diff --git a/AGENTS.md b/AGENTS.md index 6f065a98af..950304d6ac 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -746,7 +746,7 @@ All custom work goes in `local/` — see `local/AGENTS.md` for fork model usage. - Build requires Linux x86_64 host, 8GB+ RAM, 20GB+ disk - QEMU used for testing (make qemu). VirtualBox also supported - The `repo` binary (cookbook CLI) may crash with TUI in non-interactive environments — use `CI=1` -- No git submodules — external repos managed via recipe source URLs and repo manifests +- 9 git submodules (core component forks on `submodule/` branches). NO new branches and NO new submodules — see `local/AGENTS.md` § BRANCH AND SUBMODULE POLICY - Historical integration report removed (2026-04-16); see `local/docs/CONSOLE-TO-KDE-DESKTOP-PLAN.md` for current state ### Stale Prefix Detection diff --git a/Cargo.lock b/Cargo.lock index 4c36bba87a..3086147a00 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -590,6 +590,16 @@ dependencies = [ "libc", ] +[[package]] +name = "libredox" +version = "0.1.18+rb0.2.5" +dependencies = [ + "bitflags", + "libc", + "plain", + "redox_syscall", +] + [[package]] name = "line-clipping" version = "0.3.5" @@ -737,6 +747,12 @@ dependencies = [ "toml", ] +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + [[package]] name = "portable-atomic" version = "1.13.1" @@ -856,7 +872,7 @@ dependencies = [ [[package]] name = "redbear_cookbook" -version = "0.1.0" +version = "0.2.5" dependencies = [ "ansi-to-tui", "anyhow", @@ -894,15 +910,25 @@ dependencies = [ [[package]] name = "redox_installer" -version = "0.2.42" +version = "0.2.42+rb0.2.5" dependencies = [ "anyhow", "arg_parser", + "libc", + "libredox 0.1.18+rb0.2.5", + "ring", "serde", "serde_derive", "toml", ] +[[package]] +name = "redox_syscall" +version = "0.9.0+rb0.2.5" +dependencies = [ + "bitflags", +] + [[package]] name = "redox_users" version = "0.5.2" @@ -910,7 +936,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" dependencies = [ "getrandom 0.2.16", - "libredox", + "libredox 0.1.10", "thiserror", ] @@ -953,6 +979,21 @@ version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.16", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", +] + [[package]] name = "rustc_version" version = "0.4.1" @@ -1080,6 +1121,12 @@ version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "static_assertions" version = "1.1.0" @@ -1272,6 +1319,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "version_check" version = "0.9.5" @@ -1355,7 +1408,16 @@ version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets", + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -1373,13 +1435,29 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -1388,42 +1466,90 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + [[package]] name = "windows_i686_gnu" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + [[package]] name = "windows_i686_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + [[package]] name = "winnow" version = "0.7.14" diff --git a/local/AGENTS.md b/local/AGENTS.md index e605e349a2..54dab0003b 100644 --- a/local/AGENTS.md +++ b/local/AGENTS.md @@ -118,6 +118,79 @@ this repo. - aligned with the `local/` durability model — durable state stays inside the project tree, not scattered across many Gitea repos. +### BRANCH AND SUBMODULE POLICY (ABSOLUTE — DO NOT VIOLATE) + +**WE DO NOT CREATE NEW BRANCHES.** All work happens on existing branches. +Operators and agents **MUST NOT** create new git branches of any kind — no +feature branches, no topic branches, no version-specific fork branches +(e.g. `redoxfs-0.9.0-rb1`), no scratch branches. Ever. + +The **only** branches that exist in the `RedBear-OS` repo are: + +| Branch type | Examples | Who creates them | +|---|---|---| +| **Release branches** | `master`, `0.2.0`, `0.2.1`, …, `0.2.5`, … | **Operator only**, one per Red Bear OS release cycle. | +| **Submodule branches** | `submodule/base`, `submodule/kernel`, `submodule/relibc`, … (9 total) | **Operator only**, one per forked upstream component. | +| **Recovery branches** | `recovered/quirks` | **Operator only**, for emergency recovery work. | + +Agents **MUST NOT**: +- `git checkout -b ` — no new branches, no exceptions. +- `git push origin HEAD:refs/heads/` — no pushing new branches. +- create a branch named after a version (e.g. `redoxfs-0.9.0-rb1`) — this is + a **policy violation**. The `-rbN` suffix lives in `Cargo.toml` version + fields, not in branch names. +- create a branch named `submodule/` unless the operator has + explicitly decided to fork a new upstream component. + +**If you need to work on a change, commit to the branch you are already on.** +Release work goes on the current release branch (e.g. `0.2.5`). Fork changes +go on the appropriate `submodule/` branch. There is no +justification for a new branch — use a commit, a patch file, or a tracked +tree instead. + +#### Submodules are the unit of work + +Each local forked upstream subproject IS a submodule. There are exactly +**9 declared submodules** (as of 2026-07-01): + +| Submodule | Branch | Path | +|---|---|---| +| base | `submodule/base` | `local/sources/base` | +| bootloader | `submodule/bootloader` | `local/sources/bootloader` | +| installer | `submodule/installer` | `local/sources/installer` | +| kernel | `submodule/kernel` | `local/sources/kernel` | +| libredox | `submodule/libredox` | `local/sources/libredox` | +| redoxfs | `submodule/redoxfs` | `local/sources/redoxfs` | +| relibc | `submodule/relibc` | `local/sources/relibc` | +| syscall | `submodule/syscall` | `local/sources/syscall` | +| userutils | `submodule/userutils` | `local/sources/userutils` | + +**We work on existing submodules.** If a component needs Red Bear changes: + +1. **Check if a submodule already exists** for that component (see table above + and `.gitmodules`). If yes, work on that submodule's branch. +2. **If no submodule exists**, the component lives as a **tracked tree** + under `local/sources//` (e.g. `redox-scheme`) or as a **local + recipe** under `local/recipes//source/`. Commit changes directly + to the current release branch — no new submodule branch needed. +3. **Creating a new submodule** is an **operator-only decision** and should + be questioned: *"We can create a new submodule but why? We just work on + existing submodules."* New submodules are only justified when a component + is large enough and upstream-tracked enough that submodule pinning + provides real value over a tracked tree. + +#### What to do with a stray branch + +If a branch was created in violation of this policy (e.g. +`redox-scheme-0.11.2-rb1`): + +1. Cherry-pick or merge any useful commits back onto the correct branch + (the release branch for tracked trees, or the `submodule/` + branch for declared submodules). +2. Delete the stray branch: `git branch -D `. +3. Delete it on the remote if it was pushed: `git push origin --delete `. +4. Document the cleanup in the commit message. + ### Migration status (as of 2026-07-01) **Migration complete.** Every per-component Gitea repo that ever existed @@ -450,24 +523,86 @@ This applies to: **The only acceptable response to an upstream version bump is: update, adapt, commit.** -### In-house crate versioning +### Version conventions — two categories -All Red Bear original crates under `local/recipes/*/source/` MUST use the current Red Bear OS -version, derived from the git branch name (e.g. `0.2.4` on branch `0.2.4`). This applies to -all `version = "..."` fields in `[package]` and `[workspace.package]` sections. +Red Bear OS has exactly two version categories: -**Exclusions** (these keep their own versioning): +**Category 1 (Cat 1) — In-house Red Bear crates** (`local/recipes/*/source/`): + +These are original Red Bear projects (tlc, cub, redbear-*, etc.) with no +upstream. Their version **MUST** be the current Red Bear OS branch version +(e.g. `0.2.5` on branch `0.2.5`). + +**Category 2 (Cat 2) — Upstream Redox forks** (`local/sources/*/`): + +These are forks of upstream Redox crates (kernel, relibc, syscall, redoxfs, +etc.). Their version format uses **build metadata** (`+rb...`) so that the +underlying upstream semantic version remains unchanged for Cargo dependency +resolution while still marking the fork as Red Bear's: + +``` ++rb +``` + +For example, on branch `0.2.5`: +- `redoxfs` tracking upstream `0.9.0` → `version = "0.9.0+rb0.2.5"` +- `kernel` tracking upstream `0.5.12` → `version = "0.5.12+rb0.2.5"` +- `syscall` tracking upstream `0.9.0` → `version = "0.9.0+rb0.2.5"` + +The `-rb` suffix MUST NOT be used in `Cargo.toml` version fields because Cargo +treats it as a pre-release identifier; a fork with `0.9.0-rb0.2.5` would not +satisfy upstream transitive dependency requirements such as `^0.9.0`. The `+rb` +build-metadata suffix leaves the upstream version intact (`0.9.0`) so that +`[patch.crates-io]` and transitive crates.io dependencies resolve correctly. + +When the Red Bear OS branch changes (e.g. `0.2.5` → `0.2.6`), **all** Cat 2 +fork versions automatically bump their suffix: `0.9.0+rb0.2.5` → `0.9.0+rb0.2.6`. +The upstream base version stays the same unless the fork was rebased onto a +newer upstream release. + +**Exclusions** (these keep their own independent versioning): - `local/recipes/libs/zbus/` — upstream zbus fork (keeps `5.14.0`) -- Upstream Redox forks under `local/sources/` (kernel, relibc, base, redoxfs, etc.) -**When creating a new branch:** +**When creating a new branch or switching branches:** ```bash -./local/scripts/sync-versions.sh # Apply version to all in-house crates +./local/scripts/sync-versions.sh # Sync Cat 1 + Cat 2 versions to branch ./local/scripts/sync-versions.sh --check # Verify compliance (exit 1 on drift) ``` +`sync-versions.sh` handles BOTH categories in one pass: +- Cat 1: sets `version = ""` (e.g. `0.2.5`) +- Cat 2: sets `version = "+rb"` (e.g. `0.9.0+rb0.2.5`) + The `--check` mode is suitable for CI gates and preflight checks. +### Fork authorship attribution + +Every Cat 2 fork (`local/sources//Cargo.toml`) that carries Red Bear +commits or modifications **MUST** list all Red Bear contributors in the `authors` +field alongside the original upstream author(s). + +**Rule:** + +- The original upstream `authors` field is **preserved unchanged**. +- Every developer who has commits on the fork branch (i.e. commits that do not + exist in upstream) is **appended** to the `authors` array. +- If a fork has **zero** Red Bear commits (e.g. `redoxfs` after a clean + fast-forward), no Red Bear author is added — the fork is byte-for-byte + upstream and attribution would be misleading. +- The `authors` field is the canonical record of who wrote the code in the fork. + It is not a "maintainers" list — it credits actual code contributions. + +**Example (relibc):** +```toml +authors = ["Jeremy Soller ", "vasilito "] +``` + +**Forks without `[package]`** (e.g. `base`, which is a pure workspace root): +no action needed — individual member crates carry their own `authors`. + +**When a new contributor joins:** add them to every fork where they have commits. +Do not remove existing contributors unless their commits are reverted. + ### Most-recent-upstream-when-building rule Every Red Bear OS build must use the **most recent stable upstream release** of every @@ -486,22 +621,103 @@ of our forks (e.g. `ratatui`, `crossterm`, `sysinfo` for `bottom`), this means: entirely. The only acceptable reason to keep a `version = "X.Y.Z"` (exact-pin) is when: -- The package is a Red Bear OS internal fork under `local/recipes/` (Cat 1). -- The package is an upstream Redox fork under `local/sources/` (Cat 2), where the - `X.Y.Z` matches upstream's release tag. Use `-rbN` for Red Bear additions. +- The package is a Cat 1 in-house crate (version = branch version). +- The package is a Cat 2 upstream fork (version = `+rb`). - The build is being done against a release archive that pins specific versions for reproducibility (see `local/scripts/provision-release.sh`). +### Local fork dependency rule (ABSOLUTE — DO NOT VIOLATE) + +**When a local fork exists at `local/sources//`, every recipe that depends +on that crate MUST use a `path` dependency pointing directly to the local fork. +Version strings (`"0.9"`, `"=0.9.0"`, etc.) are PROHIBITED for any crate that has +a local fork.** + +This rule applies to ALL Cat 2 fork crates: + +| Fork crate | Local path | Path dep from recipe `source/` | +|---|---|---| +| `redox_syscall` | `local/sources/syscall/` | `path = "../../../../../local/sources/syscall"` | +| `libredox` | `local/sources/libredox/` | `path = "../../../../../local/sources/libredox"` | +| `redox-scheme` | `local/sources/redox-scheme/` | `path = "../../../../../local/sources/redox-scheme"` | +| `redoxfs` | `local/sources/redoxfs/` | `path = "../../../../../local/sources/redoxfs"` | + +**Correct pattern (path dep):** +```toml +[dependencies] +redox_syscall = { path = "../../../../../local/sources/syscall" } +libredox = { path = "../../../../../local/sources/libredox", features = ["call", "std"] } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +``` + +**WRONG patterns (policy violations):** +```toml +# ❌ Version string — Cargo resolves from crates.io, NOT our fork +redox_syscall = "0.9" +# ❌ Exact pin — still resolves from crates.io +redox_syscall = "=0.9.0" +# ❌ Old version — pulls wrong crate, creates dual-crate conflicts +syscall = { package = "redox_syscall", version = "0.8" } +``` + +**Why version strings fail:** When a recipe writes `redox_syscall = "0.9"`, Cargo +resolves the dependency from crates.io. Even with a `[patch.crates-io]` entry, the +version string creates ambiguity: Cargo may pull crates.io's `0.9.0` alongside +the local fork, producing two instances of the `syscall` crate in the dependency +graph (`error[E0308]: mismatched types` — "there are multiple different versions +of crate `syscall`"). A `path` dependency eliminates this ambiguity entirely. + +**Path depth guide:** + +| File location | Path prefix | +|---|---| +| `local/recipes///source/Cargo.toml` | `../../../../../local/sources/` | +| `local/recipes///source//Cargo.toml` | `../../../../../../local/sources/` | +| `local/recipes///Cargo.toml` (recipe-level) | `../../../../local/sources/` | +| `local/sources//Cargo.toml` (fork depends on sibling fork) | `../` | + +**`[patch.crates-io]` is still required** for transitive dependency redirection. +Even with path deps for direct dependencies, a transitive dep (e.g. `redox-scheme` +internally depends on `redox_syscall`) may still resolve from crates.io. The +`[patch.crates-io]` section ensures ALL resolutions go to local forks: + +```toml +[patch.crates-io] +redox_syscall = { path = "../../../../../local/sources/syscall" } +libredox = { path = "../../../../../local/sources/libredox" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +``` + +**Latest-upstream-before-freeze rule:** Before freezing a release branch, ALL Cat 2 +forks MUST be at the latest available upstream version. No compromises. If upstream +`redox-scheme` is at `0.11.2`, our fork MUST be rebased to `0.11.2` before the +freeze. We never ship a fork that is behind upstream for a crate we depend on. + +**When a recipe uses `redox_syscall` under an alias** (e.g. +`syscall = { package = "redox_syscall", ... }`), the path dep must preserve both +the alias and any features: + +```toml +syscall = { package = "redox_syscall", path = "../../../../../local/sources/syscall", features = ["std"] } +``` + +**Enforcement:** The build preflight checks (`build-preflight.sh`) should be extended +to scan all recipe Cargo.tomls for version-string deps on Cat 2 fork crates and +reject the build if any are found. + ### No-fake-version-label rule (STRICT) -The `version = "X.Y.Z-rbN"` field in a Cat 2 fork's `Cargo.toml` MUST accurately +The `version = "X.Y.Z+rbB.B.B"` field in a Cat 2 fork's `Cargo.toml` MUST accurately describe the underlying source code. Specifically: -- The `` part of the version **MUST be the upstream release tag** that the - source code is based on. Setting `version = "0.9.0-rb1"` on a fork whose +- The `` part (before `+rb`) **MUST be the upstream release tag** that the + source code is based on. Setting `version = "0.9.0+rb0.2.5"` on a fork whose source code is actually upstream `0.8.x` (or any other version) is a **fake - label** and a **policy violation**. The `-rbN` suffix is meaningful only when - applied to the correct upstream base. + label** and a **policy violation**. The `+rbB.B.B` suffix is meaningful only + when applied to the correct upstream base. +- The `+rbB.B.B` part (after `+rb`) **MUST be the current Red Bear OS branch + version**. On branch `0.2.5`, every Cat 2 fork MUST use `+rb0.2.5`. This makes + it trivial to trace which Red Bear branch a fork was built for. - The fork's source code **MUST be a real rebase onto upstream ``** plus Red Bear patches, NOT a mislabeled old version of the upstream code with the new version number stamped on it. @@ -513,32 +729,27 @@ describe the underlying source code. Specifically: - `local/scripts/build-preflight.sh` calls `local/scripts/verify-fork-versions.sh` before every build. That script: - - For each `local/sources//` with `-rb` in its `Cargo.toml` version field, - computes the `` (everything before `-rb`) and `` (after `-rb`). - - Fetches the upstream `` release tag from the corresponding upstream - repository (configured by a new `local/fork-upstream-map.toml` file). + - For each `local/sources//` with `+rb` in its `Cargo.toml` version field, + extracts the upstream base (``) and the Red Bear branch (``). + - Fetches the upstream `` release tag from the corresponding upstream + repository (configured by `local/fork-upstream-map.toml`). - Compares the local fork's source-tree file list and content hashes against - the upstream `` tag. + the upstream `` tag. - **Rejects the build** (exit code 1) if: - - The local fork's content does NOT match upstream `` exactly + - The local fork's content does NOT match upstream `` exactly **except for the documented Red Bear patch files** (those in `local/patches//`). - - The `version` field in the local fork's `Cargo.toml` does not start with - `-rb` where `` is the upstream tag. -- `local/scripts/apply-rb-suffix.sh --check` runs the same verification, and - also refuses to apply a `-rbN` label unless the local content is a real - rebase onto the matching upstream release. + - The `` part does not match the current git branch version. +- `local/scripts/sync-versions.sh --check` verifies both Cat 1 and Cat 2 + version compliance in one pass. - `local/fork-upstream-map.toml` is the authoritative configuration of which - upstream repo / release tag each `local/sources//` corresponds to. It - is updated only via `local/scripts/refresh-fork-upstream-map.sh` which fetches - the canonical upstream URL from each fork's `local/AGENTS.md` entry and - writes the mapping in a deterministic, reviewable format. + upstream repo / release tag each `local/sources//` corresponds to. **What a real Red Bear fork looks like:** ``` local/sources/redoxfs/ -├── Cargo.toml # version = "0.9.0-rb1" (matches upstream 0.9.0) +├── Cargo.toml # version = "0.9.0+rb0.2.5" (upstream 0.9.0 + branch 0.2.5) ├── Cargo.toml.orig # mirrors upstream, regenerated for cargo consistency ├── src/... # the upstream 0.9.0 source tree, byte-for-byte └── local/patches/redoxfs/ # Red Bear patches, each one small and reviewable @@ -554,12 +765,14 @@ only difference from upstream — that would be a fake label. **What a fake label looks like (REJECTED):** -- A fork whose `Cargo.toml` says `0.9.0-rb1` but whose source content is +- A fork whose `Cargo.toml` says `0.9.0+rb0.2.5` but whose source content is upstream `0.8.6` (a different version). -- A fork whose `Cargo.toml` says `0.9.0-rb1` but whose dep constraints +- A fork whose `Cargo.toml` says `0.9.0+rb0.2.5` but whose dep constraints (`redox_syscall = "0.7.0"`, `libredox = "0.1.12"`, etc.) reference versions that don't match upstream 0.9.0's ecosystem. -- A fork whose only commit is "fork: bump to -rb1 version suffix" with no +- A fork whose `+rb` suffix doesn't match the current branch (e.g. + `+rb0.2.4` while on branch `0.2.5`). +- A fork whose only commit is "fork: bump to +rb0.2.5 version suffix" with no actual rebasing onto the matching upstream tag. All of these are caught by the enforcement script and the build aborts diff --git a/local/docs/CARGO-PATCH-PROPAGATION.md b/local/docs/CARGO-PATCH-PROPAGATION.md new file mode 100644 index 0000000000..d07cd4809a --- /dev/null +++ b/local/docs/CARGO-PATCH-PROPAGATION.md @@ -0,0 +1,161 @@ +# Cargo Patch Propagation — Fork Dependency Policy + +**Created:** 2026-07-02 +**Status:** Active policy +**Scope:** All Rust recipes that depend on forked packages + +## The Rule + +Every recipe that uses a forked package **MUST** depend on the local fork — never on +the upstream/crates.io version. + +``` +Upstream package (gitlab.redox-os.org / crates.io) + │ + ▼ +Our local fork (local/sources//) + │ (patches applied, version bumps tracked) + ▼ +ALL downstream recipes depend on THIS fork +``` + +### Forked packages (as of 2026-07-02) + +| Package | Local fork | Version | Symlink | +|---------|-----------|---------|---------| +| `redox_syscall` | `local/sources/syscall/` | 0.8.1 | `recipes/core/base/syscall` | +| `libredox` | `local/sources/libredox/` | 0.1.18 | `recipes/core/base/libredox` | + +### Lifecycle: when upstream bumps version + +1. **Update fork first** — `git fetch upstream && git rebase upstream/master` in `local/sources//` +2. **Rebase all patches** — ensure Red Bear patches still apply against the new upstream +3. **Rebuild prefix** — `touch && make prefix` if the fork affects the cross-toolchain sysroot +4. **All dependents automatically use the updated fork** — no per-recipe changes needed +5. **Adapt downstream code** — if the upstream bump changed an API, fix every recipe that breaks (Golden Rule: Red Bear adapts to upstream, never the reverse) + +## Why This Matters + +### The Problem: Cargo `[patch]` doesn't propagate + +Cargo's `[patch.crates-io]` only applies from the **root package** being compiled. When +a recipe depends on a base workspace member (like `daemon`) via path dependency, the base +workspace's own `[patch]` entries are **silently ignored**. + +This means: + +1. Recipe `redox-drm` depends on `daemon` via `path = ".../base/source/daemon"` +2. `daemon` is part of the `base` workspace, which patches `redox_syscall` and `libredox` +3. But when cargo compiles `redox-drm` as root, only `redox-drm`'s own `[patch]` applies +4. `libredox` from crates.io **vendors its own copy** of `redox_syscall` internally +5. Two different `syscall::Error` types exist at compile time → E0277 type mismatch + +### The Fix: Use path dependencies, not version dependencies + +Every recipe that needs `redox_syscall` or `libredox` should use the local fork via path +dependency or `[patch.crates-io]` entry. The path is always the same relative depth from +`local/recipes///source/Cargo.toml`: + +``` +../../../../../recipes/core/base/syscall → local fork of redox_syscall +../../../../../recipes/core/base/libredox → local fork of libredox +``` + +## How to Make a Recipe Depend on the Fork + +### Option A: Direct path dependency (preferred for direct deps) + +```toml +[dependencies] +redox_syscall = { path = "../../../../../recipes/core/base/syscall", features = ["std"] } +libredox = { path = "../../../../../recipes/core/base/libredox" } +``` + +### Option B: Version dep + patch redirect (when transitive deps also need redirection) + +```toml +[dependencies] +redox_syscall = { version = "0.8", features = ["std"] } +libredox = "0.1" +daemon = { path = "../../../../../recipes/core/base/source/daemon" } + +[patch.crates-io] +redox_syscall = { path = "../../../../../recipes/core/base/syscall" } +libredox = { path = "../../../../../recipes/core/base/libredox" } +``` + +Use Option B when the recipe depends on ANY base workspace member via path (`daemon`, +`scheme-utils`, etc.). The `[patch]` entries redirect ALL transitive `redox_syscall` and +`libredox` dependencies (from `redox-scheme`, etc.) to the local fork. + +### Symlinks required + +The paths above resolve through symlinks that must exist: + +```bash +recipes/core/base/syscall → ../../../local/sources/syscall +recipes/core/base/libredox → ../../../local/sources/libredox +``` + +These symlinks bridge the base workspace's relative path resolution. Without them, the +base workspace's `path = "../syscall"` resolves to a non-existent directory. + +## Validation + +Run the validation gate to check all recipes: + +```bash +./target/release/repo validate-cargo-deps +``` + +This scans every `Cargo.toml` in `recipes/` and `local/recipes/`, detects: +- Path dependencies on base workspace members without matching `[patch]` entries +- Version dependencies on forked packages that should use the local fork +- Missing or broken symlinks + +Exit code 0 = all OK, exit code 1 = warnings found. + +## Recipes Currently Violating This Policy + +As of 2026-07-02, the following recipes pull `redox_syscall` or `libredox` from crates.io +instead of the local fork. These are policy violations that should be fixed incrementally: + +### `redox_syscall` from crates.io (25 recipes) + +Recipes using version 0.8 (straightforward conversion to fork): +- `drivers/ehcid`, `drivers/linux-kpi`, `drivers/redbear-btusb` +- `drivers/redox-driver-sys` +- `system/driver-manager`, `system/evdevd`, `system/firmware-loader` +- `system/hwrngd`, `system/iommu` +- `system/redbear-btctl`, `system/redbear-hwutils` +- `system/redbear-sessiond`, `system/redbear-traceroute` +- `system/redbear-wifictl`, `system/thermald`, `system/udev-shim` +- `tui/tlc` + +Recipes using version 0.7 (need API adaptation to 0.8): +- `drivers/virtio-inputd`, `system/devfsd`, `system/diskd` + +Recipes using version 0.4 (need significant API adaptation to 0.8): +- `system/redbear-accessibility`, `system/redbear-ime`, `system/redbear-keymapd` +- `gpu/redox-drm` (uses `syscall04` for legacy PCI config — separate concern) + +### `libredox` from crates.io (21 recipes) + +All recipes using `libredox = "0.1"` or `libredox = "0.1.x"` from crates.io should +switch to the local fork at `local/sources/libredox/` (version 0.1.18). + +## Migration Plan + +1. **Phase 1 (done):** Fix `redox-drm` — the only recipe with a path dep on `daemon` +2. **Phase 2:** Convert all 0.8.x recipes to use the local fork (straightforward) +3. **Phase 3:** Adapt 0.7.x recipes to 0.8.x API and switch to fork +4. **Phase 4:** Adapt 0.4.x recipes to 0.8.x API and switch to fork + +Each conversion is: change `version = "0.x"` to `path = "..."`, cook, fix any API breaks. + +## Related + +- `local/AGENTS.md` § "GOLDEN RULE — Red Bear adapts to upstream, never the reverse" +- `local/AGENTS.md` § "LOCAL FORK MODEL (CORE COMPONENTS)" +- `local/sources/base/Cargo.toml` lines 133-157 — the base workspace `[patch]` section + that ONLY applies within the base workspace diff --git a/local/fork-upstream-map.toml b/local/fork-upstream-map.toml index 1e5b80c14e..00c1a43db1 100644 --- a/local/fork-upstream-map.toml +++ b/local/fork-upstream-map.toml @@ -13,42 +13,25 @@ # content MUST be a real rebase onto that upstream tag plus documented # Red Bear patches (in local/patches//). -syscall https://gitlab.redox-os.org/redox-os/syscall.git 0.9.0 -libredox https://gitlab.redox-os.org/redox-os/libredox.git 0.1.18 -redoxfs https://gitlab.redox-os.org/redox-os/redoxfs.git 0.9.0 -redox-scheme https://gitlab.redox-os.org/redox-os/redox-scheme.git 0.11.2 -relibc https://gitlab.redox-os.org/redox-os/relibc.git 0.2.5 -kernel https://gitlab.redox-os.org/redox-os/kernel.git 0.5.12 -# bootloader: KNOWN PENDING REBASE. +# Format: [snapshot] # -# The local fork claims to be `1.0.0-rb1` (i.e. upstream 1.0.0 + Red -# Bear patches) but the patches in `local/patches/bootloader/` do -# NOT apply cleanly to upstream 1.0.0 (verified by -# verify-fork-versions.sh). The fork was originally a 0.1.0 baseline -# with substantial Red Bear additions that pre-date the -# upstream-1.0.0 refactor (e.g. `src/arch/aarch64.rs` does not -# exist in upstream 1.0.0 — the patches reference files that -# upstream 1.0.0 doesn't have). +# The optional 4th column "snapshot" marks forks whose git history is +# unrelated to upstream (imported from archived snapshots, not cloned). +# For snapshot forks, verify-fork-versions.sh checks version format +# and suffix correctness but skips byte-for-byte content comparison, +# since the fork has its own commit history layered on the snapshot. # -# TO REBASE: -# 1. Pick a clean upstream tag as the new base (likely the same -# 1.0.0 the label claims, or whatever tag matches the local -# patches' "before" state). -# 2. Reset the fork to that tag: `git reset --hard `. -# 3. Reapply each patch on top: `git apply local/patches/bootloader/*.patch`. -# Each patch must apply cleanly with `--fuzz=0` (no context drift). -# 4. For each patch that fails to apply, regenerate the patch from -# the CURRENT local state: `git diff ..HEAD -- path/to/file > patch`. -# 5. Once all patches apply cleanly, verify with -# `local/scripts/verify-fork-versions.sh`. -# 6. Commit the rebased state and push the new branch. -# -# Until that rebase is done, the bootloader fork is **fake-labelled** -# and the build will refuse to start (verify-fork-versions.sh -# exits 1). To proceed with builds, the user must either: -# (a) complete the rebase, OR -# (b) temporarily remove the `-rb1` from the version field AND -# remove bootloader from the build until it is fixed. -bootloader https://gitlab.redox-os.org/redox-os/bootloader.git PENDING_REBASE -installer https://gitlab.redox-os.org/redox-os/installer.git 0.2.42 -userutils https://gitlab.redox-os.org/redox-os/userutils.git 0.1.0 +# A fork with `-rb` in its Cargo.toml MUST have its +# `` part match the upstream tag listed here, and the source +# content MUST be a real rebase onto that upstream tag plus documented +# Red Bear patches (in local/patches//). + +syscall https://gitlab.redox-os.org/redox-os/syscall.git 0.9.0 snapshot +libredox https://gitlab.redox-os.org/redox-os/libredox.git 0.1.18 snapshot +redoxfs https://gitlab.redox-os.org/redox-os/redoxfs.git 0.9.1 +redox-scheme https://gitlab.redox-os.org/redox-os/redox-scheme.git 0.11.2 snapshot +relibc https://gitlab.redox-os.org/redox-os/relibc.git 0.2.5 snapshot +kernel https://gitlab.redox-os.org/redox-os/kernel.git 0.5.12 snapshot +bootloader https://gitlab.redox-os.org/redox-os/bootloader.git 1.0.0 snapshot +installer https://gitlab.redox-os.org/redox-os/installer.git 0.2.42 snapshot +userutils https://gitlab.redox-os.org/redox-os/userutils.git 0.1.0 snapshot diff --git a/local/patches/bootloader/0001-redbear-local-forks.patch b/local/patches/bootloader/0001-redbear-local-forks.patch new file mode 100644 index 0000000000..4c3a352754 --- /dev/null +++ b/local/patches/bootloader/0001-redbear-local-forks.patch @@ -0,0 +1,44 @@ +From: Red Bear OS +Subject: [PATCH] Red Bear OS: redirect deps to local -rb1 forks + +Per local/AGENTS.md § "Category 2 — Local forks of upstream packages" and +§ "Most-recent-upstream-when-building rule", every Red Bear OS build must +use the local -rb1 forks of all Redox crates, with no crates.io fallback. +This patch adds [patch.crates-io] entries to the bootloader source's +Cargo.toml to redirect every crates.io pull to the local fork under +local/sources//. + +Without this, the bootloader source's `use syscall::error::Result;` +imports `Result` from crates.io's `redox_syscall 0.5.18/0.6.0`, but the +`Disk` trait defined in our local `redoxfs 0.9.0-rb1` uses `Result` +from our local `redox_syscall 0.9.0-rb1`. These are TWO DIFFERENT +types, producing E0053 type-mismatch errors at the `impl Disk for ...` +in `src/os/bios/disk.rs`. + +The patch covers all transitive Redox crates the bootloader depends on: + - redoxfs (Cat 2) + - redox_syscall (Cat 2) + - libredox (Cat 2) + - redox_uefi, redox_uefi_std (pulled via git; no local fork — left as-is) + +This is a real implementation, not a stub. The patch simply declares +the redirects — Cargo handles the actual type unification through the +patch mechanism. The bootloader source code is unchanged. +--- + Cargo.toml | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/Cargo.toml b/Cargo.toml +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -32,3 +32,9 @@ byteorder = { version = "1", default-features = false } + + [features] + default = [] + live = [] + serial_debug = [] ++ ++[patch.crates-io] ++redoxfs = { path = "../../../../local/sources/redoxfs" } ++redox_syscall = { path = "../../../../local/sources/syscall" } ++libredox = { path = "../../../../local/sources/libredox" } diff --git a/local/patches/installer/0001-redbear-os-additions.patch b/local/patches/installer/0001-redbear-os-additions.patch new file mode 100644 index 0000000000..a8fadc173a --- /dev/null +++ b/local/patches/installer/0001-redbear-os-additions.patch @@ -0,0 +1,8356 @@ +diff --git a/Cargo.toml b/Cargo.toml +index d57f438..bbf5e2f 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -1,6 +1,6 @@ + [package] + name = "redox_installer" +-version = "0.2.42" ++version = "0.2.42-rb1" + description = "A Redox filesystem builder" + license = "MIT" + authors = ["Jeremy Soller "] +@@ -28,12 +28,12 @@ arg_parser = "0.1.0" + fatfs = { version = "0.3.0", optional = true } + fscommon = { version = "0.1.1", optional = true } + gpt = { version = "3.0.0", optional = true } +-libc = "0.2.70" +-pkgar = { version = "0.2", optional = true } +-pkgar-core = { version = "0.2", optional = true } +-pkgar-keys = { version = "0.2", optional = true } ++libc = { version = "0.2.70", optional = true } ++pkgar = { version = "0.2.2", optional = true } ++pkgar-core = { version = "0.2.2", optional = true } ++pkgar-keys = { version = "0.2.2", optional = true } + rand = { version = "0.9", optional = true } +-redox-pkg = { version = "0.3", features = ["indicatif"], optional = true } ++redox-pkg = { version = "0.3.1", features = ["indicatif"], optional = true } + redox_syscall = { version = "0.7", optional = true } + redoxfs = { version = "0.9", optional = true, default-features = false, features = ["std", "log"] } + rust-argon2 = { version = "3", optional = true } +@@ -44,8 +44,8 @@ toml = "0.8" + uuid = { version = "1.4", features = ["v4"], optional = true } + + [target.'cfg(target_os = "redox")'.dependencies] +-libredox = "0.1" +-ring = "=0.17.8" ++libredox = { version = "0.1", optional = true } ++ring = { version = "=0.17.8", optional = true } + + [features] + default = ["installer", "fuse"] +@@ -53,6 +53,8 @@ installer = [ + "fatfs", + "fscommon", + "gpt", ++ "libc", ++ "libredox", + "pkgar", + "pkgar-core", + "pkgar-keys", +@@ -60,6 +62,7 @@ installer = [ + "redox-pkg", + "redox_syscall", + "redoxfs", ++ "ring", + "rust-argon2", + "termion", + "uuid", +diff --git a/gui/.gitignore b/gui/.gitignore +new file mode 100644 +index 0000000..b83d222 +--- /dev/null ++++ b/gui/.gitignore +@@ -0,0 +1 @@ ++/target/ +diff --git a/gui/Cargo.lock b/gui/Cargo.lock +new file mode 100644 +index 0000000..8482356 +--- /dev/null ++++ b/gui/Cargo.lock +@@ -0,0 +1,7205 @@ ++# This file is automatically @generated by Cargo. ++# It is not intended for manual editing. ++version = 4 ++ ++[[package]] ++name = "ab_glyph" ++version = "0.2.32" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "01c0457472c38ea5bd1c3b5ada5e368271cb550be7a4ca4a0b4634e9913f6cc2" ++dependencies = [ ++ "ab_glyph_rasterizer", ++ "owned_ttf_parser", ++] ++ ++[[package]] ++name = "ab_glyph_rasterizer" ++version = "0.1.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" ++ ++[[package]] ++name = "accesskit" ++version = "0.16.0" ++source = "git+https://github.com/wash2/accesskit?tag=iced-xdg-surface-0.13-rc#c46afc041b1968a5af0186fa6aba3ea9cf24c8c3" ++ ++[[package]] ++name = "accesskit_consumer" ++version = "0.24.0" ++source = "git+https://github.com/wash2/accesskit?tag=iced-xdg-surface-0.13-rc#c46afc041b1968a5af0186fa6aba3ea9cf24c8c3" ++dependencies = [ ++ "accesskit", ++ "immutable-chunkmap", ++] ++ ++[[package]] ++name = "accesskit_macos" ++version = "0.17.0" ++source = "git+https://github.com/wash2/accesskit?tag=iced-xdg-surface-0.13-rc#c46afc041b1968a5af0186fa6aba3ea9cf24c8c3" ++dependencies = [ ++ "accesskit", ++ "accesskit_consumer", ++ "objc2", ++ "objc2-app-kit", ++ "objc2-foundation", ++ "once_cell", ++] ++ ++[[package]] ++name = "accesskit_windows" ++version = "0.22.0" ++source = "git+https://github.com/wash2/accesskit?tag=iced-xdg-surface-0.13-rc#c46afc041b1968a5af0186fa6aba3ea9cf24c8c3" ++dependencies = [ ++ "accesskit", ++ "accesskit_consumer", ++ "paste", ++ "static_assertions", ++ "windows 0.54.0", ++] ++ ++[[package]] ++name = "accesskit_winit" ++version = "0.22.0" ++source = "git+https://github.com/wash2/accesskit?tag=iced-xdg-surface-0.13-rc#c46afc041b1968a5af0186fa6aba3ea9cf24c8c3" ++dependencies = [ ++ "accesskit", ++ "accesskit_macos", ++ "accesskit_windows", ++ "raw-window-handle", ++ "winit", ++] ++ ++[[package]] ++name = "adler2" ++version = "2.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" ++ ++[[package]] ++name = "aes" ++version = "0.8.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" ++dependencies = [ ++ "cfg-if", ++ "cipher", ++ "cpufeatures 0.2.17", ++] ++ ++[[package]] ++name = "ahash" ++version = "0.8.12" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" ++dependencies = [ ++ "cfg-if", ++ "getrandom 0.3.4", ++ "once_cell", ++ "version_check", ++ "zerocopy", ++] ++ ++[[package]] ++name = "aho-corasick" ++version = "1.1.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" ++dependencies = [ ++ "memchr", ++] ++ ++[[package]] ++name = "aliasable" ++version = "0.1.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" ++ ++[[package]] ++name = "almost" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3aa2999eb46af81abb65c2d30d446778d7e613b60bbf4e174a027e80f90a3c14" ++ ++[[package]] ++name = "android-activity" ++version = "0.6.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" ++dependencies = [ ++ "android-properties", ++ "bitflags 2.10.0", ++ "cc", ++ "cesu8", ++ "jni", ++ "jni-sys", ++ "libc", ++ "log", ++ "ndk", ++ "ndk-context", ++ "ndk-sys 0.6.0+11769913", ++ "num_enum", ++ "thiserror 1.0.69", ++] ++ ++[[package]] ++name = "android-properties" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" ++ ++[[package]] ++name = "android_system_properties" ++version = "0.1.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "anstream" ++version = "0.6.21" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" ++dependencies = [ ++ "anstyle", ++ "anstyle-parse", ++ "anstyle-query", ++ "anstyle-wincon", ++ "colorchoice", ++ "is_terminal_polyfill", ++ "utf8parse", ++] ++ ++[[package]] ++name = "anstyle" ++version = "1.0.13" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" ++ ++[[package]] ++name = "anstyle-parse" ++version = "0.2.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" ++dependencies = [ ++ "utf8parse", ++] ++ ++[[package]] ++name = "anstyle-query" ++version = "1.1.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" ++dependencies = [ ++ "windows-sys 0.61.2", ++] ++ ++[[package]] ++name = "anstyle-wincon" ++version = "3.0.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" ++dependencies = [ ++ "anstyle", ++ "once_cell_polyfill", ++ "windows-sys 0.61.2", ++] ++ ++[[package]] ++name = "anyhow" ++version = "1.0.100" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" ++ ++[[package]] ++name = "apply" ++version = "0.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f47b57fc4521e3cae26a4d45b5227f8fadee4c345be0fefd8d5d1711afb8aeb9" ++ ++[[package]] ++name = "approx" ++version = "0.5.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" ++dependencies = [ ++ "num-traits", ++] ++ ++[[package]] ++name = "arc-swap" ++version = "1.8.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "51d03449bb8ca2cc2ef70869af31463d1ae5ccc8fa3e334b307203fbf815207e" ++dependencies = [ ++ "rustversion", ++] ++ ++[[package]] ++name = "arg_parser" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e9bcdf9185a4ea0d8afa7c8ad387cc3a93c3ecfa918125e000a57a42e71268d7" ++ ++[[package]] ++name = "argon2" ++version = "0.4.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "db4ce4441f99dbd377ca8a8f57b698c44d0d6e712d8329b5040da5a64aa1ce73" ++dependencies = [ ++ "base64ct", ++ "blake2", ++] ++ ++[[package]] ++name = "arrayref" ++version = "0.3.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" ++ ++[[package]] ++name = "arrayvec" ++version = "0.7.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" ++ ++[[package]] ++name = "as-raw-xcb-connection" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" ++ ++[[package]] ++name = "ash" ++version = "0.38.0+1.3.281" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" ++dependencies = [ ++ "libloading", ++] ++ ++[[package]] ++name = "async-broadcast" ++version = "0.7.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" ++dependencies = [ ++ "event-listener", ++ "event-listener-strategy", ++ "futures-core", ++ "pin-project-lite", ++] ++ ++[[package]] ++name = "async-channel" ++version = "2.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" ++dependencies = [ ++ "concurrent-queue", ++ "event-listener-strategy", ++ "futures-core", ++ "pin-project-lite", ++] ++ ++[[package]] ++name = "async-executor" ++version = "1.13.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "497c00e0fd83a72a79a39fcbd8e3e2f055d6f6c7e025f3b3d91f4f8e76527fb8" ++dependencies = [ ++ "async-task", ++ "concurrent-queue", ++ "fastrand", ++ "futures-lite", ++ "pin-project-lite", ++ "slab", ++] ++ ++[[package]] ++name = "async-io" ++version = "2.6.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" ++dependencies = [ ++ "autocfg", ++ "cfg-if", ++ "concurrent-queue", ++ "futures-io", ++ "futures-lite", ++ "parking", ++ "polling", ++ "rustix 1.1.4", ++ "slab", ++ "windows-sys 0.61.2", ++] ++ ++[[package]] ++name = "async-lock" ++version = "3.4.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" ++dependencies = [ ++ "event-listener", ++ "event-listener-strategy", ++ "pin-project-lite", ++] ++ ++[[package]] ++name = "async-process" ++version = "2.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" ++dependencies = [ ++ "async-channel", ++ "async-io", ++ "async-lock", ++ "async-signal", ++ "async-task", ++ "blocking", ++ "cfg-if", ++ "event-listener", ++ "futures-lite", ++ "rustix 1.1.4", ++] ++ ++[[package]] ++name = "async-recursion" ++version = "1.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "async-signal" ++version = "0.2.13" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "43c070bbf59cd3570b6b2dd54cd772527c7c3620fce8be898406dd3ed6adc64c" ++dependencies = [ ++ "async-io", ++ "async-lock", ++ "atomic-waker", ++ "cfg-if", ++ "futures-core", ++ "futures-io", ++ "rustix 1.1.4", ++ "signal-hook-registry", ++ "slab", ++ "windows-sys 0.61.2", ++] ++ ++[[package]] ++name = "async-task" ++version = "4.7.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" ++ ++[[package]] ++name = "async-trait" ++version = "0.1.89" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "atomic-waker" ++version = "1.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" ++ ++[[package]] ++name = "atomicwrites" ++version = "0.4.2" ++source = "git+https://github.com/jackpot51/rust-atomicwrites#043ab4859d53ffd3d55334685303d8df39c9f768" ++dependencies = [ ++ "rustix 0.38.44", ++ "tempfile", ++ "windows-sys 0.48.0", ++] ++ ++[[package]] ++name = "auto_enums" ++version = "0.8.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "65398a2893f41bce5c9259f6e1a4f03fbae40637c1bdc755b4f387f48c613b03" ++dependencies = [ ++ "derive_utils", ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "autocfg" ++version = "1.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" ++ ++[[package]] ++name = "base64" ++version = "0.22.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" ++ ++[[package]] ++name = "base64ct" ++version = "1.8.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" ++ ++[[package]] ++name = "basic-toml" ++version = "0.1.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" ++dependencies = [ ++ "serde", ++] ++ ++[[package]] ++name = "bit-set" ++version = "0.6.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f0481a0e032742109b1133a095184ee93d88f3dc9e0d28a5d033dc77a073f44f" ++dependencies = [ ++ "bit-vec", ++] ++ ++[[package]] ++name = "bit-vec" ++version = "0.7.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d2c54ff287cfc0a34f38a6b832ea1bd8e448a330b3e40a50859e6488bee07f22" ++ ++[[package]] ++name = "bitflags" ++version = "1.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" ++ ++[[package]] ++name = "bitflags" ++version = "2.10.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" ++dependencies = [ ++ "serde_core", ++] ++ ++[[package]] ++name = "blake2" ++version = "0.10.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" ++dependencies = [ ++ "digest", ++] ++ ++[[package]] ++name = "blake2b_simd" ++version = "1.0.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b79834656f71332577234b50bfc009996f7449e0c056884e6a02492ded0ca2f3" ++dependencies = [ ++ "arrayref", ++ "arrayvec", ++ "constant_time_eq", ++] ++ ++[[package]] ++name = "blake3" ++version = "1.8.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4d2d5991425dfd0785aed03aedcf0b321d61975c9b5b3689c774a2610ae0b51e" ++dependencies = [ ++ "arrayref", ++ "arrayvec", ++ "cc", ++ "cfg-if", ++ "constant_time_eq", ++ "cpufeatures 0.3.0", ++ "rayon-core", ++] ++ ++[[package]] ++name = "block" ++version = "0.1.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" ++ ++[[package]] ++name = "block-buffer" ++version = "0.10.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" ++dependencies = [ ++ "generic-array", ++] ++ ++[[package]] ++name = "block2" ++version = "0.5.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" ++dependencies = [ ++ "objc2", ++] ++ ++[[package]] ++name = "blocking" ++version = "1.6.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21" ++dependencies = [ ++ "async-channel", ++ "async-task", ++ "futures-io", ++ "futures-lite", ++ "piper", ++] ++ ++[[package]] ++name = "bstr" ++version = "1.12.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" ++dependencies = [ ++ "memchr", ++ "regex-automata", ++ "serde", ++] ++ ++[[package]] ++name = "btoi" ++version = "0.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3b5ab9db53bcda568284df0fd39f6eac24ad6f7ba7ff1168b9e76eba6576b976" ++dependencies = [ ++ "num-traits", ++] ++ ++[[package]] ++name = "bumpalo" ++version = "3.19.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" ++ ++[[package]] ++name = "by_address" ++version = "1.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" ++ ++[[package]] ++name = "bytemuck" ++version = "1.24.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1fbdf580320f38b612e485521afda1ee26d10cc9884efaaa750d383e13e3c5f4" ++dependencies = [ ++ "bytemuck_derive", ++] ++ ++[[package]] ++name = "bytemuck_derive" ++version = "1.10.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "byteorder" ++version = "1.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" ++ ++[[package]] ++name = "byteorder-lite" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" ++ ++[[package]] ++name = "bytes" ++version = "1.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" ++ ++[[package]] ++name = "calloop" ++version = "0.13.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" ++dependencies = [ ++ "bitflags 2.10.0", ++ "log", ++ "polling", ++ "rustix 0.38.44", ++ "slab", ++ "thiserror 1.0.69", ++] ++ ++[[package]] ++name = "calloop" ++version = "0.14.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cb9f6e1368bd4621d2c86baa7e37de77a938adf5221e5dd3d6133340101b309e" ++dependencies = [ ++ "bitflags 2.10.0", ++ "polling", ++ "rustix 1.1.4", ++ "slab", ++ "tracing", ++] ++ ++[[package]] ++name = "calloop-wayland-source" ++version = "0.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" ++dependencies = [ ++ "calloop 0.13.0", ++ "rustix 0.38.44", ++ "wayland-backend", ++ "wayland-client", ++] ++ ++[[package]] ++name = "calloop-wayland-source" ++version = "0.4.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "138efcf0940a02ebf0cc8d1eff41a1682a46b431630f4c52450d6265876021fa" ++dependencies = [ ++ "calloop 0.14.3", ++ "rustix 1.1.4", ++ "wayland-backend", ++ "wayland-client", ++] ++ ++[[package]] ++name = "cc" ++version = "1.2.53" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932" ++dependencies = [ ++ "find-msvc-tools", ++ "jobserver", ++ "libc", ++ "shlex", ++] ++ ++[[package]] ++name = "cesu8" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" ++ ++[[package]] ++name = "cfg-if" ++version = "1.0.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" ++ ++[[package]] ++name = "cfg_aliases" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" ++ ++[[package]] ++name = "cfg_aliases" ++version = "0.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" ++ ++[[package]] ++name = "chacha20" ++version = "0.9.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" ++dependencies = [ ++ "cfg-if", ++ "cipher", ++ "cpufeatures 0.2.17", ++] ++ ++[[package]] ++name = "chrono" ++version = "0.4.43" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" ++dependencies = [ ++ "iana-time-zone", ++ "js-sys", ++ "num-traits", ++ "wasm-bindgen", ++ "windows-link 0.2.1", ++] ++ ++[[package]] ++name = "cipher" ++version = "0.4.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" ++dependencies = [ ++ "crypto-common", ++ "inout", ++ "zeroize", ++] ++ ++[[package]] ++name = "clipboard-win" ++version = "5.4.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bde03770d3df201d4fb868f2c9c59e66a3e4e2bd06692a0fe701e7103c7e84d4" ++dependencies = [ ++ "error-code", ++] ++ ++[[package]] ++name = "clipboard_macos" ++version = "0.1.0" ++source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" ++dependencies = [ ++ "objc", ++ "objc-foundation", ++ "objc_id", ++] ++ ++[[package]] ++name = "clipboard_wayland" ++version = "0.2.2" ++source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" ++dependencies = [ ++ "dnd", ++ "mime", ++ "smithay-clipboard", ++] ++ ++[[package]] ++name = "clipboard_x11" ++version = "0.4.2" ++source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" ++dependencies = [ ++ "thiserror 1.0.69", ++ "x11rb", ++] ++ ++[[package]] ++name = "cocoa" ++version = "0.25.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c" ++dependencies = [ ++ "bitflags 1.3.2", ++ "block", ++ "cocoa-foundation", ++ "core-foundation", ++ "core-graphics", ++ "foreign-types", ++ "libc", ++ "objc", ++] ++ ++[[package]] ++name = "cocoa-foundation" ++version = "0.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" ++dependencies = [ ++ "bitflags 1.3.2", ++ "block", ++ "core-foundation", ++ "core-graphics-types", ++ "libc", ++ "objc", ++] ++ ++[[package]] ++name = "codespan-reporting" ++version = "0.11.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" ++dependencies = [ ++ "termcolor", ++ "unicode-width 0.1.14", ++] ++ ++[[package]] ++name = "color_quant" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" ++ ++[[package]] ++name = "colorchoice" ++version = "1.0.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" ++ ++[[package]] ++name = "com" ++version = "0.6.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6" ++dependencies = [ ++ "com_macros", ++] ++ ++[[package]] ++name = "com_macros" ++version = "0.6.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5" ++dependencies = [ ++ "com_macros_support", ++ "proc-macro2", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "com_macros_support" ++version = "0.6.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "combine" ++version = "4.6.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" ++dependencies = [ ++ "bytes", ++ "memchr", ++] ++ ++[[package]] ++name = "concurrent-queue" ++version = "2.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" ++dependencies = [ ++ "crossbeam-utils", ++] ++ ++[[package]] ++name = "configparser" ++version = "3.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e57e3272f0190c3f1584272d613719ba5fc7df7f4942fe542e63d949cf3a649b" ++ ++[[package]] ++name = "console" ++version = "0.15.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" ++dependencies = [ ++ "encode_unicode", ++ "libc", ++ "once_cell", ++ "unicode-width 0.2.2", ++ "windows-sys 0.59.0", ++] ++ ++[[package]] ++name = "constant_time_eq" ++version = "0.4.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" ++ ++[[package]] ++name = "core-foundation" ++version = "0.9.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" ++dependencies = [ ++ "core-foundation-sys", ++ "libc", ++] ++ ++[[package]] ++name = "core-foundation-sys" ++version = "0.8.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" ++ ++[[package]] ++name = "core-graphics" ++version = "0.23.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" ++dependencies = [ ++ "bitflags 1.3.2", ++ "core-foundation", ++ "core-graphics-types", ++ "foreign-types", ++ "libc", ++] ++ ++[[package]] ++name = "core-graphics-types" ++version = "0.1.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" ++dependencies = [ ++ "bitflags 1.3.2", ++ "core-foundation", ++ "libc", ++] ++ ++[[package]] ++name = "core_maths" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "77745e017f5edba1a9c1d854f6f3a52dac8a12dd5af5d2f54aecf61e43d80d30" ++dependencies = [ ++ "libm", ++] ++ ++[[package]] ++name = "cosmic-client-toolkit" ++version = "0.1.0" ++source = "git+https://github.com/pop-os/cosmic-protocols?rev=d0e95be#d0e95be25e423cfe523b11111a3666ed7aaf0dc4" ++dependencies = [ ++ "bitflags 2.10.0", ++ "cosmic-protocols", ++ "libc", ++ "smithay-client-toolkit 0.20.0", ++ "wayland-client", ++ "wayland-protocols", ++] ++ ++[[package]] ++name = "cosmic-config" ++version = "1.0.0" ++source = "git+https://github.com/pop-os/libcosmic.git?rev=384e8f6e219bb458720eafa5bb971b832c057f23#384e8f6e219bb458720eafa5bb971b832c057f23" ++dependencies = [ ++ "atomicwrites", ++ "cosmic-config-derive", ++ "cosmic-settings-daemon", ++ "dirs", ++ "futures-util", ++ "iced_futures", ++ "known-folders", ++ "notify", ++ "ron", ++ "serde", ++ "tracing", ++ "xdg", ++ "zbus", ++] ++ ++[[package]] ++name = "cosmic-config-derive" ++version = "1.0.0" ++source = "git+https://github.com/pop-os/libcosmic.git?rev=384e8f6e219bb458720eafa5bb971b832c057f23#384e8f6e219bb458720eafa5bb971b832c057f23" ++dependencies = [ ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "cosmic-freedesktop-icons" ++version = "0.4.0" ++source = "git+https://github.com/pop-os/freedesktop-icons#7a61a704f6d1ec41f71cbe766e3cc484858523fa" ++dependencies = [ ++ "bstr", ++ "btoi", ++ "memchr", ++ "memmap2", ++ "thiserror 2.0.18", ++ "tracing", ++ "xdg", ++] ++ ++[[package]] ++name = "cosmic-protocols" ++version = "0.1.0" ++source = "git+https://github.com/pop-os/cosmic-protocols?rev=d0e95be#d0e95be25e423cfe523b11111a3666ed7aaf0dc4" ++dependencies = [ ++ "bitflags 2.10.0", ++ "wayland-backend", ++ "wayland-client", ++ "wayland-protocols", ++ "wayland-protocols-wlr", ++ "wayland-scanner", ++ "wayland-server", ++] ++ ++[[package]] ++name = "cosmic-settings-daemon" ++version = "0.1.0" ++source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" ++dependencies = [ ++ "zbus", ++] ++ ++[[package]] ++name = "cosmic-text" ++version = "0.18.2" ++source = "git+https://github.com/pop-os/cosmic-text.git#f31b9d86959676d97fde54ff5907a58ab4308897" ++dependencies = [ ++ "bitflags 2.10.0", ++ "fontdb 0.23.0", ++ "harfrust", ++ "linebender_resource_handle", ++ "log", ++ "rangemap", ++ "rustc-hash 2.1.1", ++ "self_cell", ++ "skrifa 0.40.0", ++ "smol_str 0.3.6", ++ "swash", ++ "sys-locale", ++ "unicode-bidi", ++ "unicode-linebreak", ++ "unicode-script", ++ "unicode-segmentation", ++] ++ ++[[package]] ++name = "cosmic-theme" ++version = "1.0.0" ++source = "git+https://github.com/pop-os/libcosmic.git?rev=384e8f6e219bb458720eafa5bb971b832c057f23#384e8f6e219bb458720eafa5bb971b832c057f23" ++dependencies = [ ++ "almost", ++ "configparser", ++ "cosmic-config", ++ "csscolorparser", ++ "dirs", ++ "palette", ++ "ron", ++ "serde", ++ "serde_json", ++ "thiserror 2.0.18", ++] ++ ++[[package]] ++name = "cpufeatures" ++version = "0.2.17" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "cpufeatures" ++version = "0.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "crc" ++version = "3.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5eb8a2a1cd12ab0d987a5d5e825195d372001a4094a0376319d5a0ad71c1ba0d" ++dependencies = [ ++ "crc-catalog", ++] ++ ++[[package]] ++name = "crc-catalog" ++version = "2.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" ++ ++[[package]] ++name = "crc32fast" ++version = "1.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" ++dependencies = [ ++ "cfg-if", ++] ++ ++[[package]] ++name = "crossbeam-deque" ++version = "0.8.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" ++dependencies = [ ++ "crossbeam-epoch", ++ "crossbeam-utils", ++] ++ ++[[package]] ++name = "crossbeam-epoch" ++version = "0.9.18" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" ++dependencies = [ ++ "crossbeam-utils", ++] ++ ++[[package]] ++name = "crossbeam-utils" ++version = "0.8.21" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" ++ ++[[package]] ++name = "crunchy" ++version = "0.2.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" ++ ++[[package]] ++name = "crypto-common" ++version = "0.1.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" ++dependencies = [ ++ "generic-array", ++ "typenum", ++] ++ ++[[package]] ++name = "css-color" ++version = "0.2.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "42aaeae719fd78ce501d77c6cdf01f7e96f26bcd5617a4903a1c2b97e388543a" ++ ++[[package]] ++name = "csscolorparser" ++version = "0.8.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "199f851bd3cb5004c09474252c7f74e7c047441ed0979bf3688a7106a13da952" ++dependencies = [ ++ "num-traits", ++ "phf 0.13.1", ++ "serde", ++ "uncased", ++] ++ ++[[package]] ++name = "ctor-lite" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1f791803201ab277ace03903de1594460708d2d54df6053f2d9e82f592b19e3b" ++ ++[[package]] ++name = "cursor-icon" ++version = "1.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f" ++ ++[[package]] ++name = "curve25519-dalek" ++version = "4.1.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" ++dependencies = [ ++ "cfg-if", ++ "cpufeatures 0.2.17", ++ "curve25519-dalek-derive", ++ "fiat-crypto", ++ "rustc_version", ++ "subtle", ++ "zeroize", ++] ++ ++[[package]] ++name = "curve25519-dalek-derive" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "d3d12" ++version = "22.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bdbd1f579714e3c809ebd822c81ef148b1ceaeb3d535352afc73fd0c4c6a0017" ++dependencies = [ ++ "bitflags 2.10.0", ++ "libloading", ++ "winapi", ++] ++ ++[[package]] ++name = "darling" ++version = "0.21.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0" ++dependencies = [ ++ "darling_core", ++ "darling_macro", ++] ++ ++[[package]] ++name = "darling_core" ++version = "0.21.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4" ++dependencies = [ ++ "fnv", ++ "ident_case", ++ "proc-macro2", ++ "quote", ++ "strsim", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "darling_macro" ++version = "0.21.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" ++dependencies = [ ++ "darling_core", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "data-url" ++version = "0.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376" ++ ++[[package]] ++name = "derive_setters" ++version = "0.1.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b7e6f6fa1f03c14ae082120b84b3c7fbd7b8588d924cf2d7c3daf9afd49df8b9" ++dependencies = [ ++ "darling", ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "derive_utils" ++version = "0.15.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ccfae181bab5ab6c5478b2ccb69e4c68a02f8c3ec72f6616bfec9dbc599d2ee0" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "digest" ++version = "0.10.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" ++dependencies = [ ++ "block-buffer", ++ "crypto-common", ++ "subtle", ++] ++ ++[[package]] ++name = "dirs" ++version = "6.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" ++dependencies = [ ++ "dirs-sys", ++] ++ ++[[package]] ++name = "dirs-sys" ++version = "0.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" ++dependencies = [ ++ "libc", ++ "option-ext", ++ "redox_users", ++ "windows-sys 0.61.2", ++] ++ ++[[package]] ++name = "dispatch" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" ++ ++[[package]] ++name = "displaydoc" ++version = "0.2.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "dlib" ++version = "0.5.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" ++dependencies = [ ++ "libloading", ++] ++ ++[[package]] ++name = "dnd" ++version = "0.1.0" ++source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" ++dependencies = [ ++ "bitflags 2.10.0", ++ "mime", ++ "raw-window-handle", ++ "smithay-client-toolkit 0.19.2", ++ "smithay-clipboard", ++] ++ ++[[package]] ++name = "document-features" ++version = "0.2.12" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" ++dependencies = [ ++ "litrs", ++] ++ ++[[package]] ++name = "downcast-rs" ++version = "1.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" ++ ++[[package]] ++name = "dpi" ++version = "0.1.1" ++source = "git+https://gitlab.redox-os.org/redox-os/winit?branch=redox-0.30.5#a0d14b4f2466afec886bcfb7e5d5d7eb9d703a60" ++ ++[[package]] ++name = "drm" ++version = "0.11.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a0f8a69e60d75ae7dab4ef26a59ca99f2a89d4c142089b537775ae0c198bdcde" ++dependencies = [ ++ "bitflags 2.10.0", ++ "bytemuck", ++ "drm-ffi", ++ "drm-fourcc", ++ "rustix 0.38.44", ++] ++ ++[[package]] ++name = "drm-ffi" ++version = "0.7.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "41334f8405792483e32ad05fbb9c5680ff4e84491883d2947a4757dc54cb2ac6" ++dependencies = [ ++ "drm-sys", ++ "rustix 0.38.44", ++] ++ ++[[package]] ++name = "drm-fourcc" ++version = "2.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4" ++ ++[[package]] ++name = "drm-sys" ++version = "0.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2d09ff881f92f118b11105ba5e34ff8f4adf27b30dae8f12e28c193af1c83176" ++dependencies = [ ++ "libc", ++ "linux-raw-sys 0.6.5", ++] ++ ++[[package]] ++name = "dryoc" ++version = "0.7.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4684d84cc4dc1a8705dcbe8be0e258581dfdbb308477ed604f52797c336bb3d2" ++dependencies = [ ++ "bitflags 2.10.0", ++ "chacha20", ++ "curve25519-dalek", ++ "generic-array", ++ "lazy_static", ++ "libc", ++ "rand_core 0.9.5", ++ "salsa20", ++ "sha2", ++ "subtle", ++ "winapi", ++ "zeroize", ++] ++ ++[[package]] ++name = "encode_unicode" ++version = "1.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" ++ ++[[package]] ++name = "endi" ++version = "1.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099" ++ ++[[package]] ++name = "endian-num" ++version = "0.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f8f59926911ef34d1efb9ea1ee8ca78385df62ce700ccf2bcb149011bd226888" ++ ++[[package]] ++name = "enumflags2" ++version = "0.7.12" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" ++dependencies = [ ++ "enumflags2_derive", ++ "serde", ++] ++ ++[[package]] ++name = "enumflags2_derive" ++version = "0.7.12" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "env_filter" ++version = "0.1.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1bf3c259d255ca70051b30e2e95b5446cdb8949ac4cd22c0d7fd634d89f568e2" ++dependencies = [ ++ "log", ++ "regex", ++] ++ ++[[package]] ++name = "env_logger" ++version = "0.11.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" ++dependencies = [ ++ "anstream", ++ "anstyle", ++ "env_filter", ++ "jiff", ++ "log", ++] ++ ++[[package]] ++name = "equivalent" ++version = "1.0.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" ++ ++[[package]] ++name = "errno" ++version = "0.3.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" ++dependencies = [ ++ "libc", ++ "windows-sys 0.61.2", ++] ++ ++[[package]] ++name = "error-code" ++version = "3.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dea2df4cf52843e0452895c455a1a2cfbb842a1e7329671acf418fdc53ed4c59" ++ ++[[package]] ++name = "etagere" ++version = "0.2.15" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fc89bf99e5dc15954a60f707c1e09d7540e5cd9af85fa75caa0b510bc08c5342" ++dependencies = [ ++ "euclid", ++ "svg_fmt", ++] ++ ++[[package]] ++name = "euclid" ++version = "0.22.13" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "df61bf483e837f88d5c2291dcf55c67be7e676b3a51acc48db3a7b163b91ed63" ++dependencies = [ ++ "num-traits", ++] ++ ++[[package]] ++name = "event-listener" ++version = "5.4.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" ++dependencies = [ ++ "concurrent-queue", ++ "parking", ++ "pin-project-lite", ++] ++ ++[[package]] ++name = "event-listener-strategy" ++version = "0.5.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" ++dependencies = [ ++ "event-listener", ++ "pin-project-lite", ++] ++ ++[[package]] ++name = "fast-srgb8" ++version = "1.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dd2e7510819d6fbf51a5545c8f922716ecfb14df168a3242f7d33e0239efe6a1" ++ ++[[package]] ++name = "fastrand" ++version = "2.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" ++ ++[[package]] ++name = "fatfs" ++version = "0.3.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "05669f8e7e2d7badc545c513710f0eba09c2fbef683eb859fd79c46c355048e0" ++dependencies = [ ++ "bitflags 1.3.2", ++ "byteorder", ++ "chrono", ++ "log", ++] ++ ++[[package]] ++name = "fdeflate" ++version = "0.3.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" ++dependencies = [ ++ "simd-adler32", ++] ++ ++[[package]] ++name = "fiat-crypto" ++version = "0.2.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" ++ ++[[package]] ++name = "find-crate" ++version = "0.6.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "59a98bbaacea1c0eb6a0876280051b892eb73594fd90cf3b20e9c817029c57d2" ++dependencies = [ ++ "toml 0.5.11", ++] ++ ++[[package]] ++name = "find-msvc-tools" ++version = "0.1.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db" ++ ++[[package]] ++name = "flate2" ++version = "1.1.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b375d6465b98090a5f25b1c7703f3859783755aa9a80433b36e0379a3ec2f369" ++dependencies = [ ++ "crc32fast", ++ "miniz_oxide", ++] ++ ++[[package]] ++name = "float-cmp" ++version = "0.9.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" ++ ++[[package]] ++name = "float_next_after" ++version = "1.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8bf7cc16383c4b8d58b9905a8509f02926ce3058053c056376248d958c9df1e8" ++ ++[[package]] ++name = "fluent" ++version = "0.17.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8137a6d5a2c50d6b0ebfcb9aaa91a28154e0a70605f112d30cb0cd4a78670477" ++dependencies = [ ++ "fluent-bundle", ++ "unic-langid", ++] ++ ++[[package]] ++name = "fluent-bundle" ++version = "0.16.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "01203cb8918f5711e73891b347816d932046f95f54207710bda99beaeb423bf4" ++dependencies = [ ++ "fluent-langneg", ++ "fluent-syntax", ++ "intl-memoizer", ++ "intl_pluralrules", ++ "rustc-hash 2.1.1", ++ "self_cell", ++ "smallvec", ++ "unic-langid", ++] ++ ++[[package]] ++name = "fluent-langneg" ++version = "0.13.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7eebbe59450baee8282d71676f3bfed5689aeab00b27545e83e5f14b1195e8b0" ++dependencies = [ ++ "unic-langid", ++] ++ ++[[package]] ++name = "fluent-syntax" ++version = "0.12.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "54f0d287c53ffd184d04d8677f590f4ac5379785529e5e08b1c8083acdd5c198" ++dependencies = [ ++ "memchr", ++ "thiserror 2.0.18", ++] ++ ++[[package]] ++name = "fnv" ++version = "1.0.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" ++ ++[[package]] ++name = "foldhash" ++version = "0.1.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" ++ ++[[package]] ++name = "font-types" ++version = "0.10.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "39a654f404bbcbd48ea58c617c2993ee91d1cb63727a37bf2323a4edeed1b8c5" ++dependencies = [ ++ "bytemuck", ++] ++ ++[[package]] ++name = "font-types" ++version = "0.11.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2d9237c6d82152100c691fb77ea18037b402bcc7257d2c876a4ffac81bc22a1c" ++dependencies = [ ++ "bytemuck", ++] ++ ++[[package]] ++name = "fontconfig-parser" ++version = "0.5.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bbc773e24e02d4ddd8395fd30dc147524273a83e54e0f312d986ea30de5f5646" ++dependencies = [ ++ "roxmltree", ++] ++ ++[[package]] ++name = "fontdb" ++version = "0.18.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e32eac81c1135c1df01d4e6d4233c47ba11f6a6d07f33e0bba09d18797077770" ++dependencies = [ ++ "fontconfig-parser", ++ "log", ++ "memmap2", ++ "slotmap", ++ "tinyvec", ++ "ttf-parser 0.21.1", ++] ++ ++[[package]] ++name = "fontdb" ++version = "0.23.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "457e789b3d1202543297a350643cf459f836cade38934e7a4cf6a39e7cde2905" ++dependencies = [ ++ "fontconfig-parser", ++ "log", ++ "memmap2", ++ "slotmap", ++ "tinyvec", ++ "ttf-parser 0.25.1", ++] ++ ++[[package]] ++name = "foreign-types" ++version = "0.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" ++dependencies = [ ++ "foreign-types-macros", ++ "foreign-types-shared", ++] ++ ++[[package]] ++name = "foreign-types-macros" ++version = "0.2.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "foreign-types-shared" ++version = "0.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" ++ ++[[package]] ++name = "form_urlencoded" ++version = "1.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" ++dependencies = [ ++ "percent-encoding", ++] ++ ++[[package]] ++name = "fscommon" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "315ce685aca5ddcc5a3e7e436ef47d4a5d0064462849b6f0f628c28140103531" ++dependencies = [ ++ "log", ++] ++ ++[[package]] ++name = "fsevent-sys" ++version = "4.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "fuser" ++version = "0.16.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0bb29a3ae32279fe3e79a958fe01899f5fb23eadccee919cf88e145b54ed9367" ++dependencies = [ ++ "libc", ++ "log", ++ "memchr", ++ "nix", ++ "page_size", ++ "smallvec", ++ "zerocopy", ++] ++ ++[[package]] ++name = "futures" ++version = "0.3.31" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" ++dependencies = [ ++ "futures-channel", ++ "futures-core", ++ "futures-executor", ++ "futures-io", ++ "futures-sink", ++ "futures-task", ++ "futures-util", ++] ++ ++[[package]] ++name = "futures-channel" ++version = "0.3.31" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" ++dependencies = [ ++ "futures-core", ++ "futures-sink", ++] ++ ++[[package]] ++name = "futures-core" ++version = "0.3.31" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" ++ ++[[package]] ++name = "futures-executor" ++version = "0.3.31" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" ++dependencies = [ ++ "futures-core", ++ "futures-task", ++ "futures-util", ++ "num_cpus", ++] ++ ++[[package]] ++name = "futures-io" ++version = "0.3.31" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" ++ ++[[package]] ++name = "futures-lite" ++version = "2.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" ++dependencies = [ ++ "fastrand", ++ "futures-core", ++ "futures-io", ++ "parking", ++ "pin-project-lite", ++] ++ ++[[package]] ++name = "futures-macro" ++version = "0.3.31" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "futures-sink" ++version = "0.3.31" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" ++ ++[[package]] ++name = "futures-task" ++version = "0.3.31" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" ++ ++[[package]] ++name = "futures-util" ++version = "0.3.31" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" ++dependencies = [ ++ "futures-channel", ++ "futures-core", ++ "futures-io", ++ "futures-macro", ++ "futures-sink", ++ "futures-task", ++ "memchr", ++ "pin-project-lite", ++ "pin-utils", ++ "slab", ++] ++ ++[[package]] ++name = "generic-array" ++version = "0.14.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" ++dependencies = [ ++ "typenum", ++ "version_check", ++] ++ ++[[package]] ++name = "gethostname" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8" ++dependencies = [ ++ "rustix 1.1.4", ++ "windows-link 0.2.1", ++] ++ ++[[package]] ++name = "getrandom" ++version = "0.2.17" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" ++dependencies = [ ++ "cfg-if", ++ "js-sys", ++ "libc", ++ "wasi", ++ "wasm-bindgen", ++] ++ ++[[package]] ++name = "getrandom" ++version = "0.3.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" ++dependencies = [ ++ "cfg-if", ++ "js-sys", ++ "libc", ++ "r-efi", ++ "wasip2", ++ "wasm-bindgen", ++] ++ ++[[package]] ++name = "gif" ++version = "0.13.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4ae047235e33e2829703574b54fdec96bfbad892062d97fed2f76022287de61b" ++dependencies = [ ++ "color_quant", ++ "weezl", ++] ++ ++[[package]] ++name = "gl_generator" ++version = "0.14.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" ++dependencies = [ ++ "khronos_api", ++ "log", ++ "xml-rs", ++] ++ ++[[package]] ++name = "glam" ++version = "0.25.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" ++ ++[[package]] ++name = "glow" ++version = "0.13.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1" ++dependencies = [ ++ "js-sys", ++ "slotmap", ++ "wasm-bindgen", ++ "web-sys", ++] ++ ++[[package]] ++name = "glutin_wgl_sys" ++version = "0.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2c4ee00b289aba7a9e5306d57c2d05499b2e5dc427f84ac708bd2c090212cf3e" ++dependencies = [ ++ "gl_generator", ++] ++ ++[[package]] ++name = "gpt" ++version = "3.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8283e7331b8c93b9756e0cfdbcfb90312852f953c6faf9bf741e684cc3b6ad69" ++dependencies = [ ++ "bitflags 2.10.0", ++ "crc", ++ "log", ++ "uuid", ++] ++ ++[[package]] ++name = "gpu-alloc" ++version = "0.6.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" ++dependencies = [ ++ "bitflags 2.10.0", ++ "gpu-alloc-types", ++] ++ ++[[package]] ++name = "gpu-alloc-types" ++version = "0.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" ++dependencies = [ ++ "bitflags 2.10.0", ++] ++ ++[[package]] ++name = "gpu-allocator" ++version = "0.26.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fdd4240fc91d3433d5e5b0fc5b67672d771850dc19bbee03c1381e19322803d7" ++dependencies = [ ++ "log", ++ "presser", ++ "thiserror 1.0.69", ++ "winapi", ++ "windows 0.52.0", ++] ++ ++[[package]] ++name = "gpu-descriptor" ++version = "0.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b89c83349105e3732062a895becfc71a8f921bb71ecbbdd8ff99263e3b53a0ca" ++dependencies = [ ++ "bitflags 2.10.0", ++ "gpu-descriptor-types", ++ "hashbrown 0.15.5", ++] ++ ++[[package]] ++name = "gpu-descriptor-types" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" ++dependencies = [ ++ "bitflags 2.10.0", ++] ++ ++[[package]] ++name = "grid" ++version = "1.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f9e2d4c0a8296178d8802098410ca05d86b17a10bb5ab559b3fb404c1f948220" ++ ++[[package]] ++name = "guillotiere" ++version = "0.6.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b62d5865c036cb1393e23c50693df631d3f5d7bcca4c04fe4cc0fd592e74a782" ++dependencies = [ ++ "euclid", ++ "svg_fmt", ++] ++ ++[[package]] ++name = "half" ++version = "2.7.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" ++dependencies = [ ++ "cfg-if", ++ "crunchy", ++ "zerocopy", ++] ++ ++[[package]] ++name = "harfrust" ++version = "0.5.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9da2e5ae821f6e96664977bf974d6d6a2d6682f9ccee23e62ec1d134246845f9" ++dependencies = [ ++ "bitflags 2.10.0", ++ "bytemuck", ++ "core_maths", ++ "read-fonts 0.37.0", ++ "smallvec", ++] ++ ++[[package]] ++name = "hashbrown" ++version = "0.15.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" ++dependencies = [ ++ "foldhash", ++] ++ ++[[package]] ++name = "hashbrown" ++version = "0.16.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" ++ ++[[package]] ++name = "hassle-rs" ++version = "0.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" ++dependencies = [ ++ "bitflags 2.10.0", ++ "com", ++ "libc", ++ "libloading", ++ "thiserror 1.0.69", ++ "widestring", ++ "winapi", ++] ++ ++[[package]] ++name = "heck" ++version = "0.4.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" ++ ++[[package]] ++name = "hermit-abi" ++version = "0.5.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" ++ ++[[package]] ++name = "hex" ++version = "0.4.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" ++dependencies = [ ++ "serde", ++] ++ ++[[package]] ++name = "hexf-parse" ++version = "0.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" ++ ++[[package]] ++name = "http" ++version = "1.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" ++dependencies = [ ++ "bytes", ++ "itoa", ++] ++ ++[[package]] ++name = "http-body" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" ++dependencies = [ ++ "bytes", ++ "http", ++] ++ ++[[package]] ++name = "http-body-util" ++version = "0.1.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" ++dependencies = [ ++ "bytes", ++ "futures-core", ++ "http", ++ "http-body", ++ "pin-project-lite", ++] ++ ++[[package]] ++name = "httparse" ++version = "1.10.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" ++ ++[[package]] ++name = "humansize" ++version = "2.1.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7" ++dependencies = [ ++ "libm", ++] ++ ++[[package]] ++name = "hyper" ++version = "1.8.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" ++dependencies = [ ++ "atomic-waker", ++ "bytes", ++ "futures-channel", ++ "futures-core", ++ "http", ++ "http-body", ++ "httparse", ++ "itoa", ++ "pin-project-lite", ++ "pin-utils", ++ "smallvec", ++ "tokio", ++ "want", ++] ++ ++[[package]] ++name = "hyper-rustls" ++version = "0.27.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" ++dependencies = [ ++ "http", ++ "hyper", ++ "hyper-util", ++ "rustls", ++ "rustls-pki-types", ++ "tokio", ++ "tokio-rustls", ++ "tower-service", ++ "webpki-roots", ++] ++ ++[[package]] ++name = "hyper-util" ++version = "0.1.19" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f" ++dependencies = [ ++ "base64", ++ "bytes", ++ "futures-channel", ++ "futures-core", ++ "futures-util", ++ "http", ++ "http-body", ++ "hyper", ++ "ipnet", ++ "libc", ++ "percent-encoding", ++ "pin-project-lite", ++ "socket2", ++ "tokio", ++ "tower-service", ++ "tracing", ++] ++ ++[[package]] ++name = "i18n-config" ++version = "0.4.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3e06b90c8a0d252e203c94344b21e35a30f3a3a85dc7db5af8f8df9f3e0c63ef" ++dependencies = [ ++ "basic-toml", ++ "log", ++ "serde", ++ "serde_derive", ++ "thiserror 1.0.69", ++ "unic-langid", ++] ++ ++[[package]] ++name = "i18n-embed" ++version = "0.16.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a217bbb075dcaefb292efa78897fc0678245ca67f265d12c351e42268fcb0305" ++dependencies = [ ++ "arc-swap", ++ "fluent", ++ "fluent-langneg", ++ "fluent-syntax", ++ "i18n-embed-impl", ++ "intl-memoizer", ++ "log", ++ "parking_lot 0.12.5", ++ "rust-embed", ++ "sys-locale", ++ "thiserror 1.0.69", ++ "unic-langid", ++ "walkdir", ++] ++ ++[[package]] ++name = "i18n-embed-fl" ++version = "0.10.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e598ed73b67db92f61e04672e599eef2991a262a40e1666735b8a86d2e7e9f30" ++dependencies = [ ++ "find-crate", ++ "fluent", ++ "fluent-syntax", ++ "i18n-config", ++ "i18n-embed", ++ "proc-macro-error2", ++ "proc-macro2", ++ "quote", ++ "strsim", ++ "syn 2.0.114", ++ "unic-langid", ++] ++ ++[[package]] ++name = "i18n-embed-impl" ++version = "0.8.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0f2cc0e0523d1fe6fc2c6f66e5038624ea8091b3e7748b5e8e0c84b1698db6c2" ++dependencies = [ ++ "find-crate", ++ "i18n-config", ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "iana-time-zone" ++version = "0.1.64" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" ++dependencies = [ ++ "android_system_properties", ++ "core-foundation-sys", ++ "iana-time-zone-haiku", ++ "js-sys", ++ "log", ++ "wasm-bindgen", ++ "windows-core 0.61.2", ++] ++ ++[[package]] ++name = "iana-time-zone-haiku" ++version = "0.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" ++dependencies = [ ++ "cc", ++] ++ ++[[package]] ++name = "iced" ++version = "0.14.0-dev" ++source = "git+https://github.com/pop-os/libcosmic.git?rev=384e8f6e219bb458720eafa5bb971b832c057f23#384e8f6e219bb458720eafa5bb971b832c057f23" ++dependencies = [ ++ "dnd", ++ "iced_accessibility", ++ "iced_core", ++ "iced_futures", ++ "iced_renderer", ++ "iced_widget", ++ "iced_winit", ++ "image", ++ "mime", ++ "thiserror 1.0.69", ++ "window_clipboard", ++] ++ ++[[package]] ++name = "iced_accessibility" ++version = "0.1.0" ++source = "git+https://github.com/pop-os/libcosmic.git?rev=384e8f6e219bb458720eafa5bb971b832c057f23#384e8f6e219bb458720eafa5bb971b832c057f23" ++dependencies = [ ++ "accesskit", ++ "accesskit_winit", ++] ++ ++[[package]] ++name = "iced_core" ++version = "0.14.0-dev" ++source = "git+https://github.com/pop-os/libcosmic.git?rev=384e8f6e219bb458720eafa5bb971b832c057f23#384e8f6e219bb458720eafa5bb971b832c057f23" ++dependencies = [ ++ "bitflags 2.10.0", ++ "bytes", ++ "dnd", ++ "glam", ++ "log", ++ "mime", ++ "num-traits", ++ "once_cell", ++ "palette", ++ "raw-window-handle", ++ "rustc-hash 2.1.1", ++ "serde", ++ "smol_str 0.2.2", ++ "thiserror 1.0.69", ++ "web-time", ++ "window_clipboard", ++] ++ ++[[package]] ++name = "iced_futures" ++version = "0.14.0-dev" ++source = "git+https://github.com/pop-os/libcosmic.git?rev=384e8f6e219bb458720eafa5bb971b832c057f23#384e8f6e219bb458720eafa5bb971b832c057f23" ++dependencies = [ ++ "futures", ++ "iced_core", ++ "log", ++ "rustc-hash 2.1.1", ++ "wasm-bindgen-futures", ++ "wasm-timer", ++] ++ ++[[package]] ++name = "iced_glyphon" ++version = "0.6.0" ++source = "git+https://github.com/pop-os/glyphon.git?tag=iced-0.14-dev#6ef9d12a20cfd0f7bdf38136a26ded9f7459ec8b" ++dependencies = [ ++ "cosmic-text", ++ "etagere", ++ "lru", ++ "rustc-hash 2.1.1", ++ "wgpu", ++] ++ ++[[package]] ++name = "iced_graphics" ++version = "0.14.0-dev" ++source = "git+https://github.com/pop-os/libcosmic.git?rev=384e8f6e219bb458720eafa5bb971b832c057f23#384e8f6e219bb458720eafa5bb971b832c057f23" ++dependencies = [ ++ "bitflags 2.10.0", ++ "bytemuck", ++ "cosmic-text", ++ "half", ++ "iced_core", ++ "iced_futures", ++ "image", ++ "kamadak-exif", ++ "log", ++ "lyon_path", ++ "once_cell", ++ "raw-window-handle", ++ "rustc-hash 2.1.1", ++ "thiserror 1.0.69", ++ "unicode-segmentation", ++] ++ ++[[package]] ++name = "iced_renderer" ++version = "0.14.0-dev" ++source = "git+https://github.com/pop-os/libcosmic.git?rev=384e8f6e219bb458720eafa5bb971b832c057f23#384e8f6e219bb458720eafa5bb971b832c057f23" ++dependencies = [ ++ "iced_graphics", ++ "iced_tiny_skia", ++ "iced_wgpu", ++ "log", ++ "thiserror 1.0.69", ++] ++ ++[[package]] ++name = "iced_runtime" ++version = "0.14.0-dev" ++source = "git+https://github.com/pop-os/libcosmic.git?rev=384e8f6e219bb458720eafa5bb971b832c057f23#384e8f6e219bb458720eafa5bb971b832c057f23" ++dependencies = [ ++ "bytes", ++ "dnd", ++ "iced_core", ++ "iced_futures", ++ "raw-window-handle", ++ "thiserror 1.0.69", ++ "window_clipboard", ++] ++ ++[[package]] ++name = "iced_tiny_skia" ++version = "0.14.0-dev" ++source = "git+https://github.com/pop-os/libcosmic.git?rev=384e8f6e219bb458720eafa5bb971b832c057f23#384e8f6e219bb458720eafa5bb971b832c057f23" ++dependencies = [ ++ "bytemuck", ++ "cosmic-text", ++ "iced_graphics", ++ "kurbo 0.10.4", ++ "log", ++ "resvg", ++ "rustc-hash 2.1.1", ++ "softbuffer", ++ "tiny-skia", ++] ++ ++[[package]] ++name = "iced_wgpu" ++version = "0.14.0-dev" ++source = "git+https://github.com/pop-os/libcosmic.git?rev=384e8f6e219bb458720eafa5bb971b832c057f23#384e8f6e219bb458720eafa5bb971b832c057f23" ++dependencies = [ ++ "as-raw-xcb-connection", ++ "bitflags 2.10.0", ++ "bytemuck", ++ "cosmic-client-toolkit", ++ "futures", ++ "glam", ++ "guillotiere", ++ "iced_glyphon", ++ "iced_graphics", ++ "log", ++ "lyon", ++ "once_cell", ++ "raw-window-handle", ++ "resvg", ++ "rustc-hash 2.1.1", ++ "rustix 0.38.44", ++ "thiserror 1.0.69", ++ "tiny-xlib", ++ "wayland-backend", ++ "wayland-client", ++ "wayland-protocols", ++ "wayland-sys", ++ "wgpu", ++ "x11rb", ++] ++ ++[[package]] ++name = "iced_widget" ++version = "0.14.0-dev" ++source = "git+https://github.com/pop-os/libcosmic.git?rev=384e8f6e219bb458720eafa5bb971b832c057f23#384e8f6e219bb458720eafa5bb971b832c057f23" ++dependencies = [ ++ "dnd", ++ "iced_renderer", ++ "iced_runtime", ++ "log", ++ "num-traits", ++ "once_cell", ++ "ouroboros", ++ "rustc-hash 2.1.1", ++ "thiserror 1.0.69", ++ "unicode-segmentation", ++ "window_clipboard", ++] ++ ++[[package]] ++name = "iced_winit" ++version = "0.14.0-dev" ++source = "git+https://github.com/pop-os/libcosmic.git?rev=384e8f6e219bb458720eafa5bb971b832c057f23#384e8f6e219bb458720eafa5bb971b832c057f23" ++dependencies = [ ++ "dnd", ++ "iced_futures", ++ "iced_graphics", ++ "iced_runtime", ++ "log", ++ "rustc-hash 2.1.1", ++ "rustix 0.38.44", ++ "thiserror 1.0.69", ++ "tracing", ++ "wasm-bindgen-futures", ++ "wayland-client", ++ "web-sys", ++ "winapi", ++ "window_clipboard", ++ "winit", ++] ++ ++[[package]] ++name = "icu_collections" ++version = "2.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" ++dependencies = [ ++ "displaydoc", ++ "potential_utf", ++ "yoke", ++ "zerofrom", ++ "zerovec", ++] ++ ++[[package]] ++name = "icu_locale_core" ++version = "2.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" ++dependencies = [ ++ "displaydoc", ++ "litemap", ++ "tinystr", ++ "writeable", ++ "zerovec", ++] ++ ++[[package]] ++name = "icu_normalizer" ++version = "2.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" ++dependencies = [ ++ "icu_collections", ++ "icu_normalizer_data", ++ "icu_properties", ++ "icu_provider", ++ "smallvec", ++ "zerovec", ++] ++ ++[[package]] ++name = "icu_normalizer_data" ++version = "2.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" ++ ++[[package]] ++name = "icu_properties" ++version = "2.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" ++dependencies = [ ++ "icu_collections", ++ "icu_locale_core", ++ "icu_properties_data", ++ "icu_provider", ++ "zerotrie", ++ "zerovec", ++] ++ ++[[package]] ++name = "icu_properties_data" ++version = "2.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" ++ ++[[package]] ++name = "icu_provider" ++version = "2.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" ++dependencies = [ ++ "displaydoc", ++ "icu_locale_core", ++ "writeable", ++ "yoke", ++ "zerofrom", ++ "zerotrie", ++ "zerovec", ++] ++ ++[[package]] ++name = "ident_case" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" ++ ++[[package]] ++name = "idna" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" ++dependencies = [ ++ "idna_adapter", ++ "smallvec", ++ "utf8_iter", ++] ++ ++[[package]] ++name = "idna_adapter" ++version = "1.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" ++dependencies = [ ++ "icu_normalizer", ++ "icu_properties", ++] ++ ++[[package]] ++name = "image" ++version = "0.25.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104" ++dependencies = [ ++ "bytemuck", ++ "byteorder-lite", ++ "moxcms", ++ "num-traits", ++ "png 0.18.0", ++ "zune-core", ++ "zune-jpeg", ++] ++ ++[[package]] ++name = "imagesize" ++version = "0.12.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" ++ ++[[package]] ++name = "immutable-chunkmap" ++version = "2.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9a3e98b1520e49e252237edc238a39869da9f3241f2ec19dc788c1d24694d1e4" ++dependencies = [ ++ "arrayvec", ++] ++ ++[[package]] ++name = "indexmap" ++version = "2.13.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" ++dependencies = [ ++ "equivalent", ++ "hashbrown 0.16.1", ++] ++ ++[[package]] ++name = "indicatif" ++version = "0.17.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "183b3088984b400f4cfac3620d5e076c84da5364016b4f49473de574b2586235" ++dependencies = [ ++ "console", ++ "number_prefix", ++ "portable-atomic", ++ "unicode-width 0.2.2", ++ "web-time", ++] ++ ++[[package]] ++name = "inotify" ++version = "0.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" ++dependencies = [ ++ "bitflags 2.10.0", ++ "inotify-sys", ++ "libc", ++] ++ ++[[package]] ++name = "inotify-sys" ++version = "0.1.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "inout" ++version = "0.1.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" ++dependencies = [ ++ "generic-array", ++] ++ ++[[package]] ++name = "instant" ++version = "0.1.13" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" ++dependencies = [ ++ "cfg-if", ++] ++ ++[[package]] ++name = "intl-memoizer" ++version = "0.5.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "310da2e345f5eb861e7a07ee182262e94975051db9e4223e909ba90f392f163f" ++dependencies = [ ++ "type-map", ++ "unic-langid", ++] ++ ++[[package]] ++name = "intl_pluralrules" ++version = "7.0.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "078ea7b7c29a2b4df841a7f6ac8775ff6074020c6776d48491ce2268e068f972" ++dependencies = [ ++ "unic-langid", ++] ++ ++[[package]] ++name = "ipnet" ++version = "2.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" ++ ++[[package]] ++name = "iri-string" ++version = "0.7.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" ++dependencies = [ ++ "memchr", ++ "serde", ++] ++ ++[[package]] ++name = "is_terminal_polyfill" ++version = "1.70.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" ++ ++[[package]] ++name = "itoa" ++version = "1.0.17" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" ++ ++[[package]] ++name = "jiff" ++version = "0.2.18" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e67e8da4c49d6d9909fe03361f9b620f58898859f5c7aded68351e85e71ecf50" ++dependencies = [ ++ "jiff-static", ++ "jiff-tzdb-platform", ++ "log", ++ "portable-atomic", ++ "portable-atomic-util", ++ "serde_core", ++ "windows-sys 0.61.2", ++] ++ ++[[package]] ++name = "jiff-static" ++version = "0.2.18" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e0c84ee7f197eca9a86c6fd6cb771e55eb991632f15f2bc3ca6ec838929e6e78" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "jiff-tzdb" ++version = "0.1.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c900ef84826f1338a557697dc8fc601df9ca9af4ac137c7fb61d4c6f2dfd3076" ++ ++[[package]] ++name = "jiff-tzdb-platform" ++version = "0.1.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8" ++dependencies = [ ++ "jiff-tzdb", ++] ++ ++[[package]] ++name = "jni" ++version = "0.21.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" ++dependencies = [ ++ "cesu8", ++ "cfg-if", ++ "combine", ++ "jni-sys", ++ "log", ++ "thiserror 1.0.69", ++ "walkdir", ++ "windows-sys 0.45.0", ++] ++ ++[[package]] ++name = "jni-sys" ++version = "0.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" ++ ++[[package]] ++name = "jobserver" ++version = "0.1.34" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" ++dependencies = [ ++ "getrandom 0.3.4", ++ "libc", ++] ++ ++[[package]] ++name = "jpeg-decoder" ++version = "0.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "00810f1d8b74be64b13dbf3db89ac67740615d6c891f0e7b6179326533011a07" ++ ++[[package]] ++name = "js-sys" ++version = "0.3.85" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" ++dependencies = [ ++ "once_cell", ++ "wasm-bindgen", ++] ++ ++[[package]] ++name = "kamadak-exif" ++version = "0.5.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ef4fc70d0ab7e5b6bafa30216a6b48705ea964cdfc29c050f2412295eba58077" ++dependencies = [ ++ "mutate_once", ++] ++ ++[[package]] ++name = "khronos-egl" ++version = "6.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" ++dependencies = [ ++ "libc", ++ "libloading", ++ "pkg-config", ++] ++ ++[[package]] ++name = "khronos_api" ++version = "3.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" ++ ++[[package]] ++name = "known-folders" ++version = "1.4.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7a1886916523694cd6ea3d175f03a1e5010699a2a4cc13696d83d7bea1d80638" ++dependencies = [ ++ "windows-sys 0.61.2", ++] ++ ++[[package]] ++name = "kqueue" ++version = "1.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "eac30106d7dce88daf4a3fcb4879ea939476d5074a9b7ddd0fb97fa4bed5596a" ++dependencies = [ ++ "kqueue-sys", ++ "libc", ++] ++ ++[[package]] ++name = "kqueue-sys" ++version = "1.0.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" ++dependencies = [ ++ "bitflags 1.3.2", ++ "libc", ++] ++ ++[[package]] ++name = "kurbo" ++version = "0.10.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1618d4ebd923e97d67e7cd363d80aef35fe961005cbbbb3d2dad8bdd1bc63440" ++dependencies = [ ++ "arrayvec", ++ "smallvec", ++] ++ ++[[package]] ++name = "kurbo" ++version = "0.11.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c62026ae44756f8a599ba21140f350303d4f08dcdcc71b5ad9c9bb8128c13c62" ++dependencies = [ ++ "arrayvec", ++ "euclid", ++ "smallvec", ++] ++ ++[[package]] ++name = "lazy_static" ++version = "1.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" ++ ++[[package]] ++name = "libc" ++version = "0.2.184" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af" ++ ++[[package]] ++name = "libcosmic" ++version = "1.0.0" ++source = "git+https://github.com/pop-os/libcosmic.git?rev=384e8f6e219bb458720eafa5bb971b832c057f23#384e8f6e219bb458720eafa5bb971b832c057f23" ++dependencies = [ ++ "apply", ++ "auto_enums", ++ "cosmic-config", ++ "cosmic-freedesktop-icons", ++ "cosmic-settings-daemon", ++ "cosmic-theme", ++ "css-color", ++ "derive_setters", ++ "futures", ++ "i18n-embed", ++ "i18n-embed-fl", ++ "iced", ++ "iced_core", ++ "iced_futures", ++ "iced_renderer", ++ "iced_runtime", ++ "iced_tiny_skia", ++ "iced_widget", ++ "iced_winit", ++ "image", ++ "jiff", ++ "log", ++ "palette", ++ "phf 0.13.1", ++ "raw-window-handle", ++ "rust-embed", ++ "serde", ++ "slotmap", ++ "taffy", ++ "thiserror 2.0.18", ++ "tracing", ++ "unicode-segmentation", ++ "url", ++ "zbus", ++] ++ ++[[package]] ++name = "libloading" ++version = "0.8.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" ++dependencies = [ ++ "cfg-if", ++ "windows-link 0.2.1", ++] ++ ++[[package]] ++name = "libm" ++version = "0.2.15" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" ++ ++[[package]] ++name = "libredox" ++version = "0.1.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c" ++dependencies = [ ++ "bitflags 2.10.0", ++ "libc", ++ "plain", ++ "redox_syscall 0.7.0", ++] ++ ++[[package]] ++name = "linebender_resource_handle" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" ++ ++[[package]] ++name = "linux-raw-sys" ++version = "0.4.15" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" ++ ++[[package]] ++name = "linux-raw-sys" ++version = "0.6.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2a385b1be4e5c3e362ad2ffa73c392e53f031eaa5b7d648e64cd87f27f6063d7" ++ ++[[package]] ++name = "linux-raw-sys" ++version = "0.12.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" ++ ++[[package]] ++name = "litemap" ++version = "0.8.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" ++ ++[[package]] ++name = "litrs" ++version = "1.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" ++ ++[[package]] ++name = "lock_api" ++version = "0.4.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" ++dependencies = [ ++ "scopeguard", ++] ++ ++[[package]] ++name = "log" ++version = "0.4.29" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" ++ ++[[package]] ++name = "lru" ++version = "0.12.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" ++ ++[[package]] ++name = "lru-slab" ++version = "0.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" ++ ++[[package]] ++name = "lyon" ++version = "1.0.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dbcb7d54d54c8937364c9d41902d066656817dce1e03a44e5533afebd1ef4352" ++dependencies = [ ++ "lyon_algorithms", ++ "lyon_tessellation", ++] ++ ++[[package]] ++name = "lyon_algorithms" ++version = "1.0.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f4c0829e28c4f336396f250d850c3987e16ce6db057ffe047ce0dd54aab6b647" ++dependencies = [ ++ "lyon_path", ++ "num-traits", ++] ++ ++[[package]] ++name = "lyon_geom" ++version = "1.0.18" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e260b6de923e6e47adfedf6243013a7a874684165a6a277594ee3906021b2343" ++dependencies = [ ++ "arrayvec", ++ "euclid", ++ "num-traits", ++] ++ ++[[package]] ++name = "lyon_path" ++version = "1.0.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1aeca86bcfd632a15984ba029b539ffb811e0a70bf55e814ef8b0f54f506fdeb" ++dependencies = [ ++ "lyon_geom", ++ "num-traits", ++] ++ ++[[package]] ++name = "lyon_tessellation" ++version = "1.0.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f3f586142e1280335b1bc89539f7c97dd80f08fc43e9ab1b74ef0a42b04aa353" ++dependencies = [ ++ "float_next_after", ++ "lyon_path", ++ "num-traits", ++] ++ ++[[package]] ++name = "lz4_flex" ++version = "0.11.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "373f5eceeeab7925e0c1098212f2fbc4d416adec9d35051a6ab251e824c1854a" ++ ++[[package]] ++name = "lzma-rust2" ++version = "0.16.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "47bb1e988e6fb779cf720ad431242d3f03167c1b3f2b1aae7f1a94b2495b36ae" ++dependencies = [ ++ "sha2", ++] ++ ++[[package]] ++name = "malloc_buf" ++version = "0.0.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "memchr" ++version = "2.7.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" ++ ++[[package]] ++name = "memmap2" ++version = "0.9.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "744133e4a0e0a658e1374cf3bf8e415c4052a15a111acd372764c55b4177d490" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "memoffset" ++version = "0.9.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" ++dependencies = [ ++ "autocfg", ++] ++ ++[[package]] ++name = "memsec" ++version = "0.6.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0fa0916b001582d253822171bd23f4a0229d32b9507fae236f5da8cad515ba7c" ++dependencies = [ ++ "getrandom 0.2.17", ++ "libc", ++ "windows-sys 0.45.0", ++] ++ ++[[package]] ++name = "metal" ++version = "0.29.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" ++dependencies = [ ++ "bitflags 2.10.0", ++ "block", ++ "core-graphics-types", ++ "foreign-types", ++ "log", ++ "objc", ++ "paste", ++] ++ ++[[package]] ++name = "mime" ++version = "0.1.0" ++source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" ++dependencies = [ ++ "smithay-clipboard", ++] ++ ++[[package]] ++name = "miniz_oxide" ++version = "0.8.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" ++dependencies = [ ++ "adler2", ++ "simd-adler32", ++] ++ ++[[package]] ++name = "mio" ++version = "1.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" ++dependencies = [ ++ "libc", ++ "log", ++ "wasi", ++ "windows-sys 0.61.2", ++] ++ ++[[package]] ++name = "moxcms" ++version = "0.8.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b" ++dependencies = [ ++ "num-traits", ++ "pxfm", ++] ++ ++[[package]] ++name = "mutate_once" ++version = "0.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "13d2233c9842d08cfe13f9eac96e207ca6a2ea10b80259ebe8ad0268be27d2af" ++ ++[[package]] ++name = "naga" ++version = "22.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8bd5a652b6faf21496f2cfd88fc49989c8db0825d1f6746b1a71a6ede24a63ad" ++dependencies = [ ++ "arrayvec", ++ "bit-set", ++ "bitflags 2.10.0", ++ "cfg_aliases 0.1.1", ++ "codespan-reporting", ++ "hexf-parse", ++ "indexmap", ++ "log", ++ "rustc-hash 1.1.0", ++ "spirv", ++ "termcolor", ++ "thiserror 1.0.69", ++ "unicode-xid", ++] ++ ++[[package]] ++name = "ndk" ++version = "0.9.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" ++dependencies = [ ++ "bitflags 2.10.0", ++ "jni-sys", ++ "log", ++ "ndk-sys 0.6.0+11769913", ++ "num_enum", ++ "raw-window-handle", ++ "thiserror 1.0.69", ++] ++ ++[[package]] ++name = "ndk-context" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" ++ ++[[package]] ++name = "ndk-sys" ++version = "0.5.0+25.2.9519653" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" ++dependencies = [ ++ "jni-sys", ++] ++ ++[[package]] ++name = "ndk-sys" ++version = "0.6.0+11769913" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" ++dependencies = [ ++ "jni-sys", ++] ++ ++[[package]] ++name = "nix" ++version = "0.29.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" ++dependencies = [ ++ "bitflags 2.10.0", ++ "cfg-if", ++ "cfg_aliases 0.2.1", ++ "libc", ++] ++ ++[[package]] ++name = "notify" ++version = "8.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3" ++dependencies = [ ++ "bitflags 2.10.0", ++ "fsevent-sys", ++ "inotify", ++ "kqueue", ++ "libc", ++ "log", ++ "mio", ++ "notify-types", ++ "walkdir", ++ "windows-sys 0.60.2", ++] ++ ++[[package]] ++name = "notify-types" ++version = "2.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5e0826a989adedc2a244799e823aece04662b66609d96af8dff7ac6df9a8925d" ++ ++[[package]] ++name = "num-traits" ++version = "0.2.19" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" ++dependencies = [ ++ "autocfg", ++ "libm", ++] ++ ++[[package]] ++name = "num_cpus" ++version = "1.17.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" ++dependencies = [ ++ "hermit-abi", ++ "libc", ++] ++ ++[[package]] ++name = "num_enum" ++version = "0.7.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b1207a7e20ad57b847bbddc6776b968420d38292bbfe2089accff5e19e82454c" ++dependencies = [ ++ "num_enum_derive", ++ "rustversion", ++] ++ ++[[package]] ++name = "num_enum_derive" ++version = "0.7.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7" ++dependencies = [ ++ "proc-macro-crate", ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "number_prefix" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" ++ ++[[package]] ++name = "numtoa" ++version = "0.2.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6aa2c4e539b869820a2b82e1aef6ff40aa85e65decdd5185e83fb4b1249cd00f" ++ ++[[package]] ++name = "objc" ++version = "0.2.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" ++dependencies = [ ++ "malloc_buf", ++] ++ ++[[package]] ++name = "objc-foundation" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" ++dependencies = [ ++ "block", ++ "objc", ++ "objc_id", ++] ++ ++[[package]] ++name = "objc-sys" ++version = "0.3.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" ++ ++[[package]] ++name = "objc2" ++version = "0.5.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" ++dependencies = [ ++ "objc-sys", ++ "objc2-encode", ++] ++ ++[[package]] ++name = "objc2-app-kit" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" ++dependencies = [ ++ "bitflags 2.10.0", ++ "block2", ++ "libc", ++ "objc2", ++ "objc2-core-data", ++ "objc2-core-image", ++ "objc2-foundation", ++ "objc2-quartz-core", ++] ++ ++[[package]] ++name = "objc2-cloud-kit" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" ++dependencies = [ ++ "bitflags 2.10.0", ++ "block2", ++ "objc2", ++ "objc2-core-location", ++ "objc2-foundation", ++] ++ ++[[package]] ++name = "objc2-contacts" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" ++dependencies = [ ++ "block2", ++ "objc2", ++ "objc2-foundation", ++] ++ ++[[package]] ++name = "objc2-core-data" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" ++dependencies = [ ++ "bitflags 2.10.0", ++ "block2", ++ "objc2", ++ "objc2-foundation", ++] ++ ++[[package]] ++name = "objc2-core-image" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" ++dependencies = [ ++ "block2", ++ "objc2", ++ "objc2-foundation", ++ "objc2-metal", ++] ++ ++[[package]] ++name = "objc2-core-location" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" ++dependencies = [ ++ "block2", ++ "objc2", ++ "objc2-contacts", ++ "objc2-foundation", ++] ++ ++[[package]] ++name = "objc2-encode" ++version = "4.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" ++ ++[[package]] ++name = "objc2-foundation" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" ++dependencies = [ ++ "bitflags 2.10.0", ++ "block2", ++ "dispatch", ++ "libc", ++ "objc2", ++] ++ ++[[package]] ++name = "objc2-link-presentation" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" ++dependencies = [ ++ "block2", ++ "objc2", ++ "objc2-app-kit", ++ "objc2-foundation", ++] ++ ++[[package]] ++name = "objc2-metal" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" ++dependencies = [ ++ "bitflags 2.10.0", ++ "block2", ++ "objc2", ++ "objc2-foundation", ++] ++ ++[[package]] ++name = "objc2-quartz-core" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" ++dependencies = [ ++ "bitflags 2.10.0", ++ "block2", ++ "objc2", ++ "objc2-foundation", ++ "objc2-metal", ++] ++ ++[[package]] ++name = "objc2-symbols" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" ++dependencies = [ ++ "objc2", ++ "objc2-foundation", ++] ++ ++[[package]] ++name = "objc2-ui-kit" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" ++dependencies = [ ++ "bitflags 2.10.0", ++ "block2", ++ "objc2", ++ "objc2-cloud-kit", ++ "objc2-core-data", ++ "objc2-core-image", ++ "objc2-core-location", ++ "objc2-foundation", ++ "objc2-link-presentation", ++ "objc2-quartz-core", ++ "objc2-symbols", ++ "objc2-uniform-type-identifiers", ++ "objc2-user-notifications", ++] ++ ++[[package]] ++name = "objc2-uniform-type-identifiers" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" ++dependencies = [ ++ "block2", ++ "objc2", ++ "objc2-foundation", ++] ++ ++[[package]] ++name = "objc2-user-notifications" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" ++dependencies = [ ++ "bitflags 2.10.0", ++ "block2", ++ "objc2", ++ "objc2-core-location", ++ "objc2-foundation", ++] ++ ++[[package]] ++name = "objc_id" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" ++dependencies = [ ++ "objc", ++] ++ ++[[package]] ++name = "once_cell" ++version = "1.21.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" ++ ++[[package]] ++name = "once_cell_polyfill" ++version = "1.70.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" ++ ++[[package]] ++name = "option-ext" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" ++ ++[[package]] ++name = "orbclient" ++version = "0.3.50" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "52ad2c6bae700b7aa5d1cc30c59bdd3a1c180b09dbaea51e2ae2b8e1cf211fdd" ++dependencies = [ ++ "libc", ++ "libredox", ++] ++ ++[[package]] ++name = "ordered-stream" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" ++dependencies = [ ++ "futures-core", ++ "pin-project-lite", ++] ++ ++[[package]] ++name = "ouroboros" ++version = "0.18.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1e0f050db9c44b97a94723127e6be766ac5c340c48f2c4bb3ffa11713744be59" ++dependencies = [ ++ "aliasable", ++ "ouroboros_macro", ++ "static_assertions", ++] ++ ++[[package]] ++name = "ouroboros_macro" ++version = "0.18.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3c7028bdd3d43083f6d8d4d5187680d0d3560d54df4cc9d752005268b41e64d0" ++dependencies = [ ++ "heck", ++ "proc-macro2", ++ "proc-macro2-diagnostics", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "owned_ttf_parser" ++version = "0.25.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "36820e9051aca1014ddc75770aab4d68bc1e9e632f0f5627c4086bc216fb583b" ++dependencies = [ ++ "ttf-parser 0.25.1", ++] ++ ++[[package]] ++name = "page_size" ++version = "0.6.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da" ++dependencies = [ ++ "libc", ++ "winapi", ++] ++ ++[[package]] ++name = "palette" ++version = "0.7.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4cbf71184cc5ecc2e4e1baccdb21026c20e5fc3dcf63028a086131b3ab00b6e6" ++dependencies = [ ++ "approx", ++ "fast-srgb8", ++ "palette_derive", ++ "phf 0.11.3", ++ "serde", ++] ++ ++[[package]] ++name = "palette_derive" ++version = "0.7.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f5030daf005bface118c096f510ffb781fc28f9ab6a32ab224d8631be6851d30" ++dependencies = [ ++ "by_address", ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "parking" ++version = "2.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" ++ ++[[package]] ++name = "parking_lot" ++version = "0.11.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" ++dependencies = [ ++ "instant", ++ "lock_api", ++ "parking_lot_core 0.8.6", ++] ++ ++[[package]] ++name = "parking_lot" ++version = "0.12.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" ++dependencies = [ ++ "lock_api", ++ "parking_lot_core 0.9.12", ++] ++ ++[[package]] ++name = "parking_lot_core" ++version = "0.8.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" ++dependencies = [ ++ "cfg-if", ++ "instant", ++ "libc", ++ "redox_syscall 0.2.16", ++ "smallvec", ++ "winapi", ++] ++ ++[[package]] ++name = "parking_lot_core" ++version = "0.9.12" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" ++dependencies = [ ++ "cfg-if", ++ "libc", ++ "redox_syscall 0.5.18", ++ "smallvec", ++ "windows-link 0.2.1", ++] ++ ++[[package]] ++name = "parse-size" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "487f2ccd1e17ce8c1bfab3a65c89525af41cfad4c8659021a1e9a2aacd73b89b" ++ ++[[package]] ++name = "paste" ++version = "1.0.15" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" ++ ++[[package]] ++name = "percent-encoding" ++version = "2.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" ++ ++[[package]] ++name = "phf" ++version = "0.11.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" ++dependencies = [ ++ "phf_macros 0.11.3", ++ "phf_shared 0.11.3", ++] ++ ++[[package]] ++name = "phf" ++version = "0.13.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" ++dependencies = [ ++ "phf_macros 0.13.1", ++ "phf_shared 0.13.1", ++ "serde", ++] ++ ++[[package]] ++name = "phf_generator" ++version = "0.11.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" ++dependencies = [ ++ "phf_shared 0.11.3", ++ "rand 0.8.5", ++] ++ ++[[package]] ++name = "phf_generator" ++version = "0.13.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" ++dependencies = [ ++ "fastrand", ++ "phf_shared 0.13.1", ++] ++ ++[[package]] ++name = "phf_macros" ++version = "0.11.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" ++dependencies = [ ++ "phf_generator 0.11.3", ++ "phf_shared 0.11.3", ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "phf_macros" ++version = "0.13.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" ++dependencies = [ ++ "phf_generator 0.13.1", ++ "phf_shared 0.13.1", ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++ "uncased", ++] ++ ++[[package]] ++name = "phf_shared" ++version = "0.11.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" ++dependencies = [ ++ "siphasher", ++] ++ ++[[package]] ++name = "phf_shared" ++version = "0.13.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" ++dependencies = [ ++ "siphasher", ++ "uncased", ++] ++ ++[[package]] ++name = "pico-args" ++version = "0.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" ++ ++[[package]] ++name = "pin-project" ++version = "1.1.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" ++dependencies = [ ++ "pin-project-internal", ++] ++ ++[[package]] ++name = "pin-project-internal" ++version = "1.1.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "pin-project-lite" ++version = "0.2.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" ++ ++[[package]] ++name = "pin-utils" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" ++ ++[[package]] ++name = "piper" ++version = "0.2.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" ++dependencies = [ ++ "atomic-waker", ++ "fastrand", ++ "futures-io", ++] ++ ++[[package]] ++name = "pkg-config" ++version = "0.3.32" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" ++ ++[[package]] ++name = "pkgar" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2a75ef5508090a60ee9b349eb5775a52b083a6b8b4cc6ff7b6931ccb8e319315" ++dependencies = [ ++ "blake3", ++ "bytemuck", ++ "lzma-rust2", ++ "pkgar-core", ++ "pkgar-keys", ++ "thiserror 2.0.18", ++] ++ ++[[package]] ++name = "pkgar-core" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "adce00b7a00ce1fb8a52d8989f13186886a0a5bd05058609ac2d619260bcf1da" ++dependencies = [ ++ "bitflags 2.10.0", ++ "blake3", ++ "bytemuck", ++ "dryoc", ++] ++ ++[[package]] ++name = "pkgar-keys" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "246034987d0419421e9aced672f1902091cd25580893e1acf67fbcfbec8bf446" ++dependencies = [ ++ "hex", ++ "pkgar-core", ++ "seckey", ++ "serde", ++ "thiserror 2.0.18", ++ "toml 0.8.23", ++] ++ ++[[package]] ++name = "plain" ++version = "0.2.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" ++ ++[[package]] ++name = "png" ++version = "0.17.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" ++dependencies = [ ++ "bitflags 1.3.2", ++ "crc32fast", ++ "fdeflate", ++ "flate2", ++ "miniz_oxide", ++] ++ ++[[package]] ++name = "png" ++version = "0.18.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "97baced388464909d42d89643fe4361939af9b7ce7a31ee32a168f832a70f2a0" ++dependencies = [ ++ "bitflags 2.10.0", ++ "crc32fast", ++ "fdeflate", ++ "flate2", ++ "miniz_oxide", ++] ++ ++[[package]] ++name = "polling" ++version = "3.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" ++dependencies = [ ++ "cfg-if", ++ "concurrent-queue", ++ "hermit-abi", ++ "pin-project-lite", ++ "rustix 1.1.4", ++ "windows-sys 0.61.2", ++] ++ ++[[package]] ++name = "portable-atomic" ++version = "1.13.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950" ++ ++[[package]] ++name = "portable-atomic-util" ++version = "0.2.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" ++dependencies = [ ++ "portable-atomic", ++] ++ ++[[package]] ++name = "potential_utf" ++version = "0.1.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" ++dependencies = [ ++ "zerovec", ++] ++ ++[[package]] ++name = "ppv-lite86" ++version = "0.2.21" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" ++dependencies = [ ++ "zerocopy", ++] ++ ++[[package]] ++name = "presser" ++version = "0.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" ++ ++[[package]] ++name = "proc-macro-crate" ++version = "3.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" ++dependencies = [ ++ "toml_edit 0.23.10+spec-1.0.0", ++] ++ ++[[package]] ++name = "proc-macro-error-attr2" ++version = "2.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++] ++ ++[[package]] ++name = "proc-macro-error2" ++version = "2.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" ++dependencies = [ ++ "proc-macro-error-attr2", ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "proc-macro2" ++version = "1.0.106" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" ++dependencies = [ ++ "unicode-ident", ++] ++ ++[[package]] ++name = "proc-macro2-diagnostics" ++version = "0.10.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++ "version_check", ++ "yansi", ++] ++ ++[[package]] ++name = "profiling" ++version = "1.0.17" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773" ++ ++[[package]] ++name = "pxfm" ++version = "0.1.27" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7186d3822593aa4393561d186d1393b3923e9d6163d3fbfd6e825e3e6cf3e6a8" ++dependencies = [ ++ "num-traits", ++] ++ ++[[package]] ++name = "quick-xml" ++version = "0.38.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b66c2058c55a409d601666cffe35f04333cf1013010882cec174a7467cd4e21c" ++dependencies = [ ++ "memchr", ++] ++ ++[[package]] ++name = "quinn" ++version = "0.11.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" ++dependencies = [ ++ "bytes", ++ "cfg_aliases 0.2.1", ++ "pin-project-lite", ++ "quinn-proto", ++ "quinn-udp", ++ "rustc-hash 2.1.1", ++ "rustls", ++ "socket2", ++ "thiserror 2.0.18", ++ "tokio", ++ "tracing", ++ "web-time", ++] ++ ++[[package]] ++name = "quinn-proto" ++version = "0.11.13" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" ++dependencies = [ ++ "bytes", ++ "getrandom 0.3.4", ++ "lru-slab", ++ "rand 0.9.2", ++ "ring", ++ "rustc-hash 2.1.1", ++ "rustls", ++ "rustls-pki-types", ++ "slab", ++ "thiserror 2.0.18", ++ "tinyvec", ++ "tracing", ++ "web-time", ++] ++ ++[[package]] ++name = "quinn-udp" ++version = "0.5.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" ++dependencies = [ ++ "cfg_aliases 0.2.1", ++ "libc", ++ "once_cell", ++ "socket2", ++ "tracing", ++ "windows-sys 0.60.2", ++] ++ ++[[package]] ++name = "quote" ++version = "1.0.43" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a" ++dependencies = [ ++ "proc-macro2", ++] ++ ++[[package]] ++name = "r-efi" ++version = "5.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" ++ ++[[package]] ++name = "rand" ++version = "0.8.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" ++dependencies = [ ++ "rand_core 0.6.4", ++] ++ ++[[package]] ++name = "rand" ++version = "0.9.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" ++dependencies = [ ++ "rand_chacha", ++ "rand_core 0.9.5", ++] ++ ++[[package]] ++name = "rand_chacha" ++version = "0.9.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" ++dependencies = [ ++ "ppv-lite86", ++ "rand_core 0.9.5", ++] ++ ++[[package]] ++name = "rand_core" ++version = "0.6.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" ++ ++[[package]] ++name = "rand_core" ++version = "0.9.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" ++dependencies = [ ++ "getrandom 0.3.4", ++] ++ ++[[package]] ++name = "range-alloc" ++version = "0.1.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ca45419789ae5a7899559e9512e58ca889e41f04f1f2445e9f4b290ceccd1d08" ++ ++[[package]] ++name = "range-tree" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "384c2842d4e069d5ccacf5fe1dca4ef8d07a5444329715f0fc3c61813502d4d1" ++ ++[[package]] ++name = "rangemap" ++version = "1.7.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "973443cf09a9c8656b574a866ab68dfa19f0867d0340648c7d2f6a71b8a8ea68" ++ ++[[package]] ++name = "raw-window-handle" ++version = "0.6.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" ++ ++[[package]] ++name = "rayon-core" ++version = "1.13.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" ++dependencies = [ ++ "crossbeam-deque", ++ "crossbeam-utils", ++] ++ ++[[package]] ++name = "read-fonts" ++version = "0.35.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6717cf23b488adf64b9d711329542ba34de147df262370221940dfabc2c91358" ++dependencies = [ ++ "bytemuck", ++ "font-types 0.10.1", ++] ++ ++[[package]] ++name = "read-fonts" ++version = "0.37.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7b634fabf032fab15307ffd272149b622260f55974d9fad689292a5d33df02e5" ++dependencies = [ ++ "bytemuck", ++ "core_maths", ++ "font-types 0.11.2", ++] ++ ++[[package]] ++name = "redox-path" ++version = "0.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "436d45c2b6a5b159d43da708e62b25be3a4a3d5550d654b72216ade4c4bfd717" ++ ++[[package]] ++name = "redox-pkg" ++version = "0.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "618ad6a26b28ba7e0acd8c4188680306e482ef1924f197ef9c541dd5e5cfaf01" ++dependencies = [ ++ "hex", ++ "indicatif", ++ "pkgar", ++ "pkgar-core", ++ "reqwest", ++ "serde", ++ "serde_derive", ++ "thiserror 2.0.18", ++ "toml 0.8.23", ++] ++ ++[[package]] ++name = "redox-scheme" ++version = "0.9.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5eb0cee524a5c6e4db180250f699e101ee25f3f79ad2618527e539e028cb6722" ++dependencies = [ ++ "libredox", ++ "redox_syscall 0.7.0", ++] ++ ++[[package]] ++name = "redox_event" ++version = "0.4.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4ea3e412d205440c7b0218af26247226f979ed1201674cda7a33cc70609084b5" ++dependencies = [ ++ "bitflags 2.10.0", ++ "libredox", ++] ++ ++[[package]] ++name = "redox_installer" ++version = "0.2.42" ++dependencies = [ ++ "anyhow", ++ "arg_parser", ++ "fatfs", ++ "fscommon", ++ "gpt", ++ "libc", ++ "libredox", ++ "pkgar", ++ "pkgar-core", ++ "pkgar-keys", ++ "rand 0.9.2", ++ "redox-pkg", ++ "redox_syscall 0.7.0", ++ "redoxfs", ++ "ring", ++ "rust-argon2", ++ "serde", ++ "serde_derive", ++ "termion", ++ "toml 0.8.23", ++ "uuid", ++] ++ ++[[package]] ++name = "redox_installer_gui" ++version = "0.1.0" ++dependencies = [ ++ "anyhow", ++ "libcosmic", ++ "libredox", ++ "pkgar", ++ "pkgar-core", ++ "pkgar-keys", ++ "redox_installer", ++ "redox_syscall 0.7.0", ++ "toml 0.8.23", ++] ++ ++[[package]] ++name = "redox_syscall" ++version = "0.2.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" ++dependencies = [ ++ "bitflags 1.3.2", ++] ++ ++[[package]] ++name = "redox_syscall" ++version = "0.5.18" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" ++dependencies = [ ++ "bitflags 2.10.0", ++] ++ ++[[package]] ++name = "redox_syscall" ++version = "0.7.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "49f3fe0889e69e2ae9e41f4d6c4c0181701d00e4697b356fb1f74173a5e0ee27" ++dependencies = [ ++ "bitflags 2.10.0", ++] ++ ++[[package]] ++name = "redox_users" ++version = "0.5.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" ++dependencies = [ ++ "getrandom 0.2.17", ++ "libredox", ++ "thiserror 2.0.18", ++] ++ ++[[package]] ++name = "redoxfs" ++version = "0.9.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f790d2ee811995ee2ba5dd7693fae50a222fa2ca529bfd3e23734ddc10f0a065" ++dependencies = [ ++ "aes", ++ "argon2", ++ "base64ct", ++ "bitflags 2.10.0", ++ "endian-num", ++ "env_logger", ++ "fuser", ++ "getrandom 0.2.17", ++ "humansize", ++ "libc", ++ "libredox", ++ "log", ++ "lz4_flex", ++ "parse-size", ++ "range-tree", ++ "redox-path", ++ "redox-scheme", ++ "redox_syscall 0.7.0", ++ "seahash", ++ "termion", ++ "uuid", ++ "xts-mode", ++] ++ ++[[package]] ++name = "regex" ++version = "1.12.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" ++dependencies = [ ++ "aho-corasick", ++ "memchr", ++ "regex-automata", ++ "regex-syntax", ++] ++ ++[[package]] ++name = "regex-automata" ++version = "0.4.13" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" ++dependencies = [ ++ "aho-corasick", ++ "memchr", ++ "regex-syntax", ++] ++ ++[[package]] ++name = "regex-syntax" ++version = "0.8.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" ++ ++[[package]] ++name = "renderdoc-sys" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" ++ ++[[package]] ++name = "reqwest" ++version = "0.12.28" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" ++dependencies = [ ++ "base64", ++ "bytes", ++ "futures-channel", ++ "futures-core", ++ "futures-util", ++ "http", ++ "http-body", ++ "http-body-util", ++ "hyper", ++ "hyper-rustls", ++ "hyper-util", ++ "js-sys", ++ "log", ++ "percent-encoding", ++ "pin-project-lite", ++ "quinn", ++ "rustls", ++ "rustls-pki-types", ++ "serde", ++ "serde_json", ++ "serde_urlencoded", ++ "sync_wrapper", ++ "tokio", ++ "tokio-rustls", ++ "tower", ++ "tower-http", ++ "tower-service", ++ "url", ++ "wasm-bindgen", ++ "wasm-bindgen-futures", ++ "web-sys", ++ "webpki-roots", ++] ++ ++[[package]] ++name = "resvg" ++version = "0.42.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "944d052815156ac8fa77eaac055220e95ba0b01fa8887108ca710c03805d9051" ++dependencies = [ ++ "gif", ++ "jpeg-decoder", ++ "log", ++ "pico-args", ++ "rgb", ++ "svgtypes", ++ "tiny-skia", ++ "usvg", ++] ++ ++[[package]] ++name = "rgb" ++version = "0.8.52" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0c6a884d2998352bb4daf0183589aec883f16a6da1f4dde84d8e2e9a5409a1ce" ++dependencies = [ ++ "bytemuck", ++] ++ ++[[package]] ++name = "ring" ++version = "0.17.8" ++source = "git+https://gitlab.redox-os.org/redox-os/ring.git?branch=redox-0.17.8#fce20f12b6aad164a1a7e13ae1dcb46422b171c0" ++dependencies = [ ++ "cc", ++ "cfg-if", ++ "getrandom 0.2.17", ++ "libc", ++ "spin", ++ "untrusted", ++ "windows-sys 0.52.0", ++] ++ ++[[package]] ++name = "ron" ++version = "0.12.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4147b952f3f819eca0e99527022f7d6a8d05f111aeb0a62960c74eb283bec8fc" ++dependencies = [ ++ "bitflags 2.10.0", ++ "once_cell", ++ "serde", ++ "serde_derive", ++ "typeid", ++ "unicode-ident", ++] ++ ++[[package]] ++name = "roxmltree" ++version = "0.20.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" ++ ++[[package]] ++name = "rust-argon2" ++version = "3.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8ae76b7506744d254fd0eb2c0ff5c5d108201ccbb083111ac04a44eeda105680" ++dependencies = [ ++ "base64", ++ "blake2b_simd", ++ "constant_time_eq", ++ "crossbeam-utils", ++] ++ ++[[package]] ++name = "rust-embed" ++version = "8.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "04113cb9355a377d83f06ef1f0a45b8ab8cd7d8b1288160717d66df5c7988d27" ++dependencies = [ ++ "rust-embed-impl", ++ "rust-embed-utils", ++ "walkdir", ++] ++ ++[[package]] ++name = "rust-embed-impl" ++version = "8.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "da0902e4c7c8e997159ab384e6d0fc91c221375f6894346ae107f47dd0f3ccaa" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "rust-embed-utils", ++ "syn 2.0.114", ++ "walkdir", ++] ++ ++[[package]] ++name = "rust-embed-utils" ++version = "8.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5bcdef0be6fe7f6fa333b1073c949729274b05f123a0ad7efcb8efd878e5c3b1" ++dependencies = [ ++ "sha2", ++ "walkdir", ++] ++ ++[[package]] ++name = "rustc-hash" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" ++ ++[[package]] ++name = "rustc-hash" ++version = "2.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" ++ ++[[package]] ++name = "rustc_version" ++version = "0.4.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" ++dependencies = [ ++ "semver", ++] ++ ++[[package]] ++name = "rustix" ++version = "0.38.44" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" ++dependencies = [ ++ "bitflags 2.10.0", ++ "errno", ++ "libc", ++ "linux-raw-sys 0.4.15", ++ "windows-sys 0.59.0", ++] ++ ++[[package]] ++name = "rustix" ++version = "1.1.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" ++dependencies = [ ++ "bitflags 2.10.0", ++ "errno", ++ "libc", ++ "linux-raw-sys 0.12.1", ++ "windows-sys 0.61.2", ++] ++ ++[[package]] ++name = "rustls" ++version = "0.23.36" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" ++dependencies = [ ++ "once_cell", ++ "ring", ++ "rustls-pki-types", ++ "rustls-webpki", ++ "subtle", ++ "zeroize", ++] ++ ++[[package]] ++name = "rustls-pki-types" ++version = "1.14.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" ++dependencies = [ ++ "web-time", ++ "zeroize", ++] ++ ++[[package]] ++name = "rustls-webpki" ++version = "0.103.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" ++dependencies = [ ++ "ring", ++ "rustls-pki-types", ++ "untrusted", ++] ++ ++[[package]] ++name = "rustversion" ++version = "1.0.22" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" ++ ++[[package]] ++name = "rustybuzz" ++version = "0.14.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cfb9cf8877777222e4a3bc7eb247e398b56baba500c38c1c46842431adc8b55c" ++dependencies = [ ++ "bitflags 2.10.0", ++ "bytemuck", ++ "smallvec", ++ "ttf-parser 0.21.1", ++ "unicode-bidi-mirroring", ++ "unicode-ccc", ++ "unicode-properties", ++ "unicode-script", ++] ++ ++[[package]] ++name = "ryu" ++version = "1.0.22" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984" ++ ++[[package]] ++name = "salsa20" ++version = "0.10.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" ++dependencies = [ ++ "cipher", ++] ++ ++[[package]] ++name = "same-file" ++version = "1.0.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" ++dependencies = [ ++ "winapi-util", ++] ++ ++[[package]] ++name = "scoped-tls" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" ++ ++[[package]] ++name = "scopeguard" ++version = "1.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" ++ ++[[package]] ++name = "sctk-adwaita" ++version = "0.10.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec" ++dependencies = [ ++ "ab_glyph", ++ "log", ++ "memmap2", ++ "smithay-client-toolkit 0.19.2", ++ "tiny-skia", ++] ++ ++[[package]] ++name = "seahash" ++version = "4.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" ++ ++[[package]] ++name = "seckey" ++version = "0.12.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cd64b8649b6038d9ea27fde99aeded1c5571c00af18a6bc54ed6c1e01d7d2083" ++dependencies = [ ++ "memsec", ++] ++ ++[[package]] ++name = "self_cell" ++version = "1.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b12e76d157a900eb52e81bc6e9f3069344290341720e9178cde2407113ac8d89" ++ ++[[package]] ++name = "semver" ++version = "1.0.27" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" ++ ++[[package]] ++name = "serde" ++version = "1.0.228" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" ++dependencies = [ ++ "serde_core", ++ "serde_derive", ++] ++ ++[[package]] ++name = "serde_core" ++version = "1.0.228" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" ++dependencies = [ ++ "serde_derive", ++] ++ ++[[package]] ++name = "serde_derive" ++version = "1.0.228" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "serde_json" ++version = "1.0.149" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" ++dependencies = [ ++ "indexmap", ++ "itoa", ++ "memchr", ++ "serde", ++ "serde_core", ++ "zmij", ++] ++ ++[[package]] ++name = "serde_repr" ++version = "0.1.20" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "serde_spanned" ++version = "0.6.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" ++dependencies = [ ++ "serde", ++] ++ ++[[package]] ++name = "serde_urlencoded" ++version = "0.7.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" ++dependencies = [ ++ "form_urlencoded", ++ "itoa", ++ "ryu", ++ "serde", ++] ++ ++[[package]] ++name = "sha2" ++version = "0.10.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" ++dependencies = [ ++ "cfg-if", ++ "cpufeatures 0.2.17", ++ "digest", ++] ++ ++[[package]] ++name = "shlex" ++version = "1.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" ++ ++[[package]] ++name = "signal-hook-registry" ++version = "1.4.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" ++dependencies = [ ++ "errno", ++ "libc", ++] ++ ++[[package]] ++name = "simd-adler32" ++version = "0.3.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" ++ ++[[package]] ++name = "simplecss" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7a9c6883ca9c3c7c90e888de77b7a5c849c779d25d74a1269b0218b14e8b136c" ++dependencies = [ ++ "log", ++] ++ ++[[package]] ++name = "siphasher" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" ++ ++[[package]] ++name = "skrifa" ++version = "0.37.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8c31071dedf532758ecf3fed987cdb4bd9509f900e026ab684b4ecb81ea49841" ++dependencies = [ ++ "bytemuck", ++ "read-fonts 0.35.0", ++] ++ ++[[package]] ++name = "skrifa" ++version = "0.40.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7fbdfe3d2475fbd7ddd1f3e5cf8288a30eb3e5f95832829570cd88115a7434ac" ++dependencies = [ ++ "bytemuck", ++ "read-fonts 0.37.0", ++] ++ ++[[package]] ++name = "slab" ++version = "0.4.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" ++ ++[[package]] ++name = "slotmap" ++version = "1.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038" ++dependencies = [ ++ "version_check", ++] ++ ++[[package]] ++name = "smallvec" ++version = "1.15.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" ++ ++[[package]] ++name = "smithay-client-toolkit" ++version = "0.19.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" ++dependencies = [ ++ "bitflags 2.10.0", ++ "calloop 0.13.0", ++ "calloop-wayland-source 0.3.0", ++ "cursor-icon", ++ "libc", ++ "log", ++ "memmap2", ++ "rustix 0.38.44", ++ "thiserror 1.0.69", ++ "wayland-backend", ++ "wayland-client", ++ "wayland-csd-frame", ++ "wayland-cursor", ++ "wayland-protocols", ++ "wayland-protocols-wlr", ++ "wayland-scanner", ++ "xkeysym", ++] ++ ++[[package]] ++name = "smithay-client-toolkit" ++version = "0.20.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0512da38f5e2b31201a93524adb8d3136276fa4fe4aafab4e1f727a82b534cc0" ++dependencies = [ ++ "bitflags 2.10.0", ++ "bytemuck", ++ "calloop 0.14.3", ++ "calloop-wayland-source 0.4.1", ++ "cursor-icon", ++ "libc", ++ "log", ++ "memmap2", ++ "pkg-config", ++ "rustix 1.1.4", ++ "thiserror 2.0.18", ++ "wayland-backend", ++ "wayland-client", ++ "wayland-csd-frame", ++ "wayland-cursor", ++ "wayland-protocols", ++ "wayland-protocols-experimental", ++ "wayland-protocols-misc", ++ "wayland-protocols-wlr", ++ "wayland-scanner", ++ "xkbcommon", ++ "xkeysym", ++] ++ ++[[package]] ++name = "smithay-clipboard" ++version = "0.8.0" ++source = "git+https://github.com/pop-os/smithay-clipboard?tag=pop-dnd-5#5a3007def49eb678d1144850c9ee04b80707c56a" ++dependencies = [ ++ "libc", ++ "raw-window-handle", ++ "smithay-client-toolkit 0.19.2", ++ "wayland-backend", ++] ++ ++[[package]] ++name = "smol_str" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" ++dependencies = [ ++ "serde", ++] ++ ++[[package]] ++name = "smol_str" ++version = "0.3.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4aaa7368fcf4852a4c2dd92df0cace6a71f2091ca0a23391ce7f3a31833f1523" ++ ++[[package]] ++name = "socket2" ++version = "0.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" ++dependencies = [ ++ "libc", ++ "windows-sys 0.60.2", ++] ++ ++[[package]] ++name = "softbuffer" ++version = "0.4.1" ++source = "git+https://github.com/pop-os/softbuffer?tag=cosmic-4.0#a3f77e251e7422803f693df6e3fc313c010c4dcb" ++dependencies = [ ++ "as-raw-xcb-connection", ++ "bytemuck", ++ "cfg_aliases 0.2.1", ++ "cocoa", ++ "core-graphics", ++ "drm", ++ "fastrand", ++ "foreign-types", ++ "js-sys", ++ "log", ++ "memmap2", ++ "objc", ++ "raw-window-handle", ++ "redox_syscall 0.5.18", ++ "rustix 0.38.44", ++ "tiny-xlib", ++ "wasm-bindgen", ++ "wayland-backend", ++ "wayland-client", ++ "wayland-sys", ++ "web-sys", ++ "windows-sys 0.52.0", ++ "x11rb", ++] ++ ++[[package]] ++name = "spin" ++version = "0.9.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" ++ ++[[package]] ++name = "spirv" ++version = "0.3.0+sdk-1.3.268.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" ++dependencies = [ ++ "bitflags 2.10.0", ++] ++ ++[[package]] ++name = "stable_deref_trait" ++version = "1.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" ++ ++[[package]] ++name = "static_assertions" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" ++ ++[[package]] ++name = "strict-num" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" ++dependencies = [ ++ "float-cmp", ++] ++ ++[[package]] ++name = "strsim" ++version = "0.11.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" ++ ++[[package]] ++name = "subtle" ++version = "2.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" ++ ++[[package]] ++name = "svg_fmt" ++version = "0.4.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0193cc4331cfd2f3d2011ef287590868599a2f33c3e69bc22c1a3d3acf9e02fb" ++ ++[[package]] ++name = "svgtypes" ++version = "0.15.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "68c7541fff44b35860c1a7a47a7cadf3e4a304c457b58f9870d9706ece028afc" ++dependencies = [ ++ "kurbo 0.11.3", ++ "siphasher", ++] ++ ++[[package]] ++name = "swash" ++version = "0.2.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "47846491253e976bdd07d0f9cc24b7daf24720d11309302ccbbc6e6b6e53550a" ++dependencies = [ ++ "skrifa 0.37.0", ++ "yazi", ++ "zeno", ++] ++ ++[[package]] ++name = "syn" ++version = "1.0.109" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "unicode-ident", ++] ++ ++[[package]] ++name = "syn" ++version = "2.0.114" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "unicode-ident", ++] ++ ++[[package]] ++name = "sync_wrapper" ++version = "1.0.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" ++dependencies = [ ++ "futures-core", ++] ++ ++[[package]] ++name = "synstructure" ++version = "0.13.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "sys-locale" ++version = "0.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "taffy" ++version = "0.9.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "41ba83ebaf2954d31d05d67340fd46cebe99da2b7133b0dd68d70c65473a437b" ++dependencies = [ ++ "arrayvec", ++ "grid", ++ "serde", ++ "slotmap", ++] ++ ++[[package]] ++name = "tempfile" ++version = "3.24.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c" ++dependencies = [ ++ "fastrand", ++ "getrandom 0.3.4", ++ "once_cell", ++ "rustix 1.1.4", ++ "windows-sys 0.61.2", ++] ++ ++[[package]] ++name = "termcolor" ++version = "1.4.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" ++dependencies = [ ++ "winapi-util", ++] ++ ++[[package]] ++name = "termion" ++version = "4.0.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f44138a9ae08f0f502f24104d82517ef4da7330c35acd638f1f29d3cd5475ecb" ++dependencies = [ ++ "libc", ++ "numtoa", ++] ++ ++[[package]] ++name = "thiserror" ++version = "1.0.69" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" ++dependencies = [ ++ "thiserror-impl 1.0.69", ++] ++ ++[[package]] ++name = "thiserror" ++version = "2.0.18" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" ++dependencies = [ ++ "thiserror-impl 2.0.18", ++] ++ ++[[package]] ++name = "thiserror-impl" ++version = "1.0.69" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "thiserror-impl" ++version = "2.0.18" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "tiny-skia" ++version = "0.11.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab" ++dependencies = [ ++ "arrayref", ++ "arrayvec", ++ "bytemuck", ++ "cfg-if", ++ "log", ++ "png 0.17.16", ++ "tiny-skia-path", ++] ++ ++[[package]] ++name = "tiny-skia-path" ++version = "0.11.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93" ++dependencies = [ ++ "arrayref", ++ "bytemuck", ++ "strict-num", ++] ++ ++[[package]] ++name = "tiny-xlib" ++version = "0.2.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0324504befd01cab6e0c994f34b2ffa257849ee019d3fb3b64fb2c858887d89e" ++dependencies = [ ++ "as-raw-xcb-connection", ++ "ctor-lite", ++ "libloading", ++ "pkg-config", ++ "tracing", ++] ++ ++[[package]] ++name = "tinystr" ++version = "0.8.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" ++dependencies = [ ++ "displaydoc", ++ "serde_core", ++ "zerovec", ++] ++ ++[[package]] ++name = "tinyvec" ++version = "1.10.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" ++dependencies = [ ++ "tinyvec_macros", ++] ++ ++[[package]] ++name = "tinyvec_macros" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" ++ ++[[package]] ++name = "tokio" ++version = "1.49.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" ++dependencies = [ ++ "bytes", ++ "libc", ++ "mio", ++ "pin-project-lite", ++ "socket2", ++ "windows-sys 0.61.2", ++] ++ ++[[package]] ++name = "tokio-rustls" ++version = "0.26.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" ++dependencies = [ ++ "rustls", ++ "tokio", ++] ++ ++[[package]] ++name = "toml" ++version = "0.5.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" ++dependencies = [ ++ "serde", ++] ++ ++[[package]] ++name = "toml" ++version = "0.8.23" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" ++dependencies = [ ++ "serde", ++ "serde_spanned", ++ "toml_datetime 0.6.11", ++ "toml_edit 0.22.27", ++] ++ ++[[package]] ++name = "toml_datetime" ++version = "0.6.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" ++dependencies = [ ++ "serde", ++] ++ ++[[package]] ++name = "toml_datetime" ++version = "0.7.5+spec-1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" ++dependencies = [ ++ "serde_core", ++] ++ ++[[package]] ++name = "toml_edit" ++version = "0.22.27" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" ++dependencies = [ ++ "indexmap", ++ "serde", ++ "serde_spanned", ++ "toml_datetime 0.6.11", ++ "toml_write", ++ "winnow", ++] ++ ++[[package]] ++name = "toml_edit" ++version = "0.23.10+spec-1.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" ++dependencies = [ ++ "indexmap", ++ "toml_datetime 0.7.5+spec-1.1.0", ++ "toml_parser", ++ "winnow", ++] ++ ++[[package]] ++name = "toml_parser" ++version = "1.0.6+spec-1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" ++dependencies = [ ++ "winnow", ++] ++ ++[[package]] ++name = "toml_write" ++version = "0.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" ++ ++[[package]] ++name = "tower" ++version = "0.5.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" ++dependencies = [ ++ "futures-core", ++ "futures-util", ++ "pin-project-lite", ++ "sync_wrapper", ++ "tokio", ++ "tower-layer", ++ "tower-service", ++] ++ ++[[package]] ++name = "tower-http" ++version = "0.6.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" ++dependencies = [ ++ "bitflags 2.10.0", ++ "bytes", ++ "futures-util", ++ "http", ++ "http-body", ++ "iri-string", ++ "pin-project-lite", ++ "tower", ++ "tower-layer", ++ "tower-service", ++] ++ ++[[package]] ++name = "tower-layer" ++version = "0.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" ++ ++[[package]] ++name = "tower-service" ++version = "0.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" ++ ++[[package]] ++name = "tracing" ++version = "0.1.44" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" ++dependencies = [ ++ "log", ++ "pin-project-lite", ++ "tracing-attributes", ++ "tracing-core", ++] ++ ++[[package]] ++name = "tracing-attributes" ++version = "0.1.31" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "tracing-core" ++version = "0.1.36" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" ++dependencies = [ ++ "once_cell", ++] ++ ++[[package]] ++name = "try-lock" ++version = "0.2.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" ++ ++[[package]] ++name = "ttf-parser" ++version = "0.21.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" ++ ++[[package]] ++name = "ttf-parser" ++version = "0.25.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" ++dependencies = [ ++ "core_maths", ++] ++ ++[[package]] ++name = "type-map" ++version = "0.5.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cb30dbbd9036155e74adad6812e9898d03ec374946234fbcebd5dfc7b9187b90" ++dependencies = [ ++ "rustc-hash 2.1.1", ++] ++ ++[[package]] ++name = "typeid" ++version = "1.0.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" ++ ++[[package]] ++name = "typenum" ++version = "1.19.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" ++ ++[[package]] ++name = "uds_windows" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" ++dependencies = [ ++ "memoffset", ++ "tempfile", ++ "winapi", ++] ++ ++[[package]] ++name = "uncased" ++version = "0.9.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" ++dependencies = [ ++ "version_check", ++] ++ ++[[package]] ++name = "unic-langid" ++version = "0.9.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a28ba52c9b05311f4f6e62d5d9d46f094bd6e84cb8df7b3ef952748d752a7d05" ++dependencies = [ ++ "unic-langid-impl", ++] ++ ++[[package]] ++name = "unic-langid-impl" ++version = "0.9.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dce1bf08044d4b7a94028c93786f8566047edc11110595914de93362559bc658" ++dependencies = [ ++ "serde", ++ "tinystr", ++] ++ ++[[package]] ++name = "unicode-bidi" ++version = "0.3.18" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" ++ ++[[package]] ++name = "unicode-bidi-mirroring" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "23cb788ffebc92c5948d0e997106233eeb1d8b9512f93f41651f52b6c5f5af86" ++ ++[[package]] ++name = "unicode-ccc" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1df77b101bcc4ea3d78dafc5ad7e4f58ceffe0b2b16bf446aeb50b6cb4157656" ++ ++[[package]] ++name = "unicode-ident" ++version = "1.0.22" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" ++ ++[[package]] ++name = "unicode-linebreak" ++version = "0.1.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" ++ ++[[package]] ++name = "unicode-properties" ++version = "0.1.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" ++ ++[[package]] ++name = "unicode-script" ++version = "0.5.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "383ad40bb927465ec0ce7720e033cb4ca06912855fc35db31b5755d0de75b1ee" ++ ++[[package]] ++name = "unicode-segmentation" ++version = "1.12.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" ++ ++[[package]] ++name = "unicode-vo" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b1d386ff53b415b7fe27b50bb44679e2cc4660272694b7b6f3326d8480823a94" ++ ++[[package]] ++name = "unicode-width" ++version = "0.1.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" ++ ++[[package]] ++name = "unicode-width" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" ++ ++[[package]] ++name = "unicode-xid" ++version = "0.2.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" ++ ++[[package]] ++name = "untrusted" ++version = "0.9.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" ++ ++[[package]] ++name = "url" ++version = "2.5.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" ++dependencies = [ ++ "form_urlencoded", ++ "idna", ++ "percent-encoding", ++ "serde", ++] ++ ++[[package]] ++name = "usvg" ++version = "0.42.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b84ea542ae85c715f07b082438a4231c3760539d902e11d093847a0b22963032" ++dependencies = [ ++ "base64", ++ "data-url", ++ "flate2", ++ "fontdb 0.18.0", ++ "imagesize", ++ "kurbo 0.11.3", ++ "log", ++ "pico-args", ++ "roxmltree", ++ "rustybuzz", ++ "simplecss", ++ "siphasher", ++ "strict-num", ++ "svgtypes", ++ "tiny-skia-path", ++ "unicode-bidi", ++ "unicode-script", ++ "unicode-vo", ++ "xmlwriter", ++] ++ ++[[package]] ++name = "utf8_iter" ++version = "1.0.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" ++ ++[[package]] ++name = "utf8parse" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" ++ ++[[package]] ++name = "uuid" ++version = "1.19.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a" ++dependencies = [ ++ "getrandom 0.3.4", ++ "js-sys", ++ "serde_core", ++ "wasm-bindgen", ++] ++ ++[[package]] ++name = "version_check" ++version = "0.9.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" ++ ++[[package]] ++name = "walkdir" ++version = "2.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" ++dependencies = [ ++ "same-file", ++ "winapi-util", ++] ++ ++[[package]] ++name = "want" ++version = "0.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" ++dependencies = [ ++ "try-lock", ++] ++ ++[[package]] ++name = "wasi" ++version = "0.11.1+wasi-snapshot-preview1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" ++ ++[[package]] ++name = "wasip2" ++version = "1.0.2+wasi-0.2.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" ++dependencies = [ ++ "wit-bindgen", ++] ++ ++[[package]] ++name = "wasm-bindgen" ++version = "0.2.108" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" ++dependencies = [ ++ "cfg-if", ++ "once_cell", ++ "rustversion", ++ "wasm-bindgen-macro", ++ "wasm-bindgen-shared", ++] ++ ++[[package]] ++name = "wasm-bindgen-futures" ++version = "0.4.58" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f" ++dependencies = [ ++ "cfg-if", ++ "futures-util", ++ "js-sys", ++ "once_cell", ++ "wasm-bindgen", ++ "web-sys", ++] ++ ++[[package]] ++name = "wasm-bindgen-macro" ++version = "0.2.108" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" ++dependencies = [ ++ "quote", ++ "wasm-bindgen-macro-support", ++] ++ ++[[package]] ++name = "wasm-bindgen-macro-support" ++version = "0.2.108" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" ++dependencies = [ ++ "bumpalo", ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++ "wasm-bindgen-shared", ++] ++ ++[[package]] ++name = "wasm-bindgen-shared" ++version = "0.2.108" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" ++dependencies = [ ++ "unicode-ident", ++] ++ ++[[package]] ++name = "wasm-timer" ++version = "0.2.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" ++dependencies = [ ++ "futures", ++ "js-sys", ++ "parking_lot 0.11.2", ++ "pin-utils", ++ "wasm-bindgen", ++ "wasm-bindgen-futures", ++ "web-sys", ++] ++ ++[[package]] ++name = "wayland-backend" ++version = "0.3.12" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fee64194ccd96bf648f42a65a7e589547096dfa702f7cadef84347b66ad164f9" ++dependencies = [ ++ "cc", ++ "downcast-rs", ++ "rustix 1.1.4", ++ "scoped-tls", ++ "smallvec", ++ "wayland-sys", ++] ++ ++[[package]] ++name = "wayland-client" ++version = "0.31.12" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b8e6faa537fbb6c186cb9f1d41f2f811a4120d1b57ec61f50da451a0c5122bec" ++dependencies = [ ++ "bitflags 2.10.0", ++ "rustix 1.1.4", ++ "wayland-backend", ++ "wayland-scanner", ++] ++ ++[[package]] ++name = "wayland-csd-frame" ++version = "0.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" ++dependencies = [ ++ "bitflags 2.10.0", ++ "cursor-icon", ++ "wayland-backend", ++] ++ ++[[package]] ++name = "wayland-cursor" ++version = "0.31.12" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5864c4b5b6064b06b1e8b74ead4a98a6c45a285fe7a0e784d24735f011fdb078" ++dependencies = [ ++ "rustix 1.1.4", ++ "wayland-client", ++ "xcursor", ++] ++ ++[[package]] ++name = "wayland-protocols" ++version = "0.32.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "baeda9ffbcfc8cd6ddaade385eaf2393bd2115a69523c735f12242353c3df4f3" ++dependencies = [ ++ "bitflags 2.10.0", ++ "wayland-backend", ++ "wayland-client", ++ "wayland-scanner", ++ "wayland-server", ++] ++ ++[[package]] ++name = "wayland-protocols-experimental" ++version = "20250721.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "40a1f863128dcaaec790d7b4b396cc9b9a7a079e878e18c47e6c2d2c5a8dcbb1" ++dependencies = [ ++ "bitflags 2.10.0", ++ "wayland-backend", ++ "wayland-client", ++ "wayland-protocols", ++ "wayland-scanner", ++] ++ ++[[package]] ++name = "wayland-protocols-misc" ++version = "0.3.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "791c58fdeec5406aa37169dd815327d1e47f334219b523444bc26d70ceb4c34e" ++dependencies = [ ++ "bitflags 2.10.0", ++ "wayland-backend", ++ "wayland-client", ++ "wayland-protocols", ++ "wayland-scanner", ++] ++ ++[[package]] ++name = "wayland-protocols-plasma" ++version = "0.3.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "aa98634619300a535a9a97f338aed9a5ff1e01a461943e8346ff4ae26007306b" ++dependencies = [ ++ "bitflags 2.10.0", ++ "wayland-backend", ++ "wayland-client", ++ "wayland-protocols", ++ "wayland-scanner", ++] ++ ++[[package]] ++name = "wayland-protocols-wlr" ++version = "0.3.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e9597cdf02cf0c34cd5823786dce6b5ae8598f05c2daf5621b6e178d4f7345f3" ++dependencies = [ ++ "bitflags 2.10.0", ++ "wayland-backend", ++ "wayland-client", ++ "wayland-protocols", ++ "wayland-scanner", ++ "wayland-server", ++] ++ ++[[package]] ++name = "wayland-scanner" ++version = "0.31.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5423e94b6a63e68e439803a3e153a9252d5ead12fd853334e2ad33997e3889e3" ++dependencies = [ ++ "proc-macro2", ++ "quick-xml", ++ "quote", ++] ++ ++[[package]] ++name = "wayland-server" ++version = "0.31.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9297ab90f8d1f597711d36455c5b1b2290eca59b8134485e377a296b80b118c9" ++dependencies = [ ++ "bitflags 2.10.0", ++ "downcast-rs", ++ "rustix 1.1.4", ++ "wayland-backend", ++ "wayland-scanner", ++] ++ ++[[package]] ++name = "wayland-sys" ++version = "0.31.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1e6dbfc3ac5ef974c92a2235805cc0114033018ae1290a72e474aa8b28cbbdfd" ++dependencies = [ ++ "dlib", ++ "log", ++ "once_cell", ++ "pkg-config", ++] ++ ++[[package]] ++name = "web-sys" ++version = "0.3.85" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" ++dependencies = [ ++ "js-sys", ++ "wasm-bindgen", ++] ++ ++[[package]] ++name = "web-time" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" ++dependencies = [ ++ "js-sys", ++ "wasm-bindgen", ++] ++ ++[[package]] ++name = "webpki-roots" ++version = "1.0.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "12bed680863276c63889429bfd6cab3b99943659923822de1c8a39c49e4d722c" ++dependencies = [ ++ "rustls-pki-types", ++] ++ ++[[package]] ++name = "weezl" ++version = "0.1.12" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" ++ ++[[package]] ++name = "wgpu" ++version = "22.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e1d1c4ba43f80542cf63a0a6ed3134629ae73e8ab51e4b765a67f3aa062eb433" ++dependencies = [ ++ "arrayvec", ++ "cfg_aliases 0.1.1", ++ "document-features", ++ "js-sys", ++ "log", ++ "naga", ++ "parking_lot 0.12.5", ++ "profiling", ++ "raw-window-handle", ++ "smallvec", ++ "static_assertions", ++ "wasm-bindgen", ++ "wasm-bindgen-futures", ++ "web-sys", ++ "wgpu-core", ++ "wgpu-hal", ++ "wgpu-types", ++] ++ ++[[package]] ++name = "wgpu-core" ++version = "22.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0348c840d1051b8e86c3bcd31206080c5e71e5933dabd79be1ce732b0b2f089a" ++dependencies = [ ++ "arrayvec", ++ "bit-vec", ++ "bitflags 2.10.0", ++ "cfg_aliases 0.1.1", ++ "document-features", ++ "indexmap", ++ "log", ++ "naga", ++ "once_cell", ++ "parking_lot 0.12.5", ++ "profiling", ++ "raw-window-handle", ++ "rustc-hash 1.1.0", ++ "smallvec", ++ "thiserror 1.0.69", ++ "wgpu-hal", ++ "wgpu-types", ++] ++ ++[[package]] ++name = "wgpu-hal" ++version = "22.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f6bbf4b4de8b2a83c0401d9e5ae0080a2792055f25859a02bf9be97952bbed4f" ++dependencies = [ ++ "android_system_properties", ++ "arrayvec", ++ "ash", ++ "bit-set", ++ "bitflags 2.10.0", ++ "block", ++ "cfg_aliases 0.1.1", ++ "core-graphics-types", ++ "d3d12", ++ "glow", ++ "glutin_wgl_sys", ++ "gpu-alloc", ++ "gpu-allocator", ++ "gpu-descriptor", ++ "hassle-rs", ++ "js-sys", ++ "khronos-egl", ++ "libc", ++ "libloading", ++ "log", ++ "metal", ++ "naga", ++ "ndk-sys 0.5.0+25.2.9519653", ++ "objc", ++ "once_cell", ++ "parking_lot 0.12.5", ++ "profiling", ++ "range-alloc", ++ "raw-window-handle", ++ "renderdoc-sys", ++ "rustc-hash 1.1.0", ++ "smallvec", ++ "thiserror 1.0.69", ++ "wasm-bindgen", ++ "web-sys", ++ "wgpu-types", ++ "winapi", ++] ++ ++[[package]] ++name = "wgpu-types" ++version = "22.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bc9d91f0e2c4b51434dfa6db77846f2793149d8e73f800fa2e41f52b8eac3c5d" ++dependencies = [ ++ "bitflags 2.10.0", ++ "js-sys", ++ "web-sys", ++] ++ ++[[package]] ++name = "widestring" ++version = "1.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "72069c3113ab32ab29e5584db3c6ec55d416895e60715417b5b883a357c3e471" ++ ++[[package]] ++name = "winapi" ++version = "0.3.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" ++dependencies = [ ++ "winapi-i686-pc-windows-gnu", ++ "winapi-x86_64-pc-windows-gnu", ++] ++ ++[[package]] ++name = "winapi-i686-pc-windows-gnu" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" ++ ++[[package]] ++name = "winapi-util" ++version = "0.1.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" ++dependencies = [ ++ "windows-sys 0.61.2", ++] ++ ++[[package]] ++name = "winapi-x86_64-pc-windows-gnu" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" ++ ++[[package]] ++name = "window_clipboard" ++version = "0.4.1" ++source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" ++dependencies = [ ++ "clipboard-win", ++ "clipboard_macos", ++ "clipboard_wayland", ++ "clipboard_x11", ++ "dnd", ++ "mime", ++ "raw-window-handle", ++ "thiserror 1.0.69", ++] ++ ++[[package]] ++name = "windows" ++version = "0.52.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" ++dependencies = [ ++ "windows-core 0.52.0", ++ "windows-targets 0.52.6", ++] ++ ++[[package]] ++name = "windows" ++version = "0.54.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" ++dependencies = [ ++ "windows-core 0.54.0", ++ "windows-implement 0.53.0", ++ "windows-interface 0.53.0", ++ "windows-targets 0.52.6", ++] ++ ++[[package]] ++name = "windows-core" ++version = "0.52.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" ++dependencies = [ ++ "windows-targets 0.52.6", ++] ++ ++[[package]] ++name = "windows-core" ++version = "0.54.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" ++dependencies = [ ++ "windows-result 0.1.2", ++ "windows-targets 0.52.6", ++] ++ ++[[package]] ++name = "windows-core" ++version = "0.61.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" ++dependencies = [ ++ "windows-implement 0.60.2", ++ "windows-interface 0.59.3", ++ "windows-link 0.1.3", ++ "windows-result 0.3.4", ++ "windows-strings", ++] ++ ++[[package]] ++name = "windows-implement" ++version = "0.53.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "942ac266be9249c84ca862f0a164a39533dc2f6f33dc98ec89c8da99b82ea0bd" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "windows-implement" ++version = "0.60.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "windows-interface" ++version = "0.53.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "da33557140a288fae4e1d5f8873aaf9eb6613a9cf82c3e070223ff177f598b60" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "windows-interface" ++version = "0.59.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "windows-link" ++version = "0.1.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" ++ ++[[package]] ++name = "windows-link" ++version = "0.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" ++ ++[[package]] ++name = "windows-result" ++version = "0.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" ++dependencies = [ ++ "windows-targets 0.52.6", ++] ++ ++[[package]] ++name = "windows-result" ++version = "0.3.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" ++dependencies = [ ++ "windows-link 0.1.3", ++] ++ ++[[package]] ++name = "windows-strings" ++version = "0.4.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" ++dependencies = [ ++ "windows-link 0.1.3", ++] ++ ++[[package]] ++name = "windows-sys" ++version = "0.45.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" ++dependencies = [ ++ "windows-targets 0.42.2", ++] ++ ++[[package]] ++name = "windows-sys" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" ++dependencies = [ ++ "windows-targets 0.48.5", ++] ++ ++[[package]] ++name = "windows-sys" ++version = "0.52.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" ++dependencies = [ ++ "windows-targets 0.52.6", ++] ++ ++[[package]] ++name = "windows-sys" ++version = "0.59.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" ++dependencies = [ ++ "windows-targets 0.52.6", ++] ++ ++[[package]] ++name = "windows-sys" ++version = "0.60.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" ++dependencies = [ ++ "windows-targets 0.53.5", ++] ++ ++[[package]] ++name = "windows-sys" ++version = "0.61.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" ++dependencies = [ ++ "windows-link 0.2.1", ++] ++ ++[[package]] ++name = "windows-targets" ++version = "0.42.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" ++dependencies = [ ++ "windows_aarch64_gnullvm 0.42.2", ++ "windows_aarch64_msvc 0.42.2", ++ "windows_i686_gnu 0.42.2", ++ "windows_i686_msvc 0.42.2", ++ "windows_x86_64_gnu 0.42.2", ++ "windows_x86_64_gnullvm 0.42.2", ++ "windows_x86_64_msvc 0.42.2", ++] ++ ++[[package]] ++name = "windows-targets" ++version = "0.48.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" ++dependencies = [ ++ "windows_aarch64_gnullvm 0.48.5", ++ "windows_aarch64_msvc 0.48.5", ++ "windows_i686_gnu 0.48.5", ++ "windows_i686_msvc 0.48.5", ++ "windows_x86_64_gnu 0.48.5", ++ "windows_x86_64_gnullvm 0.48.5", ++ "windows_x86_64_msvc 0.48.5", ++] ++ ++[[package]] ++name = "windows-targets" ++version = "0.52.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" ++dependencies = [ ++ "windows_aarch64_gnullvm 0.52.6", ++ "windows_aarch64_msvc 0.52.6", ++ "windows_i686_gnu 0.52.6", ++ "windows_i686_gnullvm 0.52.6", ++ "windows_i686_msvc 0.52.6", ++ "windows_x86_64_gnu 0.52.6", ++ "windows_x86_64_gnullvm 0.52.6", ++ "windows_x86_64_msvc 0.52.6", ++] ++ ++[[package]] ++name = "windows-targets" ++version = "0.53.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" ++dependencies = [ ++ "windows-link 0.2.1", ++ "windows_aarch64_gnullvm 0.53.1", ++ "windows_aarch64_msvc 0.53.1", ++ "windows_i686_gnu 0.53.1", ++ "windows_i686_gnullvm 0.53.1", ++ "windows_i686_msvc 0.53.1", ++ "windows_x86_64_gnu 0.53.1", ++ "windows_x86_64_gnullvm 0.53.1", ++ "windows_x86_64_msvc 0.53.1", ++] ++ ++[[package]] ++name = "windows_aarch64_gnullvm" ++version = "0.42.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" ++ ++[[package]] ++name = "windows_aarch64_gnullvm" ++version = "0.48.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" ++ ++[[package]] ++name = "windows_aarch64_gnullvm" ++version = "0.52.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" ++ ++[[package]] ++name = "windows_aarch64_gnullvm" ++version = "0.53.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" ++ ++[[package]] ++name = "windows_aarch64_msvc" ++version = "0.42.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" ++ ++[[package]] ++name = "windows_aarch64_msvc" ++version = "0.48.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" ++ ++[[package]] ++name = "windows_aarch64_msvc" ++version = "0.52.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" ++ ++[[package]] ++name = "windows_aarch64_msvc" ++version = "0.53.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" ++ ++[[package]] ++name = "windows_i686_gnu" ++version = "0.42.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" ++ ++[[package]] ++name = "windows_i686_gnu" ++version = "0.48.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" ++ ++[[package]] ++name = "windows_i686_gnu" ++version = "0.52.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" ++ ++[[package]] ++name = "windows_i686_gnu" ++version = "0.53.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" ++ ++[[package]] ++name = "windows_i686_gnullvm" ++version = "0.52.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" ++ ++[[package]] ++name = "windows_i686_gnullvm" ++version = "0.53.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" ++ ++[[package]] ++name = "windows_i686_msvc" ++version = "0.42.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" ++ ++[[package]] ++name = "windows_i686_msvc" ++version = "0.48.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" ++ ++[[package]] ++name = "windows_i686_msvc" ++version = "0.52.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" ++ ++[[package]] ++name = "windows_i686_msvc" ++version = "0.53.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" ++ ++[[package]] ++name = "windows_x86_64_gnu" ++version = "0.42.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" ++ ++[[package]] ++name = "windows_x86_64_gnu" ++version = "0.48.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" ++ ++[[package]] ++name = "windows_x86_64_gnu" ++version = "0.52.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" ++ ++[[package]] ++name = "windows_x86_64_gnu" ++version = "0.53.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" ++ ++[[package]] ++name = "windows_x86_64_gnullvm" ++version = "0.42.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" ++ ++[[package]] ++name = "windows_x86_64_gnullvm" ++version = "0.48.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" ++ ++[[package]] ++name = "windows_x86_64_gnullvm" ++version = "0.52.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" ++ ++[[package]] ++name = "windows_x86_64_gnullvm" ++version = "0.53.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" ++ ++[[package]] ++name = "windows_x86_64_msvc" ++version = "0.42.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" ++ ++[[package]] ++name = "windows_x86_64_msvc" ++version = "0.48.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" ++ ++[[package]] ++name = "windows_x86_64_msvc" ++version = "0.52.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" ++ ++[[package]] ++name = "windows_x86_64_msvc" ++version = "0.53.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" ++ ++[[package]] ++name = "winit" ++version = "0.30.5" ++source = "git+https://gitlab.redox-os.org/redox-os/winit?branch=redox-0.30.5#a0d14b4f2466afec886bcfb7e5d5d7eb9d703a60" ++dependencies = [ ++ "ahash", ++ "android-activity", ++ "atomic-waker", ++ "bitflags 2.10.0", ++ "block2", ++ "bytemuck", ++ "calloop 0.13.0", ++ "cfg_aliases 0.2.1", ++ "concurrent-queue", ++ "core-foundation", ++ "core-graphics", ++ "cursor-icon", ++ "dpi", ++ "js-sys", ++ "libc", ++ "libredox", ++ "memmap2", ++ "ndk", ++ "objc2", ++ "objc2-app-kit", ++ "objc2-foundation", ++ "objc2-ui-kit", ++ "orbclient", ++ "percent-encoding", ++ "pin-project", ++ "raw-window-handle", ++ "redox_event", ++ "rustix 0.38.44", ++ "sctk-adwaita", ++ "smithay-client-toolkit 0.19.2", ++ "smol_str 0.2.2", ++ "tracing", ++ "unicode-segmentation", ++ "wasm-bindgen", ++ "wasm-bindgen-futures", ++ "wayland-backend", ++ "wayland-client", ++ "wayland-protocols", ++ "wayland-protocols-plasma", ++ "web-sys", ++ "web-time", ++ "windows-sys 0.52.0", ++ "x11-dl", ++ "x11rb", ++ "xkbcommon-dl", ++] ++ ++[[package]] ++name = "winnow" ++version = "0.7.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" ++dependencies = [ ++ "memchr", ++] ++ ++[[package]] ++name = "wit-bindgen" ++version = "0.51.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" ++ ++[[package]] ++name = "writeable" ++version = "0.6.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" ++ ++[[package]] ++name = "x11-dl" ++version = "2.21.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" ++dependencies = [ ++ "libc", ++ "once_cell", ++ "pkg-config", ++] ++ ++[[package]] ++name = "x11rb" ++version = "0.13.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9993aa5be5a26815fe2c3eacfc1fde061fc1a1f094bf1ad2a18bf9c495dd7414" ++dependencies = [ ++ "as-raw-xcb-connection", ++ "gethostname", ++ "libc", ++ "libloading", ++ "once_cell", ++ "rustix 1.1.4", ++ "x11rb-protocol", ++ "xcursor", ++] ++ ++[[package]] ++name = "x11rb-protocol" ++version = "0.13.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd" ++ ++[[package]] ++name = "xcursor" ++version = "0.3.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bec9e4a500ca8864c5b47b8b482a73d62e4237670e5b5f1d6b9e3cae50f28f2b" ++ ++[[package]] ++name = "xdg" ++version = "3.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2fb433233f2df9344722454bc7e96465c9d03bff9d77c248f9e7523fe79585b5" ++ ++[[package]] ++name = "xkbcommon" ++version = "0.8.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8d66ca9352cbd4eecbbc40871d8a11b4ac8107cfc528a6e14d7c19c69d0e1ac9" ++dependencies = [ ++ "libc", ++ "memmap2", ++ "xkeysym", ++] ++ ++[[package]] ++name = "xkbcommon-dl" ++version = "0.4.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" ++dependencies = [ ++ "bitflags 2.10.0", ++ "dlib", ++ "log", ++ "once_cell", ++ "xkeysym", ++] ++ ++[[package]] ++name = "xkeysym" ++version = "0.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" ++dependencies = [ ++ "bytemuck", ++] ++ ++[[package]] ++name = "xml-rs" ++version = "0.8.28" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3ae8337f8a065cfc972643663ea4279e04e7256de865aa66fe25cec5fb912d3f" ++ ++[[package]] ++name = "xmlwriter" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9" ++ ++[[package]] ++name = "xts-mode" ++version = "0.5.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "09cbddb7545ca0b9ffa7bdc653e8743303e1712687a6918ced25f2cdbed42520" ++dependencies = [ ++ "byteorder", ++ "cipher", ++] ++ ++[[package]] ++name = "yansi" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" ++ ++[[package]] ++name = "yazi" ++version = "0.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e01738255b5a16e78bbb83e7fbba0a1e7dd506905cfc53f4622d89015a03fbb5" ++ ++[[package]] ++name = "yoke" ++version = "0.8.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" ++dependencies = [ ++ "stable_deref_trait", ++ "yoke-derive", ++ "zerofrom", ++] ++ ++[[package]] ++name = "yoke-derive" ++version = "0.8.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++ "synstructure", ++] ++ ++[[package]] ++name = "zbus" ++version = "5.14.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ca82f95dbd3943a40a53cfded6c2d0a2ca26192011846a1810c4256ef92c60bc" ++dependencies = [ ++ "async-broadcast", ++ "async-executor", ++ "async-io", ++ "async-lock", ++ "async-process", ++ "async-recursion", ++ "async-task", ++ "async-trait", ++ "blocking", ++ "enumflags2", ++ "event-listener", ++ "futures-core", ++ "futures-lite", ++ "hex", ++ "libc", ++ "ordered-stream", ++ "rustix 1.1.4", ++ "serde", ++ "serde_repr", ++ "tracing", ++ "uds_windows", ++ "uuid", ++ "windows-sys 0.61.2", ++ "winnow", ++ "zbus_macros", ++ "zbus_names", ++ "zvariant", ++] ++ ++[[package]] ++name = "zbus_macros" ++version = "5.14.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "897e79616e84aac4b2c46e9132a4f63b93105d54fe8c0e8f6bffc21fa8d49222" ++dependencies = [ ++ "proc-macro-crate", ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++ "zbus_names", ++ "zvariant", ++ "zvariant_utils", ++] ++ ++[[package]] ++name = "zbus_names" ++version = "4.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ffd8af6d5b78619bab301ff3c560a5bd22426150253db278f164d6cf3b72c50f" ++dependencies = [ ++ "serde", ++ "winnow", ++ "zvariant", ++] ++ ++[[package]] ++name = "zeno" ++version = "0.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6df3dc4292935e51816d896edcd52aa30bc297907c26167fec31e2b0c6a32524" ++ ++[[package]] ++name = "zerocopy" ++version = "0.8.33" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd" ++dependencies = [ ++ "zerocopy-derive", ++] ++ ++[[package]] ++name = "zerocopy-derive" ++version = "0.8.33" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "zerofrom" ++version = "0.1.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" ++dependencies = [ ++ "zerofrom-derive", ++] ++ ++[[package]] ++name = "zerofrom-derive" ++version = "0.1.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++ "synstructure", ++] ++ ++[[package]] ++name = "zeroize" ++version = "1.8.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" ++dependencies = [ ++ "zeroize_derive", ++] ++ ++[[package]] ++name = "zeroize_derive" ++version = "1.4.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "zerotrie" ++version = "0.2.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" ++dependencies = [ ++ "displaydoc", ++ "yoke", ++ "zerofrom", ++] ++ ++[[package]] ++name = "zerovec" ++version = "0.11.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" ++dependencies = [ ++ "serde", ++ "yoke", ++ "zerofrom", ++ "zerovec-derive", ++] ++ ++[[package]] ++name = "zerovec-derive" ++version = "0.11.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++] ++ ++[[package]] ++name = "zmij" ++version = "1.0.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dfcd145825aace48cff44a8844de64bf75feec3080e0aa5cdbde72961ae51a65" ++ ++[[package]] ++name = "zune-core" ++version = "0.5.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cb8a0807f7c01457d0379ba880ba6322660448ddebc890ce29bb64da71fb40f9" ++ ++[[package]] ++name = "zune-jpeg" ++version = "0.5.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2959ca473aae96a14ecedf501d20b3608d2825ba280d5adb57d651721885b0c2" ++dependencies = [ ++ "zune-core", ++] ++ ++[[package]] ++name = "zvariant" ++version = "5.10.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5708299b21903bbe348e94729f22c49c55d04720a004aa350f1f9c122fd2540b" ++dependencies = [ ++ "endi", ++ "enumflags2", ++ "serde", ++ "winnow", ++ "zvariant_derive", ++ "zvariant_utils", ++] ++ ++[[package]] ++name = "zvariant_derive" ++version = "5.10.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5b59b012ebe9c46656f9cc08d8da8b4c726510aef12559da3e5f1bf72780752c" ++dependencies = [ ++ "proc-macro-crate", ++ "proc-macro2", ++ "quote", ++ "syn 2.0.114", ++ "zvariant_utils", ++] ++ ++[[package]] ++name = "zvariant_utils" ++version = "3.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f75c23a64ef8f40f13a6989991e643554d9bef1d682a281160cf0c1bc389c5e9" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "serde", ++ "syn 2.0.114", ++ "winnow", ++] +diff --git a/gui/Cargo.toml b/gui/Cargo.toml +new file mode 100644 +index 0000000..ee9fc60 +--- /dev/null ++++ b/gui/Cargo.toml +@@ -0,0 +1,27 @@ ++[package] ++name = "redox_installer_gui" ++version = "0.1.0" ++edition = "2021" ++ ++[dependencies] ++anyhow = "1" ++libredox = "0.1" ++pkgar = "0.2" ++pkgar-core = "0.2" ++pkgar-keys = "0.2" ++redox_installer = { path = ".." } ++redox_syscall = "0.7" ++toml = "0.8" ++ ++[dependencies.libcosmic] ++git = "https://github.com/pop-os/libcosmic.git" ++# use the same rev with other cosmic app ++rev = "384e8f6e219bb458720eafa5bb971b832c057f23" ++default-features = false ++features = ["winit"] ++ ++[patch.crates-io] ++ring = { git = "https://gitlab.redox-os.org/redox-os/ring.git", branch = "redox-0.17.8" } ++ ++[patch.'https://github.com/pop-os/winit'] ++winit = { git = "https://gitlab.redox-os.org/redox-os/winit", branch = "redox-0.30.5" } +diff --git a/gui/README.md b/gui/README.md +new file mode 100644 +index 0000000..372459d +--- /dev/null ++++ b/gui/README.md +@@ -0,0 +1,92 @@ ++# installer_gui ++ ++ ++ ++## Getting started ++ ++To make it easy for you to get started with GitLab, here's a list of recommended next steps. ++ ++Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! ++ ++## Add your files ++ ++- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files ++- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: ++ ++``` ++cd existing_repo ++git remote add origin https://gitlab.redox-os.org/redox-os/installer_gui.git ++git branch -M main ++git push -uf origin main ++``` ++ ++## Integrate with your tools ++ ++- [ ] [Set up project integrations](https://gitlab.redox-os.org/redox-os/installer_gui/-/settings/integrations) ++ ++## Collaborate with your team ++ ++- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) ++- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) ++- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) ++- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) ++- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) ++ ++## Test and Deploy ++ ++Use the built-in continuous integration in GitLab. ++ ++- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) ++- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) ++- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) ++- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) ++- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) ++ ++*** ++ ++# Editing this README ++ ++When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. ++ ++## Suggestions for a good README ++Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. ++ ++## Name ++Choose a self-explaining name for your project. ++ ++## Description ++Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. ++ ++## Badges ++On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. ++ ++## Visuals ++Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. ++ ++## Installation ++Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. ++ ++## Usage ++Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. ++ ++## Support ++Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. ++ ++## Roadmap ++If you have ideas for releases in the future, it is a good idea to list them in the README. ++ ++## Contributing ++State if you are open to contributions and what your requirements are for accepting them. ++ ++For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. ++ ++You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. ++ ++## Authors and acknowledgment ++Show your appreciation to those who have contributed to the project. ++ ++## License ++For open source projects, say how it is licensed. ++ ++## Project status ++If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. +diff --git a/gui/src/main.rs b/gui/src/main.rs +new file mode 100644 +index 0000000..f5f9fb6 +--- /dev/null ++++ b/gui/src/main.rs +@@ -0,0 +1,705 @@ ++use anyhow::format_err; ++use cosmic::{ ++ app::{self, Task}, ++ iced::{ ++ self, executor, futures::sink::SinkExt, stream, widget::row, window, Alignment, Size, ++ Subscription, ++ }, ++ widget::{ ++ button, column, horizontal_space, progress_bar, radio, text, text_input, vertical_space, ++ }, ++ Application, ApplicationExt, Core, Element, ++}; ++use pkgar::{ext::EntryExt, PackageHead}; ++use pkgar_core::PackageSrc; ++use pkgar_keys::PublicKeyFile; ++use redox_installer::{try_fast_install, with_redoxfs_mount, with_whole_disk, Config, DiskOption}; ++use std::{ ++ ffi::OsStr, ++ fs, ++ io::{self, Read, Write}, ++ os::unix::fs::{symlink, MetadataExt, OpenOptionsExt}, ++ path::Path, ++ sync::Arc, ++}; ++ ++fn main() -> iced::Result { ++ let mut settings = app::Settings::default(); ++ settings = settings.size(Size::new(608.0, 416.0)); ++ settings = settings.exit_on_close(false); ++ app::run::(settings, ()) ++} ++ ++fn sudo(password: &str) -> Result<(), String> { ++ let file = libredox::call::open("/scheme/sudo", libredox::flag::O_CLOEXEC, 0) ++ .map_err(|err| err.to_string())?; ++ ++ libredox::call::write(file, password.as_bytes()).map_err(|err| err.to_string())?; ++ ++ // FIXME move to libredox ++ unsafe extern "C" { ++ safe fn redox_cur_procfd_v0() -> usize; ++ } ++ ++ // Elevate privileges of our own process with help from the sudo daemon ++ syscall::sendfd( ++ file, ++ syscall::dup(redox_cur_procfd_v0(), &[]).map_err(|err| err.to_string())?, ++ 0, ++ 0, ++ ) ++ .map_err(|err| err.to_string())?; ++ ++ Ok(()) ++} ++ ++fn disk_paths() -> Result, String> { ++ let mut schemes = Vec::new(); ++ match fs::read_dir("/scheme/") { ++ Ok(entries) => { ++ for entry_res in entries { ++ if let Ok(entry) = entry_res { ++ let path = entry.path(); ++ if let Ok(path_str) = path.into_os_string().into_string() { ++ let scheme = path_str.trim_start_matches("/scheme/").trim_matches('/'); ++ if scheme.starts_with("disk") { ++ if scheme == "disk/live" { ++ // Skip live disks ++ continue; ++ } ++ ++ schemes.push(format!("/scheme/{}", scheme)); ++ } ++ } ++ } ++ } ++ } ++ Err(err) => { ++ return Err(format!("failed to list schemes: {}", err)); ++ } ++ } ++ ++ let mut paths = Vec::new(); ++ for scheme in schemes { ++ let is_dir = fs::metadata(&scheme).map(|x| x.is_dir()).unwrap_or(false); ++ if is_dir { ++ match fs::read_dir(&scheme) { ++ Ok(entries) => { ++ for entry_res in entries { ++ if let Ok(entry) = entry_res { ++ if let Ok(file_name) = entry.file_name().into_string() { ++ if file_name.contains('p') { ++ // Skip partitions ++ continue; ++ } ++ ++ if let Ok(path) = entry.path().into_os_string().into_string() { ++ if let Ok(metadata) = entry.metadata() { ++ let size = metadata.len(); ++ if size > 0 { ++ paths.push((path, size)); ++ } ++ } ++ } ++ } ++ } ++ } ++ } ++ Err(err) => { ++ return Err(format!("failed to list '{}': {}", scheme, err)); ++ } ++ } ++ } ++ } ++ ++ Ok(paths) ++} ++ ++const KIB: u64 = 1024; ++const MIB: u64 = 1024 * KIB; ++const GIB: u64 = 1024 * MIB; ++const TIB: u64 = 1024 * GIB; ++ ++fn format_size(size: u64) -> String { ++ if size >= 4 * TIB { ++ format!("{:.1} TiB", size as f64 / TIB as f64) ++ } else if size >= GIB { ++ format!("{:.1} GiB", size as f64 / GIB as f64) ++ } else if size >= MIB { ++ format!("{:.1} MiB", size as f64 / MIB as f64) ++ } else if size >= KIB { ++ format!("{:.1} KiB", size as f64 / KIB as f64) ++ } else { ++ format!("{} B", size) ++ } ++} ++ ++fn copy_file(src: &Path, dest: &Path, buf: &mut [u8]) -> anyhow::Result<()> { ++ if let Some(parent) = dest.parent() { ++ // Parent may be a symlink ++ if !parent.is_symlink() { ++ match fs::create_dir_all(&parent) { ++ Ok(()) => (), ++ Err(err) => { ++ return Err(format_err!( ++ "failed to create directory {}: {}", ++ parent.display(), ++ err ++ )); ++ } ++ } ++ } ++ } ++ ++ let metadata = match fs::symlink_metadata(&src) { ++ Ok(ok) => ok, ++ Err(err) => { ++ return Err(format_err!( ++ "failed to read metadata of {}: {}", ++ src.display(), ++ err ++ )); ++ } ++ }; ++ ++ if metadata.file_type().is_symlink() { ++ let real_src = match fs::read_link(&src) { ++ Ok(ok) => ok, ++ Err(err) => { ++ return Err(format_err!( ++ "failed to read link {}: {}", ++ src.display(), ++ err ++ )); ++ } ++ }; ++ ++ match symlink(&real_src, &dest) { ++ Ok(()) => (), ++ Err(err) => { ++ return Err(format_err!( ++ "failed to copy link {} ({}) to {}: {}", ++ src.display(), ++ real_src.display(), ++ dest.display(), ++ err ++ )); ++ } ++ } ++ } else { ++ let mut src_file = match fs::File::open(&src) { ++ Ok(ok) => ok, ++ Err(err) => { ++ return Err(format_err!( ++ "failed to open file {}: {}", ++ src.display(), ++ err ++ )); ++ } ++ }; ++ ++ let mut dest_file = match fs::OpenOptions::new() ++ .write(true) ++ .create_new(true) ++ .mode(metadata.mode()) ++ .open(&dest) ++ { ++ Ok(ok) => ok, ++ Err(err) => { ++ return Err(format_err!( ++ "failed to create file {}: {}", ++ dest.display(), ++ err ++ )); ++ } ++ }; ++ ++ loop { ++ let count = match src_file.read(buf) { ++ Ok(ok) => ok, ++ Err(err) => { ++ return Err(format_err!( ++ "failed to read file {}: {}", ++ src.display(), ++ err ++ )); ++ } ++ }; ++ ++ if count == 0 { ++ break; ++ } ++ ++ match dest_file.write_all(&buf[..count]) { ++ Ok(()) => (), ++ Err(err) => { ++ return Err(format_err!( ++ "failed to write file {}: {}", ++ dest.display(), ++ err ++ )); ++ } ++ } ++ } ++ } ++ ++ Ok(()) ++} ++ ++fn package_files( ++ root_path: &Path, ++ config: &mut Config, ++ files: &mut Vec, ++) -> Result<(), anyhow::Error> { ++ //TODO: Remove packages from config where all files are located (and have valid shasum?) ++ config.packages.clear(); ++ ++ let pkey_path = "pkg/id_ed25519.pub.toml"; ++ let pkey = PublicKeyFile::open(&root_path.join(pkey_path))?.pkey; ++ files.push(pkey_path.to_string()); ++ ++ for item_res in fs::read_dir(&root_path.join("pkg"))? { ++ let item = item_res?; ++ let pkg_path = item.path(); ++ if pkg_path.extension() == Some(OsStr::new("pkgar_head")) { ++ let mut pkg = PackageHead::new(&pkg_path, &root_path, &pkey)?; ++ for entry in pkg.read_entries()? { ++ files.push(entry.check_path()?.to_str().unwrap().to_string()); ++ } ++ files.push( ++ pkg_path ++ .strip_prefix(root_path) ++ .unwrap() ++ .to_str() ++ .unwrap() ++ .to_string(), ++ ); ++ } ++ } ++ ++ Ok(()) ++} ++ ++fn install(disk_path: String, password_opt: Option, mut f: F) { ++ let start = std::time::Instant::now(); ++ ++ let mut progress = 0; ++ ++ macro_rules! message { ++ ($($arg:tt)*) => {{ ++ eprintln!($($arg)*); ++ f(Message::Install( ++ progress, ++ format!($($arg)*) ++ )); ++ }} ++ } ++ ++ let root_path = Path::new("/scheme/file/"); ++ ++ message!("Loading bootloader"); ++ let bootloader_bios = { ++ let path = root_path.join("boot").join("bootloader.bios"); ++ if path.exists() { ++ match fs::read(&path) { ++ Ok(ok) => ok, ++ Err(err) => { ++ f(Message::Error(format!( ++ "{}: failed to read: {}", ++ path.display(), ++ err ++ ))); ++ return; ++ } ++ } ++ } else { ++ Vec::new() ++ } ++ }; ++ ++ message!("Loading bootloader.efi"); ++ let bootloader_efi = { ++ let path = root_path.join("boot").join("bootloader.efi"); ++ if path.exists() { ++ match fs::read(&path) { ++ Ok(ok) => ok, ++ Err(err) => { ++ f(Message::Error(format!( ++ "{}: failed to read: {}", ++ path.display(), ++ err ++ ))); ++ return; ++ } ++ } ++ } else { ++ Vec::new() ++ } ++ }; ++ ++ message!("Formatting disk"); ++ let disk_option = DiskOption { ++ bootloader_bios: &bootloader_bios, ++ bootloader_efi: &bootloader_efi, ++ password_opt: password_opt.as_ref().map(|x| x.as_bytes()), ++ efi_partition_size: None, ++ skip_partitions: false, ++ }; ++ let res = with_whole_disk(&disk_path, &disk_option, |mut fs| -> anyhow::Result<()> { ++ // Fast install method via filesystem clone ++ let mut last_progress = 0; ++ if try_fast_install(&mut fs, |used, used_old| { ++ progress = ((used * 100) / used_old) as usize; ++ if progress != last_progress { ++ message!( ++ "{}%: {} MB/{} MB", ++ progress, ++ used / 1000 / 1000, ++ used_old / 1000 / 1000 ++ ); ++ last_progress = progress; ++ } ++ })? { ++ progress = 100; ++ message!("Finished installing using fast mode"); ++ return Ok(()); ++ } ++ ++ with_redoxfs_mount(fs, None, |mount_path: &Path| -> anyhow::Result<()> { ++ message!("Loading filesystem.toml"); ++ let mut config: Config = { ++ let path = root_path.join("filesystem.toml"); ++ match fs::read_to_string(&path) { ++ Ok(config_data) => match toml::from_str(&config_data) { ++ Ok(config) => config, ++ Err(err) => { ++ return Err(format_err!( ++ "{}: failed to decode: {}", ++ path.display(), ++ err ++ )); ++ } ++ }, ++ Err(err) => { ++ return Err(format_err!("{}: failed to read: {}", path.display(), err)); ++ } ++ } ++ }; ++ ++ // Copy filesystem.toml, which is not packaged ++ let mut files = vec!["filesystem.toml".to_string()]; ++ ++ // Copy files from locally installed packages ++ message!("Loading package files"); ++ if let Err(err) = package_files(&root_path, &mut config, &mut files) { ++ return Err(format_err!("failed to read package files: {}", err)); ++ } ++ ++ // Sort and remove duplicates ++ files.sort(); ++ files.dedup(); ++ ++ // Perform config install (after packages have been converted to files) ++ message!("Configuring system"); ++ let cookbook: Option<&'static str> = None; ++ redox_installer::install_dir(config, mount_path, cookbook) ++ .map_err(|err| io::Error::new(io::ErrorKind::Other, err))?; ++ ++ // Install files ++ let mut buf = vec![0; 4 * MIB as usize]; ++ for (i, name) in files.iter().enumerate() { ++ progress = (i * 100) / files.len(); ++ message!("Copy {} [{}/{}]", name, i, files.len()); ++ ++ let src = root_path.join(name); ++ let dest = mount_path.join(name); ++ copy_file(&src, &dest, &mut buf)?; ++ } ++ ++ progress = 100; ++ message!("Finished installing, unmounting filesystem"); ++ Ok(()) ++ }) ++ }); ++ ++ match res { ++ Ok(()) => { ++ f(Message::Success(format!( ++ "Finished installing in {:?}, ready to reboot", ++ start.elapsed() ++ ))); ++ } ++ Err(err) => { ++ f(Message::Error(format!("Failed to install: {}", err))); ++ } ++ } ++} ++ ++#[derive(Debug)] ++enum Page { ++ Sudo(String), ++ Disk(Option), ++ Install(usize, String), ++ Success(String), ++ Error(String), ++} ++ ++#[derive(Clone, Debug)] ++struct Worker { ++ command_sender: std::sync::mpsc::Sender<(String, Option)>, ++ join_handle: Arc>, ++} ++ ++#[derive(Clone, Debug)] ++enum Message { ++ None, ++ Worker(Worker), ++ SudoInput(String), ++ SudoSubmit, ++ DiskChoose(usize), ++ DiskConfirm(usize), ++ Install(usize, String), ++ Success(String), ++ Exit, ++ Error(String), ++} ++ ++struct Window { ++ core: Core, ++ page: Page, ++ disk_paths: Vec<(String, u64)>, ++ worker_opt: Option, ++} ++ ++impl Application for Window { ++ type Executor = executor::Default; ++ type Flags = (); ++ type Message = Message; ++ ++ const APP_ID: &'static str = "org.redox-os.InstallerGui"; ++ ++ fn init(core: Core, _flags: ()) -> (Self, Task) { ++ let uid = libredox::call::geteuid().unwrap(); ++ let (page, disk_paths) = if uid == 0 { ++ //TODO: load in background ++ match disk_paths() { ++ Ok(disk_paths) => (Page::Disk(None), disk_paths), ++ Err(err) => (Page::Error(err), Vec::new()), ++ } ++ } else { ++ (Page::Sudo(String::new()), Vec::new()) ++ }; ++ ++ let mut app = Self { ++ core, ++ page, ++ disk_paths, ++ worker_opt: None, ++ }; ++ let task = app.set_window_title("Redox OS Installer".to_string()); ++ (app, task) ++ } ++ ++ fn core(&self) -> &Core { ++ &self.core ++ } ++ ++ fn core_mut(&mut self) -> &mut Core { ++ &mut self.core ++ } ++ ++ fn update(&mut self, message: Message) -> Task { ++ match message { ++ Message::None => {} ++ Message::Worker(worker) => { ++ self.worker_opt = Some(worker); ++ } ++ Message::SudoInput(password) => { ++ self.page = Page::Sudo(password); ++ } ++ Message::SudoSubmit => { ++ if let Page::Sudo(password) = &self.page { ++ //TODO: run async? ++ match sudo(password) { ++ Ok(()) => { ++ (self.page, self.disk_paths) = match disk_paths() { ++ Ok(disk_paths) => (Page::Disk(None), disk_paths), ++ Err(err) => (Page::Error(err), Vec::new()), ++ }; ++ } ++ Err(err) => { ++ //TODO: show error in GUI ++ eprintln!("{err}"); ++ self.page = Page::Sudo(String::new()); ++ } ++ } ++ } ++ } ++ Message::DiskChoose(disk_i) => { ++ self.page = Page::Disk(Some(disk_i)); ++ } ++ Message::DiskConfirm(disk_i) => match self.disk_paths.get(disk_i) { ++ Some((disk_path, _disk_size)) => match &self.worker_opt { ++ Some(worker) => match worker.command_sender.send((disk_path.clone(), None)) { ++ Ok(()) => self.page = Page::Install(0, format!("Starting install...")), ++ Err(err) => { ++ self.page = Page::Error(format!("failed to send command: {}", err)); ++ } ++ }, ++ None => { ++ self.page = Page::Error(format!("command sender not found")); ++ } ++ }, ++ None => { ++ self.page = Page::Error(format!("invalid disk number {} chosen", disk_i)); ++ } ++ }, ++ Message::Install(progress, description) => { ++ self.page = Page::Install(progress, description); ++ } ++ Message::Success(description) => { ++ self.page = Page::Success(description); ++ } ++ Message::Error(err) => { ++ self.page = Page::Error(err); ++ } ++ Message::Exit => { ++ if let Some(worker) = self.worker_opt.take() { ++ drop(worker.command_sender); ++ let join_handle = Arc::try_unwrap(worker.join_handle).unwrap(); ++ join_handle.join().unwrap(); ++ } ++ if let Some(window_id) = self.core.main_window_id() { ++ return window::close(window_id); ++ } ++ } ++ } ++ Task::none() ++ } ++ ++ fn view(&self) -> Element<'_, Message> { ++ let mut widgets = Vec::new(); ++ match &self.page { ++ Page::Sudo(password) => { ++ widgets.push(text("Enter your password:").into()); ++ widgets.push( ++ text_input("", password) ++ .password() ++ .on_input(Message::SudoInput) ++ .on_submit(|_| Message::SudoSubmit) ++ .into(), ++ ); ++ } ++ Page::Disk(disk_i_opt) => { ++ if !self.disk_paths.is_empty() { ++ widgets.push(text("Choose a drive:").size(24).into()); ++ ++ for (disk_i, (disk_path, disk_size)) in self.disk_paths.iter().enumerate() { ++ widgets.push( ++ row![ ++ radio(text(disk_path), disk_i, *disk_i_opt, Message::DiskChoose), ++ horizontal_space(), ++ text(format_size(*disk_size)), ++ ] ++ .into(), ++ ); ++ } ++ ++ if let Some(disk_i) = *disk_i_opt { ++ widgets.push(vertical_space().into()); ++ widgets.push( ++ row![ ++ horizontal_space(), ++ button::destructive("Confirm") ++ .on_press(Message::DiskConfirm(disk_i)), ++ ] ++ .into(), ++ ); ++ } ++ } else { ++ widgets.push(text("No drives found").into()); ++ // TODO: expose disk.pci-*-*nvme/* */ scheme to user ++ widgets.push(text("(try to rerun with sudo)").into()); ++ } ++ } ++ Page::Install(progress, description) => { ++ widgets.push(text("Installation progress:").size(24).into()); ++ widgets.push(progress_bar(0.0..=100.0, *progress as f32).into()); ++ widgets.push(text(description).into()); ++ } ++ Page::Success(description) => { ++ widgets.push(text("Installation complete!").size(24).into()); ++ widgets.push(text(description).into()); ++ widgets.push(vertical_space().into()); ++ widgets.push( ++ row![ ++ horizontal_space(), ++ button::standard("Exit").on_press(Message::Exit), ++ ] ++ .into(), ++ ); ++ } ++ Page::Error(err) => { ++ widgets.push(text(format!("{}", err)).into()); ++ } ++ }; ++ ++ column::with_children(widgets) ++ .spacing(8) ++ .padding(24) ++ .align_x(Alignment::Start) ++ .into() ++ } ++ ++ fn subscription(&self) -> Subscription { ++ enum State { ++ Ready, ++ Waiting(iced::futures::channel::mpsc::UnboundedReceiver), ++ Finished, ++ } ++ ++ Subscription::run_with_id( ++ std::any::TypeId::of::(), ++ stream::channel(100, |mut output| async move { ++ let mut state = State::Ready; ++ loop { ++ let (message, new_state) = match state { ++ State::Ready => { ++ let (command_sender, command_receiver) = std::sync::mpsc::channel(); ++ ++ let (message_sender, message_receiver) = ++ iced::futures::channel::mpsc::unbounded(); ++ ++ //TODO: kill worker thread? ++ let join_handle = std::thread::spawn(move || { ++ while let Ok((disk_path, password_opt)) = command_receiver.recv() { ++ println!("Installing to {:?}", disk_path); ++ install(disk_path, password_opt, |message| { ++ message_sender.unbounded_send(message).unwrap(); ++ }); ++ } ++ }); ++ ++ let worker = Worker { ++ command_sender, ++ join_handle: Arc::new(join_handle), ++ }; ++ ++ (Message::Worker(worker), State::Waiting(message_receiver)) ++ } ++ State::Waiting(mut message_receiver) => { ++ use iced::futures::StreamExt; ++ match message_receiver.next().await { ++ Some(message) => (message, State::Waiting(message_receiver)), ++ None => (Message::None, State::Finished), ++ } ++ } ++ State::Finished => iced::futures::future::pending().await, ++ }; ++ output.send(message).await.unwrap(); ++ state = new_state; ++ } ++ }), ++ ) ++ } ++} +diff --git a/src/config/mod.rs b/src/config/mod.rs +index b0c4b13..22a0ed9 100644 +--- a/src/config/mod.rs ++++ b/src/config/mod.rs +@@ -1,10 +1,11 @@ +-use std::collections::BTreeMap; ++use std::collections::{BTreeMap, BTreeSet}; + use std::fmt::Display; + use std::fs; + use std::mem; + use std::path::{Path, PathBuf}; + + use anyhow::bail; ++use anyhow::anyhow; + use anyhow::Context; + use anyhow::Result; + +@@ -17,6 +18,28 @@ pub mod general; + pub mod package; + pub mod user; + ++/// A named group of packages that can be referenced from the `[packages]` section ++/// of a config TOML. When a group name appears in `[packages]`, the resolver ++/// expands it to the individual package entries listed here. ++/// ++/// Groups may reference other groups for hierarchical composition: ++/// ++/// ```toml ++/// [package_groups.qt6-core] ++/// description = "Qt 6 Core modules" ++/// packages = ["qtbase", "qtdeclarative", "qtsvg"] ++/// ++/// [package_groups.kde-desktop] ++/// description = "Complete KDE Plasma desktop session" ++/// packages = ["qt6-core", "kwin", "sddm"] ++/// ``` ++#[derive(Clone, Debug, Default, Deserialize, Serialize)] ++pub struct PackageGroup { ++ #[serde(default)] ++ pub description: String, ++ pub packages: Vec, ++} ++ + #[derive(Clone, Debug, Default, Deserialize, Serialize)] + pub struct Config { + #[serde(default)] +@@ -26,6 +49,8 @@ pub struct Config { + #[serde(default)] + pub packages: BTreeMap, + #[serde(default)] ++ pub package_groups: BTreeMap, ++ #[serde(default)] + pub files: Vec, + #[serde(default)] + pub users: BTreeMap, +@@ -65,6 +90,8 @@ impl Config { + config.merge(other_config); + } + ++ config.resolve_package_groups()?; ++ + Ok(config) + } + +@@ -91,6 +118,7 @@ impl Config { + include: _, + general: other_general, + packages: other_packages, ++ package_groups: other_package_groups, + files: other_files, + users: other_users, + groups: other_groups, +@@ -102,6 +130,10 @@ impl Config { + self.packages.insert(package, package_config); + } + ++ for (group_name, group) in other_package_groups { ++ self.package_groups.insert(group_name, group); ++ } ++ + self.files.extend(other_files); + + for (user, user_config) in other_users { +@@ -112,6 +144,66 @@ impl Config { + self.groups.insert(group, group_config); + } + } ++ ++ /// Expand all `[package_groups]` references in `packages` into individual ++ /// package entries. Must be called after `merge()` so that groups from all ++ /// included configs are collected. ++ /// ++ /// Explicit package entries always take priority over group-expanded entries. ++ /// Circular group references are detected and rejected. ++ pub fn resolve_package_groups(&mut self) -> Result<()> { ++ if self.package_groups.is_empty() { ++ return Ok(()); ++ } ++ ++ let mut resolved: BTreeMap = BTreeMap::new(); ++ ++ for (name, config) in &self.packages { ++ if !self.package_groups.contains_key(name) { ++ resolved.insert(name.clone(), config.clone()); ++ } ++ } ++ ++ for (name, config) in &self.packages { ++ if self.package_groups.contains_key(name) { ++ let mut visiting = BTreeSet::new(); ++ let expanded = self.expand_group(name, &mut visiting)?; ++ for pkg in expanded { ++ resolved.entry(pkg).or_insert_with(|| config.clone()); ++ } ++ } ++ } ++ ++ self.packages = resolved; ++ Ok(()) ++ } ++ ++ fn expand_group( ++ &self, ++ name: &str, ++ visiting: &mut BTreeSet, ++ ) -> Result> { ++ if !visiting.insert(name.to_string()) { ++ bail!("circular package group reference involving '{}'", name); ++ } ++ ++ let group = self ++ .package_groups ++ .get(name) ++ .ok_or_else(|| anyhow!("package group '{}' not found", name))?; ++ ++ let mut result = Vec::new(); ++ for pkg in &group.packages { ++ if self.package_groups.contains_key(pkg) { ++ result.extend(self.expand_group(pkg, visiting)?); ++ } else { ++ result.push(pkg.to_string()); ++ } ++ } ++ ++ visiting.remove(name); ++ Ok(result) ++ } + } + + impl Display for Config { +@@ -132,3 +224,77 @@ impl Display for Config { + Ok(()) + } + } ++ ++#[cfg(test)] ++mod tests { ++ use super::*; ++ ++ #[test] ++ fn test_resolve_nested_groups() { ++ let toml_str = r#" ++[package_groups.qt6-core] ++packages = ["qtbase", "qtdeclarative", "qtsvg"] ++ ++[package_groups.qt6-extras] ++packages = ["qtwayland", "qt6-sensors"] ++ ++[package_groups.qt6-all] ++packages = ["qt6-core", "qt6-extras"] ++ ++[package_groups.kde-desktop] ++packages = ["qt6-all", "kwin", "sddm"] ++ ++[packages] ++kde-desktop = {} ++"#; ++ let mut config: Config = toml::from_str(toml_str).unwrap(); ++ config.resolve_package_groups().unwrap(); ++ ++ assert!(config.packages.contains_key("qtbase")); ++ assert!(config.packages.contains_key("qtdeclarative")); ++ assert!(config.packages.contains_key("qtsvg")); ++ assert!(config.packages.contains_key("qtwayland")); ++ assert!(config.packages.contains_key("qt6-sensors")); ++ assert!(config.packages.contains_key("kwin")); ++ assert!(config.packages.contains_key("sddm")); ++ assert!(!config.packages.contains_key("kde-desktop")); ++ assert!(!config.packages.contains_key("qt6-all")); ++ assert!(!config.packages.contains_key("qt6-core")); ++ assert!(!config.packages.contains_key("qt6-extras")); ++ } ++ ++ #[test] ++ fn test_explicit_overrides_group() { ++ let toml_str = r#" ++[package_groups.qt6-core] ++packages = ["qtbase", "qtdeclarative"] ++ ++[packages] ++qt6-core = {} ++qtbase = "ignore" ++"#; ++ let mut config: Config = toml::from_str(toml_str).unwrap(); ++ config.resolve_package_groups().unwrap(); ++ ++ assert_eq!( ++ config.packages.get("qtbase").unwrap(), ++ &package::PackageConfig::Build("ignore".to_string()) ++ ); ++ assert!(config.packages.contains_key("qtdeclarative")); ++ } ++ ++ #[test] ++ fn test_no_groups_no_change() { ++ let toml_str = r#" ++[packages] ++foo = {} ++bar = {} ++"#; ++ let mut config: Config = toml::from_str(toml_str).unwrap(); ++ config.resolve_package_groups().unwrap(); ++ ++ assert_eq!(config.packages.len(), 2); ++ assert!(config.packages.contains_key("foo")); ++ assert!(config.packages.contains_key("bar")); ++ } ++} +diff --git a/src/config/package.rs b/src/config/package.rs +index b5b695c..84a8ac5 100644 +--- a/src/config/package.rs ++++ b/src/config/package.rs +@@ -1,4 +1,4 @@ +-#[derive(Clone, Debug, Deserialize, Serialize)] ++#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] + #[serde(untagged)] + pub enum PackageConfig { + Empty, diff --git a/local/patches/kf6-kcolorscheme/add-frameContrast.patch b/local/patches/kf6-kcolorscheme/add-frameContrast.patch new file mode 100644 index 0000000000..42365bbd0d --- /dev/null +++ b/local/patches/kf6-kcolorscheme/add-frameContrast.patch @@ -0,0 +1,25 @@ +--- a/src/kcolorscheme.h ++++ b/src/kcolorscheme.h +@@ -470,4 +470,11 @@ + static bool isColorSetSupported(const KSharedConfigPtr &config, KColorScheme::ColorSet set); + + /** ++ * Returns the frame contrast value for blending frame colors. ++ * Must stay in sync with Kirigami::PlatformTheme::frameContrast(). ++ * @since 6.27 ++ */ ++ static qreal frameContrast(); ++ ++ /** + * @since 5.92 +--- a/src/kcolorscheme.cpp ++++ b/src/kcolorscheme.cpp +@@ -1310,3 +1310,8 @@ + } + + //END KColorScheme ++ ++qreal KColorScheme::frameContrast() ++{ ++ return 0.20; ++} diff --git a/local/patches/kf6-pty/01-no-utmp.patch b/local/patches/kf6-pty/01-no-utmp.patch new file mode 100644 index 0000000000..25eace62f8 --- /dev/null +++ b/local/patches/kf6-pty/01-no-utmp.patch @@ -0,0 +1,37 @@ +--- a/src/kpty.cpp ++++ b/src/kpty.cpp +@@ -464,6 +464,9 @@ + } + + #else ++#if 0 ++ Q_UNUSED(user) ++ Q_UNUSED(remotehost) + #if HAVE_UTMPX + struct utmpx l_struct; + #else +@@ -532,6 +535,8 @@ + #endif + #endif + #endif ++#endif + } + + void KPty::logout() +@@ -551,6 +556,8 @@ + } + + #else ++#if 0 ++ return; + Q_D(KPty); + + const char *str_ptr = d->ttyName.data(); +@@ -611,6 +618,7 @@ + endutent(); + #endif + #endif ++#endif + #endif + } + diff --git a/local/recipes/core/ext4d/source/Cargo.toml b/local/recipes/core/ext4d/source/Cargo.toml index 75c0ff7fd0..6fd4505308 100644 --- a/local/recipes/core/ext4d/source/Cargo.toml +++ b/local/recipes/core/ext4d/source/Cargo.toml @@ -13,10 +13,15 @@ license = "MIT" [workspace.dependencies] rsext4 = "0.3" -redox_syscall = "0.8" -redox-scheme = "0.11.0" -libredox = "0.1.13" +redox_syscall = { path = "../../../../../local/sources/syscall" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +libredox = { path = "../../../../../local/sources/libredox" } redox-path = "0.3.0" log = "0.4" env_logger = "0.11" libc = "0.2" + +[patch.crates-io] +libredox = { path = "../../../../../local/sources/libredox" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/core/ext4d/source/ext4-blockdev/Cargo.toml b/local/recipes/core/ext4d/source/ext4-blockdev/Cargo.toml index f1abd50405..1b106019bf 100644 --- a/local/recipes/core/ext4d/source/ext4-blockdev/Cargo.toml +++ b/local/recipes/core/ext4d/source/ext4-blockdev/Cargo.toml @@ -7,8 +7,8 @@ license.workspace = true [dependencies] rsext4.workspace = true -redox_syscall = { workspace = true, optional = true } -libredox = { workspace = true, optional = true } +redox_syscall = { path = "../../../../../../local/sources/syscall", workspace = true, optional = true } +libredox = { path = "../../../../../../local/sources/libredox", workspace = true, optional = true } log.workspace = true [features] diff --git a/local/recipes/core/ext4d/source/ext4d/Cargo.toml b/local/recipes/core/ext4d/source/ext4d/Cargo.toml index 492b10a51d..2212c92e24 100644 --- a/local/recipes/core/ext4d/source/ext4d/Cargo.toml +++ b/local/recipes/core/ext4d/source/ext4d/Cargo.toml @@ -14,7 +14,7 @@ ext4-blockdev = { path = "../ext4-blockdev" } rsext4.workspace = true redox_syscall.workspace = true redox-scheme.workspace = true -libredox = { workspace = true, optional = true } +libredox = { path = "../../../../../../local/sources/libredox", workspace = true, optional = true } redox-path = { workspace = true, optional = true } log.workspace = true env_logger = { workspace = true, optional = true } diff --git a/local/recipes/core/fatd/source/Cargo.toml b/local/recipes/core/fatd/source/Cargo.toml index cb91a80965..77b968c11e 100644 --- a/local/recipes/core/fatd/source/Cargo.toml +++ b/local/recipes/core/fatd/source/Cargo.toml @@ -16,10 +16,15 @@ license = "MIT" [workspace.dependencies] fatfs = "0.3.6" fscommon = "0.1.1" -redox_syscall = "0.8" -redox-scheme = "0.11.0" -libredox = "0.1.13" +redox_syscall = { path = "../../../../../local/sources/syscall" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +libredox = { path = "../../../../../local/sources/libredox" } redox-path = "0.3.0" log = "0.4" env_logger = "0.11" libc = "0.2" + +[patch.crates-io] +libredox = { path = "../../../../../local/sources/libredox" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/core/fatd/source/fatd/Cargo.toml b/local/recipes/core/fatd/source/fatd/Cargo.toml index 207c57bc0f..d1f68a28d7 100644 --- a/local/recipes/core/fatd/source/fatd/Cargo.toml +++ b/local/recipes/core/fatd/source/fatd/Cargo.toml @@ -15,7 +15,7 @@ fatfs.workspace = true fscommon.workspace = true redox_syscall.workspace = true redox-scheme.workspace = true -libredox = { workspace = true, optional = true } +libredox = { path = "../../../../../../local/sources/libredox", workspace = true, optional = true } redox-path = { workspace = true, optional = true } log.workspace = true env_logger = { workspace = true, optional = true } diff --git a/local/recipes/dev/bison/recipe.toml b/local/recipes/dev/bison/recipe.toml index 20092672f2..c77adafd97 100644 --- a/local/recipes/dev/bison/recipe.toml +++ b/local/recipes/dev/bison/recipe.toml @@ -13,16 +13,14 @@ export ac_cv_type_posix_spawn_file_actions_t=yes COOKBOOK_CONFIGURE_FLAGS+=( --disable-nls ) -# Prevent aclocal/automake regeneration during cross-compilation. -# Bison's Makefile references aclocal-1.16 which may not match the host's -# automake version (e.g. 1.18). Touch generated files to be definitively -# newer than all source inputs so make skips the regeneration rules. sleep 1 touch "${COOKBOOK_SOURCE}/aclocal.m4" \ "${COOKBOOK_SOURCE}/configure" \ "${COOKBOOK_SOURCE}/Makefile.in" \ "${COOKBOOK_SOURCE}/config.h.in" 2>/dev/null || true -cookbook_configure +"${COOKBOOK_CONFIGURE}" "${COOKBOOK_CONFIGURE_FLAGS[@]}" YACC=/usr/bin/bison +"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}" YACC=/usr/bin/bison +"${COOKBOOK_MAKE}" install DESTDIR="${COOKBOOK_STAGE}" YACC=/usr/bin/bison """ [package] diff --git a/local/recipes/dev/bison/source/doc/bison.info b/local/recipes/dev/bison/source/doc/bison.info index 4f4fb08267..2e0fd584cd 100644 --- a/local/recipes/dev/bison/source/doc/bison.info +++ b/local/recipes/dev/bison/source/doc/bison.info @@ -1,22 +1,22 @@ -This is bison.info, produced by makeinfo version 6.8 from bison.texi. +This is bison.info, produced by makeinfo version 7.3 from bison.texi. -This manual (12 September 2021) is for GNU Bison (version 3.8.2), the -GNU parser generator. +This manual (5 July 2026) is for GNU Bison (version 3.8.2), the GNU +parser generator. - Copyright © 1988–1993, 1995, 1998–2015, 2018–2021 Free Software + Copyright © 1988-1993, 1995, 1998-2015, 2018-2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover texts - being “A GNU Manual,” and with the Back-Cover Texts as in (a) + being "A GNU Manual," and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled - “GNU Free Documentation License.” + "GNU Free Documentation License." - (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and + (a) The FSF's Back-Cover Text is: "You have the freedom to copy and modify this GNU manual. Buying copies from the FSF supports it in - developing GNU and promoting software freedom.” + developing GNU and promoting software freedom." INFO-DIR-SECTION Software development START-INFO-DIR-ENTRY * bison: (bison). GNU parser generator (Yacc replacement). @@ -28,23 +28,23 @@ File: bison.info, Node: Top, Next: Introduction, Up: (dir) Bison ***** -This manual (12 September 2021) is for GNU Bison (version 3.8.2), the -GNU parser generator. +This manual (5 July 2026) is for GNU Bison (version 3.8.2), the GNU +parser generator. - Copyright © 1988–1993, 1995, 1998–2015, 2018–2021 Free Software + Copyright © 1988-1993, 1995, 1998-2015, 2018-2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover texts - being “A GNU Manual,” and with the Back-Cover Texts as in (a) + being "A GNU Manual," and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled - “GNU Free Documentation License.” + "GNU Free Documentation License." - (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and + (a) The FSF's Back-Cover Text is: "You have the freedom to copy and modify this GNU manual. Buying copies from the FSF supports it in - developing GNU and promoting software freedom.” + developing GNU and promoting software freedom." * Menu: @@ -76,20 +76,20 @@ Reference sections: * Bibliography:: Publications cited in this manual. * Index of Terms:: Cross-references to the text. - — The Detailed Node Listing — + -- The Detailed Node Listing -- The Concepts of Bison * Language and Grammar:: Languages and context-free grammars, as mathematical ideas. -* Grammar in Bison:: How we represent grammars for Bison’s sake. +* Grammar in Bison:: How we represent grammars for Bison's sake. * Semantic Values:: Each token or syntactic grouping can have a semantic value (the value of an integer, the name of an identifier, etc.). * Semantic Actions:: Each rule can have an action containing C code. * GLR Parsers:: Writing parsers for general context-free languages. * Locations:: Overview of location tracking. -* Bison Parser:: What are Bison’s input and output, +* Bison Parser:: What are Bison's input and output, how is the output used? * Stages:: Stages in writing and running Bison grammars. * Grammar Layout:: Overall structure of a Bison grammar file. @@ -211,7 +211,7 @@ Bison Declarations * Pure Decl:: Requesting a reentrant parser. * Push Decl:: Requesting a push parser. * Decl Summary:: Table of all Bison declarations. -* %define Summary:: Defining variables to adjust Bison’s behavior. +* %define Summary:: Defining variables to adjust Bison's behavior. * %code Summary:: Inserting code into the parser source. Parser C-Language Interface @@ -222,7 +222,7 @@ Parser C-Language Interface which reads tokens. * Error Reporting:: Passing error messages to the user. * Action Features:: Special features for use in actions. -* Internationalization:: How to let the parser speak in the user’s +* Internationalization:: How to let the parser speak in the user's native language. The Lexical Analyzer Function ‘yylex’ @@ -253,7 +253,7 @@ The Bison Parser Algorithm * Lookahead:: Parser looks one token ahead when deciding what to do. * Shift/Reduce:: Conflicts: when either shifting or reduction is valid. * Precedence:: Operator precedence works by resolving conflicts. -* Contextual Precedence:: When an operator’s precedence depends on context. +* Contextual Precedence:: When an operator's precedence depends on context. * Parser States:: The parser is a finite-state-machine with stack. * Reduce/Reduce:: When two rules are applicable in the same situation. * Mysterious Conflicts:: Conflicts that look unjustified. @@ -401,7 +401,6 @@ Copying This Manual * GNU Free Documentation License:: Copying and sharing this manual -  File: bison.info, Node: Introduction, Next: Conditions, Prev: Top, Up: Top @@ -423,7 +422,7 @@ understand this manual. We begin with tutorial chapters that explain the basic concepts of using Bison and show three explained examples, each building on the -last. If you don’t know Bison or Yacc, start by reading these chapters. +last. If you don't know Bison or Yacc, start by reading these chapters. Reference chapters follow, which describe specific aspects of Bison in detail. @@ -454,24 +453,24 @@ software. The reason Bison was different was not due to a special policy decision; it resulted from applying the usual General Public License to all of the Bison source code. - The main output of the Bison utility—the Bison parser implementation -file—contains a verbatim copy of a sizable piece of Bison, which is the -code for the parser’s implementation. (The actions from your grammar + The main output of the Bison utility--the Bison parser implementation +file--contains a verbatim copy of a sizable piece of Bison, which is the +code for the parser's implementation. (The actions from your grammar are inserted into this implementation at one point, but most of the rest of the implementation is not changed.) When we applied the GPL terms to -the skeleton code for the parser’s implementation, the effect was to +the skeleton code for the parser's implementation, the effect was to restrict the use of Bison output to free software. - We didn’t change the terms because of sympathy for people who want to + We didn't change the terms because of sympathy for people who want to make software proprietary. *Software should be free.* But we concluded -that limiting Bison’s use to free software was doing little to encourage +that limiting Bison's use to free software was doing little to encourage people to make other software free. So we decided to make the practical conditions for using Bison match the practical conditions for using the other GNU tools. This exception applies when Bison is generating code for a parser. You can tell whether the exception applies to a Bison output file by -inspecting the file for text beginning with “As a special exception...”. +inspecting the file for text beginning with "As a special exception...". The text spells out the exact terms of the exception.  @@ -496,7 +495,7 @@ and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program—to make sure it remains free +share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to @@ -524,16 +523,16 @@ know their rights. (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. - For the developers’ and authors’ protection, the GPL clearly explains -that there is no warranty for this free software. For both users’ and -authors’ sake, the GPL requires that modified versions be marked as + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of -protecting users’ freedom to change the software. The systematic +protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those @@ -556,25 +555,25 @@ TERMS AND CONDITIONS 0. Definitions. - “This License” refers to version 3 of the GNU General Public + "This License" refers to version 3 of the GNU General Public License. - “Copyright” also means copyright-like laws that apply to other + "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. - “The Program” refers to any copyrightable work licensed under this - License. Each licensee is addressed as “you”. “Licensees” and - “recipients” may be individuals or organizations. + "The Program" refers to any copyrightable work licensed under this + License. Each licensee is addressed as "you". "Licensees" and + "recipients" may be individuals or organizations. - To “modify” a work means to copy from or adapt all or part of the + To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the - making of an exact copy. The resulting work is called a “modified - version” of the earlier work or a work “based on” the earlier work. + making of an exact copy. The resulting work is called a "modified + version" of the earlier work or a work "based on" the earlier work. - A “covered work” means either the unmodified Program or a work + A "covered work" means either the unmodified Program or a work based on the Program. - To “propagate” a work means to do anything with it that, without + To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes @@ -582,12 +581,12 @@ TERMS AND CONDITIONS available to the public, and in some countries other activities as well. - To “convey” a work means any kind of propagation that enables other + To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. - An interactive user interface displays “Appropriate Legal Notices” + An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to @@ -599,33 +598,33 @@ TERMS AND CONDITIONS 1. Source Code. - The “source code” for a work means the preferred form of the work - for making modifications to it. “Object code” means any non-source + The "source code" for a work means the preferred form of the work + for making modifications to it. "Object code" means any non-source form of a work. - A “Standard Interface” means an interface that either is an + A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. - The “System Libraries” of an executable work include anything, + The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code - form. A “Major Component”, in this context, means a major + form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. - The “Corresponding Source” for a work in object code form means all + The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the - work’s System Libraries, or general-purpose tools or generally + work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated @@ -669,7 +668,7 @@ TERMS AND CONDITIONS the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. - 3. Protecting Users’ Legal Rights From Anti-Circumvention Law. + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under @@ -682,12 +681,12 @@ TERMS AND CONDITIONS circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of - enforcing, against the work’s users, your or third parties’ legal + enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. - You may convey verbatim copies of the Program’s source code as you + You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any @@ -711,7 +710,7 @@ TERMS AND CONDITIONS b. The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in - section 4 to “keep intact all notices”. + section 4 to "keep intact all notices". c. You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This @@ -731,9 +730,9 @@ TERMS AND CONDITIONS works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is - called an “aggregate” if the compilation and its resulting + called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the - compilation’s users beyond what the individual works permit. + compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. @@ -791,13 +790,13 @@ TERMS AND CONDITIONS excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. - A “User Product” is either (1) a “consumer product”, which means + A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, - “normally used” refers to a typical or common use of that class of + "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product @@ -805,7 +804,7 @@ TERMS AND CONDITIONS industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. - “Installation Information” for a User Product means any methods, + "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. @@ -841,7 +840,7 @@ TERMS AND CONDITIONS 7. Additional Terms. - “Additional permissions” are terms that supplement the terms of + "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in @@ -886,8 +885,8 @@ TERMS AND CONDITIONS the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. - All other non-permissive additional terms are considered “further - restrictions” within the meaning of section 10. If the Program as + All other non-permissive additional terms are considered "further + restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document @@ -953,12 +952,12 @@ TERMS AND CONDITIONS responsible for enforcing compliance by third parties with this License. - An “entity transaction” is a transaction transferring control of an + An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever - licenses to the work the party’s predecessor in interest had or + licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable @@ -975,31 +974,31 @@ TERMS AND CONDITIONS 11. Patents. - A “contributor” is a copyright holder who authorizes use under this + A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. - The work thus licensed is called the contributor’s “contributor - version”. + The work thus licensed is called the contributor's "contributor + version". - A contributor’s “essential patent claims” are all patent claims + A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the - contributor version. For purposes of this definition, “control” + contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, - royalty-free patent license under the contributor’s essential + royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. - In the following three paragraphs, a “patent license” is any + In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a - patent or covenant not to sue for patent infringement). To “grant” + patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. @@ -1012,9 +1011,9 @@ TERMS AND CONDITIONS yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream - recipients. “Knowingly relying” means you have actual knowledge + recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work - in a country, or your recipient’s use of the covered work in a + in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. @@ -1026,7 +1025,7 @@ TERMS AND CONDITIONS patent license you grant is automatically extended to all recipients of the covered work and works based on it. - A patent license is “discriminatory” if it does not include within + A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a @@ -1046,7 +1045,7 @@ TERMS AND CONDITIONS any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. - 12. No Surrender of Others’ Freedom. + 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they @@ -1079,7 +1078,7 @@ TERMS AND CONDITIONS Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU - General Public License “or any later version” applies to it, you + General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version @@ -1088,7 +1087,7 @@ TERMS AND CONDITIONS If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that - proxy’s public statement of acceptance of a version permanently + proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different @@ -1100,7 +1099,7 @@ TERMS AND CONDITIONS THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE - COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” + COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE @@ -1144,7 +1143,7 @@ terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the -“copyright” line and a pointer to where the full notice is found. +"copyright" line and a pointer to where the full notice is found. ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. Copyright (C) YEAR NAME OF AUTHOR @@ -1175,11 +1174,11 @@ notice like this when it starts in an interactive mode: The hypothetical commands ‘show w’ and ‘show c’ should show the appropriate parts of the General Public License. Of course, your -program’s commands might be different; for a GUI interface, you would -use an “about box”. +program's commands might be different; for a GUI interface, you would +use an "about box". You should also get your employer (if you work as a programmer) or -school, if any, to sign a “copyright disclaimer” for the program, if +school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . @@ -1205,14 +1204,14 @@ carefully. * Language and Grammar:: Languages and context-free grammars, as mathematical ideas. -* Grammar in Bison:: How we represent grammars for Bison’s sake. +* Grammar in Bison:: How we represent grammars for Bison's sake. * Semantic Values:: Each token or syntactic grouping can have a semantic value (the value of an integer, the name of an identifier, etc.). * Semantic Actions:: Each rule can have an action containing C code. * GLR Parsers:: Writing parsers for general context-free languages. * Locations:: Overview of location tracking. -* Bison Parser:: What are Bison’s input and output, +* Bison Parser:: What are Bison's input and output, how is the output used? * Stages:: Stages in writing and running Bison grammars. * Grammar Layout:: Overall structure of a Bison grammar file. @@ -1227,14 +1226,14 @@ In order for Bison to parse a language, it must be described by a “context-free grammar”. This means that you specify one or more “syntactic groupings” and give rules for constructing them from their parts. For example, in the C language, one kind of grouping is called -an ‘expression’. One rule for making an expression might be, “An -expression can be made of a minus sign and another expression”. Another -would be, “An expression can be an integer”. As you can see, rules are +an 'expression'. One rule for making an expression might be, "An +expression can be made of a minus sign and another expression". Another +would be, "An expression can be an integer". As you can see, rules are often recursive, but there must be at least one rule which leads out of the recursion. The most common formal system for presenting such rules for humans to -read is “Backus-Naur Form” or “BNF”, which was developed in order to +read is “Backus-Naur Form” or "BNF", which was developed in order to specify the language Algol 60. Any grammar expressed in BNF is a context-free grammar. The input to Bison is essentially machine-readable BNF. @@ -1259,14 +1258,14 @@ rules to get the same inputs. Even unambiguous grammars can be “nondeterministic”, meaning that no fixed lookahead always suffices to determine the next grammar rule to apply. With the proper declarations, Bison is also able to parse these more general context-free grammars, -using a technique known as GLR parsing (for Generalized LR). Bison’s GLR +using a technique known as GLR parsing (for Generalized LR). Bison's GLR parsers are able to handle any context-free grammar for which the number of possible parses of any given string is finite. In the formal grammatical rules for a language, each kind of syntactic unit or grouping is named by a “symbol”. Those which are built by grouping smaller constructs according to grammatical rules are -called “nonterminal symbols”; those which can’t be subdivided are called +called “nonterminal symbols”; those which can't be subdivided are called “terminal symbols” or “token kinds”. We call a piece of input corresponding to a single terminal symbol a “token”, and a piece corresponding to a single nonterminal symbol a “grouping”. @@ -1275,26 +1274,26 @@ corresponding to a single nonterminal symbol a “grouping”. nonterminal, mean. The tokens of C are identifiers, constants (numeric and string), and the various keywords, arithmetic operators and punctuation marks. So the terminal symbols of a grammar for C include -‘identifier’, ‘number’, ‘string’, plus one symbol for each keyword, -operator or punctuation mark: ‘if’, ‘return’, ‘const’, ‘static’, ‘int’, -‘char’, ‘plus-sign’, ‘open-brace’, ‘close-brace’, ‘comma’ and many more. +'identifier', 'number', 'string', plus one symbol for each keyword, +operator or punctuation mark: 'if', 'return', 'const', 'static', 'int', +'char', 'plus-sign', 'open-brace', 'close-brace', 'comma' and many more. (These tokens can be subdivided into characters, but that is a matter of lexicography, not grammar.) Here is a simple C function subdivided into tokens: - int /* keyword ‘int’ */ - square (int x) /* identifier, open-paren, keyword ‘int’, + int /* keyword 'int' */ + square (int x) /* identifier, open-paren, keyword 'int', identifier, close-paren */ { /* open-brace */ - return x * x; /* keyword ‘return’, identifier, asterisk, + return x * x; /* keyword 'return', identifier, asterisk, identifier, semicolon */ } /* close-brace */ The syntactic groupings of C include the expression, the statement, the declaration, and the function definition. These are represented in -the grammar of C by nonterminal symbols ‘expression’, ‘statement’, -‘declaration’ and ‘function definition’. The full grammar uses dozens +the grammar of C by nonterminal symbols 'expression', 'statement', +'declaration' and 'function definition'. The full grammar uses dozens of additional language constructs, each with its own nonterminal symbol, in order to express the meanings of these four. The example above is a function definition; it contains one declaration, and one statement. In @@ -1305,28 +1304,28 @@ made out of simpler constructs. For example, one kind of C statement is the ‘return’ statement; this would be described with a grammar rule which reads informally as follows: - A ‘statement’ can be made of a ‘return’ keyword, an ‘expression’ - and a ‘semicolon’. + A 'statement' can be made of a 'return' keyword, an 'expression' + and a 'semicolon'. -There would be many other rules for ‘statement’, one for each kind of +There would be many other rules for 'statement', one for each kind of statement in C. One nonterminal symbol must be distinguished as the special one which defines a complete utterance in the language. It is called the “start symbol”. In a compiler, this means a complete input program. In the C -language, the nonterminal symbol ‘sequence of definitions and -declarations’ plays this role. +language, the nonterminal symbol 'sequence of definitions and +declarations' plays this role. - For example, ‘1 + 2’ is a valid C expression—a valid part of a C -program—but it is not valid as an _entire_ C program. In the -context-free grammar of C, this follows from the fact that ‘expression’ + For example, ‘1 + 2’ is a valid C expression--a valid part of a C +program--but it is not valid as an _entire_ C program. In the +context-free grammar of C, this follows from the fact that 'expression' is not the start symbol. The Bison parser reads a sequence of tokens as its input, and groups the tokens using the grammar rules. If the input is valid, the end result is that the entire token sequence reduces to a single grouping -whose symbol is the grammar’s start symbol. If we use a grammar for C, -the entire input must be a ‘sequence of definitions and declarations’. +whose symbol is the grammar's start symbol. If we use a grammar for C, +the entire input must be a 'sequence of definitions and declarations'. If not, the parser reports a syntax error.  @@ -1378,7 +1377,7 @@ File: bison.info, Node: Semantic Values, Next: Semantic Actions, Prev: Gramma =================== A formal grammar selects tokens only by their classifications: for -example, if a rule mentions the terminal symbol ‘integer constant’, it +example, if a rule mentions the terminal symbol 'integer constant', it means that _any_ integer constant is grammatically valid in that position. The precise value of the constant is irrelevant to how to parse the input: if ‘x+4’ is grammatical then ‘x+1’ or ‘x+3989’ is @@ -1398,7 +1397,7 @@ kinds. The semantic value has all the rest of the information about the meaning of the token, such as the value of an integer, or the name of an -identifier. (A token such as ‘','’ which is just punctuation doesn’t +identifier. (A token such as ‘','’ which is just punctuation doesn't need to have any semantic value.) For example, an input token might be classified as token kind @@ -1406,7 +1405,7 @@ need to have any semantic value.) the same token kind ‘INTEGER’ but value 3989. When a grammar rule says that ‘INTEGER’ is allowed, either of these tokens is acceptable because each is an ‘INTEGER’. When the parser accepts the token, it keeps track -of the token’s semantic value. +of the token's semantic value. Each grouping can also have a semantic value as well as its nonterminal symbol. For example, in a calculator, an expression @@ -1448,7 +1447,7 @@ File: bison.info, Node: GLR Parsers, Next: Locations, Prev: Semantic Actions, 1.5 Writing GLR Parsers ======================= -In some grammars, Bison’s deterministic LR(1) parsing algorithm cannot +In some grammars, Bison's deterministic LR(1) parsing algorithm cannot decide whether to apply a certain grammar rule at a given point. That is, it may not be able to decide (on the basis of the input read so far) which of two possible reductions (applications of a grammar rule) @@ -1534,7 +1533,7 @@ become a new identifier to represent the enumeration value, while in the former case ‘a’ must be evaluated with its current meaning, which may be a constant or even a function call. - You could parse ‘(a)’ as an “unspecified identifier in parentheses”, + You could parse ‘(a)’ as an "unspecified identifier in parentheses", to be resolved later, but this typically requires substantial contortions in both semantic actions and large parts of the grammar, where the parentheses are nested in the recursive rules for expressions. @@ -1542,7 +1541,7 @@ where the parentheses are nested in the recursive rules for expressions. You might think of using the lexer to distinguish between the two forms by returning different tokens for currently defined and undefined identifiers. But if these declarations occur in a local scope, and ‘a’ -is defined in an outer scope, then both forms are possible—either +is defined in an outer scope, then both forms are possible--either locally redefining ‘a’, or using the value of ‘a’ from the outer scope. So this approach cannot work. @@ -1560,7 +1559,7 @@ split. If the input is syntactically incorrect, both branches fail and the parser reports a syntax error as usual. - The effect of all this is that the parser seems to “guess” the + The effect of all this is that the parser seems to "guess" the correct branch to take, or in other words, it seems to use more lookahead than the underlying LR(1) algorithm actually allows for. In this example, LR(2) would suffice, but also some cases that are not @@ -1652,7 +1651,7 @@ File: bison.info, Node: Merging GLR Parses, Next: GLR Semantic Actions, Prev: 1.5.2 Using GLR to Resolve Ambiguities -------------------------------------- -Let’s consider an example, vastly simplified from a C++ grammar.(1) +Let's consider an example, vastly simplified from a C++ grammar.(1) %{ #include @@ -1701,7 +1700,7 @@ Let’s consider an example, vastly simplified from a C++ grammar.(1) | '(' declarator ')' ; -This models a problematic part of the C++ grammar—the ambiguity between +This models a problematic part of the C++ grammar--the ambiguity between certain declarations and statements. For example, T (x) = y+z; @@ -1713,10 +1712,10 @@ ID’, which it cannot resolve at the time it encounters ‘x’ in the example above. Since this is a GLR parser, it therefore splits the problem into two parses, one for each choice of resolving the reduce/reduce conflict. Unlike the example from the previous section -(*note Simple GLR Parsers::), however, neither of these parses “dies,” +(*note Simple GLR Parsers::), however, neither of these parses "dies," because the grammar as it stands is ambiguous. One of the parsers eventually reduces ‘stmt : expr ';'’ and the other reduces ‘stmt : -decl’, after which both parsers are in an identical state: they’ve seen +decl’, after which both parsers are in an identical state: they've seen ‘prog stmt’ and have the same unprocessed input remaining. We say that these parses have “merged.” @@ -1834,11 +1833,11 @@ features you might use in a semantic action in a GLR parser. kind of the lookahead token present at the time of the associated reduction. After checking that ‘yychar’ is not set to ‘YYEMPTY’ or ‘YYEOF’, you can then examine ‘yylval’ and ‘yylloc’ to determine the -lookahead token’s semantic value and location, if any. In a nondeferred +lookahead token's semantic value and location, if any. In a nondeferred semantic action, you can also modify any of these variables to influence syntax analysis. *Note Lookahead::. - In a deferred semantic action, it’s too late to influence syntax + In a deferred semantic action, it's too late to influence syntax analysis. In this case, ‘yychar’, ‘yylval’, and ‘yylloc’ are set to shallow copies of the values they had at the time of the associated reduction. For this reason alone, modifying them is dangerous. @@ -1967,14 +1966,14 @@ distinct programs: the Bison utility is a program whose output is the Bison parser implementation file that becomes part of your program. The job of the Bison parser is to group tokens into groupings -according to the grammar rules—for example, to build identifiers and +according to the grammar rules--for example, to build identifiers and operators into expressions. As it does this, it runs the actions for the grammar rules it uses. The tokens come from a function called the “lexical analyzer” that you must supply in some fashion (such as by writing it in C). The Bison parser calls the lexical analyzer each time it wants a new token. It -doesn’t know what is “inside” the tokens (though their semantic values +doesn't know what is "inside" the tokens (though their semantic values may reflect this). Typically the lexical analyzer makes the tokens by parsing characters of text, but Bison does not depend on this. *Note Lexical::. @@ -2092,9 +2091,9 @@ File: bison.info, Node: Examples, Next: Grammar File, Prev: Concepts, Up: To Now we show and explain several sample programs written using Bison: a Reverse Polish Notation calculator, an algebraic (infix) notation -calculator — later extended to track “locations” — and a multi-function -calculator. All produce usable, though limited, interactive desk-top -calculators. +calculator -- later extended to track "locations" -- and a +multi-function calculator. All produce usable, though limited, +interactive desk-top calculators. These examples are simple, but Bison grammars for real programming languages are written the same way. You can copy these examples into a @@ -2188,13 +2187,13 @@ about the tokens and their types (*note Bison Declarations::). The ‘%define’ directive defines the variable ‘api.value.type’, thus specifying the C data type for semantic values of both tokens and groupings (*note Value Type::). The Bison parser will use whatever type -‘api.value.type’ is defined as; if you don’t define it, ‘int’ is the +‘api.value.type’ is defined as; if you don't define it, ‘int’ is the default. Because we specify ‘{double}’, each token and each expression has an associated value, which is a floating point number. C code can use ‘YYSTYPE’ to refer to the value ‘api.value.type’. Each terminal symbol that is not a single-character literal must be -declared. (Single-character literals normally don’t need to be +declared. (Single-character literals normally don't need to be declared.) In this example, all the arithmetic operators are designated by single-character literals, so the only terminal symbol that needs to be declared is ‘NUM’, the token kind for numeric constants. @@ -2228,11 +2227,11 @@ Here are the grammar rules for the Reverse Polish Notation calculator. ; %% - The groupings of the rpcalc “language” defined here are the + The groupings of the rpcalc "language" defined here are the expression (given the name ‘exp’), the line of input (‘line’), and the complete input transcript (‘input’). Each of these nonterminal symbols has several alternate rules, joined by the vertical bar ‘|’ which is -read as “or”. The following sections explain what these rules mean. +read as "or". The following sections explain what these rules mean. The semantics of the language is determined by the actions taken when a grouping is recognized. The actions are the C code that appears @@ -2264,25 +2263,25 @@ Consider the definition of ‘input’: | input line ; - This definition reads as follows: “A complete input is either an -empty string, or a complete input followed by an input line”. Notice -that “complete input” is defined in terms of itself. This definition is + This definition reads as follows: "A complete input is either an +empty string, or a complete input followed by an input line". Notice +that "complete input" is defined in terms of itself. This definition is said to be “left recursive” since ‘input’ appears always as the leftmost symbol in the sequence. *Note Recursion::. The first alternative is empty because there are no symbols between the colon and the first ‘|’; this means that ‘input’ can match an empty string of input (no tokens). We write the rules this way because it is -legitimate to type ‘Ctrl-d’ right after you start the calculator. It’s +legitimate to type ‘Ctrl-d’ right after you start the calculator. It's conventional to put an empty alternative first and to use the (optional) ‘%empty’ directive, or to write the comment ‘/* empty */’ in it (*note Empty Rules::). The second alternate rule (‘input line’) handles all nontrivial -input. It means, “After reading any number of lines, read one more line -if possible.” The left recursion makes this rule into a loop. Since the -first alternative matches empty input, the loop can be executed zero or -more times. +input. It means, "After reading any number of lines, read one more line +if possible." The left recursion makes this rule into a loop. Since +the first alternative matches empty input, the loop can be executed zero +or more times. The parser function ‘yyparse’ continues to process input until a grammatical error is seen or the lexical analyzer says there are no more @@ -2313,8 +2312,8 @@ for. This action is unusual because it does not assign a value to ‘$$’. As a consequence, the semantic value associated with the ‘line’ is uninitialized (its value will be unpredictable). This would be a bug if -that value were ever used, but we don’t use it: once rpcalc has printed -the value of the user’s input line, that value is no longer needed. +that value were ever used, but we don't use it: once rpcalc has printed +the value of the user's input line, that value is no longer needed.  File: bison.info, Node: Rpcalc Exp, Prev: Rpcalc Line, Up: Rpcalc Rules @@ -2352,10 +2351,10 @@ associated semantic value, but if it had one you could refer to it as }’. When ‘yyparse’ recognizes a sum expression using this rule, the sum -of the two subexpressions’ values is produced as the value of the entire +of the two subexpressions' values is produced as the value of the entire expression. *Note Actions::. - You don’t have to give an action for every rule. When a rule has no + You don't have to give an action for every rule. When a rule has no action, Bison by default copies the value of ‘$1’ into ‘$$’. This is what happens in the first rule (the one that uses ‘NUM’). @@ -2381,14 +2380,14 @@ File: bison.info, Node: Rpcalc Lexer, Next: Rpcalc Main, Prev: Rpcalc Rules, 2.1.3 The ‘rpcalc’ Lexical Analyzer ----------------------------------- -The lexical analyzer’s job is low-level parsing: converting characters +The lexical analyzer's job is low-level parsing: converting characters or sequences of characters into tokens. The Bison parser gets its tokens by calling the lexical analyzer. *Note Lexical::. Only a simple lexical analyzer is needed for the RPN calculator. This lexical analyzer skips blanks and tabs, then reads in numbers as ‘double’ and returns them as ‘NUM’ tokens. Any other character that -isn’t part of a number is a separate token. Note that the token-code +isn't part of a number is a separate token. Note that the token-code for such a single-character token is the character itself. The return value of the lexical analyzer function is a numeric code @@ -2507,8 +2506,8 @@ command to convert it into a parser implementation file: $ bison FILE.y -In this example, the grammar file is called ‘rpcalc.y’ (for “Reverse -Polish CALCulator”). Bison produces a parser implementation file named +In this example, the grammar file is called ‘rpcalc.y’ (for "Reverse +Polish CALCulator"). Bison produces a parser implementation file named ‘FILE.tab.c’, removing the ‘.y’ from the grammar file name. The parser implementation file contains the source code for ‘yyparse’. The additional functions in the grammar file (‘yylex’, ‘yyerror’ and ‘main’) @@ -2611,7 +2610,7 @@ kinds and says they are left-associative operators. The declarations ‘%left’ and ‘%right’ (right associativity) take the place of ‘%token’ which is used to declare a token kind name without associativity/precedence. (These tokens are single-character literals, -which ordinarily don’t need to be declared. We declare them here to +which ordinarily don't need to be declared. We declare them here to specify the associativity/precedence.) Operator precedence is determined by the line ordering of the @@ -2623,7 +2622,7 @@ matters (‘%precedence’. *Note Precedence::. The other important new feature is the ‘%prec’ in the grammar section for the unary minus operator. The ‘%prec’ simply instructs Bison that -the rule ‘| '-' exp’ has the same precedence as ‘NEG’—in this case the +the rule ‘| '-' exp’ has the same precedence as ‘NEG’--in this case the next-to-highest. *Note Contextual Precedence::. Here is a sample run of ‘calc.y’: @@ -2649,7 +2648,7 @@ File: bison.info, Node: Simple Error Recovery, Next: Location Tracking Calc, ========================= Up to this point, this manual has not addressed the issue of “error -recovery”—how to continue parsing after the parser detects a syntax +recovery”--how to continue parsing after the parser detects a syntax error. All we have handled is error reporting with ‘yyerror’. Recall that by default ‘yyparse’ returns after calling ‘yyerror’. This means that an erroneous input line causes the calculator program to exit. Now @@ -2679,7 +2678,7 @@ other kinds of errors; for example, division by zero, which raises an exception signal that is normally fatal. A real calculator program must handle this signal and use ‘longjmp’ to return to ‘main’ and resume parsing input lines; it would also have to discard the rest of the -current line of input. We won’t discuss this issue further because it +current line of input. We won't discuss this issue further because it is not specific to Bison programs.  @@ -2785,7 +2784,7 @@ the wrong expressions or subexpressions. using the pseudo-variables ‘@N’ for rule components, and the pseudo-variable ‘@$’ for groupings. - We don’t need to assign a value to ‘@$’: the output parser does it + We don't need to assign a value to ‘@$’: the output parser does it automatically. By default, before executing the C code of each action, ‘@$’ is set to range from the beginning of ‘@1’ to the end of ‘@N’, for a rule with N components. This behavior can be redefined (*note @@ -2798,7 +2797,7 @@ File: bison.info, Node: Ltcalc Lexer, Prev: Ltcalc Rules, Up: Location Tracki 2.4.3 The ‘ltcalc’ Lexical Analyzer. ------------------------------------ -Until now, we relied on Bison’s defaults to enable location tracking. +Until now, we relied on Bison's defaults to enable location tracking. The next step is to rewrite the lexical analyzer, and make it able to feed the parser with the token locations, as it already does for semantic values. @@ -2851,7 +2850,7 @@ input text, to avoid the computed locations of being fuzzy or wrong: Basically, the lexical analyzer performs the same processing as before: it skips blanks and tabs, and reads numbers or single-character tokens. In addition, it updates ‘yylloc’, the global variable (of type -‘YYLTYPE’) containing the token’s location. +‘YYLTYPE’) containing the token's location. Now, each time this function returns a token, the parser has its kind as well as its semantic value, and its location in the text. The last @@ -3018,7 +3017,7 @@ File: bison.info, Node: Mfcalc Symbol Table, Next: Mfcalc Lexer, Prev: Mfcalc ------------------------------- The multi-function calculator requires a symbol table to keep track of -the names and meanings of variables and functions. This doesn’t affect +the names and meanings of variables and functions. This doesn't affect the grammar rules (except for the actions) or the Bison declarations, but it requires some additional C functions for support. @@ -3315,7 +3314,7 @@ The PROLOGUE section contains macro definitions and declarations of functions and variables that are used in the actions in the grammar rules. These are copied to the beginning of the parser implementation file so that they precede the definition of ‘yyparse’. You can use -‘#include’ to get the declarations from a header file. If you don’t +‘#include’ to get the declarations from a header file. If you don't need any C declarations, you may omit the ‘%{’ and ‘%}’ delimiters that bracket this section. @@ -3384,9 +3383,9 @@ qualifier can be omitted for the default location, or it can be one of ... -Notice that there are two PROLOGUE sections here, but there’s a subtle +Notice that there are two PROLOGUE sections here, but there's a subtle distinction between their functionality. For example, if you decide to -override Bison’s default definition for ‘YYLTYPE’, in which PROLOGUE +override Bison's default definition for ‘YYLTYPE’, in which PROLOGUE section should you write your new definition?(1) You should write it in the first since Bison will insert that code into the parser implementation file _before_ the default ‘YYLTYPE’ definition. In which @@ -3403,7 +3402,7 @@ Second, what if there is no ‘%union’? In that case, the second kind of PROLOGUE section is not available. This behavior is not intuitive. To avoid this subtle ‘%union’ dependency, rewrite the example using a -‘%code top’ and an unqualified ‘%code’. Let’s go ahead and add the new +‘%code top’ and an unqualified ‘%code’. Let's go ahead and add the new ‘YYLTYPE’ definition and the ‘trace_token’ prototype at the same time: %code top { @@ -3438,7 +3437,7 @@ PROLOGUE section is not available. This behavior is not intuitive. ... In this way, ‘%code top’ and the unqualified ‘%code’ achieve the same -functionality as the two kinds of PROLOGUE sections, but it’s always +functionality as the two kinds of PROLOGUE sections, but it's always explicit which kind you intend. Moreover, both kinds are always available even in the absence of ‘%union’. @@ -3446,7 +3445,7 @@ available even in the absence of ‘%union’. two lines before the warning need to appear near the top of the parser implementation file. The first line after the warning is required by ‘YYSTYPE’ and thus also needs to appear in the parser implementation -file. However, if you’ve instructed Bison to generate a parser header +file. However, if you've instructed Bison to generate a parser header file (*note Decl Summary::), you probably want that line to appear before the ‘YYSTYPE’ definition in that header file as well. The ‘YYLTYPE’ definition should also appear in the parser header file to @@ -3510,7 +3509,7 @@ provide ‘trace_token’ to modules that are external to your parser. Thus, you might wish for Bison to insert the prototype into both the parser header file and the parser implementation file. Since this function is not a dependency required by ‘YYSTYPE’ or ‘YYLTYPE’, it -doesn’t make sense to move its prototype to a ‘%code requires’. More +doesn't make sense to move its prototype to a ‘%code requires’. More importantly, since it depends upon ‘YYLTYPE’ and ‘yytoken_kind_t’, ‘%code requires’ is not sufficient. Instead, move its prototype from the unqualified ‘%code’ to a ‘%code provides’: @@ -3583,7 +3582,7 @@ semantic-type-related directives by semantic type: You could even place each of the above directive groups in the rules section of the grammar file next to the set of rules that uses the associated semantic type. (In the rules section, you must terminate -each of those directives with a semicolon.) And you don’t have to worry +each of those directives with a semicolon.) And you don't have to worry that some directive (like a ‘%union’) in the definitions section is going to adversely affect their functionality in some counter-intuitive manner just because it comes first. Such an organization is not @@ -3591,7 +3590,7 @@ possible using PROLOGUE sections. This section has been concerned with explaining the advantages of the four PROLOGUE alternatives over the original Yacc PROLOGUE. However, in -most cases when using these directives, you shouldn’t need to think +most cases when using these directives, you shouldn't need to think about all the low-level ordering issues discussed here. Instead, you should simply use these directives to label each block of your code according to its purpose and let Bison handle the ordering. ‘%code’ is @@ -3664,7 +3663,7 @@ of syntactically equivalent tokens. You use the symbol in grammar rules to mean that a token in that class is allowed. The symbol is represented in the Bison parser by a numeric code, and the ‘yylex’ function returns a token kind code to indicate what kind of token has -been read. You don’t need to know what the code value is; you can use +been read. You don't need to know what the code value is; you can use the symbol to stand for it. A “nonterminal symbol” stands for a class of syntactically equivalent @@ -3690,7 +3689,7 @@ token names. • A “character token kind” (or “literal character token”) is written in the grammar using the same syntax used in C for character constants; for example, ‘'+'’ is a character token kind. A - character token kind doesn’t need to be declared unless you need to + character token kind doesn't need to be declared unless you need to specify its semantic value data type (*note Value Type::), associativity, or precedence (*note Precedence::). @@ -3709,13 +3708,13 @@ token names. • A “literal string token” is written like a C string constant; for example, ‘"<="’ is a literal string token. A literal string token - doesn’t need to be declared unless you need to specify its semantic + doesn't need to be declared unless you need to specify its semantic value data type (*note Value Type::), associativity, or precedence (*note Precedence::). You can associate the literal string token with a symbolic name as an alias, using the ‘%token’ declaration (*note Token Decl::). If - you don’t do that, the lexical analyzer has to retrieve the token + you don't do that, the lexical analyzer has to retrieve the token code for the literal string token from the ‘yytname’ table (*note Calling Convention::). @@ -3748,7 +3747,7 @@ token kind is simply the positive numeric code of the character, so though you may need to convert it to ‘unsigned char’ to avoid sign-extension on hosts where ‘char’ is signed. Each named token kind becomes a C macro in the parser implementation file, so ‘yylex’ can use -the name to stand for the code. (This is why periods don’t make sense +the name to stand for the code. (This is why periods don't make sense in terminal symbols.) *Note Calling Convention::. If ‘yylex’ is defined in a separate file, you need to arrange for the @@ -3777,7 +3776,7 @@ that are incompatible with ASCII must rebuild those files before compiling them. The symbol ‘error’ is a terminal symbol reserved for error recovery -(*note Error Recovery::); you shouldn’t use it for any other purpose. +(*note Error Recovery::); you shouldn't use it for any other purpose. In particular, ‘yylex’ should never return this value. The default value of the error token is 256, unless you explicitly assigned 256 to one of your tokens with a ‘%token’ declaration. @@ -3996,14 +3995,14 @@ or The value of ‘api.value.type’ should be a type name that does not contain parentheses or square brackets. - Alternatively in C, instead of relying of Bison’s ‘%define’ support, + Alternatively in C, instead of relying of Bison's ‘%define’ support, you may rely on the C preprocessor and define ‘YYSTYPE’ as a macro: #define YYSTYPE double This macro definition must go in the prologue of the grammar file (*note Grammar Outline::). If compatibility with POSIX Yacc matters to you, -use this. Note however that Bison cannot know ‘YYSTYPE’’s value, not +use this. Note however that Bison cannot know ‘YYSTYPE’'s value, not even whether it is defined, so there are services it cannot provide. Besides this works only for C. @@ -4223,18 +4222,18 @@ references construct. Note that the vertical-bar character ‘|’ is really a rule separator, and actions are attached to a single rule. This is a difference with -tools like Flex, for which ‘|’ stands for either “or”, or “the same -action as that of the next rule”. In the following example, the action +tools like Flex, for which ‘|’ stands for either "or", or "the same +action as that of the next rule". In the following example, the action is triggered only when ‘b’ is found: a-or-b: 'a'|'b' { a_or_b_found = 1; }; - If you don’t specify an action for a rule, Bison supplies a default: + If you don't specify an action for a rule, Bison supplies a default: ‘$$ = $1’. Thus, the value of the first symbol in the rule becomes the value of the whole rule. Of course, the default action is valid only if the two data types match. There is no meaningful default action for an empty rule; every empty rule must have an explicit action unless the -rule’s value does not matter. +rule's value does not matter. ‘$N’ with N zero or negative is allowed for reference to tokens and groupings on the stack _before_ those that match the current rule. This @@ -4384,7 +4383,7 @@ readability and maintainability (*note Named References::): After the embedded statement is parsed, its semantic value becomes the value of the entire ‘let’-statement. Then the semantic value from the earlier action is used to restore the prior list of variables. This -removes the temporary ‘let’-variable from the list so that it won’t +removes the temporary ‘let’-variable from the list so that it won't appear to exist while the rest of the program is parsed. Because the types of the semantic values of midrule actions are @@ -4410,7 +4409,7 @@ without restoring it. Thus, ‘$5’ needs a destructor (*note Destructor Decl::), and Bison needs the type of the semantic value (‘context’) to select the right destructor. - As an extension to Yacc’s midrule actions, Bison offers a means to + As an extension to Yacc's midrule actions, Bison offers a means to type their semantic value: specify its type tag (‘<...>’ before the midrule action. @@ -4522,7 +4521,6 @@ a destructor for that symbol: declare_variable ($var); }; -  File: bison.info, Node: Midrule Conflicts, Prev: Midrule Action Translation, Up: Midrule Actions @@ -4733,7 +4731,7 @@ File: bison.info, Node: Printing Locations, Next: Location Default Action, Pr ------------------------ When using the default location type, the debug traces report the -symbols’ location. The generated parser does so using the +symbols' location. The generated parser does so using the ‘YYLOCATION_PRINT’ macro. -- Macro: YYLOCATION_PRINT (FILE, LOC); @@ -4757,7 +4755,7 @@ locations are much more general than semantic values, there is room in the output parser to redefine the default action to take for each rule. The ‘YYLLOC_DEFAULT’ macro is invoked each time a rule is matched, before the associated action is run. It is also invoked while -processing a syntax error, to compute the error’s location. Before +processing a syntax error, to compute the error's location. Before reporting an unresolvable syntactic ambiguity, a GLR parser invokes ‘YYLLOC_DEFAULT’ recursively to compute the location of that ambiguity. @@ -4768,7 +4766,7 @@ dedicated code from semantic actions. the location of the grouping (the result of the computation). When a rule is matched, the second parameter identifies locations of all right hand side elements of the rule being matched, and the third parameter is -the size of the rule’s right hand side. When a GLR parser reports an +the size of the rule's right hand side. When a GLR parser reports an ambiguity, which of multiple candidate right hand sides it passes to ‘YYLLOC_DEFAULT’ is undefined. When processing a syntax error, the second parameter identifies locations of the symbols that were discarded @@ -4863,7 +4861,6 @@ closing brace of the midrule action code: exp[res]: exp[x] '+' {$left = $x;}[left] exp[right] { $res = $left + $right; } - In references, in order to specify names containing dots and dashes, an explicit bracketed syntax ‘$[name]’ and ‘@[name]’ must be used: if-stmt: "if" '(' expr ')' "then" then.stmt ';' @@ -4911,7 +4908,7 @@ must declare it explicitly (*note Language and Grammar::). * Pure Decl:: Requesting a reentrant parser. * Push Decl:: Requesting a push parser. * Decl Summary:: Table of all Bison declarations. -* %define Summary:: Defining variables to adjust Bison’s behavior. +* %define Summary:: Defining variables to adjust Bison's behavior. * %code Summary:: Inserting code into the parser source.  @@ -4944,7 +4941,7 @@ follows: Bison will convert this into a definition in the parser, so that the function ‘yylex’ (if it is in this file) can use the name NAME to stand -for this token kind’s code. +for this token kind's code. Alternatively, you can use ‘%left’, ‘%right’, ‘%precedence’, or ‘%nonassoc’ instead of ‘%token’, if you wish to specify associativity @@ -4960,7 +4957,7 @@ field immediately following the token name: %token XNUM 0x12d // a GNU extension It is generally best, however, to let Bison choose the numeric codes for -all token kinds. Bison will automatically select codes that don’t +all token kinds. Bison will automatically select codes that don't conflict with each other or with normal characters. In the event that the stack type is a union, you must augment the @@ -5124,7 +5121,7 @@ code. -- Directive: %initial-action { CODE } Declare that the braced CODE must be invoked before parsing each time ‘yyparse’ is called. The CODE may use ‘$$’ (or ‘$$’) and - ‘@$’ — initial value and location of the lookahead — and the + ‘@$’ -- initial value and location of the lookahead -- and the ‘%parse-param’. For instance, if your locations use a file name, you may use @@ -5221,7 +5218,7 @@ the end token (token 0) if you redefine it from ‘$end’ to, for example, Finally, Bison will never invoke a ‘%destructor’ for an unreferenced midrule semantic value (*note Midrule Actions::). That is, Bison does not consider a midrule to have a semantic value if you do not reference -‘$$’ in the midrule’s action or ‘$N’ (where N is the right-hand side +‘$$’ in the midrule's action or ‘$N’ (where N is the right-hand side symbol position of the midrule) in any later action in that rule. However, if you do reference either, the Bison-generated parser will invoke the ‘<>’ ‘%destructor’ whenever it discards the midrule symbol. @@ -5354,7 +5351,7 @@ document this fact with an ‘%expect’ modifier as follows: Mid-rule actions generate implicit rules that are also subject to conflicts (*note Midrule Conflicts::). To attach an ‘%expect’ or -‘%expect-rr’ annotation to an implicit mid-rule action’s rule, put it +‘%expect-rr’ annotation to an implicit mid-rule action's rule, put it before the action. For example, %glr-parser @@ -5377,7 +5374,7 @@ other, and we should expect one reduce/reduce conflict for each. a verbose list of where the conflicts occur. Bison will also print the number of conflicts. - • Check each of the conflicts to make sure that Bison’s default + • Check each of the conflicts to make sure that Bison's default resolution is what you really want. If not, rewrite the grammar and go back to the beginning. @@ -5457,7 +5454,7 @@ completely parsed. A push parser, on the other hand, is called each time a new token is made available. A push parser is typically useful when the parser is part of a main -event loop in the client’s application. This is typically a requirement +event loop in the client's application. This is typically a requirement of a GUI, when the main event loop needs to be triggered within a certain time period. @@ -5484,7 +5481,7 @@ parser at a time. When a push parser is selected, Bison will generate some new symbols in the generated parser. ‘yypstate’ is a structure that the generated -parser uses to store the parser’s state. ‘yypstate_new’ is the function +parser uses to store the parser's state. ‘yypstate_new’ is the function that will create a new parser instance. ‘yypstate_delete’ will free the resources associated with the corresponding parser instance. Finally, ‘yypush_parse’ is the function that should be called whenever a token is @@ -5514,7 +5511,7 @@ would thus look like this: } while (status == YYPUSH_MORE); yypstate_delete (ps); - That’s it. Notice the next token is put into the global variable + That's it. Notice the next token is put into the global variable ‘yychar’ for use by the next invocation of the ‘yypush_parse’ function. Bison also supports both the push parser interface along with the @@ -5581,7 +5578,7 @@ Here is a summary of the declarations used to define a grammar: Decl::). -- Directive: %start - Specify the grammar’s start symbol (*note Start Decl::). + Specify the grammar's start symbol (*note Start Decl::). -- Directive: %expect Declare the expected number of shift/reduce conflicts, either @@ -5609,7 +5606,7 @@ directives: -- Directive: %define VARIABLE VALUE -- Directive: %define VARIABLE {VALUE} -- Directive: %define VARIABLE "VALUE" - Define a variable to adjust Bison’s behavior. *Note %define + Define a variable to adjust Bison's behavior. *Note %define Summary::. -- Directive: %defines @@ -5703,7 +5700,7 @@ directives: ‘yytoken_kind_t’, ‘YYSTYPE’, ‘YYLTYPE’. -- Directive: %no-lines - Don’t generate any ‘#line’ preprocessor commands in the parser + Don't generate any ‘#line’ preprocessor commands in the parser implementation file. Ordinarily Bison writes these commands in the parser implementation file so that the C compiler and debuggers will associate errors and object code with your source file (the @@ -5762,7 +5759,7 @@ directives: ‘YYNSTATES’ The number of parser states (*note Parser States::). - Here’s code for looking up a multicharacter token in ‘yytname’, + Here's code for looking up a multicharacter token in ‘yytname’, assuming that the characters of the token are stored in ‘token_buffer’, and assuming that the token does not contain any characters like ‘"’ that require escaping. @@ -5804,7 +5801,7 @@ File: bison.info, Node: %define Summary, Next: %code Summary, Prev: Decl Summ 3.7.14 %define Summary ---------------------- -There are many features of Bison’s behavior that can be controlled by +There are many features of Bison's behavior that can be controlled by assigning the feature a single value. For historical reasons, some such features are assigned values by dedicated directives, such as ‘%start’, which assigns the start symbol. However, newer such features are @@ -5853,7 +5850,7 @@ described below. • Language(s): C++ - • Purpose: Define the type of file names in Bison’s default + • Purpose: Define the type of file names in Bison's default location and position types. *Note Exposing the Location Classes::. @@ -5892,7 +5889,7 @@ described below. Using ‘api.header.include’ does not change the name of the generated header, only how it is included. - To work around limitations of Automake’s ‘ylwrap’ (which runs + To work around limitations of Automake's ‘ylwrap’ (which runs ‘bison’ with ‘--yacc’), ‘api.header.include’ is _not_ predefined when the output file is ‘y.tab.c’. Define it to avoid the duplication. @@ -5913,7 +5910,7 @@ described below. • Language(s): C++ - • Purpose: Define the name of the file in which Bison’s default + • Purpose: Define the name of the file in which Bison's default location and position types are generated. *Note Exposing the Location Classes::. @@ -5930,7 +5927,7 @@ described below. • Default Value: Not applicable if locations are not enabled, or if a user location type is specified (see - ‘api.location.type’). Otherwise, Bison’s ‘location’ is + ‘api.location.type’). Otherwise, Bison's ‘location’ is generated in ‘location.hh’ (*note C++ location::). • History: Introduced in Bison 3.2. @@ -6103,7 +6100,7 @@ described below. • Accepted Values: Any non empty string. Must be a valid identifier in the target language (typically a non empty - sequence of letters, underscores, and —not at the beginning— + sequence of letters, underscores, and --not at the beginning-- digits). The empty prefix is (generally) invalid: @@ -6163,7 +6160,7 @@ described below. • Accepted Values: Any string. Must be a valid identifier prefix in the target language (typically, a possibly empty - sequence of letters, underscores, and —not at the beginning— + sequence of letters, underscores, and --not at the beginning-- digits). • Default Value: empty @@ -6250,7 +6247,7 @@ described below. properly supported yet. ‘union-directive’ (C, C++, D) The type is defined thanks to the ‘%union’ directive. - You don’t have to define ‘api.value.type’ in that case, + You don't have to define ‘api.value.type’ in that case, using ‘%union’ suffices. *Note Union Decl::. For instance: %define api.value.type union-directive @@ -6373,7 +6370,7 @@ described below. In C++, when variants are used (*note C++ Variants::), symbols must be constructed and destroyed properly. This option checks these constraints using runtime type information - (RTTI). Therefore the generated code cannot be compiled with + (RTTI). Therefore the generated code cannot be compiled with RTTI disabled (via compiler options such as ‘-fno-rtti’). • Accepted Values: Boolean @@ -6487,9 +6484,9 @@ qualifiers produce an error. Some of the accepted qualifiers are: • Purpose: This is the best place to write dependency code required for the value and location types (‘YYSTYPE’ and - ‘YYLTYPE’ in C). In other words, it’s the best place to define + ‘YYLTYPE’ in C). In other words, it's the best place to define types referenced in ‘%union’ directives. In C, if you use - ‘#define’ to override Bison’s default ‘YYSTYPE’ and ‘YYLTYPE’ + ‘#define’ to override Bison's default ‘YYSTYPE’ and ‘YYLTYPE’ definitions, then it is also the best place. However you should rather ‘%define’ ‘api.value.type’ and ‘api.location.type’. @@ -6571,7 +6568,7 @@ by PREFIX (i.e., PREFIX upper-cased) instead of ‘YY’. ‘yylval’, ‘yylloc’, ‘yychar’ and ‘yydebug’. If you use a push parser, ‘yypush_parse’, ‘yypull_parse’, ‘yypstate’, ‘yypstate_new’ and ‘yypstate_delete’ will also be renamed. The renamed macros include -‘YYSTYPE’, ‘YYLTYPE’, and ‘YYDEBUG’, which is treated specifically — +‘YYSTYPE’, ‘YYLTYPE’, and ‘YYDEBUG’, which is treated specifically -- more about this below. For example, if you use ‘%define api.prefix {c}’, the names become @@ -6609,7 +6606,7 @@ beginning of the parser implementation file, defining ‘yyparse’ as int yyparse (void); This effectively substitutes one name for the other in the entire -parser implementation file, thus the “original” names (‘yylex’, +parser implementation file, thus the "original" names (‘yylex’, ‘YYSTYPE’, ...) are also usable in the parser implementation file. However, in the parser header file, the symbols are defined renamed, @@ -6667,7 +6664,7 @@ grammar file, you are likely to run into trouble. which reads tokens. * Error Reporting:: Passing error messages to the user. * Action Features:: Special features for use in actions. -* Internationalization:: How to let the parser speak in the user’s +* Internationalization:: How to let the parser speak in the user's native language.  @@ -6714,7 +6711,7 @@ declaration ‘%parse-param’: declaring functions or prototypes. The last identifier in ARGUMENT-DECLARATION must be the argument name. - Here’s an example. Write this in the parser: + Here's an example. Write this in the parser: %parse-param {int *nastiness} {int *randomness} @@ -6903,7 +6900,7 @@ that there is nothing left afterwards. *Note Calling Convention::, for an example. Returning ‘YYUNDEF’ tells the parser that some lexical error was -found. It will emit an error message about an “invalid token”, and +found. It will emit an error message about an "invalid token", and enter error-recovery (*note Error Recovery::). Returning an unknown token kind results in the exact same behavior. @@ -6974,9 +6971,9 @@ if the type is ‘int’ (the default), you might write this in ‘yylex’: return INT; /* Return the kind of the token. */ ... - When you are using multiple data types, ‘yylval’’s type is a union + When you are using multiple data types, ‘yylval’'s type is a union made from the ‘%union’ declaration (*note Union Decl::). So when you -store a token’s value, you must use the proper member of the union. If +store a token's value, you must use the proper member of the union. If the ‘%union’ declaration looks like this: %union { @@ -7117,7 +7114,7 @@ incorrect information if LAC is not enabled (*note LAC::). The parser can detect one other kind of error: memory exhaustion. This can happen when the input contains constructions that are very -deeply nested. It isn’t likely you will encounter this, since the Bison +deeply nested. It isn't likely you will encounter this, since the Bison parser normally extends its stack automatically up to a very large limit. But if memory is exhausted, ‘yyparse’ calls ‘yyerror’ in the usual fashion, except that the argument string is ‘"memory exhausted"’. @@ -7175,9 +7172,9 @@ then the parser no longer passes syntax error messages to ‘yyerror’, rather it delegates that task to the user by calling the ‘yyreport_syntax_error’ function. - The following functions and types are “‘static’”: they are defined in + The following functions and types are "‘static’": they are defined in the implementation file (‘*.c’) and available only from there. They are -meant to be used from the grammar’s epilogue. +meant to be used from the grammar's epilogue. -- Function: static int yyreport_syntax_error (const yypcontext_t *CTX) Report a syntax error to the user. Return 0 on success, ‘YYENOMEM’ @@ -7211,7 +7208,7 @@ meant to be used from the grammar’s epilogue. -- Function: static yysymbol_kind_t yypcontext_token (const yypcontext_t *CTX) - The “unexpected” token: the symbol kind of the lookahead token that + The "unexpected" token: the symbol kind of the lookahead token that caused the syntax error. Returns ‘YYSYMBOL_YYEMPTY’ if there is no lookahead. @@ -7392,12 +7389,12 @@ File: bison.info, Node: Internationalization, Prev: Action Features, Up: Inte A Bison-generated parser can print diagnostics, including error and tracing messages. By default, they appear in English. However, Bison -also supports outputting diagnostics in the user’s native language. To +also supports outputting diagnostics in the user's native language. To make this work, the user should set the usual environment variables. -*Note The User’s View: (gettext)Users. For example, the shell command -‘export LC_ALL=fr_CA.UTF-8’ might set the user’s locale to French +*Note The User's View: (gettext)Users. For example, the shell command +‘export LC_ALL=fr_CA.UTF-8’ might set the user's locale to French Canadian using the UTF-8 encoding. The exact set of available locales -depends on the user’s installation. +depends on the user's installation. * Menu: @@ -7411,13 +7408,13 @@ File: bison.info, Node: Enabling I18n, Next: Token I18n, Up: Internationaliza ----------------------------------- The maintainer of a package that uses a Bison-generated parser enables -the internationalization of the parser’s output through the following +the internationalization of the parser's output through the following steps. Here we assume a package that uses GNU Autoconf and GNU Automake. 1. Into the directory containing the GNU Autoconf macros used by the - package —often called ‘m4’— copy the ‘bison-i18n.m4’ file installed - by Bison under ‘share/aclocal/bison-i18n.m4’ in Bison’s + package --often called ‘m4’-- copy the ‘bison-i18n.m4’ file + installed by Bison under ‘share/aclocal/bison-i18n.m4’ in Bison's installation directory. For example: cp /usr/local/share/aclocal/bison-i18n.m4 m4/bison-i18n.m4 @@ -7430,7 +7427,7 @@ Automake. to enable translations in the Bison-generated parser. 3. In the ‘main’ function of your program, designate the directory - containing Bison’s runtime message catalog, through a call to + containing Bison's runtime message catalog, through a call to ‘bindtextdomain’ with domain name ‘bison-runtime’. For example: bindtextdomain ("bison-runtime", BISON_LOCALEDIR); @@ -7478,17 +7475,17 @@ internationalization marker (‘_("function")’). parser will use both ‘N_’ and ‘_’, that must be defined (*note The Programmer’s View: (gettext)Programmers.). They are used only on string aliases marked for translation. In other words, even if your catalog -features a translation for “function”, then with +features a translation for "function", then with %token FUN "function" VAR _("variable") -“function” will appear untranslated in debug traces and error messages. +"function" will appear untranslated in debug traces and error messages. Unless defined by the user, the end-of-file token, ‘YYEOF’, is -provided “end of file” as an alias. It is also internationalized if the +provided "end of file" as an alias. It is also internationalized if the user internationalized tokens. To map it to another string, use: %token END 0 _("end of input") @@ -7512,11 +7509,11 @@ When the last N tokens and groupings shifted match the components of a grammar rule, they can be combined according to that rule. This is called “reduction”. Those tokens and groupings are replaced on the stack by a single grouping whose symbol is the result (left hand side) -of that rule. Running the rule’s action is part of the process of +of that rule. Running the rule's action is part of the process of reduction, because this is what computes the semantic value of the resulting grouping. - For example, if the infix calculator’s parser stack contains this: + For example, if the infix calculator's parser stack contains this: 1 + 5 * 3 @@ -7533,7 +7530,7 @@ At this point, another reduction can be made, resulting in the single value 16. Then the newline token can be shifted. The parser tries, by shifts and reductions, to reduce the entire -input down to a single grouping whose symbol is the grammar’s +input down to a single grouping whose symbol is the grammar's start-symbol (*note Language and Grammar::). This kind of parser is known in the literature as a bottom-up parser. @@ -7543,7 +7540,7 @@ start-symbol (*note Language and Grammar::). * Lookahead:: Parser looks one token ahead when deciding what to do. * Shift/Reduce:: Conflicts: when either shifting or reduction is valid. * Precedence:: Operator precedence works by resolving conflicts. -* Contextual Precedence:: When an operator’s precedence depends on context. +* Contextual Precedence:: When an operator's precedence depends on context. * Parser States:: The parser is a finite-state-machine with stack. * Reduce/Reduce:: When two rules are applicable in the same situation. * Mysterious Conflicts:: Conflicts that look unjustified. @@ -7560,7 +7557,7 @@ File: bison.info, Node: Lookahead, Next: Shift/Reduce, Up: Algorithm The Bison parser does _not_ always reduce immediately as soon as the last N tokens and groupings match a rule. This is because such a simple strategy is inadequate to handle most languages. Instead, when a -reduction is possible, the parser sometimes “looks ahead” at the next +reduction is possible, the parser sometimes "looks ahead" at the next token in order to decide what to do. When a token is read, it is not immediately shifted; first it becomes @@ -7630,7 +7627,7 @@ rule. This situation, where either a shift or a reduction would be valid, is called a “shift/reduce conflict”. Bison is designed to resolve these conflicts by choosing to shift, unless otherwise directed by operator -precedence declarations. To see the reason for this, let’s contrast it +precedence declarations. To see the reason for this, let's contrast it with the other alternative. Since the parser prefers to shift the ‘"else"’, the result is to @@ -7657,10 +7654,10 @@ Bison accomplishes by choosing to shift rather than reduce. (It would ideally be cleaner to write an unambiguous grammar, but that is very hard to do in this case.) This particular ambiguity was first encountered in the specifications of Algol 60 and is called the -“dangling ‘else’” ambiguity. +"dangling ‘else’" ambiguity. To assist the grammar author in understanding the nature of each -conflict, Bison can be asked to generate “counterexamples”. In the +conflict, Bison can be asked to generate "counterexamples". In the present case it actually even proves that the grammar is ambiguous by exhibiting a string with two different parses: @@ -7684,7 +7681,7 @@ exhibiting a string with two different parses: shift/reduce conflicts, you can use the ‘%expect N’ declaration. There will be no warning as long as the number of shift/reduce conflicts is exactly N, and Bison will report an error if there is a different -number. *Note Expect Decl::. However, we don’t recommend the use of +number. *Note Expect Decl::. However, we don't recommend the use of ‘%expect’ (except ‘%expect 0’!), as an equal number of conflicts does not mean that they are the _same_. When possible, you should rather use precedence directives to _fix_ the conflicts explicitly (*note Non @@ -7784,7 +7781,7 @@ list of tokens, which are operators whose precedence and associativity is being declared. The ‘%left’ declaration makes all those operators left-associative and the ‘%right’ declaration makes them right-associative. A third alternative is ‘%nonassoc’, which declares -that it is a syntax error to find the same operator twice “in a row”. +that it is a syntax error to find the same operator twice "in a row". The last alternative, ‘%precedence’, allows to define only precedence and no associativity at all. As a result, any associativity-related conflict that remains will be reported as an compile-time error. The @@ -7873,8 +7870,8 @@ Precedence::.) Finally, the resolution of conflicts works by comparing the precedence of the rule being considered with that of the lookahead -token. If the token’s precedence is higher, the choice is to shift. If -the rule’s precedence is higher, the choice is to reduce. If they have +token. If the token's precedence is higher, the choice is to shift. If +the rule's precedence is higher, the choice is to reduce. If they have equal precedence, the choice is made based on the associativity of that precedence level. The verbose output file made by ‘-v’ (*note Invocation::) says how each conflict was resolved. @@ -7890,7 +7887,7 @@ File: bison.info, Node: Non Operators, Prev: How Precedence, Up: Precedence Using properly precedence and associativity directives can help fixing shift/reduce conflicts that do not involve arithmetic-like operators. -For instance, the “dangling ‘else’” problem (*note Shift/Reduce::) can +For instance, the "dangling ‘else’" problem (*note Shift/Reduce::) can be solved elegantly in two different ways. In the present case, the conflict is between the token ‘"else"’ @@ -7910,12 +7907,12 @@ action, use right associativity: %right "then" "else" Neither solution is perfect however. Since Bison does not provide, -so far, “scoped” precedence, both force you to declare the precedence of +so far, "scoped" precedence, both force you to declare the precedence of these keywords with respect to the other operators your grammar. Therefore, instead of being warned about new conflicts you would be unaware of (e.g., a shift/reduce conflict due to ‘if test then 1 else 2 + 3’ being ambiguous: ‘if test then 1 else (2 + 3)’ or ‘(if test then 1 -else 2) + 3’?), the conflict will be already “fixed”. +else 2) + 3’?), the conflict will be already "fixed".  File: bison.info, Node: Contextual Precedence, Next: Parser States, Prev: Precedence, Up: Algorithm @@ -7936,8 +7933,8 @@ the ‘%prec’ modifier for rules. The ‘%prec’ modifier declares the precedence of a particular rule by specifying a terminal symbol whose precedence should be used for that -rule. It’s not necessary for that symbol to appear otherwise in the -rule. The modifier’s syntax is: +rule. It's not necessary for that symbol to appear otherwise in the +rule. The modifier's syntax is: %prec TERMINAL-SYMBOL @@ -7980,9 +7977,9 @@ do next. Each time a lookahead token is read, the current parser state together with the kind of lookahead token are looked up in a table. -This table entry can say, “Shift the lookahead token.” In this case, it +This table entry can say, "Shift the lookahead token." In this case, it also specifies the new parser state, which is pushed onto the top of the -parser stack. Or it can say, “Reduce using rule number N.” This means +parser stack. Or it can say, "Reduce using rule number N." This means that a certain number of tokens or groupings are taken off the top of the stack, and replaced by one grouping. In other words, that number of states are popped from the stack, and one new state is pushed. @@ -8030,8 +8027,8 @@ via ‘maybeword’ and then the second rule. You might think that this is a distinction without a difference, because it does not change whether any particular input is valid or not. But it does affect which actions are run. One parsing order runs the -second rule’s action; the other runs the first rule’s action and the -third rule’s action. In this example, the output of the program +second rule's action; the other runs the first rule's action and the +third rule's action. In this example, the output of the program changes. Bison resolves a reduce/reduce conflict by choosing to use the rule @@ -8147,7 +8144,7 @@ File: bison.info, Node: Mysterious Conflicts, Next: Tuning LR, Prev: Reduce/R 5.7 Mysterious Conflicts ======================== -Sometimes reduce/reduce conflicts can occur that don’t look warranted. +Sometimes reduce/reduce conflicts can occur that don't look warranted. Here is an example: %% @@ -8182,7 +8179,7 @@ default_, for historical reasons. In this grammar, two contexts, that after an ‘"id"’ at the beginning of a ‘param_spec’ and likewise at the beginning of a ‘return_spec’, are similar enough that Bison assumes they are the same. They appear similar because the same set of rules would -be active—the rule for reducing to a ‘name’ and that for reducing to a +be active--the rule for reducing to a ‘name’ and that for reducing to a ‘type’. Bison is unable to determine at that stage of processing that the rules would require different lookahead tokens in the two contexts, so it makes a single parser state for them both. Combining the two @@ -8197,7 +8194,7 @@ algorithm. Either IELR(1) or canonical LR(1) would suffice, but the former is more efficient and easier to debug during development. *Note LR Table Construction::, for details. - If you instead wish to work around LALR(1)’s limitations, you can + If you instead wish to work around LALR(1)'s limitations, you can often fix a mysterious conflict by identifying the two parser states that are being confused, and adding something to make them look distinct. In the above example, adding one rule to ‘return_spec’ as @@ -8243,11 +8240,11 @@ File: bison.info, Node: Tuning LR, Next: Generalized LR Parsing, Prev: Myster 5.8 Tuning LR ============= -The default behavior of Bison’s LR-based parsers is chosen mostly for +The default behavior of Bison's LR-based parsers is chosen mostly for historical reasons, but that behavior is often not robust. For example, in the previous section, we discussed the mysterious conflicts that can -be produced by LALR(1), Bison’s default parser table construction -algorithm. Another example is Bison’s ‘%define parse.error verbose’ +be produced by LALR(1), Bison's default parser table construction +algorithm. Another example is Bison's ‘%define parse.error verbose’ directive, which instructs the generated parser to produce verbose syntax error messages, which can sometimes contain incorrect information. @@ -8310,7 +8307,7 @@ use IELR will result in unnecessarily large parser tables. That is, IELR generates LALR tables when LALR (using a deterministic parsing algorithm) is sufficient to support the full language-recognition power of LR. Thus, by enabling IELR at the start of grammar development, you -can safely and completely eliminate the need to consider LALR’s +can safely and completely eliminate the need to consider LALR's shortcomings. While IELR is almost always preferable, there are circumstances where @@ -8335,7 +8332,7 @@ each parser table construction algorithm within Bison: to resolve conflicts statically, GLR behaves more like a deterministic parser in the syntactic contexts where those conflicts appear, and so either IELR or canonical LR can then - be helpful to avoid LALR’s mysterious behavior. + be helpful to avoid LALR's mysterious behavior. • Malformed grammars. @@ -8354,7 +8351,7 @@ each parser table construction algorithm within Bison: sentences. However, like LALR, IELR merges parser states during parser table construction so that the number of parser states is often an order of magnitude less than for canonical LR. More - importantly, because canonical LR’s extra parser states may contain + importantly, because canonical LR's extra parser states may contain duplicate conflicts in the case of non-LR grammars, the number of conflicts for IELR is often an order of magnitude less as well. This effect can significantly reduce the complexity of developing a @@ -8533,7 +8530,7 @@ enable default reductions in consistent states, canonical LR and IELR behave almost exactly the same for both syntactically acceptable and syntactically unacceptable input. While LALR still does not support the full language-recognition power of canonical LR and IELR, LAC at least -enables LALR’s syntax error handling to correctly reflect LALR’s +enables LALR's syntax error handling to correctly reflect LALR's language-recognition power. There are a few caveats to consider when using LAC: @@ -8564,7 +8561,7 @@ language-recognition power. reductions in consistent states and shift actions, the parser never has to initiate an exploratory parse. Moreover, the most time-consuming tasks in a parse are often the file I/O, the lexical - analysis performed by the scanner, and the user’s semantic actions, + analysis performed by the scanner, and the user's semantic actions, but none of these are performed during the exploratory parse. Finally, the base of the temporary stack used during an exploratory parse is a pointer into the normal parser state stack so that the @@ -8582,7 +8579,7 @@ File: bison.info, Node: Unreachable States, Prev: LAC, Up: Tuning LR 5.8.4 Unreachable States ------------------------ -If there exists no sequence of transitions from the parser’s start state +If there exists no sequence of transitions from the parser's start state to some state S, then Bison considers S to be an “unreachable state”. A state can become unreachable during conflict resolution if Bison disables a shift action leading to it from a predecessor state. @@ -8602,7 +8599,7 @@ understand the relationship between the parser and the grammar. Unreachable states may contain conflicts and may use rules not used in any other state. Thus, keeping unreachable states may induce - warnings that are irrelevant to your parser’s behavior, and it may + warnings that are irrelevant to your parser's behavior, and it may eliminate warnings that are relevant. Of course, the change in warnings may actually be relevant to a parser table analysis that wants to keep unreachable states, so this behavior will likely @@ -8635,7 +8632,7 @@ The same is true of languages that require more than one symbol of lookahead, since the parser lacks the information necessary to make a decision at the point it must be made in a shift/reduce parser. Finally, as previously mentioned (*note Mysterious Conflicts::), there -are languages where Bison’s default choice of how to summarize the input +are languages where Bison's default choice of how to summarize the input seen so far loses necessary information. When you use the ‘%glr-parser’ declaration in your grammar file, @@ -8685,7 +8682,7 @@ length of the input times the maximum number of stacks required for any prefix of the input. Thus, really ambiguous or nondeterministic grammars can require exponential time and space to process. Such badly behaving examples, however, are not generally of practical interest. -Usually, nondeterminism in a grammar is local—the parser is “in doubt” +Usually, nondeterminism in a grammar is local--the parser is "in doubt" only for a few tokens at a time. Therefore, the current data structure should generally be adequate. On LR(1) portions of a grammar, in particular, it is only slightly slower than with the deterministic LR(1) @@ -8837,14 +8834,14 @@ shifted will error messages resume. as any other rules can. You can make error messages resume immediately by using the macro -‘yyerrok’ in an action. If you do this in the error rule’s action, no +‘yyerrok’ in an action. If you do this in the error rule's action, no error messages will be suppressed. This macro requires no arguments; ‘yyerrok;’ is a valid C statement. The previous lookahead token is reanalyzed immediately after an error. If this is unacceptable, then the macro ‘yyclearin’ may be used to clear this token. Write the statement ‘yyclearin;’ in the error -rule’s action. *Note Action Features::. +rule's action. *Note Action Features::. For example, suppose that on a syntax error, an error handling routine is called that advances the input stream to some point where @@ -8875,7 +8872,7 @@ for such languages. * Tie-in Recovery:: Lexical tie-ins have implications for how error recovery rules must be written. - (Actually, “kludge” means any technique that gets its job done but is + (Actually, "kludge" means any technique that gets its job done but is neither clean nor robust.)  @@ -8904,7 +8901,7 @@ choice of token kind to recognize. ‘IDENTIFIER’ is accepted as an expression, but ‘TYPENAME’ is not. ‘TYPENAME’ can start a declaration, but ‘IDENTIFIER’ cannot. In contexts where the meaning of the identifier is _not_ significant, such as in declarations that can shadow -a typedef name, either ‘TYPENAME’ or ‘IDENTIFIER’ is accepted—there is +a typedef name, either ‘TYPENAME’ or ‘IDENTIFIER’ is accepted--there is one rule for each of the two token kinds. This technique is simple to use if the decision of which kinds of @@ -8922,13 +8919,13 @@ earlier: } Unfortunately, the name being declared is separated from the -declaration construct itself by a complicated syntactic structure—the -“declarator”. +declaration construct itself by a complicated syntactic structure--the +"declarator". As a result, part of the Bison parser for C needs to be duplicated, with all the nonterminal names changed: once for parsing a declaration in which a typedef name can be redefined, and once for parsing a -declaration in which that can’t be done. Here is a part of the +declaration in which that can't be done. Here is a part of the duplication, with actions omitted for brevity: initdcl: @@ -9050,7 +9047,7 @@ way you can write the action to determine whether a ‘hex’ construct is being aborted or not. So if you are using a lexical tie-in, you had better make sure your error recovery rules are not of this kind. Each rule must be such that you can be sure that it always will, or always -won’t, have to clear the flag. +won't, have to clear the flag.  File: bison.info, Node: Debugging, Next: Invocation, Prev: Context Dependency, Up: Top @@ -9058,7 +9055,7 @@ File: bison.info, Node: Debugging, Next: Invocation, Prev: Context Dependency 8 Debugging Your Parser *********************** -Developing a parser can be a challenge, especially if you don’t +Developing a parser can be a challenge, especially if you don't understand the algorithm (*note Algorithm::). This chapter explains how to understand and debug a parser. @@ -9118,7 +9115,7 @@ features one shift/reduce conflict: else.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] else.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples -Let’s rerun ‘bison’ with the option ‘-Wcex’/‘-Wcounterexamples’(the +Let's rerun ‘bison’ with the option ‘-Wcex’/‘-Wcounterexamples’(the following output is actually in color): else.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] @@ -9205,7 +9202,7 @@ shows that the grammar accepts the empty input in two different ways. two ways. In these cases, counterexample generation will provide two examples that are the same up until the dot. Most notably, this will happen when your grammar requires a stronger parser (more lookahead, LR -instead of LALR). The following example isn’t LR(1): +instead of LALR). The following example isn't LR(1): %token ID %% @@ -9309,7 +9306,7 @@ might vary, but the interpretation is the same. The first section reports useless tokens, nonterminals and rules. Useless nonterminals and rules are removed in order to produce a smaller parser, but useless tokens are preserved, since they might be used by -the scanner (note the difference between “useless” and “unused” below): +the scanner (note the difference between "useless" and "unused" below): Nonterminals useless in grammar useless @@ -9373,14 +9370,14 @@ input cursor. exp go to state 2 - This reads as follows: “state 0 corresponds to being at the very + This reads as follows: "state 0 corresponds to being at the very beginning of the parsing, in the initial rule, right before the start symbol (here, ‘exp’). When the parser returns to this state right after having reduced a rule that produced an ‘exp’, the control flow jumps to state 2. If there is no such transition on a nonterminal symbol, and the lookahead is a ‘NUM’, then this token is shifted onto the parse stack, and the control flow jumps to state 1. Any other lookahead -triggers a syntax error.” +triggers a syntax error." Even though the only active rule in state 0 seems to be rule 0, the report lists ‘NUM’ as a lookahead token because ‘NUM’ can be at the @@ -9749,7 +9746,7 @@ distinguished by a red filling color on these nodes, just like how they are reported between square brackets in the verbose file. The reduction corresponding to the rule number 0 is the acceptation -state. It is shown as a blue diamond, labeled “Acc”. +state. It is shown as a blue diamond, labeled "Acc". Graphical Representation of Gotos --------------------------------- @@ -9802,7 +9799,7 @@ File: bison.info, Node: Tracing, Prev: Xml, Up: Debugging 8.5 Tracing Your Parser ======================= -When a Bison grammar compiles properly but parses “incorrectly”, the +When a Bison grammar compiles properly but parses "incorrectly", the ‘yydebug’ parser-trace feature helps figuring out why. * Menu: @@ -9890,7 +9887,7 @@ arrive at the place where something undesirable happens, and you will see which parts of the grammar are to blame. The parser implementation file is a C/C++/D/Java program and you can -use debuggers on it, but it’s not easy to interpret what it is doing. +use debuggers on it, but it's not easy to interpret what it is doing. The parser function is a finite-state machine interpreter, and aside from the actions it executes the same code over and over. Only the values of variables show where in the grammar it is working. @@ -9923,7 +9920,7 @@ its prologue: The ‘%define’ directive instructs Bison to generate run-time trace support. Then, activation of these traces is controlled at run-time by the ‘yydebug’ variable, which is disabled by default. Because these -traces will refer to the “states” of the parser, it is helpful to ask +traces will refer to the "states" of the parser, it is helpful to ask for the creation of a description of that parser; this is the purpose of (admittedly ill-named) ‘%verbose’ directive. @@ -10059,10 +10056,10 @@ The usual way to invoke Bison is as follows: $ bison FILE Here FILE is the grammar file name, which usually ends in ‘.y’. The -parser implementation file’s name is made by replacing the ‘.y’ with +parser implementation file's name is made by replacing the ‘.y’ with ‘.tab.c’ and removing any leading directory. Thus, the ‘bison foo.y’ file name yields ‘foo.tab.c’, and the ‘bison hack/foo.y’ file name -yields ‘foo.tab.c’. It’s also possible, in case you are writing C++ +yields ‘foo.tab.c’. It's also possible, in case you are writing C++ code instead of C in your grammar file, to name it ‘foo.ypp’ or ‘foo.y++’. Then, the output files will take an extension like the given one as input (respectively ‘foo.tab.cpp’ and ‘foo.tab.c++’). This @@ -10183,8 +10180,8 @@ Options controlling the global behavior of ‘bison’. Activate miscellaneous FEATUREs. FEATURE can be one of: ‘caret’ ‘diagnostics-show-caret’ - Show caret errors, in a manner similar to GCC’s - ‘-fdiagnostics-show-caret’, or Clang’s ‘-fcaret-diagnostics’. + Show caret errors, in a manner similar to GCC's + ‘-fdiagnostics-show-caret’, or Clang's ‘-fcaret-diagnostics’. The location provided with the message is used to quote the corresponding line of the source file, underlining the important part of it with carets (‘^’). Here is an example, @@ -10225,8 +10222,8 @@ Options controlling the global behavior of ‘bison’. ‘fixit’ ‘diagnostics-parseable-fixits’ - Show machine-readable fixes, in a manner similar to GCC’s and - Clang’s ‘-fdiagnostics-parseable-fixits’. + Show machine-readable fixes, in a manner similar to GCC's and + Clang's ‘-fdiagnostics-parseable-fixits’. Fix-its are generated for duplicate directives: @@ -10307,8 +10304,8 @@ Options controlling the diagnostics. %type cond "condition" - does not define “condition” as a string alias to - ‘cond’—nonterminal symbols do not have string aliases. It is + does not define "condition" as a string alias to + ‘cond’--nonterminal symbols do not have string aliases. It is rather equivalent to %nterm cond @@ -10450,7 +10447,7 @@ Options controlling the diagnostics. ‘-Wno-error=CATEGORY’ Deactivate the error treatment for this CATEGORY. However, the - warning itself won’t be disabled, or enabled, by this option. + warning itself won't be disabled, or enabled, by this option. ‘--color’ Equivalent to ‘--color=always’. @@ -10539,7 +10536,7 @@ Options changing the generated parsers. ‘-l’ ‘--no-lines’ - Don’t put any ‘#line’ preprocessor commands in the parser + Don't put any ‘#line’ preprocessor commands in the parser implementation file. Ordinarily Bison puts them in the parser implementation file so that the C compiler and debuggers will associate errors with your source file, the grammar file. This @@ -10574,11 +10571,11 @@ Options changing the generated parsers. void yyerror (const char *); As a Bison extension, additional arguments required by ‘%pure-parser’, ‘%locations’, ‘%lex-param’ and ‘%parse-param’ - are taken into account. You may disable ‘yyerror’’s prototype + are taken into account. You may disable ‘yyerror’'s prototype with ‘#define yyerror yyerror’ (as specified by POSIX), or with ‘#define YYERROR_IS_DECLARED’ (a Bison extension). Likewise for ‘yylex’. - • Imitate Yacc’s output file name conventions, so that the + • Imitate Yacc's output file name conventions, so that the parser implementation file is called ‘y.tab.c’, and the other outputs are called ‘y.output’ and ‘y.tab.h’. Do not use ‘--yacc’ just to change the output file names since it also @@ -10636,7 +10633,7 @@ Options controlling the output. ‘state’ Description of the grammar, conflicts (resolved and - unresolved), and parser’s automaton. + unresolved), and parser's automaton. ‘itemset’ Implies ‘state’ and augments the description of the automaton @@ -10645,7 +10642,7 @@ Options controlling the output. ‘lookahead’ Implies ‘state’ and augments the description of the automaton - with each rule’s lookahead set. + with each rule's lookahead set. ‘solved’ Implies ‘state’. Explain how conflicts were solved thanks to @@ -10682,7 +10679,7 @@ Options controlling the output. ‘-g [FILE]’ ‘--graph[=FILE]’ - Output a graphical representation of the parser’s automaton + Output a graphical representation of the parser's automaton computed by Bison, in Graphviz (https://www.graphviz.org/) DOT (https://www.graphviz.org/doc/info/lang.html) format. ‘FILE’ is optional. If omitted and the grammar file is ‘foo.y’, the output @@ -10690,7 +10687,7 @@ Options controlling the output. ‘-x [FILE]’ ‘--xml[=FILE]’ - Output an XML report of the parser’s automaton computed by Bison. + Output an XML report of the parser's automaton computed by Bison. ‘FILE’ is optional. If omitted and the grammar file is ‘foo.y’, the output file will be ‘foo.xml’. @@ -10749,18 +10746,18 @@ File: bison.info, Node: Yacc Library, Prev: Option Cross Key, Up: Invocation The Yacc library contains default implementations of the ‘yyerror’ and ‘main’ functions. These default implementations are normally not useful, but POSIX requires them. To use the Yacc library, link your -program with the ‘-ly’ option. Note that Bison’s implementation of the +program with the ‘-ly’ option. Note that Bison's implementation of the Yacc library is distributed under the terms of the GNU General Public License (*note Copying::). - If you use the Yacc library’s ‘yyerror’ function, you should declare + If you use the Yacc library's ‘yyerror’ function, you should declare ‘yyerror’ as follows: int yyerror (char const *); The ‘int’ value returned by this ‘yyerror’ is ignored. - The implementation of Yacc library’s ‘main’ function is: + The implementation of Yacc library's ‘main’ function is: int main (void) { @@ -10783,7 +10780,7 @@ File: bison.info, Node: Other Languages, Next: History, Prev: Invocation, Up In addition to C, Bison can generate parsers in C++, D and Java. This chapter is devoted to these languages. The reader is expected to understand how Bison works; read the introductory chapters first if you -don’t. +don't. * Menu: @@ -10832,7 +10829,7 @@ and that we generate C++. %require "3.2" %language "c++" - Let’s dive directly into the middle part: the grammar. Our input is + Let's dive directly into the middle part: the grammar. Our input is a simple list of strings, that we display once the parsing is done. %% @@ -10847,7 +10844,7 @@ a simple list of strings, that we display once the parsing is done. ; We used a vector of strings as a semantic value! To use genuine C++ -objects as semantic values—not just PODs—we cannot rely on the union +objects as semantic values--not just PODs--we cannot rely on the union that Bison uses by default to store them, we need _variants_ (*note C++ Variants::): @@ -11017,7 +11014,7 @@ argument for its constructor. A structure that contains (only) the ‘token_kind_type’ enumeration, which defines the tokens. To refer to the token ‘FOO’, use ‘yy::parser::token::FOO’. The scanner can use ‘typedef - yy::parser::token token;’ to “import” the token enumeration (*note + yy::parser::token token;’ to "import" the token enumeration (*note Calc++ Scanner::). -- Type of parser: token_kind_type @@ -11151,7 +11148,7 @@ section, and in particular, object types can be used without pointers. To enable variant-based semantic values, set the ‘%define’ variable ‘api.value.type’ to ‘variant’ (*note %define Summary::). Then ‘%union’ is ignored; instead of using the name of the fields of the ‘%union’ to -“type” the symbols, use genuine types. +"type" the symbols, use genuine types. For instance, instead of: @@ -11196,14 +11193,14 @@ Typed Midrule Actions::). from the variadic forwarding references U.... *Warning*: We do not use Boost.Variant, for two reasons. First, it -appeared unacceptable to require Boost on the user’s machine (i.e., the +appeared unacceptable to require Boost on the user's machine (i.e., the machine on which the generated parser will be compiled, not the machine on which ‘bison’ was run). Second, for each possible semantic value, Boost.Variant not only stores the value, but also a tag specifying its -type. But the parser already “knows” the type of the semantic value, so +type. But the parser already "knows" the type of the semantic value, so that would be duplicating the information. - We do not use C++17’s ‘std::variant’ either: we want to support all + We do not use C++17's ‘std::variant’ either: we want to support all the C++ standards, and of course ‘std::variant’ also stores a tag to record the current type. @@ -11363,13 +11360,13 @@ File: bison.info, Node: Exposing the Location Classes, Next: User Defined Loca ...................................... When both ‘%header’ and ‘%locations’ are enabled, Bison generates an -additional file: ‘location.hh’. If you don’t use locations outside of +additional file: ‘location.hh’. If you don't use locations outside of the parser, you may avoid its creation with ‘%define api.location.file none’. However this file is useful if, for instance, your parser builds an -abstract syntax tree decorated with locations: you may use Bison’s -‘location’ type independently of Bison’s parser. You may name the file +abstract syntax tree decorated with locations: you may use Bison's +‘location’ type independently of Bison's parser. You may name the file differently, e.g., ‘%define api.location.file "include/ast/location.hh"’: this name can have directory components, or even be absolute. The way the location file is included is controlled @@ -11489,7 +11486,7 @@ Function::), the user must define the following function. typedef symbol_kind::symbol_kind_t symbol_kind_type; -- Method on context: const symbol_type& lookahead () const - The “unexpected” token: the lookahead that caused the syntax error. + The "unexpected" token: the lookahead that caused the syntax error. -- Method on context: symbol_kind_type token () const The symbol kind of the lookahead token that caused the syntax @@ -11636,7 +11633,7 @@ expects ‘yylex’ to have the following prototype. yield additional arguments. -- Type of parser: symbol_type - A “complete symbol”, that binds together its kind, value and (when + A "complete symbol", that binds together its kind, value and (when applicable) location. -- Method on symbol_type: symbol_kind_type kind () const @@ -11763,8 +11760,8 @@ interface with.  File: bison.info, Node: Calc++ --- C++ Calculator, Next: Calc++ Parsing Driver, Up: A Complete C++ Example -10.1.8.1 Calc++ — C++ Calculator -................................ +10.1.8.1 Calc++ -- C++ Calculator +................................. Of course the grammar is dedicated to arithmetic, a single expression, possibly preceded by variable assignments. An environment containing @@ -11782,7 +11779,7 @@ File: bison.info, Node: Calc++ Parsing Driver, Next: Calc++ Parser, Prev: Cal .............................. To support a pure interface with the parser (and the scanner) the -technique of the “parsing context” is convenient: a structure containing +technique of the "parsing context" is convenient: a structure containing all the data to exchange. Since, in addition to simply launch the parsing, there are several auxiliary tasks to execute (open the file for scanning, instantiate the parser etc.), we recommend transforming the @@ -11894,7 +11891,7 @@ conversions. This example uses genuine C++ objects as semantic values, therefore, we require the variant-based storage of semantic values. To make sure we properly use it, we enable assertions. To fully benefit from -type-safety and more natural definition of “symbol”, we enable +type-safety and more natural definition of "symbol", we enable ‘api.token.constructor’. %define api.token.constructor @@ -11905,8 +11902,8 @@ Then come the declarations/inclusions needed by the semantic values. Because the parser uses the parsing driver and reciprocally, both would like to include the header of the other, which is, of course, insane. This mutual dependency will be broken using forward declarations. -Because the driver’s header needs detailed knowledge about the parser -class (in particular its inner types), it is the parser’s header which +Because the driver's header needs detailed knowledge about the parser +class (in particular its inner types), it is the parser's header which will use a forward declaration of the driver. *Note %code Summary::. %code requires { @@ -12008,8 +12005,8 @@ File: bison.info, Node: Calc++ Scanner, Next: Calc++ Top Level, Prev: Calc++ 10.1.8.4 Calc++ Scanner ....................... -In addition to standard headers, the Flex scanner includes the driver’s, -then the parser’s to get the set of defined tokens. +In addition to standard headers, the Flex scanner includes the driver's, +then the parser's to get the set of defined tokens. %{ /* -*- C++ -*- */ # include @@ -12021,8 +12018,8 @@ then the parser’s to get the set of defined tokens. # include "parser.hh" %} -Since our calculator has no ‘#include’-like feature, we don’t need -‘yywrap’. We don’t need the ‘unput’ and ‘input’ functions either, and +Since our calculator has no ‘#include’-like feature, we don't need +‘yywrap’. We don't need the ‘unput’ and ‘input’ functions either, and we parse an actual file, this is not an interactive session with the user. Finally, we enable scanner tracing. @@ -12098,8 +12095,8 @@ report errors. return yy::parser::make_NUMBER ((int) n, loc); } -Finally, because the scanner-related driver’s member-functions depend on -the scanner’s data, it is simpler to implement them in this file. +Finally, because the scanner-related driver's member-functions depend on +the scanner's data, it is simpler to implement them in this file. void driver::scan_begin () @@ -12209,7 +12206,7 @@ garbage collection. The parser will try to hold references to semantic values for as little time as needed. D parsers support ‘%printer’. An example for the output of type -‘int’, where ‘yyo’ is the parser’s debug output: +‘int’, where ‘yyo’ is the parser's debug output: %printer { yyo.write($$); } @@ -12518,7 +12515,7 @@ Summary::). returned if more input is required to finish parsing the input. If ‘api.push-pull’ is defined as ‘both’, then the generated parser -class will also implement the ‘parse’ method. This method’s body is a +class will also implement the ‘parse’ method. This method's body is a loop that repeatedly invokes the scanner and then passes the values obtained from the scanner to the ‘pushParse’ method. @@ -12581,7 +12578,7 @@ contains a single class for the parser. Contrary to C parsers, Java parsers do not use global variables; the state of the parser is always local to an instance of the parser class. -Therefore, all Java parsers are “pure”, and the ‘%define api.pure’ +Therefore, all Java parsers are "pure", and the ‘%define api.pure’ directive does nothing when used in Java. GLR parsers are currently unsupported in Java. Do not use the @@ -12598,7 +12595,7 @@ parser, so use ‘%define parse.trace’ explicitly if needed. Also, in the future the ‘%token-table’ directive might enable a public interface to access the token names and codes. - Getting a “code too large” error from the Java compiler means the + Getting a "code too large" error from the Java compiler means the code hit the 64KB bytecode per method limitation of the Java class file. Try reducing the amount of code in actions and static initializers; otherwise, report a bug so that the parser skeleton will be improved. @@ -12610,7 +12607,7 @@ File: bison.info, Node: Java Semantic Values, Next: Java Location Values, Pre --------------------------- There is no ‘%union’ directive in Java parsers. Instead, the semantic -values’ types (class names) should be specified in the ‘%nterm’ or +values' types (class names) should be specified in the ‘%nterm’ or ‘%token’ directive: %nterm expr assignment_expr term factor @@ -12776,7 +12773,7 @@ them automatically. must provide the parser with the following function: -- Static Method of YYParser: String i18n (string S) - Return the translation of S in the user’s language. As an example: + Return the translation of S in the user's language. As an example: %code { static ResourceBundle myResources @@ -13034,7 +13031,7 @@ following: 0 (success), 1 (abort), 2 (memory exhaustion), or input is required to finish parsing the grammar. If ‘api.push-pull’ is defined as ‘both’, then the generated parser -class will also implement the ‘parse’ method. This method’s body is a +class will also implement the ‘parse’ method. This method's body is a loop that repeatedly invokes the scanner and then passes the values obtained from the scanner to the ‘push_parse’ method. @@ -13265,7 +13262,7 @@ File: bison.info, Node: Yacc, Next: yacchack, Up: History 11.1 The ancestral Yacc ======================= -Bison originated as a workalike of a program called Yacc — Yet Another +Bison originated as a workalike of a program called Yacc -- Yet Another Compiler Compiler.(1) Yacc was written at Bell Labs as part of the very early development of Unix; one of its first uses was to develop the original Portable C Compiler, pcc. The same person, Steven C. Johnson, @@ -13289,13 +13286,13 @@ with less restrictive licenses and more features became available. Original Yacc became generally available when Caldera released the sources of old versions of Unix up to V7 and 32V in 2002. By that time -it had been long superseded in practical use by Bison even on Yacc’s +it had been long superseded in practical use by Bison even on Yacc's native Unix variants. ---------- Footnotes ---------- - (1) Because of the acronym, the name is sometimes given as “YACC”, -but Johnson used “Yacc” in the descriptive paper included in the Version + (1) Because of the acronym, the name is sometimes given as "YACC", +but Johnson used "Yacc" in the descriptive paper included in the Version 7 Unix Manual (https://s3.amazonaws.com/plan9-bell-labs/7thEdMan/v7vol2b.pdf). @@ -13309,7 +13306,7 @@ File: bison.info, Node: yacchack, Next: Byacc, Prev: Yacc, Up: History One of the deficiencies of original Yacc was its inability to produce reentrant parsers. This was first remedied by a set of drop-in -modifications called “yacchack”, published by Eric S. Raymond on USENET +modifications called "yacchack", published by Eric S. Raymond on USENET around 1983. This code was quickly forgotten when zoo and Berkeley Yacc became available a few years later. @@ -13320,14 +13317,14 @@ File: bison.info, Node: Byacc, Next: Bison, Prev: yacchack, Up: History ================== Berkeley Yacc was originated in 1985 by Robert Corbett (*note Corbett -1984::). It was originally named “zoo”, but by October 1989 it became +1984::). It was originally named "zoo", but by October 1989 it became known as Berkeley Yacc or byacc. Berkeley Yacc had three advantages over the ancestral Yacc: it generated faster parsers, it could generate reentrant parsers, and the source code was released to the public domain rather than being under an AT&T proprietary license. The better performance came from implementing -techniques from DeRemer and Penello’s seminal paper on LALR parsing +techniques from DeRemer and Penello's seminal paper on LALR parsing (*note DeRemer 1982::). Use of byacc spread rapidly due to its public domain license. @@ -13341,12 +13338,12 @@ File: bison.info, Node: Bison, Next: Other Ungulates, Prev: Byacc, Up: Histo ========== Robert Corbett actually wrote two (closely related) LALR parsers in -1985, both using the DeRemer/Penello techniques. One was “zoo”, the -other was “Byson”. In 1987 Richard Stallman began working on Byson; the +1985, both using the DeRemer/Penello techniques. One was "zoo", the +other was "Byson". In 1987 Richard Stallman began working on Byson; the name changed to Bison and the interface became Yacc-compatible. The main visible difference between Yacc and Byson/Bison at the time -of Byson’s first release is that Byson supported the ‘@N’ construct +of Byson's first release is that Byson supported the ‘@N’ construct (giving access to the starting and ending line number and character number associated with any of the symbols in the current rule). @@ -13391,8 +13388,8 @@ the early ports are extinct along with the languages that hosted them; others have been superseded by parser skeletons shipped with Bison. However, independent implementations persist. One of the best-known -still in use is David Beazley’s “PLY” (Python Lex-Yacc) for Python. -Another is goyacc, supporting the Go language. An “ocamlyacc” is +still in use is David Beazley's "PLY" (Python Lex-Yacc) for Python. +Another is goyacc, supporting the Go language. An "ocamlyacc" is shipped as part of the Ocaml compiler suite.  @@ -13574,7 +13571,7 @@ manipulate multiple input buffers. If your Flex-generated scanner uses start conditions (*note Start conditions: (flex)Start conditions.), you might also want to reset the -scanner’s state, i.e., go back to the initial start condition, through a +scanner's state, i.e., go back to the initial start condition, through a call to ‘BEGIN (0)’.  @@ -13587,7 +13584,7 @@ File: bison.info, Node: Strings are Destroyed, Next: Implementing Gotos/Loops, them. Instead of reporting ‘"foo", "bar"’, it reports ‘"bar", "bar"’, or even ‘"foo\nbar", "bar"’. - This error is probably the single most frequent “bug report” sent to + This error is probably the single most frequent "bug report" sent to Bison lists, but is only concerned with a misunderstanding of the role of the scanner. Consider the following Lex code: @@ -13639,9 +13636,9 @@ File: bison.info, Node: Implementing Gotos/Loops, Next: Multiple start-symbols functions, but how can I implement gotos, or loops? Although very pedagogical, the examples included in the document blur -the distinction to make between the parser—whose job is to recover the +the distinction to make between the parser--whose job is to recover the structure of a text and to transmit it to subsequent modules of the -program—and the processing (such as the execution) of this structure. +program--and the processing (such as the execution) of this structure. This works well with so called straight line programs, i.e., precisely those that have a straightforward execution model: execute simple instructions one after the others. @@ -13709,7 +13706,7 @@ File: bison.info, Node: Secure? Conform?, Next: Enabling Relocatability, Prev Is Bison secure? Does it conform to POSIX? - If you’re looking for a guarantee or certification, we don’t provide + If you're looking for a guarantee or certification, we don't provide it. However, Bison is intended to be a reliable program that conforms to the POSIX specification for Yacc. If you run into problems, please send us a bug report. @@ -13728,7 +13725,7 @@ through ‘configure; make; make install’ with all its dependencies, options, and hurdles. Most package management systems, that allow the user to install -pre-built binaries of the packages, solve the “ease of installation” +pre-built binaries of the packages, solve the "ease of installation" problem, but they hardwire path names, usually to ‘/usr’ or ‘/usr/local’. This means that users need root privileges to install a binary package, and prevents installing two different versions of the @@ -13760,7 +13757,7 @@ also do not recommend prefixes that might be behind an automounter (e.g. ‘$HOME/inst$$’) because of the performance impact of directory searching. - Here’s a sample installation run that takes into account all these + Here's a sample installation run that takes into account all these recommendations: ./configure --enable-relocatable --prefix=/nonexistent @@ -13779,29 +13776,29 @@ executes the real program).  File: bison.info, Node: I can't build Bison, Next: Where can I find help?, Prev: Enabling Relocatability, Up: FAQ -13.8 I can’t build Bison +13.8 I can't build Bison ======================== - I can’t build Bison because ‘make’ complains that ‘msgfmt’ is not + I can't build Bison because ‘make’ complains that ‘msgfmt’ is not found. What should I do? Like most GNU packages with internationalization support, that feature is turned on by default. If you have problems building in the -‘po’ subdirectory, it indicates that your system’s internationalization +‘po’ subdirectory, it indicates that your system's internationalization support is lacking. You can re-configure Bison with ‘--disable-nls’ to turn off this support, or you can install GNU gettext from and re-configure Bison. See the file ‘ABOUT-NLS’ for more information. - I can’t build Bison because my C compiler is too old. + I can't build Bison because my C compiler is too old. Except for GLR parsers (which require C99), the C code that Bison generates requires only C89 or later. However, Bison itself requires -common C99 features such as declarations after statements. Bison’s +common C99 features such as declarations after statements. Bison's ‘configure’ script attempts to enable C99 (or later) support on compilers that default to pre-C99. If your compiler lacks these C99 features entirely, GCC may well be a better choice; or you can try -upgrading to your compiler’s latest version. +upgrading to your compiler's latest version.  File: bison.info, Node: Where can I find help?, Next: Bug Reports, Prev: I can't build Bison, Up: FAQ @@ -13809,7 +13806,7 @@ File: bison.info, Node: Where can I find help?, Next: Bug Reports, Prev: I ca 13.9 Where can I find help? =========================== - I’m having trouble using Bison. Where can I find help? + I'm having trouble using Bison. Where can I find help? First, read this fine manual. Beyond that, you can send mail to . This mailing list is intended to be populated @@ -13842,7 +13839,7 @@ to edit or add anything). The smaller and simpler the grammar, the easier it will be to fix the bug. Include information about your compilation environment, including -your operating system’s name and version and your compiler’s name and +your operating system's name and version and your compiler's name and version. If you have trouble compiling, you should also include a transcript of the build session, starting with the invocation of ‘configure’. Depending on the nature of the bug, you may be asked to @@ -13862,7 +13859,7 @@ File: bison.info, Node: More Languages, Next: Beta Testing, Prev: Bug Reports Will Bison ever have C++ and Java support? How about INSERT YOUR FAVORITE LANGUAGE HERE? - C++, D and Java are supported. We’d love to add other languages; + C++, D and Java are supported. We'd love to add other languages; contributions are welcome.  @@ -13873,7 +13870,7 @@ File: bison.info, Node: Beta Testing, Next: Mailing Lists, Prev: More Languag What is involved in being a beta tester? - It’s not terribly involved. Basically, you would download a test + It's not terribly involved. Basically, you would download a test release, compile it, and use it to build and run a parser or two. After that, you would submit either a bug report or a message saying that everything is okay. It is important to report successes as well as @@ -13959,7 +13956,7 @@ Appendix A Bison Symbols Comments, as in C/C++. -- Delimiter: : - Separates a rule’s result from its components. *Note Rules::. + Separates a rule's result from its components. *Note Rules::. -- Delimiter: ; Terminates a rule. *Note Rules::. @@ -13998,7 +13995,7 @@ Appendix A Bison Symbols -- Directive: %define VARIABLE VALUE -- Directive: %define VARIABLE {VALUE} -- Directive: %define VARIABLE "VALUE" - Define a variable to adjust Bison’s behavior. *Note %define + Define a variable to adjust Bison's behavior. *Note %define Summary::. -- Directive: %defines @@ -14242,7 +14239,7 @@ Appendix A Bison Symbols External variable in which ‘yylex’ should place the line and column numbers associated with a token. (In a pure parser, it is a local variable within ‘yyparse’, and its address is passed to ‘yylex’.) - You can ignore this variable if you don’t use the ‘@’ feature in + You can ignore this variable if you don't use the ‘@’ feature in the grammar actions. *Note Token Locations::. In semantic actions, it stores the location of the lookahead token. *Note Actions and Locations::. @@ -14352,7 +14349,7 @@ Accepting state A state whose only action is the accept action. The accepting state is thus a consistent state. *Note Understanding::. -Backus-Naur Form (BNF; also called “Backus Normal Form”) +Backus-Naur Form (BNF; also called "Backus Normal Form") Formal method of specifying context-free grammars originally proposed by John Backus, and slightly improved by Peter Naur in his 1960-01-02 committee document contributing to what became the Algol @@ -14401,7 +14398,7 @@ Empty string character string of length zero. Finite-state stack machine - A “machine” that has discrete states in which it is said to exist + A "machine" that has discrete states in which it is said to exist at each instant in time. As input to the machine is processed, the machine moves from state to state as specified by the logic of the machine. In the case of the parser, the input is the language @@ -14411,14 +14408,14 @@ Finite-state stack machine Generalized LR (GLR) A parsing algorithm that can handle all context-free grammars, including those that are not LR(1). It resolves situations that - Bison’s deterministic parsing algorithm cannot by effectively + Bison's deterministic parsing algorithm cannot by effectively splitting off multiple parsers, trying all possible parsers, and discarding those that fail in the light of additional right context. *Note Generalized LR Parsing::. Grouping A language construct that is (in general) grammatically divisible; - for example, ‘expression’ or ‘declaration’ in C. *Note Language + for example, 'expression' or 'declaration' in C. *Note Language and Grammar::. IELR(1) (Inadequacy Elimination LR(1)) @@ -14427,7 +14424,7 @@ IELR(1) (Inadequacy Elimination LR(1)) with the full language-recognition power of canonical LR(1) but with nearly the same number of parser states as LALR(1). This reduction in parser states is often an order of magnitude. More - importantly, because canonical LR(1)’s extra parser states may + importantly, because canonical LR(1)'s extra parser states may contain duplicate conflicts in the case of non-LR(1) grammars, the number of conflicts for IELR(1) is often an order of magnitude less as well. This can significantly reduce the complexity of @@ -14441,25 +14438,25 @@ Input stream A continuous flow of data between devices or programs. Kind - “Token” and “symbol” are each overloaded to mean either a grammar + "Token" and "symbol" are each overloaded to mean either a grammar symbol (kind) or all parse info (kind, value, location) associated with occurrences of that grammar symbol from the input. To disambiguate, - • we use “token kind” and “symbol kind” to mean both grammar + • we use "token kind" and "symbol kind" to mean both grammar symbols and the values that represent them in a base programming language (C, C++, etc.). The names of the types of these values are typically ‘token_kind_t’, or ‘token_kind_type’, or ‘TokenKind’, depending on the programming language. - • we use “token” and “symbol” without the word “kind” to mean - parsed occurrences, and we append the word “type” to refer to + • we use "token" and "symbol" without the word "kind" to mean + parsed occurrences, and we append the word "type" to refer to the types that represent them in a base programming language. - In summary: When you see “kind”, interpret “symbol” or “token” to - mean a _grammar symbol_. When you don’t see “kind” (including when - you see “type”), interpret “symbol” or “token” to mean a _parsed + In summary: When you see "kind", interpret "symbol" or "token" to + mean a _grammar symbol_. When you don't see "kind" (including when + you see "type"), interpret "symbol" or "token" to mean a _parsed symbol_. LAC (Lookahead Correction) @@ -14594,7 +14591,7 @@ Token kind Unreachable state A parser state to which there does not exist a sequence of - transitions from the parser’s start state. A state can become + transitions from the parser's start state. A state can become unreachable during conflict resolution. *Note Unreachable States::. @@ -14622,7 +14619,7 @@ Appendix C GNU Free Documentation License author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. - This License is a kind of “copyleft”, which means that derivative + This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. @@ -14643,18 +14640,18 @@ Appendix C GNU Free Documentation License be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The - “Document”, below, refers to any such manual or work. Any member - of the public is a licensee, and is addressed as “you”. You accept + "Document", below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. - A “Modified Version” of the Document means any work containing the + A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. - A “Secondary Section” is a named appendix or a front-matter section + A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the - publishers or authors of the Document to the Document’s overall + publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not @@ -14663,7 +14660,7 @@ Appendix C GNU Free Documentation License of legal, commercial, philosophical, ethical or political position regarding them. - The “Invariant Sections” are certain Secondary Sections whose + The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it @@ -14671,13 +14668,13 @@ Appendix C GNU Free Documentation License contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. - The “Cover Texts” are certain short passages of text that are + The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. - A “Transparent” copy of the Document means a machine-readable copy, + A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed @@ -14689,7 +14686,7 @@ Appendix C GNU Free Documentation License been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not - “Transparent” is called “Opaque”. + "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, @@ -14702,23 +14699,23 @@ Appendix C GNU Free Documentation License the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. - The “Title Page” means, for a printed book, the title page itself, + The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For - works in formats which do not have any title page as such, “Title - Page” means the text near the most prominent appearance of the - work’s title, preceding the beginning of the body of the text. + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. - The “publisher” means any person or entity that distributes copies + The "publisher" means any person or entity that distributes copies of the Document to the public. - A section “Entitled XYZ” means a named subunit of the Document + A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as - “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) - To “Preserve the Title” of such a section when you modify the - Document means that it remains a section “Entitled XYZ” according + "Acknowledgements", "Dedications", "Endorsements", or "History".) + To "Preserve the Title" of such a section when you modify the + Document means that it remains a section "Entitled XYZ" according to this definition. The Document may include Warranty Disclaimers next to the notice @@ -14748,7 +14745,7 @@ Appendix C GNU Free Documentation License If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and - the Document’s license notice requires Cover Texts, you must + the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly @@ -14820,15 +14817,15 @@ Appendix C GNU Free Documentation License the Addendum below. G. Preserve in that license notice the full lists of Invariant - Sections and required Cover Texts given in the Document’s + Sections and required Cover Texts given in the Document's license notice. H. Include an unaltered copy of this License. - I. Preserve the section Entitled “History”, Preserve its Title, + I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the - Title Page. If there is no section Entitled “History” in the + Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the @@ -14838,12 +14835,12 @@ Appendix C GNU Free Documentation License for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the - “History” section. You may omit a network location for a work + "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. - K. For any section Entitled “Acknowledgements” or “Dedications”, + K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. @@ -14852,11 +14849,11 @@ Appendix C GNU Free Documentation License in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. - M. Delete any section Entitled “Endorsements”. Such a section + M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version. N. Do not retitle any existing section to be Entitled - “Endorsements” or to conflict in title with any Invariant + "Endorsements" or to conflict in title with any Invariant Section. O. Preserve any Warranty Disclaimers. @@ -14865,15 +14862,15 @@ Appendix C GNU Free Documentation License appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their - titles to the list of Invariant Sections in the Modified Version’s + titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. - You may add a section Entitled “Endorsements”, provided it contains + You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various - parties—for example, statements of peer review or that the text has - been approved by an organization as the authoritative definition of - a standard. + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of @@ -14911,10 +14908,10 @@ Appendix C GNU Free Documentation License combined work. In the combination, you must combine any sections Entitled - “History” in the various original documents, forming one section - Entitled “History”; likewise combine any sections Entitled - “Acknowledgements”, and any sections Entitled “Dedications”. You - must delete all sections Entitled “Endorsements.” + "History" in the various original documents, forming one section + Entitled "History"; likewise combine any sections Entitled + "Acknowledgements", and any sections Entitled "Dedications". You + must delete all sections Entitled "Endorsements." 6. COLLECTIONS OF DOCUMENTS @@ -14935,16 +14932,16 @@ Appendix C GNU Free Documentation License A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a - storage or distribution medium, is called an “aggregate” if the + storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the - legal rights of the compilation’s users beyond what the individual + legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half - of the entire aggregate, the Document’s Cover Texts may be placed + of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket @@ -14966,8 +14963,8 @@ Appendix C GNU Free Documentation License this License or a notice or disclaimer, the original version will prevail. - If a section in the Document is Entitled “Acknowledgements”, - “Dedications”, or “History”, the requirement (section 4) to + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. @@ -15008,7 +15005,7 @@ Appendix C GNU Free Documentation License Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered - version of this License “or any later version” applies to it, you + version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the @@ -15016,29 +15013,29 @@ Appendix C GNU Free Documentation License choose any version ever published (not as a draft) by the Free Software Foundation. If the Document specifies that a proxy can decide which future versions of this License can be used, that - proxy’s public statement of acceptance of a version permanently + proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Document. 11. RELICENSING - “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any + "Massive Multiauthor Collaboration Site" (or "MMC Site") means any World Wide Web server that publishes copyrightable works and also provides prominent facilities for anybody to edit those works. A public wiki that anybody can edit is an example of such a server. - A “Massive Multiauthor Collaboration” (or “MMC”) contained in the + A "Massive Multiauthor Collaboration" (or "MMC") contained in the site means any set of copyrightable works thus published on the MMC site. - “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 + "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 license published by Creative Commons Corporation, a not-for-profit corporation with a principal place of business in San Francisco, California, as well as future copyleft versions of that license published by that same organization. - “Incorporate” means to publish or republish a Document, in whole or + "Incorporate" means to publish or republish a Document, in whole or in part, as part of another Document. - An MMC is “eligible for relicensing” if it is licensed under this + An MMC is "eligible for relicensing" if it is licensed under this License, and if all works that were first published under this License somewhere other than this MMC, and subsequently incorporated in whole or in part into the MMC, (1) had no cover @@ -15065,7 +15062,7 @@ notices just after the title page: Free Documentation License''. If you have Invariant Sections, Front-Cover Texts and Back-Cover -Texts, replace the “with...Texts.” line with this: +Texts, replace the "with...Texts." line with this: with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts @@ -15088,7 +15085,7 @@ Bibliography [Corbett 1984] Robert Paul Corbett, Static Semantics in Compiler Error Recovery - Ph.D. Dissertation, Report No. UCB/CSD 85/251, Department of + Ph.D. Dissertation, Report No. UCB/CSD 85/251, Department of Electrical Engineering and Computer Science, Compute Science Division, University of California, Berkeley, California (June 1985). @@ -15097,7 +15094,7 @@ Bibliography Joel E. Denny and Brian A. Malloy, IELR(1): Practical LR(1) Parser Tables for Non-LR(1) Grammars with Conflict Resolution, in ‘Proceedings of the 2008 ACM Symposium on Applied Computing’ - (SAC’08), ACM, New York, NY, USA, pp. 240–245. + (SAC'08), ACM, New York, NY, USA, pp. 240-245. [Denny 2010 May] @@ -15110,32 +15107,32 @@ Bibliography Joel E. Denny and Brian A. Malloy, The IELR(1) Algorithm for Generating Minimal LR(1) Parser Tables for Non-LR(1) Grammars with Conflict Resolution, in ‘Science of Computer Programming’, Vol. 75, - Issue 11 (November 2010), pp. 943–979. + Issue 11 (November 2010), pp. 943-979. [DeRemer 1982] Frank DeRemer and Thomas Pennello, Efficient Computation of LALR(1) Look-Ahead Sets, in ‘ACM Transactions on Programming Languages and - Systems’, Vol. 4, No. 4 (October 1982), pp. 615–649. + Systems’, Vol. 4, No. 4 (October 1982), pp. 615-649. [Isradisaikul 2015] Chinawat Isradisaikul, Andrew Myers, Finding Counterexamples from Parsing Conflicts, in ‘Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation’ (PLDI - ’15), ACM, pp. 555–564. + '15), ACM, pp. 555-564. [Johnson 1978] Steven C. Johnson, A portable compiler: theory and practice, in ‘Proceedings of the 5th ACM SIGACT-SIGPLAN symposium on Principles - of programming languages’ (POPL ’78), pp. 97–104. + of programming languages’ (POPL '78), pp. 97-104. . [Knuth 1965] Donald E. Knuth, On the Translation of Languages from Left to Right, in ‘Information and Control’, Vol. 8, Issue 6 (December - 1965), pp. 607–639. + 1965), pp. 607-639. [Scott 2000] @@ -15154,39 +15151,42 @@ Index of Terms [index] * Menu: -* $$: Actions. (line 6) -* $$ <1>: Java Action Features. - (line 20) -* $$ <2>: Action Features. (line 9) -* $$ <3>: D Action Features. (line 9) -* $$ <4>: Table of Symbols. (line 28) -* $$: Java Action Features. - (line 28) -* $$ <1>: Action Features. (line 17) -* $N: Java Action Features. - (line 16) -* $N <1>: Action Features. (line 21) -* $@N: Midrule Action Translation. +* ;: Table of Symbols. (line 65) +* :: Table of Symbols. (line 62) +* @[NAME]: Actions and Locations. (line 6) -* $@N <1>: Table of Symbols. (line 23) -* $accept: Table of Symbols. (line 84) -* $end: Table of Symbols. (line 122) -* $N: Actions. (line 6) -* $N <1>: Java Action Features. - (line 12) -* $N <2>: Action Features. (line 13) -* $N <3>: D Action Features. (line 13) -* $N <4>: Table of Symbols. (line 32) -* $NAME: Actions. (line 6) -* $NAME <1>: Table of Symbols. (line 36) -* $undefined: Table of Symbols. (line 253) -* $[NAME]: Actions. (line 6) -* $[NAME] <1>: Table of Symbols. (line 37) +* @[NAME] <1>: Table of Symbols. (line 19) +* @$: Actions and Locations. + (line 6) +* @$ <1>: Java Action Features. + (line 38) +* @$ <2>: Action Features. (line 99) +* @$ <3>: Table of Symbols. (line 6) +* @N: Midrule Action Translation. + (line 6) +* @N <1>: Actions and Locations. + (line 6) +* @N <2>: Java Action Features. + (line 34) +* @N <3>: Action Features. (line 104) +* @N <4>: Action Features. (line 105) +* @N <5>: Table of Symbols. (line 10) +* @N <6>: Table of Symbols. (line 11) +* @NAME: Actions and Locations. + (line 6) +* @NAME <1>: Table of Symbols. (line 18) +* /*: Table of Symbols. (line 58) +* /* ... */: Grammar Outline. (line 6) +* //: Table of Symbols. (line 59) +* // ...: Grammar Outline. (line 6) +* %?: Semantic Predicates. (line 6) +* %?{EXPRESSION}: Table of Symbols. (line 50) +* %{: Java Declarations Summary. + (line 51) +* %{CODE%}: Table of Symbols. (line 45) * %%: Java Declarations Summary. (line 47) * %% <1>: Table of Symbols. (line 41) -* %?: Semantic Predicates. (line 6) -* %?{EXPRESSION}: Table of Symbols. (line 50) * %code: Prologue Alternatives. (line 6) * %code <1>: Decl Summary. (line 52) @@ -15443,45 +15443,42 @@ Index of Terms * %union <3>: Table of Symbols. (line 258) * %verbose: Decl Summary. (line 241) * %yacc: Decl Summary. (line 246) -* %{: Java Declarations Summary. - (line 51) -* %{CODE%}: Table of Symbols. (line 45) -* /*: Table of Symbols. (line 58) -* /* ... */: Grammar Outline. (line 6) -* //: Table of Symbols. (line 59) -* // ...: Grammar Outline. (line 6) -* :: Table of Symbols. (line 62) -* ;: Table of Symbols. (line 65) * <*>: Destructor Decl. (line 6) * <*> <1>: Printer Decl. (line 6) * <*> <2>: Table of Symbols. (line 72) * <>: Destructor Decl. (line 6) * <> <1>: Printer Decl. (line 6) * <> <2>: Table of Symbols. (line 78) -* @$: Actions and Locations. - (line 6) -* @$ <1>: Java Action Features. - (line 38) -* @$ <2>: Action Features. (line 99) -* @$ <3>: Table of Symbols. (line 6) -* @N: Midrule Action Translation. - (line 6) -* @N <1>: Actions and Locations. - (line 6) -* @N <2>: Java Action Features. - (line 34) -* @N <3>: Action Features. (line 104) -* @N <4>: Action Features. (line 105) -* @N <5>: Table of Symbols. (line 10) -* @N <6>: Table of Symbols. (line 11) -* @NAME: Actions and Locations. - (line 6) -* @NAME <1>: Table of Symbols. (line 18) -* @[NAME]: Actions and Locations. - (line 6) -* @[NAME] <1>: Table of Symbols. (line 19) * |: Rules Syntax. (line 48) * | <1>: Table of Symbols. (line 68) +* $[NAME]: Actions. (line 6) +* $[NAME] <1>: Table of Symbols. (line 37) +* $@N: Midrule Action Translation. + (line 6) +* $@N <1>: Table of Symbols. (line 23) +* $$: Java Action Features. + (line 28) +* $$ <1>: Action Features. (line 17) +* $N: Java Action Features. + (line 16) +* $N <1>: Action Features. (line 21) +* $$: Actions. (line 6) +* $$ <1>: Java Action Features. + (line 20) +* $$ <2>: Action Features. (line 9) +* $$ <3>: D Action Features. (line 9) +* $$ <4>: Table of Symbols. (line 28) +* $accept: Table of Symbols. (line 84) +* $end: Table of Symbols. (line 122) +* $N: Actions. (line 6) +* $N <1>: Java Action Features. + (line 12) +* $N <2>: Action Features. (line 13) +* $N <3>: D Action Features. (line 13) +* $N <4>: Table of Symbols. (line 32) +* $NAME: Actions. (line 6) +* $NAME <1>: Table of Symbols. (line 36) +* $undefined: Table of Symbols. (line 253) * abstract syntax tree: Implementing Gotos/Loops. (line 17) * accepting state: Understanding. (line 185) @@ -15517,6 +15514,8 @@ Index of Terms * Bison parser algorithm: Algorithm. (line 6) * Bison symbols, table of: Table of Symbols. (line 6) * Bison utility: Bison Parser. (line 6) +* BISON_I18N: Enabling I18n. (line 18) +* BISON_LOCALEDIR: Enabling I18n. (line 18) * bison-i18n.m4: Enabling I18n. (line 11) * bison-po: Internationalization. (line 6) @@ -15526,8 +15525,6 @@ Index of Terms * bisonVersion of YYParser: D Parser Interface. (line 69) * bisonVersion of YYParser <1>: Java Parser Interface. (line 91) -* BISON_I18N: Enabling I18n. (line 18) -* BISON_LOCALEDIR: Enabling I18n. (line 18) * BNF: Language and Grammar. (line 16) * braced code: Rules Syntax. (line 29) @@ -15567,19 +15564,19 @@ Index of Terms (line 6) * controlling function: Rpcalc Main. (line 6) * core, item set: Understanding. (line 132) +* counter_type: C++ position. (line 11) * counterexample, nonunifying: Glossary. (line 31) * counterexample, unifying: Glossary. (line 31) * counterexamples: Counterexamples. (line 6) -* counter_type: C++ position. (line 11) * dangling else: Shift/Reduce. (line 6) * data type of locations: Location Type. (line 6) * data types in actions: Action Types. (line 6) * data types of semantic values: Value Type. (line 6) -* debugging: Tracing. (line 6) * debug_level on parser: C++ Parser Interface. (line 91) * debug_stream on parser: C++ Parser Interface. (line 86) +* debugging: Tracing. (line 6) * declaration summary: Decl Summary. (line 6) * declarations: Prologue. (line 6) * declarations section: Prologue. (line 6) @@ -15781,10 +15778,10 @@ Index of Terms (line 27) * location tracking calculator: Location Tracking Calc. (line 6) -* location, textual: Locations. (line 6) -* location, textual <1>: Tracking Locations. (line 6) * location_type: C++ Parser Interface. (line 49) +* location, textual: Locations. (line 6) +* location, textual <1>: Tracking Locations. (line 6) * lookahead correction: LAC. (line 6) * lookahead on context: C++ Parser Context. (line 43) * lookahead token: Lookahead. (line 6) @@ -15824,6 +15821,10 @@ Index of Terms * nonunifying counterexample: Glossary. (line 31) * operator precedence: Precedence. (line 6) * operator precedence, declaring: Precedence Decl. (line 6) +* operator- on location: C++ location. (line 30) +* operator- on position: C++ position. (line 45) +* operator-= on location: C++ location. (line 31) +* operator-= on position: C++ position. (line 44) * operator!= on location: C++ location. (line 43) * operator!= on position: C++ position. (line 49) * operator() on parser: C++ Parser Interface. @@ -15834,10 +15835,6 @@ Index of Terms * operator+= on location: C++ location. (line 29) * operator+= on location <1>: C++ location. (line 35) * operator+= on position: C++ position. (line 42) -* operator- on location: C++ location. (line 30) -* operator- on position: C++ position. (line 45) -* operator-= on location: C++ location. (line 31) -* operator-= on position: C++ position. (line 44) * operator<<: C++ position. (line 52) * operator<< <1>: C++ location. (line 47) * operator== on location: C++ location. (line 42) @@ -15875,14 +15872,14 @@ Index of Terms * pure parser: Pure Decl. (line 6) * push parser: Push Decl. (line 6) * push parser <1>: Push Decl. (line 6) -* pushParse on YYParser: D Push Parser Interface. - (line 18) * push_parse on YYParser: Java Push Parser Interface. (line 18) * push_parse on YYParser <1>: Java Push Parser Interface. (line 19) * push_parse on YYParser <2>: Java Push Parser Interface. (line 21) +* pushParse on YYParser: D Push Parser Interface. + (line 18) * questions: FAQ. (line 6) * recovering: Java Action Features. (line 54) @@ -15897,11 +15894,11 @@ Index of Terms * reduce/reduce conflicts <2>: Merging GLR Parses. (line 6) * reduction: Algorithm. (line 6) * reentrant parser: Pure Decl. (line 6) +* report_syntax_error on parser: C++ Parser Context. (line 9) * reportSyntaxError on Lexer: Java Scanner Interface. (line 59) * reportSyntaxError(YYParser.Context on Lexer: D Scanner Interface. (line 34) -* report_syntax_error on parser: C++ Parser Context. (line 9) * requiring a version of Bison: Require Decl. (line 6) * Reverse Polish Notation: RPN Calc. (line 6) * right recursion: Recursion. (line 17) @@ -15917,6 +15914,10 @@ Index of Terms * Semantic predicates in GLR parsers: Semantic Predicates. (line 6) * semantic value: Semantic Values. (line 6) * semantic value type: Value Type. (line 6) +* set_debug_level on parser: C++ Parser Interface. + (line 92) +* set_debug_stream on parser: C++ Parser Interface. + (line 87) * setDebugLevel on YYParser: Java Parser Interface. (line 87) * setDebugLevel(int on YYParser: D Parser Interface. (line 65) @@ -15926,10 +15927,6 @@ Index of Terms * setErrorVerbose on YYParser: Java Parser Interface. (line 65) * setErrorVerbose(boolean on YYParser: D Parser Interface. (line 44) -* set_debug_level on parser: C++ Parser Interface. - (line 92) -* set_debug_stream on parser: C++ Parser Interface. - (line 87) * shift/reduce conflicts: GLR Parsers. (line 6) * shift/reduce conflicts <1>: Simple GLR Parsers. (line 6) * shift/reduce conflicts <2>: Shift/Reduce. (line 6) @@ -15950,13 +15947,6 @@ Index of Terms * suppressing conflict warnings: Expect Decl. (line 6) * symbol: Symbols. (line 6) * symbol table example: Mfcalc Symbol Table. (line 6) -* SymbolKind: D Parser Context Interface. - (line 9) -* SymbolKind <1>: Java Parser Context Interface. - (line 9) -* symbols (abstract): Language and Grammar. - (line 46) -* symbols in Bison, table of: Table of Symbols. (line 6) * symbol_kind_type: C++ Parser Context. (line 19) * symbol_name on parser: C++ Parser Context. (line 68) * symbol_type: Complete Symbols. (line 17) @@ -15964,6 +15954,13 @@ Index of Terms * symbol_type on parser::symbol_type <1>: Complete Symbols. (line 34) * symbol_type on parser::symbol_type <2>: Complete Symbols. (line 36) * symbol_type on parser::symbol_type <3>: Complete Symbols. (line 38) +* SymbolKind: D Parser Context Interface. + (line 9) +* SymbolKind <1>: Java Parser Context Interface. + (line 9) +* symbols (abstract): Language and Grammar. + (line 46) +* symbols in Bison, table of: Table of Symbols. (line 6) * syntactic grouping: Language and Grammar. (line 46) * syntax error: Error Reporting Function. @@ -15978,8 +15975,8 @@ Index of Terms * terminal symbol: Symbols. (line 6) * textual location: Locations. (line 6) * textual location <1>: Tracking Locations. (line 6) -* this(Lexer on YYParser: D Parser Interface. (line 34) * this(LEX_PARAM, on YYParser: D Parser Interface. (line 29) +* this(Lexer on YYParser: D Parser Interface. (line 34) * this(Position on Location: D Location Values. (line 14) * this(Position on Location <1>: D Location Values. (line 18) * token: Language and Grammar. @@ -15989,9 +15986,9 @@ Index of Terms * token kind: Symbols. (line 6) * token kind names, declaring: Token Decl. (line 6) * token on context: C++ Parser Context. (line 46) -* token, useless: Understanding. (line 56) * token_kind_type: C++ Parser Interface. (line 21) +* token, useless: Understanding. (line 56) * toString on Location: Java Location Values. (line 30) * toString() on Location: D Location Values. (line 21) @@ -16011,9 +16008,9 @@ Index of Terms * value types, declaring <2>: Structured Value Type. (line 6) * value types, nonterminals, declaring: Type Decl. (line 6) -* value, semantic: Semantic Values. (line 6) * value_type: C++ Parser Interface. (line 46) +* value, semantic: Semantic Values. (line 6) * version: Versioning. (line 6) * version requirement: Require Decl. (line 6) * warnings, preventing: Expect Decl. (line 6) @@ -16181,270 +16178,269 @@ Index of Terms * YYUNDEF: Table of Symbols. (line 443) * zoo: Bison. (line 6) -  Tag Table: -Node: Top1066 -Node: Introduction18219 -Node: Conditions19794 -Node: Copying21717 -Node: Concepts59459 -Node: Language and Grammar60655 -Node: Grammar in Bison66769 -Node: Semantic Values68685 -Node: Semantic Actions70821 -Node: GLR Parsers71998 -Node: Simple GLR Parsers74773 -Node: Merging GLR Parses81253 -Ref: Merging GLR Parses-Footnote-186591 -Node: GLR Semantic Actions86732 -Node: Semantic Predicates89333 -Node: Locations91786 -Node: Bison Parser93264 -Node: Stages96464 -Node: Grammar Layout97689 -Node: Examples99051 -Node: RPN Calc100544 -Ref: RPN Calc-Footnote-1101596 -Node: Rpcalc Declarations101674 -Node: Rpcalc Rules103730 -Node: Rpcalc Input105629 -Node: Rpcalc Line107208 -Node: Rpcalc Exp108360 -Node: Rpcalc Lexer110373 -Node: Rpcalc Main113070 -Node: Rpcalc Error113481 -Node: Rpcalc Generate114509 -Node: Rpcalc Compile115757 -Node: Infix Calc116721 -Ref: Infix Calc-Footnote-1119567 -Node: Simple Error Recovery119720 -Node: Location Tracking Calc121658 -Node: Ltcalc Declarations122358 -Node: Ltcalc Rules123453 -Node: Ltcalc Lexer125295 -Node: Multi-function Calc127636 -Ref: Multi-function Calc-Footnote-1129413 -Node: Mfcalc Declarations129491 -Node: Mfcalc Rules131515 -Node: Mfcalc Symbol Table132793 -Node: Mfcalc Lexer136255 -Node: Mfcalc Main138828 -Node: Exercises139704 -Node: Grammar File140231 -Node: Grammar Outline141081 -Node: Prologue141939 -Node: Prologue Alternatives143740 -Ref: Prologue Alternatives-Footnote-1153440 -Node: Bison Declarations153545 -Node: Grammar Rules153955 -Node: Epilogue154411 -Node: Symbols155462 -Node: Rules162497 -Node: Rules Syntax162812 -Node: Empty Rules164877 -Node: Recursion165964 -Node: Semantics167622 -Node: Value Type168928 -Node: Multiple Types170216 -Node: Type Generation171666 -Node: Union Decl173596 -Node: Structured Value Type174989 -Node: Actions176015 -Node: Action Types179899 -Node: Midrule Actions181252 -Node: Using Midrule Actions181906 -Node: Typed Midrule Actions185445 -Node: Midrule Action Translation186995 -Node: Midrule Conflicts189488 -Node: Tracking Locations192097 -Node: Location Type192829 -Node: Actions and Locations194352 -Node: Printing Locations196734 -Node: Location Default Action197496 -Node: Named References201033 -Node: Declarations203630 -Node: Require Decl205319 -Node: Token Decl205833 -Node: Precedence Decl208750 -Node: Type Decl211026 -Node: Symbol Decls211977 -Node: Initial Action Decl212932 -Node: Destructor Decl213747 -Node: Printer Decl219393 -Node: Expect Decl221662 -Node: Start Decl225663 -Node: Pure Decl226057 -Node: Push Decl227805 -Node: Decl Summary232244 -Ref: %header234925 -Node: %define Summary243258 -Ref: api-filename-type245169 -Ref: api-token-prefix256117 -Node: %code Summary268123 -Node: Multiple Parsers272379 -Node: Interface276239 -Node: Parser Function277348 -Node: Push Parser Interface279841 -Ref: yypstate_new280226 -Ref: yypstate_delete280667 -Ref: yypush_parse281081 -Ref: yypull_parse282093 -Node: Lexical283096 -Node: Calling Convention284671 -Node: Special Tokens286200 -Node: Tokens from Literals287639 -Node: Token Values288720 -Node: Token Locations289888 -Node: Pure Calling290820 -Node: Error Reporting293417 -Node: Error Reporting Function293940 -Node: Syntax Error Reporting Function297312 -Node: Action Features301923 -Node: Internationalization306263 -Node: Enabling I18n307123 -Node: Token I18n309241 -Node: Algorithm310644 -Node: Lookahead313066 -Node: Shift/Reduce315280 -Node: Precedence319347 -Node: Why Precedence320119 -Node: Using Precedence322034 -Node: Precedence Only323534 -Node: Precedence Examples325336 -Node: How Precedence325860 -Node: Non Operators327005 -Node: Contextual Precedence328578 -Node: Parser States330324 -Node: Reduce/Reduce331579 -Node: Mysterious Conflicts336388 -Node: Tuning LR340015 -Node: LR Table Construction341221 -Node: Default Reductions346839 -Node: LAC351626 -Node: Unreachable States357132 -Node: Generalized LR Parsing359139 -Node: Memory Management363524 -Node: Error Recovery365908 -Node: Context Dependency371188 -Node: Semantic Tokens372045 -Node: Lexical Tie-ins375121 -Node: Tie-in Recovery376577 -Node: Debugging378709 -Node: Counterexamples380174 -Node: Understanding386180 -Ref: state-8392904 -Node: Graphviz398455 -Node: Xml402776 -Node: Tracing404514 -Node: Enabling Traces404891 -Node: Mfcalc Traces409019 -Node: Invocation414230 -Node: Bison Options416336 -Node: Operation Modes417183 -Node: Diagnostics422900 -Ref: Wconflicts-sr423208 -Ref: Wconflicts-rr423232 -Ref: Wcounterexamples423620 -Ref: Wdangling-alias423933 -Ref: Wdeprecated425263 -Ref: Wempty-rule425387 -Ref: Wmidrule-values425599 -Ref: Wprecedence426310 -Ref: Wyacc427444 -Ref: Wother427506 -Ref: Wall427810 -Ref: Wnone427930 -Ref: Werror428206 -Node: Tuning the Parser430013 -Ref: option-yacc433427 -Ref: Tuning the Parser-Footnote-1435280 -Node: Output Files435346 -Node: Option Cross Key438623 -Node: Yacc Library440761 -Node: Other Languages441834 -Node: C++ Parsers442459 -Node: A Simple C++ Example443188 -Ref: A Simple C++ Example-Footnote-1447342 -Node: C++ Bison Interface447425 -Node: C++ Parser Interface449015 -Node: C++ Semantic Values453602 -Node: C++ Unions454152 -Node: C++ Variants454945 -Node: C++ Location Values458718 -Node: C++ position459657 -Node: C++ location462026 -Node: Exposing the Location Classes464216 -Node: User Defined Location Type466115 -Node: C++ Parser Context467694 -Node: C++ Scanner Interface471661 -Node: Split Symbols472229 -Node: Complete Symbols473964 -Node: A Complete C++ Example478719 -Node: Calc++ --- C++ Calculator479662 -Node: Calc++ Parsing Driver480183 -Node: Calc++ Parser483150 -Node: Calc++ Scanner487273 -Node: Calc++ Top Level491228 -Node: D Parsers491927 -Node: D Bison Interface492631 -Node: D Semantic Values493744 -Node: D Location Values494577 -Node: D Parser Interface495448 -Node: D Parser Context Interface500364 -Node: D Scanner Interface501807 -Node: D Action Features504747 -Node: D Push Parser Interface505516 -Node: D Complete Symbols506992 -Node: Java Parsers507708 -Node: Java Bison Interface508524 -Node: Java Semantic Values510715 -Node: Java Location Values512412 -Node: Java Parser Interface514010 -Node: Java Parser Context Interface519267 -Node: Java Scanner Interface521352 -Node: Java Action Features525424 -Node: Java Push Parser Interface528175 -Node: Java Differences531170 -Ref: Java Differences-Footnote-1533833 -Node: Java Declarations Summary533987 -Node: History539020 -Node: Yacc539476 -Ref: Yacc-Footnote-1540972 -Ref: Yacc-Footnote-2541203 -Node: yacchack541273 -Node: Byacc541700 -Node: Bison542519 -Node: Other Ungulates544537 -Node: Versioning545127 -Node: FAQ548550 -Node: Memory Exhausted549577 -Node: How Can I Reset the Parser549879 -Node: Strings are Destroyed552473 -Node: Implementing Gotos/Loops554178 -Node: Multiple start-symbols555471 -Node: Secure? Conform?557051 -Node: Enabling Relocatability557505 -Node: I can't build Bison560429 -Node: Where can I find help?561701 -Node: Bug Reports562496 -Node: More Languages563975 -Node: Beta Testing564312 -Node: Mailing Lists565188 -Node: Table of Symbols565400 -Node: Glossary582432 -Node: GNU Free Documentation License592794 -Node: Bibliography618148 -Ref: Corbett 1984618288 -Ref: Denny 2008618638 -Ref: Denny 2010 May618964 -Ref: Denny 2010 November619239 -Ref: DeRemer 1982619577 -Ref: Isradisaikul 2015619849 -Ref: Johnson 1978620178 -Ref: Knuth 1965620447 -Ref: Scott 2000620683 -Node: Index of Terms621000 +Node: Top1040 +Node: Introduction18154 +Node: Conditions19727 +Node: Copying21636 +Node: Concepts59175 +Node: Language and Grammar60367 +Node: Grammar in Bison66345 +Node: Semantic Values68261 +Node: Semantic Actions70389 +Node: GLR Parsers71566 +Node: Simple GLR Parsers74339 +Node: Merging GLR Parses80810 +Ref: Merging GLR Parses-Footnote-186139 +Node: GLR Semantic Actions86280 +Node: Semantic Predicates88877 +Node: Locations91330 +Node: Bison Parser92808 +Node: Stages96001 +Node: Grammar Layout97226 +Node: Examples98588 +Node: RPN Calc100075 +Ref: RPN Calc-Footnote-1101127 +Node: Rpcalc Declarations101205 +Node: Rpcalc Rules103257 +Node: Rpcalc Input105148 +Node: Rpcalc Line106714 +Node: Rpcalc Exp107862 +Node: Rpcalc Lexer109871 +Node: Rpcalc Main112564 +Node: Rpcalc Error112975 +Node: Rpcalc Generate114003 +Node: Rpcalc Compile115247 +Node: Infix Calc116211 +Ref: Infix Calc-Footnote-1119054 +Node: Simple Error Recovery119207 +Node: Location Tracking Calc121142 +Node: Ltcalc Declarations121842 +Node: Ltcalc Rules122937 +Node: Ltcalc Lexer124777 +Node: Multi-function Calc127114 +Ref: Multi-function Calc-Footnote-1128891 +Node: Mfcalc Declarations128969 +Node: Mfcalc Rules130993 +Node: Mfcalc Symbol Table132271 +Node: Mfcalc Lexer135731 +Node: Mfcalc Main138304 +Node: Exercises139180 +Node: Grammar File139707 +Node: Grammar Outline140557 +Node: Prologue141415 +Node: Prologue Alternatives143214 +Ref: Prologue Alternatives-Footnote-1152898 +Node: Bison Declarations153003 +Node: Grammar Rules153413 +Node: Epilogue153869 +Node: Symbols154920 +Node: Rules161943 +Node: Rules Syntax162258 +Node: Empty Rules164323 +Node: Recursion165410 +Node: Semantics167068 +Node: Value Type168374 +Node: Multiple Types169658 +Node: Type Generation171108 +Node: Union Decl173038 +Node: Structured Value Type174431 +Node: Actions175457 +Node: Action Types179329 +Node: Midrule Actions180682 +Node: Using Midrule Actions181336 +Node: Typed Midrule Actions184873 +Node: Midrule Action Translation186421 +Node: Midrule Conflicts188913 +Node: Tracking Locations191522 +Node: Location Type192254 +Node: Actions and Locations193777 +Node: Printing Locations196159 +Node: Location Default Action196919 +Node: Named References200452 +Node: Declarations203048 +Node: Require Decl204735 +Node: Token Decl205249 +Node: Precedence Decl208162 +Node: Type Decl210438 +Node: Symbol Decls211389 +Node: Initial Action Decl212344 +Node: Destructor Decl213157 +Node: Printer Decl218801 +Node: Expect Decl221070 +Node: Start Decl225067 +Node: Pure Decl225461 +Node: Push Decl227209 +Node: Decl Summary231642 +Ref: %header234319 +Node: %define Summary242648 +Ref: api-filename-type244557 +Ref: api-token-prefix255495 +Node: %code Summary267498 +Node: Multiple Parsers271750 +Node: Interface275605 +Node: Parser Function276712 +Node: Push Parser Interface279203 +Ref: yypstate_new279588 +Ref: yypstate_delete280029 +Ref: yypush_parse280443 +Ref: yypull_parse281455 +Node: Lexical282458 +Node: Calling Convention284033 +Node: Special Tokens285562 +Node: Tokens from Literals286997 +Node: Token Values288078 +Node: Token Locations289242 +Node: Pure Calling290174 +Node: Error Reporting292771 +Node: Error Reporting Function293294 +Node: Syntax Error Reporting Function296664 +Node: Action Features301265 +Node: Internationalization305605 +Node: Enabling I18n306457 +Node: Token I18n308567 +Node: Algorithm309958 +Node: Lookahead312372 +Node: Shift/Reduce314582 +Node: Precedence318637 +Node: Why Precedence319409 +Node: Using Precedence321324 +Node: Precedence Only322820 +Node: Precedence Examples324622 +Node: How Precedence325146 +Node: Non Operators326287 +Node: Contextual Precedence327848 +Node: Parser States329590 +Node: Reduce/Reduce330839 +Node: Mysterious Conflicts335642 +Node: Tuning LR339264 +Node: LR Table Construction340464 +Node: Default Reductions346076 +Node: LAC350863 +Node: Unreachable States356363 +Node: Generalized LR Parsing358366 +Node: Memory Management362744 +Node: Error Recovery365128 +Node: Context Dependency370404 +Node: Semantic Tokens371257 +Node: Lexical Tie-ins374325 +Node: Tie-in Recovery375781 +Node: Debugging377911 +Node: Counterexamples379374 +Node: Understanding385376 +Ref: state-8392088 +Node: Graphviz397639 +Node: Xml401956 +Node: Tracing403694 +Node: Enabling Traces404067 +Node: Mfcalc Traces408193 +Node: Invocation413400 +Node: Bison Options415502 +Node: Operation Modes416349 +Node: Diagnostics422058 +Ref: Wconflicts-sr422366 +Ref: Wconflicts-rr422390 +Ref: Wcounterexamples422778 +Ref: Wdangling-alias423091 +Ref: Wdeprecated424416 +Ref: Wempty-rule424540 +Ref: Wmidrule-values424752 +Ref: Wprecedence425463 +Ref: Wyacc426597 +Ref: Wother426659 +Ref: Wall426963 +Ref: Wnone427083 +Ref: Werror427359 +Node: Tuning the Parser429164 +Ref: option-yacc432576 +Ref: Tuning the Parser-Footnote-1434425 +Node: Output Files434491 +Node: Option Cross Key437760 +Node: Yacc Library439898 +Node: Other Languages440965 +Node: C++ Parsers441588 +Node: A Simple C++ Example442317 +Ref: A Simple C++ Example-Footnote-1446467 +Node: C++ Bison Interface446550 +Node: C++ Parser Interface448140 +Node: C++ Semantic Values452723 +Node: C++ Unions453273 +Node: C++ Variants454066 +Node: C++ Location Values457827 +Node: C++ position458766 +Node: C++ location461135 +Node: Exposing the Location Classes463325 +Node: User Defined Location Type465218 +Node: C++ Parser Context466797 +Node: C++ Scanner Interface470760 +Node: Split Symbols471328 +Node: Complete Symbols473063 +Node: A Complete C++ Example477814 +Node: Calc++ --- C++ Calculator478757 +Node: Calc++ Parsing Driver479278 +Node: Calc++ Parser482241 +Node: Calc++ Scanner486356 +Node: Calc++ Top Level490299 +Node: D Parsers490998 +Node: D Bison Interface491702 +Node: D Semantic Values492815 +Node: D Location Values493646 +Node: D Parser Interface494517 +Node: D Parser Context Interface499433 +Node: D Scanner Interface500876 +Node: D Action Features503816 +Node: D Push Parser Interface504585 +Node: D Complete Symbols506059 +Node: Java Parsers506775 +Node: Java Bison Interface507591 +Node: Java Semantic Values509774 +Node: Java Location Values511469 +Node: Java Parser Interface513067 +Node: Java Parser Context Interface518322 +Node: Java Scanner Interface520407 +Node: Java Action Features524479 +Node: Java Push Parser Interface527230 +Node: Java Differences530223 +Ref: Java Differences-Footnote-1532886 +Node: Java Declarations Summary533040 +Node: History538073 +Node: Yacc538529 +Ref: Yacc-Footnote-1540022 +Ref: Yacc-Footnote-2540245 +Node: yacchack540315 +Node: Byacc540738 +Node: Bison541551 +Node: Other Ungulates543559 +Node: Versioning544139 +Node: FAQ547562 +Node: Memory Exhausted548589 +Node: How Can I Reset the Parser548891 +Node: Strings are Destroyed551483 +Node: Implementing Gotos/Loops553184 +Node: Multiple start-symbols554475 +Node: Secure? Conform?556055 +Node: Enabling Relocatability556505 +Node: I can't build Bison559423 +Node: Where can I find help?560683 +Node: Bug Reports561476 +Node: More Languages562951 +Node: Beta Testing563286 +Node: Mailing Lists564160 +Node: Table of Symbols564372 +Node: Glossary581398 +Node: GNU Free Documentation License591676 +Node: Bibliography616829 +Ref: Corbett 1984616969 +Ref: Denny 2008617320 +Ref: Denny 2010 May617642 +Ref: Denny 2010 November617917 +Ref: DeRemer 1982618253 +Ref: Isradisaikul 2015618523 +Ref: Johnson 1978618848 +Ref: Knuth 1965619113 +Ref: Scott 2000619347 +Node: Index of Terms619664  End Tag Table diff --git a/local/recipes/dev/bison/source/doc/bison.info.bak b/local/recipes/dev/bison/source/doc/bison.info.bak index 4f4fb08267..2e0fd584cd 100644 --- a/local/recipes/dev/bison/source/doc/bison.info.bak +++ b/local/recipes/dev/bison/source/doc/bison.info.bak @@ -1,22 +1,22 @@ -This is bison.info, produced by makeinfo version 6.8 from bison.texi. +This is bison.info, produced by makeinfo version 7.3 from bison.texi. -This manual (12 September 2021) is for GNU Bison (version 3.8.2), the -GNU parser generator. +This manual (5 July 2026) is for GNU Bison (version 3.8.2), the GNU +parser generator. - Copyright © 1988–1993, 1995, 1998–2015, 2018–2021 Free Software + Copyright © 1988-1993, 1995, 1998-2015, 2018-2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover texts - being “A GNU Manual,” and with the Back-Cover Texts as in (a) + being "A GNU Manual," and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled - “GNU Free Documentation License.” + "GNU Free Documentation License." - (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and + (a) The FSF's Back-Cover Text is: "You have the freedom to copy and modify this GNU manual. Buying copies from the FSF supports it in - developing GNU and promoting software freedom.” + developing GNU and promoting software freedom." INFO-DIR-SECTION Software development START-INFO-DIR-ENTRY * bison: (bison). GNU parser generator (Yacc replacement). @@ -28,23 +28,23 @@ File: bison.info, Node: Top, Next: Introduction, Up: (dir) Bison ***** -This manual (12 September 2021) is for GNU Bison (version 3.8.2), the -GNU parser generator. +This manual (5 July 2026) is for GNU Bison (version 3.8.2), the GNU +parser generator. - Copyright © 1988–1993, 1995, 1998–2015, 2018–2021 Free Software + Copyright © 1988-1993, 1995, 1998-2015, 2018-2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover texts - being “A GNU Manual,” and with the Back-Cover Texts as in (a) + being "A GNU Manual," and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled - “GNU Free Documentation License.” + "GNU Free Documentation License." - (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and + (a) The FSF's Back-Cover Text is: "You have the freedom to copy and modify this GNU manual. Buying copies from the FSF supports it in - developing GNU and promoting software freedom.” + developing GNU and promoting software freedom." * Menu: @@ -76,20 +76,20 @@ Reference sections: * Bibliography:: Publications cited in this manual. * Index of Terms:: Cross-references to the text. - — The Detailed Node Listing — + -- The Detailed Node Listing -- The Concepts of Bison * Language and Grammar:: Languages and context-free grammars, as mathematical ideas. -* Grammar in Bison:: How we represent grammars for Bison’s sake. +* Grammar in Bison:: How we represent grammars for Bison's sake. * Semantic Values:: Each token or syntactic grouping can have a semantic value (the value of an integer, the name of an identifier, etc.). * Semantic Actions:: Each rule can have an action containing C code. * GLR Parsers:: Writing parsers for general context-free languages. * Locations:: Overview of location tracking. -* Bison Parser:: What are Bison’s input and output, +* Bison Parser:: What are Bison's input and output, how is the output used? * Stages:: Stages in writing and running Bison grammars. * Grammar Layout:: Overall structure of a Bison grammar file. @@ -211,7 +211,7 @@ Bison Declarations * Pure Decl:: Requesting a reentrant parser. * Push Decl:: Requesting a push parser. * Decl Summary:: Table of all Bison declarations. -* %define Summary:: Defining variables to adjust Bison’s behavior. +* %define Summary:: Defining variables to adjust Bison's behavior. * %code Summary:: Inserting code into the parser source. Parser C-Language Interface @@ -222,7 +222,7 @@ Parser C-Language Interface which reads tokens. * Error Reporting:: Passing error messages to the user. * Action Features:: Special features for use in actions. -* Internationalization:: How to let the parser speak in the user’s +* Internationalization:: How to let the parser speak in the user's native language. The Lexical Analyzer Function ‘yylex’ @@ -253,7 +253,7 @@ The Bison Parser Algorithm * Lookahead:: Parser looks one token ahead when deciding what to do. * Shift/Reduce:: Conflicts: when either shifting or reduction is valid. * Precedence:: Operator precedence works by resolving conflicts. -* Contextual Precedence:: When an operator’s precedence depends on context. +* Contextual Precedence:: When an operator's precedence depends on context. * Parser States:: The parser is a finite-state-machine with stack. * Reduce/Reduce:: When two rules are applicable in the same situation. * Mysterious Conflicts:: Conflicts that look unjustified. @@ -401,7 +401,6 @@ Copying This Manual * GNU Free Documentation License:: Copying and sharing this manual -  File: bison.info, Node: Introduction, Next: Conditions, Prev: Top, Up: Top @@ -423,7 +422,7 @@ understand this manual. We begin with tutorial chapters that explain the basic concepts of using Bison and show three explained examples, each building on the -last. If you don’t know Bison or Yacc, start by reading these chapters. +last. If you don't know Bison or Yacc, start by reading these chapters. Reference chapters follow, which describe specific aspects of Bison in detail. @@ -454,24 +453,24 @@ software. The reason Bison was different was not due to a special policy decision; it resulted from applying the usual General Public License to all of the Bison source code. - The main output of the Bison utility—the Bison parser implementation -file—contains a verbatim copy of a sizable piece of Bison, which is the -code for the parser’s implementation. (The actions from your grammar + The main output of the Bison utility--the Bison parser implementation +file--contains a verbatim copy of a sizable piece of Bison, which is the +code for the parser's implementation. (The actions from your grammar are inserted into this implementation at one point, but most of the rest of the implementation is not changed.) When we applied the GPL terms to -the skeleton code for the parser’s implementation, the effect was to +the skeleton code for the parser's implementation, the effect was to restrict the use of Bison output to free software. - We didn’t change the terms because of sympathy for people who want to + We didn't change the terms because of sympathy for people who want to make software proprietary. *Software should be free.* But we concluded -that limiting Bison’s use to free software was doing little to encourage +that limiting Bison's use to free software was doing little to encourage people to make other software free. So we decided to make the practical conditions for using Bison match the practical conditions for using the other GNU tools. This exception applies when Bison is generating code for a parser. You can tell whether the exception applies to a Bison output file by -inspecting the file for text beginning with “As a special exception...”. +inspecting the file for text beginning with "As a special exception...". The text spells out the exact terms of the exception.  @@ -496,7 +495,7 @@ and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program—to make sure it remains free +share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to @@ -524,16 +523,16 @@ know their rights. (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. - For the developers’ and authors’ protection, the GPL clearly explains -that there is no warranty for this free software. For both users’ and -authors’ sake, the GPL requires that modified versions be marked as + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of -protecting users’ freedom to change the software. The systematic +protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those @@ -556,25 +555,25 @@ TERMS AND CONDITIONS 0. Definitions. - “This License” refers to version 3 of the GNU General Public + "This License" refers to version 3 of the GNU General Public License. - “Copyright” also means copyright-like laws that apply to other + "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. - “The Program” refers to any copyrightable work licensed under this - License. Each licensee is addressed as “you”. “Licensees” and - “recipients” may be individuals or organizations. + "The Program" refers to any copyrightable work licensed under this + License. Each licensee is addressed as "you". "Licensees" and + "recipients" may be individuals or organizations. - To “modify” a work means to copy from or adapt all or part of the + To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the - making of an exact copy. The resulting work is called a “modified - version” of the earlier work or a work “based on” the earlier work. + making of an exact copy. The resulting work is called a "modified + version" of the earlier work or a work "based on" the earlier work. - A “covered work” means either the unmodified Program or a work + A "covered work" means either the unmodified Program or a work based on the Program. - To “propagate” a work means to do anything with it that, without + To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes @@ -582,12 +581,12 @@ TERMS AND CONDITIONS available to the public, and in some countries other activities as well. - To “convey” a work means any kind of propagation that enables other + To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. - An interactive user interface displays “Appropriate Legal Notices” + An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to @@ -599,33 +598,33 @@ TERMS AND CONDITIONS 1. Source Code. - The “source code” for a work means the preferred form of the work - for making modifications to it. “Object code” means any non-source + The "source code" for a work means the preferred form of the work + for making modifications to it. "Object code" means any non-source form of a work. - A “Standard Interface” means an interface that either is an + A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. - The “System Libraries” of an executable work include anything, + The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code - form. A “Major Component”, in this context, means a major + form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. - The “Corresponding Source” for a work in object code form means all + The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the - work’s System Libraries, or general-purpose tools or generally + work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated @@ -669,7 +668,7 @@ TERMS AND CONDITIONS the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. - 3. Protecting Users’ Legal Rights From Anti-Circumvention Law. + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under @@ -682,12 +681,12 @@ TERMS AND CONDITIONS circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of - enforcing, against the work’s users, your or third parties’ legal + enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. - You may convey verbatim copies of the Program’s source code as you + You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any @@ -711,7 +710,7 @@ TERMS AND CONDITIONS b. The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in - section 4 to “keep intact all notices”. + section 4 to "keep intact all notices". c. You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This @@ -731,9 +730,9 @@ TERMS AND CONDITIONS works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is - called an “aggregate” if the compilation and its resulting + called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the - compilation’s users beyond what the individual works permit. + compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. @@ -791,13 +790,13 @@ TERMS AND CONDITIONS excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. - A “User Product” is either (1) a “consumer product”, which means + A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, - “normally used” refers to a typical or common use of that class of + "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product @@ -805,7 +804,7 @@ TERMS AND CONDITIONS industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. - “Installation Information” for a User Product means any methods, + "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. @@ -841,7 +840,7 @@ TERMS AND CONDITIONS 7. Additional Terms. - “Additional permissions” are terms that supplement the terms of + "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in @@ -886,8 +885,8 @@ TERMS AND CONDITIONS the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. - All other non-permissive additional terms are considered “further - restrictions” within the meaning of section 10. If the Program as + All other non-permissive additional terms are considered "further + restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document @@ -953,12 +952,12 @@ TERMS AND CONDITIONS responsible for enforcing compliance by third parties with this License. - An “entity transaction” is a transaction transferring control of an + An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever - licenses to the work the party’s predecessor in interest had or + licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable @@ -975,31 +974,31 @@ TERMS AND CONDITIONS 11. Patents. - A “contributor” is a copyright holder who authorizes use under this + A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. - The work thus licensed is called the contributor’s “contributor - version”. + The work thus licensed is called the contributor's "contributor + version". - A contributor’s “essential patent claims” are all patent claims + A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the - contributor version. For purposes of this definition, “control” + contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, - royalty-free patent license under the contributor’s essential + royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. - In the following three paragraphs, a “patent license” is any + In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a - patent or covenant not to sue for patent infringement). To “grant” + patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. @@ -1012,9 +1011,9 @@ TERMS AND CONDITIONS yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream - recipients. “Knowingly relying” means you have actual knowledge + recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work - in a country, or your recipient’s use of the covered work in a + in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. @@ -1026,7 +1025,7 @@ TERMS AND CONDITIONS patent license you grant is automatically extended to all recipients of the covered work and works based on it. - A patent license is “discriminatory” if it does not include within + A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a @@ -1046,7 +1045,7 @@ TERMS AND CONDITIONS any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. - 12. No Surrender of Others’ Freedom. + 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they @@ -1079,7 +1078,7 @@ TERMS AND CONDITIONS Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU - General Public License “or any later version” applies to it, you + General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version @@ -1088,7 +1087,7 @@ TERMS AND CONDITIONS If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that - proxy’s public statement of acceptance of a version permanently + proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different @@ -1100,7 +1099,7 @@ TERMS AND CONDITIONS THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE - COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” + COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE @@ -1144,7 +1143,7 @@ terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the -“copyright” line and a pointer to where the full notice is found. +"copyright" line and a pointer to where the full notice is found. ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. Copyright (C) YEAR NAME OF AUTHOR @@ -1175,11 +1174,11 @@ notice like this when it starts in an interactive mode: The hypothetical commands ‘show w’ and ‘show c’ should show the appropriate parts of the General Public License. Of course, your -program’s commands might be different; for a GUI interface, you would -use an “about box”. +program's commands might be different; for a GUI interface, you would +use an "about box". You should also get your employer (if you work as a programmer) or -school, if any, to sign a “copyright disclaimer” for the program, if +school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . @@ -1205,14 +1204,14 @@ carefully. * Language and Grammar:: Languages and context-free grammars, as mathematical ideas. -* Grammar in Bison:: How we represent grammars for Bison’s sake. +* Grammar in Bison:: How we represent grammars for Bison's sake. * Semantic Values:: Each token or syntactic grouping can have a semantic value (the value of an integer, the name of an identifier, etc.). * Semantic Actions:: Each rule can have an action containing C code. * GLR Parsers:: Writing parsers for general context-free languages. * Locations:: Overview of location tracking. -* Bison Parser:: What are Bison’s input and output, +* Bison Parser:: What are Bison's input and output, how is the output used? * Stages:: Stages in writing and running Bison grammars. * Grammar Layout:: Overall structure of a Bison grammar file. @@ -1227,14 +1226,14 @@ In order for Bison to parse a language, it must be described by a “context-free grammar”. This means that you specify one or more “syntactic groupings” and give rules for constructing them from their parts. For example, in the C language, one kind of grouping is called -an ‘expression’. One rule for making an expression might be, “An -expression can be made of a minus sign and another expression”. Another -would be, “An expression can be an integer”. As you can see, rules are +an 'expression'. One rule for making an expression might be, "An +expression can be made of a minus sign and another expression". Another +would be, "An expression can be an integer". As you can see, rules are often recursive, but there must be at least one rule which leads out of the recursion. The most common formal system for presenting such rules for humans to -read is “Backus-Naur Form” or “BNF”, which was developed in order to +read is “Backus-Naur Form” or "BNF", which was developed in order to specify the language Algol 60. Any grammar expressed in BNF is a context-free grammar. The input to Bison is essentially machine-readable BNF. @@ -1259,14 +1258,14 @@ rules to get the same inputs. Even unambiguous grammars can be “nondeterministic”, meaning that no fixed lookahead always suffices to determine the next grammar rule to apply. With the proper declarations, Bison is also able to parse these more general context-free grammars, -using a technique known as GLR parsing (for Generalized LR). Bison’s GLR +using a technique known as GLR parsing (for Generalized LR). Bison's GLR parsers are able to handle any context-free grammar for which the number of possible parses of any given string is finite. In the formal grammatical rules for a language, each kind of syntactic unit or grouping is named by a “symbol”. Those which are built by grouping smaller constructs according to grammatical rules are -called “nonterminal symbols”; those which can’t be subdivided are called +called “nonterminal symbols”; those which can't be subdivided are called “terminal symbols” or “token kinds”. We call a piece of input corresponding to a single terminal symbol a “token”, and a piece corresponding to a single nonterminal symbol a “grouping”. @@ -1275,26 +1274,26 @@ corresponding to a single nonterminal symbol a “grouping”. nonterminal, mean. The tokens of C are identifiers, constants (numeric and string), and the various keywords, arithmetic operators and punctuation marks. So the terminal symbols of a grammar for C include -‘identifier’, ‘number’, ‘string’, plus one symbol for each keyword, -operator or punctuation mark: ‘if’, ‘return’, ‘const’, ‘static’, ‘int’, -‘char’, ‘plus-sign’, ‘open-brace’, ‘close-brace’, ‘comma’ and many more. +'identifier', 'number', 'string', plus one symbol for each keyword, +operator or punctuation mark: 'if', 'return', 'const', 'static', 'int', +'char', 'plus-sign', 'open-brace', 'close-brace', 'comma' and many more. (These tokens can be subdivided into characters, but that is a matter of lexicography, not grammar.) Here is a simple C function subdivided into tokens: - int /* keyword ‘int’ */ - square (int x) /* identifier, open-paren, keyword ‘int’, + int /* keyword 'int' */ + square (int x) /* identifier, open-paren, keyword 'int', identifier, close-paren */ { /* open-brace */ - return x * x; /* keyword ‘return’, identifier, asterisk, + return x * x; /* keyword 'return', identifier, asterisk, identifier, semicolon */ } /* close-brace */ The syntactic groupings of C include the expression, the statement, the declaration, and the function definition. These are represented in -the grammar of C by nonterminal symbols ‘expression’, ‘statement’, -‘declaration’ and ‘function definition’. The full grammar uses dozens +the grammar of C by nonterminal symbols 'expression', 'statement', +'declaration' and 'function definition'. The full grammar uses dozens of additional language constructs, each with its own nonterminal symbol, in order to express the meanings of these four. The example above is a function definition; it contains one declaration, and one statement. In @@ -1305,28 +1304,28 @@ made out of simpler constructs. For example, one kind of C statement is the ‘return’ statement; this would be described with a grammar rule which reads informally as follows: - A ‘statement’ can be made of a ‘return’ keyword, an ‘expression’ - and a ‘semicolon’. + A 'statement' can be made of a 'return' keyword, an 'expression' + and a 'semicolon'. -There would be many other rules for ‘statement’, one for each kind of +There would be many other rules for 'statement', one for each kind of statement in C. One nonterminal symbol must be distinguished as the special one which defines a complete utterance in the language. It is called the “start symbol”. In a compiler, this means a complete input program. In the C -language, the nonterminal symbol ‘sequence of definitions and -declarations’ plays this role. +language, the nonterminal symbol 'sequence of definitions and +declarations' plays this role. - For example, ‘1 + 2’ is a valid C expression—a valid part of a C -program—but it is not valid as an _entire_ C program. In the -context-free grammar of C, this follows from the fact that ‘expression’ + For example, ‘1 + 2’ is a valid C expression--a valid part of a C +program--but it is not valid as an _entire_ C program. In the +context-free grammar of C, this follows from the fact that 'expression' is not the start symbol. The Bison parser reads a sequence of tokens as its input, and groups the tokens using the grammar rules. If the input is valid, the end result is that the entire token sequence reduces to a single grouping -whose symbol is the grammar’s start symbol. If we use a grammar for C, -the entire input must be a ‘sequence of definitions and declarations’. +whose symbol is the grammar's start symbol. If we use a grammar for C, +the entire input must be a 'sequence of definitions and declarations'. If not, the parser reports a syntax error.  @@ -1378,7 +1377,7 @@ File: bison.info, Node: Semantic Values, Next: Semantic Actions, Prev: Gramma =================== A formal grammar selects tokens only by their classifications: for -example, if a rule mentions the terminal symbol ‘integer constant’, it +example, if a rule mentions the terminal symbol 'integer constant', it means that _any_ integer constant is grammatically valid in that position. The precise value of the constant is irrelevant to how to parse the input: if ‘x+4’ is grammatical then ‘x+1’ or ‘x+3989’ is @@ -1398,7 +1397,7 @@ kinds. The semantic value has all the rest of the information about the meaning of the token, such as the value of an integer, or the name of an -identifier. (A token such as ‘','’ which is just punctuation doesn’t +identifier. (A token such as ‘','’ which is just punctuation doesn't need to have any semantic value.) For example, an input token might be classified as token kind @@ -1406,7 +1405,7 @@ need to have any semantic value.) the same token kind ‘INTEGER’ but value 3989. When a grammar rule says that ‘INTEGER’ is allowed, either of these tokens is acceptable because each is an ‘INTEGER’. When the parser accepts the token, it keeps track -of the token’s semantic value. +of the token's semantic value. Each grouping can also have a semantic value as well as its nonterminal symbol. For example, in a calculator, an expression @@ -1448,7 +1447,7 @@ File: bison.info, Node: GLR Parsers, Next: Locations, Prev: Semantic Actions, 1.5 Writing GLR Parsers ======================= -In some grammars, Bison’s deterministic LR(1) parsing algorithm cannot +In some grammars, Bison's deterministic LR(1) parsing algorithm cannot decide whether to apply a certain grammar rule at a given point. That is, it may not be able to decide (on the basis of the input read so far) which of two possible reductions (applications of a grammar rule) @@ -1534,7 +1533,7 @@ become a new identifier to represent the enumeration value, while in the former case ‘a’ must be evaluated with its current meaning, which may be a constant or even a function call. - You could parse ‘(a)’ as an “unspecified identifier in parentheses”, + You could parse ‘(a)’ as an "unspecified identifier in parentheses", to be resolved later, but this typically requires substantial contortions in both semantic actions and large parts of the grammar, where the parentheses are nested in the recursive rules for expressions. @@ -1542,7 +1541,7 @@ where the parentheses are nested in the recursive rules for expressions. You might think of using the lexer to distinguish between the two forms by returning different tokens for currently defined and undefined identifiers. But if these declarations occur in a local scope, and ‘a’ -is defined in an outer scope, then both forms are possible—either +is defined in an outer scope, then both forms are possible--either locally redefining ‘a’, or using the value of ‘a’ from the outer scope. So this approach cannot work. @@ -1560,7 +1559,7 @@ split. If the input is syntactically incorrect, both branches fail and the parser reports a syntax error as usual. - The effect of all this is that the parser seems to “guess” the + The effect of all this is that the parser seems to "guess" the correct branch to take, or in other words, it seems to use more lookahead than the underlying LR(1) algorithm actually allows for. In this example, LR(2) would suffice, but also some cases that are not @@ -1652,7 +1651,7 @@ File: bison.info, Node: Merging GLR Parses, Next: GLR Semantic Actions, Prev: 1.5.2 Using GLR to Resolve Ambiguities -------------------------------------- -Let’s consider an example, vastly simplified from a C++ grammar.(1) +Let's consider an example, vastly simplified from a C++ grammar.(1) %{ #include @@ -1701,7 +1700,7 @@ Let’s consider an example, vastly simplified from a C++ grammar.(1) | '(' declarator ')' ; -This models a problematic part of the C++ grammar—the ambiguity between +This models a problematic part of the C++ grammar--the ambiguity between certain declarations and statements. For example, T (x) = y+z; @@ -1713,10 +1712,10 @@ ID’, which it cannot resolve at the time it encounters ‘x’ in the example above. Since this is a GLR parser, it therefore splits the problem into two parses, one for each choice of resolving the reduce/reduce conflict. Unlike the example from the previous section -(*note Simple GLR Parsers::), however, neither of these parses “dies,” +(*note Simple GLR Parsers::), however, neither of these parses "dies," because the grammar as it stands is ambiguous. One of the parsers eventually reduces ‘stmt : expr ';'’ and the other reduces ‘stmt : -decl’, after which both parsers are in an identical state: they’ve seen +decl’, after which both parsers are in an identical state: they've seen ‘prog stmt’ and have the same unprocessed input remaining. We say that these parses have “merged.” @@ -1834,11 +1833,11 @@ features you might use in a semantic action in a GLR parser. kind of the lookahead token present at the time of the associated reduction. After checking that ‘yychar’ is not set to ‘YYEMPTY’ or ‘YYEOF’, you can then examine ‘yylval’ and ‘yylloc’ to determine the -lookahead token’s semantic value and location, if any. In a nondeferred +lookahead token's semantic value and location, if any. In a nondeferred semantic action, you can also modify any of these variables to influence syntax analysis. *Note Lookahead::. - In a deferred semantic action, it’s too late to influence syntax + In a deferred semantic action, it's too late to influence syntax analysis. In this case, ‘yychar’, ‘yylval’, and ‘yylloc’ are set to shallow copies of the values they had at the time of the associated reduction. For this reason alone, modifying them is dangerous. @@ -1967,14 +1966,14 @@ distinct programs: the Bison utility is a program whose output is the Bison parser implementation file that becomes part of your program. The job of the Bison parser is to group tokens into groupings -according to the grammar rules—for example, to build identifiers and +according to the grammar rules--for example, to build identifiers and operators into expressions. As it does this, it runs the actions for the grammar rules it uses. The tokens come from a function called the “lexical analyzer” that you must supply in some fashion (such as by writing it in C). The Bison parser calls the lexical analyzer each time it wants a new token. It -doesn’t know what is “inside” the tokens (though their semantic values +doesn't know what is "inside" the tokens (though their semantic values may reflect this). Typically the lexical analyzer makes the tokens by parsing characters of text, but Bison does not depend on this. *Note Lexical::. @@ -2092,9 +2091,9 @@ File: bison.info, Node: Examples, Next: Grammar File, Prev: Concepts, Up: To Now we show and explain several sample programs written using Bison: a Reverse Polish Notation calculator, an algebraic (infix) notation -calculator — later extended to track “locations” — and a multi-function -calculator. All produce usable, though limited, interactive desk-top -calculators. +calculator -- later extended to track "locations" -- and a +multi-function calculator. All produce usable, though limited, +interactive desk-top calculators. These examples are simple, but Bison grammars for real programming languages are written the same way. You can copy these examples into a @@ -2188,13 +2187,13 @@ about the tokens and their types (*note Bison Declarations::). The ‘%define’ directive defines the variable ‘api.value.type’, thus specifying the C data type for semantic values of both tokens and groupings (*note Value Type::). The Bison parser will use whatever type -‘api.value.type’ is defined as; if you don’t define it, ‘int’ is the +‘api.value.type’ is defined as; if you don't define it, ‘int’ is the default. Because we specify ‘{double}’, each token and each expression has an associated value, which is a floating point number. C code can use ‘YYSTYPE’ to refer to the value ‘api.value.type’. Each terminal symbol that is not a single-character literal must be -declared. (Single-character literals normally don’t need to be +declared. (Single-character literals normally don't need to be declared.) In this example, all the arithmetic operators are designated by single-character literals, so the only terminal symbol that needs to be declared is ‘NUM’, the token kind for numeric constants. @@ -2228,11 +2227,11 @@ Here are the grammar rules for the Reverse Polish Notation calculator. ; %% - The groupings of the rpcalc “language” defined here are the + The groupings of the rpcalc "language" defined here are the expression (given the name ‘exp’), the line of input (‘line’), and the complete input transcript (‘input’). Each of these nonterminal symbols has several alternate rules, joined by the vertical bar ‘|’ which is -read as “or”. The following sections explain what these rules mean. +read as "or". The following sections explain what these rules mean. The semantics of the language is determined by the actions taken when a grouping is recognized. The actions are the C code that appears @@ -2264,25 +2263,25 @@ Consider the definition of ‘input’: | input line ; - This definition reads as follows: “A complete input is either an -empty string, or a complete input followed by an input line”. Notice -that “complete input” is defined in terms of itself. This definition is + This definition reads as follows: "A complete input is either an +empty string, or a complete input followed by an input line". Notice +that "complete input" is defined in terms of itself. This definition is said to be “left recursive” since ‘input’ appears always as the leftmost symbol in the sequence. *Note Recursion::. The first alternative is empty because there are no symbols between the colon and the first ‘|’; this means that ‘input’ can match an empty string of input (no tokens). We write the rules this way because it is -legitimate to type ‘Ctrl-d’ right after you start the calculator. It’s +legitimate to type ‘Ctrl-d’ right after you start the calculator. It's conventional to put an empty alternative first and to use the (optional) ‘%empty’ directive, or to write the comment ‘/* empty */’ in it (*note Empty Rules::). The second alternate rule (‘input line’) handles all nontrivial -input. It means, “After reading any number of lines, read one more line -if possible.” The left recursion makes this rule into a loop. Since the -first alternative matches empty input, the loop can be executed zero or -more times. +input. It means, "After reading any number of lines, read one more line +if possible." The left recursion makes this rule into a loop. Since +the first alternative matches empty input, the loop can be executed zero +or more times. The parser function ‘yyparse’ continues to process input until a grammatical error is seen or the lexical analyzer says there are no more @@ -2313,8 +2312,8 @@ for. This action is unusual because it does not assign a value to ‘$$’. As a consequence, the semantic value associated with the ‘line’ is uninitialized (its value will be unpredictable). This would be a bug if -that value were ever used, but we don’t use it: once rpcalc has printed -the value of the user’s input line, that value is no longer needed. +that value were ever used, but we don't use it: once rpcalc has printed +the value of the user's input line, that value is no longer needed.  File: bison.info, Node: Rpcalc Exp, Prev: Rpcalc Line, Up: Rpcalc Rules @@ -2352,10 +2351,10 @@ associated semantic value, but if it had one you could refer to it as }’. When ‘yyparse’ recognizes a sum expression using this rule, the sum -of the two subexpressions’ values is produced as the value of the entire +of the two subexpressions' values is produced as the value of the entire expression. *Note Actions::. - You don’t have to give an action for every rule. When a rule has no + You don't have to give an action for every rule. When a rule has no action, Bison by default copies the value of ‘$1’ into ‘$$’. This is what happens in the first rule (the one that uses ‘NUM’). @@ -2381,14 +2380,14 @@ File: bison.info, Node: Rpcalc Lexer, Next: Rpcalc Main, Prev: Rpcalc Rules, 2.1.3 The ‘rpcalc’ Lexical Analyzer ----------------------------------- -The lexical analyzer’s job is low-level parsing: converting characters +The lexical analyzer's job is low-level parsing: converting characters or sequences of characters into tokens. The Bison parser gets its tokens by calling the lexical analyzer. *Note Lexical::. Only a simple lexical analyzer is needed for the RPN calculator. This lexical analyzer skips blanks and tabs, then reads in numbers as ‘double’ and returns them as ‘NUM’ tokens. Any other character that -isn’t part of a number is a separate token. Note that the token-code +isn't part of a number is a separate token. Note that the token-code for such a single-character token is the character itself. The return value of the lexical analyzer function is a numeric code @@ -2507,8 +2506,8 @@ command to convert it into a parser implementation file: $ bison FILE.y -In this example, the grammar file is called ‘rpcalc.y’ (for “Reverse -Polish CALCulator”). Bison produces a parser implementation file named +In this example, the grammar file is called ‘rpcalc.y’ (for "Reverse +Polish CALCulator"). Bison produces a parser implementation file named ‘FILE.tab.c’, removing the ‘.y’ from the grammar file name. The parser implementation file contains the source code for ‘yyparse’. The additional functions in the grammar file (‘yylex’, ‘yyerror’ and ‘main’) @@ -2611,7 +2610,7 @@ kinds and says they are left-associative operators. The declarations ‘%left’ and ‘%right’ (right associativity) take the place of ‘%token’ which is used to declare a token kind name without associativity/precedence. (These tokens are single-character literals, -which ordinarily don’t need to be declared. We declare them here to +which ordinarily don't need to be declared. We declare them here to specify the associativity/precedence.) Operator precedence is determined by the line ordering of the @@ -2623,7 +2622,7 @@ matters (‘%precedence’. *Note Precedence::. The other important new feature is the ‘%prec’ in the grammar section for the unary minus operator. The ‘%prec’ simply instructs Bison that -the rule ‘| '-' exp’ has the same precedence as ‘NEG’—in this case the +the rule ‘| '-' exp’ has the same precedence as ‘NEG’--in this case the next-to-highest. *Note Contextual Precedence::. Here is a sample run of ‘calc.y’: @@ -2649,7 +2648,7 @@ File: bison.info, Node: Simple Error Recovery, Next: Location Tracking Calc, ========================= Up to this point, this manual has not addressed the issue of “error -recovery”—how to continue parsing after the parser detects a syntax +recovery”--how to continue parsing after the parser detects a syntax error. All we have handled is error reporting with ‘yyerror’. Recall that by default ‘yyparse’ returns after calling ‘yyerror’. This means that an erroneous input line causes the calculator program to exit. Now @@ -2679,7 +2678,7 @@ other kinds of errors; for example, division by zero, which raises an exception signal that is normally fatal. A real calculator program must handle this signal and use ‘longjmp’ to return to ‘main’ and resume parsing input lines; it would also have to discard the rest of the -current line of input. We won’t discuss this issue further because it +current line of input. We won't discuss this issue further because it is not specific to Bison programs.  @@ -2785,7 +2784,7 @@ the wrong expressions or subexpressions. using the pseudo-variables ‘@N’ for rule components, and the pseudo-variable ‘@$’ for groupings. - We don’t need to assign a value to ‘@$’: the output parser does it + We don't need to assign a value to ‘@$’: the output parser does it automatically. By default, before executing the C code of each action, ‘@$’ is set to range from the beginning of ‘@1’ to the end of ‘@N’, for a rule with N components. This behavior can be redefined (*note @@ -2798,7 +2797,7 @@ File: bison.info, Node: Ltcalc Lexer, Prev: Ltcalc Rules, Up: Location Tracki 2.4.3 The ‘ltcalc’ Lexical Analyzer. ------------------------------------ -Until now, we relied on Bison’s defaults to enable location tracking. +Until now, we relied on Bison's defaults to enable location tracking. The next step is to rewrite the lexical analyzer, and make it able to feed the parser with the token locations, as it already does for semantic values. @@ -2851,7 +2850,7 @@ input text, to avoid the computed locations of being fuzzy or wrong: Basically, the lexical analyzer performs the same processing as before: it skips blanks and tabs, and reads numbers or single-character tokens. In addition, it updates ‘yylloc’, the global variable (of type -‘YYLTYPE’) containing the token’s location. +‘YYLTYPE’) containing the token's location. Now, each time this function returns a token, the parser has its kind as well as its semantic value, and its location in the text. The last @@ -3018,7 +3017,7 @@ File: bison.info, Node: Mfcalc Symbol Table, Next: Mfcalc Lexer, Prev: Mfcalc ------------------------------- The multi-function calculator requires a symbol table to keep track of -the names and meanings of variables and functions. This doesn’t affect +the names and meanings of variables and functions. This doesn't affect the grammar rules (except for the actions) or the Bison declarations, but it requires some additional C functions for support. @@ -3315,7 +3314,7 @@ The PROLOGUE section contains macro definitions and declarations of functions and variables that are used in the actions in the grammar rules. These are copied to the beginning of the parser implementation file so that they precede the definition of ‘yyparse’. You can use -‘#include’ to get the declarations from a header file. If you don’t +‘#include’ to get the declarations from a header file. If you don't need any C declarations, you may omit the ‘%{’ and ‘%}’ delimiters that bracket this section. @@ -3384,9 +3383,9 @@ qualifier can be omitted for the default location, or it can be one of ... -Notice that there are two PROLOGUE sections here, but there’s a subtle +Notice that there are two PROLOGUE sections here, but there's a subtle distinction between their functionality. For example, if you decide to -override Bison’s default definition for ‘YYLTYPE’, in which PROLOGUE +override Bison's default definition for ‘YYLTYPE’, in which PROLOGUE section should you write your new definition?(1) You should write it in the first since Bison will insert that code into the parser implementation file _before_ the default ‘YYLTYPE’ definition. In which @@ -3403,7 +3402,7 @@ Second, what if there is no ‘%union’? In that case, the second kind of PROLOGUE section is not available. This behavior is not intuitive. To avoid this subtle ‘%union’ dependency, rewrite the example using a -‘%code top’ and an unqualified ‘%code’. Let’s go ahead and add the new +‘%code top’ and an unqualified ‘%code’. Let's go ahead and add the new ‘YYLTYPE’ definition and the ‘trace_token’ prototype at the same time: %code top { @@ -3438,7 +3437,7 @@ PROLOGUE section is not available. This behavior is not intuitive. ... In this way, ‘%code top’ and the unqualified ‘%code’ achieve the same -functionality as the two kinds of PROLOGUE sections, but it’s always +functionality as the two kinds of PROLOGUE sections, but it's always explicit which kind you intend. Moreover, both kinds are always available even in the absence of ‘%union’. @@ -3446,7 +3445,7 @@ available even in the absence of ‘%union’. two lines before the warning need to appear near the top of the parser implementation file. The first line after the warning is required by ‘YYSTYPE’ and thus also needs to appear in the parser implementation -file. However, if you’ve instructed Bison to generate a parser header +file. However, if you've instructed Bison to generate a parser header file (*note Decl Summary::), you probably want that line to appear before the ‘YYSTYPE’ definition in that header file as well. The ‘YYLTYPE’ definition should also appear in the parser header file to @@ -3510,7 +3509,7 @@ provide ‘trace_token’ to modules that are external to your parser. Thus, you might wish for Bison to insert the prototype into both the parser header file and the parser implementation file. Since this function is not a dependency required by ‘YYSTYPE’ or ‘YYLTYPE’, it -doesn’t make sense to move its prototype to a ‘%code requires’. More +doesn't make sense to move its prototype to a ‘%code requires’. More importantly, since it depends upon ‘YYLTYPE’ and ‘yytoken_kind_t’, ‘%code requires’ is not sufficient. Instead, move its prototype from the unqualified ‘%code’ to a ‘%code provides’: @@ -3583,7 +3582,7 @@ semantic-type-related directives by semantic type: You could even place each of the above directive groups in the rules section of the grammar file next to the set of rules that uses the associated semantic type. (In the rules section, you must terminate -each of those directives with a semicolon.) And you don’t have to worry +each of those directives with a semicolon.) And you don't have to worry that some directive (like a ‘%union’) in the definitions section is going to adversely affect their functionality in some counter-intuitive manner just because it comes first. Such an organization is not @@ -3591,7 +3590,7 @@ possible using PROLOGUE sections. This section has been concerned with explaining the advantages of the four PROLOGUE alternatives over the original Yacc PROLOGUE. However, in -most cases when using these directives, you shouldn’t need to think +most cases when using these directives, you shouldn't need to think about all the low-level ordering issues discussed here. Instead, you should simply use these directives to label each block of your code according to its purpose and let Bison handle the ordering. ‘%code’ is @@ -3664,7 +3663,7 @@ of syntactically equivalent tokens. You use the symbol in grammar rules to mean that a token in that class is allowed. The symbol is represented in the Bison parser by a numeric code, and the ‘yylex’ function returns a token kind code to indicate what kind of token has -been read. You don’t need to know what the code value is; you can use +been read. You don't need to know what the code value is; you can use the symbol to stand for it. A “nonterminal symbol” stands for a class of syntactically equivalent @@ -3690,7 +3689,7 @@ token names. • A “character token kind” (or “literal character token”) is written in the grammar using the same syntax used in C for character constants; for example, ‘'+'’ is a character token kind. A - character token kind doesn’t need to be declared unless you need to + character token kind doesn't need to be declared unless you need to specify its semantic value data type (*note Value Type::), associativity, or precedence (*note Precedence::). @@ -3709,13 +3708,13 @@ token names. • A “literal string token” is written like a C string constant; for example, ‘"<="’ is a literal string token. A literal string token - doesn’t need to be declared unless you need to specify its semantic + doesn't need to be declared unless you need to specify its semantic value data type (*note Value Type::), associativity, or precedence (*note Precedence::). You can associate the literal string token with a symbolic name as an alias, using the ‘%token’ declaration (*note Token Decl::). If - you don’t do that, the lexical analyzer has to retrieve the token + you don't do that, the lexical analyzer has to retrieve the token code for the literal string token from the ‘yytname’ table (*note Calling Convention::). @@ -3748,7 +3747,7 @@ token kind is simply the positive numeric code of the character, so though you may need to convert it to ‘unsigned char’ to avoid sign-extension on hosts where ‘char’ is signed. Each named token kind becomes a C macro in the parser implementation file, so ‘yylex’ can use -the name to stand for the code. (This is why periods don’t make sense +the name to stand for the code. (This is why periods don't make sense in terminal symbols.) *Note Calling Convention::. If ‘yylex’ is defined in a separate file, you need to arrange for the @@ -3777,7 +3776,7 @@ that are incompatible with ASCII must rebuild those files before compiling them. The symbol ‘error’ is a terminal symbol reserved for error recovery -(*note Error Recovery::); you shouldn’t use it for any other purpose. +(*note Error Recovery::); you shouldn't use it for any other purpose. In particular, ‘yylex’ should never return this value. The default value of the error token is 256, unless you explicitly assigned 256 to one of your tokens with a ‘%token’ declaration. @@ -3996,14 +3995,14 @@ or The value of ‘api.value.type’ should be a type name that does not contain parentheses or square brackets. - Alternatively in C, instead of relying of Bison’s ‘%define’ support, + Alternatively in C, instead of relying of Bison's ‘%define’ support, you may rely on the C preprocessor and define ‘YYSTYPE’ as a macro: #define YYSTYPE double This macro definition must go in the prologue of the grammar file (*note Grammar Outline::). If compatibility with POSIX Yacc matters to you, -use this. Note however that Bison cannot know ‘YYSTYPE’’s value, not +use this. Note however that Bison cannot know ‘YYSTYPE’'s value, not even whether it is defined, so there are services it cannot provide. Besides this works only for C. @@ -4223,18 +4222,18 @@ references construct. Note that the vertical-bar character ‘|’ is really a rule separator, and actions are attached to a single rule. This is a difference with -tools like Flex, for which ‘|’ stands for either “or”, or “the same -action as that of the next rule”. In the following example, the action +tools like Flex, for which ‘|’ stands for either "or", or "the same +action as that of the next rule". In the following example, the action is triggered only when ‘b’ is found: a-or-b: 'a'|'b' { a_or_b_found = 1; }; - If you don’t specify an action for a rule, Bison supplies a default: + If you don't specify an action for a rule, Bison supplies a default: ‘$$ = $1’. Thus, the value of the first symbol in the rule becomes the value of the whole rule. Of course, the default action is valid only if the two data types match. There is no meaningful default action for an empty rule; every empty rule must have an explicit action unless the -rule’s value does not matter. +rule's value does not matter. ‘$N’ with N zero or negative is allowed for reference to tokens and groupings on the stack _before_ those that match the current rule. This @@ -4384,7 +4383,7 @@ readability and maintainability (*note Named References::): After the embedded statement is parsed, its semantic value becomes the value of the entire ‘let’-statement. Then the semantic value from the earlier action is used to restore the prior list of variables. This -removes the temporary ‘let’-variable from the list so that it won’t +removes the temporary ‘let’-variable from the list so that it won't appear to exist while the rest of the program is parsed. Because the types of the semantic values of midrule actions are @@ -4410,7 +4409,7 @@ without restoring it. Thus, ‘$5’ needs a destructor (*note Destructor Decl::), and Bison needs the type of the semantic value (‘context’) to select the right destructor. - As an extension to Yacc’s midrule actions, Bison offers a means to + As an extension to Yacc's midrule actions, Bison offers a means to type their semantic value: specify its type tag (‘<...>’ before the midrule action. @@ -4522,7 +4521,6 @@ a destructor for that symbol: declare_variable ($var); }; -  File: bison.info, Node: Midrule Conflicts, Prev: Midrule Action Translation, Up: Midrule Actions @@ -4733,7 +4731,7 @@ File: bison.info, Node: Printing Locations, Next: Location Default Action, Pr ------------------------ When using the default location type, the debug traces report the -symbols’ location. The generated parser does so using the +symbols' location. The generated parser does so using the ‘YYLOCATION_PRINT’ macro. -- Macro: YYLOCATION_PRINT (FILE, LOC); @@ -4757,7 +4755,7 @@ locations are much more general than semantic values, there is room in the output parser to redefine the default action to take for each rule. The ‘YYLLOC_DEFAULT’ macro is invoked each time a rule is matched, before the associated action is run. It is also invoked while -processing a syntax error, to compute the error’s location. Before +processing a syntax error, to compute the error's location. Before reporting an unresolvable syntactic ambiguity, a GLR parser invokes ‘YYLLOC_DEFAULT’ recursively to compute the location of that ambiguity. @@ -4768,7 +4766,7 @@ dedicated code from semantic actions. the location of the grouping (the result of the computation). When a rule is matched, the second parameter identifies locations of all right hand side elements of the rule being matched, and the third parameter is -the size of the rule’s right hand side. When a GLR parser reports an +the size of the rule's right hand side. When a GLR parser reports an ambiguity, which of multiple candidate right hand sides it passes to ‘YYLLOC_DEFAULT’ is undefined. When processing a syntax error, the second parameter identifies locations of the symbols that were discarded @@ -4863,7 +4861,6 @@ closing brace of the midrule action code: exp[res]: exp[x] '+' {$left = $x;}[left] exp[right] { $res = $left + $right; } - In references, in order to specify names containing dots and dashes, an explicit bracketed syntax ‘$[name]’ and ‘@[name]’ must be used: if-stmt: "if" '(' expr ')' "then" then.stmt ';' @@ -4911,7 +4908,7 @@ must declare it explicitly (*note Language and Grammar::). * Pure Decl:: Requesting a reentrant parser. * Push Decl:: Requesting a push parser. * Decl Summary:: Table of all Bison declarations. -* %define Summary:: Defining variables to adjust Bison’s behavior. +* %define Summary:: Defining variables to adjust Bison's behavior. * %code Summary:: Inserting code into the parser source.  @@ -4944,7 +4941,7 @@ follows: Bison will convert this into a definition in the parser, so that the function ‘yylex’ (if it is in this file) can use the name NAME to stand -for this token kind’s code. +for this token kind's code. Alternatively, you can use ‘%left’, ‘%right’, ‘%precedence’, or ‘%nonassoc’ instead of ‘%token’, if you wish to specify associativity @@ -4960,7 +4957,7 @@ field immediately following the token name: %token XNUM 0x12d // a GNU extension It is generally best, however, to let Bison choose the numeric codes for -all token kinds. Bison will automatically select codes that don’t +all token kinds. Bison will automatically select codes that don't conflict with each other or with normal characters. In the event that the stack type is a union, you must augment the @@ -5124,7 +5121,7 @@ code. -- Directive: %initial-action { CODE } Declare that the braced CODE must be invoked before parsing each time ‘yyparse’ is called. The CODE may use ‘$$’ (or ‘$$’) and - ‘@$’ — initial value and location of the lookahead — and the + ‘@$’ -- initial value and location of the lookahead -- and the ‘%parse-param’. For instance, if your locations use a file name, you may use @@ -5221,7 +5218,7 @@ the end token (token 0) if you redefine it from ‘$end’ to, for example, Finally, Bison will never invoke a ‘%destructor’ for an unreferenced midrule semantic value (*note Midrule Actions::). That is, Bison does not consider a midrule to have a semantic value if you do not reference -‘$$’ in the midrule’s action or ‘$N’ (where N is the right-hand side +‘$$’ in the midrule's action or ‘$N’ (where N is the right-hand side symbol position of the midrule) in any later action in that rule. However, if you do reference either, the Bison-generated parser will invoke the ‘<>’ ‘%destructor’ whenever it discards the midrule symbol. @@ -5354,7 +5351,7 @@ document this fact with an ‘%expect’ modifier as follows: Mid-rule actions generate implicit rules that are also subject to conflicts (*note Midrule Conflicts::). To attach an ‘%expect’ or -‘%expect-rr’ annotation to an implicit mid-rule action’s rule, put it +‘%expect-rr’ annotation to an implicit mid-rule action's rule, put it before the action. For example, %glr-parser @@ -5377,7 +5374,7 @@ other, and we should expect one reduce/reduce conflict for each. a verbose list of where the conflicts occur. Bison will also print the number of conflicts. - • Check each of the conflicts to make sure that Bison’s default + • Check each of the conflicts to make sure that Bison's default resolution is what you really want. If not, rewrite the grammar and go back to the beginning. @@ -5457,7 +5454,7 @@ completely parsed. A push parser, on the other hand, is called each time a new token is made available. A push parser is typically useful when the parser is part of a main -event loop in the client’s application. This is typically a requirement +event loop in the client's application. This is typically a requirement of a GUI, when the main event loop needs to be triggered within a certain time period. @@ -5484,7 +5481,7 @@ parser at a time. When a push parser is selected, Bison will generate some new symbols in the generated parser. ‘yypstate’ is a structure that the generated -parser uses to store the parser’s state. ‘yypstate_new’ is the function +parser uses to store the parser's state. ‘yypstate_new’ is the function that will create a new parser instance. ‘yypstate_delete’ will free the resources associated with the corresponding parser instance. Finally, ‘yypush_parse’ is the function that should be called whenever a token is @@ -5514,7 +5511,7 @@ would thus look like this: } while (status == YYPUSH_MORE); yypstate_delete (ps); - That’s it. Notice the next token is put into the global variable + That's it. Notice the next token is put into the global variable ‘yychar’ for use by the next invocation of the ‘yypush_parse’ function. Bison also supports both the push parser interface along with the @@ -5581,7 +5578,7 @@ Here is a summary of the declarations used to define a grammar: Decl::). -- Directive: %start - Specify the grammar’s start symbol (*note Start Decl::). + Specify the grammar's start symbol (*note Start Decl::). -- Directive: %expect Declare the expected number of shift/reduce conflicts, either @@ -5609,7 +5606,7 @@ directives: -- Directive: %define VARIABLE VALUE -- Directive: %define VARIABLE {VALUE} -- Directive: %define VARIABLE "VALUE" - Define a variable to adjust Bison’s behavior. *Note %define + Define a variable to adjust Bison's behavior. *Note %define Summary::. -- Directive: %defines @@ -5703,7 +5700,7 @@ directives: ‘yytoken_kind_t’, ‘YYSTYPE’, ‘YYLTYPE’. -- Directive: %no-lines - Don’t generate any ‘#line’ preprocessor commands in the parser + Don't generate any ‘#line’ preprocessor commands in the parser implementation file. Ordinarily Bison writes these commands in the parser implementation file so that the C compiler and debuggers will associate errors and object code with your source file (the @@ -5762,7 +5759,7 @@ directives: ‘YYNSTATES’ The number of parser states (*note Parser States::). - Here’s code for looking up a multicharacter token in ‘yytname’, + Here's code for looking up a multicharacter token in ‘yytname’, assuming that the characters of the token are stored in ‘token_buffer’, and assuming that the token does not contain any characters like ‘"’ that require escaping. @@ -5804,7 +5801,7 @@ File: bison.info, Node: %define Summary, Next: %code Summary, Prev: Decl Summ 3.7.14 %define Summary ---------------------- -There are many features of Bison’s behavior that can be controlled by +There are many features of Bison's behavior that can be controlled by assigning the feature a single value. For historical reasons, some such features are assigned values by dedicated directives, such as ‘%start’, which assigns the start symbol. However, newer such features are @@ -5853,7 +5850,7 @@ described below. • Language(s): C++ - • Purpose: Define the type of file names in Bison’s default + • Purpose: Define the type of file names in Bison's default location and position types. *Note Exposing the Location Classes::. @@ -5892,7 +5889,7 @@ described below. Using ‘api.header.include’ does not change the name of the generated header, only how it is included. - To work around limitations of Automake’s ‘ylwrap’ (which runs + To work around limitations of Automake's ‘ylwrap’ (which runs ‘bison’ with ‘--yacc’), ‘api.header.include’ is _not_ predefined when the output file is ‘y.tab.c’. Define it to avoid the duplication. @@ -5913,7 +5910,7 @@ described below. • Language(s): C++ - • Purpose: Define the name of the file in which Bison’s default + • Purpose: Define the name of the file in which Bison's default location and position types are generated. *Note Exposing the Location Classes::. @@ -5930,7 +5927,7 @@ described below. • Default Value: Not applicable if locations are not enabled, or if a user location type is specified (see - ‘api.location.type’). Otherwise, Bison’s ‘location’ is + ‘api.location.type’). Otherwise, Bison's ‘location’ is generated in ‘location.hh’ (*note C++ location::). • History: Introduced in Bison 3.2. @@ -6103,7 +6100,7 @@ described below. • Accepted Values: Any non empty string. Must be a valid identifier in the target language (typically a non empty - sequence of letters, underscores, and —not at the beginning— + sequence of letters, underscores, and --not at the beginning-- digits). The empty prefix is (generally) invalid: @@ -6163,7 +6160,7 @@ described below. • Accepted Values: Any string. Must be a valid identifier prefix in the target language (typically, a possibly empty - sequence of letters, underscores, and —not at the beginning— + sequence of letters, underscores, and --not at the beginning-- digits). • Default Value: empty @@ -6250,7 +6247,7 @@ described below. properly supported yet. ‘union-directive’ (C, C++, D) The type is defined thanks to the ‘%union’ directive. - You don’t have to define ‘api.value.type’ in that case, + You don't have to define ‘api.value.type’ in that case, using ‘%union’ suffices. *Note Union Decl::. For instance: %define api.value.type union-directive @@ -6373,7 +6370,7 @@ described below. In C++, when variants are used (*note C++ Variants::), symbols must be constructed and destroyed properly. This option checks these constraints using runtime type information - (RTTI). Therefore the generated code cannot be compiled with + (RTTI). Therefore the generated code cannot be compiled with RTTI disabled (via compiler options such as ‘-fno-rtti’). • Accepted Values: Boolean @@ -6487,9 +6484,9 @@ qualifiers produce an error. Some of the accepted qualifiers are: • Purpose: This is the best place to write dependency code required for the value and location types (‘YYSTYPE’ and - ‘YYLTYPE’ in C). In other words, it’s the best place to define + ‘YYLTYPE’ in C). In other words, it's the best place to define types referenced in ‘%union’ directives. In C, if you use - ‘#define’ to override Bison’s default ‘YYSTYPE’ and ‘YYLTYPE’ + ‘#define’ to override Bison's default ‘YYSTYPE’ and ‘YYLTYPE’ definitions, then it is also the best place. However you should rather ‘%define’ ‘api.value.type’ and ‘api.location.type’. @@ -6571,7 +6568,7 @@ by PREFIX (i.e., PREFIX upper-cased) instead of ‘YY’. ‘yylval’, ‘yylloc’, ‘yychar’ and ‘yydebug’. If you use a push parser, ‘yypush_parse’, ‘yypull_parse’, ‘yypstate’, ‘yypstate_new’ and ‘yypstate_delete’ will also be renamed. The renamed macros include -‘YYSTYPE’, ‘YYLTYPE’, and ‘YYDEBUG’, which is treated specifically — +‘YYSTYPE’, ‘YYLTYPE’, and ‘YYDEBUG’, which is treated specifically -- more about this below. For example, if you use ‘%define api.prefix {c}’, the names become @@ -6609,7 +6606,7 @@ beginning of the parser implementation file, defining ‘yyparse’ as int yyparse (void); This effectively substitutes one name for the other in the entire -parser implementation file, thus the “original” names (‘yylex’, +parser implementation file, thus the "original" names (‘yylex’, ‘YYSTYPE’, ...) are also usable in the parser implementation file. However, in the parser header file, the symbols are defined renamed, @@ -6667,7 +6664,7 @@ grammar file, you are likely to run into trouble. which reads tokens. * Error Reporting:: Passing error messages to the user. * Action Features:: Special features for use in actions. -* Internationalization:: How to let the parser speak in the user’s +* Internationalization:: How to let the parser speak in the user's native language.  @@ -6714,7 +6711,7 @@ declaration ‘%parse-param’: declaring functions or prototypes. The last identifier in ARGUMENT-DECLARATION must be the argument name. - Here’s an example. Write this in the parser: + Here's an example. Write this in the parser: %parse-param {int *nastiness} {int *randomness} @@ -6903,7 +6900,7 @@ that there is nothing left afterwards. *Note Calling Convention::, for an example. Returning ‘YYUNDEF’ tells the parser that some lexical error was -found. It will emit an error message about an “invalid token”, and +found. It will emit an error message about an "invalid token", and enter error-recovery (*note Error Recovery::). Returning an unknown token kind results in the exact same behavior. @@ -6974,9 +6971,9 @@ if the type is ‘int’ (the default), you might write this in ‘yylex’: return INT; /* Return the kind of the token. */ ... - When you are using multiple data types, ‘yylval’’s type is a union + When you are using multiple data types, ‘yylval’'s type is a union made from the ‘%union’ declaration (*note Union Decl::). So when you -store a token’s value, you must use the proper member of the union. If +store a token's value, you must use the proper member of the union. If the ‘%union’ declaration looks like this: %union { @@ -7117,7 +7114,7 @@ incorrect information if LAC is not enabled (*note LAC::). The parser can detect one other kind of error: memory exhaustion. This can happen when the input contains constructions that are very -deeply nested. It isn’t likely you will encounter this, since the Bison +deeply nested. It isn't likely you will encounter this, since the Bison parser normally extends its stack automatically up to a very large limit. But if memory is exhausted, ‘yyparse’ calls ‘yyerror’ in the usual fashion, except that the argument string is ‘"memory exhausted"’. @@ -7175,9 +7172,9 @@ then the parser no longer passes syntax error messages to ‘yyerror’, rather it delegates that task to the user by calling the ‘yyreport_syntax_error’ function. - The following functions and types are “‘static’”: they are defined in + The following functions and types are "‘static’": they are defined in the implementation file (‘*.c’) and available only from there. They are -meant to be used from the grammar’s epilogue. +meant to be used from the grammar's epilogue. -- Function: static int yyreport_syntax_error (const yypcontext_t *CTX) Report a syntax error to the user. Return 0 on success, ‘YYENOMEM’ @@ -7211,7 +7208,7 @@ meant to be used from the grammar’s epilogue. -- Function: static yysymbol_kind_t yypcontext_token (const yypcontext_t *CTX) - The “unexpected” token: the symbol kind of the lookahead token that + The "unexpected" token: the symbol kind of the lookahead token that caused the syntax error. Returns ‘YYSYMBOL_YYEMPTY’ if there is no lookahead. @@ -7392,12 +7389,12 @@ File: bison.info, Node: Internationalization, Prev: Action Features, Up: Inte A Bison-generated parser can print diagnostics, including error and tracing messages. By default, they appear in English. However, Bison -also supports outputting diagnostics in the user’s native language. To +also supports outputting diagnostics in the user's native language. To make this work, the user should set the usual environment variables. -*Note The User’s View: (gettext)Users. For example, the shell command -‘export LC_ALL=fr_CA.UTF-8’ might set the user’s locale to French +*Note The User's View: (gettext)Users. For example, the shell command +‘export LC_ALL=fr_CA.UTF-8’ might set the user's locale to French Canadian using the UTF-8 encoding. The exact set of available locales -depends on the user’s installation. +depends on the user's installation. * Menu: @@ -7411,13 +7408,13 @@ File: bison.info, Node: Enabling I18n, Next: Token I18n, Up: Internationaliza ----------------------------------- The maintainer of a package that uses a Bison-generated parser enables -the internationalization of the parser’s output through the following +the internationalization of the parser's output through the following steps. Here we assume a package that uses GNU Autoconf and GNU Automake. 1. Into the directory containing the GNU Autoconf macros used by the - package —often called ‘m4’— copy the ‘bison-i18n.m4’ file installed - by Bison under ‘share/aclocal/bison-i18n.m4’ in Bison’s + package --often called ‘m4’-- copy the ‘bison-i18n.m4’ file + installed by Bison under ‘share/aclocal/bison-i18n.m4’ in Bison's installation directory. For example: cp /usr/local/share/aclocal/bison-i18n.m4 m4/bison-i18n.m4 @@ -7430,7 +7427,7 @@ Automake. to enable translations in the Bison-generated parser. 3. In the ‘main’ function of your program, designate the directory - containing Bison’s runtime message catalog, through a call to + containing Bison's runtime message catalog, through a call to ‘bindtextdomain’ with domain name ‘bison-runtime’. For example: bindtextdomain ("bison-runtime", BISON_LOCALEDIR); @@ -7478,17 +7475,17 @@ internationalization marker (‘_("function")’). parser will use both ‘N_’ and ‘_’, that must be defined (*note The Programmer’s View: (gettext)Programmers.). They are used only on string aliases marked for translation. In other words, even if your catalog -features a translation for “function”, then with +features a translation for "function", then with %token FUN "function" VAR _("variable") -“function” will appear untranslated in debug traces and error messages. +"function" will appear untranslated in debug traces and error messages. Unless defined by the user, the end-of-file token, ‘YYEOF’, is -provided “end of file” as an alias. It is also internationalized if the +provided "end of file" as an alias. It is also internationalized if the user internationalized tokens. To map it to another string, use: %token END 0 _("end of input") @@ -7512,11 +7509,11 @@ When the last N tokens and groupings shifted match the components of a grammar rule, they can be combined according to that rule. This is called “reduction”. Those tokens and groupings are replaced on the stack by a single grouping whose symbol is the result (left hand side) -of that rule. Running the rule’s action is part of the process of +of that rule. Running the rule's action is part of the process of reduction, because this is what computes the semantic value of the resulting grouping. - For example, if the infix calculator’s parser stack contains this: + For example, if the infix calculator's parser stack contains this: 1 + 5 * 3 @@ -7533,7 +7530,7 @@ At this point, another reduction can be made, resulting in the single value 16. Then the newline token can be shifted. The parser tries, by shifts and reductions, to reduce the entire -input down to a single grouping whose symbol is the grammar’s +input down to a single grouping whose symbol is the grammar's start-symbol (*note Language and Grammar::). This kind of parser is known in the literature as a bottom-up parser. @@ -7543,7 +7540,7 @@ start-symbol (*note Language and Grammar::). * Lookahead:: Parser looks one token ahead when deciding what to do. * Shift/Reduce:: Conflicts: when either shifting or reduction is valid. * Precedence:: Operator precedence works by resolving conflicts. -* Contextual Precedence:: When an operator’s precedence depends on context. +* Contextual Precedence:: When an operator's precedence depends on context. * Parser States:: The parser is a finite-state-machine with stack. * Reduce/Reduce:: When two rules are applicable in the same situation. * Mysterious Conflicts:: Conflicts that look unjustified. @@ -7560,7 +7557,7 @@ File: bison.info, Node: Lookahead, Next: Shift/Reduce, Up: Algorithm The Bison parser does _not_ always reduce immediately as soon as the last N tokens and groupings match a rule. This is because such a simple strategy is inadequate to handle most languages. Instead, when a -reduction is possible, the parser sometimes “looks ahead” at the next +reduction is possible, the parser sometimes "looks ahead" at the next token in order to decide what to do. When a token is read, it is not immediately shifted; first it becomes @@ -7630,7 +7627,7 @@ rule. This situation, where either a shift or a reduction would be valid, is called a “shift/reduce conflict”. Bison is designed to resolve these conflicts by choosing to shift, unless otherwise directed by operator -precedence declarations. To see the reason for this, let’s contrast it +precedence declarations. To see the reason for this, let's contrast it with the other alternative. Since the parser prefers to shift the ‘"else"’, the result is to @@ -7657,10 +7654,10 @@ Bison accomplishes by choosing to shift rather than reduce. (It would ideally be cleaner to write an unambiguous grammar, but that is very hard to do in this case.) This particular ambiguity was first encountered in the specifications of Algol 60 and is called the -“dangling ‘else’” ambiguity. +"dangling ‘else’" ambiguity. To assist the grammar author in understanding the nature of each -conflict, Bison can be asked to generate “counterexamples”. In the +conflict, Bison can be asked to generate "counterexamples". In the present case it actually even proves that the grammar is ambiguous by exhibiting a string with two different parses: @@ -7684,7 +7681,7 @@ exhibiting a string with two different parses: shift/reduce conflicts, you can use the ‘%expect N’ declaration. There will be no warning as long as the number of shift/reduce conflicts is exactly N, and Bison will report an error if there is a different -number. *Note Expect Decl::. However, we don’t recommend the use of +number. *Note Expect Decl::. However, we don't recommend the use of ‘%expect’ (except ‘%expect 0’!), as an equal number of conflicts does not mean that they are the _same_. When possible, you should rather use precedence directives to _fix_ the conflicts explicitly (*note Non @@ -7784,7 +7781,7 @@ list of tokens, which are operators whose precedence and associativity is being declared. The ‘%left’ declaration makes all those operators left-associative and the ‘%right’ declaration makes them right-associative. A third alternative is ‘%nonassoc’, which declares -that it is a syntax error to find the same operator twice “in a row”. +that it is a syntax error to find the same operator twice "in a row". The last alternative, ‘%precedence’, allows to define only precedence and no associativity at all. As a result, any associativity-related conflict that remains will be reported as an compile-time error. The @@ -7873,8 +7870,8 @@ Precedence::.) Finally, the resolution of conflicts works by comparing the precedence of the rule being considered with that of the lookahead -token. If the token’s precedence is higher, the choice is to shift. If -the rule’s precedence is higher, the choice is to reduce. If they have +token. If the token's precedence is higher, the choice is to shift. If +the rule's precedence is higher, the choice is to reduce. If they have equal precedence, the choice is made based on the associativity of that precedence level. The verbose output file made by ‘-v’ (*note Invocation::) says how each conflict was resolved. @@ -7890,7 +7887,7 @@ File: bison.info, Node: Non Operators, Prev: How Precedence, Up: Precedence Using properly precedence and associativity directives can help fixing shift/reduce conflicts that do not involve arithmetic-like operators. -For instance, the “dangling ‘else’” problem (*note Shift/Reduce::) can +For instance, the "dangling ‘else’" problem (*note Shift/Reduce::) can be solved elegantly in two different ways. In the present case, the conflict is between the token ‘"else"’ @@ -7910,12 +7907,12 @@ action, use right associativity: %right "then" "else" Neither solution is perfect however. Since Bison does not provide, -so far, “scoped” precedence, both force you to declare the precedence of +so far, "scoped" precedence, both force you to declare the precedence of these keywords with respect to the other operators your grammar. Therefore, instead of being warned about new conflicts you would be unaware of (e.g., a shift/reduce conflict due to ‘if test then 1 else 2 + 3’ being ambiguous: ‘if test then 1 else (2 + 3)’ or ‘(if test then 1 -else 2) + 3’?), the conflict will be already “fixed”. +else 2) + 3’?), the conflict will be already "fixed".  File: bison.info, Node: Contextual Precedence, Next: Parser States, Prev: Precedence, Up: Algorithm @@ -7936,8 +7933,8 @@ the ‘%prec’ modifier for rules. The ‘%prec’ modifier declares the precedence of a particular rule by specifying a terminal symbol whose precedence should be used for that -rule. It’s not necessary for that symbol to appear otherwise in the -rule. The modifier’s syntax is: +rule. It's not necessary for that symbol to appear otherwise in the +rule. The modifier's syntax is: %prec TERMINAL-SYMBOL @@ -7980,9 +7977,9 @@ do next. Each time a lookahead token is read, the current parser state together with the kind of lookahead token are looked up in a table. -This table entry can say, “Shift the lookahead token.” In this case, it +This table entry can say, "Shift the lookahead token." In this case, it also specifies the new parser state, which is pushed onto the top of the -parser stack. Or it can say, “Reduce using rule number N.” This means +parser stack. Or it can say, "Reduce using rule number N." This means that a certain number of tokens or groupings are taken off the top of the stack, and replaced by one grouping. In other words, that number of states are popped from the stack, and one new state is pushed. @@ -8030,8 +8027,8 @@ via ‘maybeword’ and then the second rule. You might think that this is a distinction without a difference, because it does not change whether any particular input is valid or not. But it does affect which actions are run. One parsing order runs the -second rule’s action; the other runs the first rule’s action and the -third rule’s action. In this example, the output of the program +second rule's action; the other runs the first rule's action and the +third rule's action. In this example, the output of the program changes. Bison resolves a reduce/reduce conflict by choosing to use the rule @@ -8147,7 +8144,7 @@ File: bison.info, Node: Mysterious Conflicts, Next: Tuning LR, Prev: Reduce/R 5.7 Mysterious Conflicts ======================== -Sometimes reduce/reduce conflicts can occur that don’t look warranted. +Sometimes reduce/reduce conflicts can occur that don't look warranted. Here is an example: %% @@ -8182,7 +8179,7 @@ default_, for historical reasons. In this grammar, two contexts, that after an ‘"id"’ at the beginning of a ‘param_spec’ and likewise at the beginning of a ‘return_spec’, are similar enough that Bison assumes they are the same. They appear similar because the same set of rules would -be active—the rule for reducing to a ‘name’ and that for reducing to a +be active--the rule for reducing to a ‘name’ and that for reducing to a ‘type’. Bison is unable to determine at that stage of processing that the rules would require different lookahead tokens in the two contexts, so it makes a single parser state for them both. Combining the two @@ -8197,7 +8194,7 @@ algorithm. Either IELR(1) or canonical LR(1) would suffice, but the former is more efficient and easier to debug during development. *Note LR Table Construction::, for details. - If you instead wish to work around LALR(1)’s limitations, you can + If you instead wish to work around LALR(1)'s limitations, you can often fix a mysterious conflict by identifying the two parser states that are being confused, and adding something to make them look distinct. In the above example, adding one rule to ‘return_spec’ as @@ -8243,11 +8240,11 @@ File: bison.info, Node: Tuning LR, Next: Generalized LR Parsing, Prev: Myster 5.8 Tuning LR ============= -The default behavior of Bison’s LR-based parsers is chosen mostly for +The default behavior of Bison's LR-based parsers is chosen mostly for historical reasons, but that behavior is often not robust. For example, in the previous section, we discussed the mysterious conflicts that can -be produced by LALR(1), Bison’s default parser table construction -algorithm. Another example is Bison’s ‘%define parse.error verbose’ +be produced by LALR(1), Bison's default parser table construction +algorithm. Another example is Bison's ‘%define parse.error verbose’ directive, which instructs the generated parser to produce verbose syntax error messages, which can sometimes contain incorrect information. @@ -8310,7 +8307,7 @@ use IELR will result in unnecessarily large parser tables. That is, IELR generates LALR tables when LALR (using a deterministic parsing algorithm) is sufficient to support the full language-recognition power of LR. Thus, by enabling IELR at the start of grammar development, you -can safely and completely eliminate the need to consider LALR’s +can safely and completely eliminate the need to consider LALR's shortcomings. While IELR is almost always preferable, there are circumstances where @@ -8335,7 +8332,7 @@ each parser table construction algorithm within Bison: to resolve conflicts statically, GLR behaves more like a deterministic parser in the syntactic contexts where those conflicts appear, and so either IELR or canonical LR can then - be helpful to avoid LALR’s mysterious behavior. + be helpful to avoid LALR's mysterious behavior. • Malformed grammars. @@ -8354,7 +8351,7 @@ each parser table construction algorithm within Bison: sentences. However, like LALR, IELR merges parser states during parser table construction so that the number of parser states is often an order of magnitude less than for canonical LR. More - importantly, because canonical LR’s extra parser states may contain + importantly, because canonical LR's extra parser states may contain duplicate conflicts in the case of non-LR grammars, the number of conflicts for IELR is often an order of magnitude less as well. This effect can significantly reduce the complexity of developing a @@ -8533,7 +8530,7 @@ enable default reductions in consistent states, canonical LR and IELR behave almost exactly the same for both syntactically acceptable and syntactically unacceptable input. While LALR still does not support the full language-recognition power of canonical LR and IELR, LAC at least -enables LALR’s syntax error handling to correctly reflect LALR’s +enables LALR's syntax error handling to correctly reflect LALR's language-recognition power. There are a few caveats to consider when using LAC: @@ -8564,7 +8561,7 @@ language-recognition power. reductions in consistent states and shift actions, the parser never has to initiate an exploratory parse. Moreover, the most time-consuming tasks in a parse are often the file I/O, the lexical - analysis performed by the scanner, and the user’s semantic actions, + analysis performed by the scanner, and the user's semantic actions, but none of these are performed during the exploratory parse. Finally, the base of the temporary stack used during an exploratory parse is a pointer into the normal parser state stack so that the @@ -8582,7 +8579,7 @@ File: bison.info, Node: Unreachable States, Prev: LAC, Up: Tuning LR 5.8.4 Unreachable States ------------------------ -If there exists no sequence of transitions from the parser’s start state +If there exists no sequence of transitions from the parser's start state to some state S, then Bison considers S to be an “unreachable state”. A state can become unreachable during conflict resolution if Bison disables a shift action leading to it from a predecessor state. @@ -8602,7 +8599,7 @@ understand the relationship between the parser and the grammar. Unreachable states may contain conflicts and may use rules not used in any other state. Thus, keeping unreachable states may induce - warnings that are irrelevant to your parser’s behavior, and it may + warnings that are irrelevant to your parser's behavior, and it may eliminate warnings that are relevant. Of course, the change in warnings may actually be relevant to a parser table analysis that wants to keep unreachable states, so this behavior will likely @@ -8635,7 +8632,7 @@ The same is true of languages that require more than one symbol of lookahead, since the parser lacks the information necessary to make a decision at the point it must be made in a shift/reduce parser. Finally, as previously mentioned (*note Mysterious Conflicts::), there -are languages where Bison’s default choice of how to summarize the input +are languages where Bison's default choice of how to summarize the input seen so far loses necessary information. When you use the ‘%glr-parser’ declaration in your grammar file, @@ -8685,7 +8682,7 @@ length of the input times the maximum number of stacks required for any prefix of the input. Thus, really ambiguous or nondeterministic grammars can require exponential time and space to process. Such badly behaving examples, however, are not generally of practical interest. -Usually, nondeterminism in a grammar is local—the parser is “in doubt” +Usually, nondeterminism in a grammar is local--the parser is "in doubt" only for a few tokens at a time. Therefore, the current data structure should generally be adequate. On LR(1) portions of a grammar, in particular, it is only slightly slower than with the deterministic LR(1) @@ -8837,14 +8834,14 @@ shifted will error messages resume. as any other rules can. You can make error messages resume immediately by using the macro -‘yyerrok’ in an action. If you do this in the error rule’s action, no +‘yyerrok’ in an action. If you do this in the error rule's action, no error messages will be suppressed. This macro requires no arguments; ‘yyerrok;’ is a valid C statement. The previous lookahead token is reanalyzed immediately after an error. If this is unacceptable, then the macro ‘yyclearin’ may be used to clear this token. Write the statement ‘yyclearin;’ in the error -rule’s action. *Note Action Features::. +rule's action. *Note Action Features::. For example, suppose that on a syntax error, an error handling routine is called that advances the input stream to some point where @@ -8875,7 +8872,7 @@ for such languages. * Tie-in Recovery:: Lexical tie-ins have implications for how error recovery rules must be written. - (Actually, “kludge” means any technique that gets its job done but is + (Actually, "kludge" means any technique that gets its job done but is neither clean nor robust.)  @@ -8904,7 +8901,7 @@ choice of token kind to recognize. ‘IDENTIFIER’ is accepted as an expression, but ‘TYPENAME’ is not. ‘TYPENAME’ can start a declaration, but ‘IDENTIFIER’ cannot. In contexts where the meaning of the identifier is _not_ significant, such as in declarations that can shadow -a typedef name, either ‘TYPENAME’ or ‘IDENTIFIER’ is accepted—there is +a typedef name, either ‘TYPENAME’ or ‘IDENTIFIER’ is accepted--there is one rule for each of the two token kinds. This technique is simple to use if the decision of which kinds of @@ -8922,13 +8919,13 @@ earlier: } Unfortunately, the name being declared is separated from the -declaration construct itself by a complicated syntactic structure—the -“declarator”. +declaration construct itself by a complicated syntactic structure--the +"declarator". As a result, part of the Bison parser for C needs to be duplicated, with all the nonterminal names changed: once for parsing a declaration in which a typedef name can be redefined, and once for parsing a -declaration in which that can’t be done. Here is a part of the +declaration in which that can't be done. Here is a part of the duplication, with actions omitted for brevity: initdcl: @@ -9050,7 +9047,7 @@ way you can write the action to determine whether a ‘hex’ construct is being aborted or not. So if you are using a lexical tie-in, you had better make sure your error recovery rules are not of this kind. Each rule must be such that you can be sure that it always will, or always -won’t, have to clear the flag. +won't, have to clear the flag.  File: bison.info, Node: Debugging, Next: Invocation, Prev: Context Dependency, Up: Top @@ -9058,7 +9055,7 @@ File: bison.info, Node: Debugging, Next: Invocation, Prev: Context Dependency 8 Debugging Your Parser *********************** -Developing a parser can be a challenge, especially if you don’t +Developing a parser can be a challenge, especially if you don't understand the algorithm (*note Algorithm::). This chapter explains how to understand and debug a parser. @@ -9118,7 +9115,7 @@ features one shift/reduce conflict: else.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] else.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples -Let’s rerun ‘bison’ with the option ‘-Wcex’/‘-Wcounterexamples’(the +Let's rerun ‘bison’ with the option ‘-Wcex’/‘-Wcounterexamples’(the following output is actually in color): else.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] @@ -9205,7 +9202,7 @@ shows that the grammar accepts the empty input in two different ways. two ways. In these cases, counterexample generation will provide two examples that are the same up until the dot. Most notably, this will happen when your grammar requires a stronger parser (more lookahead, LR -instead of LALR). The following example isn’t LR(1): +instead of LALR). The following example isn't LR(1): %token ID %% @@ -9309,7 +9306,7 @@ might vary, but the interpretation is the same. The first section reports useless tokens, nonterminals and rules. Useless nonterminals and rules are removed in order to produce a smaller parser, but useless tokens are preserved, since they might be used by -the scanner (note the difference between “useless” and “unused” below): +the scanner (note the difference between "useless" and "unused" below): Nonterminals useless in grammar useless @@ -9373,14 +9370,14 @@ input cursor. exp go to state 2 - This reads as follows: “state 0 corresponds to being at the very + This reads as follows: "state 0 corresponds to being at the very beginning of the parsing, in the initial rule, right before the start symbol (here, ‘exp’). When the parser returns to this state right after having reduced a rule that produced an ‘exp’, the control flow jumps to state 2. If there is no such transition on a nonterminal symbol, and the lookahead is a ‘NUM’, then this token is shifted onto the parse stack, and the control flow jumps to state 1. Any other lookahead -triggers a syntax error.” +triggers a syntax error." Even though the only active rule in state 0 seems to be rule 0, the report lists ‘NUM’ as a lookahead token because ‘NUM’ can be at the @@ -9749,7 +9746,7 @@ distinguished by a red filling color on these nodes, just like how they are reported between square brackets in the verbose file. The reduction corresponding to the rule number 0 is the acceptation -state. It is shown as a blue diamond, labeled “Acc”. +state. It is shown as a blue diamond, labeled "Acc". Graphical Representation of Gotos --------------------------------- @@ -9802,7 +9799,7 @@ File: bison.info, Node: Tracing, Prev: Xml, Up: Debugging 8.5 Tracing Your Parser ======================= -When a Bison grammar compiles properly but parses “incorrectly”, the +When a Bison grammar compiles properly but parses "incorrectly", the ‘yydebug’ parser-trace feature helps figuring out why. * Menu: @@ -9890,7 +9887,7 @@ arrive at the place where something undesirable happens, and you will see which parts of the grammar are to blame. The parser implementation file is a C/C++/D/Java program and you can -use debuggers on it, but it’s not easy to interpret what it is doing. +use debuggers on it, but it's not easy to interpret what it is doing. The parser function is a finite-state machine interpreter, and aside from the actions it executes the same code over and over. Only the values of variables show where in the grammar it is working. @@ -9923,7 +9920,7 @@ its prologue: The ‘%define’ directive instructs Bison to generate run-time trace support. Then, activation of these traces is controlled at run-time by the ‘yydebug’ variable, which is disabled by default. Because these -traces will refer to the “states” of the parser, it is helpful to ask +traces will refer to the "states" of the parser, it is helpful to ask for the creation of a description of that parser; this is the purpose of (admittedly ill-named) ‘%verbose’ directive. @@ -10059,10 +10056,10 @@ The usual way to invoke Bison is as follows: $ bison FILE Here FILE is the grammar file name, which usually ends in ‘.y’. The -parser implementation file’s name is made by replacing the ‘.y’ with +parser implementation file's name is made by replacing the ‘.y’ with ‘.tab.c’ and removing any leading directory. Thus, the ‘bison foo.y’ file name yields ‘foo.tab.c’, and the ‘bison hack/foo.y’ file name -yields ‘foo.tab.c’. It’s also possible, in case you are writing C++ +yields ‘foo.tab.c’. It's also possible, in case you are writing C++ code instead of C in your grammar file, to name it ‘foo.ypp’ or ‘foo.y++’. Then, the output files will take an extension like the given one as input (respectively ‘foo.tab.cpp’ and ‘foo.tab.c++’). This @@ -10183,8 +10180,8 @@ Options controlling the global behavior of ‘bison’. Activate miscellaneous FEATUREs. FEATURE can be one of: ‘caret’ ‘diagnostics-show-caret’ - Show caret errors, in a manner similar to GCC’s - ‘-fdiagnostics-show-caret’, or Clang’s ‘-fcaret-diagnostics’. + Show caret errors, in a manner similar to GCC's + ‘-fdiagnostics-show-caret’, or Clang's ‘-fcaret-diagnostics’. The location provided with the message is used to quote the corresponding line of the source file, underlining the important part of it with carets (‘^’). Here is an example, @@ -10225,8 +10222,8 @@ Options controlling the global behavior of ‘bison’. ‘fixit’ ‘diagnostics-parseable-fixits’ - Show machine-readable fixes, in a manner similar to GCC’s and - Clang’s ‘-fdiagnostics-parseable-fixits’. + Show machine-readable fixes, in a manner similar to GCC's and + Clang's ‘-fdiagnostics-parseable-fixits’. Fix-its are generated for duplicate directives: @@ -10307,8 +10304,8 @@ Options controlling the diagnostics. %type cond "condition" - does not define “condition” as a string alias to - ‘cond’—nonterminal symbols do not have string aliases. It is + does not define "condition" as a string alias to + ‘cond’--nonterminal symbols do not have string aliases. It is rather equivalent to %nterm cond @@ -10450,7 +10447,7 @@ Options controlling the diagnostics. ‘-Wno-error=CATEGORY’ Deactivate the error treatment for this CATEGORY. However, the - warning itself won’t be disabled, or enabled, by this option. + warning itself won't be disabled, or enabled, by this option. ‘--color’ Equivalent to ‘--color=always’. @@ -10539,7 +10536,7 @@ Options changing the generated parsers. ‘-l’ ‘--no-lines’ - Don’t put any ‘#line’ preprocessor commands in the parser + Don't put any ‘#line’ preprocessor commands in the parser implementation file. Ordinarily Bison puts them in the parser implementation file so that the C compiler and debuggers will associate errors with your source file, the grammar file. This @@ -10574,11 +10571,11 @@ Options changing the generated parsers. void yyerror (const char *); As a Bison extension, additional arguments required by ‘%pure-parser’, ‘%locations’, ‘%lex-param’ and ‘%parse-param’ - are taken into account. You may disable ‘yyerror’’s prototype + are taken into account. You may disable ‘yyerror’'s prototype with ‘#define yyerror yyerror’ (as specified by POSIX), or with ‘#define YYERROR_IS_DECLARED’ (a Bison extension). Likewise for ‘yylex’. - • Imitate Yacc’s output file name conventions, so that the + • Imitate Yacc's output file name conventions, so that the parser implementation file is called ‘y.tab.c’, and the other outputs are called ‘y.output’ and ‘y.tab.h’. Do not use ‘--yacc’ just to change the output file names since it also @@ -10636,7 +10633,7 @@ Options controlling the output. ‘state’ Description of the grammar, conflicts (resolved and - unresolved), and parser’s automaton. + unresolved), and parser's automaton. ‘itemset’ Implies ‘state’ and augments the description of the automaton @@ -10645,7 +10642,7 @@ Options controlling the output. ‘lookahead’ Implies ‘state’ and augments the description of the automaton - with each rule’s lookahead set. + with each rule's lookahead set. ‘solved’ Implies ‘state’. Explain how conflicts were solved thanks to @@ -10682,7 +10679,7 @@ Options controlling the output. ‘-g [FILE]’ ‘--graph[=FILE]’ - Output a graphical representation of the parser’s automaton + Output a graphical representation of the parser's automaton computed by Bison, in Graphviz (https://www.graphviz.org/) DOT (https://www.graphviz.org/doc/info/lang.html) format. ‘FILE’ is optional. If omitted and the grammar file is ‘foo.y’, the output @@ -10690,7 +10687,7 @@ Options controlling the output. ‘-x [FILE]’ ‘--xml[=FILE]’ - Output an XML report of the parser’s automaton computed by Bison. + Output an XML report of the parser's automaton computed by Bison. ‘FILE’ is optional. If omitted and the grammar file is ‘foo.y’, the output file will be ‘foo.xml’. @@ -10749,18 +10746,18 @@ File: bison.info, Node: Yacc Library, Prev: Option Cross Key, Up: Invocation The Yacc library contains default implementations of the ‘yyerror’ and ‘main’ functions. These default implementations are normally not useful, but POSIX requires them. To use the Yacc library, link your -program with the ‘-ly’ option. Note that Bison’s implementation of the +program with the ‘-ly’ option. Note that Bison's implementation of the Yacc library is distributed under the terms of the GNU General Public License (*note Copying::). - If you use the Yacc library’s ‘yyerror’ function, you should declare + If you use the Yacc library's ‘yyerror’ function, you should declare ‘yyerror’ as follows: int yyerror (char const *); The ‘int’ value returned by this ‘yyerror’ is ignored. - The implementation of Yacc library’s ‘main’ function is: + The implementation of Yacc library's ‘main’ function is: int main (void) { @@ -10783,7 +10780,7 @@ File: bison.info, Node: Other Languages, Next: History, Prev: Invocation, Up In addition to C, Bison can generate parsers in C++, D and Java. This chapter is devoted to these languages. The reader is expected to understand how Bison works; read the introductory chapters first if you -don’t. +don't. * Menu: @@ -10832,7 +10829,7 @@ and that we generate C++. %require "3.2" %language "c++" - Let’s dive directly into the middle part: the grammar. Our input is + Let's dive directly into the middle part: the grammar. Our input is a simple list of strings, that we display once the parsing is done. %% @@ -10847,7 +10844,7 @@ a simple list of strings, that we display once the parsing is done. ; We used a vector of strings as a semantic value! To use genuine C++ -objects as semantic values—not just PODs—we cannot rely on the union +objects as semantic values--not just PODs--we cannot rely on the union that Bison uses by default to store them, we need _variants_ (*note C++ Variants::): @@ -11017,7 +11014,7 @@ argument for its constructor. A structure that contains (only) the ‘token_kind_type’ enumeration, which defines the tokens. To refer to the token ‘FOO’, use ‘yy::parser::token::FOO’. The scanner can use ‘typedef - yy::parser::token token;’ to “import” the token enumeration (*note + yy::parser::token token;’ to "import" the token enumeration (*note Calc++ Scanner::). -- Type of parser: token_kind_type @@ -11151,7 +11148,7 @@ section, and in particular, object types can be used without pointers. To enable variant-based semantic values, set the ‘%define’ variable ‘api.value.type’ to ‘variant’ (*note %define Summary::). Then ‘%union’ is ignored; instead of using the name of the fields of the ‘%union’ to -“type” the symbols, use genuine types. +"type" the symbols, use genuine types. For instance, instead of: @@ -11196,14 +11193,14 @@ Typed Midrule Actions::). from the variadic forwarding references U.... *Warning*: We do not use Boost.Variant, for two reasons. First, it -appeared unacceptable to require Boost on the user’s machine (i.e., the +appeared unacceptable to require Boost on the user's machine (i.e., the machine on which the generated parser will be compiled, not the machine on which ‘bison’ was run). Second, for each possible semantic value, Boost.Variant not only stores the value, but also a tag specifying its -type. But the parser already “knows” the type of the semantic value, so +type. But the parser already "knows" the type of the semantic value, so that would be duplicating the information. - We do not use C++17’s ‘std::variant’ either: we want to support all + We do not use C++17's ‘std::variant’ either: we want to support all the C++ standards, and of course ‘std::variant’ also stores a tag to record the current type. @@ -11363,13 +11360,13 @@ File: bison.info, Node: Exposing the Location Classes, Next: User Defined Loca ...................................... When both ‘%header’ and ‘%locations’ are enabled, Bison generates an -additional file: ‘location.hh’. If you don’t use locations outside of +additional file: ‘location.hh’. If you don't use locations outside of the parser, you may avoid its creation with ‘%define api.location.file none’. However this file is useful if, for instance, your parser builds an -abstract syntax tree decorated with locations: you may use Bison’s -‘location’ type independently of Bison’s parser. You may name the file +abstract syntax tree decorated with locations: you may use Bison's +‘location’ type independently of Bison's parser. You may name the file differently, e.g., ‘%define api.location.file "include/ast/location.hh"’: this name can have directory components, or even be absolute. The way the location file is included is controlled @@ -11489,7 +11486,7 @@ Function::), the user must define the following function. typedef symbol_kind::symbol_kind_t symbol_kind_type; -- Method on context: const symbol_type& lookahead () const - The “unexpected” token: the lookahead that caused the syntax error. + The "unexpected" token: the lookahead that caused the syntax error. -- Method on context: symbol_kind_type token () const The symbol kind of the lookahead token that caused the syntax @@ -11636,7 +11633,7 @@ expects ‘yylex’ to have the following prototype. yield additional arguments. -- Type of parser: symbol_type - A “complete symbol”, that binds together its kind, value and (when + A "complete symbol", that binds together its kind, value and (when applicable) location. -- Method on symbol_type: symbol_kind_type kind () const @@ -11763,8 +11760,8 @@ interface with.  File: bison.info, Node: Calc++ --- C++ Calculator, Next: Calc++ Parsing Driver, Up: A Complete C++ Example -10.1.8.1 Calc++ — C++ Calculator -................................ +10.1.8.1 Calc++ -- C++ Calculator +................................. Of course the grammar is dedicated to arithmetic, a single expression, possibly preceded by variable assignments. An environment containing @@ -11782,7 +11779,7 @@ File: bison.info, Node: Calc++ Parsing Driver, Next: Calc++ Parser, Prev: Cal .............................. To support a pure interface with the parser (and the scanner) the -technique of the “parsing context” is convenient: a structure containing +technique of the "parsing context" is convenient: a structure containing all the data to exchange. Since, in addition to simply launch the parsing, there are several auxiliary tasks to execute (open the file for scanning, instantiate the parser etc.), we recommend transforming the @@ -11894,7 +11891,7 @@ conversions. This example uses genuine C++ objects as semantic values, therefore, we require the variant-based storage of semantic values. To make sure we properly use it, we enable assertions. To fully benefit from -type-safety and more natural definition of “symbol”, we enable +type-safety and more natural definition of "symbol", we enable ‘api.token.constructor’. %define api.token.constructor @@ -11905,8 +11902,8 @@ Then come the declarations/inclusions needed by the semantic values. Because the parser uses the parsing driver and reciprocally, both would like to include the header of the other, which is, of course, insane. This mutual dependency will be broken using forward declarations. -Because the driver’s header needs detailed knowledge about the parser -class (in particular its inner types), it is the parser’s header which +Because the driver's header needs detailed knowledge about the parser +class (in particular its inner types), it is the parser's header which will use a forward declaration of the driver. *Note %code Summary::. %code requires { @@ -12008,8 +12005,8 @@ File: bison.info, Node: Calc++ Scanner, Next: Calc++ Top Level, Prev: Calc++ 10.1.8.4 Calc++ Scanner ....................... -In addition to standard headers, the Flex scanner includes the driver’s, -then the parser’s to get the set of defined tokens. +In addition to standard headers, the Flex scanner includes the driver's, +then the parser's to get the set of defined tokens. %{ /* -*- C++ -*- */ # include @@ -12021,8 +12018,8 @@ then the parser’s to get the set of defined tokens. # include "parser.hh" %} -Since our calculator has no ‘#include’-like feature, we don’t need -‘yywrap’. We don’t need the ‘unput’ and ‘input’ functions either, and +Since our calculator has no ‘#include’-like feature, we don't need +‘yywrap’. We don't need the ‘unput’ and ‘input’ functions either, and we parse an actual file, this is not an interactive session with the user. Finally, we enable scanner tracing. @@ -12098,8 +12095,8 @@ report errors. return yy::parser::make_NUMBER ((int) n, loc); } -Finally, because the scanner-related driver’s member-functions depend on -the scanner’s data, it is simpler to implement them in this file. +Finally, because the scanner-related driver's member-functions depend on +the scanner's data, it is simpler to implement them in this file. void driver::scan_begin () @@ -12209,7 +12206,7 @@ garbage collection. The parser will try to hold references to semantic values for as little time as needed. D parsers support ‘%printer’. An example for the output of type -‘int’, where ‘yyo’ is the parser’s debug output: +‘int’, where ‘yyo’ is the parser's debug output: %printer { yyo.write($$); } @@ -12518,7 +12515,7 @@ Summary::). returned if more input is required to finish parsing the input. If ‘api.push-pull’ is defined as ‘both’, then the generated parser -class will also implement the ‘parse’ method. This method’s body is a +class will also implement the ‘parse’ method. This method's body is a loop that repeatedly invokes the scanner and then passes the values obtained from the scanner to the ‘pushParse’ method. @@ -12581,7 +12578,7 @@ contains a single class for the parser. Contrary to C parsers, Java parsers do not use global variables; the state of the parser is always local to an instance of the parser class. -Therefore, all Java parsers are “pure”, and the ‘%define api.pure’ +Therefore, all Java parsers are "pure", and the ‘%define api.pure’ directive does nothing when used in Java. GLR parsers are currently unsupported in Java. Do not use the @@ -12598,7 +12595,7 @@ parser, so use ‘%define parse.trace’ explicitly if needed. Also, in the future the ‘%token-table’ directive might enable a public interface to access the token names and codes. - Getting a “code too large” error from the Java compiler means the + Getting a "code too large" error from the Java compiler means the code hit the 64KB bytecode per method limitation of the Java class file. Try reducing the amount of code in actions and static initializers; otherwise, report a bug so that the parser skeleton will be improved. @@ -12610,7 +12607,7 @@ File: bison.info, Node: Java Semantic Values, Next: Java Location Values, Pre --------------------------- There is no ‘%union’ directive in Java parsers. Instead, the semantic -values’ types (class names) should be specified in the ‘%nterm’ or +values' types (class names) should be specified in the ‘%nterm’ or ‘%token’ directive: %nterm expr assignment_expr term factor @@ -12776,7 +12773,7 @@ them automatically. must provide the parser with the following function: -- Static Method of YYParser: String i18n (string S) - Return the translation of S in the user’s language. As an example: + Return the translation of S in the user's language. As an example: %code { static ResourceBundle myResources @@ -13034,7 +13031,7 @@ following: 0 (success), 1 (abort), 2 (memory exhaustion), or input is required to finish parsing the grammar. If ‘api.push-pull’ is defined as ‘both’, then the generated parser -class will also implement the ‘parse’ method. This method’s body is a +class will also implement the ‘parse’ method. This method's body is a loop that repeatedly invokes the scanner and then passes the values obtained from the scanner to the ‘push_parse’ method. @@ -13265,7 +13262,7 @@ File: bison.info, Node: Yacc, Next: yacchack, Up: History 11.1 The ancestral Yacc ======================= -Bison originated as a workalike of a program called Yacc — Yet Another +Bison originated as a workalike of a program called Yacc -- Yet Another Compiler Compiler.(1) Yacc was written at Bell Labs as part of the very early development of Unix; one of its first uses was to develop the original Portable C Compiler, pcc. The same person, Steven C. Johnson, @@ -13289,13 +13286,13 @@ with less restrictive licenses and more features became available. Original Yacc became generally available when Caldera released the sources of old versions of Unix up to V7 and 32V in 2002. By that time -it had been long superseded in practical use by Bison even on Yacc’s +it had been long superseded in practical use by Bison even on Yacc's native Unix variants. ---------- Footnotes ---------- - (1) Because of the acronym, the name is sometimes given as “YACC”, -but Johnson used “Yacc” in the descriptive paper included in the Version + (1) Because of the acronym, the name is sometimes given as "YACC", +but Johnson used "Yacc" in the descriptive paper included in the Version 7 Unix Manual (https://s3.amazonaws.com/plan9-bell-labs/7thEdMan/v7vol2b.pdf). @@ -13309,7 +13306,7 @@ File: bison.info, Node: yacchack, Next: Byacc, Prev: Yacc, Up: History One of the deficiencies of original Yacc was its inability to produce reentrant parsers. This was first remedied by a set of drop-in -modifications called “yacchack”, published by Eric S. Raymond on USENET +modifications called "yacchack", published by Eric S. Raymond on USENET around 1983. This code was quickly forgotten when zoo and Berkeley Yacc became available a few years later. @@ -13320,14 +13317,14 @@ File: bison.info, Node: Byacc, Next: Bison, Prev: yacchack, Up: History ================== Berkeley Yacc was originated in 1985 by Robert Corbett (*note Corbett -1984::). It was originally named “zoo”, but by October 1989 it became +1984::). It was originally named "zoo", but by October 1989 it became known as Berkeley Yacc or byacc. Berkeley Yacc had three advantages over the ancestral Yacc: it generated faster parsers, it could generate reentrant parsers, and the source code was released to the public domain rather than being under an AT&T proprietary license. The better performance came from implementing -techniques from DeRemer and Penello’s seminal paper on LALR parsing +techniques from DeRemer and Penello's seminal paper on LALR parsing (*note DeRemer 1982::). Use of byacc spread rapidly due to its public domain license. @@ -13341,12 +13338,12 @@ File: bison.info, Node: Bison, Next: Other Ungulates, Prev: Byacc, Up: Histo ========== Robert Corbett actually wrote two (closely related) LALR parsers in -1985, both using the DeRemer/Penello techniques. One was “zoo”, the -other was “Byson”. In 1987 Richard Stallman began working on Byson; the +1985, both using the DeRemer/Penello techniques. One was "zoo", the +other was "Byson". In 1987 Richard Stallman began working on Byson; the name changed to Bison and the interface became Yacc-compatible. The main visible difference between Yacc and Byson/Bison at the time -of Byson’s first release is that Byson supported the ‘@N’ construct +of Byson's first release is that Byson supported the ‘@N’ construct (giving access to the starting and ending line number and character number associated with any of the symbols in the current rule). @@ -13391,8 +13388,8 @@ the early ports are extinct along with the languages that hosted them; others have been superseded by parser skeletons shipped with Bison. However, independent implementations persist. One of the best-known -still in use is David Beazley’s “PLY” (Python Lex-Yacc) for Python. -Another is goyacc, supporting the Go language. An “ocamlyacc” is +still in use is David Beazley's "PLY" (Python Lex-Yacc) for Python. +Another is goyacc, supporting the Go language. An "ocamlyacc" is shipped as part of the Ocaml compiler suite.  @@ -13574,7 +13571,7 @@ manipulate multiple input buffers. If your Flex-generated scanner uses start conditions (*note Start conditions: (flex)Start conditions.), you might also want to reset the -scanner’s state, i.e., go back to the initial start condition, through a +scanner's state, i.e., go back to the initial start condition, through a call to ‘BEGIN (0)’.  @@ -13587,7 +13584,7 @@ File: bison.info, Node: Strings are Destroyed, Next: Implementing Gotos/Loops, them. Instead of reporting ‘"foo", "bar"’, it reports ‘"bar", "bar"’, or even ‘"foo\nbar", "bar"’. - This error is probably the single most frequent “bug report” sent to + This error is probably the single most frequent "bug report" sent to Bison lists, but is only concerned with a misunderstanding of the role of the scanner. Consider the following Lex code: @@ -13639,9 +13636,9 @@ File: bison.info, Node: Implementing Gotos/Loops, Next: Multiple start-symbols functions, but how can I implement gotos, or loops? Although very pedagogical, the examples included in the document blur -the distinction to make between the parser—whose job is to recover the +the distinction to make between the parser--whose job is to recover the structure of a text and to transmit it to subsequent modules of the -program—and the processing (such as the execution) of this structure. +program--and the processing (such as the execution) of this structure. This works well with so called straight line programs, i.e., precisely those that have a straightforward execution model: execute simple instructions one after the others. @@ -13709,7 +13706,7 @@ File: bison.info, Node: Secure? Conform?, Next: Enabling Relocatability, Prev Is Bison secure? Does it conform to POSIX? - If you’re looking for a guarantee or certification, we don’t provide + If you're looking for a guarantee or certification, we don't provide it. However, Bison is intended to be a reliable program that conforms to the POSIX specification for Yacc. If you run into problems, please send us a bug report. @@ -13728,7 +13725,7 @@ through ‘configure; make; make install’ with all its dependencies, options, and hurdles. Most package management systems, that allow the user to install -pre-built binaries of the packages, solve the “ease of installation” +pre-built binaries of the packages, solve the "ease of installation" problem, but they hardwire path names, usually to ‘/usr’ or ‘/usr/local’. This means that users need root privileges to install a binary package, and prevents installing two different versions of the @@ -13760,7 +13757,7 @@ also do not recommend prefixes that might be behind an automounter (e.g. ‘$HOME/inst$$’) because of the performance impact of directory searching. - Here’s a sample installation run that takes into account all these + Here's a sample installation run that takes into account all these recommendations: ./configure --enable-relocatable --prefix=/nonexistent @@ -13779,29 +13776,29 @@ executes the real program).  File: bison.info, Node: I can't build Bison, Next: Where can I find help?, Prev: Enabling Relocatability, Up: FAQ -13.8 I can’t build Bison +13.8 I can't build Bison ======================== - I can’t build Bison because ‘make’ complains that ‘msgfmt’ is not + I can't build Bison because ‘make’ complains that ‘msgfmt’ is not found. What should I do? Like most GNU packages with internationalization support, that feature is turned on by default. If you have problems building in the -‘po’ subdirectory, it indicates that your system’s internationalization +‘po’ subdirectory, it indicates that your system's internationalization support is lacking. You can re-configure Bison with ‘--disable-nls’ to turn off this support, or you can install GNU gettext from and re-configure Bison. See the file ‘ABOUT-NLS’ for more information. - I can’t build Bison because my C compiler is too old. + I can't build Bison because my C compiler is too old. Except for GLR parsers (which require C99), the C code that Bison generates requires only C89 or later. However, Bison itself requires -common C99 features such as declarations after statements. Bison’s +common C99 features such as declarations after statements. Bison's ‘configure’ script attempts to enable C99 (or later) support on compilers that default to pre-C99. If your compiler lacks these C99 features entirely, GCC may well be a better choice; or you can try -upgrading to your compiler’s latest version. +upgrading to your compiler's latest version.  File: bison.info, Node: Where can I find help?, Next: Bug Reports, Prev: I can't build Bison, Up: FAQ @@ -13809,7 +13806,7 @@ File: bison.info, Node: Where can I find help?, Next: Bug Reports, Prev: I ca 13.9 Where can I find help? =========================== - I’m having trouble using Bison. Where can I find help? + I'm having trouble using Bison. Where can I find help? First, read this fine manual. Beyond that, you can send mail to . This mailing list is intended to be populated @@ -13842,7 +13839,7 @@ to edit or add anything). The smaller and simpler the grammar, the easier it will be to fix the bug. Include information about your compilation environment, including -your operating system’s name and version and your compiler’s name and +your operating system's name and version and your compiler's name and version. If you have trouble compiling, you should also include a transcript of the build session, starting with the invocation of ‘configure’. Depending on the nature of the bug, you may be asked to @@ -13862,7 +13859,7 @@ File: bison.info, Node: More Languages, Next: Beta Testing, Prev: Bug Reports Will Bison ever have C++ and Java support? How about INSERT YOUR FAVORITE LANGUAGE HERE? - C++, D and Java are supported. We’d love to add other languages; + C++, D and Java are supported. We'd love to add other languages; contributions are welcome.  @@ -13873,7 +13870,7 @@ File: bison.info, Node: Beta Testing, Next: Mailing Lists, Prev: More Languag What is involved in being a beta tester? - It’s not terribly involved. Basically, you would download a test + It's not terribly involved. Basically, you would download a test release, compile it, and use it to build and run a parser or two. After that, you would submit either a bug report or a message saying that everything is okay. It is important to report successes as well as @@ -13959,7 +13956,7 @@ Appendix A Bison Symbols Comments, as in C/C++. -- Delimiter: : - Separates a rule’s result from its components. *Note Rules::. + Separates a rule's result from its components. *Note Rules::. -- Delimiter: ; Terminates a rule. *Note Rules::. @@ -13998,7 +13995,7 @@ Appendix A Bison Symbols -- Directive: %define VARIABLE VALUE -- Directive: %define VARIABLE {VALUE} -- Directive: %define VARIABLE "VALUE" - Define a variable to adjust Bison’s behavior. *Note %define + Define a variable to adjust Bison's behavior. *Note %define Summary::. -- Directive: %defines @@ -14242,7 +14239,7 @@ Appendix A Bison Symbols External variable in which ‘yylex’ should place the line and column numbers associated with a token. (In a pure parser, it is a local variable within ‘yyparse’, and its address is passed to ‘yylex’.) - You can ignore this variable if you don’t use the ‘@’ feature in + You can ignore this variable if you don't use the ‘@’ feature in the grammar actions. *Note Token Locations::. In semantic actions, it stores the location of the lookahead token. *Note Actions and Locations::. @@ -14352,7 +14349,7 @@ Accepting state A state whose only action is the accept action. The accepting state is thus a consistent state. *Note Understanding::. -Backus-Naur Form (BNF; also called “Backus Normal Form”) +Backus-Naur Form (BNF; also called "Backus Normal Form") Formal method of specifying context-free grammars originally proposed by John Backus, and slightly improved by Peter Naur in his 1960-01-02 committee document contributing to what became the Algol @@ -14401,7 +14398,7 @@ Empty string character string of length zero. Finite-state stack machine - A “machine” that has discrete states in which it is said to exist + A "machine" that has discrete states in which it is said to exist at each instant in time. As input to the machine is processed, the machine moves from state to state as specified by the logic of the machine. In the case of the parser, the input is the language @@ -14411,14 +14408,14 @@ Finite-state stack machine Generalized LR (GLR) A parsing algorithm that can handle all context-free grammars, including those that are not LR(1). It resolves situations that - Bison’s deterministic parsing algorithm cannot by effectively + Bison's deterministic parsing algorithm cannot by effectively splitting off multiple parsers, trying all possible parsers, and discarding those that fail in the light of additional right context. *Note Generalized LR Parsing::. Grouping A language construct that is (in general) grammatically divisible; - for example, ‘expression’ or ‘declaration’ in C. *Note Language + for example, 'expression' or 'declaration' in C. *Note Language and Grammar::. IELR(1) (Inadequacy Elimination LR(1)) @@ -14427,7 +14424,7 @@ IELR(1) (Inadequacy Elimination LR(1)) with the full language-recognition power of canonical LR(1) but with nearly the same number of parser states as LALR(1). This reduction in parser states is often an order of magnitude. More - importantly, because canonical LR(1)’s extra parser states may + importantly, because canonical LR(1)'s extra parser states may contain duplicate conflicts in the case of non-LR(1) grammars, the number of conflicts for IELR(1) is often an order of magnitude less as well. This can significantly reduce the complexity of @@ -14441,25 +14438,25 @@ Input stream A continuous flow of data between devices or programs. Kind - “Token” and “symbol” are each overloaded to mean either a grammar + "Token" and "symbol" are each overloaded to mean either a grammar symbol (kind) or all parse info (kind, value, location) associated with occurrences of that grammar symbol from the input. To disambiguate, - • we use “token kind” and “symbol kind” to mean both grammar + • we use "token kind" and "symbol kind" to mean both grammar symbols and the values that represent them in a base programming language (C, C++, etc.). The names of the types of these values are typically ‘token_kind_t’, or ‘token_kind_type’, or ‘TokenKind’, depending on the programming language. - • we use “token” and “symbol” without the word “kind” to mean - parsed occurrences, and we append the word “type” to refer to + • we use "token" and "symbol" without the word "kind" to mean + parsed occurrences, and we append the word "type" to refer to the types that represent them in a base programming language. - In summary: When you see “kind”, interpret “symbol” or “token” to - mean a _grammar symbol_. When you don’t see “kind” (including when - you see “type”), interpret “symbol” or “token” to mean a _parsed + In summary: When you see "kind", interpret "symbol" or "token" to + mean a _grammar symbol_. When you don't see "kind" (including when + you see "type"), interpret "symbol" or "token" to mean a _parsed symbol_. LAC (Lookahead Correction) @@ -14594,7 +14591,7 @@ Token kind Unreachable state A parser state to which there does not exist a sequence of - transitions from the parser’s start state. A state can become + transitions from the parser's start state. A state can become unreachable during conflict resolution. *Note Unreachable States::. @@ -14622,7 +14619,7 @@ Appendix C GNU Free Documentation License author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. - This License is a kind of “copyleft”, which means that derivative + This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. @@ -14643,18 +14640,18 @@ Appendix C GNU Free Documentation License be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The - “Document”, below, refers to any such manual or work. Any member - of the public is a licensee, and is addressed as “you”. You accept + "Document", below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. - A “Modified Version” of the Document means any work containing the + A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. - A “Secondary Section” is a named appendix or a front-matter section + A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the - publishers or authors of the Document to the Document’s overall + publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not @@ -14663,7 +14660,7 @@ Appendix C GNU Free Documentation License of legal, commercial, philosophical, ethical or political position regarding them. - The “Invariant Sections” are certain Secondary Sections whose + The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it @@ -14671,13 +14668,13 @@ Appendix C GNU Free Documentation License contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. - The “Cover Texts” are certain short passages of text that are + The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. - A “Transparent” copy of the Document means a machine-readable copy, + A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed @@ -14689,7 +14686,7 @@ Appendix C GNU Free Documentation License been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not - “Transparent” is called “Opaque”. + "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, @@ -14702,23 +14699,23 @@ Appendix C GNU Free Documentation License the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. - The “Title Page” means, for a printed book, the title page itself, + The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For - works in formats which do not have any title page as such, “Title - Page” means the text near the most prominent appearance of the - work’s title, preceding the beginning of the body of the text. + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. - The “publisher” means any person or entity that distributes copies + The "publisher" means any person or entity that distributes copies of the Document to the public. - A section “Entitled XYZ” means a named subunit of the Document + A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as - “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) - To “Preserve the Title” of such a section when you modify the - Document means that it remains a section “Entitled XYZ” according + "Acknowledgements", "Dedications", "Endorsements", or "History".) + To "Preserve the Title" of such a section when you modify the + Document means that it remains a section "Entitled XYZ" according to this definition. The Document may include Warranty Disclaimers next to the notice @@ -14748,7 +14745,7 @@ Appendix C GNU Free Documentation License If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and - the Document’s license notice requires Cover Texts, you must + the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly @@ -14820,15 +14817,15 @@ Appendix C GNU Free Documentation License the Addendum below. G. Preserve in that license notice the full lists of Invariant - Sections and required Cover Texts given in the Document’s + Sections and required Cover Texts given in the Document's license notice. H. Include an unaltered copy of this License. - I. Preserve the section Entitled “History”, Preserve its Title, + I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the - Title Page. If there is no section Entitled “History” in the + Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the @@ -14838,12 +14835,12 @@ Appendix C GNU Free Documentation License for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the - “History” section. You may omit a network location for a work + "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. - K. For any section Entitled “Acknowledgements” or “Dedications”, + K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. @@ -14852,11 +14849,11 @@ Appendix C GNU Free Documentation License in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. - M. Delete any section Entitled “Endorsements”. Such a section + M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version. N. Do not retitle any existing section to be Entitled - “Endorsements” or to conflict in title with any Invariant + "Endorsements" or to conflict in title with any Invariant Section. O. Preserve any Warranty Disclaimers. @@ -14865,15 +14862,15 @@ Appendix C GNU Free Documentation License appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their - titles to the list of Invariant Sections in the Modified Version’s + titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. - You may add a section Entitled “Endorsements”, provided it contains + You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various - parties—for example, statements of peer review or that the text has - been approved by an organization as the authoritative definition of - a standard. + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of @@ -14911,10 +14908,10 @@ Appendix C GNU Free Documentation License combined work. In the combination, you must combine any sections Entitled - “History” in the various original documents, forming one section - Entitled “History”; likewise combine any sections Entitled - “Acknowledgements”, and any sections Entitled “Dedications”. You - must delete all sections Entitled “Endorsements.” + "History" in the various original documents, forming one section + Entitled "History"; likewise combine any sections Entitled + "Acknowledgements", and any sections Entitled "Dedications". You + must delete all sections Entitled "Endorsements." 6. COLLECTIONS OF DOCUMENTS @@ -14935,16 +14932,16 @@ Appendix C GNU Free Documentation License A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a - storage or distribution medium, is called an “aggregate” if the + storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the - legal rights of the compilation’s users beyond what the individual + legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half - of the entire aggregate, the Document’s Cover Texts may be placed + of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket @@ -14966,8 +14963,8 @@ Appendix C GNU Free Documentation License this License or a notice or disclaimer, the original version will prevail. - If a section in the Document is Entitled “Acknowledgements”, - “Dedications”, or “History”, the requirement (section 4) to + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. @@ -15008,7 +15005,7 @@ Appendix C GNU Free Documentation License Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered - version of this License “or any later version” applies to it, you + version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the @@ -15016,29 +15013,29 @@ Appendix C GNU Free Documentation License choose any version ever published (not as a draft) by the Free Software Foundation. If the Document specifies that a proxy can decide which future versions of this License can be used, that - proxy’s public statement of acceptance of a version permanently + proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Document. 11. RELICENSING - “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any + "Massive Multiauthor Collaboration Site" (or "MMC Site") means any World Wide Web server that publishes copyrightable works and also provides prominent facilities for anybody to edit those works. A public wiki that anybody can edit is an example of such a server. - A “Massive Multiauthor Collaboration” (or “MMC”) contained in the + A "Massive Multiauthor Collaboration" (or "MMC") contained in the site means any set of copyrightable works thus published on the MMC site. - “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 + "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 license published by Creative Commons Corporation, a not-for-profit corporation with a principal place of business in San Francisco, California, as well as future copyleft versions of that license published by that same organization. - “Incorporate” means to publish or republish a Document, in whole or + "Incorporate" means to publish or republish a Document, in whole or in part, as part of another Document. - An MMC is “eligible for relicensing” if it is licensed under this + An MMC is "eligible for relicensing" if it is licensed under this License, and if all works that were first published under this License somewhere other than this MMC, and subsequently incorporated in whole or in part into the MMC, (1) had no cover @@ -15065,7 +15062,7 @@ notices just after the title page: Free Documentation License''. If you have Invariant Sections, Front-Cover Texts and Back-Cover -Texts, replace the “with...Texts.” line with this: +Texts, replace the "with...Texts." line with this: with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts @@ -15088,7 +15085,7 @@ Bibliography [Corbett 1984] Robert Paul Corbett, Static Semantics in Compiler Error Recovery - Ph.D. Dissertation, Report No. UCB/CSD 85/251, Department of + Ph.D. Dissertation, Report No. UCB/CSD 85/251, Department of Electrical Engineering and Computer Science, Compute Science Division, University of California, Berkeley, California (June 1985). @@ -15097,7 +15094,7 @@ Bibliography Joel E. Denny and Brian A. Malloy, IELR(1): Practical LR(1) Parser Tables for Non-LR(1) Grammars with Conflict Resolution, in ‘Proceedings of the 2008 ACM Symposium on Applied Computing’ - (SAC’08), ACM, New York, NY, USA, pp. 240–245. + (SAC'08), ACM, New York, NY, USA, pp. 240-245. [Denny 2010 May] @@ -15110,32 +15107,32 @@ Bibliography Joel E. Denny and Brian A. Malloy, The IELR(1) Algorithm for Generating Minimal LR(1) Parser Tables for Non-LR(1) Grammars with Conflict Resolution, in ‘Science of Computer Programming’, Vol. 75, - Issue 11 (November 2010), pp. 943–979. + Issue 11 (November 2010), pp. 943-979. [DeRemer 1982] Frank DeRemer and Thomas Pennello, Efficient Computation of LALR(1) Look-Ahead Sets, in ‘ACM Transactions on Programming Languages and - Systems’, Vol. 4, No. 4 (October 1982), pp. 615–649. + Systems’, Vol. 4, No. 4 (October 1982), pp. 615-649. [Isradisaikul 2015] Chinawat Isradisaikul, Andrew Myers, Finding Counterexamples from Parsing Conflicts, in ‘Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation’ (PLDI - ’15), ACM, pp. 555–564. + '15), ACM, pp. 555-564. [Johnson 1978] Steven C. Johnson, A portable compiler: theory and practice, in ‘Proceedings of the 5th ACM SIGACT-SIGPLAN symposium on Principles - of programming languages’ (POPL ’78), pp. 97–104. + of programming languages’ (POPL '78), pp. 97-104. . [Knuth 1965] Donald E. Knuth, On the Translation of Languages from Left to Right, in ‘Information and Control’, Vol. 8, Issue 6 (December - 1965), pp. 607–639. + 1965), pp. 607-639. [Scott 2000] @@ -15154,39 +15151,42 @@ Index of Terms [index] * Menu: -* $$: Actions. (line 6) -* $$ <1>: Java Action Features. - (line 20) -* $$ <2>: Action Features. (line 9) -* $$ <3>: D Action Features. (line 9) -* $$ <4>: Table of Symbols. (line 28) -* $$: Java Action Features. - (line 28) -* $$ <1>: Action Features. (line 17) -* $N: Java Action Features. - (line 16) -* $N <1>: Action Features. (line 21) -* $@N: Midrule Action Translation. +* ;: Table of Symbols. (line 65) +* :: Table of Symbols. (line 62) +* @[NAME]: Actions and Locations. (line 6) -* $@N <1>: Table of Symbols. (line 23) -* $accept: Table of Symbols. (line 84) -* $end: Table of Symbols. (line 122) -* $N: Actions. (line 6) -* $N <1>: Java Action Features. - (line 12) -* $N <2>: Action Features. (line 13) -* $N <3>: D Action Features. (line 13) -* $N <4>: Table of Symbols. (line 32) -* $NAME: Actions. (line 6) -* $NAME <1>: Table of Symbols. (line 36) -* $undefined: Table of Symbols. (line 253) -* $[NAME]: Actions. (line 6) -* $[NAME] <1>: Table of Symbols. (line 37) +* @[NAME] <1>: Table of Symbols. (line 19) +* @$: Actions and Locations. + (line 6) +* @$ <1>: Java Action Features. + (line 38) +* @$ <2>: Action Features. (line 99) +* @$ <3>: Table of Symbols. (line 6) +* @N: Midrule Action Translation. + (line 6) +* @N <1>: Actions and Locations. + (line 6) +* @N <2>: Java Action Features. + (line 34) +* @N <3>: Action Features. (line 104) +* @N <4>: Action Features. (line 105) +* @N <5>: Table of Symbols. (line 10) +* @N <6>: Table of Symbols. (line 11) +* @NAME: Actions and Locations. + (line 6) +* @NAME <1>: Table of Symbols. (line 18) +* /*: Table of Symbols. (line 58) +* /* ... */: Grammar Outline. (line 6) +* //: Table of Symbols. (line 59) +* // ...: Grammar Outline. (line 6) +* %?: Semantic Predicates. (line 6) +* %?{EXPRESSION}: Table of Symbols. (line 50) +* %{: Java Declarations Summary. + (line 51) +* %{CODE%}: Table of Symbols. (line 45) * %%: Java Declarations Summary. (line 47) * %% <1>: Table of Symbols. (line 41) -* %?: Semantic Predicates. (line 6) -* %?{EXPRESSION}: Table of Symbols. (line 50) * %code: Prologue Alternatives. (line 6) * %code <1>: Decl Summary. (line 52) @@ -15443,45 +15443,42 @@ Index of Terms * %union <3>: Table of Symbols. (line 258) * %verbose: Decl Summary. (line 241) * %yacc: Decl Summary. (line 246) -* %{: Java Declarations Summary. - (line 51) -* %{CODE%}: Table of Symbols. (line 45) -* /*: Table of Symbols. (line 58) -* /* ... */: Grammar Outline. (line 6) -* //: Table of Symbols. (line 59) -* // ...: Grammar Outline. (line 6) -* :: Table of Symbols. (line 62) -* ;: Table of Symbols. (line 65) * <*>: Destructor Decl. (line 6) * <*> <1>: Printer Decl. (line 6) * <*> <2>: Table of Symbols. (line 72) * <>: Destructor Decl. (line 6) * <> <1>: Printer Decl. (line 6) * <> <2>: Table of Symbols. (line 78) -* @$: Actions and Locations. - (line 6) -* @$ <1>: Java Action Features. - (line 38) -* @$ <2>: Action Features. (line 99) -* @$ <3>: Table of Symbols. (line 6) -* @N: Midrule Action Translation. - (line 6) -* @N <1>: Actions and Locations. - (line 6) -* @N <2>: Java Action Features. - (line 34) -* @N <3>: Action Features. (line 104) -* @N <4>: Action Features. (line 105) -* @N <5>: Table of Symbols. (line 10) -* @N <6>: Table of Symbols. (line 11) -* @NAME: Actions and Locations. - (line 6) -* @NAME <1>: Table of Symbols. (line 18) -* @[NAME]: Actions and Locations. - (line 6) -* @[NAME] <1>: Table of Symbols. (line 19) * |: Rules Syntax. (line 48) * | <1>: Table of Symbols. (line 68) +* $[NAME]: Actions. (line 6) +* $[NAME] <1>: Table of Symbols. (line 37) +* $@N: Midrule Action Translation. + (line 6) +* $@N <1>: Table of Symbols. (line 23) +* $$: Java Action Features. + (line 28) +* $$ <1>: Action Features. (line 17) +* $N: Java Action Features. + (line 16) +* $N <1>: Action Features. (line 21) +* $$: Actions. (line 6) +* $$ <1>: Java Action Features. + (line 20) +* $$ <2>: Action Features. (line 9) +* $$ <3>: D Action Features. (line 9) +* $$ <4>: Table of Symbols. (line 28) +* $accept: Table of Symbols. (line 84) +* $end: Table of Symbols. (line 122) +* $N: Actions. (line 6) +* $N <1>: Java Action Features. + (line 12) +* $N <2>: Action Features. (line 13) +* $N <3>: D Action Features. (line 13) +* $N <4>: Table of Symbols. (line 32) +* $NAME: Actions. (line 6) +* $NAME <1>: Table of Symbols. (line 36) +* $undefined: Table of Symbols. (line 253) * abstract syntax tree: Implementing Gotos/Loops. (line 17) * accepting state: Understanding. (line 185) @@ -15517,6 +15514,8 @@ Index of Terms * Bison parser algorithm: Algorithm. (line 6) * Bison symbols, table of: Table of Symbols. (line 6) * Bison utility: Bison Parser. (line 6) +* BISON_I18N: Enabling I18n. (line 18) +* BISON_LOCALEDIR: Enabling I18n. (line 18) * bison-i18n.m4: Enabling I18n. (line 11) * bison-po: Internationalization. (line 6) @@ -15526,8 +15525,6 @@ Index of Terms * bisonVersion of YYParser: D Parser Interface. (line 69) * bisonVersion of YYParser <1>: Java Parser Interface. (line 91) -* BISON_I18N: Enabling I18n. (line 18) -* BISON_LOCALEDIR: Enabling I18n. (line 18) * BNF: Language and Grammar. (line 16) * braced code: Rules Syntax. (line 29) @@ -15567,19 +15564,19 @@ Index of Terms (line 6) * controlling function: Rpcalc Main. (line 6) * core, item set: Understanding. (line 132) +* counter_type: C++ position. (line 11) * counterexample, nonunifying: Glossary. (line 31) * counterexample, unifying: Glossary. (line 31) * counterexamples: Counterexamples. (line 6) -* counter_type: C++ position. (line 11) * dangling else: Shift/Reduce. (line 6) * data type of locations: Location Type. (line 6) * data types in actions: Action Types. (line 6) * data types of semantic values: Value Type. (line 6) -* debugging: Tracing. (line 6) * debug_level on parser: C++ Parser Interface. (line 91) * debug_stream on parser: C++ Parser Interface. (line 86) +* debugging: Tracing. (line 6) * declaration summary: Decl Summary. (line 6) * declarations: Prologue. (line 6) * declarations section: Prologue. (line 6) @@ -15781,10 +15778,10 @@ Index of Terms (line 27) * location tracking calculator: Location Tracking Calc. (line 6) -* location, textual: Locations. (line 6) -* location, textual <1>: Tracking Locations. (line 6) * location_type: C++ Parser Interface. (line 49) +* location, textual: Locations. (line 6) +* location, textual <1>: Tracking Locations. (line 6) * lookahead correction: LAC. (line 6) * lookahead on context: C++ Parser Context. (line 43) * lookahead token: Lookahead. (line 6) @@ -15824,6 +15821,10 @@ Index of Terms * nonunifying counterexample: Glossary. (line 31) * operator precedence: Precedence. (line 6) * operator precedence, declaring: Precedence Decl. (line 6) +* operator- on location: C++ location. (line 30) +* operator- on position: C++ position. (line 45) +* operator-= on location: C++ location. (line 31) +* operator-= on position: C++ position. (line 44) * operator!= on location: C++ location. (line 43) * operator!= on position: C++ position. (line 49) * operator() on parser: C++ Parser Interface. @@ -15834,10 +15835,6 @@ Index of Terms * operator+= on location: C++ location. (line 29) * operator+= on location <1>: C++ location. (line 35) * operator+= on position: C++ position. (line 42) -* operator- on location: C++ location. (line 30) -* operator- on position: C++ position. (line 45) -* operator-= on location: C++ location. (line 31) -* operator-= on position: C++ position. (line 44) * operator<<: C++ position. (line 52) * operator<< <1>: C++ location. (line 47) * operator== on location: C++ location. (line 42) @@ -15875,14 +15872,14 @@ Index of Terms * pure parser: Pure Decl. (line 6) * push parser: Push Decl. (line 6) * push parser <1>: Push Decl. (line 6) -* pushParse on YYParser: D Push Parser Interface. - (line 18) * push_parse on YYParser: Java Push Parser Interface. (line 18) * push_parse on YYParser <1>: Java Push Parser Interface. (line 19) * push_parse on YYParser <2>: Java Push Parser Interface. (line 21) +* pushParse on YYParser: D Push Parser Interface. + (line 18) * questions: FAQ. (line 6) * recovering: Java Action Features. (line 54) @@ -15897,11 +15894,11 @@ Index of Terms * reduce/reduce conflicts <2>: Merging GLR Parses. (line 6) * reduction: Algorithm. (line 6) * reentrant parser: Pure Decl. (line 6) +* report_syntax_error on parser: C++ Parser Context. (line 9) * reportSyntaxError on Lexer: Java Scanner Interface. (line 59) * reportSyntaxError(YYParser.Context on Lexer: D Scanner Interface. (line 34) -* report_syntax_error on parser: C++ Parser Context. (line 9) * requiring a version of Bison: Require Decl. (line 6) * Reverse Polish Notation: RPN Calc. (line 6) * right recursion: Recursion. (line 17) @@ -15917,6 +15914,10 @@ Index of Terms * Semantic predicates in GLR parsers: Semantic Predicates. (line 6) * semantic value: Semantic Values. (line 6) * semantic value type: Value Type. (line 6) +* set_debug_level on parser: C++ Parser Interface. + (line 92) +* set_debug_stream on parser: C++ Parser Interface. + (line 87) * setDebugLevel on YYParser: Java Parser Interface. (line 87) * setDebugLevel(int on YYParser: D Parser Interface. (line 65) @@ -15926,10 +15927,6 @@ Index of Terms * setErrorVerbose on YYParser: Java Parser Interface. (line 65) * setErrorVerbose(boolean on YYParser: D Parser Interface. (line 44) -* set_debug_level on parser: C++ Parser Interface. - (line 92) -* set_debug_stream on parser: C++ Parser Interface. - (line 87) * shift/reduce conflicts: GLR Parsers. (line 6) * shift/reduce conflicts <1>: Simple GLR Parsers. (line 6) * shift/reduce conflicts <2>: Shift/Reduce. (line 6) @@ -15950,13 +15947,6 @@ Index of Terms * suppressing conflict warnings: Expect Decl. (line 6) * symbol: Symbols. (line 6) * symbol table example: Mfcalc Symbol Table. (line 6) -* SymbolKind: D Parser Context Interface. - (line 9) -* SymbolKind <1>: Java Parser Context Interface. - (line 9) -* symbols (abstract): Language and Grammar. - (line 46) -* symbols in Bison, table of: Table of Symbols. (line 6) * symbol_kind_type: C++ Parser Context. (line 19) * symbol_name on parser: C++ Parser Context. (line 68) * symbol_type: Complete Symbols. (line 17) @@ -15964,6 +15954,13 @@ Index of Terms * symbol_type on parser::symbol_type <1>: Complete Symbols. (line 34) * symbol_type on parser::symbol_type <2>: Complete Symbols. (line 36) * symbol_type on parser::symbol_type <3>: Complete Symbols. (line 38) +* SymbolKind: D Parser Context Interface. + (line 9) +* SymbolKind <1>: Java Parser Context Interface. + (line 9) +* symbols (abstract): Language and Grammar. + (line 46) +* symbols in Bison, table of: Table of Symbols. (line 6) * syntactic grouping: Language and Grammar. (line 46) * syntax error: Error Reporting Function. @@ -15978,8 +15975,8 @@ Index of Terms * terminal symbol: Symbols. (line 6) * textual location: Locations. (line 6) * textual location <1>: Tracking Locations. (line 6) -* this(Lexer on YYParser: D Parser Interface. (line 34) * this(LEX_PARAM, on YYParser: D Parser Interface. (line 29) +* this(Lexer on YYParser: D Parser Interface. (line 34) * this(Position on Location: D Location Values. (line 14) * this(Position on Location <1>: D Location Values. (line 18) * token: Language and Grammar. @@ -15989,9 +15986,9 @@ Index of Terms * token kind: Symbols. (line 6) * token kind names, declaring: Token Decl. (line 6) * token on context: C++ Parser Context. (line 46) -* token, useless: Understanding. (line 56) * token_kind_type: C++ Parser Interface. (line 21) +* token, useless: Understanding. (line 56) * toString on Location: Java Location Values. (line 30) * toString() on Location: D Location Values. (line 21) @@ -16011,9 +16008,9 @@ Index of Terms * value types, declaring <2>: Structured Value Type. (line 6) * value types, nonterminals, declaring: Type Decl. (line 6) -* value, semantic: Semantic Values. (line 6) * value_type: C++ Parser Interface. (line 46) +* value, semantic: Semantic Values. (line 6) * version: Versioning. (line 6) * version requirement: Require Decl. (line 6) * warnings, preventing: Expect Decl. (line 6) @@ -16181,270 +16178,269 @@ Index of Terms * YYUNDEF: Table of Symbols. (line 443) * zoo: Bison. (line 6) -  Tag Table: -Node: Top1066 -Node: Introduction18219 -Node: Conditions19794 -Node: Copying21717 -Node: Concepts59459 -Node: Language and Grammar60655 -Node: Grammar in Bison66769 -Node: Semantic Values68685 -Node: Semantic Actions70821 -Node: GLR Parsers71998 -Node: Simple GLR Parsers74773 -Node: Merging GLR Parses81253 -Ref: Merging GLR Parses-Footnote-186591 -Node: GLR Semantic Actions86732 -Node: Semantic Predicates89333 -Node: Locations91786 -Node: Bison Parser93264 -Node: Stages96464 -Node: Grammar Layout97689 -Node: Examples99051 -Node: RPN Calc100544 -Ref: RPN Calc-Footnote-1101596 -Node: Rpcalc Declarations101674 -Node: Rpcalc Rules103730 -Node: Rpcalc Input105629 -Node: Rpcalc Line107208 -Node: Rpcalc Exp108360 -Node: Rpcalc Lexer110373 -Node: Rpcalc Main113070 -Node: Rpcalc Error113481 -Node: Rpcalc Generate114509 -Node: Rpcalc Compile115757 -Node: Infix Calc116721 -Ref: Infix Calc-Footnote-1119567 -Node: Simple Error Recovery119720 -Node: Location Tracking Calc121658 -Node: Ltcalc Declarations122358 -Node: Ltcalc Rules123453 -Node: Ltcalc Lexer125295 -Node: Multi-function Calc127636 -Ref: Multi-function Calc-Footnote-1129413 -Node: Mfcalc Declarations129491 -Node: Mfcalc Rules131515 -Node: Mfcalc Symbol Table132793 -Node: Mfcalc Lexer136255 -Node: Mfcalc Main138828 -Node: Exercises139704 -Node: Grammar File140231 -Node: Grammar Outline141081 -Node: Prologue141939 -Node: Prologue Alternatives143740 -Ref: Prologue Alternatives-Footnote-1153440 -Node: Bison Declarations153545 -Node: Grammar Rules153955 -Node: Epilogue154411 -Node: Symbols155462 -Node: Rules162497 -Node: Rules Syntax162812 -Node: Empty Rules164877 -Node: Recursion165964 -Node: Semantics167622 -Node: Value Type168928 -Node: Multiple Types170216 -Node: Type Generation171666 -Node: Union Decl173596 -Node: Structured Value Type174989 -Node: Actions176015 -Node: Action Types179899 -Node: Midrule Actions181252 -Node: Using Midrule Actions181906 -Node: Typed Midrule Actions185445 -Node: Midrule Action Translation186995 -Node: Midrule Conflicts189488 -Node: Tracking Locations192097 -Node: Location Type192829 -Node: Actions and Locations194352 -Node: Printing Locations196734 -Node: Location Default Action197496 -Node: Named References201033 -Node: Declarations203630 -Node: Require Decl205319 -Node: Token Decl205833 -Node: Precedence Decl208750 -Node: Type Decl211026 -Node: Symbol Decls211977 -Node: Initial Action Decl212932 -Node: Destructor Decl213747 -Node: Printer Decl219393 -Node: Expect Decl221662 -Node: Start Decl225663 -Node: Pure Decl226057 -Node: Push Decl227805 -Node: Decl Summary232244 -Ref: %header234925 -Node: %define Summary243258 -Ref: api-filename-type245169 -Ref: api-token-prefix256117 -Node: %code Summary268123 -Node: Multiple Parsers272379 -Node: Interface276239 -Node: Parser Function277348 -Node: Push Parser Interface279841 -Ref: yypstate_new280226 -Ref: yypstate_delete280667 -Ref: yypush_parse281081 -Ref: yypull_parse282093 -Node: Lexical283096 -Node: Calling Convention284671 -Node: Special Tokens286200 -Node: Tokens from Literals287639 -Node: Token Values288720 -Node: Token Locations289888 -Node: Pure Calling290820 -Node: Error Reporting293417 -Node: Error Reporting Function293940 -Node: Syntax Error Reporting Function297312 -Node: Action Features301923 -Node: Internationalization306263 -Node: Enabling I18n307123 -Node: Token I18n309241 -Node: Algorithm310644 -Node: Lookahead313066 -Node: Shift/Reduce315280 -Node: Precedence319347 -Node: Why Precedence320119 -Node: Using Precedence322034 -Node: Precedence Only323534 -Node: Precedence Examples325336 -Node: How Precedence325860 -Node: Non Operators327005 -Node: Contextual Precedence328578 -Node: Parser States330324 -Node: Reduce/Reduce331579 -Node: Mysterious Conflicts336388 -Node: Tuning LR340015 -Node: LR Table Construction341221 -Node: Default Reductions346839 -Node: LAC351626 -Node: Unreachable States357132 -Node: Generalized LR Parsing359139 -Node: Memory Management363524 -Node: Error Recovery365908 -Node: Context Dependency371188 -Node: Semantic Tokens372045 -Node: Lexical Tie-ins375121 -Node: Tie-in Recovery376577 -Node: Debugging378709 -Node: Counterexamples380174 -Node: Understanding386180 -Ref: state-8392904 -Node: Graphviz398455 -Node: Xml402776 -Node: Tracing404514 -Node: Enabling Traces404891 -Node: Mfcalc Traces409019 -Node: Invocation414230 -Node: Bison Options416336 -Node: Operation Modes417183 -Node: Diagnostics422900 -Ref: Wconflicts-sr423208 -Ref: Wconflicts-rr423232 -Ref: Wcounterexamples423620 -Ref: Wdangling-alias423933 -Ref: Wdeprecated425263 -Ref: Wempty-rule425387 -Ref: Wmidrule-values425599 -Ref: Wprecedence426310 -Ref: Wyacc427444 -Ref: Wother427506 -Ref: Wall427810 -Ref: Wnone427930 -Ref: Werror428206 -Node: Tuning the Parser430013 -Ref: option-yacc433427 -Ref: Tuning the Parser-Footnote-1435280 -Node: Output Files435346 -Node: Option Cross Key438623 -Node: Yacc Library440761 -Node: Other Languages441834 -Node: C++ Parsers442459 -Node: A Simple C++ Example443188 -Ref: A Simple C++ Example-Footnote-1447342 -Node: C++ Bison Interface447425 -Node: C++ Parser Interface449015 -Node: C++ Semantic Values453602 -Node: C++ Unions454152 -Node: C++ Variants454945 -Node: C++ Location Values458718 -Node: C++ position459657 -Node: C++ location462026 -Node: Exposing the Location Classes464216 -Node: User Defined Location Type466115 -Node: C++ Parser Context467694 -Node: C++ Scanner Interface471661 -Node: Split Symbols472229 -Node: Complete Symbols473964 -Node: A Complete C++ Example478719 -Node: Calc++ --- C++ Calculator479662 -Node: Calc++ Parsing Driver480183 -Node: Calc++ Parser483150 -Node: Calc++ Scanner487273 -Node: Calc++ Top Level491228 -Node: D Parsers491927 -Node: D Bison Interface492631 -Node: D Semantic Values493744 -Node: D Location Values494577 -Node: D Parser Interface495448 -Node: D Parser Context Interface500364 -Node: D Scanner Interface501807 -Node: D Action Features504747 -Node: D Push Parser Interface505516 -Node: D Complete Symbols506992 -Node: Java Parsers507708 -Node: Java Bison Interface508524 -Node: Java Semantic Values510715 -Node: Java Location Values512412 -Node: Java Parser Interface514010 -Node: Java Parser Context Interface519267 -Node: Java Scanner Interface521352 -Node: Java Action Features525424 -Node: Java Push Parser Interface528175 -Node: Java Differences531170 -Ref: Java Differences-Footnote-1533833 -Node: Java Declarations Summary533987 -Node: History539020 -Node: Yacc539476 -Ref: Yacc-Footnote-1540972 -Ref: Yacc-Footnote-2541203 -Node: yacchack541273 -Node: Byacc541700 -Node: Bison542519 -Node: Other Ungulates544537 -Node: Versioning545127 -Node: FAQ548550 -Node: Memory Exhausted549577 -Node: How Can I Reset the Parser549879 -Node: Strings are Destroyed552473 -Node: Implementing Gotos/Loops554178 -Node: Multiple start-symbols555471 -Node: Secure? Conform?557051 -Node: Enabling Relocatability557505 -Node: I can't build Bison560429 -Node: Where can I find help?561701 -Node: Bug Reports562496 -Node: More Languages563975 -Node: Beta Testing564312 -Node: Mailing Lists565188 -Node: Table of Symbols565400 -Node: Glossary582432 -Node: GNU Free Documentation License592794 -Node: Bibliography618148 -Ref: Corbett 1984618288 -Ref: Denny 2008618638 -Ref: Denny 2010 May618964 -Ref: Denny 2010 November619239 -Ref: DeRemer 1982619577 -Ref: Isradisaikul 2015619849 -Ref: Johnson 1978620178 -Ref: Knuth 1965620447 -Ref: Scott 2000620683 -Node: Index of Terms621000 +Node: Top1040 +Node: Introduction18154 +Node: Conditions19727 +Node: Copying21636 +Node: Concepts59175 +Node: Language and Grammar60367 +Node: Grammar in Bison66345 +Node: Semantic Values68261 +Node: Semantic Actions70389 +Node: GLR Parsers71566 +Node: Simple GLR Parsers74339 +Node: Merging GLR Parses80810 +Ref: Merging GLR Parses-Footnote-186139 +Node: GLR Semantic Actions86280 +Node: Semantic Predicates88877 +Node: Locations91330 +Node: Bison Parser92808 +Node: Stages96001 +Node: Grammar Layout97226 +Node: Examples98588 +Node: RPN Calc100075 +Ref: RPN Calc-Footnote-1101127 +Node: Rpcalc Declarations101205 +Node: Rpcalc Rules103257 +Node: Rpcalc Input105148 +Node: Rpcalc Line106714 +Node: Rpcalc Exp107862 +Node: Rpcalc Lexer109871 +Node: Rpcalc Main112564 +Node: Rpcalc Error112975 +Node: Rpcalc Generate114003 +Node: Rpcalc Compile115247 +Node: Infix Calc116211 +Ref: Infix Calc-Footnote-1119054 +Node: Simple Error Recovery119207 +Node: Location Tracking Calc121142 +Node: Ltcalc Declarations121842 +Node: Ltcalc Rules122937 +Node: Ltcalc Lexer124777 +Node: Multi-function Calc127114 +Ref: Multi-function Calc-Footnote-1128891 +Node: Mfcalc Declarations128969 +Node: Mfcalc Rules130993 +Node: Mfcalc Symbol Table132271 +Node: Mfcalc Lexer135731 +Node: Mfcalc Main138304 +Node: Exercises139180 +Node: Grammar File139707 +Node: Grammar Outline140557 +Node: Prologue141415 +Node: Prologue Alternatives143214 +Ref: Prologue Alternatives-Footnote-1152898 +Node: Bison Declarations153003 +Node: Grammar Rules153413 +Node: Epilogue153869 +Node: Symbols154920 +Node: Rules161943 +Node: Rules Syntax162258 +Node: Empty Rules164323 +Node: Recursion165410 +Node: Semantics167068 +Node: Value Type168374 +Node: Multiple Types169658 +Node: Type Generation171108 +Node: Union Decl173038 +Node: Structured Value Type174431 +Node: Actions175457 +Node: Action Types179329 +Node: Midrule Actions180682 +Node: Using Midrule Actions181336 +Node: Typed Midrule Actions184873 +Node: Midrule Action Translation186421 +Node: Midrule Conflicts188913 +Node: Tracking Locations191522 +Node: Location Type192254 +Node: Actions and Locations193777 +Node: Printing Locations196159 +Node: Location Default Action196919 +Node: Named References200452 +Node: Declarations203048 +Node: Require Decl204735 +Node: Token Decl205249 +Node: Precedence Decl208162 +Node: Type Decl210438 +Node: Symbol Decls211389 +Node: Initial Action Decl212344 +Node: Destructor Decl213157 +Node: Printer Decl218801 +Node: Expect Decl221070 +Node: Start Decl225067 +Node: Pure Decl225461 +Node: Push Decl227209 +Node: Decl Summary231642 +Ref: %header234319 +Node: %define Summary242648 +Ref: api-filename-type244557 +Ref: api-token-prefix255495 +Node: %code Summary267498 +Node: Multiple Parsers271750 +Node: Interface275605 +Node: Parser Function276712 +Node: Push Parser Interface279203 +Ref: yypstate_new279588 +Ref: yypstate_delete280029 +Ref: yypush_parse280443 +Ref: yypull_parse281455 +Node: Lexical282458 +Node: Calling Convention284033 +Node: Special Tokens285562 +Node: Tokens from Literals286997 +Node: Token Values288078 +Node: Token Locations289242 +Node: Pure Calling290174 +Node: Error Reporting292771 +Node: Error Reporting Function293294 +Node: Syntax Error Reporting Function296664 +Node: Action Features301265 +Node: Internationalization305605 +Node: Enabling I18n306457 +Node: Token I18n308567 +Node: Algorithm309958 +Node: Lookahead312372 +Node: Shift/Reduce314582 +Node: Precedence318637 +Node: Why Precedence319409 +Node: Using Precedence321324 +Node: Precedence Only322820 +Node: Precedence Examples324622 +Node: How Precedence325146 +Node: Non Operators326287 +Node: Contextual Precedence327848 +Node: Parser States329590 +Node: Reduce/Reduce330839 +Node: Mysterious Conflicts335642 +Node: Tuning LR339264 +Node: LR Table Construction340464 +Node: Default Reductions346076 +Node: LAC350863 +Node: Unreachable States356363 +Node: Generalized LR Parsing358366 +Node: Memory Management362744 +Node: Error Recovery365128 +Node: Context Dependency370404 +Node: Semantic Tokens371257 +Node: Lexical Tie-ins374325 +Node: Tie-in Recovery375781 +Node: Debugging377911 +Node: Counterexamples379374 +Node: Understanding385376 +Ref: state-8392088 +Node: Graphviz397639 +Node: Xml401956 +Node: Tracing403694 +Node: Enabling Traces404067 +Node: Mfcalc Traces408193 +Node: Invocation413400 +Node: Bison Options415502 +Node: Operation Modes416349 +Node: Diagnostics422058 +Ref: Wconflicts-sr422366 +Ref: Wconflicts-rr422390 +Ref: Wcounterexamples422778 +Ref: Wdangling-alias423091 +Ref: Wdeprecated424416 +Ref: Wempty-rule424540 +Ref: Wmidrule-values424752 +Ref: Wprecedence425463 +Ref: Wyacc426597 +Ref: Wother426659 +Ref: Wall426963 +Ref: Wnone427083 +Ref: Werror427359 +Node: Tuning the Parser429164 +Ref: option-yacc432576 +Ref: Tuning the Parser-Footnote-1434425 +Node: Output Files434491 +Node: Option Cross Key437760 +Node: Yacc Library439898 +Node: Other Languages440965 +Node: C++ Parsers441588 +Node: A Simple C++ Example442317 +Ref: A Simple C++ Example-Footnote-1446467 +Node: C++ Bison Interface446550 +Node: C++ Parser Interface448140 +Node: C++ Semantic Values452723 +Node: C++ Unions453273 +Node: C++ Variants454066 +Node: C++ Location Values457827 +Node: C++ position458766 +Node: C++ location461135 +Node: Exposing the Location Classes463325 +Node: User Defined Location Type465218 +Node: C++ Parser Context466797 +Node: C++ Scanner Interface470760 +Node: Split Symbols471328 +Node: Complete Symbols473063 +Node: A Complete C++ Example477814 +Node: Calc++ --- C++ Calculator478757 +Node: Calc++ Parsing Driver479278 +Node: Calc++ Parser482241 +Node: Calc++ Scanner486356 +Node: Calc++ Top Level490299 +Node: D Parsers490998 +Node: D Bison Interface491702 +Node: D Semantic Values492815 +Node: D Location Values493646 +Node: D Parser Interface494517 +Node: D Parser Context Interface499433 +Node: D Scanner Interface500876 +Node: D Action Features503816 +Node: D Push Parser Interface504585 +Node: D Complete Symbols506059 +Node: Java Parsers506775 +Node: Java Bison Interface507591 +Node: Java Semantic Values509774 +Node: Java Location Values511469 +Node: Java Parser Interface513067 +Node: Java Parser Context Interface518322 +Node: Java Scanner Interface520407 +Node: Java Action Features524479 +Node: Java Push Parser Interface527230 +Node: Java Differences530223 +Ref: Java Differences-Footnote-1532886 +Node: Java Declarations Summary533040 +Node: History538073 +Node: Yacc538529 +Ref: Yacc-Footnote-1540022 +Ref: Yacc-Footnote-2540245 +Node: yacchack540315 +Node: Byacc540738 +Node: Bison541551 +Node: Other Ungulates543559 +Node: Versioning544139 +Node: FAQ547562 +Node: Memory Exhausted548589 +Node: How Can I Reset the Parser548891 +Node: Strings are Destroyed551483 +Node: Implementing Gotos/Loops553184 +Node: Multiple start-symbols554475 +Node: Secure? Conform?556055 +Node: Enabling Relocatability556505 +Node: I can't build Bison559423 +Node: Where can I find help?560683 +Node: Bug Reports561476 +Node: More Languages562951 +Node: Beta Testing563286 +Node: Mailing Lists564160 +Node: Table of Symbols564372 +Node: Glossary581398 +Node: GNU Free Documentation License591676 +Node: Bibliography616829 +Ref: Corbett 1984616969 +Ref: Denny 2008617320 +Ref: Denny 2010 May617642 +Ref: Denny 2010 November617917 +Ref: DeRemer 1982618253 +Ref: Isradisaikul 2015618523 +Ref: Johnson 1978618848 +Ref: Knuth 1965619113 +Ref: Scott 2000619347 +Node: Index of Terms619664  End Tag Table diff --git a/local/recipes/dev/bison/source/doc/stamp-vti b/local/recipes/dev/bison/source/doc/stamp-vti index f0d2ff89da..7250b55d08 100644 --- a/local/recipes/dev/bison/source/doc/stamp-vti +++ b/local/recipes/dev/bison/source/doc/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 12 September 2021 -@set UPDATED-MONTH September 2021 +@set UPDATED 5 July 2026 +@set UPDATED-MONTH July 2026 @set EDITION 3.8.2 @set VERSION 3.8.2 diff --git a/local/recipes/dev/bison/source/doc/version.texi b/local/recipes/dev/bison/source/doc/version.texi index f0d2ff89da..7250b55d08 100644 --- a/local/recipes/dev/bison/source/doc/version.texi +++ b/local/recipes/dev/bison/source/doc/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 12 September 2021 -@set UPDATED-MONTH September 2021 +@set UPDATED 5 July 2026 +@set UPDATED-MONTH July 2026 @set EDITION 3.8.2 @set VERSION 3.8.2 diff --git a/local/recipes/dev/flex/source/doc/flex.info-1 b/local/recipes/dev/flex/source/doc/flex.info-1 index daf3d02849..d2bce03a4e 100644 --- a/local/recipes/dev/flex/source/doc/flex.info-1 +++ b/local/recipes/dev/flex/source/doc/flex.info-1 @@ -51,7 +51,7 @@ perform pattern-matching on text. The manual includes both tutorial and reference sections. This edition of ‘The flex Manual’ documents ‘flex’ version 2.6.4. It -was last updated on 12 May 2026. +was last updated on 5 July 2026. This manual was written by Vern Paxson, Will Estes and John Millaway. diff --git a/local/recipes/dev/flex/source/doc/stamp-vti b/local/recipes/dev/flex/source/doc/stamp-vti index 7032ed2a0e..fa9747afac 100644 --- a/local/recipes/dev/flex/source/doc/stamp-vti +++ b/local/recipes/dev/flex/source/doc/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 12 May 2026 -@set UPDATED-MONTH May 2026 +@set UPDATED 5 July 2026 +@set UPDATED-MONTH July 2026 @set EDITION 2.6.4 @set VERSION 2.6.4 diff --git a/local/recipes/dev/flex/source/doc/version.texi b/local/recipes/dev/flex/source/doc/version.texi index 7032ed2a0e..fa9747afac 100644 --- a/local/recipes/dev/flex/source/doc/version.texi +++ b/local/recipes/dev/flex/source/doc/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 12 May 2026 -@set UPDATED-MONTH May 2026 +@set UPDATED 5 July 2026 +@set UPDATED-MONTH July 2026 @set EDITION 2.6.4 @set VERSION 2.6.4 diff --git a/local/recipes/dev/m4/source/doc/m4.info b/local/recipes/dev/m4/source/doc/m4.info index 6627656632..dea73747f6 100644 --- a/local/recipes/dev/m4/source/doc/m4.info +++ b/local/recipes/dev/m4/source/doc/m4.info @@ -1,6 +1,6 @@ This is m4.info, produced by makeinfo version 7.3 from m4.texi. -This manual (12 May 2026) is for GNU M4 (version 1.4.21), a package +This manual (5 July 2026) is for GNU M4 (version 1.4.21), a package containing an implementation of the m4 macro language. Copyright © 1989-1994, 2004-2014, 2016-2017, 2020-2026 Free Software diff --git a/local/recipes/dev/m4/source/doc/m4.info-1 b/local/recipes/dev/m4/source/doc/m4.info-1 index b571b2d530..4303794c96 100644 --- a/local/recipes/dev/m4/source/doc/m4.info-1 +++ b/local/recipes/dev/m4/source/doc/m4.info-1 @@ -1,6 +1,6 @@ This is m4.info, produced by makeinfo version 7.3 from m4.texi. -This manual (12 May 2026) is for GNU M4 (version 1.4.21), a package +This manual (5 July 2026) is for GNU M4 (version 1.4.21), a package containing an implementation of the m4 macro language. Copyright © 1989-1994, 2004-2014, 2016-2017, 2020-2026 Free Software @@ -23,7 +23,7 @@ File: m4.info, Node: Top, Next: Preliminaries, Up: (dir) GNU M4 ****** -This manual (12 May 2026) is for GNU M4 (version 1.4.21), a package +This manual (5 July 2026) is for GNU M4 (version 1.4.21), a package containing an implementation of the m4 macro language. Copyright © 1989-1994, 2004-2014, 2016-2017, 2020-2026 Free Software diff --git a/local/recipes/dev/m4/source/doc/m4.info-2 b/local/recipes/dev/m4/source/doc/m4.info-2 index 193dcabb58..2b6075c170 100644 --- a/local/recipes/dev/m4/source/doc/m4.info-2 +++ b/local/recipes/dev/m4/source/doc/m4.info-2 @@ -1,6 +1,6 @@ This is m4.info, produced by makeinfo version 7.3 from m4.texi. -This manual (12 May 2026) is for GNU M4 (version 1.4.21), a package +This manual (5 July 2026) is for GNU M4 (version 1.4.21), a package containing an implementation of the m4 macro language. Copyright © 1989-1994, 2004-2014, 2016-2017, 2020-2026 Free Software diff --git a/local/recipes/dev/m4/source/doc/stamp-vti b/local/recipes/dev/m4/source/doc/stamp-vti index fc10bda26c..d8743b65b6 100644 --- a/local/recipes/dev/m4/source/doc/stamp-vti +++ b/local/recipes/dev/m4/source/doc/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 12 May 2026 -@set UPDATED-MONTH May 2026 +@set UPDATED 5 July 2026 +@set UPDATED-MONTH July 2026 @set EDITION 1.4.21 @set VERSION 1.4.21 diff --git a/local/recipes/dev/m4/source/doc/version.texi b/local/recipes/dev/m4/source/doc/version.texi index fc10bda26c..d8743b65b6 100644 --- a/local/recipes/dev/m4/source/doc/version.texi +++ b/local/recipes/dev/m4/source/doc/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 12 May 2026 -@set UPDATED-MONTH May 2026 +@set UPDATED 5 July 2026 +@set UPDATED-MONTH July 2026 @set EDITION 1.4.21 @set VERSION 1.4.21 diff --git a/local/recipes/drivers/ehcid/Cargo.toml b/local/recipes/drivers/ehcid/Cargo.toml index 3f79a18082..0767dd7a56 100644 --- a/local/recipes/drivers/ehcid/Cargo.toml +++ b/local/recipes/drivers/ehcid/Cargo.toml @@ -10,5 +10,5 @@ path = "src/main.rs" [dependencies] usb-core = { path = "../../usb-core/source" } -redox_syscall = "0.7" +redox_syscall = { path = "../../../../local/sources/syscall" } log = "0.4" diff --git a/local/recipes/drivers/ehcid/source/Cargo.toml b/local/recipes/drivers/ehcid/source/Cargo.toml index e98156c0a8..0da99f971c 100644 --- a/local/recipes/drivers/ehcid/source/Cargo.toml +++ b/local/recipes/drivers/ehcid/source/Cargo.toml @@ -13,7 +13,7 @@ usb-core = { path = "../../usb-core/source" } libredox = { path = "../../../../../local/sources/libredox", features = ["call", "std"] } log = { version = "0.4", features = ["std"] } redox-driver-sys = { path = "../../redox-driver-sys/source" } -redox-scheme = "<0.11.2" +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } syscall = { package = "redox_syscall", path = "../../../../../local/sources/syscall", features = ["std"] } [target.'cfg(target_os = "redox")'.dependencies] @@ -22,3 +22,4 @@ redox-driver-sys = { path = "../../redox-driver-sys/source", features = ["redox" [patch.crates-io] redox_syscall = { path = "../../../../../local/sources/syscall" } libredox = { path = "../../../../../local/sources/libredox" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } diff --git a/local/recipes/drivers/ohcid/Cargo.toml b/local/recipes/drivers/ohcid/Cargo.toml index 8c41a74323..6efa793711 100644 --- a/local/recipes/drivers/ohcid/Cargo.toml +++ b/local/recipes/drivers/ohcid/Cargo.toml @@ -10,5 +10,5 @@ path = "src/main.rs" [dependencies] usb-core = { path = "../../usb-core/source" } -redox_syscall = "0.7" +redox_syscall = { path = "../../../../local/sources/syscall" } log = "0.4" diff --git a/local/recipes/drivers/redbear-btusb/source/Cargo.toml b/local/recipes/drivers/redbear-btusb/source/Cargo.toml index ad22334e6b..e0e06fd01e 100644 --- a/local/recipes/drivers/redbear-btusb/source/Cargo.toml +++ b/local/recipes/drivers/redbear-btusb/source/Cargo.toml @@ -11,9 +11,10 @@ path = "src/main.rs" libc = "0.2" libredox = { path = "../../../../../local/sources/libredox", features = ["call", "std"] } log = { version = "0.4", features = ["std"] } -redox-scheme = "<0.11.2" +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } syscall = { package = "redox_syscall", path = "../../../../../local/sources/syscall", features = ["std"] } [patch.crates-io] redox_syscall = { path = "../../../../../local/sources/syscall" } libredox = { path = "../../../../../local/sources/libredox" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } diff --git a/local/recipes/drivers/redox-driver-pci/Cargo.toml b/local/recipes/drivers/redox-driver-pci/Cargo.toml index 52beeb71c3..5f4f6c9f19 100644 --- a/local/recipes/drivers/redox-driver-pci/Cargo.toml +++ b/local/recipes/drivers/redox-driver-pci/Cargo.toml @@ -6,4 +6,4 @@ description = "PCI bus backend for redox-driver-core" [dependencies] redox-driver-core = { path = "../redox-driver-core" } -redox_syscall = "0.7" +redox_syscall = { path = "../../../../local/sources/syscall" } \ No newline at end of file diff --git a/local/recipes/drivers/redox-driver-sys/source/src/dma.rs b/local/recipes/drivers/redox-driver-sys/source/src/dma.rs index ac67215087..e784361c1e 100644 --- a/local/recipes/drivers/redox-driver-sys/source/src/dma.rs +++ b/local/recipes/drivers/redox-driver-sys/source/src/dma.rs @@ -3,7 +3,7 @@ use std::sync::atomic::{AtomicI32, Ordering}; use redox_syscall::data::Map; use syscall as redox_syscall; -use redox_syscall::flag::{MapFlags, MAP_PRIVATE, O_CLOEXEC, PROT_READ, PROT_WRITE}; +use redox_syscall::flag::{MapFlags, MAP_PRIVATE, FD_CLOEXEC, PROT_READ, PROT_WRITE}; use redox_syscall::PAGE_SIZE; use crate::{DriverError, Result}; @@ -90,7 +90,7 @@ fn get_dma_memory_fd() -> Result { return Ok(current); } - let fd = libredox::call::open("/scheme/memory/scheme-root", O_CLOEXEC as i32, 0) + let fd = libredox::call::open("/scheme/memory/scheme-root", FD_CLOEXEC.bits() as i32, 0) .map_err(|e| DriverError::Io(std::io::Error::from_raw_os_error(e.errno())))?; let raw = fd as i32; @@ -111,7 +111,7 @@ fn virt_to_phys_cached(virt: usize) -> Result { let raw = match TRANSLATION_FD.load(Ordering::Acquire) { fd if fd >= 0 => fd, _ => { - let fd = libredox::Fd::open("/scheme/memory/translation", O_CLOEXEC as i32, 0) + let fd = libredox::Fd::open("/scheme/memory/translation", FD_CLOEXEC.bits() as i32, 0) .map_err(|e| DriverError::Io(std::io::Error::from_raw_os_error(e.errno())))?; let raw = fd.raw() as i32; // Leak the fd intentionally — it's a global cache @@ -202,7 +202,7 @@ impl DmaBuffer { fn allocate_via_scheme(mem_fd: i32, size: usize, _align: usize) -> Result { // Open a physical memory region of the requested size let path = format!("zeroed@{}?phys_contiguous", DMA_MEMORY_TYPE.suffix()); - let region_fd = libredox::call::openat(mem_fd as usize, &path, O_CLOEXEC as i32, 0) + let region_fd = libredox::call::openat(mem_fd as usize, &path, FD_CLOEXEC.bits() as i32, 0) .map_err(|e| DriverError::Io(std::io::Error::from_raw_os_error(e.errno())))?; let map = Map { diff --git a/local/recipes/drivers/redox-driver-sys/source/src/io.rs b/local/recipes/drivers/redox-driver-sys/source/src/io.rs index b4f2064259..e5d3c32d51 100644 --- a/local/recipes/drivers/redox-driver-sys/source/src/io.rs +++ b/local/recipes/drivers/redox-driver-sys/source/src/io.rs @@ -7,14 +7,14 @@ pub fn acquire_iopl() -> std::result::Result<(), crate::DriverError> { extern "C" { fn redox_cur_thrfd_v0() -> usize; } - let kernel_fd = redox_syscall::dup(unsafe { redox_cur_thrfd_v0() }, b"open_via_dup")?; + let kernel_fd = libredox::call::dup(unsafe { redox_cur_thrfd_v0() }, b"open_via_dup")?; let res = libredox::call::call_wo( kernel_fd, &[], redox_syscall::CallFlags::empty(), &[redox_syscall::ProcSchemeVerb::Iopl as u64], ); - let _ = redox_syscall::close(kernel_fd); + let _ = libredox::call::close(kernel_fd); res.map(|_| ()).map_err(|e| e.into()) } diff --git a/local/recipes/drivers/redox-driver-sys/source/src/memory.rs b/local/recipes/drivers/redox-driver-sys/source/src/memory.rs index 48daf5736e..9b50d0aaf5 100644 --- a/local/recipes/drivers/redox-driver-sys/source/src/memory.rs +++ b/local/recipes/drivers/redox-driver-sys/source/src/memory.rs @@ -4,7 +4,7 @@ use core::sync::atomic::{AtomicPtr, Ordering}; use redox_syscall::data::Map; use syscall as redox_syscall; use redox_syscall::flag::{ - MAP_SHARED, O_CLOEXEC, O_RDONLY, O_RDWR, O_WRONLY, PROT_READ, PROT_WRITE, + MAP_SHARED, FD_CLOEXEC, O_RDONLY, O_RDWR, O_WRONLY, PROT_READ, PROT_WRITE, }; use redox_syscall::PAGE_SIZE; @@ -41,7 +41,7 @@ bitflags::bitflags! { // SAFETY: The memory scheme root FD is cached for the process lifetime. // This is valid because: // 1. scheme:memory is a kernel-built-in scheme that never terminates. -// 2. The FD is opened with O_CLOEXEC — children after exec(2) do not inherit it. +// 2. The FD is opened with FD_CLOEXEC — children after exec(2) do not inherit it. // 3. This code MUST NOT be used in processes that fork() without exec() — // the child would share the same FD table slot, risking double-close. static MEMORY_ROOT_FD: AtomicPtr<()> = AtomicPtr::new(ptr::null_mut()); @@ -55,7 +55,7 @@ fn ensure_memory_root() -> Result { return Ok(libredox::Fd::new(dup_fd)); } - let fd = libredox::Fd::open("/scheme/memory/scheme-root", O_CLOEXEC as i32, 0)?; + let fd = libredox::Fd::open("/scheme/memory/scheme-root", FD_CLOEXEC.bits() as i32, 0)?; let raw = fd.raw(); match MEMORY_ROOT_FD.compare_exchange( @@ -109,7 +109,7 @@ impl MmioRegion { } let root_fd = ensure_memory_root()?; - let mem_fd = root_fd.openat(&path, (O_CLOEXEC | mode) as i32, 0)?; + let mem_fd = root_fd.openat(&path, (FD_CLOEXEC.bits() as usize | mode) as i32, 0)?; let map = Map { offset: phys_addr as usize, diff --git a/local/recipes/drivers/uhcid/Cargo.toml b/local/recipes/drivers/uhcid/Cargo.toml index 32f52e4cf8..0ffe21a4f5 100644 --- a/local/recipes/drivers/uhcid/Cargo.toml +++ b/local/recipes/drivers/uhcid/Cargo.toml @@ -10,5 +10,5 @@ path = "src/main.rs" [dependencies] usb-core = { path = "../../usb-core/source" } -redox_syscall = "0.7" +redox_syscall = { path = "../../../../local/sources/syscall" } log = "0.4" diff --git a/local/recipes/gpu/redox-drm/source/Cargo.toml b/local/recipes/gpu/redox-drm/source/Cargo.toml index 87e62a888a..ef3d693596 100644 --- a/local/recipes/gpu/redox-drm/source/Cargo.toml +++ b/local/recipes/gpu/redox-drm/source/Cargo.toml @@ -7,10 +7,10 @@ description = "DRM scheme daemon for Redox OS — provides GPU modesetting and b [dependencies] redox-driver-sys = { version = "0.2", path = "../../../drivers/redox-driver-sys/source" } linux-kpi = { version = "0.2", path = "../../../drivers/linux-kpi/source" } -libredox = "0.1" -redox_syscall = { version = "0.8", features = ["std"] } +libredox = { path = "../../../../../local/sources/libredox" } +redox_syscall = { path = "../../../../../local/sources/syscall", features = ["std"] } syscall04 = { package = "redox_syscall", version = "0.4" } -redox-scheme = "0.11" +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } daemon = { path = "../../../../../recipes/core/base/source/daemon" } log = "0.4" thiserror = "2" @@ -20,3 +20,6 @@ getrandom = "0.2" [patch.crates-io] redox-driver-sys = { path = "../../../drivers/redox-driver-sys/source" } linux-kpi = { path = "../../../drivers/linux-kpi/source" } +libredox = { path = "../../../../../local/sources/libredox" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/kde/kdecoration/source/po/ga/kdecoration.po b/local/recipes/kde/kdecoration/source/po/ga/kdecoration.po new file mode 100644 index 0000000000..2728ed3687 --- /dev/null +++ b/local/recipes/kde/kdecoration/source/po/ga/kdecoration.po @@ -0,0 +1,107 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR This file is copyright: +# This file is distributed under the same license as the kdecoration package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: kdecoration\n" +"Report-Msgid-Bugs-To: https://bugs.kde.org\n" +"POT-Creation-Date: 2026-01-13 08:42+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Irish Gaelic \n" +"Language: ga\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=5; plural=n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n < 11 ? " +"3 : 4\n" + +#: decorationbutton.cpp:325 +#, kde-format +msgctxt "" +"@info:tooltip The Name of the menu that appears when you click a window's " +"app icon" +msgid "Window menu" +msgstr "" + +#: decorationbutton.cpp:327 +#, kde-format +msgid "Application menu" +msgstr "" + +#: decorationbutton.cpp:330 +#, kde-format +msgid "On one desktop" +msgstr "" + +#: decorationbutton.cpp:332 +#, kde-format +msgid "On all desktops" +msgstr "" + +#: decorationbutton.cpp:334 +#, kde-format +msgid "Minimize" +msgstr "" + +#: decorationbutton.cpp:337 +#, kde-format +msgid "Restore" +msgstr "" + +#: decorationbutton.cpp:339 +#, kde-format +msgid "Maximize" +msgstr "" + +#: decorationbutton.cpp:341 +#, kde-format +msgid "Close" +msgstr "" + +#: decorationbutton.cpp:343 +#, kde-format +msgid "Context help" +msgstr "" + +#: decorationbutton.cpp:346 +#, kde-format +msgid "Unshade" +msgstr "" + +#: decorationbutton.cpp:348 +#, kde-format +msgid "Shade" +msgstr "" + +#: decorationbutton.cpp:351 +#, kde-format +msgid "Don't keep below other windows" +msgstr "" + +#: decorationbutton.cpp:353 +#, kde-format +msgid "Keep below other windows" +msgstr "" + +#: decorationbutton.cpp:356 +#, kde-format +msgid "Don't keep above other windows" +msgstr "" + +#: decorationbutton.cpp:358 +#, kde-format +msgid "Keep above other windows" +msgstr "" + +#: decorationbutton.cpp:361 +#, kde-format +msgid "The window is hidden from Screencast. Press to make it visible" +msgstr "" + +#: decorationbutton.cpp:363 +#, kde-format +msgid "Hide from Screencast" +msgstr "" diff --git a/local/recipes/kde/kf6-attica/source/src/attica-index.qdoc b/local/recipes/kde/kf6-attica/source/src/attica-index.qdoc new file mode 100644 index 0000000000..56e660d4b7 --- /dev/null +++ b/local/recipes/kde/kf6-attica/source/src/attica-index.qdoc @@ -0,0 +1,20 @@ +/*! + \page attica-index.html + \title Attica + + Open Collaboration Service client library + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {Attica} {KF6::Attica} + + \section1 API Reference + + \list + \li \l{Attica C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-attica/source/src/attica.qdoc b/local/recipes/kde/kf6-attica/source/src/attica.qdoc new file mode 100644 index 0000000000..27ba8a72b3 --- /dev/null +++ b/local/recipes/kde/kf6-attica/source/src/attica.qdoc @@ -0,0 +1,9 @@ +/*! + \module Attica + \title Attica C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Attica + + \brief Open Collaboration Service client library. +*/ diff --git a/local/recipes/kde/kf6-attica/source/src/attica.qdocconf b/local/recipes/kde/kf6-attica/source/src/attica.qdocconf new file mode 100644 index 0000000000..6a4f086122 --- /dev/null +++ b/local/recipes/kde/kf6-attica/source/src/attica.qdocconf @@ -0,0 +1,33 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = Attica +description = Open Collaboration Service client library + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +navigation.landingpage = "Attica" + +depends += \ + kde \ + qtcore + +qhp.projects = Attica + +qhp.Attica.file = attica.qhp +qhp.Attica.namespace = org.kde.attica.$QT_VERSION_TAG +qhp.Attica.virtualFolder = attica +qhp.Attica.indexTitle = Attica +qhp.Attica.indexRoot = + +qhp.Attica.subprojects = classes +qhp.Attica.subprojects.classes.title = C++ Classes +qhp.Attica.subprojects.classes.indexTitle = Attica C++ Classes +qhp.Attica.subprojects.classes.selectors = class fake:headerfile +qhp.Attica.subprojects.classes.sortPages = true + +tagfile = attica.tags diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/docs/find-module/FindFFmpeg.rst b/local/recipes/kde/kf6-extra-cmake-modules/source/docs/find-module/FindFFmpeg.rst new file mode 100644 index 0000000000..368ad628b3 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/docs/find-module/FindFFmpeg.rst @@ -0,0 +1 @@ +.. ecm-module:: ../../find-modules/FindFFmpeg.cmake diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/docs/module/ECMFeatureSummary.rst b/local/recipes/kde/kf6-extra-cmake-modules/source/docs/module/ECMFeatureSummary.rst new file mode 100644 index 0000000000..8c71d036f0 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/docs/module/ECMFeatureSummary.rst @@ -0,0 +1 @@ +.. ecm-module:: ../../modules/ECMFeatureSummary.cmake diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindFFmpeg.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindFFmpeg.cmake new file mode 100644 index 0000000000..b0f4521a57 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindFFmpeg.cmake @@ -0,0 +1,250 @@ +# SPDX-FileCopyrightText: 2006 Matthias Kretz +# SPDX-FileCopyrightText: 2008 Alexander Neundorf +# SPDX-FileCopyrightText: 2011 Michael Jansen +# SPDX-FileCopyrightText: 2021 Stefan Brüns +# +# SPDX-License-Identifier: BSD-3-Clause + +#[=======================================================================[.rst: + +FindFFmpeg +---------- + +Try to find FFmpeg components. + +The following components are available:: + + AVCODEC AVFILTER AVDEVICE AVFORMAT + AVUTIL SWRESAMPLE SWSCALE POSTPROCESS + +If no components are specified in the find_module call, the following ones +will be choosen as default:: + + AVFORMAT AVUTIL AVCODEC + +Imported Targets +^^^^^^^^^^^^^^^^ + +This module provides the following imported targets, if found: + +``FFmpeg::FFmpeg`` + For all the required FFmpeg components + +``FFmpeg::`` + For each that was found + +Result Variables +^^^^^^^^^^^^^^^^ + +This will define the following variables: + +``FFMPEG_FOUND`` + System has the all required components. + +``FFMPEG_INCLUDE_DIRS`` + Include directory necessary for using the required components headers. + +``FFMPEG_LIBRARIES`` + Link these to use the required FFmpeg components. + +``FFMPEG_DEFINITIONS`` + Compiler switches required for using the required FFmpeg components. + + +Additionally for each of the components, the following variables will be defined: + +``_FOUND`` + True if (the requestion version of) is available + +``_INCLUDE_DIRS`` + Include directory necessary for using the headers + +``_LIBRARIES`` + Link these to use + +``_DEFINITIONS`` + Compiler switches required for using + +``_VERSION`` + The components version (NOTE: always empty on Windows) + +As the versions of the various FFmpeg components differ for a given release, +and CMake supports only one common version for all components, use the +following to specify required versions for multiple components: + +.. code-block:: cmake + + find_package(FFmpeg 57.48 COMPONENTS AVCODEC) + find_package(FFmpeg 57.40 COMPONENTS AVFORMAT) + find_package(FFmpeg 55.27 COMPONENTS AVUTIL) + +NOTE: version checking is skipped on Windows + +Since 6.20.0. +#]=======================================================================] + +cmake_policy(VERSION 3.16) + +include(FindPackageHandleStandardArgs) + +if(NOT FFmpeg_FIND_COMPONENTS) + # The default components were taken from a survey over other FindFFMPEG.cmake files + set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL) +endif() + +list(LENGTH FFmpeg_FIND_COMPONENTS _numComponents) +if((${_numComponents} GREATER 1) AND DEFINED ${FFmpeg_FIND_VERSION}) + message(WARNING "Using a required version in combination with multiple COMPONENTS is not supported") + set(_FFmpeg_REQUIRED_VERSION 0) +elseif(DEFINED FFmpeg_FIND_VERSION) + set(_FFmpeg_REQUIRED_VERSION ${FFmpeg_FIND_VERSION}) +else() + set(_FFmpeg_REQUIRED_VERSION 0) +endif() +set(_FFmpeg_ALL_COMPONENTS AVCODEC AVFILTER AVDEVICE AVFORMAT AVUTIL POSTPROCESS SWRESAMPLE SWSCALE) + +### Macro: set_component_found +# +# Marks the given component as found if both *_LIBRARIES AND *_INCLUDE_DIRS is present. + +macro(set_component_found _component ) + if(${_component}_LIBRARIES AND ${_component}_INCLUDE_DIRS) + set(${_component}_FOUND TRUE) + set(FFmpeg_${_component}_FOUND TRUE) + endif() +endmacro() + +macro(create_target _component ) + if(${_component}_FOUND AND NOT TARGET FFmpeg::${_component}) + add_library(FFmpeg::${_component} UNKNOWN IMPORTED) + set_target_properties(FFmpeg::${_component} PROPERTIES + IMPORTED_LOCATION "${${_component}_LIBRARIES}" + INTERFACE_COMPILE_OPTIONS "${${_component}_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${${_component}_INCLUDE_DIRS}" + ) + endif() +endmacro() + +### Macro: find_component +# +# Checks for the given component by invoking pkgconfig and then looking up the libraries and +# include directories. + +macro(find_component _component _pkgconfig _library _header) + + if(NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + pkg_check_modules(PC_${_component} QUIET ${_pkgconfig}) + endif() + + find_path(${_component}_INCLUDE_DIRS ${_header} + HINTS + ${PC_LIB${_component}_INCLUDEDIR} + ${PC_LIB${_component}_INCLUDE_DIRS} + PATH_SUFFIXES + ffmpeg + ) + + find_library(${_component}_LIBRARIES NAMES ${_library} + HINTS + ${PC_LIB${_component}_LIBDIR} + ${PC_LIB${_component}_LIBRARY_DIRS} + ) + + set(${_component}_DEFINITIONS ${PC_${_component}_CFLAGS_OTHER} CACHE STRING "The ${_component} CFLAGS.") + set(${_component}_VERSION ${PC_${_component}_VERSION} CACHE STRING "The ${_component} version number.") + + set_component_found(${_component}) + create_target(${_component}) + + mark_as_advanced( + ${_component}_INCLUDE_DIRS + ${_component}_LIBRARIES + ${_component}_DEFINITIONS + ${_component}_VERSION) + +endmacro() + +# Check for cached results. If there are skip the costly part. +if(NOT FFMPEG_LIBRARIES) + + # Check for all possible component. + find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h) + find_component(AVFILTER libavfilter avfilter libavfilter/avfilter.h) + find_component(AVFORMAT libavformat avformat libavformat/avformat.h) + find_component(AVDEVICE libavdevice avdevice libavdevice/avdevice.h) + find_component(AVUTIL libavutil avutil libavutil/avutil.h) + find_component(SWRESAMPLE libswresample swresample libswresample/swresample.h) + find_component(SWSCALE libswscale swscale libswscale/swscale.h) + find_component(POSTPROCESS libpostproc postproc libpostproc/postprocess.h) + + # Check if the required components were found and add their stuff to the FFMPEG_* vars. + foreach(_component ${_FFmpeg_ALL_COMPONENTS}) + if(${_component}_FOUND) + set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${_component}_LIBRARIES}) + set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${_component}_DEFINITIONS}) + list(APPEND FFMPEG_INCLUDE_DIRS ${${_component}_INCLUDE_DIRS}) + endif() + endforeach() + + # Build the include path with duplicates removed. + if(FFMPEG_INCLUDE_DIRS) + list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS) + endif() + + # cache the vars. + set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "The FFmpeg include directories." FORCE) + set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "The FFmpeg libraries." FORCE) + set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} CACHE STRING "The FFmpeg cflags." FORCE) + + mark_as_advanced(FFMPEG_INCLUDE_DIRS + FFMPEG_LIBRARIES + FFMPEG_DEFINITIONS) + +else() + # Set the noncached _FOUND vars for the components. + foreach(_component ${_FFmpeg_ALL_COMPONENTS}) + set_component_found(${_component}) + create_target(${_component}) + endforeach() +endif() + +# Compile the list of required vars +unset(_FFmpeg_REQUIRED_VARS) +set(_FFmpeg_FOUND_LIBRARIES "") +foreach(_component ${FFmpeg_FIND_COMPONENTS}) + if(${_component}_FOUND) + if(NOT WIN32) + if(${_component}_VERSION VERSION_LESS _FFmpeg_REQUIRED_VERSION) + message(STATUS "${_component}: ${${_component}_VERSION} < ${_FFmpeg_REQUIRED_VERSION}") + unset(${_component}_FOUND) + endif() + else() + # We don't use PkgConfig on Windows an hence the _VERSION var is empty + # TODO: We could add some magic to retrieve the version from the .pc files or version headers ourself, + # like https://github.com/Kitware/VTK/blob/master/CMake/FindFFMPEG.cmake + message(WARNING "${_component}: Version check is not supported on Windows, skipping version check") + endif() + + list(APPEND _FFmpeg_FOUND_LIBRARIES ${${_component}_LIBRARIES}) + endif() + list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS ${_component}_FOUND) +endforeach() +list(INSERT _FFmpeg_REQUIRED_VARS 0 _FFmpeg_FOUND_LIBRARIES) + +# Give a nice error message if some of the required vars are missing. +find_package_handle_standard_args(FFmpeg + REQUIRED_VARS ${_FFmpeg_REQUIRED_VARS} + HANDLE_COMPONENTS) + +# Create the general target +if(FFmpeg_FOUND AND NOT TARGET FFmpeg::FFmpeg) + add_library(FFmpeg::FFmpeg INTERFACE IMPORTED) + foreach(_component ${FFmpeg_FIND_COMPONENTS}) + if(${_component}_FOUND AND TARGET FFmpeg::${_component}) + target_link_libraries(FFmpeg::FFmpeg INTERFACE FFmpeg::${_component}) + endif() + endforeach() +endif() diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/multi_tests/test12.cpp b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/multi_tests/test12.cpp new file mode 100644 index 0000000000..211c4ba989 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/multi_tests/test12.cpp @@ -0,0 +1,8 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test12.txt"); + return 0; +} + diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/multi_tests/test13.cpp b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/multi_tests/test13.cpp new file mode 100644 index 0000000000..d055dbb52f --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/multi_tests/test13.cpp @@ -0,0 +1,8 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test13.txt"); + return 0; +} + diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/multi_tests/test14.cpp b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/multi_tests/test14.cpp new file mode 100644 index 0000000000..0faceebb56 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/multi_tests/test14.cpp @@ -0,0 +1,9 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test14.txt"); + int var = TEST_DEF; + return var == 1 ? 0 : 1; +} + diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/multi_tests/test15.cpp b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/multi_tests/test15.cpp new file mode 100644 index 0000000000..574ba0e143 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/multi_tests/test15.cpp @@ -0,0 +1,9 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test15.txt"); + int var = TEST_DEF; + return var == 1 ? 0 : 1; +} + diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/CMakeLists.txt new file mode 100644 index 0000000000..b6412c1cfe --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/CMakeLists.txt @@ -0,0 +1,21 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +cmake_minimum_required(VERSION 3.16) + +project(ECMAddTests) + +set(ECM_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../modules) +set(CMAKE_MODULE_PATH "${ECM_MODULE_DIR}") + +enable_testing() + +include(ECMAddTests) +include(../../test_helpers.cmake) +include(../nameprefix_test_helpers.cmake) + +set(main_cpp ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) + +set(ECM_TEST_NAME_PREFIX_STRATEGY "PATH") + +add_subdirectory(dir_a) diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/CMakeLists.txt new file mode 100644 index 0000000000..5fffc8c153 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/CMakeLists.txt @@ -0,0 +1,35 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +add_subdirectory(dir_b) +add_subdirectory(dir_ignored) +add_subdirectory(dir_notignored) +add_subdirectory(dir_bypropignored) +add_subdirectory(dir_first) +add_subdirectory(dir_renamed) +add_subdirectory(dir_nodirs) + +# default from source name., prefix preset by path-derived value +ecm_add_test( + ${main_cpp} +) + +# prefix preset by path-derived value +ecm_add_test( + TEST_NAME "main_a2" + ${main_cpp} +) + +# override of path-derived value by explicit arg +ecm_add_test( + NAME_PREFIX "override_by_arg-" + TEST_NAME "main_a3" + ${main_cpp} +) + +# check +assert_test_name_prefix("dir_a-") + +assert_test_name("dir_a-" "main") +assert_test_name("dir_a-" "main_a2") +assert_test_name("override_by_arg-" "main_a3") diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_b/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_b/CMakeLists.txt new file mode 100644 index 0000000000..4c4e5fee81 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_b/CMakeLists.txt @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +# prefix preset by path-derived value +ecm_add_test( + TEST_NAME "main_b" + ${main_cpp} +) + +# override of path-derived value by explicit arg +ecm_add_test( + NAME_PREFIX "override_by_arg-" + TEST_NAME "main_b2" + ${main_cpp} +) + +# override of path-derived value by explicit NO_NAME_PREFIX +ecm_add_test( + NO_NAME_PREFIX + TEST_NAME "main_b3" + ${main_cpp} +) + +# check +assert_test_name_prefix("dir_a-dir_b-") + +assert_test_name("dir_a-dir_b-" "main_b") +assert_test_name("override_by_arg-" "main_b2") +assert_test_name("" "main_b3") diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_bypropignored/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_bypropignored/CMakeLists.txt new file mode 100644 index 0000000000..1fe5ce87b8 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_bypropignored/CMakeLists.txt @@ -0,0 +1,31 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +ecm_test_set_dir_properties(PREFIX_NAME_IGNORE) + +# prefix preset by path-derived value +ecm_add_test( + TEST_NAME "main_bypropignored1" + ${main_cpp} +) + +# override of path-derived value by explicit arg +ecm_add_test( + NAME_PREFIX "override_by_arg-" + TEST_NAME "main_bypropignored2" + ${main_cpp} +) + +# override of path-derived value by explicit NO_NAME_PREFIX +ecm_add_test( + NO_NAME_PREFIX + TEST_NAME "main_bypropignored3" + ${main_cpp} +) + +# check +assert_test_name_prefix("dir_a-") + +assert_test_name("dir_a-" "main_bypropignored1") +assert_test_name("override_by_arg-" "main_bypropignored2") +assert_test_name("" "main_bypropignored3") diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/CMakeLists.txt new file mode 100644 index 0000000000..77a82c0aec --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/CMakeLists.txt @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +ecm_test_set_dir_properties(FIRST_PREFIX_NAME) + +add_subdirectory(dir_last) + +# prefix preset by path-derived value +ecm_add_test( + TEST_NAME "main_first" + ${main_cpp} +) + +# override of path-derived value by explicit arg +ecm_add_test( + NAME_PREFIX "override_by_arg-" + TEST_NAME "main_first2" + ${main_cpp} +) + +# check +assert_test_name_prefix("dir_first-") + +assert_test_name("dir_first-" "main_first") +assert_test_name("override_by_arg-" "main_first2") diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/dir_last/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/dir_last/CMakeLists.txt new file mode 100644 index 0000000000..2249472f9d --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/dir_last/CMakeLists.txt @@ -0,0 +1,33 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +ecm_test_set_dir_properties(LAST_PREFIX_NAME) + +add_subdirectory(dir_afterlast) + +# prefix preset by path-derived value +ecm_add_test( + TEST_NAME "main_last" + ${main_cpp} +) + +# override of path-derived value by explicit arg +ecm_add_test( + NAME_PREFIX "override_by_arg-" + TEST_NAME "main_last2" + ${main_cpp} +) + +# override of path-derived value by explicit NO_NAME_PREFIX +ecm_add_test( + NO_NAME_PREFIX + TEST_NAME "main_last3" + ${main_cpp} +) + +# check +assert_test_name_prefix("dir_first-dir_last-") + +assert_test_name("dir_first-dir_last-" "main_last") +assert_test_name("override_by_arg-" "main_last2") +assert_test_name("" "main_last3") diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/dir_last/dir_afterlast/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/dir_last/dir_afterlast/CMakeLists.txt new file mode 100644 index 0000000000..bad8068d9c --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/dir_last/dir_afterlast/CMakeLists.txt @@ -0,0 +1,21 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +# prefix preset by path-derived value +ecm_add_test( + TEST_NAME "main_afterlast" + ${main_cpp} +) + +# override of path-derived value by explicit arg +ecm_add_test( + NAME_PREFIX "override_by_arg-" + TEST_NAME "main_afterlast2" + ${main_cpp} +) + +# check +assert_test_name_prefix("dir_first-dir_last-") + +assert_test_name("dir_first-dir_last-" "main_afterlast") +assert_test_name("override_by_arg-" "main_afterlast2") diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_ignored/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_ignored/CMakeLists.txt new file mode 100644 index 0000000000..5df552b796 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_ignored/CMakeLists.txt @@ -0,0 +1,31 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +list(APPEND ECM_TEST_NAME_PREFIX_IGNORE_DIRS "dir_ignored") + +# prefix preset by path-derived value +ecm_add_test( + TEST_NAME "main_ignored1" + ${main_cpp} +) + +# override of path-derived value by explicit arg +ecm_add_test( + NAME_PREFIX "override_by_arg-" + TEST_NAME "main_ignored2" + ${main_cpp} +) + +# override of path-derived value by explicit NO_NAME_PREFIX +ecm_add_test( + NO_NAME_PREFIX + TEST_NAME "main_ignored3" + ${main_cpp} +) + +# check +assert_test_name_prefix("dir_a-") + +assert_test_name("dir_a-" "main_ignored1") +assert_test_name("override_by_arg-" "main_ignored2") +assert_test_name("" "main_ignored3") diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_nodirs/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_nodirs/CMakeLists.txt new file mode 100644 index 0000000000..fa6c93a30d --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_nodirs/CMakeLists.txt @@ -0,0 +1,26 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +ecm_test_set_dir_properties( + DIR nodir_first/nodir_ignored + PREFIX_NAME_IGNORE +) +list(APPEND ECM_TEST_NAME_PREFIX_IGNORE_DIRS "nodir_notignored") +ecm_test_set_dir_properties( + DIR nodir_first/nodir_ignored/nodir_notignored + PREFIX_NAME_NOT_IGNORE +) +ecm_test_set_dir_properties( + DIR nodir_first/nodir_ignored/nodir_notignored/nodir_renamed + PREFIX_NAME "new_name" +) +ecm_test_set_dir_properties( + DIR nodir_first + FIRST_PREFIX_NAME +) +ecm_test_set_dir_properties( + DIR nodir_first/nodir_ignored/nodir_notignored/nodir_renamed/nodir_last + LAST_PREFIX_NAME +) + +add_subdirectory(nodir_first/nodir_ignored/nodir_notignored/nodir_renamed/nodir_last/dir_afterlast) \ No newline at end of file diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_nodirs/nodir_first/nodir_ignored/nodir_notignored/nodir_renamed/nodir_last/dir_afterlast/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_nodirs/nodir_first/nodir_ignored/nodir_notignored/nodir_renamed/nodir_last/dir_afterlast/CMakeLists.txt new file mode 100644 index 0000000000..bba356705c --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_nodirs/nodir_first/nodir_ignored/nodir_notignored/nodir_renamed/nodir_last/dir_afterlast/CMakeLists.txt @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +# prefix preset by path-derived value +ecm_add_test( + TEST_NAME "main_nodir" + ${main_cpp} +) + +# override of path-derived value by explicit arg +ecm_add_test( + NAME_PREFIX "override_by_arg-" + TEST_NAME "main_nodir2" + ${main_cpp} +) + +# override of path-derived value by explicit NO_NAME_PREFIX +ecm_add_test( + NO_NAME_PREFIX + TEST_NAME "main_nodir3" + ${main_cpp} +) + +# check +assert_test_name_prefix("nodir_first-nodir_notignored-new_name-nodir_last-") + +assert_test_name("nodir_first-nodir_notignored-new_name-nodir_last-" "main_nodir") +assert_test_name("override_by_arg-" "main_nodir2") +assert_test_name("" "main_nodir3") diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_notignored/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_notignored/CMakeLists.txt new file mode 100644 index 0000000000..788808a3e1 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_notignored/CMakeLists.txt @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +list(APPEND ECM_TEST_NAME_PREFIX_IGNORE_DIRS "dir_notignored") +ecm_test_set_dir_properties(PREFIX_NAME_NOT_IGNORE) + +# prefix preset by path-derived value +ecm_add_test( + TEST_NAME "main_notignored1" + ${main_cpp} +) + +# override of path-derived value by explicit arg +ecm_add_test( + NAME_PREFIX "override_by_arg-" + TEST_NAME "main_notignored2" + ${main_cpp} +) + +# override of path-derived value by explicit NO_NAME_PREFIX +ecm_add_test( + NO_NAME_PREFIX + TEST_NAME "main_notignored3" + ${main_cpp} +) + +# check +assert_test_name_prefix("dir_a-dir_notignored-") + +assert_test_name("dir_a-dir_notignored-" "main_notignored1") +assert_test_name("override_by_arg-" "main_notignored2") +assert_test_name("" "main_notignored3") diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_renamed/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_renamed/CMakeLists.txt new file mode 100644 index 0000000000..b7529277ea --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_renamed/CMakeLists.txt @@ -0,0 +1,31 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +ecm_test_set_dir_properties(PREFIX_NAME "new_name") + +# override of dir name for path-derived value +ecm_add_test( + TEST_NAME "main_renamed" + ${main_cpp} +) + +# override of path-derived value by explicit arg +ecm_add_test( + NAME_PREFIX "override_by_arg-" + TEST_NAME "main_renamed2" + ${main_cpp} +) + +# override of path-derived value by explicit NO_NAME_PREFIX +ecm_add_test( + NO_NAME_PREFIX + TEST_NAME "main_renamed3" + ${main_cpp} +) + +# check +assert_test_name_prefix("dir_a-new_name-") + +assert_test_name("dir_a-new_name-" "main_renamed") +assert_test_name("override_by_arg-" "main_renamed2") +assert_test_name("" "main_renamed3") diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/main.cpp b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/main.cpp new file mode 100644 index 0000000000..9606d9f5e6 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_path_tests/main.cpp @@ -0,0 +1,7 @@ +// SPDX-FileCopyrightText: None +// SPDX-License-Identifier: CC0-1.0 + +int main() +{ + return 0; +} diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_var_tests/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_var_tests/CMakeLists.txt new file mode 100644 index 0000000000..31e196af94 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_var_tests/CMakeLists.txt @@ -0,0 +1,71 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +cmake_minimum_required(VERSION 3.16) + +project(ECMAddTests) + +set(ECM_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../modules) +set(CMAKE_MODULE_PATH "${ECM_MODULE_DIR}") + +enable_testing() + +include(ECMAddTests) +include(../../test_helpers.cmake) +include(../nameprefix_test_helpers.cmake) + +set(main_cpp ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) + +# default from source name +ecm_add_test( + ${main_cpp} +) + +# by explicit arg +ecm_add_test( + NAME_PREFIX "by_arg-" + TEST_NAME "main2" + ${main_cpp} +) + +# preset by scope variable +set(ECM_TEST_NAME_PREFIX "by_var-") + +assert_test_name_prefix("by_var-") + +ecm_add_test( + TEST_NAME "main3" + ${main_cpp} +) + +# override of scope variable by explicit arg +ecm_add_test( + NAME_PREFIX "override_by_arg-" + TEST_NAME "main4" + ${main_cpp} +) + +# override of scope variable by explicit NO_NAME_PREFIX +ecm_add_test( + NO_NAME_PREFIX + TEST_NAME "main5" + ${main_cpp} +) + +# preset by reset scope variable +set(ECM_TEST_NAME_PREFIX "by_var2-") + +assert_test_name_prefix("by_var2-") + +ecm_add_test( + TEST_NAME "main6" + ${main_cpp} +) + +# check +assert_test_name("" "main") +assert_test_name("by_arg-" "main2") +assert_test_name("by_var-" "main3") +assert_test_name("override_by_arg-" "main4") +assert_test_name("" "main5") +assert_test_name("by_var2-" "main6") diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_var_tests/main.cpp b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_var_tests/main.cpp new file mode 100644 index 0000000000..9606d9f5e6 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_by_var_tests/main.cpp @@ -0,0 +1,7 @@ +// SPDX-FileCopyrightText: None +// SPDX-License-Identifier: CC0-1.0 + +int main() +{ + return 0; +} diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_test_helpers.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_test_helpers.cmake new file mode 100644 index 0000000000..5339614e1e --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/nameprefix_test_helpers.cmake @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +macro(assert_test_name expected_prefix_name expected_base_name) + if(NOT TARGET ${expected_base_name}) + message(SEND_ERROR "No target defined with name '${expected_base_name}'.") + endif() + set(_test_name "${expected_prefix_name}${expected_base_name}") + if(NOT TEST ${_test_name}) + message(SEND_ERROR "No test defined with name '${_test_name}'.") + endif() +endmacro() + +macro(assert_test_name_prefix expected_name_prefix) + ecm_test_get_name_prefix(name_prefix) + if(NOT ${name_prefix} STREQUAL ${expected_name_prefix}) + message(SEND_ERROR "Path-derived name prefix is '${name_prefix}', expecting '${expected_name_prefix}'.") + endif() +endmacro() diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/single_tests/test8.cpp b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/single_tests/test8.cpp new file mode 100644 index 0000000000..ce762c8d3a --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/single_tests/test8.cpp @@ -0,0 +1,8 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test8.txt"); + return 0; +} + diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/single_tests/test9.cpp b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/single_tests/test9.cpp new file mode 100644 index 0000000000..cac5e20f83 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/single_tests/test9.cpp @@ -0,0 +1,9 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test9.txt"); + int var = TEST_DEF; + return var == 1 ? 0 : 1; +} + diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/custom_defines/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/custom_defines/CMakeLists.txt new file mode 100644 index 0000000000..d514d664bc --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/custom_defines/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.16) + +project(custom_defines VERSION 6.7.0) + +include(../test-and-comparison-helpers.cmake) + +include(ECMGeneratePkgConfigFile) +include(ECMSetupVersion) + +ecm_setup_version(PROJECT VARIABLE_PREFIX ATTICA + VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/attica_version.h" + PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6AtticaConfigVersion.cmake" + SOVERSION 6) + +set(origfiles "${CMAKE_CURRENT_SOURCE_DIR}/../../../tests/ECMGeneratePkgConfigFile/KF6Attica.pc") + +ecm_generate_pkgconfig_file(BASE_NAME KF6Attica + DESCRIPTION "Qt library to access Open Collaboration Services" + LIB_NAME KF6Attica + INCLUDE_INSTALL_DIR /usr/include/Attica + DEFINES -I\${prefix}/include/foo -I\${prefix}/include/bar + DEPS Qt6Core Qt6Network + FILENAME_VAR OutputFile + ) + +compare_files(GENERATED ${OutputFile} + ORIGINALS ${origfiles}) +file(REMOVE ${OutputFile}) diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/no_description_parameter_metainfo_with_description-param/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/no_description_parameter_metainfo_with_description-param/CMakeLists.txt new file mode 100644 index 0000000000..418e4b4761 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/no_description_parameter_metainfo_with_description-param/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.16) + +project(no_description_parameter_metainfo_with_description-param VERSION 5.43) + +include(../test-and-comparison-helpers.cmake) + +include(ECMGeneratePkgConfigFile) +include(ECMSetupVersion) + +ecm_setup_version(PROJECT VARIABLE_PREFIX KCOREADDONS + VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kcoreaddons_version.h" + PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5CoreAddonsConfigVersion.cmake" + SOVERSION 5) + +set(origfiles "${CMAKE_CURRENT_SOURCE_DIR}/../../../tests/ECMGeneratePkgConfigFile/KF5CoreAddons2.pc") + +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/../../../tests/ECMGeneratePkgConfigFile/metainfo_with_description.yaml + DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}) +file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/metainfo_with_description.yaml ${CMAKE_CURRENT_SOURCE_DIR}/metainfo.yaml) + +ecm_generate_pkgconfig_file(BASE_NAME KF5CoreAddons2 + DEPS Qt5Core + INCLUDE_INSTALL_DIR /usr/KCoreAddons + FILENAME_VAR OutputFile) + +compare_files(GENERATED ${OutputFile} + ORIGINALS ${origfiles}) +file(REMOVE ${OutputFile}) +file(REMOVE ${CMAKE_CURRENT_SOURCE_DIR}/metainfo.yaml) diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/no_description_parameter_metainfo_with_empty_description/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/no_description_parameter_metainfo_with_empty_description/CMakeLists.txt new file mode 100644 index 0000000000..5c76b83814 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/no_description_parameter_metainfo_with_empty_description/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.16) + +project(no_description_parameter_metainfo_with_description-param VERSION 5.43) + +include(../test-and-comparison-helpers.cmake) + +include(ECMGeneratePkgConfigFile) +include(ECMSetupVersion) + +ecm_setup_version(PROJECT VARIABLE_PREFIX KCOREADDONS + VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kcoreaddons_version.h" + PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5CoreAddonsConfigVersion.cmake" + SOVERSION 5) + +set(origfiles "${CMAKE_CURRENT_SOURCE_DIR}/../../../tests/ECMGeneratePkgConfigFile/KF5CoreAddons3.pc") + +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/../../../tests/ECMGeneratePkgConfigFile/metainfo_with_empty_description.yaml + DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}) +file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/metainfo_with_empty_description.yaml ${CMAKE_CURRENT_SOURCE_DIR}/metainfo.yaml) + +ecm_generate_pkgconfig_file(BASE_NAME KF5CoreAddons3 + DEPS Qt5Core + INCLUDE_INSTALL_DIR /usr/KCoreAddons + FILENAME_VAR OutputFile) + +compare_files(GENERATED ${OutputFile} + ORIGINALS ${origfiles}) +file(REMOVE ${OutputFile}) +file(REMOVE ${CMAKE_CURRENT_SOURCE_DIR}/metainfo.yaml) diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/no_description_parameter_metainfo_without_description/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/no_description_parameter_metainfo_without_description/CMakeLists.txt new file mode 100644 index 0000000000..159d65610d --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/no_description_parameter_metainfo_without_description/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.16) + +project(no_description_parameter_metainfo_without_description VERSION 5.43) + +include(../test-and-comparison-helpers.cmake) + +include(ECMGeneratePkgConfigFile) +include(ECMSetupVersion) + +ecm_setup_version(PROJECT VARIABLE_PREFIX KCOREADDONS + VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kcoreaddons_version.h" + PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5CoreAddonsConfigVersion.cmake" + SOVERSION 5) + +set(origfiles "${CMAKE_CURRENT_SOURCE_DIR}/../../../tests/ECMGeneratePkgConfigFile/KF5CoreAddons3.pc") + +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/../../../tests/ECMGeneratePkgConfigFile/metainfo_without_description.yaml + DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}) +file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/metainfo_without_description.yaml ${CMAKE_CURRENT_SOURCE_DIR}/metainfo.yaml) + +ecm_generate_pkgconfig_file(BASE_NAME KF5CoreAddons3 + DEPS Qt5Core + INCLUDE_INSTALL_DIR /usr/KCoreAddons + FILENAME_VAR OutputFile) + +compare_files(GENERATED ${OutputFile} + ORIGINALS ${origfiles}) +file(REMOVE ${OutputFile}) +file(REMOVE ${CMAKE_CURRENT_SOURCE_DIR}/metainfo.yaml) diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/no_optional_arguments/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/no_optional_arguments/CMakeLists.txt new file mode 100644 index 0000000000..c6513b7455 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/no_optional_arguments/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.16) + +project(no_optional_arguments VERSION 5.43) + +include(../test-and-comparison-helpers.cmake) + +include(ECMGeneratePkgConfigFile) +include(ECMSetupVersion) + +ecm_setup_version(PROJECT VARIABLE_PREFIX KCOREADDONS + VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kcoreaddons_version.h" + PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5CoreAddonsConfigVersion.cmake" + SOVERSION 5) + +set(origfiles "${CMAKE_CURRENT_SOURCE_DIR}/../../../tests/ECMGeneratePkgConfigFile/KF5CoreAddons.pc") + +ecm_generate_pkgconfig_file(BASE_NAME KF5CoreAddons + DESCRIPTION "KF5CoreAddons test" + DEPS Qt5Core + FILENAME_VAR OutputFile) + +compare_files(GENERATED ${OutputFile} + ORIGINALS ${origfiles}) +file(REMOVE ${OutputFile}) diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/test-and-comparison-helpers.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/test-and-comparison-helpers.cmake new file mode 100644 index 0000000000..d25e356083 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/test-and-comparison-helpers.cmake @@ -0,0 +1,32 @@ +set(ECM_MODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../modules") +set(CMAKE_MODULE_PATH "${ECM_MODULE_DIR}") + +set(CMAKE_INSTALL_PREFIX "/usr") + +function (compare_files) + set(options) + set(oneValueArgs GENERATED ORIGINALS) + set(multiValueArgs) + cmake_parse_arguments(CF "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + list(LENGTH CF_GENERATED count) + math(EXPR last "${count}-1") + foreach(i RANGE ${last}) + list(GET CF_GENERATED ${i} generated_file) + if (NOT EXISTS "${generated_file}") + message(FATAL_ERROR "${generated_file} was not generated") + endif() + file(READ "${generated_file}" file_contents) + string(STRIP "${file_contents}" file_contents) + + list(GET CF_ORIGINALS ${i} original_file) + if (NOT EXISTS "${original_file}") + message(FATAL_ERROR "Original ${original_file} was not found") + endif() + file(READ "${original_file}" original_contents) + string(STRIP "${original_contents}" original_contents) + + if(NOT original_contents STREQUAL file_contents) + message(FATAL_ERROR "Different files: ${original_file} ${generated_file}") + endif() + endforeach() +endfunction() diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/with_an_URL_parameter/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/with_an_URL_parameter/CMakeLists.txt new file mode 100644 index 0000000000..a23c918c0a --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/with_an_URL_parameter/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.16) + +project(with_an_URL_parameter VERSION 5.43) + +include(../test-and-comparison-helpers.cmake) + +include(ECMGeneratePkgConfigFile) +include(ECMSetupVersion) + +ecm_setup_version(PROJECT VARIABLE_PREFIX KCOREADDONS + VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kcoreaddons_version.h" + PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5CoreAddonsConfigVersion.cmake" + SOVERSION 5) + +set(origfiles "${CMAKE_CURRENT_SOURCE_DIR}/../../../tests/ECMGeneratePkgConfigFile/KF5CoreAddons5.pc") + +ecm_generate_pkgconfig_file(BASE_NAME KF5CoreAddons5 + DESCRIPTION "KF5CoreAddons test" + URL "https://www.example.org/" + DEPS Qt5Core + INCLUDE_INSTALL_DIR /usr/KCoreAddons + FILENAME_VAR OutputFile) + +compare_files(GENERATED ${OutputFile} + ORIGINALS ${origfiles}) +file(REMOVE ${OutputFile}) diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/with_public_and_private_dependencies/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/with_public_and_private_dependencies/CMakeLists.txt new file mode 100644 index 0000000000..dba273f8ed --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/with_public_and_private_dependencies/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.16) + +project(with_public_and_private_dependencies VERSION 5.43) + +include(../test-and-comparison-helpers.cmake) + +include(ECMGeneratePkgConfigFile) +include(ECMSetupVersion) + +ecm_setup_version(PROJECT VARIABLE_PREFIX KCOREADDONS + VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kcoreaddons_version.h" + PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5CoreAddonsConfigVersion.cmake" + SOVERSION 5) + +set(origfiles "${CMAKE_CURRENT_SOURCE_DIR}/../../../tests/ECMGeneratePkgConfigFile/KF5CoreAddons4.pc") + +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/../../../tests/ECMGeneratePkgConfigFile/metainfo_without_description.yaml + DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}) +file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/metainfo_without_description.yaml ${CMAKE_CURRENT_SOURCE_DIR}/metainfo.yaml) + +ecm_generate_pkgconfig_file(BASE_NAME KF5CoreAddons4 + DEPS Public1 PRIVATE Private1 Private2 PUBLIC Public2 + INCLUDE_INSTALL_DIR /usr/KCoreAddons + FILENAME_VAR OutputFile) + +compare_files(GENERATED ${OutputFile} + ORIGINALS ${origfiles}) +file(REMOVE ${OutputFile}) +file(REMOVE ${CMAKE_CURRENT_SOURCE_DIR}/metainfo.yaml) diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMPoQmToolsTest/tr_test-po/pt/catalog.po b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMPoQmToolsTest/tr_test-po/pt/catalog.po new file mode 100644 index 0000000000..61f29b1392 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMPoQmToolsTest/tr_test-po/pt/catalog.po @@ -0,0 +1,22 @@ +msgid "" +msgstr "" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Language: pt\n" +"X-Qt-Contexts: true\n" + +#: main.cpp:12 +msgctxt "testcontext|" +msgid "test string" +msgstr "pt text" + +#: main.cpp:13 +#, qt-format +#| msgid "test plural" +msgctxt "testcontext|" +msgid "test plural %n" +msgid_plural "test plural %n" +msgstr[0] "pt singular form %n" +msgstr[1] "pt plural form %n" diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMPoQmToolsTest/tr_test-po/pt_BR/catalog.po b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMPoQmToolsTest/tr_test-po/pt_BR/catalog.po new file mode 100644 index 0000000000..d90b96083c --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMPoQmToolsTest/tr_test-po/pt_BR/catalog.po @@ -0,0 +1,22 @@ +msgid "" +msgstr "" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Language: pt_BR\n" +"X-Qt-Contexts: true\n" + +#: main.cpp:12 +msgctxt "testcontext|" +msgid "test string" +msgstr "pt_BR text" + +#: main.cpp:13 +#, qt-format +#| msgid "test plural" +msgctxt "testcontext|" +msgid "test plural %n" +msgid_plural "test plural %n" +msgstr[0] "pt_BR singular form %n" +msgstr[1] "pt_BR plural form %n" diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesCrossTest/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesCrossTest/CMakeLists.txt new file mode 100644 index 0000000000..7fba83543e --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesCrossTest/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16) +set(ECM_KDE_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../kde-modules) +set(ECM_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../modules) +set(CMAKE_MODULE_PATH "${ECM_KDE_MODULE_DIR}") + +set(CMAKE_CROSSCOMPILING ON) +include(KDEPackageAppTemplates) + +message(STATUS "Test: generate compressed template") +kde_package_app_templates(TEMPLATES "qml-plasmoid" INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}) + +# we need something to install, otherwise make install will fail. +install(FILES someFile DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + +# this will be run by CTest +configure_file(check.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/check.cmake" @ONLY) diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesCrossTest/check.cmake.in b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesCrossTest/check.cmake.in new file mode 100644 index 0000000000..a1c1d668f5 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesCrossTest/check.cmake.in @@ -0,0 +1,16 @@ +set(CMAKE_MODULE_PATH "@MODULES_DIR@/../kde-modules") +set(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") +set(CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@") + + +########################################################### + +macro(check_not_exists file) + message(STATUS "Checking for ${file}") + if (EXISTS ${file}) + message(FATAL_ERROR "File \"${file}\" does exist") + endif() +endmacro() + +message(STATUS "Test: the packaged template has not been generated") +check_not_exists(${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid.tar.bz2 ) diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesCrossTest/someFile b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesCrossTest/someFile new file mode 100644 index 0000000000..e69de29bb2 diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/CMakeLists.txt new file mode 100644 index 0000000000..919db39d07 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.16) +set(ECM_KDE_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../kde-modules) +set(ECM_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../modules) +set(CMAKE_MODULE_PATH "${ECM_KDE_MODULE_DIR}") + +set(CMAKE_CROSSCOMPILING ON) +include(KDEPackageAppTemplates) + +message(STATUS "Test: generate compressed template") +kde_package_app_templates(TEMPLATES "qml-plasmoid" INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}) + +# this will be run by CTest +configure_file(check.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/check.cmake" @ONLY) diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/check.cmake.in b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/check.cmake.in new file mode 100644 index 0000000000..2a4ed1e773 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/check.cmake.in @@ -0,0 +1,37 @@ +set(CMAKE_MODULE_PATH "@MODULES_DIR@/../kde-modules") +set(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") +set(CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@") + + +########################################################### + +macro(check_exists file) + message(STATUS "Checking for ${file}") + if (NOT EXISTS ${file}) + message(FATAL_ERROR "File \"${file}\" does not exist") + endif() +endmacro() + +message(STATUS "Test: the packaged template has been generated") +check_exists(${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid.tar.bz2 ) + +message(STATUS "Extracting the packaged template") +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid) +execute_process(COMMAND ${CMAKE_COMMAND} -E tar "xvfj" ${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid.tar.bz2 + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid + RESULT_VARIABLE result + ERROR_VARIABLE error + ) + +if(NOT result EQUAL 0) + message(FATAL_ERROR "Error extracting the template: ${error}") +endif() + +message(STATUS "Test: the packaged template has been correctly extracted") +check_exists(${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid/qml-plasmoid.png ) +check_exists(${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid/qml-plasmoid.kdevtemplate ) +check_exists(${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid/package/metadata.desktop ) + +message(STATUS "Cleaning up generated files") +file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid.tar.bz2 ) +file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid ) diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/CMakeLists.txt new file mode 100644 index 0000000000..aee4088a02 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.5) + +project(plasma-%{APPNAMELC}) + +find_package(ECM 1.4.0 REQUIRED NO_MODULE) +set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) + +find_package(KF5Plasma REQUIRED) + +plasma_install_package(package org.kde.%{APPNAMELC}) diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/Messages.sh b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/Messages.sh new file mode 100644 index 0000000000..b8af9a77e2 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/Messages.sh @@ -0,0 +1,2 @@ +#! /usr/bin/env bash +$XGETTEXT `find . -name \*.qml` -o $podir/plasma_applet_%{APPNAMELC}.pot \ No newline at end of file diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/README b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/README new file mode 100644 index 0000000000..6814263d87 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/README @@ -0,0 +1,32 @@ +Plasma Applet Template +---------------------- + +-- Build instructions -- + +cd /where/your/applet/is/generated +mkdir build +cd build +cmake -DCMAKE_INSTALL_PREFIX=MYPREFIX .. +make +make install + +(MYPREFIX is where you install your Plasma setup, replace it accordingly) + +Restart plasma to load the applet +(in a terminal type: +kquitapp plasmashell +and then +plasmashell) + +or view it with +plasmoidviewer -a YourAppletName + +-- Tutorials and resources -- +The explanation of the template +http://techbase.kde.org/index.php?title=Development/Tutorials/Plasma/GettingStarted + +Plasma techbase pages +http://techbase.kde.org/Projects/Plasma + +Plasma QML API explained +http://techbase.kde.org/Development/Tutorials/Plasma/QML/API diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/package/contents/images/pairs.svgz b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/package/contents/images/pairs.svgz new file mode 100644 index 0000000000..4d1be5de09 Binary files /dev/null and b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/package/contents/images/pairs.svgz differ diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/package/contents/ui/main.qml b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/package/contents/ui/main.qml new file mode 100644 index 0000000000..a48cf3af5f --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/package/contents/ui/main.qml @@ -0,0 +1,28 @@ +/*************************************************************************** + * Copyright (C) %{CURRENT_YEAR} by %{AUTHOR} <%{EMAIL}> * + * * + * Distributed under the OSI-approved BSD License (the "License"); + * see accompanying file COPYING-CMAKE-SCRIPTS for details. + * + * This software is distributed WITHOUT ANY WARRANTY; without even the + * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the License for more information. + ***************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.1 +import org.kde.kirigami 2.20 as Kirigami +import org.kde.plasma.plasmoid 2.0 +import org.kde.plasma.components 2.0 as PlasmaComponents + +Item { + Plasmoid.fullRepresentation: ColumnLayout { + anchors.fill: parent + Kirigami.Icon { + source: "kde" + } + PlasmaComponents.Label { + text: "This is Plasma!" + } + } +} diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/package/metadata.desktop b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/package/metadata.desktop new file mode 100644 index 0000000000..dca635d065 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/package/metadata.desktop @@ -0,0 +1,66 @@ +[Desktop Entry] +Name=%{APPNAME} +Name[ca]=%{APPNAME} +Name[ca@valencia]=%{APPNAME} +Name[da]=%{APPNAME} +Name[en_GB]=%{APPNAME} +Name[es]=%{APPNAME} +Name[fi]=%{APPNAME} +Name[gl]=%{APPNAME} +Name[it]=%{APPNAME} +Name[nb]=%{APPNAME} +Name[nl]=%{APPNAME} +Name[nn]=%{APPNAME} +Name[pl]=%{APPNAME} +Name[pt]=%{APPNAME} +Name[pt_BR]=%{APPNAME} +Name[sl]=%{APPNAME} +Name[sr]=%{APPNAME} +Name[sr@ijekavian]=%{APPNAME} +Name[sr@ijekavianlatin]=%{APPNAME} +Name[sr@latin]=%{APPNAME} +Name[sv]=%{APPNAME} +Name[uk]=%{APPNAME} +Name[x-test]=xx%{APPNAME}xx +Comment=what your app does in a few words +Comment[ca]=Què fa aquesta aplicació en poques paraules +Comment[ca@valencia]=Què fa esta aplicació en poques paraules +Comment[da]=nogle få ord om hvad din app gør +Comment[en_GB]=what your app does in a few words +Comment[es]=lo que hace su aplicación, en pocas palabras +Comment[fi]=ohjelmasi toiminta muutamalla sanalla +Comment[gl]=o que fai o seu programa en poucas palabras +Comment[it]=Cosa fa la tua applicazione in poche parole +Comment[nb]=hva programmet gjør, med noen få ord +Comment[nl]=wat uw app doet in een paar woorden +Comment[pl]=w kilku słowach opis co robi twój program +Comment[pt]=o que faz a sua aplicação, em poucas palavras +Comment[pt_BR]=breve descrição do que o seu aplicativo faz +Comment[sl]=kaj vaš program dela, v nekaj besedah +Comment[sr]=Укратко о томе шта ваш програм ради +Comment[sr@ijekavian]=Укратко о томе шта ваш програм ради +Comment[sr@ijekavianlatin]=Ukratko o tome šta vaš program radi +Comment[sr@latin]=Ukratko o tome šta vaš program radi +Comment[sv]=vad programmet gör med några få ord +Comment[uk]=призначення вашої програми у декількох словах +Comment[x-test]=xxwhat your app does in a few wordsxx + +Icon=applications-system +Type=Service +ServiceTypes=Plasma/Applet + +X-KDE-PluginInfo-Author=%{AUTHOR} +X-KDE-PluginInfo-Email=%{EMAIL} +X-KDE-PluginInfo-Name=%{APPNAMELC} +X-KDE-PluginInfo-Version=1.0 +X-KDE-PluginInfo-Website=https://plasma.kde.org/ +X-KDE-PluginInfo-Category=Utilities +X-KDE-PluginInfo-License=GPL +X-KDE-PluginInfo-EnabledByDefault=true +X-KDE-PluginInfo-Name=org.kde.%{APPNAMELC} + +X-Plasma-API=declarativeappletscript +X-Plasma-MainScript=ui/main.qml +X-Plasma-Requires-FileDialog=Unused +X-Plasma-Requires-LaunchApp=Unused +X-Plasma-DefaultSize=200,300 diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/qml-plasmoid.kdevtemplate b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/qml-plasmoid.kdevtemplate new file mode 100644 index 0000000000..2675e7110d --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/qml-plasmoid.kdevtemplate @@ -0,0 +1,74 @@ +# KDE Config File +[General] +Name=Plasma QML Applet +Name[bs]=Plasma QML Applet +Name[ca]=Miniaplicació en QML pel Plasma +Name[ca@valencia]=Miniaplicació en QML pel Plasma +Name[cs]=Aplet QML Plasma +Name[da]=Plasma QML-applet +Name[de]=Plasma-QML-Miniprogramm +Name[el]=Μικροεφαρμογή Plasma QML +Name[en_GB]=Plasma QML Applet +Name[es]=Miniaplicación QML para Plasma +Name[et]=Plasma QML aplett +Name[fi]=Plasma QML-sovelma +Name[fr]=Composant graphique QML pour Plasma +Name[gl]=Applet QML para Plasma +Name[hu]=Plasma QML kisalkalmazás +Name[it]=Applet di Plasma in QML +Name[kk]=Plasma QML апплеті +Name[ko]=Plasma QML 애플릿 +Name[nb]=Plasma QML-miniprogram +Name[nl]=Plasma QML-applet +Name[pl]=Aplet plazmy QML Applet +Name[pt]='Applet' do Plasma em QML +Name[pt_BR]=Miniaplicativo Plasma em QML +Name[ru]=Аплет Plasma QML +Name[sk]=Plasma QML Applet +Name[sl]=Aplet QML za Plasmo +Name[sr]=Плазма КуМЛ аплет +Name[sr@ijekavian]=Плазма КуМЛ аплет +Name[sr@ijekavianlatin]=Plasma QML aplet +Name[sr@latin]=Plasma QML aplet +Name[sv]=Plasma QML-miniprogram +Name[tr]=Plasma QML Programcığı +Name[uk]=Аплет Плазми мовою QML +Name[x-test]=xxPlasma QML Appletxx +Name[zh_CN]=Plasma QML 小程序 +Name[zh_TW]=Plasma QML 小程式 +Comment=Plasma QML Applet Template: a plasma applet template displaying a svg picture and a text. +Comment[bs]=Predložak za QML aplete. Predložak za plasma aplete koji prikazuju SVG sliku i tekst. +Comment[ca]=Plantilla de miniaplicació pel Plasma: una plantilla de miniaplicació del plasma que mostra una icona i un text. +Comment[ca@valencia]=Plantilla de miniaplicació pel Plasma: una plantilla de miniaplicació del plasma que mostra una icona i un text. +Comment[da]=Skabelon til Plasma QML-applet. En skabelon til en Plasma-applet, som viser et SVG-billede og en tekst. +Comment[de]=Vorlage für Plasma-QML-Miniprogramm. Eine Vorlage für ein Plasma-Miniprogramm, das ein SVG-Symbol und einen Text anzeigt +Comment[el]=Πρότυπο μικροεφαρμογής Plasma QML: ένα πρότυπο μικροεφαρμογής plasma που εμφανίζει μια εικόνα svg και ένα κείμενο. +Comment[en_GB]=Plasma QML Applet Template: a plasma applet template displaying a svg picture and a text. +Comment[es]=Plantilla de miniaplicación QML para Plasma: una plantilla de miniaplicación para Plasma que muestra una imagen SVG y un texto. +Comment[et]=Plasma QML apleti mall. Plasma apleti mall, näitab SVG-pilti ja teksti +Comment[fi]=Plasman QML-sovelmamalli: Plasma-sovelmamalli, joka näyttää kuvakkeen ja tekstiä. +Comment[fr]=Modèle de composant graphique QML pour Plasma. Un modèle de composant graphique pour Plasma affichant une image « svg » et un texte. +Comment[gl]=Modelo de applet para Plasma: un modelo de applet para Plasma que mostra unha imaxe SVG e un texto. +Comment[hu]=Plasma QML kisalkalmazás sablon: egy Plasma kisalkalmazás sablon, amely megjelenít egy SVG képet és egy szöveget. +Comment[it]=Modello di applet Plasma in QML. Un modello di programmino Plasma che visualizza un'immagine SVG e del testo +Comment[kk]=Plasma QML апплет үлгісі. SVG-суреті мен мәтінді көрсететін Plasma апплет үлгісі. +Comment[ko]=Plasma QML 애플릿 템플릿. SVG 그림과 텍스트를 표시하는 Plasma 애플릿 템플릿 +Comment[nb]=Plasma mal for QML miniprogram: en mal for et Plasma-element som viser et svg-bilde og en tekst. +Comment[nl]=Sjabloon voor Plasma-QML-applet: Een sjabloon voor een plasma-applet dat een svg-afbeelding en een tekst toont +Comment[pl]=Szablon apletu Plazmy QML: szablon apletu plazmy wyświetlający zdjęcie svg i tekst. +Comment[pt]=Modelo de 'Applet' do Plasma. Um modelo de 'applet' do Plasma que mostra uma imagem SVG e algum texto. +Comment[pt_BR]=Modelo de miniaplicativo Plasma em QML: Um modelo de miniaplicativo Plasma que mostra uma imagem SVG e texto. +Comment[ru]=Пример виджета Plasma на QML. Шаблон виджета Plasma, показывающий изображение SVG и текст. +Comment[sk]=Šablóna appletu Plasma QML: šablóna plasma appletu zobrazujúca svg obrázok a text. +Comment[sl]=Predloga apleta Plasma, ki prikazuje sliko svg in besedilo. +Comment[sr]=Шаблон за плазма КуМЛ аплет који даје СВГ слику и текст +Comment[sr@ijekavian]=Шаблон за плазма КуМЛ аплет који даје СВГ слику и текст +Comment[sr@ijekavianlatin]=Šablon za plasma QML aplet koji daje SVG sliku i tekst +Comment[sr@latin]=Šablon za plasma QML aplet koji daje SVG sliku i tekst +Comment[sv]=Mall för Plasma QML-miniprogram. En mall för ett Plasma-miniprogram som visar en SVG-bild och en text. +Comment[tr]=Plasma QML Programcığı Şablonu: Bir metin ve svg resmi gösteren plasma programcığı şablonu +Comment[uk]=Шаблон аплету Плазми. Шаблон аплету Плазми, який показу зображення SVG і текст. +Comment[x-test]=xxPlasma QML Applet Template: a plasma applet template displaying a svg picture and a text.xx +Comment[zh_TW]=Plasma QML 小程式樣本:用於顯示 svg 圖片與文字的 plasma 小程式樣本 +Category=KDE/Plasmoid +Icon=qml-plasmoid.png diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/qml-plasmoid.png b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/qml-plasmoid.png new file mode 100644 index 0000000000..26748f6cf7 Binary files /dev/null and b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesForcedTest/qml-plasmoid/qml-plasmoid.png differ diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/toolchain/ecm-version.gradle.in b/local/recipes/kde/kf6-extra-cmake-modules/source/toolchain/ecm-version.gradle.in new file mode 100644 index 0000000000..52bac1bde2 --- /dev/null +++ b/local/recipes/kde/kf6-extra-cmake-modules/source/toolchain/ecm-version.gradle.in @@ -0,0 +1,25 @@ +// SPDX-FileCopyrightText: 2025 Volker Krause +// SPDX-License-Identifier: BSD-2-Clause + +ext { + ecmVersionName = "@PROJECT_VERSION@" + // version code needs to be strictly increasing and properly ordered for multiple APKs with different architectures + // we ensure the former by tying this to time and the latter by using CI_PIPELINE_CREATED_AT for builds + // in Gitlab pipelines. + // + // We have the following constraints to satisfy + // - Google Play requires different version codes for different architecture APKs + // - F-Droid requires ARM32 does not have a higher version code than ARM64 + // - Google Play require ARM64 to have a higher version code as ARM32 + ecmVersionCode = (int)(new Date().getTime()/1000) + if (System.getenv('CI_PIPELINE_CREATED_AT')) { + ecmVersionCode = (int)(Date.from(Instant.parse(System.getenv('CI_PIPELINE_CREATED_AT'))).getTime()/1000) + if (System.getenv('KDECI_CRAFT_PLATFORM')) { + if (System.getenv('KDECI_CRAFT_PLATFORM').contains('x86_64')) { + ecmVersionCode = ecmVersionCode + 1 + } else if (System.getenv('KDECI_CRAFT_PLATFORM').contains('arm64')) { + ecmVersionCode = ecmVersionCode + 2 + } + } + } +} diff --git a/local/recipes/kde/kf6-karchive/source/LICENSES/Apache-2.0.txt b/local/recipes/kde/kf6-karchive/source/LICENSES/Apache-2.0.txt new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/LICENSES/Apache-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/local/recipes/kde/kf6-karchive/source/REUSE.toml b/local/recipes/kde/kf6-karchive/source/REUSE.toml new file mode 100644 index 0000000000..df48f5b276 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/REUSE.toml @@ -0,0 +1,6 @@ +version = 1 + +[[annotations]] +path = "autotests/data/corpus/*" +SPDX-FileCopyrightText = "2025 Azhar Momin " +SPDX-License-Identifier = "CC0-1.0" diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_bcj.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_bcj.7z new file mode 100644 index 0000000000..1887a27f62 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_bcj.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_bcj2.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_bcj2.7z new file mode 100644 index 0000000000..d0ae6f5020 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_bcj2.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_bzip2.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_bzip2.7z new file mode 100644 index 0000000000..9271ef78bf Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_bzip2.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_copy.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_copy.7z new file mode 100644 index 0000000000..e5d11bdbb6 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_copy.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_deflate.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_deflate.7z new file mode 100644 index 0000000000..050ab91112 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_deflate.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_lzma.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_lzma.7z new file mode 100644 index 0000000000..a33ffae94f Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_lzma.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_lzma2.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_lzma2.7z new file mode 100644 index 0000000000..58e00ae6ac Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_lzma2.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_zstd.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_zstd.7z new file mode 100644 index 0000000000..75cf1b09e4 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/7z_coder_test_zstd.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/corpus/sample.ar b/local/recipes/kde/kf6-karchive/source/autotests/data/corpus/sample.ar new file mode 100644 index 0000000000..996b4246c4 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/autotests/data/corpus/sample.ar @@ -0,0 +1,3 @@ +! +file.txt/ 1748185727 1000 1000 100644 14 ` +Hello, World! diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/corpus/sample.tar b/local/recipes/kde/kf6-karchive/source/autotests/data/corpus/sample.tar new file mode 100644 index 0000000000..75fe444434 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/corpus/sample.tar differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/corpus/sample.tar.lz b/local/recipes/kde/kf6-karchive/source/autotests/data/corpus/sample.tar.lz new file mode 100644 index 0000000000..9a04ca590d Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/corpus/sample.tar.lz differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/corpus/sample.tar.xz b/local/recipes/kde/kf6-karchive/source/autotests/data/corpus/sample.tar.xz new file mode 100644 index 0000000000..32811c99de Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/corpus/sample.tar.xz differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/corpus/sample.tar.zst b/local/recipes/kde/kf6-karchive/source/autotests/data/corpus/sample.tar.zst new file mode 100644 index 0000000000..ce23a92e2f Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/corpus/sample.tar.zst differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/dict/k7z_fuzzer.dict b/local/recipes/kde/kf6-karchive/source/autotests/data/dict/k7z_fuzzer.dict new file mode 100644 index 0000000000..c9f6a936c9 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/autotests/data/dict/k7z_fuzzer.dict @@ -0,0 +1,41 @@ +# SPDX-FileCopyrightText: 2025 Azhar Momin +# SPDX-License-Identifier: CC0-1.0 + +magic="7z\xBC\xAF\x27\x1C" + +# Header types +end="\x00" +header="\x01" +archive_properties="\x02" +additional_streams_info="\x03" +main_streams_info="\x04" +files_info="\x05" +pack_info="\x06" +unpack_info="\x07" +substreams_info="\x08" +size="\x09" +crc="\x0A" +folder="\x0B" +coders_unpack_size="\x0C" +num_unpack_stream="\x0D" +empty_stream="\x0E" +empty_file="\x0F" +anti="\x10" +name="\x11" +ctime="\x12" +atime="\x13" +mtime="\x14" +attributes="\x15" +comment="\x16" +encoded_header="\x17" +start_pos="\x18" +dummy="\x19" + +# Method IDs +lzma2="\x21" +lzma="\x03\x01\x01" +bcj="\x03\x03\x01\x03" +bcj2="\x03\x03\x01\x1B" +ppmd="\x03\x04\x01" +bzip2="\x04\x02\x02" +aes="\x06\xF1\x07\x01" diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/dict/kar_fuzzer.dict b/local/recipes/kde/kf6-karchive/source/autotests/data/dict/kar_fuzzer.dict new file mode 100644 index 0000000000..732a61159a --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/autotests/data/dict/kar_fuzzer.dict @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2025 Azhar Momin +# SPDX-License-Identifier: CC0-1.0 + +magic="!\\n" +file_magic="`\\n" diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/dict/ktar_bz2_fuzzer.dict b/local/recipes/kde/kf6-karchive/source/autotests/data/dict/ktar_bz2_fuzzer.dict new file mode 100644 index 0000000000..1dc7e6d5b7 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/autotests/data/dict/ktar_bz2_fuzzer.dict @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: 2025 Azhar Momin +# SPDX-License-Identifier: CC0-1.0 + +magic="ustar" +version="00" + +magic="BZ" +version_bzip2="h" +version_bzip1="0" + +compressed_magic="\x31\x41\x59\x26\x53\x59" +eos_magic="\x17\x72\x45\x38\x50\x90" diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/dict/ktar_fuzzer.dict b/local/recipes/kde/kf6-karchive/source/autotests/data/dict/ktar_fuzzer.dict new file mode 100644 index 0000000000..48bea4559f --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/autotests/data/dict/ktar_fuzzer.dict @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2025 Azhar Momin +# SPDX-License-Identifier: CC0-1.0 + +magic="ustar" +version="00" + +# Interesting typeflags +"5" +"D" +"x" +"g" +"1" + +longlink="././@LongLink" diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/dict/ktar_gz_fuzzer.dict b/local/recipes/kde/kf6-karchive/source/autotests/data/dict/ktar_gz_fuzzer.dict new file mode 100644 index 0000000000..49626d3ea3 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/autotests/data/dict/ktar_gz_fuzzer.dict @@ -0,0 +1,34 @@ +# SPDX-FileCopyrightText: 2025 Azhar Momin +# SPDX-License-Identifier: CC0-1.0 + +magic="ustar" +version="00" + +magic="\x1F\x8B" + +deflate="\x08" + +# File Flags +ftxt="\x01" +fhcrc="\x02" +fextra="\x04" +fname="\x08" +fcomment="\x10" +fall="\x1F" + +# Operating System +fat="\x00" +amiga="\x01" +vms="\x02" +unix="\x03" +vm_cms="\x04" +atari_tos="\x05" +hpfs="\x06" +mac="\x07" +zsystem="\x08" +cp_m="\x09" +tops20="\x0A" +ntfs="\x0B" +qdos="\x0C" +acorn_riscos="\x0D" +unknown="\xFF" diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/dict/ktar_lz_fuzzer.dict b/local/recipes/kde/kf6-karchive/source/autotests/data/dict/ktar_lz_fuzzer.dict new file mode 100644 index 0000000000..5a3ce57efe --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/autotests/data/dict/ktar_lz_fuzzer.dict @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: 2025 Azhar Momin +# SPDX-License-Identifier: CC0-1.0 + +magic="ustar" +version="00" + +magic="LZIP" +version_old="\x00" +version="\x01" diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/dict/ktar_xz_fuzzer.dict b/local/recipes/kde/kf6-karchive/source/autotests/data/dict/ktar_xz_fuzzer.dict new file mode 100644 index 0000000000..2f49c85119 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/autotests/data/dict/ktar_xz_fuzzer.dict @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: 2025 Azhar Momin +# SPDX-License-Identifier: CC0-1.0 + +magic="ustar" +version="00" + +magic="\x5D\x37\x7A\x58\x5A\x00" +footer_magic="\x59\x5A" + +check_none="\x00\x00" +check_crc32="\x01\x00" +check_crc64="\x04\x00" +check_sha256="\x0A\x00" + +# Filter IDs +lzma2="\x21" +delta="\x03" +x86="\x04" +powerpc="\x05" +ia64="\x06" +arm="\x07" +armthumb="\x08" +sparc="\x09" diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/dict/ktar_zst_fuzzer.dict b/local/recipes/kde/kf6-karchive/source/autotests/data/dict/ktar_zst_fuzzer.dict new file mode 100644 index 0000000000..670b529c58 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/autotests/data/dict/ktar_zst_fuzzer.dict @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: 2025 Azhar Momin +# SPDX-License-Identifier: CC0-1.0 + +magic="ustar" +version="00" + +magic="\x28\xB5\x2F\xFD" + +# Skippable Frames +"\x50\x2A\x4D\x18" +"\x51\x2A\x4D\x18" +"\x52\x2A\x4D\x18" +"\x53\x2A\x4D\x18" +"\x54\x2A\x4D\x18" +"\x55\x2A\x4D\x18" +"\x56\x2A\x4D\x18" +"\x57\x2A\x4D\x18" +"\x58\x2A\x4D\x18" +"\x59\x2A\x4D\x18" +"\x5A\x2A\x4D\x18" +"\x5B\x2A\x4D\x18" +"\x5C\x2A\x4D\x18" +"\x5D\x2A\x4D\x18" +"\x5E\x2A\x4D\x18" +"\x5F\x2A\x4D\x18" diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/dict/kzip_fuzzer.dict b/local/recipes/kde/kf6-karchive/source/autotests/data/dict/kzip_fuzzer.dict new file mode 100644 index 0000000000..6084340f80 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/autotests/data/dict/kzip_fuzzer.dict @@ -0,0 +1,13 @@ +# SPDX-FileCopyrightText: 2025 Azhar Momin +# SPDX-License-Identifier: CC0-1.0 + +cd="\x50\x4B\x01\x02" +lfh="\x50\x4B\x03\x04" +eocd="\x50\x4B\x05\x06" +zip64_eocd"\x50\x4B\x06\x06" +zip64_eocd_locator="\x50\x4B\x06\x07" +dd="\x50\x4B\x07\x08" + +# Compression methods +store="\x00" +deflate="\x08" diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/filename_ends_in_slash.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/filename_ends_in_slash.7z new file mode 100644 index 0000000000..8dd504a518 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/filename_ends_in_slash.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/global_header_test.tar.gz b/local/recipes/kde/kf6-karchive/source/autotests/data/global_header_test.tar.gz new file mode 100644 index 0000000000..613d2a6a5b Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/global_header_test.tar.gz differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/multiple_nameless_files.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/multiple_nameless_files.7z new file mode 100644 index 0000000000..6bde3bc64d Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/multiple_nameless_files.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_issue_433303801.zip b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_issue_433303801.zip new file mode 100644 index 0000000000..076c97c42d Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_issue_433303801.zip differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_issue_440829292.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_issue_440829292.7z new file mode 100644 index 0000000000..52b45377a7 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_issue_440829292.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_issue_441906077.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_issue_441906077.7z new file mode 100644 index 0000000000..5dd16931a6 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_issue_441906077.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_4566647131406336.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_4566647131406336.7z new file mode 100644 index 0000000000..5d2aa662e1 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_4566647131406336.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_4784793343819776.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_4784793343819776.7z new file mode 100644 index 0000000000..851a9597ec Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_4784793343819776.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5082404562993152.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5082404562993152.7z new file mode 100644 index 0000000000..1b39657266 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5082404562993152.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5125023070486528.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5125023070486528.7z new file mode 100644 index 0000000000..1b00779655 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5125023070486528.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5132547098214400.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5132547098214400.7z new file mode 100644 index 0000000000..791f79bdcb Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5132547098214400.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5141245598171136.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5141245598171136.7z new file mode 100644 index 0000000000..ee15cfc00b Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5141245598171136.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5158171118469120.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5158171118469120.7z new file mode 100644 index 0000000000..46d2a47654 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5158171118469120.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5161502865948672.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5161502865948672.7z new file mode 100644 index 0000000000..e5f27dec0f Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5161502865948672.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5497856632094720.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5497856632094720.7z new file mode 100644 index 0000000000..c5bc7ec3d2 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5497856632094720.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5503074996387840.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5503074996387840.7z new file mode 100644 index 0000000000..8dab12273d Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5503074996387840.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5560695602348032.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5560695602348032.7z new file mode 100644 index 0000000000..b77d294c4f Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5560695602348032.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5581009572921344.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5581009572921344.7z new file mode 100644 index 0000000000..b3a6255d6b Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5581009572921344.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5821682553257984.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5821682553257984.7z new file mode 100644 index 0000000000..07cbacd851 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5821682553257984.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5991129817612288.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5991129817612288.7z new file mode 100644 index 0000000000..0e84c945c9 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_5991129817612288.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6077171694370816.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6077171694370816.7z new file mode 100644 index 0000000000..cd77fc4b3e Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6077171694370816.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6096742417498112.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6096742417498112.7z new file mode 100644 index 0000000000..ac1d7e8f26 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6096742417498112.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6213340184772608.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6213340184772608.7z new file mode 100644 index 0000000000..77827e37a4 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6213340184772608.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6248361801089024.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6248361801089024.7z new file mode 100644 index 0000000000..b10f3ef263 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6248361801089024.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6366650283917312.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6366650283917312.7z new file mode 100644 index 0000000000..4dd9c017de Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6366650283917312.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6532014901886976.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6532014901886976.7z new file mode 100644 index 0000000000..63744e306e Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6532014901886976.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6581632288227328.tar.gz b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6581632288227328.tar.gz new file mode 100644 index 0000000000..6cff643232 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6581632288227328.tar.gz differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6593198198947840.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6593198198947840.7z new file mode 100644 index 0000000000..343f1a3cce Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6593198198947840.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6597581431177216.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6597581431177216.7z new file mode 100644 index 0000000000..ee41eaccc2 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6597581431177216.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6649925879529472.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6649925879529472.7z new file mode 100644 index 0000000000..35e43d09b1 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6649925879529472.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6653406484955136.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6653406484955136.7z new file mode 100644 index 0000000000..b64b6b7232 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6653406484955136.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6740459604213760.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6740459604213760.7z new file mode 100644 index 0000000000..ebea5a1308 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/ossfuzz_testcase_6740459604213760.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/password_protected.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/password_protected.7z new file mode 100644 index 0000000000..5c14fc8417 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/password_protected.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/readnumber_check.7z b/local/recipes/kde/kf6-karchive/source/autotests/data/readnumber_check.7z new file mode 100644 index 0000000000..fb7ff687d4 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/readnumber_check.7z differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/runtime_resource.rcc b/local/recipes/kde/kf6-karchive/source/autotests/data/runtime_resource.rcc new file mode 100644 index 0000000000..10b52cbf5d Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/runtime_resource.rcc differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/tar_deep_hierarchy.tar.xz b/local/recipes/kde/kf6-karchive/source/autotests/data/tar_deep_hierarchy.tar.xz new file mode 100644 index 0000000000..a5284d6fe4 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/tar_deep_hierarchy.tar.xz differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/tar_directory_forgotten.tar.gz b/local/recipes/kde/kf6-karchive/source/autotests/data/tar_directory_forgotten.tar.gz new file mode 100644 index 0000000000..3f6452a163 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/tar_directory_forgotten.tar.gz differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/tar_directory_twice.tar.gz b/local/recipes/kde/kf6-karchive/source/autotests/data/tar_directory_twice.tar.gz new file mode 100644 index 0000000000..a87449dc0a Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/tar_directory_twice.tar.gz differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/tar_emptyfile_missingdir.tar.gz b/local/recipes/kde/kf6-karchive/source/autotests/data/tar_emptyfile_missingdir.tar.gz new file mode 100644 index 0000000000..12aac6e4eb Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/tar_emptyfile_missingdir.tar.gz differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/tar_non_ascii_file_name.tar.gz b/local/recipes/kde/kf6-karchive/source/autotests/data/tar_non_ascii_file_name.tar.gz new file mode 100644 index 0000000000..bfbce8360e Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/tar_non_ascii_file_name.tar.gz differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/tar_prefix_test.tar.gz b/local/recipes/kde/kf6-karchive/source/autotests/data/tar_prefix_test.tar.gz new file mode 100644 index 0000000000..e4545a3c4f Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/tar_prefix_test.tar.gz differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/tar_relative_path_outside_archive.tar.bz2 b/local/recipes/kde/kf6-karchive/source/autotests/data/tar_relative_path_outside_archive.tar.bz2 new file mode 100644 index 0000000000..50a3aca2c3 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/tar_relative_path_outside_archive.tar.bz2 differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/tar_rootdir.tar.gz b/local/recipes/kde/kf6-karchive/source/autotests/data/tar_rootdir.tar.gz new file mode 100644 index 0000000000..3461fd2510 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/tar_rootdir.tar.gz differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/zip64_datadescriptor.zip b/local/recipes/kde/kf6-karchive/source/autotests/data/zip64_datadescriptor.zip new file mode 100644 index 0000000000..1a63eb67ba Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/zip64_datadescriptor.zip differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/zip64_end_of_central_directory.zip b/local/recipes/kde/kf6-karchive/source/autotests/data/zip64_end_of_central_directory.zip new file mode 100644 index 0000000000..22736a76c9 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/zip64_end_of_central_directory.zip differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/zip64_extra_zip64_localheader.oxps b/local/recipes/kde/kf6-karchive/source/autotests/data/zip64_extra_zip64_localheader.oxps new file mode 100644 index 0000000000..ade9c82a02 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/zip64_extra_zip64_localheader.oxps differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/zip64_extra_zip64_size.zip.gz b/local/recipes/kde/kf6-karchive/source/autotests/data/zip64_extra_zip64_size.zip.gz new file mode 100644 index 0000000000..5c7cfa7df7 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/zip64_extra_zip64_size.zip.gz differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/zip64_extra_zip64_size_first.zip.gz b/local/recipes/kde/kf6-karchive/source/autotests/data/zip64_extra_zip64_size_first.zip.gz new file mode 100644 index 0000000000..5e1e36d60e Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/zip64_extra_zip64_size_first.zip.gz differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/zip64_nested_stored_streamed.zip b/local/recipes/kde/kf6-karchive/source/autotests/data/zip64_nested_stored_streamed.zip new file mode 100644 index 0000000000..c7668473a2 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/zip64_nested_stored_streamed.zip differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/zip_deep_hierarchy.zip b/local/recipes/kde/kf6-karchive/source/autotests/data/zip_deep_hierarchy.zip new file mode 100644 index 0000000000..a65fb1e007 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/zip_deep_hierarchy.zip differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/data/zip_duplicate_names.zip b/local/recipes/kde/kf6-karchive/source/autotests/data/zip_duplicate_names.zip new file mode 100644 index 0000000000..1c2b40aeb8 Binary files /dev/null and b/local/recipes/kde/kf6-karchive/source/autotests/data/zip_duplicate_names.zip differ diff --git a/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/CMakeLists.txt b/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/CMakeLists.txt new file mode 100644 index 0000000000..c598297685 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/CMakeLists.txt @@ -0,0 +1,58 @@ +# SPDX-FileCopyrightText: 2025 Azhar Momin +# SPDX-License-Identifier: BSD-2-Clause + +if(DEFINED ENV{LIB_FUZZING_ENGINE}) + set(fuzzing_engine $ENV{LIB_FUZZING_ENGINE}) +else() + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(fuzzing_engine -fsanitize=fuzzer) + else() + message(FATAL_ERROR "Fuzzing engine not supported") + endif() +endif() + +function(add_fuzzer target_name source_file define_name define_value) + add_executable(${target_name} ${source_file}) + + target_compile_definitions( + ${target_name} + PRIVATE ${define_name}=${define_value} + ) + + target_link_libraries( + ${target_name} + PRIVATE KF6Archive ${fuzzing_engine} + ) + + set_target_properties( + ${target_name} PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/fuzzers + ) +endfunction() + + +if(LIBLZMA_FOUND) + add_fuzzer(k7z_fuzzer karchive_fuzzer.cc HANDLER K7Zip) + if(OpenSSL_FOUND) + target_compile_definitions(k7z_fuzzer PRIVATE USE_PASSWORD=1) + endif() +endif() + +add_fuzzer(kar_fuzzer karchive_fuzzer.cc HANDLER KAr) +add_fuzzer(ktar_fuzzer karchive_fuzzer.cc HANDLER KTar) +add_fuzzer(kzip_fuzzer karchive_fuzzer.cc HANDLER KZip) + +if(BZIP2_FOUND) + add_fuzzer(ktar_bz2_fuzzer kcompressiondevice_fuzzer.cc DEVICE BZip2) +endif() + +add_fuzzer(ktar_gz_fuzzer kcompressiondevice_fuzzer.cc DEVICE GZip) + +if(LIBLZMA_FOUND) + add_fuzzer(ktar_lz_fuzzer kcompressiondevice_fuzzer.cc DEVICE Lz) + add_fuzzer(ktar_xz_fuzzer kcompressiondevice_fuzzer.cc DEVICE Xz) +endif() + +if(LibZstd_FOUND) + add_fuzzer(ktar_zst_fuzzer kcompressiondevice_fuzzer.cc DEVICE Zstd) +endif() diff --git a/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/README.md b/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/README.md new file mode 100644 index 0000000000..70d74e8368 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/README.md @@ -0,0 +1,50 @@ + + + +# KArchive OSS-Fuzz Integration + +## Fuzzing Locally +Make sure you're using Clang (by setting `CC` and `CXX`), since fuzzing requires it. Then build KArchive with `BUILD_FUZZERS=ON` to generate the fuzzer binaries: +```sh +cmake -B build -DBUILD_FUZZERS=ON +cmake --build build +# Then run one of the fuzzer binaries: +./build/bin/fuzzers/kzip_fuzzer +``` + +## Testing OSS-Fuzz Integration +Testing OSS-Fuzz integration requires: Python & Docker + +First clone the OSS-Fuzz repository: +```sh +git clone https://github.com/google/oss-fuzz.git +``` + +After navigating to the cloned repository, run the following command to build the fuzzers: +```sh +python3 infra/helper.py build_image karchive +python3 infra/helper.py build_fuzzers --sanitizer address karchive +``` + +This may take a while since it builds the whole QtBase dependency alongside with zlib, libzstd, liblzma, libcrypto, etc and KArchive itself. Once the build is completed, you can run the fuzzers using the following command: +```sh +python3 infra/helper.py run_fuzzer karchive kzip_fuzzer +``` + +The code for preparing the build lives in the `prepare_build.sh` script and the code for building the fuzzers lives in the `build_fuzzers.sh` script (which is also responsible for building the dependencies, creating the seed corpus and copying the dict file). + +For more information on OSS-Fuzz, visit the [official website](https://google.github.io/oss-fuzz/). + +## Integrating New Fuzzers + +When you add a new archive format or compression device, you need to add a corresponding fuzzer for it. KArchive uses two main fuzzer types: +- `karchive_fuzzer.cc` for archive formats (like zip, tar, etc) +- `kcompressiondevice_fuzzer.cc` for compression devices (used through `KTar`) + +### If You Are Adding a New Archive Format: +- Update `CMakeLists.txt` to include the new fuzzer, following the pattern of existing ones +- If the format needs extra dependencies, update `prepare_build.sh` accordingly +- Update `build_fuzzers.sh` to build those dependencies and include the new fuzzer + +### If You Are Adding a New Compression Device: +- Do the same as above, but use `kcompressiondevice_fuzzer.cc` instead of `karchive_fuzzer.cc` diff --git a/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/build_fuzzers.sh b/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/build_fuzzers.sh new file mode 100755 index 0000000000..a4e93432ac --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/build_fuzzers.sh @@ -0,0 +1,128 @@ +#!/bin/bash -eu +# +# SPDX-FileCopyrightText: 2019 Google Inc. +# SPDX-FileCopyrightText: 2025 Azhar Momin +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright 2019 Google Inc. +# Copyright 2025 Azhar Momin +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +rm -rf $WORK/* + +export PATH="$WORK/bin:$PATH" +export PKG_CONFIG_PATH="$WORK/lib/pkgconfig:$WORK/lib/x86_64-linux-gnu/pkgconfig" +if [[ $FUZZING_ENGINE == "afl" ]]; then + export LDFLAGS="-fuse-ld=lld" +fi + +# build zstd +cd $SRC/zstd +cmake -S build/cmake -G Ninja \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_INSTALL_PREFIX=$WORK +ninja install -j$(nproc) + +# Build zlib +cd $SRC/zlib +./configure --static --prefix $WORK +make install -j$(nproc) + +# Build bzip2 +# Inspired from ../bzip2/build +cd $SRC +tar xzf bzip2-*.tar.gz && rm -f bzip2-*.tar.gz +cd bzip2-* +SRCL=(blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o) + +for source in ${SRCL[@]}; do + name=$(basename $source .o) + $CC $CFLAGS -c ${name}.c +done +rm -f libbz2.a +ar cq libbz2.a ${SRCL[@]} +cp -f bzlib.h $WORK/include +cp -f libbz2.a $WORK/lib + +# Build xz +export ORIG_CFLAGS="${CFLAGS}" +export ORIG_CXXFLAGS="${CXXFLAGS}" +unset CFLAGS +unset CXXFLAGS +cd $SRC/xz +./autogen.sh --no-po4a --no-doxygen +./configure --enable-static --disable-debug --disable-shared --disable-xz --disable-xzdec --disable-lzmainfo --prefix $WORK +make install -j$(nproc) +export CFLAGS="${ORIG_CFLAGS}" +export CXXFLAGS="${ORIG_CXXFLAGS}" + +# Build openssl +cd $SRC/openssl +CONFIG_FLAGS="no-shared no-tests --prefix=$WORK --openssldir=$WORK" +if [[ $CFLAGS = *sanitize=memory* ]] +then + # Disable assembly for proper instrumentation + CONFIG_FLAGS+=" no-asm" +fi +./config $CONFIG_FLAGS +make build_generated +make libcrypto.a -j$(nproc) +make install_sw + +# Build extra-cmake-modules +cd $SRC/extra-cmake-modules +cmake . -G Ninja \ + -DCMAKE_INSTALL_PREFIX=$WORK +ninja install -j$(nproc) + +# Build qtbase +cd $SRC/qtbase +./configure -no-glib -qt-libpng -qt-pcre -opensource -confirm-license -static -no-opengl \ + -no-icu -platform linux-clang-libc++ -debug -prefix $WORK -no-feature-gui -no-feature-sql \ + -no-feature-network -no-feature-xml -no-feature-dbus -no-feature-printsupport +ninja install -j$(nproc) + +# Build karchive +cd $SRC/karchive +rm -rf poqm +cmake . -G Ninja \ + -DBUILD_SHARED_LIBS=OFF \ + -DBUILD_TESTING=OFF \ + -DBUILD_FUZZERS=ON \ + -DCMAKE_INSTALL_PREFIX=$WORK +ninja install -j$(nproc) + +EXTENSIONS="k7z_fuzzer 7z + kar_fuzzer ar + ktar_fuzzer tar + kzip_fuzzer zip + ktar_bz2_fuzzer tar.bz2 + ktar_gz_fuzzer tar.gz + ktar_lz_fuzzer tar.lz + ktar_xz_fuzzer tar.xz + ktar_zst_fuzzer tar.zst" +echo "$EXTENSIONS" | while read fuzzer_name extension; do + # Copy the fuzzer + cp bin/fuzzers/$fuzzer_name $OUT + + # Create a seed corpus + find . -name "*.$extension" -exec zip -jq "$OUT/${fuzzer_name}_seed_corpus.zip" {} + + + # Copy the dictionary file + if [ -f "autotests/data/dict/$fuzzer_name.dict" ]; then + cp "autotests/data/dict/$fuzzer_name.dict" $OUT + fi +done diff --git a/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/karchive_fuzzer.cc b/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/karchive_fuzzer.cc new file mode 100644 index 0000000000..39e30d7dd8 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/karchive_fuzzer.cc @@ -0,0 +1,66 @@ +/* +# SPDX-FileCopyrightText: 2019 Google Inc. +# SPDX-FileCopyrightText: 2025 Azhar Momin +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright 2019 Google Inc. +# Copyright 2025 Azhar Momin +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +*/ + +/* + Usage: + python infra/helper.py build_image karchive + python infra/helper.py build_fuzzers --sanitizer undefined|address|memory karchive + python infra/helper.py run_fuzzer karchive k[ar|tar|zip|7z]_fuzzer +*/ + +#ifndef HANDLER +#error "HANDLER is not defined" +#endif + +#include +#include + +#include +#include +#include +#include + +#include "karchive_fuzzer_common.h" + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + int argc = 0; + QCoreApplication a(argc, nullptr); + + QBuffer b; + b.setData((const char *)data, size); + + HANDLER handler(&b); + +#ifdef USE_PASSWORD + // Set a dummy password to force decryption + handler.setPassword(QStringLiteral("youshallnotpass")); +#endif + + if (handler.open(QIODevice::ReadOnly)) { + traverseArchive(handler.directory()); + handler.close(); + } + + return 0; +} diff --git a/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/karchive_fuzzer_common.h b/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/karchive_fuzzer_common.h new file mode 100644 index 0000000000..d26679de84 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/karchive_fuzzer_common.h @@ -0,0 +1,53 @@ +/* +# SPDX-FileCopyrightText: 2025 Google LLC +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +*/ + +#include + +inline void traverseArchive(const KArchiveDirectory *dir, const QString &path = QString()) +{ + for (const auto &entryName : dir->entries()) { + auto entry = dir->entry(entryName); + + if (entry->isFile()) { + auto file = static_cast(entry); + QIODevice *device = file->createDevice(); + if (device) { + static const qint64 chunkSize = 1024 * 1024 * 100; + qint64 remainingSize = device->size(); + QByteArray array; + array.resize(int(qMin(chunkSize, remainingSize))); + while (remainingSize > 0) { + const qint64 currentChunkSize = qMin(chunkSize, remainingSize); + const qint64 n = device->read(array.data(), currentChunkSize); + if (n != currentChunkSize) { + delete device; + return; + } + remainingSize -= currentChunkSize; + } + delete device; + } + } else if (entry->isDirectory()) { + auto subDir = static_cast(entry); + traverseArchive(subDir, path + QString::fromUtf8("/") + entryName); + } + } +} diff --git a/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/kcompressiondevice_fuzzer.cc b/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/kcompressiondevice_fuzzer.cc new file mode 100644 index 0000000000..da42a782ff --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/kcompressiondevice_fuzzer.cc @@ -0,0 +1,57 @@ +/* +# SPDX-FileCopyrightText: 2025 Google LLC +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +*/ + +/* + Usage: + python infra/helper.py build_image karchive + python infra/helper.py build_fuzzers --sanitizer undefined|address|memory karchive + python infra/helper.py run_fuzzer karchive ktar_[gz|bz2|xz|zst|lz]_fuzzer +*/ +#ifndef DEVICE +#error "DEVICE is not defined" +#endif + +#include +#include + +#include +#include + +#include "karchive_fuzzer_common.h" + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + int argc = 0; + QCoreApplication a(argc, nullptr); + + QBuffer b; + b.setData((const char *)data, size); + + KCompressionDevice kd(&b, false, KCompressionDevice::DEVICE); + KTar ktar(&kd); + + if (ktar.open(QIODevice::ReadOnly)) { + traverseArchive(ktar.directory()); + ktar.close(); + } + + return 0; +} diff --git a/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/prepare_build.sh b/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/prepare_build.sh new file mode 100755 index 0000000000..c7ef060afe --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/autotests/ossfuzz/prepare_build.sh @@ -0,0 +1,33 @@ +#!/bin/bash -eu +# +# SPDX-FileCopyrightText: 2019 Google Inc. +# SPDX-License-Identifier: Apache-2.0 +# +# Based on https://github.com/google/oss-fuzz/blob/33aab4a70dc4b5811143d214536584a8c8cb3924/projects/karchive/Dockerfile +# Copyright 2019 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +apt-get update && \ + apt-get install -y cmake make autoconf automake autopoint libtool \ + wget po4a ninja-build pkgconf + +git clone --depth 1 https://github.com/madler/zlib.git +git clone --depth 1 https://github.com/facebook/zstd.git +git clone --depth 1 https://github.com/openssl/openssl.git +wget https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz +git clone https://github.com/tukaani-project/xz.git +git clone --depth 1 -b dev git://code.qt.io/qt/qtbase.git +git clone --depth 1 -b master https://invent.kde.org/frameworks/extra-cmake-modules.git diff --git a/local/recipes/kde/kf6-karchive/source/poqm/ga/karchive6_qt.po b/local/recipes/kde/kf6-karchive/source/poqm/ga/karchive6_qt.po new file mode 100644 index 0000000000..6d5061a1e1 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/poqm/ga/karchive6_qt.po @@ -0,0 +1,484 @@ +msgid "" +msgstr "" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=5; plural=n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n < 11 ? " +"3 : 4\n" +"X-Qt-Contexts: true\n" + +#: k7zip.cpp:2541 +msgctxt "K7Zip|" +msgid "Could not get underlying device" +msgstr "" + +#: k7zip.cpp:2549 +msgctxt "K7Zip|" +msgid "Read header failed" +msgstr "" + +#: k7zip.cpp:2555 +msgctxt "K7Zip|" +msgid "Check signature failed" +msgstr "" + +#: k7zip.cpp:2578 +msgctxt "K7Zip|" +msgid "Bad CRC" +msgstr "" + +#: k7zip.cpp:2587 +msgctxt "K7Zip|" +msgid "Next header size is too big" +msgstr "" + +#: k7zip.cpp:2592 +msgctxt "K7Zip|" +msgid "Next header size is less than zero" +msgstr "" + +#: k7zip.cpp:2603 +#, qt-format +msgctxt "K7Zip|" +msgid "Failed read next header size; should read %1, read %2" +msgstr "" + +#: k7zip.cpp:2616 +msgctxt "K7Zip|" +msgid "Bad next header CRC" +msgstr "" + +#: k7zip.cpp:2624 +msgctxt "K7Zip|" +msgid "Error in header" +msgstr "" + +#: k7zip.cpp:2642 k7zip.cpp:2675 +msgctxt "K7Zip|" +msgid "Password needed for this archive" +msgstr "" + +#: k7zip.cpp:2648 +msgctxt "K7Zip|" +msgid "Wrong header type" +msgstr "" + +#: k7zip.cpp:2658 k7zip.cpp:2664 +msgctxt "K7Zip|" +msgid "Not implemented" +msgstr "" + +#: k7zip.cpp:2670 +msgctxt "K7Zip|" +msgid "Error while reading main streams information" +msgstr "" + +#: k7zip.cpp:2693 +msgctxt "K7Zip|" +msgid "Error while reading header" +msgstr "" + +#: k7zip.cpp:2701 k7zip.cpp:2709 +#, qt-format +msgctxt "K7Zip|" +msgid "Archive has %1 files which is more than the supported amount (%2)" +msgstr "" + +#: k7zip.cpp:2767 +msgctxt "K7Zip|" +msgid "Error reading modification time" +msgstr "" + +#: k7zip.cpp:2813 +msgctxt "K7Zip|" +msgid "Error reading MTime" +msgstr "" + +#: k7zip.cpp:2820 +msgctxt "K7Zip|" +msgid "Invalid" +msgstr "" + +#: k7zip.cpp:2844 +#, qt-format +msgctxt "K7Zip|" +msgid "Read size failed (checkRecordsSize: %1, d->pos - ppp: %2, size: %3)" +msgstr "" + +#: k7zip.cpp:2884 +msgctxt "K7Zip|" +msgid "contents" +msgstr "" + +#: k7zip.cpp:3079 +msgctxt "K7Zip|" +msgid "Write error" +msgstr "" + +#: k7zip.cpp:3109 +msgctxt "K7Zip|" +msgid "Failed while encoding header" +msgstr "" + +#: k7zip.cpp:3153 +msgctxt "K7Zip|" +msgid "No file currently selected" +msgstr "" + +#: k7zip.cpp:3177 k7zip.cpp:3227 k7zip.cpp:3267 +msgctxt "K7Zip|" +msgid "Application error: 7-Zip file must be open before being written into" +msgstr "" + +#: k7zip.cpp:3183 k7zip.cpp:3273 +msgctxt "K7Zip|" +msgid "Application error: attempted to write into non-writable 7-Zip file" +msgstr "" + +#: kar.cpp:53 kar.cpp:60 kar.cpp:67 kar.cpp:74 +msgctxt "KAr|" +msgid "Cannot write to AR file" +msgstr "" + +#: kar.cpp:87 +#, qt-format +msgctxt "KAr|" +msgid "Unsupported mode %1" +msgstr "" + +#: kar.cpp:98 +msgctxt "KAr|" +msgid "Invalid main magic" +msgstr "" + +#: kar.cpp:115 +msgctxt "KAr|" +msgid "Invalid magic" +msgstr "" + +#: kar.cpp:126 +msgctxt "KAr|" +msgid "Invalid size" +msgstr "" + +#: kar.cpp:146 +msgctxt "KAr|" +msgid "Invalid longfilename reference" +msgstr "" + +#: kar.cpp:150 +msgctxt "KAr|" +msgid "Invalid longfilename position reference" +msgstr "" + +#: karchive.cpp:178 +msgctxt "KArchive|" +msgid "No filename or device was specified" +msgstr "" + +#: karchive.cpp:183 +#, qt-format +msgctxt "KArchive|" +msgid "Could not open device in mode %1" +msgstr "" + +#: karchive.cpp:210 +#, qt-format +msgctxt "KArchive|" +msgid "QSaveFile creation for %1 failed: %2" +msgstr "" + +#: karchive.cpp:229 +#, qt-format +msgctxt "KArchive|" +msgid "Unsupported mode %1" +msgstr "" + +#: karchive.cpp:238 +msgctxt "KArchive|" +msgid "Archive already closed" +msgstr "" + +#: karchive.cpp:287 +#, qt-format +msgctxt "KArchive|" +msgid "%1 doesn't exist or is not a regular file." +msgstr "" + +#: karchive.cpp:293 +#, qt-format +msgctxt "KArchive|" +msgid "" +"Failed accessing the file %1 for adding to the archive. The error was: %2" +msgstr "" + +#: karchive.cpp:339 +#, qt-format +msgctxt "KArchive|" +msgid "Couldn't open file %1: %2" +msgstr "" + +#: karchive.cpp:373 +#, qt-format +msgctxt "KArchive|" +msgid "Directory %1 does not exist" +msgstr "" + +#: karchive.cpp:447 +#, qt-format +msgctxt "KArchive|" +msgid "Writing failed: %1" +msgstr "" + +#: karchive_p.h:59 +msgctxt "QIODevice|" +msgid "Unknown error" +msgstr "" + +#: kcompressiondevice.cpp:514 +msgctxt "KCompressionDevice|" +msgid "Could not write. Partition full?" +msgstr "" + +#: krcc.cpp:83 krcc.cpp:90 krcc.cpp:97 krcc.cpp:104 +msgctxt "KRcc|" +msgid "Cannot write to RCC file" +msgstr "" + +#: krcc.cpp:117 +#, qt-format +msgctxt "KRcc|" +msgid "Unsupported mode %1" +msgstr "" + +#: krcc.cpp:124 +#, qt-format +msgctxt "KRcc|" +msgid "Failed to register resource %1 under prefix %2" +msgstr "" + +#: ktar.cpp:349 +#, qt-format +msgctxt "KTar|" +msgid "File %1 does not exist" +msgstr "" + +#: ktar.cpp:356 +#, qt-format +msgctxt "KTar|" +msgid "Archive %1 is corrupt" +msgstr "" + +#: ktar.cpp:360 +msgctxt "KTar|" +msgid "Disk full" +msgstr "" + +#: ktar.cpp:394 +msgctxt "KTar|" +msgid "Could not get underlying device" +msgstr "" + +#: ktar.cpp:409 +msgctxt "KTar|" +msgid "Could not read tar header" +msgstr "" + +#: ktar.cpp:592 ktar.cpp:607 +#, qt-format +msgctxt "KTar|" +msgid "Failed to write back temp file: %1" +msgstr "" + +#: ktar.cpp:653 +#, qt-format +msgctxt "KTar|" +msgid "Couldn't write alignment: %1" +msgstr "" + +#: ktar.cpp:755 ktar.cpp:765 +#, qt-format +msgctxt "KTar|" +msgid "Couldn't write long link: %1" +msgstr "" + +#: ktar.cpp:786 ktar.cpp:869 ktar.cpp:938 +msgctxt "KTar|" +msgid "Application error: TAR file must be open before being written into" +msgstr "" + +#: ktar.cpp:792 +msgctxt "KTar|" +msgid "Application error: attempted to write into non-writable 7-Zip file" +msgstr "" + +#: ktar.cpp:799 +#, qt-format +msgctxt "KTar|" +msgid "Application limitation: Can not add file larger than %1 bytes" +msgstr "" + +#: ktar.cpp:853 +#, qt-format +msgctxt "KTar|" +msgid "Failed to write header: %1" +msgstr "" + +#: ktar.cpp:875 ktar.cpp:944 +msgctxt "KTar|" +msgid "Application error: attempted to write into non-writable TAR file" +msgstr "" + +#: kzip.cpp:484 kzip.cpp:509 +#, qt-format +msgctxt "KZip|" +msgid "Invalid ZIP file. Unexpected end of file. (Error code: %1)" +msgstr "" + +#: kzip.cpp:535 +msgctxt "KZip|" +msgid "Invalid ZIP file. Negative name length" +msgstr "" + +#: kzip.cpp:540 +msgctxt "KZip|" +msgid "Invalid ZIP file. Name not completely read (#2)" +msgstr "" + +#: kzip.cpp:558 +msgctxt "KZip|" +msgid "Invalid ZIP File. Broken ExtraField." +msgstr "" + +#: kzip.cpp:572 kzip.cpp:595 +msgctxt "KZip|" +msgid "Could not seek to next header token" +msgstr "" + +#: kzip.cpp:587 +msgctxt "KZip|" +msgid "Invalid ZIP file. Unexpected end of file. (#5)" +msgstr "" + +#: kzip.cpp:602 +msgctxt "KZip|" +msgid "Could not seek to file compressed size" +msgstr "" + +#: kzip.cpp:618 +msgctxt "KZip|" +msgid "Invalid ZIP file. Unexpected end of file. (#1)" +msgstr "" + +#: kzip.cpp:655 +msgctxt "KZip|" +msgid "" +"Invalid ZIP file, central entry too short (not long enough for valid entry)" +msgstr "" + +#: kzip.cpp:670 +msgctxt "KZip|" +msgid "Invalid ZIP file, file path name length is zero" +msgstr "" + +#: kzip.cpp:676 +#, qt-format +msgctxt "KZip|" +msgid "" +"Invalid ZIP file, unable to read %1 + %2 bytes for filename and extra data " +"at offset %3" +msgstr "" + +#: kzip.cpp:726 +#, qt-format +msgctxt "KZip|" +msgid "" +"Invalid ZIP file, inconsistent Local Header Offset in Central Directory at %1" +msgstr "" + +#: kzip.cpp:761 +msgctxt "KZip|" +msgid "Invalid ZIP file, found empty entry name" +msgstr "" + +#: kzip.cpp:803 +#, qt-format +msgctxt "KZip|" +msgid "File %1 is in folder %2, but %3 is actually a file." +msgstr "" + +#: kzip.cpp:814 +msgctxt "KZip|" +msgid "Could not seek to next entry" +msgstr "" + +#: kzip.cpp:843 +msgctxt "KZip|" +msgid "Not a ZIP file, no Local File Header found." +msgstr "" + +#: kzip.cpp:847 +#, qt-format +msgctxt "KZip|" +msgid "Invalid ZIP file. Unrecognized header at offset %1" +msgstr "" + +#: kzip.cpp:875 +#, qt-format +msgctxt "KZip|" +msgid "Could not seek to next file header: %1" +msgstr "" + +#: kzip.cpp:901 kzip.cpp:995 +#, qt-format +msgctxt "KZip|" +msgid "Could not write file header: %1" +msgstr "" + +#: kzip.cpp:1042 +#, qt-format +msgctxt "KZip|" +msgid "Could not write central dir record: %1" +msgstr "" + +#: kzip.cpp:1078 +msgctxt "KZip|" +msgid "Application error: ZIP file must be open before being written into" +msgstr "" + +#: kzip.cpp:1084 +msgctxt "KZip|" +msgid "Application error: attempted to write into non-writable ZIP file" +msgstr "" + +#: kzip.cpp:1090 +msgctxt "KZip|" +msgid "Cannot create a device. Disk full?" +msgstr "" + +#: kzip.cpp:1096 +msgctxt "KZip|" +msgid "Cannot seek in ZIP file. Disk full?" +msgstr "" + +#: kzip.cpp:1240 +msgctxt "KZip|" +msgid "Could not write to the archive. Disk full?" +msgstr "" + +#: kzip.cpp:1259 +#, qt-format +msgctxt "KZip|" +msgid "Could not open compression device: %1" +msgstr "" + +#: kzip.cpp:1346 +msgctxt "KZip|" +msgid "No file or device" +msgstr "" + +#: kzip.cpp:1359 +#, qt-format +msgctxt "KZip|" +msgid "Error writing data: %1" +msgstr "" diff --git a/local/recipes/kde/kf6-karchive/source/poqm/pt_BR/karchive6_qt.po b/local/recipes/kde/kf6-karchive/source/poqm/pt_BR/karchive6_qt.po new file mode 100644 index 0000000000..979dc9116c --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/poqm/pt_BR/karchive6_qt.po @@ -0,0 +1,505 @@ +# SPDX-FileCopyrightText: 2025 Marcus Gama +msgid "" +msgstr "" +"Project-Id-Version: \n" +"PO-Revision-Date: 2025-08-23 09:24-0300\n" +"Last-Translator: Marcus Gama \n" +"Language-Team: Brazilian Portuguese \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Qt-Contexts: true\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Lokalize 25.08.0\n" + +#: k7zip.cpp:2541 +msgctxt "K7Zip|" +msgid "Could not get underlying device" +msgstr "Não foi possível obter o dispositivo subjacente" + +#: k7zip.cpp:2549 +msgctxt "K7Zip|" +msgid "Read header failed" +msgstr "Leitura do cabeçalho falhou" + +#: k7zip.cpp:2555 +msgctxt "K7Zip|" +msgid "Check signature failed" +msgstr "Verificação da assinatura falhou" + +#: k7zip.cpp:2578 +msgctxt "K7Zip|" +msgid "Bad CRC" +msgstr "CRC ruim" + +#: k7zip.cpp:2587 +msgctxt "K7Zip|" +msgid "Next header size is too big" +msgstr "O próximo tamanho de cabeçalho é muito grande" + +#: k7zip.cpp:2592 +msgctxt "K7Zip|" +msgid "Next header size is less than zero" +msgstr "O próximo tamanho de cabeçalho é menor que zero" + +#: k7zip.cpp:2603 +#, qt-format +msgctxt "K7Zip|" +msgid "Failed read next header size; should read %1, read %2" +msgstr "" +"Falha na leitura do próximo tamanho do cabeçalho; deveria ler %1, ler %2" + +#: k7zip.cpp:2616 +msgctxt "K7Zip|" +msgid "Bad next header CRC" +msgstr "Próximo CRC do cabeçalho ruim" + +#: k7zip.cpp:2624 +msgctxt "K7Zip|" +msgid "Error in header" +msgstr "Erro no cabeçalho" + +#: k7zip.cpp:2642 k7zip.cpp:2675 +msgctxt "K7Zip|" +msgid "Password needed for this archive" +msgstr "Senha necessária para este arquivo" + +#: k7zip.cpp:2648 +msgctxt "K7Zip|" +msgid "Wrong header type" +msgstr "Tipo de cabeçalho errado" + +#: k7zip.cpp:2658 k7zip.cpp:2664 +msgctxt "K7Zip|" +msgid "Not implemented" +msgstr "Não implementado" + +#: k7zip.cpp:2670 +msgctxt "K7Zip|" +msgid "Error while reading main streams information" +msgstr "Erro ao ler informações dos principais fluxos" + +#: k7zip.cpp:2693 +msgctxt "K7Zip|" +msgid "Error while reading header" +msgstr "Erro ao ler informações do cabeçalho" + +#: k7zip.cpp:2701 k7zip.cpp:2709 +#, qt-format +msgctxt "K7Zip|" +msgid "Archive has %1 files which is more than the supported amount (%2)" +msgstr "" +"O arquivo tem %1 arquivos, o que é mais do que a quantidade suportada (%2)" + +#: k7zip.cpp:2767 +msgctxt "K7Zip|" +msgid "Error reading modification time" +msgstr "Erro ao ler a hora de modificação" + +#: k7zip.cpp:2813 +msgctxt "K7Zip|" +msgid "Error reading MTime" +msgstr "Erro ao ler o MTime" + +#: k7zip.cpp:2820 +msgctxt "K7Zip|" +msgid "Invalid" +msgstr "Inválido" + +#: k7zip.cpp:2844 +#, qt-format +msgctxt "K7Zip|" +msgid "Read size failed (checkRecordsSize: %1, d->pos - ppp: %2, size: %3)" +msgstr "" +"Falha na leitura do tamanho (checkRecordsSize: %1, d->pos - ppp: %2, " +"tamanho: %3)" + +#: k7zip.cpp:2884 +msgctxt "K7Zip|" +msgid "contents" +msgstr "conteúdo" + +#: k7zip.cpp:3079 +msgctxt "K7Zip|" +msgid "Write error" +msgstr "Erro de gravação" + +#: k7zip.cpp:3109 +msgctxt "K7Zip|" +msgid "Failed while encoding header" +msgstr "Falha ao codificar o cabeçalho" + +#: k7zip.cpp:3153 +msgctxt "K7Zip|" +msgid "No file currently selected" +msgstr "Nenhum arquivo selecionado atualmente" + +#: k7zip.cpp:3177 k7zip.cpp:3227 k7zip.cpp:3267 +msgctxt "K7Zip|" +msgid "Application error: 7-Zip file must be open before being written into" +msgstr "" +"Erro do aplicativo: o arquivo 7-Zip deve ser aberto antes de ser gravado" + +#: k7zip.cpp:3183 k7zip.cpp:3273 +msgctxt "K7Zip|" +msgid "Application error: attempted to write into non-writable 7-Zip file" +msgstr "" +"Erro do aplicativo: tentativa de gravação em arquivo 7-Zip não gravável" + +#: kar.cpp:53 kar.cpp:60 kar.cpp:67 kar.cpp:74 +msgctxt "KAr|" +msgid "Cannot write to AR file" +msgstr "Não foi possível gravar para arquivo AR" + +#: kar.cpp:87 +#, qt-format +msgctxt "KAr|" +msgid "Unsupported mode %1" +msgstr "Modo não suportado %1" + +#: kar.cpp:98 +msgctxt "KAr|" +msgid "Invalid main magic" +msgstr "Magia principal inválida" + +#: kar.cpp:115 +msgctxt "KAr|" +msgid "Invalid magic" +msgstr "Magia inválida" + +#: kar.cpp:126 +msgctxt "KAr|" +msgid "Invalid size" +msgstr "Tamanho inválido" + +#: kar.cpp:146 +msgctxt "KAr|" +msgid "Invalid longfilename reference" +msgstr "Referência de nome de arquivo longo inválida" + +#: kar.cpp:150 +msgctxt "KAr|" +msgid "Invalid longfilename position reference" +msgstr "Referência de posição de nome de arquivo longo inválida" + +#: karchive.cpp:178 +msgctxt "KArchive|" +msgid "No filename or device was specified" +msgstr "Nenhum nome de arquivo ou dispositivo indicado" + +#: karchive.cpp:183 +#, qt-format +msgctxt "KArchive|" +msgid "Could not open device in mode %1" +msgstr "Não foi possível abrir o dispositivo no modo %1" + +#: karchive.cpp:210 +#, qt-format +msgctxt "KArchive|" +msgid "QSaveFile creation for %1 failed: %2" +msgstr "Falha na criação do QSaveFile para %1: %2" + +#: karchive.cpp:229 +#, qt-format +msgctxt "KArchive|" +msgid "Unsupported mode %1" +msgstr "Modo não suportado %1" + +#: karchive.cpp:238 +msgctxt "KArchive|" +msgid "Archive already closed" +msgstr "O arquivo já está fechado" + +#: karchive.cpp:287 +#, qt-format +msgctxt "KArchive|" +msgid "%1 doesn't exist or is not a regular file." +msgstr "%1 não existe ou não é um arquivo regular." + +#: karchive.cpp:293 +#, qt-format +msgctxt "KArchive|" +msgid "" +"Failed accessing the file %1 for adding to the archive. The error was: %2" +msgstr "" +"Falha ao acessar o arquivo %1 para adicioná-lo ao arquivo. O erro foi: %2" + +#: karchive.cpp:339 +#, qt-format +msgctxt "KArchive|" +msgid "Couldn't open file %1: %2" +msgstr "Não foi possível abrir o arquivo %1: %2" + +#: karchive.cpp:373 +#, qt-format +msgctxt "KArchive|" +msgid "Directory %1 does not exist" +msgstr "A pasta %1 não existe" + +#: karchive.cpp:447 +#, qt-format +msgctxt "KArchive|" +msgid "Writing failed: %1" +msgstr "Escrita falhou: %1" + +#: karchive_p.h:59 +msgctxt "QIODevice|" +msgid "Unknown error" +msgstr "Erro desconhecido" + +#: kcompressiondevice.cpp:514 +msgctxt "KCompressionDevice|" +msgid "Could not write. Partition full?" +msgstr "Não foi possível gravar. A partição está cheia?" + +#: krcc.cpp:83 krcc.cpp:90 krcc.cpp:97 krcc.cpp:104 +msgctxt "KRcc|" +msgid "Cannot write to RCC file" +msgstr "Não foi possível gravar para arquivo RCC" + +#: krcc.cpp:117 +#, qt-format +msgctxt "KRcc|" +msgid "Unsupported mode %1" +msgstr "Modo não suportado %1" + +#: krcc.cpp:124 +#, qt-format +msgctxt "KRcc|" +msgid "Failed to register resource %1 under prefix %2" +msgstr "Falha ao registrar o recurso %1 sob o prefixo %2" + +#: ktar.cpp:349 +#, qt-format +msgctxt "KTar|" +msgid "File %1 does not exist" +msgstr "O arquivo %1 não existe" + +#: ktar.cpp:356 +#, qt-format +msgctxt "KTar|" +msgid "Archive %1 is corrupt" +msgstr "O arquivo %1 está corrompido" + +#: ktar.cpp:360 +msgctxt "KTar|" +msgid "Disk full" +msgstr "Disco cheio" + +#: ktar.cpp:394 +msgctxt "KTar|" +msgid "Could not get underlying device" +msgstr "Não foi possível obter o dispositivo subjacente" + +#: ktar.cpp:409 +msgctxt "KTar|" +msgid "Could not read tar header" +msgstr "Não foi possível ler o cabeçalho tar" + +#: ktar.cpp:592 ktar.cpp:607 +#, qt-format +msgctxt "KTar|" +msgid "Failed to write back temp file: %1" +msgstr "Falha ao gravar novamente o arquivo temporário: %1" + +#: ktar.cpp:653 +#, qt-format +msgctxt "KTar|" +msgid "Couldn't write alignment: %1" +msgstr "Não foi possível gravar o alinhamento: %1" + +#: ktar.cpp:755 ktar.cpp:765 +#, qt-format +msgctxt "KTar|" +msgid "Couldn't write long link: %1" +msgstr "Não foi possível gravar link longo: %1" + +#: ktar.cpp:786 ktar.cpp:869 ktar.cpp:938 +msgctxt "KTar|" +msgid "Application error: TAR file must be open before being written into" +msgstr "Erro do aplicativo: o arquivo TAR deve ser aberto antes de ser gravado" + +#: ktar.cpp:792 +msgctxt "KTar|" +msgid "Application error: attempted to write into non-writable 7-Zip file" +msgstr "" +"Erro do aplicativo: tentativa de gravação em arquivo 7-Zip não gravável" + +#: ktar.cpp:799 +#, qt-format +msgctxt "KTar|" +msgid "Application limitation: Can not add file larger than %1 bytes" +msgstr "" +"Limitação do aplicativo: Não é possível adicionar arquivo maior que %1 bytes" + +#: ktar.cpp:853 +#, qt-format +msgctxt "KTar|" +msgid "Failed to write header: %1" +msgstr "Falha ao gravar no cabeçalho: %1" + +#: ktar.cpp:875 ktar.cpp:944 +msgctxt "KTar|" +msgid "Application error: attempted to write into non-writable TAR file" +msgstr "Erro do aplicativo: tentativa de gravação em arquivo TAR não gravável" + +#: kzip.cpp:484 kzip.cpp:509 +#, qt-format +msgctxt "KZip|" +msgid "Invalid ZIP file. Unexpected end of file. (Error code: %1)" +msgstr "Arquivo ZIP inválido. Fim de arquivo inesperado. (Código de erro: %1)" + +#: kzip.cpp:535 +msgctxt "KZip|" +msgid "Invalid ZIP file. Negative name length" +msgstr "Arquivo ZIP inválido. Comprimento do nome negativo." + +#: kzip.cpp:540 +msgctxt "KZip|" +msgid "Invalid ZIP file. Name not completely read (#2)" +msgstr "Arquivo ZIP inválido. Nome não totalmente legível (#2)" + +#: kzip.cpp:558 +msgctxt "KZip|" +msgid "Invalid ZIP File. Broken ExtraField." +msgstr "Arquivo ZIP inválido. Campo extra corrompido." + +#: kzip.cpp:572 kzip.cpp:595 +msgctxt "KZip|" +msgid "Could not seek to next header token" +msgstr "Não foi possível procurar o próximo token de cabeçalho" + +#: kzip.cpp:587 +msgctxt "KZip|" +msgid "Invalid ZIP file. Unexpected end of file. (#5)" +msgstr "Arquivo ZIP inválido. Fim de arquivo inesperado. (#5)" + +#: kzip.cpp:602 +msgctxt "KZip|" +msgid "Could not seek to file compressed size" +msgstr "Não foi possível tentar arquivar o tamanho compactado" + +#: kzip.cpp:618 +msgctxt "KZip|" +msgid "Invalid ZIP file. Unexpected end of file. (#1)" +msgstr "Arquivo ZIP inválido. Fim de arquivo inesperado. (#1)" + +#: kzip.cpp:655 +msgctxt "KZip|" +msgid "" +"Invalid ZIP file, central entry too short (not long enough for valid entry)" +msgstr "" +"Arquivo ZIP inválido, entrada central muito curta (não longa o suficiente " +"para uma entrada válida)" + +#: kzip.cpp:670 +msgctxt "KZip|" +msgid "Invalid ZIP file, file path name length is zero" +msgstr "Arquivo ZIP inválido, comprimento do caminho do arquivo é zero" + +#: kzip.cpp:676 +#, qt-format +msgctxt "KZip|" +msgid "" +"Invalid ZIP file, unable to read %1 + %2 bytes for filename and extra data " +"at offset %3" +msgstr "" +"Arquivo ZIP inválido, não foi possível ler %1 + %2 bytes para o nome do " +"arquivo e dados extras no deslocamento %3" + +#: kzip.cpp:726 +#, qt-format +msgctxt "KZip|" +msgid "" +"Invalid ZIP file, inconsistent Local Header Offset in Central Directory at %1" +msgstr "" +"Arquivo ZIP inválido, deslocamento de cabeçalho local inconsistente no " +"diretório central em %1" + +#: kzip.cpp:761 +msgctxt "KZip|" +msgid "Invalid ZIP file, found empty entry name" +msgstr "Arquivo ZIP inválido, nome de entrada vazio encontrado" + +#: kzip.cpp:803 +#, qt-format +msgctxt "KZip|" +msgid "File %1 is in folder %2, but %3 is actually a file." +msgstr "O arquivo %1 está na pasta %2, mas %3 é na verdade um arquivo." + +#: kzip.cpp:814 +msgctxt "KZip|" +msgid "Could not seek to next entry" +msgstr "Não foi possível prosseguir para a próxima entrada" + +#: kzip.cpp:843 +msgctxt "KZip|" +msgid "Not a ZIP file, no Local File Header found." +msgstr "Não é um arquivo ZIP, nenhum cabeçalho de arquivo local encontrado." + +#: kzip.cpp:847 +#, qt-format +msgctxt "KZip|" +msgid "Invalid ZIP file. Unrecognized header at offset %1" +msgstr "Arquivo ZIP inválido. Cabeçalho não reconhecido no deslocamento %1." + +#: kzip.cpp:875 +#, qt-format +msgctxt "KZip|" +msgid "Could not seek to next file header: %1" +msgstr "Não foi possível procurar o próximo cabeçalho de arquivo: %1" + +#: kzip.cpp:901 kzip.cpp:995 +#, qt-format +msgctxt "KZip|" +msgid "Could not write file header: %1" +msgstr "Não foi possível gravar o cabeçalho do arquivo: %1" + +#: kzip.cpp:1042 +#, qt-format +msgctxt "KZip|" +msgid "Could not write central dir record: %1" +msgstr "Não foi possível gravar o registro do diretório central: %1" + +#: kzip.cpp:1078 +msgctxt "KZip|" +msgid "Application error: ZIP file must be open before being written into" +msgstr "Erro do aplicativo: o arquivo Zip deve ser aberto antes de ser gravado" + +#: kzip.cpp:1084 +msgctxt "KZip|" +msgid "Application error: attempted to write into non-writable ZIP file" +msgstr "Erro do aplicativo: tentativa de gravação em arquivo Zip não gravável" + +#: kzip.cpp:1090 +msgctxt "KZip|" +msgid "Cannot create a device. Disk full?" +msgstr "Não foi possível criar um dispositivo. Disco cheio?" + +#: kzip.cpp:1096 +msgctxt "KZip|" +msgid "Cannot seek in ZIP file. Disk full?" +msgstr "Não foi possível buscar no arquivo ZIP. Disco cheio?" + +#: kzip.cpp:1240 +msgctxt "KZip|" +msgid "Could not write to the archive. Disk full?" +msgstr "Não foi possível gravar no arquivo. Disco cheio?" + +#: kzip.cpp:1259 +#, qt-format +msgctxt "KZip|" +msgid "Could not open compression device: %1" +msgstr "Não foi possível abrir o dispositivo de compressão: %1" + +#: kzip.cpp:1346 +msgctxt "KZip|" +msgid "No file or device" +msgstr "Nenhum arquivo ou dispositivo" + +#: kzip.cpp:1359 +#, qt-format +msgctxt "KZip|" +msgid "Error writing data: %1" +msgstr "Erro ao gravar dados: %1" diff --git a/local/recipes/kde/kf6-karchive/source/poqm/ug/karchive6_qt.po b/local/recipes/kde/kf6-karchive/source/poqm/ug/karchive6_qt.po new file mode 100644 index 0000000000..ec1dbd7ce9 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/poqm/ug/karchive6_qt.po @@ -0,0 +1,490 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: Abduqadir Abliz \n" +"Language-Team: \n" +"Language: ug\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Qt-Contexts: true\n" +"X-Generator: Poedit 3.9\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: k7zip.cpp:2541 +msgctxt "K7Zip|" +msgid "Could not get underlying device" +msgstr "ئاستى قەۋەت ئۈسكۈنىگە ئېرىشەلمىدى" + +#: k7zip.cpp:2549 +msgctxt "K7Zip|" +msgid "Read header failed" +msgstr "ھۆججەت بېشىنى ئوقۇيالمىدى" + +#: k7zip.cpp:2555 +msgctxt "K7Zip|" +msgid "Check signature failed" +msgstr "" + +#: k7zip.cpp:2578 +msgctxt "K7Zip|" +msgid "Bad CRC" +msgstr "" + +#: k7zip.cpp:2587 +msgctxt "K7Zip|" +msgid "Next header size is too big" +msgstr "" + +#: k7zip.cpp:2592 +msgctxt "K7Zip|" +msgid "Next header size is less than zero" +msgstr "" + +#: k7zip.cpp:2603 +#, qt-format +msgctxt "K7Zip|" +msgid "Failed read next header size; should read %1, read %2" +msgstr "" + +#: k7zip.cpp:2616 +msgctxt "K7Zip|" +msgid "Bad next header CRC" +msgstr "" + +#: k7zip.cpp:2624 +msgctxt "K7Zip|" +msgid "Error in header" +msgstr "" + +#: k7zip.cpp:2642 k7zip.cpp:2675 +msgctxt "K7Zip|" +msgid "Password needed for this archive" +msgstr "" + +#: k7zip.cpp:2648 +msgctxt "K7Zip|" +msgid "Wrong header type" +msgstr "" + +#: k7zip.cpp:2658 k7zip.cpp:2664 +msgctxt "K7Zip|" +msgid "Not implemented" +msgstr "ئەمەلىيلەشتۈرۈلمىگەن" + +#: k7zip.cpp:2670 +msgctxt "K7Zip|" +msgid "Error while reading main streams information" +msgstr "" + +#: k7zip.cpp:2693 +msgctxt "K7Zip|" +msgid "Error while reading header" +msgstr "" + +#: k7zip.cpp:2701 k7zip.cpp:2709 +#, qt-format +msgctxt "K7Zip|" +msgid "Archive has %1 files which is more than the supported amount (%2)" +msgstr "" + +#: k7zip.cpp:2767 +msgctxt "K7Zip|" +msgid "Error reading modification time" +msgstr "" + +#: k7zip.cpp:2813 +msgctxt "K7Zip|" +msgid "Error reading MTime" +msgstr "" + +#: k7zip.cpp:2820 +msgctxt "K7Zip|" +msgid "Invalid" +msgstr "ئىناۋەتسىز" + +#: k7zip.cpp:2844 +#, qt-format +msgctxt "K7Zip|" +msgid "Read size failed (checkRecordsSize: %1, d->pos - ppp: %2, size: %3)" +msgstr "" + +#: k7zip.cpp:2884 +msgctxt "K7Zip|" +msgid "contents" +msgstr "" + +#: k7zip.cpp:3079 +msgctxt "K7Zip|" +msgid "Write error" +msgstr "يېزىش خاتالىقى" + +#: k7zip.cpp:3109 +msgctxt "K7Zip|" +msgid "Failed while encoding header" +msgstr "" + +#: k7zip.cpp:3153 +msgctxt "K7Zip|" +msgid "No file currently selected" +msgstr "" + +#: k7zip.cpp:3177 k7zip.cpp:3227 k7zip.cpp:3267 +msgctxt "K7Zip|" +msgid "Application error: 7-Zip file must be open before being written into" +msgstr "" + +#: k7zip.cpp:3183 k7zip.cpp:3273 +msgctxt "K7Zip|" +msgid "Application error: attempted to write into non-writable 7-Zip file" +msgstr "" + +#: kar.cpp:53 kar.cpp:60 kar.cpp:67 kar.cpp:74 +msgctxt "KAr|" +msgid "Cannot write to AR file" +msgstr "" + +#: kar.cpp:87 +#, qt-format +msgctxt "KAr|" +msgid "Unsupported mode %1" +msgstr "" + +#: kar.cpp:98 +msgctxt "KAr|" +msgid "Invalid main magic" +msgstr "" + +#: kar.cpp:115 +msgctxt "KAr|" +msgid "Invalid magic" +msgstr "" + +#: kar.cpp:126 +msgctxt "KAr|" +msgid "Invalid size" +msgstr "" + +#: kar.cpp:146 +msgctxt "KAr|" +msgid "Invalid longfilename reference" +msgstr "" + +#: kar.cpp:150 +msgctxt "KAr|" +msgid "Invalid longfilename position reference" +msgstr "" + +#: karchive.cpp:178 +msgctxt "KArchive|" +msgid "No filename or device was specified" +msgstr "" + +#: karchive.cpp:183 +#, qt-format +msgctxt "KArchive|" +msgid "Could not open device in mode %1" +msgstr "" + +#: karchive.cpp:210 +#, qt-format +msgctxt "KArchive|" +msgid "QSaveFile creation for %1 failed: %2" +msgstr "" + +#: karchive.cpp:229 +#, qt-format +msgctxt "KArchive|" +msgid "Unsupported mode %1" +msgstr "" + +#: karchive.cpp:238 +msgctxt "KArchive|" +msgid "Archive already closed" +msgstr "" + +#: karchive.cpp:287 +#, qt-format +msgctxt "KArchive|" +msgid "%1 doesn't exist or is not a regular file." +msgstr "" + +#: karchive.cpp:293 +#, qt-format +msgctxt "KArchive|" +msgid "" +"Failed accessing the file %1 for adding to the archive. The error was: %2" +msgstr "" + +#: karchive.cpp:339 +#, qt-format +msgctxt "KArchive|" +msgid "Couldn't open file %1: %2" +msgstr "" + +#: karchive.cpp:373 +#, qt-format +msgctxt "KArchive|" +msgid "Directory %1 does not exist" +msgstr "" + +#: karchive.cpp:447 +#, qt-format +msgctxt "KArchive|" +msgid "Writing failed: %1" +msgstr "" + +#: karchive_p.h:59 +msgctxt "QIODevice|" +msgid "Unknown error" +msgstr "نامەلۇم خاتالىق" + +#: kcompressiondevice.cpp:514 +msgctxt "KCompressionDevice|" +msgid "Could not write. Partition full?" +msgstr "" + +#: krcc.cpp:83 krcc.cpp:90 krcc.cpp:97 krcc.cpp:104 +msgctxt "KRcc|" +msgid "Cannot write to RCC file" +msgstr "" + +#: krcc.cpp:117 +#, qt-format +msgctxt "KRcc|" +msgid "Unsupported mode %1" +msgstr "" + +#: krcc.cpp:124 +#, qt-format +msgctxt "KRcc|" +msgid "Failed to register resource %1 under prefix %2" +msgstr "" + +#: ktar.cpp:349 +#, qt-format +msgctxt "KTar|" +msgid "File %1 does not exist" +msgstr "%1 ھۆججەت مەۋجۇت ئەمەس" + +#: ktar.cpp:356 +#, qt-format +msgctxt "KTar|" +msgid "Archive %1 is corrupt" +msgstr "" + +#: ktar.cpp:360 +msgctxt "KTar|" +msgid "Disk full" +msgstr "" + +#: ktar.cpp:394 +msgctxt "KTar|" +msgid "Could not get underlying device" +msgstr "ئاستى قەۋەت ئۈسكۈنىگە ئېرىشەلمىدى" + +#: ktar.cpp:409 +msgctxt "KTar|" +msgid "Could not read tar header" +msgstr "" + +#: ktar.cpp:592 ktar.cpp:607 +#, qt-format +msgctxt "KTar|" +msgid "Failed to write back temp file: %1" +msgstr "" + +#: ktar.cpp:653 +#, qt-format +msgctxt "KTar|" +msgid "Couldn't write alignment: %1" +msgstr "" + +#: ktar.cpp:755 ktar.cpp:765 +#, qt-format +msgctxt "KTar|" +msgid "Couldn't write long link: %1" +msgstr "" + +#: ktar.cpp:786 ktar.cpp:869 ktar.cpp:938 +msgctxt "KTar|" +msgid "Application error: TAR file must be open before being written into" +msgstr "" + +#: ktar.cpp:792 +msgctxt "KTar|" +msgid "Application error: attempted to write into non-writable 7-Zip file" +msgstr "" + +#: ktar.cpp:799 +#, qt-format +msgctxt "KTar|" +msgid "Application limitation: Can not add file larger than %1 bytes" +msgstr "" + +#: ktar.cpp:853 +#, qt-format +msgctxt "KTar|" +msgid "Failed to write header: %1" +msgstr "" + +#: ktar.cpp:875 ktar.cpp:944 +msgctxt "KTar|" +msgid "Application error: attempted to write into non-writable TAR file" +msgstr "" + +#: kzip.cpp:484 kzip.cpp:509 +#, qt-format +msgctxt "KZip|" +msgid "Invalid ZIP file. Unexpected end of file. (Error code: %1)" +msgstr "" + +#: kzip.cpp:535 +msgctxt "KZip|" +msgid "Invalid ZIP file. Negative name length" +msgstr "" + +#: kzip.cpp:540 +msgctxt "KZip|" +msgid "Invalid ZIP file. Name not completely read (#2)" +msgstr "" + +#: kzip.cpp:558 +msgctxt "KZip|" +msgid "Invalid ZIP File. Broken ExtraField." +msgstr "" + +#: kzip.cpp:572 kzip.cpp:595 +msgctxt "KZip|" +msgid "Could not seek to next header token" +msgstr "" + +#: kzip.cpp:587 +msgctxt "KZip|" +msgid "Invalid ZIP file. Unexpected end of file. (#5)" +msgstr "" + +#: kzip.cpp:602 +msgctxt "KZip|" +msgid "Could not seek to file compressed size" +msgstr "" + +#: kzip.cpp:618 +msgctxt "KZip|" +msgid "Invalid ZIP file. Unexpected end of file. (#1)" +msgstr "" + +#: kzip.cpp:655 +msgctxt "KZip|" +msgid "" +"Invalid ZIP file, central entry too short (not long enough for valid entry)" +msgstr "" + +#: kzip.cpp:670 +msgctxt "KZip|" +msgid "Invalid ZIP file, file path name length is zero" +msgstr "" + +#: kzip.cpp:676 +#, qt-format +msgctxt "KZip|" +msgid "" +"Invalid ZIP file, unable to read %1 + %2 bytes for filename and extra data " +"at offset %3" +msgstr "" + +#: kzip.cpp:726 +#, qt-format +msgctxt "KZip|" +msgid "" +"Invalid ZIP file, inconsistent Local Header Offset in Central Directory at %1" +msgstr "" + +#: kzip.cpp:761 +msgctxt "KZip|" +msgid "Invalid ZIP file, found empty entry name" +msgstr "" + +#: kzip.cpp:803 +#, qt-format +msgctxt "KZip|" +msgid "File %1 is in folder %2, but %3 is actually a file." +msgstr "" + +#: kzip.cpp:814 +msgctxt "KZip|" +msgid "Could not seek to next entry" +msgstr "" + +#: kzip.cpp:843 +msgctxt "KZip|" +msgid "Not a ZIP file, no Local File Header found." +msgstr "" + +#: kzip.cpp:847 +#, qt-format +msgctxt "KZip|" +msgid "Invalid ZIP file. Unrecognized header at offset %1" +msgstr "" + +#: kzip.cpp:875 +#, qt-format +msgctxt "KZip|" +msgid "Could not seek to next file header: %1" +msgstr "" + +#: kzip.cpp:901 kzip.cpp:995 +#, qt-format +msgctxt "KZip|" +msgid "Could not write file header: %1" +msgstr "" + +#: kzip.cpp:1042 +#, qt-format +msgctxt "KZip|" +msgid "Could not write central dir record: %1" +msgstr "" + +#: kzip.cpp:1078 +msgctxt "KZip|" +msgid "Application error: ZIP file must be open before being written into" +msgstr "" + +#: kzip.cpp:1084 +msgctxt "KZip|" +msgid "Application error: attempted to write into non-writable ZIP file" +msgstr "" + +#: kzip.cpp:1090 +msgctxt "KZip|" +msgid "Cannot create a device. Disk full?" +msgstr "" + +#: kzip.cpp:1096 +msgctxt "KZip|" +msgid "Cannot seek in ZIP file. Disk full?" +msgstr "" + +#: kzip.cpp:1240 +msgctxt "KZip|" +msgid "Could not write to the archive. Disk full?" +msgstr "" + +#: kzip.cpp:1259 +#, qt-format +msgctxt "KZip|" +msgid "Could not open compression device: %1" +msgstr "" + +#: kzip.cpp:1346 +msgctxt "KZip|" +msgid "No file or device" +msgstr "" + +#: kzip.cpp:1359 +#, qt-format +msgctxt "KZip|" +msgid "Error writing data: %1" +msgstr "" diff --git a/local/recipes/kde/kf6-karchive/source/src/karchive-index.qdoc b/local/recipes/kde/kf6-karchive/source/src/karchive-index.qdoc new file mode 100644 index 0000000000..aba1eed06a --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/src/karchive-index.qdoc @@ -0,0 +1,20 @@ +/*! + \page karchive-index.html + \title KArchive + + Reading, creating, and manipulating file archives. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {Archive} {KF6::Archive} + + \section1 API Reference + + \list + \li \l{KArchive C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-karchive/source/src/karchive.qdoc b/local/recipes/kde/kf6-karchive/source/src/karchive.qdoc new file mode 100644 index 0000000000..3090326c67 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/src/karchive.qdoc @@ -0,0 +1,9 @@ +/*! + \module KArchive + \title KArchive C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Archive + + \brief Reading, creating, and manipulating file archives. +*/ diff --git a/local/recipes/kde/kf6-karchive/source/src/karchive.qdocconf b/local/recipes/kde/kf6-karchive/source/src/karchive.qdocconf new file mode 100644 index 0000000000..b6964dbab1 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/src/karchive.qdocconf @@ -0,0 +1,34 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KArchive +description = Reading, creating, and manipulating file archives + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +navigation.landingpage = "KArchive" + +depends += \ + kde \ + qtcore \ + qtgui + +qhp.projects = KArchive + +qhp.KArchive.file = karchive.qhp +qhp.KArchive.namespace = org.kde.karchive.$QT_VERSION_TAG +qhp.KArchive.virtualFolder = karchive +qhp.KArchive.indexTitle = KArchive +qhp.KArchive.indexRoot = + +qhp.KArchive.subprojects = classes +qhp.KArchive.subprojects.classes.title = C++ Classes +qhp.KArchive.subprojects.classes.indexTitle = KArchive C++ Classes +qhp.KArchive.subprojects.classes.selectors = class fake:headerfile +qhp.KArchive.subprojects.classes.sortPages = true + +tagfile = karchive.tags diff --git a/local/recipes/kde/kf6-karchive/source/src/klzfilter.cpp b/local/recipes/kde/kf6-karchive/source/src/klzfilter.cpp new file mode 100644 index 0000000000..eb8e7f1274 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/src/klzfilter.cpp @@ -0,0 +1,392 @@ +/* This file is part of the KDE libraries + SPDX-FileCopyrightText: 2025 Azhar Momin + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "klzfilter.h" +#include "loggingcategory.h" + +#include +#include +#include + +#if HAVE_XZ_SUPPORT + +extern "C" { +#include +} + +#if LZMA_VERSION_MAJOR > 5 || (LZMA_VERSION_MAJOR == 5 && LZMA_VERSION_MINOR >= 4) +#define LZMA_LZIP_DECODER_AVAILABLE 1 +#endif + +#ifndef LZMA_LZIP_DECODER_AVAILABLE +static const uint32_t minDictSize = 1 << 12; // 4 KiB +static const uint32_t maxDictSize = 1 << 29; // 512 MiB +#endif + +// Default dictionary size (8 MiB) +static const uint8_t defaultEncodedDictSize = 23; +static const uint32_t defaultDecodedDictSize = 1 << 23; + +class Q_DECL_HIDDEN KLzFilter::Private +{ +public: + Private() + : zStream(LZMA_STREAM_INIT) + , mode(0) + , isInitialized(false) + { + } + + lzma_stream zStream; + + uint32_t decodedDictSize; + uint32_t crc32; + + int mode; + bool isInitialized; +}; + +KLzFilter::KLzFilter() + : d(new Private) +{ +} + +KLzFilter::~KLzFilter() +{ +} + +bool KLzFilter::init(int mode) +{ + if (d->isInitialized) { + terminate(); + } + + d->zStream.next_in = nullptr; + d->zStream.avail_in = 0; + + d->crc32 = 0; + d->decodedDictSize = defaultDecodedDictSize; + + lzma_ret result; + + if (mode == QIODevice::ReadOnly) { +#ifdef LZMA_LZIP_DECODER_AVAILABLE + result = lzma_lzip_decoder(&d->zStream, 100 << 20, 0); + if (result != LZMA_OK) { + qCWarning(KArchiveLog) << "lzma_lzip_decoder returned" << result; + return false; + } + d->isInitialized = true; +#else + // We cannot initialize lzma_raw_decoder here because we + // need to read the header first to extract the dictionary size. +#endif + } else if (mode == QIODevice::WriteOnly) { + lzma_options_lzma lzma_opt; + lzma_lzma_preset(&lzma_opt, LZMA_PRESET_DEFAULT); + lzma_opt.dict_size = defaultDecodedDictSize; + + lzma_filter filters[2]; + filters[0].id = LZMA_FILTER_LZMA1; + filters[0].options = &lzma_opt; + filters[1].id = LZMA_VLI_UNKNOWN; + filters[1].options = nullptr; + + result = lzma_raw_encoder(&d->zStream, filters); + if (result != LZMA_OK) { + qCWarning(KArchiveLog) << "lzma_raw_encoder returned" << result; + return false; + } + d->isInitialized = true; + } else { + return false; + } + d->mode = mode; + return true; +} + +int KLzFilter::mode() const +{ + return d->mode; +} + +bool KLzFilter::terminate() +{ + if (d->mode != QIODevice::ReadOnly && d->mode != QIODevice::WriteOnly) { + return false; + } + + if (d->isInitialized) { + lzma_end(&d->zStream); + } + + d->isInitialized = false; + return true; +} + +void KLzFilter::reset() +{ + terminate(); + init(d->mode); +} + +void KLzFilter::setOutBuffer(char *data, uint maxlen) +{ + d->zStream.avail_out = maxlen; + d->zStream.next_out = (uint8_t *)data; +} + +void KLzFilter::setInBuffer(const char *data, unsigned int size) +{ + d->zStream.avail_in = size; + d->zStream.next_in = (uint8_t *)const_cast(data); +} + +int KLzFilter::inBufferAvailable() const +{ + return d->zStream.avail_in; +} + +int KLzFilter::outBufferAvailable() const +{ + return d->zStream.avail_out; +} + +#ifndef LZMA_LZIP_DECODER_AVAILABLE +static uint32_t parseUi32(const uint8_t *buffer) +{ + uint32_t value = 0; + for (int i = 0; i < 4; ++i) { + value |= (uint32_t)buffer[i] << (i * 8); + } + return value; +} + +static uint64_t parseUi64(const uint8_t *buffer) +{ + return (parseUi32(buffer) | (uint64_t)parseUi32(buffer + 4) << 32); +} +#endif + +static void putUi32(uint8_t *buffer, uint32_t value) +{ + for (int i = 0; i < 4; ++i) { + buffer[i] = value; + value >>= 8; + } +} + +static void putUi64(uint8_t *buffer, uint64_t value) +{ + for (int i = 0; i < 8; ++i) { + buffer[i] = value; + value >>= 8; + } +} + +bool KLzFilter::readHeader() +{ + if (d->mode != QIODevice::ReadOnly) { + return false; + } + +#ifndef LZMA_LZIP_DECODER_AVAILABLE + if (d->zStream.avail_in < 6) { + qCWarning(KArchiveLog) << "Not enough data to read LZIP header"; + return false; + } + + const uint8_t *header = d->zStream.next_in; + + // check the lzip magic + version (should be 1) + if (memcmp(header, "LZIP\x01", 5) != 0) { + qCWarning(KArchiveLog) << "Invalid LZIP header or unsupported version"; + return false; + } + + uint32_t dictSize = 1 << (header[5] & 0x1F); + if (dictSize > minDictSize) { + dictSize -= (dictSize / 16) * ((header[5] >> 5) & 7); + } + + if (dictSize < minDictSize || dictSize > maxDictSize) { + qCWarning(KArchiveLog) << "Invalid LZIP dictSize:" << dictSize; + return false; + } + + d->decodedDictSize = dictSize; + + d->zStream.next_in += 6; + d->zStream.avail_in -= 6; +#endif + + return true; +} + +bool KLzFilter::readTrailer() +{ + if (d->mode != QIODevice::ReadOnly) { + return false; + } + +#ifndef LZMA_LZIP_DECODER_AVAILABLE + if (d->zStream.avail_in < 20) { + qCWarning(KArchiveLog) << "Not enough data to read LZIP header"; + return false; + } + + uint64_t actualDataSize = d->zStream.total_out; // total uncompressed data + uint64_t actualMemberSize = d->zStream.total_in + 26; // header (6) + data + trailer (20) + + const uint8_t *trailer = d->zStream.next_in; + + const uint32_t crc32 = parseUi32(trailer); + if (crc32 != d->crc32) { + qCWarning(KArchiveLog) << "Invalid LZIP CRC32:" << crc32; + return false; + } + + const uint64_t dataSize = parseUi64(trailer + 4); + if (dataSize != actualDataSize) { + qCWarning(KArchiveLog) << "Invalid LZIP dataSize:" << dataSize; + return false; + } + + const uint64_t memberSize = parseUi64(trailer + 12); + if (memberSize != actualMemberSize) { + qCWarning(KArchiveLog) << "Invalid LZIP memberSize:" << memberSize; + return false; + } + + d->zStream.next_in += 20; + d->zStream.avail_in -= 20; +#endif + + return true; +} + +bool KLzFilter::writeHeader(const QByteArray &) +{ + if (d->mode != QIODevice::WriteOnly) { + return false; + } + + if (d->zStream.avail_out < 6) { + qCWarning(KArchiveLog) << "Not enough space to write LZIP header"; + return false; + } + + d->zStream.next_out[0] = 'L'; + d->zStream.next_out[1] = 'Z'; + d->zStream.next_out[2] = 'I'; + d->zStream.next_out[3] = 'P'; + d->zStream.next_out[4] = 1; // version = 1 + d->zStream.next_out[5] = defaultEncodedDictSize; + + d->zStream.next_out += 6; + d->zStream.avail_out -= 6; + + return true; +} + +bool KLzFilter::writeTrailer() +{ + if (d->mode != QIODevice::WriteOnly) { + return false; + } + + if (d->zStream.avail_out < 20) { + qCWarning(KArchiveLog) << "Not enough space to write LZIP trailer"; + return false; + } + + uint64_t dataSize = d->zStream.total_in; // total uncompressed data + uint64_t memberSize = d->zStream.total_out + 26; // header (6) + data + trailer (20) + + putUi32(d->zStream.next_out, d->crc32); + putUi64(d->zStream.next_out + 4, dataSize); + putUi64(d->zStream.next_out + 12, memberSize); + + d->zStream.next_out += 20; + d->zStream.avail_out -= 20; + + return true; +} + +KLzFilter::Result KLzFilter::uncompress() +{ +#ifdef LZMA_LZIP_DECODER_AVAILABLE + lzma_ret result = lzma_code(&d->zStream, LZMA_RUN); +#else + lzma_ret result; + if (!d->isInitialized) { + lzma_options_lzma lzma_opt; + lzma_lzma_preset(&lzma_opt, LZMA_PRESET_DEFAULT); + lzma_opt.dict_size = d->decodedDictSize; + + lzma_filter filters[2]; + filters[0].id = LZMA_FILTER_LZMA1; + filters[0].options = &lzma_opt; + filters[1].id = LZMA_VLI_UNKNOWN; + filters[1].options = nullptr; + + result = lzma_raw_decoder(&d->zStream, filters); + if (result != LZMA_OK) { + qCWarning(KArchiveLog) << "lzma_raw_decoder returned" << result; + return KFilterBase::Error; + } + + d->isInitialized = true; + } + + size_t prevAvailOut = d->zStream.avail_out; + result = lzma_code(&d->zStream, LZMA_RUN); + size_t written = prevAvailOut - d->zStream.avail_out; + + if (written > 0) { + d->crc32 = lzma_crc32(d->zStream.next_out - written, written, d->crc32); + } +#endif + + switch (result) { + case LZMA_OK: + return KFilterBase::Ok; + case LZMA_STREAM_END: + if (!readTrailer()) { + return KFilterBase::Error; + } + return KFilterBase::End; + default: + qCWarning(KArchiveLog) << "lzma_code returned" << result; + return KFilterBase::Error; + } +} + +KLzFilter::Result KLzFilter::compress(bool finish) +{ + size_t prevAvailIn = d->zStream.avail_in; + lzma_ret result = lzma_code(&d->zStream, finish ? LZMA_FINISH : LZMA_RUN); + size_t read = prevAvailIn - d->zStream.avail_in; + + if (read > 0) { + d->crc32 = lzma_crc32(d->zStream.next_in - read, read, d->crc32); + } + + switch (result) { + case LZMA_OK: + return KFilterBase::Ok; + case LZMA_STREAM_END: + if (finish && !writeTrailer()) { + return KFilterBase::Error; + } + return KFilterBase::End; + default: + qCDebug(KArchiveLog) << " lzma_code returned " << result; + return KFilterBase::Error; + } +} + +#endif diff --git a/local/recipes/kde/kf6-karchive/source/src/klzfilter.h b/local/recipes/kde/kf6-karchive/source/src/klzfilter.h new file mode 100644 index 0000000000..a9a09777b9 --- /dev/null +++ b/local/recipes/kde/kf6-karchive/source/src/klzfilter.h @@ -0,0 +1,48 @@ +/* This file is part of the KDE libraries + SPDX-FileCopyrightText: 2025 Azhar Momin + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef KLZFILTER_H +#define KLZFILTER_H + +#include + +#if HAVE_XZ_SUPPORT + +#include "kfilterbase.h" + +/** + * Internal class used by KCompressionDevice + * @internal + */ +class KLzFilter : public KFilterBase +{ +public: + KLzFilter(); + ~KLzFilter() override; + + bool init(int mode) override; + int mode() const override; + bool terminate() override; + void reset() override; + bool readHeader() override; + bool readTrailer(); + bool writeHeader(const QByteArray &) override; + bool writeTrailer(); + void setOutBuffer(char *data, uint maxlen) override; + void setInBuffer(const char *data, uint size) override; + int inBufferAvailable() const override; + int outBufferAvailable() const override; + Result uncompress() override; + Result compress(bool finish) override; + +private: + class Private; + const std::unique_ptr d; +}; + +#endif // HAVE_XZ_SUPPORT + +#endif // KLZFILTER_H diff --git a/local/recipes/kde/kf6-kauth/source/src/kauth-index.qdoc b/local/recipes/kde/kf6-kauth/source/src/kauth-index.qdoc new file mode 100644 index 0000000000..adf66fce40 --- /dev/null +++ b/local/recipes/kde/kf6-kauth/source/src/kauth-index.qdoc @@ -0,0 +1,323 @@ +/*! + \page kauth-index.html + \title KAuth + + Execute actions as privileged user. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {Auth} {KF6::AuthCore} + + \section1 Introduction + + The KDE Authorization API allows developers to write desktop applications that + run high-privileged tasks in an easy, secure and cross-platform way. + Previously, if an application had to do administrative tasks, it had to be run + as root, using mechanisms such as sudo or graphical equivalents, or by setting + the executable's setuid bit. This approach has some drawbacks. For example, the + whole application code, including GUI handling and network communication, had + to be done as root. More code that runs as root means more possible security + holes. + + The solution is the caller/helper pattern. With this pattern, the privileged + code is isolated in a small helper tool that runs as root. This tool includes + only the few lines of code that actually need to be run with privileges, not + the whole application logic. All the other parts of the application are run as + a normal user, and the helper tool is called when needed, using a secure + mechanism that ensures that the user is authorized to do so. This pattern is + not very easy to implement, because the developer has to deal with a lot of + details about how to authorize the user, how to call the helper with the right + privileges, how to exchange data with the helper, etc.. This is where the new + KDE Authorization API becomes useful. Thanks to this new library, every + developer can implement the caller/helper pattern to write application that + require high privileges, with a few lines of code in an easy, secure and + cross-platform way. + + Not only: the library can also be used to lock down some actions in your + application without using a helper but just checking for authorization and + verifying if the user is allowed to perform it. + + The KDE Authorization library uses different backends depending on the system + where it's built. As far as the user authorization is concerned, it currently + uses polkit-1 on linux and Authorization Services on Mac OSX, and a Windows + backend will eventually be written, too. At the communication layer, the + library uses D-Bus on every supported platform. + + + \section2 Concepts + + There are a few concepts to understand when using the library. Much of those + are carried from underlying APIs such as polkit-1, so if you know something + about them there shouldn't be problems. + + An \e action is a single task that needs to be done by the application. You + refer to an action using an action identifier, which is a string in reverse + domain name syntax (to avoid duplicates). For example, if the date/time control + center module needs to change the date, it would need an action like + "org.kde.datatime.change". If your application has to perform more than one + privileged task, you should configure more than one action. This allows system + administrators to fine tune the policies that allow users to perform your + actions. + + The \e authorization is the process that is executed to decide if a user + can perform an action or not. In order to execute the helper as root, the user + has to be authorized. For example, on linux, che policykit backend will look at + the policykit policy database to see what requirements the user has to meet in + order to execute the action you requested. The policy set for that action could + allow or deny that user, or could say the user has to authenticate in order to + gain the authorization. + + The \e authentication is the process that allows the system to know that + the person is in front of the console is who he says to be. If an action can be + allowed or not depending on the user's identity, it has to be proved by + entering a password or any other identification data the system requires. + + A typical session with the authorization API is like this: + \list + \li The user want to perform some privileged task + \li The application asks the system if the user is authorized. + \li The system asks the user to authenticate, if needed, and reply the application. + \li The application uses some system-provided mechanism to execute the helper's + code as the root user. Previously, you had to set the setuid bit to do this, + but we have something cool called + "D-Bus activation" that doesn't require the setuid bit and is much more flexible. + \li The helper code, immediately after starting, checks if the caller is + authorized to do what it asks. If not the helper immediately exits! + \li If the caller is authorized, the helper executes the task and exits. + \li The application receives data back from the helper. + \endlist + + All these steps are managed by the library. Following sections will focus on + how to write the helper to implement your actions and how to call the helper + from the application. + + \section2 Writing the helper tool + + The first thing you need to do before writing anything is to decide what + actions you need to implement. Every action needs to be identified by a string + in the reverse domain name syntax. This helps to avoid duplicates. An example + of action id is "org.kde.datetime.change" or "org.kde.ksysguard.killprocess". + Action names can only contain lowercase letters and dots (not as the first or + last char). You also need an identifier for your helper. An application using + the KDE auth api can implement and use more than one helper, implementing + different actions. An helper is uniquely identified in the system context with + a string. It, again, is in reverse domain name syntax to avoid duplicates. A + common approach is to call the helper like the common prefix of your action + names. For example, the Date/Time kcm module could use a helper called + "org.kde.datetime", to perform actions like "org.kde.datetime.changedate" and + "org.kde.datetime.changetime". This naming convention simplifies the + implementation of the helper. + + From the code point of view, the helper is implemented as a QObject subclass. + Every action is implemented by a public slot. In the example/ directory in the + source code tree you find a complete example. Let's look at that. The + helper.h file declares the class that implements the helper. It looks like: + + \snippet helper.cpp helper_declaration + + The slot names are the last part of the action name, without the helper's ID if + it's a prefix, with all the dots replaced by underscores. In this case, the + helper ID is "org.kde.kf6auth.example", so those three slots implement the + actions "org.kde.kf6auth.example.read", "org.kde.kf6auth.example.write" and + "org.kde.kf6auth.example.longaction". The helper ID doesn't have to appear at + the beginning of the action name, but it's good practice. If you want to extend + MyHelper to implement also a different action like + "org.kde.datetime.changetime", since the helper ID doesn't match you'll have to + implement a slot called org_kde_datetime_changetime(). + + The slot's signature is fixed: the return type is ActionReply, a class that + allows you to return results, error codes and custom data to the application + when your action has finished to run. + + Let's look at the read action implementation. Its purpose is to read files: + + \snippet helper.cpp helper_read_action + + First, the code creates a default reply object. The default constructor creates + a reply that reports success. Then it gets the filename parameter from the + argument QVariantMap, that has previously been set by the application, before + calling the helper. If it fails to open the file, it creates an ActionReply + object that notifies that some error has happened in the helper, then set the + error code to that returned by QFile and returns. If there is no error, it + reads the file. The contents are added to the reply. + + Because this class will be compiled into a standalone executable, we need a + main() function and some code to initialize everything: you don't have to write + it. Instead, you use the KAUTH_HELPER_MAIN() macro that will take care of + everything. It's used like this: + + \snippet helper.cpp helper_main + + The first parameter is the string containing the helper identifier. Please note + that you need to use this same string in the application's code to tell the + library which helper to call, so please stay away from typos, because we don't + have any way to detect them. The second parameter is the name of the helper's + class. Your helper, if complex, can be composed of a lot of source files, but + the important thing is to include this macro in at least one of them. + + To build the helper, KDE macros provide a function named + kauth_install_helper_files(). Use it in your cmake file like this: + + \badcode + add_executable( your sources...) + target_link_libraries( your libraries...) + install(TARGETS DESTINATION ${KAUTH_HELPER_INSTALL_DIR}) + + kauth_install_helper_files( ) + \endcode + + As locale is not inherited, the auth helper will have the text codec explicitly set + to use UTF-8. + + The first argument is the cmake target name for the helper executable, which + you have to build and install separately. Make sure to INSTALL THE HELPER IN + \c ${KAUTH_HELPER_INSTALL_DIR}, otherwise \c kauth_install_helper_files will not work. The + second argument is the helper id. Please be sure to don't misspell it, and to + not quote it. The user parameter is the user that the helper has to be run as. + It usually is root, but some actions could require less strict permissions, so + you should use the right user where possible (for example the user apache if + you have to mess with apache settings). Note that the target created by this + macro already links to libkauth and QtCore. + + \section2 Action registration + + To be able to authorize the actions, they have to be added to the policy + database. To do this in a cross-platform way, we provide a cmake macro. It + looks like: + \code + kauth_install_actions( ) + \endcode + + The action definition file describes which actions are implemented by your code + and which default security options they should have. It is a common text file + in ini format, with one section for each action and some parameters. The + definition for the read action is: + + \badcode + [org.kde.kf6auth.example.read] + Name=Read action + Description=Read action description + Policy=auth_admin + Persistence=session + \endcode + + The name parameter is a text describing the action for \e{who reads the + file}. The description parameter is the message shown to the user in the + authentication dialog. It should be a finite phrase. The policy attribute + specify the default rule that the user must satisfy to be authorized. Possible + values are: + \list + \li yes: the action should be always allowed + \li no: the action should be always denied + \li auth_self: the user should authenticate as itself + \li auth_admin: the user should authenticate as an administrator user + \endlist + + The persistence attribute is optional. It says how long an authorization should + be retained for that action. The values could be: + \list + \li session: the authorization persists until the user logs-out + \li always: the authorization will persist indefinitely + \endlist + + If this attribute is missing, the authorization will be queried every time. + + \note Only the PolicyKit and polkit-1 backends use this attribute. + \warning With the polkit-1 backend, 'session' and 'always' have the same meaning. + They just make the authorization persists for a few minutes. + + \section2 Calling the helper from the application + + Once the helper is ready, we need to call it from the main application. + In examples/client.cpp you can see how this is done. To create a reference to + an action, an object of type Action has to be created. Every Action object + refers to an action by its action id. Two objects with the same action id will + act on the same action. With an Action object, you can authorize and execute + the action. To execute an action you need to retrieve an ExecuteJob, which is + a standard KJob that you can run synchronously or asynchronously. + See the KJob documentation (from KCoreAddons) for more details. + + The piece of code that calls the action of the previous example is: + + \snippet client.cpp client_how_to_call_helper + + First of all, it creates the action object specifying the action id. Then it + loads the filename (we want to read a forbidden file) into the arguments() + QVariantMap, which will be directly passed to the helper in the read() slot's + parameter. This example code uses a synchronous call to execute the action and + retrieve the reply. If the reply succeeded, the reply data is retrieved from + the returned QVariantMap object. Please note that you have + to explicitly set the helper ID to the action: this is done for added safety, + to prevent the caller from accidentally invoking a helper, and also because + KAuth actions may be used without a helper attached (the default). + + Please note that if your application is calling the helper multiple times it + must do so from the same thread. + + \section2 Asynchronous calls, data reporting, and action termination + + For a more advanced example, we look at the action + "org.kde.kf6auth.example.longaction" in the example helper. This is an action + that takes a long time to execute, so we need some features: + \list + \li The helper needs to regularly send data to the application, to inform about + the execution status. + \li The application needs to be able to stop the action execution if the user + stops it or close the application. + \endlist + The example code follows: + + \snippet helper.cpp helper_longaction + + In this example, the action is only waiting a "long" time using a loop, but we + can see some interesting line. The progress status is sent to the application + using the HelperSupport::progressStep(int) and + HelperSupport::progressStep(const QVariantMap &) methods. + When those methods are called, the HelperProxy associated with this action + will emit the HelperProxy::progressStep(const QString &, int) and + HelperProxy::progressStepData(const QString &, const QVariantMap &) signals, + respectively, reporting back the data to the application. + The method that takes an integer argument is the one used here. + Its meaning is application dependent, so you can use it as a sort of + percentage. If you want to report custom data back to the application, you + can use the other method that takes a QVariantMap object which is directly + passed to the app. + + In this example code, the loop exits when the HelperSupport::isStopped() + returns true. This happens when the application calls the HelperProxy::stopAction() + method on the corresponding action object. + The stopAction() method, this way, asks the helper to + stop the action execution. It's up to the helper to obbey to this request, and + if it does so, it should return from the slot, _not_ exit. + + \section2 Other features + + It doesn't happen very frequently that you code something that doesn't require + some debugging, and you'll need some tool, even a basic one, to debug your + helper code as well. For this reason, the KDE Authorization library provides a + message handler for the Qt debugging system. This means that every call to + qDebug() & co. will be reported to the application, and printed using the same + qt debugging system, with the same debug level. If, in the helper code, you + write something like: + \code + qDebug() << "I'm in the helper"; + \endcode + You'll see something like this in the \e application's output: + + \badcode + Debug message from the helper: I'm in the helper + \endcode + + Remember that the debug level is preserved, so if you use qFatal() you won't + only abort the helper (which isn't suggested anyway), but also the application. + + \section1 API Reference + + \list + \li \l{KAuth C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kauth/source/src/kauth.qdoc b/local/recipes/kde/kf6-kauth/source/src/kauth.qdoc new file mode 100644 index 0000000000..1e0f0d7e49 --- /dev/null +++ b/local/recipes/kde/kf6-kauth/source/src/kauth.qdoc @@ -0,0 +1,10 @@ +/*! + \module KAuth + \title KAuth C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Auth + \cmaketargetitem KF6::AuthCore + + \brief Execute actions as privileged user. +*/ diff --git a/local/recipes/kde/kf6-kauth/source/src/kauth.qdocconf b/local/recipes/kde/kf6-kauth/source/src/kauth.qdocconf new file mode 100644 index 0000000000..8c338fccea --- /dev/null +++ b/local/recipes/kde/kf6-kauth/source/src/kauth.qdocconf @@ -0,0 +1,39 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KAuth +description = Execute actions as privileged user + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +excludedirs += backends policy-gen + +exampledirs += ../examples + +outputformats = HTML + +navigation.landingpage = "KAuth" + +depends += \ + kde \ + qtcore \ + qtgui \ + kcoreaddons + +qhp.projects = KAuth + +qhp.KAuth.file = kauth.qhp +qhp.KAuth.namespace = org.kde.kauth.$QT_VERSION_TAG +qhp.KAuth.virtualFolder = kauth +qhp.KAuth.indexTitle = KAuth +qhp.KAuth.indexRoot = + +qhp.KAuth.subprojects = classes +qhp.KAuth.subprojects.classes.title = C++ Classes +qhp.KAuth.subprojects.classes.indexTitle = KAuth C++ Classes +qhp.KAuth.subprojects.classes.selectors = class fake:headerfile +qhp.KAuth.subprojects.classes.sortPages = true + +tagfile = kauth.tags diff --git a/local/recipes/kde/kf6-kbookmarks/source/src/kbookmarkaction_p.h b/local/recipes/kde/kf6-kbookmarks/source/src/kbookmarkaction_p.h new file mode 100644 index 0000000000..73182ce8f5 --- /dev/null +++ b/local/recipes/kde/kf6-kbookmarks/source/src/kbookmarkaction_p.h @@ -0,0 +1,24 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2025 Albert Astals Cid + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef KBOOKMARKACTIONPRIVATE_H +#define KBOOKMARKACTIONPRIVATE_H + +class KBookmarkActionPrivate +{ +public: + KBookmarkActionPrivate(KBookmarkAction *a, KBookmarkOwner *const o) : q(a), owner(o) {} + + static KBookmarkActionPrivate *get(KBookmarkAction *a) { return a->d; } + + + Qt::MouseButtons buttons = Qt::NoButton; + KBookmarkAction *const q; + KBookmarkOwner *const owner; +}; + +#endif diff --git a/local/recipes/kde/kf6-kbookmarks/source/src/kbookmarks-index.qdoc b/local/recipes/kde/kf6-kbookmarks/source/src/kbookmarks-index.qdoc new file mode 100644 index 0000000000..2a64a5a91a --- /dev/null +++ b/local/recipes/kde/kf6-kbookmarks/source/src/kbookmarks-index.qdoc @@ -0,0 +1,21 @@ +/*! + \page kbookmarks-index.html + \title KBookmarks + + Bookmarks management library + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {Bookmarks} {KF6::Bookmarks} + + \section1 API Reference + + \list + \li \l{KBookmarks C++ Classes} + \li \l{KBookmarksWidgets C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kbookmarks/source/src/kbookmarks.qdoc b/local/recipes/kde/kf6-kbookmarks/source/src/kbookmarks.qdoc new file mode 100644 index 0000000000..9a4a5a8a89 --- /dev/null +++ b/local/recipes/kde/kf6-kbookmarks/source/src/kbookmarks.qdoc @@ -0,0 +1,9 @@ +/*! + \module KBookmarks + \title KBookmarks C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Bookmarks + + \brief Bookmarks management library. +*/ diff --git a/local/recipes/kde/kf6-kbookmarks/source/src/kbookmarks.qdocconf b/local/recipes/kde/kf6-kbookmarks/source/src/kbookmarks.qdocconf new file mode 100644 index 0000000000..9584672462 --- /dev/null +++ b/local/recipes/kde/kf6-kbookmarks/source/src/kbookmarks.qdocconf @@ -0,0 +1,36 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KBookmarks +description = Bookmarks management library + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +excludedirs += widgets + +outputformats = HTML + +navigation.landingpage = "KBookmarks" + +depends += \ + kde \ + qtcore \ + kbookmarkswidgets + +qhp.projects = KBookmarks + +qhp.KBookmarks.file = kbookmarks.qhp +qhp.KBookmarks.namespace = org.kde.kbookmarks.$QT_VERSION_TAG +qhp.KBookmarks.virtualFolder = kbookmarks +qhp.KBookmarks.indexTitle = KBookmarks +qhp.KBookmarks.indexRoot = + +qhp.KBookmarks.subprojects = classes +qhp.KBookmarks.subprojects.classes.title = C++ Classes +qhp.KBookmarks.subprojects.classes.indexTitle = KBookmarks C++ Classes +qhp.KBookmarks.subprojects.classes.selectors = class fake:headerfile +qhp.KBookmarks.subprojects.classes.sortPages = true + +tagfile = kbookmarks.tags diff --git a/local/recipes/kde/kf6-kbookmarks/source/src/widgets/kbookmarkswidgets.qdoc b/local/recipes/kde/kf6-kbookmarks/source/src/widgets/kbookmarkswidgets.qdoc new file mode 100644 index 0000000000..5766635cdd --- /dev/null +++ b/local/recipes/kde/kf6-kbookmarks/source/src/widgets/kbookmarkswidgets.qdoc @@ -0,0 +1,11 @@ +/*! + \module KBookmarksWidgets + \title KBookmarksWidgets C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Bookmarks + \cmaketargetitem KF6::BookmarksWidgets + + \brief Widgets for Bookmark Handling. + +*/ diff --git a/local/recipes/kde/kf6-kbookmarks/source/src/widgets/kbookmarkswidgets.qdocconf b/local/recipes/kde/kf6-kbookmarks/source/src/widgets/kbookmarkswidgets.qdocconf new file mode 100644 index 0000000000..43de089faa --- /dev/null +++ b/local/recipes/kde/kf6-kbookmarks/source/src/widgets/kbookmarkswidgets.qdocconf @@ -0,0 +1,35 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KBookmarksWidgets +description = Widgets for Bookmark Handling + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +navigation.landingpage = "KBookmarks" + +depends += \ + kde \ + qtcore \ + kbookmarks \ + kwidgetsaddons + +qhp.projects = KBookmarksWidgets + +qhp.KBookmarksWidgets.file = kbookmarkswidgets.qhp +qhp.KBookmarksWidgets.namespace = org.kde.kbookmarkswidgets.$QT_VERSION_TAG +qhp.KBookmarksWidgets.virtualFolder = kbookmarkswidgets +qhp.KBookmarksWidgets.indexTitle = KBookmarksWidgets +qhp.KBookmarksWidgets.indexRoot = + +qhp.KBookmarksWidgets.subprojects = classes +qhp.KBookmarksWidgets.subprojects.classes.title = C++ Classes +qhp.KBookmarksWidgets.subprojects.classes.indexTitle = KBookmarksWidgets C++ Classes +qhp.KBookmarksWidgets.subprojects.classes.selectors = class fake:headerfile +qhp.KBookmarksWidgets.subprojects.classes.sortPages = true + +tagfile = kbookmarkswidgets.tags diff --git a/local/recipes/kde/kf6-kcodecs/source/LICENSES/Apache-2.0.txt b/local/recipes/kde/kf6-kcodecs/source/LICENSES/Apache-2.0.txt new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/local/recipes/kde/kf6-kcodecs/source/LICENSES/Apache-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/local/recipes/kde/kf6-kcodecs/source/autotests/kencodingproberunittest.cpp b/local/recipes/kde/kf6-kcodecs/source/autotests/kencodingproberunittest.cpp new file mode 100644 index 0000000000..22e0211550 --- /dev/null +++ b/local/recipes/kde/kf6-kcodecs/source/autotests/kencodingproberunittest.cpp @@ -0,0 +1,424 @@ +/* + SPDX-FileCopyrightText: 2025 Stefan Brüns + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include + +#include "../src/probers/nsEscSM.h" +#include "../src/probers/nsMBCSSM.h" + +#include "../src/probers/nsCodingStateMachine.h" +#include "../src/probers/nsHebrewProber.h" +#include "../src/probers/nsLatin1Prober.h" + +class KEncodingProberUnitTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void testUtf8(); + void testUtf8_data(); + void testUtf16BE(); + void testUtf16BE_data(); + void testUtf16LE(); + void testUtf16LE_data(); + void testUtf16_common_data(); + void testWindows1252(); + void testWindows1252_data(); + void testWindows1255(); + void testWindows1255_data(); + void testEsc_common_data(); + void testHzCharset(); + void testHzCharset_data(); + void testIso2022JPCharset(); + void testIso2022JPCharset_data(); +}; + +void KEncodingProberUnitTest::testUtf8() +{ + QFETCH(QByteArray, data); + QFETCH(bool, utf8Valid); + + using namespace kencodingprober; + + nsCodingStateMachine stateMachine{&UTF8SMModel}; + nsSMState state = eStart; + + for (auto b : data) { + state = stateMachine.NextState(b); + } + + QCOMPARE((state != eError), utf8Valid); +} + +void KEncodingProberUnitTest::testUtf8_data() +{ + using namespace Qt::StringLiterals; + + QTest::addColumn("data"); + QTest::addColumn("utf8Valid"); + + QTest::addRow("UTF-8 Latin1") << "abcdxyzABCDXYZ 0129;,"_ba << true; + QTest::addRow("BOM UTF-8") << "\xef\xbb\xbfZ"_ba << true; // "Z" + + // multibyte sequences - length 2 + QTest::addRow("UTF-8 Latin1 Supplement") // + << "Latin1 Text \xC3\xA4\xC3\xB6\xC3\xBC\xC3\x9F"_ba // "Latin1 Text äöüß" + << true; + QTest::addRow("UTF-8 len 2") << "Text \xC3\xA4 "_ba << true; + QTest::addRow("UTF-8 len 2 short") << "Text \xC3 "_ba << false; + QTest::addRow("UTF-8 len 2 invalid range") << "Text \xC0\x90 "_ba << false; + + // multibyte sequences - length 3 + QTest::addRow("UTF-8 CJK") // + << QByteArray::fromHex("e998bfe5b094e58d91e696afe5b1b1e88489") // 阿尔卑斯山脉 + << true; + QTest::addRow("UTF-8 len 3 a") << "Text \xE2\x80\x90 "_ba << true; // "‐" (HYPHEN) + QTest::addRow("UTF-8 len 3-1 short") << "Text \xE2\x80 "_ba << false; + QTest::addRow("UTF-8 len 3-2 short") << "Text \xE2 "_ba << false; + + QTest::addRow("UTF-8 len 3 b") << "Text \xE0\xbf\xbf "_ba << true; // "๏" (THAI CHARACTER FONGMAN) + QTest::addRow("UTF-8 len 3 invalid range") << "Text \xE0\x9f\x90 "_ba << false; + + QTest::addRow("UTF-8 len 3 c") << "Text \xED\x80\x80 "_ba << true; // "퀀" (HANGUL SYLLABLE KWEON) + QTest::addRow("UTF-8 invalid CESU") << "Text \xED\xbf\x80 "_ba << false; + + // multibyte sequences - length 4 + QTest::addRow("UTF-8 SMP Symbols") << "\xF0\x9F\x82\xA1 "_ba << true; // "🂡 " (ACE OF SPADES) + QTest::addRow("UTF-8 len 4-1 short") << "\xF0\x9F\x82 "_ba << false; + QTest::addRow("UTF-8 len 4-2 short") << "\xF0\x9F "_ba << false; + QTest::addRow("UTF-8 len 4-3 short") << "\xF0 "_ba << false; + QTest::addRow("UTF-8 len 4 invalid long") << "\xF0\x8F\x90\x90 "_ba << false; + QTest::addRow("UTF-8 len 4 invalid range") << "\xF5\x90\x90\x90 "_ba << false; + + // multibyte sequences - length 5/6 (invalid) + QTest::addRow("UTF-8 len 5 invalid") << "\xF8\x90\x90\x90\x90 "_ba << false; + QTest::addRow("UTF-8 len 6 invalid") << "\xFC\x90\x90\x90\x90\x90 "_ba << false; + + QTest::addRow("UTF-8 0xFE invalid") << "\xFE "_ba << false; + QTest::addRow("UTF-8 0xFF invalid") << "\xFF "_ba << false; + + // continuation without leading 2/3/4 byte start byte + QTest::addRow("UTF-8 invalid isolate high 0x80") << "\x80 "_ba << false; + QTest::addRow("UTF-8 invalid isolate high 0x92") << "\x92 "_ba << false; + QTest::addRow("UTF-8 invalid isolate high 0xAA") << "\xAA "_ba << false; + QTest::addRow("UTF-8 invalid isolate high 0xBF") << "\xBF "_ba << false; + + // Either Windows-1252/-1254/-1255 (binary identical) + // "One pound, i.e. ½ a kilogramm of butter costs 2 £." + QTest::addRow("Windows-125x English") << "One pound, i.e. \xAF a kilogramm of butter costs 2 \xA3."_ba << false; + // Example texts with Windows-125x encoding which are definitely not UTF-8 -- see Wikipedia "Pangram" + // "Příliš žluťoučký kůň úpěl ďábelské ódy" - "A horse that was too yellow moaned devilish odes" + QTest::addRow("Windows-1250 Czech") << // + "P\xf8\xedli\x9a \x9elu\x9dou\xe8k\xfd k\xf9\xf2 \xfap\xecl \xef\xe1\x62\x65lsk\xe9 \xf3\x64y."_ba << false; + // "Под южно дърво, цъфтящо в синьо, бягаше малко пухкаво зайче" - "Under a southern tree, blooming in blue, ran a little fluffy bunny" + QTest::addRow("Windows-1251 Bulgarian") << QByteArray::fromHex( // + "cfeee420fee6edee20e4faf0e2ee2c20f6faf4f2fff9ee20" + "e220f1e8edfcee2c20e1ffe3e0f8e520ece0ebeaee20eff3" + "f5eae0e2ee20e7e0e9f7e5") << false; + // "Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich." - "Victor chases twelve boxers across the Great Levee of Sylt" + QTest::addRow("Windows-1252 German") << // + "Victor jagt zw\xf6lf Boxk\xe4mpfer quer \xfc\x62\x65r den gro\xdf\x65n Sylter Deich."_ba << false; + // "שפן אכל קצת גזר בטעם חסה, ודי" - "A bunny ate some lettuce-flavored carrots, and he had enough" + QTest::addRow("Windows-1255 Hebrew") // + << QByteArray::fromHex("f9f4ef20e0ebec20f7f6fa20e2e6f820e1e8f2ed20e7f1e42c20e5e3e9") << false; +} + +void KEncodingProberUnitTest::testUtf16BE() +{ + QFETCH(QByteArray, data); + QFETCH(bool, utf16BEValid); + + using namespace kencodingprober; + + nsCodingStateMachine stateMachine{&UCS2BESMModel}; + nsSMState state = eStart; + + QEXPECT_FAIL("UTF16 ZWNBSP little", "zero width no-break space rejected", Abort); + for (auto b : data) { + state = stateMachine.NextState(b); + } + + QCOMPARE((state != eError), utf16BEValid); +} + +void KEncodingProberUnitTest::testUtf16LE() +{ + QFETCH(QByteArray, data); + QFETCH(bool, utf16LEValid); + + using namespace kencodingprober; + + nsCodingStateMachine stateMachine{&UCS2LESMModel}; + nsSMState state = eStart; + + QEXPECT_FAIL("UTF16 ZWNBSP big", "zero width no-break space rejected", Abort); + for (auto b : data) { + state = stateMachine.NextState(b); + } + + QCOMPARE((state != eError), utf16LEValid); +} + +void KEncodingProberUnitTest::testUtf16_common_data() +{ + QTest::addColumn("data"); + QTest::addColumn("utf16BEValid"); + QTest::addColumn("utf16LEValid"); + + QTest::addRow("empty") << QByteArray() << true << true; + // BOM must be detected + QTest::addRow("BE BOM") << QByteArray("\xFE\xFF") << true << false; + QTest::addRow("LE BOM") << QByteArray("\xFF\xFE") << false << true; + // swapped endianess does not cause an error, as the codepoint is still valid + QTest::addRow("BE HS+LS") << QByteArray("\x01\x01\xD8\x00\xDC\x00", 6) << true << true; + QTest::addRow("LE HS+LS") << QByteArray("\x01\x01\x00\xD8\x00\xDC", 6) << true << true; + QTest::addRow("BE HS+LS at start") << QByteArray("\xD8\x00\xDC\x00", 4) << true << true; + QTest::addRow("LE HS+LS at start") << QByteArray("\x00\xD8\x00\xDC", 4) << true << true; + // if swapped endianess results in a low surrogate, the input is invalid + QTest::addRow("BE LS") << QByteArray("\x01\x01\xDC\x00", 4) << false << true; + QTest::addRow("LE LS") << QByteArray("\x01\x01\x00\xDC", 4) << true << false; + QTest::addRow("BE LS at start") << QByteArray("\xDC\x00", 2) << false << true; + QTest::addRow("LE LS at start") << QByteArray("\x00\xDC", 2) << true << false; + + struct Utf16TestData { + const char *name; + const std::span data; + bool validBig; + bool validLittle; + }; + using namespace std::string_view_literals; + constexpr std::array utf16TestData = { + // syntactically correct even with wrong endianess + Utf16TestData{"UTF16 XY", u"XY"sv, true, true}, + Utf16TestData{"UTF16 ab", u"ab"sv, true, true}, + Utf16TestData{"UTF16 äöü", u"äöü"sv, true, true}, + Utf16TestData{"UTF16 BOM", u"\xFEFF"sv, true, false}, + // "‛" or "ᬠ" (U+1B20 BALINESE LETTER DA MURDA MAHAPRANA) + Utf16TestData{"UTF16 Interpunctuation", u"\x201B"sv, true, true}, + // "⨯" or "⼪" (U+2F2A KANGXI RADICAL LAME) + Utf16TestData{"UTF16 Math supplement", u"\x2A2F"sv, true, true}, + // ZWNBSP aka BOM inside the document is deprecated, but valid + Utf16TestData{"UTF16 ZWNBSP", u" \xFEFF"sv, true, true}, + }; + + for (const auto &tc : utf16TestData) { + QByteArray data; + data.resize(tc.data.size() * 2); + + qToBigEndian(tc.data.data(), tc.data.size(), data.data()); + QTest::addRow("%s big", tc.name) << data << tc.validBig << tc.validLittle; + + qToLittleEndian(tc.data.data(), tc.data.size(), data.data()); + QTest::addRow("%s little", tc.name) << data << tc.validLittle << tc.validBig; + } +} + +void KEncodingProberUnitTest::testUtf16BE_data() +{ + testUtf16_common_data(); +} + +void KEncodingProberUnitTest::testUtf16LE_data() +{ + testUtf16_common_data(); +} + +void KEncodingProberUnitTest::testWindows1252() +{ + using namespace kencodingprober; + + QFETCH(QByteArray, data); + QFETCH(bool, win1252Valid); + QFETCH(double, minConfidence); + + nsLatin1Prober win1252Prober{}; + + auto state = win1252Prober.HandleData(data.constData(), data.size()); + + QCOMPARE(win1252Valid, (state != eNotMe)); + + QEXPECT_FAIL("Windows-1252 German", "Valid vowel + sharp s considered unlikely", Abort); + QEXPECT_FAIL("Windows-1252 French", "Accented vowel pair considered unlikely", Abort); + QEXPECT_FAIL("Windows-1252 Spanish", "Accented vowel pair considered unlikely", Abort); + if (win1252Valid) { + QCOMPARE_GE(win1252Prober.GetConfidence(), minConfidence); + } +} + +void KEncodingProberUnitTest::testWindows1252_data() +{ + using namespace Qt::StringLiterals; + + QTest::addColumn("data"); + QTest::addColumn("win1252Valid"); + QTest::addColumn("minConfidence"); + + // Verify "undefined" codes in CP1252 are rejected + // https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT + for (auto c : std::array{0x81, 0x8D, 0x8F, 0x90, 0x9D}) { + QTest::addRow("Undefined 0x%x", c) << QByteArray(1, c) + " "_ba << false << 0.0; + } + + // "Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich." - "Victor chases twelve boxers across the Great Levee of Sylt" + QTest::addRow("Windows-1252 German") << // + "Victor jagt zw\xf6lf Boxk\xe4mpfer quer \xfc\x62\x65r den gro\xdf\x65n Sylter Deich."_ba << true << 0.45; + + // Same "Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich.", but using UTF-8 + // Unfortunately, these are all valid codepoints for Windows-1252, but the confidence should be lower than for UTF-8, + // as it contains UTF-8 multibyte sequences, and several capital characters following small characters for Windows-1252. + QTest::addRow("UTF-8 German") << // + "Victor jagt zw\xc3\xb6lf Boxk\xc3\xa4mpfer quer \xc3\xbc\x62\x65r den gro\xc3\x9f\x65n Sylter Deich."_ba << true << 0.0; + + // "L'ergothérapeute effectue des prestations de rééducation et de réadaptation." + // - "The occupational therapist provides rehabilitation and re-adaptation services." + QTest::addRow("Windows-1252 French") << // + "L'ergoth\xe9rapeute effectue des prestations de r\xe9\xe9\x64ucation et de r\xe9\x61\x64\x61ptation."_ba << true << 0.45; + + // "La sociolingüística sincrónica se centra en la estructura sociolingüística y en las variaciones lingüísticas." + // - "Synchronic sociolinguistics focuses on sociolinguistic structure and linguistic variations." + QTest::addRow("Windows-1252 Spanish") << // + "La socioling\xfc\xedstica sincr\xf3nica se centra en la estructura socioling\xfc\xedstica y en las variaciones ling\xfc\xedsticas."_ba << true << 0.45; + + // "שפן אכל קצת גזר בטעם חסה, ודי" - "A bunny ate some lettuce-flavored carrots, and he had enough" + QTest::addRow("Windows-1255 Hebrew") // + << QByteArray::fromHex("f9f4ef20e0ebec20f7f6fa20e2e6f820e1e8f2ed20e7f1e42c20e5e3e9") << true << 0.0; + // "שפן אכל קצת גזר בטעם חסה, ודי", but using UTF-8 + QTest::addRow("UTF-8 Hebrew") << QByteArray::fromHex( // + "d7a9d7a4d79f20d790d79bd79c20d7a7d7a6d7aa20d792d7" + "96d7a820d791d798d7a2d79d20d797d7a1d7942c20d795d7" + "93d799") << false << 0.0; +} + +void KEncodingProberUnitTest::testWindows1255() +{ + using namespace kencodingprober; + + QFETCH(QByteArray, data); + QFETCH(bool, win1255Valid); + + nsHebrewProber win1255Prober{}; + + if (QByteArray(QTest::currentDataTag(), -1).startsWith("Undefined 0x")) { + QEXPECT_FAIL("", "Invalid value accepted", Abort); + } + QEXPECT_FAIL("UTF-8 Hebrew", "Invalid 0x9f accepted", Abort); + + auto state = win1255Prober.HandleData(data.constData(), data.size()); + + QCOMPARE(win1255Valid, (state != eNotMe)); +} + +void KEncodingProberUnitTest::testWindows1255_data() +{ + using namespace Qt::StringLiterals; + + QTest::addColumn("data"); + QTest::addColumn("win1255Valid"); + + // Verify "undefined" codes in CP1255 are rejected + // https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT + for (auto c : std::array{ + 0x81, 0x8A, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x9A, 0x9C, 0x9D, 0x9E, 0x9F, // + 0xCA, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, 0xFB, 0xFC, 0xFF, + }) { + QTest::addRow("Undefined 0x%x", c) << QByteArray(1, c) + " "_ba << false; + } + + // "שפן אכל קצת גזר בטעם חסה, ודי" - "A bunny ate some lettuce-flavored carrots, and he had enough" + QTest::addRow("Windows-1255 Hebrew") // + << QByteArray::fromHex("f9f4ef20e0ebec20f7f6fa20e2e6f820e1e8f2ed20e7f1e42c20e5e3e9") << true; + + // Same "שפן אכל קצת גזר בטעם חסה, ודי", but using UTF-8 + QTest::addRow("UTF-8 Hebrew") << QByteArray::fromHex( // + "d7a9d7a4d79f20d790d79bd79c20d7a7d7a6d7aa20d792d7" + "96d7a820d791d798d7a2d79d20d797d7a1d7942c20d795d7" + "93d799") << false; +} + +void KEncodingProberUnitTest::testHzCharset() +{ + QFETCH(QByteArray, data); + QFETCH(bool, hzValid); + + using namespace kencodingprober; + + nsCodingStateMachine stateMachine{&HZSMModel}; + + nsSMState state = eStart; + + QEXPECT_FAIL("HZ odd", "0x7d '}' accepted as lead byte", Abort); + for (auto b : data) { + state = stateMachine.NextState(b); + } + + QCOMPARE((state != eError), hzValid); +} + +void KEncodingProberUnitTest::testIso2022JPCharset() +{ + QFETCH(QByteArray, data); + QFETCH(bool, iso2022JPValid); + + using namespace kencodingprober; + + nsCodingStateMachine stateMachine{&ISO2022JPSMModel}; + + nsSMState state = eStart; + + for (auto b : data) { + state = stateMachine.NextState(b); + } + + qDebug() << data; + QCOMPARE((state != eError), iso2022JPValid); +} + +void KEncodingProberUnitTest::testEsc_common_data() +{ + using namespace Qt::StringLiterals; + + QTest::addColumn("data"); + QTest::addColumn("hzValid"); + QTest::addColumn("iso2022JPValid"); + + // ASCII without escape sequence is always valid + QTest::addRow("empty") << QByteArray() << true << true; + QTest::addRow("Latin1") << "abcdxyzABCDXYZ 0129;,"_ba << true << true; + + // All codes >= 0x80 are invalid + QTest::addRow("UTF-8 BOM") << "\xef\xbb\xbfZ"_ba << false << false; // "Z" + QTest::addRow("UTF-16BE BOM") << "\xFE\xFF"_ba << false << false; + QTest::addRow("UTF-16LE BOM") << "\xFF\xFE"_ba << false << false; + QTest::addRow("UTF-8 Latin1 Supplement") // + << "Latin1 Text \xC3\xA4\xC3\xB6\xC3\xBC\xC3\x9F"_ba // "Latin1 Text äöüß" + << false << false; + + // HZ encoding is (a subset of) plain ASCII, i.e. also valid ISO-2022 + QTest::addRow("HZ empty") << "~{~}"_ba << true << true; + QTest::addRow("HZ odd") << "~{R~}"_ba << false << true; + QTest::addRow("HZ valid") << "~{R;~}"_ba << true << true; // "一" (one) + QTest::addRow("HZ valid with ASCII") << "R~{R;~}R"_ba << true << true; // "R一R" + + // "こんにちは" / "Kon'nichiwa" - "Hello" + // ESC $ B ESC ( B + QTest::addRow("ISO-2022-JP") << QByteArray::fromHex( // + "1b 24 42 24 33 24 73 24 4b 24 41 24 4f 1b 28 42" + "") << false << true; +} + +void KEncodingProberUnitTest::testHzCharset_data() +{ + testEsc_common_data(); +} + +void KEncodingProberUnitTest::testIso2022JPCharset_data() +{ + testEsc_common_data(); +} + +QTEST_MAIN(KEncodingProberUnitTest) + +#include "kencodingproberunittest.moc" diff --git a/local/recipes/kde/kf6-kcodecs/source/autotests/ossfuzz/CMakeLists.txt b/local/recipes/kde/kf6-kcodecs/source/autotests/ossfuzz/CMakeLists.txt new file mode 100644 index 0000000000..a28c46d5e3 --- /dev/null +++ b/local/recipes/kde/kf6-kcodecs/source/autotests/ossfuzz/CMakeLists.txt @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: 2025 Azhar Momin +# SPDX-License-Identifier: BSD-2-Clause + +if(DEFINED ENV{LIB_FUZZING_ENGINE}) + set(fuzzing_engine $ENV{LIB_FUZZING_ENGINE}) +else() + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(fuzzing_engine -fsanitize=fuzzer) + else() + message(FATAL_ERROR "Fuzzing engine not supported") + endif() +endif() + +add_executable(kcodecs_fuzzer kcodecs_fuzzer.cc) +target_link_libraries(kcodecs_fuzzer PRIVATE KF6Codecs ${fuzzing_engine}) + +set_target_properties(kcodecs_fuzzer PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/fuzzers +) diff --git a/local/recipes/kde/kf6-kcodecs/source/autotests/ossfuzz/README.md b/local/recipes/kde/kf6-kcodecs/source/autotests/ossfuzz/README.md new file mode 100644 index 0000000000..a4380fb955 --- /dev/null +++ b/local/recipes/kde/kf6-kcodecs/source/autotests/ossfuzz/README.md @@ -0,0 +1,35 @@ + + + +# KCodecs OSS-Fuzz Integration + +## Fuzzing Locally +Make sure you're using Clang (by setting `CC` and `CXX`), since fuzzing requires it. Then build KCodecs with `BUILD_FUZZERS=ON` to generate the `kcodecs_fuzzer` binary: +```sh +cmake -B build -DBUILD_FUZZERS=ON +cmake --build build +./build/bin/fuzzers/kcodecs_fuzzer +``` + +## Testing OSS-Fuzz Integration +Testing OSS-Fuzz integration requires: Python & Docker + +First clone the OSS-Fuzz repository: +```sh +git clone https://github.com/google/oss-fuzz.git +``` + +After navigating to the cloned repository, run the following command to build the fuzzers: +```sh +python3 infra/helper.py build_image kcodecs +python3 infra/helper.py build_fuzzers --sanitizer address kcodecs +``` + +This may take a while since it builds the whole QtBase dependency alongside with KCodecs. Once the build is completed, you can run the fuzzers using the following command: +```sh +python3 infra/helper.py run_fuzzer kcodecs kcodecs_fuzzer +``` + +The code for preparing the build lives in the `prepare_build.sh` script and the code for building the fuzzers lives in the `build_fuzzers.sh` script (which is also responsible for building the dependencies, creating the seed corpus and copying the dict file). + +For more information on OSS-Fuzz, visit the [official website](https://google.github.io/oss-fuzz/). diff --git a/local/recipes/kde/kf6-kcodecs/source/autotests/ossfuzz/build_fuzzers.sh b/local/recipes/kde/kf6-kcodecs/source/autotests/ossfuzz/build_fuzzers.sh new file mode 100755 index 0000000000..24156bbe00 --- /dev/null +++ b/local/recipes/kde/kf6-kcodecs/source/autotests/ossfuzz/build_fuzzers.sh @@ -0,0 +1,55 @@ +#!/bin/bash -eu +# +# SPDX-FileCopyrightText: 2019 Google Inc. +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright 2019 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +rm -rf $WORK/* + +export PATH="$WORK/bin:$PATH" +if [[ $FUZZING_ENGINE == "afl" ]]; then + export LDFLAGS="-fuse-ld=lld" +fi + +cd $SRC/extra-cmake-modules +cmake . -G Ninja \ + -DBUILD_TESTING=OFF \ + -DCMAKE_INSTALL_PREFIX=$WORK +ninja install -j$(nproc) + +cd $SRC/qtbase +./configure -no-glib -qt-libpng -qt-pcre -qt-zlib -opensource -confirm-license -static -no-opengl \ + -no-icu -platform linux-clang-libc++ -debug -prefix $WORK -no-feature-gui -no-feature-sql \ + -no-feature-network -no-feature-xml -no-feature-dbus -no-feature-printsupport +ninja install -j$(nproc) + +cd $SRC/kcodecs +rm -rf poqm +cmake . -G Ninja \ + -DBUILD_SHARED_LIBS=OFF \ + -DBUILD_TESTING=OFF \ + -DBUILD_FUZZERS=ON \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$WORK +ninja install -j$(nproc) + +# Copy the fuzzer +cp bin/fuzzers/kcodecs_fuzzer $OUT/kcodecs_fuzzer + +# Create a seed corpus +zip -qr $OUT/kcodecs_fuzzer_seed_corpus.zip $SRC/uchardet/test/ $SRC/kcodecs/autotests/data diff --git a/local/recipes/kde/kf6-kcodecs/source/autotests/ossfuzz/kcodecs_fuzzer.cc b/local/recipes/kde/kf6-kcodecs/source/autotests/ossfuzz/kcodecs_fuzzer.cc new file mode 100644 index 0000000000..253114b83b --- /dev/null +++ b/local/recipes/kde/kf6-kcodecs/source/autotests/ossfuzz/kcodecs_fuzzer.cc @@ -0,0 +1,73 @@ +/* +# +# SPDX-FileCopyrightText: 2019 Google Inc. +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright 2019 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +*/ + +/* + Usage: + python infra/helper.py build_image kcodecs + python infra/helper.py build_fuzzers --sanitizer undefined|address|memory kcodecs + python infra/helper.py run_fuzzer kcodecs kcodecs_fuzzer +*/ + +#include +#include + +#include +#include + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + int argc = 0; + QCoreApplication a(argc, nullptr); + + const QByteArray ba((const char *)data, size); + const std::unique_ptr prober = std::make_unique(); + + // Arabic, Baltic, CentralEuropean, Cyrillic, Greek, Hebrew, NorthernSaami, Other, + // SouthEasternEurope, Thai, Turkish, WesternEuropean + // All of these use nsSBCSGroupProber, so add only Arabic to avoid duplication + // ChineseSimplified and ChineseTraditional both use ChineseGroupProber + const QVector allProbers = { + KEncodingProber::None, + KEncodingProber::Universal, + KEncodingProber::Arabic, + KEncodingProber::ChineseTraditional, + KEncodingProber::Japanese, + KEncodingProber::Korean, + KEncodingProber::Unicode + }; + for (KEncodingProber::ProberType type : allProbers) { + prober->setProberType(type); + prober->feed(ba); + prober->reset(); + } + + const QVector codecs = {"base64", "quoted-printable", "b", "q", "x-kmime-rfc2231", "x-uuencode"}; + for (const char *codecName : codecs) { + KCodecs::Codec *c = KCodecs::Codec::codecForName(codecName); + c->encode(ba, KCodecs::Codec::NewlineCRLF); + c->decode(ba, KCodecs::Codec::NewlineCRLF); + c->encode(ba, KCodecs::Codec::NewlineLF); + c->decode(ba, KCodecs::Codec::NewlineLF); + } + + return 0; +} diff --git a/local/recipes/kde/kf6-kcodecs/source/autotests/ossfuzz/prepare_build.sh b/local/recipes/kde/kf6-kcodecs/source/autotests/ossfuzz/prepare_build.sh new file mode 100755 index 0000000000..1165a078ba --- /dev/null +++ b/local/recipes/kde/kf6-kcodecs/source/autotests/ossfuzz/prepare_build.sh @@ -0,0 +1,27 @@ +#!/bin/bash -eu +# +# SPDX-FileCopyrightText: 2019 Google Inc. +# SPDX-License-Identifier: Apache-2.0 +# +# Based on https://github.com/google/oss-fuzz/blob/33aab4a70dc4b5811143d214536584a8c8cb3924/projects/kcodecs/Dockerfile +# Copyright 2019 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +apt-get update && apt-get install --yes cmake ninja-build + +git clone --depth 1 --branch=dev git://code.qt.io/qt/qtbase.git +git clone --depth 1 -b master https://invent.kde.org/frameworks/extra-cmake-modules.git +git clone --depth 1 https://gitlab.freedesktop.org/uchardet/uchardet.git diff --git a/local/recipes/kde/kf6-kcodecs/source/src/kcodecs-index.qdoc b/local/recipes/kde/kf6-kcodecs/source/src/kcodecs-index.qdoc new file mode 100644 index 0000000000..074d685668 --- /dev/null +++ b/local/recipes/kde/kf6-kcodecs/source/src/kcodecs-index.qdoc @@ -0,0 +1,25 @@ +/*! + \page kcodecs-index.html + \title KCodecs + + KCodecs provide a collection of methods to manipulate strings using various + encodings. + + It can automatically determine the charset of a string, translate XML entities, + validate email addresses, and find encodings by name in a more tolerant way than QTextCodec + (useful e.g. for data coming from the Internet). + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {Codecs} {KF6::Codecs} + + \section1 API Reference + + \list + \li \l{KCodecs C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kcodecs/source/src/kcodecs.qdoc b/local/recipes/kde/kf6-kcodecs/source/src/kcodecs.qdoc new file mode 100644 index 0000000000..83b087c013 --- /dev/null +++ b/local/recipes/kde/kf6-kcodecs/source/src/kcodecs.qdoc @@ -0,0 +1,9 @@ +/*! + \module KCodecs + \title KCodecs C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Codecs + + \brief Text encoding. +*/ diff --git a/local/recipes/kde/kf6-kcodecs/source/src/kcodecs.qdocconf b/local/recipes/kde/kf6-kcodecs/source/src/kcodecs.qdocconf new file mode 100644 index 0000000000..a4ba8a97e7 --- /dev/null +++ b/local/recipes/kde/kf6-kcodecs/source/src/kcodecs.qdocconf @@ -0,0 +1,33 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KCodecs +description = Text encoding + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +depends += \ + qtcore \ + qtcore5compat + +navigation.landingpage = "KCodecs" + +qhp.projects = KCodecs + +qhp.KCodecs.file = kcodecs.qhp +qhp.KCodecs.namespace = org.kde.kcodecs.$QT_VERSION_TAG +qhp.KCodecs.virtualFolder = kcodecs +qhp.KCodecs.indexTitle = KCodecs +qhp.KCodecs.indexRoot = + +qhp.KCodecs.subprojects = classes +qhp.KCodecs.subprojects.classes.title = C++ Classes +qhp.KCodecs.subprojects.classes.indexTitle = KCodecs C++ Classes +qhp.KCodecs.subprojects.classes.selectors = class fake:headerfile +qhp.KCodecs.subprojects.classes.sortPages = true + +tagfile = kcodecs.tags diff --git a/local/recipes/kde/kf6-kcodecs/source/src/kencodingprober_p.h b/local/recipes/kde/kf6-kcodecs/source/src/kencodingprober_p.h new file mode 100644 index 0000000000..437fc9bfb6 --- /dev/null +++ b/local/recipes/kde/kf6-kcodecs/source/src/kencodingprober_p.h @@ -0,0 +1,18 @@ +/* + This file is part of the KDE libraries + + SPDX-FileCopyrightText: 2008 Wang Hoi + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#ifndef KENCODINGPROBER_P_H +#define KENCODINGPROBER_P_H + +// enable debug of private probers +// #define DEBUG_PROBE + +#ifdef DEBUG_PROBE +#include +#endif + +#endif diff --git a/local/recipes/kde/kf6-kcodecs/source/src/probers/nsEscSM.h b/local/recipes/kde/kf6-kcodecs/source/src/probers/nsEscSM.h new file mode 100644 index 0000000000..aad33b5607 --- /dev/null +++ b/local/recipes/kde/kf6-kcodecs/source/src/probers/nsEscSM.h @@ -0,0 +1,135 @@ +/* -*- C++ -*- + SPDX-FileCopyrightText: 1998 Netscape Communications Corporation + + SPDX-License-Identifier: MIT +*/ + +#ifndef nsEscSM_h__ +#define nsEscSM_h__ + +#include "nsCodingStateMachine.h" + +namespace kencodingprober +{ +static constexpr std::array HZ_cls{ + // clang-format off + 1, 0, 0, 0, 0, 0, 0, 0, // 00 - 07 + 0, 0, 0, 0, 0, 0, 0, 0, // 08 - 0f + 0, 0, 0, 0, 0, 0, 0, 0, // 10 - 17 + 0, 0, 0, 1, 0, 0, 0, 0, // 18 - 1f + 0, 0, 0, 0, 0, 0, 0, 0, // 20 - 27 + 0, 0, 0, 0, 0, 0, 0, 0, // 28 - 2f + 0, 0, 0, 0, 0, 0, 0, 0, // 30 - 37 + 0, 0, 0, 0, 0, 0, 0, 0, // 38 - 3f + 0, 0, 0, 0, 0, 0, 0, 0, // 40 - 47 + 0, 0, 0, 0, 0, 0, 0, 0, // 48 - 4f + 0, 0, 0, 0, 0, 0, 0, 0, // 50 - 57 + 0, 0, 0, 0, 0, 0, 0, 0, // 58 - 5f + 0, 0, 0, 0, 0, 0, 0, 0, // 60 - 67 + 0, 0, 0, 0, 0, 0, 0, 0, // 68 - 6f + 0, 0, 0, 0, 0, 0, 0, 0, // 70 - 77 + 0, 0, 0, 4, 0, 5, 2, 0, // 78 - 7f + 1, 1, 1, 1, 1, 1, 1, 1, // 80 - 87 + 1, 1, 1, 1, 1, 1, 1, 1, // 88 - 8f + 1, 1, 1, 1, 1, 1, 1, 1, // 90 - 97 + 1, 1, 1, 1, 1, 1, 1, 1, // 98 - 9f + 1, 1, 1, 1, 1, 1, 1, 1, // a0 - a7 + 1, 1, 1, 1, 1, 1, 1, 1, // a8 - af + 1, 1, 1, 1, 1, 1, 1, 1, // b0 - b7 + 1, 1, 1, 1, 1, 1, 1, 1, // b8 - bf + 1, 1, 1, 1, 1, 1, 1, 1, // c0 - c7 + 1, 1, 1, 1, 1, 1, 1, 1, // c8 - cf + 1, 1, 1, 1, 1, 1, 1, 1, // d0 - d7 + 1, 1, 1, 1, 1, 1, 1, 1, // d8 - df + 1, 1, 1, 1, 1, 1, 1, 1, // e0 - e7 + 1, 1, 1, 1, 1, 1, 1, 1, // e8 - ef + 1, 1, 1, 1, 1, 1, 1, 1, // f0 - f7 + 1, 1, 1, 1, 1, 1, 1, 1 // f8 - ff + // clang-format on +}; + +static constexpr std::array HZ_st{ + // clang-format off + // ~ { } + eStart, eError, 3, eStart, eStart, eStart, // eStart + eError, eError, eError, eError, eError, eError, // eError + eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, // eItsMe + eError, eError, eStart, eStart, 4, eError, // 3 '~' + 5, eError, 6, eError, 5, 5, // 4 '~ { [ ]*' + 4, eError, 4, eError, 4, 4, // 5 '~ { [ ]*' + 4, eError, 4, eError, 4, eItsMe, // 6 + // clang-format on +}; + +static const unsigned int HZCharLenTable[] = {0, 0, 0, 0, 0, 0}; + +static constexpr SMModel HZSMModel{ + HZ_cls, + 6, + HZ_st, + HZCharLenTable, + "HZ-GB-2312", +}; + +static constexpr std::array ISO2022JP_cls{ + // clang-format off + 2, 0, 0, 0, 0, 0, 0, 0, // 00 - 07 + 0, 0, 0, 0, 0, 0, 2, 2, // 08 - 0f + 0, 0, 0, 0, 0, 0, 0, 0, // 10 - 17 + 0, 0, 0, 1, 0, 0, 0, 0, // 18 - 1f + 0, 0, 0, 0, 7, 0, 0, 0, // 20 - 27 + 3, 0, 0, 0, 0, 0, 0, 0, // 28 - 2f + 0, 0, 0, 0, 0, 0, 0, 0, // 30 - 37 + 0, 0, 0, 0, 0, 0, 0, 0, // 38 - 3f + 6, 0, 4, 0, 8, 0, 0, 0, // 40 - 47 + 0, 9, 5, 0, 0, 0, 0, 0, // 48 - 4f + 0, 0, 0, 0, 0, 0, 0, 0, // 50 - 57 + 0, 0, 0, 0, 0, 0, 0, 0, // 58 - 5f + 0, 0, 0, 0, 0, 0, 0, 0, // 60 - 67 + 0, 0, 0, 0, 0, 0, 0, 0, // 68 - 6f + 0, 0, 0, 0, 0, 0, 0, 0, // 70 - 77 + 0, 0, 0, 0, 0, 0, 0, 0, // 78 - 7f + 2, 2, 2, 2, 2, 2, 2, 2, // 80 - 87 + 2, 2, 2, 2, 2, 2, 2, 2, // 88 - 8f + 2, 2, 2, 2, 2, 2, 2, 2, // 90 - 97 + 2, 2, 2, 2, 2, 2, 2, 2, // 98 - 9f + 2, 2, 2, 2, 2, 2, 2, 2, // a0 - a7 + 2, 2, 2, 2, 2, 2, 2, 2, // a8 - af + 2, 2, 2, 2, 2, 2, 2, 2, // b0 - b7 + 2, 2, 2, 2, 2, 2, 2, 2, // b8 - bf + 2, 2, 2, 2, 2, 2, 2, 2, // c0 - c7 + 2, 2, 2, 2, 2, 2, 2, 2, // c8 - cf + 2, 2, 2, 2, 2, 2, 2, 2, // d0 - d7 + 2, 2, 2, 2, 2, 2, 2, 2, // d8 - df + 2, 2, 2, 2, 2, 2, 2, 2, // e0 - e7 + 2, 2, 2, 2, 2, 2, 2, 2, // e8 - ef + 2, 2, 2, 2, 2, 2, 2, 2, // f0 - f7 + 2, 2, 2, 2, 2, 2, 2, 2 // f8 - ff + // clang-format on +}; + +// ISO-2022-JP-1 / RFC 2237 +static constexpr std::array ISO2022JP_st{ + // clang-format off + // ( B J @ $ D I + eStart, 3, eError, eStart, eStart, eStart, eStart, eStart, eStart, eStart, // eStart + eError, eError, eError, eError, eError, eError, eError, eError, eError, eError, // eError + eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, // eItsMe + eError, eError, eError, 5, eError, eError, eError, 4, eError, eError, // 3 'ESC' + eError, eError, eError, 6, eItsMe, eError, eItsMe, eError, eError, eError, // 4 'ESC $' + eError, eError, eError, eError, eItsMe, eItsMe, eError, eError, eError, eItsMe, // 5 'ESC (' + eError, eError, eError, eError, eError, eError, eError, eError, eItsMe, eError, // 6 'ESC $ (' + // clang-format on +}; + +static const unsigned int ISO2022JPCharLenTable[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +static constexpr SMModel ISO2022JPSMModel = { + ISO2022JP_cls, + 10, + ISO2022JP_st, + ISO2022JPCharLenTable, + "ISO-2022-JP", +}; +} +#endif // nsEscSM_h__ diff --git a/local/recipes/kde/kf6-kcodecs/source/src/probers/nsMBCSSM.h b/local/recipes/kde/kf6-kcodecs/source/src/probers/nsMBCSSM.h new file mode 100644 index 0000000000..255996854b --- /dev/null +++ b/local/recipes/kde/kf6-kcodecs/source/src/probers/nsMBCSSM.h @@ -0,0 +1,485 @@ +/* -*- C++ -*- + SPDX-FileCopyrightText: 1998 Netscape Communications Corporation + + SPDX-License-Identifier: MIT +*/ + +#ifndef nsMBCSSM_h__ +#define nsMBCSSM_h__ + +#include "nsCodingStateMachine.h" + +/* +Modification from frank tang's original work: +. 0x00 is allowed as a legal character. Since some web pages contains this char in + text stream. +*/ + +// BIG5 + +namespace kencodingprober +{ +static constexpr std::array BIG5_cls{ + // clang-format off + // 0,1,1,1,1,1,1,1, // 00 - 07 + 1, 1, 1, 1, 1, 1, 1, 1, // 00 - 07 //allow 0x00 as legal value + 1, 1, 1, 1, 1, 1, 0, 0, // 08 - 0f + 1, 1, 1, 1, 1, 1, 1, 1, // 10 - 17 + 1, 1, 1, 0, 1, 1, 1, 1, // 18 - 1f + 1, 1, 1, 1, 1, 1, 1, 1, // 20 - 27 + 1, 1, 1, 1, 1, 1, 1, 1, // 28 - 2f + 1, 1, 1, 1, 1, 1, 1, 1, // 30 - 37 + 1, 1, 1, 1, 1, 1, 1, 1, // 38 - 3f + 2, 2, 2, 2, 2, 2, 2, 2, // 40 - 47 + 2, 2, 2, 2, 2, 2, 2, 2, // 48 - 4f + 2, 2, 2, 2, 2, 2, 2, 2, // 50 - 57 + 2, 2, 2, 2, 2, 2, 2, 2, // 58 - 5f + 2, 2, 2, 2, 2, 2, 2, 2, // 60 - 67 + 2, 2, 2, 2, 2, 2, 2, 2, // 68 - 6f + 2, 2, 2, 2, 2, 2, 2, 2, // 70 - 77 + 2, 2, 2, 2, 2, 2, 2, 1, // 78 - 7f + 4, 4, 4, 4, 4, 4, 4, 4, // 80 - 87 + 4, 4, 4, 4, 4, 4, 4, 4, // 88 - 8f + 4, 4, 4, 4, 4, 4, 4, 4, // 90 - 97 + 4, 4, 4, 4, 4, 4, 4, 4, // 98 - 9f + 4, 3, 3, 3, 3, 3, 3, 3, // a0 - a7 + 3, 3, 3, 3, 3, 3, 3, 3, // a8 - af + 3, 3, 3, 3, 3, 3, 3, 3, // b0 - b7 + 3, 3, 3, 3, 3, 3, 3, 3, // b8 - bf + 3, 3, 3, 3, 3, 3, 3, 3, // c0 - c7 + 3, 3, 3, 3, 3, 3, 3, 3, // c8 - cf + 3, 3, 3, 3, 3, 3, 3, 3, // d0 - d7 + 3, 3, 3, 3, 3, 3, 3, 3, // d8 - df + 3, 3, 3, 3, 3, 3, 3, 3, // e0 - e7 + 3, 3, 3, 3, 3, 3, 3, 3, // e8 - ef + 3, 3, 3, 3, 3, 3, 3, 3, // f0 - f7 + 3, 3, 3, 3, 3, 3, 3, 0 // f8 - ff + // clang-format on +}; + +static constexpr std::array BIG5_st{ + // clang-format off + eError, eStart, eStart, 3, eError, // eStart + eError, eError, eError, eError, eError, // eError + eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, // eItsMe + eError, eError, eStart, eStart, eStart, // 3 + eStart, eStart, eStart, eStart // Padding + // clang-format on +}; + +static const unsigned int Big5CharLenTable[] = {0, 1, 1, 2, 0}; + +static constexpr SMModel Big5SMModel{ + BIG5_cls, + 5, + BIG5_st, + Big5CharLenTable, + "Big5", +}; + +static constexpr std::array EUCJP_cls{ + // clang-format off + // 5,4,4,4,4,4,4,4, // 00 - 07 + 4, 4, 4, 4, 4, 4, 4, 4, // 00 - 07 + 4, 4, 4, 4, 4, 4, 5, 5, // 08 - 0f + 4, 4, 4, 4, 4, 4, 4, 4, // 10 - 17 + 4, 4, 4, 5, 4, 4, 4, 4, // 18 - 1f + 4, 4, 4, 4, 4, 4, 4, 4, // 20 - 27 + 4, 4, 4, 4, 4, 4, 4, 4, // 28 - 2f + 4, 4, 4, 4, 4, 4, 4, 4, // 30 - 37 + 4, 4, 4, 4, 4, 4, 4, 4, // 38 - 3f + 4, 4, 4, 4, 4, 4, 4, 4, // 40 - 47 + 4, 4, 4, 4, 4, 4, 4, 4, // 48 - 4f + 4, 4, 4, 4, 4, 4, 4, 4, // 50 - 57 + 4, 4, 4, 4, 4, 4, 4, 4, // 58 - 5f + 4, 4, 4, 4, 4, 4, 4, 4, // 60 - 67 + 4, 4, 4, 4, 4, 4, 4, 4, // 68 - 6f + 4, 4, 4, 4, 4, 4, 4, 4, // 70 - 77 + 4, 4, 4, 4, 4, 4, 4, 4, // 78 - 7f + 5, 5, 5, 5, 5, 5, 5, 5, // 80 - 87 + 5, 5, 5, 5, 5, 5, 1, 3, // 88 - 8f + 5, 5, 5, 5, 5, 5, 5, 5, // 90 - 97 + 5, 5, 5, 5, 5, 5, 5, 5, // 98 - 9f + 5, 2, 2, 2, 2, 2, 2, 2, // a0 - a7 + 2, 2, 2, 2, 2, 2, 2, 2, // a8 - af + 2, 2, 2, 2, 2, 2, 2, 2, // b0 - b7 + 2, 2, 2, 2, 2, 2, 2, 2, // b8 - bf + 2, 2, 2, 2, 2, 2, 2, 2, // c0 - c7 + 2, 2, 2, 2, 2, 2, 2, 2, // c8 - cf + 2, 2, 2, 2, 2, 2, 2, 2, // d0 - d7 + 2, 2, 2, 2, 2, 2, 2, 2, // d8 - df + 0, 0, 0, 0, 0, 0, 0, 0, // e0 - e7 + 0, 0, 0, 0, 0, 0, 0, 0, // e8 - ef + 0, 0, 0, 0, 0, 0, 0, 0, // f0 - f7 + 0, 0, 0, 0, 0, 0, 0, 5 // f8 - ff + // clang-format on +}; + +static constexpr std::array EUCJP_st{ + // clang-format off + 3, 4, 3, 5, eStart, eError, // eStart + eError, eError, eError, eError, eError, eError, // eError + eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, // eItsMe + eStart, eError, eStart, eError, eError, eError, // 3 + eError, eError, eStart, eError, eError, eError, // 4 + 3, eError, 3, eError, eError, eError, // 5 + eStart, eStart, eStart, eStart // Padding + // clang-format on +}; + +static const unsigned int EUCJPCharLenTable[] = {2, 2, 2, 3, 1, 0}; + +static constexpr SMModel EUCJPSMModel{ + EUCJP_cls, + 6, + EUCJP_st, + EUCJPCharLenTable, + "EUC-JP", +}; + +static constexpr std::array EUCKR_cls{ + // clang-format off + // 0,1,1,1,1,1,1,1, // 00 - 07 + 1, 1, 1, 1, 1, 1, 1, 1, // 00 - 07 + 1, 1, 1, 1, 1, 1, 0, 0, // 08 - 0f + 1, 1, 1, 1, 1, 1, 1, 1, // 10 - 17 + 1, 1, 1, 0, 1, 1, 1, 1, // 18 - 1f + 1, 1, 1, 1, 1, 1, 1, 1, // 20 - 27 + 1, 1, 1, 1, 1, 1, 1, 1, // 28 - 2f + 1, 1, 1, 1, 1, 1, 1, 1, // 30 - 37 + 1, 1, 1, 1, 1, 1, 1, 1, // 38 - 3f + 1, 1, 1, 1, 1, 1, 1, 1, // 40 - 47 + 1, 1, 1, 1, 1, 1, 1, 1, // 48 - 4f + 1, 1, 1, 1, 1, 1, 1, 1, // 50 - 57 + 1, 1, 1, 1, 1, 1, 1, 1, // 58 - 5f + 1, 1, 1, 1, 1, 1, 1, 1, // 60 - 67 + 1, 1, 1, 1, 1, 1, 1, 1, // 68 - 6f + 1, 1, 1, 1, 1, 1, 1, 1, // 70 - 77 + 1, 1, 1, 1, 1, 1, 1, 1, // 78 - 7f + 0, 0, 0, 0, 0, 0, 0, 0, // 80 - 87 + 0, 0, 0, 0, 0, 0, 0, 0, // 88 - 8f + 0, 0, 0, 0, 0, 0, 0, 0, // 90 - 97 + 0, 0, 0, 0, 0, 0, 0, 0, // 98 - 9f + 0, 2, 2, 2, 2, 2, 2, 2, // a0 - a7 + 2, 2, 2, 2, 2, 3, 3, 3, // a8 - af + 2, 2, 2, 2, 2, 2, 2, 2, // b0 - b7 + 2, 2, 2, 2, 2, 2, 2, 2, // b8 - bf + 2, 2, 2, 2, 2, 2, 2, 2, // c0 - c7 + 2, 3, 2, 2, 2, 2, 2, 2, // c8 - cf + 2, 2, 2, 2, 2, 2, 2, 2, // d0 - d7 + 2, 2, 2, 2, 2, 2, 2, 2, // d8 - df + 2, 2, 2, 2, 2, 2, 2, 2, // e0 - e7 + 2, 2, 2, 2, 2, 2, 2, 2, // e8 - ef + 2, 2, 2, 2, 2, 2, 2, 2, // f0 - f7 + 2, 2, 2, 2, 2, 2, 2, 0 // f8 - ff + // clang-format on +}; + +static constexpr std::array EUCKR_st{ + // clang-format off + eError, eStart, 3, eError, // eStart + eError, eError, eError, eError, // eError + eItsMe, eItsMe, eItsMe, eItsMe, // eItsMe + eError, eError, eStart, eStart // 3 + // clang-format on +}; + +static const unsigned int EUCKRCharLenTable[] = {0, 1, 2, 0}; + +static constexpr SMModel EUCKRSMModel{ + EUCKR_cls, + 4, + EUCKR_st, + EUCKRCharLenTable, + "EUC-KR", +}; + +// the following state machine data was created by perl script in +// intl/chardet/tools. It should be the same as in PSM detector. +static constexpr std::array GB18030_cls{ + // clang-format off + 1, 1, 1, 1, 1, 1, 1, 1, // 00 - 07 + 1, 1, 1, 1, 1, 1, 0, 0, // 08 - 0f + 1, 1, 1, 1, 1, 1, 1, 1, // 10 - 17 + 1, 1, 1, 0, 1, 1, 1, 1, // 18 - 1f + 1, 1, 1, 1, 1, 1, 1, 1, // 20 - 27 + 1, 1, 1, 1, 1, 1, 1, 1, // 28 - 2f + 3, 3, 3, 3, 3, 3, 3, 3, // 30 - 37 + 3, 3, 1, 1, 1, 1, 1, 1, // 38 - 3f + 2, 2, 2, 2, 2, 2, 2, 2, // 40 - 47 + 2, 2, 2, 2, 2, 2, 2, 2, // 48 - 4f + 2, 2, 2, 2, 2, 2, 2, 2, // 50 - 57 + 2, 2, 2, 2, 2, 2, 2, 2, // 58 - 5f + 2, 2, 2, 2, 2, 2, 2, 2, // 60 - 67 + 2, 2, 2, 2, 2, 2, 2, 2, // 68 - 6f + 2, 2, 2, 2, 2, 2, 2, 2, // 70 - 77 + 2, 2, 2, 2, 2, 2, 2, 4, // 78 - 7f + 5, 6, 6, 6, 6, 6, 6, 6, // 80 - 87 + 6, 6, 6, 6, 6, 6, 6, 6, // 88 - 8f + 6, 6, 6, 6, 6, 6, 6, 6, // 90 - 97 + 6, 6, 6, 6, 6, 6, 6, 6, // 98 - 9f + 6, 6, 6, 6, 6, 6, 6, 6, // a0 - a7 + 6, 6, 6, 6, 6, 6, 6, 6, // a8 - af + 6, 6, 6, 6, 6, 6, 6, 6, // b0 - b7 + 6, 6, 6, 6, 6, 6, 6, 6, // b8 - bf + 6, 6, 6, 6, 6, 6, 6, 6, // c0 - c7 + 6, 6, 6, 6, 6, 6, 6, 6, // c8 - cf + 6, 6, 6, 6, 6, 6, 6, 6, // d0 - d7 + 6, 6, 6, 6, 6, 6, 6, 6, // d8 - df + 6, 6, 6, 6, 6, 6, 6, 6, // e0 - e7 + 6, 6, 6, 6, 6, 6, 6, 6, // e8 - ef + 6, 6, 6, 6, 6, 6, 6, 6, // f0 - f7 + 6, 6, 6, 6, 6, 6, 6, 0 // f8 - ff + // clang-format on +}; + +static constexpr std::array GB18030_st{ + // clang-format off + eError, eStart, eStart, eStart, eStart, eStart, 3, // eStart + eError, eError, eError, eError, eError, eError, eError, // eError + eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, // eItsMe + eError, eError, eStart, 4, eError, eStart, eStart, // 3 + eError, eError, eError, eError, eError, eError, 5, // 4 + eError, eError, eError, eItsMe, eError, eError, eError, // 5 + eStart, eStart, eStart, eStart, eStart, eStart // Padding + // clang-format on +}; + +// To be accurate, the length of class 6 can be either 2 or 4. +// But it is not necessary to discriminate between the two since +// it is used for frequency analysis only, and we are validating +// each code range there as well. So it is safe to set it to be +// 2 here. +static const unsigned int GB18030CharLenTable[] = {0, 1, 1, 1, 1, 1, 2}; + +static constexpr SMModel GB18030SMModel{ + GB18030_cls, + 7, + GB18030_st, + GB18030CharLenTable, + "GB18030", +}; + +// sjis + +static constexpr std::array SJIS_cls{ + // clang-format off + // 0,1,1,1,1,1,1,1, // 00 - 07 + 1, 1, 1, 1, 1, 1, 1, 1, // 00 - 07 + 1, 1, 1, 1, 1, 1, 0, 0, // 08 - 0f + 1, 1, 1, 1, 1, 1, 1, 1, // 10 - 17 + 1, 1, 1, 0, 1, 1, 1, 1, // 18 - 1f + 1, 1, 1, 1, 1, 1, 1, 1, // 20 - 27 + 1, 1, 1, 1, 1, 1, 1, 1, // 28 - 2f + 1, 1, 1, 1, 1, 1, 1, 1, // 30 - 37 + 1, 1, 1, 1, 1, 1, 1, 1, // 38 - 3f + 2, 2, 2, 2, 2, 2, 2, 2, // 40 - 47 + 2, 2, 2, 2, 2, 2, 2, 2, // 48 - 4f + 2, 2, 2, 2, 2, 2, 2, 2, // 50 - 57 + 2, 2, 2, 2, 2, 2, 2, 2, // 58 - 5f + 2, 2, 2, 2, 2, 2, 2, 2, // 60 - 67 + 2, 2, 2, 2, 2, 2, 2, 2, // 68 - 6f + 2, 2, 2, 2, 2, 2, 2, 2, // 70 - 77 + 2, 2, 2, 2, 2, 2, 2, 1, // 78 - 7f + 3, 3, 3, 3, 3, 3, 3, 3, // 80 - 87 + 3, 3, 3, 3, 3, 3, 3, 3, // 88 - 8f + 3, 3, 3, 3, 3, 3, 3, 3, // 90 - 97 + 3, 3, 3, 3, 3, 3, 3, 3, // 98 - 9f + // 0xa0 is illegal in sjis encoding, but some pages does + // contain such byte. We need to be more error forgiven. + 2, 2, 2, 2, 2, 2, 2, 2, // a0 - a7 + 2, 2, 2, 2, 2, 2, 2, 2, // a8 - af + 2, 2, 2, 2, 2, 2, 2, 2, // b0 - b7 + 2, 2, 2, 2, 2, 2, 2, 2, // b8 - bf + 2, 2, 2, 2, 2, 2, 2, 2, // c0 - c7 + 2, 2, 2, 2, 2, 2, 2, 2, // c8 - cf + 2, 2, 2, 2, 2, 2, 2, 2, // d0 - d7 + 2, 2, 2, 2, 2, 2, 2, 2, // d8 - df + 3, 3, 3, 3, 3, 3, 3, 3, // e0 - e7 + 3, 3, 3, 3, 3, 4, 4, 4, // e8 - ef + 4, 4, 4, 4, 4, 4, 4, 4, // f0 - f7 + 4, 4, 4, 4, 4, 0, 0, 0 // f8 - ff + // clang-format on +}; + +static constexpr std::array SJIS_st{ + // clang-format off + eError, eStart, eStart, 3, eError, eError, // eStart + eError, eError, eError, eError, eError, eError, // eError + eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, // eItsMe + eError, eError, eStart, eStart, eStart, eStart // 3 + // clang-format on +}; + +static const unsigned int SJISCharLenTable[] = {0, 1, 1, 2, 0, 0}; + +static constexpr SMModel SJISSMModel{ + SJIS_cls, + 6, + SJIS_st, + SJISCharLenTable, + "Shift_JIS", +}; + +// Class table shared by UCS2LE and UCS2BE +static constexpr std::array UCS2_cls{ + // clang-format off + 0, 0, 0, 0, 0, 0, 0, 0, // 00 - 07 + 0, 0, 1, 0, 0, 2, 0, 0, // 08 - 0f + 0, 0, 0, 0, 0, 0, 0, 0, // 10 - 17 + 0, 0, 0, 0, 0, 0, 0, 0, // 18 - 1f + 0, 0, 0, 0, 0, 0, 0, 0, // 20 - 27 + 0, 0, 0, 0, 0, 0, 0, 0, // 28 - 2f + 0, 0, 0, 0, 0, 0, 0, 0, // 30 - 37 + 0, 0, 0, 0, 0, 0, 0, 0, // 38 - 3f + 0, 0, 0, 0, 0, 0, 0, 0, // 40 - 47 + 0, 0, 0, 0, 0, 0, 0, 0, // 48 - 4f + 0, 0, 0, 0, 0, 0, 0, 0, // 50 - 57 + 0, 0, 0, 0, 0, 0, 0, 0, // 58 - 5f + 0, 0, 0, 0, 0, 0, 0, 0, // 60 - 67 + 0, 0, 0, 0, 0, 0, 0, 0, // 68 - 6f + 0, 0, 0, 0, 0, 0, 0, 0, // 70 - 77 + 0, 0, 0, 0, 0, 0, 0, 0, // 78 - 7f + 0, 0, 0, 0, 0, 0, 0, 0, // 80 - 87 + 0, 0, 0, 0, 0, 0, 0, 0, // 88 - 8f + 0, 0, 0, 0, 0, 0, 0, 0, // 90 - 97 + 0, 0, 0, 0, 0, 0, 0, 0, // 98 - 9f + 0, 0, 0, 0, 0, 0, 0, 0, // a0 - a7 + 0, 0, 0, 0, 0, 0, 0, 0, // a8 - af + 0, 0, 0, 0, 0, 0, 0, 0, // b0 - b7 + 0, 0, 0, 0, 0, 0, 0, 0, // b8 - bf + 0, 0, 0, 0, 0, 0, 0, 0, // c0 - c7 + 0, 0, 0, 0, 0, 0, 0, 0, // c8 - cf + 0, 0, 0, 0, 0, 0, 0, 0, // d0 - d7 + 6, 6, 6, 6, 7, 7, 7, 7, // d8 - df + 0, 0, 0, 0, 0, 0, 0, 0, // e0 - e7 + 0, 0, 0, 0, 0, 0, 0, 0, // e8 - ef + 0, 0, 0, 0, 0, 0, 0, 0, // f0 - f7 + 0, 0, 0, 0, 0, 0, 4, 5 // f8 - ff + // clang-format on +}; + +// eStart and "6" are MSB states, "5" and "7" are LSB +// 9 is High Surrogate low byte +// 10 is Low Surrogate high byte +static constexpr std::array UCS2BE_st{ + // clang-format off + 5, 7, 7, eError, 4, 3, 9, eError, // 0 + eError, eError, eError, eError, eError, eError, eError, eError, // 1 + eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, // 2 + 6, 6, 6, 6, eError, eError, 9, 6, // 3 + 6, 6, 6, 6, 6, eItsMe, 6, 6, // 4 + 6, 6, 6, 6, 6, 6, 6, 6, // 5 + 5, 7, 7, eError, 5, 8, 9, eError, // 6 + 6, 6, eError, 6, 6, 6, 9, 6, // 7 + 6, 6, 6, 6, eError, eError, 9, 6, // 8 + 10, 10, 10, 10, 10, 10, 10, 10, // 9 + eError, eError, eError, eError, eError, eError, eError, 6 // 10 + // clang-format on +}; + +static const unsigned int UCS2BECharLenTable[] = {2, 2, 2, 0, 2, 2, 4, 4}; + +static constexpr SMModel UCS2BESMModel{ + UCS2_cls, + 8, + UCS2BE_st, + UCS2BECharLenTable, + "UTF-16BE", +}; + +// eStart and "5" are LSB states, "3", "4", "6", "7" and "8" are MSB +// 9 is Low Surrogate LSB +// 10 is Low Surrogate MSB +static constexpr std::array UCS2LE_st{ + // clang-format off + 6, 6, 7, 6, 4, 3, 6, 6, // 0 + eError, eError, eError, eError, eError, eError, eError, eError, // 1 + eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, // 2 + 5, 5, 5, eError, eItsMe, eError, 9, eError, // 3 + 5, 5, 5, eError, 5, eError, 9, eError, // 4 + 6, 6, 7, 6, 8, 8, 6, 6, // 5 + 5, 5, 5, eError, 5, 5, 9, eError, // 6 + 5, eError, eError, eError, 5, 5, 9, eError, // 7 + 5, 5, 5, eError, 5, eError, 9, eError, // 8 + 10, 10, 10, 10, 10, 10, 10, 10, // 9 + eError, eError, eError, eError, eError, eError, eError, 5 // 10 + // clang-format on +}; + +static const unsigned int UCS2LECharLenTable[] = {2, 2, 2, 2, 2, 2, 4, 4}; + +static constexpr SMModel UCS2LESMModel{ + UCS2_cls, + 8, + UCS2LE_st, + UCS2LECharLenTable, + "UTF-16LE", +}; + +static constexpr std::array UTF8_cls{ + // clang-format off + // 0,1,1,1,1,1,1,1, // 00 - 07 + 1, 1, 1, 1, 1, 1, 1, 1, // 00 - 07 //allow 0x00 as a legal value + 1, 1, 1, 1, 1, 1, 0, 0, // 08 - 0f + 1, 1, 1, 1, 1, 1, 1, 1, // 10 - 17 + 1, 1, 1, 0, 1, 1, 1, 1, // 18 - 1f + 1, 1, 1, 1, 1, 1, 1, 1, // 20 - 27 + 1, 1, 1, 1, 1, 1, 1, 1, // 28 - 2f + 1, 1, 1, 1, 1, 1, 1, 1, // 30 - 37 + 1, 1, 1, 1, 1, 1, 1, 1, // 38 - 3f + 1, 1, 1, 1, 1, 1, 1, 1, // 40 - 47 + 1, 1, 1, 1, 1, 1, 1, 1, // 48 - 4f + 1, 1, 1, 1, 1, 1, 1, 1, // 50 - 57 + 1, 1, 1, 1, 1, 1, 1, 1, // 58 - 5f + 1, 1, 1, 1, 1, 1, 1, 1, // 60 - 67 + 1, 1, 1, 1, 1, 1, 1, 1, // 68 - 6f + 1, 1, 1, 1, 1, 1, 1, 1, // 70 - 77 + 1, 1, 1, 1, 1, 1, 1, 1, // 78 - 7f + 2, 2, 2, 2, 2, 2, 2, 2, // 80 - 87 + 2, 2, 2, 2, 2, 2, 2, 2, // 88 - 8f + 3, 3, 3, 3, 3, 3, 3, 3, // 90 - 97 + 3, 3, 3, 3, 3, 3, 3, 3, // 98 - 9f + 4, 4, 4, 4, 4, 4, 4, 4, // a0 - a7 + 4, 4, 4, 4, 4, 4, 4, 4, // a8 - af + 4, 4, 4, 4, 4, 4, 4, 4, // b0 - b7 + 4, 4, 4, 4, 4, 4, 4, 4, // b8 - bf + 0, 0, 5, 5, 5, 5, 5, 5, // c0 - c7 + 5, 5, 5, 5, 5, 5, 5, 5, // c8 - cf + 5, 5, 5, 5, 5, 5, 5, 5, // d0 - d7 + 5, 5, 5, 5, 5, 5, 5, 5, // d8 - df + 6, 7, 7, 7, 7, 7, 7, 7, // e0 - e7 + 7, 7, 7, 7, 7, 8, 7, 7, // e7 - ef + 9, 10, 10, 10, 11, 0, 0, 0, // f0 - f7 + 0, 0, 0, 0, 0, 0, 0, 0 // f8 - ff + // clang-format on +}; + +static constexpr std::array UTF8_st{ + // clang-format off + // byteclass: + // 0 1 2 3 4 5 6 7 8 9 10 11 + eError, eStart, eError, eError, eError, 3, 4, 5, 6, 7, 8, 9, // eStart + eError, eError, eError, eError, eError, eError, eError, eError, eError, eError, eError, eError, // eError + eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, // eItsMe + eError, eError, eStart, eStart, eStart, eError, eError, eError, eError, eError, eError, eError, // 3 + eError, eError, eError, eError, 3, eError, eError, eError, eError, eError, eError, eError, // 4 + eError, eError, 3, 3, 3, eError, eError, eError, eError, eError, eError, eError, // 5 + eError, eError, 3, 3, eError, eError, eError, eError, eError, eError, eError, eError, // 6 + eError, eError, eError, 5, 5, eError, eError, eError, eError, eError, eError, eError, // 7 + eError, eError, 5, 5, 5, eError, eError, eError, eError, eError, eError, eError, // 8 + eError, eError, 5, eError, eError, eError, eError, eError, eError, eError, eError, eError // 9 + // clang-format on +}; + +static const unsigned int UTF8CharLenTable[] = {0, 1, 1, 1, 1, 1, 2, 3, 3, 3, 4, 4}; + +static constexpr SMModel UTF8SMModel{ + UTF8_cls, + 12, + UTF8_st, + UTF8CharLenTable, + "UTF-8", +}; +} +#endif // nsMBCSSM_h__ diff --git a/local/recipes/kde/kf6-kcolorscheme/add-frameContrast.patch b/local/recipes/kde/kf6-kcolorscheme/add-frameContrast.patch new file mode 100644 index 0000000000..42365bbd0d --- /dev/null +++ b/local/recipes/kde/kf6-kcolorscheme/add-frameContrast.patch @@ -0,0 +1,25 @@ +--- a/src/kcolorscheme.h ++++ b/src/kcolorscheme.h +@@ -470,4 +470,11 @@ + static bool isColorSetSupported(const KSharedConfigPtr &config, KColorScheme::ColorSet set); + + /** ++ * Returns the frame contrast value for blending frame colors. ++ * Must stay in sync with Kirigami::PlatformTheme::frameContrast(). ++ * @since 6.27 ++ */ ++ static qreal frameContrast(); ++ ++ /** + * @since 5.92 +--- a/src/kcolorscheme.cpp ++++ b/src/kcolorscheme.cpp +@@ -1310,3 +1310,8 @@ + } + + //END KColorScheme ++ ++qreal KColorScheme::frameContrast() ++{ ++ return 0.20; ++} diff --git a/local/recipes/kde/kf6-kcolorscheme/source/LICENSES/CC-BY-SA-4.0.txt b/local/recipes/kde/kf6-kcolorscheme/source/LICENSES/CC-BY-SA-4.0.txt new file mode 100644 index 0000000000..835a6836b3 --- /dev/null +++ b/local/recipes/kde/kf6-kcolorscheme/source/LICENSES/CC-BY-SA-4.0.txt @@ -0,0 +1,170 @@ +Creative Commons Attribution-ShareAlike 4.0 International + + Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. + +Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors. + +Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. + +Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public. + +Creative Commons Attribution-ShareAlike 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. + +Section 1 – Definitions. + + a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. + + c. BY-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses, approved by Creative Commons as essentially the equivalent of this Public License. + + d. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. + + e. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. + + f. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. + + g. License Elements means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution and ShareAlike. + + h. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. + + i. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. + + j. Licensor means the individual(s) or entity(ies) granting rights under this Public License. + + k. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. + + l. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. + + m. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. + +Section 2 – Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: + + A. reproduce and Share the Licensed Material, in whole or in part; and + + B. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. + + 3. Term. The term of this Public License is specified in Section 6(a). + + 4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. + + 5. Downstream recipients. + + A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. + + B. Additional offer from the Licensor – Adapted Material. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply. + + C. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. + + 6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this Public License. + + 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. + +Section 3 – License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified form), You must: + + A. retain the following if it is supplied by the Licensor with the Licensed Material: + + i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of warranties; + + v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; + + B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and + + C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. + + 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. + + b. ShareAlike.In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply. + + 1. The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-SA Compatible License. + + 2. You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material. + + 3. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply. + +Section 4 – Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; + + b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and + + c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. +For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. + +Section 5 – Disclaimer of Warranties and Limitation of Liability. + + a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You. + + b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You. + + c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. + +Section 6 – Term and Termination. + + a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or + + 2. upon express reinstatement by the Licensor. + + c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. + + d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. + + e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. + +Section 7 – Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. + +Section 8 – Interpretation. + + a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. + + c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. + + d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. + +Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. + +Creative Commons may be contacted at creativecommons.org. diff --git a/local/recipes/kde/kf6-kcolorscheme/source/po/ga/kcolorscheme6.po b/local/recipes/kde/kf6-kcolorscheme/source/po/ga/kcolorscheme6.po new file mode 100644 index 0000000000..cad21a2a98 --- /dev/null +++ b/local/recipes/kde/kf6-kcolorscheme/source/po/ga/kcolorscheme6.po @@ -0,0 +1,24 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR This file is copyright: +# This file is distributed under the same license as the kcolorscheme package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: kcolorscheme\n" +"Report-Msgid-Bugs-To: https://bugs.kde.org\n" +"POT-Creation-Date: 2025-11-17 11:49+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Irish Gaelic \n" +"Language: ga\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=5; plural=n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n < 11 ? " +"3 : 4\n" + +#: kcolorschememodel.cpp:73 +#, kde-format +msgid "Default" +msgstr "" diff --git a/local/recipes/kde/kf6-kcolorscheme/source/po/ug/kcolorscheme6.po b/local/recipes/kde/kf6-kcolorscheme/source/po/ug/kcolorscheme6.po new file mode 100644 index 0000000000..5eac49da26 --- /dev/null +++ b/local/recipes/kde/kf6-kcolorscheme/source/po/ug/kcolorscheme6.po @@ -0,0 +1,24 @@ +# Uyghur translation for kcolorscheme6. +# Copyright (C) YEAR This file is copyright: +# This file is distributed under the same license as the kcolorscheme package. +# Abduqadir Abliz , 2026., YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: kcolorscheme\n" +"Report-Msgid-Bugs-To: https://bugs.kde.org\n" +"POT-Creation-Date: 2025-11-17 11:49+0000\n" +"PO-Revision-Date: 2026-05-30 17:10-0400\n" +"Last-Translator: Abduqadir Abliz \n" +"Language-Team: Uyghur \n" +"Language: ug\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.9\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: kcolorschememodel.cpp:73 +#, kde-format +msgid "Default" +msgstr "كۆڭۈلدىكى" diff --git a/local/recipes/kde/kf6-kcolorscheme/source/src/kcolorscheme-index.qdoc b/local/recipes/kde/kf6-kcolorscheme/source/src/kcolorscheme-index.qdoc new file mode 100644 index 0000000000..17ca289ed5 --- /dev/null +++ b/local/recipes/kde/kf6-kcolorscheme/source/src/kcolorscheme-index.qdoc @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: None + +/*! + \page kcolorscheme-index.html + \title KColorScheme + + Classes to interact with KColorScheme. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {ColorScheme} {KF6::ColorScheme} + + \section1 API Reference + + \list + \li \l{KColorScheme C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kcolorscheme/source/src/kcolorscheme.qdoc b/local/recipes/kde/kf6-kcolorscheme/source/src/kcolorscheme.qdoc new file mode 100644 index 0000000000..fea0690d48 --- /dev/null +++ b/local/recipes/kde/kf6-kcolorscheme/source/src/kcolorscheme.qdoc @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: None + +/*! + \module KColorScheme + \title KColorScheme C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent ColorScheme + + \brief Classes to interact with KColorScheme. +*/ diff --git a/local/recipes/kde/kf6-kcolorscheme/source/src/kcolorscheme.qdocconf b/local/recipes/kde/kf6-kcolorscheme/source/src/kcolorscheme.qdocconf new file mode 100644 index 0000000000..6526116920 --- /dev/null +++ b/local/recipes/kde/kf6-kcolorscheme/source/src/kcolorscheme.qdocconf @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: CC-BY-SA-4.0 +# SPDX-FileCopyrightText: None + +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KColorScheme +description = Classes to interact with KColorScheme. + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +navigation.landingpage = "KColorScheme" + +outputformats = HTML + +depends += \ + kde \ + qtcore \ + qtgui \ + qtwidgets \ + kconfigcore \ + kguiaddons \ + kconfigwidgets + +qhp.projects = KColorScheme + +qhp.KColorScheme.file = kcolorscheme.qhp +qhp.KColorScheme.namespace = org.kde.kcolorscheme.$QT_VERSION_TAG +qhp.KColorScheme.virtualFolder = kcolorscheme +qhp.KColorScheme.indexTitle = KColorScheme +qhp.KColorScheme.indexRoot = + +qhp.KColorScheme.subprojects = classes +qhp.KColorScheme.subprojects.classes.title = C++ Classes +qhp.KColorScheme.subprojects.classes.indexTitle = KColorScheme C++ Classes +qhp.KColorScheme.subprojects.classes.selectors = class fake:headerfile +qhp.KColorScheme.subprojects.classes.sortPages = true + +tagfile = kcolorscheme.tags diff --git a/local/recipes/kde/kf6-kcompletion/source/src/kcompletion-index.qdoc b/local/recipes/kde/kf6-kcompletion/source/src/kcompletion-index.qdoc new file mode 100644 index 0000000000..ac2889a89e --- /dev/null +++ b/local/recipes/kde/kf6-kcompletion/source/src/kcompletion-index.qdoc @@ -0,0 +1,20 @@ +/*! + \page kcompletion-index.html + \title KCompletion + + Text completion helpers and widgets + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {Kf6} {Completion} {KF6::Completion} + + \section1 API Reference + + \list + \li \l{KCompletion C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kcompletion/source/src/kcompletion.qdoc b/local/recipes/kde/kf6-kcompletion/source/src/kcompletion.qdoc new file mode 100644 index 0000000000..c92437b680 --- /dev/null +++ b/local/recipes/kde/kf6-kcompletion/source/src/kcompletion.qdoc @@ -0,0 +1,9 @@ +/*! + \module KCompletion + \title KCompletion C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Completion + + \brief Text completion helpers and widgets. +*/ diff --git a/local/recipes/kde/kf6-kcompletion/source/src/kcompletion.qdocconf b/local/recipes/kde/kf6-kcompletion/source/src/kcompletion.qdocconf new file mode 100644 index 0000000000..dd93dc8ccc --- /dev/null +++ b/local/recipes/kde/kf6-kcompletion/source/src/kcompletion.qdocconf @@ -0,0 +1,38 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KCompletion +description = Text completion helpers and widgets + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +imagedirs += ../docs/pics + +outputformats = HTML + +navigation.landingpage = "KCompletion" + +depends += \ + kde \ + qtcore \ + qtgui \ + qtwidgets \ + kcodecs + +qhp.projects = KCompletion + +qhp.KCompletion.file = kcompletion.qhp +qhp.KCompletion.namespace = org.kde.kcompletion.$QT_VERSION_TAG +qhp.KCompletion.virtualFolder = kcompletion +qhp.KCompletion.indexTitle = KCompletion +qhp.KCompletion.indexRoot = + +qhp.KCompletion.subprojects = classes +qhp.KCompletion.subprojects.classes.title = C++ Classes +qhp.KCompletion.subprojects.classes.indexTitle = KCompletion C++ Classes +qhp.KCompletion.subprojects.classes.selectors = class fake:headerfile +qhp.KCompletion.subprojects.classes.sortPages = true + +tagfile = kcompletion.tags diff --git a/local/recipes/kde/kf6-kconfig/source/LICENSES/CC-BY-SA-4.0.txt b/local/recipes/kde/kf6-kconfig/source/LICENSES/CC-BY-SA-4.0.txt new file mode 100644 index 0000000000..835a6836b3 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/LICENSES/CC-BY-SA-4.0.txt @@ -0,0 +1,170 @@ +Creative Commons Attribution-ShareAlike 4.0 International + + Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. + +Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors. + +Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. + +Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public. + +Creative Commons Attribution-ShareAlike 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. + +Section 1 – Definitions. + + a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. + + c. BY-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses, approved by Creative Commons as essentially the equivalent of this Public License. + + d. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. + + e. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. + + f. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. + + g. License Elements means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution and ShareAlike. + + h. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. + + i. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. + + j. Licensor means the individual(s) or entity(ies) granting rights under this Public License. + + k. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. + + l. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. + + m. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. + +Section 2 – Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: + + A. reproduce and Share the Licensed Material, in whole or in part; and + + B. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. + + 3. Term. The term of this Public License is specified in Section 6(a). + + 4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. + + 5. Downstream recipients. + + A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. + + B. Additional offer from the Licensor – Adapted Material. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply. + + C. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. + + 6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this Public License. + + 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. + +Section 3 – License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified form), You must: + + A. retain the following if it is supplied by the Licensor with the Licensed Material: + + i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of warranties; + + v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; + + B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and + + C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. + + 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. + + b. ShareAlike.In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply. + + 1. The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-SA Compatible License. + + 2. You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material. + + 3. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply. + +Section 4 – Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; + + b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and + + c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. +For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. + +Section 5 – Disclaimer of Warranties and Limitation of Liability. + + a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You. + + b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You. + + c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. + +Section 6 – Term and Termination. + + a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or + + 2. upon express reinstatement by the Licensor. + + c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. + + d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. + + e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. + +Section 7 – Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. + +Section 8 – Interpretation. + + a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. + + c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. + + d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. + +Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. + +Creative Commons may be contacted at creativecommons.org. diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/data/crash1 b/local/recipes/kde/kf6-kconfig/source/autotests/data/crash1 new file mode 100644 index 0000000000..9a8f943523 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/data/crash1 @@ -0,0 +1,2 @@ +[General] +a[$e]=I$$$$$$$$$$$$$$$$$$$$$$${ diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/Test16Qml.qml b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/Test16Qml.qml new file mode 100644 index 0000000000..7779c50f8a --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/Test16Qml.qml @@ -0,0 +1,13 @@ +/* + SPDX-FileCopyrightText: 2024 Joshua Goins + + SPDX-License-Identifier: MIT +*/ + +import QtQuick +import org.kde.kconfig.test16 + +Item { + property url dir: TestCfg.picturesDir + property double brightness: TestCfg.brightness +} diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/Test17Qml.qml b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/Test17Qml.qml new file mode 100644 index 0000000000..aa69a5e58f --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/Test17Qml.qml @@ -0,0 +1,14 @@ +/* + SPDX-FileCopyrightText: 2025 Julius Künzel + + SPDX-License-Identifier: MIT +*/ + +import QtQuick +import org.kde.kconfig.test17 + +Item { + property url dir: Test17.picturesDir + property double brightness: Test17.brightness + property double brightnessDefault: Test17.defaultBrightnessValue +} diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/Test19Qml.qml b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/Test19Qml.qml new file mode 100644 index 0000000000..dc59d9b1c9 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/Test19Qml.qml @@ -0,0 +1,14 @@ +/* + SPDX-FileCopyrightText: 2026 Nicolas Fella + + SPDX-License-Identifier: MIT +*/ + +import QtQuick +import org.kde.kconfig.test19 + +Item { + property url dir: Test19.picturesDir + property double brightness: Test19.brightness + property double brightnessDefault: Test19.defaultBrightnessValue +} diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test16.cpp.ref b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test16.cpp.ref new file mode 100644 index 0000000000..c718d276ba --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test16.cpp.ref @@ -0,0 +1,38 @@ +// This file is generated by kconfig_compiler_kf6 from test16.kcfg. +// All changes you do to this file will be lost. + +#include "test16.h" + +Test16::Test16( ) + : KConfigSkeleton( QStringLiteral( "muondatasourcesrc" ) ) +{ + KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast(&Test16::itemChanged); + + setCurrentGroup( QStringLiteral( "kamoso" ) ); + + KConfigSkeleton::ItemUrl *itemPicturesDir; + itemPicturesDir = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "picturesDir" ), mPicturesDir ); + addItem( itemPicturesDir, QStringLiteral( "picturesDir" ) ); + KConfigCompilerSignallingItem *itemBrightness; + KConfigSkeleton::ItemDouble *innerItemBrightness; + innerItemBrightness = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "brightness" ), mBrightness ); + itemBrightness = new KConfigCompilerSignallingItem(innerItemBrightness, this, notifyFunction, signalBrightnessChanged); + addItem( itemBrightness, QStringLiteral( "brightness" ) ); + KConfigSkeleton::ItemBool *itemStartsWithUppercase; + itemStartsWithUppercase = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "StartsWithUppercase" ), mStartsWithUppercase ); + addItem( itemStartsWithUppercase, QStringLiteral( "StartsWithUppercase" ) ); +} + +Test16::~Test16() +{ +} + + +void Test16::itemChanged(quint64 signalFlag) { + + switch (signalFlag) { + case signalBrightnessChanged: + Q_EMIT brightnessChanged(); + break; + } +} diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test16.h.ref b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test16.h.ref new file mode 100644 index 0000000000..cb6cc4eefc --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test16.h.ref @@ -0,0 +1,107 @@ +// This file is generated by kconfig_compiler_kf6 from test16.kcfg. +// All changes you do to this file will be lost. +#ifndef TEST16_H +#define TEST16_H + +#include +#include +#include +#include +#include + +class Test16 : public KConfigSkeleton +{ + Q_OBJECT + QML_ELEMENT + QML_UNCREATABLE("") + public: + + Test16( ); + ~Test16() override; + + Q_PROPERTY(QUrl picturesDir READ picturesDir CONSTANT) + Q_PROPERTY(bool isPicturesDirImmutable READ isPicturesDirImmutable CONSTANT) + /** + Get picturesDir + */ + QUrl picturesDir() const + { + return mPicturesDir; + } + + /** + Is picturesDir Immutable + */ + bool isPicturesDirImmutable() const + { + return isImmutable( QStringLiteral( "picturesDir" ) ); + } + + /** + Set brightness + */ + void setBrightness( double v ) + { + if (v != mBrightness && !isBrightnessImmutable()) { + mBrightness = v; + Q_EMIT brightnessChanged(); + } + } + + Q_PROPERTY(double brightness READ brightness WRITE setBrightness NOTIFY brightnessChanged) + Q_PROPERTY(bool isBrightnessImmutable READ isBrightnessImmutable CONSTANT) + /** + Get brightness + */ + double brightness() const + { + return mBrightness; + } + + /** + Is brightness Immutable + */ + bool isBrightnessImmutable() const + { + return isImmutable( QStringLiteral( "brightness" ) ); + } + + Q_PROPERTY(bool startsWithUppercase READ startsWithUppercase CONSTANT) + Q_PROPERTY(bool isStartsWithUppercaseImmutable READ isStartsWithUppercaseImmutable CONSTANT) + /** + Get StartsWithUppercase + */ + bool startsWithUppercase() const + { + return mStartsWithUppercase; + } + + /** + Is StartsWithUppercase Immutable + */ + bool isStartsWithUppercaseImmutable() const + { + return isImmutable( QStringLiteral( "StartsWithUppercase" ) ); + } + + + enum { + signalBrightnessChanged = 1 + }; + + Q_SIGNALS: + void brightnessChanged(); + + private: + void itemChanged(quint64 signalFlag); + + protected: + + // kamoso + QUrl mPicturesDir; + double mBrightness; + bool mStartsWithUppercase; +}; + +#endif + diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test16.kcfg b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test16.kcfg new file mode 100644 index 0000000000..cf78c70e9b --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test16.kcfg @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test16.kcfgc b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test16.kcfgc new file mode 100644 index 0000000000..eca761a61f --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test16.kcfgc @@ -0,0 +1,6 @@ +ClassName=Test16 +GenerateProperties=true +Mutators=brightness +File=test16.kcfg +QmlRegistration=true +QmlUncreatable=true diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test16main.cpp b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test16main.cpp new file mode 100644 index 0000000000..479e6bb943 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test16main.cpp @@ -0,0 +1,12 @@ +/* + SPDX-FileCopyrightText: 2024 Joshua Goins + + SPDX-License-Identifier: MIT +*/ +#include "test16.h" + +int main(int, char **) +{ + QStandardPaths::setTestModeEnabled(true); + return 0; +} diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test16qml.cpp b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test16qml.cpp new file mode 100644 index 0000000000..03f7c9dd7a --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test16qml.cpp @@ -0,0 +1,34 @@ +/* + SPDX-FileCopyrightText: 2024 Joshua Goins + + SPDX-License-Identifier: MIT +*/ + +#include +#include +#include + +#include "test16.h" + +class Test16Qml : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void testQml() + { + QQmlApplicationEngine engine; + + Test16 cfg; + + qmlRegisterSingletonInstance("org.kde.kconfig.test16", 1, 0, "TestCfg", &cfg); + + engine.loadFromModule("org.kde.kconfig.test16", "Test16Qml"); + + QVERIFY(!engine.rootObjects().isEmpty()); + } +}; + +QTEST_MAIN(Test16Qml) + +#include "test16qml.moc" diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test17.cpp.ref b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test17.cpp.ref new file mode 100644 index 0000000000..c2521215f9 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test17.cpp.ref @@ -0,0 +1,76 @@ +// This file is generated by kconfig_compiler_kf6 from test17.kcfg. +// All changes you do to this file will be lost. + +#include "test17.h" + +#include +#include +#include + +class Test17Helper +{ + public: + Test17Helper() noexcept : q(nullptr) {} + ~Test17Helper() noexcept { delete q; q = nullptr; } + Test17Helper(const Test17Helper&) = delete; + Test17Helper& operator=(const Test17Helper&) = delete; + Test17 *q; +}; +Q_GLOBAL_STATIC(Test17Helper, s_globalTest17) +Test17 *Test17::self() +{ + if (!s_globalTest17()->q) { + new Test17; + s_globalTest17()->q->read(); + } + + return s_globalTest17()->q; +} + +Test17 *Test17::create(QQmlEngine *, QJSEngine *) +{ + QQmlEngine::setObjectOwnership(self(), QQmlEngine::CppOwnership); + return self(); +} + +Test17::Test17( ) + : KConfigSkeleton( QStringLiteral( "muondatasourcesrc" ) ) +{ + Q_ASSERT(!s_globalTest17()->q); + s_globalTest17()->q = this; + KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast(&Test17::itemChanged); + + setCurrentGroup( QStringLiteral( "kamoso" ) ); + + KConfigSkeleton::ItemUrl *itemPicturesDir; + itemPicturesDir = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "picturesDir" ), mPicturesDir ); + addItem( itemPicturesDir, QStringLiteral( "picturesDir" ) ); + KConfigCompilerSignallingItem *itemBrightness; + KConfigSkeleton::ItemDouble *innerItemBrightness; + innerItemBrightness = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "brightness" ), mBrightness, 5.7 ); + itemBrightness = new KConfigCompilerSignallingItem(innerItemBrightness, this, notifyFunction, signalBrightnessChanged); + addItem( itemBrightness, QStringLiteral( "brightness" ) ); +} + +double Test17::defaultBrightnessValue_helper() +{ + + return 5.7; +} + +Test17::~Test17() +{ + if (s_globalTest17.exists() && !s_globalTest17.isDestroyed()) { + s_globalTest17()->q = nullptr; + } +} + + +void Test17::itemChanged(quint64 signalFlag) { + + switch (signalFlag) { + case signalBrightnessChanged: + Q_EMIT brightnessChanged(); + break; + } +} diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test17.h.ref b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test17.h.ref new file mode 100644 index 0000000000..7b3107bc24 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test17.h.ref @@ -0,0 +1,111 @@ +// This file is generated by kconfig_compiler_kf6 from test17.kcfg. +// All changes you do to this file will be lost. +#ifndef TEST17_H +#define TEST17_H + +#include +#include +#include +#include + +class QQmlEngine; +class QJSEngine; + +class Test17 : public KConfigSkeleton +{ + Q_OBJECT + QML_ELEMENT + QML_SINGLETON + public: + + static Test17 *self(); + static Test17 *create(QQmlEngine *, QJSEngine *); + ~Test17() override; + + Q_PROPERTY(QUrl picturesDir READ picturesDir CONSTANT) + Q_PROPERTY(bool isPicturesDirImmutable READ isPicturesDirImmutable CONSTANT) + /** + Get picturesDir + */ + static + QUrl picturesDir() + { + return self()->mPicturesDir; + } + + /** + Is picturesDir Immutable + */ + static + bool isPicturesDirImmutable() + { + return self()->isImmutable( QStringLiteral( "picturesDir" ) ); + } + + /** + Set brightness + */ + static + void setBrightness( double v ) + { + if (v != self()->mBrightness && !self()->isBrightnessImmutable()) { + self()->mBrightness = v; + Q_EMIT self()->brightnessChanged(); + } + } + + Q_PROPERTY(double brightness READ brightness WRITE setBrightness NOTIFY brightnessChanged) + Q_PROPERTY(bool isBrightnessImmutable READ isBrightnessImmutable CONSTANT) + Q_PROPERTY(double defaultBrightnessValue READ defaultBrightnessValue CONSTANT) + /** + Get brightness + */ + static + double brightness() + { + return self()->mBrightness; + } + + /** + Is brightness Immutable + */ + static + bool isBrightnessImmutable() + { + return self()->isImmutable( QStringLiteral( "brightness" ) ); + } + + /** + Get brightness default value + */ + static + double defaultBrightnessValue() + { + return defaultBrightnessValue_helper(); + } + + + enum { + signalBrightnessChanged = 1 + }; + + Q_SIGNALS: + void brightnessChanged(); + + private: + void itemChanged(quint64 signalFlag); + + protected: + Test17(); + friend class Test17Helper; + + + // kamoso + QUrl mPicturesDir; + static QUrl defaultPicturesDirValue_helper(); + double mBrightness; + static double defaultBrightnessValue_helper(); +}; + +#endif + diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test17.kcfg b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test17.kcfg new file mode 100644 index 0000000000..621aadf83d --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test17.kcfg @@ -0,0 +1,13 @@ + + + + + + + 5.7 + + + diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test17.kcfgc b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test17.kcfgc new file mode 100644 index 0000000000..3eb725c9c5 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test17.kcfgc @@ -0,0 +1,7 @@ +ClassName=Test17 +GenerateProperties=true +Mutators=brightness +File=test17.kcfg +QmlRegistration=true +Singleton=true +DefaultValueGetters=true diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test17main.cpp b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test17main.cpp new file mode 100644 index 0000000000..130c05ac5b --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test17main.cpp @@ -0,0 +1,13 @@ +/* + SPDX-FileCopyrightText: 2003 Cornelius Schumacher + + SPDX-License-Identifier: MIT +*/ +#include "test17.h" + +int main(int, char **) +{ + QStandardPaths::setTestModeEnabled(true); + Test17::self(); + return 0; +} diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test17qml.cpp b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test17qml.cpp new file mode 100644 index 0000000000..f7e006cb25 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test17qml.cpp @@ -0,0 +1,28 @@ +/* + SPDX-FileCopyrightText: 2025 Julius Künzel + + SPDX-License-Identifier: MIT +*/ + +#include +#include +#include + +class Test17Qml : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void testQml() + { + QQmlApplicationEngine engine; + + engine.loadFromModule("org.kde.kconfig.test17", "Test17Qml"); + + QVERIFY(!engine.rootObjects().isEmpty()); + } +}; + +QTEST_MAIN(Test17Qml) + +#include "test17qml.moc" diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test18.cpp.ref b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test18.cpp.ref new file mode 100644 index 0000000000..8567cb247b --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test18.cpp.ref @@ -0,0 +1,107 @@ +// This file is generated by kconfig_compiler_kf6 from test18.kcfg. +// All changes you do to this file will be lost. + +#include "test18.h" + +#include +#include +#include + +class Test18Helper +{ + public: + Test18Helper() noexcept : q(nullptr) {} + ~Test18Helper() noexcept { delete q; q = nullptr; } + Test18Helper(const Test18Helper&) = delete; + Test18Helper& operator=(const Test18Helper&) = delete; + Test18 *q; +}; +Q_GLOBAL_STATIC(Test18Helper, s_globalTest18) +Test18 *Test18::self() +{ + if (!s_globalTest18()->q) { + new Test18; + s_globalTest18()->q->read(); + } + + return s_globalTest18()->q; +} + +Test18 *Test18::create(QQmlEngine *, QJSEngine *) +{ + QQmlEngine::setObjectOwnership(self(), QQmlEngine::CppOwnership); + return self(); +} + +Test18::Test18( ) + : KConfigSkeleton( QStringLiteral( "muondatasourcesrc" ) ) +{ + Q_ASSERT(!s_globalTest18()->q); + s_globalTest18()->q = this; + KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast(&Test18::itemChanged); + + setCurrentGroup( QStringLiteral( "kamoso" ) ); + + KConfigSkeleton::ItemInt *itemSize; + itemSize = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "size" ), mSize, 13 ); + addItem( itemSize, QStringLiteral( "size" ) ); + QStringList defaultfoos; + defaultfoos.append( QString::fromUtf8( "Foo" ) ); + defaultfoos.append( QString::fromUtf8( "Bar" ) ); + + KConfigSkeleton::ItemStringList *itemFoos; + itemFoos = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "foos" ), mFoos, defaultfoos ); + addItem( itemFoos, QStringLiteral( "foos" ) ); + KConfigSkeleton::ItemUrl *itemPicturesDir; + itemPicturesDir = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "picturesDir" ), mPicturesDir, QUrl::fromUserInput( QStringLiteral( "Bar" )) ); + addItem( itemPicturesDir, QStringLiteral( "picturesDir" ) ); + KConfigCompilerSignallingItem *itemBrightness; + KConfigSkeleton::ItemString *innerItemBrightness; + innerItemBrightness = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "brightness" ), mBrightness, QStringLiteral( "Foo" ) ); + itemBrightness = new KConfigCompilerSignallingItem(innerItemBrightness, this, notifyFunction, signalBrightnessChanged); + addItem( itemBrightness, QStringLiteral( "brightness" ) ); +} + +int Test18::defaultSizeValue_helper() +{ + + return 13; +} + +QStringList Test18::defaultFoosValue_helper() +{ + QStringList defaultfoos; + defaultfoos.append( QString::fromUtf8( "Foo" ) ); + defaultfoos.append( QString::fromUtf8( "Bar" ) ); + + return defaultfoos; +} + +QUrl Test18::defaultPicturesDirValue_helper() +{ + + return QUrl::fromUserInput( QStringLiteral( "Bar" )); +} + +QString Test18::defaultBrightnessValue_helper() +{ + + return QStringLiteral( "Foo" ); +} + +Test18::~Test18() +{ + if (s_globalTest18.exists() && !s_globalTest18.isDestroyed()) { + s_globalTest18()->q = nullptr; + } +} + + +void Test18::itemChanged(quint64 signalFlag) { + + switch (signalFlag) { + case signalBrightnessChanged: + Q_EMIT brightnessChanged(); + break; + } +} diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test18.h.ref b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test18.h.ref new file mode 100644 index 0000000000..c9e2230b9e --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test18.h.ref @@ -0,0 +1,185 @@ +// This file is generated by kconfig_compiler_kf6 from test18.kcfg. +// All changes you do to this file will be lost. +#ifndef TEST18_H +#define TEST18_H + +#include +#include +#include +#include + +class QQmlEngine; +class QJSEngine; + +class Test18 : public KConfigSkeleton +{ + Q_OBJECT + QML_ELEMENT + QML_SINGLETON + public: + + static Test18 *self(); + static Test18 *create(QQmlEngine *, QJSEngine *); + ~Test18() override; + + Q_PROPERTY(int size READ size CONSTANT) + Q_PROPERTY(bool isSizeImmutable READ isSizeImmutable CONSTANT) + Q_PROPERTY(int defaultSizeValue READ defaultSizeValue CONSTANT) + /** + Get size + */ + static + int size() + { + return self()->mSize; + } + + /** + Is size Immutable + */ + static + bool isSizeImmutable() + { + return self()->isImmutable( QStringLiteral( "size" ) ); + } + + /** + Get size default value + */ + static + int defaultSizeValue() + { + return defaultSizeValue_helper(); + } + + Q_PROPERTY(QStringList foos READ foos CONSTANT) + Q_PROPERTY(bool isFoosImmutable READ isFoosImmutable CONSTANT) + Q_PROPERTY(QStringList defaultFoosValue READ defaultFoosValue CONSTANT) + /** + Get foos + */ + static + QStringList foos() + { + return self()->mFoos; + } + + /** + Is foos Immutable + */ + static + bool isFoosImmutable() + { + return self()->isImmutable( QStringLiteral( "foos" ) ); + } + + /** + Get foos default value + */ + static + QStringList defaultFoosValue() + { + return defaultFoosValue_helper(); + } + + Q_PROPERTY(QUrl picturesDir READ picturesDir CONSTANT) + Q_PROPERTY(bool isPicturesDirImmutable READ isPicturesDirImmutable CONSTANT) + Q_PROPERTY(QUrl defaultPicturesDirValue READ defaultPicturesDirValue CONSTANT) + /** + Get picturesDir + */ + static + QUrl picturesDir() + { + return self()->mPicturesDir; + } + + /** + Is picturesDir Immutable + */ + static + bool isPicturesDirImmutable() + { + return self()->isImmutable( QStringLiteral( "picturesDir" ) ); + } + + /** + Get picturesDir default value + */ + static + QUrl defaultPicturesDirValue() + { + return defaultPicturesDirValue_helper(); + } + + /** + Set brightness + */ + static + void setBrightness( const QString & v ) + { + if (v != self()->mBrightness && !self()->isBrightnessImmutable()) { + self()->mBrightness = v; + Q_EMIT self()->brightnessChanged(); + } + } + + Q_PROPERTY(QString brightness READ brightness WRITE setBrightness NOTIFY brightnessChanged) + Q_PROPERTY(bool isBrightnessImmutable READ isBrightnessImmutable CONSTANT) + Q_PROPERTY(QString defaultBrightnessValue READ defaultBrightnessValue CONSTANT) + /** + Get brightness + */ + static + QString brightness() + { + return self()->mBrightness; + } + + /** + Is brightness Immutable + */ + static + bool isBrightnessImmutable() + { + return self()->isImmutable( QStringLiteral( "brightness" ) ); + } + + /** + Get brightness default value + */ + static + QString defaultBrightnessValue() + { + return defaultBrightnessValue_helper(); + } + + + enum { + signalBrightnessChanged = 1 + }; + + Q_SIGNALS: + void brightnessChanged(); + + private: + void itemChanged(quint64 signalFlag); + + protected: + Test18(); + friend class Test18Helper; + + + // kamoso + int mSize; + static int defaultSizeValue_helper(); + QStringList mFoos; + static QStringList defaultFoosValue_helper(); + QUrl mPicturesDir; + static QUrl defaultPicturesDirValue_helper(); + QString mBrightness; + static QString defaultBrightnessValue_helper(); +}; + +#endif + diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test18.kcfg b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test18.kcfg new file mode 100644 index 0000000000..d2c2526262 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test18.kcfg @@ -0,0 +1,21 @@ + + + + + + 13 + + + Foo,Bar + + + Bar + + + Foo + + + diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test18.kcfgc b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test18.kcfgc new file mode 100644 index 0000000000..9831446c6a --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test18.kcfgc @@ -0,0 +1,7 @@ +ClassName=Test18 +GenerateProperties=true +Mutators=brightness +File=test18.kcfg +QmlRegistration=true +Singleton=true +DefaultValueGetters=true diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test18main.cpp b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test18main.cpp new file mode 100644 index 0000000000..65b56761e9 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test18main.cpp @@ -0,0 +1,12 @@ +/* + SPDX-FileCopyrightText: 2024 Joshua Goins + + SPDX-License-Identifier: MIT +*/ +#include "test18.h" + +int main(int, char **) +{ + QStandardPaths::setTestModeEnabled(true); + return 0; +} diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test19.cpp.ref b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test19.cpp.ref new file mode 100644 index 0000000000..bc9ad5101b --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test19.cpp.ref @@ -0,0 +1,82 @@ +// This file is generated by kconfig_compiler_kf6 from test19.kcfg. +// All changes you do to this file will be lost. + +#include "test19.h" + +#include +#include +#include + +using namespace Foo; + +namespace Foo { + +class Test19Helper +{ + public: + Test19Helper() noexcept : q(nullptr) {} + ~Test19Helper() noexcept { delete q; q = nullptr; } + Test19Helper(const Test19Helper&) = delete; + Test19Helper& operator=(const Test19Helper&) = delete; + Test19 *q; +}; + +} +Q_GLOBAL_STATIC(Test19Helper, s_globalTest19) +Test19 *Test19::self() +{ + if (!s_globalTest19()->q) { + new Test19; + s_globalTest19()->q->read(); + } + + return s_globalTest19()->q; +} + +Test19 *Test19::create(QQmlEngine *, QJSEngine *) +{ + QQmlEngine::setObjectOwnership(self(), QQmlEngine::CppOwnership); + return self(); +} + +Test19::Test19( ) + : KConfigSkeleton( QStringLiteral( "muondatasourcesrc" ) ) +{ + Q_ASSERT(!s_globalTest19()->q); + s_globalTest19()->q = this; + KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast(&Test19::itemChanged); + + setCurrentGroup( QStringLiteral( "kamoso" ) ); + + KConfigSkeleton::ItemUrl *itemPicturesDir; + itemPicturesDir = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "picturesDir" ), mPicturesDir ); + addItem( itemPicturesDir, QStringLiteral( "picturesDir" ) ); + KConfigCompilerSignallingItem *itemBrightness; + KConfigSkeleton::ItemDouble *innerItemBrightness; + innerItemBrightness = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "brightness" ), mBrightness, 5.7 ); + itemBrightness = new KConfigCompilerSignallingItem(innerItemBrightness, this, notifyFunction, signalBrightnessChanged); + addItem( itemBrightness, QStringLiteral( "brightness" ) ); +} + +double Test19::defaultBrightnessValue_helper() +{ + + return 5.7; +} + +Test19::~Test19() +{ + if (s_globalTest19.exists() && !s_globalTest19.isDestroyed()) { + s_globalTest19()->q = nullptr; + } +} + + +void Test19::itemChanged(quint64 signalFlag) { + + switch (signalFlag) { + case signalBrightnessChanged: + Q_EMIT brightnessChanged(); + break; + } +} diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test19.h.ref b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test19.h.ref new file mode 100644 index 0000000000..19d3c8e1f0 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test19.h.ref @@ -0,0 +1,115 @@ +// This file is generated by kconfig_compiler_kf6 from test19.kcfg. +// All changes you do to this file will be lost. +#ifndef FOO_TEST19_H +#define FOO_TEST19_H + +#include +#include +#include +#include + +class QQmlEngine; +class QJSEngine; + +namespace Foo { + +class Test19 : public KConfigSkeleton +{ + Q_OBJECT + QML_ELEMENT + QML_SINGLETON + public: + + static Test19 *self(); + static Test19 *create(QQmlEngine *, QJSEngine *); + ~Test19() override; + + Q_PROPERTY(QUrl picturesDir READ picturesDir CONSTANT) + Q_PROPERTY(bool isPicturesDirImmutable READ isPicturesDirImmutable CONSTANT) + /** + Get picturesDir + */ + static + QUrl picturesDir() + { + return self()->mPicturesDir; + } + + /** + Is picturesDir Immutable + */ + static + bool isPicturesDirImmutable() + { + return self()->isImmutable( QStringLiteral( "picturesDir" ) ); + } + + /** + Set brightness + */ + static + void setBrightness( double v ) + { + if (v != self()->mBrightness && !self()->isBrightnessImmutable()) { + self()->mBrightness = v; + Q_EMIT self()->brightnessChanged(); + } + } + + Q_PROPERTY(double brightness READ brightness WRITE setBrightness NOTIFY brightnessChanged) + Q_PROPERTY(bool isBrightnessImmutable READ isBrightnessImmutable CONSTANT) + Q_PROPERTY(double defaultBrightnessValue READ defaultBrightnessValue CONSTANT) + /** + Get brightness + */ + static + double brightness() + { + return self()->mBrightness; + } + + /** + Is brightness Immutable + */ + static + bool isBrightnessImmutable() + { + return self()->isImmutable( QStringLiteral( "brightness" ) ); + } + + /** + Get brightness default value + */ + static + double defaultBrightnessValue() + { + return defaultBrightnessValue_helper(); + } + + + enum { + signalBrightnessChanged = 1 + }; + + Q_SIGNALS: + void brightnessChanged(); + + private: + void itemChanged(quint64 signalFlag); + + protected: + Test19(); + friend class Test19Helper; + + + // kamoso + QUrl mPicturesDir; + static QUrl defaultPicturesDirValue_helper(); + double mBrightness; + static double defaultBrightnessValue_helper(); +}; + +} + +#endif + diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test19.kcfg b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test19.kcfg new file mode 100644 index 0000000000..621aadf83d --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test19.kcfg @@ -0,0 +1,13 @@ + + + + + + + 5.7 + + + diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test19.kcfgc b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test19.kcfgc new file mode 100644 index 0000000000..a7aadaa3cb --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test19.kcfgc @@ -0,0 +1,8 @@ +ClassName=Test19 +GenerateProperties=true +Mutators=brightness +File=test19.kcfg +QmlRegistration=true +Singleton=true +DefaultValueGetters=true +NameSpace=Foo diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test19main.cpp b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test19main.cpp new file mode 100644 index 0000000000..f46e5fbc2b --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test19main.cpp @@ -0,0 +1,13 @@ +/* + SPDX-FileCopyrightText: 2026 Nicolas Fella + + SPDX-License-Identifier: MIT +*/ +#include "test19.h" + +int main(int, char **) +{ + QStandardPaths::setTestModeEnabled(true); + Foo::Test19::self(); + return 0; +} diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test19qml.cpp b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test19qml.cpp new file mode 100644 index 0000000000..b2769a8ea7 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test19qml.cpp @@ -0,0 +1,28 @@ +/* + SPDX-FileCopyrightText: 2026 Nicolas Fella + + SPDX-License-Identifier: MIT +*/ + +#include +#include +#include + +class Test19Qml : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void testQml() + { + QQmlApplicationEngine engine; + + engine.loadFromModule("org.kde.kconfig.test19", "Test19Qml"); + + QVERIFY(!engine.rootObjects().isEmpty()); + } +}; + +QTEST_MAIN(Test19Qml) + +#include "test19qml.moc" diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_kconfigconstructor.cpp.ref b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_kconfigconstructor.cpp.ref new file mode 100644 index 0000000000..af65c0bac8 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_kconfigconstructor.cpp.ref @@ -0,0 +1,20 @@ +// This file is generated by kconfig_compiler_kf6 from test_kconfigconstructor.kcfg. +// All changes you do to this file will be lost. + +#include "test_kconfigconstructor.h" + +TestKConfigConstructor::TestKConfigConstructor( std::unique_ptr config, QObject *parent ) + : KConfigSkeleton(std::move(config), KCoreConfigSkeleton::DisambiguateConstructor::IsStdUniqPtr) +{ + setParent(parent); + setCurrentGroup( QStringLiteral( "MyOptions" ) ); + + KConfigSkeleton::ItemString *itemMyString; + itemMyString = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "MyString" ), mMyString, QStringLiteral( "Default String" ) ); + addItem( itemMyString, QStringLiteral( "MyString" ) ); +} + +TestKConfigConstructor::~TestKConfigConstructor() +{ +} + diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_kconfigconstructor.h.ref b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_kconfigconstructor.h.ref new file mode 100644 index 0000000000..b9ab35d153 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_kconfigconstructor.h.ref @@ -0,0 +1,50 @@ +// This file is generated by kconfig_compiler_kf6 from test_kconfigconstructor.kcfg. +// All changes you do to this file will be lost. +#ifndef TESTKCONFIGCONSTRUCTOR_H +#define TESTKCONFIGCONSTRUCTOR_H + +#include +#include +#include +#include + +class TestKConfigConstructor : public KConfigSkeleton +{ + public: + + TestKConfigConstructor( std::unique_ptr config, QObject *parent = nullptr ); + ~TestKConfigConstructor() override; + + /** + Set This is a string + */ + void setMyString( const QString & v ) + { + if (!isMyStringImmutable()) + mMyString = v; + } + + /** + Get This is a string + */ + QString myString() const + { + return mMyString; + } + + /** + Is This is a string Immutable + */ + bool isMyStringImmutable() const + { + return isImmutable( QStringLiteral( "MyString" ) ); + } + + protected: + + // MyOptions + QString mMyString; +}; + +#endif + diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_kconfigconstructor.kcfg b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_kconfigconstructor.kcfg new file mode 100644 index 0000000000..1f0922a4f6 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_kconfigconstructor.kcfg @@ -0,0 +1,12 @@ + + + + + + Default String + + + diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_kconfigconstructor.kcfgc b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_kconfigconstructor.kcfgc new file mode 100644 index 0000000000..3a0a0146ea --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_kconfigconstructor.kcfgc @@ -0,0 +1,6 @@ +# Code generation options for kconfig_compiler_kf6 +ClassName=TestKConfigConstructor +File=test_kconfigconstructor.kcfg +ParentInConstructor=true +Mutators=true +KConfigConstructor=true diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_kconfigconstructormain.cpp b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_kconfigconstructormain.cpp new file mode 100644 index 0000000000..2e358e3231 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_kconfigconstructormain.cpp @@ -0,0 +1,37 @@ +/* + SPDX-FileCopyrightText: 2025 Méven Car + + SPDX-License-Identifier: MIT +*/ + +#include +#include +#include +#include + +#include + +#include + +#include "test_kconfigconstructor.h" + +int main(int argc, char **argv) +{ + QStandardPaths::setTestModeEnabled(true); + QGuiApplication app(argc, argv); + Q_UNUSED(app); + + auto buffer = std::make_shared(); + buffer->open(QIODevice::ReadWrite | QIODevice::Text); + { + KConfig initialConfig(buffer); + KConfigGroup group = initialConfig.group(QStringLiteral("MyOptions")); + group.writeEntry(QStringLiteral("MyString"), QStringLiteral("The String")); + } + buffer->seek(0); + TestKConfigConstructor t(std::make_unique(buffer)); + + bool ok = t.myString() == QLatin1String("The String"); + + return ok ? 0 : 1; +} diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_state_config_nameless.kcfg b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_state_config_nameless.kcfg new file mode 100644 index 0000000000..9de20d0d2c --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_state_config_nameless.kcfg @@ -0,0 +1,14 @@ + + + + + + + 0 + + + + diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_state_config_nameless.kcfgc b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_state_config_nameless.kcfgc new file mode 100644 index 0000000000..e7cf0e58d9 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_state_config_nameless.kcfgc @@ -0,0 +1,6 @@ +# Code generation options for kconfig_compiler_kf6 +File=test_state_config_nameless.kcfg +ClassName=MyStateConfig +Singleton=false +Mutators=true +ItemAccessors=true diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_state_config_nameless_main.cpp b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_state_config_nameless_main.cpp new file mode 100644 index 0000000000..bd3726a2f4 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_state_config_nameless_main.cpp @@ -0,0 +1,43 @@ +/* + SPDX-FileCopyrightText: 2021 Alexander Lohnau + + SPDX-License-Identifier: MIT +*/ + +#include "test_state_config.h" +#include + +class TestStateConfig : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void testStateConfig() + { + QStandardPaths::setTestModeEnabled(true); + + auto stateConfig = KSharedConfig::openStateConfig(); + + // Clean the group at every start + stateConfig->deleteGroup(QStringLiteral("General")); + stateConfig->sync(); + + // It should have the default value + QCOMPARE(MyStateConfig().someStateData(), 0); + + // the updated value should be read from the generated config class + stateConfig->group(QStringLiteral("General")).writeEntry("SomeStateData", 1); + QCOMPARE(MyStateConfig().someStateData(), 1); + + // Make sure writing the value works as expected + MyStateConfig cfg; + cfg.setSomeStateData(2); + QVERIFY(cfg.isSaveNeeded()); + cfg.save(); + stateConfig->reparseConfiguration(); + QCOMPARE(stateConfig->group(QStringLiteral("General")).readEntry("SomeStateData", -1), 2); + } +}; +QTEST_MAIN(TestStateConfig) + +#include "test_state_config_nameless_main.moc" diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_time.cpp.ref b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_time.cpp.ref new file mode 100644 index 0000000000..57dda61be4 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_time.cpp.ref @@ -0,0 +1,25 @@ +// This file is generated by kconfig_compiler_kf6 from test_time.kcfg. +// All changes you do to this file will be lost. + +#include "test_time.h" + +TestTime::TestTime( ) + : KConfigSkeleton( QStringLiteral( "timerc" ) ) +{ + setCurrentGroup( QStringLiteral( "General" ) ); + + KConfigSkeleton::ItemTime *itemFirstTime; + itemFirstTime = new KConfigSkeleton::ItemTime( currentGroup(), QStringLiteral( "FirstTime" ), mFirstTime ); + addItem( itemFirstTime, QStringLiteral( "FirstTime" ) ); + KConfigSkeleton::ItemTime *itemSecondTime; + itemSecondTime = new KConfigSkeleton::ItemTime( currentGroup(), QStringLiteral( "SecondTime" ), mSecondTime, QTime(6, 42, 37) ); + addItem( itemSecondTime, QStringLiteral( "SecondTime" ) ); + KConfigSkeleton::ItemTime *itemThirdTime; + itemThirdTime = new KConfigSkeleton::ItemTime( currentGroup(), QStringLiteral( "ThirdTime" ), mThirdTime, QTime(21, 22, 23) ); + addItem( itemThirdTime, QStringLiteral( "ThirdTime" ) ); +} + +TestTime::~TestTime() +{ +} + diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_time.h.ref b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_time.h.ref new file mode 100644 index 0000000000..a9c8c3cd43 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_time.h.ref @@ -0,0 +1,102 @@ +// This file is generated by kconfig_compiler_kf6 from test_time.kcfg. +// All changes you do to this file will be lost. +#ifndef TESTTIME_H +#define TESTTIME_H + +#include +#include +#include +#include + +class TestTime : public KConfigSkeleton +{ + public: + + TestTime( ); + ~TestTime() override; + + /** + Set FirstTime + */ + void setFirstTime( QTime v ) + { + if (!isFirstTimeImmutable()) + mFirstTime = v; + } + + /** + Get FirstTime + */ + QTime firstTime() const + { + return mFirstTime; + } + + /** + Is FirstTime Immutable + */ + bool isFirstTimeImmutable() const + { + return isImmutable( QStringLiteral( "FirstTime" ) ); + } + + /** + Set SecondTime + */ + void setSecondTime( QTime v ) + { + if (!isSecondTimeImmutable()) + mSecondTime = v; + } + + /** + Get SecondTime + */ + QTime secondTime() const + { + return mSecondTime; + } + + /** + Is SecondTime Immutable + */ + bool isSecondTimeImmutable() const + { + return isImmutable( QStringLiteral( "SecondTime" ) ); + } + + /** + Set ThirdTime + */ + void setThirdTime( QTime v ) + { + if (!isThirdTimeImmutable()) + mThirdTime = v; + } + + /** + Get ThirdTime + */ + QTime thirdTime() const + { + return mThirdTime; + } + + /** + Is ThirdTime Immutable + */ + bool isThirdTimeImmutable() const + { + return isImmutable( QStringLiteral( "ThirdTime" ) ); + } + + protected: + + // General + QTime mFirstTime; + QTime mSecondTime; + QTime mThirdTime; +}; + +#endif + diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_time.kcfg b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_time.kcfg new file mode 100644 index 0000000000..ad2e851051 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_time.kcfg @@ -0,0 +1,19 @@ + + + + + + + + + 06:42:37 + + + + QTime(21, 22, 23) + + + diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_time.kcfgc b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_time.kcfgc new file mode 100644 index 0000000000..31abb831d2 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_time.kcfgc @@ -0,0 +1,3 @@ +ClassName=TestTime +File=test_time.kcfg +Mutators=true diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_time_main.cpp b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_time_main.cpp new file mode 100644 index 0000000000..6e65318483 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/kconfig_compiler/test_time_main.cpp @@ -0,0 +1,18 @@ +/* + SPDX-FileCopyrightText: 2025 Vlad Zahorodnii + + SPDX-License-Identifier: MIT +*/ + +#include + +#include "test_time.h" + +int main(int argc, char **argv) +{ + QStandardPaths::setTestModeEnabled(true); + QGuiApplication app(argc, argv); + Q_UNUSED(app); + TestTime t = TestTime(); + return 0; +} diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/CMakeLists.txt b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/CMakeLists.txt new file mode 100644 index 0000000000..7e627bd31e --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/CMakeLists.txt @@ -0,0 +1,20 @@ +# SPDX-FileCopyrightText: 2025 Azhar Momin +# SPDX-License-Identifier: BSD-2-Clause + +if(DEFINED ENV{LIB_FUZZING_ENGINE}) + set(fuzzing_engine $ENV{LIB_FUZZING_ENGINE}) +else() + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(fuzzing_engine -fsanitize=fuzzer) + else() + message(FATAL_ERROR "Fuzzing engine not supported") + endif() +endif() + + +add_executable(kconfig_fuzzer kconfig_fuzzer.cc) +target_link_libraries(kconfig_fuzzer PRIVATE KF6::ConfigCore ${fuzzing_engine}) + +set_target_properties(kconfig_fuzzer PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/fuzzers +) diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/README.md b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/README.md new file mode 100644 index 0000000000..f047a10484 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/README.md @@ -0,0 +1,35 @@ + + + +# KConfig OSS-Fuzz Integration + +## Fuzzing Locally +Make sure you're using Clang (by setting `CC` and `CXX`), since fuzzing requires it. Then build KConfig with `BUILD_FUZZERS=ON` to generate the `kconfig_fuzzer` binary: +```sh +cmake -B build -DBUILD_FUZZERS=ON +cmake --build build +./build/bin/fuzzers/kconfig_fuzzer +``` + +## Testing OSS-Fuzz Integration +Testing OSS-Fuzz integration requires: Python & Docker + +First clone the OSS-Fuzz repository: +```sh +git clone https://github.com/google/oss-fuzz.git +``` + +After navigating to the cloned repository, run the following command to build the fuzzers: +```sh +python3 infra/helper.py build_image kconfig +python3 infra/helper.py build_fuzzers --sanitizer address kconfig +``` + +This may take a while since it builds the whole QtBase dependency alongside with KConfig. Once the build is completed, you can run the fuzzers using the following command: +```sh +python3 infra/helper.py run_fuzzer kconfig kconfig_fuzzer +``` + +The code for preparing the build lives in the `prepare_build.sh` script and the code for building the fuzzers lives in the `build_fuzzers.sh` script (which is also responsible for building the dependencies, creating the seed corpus and copying the dict file). + +For more information on OSS-Fuzz, visit the [official website](https://google.github.io/oss-fuzz/). diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/build_fuzzers.sh b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/build_fuzzers.sh new file mode 100755 index 0000000000..c2c5c2c785 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/build_fuzzers.sh @@ -0,0 +1,42 @@ +#!/bin/bash -eu +# +# SPDX-FileCopyrightText: 2025 Azhar Momin +# SPDX-FileCopyrightText: 2026 Nicolas Fella +# SPDX-License-Identifier: LGPL-2.0-or-later + +export PATH="$WORK/bin:$PATH" +if [[ $FUZZING_ENGINE == "afl" ]]; then + export LDFLAGS="-fuse-ld=lld" +fi + +cd $SRC/extra-cmake-modules +cmake . -G Ninja \ + -DBUILD_TESTING=OFF \ + -DCMAKE_INSTALL_PREFIX=$WORK +ninja install -j$(nproc) + +cd $SRC/qtbase +./configure -platform linux-clang-libc++ -prefix $WORK -static -opensource -confirm-license -debug \ + -qt-pcre -qt-zlib \ + -no-glib -no-icu -no-feature-gui -no-feature-sql -no-feature-network \ + -no-feature-dbus -no-feature-printsupport -no-feature-widgets +ninja install -j$(nproc) + +cd $SRC/kconfig +rm -rf poqm +cmake . -G Ninja \ + -DBUILD_SHARED_LIBS=OFF \ + -DBUILD_TESTING=OFF \ + -DBUILD_FUZZERS=ON \ + -DKCONFIG_USE_GUI=OFF \ + -DKCONFIG_USE_QML=OFF \ + -DUSE_DBUS=OFF \ + -DCMAKE_INSTALL_PREFIX=$WORK +ninja install -j$(nproc) + +# Copy the fuzzer +cp bin/fuzzers/kconfig_fuzzer $OUT/kconfig_fuzzer +# Create a seed corpus +find . -name "*.config" | zip -q $OUT/kconfig_fuzzer_seed_corpus.zip -@ +# Copy the dictionary +cp autotests/ossfuzz/kconfig_fuzzer.dict $OUT/kconfig_fuzzer.dict diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/corpus/kritarc.config b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/corpus/kritarc.config new file mode 100644 index 0000000000..e76f1781b4 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/corpus/kritarc.config @@ -0,0 +1,485 @@ +ArtColorSel.ColorSpace=0 +ArtColorSel.InversedSaturation=false +ArtColorSel.Light=0 +ArtColorSel.LightPieces=11 +ArtColorSel.NumRings=7 +ArtColorSel.RingPieces=12 +ArtColorSel.SelColorH=0 +ArtColorSel.SelColorS=0 +ArtColorSel.SelColorX=0 +ArtColorSel.defaultHueSteps=12 +ArtColorSel.defaultSaturationSteps=7 +ArtColorSel.defaultValueScaleSteps=11 +ArtColorSel.enforceGamutMask=false +ArtColorSel.lumaB=0.0722 +ArtColorSel.lumaG=0.7152 +ArtColorSel.lumaGamma=2.2 +ArtColorSel.lumaR=0.2126 +ArtColorSel.showBgColor=true +ArtColorSel.showValueScale=false +BackgroundColorForNewImage=255,255,255 +BackgroundOpacityForNewImage=255 +BackgroundStyleForNewImage=0 +CanvasOnlyActive=false +GamutMasks.viewMode=0 +Krita/Ocio/DisplayDevice=sRGB +Krita/Ocio/DisplayLook=Keine +Krita/Ocio/DisplayView=Raw +Krita/Ocio/InputColorSpace=raw +Krita/Ocio/OcioColorManagementMode=0 +Krita/Ocio/OcioConfigPath= +Krita/Ocio/OcioLockColorVisualRepresentation=false +Krita/Ocio/OcioLutPath= +Krita/Ocio/UseOcio=false +LastBackGroundColor=\n\n \n\n +LastForeGroundColor=\n\n \n\n +LastPreset=b) Basic-5 Size Opacity +LastPreset_-1=b) Basic-5 Size Opacity +LineSmoothingDelayDistance=50 +LineSmoothingDistance=50 +LineSmoothingDistanceKeepAspectRatio=true +LineSmoothingDistanceMax=50 +LineSmoothingDistanceMin=50 +LineSmoothingFinishStabilizedCurve=true +LineSmoothingScalableDistance=true +LineSmoothingSmoothPressure=false +LineSmoothingStabilizeSensors=true +LineSmoothingTailAggressiveness=0.15 +LineSmoothingType=1 +LineSmoothingUseDelayDistance=true +NumberOfLayersForNewImage=2 +SpecificColorSelector/HsxMode=0 +SpecificColorSelector/UseHsx=false +SpecificColorSelector/UsePercentage=false +baseLength=60 +canvasState=OPENGL_SUCCESS +colorDepthDef=U8 +colorModelDef=RGBA +colorProfileDef=sRGB-elle-V2-srgbtrc.icc +defaultPalette=Default +globalSnapBoundingBox=false +globalSnapExtension=false +globalSnapImageBounds=true +globalSnapImageCenter=false +globalSnapIntersection=false +globalSnapNode=false +globalSnapOrthogonal=false +globalSnapToPixel=false +gridisoverticalcolor=150,150,150 +gridisoverticalstyle=0 +gridmaincolor=99,99,99 +gridmainstyle=0 +gridsubdivisioncolor=150,150,150 +gridsubdivisionstyle=1 +guidesColor=99,99,99 +guidesLineStyle=0 +imageHeightDef=3508 +imageResolutionDef=300 +imageWidthDef=2480 +levelOfDetailEnabled=false +logviewer_enabled=false +moveToolUnit=0 +numberOfOnionSkins=10 +oninSkinTintColorForward=0,255,0 +onionSkinOpacity_-1=173 +onionSkinOpacity_-10=22 +onionSkinOpacity_-2=163 +onionSkinOpacity_-3=147 +onionSkinOpacity_-4=130 +onionSkinOpacity_-5=107 +onionSkinOpacity_-6=86 +onionSkinOpacity_-7=66 +onionSkinOpacity_-8=48 +onionSkinOpacity_-9=35 +onionSkinOpacity_0=178 +onionSkinOpacity_1=173 +onionSkinOpacity_10=22 +onionSkinOpacity_2=163 +onionSkinOpacity_3=147 +onionSkinOpacity_4=130 +onionSkinOpacity_5=107 +onionSkinOpacity_6=86 +onionSkinOpacity_7=66 +onionSkinOpacity_8=48 +onionSkinOpacity_9=35 +onionSkinState_-1=true +onionSkinState_-10=false +onionSkinState_-2=true +onionSkinState_-3=false +onionSkinState_-4=false +onionSkinState_-5=false +onionSkinState_-6=false +onionSkinState_-7=false +onionSkinState_-8=false +onionSkinState_-9=false +onionSkinState_0=true +onionSkinState_1=true +onionSkinState_10=false +onionSkinState_2=true +onionSkinState_3=false +onionSkinState_4=false +onionSkinState_5=false +onionSkinState_6=false +onionSkinState_7=false +onionSkinState_8=false +onionSkinState_9=false +onionSkinTintColorBackward=255,0,0 +onionSkinTintFactor=191 +presetStripVisible=true +presethistory=b) Basic-5 Size Opacity +scratchpadVisible=true +showAdditionalOnionSkinsSettings=true +showPaletteBottomBar=true +toolbarslider_1=opacity +toolbarslider_2=size +toolbarslider_3=flow +toolbarslider_4=flow +toolbarslider_5=flow + +[GradientChooser] +global/itemSize=medium +global/itemSizeCustom=32 +global/viewMode=icon + +[KisResourceItemChooser_paintoppresets] +splitterState_1row=\x00\x00\x00\xff\x00\x00\x00\x01\x00\x00\x00\x02\xff\xff\xff\xff\xff\xff\xff\xff\x01\xff\xff\xff\xff\x01\x00\x00\x00\x01\x00 +splitterState_2row=\x00\x00\x00\xff\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x01)\x00\x00\x00*\xff\xff\xff\xff\x01\xff\xff\xff\xff\x01\x00\x00\x00\x01\x00 + +[MainWindow] +State=AAAA/wAAAAD9AAAABAAAAAAAAABCAAABpvwCAAAAA/sAAAAOAFQAbwBvAGwAQgBvAHgBAAAAOAAAAaYAAAAoAP////sAAAAkAEYAbABvAHcAUwBoAGEAcABlAEIAbwB4AEQAbwBjAGsAZQByAAAAA2oAAADHAAAAAAAAAAD7AAAAKABGAGwAbwB3AFMAdABlAG4AYwBpAGwAQgBvAHgARABvAGMAawBlAHIAAAADfQAAAMcAAAAAAAAAAAAAAAEAAAEGAAABpvwCAAAARvsAAAAaAEsAaQBzAEIAaQByAGQAZQB5AGUAQgBvAHgAAAAAAP////8AAAAAAAAAAPsAAAAgAEsAaQBzAFAAYQBsAGUAdAB0AGUARABvAGMAawBlAHIAAAAAAP////8AAAAAAAAAAPsAAAAaAEsAbwBDAG8AbABvAHIARABvAGMAawBlAHIAAAAAAP////8AAAAAAAAAAPsAAAAwAEsAaQBzAFQAcgBpAGEAbgBnAGwAZQBDAG8AbABvAHIAUwBlAGwAZQBjAHQAbwByAAAAAAD/////AAAAAAAAAAD7AAAAIgBTAGgAYQBkAG8AdwAgAFAAcgBvAHAAZQByAHQAaQBlAHMAAAAAAP////8AAAAAAAAAAPsAAAAgAFMAaABhAHAAZQAgAFAAcgBvAHAAZQByAHQAaQBlAHMAAAAAAP////8AAAAAAAAAAPsAAAAaAFMAaABhAHAAZQBTAGUAbABlAGMAdABvAHIAAAAASAAAAEQAAAAAAAAAAPsAAAAkAFMAaQBtAHAAbABlACAAVABlAHgAdAAgAEUAZABpAHQAbwByAAAAAAD/////AAAAAAAAAAD8AAAAOAAAAIgAAACIAQAAGfoAAAAAAQAAAAf7AAAAHgBDAG8AbABvAHIAUwBlAGwAZQBjAHQAbwByAE4AZwEAAAAA/////wAAAEYA////+wAAACAAcwBoAGEAcgBlAGQAdABvAG8AbABkAG8AYwBrAGUAcgEAAAAA/////wAAAEYA////+wAAABwATwB2AGUAcgB2AGkAZQB3AEQAbwBjAGsAZQByAAAAAAD/////AAAARgD////7AAAAKgBTAHAAZQBjAGkAZgBpAGMAQwBvAGwAbwByAFMAZQBsAGUAYwB0AG8AcgAAAAAA/////wAAAHAA////+wAAABYAQwBvAGwAbwByAFMAbABpAGQAZQByAAAAAAD/////AAAAAAAAAAD7AAAAFgBJAG0AYQBnAGUARABvAGMAawBlAHIAAAAAAP////8AAAAAAAAAAPsAAAAqAFMAaABhAHAAZQBDAG8AbABsAGUAYwB0AGkAbwBuAEQAbwBjAGsAZQByAAAABkgAAAEoAAAAAAAAAAD7AAAARgBLAHIAaQB0AGEAUwBoAGEAcABlAC8ASwBpAHMAVABvAG8AbABEAHkAbgBhAG8AcAB0AGkAbwBuACAAdwBpAGQAZwBlAHQBAAAAUgAAABIAAAAAAAAAAPsAAAAsAEsAcgBpAHQAYQBTAGgAYQBwAGUALwBLAGkAcwBUAG8AbwBsAEwAaQBuAGUBAAAAPAAAAGkAAAAAAAAAAPsAAAAyAEsAcgBpAHQAYQBTAGgAYQBwAGUALwBLAGkAcwBUAG8AbwBsAEUAbABsAGkAcABzAGUBAAAAkQAAABIAAAAAAAAAAPsAAAAcAEsAaQBzAFQAbwBvAGwAUABvAGwAeQBnAG8AbgEAAACmAAAAEgAAAAAAAAAA+wAAAB4ASwBpAHMAVABvAG8AbABQAG8AbAB5AGwAaQBuAGUBAAAAuwAAABIAAAAAAAAAAPsAAAAWAEsAaQBzAFQAbwBvAGwAUwB0AGEAcgEAAADQAAAAEwAAAAAAAAAA+wAAACoAUwBuAGEAcABHAHUAaQBkAGUAQwBvAG4AZgBpAGcAVwBpAGQAZwBlAHQAAAAA7wAAAHEAAAAAAAAAAPsAAAAyAEsAaQBzAFQAbwBvAGwAQwByAG8AcAAgAG8AcAB0AGkAbwBuACAAdwBpAGQAZwBlAHQBAAAA+wAAABIAAAAAAAAAAPsAAABQAEsAcgBpAHQAYQBUAHIAYQBuAHMAZgBvAHIAbQAvAEsAaQBzAFQAbwBvAGwATQBvAHYAZQAgAE8AcAB0AGkAbwBuACAAVwBpAGQAZwBlAHQBAAABEAAAABIAAAAAAAAAAPsAAAA8AEsAaQBzAFQAbwBvAGwAVAByAGEAbgBzAGYAbwByAG0AIABvAHAAdABpAG8AbgAgAHcAaQBkAGcAZQB0AQAAADwAAAAvAAAAAAAAAAD7AAAATgBLAHIAaQB0AGEAUwBoAGEAcABlAC8ASwBpAHMAVABvAG8AbABNAGUAYQBzAHUAcgBlACAAbwBwAHQAaQBvAG4AIAB3AGkAZABnAGUAdAEAAAA8AAAAQgAAAAAAAAAA+wAAAFwASwByAGkAdABhAFMAZQBsAGUAYwB0AGUAZAAvAEsAaQBzAFQAbwBvAGwAQwBvAGwAbwByAFAAaQBjAGsAZQByACAAbwBwAHQAaQBvAG4AIAB3AGkAZABnAGUAdAEAAAA8AAAA/wAAAAAAAAAA+wAAAEYASwBpAHMAUgB1AGwAZQByAEEAcwBzAGkAcwB0AGEAbgB0AFQAbwBvAGwAIABPAHAAdABpAG8AbgAgAFcAaQBkAGcAZQB0AQAAADwAAAASAAAAAAAAAAD7AAAASABLAGkAcwBUAG8AbwBsAFAAZQByAHMAcABlAGMAdABpAHYAZQBHAHIAaQBkACAATwBwAHQAaQBvAG4AIABXAGkAZABnAGUAdAEAAAGjAAAAEgAAAAAAAAAA+wAAADIASwBpAHMAVABvAG8AbABHAHIAaQBkACAATwBwAHQAaQBvAG4AIABXAGkAZABnAGUAdAEAAAG4AAAAEwAAAAAAAAAA+wAAAEwASwBpAHMAVABvAG8AbABTAGUAbABlAGMAdABSAGUAYwB0AGEAbgBnAHUAbABhAHIAIABvAHAAdABpAG8AbgAgAHcAaQBkAGcAZQB0AQAAAc4AAAASAAAAAAAAAAD7AAAASgBLAGkAcwBUAG8AbwBsAFMAZQBsAGUAYwB0AEUAbABsAGkAcAB0AGkAYwBhAGwAIABvAHAAdABpAG8AbgAgAHcAaQBkAGcAZQB0AQAAAeMAAAASAAAAAAAAAAD7AAAASABLAGkAcwBUAG8AbwBsAFMAZQBsAGUAYwB0AFAAbwBsAHkAZwBvAG4AYQBsACAAbwBwAHQAaQBvAG4AIAB3AGkAZABnAGUAdAEAAAH4AAAAEgAAAAAAAAAA+wAAAEQASwBpAHMAVABvAG8AbABTAGUAbABlAGMAdABPAHUAdABsAGkAbgBlACAAbwBwAHQAaQBvAG4AIAB3AGkAZABnAGUAdAEAAAINAAAAEgAAAAAAAAAA+wAAAEoASwBpAHMAVABvAG8AbABTAGUAbABlAGMAdABDAG8AbgB0AGkAZwB1AG8AdQBzACAAbwBwAHQAaQBvAG4AIAB3AGkAZABnAGUAdAEAAAIiAAAAEgAAAAAAAAAA+wAAAEQASwBpAHMAVABvAG8AbABTAGUAbABlAGMAdABTAGkAbQBpAGwAYQByACAAbwBwAHQAaQBvAG4AIAB3AGkAZABnAGUAdAEAAAI3AAAAEgAAAAAAAAAA/AAAAbYAAABaAAAAAAD////6AAAAAAEAAAAC+wAAAC4ASwBvAFMAaABhAHAAZQBDAG8AbABsAGUAYwB0AGkAbwBuAEQAbwBjAGsAZQByAQAAAAD/////AAAAAAAAAAD7AAAAJABTAG0AYQBsAGwAQwBvAGwAbwByAFMAZQBsAGUAYwB0AG8AcgAAAANuAAABBAAAAEYA/////AAAAMYAAAC3AAAAtwD////6AAAAAAEAAAAD+wAAABYASwBpAHMATABhAHkAZQByAEIAbwB4AQAAAAD/////AAABAgD////7AAAAGgBDAGgAYQBuAG4AZQBsAEQAbwBjAGsAZQByAAAAAAD/////AAAARgD////7AAAALgBLAGkAcwBQAGEAaQBuAHQAZQByAGwAeQBNAGkAeABlAHIARABvAGMAawBlAHIAAAAAAP////8AAAAAAAAAAPwAAAGDAAAAWwAAADMA////+gAAAAABAAAAAvsAAAAYAFAAcgBlAHMAZQB0AEQAbwBjAGsAZQByAQAAAAD/////AAAAZgD////7AAAAGgBQAHIAZQBzAGUAdABIAGkAcwB0AG8AcgB5AAAACPoAAAEGAAAARgD////7AAAASABLAHIAaQB0AGEAUwBoAGEAcABlAC8ASwBpAHMAVABvAG8AbABCAHIAdQBzAGgAbwBwAHQAaQBvAG4AIAB3AGkAZABnAGUAdAEAAAPcAAAAaAAAAAAAAAAA+wAAACIAUwB0AHIAbwBrAGUAIABQAHIAbwBwAGUAcgB0AGkAZQBzAAAAAAD/////AAAAAAAAAAD7AAAAFgBTAHQAeQBsAGUARABvAGMAawBlAHIAAAAAAP////8AAAAAAAAAAPsAAAAgAEsAaQBzAEgAaQBzAHQAbwBnAHIAYQBtAEQAbwBjAGsAAAAAAP////8AAAAAAAAAAPsAAAASAFMAYwByAGkAcAB0AGkAbgBnAAAAAAD/////AAAAAAAAAAD7AAAAMABEAGUAZgBhAHUAbAB0AFQAbwBvAGwAQQByAHIAYQBuAGcAZQBXAGkAZABnAGUAdAAAAAK8AAAAUgAAAAAAAAAA+wAAACIARABlAGYAYQB1AGwAdABUAG8AbwBsAFcAaQBkAGcAZQB0AAAAAxEAAABbAAAAAAAAAAD7AAAAJABLAGkAcwBIAGkAcwB0AG8AZwByAGEAbQBEAG8AYwBrAGUAcgAAAAJCAAAAewAAAAAAAAAA+wAAABgARABpAGcAaQB0AGEAbABNAGkAeABlAHIAAAAAAP////8AAAC1AP////sAAAAOAEgAaQBzAHQAbwByAHkAAAADkAAAALQAAABWAP////sAAABOAEsAcgBpAHQAYQBGAGkAbABsAC8ASwBpAHMAVABvAG8AbABHAHIAYQBkAGkAZQBuAHQAIABvAHAAdABpAG8AbgAgAHcAaQBkAGcAZQB0AAAABCgAAAAcAAAAAAAAAAD7AAAARgBLAHIAaQB0AGEARgBpAGwAbAAvAEsAaQBzAFQAbwBvAGwARgBpAGwAbAAgAG8AcAB0AGkAbwBuACAAdwBpAGQAZwBlAHQAAAADUAAAABwAAAAAAAAAAPsAAAA2AEsAcgBpAHQAYQBTAGgAYQBwAGUALwBLAGkAcwBUAG8AbwBsAFIAZQBjAHQAYQBuAGcAbABlAAAAAwUAAABnAAAAAAAAAAD7AAAAIgBDAG8AbQBwAG8AcwBpAHQAaQBvAG4ARABvAGMAawBlAHIAAAAAAP////8AAABxAP////sAAAAqAEEAcgB0AGkAcwB0AGkAYwBDAG8AbABvAHIAUwBlAGwAZQBjAHQAbwByAAAAAAD/////AAAAdAD////7AAAAGgBQAGEAdAB0AGUAcgBuAEQAbwBjAGsAZQByAAAAAtkAAAFJAAAA+wAIAA/7AAAAGgBUAGEAcwBrAHMAZQB0AEQAbwBjAGsAZQByAAAAAAD/////AAAAdQD////7AAAAKABTAG4AYQBwAEcAdQBpAGQAZQAgAFAAcgBvAHAAZQByAHQAaQBlAHMAAAAAAP////8AAAAAAAAAAPsAAAA4AFQAZQB4AHQARABvAGMAdQBtAGUAbgB0AEkAbgBzAHAAZQBjAHQAaQBvAG4ARABvAGMAawBlAHICAAAEmgAAAhUAAAEqAAAArvsAAAASAEwAdQB0AEQAbwBjAGsAZQByAAAAAAD/////AAABNQD////7AAAAGgBQAGEAbABlAHQAdABlAEQAbwBjAGsAZQByAAAAAAD/////AAAAYgD////7AAAAFABHAHIAaQBkAEQAbwBjAGsAZQByAAAAAAD/////AAABKgD////7AAAAHgBIAGkAcwB0AG8AZwByAGEAbQBEAG8AYwBrAGUAcgAAAAAA/////wAAAEQA////+wAAACoAQQBuAGkAbQBhAHQAaQBvAG4AQwB1AHIAdgBlAHMARABvAGMAawBlAHIAAAAAAP////8AAABoAP////sAAAAyAFMAdgBnAFMAeQBtAGIAbwBsAEMAbwBsAGwAZQBjAHQAaQBvAG4ARABvAGMAawBlAHIAAAAAAP////8AAAB1AP////sAAAAWAFQAbwB1AGMAaABEAG8AYwBrAGUAcgAAAAJMAAABMQAAABIA////+wAAABoAQQByAHIAYQBuAGcAZQBEAG8AYwBrAGUAcgAAAAAA/////wAAADIA////+wAAADoAYwBvAG0AaQBjAHMAXwBwAHIAbwBqAGUAYwB0AF8AbQBhAG4AYQBnAGUAcgBfAGQAbwBjAGsAZQByAAAAAAD/////AAAApwD////7AAAAKgBxAHUAaQBjAGsAXwBzAGUAdAB0AGkAbgBnAHMAXwBkAG8AYwBrAGUAcgAAAAAA/////wAAAHYA////+wAAABYAUABhAGcAZQByAEQAbwBjAGsAZQByAAAAAAD/////AAAAAAAAAAD7AAAAJgBsAGEAcwB0AGQAbwBjAHUAbQBlAG4AdABzAGQAbwBjAGsAZQByAAAAAAD/////AAAAdAD////7AAAAEgBHAGEAbQB1AHQATQBhAHMAawAAAAAA/////wAAAKMA////+wAAABAAUwBuAGEAcABzAGgAbwB0AAAAAt8AAACkAAAAdQD////7AAAAEgBMAG8AZwBEAG8AYwBrAGUAcgAAAAAA/////wAAAHQA////+wAAACAAUwB0AG8AcgB5AGIAbwBhAHIAZABEAG8AYwBrAGUAcgAAAAAA/////wAAAJgA////+wAAABwAUgBlAGMAbwByAGQAZQByAEQAbwBjAGsAZQByAAAAAAD/////AAAAVgD////7AAAALABXAGkAZABlAEcAYQBtAHUAdABDAG8AbABvAHIAUwBlAGwAZQBjAHQAbwByAAAAAAD/////AAAArQD///8AAAACAAAKAAAAALz8AQAAAAH7AAAAGgBUAG8AbwBsAEIAYQByAEQAbwBjAGsAZQByAAAAAAD/////AAAAAAAAAAAAAAADAAAAAAAAAAD8AQAAAAT7AAAAHABGAGwAaQBwAGIAbwBvAGsARABvAGMAawBlAHIAAAAAAP////8AAAAAAAAAAPsAAAAeAEEAbgBpAG0AYQB0AGkAbwBuAEQAbwBjAGsAZQByAAAAAAD/////AAAAAAAAAAD7AAAAIABPAG4AaQBvAG4AUwBrAGkAbgBzAEQAbwBjAGsAZQByAAAAAAD/////AAABMwD////7AAAAHABUAGkAbQBlAGwAaQBuAGUARABvAGMAawBlAHIAAAAAAP////8AAANrAP///wAAAgAAAAGmAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAMAAAAWAG0AYQBpAG4AVABvAG8AbABCAGEAcgEAAAAA/////wAAAAAAAAAAAAAAHgBCAHIAdQBzAGgAZQBzAEEAbgBkAFMAdAB1AGYAZgEAAABm/////wAAAAAAAAAAAAAAFgBlAGQAaQB0AFQAbwBvAGwAQgBhAHIAAAAAAP////8AAAAAAAAAAA== +ToolBarsMovable=Disabled +eDP-1 Height 1280x800 eDP-1=508 +eDP-1 Width 1280x800 eDP-1=852 +ko_geometry=AdnQywADAAAAAADWAAAAaAAABCkAAAJ6AAAA1gAAAH8AAAQpAAACegAAAAAAAAAABQAAAADWAAAAfwAABCkAAAJ6 + +[MainWindow][DockWidget AnimationCurvesDocker] +DockArea=2 +Locked=false +height=480 +width=640 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget ArrangeDocker] +DockArea=2 +Locked=false +height=264 +width=222 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget ArtisticColorSelector] +DockArea=2 +Locked=false +height=284 +width=334 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget ChannelDocker] +DockArea=2 +Locked=false +height=30 +width=100 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget ColorSelectorNg] +DockArea=2 +Locked=false +height=94 +width=262 +xPosition=0 +yPosition=16 + +[MainWindow][DockWidget CompositionDocker] +DockArea=2 +Locked=false +height=300 +width=400 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget DigitalMixer] +DockArea=2 +Locked=false +height=30 +width=100 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget GamutMask] +DockArea=2 +Locked=false +height=322 +width=363 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget GridDocker] +DockArea=2 +Locked=false +height=527 +width=258 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget HistogramDocker] +DockArea=2 +Locked=false +height=464 +width=640 +xPosition=0 +yPosition=16 + +[MainWindow][DockWidget History] +DockArea=2 +Locked=false +height=464 +width=640 +xPosition=0 +yPosition=16 + +[MainWindow][DockWidget KisLayerBox] +DockArea=2 +Locked=false +height=167 +width=262 +xPosition=0 +yPosition=16 + +[MainWindow][DockWidget LogDocker] +DockArea=2 +Locked=false +height=260 +width=400 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget LutDocker] +DockArea=2 +Locked=false +height=328 +width=357 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget OnionSkinsDocker] +DockArea=8 +Locked=false +height=282 +width=336 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget OverviewDocker] +DockArea=2 +Locked=false +height=102 +width=100 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget PaletteDocker] +DockArea=2 +Locked=false +height=422 +width=340 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget PatternDocker] +DockArea=2 +Locked=false +height=235 +width=175 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget PresetDocker] +DockArea=2 +Locked=false +height=75 +width=262 +xPosition=0 +yPosition=16 + +[MainWindow][DockWidget PresetHistory] +DockArea=2 +Locked=false +height=30 +width=100 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget RecorderDocker] +DockArea=2 +Locked=false +height=369 +width=277 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget SmallColorSelector] +DockArea=2 +Locked=false +height=464 +width=640 +xPosition=0 +yPosition=16 + +[MainWindow][DockWidget Snapshot] +DockArea=2 +Locked=false +height=30 +width=100 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget SpecificColorSelector] +DockArea=2 +Locked=false +height=207 +width=268 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget StoryboardDocker] +DockArea=2 +Locked=false +height=561 +width=604 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget SvgSymbolCollectionDocker] +DockArea=2 +Locked=false +height=464 +width=640 +xPosition=0 +yPosition=16 + +[MainWindow][DockWidget TasksetDocker] +DockArea=2 +Locked=false +height=300 +width=400 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget TimelineDocker] +DockArea=8 +Locked=false +height=50 +width=100 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget ToolBox] +DockArea=1 +Locked=false +height=406 +width=66 +xPosition=0 +yPosition=16 + +[MainWindow][DockWidget TouchDocker] +DockArea=2 +Locked=false +height=341 +width=116 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget WideGamutColorSelector] +DockArea=2 +Locked=false +height=480 +width=640 +xPosition=0 +yPosition=0 + +[MainWindow][DockWidget comics_project_manager_docker] +DockArea=2 +Locked=false +height=464 +width=640 +xPosition=0 +yPosition=16 + +[MainWindow][DockWidget lastdocumentsdocker] +DockArea=2 +Locked=false +height=464 +width=640 +xPosition=0 +yPosition=16 + +[MainWindow][DockWidget quick_settings_docker] +DockArea=2 +Locked=false +height=464 +width=640 +xPosition=0 +yPosition=16 + +[MainWindow][DockWidget sharedtooldocker] +DockArea=2 +Locked=false +height=464 +width=640 +xPosition=0 +yPosition=16 + +[OverviewDocker] +pinControls=true + +[SelectedTags] +brushes=All +gamutmasks=All +gradients=All +paintoppresets=All +palettes=All +patterns=All +tasksets=All +windowlayouts=All +workspaces=All + +[SvgSymbolCollection] +currentCollection=0 +displayThumbnails=false +iconSize=20 + +[SvgTextTool] +cssStylePresetName= +pasteRichtTextByDefault=false +useCurrentTextProperties=true +useVisualBidiCursor=false + +[advancedColorSelector] +customSelectorBackgroundColor=160,160,164 +gamma=2.2 +lastUsedColorsPerDocument=false +lumaG=0.7152 +lumaR=0.2126 +minimalShadeSelectorLineConfig=0|0.2|0|0|0|0|0;1|0|1|1|0|0|0;2|0|-1|1|0|0|0 +showColorSelector=true +useCustomColorForBackground=false + +[crashprevention] +CreatingCanvas=false + +[krita] +ColorSpaceExtensionsPlugins=\\0 +ColorSpaceExtensionsPluginsDisabled= +ColorSpacePlugins=\\0 +ColorSpacePluginsDisabled= +DockerPlugins=,,,,,,,,,,,,,,,,,,,,,,,,,,, +DockerPluginsDisabled= +FlakePlugins=\\0 +FlakePluginsDisabled= +ShapePlugins=\\0 +ShapePluginsDisabled= +ToolPlugins=,,,,,,,,,,,,, +ToolPluginsDisabled= diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/corpus/ksmserverrc.config b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/corpus/ksmserverrc.config new file mode 100644 index 0000000000..3cdd24d40c --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/corpus/ksmserverrc.config @@ -0,0 +1,43 @@ +[$Version] +update_info=ksmserver_update_loginMode_value.upd:ksmserver_update_loginMode_value_default_enum + +[General] +loginMode=emptySession + +[LegacySession: saved at previous logout] +count=0 + +[Session: saved at previous logout] +clientId1=10134d3e3d8000170403007100000169350006 +clientId2=10134d3e3d8000170403007200000169350007 +clientId3=10134d3e3d8000170069161100000026860003 +clientId4=10134d3e3d8000170403011900000169350010 +clientId5=10134d3e3d8000170403026700000169350012 +clientId6=10134d3e3d8000170403092000000169350014 +count=6 +discardCommand4[$e]=rm,$HOME/.config/session/konsole_10134d3e3d8000170403011900000169350010_1704031295_794333 +discardCommand5[$e]=rm,$HOME/.config/session/kate_10134d3e3d8000170403026700000169350012_1704031295_794354 +program1=/usr/bin/nextcloud +program2=/usr/bin/kalendarac +program3=firefox +program4=/usr/bin/konsole +program5=/usr/bin/kate +program6=thunderbird +restartCommand1=/usr/bin/nextcloud,-session,10134d3e3d8000170403007100000169350006_1704031295_794284 +restartCommand2=/usr/bin/kalendarac,-session,10134d3e3d8000170403007200000169350007_1704031295_794279 +restartCommand3=/usr/bin/firefox,--sm-client-id,10134d3e3d8000170069161100000026860003 +restartCommand4=/usr/bin/konsole,-session,10134d3e3d8000170403011900000169350010_1704031295_794333 +restartCommand5=/usr/bin/kate,-session,10134d3e3d8000170403026700000169350012_1704031295_794354 +restartCommand6=/usr/bin/thunderbird,--sm-client-id,10134d3e3d8000170403092000000169350014 +restartStyleHint1=0 +restartStyleHint2=0 +restartStyleHint3=0 +restartStyleHint4=0 +restartStyleHint5=0 +restartStyleHint6=0 +userId1=nico +userId2=nico +userId3=nico +userId4=nico +userId5=nico +userId6=nico diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/corpus/kssl.config b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/corpus/kssl.config new file mode 100644 index 0000000000..295e3aa000 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/corpus/kssl.config @@ -0,0 +1,23 @@ +[0bbd9e5ce95a198d1073fe94df923c7e] +CertificatePEM=-----BEGIN CERTIFICATE-----\nMIIBTTCB9KADAgECAhB8o6UuC1LdsWpWBQ18Yd67MAoGCCqGSM49BAMCMAAwHhcN\nMjYwMTA4MTMwMzA5WhcNMjYwMTA4MTMwODA5WjAAMFkwEwYHKoZIzj0CAQYIKoZI\nzj0DAQcDQgAEWhPpfzfX2hCMGyM2rELCQJsTjSs35KrKI8P0BvPU8jNZAQX8hY/g\nWgKY03NAUyMxYJoaICuP0IhSJQu5i1SbNqNQME4wDgYDVR0PAQH/BAQDAgWgMBMG\nA1UdJQQMMAoGCCsGAQUFBwMBMAwGA1UdEwEB/wQCMAAwGQYDVR0RAQH/BA8wDYIL\ndGsubWFiby5sdGQwCgYIKoZIzj0EAwIDSAAwRQIgPeFk1W3UcIZaZojQL6QfEg08\nVO+bmvEwODBUC+tpVL4CIQDL/d1x171TaDNrd72rEgwXV4yeRm2TXG/cnuLKekPN\nJw==\n-----END CERTIFICATE-----\n +tk.mabo.ltd=ExpireUTC 3026-01-08T14:03:31,SelfSignedCertificate + +[327544eb08625892b837ce01f380df47] +CertificatePEM=-----BEGIN CERTIFICATE-----\nMIIBTTCB9KADAgECAhBnwIrTOTvVxxvYfCdTOzwgMAoGCCqGSM49BAMCMAAwHhcN\nMjYwMTA4MTI0MzA0WhcNMjYwMTA4MTI0ODA0WjAAMFkwEwYHKoZIzj0CAQYIKoZI\nzj0DAQcDQgAE3b5falJQN2FRrjpT4SpjeAITW3XcDv5maenrJXBZxbPz61/qh+tP\nc7OgCDcHmga7vyyU3lIVXku6JBWEHkFwXKNQME4wDgYDVR0PAQH/BAQDAgWgMBMG\nA1UdJQQMMAoGCCsGAQUFBwMBMAwGA1UdEwEB/wQCMAAwGQYDVR0RAQH/BA8wDYIL\ndGsubWFiby5sdGQwCgYIKoZIzj0EAwIDSAAwRQIhAK8cYIaz/sHpDFhfROV+Ix4h\nP8eHeSw1Nz+2Ielks5TAAiAr0aSpV5V5QRrVCanLGgEuVrtTh1FzWy22hTRJwHRS\n5A==\n-----END CERTIFICATE-----\n +tk.mabo.ltd=ExpireUTC 3026-01-08T13:47:32,SelfSignedCertificate + +[67344e61c0431cf1f7257c1d6de7a785] +CertificatePEM=-----BEGIN CERTIFICATE-----\nMIIFSzCCBDOgAwIBAgIQSueVSfqavj8QDxekeOFpCTANBgkqhkiG9w0BAQsFADCB\nkDELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G\nA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxNjA0BgNV\nBAMTLUNPTU9ETyBSU0EgRG9tYWluIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZlciBD\nQTAeFw0xNTA0MDkwMDAwMDBaFw0xNTA0MTIyMzU5NTlaMFkxITAfBgNVBAsTGERv\nbWFpbiBDb250cm9sIFZhbGlkYXRlZDEdMBsGA1UECxMUUG9zaXRpdmVTU0wgV2ls\nZGNhcmQxFTATBgNVBAMUDCouYmFkc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQAD\nggEPADCCAQoCggEBAMIE7PiM7gTCs9hQ1XBYzJMY61yoaEmwIrX5lZ6xKyx2PmzA\nS2BMTOqytMAPgLaw+XLJhgL5XEFdEyt/ccRLvOmULlA3pmccYYz2QULFRtMWhyef\ndOsKnRFSJiFzbIRMeVXk0WvoBj1IFVKtsyjbqv9u/2CVSndrOfEk0TG23U3AxPxT\nuW1CrbV8/q71FdIzSOciccfCFHpsKOo3St/qbLVytH5aohbcabFXRNsKEqveww9H\ndFxBIuGa+RuT5q0iBikusbpJHAwnnqP7i/dAcgCskgjZjFeEU4EFy+b+a1SYQCeF\nxxC7c3DvaRhBB0VVfPlkPz0sw6l865MaTIbRyoUCAwEAAaOCAdUwggHRMB8GA1Ud\nIwQYMBaAFJCvajqUWgvYkOoSVnPfQ7Q6KNrnMB0GA1UdDgQWBBSd7sF7gQs6R2lx\nGH0RN5O8pRs/+zAOBgNVHQ8BAf8EBAMCBaAwDAYDVR0TAQH/BAIwADAdBgNVHSUE\nFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwTwYDVR0gBEgwRjA6BgsrBgEEAbIxAQIC\nBzArMCkGCCsGAQUFBwIBFh1odHRwczovL3NlY3VyZS5jb21vZG8uY29tL0NQUzAI\nBgZngQwBAgEwVAYDVR0fBE0wSzBJoEegRYZDaHR0cDovL2NybC5jb21vZG9jYS5j\nb20vQ09NT0RPUlNBRG9tYWluVmFsaWRhdGlvblNlY3VyZVNlcnZlckNBLmNybDCB\nhQYIKwYBBQUHAQEEeTB3ME8GCCsGAQUFBzAChkNodHRwOi8vY3J0LmNvbW9kb2Nh\nLmNvbS9DT01PRE9SU0FEb21haW5WYWxpZGF0aW9uU2VjdXJlU2VydmVyQ0EuY3J0\nMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5jb21vZG9jYS5jb20wIwYDVR0RBBww\nGoIMKi5iYWRzc2wuY29tggpiYWRzc2wuY29tMA0GCSqGSIb3DQEBCwUAA4IBAQBq\nevHa/wMHcnjFZqFPRkMOXxQhjHUa6zbgH6QQFezaMyV8O7UKxwE4PSf9WNnM6i1p\nOXy+l+8L1gtY54x/v7NMHfO3kICmNnwUW+wHLQI+G1tjWxWrAPofOxkt3+IjEBEH\nfnJ/4r+3ABuYLyw/zoWaJ4wQIghBK4o+gk783SHGVnRwpDTysUCeK1iiWQ8dSO/r\nET7BSp68ZVVtxqPv1dSWzfGuJ/ekVxQ8lEEFeouhN0fX9X3c+s5vMaKwjOrMEpsi\n8TRwz311SotoKQwe6Zaoz7ASH1wq7mcvf71z81oBIgxw+s1F73hczg36TuHvzmWf\nRwxPuzZEaFZcVlmtqoq8\n-----END CERTIFICATE-----\n +expired.badssl.com=ExpireUTC 3026-01-08T13:38:18,ExpiredCertificate + +[b52998685ad4154fdce274ec9122886b] +CertificatePEM=-----BEGIN CERTIFICATE-----\nMIIDeTCCAmGgAwIBAgIJALIblay5ZkE3MA0GCSqGSIb3DQEBCwUAMGIxCzAJBgNV\nBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNp\nc2NvMQ8wDQYDVQQKDAZCYWRTU0wxFTATBgNVBAMMDCouYmFkc3NsLmNvbTAeFw0y\nNjAxMDYyMTAxMzdaFw0yODAxMDYyMTAxMzdaMGIxCzAJBgNVBAYTAlVTMRMwEQYD\nVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMQ8wDQYDVQQK\nDAZCYWRTU0wxFTATBgNVBAMMDCouYmFkc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEB\nBQADggEPADCCAQoCggEBAMIE7PiM7gTCs9hQ1XBYzJMY61yoaEmwIrX5lZ6xKyx2\nPmzAS2BMTOqytMAPgLaw+XLJhgL5XEFdEyt/ccRLvOmULlA3pmccYYz2QULFRtMW\nhyefdOsKnRFSJiFzbIRMeVXk0WvoBj1IFVKtsyjbqv9u/2CVSndrOfEk0TG23U3A\nxPxTuW1CrbV8/q71FdIzSOciccfCFHpsKOo3St/qbLVytH5aohbcabFXRNsKEqve\nww9HdFxBIuGa+RuT5q0iBikusbpJHAwnnqP7i/dAcgCskgjZjFeEU4EFy+b+a1SY\nQCeFxxC7c3DvaRhBB0VVfPlkPz0sw6l865MaTIbRyoUCAwEAAaMyMDAwCQYDVR0T\nBAIwADAjBgNVHREEHDAaggwqLmJhZHNzbC5jb22CCmJhZHNzbC5jb20wDQYJKoZI\nhvcNAQELBQADggEBACBmeeKlBBbmu1XqnjrP11du8Ni3tvymUC+1nWnYUcr2OtYI\nnQzJ/+F3N70xfqivGWdGIlEc4n42yNdsfHTcDHuoFjfXpLuHypMHnQ1Nhgs/Grpb\nE9KBYOm59lwuvNIHOkz8k0H34SKHI4h222gXS0od+5rqBqACJhUogx8gszwO1qLq\nCgUh079w6nTUb11cmCKKZlU4i2dAMFl2cHrlTsYA+vclk7M6nAFduIYFXB8uyRRu\nplXXfqXG4KHqafLFNF2Y43BIz2r47cRMZCu30JHFS8EQ5hxlclLQdBYPpdRTWGJq\nMkGwalYpc/7tHlACbYvUTKl+Pj+J0Fl5kq7qZJM=\n-----END CERTIFICATE-----\n +self-signed.badssl.com=ExpireUTC 3026-01-08T13:48:27,SelfSignedCertificate + +[ba4cc1eb0cc40a6431d7d368f493e00b] +CertificatePEM=-----BEGIN CERTIFICATE-----\nMIIBTTCB9KADAgECAhBgnGGYMsnxNZIMFzRvSTFZMAoGCCqGSM49BAMCMAAwHhcN\nMjYwMTA4MTI1MjEzWhcNMjYwMTA4MTI1NzEzWjAAMFkwEwYHKoZIzj0CAQYIKoZI\nzj0DAQcDQgAEsM+jPMG/sOjPmvwRqNAHIPeIJ5Ph/kYhBl+RTDLW688wOYCz9quv\noKTw/o65HB9/IXMkC1dyig3uFiHd1a/266NQME4wDgYDVR0PAQH/BAQDAgWgMBMG\nA1UdJQQMMAoGCCsGAQUFBwMBMAwGA1UdEwEB/wQCMAAwGQYDVR0RAQH/BA8wDYIL\ndGsubWFiby5sdGQwCgYIKoZIzj0EAwIDSAAwRQIgcG0ms7IZ3lLD1FTZ8u/QpqI/\nT2djFw6VTnjsR+DPPv8CIQCsRJe58ZavZ/YAtmD9mWkyK5WBfTnBQuMq+wgXpcMD\nyg==\n-----END CERTIFICATE-----\n +tk.mabo.ltd=ExpireUTC 3026-01-08T13:56:20,SelfSignedCertificate + +[f50af8f2072b19ec0c3a584744a4dc39] +CertificatePEM=-----BEGIN CERTIFICATE-----\nMIIBTTCB9KADAgECAhBwtADX4RWBI1dCys1WAOfpMAoGCCqGSM49BAMCMAAwHhcN\nMjYwMTA4MTI0NjQwWhcNMjYwMTA4MTI1MTQwWjAAMFkwEwYHKoZIzj0CAQYIKoZI\nzj0DAQcDQgAE6xSC1V7Y4uJuNjjZgJhPj1JY2cNbkzP1C2zXqcb3qjoNod2a/QHO\nxgmsaQfU79suzYqbPPXHjNvGgXkGyxn+FKNQME4wDgYDVR0PAQH/BAQDAgWgMBMG\nA1UdJQQMMAoGCCsGAQUFBwMBMAwGA1UdEwEB/wQCMAAwGQYDVR0RAQH/BA8wDYIL\ndGsubWFiby5sdGQwCgYIKoZIzj0EAwIDSAAwRQIhAOmKoV0hZUPwRcOsPQGE0BQR\nlZqthsUxlbqVh50QTa5YAiB48uFuWD+JD26Kdx9LRbjPrvPGGbdTrUc+fIvHnwKN\nHA==\n-----END CERTIFICATE-----\n +tk.mabo.ltd=ExpireUTC 3026-01-08T13:46:47,SelfSignedCertificate diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/corpus/kwalletrc.config b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/corpus/kwalletrc.config new file mode 100644 index 0000000000..3f5caa258b --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/corpus/kwalletrc.config @@ -0,0 +1,15 @@ +[Wallet] +Close When Idle=false +Close on Screensaver=false +Default Wallet=kdewallet +Enabled=true +First Use=false +Idle Timeout=10 +Launch Manager=true +Leave Manager Open=false +Leave Open=true +Prompt on Open=false +Use One Wallet=true + +[org.freedesktop.secrets] +apiEnabled=true diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/corpus/kwinrc.config b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/corpus/kwinrc.config new file mode 100644 index 0000000000..614a29160c --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/corpus/kwinrc.config @@ -0,0 +1,217 @@ +[$Version] +update_info=kwin.upd:replace-scalein-with-scale,kwin.upd:port-minimizeanimation-effect-to-js,kwin.upd:port-scale-effect-to-js,kwin.upd:port-dimscreen-effect-to-js,kwin.upd:auto-bordersize,kwin.upd:animation-speed,kwin.upd:desktop-grid-click-behavior,kwin.upd:no-swap-encourage,kwin.upd:make-translucency-effect-disabled-by-default,kwin.upd:remove-flip-switch-effect,kwin.upd:remove-cover-switch-effect,kwin.upd:remove-cubeslide-effect,kwin.upd:remove-xrender-backend,kwin.upd:enable-scale-effect-by-default,kwin.upd:overview-group-plugin-id,kwin.upd:animation-speed-cleanup,kwin.upd:replace-cascaded-zerocornered + +[Desktops] +Id_1=6cb263b3-0b19-4573-96d3-68831fa29520 +Id_2=bc0ae556-6278-4ee9-a6b4-cdc0fc497c7a +Name_2=Desktop 4 +Number=2 +Rows=1 + +[Effect-blur] +NoiseStrength=14 + +[Effect-overview] +BorderActivate=9 + +[ElectricBorders] +TopLeft=ApplicationLauncher + +[NightColor] +Active=true +NightTemperature=4200 + +[Plugins] +gamecontrollerEnabled=false +invertEnabled=true + +[TabBox] +LayoutName=org.kde.breeze.desktop + +[Tiling][03972f61-e200-460d-b2e8-faec3cb589d5][0b941a18-575c-4e38-a4a8-8b3f7d309bcb] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][03972f61-e200-460d-b2e8-faec3cb589d5][33eedd40-d65e-42a9-8a98-9ef0ca818762] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][03972f61-e200-460d-b2e8-faec3cb589d5][378a2274-c8a6-4ccf-bef9-281e7c3d2c18] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][03972f61-e200-460d-b2e8-faec3cb589d5][673d8856-61cd-4b33-870f-62e9effbeb8a] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][03972f61-e200-460d-b2e8-faec3cb589d5][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][03972f61-e200-460d-b2e8-faec3cb589d5][bad68552-cc25-495f-a497-4d0ceac6f35c] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][03972f61-e200-460d-b2e8-faec3cb589d5][eb67f5ec-2412-4d21-a2cc-5d634ff6bd80] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][03972f61-e200-460d-b2e8-faec3cb589d5][f342b4f0-2d42-4a0a-a067-57aa2bab3fab] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][13adc0dc-26a1-47c1-b55b-123174ef5b35][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][1408a254-8772-53e5-9834-0887b7ff089c] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][15f9a886-0078-48bd-936f-0727467e37cb][7c644455-ff9b-45dd-806b-5cfe4a4d0178] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][15f9a886-0078-48bd-936f-0727467e37cb][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][164b96e3-40be-4038-8da3-529b4e695538][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][1a38a346-21b8-453f-bcc3-0d56f718164d][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][2ced8910-d65f-499e-9f46-3aa9dd7f1ade][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][303715bd-5b62-44c7-9cb8-feded526f4b3][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][33805ee0-4fe5-455d-9a8c-fb14fc7c9b22][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][33e3deaa-7f93-4183-9805-b53ce071f541][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][367cf2b4-7b48-4319-915f-aa4882f5072b][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][4abc195d-9580-40fb-b7b7-46c051139db3][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][5d3d9a8c-c978-45a5-90ef-122093fc3565][7c644455-ff9b-45dd-806b-5cfe4a4d0178] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][5d3d9a8c-c978-45a5-90ef-122093fc3565][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][5e204b65-f7cf-42ef-83e7-ecd179dbd55a][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][6cb263b3-0b19-4573-96d3-68831fa29520][0b941a18-575c-4e38-a4a8-8b3f7d309bcb] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][6cb263b3-0b19-4573-96d3-68831fa29520][0c75e4ca-a7cc-496d-a9cb-b82dd17b304a] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][6cb263b3-0b19-4573-96d3-68831fa29520][24927995-2bfe-4c32-9856-8993972ebd74] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][6cb263b3-0b19-4573-96d3-68831fa29520][33eedd40-d65e-42a9-8a98-9ef0ca818762] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][6cb263b3-0b19-4573-96d3-68831fa29520][378a2274-c8a6-4ccf-bef9-281e7c3d2c18] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][6cb263b3-0b19-4573-96d3-68831fa29520][673d8856-61cd-4b33-870f-62e9effbeb8a] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][6cb263b3-0b19-4573-96d3-68831fa29520][7c644455-ff9b-45dd-806b-5cfe4a4d0178] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][6cb263b3-0b19-4573-96d3-68831fa29520][7ec28b21-546c-4786-9143-8cb4733989a3] +padding=4 +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][6cb263b3-0b19-4573-96d3-68831fa29520][bad68552-cc25-495f-a497-4d0ceac6f35c] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][6cb263b3-0b19-4573-96d3-68831fa29520][e05b4157-2b73-4246-a522-8ad69c8ec812] +padding=4 +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][6cb263b3-0b19-4573-96d3-68831fa29520][eb67f5ec-2412-4d21-a2cc-5d634ff6bd80] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][6cb263b3-0b19-4573-96d3-68831fa29520][f342b4f0-2d42-4a0a-a067-57aa2bab3fab] +padding=4 +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][727c9be0-b4f0-49b6-9c2f-dc19956e49e0][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][810ce7a5-ce8a-456e-93e5-9b876e619fde][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][83eb4838-f93c-404d-aa87-a1b14f5ec062][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][8f1922fa-ccac-41a6-950d-aa366dfce825][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][9669aa19-24d3-463c-827e-bc35c95e0320][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][9f858388-339b-44b0-ab25-eef76813aeae][7c644455-ff9b-45dd-806b-5cfe4a4d0178] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][9f858388-339b-44b0-ab25-eef76813aeae][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][ad30c232-0383-5b69-8aaa-83ddca1b8f77] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][b3421647-5d06-4da4-b375-83c0b2b2847b][33eedd40-d65e-42a9-8a98-9ef0ca818762] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][b3421647-5d06-4da4-b375-83c0b2b2847b][673d8856-61cd-4b33-870f-62e9effbeb8a] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][b3421647-5d06-4da4-b375-83c0b2b2847b][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][b3421647-5d06-4da4-b375-83c0b2b2847b][f342b4f0-2d42-4a0a-a067-57aa2bab3fab] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][bc0ae556-6278-4ee9-a6b4-cdc0fc497c7a][0c75e4ca-a7cc-496d-a9cb-b82dd17b304a] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][bc0ae556-6278-4ee9-a6b4-cdc0fc497c7a][24927995-2bfe-4c32-9856-8993972ebd74] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][bc0ae556-6278-4ee9-a6b4-cdc0fc497c7a][7c644455-ff9b-45dd-806b-5cfe4a4d0178] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][bc0ae556-6278-4ee9-a6b4-cdc0fc497c7a][7ec28b21-546c-4786-9143-8cb4733989a3] +padding=4 +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][bc0ae556-6278-4ee9-a6b4-cdc0fc497c7a][e05b4157-2b73-4246-a522-8ad69c8ec812] +padding=4 +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][bc0ae556-6278-4ee9-a6b4-cdc0fc497c7a][f342b4f0-2d42-4a0a-a067-57aa2bab3fab] +padding=4 +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][cff91b75-eca4-4c66-8c32-5fd34c23a086][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][d458986c-e67d-491a-8f5b-7a55b414bea2][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][f6803658-beee-4331-8401-aca890a34ffa][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[Tiling][ffe8e724-ac38-4327-bc9f-47c24f413bc7][7ec28b21-546c-4786-9143-8cb4733989a3] +tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} + +[TouchEdges] +Left=ShowDesktop + +[Wayland] +InputMethod[$e]=$HOME/kde/usr/share/applications/org.kde.plasma.keyboard.desktop +VirtualKeyboardEnabled=true + +[Xwayland] +Scale=2.5 +XwaylandEavesdrops=All diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/kconfig_fuzzer.cc b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/kconfig_fuzzer.cc new file mode 100644 index 0000000000..e1d5ed44c3 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/kconfig_fuzzer.cc @@ -0,0 +1,32 @@ +/* + * SPDX-FileCopyrightText: 2026 Nicolas Fella + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#include +#include + +#include +#include + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + + int argc = 0; + QCoreApplication a(argc, nullptr); + + QByteArray input((const char *)data, size); + + auto buffer = std::make_shared(&input); + + buffer->open(QIODevice::ReadOnly); + + KConfig config(buffer); + + const auto groups = config.groupList(); + for (const auto &groupName : groups) { + KConfigGroup group = config.group(groupName); + group.entryMap(); + } + + return 0; +} diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/kconfig_fuzzer.dict b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/kconfig_fuzzer.dict new file mode 100644 index 0000000000..277f507196 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/kconfig_fuzzer.dict @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: 2026 Nicolas Fella +# SPDX-License-Identifier: CC0-1.0 + +# INI tokens +"[" +"]" +"=" +"$" +"$i" +"$e" +"$d" +"\x1d" +"\\n" +"#" +"_" diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/prepare_build.sh b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/prepare_build.sh new file mode 100755 index 0000000000..daca9ca9d2 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/ossfuzz/prepare_build.sh @@ -0,0 +1,10 @@ +#!/bin/bash -eu +# +# SPDX-FileCopyrightText: 2025 Azhar Momin +# SPDX-License-Identifier: LGPL-2.0-or-later + +apt-get update && \ + apt-get install -y cmake ninja-build + +git clone --depth 1 --branch=dev git://code.qt.io/qt/qtbase.git +git clone --depth 1 -b master https://invent.kde.org/frameworks/extra-cmake-modules.git diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/parsetest.cpp b/local/recipes/kde/kf6-kconfig/source/autotests/parsetest.cpp new file mode 100644 index 0000000000..a36cea10bc --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/parsetest.cpp @@ -0,0 +1,41 @@ +/* This file is part of the KDE libraries + * SPDX-FileCopyrightText: 2026 Nicolas Fella + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#include + +#include +#include + +class ParseTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + + void testParse_data() + { + QTest::addColumn("fileName"); + + QTest::addRow("crash1") << QFINDTESTDATA("data/crash1"); + } + + void testParse() + { + QFETCH(QString, fileName); + + KConfig config(fileName); + + const auto groups = config.groupList(); + for (const auto &groupName : groups) { + KConfigGroup group = config.group(groupName); + group.entryMap(); + } + } +}; + +QTEST_GUILESS_MAIN(ParseTest) + +#include "parsetest.moc" diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/qiodevicetest.cpp b/local/recipes/kde/kf6-kconfig/source/autotests/qiodevicetest.cpp new file mode 100644 index 0000000000..f284439a86 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/qiodevicetest.cpp @@ -0,0 +1,182 @@ +// SPDX-License-Identifier: LGPL-2.0-or-later +// SPDX-FileCopyrightText: 2025 Harald Sitter + +#include +#include +#include + +#include +#include + +using namespace Qt::StringLiterals; + +class QIODeviceTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + + void initTestCase() + { + QStandardPaths::setTestModeEnabled(true); + } + + void testWriteRead() + { + // write to file + auto buffer = std::make_shared(); + QVERIFY(buffer->open(QIODevice::ReadWrite | QIODevice::Text)); + { + KConfig config(buffer, KConfig::OpenFlag::SimpleConfig); + config.group(u"Test"_s).writeEntry("key", "value"); + } + buffer->close(); + + QVERIFY(buffer->open(QIODevice::ReadOnly | QIODevice::Text)); + QVERIFY(buffer->isReadable()); + + // check content + QCOMPARE(buffer->readAll(), "[Test]\nkey=value\n"); + buffer->seek(0); + + // read back the config + { + KConfig config(buffer, KConfig::OpenFlag::SimpleConfig); + + QVERIFY(config.hasGroup(u"Test"_s)); + QCOMPARE(config.group(u"Test"_s).readEntry("key"), u"value"_s); + } + } + + void testKdeGlobals() + { + { + KConfig glob(QStringLiteral("kdeglobals")); + KConfigGroup general(&glob, QStringLiteral("General")); + general.writeEntry("testKG", "1"); + QVERIFY(glob.sync()); + } + + KConfig globRead(QStringLiteral("kdeglobals")); + const KConfigGroup general(&globRead, QStringLiteral("General")); + QCOMPARE(general.readEntry("testKG"), QStringLiteral("1")); + + auto buffer = std::make_shared(); + QVERIFY(buffer->open(QIODevice::ReadOnly | QIODevice::Text)); + { + KConfig config(buffer, KConfig::OpenFlag::FullConfig); + QVERIFY(config.hasGroup(u"General"_s)); + config.group(u"General"_s).writeEntry("testKG", "1"); + } + } + + void testAddConfigSources() + { + QTemporaryFile extrafile; + extrafile.setAutoRemove(false); + QVERIFY(extrafile.open()); + extrafile.close(); + + { + KConfig glob(extrafile.fileName()); + KConfigGroup extra(&glob, QStringLiteral("Extra")); + extra.writeEntry("testKG", "1"); + QVERIFY(glob.sync()); + } + + { + // check preconditions + KConfig globRead(extrafile.fileName()); + const KConfigGroup extra(&globRead, QStringLiteral("General")); + QCOMPARE(extra.readEntry("testKG"), QStringLiteral("1")); + } + + // When using a QBuffer as QIODevice + auto buffer = std::make_shared(); + QVERIFY(buffer->open(QIODevice::ReadWrite | QIODevice::Text)); + { + KConfig config(buffer, KConfig::OpenFlag::CascadeConfig); + config.addConfigSources({extrafile.fileName()}); + QVERIFY(config.hasGroup(u"Extra"_s)); + QCOMPARE(config.group(u"Extra"_s).readEntry("testKG"), u"1"_s); + + config.group(u"Extra"_s).writeEntry("testKG", "2"); + QCOMPARE(config.group(u"Extra"_s).readEntry("testKG"), u"2"_s); + } + buffer->seek(0); + QCOMPARE(buffer->readAll(), "[Extra]\ntestKG=2\n"); + + QFile extraConfigSource(extrafile.fileName()); + QVERIFY(extraConfigSource.open(QIODevice::ReadOnly)); + auto extraConfigInin = QString::fromUtf8(extraConfigSource.readAll()); + extraConfigInin.remove(QLatin1Char('\r')); + QCOMPARE(extraConfigInin, u"[Extra]\ntestKG=1\n"_s); + + extrafile.remove(); + } + + void testFileToBuffer() + { + QTemporaryFile file; + file.setAutoRemove(false); + QVERIFY(file.open()); + file.close(); + { + KConfig glob(file.fileName()); + KConfigGroup extra(&glob, QStringLiteral("Extra")); + extra.writeEntry("testKG", "1"); + QVERIFY(glob.sync()); + } + + KConfig glob(file.fileName()); + + auto buffer = std::make_shared(); + QVERIFY(buffer->open(QIODevice::ReadWrite | QIODevice::Text)); + KConfig config(buffer, KConfig::OpenFlag::SimpleConfig); + config.copyFrom(glob); + + QVERIFY(config.isDirty()); + { + const KConfigGroup extra(&config, QStringLiteral("Extra")); + QCOMPARE(extra.readEntry("testKG"), QStringLiteral("1")); + } + + QCOMPARE(buffer->size(), 0); + QVERIFY(config.sync()); + QVERIFY(!config.isDirty()); + + buffer->seek(0); + QCOMPARE(buffer->readAll(), "[Extra]\ntestKG=1\n"); + } + + void testQFile() + { + QTemporaryFile file; + file.setAutoRemove(false); + QVERIFY(file.open()); + file.close(); + + auto backingFile = std::make_shared(file.fileName()); + QVERIFY(backingFile->open(QIODevice::ReadWrite | QIODevice::Text)); + KConfig config(backingFile, KConfig::OpenFlag::SimpleConfig); + + KConfigGroup group(&config, QStringLiteral("Extra")); + group.writeEntry("testKG", "1"); + QVERIFY(config.isDirty()); + { + const KConfigGroup extra(&config, QStringLiteral("Extra")); + QCOMPARE(extra.readEntry("testKG"), QStringLiteral("1")); + } + + QCOMPARE(backingFile->size(), 0); + QVERIFY(config.sync()); + QVERIFY(!config.isDirty()); + + backingFile->seek(0); + QCOMPARE(backingFile->readAll(), "[Extra]\ntestKG=1\n"); + } +}; + +QTEST_MAIN(QIODeviceTest) + +#include "qiodevicetest.moc" diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/registry_test_hkcu.reg b/local/recipes/kde/kf6-kconfig/source/autotests/registry_test_hkcu.reg new file mode 100644 index 0000000000..486430638c Binary files /dev/null and b/local/recipes/kde/kf6-kconfig/source/autotests/registry_test_hkcu.reg differ diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/registry_test_hklm.reg b/local/recipes/kde/kf6-kconfig/source/autotests/registry_test_hklm.reg new file mode 100644 index 0000000000..802c367f32 Binary files /dev/null and b/local/recipes/kde/kf6-kconfig/source/autotests/registry_test_hklm.reg differ diff --git a/local/recipes/kde/kf6-kconfig/source/autotests/registrytest.cpp b/local/recipes/kde/kf6-kconfig/source/autotests/registrytest.cpp new file mode 100644 index 0000000000..3b30abd8ae --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/autotests/registrytest.cpp @@ -0,0 +1,113 @@ +// SPDX-FileCopyrightText: 2024 g10 Code GmbH +// SPDX-FileContributor: Tobias Fella +// SPDX-License-Identifier: GPL-2.0-or-later + +#include + +#include +#include +#include +#include +#include + +using namespace Qt::Literals; + +class RegistryTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void initTestCase() + { + QStandardPaths::setTestModeEnabled(true); + + qApp->setOrganizationName(QStringLiteral("KDE")); + + auto hkcuPath = QFINDTESTDATA("registry_test_hkcu.reg"); + QVERIFY(hkcuPath.length() > 0); + QCOMPARE(QProcess::execute(QStringLiteral("reg"), {QStringLiteral("import"), hkcuPath}), 0); + QFile::remove(QStringLiteral("registry_test_hkcu.reg")); + + auto hklmPath = QFINDTESTDATA("registry_test_hklm.reg"); + QVERIFY(hklmPath.length() > 0); + if (QProcess::execute(QStringLiteral("reg"), {QStringLiteral("import"), hklmPath})) { + qWarning() << "Unable to import HKLM registry keys (missing privileges?). Import them manually and repeat test."; + } + QFile::remove(QStringLiteral("registry_test_hklm.reg")); + } + void testReadValues() + { + auto config = KSharedConfig::openConfig(); + + KConfigGroup defaultGroup(config, QStringLiteral("")); + QCOMPARE(defaultGroup.readEntry("should_be_1", 0), 1); + + KConfigGroup group(config, QStringLiteral("fooGroup")); + QCOMPARE(group.readEntry("should_be_5", 1), 5); + QCOMPARE(group.readEntry("should_be_hello", QString()), QStringLiteral("hello")); + + KConfigGroup nestedGroup(&group, QStringLiteral("nestedGroup")); + QCOMPARE(nestedGroup.readEntry("should_be_1", 0), 1); + + KConfigGroup immutableGroup(config, QStringLiteral("immutableGroup")); + QCOMPARE(immutableGroup.readEntry("should_be_hello", QString()), QStringLiteral("hello")); + KConfigGroup immutableNestedGroup(&immutableGroup, QStringLiteral("nestedGroup")); + QCOMPARE(immutableNestedGroup.readEntry("should_be_hello", QString()), QStringLiteral("hello")); + } + + void testImmutability() + { + auto config = KSharedConfig::openConfig(); + KConfigGroup group(config, QStringLiteral("fooGroup")); + QVERIFY(!group.isImmutable()); + QVERIFY(!group.isEntryImmutable("should_be_5")); + QVERIFY(group.isEntryImmutable("should_be_immutable")); + + KConfigGroup nestedGroup(&group, QStringLiteral("nestedGroup")); + QVERIFY(!nestedGroup.isImmutable()); + + KConfigGroup immutableGroup(config, QStringLiteral("immutableGroup")); + QVERIFY(immutableGroup.isImmutable()); + QVERIFY(immutableGroup.isEntryImmutable("normal_entry")); + QVERIFY(immutableGroup.isEntryImmutable("immutable_entry")); + + QVERIFY(immutableGroup.hasGroup(QStringLiteral("nestedGroup"))); + KConfigGroup immutableNestedGroup(&immutableGroup, QStringLiteral("nestedGroup")); + QVERIFY(immutableNestedGroup.isImmutable()); + } + + void testFileName() + { + QCOMPARE(KSharedConfig::openConfig(QStringLiteral("named_config"))->group(QStringLiteral("")).readEntry("value", 0), 1); + // trailing "rc" is removed from file name + QCOMPARE(KSharedConfig::openConfig(QStringLiteral("named_configrc"))->group(QStringLiteral("")).readEntry("value", 0), 1); + } + + void testHierarchy() + { + auto config = KSharedConfig::openConfig(); + KConfigGroup group(config, QStringLiteral("")); + QCOMPARE(group.readEntry("value_from_hklm", QString()), QStringLiteral("hklm")); + QCOMPARE(group.readEntry("overwritten_value", QString()), QStringLiteral("hkcu")); + QCOMPARE(group.readEntry("immutable_value", QString()), QStringLiteral("hklm")); + QVERIFY(group.isEntryImmutable("immutable_value")); + QVERIFY(!group.isEntryImmutable("value_from_hklm")); + + KConfigGroup immutableGroup(config, QStringLiteral("inherit_immutable_group")); + QCOMPARE(immutableGroup.readEntry("test_value", 0), 0); + } + + void testNotExistingRegistryKeyIsNotCreated() + { + KSharedConfig::openConfig(u"does_not_exist"_s); + QSettings settings(u"HKEY_CURRENT_USER\\SOFTWARE"_s, QSettings::NativeFormat); + QVERIFY(settings.childGroups().contains(u"KDE"_s)); + settings.beginGroup(u"KDE"_s); + const QStringList allKeys = settings.allKeys(); + QVERIFY(!settings.childGroups().contains(u"does_not_exist"_s)); + } +}; + +QTEST_MAIN(RegistryTest) + +#include "registrytest.moc" diff --git a/local/recipes/kde/kf6-kconfig/source/src/core/kconfig-index.qdoc b/local/recipes/kde/kf6-kconfig/source/src/core/kconfig-index.qdoc new file mode 100644 index 0000000000..c9c3ec88b0 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/src/core/kconfig-index.qdoc @@ -0,0 +1,43 @@ +/*! + \page kconfig-index.html + \title KConfig + + Persistent platform-independent application settings. + + KConfig provides an advanced configuration system. It is made of two parts: + KConfigCore and KConfigGui. + + KConfigCore provides access to the configuration files themselves. It features: + \list + \li Code generation: describe your configuration in an XML file, and use + kconfig_compiler to generate classes that read and write configuration + entries. + \li Cascading configuration files (global settings overridden by local settings). + \li Optional shell expansion support. + \li The ability to lock down configuration options. + \endlist + + KConfigGui provides a way to hook widgets to the configuration so that they are + automatically initialized from the configuration and automatically propagate + their changes to their respective configuration files. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {Config} {KF6::ConfigCore} + + \section1 API Reference + + \list + \li \l{KConfigCore C++ Classes} + \li \l{KConfigGui C++ Classes} + \li \l{KConfigQml C++ Classes} + \li \l{KConfig QML Types} + \li \l{kconf_update Tool} + \li \l{The KDE Configuration Compiler} + \li \l{Obsolete Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kconfig/source/src/core/kconfigcore.qdoc b/local/recipes/kde/kf6-kconfig/source/src/core/kconfigcore.qdoc new file mode 100644 index 0000000000..5296c90273 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/src/core/kconfigcore.qdoc @@ -0,0 +1,20 @@ +/*! + \module KConfigCore + \title KConfigCore C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Config + \cmaketargetitem KF6::ConfigCore + + \brief Persistent platform-independent application settings. + + KConfigCore provides access to the configuration files themselves. It features: + \list + \li Code generation: describe your configuration in an XML file, and use + kconfig_compiler to generate classes that read and write configuration + entries. + \li Cascading configuration files (global settings overridden by local settings). + \li Optional shell expansion support. + \li The ability to lock down configuration options. + \endlist +*/ diff --git a/local/recipes/kde/kf6-kconfig/source/src/core/kconfigcore.qdocconf b/local/recipes/kde/kf6-kconfig/source/src/core/kconfigcore.qdocconf new file mode 100644 index 0000000000..252c9a7473 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/src/core/kconfigcore.qdocconf @@ -0,0 +1,36 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KConfigCore +description = Persistent platform-independent application settings + +documentationinheaders = true + +headerdirs += . +sourcedirs += . ../kconf_update ../kconfig_compiler + +outputformats = HTML + +navigation.landingpage = "KConfig" + +depends += \ + kde \ + qtcore \ + kconfiggui \ + kconfigqml \ + kcoreaddons + +qhp.projects = KConfigCore + +qhp.KConfigCore.file = kconfigcore.qhp +qhp.KConfigCore.namespace = org.kde.kconfigcore.$QT_VERSION_TAG +qhp.KConfigCore.virtualFolder = kconfigcore +qhp.KConfigCore.indexTitle = KConfig Core +qhp.KConfigCore.indexRoot = + +qhp.KConfigCore.subprojects = classes +qhp.KConfigCore.subprojects.classes.title = C++ Classes +qhp.KConfigCore.subprojects.classes.indexTitle = KConfig Core C++ Classes +qhp.KConfigCore.subprojects.classes.selectors = class fake:headerfile +qhp.KConfigCore.subprojects.classes.sortPages = true + +tagfile = kconfigcore.tags diff --git a/local/recipes/kde/kf6-kconfig/source/src/core/kconfiginibackendreader_p.h b/local/recipes/kde/kf6-kconfig/source/src/core/kconfiginibackendreader_p.h new file mode 100644 index 0000000000..cf70b83b19 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/src/core/kconfiginibackendreader_p.h @@ -0,0 +1,438 @@ +// SPDX-License-Identifier: LGPL-2.0-or-later +// SPDX-FileCopyrightText: 2006, 2007 Thomas Braxton +// SPDX-FileCopyrightText: 1999 Preston Brown +// SPDX-FileCopyrightText: 1997 Matthias Kalle Dalheimer +// SPDX-FileCopyrightText: 2025 Harald Sitter + +#pragma once + +#include +#include +#include +#include + +#ifdef Q_OS_ANDROID +#include +#endif + +#include +#include + +#ifndef Q_OS_WIN +#include // getuid +#endif +#include // uid_t + +#include "kconfig_core_log_settings.h" + +using namespace Qt::StringLiterals; + +// Wraps a QLockFile to allow no-op locking when locking is not supported (e.g. QIODevice based backends). +class AbstractLockFile +{ +public: + AbstractLockFile() = default; + virtual ~AbstractLockFile() = default; + Q_DISABLE_COPY_MOVE(AbstractLockFile) + + [[nodiscard]] virtual bool tryLock(std::chrono::milliseconds timeout = std::chrono::milliseconds::zero()) = 0; + [[nodiscard]] virtual bool isLocked() const = 0; + [[nodiscard]] virtual QString fileName() const = 0; + virtual void unlock() = 0; + [[nodiscard]] virtual QLockFile::LockError error() const = 0; +}; + +class RealLockFile : public AbstractLockFile +{ +public: + RealLockFile(std::unique_ptr &&lockFile) + : m_lockFile(std::move(lockFile)) + { + m_lockFile->setStaleLockTime(std::chrono::seconds{20}); + } + + [[nodiscard]] bool tryLock(std::chrono::milliseconds timeout) override + { + return m_lockFile->tryLock(timeout); + } + + void unlock() override + { + m_lockFile->unlock(); + } + + [[nodiscard]] bool isLocked() const override + { + return m_lockFile->isLocked(); + } + QString fileName() const override + { + return m_lockFile->fileName(); + } + + [[nodiscard]] QLockFile::LockError error() const override + { + return m_lockFile->error(); + } + +private: + std::unique_ptr m_lockFile; +}; + +class FakeLockFile : public AbstractLockFile +{ +public: + [[nodiscard]] bool tryLock(std::chrono::milliseconds timeout) override + { + Q_UNUSED(timeout) + return m_locked = true; + } + + void unlock() override + { + m_locked = false; + } + + [[nodiscard]] bool isLocked() const override + { + return m_locked; + } + + [[nodiscard]] QString fileName() const override + { + return {}; + } + + [[nodiscard]] QLockFile::LockError error() const override + { + return QLockFile::LockError::NoError; + } + +private: + bool m_locked = false; +}; + +class KConfigIniBackendAbstractDevice +{ +public: + struct OpenResult { + bool shouldHaveDevice; + std::shared_ptr device; + }; + + KConfigIniBackendAbstractDevice() = default; + virtual ~KConfigIniBackendAbstractDevice() = default; + Q_DISABLE_COPY_MOVE(KConfigIniBackendAbstractDevice) + + // The local file path for path based devices or a pseudo name for all others. + [[nodiscard]] virtual QString id() const = 0; + [[nodiscard]] virtual bool isDeviceReadable() const = 0; + [[nodiscard]] virtual bool canWriteToDevice() const = 0; + [[nodiscard]] virtual bool writeToDevice(const std::function &write) = 0; + [[nodiscard]] virtual OpenResult open() = 0; + [[nodiscard]] virtual std::unique_ptr lockFile() = 0; + virtual void createEnclosingEntity() = 0; + virtual void setFilePath(const QString &path) = 0; +}; + +class KConfigIniBackendNullDevice : public KConfigIniBackendAbstractDevice +{ +public: + [[nodiscard]] QString id() const override + { + return u"((NullDevice))"_s; + } + + [[nodiscard]] bool isDeviceReadable() const override + { + return false; + } + + [[nodiscard]] bool canWriteToDevice() const override + { + return false; + } + + [[nodiscard]] bool writeToDevice(const std::function &write) override + { + Q_UNUSED(write) + return false; + } + + [[nodiscard]] OpenResult open() override + { + return {.shouldHaveDevice = false, .device = nullptr}; + } + + [[nodiscard]] std::unique_ptr lockFile() override + { + return std::make_unique(); + } + + void createEnclosingEntity() override + { + } + + void setFilePath(const QString &path) override + { + Q_UNUSED(path) + } +}; + +class KConfigIniBackendPathDevice : public KConfigIniBackendAbstractDevice +{ +public: + explicit KConfigIniBackendPathDevice(const QString &path) + { + setFilePath(path); + } + + [[nodiscard]] QString id() const override + { + return m_localFilePath; + } + + [[nodiscard]] bool isDeviceReadable() const override + { + return !m_localFilePath.isEmpty(); + } + + [[nodiscard]] bool canWriteToDevice() const override + { + const QString filePath = m_localFilePath; + if (filePath.isEmpty()) { + return false; + } + + QFileInfo file(filePath); + if (file.exists()) { + return file.isWritable(); + } + + // If the file does not exist, check if the deepest existing dir is writable + QFileInfo dir(file.absolutePath()); + while (!dir.exists()) { + QString parent = dir.absolutePath(); // Go up. Can't use cdUp() on non-existing dirs. + if (parent == dir.filePath()) { + // no parent + return false; + } + dir.setFile(parent); + } + return dir.isDir() && dir.isWritable(); + } + + [[nodiscard]] bool writeToDevice(const std::function &write) override + { + // check if file exists + QFile::Permissions fileMode = filePath().startsWith(u"/etc/xdg/"_s) ? QFile::ReadUser | QFile::WriteUser | QFile::ReadGroup | QFile::ReadOther // + : QFile::ReadUser | QFile::WriteUser; + + bool createNew = true; + + QFileInfo fi(filePath()); + if (fi.exists()) { +#ifdef Q_OS_WIN + // TODO: getuid does not exist on windows, use GetSecurityInfo and GetTokenInformation instead + createNew = false; +#else + if (fi.ownerId() == ::getuid()) { + // Preserve file mode if file exists and is owned by user. + fileMode = fi.permissions(); + } else { + // File is not owned by user: + // Don't create new file but write to existing file instead. + createNew = false; + } +#endif + } + + if (createNew) { + QSaveFile file(filePath()); + if (!file.open(QIODevice::WriteOnly)) { +#ifdef Q_OS_ANDROID + // HACK: when we are dealing with content:// URIs, QSaveFile has to rely on DirectWrite. + // Otherwise this method returns a false and we're done. + file.setDirectWriteFallback(true); + if (!file.open(QIODevice::WriteOnly)) { + qWarning(KCONFIG_CORE_LOG) << "Couldn't create a new file:" << filePath() << ". Error:" << file.errorString(); + return false; + } +#else + qWarning(KCONFIG_CORE_LOG) << "Couldn't create a new file:" << filePath() << ". Error:" << file.errorString(); + return false; +#endif + } + + file.setTextModeEnabled(true); // to get eol translation + write(file); + + if (!file.size() && (fileMode == (QFile::ReadUser | QFile::WriteUser))) { + // File is empty and doesn't have special permissions: delete it. + file.cancelWriting(); + + if (fi.exists()) { + // also remove the old file in case it existed. this can happen + // when we delete all the entries in an existing config file. + // if we don't do this, then deletions and revertToDefault's + // will mysteriously fail + QFile::remove(filePath()); + } + } else { + // Normal case: Close the file + if (file.commit()) { + QFile::setPermissions(filePath(), fileMode); + return true; + } + // Couldn't write. Disk full? + qCWarning(KCONFIG_CORE_LOG) << "Couldn't write" << filePath() << ". Disk full?"; + return false; + } + } else { + QFile f(filePath()); + + // Open existing file. *DON'T* create it if it suddenly does not exist! + if (!f.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::ExistingOnly)) { + return false; + } + + f.setTextModeEnabled(true); + write(f); + } + + return true; + } + + [[nodiscard]] OpenResult open() override + { + auto file = std::make_unique(m_localFilePath); + if (!file->open(QIODevice::ReadOnly | QIODevice::Text)) { + return {.shouldHaveDevice = file->exists(), .device = nullptr}; + } + return {.shouldHaveDevice = true, .device = std::move(file)}; + } + + void createEnclosingEntity() override + { + const QString file = m_localFilePath; + if (file.isEmpty()) { + return; // nothing to do + } + + // Create the containing dir, maybe it wasn't there + if (!QDir().mkpath(QFileInfo(file).absolutePath())) { + qWarning("KConfigIniBackend: Could not create enclosing directory for %s", qPrintable(file)); + } + } + + void setFilePath(const QString &path) override + { + if (path.isEmpty()) { + return; + } + + Q_ASSERT(QDir::isAbsolutePath(path)); + if (!QDir::isAbsolutePath(path)) { + qWarning() << "setFilePath" << path; + } + + const QFileInfo info(path); + if (info.exists()) { + setLocalFilePath(info.canonicalFilePath()); + return; + } + + if (QString filePath = info.dir().canonicalPath(); !filePath.isEmpty()) { + filePath += QLatin1Char('/') + info.fileName(); + setLocalFilePath(filePath); + } else { + setLocalFilePath(path); + } + } + + [[nodiscard]] std::unique_ptr lockFile() override + { +#ifdef Q_OS_ANDROID + // handle content Uris properly + if (filePath().startsWith(QLatin1String("content://"))) { + // we can't create file at an arbitrary location, so use internal storage to create one + + // NOTE: filename can be the same, but because this lock is short lived we may never have a collision + return std::make_unique(std::make_unique(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + + QLatin1String("/") + QFileInfo(filePath()).fileName() + + QLatin1String(".lock"))); + } + return std::make_unique(std::make_unique(filePath() + QLatin1String(".lock"))); +#else + return std::make_unique(std::make_unique(filePath() + QLatin1String(".lock"))); +#endif + } + +private: + /* the absolute path to the object */ + [[nodiscard]] QString filePath() const + { + return m_localFilePath; + } + + void setLocalFilePath(const QString &file) + { + m_localFilePath = file; + } + + QString m_localFilePath; +}; + +class KConfigIniBackendQIODevice : public KConfigIniBackendAbstractDevice +{ +public: + KConfigIniBackendQIODevice(const std::shared_ptr &device) + : m_device(device) + { + } + + [[nodiscard]] QString id() const override + { + return u"((QIODevice))"_s; + } + + [[nodiscard]] bool isDeviceReadable() const override + { + return m_device->isOpen() && m_device->isReadable(); + } + + [[nodiscard]] bool canWriteToDevice() const override + { + return m_device->isOpen() && m_device->isWritable(); + } + + [[nodiscard]] bool writeToDevice(const std::function &write) override + { + m_device->setTextModeEnabled(true); + write(*m_device); + return true; + } + + [[nodiscard]] OpenResult open() override + { + return {.shouldHaveDevice = true, .device = m_device}; + } + + [[nodiscard]] std::unique_ptr lockFile() override + { + return std::make_unique(); + } + + void createEnclosingEntity() override + { + // nothing to do + } + + void setFilePath([[maybe_unused]] const QString &path) override + { + // nothing to do + } + +private: + std::shared_ptr m_device; +}; diff --git a/local/recipes/kde/kf6-kconfig/source/src/core/registry_win.cpp b/local/recipes/kde/kf6-kconfig/source/src/core/registry_win.cpp new file mode 100644 index 0000000000..dac5c0d10e --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/src/core/registry_win.cpp @@ -0,0 +1,74 @@ +/* + SPDX-FileCopyrightText: 2022 g10 Code GmbH + SPDX-FileContributor: Andre Heinecke + SPDX-FileContributor: Tobias Fella + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "registry_win_p.h" + +#include + +#include + +enum Registry { + HKLM, + HKCU, +}; + +static void parseRegValues(const QString &groupName, QSettings &settings, KEntryMap &entryMap, bool groupImmutable) +{ + for (auto &key : settings.childKeys()) { + KEntryMap::EntryOptions entryOptions = KEntryMap::EntryDefault; + const auto value = settings.value(key).toString().toStdWString(); + const auto requiredSize = ExpandEnvironmentStringsW(value.c_str(), nullptr, 0); + std::vector expanded(requiredSize, char16_t(0)); + ExpandEnvironmentStringsW(value.c_str(), (LPWSTR)expanded.data(), expanded.size()); + if (key.endsWith(QStringLiteral("[$i]"))) { + key.chop(4); + entryOptions |= KEntryMap::EntryImmutable; + } + if (groupImmutable) { + entryOptions |= KEntryMap::EntryImmutable; + } + key = key.replace(QLatin1Char('\\'), QLatin1Char('/')); + if (entryMap.getEntryOption(groupName, key.toUtf8(), KEntryMap::SearchDefaults, KEntryMap::EntryImmutable)) { + continue; + } + entryMap.setEntry(groupName, key.toUtf8(), QString::fromUtf16(&expanded[0]), entryOptions); + } +} + +static void parseRegSubkeys(const QString &baseGroup, QSettings &settings, KEntryMap &entryMap, bool immutable) +{ + parseRegValues(baseGroup, settings, entryMap, immutable); + + for (auto &group : settings.childGroups()) { + bool groupImmutable = immutable; + QString groupWithoutSuffix = group; + if (group.endsWith(QStringLiteral("[$i]"))) { + groupWithoutSuffix.chop(4); + groupImmutable = true; + } + settings.beginGroup(group); + QString groupName = (baseGroup == QStringLiteral("") ? QString() : (baseGroup + QLatin1Char('\x1d'))) + groupWithoutSuffix; + parseRegSubkeys(groupName, settings, entryMap, groupImmutable); + settings.endGroup(); + entryMap.setEntry(groupName, {}, QByteArray(), groupImmutable ? KEntryMap::EntryImmutable : KEntryMap::EntryOptions()); + } +} + +static void parseRegistry(const QString ®Key, KEntryMap &entryMap, Registry registry) +{ + QSettings settings((registry == HKCU ? QStringLiteral("HKEY_CURRENT_USER\\SOFTWARE") : QStringLiteral("HKEY_LOCAL_MACHINE\\SOFTWARE")), + QSettings::NativeFormat); + settings.beginGroup(regKey); + parseRegSubkeys(QStringLiteral(""), settings, entryMap, false); +} + +void WindowsRegistry::parse(const QString ®Key, KEntryMap &entryMap) +{ + parseRegistry(regKey, entryMap, HKLM); + parseRegistry(regKey, entryMap, HKCU); +} diff --git a/local/recipes/kde/kf6-kconfig/source/src/core/registry_win_p.h b/local/recipes/kde/kf6-kconfig/source/src/core/registry_win_p.h new file mode 100644 index 0000000000..ab4ba97bbd --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/src/core/registry_win_p.h @@ -0,0 +1,13 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2022 g10 Code GmbH + SPDX-FileContributor: Andre Heinecke + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#include "kconfigdata_p.h" + +namespace WindowsRegistry +{ +void parse(const QString ®Key, KEntryMap &entryMap); +} diff --git a/local/recipes/kde/kf6-kconfig/source/src/gui/kconfiggui.qdoc b/local/recipes/kde/kf6-kconfig/source/src/gui/kconfiggui.qdoc new file mode 100644 index 0000000000..b1c7440780 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/src/gui/kconfiggui.qdoc @@ -0,0 +1,14 @@ +/*! + \module KConfigGui + \title KConfigGui C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Config + \cmaketargetitem KF6::ConfigGui + + \brief Persistent platform-independent application settings. + + KConfigGui provides a way to hook widgets to the configuration so that they are + automatically initialized from the configuration and automatically propagate + their changes to their respective configuration files. +*/ diff --git a/local/recipes/kde/kf6-kconfig/source/src/gui/kconfiggui.qdocconf b/local/recipes/kde/kf6-kconfig/source/src/gui/kconfiggui.qdocconf new file mode 100644 index 0000000000..eeaed9b1da --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/src/gui/kconfiggui.qdocconf @@ -0,0 +1,35 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KConfigGui +description = Persistent platform-independent application settings + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +navigation.landingpage = "KConfig" + +depends += \ + kde \ + qtcore \ + qtgui \ + kconfigcore + +qhp.projects = KConfigGui + +qhp.KConfigGui.file = kconfiggui.qhp +qhp.KConfigGui.namespace = org.kde.kconfiggui.$QT_VERSION_TAG +qhp.KConfigGui.virtualFolder = kconfiggui +qhp.KConfigGui.indexTitle = KConfig Gui +qhp.KConfigGui.indexRoot = + +qhp.KConfigGui.subprojects = classes +qhp.KConfigGui.subprojects.classes.title = C++ Classes +qhp.KConfigGui.subprojects.classes.indexTitle = KConfig Gui C++ Classes +qhp.KConfigGui.subprojects.classes.selectors = class fake:headerfile +qhp.KConfigGui.subprojects.classes.sortPages = true + +tagfile = kconfiggui.tags diff --git a/local/recipes/kde/kf6-kconfig/source/src/kconf_update/kconf_update.qdoc b/local/recipes/kde/kf6-kconfig/source/src/kconf_update/kconf_update.qdoc new file mode 100644 index 0000000000..e6c69fd05b --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/src/kconf_update/kconf_update.qdoc @@ -0,0 +1,25 @@ +/*! +\page kconfupdate.html +\title kconf_update Tool + +kconf_update is a tool designed to update config files. Over time applications +sometimes need to rearrange the way configuration options are stored. Since +such an update shouldn't influence the configuration options that the user +has selected, the application must take care that the options stored in the +old way will still be honored. + +What used to happen is that the application looks up both the old and the +new configuration option and then decides which one to use. This method has +several drawbacks: +\list +\li The application may need to read more configuration files than strictly + needed, resulting in a slower startup. +\li The application becomes bigger with code that will only be used once. +\endlist + +kconf_update addresses these problems by offering a framework to update +configuration files without adding code to the application itself. + +See the \l {https://techbase.kde.org/Development/Tools/Using_kconf_update} {Wiki} for more information. + +*/ diff --git a/local/recipes/kde/kf6-kconfig/source/src/kconfig_compiler/kconfigcompiler.qdoc b/local/recipes/kde/kf6-kconfig/source/src/kconfig_compiler/kconfigcompiler.qdoc new file mode 100644 index 0000000000..45bdc71a6e --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/src/kconfig_compiler/kconfigcompiler.qdoc @@ -0,0 +1,590 @@ +/*! +\page kconfigcompiler +\title The KDE Configuration Compiler + +kconfig_compiler generates C++ source code from an XML file containing +information about configuration options (.kcfg) and a file that provides +the code generation options (.kcfgc) The generated class is based on +KConfigSkeleton and provides an API for the application to access its +configuration data. + +The generated C++ source code is output to a .h and a .cpp file, whose base +name is the same as that of the .kcfgc file. + +\section1 The .kcfg XML file format: description of the configuration skeleton + +The structure of the .kcfg file is described by its DTD kcfg.xsd. + +The \ tag may contain either the "name" attribute, which should be the name +of the configuration file described, or the "arg" attribute, which, if set to +"true", will allow you to pass the KSharedConfig::Ptr object to use. + +If neither "name" nor "arg" is set, the default configuration file +("\rc") will be used. + +The \ tags are optional and may contain C++ header files that +are needed to compile the code needed to compute default values. To generate +a \#include "..." statement instead of \#include \<...\>, enclose the header +file name in double quotes (e.g. \"header.h"\). + +The remaining entries in the XML file are grouped by the tag \ +which describes the corresponding group in the configuration file. + +The individual entries must have at least a name or a key. The key is used +as the key in the config file, while the name is used to create accessor and +modifier functions. If \ is given, but not \, the name is +constructed by removing all spaces from \. If \ is given, but +not \, the key is the same as \. + +An entry must also have a type. The list of allowable types is +specified in the DTD and loosely follows the list of types supported +by the QVariant with exception of the clearly binary types +(e.g. Pixmap, Image...) which are not supported. Besides those basic +types the following special types are supported: + +\table + \header + \li Type + \li Description + + \row + \li Path + \li This is a string that is specially treated as a file-path. + In particular paths in the home directory are prefixed with $HOME in + when being stored in the configuration file. + + \row + \li Enum + \li This indicates an enumeration. The possible enum values and optional + enum name should be provided via the \ tag. Enum values are + accessed as integers by the application but stored as strings in the + configuration file. This makes it possible to add more values at a later + date without breaking compatibility. + + \row + \li IntList + \li This indicates a list of integers. This information is provided + to the application as QList. Useful for storing QSplitter + geometries. + + \row + \li Color + \li Isn't a special type but has special input. It is generated as QColor. + Any valid input to QColor(QString) can be used (hex or SVG keyword notation) + as well as a special format r,g,b,a where the a denotes the alpha channel and + may be omitted. +\endtable + +An entry can optionally have a default value which is used as default when +the value isn't specified in any config file. Default values are interpreted +as literal constant values. If a default value needs to be computed +or if it needs to be obtained from a function call, the \ tag +should contain the code="true" attribute. The contents of the \ +tag is then considered to be a C++ expression. Note that in this case you +might have to add an \ tag as described above, or a +SourceIncludeFiles entry in the .kcfgc file as described below, so that the +code which computes the default value can be compiled. + +Additional code for computing default values can be provided outside any +entry definition via the \ tag. The contents of the \ tag is +inserted as-is. A typical use for this is to compute a common default value +which can then be referenced by multiple entries that follow. + +\section1 The .kcfgc file format: code generation options + +The options for generating the C++ sources are read from the file with the +extension .kcfgc. To generate a class add the corresponding kcfgc file to the +SOURCES line in the Makefile.am. + +The following options are read from the kcfgc file: + +\table + \header + \li Option + \li Description + \li Default + \li Since + + \row + \li File=\ + \li Name of kcfg file containing the options the class is generated for + \li \.kcfg + \li + + \row + \li HeaderExtension=\ + \li Extension to use for the name of the generated C++ header files. + \li h + \li 5.57 + + \row + \li NameSpace=\ + \li Optional namespace for generated class + \li + \li + + \row + \li ClassName=\ + \li Name of generated class (required) + \li + \li + + \row + \li Inherits=\ + \li Class the generated class inherits from. + + This class must inherit KConfigSkeleton and must provide a default + constructor (kcfgfile not specified), a constructor taking a + QString argument (kcfgfile with "name" attribute) and a constructor + taking a KSharedConfig::Ptr as argument (kcfgfile with "arg" attribute). + + Please refer to the documentation of KConfigSkeleton. + \li KConfigSkeleton + \li + + \row + \li Visibility=\ + \li Inserts visibility directive (for example KDE_EXPORT) between + "class" keyword and class name in header file + \li + \li + + \row + \li Singleton=\ + \li Generated class is a singleton. + \li false + \li + + \row + \li CustomAdditions=\ + \li + \li + \li + + \row + \li MemberVariables=\ + \li C++ access modifier used for member variables holding the configuration values + + Values: public, protected, private, dpointer + \li private + \li + + \row + \li IncludeFiles=\, \ ... + \li Names of files to be included in the header of the generated class. + + Enclose a file name in (escaped) double quotes to generate + \#include "..." instead of \#include \<...\>. + \li + \li + + \row + \li SourceIncludeFiles=\, \ ... + \li Names of files to be included in the source file of the generated class. + + Enclose a file name in (escaped) double quotes to generate + \#include "..." instead of \#include \<...\>. + \li + \li + + \row + \li Mutators=\ + \li Values: true, false or a comma separated list of options + + If true, mutator functions for all configuration options are generated. + + If false, no mutator functions are generated. If a list is provided, + mutator functions are generated for the options that are listed. + \li false + \li + + \row + \li Notifiers=\ + \li Values: true, false or a comma separated list of options + If true, entries will be written with the Notify flag enabled, + so changes can be detected using KConfigWatcher. + If a list is provided, the options that are listed are written with + said flag. + \li false + \li + + \row + \li DefaultValueGetters=\ + \li Values: true, false or a comma separated list of options + If true, functions to return the default value of all configuration options + are generated. If false, no default value functions are generated. If a list + is provided, default value functions are generated for the options that are listed. + \li false + + \row + \li ItemAccessors=\ + \li Generate accessor functions for the KConfigSkeletonItem objects + corresponding to the configuration options. If SetUserTexts is set, + ItemAccessors also has to be set. + \li false + \li + + \row + \li SetUserTexts=\ + \li Set the label and whatthis texts of the items from the kcfg file. + If SetUserTexts is set, ItemAccessors also has to be set. + \li false + \li + + \row + \li GlobalEnums=\ + \li If set to true all choices of Enum items will be created in the global + scope of the generated class. If set to false, each Enum item whose enum is not + explicitly named will get its own namespace for its choices. + \li false + \li + + \row + \li UseEnumTypes=\ + \li If set to true, all Enum items whose enums are named will use enum types for + the return value of accessor functions and for the parameter of mutator + functions. This eliminates the need to cast accessor return values to the enum + type if you want to use the enum type in your own code. If set to false, + accessor return values and mutator parameters will be of type int. + \li false + \li + + \row + \li ForceStringFilename=\ + \li If set to true, forces the first parameter of the generated class + to be a QString when using an argument for the filename. + + This is useful to specify at runtime the filename of the configuration class. + \li false + \li + + \row + \li GenerateProperties=\ + \li If set to true, a Q_PROPERTY will be generated for each member variable holding a + configuration value and the Q_OBJECT macro will be added to the generated class. + + Note that you will also need to pass the GENERATE_MOC option to the kconfig_add_kcfg_files macro. + \li false + \li + + \row + \li ParentInConstructor=\ + \li If set to true, the generated constructor will take an additional QObject* + parameter that will be used as the object's parent. + + This is useful when working with KQuickAddons::ManagedConfigModule + to set it as the parent of the generated class to allow automatic + settings discovery and handle the deallocation. + + Note this parameter is incompatible with Singleton set to true. + \li false + \li + + \row + \li TranslationSystem=\ + \li Set the translation system for label, tooltip and whatsthis text in generated KConfigSkeleton. + + Set the value to kde to use the KDE Framework translation system, see KI18n. + \li qt + \li + + \row + \li TranslationDomain=\ + \li When TranslationSystem=kde is set, allow to specify the domain in which to look for translations. + \li + \li + + \row + \li QmlUncreatable=\ + \li If set to true the generated code will use the QML_UNCREATABLE macro to register the type to QML. + + This shouldn't combined with Singleton, and can only be passed to C++ manually. + \li false + \li 6.11 + + \row + \li QmlRegistration=\ + \li If set to true the generated code will use the QML_ELEMENT macro to register the type to QML. + + If Singleton is also true it will be registered as a QML singleton using QML_SINGLETON + \li false + \li 6.4 + + \row + \li KConfigConstructor=\ + \li If set to true the generated code will have an alternative constructor directly from + const std::unique_ptr instead of KSharedConfigPtr. + \li false + \li 6.23 + +\endtable + + +\section1 Advanced entry options + +There are several possibilities to parameterize entries. + +\section2 Parameterized entries + +An entry can be parameterized using a fixed range parameter specified with +the \ tag. Such parameter can either be an Enum or an int. An Enum +parameter should specify the possible enumeration values with the \ +tag. An int parameter should specify its maximum value. Its minimum value +is always 0. + +A parameterized entry is expanded to a number of entries, one for each +value in the parameter range. The name and key should contain a reference +to the parameter in the form of $(parameter-name). When expanding the entries +the $(parameter-name) part is replaced with the value of the parameter. +In the case of an Enum parameter it is replaced with the name of the +enumuration value. In the case of an int parameter it is replaced with +the numeric value of the parameter. + +Parameterized entries all share the same default value unless different +default values have been specified for specific parameter values. +This can be done with the param= attribute of the \. When a +param attribute is specified the default value only applies to that +particular parameter value. + +Example 1: +\badcode + + + #ff0000 + #00ff00 + #0000ff + #ffff00 + +\endcode + +The above describes 4 color configuration entries with the following defaults: + +\badcode +color_0=#ff0000 +color_1=#00ff00 +color_2=#0000ff +color_3=#ffff00 +\endcode + +The configuration options will be accessible to the application via +a QColor color(int ColorIndex) and a +void setColor(int ColorIndex, const QColor &v) function. + +Example 2: +\badcode + + + + Explosion + Crash + Missile + + + boom.wav + crash.wav + missile.wav + +\endcode + +The above describes 3 string configuration entries with the following defaults: + +\badcode +sound_Explosion=boom.wav +sound_Crash=crash.wav +sound_Missile=missile.wav +\endcode + +The configuration options will be accessible to the application via +a QString sound(int SoundEvent) and a +void setSound(int SoundEvent, const QString &v) function. + +\section2 Parameterized groups + +A group name can be parametrized using a parameter given to the KConfigSkeleton +instance (which means this feature cannot be used with singleton classes). + +Example 1: +\badcode + + + + + + + +\endcode + +In this case passing "Group2" as the 'groupname' parameter to the generated class +will make it use group "Group2" for the entry "Text". + +By setting the stateConfig attribute of kcfgfile to "true", KSharedConfig::openStateConfig is used. +This should be used when one stores volatile data, like window sizes or autocompletion texts. +It is recommended to have at least two separate kcfg files for the different kinds of data. + +\note This option is ignored when ForceStringFilename is set. + +\section2 Enums + +By default, if GlobalEnums is set to false, a separate named enum will be generated +for each Enum entry. Since each enum is defined in a little enclosing class of its own, +this allows the same Enum value names to be used in different enums. For example, the +.kcfg entry + +\badcode + + + + + + +\endcode + +will generate this public class containing the enum definition, inside the generated class: + +\code +class EnumKeepData +{ + public: + enum type { Do, Dont, COUNT }; +}; +\endcode + +Since 5.68, if present the value attribute will be used as the choice value written to the backend +instead of the name, allowing to write text incompatible with enum naming. + +Alternatively, if GlobalEnums is set to true, all Enum items are defined as +unnamed enums in the global scope of the generated class. In this case, all Enum values +must have different names to avoid clashes. However, you can use a 'prefix' argument +in \ to prevent duplicate enum member names clashing. Using this, the Enum value +names are prefixed in code with the string you specify. For example, if GlobalEnums +is set to true, the .kcfg entry + +\badcode + + + + + + +\endcode + +will generate config file entries of "KeepData=Do" and "KeepData=Dont", but the enum +will be declared + +\code +enum { Keep_Do, Keep_Dont }; +\endcode + +It is possible to specify your own name for a generated enum, by including a +'name' parameter in \. Just like unnamed enums, this enum will be defined in +the global scope of the generated class (without any enclosing class of its own). +Therefore the names of Enum values must be unique across both unnamed enums (if +GlobalEnums is set to true) and all specifically named enums. + +An example of a specifically named enum: + +\badcode + + + + + + +\endcode + +which results in the following enum declaration, inside the generated class: + +\code +enum Types { Do, Dont }; +\endcode + +It is also possible to specify the use of enums external to the generated class, by +including the string "::" in the enum name - just ensure that it is sufficiently +qualified to be unambiguous in use. To specify use of an unnamed enum, append a +trailing "::". For example, to use the enum 'myEnum' defined in class ClassA, use +either of + +\badcode + + +\endcode + +To specify an unnamed enum in namespace ProgSpace, use + +\badcode + +\endcode + +To specify a top-level unnamed enum, use + +\badcode + +\endcode + +To specify the top-level enum 'anotherEnum', use + +\badcode + +\endcode + + +\section2 Notify signals + +An entry can emit a signal when it gets changed. First of all, you must +define a list of signals for the configuration class. The signal's name may be +any legal identifier you wish. The \ tag allows you to specify arguments +for the emitted signal. It supports all types as defined in +the KConfigXT DTD. The argument value must specify the name, without spaces, of one +of the entries defined in the .kcfg file. +A signal definition can also contain a \ tag which will be +the documentation line in the generated file. + +\badcode + + + + + stylePath + StyleCSSVariant + +\endcode + +After defining the signals, you must tell which signal to emit for the entry. +A signal can be emitted by multiple entries. Also, you don't need to specify the arguments +for a signal, the signal name will suffice. + +\badcode + + + + +\endcode + +The signal will be emitted when save() is called. + +\warning You must not call save() in direct response to any notify signal. +If you need to call save(), +use a QueuedConnection to listen to the notify signal. + +You can also listen to the generic configChanged() signal from KConfigSkeleton to +notify your application about configuration changes. +In that case you may also call save() in direct response. + +Note that you will also need to pass the GENERATE_MOC option to the kconfig_add_kcfg_files macro. + +\section2 Translation context + +In the kcfg file you can specify the translation's context for \, \ and \ element for an entry. + +\badcode + + + Enable automatic saving of calendars to have calendars saved automatically. + false + +\endcode + +For more information on translation context and how to write good translatable text, +please refer to \l {https://api.kde.org/frameworks/ki18n/html/prg_guide.html} + +*/ diff --git a/local/recipes/kde/kf6-kconfig/source/src/qml/kconfigqml.qdoc b/local/recipes/kde/kf6-kconfig/source/src/qml/kconfigqml.qdoc new file mode 100644 index 0000000000..adb619a33d --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/src/qml/kconfigqml.qdoc @@ -0,0 +1,18 @@ +/*! + \module KConfigQml + \title KConfigQml C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Config + \cmaketargetitem KF6::ConfigQml + + \brief Persistent platform-independent application settings. + + */ + +/*! + \qmlmodule org.kde.config + \title KConfig QML Types + + \brief Persistent platform-independent application settings. +*/ diff --git a/local/recipes/kde/kf6-kconfig/source/src/qml/kconfigqml.qdocconf b/local/recipes/kde/kf6-kconfig/source/src/qml/kconfigqml.qdocconf new file mode 100644 index 0000000000..c971144911 --- /dev/null +++ b/local/recipes/kde/kf6-kconfig/source/src/qml/kconfigqml.qdocconf @@ -0,0 +1,36 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KConfigQml +description = Persistent platform-independent application settings + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +navigation.landingpage = "KConfig" + +depends += \ + kde \ + qtcore \ + qtqml \ + kconfigcore \ + kconfiggui + +qhp.projects = KConfigQml + +qhp.KConfigQml.file = kconfigqml.qhp +qhp.KConfigQml.namespace = org.kde.kconfigqml.$QT_VERSION_TAG +qhp.KConfigQml.virtualFolder = kconfigqml +qhp.KConfigQml.indexTitle = KConfig QML +qhp.KConfigQml.indexRoot = + +qhp.KConfigQml.subprojects = classes +qhp.KConfigQml.subprojects.classes.title = C++ Classes +qhp.KConfigQml.subprojects.classes.indexTitle = KConfig QML C++ Classes +qhp.KConfigQml.subprojects.classes.selectors = class fake:headerfile +qhp.KConfigQml.subprojects.classes.sortPages = true + +tagfile = kconfigqml.tags diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/po/lg/kconfigwidgets6.po b/local/recipes/kde/kf6-kconfigwidgets/source/po/lg/kconfigwidgets6.po new file mode 100644 index 0000000000..c20ef481c4 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/po/lg/kconfigwidgets6.po @@ -0,0 +1,532 @@ +# Copyright (C) 2025 This file is copyright: +# This file is distributed under the same license as the kconfigwidgets package. +# +# SPDX-FileCopyrightText: 2025 Kizito Birabwa +msgid "" +msgstr "" +"Project-Id-Version: kconfigwidgets\n" +"Report-Msgid-Bugs-To: https://bugs.kde.org\n" +"POT-Creation-Date: 2026-05-18 00:40+0000\n" +"PO-Revision-Date: 2025-05-27 20:26+0100\n" +"Last-Translator: Kizito Birabwa \n" +"Language-Team: Luganda\n" +"Language: lg\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Lokalize 24.05.2\n" + +#, kde-format +msgctxt "NAME OF TRANSLATORS" +msgid "Your names" +msgstr "Kizito Birabwa" + +#, kde-format +msgctxt "EMAIL OF TRANSLATORS" +msgid "Your emails" +msgstr "kbirabwa@yahoo.co.uk" + +#: kcodecaction.cpp:62 +#, kde-format +msgctxt "Encodings menu" +msgid "Default" +msgstr "Ebya bulijjo" + +#: kcodecaction.cpp:70 +#, kde-format +msgctxt "Encodings menu" +msgid "Autodetect" +msgstr "Yevumbulire" + +#: kcolorschememenu.cpp:24 +#, kde-format +msgid "Color Scheme" +msgstr "Nteekateeka ya Langi" + +#: kcommandbar.cpp:660 +#, kde-format +msgid "No commands to display" +msgstr "Tewali biragiro binaalagibwa" + +#: kcommandbar.cpp:662 +#, kde-format +msgid "No commands matching the filter" +msgstr "Ekisunsuzibwa kibulidwa biragiro bye kikwasa" + +#: kconfigdialog.cpp:37 +#, kde-format +msgctxt "@title:window" +msgid "Configure" +msgstr "Teekateeka" + +#: khamburgermenu.cpp:125 +#, kde-format +msgctxt "@action:inmenu General purpose menu" +msgid "&Menu" +msgstr "&Menyu" + +#: khamburgermenu.cpp:325 +#, kde-format +msgctxt "@action:inmenu A menu item that advertises and enables the menubar" +msgid "Show &Menubar with All Actions" +msgstr "Olubaawo lwa &Menyu Lulabike n'Ebisangibwa ko Byonna" + +#: khamburgermenu.cpp:351 +#, kde-format +msgctxt "@action:inmenu A menu text advertising its contents (more features)." +msgid "More" +msgstr "Ebisinga wo" + +#: khamburgermenu.cpp:352 +#, kde-format +msgctxt "" +"@action:inmenu A section heading advertising the contents of the menu bar" +msgid "More Actions" +msgstr "Ebirondeka Ebisinga Wo" + +#: krecentfilesaction.cpp:78 +#, kde-format +msgid "No Entries" +msgstr "Tewali" + +#: krecentfilesaction.cpp:84 +#, kde-format +msgid "Clear List" +msgstr "Ebiri ku lukalala byonna bigyeko" + +#: kstandardaction.cpp:157 +#, kde-format +msgctxt "go back" +msgid "&Back" +msgstr "&Ddayo" + +#: kstandardaction.cpp:164 +#, kde-format +msgctxt "go forward" +msgid "&Forward" +msgstr "&Weyongereyo" + +#: kstandardaction.cpp:171 +#, kde-format +msgctxt "home page" +msgid "&Home" +msgstr "Dda &Awatandikirwa" + +#: kstandardaction.cpp:230 +#, kde-format +msgid "Show Menubar

Shows the menubar again after it has been hidden

" +msgstr "" +"Olubaawo lwa &Menyu Lulabike

Kino kikomyawo olubaawo lwa menyu nga " +"lubadde lukisidwa

" + +#: kstandardaction.cpp:251 +#, kde-format +msgid "" +"Show Statusbar

Shows the statusbar, which is the bar at the bottom of the " +"window used for status information.

" +msgstr "" +"Olubaawo Olulaga Mbeera y'Egibumbujja Lulabike

Kino kireeta olubaawo " +"olulaga mbeera y'egibumbujja, olusangibwa ku mwango gw'eddirisa wansi.

" + +#: kstandardaction_p.h:63 +msgid "&New" +msgstr "Kolawo Eki&pya" + +#: kstandardaction_p.h:63 +msgid "Create new document" +msgstr "Kolawo ekwandike ekipya" + +#: kstandardaction_p.h:64 +msgid "&Open…" +msgstr "&Bikkula…" + +#: kstandardaction_p.h:64 +msgid "Open an existing document" +msgstr "Bikkula ekiwandike ekisangidwawo" + +#: kstandardaction_p.h:65 +msgid "Open &Recent" +msgstr "Bikkula ku Bya&semba Okubikkulibwa" + +#: kstandardaction_p.h:65 +msgid "Open a document which was recently opened" +msgstr "Bikkulayo ekiwandike mu byasemba okubikkulibwa" + +#: kstandardaction_p.h:66 +msgid "&Save" +msgstr "&Kazza" + +#: kstandardaction_p.h:66 +msgid "Save document" +msgstr "Ekiwandike kikazze" + +#: kstandardaction_p.h:67 +msgid "Save &As…" +msgstr "Kolamu K&oppi…" + +#: kstandardaction_p.h:67 +msgid "Save document under a new name" +msgstr "Ekiwandike kikolemu koppi ogiwe erinnya ppya" + +#: kstandardaction_p.h:68 +msgid "Re&vert" +msgstr "Enkyukakyuka Zi&jjulule" + +#: kstandardaction_p.h:68 +msgid "Revert unsaved changes made to document" +msgstr "Jjulula ebikyusidwa mu kiwandike ebitannakazzibwa" + +#: kstandardaction_p.h:69 +msgid "&Close" +msgstr "&Gala" + +#: kstandardaction_p.h:69 +msgid "Close document" +msgstr "Komya by'okola ku kiwandike kizingibweko" + +#: kstandardaction_p.h:70 +msgid "&Print…" +msgstr "&Kubisa…" + +#: kstandardaction_p.h:70 +msgid "Print document" +msgstr "Ekiwandike kisindike ku pulinta" + +#: kstandardaction_p.h:71 +msgid "Print Previe&w" +msgstr "Laba B&we Binaafaanana" + +#: kstandardaction_p.h:71 +msgid "Show a print preview of document" +msgstr "Kikulaga ekiwandise bwe kinaafaanana nga pulinta ekifulumyizza" + +#: kstandardaction_p.h:72 +msgid "&Mail…" +msgstr "Yi&meero…" + +#: kstandardaction_p.h:72 +msgid "Send document by mail" +msgstr "Ekiwandike kisindike mu yimeero" + +#: kstandardaction_p.h:73 +msgid "&Quit" +msgstr "&Mala" + +#: kstandardaction_p.h:73 +msgid "Quit application" +msgstr "Puloguramu givemu era gikomye" + +#: kstandardaction_p.h:75 +msgid "&Undo" +msgstr "&Bijjulule" + +#: kstandardaction_p.h:75 +msgid "Undo last action" +msgstr "Jjulula ebivudde mu ky'osembye okukola" + +#: kstandardaction_p.h:76 +msgid "Re&do" +msgstr "&Zzawo" + +#: kstandardaction_p.h:76 +msgid "Redo last undone action" +msgstr "Zzawo by'osembye okujjulula" + +#: kstandardaction_p.h:77 +msgid "Cu&t" +msgstr "Si&tulawo" + +#: kstandardaction_p.h:77 +msgid "Cut selection to clipboard" +msgstr "Ebitangaazidwa bisitulewo biterekebwe mu ggwanika ly'ebikwatidwa" + +#: kstandardaction_p.h:78 +msgid "&Copy" +msgstr "&Koppa" + +#: kstandardaction_p.h:78 +msgid "Copy selection to clipboard" +msgstr "Kwata koppi y'ebitangaazidwa eterekebwe mu ggwanika ly'ebikwatidwa" + +#: kstandardaction_p.h:79 +msgid "&Paste" +msgstr "&Paatiika" + +#: kstandardaction_p.h:79 +msgid "Paste clipboard content" +msgstr "Paatiikawo ebiri mu ggwanika ly'ebikwatidwa" + +#: kstandardaction_p.h:80 +msgid "C&lear" +msgstr "Yeru&la" + +#: kstandardaction_p.h:81 +msgid "Select &All" +msgstr "Lond&a Byonna" + +#: kstandardaction_p.h:82 +msgid "Dese&lect" +msgstr "&Ta" + +#: kstandardaction_p.h:83 +msgid "&Find…" +msgstr "&Noonya…" + +#: kstandardaction_p.h:84 +msgid "Find &Next" +msgstr "Noonya Eki&ddako" + +#: kstandardaction_p.h:85 +msgid "Find Pre&vious" +msgstr "Noonya Ebik&ulembera Bino" + +#: kstandardaction_p.h:86 +msgid "&Replace…" +msgstr "&Wanyisa…" + +#: kstandardaction_p.h:88 +msgid "Zoom to &Actual Size" +msgstr "Dd&a ku Buzimbulukufu Obwa Ddala" + +#: kstandardaction_p.h:88 +msgid "View document at its actual size" +msgstr "Ekiwandike kyoleseze ku bunene bwa kyo obwa ddala" + +#: kstandardaction_p.h:89 +msgid "&Fit to Page" +msgstr "Bi&ggweere ku lupapula lumu" + +#: kstandardaction_p.h:89 +msgid "Zoom to fit page in window" +msgstr "" +"Kyusa obunene bw'ekyolesebwa kiggweere ku lupapula olulabikira mu ddirisa" + +#: kstandardaction_p.h:90 +msgid "Fit to Page &Width" +msgstr "Bijje mu Bugazi b&w'Olupapula" + +#: kstandardaction_p.h:90 +msgid "Zoom to fit page width in window" +msgstr "" +"Kyusa obunene bw'ekyolesebwa kiggweere mu bugazi bw'olupapula olulabikira mu " +"ddirisa" + +#: kstandardaction_p.h:91 +msgid "Fit to Page &Height" +msgstr "Bijje mu Buwan&vu bw'Olupapula" + +#: kstandardaction_p.h:91 +msgid "Zoom to fit page height in window" +msgstr "" +"Kyusa obunene bw'ekyolesebwa kiggweere mu buwanvu bw'olupapula olulabikira " +"mu ddirisa" + +#: kstandardaction_p.h:92 +msgid "Zoom &In" +msgstr "Z&imbulukusa" + +#: kstandardaction_p.h:93 +msgid "Zoom &Out" +msgstr "K&endeeza" + +#: kstandardaction_p.h:94 +msgid "&Zoom…" +msgstr "Obu&zimbulukufu…" + +#: kstandardaction_p.h:94 +msgid "Select zoom level" +msgstr "Londa obuzimbulukufu" + +#: kstandardaction_p.h:95 +msgid "&Refresh" +msgstr "N&yumunguza" + +#: kstandardaction_p.h:95 +msgid "Refresh document" +msgstr "Ekiwandike damu okunona n'okwolesa ebikirimu" + +#: kstandardaction_p.h:97 +msgid "&Up" +msgstr "Wagg&ulu" + +#: kstandardaction_p.h:97 +msgid "Go up" +msgstr "Yongerayo waggulu" + +#: kstandardaction_p.h:102 +msgid "&Previous Page" +msgstr "Lu&papula Olukulembera Luno" + +#: kstandardaction_p.h:102 +msgid "Go to previous page" +msgstr "Dda ku lupapula olukulembera luno" + +#: kstandardaction_p.h:103 +msgid "&Next Page" +msgstr "Lupapula Olu&ddako" + +#: kstandardaction_p.h:103 +msgid "Go to next page" +msgstr "Genda ku lupapula oludda ku luno" + +#: kstandardaction_p.h:104 +msgid "&Go To…" +msgstr "&Genda Ku…" + +#: kstandardaction_p.h:105 +msgid "&Go to Page…" +msgstr "&Genda ku Lupapula…" + +#: kstandardaction_p.h:106 +msgid "&Go to Line…" +msgstr "&Genda lu lunyiriri…" + +#: kstandardaction_p.h:107 +msgid "&First Page" +msgstr "Lupapula Olu&sooka" + +#: kstandardaction_p.h:107 +msgid "Go to first page" +msgstr "Dda ku lupapula olusooka" + +#: kstandardaction_p.h:108 +msgid "&Last Page" +msgstr "Lupapula Olus&emba" + +#: kstandardaction_p.h:108 +msgid "Go to last page" +msgstr "Genda ku lupapula olusemba" + +#: kstandardaction_p.h:109 +msgid "&Back" +msgstr "&Ddayo" + +#: kstandardaction_p.h:109 +msgid "Go back in document" +msgstr "Dda ku kifo mu kiwandike ekikulembera ky'oliko kakano" + +#: kstandardaction_p.h:110 +msgid "&Forward" +msgstr "&Weyongereyo" + +#: kstandardaction_p.h:110 +msgid "Go forward in document" +msgstr "Genda ku kifo mu kiwandike ekidda ku ky'oliko kakano" + +#: kstandardaction_p.h:112 +msgid "&Add Bookmark" +msgstr "Yonger&a ku Bukwatakifo" + +#: kstandardaction_p.h:113 +msgid "&Edit Bookmarks…" +msgstr "K&yusamu Obukwatakifo…" + +#: kstandardaction_p.h:115 +msgid "&Spelling…" +msgstr "Em&pandika y'Ebigambo…" + +#: kstandardaction_p.h:115 +msgid "Check spelling in document" +msgstr "Golola empandika y'ebigambo mu kiwandike" + +#: kstandardaction_p.h:117 +msgid "Show &Menubar" +msgstr "Olubaawo lwa &Menyu Lulabike" + +#: kstandardaction_p.h:117 +msgid "Show or hide menubar" +msgstr "Kino kirabisa ne kikisa olubaawo lwa menyu" + +#: kstandardaction_p.h:118 +msgid "Show &Toolbar" +msgstr "Olubaawo lw'Ebi&yamba Lulabike" + +#: kstandardaction_p.h:118 +msgid "Show or hide toolbar" +msgstr "Kino kirabisa ne kikisa olubaawo lw'ebiyamba" + +#: kstandardaction_p.h:119 +msgid "Show St&atusbar" +msgstr "Olubaawo Olulaga Mbeer&a y'Egibumbujja Lulabike" + +#: kstandardaction_p.h:119 +msgid "Show or hide statusbar" +msgstr "Kino kirabisa ne kikisa olubaawo olulaga mbeera y'egibumbujja" + +#: kstandardaction_p.h:120 +msgid "F&ull Screen Mode" +msgstr "B&una Lutimbe" + +#: kstandardaction_p.h:121 +msgid "Configure Keyboard S&hortcuts…" +msgstr "Teekateeka Mapeesa A&gagonza Emirimu..." + +#: kstandardaction_p.h:122 +#, kde-format +msgid "&Configure %1…" +msgstr "&Teekateeka %1…" + +#: kstandardaction_p.h:123 +msgid "Configure Tool&bars…" +msgstr "Teekateeka &Bubaawo Bw'ebiyamba…" + +#: kstandardaction_p.h:124 +msgid "Configure &Notifications…" +msgstr "Teekateeka Eby'obubaka Obu&tangaaza..." + +#: kstandardaction_p.h:128 +#, kde-format +msgid "%1 &Handbook" +msgstr "Eki&wandike Ekiragirira Enkozesa ya %1" + +#: kstandardaction_p.h:129 +msgid "What's &This?" +msgstr "Kino &Kiki?" + +#: kstandardaction_p.h:130 +msgid "&Report Bug…" +msgstr "&Sindika Obubaka ku Mpulunguse…" + +#: kstandardaction_p.h:131 +msgid "Configure &Language…" +msgstr "Teekateeka Eby'&olulimi…" + +#: kstandardaction_p.h:132 +#, kde-format +msgid "&About %1" +msgstr "Kw&anjula %1" + +#: kstandardaction_p.h:133 +msgid "About &KDE" +msgstr "Kwanjula &KDE" + +#: kstandardaction_p.h:134 +msgid "&Delete" +msgstr "&Gyawo" + +#: kstandardaction_p.h:135 +msgid "&Rename…" +msgstr "&Kyusa Linnya…" + +#: kstandardaction_p.h:136 +msgid "&Move to Trash" +msgstr "&Twala mu Bisuulidwa" + +#: kstandardaction_p.h:137 +msgid "&Donate" +msgstr "&Wa Obuyambi" + +#: kstandardaction_p.h:138 +msgid "Open &Menu" +msgstr "Bikkula &Menyu" + +#: kstylemanager.cpp:74 +#, kde-format +msgid "Application Style" +msgstr "Olulyo Lw'endabika ya Puloguramu" + +#: kstylemanager.cpp:84 +#, kde-format +msgid "Default" +msgstr "Ebya bulijjo" diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/kconfigwidgets-index.qdoc b/local/recipes/kde/kf6-kconfigwidgets/source/src/kconfigwidgets-index.qdoc new file mode 100644 index 0000000000..445956da95 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/kconfigwidgets-index.qdoc @@ -0,0 +1,21 @@ +/*! + \page kconfigwidgets-index.html + \title KConfig + + KConfigWidgets provides easy-to-use classes to create configuration dialogs, as + well as a set of widgets which uses KConfig to store their settings. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {ConfigWidgets} {KF6::ConfigWidgets} + + \section1 API Reference + + \list + \li \l{KConfigWidgets C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/kconfigwidgets.qdoc b/local/recipes/kde/kf6-kconfigwidgets/source/src/kconfigwidgets.qdoc new file mode 100644 index 0000000000..7f9addc7a9 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/kconfigwidgets.qdoc @@ -0,0 +1,12 @@ +/*! + \module KConfigWidgets + \title KConfigWidgets C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent ConfigWidgets + + \brief Widgets for configuration dialogs. + + KConfigWidgets provides easy-to-use classes to create configuration dialogs, as + well as a set of widgets which uses KConfig to store their settings. +*/ diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/kconfigwidgets.qdocconf b/local/recipes/kde/kf6-kconfigwidgets/source/src/kconfigwidgets.qdocconf new file mode 100644 index 0000000000..dfe7055f50 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/kconfigwidgets.qdocconf @@ -0,0 +1,41 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KConfigWidgets +description = Widgets for configuration dialogs + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +imagedirs = ../docs/pics + +outputformats = HTML + +navigation.landingpage = "KConfigWidgets" + +depends += \ + kde \ + qtcore \ + qtgui \ + qtwidgets \ + kwidgetsaddons \ + kcolorscheme \ + kconfigcore \ + kconfiggui + +qhp.projects = KConfigWidgets + +qhp.KConfigWidgets.file = kconfigwidgets.qhp +qhp.KConfigWidgets.namespace = org.kde.kconfigwidgets.$QT_VERSION_TAG +qhp.KConfigWidgets.virtualFolder = kconfigwidgets +qhp.KConfigWidgets.indexTitle = KConfigWidgets +qhp.KConfigWidgets.indexRoot = + +qhp.KConfigWidgets.subprojects = classes +qhp.KConfigWidgets.subprojects.classes.title = C++ Classes +qhp.KConfigWidgets.subprojects.classes.indexTitle = KConfigWidgets C++ Classes +qhp.KConfigWidgets.subprojects.classes.selectors = class fake:headerfile +qhp.KConfigWidgets.subprojects.classes.sortPages = true + +tagfile = kconfigwidgets.tags diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/af/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/af/kf6_entry.desktop new file mode 100644 index 0000000000..8a88ca7c56 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/af/kf6_entry.desktop @@ -0,0 +1,102 @@ +[KCM Locale] +Name=Afrikaans +Name[af]=Afrikaans +Name[ar]=الأفريكانيّة +Name[as]=আফ্ৰিকান্স +Name[az]=Afrikaan dili +Name[be]=Афрыкаанс +Name[be@latin]=Afrykaans +Name[bg]=Африкаанс +Name[bn]=আফ্রিকান্‌স +Name[bn_IN]=আফ্রিকান্স +Name[br]=Afrikaans +Name[bs]=afrikanerski +Name[ca]=Afrikaans +Name[ca@valencia]=Afrikaans +Name[cs]=Afrikánský +Name[csb]=Afrikanersczi +Name[cy]=Affricaneg +Name[da]=Afrikaans +Name[de]=Afrikaans +Name[el]=Αφρικάανς +Name[en_GB]=Afrikaans +Name[eo]=Afrikansa +Name[es]=Afrikaans +Name[et]=Afrikaani +Name[eu]=Afrikaans +Name[fa]=آفریکانس +Name[fi]=Afrikaans +Name[fr]=Afrikaans +Name[fy]=Afrikaansk +Name[ga]=Afracáinis +Name[gd]=Afraganais +Name[gl]=Africáner +Name[gu]=આફ્રિકાન્સ +Name[he]=אפריקאנס +Name[hi]=अफ्रीकी +Name[hne]=अफ्रीकी +Name[hr]=Afrikaans +Name[hsb]=Afrikaansce +Name[hu]=Afrikaans +Name[ia]=Afrikaans +Name[id]=Afrika +Name[is]=Afríkanska +Name[it]=Afrikaans +Name[ja]=アフリカーンス語 +Name[ka]=აფრიკაანსი +Name[kk]=Африкаансша +Name[km]=អាហ្វ្រីកាអាន +Name[kn]=ಆಫ್ರಿಕಾನಾಸ್ +Name[ko]=아프리칸스어 +Name[ku]=Afrîkans +Name[lb]=Afrikaans +Name[lg]=Lubbuwa +Name[lt]=Afrikansas +Name[lv]=Afrikandu +Name[mai]=अफ्रीकी +Name[mk]=Африкаанс +Name[ml]=ആഫ്രിക്കാന്‍സ് +Name[mr]=अफ्रीकी +Name[ms]=Afrika +Name[nb]=Afrikaans +Name[nds]=Afrikaansch +Name[ne]=अफ्रिकी +Name[nl]=Afrikaans +Name[nn]=Afrikaans +Name[oc]=Afrikaans +Name[or]=ଆଫ୍ରିକାନ +Name[pa]=ਅਫ਼ਰੀਕੀ +Name[pl]=Afrykanerski +Name[ps]=افريکانس +Name[pt]=Afrikaans +Name[pt_BR]=Africâner +Name[ro]=Africană +Name[ru]=Африкаанс +Name[sa]=आफ्रिकादेशीयः +Name[se]=Afrikánsgiella +Name[si]=අප්‍රිකානු +Name[sk]=Afrikánčina +Name[sl]=Afrikanščina +Name[sq]=Afrikanisht +Name[sr]=африканерски +Name[sr@ijekavian]=африканерски +Name[sr@ijekavianlatin]=afrikanerski +Name[sr@latin]=afrikanerski +Name[sv]=Afrikaans +Name[ta]=ஆப்ரிகான் +Name[te]=ఆఫ్రికాన్స్ +Name[tg]=Африкоӣ +Name[th]=ภาษาแอฟริกา +Name[tok]=toki Apikan +Name[tr]=Afrikaanca +Name[tt]=Африкаанс +Name[ug]=جەنۇبى ئافرىقا گوللاندىيەچە +Name[uk]=Африкаанс +Name[uz]=Afrikancha +Name[uz@cyrillic]=Африканча +Name[vi]=Tiếng Afrikaans +Name[wa]=Afrikaans +Name[xh]=Isibhulu +Name[zh_CN]=南非荷兰语 +Name[zh_HK]=南非荷蘭語 +Name[zh_TW]=南非荷蘭語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/am/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/am/kf6_entry.desktop new file mode 100644 index 0000000000..fd01df5dc9 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/am/kf6_entry.desktop @@ -0,0 +1,28 @@ +[KCM Locale] +Name=Amharic +Name[ar]=الأمهرية +Name[bg]=Амхарски +Name[ca]=Amhàric +Name[ca@valencia]=Amhàric +Name[cs]=Amharský +Name[es]=Amhárico +Name[fr]=Amharique +Name[he]=אמהרית +Name[ia]=Amharic +Name[is]=Amharíska +Name[it]=Amarico +Name[ka]=ამჰარული +Name[ko]=암하라어 +Name[lt]=Amharų +Name[nl]=Amharisch +Name[nn]=Amharisk +Name[pt_BR]=Amárico +Name[ro]=Amarică +Name[sk]=Amharčina +Name[sl]=Amharščina +Name[ta]=அம்ஹாரிக் +Name[tr]=Amharca +Name[ug]=ئامخارىكچە +Name[uk]=Амхарська +Name[zh_CN]=阿姆哈拉语 +Name[zh_TW]=阿姆哈拉語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ar/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ar/kf6_entry.desktop new file mode 100644 index 0000000000..6e518156ce --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ar/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Arabic +Name[af]=Arabiese +Name[ar]=العربيّة +Name[as]=আৰবীয় +Name[ast]=Árabe +Name[az]=Ərəb dilində +Name[be]=Арабская +Name[be@latin]=Arabskaja +Name[bg]=Арабски +Name[bn]=আরবী +Name[bn_IN]=আরবি +Name[br]=Arabeg +Name[bs]=arapski +Name[ca]=Àrab +Name[ca@valencia]=Àrab +Name[cs]=Arabský +Name[csb]=Arabsczi +Name[cy]=Arabeg +Name[da]=Arabisk +Name[de]=Arabisch +Name[el]=Αραβικά +Name[en_GB]=Arabic +Name[eo]=Araba +Name[es]=Árabe +Name[et]=Araabia +Name[eu]=Arabiera +Name[fa]=عربی +Name[fi]=Arabia +Name[fr]=Arabe +Name[fy]=Arabysk +Name[ga]=Araibis +Name[gd]=Arabais +Name[gl]=Árabe +Name[gu]=અરેબીક +Name[he]=ערבית +Name[hi]=अरबी +Name[hne]=अरबी +Name[hr]=Arapski +Name[hsb]=Arabsce +Name[hu]=Arab +Name[ia]=Arabe +Name[id]=Arab +Name[is]=Arabíska +Name[it]=Arabo +Name[ja]=アラビア語 +Name[ka]=არაბული +Name[kk]=Арабша +Name[km]=អារ៉ាប់ +Name[kn]=ಅರೇಬಿಕ್ +Name[ko]=아라비아어 +Name[ku]=Erebî +Name[lb]=Arabesch +Name[lg]=Luwarabu +Name[lt]=Arabų +Name[lv]=Arābu +Name[mai]=अरबी +Name[mk]=Арапски +Name[ml]=അറബി +Name[mr]=अरेबिक +Name[ms]=Arab +Name[nb]=Arabisk +Name[nds]=Araabsch +Name[ne]=अरबी +Name[nl]=Arabisch +Name[nn]=Arabisk +Name[oc]=Arab +Name[or]=ଆରାବିକ +Name[pa]=ਅਰਬੀ +Name[pl]=Arabski +Name[ps]=عربي +Name[pt]=Árabe +Name[pt_BR]=Árabe +Name[ro]=Arabă +Name[ru]=Арабский +Name[sa]=अरबी +Name[se]=Arábagiella +Name[si]=අරාබි +Name[sk]=Arabčina +Name[sl]=Arabščina +Name[sq]=Arabisht +Name[sr]=арапски +Name[sr@ijekavian]=арапски +Name[sr@ijekavianlatin]=arapski +Name[sr@latin]=arapski +Name[sv]=Arabiska +Name[ta]=அராபிக் +Name[te]=అరబిక్ +Name[tg]=Арабӣ +Name[th]=ภาษาอารบิก +Name[tok]=toki Alapi +Name[tr]=Arapça +Name[tt]=Гарәп +Name[ug]=ئەرەبچە +Name[uk]=Арабська +Name[uz]=Arabcha +Name[uz@cyrillic]=Арабча +Name[vi]=Tiếng Ả-rập +Name[wa]=Arabe +Name[xh]=Arabic +Name[zh_CN]=阿拉伯语 +Name[zh_HK]=阿拉伯語 +Name[zh_TW]=阿拉伯語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/as/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/as/kf6_entry.desktop new file mode 100644 index 0000000000..0e4d9fed48 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/as/kf6_entry.desktop @@ -0,0 +1,84 @@ +[KCM Locale] +Name=Assamese +Name[ar]=الأساميّة +Name[ast]=Asamés +Name[az]=Assam dilində +Name[be]=Асамская +Name[be@latin]=Asamskaja +Name[bg]=Асамезе +Name[bn_IN]=অসমীয়া +Name[bs]=asamski +Name[ca]=Assamès +Name[ca@valencia]=Assamés +Name[cs]=Ásámský +Name[csb]=Assamese +Name[da]=Assamesisk +Name[de]=Assamesisch +Name[el]=Ασσαμίσια +Name[en_GB]=Assamese +Name[eo]=Asama +Name[es]=Asamés +Name[et]=Assami +Name[eu]=Assamera +Name[fa]=آسامی +Name[fi]=Assami +Name[fr]=Assamais +Name[fy]=Assamese +Name[ga]=Asaimis +Name[gd]=Asamais +Name[gl]=Assamés +Name[gu]=આસામીઝ +Name[he]=אסאמית +Name[hi]=अस्सामी +Name[hr]=Asamski +Name[hu]=Asszámi +Name[ia]=Assamese +Name[id]=Assamese +Name[is]=Assamíska +Name[it]=Assamese +Name[ja]=アッサム語 +Name[ka]=ასამური +Name[kk]=Ассамша +Name[km]=អាសាមីស +Name[kn]=ಅಸ್ಸಾಮಿ +Name[ko]=아삼어 +Name[ku]=Assamî +Name[lg]=Luwassamu +Name[lt]=Asamų +Name[lv]=Asamiešu +Name[mk]=Асамески +Name[ml]=ആസാമീസ് +Name[mr]=आसामी +Name[ms]=Assamese +Name[nb]=Assamesisk +Name[nds]=Assameesch +Name[nl]=Assamees +Name[nn]=Assami +Name[pa]=ਆਸਾਮੀ +Name[pl]=Assamski +Name[pt]=Assamese +Name[pt_BR]=Assamês +Name[ro]=Asameză +Name[ru]=Ассамский +Name[sa]=असमिया +Name[se]=Assamesgiella +Name[si]=ඇසෑමී +Name[sk]=Asámčina +Name[sl]=Asamščina +Name[sq]=Asamizë +Name[sr]=асамски +Name[sr@ijekavian]=асамски +Name[sr@ijekavianlatin]=asamski +Name[sr@latin]=asamski +Name[sv]=Assamesiska +Name[ta]=அசாமியம் +Name[tg]=Ассамезӣ +Name[th]=ภาษาอัสสมี +Name[tr]=Assamca +Name[tt]=Ассам +Name[ug]=ئاسسامچە +Name[uk]=Ассамська +Name[vi]=Tiếng Assam +Name[wa]=Assamès +Name[zh_CN]=阿萨姆语 +Name[zh_TW]=阿薩姆語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ast/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ast/kf6_entry.desktop new file mode 100644 index 0000000000..a19b269c71 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ast/kf6_entry.desktop @@ -0,0 +1,74 @@ +[KCM Locale] +Name=Asturian +Name[ar]=الأستريّة +Name[ast]=Asturianu +Name[az]=Avstriya Dili +Name[be]=Астурыйская +Name[be@latin]=Asturyjskaja +Name[bg]=Астурийски +Name[bs]=asturijski +Name[ca]=Asturià +Name[ca@valencia]=Asturià +Name[cs]=Asturijský +Name[da]=Asturiansk +Name[de]=Asturisch +Name[el]=Αστουριανά +Name[en_GB]=Asturian +Name[eo]=Asturia +Name[es]=Asturiano +Name[et]=Astuuria +Name[eu]=Asturiera +Name[fa]=اتریشی +Name[fi]=Asturia +Name[fr]=Asturien +Name[ga]=Astúiris +Name[gd]=Astùrais +Name[gl]=Asturiano +Name[gu]=એસ્ટોરિયન +Name[he]=אסטורית +Name[hi]=एस्तुरियन +Name[hr]=Asturijanski +Name[hu]=Asztúriai +Name[ia]=Asturian +Name[id]=Asturia +Name[is]=Astúríska +Name[it]=Asturiano +Name[ja]=アストゥリアス語 +Name[ka]=ასთურიანული +Name[kk]=Астурианша +Name[km]=អាស្តូរៀន +Name[ko]=아스투리아스어 +Name[ku]=Astûrî +Name[lg]=Lu-Asituriyanu +Name[lt]=Asturų +Name[lv]=Astūriešu +Name[mk]=Астуриски +Name[mr]=अस्तुरियन +Name[ms]=Asturian +Name[nb]=Asturiansk +Name[nds]=Astuursch +Name[nl]=Asturisch +Name[nn]=Asturleonesisk +Name[pa]=ਅਸਟੁਰੀਆਈ +Name[pl]=Asturyjski +Name[pt]=Asturiano +Name[pt_BR]=Asturiano +Name[ro]=Asturiană +Name[ru]=Астурийский +Name[sa]=अस्टुरियन +Name[se]=Asturiagiella +Name[sk]=Astúrčina +Name[sl]=Asturijščina +Name[sq]=Asturiane +Name[sv]=Asturiska +Name[ta]=அஸ்டூரியன் +Name[tg]=Астуриёнӣ +Name[th]=ภาษาอัสตูเรียส +Name[tr]=Avusturya Dili +Name[tt]=Астурий +Name[ug]=ئاستۇرىيەچە +Name[uk]=Астурійська +Name[vi]=Tiếng Asturias +Name[wa]=Asturyin +Name[zh_CN]=阿斯图里亚斯语 +Name[zh_TW]=阿斯圖里亞斯語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/az/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/az/kf6_entry.desktop new file mode 100644 index 0000000000..a3e4866e8b --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/az/kf6_entry.desktop @@ -0,0 +1,65 @@ +[KCM Locale] +Name=Azerbaijani +Name[af]=Azerbaijani +Name[ar]=الأذربيجانية +Name[ast]=Azerbaixanu +Name[az]=Azərbaycanca +Name[be]=Азербайджанская +Name[be@latin]=Azierbajdžanskaja +Name[bg]=Азербайджански +Name[br]=Azerbaidjanek +Name[ca]=Àzeri +Name[ca@valencia]=Àzeri +Name[cs]=Ázerbájdžánský +Name[cy]=Azerbaijaneg +Name[da]=Aserbajdsjansk +Name[de]=Aserbaidschanisch +Name[el]=Αζερικά +Name[en_GB]=Azerbaijani +Name[eo]=Azerbajĝana +Name[es]=Azerí +Name[et]=Aserbaidžaani +Name[eu]=Azerbaijanera +Name[fi]=Azeri +Name[fr]=Azerbaijani +Name[fy]=Azerbeidzjaansk +Name[ga]=Asarbaiseáinis +Name[gl]=Azerí +Name[he]=אזרית +Name[hi]=अजरबेजानी +Name[hr]=Azerbejdžanski +Name[hu]=Azerbajdzsáni +Name[ia]=Azerbaijano +Name[id]=Azerbaijani +Name[is]=Aserska +Name[it]=Azero +Name[ka]=აზერბაიჯანული +Name[ko]=아제르바이잔어 +Name[lb]=Aserbaidjanesch +Name[lg]=Luwazerebayijani +Name[lt]=Azerbaidžaniečių +Name[lv]=Azerbaidžāņu +Name[nb]=Aserbajdsjansk +Name[nl]=Azerbeidzjaans +Name[nn]=Aserbajdsjansk +Name[pa]=ਅਜ਼ਰਬਾਈਜਾਨੀ +Name[pl]=Azerbejdżański +Name[pt]=Azerbaijano +Name[pt_BR]=Azeri +Name[ro]=Azerbaijană +Name[ru]=Азербайджанский +Name[sa]=अजरबैजानी +Name[sk]=Azerbajdžančina +Name[sl]=Azarbejdžansko +Name[sv]=Azerbajdzjanska +Name[ta]=அசர்பைஜானி +Name[tr]=Azerbaycanca +Name[ug]=ئەزەربەيجانچە +Name[uk]=Азербайджанська +Name[uz]=Ozarbayjoncha +Name[uz@cyrillic]=Озарбайжонча +Name[vi]=Tiếng Azerbaijan +Name[xh]=Azerbaijani +Name[zh_CN]=阿塞拜疆语 +Name[zh_HK]=阿塞拜疆語 +Name[zh_TW]=亞塞拜然語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/be/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/be/kf6_entry.desktop new file mode 100644 index 0000000000..6d197eaa39 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/be/kf6_entry.desktop @@ -0,0 +1,102 @@ +[KCM Locale] +Name=Belarusian +Name[af]=Belarusian +Name[ar]=البيلاروسيّة +Name[as]=বেলাৰুচীয় +Name[ast]=Bielorrusu +Name[az]=Belarus dilində +Name[be]=Беларуская +Name[be@latin]=Bielaruskaja +Name[bg]=Белоруски +Name[bn]=বেলারুশিয় +Name[bn_IN]=বেলারুশিয়ান +Name[br]=Belarusieg +Name[bs]=bjeloruski +Name[ca]=Belarús +Name[ca@valencia]=Belarús +Name[cs]=Běloruský +Name[csb]=Białorusczi +Name[cy]=Belarwsieg +Name[da]=Hviderussisk +Name[de]=Weißrussisch +Name[el]=Λευκορωσικά +Name[en_GB]=Belarusian +Name[eo]=Belorusa +Name[es]=Bielorruso +Name[et]=Valgevene +Name[eu]=Bielorrusiera +Name[fa]=بلاروسی +Name[fi]=Valkovenäjä +Name[fr]=Biélorusse +Name[fy]=Wyt-Russysk +Name[ga]=Bealarúisis +Name[gd]=Bealaruisis +Name[gl]=Bielorruso +Name[gu]=બેલારશિયન +Name[he]=בלארוסית +Name[hi]=बेलारूसी +Name[hne]=बेलारूसी +Name[hr]=Bjeloruski +Name[hsb]=Běłorusce +Name[hu]=Belorusz +Name[ia]=Bielorusso +Name[id]=Belarusia +Name[is]=Hvítrússneska +Name[it]=Bielorusso +Name[ja]=ベラルーシ語 +Name[ka]=ბელორუსული +Name[kk]=Белорусша +Name[km]=បេឡារុស្ស +Name[kn]=ಬೆಲರೂಸಿಯನ್ +Name[ko]=벨라루스어 +Name[ku]=Belarusî +Name[lb]=Wäissrussesch +Name[lg]=Lubelarusi +Name[lt]=Baltarusių +Name[lv]=Baltkrievu +Name[mai]=बेलारूसी +Name[mk]=Белоруски +Name[ml]=ബെലാറൂഷ്യന്‍ +Name[mr]=बेलारूसी +Name[ms]=Belarusian +Name[nb]=Belarusisk +Name[nds]=Wittruss'sch +Name[ne]=बेलारूसी +Name[nl]=Wit-Russisch +Name[nn]=Belarusisk +Name[oc]=Bielorus +Name[or]=ବେଲାରୁସିୟାନ +Name[pa]=ਬੇਲਾਰੂਸੀ +Name[pl]=Białoruski +Name[ps]=بېلاروسي +Name[pt]=Bielorrusso +Name[pt_BR]=Bielorrusso +Name[ro]=Bielorusă +Name[ru]=Белорусский +Name[sa]=बेलारूसी +Name[se]=Vilgesruoššagiella +Name[si]=බෙලරුසියානු +Name[sk]=Bieloruština +Name[sl]=Beloruščina +Name[sq]=Bellorusisht +Name[sr]=белоруски +Name[sr@ijekavian]=бјелоруски +Name[sr@ijekavianlatin]=bjeloruski +Name[sr@latin]=beloruski +Name[sv]=Vitryska +Name[ta]=பெலரூசியன் +Name[te]=బెలరుసియన్ +Name[tg]=Белорусӣ +Name[th]=ภาษาเบลารุส +Name[tr]=Beyaz Rusça +Name[tt]=Белорус +Name[ug]=بېلورۇسچە +Name[uk]=Білоруська +Name[uz]=Beloruscha +Name[uz@cyrillic]=Белорусча +Name[vi]=Tiếng Bê-la-rút +Name[wa]=Bielorûsse +Name[xh]=Belarusian +Name[zh_CN]=白俄罗斯语 +Name[zh_HK]=白俄羅斯語 +Name[zh_TW]=白俄羅斯語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/be@latin/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/be@latin/kf6_entry.desktop new file mode 100644 index 0000000000..5179fa6dfe --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/be@latin/kf6_entry.desktop @@ -0,0 +1,88 @@ +[KCM Locale] +Name=Belarusian Latin +Name[ar]=البيلاروسيةّ اللاتينيّة +Name[as]=বেলাৰুচীয় লেটিন +Name[ast]=Bielorrusu (alfabetu llatín) +Name[az]=Belarus (latın) dilində +Name[be]=Беларуская (лацінка) +Name[be@latin]=Bielaruskaja (lacinka) +Name[bg]=Белоруски (латиница) +Name[bn_IN]=বেলারুশিয়ান লাতিন +Name[bs]=bjeloruski (latinica) +Name[ca]=Belarús llatí +Name[ca@valencia]=Belarús llatí +Name[cs]=Běloruský (latinka) +Name[csb]=Białorusczi łacëzniany +Name[da]=Hviderussisk latin +Name[de]=Weißrussisch (lat. Alphabet) +Name[el]=Λευκορωσικά Λατινικά +Name[en_GB]=Belarusian Latin +Name[eo]=Latina belorusa +Name[es]=Bielorruso (Latino) +Name[et]=Valgevene (ladina) +Name[eu]=Bielorrusiera Latinoa +Name[fa]=لاتین بلاروسی +Name[fi]=Valkovenäjä (Latin) +Name[fr]=Biélorusse latin +Name[fy]=Wyt-Russysk latynsk +Name[ga]=Bealarúisis (aibítir Laidineach) +Name[gd]=Bealaruisis (Laideann) +Name[gl]=Bielorruso latino +Name[gu]=બેલારશિયન લેટિન +Name[he]=בלארוסית לטינית +Name[hi]=बेलारूसी लातिन +Name[hne]=बेलारूसी लातिनी +Name[hr]=Bjeloruski, latinica +Name[hsb]=Běłorusce (z łaćonskim pismom) +Name[hu]=Belorusz (latin betűs) +Name[ia]=Bielorusso Latino +Name[id]=Belarusia Latin +Name[is]=Hvítrússneska (latneskt letur) +Name[it]=Bielorusso Latino +Name[ja]=ベラルーシ語 (ラテン文字) +Name[ka]=ბელორუსული ლათინური +Name[kk]=Латындағы Белорусша +Name[km]=បេឡារុស្ស៊ី (ឡាតាំង) +Name[kn]=ಬೆಲರೂಸಿಯನ್ ಲಾಟಿನ್ +Name[ko]=벨라루스어(라틴 문자) +Name[ku]=Latîniya Rûsiya Spî +Name[lg]=Lubelarusi lwa kilattini +Name[lt]=Baltarusių lotynų +Name[lv]=Baltkrievu latīņu +Name[mai]=बेलारूसी लैटिन +Name[mk]=Белоруски латиница +Name[ml]=ബെലാറൂഷ്യന്‍ ലാറ്റിന്‍ +Name[mr]=बेलारूसी लॅटिन +Name[ms]=Belarusian Latin +Name[nb]=Belarusisk (romanisert) +Name[nds]=Latiensch Wittruss'sch +Name[nl]=Wit-Russisch Latijn +Name[nn]=Belarusisk (romanisert) +Name[pa]=ਬੇਲਾਰੂਸੀ ਲੈਟਿਨ +Name[pl]=Białoruski (alfabet łaciński) +Name[pt]=Bielorrusso Latino +Name[pt_BR]=Bielorrusso latino +Name[ro]=Bielorusă latină +Name[ru]=Белорусский (латиница) +Name[sa]=बेलारूसी लैटिन +Name[se]=Vilgesruoššagiella (Latiidna) +Name[si]=බෙලරුසියානු ලතින් +Name[sk]=Bieloruština (latinka) +Name[sl]=Beloruščina (latinica) +Name[sq]=Bellorusisht (Latine) +Name[sr]=белоруски (латиница) +Name[sr@ijekavian]=бјелоруски (латиница) +Name[sr@ijekavianlatin]=bjeloruski (latinica) +Name[sr@latin]=beloruski (latinica) +Name[sv]=Latinsk vitryska +Name[ta]=பெலரூசிய இலத்தீன் +Name[tg]=Белорусии лотинӣ +Name[th]=ภาษาเบลารุส แบบละติน +Name[tr]=Beyaz Rusça Latin +Name[tt]=Беларус (Латин алф.) +Name[ug]=بېلورۇسچە(لاتىنچە) +Name[uk]=Білоруська (латиниця) +Name[vi]=Tiếng Bê-la-rút La-tinh +Name[wa]=Bielorûsse latén +Name[zh_CN]=白俄罗斯语 (拉丁字母) +Name[zh_TW]=白俄羅斯語(拉丁文字) diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/bg/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/bg/kf6_entry.desktop new file mode 100644 index 0000000000..00a6b5390d --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/bg/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Bulgarian +Name[af]=Bulgaars +Name[ar]=البلغاريّة +Name[as]=বুল্গাৰীয়ান +Name[ast]=Búlgaru +Name[az]=Bolqar dilində +Name[be]=Балгарская +Name[be@latin]=Balharskaja +Name[bg]=Български +Name[bn]=বুলগেরিয় +Name[bn_IN]=বুলগেরিয়ান +Name[br]=Bulgareg +Name[bs]=bugarski +Name[ca]=Búlgar +Name[ca@valencia]=Búlgar +Name[cs]=Bulharský +Name[csb]=Bùlgarsczi +Name[cy]=Bulgareg +Name[da]=Bulgarsk +Name[de]=Bulgarisch +Name[el]=Βουλγαρικά +Name[en_GB]=Bulgarian +Name[eo]=Bulgara +Name[es]=Búlgaro +Name[et]=Bulgaaria +Name[eu]=Bulgariera +Name[fa]=بلغاری +Name[fi]=Bulgaria +Name[fr]=Bulgare +Name[fy]=Bulgaarsk +Name[ga]=Bulgáiris +Name[gd]=Bulgairis +Name[gl]=Búlgaro +Name[gu]=બલ્ગેરીયન +Name[he]=בולגרית +Name[hi]=बुल्गारियाई +Name[hne]=बुल्गारियाई +Name[hr]=Bugarski +Name[hsb]=Bołharsce +Name[hu]=Bolgár +Name[ia]=Bulgaro +Name[id]=Bulgaria +Name[is]=Búlgarska +Name[it]=Bulgaro +Name[ja]=ブルガリア語 +Name[ka]=ბულგარული +Name[kk]=Болғарша +Name[km]=ប៊ុលហ្ការី +Name[kn]=ಬಲ್ಗೇರಿಯನ್ +Name[ko]=불가리아어 +Name[ku]=Bulgarî +Name[lb]=Bulgaresch +Name[lg]=Lubulugariya +Name[lt]=Bulgarų +Name[lv]=Bulgāru +Name[mai]=बुल्गारियाइ +Name[mk]=Бугарски +Name[ml]=ബള്‍ഗേറിയന്‍ +Name[mr]=बुल्गारियाई +Name[ms]=Bulgaria +Name[nb]=Bulgarsk +Name[nds]=Bulgaarsch +Name[ne]=बुल्गेरियाली +Name[nl]=Bulgaars +Name[nn]=Bulgarsk +Name[oc]=Bulgar +Name[or]=ବୁଲଗାରିୟାନ +Name[pa]=ਬੁਲਗਾਰੀਆਈ +Name[pl]=Bułgarski +Name[ps]=بلګريايي +Name[pt]=Búlgaro +Name[pt_BR]=Búlgaro +Name[ro]=Bulgară +Name[ru]=Болгарский +Name[sa]=बल्गेरियाई +Name[se]=Bulgáriagiella +Name[si]=බල්ගේරියානු +Name[sk]=Bulharčina +Name[sl]=Bolgarščina +Name[sq]=Bullgarisht +Name[sr]=бугарски +Name[sr@ijekavian]=бугарски +Name[sr@ijekavianlatin]=bugarski +Name[sr@latin]=bugarski +Name[sv]=Bulgariska +Name[ta]=பல்கேரியன் +Name[te]=బల్గెరియన్ +Name[tg]=Булғорӣ +Name[th]=ภาษาบัลแกเรีย +Name[tok]=toki Pokasi +Name[tr]=Bulgarca +Name[tt]=Болгар +Name[ug]=بۇلغارچە +Name[uk]=Болгарська +Name[uz]=Bolgarcha +Name[uz@cyrillic]=Болгарча +Name[vi]=Tiếng Bun-ga-ri +Name[wa]=Bulgåre +Name[xh]=Bulgarian +Name[zh_CN]=保加利亚语 +Name[zh_HK]=保加利亞語 +Name[zh_TW]=保加利亞語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/bn/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/bn/kf6_entry.desktop new file mode 100644 index 0000000000..a0f7c8f440 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/bn/kf6_entry.desktop @@ -0,0 +1,102 @@ +[KCM Locale] +Name=Bengali +Name[af]=Bengali +Name[ar]=البنغاليّة +Name[as]=বঙালী +Name[ast]=Bengalín +Name[az]=Baenqal dilində +Name[be]=Бенгальская +Name[be@latin]=Bienhaĺskaja +Name[bg]=Бенгали +Name[bn]=বাংলা +Name[bn_IN]=বাংলা +Name[br]=Bangali +Name[bs]=bengalski +Name[ca]=Bengalí +Name[ca@valencia]=Bengalí +Name[cs]=Bengálský +Name[csb]=Bengalsczi +Name[cy]=Bengaleg +Name[da]=Bengali +Name[de]=Bengalisch +Name[el]=Μπενγκάλι +Name[en_GB]=Bengali +Name[eo]=Bengala +Name[es]=Bengalí +Name[et]=Bengali +Name[eu]=Bengalera +Name[fa]=بنگالی +Name[fi]=Bengali +Name[fr]=Bengali +Name[fy]=Bengaalsk +Name[ga]=Beangáilis +Name[gd]=Beangailis +Name[gl]=Bengalí +Name[gu]=બંગાળી +Name[he]=בנגלית +Name[hi]=बंगाली +Name[hne]=बंगाली +Name[hr]=Bengalski +Name[hsb]=Bengali +Name[hu]=Bengáli +Name[ia]=Bengalese +Name[id]=Bengali +Name[is]=Bengalska +Name[it]=Bengalese +Name[ja]=ベンガル語 +Name[ka]=ბენგალური +Name[kk]=Бенгалша +Name[km]=បេន្កាលី +Name[kn]=ಬಂಗಾಳಿ +Name[ko]=벵골어 +Name[ku]=Bengalî +Name[lb]=Bengalesch +Name[lg]=Lubengali +Name[lt]=Bengalų +Name[lv]=Bengāļu +Name[mai]=बंगाली +Name[mk]=Бенгали +Name[ml]=ബംഗാളി +Name[mr]=बंगाली +Name[ms]=Bengali +Name[nb]=Bengali +Name[nds]=Bengaalsch +Name[ne]=बङ्गाली +Name[nl]=Bengaals +Name[nn]=Bengali +Name[oc]=Bengalí +Name[or]=ବେଙ୍ଗଲି +Name[pa]=ਬੰਗਾਲੀ +Name[pl]=Bengalski +Name[ps]=بنګالي +Name[pt]=Bengali +Name[pt_BR]=Bengali +Name[ro]=Bengaleză +Name[ru]=Бенгальский +Name[sa]=बङ्गला +Name[se]=Bengaligiella +Name[si]=බෙංගාලි +Name[sk]=Bengálčina +Name[sl]=Bengalščina +Name[sq]=Bengalisht +Name[sr]=бенгалски +Name[sr@ijekavian]=бенгалски +Name[sr@ijekavianlatin]=bengalski +Name[sr@latin]=bengalski +Name[sv]=Bengali +Name[ta]=பெங்காளி +Name[te]=బెంగాలి +Name[tg]=Бенгалӣ +Name[th]=ภาษาเบ็งกาลี +Name[tok]=toki Panla +Name[tr]=Bengalce +Name[tt]=Бенгаль +Name[ug]=بېنگالچە +Name[uk]=Бенгальська +Name[uz]=Bengalcha +Name[uz@cyrillic]=Бенгалча +Name[vi]=Tiếng Băng-gan +Name[wa]=Bengali +Name[zh_CN]=孟加拉语 +Name[zh_HK]=孟加拉語 +Name[zh_TW]=孟加拉語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/bn_IN/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/bn_IN/kf6_entry.desktop new file mode 100644 index 0000000000..8ae31f5b18 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/bn_IN/kf6_entry.desktop @@ -0,0 +1,98 @@ +[KCM Locale] +Name=Bengali (India) +Name[ar]=البنغاليّة (الهند) +Name[as]=বঙালী (ভাৰত) +Name[ast]=Bengalín (India) +Name[az]=Benqal (Hindistan) dilində +Name[be]=Бенгальская (Індыя) +Name[be@latin]=Bienhaĺskaja (Indyja) +Name[bg]=Бенгали +Name[bn]=বাংলা (ভারত) +Name[bn_IN]=বাংলা (ভারত) +Name[br]=Bangali (Indez) +Name[bs]=bengalski (Indija) +Name[ca]=Bengalí (Índia) +Name[ca@valencia]=Bengalí (Índia) +Name[cs]=Bengálský (Indie) +Name[csb]=Bengalsczi (Indie) +Name[da]=Bengali (Indien) +Name[de]=Bengalisch (Indien) +Name[el]=Μπενγκάλι (Ινδία) +Name[en_GB]=Bengali (India) +Name[eo]=Bengala (Hinda) +Name[es]=Bengalí (India) +Name[et]=Bengali (India) +Name[eu]=Bengalera (India) +Name[fa]=بنگالی (هند) +Name[fi]=Bengali (Intia) +Name[fr]=Bengali (Inde) +Name[fy]=Bengaalsk (india) +Name[ga]=Beangáilis (An India) +Name[gd]=Beangailis nan Innseachan +Name[gl]=Bengalí (India) +Name[gu]=બંગાળી (ભારત) +Name[he]=בנגלית הודית +Name[hi]=बंगाली (भारत) +Name[hne]=बंगाली (भारत) +Name[hr]=Bengalski (Indija) +Name[hsb]=Bengali (Indiska) +Name[hu]=Bengáli (India) +Name[ia]=Bengalese (India) +Name[id]=Bengali (India) +Name[is]=Bengalska (Indland) +Name[it]=Bengalese (India) +Name[ja]=ベンガル語 (インド) +Name[ka]=ბენგალური (ინდია) +Name[kk]=Бенгалша (Үндістан) +Name[km]=បេន្កាលី (ឥណ្ឌា) +Name[kn]=ಬಂಗಾಳಿ (ಭಾರತ) +Name[ko]=벵골어(인도) +Name[ku]=Bengalî (Hindistan) +Name[lg]=Lubengali (olwa mu Buyindi) +Name[lt]=Bengalų (Indija) +Name[lv]=Bengāļu (Indijas) +Name[mai]=बंगाली (भारत) +Name[mk]=Бенгали (Индија) +Name[ml]=ബംഗാളി (ഇന്ത്യ) +Name[mr]=बंगाली (भारत) +Name[ms]=Bengali (India) +Name[nb]=Bengali (India) +Name[nds]=Bengaalsch (Indien) +Name[ne]=बङ्गाली (भारत) +Name[nl]=Bengaals (India) +Name[nn]=Bengali (India) +Name[oc]=Bengalin (Índia) +Name[or]=ବେଙ୍ଗଲି (ଭାରତ) +Name[pa]=ਬੰਗਾਲੀ (ਭਾਰਤ) +Name[pl]=Bengalski (Indie) +Name[ps]=بنګالي (انډيا) +Name[pt]=Bengali (Índia) +Name[pt_BR]=Bengali (Índia) +Name[ro]=Bengaleză (India) +Name[ru]=Бенгальский (Индия) +Name[sa]=बङ्गला (भारत) +Name[se]=Bengaligiella (India) +Name[si]=බෙංගාලි (ඉන්දීය) +Name[sk]=Bengálčina (India) +Name[sl]=Bengalščina (Indija) +Name[sq]=Bengalisht (Indi) +Name[sr]=бенгалски (Индија) +Name[sr@ijekavian]=бенгалски (Индија) +Name[sr@ijekavianlatin]=bengalski (Indija) +Name[sr@latin]=bengalski (Indija) +Name[sv]=Bengali (Indien) +Name[ta]=பெங்காளி (இந்தியா) +Name[te]=బెంగాలి (ఇండియా) +Name[tg]=Бенгалӣ (Ҳиндӣ) +Name[th]=ภาษาเบ็งกาลี (อินเดีย) +Name[tok]=toki Panla pi ma Palata +Name[tr]=Bengalce (Hindistan) +Name[tt]=Бенгаль (Һинд.) +Name[ug]=بېنگالچە (ھىندىستان) +Name[uk]=Бенгальська (Індія) +Name[uz]=Bengalcha (Hindiston) +Name[uz@cyrillic]=Бенгалча (Ҳиндистон) +Name[vi]=Tiếng Băng-gan (Ấn Độ) +Name[wa]=Bengali (Inde) +Name[zh_CN]=孟加拉语 (印度) +Name[zh_TW]=孟加拉語(印度) diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/br/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/br/kf6_entry.desktop new file mode 100644 index 0000000000..7e9425dde8 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/br/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Breton +Name[af]=Breton +Name[ar]=البرتونيّة +Name[as]=ব্ৰিট'ন +Name[ast]=Bretón +Name[az]=Breton dilində +Name[be]=Брэтонская +Name[be@latin]=Bretonskaja +Name[bg]=Бретонски +Name[bn]=ব্রেটন +Name[bn_IN]=ব্রেটন +Name[br]=Brezhoneg +Name[bs]=bretonski +Name[ca]=Bretó +Name[ca@valencia]=Bretó +Name[cs]=Bretonský +Name[csb]=Bretońsczi +Name[cy]=Llydaweg +Name[da]=Bretonsk +Name[de]=Bretonisch +Name[el]=Βρετονικά +Name[en_GB]=Breton +Name[eo]=Bretona +Name[es]=Bretón +Name[et]=Bretooni +Name[eu]=Bretoiera +Name[fa]=برتونی +Name[fi]=Bretoni +Name[fr]=Breton +Name[fy]=Bretonsk +Name[ga]=Briotáinis +Name[gd]=Breatnais +Name[gl]=Bretón +Name[gu]=બ્રેટોન +Name[he]=ברטונית +Name[hi]=ब्रेटन +Name[hne]=ब्रेटन +Name[hr]=Bretonski +Name[hsb]=Bretonsce +Name[hu]=Breton +Name[ia]=Bretone +Name[id]=Inggris +Name[is]=Bretónska +Name[it]=Bretone +Name[ja]=ブルトン語 +Name[ka]=ბრეტონული +Name[kk]=Бретонша +Name[km]=ប្រេតុង +Name[kn]=ಬ್ರೆಟನ್ +Name[ko]=브르타뉴어 +Name[ku]=Bretonî +Name[lb]=Bretonesch +Name[lg]=Luburetoni +Name[lt]=Bretonų +Name[lv]=Bretoņu +Name[mai]=ब्रेटन +Name[mk]=Бретонски +Name[ml]=ബ്രെട്ടോണ്‍ +Name[mr]=ब्रेटन +Name[ms]=Breton +Name[nb]=Bretonsk +Name[nds]=Bretoonsch +Name[ne]=बेलायती +Name[nl]=Bretons +Name[nn]=Bretonsk +Name[oc]=Breton +Name[or]=ବ୍ରେଟନ +Name[pa]=ਬਾਰਟਨ +Name[pl]=Bretoński +Name[ps]=برېټون +Name[pt]=Bretão +Name[pt_BR]=Bretão +Name[ro]=Bretonă +Name[ru]=Бретонский +Name[sa]=ब्रेटन +Name[se]=Bretonagiella +Name[si]=බ්‍රෙටන් +Name[sk]=Bretónčina +Name[sl]=Bretonščina +Name[sq]=Bretonisht +Name[sr]=бретонски +Name[sr@ijekavian]=бретонски +Name[sr@ijekavianlatin]=bretonski +Name[sr@latin]=bretonski +Name[sv]=Bretonska +Name[ta]=பிரிடான் +Name[te]=బ్రెటన్ +Name[tg]=Бритонӣ +Name[th]=ภาษาเบร็ตตัน +Name[tok]=toki Peson +Name[tr]=Bretonca +Name[tt]=Бретон +Name[ug]=بىرېتونچە +Name[uk]=Бретонська +Name[uz]=Bretoncha +Name[uz@cyrillic]=Бретонча +Name[vi]=Tiếng Breton +Name[wa]=Burton +Name[xh]=Breton +Name[zh_CN]=布列塔尼语 +Name[zh_HK]=不列塔尼語 +Name[zh_TW]=布列塔尼語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/bs/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/bs/kf6_entry.desktop new file mode 100644 index 0000000000..3b44445757 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/bs/kf6_entry.desktop @@ -0,0 +1,84 @@ +[KCM Locale] +Name=Bosnian +Name[af]=Bosnise +Name[ar]=البوسنيّة +Name[ast]=Bosniu +Name[az]=Bosniya dilində +Name[be]=Баснійская +Name[be@latin]=Basnijskaja +Name[bg]=Босненски +Name[br]=Bosnieg +Name[bs]=bosanski +Name[ca]=Bosnià +Name[ca@valencia]=Bosnià +Name[cs]=Bosenský +Name[cy]=Bosnieg +Name[da]=Bosnisk +Name[de]=Bosnisch +Name[el]=Βοσνιακά +Name[en_GB]=Bosnian +Name[eo]=Bosnia +Name[es]=Bosnio +Name[et]=Bosnia +Name[eu]=Bosniera +Name[fa]=بوسنیایی +Name[fi]=Bosnia +Name[fr]=Bosniaque +Name[fy]=Bosnysk +Name[ga]=Boisnis +Name[gd]=Bosnais +Name[gl]=Bosníaco +Name[gu]=બોસ્નિઅન +Name[he]=בוסנית +Name[hi]=बोस्नियाई +Name[hr]=Bosanski +Name[hu]=Bosnyák +Name[ia]=Bosnian +Name[id]=Bosnia +Name[is]=Bosníska +Name[it]=Bosniaco +Name[ja]=ボズニア語 +Name[ka]=ბოსნიური +Name[kk]=Боснаша +Name[km]=បូស្នី +Name[ko]=보스니아어 +Name[lb]=Bosnesch +Name[lg]=Lubosniya +Name[lt]=Bosnių +Name[lv]=Bosniešu +Name[mr]=बोस्नियन +Name[nb]=Bosnisk +Name[nds]=Bosnisch +Name[nl]=Bosnisch +Name[nn]=Bosnisk +Name[pa]=ਬੋਸਨੀਆਈ +Name[pl]=Bośniacki +Name[pt]=Bósnio +Name[pt_BR]=Bósnio +Name[ro]=Bosniacă +Name[ru]=Боснийский +Name[sa]=बोस्नियाई +Name[se]=Bosniagiella +Name[sk]=Bosniačtina +Name[sl]=Bosanščina +Name[sq]=Boshnjakisht +Name[sr]=бошњачки +Name[sr@ijekavian]=бошњачки +Name[sr@ijekavianlatin]=bošnjački +Name[sr@latin]=bošnjački +Name[sv]=Bosniska +Name[ta]=பொஸ்னியன் +Name[tg]=Босниягӣ +Name[tok]=toki Posan +Name[tr]=Bosnaca +Name[tt]=Босния +Name[ug]=بوسنىيەچە +Name[uk]=Боснійська +Name[uz]=Bosniyacha +Name[uz@cyrillic]=Боснияча +Name[vi]=Tiếng Bosnia +Name[wa]=Bosnyin +Name[xh]=Bosnian +Name[zh_CN]=波斯尼亚语 +Name[zh_HK]=波斯尼亞語 +Name[zh_TW]=波士尼亞語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ca/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ca/kf6_entry.desktop new file mode 100644 index 0000000000..2047f53a27 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ca/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Catalan +Name[af]=Katelaans +Name[ar]=الكاتالانيّة +Name[as]=কাটালান +Name[ast]=Catalán +Name[az]=Katalon dilində +Name[be]=Каталанская +Name[be@latin]=Katalanskaja +Name[bg]=Каталонски +Name[bn]=ক্যাটালান +Name[bn_IN]=ক্যাটালান +Name[br]=Katalaneg +Name[bs]=katalonski +Name[ca]=Català +Name[ca@valencia]=Català +Name[cs]=Katalánský +Name[csb]=Katalońsczi +Name[cy]=Catalaneg +Name[da]=Catalansk +Name[de]=Katalanisch +Name[el]=Καταλανικά +Name[en_GB]=Catalan +Name[eo]=Kataluna +Name[es]=Catalán +Name[et]=Katalaani +Name[eu]=Katalana +Name[fa]=کاتالان +Name[fi]=Katalaani +Name[fr]=Catalan +Name[fy]=Katalaansk +Name[ga]=Catalóinis +Name[gd]=Catalanais +Name[gl]=Catalán +Name[gu]=કેટેલાન +Name[he]=קטלאנית +Name[hi]=केटेलन +Name[hne]=केटेलन +Name[hr]=Katalonski +Name[hsb]=Katalansce +Name[hu]=Katalán +Name[ia]=Catalan +Name[id]=Catalan +Name[is]=Katalónska +Name[it]=Catalano +Name[ja]=カタロニア語 +Name[ka]=კატალანური +Name[kk]=Каталанша +Name[km]=កាតាឡាន +Name[kn]=ಕ್ಯಾಟಲಾನ್ +Name[ko]=카탈루냐어 +Name[ku]=Katalan +Name[lb]=Katalanesch +Name[lg]=Lukatalani +Name[lt]=Katalonų +Name[lv]=Kataloņu +Name[mai]=केटालान +Name[mk]=Каталонски +Name[ml]=കറ്റാലന്‍ +Name[mr]=केटेलन +Name[ms]=Catalan +Name[nb]=Katalansk +Name[nds]=Katalaansch +Name[ne]=कातालान +Name[nl]=Catalaans +Name[nn]=Katalansk +Name[oc]=Catalan +Name[or]=କେଟାଲାନ +Name[pa]=ਕਾਟਾਲਾਨ +Name[pl]=Kataloński +Name[ps]=کېټېلېن +Name[pt]=Catalão +Name[pt_BR]=Catalão +Name[ro]=Catalană +Name[ru]=Каталонский +Name[sa]=कातालान भाषा +Name[se]=Katalánagiella +Name[si]=කැටලන් +Name[sk]=Katalánčina +Name[sl]=Katalonščina +Name[sq]=Katalanisht +Name[sr]=каталонски +Name[sr@ijekavian]=каталонски +Name[sr@ijekavianlatin]=katalonski +Name[sr@latin]=katalonski +Name[sv]=Katalanska +Name[ta]=கெடலான் +Name[te]=కెటలన్ +Name[tg]=Каталанӣ +Name[th]=ภาษาคาตาลัน +Name[tok]=toki Katala +Name[tr]=Katalanca +Name[tt]=Каталон +Name[ug]=كاتالانچە +Name[uk]=Каталанська +Name[uz]=Katalancha +Name[uz@cyrillic]=Каталанча +Name[vi]=Tiếng Catalan +Name[wa]=Catalan +Name[xh]=Catalan +Name[zh_CN]=加泰罗尼亚语 +Name[zh_HK]=加泰隆尼亞語 +Name[zh_TW]=加泰隆尼亞語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ca@valencia/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ca@valencia/kf6_entry.desktop new file mode 100644 index 0000000000..0a4498cc4f --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ca@valencia/kf6_entry.desktop @@ -0,0 +1,78 @@ +[KCM Locale] +Name=Catalan (Valencian) +Name[ar]=الكاتلونيّة(البلنسيّة) +Name[ast]=Catalán (Valencia) +Name[az]=Katalon (Valensiya) dilində +Name[be]=Каталанская (Валенсія) +Name[be@latin]=Katalanskaja (Valiensija) +Name[bg]=Каталонски (Валенсиански) +Name[bs]=katalonski (valensijski) +Name[ca]=Català (Valencià) +Name[ca@valencia]=Català (Valencià) +Name[cs]=Katalánský (Valencie) +Name[da]=Catalansk (valenciansk) +Name[de]=Katalanisch (Valencianisch) +Name[el]=Καταλανικά (Βαλένθια) +Name[en_GB]=Catalan (Valencian) +Name[eo]=Kataluna (Valencio) +Name[es]=Catalán (Valenciano) +Name[et]=Katalaani (valencia) +Name[eu]=Katalana (valentziera) +Name[fa]=کاتالان (والنسیایی) +Name[fi]=Katalaani (Valencia) +Name[fr]=Catalan (Valencien) +Name[ga]=Catalóinis (Vaileinsis) +Name[gd]=Catalanais (Valencianais) +Name[gl]=Catalán (valenciano) +Name[gu]=કેટેલાન (વેલેન્સિઅન) +Name[he]=קטלאנית ולנסית +Name[hi]=केटेलन (वेलेन्सियन) +Name[hr]=Katalonski (Valencijski) +Name[hu]=Katalán (valenciai) +Name[ia]=Catalan (Valencian) +Name[id]=Catalan (Valencia) +Name[is]=Katalónska (Valensía) +Name[it]=Catalano (Valenziano) +Name[ja]=カタロニア語 (バレンシア方言) +Name[ka]=კატალანური (ვალენსიური) +Name[kk]=Каталанша (Валенсияша) +Name[km]=កាតាឡាំ (វ៉ាឡេន​ស្សង់) +Name[ko]=카탈루냐어(발렌시아) +Name[ku]=Katalan (Valensî) +Name[lg]=Lukatalani (olwa mu Valenciya) +Name[lt]=Katalonų (Valencijos) +Name[lv]=Kataloņu (Valensijas) +Name[mk]=Каталонски (валенсиски) +Name[mr]=केटेलन (व्हेलन्सिअन) +Name[nb]=Katalansk (Valencia) +Name[nds]=Katalaansch (valenziaansch) +Name[nl]=Catalaans (Valentiaans) +Name[nn]=Katalansk (Valencia) +Name[pa]=ਕਟਾਲਾਨ (ਵਾਲਿਸੀਅਨ) +Name[pl]=Kataloński (walencki) +Name[pt]=Catalão (Valenciano) +Name[pt_BR]=Catalão (valenciano) +Name[ro]=Catalană (Valenciană) +Name[ru]=Каталонский (Валенсия) +Name[sa]=कातालान (वैलेन्सिया) +Name[se]=Kataluniagiella (Valensalaš) +Name[sk]=Katalánčina (Valencia) +Name[sl]=Valencijanščina +Name[sq]=Katalanisht (Valenciane) +Name[sr]=каталонски (валенсијски) +Name[sr@ijekavian]=каталонски (валенсијски) +Name[sr@ijekavianlatin]=katalonski (valensijski) +Name[sr@latin]=katalonski (valensijski) +Name[sv]=Katalanska (valenciska) +Name[ta]=கெடலான் (வேலன்சீயன்) +Name[tg]=Каталанӣ (Валенсӣ) +Name[th]=ภาษาคาตะลาน (วาเลนเซีย) +Name[tr]=Katalanca (Valensiya) +Name[tt]=Каталан (Валенсия) +Name[ug]=كاتالانچە(ۋالىنسىيە) +Name[uk]=Каталонська (валенсійський діалект) +Name[vi]=Tiếng Catalan (Valencia) +Name[wa]=Catalan (Valince) +Name[zh_CN]=加泰罗尼亚语 (巴伦西亚) +Name[zh_TW]=加泰隆尼亞語(瓦倫西亞) + diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/crh/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/crh/kf6_entry.desktop new file mode 100644 index 0000000000..89322c797d --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/crh/kf6_entry.desktop @@ -0,0 +1,89 @@ +[KCM Locale] +Name=Crimean Tatar +Name[ar]=تتاريّة القرم +Name[as]=ক্ৰিমিয়ান টাটাৰ +Name[az]=Krım-tatar dilində +Name[be]=Крымскататарская +Name[be@latin]=Krymskatatarskaja +Name[bg]=Кримейски татарски +Name[bn]=ক্রিমিয়ান টাটার +Name[bn_IN]=ক্রিমিয়ান তাতার +Name[bs]=krimski tatarski +Name[ca]=Tàtar de Crimea +Name[ca@valencia]=Tàtar de Crimea +Name[cs]=Krymská tatarština +Name[csb]=Tatarsczi (krimsczi) +Name[da]=Krimsk tatar +Name[de]=Krimtatarisch +Name[el]=Ταταρικά Κριμαίας +Name[en_GB]=Crimean Tatar +Name[eo]=Krima tatara +Name[es]=Tártaro de Crimea +Name[et]=Krimmitatari +Name[eu]=Krimeako tatarera +Name[fa]=تاتار کریمه‌ای +Name[fi]=Krimin tataari +Name[fr]=Tatar de Crimée +Name[fy]=Crimean Tatar +Name[ga]=Tatairis na Crimé +Name[gd]=Tatarais A' Chriom +Name[gl]=Tártaro da Crimea +Name[gu]=ક્રિમીઅન તાતાર +Name[he]=טטרית של קרים +Name[hi]=क्रिमियन तातर +Name[hne]=क्रिमियन तातर +Name[hr]=Krimsko-tatarski +Name[hsb]=Krimtatarsce +Name[hu]=Krími tatár +Name[ia]=Crimean Tatar +Name[id]=Crimean Tatar +Name[is]=Krímtatarska +Name[it]=Tartaro di Crimea +Name[ja]=クリミア・タタール語 +Name[ka]=ყირიმელი თათრული +Name[kk]=Қырым Татарша +Name[km]=Crimean Tatar +Name[kn]=ಕ್ರೈಮೀನ್ ಟಟಾರ್ +Name[ko]=크림 타타르어 +Name[ku]=Tatariya Kirimî +Name[lg]=Lutatar olw'omu Kirimea +Name[lt]=Krymo totorių +Name[lv]=Krimas tatāru +Name[mai]=क्रिमियन तातर +Name[mk]=Кримски татарски +Name[ml]=ക്രിമീന്‍ ടട്ടാര്‍ +Name[mr]=क्रिमीयन ततार +Name[ms]=Crimean Tatar +Name[nb]=Krimtatarsk +Name[nds]=Krimtataarsch +Name[nl]=Krim-Tataars +Name[nn]=Krymtatarsk +Name[pa]=ਸਰੀਮੀਨ ਤਤਾਰ +Name[pl]=Tatarski (Krymski) +Name[ps]=کريمين ټاټار +Name[pt]=Tatar da Crimeia +Name[pt_BR]=Tártaro da Crimeia +Name[ro]=Tătară din Crimeea +Name[ru]=Крымско-татарский +Name[sa]=क्रीमिया तातार +Name[se]=Krimalaš tataragiella +Name[si]=ක්‍රිමීන් තාටර් +Name[sk]=Krymská tatárčina +Name[sl]=Krimska tatarščina +Name[sq]=Tatarishte Krimease +Name[sr]=кримски татарски +Name[sr@ijekavian]=кримски татарски +Name[sr@ijekavianlatin]=krimski tatarski +Name[sr@latin]=krimski tatarski +Name[sv]=Krimtatariska +Name[ta]=கிரிமேன் டாடார் +Name[tg]=Тоторӣ +Name[th]=ภาษาทาทาร์ +Name[tr]=Kırım Tatarcası +Name[tt]=Татарча (Кырым) +Name[ug]=قىرىم تاتارچە +Name[uk]=Кримськотатарська +Name[vi]=Tiếng Tatar Crimea +Name[wa]=Tatår del Crimêye +Name[zh_CN]=克里米亚鞑靼语 +Name[zh_TW]=克里米亞韃靼語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/cs/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/cs/kf6_entry.desktop new file mode 100644 index 0000000000..e7b0f07112 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/cs/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Czech +Name[af]=Tsjeggië +Name[ar]=التّشيكيّة +Name[as]=চেক্‌ +Name[ast]=Checu +Name[az]=Çex dilində +Name[be]=Чэшская +Name[be@latin]=Češskaja +Name[bg]=Чешки +Name[bn]=চেক +Name[bn_IN]=চেক +Name[br]=Tchekeg +Name[bs]=češki +Name[ca]=Txec +Name[ca@valencia]=Txec +Name[cs]=Český +Name[csb]=Czesczi +Name[cy]=Tsiec +Name[da]=Tjekkisk +Name[de]=Tschechisch +Name[el]=Τσέχικα +Name[en_GB]=Czech +Name[eo]=Ĉeĥa +Name[es]=Checo +Name[et]=Tšehhi +Name[eu]=Txekiera +Name[fa]=چکسلواکی +Name[fi]=Tšekki +Name[fr]=Tchèque +Name[fy]=Tsjechysk +Name[ga]=Seicis +Name[gd]=Seacais +Name[gl]=Checo +Name[gu]=ચેક +Name[he]=צ׳כית +Name[hi]=चेक +Name[hne]=चेक +Name[hr]=Češki +Name[hsb]=Čěsce +Name[hu]=Cseh +Name[ia]=Tchech +Name[id]=Ceko +Name[is]=Tékkneska +Name[it]=Ceco +Name[ja]=チェコ語 +Name[ka]=ჩეხური +Name[kk]=Чехше +Name[km]=ឆេក +Name[kn]=ಚೆಕ್ +Name[ko]=체코어 +Name[ku]=Çekî +Name[lb]=Tschechesch +Name[lg]=Luceeki +Name[lt]=Čekų +Name[lv]=Čehu +Name[mai]=चेक +Name[mk]=Чешки +Name[ml]=ചെക്ക് +Name[mr]=चेक +Name[ms]=Czech +Name[nb]=Tsjekkisk +Name[nds]=Tschechsch +Name[ne]=चेक +Name[nl]=Tsjechisch +Name[nn]=Tsjekkisk +Name[oc]=Chèc +Name[or]=ଚେକ +Name[pa]=ਚੈੱਕ +Name[pl]=Czeski +Name[ps]=چېک +Name[pt]=Checo +Name[pt_BR]=Tcheco +Name[ro]=Cehă +Name[ru]=Чешский +Name[sa]=चेक +Name[se]=Čehkagiella +Name[si]=චෙච් +Name[sk]=Čeština +Name[sl]=Češčina +Name[sq]=Çekisht +Name[sr]=чешки +Name[sr@ijekavian]=чешки +Name[sr@ijekavianlatin]=češki +Name[sr@latin]=češki +Name[sv]=Tjeckiska +Name[ta]=செக் +Name[te]=చెక్ +Name[tg]=Чехӣ +Name[th]=ภาษาเชค +Name[tok]=toki Seki +Name[tr]=Çekçe +Name[tt]=Чех +Name[ug]=چېخچە +Name[uk]=Чеська +Name[uz]=Chexcha +Name[uz@cyrillic]=Чехча +Name[vi]=Tiếng Séc +Name[wa]=Tcheke +Name[xh]=Czech +Name[zh_CN]=捷克语 +Name[zh_HK]=捷克語 +Name[zh_TW]=捷克語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/csb/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/csb/kf6_entry.desktop new file mode 100644 index 0000000000..994e5bc8b7 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/csb/kf6_entry.desktop @@ -0,0 +1,96 @@ +[KCM Locale] +Name=Kashubian +Name[ar]=الكاشوبيّة +Name[as]=কাছুবিয়ান +Name[az]=Kaşub dilində +Name[be]=Сербская +Name[be@latin]=Sierbskaja +Name[bg]=Кашубски +Name[bn]=কাশুবিয়ান +Name[bn_IN]=কাশুবিয়ান +Name[br]=Kashubieg +Name[bs]=kašupski +Name[ca]=Caixubi +Name[ca@valencia]=Caixubi +Name[cs]=Kašubský +Name[csb]=Kaszëbsczi +Name[da]=Kashubisk +Name[de]=Kaschubisch +Name[el]=Κασουμπιανά +Name[en_GB]=Kashubian +Name[eo]=Kaŝuba +Name[es]=Casubio +Name[et]=Kašuubi +Name[eu]=Kaxubiera +Name[fa]=کاشوبیان +Name[fi]=Kašubi +Name[fr]=Kachoube +Name[fy]=Kashubian +Name[ga]=Caisiúibis +Name[gd]=Caisiubais +Name[gl]=Caxubio +Name[gu]=કાશુબિયન +Name[he]=קשובית +Name[hi]=कासुबियाई +Name[hne]=कासुबियाई +Name[hr]=Kašupski +Name[hsb]=Kašubsce +Name[hu]=Kasub +Name[ia]=Kashubian +Name[id]=Kashubia +Name[is]=Kasjúbíska +Name[it]=Casciubico +Name[ja]=カシューブ語 +Name[ka]=კაშუბური +Name[kk]=Кашубша +Name[km]=កាស៊ូបៀន +Name[kn]=ಕಶುಬಿಯನ್ +Name[ko]=카슈비아어 +Name[ku]=Kaşûbî +Name[lg]=Lukasubiya +Name[lt]=Kašubų +Name[lv]=Kašūbu +Name[mai]=काशुबिनयन +Name[mk]=Кашубски +Name[ml]=കശൂബ്യന്‍ +Name[mr]=कासुबियाई +Name[ms]=Kashubian +Name[nb]=Kasjubisk +Name[nds]=Kaschuubsch +Name[ne]=कसुबियन +Name[nl]=Kasjoebisch +Name[nn]=Kasjubisk +Name[oc]=Kashbian +Name[or]=କାଶୁବେନ +Name[pa]=ਕਾਸ਼ੂਬੀਆਈ +Name[pl]=Kaszubski +Name[ps]=کشوبي +Name[pt]=Kashubian +Name[pt_BR]=Cassúbia +Name[ro]=Kashubian +Name[ru]=Кашубский +Name[sa]=कशुबियन +Name[se]=Kašubiagiella +Name[si]=කෂුබියානු +Name[sk]=Kašubčina +Name[sl]=Kašubščina +Name[sq]=Kashubianisht +Name[sr]=кашупски +Name[sr@ijekavian]=кашупски +Name[sr@ijekavianlatin]=kašupski +Name[sr@latin]=kašupski +Name[sv]=Kasjubiska +Name[ta]=கஷுபியன் +Name[te]=కషుబియన్ +Name[tg]=Кошӯбиявӣ +Name[th]=ภาษาคาชูเบียน +Name[tr]=Kaşupça +Name[tt]=Кашуб +Name[ug]=كاسزۇبىچە +Name[uk]=Кашубська +Name[uz]=Kashubiacha +Name[uz@cyrillic]=Кашубиача +Name[vi]=Tiếng Kashubia +Name[wa]=Cachoube +Name[zh_CN]=卡舒比语 +Name[zh_TW]=卡舒比語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/cy/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/cy/kf6_entry.desktop new file mode 100644 index 0000000000..d5eaa4a019 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/cy/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Welsh +Name[af]=Wallies +Name[ar]=الغاليّة +Name[as]=ৱেল্‌শ্ব +Name[ast]=Galés +Name[az]=Uels dilində +Name[be]=Валійская +Name[be@latin]=Valijskaja +Name[bg]=Уелски +Name[bn]=ওয়েল্‌শ +Name[bn_IN]=ওয়েলশ +Name[br]=Kembraeg +Name[bs]=velški +Name[ca]=Gal·lès +Name[ca@valencia]=Gal·lés +Name[cs]=Welšský +Name[csb]=Walijsczi +Name[cy]=Cymraeg +Name[da]=Walisisk +Name[de]=Walisisch +Name[el]=Ουαλικά +Name[en_GB]=Welsh +Name[eo]=Kimra +Name[es]=Galés +Name[et]=Uelsi +Name[eu]=Galesa +Name[fa]=ولزی +Name[fi]=Kymri +Name[fr]=Gallois +Name[fy]=Welsk +Name[ga]=Breatnais +Name[gd]=Cuimris +Name[gl]=Galés +Name[gu]=વેલ્સ +Name[he]=וולשית +Name[hi]=वेल्श +Name[hne]=वेल्स +Name[hr]=Velški +Name[hsb]=Kymrisce +Name[hu]=Walesi +Name[ia]=Gallese +Name[id]=Wales +Name[is]=Velska +Name[it]=Gallese +Name[ja]=ウェールズ語 +Name[ka]=უელსური +Name[kk]=Уэлсше +Name[km]=វ៉េល +Name[kn]=ವೆಲ್ಷ್ +Name[ko]=웨일스어 +Name[ku]=Galî +Name[lb]=Wallisesch +Name[lg]=Luwelesi +Name[lt]=Valų +Name[lv]=Velsiešu +Name[mai]=वेल्श +Name[mk]=Велшки +Name[ml]=വെല്‍ഷ് +Name[mr]=वेल्श +Name[ms]=Wales +Name[nb]=Walisisk +Name[nds]=Waliessch +Name[ne]=वेल्स +Name[nl]=Welsh +Name[nn]=Walisisk +Name[oc]=Galés +Name[or]=ୱେଲ୍ସ +Name[pa]=ਵਾਲਿਸ਼ +Name[pl]=Walijski +Name[ps]=وېلش +Name[pt]=Galês +Name[pt_BR]=Galês +Name[ro]=Galeză +Name[ru]=Валлийский +Name[sa]=वेल्शभाषा +Name[se]=Walesagiella +Name[si]=වෙල්ෂ් +Name[sk]=Waleština +Name[sl]=Valižanščina +Name[sq]=Uelsisht +Name[sr]=велшки +Name[sr@ijekavian]=велшки +Name[sr@ijekavianlatin]=velški +Name[sr@latin]=velški +Name[sv]=Walesiska +Name[ta]=வெல்ஷ் +Name[te]=వెల్ష్ +Name[tg]=Уэлсӣ +Name[th]=ภาษาเวลช์ +Name[tok]=toki Kinli +Name[tr]=Galce +Name[tt]=Уэльс +Name[ug]=ۋېلشچە +Name[uk]=Уельська +Name[uz]=Uelscha +Name[uz@cyrillic]=Уэлсча +Name[vi]=Tiếng Wales +Name[wa]=Walès +Name[xh]=Welsh +Name[zh_CN]=威尔士语 +Name[zh_HK]=威爾斯語 +Name[zh_TW]=威爾斯語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/da/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/da/kf6_entry.desktop new file mode 100644 index 0000000000..fd1d8d4044 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/da/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Danish +Name[af]=Deens +Name[ar]=الدّنماركيّة +Name[as]=ডেনিশ্ব +Name[ast]=Danés +Name[az]=Danimarka dilində +Name[be]=Дацкая +Name[be@latin]=Dackaja +Name[bg]=Датски +Name[bn]=ড্যানিশ +Name[bn_IN]=ডেনিশ +Name[br]=Daneg +Name[bs]=danski +Name[ca]=Danès +Name[ca@valencia]=Danés +Name[cs]=Dánský +Name[csb]=Dëńsczi +Name[cy]=Daneg +Name[da]=Dansk +Name[de]=Dänisch +Name[el]=Δανέζικα +Name[en_GB]=Danish +Name[eo]=Dana +Name[es]=Danés +Name[et]=Taani +Name[eu]=Daniera +Name[fa]=دانمارکی +Name[fi]=Tanska +Name[fr]=Danois +Name[fy]=Deensk +Name[ga]=Danmhairgis +Name[gd]=Danmhairgis +Name[gl]=Dinamarqués +Name[gu]=ડેનિશ +Name[he]=דנית +Name[hi]=दानिश +Name[hne]=दानिस +Name[hr]=Danski +Name[hsb]=Dansce +Name[hu]=Dán +Name[ia]=Danese +Name[id]=Denmark +Name[is]=Danska +Name[it]=Danese +Name[ja]=デンマーク語 +Name[ka]=დანიური +Name[kk]=Датша +Name[km]=ដាណឺម៉ាក +Name[kn]=ಡ್ಯಾನಿಷ್ +Name[ko]=덴마크어 +Name[ku]=Danmarkî +Name[lb]=Dänesch +Name[lg]=Ludenimaaki +Name[lt]=Danų +Name[lv]=Dāņu +Name[mai]=डैनिश +Name[mk]=Дански +Name[ml]=ഡാനിഷ് +Name[mr]=दानिश +Name[ms]=Danish +Name[nb]=Dansk +Name[nds]=Däänsch +Name[ne]=डेनिश +Name[nl]=Deens +Name[nn]=Dansk +Name[oc]=Danés +Name[or]=ଡେନିସ +Name[pa]=ਡੈਨਿਸ਼ +Name[pl]=Duński +Name[ps]=ډېنېش +Name[pt]=Dinamarquês +Name[pt_BR]=Dinamarquês +Name[ro]=Daneză +Name[ru]=Датский +Name[sa]=दानिशः +Name[se]=Dánskkagiella +Name[si]=ඩෙන්මාර්ක +Name[sk]=Dánčina +Name[sl]=Danščina +Name[sq]=Danisht +Name[sr]=дански +Name[sr@ijekavian]=дански +Name[sr@ijekavianlatin]=danski +Name[sr@latin]=danski +Name[sv]=Danska +Name[ta]=டேனிஷ் +Name[te]=డెనిష్ +Name[tg]=Даниягӣ +Name[th]=ภาษาเดนมาร์ก +Name[tok]=toki Tansi +Name[tr]=Danca +Name[tt]=Дания +Name[ug]=دانىشچە +Name[uk]=Данська +Name[uz]=Daniyacha +Name[uz@cyrillic]=Данияча +Name[vi]=Tiếng Đan Mạch +Name[wa]=Daenwès +Name[xh]=Danish +Name[zh_CN]=丹麦语 +Name[zh_HK]=丹麥語 +Name[zh_TW]=丹麥語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/de/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/de/kf6_entry.desktop new file mode 100644 index 0000000000..a3957869ff --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/de/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=German +Name[af]=Duits +Name[ar]=الألمانيّة +Name[as]=জাৰ্মান +Name[ast]=Alemán +Name[az]=Alman dilində +Name[be]=Нямецкая +Name[be@latin]=Niamieckaja +Name[bg]=Немски +Name[bn]=জার্মান +Name[bn_IN]=জার্মান +Name[br]=Alamaneg +Name[bs]=njemački +Name[ca]=Alemany +Name[ca@valencia]=Alemany +Name[cs]=Německý +Name[csb]=Miemiecczi +Name[cy]=Almaeneg +Name[da]=Tysk +Name[de]=Deutsch +Name[el]=Γερμανικά +Name[en_GB]=German +Name[eo]=Germana +Name[es]=Alemán +Name[et]=Saksa +Name[eu]=Aleman +Name[fa]=آلمانی +Name[fi]=Saksa +Name[fr]=Allemand +Name[fy]=Dútsk +Name[ga]=Gearmáinis +Name[gd]=Gearmailtis +Name[gl]=Alemán +Name[gu]=જર્મન +Name[he]=גרמנית +Name[hi]=जर्मन +Name[hne]=जर्मन +Name[hr]=Njemački +Name[hsb]=Němsce +Name[hu]=Német +Name[ia]=Germano +Name[id]=Jerman +Name[is]=Þýska +Name[it]=Tedesco +Name[ja]=ドイツ語 +Name[ka]=გერმანული +Name[kk]=Немісше +Name[km]=អាល្លឺម៉ង់ +Name[kn]=ಜರ್ಮನ್ +Name[ko]=독일어 +Name[ku]=Almanî +Name[lb]=Däitsch +Name[lg]=Ludaaki +Name[lt]=Vokiečių +Name[lv]=Vācu +Name[mai]=जर्मन +Name[mk]=Германски +Name[ml]=ജര്‍മ്മന്‍ +Name[mr]=जर्मन +Name[ms]=Jerman +Name[nb]=Tysk +Name[nds]=Hoochdüütsch +Name[ne]=जर्मनी +Name[nl]=Duits +Name[nn]=Tysk +Name[oc]=Aleman +Name[or]=ଜର୍ମାନ +Name[pa]=ਜਰਮਨ +Name[pl]=Niemiecki +Name[ps]=جرمني +Name[pt]=Alemão +Name[pt_BR]=Alemão +Name[ro]=Germană +Name[ru]=Немецкий +Name[sa]=जर्मन +Name[se]=Duiskkagiella +Name[si]=ජර්මානු +Name[sk]=Nemčina +Name[sl]=Nemščina +Name[sq]=Gjermanisht +Name[sr]=немачки +Name[sr@ijekavian]=њемачки +Name[sr@ijekavianlatin]=njemački +Name[sr@latin]=nemački +Name[sv]=Tyska +Name[ta]=ஜெர்மன் +Name[te]=జెర్మన్ +Name[tg]=Олмонӣ +Name[th]=ภาษาเยอรมัน +Name[tok]=toki Tosi +Name[tr]=Almanca +Name[tt]=Алман +Name[ug]=گېرمانچە +Name[uk]=Німецька +Name[uz]=Olmoncha +Name[uz@cyrillic]=Олмонча +Name[vi]=Tiếng Đức +Name[wa]=Almand +Name[xh]=German +Name[zh_CN]=德语 +Name[zh_HK]=德語 +Name[zh_TW]=德語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/el/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/el/kf6_entry.desktop new file mode 100644 index 0000000000..2ec8566d67 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/el/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Greek +Name[af]=Grieks +Name[ar]=اليونانيّة +Name[as]=গ্ৰীক +Name[ast]=Griegu +Name[az]=Yunan dilində +Name[be]=Грэчаская +Name[be@latin]=Hrečaskaja +Name[bg]=Гръцки +Name[bn]=গ্রীক +Name[bn_IN]=গ্রিক +Name[br]=Gresianeg +Name[bs]=grčki +Name[ca]=Grec +Name[ca@valencia]=Grec +Name[cs]=Řecký +Name[csb]=Grecczi +Name[cy]=Groeg +Name[da]=Græsk +Name[de]=Griechisch +Name[el]=Ελληνικά +Name[en_GB]=Greek +Name[eo]=Greka +Name[es]=Griego +Name[et]=Kreeka +Name[eu]=Greko +Name[fa]=یونانی +Name[fi]=Kreikka +Name[fr]=Grec +Name[fy]=Gryks +Name[ga]=Gréigis +Name[gd]=Greugais +Name[gl]=Grego +Name[gu]=ગ્રીક +Name[he]=יוונית +Name[hi]=यूनानी +Name[hne]=यूनानी +Name[hr]=Grčki +Name[hsb]=Grjeksce +Name[hu]=Görög +Name[ia]=Greco +Name[id]=Yunani +Name[is]=Gríska +Name[it]=Greco +Name[ja]=ギリシャ語 +Name[ka]=ბერძნული +Name[kk]=Грекше +Name[km]=ក្រិក +Name[kn]=ಗ್ರೀಕ್ +Name[ko]=그리스어 +Name[ku]=Yewnanî +Name[lb]=Griichesch +Name[lg]=Lugereeki/ Luyonaani +Name[lt]=Graikų +Name[lv]=Grieķu +Name[mai]=ग्रीक +Name[mk]=Грчки +Name[ml]=ഗ്രീക്ക് +Name[mr]=ग्रीक +Name[ms]=Greek +Name[nb]=Gresk +Name[nds]=Greeksch +Name[ne]=ग्रीक +Name[nl]=Grieks +Name[nn]=Gresk +Name[oc]=Grèc +Name[or]=ଗ୍ରୀକ +Name[pa]=ਗਰੀਕ +Name[pl]=Grecki +Name[ps]=يوناني +Name[pt]=Grego +Name[pt_BR]=Grego +Name[ro]=Greacă +Name[ru]=Греческий +Name[sa]=ग्रीकभाषा +Name[se]=Greikkagiella +Name[si]=ග්‍රීක +Name[sk]=Gréčtina +Name[sl]=Grščina +Name[sq]=Greqisht +Name[sr]=грчки +Name[sr@ijekavian]=грчки +Name[sr@ijekavianlatin]=grčki +Name[sr@latin]=grčki +Name[sv]=Grekiska +Name[ta]=கிரேக்கம் +Name[te]=గ్రీక్ +Name[tg]=Юнонӣ +Name[th]=ภาษากรีก +Name[tok]=toki Elina +Name[tr]=Yunanca +Name[tt]=Грек +Name[ug]=گىرېكچە +Name[uk]=Грецька +Name[uz]=Yunoncha +Name[uz@cyrillic]=Юнонча +Name[vi]=Tiếng Hi Lạp +Name[wa]=Grek +Name[xh]=Greek +Name[zh_CN]=希腊语 +Name[zh_HK]=希臘語 +Name[zh_TW]=希臘語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/en_GB/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/en_GB/kf6_entry.desktop new file mode 100644 index 0000000000..1a9e57e415 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/en_GB/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=British English +Name[af]=Britse Engels +Name[ar]=الإنجليزيّة البريطانيّة +Name[as]=ব্ৰিটিশ্ব ইংৰাজী +Name[ast]=Inglés (Gran Bretaña) +Name[az]=Böyük Britaniya +Name[be]=Англійская (Вялікабрытанія) +Name[be@latin]=Anhlijskaja (Vialikabrytanija) +Name[bg]=Английски (Великобритания) +Name[bn]=বৃটিশ ইংরেজি +Name[bn_IN]=ব্রিটিশ ইংরেজি +Name[br]=Saozneg eus Bro Saoz +Name[bs]=britanski engleski +Name[ca]=Anglès britànic +Name[ca@valencia]=Anglés britànic +Name[cs]=Britská angličtina +Name[csb]=Britijsczi anielsczi +Name[cy]=Saesneg Prydain +Name[da]=Britisk engelsk +Name[de]=Englisch (UK) +Name[el]=Αγγλικά Βρετανίας +Name[en_GB]=British English +Name[eo]=Brita angla +Name[es]=Inglés británico +Name[et]=Briti inglise +Name[eu]=Britainiako Ingeles +Name[fa]=انگلیسی بریتانیا +Name[fi]=Britannianenglanti +Name[fr]=Anglais Britannique +Name[fy]=Britsk Ingelsk +Name[ga]=Béarla na Breataine +Name[gd]=Beurla Bhreatainn +Name[gl]=Inglés británico +Name[gu]=બ્રિટિશ અંગ્રેજી +Name[he]=אנגלית בריטית +Name[hi]=ब्रितानी अंग्रेज़ी +Name[hne]=ब्रितानी अंगरेजी +Name[hr]=Britanski engleski +Name[hsb]=Jendźelsce (WB) +Name[hu]=Angol (brit) +Name[ia]=Anglese Britannic +Name[id]=Inggris Britania +Name[is]=Enska (Bretland) +Name[it]=Inglese britannico +Name[ja]=イギリス英語 +Name[ka]=ბრიტანული ინგლისური +Name[kk]=Британдық ағылшынша +Name[km]=អង់គ្លេស (អង់គ្លេស) +Name[kn]=ಬ್ರಿಟಿಷ್ ಇಂಗ್ಲೀಷ್ +Name[ko]=영국 영어 +Name[ku]=Îngilîziya Brîtanyayê +Name[lb]=Englesch (UK) +Name[lg]=Lungereza olwa mu Bungereza +Name[lt]=Anglų (D.Britanijos) +Name[lv]=Britu angļu +Name[mai]=ब्रिटिश अंग्रेजी +Name[mk]=Британски Англиски +Name[ml]=ബ്രിട്ടീഷ് ഇംഗ്ലീഷ് +Name[mr]=ब्रिटिश इंग्रजी +Name[ms]=English GB +Name[nb]=Engelsk (Storbritannia) +Name[nds]=Britsch Engelsch +Name[ne]=बेलायती अंग्रेजी +Name[nl]=Brits Engels +Name[nn]=Engelsk (Storbritannia) +Name[oc]=Anglés britanic +Name[or]=ବ୍ରିଟିଶ ଇଂଲିସ +Name[pa]=ਬਰਤਾਨੀਵੀ ਅੰਗਰੇਜ਼ੀ +Name[pl]=Brytyjski angielski +Name[ps]=برېټانوي انګريزي +Name[pt]=Inglês da Grã-Bretanha +Name[pt_BR]=Inglês britânico +Name[ro]=Engleză britanică +Name[ru]=Английский (Великобритания) +Name[sa]=ब्रिटिश आङ्ग्ल +Name[se]=Eŋgelasgiella (Stuorra Brittania) +Name[si]=බ්‍රිතාන්‍ය ඉංග්‍රීසි +Name[sk]=Britská angličtina +Name[sl]=Angleščina (VB) +Name[sq]=Anglisht e Britanisë +Name[sr]=британски енглески +Name[sr@ijekavian]=британски енглески +Name[sr@ijekavianlatin]=britanski engleski +Name[sr@latin]=britanski engleski +Name[sv]=Brittisk engelska +Name[ta]=பிரிட்டிஷ் ஆங்கிலம் +Name[te]=బ్రిటిష్ ఆంగ్లము +Name[tg]=Англисии Британӣ +Name[th]=ภาษาอังกฤษบริติช +Name[tok]=toki Inli pi ma Juke +Name[tr]=Britanya İngilizcesi +Name[tt]=Инглиз (Британия) +Name[ug]=ئەنگلىيە ئىنگلىزچە +Name[uk]=Англійська (Велика Британія) +Name[uz]=Inglizcha BB +Name[uz@cyrillic]=Инглизча ББ +Name[vi]=Tiếng Anh Anh +Name[wa]=Inglès britanike +Name[zh_CN]=英式英语 +Name[zh_HK]=英式英語 +Name[zh_TW]=英式英語 + diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/eo/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/eo/kf6_entry.desktop new file mode 100644 index 0000000000..379564b0ba --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/eo/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Esperanto +Name[af]=Esperanto +Name[ar]=الإسبرانتو +Name[as]=এস্পেৰান্টো +Name[ast]=Esperantu +Name[az]=Esperanto dilində +Name[be]=Эсперанта +Name[be@latin]=Espieranta +Name[bg]=Есперанто +Name[bn]=এস্পারান্তো +Name[bn_IN]=এসপারান্তো +Name[br]=Esperanteg +Name[bs]=esperanto +Name[ca]=Esperanto +Name[ca@valencia]=Esperanto +Name[cs]=Esperanto +Name[csb]=Esperanto +Name[cy]=Esperanto +Name[da]=Esperanto +Name[de]=Esperanto +Name[el]=Esperanto +Name[en_GB]=Esperanto +Name[eo]=Esperanto +Name[es]=Esperanto +Name[et]=Esperanto +Name[eu]=Esperanto +Name[fa]=اسپرانتور +Name[fi]=Esperanto +Name[fr]=Espéranto +Name[fy]=Esperanto +Name[ga]=Esperanto +Name[gd]=Esperanto +Name[gl]=Esperanto +Name[gu]=એસ્પ્રાન્ટો +Name[he]=אספרנטו +Name[hi]=एस्परेन्तो +Name[hne]=एस्परेन्तो +Name[hr]=Esperanto +Name[hsb]=Esperanto +Name[hu]=Eszperantó +Name[ia]=Esperanto +Name[id]=Esperanto +Name[is]=Esperantó +Name[it]=Esperanto +Name[ja]=エスペラント語 +Name[ka]=ესპერანტო +Name[kk]=Эсперанто +Name[km]=អេស្ពេរ៉ាន់តូ +Name[kn]=ಎಸ್ಪರಾನ್ಟೊ +Name[ko]=에스페란토 +Name[ku]=Esperanto +Name[lb]=Esperanto +Name[lg]=Esperanto +Name[lt]=Esperanto +Name[lv]=Esperanto +Name[mai]=एस्पेरांटो +Name[mk]=Есперанто +Name[ml]=എസ്പരാണ്ടോ +Name[mr]=एस्परेन्तो +Name[ms]=Esperanto +Name[nb]=Esperanto +Name[nds]=Esperanto +Name[ne]=इस्पेरान्तो +Name[nl]=Esperanto +Name[nn]=Esperanto +Name[oc]=Esperanto +Name[or]=ଏସ୍ପେରେଣ୍ଟୋ +Name[pa]=ਇਸਪੀਰਾਨਟੋ +Name[pl]=Esperanto +Name[ps]=اېسپېرېنټو +Name[pt]=Esperanto +Name[pt_BR]=Esperanto +Name[ro]=Esperanto +Name[ru]=Эсперанто +Name[sa]=एस्पेरान्तो +Name[se]=Esperantogiella +Name[si]=එස්පරන්ටෝ +Name[sk]=Esperanto +Name[sl]=Esperanto +Name[sq]=Esperanto +Name[sr]=есперанто +Name[sr@ijekavian]=есперанто +Name[sr@ijekavianlatin]=esperanto +Name[sr@latin]=esperanto +Name[sv]=Esperanto +Name[ta]=எஸ்பரான்டோ +Name[te]=ఎస్పరాన్టొ +Name[tg]=Эсперанто +Name[th]=ภาษาเอสเปอร์รันโต +Name[tok]=toki Epelanto +Name[tr]=Esperanto +Name[tt]=Эсперанто +Name[ug]=دۇنيا تىلى +Name[uk]=Есперанто +Name[uz]=Esperanto +Name[uz@cyrillic]=Эсперанто +Name[vi]=Tiếng Quốc tế +Name[wa]=Esperanto +Name[xh]=Esperanto +Name[zh_CN]=世界语 +Name[zh_HK]=世界語 +Name[zh_TW]=世界語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/es/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/es/kf6_entry.desktop new file mode 100644 index 0000000000..49e8f99d10 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/es/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Spanish +Name[af]=Spaanse +Name[ar]=الإسبانيّة +Name[as]=স্পেনিশ্ব +Name[ast]=Castellán +Name[az]=İspan dilində +Name[be]=Іспанская +Name[be@latin]=Ispanskaja +Name[bg]=Испански +Name[bn]=স্প্যানিশ +Name[bn_IN]=স্প্যানিশ +Name[br]=Spagnoleg +Name[bs]=španski +Name[ca]=Espanyol +Name[ca@valencia]=Espanyol +Name[cs]=Španělský +Name[csb]=Szpańsczi +Name[cy]=Sbaeneg +Name[da]=Spansk +Name[de]=Spanisch +Name[el]=Ισπανικά +Name[en_GB]=Spanish +Name[eo]=Hispana +Name[es]=Español +Name[et]=Hispaania +Name[eu]=Gaztelania +Name[fa]=اسپانیایی +Name[fi]=Espanja +Name[fr]=Espagnol +Name[fy]=Spaansk +Name[ga]=Spáinnis +Name[gd]=Spàinntis +Name[gl]=Castelán +Name[gu]=સ્પેનીશ +Name[he]=ספרדית +Name[hi]=स्पेनी +Name[hne]=स्पेनी +Name[hr]=Španjolski +Name[hsb]=Španisce +Name[hu]=Spanyol +Name[ia]=Espaniol +Name[id]=Spanyol +Name[is]=Spænska +Name[it]=Spagnolo +Name[ja]=スペイン語 +Name[ka]=ესპანური +Name[kk]=Испанша +Name[km]=អេស្ប៉ាញ +Name[kn]=ಸ್ಪ್ಯಾನಿಷ್ +Name[ko]=스페인어 +Name[ku]=Spanî +Name[lb]=Spuenesch +Name[lg]=Lusipanya +Name[lt]=Ispanų +Name[lv]=Spāņu +Name[mai]=स्पेनी +Name[mk]=Шпански +Name[ml]=സ്പാനിഷ് +Name[mr]=स्पॅनिश +Name[ms]=Sepanyol +Name[nb]=Spansk +Name[nds]=Spaansch +Name[ne]=स्पेनिस +Name[nl]=Spaans +Name[nn]=Spansk +Name[oc]=Castelhan +Name[or]=ସ୍ପେନିସ +Name[pa]=ਸਪੇਨੀ +Name[pl]=Hiszpański +Name[ps]=سپېنېش +Name[pt]=Espanhol +Name[pt_BR]=Espanhol +Name[ro]=Spaniolă +Name[ru]=Испанский +Name[sa]=स्पेनी भाषा +Name[se]=Spánskkagiella +Name[si]=ස්පාඤ්ඤ +Name[sk]=Španielčina +Name[sl]=Španščina +Name[sq]=Spanjollisht +Name[sr]=шпански +Name[sr@ijekavian]=шпански +Name[sr@ijekavianlatin]=španski +Name[sr@latin]=španski +Name[sv]=Spanska +Name[ta]=ஸ்பானியம் +Name[te]=స్పెనిష్ +Name[tg]=Испанӣ +Name[th]=ภาษาสเปน +Name[tok]=toki Epanja +Name[tr]=İspanyolca +Name[tt]=Испан +Name[ug]=ئىسپانچە +Name[uk]=Іспанська +Name[uz]=Ispancha +Name[uz@cyrillic]=Испанча +Name[vi]=Tiếng Tây Ban Nha +Name[wa]=Castiyan +Name[xh]=isipanishi +Name[zh_CN]=西班牙语 +Name[zh_HK]=西班牙語 +Name[zh_TW]=西班牙語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/et/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/et/kf6_entry.desktop new file mode 100644 index 0000000000..dc6b241d42 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/et/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Estonian +Name[af]=Estonianse +Name[ar]=الإستونيّة +Name[as]=ইস্টোনিয়ান +Name[ast]=Estoniu +Name[az]=Eston dilində +Name[be]=Эстонская +Name[be@latin]=Estonskaja +Name[bg]=Естонски +Name[bn]=এস্টোনীয় +Name[bn_IN]=এস্তোনিয়ান +Name[br]=Estoneg +Name[bs]=estonski +Name[ca]=Estonià +Name[ca@valencia]=Estonià +Name[cs]=Estonský +Name[csb]=Estońsczi +Name[cy]=Estoneg +Name[da]=Estisk +Name[de]=Estnisch +Name[el]=Εσθονικά +Name[en_GB]=Estonian +Name[eo]=Estona +Name[es]=Estonio +Name[et]=Eesti +Name[eu]=Estoniera +Name[fa]=استونی +Name[fi]=Viro +Name[fr]=Estonien +Name[fy]=Estsk +Name[ga]=Eastóinis +Name[gd]=Eastoinis +Name[gl]=Estoniano +Name[gu]=એસ્ટોનિયન +Name[he]=אסטונית +Name[hi]=एस्तोनियाई +Name[hne]=एस्तोनियाई +Name[hr]=Estonski +Name[hsb]=Estnisce +Name[hu]=Észt +Name[ia]=Estonian +Name[id]=Estonia +Name[is]=Eistneska +Name[it]=Estone +Name[ja]=エストニア語 +Name[ka]=ესტონური +Name[kk]=Эстонша +Name[km]=អេស្តូនី +Name[kn]=ಎಸ್ಚೋನಿಯನ್ +Name[ko]=에스토니아어 +Name[ku]=Estonî +Name[lb]=Eestnesch +Name[lg]=Lu-Estoniya +Name[lt]=Estų +Name[lv]=Igauņu +Name[mai]=एस्तोनियाइ +Name[mk]=Естонски +Name[ml]=എസ്ടോണിയന്‍ +Name[mr]=एस्तोनियाई +Name[ms]=Estonian +Name[nb]=Estisk +Name[nds]=Eestlannsch +Name[ne]=इस्टोनियाली +Name[nl]=Ests +Name[nn]=Estisk +Name[oc]=Estonian +Name[or]=ଏସ୍ଟୋନିୟନ +Name[pa]=ਇਸਟੋਨੀਆਈ +Name[pl]=Estoński +Name[ps]=اېسټونيايي +Name[pt]=Estónio +Name[pt_BR]=Estoniano +Name[ro]=Estoniană +Name[ru]=Эстонский +Name[sa]=एस्टोनियाई +Name[se]=Esttegiella +Name[si]=එස්තෝනියානු +Name[sk]=Estónčina +Name[sl]=Estonščina +Name[sq]=Estonisht +Name[sr]=естонски +Name[sr@ijekavian]=естонски +Name[sr@ijekavianlatin]=estonski +Name[sr@latin]=estonski +Name[sv]=Estniska +Name[ta]=எஸ்டோனிய +Name[te]=ఎస్టొనియన్ +Name[tg]=Эстонӣ +Name[th]=ภาษาเอสโทเนีย +Name[tok]=toki Esi +Name[tr]=Estonca +Name[tt]=Эстон +Name[ug]=ئېستونچە +Name[uk]=Естонська +Name[uz]=Estoncha +Name[uz@cyrillic]=Эстонча +Name[vi]=Tiếng Estonia +Name[wa]=Estonyin +Name[xh]=Estonian +Name[zh_CN]=爱沙尼亚语 +Name[zh_HK]=愛沙尼亞語 +Name[zh_TW]=愛沙尼亞語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/eu/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/eu/kf6_entry.desktop new file mode 100644 index 0000000000..0b298d3140 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/eu/kf6_entry.desktop @@ -0,0 +1,102 @@ +[KCM Locale] +Name=Basque +Name[af]=Basque +Name[ar]=الباسكيّة +Name[as]=বাস্ক +Name[ast]=Vascu +Name[az]=Basq dilində +Name[be]=Басконская +Name[be@latin]=Baskonskaja +Name[bg]=Баскийски +Name[bn]=বাস্ক +Name[bn_IN]=বাস্ক +Name[br]=Euskareg +Name[bs]=baskijski +Name[ca]=Basc +Name[ca@valencia]=Basc +Name[cs]=Baskický +Name[csb]=Baskijsczi +Name[cy]=Basceg +Name[da]=Baskisk +Name[de]=Baskisch +Name[el]=Βασκικά +Name[en_GB]=Basque +Name[eo]=Eŭska +Name[es]=Euskera +Name[et]=Baski +Name[eu]=Euskara +Name[fa]=باسکی +Name[fi]=Baski +Name[fr]=Basque +Name[fy]=Baskysk +Name[ga]=Bascais +Name[gd]=Basgais +Name[gl]=Éuscaro +Name[gu]=બાસ્ક +Name[he]=בסקית +Name[hi]=बास्क +Name[hne]=बास्क +Name[hr]=Baskijski +Name[hsb]=Baskisce +Name[hu]=Baszk +Name[ia]=Basco +Name[id]=Basque +Name[is]=Baskneska +Name[it]=Basco +Name[ja]=バスク語 +Name[ka]=ბასკური +Name[kk]=Баскша +Name[km]=បាស្ក +Name[kn]=ಬಾಸ್ಕ್ +Name[ko]=바스크어 +Name[ku]=Baskî +Name[lb]=Baskesch +Name[lg]=Lubasiki +Name[lt]=Baskų +Name[lv]=Basku +Name[mai]=बास्क +Name[mk]=Баскиски +Name[mr]=बास्क +Name[ms]=Basque +Name[nb]=Baskisk +Name[nds]=Basksch +Name[ne]=बास्क +Name[nl]=Baskisch +Name[nn]=Baskisk +Name[oc]=Basc +Name[or]=ବସ୍କ +Name[pa]=ਬਸਕਿਉ +Name[pl]=Baskijski +Name[ps]=بېسک +Name[pt]=Basco +Name[pt_BR]=Basco +Name[ro]=Bască +Name[ru]=Баскский +Name[sa]=बास्क् +Name[se]=Baskagiella +Name[si]=බැස්ක් +Name[sk]=Baskičtina +Name[sl]=Baskovščina +Name[sq]=Baske +Name[sr]=баскијски +Name[sr@ijekavian]=баскијски +Name[sr@ijekavianlatin]=baskijski +Name[sr@latin]=baskijski +Name[sv]=Baskiska +Name[ta]=பாஸ்க்கு +Name[te]=బాస్క్ +Name[tg]=Баскӣ +Name[th]=ภาษาบาสก์ +Name[tok]=toki Esuka +Name[tr]=Baskça +Name[tt]=Баск +Name[ug]=باسىكچە +Name[uk]=Баскська +Name[uz]=Baskcha +Name[uz@cyrillic]=Баскча +Name[vi]=Tiếng Basque +Name[wa]=Basse +Name[xh]=Basque +Name[zh_CN]=巴斯克语 +Name[zh_HK]=巴斯克語 +Name[zh_TW]=巴斯克語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/fa/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/fa/kf6_entry.desktop new file mode 100644 index 0000000000..1ab6d815f2 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/fa/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Farsi +Name[af]=Farsi +Name[ar]=الفارسيّة +Name[as]=ফাৰ্চী +Name[ast]=Persa +Name[az]=Fars dilində +Name[be]=Фарсі +Name[be@latin]=Farsi +Name[bg]=Фарси +Name[bn]=ফার্সী +Name[bn_IN]=ফার্সি +Name[br]=Farsieg +Name[bs]=farsi +Name[ca]=Farsi +Name[ca@valencia]=Farsi +Name[cs]=Farsi +Name[csb]=Farsi (persczi) +Name[cy]=Ffarsi +Name[da]=Farsi +Name[de]=Farsi +Name[el]=Φαρσί +Name[en_GB]=Farsi +Name[eo]=Persa +Name[es]=Farsi +Name[et]=Farsi +Name[eu]=Farsiera +Name[fa]=فارسی +Name[fi]=Farsi +Name[fr]=Farsi +Name[fy]=Farsysk +Name[ga]=Peirsis +Name[gd]=Farsaidh +Name[gl]=Persa +Name[gu]=ફારસી +Name[he]=פרסית +Name[hi]=फारसी +Name[hne]=फारसी +Name[hr]=Perzijski +Name[hsb]=Farsi +Name[hu]=Fárszi +Name[ia]=Farsi +Name[id]=Farsi +Name[is]=Farsi +Name[it]=Farsi (Persiano) +Name[ja]=ペルシア語 +Name[ka]=ფარსი (სპარსული) +Name[kk]=Фарси +Name[km]=ហ្វារស៊ី +Name[kn]=ಫಾರ್ಸೀ +Name[ko]=페르시아어 +Name[ku]=Farsî +Name[lb]=Farsi +Name[lg]=Luperusi +Name[lt]=Farsi +Name[lv]=Persiešu (Farsi) +Name[mai]=फारसी +Name[mk]=Фарси +Name[ml]=പാര്‍സി +Name[mr]=फारसी +Name[ms]=Farsi +Name[nb]=Persisk +Name[nds]=Persisch +Name[ne]=फारसी +Name[nl]=Farsi +Name[nn]=Persisk +Name[oc]=Farsi +Name[or]=ଫାରସି +Name[pa]=ਫਾਰਸੀ +Name[pl]=Perski +Name[ps]=پاړسي +Name[pt]=Farsi +Name[pt_BR]=Farsi +Name[ro]=Farsă +Name[ru]=Персидский +Name[sa]=फारसी +Name[se]=Farsigiella +Name[si]=පර්සියානු +Name[sk]=Perzština +Name[sl]=Perzijščina +Name[sq]=Persisht +Name[sr]=фарси +Name[sr@ijekavian]=фарси +Name[sr@ijekavianlatin]=farsi +Name[sr@latin]=farsi +Name[sv]=Persiska +Name[ta]=பாஃர்ஸி +Name[te]=ఫర్సి +Name[tg]=Форсӣ +Name[th]=ภาษาฟาร์ซี +Name[tok]=toki Pasi +Name[tr]=Farsça +Name[tt]=Фарсы +Name[ug]=پارسچە +Name[uk]=Фарсі +Name[uz]=Forscha +Name[uz@cyrillic]=Форсча +Name[vi]=Tiếng Ba Tư +Name[wa]=Farsi (Iranyin) +Name[xh]=Farsi +Name[zh_CN]=波斯语 +Name[zh_HK]=波斯語 +Name[zh_TW]=波斯語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/fi/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/fi/kf6_entry.desktop new file mode 100644 index 0000000000..dd11475b8e --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/fi/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Finnish +Name[af]=Feense +Name[ar]=الفنلنديّة +Name[as]=ফিনিশ্ব +Name[ast]=Finlandés +Name[az]=Fin dilində +Name[be]=Фінская +Name[be@latin]=Finskaja +Name[bg]=Фински +Name[bn]=ফিনিশ +Name[bn_IN]=ফিনিশ +Name[br]=Finneg +Name[bs]=finski +Name[ca]=Finès +Name[ca@valencia]=Finés +Name[cs]=Finský +Name[csb]=Finsczi +Name[cy]=Ffinneg +Name[da]=Finsk +Name[de]=Finnisch +Name[el]=Φινλανδικά +Name[en_GB]=Finnish +Name[eo]=Finna +Name[es]=Finés +Name[et]=Soome +Name[eu]=Finlandiera +Name[fa]=فنلاندی +Name[fi]=Suomi +Name[fr]=Finnois +Name[fy]=Finsk +Name[ga]=Fionlainnis +Name[gd]=Fionnlannais +Name[gl]=Finlandés +Name[gu]=ફિનિશ +Name[he]=פינית +Name[hi]=फिनिश +Name[hne]=फिनिस +Name[hr]=Finski +Name[hsb]=Finsce +Name[hu]=Finn +Name[ia]=Finnese +Name[id]=Finlandia +Name[is]=Finnska +Name[it]=Finlandese +Name[ja]=フィンランド語 +Name[ka]=ფინური +Name[kk]=Финнша +Name[km]=ហ្វាំងឡង់ +Name[kn]=ಫಿನ್ನಿಷ್ +Name[ko]=핀란드어 +Name[ku]=Finkî +Name[lb]=Finnesch +Name[lg]=Lufinilandi +Name[lt]=Suomių +Name[lv]=Somu +Name[mai]=फिनिश +Name[mk]=Фински +Name[ml]=ഫിന്നിഷ് +Name[mr]=फिनिश +Name[ms]=Finnish +Name[nb]=Finsk +Name[nds]=Finnsch +Name[ne]=फिनिश +Name[nl]=Fins +Name[nn]=Finsk +Name[oc]=Finés +Name[or]=ଫିନିସ +Name[pa]=ਫੈਨਿਸ਼ +Name[pl]=Fiński +Name[ps]=فېنېش +Name[pt]=Finlandês +Name[pt_BR]=Finlandês +Name[ro]=Finlandeză +Name[ru]=Финский +Name[sa]=फिनिश +Name[se]=Suomagiella +Name[si]=ෆින්ලන්ත +Name[sk]=Fínčina +Name[sl]=Finščina +Name[sq]=Finlandisht +Name[sr]=фински +Name[sr@ijekavian]=фински +Name[sr@ijekavianlatin]=finski +Name[sr@latin]=finski +Name[sv]=Finska +Name[ta]=பிஃன்னிசு +Name[te]=ఫిన్నిష్ +Name[tg]=Финӣ +Name[th]=ภาษาฟินแลนด์ +Name[tok]=toki Sumi +Name[tr]=Fince +Name[tt]=Фин +Name[ug]=فىنچە +Name[uk]=Фінська +Name[uz]=Fincha +Name[uz@cyrillic]=Финча +Name[vi]=Tiếng Phần Lan +Name[wa]=Finwès +Name[xh]=Finnish +Name[zh_CN]=芬兰语 +Name[zh_HK]=芬蘭語 +Name[zh_TW]=芬蘭語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/fr/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/fr/kf6_entry.desktop new file mode 100644 index 0000000000..1a103038ed --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/fr/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=French +Name[af]=Franse +Name[ar]=الفرنسيّة +Name[as]=ফৰাচী +Name[ast]=Francés +Name[az]=Fransız dilində +Name[be]=Французская +Name[be@latin]=Francuzskaja +Name[bg]=Френски +Name[bn]=ফরাসী +Name[bn_IN]=ফ্রেঞ্চ +Name[br]=Galleg +Name[bs]=francuski +Name[ca]=Francès +Name[ca@valencia]=Francés +Name[cs]=Francouzský +Name[csb]=Francësczi +Name[cy]=Ffrangeg +Name[da]=Fransk +Name[de]=Französisch +Name[el]=Γαλλικά +Name[en_GB]=French +Name[eo]=Franca +Name[es]=Francés +Name[et]=Prantsuse +Name[eu]=Frantses +Name[fa]=فرانسوی +Name[fi]=Ranska +Name[fr]=Français +Name[fy]=Frânsk +Name[ga]=Fraincis +Name[gd]=Fraingis +Name[gl]=Francés +Name[gu]=ફ્રેંચ +Name[he]=צרפתית +Name[hi]=फ्रांसीसी +Name[hne]=फ्रांसीसी +Name[hr]=Francuski +Name[hsb]=Francosce +Name[hu]=Francia +Name[ia]=Francese +Name[id]=Prancis +Name[is]=Franska +Name[it]=Francese +Name[ja]=フランス語 +Name[ka]=ფრანგული +Name[kk]=Французша +Name[km]=បារាំង +Name[kn]=ಫ್ರೆಂಚ್ +Name[ko]=프랑스어 +Name[ku]=Fransî +Name[lb]=Franséisch +Name[lg]=Lufalansa +Name[lt]=Prancūzų +Name[lv]=Franču +Name[mai]=फ्रेंच +Name[mk]=Француски +Name[ml]=ഫ്രഞ്ച് +Name[mr]=फ्रेंच +Name[ms]=Perancis +Name[nb]=Fransk +Name[nds]=Franzöösch +Name[ne]=फ्रान्सेली +Name[nl]=Frans +Name[nn]=Fransk +Name[oc]=Francés +Name[or]=ଫ୍ରେଞ୍ଚ +Name[pa]=ਫਰੈਂਚ +Name[pl]=Francuski +Name[ps]=فرانسوي +Name[pt]=Francês +Name[pt_BR]=Francês +Name[ro]=Franceză +Name[ru]=Французский +Name[sa]=फ्रेंचभाषा +Name[se]=Fránskkagiella +Name[si]=ප්‍රංශ +Name[sk]=Francúzština +Name[sl]=Francoščina +Name[sq]=Frengjisht +Name[sr]=француски +Name[sr@ijekavian]=француски +Name[sr@ijekavianlatin]=francuski +Name[sr@latin]=francuski +Name[sv]=Franska +Name[ta]=பிரென்ச் +Name[te]=ఫ్రెంచ్ +Name[tg]=Франсавӣ +Name[th]=ภาษาฝรั่งเศส +Name[tok]=toki Kanse +Name[tr]=Fransızca +Name[tt]=Француз +Name[ug]=فىرانسۇزچە +Name[uk]=Французька +Name[uz]=Fransuzcha +Name[uz@cyrillic]=Французча +Name[vi]=Tiếng Pháp +Name[wa]=Francès +Name[xh]=isifrentshi +Name[zh_CN]=法语 +Name[zh_HK]=法語 +Name[zh_TW]=法語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/fy/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/fy/kf6_entry.desktop new file mode 100644 index 0000000000..8638320cc7 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/fy/kf6_entry.desktop @@ -0,0 +1,100 @@ +[KCM Locale] +Name=Frisian +Name[af]=Frisian +Name[ar]=الفريسيّة +Name[as]=ফ্ৰিচিয়ান +Name[ast]=Frisón +Name[az]=Friz dilində +Name[be]=Фрызская +Name[be@latin]=Fryzskaja +Name[bg]=Фризийски +Name[bn]=ফ্রিসিয়ান +Name[bn_IN]=ফ্রিসিয়ান +Name[br]=Frisianeg +Name[bs]=frizijski +Name[ca]=Frisó +Name[ca@valencia]=Frisó +Name[cs]=Fríština +Name[csb]=Frizëjsczi +Name[cy]=Frisieg +Name[da]=Frisisk +Name[de]=Friesisch +Name[el]=Φρυγικά +Name[en_GB]=Frisian +Name[eo]=Frisa +Name[es]=Frisio +Name[et]=Friisi +Name[eu]=Frisiera +Name[fa]=فریسی +Name[fi]=Friisi +Name[fr]=Frisien +Name[fy]=Frysk +Name[ga]=Freaslainnis +Name[gd]=Frìsis +Name[gl]=Frisio +Name[gu]=ફ્રિસિયન +Name[he]=פריזית +Name[hi]=फ्रिसियन +Name[hne]=फ्रिसियन +Name[hr]=Frizijski +Name[hsb]=Frizisce +Name[hu]=Fríz +Name[ia]=Frisian +Name[id]=Frisia +Name[is]=Frísneska +Name[it]=Frisone +Name[ja]=フリジア語 +Name[ka]=ფრისული +Name[kk]=Фризше +Name[km]=ហ្វ្រីស៊ាន +Name[kn]=ಫ್ರಿಸಿಯನ್ +Name[ko]=프리지아어 +Name[ku]=Frîsî +Name[lb]=Frisesch +Name[lg]=Lufurisiya +Name[lt]=Fryzų +Name[lv]=Frīzu +Name[mai]=फ्रिसियन +Name[mk]=Фризиски +Name[ml]=ഫ്രിഷ്യന്‍ +Name[mr]=फ्रिसियन +Name[ms]=Frisian +Name[nb]=Frisisk +Name[nds]=Freesch +Name[ne]=फ्रिसियन +Name[nl]=Fries +Name[nn]=Frisisk +Name[oc]=Frisian +Name[or]=ଫ୍ରିସିୟାନ +Name[pa]=ਫਰੀਸੀਅਨ +Name[pl]=Fryzyjski +Name[ps]=فرېشين +Name[pt]=Frísio +Name[pt_BR]=Frisão +Name[ro]=Frisiană +Name[ru]=Фризский +Name[sa]=फ्रीजियन +Name[se]=Frisialagiella +Name[si]=ෆ්‍රිසියානු +Name[sk]=Frízština +Name[sl]=Frizijščina +Name[sr]=фризијски +Name[sr@ijekavian]=фризијски +Name[sr@ijekavianlatin]=frizijski +Name[sr@latin]=frizijski +Name[sv]=Frisiska +Name[ta]=பிரிசியன் +Name[te]=ఫ్రిసియన్ +Name[tg]=Фрисианӣ +Name[th]=ภาษาฟริสเซีย +Name[tr]=Frizce +Name[tt]=Фриз +Name[ug]=فىرىسىيانچە +Name[uk]=Фризька +Name[uz]=Frizcha +Name[uz@cyrillic]=Фризча +Name[vi]=Tiếng Frisia +Name[wa]=Frizon +Name[zh_CN]=弗里西亚语 +Name[zh_HK]=弗里西亞語 +Name[zh_TW]=弗里西亞語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ga/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ga/kf6_entry.desktop new file mode 100644 index 0000000000..0577c2e8d7 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ga/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Irish +Name[af]=Ierse +Name[ar]=الإيرلنديّة +Name[as]=আইৰিশ্ব +Name[ast]=Irlandés +Name[az]=İrland dilində +Name[be]=Ірландская +Name[be@latin]=Irlandskaja +Name[bg]=Ирландски +Name[bn]=আইরিশ +Name[bn_IN]=আইরিশ +Name[br]=Iwerzhoneg +Name[bs]=irski +Name[ca]=Irlandès +Name[ca@valencia]=Irlandés +Name[cs]=Irský +Name[csb]=Irlandzczi +Name[cy]=Gwyddeleg +Name[da]=Irsk +Name[de]=Irisch (Gälisch) +Name[el]=Ιρλανδικά +Name[en_GB]=Irish +Name[eo]=Irlanda +Name[es]=Irlandés +Name[et]=Iiri +Name[eu]=Irlandera +Name[fa]=ایرلندی +Name[fi]=Iiri +Name[fr]=Irlandais +Name[fy]=Iersk +Name[ga]=Gaeilge +Name[gd]=Gaeilge +Name[gl]=Irlandés +Name[gu]=આઈરીશ +Name[he]=אירית +Name[hi]=आइरिश +Name[hne]=आइरिस +Name[hr]=Irski +Name[hsb]=Irsce +Name[hu]=Ír +Name[ia]=Irlandese +Name[id]=Irlandia +Name[is]=Írska +Name[it]=Irlandese +Name[ja]=アイルランド語 +Name[ka]=ირლანდიური +Name[kk]=Ирландша +Name[km]=អៀរឡង់ +Name[kn]=ಐರಿಷ್ +Name[ko]=아일랜드어 +Name[ku]=Irlandayî +Name[lb]=Iresch +Name[lg]=Lugeyiliki olw'omu Ayalandi +Name[lt]=Airių +Name[lv]=Īru +Name[mai]=आइरिश +Name[mk]=Ирски +Name[ml]=ഐറിഷ് +Name[mr]=आइरिश +Name[ms]=Irish +Name[nb]=Irsk +Name[nds]=Irsch +Name[ne]=आइरिस +Name[nl]=Iers +Name[nn]=Irsk +Name[oc]=Irlandés +Name[or]=ଆଇରିସ +Name[pa]=ਆਈਰਸ਼ੀ +Name[pl]=Irlandzki +Name[ps]=اېرېش +Name[pt]=Irlandês +Name[pt_BR]=Irlandês +Name[ro]=Irlandeză +Name[ru]=Ирландский +Name[sa]=आयरिश +Name[se]=Irlánddagiella +Name[si]=අයර්ලන්ත +Name[sk]=írčina +Name[sl]=Irščina +Name[sq]=Irlandisht +Name[sr]=ирски +Name[sr@ijekavian]=ирски +Name[sr@ijekavianlatin]=irski +Name[sr@latin]=irski +Name[sv]=Iriska +Name[ta]=ஐரிஷ் +Name[te]=ఐరిష్ +Name[tg]=Ирландӣ +Name[th]=ภาษาไอริช +Name[tok]=toki Ele +Name[tr]=İrlandaca +Name[tt]=Ирланд +Name[ug]=ئېرلاندىيەچە +Name[uk]=Ірландська +Name[uz]=Irlandcha +Name[uz@cyrillic]=Ирландча +Name[vi]=Tiếng Ai-len +Name[wa]=Irlandès +Name[xh]=Irish +Name[zh_CN]=爱尔兰语 +Name[zh_HK]=愛爾蘭語 +Name[zh_TW]=愛爾蘭語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/gd/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/gd/kf6_entry.desktop new file mode 100644 index 0000000000..5d68d4153f --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/gd/kf6_entry.desktop @@ -0,0 +1,54 @@ +[KCM Locale] +Name=Scottish Gaelic +Name[ar]=الغيلية الاسكتلندية +Name[ast]=Gaélicu (Escocia) +Name[az]=Şotland Qall +Name[be]=Гаэльская (Шатландыя) +Name[be@latin]=Haeĺskaja (Šatlandyja) +Name[bg]=Шотландски келтски +Name[ca]=Gaèlic escocès +Name[ca@valencia]=Gaèlic escocés +Name[cs]=Skotská gaelština +Name[da]=Skotsk gælisk +Name[de]=Schottisch-Gälisch +Name[el]=Σκωτικά γαελικά +Name[en_GB]=Scottish Gaelic +Name[eo]=Skotgaela +Name[es]=Gaélico escocés +Name[eu]=Eskoziako gaelera +Name[fi]=Skotlanningaeli +Name[fr]=Gaélique écossais +Name[gl]=Gaélico escocés +Name[he]=גאלית סקוטית +Name[hi]=स्कॉटिश गैलिक +Name[hu]=Skót gael +Name[ia]=Gaelic Scotese +Name[id]=Gaelik Skotlandia +Name[is]=Skosk gelíska +Name[it]=Gaelico scozzese +Name[ka]=შოტლანდიური გალური +Name[ko]=스코틀랜드 게일어 +Name[lg]=Lugeyiliki olw'omu Sikotilandi +Name[lt]=Škotų gėlų +Name[lv]=Skotu gēlu +Name[nb]=Skotsk-gælisk +Name[nl]=Scottish Gaelic +Name[nn]=Skotsk-gælisk +Name[pa]=ਸਕਾਟਿਸ਼ ਗਾਈਲਿਕ +Name[pl]=Szkocki Galicyjski +Name[pt]=Gaélico Escocês +Name[pt_BR]=Escocês gaélico +Name[ro]=Galeză scoțiană +Name[ru]=Гэльский (Шотландия) +Name[sa]=स्कॉटिश गैलिक +Name[sk]=Škótska gaelčina +Name[sl]=Škotska gelščina +Name[sv]=Skotsk gäliska +Name[ta]=ஸ்காட்டிஷ் கேலிக் +Name[tok]=toki Kalike +Name[tr]=İskoç Gaelcesi +Name[ug]=شوتلاندىيە گالىكچە +Name[uk]=Шотландська гаельська +Name[vi]=Tiếng Gael Scot +Name[zh_CN]=苏格兰盖尔语 +Name[zh_TW]=蘇格蘭蓋爾語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/gl/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/gl/kf6_entry.desktop new file mode 100644 index 0000000000..9afa733478 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/gl/kf6_entry.desktop @@ -0,0 +1,101 @@ +[KCM Locale] +Name=Galician +Name[af]=Galasiese +Name[ar]=الجليقيّة +Name[as]=গেলিচিয়ান +Name[ast]=Gallegu +Name[az]=Qalisiya dilində +Name[be]=Галісійская +Name[be@latin]=Halisijskaja +Name[bg]=Галисийски +Name[bn]=গ্যালিকান +Name[bn_IN]=গেলিশিয়ান +Name[br]=Galiseg +Name[bs]=galicijski +Name[ca]=Gallec +Name[ca@valencia]=Gallec +Name[cs]=Galicijský +Name[csb]=Galicëjsczi +Name[cy]=Galiseg +Name[da]=Galicisk +Name[de]=Galizisch +Name[el]=Γαλικιανικά +Name[en_GB]=Galician +Name[eo]=Galega +Name[es]=Gallego +Name[et]=Galeegi +Name[eu]=Galiziera +Name[fa]=گالیسی +Name[fi]=Galicia +Name[fr]=Galicien +Name[fy]=Galysk +Name[ga]=Gailísis +Name[gd]=Gailìsis +Name[gl]=Galego +Name[gu]=ગેલિસીયન +Name[he]=גליסית +Name[hi]=गैलिसियाई +Name[hne]=गैलिसियाई +Name[hr]=Galicijski +Name[hsb]=Galicisce +Name[hu]=Galíciai +Name[ia]=Galleco +Name[id]=Galician +Name[is]=Galisíska +Name[it]=Gallego +Name[ja]=ガリシア語 +Name[ka]=გალური +Name[kk]=Галисияша +Name[km]=ហ្កាលីស៊ី +Name[kn]=ಗ್ಯಾಲೀಸಿಯನ್ +Name[ko]=갈라시아어 +Name[ku]=Galîkî +Name[lb]=Gallizesch +Name[lg]=Lugaliciya +Name[lt]=Galiciečių +Name[lv]=Galisiešu +Name[mai]=गेलिसियन +Name[mk]=Галициски +Name[ml]=ഗലീഷ്യന്‍ +Name[mr]=गैलिसियाई +Name[ms]=Galician +Name[nb]=Galisisk +Name[nds]=Galizsch +Name[ne]=ग्यालेसियन +Name[nl]=Galicisch +Name[nn]=Galisisk +Name[oc]=Galician +Name[or]=ଗାଲିସେନ +Name[pa]=ਗਲੀਸੀਆਈ +Name[pl]=Galicyjski +Name[ps]=ګېلېشين +Name[pt]=Galego +Name[pt_BR]=Galego +Name[ro]=Galică +Name[ru]=Галисийский +Name[sa]=गैलिशियन् +Name[se]=Gálisagiella +Name[si]=ගලිසියන් +Name[sk]=Galícijčina +Name[sl]=Galicijščina +Name[sr]=галицијски +Name[sr@ijekavian]=галицијски +Name[sr@ijekavianlatin]=galicijski +Name[sr@latin]=galicijski +Name[sv]=Galiziska +Name[ta]=கலீசியன் +Name[te]=గెలిసియన్ +Name[tg]=Галлӣ +Name[th]=ภาษาแกลิเชียน +Name[tr]=Galiçyaca +Name[tt]=Галисия +Name[ug]=گالىتسىيانچە +Name[uk]=Галісійська +Name[uz]=Galisiyacha +Name[uz@cyrillic]=Галисияча +Name[vi]=Tiếng Galicia +Name[wa]=Galicyin +Name[xh]=Galician +Name[zh_CN]=加利西亚语 +Name[zh_HK]=加里西亞語 +Name[zh_TW]=加利西亞語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/gu/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/gu/kf6_entry.desktop new file mode 100644 index 0000000000..184065e938 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/gu/kf6_entry.desktop @@ -0,0 +1,95 @@ +[KCM Locale] +Name=Gujarati +Name[ar]=الغوجاراتيّة +Name[as]=গুজৰাটী +Name[ast]=Guxaratín +Name[az]=Qucart dilində +Name[be]=Гуджараці +Name[be@latin]=Hudžaraci +Name[bg]=Гуджарати +Name[bn]=গুজরাতি +Name[bn_IN]=গুজরাটি +Name[bs]=gudžarati +Name[ca]=Gujarati +Name[ca@valencia]=Gujarati +Name[cs]=Gudžarátsky +Name[csb]=Gujarati +Name[da]=Gujarati +Name[de]=Gujarati +Name[el]=Gujarati +Name[en_GB]=Gujarati +Name[eo]=Guĝarata +Name[es]=Gujarati +Name[et]=Gudžarati +Name[eu]=Gujaratera +Name[fa]=گوجاراتی +Name[fi]=Gudžarati +Name[fr]=Goudjarati +Name[fy]=Gujarati +Name[ga]=Gúisearáitis +Name[gd]=Gujarati +Name[gl]=Gujarati +Name[gu]=ગુજરાતી +Name[he]=גוג׳ראטית +Name[hi]=गुजराती +Name[hne]=गुजराती +Name[hr]=Gudžaratski +Name[hsb]=Gujarati +Name[hu]=Gudzsarati +Name[ia]=Gujarati +Name[id]=Gujarati +Name[is]=Gujarati +Name[it]=Gujarati +Name[ja]=グジャラート語 +Name[ka]=გუჯარათი +Name[kk]=Гуджарати +Name[km]=ហ្កុយ៉ារាទី +Name[kn]=ಗುಜರಾತಿ +Name[ko]=구자라트어 +Name[ku]=Gucaratî +Name[lg]=Lugujarati +Name[lt]=Gudžarati +Name[lv]=Gudžaratu +Name[mai]=गुजराती +Name[mk]=Гуџарати +Name[ml]=ഗുജറാത്തി +Name[mr]=गुजराती +Name[ms]=Gujarati +Name[nb]=Gujarati +Name[nds]=Gudscharati +Name[nl]=Gujarati +Name[nn]=Gujarati +Name[oc]=Gujarati +Name[or]=ଗୁଜରାତି +Name[pa]=ਗੁਜਰਾਤੀ +Name[pl]=Gudźarati +Name[ps]=ګجراتي +Name[pt]=Gujarati +Name[pt_BR]=Guzerate +Name[ro]=Gujarati +Name[ru]=Гуджарати +Name[sa]=गुजराती +Name[se]=Gujaratigiella +Name[si]=ගුජරාති +Name[sk]=Gudžarátčina +Name[sl]=Gudžaratščina +Name[sq]=Guxharati +Name[sr]=гуџарати +Name[sr@ijekavian]=гуџарати +Name[sr@ijekavianlatin]=gudžarati +Name[sr@latin]=gudžarati +Name[sv]=Gujarati +Name[ta]=குஜராத்தி +Name[te]=గుజరాతి +Name[tg]=Гуҷаратӣ +Name[th]=ภาษาคุชราตี +Name[tr]=Güceratça +Name[tt]=Гөҗәрәти +Name[ug]=گۇجاراتچە +Name[uk]=Гуджараті +Name[uz]=Gujarati +Name[uz@cyrillic]=Гужарати +Name[vi]=Tiếng Gujarat +Name[wa]=Goudjarati +Name[zh_CN]=古吉拉特语 +Name[zh_TW]=古吉拉特語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ha/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ha/kf6_entry.desktop new file mode 100644 index 0000000000..c95078823b --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ha/kf6_entry.desktop @@ -0,0 +1,96 @@ +[KCM Locale] +Name=Hausa +Name[ar]=الهوسا +Name[as]=হাউছা +Name[az]=Hausa dilində +Name[be]=Хаўса +Name[be@latin]=Chaŭsa +Name[bg]=Хауса +Name[bn]=হাউসা +Name[bn_IN]=হাওসা +Name[br]=Hausa +Name[bs]=hausa +Name[ca]=Haussa +Name[ca@valencia]=Haussa +Name[cs]=Hausa +Name[csb]=Hausa +Name[da]=Hausa +Name[de]=Hausa +Name[el]=Χαούζα +Name[en_GB]=Hausa +Name[eo]=Haŭsa +Name[es]=Hausa +Name[et]=Hausa +Name[eu]=Hausa +Name[fa]=هوسا +Name[fi]=Hausa +Name[fr]=Haoussa +Name[fy]=Hausa +Name[ga]=Hásais +Name[gd]=Hausa +Name[gl]=Hausa +Name[gu]=હુસા +Name[he]=האוסה +Name[hi]=हौसा +Name[hne]=हौसा +Name[hr]=Hausa +Name[hsb]=Hausa +Name[hu]=Hausza +Name[ia]=Hausa +Name[id]=Hausa +Name[is]=Hausa +Name[it]=Hausa +Name[ja]=ハウサ語 +Name[ka]=ჰაუსა +Name[kk]=Хаузаша +Name[km]=ហូសា +Name[kn]=ಹೌಸ +Name[ko]=하우사어 +Name[ku]=Hawsa +Name[lg]=Luhawuza +Name[lt]=Hausa +Name[lv]=Hausa +Name[mai]=हौसा +Name[mk]=Хауса +Name[ml]=ഹൌസാ +Name[mr]=हौसा +Name[ms]=Hausa +Name[nb]=Hausa +Name[nds]=Haussa +Name[ne]=हउसा +Name[nl]=Hausa +Name[nn]=Hausa +Name[oc]=Hausa +Name[or]=ହଉସା +Name[pa]=ਹਾਉਸਾ +Name[pl]=Hausa +Name[ps]=هاوسا +Name[pt]=Hausa +Name[pt_BR]=Haussá +Name[ro]=Hausa +Name[ru]=Хауса +Name[sa]=हौसा +Name[se]=Hausagiella +Name[si]=හවුස +Name[sk]=Hauština +Name[sl]=Havščina +Name[sr]=хауса +Name[sr@ijekavian]=хауса +Name[sr@ijekavianlatin]=hausa +Name[sr@latin]=hausa +Name[sv]=Hausa +Name[ta]=ஹவுஸா +Name[te]=హౌసా +Name[tg]=Хауса +Name[th]=ภาษาเฮาซา +Name[tok]=toki Awasa +Name[tr]=Hausaca +Name[tt]=Хауз +Name[ug]=خاۋساچە +Name[uk]=Хауса +Name[uz]=Huasa +Name[uz@cyrillic]=Ҳуаса +Name[vi]=Tiếng Hausa +Name[wa]=Hawsa +Name[zh_CN]=豪萨语 +Name[zh_TW]=豪薩語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/he/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/he/kf6_entry.desktop new file mode 100644 index 0000000000..656d2c6d88 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/he/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Hebrew +Name[af]=Hibreüse +Name[ar]=العبريّة +Name[as]=হিব্ৰিউ +Name[ast]=Hebréu +Name[az]=İvrit dilində +Name[be]=Іўрыт +Name[be@latin]=Iŭryt +Name[bg]=Иврит +Name[bn]=হীব্রু +Name[bn_IN]=হিব্রু +Name[br]=Hebreeg +Name[bs]=hebrejski +Name[ca]=Hebreu +Name[ca@valencia]=Hebreu +Name[cs]=Hebrejský +Name[csb]=Hebrajsczi +Name[cy]=Hebraeg +Name[da]=Hebraisk +Name[de]=Hebräisch +Name[el]=Εβραϊκά +Name[en_GB]=Hebrew +Name[eo]=Hebrea +Name[es]=Hebreo +Name[et]=Heebrea +Name[eu]=Hebreera +Name[fa]=عبری +Name[fi]=Heprea +Name[fr]=Hébreu +Name[fy]=Hebrieuwsk +Name[ga]=Eabhrais +Name[gd]=Eabhra +Name[gl]=Hebreo +Name[gu]=હિબ્રુ +Name[he]=עברית +Name[hi]=हिब्रू +Name[hne]=हिब्रू +Name[hr]=Hebrejski +Name[hsb]=Hebrejsce +Name[hu]=Héber +Name[ia]=Hebreo +Name[id]=Ibrani +Name[is]=Hebreska +Name[it]=Ebraico +Name[ja]=ヘブライ語 +Name[ka]=ივრითი +Name[kk]=Иврит +Name[km]=ហេប្រ៊ូ +Name[kn]=ಹೀಬ್ರೂ +Name[ko]=히브리어 +Name[ku]=Îbranî +Name[lb]=Hebräesch +Name[lg]=Lu-heburu/Luyudaaya +Name[lt]=Hebrajų +Name[lv]=Ivrits +Name[mai]=हिब्रू +Name[mk]=Еврејски +Name[ml]=ഹീബ്രു +Name[mr]=हिब्रू +Name[ms]=Hebrew +Name[nb]=Hebraisk +Name[nds]=Hebrääsch +Name[ne]=हिब्रु +Name[nl]=Hebreeuws +Name[nn]=Hebraisk +Name[oc]=Ebrèu +Name[or]=ହର୍ବ୍ୟୁ +Name[pa]=ਹੈਬਰਿਊ +Name[pl]=Hebrajski +Name[ps]=هېبرو +Name[pt]=Hebreu +Name[pt_BR]=Hebraico +Name[ro]=Ebraică +Name[ru]=Иврит +Name[sa]=हिब्रू +Name[se]=Ebreagiella +Name[si]=හීබෲ +Name[sk]=Hebrejčina +Name[sl]=Hebrejščina +Name[sq]=Ebraisht +Name[sr]=хебрејски +Name[sr@ijekavian]=хебрејски +Name[sr@ijekavianlatin]=hebrejski +Name[sr@latin]=hebrejski +Name[sv]=Hebreiska +Name[ta]=எபிரேயம் +Name[te]=హీబ్రూ +Name[tg]=Яҳудӣ +Name[th]=ภาษาฮิบรู +Name[tok]=toki Iwisi +Name[tr]=İbranice +Name[tt]=Иврит +Name[ug]=ئىبرانىچە +Name[uk]=Іврит +Name[uz]=Yahudiycha +Name[uz@cyrillic]=Яҳудийча +Name[vi]=Tiếng Do Thái +Name[wa]=Ebreu +Name[xh]=Hebrew +Name[zh_CN]=希伯来语 +Name[zh_HK]=希伯來語 +Name[zh_TW]=希伯來語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/hi/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/hi/kf6_entry.desktop new file mode 100644 index 0000000000..ba3757138b --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/hi/kf6_entry.desktop @@ -0,0 +1,102 @@ +[KCM Locale] +Name=Hindi +Name[af]=Hindi +Name[ar]=الهنديّة +Name[as]=হিন্দী +Name[ast]=Hindi +Name[az]=Hind dilində +Name[be]=Хіндзі +Name[be@latin]=Chindzi +Name[bg]=Хинди +Name[bn]=হিন্দী +Name[bn_IN]=হিন্দি +Name[br]=Hindi +Name[bs]=hindu +Name[ca]=Hindi +Name[ca@valencia]=Hindi +Name[cs]=Hindi +Name[csb]=Hindi +Name[cy]=Hindi +Name[da]=Hindi +Name[de]=Hindi +Name[el]=Χίντι +Name[en_GB]=Hindi +Name[eo]=Hinda +Name[es]=Hindi +Name[et]=Hindi +Name[eu]=Hindi +Name[fa]=هندی +Name[fi]=Hindi +Name[fr]=Hindi +Name[fy]=Hindy +Name[ga]=Hiondúis +Name[gd]=Hindis +Name[gl]=Hindi +Name[gu]=હિન્દી +Name[he]=הינדית +Name[hi]=हिन्दी +Name[hne]=हिन्दी +Name[hr]=Hinduski +Name[hsb]=Hindi +Name[hu]=Hindi +Name[ia]=Hindi +Name[id]=Hindi +Name[is]=Hindí +Name[it]=Hindi +Name[ja]=ヒンディー語 +Name[ka]=ჰინდი +Name[kk]=Хинди +Name[km]=ហិណ្ឌូ +Name[kn]=ಹಿಂದಿ +Name[ko]=힌디어 +Name[ku]=Hîndî +Name[lb]=Hindi +Name[lg]=Luhindu +Name[lt]=Hindi +Name[lv]=Hindi +Name[mai]=हिन्दी +Name[mk]=Индијски +Name[ml]=ഹിന്ദി +Name[mr]=हिंदी +Name[ms]=Hindi +Name[nb]=Hindi +Name[nds]=Hindi +Name[ne]=हिन्दी +Name[nl]=Hindi +Name[nn]=Hindi +Name[oc]=Indi +Name[or]=ହିନ୍ଦି +Name[pa]=ਹਿੰਦੀ +Name[pl]=Hindi +Name[ps]=هندي +Name[pt]=Hindu +Name[pt_BR]=Hindi +Name[ro]=Hindi +Name[ru]=Хинди +Name[sa]=न +Name[se]=Hindigiella +Name[si]=හින්දි +Name[sk]=Hindčina +Name[sl]=Hindujščina +Name[sr]=хинду +Name[sr@ijekavian]=хинду +Name[sr@ijekavianlatin]=hindu +Name[sr@latin]=hindu +Name[sv]=Hindi +Name[ta]=ஹிந்தி +Name[te]=హింది +Name[tg]=Ҳиндӣ +Name[th]=ภาษาฮินดู +Name[tok]=toki Insi +Name[tr]=Hintçe +Name[tt]=Һинд +Name[ug]=ھىندىچە +Name[uk]=Хінді +Name[uz]=Hindcha +Name[uz@cyrillic]=Ҳиндча +Name[vi]=Tiếng Hindi +Name[wa]=Hindi +Name[zh_CN]=印地语 +Name[zh_HK]=印度語 +Name[zh_TW]=北印度語 + diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/hne/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/hne/kf6_entry.desktop new file mode 100644 index 0000000000..58c7a09b23 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/hne/kf6_entry.desktop @@ -0,0 +1,79 @@ +[KCM Locale] +Name=Chhattisgarhi +Name[ar]=التّشهاتيسجاريّة +Name[az]=Çattisqarhi dilində +Name[be]=Чхаттысгархы +Name[be@latin]=Čchattysharchy +Name[bg]=Чхатисгархи +Name[bs]=čatisgarhi +Name[ca]=Chattisgarbi +Name[ca@valencia]=Chattisgarbi +Name[cs]=Čhattísgarhy +Name[csb]=Chhattisgarhi +Name[da]=Chhattisgarhi +Name[de]=Chhattisgarhi +Name[el]=Χατισγκαρχί +Name[en_GB]=Chhattisgarhi +Name[eo]=Ĉhatisgara +Name[es]=Chhattisgarhi +Name[et]=Chhattisgarhi +Name[eu]=Chhattisgarhi +Name[fa]=چهاتیسگارهی +Name[fi]=Chhattisgarhi +Name[fr]=Chhattisgarhi +Name[fy]=Chhattisgarhi +Name[ga]=Chaitisgharhís +Name[gd]=Chhattisgarhi +Name[gl]=Chhattisgarhi +Name[gu]=છત્તિસગઢી +Name[he]=צ׳האטיסגארי +Name[hi]=चत्तिसगढ़ी +Name[hr]=Chhattisgarhi +Name[hu]=Cshattíszgarhi +Name[ia]=Chhattisgarhi +Name[id]=Chhattisgarhi +Name[is]=Chhattisgarhi +Name[it]=Chhattisgarhi +Name[ja]=チャッティースガリー語 +Name[ka]=ჩატისგარჰი +Name[kk]=Чхаттисгархише +Name[km]=ឆាយទីសហ្គាស៊ី +Name[kn]=ಛತ್ತೀಸ್ಗರ್ಹಿ +Name[ko]=차티스가르어 +Name[ku]=Şattisgarî +Name[lg]=Lucatisigari +Name[lt]=Chatisgari +Name[lv]=Čatisgari +Name[ml]=ചത്തീസ്ഗരി +Name[mr]=छत्तिसगढी +Name[ms]=Chhattisgarhi +Name[nb]=Chhatisgarhi +Name[nds]=Chhattisgarhi +Name[nl]=Chhattisgarhi +Name[nn]=Tsjhattisgarhi +Name[pa]=ਛੱਤੀਸਗੜ੍ਹੀ +Name[pl]=Chhattisgarhi +Name[pt]=Chhattisgarhi +Name[pt_BR]=Chhattisgarhi +Name[ro]=Chhattisgarhi +Name[ru]=Чхаттисгархи +Name[sa]=छत्तीसगढ़ी +Name[se]=Čattisgarhigiella +Name[sk]=Čatísgarh +Name[sl]=Čatisgarščina +Name[sr]=чатисгархи +Name[sr@ijekavian]=чатисгархи +Name[sr@ijekavianlatin]=čatisgarhi +Name[sr@latin]=čatisgarhi +Name[sv]=Chhattisgarhi +Name[ta]=சத்தீஸ்கரி +Name[tg]=Чхатисгарӣ +Name[th]=ภาษาฉัตติสครห์ +Name[tr]=Çatisgarice +Name[tt]=Чхаттисгарх +Name[ug]=چاتتىسگارھىچە +Name[uk]=Чхатісгарі +Name[vi]=Tiếng Chhattisgarh +Name[wa]=Chhattisgarhi +Name[zh_CN]=恰蒂斯加尔语 +Name[zh_TW]=恰蒂斯加爾語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/hr/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/hr/kf6_entry.desktop new file mode 100644 index 0000000000..26d3e1ddd5 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/hr/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Croatian +Name[af]=Kroatiese +Name[ar]=الكرواتيّة +Name[as]=ক্ৰোয়েচিয়ান +Name[ast]=Croata +Name[az]=Horvat dilində +Name[be]=Харвацкая +Name[be@latin]=Charvackaja +Name[bg]=Хърватски +Name[bn]=ক্রোয়েশীয় +Name[bn_IN]=ক্রোয়েশিয়ান +Name[br]=Kroateg +Name[bs]=hrvatski +Name[ca]=Croat +Name[ca@valencia]=Croat +Name[cs]=Chorvatský +Name[csb]=Chòrwacczi +Name[cy]=Croateg +Name[da]=Kroatisk +Name[de]=Kroatisch +Name[el]=Κροατικά +Name[en_GB]=Croatian +Name[eo]=Kroata +Name[es]=Croata +Name[et]=Horvaadi +Name[eu]=Kroaziera +Name[fa]=کرواسیایی +Name[fi]=Kroatia +Name[fr]=Croate +Name[fy]=Kroatysk +Name[ga]=Cróitis +Name[gd]=Cròthaisis +Name[gl]=Croata +Name[gu]=ક્રોએશિયન +Name[he]=קרואטית +Name[hi]=क्रोएशियाई +Name[hne]=क्रोएसियाई +Name[hr]=Hrvatski +Name[hsb]=Chorwatsce +Name[hu]=Horvát +Name[ia]=Croato +Name[id]=Kroasia +Name[is]=Króatíska +Name[it]=Croato +Name[ja]=クロアチア語 +Name[ka]=ხორვატული +Name[kk]=Хорватша +Name[km]=ក្រូអាត +Name[kn]=ಕ್ರೊವೇಶಿಯನ್ +Name[ko]=크로아티아어 +Name[ku]=Kroatî +Name[lb]=Kroatesch +Name[lg]=Lukurowatiya +Name[lt]=Kroatų +Name[lv]=Horvātu +Name[mai]=क्रोएशियाइ +Name[mk]=Хрватски +Name[ml]=ക്രോയേഷ്യന്‍ +Name[mr]=क्रोएशीयन +Name[ms]=Croatia +Name[nb]=Kroatisk +Name[nds]=Kroaatsch +Name[ne]=क्रोयसियाली +Name[nl]=Kroatisch +Name[nn]=Kroatisk +Name[oc]=Croat +Name[or]=କ୍ରୋଏସିୟନ +Name[pa]=ਕਰੋਆਟੀਆਈ +Name[pl]=Chorwacki +Name[ps]=کروټيايي +Name[pt]=Croata +Name[pt_BR]=Croata +Name[ro]=Croată +Name[ru]=Хорватский +Name[sa]=क्रोएशियाई +Name[se]=Kroatiagiella +Name[si]=ක්‍රොඒෂියානු +Name[sk]=Chorvátčina +Name[sl]=Hrvaščina +Name[sq]=Kroatisht +Name[sr]=хрватски +Name[sr@ijekavian]=хрватски +Name[sr@ijekavianlatin]=hrvatski +Name[sr@latin]=hrvatski +Name[sv]=Kroatiska +Name[ta]=குரொயேஷியன் +Name[te]=క్రొయెషియన్ +Name[tg]=Хорватӣ +Name[th]=ภาษาโครเอเชีย +Name[tok]=toki Lowasi +Name[tr]=Hırvatça +Name[tt]=Хорват +Name[ug]=كىرودىيە تىلى +Name[uk]=Хорватська +Name[uz]=Xorvatcha +Name[uz@cyrillic]=Хорватча +Name[vi]=Tiếng Croatia +Name[wa]=Crowåte +Name[xh]=Croatian +Name[zh_CN]=克罗地亚语 +Name[zh_HK]=克羅地亞語 +Name[zh_TW]=克羅地亞語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/hsb/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/hsb/kf6_entry.desktop new file mode 100644 index 0000000000..0eb07dc1a4 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/hsb/kf6_entry.desktop @@ -0,0 +1,98 @@ +[KCM Locale] +Name=Upper Sorbian +Name[af]=Hoër Serbies +Name[ar]=الصّربيّة العلويّة +Name[as]=আপাৰ ছ'ৰ্বিয়ান +Name[az]=Yuxarı Sorb dilində +Name[be]=Верхнялужыцкая +Name[be@latin]=Vierchnialužyckaja +Name[bg]=Горносорбийски +Name[bn]=আপার সরবিয়ান +Name[bn_IN]=আপার সোর্বিয়ান +Name[br]=Sorab uhel +Name[bs]=gornjolužičkosrpski +Name[ca]=Alt sòrab +Name[ca@valencia]=Alt sòrab +Name[cs]=Hornolužický +Name[csb]=Górnoserbsczi +Name[cy]=Sorbieg Uchaf +Name[da]=Øvre Sorbisk +Name[de]=Obersorbisch +Name[el]=Άνω Σορβικά +Name[en_GB]=Upper Sorbian +Name[eo]=Alta soraba +Name[es]=Alto sorabo +Name[et]=Ülemsorbi +Name[eu]=Goi sorabiera +Name[fa]=صربی علیا +Name[fi]=Yläsorbi +Name[fr]=Haut Sorabe +Name[fy]=Heech Sorbysk +Name[ga]=Sorbais Uachtarach +Name[gd]=Sòrbais Uachdarach +Name[gl]=Alto sorabo +Name[gu]=ઉચ્ચ સોર્બિયન +Name[he]=סורבית עילית +Name[hi]=ऊपरी सॉर्बियाई +Name[hne]=ऊपरी सार्बियाई +Name[hr]=Gornjosrpski +Name[hsb]=Hornjoserbsce +Name[hu]=Szorb +Name[ia]=Alto Sorbiano +Name[id]=Sorbian Atas +Name[is]=Efri sorbíska +Name[it]=Alto sorabo +Name[ja]=上ソルブ語 +Name[ka]=ზედა სორბიული +Name[kk]=Жоғарғы сорбше +Name[km]=សូបៀន លើ +Name[kn]=ಮೇಲಿನ ಸೋರ್ಬಿಯನ್ +Name[ko]=고지 소르브어 +Name[ku]=Sorbiya Jorîn +Name[lb]=Uewersorbesch +Name[lg]=Luworonyoserebicina +Name[lt]=Upper Sorbian +Name[lv]=Augšsorbu +Name[mai]=ऊपरी सॉर्बियाइ +Name[mk]=Горен Сорбски +Name[ml]=അപ്പര്‍ സോര്‍ബിയന്‍ +Name[mr]=वरच्या दिशेने +Name[ms]=Upper Sorbian +Name[nb]=Oversorbisk +Name[nds]=Böversorbsch +Name[ne]=माथिल्लो सर्बियाली +Name[nl]=Oppersorbisch +Name[nn]=Høgsorbisk +Name[or]=ଉପର ସର୍ବିୟନ +Name[pa]=ਅੱਪਰ ਸੋਰਬੀਆਈ +Name[pl]=Górnołużycki +Name[ps]=بره سربي +Name[pt]=Sérvio de Cima +Name[pt_BR]=Alto Sorábio +Name[ro]=Sârbă de sus +Name[ru]=Верхнелужицкий +Name[sa]=उच्च सोरबियन +Name[se]=Badjesorbialaš +Name[si]=ඉහළ සෝබියානු +Name[sk]=Hornolužická srbčina +Name[sl]=Gornjelužiška srbščina +Name[sr]=горњолужичкосрпски +Name[sr@ijekavian]=горњолужичкосрпски +Name[sr@ijekavianlatin]=gornjolužičkosrpski +Name[sr@latin]=gornjolužičkosrpski +Name[sv]=Högsorbiska +Name[ta]=அப்பர் செர்பியன் +Name[te]=అప్పర్ సొర్బియన్ +Name[tg]=Сербиявии Болоӣ +Name[th]=ภาษาซอร์เบียตอนบน +Name[tr]=Yukarı Sorbça +Name[tt]=Сорбча (Өске) +Name[ug]=يۇقىرىقى سوربىيانچە +Name[uk]=Верхньолужицька +Name[uz]=Yuqori Serbcha +Name[uz@cyrillic]=Юқори Сербча +Name[vi]=Tiếng Thượng Sorb +Name[wa]=Hôt sorbyin +Name[zh_CN]=上索布语 +Name[zh_HK]=上文德語 +Name[zh_TW]=上索布語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/hu/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/hu/kf6_entry.desktop new file mode 100644 index 0000000000..d84274353c --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/hu/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Hungarian +Name[af]=Hongaarse +Name[ar]=المجريّة +Name[as]=হাঙ্গেৰিয়ান +Name[ast]=Húngaru +Name[az]=Macar dilində +Name[be]=Венгерская +Name[be@latin]=Vienhierskaja +Name[bg]=Унгарски +Name[bn]=হাঙ্গারীয় +Name[bn_IN]=হাঙ্গেরিয়ান +Name[br]=Hungareg +Name[bs]=mađarski +Name[ca]=Hongarès +Name[ca@valencia]=Hongarés +Name[cs]=Maďarský +Name[csb]=Madżarsczi +Name[cy]=Hwngareg +Name[da]=Ungarsk +Name[de]=Ungarisch +Name[el]=Ουγγρικά +Name[en_GB]=Hungarian +Name[eo]=Hungara +Name[es]=Húngaro +Name[et]=Ungari +Name[eu]=Hungariera +Name[fa]=مجاری +Name[fi]=Unkari +Name[fr]=Hongrois +Name[fy]=Hongaarsk +Name[ga]=Ungáiris +Name[gd]=Ungairis +Name[gl]=Húngaro +Name[gu]=હંગેરિયન +Name[he]=הונגרית +Name[hi]=हंगेरियाई +Name[hne]=हंगेरियाई +Name[hr]=Mađarski +Name[hsb]=Madźarsce +Name[hu]=Magyar +Name[ia]=Hungaro +Name[id]=Hungaria +Name[is]=Ungverska +Name[it]=Ungherese +Name[ja]=ハンガリー語 +Name[ka]=უნგრული +Name[kk]=Мажарша +Name[km]=ហុងគ្រី +Name[kn]=ಹಂಗೇರಿಯನ್ +Name[ko]=헝가리어 +Name[ku]=Macarî +Name[lb]=Ungaresch +Name[lg]=Luhungariya +Name[lt]=Vengrų +Name[lv]=Ungāru +Name[mai]=हंगेरियाई +Name[mk]=Унгарски +Name[ml]=ഹംഗേറിയന്‍ +Name[mr]=हंगेरियाई +Name[ms]=Hungary +Name[nb]=Ungarsk +Name[nds]=Ungaarsch +Name[ne]=हङ्गेरियाली +Name[nl]=Hongaars +Name[nn]=Ungarsk +Name[oc]=Ongrés +Name[or]=ହଙ୍ଗାରିୟନ +Name[pa]=ਹੰਗਰੀਆਈ +Name[pl]=Węgierski +Name[ps]=هنګري +Name[pt]=Húngaro +Name[pt_BR]=Húngaro +Name[ro]=Maghiară +Name[ru]=Венгерский +Name[sa]=हङ्गेरी +Name[se]=Ungárgiella +Name[si]=හංගේරියානු +Name[sk]=Maďarčina +Name[sl]=Madžarščina +Name[sq]=Hungarisht +Name[sr]=мађарски +Name[sr@ijekavian]=мађарски +Name[sr@ijekavianlatin]=mađarski +Name[sr@latin]=mađarski +Name[sv]=Ungerska +Name[ta]=ஹங்கேரியன் +Name[te]=హంగెరియన్ +Name[tg]=Венгерӣ +Name[th]=ภาษาฮังการี +Name[tok]=toki Mosijo +Name[tr]=Macarca +Name[tt]=Венгер +Name[ug]=ھونگىرچە +Name[uk]=Угорська +Name[uz]=Vengrcha +Name[uz@cyrillic]=Венгрча +Name[vi]=Tiếng Hung-ga-ri +Name[wa]=Hongrwès +Name[xh]=Hungarian +Name[zh_CN]=匈牙利语 +Name[zh_HK]=匈牙利語 +Name[zh_TW]=匈牙利語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/hy/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/hy/kf6_entry.desktop new file mode 100644 index 0000000000..669ae04ee1 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/hy/kf6_entry.desktop @@ -0,0 +1,96 @@ +[KCM Locale] +Name=Armenian +Name[ar]=الأرمينيّة +Name[as]=আৰ্মেনিয়ান +Name[ast]=Armeniu +Name[az]=Erməni dilində +Name[be]=Армянская +Name[be@latin]=Armianskaja +Name[bg]=Арменски +Name[bn]=আর্মেনীয় +Name[bn_IN]=আর্মেনিয়ান +Name[bs]=jermenski +Name[ca]=Armeni +Name[ca@valencia]=Armeni +Name[cs]=Arménský +Name[csb]=Armensczi +Name[da]=Armensk +Name[de]=Armenisch +Name[el]=Αρμενικά +Name[en_GB]=Armenian +Name[eo]=Armena +Name[es]=Armenio +Name[et]=Armeenia +Name[eu]=Armeniera +Name[fa]=ارمنی +Name[fi]=Armenia +Name[fr]=Arménien +Name[fy]=Armeensk +Name[ga]=Airméinis +Name[gd]=Airmeinis +Name[gl]=Armenio +Name[gu]=અર્મેનિયન +Name[he]=ארמנית +Name[hi]=अर्मिनियाई +Name[hne]=अर्मिनियाई +Name[hr]=Armenski +Name[hsb]=Armensce +Name[hu]=Örmény +Name[ia]=Armenio +Name[id]=Armenia +Name[is]=Armenska +Name[it]=Armeno +Name[ja]=アルメニア語 +Name[ka]=სომხური +Name[kk]=Армянша +Name[km]=អាមេនី +Name[kn]=ಆರ್ಮೀನಿಯನ್ +Name[ko]=아르메니아어 +Name[ku]=Ermenî +Name[lg]=Lu-Arameniya +Name[lt]=Armėnų +Name[lv]=Armēņu +Name[mai]=आर्मेनियाइ +Name[mk]=Ерменски +Name[ml]=റൊമേനിയന്‍ +Name[mr]=आर्मेनिअन +Name[ms]=Armenia +Name[nb]=Armensk +Name[nds]=Armeensch +Name[nl]=Armeens +Name[nn]=Armensk +Name[oc]=Armenian +Name[or]=ଆରମେନିୟନ +Name[pa]=ਅਰਮੀਨੀਆਈ +Name[pl]=Armeński +Name[ps]=ارمنيايي +Name[pt]=Arménio +Name[pt_BR]=Armênio +Name[ro]=Armeană +Name[ru]=Армянский +Name[sa]=आर्मेनियाई +Name[se]=Armeniagiella +Name[si]=ආමේනියානු +Name[sk]=Arménčina +Name[sl]=Armenščina +Name[sq]=Armenisht +Name[sr]=јерменски +Name[sr@ijekavian]=јерменски +Name[sr@ijekavianlatin]=jermenski +Name[sr@latin]=jermenski +Name[sv]=Armeniska +Name[ta]=அர்மேனியம் +Name[te]=అర్మెనియన్ +Name[tg]=Арманӣ +Name[th]=ภาษาอาร์เมเนีย +Name[tr]=Ermenice +Name[tt]=Әрмән +Name[ug]=ئەرمەنچە +Name[uk]=Вірменська +Name[uz]=Armancha +Name[uz@cyrillic]=Арманча +Name[vi]=Tiếng Ác-mê-ni-a +Name[wa]=Årmenyin +Name[zh_CN]=亚美尼亚语 +Name[zh_TW]=亞美尼亞語 + diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ia/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ia/kf6_entry.desktop new file mode 100644 index 0000000000..9daa778ee3 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ia/kf6_entry.desktop @@ -0,0 +1,75 @@ +[KCM Locale] +Name=Interlingua +Name[ar]=الإنترلنغوا +Name[az]=Interlingva +Name[be]=Інтэрлінгва +Name[be@latin]=Interlinhva +Name[bg]=Интерлингва +Name[bs]=interlingva +Name[ca]=Interlingua +Name[ca@valencia]=Interlingua +Name[cs]=Interlingua +Name[da]=Interlingua +Name[de]=Interlingua +Name[el]=Interlingua +Name[en_GB]=Interlingua +Name[eo]=Interlingvao +Name[es]=Interlingua +Name[et]=Interlingua +Name[eu]=Interlingua +Name[fa]=میان زبانی +Name[fi]=Interlingua +Name[fr]=Interlingua +Name[ga]=Idirtheanga +Name[gd]=Interlingua +Name[gl]=Interlingua +Name[gu]=ઇન્ટરલિન્ગુઆ +Name[he]=אינטרלינגואה +Name[hi]=अंतरभाषी +Name[hr]=Interlingua +Name[hu]=Interlingua +Name[ia]=Interlingua +Name[id]=Interlingua +Name[is]=Interlingua +Name[it]=Interlingua +Name[ja]=インターリングア +Name[ka]=ინტერლინგვა +Name[kk]=Интерлингва +Name[km]=អ៊ីនធឺ​លីងហ្គោ +Name[ko]=국제어(Interlingua) +Name[ku]=Interlingua +Name[lg]=Intalingwa +Name[lt]=Interlingua +Name[lv]=Interlingva +Name[mr]=इंटरलिंग्युआ +Name[ms]=Interlingua +Name[nb]=Interlingua +Name[nds]=Interlingua +Name[nl]=Interlingua +Name[nn]=Interlingua +Name[pa]=ਇੰਟਰਲੀਗੂਆ +Name[pl]=Interlingua +Name[pt]=Interlingua +Name[pt_BR]=Interlíngua +Name[ro]=Interlingua +Name[ru]=Интерлингва +Name[sa]=अन्तरभाषा +Name[se]=Interlingua +Name[sk]=Interlingua +Name[sl]=Interlingva +Name[sr]=интерлингва +Name[sr@ijekavian]=интерлингва +Name[sr@ijekavianlatin]=interlingva +Name[sr@latin]=interlingva +Name[sv]=Interlingua +Name[ta]=இன்டர்லிங்குவா +Name[tg]=Забонҳо +Name[th]=ภาษานานาชาติ +Name[tr]=İnterlingua +Name[tt]=Интерлингва +Name[ug]=خەلقئارا تىل +Name[uk]=Інтерлінгва +Name[vi]=Tiếng Khoa học Quốc tế +Name[wa]=Interlingua (noû latén) +Name[zh_CN]=国际语 +Name[zh_TW]=科技共通語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/id/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/id/kf6_entry.desktop new file mode 100644 index 0000000000..40d104a77b --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/id/kf6_entry.desktop @@ -0,0 +1,88 @@ +[KCM Locale] +Name=Indonesian +Name[af]=Indonesië +Name[ar]=الإندونيسيّة +Name[ast]=Indonesiu +Name[az]=İndoneziya dilində +Name[be]=Інданезійская +Name[be@latin]=Indaniezijskaja +Name[bg]=Индонезийски +Name[br]=Indoneseg +Name[bs]=indonežanski +Name[ca]=Indonesi +Name[ca@valencia]=Indonesi +Name[cs]=Indonéský +Name[cy]=Indonesieg +Name[da]=Indonesisk +Name[de]=Indonesisch +Name[el]=Ινδονησιακά +Name[en_GB]=Indonesian +Name[eo]=Indonezia +Name[es]=Indonesio +Name[et]=Indoneesia +Name[eu]=Indonesiera +Name[fa]=اندونزیایی +Name[fi]=Indonesia +Name[fr]=Indonésien +Name[fy]=Yndonesysk +Name[ga]=Indinéisis +Name[gd]=Innd-Innsis +Name[gl]=Indonesio +Name[gu]=ઈન્ડોનેશિયન +Name[he]=אינדונזית +Name[hi]=इंडोनेशियाई +Name[hr]=Indonezijski +Name[hu]=Indonéz +Name[ia]=Indonesiano +Name[id]=Bahasa Indonesia +Name[is]=Indónesíska +Name[it]=Indonesiano +Name[ja]=インドネシア語 +Name[ka]=ინდონეზიური +Name[kk]=Индонезияша +Name[km]=ឥណ្ឌូនេស៊ី +Name[ko]=인도네시아어 +Name[ku]=Endonezî +Name[lb]=Indonesesch +Name[lg]=Luyindonesiya +Name[lt]=Indoneziečių +Name[lv]=Indonēziešu +Name[mk]=Индонезиски +Name[mr]=इंडोनेशियन +Name[ms]=Indonesia +Name[nb]=Indonesisk +Name[nds]=Indoneesch +Name[nl]=Indonesisch +Name[nn]=Indonesisk +Name[pa]=ਇੰਡੋਨੇਸ਼ੀਆਈ +Name[pl]=Indonezyjski +Name[pt]=Indonésio +Name[pt_BR]=Indonésio +Name[ro]=Indoneziană +Name[ru]=Индонезийский +Name[sa]=इन्डोनेशियाई +Name[se]=Indonesiagiella +Name[sk]=Indonézština +Name[sl]=Indonezijščina +Name[sq]=Indonezisht +Name[sr]=индонежански +Name[sr@ijekavian]=индонежански +Name[sr@ijekavianlatin]=indonežanski +Name[sr@latin]=indonežanski +Name[sv]=Indonesiska +Name[ta]=இந்தோனேசியம் +Name[tg]=Индонезӣ +Name[th]=ภาษาอินโดนีเซีย +Name[tok]=toki Intonesija +Name[tr]=Endonezce +Name[tt]=Индонезия +Name[ug]=ھىندونېزىيەچە +Name[uk]=Індонезійська +Name[uz]=Indonezcha +Name[uz@cyrillic]=Индонезча +Name[vi]=Tiếng Indonesia +Name[wa]=Indonezyin +Name[xh]=Indonesian +Name[zh_CN]=印度尼西亚语 +Name[zh_HK]=印尼語 +Name[zh_TW]=印尼語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ie/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ie/kf6_entry.desktop new file mode 100644 index 0000000000..50c33dfb5c --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ie/kf6_entry.desktop @@ -0,0 +1,49 @@ +[KCM Locale] +Name=Interlingue +Name[ar]=الغربية +Name[az]=İnterlinqva +Name[be]=Інтэрлінгва +Name[bg]=Интерлингве +Name[ca]=Interlingue +Name[ca@valencia]=Interlingue +Name[cs]=Interlingue +Name[da]=Interlingue +Name[de]=Interlingue +Name[el]=Interlingue +Name[en_GB]=Interlingue +Name[eo]=Interlingue +Name[es]=Interlingue +Name[eu]=Interlingue +Name[fi]=Interlingua +Name[fr]=Interlingua +Name[gl]=Interlingua +Name[he]=אינטרלינגה +Name[hu]=Interlingua +Name[ia]=Interlingue +Name[is]=Interlingue +Name[it]=Interlingue +Name[ka]=ოქსიდენტური +Name[ko]=국제어(Interlingue) +Name[lg]=Intalingwe +Name[lt]=Interlingvė +Name[lv]=Interlingve +Name[nb]=Interlingue +Name[nl]=Interlingue +Name[nn]=Interlingue +Name[pa]=ਇੰਟਰਈਨੂਗੂਈ +Name[pl]=Interlingua +Name[pt]=Interlingue +Name[pt_BR]=Interlíngua +Name[ro]=Interlingue +Name[ru]=Интерлингве +Name[sa]=अन्तरभाषा +Name[sk]=Interlingue +Name[sl]=Interlingva +Name[sv]=Interlingue +Name[ta]=இன்டெர்லிங்குவே +Name[tr]=İnterlingue +Name[ug]=خەلقئارا تىل +Name[uk]=Окциденталь +Name[vi]=Tiếng Interlingue +Name[zh_CN]=拉丁国际语 +Name[zh_TW]=西方國際語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/is/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/is/kf6_entry.desktop new file mode 100644 index 0000000000..112d6df079 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/is/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Icelandic +Name[af]=Yslandiese +Name[ar]=الإيسلنديّة +Name[as]=আইচ্‌লেণ্ডিক +Name[ast]=Islandés +Name[az]=İsland dilində +Name[be]=Ісландская +Name[be@latin]=Islandskaja +Name[bg]=Исландски +Name[bn]=আইসল্যান্ডিক +Name[bn_IN]=আইসল্যান্ডিক +Name[br]=Islandeg +Name[bs]=islandski +Name[ca]=Islandès +Name[ca@valencia]=Islandés +Name[cs]=Islandský +Name[csb]=Islandzczi +Name[cy]=Islandeg +Name[da]=Islandsk +Name[de]=Isländisch +Name[el]=Ισλανδικά +Name[en_GB]=Icelandic +Name[eo]=Islanda +Name[es]=Islandés +Name[et]=Islandi +Name[eu]=Islandiera +Name[fa]=ایسلندی +Name[fi]=Islanti +Name[fr]=Islandais +Name[fy]=Iislânsk +Name[ga]=Íoslainnis +Name[gd]=Innis Tìlis +Name[gl]=Islandés +Name[gu]=આઈલેન્ડિક +Name[he]=איסלנדית +Name[hi]=आइसलैंडिक +Name[hne]=आइसलैंडिक +Name[hr]=Islandski +Name[hsb]=Islandsce +Name[hu]=Izlandi +Name[ia]=Islandese +Name[id]=Islandia +Name[is]=Íslenska +Name[it]=Islandese +Name[ja]=アイスランド語 +Name[ka]=ისლანდიური +Name[kk]=Исландша +Name[km]=អ៊ីស្លង់ +Name[kn]=ಐಸ್ಲ್ಯಾಂಡಿಕ್ +Name[ko]=아이슬란드어 +Name[ku]=Îzlandî +Name[lb]=Islännesch +Name[lg]=Lu-Ayisilandi +Name[lt]=Islandų +Name[lv]=Islandiešu +Name[mai]=आइसलैंडिक +Name[mk]=Исландски +Name[ml]=ഐസ്ലാന്‍ഡിക് +Name[mr]=आयलॅंडिक +Name[ms]=Icelandic +Name[nb]=Islandsk +Name[nds]=Islannsch +Name[ne]=आइसल्याण्डी +Name[nl]=IJslands +Name[nn]=Islandsk +Name[oc]=Islandés +Name[or]=ଆଇସଲେଣ୍ଡିକ +Name[pa]=ਆਇਸਲੈਂਡੀ +Name[pl]=Islandzki +Name[ps]=اېسلېنډي +Name[pt]=Islandês +Name[pt_BR]=Islandês +Name[ro]=Islandeză +Name[ru]=Исландский +Name[sa]=आइसलैण्डिक +Name[se]=Islánddagiella +Name[si]=අයිස්ලන්ත +Name[sk]=Islandčina +Name[sl]=Islandščina +Name[sq]=Islandisht +Name[sr]=исландски +Name[sr@ijekavian]=исландски +Name[sr@ijekavianlatin]=islandski +Name[sr@latin]=islandski +Name[sv]=Isländska +Name[ta]=ஐஸ்லாந்தியம் +Name[te]=ఐస్ లేండిక్ +Name[tg]=Исландӣ +Name[th]=ภาษาไอซ์แลนด์ +Name[tok]=toki Isilan +Name[tr]=İzlandaca +Name[tt]=Исланд +Name[ug]=ئىسلاندچە +Name[uk]=Ісландська +Name[uz]=Islandcha +Name[uz@cyrillic]=Исландча +Name[vi]=Tiếng Ai-xơ-len +Name[wa]=Izlandès +Name[xh]=Icelandic +Name[zh_CN]=冰岛语 +Name[zh_HK]=冰島語 +Name[zh_TW]=冰島語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/it/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/it/kf6_entry.desktop new file mode 100644 index 0000000000..4c7bf50351 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/it/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Italian +Name[af]=Italiaanse +Name[ar]=الإيطاليّة +Name[as]=ইটালিয়ান +Name[ast]=Italianu +Name[az]=İtalyan dilində +Name[be]=Італьянская +Name[be@latin]=Itaĺjanskaja +Name[bg]=Италиански +Name[bn]=ইতালীয় +Name[bn_IN]=ইটালিয়ান +Name[br]=Italianeg +Name[bs]=italijanski +Name[ca]=Italià +Name[ca@valencia]=Italià +Name[cs]=Italský +Name[csb]=Italsczi +Name[cy]=Eidaleg +Name[da]=Italiensk +Name[de]=Italienisch +Name[el]=Ιταλικά +Name[en_GB]=Italian +Name[eo]=Itala +Name[es]=Italiano +Name[et]=Itaalia +Name[eu]=Italiera +Name[fa]=ایتالیایی +Name[fi]=Italia +Name[fr]=Italien +Name[fy]=Italiaansk +Name[ga]=Iodáilis +Name[gd]=Eadailtis +Name[gl]=Italiano +Name[gu]=ઈટાલીયન +Name[he]=איטלקית +Name[hi]=इतालवी +Name[hne]=इतालवी +Name[hr]=Talijanski +Name[hsb]=Italsce +Name[hu]=Olasz +Name[ia]=Italiano +Name[id]=Italia +Name[is]=Ítalska +Name[it]=Italiano +Name[ja]=イタリア語 +Name[ka]=იტალიური +Name[kk]=Итальянша +Name[km]=អ៊ីតាលី +Name[kn]=ಇಟಾಲಿಯನ್ +Name[ko]=이탈리아어 +Name[ku]=Îtalî +Name[lb]=Italienesch +Name[lg]=Luyitale +Name[lt]=Italų +Name[lv]=Itāļu +Name[mai]=इतालवी +Name[mk]=Италијански +Name[ml]=ഇറ്റാലിയന്‍ +Name[mr]=इतालवी +Name[ms]=Italia +Name[nb]=Italiensk +Name[nds]=Italieensch +Name[ne]=इटालियन +Name[nl]=Italiaans +Name[nn]=Italiensk +Name[oc]=Italian +Name[or]=ଇଟାଲିୟନ +Name[pa]=ਇਤਾਲਵੀ +Name[pl]=Włoski +Name[ps]=اېټالوي +Name[pt]=Italiano +Name[pt_BR]=Italiano +Name[ro]=Italiană +Name[ru]=Итальянский +Name[sa]=इटालियन +Name[se]=Italiágiella +Name[si]=ඉතාලි +Name[sk]=Taliančina +Name[sl]=Italijanščina +Name[sq]=Italisht +Name[sr]=италијански +Name[sr@ijekavian]=италијански +Name[sr@ijekavianlatin]=italijanski +Name[sr@latin]=italijanski +Name[sv]=Italienska +Name[ta]=இத்தாலியன் +Name[te]=ఇటాలియన్ +Name[tg]=Итолиёӣ +Name[th]=ภาษาอิตาเลียน +Name[tok]=toki Italija +Name[tr]=İtalyanca +Name[tt]=Итальян +Name[ug]=ئىتاليانچە +Name[uk]=Італійська +Name[uz]=Italyancha +Name[uz@cyrillic]=Италянча +Name[vi]=Tiếng Ý +Name[wa]=Itålyin +Name[xh]=isitaliyane +Name[zh_CN]=意大利语 +Name[zh_HK]=意大利語 +Name[zh_TW]=義大利語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ja/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ja/kf6_entry.desktop new file mode 100644 index 0000000000..c8d84bf90d --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ja/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Japanese +Name[af]=Japanese +Name[ar]=اليابانيّة +Name[as]=জাপানী +Name[ast]=Xaponés +Name[az]=Yapon dilində +Name[be]=Японская +Name[be@latin]=Japonskaja +Name[bg]=Японски +Name[bn]=জাপানী +Name[bn_IN]=জাপানি +Name[br]=Japaneg +Name[bs]=japanski +Name[ca]=Japonès +Name[ca@valencia]=Japonés +Name[cs]=Japonský +Name[csb]=Japòńsczi +Name[cy]=Tsiapaneg +Name[da]=Japansk +Name[de]=Japanisch +Name[el]=Ιαπωνικά +Name[en_GB]=Japanese +Name[eo]=Japana +Name[es]=Japonés +Name[et]=Jaapani +Name[eu]=Japoniera +Name[fa]=ژاپنی +Name[fi]=Japani +Name[fr]=Japonais +Name[fy]=Japansk +Name[ga]=Seapáinis +Name[gd]=Seapanais +Name[gl]=Xaponés +Name[gu]=જાપાનીઝ +Name[he]=יפנית +Name[hi]=जापानी +Name[hne]=जापानी +Name[hr]=Japanski +Name[hsb]=Japansce +Name[hu]=Japán +Name[ia]=Japonese +Name[id]=Jepang +Name[is]=Japanska +Name[it]=Giapponese +Name[ja]=日本語 +Name[ka]=იაპონური +Name[kk]=Жапонша +Name[km]=ជប៉ុន +Name[kn]=ಜಪಾನೀಸ್ +Name[ko]=일본어 +Name[ku]=Japonî +Name[lb]=Japanesch +Name[lg]=Lujapani +Name[lt]=Japonų +Name[lv]=Japāņu +Name[mai]=जापानी +Name[mk]=Јапонски +Name[ml]=ജാപ്പനീസ് +Name[mr]=जपानी +Name[ms]=Jepun +Name[nb]=Japansk +Name[nds]=Japaansch +Name[ne]=जापानी +Name[nl]=Japans +Name[nn]=Japansk +Name[oc]=Japonés +Name[or]=ଜାପାନିଜ +Name[pa]=ਜਾਪਾਨੀ +Name[pl]=Japoński +Name[ps]=جاپاني +Name[pt]=Japonês +Name[pt_BR]=Japonês +Name[ro]=Japoneză +Name[ru]=Японский +Name[sa]=जापानी +Name[se]=Jáhpangiella +Name[si]=ජපන් +Name[sk]=Japončina +Name[sl]=Japonščina +Name[sq]=Japonisht +Name[sr]=јапански +Name[sr@ijekavian]=јапански +Name[sr@ijekavianlatin]=japanski +Name[sr@latin]=japanski +Name[sv]=Japanska +Name[ta]=ஜப்பானியம் +Name[te]=జపనీస్ +Name[tg]=Ҷопонӣ +Name[th]=ภาษาญี่ปุ่น +Name[tok]=toki Nijon +Name[tr]=Japonca +Name[tt]=Япон +Name[ug]=ياپونچە +Name[uk]=Японська +Name[uz]=Yaponcha +Name[uz@cyrillic]=Японча +Name[vi]=Tiếng Nhật +Name[wa]=Djaponès +Name[xh]=Japanese +Name[zh_CN]=日语 +Name[zh_HK]=日語 +Name[zh_TW]=日語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ka/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ka/kf6_entry.desktop new file mode 100644 index 0000000000..181d1c3aef --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ka/kf6_entry.desktop @@ -0,0 +1,102 @@ +[KCM Locale] +Name=Georgian +Name[af]=Georgian +Name[ar]=الجيورجيّة +Name[as]=জৰ্জিয়ান +Name[ast]=Xeorxanu +Name[az]=Gürcü dilində +Name[be]=Грузінская +Name[be@latin]=Hruzinskaja +Name[bg]=Грузински +Name[bn]=জর্জিয়ান +Name[bn_IN]=জর্জিয়ান +Name[br]=Jeorjieg +Name[bs]=gruzijski +Name[ca]=Georgià +Name[ca@valencia]=Georgià +Name[cs]=Gruzínský +Name[csb]=Grëzóńsczi +Name[cy]=Georgeg +Name[da]=Georgisk +Name[de]=Georgisch +Name[el]=Γεωργιανά +Name[en_GB]=Georgian +Name[eo]=Kartvela +Name[es]=Georgiano +Name[et]=Gruusia +Name[eu]=Georgiera +Name[fa]=گرجی +Name[fi]=Georgia +Name[fr]=Géorgien +Name[fy]=Georgysk +Name[ga]=Seoirsis +Name[gd]=Cairtbheilis +Name[gl]=Xeorxiano +Name[gu]=જ્યોર્જિયન +Name[he]=גאורגית +Name[hi]=ज्यॉर्जियाई +Name[hne]=ज्यार्जियाई +Name[hr]=Gruzijski +Name[hsb]=Gruzinsce +Name[hu]=Grúz +Name[ia]=Georgian +Name[id]=Georgia +Name[is]=Georgíska +Name[it]=Georgiano +Name[ja]=グルジア語 +Name[ka]=ქართული +Name[kk]=Гүржіше +Name[km]=ហ្សកហ្ស៊ី +Name[kn]=ಜಾರ್ಜೀಯನ್ +Name[ko]=조지아어 +Name[ku]=Gurcî +Name[lb]=Georgesch +Name[lg]=Lugiyogiya +Name[lt]=Gruzinų +Name[lv]=Gruzīnu +Name[mai]=ज्यॉर्जियाइ +Name[mk]=Грузиски +Name[ml]=ജോര്‍ജ്ജിയന്‍ +Name[mr]=जॉर्जियन +Name[ms]=Georgian +Name[nb]=Georgisk +Name[nds]=Georgsch +Name[ne]=जर्जियाली +Name[nl]=Georgisch +Name[nn]=Georgisk +Name[oc]=Georgian +Name[or]=ଜର୍ଜିୟନ +Name[pa]=ਜਾਰਜੀਆਈ +Name[pl]=Gruziński +Name[ps]=ګورجيايي +Name[pt]=Geórgio +Name[pt_BR]=Georgiano +Name[ro]=Georgiană +Name[ru]=Грузинский +Name[sa]=जॉर्जियाई +Name[se]=Georgialaš +Name[si]=ජෝර්ජියානු +Name[sk]=Gruzínčina +Name[sl]=Gruzinščina +Name[sq]=Gjorgjisht +Name[sr]=грузијски +Name[sr@ijekavian]=грузијски +Name[sr@ijekavianlatin]=gruzijski +Name[sr@latin]=gruzijski +Name[sv]=Georgiska +Name[ta]=ஜார்ஜியான் +Name[te]=జార్జియన్ +Name[tg]=Гурҷӣ +Name[th]=ภาษาจอร์เจีย +Name[tok]=toki Katuli +Name[tr]=Gürcüce +Name[tt]=Грузин +Name[ug]=گىرۇزىنچە +Name[uk]=Грузинська +Name[uz]=Gurjistoncha +Name[uz@cyrillic]=Гуржистонча +Name[vi]=Tiếng Georgia +Name[wa]=Djeyordjyin +Name[zh_CN]=格鲁吉亚语 +Name[zh_HK]=格魯吉亞語 +Name[zh_TW]=喬治亞語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/kk/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/kk/kf6_entry.desktop new file mode 100644 index 0000000000..3997e2545f --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/kk/kf6_entry.desktop @@ -0,0 +1,100 @@ +[KCM Locale] +Name=Kazakh +Name[af]=Kazakh +Name[ar]=القازاقيّة +Name[as]=কাজাখ +Name[ast]=Kazaxu +Name[az]=Qazax dilində +Name[be]=Казахская +Name[be@latin]=Kazachskaja +Name[bg]=Казахски +Name[bn]=কাজাক +Name[bn_IN]=কাজাখ +Name[br]=Kazakstaneg +Name[bs]=kazaški +Name[ca]=Kazakh +Name[ca@valencia]=Kazakh +Name[cs]=Kazašský +Name[csb]=Kazachsczi +Name[cy]=Kazakh +Name[da]=Kazakh +Name[de]=Kasachisch +Name[el]=Καζακικά +Name[en_GB]=Kazakh +Name[eo]=Kazaĥa +Name[es]=Kazajo +Name[et]=Kasahhi +Name[eu]=Kazakhera +Name[fa]=قزاق +Name[fi]=Kazakki +Name[fr]=Kazakh +Name[fy]=Kazakh +Name[ga]=Casaicis +Name[gd]=Casachais +Name[gl]=Casaco +Name[gu]=કઝાખ +Name[he]=קזחית +Name[hi]=कज़ाख +Name[hne]=कजाख +Name[hr]=Kazaški +Name[hsb]=Kazachisce +Name[hu]=Kazah +Name[ia]=Kazako +Name[id]=Kazakhstan +Name[is]=Kasakska +Name[it]=Kazako +Name[ja]=カザフ語 +Name[ka]=ყაზახური +Name[kk]=Қазақша +Name[km]=កាហ្សាក់ស្ថាន +Name[kn]=ಕಝಾಕ್ +Name[ko]=카자흐어 +Name[ku]=Kazakî +Name[lb]=Kasachesch +Name[lg]=Lukazaka +Name[lt]=Kazachų +Name[lv]=Kazahu +Name[mai]=कजाख +Name[mk]=Казахстански +Name[ml]=ഖസാഖ് +Name[mr]=कज़ाख +Name[ms]=Kazakh +Name[nb]=Kasakhisk +Name[nds]=Kasachsch +Name[ne]=कजाख +Name[nl]=Kazachs +Name[nn]=Kasakhisk +Name[oc]=Kazakh +Name[or]=କଜାଖ +Name[pa]=ਕਾਜ਼ਾਖ +Name[pl]=Kazachski +Name[ps]=کزاکي +Name[pt]=Cazaque +Name[pt_BR]=Cazaque +Name[ro]=Kazahă +Name[ru]=Казахский +Name[sa]=कजाख +Name[se]=Kasahkagiella +Name[si]=කසඛ් +Name[sk]=Kazaština +Name[sl]=Kazaščina +Name[sr]=казашки +Name[sr@ijekavian]=казашки +Name[sr@ijekavianlatin]=kazaški +Name[sr@latin]=kazaški +Name[sv]=Kazakiska +Name[ta]=கசக் +Name[te]=కజాఖ్ +Name[tg]=Қазоқӣ +Name[th]=ภาษาคาซัค +Name[tr]=Kazakça +Name[tt]=Казах +Name[ug]=قازاقچە +Name[uk]=Казахська +Name[uz]=Qozoqcha +Name[uz@cyrillic]=Қозоқча +Name[vi]=Tiếng Kazakh +Name[wa]=Kazaxh +Name[zh_CN]=哈萨克语 +Name[zh_HK]=哈薩克語 +Name[zh_TW]=哈薩克語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/km/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/km/kf6_entry.desktop new file mode 100644 index 0000000000..fb29c41626 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/km/kf6_entry.desktop @@ -0,0 +1,100 @@ +[KCM Locale] +Name=Khmer +Name[af]=Khmer +Name[ar]=الخميريّة +Name[as]=খ্‌মেৰ +Name[ast]=Camboyanu +Name[az]=Khmer dilində +Name[be]=Кхмерская +Name[be@latin]=Kchmierskaja +Name[bg]=Кхмерски +Name[bn]=খমের +Name[bn_IN]=খমের +Name[br]=Kmereg +Name[bs]=kmerski +Name[ca]=Khmer +Name[ca@valencia]=Khmer +Name[cs]=Khmérské +Name[csb]=Khmersczi +Name[cy]=Khmer +Name[da]=Khmer +Name[de]=Khmer +Name[el]=Χμερ +Name[en_GB]=Khmer +Name[eo]=Kmera +Name[es]=Camboyano +Name[et]=Khmeeri +Name[eu]=Khmerera +Name[fa]=خمری +Name[fi]=Khmer +Name[fr]=Khmer +Name[fy]=Khmer +Name[ga]=Ciméiris +Name[gd]=Cmèar +Name[gl]=Khmer +Name[gu]=ખ્મેર +Name[he]=חמרית +Name[hi]=ख्मेर +Name[hne]=ख्मेर +Name[hr]=Kmerski +Name[hsb]=Khmer +Name[hu]=Khmer +Name[ia]=Khmer +Name[id]=Khmer +Name[is]=Khmer +Name[it]=Khmer +Name[ja]=クメール語 +Name[ka]=კხმერული +Name[kk]=Кхмерше +Name[km]=ខ្មែរ +Name[kn]=ಖುಮೇರ್ +Name[ko]=크메르어 +Name[ku]=Khmer +Name[lb]=Khmer +Name[lg]=Lukimeri +Name[lt]=Chmerų +Name[lv]=Khmeru +Name[mai]=ख्मेर +Name[mk]=Кмерски +Name[ml]=ഖമര്‍ +Name[mr]=ख्मेर +Name[ms]=Khmer +Name[nb]=Khmer +Name[nds]=Khmer +Name[ne]=खमेर +Name[nl]=Khmer +Name[nn]=Khmer +Name[oc]=Khmer +Name[or]=ଖ୍ମେର +Name[pa]=ਖਮੀਰ +Name[pl]=Khmer +Name[ps]=کمير +Name[pt]=Khmer +Name[pt_BR]=Cambojano +Name[ro]=Kmeră +Name[ru]=Кхмерский +Name[sa]=ख्मेर +Name[se]=Khmeragiella +Name[si]=ක්හ්මර් +Name[sk]=Khmérčina +Name[sl]=Kmerščina +Name[sr]=кмерски +Name[sr@ijekavian]=кмерски +Name[sr@ijekavianlatin]=kmerski +Name[sr@latin]=kmerski +Name[sv]=Kambodjanska +Name[ta]=குஹுமர் +Name[te]=ఖ్మెర్ +Name[tg]=Хмерӣ +Name[th]=ภาษาเขมร +Name[tr]=Kmerce +Name[tt]=Кхмер +Name[ug]=كېخمېرچە +Name[uk]=Кхмерська +Name[uz]=Kxmer +Name[uz@cyrillic]=Кхмер +Name[vi]=Tiếng Khơ-me +Name[wa]=Xhmer +Name[zh_CN]=高棉语 +Name[zh_HK]=高棉語 +Name[zh_TW]=高棉語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/kn/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/kn/kf6_entry.desktop new file mode 100644 index 0000000000..07fcb8a7c1 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/kn/kf6_entry.desktop @@ -0,0 +1,81 @@ +[KCM Locale] +Name=Kannada +Name[ar]=الكنادا +Name[ast]=Canarés +Name[az]=Kanada +Name[be]=Канада +Name[be@latin]=Kanada +Name[bg]=Каннада +Name[bs]=kanada +Name[ca]=Kanarès +Name[ca@valencia]=Kanarés +Name[cs]=Kannada +Name[csb]=Kannada +Name[da]=Kannada +Name[de]=Kannada +Name[el]=Κανάντα +Name[en_GB]=Kannada +Name[eo]=Kanara +Name[es]=Canarés +Name[et]=Kannada +Name[eu]=Kannada +Name[fa]=کاناده‌ای +Name[fi]=Kannada +Name[fr]=Kannada +Name[fy]=Kannada +Name[ga]=Cannadais +Name[gd]=Kannada +Name[gl]=Kannada +Name[gu]=કન્નડા +Name[he]=קאנדה +Name[hi]=कन्नड +Name[hr]=Kannadski +Name[hu]=Kannada +Name[ia]=Kannada +Name[id]=Kannada +Name[is]=Kannada +Name[it]=Kannada +Name[ja]=カンナダ語 +Name[ka]=კანნადა +Name[kk]=Каннадаша +Name[km]=កាណាដា +Name[kn]=ಕನ್ನಡ +Name[ko]=칸나다어 +Name[ku]=Kannada +Name[lg]=Lukannadda +Name[lt]=Kanadų +Name[lv]=Kannadu +Name[mk]=Каннада +Name[ml]=കന്നഡ +Name[mr]=कन्नड +Name[ms]=Kannada +Name[nb]=Kannada +Name[nds]=Kannada +Name[nl]=Kannada +Name[nn]=Kannada +Name[pa]=ਕੰਨੜ +Name[pl]=Kannada +Name[pt]=Kannada +Name[pt_BR]=Canarês +Name[ro]=Kannada +Name[ru]=Каннада +Name[sa]=कन्नड +Name[se]=Kannadagiella +Name[sk]=Kannadčina +Name[sl]=Kanareščina +Name[sr]=канада +Name[sr@ijekavian]=канада +Name[sr@ijekavianlatin]=kanada +Name[sr@latin]=kanada +Name[sv]=Kanaresiska +Name[ta]=கன்னடம் +Name[tg]=Каннадӣ +Name[th]=ภาษากัณณาท +Name[tr]=Kannadaca +Name[tt]=Каннада +Name[ug]=كانناداچە +Name[uk]=Каннада +Name[vi]=Tiếng Kannada +Name[wa]=Kannada +Name[zh_CN]=坎那达语 +Name[zh_TW]=卡納達語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ko/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ko/kf6_entry.desktop new file mode 100644 index 0000000000..685bcf8462 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ko/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Korean +Name[af]=Koriaanse +Name[ar]=الكوريّة +Name[as]=ক'ৰীয় +Name[ast]=Coreanu +Name[az]=Koreya dilində +Name[be]=Карэйская +Name[be@latin]=Karejskaja +Name[bg]=Корейски +Name[bn]=কোরীয় +Name[bn_IN]=কোরিয়ান +Name[br]=Koreeg +Name[bs]=korejski +Name[ca]=Coreà +Name[ca@valencia]=Coreà +Name[cs]=Korejský +Name[csb]=Kòrejańsczi +Name[cy]=Corieg +Name[da]=Koreansk +Name[de]=Koreanisch +Name[el]=Κορεατικά +Name[en_GB]=Korean +Name[eo]=Korea +Name[es]=Coreano +Name[et]=Korea +Name[eu]=Koreera +Name[fa]=کره‌ای +Name[fi]=Korea +Name[fr]=Coréen +Name[fy]=Koareaansk +Name[ga]=Cóiréis +Name[gd]=Coireanais +Name[gl]=Coreano +Name[gu]=કોરીયન +Name[he]=קוריאנית +Name[hi]=कोरियाई +Name[hne]=कोरियाई +Name[hr]=Korejski +Name[hsb]=Koreansce +Name[hu]=Koreai +Name[ia]=Coreano +Name[id]=Korea +Name[is]=Kóreska +Name[it]=Coreano +Name[ja]=韓国語・朝鮮語 +Name[ka]=კორეული +Name[kk]=Корейше +Name[km]=កូរ៉េ +Name[kn]=ಕೊೋರಿಯನ್ +Name[ko]=한국어 +Name[ku]=Koreyî +Name[lb]=Koreanesch +Name[lg]=Lukoreya +Name[lt]=Korėjiečių +Name[lv]=Korejiešu +Name[mai]=कोरियाइ +Name[mk]=Корејски +Name[ml]=കൊറിയന്‍ +Name[mr]=कोरियन +Name[ms]=Korea +Name[nb]=Koreansk +Name[nds]=Koreaansch +Name[ne]=कोरियाली +Name[nl]=Koreaans +Name[nn]=Koreansk +Name[oc]=Corean +Name[or]=କୋରିୟନ +Name[pa]=ਕੋਰੀਆਈ +Name[pl]=Koreański +Name[ps]=کوريايي +Name[pt]=Coreano +Name[pt_BR]=Coreano +Name[ro]=Coreeană +Name[ru]=Корейский +Name[sa]=कोरियाई +Name[se]=Koreagiella +Name[si]=කොරියානු +Name[sk]=Kórejčina +Name[sl]=Korejščina +Name[sq]=Koreanisht +Name[sr]=корејски +Name[sr@ijekavian]=корејски +Name[sr@ijekavianlatin]=korejski +Name[sr@latin]=korejski +Name[sv]=Koreanska +Name[ta]=கொரியன் +Name[te]=కొరియన్ +Name[tg]=Кореягӣ +Name[th]=ภาษาเกาหลี +Name[tok]=toki Anku +Name[tr]=Korece +Name[tt]=Корея +Name[ug]=كورېيەچە +Name[uk]=Корейська +Name[uz]=Koreyscha +Name[uz@cyrillic]=Корейсча +Name[vi]=Tiếng Hàn +Name[wa]=Coreyin +Name[xh]=Korean +Name[zh_CN]=朝鲜语 +Name[zh_HK]=朝鮮語 +Name[zh_TW]=韓文 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ku/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ku/kf6_entry.desktop new file mode 100644 index 0000000000..36312577c2 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ku/kf6_entry.desktop @@ -0,0 +1,101 @@ +[KCM Locale] +Name=Kurdish +Name[af]=Kurdish +Name[ar]=الكرديّة +Name[as]=কুৰ্দিশ্ব +Name[ast]=Kurdu +Name[az]=Kürd dilində +Name[be]=Курдская +Name[be@latin]=Kurdskaja +Name[bg]=Кюрдски +Name[bn]=কুর্দিশ +Name[bn_IN]=কুর্দিশ +Name[br]=Kurdeg +Name[bs]=kurdski +Name[ca]=Kurd +Name[ca@valencia]=Kurd +Name[cs]=Kurdský +Name[csb]=Kùrdëjsczi +Name[cy]=Cwrdeg +Name[da]=Kurdisk +Name[de]=Kurdisch +Name[el]=Κουρδικά +Name[en_GB]=Kurdish +Name[eo]=Kurda +Name[es]=Kurdo +Name[et]=Kurdi +Name[eu]=Kurduera +Name[fa]=کردی +Name[fi]=Kurdi +Name[fr]=Kurde +Name[fy]=Koerdysk +Name[ga]=Coirdis +Name[gd]=Cùrdais +Name[gl]=Kurdo +Name[gu]=કુર્દીશ +Name[he]=כורדית +Name[hi]=कुर्दी +Name[hne]=कुर्दी +Name[hr]=Kurdski +Name[hsb]=Kurdisce +Name[hu]=Kurd +Name[ia]=Kurdo +Name[id]=Kurdish +Name[is]=Kúrdíska +Name[it]=Curdo +Name[ja]=クルド語 +Name[ka]=ქურთული +Name[kk]=Курдша +Name[km]=ឃឺដ +Name[kn]=ಕಿರ್ದಿಶ್ +Name[ko]=쿠르드어 +Name[ku]=Kurdî +Name[lb]=Kurdesch +Name[lg]=Lukurudi +Name[lt]=Kurdų +Name[lv]=Kurdu +Name[mai]=कुर्दिश +Name[mk]=Курдски +Name[ml]=തുര്‍ക്കിഷ് +Name[mr]=कुर्दिष +Name[ms]=Kurdish +Name[nb]=Kurdisk +Name[nds]=Kurdsch +Name[nl]=Koerdisch +Name[nn]=Kurdisk +Name[oc]=Curd +Name[or]=କୁରଦିଶ +Name[pa]=ਕੁਰਦ +Name[pl]=Kurdyjski +Name[ps]=کوردي +Name[pt]=Curdo +Name[pt_BR]=Curdo +Name[ro]=Curdă +Name[ru]=Курдский +Name[sa]=कुर्दिष +Name[se]=Kurdagiella +Name[si]=කුර්දිෂ් +Name[sk]=Kurdčina +Name[sl]=Kurdščina +Name[sq]=Kurdisht +Name[sr]=курдски +Name[sr@ijekavian]=курдски +Name[sr@ijekavianlatin]=kurdski +Name[sr@latin]=kurdski +Name[sv]=Kurdiska +Name[ta]=குர்தீஷ் +Name[te]=కుర్దిష్ +Name[tg]=Курдӣ +Name[th]=ภาษาเคอร์ดิช +Name[tr]=Kürtçe +Name[tt]=Курд +Name[ug]=كۇردچە +Name[uk]=Курдська +Name[uz]=Kurdcha +Name[uz@cyrillic]=Курдча +Name[vi]=Tiếng Kurd +Name[wa]=Kurdi +Name[xh]=Kurdish +Name[zh_CN]=库尔德语 +Name[zh_HK]=庫爾德語 +Name[zh_TW]=庫德語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/lb/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/lb/kf6_entry.desktop new file mode 100644 index 0000000000..73b095bebd --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/lb/kf6_entry.desktop @@ -0,0 +1,100 @@ +[KCM Locale] +Name=Luxembourgish +Name[af]=Luxemburgies +Name[ar]=اللوكسبورغيّة +Name[as]=লাক্সেমব'ৰজিশ্ব +Name[ast]=Luxemburgués +Name[az]=Lüxemburq dilində +Name[be]=Люксембургская +Name[be@latin]=Liuksiemburhskaja +Name[bg]=Люксембургски +Name[bn]=লাক্সেমবুর্গীয় +Name[bn_IN]=লাক্সেমবুর্গিশ +Name[br]=Luksembourgeg +Name[bs]=luksemburški +Name[ca]=Luxemburguès +Name[ca@valencia]=Luxemburgués +Name[cs]=Lucemburský +Name[csb]=Luksembùrsczi +Name[cy]=Luxembwrgeg +Name[da]=Luxembourgish +Name[de]=Luxemburgisch +Name[el]=Λουξενβουργιανά +Name[en_GB]=Luxembourgish +Name[eo]=Luksemburga +Name[es]=Luxemburgués +Name[et]=Letseburgi +Name[eu]=Luxenburgera +Name[fa]=لوکزامبورگی +Name[fi]=Luxemburg +Name[fr]=Luxembourgeois +Name[fy]=Luxemburgsk +Name[ga]=Lucsambuirgis +Name[gd]=Lugsamburgais +Name[gl]=Luxemburgués +Name[gu]=લક્ઝેમ્બર્ગીઝ +Name[he]=לוקסמבורגית +Name[hi]=लक्जमबर्गिश +Name[hne]=लक्जमबर्गिस +Name[hr]=Luksemburški +Name[hsb]=Luksemburgsce +Name[hu]=Luxemburgi +Name[ia]=Luxemburgese +Name[id]=Luxemburg +Name[is]=Lúxemborgska +Name[it]=Lussemburghese +Name[ja]=ルクセンブルク語 +Name[ka]=ლუმბურგული +Name[kk]=Люксенбургша +Name[km]=លុចហ្សំបួរ +Name[kn]=ಲಕ್ಸೆಮ್‌ಬೌರ್ಗಿಷ್ +Name[ko]=룩셈부르크어 +Name[ku]=Luksemburgî +Name[lb]=Lëtzebuergesch +Name[lg]=Lulukizemburugi +Name[lt]=Liuksemburgiečių +Name[lv]=Luksemburgiešu +Name[mai]=लक्समबर्ग +Name[mk]=Луксембуршки +Name[ml]=ലക്സംബര്‍ഗിഷ് +Name[mr]=लक्जमबर्गिश +Name[ms]=Luxembourg +Name[nb]=Luxembourgsk +Name[nds]=Luxemborgsch +Name[ne]=लग्जेम्बर्गिश +Name[nl]=Luxemburgs +Name[nn]=Luxembourgsk +Name[oc]=Luxemborgés +Name[or]=ଲଗଜେମବରଗିଶ +Name[pa]=ਲਕਸ਼ਮਬਰਗ +Name[pl]=Luksemburski +Name[ps]=لګسېمبرګيايي +Name[pt]=Luxemburguês +Name[pt_BR]=Luxemburguês +Name[ro]=Luxemburgheză +Name[ru]=Люксембургский +Name[sa]=लक्जम्बर्ग् +Name[se]=Luxemburgalaš +Name[si]=ලක්සමබර්ග් +Name[sk]=Luxemburčina +Name[sl]=Luksemburščina +Name[sr]=луксембуршки +Name[sr@ijekavian]=луксембуршки +Name[sr@ijekavianlatin]=luksemburški +Name[sr@latin]=luksemburški +Name[sv]=Luxemburgiska +Name[ta]=லக்ஸம்போர்கிஷ் +Name[te]=లక్సెమ్ బర్గిష్ +Name[tg]=Люксембургӣ +Name[th]=ภาษาลักเซมเบอร์ก +Name[tr]=Lüksemburgca +Name[tt]=Люксембург +Name[ug]=لىيۇكسېمبۇرگچە +Name[uk]=Люксембурзька +Name[uz]=Lyuksemburgcha +Name[uz@cyrillic]=Люксембургча +Name[vi]=Tiếng Luxembourg +Name[wa]=Lussimbordjwès +Name[zh_CN]=卢森堡语 +Name[zh_HK]=盧森堡語 +Name[zh_TW]=盧森堡語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/lt/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/lt/kf6_entry.desktop new file mode 100644 index 0000000000..33ecb64b71 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/lt/kf6_entry.desktop @@ -0,0 +1,102 @@ +[KCM Locale] +Name=Lithuanian +Name[af]=Lithuaniese +Name[ar]=الليتوانيّة +Name[as]=লিথুৱেনিয়ান +Name[ast]=Lituanu +Name[az]=Litva dilində +Name[be]=Летувіская +Name[be@latin]=Lietuviskaja +Name[bg]=Литовски +Name[bn]=লিথুয়েনীয় +Name[bn_IN]=লিথুয়েনিয়ান +Name[br]=Lituaneg +Name[bs]=litvanski +Name[ca]=Lituà +Name[ca@valencia]=Lituà +Name[cs]=Litevský +Name[csb]=Litewsczi +Name[cy]=Lithwaneg +Name[da]=Litauisk +Name[de]=Litauisch +Name[el]=Λιθουανικά +Name[en_GB]=Lithuanian +Name[eo]=Litova +Name[es]=Lituano +Name[et]=Leedu +Name[eu]=Lituaniera +Name[fa]=لیتوانیایی +Name[fi]=Liettua +Name[fr]=Lituanien +Name[fy]=Litouwsk +Name[ga]=Liotuáinis +Name[gd]=Liotuainis +Name[gl]=Lituano +Name[gu]=લિથુઆનિયન +Name[he]=ליטאית +Name[hi]=लिथुआनियाई +Name[hne]=लिथुआनियाई +Name[hr]=Litvanski +Name[hsb]=Litawsce +Name[hu]=Litván +Name[ia]=Lituano +Name[id]=Lithuania +Name[is]=Litháíska +Name[it]=Lituano +Name[ja]=リトアニア語 +Name[ka]=ლითუანიური +Name[kk]=Литваша +Name[km]=លីទុយអានី +Name[kn]=ಲಿಥುವೇನಿಯನ್ +Name[ko]=리투아니아어 +Name[ku]=Lîtuwanî +Name[lb]=Litauesch +Name[lg]=Lulisuwaniya +Name[lt]=Lietuvių +Name[lv]=Lietuviešu +Name[mai]=लिथुआनियाइ +Name[mk]=Литвански +Name[ml]=ലിത്വേനിയന്‍ +Name[mr]=लिथुआनियाई +Name[ms]=Lithuania +Name[nb]=Litauisk +Name[nds]=Litausch +Name[ne]=लिथुनियाली +Name[nl]=Litouws +Name[nn]=Litauisk +Name[oc]=Lituanian +Name[or]=ଲିଥୁଆନିୟନ +Name[pa]=ਲੀਥੂਨੀਆਈ +Name[pl]=Litewski +Name[ps]=لېټوانيايي +Name[pt]=Lituano +Name[pt_BR]=Lituano +Name[ro]=Lituaniană +Name[ru]=Литовский +Name[sa]=लिथुआनियाई +Name[se]=Lietuvagiella +Name[si]=ලිතුවේනියානු +Name[sk]=Litovčina +Name[sl]=Litvanščina +Name[sq]=Lithuanisht +Name[sr]=литвански +Name[sr@ijekavian]=литвански +Name[sr@ijekavianlatin]=litvanski +Name[sr@latin]=litvanski +Name[sv]=Litauiska +Name[ta]=லிதுவேனியன் +Name[te]=లితువెనియన్ +Name[tg]=Литвиягӣ +Name[th]=ภาษาลิทัวเนีย +Name[tr]=Litvanca +Name[tt]=Литва +Name[ug]=لىتۋاچە +Name[uk]=Литовська +Name[uz]=Litvacha +Name[uz@cyrillic]=Литвача +Name[vi]=Tiếng Lít-va +Name[wa]=Litwanyin +Name[xh]=Lithuanian +Name[zh_CN]=立陶宛语 +Name[zh_HK]=立陶宛語 +Name[zh_TW]=立陶宛語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/lv/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/lv/kf6_entry.desktop new file mode 100644 index 0000000000..e6e83fa297 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/lv/kf6_entry.desktop @@ -0,0 +1,102 @@ +[KCM Locale] +Name=Latvian +Name[af]=Latvian +Name[ar]=اللاتفيّة +Name[as]=লাট্‌ভিয়ান +Name[ast]=Letón +Name[az]=Latış dilində +Name[be]=Латышская +Name[be@latin]=Latyšskaja +Name[bg]=Латвийски +Name[bn]=লাটভিয়ান +Name[bn_IN]=লাটভিয়ান +Name[br]=Latvieg +Name[bs]=letonski +Name[ca]=Letó +Name[ca@valencia]=Letó +Name[cs]=Lotyšský +Name[csb]=Łotewsczi +Name[cy]=Latfieg +Name[da]=Lettisk +Name[de]=Lettisch +Name[el]=Λεττονικά +Name[en_GB]=Latvian +Name[eo]=Latvia +Name[es]=Letonio +Name[et]=Läti +Name[eu]=Letoniera +Name[fa]=لتونیایی +Name[fi]=Latvia +Name[fr]=Letton +Name[fy]=Letsk +Name[ga]=Laitvis +Name[gd]=Laitbheis +Name[gl]=Letón +Name[gu]=લેટવિયન +Name[he]=לטבית +Name[hi]=लातवियाई +Name[hne]=लातवियाई +Name[hr]=Latvijski +Name[hsb]=Letisce +Name[hu]=Lett +Name[ia]=Letton +Name[id]=Latvia +Name[is]=Lettneska +Name[it]=Lettone +Name[ja]=ラトビア語 +Name[ka]=ლატვიური +Name[kk]=Латвияша +Name[km]=ឡាតវៀ +Name[kn]=ಲಾಟ್ವಿಯನ್ +Name[ko]=라트비아어 +Name[ku]=Letonî +Name[lb]=Lettesch +Name[lg]=Lulatviya +Name[lt]=Latvių +Name[lv]=Latviešu +Name[mai]=लातवियाइ +Name[mk]=Латвиски +Name[ml]=ലാത്വിയന്‍ +Name[mr]=लातवियाई +Name[ms]=Latvia +Name[nb]=Latvisk +Name[nds]=Lettsch +Name[ne]=लात्भियाली +Name[nl]=Lets +Name[nn]=Latvisk +Name[oc]=Leton +Name[or]=ଲାଟଭିୟନ +Name[pa]=ਲਟਵੀਆਈ +Name[pl]=Łotewski +Name[ps]=لېټوين +Name[pt]=Letão +Name[pt_BR]=Letão +Name[ro]=Letonă +Name[ru]=Латышский +Name[sa]=लाट्वियाई +Name[se]=Látviagiella +Name[si]=සලැට්වියානු +Name[sk]=Lotyština +Name[sl]=Latvijščina +Name[sq]=Latvisht +Name[sr]=летонски +Name[sr@ijekavian]=летонски +Name[sr@ijekavianlatin]=letonski +Name[sr@latin]=letonski +Name[sv]=Lettiska +Name[ta]=லட்வியன் +Name[te]=లాతివ్యన్ +Name[tg]=Латвиягӣ +Name[th]=ภาษาลัทเวีย +Name[tr]=Letonca +Name[tt]=Латыш +Name[ug]=لاتۋىيەچە +Name[uk]=Латвійська +Name[uz]=Latishcha +Name[uz@cyrillic]=Латишча +Name[vi]=Tiếng Lát-vi-a +Name[wa]=Letonyin +Name[xh]=Latvian +Name[zh_CN]=拉脱维亚语 +Name[zh_HK]=拉脫維亞語 +Name[zh_TW]=拉脫維亞語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/mai/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/mai/kf6_entry.desktop new file mode 100644 index 0000000000..a76d6e714e --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/mai/kf6_entry.desktop @@ -0,0 +1,82 @@ +[KCM Locale] +Name=Maithili +Name[ar]=المايثيلي +Name[as]=মৈথিলি +Name[az]=Maythili dilində +Name[be]=Майтхілі +Name[be@latin]=Majtchili +Name[bg]=Маратхи +Name[bn_IN]=মৈথিলি +Name[bs]=maithili +Name[ca]=Maithili +Name[ca@valencia]=Maithili +Name[cs]=Maithili +Name[csb]=Maithili +Name[da]=Maithili +Name[de]=Maithili +Name[el]=Μαϊθίλι +Name[en_GB]=Maithili +Name[eo]=Maitila +Name[es]=Maithili +Name[et]=Maithili +Name[eu]=Maithili +Name[fa]=مایتیلی +Name[fi]=Maithili +Name[fr]=Maïthili +Name[fy]=Maithili +Name[ga]=Maitilis +Name[gd]=Maithili +Name[gl]=Maithili +Name[gu]=મૈથિલિ +Name[he]=מאיטהילית +Name[hi]=मैथिली +Name[hr]=Maithilski +Name[hu]=Maithili +Name[ia]=Maithili +Name[id]=Maithili +Name[is]=Maithili +Name[it]=Maithili +Name[ja]=マイティリー語 +Name[ka]=მაითხილი +Name[kk]=Майтхилише +Name[km]=ម៉ារ៉ាទី +Name[kn]=ಮೈಥಿಲಿ +Name[ko]=마이틸리어 +Name[ku]=Zimanê Maithili +Name[lg]=Lumayitili +Name[lt]=Maithili +Name[lv]=Maithili +Name[ml]=മൈഥിലി +Name[mr]=मैथिली +Name[ms]=Maithili +Name[nb]=Maithili +Name[nds]=Maithili +Name[nl]=Maithili +Name[nn]=Maithili +Name[pa]=ਮੈਥਲੀ +Name[pl]=Maithili +Name[pt]=Maithili +Name[pt_BR]=Maithili +Name[ro]=Maithili +Name[ru]=Майтхили +Name[sa]=मैथिली +Name[se]=Maitiligiella +Name[si]=මයිතිලි +Name[sk]=Maithilčina +Name[sl]=Maitilščina +Name[sr]=маитхили +Name[sr@ijekavian]=маитхили +Name[sr@ijekavianlatin]=maithili +Name[sr@latin]=maithili +Name[sv]=Maithili +Name[ta]=மைதிலி +Name[tg]=Майтифил +Name[th]=ภาษาไมถิลี +Name[tr]=Maithili Dili +Name[tt]=Майтхили +Name[ug]=مايتىلىچە +Name[uk]=Майтхілі +Name[vi]=Tiếng Maithil +Name[wa]=Maithili +Name[zh_CN]=迈蒂利语 +Name[zh_TW]=邁蒂利語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/mk/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/mk/kf6_entry.desktop new file mode 100644 index 0000000000..38e73f6c50 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/mk/kf6_entry.desktop @@ -0,0 +1,119 @@ +[KCM Locale] +Name=Macedonian +Name[af]=Makedoniese +Name[ar]=المقدونيّة +Name[as]=মেচিডোনীয় +Name[ast]=Macedoniu +Name[az]=Makedoniya dilində +Name[be]=Македонская +Name[be@latin]=Makiedonskaja +Name[bg]=Македонски +Name[bn]=মাসিডোনীয় +Name[bn_IN]=মেসিডোনিয়ান +Name[br]=Makedoneg +Name[bs]=makedonski +Name[ca]=Macedoni +Name[ca@valencia]=Macedoni +Name[cs]=Makedonský +Name[csb]=Macedońsczi +Name[cy]=Macedoneg +Name[da]=Makedonsk +Name[de]=Mazedonisch +Name[el]=Σλαβομακεδονικά +Name[en_GB]=Macedonian +Name[eo]=Makedona +Name[es]=Macedonio +Name[et]=Makedoonia +Name[eu]=Mazedoniera +Name[fa]=مقدونی +Name[fi]=Makedonia +Name[fr]=Macédonien +Name[fy]=Masedoanysk +Name[ga]=Macadóinis +Name[gd]=Masadonais +Name[gl]=Macedonio +Name[gu]=મેસેડોનિયન +Name[he]=מקדונית +Name[hi]=मकदूनियाई +Name[hne]=मकदूनियाई +Name[hr]=Makedonski +Name[hsb]=Makedonsce +Name[hu]=Macedón +Name[ia]=Macedone +Name[id]=Macedonia +Name[is]=Makedónska +Name[it]=Macedone +Name[ja]=マケドニア語 +Name[ka]=მაკედონიური +Name[kk]=Македонша +Name[km]=ម៉ាសេដូនី +Name[kn]=ಮೆಸಡೋನಿಯನ್ +Name[ko]=마케도니아어 +Name[ku]=Makedonî +Name[lb]=Mazedonesch +Name[lg]=Lumasedoniya +Name[lt]=Makedonų +Name[lv]=Maķedoniešu +Name[mai]=मेसिडोनियाइ +Name[mk]=Македонски +Name[ml]=മാസിഡോണിയന്‍ +Name[mr]=मेसीडोनियन +Name[ms]=Macedonia +Name[nb]=Makedonsk +Name[nds]=Makedoonsch +Name[ne]=म्यासेडोनियाली +Name[nl]=Macedonisch +Name[nn]=Makedonsk +Name[oc]=Macedonian +Name[or]=ମେସିଡୋନିୟନ +Name[pa]=ਮੈਕਡੋਨੀਆਈ +Name[pl]=Macedoński +Name[ps]=مېسېډونيايي +Name[pt]=Macedónio +Name[pt_BR]=Macedônio +Name[ro]=Macedoneană +Name[ru]=Македонский +Name[sa]=मैसिडोनियाई +Name[se]=Makedoniagiella +Name[si]=මැසිඩෝනියානු +Name[sk]=Macedónčina +Name[sl]=Makedonščina +Name[sq]=Maqedonisht +Name[sr]=македонски +Name[sr@ijekavian]=македонски +Name[sr@ijekavianlatin]=makedonski +Name[sr@latin]=makedonski +Name[sv]=Makedonska +Name[ta]=மாசிடோனிய +Name[te]=మెసిడొనియన్ +Name[tg]=Мақдунӣ +Name[th]=ภาษามาเซโดเนีย +Name[tr]=Makedonca +Name[tt]=Македония +Name[ug]=ماكېدونچە +Name[uk]=Македонська +Name[uz]=Makedoniyacha +Name[uz@cyrillic]=Македонияча +Name[vi]=Tiếng Macedonia +Name[wa]=Macedonyin +Name[xh]=Macedonian +Name[zh_CN]=马其顿语 +Name[zh_HK]=馬其頓語 +Name[zh_TW]=馬其頓語 +Languages=mk +Region=easteurope +DecimalSymbol=, +ThousandsSeparator=$0 $0 +CurrencySymbol=MKD +MonetaryDecimalSymbol=, +MonetaryThousandsSeparator=$0 $0 +PositiveSign= +NegativeSign=- +FractDigits=2 +PositivePrefixCurrencySymbol=true +NegativePrefixCurrencySymbol=true +PositiveMonetarySignPosition=1 +NegativeMonetarySignPosition=1 +DateFormat=%A %e. %B %Y +DateFormatShort=%d.%m.%Y +TimeFormat=%H:%M:%S diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ml/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ml/kf6_entry.desktop new file mode 100644 index 0000000000..36c58c6409 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ml/kf6_entry.desktop @@ -0,0 +1,94 @@ +[KCM Locale] +Name=Malayalam +Name[ar]=الماليالاميّة +Name[as]=মলয়ালম +Name[ast]=Malabar +Name[az]=Malayalam dilində +Name[be]=Малаялам +Name[be@latin]=Malajalam +Name[bg]=Малаялам +Name[bn]=মলয়লম +Name[bn_IN]=মালায়ালম +Name[bs]=malajalam +Name[ca]=Malaiàlam +Name[ca@valencia]=Malaiàlam +Name[cs]=Malayalam +Name[csb]=Malajalamsczi +Name[da]=Malayalisk +Name[de]=Malayalam +Name[el]=Malayalam +Name[en_GB]=Malayalam +Name[eo]=Malajala +Name[es]=Malabar +Name[et]=Malajalami +Name[eu]=Malabarera +Name[fa]=مالایالام +Name[fi]=Malajalam +Name[fr]=Malayalam +Name[fy]=Malayalam +Name[ga]=Mailéalaimis +Name[gd]=Malayalam +Name[gl]=Malayalam +Name[gu]=મલયાલમ +Name[he]=מלאיאלאם +Name[hi]=मलयालम +Name[hne]=मलयालम +Name[hr]=Malajalamski +Name[hsb]=Malayalam +Name[hu]=Malajálam +Name[ia]=Malayalam +Name[id]=Malayalam +Name[is]=Malajalam +Name[it]=Malayalam +Name[ja]=マラヤーラム語 +Name[ka]=მალაური +Name[kk]=Малайам +Name[km]=ម៉ាឡាយ៉ាឡាម +Name[kn]=ಮಲಯಾಳಂ +Name[ko]=말라얄람어 +Name[ku]=Malayalam +Name[lg]=Lumalaya +Name[lt]=Malayalam +Name[lv]=Malajālama +Name[mai]=मलयालम +Name[mk]=Малајам +Name[ml]=മലയാളം +Name[mr]=मल्यालम +Name[ms]=Malayalam +Name[nb]=Malayalam +Name[nds]=Malayalam +Name[nl]=Malayalam +Name[nn]=Malayalam +Name[oc]=Malayalam +Name[or]=ମାଲାୟାଲମ +Name[pa]=ਮਲਿਆਲਮ +Name[pl]=Malajalam +Name[ps]=ملايالم +Name[pt]=Malayalam +Name[pt_BR]=Malaiala +Name[ro]=Malayalam +Name[ru]=Малайялам +Name[sa]=मलयालम् +Name[se]=Malayalam +Name[si]=මලයාලම් +Name[sk]=Malajálamčina +Name[sl]=Malajalamščina +Name[sr]=малајалам +Name[sr@ijekavian]=малајалам +Name[sr@ijekavianlatin]=malajalam +Name[sr@latin]=malajalam +Name[sv]=Malayalam +Name[ta]=மலையாளம் +Name[te]=మలయాళం +Name[tg]=Малаямӣ +Name[th]=ภาษามะละยาลัม +Name[tr]=Malayalam Dili +Name[tt]=Малаялам +Name[ug]=مالايالامچە +Name[uk]=Малаялам +Name[uz]=Malayalam +Name[uz@cyrillic]=Малайалам +Name[vi]=Tiếng Malayalam +Name[wa]=Malayalam +Name[zh_CN]=马拉雅拉姆语 +Name[zh_TW]=馬拉雅拉姆語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/mr/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/mr/kf6_entry.desktop new file mode 100644 index 0000000000..64f5f8818f --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/mr/kf6_entry.desktop @@ -0,0 +1,89 @@ +[KCM Locale] +Name=Marathi +Name[ar]=الماراثيّة +Name[as]=মৰাঠি +Name[az]=Marathi dilində +Name[be]=Маратхі +Name[be@latin]=Maratchi +Name[bg]=Марати +Name[bn]=মারাঠি +Name[bn_IN]=মারাঠি +Name[bs]=marati +Name[ca]=Marathi +Name[ca@valencia]=Marathi +Name[cs]=Marathi +Name[csb]=Marathi +Name[da]=Marathi +Name[de]=Marathi +Name[el]=Marathi +Name[en_GB]=Marathi +Name[eo]=Marata +Name[es]=Marathi +Name[et]=Marathi +Name[eu]=Marathera +Name[fa]=ماراتی +Name[fi]=Marathi +Name[fr]=Marathe +Name[fy]=Marathi +Name[ga]=Maraitis +Name[gd]=Marathi +Name[gl]=Marathi +Name[gu]=મરાઠી +Name[he]=מראטהית +Name[hi]=मराठी +Name[hne]=मराठी +Name[hr]=marathski +Name[hsb]=Marathi +Name[hu]=Marathi +Name[ia]=Marathi +Name[id]=Marathi +Name[is]=Marathi +Name[it]=Marathi +Name[ja]=マラーティー語 +Name[ka]=მარათი +Name[kk]=Марати +Name[km]=ម៉ារ៉ាទី +Name[kn]=ಮರಾಠಿ +Name[ko]=마라티어 +Name[ku]=Maratî +Name[lg]=Lumarasi +Name[lt]=Marathi +Name[lv]=Marathu +Name[mai]=मराठी +Name[mk]=Марати +Name[ml]=മറാത്തി +Name[mr]=मराठी +Name[ms]=Marathi +Name[nb]=Marathi +Name[nds]=Marathi +Name[nl]=Marathi +Name[nn]=Marathi +Name[oc]=Marati +Name[pa]=ਮਰਾਠੀ +Name[pl]=Marathi +Name[ps]=مراټي +Name[pt]=Marathi +Name[pt_BR]=Marata +Name[ro]=Marathi +Name[ru]=Маратхи +Name[sa]=मराठी +Name[se]=Marathigiella +Name[si]=මරාති +Name[sk]=Maráthčina +Name[sl]=Maratščina +Name[sr]=марати +Name[sr@ijekavian]=марати +Name[sr@ijekavianlatin]=marati +Name[sr@latin]=marati +Name[sv]=Marathi +Name[ta]=மராத்தி +Name[tg]=Маравӣ +Name[th]=ภาษามราฐี +Name[tr]=Marati Dili +Name[tt]=Маратхи +Name[ug]=ماراتىچە +Name[uk]=Мараті +Name[vi]=Tiếng Marathi +Name[wa]=Marati +Name[zh_CN]=马拉地语 +Name[zh_TW]=馬拉提語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ms/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ms/kf6_entry.desktop new file mode 100644 index 0000000000..44fb6f4122 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ms/kf6_entry.desktop @@ -0,0 +1,100 @@ +[KCM Locale] +Name=Malay +Name[af]=Malay +Name[ar]=الماليزيّة +Name[as]=মালাই +Name[ast]=Malayu +Name[az]=Malay dilində +Name[be]=Малайская +Name[be@latin]=Malajskaja +Name[bg]=Малайски +Name[bn]=মালয় +Name[bn_IN]=মালায় +Name[br]=Maya +Name[bs]=malajski +Name[ca]=Malai +Name[ca@valencia]=Malai +Name[cs]=Malajský +Name[csb]=Malajsczi +Name[cy]=Maleieg +Name[da]=Malay +Name[de]=Malaiisch +Name[el]=Μαλέι +Name[en_GB]=Malay +Name[eo]=Malaja +Name[es]=Malayo +Name[et]=Malai +Name[eu]=Malaysiera +Name[fa]=مالایایی +Name[fi]=Malaiji +Name[fr]=Malais +Name[fy]=Maleisk +Name[ga]=Malaeis +Name[gd]=Malaidhis +Name[gl]=Malaio +Name[gu]=મલય +Name[he]=מלאית +Name[hi]=मलय +Name[hne]=मलय +Name[hr]=Malajski +Name[hsb]=Malaisce +Name[hu]=Maláj +Name[ia]=Malay +Name[id]=Malaysia +Name[is]=Malajíska +Name[it]=Malese +Name[ja]=マレー語 +Name[ka]=მალაიური +Name[kk]=Малайша +Name[km]=ម៉ាឡេស៊ី +Name[kn]=ಮಲೇಯ್ +Name[ko]=말레이어 +Name[ku]=Malayî +Name[lb]=Malayesch +Name[lg]=Lumalayi +Name[lt]=Malajų +Name[lv]=Malajiešu +Name[mai]=मलय +Name[mk]=Малајски +Name[ml]=മലയ് +Name[mr]=मलय +Name[ms]=Bahasa Melayu +Name[nb]=Malayisk +Name[nds]=Malaiisch +Name[ne]=मले +Name[nl]=Maleis +Name[nn]=Malayisk +Name[oc]=Malés +Name[or]=ମଳୟ +Name[pa]=ਮਲਾਯੇ +Name[pl]=Malajski +Name[ps]=ملای +Name[pt]=Malaio +Name[pt_BR]=Malaio +Name[ro]=Malaeză +Name[ru]=Малайский +Name[sa]=मलय +Name[se]=Malayagiella +Name[si]=මැලේ +Name[sk]=Malajčina +Name[sl]=Malajščina +Name[sr]=малајски +Name[sr@ijekavian]=малајски +Name[sr@ijekavianlatin]=malajski +Name[sr@latin]=malajski +Name[sv]=Malajiska +Name[ta]=மலாய் +Name[te]=మలయ +Name[tg]=Малаӣ +Name[th]=ภาษามลายู +Name[tr]=Malayca +Name[tt]=Малай +Name[ug]=مالايچە +Name[uk]=Малайська +Name[uz]=Malaycha +Name[uz@cyrillic]=Малайча +Name[vi]=Tiếng Mã Lai +Name[wa]=Malay +Name[zh_CN]=马来语 +Name[zh_HK]=馬來語 +Name[zh_TW]=馬來語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/my/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/my/kf6_entry.desktop new file mode 100644 index 0000000000..9414bc1671 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/my/kf6_entry.desktop @@ -0,0 +1,53 @@ +[KCM Locale] +Name=Burmese +Name[ar]=البورمية +Name[ast]=Birmanu +Name[az]=Birma dili +Name[be]=Бірманская +Name[be@latin]=Birmanskaja +Name[bg]=Бирмански +Name[ca]=Birmà +Name[ca@valencia]=Birmà +Name[cs]=Barmský +Name[da]=Burmesisk +Name[de]=Burmesisch +Name[el]=Βιρμανικά +Name[en_GB]=Burmese +Name[eo]=Birma +Name[es]=Birmano +Name[eu]=Birmaniera +Name[fi]=Burma +Name[fr]=Birman +Name[gl]=Birmano +Name[he]=בורמזית +Name[hi]=बर्मी +Name[hu]=Burmai +Name[ia]=Burmese +Name[id]=Burmese +Name[is]=Búrmneska +Name[it]=Birmano +Name[ka]=ბურმული +Name[ko]=버마어 +Name[lg]=Lubbama +Name[lt]=Birmiečių +Name[lv]=Birmiešu +Name[nb]=Burmesisk +Name[nl]=Burmees +Name[nn]=Burmesisk +Name[pa]=ਬਰਮੀਸੀ +Name[pl]=Birmański +Name[pt]=Birmanês +Name[pt_BR]=Birmanês +Name[ro]=Burmeză +Name[ru]=Бирманский +Name[sa]=बर्मी +Name[sk]=Barmčina +Name[sl]=Burmanščina +Name[sv]=Burmesiska +Name[ta]=பர்மியம் +Name[tr]=Burmaca +Name[ug]=بىرمىچە +Name[uk]=Бірманська +Name[vi]=Tiếng Myanmar +Name[zh_CN]=缅甸语 +Name[zh_TW]=緬甸語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/nb/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/nb/kf6_entry.desktop new file mode 100644 index 0000000000..fa2cd0dd6a --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/nb/kf6_entry.desktop @@ -0,0 +1,100 @@ +[KCM Locale] +Name=Norwegian Bokmål +Name[af]=Noörweese Bokmaal +Name[ar]=النورويجيّة (البوكمال) +Name[as]=ন'ৰ্ৱেইয়ান ব'কমাল +Name[az]=Norveç (ədəbi) dilində +Name[be]=Нарвежская (Букмал) +Name[be@latin]=Narviežskaja (Bukmal) +Name[bg]=Норвежки (букмол) +Name[bn]=নরওয়েজীয় বোকমাল +Name[bn_IN]=নরওয়েজিয়ান বোকমাল +Name[br]=Norvegeg Bokmål +Name[bs]=norveški (književni) +Name[ca]=Noruec bokmål +Name[ca@valencia]=Noruec bokmål +Name[cs]=Norský (Bokmål) +Name[csb]=Norwesczi Bokmål +Name[cy]=Bokmål Norwyeg +Name[da]=Norsk bokmål +Name[de]=Norwegisch (Bokmål) +Name[el]=Νορβηγικά +Name[en_GB]=Norwegian Bokmål +Name[eo]=Norvega (Bokmål) +Name[es]=Noruego Bokmål +Name[et]=Norra Bokmål +Name[eu]=Norvegiera Bokmål +Name[fa]=بوکسمال نروژی +Name[fi]=Norjan bokmål +Name[fr]=Norvégien Bokmål +Name[fy]=Noarsk, Bokmål +Name[ga]=Ioruais (Bokmål) +Name[gd]=Bokmål na Nirribhidh +Name[gl]=Noruegués Bokmål +Name[gu]=નોર્વેયન બોકમલ +Name[he]=נורבגית (בוקמול) +Name[hi]=नार्वेजियाई बोकमाल +Name[hne]=नार्वेजियाई बोकमाल +Name[hr]=Norveški bokmal +Name[hsb]=Norwegsce (Bokmaal) +Name[hu]=Norvég (bokmål) +Name[ia]=Norvegiano Bokmal +Name[id]=Bokmål Norwegia +Name[is]=Norska (bókmál) +Name[it]=Norvegese bokmål +Name[ja]=ノルウェー語 (ブークモール) +Name[ka]=ნორვეგიული ბოკმალი +Name[kk]=Норвег букмалша +Name[km]=ន័រវែស បុកម៉ាល់ +Name[kn]=ನಾರ್ವೇಯಿಯನ್ ಬೋಕ್ಮಾಲ್ +Name[ko]=노르웨이어(보크몰) +Name[ku]=Norwêcî Bokmal +Name[lb]=Norwegesche Bokmål +Name[lg]=Lubokimalo olwa mu Nowe +Name[lt]=Norvegų (Bokmål) +Name[lv]=Norvēģu (būkmols) +Name[mai]=नार्वेजियाई बोकमाल +Name[mk]=Норвешки (Bokmål) +Name[ml]=നോര്‍വീജിയന്‍ ബോക്മാല്‍ +Name[mr]=नार्वेजियन बोर्कमाल +Name[ms]=Norwegian Bokmål +Name[nb]=Norsk (bokmål) +Name[nds]=Norweegsch (Bokmål) +Name[ne]=नर्वेली बोकमाल +Name[nl]=Noors Bokmål +Name[nn]=Norsk (bokmål) +Name[oc]=Norvegian Bokmål +Name[or]=ନରୱେୟିନ ବକମଲ +Name[pa]=ਨੋਰਵੀਗੀਅਨ ਬੋਕਮਾਲ +Name[pl]=Norweski Bokmål +Name[ps]=ناروېجني بوکمل +Name[pt]=Norueguês (Bokmål) +Name[pt_BR]=Dano-norueguês +Name[ro]=Norvegiană Bokmål +Name[ru]=Норвежский (литературный) +Name[sa]=नार्वे भाषा Bokmål +Name[se]=Girjedárogiella +Name[si]=නොර්වෙජියානු බොක්මාල් +Name[sk]=Nórčina (Bokmål) +Name[sl]=Knjižna norveščina +Name[sr]=норвешки (књижевни) +Name[sr@ijekavian]=норвешки (књижевни) +Name[sr@ijekavianlatin]=norveški (književni) +Name[sr@latin]=norveški (književni) +Name[sv]=Norska Bokmål +Name[ta]=நார்வேயின் போக்மால் +Name[te]=నార్విజియన్ బొక్మాల్ +Name[tg]=Норвегиягии Бокмалӣ +Name[th]=ภาษานอร์เวย์ (บ็อคมัล) +Name[tok]=toki Nosiki +Name[tr]=Bokmål Norveççesi +Name[tt]=Норвегия (әдәби) +Name[ug]=نورۋېگىيە بوكمالچە +Name[uk]=Норвезька (Bokmål) +Name[uz]=Norvegcha Bokmaal +Name[uz@cyrillic]=Норвегча Бокмаал +Name[vi]=Tiếng Bokmål Na Uy +Name[wa]=Norvedjin (Bokmål) +Name[zh_CN]=挪威博克马尔语 +Name[zh_HK]=書面挪威語 +Name[zh_TW]=挪威語(博克馬爾語) diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/nds/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/nds/kf6_entry.desktop new file mode 100644 index 0000000000..173240f11e --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/nds/kf6_entry.desktop @@ -0,0 +1,99 @@ +[KCM Locale] +Name=Low Saxon +Name[af]=Lae Saxon +Name[ar]=السّكسونيّة المنخفضة +Name[as]=ল' ছাক্সন +Name[az]=Aşağı Sakson dilində +Name[be]=Ніжнясаксонская +Name[be@latin]=Nižniasaksonskaja +Name[bg]=Долносаксонски +Name[bn]=লো স্যাক্সন +Name[bn_IN]=লো স্যাক্সন +Name[br]=Saozeg izel +Name[bs]=donjosaksonski +Name[ca]=Baix Saxó +Name[ca@valencia]=Baix Saxó +Name[cs]=Dolnosaský +Name[csb]=Dólnosaksońsczi +Name[cy]=Sacsoneg Isel +Name[da]=Nedersaksisk +Name[de]=Niederdeutsch +Name[el]=Κάτω Σαξονικά +Name[en_GB]=Low Saxon +Name[eo]=Malalta saksa +Name[es]=Bajo sajón +Name[et]=Alamsaksi +Name[eu]=Behe saxoiera +Name[fa]=ساکسون سفلی +Name[fi]=Alasaksa +Name[fr]=Bas saxon +Name[fy]=Neder Saksysk +Name[ga]=Sacsainis Íochtarach +Name[gd]=Sagsannais Ìochdarach +Name[gl]=Baixo saxón +Name[gu]=નીચું સેક્સોન +Name[he]=סקסונית תחתית +Name[hi]=लो सेक्सन +Name[hne]=लो सेक्सन +Name[hr]=Donjosaksonski +Name[hsb]=Delnjosaksce +Name[hu]=Alsó-szász +Name[ia]=Basso Saxone +Name[id]=Saxon Rendah +Name[is]=Neðri-saxneska +Name[it]=Basso sassone +Name[ja]=低ザクセン語 +Name[ka]=ქვედა საქსონია +Name[kk]=Төмен саксонша +Name[km]=ឡូសាក់សុង +Name[kn]=ಕೆಳ ಸಾಕ್ಸನ್ +Name[ko]=저지 독일어 +Name[ku]=Saksoniya Jêrîn +Name[lb]=Niddersächsesch +Name[lg]=Oludaaki olw'okumbalama +Name[lt]=Žemutinių saksonų +Name[lv]=Lejasvācu +Name[mai]=लो सेक्सन +Name[mk]=Долно саксонски +Name[ml]=ലോ സാക്സണ്‍ +Name[mr]=लो सॅक्सन +Name[ms]=Low Saxon +Name[nb]=Lavtysk +Name[nds]=Plattdüütsch +Name[ne]=लो सक्सोन +Name[nl]=Nedersaksisch +Name[nn]=Lågtysk +Name[or]=ତଳ ସେସ୍କନ +Name[pa]=ਲੋਵ ਲਵੋਨ +Name[pl]=Dolnosaksoński +Name[ps]=ښکته سېګسن +Name[pt]=Baixo-Saxão +Name[pt_BR]=Baixo Saxão +Name[ro]=Saxonă de jos +Name[ru]=Нижнесаксонский +Name[sa]=निम्न सक्सन +Name[se]=Vuolle sáksalaš +Name[si]=පහල සැක්සන් +Name[sk]=Dolná saština +Name[sl]=Spodnja saščina +Name[sq]=Saksonisht e Ulët +Name[sr]=доњосаксонски +Name[sr@ijekavian]=доњосаксонски +Name[sr@ijekavianlatin]=donjosaksonski +Name[sr@latin]=donjosaksonski +Name[sv]=Lågsaxiska +Name[ta]=லோ சாக்ஸான் +Name[te]=లో సాక్సన్ +Name[tg]=Саксонии Поёнӣ +Name[th]=ภาษาเยอรมัน ระดับล่าง +Name[tr]=Aşağı Saksonca +Name[tt]=Аскы Саксон +Name[ug]=تۆۋەن ساكسونچە +Name[uk]=Нижньосаксонська +Name[uz]=Past Saksoncha +Name[uz@cyrillic]=Паст Саксонча +Name[vi]=Tiếng Hạ Đức +Name[wa]=Bas sacson +Name[zh_CN]=下撒克逊语 +Name[zh_HK]=低地薩克遜語 +Name[zh_TW]=下薩克遜語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ne/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ne/kf6_entry.desktop new file mode 100644 index 0000000000..6631e3dd98 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ne/kf6_entry.desktop @@ -0,0 +1,96 @@ +[KCM Locale] +Name=Nepali +Name[ar]=النّيباليّة +Name[as]=নেপালী +Name[ast]=Nepalés +Name[az]=Nepal dilində +Name[be]=Непальская +Name[be@latin]=Niepaĺskaja +Name[bg]=Непалски +Name[bn]=নেপালী +Name[bn_IN]=নেপালি +Name[br]=Nepaleg +Name[bs]=nepalski +Name[ca]=Nepalès +Name[ca@valencia]=Nepalés +Name[cs]=Nepálský +Name[csb]=Nepali +Name[da]=Nepali +Name[de]=Nepali +Name[el]=Νεπαλέζικα +Name[en_GB]=Nepali +Name[eo]=Nepala +Name[es]=Nepalí +Name[et]=Nepali +Name[eu]=Nepalera +Name[fa]=نپالی +Name[fi]=Nepali +Name[fr]=Népalais +Name[fy]=Nepaleesk +Name[ga]=Neipealais +Name[gd]=Neapàilis +Name[gl]=Nepalí +Name[gu]=નેપાળી +Name[he]=נפאלית +Name[hi]=नेपाली +Name[hne]=नेपाली +Name[hr]=Nepalski +Name[hsb]=Nepalsce +Name[hu]=Nepáli +Name[ia]=Nepali +Name[id]=Nepali +Name[is]=Nepalska +Name[it]=Nepalese +Name[ja]=ネパール語 +Name[ka]=ნეპალური +Name[kk]=Непалша +Name[km]=នេប៉ាល់ +Name[kn]=ನೇಪಾಲಿ +Name[ko]=네팔어 +Name[ku]=Nepalî +Name[lg]=Lunepali +Name[lt]=Nepalo +Name[lv]=Nepāliešu +Name[mai]=नेपाली +Name[mk]=Непалски +Name[ml]=നേപ്പാളി +Name[mr]=नेपाली +Name[ms]=Nepali +Name[nb]=Nepali +Name[nds]=Nepaleesch +Name[ne]=नेपाली +Name[nl]=Nepalees +Name[nn]=Nepali +Name[oc]=Nepali +Name[or]=ନେପାଳି +Name[pa]=ਨੇਪਾਲੀ +Name[pl]=Nepalski +Name[ps]=نيپالي +Name[pt]=Nepalês +Name[pt_BR]=Nepalês +Name[ro]=Nepaleză +Name[ru]=Непальский +Name[sa]=नेपाली +Name[se]=Nepálalaš +Name[si]=නේපාලි +Name[sk]=Nepálčina +Name[sl]=Nepalščina +Name[sr]=непалски +Name[sr@ijekavian]=непалски +Name[sr@ijekavianlatin]=nepalski +Name[sr@latin]=nepalski +Name[sv]=Nepalesiska +Name[ta]=நேபாளி +Name[te]=నెపాలి +Name[tg]=Непалӣ +Name[th]=ภาษาเนปาล +Name[tr]=Nepalce +Name[tt]=Непал +Name[ug]=نېپالچە +Name[uk]=Непальська +Name[uz]=Nepalcha +Name[uz@cyrillic]=Непалча +Name[vi]=Tiếng Nê-pan +Name[wa]=Nepalès +Name[zh_CN]=尼泊尔语 +Name[zh_TW]=尼泊爾語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/nl/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/nl/kf6_entry.desktop new file mode 100644 index 0000000000..41163e207a --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/nl/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Dutch +Name[af]=Hollandse +Name[ar]=الهولنديّة +Name[as]=ডাচ্‌ +Name[ast]=Neerlandés +Name[az]=Holland dilində +Name[be]=Галандская +Name[be@latin]=Halandskaja +Name[bg]=Холандски +Name[bn]=ওলন্দাজ +Name[bn_IN]=ডাচ +Name[br]=Nederlandeg +Name[bs]=holandski +Name[ca]=Neerlandès +Name[ca@valencia]=Neerlandés +Name[cs]=Nizozemský +Name[csb]=Hòlandzczi +Name[cy]=Iseldireg +Name[da]=Hollandsk +Name[de]=Niederländisch +Name[el]=Ολλανδικά +Name[en_GB]=Dutch +Name[eo]=Nederlanda +Name[es]=Holandés +Name[et]=Hollandi +Name[eu]=Nederlandera +Name[fa]=هلندی +Name[fi]=Hollanti +Name[fr]=Hollandais +Name[fy]=Nederlânsk +Name[ga]=Ollainnis +Name[gd]=Duitsis +Name[gl]=Neerlandés +Name[gu]=ડચ +Name[he]=הולנדית +Name[hi]=डच +Name[hne]=डच +Name[hr]=Nizozemski +Name[hsb]=Nižozemsce +Name[hu]=Holland +Name[ia]=Hollandese +Name[id]=Belanda +Name[is]=Hollenska +Name[it]=Neerlandese +Name[ja]=オランダ語 +Name[ka]=ჰოლანდიური +Name[kk]=Нидреландша +Name[km]=ហុល្លង់ +Name[kn]=ಡಚ್ +Name[ko]=네덜란드어 +Name[ku]=Holendî +Name[lb]=Hollännesch +Name[lg]=Luholandi +Name[lt]=Olandų +Name[lv]=Nīderlandiešu +Name[mai]=डच +Name[mk]=Холандски +Name[ml]=ഡച്ച് +Name[mr]=डच +Name[ms]=Belanda +Name[nb]=Nederlandsk +Name[nds]=Nedderlannsch +Name[ne]=डच +Name[nl]=Nederlands +Name[nn]=Nederlandsk +Name[oc]=Olandés +Name[or]=ଡଚ +Name[pa]=ਡੱਚ +Name[pl]=Holenderski +Name[ps]=ډچ +Name[pt]=Holandês +Name[pt_BR]=Holandês +Name[ro]=Olandeză +Name[ru]=Голландский +Name[sa]=डच् +Name[se]=Hollánddagiella +Name[si]=නෙදර්ලන්තානු +Name[sk]=Holandčina +Name[sl]=Nizozemščina +Name[sq]=Holandisht +Name[sr]=холандски +Name[sr@ijekavian]=холандски +Name[sr@ijekavianlatin]=holandski +Name[sr@latin]=holandski +Name[sv]=Holländska +Name[ta]=டச்சு +Name[te]=డచ్ +Name[tg]=Голландӣ +Name[th]=ภาษาดัทช์ +Name[tok]=toki Netelan +Name[tr]=Hollandaca +Name[tt]=Голланд +Name[ug]=گوللاندىيەچە +Name[uk]=Голландська +Name[uz]=Gollandcha +Name[uz@cyrillic]=Голландча +Name[vi]=Tiếng Hà Lan +Name[wa]=Neyerlandès +Name[xh]=Dutch +Name[zh_CN]=荷兰语 +Name[zh_HK]=荷蘭語 +Name[zh_TW]=荷蘭語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/nn/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/nn/kf6_entry.desktop new file mode 100644 index 0000000000..d37b38561a --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/nn/kf6_entry.desktop @@ -0,0 +1,100 @@ +[KCM Locale] +Name=Norwegian Nynorsk +Name[af]=Noörweese Nynorsk +Name[ar]=النرويجيّة (نينورسك) +Name[as]=ন'ৰ্ৱেইয়ান নিন'ৰ্স্ক +Name[az]=Norveç (Nyunorsk) dilində +Name[be]=Нарвежская (нюнорск) +Name[be@latin]=Narviežskaja (niunorsk) +Name[bg]=Норвежки (нюнорск) +Name[bn]=নরওয়েজীয় নিনর্স্ক +Name[bn_IN]=নরওয়েজিয়ান নিনোরস্ক +Name[br]=Norvegeg Nynorsk +Name[bs]=novonorveški +Name[ca]=Noruec nynorsk +Name[ca@valencia]=Noruec nynorsk +Name[cs]=Norský (Nynorsk) +Name[csb]=Norwesczi Nynorsk +Name[cy]=Nynorsk Norwyeg +Name[da]=Nynorsk +Name[de]=Norwegisch (Nynorsk) +Name[el]=Νορβηγικά (Nynorsk) +Name[en_GB]=Norwegian Nynorsk +Name[eo]=Norvega (Nynorsk) +Name[es]=Noruego Nynorsk +Name[et]=Norra Nynorsk +Name[eu]=Norvegiera Nynorsk +Name[fa]=نرس جدید نروژی +Name[fi]=Norja (nynorsk) +Name[fr]=Norvégien Nynorsk +Name[fy]=Noarsk, Nynorsk +Name[ga]=Ioruais (Nynorsk) +Name[gd]=Nynorsk na Nirribhidh +Name[gl]=Noruegués Nynorsk +Name[gu]=નોર્વેયન નોર્સક +Name[he]=נורבגית (נינורשק) +Name[hi]=नारवेजियाई नायनोर्सक +Name[hne]=नारवेजियाई नायनोर्सक +Name[hr]=Norveški nynorsk +Name[hsb]=Norwegsce (Nynorsk) +Name[hu]=Norvég (nynorsk) +Name[ia]=Norvegiano Nynorsk +Name[id]=Nynorsk Norwegia +Name[is]=Norska (nýnorska) +Name[it]=Norvegese nynorsk +Name[ja]=ノルウェー語 (ニーノシュク) +Name[ka]=ნორვეგიული ნიუნორსკი +Name[kk]=Новег нунорскша +Name[km]=ន័រវែស នីនូស +Name[kn]=ನಾರ್ವೇಯಿಯನ್ ನಿನಾರ್ಕ್ +Name[ko]=노르웨이어(뉘노르스크) +Name[ku]=Norwêcî Nynorsk +Name[lb]=Norwegeschen Nynorsk +Name[lg]=Luninoosiki olwa mu Nowe +Name[lt]=Norvegų Nynorsk +Name[lv]=Norvēģu (jaunnorvēģu) +Name[mai]=नार्वेजियन न्योनोर्स्क +Name[mk]=Норвешки (Nynorsk) +Name[ml]=നോര്‍വീജിയന്‍ ന്യോര്‍സ്ക് +Name[mr]=नार्वेजियन नींओर्स्क +Name[ms]=Norwegian Nynorsk +Name[nb]=Norsk (nynorsk) +Name[nds]=Norweegsch (Nynorsk) +Name[ne]=नर्वेली निनोर्स्क +Name[nl]=Noors Nynorsk +Name[nn]=Norsk (nynorsk) +Name[oc]=Nòrvegian (Nynorsk) +Name[or]=ନରୱେୟିନ ନୟନରସ୍କ +Name[pa]=ਨਾਰਵੇਗੀਅਨ ਨਿਉਨੋਰਸਕ +Name[pl]=Norweski Nynorsk +Name[ps]=ناروېجني نېنورسک +Name[pt]=Norueguês (Nynorsk) +Name[pt_BR]=Novo Norueguês +Name[ro]=Norvegiană Nynorsk +Name[ru]=Норвежский (нюнорск) +Name[sa]=नार्वेदेशस्य नायनोर्स्कः +Name[se]=Ođđadárogiella +Name[si]=නොර්වෙජියානු නයිරොක්ස් +Name[sk]=Nórčina (Nynorsk) +Name[sl]=Novonorveščina +Name[sr]=новонорвешки +Name[sr@ijekavian]=новонорвешки +Name[sr@ijekavianlatin]=novonorveški +Name[sr@latin]=novonorveški +Name[sv]=Norska Nynorska +Name[ta]=நார்வேயின் நைநாருஸ்க் +Name[te]=నర్విజియన్ న్యొర్క్స్ +Name[tg]=Норвегиягии Нюнорскӣ +Name[th]=ภาษานอร์เวย์ (นูนอร์สคฺ) +Name[tok]=toki Nosiki sin +Name[tr]=Nynorsk Norveççesi +Name[tt]=Норвегия (Нинорск) +Name[ug]=نورۋېگىيە ناينوركس +Name[uk]=Норвезька (Nynorsk) +Name[uz]=Norvegcha Nynorsk +Name[uz@cyrillic]=Норвегча Нйнорск +Name[vi]=Tiếng Nynorsk Na Uy +Name[wa]=Noû-Norvedjin (Nynorsk) +Name[zh_CN]=挪威尼诺斯克语 +Name[zh_HK]=新挪威語 +Name[zh_TW]=挪威語(尼諾斯克語) diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/oc/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/oc/kf6_entry.desktop new file mode 100644 index 0000000000..d3f1484f1b --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/oc/kf6_entry.desktop @@ -0,0 +1,65 @@ +[KCM Locale] +Name=Occitan +Name[af]=Okkitaan +Name[ar]=الأوكسيتانية +Name[ast]=Occitanu +Name[az]=Oksitan dili +Name[be]=Аксітанская +Name[be@latin]=Aksitanskaja +Name[bg]=Окситански +Name[bn]=ওক্সিটান +Name[br]=Oksitaneg +Name[ca]=Occità +Name[ca@valencia]=Occità +Name[cs]=Okcitánský +Name[cy]=Ocsitaneg +Name[da]=Occitansk +Name[de]=Okzitanisch +Name[el]=Οξιτανικά +Name[en_GB]=Occitan +Name[eo]=Okcitana +Name[es]=Occitano +Name[et]=Oksitaani +Name[eu]=Okzitaniera +Name[fi]=Oksitaani +Name[fr]=Occitan +Name[fy]=Oksitaansk +Name[ga]=Ocatáinis +Name[gl]=Occitano +Name[he]=אוקסיטנית +Name[hi]=ओकितन +Name[hr]=Okitan +Name[hu]=Okszitán +Name[ia]=Occitano +Name[id]=Occitan +Name[is]=Oksítanska +Name[it]=Occitano +Name[ka]=ოციტანი +Name[ko]=오크어 +Name[lb]=Okzitanesch +Name[lg]=Lu-Oki +Name[lt]=Oksitanų +Name[lv]=Oksitāņu +Name[nb]=Oksitansk +Name[nl]=Occitaans +Name[nn]=Oksitansk +Name[pa]=ਓਸੀਟਾਨ +Name[pl]=Okcytański +Name[pt]=Occitano +Name[pt_BR]=Ocitano +Name[ro]=Occitană +Name[ru]=Окситанский +Name[sa]=ओक्सिटन +Name[sk]=Okcitánčina +Name[sl]=Oksitanščina +Name[sv]=Occitanska +Name[ta]=ஒக்சிட்டான் +Name[tr]=Oksitanca +Name[ug]=ئوكتىنچە +Name[uk]=Окситанська +Name[uz]=Ossitancha +Name[uz@cyrillic]=Осситанча +Name[vi]=Tiếng Occitan +Name[xh]=Occitan +Name[zh_CN]=欧西坦语 +Name[zh_TW]=奧克語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/or/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/or/kf6_entry.desktop new file mode 100644 index 0000000000..ba8343fc2c --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/or/kf6_entry.desktop @@ -0,0 +1,88 @@ +[KCM Locale] +Name=Oriya +Name[ar]=الأوريا +Name[as]=ৱৰীয়্য +Name[az]=Oriya dilində +Name[be]=Орыя +Name[be@latin]=Oryja +Name[bg]=Ория +Name[bn_IN]=ওড়িয়া +Name[bs]=orija +Name[ca]=Oriya +Name[ca@valencia]=Oriya +Name[cs]=Urijské +Name[csb]=Oriya +Name[da]=Oriya +Name[de]=Oriya +Name[el]=Ορίγια +Name[en_GB]=Oriya +Name[eo]=Orijo +Name[es]=Oriya +Name[et]=Oria +Name[eu]=Oriya +Name[fa]=اوریا +Name[fi]=Orija +Name[fr]=Oriya +Name[fy]=Oriya +Name[ga]=Oirísis +Name[gd]=Oriya +Name[gl]=Oriya +Name[gu]=ઓરિયા +Name[he]=אורייה +Name[hi]=उडिया +Name[hne]=उड़िया +Name[hr]=Oriyanski +Name[hsb]=Oriya +Name[hu]=Orija +Name[ia]=Oriya +Name[id]=Oriya +Name[is]=Oriya +Name[it]=Oriya +Name[ja]=オリヤー語 +Name[ka]=ორია +Name[kk]=Ория +Name[km]=អូរីយ៉ា +Name[kn]=ಒರಿಯಾ +Name[ko]=오리야어 +Name[ku]=Zimanê Oriya +Name[lg]=Lu-Oriya +Name[lt]=Orija +Name[lv]=Oriju +Name[mai]=उड़िया +Name[mk]=Орија +Name[ml]=ഒറിയ +Name[mr]=ओरिया +Name[ms]=Oriya +Name[nb]=Oriya +Name[nds]=Oriya +Name[nl]=Oriya +Name[nn]=Oriya +Name[oc]=Oriyà +Name[pa]=ਓੜੀਆ +Name[pl]=Orija +Name[ps]=وريا +Name[pt]=Oriya +Name[pt_BR]=Oriá +Name[ro]=Oriya +Name[ru]=Ория +Name[sa]=ओरिया +Name[se]=Orijagiella +Name[si]=ඔරියා +Name[sk]=Uríjčina +Name[sl]=Orijščina +Name[sr]=орија +Name[sr@ijekavian]=орија +Name[sr@ijekavianlatin]=orija +Name[sr@latin]=orija +Name[sv]=Oriya +Name[ta]=ஒரியா +Name[tg]=Ориёӣ +Name[th]=ภาษาโอริยา +Name[tr]=Oriya Dili +Name[tt]=Ория +Name[ug]=ئورىياچە +Name[uk]=Орія +Name[vi]=Tiếng Oriya +Name[wa]=Oriya +Name[zh_CN]=奥里雅语 +Name[zh_TW]=歐利亞語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/pa/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/pa/kf6_entry.desktop new file mode 100644 index 0000000000..9e623b105a --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/pa/kf6_entry.desktop @@ -0,0 +1,100 @@ +[KCM Locale] +Name=Punjabi +Name[af]=Punjabi +Name[ar]=البنجابيّة +Name[as]=পাঞ্জাবী +Name[az]=Pəncab dilində +Name[be]=Панджабі +Name[be@latin]=Pandžabi +Name[bg]=Панджаби +Name[bn]=পাঞ্জাবী +Name[bn_IN]=পাঞ্জাবি +Name[br]=Punjabi +Name[bs]=pandžabi +Name[ca]=Panjabi +Name[ca@valencia]=Panjabi +Name[cs]=Pandžábský +Name[csb]=Pendżabsczi +Name[cy]=Punjabi +Name[da]=Punjabi +Name[de]=Punjabi +Name[el]=Αραβικά +Name[en_GB]=Punjabi +Name[eo]=Panĝaba +Name[es]=Punjabí +Name[et]=Pandžabi +Name[eu]=Punjabera +Name[fa]=پنجابی +Name[fi]=Pandžabi +Name[fr]=Pendjabi +Name[fy]=Punjabysk +Name[ga]=Painseáibis +Name[gd]=Panjabi +Name[gl]=Punjabi +Name[gu]=પંજાબી +Name[he]=פנג׳בית +Name[hi]=पंजाबी +Name[hne]=पंजाबी +Name[hr]=Pandžabski +Name[hsb]=Pandźabsce +Name[hu]=Pandzsabi +Name[ia]=Punjabi +Name[id]=Punjabi +Name[is]=Punjabi +Name[it]=Panjabi +Name[ja]=パンジャーブ語 +Name[ka]=პანჯაბი +Name[kk]=Панджаби +Name[km]=ពូនយ៉ាប៊ី +Name[kn]=ಪಂಜಾಬಿ +Name[ko]=펀자브어 +Name[ku]=Pêncabî +Name[lb]=Pandjabi +Name[lg]=Lupunjabi +Name[lt]=Pundžabi +Name[lv]=Pendžābu +Name[mai]=पंजाबी +Name[mk]=Пунџаби +Name[ml]=പഞ്ചാബി +Name[mr]=पंजाबी +Name[ms]=Punjabi +Name[nb]=Punjabi +Name[nds]=Pandschaabsch +Name[ne]=पन्जाबी +Name[nl]=Punjabi +Name[nn]=Panjabi +Name[oc]=Punjabi +Name[or]=ପଞ୍ଜାବି +Name[pa]=ਪੰਜਾਬੀ +Name[pl]=Pundżabi +Name[ps]=پنجابي +Name[pt]=Punjabi +Name[pt_BR]=Panjabi +Name[ro]=Punjabi +Name[ru]=Панджаби +Name[sa]=पंजाबी +Name[se]=Punjabi +Name[si]=පන්ජාබි +Name[sk]=Pandžábčina +Name[sl]=Pandžabščina +Name[sq]=Punxhabisht +Name[sr]=панџаби +Name[sr@ijekavian]=панџаби +Name[sr@ijekavianlatin]=pandžabi +Name[sr@latin]=pandžabi +Name[sv]=Punjabi +Name[ta]=பஞ்சாபி +Name[te]=పంజాబి +Name[tg]=Панҷобӣ +Name[th]=ภาษาปัญจาบี +Name[tr]=Pencapça +Name[tt]=Пәнҗәби +Name[ug]=پەنجابچە +Name[uk]=Панджабі +Name[uz]=Panjabcha +Name[uz@cyrillic]=Панжабча +Name[vi]=Tiếng Punjab +Name[wa]=Pundjabi +Name[zh_CN]=旁遮普语 +Name[zh_HK]=旁遮普語 +Name[zh_TW]=旁遮普語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/pl/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/pl/kf6_entry.desktop new file mode 100644 index 0000000000..8442aa4608 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/pl/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Polish +Name[af]=Poolse +Name[ar]=البولنديّة +Name[as]=প'লিশ্ব +Name[ast]=Polacu +Name[az]=Polyak dilində +Name[be]=Польская +Name[be@latin]=Poĺskaja +Name[bg]=Полски +Name[bn]=পোলিশ +Name[bn_IN]=পোলিশ +Name[br]=Poloneg +Name[bs]=poljski +Name[ca]=Polonès +Name[ca@valencia]=Polonés +Name[cs]=Polský +Name[csb]=Pòlsczi +Name[cy]=Poleg +Name[da]=Polsk +Name[de]=Polnisch +Name[el]=Πολωνικά +Name[en_GB]=Polish +Name[eo]=Pola +Name[es]=Polaco +Name[et]=Poola +Name[eu]=Poloniera +Name[fa]=لهستانی +Name[fi]=Puola +Name[fr]=Polonais +Name[fy]=Poalsk +Name[ga]=Polainnis +Name[gd]=Pòlainnis +Name[gl]=Polaco +Name[gu]=પોલિશ +Name[he]=פולנית +Name[hi]=पोलिश +Name[hne]=पोलिस +Name[hr]=Poljski +Name[hsb]=Pólsce +Name[hu]=Lengyel +Name[ia]=Polonese +Name[id]=Polandia +Name[is]=Pólska +Name[it]=Polacco +Name[ja]=ポーランド語 +Name[ka]=პოლონური +Name[kk]=Полякша +Name[km]=ប៉ូឡូញ +Name[kn]=ಪೋಲಿಷ್ +Name[ko]=폴란드어 +Name[ku]=Polî +Name[lb]=Polnesch +Name[lg]=Lupolandi +Name[lt]=Lenkų +Name[lv]=Poļu +Name[mai]=पोलिश +Name[mk]=Полски +Name[ml]=പോളിഷ് +Name[mr]=पोलिश +Name[ms]=Polish +Name[nb]=Polsk +Name[nds]=Poolsch +Name[ne]=पोलिस +Name[nl]=Pools +Name[nn]=Polsk +Name[oc]=Polonés +Name[or]=ପୋଲିସ +Name[pa]=ਪੋਲੈਂਡੀ +Name[pl]=Polski +Name[ps]=پولېش +Name[pt]=Polaco +Name[pt_BR]=Polonês +Name[ro]=Poloneză +Name[ru]=Польский +Name[sa]=पोलिश +Name[se]=Polskkagiella +Name[si]=පෝලන්තානු +Name[sk]=Poľština +Name[sl]=Poljščina +Name[sq]=Polonisht +Name[sr]=пољски +Name[sr@ijekavian]=пољски +Name[sr@ijekavianlatin]=poljski +Name[sr@latin]=poljski +Name[sv]=Polska +Name[ta]=போலிஷ் +Name[te]=పొలిష్ +Name[tg]=Полякӣ +Name[th]=ภาษาโปแลนด์ +Name[tok]=toki Posuki +Name[tr]=Lehçe +Name[tt]=Польша +Name[ug]=پولەكچە +Name[uk]=Польська +Name[uz]=Polyakcha +Name[uz@cyrillic]=Полякча +Name[vi]=Tiếng Ba Lan +Name[wa]=Polonès +Name[xh]=Polish +Name[zh_CN]=波兰语 +Name[zh_HK]=波蘭語 +Name[zh_TW]=波蘭語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ps/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ps/kf6_entry.desktop new file mode 100644 index 0000000000..1fa4426dc9 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ps/kf6_entry.desktop @@ -0,0 +1,86 @@ +[KCM Locale] +Name=Pashto +Name[ar]=الباشتو +Name[as]=পাশ্‌টো +Name[az]=Puştu dilində +Name[be]=Пушту +Name[be@latin]=Puštu +Name[bg]=Пащо +Name[bn_IN]=পুস্তু +Name[bs]=paštunski +Name[ca]=Paixtu +Name[ca@valencia]=Paixtu +Name[cs]=Pashto +Name[csb]=Paszto +Name[da]=Pashto +Name[de]=Pashtu +Name[el]=Πάστο +Name[en_GB]=Pashto +Name[eo]=Pashto +Name[es]=Pastún +Name[et]=Puštu +Name[eu]=Paxtunera +Name[fa]=پشتو +Name[fi]=Paštu +Name[fr]=Pashto +Name[fy]=Pashto +Name[ga]=Paistis +Name[gd]=Pachtu +Name[gl]=Pashto +Name[gu]=પાશ્તો +Name[he]=פשטו +Name[hi]=पशतो +Name[hne]=पस्तो +Name[hr]=Pashto +Name[hsb]=Pašto +Name[hu]=Pastu +Name[ia]=Pashto +Name[id]=Pashto +Name[is]=Pastó +Name[it]=Pashtu +Name[ja]=パシュトー語 +Name[ka]=პაშტო +Name[kk]=Пушту +Name[km]=ប៉ាស្តូ +Name[kn]=ಪಶ್ತೋ +Name[ko]=파슈토어 +Name[ku]=Zimanê Pashto +Name[lg]=Lupasito +Name[lt]=Puštūnų +Name[lv]=Puštu +Name[mai]=पश्तो +Name[mk]=Пашто +Name[ml]=പാഷ്ടോ +Name[mr]=पश्तो +Name[nb]=Pasjto +Name[nds]=Paschtuunsch +Name[nl]=Pashto +Name[nn]=Pashto +Name[pa]=ਪੁਸ਼ਤੋ +Name[pl]=Paszto +Name[ps]=پښتو +Name[pt]=Pashto +Name[pt_BR]=Pachto +Name[ro]=Pashto +Name[ru]=Пуштунский +Name[sa]=पश्तो +Name[se]=Paštogiella +Name[si]=පශ්ටෝ +Name[sk]=Paštčina +Name[sl]=Paštunščina +Name[sr]=паштунски +Name[sr@ijekavian]=паштунски +Name[sr@ijekavianlatin]=paštunski +Name[sr@latin]=paštunski +Name[sv]=Pashto +Name[ta]=பாஷ்தோ +Name[tg]=Пушту +Name[th]=ภาษาปาชโท +Name[tr]=Peştuca +Name[tt]=Пашто +Name[ug]=پاشتۇچە +Name[uk]=Пушту +Name[vi]=Tiếng Pashtun +Name[wa]=Pashto +Name[zh_CN]=普什图语 +Name[zh_TW]=普什圖語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/pt/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/pt/kf6_entry.desktop new file mode 100644 index 0000000000..c369cd31e5 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/pt/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Portuguese +Name[af]=Portugese +Name[ar]=البرتغاليّة +Name[as]=প'ৰ্টুগিছ্‌ +Name[ast]=Portugués +Name[az]=Portuqal dilində +Name[be]=Партугальская +Name[be@latin]=Partuhaĺskaja +Name[bg]=Португалски +Name[bn]=পর্তুগীজ +Name[bn_IN]=পোর্তুগিজ +Name[br]=Portugaleg +Name[bs]=portugalski +Name[ca]=Portuguès +Name[ca@valencia]=Portugués +Name[cs]=Portugalský +Name[csb]=Pòrtugalsczi +Name[cy]=Portiwgaleg +Name[da]=Portugisisk +Name[de]=Portugiesisch +Name[el]=Πορτογαλικά +Name[en_GB]=Portuguese +Name[eo]=Portugala +Name[es]=Portugués +Name[et]=Portugali +Name[eu]=Portugesa +Name[fa]=پرتغالی +Name[fi]=Portugali +Name[fr]=Portugais +Name[fy]=Portugeesk +Name[ga]=Portaingéilis +Name[gd]=Portagailis +Name[gl]=Portugués +Name[gu]=પોર્ટુગીઝ +Name[he]=פורטוגלית +Name[hi]=पुर्तगाली +Name[hne]=पुर्तगाली +Name[hr]=Portugalski +Name[hsb]=Portugalsce +Name[hu]=Portugál +Name[ia]=Portugese +Name[id]=Portugis +Name[is]=Portúgalska +Name[it]=Portoghese +Name[ja]=ポルトガル語 +Name[ka]=პორტუგალიური +Name[kk]=Португалша +Name[km]=ព័រទុយហ្គាល់ +Name[kn]=ಪೋರ್ಚುಗೀಸ್ +Name[ko]=포르투갈어 +Name[ku]=Portûgalî +Name[lb]=Portugisesch +Name[lg]=Lupotugesi +Name[lt]=Portugalų +Name[lv]=Portugāļu +Name[mai]=पुर्तगाली +Name[mk]=Португалски +Name[ml]=പോര്‍ച്ചുഗീസ് +Name[mr]=पोर्तुगीज +Name[ms]=Portugis +Name[nb]=Portugisisk +Name[nds]=Portugeesch +Name[ne]=पोर्तुगाली +Name[nl]=Portugees +Name[nn]=Portugisisk +Name[oc]=Portugués +Name[or]=ପର୍ତ୍ତୁଗିଜ +Name[pa]=ਪੁਰਤਗਾਲੀ +Name[pl]=Portugalski +Name[ps]=پورټګيز +Name[pt]=Português +Name[pt_BR]=Português +Name[ro]=Portugheză +Name[ru]=Португальский +Name[sa]=पुर्तगाली +Name[se]=Portugálagiella +Name[si]=පෘතුගීසි +Name[sk]=Portugalčina +Name[sl]=Portugalščina +Name[sq]=Portugalisht +Name[sr]=португалски +Name[sr@ijekavian]=португалски +Name[sr@ijekavianlatin]=portugalski +Name[sr@latin]=portugalski +Name[sv]=Portugisiska +Name[ta]=போர்த்துக்கீசிய +Name[te]=పొర్ట్యుగీస్ +Name[tg]=Португалӣ +Name[th]=ภาษาโปรตุเกส +Name[tok]=toki Potuke +Name[tr]=Portekizce +Name[tt]=Португал +Name[ug]=پورتۇگالچە +Name[uk]=Португальська +Name[uz]=Portugalcha +Name[uz@cyrillic]=Португалча +Name[vi]=Tiếng Bồ Đào Nha +Name[wa]=Portuguès +Name[xh]=Portuguese +Name[zh_CN]=葡萄牙语 +Name[zh_HK]=葡萄牙語 +Name[zh_TW]=葡萄牙語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/pt_BR/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/pt_BR/kf6_entry.desktop new file mode 100644 index 0000000000..2f4282d896 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/pt_BR/kf6_entry.desktop @@ -0,0 +1,102 @@ +[KCM Locale] +Name=Brazil portuguese +Name[af]=Brazilië portugese +Name[ar]=برتغاليّة البرازيل +Name[as]=ব্ৰাজীলিয় প'ৰ্টুগিছ্ +Name[ast]=Portugués (Brasil) +Name[az]=Portuqal (Braziliya) dilində +Name[be]=Партугальская (Бразілія) +Name[be@latin]=Partuhaĺskaja (Brazilija) +Name[bg]=Португалски (Бразилия) +Name[bn]=ব্রাজিল পর্তুগীজ +Name[bn_IN]=ব্রাজিলিয়ান পোর্তুগিজ +Name[br]=Portugaleg Brazil +Name[bs]=brazilski potugalski +Name[ca]=Portuguès del Brasil +Name[ca@valencia]=Portugués del Brasil +Name[cs]=Brazilská portugalština +Name[csb]=Brazylsczi pòrtugalsczi +Name[cy]=Portiwgaleg Brasil +Name[da]=Brasiliansk portugisisk +Name[de]=Brasilianisches Portugiesisch +Name[el]=Πορτογαλικά Βραζιλίας +Name[en_GB]=Brazil portuguese +Name[eo]=Brazila portugala +Name[es]=Portugués de Brasil +Name[et]=Brasiilia portugali +Name[eu]=Brasilgoa portugesa +Name[fa]=پرتغالی برزیلی +Name[fi]=Brasilianportugali +Name[fr]=Portugais brésilien +Name[fy]=Brasiliaansk Portugeesk +Name[ga]=Portaingéilis na Brasaíle +Name[gd]=Portagailis Bhraisileach +Name[gl]=Portugués do brasil +Name[gu]=બ્રાઝિલ પોર્ટુગીઝ +Name[he]=פורטוגלית ברזילאית +Name[hi]=ब्राजील पुर्तगाली +Name[hne]=ब्राजील पुर्तगाली +Name[hr]=Brazilski portugalski +Name[hsb]=Portugalsce (w Brazilskej) +Name[hu]=Brazil portugál +Name[ia]=Portugese Brasilian +Name[id]=Brasil portugis +Name[is]=Brasilísk portúgalska +Name[it]=Portoghese brasiliano +Name[ja]=ブラジル ポルトガル語 +Name[ka]=ბრაზილიური პორტუგალიური +Name[kk]=Бразилияның португалша +Name[km]=ប្រេស៊ីល ព័រទុយហ្គាល់ +Name[kn]=ಬ್ರೆಜಿಲಿಯನ್ ಪೋರ್ಚುಗೀಸ್ +Name[ko]=포르투갈어(브라질) +Name[ku]=Portûgaliya Brezîl +Name[lb]=Brasilianescht Portugisesch +Name[lg]=Lupotugesi olwa mu Buraziri +Name[lt]=Brazilijos portugalų +Name[lv]=Brazīlijas portugāļu +Name[mai]=ब्राजील पुर्तगाली +Name[mk]=Бразилски португалски +Name[ml]=ബ്രസീലിലെ പോര്‍ച്ചുഗീസ് +Name[mr]=ब्राझील पोर्तुगीज +Name[ms]=Portugis Brazil +Name[nb]=Portugisisk (Brasil) +Name[nds]=Brasiliaansch Portugeesch +Name[ne]=ब्राजिल पोर्तुगाली +Name[nl]=Braziliaans Portugees +Name[nn]=Portugisisk (Brasil) +Name[or]=ବ୍ରାଜିଲ ପର୍ତ୍ତୁଗିଜ +Name[pa]=ਬਰਾਜ਼ੀਲ ਪੁਰਤਗਾਲੀ +Name[pl]=Brazylijski portugalski +Name[ps]=برازيلي پورټګيز +Name[pt]=Português do Brasil +Name[pt_BR]=Português brasileiro +Name[ro]=Portugheză braziliană +Name[ru]=Португальский (Бразилия) +Name[sa]=ब्राजील पुर्तगाली +Name[se]=Brasilialaš portugálagiella +Name[si]=බ්‍රසීල පෘතුගීසි +Name[sk]=Portugalčina (Brazília) +Name[sl]=Portugalščina (Brazilija) +Name[sq]=Portugalisht e Brazilit +Name[sr]=бразилски потугалски +Name[sr@ijekavian]=бразилски потугалски +Name[sr@ijekavianlatin]=brazilski potugalski +Name[sr@latin]=brazilski potugalski +Name[sv]=Brasiliansk portugisiska +Name[ta]=பிரேசில் போர்த்துகீசிய +Name[te]=బ్రాజిల్ పొర్ట్యుగీస్ +Name[tg]=Бразилиягии португалӣ +Name[th]=ภาษาโปรตุเกสบราซิล +Name[tok]=toki Potuke pi ma Pasiju +Name[tr]=Brezilya Portekizcesi +Name[tt]=Португал (Бразилия) +Name[ug]=بىرازىلىيە پورتۇگالچىسى +Name[uk]=Бразильська португальська +Name[uz]=Brazil portugalcha +Name[uz@cyrillic]=Бразил португалча +Name[vi]=Tiếng Bồ Đào Nha Brazil +Name[wa]=Portuguès do Braezi +Name[xh]=Brazil portuguese +Name[zh_CN]=巴西葡萄牙语 +Name[zh_HK]=巴西葡萄牙語 +Name[zh_TW]=巴西葡萄牙語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ro/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ro/kf6_entry.desktop new file mode 100644 index 0000000000..709eaa3997 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ro/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Romanian +Name[af]=Romeense +Name[ar]=الرّومانيّة +Name[as]=ৰোমানীয় +Name[ast]=Rumanu +Name[az]=Rumun dilində +Name[be]=Румынская +Name[be@latin]=Rumynskaja +Name[bg]=Румънски +Name[bn]=রোমানীয় +Name[bn_IN]=রোমেনিয়ান +Name[br]=Roumaneg +Name[bs]=rumunski +Name[ca]=Romanès +Name[ca@valencia]=Romanés +Name[cs]=Rumunský +Name[csb]=Rumùńsczi +Name[cy]=Romaneg +Name[da]=Rumænsk +Name[de]=Rumänisch +Name[el]=Ρουμανικά +Name[en_GB]=Romanian +Name[eo]=Rumana +Name[es]=Rumano +Name[et]=Rumeenia +Name[eu]=Errumaniera +Name[fa]=رومانیایی +Name[fi]=Romania +Name[fr]=Roumain +Name[fy]=Roemeensk +Name[ga]=Rómáinis +Name[gd]=Romàinis +Name[gl]=Romanés +Name[gu]=રોમેનિયન +Name[he]=רומנית +Name[hi]=रोमानियाई +Name[hne]=रोमानियाई +Name[hr]=Rumunjski +Name[hsb]=Rumunsce +Name[hu]=Román +Name[ia]=Romaniano +Name[id]=Rumania +Name[is]=Rúmenska +Name[it]=Rumeno +Name[ja]=ルーマニア語 +Name[ka]=რუმინული +Name[kk]=Румынша +Name[km]=រូម៉ានី +Name[kn]=ರೊಮೇನಿಯನ್ +Name[ko]=루마니아어 +Name[ku]=Romanî +Name[lb]=Rumänesch +Name[lg]=Luromaniya +Name[lt]=Rumunų +Name[lv]=Rumāņu +Name[mai]=रोमानियाइ +Name[mk]=Романски +Name[ml]=റൊമേനിയന്‍ +Name[mr]=रोमानियन +Name[ms]=Romania +Name[nb]=Rumensk +Name[nds]=Rumäänsch +Name[ne]=रोमानियाली +Name[nl]=Roemeens +Name[nn]=Rumensk +Name[oc]=Romanian +Name[or]=ରୋମାନିୟନ +Name[pa]=ਰੋਮਾਨੀਆਈ +Name[pl]=Rumuński +Name[ps]=رومانيايي +Name[pt]=Romeno +Name[pt_BR]=Romeno +Name[ro]=Română +Name[ru]=Румынский +Name[sa]=रोमानियाई +Name[se]=Romániagiella +Name[si]=රොමේනියානු +Name[sk]=Rumunčina +Name[sl]=Romunščina +Name[sq]=Rumanisht +Name[sr]=румунски +Name[sr@ijekavian]=румунски +Name[sr@ijekavianlatin]=rumunski +Name[sr@latin]=rumunski +Name[sv]=Rumänska +Name[ta]=ருமேனியம் +Name[te]=రొమెనియన్ +Name[tg]=Руминӣ +Name[th]=ภาษาโรมาเนีย +Name[tok]=toki Lomuno +Name[tr]=Rumence +Name[tt]=Румын +Name[ug]=رۇمىنچە +Name[uk]=Румунська +Name[uz]=Rumincha +Name[uz@cyrillic]=Руминча +Name[vi]=Tiếng Ru-ma-ni +Name[wa]=Roumin +Name[xh]=Romanian +Name[zh_CN]=罗马尼亚语 +Name[zh_HK]=羅馬尼亞語 +Name[zh_TW]=羅馬尼亞語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ru/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ru/kf6_entry.desktop new file mode 100644 index 0000000000..d8dbf5bc27 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ru/kf6_entry.desktop @@ -0,0 +1,105 @@ +[KCM Locale] +Name=Russian +Name[af]=Russiese +Name[ar]=الرّوسيّة +Name[as]=ৰুচীয় +Name[ast]=Rusu +Name[az]=Rus dilində +Name[be]=Расійская +Name[be@latin]=Rasijskaja +Name[bg]=Руски +Name[bn]=রুশ +Name[bn_IN]=রুশি +Name[br]=Rusianeg +Name[bs]=ruski +Name[ca]=Rus +Name[ca@valencia]=Rus +Name[cs]=Ruský +Name[csb]=Rusczi +Name[cy]=Rwsieg +Name[da]=Russisk +Name[de]=Russisch +Name[el]=Ρωσικά +Name[en_GB]=Russian +Name[eo]=Rusa +Name[es]=Ruso +Name[et]=Vene +Name[eu]=Errusiera +Name[fa]=روسی +Name[fi]=Venäjä +Name[fr]=Russe +Name[fy]=Russysk +Name[ga]=Rúisis +Name[gd]=Ruisis +Name[gl]=Ruso +Name[gu]=રશિયન +Name[he]=רוסית +Name[hi]=रूसी +Name[hne]=रूसी +Name[hr]=Ruski +Name[hsb]=Rusce +Name[hu]=Orosz +Name[ia]=Russo +Name[id]=Rusia +Name[is]=Rússneska +Name[it]=Russo +Name[ja]=ロシア語 +Name[ka]=რუსული +Name[kk]=Орысша +Name[km]=រុស្សី +Name[kn]=ರಷಿಯನ್ +Name[ko]=러시아어 +Name[ku]=Rûsî +Name[lb]=Russesch +Name[lg]=Lulasa +Name[lt]=Rusų +Name[lv]=Krievu +Name[mai]=रूसी +Name[mk]=Руски +Name[ml]=റഷ്യന്‍ +Name[mr]=रूसी +Name[ms]=Russia +Name[nb]=Russisk +Name[nds]=Russ'sch +Name[ne]=रसियाली +Name[nl]=Russisch +Name[nn]=Russisk +Name[oc]=Rus +Name[or]=ରୁସିୟାନ +Name[pa]=ਰੂਸੀ +Name[pl]=Rosyjski +Name[ps]=روسي +Name[pt]=Russo +Name[pt_BR]=Russo +Name[ro]=Rusă +Name[ru]=Русский +Name[sa]=रूसी +Name[se]=Ruoššagiella +Name[si]=රුසියානු +Name[sk]=Ruština +Name[sl]=Ruščina +Name[sq]=Rusisht +Name[sr]=руски +Name[sr@ijekavian]=руски +Name[sr@ijekavianlatin]=ruski +Name[sr@latin]=ruski +Name[sv]=Ryska +Name[ta]=ரஷ்யம் +Name[te]=రష్యన్ +Name[tg]=Русӣ +Name[th]=ภาษารัสเซีย +Name[tok]=toki Losi +Name[tr]=Rusça +Name[tt]=Рус +Name[ug]=رۇسچە +Name[uk]=Російська +Name[uz]=Ruscha +Name[uz@cyrillic]=Русча +Name[vi]=Tiếng Nga +Name[wa]=Rûsse +Name[xh]=Russian +Name[zh_CN]=俄语 +Name[zh_HK]=俄語 +Name[zh_TW]=俄語 +DateMonthNamePossessive=true +NounDeclension=true diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/se/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/se/kf6_entry.desktop new file mode 100644 index 0000000000..3ca707507e --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/se/kf6_entry.desktop @@ -0,0 +1,102 @@ +[KCM Locale] +Name=Northern Sami +Name[af]=Noord Sami +Name[ar]=السّاميّة الشّمالية +Name[as]=ন'ৰ্দাৰ্ণ চামি +Name[az]=Şimali Sami dilində +Name[be]=Паўночная самі +Name[be@latin]=Paŭnočnaja sami +Name[bg]=Северен Сами +Name[bn]=উত্তর সামি +Name[bn_IN]=উত্তর সামি +Name[br]=Sami, Norzh +Name[bs]=sjeverni sami +Name[ca]=Sami septentrional +Name[ca@valencia]=Sami septentrional +Name[cs]=Severní Sami +Name[csb]=Nordowi Sami +Name[cy]=Sami Gogleddol +Name[da]=Nordsamisk +Name[de]=Nordsamisch +Name[el]=Βόρεια Σάμι +Name[en_GB]=Northern Sami +Name[eo]=Norda samea +Name[es]=Sami del norte +Name[et]=Põhjasaami +Name[eu]=Ipar samiera +Name[fa]=سامی شمالی +Name[fi]=Pohjoissaame +Name[fr]=Sami du nord +Name[fy]=Noard-Koreaansk +Name[ga]=Sáimis Thuaidh +Name[gd]=Sàmais Thuathach +Name[gl]=Sami do norte +Name[gu]=ઉત્તરી સામી +Name[he]=סאמית צפונית +Name[hi]=उत्तरी सामी +Name[hne]=उत्तरी सामी +Name[hr]=Sjeverni Sami +Name[hsb]=Sewjernosamisce +Name[hu]=Északi szami +Name[ia]=Sami Septentrional +Name[id]=Sami Utara +Name[is]=Norðursamíska +Name[it]=Sami settentrionale +Name[ja]=北サーミ語 +Name[ka]=ჩრდილო-საამური +Name[kk]=Солтүстік саами +Name[km]=សាមី ខាង​ជើង +Name[kn]=ಉತ್ತರ ಸಾಮೀ +Name[ko]=북부 사미어 +Name[ku]=Samiya Bakûrî +Name[lb]=Nördlecht Sawi +Name[lg]=Olusaami olw'omumambuka +Name[lt]=Šiaurės Sami +Name[lv]=Ziemeļsāmu +Name[mai]=उत्तरी सामी +Name[mk]=Северен Сами +Name[ml]=നോര്‍‌ത്തേണ്‍ സാമി +Name[mr]=उत्तरी सामी +Name[ms]=Sami Utara +Name[nb]=Nordsamisk +Name[nds]=Noord-Saamsch +Name[ne]=उत्तरी सामी +Name[nl]=Noord-Sami +Name[nn]=Nordsamisk +Name[or]=ଉତ୍ତରି ସାମି +Name[pa]=ਉੱਤਰੀ ਸਾਮੀ +Name[pl]=Północny Sami +Name[ps]=شمالي سامي +Name[pt]=Sami do Norte +Name[pt_BR]=Sami setentrional +Name[ro]=Sami de Nord +Name[ru]=Северносаамский +Name[sa]=उत्तर सामी +Name[se]=Davvisámegiella +Name[si]=උතුරු සැමි +Name[sk]=Lapončina (severná) +Name[sl]=Severna samijščina +Name[sr]=северни сами +Name[sr@ijekavian]=сјеверни сами +Name[sr@ijekavianlatin]=sjeverni sami +Name[sr@latin]=severni sami +Name[sv]=Samiska +Name[ta]=நார்தன் சாமி +Name[te]=ఉత్తర సమి +Name[tg]=Ирландии Самӣ +Name[th]=ภาษาซามิตอนเหนือ +Name[tr]=Kuzey Laponcası +Name[tt]=Төньяк Саами +Name[ug]=شىمالىي سامىچە +Name[uk]=Північне Саамі +Name[uz]=Shimoliy Saamicha +Name[uz@cyrillic]=Шимолий Саамича +Name[vi]=Tiếng Bắc Sami +Name[wa]=Bijhe såmi +Name[xh]=Northern Sami +Name[zh_CN]=北萨米语 +Name[zh_HK]=北薩米語 +Name[zh_TW]=北拉普語 +Region=northeurope +DateMonthNamePossessive=true +NounDeclension=true diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/si/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/si/kf6_entry.desktop new file mode 100644 index 0000000000..8fb7301549 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/si/kf6_entry.desktop @@ -0,0 +1,82 @@ +[KCM Locale] +Name=Sinhala +Name[ar]=الصّنهاليّة +Name[ast]=Cingalés +Name[az]=Sinhala dilində +Name[be]=Сінгальская +Name[be@latin]=Sinhaĺskaja +Name[bg]=Синхалски +Name[bs]=sinhaleski +Name[ca]=Singalès +Name[ca@valencia]=Singalés +Name[cs]=Sinhalský +Name[csb]=Sinhala +Name[da]=Sinhala +Name[de]=Singhalesisch +Name[el]=Σινχάλα +Name[en_GB]=Sinhala +Name[eo]=Sinhala +Name[es]=Cingalés +Name[et]=Singali +Name[eu]=Sinhala +Name[fa]=سینهالا +Name[fi]=Sinhala +Name[fr]=Cinghalais +Name[fy]=Sinhala +Name[ga]=Siolóinis +Name[gd]=Sinhala +Name[gl]=Cingalés +Name[gu]=સિંહાલા +Name[he]=סינהלית +Name[hi]=सिंहाला +Name[hr]=Sinhalski +Name[hu]=Szingaléz +Name[ia]=Sinhala +Name[id]=Sinhala +Name[is]=Sinhalíska +Name[it]=Singalese +Name[ja]=シンハラ語 +Name[ka]=სინჰალა +Name[kk]=Сингалша +Name[km]=ស៊ីនហាឡា +Name[kn]=ಸಿಂಹಳ +Name[ko]=신할라어 +Name[ku]=Sinhala +Name[lg]=Lusinala +Name[lt]=Sinhala +Name[lv]=Singāļu +Name[mk]=Синхалски +Name[ml]=സിംഹള +Name[mr]=सिंहला +Name[ms]=Sinhala +Name[nb]=Singalesisk +Name[nds]=Singaleesch +Name[nl]=Singalees +Name[nn]=Singalesisk +Name[pa]=ਸਿੰਹਾਲਾ +Name[pl]=Sinhala +Name[pt]=Sinhala +Name[pt_BR]=Cingalês +Name[ro]=Sinhala +Name[ru]=Сингальский +Name[sa]=सिंहलम् +Name[se]=Sinhalagiella +Name[si]=සිංහල +Name[sk]=Sinhalčina +Name[sl]=Singalščina +Name[sr]=синхалески +Name[sr@ijekavian]=синхалески +Name[sr@ijekavianlatin]=sinhaleski +Name[sr@latin]=sinhaleski +Name[sv]=Singalesiska +Name[ta]=சிங்களம் +Name[tg]=Синхала +Name[th]=ภาษาสิงหล +Name[tr]=Sinhala Dili +Name[tt]=Сингал +Name[ug]=سىنخالاچە +Name[uk]=Сингала +Name[vi]=Tiếng Sinhala +Name[wa]=Sinhala +Name[zh_CN]=僧伽罗语 +Name[zh_TW]=僧伽羅語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sk/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sk/kf6_entry.desktop new file mode 100644 index 0000000000..eb45a5baaa --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sk/kf6_entry.desktop @@ -0,0 +1,98 @@ +[KCM Locale] +Name=Slovak +Name[af]=Slovakiese +Name[ar]=السلوفاكية +Name[as]=স্লোভাক +Name[ast]=Eslovacu +Name[az]=Slovak dilində +Name[be]=Славацкая +Name[be@latin]=Slavackaja +Name[bg]=Словашки +Name[bn]=স্লোভাক +Name[bn_IN]=স্লোভাক +Name[br]=Sloveg +Name[bs]=slovački +Name[ca]=Eslovac +Name[ca@valencia]=Eslovac +Name[cs]=Slovenský +Name[csb]=Słowacczi +Name[cy]=Slofac +Name[da]=Slovakisk +Name[de]=Slowakisch +Name[el]=Σλοβακικά +Name[en_GB]=Slovak +Name[eo]=Slovaka +Name[es]=Eslovaco +Name[et]=Slovaki +Name[eu]=Eslovakiera +Name[fa]=اسلواک +Name[fi]=Slovakki +Name[fr]=Slovaque +Name[fy]=Slovaaks +Name[ga]=Slóvaicis +Name[gd]=Slòbhacais +Name[gl]=Eslovaco +Name[gu]=સ્લોવેક +Name[he]=סלובקית +Name[hi]=स्लोवाक +Name[hne]=स्लोवाक +Name[hr]=Slovački +Name[hsb]=Słowaksce +Name[hu]=Szlovák +Name[ia]=Slovaco +Name[id]=Slovak +Name[is]=Slóvakíska +Name[it]=Slovacco +Name[ja]=スロバキア語 +Name[ka]=სლოვაკური +Name[kk]=Словакша +Name[km]=ស្លូវ៉ាគី +Name[kn]=ಸ್ಲೋವಾಕ್ +Name[ko]=슬로바키아어 +Name[ku]=Slovakî +Name[lb]=Slovakesch +Name[lg]=Lusilovaki +Name[lt]=Slovakų +Name[lv]=Slovāku +Name[mai]=स्लोवाक +Name[mk]=Словачки +Name[ml]=സ്ലോവാക്ക് +Name[mr]=स्लोवाक +Name[ms]=Slovak +Name[nb]=Slovakisk +Name[nds]=Slowaaksch +Name[ne]=स्लोभाकी +Name[nl]=Slowaaks +Name[nn]=Slovakisk +Name[oc]=Eslovac +Name[or]=ସ୍ଲୋଭାକ +Name[pa]=ਸਲੋਵਾਕ +Name[pl]=Słowacki +Name[ps]=سلواک +Name[pt]=Eslovaco +Name[pt_BR]=Eslovaco +Name[ro]=Slovacă +Name[ru]=Словацкий +Name[sa]=स्लोवाक +Name[se]=Slovákagiella +Name[si]=ස්ලෝවැක් +Name[sk]=Slovenčina +Name[sl]=Slovaščina +Name[sq]=Sllovakisht +Name[sv]=Slovakiska +Name[ta]=சுலோவாக் +Name[te]=స్లొవక్ +Name[tg]=Словакӣ +Name[th]=ภาษาสโลวัก +Name[tr]=Slovakça +Name[tt]=Словак +Name[ug]=سىلوۋاكچە +Name[uk]=Словацька +Name[uz]=Slovakcha +Name[uz@cyrillic]=Словакча +Name[vi]=Tiếng Slovak +Name[wa]=Eslovake +Name[xh]=Slovak +Name[zh_CN]=斯洛伐克语 +Name[zh_HK]=斯洛伐克語 +Name[zh_TW]=斯洛伐克語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sl/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sl/kf6_entry.desktop new file mode 100644 index 0000000000..9dd15feb21 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sl/kf6_entry.desktop @@ -0,0 +1,102 @@ +[KCM Locale] +Name=Slovenian +Name[af]=Sloveniese +Name[ar]=السّلوفينيّة +Name[as]=স্লোভেনিয়ান +Name[ast]=Eslovenu +Name[az]=Sloveniya dilində +Name[be]=Славенская +Name[be@latin]=Slavienskaja +Name[bg]=Словенски +Name[bn]=স্লোভেনীয় +Name[bn_IN]=স্লোভেনিয়ান +Name[br]=Slovenieg +Name[bs]=slovenački +Name[ca]=Eslovè +Name[ca@valencia]=Eslové +Name[cs]=Slovinský +Name[csb]=Slowensczi +Name[cy]=Slofeneg +Name[da]=Slovensk +Name[de]=Slowenisch +Name[el]=Σλοβενικά +Name[en_GB]=Slovenian +Name[eo]=Slovena +Name[es]=Esloveno +Name[et]=Sloveeni +Name[eu]=Esloveniera +Name[fa]=اسلوونیایی +Name[fi]=Sloveeni +Name[fr]=Slovène +Name[fy]=Sloveensk +Name[ga]=Slóivéinis +Name[gd]=Slòbhainis +Name[gl]=Esloveno +Name[gu]=સ્લોવેનિયન +Name[he]=סלובנית +Name[hi]=स्लोवेनियाई +Name[hne]=स्लोवेनियाई +Name[hr]=Slovenski +Name[hsb]=Słowjensce +Name[hu]=Szlovén +Name[ia]=Sloveno +Name[id]=Slovenia +Name[is]=Slóvenska +Name[it]=Sloveno +Name[ja]=スロベニア語 +Name[ka]=სლოვენიური +Name[kk]=Словенше +Name[km]=ស្លូវ៉ានី +Name[kn]=ಸ್ಲೊಲೋವೇನಿಯನ್ +Name[ko]=슬로베니아어 +Name[ku]=Slovênî +Name[lb]=Slovenesch +Name[lg]=Lusiloveni +Name[lt]=Slovėnų +Name[lv]=Slovēņu +Name[mai]=स्लोवानियाइ +Name[mk]=Словенечки +Name[ml]=സ്ലോവേനിയന്‍ +Name[mr]=स्लोवेनियन +Name[ms]=Slovenia +Name[nb]=Slovensk +Name[nds]=Sloweensch +Name[ne]=स्लोभानियाली +Name[nl]=Sloveens +Name[nn]=Slovensk +Name[oc]=Eslovèn +Name[or]=ସ୍ଲୋଭେନିୟନ +Name[pa]=ਸਲੋਵੀਨੀਆਈ +Name[pl]=Słoweński +Name[ps]=سلووينين +Name[pt]=Esloveno +Name[pt_BR]=Esloveno +Name[ro]=Slovenă +Name[ru]=Словенский +Name[sa]=स्लोवेनियाई +Name[se]=Slovenagiella +Name[si]=ස්ලෝවීනියානු +Name[sk]=Slovinčina +Name[sl]=Slovenščina +Name[sq]=Sllovenisht +Name[sr]=словеначки +Name[sr@ijekavian]=словеначки +Name[sr@ijekavianlatin]=slovenački +Name[sr@latin]=slovenački +Name[sv]=Slovenska +Name[ta]=சுலோவீனியன் +Name[te]=స్లొవెనియన్ +Name[tg]=Словенӣ +Name[th]=ภาษาสโลวีเนีย +Name[tr]=Slovence +Name[tt]=Словен +Name[ug]=سىلوۋېنىيەچە +Name[uk]=Словенська +Name[uz]=Sloveniancha +Name[uz@cyrillic]=Словенианча +Name[vi]=Tiếng Slovenia +Name[wa]=Eslovenyin +Name[xh]=Slovenian +Name[zh_CN]=斯洛文尼亚语 +Name[zh_HK]=斯洛文尼亞語 +Name[zh_TW]=斯洛維尼亞語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sq/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sq/kf6_entry.desktop new file mode 100644 index 0000000000..f8d6b93557 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sq/kf6_entry.desktop @@ -0,0 +1,82 @@ +[KCM Locale] +Name=Albanian +Name[af]=Albanian +Name[ar]=الألبانيّة +Name[ast]=Albanés +Name[az]=Alban dilində +Name[be]=Албанская +Name[be@latin]=Albanskaja +Name[bg]=Албански +Name[br]=Albanieg +Name[bs]=Albanski +Name[ca]=Albanès +Name[ca@valencia]=Albanés +Name[cs]=Albánský +Name[cy]=Albaneg +Name[da]=Albansk +Name[de]=Albanisch +Name[el]=Αλβανικά +Name[en_GB]=Albanian +Name[eo]=Albana +Name[es]=Albanés +Name[et]=Albaania +Name[eu]=Albaniera +Name[fa]=آلبانیایی +Name[fi]=Albania +Name[fr]=Albanais +Name[fy]=Albaansk +Name[ga]=Albáinis +Name[gd]=Albàinis +Name[gl]=Albanés +Name[gu]=અલ્બેનિઅન +Name[he]=אלבנית +Name[hi]=अल्बानियाई +Name[hr]=Albanski +Name[hu]=Albán +Name[ia]=Albanese +Name[id]=Albania +Name[is]=Albanska +Name[it]=Albanese +Name[ja]=アルバニア語 +Name[ka]=ალბანური +Name[kk]=Албанша +Name[km]=អាល់បានី +Name[ko]=알바니아어 +Name[lb]=Albanesch +Name[lg]=Lu-Alibaniya +Name[lt]=Albanų +Name[lv]=Albāņu +Name[mr]=अलबानियन +Name[nb]=Albansk +Name[nds]=Albaansch +Name[nl]=Albanees +Name[nn]=Albansk +Name[pa]=ਅਲਬਾਨੀਆਈ +Name[pl]=Albański +Name[pt]=Albanês +Name[pt_BR]=Albanês +Name[ro]=Albaneză +Name[ru]=Албанский +Name[sa]=अल्बेनियाई +Name[se]=Albániagiella +Name[sk]=Albánčina +Name[sl]=Albanščina +Name[sq]=Shqip +Name[sr]=албански +Name[sr@ijekavian]=албански +Name[sr@ijekavianlatin]=albanski +Name[sr@latin]=albanski +Name[sv]=Albanska +Name[ta]=அல்பேனியன் +Name[tg]=Албанӣ +Name[tr]=Arnavutça +Name[tt]=Албан +Name[ug]=ئالبانچە +Name[uk]=Албанська +Name[uz]=Albancha +Name[uz@cyrillic]=Албанча +Name[vi]=Tiếng An-ba-ni +Name[wa]=Albanyin +Name[zh_CN]=阿尔巴尼亚语 +Name[zh_HK]=阿爾巴尼亞語 +Name[zh_TW]=阿爾巴尼亞語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sr/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sr/kf6_entry.desktop new file mode 100644 index 0000000000..6006fd7476 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sr/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Serbian +Name[af]=Serbiese +Name[ar]=الصّربيّة +Name[as]=ছাৰ্বিয়ান +Name[ast]=Serbiu +Name[az]=Serb dilində +Name[be]=Сербская +Name[be@latin]=Sierbskaja +Name[bg]=Сръбски +Name[bn]=সার্বীয় +Name[bn_IN]=সার্বিয়ান +Name[br]=Serbeg +Name[bs]=srpski +Name[ca]=Serbi +Name[ca@valencia]=Serbi +Name[cs]=Srbský +Name[csb]=Serbsczi +Name[cy]=Serbieg +Name[da]=Serbisk +Name[de]=Serbisch +Name[el]=Σερβικά +Name[en_GB]=Serbian +Name[eo]=Serba +Name[es]=Serbio +Name[et]=Serbia +Name[eu]=Serbiera +Name[fa]=صربی +Name[fi]=Serbia +Name[fr]=Serbe +Name[fy]=Servysk +Name[ga]=Seirbis +Name[gd]=Sèirbis +Name[gl]=Serbio +Name[gu]=સર્બિયન +Name[he]=סרבית +Name[hi]=सर्बियाई +Name[hne]=सर्बियाई +Name[hr]=Srpski +Name[hsb]=Serbisce +Name[hu]=Szerb +Name[ia]=Serbo +Name[id]=Serbia +Name[is]=Serbneska +Name[it]=Serbo +Name[ja]=セルビア語 +Name[ka]=სერბული +Name[kk]=Сербше +Name[km]=ស៊ែប៊ី +Name[kn]=ಸರ್ಬಿಯನ್ +Name[ko]=세르비아어 +Name[ku]=Sirbî +Name[lb]=Serbesch +Name[lg]=Luserebiya +Name[lt]=Serbų +Name[lv]=Serbu +Name[mai]=सर्बियन +Name[mk]=Српски +Name[ml]=സെര്‍ബിയന്‍ +Name[mr]=सर्बियाई +Name[ms]=Serbia +Name[nb]=Serbisk +Name[nds]=Serbsch +Name[ne]=सर्बियाली +Name[nl]=Servisch +Name[nn]=Serbisk +Name[oc]=Serbian +Name[or]=ସରବିୟନ +Name[pa]=ਸਰਬੀਆਈ +Name[pl]=Serbski +Name[ps]=سربي +Name[pt]=Sérvio +Name[pt_BR]=Sérvio +Name[ro]=Sârbă +Name[ru]=Сербский +Name[sa]=सर्बियाई +Name[se]=Serbiágiella +Name[si]=සර්බියානු +Name[sk]=Srbčina +Name[sl]=Srbščina +Name[sq]=Serbisht +Name[sr]=српски +Name[sr@ijekavian]=српски +Name[sr@ijekavianlatin]=srpski +Name[sr@latin]=srpski +Name[sv]=Serbiska +Name[ta]=செர்பியன் +Name[te]=సెర్బియన్ +Name[tg]=Сербӣ +Name[th]=ภาษาเซอร์เบีย +Name[tok]=toki Sopisi +Name[tr]=Sırpça +Name[tt]=Сербия +Name[ug]=سېربچە +Name[uk]=Сербська +Name[uz]=Serbcha +Name[uz@cyrillic]=Сербча +Name[vi]=Tiếng Serbia +Name[wa]=Siebe +Name[xh]=Serbian +Name[zh_CN]=塞尔维亚语 +Name[zh_HK]=塞爾維亞語 +Name[zh_TW]=塞族語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sr@ijekavian/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sr@ijekavian/kf6_entry.desktop new file mode 100644 index 0000000000..2226e9b06c --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sr@ijekavian/kf6_entry.desktop @@ -0,0 +1,76 @@ +[KCM Locale] +Name=Serbian Ijekavian +Name[ar]=الصّربيّة الجيكافيانيّة +Name[az]=Serb (İekav) dilində +Name[be]=Сербская (екаўскі дыялект) +Name[be@latin]=Sierbskaja (jekaŭski dyjaliekt) +Name[bg]=Сръбски йекавски +Name[bs]=srpski ijekavski +Name[ca]=Serbi ijekavski +Name[ca@valencia]=Serbi ijekavski +Name[cs]=Srbský (Ijekavský) +Name[da]=Serbisk Ijekaviansk +Name[de]=Štokavisch +Name[el]=Σερβικά Ijekavian +Name[en_GB]=Serbian Ijekavian +Name[eo]=Ijekava serba +Name[es]=Serbio ijekaviano +Name[et]=Serbia ijekavi +Name[eu]=Serbiera ijekaviera +Name[fa]=صربی Ijekavian +Name[fi]=Serbia Ijekavian +Name[fr]=Serbe Ijékavien +Name[ga]=Seirbis Ijekavach +Name[gd]=Sèirbis Ijekavianach +Name[gl]=Serbio ixtocavio +Name[gu]=સર્બિયન ઇજેકાવિઅન +Name[he]=סרבית אייקאבית +Name[hi]=सर्बियाई जेकावियन +Name[hr]=Srpska ijekavica +Name[hu]=Szerb (ijekavica) +Name[ia]=Serbo Ljekavian +Name[id]=Ijekavian Serbia +Name[is]=Serbneska Ijekavian +Name[it]=Serbo ijekavo +Name[ja]=セルビア語イェ方言 +Name[ka]=სერბული ლიეკავიური +Name[kk]=Лиекав сербше +Name[km]=ស៊ែប៊ី​យេកាវៀន +Name[ko]=세르비아어(이예카비아) +Name[ku]=Sirbiya Ijekavian +Name[lg]=Luserebiya oluyekavi +Name[lt]=Serbų Iekavų +Name[lv]=Serbu ijekaviešu +Name[mk]=Српски јекавски +Name[mr]=सर्बीयन इजेकाव्हिआन +Name[nb]=Serbisk (ljekavisk) +Name[nds]=Štokavisch +Name[nl]=Servisch Ijekavian +Name[nn]=Serbisk (ijekavisk) +Name[pa]=ਸਰਬੀਆਈ ਲਜੀਕਾਵਿਅਨ +Name[pl]=Serbski ijekawski +Name[pt]=Sérvio Ijekavian +Name[pt_BR]=Sérvio ijekavian +Name[ro]=Sârbă jekaviană +Name[ru]=Сербский (иекавский) +Name[sa]=सर्बियादेशस्य इजेकाविया +Name[se]=Serbialaš ljekávagiella +Name[sk]=Srbčina (ijekavština) +Name[sl]=Srbščina (ijekavščina) +Name[sq]=Serbisht me J +Name[sr]=српски ијекавски +Name[sr@ijekavian]=српски ијекавски +Name[sr@ijekavianlatin]=srpski ijekavski +Name[sr@latin]=srpski ijekavski +Name[sv]=Ijekavisk serbiska +Name[ta]=செர்பியன் ஜெகாவியன் +Name[tg]=Сербӣ +Name[th]=ภาษาเซอร์เบียอิเจ็คคาเวีย +Name[tr]=İyekavi Sırpçası +Name[tt]=Сербия (Штокав д.) +Name[ug]=سېربچە ئىجېكاۋىيان +Name[uk]=Сербська (ієкавиця) +Name[vi]=Tiếng Ijekavica Serbia +Name[wa]=Siebe Ijekavyin +Name[zh_CN]=塞尔维亚伊贾卡维语 +Name[zh_TW]=賽爾維亞耶卡語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sr@ijekavianlatin/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sr@ijekavianlatin/kf6_entry.desktop new file mode 100644 index 0000000000..d9e18b7aaf --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sr@ijekavianlatin/kf6_entry.desktop @@ -0,0 +1,76 @@ +[KCM Locale] +Name=Serbian Ijekavian Latin +Name[ar]=الصّربيّة الجيكافيانيّة اللاتينيّة +Name[az]=Serb (İekav, latın) dilində +Name[be]=Сербская (екаўскі дыялект, лацінка) +Name[be@latin]=Sierbskaja (jekaŭski dyjaliekt, lacinka) +Name[bg]=Сръбски йекавски (латиница) +Name[bs]=srpski ijekavski (latinica) +Name[ca]=Serbi ijekavski llatí +Name[ca@valencia]=Serbi ijekavski llatí +Name[cs]=Srbský (Ijekavská latinka) +Name[da]=Serbisk Ijekaviansk latin +Name[de]=Štokavisch (lat. Alphabet) +Name[el]=Σερβικά Ijekavian (Λατινικά) +Name[en_GB]=Serbian Ijekavian Latin +Name[eo]=Latina ijekava serba +Name[es]=Serbio latino ijekaviano +Name[et]=Serbia ijekavi (ladina) +Name[eu]=Serbiera ijekaviera latinoa +Name[fa]=صربی Ijekavian لاتین +Name[fi]=Serbia Ijekavian latinalainen +Name[fr]=Serbe Ijékavien Latin +Name[ga]=Seirbis Ijekavach (aibítir Laidineach) +Name[gd]=Sèirbis Ijekavianach (Laideann) +Name[gl]=Serbio ijekavián latino +Name[gu]=સર્બિયન ઇજેકાવિઅન લેટિન +Name[he]=סרבית אייקאבית לטינית +Name[hi]=सर्बियाई जेकावियन लातिनी +Name[hr]=Srpska ijekavica, latinica +Name[hu]=Szerb (ijekavica, latin betűs) +Name[ia]=Serbo Latino Ljekavian +Name[id]=Latin Ijekavian Serbia +Name[is]=Serbneska Ijekavian (latneskt letur) +Name[it]=Serbo ijekavo latino +Name[ja]=セルビア語イェ方言 (ラテン文字) +Name[ka]=სერბული ლიეკავიური ლათინური +Name[kk]=Латындагы лиекав сербше +Name[km]=ស៊ែប៊ីយេកាវៀន​ឡាតាំង +Name[ko]=세르비아어(이예카비아, 라틴 문자) +Name[ku]=Sirbiya Ijekavian ya Latînî +Name[lg]=Luserebiya oluyekavi olwa walifu ya kilattini +Name[lt]=Serbų Iekavų lotynų +Name[lv]=Serbu ijekaviešu latīņu +Name[mk]=Српски јекавски латиничен +Name[mr]=सर्बीयन इजेकाव्हिआन लॅटिन +Name[nb]=Serbisk (ljekavisk – romanisert) +Name[nds]=Štokavisch (latiensch Schrift) +Name[nl]=Servisch Ijekavian latijn +Name[nn]=Serbisk (ijekavisk – romanisert) +Name[pa]=ਸਰਬੀਆਈ ਲਜੀਕਾਵਿਅਨ ਲੈਟਿਨ +Name[pl]=Serbski ijekawski (skrypt łaciński) +Name[pt]=Sérvio Latino Ijekavian +Name[pt_BR]=Sérvio latino ijekavian +Name[ro]=Sârbă jekaviană latină +Name[ru]=Сербский (иекавский, латиница) +Name[sa]=सर्बियाई इजेकावियन लैटिन +Name[se]=Serbialaš ljekávagiella (Latiinnalaš čállinvuohki) +Name[sk]=Srbčina (ijekavština - latinka) +Name[sl]=Srbščina (ijekavščina, latinica) +Name[sq]=Serbisht me J Latine +Name[sr]=српски ијекавски (латиница) +Name[sr@ijekavian]=српски ијекавски (латиница) +Name[sr@ijekavianlatin]=srpski ijekavski (latinica) +Name[sr@latin]=srpski ijekavski (latinica) +Name[sv]=Latinsk ijekavisk serbiska +Name[ta]=செர்பியன் ஜெகாவியன் லத்தீன் +Name[tg]=Сербии Лотинӣ +Name[th]=ภาษาละตินเซอร์เบียอิเจ็คคาเวีย +Name[tr]=İyekavi Sırpçası Latin +Name[tt]=Сербия (Штокав д., латин) +Name[ug]=سېربچە ئىجېكاۋىيان لاتىن +Name[uk]=Сербська (ієкавиця, латиниця) +Name[vi]=Tiếng Ijekavica Serbia La-tinh +Name[wa]=Siebe Ijekavyin èn alfabet latén +Name[zh_CN]=塞尔维亚伊贾卡维语 (拉丁字母) +Name[zh_TW]=賽爾維亞耶卡語(拉丁文字) diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sr@latin/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sr@latin/kf6_entry.desktop new file mode 100644 index 0000000000..82db761591 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sr@latin/kf6_entry.desktop @@ -0,0 +1,100 @@ +[KCM Locale] +Name=Serbian Latin +Name[af]=Serbiese Latyn +Name[ar]=الصّربيّة اللاتينيّة +Name[as]=ছাৰ্বিয়ান লেটিন +Name[az]=Serb (latın) dilində +Name[be]=Сербская (лацінка) +Name[be@latin]=Sierbskaja (lacinka) +Name[bg]=Сръбски (латиница) +Name[bn]=সার্বীয় লাতিন +Name[bn_IN]=সার্বিয়ান লাতিন +Name[br]=Serbeg latin +Name[bs]=srpski (latinica) +Name[ca]=Serbi llatí +Name[ca@valencia]=Serbi llatí +Name[cs]=Srbský (latinka) +Name[csb]=Serbsczi (łacëńsczi) +Name[cy]=Serbieg Lladin +Name[da]=Serbisk latin +Name[de]=Serbisch (lat. Alphabet) +Name[el]=Σερβικά +Name[en_GB]=Serbian Latin +Name[eo]=Latina serba +Name[es]=Serbio latino +Name[et]=Serbia (ladina) +Name[eu]=Serbiera latinoa +Name[fa]=صربی لاتین +Name[fi]=Serbia latinalainen +Name[fr]=Serbe latin +Name[fy]=Servysk latynsk +Name[ga]=Seirbis (aibítir Laidineach) +Name[gd]=Sèirbis (Laideann) +Name[gl]=Serbio latino +Name[gu]=સર્બિયન લેટિન +Name[he]=סרבית לטינית +Name[hi]=सर्बियाई लातिनी +Name[hne]=सर्बियाई लातिनी +Name[hr]=Srpski, latinica +Name[hsb]=Serbisce (latinica) +Name[hu]=Szerb latin +Name[ia]=Serbo Latino +Name[id]=Latin Serbia +Name[is]=Serbneska (latneskt letur) +Name[it]=Serbo latino +Name[ja]=セルビア語 (ラテン文字) +Name[ka]=სერბული ლათინური +Name[kk]=Латындагы сербше +Name[km]=ស៊ែប៊ី ឡាតាំង +Name[kn]=ಸರ್ಬಿಯನ್ ಲಾಟಿನ್ +Name[ko]=세르비아어(라틴 문자) +Name[ku]=Sirbî bi tîpên latînî +Name[lb]=Serbesch (latäinescht Alphabet) +Name[lg]=Luserebiya olwa walifu ya kilattini +Name[lt]=Serbų lotynų +Name[lv]=Serbu latīņu +Name[mai]=सर्बियाई लातिनी +Name[mk]=Српски латиничен +Name[ml]=സെര്‍ബിയന്‍ ലാറ്റിന്‍ +Name[mr]=लॅटिन +Name[ms]=Latin Serbia +Name[nb]=Serbisk (romanisert) +Name[nds]=Serbsch (latiensch Schrift) +Name[ne]=सर्बियाली ल्यटिन +Name[nl]=Servisch latijn +Name[nn]=Serbisk (romanisert) +Name[or]=ସର୍ବିୟନ ଲାଟିନ +Name[pa]=ਸਰਬੀਆਈ ਲੈਟਿਨ +Name[pl]=Serbski (skrypt łaciński) +Name[ps]=سربيايي لاټيني +Name[pt]=Sérvio Latino +Name[pt_BR]=Sérvio latino +Name[ro]=Sârbă latină +Name[ru]=Сербский (латиница) +Name[sa]=सर्बियाई लैटिन +Name[se]=Serbialaš latiidna +Name[si]=සර්බියානු ලතින් +Name[sk]=Srbčina (latinka) +Name[sl]=Srbščina (latinica) +Name[sq]=Serbisht Latine +Name[sr]=српски (латиница) +Name[sr@ijekavian]=српски (латиница) +Name[sr@ijekavianlatin]=srpski (latinica) +Name[sr@latin]=srpski (latinica) +Name[sv]=Latinsk serbiska +Name[ta]=செர்பியன் லத்தீன் +Name[te]=సెర్బియన్ లాటిన్ +Name[tg]=Сербии Лотинӣ +Name[th]=ภาษาละตินเซอร์เบีย +Name[tok]=toki Sopisi pi sitelen Lasina +Name[tr]=Latin Sırpça +Name[tt]=Сербия (Латин) +Name[ug]=سېربچە لاتىن +Name[uk]=Сербська (латиниця) +Name[uz]=Serbcha (lotin) +Name[uz@cyrillic]=Сербча (лотин) +Name[vi]=Tiếng Serbia La-tinh +Name[wa]=Siebe (alfabet latén) +Name[zh_CN]=塞尔维亚语 (拉丁字母) +Name[zh_HK]=塞爾維亞拉丁語 +Name[zh_TW]=塞爾維亞語(拉丁文字) diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sv/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sv/kf6_entry.desktop new file mode 100644 index 0000000000..a68dc10fe1 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/sv/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Swedish +Name[af]=Sweedse +Name[ar]=السّويديّة +Name[as]=চুইদিশ্ব +Name[ast]=Suecu +Name[az]=İsveç dilində +Name[be]=Шведская +Name[be@latin]=Šviedskaja +Name[bg]=Шведски +Name[bn]=সুইডিশ +Name[bn_IN]=সুইডিশ +Name[br]=Svedeg +Name[bs]=švedski +Name[ca]=Suec +Name[ca@valencia]=Suec +Name[cs]=Švédský +Name[csb]=Szwedzczi +Name[cy]=Swedeg +Name[da]=Svensk +Name[de]=Schwedisch +Name[el]=Σουηδικά +Name[en_GB]=Swedish +Name[eo]=Sveda +Name[es]=Sueco +Name[et]=Rootsi +Name[eu]=Suediera +Name[fa]=سوئدی +Name[fi]=Ruotsi +Name[fr]=Suédois +Name[fy]=Sweedsk +Name[ga]=Sualainnis +Name[gd]=Suainis +Name[gl]=Sueco +Name[gu]=સ્વીડિશ +Name[he]=שבדית +Name[hi]=स्वीडिश +Name[hne]=स्वीडिस +Name[hr]=Švedski +Name[hsb]=Šwedsce +Name[hu]=Svéd +Name[ia]=Svedo +Name[id]=Swedia +Name[is]=Sænska +Name[it]=Svedese +Name[ja]=スウェーデン語 +Name[ka]=შვედური +Name[kk]=Шведше +Name[km]=ស៊ុយអែដ +Name[kn]=ಸ್ವೀಡಿಷ್ +Name[ko]=스웨덴어 +Name[ku]=Swêdî +Name[lb]=Schwedesch +Name[lg]=Luswedeni +Name[lt]=Švedų +Name[lv]=Zviedru +Name[mai]=स्वीडिश +Name[mk]=Шведски +Name[ml]=സ്വീഡിഷ് +Name[mr]=स्वीडिश +Name[ms]=Swedish +Name[nb]=Svensk +Name[nds]=Sweedsch +Name[ne]=स्विडिश +Name[nl]=Zweeds +Name[nn]=Svensk +Name[oc]=Suedés +Name[or]=ସ୍ୱେଡିସ +Name[pa]=ਸਵੀਡਿਸ਼ +Name[pl]=Szwedzki +Name[ps]=سوېډېني +Name[pt]=Sueco +Name[pt_BR]=Sueco +Name[ro]=Suedeză +Name[ru]=Шведский +Name[sa]=स्वीडिश +Name[se]=Ruoŧagiella +Name[si]=ස්වීඩන +Name[sk]=Švédčina +Name[sl]=Švedščina +Name[sq]=Suedisht +Name[sr]=шведски +Name[sr@ijekavian]=шведски +Name[sr@ijekavianlatin]=švedski +Name[sr@latin]=švedski +Name[sv]=Svenska +Name[ta]=சுவீடிஷ் +Name[te]=స్విడిష్ +Name[tg]=Шведӣ +Name[th]=ภาษาสวีเดน +Name[tok]=toki Sensa +Name[tr]=İsveççe +Name[tt]=Швед +Name[ug]=شىۋېدچە +Name[uk]=Шведська +Name[uz]=Shvedcha +Name[uz@cyrillic]=Шведча +Name[vi]=Tiếng Thuỵ Điển +Name[wa]=Suwedwès +Name[xh]=Swedish +Name[zh_CN]=瑞典语 +Name[zh_HK]=瑞典語 +Name[zh_TW]=瑞典語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ta/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ta/kf6_entry.desktop new file mode 100644 index 0000000000..6429efdc04 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ta/kf6_entry.desktop @@ -0,0 +1,102 @@ +[KCM Locale] +Name=Tamil +Name[af]=Tamiliese +Name[ar]=التّاميليّة +Name[as]=তামিল +Name[ast]=Támil +Name[az]=Tamil dilində +Name[be]=Тамільская +Name[be@latin]=Tamiĺskaja +Name[bg]=Тамилски +Name[bn]=তামিল +Name[bn_IN]=তামিল +Name[br]=Tamouleg +Name[bs]=tamilski +Name[ca]=Tàmil +Name[ca@valencia]=Tàmil +Name[cs]=Tamilsky +Name[csb]=Tamilsczi +Name[cy]=Tamil +Name[da]=Tamil +Name[de]=Tamil +Name[el]=Ταμίλ +Name[en_GB]=Tamil +Name[eo]=Tamila +Name[es]=Tamil +Name[et]=Tamili +Name[eu]=Tamilera +Name[fa]=تامیلی +Name[fi]=Tamil +Name[fr]=Tamoul +Name[fy]=Tamil +Name[ga]=Tamailis +Name[gd]=Taimilis +Name[gl]=Tamil +Name[gu]=તમિલ +Name[he]=טמילית +Name[hi]=तमिल +Name[hne]=तमिल +Name[hr]=Tamilski +Name[hsb]=Tamilsce +Name[hu]=Tamil +Name[ia]=Tamil +Name[id]=Tamil +Name[is]=Tamílska +Name[it]=Tamil +Name[ja]=タミル語 +Name[ka]=თამილური +Name[kk]=Тамилша +Name[km]=តាមីល +Name[kn]=ತಮಿಳು +Name[ko]=타밀어 +Name[ku]=Tamîl +Name[lb]=Tamil +Name[lg]=Lutamilu +Name[lt]=Tamilų +Name[lv]=Tamilu +Name[mai]=तमिल +Name[mk]=Тамилски +Name[ml]=തമിഴ് +Name[mr]=तामिळ +Name[ms]=Tamil +Name[nb]=Tamil +Name[nds]=Tamielsch +Name[ne]=तामिल +Name[nl]=Tamil +Name[nn]=Tamil +Name[oc]=Tamil +Name[or]=ତାମିଲ +Name[pa]=ਤਾਮਿਲ +Name[pl]=Tamiljski +Name[ps]=ټامېل +Name[pt]=Tamil +Name[pt_BR]=Tâmil +Name[ro]=Tamilă +Name[ru]=Тамильский +Name[sa]=तमिल +Name[se]=Tamilagiella +Name[si]=දෙමළ +Name[sk]=Tamilčina +Name[sl]=Tamilščina +Name[sq]=Tamilisht +Name[sr]=тамилски +Name[sr@ijekavian]=тамилски +Name[sr@ijekavianlatin]=tamilski +Name[sr@latin]=tamilski +Name[sv]=Tamil +Name[ta]=தமிழ் +Name[te]=తమిళం +Name[tg]=Тамилӣ +Name[th]=ภาษาทมิฬ +Name[tr]=Tamilce +Name[tt]=Тамиль +Name[ug]=تامىلچە +Name[uk]=Тамільська +Name[uz]=Tamilcha +Name[uz@cyrillic]=Тамилча +Name[vi]=Tiếng Tamil +Name[wa]=Tamoul +Name[xh]=Tamil +Name[zh_CN]=泰米尔语 +Name[zh_HK]=坦米爾語 +Name[zh_TW]=泰米爾語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/te/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/te/kf6_entry.desktop new file mode 100644 index 0000000000..4dfc141e4e --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/te/kf6_entry.desktop @@ -0,0 +1,100 @@ +[KCM Locale] +Name=Telugu +Name[ar]=التّيلوغو +Name[as]=টেকুগু +Name[ast]=Télugu +Name[az]=Teleuqu dilində +Name[be]=Тэлугу +Name[be@latin]=Teluhu +Name[bg]=Телугу +Name[bn]=তেলেগু +Name[bn_IN]=তেলুগু +Name[br]=Telegu +Name[bs]=telugu +Name[ca]=Telugu +Name[ca@valencia]=Telugu +Name[cs]=Telugsky +Name[csb]=Telugu +Name[cy]=Telugu +Name[da]=Telugu +Name[de]=Telugu +Name[el]=Τελούγκου +Name[en_GB]=Telugu +Name[eo]=Teluga +Name[es]=Telugu +Name[et]=Telugu +Name[eu]=Telugu +Name[fa]=تلوگو +Name[fi]=Telugu +Name[fr]=Télougou +Name[fy]=Telugu +Name[ga]=Teileagúis +Name[gd]=Telugu +Name[gl]=Telugu +Name[gu]=તેલુગુ +Name[he]=טלוגו +Name[hi]=तेलुगु +Name[hne]=तेलुगु +Name[hr]=Telugu +Name[hsb]=Telugu +Name[hu]=Telugu +Name[ia]=Telugu +Name[id]=Telugu +Name[is]=Telúgú +Name[it]=Telugu +Name[ja]=テルグ語 +Name[ka]=თელუგუ +Name[kk]=Телугу +Name[km]=តេលូហ្គូ +Name[kn]=ತೆಲುಗು +Name[ko]=텔루구어 +Name[ku]=Telugu +Name[lb]=Telugu +Name[lg]=Lutelugu +Name[lt]=Telugu +Name[lv]=Telugu +Name[mai]=तेलुगु +Name[mk]=Телугу +Name[ml]=തെലുങ്ക് +Name[mr]=तेलुगु +Name[ms]=Telugu +Name[nb]=Telugu +Name[nds]=Telugu +Name[ne]=तेलुगु +Name[nl]=Telugu +Name[nn]=Telugu +Name[oc]=Telugu +Name[or]=ତେଲୁଗୁ +Name[pa]=ਤੇਲਗੂ +Name[pl]=Telugu +Name[ps]=ټېلوګو +Name[pt]=Telugu +Name[pt_BR]=Telugu +Name[ro]=Telugu +Name[ru]=Телугу +Name[sa]=तेलुगु +Name[se]=Telugu +Name[si]=තෙළිඟු +Name[sk]=Telugčina +Name[sl]=Teluščina +Name[sr]=телугу +Name[sr@ijekavian]=телугу +Name[sr@ijekavianlatin]=telugu +Name[sr@latin]=telugu +Name[sv]=Telugu +Name[ta]=தெலுங்கு +Name[te]=తెలుగు +Name[tg]=Телугӣ +Name[th]=ภาษาเทลูกู +Name[tok]=toki Teluku +Name[tr]=Teluguca +Name[tt]=Телугу +Name[ug]=تېلۇگۇچە +Name[uk]=Телугу +Name[uz]=Telugu +Name[uz@cyrillic]=Телугу +Name[vi]=Tiếng Telugu +Name[wa]=Telougou +Name[zh_CN]=泰卢固语 +Name[zh_TW]=泰盧固語 + diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/tg/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/tg/kf6_entry.desktop new file mode 100644 index 0000000000..f420cf3efd --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/tg/kf6_entry.desktop @@ -0,0 +1,101 @@ +[KCM Locale] +Name=Tajik +Name[af]=Thaise +Name[ar]=الطّاجيكيّة +Name[as]=টাজিক +Name[ast]=Taxicu +Name[az]=Tacik dilində +Name[be]=Таджыкская +Name[be@latin]=Tadžykskaja +Name[bg]=Таджикски +Name[bn]=তাজিক +Name[bn_IN]=তাজিক +Name[br]=Tajiek +Name[bs]=tadžički +Name[ca]=Tadjik +Name[ca@valencia]=Tadjik +Name[cs]=Tádžický +Name[csb]=Tadżëcczi +Name[cy]=Tajik +Name[da]=Tajik +Name[de]=Tadschikisch +Name[el]=Τατζικικά +Name[en_GB]=Tajik +Name[eo]=Taĝika +Name[es]=Tajiko +Name[et]=Tadžiki +Name[eu]=Tajikera +Name[fa]=تاجیکی +Name[fi]=Tadžikki +Name[fr]=Tadjik +Name[fy]=Tadzjyksk +Name[ga]=Táidsícis +Name[gd]=Taidigis +Name[gl]=Taxico +Name[gu]=તાજીક +Name[he]=טג׳יקית +Name[hi]=ताजिक +Name[hne]=ताजिक +Name[hr]=Tadžik +Name[hsb]=Tadźikisce +Name[hu]=Tádzsik +Name[ia]=Tadzhiko +Name[id]=Tajik +Name[is]=Tadsíska +Name[it]=Tagico +Name[ja]=タジク語 +Name[ka]=ტაჯიკური +Name[kk]=Тәжікше +Name[km]=តាដហ្ស៊ីគីស្តង់ +Name[kn]=ತಾಜಿಕ್ +Name[ko]=타지크어 +Name[ku]=Tacîkî +Name[lb]=Tadjikesch +Name[lg]=Lutajiki +Name[lt]=Tadžikų +Name[lv]=Tadžiku +Name[mai]=ताजिक +Name[mk]=Таџикистански +Name[ml]=താജിക്ക് +Name[mr]=ताजिक +Name[ms]=Tajik +Name[nb]=Tadsjikisk +Name[nds]=Tadschiiksch +Name[ne]=ताजिक +Name[nl]=Tadzjieks +Name[nn]=Tadsjikisk +Name[oc]=Tajik +Name[or]=ତାଜିକ +Name[pa]=ਤਾਜਿਕ +Name[pl]=Tadżycki +Name[ps]=تاجکي +Name[pt]=Tajique +Name[pt_BR]=Tajique +Name[ro]=Tadjică +Name[ru]=Таджикский +Name[sa]=ताजिक +Name[se]=Tajikagiella +Name[si]=ටජික් +Name[sk]=Tadžičtina +Name[sl]=Tadžiščina +Name[sr]=таџички +Name[sr@ijekavian]=таџички +Name[sr@ijekavianlatin]=tadžički +Name[sr@latin]=tadžički +Name[sv]=Tadzjikiska +Name[ta]=தாஜிக் +Name[te]=తాజిక్ +Name[tg]=Тоҷикӣ +Name[th]=ภาษาทาจิกิสถาน +Name[tr]=Tacikçe +Name[tt]=Таҗик +Name[ug]=تاجىكچە +Name[uk]=Таджицька +Name[uz]=Tojikcha +Name[uz@cyrillic]=Тожикча +Name[vi]=Tiếng Tajik +Name[wa]=Tadjik +Name[zh_CN]=塔吉克语 +Name[zh_HK]=塔吉克語 +Name[zh_TW]=塔吉克語 + diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/th/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/th/kf6_entry.desktop new file mode 100644 index 0000000000..8c147852e8 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/th/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Thai +Name[af]=Thaise +Name[ar]=التّايلانديّة +Name[as]=থাই +Name[ast]=Tailandés +Name[az]=Tay dilində +Name[be]=Тайская +Name[be@latin]=Tajskaja +Name[bg]=Тамилски +Name[bn]=থাই +Name[bn_IN]=থাই +Name[br]=Tailh +Name[bs]=tajlandski +Name[ca]=Tai +Name[ca@valencia]=Tai +Name[cs]=Thajský +Name[csb]=Tajsczi +Name[cy]=Tai +Name[da]=Thailandsk +Name[de]=Thai +Name[el]=Ταϊλανδικά +Name[en_GB]=Thai +Name[eo]=Taja +Name[es]=Tailandés +Name[et]=Tai +Name[eu]=Thailandiera +Name[fa]=تایلندی +Name[fi]=Thai +Name[fr]=Thaïlandais +Name[fy]=Taaisk +Name[ga]=Téalainnis +Name[gd]=Tàidh +Name[gl]=Tailandés +Name[gu]=થાઈ +Name[he]=תאית +Name[hi]=थाई +Name[hne]=थाई +Name[hr]=Thai +Name[hsb]=Thai +Name[hu]=Thaiföldi +Name[ia]=Thai +Name[id]=Thailand +Name[is]=Tælenska +Name[it]=Thailandese +Name[ja]=タイ語 +Name[ka]=ტაილანდური +Name[kk]=Тайша +Name[km]=ថៃ +Name[kn]=ತಾಯ್ +Name[ko]=태국어 +Name[ku]=Tay +Name[lb]=Thailännesch +Name[lg]=Lutayilandi +Name[lt]=Tajų +Name[lv]=Taju +Name[mai]=थाइ +Name[mk]=Тајландски +Name[ml]=തായ് +Name[mr]=थाई +Name[ms]=Thai +Name[nb]=Thai +Name[nds]=Thai +Name[ne]=थाई +Name[nl]=Thais +Name[nn]=Thai +Name[oc]=Tailandés +Name[or]=ଥାଇ +Name[pa]=ਥਾਈ +Name[pl]=Tajski +Name[ps]=ټهايي +Name[pt]=Tailandês +Name[pt_BR]=Tailandês +Name[ro]=Tailandeză +Name[ru]=Тайский +Name[sa]=थाई +Name[se]=Thaigiella +Name[si]=තායි +Name[sk]=Thajčina +Name[sl]=Tajščina +Name[sq]=Tajlandisht +Name[sr]=тајландски +Name[sr@ijekavian]=тајландски +Name[sr@ijekavianlatin]=tajlandski +Name[sr@latin]=tajlandski +Name[sv]=Thailändska +Name[ta]=தாய் +Name[te]=థాయి +Name[tg]=Тайландӣ +Name[th]=ภาษาไทย +Name[tok]=toki Tawi +Name[tr]=Tayca +Name[tt]=Тай +Name[ug]=تايلاندچە +Name[uk]=Таїландська +Name[uz]=Taycha +Name[uz@cyrillic]=Тайча +Name[vi]=Tiếng Thái +Name[wa]=Taylandès +Name[xh]=Thai +Name[zh_CN]=泰语 +Name[zh_HK]=泰語 +Name[zh_TW]=泰語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/tok/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/tok/kf6_entry.desktop new file mode 100644 index 0000000000..286bc2db9e --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/tok/kf6_entry.desktop @@ -0,0 +1,53 @@ +[KCM Locale] +Name=Toki Pona +Name[ar]=توكي بونا +Name[ast]=Toki Pona +Name[az]=Toki Pona +Name[be]=Такіпона +Name[be@latin]=Takipona +Name[bg]=Токи Пона +Name[ca]=Toki pona +Name[ca@valencia]=Toki pona +Name[cs]=Toki Pona +Name[da]=Toki pona +Name[de]=Toki Pona +Name[el]=Toki Pona +Name[en_GB]=Toki Pona +Name[eo]=Toki Pona +Name[es]=Toki pona +Name[eu]=Toki Pona +Name[fi]=Toki Pona +Name[fr]=Toki Pona +Name[gl]=Toki pona +Name[he]=טוקי פונה +Name[hu]=Toki Pona +Name[ia]=Toki Pona +Name[id]=Toki Pona +Name[is]=Toki Pona +Name[it]=Toki Pona +Name[ka]=ტოკი პონა +Name[ko]=도기 보나 +Name[lg]=Toki Pona +Name[lt]=Toki Pona +Name[lv]=Toki Pona +Name[nb]=Toki Pona +Name[nl]=Toki Pona +Name[nn]=Toki pona +Name[pa]=ਟੋਕੀ ਪੋਨਾ +Name[pl]=Toki Pona +Name[pt]=Toki Pona +Name[pt_BR]=Toki Pona +Name[ro]=Toki Pona +Name[ru]=Токипона +Name[sa]=लैपटॉप कुल्हाड़ी +Name[sk]=Toki Pona +Name[sl]=Toki Pona +Name[sv]=Toki Pona +Name[ta]=டோக்கி போனா +Name[tok]=toki pona +Name[tr]=Toki Pona +Name[ug]=توكى پوناچە +Name[uk]=Токі-пона +Name[vi]=Toki Pona +Name[zh_CN]=Toki Pona +Name[zh_TW]=道本語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/tr/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/tr/kf6_entry.desktop new file mode 100644 index 0000000000..2ba41d270b --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/tr/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Turkish +Name[af]=Turkse +Name[ar]=التّركيّة +Name[as]=টুৰকিশ্ব +Name[ast]=Turcu +Name[az]=Türk dilində +Name[be]=Турэцкая +Name[be@latin]=Tureckaja +Name[bg]=Турски +Name[bn]=তুর্কী +Name[bn_IN]=তুর্কি +Name[br]=Turkeg +Name[bs]=turski +Name[ca]=Turc +Name[ca@valencia]=Turc +Name[cs]=Turecký +Name[csb]=Tërecczi +Name[cy]=Twrceg +Name[da]=Tyrkisk +Name[de]=Türkisch +Name[el]=Τουρκικά +Name[en_GB]=Turkish +Name[eo]=Turka +Name[es]=Turco +Name[et]=Türgi +Name[eu]=Turkiera +Name[fa]=ترکی +Name[fi]=Turkki +Name[fr]=Turc +Name[fy]=Turks +Name[ga]=Tuircis +Name[gd]=Turcais +Name[gl]=Turco +Name[gu]=તુર્કીશ +Name[he]=טורקית +Name[hi]=तुर्की +Name[hne]=तुर्की +Name[hr]=Turski +Name[hsb]=Turkowsce +Name[hu]=Török +Name[ia]=Turco +Name[id]=Turki +Name[is]=Tyrkneska +Name[it]=Turco +Name[ja]=トルコ語 +Name[ka]=თურქული +Name[kk]=Түрікше +Name[km]=ទួរគី +Name[kn]=ತುರ್ಕಿಶ್ +Name[ko]=튀르키예어 +Name[ku]=Tirkî +Name[lb]=Türkesch +Name[lg]=Luturuki +Name[lt]=Turkų +Name[lv]=Turku +Name[mai]=तुर्की +Name[mk]=Турски +Name[ml]=തുര്‍ക്കിഷ് +Name[mr]=तुर्किश +Name[ms]=Turki +Name[nb]=Tyrkisk +Name[nds]=Törksch +Name[ne]=तुर्किस +Name[nl]=Turks +Name[nn]=Tyrkisk +Name[oc]=Turc +Name[or]=ତୁରକିସ +Name[pa]=ਤੁਰਕੀ +Name[pl]=Turecki +Name[ps]=ترکي +Name[pt]=Turco +Name[pt_BR]=Turco +Name[ro]=Turcă +Name[ru]=Турецкий +Name[sa]=तुर्की +Name[se]=Turkkagiella +Name[si]=තුර්කි +Name[sk]=Turečtina +Name[sl]=Turščina +Name[sq]=Turqisht +Name[sr]=турски +Name[sr@ijekavian]=турски +Name[sr@ijekavianlatin]=turski +Name[sr@latin]=turski +Name[sv]=Turkiska +Name[ta]=துருக்கியம் +Name[te]=టర్కిష్ +Name[tg]=Туркӣ +Name[th]=ภาษาตุรกี +Name[tok]=toki Tuki +Name[tr]=Türkçe +Name[tt]=Төрек +Name[ug]=تۈركچە +Name[uk]=Турецька +Name[uz]=Turkcha +Name[uz@cyrillic]=Туркча +Name[vi]=Tiếng Thổ Nhĩ Kì +Name[wa]=Turk +Name[xh]=Turkish +Name[zh_CN]=土耳其语 +Name[zh_HK]=土耳其語 +Name[zh_TW]=土耳其語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/tt/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/tt/kf6_entry.desktop new file mode 100644 index 0000000000..ecdebda157 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/tt/kf6_entry.desktop @@ -0,0 +1,79 @@ +[KCM Locale] +Name=Tatar +Name[af]=Tatar +Name[ar]=التّتاريّة +Name[ast]=Tártaru +Name[az]=Tatar dilində +Name[be]=Татарская +Name[be@latin]=Tatarskaja +Name[bg]=Татарски +Name[br]=Tatareg +Name[bs]=Tatarski +Name[ca]=Tàtar +Name[ca@valencia]=Tàtar +Name[cs]=Tatarský +Name[cy]=Tatar +Name[da]=Tatar +Name[de]=Tatarisch +Name[el]=Ταταρικά +Name[en_GB]=Tatar +Name[eo]=Tatara +Name[es]=Tártaro +Name[et]=Tatari +Name[eu]=Tatarera +Name[fa]=تاتاری +Name[fi]=Tataari +Name[fr]=Tatar +Name[fy]=Tataarsk +Name[ga]=Tatairis +Name[gd]=Tatarais +Name[gl]=Tártaro +Name[gu]=તાતાર +Name[he]=טטרית +Name[hi]=तातार +Name[hr]=Tatarski +Name[hu]=Tatár +Name[ia]=Tataro +Name[id]=Tatar +Name[is]=Tatarska +Name[it]=Tataro +Name[ka]=თათრული +Name[kk]=Татарша +Name[km]=តាតារ +Name[ko]=타타르어 +Name[lb]=Tataresch +Name[lg]=Lutatari +Name[lt]=Totorių +Name[lv]=Tatāru +Name[mr]=तातार +Name[nb]=Tatarisk +Name[nds]=Tataarsch +Name[nl]=Tataars +Name[nn]=Tatarisk +Name[pa]=ਤਤਾਰ +Name[pl]=Tatarski +Name[pt]=Tatar +Name[pt_BR]=Tatar +Name[ro]=Tătară +Name[ru]=Татарский +Name[sa]=तातार +Name[se]=Tatáragiella +Name[sk]=Tatárčina +Name[sl]=Tatarščina +Name[sq]=Tatarisht +Name[sr]=татарски +Name[sr@ijekavian]=татарски +Name[sr@ijekavianlatin]=tatarski +Name[sr@latin]=tatarski +Name[sv]=Tatariska +Name[ta]=டாடார் +Name[tg]=Тоторӣ +Name[tr]=Tatarca +Name[ug]=تاتارچە +Name[uk]=Татарська +Name[uz]=Totarcha +Name[uz@cyrillic]=Тотарча +Name[vi]=Tiếng Tatar +Name[zh_CN]=鞑靼语 +Name[zh_HK]=韃靼語 +Name[zh_TW]=韃靼語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ug/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ug/kf6_entry.desktop new file mode 100644 index 0000000000..d430619a94 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/ug/kf6_entry.desktop @@ -0,0 +1,75 @@ +[KCM Locale] +Name=Uyghur +Name[ar]=الأيغوريّة +Name[ast]=Uigur +Name[az]=Uyğur dilində +Name[be]=Уйгурская +Name[be@latin]=Ujhurskaja +Name[bg]=Уйгурски +Name[bs]=ujgurski +Name[ca]=Uigur +Name[ca@valencia]=Uigur +Name[cs]=Ujgurský +Name[da]=Uyghur +Name[de]=Uigurisch +Name[el]=Uyghur +Name[en_GB]=Uyghur +Name[eo]=Ujgura +Name[es]=Uigur +Name[et]=Uiguuri +Name[eu]=Uigurrera +Name[fa]=یوگر +Name[fi]=Uiguuri +Name[fr]=Ouïghour +Name[ga]=Uigiúiris +Name[gd]=Ùigiurais +Name[gl]=Uigur +Name[gu]=ઉયુગિહઅર +Name[he]=אויגורית +Name[hi]=उघ्यूर +Name[hr]=Ujgurski +Name[hu]=Ujgur +Name[ia]=Uighuro +Name[id]=Uyghur +Name[is]=Uygúr +Name[it]=Uiguro +Name[ja]=ウィグル語 +Name[ka]=უიღური +Name[kk]=Ұйғырша +Name[km]=អ៊ុយហ្គៀរ +Name[ko]=위구르어 +Name[lg]=Lu-uyiguru +Name[lt]=Uigurų +Name[lv]=Uiguru +Name[mr]=उइघुर +Name[nb]=Uigurisk +Name[nds]=Uighuursch +Name[nl]=Oeigoers +Name[nn]=Uigurisk +Name[pa]=ਉਘੁਰ +Name[pl]=Ujgurski +Name[pt]=Uyghur +Name[pt_BR]=Uigur +Name[ro]=Uigură +Name[ru]=Уйгурский +Name[sa]=उयघुर +Name[se]=Uiguragiella +Name[sk]=Ujgurčina +Name[sl]=Ujgurščina +Name[sq]=Ujgurisht +Name[sr]=ујгурски +Name[sr@ijekavian]=ујгурски +Name[sr@ijekavianlatin]=ujgurski +Name[sr@latin]=ujgurski +Name[sv]=Uiguriska +Name[ta]=உய்குர் +Name[tg]=Уйгурӣ +Name[th]=ภาษาอุยกูร์ +Name[tr]=Uygurca +Name[tt]=Уйгур +Name[ug]=ئۇيغۇرچە +Name[uk]=Уйгурська +Name[vi]=Tiếng Duy Ngô Nhĩ +Name[wa]=Ouygour +Name[zh_CN]=维吾尔语 +Name[zh_TW]=維吾爾語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/uk/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/uk/kf6_entry.desktop new file mode 100644 index 0000000000..ca2aa988e9 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/uk/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Ukrainian +Name[af]=Ukraïniese +Name[ar]=الأوكرانيّة +Name[as]=ইউক্ৰেনিয়ান +Name[ast]=Ucraín +Name[az]=Ukrayna dilində +Name[be]=Украінская +Name[be@latin]=Ukrainskaja +Name[bg]=Украински +Name[bn]=ইউক্রেনীয় +Name[bn_IN]=ইউক্রেনিয়ান +Name[br]=Ukrainiek +Name[bs]=ukrajinski +Name[ca]=Ucraïnès +Name[ca@valencia]=Ucraïnés +Name[cs]=Ukrajinský +Name[csb]=Ùkrajińsczi +Name[cy]=Wcraineg +Name[da]=Ukrainsk +Name[de]=Ukrainisch +Name[el]=Ουκρανικά +Name[en_GB]=Ukrainian +Name[eo]=Ukraina +Name[es]=Ucraniano +Name[et]=Ukraina +Name[eu]=Ukrainera +Name[fa]=اوکراینی +Name[fi]=Ukraina +Name[fr]=Ukrainien +Name[fy]=Oekraïnsk +Name[ga]=Úcráinis +Name[gd]=Ucràinis +Name[gl]=Ucraíno +Name[gu]=યુક્રેનિયન +Name[he]=אוקראינית +Name[hi]=उक्रेनियाई +Name[hne]=उक्रेनियाई +Name[hr]=Ukrajinski +Name[hsb]=Ukrainsce +Name[hu]=Ukrán +Name[ia]=Ucrainiano +Name[id]=Ukrainia +Name[is]=Úkraínska +Name[it]=Ucraino +Name[ja]=ウクライナ語 +Name[ka]=უკრაინული +Name[kk]=Украинша +Name[km]=អ៊ុយក្រែន +Name[kn]=ಯುಕ್ರೇನಿಯನ್ +Name[ko]=우크라이나어 +Name[ku]=Ûkraynayî +Name[lb]=Ukrainesch +Name[lg]=Lu-ukurayine +Name[lt]=Ukrainiečių +Name[lv]=Ukraiņu +Name[mai]=युक्रेनियन +Name[mk]=Украински +Name[ml]=ഉക്രൈനിയന്‍ +Name[mr]=यूक्रेनियन +Name[ms]=Ukrainia +Name[nb]=Ukrainsk +Name[nds]=Ukrainsch +Name[ne]=युक्रेनी +Name[nl]=Oekraïens +Name[nn]=Ukrainsk +Name[oc]=Ucraïnian +Name[or]=ୟୁକ୍ରେନିୟନ +Name[pa]=ਯੂਕਰੇਨੀ +Name[pl]=Ukraiński +Name[ps]=اکرېني +Name[pt]=Ucraniano +Name[pt_BR]=Ucraniano +Name[ro]=Ucrainiană +Name[ru]=Украинский +Name[sa]=युक्रेनियन +Name[se]=Ukrainagiella +Name[si]=යුක්‍රේනියානු +Name[sk]=Ukrajinčina +Name[sl]=Ukrajinščina +Name[sq]=Ukrahinisht +Name[sr]=украјински +Name[sr@ijekavian]=украјински +Name[sr@ijekavianlatin]=ukrajinski +Name[sr@latin]=ukrajinski +Name[sv]=Ukrainska +Name[ta]=உக்ரேனியம் +Name[te]=ఉక్రెనియన్ +Name[tg]=Украинӣ +Name[th]=ภาษายูเครน +Name[tok]=toki Ukawina +Name[tr]=Ukraynaca +Name[tt]=Украин +Name[ug]=ئۇكرائىنچە +Name[uk]=Українська +Name[uz]=Ukraincha +Name[uz@cyrillic]=Украинча +Name[vi]=Tiếng Ukraine +Name[wa]=Oucrinnyin +Name[xh]=Ukrainian +Name[zh_CN]=乌克兰语 +Name[zh_HK]=烏克蘭語 +Name[zh_TW]=烏克蘭語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/uz/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/uz/kf6_entry.desktop new file mode 100644 index 0000000000..b44e5afe64 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/uz/kf6_entry.desktop @@ -0,0 +1,100 @@ +[KCM Locale] +Name=Uzbek +Name[af]=Uzbek +Name[ar]=الأوزبكيّة +Name[as]=উজ্‌বেক +Name[ast]=Uzbecu +Name[az]=Özbək dilində +Name[be]=Узбекская +Name[be@latin]=Uzbiekskaja +Name[bg]=Узбекски +Name[bn]=উজবেক +Name[bn_IN]=উজবেক +Name[br]=Ouzbek +Name[bs]=uzbečki +Name[ca]=Uzbek +Name[ca@valencia]=Uzbek +Name[cs]=Uzbecký +Name[csb]=Ùzbecczi +Name[cy]=Usbek +Name[da]=Uzbek +Name[de]=Usbekisch +Name[el]=Ουζμπεκικά +Name[en_GB]=Uzbek +Name[eo]=Uzbeka +Name[es]=Uzbeko +Name[et]=Usbeki +Name[eu]=Uzbekera +Name[fa]=ازبکی +Name[fi]=Uzbekki +Name[fr]=Ouzbek +Name[fy]=Oezbeeksk +Name[ga]=Úisbéicis +Name[gd]=Usbagais +Name[gl]=Uzbeko +Name[gu]=ઉઝબેક +Name[he]=אוזבקית +Name[hi]=उज्बेक +Name[hne]=उज्बेक +Name[hr]=Uzbečki +Name[hsb]=Uzbekisce +Name[hu]=Üzbég +Name[ia]=Uzbeko +Name[id]=Uzbekistan +Name[is]=Úsbekska +Name[it]=Usbeco +Name[ja]=ウズベク語 +Name[ka]=უზბეკური +Name[kk]=Өзбекше +Name[km]=អ៊ូហ្សបេគីស្តង់ +Name[kn]=ಉಜ್ಬೆಕ್ +Name[ko]=우즈베크어 +Name[ku]=Ozbekî +Name[lb]=Usbekesch +Name[lg]=Lu-uzibeki +Name[lt]=Uzbekų +Name[lv]=Uzbeku +Name[mai]=उज्बेक +Name[mk]=Узбекистански +Name[ml]=ഉസ്ബെക് +Name[mr]=उज्बेक +Name[ms]=Uzbek +Name[nb]=Usbekisk +Name[nds]=Usbeeksch +Name[ne]=उज्वेक +Name[nl]=Oezbeeks +Name[nn]=Usbekisk +Name[oc]=Ozbèc +Name[or]=ଉଜବେକ +Name[pa]=ਉਜ਼ੇਬਕ +Name[pl]=Uzbecki +Name[ps]=ازبکي +Name[pt]=Uzbeque +Name[pt_BR]=Uzbeque +Name[ro]=Uzbecă +Name[ru]=Узбекский +Name[sa]=उज्बेक +Name[se]=Usbekagiella +Name[si]=උස්බෙක් +Name[sk]=Uzbečtina +Name[sl]=Uzbeščina +Name[sr]=узбечки +Name[sr@ijekavian]=узбечки +Name[sr@ijekavianlatin]=uzbečki +Name[sr@latin]=uzbečki +Name[sv]=Uzbekiska +Name[ta]=உசுபெக் +Name[te]=ఉజ్బెక్ +Name[tg]=Ӯзбакӣ +Name[th]=ภาษาอุซเบกิสถาน +Name[tr]=Özbekçe +Name[tt]=Үзбәк +Name[ug]=ئۆزبېكچە +Name[uk]=Узбецька +Name[uz]=Oʻzbekcha +Name[uz@cyrillic]=Ўзбекча +Name[vi]=Tiếng Uzbek +Name[wa]=Ouzbeke +Name[zh_CN]=乌兹别克语 +Name[zh_HK]=烏玆別克語 +Name[zh_TW]=烏玆別克語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/uz@cyrillic/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/uz@cyrillic/kf6_entry.desktop new file mode 100644 index 0000000000..7d0371b067 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/uz@cyrillic/kf6_entry.desktop @@ -0,0 +1,93 @@ +[KCM Locale] +Name=Uzbek (Cyrillic) +Name[ar]=الأوزبكيّة (السيرياليّة) +Name[as]=উজ্‌বেক (ছিৰিলিক) +Name[ast]=Uzbecu (alfabetu cirílicu) +Name[az]=Özbək (Kirill) dilində +Name[be]=Узбекская (кірыліца) +Name[be@latin]=Uzbiekskaja (kirylica) +Name[bg]=Узбекски (кирилица) +Name[bn]=উজবেক (কিরিলিক) +Name[bn_IN]=উজবেক (সিরিলিক) +Name[bs]=uzbečki (ćirilica) +Name[ca]=Uzbek (ciríl·lic) +Name[ca@valencia]=Uzbek (ciríl·lic) +Name[cs]=Uzbecký (azbuka) +Name[csb]=Ùzbecczi (cërëlica) +Name[da]=Uzbek (Kyrillisk) +Name[de]=Usbekisch (Kyrillisch) +Name[el]=Ουζμπεκικά (Κυριλλικά) +Name[en_GB]=Uzbek (Cyrillic) +Name[eo]=Uzbeka (cirila) +Name[es]=Uzbeko (Cirílico) +Name[et]=Usbeki (kirillitsa) +Name[eu]=Uzbekera (Zirilikoa) +Name[fa]=ازبک (سیریلیک) +Name[fi]=Uzbekki (kyrillinen) +Name[fr]=Ouzbek (Cyrillique) +Name[fy]=Uzbeeks (Cyrillic) +Name[ga]=Úisbéicis (Coireallach) +Name[gd]=Usbagais (Cirilis) +Name[gl]=Uzbeko (cirílico) +Name[gu]=ઉઝબેક (સિરીલિક) +Name[he]=אוזבקית קרילית +Name[hi]=उज़बैक (सिरिलिक) +Name[hne]=उजबैक (सिरिलिक) +Name[hr]=Uzbečki, ćirilica +Name[hsb]=Uzbeksce (z kyriliskim pismom) +Name[hu]=Üzbég (cirill) +Name[ia]=Uzbeko (Cirillico) +Name[id]=Uzbekistan (Cyrillic) +Name[is]=Úsbekska (kyrilískt letur) +Name[it]=Usbeco (cirillico) +Name[ja]=ウズベク語 (キリル文字) +Name[ka]=უზბეკური (კირილიცა) +Name[kk]=Өзбекше (Кирилл жазуы) +Name[km]=អ៊ូហ្សបេគីស្តង់ (ស៊ីលីរីក) +Name[kn]=ಉಜ್ಬೆಕ್ (ಸಿರಿಲಿಕ್) +Name[ko]=우즈베크어(키릴 문자) +Name[ku]=Ozbekî (Kîrîl) +Name[lg]=Lu-uzibeki (walifu ya kisiriiri) +Name[lt]=Uzbekų (kirilica) +Name[lv]=Uzbeku (kirilica) +Name[mai]=उस्बेक (सिरिलिक) +Name[mk]=Узбекистански (кириличен) +Name[ml]=ഉസ്ബെക്ക് (സിറിലിക്) +Name[mr]=सिरीलिक +Name[ms]=Uzbek (Cyrillic) +Name[nb]=Usbekisk (kyrillisk) +Name[nds]=Usbeeksch (kyrillsch) +Name[nl]=Oezbeeks (Cyrilisch) +Name[nn]=Usbekisk (kyrillisk) +Name[oc]=Ozbèc (cirillic) +Name[or]=ଉଜବେକ (ସିରିଲିକ) +Name[pa]=ਉਜੇਬਿਕ (ਸਿਰਲਿਕ) +Name[pl]=Uzbecki (cyrlica) +Name[ps]=ازبکي (سېرېلېک) +Name[pt]=Uzbeque (Cirílico) +Name[pt_BR]=Uzbeque (Cirílico) +Name[ro]=Uzbekă (Chirilic) +Name[ru]=Узбекский (Кириллица) +Name[sa]=उज्बेक (सिरिलिक) +Name[se]=Usbekalašgiella (Kyrillalaš) +Name[si]=උස්බක් (සිරිල්ලික්) +Name[sk]=Uzbečtina (cyrilika) +Name[sl]=Uzbeščina (cirilica) +Name[sr]=узбечки (ћирилица) +Name[sr@ijekavian]=узбечки (ћирилица) +Name[sr@ijekavianlatin]=uzbečki (ćirilica) +Name[sr@latin]=uzbečki (ćirilica) +Name[sv]=Kyrillisk Uzbekiska +Name[ta]=உஸ்பெக் (சைரிலிக்) +Name[tg]=Ӯзбакӣ (Кирилликӣ) +Name[th]=ภาษาอุซเบกิสถาน (ไซริลลิค) +Name[tr]=Özbekçe (Kiril) +Name[tt]=Үзбәк (кирилл) +Name[ug]=ئۆزبېكچە(سلاۋيان) +Name[uk]=Узбецька (кирилиця) +Name[uz]=Oʻzbekcha (kiril) +Name[uz@cyrillic]=Ўзбекча (кирил) +Name[vi]=Tiếng Uzbek (Ki-rin) +Name[wa]=Ouzbeke (cirilike) +Name[zh_CN]=乌兹别克语 (西里尔字母) +Name[zh_TW]=烏茲別克語(西里爾字母) diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/vi/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/vi/kf6_entry.desktop new file mode 100644 index 0000000000..59de7b2c87 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/vi/kf6_entry.desktop @@ -0,0 +1,102 @@ +[KCM Locale] +Name=Vietnamese +Name[af]=Viëtnamese +Name[ar]=الفييتناميّة +Name[as]=ভিয়েটনামীয় +Name[ast]=Vietnamita +Name[az]=Vyetnam dilində +Name[be]=В'етнамская +Name[be@latin]=Vjetnamskaja +Name[bg]=Виетнамски +Name[bn]=ভিয়েতনামী +Name[bn_IN]=ভিয়েতনামিস +Name[br]=Viet-Nameg +Name[bs]=vijetnamski +Name[ca]=Vietnamita +Name[ca@valencia]=Vietnamita +Name[cs]=Vietnamský +Name[csb]=Wietnamsczi +Name[cy]=Fietnameg +Name[da]=Vietnamesisk +Name[de]=Vietnamesisch +Name[el]=Βιετναμέζικα +Name[en_GB]=Vietnamese +Name[eo]=Vjetnama +Name[es]=Vietnamita +Name[et]=Vietnami +Name[eu]=Vietnamera +Name[fa]=ویتنامی +Name[fi]=Vietnam +Name[fr]=Vietnamien +Name[fy]=Vietnameesk +Name[ga]=Vítneamais +Name[gd]=Bhiet-Namais +Name[gl]=Vietnamita +Name[gu]=વિયેટનામીઝ +Name[he]=וייטנאמית +Name[hi]=विएतनामी +Name[hne]=विएतनामी +Name[hr]=Vijetnamski +Name[hsb]=Vietnamsce +Name[hu]=Vietnami +Name[ia]=Vietnamese +Name[id]=Vietnam +Name[is]=Víetnamska +Name[it]=Vietnamita +Name[ja]=ベトナム語 +Name[ka]=ვიეტნამური +Name[kk]=Вьетнамша +Name[km]=វៀតណាម +Name[kn]=ವಿಯೆಟ್ನಾಮೀಸ್ +Name[ko]=베트남어 +Name[ku]=Viyetnamî +Name[lb]=Vietnamesesch +Name[lg]=Luviyetinamu +Name[lt]=Vietnamiečių +Name[lv]=Vjetnamiešu +Name[mai]=विएतनामी +Name[mk]=Виетнамски +Name[ml]=വിയറ്റ്നാമീസ് +Name[mr]=वियेतनामी +Name[ms]=Vietnam +Name[nb]=Vietnamesisk +Name[nds]=Vietnameesch +Name[ne]=भियतनामी +Name[nl]=Vietnamees +Name[nn]=Vietnamesisk +Name[oc]=Vietnamés +Name[or]=ଭିଏତନାମିଜ +Name[pa]=ਵੀਅਤਨਾਮੀ +Name[pl]=Wietnamski +Name[ps]=وېټنامي +Name[pt]=Vietnamita +Name[pt_BR]=Vietnamita +Name[ro]=Vietnameză +Name[ru]=Вьетнамский +Name[sa]=वियतनामी +Name[se]=Vietnamagiella +Name[si]=වියට්නාම +Name[sk]=Vietnamčina +Name[sl]=Vietnamščina +Name[sq]=Vietnamisht +Name[sr]=вијетнамски +Name[sr@ijekavian]=вијетнамски +Name[sr@ijekavianlatin]=vijetnamski +Name[sr@latin]=vijetnamski +Name[sv]=Vietnamesiska +Name[ta]=வியட்னாமியம் +Name[te]=వియత్నమీస్ +Name[tg]=Ветнамӣ +Name[th]=ภาษาเวียตนาม +Name[tr]=Vietnamca +Name[tt]=Вьетнам +Name[ug]=ۋىيېتنامچە +Name[uk]=В'єтнамська +Name[uz]=Vetnamcha +Name[uz@cyrillic]=Ветнамча +Name[vi]=Tiếng Việt +Name[wa]=Vietnamyin +Name[xh]=Vietnamese +Name[zh_CN]=越南语 +Name[zh_HK]=越南語 +Name[zh_TW]=越南語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/wa/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/wa/kf6_entry.desktop new file mode 100644 index 0000000000..1d504ad3b4 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/wa/kf6_entry.desktop @@ -0,0 +1,101 @@ +[KCM Locale] +Name=Walloon +Name[af]=Walloonse +Name[ar]=الوالونيّة +Name[as]=ৱেলুন +Name[ast]=Valón +Name[az]=Vallon dilində +Name[be]=Валонская +Name[be@latin]=Valonskaja +Name[bg]=Валонски +Name[bn]=ওয়ালুন +Name[bn_IN]=ওয়ালুন +Name[br]=Walloneg +Name[bs]=valonski +Name[ca]=Való +Name[ca@valencia]=Való +Name[cs]=Valonský +Name[csb]=Walońsczi +Name[cy]=Walwneg +Name[da]=Vallonsk +Name[de]=Wallonisch +Name[el]=Βαλούν +Name[en_GB]=Walloon +Name[eo]=Valona +Name[es]=Valón +Name[et]=Vallooni +Name[eu]=Valoiera +Name[fa]=والونی +Name[fi]=Valloni +Name[fr]=Wallon +Name[fy]=Waalsk +Name[ga]=Vallúnais +Name[gd]=Bhallonais +Name[gl]=Valón +Name[gu]=વોલુન +Name[he]=וולונית +Name[hi]=वालून +Name[hne]=वालून +Name[hr]=Valunjski +Name[hsb]=Walloonsce +Name[hu]=Vallon +Name[ia]=Valloniano +Name[id]=Walloon +Name[is]=Vallónska +Name[it]=Vallone +Name[ja]=ワロン語 +Name[ka]=ვალუნი +Name[kk]=Валлонша +Name[km]=វ៉ាឡុង +Name[kn]=ವಾಲೂನ್ +Name[ko]=왈롱어 +Name[ku]=Walûn +Name[lb]=Wallounesch +Name[lg]=Luwaloni +Name[lt]=Valonų +Name[lv]=Valoņu +Name[mai]=वालून +Name[mk]=Валонски +Name[ml]=വലൂണ്‍ +Name[mr]=वालून +Name[ms]=Walloon +Name[nb]=Vallonsk +Name[nds]=Walloonsch +Name[ne]=वालोन +Name[nl]=Waals +Name[nn]=Vallonsk +Name[oc]=Valon +Name[or]=ୱାଲୁନ +Name[pa]=ਵੱਲੂਨ +Name[pl]=Waloński +Name[ps]=والون +Name[pt]=Valão +Name[pt_BR]=Valão +Name[ro]=Valonă +Name[ru]=Валлонский +Name[sa]=वालून +Name[se]=Vallonagiella +Name[si]=වැලූන් +Name[sk]=Valónčina +Name[sl]=Valonščina +Name[sr]=валонски +Name[sr@ijekavian]=валонски +Name[sr@ijekavianlatin]=valonski +Name[sr@latin]=valonski +Name[sv]=Vallonska +Name[ta]=வாலூன் +Name[te]=వాలూన్ +Name[tg]=Валунӣ +Name[th]=ภาษาวัลลูน +Name[tr]=Valonca +Name[tt]=Валлон +Name[ug]=ۋاللۇنچە +Name[uk]=Валлонська +Name[uz]=Valloncha +Name[uz@cyrillic]=Валлонча +Name[vi]=Tiếng Wallon +Name[wa]=Walon +Name[xh]=Walloon +Name[zh_CN]=瓦隆语 +Name[zh_HK]=華隆語 +Name[zh_TW]=瓦倫語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/xh/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/xh/kf6_entry.desktop new file mode 100644 index 0000000000..7b439d5ef5 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/xh/kf6_entry.desktop @@ -0,0 +1,100 @@ +[KCM Locale] +Name=Xhosa +Name[af]=Xhosa +Name[ar]=الزّوسا +Name[as]=জোছা +Name[az]=Kşosa dilində +Name[be]=Коса +Name[be@latin]=Kosa +Name[bg]=Ксоса +Name[bn]=খোসা +Name[bn_IN]=জোসা +Name[br]=Xhosa +Name[bs]=khosa +Name[ca]=Xosa +Name[ca@valencia]=Xosa +Name[cs]=Xhosa +Name[csb]=Xhosa +Name[cy]=Xhosa +Name[da]=Xhosa +Name[de]=Xhosa +Name[el]=Χόζα +Name[en_GB]=Xhosa +Name[eo]=Kosa +Name[es]=Xhosa +Name[et]=Xhosa +Name[eu]=Xhosera +Name[fa]=زسایی +Name[fi]=Xhosa +Name[fr]=Xhosa +Name[fy]=Xhosa +Name[ga]=Cóisis +Name[gd]=Xhosa +Name[gl]=Xhosa +Name[gu]=હોસા +Name[he]=קוסה +Name[hi]=झ़ोसा +Name[hne]=झ़ोसा +Name[hr]=Xhosa +Name[hsb]=Xhosa +Name[hu]=Xhosa +Name[ia]=Xhosa +Name[id]=Xhosa +Name[is]=Xhósa +Name[it]=Xhosa +Name[ja]=コサ語 +Name[ka]=ხოსა +Name[kk]=Кхоса +Name[km]=ឃសា +Name[kn]=ಕ್ಸೋಸಾ +Name[ko]=코사어 +Name[ku]=Xhosa +Name[lb]=Xhosa +Name[lg]=Lukoosa +Name[lt]=Kosų +Name[lv]=Isiķhosu +Name[mai]=झ़ोसा +Name[mk]=Ксоса +Name[ml]=ഖോസ +Name[mr]=झ़ोसा +Name[ms]=Xhosa +Name[nb]=Xhosa +Name[nds]=Xhosa +Name[ne]=होसा +Name[nl]=Xhosa +Name[nn]=Xhosa +Name[oc]=Xhosa +Name[or]=ଯୋଜା +Name[pa]=ਜ਼ੋਸਾ +Name[pl]=Xhosa +Name[ps]=کوسا +Name[pt]=Xhosa +Name[pt_BR]=Xhosa +Name[ro]=Xhosa +Name[ru]=Кшоса +Name[sa]=क्षोसा +Name[se]=Xhosagiella +Name[si]=හොසා +Name[sk]=Xhoština +Name[sl]=Koščina +Name[sr]=кхоса +Name[sr@ijekavian]=кхоса +Name[sr@ijekavianlatin]=khosa +Name[sr@latin]=khosa +Name[sv]=Xhosa +Name[ta]=சோசா +Name[te]=క్జొసా +Name[tg]=Хоса +Name[th]=ภาษาโคซา +Name[tr]=Zosa +Name[tt]=Коса +Name[ug]=كوساچە +Name[uk]=Хоза +Name[uz]=Xosa +Name[uz@cyrillic]=Хоса +Name[vi]=Tiếng Xhosa +Name[wa]=Xhossa +Name[xh]=isixhosa +Name[zh_CN]=科萨语 +Name[zh_HK]=科薩語 +Name[zh_TW]=南非柯薩語 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/zh_CN/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/zh_CN/kf6_entry.desktop new file mode 100644 index 0000000000..de16a77b5a --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/zh_CN/kf6_entry.desktop @@ -0,0 +1,103 @@ +[KCM Locale] +Name=Simplified Chinese +Name[af]=Vereenvoudigde Sjinese +Name[ar]=الصّينيّة المبسّطة +Name[as]=সৰল চীনা +Name[ast]=Chinu simplificáu +Name[az]=Sadə Çin dilində +Name[be]=Кітайская спрошчаная +Name[be@latin]=Kitajskaja sproščanaja +Name[bg]=Китайски (опростен) +Name[bn]=সরলীকৃত চৈনিক +Name[bn_IN]=চিনা (সরলীকৃত) +Name[br]=Sinaeg eeunaet +Name[bs]=kineski pojednostavljeni +Name[ca]=Xinès simplificat +Name[ca@valencia]=Xinés simplificat +Name[cs]=Zjednodušená čínština +Name[csb]=Chińsczi prosti +Name[cy]=Tseineg Syml +Name[da]=Forsimplet kinesisk +Name[de]=Chinesisch (Kurzzeichen) +Name[el]=Απλοποιημένα Κινεζικά +Name[en_GB]=Simplified Chinese +Name[eo]=Simpligita ĉina +Name[es]=Chino simplificado +Name[et]=Lihtsustatud hiina +Name[eu]=Txinatar soildua +Name[fa]=چینی ساده‌شده +Name[fi]=Yksinkertaistettu kiina +Name[fr]=Chinois simplifié +Name[fy]=Ferienfâldige Sjineesk +Name[ga]=Sínis Shimplithe +Name[gd]=Sìnis Shimplichte +Name[gl]=Chinés simplificado +Name[gu]=સરળ ચાઇનિઝ +Name[he]=סינית מפושטת +Name[hi]=सरलीकृत चीनी +Name[hne]=सरल चीनी +Name[hr]=Pojednostavljeni kineski +Name[hsb]=Zjednorjena chinšćina +Name[hu]=Kínai (egyszerűsített) +Name[ia]=Chinese Simplificate +Name[id]=China Sederhana +Name[is]=Einfölduð kínverska +Name[it]=Cinese semplificato +Name[ja]=中国語 簡体字 +Name[ka]=გამარტივებული ჩინური +Name[kk]=Жеңілтілген қытайша +Name[km]=អក្សរ​ចិនកាត់ +Name[kn]=ಸುಧಾರಿತ ಚೀನೀ +Name[ko]=중국어(간체) +Name[ku]=Çîniya hesan +Name[lb]=Einfacht Chinesesch +Name[lg]=Lucayina Olugonze +Name[lt]=Kinų supaprastinta +Name[lv]=Vienkāršotā ķīniešu +Name[mai]=सरल चीनी +Name[mk]=Поедноставен Кинески +Name[ml]=ലളിതമായ ചൈനീസ് +Name[mr]=सोपे चिनी +Name[ms]=Simplified Chinese +Name[nb]=Kinesisk (forenklet) +Name[nds]=Vereenfacht Chineesch +Name[ne]=सरलीकृत चिनियाँ +Name[nl]=Vereenvoudigd Chinees +Name[nn]=Kinesisk – forenkla +Name[oc]=Chinés simplificat +Name[or]=ସରଳିକୃତ ଚାଇନିଜ +Name[pa]=ਆਮ ਚੀਨੀ +Name[pl]=Uproszczony chiński +Name[ps]=ساده چينايي +Name[pt]=Chinês Simplificado +Name[pt_BR]=Chinês simplificado +Name[ro]=Chineză simplificată +Name[ru]=Китайский (упрощённый) +Name[sa]=सरलीकृत चीनी +Name[se]=Álkkivduvvon kiinnágiella +Name[si]=සරල චීන +Name[sk]=Čínština (zjednodušená) +Name[sl]=Kitajščina (poenostavljena) +Name[sq]=Kinezisht e thjeshtuar +Name[sr]=кинески поједностављени +Name[sr@ijekavian]=кинески поједностављени +Name[sr@ijekavianlatin]=kineski pojednostavljeni +Name[sr@latin]=kineski pojednostavljeni +Name[sv]=Förenklad kinesiska +Name[ta]=இலகு சீனம் +Name[te]=సరళికరించిన చైనీస్ +Name[tg]=Хитоии Оддӣ +Name[th]=ภาษาจีนประยุกต์ +Name[tok]=toki Sonko +Name[tr]=Basitleştirilmiş Çince +Name[tt]=Гади кытай +Name[ug]=ئاددىي خەنزۇچە +Name[uk]=Спрощена китайська +Name[uz]=Soddalashtirilgan Xitoycha +Name[uz@cyrillic]=Соддалаштирилган Хитойча +Name[vi]=Tiếng Trung Giản thể +Name[wa]=Chinwès simplifyî +Name[xh]=Simplified Chinese +Name[zh_CN]=简体中文 +Name[zh_HK]=簡體中文 +Name[zh_TW]=簡體中文 diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/zh_HK/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/zh_HK/kf6_entry.desktop new file mode 100644 index 0000000000..c6e3b1b18d --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/zh_HK/kf6_entry.desktop @@ -0,0 +1,98 @@ +[KCM Locale] +Name=Chinese (Hong Kong) +Name[ar]=الصّينية (هونغ كونغ) +Name[as]=চীনা (হং কং) +Name[ast]=Chinu (Ḥong Kong) +Name[az]=Çin (Honq-Konq) dilində +Name[be]=Кітайская (Гонг-Конг) +Name[be@latin]=Kitajskaja (Honh-Konh) +Name[bg]=Китайски (Хонг Конг) +Name[bn]=চৈনিক (হংকং) +Name[bn_IN]=চীনা (হং কং) +Name[br]=Sinaeg (Hong Kong) +Name[bs]=kineski honkonški +Name[ca]=Xinès (Hong Kong) +Name[ca@valencia]=Xinés (Hong Kong) +Name[cs]=Čínský (Hong Kong) +Name[csb]=Chińsczi (Hong Kong) +Name[da]=Kinesisk (Hong Kong) +Name[de]=Chinesisch (Hongkong) +Name[el]=Κινεζικά (Χονγκ Κονγκ) +Name[en_GB]=Chinese (Hong Kong) +Name[eo]=Ĉina (Honkongo) +Name[es]=Chino (Hong Kong) +Name[et]=Hiina (Hong Kong) +Name[eu]=Txinera (Hong Konq) +Name[fa]=چینی )هنگ کنگ( +Name[fi]=Kiina (Hongkong) +Name[fr]=Chinois (Hong Kong) +Name[fy]=Sjineesk (Hong Kong) +Name[ga]=Sínis (Hong Cong) +Name[gd]=Sìnis (Hong Kong) +Name[gl]=Chinés (Hong Kong) +Name[gu]=ચાઇનીઝ (હોંગ કોંગ) +Name[he]=סינית (הונג קונג) +Name[hi]=चीनी (हांग कांग) +Name[hne]=चीनी (हांग कांग) +Name[hr]=Kineski (Hong Kong) +Name[hsb]=Chinsce +Name[hu]=Kínai (hongkongi) +Name[ia]=Chinese (Hong Kong) +Name[id]=China (Hong Kong) +Name[is]=Kínverska (Hong Kong) +Name[it]=Cinese (Hong Kong) +Name[ja]=中国語 (香港) +Name[ka]=ჩინური (ჰონკონგი) +Name[kk]=Қытайша (Сянган) +Name[km]=ចិន (ហុងកុង) +Name[kn]=ಚೀನೀ (ಹಾಂಗ್ ಕಾಂಗ್) +Name[ko]=중국어(홍콩) +Name[ku]=Çînî (Hong Kong) +Name[lb]=Chinesesch (Hong Kong) +Name[lg]=Lucayina (olwa mu Hongo Kongo) +Name[lt]=Kinų (Honkongo) +Name[lv]=Ķīniešu (Honkongas) +Name[mai]=चीनी (हाँगकाँग) +Name[mk]=Кинески (Хонг Конг) +Name[ml]=ചൈനീസ് (ഹോങ് കോങ്) +Name[mr]=चिनी (हाँगकाँग) +Name[ms]=Cina (Hong Kong) +Name[nb]=Kinesisk (Hongkong) +Name[nds]=Chineesch (Hong Kong) +Name[ne]=चिनियाँ (हङकङ) +Name[nl]=Chinees (Hong Kong) +Name[nn]=Kinesisk – Hongkong +Name[oc]=Chinés (Hong Kong) +Name[or]=ଚାଇନିଜ (ହଙ୍ଗ କଙ୍ଗ) +Name[pa]=ਚੀਨੀ (ਹਾਂਗਕਾਂਗ) +Name[pl]=Chiński (Hong Kong) +Name[ps]=چينايي (هانګ کانګ) +Name[pt]=Chinês (Hong Kong) +Name[pt_BR]=Chinês (Hong Kong) +Name[ro]=Chineză (Hong Kong) +Name[ru]=Китайский (Гонконг) +Name[sa]=चीनी (हाङ्गकाङ्ग) +Name[se]=Kiinnágiella (Hong Kong) +Name[si]=චීන (හොං කොං) +Name[sk]=Čínština (Hongkong) +Name[sl]=Kitajščina (Hongkong) +Name[sq]=Kinezisht (Hong Kong) +Name[sr]=кинески хонконшки +Name[sr@ijekavian]=кинески хонконшки +Name[sr@ijekavianlatin]=kineski honkonški +Name[sr@latin]=kineski honkonški +Name[sv]=Kinesiska (Hong Kong) +Name[ta]=சீனம் (ஹாங் காங்க்) +Name[te]=చైనీస్ (హాంగ్ కాంగ్) +Name[tg]=Хитоии Гон Конгӣ +Name[th]=ภาษาจีน (ฮ่องกง) +Name[tr]=Çince (Hong Kong) +Name[tt]=Кытай (Гонконг) +Name[ug]=خەنزۇچە (شياڭگاڭ) +Name[uk]=Китайська (Гонконг) +Name[uz]=Xitoycha (Gongkong) +Name[uz@cyrillic]=Хитойча (Гонгконг) +Name[vi]=Tiếng Trung (Hồng Công) +Name[wa]=Chinwès (Hong Kong) +Name[zh_CN]=繁体中文 (中国香港) +Name[zh_TW]=繁體中文(香港) diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/zh_TW/kf6_entry.desktop b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/zh_TW/kf6_entry.desktop new file mode 100644 index 0000000000..237dcc8e16 --- /dev/null +++ b/local/recipes/kde/kf6-kconfigwidgets/source/src/language_files/zh_TW/kf6_entry.desktop @@ -0,0 +1,81 @@ +[KCM Locale] +Name=Traditional Chinese +Name[ar]=الصّينيّة التّقليديّة +Name[ast]=Chinu tradicional +Name[az]=Ənənəvi Çin dilində +Name[be]=Кітайская традыцыйная +Name[be@latin]=Kitajskaja tradycyjnaja +Name[bg]=Китайски (традиционен) +Name[bs]=kineski tradicionalni +Name[ca]=Xinès tradicional +Name[ca@valencia]=Xinés tradicional +Name[cs]=Tradiční čínština +Name[csb]=Zwëkòwi chińsczi +Name[da]=Traditionel kinesisk +Name[de]=Chinesisch (Langzeichen) +Name[el]=Παραδοσιακά κινεζικά +Name[en_GB]=Traditional Chinese +Name[eo]=Tradicia ĉina +Name[es]=Chino tradicional +Name[et]=Traditsiooniline hiina +Name[eu]=Txinera tradizionala +Name[fa]=چینی سنتی +Name[fi]=Perinteinen kiina +Name[fr]=Chinois traditionnel +Name[fy]=Tradisjoneel sineesk +Name[ga]=Sínis Thraidisiúnta +Name[gd]=Sìnis Thradaiseanta +Name[gl]=Chinés tradicional +Name[gu]=પરંપરાગત ચાઇનિઝ +Name[he]=סינית מסורתית +Name[hi]=परंपरिक चीनी +Name[hr]=Tradicionalni kineski +Name[hu]=Kínai (hagyományos) +Name[ia]=Chinese Traditional +Name[id]=China Tradisional +Name[is]=Hefðbundin kínverska +Name[it]=Cinese tradizionale +Name[ja]=中国語 繁体字 +Name[ka]=ტრადიციული ჩინური +Name[kk]=Дәстүрлі қытайша +Name[km]=អក្សរ​ចិន​ពេញ +Name[kn]=ಸಾಂಪ್ರದಾಯಿಕ ಚೀನೀ +Name[ko]=중국어(번체) +Name[ku]=Çîniya Kevneşopî +Name[lg]=Olucayina olw'edda +Name[lt]=Kinų tradicinė +Name[lv]=Tradicionālā ķīniešu +Name[mk]=Традиционален кинески +Name[ml]=പരമ്പരാഗത ചൈനീസ് +Name[mr]=पारंपारिक चिनी +Name[nb]=Kinesisk (tradisjonell) +Name[nds]=Traditschonell Chineesch +Name[nl]=Traditioneel Chinees +Name[nn]=Kinesisk – tradisjonell +Name[pa]=ਪੁਰਾਤਨ ਚੀਨੀ +Name[pl]=Chiński tradycyjny +Name[pt]=Chinês Tradicional +Name[pt_BR]=Chinês tradicional +Name[ro]=Chineză tradițională +Name[ru]=Китайский (традиционный) +Name[sa]=पारम्परिक चीनी +Name[se]=Árbevirolaš kiinnálašgiella +Name[sk]=Čínština (tradičná) +Name[sl]=Kitajščina (tradicionalna) +Name[sq]=Kinezisht Tradicionale +Name[sr]=кинески традиционални +Name[sr@ijekavian]=кинески традиционални +Name[sr@ijekavianlatin]=kineski tradicionalni +Name[sr@latin]=kineski tradicionalni +Name[sv]=Traditionell kinesiska +Name[ta]=தொன்மைச் சீனம் +Name[tg]=Хитоии анъанавӣ +Name[th]=ภาษาจีนดั้งเดิม +Name[tr]=Geleneksel Çince +Name[tt]=Гадәти Кытай. +Name[ug]=مۇرەككەپ خەنزۇچە +Name[uk]=Традиційна китайська +Name[vi]=Tiếng Trung Phồn thể +Name[wa]=Tradicionel Chinwès +Name[zh_CN]=繁体中文 +Name[zh_TW]=正體中文 diff --git a/local/recipes/kde/kf6-kcoreaddons/kfilesystemtype_stub.cpp b/local/recipes/kde/kf6-kcoreaddons/kfilesystemtype_stub.cpp new file mode 100644 index 0000000000..d2856edc7a --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/kfilesystemtype_stub.cpp @@ -0,0 +1,15 @@ +#include +#include +#include "io/kfilesystemtype.h" + +KFileSystemType::Type KFileSystemType::fileSystemType(const QString &path) +{ + Q_UNUSED(path); + return KFileSystemType::Unknown; +} + +QString KFileSystemType::fileSystemName(KFileSystemType::Type type) +{ + Q_UNUSED(type); + return QStringLiteral("Unknown"); +} diff --git a/local/recipes/kde/kf6-kcoreaddons/source/autotests/data/org.kde.coreaddons.test-app.xml b/local/recipes/kde/kf6-kcoreaddons/source/autotests/data/org.kde.coreaddons.test-app.xml new file mode 100644 index 0000000000..b6029bee4f --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/autotests/data/org.kde.coreaddons.test-app.xml @@ -0,0 +1,72 @@ + + + + org.kde.coreaddons.test-app + CC0-1.0 + LGPL-2.0-or-later + + + KDE + + Test App (untranslated) + Test App (German) + Test App (British) + Test App Description (untranslated) + Test App Description (German) + Test App Description (British) + + Office + Utility + + https://apps.kde.org/coreaddons-test-app + https://bugs.kde.org/enter_bug.cgi?format=guided&product=frameworks-coreaddons + https://www.kde.org/community/donations/?app=itinerary&source=appdata + https://invent.kde.org/frameworks/kcoreaddons + KDE + + coreaddons-test-app + + org.kde.coreaddons.test-app.desktop + + + +
    +
  • Patch release change 1.
  • +
  • Patch release change 2 & 3.
  • +
+
+
+ + +

"Cool" (untranslated) Features:

+

"Cool" (British) Features:

+

"Cool" (German) Features:

+
    +
  • Important untranslated feature release change 1.
  • +
  • Important British feature release change 1.
  • +
  • Important German feature release change 1.
  • +
  • Not so important untranslated feature release change 2.
  • +
  • Not so important British feature release change 2.
  • +
  • Not so important German feature release change 2.
  • +
  • Feature release change 3.
  • +
+
+ https://kde.org/announcements/gear/25.12.0/ +
+ +
+ + #frameworks-devel:kde.org + + + keyboard + pointing + touch + + + 360 + +
diff --git a/local/recipes/kde/kf6-kcoreaddons/source/autotests/kformatqmltest.cpp b/local/recipes/kde/kf6-kcoreaddons/source/autotests/kformatqmltest.cpp new file mode 100644 index 0000000000..bf2a8a8a94 --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/autotests/kformatqmltest.cpp @@ -0,0 +1,49 @@ +/* + SPDX-FileCopyrightText: ⓒ 2025 Volker Krause + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include +#include +#include + +using namespace Qt::Literals; + +void setupEnvironment() +{ + qputenv("TZ", "Asia/Kolkata"); + QLocale::setDefault(QLocale(u"en_GB")); +} +Q_CONSTRUCTOR_FUNCTION(setupEnvironment) + +class Object +{ + Q_GADGET + Q_PROPERTY(QDateTime euTime MEMBER m_euTime) + Q_PROPERTY(QDateTime indiaTime MEMBER m_indiaTime) + Q_PROPERTY(QDateTime utcTime MEMBER m_utcTime) + Q_PROPERTY(QString systemTimeZone READ systemTimeZone) +private: + QDateTime m_euTime = {{2025, 5, 29}, {12, 34}, QTimeZone("Europe/Brussels")}; + QDateTime m_indiaTime = {{2025, 5, 29}, {12, 34}, QTimeZone("Asia/Kolkata")}; + QDateTime m_utcTime = {{2025, 5, 29}, {12, 34}, QTimeZone::utc()}; + + [[nodiscard]] QString systemTimeZone() const + { + return QString::fromUtf8(QTimeZone::systemTimeZone().id()); + } +}; + +class KFormatQmlSetup : public QObject +{ + Q_OBJECT +public Q_SLOTS: + void qmlEngineAvailable(QQmlEngine *engine) + { + engine->rootContext()->setContextProperty(u"_obj"_s, QVariant::fromValue(Object())); + } +}; + +QUICK_TEST_MAIN_WITH_SETUP(kformatqmltest, KFormatQmlSetup) + +#include "kformatqmltest.moc" diff --git a/local/recipes/kde/kf6-kcoreaddons/source/autotests/kformatqmltest.qml b/local/recipes/kde/kf6-kcoreaddons/source/autotests/kformatqmltest.qml new file mode 100644 index 0000000000..264fd45539 --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/autotests/kformatqmltest.qml @@ -0,0 +1,28 @@ +/* + SPDX-FileCopyrightText: ⓒ 2025 Volker Krause + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +import QtQml +import QtTest 1.2 +import org.kde.coreaddons as KCoreAddons + +TestCase { + name: "KFormatQml" + + function test_formatTime() { + if (_obj.systemTimeZone !== "Asia/Kolkata") { + skip("timezone change not supported on this platform"); + } + compare(KCoreAddons.Format.formatTime(_obj, "euTime", Locale.ShortFormat, KCoreAddons.FormatTypes.AddTimezoneAbbreviationIfNeeded), "12:34 CEST"); + compare(KCoreAddons.Format.formatTime(_obj, "indiaTime", Locale.ShortFormat, KCoreAddons.FormatTypes.AddTimezoneAbbreviationIfNeeded), "12:34"); + compare(KCoreAddons.Format.formatTime(_obj, "utcTime", Locale.ShortFormat, KCoreAddons.FormatTypes.AddTimezoneAbbreviationIfNeeded), "12:34 UTC"); + + compare(KCoreAddons.Format.formatTime(_obj, "indiaTime", Locale.ShortFormat, KCoreAddons.FormatTypes.AddTimezoneAbbreviation), "12:34 IST"); + compare(KCoreAddons.Format.formatTime(_obj, "utcTime", Locale.ShortFormat), "12:34"); + compare(KCoreAddons.Format.formatTime(_obj, "euTime"), "12:34"); + + compare(KCoreAddons.Format.formatTime(_obj, "invalid", Locale.ShortFormat), ""); + compare(KCoreAddons.Format.formatTime(null, "invalid", Locale.ShortFormat), ""); + } +} diff --git a/local/recipes/kde/kf6-kcoreaddons/source/examples/python/kaboutdata.py b/local/recipes/kde/kf6-kcoreaddons/source/examples/python/kaboutdata.py new file mode 100755 index 0000000000..1fa9210ba3 --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/examples/python/kaboutdata.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 + +# SPDX-FileCopyrightText: 2025 Nicolas Fella +# SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + +import sys + +from KCoreAddons import KAboutData, KAboutPerson +from PySide6 import QtCore + +app = QtCore.QCoreApplication() + +about = KAboutData("myapp", "My Application", "1.0") + +me = KAboutPerson("Nicolas Fella", "Author", "nicolas.fella@kde.org") +about.addAuthor(me) + +KAboutData.setApplicationData(about) + +print(f"Hello, this is {about.displayName()} {about.version()}, written by {about.authors()[0].name()}.") + +print(f"Hello, from QApp {QtCore.QCoreApplication.applicationName()} {QtCore.QCoreApplication.applicationVersion()}.") + +sys.exit(app.exec()) diff --git a/local/recipes/kde/kf6-kcoreaddons/source/examples/python/kformat.py b/local/recipes/kde/kf6-kcoreaddons/source/examples/python/kformat.py new file mode 100755 index 0000000000..f1029658fa --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/examples/python/kformat.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +# SPDX-FileCopyrightText: 2025 Nicolas Fella +# SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + +from KCoreAddons import KFormat + +formatter = KFormat() + +print(formatter.formatByteSize(1234567)) + +print(formatter.formatDecimalDuration(54353534)) + +print(formatter.formatDistance(3.41, KFormat.MetricDistanceUnits)) + +print(formatter.formatDuration(1234567, KFormat.AbbreviatedDuration)) + +print(formatter.formatSpelloutDuration(1234567)) diff --git a/local/recipes/kde/kf6-kcoreaddons/source/poqm/am/kcoreaddons6_qt.po b/local/recipes/kde/kf6-kcoreaddons/source/poqm/am/kcoreaddons6_qt.po new file mode 100644 index 0000000000..30eb86d053 --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/poqm/am/kcoreaddons6_qt.po @@ -0,0 +1,1024 @@ +# SPDX-FileCopyrightText: 2026 Wesenseged +msgid "" +msgstr "" +"Project-Id-Version: \n" +"PO-Revision-Date: 2026-05-04 17:14+0300\n" +"Last-Translator: Wesenseged \n" +"Language-Team: English \n" +"Language: am\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Qt-Contexts: true\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 25.12.3\n" + +#: lib/io/kfilesystemtype.cpp:275 +msgctxt "KFileSystemType|" +msgid "NFS" +msgstr "NFS" + +#: lib/io/kfilesystemtype.cpp:277 +msgctxt "KFileSystemType|" +msgid "SMB" +msgstr "SMB" + +#: lib/io/kfilesystemtype.cpp:279 +msgctxt "KFileSystemType|" +msgid "FAT" +msgstr "FAT" + +#: lib/io/kfilesystemtype.cpp:281 +msgctxt "KFileSystemType|" +msgid "RAMFS" +msgstr "RAMFS" + +#: lib/io/kfilesystemtype.cpp:283 +msgctxt "KFileSystemType|" +msgid "Other" +msgstr "ሌላ" + +#: lib/io/kfilesystemtype.cpp:285 +msgctxt "KFileSystemType|" +msgid "NTFS" +msgstr "NTFS" + +#: lib/io/kfilesystemtype.cpp:287 +msgctxt "KFileSystemType|" +msgid "ExFAT" +msgstr "ExFAT" + +#: lib/io/kfilesystemtype.cpp:289 +msgctxt "KFileSystemType|" +msgid "FUSE" +msgstr "FUSE" + +#: lib/io/kfilesystemtype.cpp:291 +msgctxt "KFileSystemType|" +msgid "Unknown" +msgstr "የማይታወቅ" + +#: lib/kaboutdata.cpp:283 +#, qt-format +msgctxt "KAboutLicense|" +msgid "

This program is distributed under the terms of the %1.

" +msgstr "

ይህ ፕሮግራም የተሰራጨው በ%1 ውሎች ነው።

" + +#: lib/kaboutdata.cpp:284 +#, qt-format +msgctxt "KAboutLicense|" +msgid "" +"

You can find the full terms on the SPDX website.

" +msgstr "" +"

ሙሉ ውሎችን በዚ ላይ ማግኘት ይችላሉ የSPDX ድህረገፅ.

" + +#: lib/kaboutdata.cpp:296 +msgctxt "KAboutLicense|" +msgid "" +"No licensing terms for this program have been specified.\n" +"Please check the documentation or the source for any\n" +"licensing terms.\n" +msgstr "" +"ለዚህ ፕሮግራም ምንም የፍቃድ ውል አልተገለፀም።\n" +"እባክዎ ለማንኛውም ሰነዱን ወይም ምንጩን ያረጋግጡ\n" +"የፍቃድ አሰጣጥ ውሎች።\n" + +#: lib/kaboutdata.cpp:304 +#, qt-format +msgctxt "KAboutLicense|" +msgid "This program is distributed under the terms of the %1." +msgstr "ይህ ፕሮግራም የተሰራጨው በ%1 ውሎች ነው።" + +#: lib/kaboutdata.cpp:348 +msgctxt "KAboutLicense|@item license (short name)" +msgid "GPL v2" +msgstr "GPL v2" + +#: lib/kaboutdata.cpp:349 +msgctxt "KAboutLicense|@item license" +msgid "GNU General Public License Version 2" +msgstr "GNU General Public License Version 2" + +#: lib/kaboutdata.cpp:352 +msgctxt "KAboutLicense|@item license (short name)" +msgid "LGPL v2" +msgstr "LGPL v2" + +#: lib/kaboutdata.cpp:353 +msgctxt "KAboutLicense|@item license" +msgid "GNU Lesser General Public License Version 2" +msgstr "GNU Lesser General Public License Version 2" + +#: lib/kaboutdata.cpp:356 +msgctxt "KAboutLicense|@item license (short name)" +msgid "BSD License" +msgstr "BSD License" + +#: lib/kaboutdata.cpp:357 +msgctxt "KAboutLicense|@item license" +msgid "BSD License" +msgstr "BSD License" + +#: lib/kaboutdata.cpp:360 +msgctxt "KAboutLicense|@item license (short name)" +msgid "Artistic License" +msgstr "Artistic License" + +#: lib/kaboutdata.cpp:361 +msgctxt "KAboutLicense|@item license" +msgid "Artistic License" +msgstr "Artistic License" + +#: lib/kaboutdata.cpp:364 +msgctxt "KAboutLicense|@item license (short name)" +msgid "GPL v3" +msgstr "GPL v3" + +#: lib/kaboutdata.cpp:365 +msgctxt "KAboutLicense|@item license" +msgid "GNU General Public License Version 3" +msgstr "GNU General Public License Version 3" + +#: lib/kaboutdata.cpp:368 +msgctxt "KAboutLicense|@item license (short name)" +msgid "LGPL v3" +msgstr "LGPL v3" + +#: lib/kaboutdata.cpp:369 +msgctxt "KAboutLicense|@item license" +msgid "GNU Lesser General Public License Version 3" +msgstr "GNU Lesser General Public License Version 3" + +#: lib/kaboutdata.cpp:372 +msgctxt "KAboutLicense|@item license (short name)" +msgid "LGPL v2.1" +msgstr "LGPL v2.1" + +#: lib/kaboutdata.cpp:373 +msgctxt "KAboutLicense|@item license" +msgid "GNU Lesser General Public License Version 2.1" +msgstr "GNU Lesser General Public License Version 2.1" + +#: lib/kaboutdata.cpp:376 +msgctxt "KAboutLicense|@item license (short name)" +msgid "MIT License" +msgstr "MIT License" + +#: lib/kaboutdata.cpp:377 +msgctxt "KAboutLicense|@item license" +msgid "MIT License" +msgstr "MIT License" + +#: lib/kaboutdata.cpp:380 +msgctxt "KAboutLicense|@item license (short name)" +msgid "CC0" +msgstr "CC0" + +#: lib/kaboutdata.cpp:381 +msgctxt "KAboutLicense|@item license" +msgid "Creative Commons Zero" +msgstr "Creative Commons Zero" + +#: lib/kaboutdata.cpp:384 +msgctxt "KAboutLicense|@item license (short name)" +msgid "ODbL v1.0" +msgstr "ODbL v1.0" + +#: lib/kaboutdata.cpp:385 +msgctxt "KAboutLicense|@item license" +msgid "Open Data Commons Open Database License v1.0" +msgstr "Open Data Commons Open Database License v1.0" + +#: lib/kaboutdata.cpp:388 +msgctxt "KAboutLicense|@item license (short name)" +msgid "Apache 2.0" +msgstr "Apache 2.0" + +#: lib/kaboutdata.cpp:389 +msgctxt "KAboutLicense|@item license" +msgid "Apache License 2.0" +msgstr "Apache License 2.0" + +#: lib/kaboutdata.cpp:392 +msgctxt "KAboutLicense|@item license (short name)" +msgid "FTL" +msgstr "FLT" + +#: lib/kaboutdata.cpp:393 +msgctxt "KAboutLicense|@item license" +msgid "Freetype Project License" +msgstr "Freetype Project License" + +#: lib/kaboutdata.cpp:396 +msgctxt "KAboutLicense|@item license (short name)" +msgid "Boost License" +msgstr "Boost License" + +#: lib/kaboutdata.cpp:397 +msgctxt "KAboutLicense|@item license" +msgid "Boost Software License 1.0" +msgstr "Boost Software License 1.0" + +#: lib/kaboutdata.cpp:400 +msgctxt "KAboutLicense|@item license (short name)" +msgid "BSD-3-Clause" +msgstr "BSD-3-Clause" + +#: lib/kaboutdata.cpp:401 +msgctxt "KAboutLicense|@item license" +msgid "BSD 3-Clause \"New\" or \"Revised\" License" +msgstr "BSD 3-Clause \"New\" or \"Revised\" License" + +#: lib/kaboutdata.cpp:404 +msgctxt "KAboutLicense|@item license (short name)" +msgid "MPL 2.0" +msgstr "MPL 2.0" + +#: lib/kaboutdata.cpp:405 +msgctxt "KAboutLicense|@item license" +msgid "Mozilla Public License 2.0" +msgstr "Mozilla Public License 2.0" + +#: lib/kaboutdata.cpp:409 +msgctxt "KAboutLicense|@item license" +msgid "Custom" +msgstr "ብጁ" + +#: lib/kaboutdata.cpp:412 +msgctxt "KAboutLicense|@item license" +msgid "Not specified" +msgstr "አልተገለጸም " + +#: lib/kaboutdata.cpp:1069 +msgctxt "KAboutData|replace this with information about your translation team" +msgid "" +"

KDE is translated into many languages thanks to the work of the " +"translation teams all over the world.

For more information on KDE " +"internationalization visit https://l10n.kde." +"org

" +msgstr "" +"

KDE ወደ ብዙ ቋንቋዎች ተተርጉሟል ምስጋና በዓለም ዙሪያ ያሉ የትርጉም ቡድኖች።

በKDE ላይ ለበለጠ " +"መረጃ አለማቀፋዊ ጉብኝት https://l10n.kde.org

" + +#: lib/kaboutdata.cpp:1317 +msgctxt "KAboutData CLI|" +msgid "Show author information." +msgstr "የጻፊውን መረጃ አሳይ።" + +#: lib/kaboutdata.cpp:1318 +msgctxt "KAboutData CLI|" +msgid "Show license information." +msgstr "የፍቃድ መረጃ አሳይ።" + +#: lib/kaboutdata.cpp:1320 +msgctxt "KAboutData CLI|" +msgid "The base file name of the desktop entry for this application." +msgstr "ለዚህ መተግበሪያ የዴስክቶፕ መግቢያ ዋና የፋይል ስም።" + +#: lib/kaboutdata.cpp:1321 +msgctxt "KAboutData CLI|" +msgid "file name" +msgstr "የፋይል ስም" + +#: lib/kaboutdata.cpp:1331 +msgctxt "KAboutData CLI|" +msgid "This application was written by somebody who wants to remain anonymous." +msgstr "ይህ መተግበሪያ የተጻፈው ማንነታቸው እንዳይገለጽ በሚፈልጉ ግለሰብ ነው።" + +#: lib/kaboutdata.cpp:1339 +#, qt-format +msgctxt "KAboutData CLI|" +msgid "%1 was written by:" +msgstr "%1 የተፃፈው በ፦" + +#: lib/kaboutdata.cpp:1350 +msgctxt "KAboutData CLI|" +msgid "Please use https://bugs.kde.org to report bugs." +msgstr "እባክዎን ስህተቶችን ሪፖርት ለማድረግ https://bugs.kde.org ይጠቀሙ።" + +#: lib/kaboutdata.cpp:1352 +#, qt-format +msgctxt "KAboutData CLI|" +msgid "Please report bugs to %1." +msgstr "እባክዎን ስህተቶችን ለ%1 ሪፖርት ያድርጉ።" + +#: lib/plugin/kpluginfactory.cpp:33 +#, qt-format +msgctxt "KPluginFactory|" +msgid "Could not find plugin %1" +msgstr "ፕለጊን %1 ማግኘት አልተቻለም" + +#: lib/plugin/kpluginfactory.cpp:42 +#, qt-format +msgctxt "KPluginFactory|" +msgid "Could not load plugin from %1: %2" +msgstr "ፕለጊን ከ%1 መጫን አልተቻለም፦ %2 " + +#: lib/plugin/kpluginfactory.cpp:53 +#, qt-format +msgctxt "KPluginFactory|" +msgid "The library %1 does not offer a KPluginFactory." +msgstr "ላይብረሪ %1 KPluginFactory አያቀርብም።" + +#: lib/plugin/kpluginfactory.h:424 +#, qt-format +msgctxt "KPluginFactory|" +msgid "KPluginFactory could not create a %1 instance from %2" +msgstr "KPluginFactory ከ%2 የ%1 ኢንስታንስ መፍጠር አልቻለም" + +#: lib/util/kformatprivate.cpp:103 +msgctxt "KFormat|SI prefix for 10^⁻24" +msgid "y" +msgstr "y" + +#: lib/util/kformatprivate.cpp:104 +msgctxt "KFormat|SI prefix for 10^⁻21" +msgid "z" +msgstr "z" + +#: lib/util/kformatprivate.cpp:105 +msgctxt "KFormat|SI prefix for 10^⁻18" +msgid "a" +msgstr "a" + +#: lib/util/kformatprivate.cpp:106 +msgctxt "KFormat|SI prefix for 10^⁻15" +msgid "f" +msgstr "f" + +#: lib/util/kformatprivate.cpp:107 +msgctxt "KFormat|SI prefix for 10^⁻12" +msgid "p" +msgstr "p" + +#: lib/util/kformatprivate.cpp:108 +msgctxt "KFormat|SI prefix for 10^⁻9" +msgid "n" +msgstr "n" + +#: lib/util/kformatprivate.cpp:109 +msgctxt "KFormat|SI prefix for 10^⁻6" +msgid "µ" +msgstr "µ" + +#: lib/util/kformatprivate.cpp:110 +msgctxt "KFormat|SI prefix for 10^⁻3" +msgid "m" +msgstr "m" + +#: lib/util/kformatprivate.cpp:112 +msgctxt "KFormat|SI prefix for 10^3" +msgid "k" +msgstr "k" + +#: lib/util/kformatprivate.cpp:112 +msgctxt "KFormat|IEC binary prefix for 2^10" +msgid "Ki" +msgstr "Ki" + +#: lib/util/kformatprivate.cpp:113 +msgctxt "KFormat|SI prefix for 10^6" +msgid "M" +msgstr "M" + +#: lib/util/kformatprivate.cpp:113 +msgctxt "KFormat|IEC binary prefix for 2^20" +msgid "Mi" +msgstr "Mi" + +#: lib/util/kformatprivate.cpp:114 +msgctxt "KFormat|SI prefix for 10^9" +msgid "G" +msgstr "G" + +#: lib/util/kformatprivate.cpp:114 +msgctxt "KFormat|IEC binary prefix for 2^30" +msgid "Gi" +msgstr "Gi" + +#: lib/util/kformatprivate.cpp:115 +msgctxt "KFormat|SI prefix for 10^12" +msgid "T" +msgstr "T" + +#: lib/util/kformatprivate.cpp:115 +msgctxt "KFormat|IEC binary prefix for 2^40" +msgid "Ti" +msgstr "Ti" + +#: lib/util/kformatprivate.cpp:116 +msgctxt "KFormat|SI prefix for 10^15" +msgid "P" +msgstr "P" + +#: lib/util/kformatprivate.cpp:116 +msgctxt "KFormat|IEC binary prefix for 2^50" +msgid "Pi" +msgstr "Pi" + +#: lib/util/kformatprivate.cpp:117 +msgctxt "KFormat|SI prefix for 10^18" +msgid "E" +msgstr "E" + +#: lib/util/kformatprivate.cpp:117 +msgctxt "KFormat|IEC binary prefix for 2^60" +msgid "Ei" +msgstr "Ei" + +#: lib/util/kformatprivate.cpp:118 +msgctxt "KFormat|SI prefix for 10^21" +msgid "Z" +msgstr "Z" + +#: lib/util/kformatprivate.cpp:118 +msgctxt "KFormat|IEC binary prefix for 2^70" +msgid "Zi" +msgstr "Zi" + +#: lib/util/kformatprivate.cpp:119 +msgctxt "KFormat|SI prefix for 10^24" +msgid "Y" +msgstr "Y" + +#: lib/util/kformatprivate.cpp:119 +msgctxt "KFormat|IEC binary prefix for 2^80" +msgid "Yi" +msgstr "Yi" + +#: lib/util/kformatprivate.cpp:128 +msgctxt "KFormat|Symbol of binary digit" +msgid "bit" +msgstr "bit" + +#: lib/util/kformatprivate.cpp:131 +msgctxt "KFormat|Symbol of byte" +msgid "B" +msgstr "B" + +#: lib/util/kformatprivate.cpp:134 +msgctxt "KFormat|Symbol of meter" +msgid "m" +msgstr "m" + +#: lib/util/kformatprivate.cpp:137 +msgctxt "KFormat|Symbol of hertz" +msgid "Hz" +msgstr "Hz" + +#. value without prefix, format " " +#: lib/util/kformatprivate.cpp:146 +#, qt-format +msgctxt "KFormat|no Prefix" +msgid "%1 %2" +msgstr "%1 %2" + +#. value with prefix, format " " +#: lib/util/kformatprivate.cpp:165 +#, qt-format +msgctxt "KFormat|MetricBinaryDialect" +msgid "%1 %2%3" +msgstr "%1 %2%3" + +#. MetricBinaryDialect size in bytes +#: lib/util/kformatprivate.cpp:219 +#, qt-format +msgctxt "KFormat|MetricBinaryDialect" +msgid "%1 B" +msgstr "%1 B" + +#. MetricBinaryDialect size in 1000 bytes +#: lib/util/kformatprivate.cpp:222 +#, qt-format +msgctxt "KFormat|MetricBinaryDialect" +msgid "%1 kB" +msgstr "%1 kB" + +#. MetricBinaryDialect size in 10^6 bytes +#: lib/util/kformatprivate.cpp:225 +#, qt-format +msgctxt "KFormat|MetricBinaryDialect" +msgid "%1 MB" +msgstr "%1 MB" + +#. MetricBinaryDialect size in 10^9 bytes +#: lib/util/kformatprivate.cpp:228 +#, qt-format +msgctxt "KFormat|MetricBinaryDialect" +msgid "%1 GB" +msgstr "%1 GB" + +#. MetricBinaryDialect size in 10^12 bytes +#: lib/util/kformatprivate.cpp:231 +#, qt-format +msgctxt "KFormat|MetricBinaryDialect" +msgid "%1 TB" +msgstr "%1 TB" + +#. MetricBinaryDialect size in 10^15 bytes +#: lib/util/kformatprivate.cpp:234 +#, qt-format +msgctxt "KFormat|MetricBinaryDialect" +msgid "%1 PB" +msgstr "%1 PB" + +#. MetricBinaryDialect size in 10^18 byte +#: lib/util/kformatprivate.cpp:237 +#, qt-format +msgctxt "KFormat|MetricBinaryDialect" +msgid "%1 EB" +msgstr "%1 EB" + +#. MetricBinaryDialect size in 10^21 bytes +#: lib/util/kformatprivate.cpp:240 +#, qt-format +msgctxt "KFormat|MetricBinaryDialect" +msgid "%1 ZB" +msgstr "%1 ZB" + +#. MetricBinaryDialect size in 10^24 bytes +#: lib/util/kformatprivate.cpp:243 +#, qt-format +msgctxt "KFormat|MetricBinaryDialect" +msgid "%1 YB" +msgstr "%1 YB" + +#. JEDECBinaryDialect memory size in bytes +#: lib/util/kformatprivate.cpp:249 +#, qt-format +msgctxt "KFormat|JEDECBinaryDialect" +msgid "%1 B" +msgstr "%1 B" + +#. JEDECBinaryDialect memory size in 1024 bytes +#: lib/util/kformatprivate.cpp:252 +#, qt-format +msgctxt "KFormat|JEDECBinaryDialect" +msgid "%1 KB" +msgstr "%1 KB" + +#. JEDECBinaryDialect memory size in 10^20 bytes +#: lib/util/kformatprivate.cpp:255 +#, qt-format +msgctxt "KFormat|JEDECBinaryDialect" +msgid "%1 MB" +msgstr "%1 MB" + +#. JEDECBinaryDialect memory size in 10^30 bytes +#: lib/util/kformatprivate.cpp:258 +#, qt-format +msgctxt "KFormat|JEDECBinaryDialect" +msgid "%1 GB" +msgstr "%1 GB" + +#. JEDECBinaryDialect memory size in 10^40 bytes +#: lib/util/kformatprivate.cpp:261 +#, qt-format +msgctxt "KFormat|JEDECBinaryDialect" +msgid "%1 TB" +msgstr "%1 TB" + +#. JEDECBinaryDialect memory size in 10^50 bytes +#: lib/util/kformatprivate.cpp:264 +#, qt-format +msgctxt "KFormat|JEDECBinaryDialect" +msgid "%1 PB" +msgstr "%1 PB" + +#. JEDECBinaryDialect memory size in 10^60 bytes +#: lib/util/kformatprivate.cpp:267 +#, qt-format +msgctxt "KFormat|JEDECBinaryDialect" +msgid "%1 EB" +msgstr "%1 EB" + +#. JEDECBinaryDialect memory size in 10^70 bytes +#: lib/util/kformatprivate.cpp:270 +#, qt-format +msgctxt "KFormat|JEDECBinaryDialect" +msgid "%1 ZB" +msgstr "%1 ZB" + +#. JEDECBinaryDialect memory size in 10^80 bytes +#: lib/util/kformatprivate.cpp:273 +#, qt-format +msgctxt "KFormat|JEDECBinaryDialect" +msgid "%1 YB" +msgstr "%1 YB" + +#. IECBinaryDialect size in bytes +#: lib/util/kformatprivate.cpp:279 +#, qt-format +msgctxt "KFormat|IECBinaryDialect" +msgid "%1 B" +msgstr "%1 B" + +#. IECBinaryDialect size in 1024 bytes +#: lib/util/kformatprivate.cpp:282 +#, qt-format +msgctxt "KFormat|IECBinaryDialect" +msgid "%1 KiB" +msgstr "%1 KiB" + +#. IECBinaryDialect size in 10^20 bytes +#: lib/util/kformatprivate.cpp:285 +#, qt-format +msgctxt "KFormat|IECBinaryDialect" +msgid "%1 MiB" +msgstr "%1 MiB" + +#. IECBinaryDialect size in 10^30 bytes +#: lib/util/kformatprivate.cpp:288 +#, qt-format +msgctxt "KFormat|IECBinaryDialect" +msgid "%1 GiB" +msgstr "%1 GiB" + +#. IECBinaryDialect size in 10^40 bytes +#: lib/util/kformatprivate.cpp:291 +#, qt-format +msgctxt "KFormat|IECBinaryDialect" +msgid "%1 TiB" +msgstr "%1 TiB" + +#. IECBinaryDialect size in 10^50 bytes +#: lib/util/kformatprivate.cpp:294 +#, qt-format +msgctxt "KFormat|IECBinaryDialect" +msgid "%1 PiB" +msgstr "%1 PiB" + +#. IECBinaryDialect size in 10^60 bytes +#: lib/util/kformatprivate.cpp:297 +#, qt-format +msgctxt "KFormat|IECBinaryDialect" +msgid "%1 EiB" +msgstr "%1 EiB" + +#. IECBinaryDialect size in 10^70 bytes +#: lib/util/kformatprivate.cpp:300 +#, qt-format +msgctxt "KFormat|IECBinaryDialect" +msgid "%1 ZiB" +msgstr "%1 ZiB" + +#. IECBinaryDialect size in 10^80 bytes +#: lib/util/kformatprivate.cpp:303 +#, qt-format +msgctxt "KFormat|IECBinaryDialect" +msgid "%1 YiB" +msgstr "%1 YiB" + +#. @item:intext abbreviated amount of years +#: lib/util/kformatprivate.cpp:333 +#, qt-format +msgctxt "KFormat|" +msgid "%n yr" +msgid_plural "%n yr" +msgstr[0] "%n ዓ/ም" +msgstr[1] "%n ዓ/ም" + +#. @item:intext abbreviated amount of days +#: lib/util/kformatprivate.cpp:338 +#, qt-format +msgctxt "KFormat|" +msgid "%n d" +msgid_plural "%n d" +msgstr[0] "%n ቀን" +msgstr[1] "%n ቀን" + +#. @item:intext abbreviated amount of hours +#: lib/util/kformatprivate.cpp:343 +#, qt-format +msgctxt "KFormat|" +msgid "%n hr" +msgid_plural "%n hr" +msgstr[0] "%n hr" +msgstr[1] "%n hr" + +#. @item:intext abbreviated amount of minutes +#: lib/util/kformatprivate.cpp:348 +#, qt-format +msgctxt "KFormat|" +msgid "%n min" +msgid_plural "%n min" +msgstr[0] "%n min" +msgstr[1] "%n min" + +#. @item:intext abbreviated amount of seconds +#: lib/util/kformatprivate.cpp:353 +#, qt-format +msgctxt "KFormat|" +msgid "%n sec" +msgid_plural "%n sec" +msgstr[0] "%n sec" +msgstr[1] "%n sec" + +#. @item:intext Duration format minutes, seconds and milliseconds +#: lib/util/kformatprivate.cpp:379 +#, qt-format +msgctxt "KFormat|" +msgid "%1m%2.%3s" +msgstr "%1ደ%2.%3ሰ" + +#. @item:intext Duration format minutes and seconds +#: lib/util/kformatprivate.cpp:382 +#, qt-format +msgctxt "KFormat|" +msgid "%1m%2s" +msgstr "%1ደ%2ሰ" + +#. @item:intext Duration format hours and minutes +#: lib/util/kformatprivate.cpp:385 +#, qt-format +msgctxt "KFormat|" +msgid "%1h%2m" +msgstr "%1ሰ%2ደ" + +#. @item:intext Duration format hours, minutes, seconds, milliseconds +#: lib/util/kformatprivate.cpp:388 +#, qt-format +msgctxt "KFormat|" +msgid "%1h%2m%3.%4s" +msgstr "%1ሰ%2ደ%3.%4ሰ" + +#. @item:intext Duration format hours, minutes, seconds +#: lib/util/kformatprivate.cpp:396 +#, qt-format +msgctxt "KFormat|" +msgid "%1h%2m%3s" +msgstr "%1ሰ%2ደ%3ሰ" + +#. @item:intext abbreviated amount of years and abbreviated amount of days +#. ---------- +#. @item:intext abbreviated amount of days and abbreviated amount of hours +#. ---------- +#. @item:intext abbreviated amount of hours and abbreviated amount of minutes +#. ---------- +#. @item:intext abbreviated amount of minutes and abbreviated amount of seconds +#. ---------- +#. %1 is a formatted time (from QLocale.toString), %2 is a localized timezone abbreviation (from QTimeZone::displayName(QTimeZone::ShortName)). +#: lib/util/kformatprivate.cpp:432 lib/util/kformatprivate.cpp:441 +#: lib/util/kformatprivate.cpp:446 lib/util/kformatprivate.cpp:454 +#: lib/util/kformatprivate.cpp:680 +#, qt-format +msgctxt "KFormat|" +msgid "%1 %2" +msgstr "%1 %2" + +#. @item:intext Duration format minutes, seconds and milliseconds +#: lib/util/kformatprivate.cpp:459 +#, qt-format +msgctxt "KFormat|" +msgid "%1:%2.%3" +msgstr "%1:%2.%3" + +#. @item:intext Duration format minutes and seconds +#. ---------- +#. @item:intext Duration format hours and minutes +#: lib/util/kformatprivate.cpp:462 lib/util/kformatprivate.cpp:465 +#, qt-format +msgctxt "KFormat|" +msgid "%1:%2" +msgstr "%1:%2" + +#. @item:intext Duration format hours, minutes, seconds, milliseconds +#: lib/util/kformatprivate.cpp:468 +#, qt-format +msgctxt "KFormat|" +msgid "%1:%2:%3.%4" +msgstr "%1:%2:%3.%4" + +#. @item:intext Duration format hours, minutes, seconds +#: lib/util/kformatprivate.cpp:476 +#, qt-format +msgctxt "KFormat|" +msgid "%1:%2:%3" +msgstr "%1:%2:%3" + +#. @item:intext %1 is a real number, e.g. 1.23 days +#: lib/util/kformatprivate.cpp:483 +#, qt-format +msgctxt "KFormat|" +msgid "%1 days" +msgstr "%1 ቀናት" + +#. @item:intext %1 is a real number, e.g. 1.23 hours +#: lib/util/kformatprivate.cpp:486 +#, qt-format +msgctxt "KFormat|" +msgid "%1 hours" +msgstr "%1 ሰዓታት" + +#. @item:intext %1 is a real number, e.g. 1.23 minutes +#: lib/util/kformatprivate.cpp:489 +#, qt-format +msgctxt "KFormat|" +msgid "%1 minutes" +msgstr "%1 ደቂቃዎች" + +#. @item:intext %1 is a real number, e.g. 1.23 seconds +#: lib/util/kformatprivate.cpp:492 +#, qt-format +msgctxt "KFormat|" +msgid "%1 seconds" +msgstr "%1 ሰከንዶች" + +#. @item:intext %1 is a whole number +#: lib/util/kformatprivate.cpp:497 +#, qt-format +msgctxt "KFormat|" +msgid "%n millisecond(s)" +msgid_plural "%n millisecond(s)" +msgstr[0] "%n ሚሊሰከንድ" +msgstr[1] "%n ሚሊሰከንዶች" + +#. @item:intext %n is a whole number +#: lib/util/kformatprivate.cpp:508 +#, qt-format +msgctxt "KFormat|" +msgid "%n year(s)" +msgid_plural "%n year(s)" +msgstr[0] "%n ዓመት" +msgstr[1] "%n ዓመታት" + +#. @item:intext %n is a whole number +#: lib/util/kformatprivate.cpp:513 +#, qt-format +msgctxt "KFormat|" +msgid "%n day(s)" +msgid_plural "%n day(s)" +msgstr[0] "%n ቀን" +msgstr[1] "%n ቀናት" + +#. @item:intext %n is a whole number +#: lib/util/kformatprivate.cpp:518 +#, qt-format +msgctxt "KFormat|" +msgid "%n hour(s)" +msgid_plural "%n hour(s)" +msgstr[0] "%n ሰዓት" +msgstr[1] "%n ሰዓታት" + +#. @item:intext %n is a whole number +#: lib/util/kformatprivate.cpp:523 +#, qt-format +msgctxt "KFormat|" +msgid "%n minute(s)" +msgid_plural "%n minute(s)" +msgstr[0] "%n ደቂቃ" +msgstr[1] "%n ደቂቃዎች" + +#. @item:intext %n is a whole number +#: lib/util/kformatprivate.cpp:528 +#, qt-format +msgctxt "KFormat|" +msgid "%n second(s)" +msgid_plural "%n second(s)" +msgstr[0] "%n ሰከንድ" +msgstr[1] "%n ሰከንድዎች" + +#. @item:intext days and hours. This uses the previous item:intext messages. If this does not fit the grammar of your language please contact the i18n team to solve the problem +#. ---------- +#. @item:intext hours and minutes. This uses the previous item:intext messages. If this does not fit the grammar of your language please contact the i18n team to solve the problem +#. ---------- +#. @item:intext minutes and seconds. This uses the previous item:intext messages. If this does not fit the grammar of your language please contact the i18n team to solve the problem +#: lib/util/kformatprivate.cpp:553 lib/util/kformatprivate.cpp:559 +#: lib/util/kformatprivate.cpp:565 +#, qt-format +msgctxt "KFormat|" +msgid "%1 and %2" +msgstr "%1 እና %2" + +#: lib/util/kformatprivate.cpp:576 +msgctxt "" +"KFormat|used when a relative date string can't be generated because the date " +"is invalid" +msgid "Invalid date" +msgstr "ልክ ያልሆነ ቀን" + +#: lib/util/kformatprivate.cpp:586 +msgctxt "KFormat|" +msgid "In two days" +msgstr "በሁለት ቀን ውስጥ" + +#: lib/util/kformatprivate.cpp:588 +msgctxt "KFormat|" +msgid "Tomorrow" +msgstr "ነገ" + +#: lib/util/kformatprivate.cpp:590 +msgctxt "KFormat|" +msgid "Today" +msgstr "ዛሬ" + +#: lib/util/kformatprivate.cpp:592 +msgctxt "KFormat|" +msgid "Yesterday" +msgstr "ትላንት" + +#: lib/util/kformatprivate.cpp:594 +msgctxt "KFormat|" +msgid "Two days ago" +msgstr "ከሁለት ቀን በፊት" + +#: lib/util/kformatprivate.cpp:608 +msgctxt "KFormat|" +msgid "Just now" +msgstr "ልክ አሁን" + +#. @item:intext %1 is a whole number, abbreviate minute value +#: lib/util/kformatprivate.cpp:613 +#, qt-format +msgctxt "KFormat|" +msgid "%n min(s) ago" +msgid_plural "%n min(s) ago" +msgstr[0] "%n min ago" +msgstr[1] "%n mins ago" + +#. @item:intext %1 is a whole number +#: lib/util/kformatprivate.cpp:618 +#, qt-format +msgctxt "KFormat|" +msgid "%n minute(s) ago" +msgid_plural "%n minute(s) ago" +msgstr[0] "%n ደቂቃ በፊት" +msgstr[1] "%n ደቂቃዎች በፊት" + +#: lib/util/kformatprivate.cpp:623 +msgctxt "KFormat|" +msgid "Now" +msgstr "አሁን" + +#. @item:intext %1 is a whole number, abbreviate minute value +#: lib/util/kformatprivate.cpp:628 +#, qt-format +msgctxt "KFormat|" +msgid "%n min(s)" +msgid_plural "%n min(s)" +msgstr[0] "%n min" +msgstr[1] "%n mins" + +#. @item:intext %1 is a whole number +#: lib/util/kformatprivate.cpp:633 +#, qt-format +msgctxt "KFormat|" +msgid "In %n minute(s)" +msgid_plural "In %n minute(s)" +msgstr[0] "በ %n ደቂቃ" +msgstr[1] "በ %n ደቂቃዎች" + +#. relative datetime with %1 result of QLocale.toString(date, format) or formatRelativeDate and %2 result of QLocale.toString(time, timeformatType) If this does not fit the grammar of your language please contact the i18n team to solve the problem +#: lib/util/kformatprivate.cpp:648 +#, qt-format +msgctxt "KFormat|" +msgid "%1 at %2" +msgstr "%1 በ %2" + +#: lib/util/kformatprivate.cpp:696 +#, qt-format +msgctxt "KFormat|distance in feet" +msgid "%1 ft" +msgstr "%1 ft" + +#: lib/util/kformatprivate.cpp:700 lib/util/kformatprivate.cpp:702 +#, qt-format +msgctxt "KFormat|distance in miles" +msgid "%1 mi" +msgstr "%1 mi" + +#: lib/util/kformatprivate.cpp:708 +#, qt-format +msgctxt "KFormat|distance in meter" +msgid "%1 m" +msgstr "%1 m" + +#: lib/util/kformatprivate.cpp:711 lib/util/kformatprivate.cpp:713 +#, qt-format +msgctxt "KFormat|distance in kilometer" +msgid "%1 km" +msgstr "%1 km" + +#: lib/util/klistopenfilesjob_unix.cpp:39 +#, qt-format +msgctxt "QObject|" +msgid "Path %1 doesn't exist" +msgstr "ዱካ %1 የለም" + +#: lib/util/klistopenfilesjob_unix.cpp:46 +msgctxt "QObject|" +msgid "Could not find lsof executable in PATH:" +msgstr "lsof executableን በPATH ውስጥ ማግኘት አልተቻለም፦" + +#: lib/util/klistopenfilesjob_unix.cpp:55 +#, qt-format +msgctxt "QObject|" +msgid "Failed to execute `lsof'. Error code %1" +msgstr "`lsof' ማስኬድ አልተሳካም። የስህተት ኮድ %1" + +#: lib/util/klistopenfilesjob_win.cpp:27 +msgctxt "QObject|" +msgid "KListOpenFilesJob is not supported on Windows" +msgstr "KListOpenFilesJob በዊንዶውስ ላይ አይደገፍም" diff --git a/local/recipes/kde/kf6-kcoreaddons/source/python/typesystem_kcoreaddons.xml b/local/recipes/kde/kf6-kcoreaddons/source/python/typesystem_kcoreaddons.xml new file mode 100644 index 0000000000..7eb487e17e --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/python/typesystem_kcoreaddons.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/lib/io/kfilesystemtype_stub.cpp b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/io/kfilesystemtype_stub.cpp new file mode 100644 index 0000000000..d2856edc7a --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/io/kfilesystemtype_stub.cpp @@ -0,0 +1,15 @@ +#include +#include +#include "io/kfilesystemtype.h" + +KFileSystemType::Type KFileSystemType::fileSystemType(const QString &path) +{ + Q_UNUSED(path); + return KFileSystemType::Unknown; +} + +QString KFileSystemType::fileSystemName(KFileSystemType::Type type) +{ + Q_UNUSED(type); + return QStringLiteral("Unknown"); +} diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/lib/kcoreaddons-index.qdoc b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/kcoreaddons-index.qdoc new file mode 100644 index 0000000000..0d9be0c7c5 --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/kcoreaddons-index.qdoc @@ -0,0 +1,26 @@ +/*! + \page kcoreaddons-index.html + \title KCoreAddons + + KCoreAddons are addons to QtCore + + KCoreAddons provides classes built on top of QtCore to perform various tasks + such as manipulating mime types, autosaving files, creating backup files, + generating random sequences, performing text manipulations such as macro + replacement, accessing user information and many more. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {CoreAddons} {KF6::CoreAddons} + + \section1 API Reference + + \list + \li \l{KCoreAddons C++ Classes} + \li \l{KCoreAddons QML Types} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/lib/kcoreaddons.qdoc b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/kcoreaddons.qdoc new file mode 100644 index 0000000000..20dbf9b01b --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/kcoreaddons.qdoc @@ -0,0 +1,14 @@ +/*! + \module KCoreAddons + \title KCoreAddons C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent CoreAddons + + \brief Provides core non-GUI functionality. + + KCoreAddons provides classes built on top of QtCore to perform various tasks + such as manipulating mime types, autosaving files, creating backup files, + generating random sequences, performing text manipulations such as macro + replacement, accessing user information and many more. +*/ diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/lib/kcoreaddons.qdocconf b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/kcoreaddons.qdocconf new file mode 100644 index 0000000000..7223ef9191 --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/kcoreaddons.qdocconf @@ -0,0 +1,34 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KCoreAddons +description = Additions to Qt Core + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +depends += \ + kde \ + qtcore \ + kcoreaddonsqml + +navigation.landingpage = "KCoreAddons" + +qhp.projects = KCoreAddons + +qhp.KCoreAddons.file = kcoreaddons.qhp +qhp.KCoreAddons.namespace = org.kde.kcoreaddons.$QT_VERSION_TAG +qhp.KCoreAddons.virtualFolder = kcoreaddons +qhp.KCoreAddons.indexTitle = KCoreAddons +qhp.KCoreAddons.indexRoot = + +qhp.KCoreAddons.subprojects = classes +qhp.KCoreAddons.subprojects.classes.title = C++ Classes +qhp.KCoreAddons.subprojects.classes.indexTitle = KCoreAddons C++ Classes +qhp.KCoreAddons.subprojects.classes.selectors = class fake:headerfile +qhp.KCoreAddons.subprojects.classes.sortPages = true + +tagfile = kcoreaddons.tags diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifier.cpp b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifier.cpp new file mode 100644 index 0000000000..7777b3614c --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifier.cpp @@ -0,0 +1,79 @@ +/* + SPDX-FileCopyrightText: 2019 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#include "ksystemclockskewnotifier.h" +#include "ksystemclockskewnotifierengine_p.h" + +class KSystemClockSkewNotifierPrivate +{ +public: + explicit KSystemClockSkewNotifierPrivate(KSystemClockSkewNotifier *notifier); + + void loadNotifierEngine(); + void unloadNotifierEngine(); + + KSystemClockSkewNotifier *notifier; + std::shared_ptr engine; + bool isActive = false; +}; + +KSystemClockSkewNotifierPrivate::KSystemClockSkewNotifierPrivate(KSystemClockSkewNotifier *notifier) + : notifier(notifier) +{ +} + +void KSystemClockSkewNotifierPrivate::loadNotifierEngine() +{ + engine = KSystemClockSkewNotifierEngine::globalInstance(); + + if (engine) { + QObject::connect(engine.get(), &KSystemClockSkewNotifierEngine::skewed, notifier, &KSystemClockSkewNotifier::skewed); + } +} + +void KSystemClockSkewNotifierPrivate::unloadNotifierEngine() +{ + if (!engine) { + return; + } + + QObject::disconnect(engine.get(), &KSystemClockSkewNotifierEngine::skewed, notifier, &KSystemClockSkewNotifier::skewed); + engine.reset(); +} + +KSystemClockSkewNotifier::KSystemClockSkewNotifier(QObject *parent) + : QObject(parent) + , d(std::make_unique(this)) +{ +} + +KSystemClockSkewNotifier::~KSystemClockSkewNotifier() +{ +} + +bool KSystemClockSkewNotifier::isActive() const +{ + return d->isActive; +} + +void KSystemClockSkewNotifier::setActive(bool set) +{ + if (d->isActive == set) { + return; + } + + d->isActive = set; + + if (d->isActive) { + d->loadNotifierEngine(); + } else { + d->unloadNotifierEngine(); + } + + Q_EMIT activeChanged(); +} + +#include "moc_ksystemclockskewnotifier.cpp" diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifier.h b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifier.h new file mode 100644 index 0000000000..6bcf7c9164 --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifier.h @@ -0,0 +1,66 @@ +/* + SPDX-FileCopyrightText: 2019 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#pragma once + +#include + +#include +#include + +class KSystemClockSkewNotifierPrivate; + +/*! + * \class KSystemClockSkewNotifier + * \inmodule KCoreAddons + * + * \brief The KSystemClockSkewNotifier class provides a way for monitoring system clock changes. + * + * The KSystemClockSkewNotifier class makes it possible to detect discontinuous changes to + * the system clock. Such changes are usually initiated by the user adjusting values + * in the Date and Time KCM or calls made to functions like settimeofday(). + * + * \since 6.15 + */ +class KCOREADDONS_EXPORT KSystemClockSkewNotifier : public QObject +{ + Q_OBJECT + Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged) + +public: + explicit KSystemClockSkewNotifier(QObject *parent = nullptr); + ~KSystemClockSkewNotifier() override; + + /*! + * Returns \c true if the notifier is active; otherwise returns \c false. + */ + bool isActive() const; + + /*! + * Sets the active status of the clock skew notifier to \a active. + * + * The skewed() signal won't be emitted while the notifier is inactive. + * + * The notifier is inactive by default. + * + * \sa activeChanged() + */ + void setActive(bool active); + +Q_SIGNALS: + /*! + * This signal is emitted whenever the active property is changed. + */ + void activeChanged(); + + /*! + * This signal is emitted whenever the system clock is changed. + */ + void skewed(); + +private: + std::unique_ptr d; +}; diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifierengine.cpp b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifierengine.cpp new file mode 100644 index 0000000000..3ebd96234f --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifierengine.cpp @@ -0,0 +1,40 @@ +/* + SPDX-FileCopyrightText: 2019 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#include "ksystemclockskewnotifierengine_p.h" + +#include "config-util.h" + +#if defined(Q_OS_LINUX) +#include "ksystemclockskewnotifierengine_linux.h" +#elif HAVE_QTDBUS +#include "ksystemclockskewnotifierengine_dbus.h" +#endif + +std::shared_ptr KSystemClockSkewNotifierEngine::globalInstance() +{ + static std::weak_ptr singleton; + if (auto instance = singleton.lock()) { + return instance; + } + + std::shared_ptr instance; +#if defined(Q_OS_LINUX) + instance = KLinuxSystemClockSkewNotifierEngine::create(); +#elif HAVE_QTDBUS + instance = KDBusSystemClockSkewNotifierEngine::create(); +#endif + + singleton = instance; + return instance; +} + +KSystemClockSkewNotifierEngine::KSystemClockSkewNotifierEngine(QObject *parent) + : QObject(parent) +{ +} + +#include "moc_ksystemclockskewnotifierengine_p.cpp" diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifierengine_dbus.cpp b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifierengine_dbus.cpp new file mode 100644 index 0000000000..67d04b441e --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifierengine_dbus.cpp @@ -0,0 +1,33 @@ +/* + SPDX-FileCopyrightText: 2025 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#include "ksystemclockskewnotifierengine_dbus.h" + +#include + +std::shared_ptr KDBusSystemClockSkewNotifierEngine::create() +{ + return std::make_shared(); +} + +KDBusSystemClockSkewNotifierEngine::KDBusSystemClockSkewNotifierEngine() +{ + QDBusConnection::sessionBus().connect(QString(), + QStringLiteral("/org/kde/kcmshell_clock"), + QStringLiteral("org.kde.kcmshell_clock"), + QStringLiteral("clockUpdated"), + this, + SLOT(skewed())); + + QDBusConnection::sessionBus().connect(QStringLiteral("org.kde.Solid.PowerManagement"), + QStringLiteral("/org/kde/Solid/PowerManagement/Actions/SuspendSession"), + QStringLiteral("org.kde.Solid.PowerManagement.Actions.SuspendSession"), + QStringLiteral("resumingFromSuspend"), + this, + SLOT(skewed())); +} + +#include "moc_ksystemclockskewnotifierengine_dbus.cpp" diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifierengine_dbus.h b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifierengine_dbus.h new file mode 100644 index 0000000000..9b31f5e488 --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifierengine_dbus.h @@ -0,0 +1,19 @@ +/* + SPDX-FileCopyrightText: 2025 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#pragma once + +#include "ksystemclockskewnotifierengine_p.h" + +class KDBusSystemClockSkewNotifierEngine : public KSystemClockSkewNotifierEngine +{ + Q_OBJECT + +public: + static std::shared_ptr create(); + + KDBusSystemClockSkewNotifierEngine(); +}; diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifierengine_linux.cpp b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifierengine_linux.cpp new file mode 100644 index 0000000000..0666b71bed --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifierengine_linux.cpp @@ -0,0 +1,58 @@ +/* + SPDX-FileCopyrightText: 2019 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#include "ksystemclockskewnotifierengine_linux.h" + +#include + +#include +#include +#include +#include + +#ifndef TFD_TIMER_CANCEL_ON_SET // only available in newer glib +#define TFD_TIMER_CANCEL_ON_SET (1 << 1) +#endif + +std::shared_ptr KLinuxSystemClockSkewNotifierEngine::create() +{ + int fd = timerfd_create(CLOCK_REALTIME, O_CLOEXEC | O_NONBLOCK); + if (fd == -1) { + qWarning("Couldn't create clock skew notifier engine: %s", strerror(errno)); + return nullptr; + } + + const itimerspec spec = {}; + const int ret = timerfd_settime(fd, TFD_TIMER_ABSTIME | TFD_TIMER_CANCEL_ON_SET, &spec, nullptr); + if (ret == -1) { + qWarning("Couldn't create clock skew notifier engine: %s", strerror(errno)); + close(fd); + return nullptr; + } + return std::make_shared(fd); +} + +KLinuxSystemClockSkewNotifierEngine::KLinuxSystemClockSkewNotifierEngine(int fd) + : m_fd(fd) +{ + const QSocketNotifier *notifier = new QSocketNotifier(m_fd, QSocketNotifier::Read, this); + connect(notifier, &QSocketNotifier::activated, this, &KLinuxSystemClockSkewNotifierEngine::handleTimerCancelled); +} + +KLinuxSystemClockSkewNotifierEngine::~KLinuxSystemClockSkewNotifierEngine() +{ + close(m_fd); +} + +void KLinuxSystemClockSkewNotifierEngine::handleTimerCancelled() +{ + uint64_t expirationCount; + read(m_fd, &expirationCount, sizeof(expirationCount)); + + Q_EMIT skewed(); +} + +#include "moc_ksystemclockskewnotifierengine_linux.cpp" diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifierengine_linux.h b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifierengine_linux.h new file mode 100644 index 0000000000..c22852ea94 --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifierengine_linux.h @@ -0,0 +1,26 @@ +/* + SPDX-FileCopyrightText: 2019 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#pragma once + +#include "ksystemclockskewnotifierengine_p.h" + +class KLinuxSystemClockSkewNotifierEngine : public KSystemClockSkewNotifierEngine +{ + Q_OBJECT + +public: + static std::shared_ptr create(); + + KLinuxSystemClockSkewNotifierEngine(int fd); + ~KLinuxSystemClockSkewNotifierEngine() override; + +private Q_SLOTS: + void handleTimerCancelled(); + +private: + int m_fd; +}; diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifierengine_p.h b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifierengine_p.h new file mode 100644 index 0000000000..dc157166f0 --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/util/ksystemclockskewnotifierengine_p.h @@ -0,0 +1,23 @@ +/* + SPDX-FileCopyrightText: 2019 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#pragma once + +#include + +class KSystemClockSkewNotifierEngine : public QObject +{ + Q_OBJECT + +public: + static std::shared_ptr globalInstance(); + +protected: + explicit KSystemClockSkewNotifierEngine(QObject *parent = nullptr); + +Q_SIGNALS: + void skewed(); +}; diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/qml/kcoreaddonsqml.qdoc b/local/recipes/kde/kf6-kcoreaddons/source/src/qml/kcoreaddonsqml.qdoc new file mode 100644 index 0000000000..5ae1adf2ba --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/qml/kcoreaddonsqml.qdoc @@ -0,0 +1,6 @@ +/*! + \qmlmodule org.kde.coreaddons + \title KCoreAddons QML Types + \ingroup qmlmodules + \brief Additions to Qt Core +*/ diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/qml/kcoreaddonsqml.qdocconf b/local/recipes/kde/kf6-kcoreaddons/source/src/qml/kcoreaddonsqml.qdocconf new file mode 100644 index 0000000000..6d426e8897 --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/qml/kcoreaddonsqml.qdocconf @@ -0,0 +1,35 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KCoreAddonsQml +description = Additions to Qt Core + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +depends += \ + kde \ + qtcore \ + qtqml \ + kcoreaddons + +navigation.landingpage = "KCoreAddons" + +qhp.projects = KCoreAddonsQml + +qhp.KCoreAddonsQml.file = kcoreaddonsqml.qhp +qhp.KCoreAddonsQml.namespace = org.kde.kcoreaddonsqml.$QT_VERSION_TAG +qhp.KCoreAddonsQml.virtualFolder = kcoreaddonsqml +qhp.KCoreAddonsQml.indexTitle = KCoreAddons QML +qhp.KCoreAddonsQml.indexRoot = + +qhp.KCoreAddonsQml.subprojects = qmltypes +qhp.KCoreAddonsQml.subprojects.qmltypes.title = QML Types +qhp.KCoreAddonsQml.subprojects.qmltypes.indexTitle = KCoreAddons QML Types +qhp.KCoreAddonsQml.subprojects.qmltypes.selectors = qmlmodule:org.kde.coreaddons +qhp.KCoreAddonsQml.subprojects.qmltypes.sortPages = true + +tagfile = kcoreaddonsqml.tags diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/qml/kosreleaseproxy.cpp b/local/recipes/kde/kf6-kcoreaddons/source/src/qml/kosreleaseproxy.cpp new file mode 100644 index 0000000000..ed8f3acfec --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/qml/kosreleaseproxy.cpp @@ -0,0 +1,105 @@ +// SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +// SPDX-FileCopyrightText: 2025 Harald Sitter + +#include "kosreleaseproxy.h" + +QString KOSReleaseProxy::name() const +{ + return os.name(); +} + +QString KOSReleaseProxy::version() const +{ + return os.version(); +} + +QString KOSReleaseProxy::id() const +{ + return os.id(); +} + +QStringList KOSReleaseProxy::idLike() const +{ + return os.idLike(); +} + +QString KOSReleaseProxy::versionCodename() const +{ + return os.versionCodename(); +} + +QString KOSReleaseProxy::versionId() const +{ + return os.versionId(); +} + +QString KOSReleaseProxy::prettyName() const +{ + return os.prettyName(); +} + +QString KOSReleaseProxy::ansiColor() const +{ + return os.ansiColor(); +} + +QString KOSReleaseProxy::cpeName() const +{ + return os.cpeName(); +} + +QString KOSReleaseProxy::homeUrl() const +{ + return os.homeUrl(); +} + +QString KOSReleaseProxy::documentationUrl() const +{ + return os.documentationUrl(); +} + +QString KOSReleaseProxy::supportUrl() const +{ + return os.supportUrl(); +} + +QString KOSReleaseProxy::bugReportUrl() const +{ + return os.bugReportUrl(); +} + +QString KOSReleaseProxy::privacyPolicyUrl() const +{ + return os.privacyPolicyUrl(); +} + +QString KOSReleaseProxy::buildId() const +{ + return os.buildId(); +} +QString KOSReleaseProxy::variant() const +{ + return os.variant(); +} + +QString KOSReleaseProxy::variantId() const +{ + return os.variantId(); +} + +QString KOSReleaseProxy::logo() const +{ + return os.logo(); +} + +QStringList KOSReleaseProxy::extraKeys() const +{ + return os.extraKeys(); +} + +QString KOSReleaseProxy::extraValue(const QString &key) const +{ + return os.extraValue(key); +} + +#include "moc_kosreleaseproxy.cpp" diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/qml/kosreleaseproxy.h b/local/recipes/kde/kf6-kcoreaddons/source/src/qml/kosreleaseproxy.h new file mode 100644 index 0000000000..1a6390e81a --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/qml/kosreleaseproxy.h @@ -0,0 +1,162 @@ +// SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +// SPDX-FileCopyrightText: 2025 Harald Sitter + +#pragma once + +#include +#include + +#include "kosrelease.h" + +// TODO KF7: remove final on KOSRelease class declaration so we can more easily extend it without having to proxy all functions + +/*! + * \qmltype KOSRelease + * \inqmlmodule org.kde.coreaddons + * \nativetype KOSRelease + * \since 6.11 + * + * \brief Parses /etc/os-release files. + * + * This is a QML singleton + * + * \qml + * import QtQuick + * import org.kde.coreaddons + * + * Item { + * Component.onCompleted: console.log(KOSRelease.name) + * } + * \endqml + */ +class KOSReleaseProxy : public QObject +{ + Q_OBJECT + QML_NAMED_ELEMENT(KOSRelease) + QML_SINGLETON + + /*! + * \qmlproperty string KOSRelease::name + */ + Q_PROPERTY(QString name READ name CONSTANT) + + /*! + * \qmlproperty string KOSRelease::version + */ + Q_PROPERTY(QString version READ version CONSTANT) + + /*! + * \qmlproperty string KOSRelease::id + */ + Q_PROPERTY(QString id READ id CONSTANT) + + /*! + * \qmlproperty list KOSRelease::idLike + */ + Q_PROPERTY(QStringList idLike READ idLike CONSTANT) + + /*! + * \qmlproperty string KOSRelease::versionCodename + */ + Q_PROPERTY(QString versionCodename READ versionCodename CONSTANT) + + /*! + * \qmlproperty string KOSRelease::versionId + */ + Q_PROPERTY(QString versionId READ versionId CONSTANT) + + /*! + * \qmlproperty string KOSRelease::prettyName + */ + Q_PROPERTY(QString prettyName READ prettyName CONSTANT) + + /*! + * \qmlproperty string KOSRelease::ansiColor + */ + Q_PROPERTY(QString ansiColor READ ansiColor CONSTANT) + + /*! + * \qmlproperty string KOSRelease::cpeName + */ + Q_PROPERTY(QString cpeName READ cpeName CONSTANT) + + /*! + * \qmlproperty string KOSRelease::homeUrl + */ + Q_PROPERTY(QString homeUrl READ homeUrl CONSTANT) + + /*! + * \qmlproperty string KOSRelease::documentationUrl + */ + Q_PROPERTY(QString documentationUrl READ documentationUrl CONSTANT) + + /*! + * \qmlproperty string KOSRelease::supportUrl + */ + Q_PROPERTY(QString supportUrl READ supportUrl CONSTANT) + + /*! + * \qmlproperty string KOSRelease::bugReportUrl + */ + Q_PROPERTY(QString bugReportUrl READ bugReportUrl CONSTANT) + + /*! + * \qmlproperty string KOSRelease::privacyPolicyUrl + */ + Q_PROPERTY(QString privacyPolicyUrl READ privacyPolicyUrl CONSTANT) + + /*! + * \qmlproperty string KOSRelease::buildId + */ + Q_PROPERTY(QString buildId READ buildId CONSTANT) + + /*! + * \qmlproperty string KOSRelease::variant + */ + Q_PROPERTY(QString variant READ variant CONSTANT) + + /*! + * \qmlproperty string KOSRelease::variantId + */ + Q_PROPERTY(QString variantId READ variantId CONSTANT) + + /*! + * \qmlproperty string KOSRelease::logo + */ + Q_PROPERTY(QString logo READ logo CONSTANT) + +public: + using QObject::QObject; + + [[nodiscard]] QString name() const; + [[nodiscard]] QString version() const; + [[nodiscard]] QString id() const; + [[nodiscard]] QStringList idLike() const; + [[nodiscard]] QString versionCodename() const; + [[nodiscard]] QString versionId() const; + [[nodiscard]] QString prettyName() const; + [[nodiscard]] QString ansiColor() const; + [[nodiscard]] QString cpeName() const; + [[nodiscard]] QString homeUrl() const; + [[nodiscard]] QString documentationUrl() const; + [[nodiscard]] QString supportUrl() const; + [[nodiscard]] QString bugReportUrl() const; + [[nodiscard]] QString privacyPolicyUrl() const; + [[nodiscard]] QString buildId() const; + [[nodiscard]] QString variant() const; + [[nodiscard]] QString variantId() const; + [[nodiscard]] QString logo() const; + + /*! + * \qmlmethod list KOSRelease::extraKeys + */ + Q_INVOKABLE [[nodiscard]] QStringList extraKeys() const; + + /*! + * \qmlmethod string KOSRelease::extraValue(string key) + */ + Q_INVOKABLE [[nodiscard]] QString extraValue(const QString &key) const; + +private: + KOSRelease os; +}; diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/qml/types.h b/local/recipes/kde/kf6-kcoreaddons/source/src/qml/types.h new file mode 100644 index 0000000000..5a09eeffa9 --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/qml/types.h @@ -0,0 +1,25 @@ +// SPDX-FileCopyrightText: ⓒ 2025 Volker Krause +// SPDX-License-Identifier: LGPL-2.0-or-later + +#ifndef TYPES_H +#define TYPES_H + +#include +#include + +#include + +namespace KTextToHtmlForeign +{ +Q_NAMESPACE +QML_NAMED_ELEMENT(KTextToHTMLOptions) +QML_FOREIGN_NAMESPACE(KTextToHTML) +} + +struct KAboutReleaseForeign { + Q_GADGET + QML_VALUE_TYPE(aboutRelease) + QML_FOREIGN(KAboutRelease) +}; + +#endif diff --git a/local/recipes/kde/kf6-kcoreaddons/source/tests/kosrelease.qml b/local/recipes/kde/kf6-kcoreaddons/source/tests/kosrelease.qml new file mode 100644 index 0000000000..d89a4045cb --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/tests/kosrelease.qml @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +// SPDX-FileCopyrightText: 2025 Harald Sitter + +import QtQuick +import org.kde.coreaddons as KCoreAddons + +ListView { + model: ListModel { + dynamicRoles: true + Component.onCompleted: { + for (let i in KCoreAddons.KOSRelease) { + this.append({name: i, value: KCoreAddons.KOSRelease[i]}) + } + } + } + delegate: Text { + required property string name + required property var value + text: "%1: %2".arg(name).arg(value) + } +} diff --git a/local/recipes/kde/kf6-kcoreaddons/source/tests/kuser.qml b/local/recipes/kde/kf6-kcoreaddons/source/tests/kuser.qml new file mode 100644 index 0000000000..9d97d55ada --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/tests/kuser.qml @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: 2025 Volker Krause +// SPDX-License-Identifier: LGPL-2.0-or-later + +import QtQuick +import org.kde.coreaddons as KCoreAddons + +Column { + KCoreAddons.KUser { + id: kuser + } + + Text { + text: kuser.fullName + } + Text { + text: kuser.loginName + } + Text { + text: kuser.os + } + Text { + text: kuser.host + } + + Image { + id: faceIcon + source: kuser.faceIconUrl + } +} diff --git a/local/recipes/kde/kf6-kcoreaddons/source/tests/texttohtml.qml b/local/recipes/kde/kf6-kcoreaddons/source/tests/texttohtml.qml new file mode 100644 index 0000000000..e02a2269cf --- /dev/null +++ b/local/recipes/kde/kf6-kcoreaddons/source/tests/texttohtml.qml @@ -0,0 +1,30 @@ +// SPDX-FileCopyrightText: ⓒ 2025 Volker Krause +// SPDX-License-Identifier: LGPL-2.0-or-later + +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +import org.kde.coreaddons + +ColumnLayout { + TextField { + id: input + text: "www.kde.org *bold* +491234567890" + } + Text { + text: KTextToHTML.convertToHtml(input.text, KTextToHTMLOptions.PreserveSpaces) + textFormat: Text.RichText + onLinkActivated: (link) => { Qt.openUrlExternally(link); } + } + Text { + text: KTextToHTML.convertToHtml(input.text, KTextToHTMLOptions.HighlightText) + textFormat: Text.RichText + onLinkActivated: (link) => { Qt.openUrlExternally(link); } + } + Text { + text: KTextToHTML.convertToHtml(input.text, KTextToHTMLOptions.ConvertPhoneNumbers) + textFormat: Text.RichText + onLinkActivated: (link) => { Qt.openUrlExternally(link); } + } +} diff --git a/local/recipes/kde/kf6-kcrash/source/LICENSES/BSD-2-Clause.txt b/local/recipes/kde/kf6-kcrash/source/LICENSES/BSD-2-Clause.txt new file mode 100644 index 0000000000..5f662b354c --- /dev/null +++ b/local/recipes/kde/kf6-kcrash/source/LICENSES/BSD-2-Clause.txt @@ -0,0 +1,9 @@ +Copyright (c) + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/local/recipes/kde/kf6-kcrash/source/StaticMessages.sh b/local/recipes/kde/kf6-kcrash/source/StaticMessages.sh new file mode 100644 index 0000000000..73f6cabbac --- /dev/null +++ b/local/recipes/kde/kf6-kcrash/source/StaticMessages.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +# SPDX-FileCopyrightText: 2021 Volker Krause +# SPDX-License-Identifier: CC0-1.0 + +# The name of catalog we create (without the.pot extension) +# Required by scripty +FILENAME="kcrash-android" + +# relative path to the Android resource folder +ANDROID_RES_DIR="src/android/res" + +# Called by scripty for message extraction +# First parameter will be the path of the pot file we have to create, includes $FILENAME +function export_pot_file +{ + mkdir outdir + ANSI_COLORS_DISABLED=1 a2po export --android $ANDROID_RES_DIR --gettext outdir + mv outdir/template.pot $1 + rm -rf outdir + rm -f rc.cpp +} + +# Called by scripty for merging messages +# First parameter will be a path that will contain several .po files with the format LANG.po +function import_po_files +{ + podir=$1 + # Android doesn't support languages with an @ + find "$podir" -type f -name "*@*.po" -delete + # drop obsolete messages, as Babel cannot parse them -- see: + # https://github.com/python-babel/babel/issues/206 + # https://github.com/python-babel/babel/issues/566 + find "$podir" -name '*.po' -exec msgattrib --no-obsolete -o {} {} \; + ANSI_COLORS_DISABLED=1 a2po import --ignore-fuzzy --android $ANDROID_RES_DIR --gettext $podir +} diff --git a/local/recipes/kde/kf6-kcrash/source/src/android/AndroidManifest.xml b/local/recipes/kde/kf6-kcrash/source/src/android/AndroidManifest.xml new file mode 100644 index 0000000000..071648c88e --- /dev/null +++ b/local/recipes/kde/kf6-kcrash/source/src/android/AndroidManifest.xml @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/local/recipes/kde/kf6-kcrash/source/src/android/CMakeLists.txt b/local/recipes/kde/kf6-kcrash/source/src/android/CMakeLists.txt new file mode 100644 index 0000000000..9b4d0e3c53 --- /dev/null +++ b/local/recipes/kde/kf6-kcrash/source/src/android/CMakeLists.txt @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: 2026 Volker Krause +# SPDX-License-Identifier: BSD-2-Clause + +gradle_add_aar(kcrash_aar BUILDFILE ${CMAKE_CURRENT_SOURCE_DIR}/build.gradle NAME KF6Crash) +gradle_install_aar(kcrash_aar DESTINATION jar) + +install(FILES KF6Crash-android-dependencies.xml DESTINATION ${KDE_INSTALL_LIBDIR} RENAME KF6Crash_${CMAKE_ANDROID_ARCH_ABI}-android-dependencies.xml) diff --git a/local/recipes/kde/kf6-kcrash/source/src/android/KF6Crash-android-dependencies.xml b/local/recipes/kde/kf6-kcrash/source/src/android/KF6Crash-android-dependencies.xml new file mode 100644 index 0000000000..be47f48732 --- /dev/null +++ b/local/recipes/kde/kf6-kcrash/source/src/android/KF6Crash-android-dependencies.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/local/recipes/kde/kf6-kcrash/source/src/android/build.gradle b/local/recipes/kde/kf6-kcrash/source/src/android/build.gradle new file mode 100644 index 0000000000..c5e5385b40 --- /dev/null +++ b/local/recipes/kde/kf6-kcrash/source/src/android/build.gradle @@ -0,0 +1,54 @@ +/* + SPDX-FileCopyrightText: 2026 Volker Krause + SPDX-License-Identifier: BSD-2-Clause +*/ + +buildscript { + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:@Gradle_ANDROID_GRADLE_PLUGIN_VERSION@' + } +} + +repositories { + google() + mavenCentral() +} + +apply plugin: 'com.android.library' + +dependencies { + implementation 'io.sentry:sentry-android-core:8.43.0' +} + +android { + buildToolsVersion '@ANDROID_SDK_BUILD_TOOLS_REVISION@' + compileSdkVersion @ANDROID_SDK_COMPILE_API@ + + sourceSets { + main { + manifest.srcFile '@CMAKE_CURRENT_SOURCE_DIR@/AndroidManifest.xml' + java.srcDirs = ['@CMAKE_CURRENT_SOURCE_DIR@/src/org'] + res.srcDirs = ['@CMAKE_CURRENT_SOURCE_DIR@/res'] + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + lintOptions { + abortOnError false + } + + defaultConfig { + minSdkVersion @ANDROID_API_LEVEL@ + targetSdkVersion @ANDROID_SDK_COMPILE_API@ + namespace "org.kde.crash" + } +} diff --git a/local/recipes/kde/kf6-kcrash/source/src/android/res/values/strings.xml b/local/recipes/kde/kf6-kcrash/source/src/android/res/values/strings.xml new file mode 100644 index 0000000000..6c8a2b328b --- /dev/null +++ b/local/recipes/kde/kf6-kcrash/source/src/android/res/values/strings.xml @@ -0,0 +1,9 @@ + + + + Submit crash report + Do you want to submit an automatic crash report? + diff --git a/local/recipes/kde/kf6-kcrash/source/src/android/src/org/kde/crash/KCrash.java b/local/recipes/kde/kf6-kcrash/source/src/android/src/org/kde/crash/KCrash.java new file mode 100644 index 0000000000..2d2ab353ad --- /dev/null +++ b/local/recipes/kde/kf6-kcrash/source/src/android/src/org/kde/crash/KCrash.java @@ -0,0 +1,107 @@ +/* + SPDX-FileCopyrightText: 2026 Volker Krause + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +package org.kde.crash; + +import android.app.Activity; +import android.app.ActivityManager; +import android.app.AlertDialog; +import android.app.Application; +import android.app.ApplicationExitInfo; +import android.content.Context; +import android.content.DialogInterface; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.os.Build; +import android.util.Log; + +import io.sentry.ScreenshotStrategyType; +import io.sentry.SentryLevel; +import io.sentry.ProfileLifecycle; +import io.sentry.android.core.SentryAndroid; +import io.sentry.SentryOptions; + +import java.util.List; + +public class KCrash +{ + private static final String TAG = "org.kde.crash"; + + public static void initialize(Context context) + { + if (Build.VERSION.SDK_INT < 30) { + Log.i(TAG, "crash reporting not supported on Android API " + Build.VERSION.SDK_INT); + return; + } + + ActivityManager activityManager = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE); + List exitInfoList = activityManager.getHistoricalProcessExitReasons(null, 0, 1); + if (exitInfoList == null || exitInfoList.isEmpty()) { + Log.i(TAG, "no exit info found"); + return; + } + + ApplicationExitInfo lastExit = exitInfoList.get(0); + Log.i(TAG, "found exit info with reason " + lastExit.getReason()); + if (lastExit.getReason() != ApplicationExitInfo.REASON_CRASH_NATIVE) { // TODO add other crash types? + return; + } + + Activity activity = (Activity)context; + if (activity == null) { + Log.i(TAG, "crash reporting not supported from background service"); + return; + } + + String dsn; + PackageManager pm = context.getPackageManager(); + try { + ApplicationInfo appInfo = pm.getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA); + dsn = appInfo.metaData.getString("io.sentry.dsn"); + } catch (Exception e) { + Log.i(TAG, "failed to load application meta-data"); + return; + } + if (dsn == null) { + Log.i(TAG, "no Sentry DSN configured for this application"); + return; + } + + activity.runOnUiThread(() -> { + new AlertDialog.Builder(context) + .setTitle(R.string.submit_dialog_title) + .setMessage(R.string.submit_dialog_text) + .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + KCrash.initSentry(context, dsn); + } + }) + .setNegativeButton(android.R.string.no, null) + .setIconAttribute(android.R.attr.alertDialogIcon) + .show(); + }); + } + + private static void initSentry(Context context, String dsn) + { + Log.i(TAG, "initializing Sentry"); + + try { + SentryAndroid.init(context, options -> { + options.setDsn(dsn); + options.setSendDefaultPii(false); + options.setEnableUserInteractionTracing(false); + options.setAttachScreenshot(false); + options.setAttachViewHierarchy(false); + options.setStartProfilerOnAppStart(false); + options.setTombstoneEnabled(true); + }); + } catch (Exception e) { + Log.e(TAG, "Sentry initialization failed", e); + } catch (NoClassDefFoundError e) { + Log.e(TAG, "Sentry not bundled", e); + } + } +} diff --git a/local/recipes/kde/kf6-kcrash/source/src/kcrash-index.qdoc b/local/recipes/kde/kf6-kcrash/source/src/kcrash-index.qdoc new file mode 100644 index 0000000000..a34c561100 --- /dev/null +++ b/local/recipes/kde/kf6-kcrash/source/src/kcrash-index.qdoc @@ -0,0 +1,20 @@ +/*! + \page kcrash-index.html + \title KCrash + + Crash Handling. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {Crash} {KF6::Crash} + + \section1 API Reference + + \list + \li \l{KCrash C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kcrash/source/src/kcrash.qdoc b/local/recipes/kde/kf6-kcrash/source/src/kcrash.qdoc new file mode 100644 index 0000000000..40d35923d6 --- /dev/null +++ b/local/recipes/kde/kf6-kcrash/source/src/kcrash.qdoc @@ -0,0 +1,8 @@ +/*! + \module KCrash + \title KCrash C++ Classes + \cmakepackage KF6 + \cmakecomponent Crash + + \brief Crash handling. +*/ diff --git a/local/recipes/kde/kf6-kcrash/source/src/kcrash.qdocconf b/local/recipes/kde/kf6-kcrash/source/src/kcrash.qdocconf new file mode 100644 index 0000000000..d69dd60df4 --- /dev/null +++ b/local/recipes/kde/kf6-kcrash/source/src/kcrash.qdocconf @@ -0,0 +1,32 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KCrash +description = Crash handling + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +navigation.landingpage = "KCrash" + +depends += \ + qtcore + +qhp.projects = KCrash + +qhp.KCrash.file = kcrash.qhp +qhp.KCrash.namespace = org.kde.kcrash.$QT_VERSION_TAG +qhp.KCrash.virtualFolder = kcrash +qhp.KCrash.indexTitle = KCrash +qhp.KCrash.indexRoot = + +qhp.KCrash.subprojects = classes +qhp.KCrash.subprojects.classes.title = C++ Classes +qhp.KCrash.subprojects.classes.indexTitle = KCrash C++ Classes +qhp.KCrash.subprojects.classes.selectors = class fake:headerfile +qhp.KCrash.subprojects.classes.sortPages = true + +tagfile = kcrash.tags diff --git a/local/recipes/kde/kf6-kdbusaddons/source/poqm/ga/kdbusaddons6_qt.po b/local/recipes/kde/kf6-kdbusaddons/source/poqm/ga/kdbusaddons6_qt.po new file mode 100644 index 0000000000..ed84eebc4b --- /dev/null +++ b/local/recipes/kde/kf6-kdbusaddons/source/poqm/ga/kdbusaddons6_qt.po @@ -0,0 +1,43 @@ +msgid "" +msgstr "" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=5; plural=n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n < 11 ? " +"3 : 4\n" +"X-Qt-Contexts: true\n" + +#: tools/kquitapp/kquitapp.cpp:19 +msgctxt "main|" +msgid "Quit a D-Bus enabled application easily" +msgstr "" + +#: tools/kquitapp/kquitapp.cpp:21 +msgctxt "main|" +msgid "Full service name, overrides application name provided" +msgstr "" + +#: tools/kquitapp/kquitapp.cpp:24 +msgctxt "main|" +msgid "Path in the D-Bus interface to use" +msgstr "" + +#: tools/kquitapp/kquitapp.cpp:27 +msgctxt "main|" +msgid "The name of the application to quit" +msgstr "" + +#: tools/kquitapp/kquitapp.cpp:45 +#, qt-format +msgctxt "main|" +msgid "Application %1 could not be found using service %2 and path %3." +msgstr "" + +#: tools/kquitapp/kquitapp.cpp:52 +#, qt-format +msgctxt "main|" +msgid "" +"Quitting application %1 failed. Error reported was:\n" +"\n" +" %2 : %3" +msgstr "" diff --git a/local/recipes/kde/kf6-kdbusaddons/source/poqm/ug/kdbusaddons6_qt.po b/local/recipes/kde/kf6-kdbusaddons/source/poqm/ug/kdbusaddons6_qt.po new file mode 100644 index 0000000000..c8abc7ddbc --- /dev/null +++ b/local/recipes/kde/kf6-kdbusaddons/source/poqm/ug/kdbusaddons6_qt.po @@ -0,0 +1,49 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: Abduqadir Abliz \n" +"Language-Team: \n" +"Language: ug\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Qt-Contexts: true\n" +"X-Generator: Poedit 3.9\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: tools/kquitapp/kquitapp.cpp:19 +msgctxt "main|" +msgid "Quit a D-Bus enabled application easily" +msgstr "D-Bus قوزغىتىلغان پىروگراممىدىن ئاسانلا چېكىنىدۇ" + +#: tools/kquitapp/kquitapp.cpp:21 +msgctxt "main|" +msgid "Full service name, overrides application name provided" +msgstr "" + +#: tools/kquitapp/kquitapp.cpp:24 +msgctxt "main|" +msgid "Path in the D-Bus interface to use" +msgstr "" + +#: tools/kquitapp/kquitapp.cpp:27 +msgctxt "main|" +msgid "The name of the application to quit" +msgstr "" + +#: tools/kquitapp/kquitapp.cpp:45 +#, qt-format +msgctxt "main|" +msgid "Application %1 could not be found using service %2 and path %3." +msgstr "" + +#: tools/kquitapp/kquitapp.cpp:52 +#, qt-format +msgctxt "main|" +msgid "" +"Quitting application %1 failed. Error reported was:\n" +"\n" +" %2 : %3" +msgstr "" diff --git a/local/recipes/kde/kf6-kdbusaddons/source/src/kdbusaddons-index.qdoc b/local/recipes/kde/kf6-kdbusaddons/source/src/kdbusaddons-index.qdoc new file mode 100644 index 0000000000..4f223c6e5c --- /dev/null +++ b/local/recipes/kde/kf6-kdbusaddons/source/src/kdbusaddons-index.qdoc @@ -0,0 +1,20 @@ +/*! + \page kdbusaddons-index.html + \title KDBusAddons + + KDBusAddons provides convenience classes on top of QtDBus, as well as an API to create KDED modules. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {DBusAddons} {KF6::DBusAddons} + + \section1 API Reference + + \list + \li \l{KDBusAddons C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kdbusaddons/source/src/kdbusaddons.qdoc b/local/recipes/kde/kf6-kdbusaddons/source/src/kdbusaddons.qdoc new file mode 100644 index 0000000000..ce80254152 --- /dev/null +++ b/local/recipes/kde/kf6-kdbusaddons/source/src/kdbusaddons.qdoc @@ -0,0 +1,9 @@ +/*! + \module KDBusAddons + \title KDBusAddons C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent DBusAddons + + \brief KDBusAddons provides convenience classes on top of QtDBus, as well as an API to create KDED modules. +*/ diff --git a/local/recipes/kde/kf6-kdbusaddons/source/src/kdbusaddons.qdocconf b/local/recipes/kde/kf6-kdbusaddons/source/src/kdbusaddons.qdocconf new file mode 100644 index 0000000000..c064f44033 --- /dev/null +++ b/local/recipes/kde/kf6-kdbusaddons/source/src/kdbusaddons.qdocconf @@ -0,0 +1,31 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KDBusAddons +description = KDBusAddons provides convenience classes on top of QtDBus, as well as an API to create KDED modules. + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +navigation.landingpage = "KDBusAddons" + +depends += qtcore qtgui qttools + +qhp.projects = KDBusAddons + +qhp.KDBusAddons.file = kdbusaddons.qhp +qhp.KDBusAddons.namespace = org.kde.kdbusaddons.$QT_VERSION_TAG +qhp.KDBusAddons.virtualFolder = kdbusaddons +qhp.KDBusAddons.indexTitle = KDBusAddons +qhp.KDBusAddons.indexRoot = + +qhp.KDBusAddons.subprojects = classes +qhp.KDBusAddons.subprojects.classes.title = C++ Classes +qhp.KDBusAddons.subprojects.classes.indexTitle = KDBusAddons C++ Classes +qhp.KDBusAddons.subprojects.classes.selectors = class fake:headerfile +qhp.KDBusAddons.subprojects.classes.sortPages = true + +tagfile = kdbusaddons.tags diff --git a/local/recipes/kde/kf6-kdeclarative/source/.qmllint.ini b/local/recipes/kde/kf6-kdeclarative/source/.qmllint.ini new file mode 100644 index 0000000000..8aeaeb287b --- /dev/null +++ b/local/recipes/kde/kf6-kdeclarative/source/.qmllint.ini @@ -0,0 +1,79 @@ +[General] +DisableDefaultImports=false +MaxWarnings=0 + +[Warnings] +AccessSingletonViaObject=error +AliasCycle=error +AssignmentInCondition=error +AttachedPropertyReuse=disable +BadSignalHandlerParameters=error +Comma=error +CompilerWarnings=disable +ComponentChildrenCount=error +ConfusingExpressionStatement=error +ConfusingMinuses=error +ConfusingPluses=error +ContextProperties=error +Deprecated=error +DuplicateEnumEntries=error +DuplicateImport=error +DuplicateInlineComponent=error +DuplicatePropertyBinding=error +DuplicatedName=error +EnumEntryMatchesEnum=error +EnumsAreNotTypes=error +EqualityTypeCoercion=error +Eval=error +FunctionUsedBeforeDeclaration=disable +ImportFailure=error +ImportFileSelector=disable +IncompatibleType=error +InheritanceCycle=error +InvalidLintDirective=error +LintPluginWarnings=disable +LiteralConstructor=error +MissingEnumEntry=error +MissingProperty=error +MissingType=error +MultilineStrings=info +NonListProperty=error +NonRootEnum=error +PreferNonVarProperties=error +PrefixedImportType=error +PropertyOverride=error +QtDesignStudio.FunctionsNotSupportedInQmlUi=error +QtDesignStudio.ImperativeCodeNotEditableInVisualDesigner=error +QtDesignStudio.InvalidIdeInVisualDesigner=error +QtDesignStudio.ReferenceToParentItemNotSupportedByVisualDesigner=error +QtDesignStudio.UnsupportedRootTypeInQmlUi=error +QtDesignStudio.UnsupportedTypeInQmlUi=error +Quick.Anchors=error +Quick.AttachedPropertyReuse=disable +Quick.AttachedPropertyType=error +Quick.Color=error +Quick.ControlsAttachedPropertyReuse=disable +Quick.ControlsNativeCustomize=error +Quick.LayoutsPositioning=error +Quick.PropertyChangesParsed=error +Quick.StateNoChildItem=error +Quick.UnexpectedVarType=error +ReadOnlyProperty=error +RedundantOptionalChaining=error +RequiredProperty=error +Shadow=error +StalePropertyRead=error +TopLevelComponent=error +TranslationFunctionMismatch=error +UncreatableType=error +UnintentionalEmptyBlock=error +UnqualifiedAccess=error +UnreachableCode=error +UnresolvedAlias=error +UnresolvedType=error +UnterminatedCase=error +UnusedImports=error +UseProperFunction=disable +VarUsedBeforeDeclaration=error +Void=disable +WithStatement=error diff --git a/local/recipes/kde/kf6-kdeclarative/source/src/calendarevents/calendarevents.qdoc b/local/recipes/kde/kf6-kdeclarative/source/src/calendarevents/calendarevents.qdoc new file mode 100644 index 0000000000..7f8c0471ed --- /dev/null +++ b/local/recipes/kde/kf6-kdeclarative/source/src/calendarevents/calendarevents.qdoc @@ -0,0 +1,9 @@ +/*! + \module CalendarEvents + \title CalendarEvents C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent CalendarEvents + + \brief Plugin System for Calendar Events +*/ diff --git a/local/recipes/kde/kf6-kdeclarative/source/src/calendarevents/calendarevents.qdocconf b/local/recipes/kde/kf6-kdeclarative/source/src/calendarevents/calendarevents.qdocconf new file mode 100644 index 0000000000..884148570d --- /dev/null +++ b/local/recipes/kde/kf6-kdeclarative/source/src/calendarevents/calendarevents.qdocconf @@ -0,0 +1,38 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = CalendarEvents +description = Plugin System for Calendar Events + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +navigation.landingpage = "KDeclarative" + +depends += \ + kde \ + qtcore \ + qtgui \ + draganddrop \ + graphicaleffects \ + kquickcontrols \ + kquickcontrolsaddons + +qhp.projects = CalendarEvents + +qhp.CalendarEvents.file = calendarevents.qhp +qhp.CalendarEvents.namespace = org.kde.calendarevents.$QT_VERSION_TAG +qhp.CalendarEvents.virtualFolder = calendarevents +qhp.CalendarEvents.indexTitle = CalendarEvents +qhp.CalendarEvents.indexRoot = + +qhp.CalendarEvents.subprojects = classes +qhp.CalendarEvents.subprojects.classes.title = C++ Classes +qhp.CalendarEvents.subprojects.classes.indexTitle = CalendarEvents C++ Classes +qhp.CalendarEvents.subprojects.classes.selectors = class fake:headerfile +qhp.CalendarEvents.subprojects.classes.sortPages = true + +tagfile = calendarevents.tags diff --git a/local/recipes/kde/kf6-kdeclarative/source/src/calendarevents/kdeclarative-index.qdoc b/local/recipes/kde/kf6-kdeclarative/source/src/calendarevents/kdeclarative-index.qdoc new file mode 100644 index 0000000000..20a559927e --- /dev/null +++ b/local/recipes/kde/kf6-kdeclarative/source/src/calendarevents/kdeclarative-index.qdoc @@ -0,0 +1,16 @@ +/*! + \page kdeclarative-index.html + \title KDeclarative + + Provides integration of QML and KDE Frameworks + + \section1 API Reference + + \list + \li \l{KQuickControls QML Types} + \li \l{KQuickControlsAddons QML Types} + \li \l{GraphicalEffects QML Types} + \li \l{DragAndDrop QML Types} + \li \l{CalendarEvents C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/draganddrop/draganddrop.qdoc b/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/draganddrop/draganddrop.qdoc new file mode 100644 index 0000000000..3fa1382d30 --- /dev/null +++ b/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/draganddrop/draganddrop.qdoc @@ -0,0 +1,6 @@ +/*! + \qmlmodule org.kde.draganddrop + \ingroup modules + \title DragAndDrop QML Types + \brief QML helpers for Drag and Drop. +*/ diff --git a/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/draganddrop/draganddrop.qdocconf b/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/draganddrop/draganddrop.qdocconf new file mode 100644 index 0000000000..bcd3843312 --- /dev/null +++ b/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/draganddrop/draganddrop.qdocconf @@ -0,0 +1,29 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = DragAndDrop +description = QML helpers for Drag and Drop + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +navigation.landingpage = "KDeclarative" + +depends = kde qtcore qtquick qtquickcontrols + +qhp.projects = DragAndDrop + +qhp.DragAndDrop.file = draganddrop.qhp +qhp.DragAndDrop.namespace = org.kde.draganddrop.$QT_VERSION_TAG +qhp.DragAndDrop.virtualFolder = draganddrop +qhp.DragAndDrop.indexTitle = DragAndDrop +qhp.DragAndDrop.indexRoot = + +qhp.DragAndDrop.subprojects = qmltypes +qhp.DragAndDrop.subprojects.qmltypes.title = QML Types +qhp.DragAndDrop.subprojects.qmltypes.indexTitle = DragAndDrop QML Types +qhp.DragAndDrop.subprojects.qmltypes.selectors = qmltype +qhp.DragAndDrop.subprojects.qmltypes.sortPages = true + +tagfile = draganddrop.tags diff --git a/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/graphicaleffects/graphicaleffects.qdoc b/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/graphicaleffects/graphicaleffects.qdoc new file mode 100644 index 0000000000..e9183c1e67 --- /dev/null +++ b/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/graphicaleffects/graphicaleffects.qdoc @@ -0,0 +1,6 @@ +/*! + \qmlmodule org.kde.graphicaleffects + \ingroup modules + \title GraphicalEffects QML Types + \brief Graphical Effects. +*/ diff --git a/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/graphicaleffects/graphicaleffects.qdocconf b/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/graphicaleffects/graphicaleffects.qdocconf new file mode 100644 index 0000000000..a94a1f8762 --- /dev/null +++ b/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/graphicaleffects/graphicaleffects.qdocconf @@ -0,0 +1,29 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = GraphicalEffects +description = Graphical Effects + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +navigation.landingpage = "KDeclarative" + +depends = kde qtcore qtquick qtquickcontrols + +qhp.projects = GraphicalEffects + +qhp.GraphicalEffects.file = graphicaleffects.qhp +qhp.GraphicalEffects.namespace = org.kde.graphicaleffects.$QT_VERSION_TAG +qhp.GraphicalEffects.virtualFolder = graphicaleffects +qhp.GraphicalEffects.indexTitle = GraphicalEffects +qhp.GraphicalEffects.indexRoot = + +qhp.GraphicalEffects.subprojects = qmltypes +qhp.GraphicalEffects.subprojects.qmltypes.title = QML Types +qhp.GraphicalEffects.subprojects.qmltypes.indexTitle = GraphicalEffects QML Types +qhp.GraphicalEffects.subprojects.qmltypes.selectors = qmltype +qhp.GraphicalEffects.subprojects.qmltypes.sortPages = true + +tagfile = graphicaleffects.tags diff --git a/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/kquickcontrols/kquickcontrols.qdoc b/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/kquickcontrols/kquickcontrols.qdoc new file mode 100644 index 0000000000..856207569e --- /dev/null +++ b/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/kquickcontrols/kquickcontrols.qdoc @@ -0,0 +1,6 @@ +/*! + \qmlmodule org.kde.kquickcontrols + \ingroup modules + \title KQuickControls QML Types + \brief Extensions to Qt Quick Controls. +*/ diff --git a/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/kquickcontrols/kquickcontrols.qdocconf b/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/kquickcontrols/kquickcontrols.qdocconf new file mode 100644 index 0000000000..024f2ce489 --- /dev/null +++ b/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/kquickcontrols/kquickcontrols.qdocconf @@ -0,0 +1,29 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KQuickControls +description = Extensions to Qt Quick Controls + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +navigation.landingpage = "KDeclarative" + +depends = kde qtcore qtquick qtquickcontrols + +qhp.projects = KQuickControls + +qhp.KQuickControls.file = kquickcontrols.qhp +qhp.KQuickControls.namespace = org.kde.kquickcontrols.$QT_VERSION_TAG +qhp.KQuickControls.virtualFolder = kquickcontrols +qhp.KQuickControls.indexTitle = KQuickControls +qhp.KQuickControls.indexRoot = + +qhp.KQuickControls.subprojects = qmltypes +qhp.KQuickControls.subprojects.qmltypes.title = QML Types +qhp.KQuickControls.subprojects.qmltypes.indexTitle = KQuickControls QML Types +qhp.KQuickControls.subprojects.qmltypes.selectors = qmltype +qhp.KQuickControls.subprojects.qmltypes.sortPages = true + +tagfile = kquickcontrols.tags diff --git a/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/kquickcontrolsaddons/kquickcontrolsaddons.qdoc b/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/kquickcontrolsaddons/kquickcontrolsaddons.qdoc new file mode 100644 index 0000000000..814b15d70b --- /dev/null +++ b/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/kquickcontrolsaddons/kquickcontrolsaddons.qdoc @@ -0,0 +1,6 @@ +/*! + \qmlmodule org.kde.kquickcontrols.addons + \ingroup modules + \title KQuickControlsAddons QML Types + \brief Extensions to Qt Quick Controls. +*/ diff --git a/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/kquickcontrolsaddons/kquickcontrolsaddons.qdocconf b/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/kquickcontrolsaddons/kquickcontrolsaddons.qdocconf new file mode 100644 index 0000000000..aab1db5612 --- /dev/null +++ b/local/recipes/kde/kf6-kdeclarative/source/src/qmlcontrols/kquickcontrolsaddons/kquickcontrolsaddons.qdocconf @@ -0,0 +1,29 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KQuickControlsAddons +description = Extensions to Qt Quick Controls + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +navigation.landingpage = "KDeclarative" + +depends = kde qtcore qtquick qtquickcontrols + +qhp.projects = KQuickControlsAddons + +qhp.KQuickControlsAddons.file = kquickcontrolsaddons.qhp +qhp.KQuickControlsAddons.namespace = org.kde.kquickcontrolsaddons.$QT_VERSION_TAG +qhp.KQuickControlsAddons.virtualFolder = kquickcontrolsaddons +qhp.KQuickControlsAddons.indexTitle = KQuickControlsAddons +qhp.KQuickControlsAddons.indexRoot = + +qhp.KQuickControlsAddons.subprojects = qmltypes +qhp.KQuickControlsAddons.subprojects.qmltypes.title = QML Types +qhp.KQuickControlsAddons.subprojects.qmltypes.indexTitle = KQuickControlsAddons QML Types +qhp.KQuickControlsAddons.subprojects.qmltypes.selectors = qmltype +qhp.KQuickControlsAddons.subprojects.qmltypes.sortPages = true + +tagfile = kquickcontrolsaddons.tags diff --git a/local/recipes/kde/kf6-kglobalaccel/source/src/kglobalaccel-index.qdoc b/local/recipes/kde/kf6-kglobalaccel/source/src/kglobalaccel-index.qdoc new file mode 100644 index 0000000000..f1bc300c12 --- /dev/null +++ b/local/recipes/kde/kf6-kglobalaccel/source/src/kglobalaccel-index.qdoc @@ -0,0 +1,20 @@ +/*! + \page kglobalaccel-index.html + \title KGlobalAccel + + The KGlobalAccel API provides a convenient way to register global shortcuts. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {GlobalAccel} {KF6::GlobalAccel} + + \section1 API Reference + + \list + \li \l{KGlobalAccel C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kglobalaccel/source/src/kglobalaccel.qdoc b/local/recipes/kde/kf6-kglobalaccel/source/src/kglobalaccel.qdoc new file mode 100644 index 0000000000..1881df2bd6 --- /dev/null +++ b/local/recipes/kde/kf6-kglobalaccel/source/src/kglobalaccel.qdoc @@ -0,0 +1,9 @@ +/*! + \module KGlobalAccel + \title KGlobalAccel C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent GlobalAccel + + \brief KGlobalAccel provides a convenient way to handle global shortcuts. +*/ diff --git a/local/recipes/kde/kf6-kglobalaccel/source/src/kglobalaccel.qdocconf b/local/recipes/kde/kf6-kglobalaccel/source/src/kglobalaccel.qdocconf new file mode 100644 index 0000000000..80496e2ddd --- /dev/null +++ b/local/recipes/kde/kf6-kglobalaccel/source/src/kglobalaccel.qdocconf @@ -0,0 +1,31 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KGlobalAccel +description = Add support for global workspace shortcuts + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +navigation.landingpage = "KGlobalAccel" + +depends += kde qtcore qtgui qtwidgets kde kguiaddons + +qhp.projects = KGlobalAccel + +qhp.KGlobalAccel.file = kglobalaccel.qhp +qhp.KGlobalAccel.namespace = org.kde.kglobalaccel.$QT_VERSION_TAG +qhp.KGlobalAccel.virtualFolder = kglobalaccel +qhp.KGlobalAccel.indexTitle = KGlobalAccel +qhp.KGlobalAccel.indexRoot = + +qhp.KGlobalAccel.subprojects = classes +qhp.KGlobalAccel.subprojects.classes.title = C++ Classes +qhp.KGlobalAccel.subprojects.classes.indexTitle = KGlobalAccel C++ Classes +qhp.KGlobalAccel.subprojects.classes.selectors = class fake:headerfile +qhp.KGlobalAccel.subprojects.classes.sortPages = true + +tagfile = kglobalaccel.tags diff --git a/local/recipes/kde/kf6-kguiaddons/source/examples/python/kcolorschemewatcher.py b/local/recipes/kde/kf6-kguiaddons/source/examples/python/kcolorschemewatcher.py new file mode 100755 index 0000000000..29f9ae2934 --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/examples/python/kcolorschemewatcher.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 + +# SPDX-FileCopyrightText: 2025 Nicolas Fella +# SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + +import sys + +from KGuiAddons import KColorSchemeWatcher + +from PySide6 import QtCore + +def print_preference(preference): + if preference == KColorSchemeWatcher.NoPreference: + print("No preference") + if preference == KColorSchemeWatcher.PreferDark: + print("Dark") + if preference == KColorSchemeWatcher.PreferLight: + print("Light") + if preference == KColorSchemeWatcher.PreferHighContrast: + print("High Contrast") + + +app = QtCore.QCoreApplication() + +watcher = KColorSchemeWatcher() + +print_preference(watcher.systemPreference()) + +watcher.systemPreferenceChanged.connect(lambda: print_preference(watcher.systemPreference())) + +sys.exit(app.exec()) diff --git a/local/recipes/kde/kf6-kguiaddons/source/examples/python/kdatevalidator.py b/local/recipes/kde/kf6-kguiaddons/source/examples/python/kdatevalidator.py new file mode 100755 index 0000000000..5e55393b1d --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/examples/python/kdatevalidator.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +# SPDX-FileCopyrightText: 2025 Nicolas Fella +# SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + +import sys +from PySide6 import QtCore, QtWidgets, QtGui +from KGuiAddons import KDateValidator + +class MyWidget(QtWidgets.QWidget): + def __init__(self): + super().__init__() + + self.input = QtWidgets.QLineEdit() + self.input.editingFinished.connect(self.onEditFinished) + + validator = KDateValidator() + self.input.setValidator(validator) + + self.layout = QtWidgets.QVBoxLayout(self) + self.layout.addWidget(self.input) + + @QtCore.Slot() + def onEditFinished(self): + print("Got valid input") + +if __name__ == "__main__": + app = QtWidgets.QApplication([]) + + widget = MyWidget() + widget.resize(800, 600) + widget.show() + + sys.exit(app.exec()) diff --git a/local/recipes/kde/kf6-kguiaddons/source/examples/python/kiconutils.py b/local/recipes/kde/kf6-kguiaddons/source/examples/python/kiconutils.py new file mode 100755 index 0000000000..ef23babbec --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/examples/python/kiconutils.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 + +# SPDX-FileCopyrightText: 2025 Nicolas Fella +# SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + +import sys +from PySide6 import QtCore, QtWidgets, QtGui +from KGuiAddons import KIconUtils + +class MyWidget(QtWidgets.QWidget): + def __init__(self): + super().__init__() + + self.icon = KIconUtils.addOverlays(QtGui.QIcon.fromTheme("cuttlefish"), ["edit-entry", "edit-delete"]) + + self.label = QtWidgets.QLabel() + self.label.setPixmap(self.icon.pixmap(64)) + + self.layout = QtWidgets.QVBoxLayout(self) + self.layout.addWidget(self.label) + +if __name__ == "__main__": + app = QtWidgets.QApplication([]) + + widget = MyWidget() + widget.resize(800, 600) + widget.show() + + sys.exit(app.exec()) diff --git a/local/recipes/kde/kf6-kguiaddons/source/examples/python/ksystemclipboard.py b/local/recipes/kde/kf6-kguiaddons/source/examples/python/ksystemclipboard.py new file mode 100755 index 0000000000..55a202f145 --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/examples/python/ksystemclipboard.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 +""" +SPDX-FileCopyrightText: 2025 David Edmundson +SPDX-FileCopyrightText: 2026 Fushan Wen +SPDX-License-Identifier: LGPL-2.0-or-later +""" + +import sys + +from KGuiAddons import KSystemClipboard +from PySide6.QtCore import QMimeData, Slot +from PySide6.QtGui import QClipboard +from PySide6.QtWidgets import (QApplication, QHBoxLayout, QLabel, QPushButton, QSizePolicy, QTextEdit, QVBoxLayout, QWidget) + + +class KSystemClipboardExample(QWidget): + + def __init__(self) -> None: + super().__init__() + self.setWindowTitle("KSystemClipboard") + self.__setup_ui() + + def __setup_ui(self) -> None: + self.system_clipboard_view = QTextEdit() + self.system_text_edit = QTextEdit() + self.__setup_system_clipboard() + + self.resize(600, 500) + + def __setup_system_clipboard(self) -> None: + clipboard = KSystemClipboard.instance() + + layout = QVBoxLayout(self) + + title_label = QLabel("System Clipboard (KSystemClipboard)") + layout.addWidget(title_label) + + self.system_clipboard_view.setReadOnly(True) + self.system_clipboard_view.setMinimumHeight(200) + self.system_clipboard_view.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) + + clipboard.changed.connect(self.on_system_clipboard_changed) + + self.system_clipboard_view.setText(clipboard.text(QClipboard.Mode.Clipboard)) + + layout.addWidget(self.system_clipboard_view) + + self.system_text_edit.setPlaceholderText("Enter clipboard content here…") + self.system_text_edit.setMinimumHeight(120) + self.system_text_edit.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) + layout.addWidget(self.system_text_edit) + + btn_row = QHBoxLayout() + btn_row.addStretch() + + submit_btn = QPushButton("Submit") + submit_btn.clicked.connect(self.submit_system_clipboard) + btn_row.addWidget(submit_btn) + + layout.addLayout(btn_row) + + @Slot(QClipboard.Mode) + def on_system_clipboard_changed(self, mode) -> None: + if mode != QClipboard.Mode.Clipboard: + return + clipboard = KSystemClipboard.instance() + self.system_clipboard_view.setText(clipboard.text(mode)) + + @Slot() + def submit_system_clipboard(self) -> None: + clipboard = KSystemClipboard.instance() + mime_data = QMimeData() + mime_data.setText(self.system_text_edit.toPlainText()) + clipboard.setMimeData(mime_data, QClipboard.Mode.Clipboard) + + +if __name__ == "__main__": + app = QApplication(sys.argv) + + window = KSystemClipboardExample() + window.show() + + sys.exit(app.exec()) diff --git a/local/recipes/kde/kf6-kguiaddons/source/src/android/org/kde/guiaddons/KSystemInhibitor.java b/local/recipes/kde/kf6-kguiaddons/source/src/android/org/kde/guiaddons/KSystemInhibitor.java new file mode 100644 index 0000000000..ed2b747818 --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/src/android/org/kde/guiaddons/KSystemInhibitor.java @@ -0,0 +1,20 @@ +/* + SPDX-FileCopyrightText: 2018 Nicolas Fella + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +package org.kde.guiaddons; + +import android.app.Activity; +import android.view.WindowManager; + +public class KSystemInhibitor +{ + public static void setLockInhibitionOn(Activity activity) { + activity.runOnUiThread(() -> activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)); + } + + public static void setLockInhibitionOff(Activity activity) { + activity.runOnUiThread(() -> activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)); + } +} diff --git a/local/recipes/kde/kf6-kguiaddons/source/src/kguiaddons-index.qdoc b/local/recipes/kde/kf6-kguiaddons/source/src/kguiaddons-index.qdoc new file mode 100644 index 0000000000..88c2193884 --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/src/kguiaddons-index.qdoc @@ -0,0 +1,51 @@ +/*! + \page kguiaddons-index.html + \title KGuiAddons + + KGuiAddons are addons to QtGui. They provide utilities for graphical user interfaces in the areas + of colors, fonts, text, images, and keyboard input. + + \section1 Color utilities + + The KColorUtils namespace contains various small utilities to work with colors. KColorCollection provides + handling of color collections ("pallettes"). KColorMimeData adds drag-and-drop and clipboard mimedata + manipulation to QColor objects + + \section1 Text utilities + + KWordWrap is a special word wrapping algorithm that takes beauty into account. It can be used + directly with QPainter or can return the wrapped text in a QString. + + KDateValidator is a QValidator that validates user-entered dates. + + KFontUtils::adaptFontSize() is a function that calculates the biggest font size (in points) + that can be used to draw a text centered in a rectangle using word wrapping. + + \section1 Keyboard utilities + + KKeySequenceRecorder is a utility that records a QKeySequence by listening to key events in a window. + This can be used to let the user modify predefined keyboard shortcuts for example. + + \section1 Icon utilities + + KIconUtils contains functions to add overlays on top of a QIcon. + + \section1 Cursor utilities + + KCursorSaver is used to temporarily set a mouse cursor and restore the previous one on destruction. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {GuiAddons} {KF6::GuiAddons} + + \section1 API Reference + + \list + \li \l{KGuiAddons C++ Classes} + \li \l{KGuiAddons QML Types} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kguiaddons/source/src/kguiaddons.qdoc b/local/recipes/kde/kf6-kguiaddons/source/src/kguiaddons.qdoc new file mode 100644 index 0000000000..f0edc48c99 --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/src/kguiaddons.qdoc @@ -0,0 +1,48 @@ +/*! + \module KGuiAddons + \title KGuiAddons C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent GuiAddons + + \brief Addons to QtGui. + + They provide utilities for graphical user interfaces in the areas + of colors, fonts, text, images, keyboard input. + + \section1 Color utilities + + The KColorUtils namespace contains various small utilities to work with colors. KColorCollection provides + handling of color collections ("pallettes"). KColorMimeData adds drag-and-drop and clipboard mimedata + manipulation to QColor objects + + \section1 Text utilities + + KWordWrap is a special word wrapping algorithm that takes beauty into account. It can be used + directly with QPainter or can return the wrapped text in a QString. + + KDateValidator is a QValidator that validates user-entered dates. + + KFontUtils::adaptFontSize() is a function that calculates the biggest font size (in points) + that can be used to draw a text centered in a rectangle using word wrapping. + + \section1 Keyboard utilities + + KKeySequenceRecorder is a utility that records a QKeySequence by listening to key events in a window. + This can be used to let the user modify predefined keyboard shortcuts for example. + + \section1 Icon utilities + + KIconUtils contains functions to add overlays on top of a QIcon. + + \section1 Cursor utilities + + KCursorSaver is used to temporarily set a mouse cursor and restore the previous one on destruction. +*/ + +/*! + \qmlmodule org.kde.guiaddons + \title KGuiAddons QML Types + \ingroup qmlmodules + \brief Addons to QtGui +*/ diff --git a/local/recipes/kde/kf6-kguiaddons/source/src/kguiaddons.qdocconf b/local/recipes/kde/kf6-kguiaddons/source/src/kguiaddons.qdocconf new file mode 100644 index 0000000000..79a5059de2 --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/src/kguiaddons.qdocconf @@ -0,0 +1,45 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KGuiAddons +description = Additions to Qt Gui + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +navigation.landingpage = "KGuiAddons" + +depends += \ + qtcore \ + qtgui \ + kcoreaddons \ + kjobwidgets \ + kiocore \ + kiowidgets \ + kquickcontrols \ + kxmlgui \ + qtquick + +qhp.projects = KGuiAddons + +qhp.KGuiAddons.file = kguiaddons.qhp +qhp.KGuiAddons.namespace = org.kde.kguiaddons.$QT_VERSION_TAG +qhp.KGuiAddons.virtualFolder = kguiaddons +qhp.KGuiAddons.indexTitle = KGuiAddons +qhp.KGuiAddons.indexRoot = + +qhp.KGuiAddons.subprojects = classes qmltypes +qhp.KGuiAddons.subprojects.classes.title = C++ Classes +qhp.KGuiAddons.subprojects.classes.indexTitle = KGuiAddons C++ Classes +qhp.KGuiAddons.subprojects.classes.selectors = class fake:headerfile +qhp.KGuiAddons.subprojects.classes.sortPages = true + +qhp.KGuiAddons.subprojects.qmltypes.title = QML Types +qhp.KGuiAddons.subprojects.qmltypes.indexTitle = KGuiAddons QML Types +qhp.KGuiAddons.subprojects.qmltypes.selectors = qmltype +qhp.KGuiAddons.subprojects.qmltypes.sortPages = true + +tagfile = kguiaddons.tags diff --git a/local/recipes/kde/kf6-kguiaddons/source/src/qml/kcolorutilssingleton.cpp b/local/recipes/kde/kf6-kguiaddons/source/src/qml/kcolorutilssingleton.cpp new file mode 100644 index 0000000000..c28db7c793 --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/src/qml/kcolorutilssingleton.cpp @@ -0,0 +1,58 @@ +/* SPDX-FileCopyrightText: 2020 Noah Davis + * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + */ + +#include "kcolorutilssingleton.h" +#include + +qreal KColorUtilsSingleton::hue(const QColor &color) +{ + return KColorUtils::hue(color); +} + +qreal KColorUtilsSingleton::chroma(const QColor &color) +{ + return KColorUtils::chroma(color); +} + +qreal KColorUtilsSingleton::luma(const QColor &color) +{ + return KColorUtils::luma(color); +} + +qreal KColorUtilsSingleton::contrastRatio(const QColor &color1, const QColor &color2) +{ + return KColorUtils::contrastRatio(color1, color2); +} + +QColor KColorUtilsSingleton::hcyColor(qreal hue, qreal chroma, qreal luma, qreal alpha) +{ + return KColorUtils::hcyColor(hue, chroma, luma, alpha); +} + +QColor KColorUtilsSingleton::lighten(const QColor &color, qreal amount, qreal chromaInverseGain) +{ + return KColorUtils::lighten(color, amount, chromaInverseGain); +} + +QColor KColorUtilsSingleton::darken(const QColor &color, qreal amount, qreal chromaGain) +{ + return KColorUtils::darken(color, amount, chromaGain); +} + +QColor KColorUtilsSingleton::shade(const QColor &color, qreal lumaAmount, qreal chromaAmount) +{ + return KColorUtils::shade(color, lumaAmount, chromaAmount); +} + +QColor KColorUtilsSingleton::tint(const QColor &base, const QColor &color, qreal amount) +{ + return KColorUtils::tint(base, color, amount); +} + +QColor KColorUtilsSingleton::mix(const QColor &color1, const QColor &color2, qreal bias) +{ + return KColorUtils::mix(color1, color2, bias); +} + +#include "moc_kcolorutilssingleton.cpp" diff --git a/local/recipes/kde/kf6-kguiaddons/source/src/qml/kcolorutilssingleton.h b/local/recipes/kde/kf6-kguiaddons/source/src/qml/kcolorutilssingleton.h new file mode 100644 index 0000000000..ec0b778959 --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/src/qml/kcolorutilssingleton.h @@ -0,0 +1,28 @@ +/* SPDX-FileCopyrightText: 2020 Noah Davis + * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + */ + +#ifndef KCOLORUTILSSINGLETON_H +#define KCOLORUTILSSINGLETON_H + +#include +#include +#include + +class KColorUtilsSingleton +{ + Q_GADGET +public: + Q_INVOKABLE qreal hue(const QColor &color); + Q_INVOKABLE qreal chroma(const QColor &color); + Q_INVOKABLE qreal luma(const QColor &color); + Q_INVOKABLE QColor hcyColor(qreal hue, qreal chroma, qreal luma, qreal alpha = 1.0); + Q_INVOKABLE qreal contrastRatio(const QColor &color1, const QColor &color2); + Q_INVOKABLE QColor lighten(const QColor &color, qreal amount = 0.5, qreal chromaInverseGain = 1.0); + Q_INVOKABLE QColor darken(const QColor &color, qreal amount = 0.5, qreal chromaGain = 1.0); + Q_INVOKABLE QColor shade(const QColor &color, qreal lumaAmount, qreal chromaAmount = 0.0); + Q_INVOKABLE QColor tint(const QColor &base, const QColor &color, qreal amount = 0.3); + Q_INVOKABLE QColor mix(const QColor &color1, const QColor &color2, qreal bias = 0.5); +}; + +#endif // KCOLORUTILSSINGLETON_H diff --git a/local/recipes/kde/kf6-kguiaddons/source/src/qml/kguiaddonsplugin.cpp b/local/recipes/kde/kf6-kguiaddons/source/src/qml/kguiaddonsplugin.cpp new file mode 100644 index 0000000000..944455ab45 --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/src/qml/kguiaddonsplugin.cpp @@ -0,0 +1,25 @@ +/* + SPDX-FileCopyrightText: ⓒ 2025 Volker Krause + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "kcolorutilssingleton.h" + +#include +#include + +class KGuiAddonsPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") + +public: + void registerTypes(const char *uri) override + { + qmlRegisterSingletonType(uri, 1, 0, "ColorUtils", [](QQmlEngine *engine, QJSEngine *) -> QJSValue { + return engine->toScriptValue(KColorUtilsSingleton()); + }); + } +}; + +#include "kguiaddonsplugin.moc" diff --git a/local/recipes/kde/kf6-kguiaddons/source/src/qml/systeminhibitor.cpp b/local/recipes/kde/kf6-kguiaddons/source/src/qml/systeminhibitor.cpp new file mode 100644 index 0000000000..5b69e28fed --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/src/qml/systeminhibitor.cpp @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +// SPDX-FileCopyrightText: 2025 Harald Sitter + +#include "systeminhibitor.h" + +void SystemInhibitor::classBegin() +{ +} + +void SystemInhibitor::componentComplete() +{ + m_ready = true; + apply(); +} + +void SystemInhibitor::setEnabled(bool enable) +{ + if (m_enabled == enable) { + return; + } + m_enabled = enable; + Q_EMIT enabledChanged(); + + apply(); +} + +void SystemInhibitor::apply() +{ + if (!m_ready) { + return; + } + + m_inhibitor.reset(); + if (m_enabled) { + m_inhibitor.emplace(m_reason, m_types, m_window, this); + } +} diff --git a/local/recipes/kde/kf6-kguiaddons/source/src/qml/systeminhibitor.h b/local/recipes/kde/kf6-kguiaddons/source/src/qml/systeminhibitor.h new file mode 100644 index 0000000000..1a53da273d --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/src/qml/systeminhibitor.h @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +// SPDX-FileCopyrightText: 2025 Harald Sitter + +#pragma once + +#include + +#include +#include + +/*! + \qmltype SystemInhibitor + \since 6.23 + \inqmlmodule org.kde.guiaddons + \brief Inhibit system actions such as logout, suspend, etc. + + \qml + readonly property SystemInhibitor inhibitor: SystemInhibitor { + window: ApplicationWindow.window + types: SystemInhibitor.Suspend | SystemInhibitor.Idle + enabled: true + reason: KI18n.i18nc("inhibition reason", "Playing a video") + } + \endqml +*/ +class SystemInhibitor : public QObject, public QQmlParserStatus +{ + Q_OBJECT + Q_INTERFACES(QQmlParserStatus) + QML_ELEMENT + // Grab the enums from KSystemInhibitor into our namespace for consistent QML API - so we can address it as SystemInhibitor.Logout rather than + // KSystemInhibitor.Logout + QML_EXTENDED_NAMESPACE(KSystemInhibitor) + + /*! + \qmlproperty Window SystemInhibitor::window + The window for which to apply the inhibition. May be null in which case possible user queries will not be associated with any window. + */ + Q_PROPERTY(QWindow *window MEMBER m_window NOTIFY windowChanged) + + /*! + \qmlproperty enumeration SystemInhibitor::types + \qmlenumeratorsfrom KSystemInhibitor::Type + \required + The types of inhibition to apply. May be a combination of multiple types. + */ + Q_PROPERTY(KSystemInhibitor::Types types MEMBER m_types NOTIFY typesChanged REQUIRED) + + /*! + \qmlproperty string SystemInhibitor::reason + \required + The user-facing reason why ths inhibition is in place (e.g. "Playing a video"). + */ + Q_PROPERTY(QString reason MEMBER m_reason NOTIFY reasonChanged REQUIRED) + + /*! + \qmlproperty bool SystemInhibitor::enabled + Toggle for enabling/disabling the inhibition. Please note that inhibiting is an asynchronous operation and may be delayed or fail, the property always + reflects the requested state, not the actual state. + */ + Q_PROPERTY(bool enabled MEMBER m_enabled WRITE setEnabled NOTIFY enabledChanged) +public: + using QObject::QObject; + + void classBegin() override; + void componentComplete() override; + void setEnabled(bool enable); + +Q_SIGNALS: + void windowChanged(); + void typesChanged(); + void reasonChanged(); + void enabledChanged(); + +private: + void apply(); + + bool m_ready = false; + + QWindow *m_window = nullptr; + KSystemInhibitor::Types m_types; + QString m_reason; + bool m_enabled = false; + + std::optional m_inhibitor; +}; diff --git a/local/recipes/kde/kf6-kguiaddons/source/src/systemclipboard/waylandpipewriterhelper.cpp b/local/recipes/kde/kf6-kguiaddons/source/src/systemclipboard/waylandpipewriterhelper.cpp new file mode 100644 index 0000000000..3c80ff2038 --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/src/systemclipboard/waylandpipewriterhelper.cpp @@ -0,0 +1,42 @@ +// Copyright (C) 2026 UnionTech Software Technology Co., Ltd. +// SPDX-License-Identifier: LGPL-3.0-only + +#include "waylandpipewriterhelper_p.h" +#include + +WaylandPipeWriterHelper::SafeWriteResult +WaylandPipeWriterHelper::safeWriteWithTimeout(int fd, const char *data, qsizetype len, qsizetype chunkSize, std::chrono::nanoseconds timeout) +{ + if (len == 0) + return SafeWriteResult::Ok; + + struct pollfd pfd; + pfd.fd = fd; + pfd.events = POLLOUT; + + QDeadlineTimer deadline(timeout); + qsizetype offset = 0; + while (offset < len) { + int ready = qt_safe_poll(&pfd, 1, deadline); + if (ready < 0) { + return SafeWriteResult::Error; + } else if (ready == 0 || deadline.hasExpired()) { + return SafeWriteResult::Timeout; + } else { + const qsizetype toWrite = qMin(chunkSize, len - offset); + ssize_t n = qt_safe_write_nosignal(fd, data + offset, toWrite); + if (n > 0) { + offset += n; + continue; + } else if (n < 0) { + if (errno == EAGAIN || errno == EWOULDBLOCK) + continue; + if (errno == EPIPE) + return SafeWriteResult::Closed; + return SafeWriteResult::Error; + } + } + } + + return SafeWriteResult::Ok; +} diff --git a/local/recipes/kde/kf6-kguiaddons/source/src/systemclipboard/waylandpipewriterhelper_p.h b/local/recipes/kde/kf6-kguiaddons/source/src/systemclipboard/waylandpipewriterhelper_p.h new file mode 100644 index 0000000000..29aed7b86e --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/src/systemclipboard/waylandpipewriterhelper_p.h @@ -0,0 +1,21 @@ +// Copyright (C) 2026 UnionTech Software Technology Co., Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef WAYLANDPIPEWRITERHELPER_P_H +#define WAYLANDPIPEWRITERHELPER_P_H + +#include +#include + +namespace WaylandPipeWriterHelper +{ +enum class SafeWriteResult { + Ok, + Timeout, + Closed, + Error, +}; +SafeWriteResult safeWriteWithTimeout(int fd, const char *data, qsizetype len, qsizetype chunkSize, std::chrono::nanoseconds timeout); +}; + +#endif // WAYLANDPIPEWRITERHELPER_P_H diff --git a/local/recipes/kde/kf6-kguiaddons/source/src/systemclipboard/wlrwaylandclipboard.cpp b/local/recipes/kde/kf6-kguiaddons/source/src/systemclipboard/wlrwaylandclipboard.cpp new file mode 100644 index 0000000000..43db0aeb21 --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/src/systemclipboard/wlrwaylandclipboard.cpp @@ -0,0 +1,729 @@ +/* + SPDX-FileCopyrightText: 2020 David Edmundson + SPDX-FileCopyrightText: 2021 Méven Car + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "wlrwaylandclipboard_p.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "qwayland-wayland.h" +#include "qwayland-wlr-data-control-unstable-v1.h" + +static inline QString applicationQtXImageLiteral() +{ + return QStringLiteral("application/x-qt-image"); +} + +// copied from https://code.woboq.org/qt5/qtbase/src/gui/kernel/qinternalmimedata.cpp.html +static QString utf8Text() +{ + return QStringLiteral("text/plain;charset=utf-8"); +} + +static QStringList imageMimeFormats(const QList &imageFormats) +{ + QStringList formats; + formats.reserve(imageFormats.size()); + for (const auto &format : imageFormats) + formats.append(QLatin1String("image/") + QLatin1String(format.toLower())); + // put png at the front because it is best + int pngIndex = formats.indexOf(QLatin1String("image/png")); + if (pngIndex != -1 && pngIndex != 0) + formats.move(pngIndex, 0); + return formats; +} + +static inline QStringList imageReadMimeFormats() +{ + return imageMimeFormats(QImageReader::supportedImageFormats()); +} + +static inline QStringList imageWriteMimeFormats() +{ + return imageMimeFormats(QImageWriter::supportedImageFormats()); +} +// end copied + +class WlrDataControlDeviceManager : public QWaylandClientExtensionTemplate, public QtWayland::zwlr_data_control_manager_v1 +{ + Q_OBJECT +public: + WlrDataControlDeviceManager() + : QWaylandClientExtensionTemplate(2) + { + } + + void instantiate() + { + initialize(); + } + + ~WlrDataControlDeviceManager() + { + if (isInitialized()) { + destroy(); + } + } +}; + +class WlrDataControlOffer : public QMimeData, public QtWayland::zwlr_data_control_offer_v1 +{ + Q_OBJECT +public: + WlrDataControlOffer(struct ::zwlr_data_control_offer_v1 *id) + : QtWayland::zwlr_data_control_offer_v1(id) + { + } + + ~WlrDataControlOffer() + { + destroy(); + } + + QStringList formats() const override + { + return m_receivedFormats; + } + + bool containsImageData() const + { + if (m_receivedFormats.contains(applicationQtXImageLiteral())) { + return true; + } + const auto formats = imageReadMimeFormats(); + for (const auto &receivedFormat : m_receivedFormats) { + if (formats.contains(receivedFormat)) { + return true; + } + } + return false; + } + + bool hasFormat(const QString &mimeType) const override + { + if (mimeType == QStringLiteral("text/plain") && m_receivedFormats.contains(utf8Text())) { + return true; + } + if (m_receivedFormats.contains(mimeType)) { + return true; + } + + // If we have image data + if (containsImageData()) { + // is the requested output mimeType supported ? + const QStringList imageFormats = imageWriteMimeFormats(); + for (const QString &imageFormat : imageFormats) { + if (imageFormat == mimeType) { + return true; + } + } + if (mimeType == applicationQtXImageLiteral()) { + return true; + } + } + + return false; + } + +protected: + void zwlr_data_control_offer_v1_offer(const QString &mime_type) override + { + if (!m_receivedFormats.contains(mime_type)) { + m_receivedFormats << mime_type; + } + } + + QVariant retrieveData(const QString &mimeType, QMetaType type) const override; + +private: + /** reads data from a file descriptor with a timeout of 1 second + * true if data is read successfully + */ + static bool readData(int fd, QByteArray &data, const QString &mimeType); + QStringList m_receivedFormats; + mutable QHash m_data; +}; + +QVariant WlrDataControlOffer::retrieveData(const QString &mimeType, QMetaType type) const +{ + Q_UNUSED(type); + + auto it = m_data.constFind(mimeType); + if (it != m_data.constEnd()) + return *it; + + QString mime; + if (!m_receivedFormats.contains(mimeType)) { + if (mimeType == QStringLiteral("text/plain") && m_receivedFormats.contains(utf8Text())) { + mime = utf8Text(); + } else if (mimeType == applicationQtXImageLiteral()) { + const auto writeFormats = imageWriteMimeFormats(); + for (const auto &receivedFormat : m_receivedFormats) { + if (writeFormats.contains(receivedFormat)) { + mime = receivedFormat; + break; + } + } + if (mime.isEmpty()) { + // default exchange format + mime = QStringLiteral("image/png"); + } + } + + if (mime.isEmpty()) { + return QVariant(); + } + } else { + mime = mimeType; + } + + int pipeFds[2]; + if (pipe(pipeFds) != 0) { + return QVariant(); + } + + auto t = const_cast(this); + t->receive(mime, pipeFds[1]); + + close(pipeFds[1]); + + /* + * Ideally we need to introduce a non-blocking QMimeData object + * Or a non-blocking constructor to QMimeData with the mimetypes that are relevant + * + * However this isn't actually any worse than X. + */ + + auto waylandApp = qGuiApp->nativeInterface(); + auto display = waylandApp->display(); + + wl_display_flush(display); + + QFile readPipe; + if (readPipe.open(pipeFds[0], QIODevice::ReadOnly)) { + QByteArray data; + if (readData(pipeFds[0], data, mime)) { + close(pipeFds[0]); + + if (mimeType == applicationQtXImageLiteral()) { + QImage img = QImage::fromData(data, mime.mid(mime.indexOf(QLatin1Char('/')) + 1).toLatin1().toUpper().data()); + if (!img.isNull()) { + m_data.insert(mimeType, img); + return img; + } + } else if (data.size() > 1 && mimeType == u"text/uri-list") { + const auto urls = data.split('\n'); + QVariantList list; + list.reserve(urls.size()); + for (const QByteArray &s : urls) { + if (QUrl url(QUrl::fromEncoded(QByteArrayView(s).trimmed())); url.isValid()) { + list.emplace_back(std::move(url)); + } + } + m_data.insert(mimeType, list); + return list; + } + m_data.insert(mimeType, data); + return data; + } + close(pipeFds[0]); + } + + return QVariant(); +} + +bool WlrDataControlOffer::readData(int fd, QByteArray &data, const QString &mimeType) +{ + pollfd pfds[1]; + pfds[0].fd = fd; + pfds[0].events = POLLIN; + + while (true) { + const int ready = poll(pfds, 1, 1000); + if (ready < 0) { + if (errno != EINTR) { + qWarning("WlrDataControlOffer: poll() failed for mimeType %s: %s", qPrintable(mimeType), strerror(errno)); + return false; + } + } else if (ready == 0) { + qWarning("WlrDataControlOffer: timeout reading from pipe for mimeType %s", qPrintable(mimeType)); + return false; + } else { + char buf[4096]; + int n = read(fd, buf, sizeof buf); + + if (n < 0) { + qWarning("WlrDataControlOffer: read() failed for mimeType %s: %s", qPrintable(mimeType), strerror(errno)); + return false; + } else if (n == 0) { + return true; + } else if (n > 0) { + data.append(buf, n); + } + } + } +} + +class WlrDataControlSource : public QObject, public QtWayland::zwlr_data_control_source_v1 +{ + Q_OBJECT +public: + WlrDataControlSource(struct ::zwlr_data_control_source_v1 *id, QMimeData *mimeData); + WlrDataControlSource() = default; + ~WlrDataControlSource() + { + destroy(); + } + + QMimeData *mimeData() + { + return m_mimeData.get(); + } + std::unique_ptr releaseMimeData() + { + return std::move(m_mimeData); + } + +Q_SIGNALS: + void cancelled(); + +protected: + void zwlr_data_control_source_v1_send(const QString &mime_type, int32_t fd) override; + void zwlr_data_control_source_v1_cancelled() override; + +private: + std::unique_ptr m_mimeData; +}; + +WlrDataControlSource::WlrDataControlSource(struct ::zwlr_data_control_source_v1 *id, QMimeData *mimeData) + : QtWayland::zwlr_data_control_source_v1(id) + , m_mimeData(mimeData) +{ + const auto formats = mimeData->formats(); + for (const QString &format : formats) { + offer(format); + } + if (mimeData->hasText() && !formats.contains(utf8Text())) { + // ensure GTK applications get this mimetype to avoid them discarding the offer + offer(QStringLiteral("text/plain;charset=utf-8")); + } + + if (mimeData->hasImage()) { + const QStringList imageFormats = imageWriteMimeFormats(); + for (const QString &imageFormat : imageFormats) { + if (!formats.contains(imageFormat)) { + offer(imageFormat); + } + } + } +} + +void WlrDataControlSource::zwlr_data_control_source_v1_send(const QString &mime_type, int32_t fd) +{ + QString send_mime_type = mime_type; + if (send_mime_type == utf8Text() && !m_mimeData->hasFormat(utf8Text())) { + // if we get a request on the fallback mime, send the data from the original mime type + send_mime_type = QStringLiteral("text/plain"); + } + + QByteArray ba; + if (m_mimeData->hasImage()) { + // adapted from QInternalMimeData::renderDataHelper + if (mime_type == applicationQtXImageLiteral()) { + QImage image = qvariant_cast(m_mimeData->imageData()); + QBuffer buf(&ba); + buf.open(QBuffer::WriteOnly); + // would there not be PNG ?? + image.save(&buf, "PNG"); + + } else if (mime_type.startsWith(QLatin1String("image/"))) { + QImage image = qvariant_cast(m_mimeData->imageData()); + QBuffer buf(&ba); + buf.open(QBuffer::WriteOnly); + image.save(&buf, mime_type.mid(mime_type.indexOf(QLatin1Char('/')) + 1).toLatin1().toUpper().data()); + } + // end adapted + } else { + ba = m_mimeData->data(send_mime_type); + } + + QFile c; + if (!c.open(fd, QFile::WriteOnly, QFile::AutoCloseHandle)) { + return; + } + // Create a sigpipe handler that does nothing, or clients may be forced to terminate + // if the pipe is closed in the other end. + struct sigaction action, oldAction; + action.sa_handler = SIG_IGN; + sigemptyset(&action.sa_mask); + action.sa_flags = 0; + sigaction(SIGPIPE, &action, &oldAction); + const int flags = fcntl(fd, F_GETFL, 0); + if (flags & O_NONBLOCK) { + fcntl(fd, F_SETFL, flags & ~O_NONBLOCK); // Unset O_NONBLOCK to fix pasting to XWayland windows + } + const qint64 written = c.write(ba); + sigaction(SIGPIPE, &oldAction, nullptr); + + if (written != ba.size()) { + qWarning() << "Failed to send all clipobard data; sent" << written << "bytes out of" << ba.size(); + } +} + +void WlrDataControlSource::zwlr_data_control_source_v1_cancelled() +{ + Q_EMIT cancelled(); +} + +class WlrDataControlDevice : public QObject, public QtWayland::zwlr_data_control_device_v1 +{ + Q_OBJECT +public: + WlrDataControlDevice(struct ::zwlr_data_control_device_v1 *id) + : QtWayland::zwlr_data_control_device_v1(id) + { + } + + ~WlrDataControlDevice() + { + destroy(); + } + + void setSelection(std::unique_ptr selection); + QMimeData *receivedSelection() + { + return m_receivedSelection.get(); + } + QMimeData *selection() + { + return m_selection ? m_selection->mimeData() : nullptr; + } + + void setPrimarySelection(std::unique_ptr selection); + QMimeData *receivedPrimarySelection() + { + return m_receivedPrimarySelection.get(); + } + QMimeData *primarySelection() + { + return m_primarySelection ? m_primarySelection->mimeData() : nullptr; + } + +Q_SIGNALS: + void receivedSelectionChanged(); + void selectionChanged(); + + void receivedPrimarySelectionChanged(); + void primarySelectionChanged(); + +protected: + void zwlr_data_control_device_v1_data_offer(struct ::zwlr_data_control_offer_v1 *id) override + { + // this will become memory managed when we retrieve the selection event + // a compositor calling data_offer without doing that would be a bug + new WlrDataControlOffer(id); + } + + void zwlr_data_control_device_v1_selection(struct ::zwlr_data_control_offer_v1 *id) override + { + if (!id) { + m_receivedSelection.reset(); + } else { + auto derivated = QtWayland::zwlr_data_control_offer_v1::fromObject(id); + auto offer = dynamic_cast(derivated); // dynamic because of the dual inheritance + m_receivedSelection.reset(offer); + } + Q_EMIT receivedSelectionChanged(); + } + + void zwlr_data_control_device_v1_primary_selection(struct ::zwlr_data_control_offer_v1 *id) override + { + if (!id) { + m_receivedPrimarySelection.reset(); + } else { + auto derivated = QtWayland::zwlr_data_control_offer_v1::fromObject(id); + auto offer = dynamic_cast(derivated); // dynamic because of the dual inheritance + m_receivedPrimarySelection.reset(offer); + } + Q_EMIT receivedPrimarySelectionChanged(); + } + +private: + std::unique_ptr m_selection; // selection set locally + std::unique_ptr m_receivedSelection; // latest selection set from externally to here + + std::unique_ptr m_primarySelection; // selection set locally + std::unique_ptr m_receivedPrimarySelection; // latest selection set from externally to here + friend WlrWaylandClipboard; +}; + +void WlrDataControlDevice::setSelection(std::unique_ptr selection) +{ + set_selection(selection->object()); + + // Note the previous selection is destroyed after the set_selection request. + m_selection = std::move(selection); + connect(m_selection.get(), &WlrDataControlSource::cancelled, this, [this]() { + m_selection.reset(); + }); + + Q_EMIT selectionChanged(); +} + +void WlrDataControlDevice::setPrimarySelection(std::unique_ptr selection) +{ + if (zwlr_data_control_device_v1_get_version(object()) >= ZWLR_DATA_CONTROL_DEVICE_V1_SET_PRIMARY_SELECTION_SINCE_VERSION) { + set_primary_selection(selection->object()); + } + + // Note the previous selection is destroyed after the set_primary_selection request. + m_primarySelection = std::move(selection); + connect(m_primarySelection.get(), &WlrDataControlSource::cancelled, this, [this]() { + m_primarySelection.reset(); + }); + + if (zwlr_data_control_device_v1_get_version(object()) >= ZWLR_DATA_CONTROL_DEVICE_V1_SET_PRIMARY_SELECTION_SINCE_VERSION) { + Q_EMIT primarySelectionChanged(); + } +} + +class WlrKeyboard; +// We are binding to Seat/Keyboard manually because we want to react to gaining focus but inside Qt the events are Qt and arrive to late +class WlrKeyboardFocusWatcher : public QWaylandClientExtensionTemplate, public QtWayland::wl_seat +{ + Q_OBJECT +public: + WlrKeyboardFocusWatcher() + : QWaylandClientExtensionTemplate(5) + { + initialize(); + auto waylandApp = qGuiApp->nativeInterface(); + auto display = waylandApp->display(); + // so we get capabilities + wl_display_roundtrip(display); + } + ~WlrKeyboardFocusWatcher() override + { + if (isActive()) { + release(); + } + } + void seat_capabilities(uint32_t capabilities) override + { + const bool hasWlrKeyboard = capabilities & capability_keyboard; + if (hasWlrKeyboard && !m_keyboard) { + m_keyboard = std::make_unique(get_keyboard(), *this); + } else if (!hasWlrKeyboard && m_keyboard) { + m_keyboard.reset(); + } + } + bool hasFocus() const + { + return m_focus; + } +Q_SIGNALS: + void keyboardEntered(); + +private: + friend WlrKeyboard; + bool m_focus = false; + std::unique_ptr m_keyboard; +}; + +class WlrKeyboard : public QtWayland::wl_keyboard +{ +public: + WlrKeyboard(::wl_keyboard *keyboard, WlrKeyboardFocusWatcher &seat) + : wl_keyboard(keyboard) + , m_seat(seat) + { + } + ~WlrKeyboard() + { + release(); + } + +private: + void keyboard_enter([[maybe_unused]] uint32_t serial, [[maybe_unused]] wl_surface *surface, [[maybe_unused]] wl_array *keys) override + { + m_seat.m_focus = true; + Q_EMIT m_seat.keyboardEntered(); + } + void keyboard_leave([[maybe_unused]] uint32_t serial, [[maybe_unused]] wl_surface *surface) override + { + m_seat.m_focus = false; + } + WlrKeyboardFocusWatcher &m_seat; +}; + +WlrWaylandClipboard::WlrWaylandClipboard(QObject *parent) + : KSystemClipboard(parent) + , m_keyboardFocusWatcher(new WlrKeyboardFocusWatcher) + , m_manager(new WlrDataControlDeviceManager) +{ + connect(m_manager.get(), &WlrDataControlDeviceManager::activeChanged, this, [this]() { + if (m_manager->isActive()) { + auto waylandApp = qGuiApp->nativeInterface(); + auto seat = waylandApp->seat(); + + if (!seat) { + return; + } + m_device.reset(new WlrDataControlDevice(m_manager->get_data_device(seat))); + + connect(m_device.get(), &WlrDataControlDevice::receivedSelectionChanged, this, [this]() { + // When our source is still valid, so the offer is for setting it or we emit changed when it is cancelled + if (!m_device->selection()) { + Q_EMIT changed(QClipboard::Clipboard); + } + }); + connect(m_device.get(), &WlrDataControlDevice::selectionChanged, this, [this]() { + Q_EMIT changed(QClipboard::Clipboard); + }); + + connect(m_device.get(), &WlrDataControlDevice::receivedPrimarySelectionChanged, this, [this]() { + // When our source is still valid, so the offer is for setting it or we emit changed when it is cancelled + if (!m_device->primarySelection()) { + Q_EMIT changed(QClipboard::Selection); + } + }); + connect(m_device.get(), &WlrDataControlDevice::primarySelectionChanged, this, [this]() { + Q_EMIT changed(QClipboard::Selection); + }); + + } else { + m_device.reset(); + } + }); + + m_manager->instantiate(); +} + +WlrWaylandClipboard::~WlrWaylandClipboard() = default; + +WlrWaylandClipboard *WlrWaylandClipboard::create(QObject *parent) +{ + auto clipboard = new WlrWaylandClipboard(parent); + if (clipboard->isValid()) { + return clipboard; + } + delete clipboard; + return nullptr; +} + +bool WlrWaylandClipboard::isValid() +{ + return m_manager && m_manager->isInitialized(); +} + +void WlrWaylandClipboard::setMimeData(QMimeData *mime, QClipboard::Mode mode) +{ + if (!m_device) { + return; + } + + // roundtrip to have accurate focus state when losing focus but setting mime data before processing wayland events. + auto waylandApp = qGuiApp->nativeInterface(); + auto display = waylandApp->display(); + wl_display_roundtrip(display); + + // If the application is focused, use the normal mechanism so a future paste will not deadlock itselfs + if (m_keyboardFocusWatcher->hasFocus()) { + QGuiApplication::clipboard()->setMimeData(mime, mode); + // if we short-circuit the wlr_data_device, when we receive the data + // we cannot identify ourselves as the owner + // because of that we act like it's a synchronous action to not confuse klipper. + wl_display_roundtrip(display); + return; + } + // If not, set the clipboard once the app receives focus to avoid the deadlock + connect(m_keyboardFocusWatcher.get(), &WlrKeyboardFocusWatcher::keyboardEntered, this, &WlrWaylandClipboard::gainedFocus, Qt::UniqueConnection); + auto source = std::make_unique(m_manager->create_data_source(), mime); + if (mode == QClipboard::Clipboard) { + m_device->setSelection(std::move(source)); + } else if (mode == QClipboard::Selection) { + m_device->setPrimarySelection(std::move(source)); + } +} + +void WlrWaylandClipboard::gainedFocus() +{ + disconnect(m_keyboardFocusWatcher.get(), &WlrKeyboardFocusWatcher::keyboardEntered, this, nullptr); + // QClipboard takes ownership of the QMimeData so we need to transfer and unset our selections + if (auto &selection = m_device->m_selection) { + std::unique_ptr data = selection->releaseMimeData(); + selection.reset(); + QGuiApplication::clipboard()->setMimeData(data.release(), QClipboard::Clipboard); + } + if (auto &primarySelection = m_device->m_primarySelection) { + std::unique_ptr data = primarySelection->releaseMimeData(); + primarySelection.reset(); + QGuiApplication::clipboard()->setMimeData(data.release(), QClipboard::Selection); + } +} + +void WlrWaylandClipboard::clear(QClipboard::Mode mode) +{ + if (!m_device) { + return; + } + if (mode == QClipboard::Clipboard) { + m_device->set_selection(nullptr); + m_device->m_selection.reset(); + } else if (mode == QClipboard::Selection) { + if (zwlr_data_control_device_v1_get_version(m_device->object()) >= ZWLR_DATA_CONTROL_DEVICE_V1_SET_PRIMARY_SELECTION_SINCE_VERSION) { + m_device->set_primary_selection(nullptr); + m_device->m_primarySelection.reset(); + } + } +} + +const QMimeData *WlrWaylandClipboard::mimeData(QClipboard::Mode mode) const +{ + if (!m_device) { + return nullptr; + } + + // return our locally set selection if it's not cancelled to avoid copying data to ourselves + if (mode == QClipboard::Clipboard) { + if (m_device->selection()) { + return m_device->selection(); + } + // This application owns the clipboard via the regular data_device, use it so we don't block ourselves + if (QGuiApplication::clipboard()->ownsClipboard()) { + return QGuiApplication::clipboard()->mimeData(mode); + } + return m_device->receivedSelection(); + } else if (mode == QClipboard::Selection) { + if (m_device->primarySelection()) { + return m_device->primarySelection(); + } + // This application owns the primary selection via the regular primary_selection_device, use it so we don't block ourselves + if (QGuiApplication::clipboard()->ownsSelection()) { + return QGuiApplication::clipboard()->mimeData(mode); + } + return m_device->receivedPrimarySelection(); + } + return nullptr; +} + +#include "wlrwaylandclipboard.moc" diff --git a/local/recipes/kde/kf6-kguiaddons/source/src/systemclipboard/wlrwaylandclipboard_p.h b/local/recipes/kde/kf6-kguiaddons/source/src/systemclipboard/wlrwaylandclipboard_p.h new file mode 100644 index 0000000000..761dd41107 --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/src/systemclipboard/wlrwaylandclipboard_p.h @@ -0,0 +1,37 @@ +/* + SPDX-FileCopyrightText: 2020 David Edmundson + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef WLRWAYLANDCLIPBOARD_H +#define WLRWAYLANDCLIPBOARD_H + +#include "ksystemclipboard.h" + +#include + +class WlrDataControlDevice; +class WlrDataControlDeviceManager; +class WlrKeyboardFocusWatcher; + +class WlrWaylandClipboard : public KSystemClipboard +{ +public: + ~WlrWaylandClipboard(); + static WlrWaylandClipboard *create(QObject *parent); + void setMimeData(QMimeData *mime, QClipboard::Mode mode) override; + void clear(QClipboard::Mode mode) override; + const QMimeData *mimeData(QClipboard::Mode mode) const override; + + bool isValid(); + +private: + WlrWaylandClipboard(QObject *parent); + void gainedFocus(); + std::unique_ptr m_keyboardFocusWatcher; + std::unique_ptr m_manager; + std::unique_ptr m_device; +}; + +#endif diff --git a/local/recipes/kde/kf6-kguiaddons/source/src/util/ksysteminhibitor.h b/local/recipes/kde/kf6-kguiaddons/source/src/util/ksysteminhibitor.h new file mode 100644 index 0000000000..44fb21a0ea --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/src/util/ksysteminhibitor.h @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +// SPDX-FileCopyrightText: 2025 Harald Sitter + +#pragma once + +#include + +#include + +class QWindow; + +/*! + \class KSystemInhibitor + \inmodule KGuiAddons + \since 6.23 + + \brief Inhibit system actions such as logout, suspend, etc. +*/ +class KGUIADDONS_EXPORT KSystemInhibitor : public QObject +{ + Q_OBJECT +public: + /*! + Inhibition types. + + \value Logout Inhibit logout/shutdown + \value UserSwitch Inhibit user switching + \value Suspend Inhibit suspend/hibernate + \value Idle Inhibit idle actions (e.g. screen locking) + */ + enum class Type { + Logout = 1, + UserSwitch = 2, + Suspend = 4, + Idle = 8 + }; + Q_ENUM(Type) + Q_DECLARE_FLAGS(Types, Type) + Q_FLAG(Types) + + /*! + Claim inhibition. + + \a reason is the user-visible reason for the inhibition. + + \a types is a combination of inhibition types. + + \a window is the window for which to apply the inhibition. May be null in which case possible user queries will not be associated with any window. + + \a parent is the parent QObject. + */ + KSystemInhibitor(const QString &reason, Types types, QWindow *window, QObject *parent = nullptr); + + /*! + Release inhibition + */ + ~KSystemInhibitor() override; + + Q_DISABLE_COPY_MOVE(KSystemInhibitor) + +private: + std::unique_ptr const d; +}; diff --git a/local/recipes/kde/kf6-kguiaddons/source/src/util/ksysteminhibitor_android.cpp b/local/recipes/kde/kf6-kguiaddons/source/src/util/ksysteminhibitor_android.cpp new file mode 100644 index 0000000000..b13d6eda9a --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/src/util/ksysteminhibitor_android.cpp @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: LGPL-2.0-or-later +// SPDX-FileCopyrightText: 2019 Nicolas Fella +// SPDX-FileCopyrightText: 2025 Volker Krause + +#include "ksysteminhibitor.h" + +#include +#include + +class KSystemInhibitorPrivate +{ +public: + KSystemInhibitor::Types m_types; +}; + +KSystemInhibitor::KSystemInhibitor([[maybe_unused]] const QString &reason, Types types, [[maybe_unused]] QWindow *window, QObject *parent) + : QObject(parent) + , d(std::make_unique()) +{ + d->m_types = types; + if (d->m_types & KSystemInhibitor::Type::Idle) { + QJniObject::callStaticMethod("org.kde.guiaddons.KSystemInhibitor", + "setLockInhibitionOn", + "(Landroid/app/Activity;)V", + QNativeInterface::QAndroidApplication::context()); + } +} + +KSystemInhibitor::~KSystemInhibitor() +{ + if (d->m_types & KSystemInhibitor::Type::Idle) { + QJniObject::callStaticMethod("org.kde.guiaddons.KSystemInhibitor", + "setLockInhibitionOff", + "(Landroid/app/Activity;)V", + QNativeInterface::QAndroidApplication::context()); + } +} + +#include "moc_ksysteminhibitor.cpp" diff --git a/local/recipes/kde/kf6-kguiaddons/source/src/util/ksysteminhibitor_dbus.cpp b/local/recipes/kde/kf6-kguiaddons/source/src/util/ksysteminhibitor_dbus.cpp new file mode 100644 index 0000000000..71b2797e31 --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/src/util/ksysteminhibitor_dbus.cpp @@ -0,0 +1,77 @@ +// SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +// SPDX-FileCopyrightText: 2025 Harald Sitter + +#include "ksysteminhibitor.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "kguiaddons_debug.h" + +using namespace Qt::StringLiterals; + +namespace +{ +void release(const QDBusObjectPath &path) +{ + QDBusMessage message = QDBusMessage::createMethodCall(u"org.freedesktop.portal.Desktop"_s, path.path(), u"org.freedesktop.portal.Request"_s, u"Close"_s); + QDBusConnection::sessionBus().asyncCall(message); +}; +} // namespace + +class KSystemInhibitorPrivate +{ +public: + std::optional m_inhibition; +}; + +KSystemInhibitor::KSystemInhibitor(const QString &reason, Types types, QWindow *window, QObject *parent) + : QObject(parent) + , d(std::make_unique()) +{ + QDBusMessage message = QDBusMessage::createMethodCall(u"org.freedesktop.portal.Desktop"_s, + u"/org/freedesktop/portal/desktop"_s, + u"org.freedesktop.portal.Inhibit"_s, + u"Inhibit"_s); + + const QString windowIdentifier = [window] { + if (window) { + auto services = QGuiApplicationPrivate::platformIntegration()->services(); + if (auto unixServices = dynamic_cast(services)) { + return unixServices->portalWindowIdentifier(window); + } + } + return QString(); + }(); + message << windowIdentifier << static_cast(types.toInt()) << QVariantMap({{QLatin1String("reason"), reason}}); + + auto watcher = new QDBusPendingCallWatcher(QDBusConnection::sessionBus().asyncCall(message), qApp); + QObject::connect(watcher, + &QDBusPendingCallWatcher::finished, + qApp, + [that = QPointer(this) /* we bind to the lifetime of qApp, guard this!*/](QDBusPendingCallWatcher *watcher) { + watcher->deleteLater(); + QDBusPendingReply reply = *watcher; + if (reply.isError()) { + qCWarning(KGUIADDONS_LOG) << "KSystemInhibitor Error: " << reply.error().message(); + } else if (that) { + that->d->m_inhibition.emplace(reply.value()); + } else { // KSystemInhibitor got deleted before we could store the inhibition, release it immediately. + release(reply.value()); + } + }); +} + +KSystemInhibitor::~KSystemInhibitor() +{ + if (d->m_inhibition.has_value()) { + release(d->m_inhibition.value()); + } +} + +#include "moc_ksysteminhibitor.cpp" diff --git a/local/recipes/kde/kf6-kguiaddons/source/src/util/ksysteminhibitor_dummy.cpp b/local/recipes/kde/kf6-kguiaddons/source/src/util/ksysteminhibitor_dummy.cpp new file mode 100644 index 0000000000..8da4227988 --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/src/util/ksysteminhibitor_dummy.cpp @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +// SPDX-FileCopyrightText: 2025 Harald Sitter + +#include "ksysteminhibitor.h" + +class KSystemInhibitorPrivate +{ +}; + +KSystemInhibitor::KSystemInhibitor([[maybe_unused]] const QString &reason, [[maybe_unused]] Types types, [[maybe_unused]] QWindow *window, QObject *parent) + : QObject(parent) +{ +} + +KSystemInhibitor::~KSystemInhibitor() = default; + +#include "moc_ksysteminhibitor.cpp" diff --git a/local/recipes/kde/kf6-kguiaddons/source/src/util/ksysteminhibitor_windows.cpp b/local/recipes/kde/kf6-kguiaddons/source/src/util/ksysteminhibitor_windows.cpp new file mode 100644 index 0000000000..7d248844b6 --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/src/util/ksysteminhibitor_windows.cpp @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +// SPDX-FileCopyrightText: 2026 Kai Uwe Broulik + +#include "ksysteminhibitor.h" + +#include + +#include "kguiaddons_debug.h" + +using namespace Qt::StringLiterals; + +class KSystemInhibitorPrivate +{ +public: + HANDLE m_handle = INVALID_HANDLE_VALUE; +}; + +KSystemInhibitor::KSystemInhibitor(const QString &reason, Types types, [[maybe_unused]] QWindow *window, QObject *parent) + : QObject(parent) + , d(std::make_unique()) +{ + REASON_CONTEXT context{}; + context.Version = POWER_REQUEST_CONTEXT_VERSION; + context.Flags = POWER_REQUEST_CONTEXT_SIMPLE_STRING; + context.Reason.SimpleReasonString = reason.toStdWString().data(); + + HANDLE handle = PowerCreateRequest(&context); + if (handle == INVALID_HANDLE_VALUE) { + qCWarning(KGUIADDONS_LOG) << "KSystemInhibitor Error: Failed to create power request:" << GetLastError(); + return; + } + + if (types & KSystemInhibitor::Type::Suspend) { + if (!PowerSetRequest(handle, PowerRequestExecutionRequired)) { + qCWarning(KGUIADDONS_LOG) << "KSystemInhibitor Error: Failed to set ExecutionRequired:" << GetLastError(); + } + } + + if (types & KSystemInhibitor::Type::Idle) { + if (!PowerSetRequest(handle, PowerRequestDisplayRequired)) { + qCWarning(KGUIADDONS_LOG) << "KSystemInhibitor Error: Failed to set DisplayRequired:" << GetLastError(); + } + } + + d->m_handle = handle; +} + +KSystemInhibitor::~KSystemInhibitor() +{ + if (d->m_handle != INVALID_HANDLE_VALUE) { + PowerClearRequest(d->m_handle, PowerRequestExecutionRequired); + PowerClearRequest(d->m_handle, PowerRequestDisplayRequired); + CloseHandle(d->m_handle); + } +} + +#include "moc_ksysteminhibitor.cpp" diff --git a/local/recipes/kde/kf6-kguiaddons/source/tests/clipboardpixmaptest.cpp b/local/recipes/kde/kf6-kguiaddons/source/tests/clipboardpixmaptest.cpp new file mode 100644 index 0000000000..acc8c192f1 --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/tests/clipboardpixmaptest.cpp @@ -0,0 +1,34 @@ +/* + SPDX-FileCopyrightText: 2026 David Edmundson + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include + +#include +#include +#include +#include +#include + +// Check that we can send massive content without any timeouts + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + + QPixmap pixmap(8000, 8000); + pixmap.fill(Qt::red); + + auto mimeData = new QMimeData; + mimeData->setImageData(pixmap); + + auto clipboard = KSystemClipboard::instance(); + clipboard->setMimeData(mimeData, QClipboard::Clipboard); + + QTimer::singleShot(5000, &app, [&app]() { + app.quit(); + }); + + return app.exec(); +} diff --git a/local/recipes/kde/kf6-kguiaddons/source/tests/clipboardtest.cpp b/local/recipes/kde/kf6-kguiaddons/source/tests/clipboardtest.cpp new file mode 100644 index 0000000000..d49e208dd0 --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/tests/clipboardtest.cpp @@ -0,0 +1,116 @@ +/* + SPDX-FileCopyrightText: 2025 David Edmundson + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// This tests KSystemClipboard +// it also shows the Qt Clipboard so that we can confirm nothing deadlocks +// copying between the two + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + + QWidget window; + window.setWindowTitle(QStringLiteral("Clipboard Test")); + + auto *rootLayout = new QHBoxLayout(&window); + + // regular clipboard + { + auto clipboard = QApplication::clipboard(); + auto *group = new QGroupBox(QStringLiteral("Normal Clipboard"), &window); + rootLayout->addWidget(group); + + auto *groupLayout = new QVBoxLayout(group); + + auto *clipboardView = new QTextEdit(&window); + clipboardView->setEnabled(false); + + clipboardView->setMinimumHeight(200); + QObject::connect(clipboard, &QClipboard::changed, clipboardView, [clipboardView, clipboard](QClipboard::Mode mode) { + if (mode != QClipboard::Clipboard) { + return; + } + clipboardView->setText(clipboard->text()); + }); + clipboardView->setText(clipboard->text()); + + groupLayout->addWidget(clipboardView); + + auto *textEdit = new QTextEdit(group); + textEdit->setPlaceholderText(QStringLiteral("Enter clipboard content here…")); + textEdit->setMinimumHeight(120); + groupLayout->addWidget(textEdit); + + auto *btnRow = new QHBoxLayout(); + btnRow->addStretch(); + auto *submitBtn = new QPushButton(QStringLiteral("Submit"), group); + btnRow->addWidget(submitBtn); + groupLayout->addLayout(btnRow); + + QObject::connect(submitBtn, &QPushButton::clicked, &window, [textEdit, clipboard]() { + auto mimeData = new QMimeData; + mimeData->setText(textEdit->toPlainText()); + clipboard->setMimeData(mimeData, QClipboard::Clipboard); + }); + } + // system clipboard + { + auto clipboard = KSystemClipboard::instance(); + auto *group = new QGroupBox(QStringLiteral("System Clipboard"), &window); + rootLayout->addWidget(group); + + auto *groupLayout = new QVBoxLayout(group); + + auto *clipboardView = new QTextEdit(&window); + clipboardView->setEnabled(false); + + clipboardView->setMinimumHeight(200); + QObject::connect(clipboard, &KSystemClipboard::changed, clipboardView, [clipboardView, clipboard](QClipboard::Mode mode) { + if (mode != QClipboard::Clipboard) { + return; + } + clipboardView->setText(clipboard->text(mode)); + }); + clipboardView->setText(clipboard->text(QClipboard::Clipboard)); + + groupLayout->addWidget(clipboardView); + + auto *textEdit = new QTextEdit(group); + textEdit->setPlaceholderText(QStringLiteral("Enter clipboard content here…")); + textEdit->setMinimumHeight(120); + groupLayout->addWidget(textEdit); + + auto *btnRow = new QHBoxLayout(); + btnRow->addStretch(); + auto *submitBtn = new QPushButton(QStringLiteral("Submit"), group); + btnRow->addWidget(submitBtn); + groupLayout->addLayout(btnRow); + + QObject::connect(submitBtn, &QPushButton::clicked, &window, [textEdit, clipboard]() { + auto mimeData = new QMimeData; + mimeData->setText(textEdit->toPlainText()); + clipboard->setMimeData(mimeData, QClipboard::Clipboard); + }); + } + + window.resize(600, 500); + window.show(); + return app.exec(); +} diff --git a/local/recipes/kde/kf6-kguiaddons/source/tests/kcolorutils.qml b/local/recipes/kde/kf6-kguiaddons/source/tests/kcolorutils.qml new file mode 100644 index 0000000000..0aa51236ca --- /dev/null +++ b/local/recipes/kde/kf6-kguiaddons/source/tests/kcolorutils.qml @@ -0,0 +1,88 @@ +/* + SPDX-FileCopyrightText: ⓒ 2025 Volker Krause + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import org.kde.guiaddons + +ColumnLayout { + Label { text: "Mixing" } + RowLayout { + TextField { + id: color1 + text: "#ff0000" + } + TextField { + id: color2 + text: "#00ff00" + } + } + Text { + text: "Hue: " + ColorUtils.hue(color1.text) + " Chroma: " + ColorUtils.chroma(color1.text) + " Luma: " + ColorUtils.luma(color1.text) + } + Text { + text: "Contrast ratio: " + ColorUtils.contrastRatio(color1.text, color2.text) + } + RowLayout { + Slider { + id: lightSlider1 + } + Slider { + id: lightSlider2 + } + Rectangle { + Layout.fillWidth: true + Layout.fillHeight: true + color: ColorUtils.lighten(color1.text, lightSlider1.value, lightSlider2.value) + } + } + RowLayout { + Slider { + id: darkSlider1 + } + Slider { + id: darkSlider2 + } + Rectangle { + Layout.fillWidth: true + Layout.fillHeight: true + color: ColorUtils.darken(color1.text, darkSlider1.value, darkSlider2.value) + } + } + RowLayout { + Slider { + id: shadeSlider1 + } + Slider { + id: shadeSlider2 + } + Rectangle { + Layout.fillWidth: true + Layout.fillHeight: true + color: ColorUtils.shade(color1.text, shadeSlider1.value, shadeSlider2.value) + } + } + RowLayout { + Slider { + id: tintSlider + } + Rectangle { + Layout.fillWidth: true + Layout.fillHeight: true + color: ColorUtils.tint(color1.text, color2.text, tintSlider.value) + } + } + RowLayout { + Slider { + id: mixSlider + } + Rectangle { + Layout.fillWidth: true + Layout.fillHeight: true + color: ColorUtils.mix(color1.text, color2.text, mixSlider.value) + } + } +} diff --git a/local/recipes/kde/kf6-kiconthemes/source/autotests/kiconbutton_unittest.cpp b/local/recipes/kde/kf6-kiconthemes/source/autotests/kiconbutton_unittest.cpp new file mode 100644 index 0000000000..6adcbc8af6 --- /dev/null +++ b/local/recipes/kde/kf6-kiconthemes/source/autotests/kiconbutton_unittest.cpp @@ -0,0 +1,124 @@ +/* + SPDX-FileCopyrightText: 2026 Friedrich W. H. Kossebau + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include + +#include + +class KIconButtonTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void testConstructor(); + void test_setIcon(); + void test_resetIcon(); + void test_setIconSize(); + void test_setButtonIconSize(); + void test_setStrictIconSize(); +}; + +void KIconButtonTest::testConstructor() +{ + KIconButton iconButton; + + // check defaults + QCOMPARE(iconButton.icon(), QString()); + QCOMPARE(iconButton.iconSize(), 0); + QCOMPARE(iconButton.buttonIconSize(), 48); + QCOMPARE(iconButton.strictIconSize(), false); +} + +void KIconButtonTest::test_setIcon() +{ + KIconButton iconButton; + + // relying on default, check first + QCOMPARE(iconButton.icon(), QString()); + + // do action + iconButton.setIcon(QStringLiteral("test")); + + // check result + QCOMPARE(iconButton.icon(), QStringLiteral("test")); +} + +void KIconButtonTest::test_resetIcon() +{ + KIconButton iconButton; + + // test only icon string is reset + // prepare non-default property values + iconButton.setIcon(QStringLiteral("test")); + iconButton.setIconSize(42); + iconButton.setButtonIconSize(23); + iconButton.setStrictIconSize(true); + + // do action + iconButton.resetIcon(); + + // check result + QCOMPARE(iconButton.icon(), QString()); + QCOMPARE(iconButton.iconSize(), 42); + QCOMPARE(iconButton.buttonIconSize(), 23); + QCOMPARE(iconButton.strictIconSize(), true); +} + +void KIconButtonTest::test_setIconSize() +{ + KIconButton iconButton; + + // relying on default, check first + QCOMPARE(iconButton.iconSize(), 0); + QCOMPARE(iconButton.buttonIconSize(), 48); + + // do action + iconButton.setIconSize(42); + + // check result + QCOMPARE(iconButton.iconSize(), 42); + QCOMPARE(iconButton.buttonIconSize(), 42); +} + +void KIconButtonTest::test_setButtonIconSize() +{ + KIconButton iconButton; + + // relying on default, check first + QCOMPARE(iconButton.iconSize(), 0); + QCOMPARE(iconButton.buttonIconSize(), 48); + + // do action + iconButton.setButtonIconSize(23); + + // check result + QCOMPARE(iconButton.buttonIconSize(), 23); + QCOMPARE(iconButton.iconSize(), 0); +} + +void KIconButtonTest::test_setStrictIconSize() +{ + KIconButton iconButton; + + // relying on default, check first + QCOMPARE(iconButton.strictIconSize(), false); + + // do action: changing to true + iconButton.setStrictIconSize(true); + + // check result + QCOMPARE(iconButton.strictIconSize(), true); + + // do action: changing back to false + iconButton.setStrictIconSize(false); + + // check result + QCOMPARE(iconButton.strictIconSize(), false); +} + +QTEST_MAIN(KIconButtonTest) + +#include "kiconbutton_unittest.moc" diff --git a/local/recipes/kde/kf6-kiconthemes/source/src/kiconthemes-index.qdoc b/local/recipes/kde/kf6-kiconthemes/source/src/kiconthemes-index.qdoc new file mode 100644 index 0000000000..6a41177053 --- /dev/null +++ b/local/recipes/kde/kf6-kiconthemes/source/src/kiconthemes-index.qdoc @@ -0,0 +1,73 @@ +/*! + \page kiconthemes-index.html + \title KIconThemes + + Icon GUI utilities. + + \section1 Introduction + + This library contains classes to improve the handling of icons + in applications using the KDE Frameworks. Provided are: + + \list + \li KIconDialog: Dialog class to let the user select an icon + from the list of installed icons. + \li KIconButton: Custom button class that displays an icon. + When clicking it, the user can change it using the icon dialog. + \li KIconEffect: Applies various colorization effects to icons, + which can be used to create selected/disabled icon images. + \endlist + + Other classes in this repository are used internally by the icon + theme configuration dialogs, and should not be used by applications. + + \section1 Icon Theme Deployment + + On Linux/BSD, it is expected that the main icon themes (hicolor, oxygen, breeze) + are installed by the distribution. The platform theme plugin reads the icon + theme name from KConfig, and redirects QIcon::fromTheme calls to KIconEngine/KIconLoader, + which brings some benefits over Qt's internal icon loading, such as a cache shared + between processes. + + On other platforms such as MS Windows and Mac OS, icon themes are not a regular part of the system, + though they are available through package management systems (like MacPorts, Fink and Cygwin). + + When icon themes are installed in a suitable (system) location, applications can be built and + deployed as on Linux/BSD provided that the location is registered by calling QIcon::setThemeSearchPath(). + This can be done early in the main() function, or in a plugin that Qt loads automatically when + the application starts up (a platform theme plugin, for instance). + The more usual deployment strategy on those platforms consists of creating standalone applications + where each has its own copy of all dependencies and required resources. + + Icon theme resources for standalone applications can be created and deployed as follows: + \list + \li breeze-icons and other icon themes, when configured with -DBINARY_ICONS_RESOURCE=ON, install .rcc files (binary resources, loadable by Qt) + \li the installation process should copy one of these under the name "icontheme.rcc", in + a directory found by \l {https://doc.qt.io/qt-5/qstandardpaths.html#StandardLocation-enum} {QStandardPaths::AppDataLocation}. + For instance on Windows, icontheme.rcc is usually installed in APPROOT/data/, + while on Mac OS it is installed in the Resources directory inside the application bundle. + \li as long as the application links to KIconThemes (even if it doesn't use any of its API), + the icontheme.rcc file will be found on startup, loaded, and set as the default icon theme. + \endlist + + A related note of caution: These systems use embedded application icons regardless + of how icon themes are provided, and allow users to change that icon. Software should + thus ideally refrain from calling QGuiApplication::setWindowIcon() or at least pass + QGuiApplication::windowIcon() as the fallback argument when using QIcon::fromTheme(). + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {IconThemes} {KF6::IconThemes} + + \section1 API Reference + + \list + \li \l{KIconThemes C++ Classes} + \li \l{KIconWidgets C++ Classes} + \li \l{KIconThemes QML Types} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kiconthemes/source/src/kiconthemes.qdoc b/local/recipes/kde/kf6-kiconthemes/source/src/kiconthemes.qdoc new file mode 100644 index 0000000000..5aa7fea41a --- /dev/null +++ b/local/recipes/kde/kf6-kiconthemes/source/src/kiconthemes.qdoc @@ -0,0 +1,16 @@ +/*! + \module KIconThemes + \title KIconThemes C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent IconThemes + + \brief Icon GUI utilities. +*/ + +/*! + \qmlmodule org.kde.iconthemes + \title KIconThemes QML Types + \ingroup qmlmodules + \brief Icon GUI utilities. + */ diff --git a/local/recipes/kde/kf6-kiconthemes/source/src/kiconthemes.qdocconf b/local/recipes/kde/kf6-kiconthemes/source/src/kiconthemes.qdocconf new file mode 100644 index 0000000000..bbefa57653 --- /dev/null +++ b/local/recipes/kde/kf6-kiconthemes/source/src/kiconthemes.qdocconf @@ -0,0 +1,42 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KIconThemes +description = Icon GUI utilities + +documentationinheaders = true + +headerdirs += . +sourcedirs += . +imagedirs = ../docs/pics/ +excludedirs += widgets tools + +outputformats = HTML + +navigation.landingpage = "KIconThemes" + +depends += \ + kde \ + qtcore \ + qtgui \ + kiconwidgets + +qhp.projects = KIconThemes + +qhp.KIconThemes.file = kiconthemes.qhp +qhp.KIconThemes.namespace = org.kde.kiconthemes.$QT_VERSION_TAG +qhp.KIconThemes.virtualFolder = kiconthemes +qhp.KIconThemes.indexTitle = KIconThemes +qhp.KIconThemes.indexRoot = + +qhp.KIconThemes.subprojects = classes qmltypes +qhp.KIconThemes.subprojects.classes.title = C++ Classes +qhp.KIconThemes.subprojects.classes.indexTitle = KIconThemes C++ Classes +qhp.KIconThemes.subprojects.classes.selectors = class fake:headerfile +qhp.KIconThemes.subprojects.classes.sortPages = true + +qhp.KIconThemes.subprojects.qmltypes.title = QML Types +qhp.KIconThemes.subprojects.qmltypes.indexTitle = KIconThemes QML Types +qhp.KIconThemes.subprojects.qmltypes.selectors = qmltype +qhp.KIconThemes.subprojects.qmltypes.sortPages = true + +tagfile = kiconthemes.tags diff --git a/local/recipes/kde/kf6-kiconthemes/source/src/widgets/kiconwidgets.qdoc b/local/recipes/kde/kf6-kiconthemes/source/src/widgets/kiconwidgets.qdoc new file mode 100644 index 0000000000..c9dc8929a0 --- /dev/null +++ b/local/recipes/kde/kf6-kiconthemes/source/src/widgets/kiconwidgets.qdoc @@ -0,0 +1,9 @@ +/*! + \module KIconWidgets + \title KIconWidgets C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent IconWidgets + + \brief Icon GUI utilities. +*/ diff --git a/local/recipes/kde/kf6-kiconthemes/source/src/widgets/kiconwidgets.qdocconf b/local/recipes/kde/kf6-kiconthemes/source/src/widgets/kiconwidgets.qdocconf new file mode 100644 index 0000000000..268dcf3677 --- /dev/null +++ b/local/recipes/kde/kf6-kiconthemes/source/src/widgets/kiconwidgets.qdocconf @@ -0,0 +1,37 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KIconWidgets +description = Icon GUI utilities + +documentationinheaders = true + +headerdirs += . +sourcedirs += . +imagedirs = ../docs/pics/ + +outputformats = HTML + +navigation.landingpage = "KIconThemes" + +depends += \ + kde \ + qtcore \ + qtgui \ + qtwidgets \ + kiconthemes + +qhp.projects = KIconWidgets + +qhp.KIconWidgets.file = kiconwidgets.qhp +qhp.KIconWidgets.namespace = org.kde.kiconwidgets.$QT_VERSION_TAG +qhp.KIconWidgets.virtualFolder = kiconwidgets +qhp.KIconWidgets.indexTitle = KIconWidgets +qhp.KIconWidgets.indexRoot = + +qhp.KIconWidgets.subprojects = classes +qhp.KIconWidgets.subprojects.classes.title = C++ Classes +qhp.KIconWidgets.subprojects.classes.indexTitle = KIconWidgets C++ Classes +qhp.KIconWidgets.subprojects.classes.selectors = class fake:headerfile +qhp.KIconWidgets.subprojects.classes.sortPages = true + +tagfile = kiconwidgets.tags diff --git a/local/recipes/kde/kf6-kidletime/source/src/kidletime-index.qdoc b/local/recipes/kde/kf6-kidletime/source/src/kidletime-index.qdoc new file mode 100644 index 0000000000..25289bc21e --- /dev/null +++ b/local/recipes/kde/kf6-kidletime/source/src/kidletime-index.qdoc @@ -0,0 +1,24 @@ +/*! + \page kidletime-index.html + \title KIdleTime + + Reporting of idle time of user and system. + + KIdleTime is a singleton reporting information on idle time. It is useful not + only for finding out about the current idle time of the PC, but also for getting + notified upon idle time events, such as custom timeouts, or user activity. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {IdleTime} {KF6::IdleTime} + + \section1 API Reference + + \list + \li \l{KIdleTime C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kidletime/source/src/kidletime.qdoc b/local/recipes/kde/kf6-kidletime/source/src/kidletime.qdoc new file mode 100644 index 0000000000..a56212864d --- /dev/null +++ b/local/recipes/kde/kf6-kidletime/source/src/kidletime.qdoc @@ -0,0 +1,9 @@ +/*! + \module KIdleTime + \title KIdleTime C++ Classes + \cmakepackage KF6 + \cmakecomponent IdleTime + + \brief Reporting of idle time of user and system. + +*/ diff --git a/local/recipes/kde/kf6-kidletime/source/src/kidletime.qdocconf b/local/recipes/kde/kf6-kidletime/source/src/kidletime.qdocconf new file mode 100644 index 0000000000..f04ba18426 --- /dev/null +++ b/local/recipes/kde/kf6-kidletime/source/src/kidletime.qdocconf @@ -0,0 +1,34 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KIdleTime +description = Reporting of idle time of user and system + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +excludedirs += plugins + +outputformats = HTML + +navigation.landingpage = "KIdleTime" + +depends += \ + qtcore + +qhp.projects = KIdleTime + +qhp.KIdleTime.file = kidletime.qhp +qhp.KIdleTime.namespace = org.kde.kidletime.$QT_VERSION_TAG +qhp.KIdleTime.virtualFolder = kidletime +qhp.KIdleTime.indexTitle = KIdleTime +qhp.KIdleTime.indexRoot = + +qhp.KIdleTime.subprojects = classes +qhp.KIdleTime.subprojects.classes.title = C++ Classes +qhp.KIdleTime.subprojects.classes.indexTitle = KIdleTime C++ Classes +qhp.KIdleTime.subprojects.classes.selectors = class fake:headerfile +qhp.KIdleTime.subprojects.classes.sortPages = true + +tagfile = kidletime.tags diff --git a/local/recipes/kde/kf6-kitemmodels/source/src/core/kitemmodels-index.qdoc b/local/recipes/kde/kf6-kitemmodels/source/src/core/kitemmodels-index.qdoc new file mode 100644 index 0000000000..07d5574ed2 --- /dev/null +++ b/local/recipes/kde/kf6-kitemmodels/source/src/core/kitemmodels-index.qdoc @@ -0,0 +1,21 @@ +/*! + \page kitemmodels-index.html + \title KItemModels + + Models for Qt Model/View system. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {ItemModels} {KF6::ItemModels} + + \section1 API Reference + + \list + \li \l{KItemModels C++ Classes} + \li \l{KItemModels QML Types} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kitemmodels/source/src/core/kitemmodels.qdoc b/local/recipes/kde/kf6-kitemmodels/source/src/core/kitemmodels.qdoc new file mode 100644 index 0000000000..3d1ca004bd --- /dev/null +++ b/local/recipes/kde/kf6-kitemmodels/source/src/core/kitemmodels.qdoc @@ -0,0 +1,9 @@ +/*! + \module KItemModels + \title KItemModels C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent ItemModels + + \brief Models for Qt Model/View system. +*/ diff --git a/local/recipes/kde/kf6-kitemmodels/source/src/core/kitemmodels.qdocconf b/local/recipes/kde/kf6-kitemmodels/source/src/core/kitemmodels.qdocconf new file mode 100644 index 0000000000..e2da5b8ad8 --- /dev/null +++ b/local/recipes/kde/kf6-kitemmodels/source/src/core/kitemmodels.qdocconf @@ -0,0 +1,36 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KItemModels +description = Models for Qt Model/View system. + +documentationinheaders = true + +headerdirs += . +sourcedirs += . +imagedirs = ../../docs/pics/ + +outputformats = HTML + +navigation.landingpage = "KItemModels" + +depends += \ + kde \ + qtcore \ + qtwidgets \ + kitemmodelsqml + +qhp.projects = KItemModels + +qhp.KItemModels.file = kitemmodels.qhp +qhp.KItemModels.namespace = org.kde.kitemmodels.$QT_VERSION_TAG +qhp.KItemModels.virtualFolder = kitemmodels +qhp.KItemModels.indexTitle = KItemModels +qhp.KItemModels.indexRoot = + +qhp.KItemModels.subprojects = classes +qhp.KItemModels.subprojects.classes.title = C++ Classes +qhp.KItemModels.subprojects.classes.indexTitle = KItemModels C++ Classes +qhp.KItemModels.subprojects.classes.selectors = class fake:headerfile +qhp.KItemModels.subprojects.classes.sortPages = true + +tagfile = kitemmodels.tags diff --git a/local/recipes/kde/kf6-kitemmodels/source/src/qml.disabled/kitemmodelsqml.qdoc b/local/recipes/kde/kf6-kitemmodels/source/src/qml.disabled/kitemmodelsqml.qdoc new file mode 100644 index 0000000000..e89cf7dcbd --- /dev/null +++ b/local/recipes/kde/kf6-kitemmodels/source/src/qml.disabled/kitemmodelsqml.qdoc @@ -0,0 +1,7 @@ +/*! + \qmlmodule org.kde.kitemmodels + \title KItemModels QML Types + \ingroup qmlmodules + \brief Models for Qt Model/View system. + +*/ diff --git a/local/recipes/kde/kf6-kitemmodels/source/src/qml.disabled/kitemmodelsqml.qdocconf b/local/recipes/kde/kf6-kitemmodels/source/src/qml.disabled/kitemmodelsqml.qdocconf new file mode 100644 index 0000000000..571201b5ec --- /dev/null +++ b/local/recipes/kde/kf6-kitemmodels/source/src/qml.disabled/kitemmodelsqml.qdocconf @@ -0,0 +1,36 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KItemModelsQml +description = Models for Qt Model/View system. + +documentationinheaders = true + +headerdirs = . +sourcedirs = . + +outputformats = HTML + +navigation.landingpage = "KItemModels" + +depends += \ + kde \ + qtcore \ + qtqml \ + qtquickcontrols \ + kitemmodels + +qhp.projects = KItemModelsQml + +qhp.KItemModelsQml.file = kitemmodelsqml.qhp +qhp.KItemModelsQml.namespace = org.kde.kitemmodelsqml.$QT_VERSION_TAG +qhp.KItemModelsQml.virtualFolder = kitemmodelsqml +qhp.KItemModelsQml.indexTitle = KItemModels QML +qhp.KItemModelsQml.indexRoot = + +qhp.KItemModelsQml.subprojects = qmltypes +qhp.KItemModelsQml.subprojects.qmltypes.title = C++ Classes +qhp.KItemModelsQml.subprojects.qmltypes.indexTitle = KItemModels QML Types +qhp.KItemModelsQml.subprojects.qmltypes.selectors = qmltype +qhp.KItemModelsQml.subprojects.qmltypes.sortPages = true + +tagfile = kitemmodelsqml.tags diff --git a/local/recipes/kde/kf6-kitemviews/source/src/kitemviews-index.qdoc b/local/recipes/kde/kf6-kitemviews/source/src/kitemviews-index.qdoc new file mode 100644 index 0000000000..6f3e53b5c9 --- /dev/null +++ b/local/recipes/kde/kf6-kitemviews/source/src/kitemviews-index.qdoc @@ -0,0 +1,24 @@ +/*! + \page kitemviews-index.html + \title KItemViews + + Set of item views extending the Qt model-view framework. + + KItemViews includes a set of views, which can be used with item models. It + includes views for categorizing lists and to add search filters to flat and + hierarchical lists. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {ItemViews} {KF6::ItemViews} + + \section1 API Reference + + \list + \li \l{KItemViews C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kitemviews/source/src/kitemviews.qdoc b/local/recipes/kde/kf6-kitemviews/source/src/kitemviews.qdoc new file mode 100644 index 0000000000..97c9c93972 --- /dev/null +++ b/local/recipes/kde/kf6-kitemviews/source/src/kitemviews.qdoc @@ -0,0 +1,13 @@ +/*! + \module KItemViews + \title KItemViews C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent ItemViews + + \brief Set of item views extending the Qt model-view framework. + + KItemViews includes a set of views, which can be used with item models. It + includes views for categorizing lists and to add search filters to flat and + hierarchical lists. +*/ diff --git a/local/recipes/kde/kf6-kitemviews/source/src/kitemviews.qdocconf b/local/recipes/kde/kf6-kitemviews/source/src/kitemviews.qdocconf new file mode 100644 index 0000000000..748aa662f7 --- /dev/null +++ b/local/recipes/kde/kf6-kitemviews/source/src/kitemviews.qdocconf @@ -0,0 +1,33 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KItemViews +description = Additions to Qt Core + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +depends += \ + kde \ + qtcore \ + qtgui \ + qtwidgets + +qhp.projects = KItemViews + +qhp.KItemViews.file = kitemviews.qhp +qhp.KItemViews.namespace = org.kde.kitemviews.$QT_VERSION_TAG +qhp.KItemViews.virtualFolder = kitemviews +qhp.KItemViews.indexTitle = KItemViews +qhp.KItemViews.indexRoot = + +qhp.KItemViews.subprojects = classes +qhp.KItemViews.subprojects.classes.title = C++ Classes +qhp.KItemViews.subprojects.classes.indexTitle = KItemViews C++ Classes +qhp.KItemViews.subprojects.classes.selectors = class fake:headerfile +qhp.KItemViews.subprojects.classes.sortPages = true + +tagfile = kitemviews.tags diff --git a/local/recipes/kde/kf6-kjobwidgets/source/autotests/kuiserver2jobtrackertest2.cpp b/local/recipes/kde/kf6-kjobwidgets/source/autotests/kuiserver2jobtrackertest2.cpp new file mode 100644 index 0000000000..90c6a21e20 --- /dev/null +++ b/local/recipes/kde/kf6-kjobwidgets/source/autotests/kuiserver2jobtrackertest2.cpp @@ -0,0 +1,96 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2024 Méven Car + SPDX-FileCopyrightText: 2024 Waqar Ahmed + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +class TestJob : public KJob +{ + Q_OBJECT + +public: + TestJob() + { + m_timer.callOnTimeout(this, &TestJob::emitResult); + } + + ~TestJob() override = default; + + void start() override + { + m_timer.start(100); + } + + bool doSuspend() override + { + m_timer.stop(); + return true; + } + + bool doResume() override + { + m_timer.start(); + return true; + } + bool doKill() override + { + m_timer.stop(); + return true; + } + +private: + QTimer m_timer; +}; + +class KUiServerV2JobTrackerTest2 : public QObject +{ + Q_OBJECT +public: + KUiServerV2JobTrackerTest2(QObject *parent = nullptr) + : QObject(parent) + { + qGuiApp->setDesktopFileName(QStringLiteral("nonexisting.desktop")); + } + +private Q_SLOTS: + void simpleTest() + { + QPointer job = new TestJob; + + KUiServerV2JobTracker *tracker = new KUiServerV2JobTracker(this); + tracker->registerJob(job); + + job->start(); + job->suspend(); + job->resume(); + QTRY_VERIFY(job == nullptr); + + delete tracker; + } +}; + +QTEST_MAIN(KUiServerV2JobTrackerTest2) + +#include "kuiserver2jobtrackertest2.moc" diff --git a/local/recipes/kde/kf6-kjobwidgets/source/python/CMakeLists.txt b/local/recipes/kde/kf6-kjobwidgets/source/python/CMakeLists.txt new file mode 100644 index 0000000000..682c128f9a --- /dev/null +++ b/local/recipes/kde/kf6-kjobwidgets/source/python/CMakeLists.txt @@ -0,0 +1,39 @@ +# SPDX-FileCopyrightText: 2025 Fushan Wen +# SPDX-License-Identifier: BSD-2-Clause + +set(bindings_library "KJobWidgets") + +set(wrapped_header ${CMAKE_CURRENT_SOURCE_DIR}/bindings.h) +set(typesystem_file ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_kjobwidgets.xml) + +set(generated_sources + ${CMAKE_CURRENT_BINARY_DIR}/KJobWidgets/kjobwidgets_module_wrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR}/KJobWidgets/kabstractwidgetjobtracker_wrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR}/KJobWidgets/kdialogjobuidelegate_wrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR}/KJobWidgets/knotificationjobuidelegate_wrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR}/KJobWidgets/kstatusbarjobtracker_wrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR}/KJobWidgets/kuiserverjobtracker_wrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR}/KJobWidgets/kuiserverv2jobtracker_wrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR}/KJobWidgets/kwidgetjobtracker_wrapper.cpp +) + +ecm_generate_python_bindings( + PACKAGE_NAME ${bindings_library} + VERSION ${KF_VERSION} + WRAPPED_HEADER ${wrapped_header} + TYPESYSTEM ${typesystem_file} + GENERATED_SOURCES ${generated_sources} + DEPENDENCIES KF6::JobWidgets + QT_VERSION ${REQUIRED_QT_VERSION} + HOMEPAGE_URL "https://invent.kde.org/frameworks/kjobwidgets" + ISSUES_URL "https://bugs.kde.org/describecomponents.cgi?product=frameworks-kjobwidgets" + AUTHOR "The KDE Community" + README ${CMAKE_SOURCE_DIR}/README.md +) + +target_link_libraries(${bindings_library} PRIVATE KF6::JobWidgets) + +execute_process(COMMAND ${Python_EXECUTABLE} -Esc "import sysconfig; print(sysconfig.get_path('platlib', vars={'platbase': '${CMAKE_INSTALL_PREFIX}', 'base': '${CMAKE_INSTALL_PREFIX}'}))" OUTPUT_VARIABLE sysconfig_output) +string(STRIP ${sysconfig_output} PYTHON_INSTALL_DIR) + +install(TARGETS ${bindings_library} LIBRARY DESTINATION "${PYTHON_INSTALL_DIR}") diff --git a/local/recipes/kde/kf6-kjobwidgets/source/python/bindings.h b/local/recipes/kde/kf6-kjobwidgets/source/python/bindings.h new file mode 100644 index 0000000000..1bb1d8761b --- /dev/null +++ b/local/recipes/kde/kf6-kjobwidgets/source/python/bindings.h @@ -0,0 +1,12 @@ +// SPDX-FileCopyrightText: 2025 Fushan Wen +// SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + +#pragma once + +#include +#include +#include +#include +#include +#include +#include diff --git a/local/recipes/kde/kf6-kjobwidgets/source/python/typesystem_kjobwidgets.xml b/local/recipes/kde/kf6-kjobwidgets/source/python/typesystem_kjobwidgets.xml new file mode 100644 index 0000000000..74bc3fd218 --- /dev/null +++ b/local/recipes/kde/kf6-kjobwidgets/source/python/typesystem_kjobwidgets.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + diff --git a/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.freedesktop.PowerManagement.Inhibit.xml b/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.freedesktop.PowerManagement.Inhibit.xml new file mode 100644 index 0000000000..21dfce8c76 --- /dev/null +++ b/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.freedesktop.PowerManagement.Inhibit.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + diff --git a/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.freedesktop.portal.Inhibit.xml b/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.freedesktop.portal.Inhibit.xml new file mode 100644 index 0000000000..1ae413e185 --- /dev/null +++ b/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.freedesktop.portal.Inhibit.xml @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.freedesktop.portal.Request.xml b/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.freedesktop.portal.Request.xml new file mode 100644 index 0000000000..e8a26484e2 --- /dev/null +++ b/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.freedesktop.portal.Request.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + diff --git a/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.kde.JobView.xml b/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.kde.JobView.xml new file mode 100644 index 0000000000..97dfd2eaeb --- /dev/null +++ b/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.kde.JobView.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.kde.JobViewServer.xml b/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.kde.JobViewServer.xml new file mode 100644 index 0000000000..c8b99e2b81 --- /dev/null +++ b/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.kde.JobViewServer.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.kde.JobViewServerV2.xml b/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.kde.JobViewServerV2.xml new file mode 100644 index 0000000000..d857d8cdcb --- /dev/null +++ b/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.kde.JobViewServerV2.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + diff --git a/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.kde.JobViewV2.xml b/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.kde.JobViewV2.xml new file mode 100644 index 0000000000..221fa5af8d --- /dev/null +++ b/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.kde.JobViewV2.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.kde.JobViewV3.xml b/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.kde.JobViewV3.xml new file mode 100644 index 0000000000..3c909212fe --- /dev/null +++ b/local/recipes/kde/kf6-kjobwidgets/source/src/dbus/org.kde.JobViewV3.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/local/recipes/kde/kf6-kjobwidgets/source/src/kinhibitionjobtracker.cpp b/local/recipes/kde/kf6-kjobwidgets/source/src/kinhibitionjobtracker.cpp new file mode 100644 index 0000000000..56949cbbc6 --- /dev/null +++ b/local/recipes/kde/kf6-kjobwidgets/source/src/kinhibitionjobtracker.cpp @@ -0,0 +1,289 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2025 Kai Uwe Broulik + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include + +#include "kinhibitionjobtracker.h" +#include "kinhibitionjobtracker_p.h" + +#include "debug.h" + +#include + +#include +#include +#include + +#ifdef Q_OS_WINDOWS +#include +#elif HAVE_QTDBUS +#include + +#include +#include +#include + +#include "inhibit_interface.h" +#include "portal_inhibit_interface.h" +#include "portal_request_interface.h" + +static constexpr QLatin1String g_portalServiceName{"org.freedesktop.portal.Desktop"}; +static constexpr QLatin1String g_portalInhibitObjectPath{"/org/freedesktop/portal/desktop"}; + +static constexpr QLatin1String g_inhibitServiceName{"org.freedesktop.PowerManagement.Inhibit"}; +static constexpr QLatin1String g_inhibitObjectPath{"/org/freedesktop/PowerManagement/Inhibit"}; +#endif + +KInhibitionJobTrackerPrivate::KInhibitionJobTrackerPrivate(KInhibitionJobTracker *q) + : q(q) +{ +} + +void KInhibitionJobTrackerPrivate::inhibit(KJob *job) +{ + if (timers.contains(job) || inhibitions.contains(job)) { + return; + } + + qCDebug(KJOBWIDGETS) << "Inhibition scheduled in 10s..."; + // Avoid DBus traffic for short-lived jobs. + QTimer *timer = new QTimer(job); + QObject::connect(timer, &QObject::destroyed, q, [this, job] { + timers.remove(job); + }); + timer->setSingleShot(true); + timer->setInterval(10000); + timer->callOnTimeout(q, [this, job] { + doInhibit(job); + }); + timer->start(); + timers.insert(job, timer); +} + +void KInhibitionJobTrackerPrivate::doInhibit(KJob *job) +{ + QString appName = job->property("desktopFileName").toString(); + if (appName.isEmpty()) { + // desktopFileName is in QGuiApplication but we're in Core here. + appName = QCoreApplication::instance()->property("desktopFileName").toString(); + } + if (appName.isEmpty()) { + appName = QCoreApplication::applicationName(); + } + + QString reason = reasons.value(job); + if (reason.isEmpty()) { + reason = QCoreApplication::translate("KInhibitionJobTracker", "Job in progress"); + } + + auto *inhibition = new Inhibition(appName, reason); + Q_ASSERT(!inhibitions.contains(job)); + inhibitions.insert(job, inhibition); +} + +Inhibition::Inhibition(const QString &appName, const QString &reason, QObject *parent) + : QObject(parent) + , m_appName(appName) + , m_reason(reason) +{ + inhibit(); +} + +Inhibition::~Inhibition() +{ + uninhibit(); +} + +void Inhibition::inhibit() +{ +#ifdef Q_OS_WINDOWS + qCDebug(KJOBWIDGETS) << "Requesting power management inhibition with reason" << m_reason; + REASON_CONTEXT context{}; + context.Version = POWER_REQUEST_CONTEXT_VERSION; + context.Flags = POWER_REQUEST_CONTEXT_SIMPLE_STRING; + context.Reason.SimpleReasonString = reinterpret_cast(const_cast(m_reason.utf16())); + + HANDLE handle = PowerCreateRequest(&context); + if (handle == INVALID_HANDLE_VALUE) { + qWarning(KJOBWIDGETS).nospace() << "Failed to create inhibition request with reason " << m_reason << ": " << GetLastError(); + } else if (!PowerSetRequest(handle, PowerRequestExecutionRequired)) { + qWarning(KJOBWIDGETS).nospace() << "Failed to set inhibition request with reason " << m_reason << ": " << GetLastError(); + CloseHandle(handle); + } else { + m_handle = handle; + } +#elif HAVE_QTDBUS + if (KSandbox::isInside()) { + qCDebug(KJOBWIDGETS) << "Sending portal inhibition with reason" << m_reason; + org::freedesktop::portal::Inhibit inhibitInterface{g_portalServiceName, g_portalInhibitObjectPath, QDBusConnection::sessionBus()}; + QVariantMap args; + if (!m_reason.isEmpty()) { + args.insert(QStringLiteral("reason"), m_reason); + } + auto call = inhibitInterface.Inhibit(QString() /* window */, 4 /* Suspend */, args); + // This is not parented to the job, so we can properly clean up the inhibiton + // should the inhibition be destroyed before the inhibition has been processed. + auto *watcher = new QDBusPendingCallWatcher(call); + QPointer guard(this); + connect(watcher, &QDBusPendingCallWatcher::finished, watcher, [this, guard, watcher, reason = m_reason] { + QDBusPendingReply reply = *watcher; + + if (reply.isError()) { + qCWarning(KJOBWIDGETS).nospace() << "Failed to inhibit suspend with reason " << reason << ": " << reply.error().message(); + } else { + const QDBusObjectPath requestPath = reply.value(); + + // By the time the inhibition returned, the inhibition was already gone. Uninhibit again. + if (!guard) { + org::freedesktop::portal::Request requestInterface{g_portalServiceName, requestPath.path(), QDBusConnection::sessionBus()}; + requestInterface.Close(); + } else { + m_portalInhibitionRequest = requestPath; + } + } + + watcher->deleteLater(); + }); + } else { + qCDebug(KJOBWIDGETS) << "Sending freedesktop inhibition with reason" << m_reason; + org::freedesktop::PowerManagement::Inhibit inhibitInterface{g_inhibitServiceName, g_inhibitObjectPath, QDBusConnection::sessionBus()}; + auto call = inhibitInterface.Inhibit(m_appName, m_reason); + auto *watcher = new QDBusPendingCallWatcher(call); + QPointer guard(this); + connect(watcher, &QDBusPendingCallWatcher::finished, watcher, [this, guard, watcher, appName = m_appName, reason = m_reason] { + QDBusPendingReply reply = *watcher; + + if (reply.isError()) { + qCWarning(KJOBWIDGETS).nospace() << "Failed to inhibit suspend for " << appName << " with reason " << reason << ": " << reply.error().message(); + } else { + const uint cookie = reply.value(); + + if (!guard) { + org::freedesktop::PowerManagement::Inhibit inhibitInterface{g_inhibitServiceName, g_inhibitObjectPath, QDBusConnection::sessionBus()}; + inhibitInterface.UnInhibit(cookie); + } else { + m_inhibitionCookie = cookie; + } + } + + watcher->deleteLater(); + }); + } +#else + qCDebug(KJOBWIDGETS) << "KInhibitionJobTracker is not supported on this platform"; +#endif +} + +void Inhibition::uninhibit() +{ +#ifdef Q_OS_WINDOWS + if (m_handle != INVALID_HANDLE_VALUE) { + if (!PowerClearRequest(m_handle, PowerRequestExecutionRequired)) { + qWarning(KJOBWIDGETS) << "Failed to clear inhibition request:" << GetLastError(); + } + CloseHandle(m_handle); + m_handle = INVALID_HANDLE_VALUE; + } +#elif HAVE_QTDBUS + if (!m_portalInhibitionRequest.path().isEmpty()) { + org::freedesktop::portal::Request requestInterface{g_portalServiceName, m_portalInhibitionRequest.path(), QDBusConnection::sessionBus()}; + auto call = requestInterface.Close(); + auto *watcher = new QDBusPendingCallWatcher(call, this); + connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, watcher] { + QDBusPendingReply<> reply = *watcher; + + if (reply.isError()) { + qCWarning(KJOBWIDGETS) << "Failed to uninhibit suspend:" << reply.error().message(); + } else { + m_portalInhibitionRequest = QDBusObjectPath(); + } + + watcher->deleteLater(); + }); + } else if (m_inhibitionCookie) { + org::freedesktop::PowerManagement::Inhibit inhibitInterface{g_inhibitServiceName, g_inhibitObjectPath, QDBusConnection::sessionBus()}; + const int cookie = *m_inhibitionCookie; + auto call = inhibitInterface.UnInhibit(cookie); + auto *watcher = new QDBusPendingCallWatcher(call, this); + connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, watcher, cookie] { + QDBusPendingReply<> reply = *watcher; + + if (reply.isError()) { + qCWarning(KJOBWIDGETS).nospace() << "Failed to uninhibit suspend for cookie" << cookie << ": " << reply.error().message(); + } else { + m_inhibitionCookie.reset(); + } + + watcher->deleteLater(); + }); + } +#endif +} + +KInhibitionJobTracker::KInhibitionJobTracker(QObject *parent) + : KJobTrackerInterface(parent) + , d(std::make_unique(this)) +{ +} + +KInhibitionJobTracker::~KInhibitionJobTracker() +{ + if (!d->inhibitions.isEmpty()) { + qCWarning(KJOBWIDGETS) << "A KInhibitionJobTracker instance contains" << d->inhibitions.size() << "stalled jobs"; + qDeleteAll(d->inhibitions); + } +} + +void KInhibitionJobTracker::registerJob(KJob *job) +{ + if (d->inhibitions.contains(job)) { + return; + } + + if (!job->isSuspended() && !job->error()) { + d->inhibit(job); + } + + KJobTrackerInterface::registerJob(job); +} + +void KInhibitionJobTracker::unregisterJob(KJob *job) +{ + KJobTrackerInterface::unregisterJob(job); + finished(job); +} + +void KInhibitionJobTracker::finished(KJob *job) +{ + delete d->inhibitions.take(job); + delete d->timers.take(job); + d->reasons.remove(job); +} + +void KInhibitionJobTracker::suspended(KJob *job) +{ + delete d->inhibitions.take(job); + delete d->timers.take(job); +} + +void KInhibitionJobTracker::resumed(KJob *job) +{ + d->inhibit(job); +} + +void KInhibitionJobTracker::description(KJob *job, const QString &title, const QPair &field1, const QPair &field2) +{ + Q_UNUSED(field1); + Q_UNUSED(field2); + d->reasons.insert(job, title); + // Not recreating the inhibition just to update the title, + // lifting an inhibition after some time might trigger any action + // that was suppressed by it. +} + +#include "moc_kinhibitionjobtracker.cpp" +#include "moc_kinhibitionjobtracker_p.cpp" diff --git a/local/recipes/kde/kf6-kjobwidgets/source/src/kinhibitionjobtracker.h b/local/recipes/kde/kf6-kjobwidgets/source/src/kinhibitionjobtracker.h new file mode 100644 index 0000000000..b1bdd3d1d7 --- /dev/null +++ b/local/recipes/kde/kf6-kjobwidgets/source/src/kinhibitionjobtracker.h @@ -0,0 +1,79 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2025 Kai Uwe Broulik + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef KINHIBITIONJOBTRACKER_H +#define KINHIBITIONJOBTRACKER_H + +#include +#include + +#include + +class KJob; +class KInhibitionJobTrackerPrivate; + +/*! + * \class KInhibitionJobTracker + * + * \inmodule KJobWidgets + * + * \brief Block standby mode while a job is running. + * + * This job tracker will prevent the system from going into standby mode + * while a given job is running. This can be used to guard potentially lengthy + * operations, such as copying files, encoding videos, extracting archives, etc. + * + * When the job is started, a power management inhibition is posted after a + * short delay. When the job is paused, the inhibition is lifted until the job + * is resumed again. + * + * \since 6.18 + */ +class KJOBWIDGETS_EXPORT KInhibitionJobTracker : public KJobTrackerInterface +{ + Q_OBJECT + +public: + /*! + * Creates a new KInhibitionJobTracker + * + * \a parent the parent object + */ + explicit KInhibitionJobTracker(QObject *parent = nullptr); + + /*! + * Creates a new KJobTrackerInterface + * + * \a parent the parent object + */ + ~KInhibitionJobTracker() override; + + /*! + * Register a new job in this tracker. + * + * \a job the job to register + */ + void registerJob(KJob *job) override; + + /*! + * Unregister a job from this tracker. + * + * \a job the job to unregister + */ + void unregisterJob(KJob *job) override; + +protected Q_SLOTS: + void finished(KJob *job) override; + void suspended(KJob *job) override; + void resumed(KJob *job) override; + void description(KJob *job, const QString &title, const QPair &field1, const QPair &field2) override; + +private: + std::unique_ptr const d; +}; + +#endif // KINHIBITIONJOBTRACKER_H diff --git a/local/recipes/kde/kf6-kjobwidgets/source/src/kinhibitionjobtracker_p.h b/local/recipes/kde/kf6-kjobwidgets/source/src/kinhibitionjobtracker_p.h new file mode 100644 index 0000000000..9f6cf2801b --- /dev/null +++ b/local/recipes/kde/kf6-kjobwidgets/source/src/kinhibitionjobtracker_p.h @@ -0,0 +1,68 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2025 Kai Uwe Broulik + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef KINHIBITIONJOBTRACKER_P_H +#define KINHIBITIONJOBTRACKER_P_H + +#include + +#ifdef Q_OS_WINDOWS +#include +#elif HAVE_QTDBUS +#include +#endif + +#include +#include +#include + +class QTimer; + +class KJob; +class KInhibitionJobTracker; + +class Inhibition : public QObject +{ + Q_OBJECT + +public: + explicit Inhibition(const QString &appName, const QString &reason, QObject *parent = nullptr); + ~Inhibition() override; + +private: + void inhibit(); + void uninhibit(); + + QString m_appName; + QString m_reason; + +#ifdef Q_OS_WINDOWS + HANDLE m_handle = INVALID_HANDLE_VALUE; +#elif HAVE_QTDBUS + QDBusObjectPath m_portalInhibitionRequest; // portal. + std::optional m_inhibitionCookie; // fdo. +#endif +}; + +class KInhibitionJobTrackerPrivate +{ +public: + explicit KInhibitionJobTrackerPrivate(KInhibitionJobTracker *q); + + void inhibit(KJob *job); + + QHash reasons; + QHash timers; + QHash inhibitions; + +private: + KInhibitionJobTracker *const q; + + void doInhibit(KJob *job); +}; + +#endif // KINHIBITIONJOBTRACKER_P_H diff --git a/local/recipes/kde/kf6-kjobwidgets/source/src/kjobwidgets-index.qdoc b/local/recipes/kde/kf6-kjobwidgets/source/src/kjobwidgets-index.qdoc new file mode 100644 index 0000000000..817d9c47ba --- /dev/null +++ b/local/recipes/kde/kf6-kjobwidgets/source/src/kjobwidgets-index.qdoc @@ -0,0 +1,20 @@ +/*! + \page kjobwidgets-index.html + \title KJobWidgets + + Widgets for showing progress of asynchronous jobs. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {KJobWidgets} {KF6::JobWidgets} + + \section1 API Reference + + \list + \li \l{KJobWidgets C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kjobwidgets/source/src/kjobwidgets.qdoc b/local/recipes/kde/kf6-kjobwidgets/source/src/kjobwidgets.qdoc new file mode 100644 index 0000000000..ca02d0b19e --- /dev/null +++ b/local/recipes/kde/kf6-kjobwidgets/source/src/kjobwidgets.qdoc @@ -0,0 +1,8 @@ +/*! + \module KJobWidgets + \title KJobWidgets C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent JobWidgets + \brief Widgets for showing progress of asynchronous jobs. +*/ diff --git a/local/recipes/kde/kf6-kjobwidgets/source/src/kjobwidgets.qdocconf b/local/recipes/kde/kf6-kjobwidgets/source/src/kjobwidgets.qdocconf new file mode 100644 index 0000000000..8d7c073ec6 --- /dev/null +++ b/local/recipes/kde/kf6-kjobwidgets/source/src/kjobwidgets.qdocconf @@ -0,0 +1,33 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KJobWidgets +description = Widgets for showing progress of asynchronous jobs. + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +imagedirs = ../docs/pics + +outputformats = HTML + +navigation.landingpage = "KJobWidgets" + +depends += kde qtwidgets kcoreaddons + +qhp.projects = KJobWidgets + +qhp.KJobWidgets.file = kjobwidgets.qhp +qhp.KJobWidgets.namespace = org.kde.kjobwidgets.$QT_VERSION_TAG +qhp.KJobWidgets.virtualFolder = kjobwidgets +qhp.KJobWidgets.indexTitle = KJobWidgets +qhp.KJobWidgets.indexRoot = + +qhp.KJobWidgets.subprojects = classes +qhp.KJobWidgets.subprojects.classes.title = C++ Classes +qhp.KJobWidgets.subprojects.classes.indexTitle = KJobWidgets C++ Classes +qhp.KJobWidgets.subprojects.classes.selectors = class fake:headerfile +qhp.KJobWidgets.subprojects.classes.sortPages = true + +tagfile = kjobwidgets.tags diff --git a/local/recipes/kde/kf6-knotifications/source/src/knotifications-index.qdoc b/local/recipes/kde/kf6-knotifications/source/src/knotifications-index.qdoc new file mode 100644 index 0000000000..8687f7930d --- /dev/null +++ b/local/recipes/kde/kf6-knotifications/source/src/knotifications-index.qdoc @@ -0,0 +1,104 @@ +/*! + \page knotifications-index.html + \title KNotifications + + KNotifications is a cross-platform library for creating popup notifications. + + It currently supports Linux (and other Unix platforms that implement freedesktop.org notifications), Windows (8 or later), macOS and Android (version 5.0 or later). + + Please consult the \l {https://develop.kde.org/hig/platform/notification} {KDE Human Interface Guidelines} for when using Notifications is appropriate. + + KNotification is the main entry point for using KNotifications. + + \section1 The global config file + In order to perform a notification, you need to create a description file, which contains + default parameters of the notification. It needs to be installed to \c knotifications6/appname.notifyrc + in a QStandardPaths::GenericDataLocation directory. + On Android, this path is \c qrc:/knotifications6/. + + The filename must either match QCoreApplication::applicationName or be specified as the + component name to the KNotification object. Notifications won't be visible otherwise. + + You can do this with the following CMake command, if you use ECM's KDEInstallDirs: + \code + install(FILES appname.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR}) + \endcode + + This file contains mainly 2 parts, global information and individual events + + \section2 Global information + The global part looks like that + \badcode + [Global] + IconName=myicon + Name=Name of Application + Comment=A brief description of the application + DesktopEntry=DesktopFileName + \endcode + The icon filename is just the name, without extension. It follows the same + behavior as `Icon=` as defined in the Freedesktop Desktop Entry specification. + The Name field may be used as the application name for popup, it may also be used + to visualize the application's notification settings in KCModule instances. + If Name is not present, Comment is used instead. Either must be present. + + The DesktopEntry field is required in order for the application to be listed + in the notifications KCModule, and for its notifications to appear in the + notification history. Ensure that its value matches the application's desktop + file name, that the desktop file name is set in the QGuiApplication or + KAboutData desktopFileName property, and that the desktop file is not marked + as Hidden. + + \section2 Definition of Events + + The definition of the events forms the most important part of the config file + \badcode + [Event/newmail] + Name=New E-Mail + Comment=You have got a new email + Action=Sound|Popup + + [Event/contactOnline] + Name=Contact Goes Online + Comment=One of your contact has been connected + Sound=filetoplay.ogg + Action=None + Urgency=Low + \endcode + These are the default settings for each notifiable event. + Action is the string representing the action. At the time of writing, + the following actions are available: Sound, Popup. + Actions can be combined by separating them with '|'. + + Urgency can be any of: Low, Normal, Critical. + + \section1 Example Code + + This portion of code will fire the event for the "contactOnline" event + + \code + KNotification *notification = new KNotification("contactOnline"); + notification->setText(i18n("The contact %1 has gone online", contact->name()); + notification->setPixmap(contact->pixmap()); + notification->setActions({i18n("Open chat")}); + + connect(notification, QOverload::of(&KNotification::activated), contact, &Contact::slotOpenChat); + + notification->sendEvent(); + // Note: notification autodeletes itself with deleteLater() when no longer needed + \endcode + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {Notifications} {KF6::Notifications} + + \section1 API Reference + + \list + \li \l{KNotifications C++ Classes} + \li \l{KNotifications QML Types} + \endlist +*/ diff --git a/local/recipes/kde/kf6-knotifications/source/src/knotifications.qdoc b/local/recipes/kde/kf6-knotifications/source/src/knotifications.qdoc new file mode 100644 index 0000000000..bba798f068 --- /dev/null +++ b/local/recipes/kde/kf6-knotifications/source/src/knotifications.qdoc @@ -0,0 +1,9 @@ +/*! + \module KNotifications + \title KNotifications C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Notifications + + \brief Cross-platform Notification Library. +*/ diff --git a/local/recipes/kde/kf6-knotifications/source/src/knotifications.qdocconf b/local/recipes/kde/kf6-knotifications/source/src/knotifications.qdocconf new file mode 100644 index 0000000000..aacc7615ff --- /dev/null +++ b/local/recipes/kde/kf6-knotifications/source/src/knotifications.qdocconf @@ -0,0 +1,36 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KNotifications +description = Cross-platform Notification Library + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +excludedirs = qml + +outputformats = HTML + +navigation.landingpage = "KNotifications" + +depends += \ + qtcore \ + qtgui \ + knotificationsqml + +qhp.projects = KNotifications + +qhp.KNotifications.file = knotifications.qhp +qhp.KNotifications.namespace = org.kde.knotifications.$QT_VERSION_TAG +qhp.KNotifications.virtualFolder = knotifications +qhp.KNotifications.indexTitle = KNotifications +qhp.KNotifications.indexRoot = + +qhp.KNotifications.subprojects = classes +qhp.KNotifications.subprojects.classes.title = C++ Classes +qhp.KNotifications.subprojects.classes.indexTitle = KNotifications C++ Classes +qhp.KNotifications.subprojects.classes.selectors = class fake:headerfile +qhp.KNotifications.subprojects.classes.sortPages = true + +tagfile = knotifications.tags diff --git a/local/recipes/kde/kf6-knotifications/source/src/qml/knotificationsqml.qdoc b/local/recipes/kde/kf6-knotifications/source/src/qml/knotificationsqml.qdoc new file mode 100644 index 0000000000..1ada374964 --- /dev/null +++ b/local/recipes/kde/kf6-knotifications/source/src/qml/knotificationsqml.qdoc @@ -0,0 +1,123 @@ +/*! + \qmlmodule org.kde.notifications + \title KNotifications QML Types + + \brief Cross-platform Notification Library. + + Getting started with notifications in QML is quite similar to how this also works + in C++: + \list + \li Create a KNotificiation instance. + \li Customize it to your needs via its properties (labels, icons, actions, priorities, etc). + \li Connect to its signals to react to the user interacting with the notification, by triggering its inline actions or by closing it. + \li Eventually call its KNotification::sendEvent() method to show or re-show the notification. + \endlist + + \qml + import QtQuick + import org.kde.notification + + Item { + Notification { + id: myNotification + componentName: "your_component" + eventId: "your_event" + title: "Attention!" + text: "Something important happened." + iconName: "kde" + flags: Notification.Persistent + urgency: Notification.HighUrgency + onClosed: console.log("Notification closed.") + actions: [ + NotificationAction { + label: "Action 1" + onActivated: log.append("Action 1 activated.") + }, + NotificationAction { + label: "Action 2" + onActivated: log.append("Action 2 activated.") + }, + NotificationAction { + label: "Action 3" + onActivated: log.append("Action 3 activated.") + } + ] + } + + Button { + onClicked: myNotification.sendEvent() + } + } + \endqml + + \section1 Inline Reply Notifications + + Inline reply notifications are also available. There's a small difference to C++ + in that the reply action doesn't need to be explicitly managed but is created on + demand behind the scenes. + + \qml + import QtQuick + import org.kde.notification + + Item { + Notification { + id: myReplyNotification + componentName: "plasma_workspace" + eventId: "notification" + title: "Chat message from Dr Konqui" + text: "How are you?" + replyAction { + label: "Reply" + placeholderText: "Reply to Dr Konqi..." + submitButtonText: "Send Reply" + submitButtonIconName: "mail-reply-all" + onReplied: console.log(text) + } + } + } + \endqml + + \section1 Creating Notifications Dynamically + + You might have a use-case that requires an arbitrary amount of dynamically created + notifications rather than a fixed set of reusable instances. In that case the approach + shown above might be too restrictive. + + To address this it is possible to configure the auto-delete behavior of KNotification objects. + When used from C++ it's on by default for compatibility (but can also be switched off), + in QML it's off by default and can be switched on when needed as shown in the following example. + + \qml + import QtQuick + import org.kde.notification + + Item { + Component { + id: notificationComponent + Notification { + componentName: "plasma_workspace" + eventId: "notification" + text: "Temporary notification we can create new instances of." + autoDelete: true + } + } + + Button { + property int count: 0 + onClicked: { + var notification = notificationComponent.createObject(parent); + notification.title = "New Notification " + count; + n.sendEvent(); + ++count; + } + } + } + \endqml + + \section1 Further References + + There's a more complete and actually runnable pure-QML example in \c examples/notificationtester.qml + provided as part of the KNotifications source code. + +*/ diff --git a/local/recipes/kde/kf6-knotifications/source/src/qml/knotificationsqml.qdocconf b/local/recipes/kde/kf6-knotifications/source/src/qml/knotificationsqml.qdocconf new file mode 100644 index 0000000000..fd5a751072 --- /dev/null +++ b/local/recipes/kde/kf6-knotifications/source/src/qml/knotificationsqml.qdocconf @@ -0,0 +1,36 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KNotificationsQml +description = Additions to Qt Core + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +navigation.landingpage = "KNotifications" + +depends += \ + kde \ + qtcore \ + qtgui \ + qtqml \ + knotifications + +qhp.projects = KNotificationsQml + +qhp.KNotificationsQml.file = knotificationsqml.qhp +qhp.KNotificationsQml.namespace = org.kde.knotificationsqml.$QT_VERSION_TAG +qhp.KNotificationsQml.virtualFolder = knotificationsqml +qhp.KNotificationsQml.indexTitle = KNotificationsQml +qhp.KNotificationsQml.indexRoot = + +qhp.KNotificationsQml.subprojects = qmltypes +qhp.KNotificationsQml.subprojects.qmltypes.title = QML Types +qhp.KNotificationsQml.subprojects.qmltypes.indexTitle = KNotifications QML Types +qhp.KNotificationsQml.subprojects.qmltypes.selectors = qmltype +qhp.KNotificationsQml.subprojects.qmltypes.sortPages = true + +tagfile = knotificationsqml.tags diff --git a/local/recipes/kde/kf6-kpackage/source/po/ca@valencia/docs/kpackagetool/man-kpackagetool6.1.docbook b/local/recipes/kde/kf6-kpackage/source/po/ca@valencia/docs/kpackagetool/man-kpackagetool6.1.docbook new file mode 100644 index 0000000000..e8085c8c1e --- /dev/null +++ b/local/recipes/kde/kf6-kpackage/source/po/ca@valencia/docs/kpackagetool/man-kpackagetool6.1.docbook @@ -0,0 +1,315 @@ + + +]> + + + +Gestor KPackage +3 de gener de 2017 +Frameworks 5.30 +Frameworks de KDE + + + +kpackagetool6 +1 + + + +kpackagetool6 +Instal·la, llista, suprimix els paquets &plasma; + + + +kpackagetool6 camí tipus camí nom camí nom camí + + + +Descripció +El kpackagetool6 és una eina de la línia d'ordres per a instal·lar, llistar, suprimir els paquets de &plasma;. + + + + +Opcions + + + + +Mostra informació sobre la versió. + + + +Mostra esta ajuda. + + + camí +Genera una suma de verificació SHA1 per al paquet al «camí». + + + +Per a instal·lar o suprimir, opera amb els paquets instal·lats per a tots els usuaris. + + + tipus +El tipus del paquet, el qual es correspon amb el tipus de servei del connector que es troba en el paquet, &pex;, KPackage/Generic, Plasma/Theme, Plasma/Wallpaper, Plasma/Applet, &etc; + + + camí +Instal·la el paquet en el «camí». + + + nom +Mostra la informació del paquet «nom». + + + camí +Actualitza el paquet al «camí». + + + +Llista els paquets instal·lats. + + + +Llista tots els tipus de paquets coneguts que es poden instal·lar. + + + nom +Suprimix el paquet anomenat «nom». + + + camí +Camí absolut cap a l'arrel del paquet. Si no es proporciona, es buscaran els directoris de dades estàndard per a esta sessió de &plasma;. + + + camí +Es torna a crear l'índex dels connectors. S'utilitzarà conjuntament amb les opcions o . Torna a crear l'índex per al tipus indicat o l'arrel del paquet. Opera en el directori d'usuari, excepte si s'utilitza l'opció . + + + + + + + +Vegeu també + +Hi ha disponible documentació d'usuari més detallada des de help:/plasma-desktop (podeu emprar este &URL; a dins de &konqueror; o bé executar khelpcenter help:/plasma-desktop). + + + + +Autoria +El kpackagetool6 ha sigut escrit per en AaronSeigo aseigo@kde.org. + + + diff --git a/local/recipes/kde/kf6-kpackage/source/po/ga/libkpackage6.po b/local/recipes/kde/kf6-kpackage/source/po/ga/libkpackage6.po new file mode 100644 index 0000000000..457a860cb1 --- /dev/null +++ b/local/recipes/kde/kf6-kpackage/source/po/ga/libkpackage6.po @@ -0,0 +1,335 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR This file is copyright: +# This file is distributed under the same license as the kpackage package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: kpackage\n" +"Report-Msgid-Bugs-To: https://bugs.kde.org\n" +"POT-Creation-Date: 2025-11-17 11:49+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Irish Gaelic \n" +"Language: ga\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=5; plural=n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n < 11 ? " +"3 : 4\n" + +#, kde-format +msgctxt "NAME OF TRANSLATORS" +msgid "Your names" +msgstr "" + +#, kde-format +msgctxt "EMAIL OF TRANSLATORS" +msgid "Your emails" +msgstr "" + +#: kpackage/private/packagejobthread.cpp:164 +#, kde-format +msgid "Could not create package root directory: %1" +msgstr "" + +#: kpackage/private/packagejobthread.cpp:173 +#, kde-format +msgid "No such file: %1" +msgstr "" + +#: kpackage/private/packagejobthread.cpp:203 +#, kde-format +msgid "Could not open package file, unsupported archive format: %1 %2" +msgstr "" + +#: kpackage/private/packagejobthread.cpp:211 +#, kde-format +msgid "Could not open package file: %1" +msgstr "" + +#: kpackage/private/packagejobthread.cpp:238 +#, kde-format +msgid "Package is not considered valid" +msgstr "" + +#: kpackage/private/packagejobthread.cpp:248 +#, kde-format +msgid "Package plugin id not specified: %1" +msgstr "" + +#: kpackage/private/packagejobthread.cpp:258 +#, kde-format +msgid "Package plugin id %1 contains invalid characters" +msgstr "" + +#: kpackage/private/packagejobthread.cpp:277 +#, kde-format +msgid "" +"The new package has a different type from the old version already installed." +msgstr "" + +#: kpackage/private/packagejobthread.cpp:282 +#, kde-format +msgid "" +"Impossible to remove the old installation of %1 located at %2. error: %3" +msgstr "" + +#: kpackage/private/packagejobthread.cpp:286 +#, kde-format +msgid "Not installing version %1 of %2. Version %3 already installed." +msgstr "" + +#: kpackage/private/packagejobthread.cpp:290 +#, kde-format +msgid "%1 already exists" +msgstr "" + +#: kpackage/private/packagejobthread.cpp:311 +#, kde-format +msgid "Could not install dependency: '%1'" +msgstr "" + +#: kpackage/private/packagejobthread.cpp:323 +#, kde-format +msgid "Could not move package to destination: %1" +msgstr "" + +#: kpackage/private/packagejobthread.cpp:333 +#, kde-format +msgid "Could not copy package to destination: %1" +msgstr "" + +#: kpackage/private/packagejobthread.cpp:368 +#, kde-format +msgid "package path was deleted manually" +msgstr "" + +#: kpackage/private/packagejobthread.cpp:368 +#, kde-format +msgid "%1 does not exist" +msgstr "" + +#: kpackage/private/packagejobthread.cpp:388 +#, kde-format +msgid "Could not delete package from: %1" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:87 +#, kde-format +msgid "Failed to generate a Package hash for %1" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:90 +#, kde-format +msgid "SHA1 hash for Package at %1: '%2'" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:145 +#, kde-format +msgid "Listing KPackageType: %1 in %2" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:198 +#, kde-format +msgid "Error: Plugin %1 is not installed." +msgstr "" + +#: kpackagetool/kpackagetool.cpp:212 +#, kde-format +msgctxt "" +"No option was given, this is the error message telling the user he needs at " +"least one, do not translate install, remove, upgrade nor list" +msgid "One of install, remove, upgrade or list is required." +msgstr "" + +#: kpackagetool/kpackagetool.cpp:255 kpackagetool/kpackagetool.cpp:333 +#, kde-format +msgid "Error: Can't find plugin metadata: %1\n" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:259 +#, kde-format +msgid "Showing info for package: %1" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:260 +#, kde-format +msgid " Name : %1" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:261 +#, kde-format +msgid " Description: %1" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:262 +#, kde-format +msgid " Plugin : %1" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:268 +#, kde-format +msgid " Author : %1" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:269 +#, kde-format +msgid " Path : %1" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:429 +#, kde-format +msgctxt "" +"The user entered conflicting options packageroot and global, this is the " +"error message telling the user he can use only one" +msgid "" +"The packageroot and global options conflict with each other, please select " +"only one." +msgstr "" + +#: kpackagetool/kpackagetool.cpp:457 +#, kde-format +msgid "KPackage Structure Name" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:458 +#, kde-format +msgid "Path" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:489 +#, kde-format +msgid "Package types that are installable with this tool:" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:490 +#, kde-format +msgid "Built in:" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:493 +#, kde-format +msgid "KPackage/Generic" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:494 +#, kde-format +msgid "KPackage/GenericQML" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:502 +#, kde-format +msgid "Provided by plugins:" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:524 +#, kde-format +msgid "Successfully upgraded %1" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:526 +#, kde-format +msgid "Successfully installed %1" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:529 +#, kde-format +msgid "Error: Installation of %1 failed: %2" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:541 +#, kde-format +msgid "Upgrading package from file: %1" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:548 +#, kde-format +msgid "Successfully uninstalled %1" +msgstr "" + +#: kpackagetool/kpackagetool.cpp:550 +#, kde-format +msgid "Error: Uninstallation of %1 failed: %2" +msgstr "" + +#: kpackagetool/main.cpp:36 +#, kde-format +msgid "KPackage Manager" +msgstr "" + +#: kpackagetool/options.h:11 +#, kde-format +msgctxt "Do not translate " +msgid "Generate a SHA1 hash for the package at " +msgstr "" + +#: kpackagetool/options.h:18 +#, kde-format +msgid "For install or remove, operates on packages installed for all users." +msgstr "" + +#: kpackagetool/options.h:27 +#, kde-format +msgctxt "" +"theme, wallpaper, etc. are keywords, but they may be translated, as both " +"versions are recognized by the application (if translated, should be same as " +"messages with 'package type' context below)" +msgid "" +"The type of package, corresponding to the service type of the package " +"plugin, e.g. KPackage/Generic, Plasma/Theme, Plasma/Wallpaper, Plasma/" +"Applet, etc." +msgstr "" + +#: kpackagetool/options.h:36 +#, kde-format +msgctxt "Do not translate " +msgid "Install the package at " +msgstr "" + +#: kpackagetool/options.h:43 +#, kde-format +msgctxt "Do not translate " +msgid "Show information of package " +msgstr "" + +#: kpackagetool/options.h:50 +#, kde-format +msgctxt "Do not translate " +msgid "Upgrade the package at " +msgstr "" + +#: kpackagetool/options.h:56 +#, kde-format +msgid "List installed packages" +msgstr "" + +#: kpackagetool/options.h:61 +#, kde-format +msgid "List all known package types that can be installed" +msgstr "" + +#: kpackagetool/options.h:67 +#, kde-format +msgctxt "Do not translate " +msgid "Remove the package named " +msgstr "" + +#: kpackagetool/options.h:74 +#, kde-format +msgid "" +"Absolute path to the package root. If not supplied, then the standard data " +"directories for this KDE session will be searched instead." +msgstr "" + +#: kpackagetool/options.h:82 +#, kde-format +msgctxt "Do not translate " +msgid "Outputs the metadata for the package " +msgstr "" + +#: kpackagetool/options.h:89 +#, kde-format +msgctxt "Do not translate " +msgid "Outputs the metadata for the package into " +msgstr "" diff --git a/local/recipes/kde/kf6-kpackage/source/src/kpackage/kpackage-index.qdoc b/local/recipes/kde/kf6-kpackage/source/src/kpackage/kpackage-index.qdoc new file mode 100644 index 0000000000..5863f9a392 --- /dev/null +++ b/local/recipes/kde/kf6-kpackage/source/src/kpackage/kpackage-index.qdoc @@ -0,0 +1,20 @@ +/*! + \page kpackage-index.html + \title KPackage + + Installation and loading of additional content (ex: scripts, images...) as packages. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {Package} {KF6::Package} + + \section1 API Reference + + \list + \li \l{KPackage C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kpackage/source/src/kpackage/kpackage.qdoc b/local/recipes/kde/kf6-kpackage/source/src/kpackage/kpackage.qdoc new file mode 100644 index 0000000000..d35adca3b4 --- /dev/null +++ b/local/recipes/kde/kf6-kpackage/source/src/kpackage/kpackage.qdoc @@ -0,0 +1,9 @@ +/*! + \module KPackage + \title KPackage C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Package + + \brief Installation and loading of additional content (ex: scripts, images...) as packages. +*/ diff --git a/local/recipes/kde/kf6-kpackage/source/src/kpackage/kpackage.qdocconf b/local/recipes/kde/kf6-kpackage/source/src/kpackage/kpackage.qdocconf new file mode 100644 index 0000000000..030f4440e9 --- /dev/null +++ b/local/recipes/kde/kf6-kpackage/source/src/kpackage/kpackage.qdocconf @@ -0,0 +1,33 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KPackage +description = Installation and loading of additional content (ex: scripts, images...) as packages. + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +navigation.landingpage = "KPackage" + +depends += \ + kde \ + qtcore + +qhp.projects = KPackage + +qhp.KPackage.file = kpackage.qhp +qhp.KPackage.namespace = org.kde.kpackage.$QT_VERSION_TAG +qhp.KPackage.virtualFolder = kpackage +qhp.KPackage.indexTitle = KPackage +qhp.KPackage.indexRoot = + +qhp.KPackage.subprojects = classes +qhp.KPackage.subprojects.classes.title = C++ Classes +qhp.KPackage.subprojects.classes.indexTitle = KPackage C++ Classes +qhp.KPackage.subprojects.classes.selectors = class fake:headerfile +qhp.KPackage.subprojects.classes.sortPages = true + +tagfile = kpackage.tags diff --git a/local/recipes/kde/kf6-kservice/kmemfile_stub.cpp b/local/recipes/kde/kf6-kservice/kmemfile_stub.cpp new file mode 100644 index 0000000000..e2aec1afef --- /dev/null +++ b/local/recipes/kde/kf6-kservice/kmemfile_stub.cpp @@ -0,0 +1,64 @@ +#include +#include +#include +#include "sycoca/kmemfile_p.h" + +class KMemFile::Private +{ +public: + Private() = default; +}; + +KMemFile::KMemFile(const QString &filename, QObject *parent) + : QIODevice(parent) + , d(std::make_unique()) +{ + Q_UNUSED(filename); + setOpenMode(QIODevice::ReadOnly); +} + +KMemFile::~KMemFile() = default; + +void KMemFile::fileContentsChanged(const QString &filename) +{ + Q_UNUSED(filename); +} + +qint64 KMemFile::readData(char *data, qint64 maxSize) +{ + Q_UNUSED(data); + Q_UNUSED(maxSize); + return -1; +} + +qint64 KMemFile::writeData(const char *data, qint64 maxSize) +{ + Q_UNUSED(data); + Q_UNUSED(maxSize); + return -1; +} + +void KMemFile::close() +{ + QIODevice::close(); +} + +bool KMemFile::isSequential() const +{ + return false; +} + +bool KMemFile::open(OpenMode mode) +{ + return QIODevice::open(mode); +} + +bool KMemFile::seek(qint64 pos) +{ + return QIODevice::seek(pos); +} + +qint64 KMemFile::size() const +{ + return 0; +} diff --git a/local/recipes/kde/kf6-kservice/source/po/ca@valencia/docs/kbuildsycoca6/man-kbuildsycoca6.8.docbook b/local/recipes/kde/kf6-kservice/source/po/ca@valencia/docs/kbuildsycoca6/man-kbuildsycoca6.8.docbook new file mode 100644 index 0000000000..1820fa863d --- /dev/null +++ b/local/recipes/kde/kf6-kservice/source/po/ca@valencia/docs/kbuildsycoca6/man-kbuildsycoca6.8.docbook @@ -0,0 +1,284 @@ + + +]> + + + + +&kde-frameworks;: KService +Darian Lanx Va escriure la documentació original. + +
content@openprojects.net
+
+
+Alex Merry Ha actualitzat la documentació al &kf5-full;. + +
alexmerry@kde.org
+
+
+ +17 de setembre de 2015 +Frameworks 5.15 +Frameworks de KDE + +
+ + +kbuildsycoca6 +8 + + + +kbuildsycoca6 +Refà el cau de la Configuració del sistema per als fitxers d'escriptori en KService + + + +Sinopsi + +kbuildsycoca6 OPCIONS + + + + + + +Descripció + +kbuildsycoca6 construïx el cau binari de les dades emmagatzemades en els fitxers .desktop, .xml i tipus &MIME; que l'entorn de treball KService utilitza per a trobar connectors, aplicacions i altres serveis. + +La biblioteca KService utilitza esta base de dades per a proporcionar de manera eficient la informació requerida. + +Normalment, els usuaris no necessitaran executar esta aplicació directament. KService l'executarà si cal, cada vegada que algun dels fitxers canvie les dades guardades en la memòria cau. + + + + + +Opcions + + + + + +Ignora els fitxers definits per l'usuari (en XDG_DATA_HOME). Actualment, açò només està suportat en sistemes &UNIX;. + + + + + + +En lloc d'utilitzar la memòria cau existent i només actualitzar la informació que ha canviat o que ha sigut afegida, començarà amb una memòria cau buida. S'ignorarà si s'establix l'opció . + + + + + + +Prova la generació de la base de dades del menú d'aplicacions. En realitat no construïx la memòria cau. + + + + + + +Utilitza el «mode de prova» QStandardPaths per a evitar interferir amb les dades de l'usuari. Açò és per a ús amb les proves unitàries. + + + + + + +Seguix un identificador de menú per a la depuració. + + + + + + +Mostra la informació sobre l'autoria. + + + + + + +Mostra la informació sobre la llicència. + + + + + + +Mostra un text breu d'ajuda. + + + + + + +Mostra la informació sobre la versió. + + + + + + + + + +Fitxers + + +cachedir/ksycoca6_[idioma]_[sha1-dels-dirs] + +La memòria cau de KService generada per kbuildsycoca6. Sobre els sistemes &UNIX;, el directori_cau sol ser XDG_CACHE_HOME. + + + + + + + + +Vegeu també +kded58, kdeinit58 + + + + + +Errors +Utilitzeu el Seguidor d'errors de &kde; (escriviu-hi en anglés) per a informar dels errors. + + +
+ + + diff --git a/local/recipes/kde/kf6-kservice/source/src/kservice-index.qdoc b/local/recipes/kde/kf6-kservice/source/src/kservice-index.qdoc new file mode 100644 index 0000000000..5471e0dcf2 --- /dev/null +++ b/local/recipes/kde/kf6-kservice/source/src/kservice-index.qdoc @@ -0,0 +1,25 @@ +/*! + \page kservice-index.html + \title KService + KService allows to query information about installed applications and their associated file types. + + The two relevant classes are: + \list + \li \l KService: This models an installed application and allows to query various properties about it + \li \l KApplicationTrader: This is used to list available applications as well as applications associated with a given file type + \endlist + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {Service} {KF6::Service} + + \section1 API Reference + + \list + \li \l{KService C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kservice/source/src/kservice.qdoc b/local/recipes/kde/kf6-kservice/source/src/kservice.qdoc new file mode 100644 index 0000000000..56c3b9384d --- /dev/null +++ b/local/recipes/kde/kf6-kservice/source/src/kservice.qdoc @@ -0,0 +1,9 @@ +/*! + \module KService + \title KService C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Service + + \brief KService allows to query information about installed applications and their associated file types. +*/ diff --git a/local/recipes/kde/kf6-kservice/source/src/kservice.qdocconf b/local/recipes/kde/kf6-kservice/source/src/kservice.qdocconf new file mode 100644 index 0000000000..587758f6ce --- /dev/null +++ b/local/recipes/kde/kf6-kservice/source/src/kservice.qdocconf @@ -0,0 +1,35 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KService +description = KService allows to query information about installed applications and their associated file types + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +navigation.landingpage = "KService" + +depends += \ + kde \ + qtcore \ + kconfigcore \ + kiowidgets + +qhp.projects = KService + +qhp.KService.file = kservice.qhp +qhp.KService.namespace = org.kde.kservice.$QT_VERSION_TAG +qhp.KService.virtualFolder = kservice +qhp.KService.indexTitle = KService +qhp.KService.indexRoot = + +qhp.KService.subprojects = classes +qhp.KService.subprojects.classes.title = C++ Classes +qhp.KService.subprojects.classes.indexTitle = KService C++ Classes +qhp.KService.subprojects.classes.selectors = class fake:headerfile +qhp.KService.subprojects.classes.sortPages = true + +tagfile = kservice.tags diff --git a/local/recipes/kde/kf6-ksvg/source/autotests/data/plasma/desktoptheme/testthemesystemcolors/element.svg b/local/recipes/kde/kf6-ksvg/source/autotests/data/plasma/desktoptheme/testthemesystemcolors/element.svg new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/local/recipes/kde/kf6-ksvg/source/autotests/data/plasma/desktoptheme/testthemesystemcolors/element.svg @@ -0,0 +1 @@ + diff --git a/local/recipes/kde/kf6-ksvg/source/autotests/data/plasma/desktoptheme/testthemesystemcolors/metadata.json b/local/recipes/kde/kf6-ksvg/source/autotests/data/plasma/desktoptheme/testthemesystemcolors/metadata.json new file mode 100644 index 0000000000..88a8e6c986 --- /dev/null +++ b/local/recipes/kde/kf6-ksvg/source/autotests/data/plasma/desktoptheme/testthemesystemcolors/metadata.json @@ -0,0 +1,18 @@ +{ + "KPlugin": { + "Authors": [ + { + "Email": "kde-artists@kde.org", + "Name": "KDE Visual Design Group" + } + ], + "Category": "", + "EnabledByDefault": true, + "Id": "default", + "License": "LGPL", + "Name": "Plasma test theme", + "Version": "5.20", + "Website": "https://plasma.kde.org" + }, + "X-Plasma-API": "5.0" +} diff --git a/local/recipes/kde/kf6-ksvg/source/autotests/data/plasma/desktoptheme/testthemesystemcolors/opaque/element.svg b/local/recipes/kde/kf6-ksvg/source/autotests/data/plasma/desktoptheme/testthemesystemcolors/opaque/element.svg new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/local/recipes/kde/kf6-ksvg/source/autotests/data/plasma/desktoptheme/testthemesystemcolors/opaque/element.svg @@ -0,0 +1 @@ + diff --git a/local/recipes/kde/kf6-ksvg/source/autotests/data/plasma/desktoptheme/testthemesystemcolors/plasmarc b/local/recipes/kde/kf6-ksvg/source/autotests/data/plasma/desktoptheme/testthemesystemcolors/plasmarc new file mode 100644 index 0000000000..a31148a73c --- /dev/null +++ b/local/recipes/kde/kf6-ksvg/source/autotests/data/plasma/desktoptheme/testthemesystemcolors/plasmarc @@ -0,0 +1,5 @@ +[ContrastEffect] +enabled=true +contrast=0.23 +intensity=2.0 +saturation=1.7 diff --git a/local/recipes/kde/kf6-ksvg/source/autotests/itemtest.cpp b/local/recipes/kde/kf6-ksvg/source/autotests/itemtest.cpp new file mode 100644 index 0000000000..07f25961e2 --- /dev/null +++ b/local/recipes/kde/kf6-ksvg/source/autotests/itemtest.cpp @@ -0,0 +1,92 @@ +/* + * SPDX-FileCopyrightText: 2026 Nicolas Fella + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +class ItemTest : public QObject +{ + Q_OBJECT + +public Q_SLOTS: + void initTestCase(); + void cleanupTestCase(); + +private Q_SLOTS: + void testItem(); + +private: + QDir m_themeDir; +}; + +void copyDirectory(const QString &srcDir, const QString &dstDir) +{ + QDir targetDir(dstDir); + QDirIterator it(srcDir, QDir::Filters(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::Name), QDirIterator::Subdirectories); + while (it.hasNext()) { + it.next(); + QString path = it.filePath(); + QString relDestPath = path.last(it.filePath().length() - srcDir.length() - 1); + if (it.fileInfo().isDir()) { + QVERIFY(targetDir.mkpath(relDestPath)); + } else { + QVERIFY(QFile::copy(path, dstDir % '/' % relDestPath)); + } + } +} + +void ItemTest::initTestCase() +{ + QStandardPaths::setTestModeEnabled(true); + + m_themeDir = QDir(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) % '/' % "plasma"); + m_themeDir.removeRecursively(); + + copyDirectory(QFINDTESTDATA("data/plasma"), m_themeDir.absolutePath()); + + m_themeDir.mkpath("desktoptheme/testtheme/widgets"); + QVERIFY(QFile::copy(QFINDTESTDATA("data/background.svgz"), m_themeDir.absolutePath() + "/desktoptheme/testtheme/widgets/background.svgz")); +} + +void ItemTest::cleanupTestCase() +{ + m_themeDir.removeRecursively(); +} + +void ItemTest::testItem() +{ + auto set = std::make_unique(); + set->setBasePath("plasma/desktoptheme"); + set->setImageSetName("testtheme"); + + QQmlEngine engine; + QQmlComponent comp(&engine, QFINDTESTDATA("itemtest.qml")); + auto item = comp.create(); + QVERIFY(item); + + auto svg = item->property("svg").value(); + QVERIFY(svg); + + QVERIFY(svg->isValid()); + QCOMPARE(svg->imageSet()->imageSetName(), "testtheme"); + QCOMPARE(svg->imagePath(), "widgets/background"); + + QCOMPARE(item->property("naturalSize"), QSizeF(148, 148)); + QCOMPARE(item->property("elementRect"), QRectF(0, 0, 148, 148)); + + delete item; +} + +#include "itemtest.moc" + +QTEST_MAIN(ItemTest); diff --git a/local/recipes/kde/kf6-ksvg/source/autotests/itemtest.qml b/local/recipes/kde/kf6-ksvg/source/autotests/itemtest.qml new file mode 100644 index 0000000000..2b3b13c3fb --- /dev/null +++ b/local/recipes/kde/kf6-ksvg/source/autotests/itemtest.qml @@ -0,0 +1,14 @@ +/* + * SPDX-FileCopyrightText: 2026 Nicolas Fella + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick + +import org.kde.ksvg as KSvg + +KSvg.SvgItem { + imagePath: "widgets/background" + anchors.fill: parent +} diff --git a/local/recipes/kde/kf6-ksvg/source/po/ug/libksvg6.po b/local/recipes/kde/kf6-ksvg/source/po/ug/libksvg6.po new file mode 100644 index 0000000000..674f989302 --- /dev/null +++ b/local/recipes/kde/kf6-ksvg/source/po/ug/libksvg6.po @@ -0,0 +1,29 @@ +# Uyghur translation for libksvg6. +# Copyright (C) YEAR This file is copyright: +# This file is distributed under the same license as the ksvg package. +# Abduqadir Abliz , 2026., YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: ksvg\n" +"Report-Msgid-Bugs-To: https://bugs.kde.org\n" +"POT-Creation-Date: 2025-11-17 11:49+0000\n" +"PO-Revision-Date: 2026-05-31 19:45-0400\n" +"Last-Translator: Abduqadir Abliz \n" +"Language-Team: Uyghur \n" +"Language: ug\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.9\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#, kde-format +msgctxt "NAME OF TRANSLATORS" +msgid "Your names" +msgstr "ئابدۇقادىر ئابلىز، غەيرەت كەنجى" + +#, kde-format +msgctxt "EMAIL OF TRANSLATORS" +msgid "Your emails" +msgstr "sahranbay@gmail.com, gheyret@gmail.com" diff --git a/local/recipes/kde/kf6-ktextwidgets/source/src/ktextwidgets-index.qdoc b/local/recipes/kde/kf6-ktextwidgets/source/src/ktextwidgets-index.qdoc new file mode 100644 index 0000000000..68d97dcb25 --- /dev/null +++ b/local/recipes/kde/kf6-ktextwidgets/source/src/ktextwidgets-index.qdoc @@ -0,0 +1,20 @@ +/*! + \page ktextwidgets-index.html + \title KTextWidgets + + KTextWidgets is a collection of text editing widgets. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {TextWidgets} {KF6::TextWidgets} + + \section1 API Reference + + \list + \li \l{KTextWidgets C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-ktextwidgets/source/src/ktextwidgets.qdoc b/local/recipes/kde/kf6-ktextwidgets/source/src/ktextwidgets.qdoc new file mode 100644 index 0000000000..518127485d --- /dev/null +++ b/local/recipes/kde/kf6-ktextwidgets/source/src/ktextwidgets.qdoc @@ -0,0 +1,12 @@ +/*! + \module KTextWidgets + \title KTextWidgets C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent TextWidgets + + \brief KTextWidgets is a collection of text editing widgets. + + KTextWidgets provides widgets for displaying and editing text. It supports + rich text as well as plain text. +*/ diff --git a/local/recipes/kde/kf6-ktextwidgets/source/src/ktextwidgets.qdocconf b/local/recipes/kde/kf6-ktextwidgets/source/src/ktextwidgets.qdocconf new file mode 100644 index 0000000000..b0faf878a2 --- /dev/null +++ b/local/recipes/kde/kf6-ktextwidgets/source/src/ktextwidgets.qdocconf @@ -0,0 +1,31 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KTextWidgets +description = Text editing widgets + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +imagedirs = ../docs/pics + +navigation.landingpage = "KTextWidgets" + +depends += kde qtcore qtwidgets sonnetui + +qhp.projects = KTextWidgets + +qhp.KTextWidgets.file = ktextwidgets.qhp +qhp.KTextWidgets.namespace = org.kde.ktextwidgets.$QT_VERSION_TAG +qhp.KTextWidgets.virtualFolder = ktextwidgets +qhp.KTextWidgets.indexTitle = KTextWidgets +qhp.KTextWidgets.indexRoot = + +qhp.KTextWidgets.subprojects = classes +qhp.KTextWidgets.subprojects.classes.title = C++ Classes +qhp.KTextWidgets.subprojects.classes.indexTitle = KTextWidgets C++ Classes +qhp.KTextWidgets.subprojects.classes.selectors = class fake:headerfile +qhp.KTextWidgets.subprojects.classes.sortPages = true + +tagfile = ktextwidgets.tags diff --git a/local/recipes/kde/kf6-kwallet/source/po/ga/kwallet6-query.po b/local/recipes/kde/kf6-kwallet/source/po/ga/kwallet6-query.po new file mode 100644 index 0000000000..69638bcd41 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/po/ga/kwallet6-query.po @@ -0,0 +1,131 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR This file is copyright: +# This file is distributed under the same license as the kwallet package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: kwallet\n" +"Report-Msgid-Bugs-To: https://bugs.kde.org\n" +"POT-Creation-Date: 2025-11-17 11:49+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Irish Gaelic \n" +"Language: ga\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=5; plural=n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n < 11 ? " +"3 : 4\n" + +#, kde-format +msgctxt "NAME OF TRANSLATORS" +msgid "Your names" +msgstr "" + +#, kde-format +msgctxt "EMAIL OF TRANSLATORS" +msgid "Your emails" +msgstr "" + +#: main.cpp:24 main.cpp:26 +#, kde-format +msgid "KWallet query interface" +msgstr "" + +#: main.cpp:28 +#, kde-format +msgid "(c) 2015, The KDE Developers" +msgstr "" + +#: main.cpp:32 +#, kde-format +msgid "verbose output" +msgstr "" + +#: main.cpp:33 +#, kde-format +msgid "list password entries" +msgstr "" + +#: main.cpp:34 +#, kde-format +msgid "reads the secrets from the given " +msgstr "" + +#: main.cpp:34 main.cpp:35 +#, kde-format +msgid "Entry" +msgstr "" + +#: main.cpp:35 +#, kde-format +msgid "" +"write secrets to the given . The values are read from the standard " +"input. IMPORTANT: previous wallet entry value will be overwritten!" +msgstr "" + +#: main.cpp:36 +#, kde-format +msgid "specify the folder in the wallet " +msgstr "" + +#: main.cpp:36 +#, kde-format +msgid "Folder" +msgstr "" + +#: main.cpp:40 +#, kde-format +msgid "The wallet to query" +msgstr "" + +#: main.cpp:50 +#, kde-format +msgid "Missing argument" +msgstr "" + +#: main.cpp:54 +#, kde-format +msgid "Too many arguments given" +msgstr "" + +#: main.cpp:59 +#, kde-format +msgid "Only one mode (list, read or write) can be set. Aborting" +msgstr "" + +#: main.cpp:63 +#, kde-format +msgid "Please specify the mode (list or read)." +msgstr "" + +#: querydriver.cpp:46 +#, kde-format +msgid "Wallet %1 not found" +msgstr "" + +#: querydriver.cpp:70 +#, kde-format +msgid "Failed to open wallet %1. Aborting" +msgstr "" + +#: querydriver.cpp:104 querydriver.cpp:122 +#, kde-format +msgid "The folder %1 does not exist!" +msgstr "" + +#: querydriver.cpp:132 +#, kde-format +msgid "Failed to read entry %1 value from the %2 wallet." +msgstr "" + +#: querydriver.cpp:142 querydriver.cpp:159 +#, kde-format +msgid "Failed to read entry %1 value from the %2 wallet" +msgstr "" + +#: querydriver.cpp:194 querydriver.cpp:211 +#, kde-format +msgid "Failed to write entry %1 value to %2 wallet" +msgstr "" diff --git a/local/recipes/kde/kf6-kwallet/source/po/ug/kwallet6-query.po b/local/recipes/kde/kf6-kwallet/source/po/ug/kwallet6-query.po new file mode 100644 index 0000000000..13fc3ae4ba --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/po/ug/kwallet6-query.po @@ -0,0 +1,131 @@ +# Uyghur translation for kwallet6-query. +# Copyright (C) YEAR This file is copyright: +# This file is distributed under the same license as the kwallet package. +# Abduqadir Abliz , 2026., YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: kwallet\n" +"Report-Msgid-Bugs-To: https://bugs.kde.org\n" +"POT-Creation-Date: 2025-11-17 11:49+0000\n" +"PO-Revision-Date: 2026-05-31 19:57-0400\n" +"Last-Translator: Abduqadir Abliz \n" +"Language-Team: Uyghur \n" +"Language: ug\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.9\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#, kde-format +msgctxt "NAME OF TRANSLATORS" +msgid "Your names" +msgstr "ئابدۇقادىر ئابلىز، غەيرەت كەنجى" + +#, kde-format +msgctxt "EMAIL OF TRANSLATORS" +msgid "Your emails" +msgstr "sahranbay@gmail.com, gheyret@gmail.com" + +#: main.cpp:24 main.cpp:26 +#, kde-format +msgid "KWallet query interface" +msgstr "" + +#: main.cpp:28 +#, kde-format +msgid "(c) 2015, The KDE Developers" +msgstr "" + +#: main.cpp:32 +#, kde-format +msgid "verbose output" +msgstr "" + +#: main.cpp:33 +#, kde-format +msgid "list password entries" +msgstr "" + +#: main.cpp:34 +#, kde-format +msgid "reads the secrets from the given " +msgstr "" + +#: main.cpp:34 main.cpp:35 +#, kde-format +msgid "Entry" +msgstr "تۈر" + +#: main.cpp:35 +#, kde-format +msgid "" +"write secrets to the given . The values are read from the standard " +"input. IMPORTANT: previous wallet entry value will be overwritten!" +msgstr "" + +#: main.cpp:36 +#, kde-format +msgid "specify the folder in the wallet " +msgstr "" + +#: main.cpp:36 +#, kde-format +msgid "Folder" +msgstr "قىسقۇچ" + +#: main.cpp:40 +#, kde-format +msgid "The wallet to query" +msgstr "" + +#: main.cpp:50 +#, kde-format +msgid "Missing argument" +msgstr "" + +#: main.cpp:54 +#, kde-format +msgid "Too many arguments given" +msgstr "" + +#: main.cpp:59 +#, kde-format +msgid "Only one mode (list, read or write) can be set. Aborting" +msgstr "" + +#: main.cpp:63 +#, kde-format +msgid "Please specify the mode (list or read)." +msgstr "" + +#: querydriver.cpp:46 +#, kde-format +msgid "Wallet %1 not found" +msgstr "" + +#: querydriver.cpp:70 +#, kde-format +msgid "Failed to open wallet %1. Aborting" +msgstr "" + +#: querydriver.cpp:104 querydriver.cpp:122 +#, kde-format +msgid "The folder %1 does not exist!" +msgstr "" + +#: querydriver.cpp:132 +#, kde-format +msgid "Failed to read entry %1 value from the %2 wallet." +msgstr "" + +#: querydriver.cpp:142 querydriver.cpp:159 +#, kde-format +msgid "Failed to read entry %1 value from the %2 wallet" +msgstr "" + +#: querydriver.cpp:194 querydriver.cpp:211 +#, kde-format +msgid "Failed to write entry %1 value to %2 wallet" +msgstr "" diff --git a/local/recipes/kde/kf6-kwallet/source/src/api/KWallet/kwallet-index.qdoc b/local/recipes/kde/kf6-kwallet/source/src/api/KWallet/kwallet-index.qdoc new file mode 100644 index 0000000000..a210c03d33 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/api/KWallet/kwallet-index.qdoc @@ -0,0 +1,20 @@ +/*! + \page kwallet-index.html + \title KWallet + + Secrets Storage. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {Wallet} {KF6::Wallet} + + \section1 API Reference + + \list + \li \l{KWallet C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kwallet/source/src/api/KWallet/kwallet.qdoc b/local/recipes/kde/kf6-kwallet/source/src/api/KWallet/kwallet.qdoc new file mode 100644 index 0000000000..9216d56778 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/api/KWallet/kwallet.qdoc @@ -0,0 +1,9 @@ +/*! + \module KWallet + \title KWallet C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Wallet + + \brief Secrets Storage. +*/ diff --git a/local/recipes/kde/kf6-kwallet/source/src/api/KWallet/kwallet.qdocconf b/local/recipes/kde/kf6-kwallet/source/src/api/KWallet/kwallet.qdocconf new file mode 100644 index 0000000000..3cd9d1cf90 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/api/KWallet/kwallet.qdocconf @@ -0,0 +1,29 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KWallet +description = Password storage API + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +navigation.landingpage = "KWallet" + +depends = kde qtcore qtwidgets + +qhp.projects = KWallet + +qhp.KWallet.file = kwallet.qhp +qhp.KWallet.namespace = org.kde.kwallet.$QT_VERSION_TAG +qhp.KWallet.virtualFolder = kwallet +qhp.KWallet.indexTitle = KWallet +qhp.KWallet.indexRoot = + +qhp.KWallet.subprojects = classes +qhp.KWallet.subprojects.classes.title = C++ Classes +qhp.KWallet.subprojects.classes.indexTitle = KWallet C++ Classes +qhp.KWallet.subprojects.classes.selectors = class fake:headerfile +qhp.KWallet.subprojects.classes.sortPages = true + +tagfile = kwallet.tags diff --git a/local/recipes/kde/kf6-kwallet/source/src/api/KWallet/org.kde.nodeprecated.KWallet.xml b/local/recipes/kde/kf6-kwallet/source/src/api/KWallet/org.kde.nodeprecated.KWallet.xml new file mode 100644 index 0000000000..ffc3bd7b61 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/api/KWallet/org.kde.nodeprecated.KWallet.xml @@ -0,0 +1,278 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/Messages.sh b/local/recipes/kde/kf6-kwallet/source/src/runtime/Messages.sh new file mode 100755 index 0000000000..410aa31c60 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/Messages.sh @@ -0,0 +1,3 @@ +#! /usr/bin/env bash +$EXTRACTRC `find . -name \*.ui` >> rc.cpp || exit 11 +$XGETTEXT `find . -name "*.cpp" -o -name "*.cc" | grep -v "/tests" | grep -v "/kwallet-query"` -o $podir/kwalletd6.pot diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/CMakeLists.txt b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/CMakeLists.txt new file mode 100644 index 0000000000..1a9eb8f27e --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/CMakeLists.txt @@ -0,0 +1,182 @@ +add_definitions(-DTRANSLATION_DOMAIN="kwalletd6") + +configure_file(config-ksecretd.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-ksecretd.h ) + +include(CheckSymbolExists) + +check_symbol_exists(explicit_bzero "string.h" KSECRETD_HAVE_EXPLICIT_BZERO) +if (NOT KSECRETD_HAVE_EXPLICIT_BZERO) +# On FreeBSD it's in strings.h +check_symbol_exists(explicit_bzero "strings.h" KSECRETD_HAVE_EXPLICIT_BZERO) +endif(NOT KSECRETD_HAVE_EXPLICIT_BZERO) +check_symbol_exists(RtlSecureZeroMemory "windows.h" KSECRETD_HAVE_RTLSECUREZEROMEMORY) + +find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Gui) + +find_package(KF6ColorScheme ${KF_DEP_VERSION} REQUIRED) +find_package(KF6Config ${KF_DEP_VERSION} REQUIRED) +find_package(KF6CoreAddons ${KF_DEP_VERSION} REQUIRED) +find_package(KF6DBusAddons ${KF_DEP_VERSION} REQUIRED) +find_package(KF6Notifications ${KF_DEP_VERSION} REQUIRED) +find_package(KF6WidgetsAddons ${KF_DEP_VERSION} REQUIRED) +find_package(KF6WindowSystem ${KF_DEP_VERSION} REQUIRED) +find_package(KF6Crash ${KF_DEP_VERSION} REQUIRED) + +########### find needed packages ###### + +find_package(Qca-qt6 REQUIRED 2.3.1) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) +########### build tests ######### +add_subdirectory(autotests) + +########### ksecretd ############### + +add_executable(ksecretd) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../kwalletbackend) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/../kwalletbackend) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../api/KWallet) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/../../api/KWallet) + +remove_definitions(-DQT_NO_CAST_FROM_ASCII) + +ecm_setup_version(${KF_VERSION} VARIABLE_PREFIX KSECRETD + VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/ksecretd_version.h" + PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6WalletConfigVersion.cmake" + SOVERSION 6) + +target_sources(ksecretd PRIVATE + main.cpp + kbetterthankdialog.cpp + ksecretd.cpp + kwalletwizard.cpp + ktimeout.cpp + kwalletsessionstore.cpp + kwalletfreedesktopservice.cpp + kwalletfreedesktopsession.cpp + kwalletfreedesktopcollection.cpp + kwalletfreedesktopitem.cpp + kwalletfreedesktopprompt.cpp + kwalletfreedesktopattributes.cpp + + kwalletportalsecrets.cpp +) +ecm_qt_declare_logging_category(ksecretd + HEADER ksecretd_debug.h + IDENTIFIER KSECRETD_LOG + CATEGORY_NAME kf.wallet.ksecretd + OLD_CATEGORY_NAMES kf5.kwallet.ksecretd + DESCRIPTION "ksecretd" + EXPORT KWALLET +) + +ki18n_wrap_ui(ksecretd + kbetterthankdialogbase.ui + kwalletwizardpageexplanation.ui + kwalletwizardpageintro.ui + kwalletwizardpageoptions.ui + kwalletwizardpagepassword.ui +) + +if (Gpgmepp_FOUND) + target_sources(ksecretd PRIVATE + knewwalletdialog.cpp + ) + ki18n_wrap_ui(ksecretd + kwalletwizardpagepasswordgpg.ui + kwalletwizardpagegpgkey.ui + knewwalletdialogintro.ui + knewwalletdialoggpg.ui + ) +endif(Gpgmepp_FOUND) + +if (NOT EXCLUDE_DEPRECATED_BEFORE_AND_AT STREQUAL "CURRENT" AND + EXCLUDE_DEPRECATED_BEFORE_AND_AT VERSION_LESS 5.72.0) + set(kwallet_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.kde.KWallet.xml) +else() + # copy of org.kde.KWallet.xml, but with all deprecated API removed + set(kwallet_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.kde.nodeprecated.KWallet.xml) +endif() +set(fdo_service_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.Secrets.Service.xml) +set(fdo_session_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.Secrets.Session.xml) +set(fdo_collection_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.Secrets.Collection.xml) +set(fdo_item_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.Secrets.Item.xml) +set(fdo_prompt_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.Secrets.Prompt.xml) +set(fdo_portal_secret_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.impl.portal.Secret.xml) + +set(ksecretd_dbus_SRCS) +qt_add_dbus_adaptor(ksecretd_dbus_SRCS ${kwallet_xml} ksecretd.h KSecretD kwalletadaptor KWalletAdaptor) +qt_add_dbus_adaptor(ksecretd_dbus_SRCS ${fdo_service_xml} kwalletfreedesktopservice.h KWalletFreedesktopService + kwalletfreedesktopserviceadaptor KWalletFreedesktopServiceAdaptor) +qt_add_dbus_adaptor(ksecretd_dbus_SRCS ${fdo_session_xml} kwalletfreedesktopsession.h KWalletFreedesktopSession + kwalletfreedesktopsessionadaptor KWalletFreedesktopSessionAdaptor) +qt_add_dbus_adaptor(ksecretd_dbus_SRCS ${fdo_collection_xml} kwalletfreedesktopcollection.h KWalletFreedesktopCollection + kwalletfreedesktopcollectionadaptor KWalletFreedesktopCollectionAdaptor) +qt_add_dbus_adaptor(ksecretd_dbus_SRCS ${fdo_item_xml} kwalletfreedesktopitem.h KWalletFreedesktopItem + kwalletfreedesktopitemadaptor KWalletFreedesktopItemAdaptor) +qt_add_dbus_adaptor(ksecretd_dbus_SRCS ${fdo_prompt_xml} kwalletfreedesktopprompt.h KWalletFreedesktopPrompt + kwalletfreedesktoppromptadaptor KWalletFreedesktopPromptAdaptor) +qt_add_dbus_adaptor(ksecretd_dbus_SRCS ${fdo_portal_secret_xml} kwalletportalsecrets.h KWalletPortalSecrets + kwalletportalsecretsadaptor KWalletPortalSecretsAdaptor) + +target_sources(ksecretd PRIVATE + ${ksecretd_dbus_SRCS} +) + +if (HAIKU) + target_link_libraries(ksecretd network) +endif () + +target_link_libraries(ksecretd + KF6WalletBackend + KF6Wallet + Qt6::Widgets + KF6::I18n + KF6::ColorScheme + KF6::CoreAddons + KF6::ConfigCore + KF6::DBusAddons + KF6::WidgetsAddons + KF6::WindowSystem + KF6::Notifications + KF6::Crash + ${Qca_LIBRARY}) +if (Gpgmepp_FOUND) + target_link_libraries(ksecretd Gpgmepp) + kde_target_enable_exceptions(ksecretd PRIVATE) +endif(Gpgmepp_FOUND) + +ecm_mark_nongui_executable(ksecretd) +install(TARGETS ksecretd ${KF_INSTALL_TARGETS_DEFAULT_ARGS}) + +if(WIN32) + configure_file(org.kde.kwalletd5.service.win.in + ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kwalletd5.service) + configure_file(org.kde.kwalletd6.service.win.in + ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kwalletd6.service) + install( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kwalletd5.service + ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kwalletd6.service + DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR} + ) +else() + configure_file(org.kde.secretservicecompat.service.in + ${CMAKE_CURRENT_BINARY_DIR}/org.kde.secretservicecompat.service) + configure_file(org.freedesktop.impl.portal.desktop.kwallet.service.in + ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.impl.portal.desktop.kwallet.service) + + install( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/org.kde.secretservicecompat.service + ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.impl.portal.desktop.kwallet.service + DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR} + ) +endif() + +########### install files ############### +install( FILES ksecretd.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR} ) +install( FILES org.kde.ksecretd.desktop DESTINATION ${KDE_INSTALL_APPDIR} ) +install( FILES kwallet.portal DESTINATION ${KDE_INSTALL_DATADIR}/xdg-desktop-portal/portals) + diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/README b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/README new file mode 100644 index 0000000000..020e1baade --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/README @@ -0,0 +1,19 @@ +This directory consists of one daemon: kwalletd, and one library, in backend. + +KWallet::Backend is used inside kwalletd to manage the actual files and +encryption. + +KWallet::Wallet, used to represent wallet entries and to encapsulate communication +to and from the wallet server kwalletd, is part of the public API and has been +moved to kdeui. + + +Application level: + +KSystemTray notifier for wallet accesses + +Konqueror plugin + +KControl module + +You can also read the paper at http://www.staikos.net/~staikos/papers/2003/ diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/autotests/CMakeLists.txt b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/autotests/CMakeLists.txt new file mode 100644 index 0000000000..2499edc6db --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/autotests/CMakeLists.txt @@ -0,0 +1,76 @@ +set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} ) + +find_package(Qt6Test REQUIRED) +find_package(KF6Config ${KF6_DEP_VERSION} REQUIRED) +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOMOC ON) + +include(ECMAddTests) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/..) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../api/KWallet) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../api/KWallet) + +add_definitions(-DFDO_ENABLE_DUMMY_MESSAGE_CONNECTION) +remove_definitions(-DQT_NO_CAST_FROM_ASCII) + +if (NOT EXCLUDE_DEPRECATED_BEFORE_AND_AT STREQUAL "CURRENT" AND + EXCLUDE_DEPRECATED_BEFORE_AND_AT VERSION_LESS 5.72.0) + set(kwallet_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.kde.KWallet.xml) +else() + # copy of org.kde.KWallet.xml, but with all deprecated API removed + set(kwallet_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.kde.nodeprecated.KWallet.xml) +endif() +set(fdo_service_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.Secrets.Service.xml) +set(fdo_session_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.Secrets.Session.xml) +set(fdo_collection_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.Secrets.Collection.xml) +set(fdo_item_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.Secrets.Item.xml) +set(fdo_prompt_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.Secrets.Prompt.xml) + +set(TEST_SRC + fdo_secrets_test.cpp + ../kwalletfreedesktopservice.cpp + ../kwalletfreedesktopitem.cpp + ../kwalletfreedesktopcollection.cpp + ../kwalletfreedesktopsession.cpp + ../kwalletfreedesktopprompt.cpp + ../kwalletfreedesktopattributes.cpp +) + +qt_add_dbus_adaptor( TEST_SRC ${kwallet_xml} ../ksecretd.h KSecretD kwalletadaptor KWalletAdaptor) +qt_add_dbus_adaptor( TEST_SRC ${fdo_service_xml} ../kwalletfreedesktopservice.h KWalletFreedesktopService + kwalletfreedesktopserviceadaptor KWalletFreedesktopServiceAdaptor) +qt_add_dbus_adaptor( TEST_SRC ${fdo_session_xml} ../kwalletfreedesktopsession.h KWalletFreedesktopSession + kwalletfreedesktopsessionadaptor KWalletFreedesktopSessionAdaptor) +qt_add_dbus_adaptor( TEST_SRC ${fdo_collection_xml} ../kwalletfreedesktopcollection.h KWalletFreedesktopCollection + kwalletfreedesktopcollectionadaptor KWalletFreedesktopCollectionAdaptor) +qt_add_dbus_adaptor( TEST_SRC ${fdo_item_xml} ../kwalletfreedesktopitem.h KWalletFreedesktopItem + kwalletfreedesktopitemadaptor KWalletFreedesktopItemAdaptor) +qt_add_dbus_adaptor( TEST_SRC ${fdo_prompt_xml} ../kwalletfreedesktopprompt.h KWalletFreedesktopPrompt + kwalletfreedesktoppromptadaptor KWalletFreedesktopPromptAdaptor) + +ecm_add_test( + ${TEST_SRC} + ../kwalletfreedesktopservice.h + ../kwalletfreedesktopcollection.h + ../kwalletfreedesktopitem.h + ../kwalletfreedesktopsession.h + ../kwalletfreedesktopprompt.h + ../ksecretd.h + ../ktimeout.h + kwalletfreedesktopserviceadaptor.cpp + kwalletfreedesktopcollectionadaptor.cpp + kwalletfreedesktopitemadaptor.cpp + kwalletfreedesktopsessionadaptor.cpp + kwalletfreedesktoppromptadaptor.cpp + TEST_NAME fdo_secrets_test + LINK_LIBRARIES + KF6Wallet + KF6WalletBackend + Qt6::Widgets + Qt6::Test + KF6::DBusAddons + KF6::ConfigCore + ${Qca_LIBRARY} +) diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/autotests/fdo_secrets_test.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/autotests/fdo_secrets_test.cpp new file mode 100644 index 0000000000..7dbfa5b1d4 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/autotests/fdo_secrets_test.cpp @@ -0,0 +1,632 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2021 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#include "fdo_secrets_test.h" +#include "../kwalletfreedesktopsession.h" +#include "mockkwalletd.cpp" +// cannot be in mockkwalletd.cpp, as CMake's automoc does not look there +#include "moc_ksecretd.cpp" +#include "moc_ktimeout.cpp" +#include "static_mock.hpp" + +#include + +void FdoSecretsTest::initTestCase() +{ + if (qEnvironmentVariableIntValue("KDECI_CANNOT_CREATE_WINDOWS")) { + QSKIP("These tests are unstable on Windows CI, skipping."); + } + + QStandardPaths::setTestModeEnabled(true); + static QCA::Initializer init{}; +} + +void FdoSecretsTest::serviceStaticFunctions() +{ + auto labels = Testset{ + {"label", {"label", -1}}, + {"label__0_", {"label", 0}}, + {"label___1_", {"label_", 1}}, + {"__0_label___200_", {"__0_label_", 200}}, + }; + + runTestset(FdoUniqueLabel::fromName, labels); + runRevTestset( + [](const FdoUniqueLabel &l) { + return l.toName(); + }, + labels); + + runTestset(KWalletFreedesktopService::wrapToCollectionPath, + Testset{ + {"/org/freedesktop/secrets/collection/abcd", "/org/freedesktop/secrets/collection/abcd"}, + {"/org/freedesktop/secrets/collection/abcd/2", "/org/freedesktop/secrets/collection/abcd"}, + {"/org/freedesktop/secrets/collection/abcd/2/2/3/4", "/org/freedesktop/secrets/collection/abcd"}, + }); + + QCOMPARE(KWalletFreedesktopService::nextPromptPath().path(), "/org/freedesktop/secrets/prompt/p0"); + QCOMPARE(KWalletFreedesktopService::nextPromptPath().path(), "/org/freedesktop/secrets/prompt/p1"); +} + +void FdoSecretsTest::collectionStaticFunctions() +{ + auto dirNameTestset = Testset{ + {{FDO_SECRETS_DEFAULT_DIR, "entry1"}, {"entry1", -1}}, + {{FDO_SECRETS_DEFAULT_DIR, "entry__3_"}, {"entry", 3}}, + {{"Passwords", "password__"}, {"Passwords/password__", -1}}, + {{"Passwords__3_", "password__200_"}, {"Passwords__3_/password", 200}}, + {{"", "password"}, {"/password", -1}}, + {{"", "/"}, {"//", -1}}, + {{FDO_SECRETS_DEFAULT_DIR, "/"}, {"/", -1}}, + {{FDO_SECRETS_DEFAULT_DIR, "/__2_"}, {"/", 2}}, + {{"https:", "/foobar.org/"}, {"https://foobar.org/", -1}}, + {{"https:", "/foobar.org/__80_"}, {"https://foobar.org/", 80}}, + }; + + runTestset( + [](const EntryLocation &l) { + return l.toUniqueLabel(); + }, + dirNameTestset); + runRevTestset( + [](const FdoUniqueLabel &l) { + return l.toEntryLocation(); + }, + dirNameTestset); +} + +void FdoSecretsTest::cleanup() +{ + SET_FUNCTION_RESULT(KSecretD::wallets, QStringList()); +} + +void FdoSecretsTest::precreatedWallets() +{ + const QStringList wallets = {"wallet1", "wallet2", "wallet2__0_", "wallet2__1_"}; + SET_FUNCTION_RESULT(KSecretD::wallets, wallets); + SET_FUNCTION_RESULT_OVERLOADED(KSecretD::isOpen, true, bool(KSecretD::*)(int)); + + std::unique_ptr kwalletd{new KSecretD}; + std::unique_ptr service{new KWalletFreedesktopService(kwalletd.get())}; + + QCOMPARE(wallets.size(), service->collections().size()); + for (const auto &walletName : wallets) { + auto collection = service->getCollectionByWalletName(walletName); + QVERIFY(collection); + QVERIFY(collection->label() == "wallet1" || collection->label() == "wallet2"); + } + + auto firstCollection = service->getCollectionByWalletName(wallets.front()); + auto &item1 = firstCollection->pushNewItem(FdoUniqueLabel{"item1", -1}, QDBusObjectPath(firstCollection->fdoObjectPath().path() + "/0")); + QCOMPARE(item1.fdoObjectPath().path(), (firstCollection->fdoObjectPath().path() + "/0")); + QCOMPARE(&item1, service->getItemByObjectPath(item1.fdoObjectPath())); +} + +void FdoSecretsTest::aliases() +{ + std::unique_ptr kwalletd{new KSecretD}; + std::unique_ptr service{new KWalletFreedesktopService(kwalletd.get())}; + + service->createCollectionAlias("alias", "walletName"); + service->createCollectionAlias("alias2", "walletName"); + service->createCollectionAlias("alias3", "walletName300"); + service->updateCollectionAlias("alias3", "walletName"); + QSet checkAliases = {"alias", "alias2", "alias3"}; + const QStringList aliases = service->readAliasesFor("walletName"); + for (const auto &alias : aliases) + checkAliases.remove(alias); + QVERIFY(checkAliases.isEmpty()); + + service->removeAlias("alias"); + service->removeAlias("alias2"); + service->removeAlias("alias3"); + QVERIFY(service->readAliasesFor("walletName").isEmpty()); +} + +struct SetupSessionT { + QDBusObjectPath sessionPath; + QCA::SymmetricKey symmetricKey; + int commonSecretSize = 0; + QByteArray error; +}; + +#define SETUP_SESSION_VERIFY(cond) \ + do { \ + if (!(cond)) \ + return SetupSessionT{QDBusObjectPath(), QCA::SymmetricKey(), 0, #cond}; \ + } while (false) + +static QCA::SymmetricKey deriveLibsecretStyleSymmetricKey(const QCA::SecureArray &commonSecret) +{ + auto paddedSecret = commonSecret.toByteArray(); + if (paddedSecret.size() < FDO_DH_PUBLIC_KEY_SIZE) { + paddedSecret.prepend(FDO_DH_PUBLIC_KEY_SIZE - paddedSecret.size(), '\0'); + } + + return QCA::HKDF().makeKey(QCA::SecureArray(paddedSecret), {}, {}, FDO_SECRETS_CIPHER_KEY_SIZE); +} + +SetupSessionT setupSession(KWalletFreedesktopService *service, bool requireShortDhSecret = false, bool requireMsbSetClientPublicKey = false) +{ + QCA::KeyGenerator keygen; + auto dlGroup = QCA::DLGroup(keygen.createDLGroup(QCA::IETF_1024)); + if (dlGroup.isNull()) { + return SetupSessionT{QDBusObjectPath(), QCA::SymmetricKey(), 0, "createDLGroup failed, maybe libqca-ossl is missing"}; + } + + for (int attempt = 0; attempt < 4096; ++attempt) { + SetupSessionT result; + auto privateKey = QCA::PrivateKey(keygen.createDH(dlGroup)); + auto publicKey = QCA::PublicKey(privateKey); + + auto pubKeyBytes = KWalletFreedesktopSessionAlgorithmDhAes::normalizeUnsignedDhValue(publicKey.toDH().y().toArray().toByteArray()); + if (requireMsbSetClientPublicKey && (static_cast(pubKeyBytes.front()) & 0x80U) == 0) { + continue; + } + auto sessionPubKeyVariant = service->OpenSession("dh-ietf1024-sha256-aes128-cbc-pkcs7", QDBusVariant(pubKeyBytes), result.sessionPath); + SETUP_SESSION_VERIFY(result.sessionPath.path() != "/"); + SETUP_SESSION_VERIFY(sessionPubKeyVariant.variant().canConvert()); + + auto servicePublicKeyBytes = sessionPubKeyVariant.variant().toByteArray(); + SETUP_SESSION_VERIFY(!servicePublicKeyBytes.isEmpty()); + + auto servicePublicKey = QCA::DHPublicKey(dlGroup, KWalletFreedesktopSessionAlgorithmDhAes::decodeUnsignedDhValue(servicePublicKeyBytes)); + auto commonSecret = privateKey.deriveKey(servicePublicKey); + result.commonSecretSize = commonSecret.size(); + if (requireShortDhSecret && result.commonSecretSize >= FDO_DH_PUBLIC_KEY_SIZE) { + continue; + } + + result.symmetricKey = deriveLibsecretStyleSymmetricKey(commonSecret); + return result; + } + + return SetupSessionT{QDBusObjectPath(), QCA::SymmetricKey(), 0, ""}; +} + +void FdoSecretsTest::sessionAlgorithmStaticFunctions() +{ + const QByteArray shortValue(127, '\x5a'); + const QByteArray fullValue(FDO_DH_PUBLIC_KEY_SIZE, '\x7f'); + const QByteArray highBitValue(FDO_DH_PUBLIC_KEY_SIZE, static_cast(0x80)); + const QByteArray signExtendedHighBitValue = QByteArray(1, '\0') + highBitValue; + + auto normalizedShort = KWalletFreedesktopSessionAlgorithmDhAes::normalizeUnsignedDhValue(shortValue); + QCOMPARE(normalizedShort.size(), FDO_DH_PUBLIC_KEY_SIZE); + QCOMPARE(normalizedShort.front(), '\0'); + QCOMPARE(normalizedShort.mid(1), shortValue); + + QCOMPARE(KWalletFreedesktopSessionAlgorithmDhAes::normalizeUnsignedDhValue(fullValue), fullValue); + QCOMPARE(KWalletFreedesktopSessionAlgorithmDhAes::normalizeUnsignedDhValue(signExtendedHighBitValue), highBitValue); + + auto decodedHighBit = KWalletFreedesktopSessionAlgorithmDhAes::decodeUnsignedDhValue(highBitValue); + QCOMPARE(KWalletFreedesktopSessionAlgorithmDhAes::normalizeUnsignedDhValue(decodedHighBit.toArray().toByteArray()), highBitValue); +} + +static QByteArray shortDhPublicKey() +{ + // clang-format off + return QByteArray::fromBase64("bt4u/O+RSvVNOTszD/ThOeSNd+Ji7OVENIyRXsY45OzdocCMKZ8hSzxSmpqzwJL57I2yZtB897bBab1ujRK5tat6IIkMdOPf4WgExoU8c54VV1ohbehKraUktN1UzrDPsDrB4hJtm2GwFULMJXoEcdpkYaJSGEGWvjzlhrZZZA=="); + // clang-format on +} + +void FdoSecretsTest::items() +{ + const QStringList wallets = {"wallet1"}; + const QStringList folders = {FDO_SECRETS_DEFAULT_DIR}; + const QStringList entries = {"item1", "item2", "item3"}; + SET_FUNCTION_RESULT(KSecretD::wallets, wallets); + SET_FUNCTION_RESULT(KSecretD::folderList, folders); + SET_FUNCTION_RESULT(KSecretD::entryList, entries); + + SET_FUNCTION_IMPL(KSecretD::entryType, [](int, const QString &, const QString &key, const QString &) -> int { + if (key == "item1") + return KWallet::Wallet::Password; + else if (key == "item2") + return KWallet::Wallet::Stream; + else if (key == "item3") + return KWallet::Wallet::Map; + + QTEST_ASSERT(false); + return KWallet::Wallet::Unknown; + }); + + QString _secretHolder1 = "It's a password"; + QByteArray _secretHolder2; + QByteArray _secretHolder3; + + { + QByteArray a = "It's a"; + QString b = "stream"; + + QDataStream ds{&_secretHolder2, QIODevice::WriteOnly}; + ds << a << b; + } + + { + StrStrMap map; + map["it's a"] = "map"; + + QDataStream ds{&_secretHolder3, QIODevice::WriteOnly}; + ds << map; + } + + SET_FUNCTION_IMPL(KSecretD::readPassword, [&](int, const QString &, const QString &key, const QString &) -> QString { + QTEST_ASSERT(key == "item1"); + return _secretHolder1; + }); + + SET_FUNCTION_IMPL(KSecretD::readEntry, [&](int, const QString &, const QString &key, const QString &) -> QByteArray { + QTEST_ASSERT(key == "item2"); + return _secretHolder2; + }); + + SET_FUNCTION_IMPL(KSecretD::readMap, [&](int, const QString &, const QString &key, const QString &) -> QByteArray { + QTEST_ASSERT(key == "item3"); + return _secretHolder3; + + QJsonObject obj = QJsonDocument::fromJson(_secretHolder3).object(); + + QMap map; + for (auto it = obj.constBegin(); it != obj.constEnd(); it++) { + map[it.key()] = it.value().toString(); + } + + QByteArray data; + QDataStream ds(&data, QIODevice::WriteOnly); + ds << map; + + return data; + }); + + SET_FUNCTION_IMPL(KSecretD::writePassword, [&](int, const QString &, const QString &key, const QString &value, const QString &) -> int { + QTEST_ASSERT(key == "item1"); + _secretHolder1 = value; + return 0; + }); + + using writeEntryT = int (KSecretD::*)(int, const QString &, const QString &, const QByteArray &, int, const QString &); + SET_FUNCTION_IMPL_OVERLOADED(KSecretD::writeEntry, + writeEntryT, + [&](int, const QString &, const QString &key, const QByteArray &value, int, const QString &) -> int { + QTEST_ASSERT(key == "item3" || key == "item2"); + if (key == "item2") + _secretHolder2 = value; + else + _secretHolder3 = value; + return 0; + }); + + std::unique_ptr kwalletd{new KSecretD}; + std::unique_ptr service{new KWalletFreedesktopService(kwalletd.get())}; + + auto collection = service->getCollectionByWalletName("wallet1"); + QVERIFY(collection); + + /* Write some attributes */ + { + collection->itemAttributes().newItem({FDO_SECRETS_DEFAULT_DIR, "item1"}); + collection->itemAttributes().newItem({FDO_SECRETS_DEFAULT_DIR, "item2"}); + + const EntryLocation entryLoc = {FDO_SECRETS_DEFAULT_DIR, "item3"}; + collection->itemAttributes().newItem(entryLoc); + collection->itemAttributes().setParam(entryLoc, FDO_KEY_CREATED, 100200300ULL); + collection->itemAttributes().setParam(entryLoc, FDO_KEY_MODIFIED, 100200301ULL); + auto attribs = collection->itemAttributes().getAttributes(entryLoc); + attribs["Attrib1"] = "value1"; + attribs["Attrib2"] = "value2"; + collection->itemAttributes().setAttributes(entryLoc, attribs); + auto &newItem = collection->pushNewItem(entryLoc.toUniqueLabel(), collection->nextItemPath()); + newItem.setAttributes(attribs); + } + + /* Create collection */ + using OpenAsyncT = int (KSecretD::*)(const QString &, qlonglong, const QString &, bool, const QDBusConnection &, const QDBusMessage &); + bool openAsyncCalled = false; + SET_FUNCTION_IMPL_OVERLOADED(KSecretD::openAsync, + OpenAsyncT, + [&](const QString &, qlonglong, const QString &, bool, const QDBusConnection &, const QDBusMessage &) -> int { + openAsyncCalled = true; + return 0; + }); + + QDBusObjectPath promptPath; + service->Unlock({collection->fdoObjectPath()}, promptPath); + auto prompt = service->getPromptByObjectPath(promptPath); + QVERIFY(prompt); + prompt->Prompt("wndid"); + Q_EMIT kwalletd->walletAsyncOpened(0, 0); + SET_FUNCTION_RESULT_OVERLOADED(KSecretD::isOpen, true, bool(KSecretD::*)(int)); + QVERIFY(!collection->locked()); + + auto item1 = collection->findItemByEntryLocation({FDO_SECRETS_DEFAULT_DIR, "item1"}); + auto item2 = collection->findItemByEntryLocation({FDO_SECRETS_DEFAULT_DIR, "item2"}); + auto item3 = collection->findItemByEntryLocation({FDO_SECRETS_DEFAULT_DIR, "item3"}); + QVERIFY(item1 && item2 && item3); + + auto message = QDBusMessage::createSignal("dummy", "dummy", "dummy"); + auto [sessionPath, symmetricKey, commonSecretSize, errorStr] = setupSession(service.get()); + QVERIFY2(errorStr.isEmpty(), errorStr.constData()); + Q_UNUSED(commonSecretSize); + + /* Check secrets */ + auto secret1 = item1->GetSecret(sessionPath); + service->desecret(message, secret1); + QCOMPARE(secret1.value.toByteArray(), "It's a password"); + // QCOMPARE(secret1.mimeType, "text/plain"); + + auto secret2 = item2->GetSecret(sessionPath); + service->desecret(message, secret2); + QByteArray secretBytes = secret2.value.toByteArray(); + QDataStream ds{secretBytes}; + QByteArray a; + QString b; + ds >> a >> b; + + QCOMPARE(secret2.mimeType, "application/octet-stream"); + QCOMPARE(a, "It's a"); + QCOMPARE(b, "stream"); + + auto secret3 = item3->GetSecret(sessionPath); + service->desecret(message, secret3); + auto bytes3 = secret3.value.toByteArray(); + + QJsonObject obj = QJsonDocument::fromJson(bytes3).object(); + StrStrMap map3; + for (auto it = obj.constBegin(); it != obj.constEnd(); it++) { + map3[it.key()] = it.value().toString(); + } + + QVERIFY(map3.find("it's a") != map3.end() && map3["it's a"] == "map"); + QCOMPARE(item3->created(), 100200300); + QCOMPARE(item3->modified(), 100200301); + QCOMPARE(item3->attributes()["Attrib1"], "value1"); + QCOMPARE(item3->attributes()["Attrib2"], "value2"); + + /* Set new secrets */ + secret1.value = QByteArray("It's a new password"); + secret1.mimeType = "text/plain"; + service->ensecret(message, secret1); + item1->SetSecret(secret1); + secret1 = item1->GetSecret(sessionPath); + service->desecret(message, secret1); + QCOMPARE(secret1.value.toByteArray(), "It's a new password"); + QCOMPARE(secret1.mimeType, "text/plain"); + + secret2.value = QByteArray("It's a new secret"); + secret2.mimeType = "application/octet-stream"; + service->ensecret(message, secret2); + item2->SetSecret(secret2); + auto attribs = item2->attributes(); + attribs["newAttrib"] = ")))"; + item2->setAttributes(attribs); + + secret2 = item2->GetSecret(sessionPath); + service->desecret(message, secret2); + QCOMPARE(secret2.value.toByteArray(), "It's a new secret"); + QCOMPARE(item2->attributes()["newAttrib"], ")))"); + + /* Search items */ + attribs.clear(); + attribs["Attrib1"] = "value1"; + QList lockedItems; + auto unlockedItems = service->SearchItems(attribs, lockedItems); + QCOMPARE(unlockedItems.size(), 1); + QCOMPARE(unlockedItems.front(), item3->fdoObjectPath()); +} + +void FdoSecretsTest::createLockUnlockCollection() +{ + std::unique_ptr kwalletd{new KSecretD}; + std::unique_ptr service{new KWalletFreedesktopService(kwalletd.get())}; + + /* Create collection */ + using OpenAsyncT = int (KSecretD::*)(const QString &, qlonglong, const QString &, bool, const QDBusConnection &, const QDBusMessage &); + bool openAsyncCalled = false; + SET_FUNCTION_IMPL_OVERLOADED(KSecretD::openAsync, + OpenAsyncT, + [&](const QString &, qlonglong, const QString &, bool, const QDBusConnection &, const QDBusMessage &) -> int { + openAsyncCalled = true; + return 0; + }); + + QVariantMap props; + props["org.freedesktop.Secret.Collection.Label"] = QString("walletName"); + QDBusObjectPath promptPath; + service->CreateCollection(props, "", promptPath); + auto prompt = service->getPromptByObjectPath(promptPath); + QVERIFY(prompt); + prompt->Prompt("wndid"); + QVERIFY(openAsyncCalled); + Q_EMIT kwalletd->walletAsyncOpened(0, 0); + + auto createdCollection = service->getCollectionByWalletName("walletName"); + QVERIFY(createdCollection); + QCOMPARE(createdCollection->label(), "walletName"); + + /* Check aliases */ + service->createCollectionAlias("alias", "walletName"); + service->createCollectionAlias("alias2", "walletName"); + service->createCollectionAlias("alias3", "walletName"); + + QCOMPARE(service->resolveIfAlias(QStringLiteral(FDO_ALIAS_PATH) + "alias"), createdCollection->fdoObjectPath().path()); + QCOMPARE(service->resolveIfAlias(QStringLiteral(FDO_ALIAS_PATH) + "alias2"), createdCollection->fdoObjectPath().path()); + QCOMPARE(service->resolveIfAlias(QStringLiteral(FDO_ALIAS_PATH) + "alias3"), createdCollection->fdoObjectPath().path()); + QCOMPARE(service->ReadAlias("alias"), createdCollection->fdoObjectPath()); + + service->removeAlias("alias"); + service->removeAlias("alias2"); + service->removeAlias("alias3"); + + /* Lock/Unlock */ + auto lockedObjects = service->Lock({createdCollection->fdoObjectPath()}, promptPath); + QCOMPARE(lockedObjects.size(), 1); + QCOMPARE(lockedObjects.front(), createdCollection->fdoObjectPath()); + SET_FUNCTION_RESULT_OVERLOADED(KSecretD::isOpen, false, bool(KSecretD::*)(int)); + QVERIFY(createdCollection->locked()); + + service->Unlock({createdCollection->fdoObjectPath()}, promptPath); + prompt = service->getPromptByObjectPath(promptPath); + QVERIFY(prompt); + openAsyncCalled = false; + prompt->Prompt("wndid"); + QVERIFY(openAsyncCalled); + Q_EMIT kwalletd->walletAsyncOpened(0, 0); + SET_FUNCTION_RESULT_OVERLOADED(KSecretD::isOpen, true, bool(KSecretD::*)(int)); + QVERIFY(!createdCollection->locked()); +} + +void FdoSecretsTest::session() +{ + std::unique_ptr kwalletd{new KSecretD}; + std::unique_ptr service{new KWalletFreedesktopService(kwalletd.get())}; + + auto message = QDBusMessage::createSignal("dummy", "dummy", "dummy"); + auto [sessionPath, symmetricKey, commonSecretSize, errorStr] = setupSession(service.get()); + QVERIFY2(errorStr.isEmpty(), errorStr.constData()); + Q_UNUSED(commonSecretSize); + + /* Generate secret */ + auto secret = FreedesktopSecret(sessionPath, QByteArray("It's a secret"), "text/plain"); + QVERIFY(service->ensecret(message, secret)); + + /* Try to decrypt by hand with symmetricKey */ + auto cipher = QCA::Cipher("aes128", QCA::Cipher::CBC, QCA::Cipher::PKCS7, QCA::Decode, symmetricKey, secret.parameters); + QCA::SecureArray result; + result.append(cipher.update(QCA::MemoryRegion(secret.value.toByteArray()))); + result.append(cipher.final()); + + QCOMPARE(QString::fromUtf8(result.toByteArray()), "It's a secret"); + + /* Try to decrypt by session */ + QVERIFY(service->desecret(message, secret)); + QCOMPARE(secret.value.toByteArray(), QByteArray("It's a secret")); +} + +void FdoSecretsTest::sessionWithShortDhSecret() +{ + std::unique_ptr kwalletd{new KSecretD}; + std::unique_ptr service{new KWalletFreedesktopService(kwalletd.get())}; + + auto message = QDBusMessage::createSignal("dummy", "dummy", "dummy"); + auto [sessionPath, symmetricKey, commonSecretSize, errorStr] = setupSession(service.get(), true); + QVERIFY2(errorStr.isEmpty(), errorStr.constData()); + QVERIFY(commonSecretSize < FDO_DH_PUBLIC_KEY_SIZE); + + auto secret = FreedesktopSecret(sessionPath, QByteArray("It's a secret"), "text/plain"); + QVERIFY(service->ensecret(message, secret)); + + auto cipher = QCA::Cipher("aes128", QCA::Cipher::CBC, QCA::Cipher::PKCS7, QCA::Decode, symmetricKey, secret.parameters); + QCA::SecureArray result; + result.append(cipher.update(QCA::MemoryRegion(secret.value.toByteArray()))); + result.append(cipher.final()); + + QVERIFY(cipher.ok()); + QCOMPARE(QString::fromUtf8(result.toByteArray()), "It's a secret"); +} + +void FdoSecretsTest::sessionWithShortClientPublicKey() +{ + std::unique_ptr kwalletd{new KSecretD}; + std::unique_ptr service{new KWalletFreedesktopService(kwalletd.get())}; + + auto publicKeyBytes = shortDhPublicKey(); + + QDBusObjectPath sessionPath; + auto sessionPubKeyVariant = service->OpenSession("dh-ietf1024-sha256-aes128-cbc-pkcs7", QDBusVariant(publicKeyBytes), sessionPath); + QVERIFY(sessionPath.path() != "/"); + QVERIFY(sessionPubKeyVariant.variant().canConvert()); + QVERIFY(!sessionPubKeyVariant.variant().toByteArray().isEmpty()); +} + +void FdoSecretsTest::sessionWithMsbSetClientPublicKey() +{ + std::unique_ptr kwalletd{new KSecretD}; + std::unique_ptr service{new KWalletFreedesktopService(kwalletd.get())}; + + auto message = QDBusMessage::createSignal("dummy", "dummy", "dummy"); + auto [sessionPath, symmetricKey, commonSecretSize, errorStr] = setupSession(service.get(), false, true); + QVERIFY2(errorStr.isEmpty(), errorStr.constData()); + QVERIFY(commonSecretSize > 0); + + auto secret = FreedesktopSecret(sessionPath, QByteArray("It's a secret"), "text/plain"); + QVERIFY(service->ensecret(message, secret)); + + auto cipher = QCA::Cipher("aes128", QCA::Cipher::CBC, QCA::Cipher::PKCS7, QCA::Decode, symmetricKey, secret.parameters); + QCA::SecureArray result; + result.append(cipher.update(QCA::MemoryRegion(secret.value.toByteArray()))); + result.append(cipher.final()); + + QVERIFY(cipher.ok()); + QCOMPARE(QString::fromUtf8(result.toByteArray()), "It's a secret"); +} + +void FdoSecretsTest::attributes() +{ + KWalletFreedesktopAttributes attribs{"test"}; + + attribs.newItem({"dir", "name"}); + + attribs.setParam({"dir", "name"}, "param1", 0xff00ff00ff00ff00); + attribs.setParam({"dir", "name"}, "param2", "string_param"); + + QCOMPARE(attribs.getULongLongParam({"dir", "name"}, "param1", 0), 0xff00ff00ff00ff00); + QCOMPARE(attribs.getStringParam({"dir", "name"}, "param2", ""), "string_param"); + + attribs.renameLabel({"dir", "name"}, {"newdir", "newname"}); + + QCOMPARE(attribs.getULongLongParam({"newdir", "newname"}, "param1", 0), 0xff00ff00ff00ff00); + QCOMPARE(attribs.getStringParam({"newdir", "newname"}, "param2", ""), "string_param"); + QCOMPARE(attribs.getULongLongParam({"dir", "name"}, "param1", 0xdef017), 0xdef017); + QCOMPARE(attribs.getStringParam({"dir", "name"}, "param2", "default"), "default"); + + attribs.setParam({"newdir", "newname"}, "param1", 100200300ULL); + attribs.setParam({"newdir", "newname"}, "param2", "another_string_param"); + + QCOMPARE(attribs.getULongLongParam({"newdir", "newname"}, "param1", 0), 100200300ULL); + QCOMPARE(attribs.getStringParam({"newdir", "newname"}, "param2", ""), "another_string_param"); + + QVERIFY(attribs.getAttributes({"newdir", "newname"}).empty()); + + StrStrMap attribMap; + attribMap["key1"] = "value1"; + attribMap["key2"] = "value2"; + + attribs.setAttributes({"newdir", "newname"}, attribMap); + QCOMPARE(attribs.getAttributes({"newdir", "newname"}), attribMap); + + attribs.setAttributes({"dir", "name"}, attribMap); + /* Item not exists - expects empty attributes map */ + QVERIFY(attribs.getAttributes({"dir", "name"}).empty()); + + attribs.setParam({"dir1", "name1"}, "param1", "some_param"); + QCOMPARE(attribs.getStringParam({"dir1", "name1"}, "param1", "default"), "default"); +} + +void FdoSecretsTest::walletNameEncodeDecode() +{ +#define ENCODE_DECODE_CHECK(DECODED, ENCODED) \ + do { \ + auto encodedResult = KWallet::Backend::encodeWalletName(DECODED); \ + auto decodedResult = KWallet::Backend::decodeWalletName(ENCODED); \ + QCOMPARE(encodedResult, ENCODED); \ + QCOMPARE(decodedResult, DECODED); \ + } while (false) + + ENCODE_DECODE_CHECK("/", ";2F"); + QString allowedChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789^&'@{}[],$=!-#()%.+_\r\n\t\f\v "; + ENCODE_DECODE_CHECK(allowedChars, allowedChars); + ENCODE_DECODE_CHECK("a/b/c\\", "a;2Fb;2Fc;5C"); + ENCODE_DECODE_CHECK("/\\/", ";2F;5C;2F"); + ENCODE_DECODE_CHECK(";;;", ";3B;3B;3B"); + ENCODE_DECODE_CHECK(";3B", ";3B3B"); + +#undef ENCODE_DECODE_CHECK +} + +QTEST_GUILESS_MAIN(FdoSecretsTest) + +#include "moc_fdo_secrets_test.cpp" diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/autotests/fdo_secrets_test.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/autotests/fdo_secrets_test.h new file mode 100644 index 0000000000..8821bcf7fa --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/autotests/fdo_secrets_test.h @@ -0,0 +1,38 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2021 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef FDOSECRETSTEST_H +#define FDOSECRETSTEST_H + +#include "../ksecretd.h" +#include "testhelpers.hpp" + +class FdoSecretsTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void initTestCase(); + void cleanup(); + + void serviceStaticFunctions(); + void collectionStaticFunctions(); + void sessionAlgorithmStaticFunctions(); + + void precreatedWallets(); + void aliases(); + void createLockUnlockCollection(); + void items(); + void session(); + void sessionWithShortDhSecret(); + void sessionWithShortClientPublicKey(); + void sessionWithMsbSetClientPublicKey(); + void attributes(); + void walletNameEncodeDecode(); +}; + +#endif diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/autotests/mockkwalletd.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/autotests/mockkwalletd.cpp new file mode 100644 index 0000000000..ed2ebe6ff9 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/autotests/mockkwalletd.cpp @@ -0,0 +1,150 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2022 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#include "static_mock.hpp" + +#include "../ksecretd.h" +#include "../kwalletfreedesktopcollection.h" +#include "../kwalletfreedesktopitem.h" +#include "../kwalletfreedesktopprompt.h" +#include "../kwalletfreedesktopservice.h" +#include "../kwalletfreedesktopsession.h" + +KSecretD::KSecretD() + : _syncTime(0) +{ +} +KSecretD::~KSecretD() +{ +} + +KWalletSessionStore::KWalletSessionStore() +{ +} +KWalletSessionStore::~KWalletSessionStore() +{ +} + +KTimeout::KTimeout(QObject *) +{ +} +KTimeout::~KTimeout() +{ +} + +MOCK_FUNCTION(KSecretD, encodeWalletName, 1, ); +MOCK_FUNCTION(KSecretD, decodeWalletName, 1, ); + +MOCK_FUNCTION(KTimeout, clear, 0, ); +MOCK_FUNCTION(KTimeout, resetTimer, 2, ); +MOCK_FUNCTION(KTimeout, removeTimer, 1, ); +MOCK_FUNCTION(KTimeout, addTimer, 2, ); + +void KTimeout::timerEvent(QTimerEvent *) +{ +} + +MOCK_FUNCTION(KSecretD, readEntry, 4, ); +MOCK_FUNCTION(KSecretD, readMap, 4, ); +MOCK_FUNCTION(KSecretD, readPassword, 4, ); + +MOCK_FUNCTION_RES(KSecretD, removeEntry, 4, 0, ); +MOCK_FUNCTION_RES(KSecretD, writeMap, 5, 0, ); +MOCK_FUNCTION_RES(KSecretD, writePassword, 5, 0, ); + +using OVWriteEntry_6 = int (KSecretD::*)(int, const QString &, const QString &, const QByteArray &, int, const QString &); +MOCK_FUNCTION_OVERLOADED_RES(KSecretD, writeEntry, 6, 0, OVWriteEntry_6); + +using OVWriteEntry_5 = int (KSecretD::*)(int, const QString &, const QString &, const QByteArray &, const QString &); +MOCK_FUNCTION_OVERLOADED_RES(KSecretD, writeEntry, 5, 0, OVWriteEntry_5); + +MOCK_FUNCTION(KSecretD, entryType, 4, ); +MOCK_FUNCTION_RES(KSecretD, renameEntry, 5, 0, ); + +MOCK_FUNCTION_RES(KSecretD, isEnabled, 0, 1); +MOCK_FUNCTION(KSecretD, open, 3, ); +MOCK_FUNCTION(KSecretD, openPath, 3, ); +MOCK_FUNCTION(KSecretD, openPathAsync, 4, ); + +using OVOpenAsync4 = int (KSecretD::*)(const QString &, qlonglong, const QString &, bool); +MOCK_FUNCTION_OVERLOADED(KSecretD, openAsync, 4, OVOpenAsync4); + +using OVOpenAsync6 = int (KSecretD::*)(const QString &, qlonglong, const QString &, bool, const QDBusConnection &, const QDBusMessage &); +MOCK_FUNCTION_OVERLOADED(KSecretD, openAsync, 6, OVOpenAsync6); + +using OVClose4 = int (KSecretD::*)(int, bool, const QString &, const QDBusMessage &); +MOCK_FUNCTION_OVERLOADED(KSecretD, close, 4, OVClose4); + +using OVClose2 = int (KSecretD::*)(const QString &, bool); +MOCK_FUNCTION_OVERLOADED(KSecretD, close, 2, OVClose2); + +using OVClose3 = int (KSecretD::*)(int, bool, const QString &); +MOCK_FUNCTION_OVERLOADED(KSecretD, close, 3, OVClose3); + +MOCK_FUNCTION(KSecretD, deleteWallet, 1, ); + +MOCK_FUNCTION_OVERLOADED(KSecretD, isOpen, 1, bool (KSecretD::*)(const QString &)); +MOCK_FUNCTION_OVERLOADED(KSecretD, isOpen, 1, bool (KSecretD::*)(int)); + +MOCK_FUNCTION(KSecretD, users, 1, const); +MOCK_FUNCTION(KSecretD, wallets, 0, const); +MOCK_FUNCTION(KSecretD, folderList, 2, ); +MOCK_FUNCTION(KSecretD, hasFolder, 3, ); +MOCK_FUNCTION(KSecretD, createFolder, 3, ); +MOCK_FUNCTION(KSecretD, removeFolder, 3, ); +MOCK_FUNCTION(KSecretD, entryList, 3, ); + +#if KWALLET_BUILD_DEPRECATED_SINCE(5, 72) +MOCK_FUNCTION(KSecretD, readEntryList, 4, ); +MOCK_FUNCTION(KSecretD, readMapList, 4, ); +MOCK_FUNCTION(KSecretD, readPasswordList, 4, ); +#endif + +MOCK_FUNCTION(KSecretD, entriesList, 3, ); +MOCK_FUNCTION(KSecretD, mapList, 3, ); +MOCK_FUNCTION(KSecretD, passwordList, 3, ); +MOCK_FUNCTION(KSecretD, renameWallet, 2, ); +MOCK_FUNCTION(KSecretD, hasEntry, 4, ); +MOCK_FUNCTION(KSecretD, disconnectApplication, 2, ); +MOCK_FUNCTION(KSecretD, folderDoesNotExist, 2, ); +MOCK_FUNCTION(KSecretD, keyDoesNotExist, 3, ); +MOCK_FUNCTION(KSecretD, networkWallet, 0, ); +MOCK_FUNCTION(KSecretD, localWallet, 0, ); +MOCK_FUNCTION(KSecretD, pamOpen, 3, ); +MOCK_FUNCTION(KSecretD, sync, 2, ); +MOCK_FUNCTION(KSecretD, changePassword, 3, ); +MOCK_FUNCTION(KSecretD, reconfigure, 0, ); +MOCK_FUNCTION(KSecretD, closeAllWallets, 0, ); +MOCK_FUNCTION(KSecretD, screenSaverChanged, 1, ); + +void KSecretD::slotServiceOwnerChanged(const QString &, const QString &, const QString &) +{ +} +void KSecretD::emitWalletListDirty() +{ +} +void KSecretD::timedOutClose(int) +{ +} +void KSecretD::timedOutSync(int) +{ +} +void KSecretD::notifyFailures() +{ +} +void KSecretD::processTransactions() +{ +} +void KSecretD::activatePasswordDialog() +{ +} + +#include +const QLoggingCategory &KSECRETD_LOG() +{ + static const QLoggingCategory category("kf.wallet.ksecretd", QtFatalMsg); + return category; +} diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/autotests/static_mock.hpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/autotests/static_mock.hpp new file mode 100644 index 0000000000..2b7e62747e --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/autotests/static_mock.hpp @@ -0,0 +1,312 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2021 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef __STATIC_MOCK__H__ +#define __STATIC_MOCK__H__ + +#include +#include +#include +#include + +/* + * Details + */ + +#define COMPTIME_HASH(x) details::fnv1a64_hash(x) + +namespace details +{ +template +constexpr uint64_t fnv1a64_hash(const char *str) +{ + return (fnv1a64_hash(str) ^ static_cast(str[I])) * 0x100000001b3; +} + +template<> +constexpr uint64_t fnv1a64_hash(const char *) +{ + return 0xcbf29ce484222325; +} + +template +struct ElementType_ { + using type = typename std::tuple_element>::type; +}; + +template +struct ElementType_ { + using type = std::nullptr_t; +}; + +template +struct ElementType : details::ElementType_<(N < sizeof...(ArgsT)), N, ArgsT...> { +}; + +template +struct FunctionTraitsImpl { + using ReturnType = ReturnT; + + template + using ArgT = typename ElementType::type; + + static constexpr size_t arity = sizeof...(ArgsT); +}; + +template +struct FunctionTraits { +}; + +template +struct FunctionTraits : FunctionTraitsImpl { +}; + +template +struct FunctionTraits : FunctionTraitsImpl { +}; + +template +struct FunctionTraits : FunctionTraitsImpl { +}; + +template +static T &returnStaticStorage() +{ + static T value; + return value; +} + +template +struct ReturnStaticStorageHelper { + using TT = typename std::decay::type; + + static T get() + { + return returnStaticStorage(); + } + template + static void setValue(V &&v) + { + returnStaticStorage() = std::forward(v); + } +}; + +template +struct ReturnStaticStorageHelper { + static void get() + { + } + template + static void setValue(V) + { + } +}; + +template +struct DefaultCtorOrNullForVoid { + using TT = typename std::decay::type; + static TT get() + { + return TT(); + } +}; + +template<> +struct DefaultCtorOrNullForVoid { + static std::nullptr_t get() + { + return nullptr; + } +}; + +template +struct FuncImplHelper { + using RetT = typename FunctionTraits::ReturnType; + + static typename FunctionTraits::ReturnType call(ArgsT... args) + { + if (func()) + return func()(args...); + else + return ReturnStaticStorageHelper::ReturnType>::get(); + } + + static std::function &func() + { + static std::function holder; + return holder; + } +}; + +template +struct FuncImpl : std::conditional<(I < FunctionTraits::arity), + FuncImpl::template ArgT>, + FuncImplHelper>::type { +}; + +} // namespace details + +#define MM_MEMBER_TRAITS(NAME) details::FunctionTraits + +#define MM_MEMBER_ARG_0(NAME) +#define MM_MEMBER_ARG_1(NAME) typename details::FunctionTraits::ArgT<0> _0 +#define MM_MEMBER_ARG_2(NAME) MM_MEMBER_ARG_1(NAME), typename details::FunctionTraits::ArgT<1> _1 +#define MM_MEMBER_ARG_3(NAME) MM_MEMBER_ARG_2(NAME), typename details::FunctionTraits::ArgT<2> _2 +#define MM_MEMBER_ARG_4(NAME) MM_MEMBER_ARG_3(NAME), typename details::FunctionTraits::ArgT<3> _3 +#define MM_MEMBER_ARG_5(NAME) MM_MEMBER_ARG_4(NAME), typename details::FunctionTraits::ArgT<4> _4 +#define MM_MEMBER_ARG_6(NAME) MM_MEMBER_ARG_5(NAME), typename details::FunctionTraits::ArgT<5> _5 +#define MM_MEMBER_ARG_7(NAME) MM_MEMBER_ARG_6(NAME), typename details::FunctionTraits::ArgT<6> _6 + +#define MM_MEMBER_ARGNAME_0(NAME) +#define MM_MEMBER_ARGNAME_1(NAME) _0 +#define MM_MEMBER_ARGNAME_2(NAME) MM_MEMBER_ARGNAME_1(NAME), _1 +#define MM_MEMBER_ARGNAME_3(NAME) MM_MEMBER_ARGNAME_2(NAME), _2 +#define MM_MEMBER_ARGNAME_4(NAME) MM_MEMBER_ARGNAME_3(NAME), _3 +#define MM_MEMBER_ARGNAME_5(NAME) MM_MEMBER_ARGNAME_4(NAME), _4 +#define MM_MEMBER_ARGNAME_6(NAME) MM_MEMBER_ARGNAME_5(NAME), _5 +#define MM_MEMBER_ARGNAME_7(NAME) MM_MEMBER_ARGNAME_6(NAME), _6 + +#define MM_LINE_NAME(prefix) MM_JOIN_NAME(prefix, __LINE__) +#define MM_JOIN_NAME(NAME, LINE) MM_JOIN_NAME_1(NAME, LINE) +#define MM_JOIN_NAME_1(NAME, LINE) NAME##LINE + +#define MOCK_FUNCTION_RES_RAW_TYPE(CLASS, NAME, TYPE, ARGS_COUNT, INIT_VALUE, ...) \ + details::FunctionTraits::ReturnType CLASS::NAME(MM_MEMBER_ARG_##ARGS_COUNT(TYPE)) __VA_ARGS__ \ + { \ + return details::FuncImpl::call(MM_MEMBER_ARGNAME_##ARGS_COUNT(TYPE)); \ + } \ + static int MM_LINE_NAME(_init_res_##CLASS##NAME##ARGS_COUNT) = []() { \ + details::ReturnStaticStorageHelper::ReturnType>::setValue(INIT_VALUE); \ + return 0; \ + }() + +/* + * Interface + */ + +/* + * Defines implementation for the function with specified return value + * + * CLASS - the class name + * NAME - the function name + * ARGS_COUNT - the count of function arguments + * INIT_VALUE - the new result of the function + * ... - the optional const qualifier (must be empty if member function is non-const) + */ +#define MOCK_FUNCTION_RES(CLASS, NAME, ARGS_COUNT, INIT_VALUE, ...) \ + MOCK_FUNCTION_RES_RAW_TYPE(CLASS, NAME, decltype(&CLASS::NAME), ARGS_COUNT, INIT_VALUE, __VA_ARGS__) + +/* + * Defines implementation for the function with default-constructed return value + * + * CLASS - the class name + * NAME - the function name + * ARGS_COUNT - the count of function arguments + * ... - the optional const qualifier (must be empty if member function is non-const) + */ +#define MOCK_FUNCTION(CLASS, NAME, ARGS_COUNT, ...) \ + MOCK_FUNCTION_RES(CLASS, \ + NAME, \ + ARGS_COUNT, \ + details::DefaultCtorOrNullForVoid::ReturnType>::get(), \ + __VA_ARGS__) + +/* + * Defines implementation for the overloaded function with specified return value + * + * CLASS - the class name + * NAME - the function name + * ARGS_COUNT - the count of function arguments + * INIT_VALUE - the new result of the function + * ... - the signature of the overloaded function + */ +#define MOCK_FUNCTION_OVERLOADED_RES(CLASS, NAME, ARGS_COUNT, INIT_VALUE, ...) \ + MOCK_FUNCTION_RES_RAW_TYPE(CLASS, NAME, decltype((__VA_ARGS__) & CLASS::NAME), ARGS_COUNT, INIT_VALUE, ) + +/* + * Defines implementation for the overloaded const member function with specified return value + * + * CLASS - the class name + * NAME - the function name + * ARGS_COUNT - the count of function arguments + * INIT_VALUE - the new result of the function + * ... - the signature of the overloaded function + */ +#define MOCK_FUNCTION_OVERLOADED_RES_CONST(CLASS, NAME, ARGS_COUNT, INIT_VALUE, ...) \ + MOCK_FUNCTION_RES_RAW_TYPE(CLASS, NAME, decltype((__VA_ARGS__) & CLASS::NAME), ARGS_COUNT, INIT_VALUE, const) + +/* + * Defines implementation for the overloaded function with default-constructed return value + * + * CLASS - the class name + * NAME - the function name + * ARGS_COUNT - the count of function arguments + * ... - the signature of the overloaded function + */ +#define MOCK_FUNCTION_OVERLOADED(CLASS, NAME, ARGS_COUNT, ...) \ + MOCK_FUNCTION_OVERLOADED_RES(CLASS, \ + NAME, \ + ARGS_COUNT, \ + details::DefaultCtorOrNullForVoid::ReturnType>::get(), \ + __VA_ARGS__) + +/* + * Defines implementation for the overloaded const member function with default-constructed return value + * + * CLASS - the class name + * NAME - the function name + * ARGS_COUNT - the count of function arguments + * ... - the signature of the overloaded function + */ +#define MOCK_FUNCTION_OVERLOADED_CONST(CLASS, NAME, ARGS_COUNT, ...) \ + MOCK_FUNCTION_OVERLOADED_RES_CONST(CLASS, \ + NAME, \ + ARGS_COUNT, \ + details::DefaultCtorOrNullForVoid::ReturnType>::get(), \ + __VA_ARGS__) + +/* + * Sets return value for the specified function + * + * FULL_NAME - the full name of the function (e.g. SomeClass::functionName) + * ... - the value to be returned (or arguments to constructor) + */ +#define SET_FUNCTION_RESULT(FULL_NAME, ...) \ + details::ReturnStaticStorageHelper::ReturnType>::setValue( \ + __VA_ARGS__) + +/* + * Sets return value for the specified overloaded function + * + * FULL_NAME - the full name of the function (e.g. SomeClass::functionName) + * VALUE - the value to be returned + * ... - the signature of the overloaded function + */ +#define SET_FUNCTION_RESULT_OVERLOADED(FULL_NAME, VALUE, ...) \ + details::ReturnStaticStorageHelper::ReturnType>::setValue(VALUE) + +/* + * Sets implementation for the specified function + * + * FULL_NAME - the full name of the function (e.g. SomeClass::functionName) + * ... - the lambda or function for implementation + */ +#define SET_FUNCTION_IMPL(FULL_NAME, ...) details::FuncImpl::func() = __VA_ARGS__ + +/* + * Sets implementation for the specified overloaded function + * + * FULL_NAME - the full name of the function (e.g. SomeClass::functionName) + * FUNC_TYPE - the signature of the overloaded function (must be alias if it contains commas) + * ... - the lambda or function for implementation + */ +#define SET_FUNCTION_IMPL_OVERLOADED(FULL_NAME, FUNC_TYPE, ...) \ + details::FuncImpl::func() = __VA_ARGS__ + +#endif // __STATIC_MOCK__H__ diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/autotests/testhelpers.hpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/autotests/testhelpers.hpp new file mode 100644 index 0000000000..30c11a4e37 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/autotests/testhelpers.hpp @@ -0,0 +1,106 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2021 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#ifndef __TESTHELPERS_HPP__ +#define __TESTHELPERS_HPP__ + +#include <../kwalletfreedesktopservice.h> +#include +#include +#include +#include + +template +using Testset = std::vector>; + +template +struct EasyFormater { + std::string operator()(const T &v) const + { + return std::string(v.toStdString()); + } +}; + +template +struct EasyFormater::value || std::is_floating_point::value>::type> { + std::string operator()(T v) const + { + return std::to_string(v); + } +}; + +template<> +struct EasyFormater { + std::string operator()(const FdoUniqueLabel &v) const + { + return "{" + v.label.toStdString() + ", " + std::to_string(v.copyId) + "}"; + } +}; + +template<> +struct EasyFormater { + std::string operator()(const EntryLocation &v) const + { + return "{" + v.folder.toStdString() + ", " + v.key.toStdString() + "}"; + } +}; + +template +struct TestsetCmpHelper { + template + bool cmp(F &&function, const T &pair) + { + return function(pair.first) == pair.second; + } + template + std::string format(F &&function, const T &pair) + { + using RetT = decltype(function(pair.first)); + return EasyFormater()(pair.first) + " (evaluates to " + EasyFormater()(function(pair.first)) + ") not equal with " + + EasyFormater()(pair.second); + } +}; +template<> +struct TestsetCmpHelper { + template + bool cmp(F &&function, const T &pair) + { + return function(pair.second) == pair.first; + } + template + std::string format(F &&function, const T &pair) + { + using RetT = decltype(function(pair.second)); + return EasyFormater()(pair.second) + " (evaluates to " + EasyFormater()(function(pair.second)) + ") not equal with " + + EasyFormater()(pair.first); + } +}; + +template +void runTestsetTmpl(F &&function, const Testset &labelMap) +{ + for (auto &pair : labelMap) { + bool ok = TestsetCmpHelper().cmp(function, pair); + if (!ok) { + std::string str = TestsetCmpHelper().format(function, pair); + QVERIFY2(ok, str.c_str()); + } + } +} + +template +void runTestset(F &&function, const Testset &labelMap) +{ + return runTestsetTmpl(std::forward(function), labelMap); +} + +template +void runRevTestset(F &&function, const Testset &labelMap) +{ + return runTestsetTmpl(std::forward(function), labelMap); +} + +#endif // __TESTHELPERS_HPP__ diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/config-ksecretd.h.cmake b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/config-ksecretd.h.cmake new file mode 100644 index 0000000000..df024d2128 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/config-ksecretd.h.cmake @@ -0,0 +1,2 @@ +#cmakedefine01 WITH_X11 +#cmakedefine01 EXPORT_LEGACY_API diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kbetterthankdialog.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kbetterthankdialog.cpp new file mode 100644 index 0000000000..f58302656e --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kbetterthankdialog.cpp @@ -0,0 +1,69 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2004 George Staikos + + SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#include "kbetterthankdialog.h" +#include + +KBetterThanKDialog::KBetterThanKDialog(QWidget *parent) + : QDialog(parent) +{ + setupUi(this); + connect(_allowOnce, &QPushButton::clicked, this, &KBetterThanKDialog::allowOnceClicked); + connect(_allowAlways, &QPushButton::clicked, this, &KBetterThanKDialog::allowAlwaysClicked); + connect(_deny, &QPushButton::clicked, this, &KBetterThanKDialog::denyClicked); + connect(_denyForever, &QPushButton::clicked, this, &KBetterThanKDialog::denyForeverClicked); + + init(); +} + +void KBetterThanKDialog::init() +{ + _allowOnce->setIcon(QIcon::fromTheme(QStringLiteral("dialog-ok"))); + _allowAlways->setIcon(QIcon::fromTheme(QStringLiteral("dialog-ok"))); + _deny->setIcon(QIcon::fromTheme(QStringLiteral("dialog-cancel"))); + _denyForever->setIcon(QIcon::fromTheme(QStringLiteral("dialog-cancel"))); + + _allowOnce->setFocus(); +} + +void KBetterThanKDialog::setLabel(const QString &label) +{ + _label->setText(label); +} + +void KBetterThanKDialog::accept() +{ + setResult(0); +} + +void KBetterThanKDialog::reject() +{ + QDialog::reject(); + setResult(2); +} + +void KBetterThanKDialog::allowOnceClicked() +{ + done(0); +} + +void KBetterThanKDialog::allowAlwaysClicked() +{ + done(1); +} + +void KBetterThanKDialog::denyClicked() +{ + done(2); +} + +void KBetterThanKDialog::denyForeverClicked() +{ + done(3); +} + +#include "moc_kbetterthankdialog.cpp" diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kbetterthankdialog.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kbetterthankdialog.h new file mode 100644 index 0000000000..b99e748b69 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kbetterthankdialog.h @@ -0,0 +1,36 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2004 George Staikos + + SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#ifndef KBETTERTHANKDIALOG_H +#define KBETTERTHANKDIALOG_H + +#include + +#include "ui_kbetterthankdialogbase.h" + +class KBetterThanKDialog : public QDialog, private Ui_KBetterThanKDialogBase +{ + Q_OBJECT + +public: + explicit KBetterThanKDialog(QWidget *parent = nullptr); + + void init(); + void setLabel(const QString &label); + +protected Q_SLOTS: + void accept() override; + void reject() override; + +private Q_SLOTS: + void allowOnceClicked(); + void allowAlwaysClicked(); + void denyClicked(); + void denyForeverClicked(); +}; + +#endif diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kbetterthankdialogbase.ui b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kbetterthankdialogbase.ui new file mode 100644 index 0000000000..a0a19e562e --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kbetterthankdialogbase.ui @@ -0,0 +1,100 @@ + + + KBetterThanKDialogBase + + + + 0 + 0 + 479 + 109 + + + + + 11 + + + 6 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 41 + 21 + + + + + + + + 6 + + + 0 + + + + + Allow &Once + + + true + + + + + + + Allow &Always + + + + + + + &Deny + + + + + + + Deny &Forever + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 61 + 21 + + + + + + + + + diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/knewwalletdialog.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/knewwalletdialog.cpp new file mode 100644 index 0000000000..b6dbd2aab1 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/knewwalletdialog.cpp @@ -0,0 +1,185 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2013 Valentin Rusu + + SPDX-License-Identifier: LGPL-2.0-only +*/ + +#include "knewwalletdialog.h" +#include "ksecretd_debug.h" +#include +#include +#include +#include +#include +#include +#include + +Q_DECLARE_METATYPE(GpgME::Key) + +namespace KWallet +{ +KNewWalletDialog::KNewWalletDialog(const QString &appName, const QString &walletName, QWidget *parent) + : QWizard(parent) +{ + setOption(HaveFinishButtonOnEarlyPages); + _intro = new KNewWalletDialogIntro(appName, walletName, this); + _introId = addPage(_intro); + + _gpg = new KNewWalletDialogGpg(this); + _gpgId = addPage(_gpg); +} + +bool KNewWalletDialog::isBlowfish() const +{ + return _intro->isBlowfish(); +} + +GpgME::Key KNewWalletDialog::gpgKey() const +{ + QVariant varKey = field(QStringLiteral("key")); + return varKey.value(); +} + +KNewWalletDialogIntro::KNewWalletDialogIntro(const QString &appName, const QString &walletName, QWidget *parent) + : QWizardPage(parent) +{ + _ui.setupUi(this); + if (appName.isEmpty()) { + _ui.labelIntro->setText( + i18n("KDE has requested to create a new wallet named '%1'. This is used to store sensitive data in a secure fashion. Please choose the " + "new wallet's type below or click cancel to deny the application's request.", + walletName.toHtmlEscaped())); + } else { + _ui.labelIntro->setText( + i18n("The application '%1' has requested to create a new wallet named '%2'. This is used to store sensitive data in a secure " + "fashion. Please choose the new wallet's type below or click cancel to deny the application's request.", + appName.toHtmlEscaped(), + walletName.toHtmlEscaped())); + } +} + +void KNewWalletDialogIntro::onBlowfishToggled(bool blowfish) +{ + setFinalPage(blowfish); +} + +bool KNewWalletDialogIntro::isBlowfish() const +{ + return _ui.radioBlowfish->isChecked(); +} + +int KNewWalletDialogIntro::nextId() const +{ + if (isBlowfish()) { + return -1; + } else { + return qobject_cast(wizard())->gpgId(); + } +} + +KNewWalletDialogGpg::KNewWalletDialogGpg(QWidget *parent) + : QWizardPage(parent) +{ + _ui.setupUi(this); +} + +struct AddKeyToList { + QTableWidget *_list; + int _row; + AddKeyToList(QTableWidget *list) + : _list(list) + , _row(0) + { + } + void operator()(const GpgME::Key &k) + { + GpgME::UserID uid = k.userID(0); + QString name(uid.name()); + if (uid.comment()) { + name = QStringLiteral("%1 (%2)").arg(name, uid.comment()); + } + _list->setItem(_row, 0, new QTableWidgetItem(name)); + _list->setItem(_row, 1, new QTableWidgetItem(uid.email())); + _list->setItem(_row, 2, new QTableWidgetItem(k.shortKeyID())); + QVariant varKey; + varKey.setValue(k); + _list->item(_row, 0)->setData(Qt::UserRole, varKey); + ++_row; + } +}; + +void KNewWalletDialogGpg::initializePage() +{ + if (_alreadyInitialized) { + return; + } + + registerField(QStringLiteral("key"), this); + + GpgME::initializeLibrary(); + GpgME::Error err = GpgME::checkEngine(GpgME::OpenPGP); + if (err) { + qCDebug(KSECRETD_LOG) << "OpenPGP not supported on your system!"; + KMessageBox::error(this, + i18n("The GpgME library failed to initialize for the OpenPGP protocol. Please check your system's configuration then try again.")); + Q_EMIT completeChanged(); + return; + } + std::shared_ptr _ctx(GpgME::Context::createForProtocol(GpgME::OpenPGP)); + if (!_ctx) { + KMessageBox::error(this, + i18n("The GpgME library failed to initialize for the OpenPGP protocol. Please check your system's configuration then try again.")); + Q_EMIT completeChanged(); + return; + } + _ctx->setKeyListMode(GpgME::Local); + + std::vector keys; + err = _ctx->startKeyListing(); + while (!err) { + GpgME::Key k = _ctx->nextKey(err); + if (err) { + break; + } + if (!k.isInvalid() && k.canEncrypt() && (k.ownerTrust() == GpgME::Key::Ultimate)) { + keys.push_back(k); + } + } + _ctx->endKeyListing(); + + if (keys.size() == 0) { + KMessageBox::error(this, + i18n("Seems that your system has no keys suitable for encryption. Please set-up at least one encryption key, then try again.")); + Q_EMIT completeChanged(); + return; + } + + _ui.listCertificates->setRowCount(keys.size()); + std::for_each(keys.begin(), keys.end(), AddKeyToList(_ui.listCertificates)); + _ui.listCertificates->resizeColumnsToContents(); + _ui.listCertificates->setCurrentCell(0, 0); + + _alreadyInitialized = true; +} + +void KNewWalletDialogGpg::onItemSelectionChanged() +{ + _complete = _ui.listCertificates->currentRow() >= 0; + QVariant varKey = _ui.listCertificates->item(_ui.listCertificates->currentRow(), 0)->data(Qt::UserRole); + setField(QStringLiteral("key"), varKey); + Q_EMIT completeChanged(); +} + +bool KNewWalletDialogGpg::isComplete() const +{ + return _complete; +} + +bool KNewWalletDialogGpg::validateCurrentPage() +{ + return false; +} + +} // namespace +#include "moc_knewwalletdialog.cpp" diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/knewwalletdialog.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/knewwalletdialog.h new file mode 100644 index 0000000000..19fd58e96c --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/knewwalletdialog.h @@ -0,0 +1,79 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2013 Valentin Rusu + + SPDX-License-Identifier: LGPL-2.0-only +*/ + +#ifndef KNEWWALLETDIALOG_H +#define KNEWWALLETDIALOG_H + +#include + +#include "ui_knewwalletdialoggpg.h" +#include "ui_knewwalletdialogintro.h" + +namespace GpgME +{ +class Key; +} + +namespace KWallet +{ +class KNewWalletDialogIntro; +class KNewWalletDialogGpg; + +class KNewWalletDialog : public QWizard +{ + Q_OBJECT +public: + KNewWalletDialog(const QString &appName, const QString &walletName, QWidget *parent = nullptr); + + bool isBlowfish() const; + int gpgId() const + { + return _gpgId; + } + GpgME::Key gpgKey() const; + +private: + KNewWalletDialogIntro *_intro = nullptr; + int _introId = 0; + KNewWalletDialogGpg *_gpg = nullptr; + int _gpgId = 0; +}; + +class KNewWalletDialogIntro : public QWizardPage +{ + Q_OBJECT +public: + KNewWalletDialogIntro(const QString &appName, const QString &walletName, QWidget *parent = nullptr); + bool isBlowfish() const; + int nextId() const override; +protected Q_SLOTS: + void onBlowfishToggled(bool); + +private: + Ui_KNewWalletDialogIntro _ui; +}; + +class KNewWalletDialogGpg : public QWizardPage +{ + Q_OBJECT +public: + explicit KNewWalletDialogGpg(QWidget *parent = nullptr); + void initializePage() override; + bool isComplete() const override; + virtual bool validateCurrentPage(); +protected Q_SLOTS: + void onItemSelectionChanged(); + +private: + bool _alreadyInitialized = false; + Ui_KNewWalletDialogGpg _ui; + bool _complete = false; +}; + +} // namespace + +#endif // KNEWWALLETDIALOG_H diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/knewwalletdialoggpg.ui b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/knewwalletdialoggpg.ui new file mode 100644 index 0000000000..66f6b5685b --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/knewwalletdialoggpg.ui @@ -0,0 +1,98 @@ + + + KNewWalletDialogGpg + + + + 0 + 0 + 400 + 300 + + + + + + + Please select the signing key from the list below: + + + + + + + <html><head/><body><p><span style=" font-weight:600;">NOTE:</span> this list shows only &quot;ultimate-level&quot; trusted keys</p></body></html> + + + + + + + false + + + false + + + QAbstractItemView::SelectRows + + + false + + + 3 + + + true + + + true + + + false + + + false + + + + Name + + + + + E-Mail + + + + + Key-ID + + + + + + + + + + listCertificates + itemSelectionChanged() + KNewWalletDialogGpg + onItemSelectionChanged() + + + 48 + 89 + + + 0 + 81 + + + + + + onItemSelectionChanged() + + diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/knewwalletdialogintro.ui b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/knewwalletdialogintro.ui new file mode 100644 index 0000000000..a8e7cb3324 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/knewwalletdialogintro.ui @@ -0,0 +1,128 @@ + + + KNewWalletDialogIntro + + + + 0 + 0 + 341 + 190 + + + + + + + The KDE Wallet System + + + + + + + + 0 + 0 + + + + <html><head/><body><p>The application '<span style=" font-weight:600;">%1</span>' has requested to open the KDE wallet. This is used to store sensitive data in a secure fashion. Please choose the new wallet's type below or click cancel to deny the application's request.</p></body></html> + + + Qt::RichText + + + Qt::AlignVCenter + + + true + + + 12 + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Classic, blowfish encrypted file + + + + + + + Use GPG encryption, for better protection + + + true + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + KTitleWidget + QWidget +
ktitlewidget.h
+
+
+ + + + radioBlowfish + toggled(bool) + KNewWalletDialogIntro + onBlowfishToggled(bool) + + + 31 + 144 + + + 2 + 138 + + + + + + onBlowfishToggled(bool) + +
diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/ksecretd.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/ksecretd.cpp new file mode 100644 index 0000000000..a3e74da437 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/ksecretd.cpp @@ -0,0 +1,1923 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2002-2004 George Staikos + SPDX-FileCopyrightText: 2008 Michael Leupold + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "ksecretd.h" +#include "ksecretd_debug.h" + +#include "kbetterthankdialog.h" +#include "kwalletfreedesktopcollection.h" +#include "kwalletfreedesktopitem.h" +#include "kwalletfreedesktopprompt.h" +#include "kwalletfreedesktopservice.h" +#include "kwalletfreedesktopsession.h" +#include "kwalletportalsecrets.h" +#include "kwalletwizard.h" + +#ifdef HAVE_GPGMEPP +#include "knewwalletdialog.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#if WITH_X11 +#include +#endif + +#ifdef HAVE_GPGMEPP +#include +#endif + +#include +#include +#include +#include + +#include + +#include "kwalletadaptor.h" + +static void startManagerForKSecretD() +{ + if (!QStandardPaths::findExecutable(QStringLiteral("kstart")).isEmpty()) { + QProcess::startDetached(QStringLiteral("kstart"), {QStringLiteral("--application"), QStringLiteral("kwalletmanager5-kwalletd")}); + } else { + QProcess::startDetached(QStringLiteral("kwalletmanager5"), QStringList{QStringLiteral("--kwalletd")}); + } +} + +class KWalletTransaction +{ +public: + explicit KWalletTransaction(QDBusConnection conn) + : tId(nextTransactionId) + , res(-1) + , connection(conn) + { + nextTransactionId++; + // make sure the id is never < 0 as that's used for the + // error conditions. + if (nextTransactionId < 0) { + nextTransactionId = 0; + } + } + + static int getTransactionId() + { + return nextTransactionId; + } + + ~KWalletTransaction() + { + } + + enum Type { + Unknown, + Open, + ChangePassword, + OpenFail, + CloseCancelled, + }; + Type tType = Unknown; + QString appid; + qlonglong wId; + QString wallet; + QString service; + bool cancelled = false; // set true if the client dies before open + bool modal; + bool isPath; + int tId; // transaction id + int res; + QDBusMessage message; + QDBusConnection connection; + +private: + static int nextTransactionId; +}; + +int KWalletTransaction::nextTransactionId = 0; + +KSecretD::KSecretD() + : QObject(nullptr) + , _failed(0) + , _syncTime(5000) + , _curtrans(nullptr) + , _useGpg(false) +{ +#ifdef HAVE_GPGMEPP + _useGpg = true; +#endif + + srand(time(nullptr)); + _showingFailureNotify = false; + _closeIdle = false; + _idleTime = 0; + connect(&_closeTimers, &KTimeout::timedOut, this, &KSecretD::timedOutClose); + connect(&_syncTimers, &KTimeout::timedOut, this, &KSecretD::timedOutSync); + + KConfig kwalletrc(QStringLiteral("kwalletrc")); + KConfigGroup cfgWallet(&kwalletrc, "Wallet"); + + if (cfgWallet.readEntry("apiEnabled", true)) { + (void)new KWalletAdaptor(this); + // register legacy services + QDBusConnection::sessionBus().registerObject(QStringLiteral("/ksecretd"), this); + QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.ksecretd")); + QDBusConnection::sessionBus().interface()->registerService(QStringLiteral("org.kde.ksecretd"), QDBusConnectionInterface::QueueService); + + new KWalletPortalSecrets(this); + } + +#ifdef Q_WS_X11 + screensaver = 0; +#endif + + reconfigure(); + // KGlobal::dirs()->addResourceType("kwallet", 0, "share/apps/kwallet"); + _dw = new KDirWatch(this); + _dw->setObjectName(QStringLiteral("KWallet Directory Watcher")); + // _dw->addDir(KGlobal::dirs()->saveLocation("kwallet")); + _dw->addDir(KWallet::Backend::getSaveLocation()); + + _dw->startScan(true); + connect(_dw, &KDirWatch::dirty, this, &KSecretD::emitWalletListDirty); + connect(_dw, &KDirWatch::deleted, this, &KSecretD::emitWalletListDirty); + + _serviceWatcher.setWatchMode(QDBusServiceWatcher::WatchForOwnerChange); + connect(&_serviceWatcher, &QDBusServiceWatcher::serviceOwnerChanged, this, &KSecretD::slotServiceOwnerChanged); + + _fdoService.reset(new KWalletFreedesktopService(this)); +} + +KSecretD::~KSecretD() +{ +#ifdef Q_WS_X11 + delete screensaver; + screensaver = 0; +#endif + closeAllWallets(); + qDeleteAll(_transactions); +} + +QString KSecretD::encodeWalletName(const QString &name) +{ + return KWallet::Backend::encodeWalletName(name); +} + +QString KSecretD::decodeWalletName(const QString &mangledName) +{ + return KWallet::Backend::decodeWalletName(mangledName); +} + +#ifdef Q_WS_X11 +void KSecretD::connectToScreenSaver() +{ + screensaver = new QDBusInterface("org.freedesktop.ScreenSaver", "/ScreenSaver", "org.freedesktop.ScreenSaver"); + if (!screensaver->isValid()) { + qCDebug(KSECRETD_LOG) << "Service org.freedesktop.ScreenSaver not found. Retrying in 10 seconds..."; + // keep attempting every 10 seconds + QTimer::singleShot(10000, this, SLOT(connectToScreenSaver())); + } else { + connect(screensaver, SIGNAL(ActiveChanged(bool)), SLOT(screenSaverChanged(bool))); + qCDebug(KSECRETD_LOG) << "connected to screen saver service."; + } +} +#endif + +int KSecretD::generateHandle() +{ + int rc; + + // ASSUMPTION: RAND_MAX is fairly large. + do { + rc = rand(); + } while (_wallets.contains(rc) || rc == 0); + + return rc; +} + +QPair KSecretD::findWallet(const QString &walletName) const +{ + Wallets::const_iterator it = _wallets.constBegin(); + const Wallets::const_iterator end = _wallets.constEnd(); + for (; it != end; ++it) { + if (it.value()->walletName() == walletName) { + return qMakePair(it.key(), it.value()); + } + } + return qMakePair(-1, static_cast(nullptr)); +} + +bool KSecretD::_processing = false; + +void KSecretD::processTransactions() +{ + if (_processing) { + return; + } + + _processing = true; + + // Process remaining transactions + while (!_transactions.isEmpty()) { + _curtrans = _transactions.takeFirst(); + int res; + + assert(_curtrans->tType != KWalletTransaction::Unknown); + + switch (_curtrans->tType) { + case KWalletTransaction::Open: + res = doTransactionOpen(_curtrans->appid, _curtrans->wallet, _curtrans->isPath, _curtrans->wId, _curtrans->modal, _curtrans->service); + + // multiple requests from the same client + // should not produce multiple password + // dialogs on a failure + if (res < 0) { + QList::iterator it; + for (it = _transactions.begin(); it != _transactions.end(); ++it) { + KWalletTransaction *x = *it; + if (_curtrans->appid == x->appid && x->tType == KWalletTransaction::Open && x->wallet == _curtrans->wallet && x->wId == _curtrans->wId) { + x->tType = KWalletTransaction::OpenFail; + } + } + } else if (_curtrans->cancelled) { + // the wallet opened successfully but the application + // opening exited/crashed while the dialog was still shown. + KWalletTransaction *_xact = new KWalletTransaction(_curtrans->connection); + _xact->tType = KWalletTransaction::CloseCancelled; + _xact->appid = _curtrans->appid; + _xact->wallet = _curtrans->wallet; + _xact->service = _curtrans->service; + _transactions.append(_xact); + } + + // emit the AsyncOpened signal as a reply + _curtrans->res = res; + Q_EMIT walletAsyncOpened(_curtrans->tId, res); + break; + + case KWalletTransaction::OpenFail: + // emit the AsyncOpened signal with an invalid handle + _curtrans->res = -1; + Q_EMIT walletAsyncOpened(_curtrans->tId, -1); + break; + + case KWalletTransaction::ChangePassword: + doTransactionChangePassword(_curtrans->appid, _curtrans->wallet, _curtrans->wId); + break; + + case KWalletTransaction::CloseCancelled: + doTransactionOpenCancelled(_curtrans->appid, _curtrans->wallet, _curtrans->service); + break; + + case KWalletTransaction::Unknown: + break; + default: + break; + } + + // send delayed dbus message reply to the caller + if (_curtrans->message.type() != QDBusMessage::InvalidMessage) { + if (_curtrans->connection.isConnected()) { + QDBusMessage reply = _curtrans->message.createReply(); + reply << _curtrans->res; + _curtrans->connection.send(reply); + } + } + + delete _curtrans; + _curtrans = nullptr; + } + + _processing = false; +} + +int KSecretD::openPath(const QString &path, qlonglong wId, const QString &appid) +{ + int tId = openPathAsync(path, wId, appid, false); + if (tId < 0) { + return tId; + } + + // NOTE the real return value will be sent by the dbusmessage delayed + // reply + return 0; + // wait for the open-transaction to be processed + // KWalletOpenLoop loop(this); + // return loop.waitForAsyncOpen(tId); +} + +int KSecretD::open(const QString &wallet, qlonglong wId, const QString &appid) +{ + if (!isEnabled()) { // guard + return -1; + } + + KWalletTransaction *xact = new KWalletTransaction(connection()); + _transactions.append(xact); + + message().setDelayedReply(true); + xact->message = message(); + + xact->appid = appid; + xact->wallet = wallet; + xact->wId = wId; + xact->modal = true; // mark dialogs as modal, the app has blocking wait + xact->tType = KWalletTransaction::Open; + xact->isPath = false; + + QTimer::singleShot(0, this, SLOT(processTransactions())); + checkActiveDialog(); + // NOTE the real return value will be sent by the dbusmessage delayed + // reply + return 0; +} + +int KSecretD::nextTransactionId() const +{ + return KWalletTransaction::getTransactionId(); +} + +int KSecretD::openAsync(const QString &wallet, + qlonglong wId, + const QString &appid, + bool handleSession, + const QDBusConnection &connection, + const QDBusMessage &message) +{ + if (!isEnabled()) { // guard + return -1; + } + + KWalletTransaction *xact = new KWalletTransaction(connection); + _transactions.append(xact); + + xact->appid = appid; + xact->wallet = wallet; + xact->wId = wId; + xact->modal = true; // mark dialogs as modal, the app has blocking wait + xact->tType = KWalletTransaction::Open; + xact->isPath = false; + if (handleSession) { + qCDebug(KSECRETD_LOG) << "openAsync for " << message.service(); + _serviceWatcher.setConnection(connection); + _serviceWatcher.addWatchedService(message.service()); + xact->service = message.service(); + } + QTimer::singleShot(0, this, SLOT(processTransactions())); + checkActiveDialog(); + // opening is in progress. return the transaction number + return xact->tId; +} + +int KSecretD::openAsync(const QString &wallet, qlonglong wId, const QString &appid, bool handleSession) +{ + return openAsync(wallet, wId, appid, handleSession, connection(), message()); +} + +int KSecretD::openPathAsync(const QString &path, qlonglong wId, const QString &appid, bool handleSession) +{ + if (!isEnabled()) { // guard + return -1; + } + + KWalletTransaction *xact = new KWalletTransaction(connection()); + _transactions.append(xact); + + xact->appid = appid; + xact->wallet = path; + xact->wId = wId; + xact->modal = true; + xact->tType = KWalletTransaction::Open; + xact->isPath = true; + if (handleSession) { + qCDebug(KSECRETD_LOG) << "openPathAsync " << message().service(); + _serviceWatcher.setConnection(connection()); + _serviceWatcher.addWatchedService(message().service()); + xact->service = message().service(); + } + QTimer::singleShot(0, this, SLOT(processTransactions())); + checkActiveDialog(); + // opening is in progress. return the transaction number + return xact->tId; +} + +// Sets up a dialog that will be shown by kwallet. +void KSecretD::setupDialog(QWidget *dialog, WId wId, const QString &appid, bool modal) +{ + if (wId != 0) { + // correct, set dialog parent + dialog->setAttribute(Qt::WA_NativeWindow, true); + KWindowSystem::setMainWindow(dialog->windowHandle(), wId); + } else { + if (appid.isEmpty()) { + qWarning() << "Using kwallet without parent window!"; + } else { + qWarning() << "Application" << appid << "using kwallet without parent window!"; + } + // allow dialog activation even if it interrupts, better than trying + // hacks + // with keeping the dialog on top or on all desktops + // KF5 FIXME what should we use now instead of this: + // kapp->updateUserTimestamp(); + } + +#if WITH_X11 + if (KWindowSystem::isPlatformX11()) { + if (modal) { + KX11Extras::setState(dialog->winId(), NET::Modal); + } else { + KX11Extras::clearState(dialog->winId(), NET::Modal); + } + } +#endif + activeDialog = dialog; +} + +// If there's a dialog already open and another application tries some +// operation that'd lead to +// opening a dialog, that application will be blocked by this dialog. A proper +// solution would +// be to set the second application's window also as a parent for the active +// dialog, so that +// KWin properly handles focus changes and so on, but there's currently no +// support for multiple +// dialog parents. In the absence of this support, we use all kinds of bad +// hacks to make +// sure the user doesn't overlook the active dialog. +void KSecretD::checkActiveDialog() +{ + if (!activeDialog) { + return; + } + + // KF5 FIXME what should we use now instead of this: + // kapp->updateUserTimestamp(); + + activeDialog->show(); + +#if WITH_X11 + if (KWindowSystem::isPlatformX11()) { + WId window = activeDialog->winId(); + KX11Extras::setState(window, NET::KeepAbove); + KX11Extras::setOnAllDesktops(window, true); + KX11Extras::forceActiveWindow(window); + } +#endif +} + +int KSecretD::doTransactionOpen(const QString &appid, const QString &wallet, bool isPath, qlonglong wId, bool modal, const QString &service) +{ + if (_firstUse && !isPath) { + // if the user specifies a wallet name, the use it as the default + // wallet name + if (wallet != KWallet::Wallet::LocalWallet()) { + KConfig kwalletrc(QStringLiteral("kwalletrc")); + KConfigGroup cfg(&kwalletrc, "Wallet"); + cfg.writeEntry("Default Wallet", wallet); + } + if (wallets().contains(KWallet::Wallet::LocalWallet())) { + KConfig kwalletrc(QStringLiteral("kwalletrc")); + KConfigGroup cfg(&kwalletrc, "Wallet"); + _firstUse = false; + cfg.writeEntry("First Use", false); + } + // else { + // // First use wizard + // // TODO GPG adjust new smartcard options gathered by + // the wizard + // QPointer wiz = new KWalletWizard(0); + // wiz->setWindowTitle(i18n("KDE Wallet Service")); + // setupDialog(wiz, (WId)wId, appid, modal); + // int rc = wiz->exec(); + // if (rc == QDialog::Accepted && wiz) { + // bool useWallet = wiz->field("useWallet").toBool(); + // KConfig kwalletrc("kwalletrc"); + // KConfigGroup cfg(&kwalletrc, "Wallet"); + // cfg.writeEntry("First Use", false); + // cfg.writeEntry("Enabled", useWallet); + // cfg.writeEntry("Close When Idle", + // wiz->field("closeWhenIdle").toBool()); + // cfg.writeEntry("Use One Wallet", + // !wiz->field("networkWallet").toBool()); + // cfg.sync(); + // reconfigure(); + // + // if (!useWallet) { + // delete wiz; + // return -1; + // } + // + // // Create the wallet + // // TODO GPG select the correct wallet type upon + // cretion (GPG or blowfish based) + // KWallet::Backend *b = new + // KWallet::Backend(KWallet::Wallet::LocalWallet()); + // #ifdef HAVE_GPGMEPP + // if (wiz->field("useBlowfish").toBool()) { + // b->setCipherType(KWallet::BACKEND_CIPHER_BLOWFISH); + // #endif + // QString pass = wiz->field("pass1").toString(); + // QByteArray p(pass.toUtf8(), pass.length()); + // b->open(p); + // p.fill(0); + // #ifdef HAVE_GPGMEPP + // } else { + // assert(wiz->field("useGpg").toBool()); + // b->setCipherType(KWallet::BACKEND_CIPHER_GPG); + // b->open(wiz->gpgKey()); + // } + // #endif + // b->createFolder(KWallet::Wallet::PasswordFolder()); + // b->createFolder(KWallet::Wallet::FormDataFolder()); + // b->close(true); + // delete b; + // delete wiz; + // } else { + // delete wiz; + // return -1; + // } + // } + } + + int rc = internalOpen(appid, wallet, isPath, WId(wId), modal, service); + return rc; +} + +int KSecretD::internalOpen(const QString &appid, const QString &wallet, bool isPath, WId w, bool modal, const QString &service) +{ + bool brandNew = false; + + QString thisApp; + if (appid.isEmpty()) { + thisApp = QStringLiteral("KDE System"); + } else { + thisApp = appid; + } + + if (implicitDeny(wallet, thisApp)) { + return -1; + } + + QPair walletInfo = findWallet(wallet); + int rc = walletInfo.first; + if (rc == -1) { + if (_wallets.count() > 20) { + qCDebug(KSECRETD_LOG) << "Too many wallets open."; + return -1; + } + + KWallet::Backend *b = new KWallet::Backend(wallet, isPath); + QString password; + bool emptyPass = false; + if ((isPath && QFile::exists(wallet)) || (!isPath && KWallet::Backend::exists(wallet))) { + // this open attempt will set wallet type from the file header, + // even if password is needed + int pwless = b->open(QByteArray(), w); +#ifdef HAVE_GPGMEPP + assert(b->cipherType() != KWallet::BACKEND_CIPHER_UNKNOWN); + if (b->cipherType() == KWallet::BACKEND_CIPHER_GPG) { + // GPG based wallets do not prompt for password here. Instead, + // GPG should already have popped pinentry utility for wallet + // decryption + if (!b->isOpen()) { + // for some reason, GPG operation failed + delete b; + return -1; + } + emptyPass = true; + } else { +#endif + if (0 != pwless || !b->isOpen()) { + if (pwless == 0) { + // release, start anew + delete b; + b = new KWallet::Backend(wallet, isPath); + } + KPasswordDialog *kpd = new KPasswordDialog(); + if (appid.isEmpty()) { + kpd->setPrompt(i18n("KDE has requested to open the wallet '%1'. Please enter the password for this wallet below.", + wallet.toHtmlEscaped())); + } else { + kpd->setPrompt( + i18n("The application '%1' has requested to open the wallet '%2'. Please enter the password for this wallet " + "below.", + appid.toHtmlEscaped(), + wallet.toHtmlEscaped())); + } + brandNew = false; + // don't use KStdGuiItem::open() here which has trailing + // ellipsis! + // KF5 FIXME what should we use now instead of this: + // kpd->setButtonGuiItem(KDialog::Ok,KGuiItem( + // i18n( "&Open" ), "wallet-open")); + kpd->setWindowTitle(i18n("KDE Wallet Service")); + kpd->setIcon(QIcon::fromTheme(QStringLiteral("kwalletmanager"))); + +#if WITH_X11 + if (KWindowSystem::isPlatformX11() && w != KX11Extras::activeWindow() && w != 0L) { + // If the dialog is modal to a minimized window it + // might not be visible + // (but still blocking the calling application). + // Notify the user about + // the request to open the wallet. + KNotification *notification = + new KNotification(QStringLiteral("needsPassword"), KNotification::Persistent | KNotification::CloseWhenWindowActivated); + notification->setWindow(kpd->windowHandle()); + QString actionText; + if (appid.isEmpty()) { + notification->setText(i18n("An application has requested to open a wallet (%1).", wallet.toHtmlEscaped())); + actionText = i18nc("Text of a button for switching to the (unnamed) application requesting a password", "Switch there"); + } else { + notification->setText(i18n("%1 has requested to open a wallet (%2).", appid.toHtmlEscaped(), wallet.toHtmlEscaped())); + actionText = + i18nc("Text of a button for switching to the application requesting a password", "Switch to %1", appid.toHtmlEscaped()); + } + + KNotificationAction *action = notification->addAction(actionText); + connect(action, &KNotificationAction::activated, this, &KSecretD::activatePasswordDialog); + notification->sendEvent(); + } +#endif + + while (!b->isOpen()) { + setupDialog(kpd, w, appid, modal); + if (kpd->exec() == QDialog::Accepted) { + password = kpd->password(); + int rc = b->open(password.toUtf8()); + if (!b->isOpen()) { + const auto errorStr = KWallet::Backend::openRCToString(rc); + qCWarning(KSECRETD_LOG) << "Failed to open wallet" << wallet << errorStr; + kpd->setPrompt(i18n("Error opening the wallet '%1'. Please try again.
(Error code %2: %3)
", + wallet.toHtmlEscaped(), + rc, + errorStr)); + kpd->setPassword(QLatin1String("")); + } + } else { + break; + } + } + delete kpd; + } else { + emptyPass = true; + } +#ifdef HAVE_GPGMEPP + } +#endif + } else { + brandNew = true; +#ifdef HAVE_GPGMEPP + // prompt the user for the new wallet format here + KWallet::BackendCipherType newWalletType = KWallet::BACKEND_CIPHER_UNKNOWN; + + std::shared_ptr newWalletDlg(new KWallet::KNewWalletDialog(appid, wallet, QWidget::find(w))); + GpgME::Key gpgKey; + setupDialog(newWalletDlg.get(), (WId)w, appid, true); + if (newWalletDlg->exec() == QDialog::Accepted) { + newWalletType = newWalletDlg->isBlowfish() ? KWallet::BACKEND_CIPHER_BLOWFISH : KWallet::BACKEND_CIPHER_GPG; + gpgKey = newWalletDlg->gpgKey(); + } else { + // user cancelled the dialog box + delete b; + return -1; + } + + if (newWalletType == KWallet::BACKEND_CIPHER_GPG) { + b->setCipherType(newWalletType); + b->open(gpgKey); + } else if (newWalletType == KWallet::BACKEND_CIPHER_BLOWFISH) { +#endif // HAVE_GPGMEPP + b->setCipherType(KWallet::BACKEND_CIPHER_BLOWFISH); + KNewPasswordDialog *kpd = new KNewPasswordDialog(); + KColorScheme colorScheme(QPalette::Active, KColorScheme::View); + kpd->setBackgroundWarningColor(colorScheme.background(KColorScheme::NegativeBackground).color()); + if (wallet == KWallet::Wallet::LocalWallet() || wallet == KWallet::Wallet::NetworkWallet()) { + // Auto create these wallets. + if (appid.isEmpty()) { + kpd->setPrompt( + i18n("KDE has requested to open the wallet. This is used to store sensitive data in a " + "secure fashion. Please enter a password to use with this wallet or click cancel to " + "deny the application's request.")); + } else { + kpd->setPrompt( + i18n("The application '%1' has requested to open the KDE wallet. This is " + "used to store sensitive data in a secure fashion. Please enter a password to use " + "with this wallet or click cancel to deny the application's request.", + appid.toHtmlEscaped())); + } + } else { + if (appid.length() == 0) { + kpd->setPrompt( + i18n("KDE has requested to create a new wallet named '%1'. Please choose a " + "password for this wallet, or cancel to deny the application's request.", + wallet.toHtmlEscaped())); + } else { + kpd->setPrompt( + i18n("The application '%1' has requested to create a new wallet named '%2'. " + "Please choose a password for this wallet, or cancel to deny the application's request.", + appid.toHtmlEscaped(), + wallet.toHtmlEscaped())); + } + } + kpd->setWindowTitle(i18n("KDE Wallet Service")); + // KF5 FIXME what should we use now instead of this: + // kpd->setButtonGuiItem(KDialog::Ok,KGuiItem(i18n("C&reate"),"document-new")); + kpd->setIcon(QIcon::fromTheme(QStringLiteral("kwalletmanager"))); + while (!b->isOpen()) { + setupDialog(kpd, w, appid, modal); + if (kpd->exec() == QDialog::Accepted) { + password = kpd->password(); + int rc = b->open(password.toUtf8()); + if (!b->isOpen()) { + kpd->setPrompt(i18n("Error opening the wallet '%1'. Please try again.
(Error code %2: %3)
", + wallet.toHtmlEscaped(), + rc, + KWallet::Backend::openRCToString(rc))); + } + } else { + break; + } + } + delete kpd; +#ifdef HAVE_GPGMEPP + } +#endif + } + + if ((b->cipherType() == KWallet::BACKEND_CIPHER_BLOWFISH) && !emptyPass && (password.isNull() || !b->isOpen())) { + delete b; + return -1; + } + + if (emptyPass && !isAuthorizedApp(appid, wallet, w)) { + delete b; + return -1; + } + + _wallets.insert(rc = generateHandle(), b); + _sessions.addSession(appid, service, rc); + _syncTimers.addTimer(rc, _syncTime); + + if (brandNew) { + createFolder(rc, KWallet::Wallet::PasswordFolder(), appid); + createFolder(rc, KWallet::Wallet::FormDataFolder(), appid); + } + + b->ref(); + if (_closeIdle) { + _closeTimers.addTimer(rc, _idleTime); + } + if (brandNew) { + Q_EMIT walletCreated(wallet); + } + Q_EMIT walletOpened(wallet); + if (_wallets.count() == 1 && _launchManager) { + startManagerForKSecretD(); + } + } else { + // prematurely add a reference so that the wallet does not close while + // the + // authorization dialog is being shown. + walletInfo.second->ref(); + bool isAuthorized = _sessions.hasSession(appid, rc) || isAuthorizedApp(appid, wallet, w); + // as the wallet might have been forcefully closed, find it again to + // make sure it's + // still available (isAuthorizedApp might show a dialog). + walletInfo = findWallet(wallet); + if (!isAuthorized) { + if (walletInfo.first != -1) { + walletInfo.second->deref(); + // check if the wallet should be closed now. + internalClose(walletInfo.second, walletInfo.first, false); + } + return -1; + } else { + if (walletInfo.first != -1) { + _sessions.addSession(appid, service, rc); + } else { + // wallet was forcefully closed. + return -1; + } + } + } + + return rc; +} + +bool KSecretD::isAuthorizedApp(const QString &appid, const QString &wallet, WId w) +{ + if (!_openPrompt) { + return true; + } + + int response = 0; + + QString thisApp; + if (appid.isEmpty()) { + thisApp = QStringLiteral("KDE System"); + } else { + thisApp = appid; + } + + if (!implicitAllow(wallet, thisApp)) { + KConfigGroup cfg = KSharedConfig::openConfig(QStringLiteral("kwalletrc"))->group("Auto Allow"); + if (!cfg.isEntryImmutable(wallet)) { + KBetterThanKDialog *dialog = new KBetterThanKDialog; + dialog->setWindowTitle(i18n("KDE Wallet Service")); + if (appid.isEmpty()) { + dialog->setLabel(i18n("KDE has requested access to the open wallet '%1'.", wallet.toHtmlEscaped())); + } else { + dialog->setLabel(i18n("The application '%1' has requested access to the open wallet '%2'.", + appid.toHtmlEscaped(), + wallet.toHtmlEscaped())); + } + setupDialog(dialog, w, appid, false); + response = dialog->exec(); + delete dialog; + } + } + + if (response == 0 || response == 1) { + if (response == 1) { + KConfigGroup cfg = KSharedConfig::openConfig(QStringLiteral("kwalletrc"))->group("Auto Allow"); + QStringList apps = cfg.readEntry(wallet, QStringList()); + if (!apps.contains(thisApp)) { + if (cfg.isEntryImmutable(wallet)) { + return false; + } + apps += thisApp; + _implicitAllowMap[wallet] += thisApp; + cfg.writeEntry(wallet, apps); + cfg.sync(); + } + } + } else if (response == 3) { + KConfigGroup cfg = KSharedConfig::openConfig(QStringLiteral("kwalletrc"))->group("Auto Deny"); + QStringList apps = cfg.readEntry(wallet, QStringList()); + if (!apps.contains(thisApp)) { + apps += thisApp; + _implicitDenyMap[wallet] += thisApp; + cfg.writeEntry(wallet, apps); + cfg.sync(); + } + return false; + } else { + return false; + } + return true; +} + +int KSecretD::deleteWallet(const QString &wallet) +{ + int result = -1; + QString path = KWallet::Backend::getSaveLocation() + "/" + encodeWalletName(wallet) + ".kwl"; + QString pathSalt = KWallet::Backend::getSaveLocation() + "/" + encodeWalletName(wallet) + ".salt"; + + if (QFile::exists(path)) { + const QPair walletInfo = findWallet(wallet); + internalClose(walletInfo.second, walletInfo.first, true); + QFile::remove(path); + Q_EMIT walletDeleted(wallet); + // also delete access control entries + KConfigGroup cfgAllow = KSharedConfig::openConfig(QStringLiteral("kwalletrc"))->group("Auto Allow"); + cfgAllow.deleteEntry(wallet); + + KConfigGroup cfgDeny = KSharedConfig::openConfig(QStringLiteral("kwalletrc"))->group("Auto Deny"); + cfgDeny.deleteEntry(wallet); + + if (QFile::exists(pathSalt)) { + QFile::remove(pathSalt); + } + + result = 0; + } + + return result; +} + +void KSecretD::changePassword(const QString &wallet, qlonglong wId, const QString &appid) +{ + KWalletTransaction *xact = new KWalletTransaction(connection()); + + message().setDelayedReply(true); + xact->message = message(); + // TODO GPG this shouldn't be allowed on a GPG managed wallet; a warning + // should be displayed about this + + xact->appid = appid; + xact->wallet = wallet; + xact->wId = wId; + xact->modal = false; + xact->tType = KWalletTransaction::ChangePassword; + + _transactions.append(xact); + + QTimer::singleShot(0, this, SLOT(processTransactions())); + checkActiveDialog(); + checkActiveDialog(); +} + +void KSecretD::initiateSync(int handle) +{ + // add a timer and reset it right away + _syncTimers.addTimer(handle, _syncTime); + _syncTimers.resetTimer(handle, _syncTime); +} + +void KSecretD::doTransactionChangePassword(const QString &appid, const QString &wallet, qlonglong wId) +{ + const QPair walletInfo = findWallet(wallet); + int handle = walletInfo.first; + KWallet::Backend *w = walletInfo.second; + + bool reclose = false; + if (!w) { + handle = doTransactionOpen(appid, wallet, false, wId, false, QLatin1String("")); + if (-1 == handle) { + KMessageBox::errorWId((WId)wId, + i18n("Unable to open wallet. The wallet must be opened in order to change the password."), + i18n("KDE Wallet Service")); + return; + } + + w = _wallets.value(handle); + reclose = true; + } + + assert(w); + +#ifdef HAVE_GPGMEPP + if (w->cipherType() == KWallet::BACKEND_CIPHER_GPG) { + QString keyID = w->gpgKey().shortKeyID(); + assert(!keyID.isNull()); + KMessageBox::errorWId((WId)wId, + i18n("The %1 wallet is encrypted using GPG key %2. Please use GPG tools (such " + "as kleopatra) to change the passphrase associated to that key.", + wallet.toHtmlEscaped(), + keyID)); + } else { +#endif + QPointer kpd = new KNewPasswordDialog(); + kpd->setPrompt(i18n("Please choose a new password for the wallet '%1'.", wallet.toHtmlEscaped())); + kpd->setWindowTitle(i18n("KDE Wallet Service")); + kpd->setAllowEmptyPasswords(true); + KColorScheme colorScheme(QPalette::Active, KColorScheme::View); + kpd->setBackgroundWarningColor(colorScheme.background(KColorScheme::NegativeBackground).color()); + setupDialog(kpd, (WId)wId, appid, false); + if (kpd->exec() == QDialog::Accepted && kpd) { + QString p = kpd->password(); + if (!p.isNull()) { + w->setPassword(p.toUtf8()); + int rc = w->close(true); + if (rc < 0) { + KMessageBox::errorWId((WId)wId, i18n("Error re-encrypting the wallet. Password was not changed."), i18n("KDE Wallet Service")); + reclose = true; + } else { + rc = w->open(p.toUtf8()); + if (rc < 0) { + KMessageBox::errorWId((WId)wId, i18n("Error reopening the wallet. Data may be lost."), i18n("KDE Wallet Service")); + reclose = true; + } + } + } + } + + delete kpd; +#ifdef HAVE_GPGMEPP + } +#endif + + if (reclose) { + internalClose(w, handle, true); + } +} + +int KSecretD::close(const QString &wallet, bool force) +{ + const QPair walletInfo = findWallet(wallet); + int handle = walletInfo.first; + KWallet::Backend *w = walletInfo.second; + + return internalClose(w, handle, force); +} + +int KSecretD::internalClose(KWallet::Backend *const w, const int handle, const bool force, const bool saveBeforeClose) +{ + if (w) { + const QString &wallet = w->walletName(); + if ((w->refCount() == 0 && !_leaveOpen) || force) { + // this is only a safety measure. sessions should be gone already. + _sessions.removeAllSessions(handle); + if (_closeIdle) { + _closeTimers.removeTimer(handle); + } + _syncTimers.removeTimer(handle); + _wallets.remove(handle); + w->close(saveBeforeClose); + doCloseSignals(handle, wallet); + delete w; + return 0; + } + return 1; + } + + return -1; +} + +int KSecretD::close(int handle, bool force, const QString &appid, const QDBusMessage &message) +{ + KWallet::Backend *w = _wallets.value(handle); + + if (w) { + if (_sessions.hasSession(appid, handle)) { + // remove one handle for the application + bool removed = _sessions.removeSession(appid, message.service(), handle); + // alternatively try sessionless + if (removed || _sessions.removeSession(appid, QLatin1String(""), handle)) { + w->deref(); + } + return internalClose(w, handle, force); + } + return 1; // not closed, handle unknown + } + return -1; // not open to begin with, or other error +} + +int KSecretD::close(int handle, bool force, const QString &appid) +{ + return close(handle, force, appid, message()); +} + +bool KSecretD::isOpen(const QString &wallet) +{ + const QPair walletInfo = findWallet(wallet); + return walletInfo.second != nullptr; +} + +bool KSecretD::isOpen(int handle) +{ + if (handle == 0) { + return false; + } + + KWallet::Backend *rc = _wallets.value(handle); + + if (rc == nullptr && ++_failed > 5) { + _failed = 0; + QTimer::singleShot(0, this, SLOT(notifyFailures())); + } else if (rc != nullptr) { + _failed = 0; + } + + return rc != nullptr; +} + +QStringList KSecretD::wallets() const +{ + QString path = KWallet::Backend::getSaveLocation(); + QDir dir(path, QStringLiteral("*.kwl")); + QStringList rc; + + dir.setFilter(QDir::Files | QDir::Hidden); + + const auto list = dir.entryInfoList(); + for (const QFileInfo &fi : list) { + QString fn = fi.fileName(); + if (fn.endsWith(QLatin1String(".kwl"))) { + fn.truncate(fn.length() - 4); + } + rc += decodeWalletName(fn); + } + return rc; +} + +void KSecretD::sync(int handle, const QString &appid) +{ + KWallet::Backend *b; + + // get the wallet and check if we have a password for it (safety measure) + if ((b = getWallet(appid, handle))) { + QString wallet = b->walletName(); + b->sync(0); + } +} + +void KSecretD::timedOutSync(int handle) +{ + _syncTimers.removeTimer(handle); + if (_wallets.contains(handle) && _wallets[handle]) { + _wallets[handle]->sync(0); + } else { + qDebug("wallet not found for sync!"); + } +} + +void KSecretD::doTransactionOpenCancelled(const QString &appid, const QString &wallet, const QString &service) +{ + // there will only be one session left to remove - all others + // have already been removed in slotServiceOwnerChanged and all + // transactions for opening new sessions have been deleted. + if (!_sessions.hasSession(appid)) { + return; + } + + const QPair walletInfo = findWallet(wallet); + int handle = walletInfo.first; + KWallet::Backend *b = walletInfo.second; + if (handle != -1 && b) { + b->deref(); + internalClose(b, handle, false); + } + + // close the session in case the wallet hasn't been closed yet + _sessions.removeSession(appid, service, handle); +} + +QStringList KSecretD::folderList(int handle, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + return b->folderList(); + } + + return QStringList(); +} + +bool KSecretD::hasFolder(int handle, const QString &f, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + return b->hasFolder(f); + } + + return false; +} + +bool KSecretD::removeFolder(int handle, const QString &f, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + bool rc = b->removeFolder(f); + initiateSync(handle); + Q_EMIT folderListUpdated(b->walletName()); + return rc; + } + + return false; +} + +bool KSecretD::createFolder(int handle, const QString &f, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + bool rc = b->createFolder(f); + initiateSync(handle); + Q_EMIT folderListUpdated(b->walletName()); + return rc; + } + + return false; +} + +QByteArray KSecretD::readMap(int handle, const QString &folder, const QString &key, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + b->setFolder(folder); + KWallet::Entry *e = b->readEntry(key); + if (e && e->type() == KWallet::Wallet::Map) { + return e->map(); + } + } + + return QByteArray(); +} + +#if KWALLET_BUILD_DEPRECATED_SINCE(5, 72) +QVariantMap KSecretD::readMapList(int handle, const QString &folder, const QString &key, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + b->setFolder(folder); + QVariantMap rc; + const auto lst = b->readEntryList(key); + for (KWallet::Entry *entry : lst) { + if (entry->type() == KWallet::Wallet::Map) { + rc.insert(entry->key(), entry->map()); + } + } + return rc; + } + + return QVariantMap(); +} +#endif + +QVariantMap KSecretD::mapList(int handle, const QString &folder, const QString &appid) +{ + QVariantMap rc; + + KWallet::Backend *backend = getWallet(appid, handle); + if (backend) { + backend->setFolder(folder); + const QList lst = backend->entriesList(); + for (KWallet::Entry *entry : lst) { + if (entry->type() == KWallet::Wallet::Map) { + rc.insert(entry->key(), entry->map()); + } + } + } + + return rc; +} + +QByteArray KSecretD::readEntry(int handle, const QString &folder, const QString &key, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + b->setFolder(folder); + KWallet::Entry *e = b->readEntry(key); + if (e) { + return e->value(); + } + } + + return QByteArray(); +} + +#if KWALLET_BUILD_DEPRECATED_SINCE(5, 72) +QVariantMap KSecretD::readEntryList(int handle, const QString &folder, const QString &key, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + b->setFolder(folder); + QVariantMap rc; + const auto lst = b->readEntryList(key); + for (KWallet::Entry *entry : lst) { + rc.insert(entry->key(), entry->value()); + } + return rc; + } + + return QVariantMap(); +} +#endif + +QVariantMap KSecretD::entriesList(int handle, const QString &folder, const QString &appid) +{ + QVariantMap rc; + + KWallet::Backend *backend = getWallet(appid, handle); + if (backend) { + backend->setFolder(folder); + const QList lst = backend->entriesList(); + for (KWallet::Entry *entry : lst) { + rc.insert(entry->key(), entry->value()); + } + } + + return rc; +} + +QStringList KSecretD::entryList(int handle, const QString &folder, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + b->setFolder(folder); + return b->entryList(); + } + + return QStringList(); +} + +QString KSecretD::readPassword(int handle, const QString &folder, const QString &key, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + b->setFolder(folder); + KWallet::Entry *e = b->readEntry(key); + if (e && e->type() == KWallet::Wallet::Password) { + return e->password(); + } + } + + return QString(); +} + +#if KWALLET_BUILD_DEPRECATED_SINCE(5, 72) +QVariantMap KSecretD::readPasswordList(int handle, const QString &folder, const QString &key, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + b->setFolder(folder); + QVariantMap rc; + const auto lst = b->readEntryList(key); + for (KWallet::Entry *entry : lst) { + if (entry->type() == KWallet::Wallet::Password) { + rc.insert(entry->key(), entry->password()); + } + } + return rc; + } + + return QVariantMap(); +} +#endif + +QVariantMap KSecretD::passwordList(int handle, const QString &folder, const QString &appid) +{ + QVariantMap rc; + + KWallet::Backend *backend = getWallet(appid, handle); + if (backend) { + backend->setFolder(folder); + const QList lst = backend->entriesList(); + for (KWallet::Entry *entry : lst) { + if (entry->type() == KWallet::Wallet::Password) { + rc.insert(entry->key(), entry->password()); + } + } + } + + return rc; +} + +int KSecretD::writeMap(int handle, const QString &folder, const QString &key, const QByteArray &value, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + b->setFolder(folder); + KWallet::Entry e; + e.setKey(key); + e.setValue(value); + e.setType(KWallet::Wallet::Map); + b->writeEntry(&e); + initiateSync(handle); + emitFolderUpdated(b->walletName(), folder); + emitEntryUpdated(b->walletName(), folder, key); + return 0; + } + + return -1; +} + +int KSecretD::writeEntry(int handle, const QString &folder, const QString &key, const QByteArray &value, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + b->setFolder(folder); + KWallet::Entry e; + e.setKey(key); + e.setValue(value); + e.setType(KWallet::Wallet::Stream); + b->writeEntry(&e); + initiateSync(handle); + emitFolderUpdated(b->walletName(), folder); + emitEntryUpdated(b->walletName(), folder, key); + return 0; + } + + return -1; +} + +int KSecretD::writeEntry(int handle, const QString &folder, const QString &key, const QByteArray &value, int entryType, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + b->setFolder(folder); + KWallet::Entry e; + e.setKey(key); + e.setValue(value); + e.setType(KWallet::Wallet::EntryType(entryType)); + b->writeEntry(&e); + initiateSync(handle); + emitFolderUpdated(b->walletName(), folder); + return 0; + } + + return -1; +} + +int KSecretD::writePassword(int handle, const QString &folder, const QString &key, const QString &value, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + b->setFolder(folder); + KWallet::Entry e; + e.setKey(key); + e.setValue(value); + e.setType(KWallet::Wallet::Password); + b->writeEntry(&e); + initiateSync(handle); + emitFolderUpdated(b->walletName(), folder); + emitEntryUpdated(b->walletName(), folder, key); + return 0; + } + + return -1; +} + +int KSecretD::entryType(int handle, const QString &folder, const QString &key, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + if (!b->hasFolder(folder)) { + return KWallet::Wallet::Unknown; + } + b->setFolder(folder); + if (b->hasEntry(key)) { + return b->readEntry(key)->type(); + } + } + + return KWallet::Wallet::Unknown; +} + +bool KSecretD::hasEntry(int handle, const QString &folder, const QString &key, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + if (!b->hasFolder(folder)) { + return false; + } + b->setFolder(folder); + return b->hasEntry(key); + } + + return false; +} + +int KSecretD::removeEntry(int handle, const QString &folder, const QString &key, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + if (!b->hasFolder(folder)) { + return 0; + } + b->setFolder(folder); + bool rc = b->removeEntry(key); + initiateSync(handle); + emitFolderUpdated(b->walletName(), folder); + emitEntryDeleted(b->walletName(), folder, key); + return rc ? 0 : -3; + } + + return -1; +} + +void KSecretD::slotServiceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner) +{ + Q_UNUSED(name); + qCDebug(KSECRETD_LOG) << "slotServiceOwnerChanged " << name << ", " << oldOwner << ", " << newOwner; + + if (!newOwner.isEmpty()) { + return; // no application exit, don't care. + } + + // as we don't have the application id we have to cycle + // all sessions. As an application can basically open wallets + // with several appids, we can't stop if we found one. + QString service(oldOwner); + const QList sessremove(_sessions.findSessions(service)); + KWallet::Backend *b = nullptr; + + // check all sessions for wallets to close + for (const KWalletAppHandlePair &s : sessremove) { + b = getWallet(s.first, s.second); + if (b) { + b->deref(); + internalClose(b, s.second, false); + } + } + + // remove all the sessions in case they aren't gone yet + for (const KWalletAppHandlePair &s : sessremove) { + _sessions.removeSession(s.first, service, s.second); + } + + // cancel all open-transactions still running for the service + QList::iterator tit; + for (tit = _transactions.begin(); tit != _transactions.end(); ++tit) { + if ((*tit)->tType == KWalletTransaction::Open && (*tit)->service == oldOwner) { + delete (*tit); + *tit = nullptr; + } + } + _transactions.removeAll(nullptr); + + // if there's currently an open-transaction being handled, + // mark it as cancelled. + if (_curtrans && _curtrans->tType == KWalletTransaction::Open && _curtrans->service == oldOwner) { + qCDebug(KSECRETD_LOG) << "Cancelling current transaction!"; + _curtrans->cancelled = true; + } + _serviceWatcher.removeWatchedService(oldOwner); +} + +KWallet::Backend *KSecretD::getWallet(const QString &appid, int handle) +{ + if (handle == 0) { + return nullptr; + } + + KWallet::Backend *w = _wallets.value(handle); + + if (w) { // the handle is valid + if (_sessions.hasSession(appid, handle)) { + // the app owns this handle + _failed = 0; + if (_closeIdle) { + _closeTimers.resetTimer(handle, _idleTime); + } + return w; + } + } + + if (++_failed > 5) { + _failed = 0; + QTimer::singleShot(0, this, SLOT(notifyFailures())); + } + + return nullptr; +} + +void KSecretD::notifyFailures() +{ + if (!_showingFailureNotify) { + _showingFailureNotify = true; + KMessageBox::information(nullptr, + i18n("There have been repeated failed attempts to gain access to a wallet. An application may be misbehaving."), + i18n("KDE Wallet Service")); + _showingFailureNotify = false; + } +} + +void KSecretD::doCloseSignals(int handle, const QString &wallet) +{ + Q_EMIT walletClosed(handle); + Q_EMIT walletClosedId(handle); + + Q_EMIT walletClosed(wallet); + if (_wallets.isEmpty()) { + Q_EMIT allWalletsClosed(); + } +} + +int KSecretD::renameEntry(int handle, const QString &folder, const QString &oldName, const QString &newName, const QString &appid) +{ + KWallet::Backend *b; + + if ((b = getWallet(appid, handle))) { + b->setFolder(folder); + int rc = b->renameEntry(oldName, newName); + initiateSync(handle); + emitFolderUpdated(b->walletName(), folder); + emitEntryRenamed(b->walletName(), folder, oldName, newName); + return rc; + } + + return -1; +} + +int KSecretD::renameWallet(const QString &oldName, const QString &newName) +{ + const QPair walletInfo = findWallet(oldName); + return walletInfo.second->renameWallet(newName); +} + +QStringList KSecretD::users(const QString &wallet) const +{ + const QPair walletInfo = findWallet(wallet); + return _sessions.getApplications(walletInfo.first); +} + +bool KSecretD::disconnectApplication(const QString &wallet, const QString &application) +{ + const QPair walletInfo = findWallet(wallet); + int handle = walletInfo.first; + KWallet::Backend *backend = walletInfo.second; + + if (handle != -1 && _sessions.hasSession(application, handle)) { + int removed = _sessions.removeAllSessions(application, handle); + + for (int i = 0; i < removed; ++i) { + backend->deref(); + } + internalClose(backend, handle, false); + + Q_EMIT applicationDisconnected(wallet, application); + return true; + } + + return false; +} + +void KSecretD::emitFolderUpdated(const QString &wallet, const QString &folder) +{ + Q_EMIT folderUpdated(wallet, folder); +} + +void KSecretD::emitEntryUpdated(const QString &wallet, const QString &folder, const QString &key) +{ + Q_EMIT entryUpdated(wallet, folder, key); +} + +void KSecretD::emitEntryRenamed(const QString &wallet, const QString &folder, const QString &oldName, const QString &newName) +{ + Q_EMIT entryRenamed(wallet, folder, oldName, newName); +} + +void KSecretD::emitEntryDeleted(const QString &wallet, const QString &folder, const QString &key) +{ + Q_EMIT entryDeleted(wallet, folder, key); +} + +void KSecretD::emitWalletListDirty() +{ + const QStringList walletsInDisk = wallets(); + const auto lst = _wallets.values(); + for (auto i : lst) { + if (!walletsInDisk.contains(i->walletName())) { + internalClose(i, _wallets.key(i), true, false); + } + } + Q_EMIT walletListDirty(); +} + +void KSecretD::reconfigure() +{ + KConfig cfg(QStringLiteral("kwalletrc")); + KConfigGroup walletGroup(&cfg, "Wallet"); + _firstUse = walletGroup.readEntry("First Use", true); + _launchManager = walletGroup.readEntry("Launch Manager", false); + _leaveOpen = walletGroup.readEntry("Leave Open", true); + bool idleSave = _closeIdle; + _closeIdle = walletGroup.readEntry("Close When Idle", false); + _openPrompt = walletGroup.readEntry("Prompt on Open", false); + int timeSave = _idleTime; + // in minutes! + _idleTime = walletGroup.readEntry("Idle Timeout", 10) * 60 * 1000; +#ifdef Q_WS_X11 + if (walletGroup.readEntry("Close on Screensaver", false)) { + // BUG 254273 : if KSecretD starts before the screen saver, then the + // connection fails and KSecretD never receives it's notifications + // To fix this, we use a timer and perform periodic connection + // attempts until connection succeeds + QTimer::singleShot(0, this, SLOT(connectToScreenSaver())); + } else { + if (screensaver && screensaver->isValid()) { + screensaver->disconnect(SIGNAL(ActiveChanged(bool)), this, SLOT(screenSaverChanged(bool))); + delete screensaver; + screensaver = 0; + } + } +#endif + // Handle idle changes + if (_closeIdle) { + if (_idleTime != timeSave) { // Timer length changed + Wallets::const_iterator it = _wallets.constBegin(); + const Wallets::const_iterator end = _wallets.constEnd(); + for (; it != end; ++it) { + _closeTimers.resetTimer(it.key(), _idleTime); + } + } + + if (!idleSave) { // add timers for all the wallets + Wallets::const_iterator it = _wallets.constBegin(); + const Wallets::const_iterator end = _wallets.constEnd(); + for (; it != end; ++it) { + _closeTimers.addTimer(it.key(), _idleTime); + } + } + } else { + _closeTimers.clear(); + } + + // Update the implicit allow stuff + _implicitAllowMap.clear(); + const KConfigGroup autoAllowGroup(&cfg, "Auto Allow"); + QStringList entries = autoAllowGroup.entryMap().keys(); + for (QStringList::const_iterator i = entries.constBegin(); i != entries.constEnd(); ++i) { + _implicitAllowMap[*i] = autoAllowGroup.readEntry(*i, QStringList()); + } + + // Update the implicit allow stuff + _implicitDenyMap.clear(); + const KConfigGroup autoDenyGroup(&cfg, "Auto Deny"); + entries = autoDenyGroup.entryMap().keys(); + for (QStringList::const_iterator i = entries.constBegin(); i != entries.constEnd(); ++i) { + _implicitDenyMap[*i] = autoDenyGroup.readEntry(*i, QStringList()); + } + + // Update if wallet was enabled/disabled + if (!isEnabled()) { // close all wallets + while (!_wallets.isEmpty()) { + Wallets::const_iterator it = _wallets.constBegin(); + internalClose(it.value(), it.key(), true); + } + QApplication::exit(0); + } +} + +bool KSecretD::isEnabled() +{ + KConfig cfg(QStringLiteral("kwalletrc")); + KConfigGroup walletGroup(&cfg, "Wallet"); + KConfigGroup ksecretdGroup(&cfg, "KSecretD"); + // For KSecredD to be enabled, it needs both global kwallet enabled and ksecretd enabled + // values, as it does not make sense without kwallet, but is possible kwallet without + // ksecretd + return ksecretdGroup.readEntry("Enabled", true) && walletGroup.readEntry("Enabled", true); +} + +bool KSecretD::folderDoesNotExist(const QString &wallet, const QString &folder) +{ + if (!wallets().contains(wallet)) { + return true; + } + + const QPair walletInfo = findWallet(wallet); + if (walletInfo.second) { + return walletInfo.second->folderDoesNotExist(folder); + } + + KWallet::Backend *b = new KWallet::Backend(wallet); + b->open(QByteArray()); + bool rc = b->folderDoesNotExist(folder); + delete b; + return rc; +} + +bool KSecretD::keyDoesNotExist(const QString &wallet, const QString &folder, const QString &key) +{ + if (!wallets().contains(wallet)) { + return true; + } + + const QPair walletInfo = findWallet(wallet); + if (walletInfo.second) { + return walletInfo.second->entryDoesNotExist(folder, key); + } + + KWallet::Backend *b = new KWallet::Backend(wallet); + b->open(QByteArray()); + bool rc = b->entryDoesNotExist(folder, key); + delete b; + return rc; +} + +bool KSecretD::implicitAllow(const QString &wallet, const QString &app) +{ + return _implicitAllowMap[wallet].contains(app); +} + +bool KSecretD::implicitDeny(const QString &wallet, const QString &app) +{ + return _implicitDenyMap[wallet].contains(app); +} + +void KSecretD::timedOutClose(int id) +{ + KWallet::Backend *w = _wallets.value(id); + if (w) { + internalClose(w, id, true); + } +} + +void KSecretD::closeAllWallets() +{ + Wallets walletsCopy = _wallets; + + Wallets::const_iterator it = walletsCopy.constBegin(); + const Wallets::const_iterator end = walletsCopy.constEnd(); + for (; it != end; ++it) { + internalClose(it.value(), it.key(), true); + } + + walletsCopy.clear(); + + // All of this should be basically noop. Let's just be safe. + _wallets.clear(); +} + +QString KSecretD::networkWallet() +{ + return KWallet::Wallet::NetworkWallet(); +} + +QString KSecretD::localWallet() +{ + return KWallet::Wallet::LocalWallet(); +} + +void KSecretD::screenSaverChanged(bool s) +{ + if (s) { + closeAllWallets(); + } +} + +void KSecretD::activatePasswordDialog() +{ + checkActiveDialog(); +} + +int KSecretD::pamOpen(const QString &wallet, const QByteArray &passwordHash, int sessionTimeout) +{ + if (_processing) { + return -1; + } + + bool brandNew = false; + + // check if the wallet is already open + QPair walletInfo = findWallet(wallet); + int rc = walletInfo.first; + if (rc != -1) { + return rc; // Wallet already opened, return handle + } + if (_wallets.count() > 20) { + return -1; + } + + KWallet::Backend *b = nullptr; + // If the wallet we want to open does not exists. create it and set pam + // hash + if (!wallets().contains(wallet)) { + b = new KWallet::Backend(wallet); + b->setCipherType(KWallet::BACKEND_CIPHER_BLOWFISH); + brandNew = true; + } else { + b = new KWallet::Backend(wallet); + } + + int openrc = b->openPreHashed(passwordHash); + if (openrc != 0 || !b->isOpen()) { + delete b; + return openrc; + } + + // opening the wallet was successful + int handle = generateHandle(); + _wallets.insert(handle, b); + _syncTimers.addTimer(handle, _syncTime); + + // don't reference the wallet or add a session so it + // can be reclosed easily. + + if (sessionTimeout > 0) { + _closeTimers.addTimer(handle, sessionTimeout); + } else if (_closeIdle) { + _closeTimers.addTimer(handle, _idleTime); + } + if (brandNew) { + Q_EMIT walletCreated(wallet); + } + Q_EMIT walletOpened(wallet); + + if (_wallets.count() == 1 && _launchManager) { + startManagerForKSecretD(); + } + + return handle; +} + +// vim: tw=220:ts=4 + +#include "moc_ksecretd.cpp" diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/ksecretd.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/ksecretd.h new file mode 100644 index 0000000000..d250af2f0d --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/ksecretd.h @@ -0,0 +1,271 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2002-2004 George Staikos + SPDX-FileCopyrightText: 2008 Michael Leupold + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef _KSECRETD_H_ +#define _KSECRETD_H_ + +#include "kwalletbackend.h" +#include +#include +#include +#include +#include +#include + +#include "ktimeout.h" +#include "kwalletsessionstore.h" + +class KDirWatch; +class KTimeout; + +// @Private +class KWalletTransaction; +class KWalletSessionStore; +class KWalletFreedesktopService; + +class KSecretD : public QObject, protected QDBusContext +{ + Q_OBJECT + +public: + KSecretD(); + ~KSecretD() override; + + static QString encodeWalletName(const QString &name); + static QString decodeWalletName(const QString &mangledName); + // Is the wallet enabled? If not, all open() calls fail. + static bool isEnabled(); + + int nextTransactionId() const; + int + openAsync(const QString &wallet, qlonglong wId, const QString &appid, bool handleSession, const QDBusConnection &connection, const QDBusMessage &message); + // Close and lock the wallet + // Accepts "message" for working from other QDBusContexts + int close(int handle, bool force, const QString &appid, const QDBusMessage &message); + +public Q_SLOTS: + + // Open and unlock the wallet + int open(const QString &wallet, qlonglong wId, const QString &appid); + + // Open and unlock the wallet with this path + int openPath(const QString &path, qlonglong wId, const QString &appid); + + // Open the wallet asynchronously + int openAsync(const QString &wallet, qlonglong wId, const QString &appid, bool handleSession); + + // Open and unlock the wallet with this path asynchronously + int openPathAsync(const QString &path, qlonglong wId, const QString &appid, bool handleSession); + + // Close and lock the wallet + // If force = true, will close it for all users. Behave. This + // can break applications, and is generally intended for use by + // the wallet manager app only. + int close(const QString &wallet, bool force); + int close(int handle, bool force, const QString &appid); + + // Save to disk but leave open + Q_NOREPLY void sync(int handle, const QString &appid); + + // Physically deletes the wallet from disk. + int deleteWallet(const QString &wallet); + + // Returns true if the wallet is open + bool isOpen(const QString &wallet); + bool isOpen(int handle); + + // List the users of this wallet + QStringList users(const QString &wallet) const; + + // Change the password of this wallet + void changePassword(const QString &wallet, qlonglong wId, const QString &appid); + + // A list of all wallets + QStringList wallets() const; + + // A list of all folders in this wallet + QStringList folderList(int handle, const QString &appid); + + // Does this wallet have this folder? + bool hasFolder(int handle, const QString &folder, const QString &appid); + + // Create this folder + bool createFolder(int handle, const QString &folder, const QString &appid); + + // Remove this folder + bool removeFolder(int handle, const QString &folder, const QString &appid); + + // List of entries in this folder + QStringList entryList(int handle, const QString &folder, const QString &appid); + + // Read an entry. If the entry does not exist, it just + // returns an empty result. It is your responsibility to check + // hasEntry() first. + QByteArray readEntry(int handle, const QString &folder, const QString &key, const QString &appid); + QByteArray readMap(int handle, const QString &folder, const QString &key, const QString &appid); + QString readPassword(int handle, const QString &folder, const QString &key, const QString &appid); + +#if KWALLET_BUILD_DEPRECATED_SINCE(5, 72) + // use entriesList() + QVariantMap readEntryList(int handle, const QString &folder, const QString &key, const QString &appid); +#endif + +#if KWALLET_BUILD_DEPRECATED_SINCE(5, 72) + // use mapList() + QVariantMap readMapList(int handle, const QString &folder, const QString &key, const QString &appid); +#endif + +#if KWALLET_BUILD_DEPRECATED_SINCE(5, 72) + // use passwordList() + QVariantMap readPasswordList(int handle, const QString &folder, const QString &key, const QString &appid); +#endif + + QVariantMap entriesList(int handle, const QString &folder, const QString &appid); + QVariantMap mapList(int handle, const QString &folder, const QString &appid); + QVariantMap passwordList(int handle, const QString &folder, const QString &appid); + + // Rename an entry. rc=0 on success. + int renameEntry(int handle, const QString &folder, const QString &oldName, const QString &newName, const QString &appid); + // Rename the wallet + int renameWallet(const QString &oldName, const QString &newName); + + // Write an entry. rc=0 on success. + int writeEntry(int handle, const QString &folder, const QString &key, const QByteArray &value, int entryType, const QString &appid); + int writeEntry(int handle, const QString &folder, const QString &key, const QByteArray &value, const QString &appid); + int writeMap(int handle, const QString &folder, const QString &key, const QByteArray &value, const QString &appid); + int writePassword(int handle, const QString &folder, const QString &key, const QString &value, const QString &appid); + + // Does the entry exist? + bool hasEntry(int handle, const QString &folder, const QString &key, const QString &appid); + + // What type is the entry? + int entryType(int handle, const QString &folder, const QString &key, const QString &appid); + + // Remove an entry. rc=0 on success. + int removeEntry(int handle, const QString &folder, const QString &key, const QString &appid); + + // Disconnect an app from a wallet + bool disconnectApplication(const QString &wallet, const QString &application); + + void reconfigure(); + + // Determine + bool folderDoesNotExist(const QString &wallet, const QString &folder); + bool keyDoesNotExist(const QString &wallet, const QString &folder, const QString &key); + + void closeAllWallets(); + + QString networkWallet(); + + QString localWallet(); + + void screenSaverChanged(bool); + + // Open a wallet using a pre-hashed password. This is only useful in cooperation + // with the kwallet PAM module. It's also less secure than manually entering the + // password as the password hash is transmitted using D-Bus. + int pamOpen(const QString &wallet, const QByteArray &passwordHash, int sessionTimeout); + +Q_SIGNALS: + void walletAsyncOpened(int id, int handle); // used to notify KWallet::Wallet + void walletListDirty(); + void walletCreated(const QString &wallet); + void walletOpened(const QString &wallet); + void walletDeleted(const QString &wallet); + void walletClosed(const QString &wallet); // clazy:exclude=overloaded-signal + + // TODO KF6 remove this signal, replaced by walletClosedId(int) + void walletClosed(int handle); // clazy:exclude=overloaded-signal + + // since 5.81 + void walletClosedId(int handle); + + void allWalletsClosed(); + void folderListUpdated(const QString &wallet); + void folderUpdated(const QString &, const QString &); + void entryUpdated(const QString &, const QString &, const QString &); + void entryRenamed(const QString &, const QString &, const QString &, const QString &); + void entryDeleted(const QString &, const QString &, const QString &); + void applicationDisconnected(const QString &wallet, const QString &application); + +private Q_SLOTS: + void slotServiceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner); + void emitWalletListDirty(); + void timedOutClose(int handle); + void timedOutSync(int handle); + void notifyFailures(); + void processTransactions(); + void activatePasswordDialog(); +#ifdef Q_WS_X11 + void connectToScreenSaver(); +#endif + +private: + // Internal - open a wallet + int internalOpen(const QString &appid, const QString &wallet, bool isPath, WId w, bool modal, const QString &service); + // Internal - close this wallet. + int internalClose(KWallet::Backend *const w, const int handle, const bool force, const bool saveBeforeClose = true); + + bool isAuthorizedApp(const QString &appid, const QString &wallet, WId w); + // This also validates the handle. May return NULL. + KWallet::Backend *getWallet(const QString &appid, int handle); + // Generate a new unique handle. + int generateHandle(); + // Emit signals about closing wallets + void doCloseSignals(int, const QString &); + void emitFolderUpdated(const QString &, const QString &); + void emitEntryUpdated(const QString &, const QString &, const QString &); + void emitEntryRenamed(const QString &, const QString &, const QString &, const QString &); + void emitEntryDeleted(const QString &, const QString &, const QString &); + // Implicitly allow access for this application + bool implicitAllow(const QString &wallet, const QString &app); + bool implicitDeny(const QString &wallet, const QString &app); + + void doTransactionChangePassword(const QString &appid, const QString &wallet, qlonglong wId); + void doTransactionOpenCancelled(const QString &appid, const QString &wallet, const QString &service); + int doTransactionOpen(const QString &appid, const QString &wallet, bool isPath, qlonglong wId, bool modal, const QString &service); + void initiateSync(int handle); + + void setupDialog(QWidget *dialog, WId wId, const QString &appid, bool modal); + void checkActiveDialog(); + + QPair findWallet(const QString &walletName) const; + + typedef QHash Wallets; + Wallets _wallets; + KDirWatch *_dw; + int _failed; + + // configuration values + bool _leaveOpen, _closeIdle, _launchManager; + bool _openPrompt, _firstUse, _showingFailureNotify; + int _idleTime; + QMap _implicitAllowMap, _implicitDenyMap; + KTimeout _closeTimers; + KTimeout _syncTimers; + const int _syncTime; + static bool _processing; + + KWalletTransaction *_curtrans; // current transaction + QList _transactions; + QPointer activeDialog; + +#ifdef Q_WS_X11 + QDBusInterface *screensaver; +#endif + + // sessions + KWalletSessionStore _sessions; + QDBusServiceWatcher _serviceWatcher; + + std::unique_ptr _fdoService; + + bool _useGpg; +}; + +#endif diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/ksecretd.notifyrc b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/ksecretd.notifyrc new file mode 100644 index 0000000000..afce12a6d2 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/ksecretd.notifyrc @@ -0,0 +1,331 @@ +[Global] +IconName=kwalletmanager +Comment=KDE Wallet +Comment[ar]=محفظة كِيدِي +Comment[ast]=KDE Wallet +Comment[az]=KDE Cüzdanı +Comment[bg]=Портфейл на KDE +Comment[ca]=Cartera de KDE +Comment[ca@valencia]=Cartera de KDE +Comment[cs]=Úschovna KDE +Comment[da]=KDE tegnebog +Comment[de]=KDE-Passwortspeicher +Comment[el]=Πορτοφόλι του KDE +Comment[en_GB]=KDE Wallet +Comment[eo]=KDE Trezorejo +Comment[es]=Cartera de KDE +Comment[eu]=KDE Zorroa +Comment[fi]=KDE Wallet +Comment[fr]=Portefeuille de KDE +Comment[ga]=Sparán KDE +Comment[gl]=KDE Wallet. +Comment[he]=ארנק KDE +Comment[hu]=KDE Wallet +Comment[ia]=KDE Wallet (Portafolio de KDE) +Comment[is]=KDE Wallet +Comment[it]=Portafoglio di KDE +Comment[ka]=KDE-ის საფულე +Comment[ko]=KDE 지갑 +Comment[lt]=KDE slaptažodinė +Comment[lv]=KDE maks +Comment[nl]=KDE Portefeuillebeheer +Comment[nn]=KDE-lommebok +Comment[pa]=KDE ਵਾਲਟ +Comment[pl]=Portfel KDE +Comment[pt]=Carteira do KDE +Comment[pt_BR]=Carteira do KDE +Comment[ro]=Portofel KDE +Comment[ru]=Бумажник +Comment[sa]=केडीई बटुआ +Comment[sk]=KDE Wallet +Comment[sl]=KDE Wallet +Comment[sv]=KDE-plånbok +Comment[tr]=KDE Cüzdan +Comment[ug]=KDE ھەميان +Comment[uk]=Торбинка KDE +Comment[vi]=Ví KDE +Comment[zh_CN]=KDE 密码库 +Comment[zh_TW]=KDE 錢包 +Name=KDE Wallet +Name[ar]=محفظة كِيدِي +Name[ast]=KDE Wallet +Name[az]=KDE Cüzdanı +Name[bg]=Портфейл на KDE +Name[ca]=Cartera de KDE +Name[ca@valencia]=Cartera de KDE +Name[cs]=Úschovna KDE +Name[da]=KDE tegnebog +Name[de]=KDE-Passwortspeicher +Name[el]=Πορτοφόλι του KDE +Name[en_GB]=KDE Wallet +Name[eo]=KDE Trezorejo +Name[es]=Cartera de KDE +Name[eu]=KDE Zorroa +Name[fi]=KDE Wallet +Name[fr]=Portefeuille de KDE +Name[ga]=Sparán KDE +Name[gl]=KDE Wallet +Name[he]=ארנק KDE +Name[hu]=KDE Wallet +Name[ia]=KDE Wallet (Portafolio de KDE) +Name[is]=KDE Wallet +Name[it]=Portafoglio di KDE +Name[ka]=KDE-ის საფულე +Name[ko]=KDE 지갑 +Name[lt]=KDE slaptažodinė +Name[lv]=KDE maks +Name[nl]=KDE Portefeuillebeheer +Name[nn]=KDE-lommebok +Name[pa]=KDE ਵਾਲਟ +Name[pl]=Portfel KDE +Name[pt]=Carteira do KDE +Name[pt_BR]=Carteira do KDE +Name[ro]=Portofel KDE +Name[ru]=Бумажник +Name[sa]=केडीई बटुआ +Name[sk]=KDE Wallet +Name[sl]=KDE Wallet +Name[sv]=KDE-plånbok +Name[tr]=KDE Cüzdan +Name[ug]=KDE ھەميان +Name[uk]=Торбинка KDE +Name[vi]=Ví KDE +Name[zh_CN]=KDE 密码库 +Name[zh_TW]=KDE 錢包 + +[Event/needsPassword] +Name=Needs Password +Name[ar]=يحتاج كلمة السر +Name[az]=Şifrə tələb olunur +Name[bg]=Изисква парола +Name[ca]=Cal una contrasenya +Name[ca@valencia]=Cal una contrasenya +Name[cs]=Je třeba heslo +Name[da]=Kræver adgangskode +Name[de]=Passwort erforderlich +Name[el]=Απαιτείται κωδικός πρόσβασης +Name[en_GB]=Needs Password +Name[eo]=Postulas Pasvorton +Name[es]=Necesita contraseña +Name[eu]=Pasahitza behar du +Name[fi]=Salasana vaaditaan +Name[fr]=Nécessite un mot de passe +Name[ga]=Focal Faire de Dhíth +Name[gl]=Precisa dun contrasinal +Name[he]=צריך סיסמה +Name[hu]=Jelszó megadása szükséges +Name[ia]=Il necessita de un contrasigno +Name[is]=Þarf lykilorð +Name[it]=Richiede password +Name[ka]=სჭირდება პაროლი +Name[ko]=암호 필요함 +Name[lt]=Reikalauja slaptažodžio +Name[lv]=Nepieciešama parole +Name[nl]=Wachtwoord nodig +Name[nn]=Passord er påkravd +Name[pa]=ਪਾਸਵਰਡ ਚਾਹੀਦਾ ਹੈ +Name[pl]=Potrzebuje hasła +Name[pt]=Necessita de Senha +Name[pt_BR]=Necessita senha +Name[ro]=Necesită parolă +Name[ru]=Требуется пароль +Name[sa]=Password आवश्यकम् +Name[sk]=Vyžaduje heslo +Name[sl]=Potrebno je geslo +Name[sv]=Kräver lösenord +Name[tr]=Parola Gerektirir +Name[ug]=ئىم زۆرۈر +Name[uk]=Потрібен пароль +Name[vi]=Cần mật khẩu +Name[zh_CN]=需要密码 +Name[zh_TW]=需要密碼 +Comment=The KDE Wallet Daemon requests a password +Comment[ar]=«عفريت محفظة كِيدِي» يطلب كلمة سر +Comment[az]=KDE Cüzdan şifrə tələb edir +Comment[bg]=Услугата Портфейл на KDE изисква парола +Comment[bn]=কে.ডি.ই. ওয়ালেট ডিমন একটি পাসওয়ার্ড চাইছে +Comment[bs]=KDE‑ov demon novčanika zahtjeva lozinku +Comment[ca]=El dimoni de carteres de KDE demana una contrasenya +Comment[ca@valencia]=El dimoni de carteres de KDE demana una contrasenya +Comment[cs]=Démon úschovny KDE požaduje heslo +Comment[csb]=Demóna KDE Wallet żądô parolë +Comment[da]=Dæmonen for KDE's tegnebog anmoder om en adgangskode +Comment[de]=Der Passwortspeicher benötigt ein Passwort +Comment[el]=Ο δαίμονας πορτοφολιού του KDE απαιτεί έναν κωδικό πρόσβασης +Comment[en_GB]=The KDE Wallet Dæmon requests a password +Comment[eo]=La trezoreja demono de KDE postulas pasvorton +Comment[es]=El demonio de la cartera de KDE requiere una contraseña +Comment[et]=KDE turvalaeka deemon nõuab parooli +Comment[eu]=KDEren zorroaren daemon-ak pasahitza eskatzen du +Comment[fa]=شبح Wallte کی‌دی‌ای رمزعبوری را درخواست میکند +Comment[fi]=KDE:n Lompakkotaustaprosessi pyytää salasanaa +Comment[fr]=Le démon du portefeuille de KDE demande un mot de passe +Comment[fy]=The KDE slûf daemon fereasket in wachtwurd +Comment[ga]=Tá Deamhan Sparáin KDE ag iarraidh focal faire +Comment[gd]=Tha an daemon aig Sporan KDE ag iarraidh facal-faire +Comment[gl]=O Servizo de carteiras de KDE pide un contrasinal. +Comment[gu]=KDE વોલેટ ડેમને પાસવર્ડની માંગ કરી છે +Comment[he]=סוכן ארנק KDE מבקש סיסמה +Comment[hi]=केडीई वॉलेट डेमॉन एक पासवर्ड का अनुरोध करता है +Comment[hr]=KDE-ov novčanik daemon zahtijeva zaporku +Comment[hu]=A KDE jelszótároló szolgáltatás jelszót kér +Comment[ia]=Le Demone KDE Wallet exige un contrasigno +Comment[id]=Daemon Wallet KDE meminta sandi +Comment[is]=KDE Wallet-miðlarinn biður um lykilorð +Comment[it]=Il demone dei portafogli di KDE richiede una password +Comment[ja]=KDE ウォレットデーモンがパスワードを要求しています +Comment[ka]=KDE-ის საფულის დემონი პაროლს ითხოვს +Comment[kk]=KDE әмиян қызметі паролін қажет етеді +Comment[km]=ដេមិន​កាបូប​របស់ KDE ស្នើ​ពាក្យសម្ងាត់ +Comment[kn]=ಕೆಡಿಇ ವಾಲೆಟ್‌ ಡೀಮನ್ ಗುಪ್ತಪದಕ್ಕಾಗಿ ಮನವಿ ಸಲ್ಲಿಸುತ್ತದೆ +Comment[ko]=KDE 지갑 데몬에서 암호를 물어봅니다 +Comment[lt]=KDE slaptažodinių tarnyba reikalauja slaptažodžio +Comment[lv]=KDE maka dēmons pieprasa paroli +Comment[mai]=KDE वालेट डेमान एकटा कूटशब्दकेँ आग्रह करैत अछि +Comment[mk]=KDE даемонот за паричник побарува лозинка +Comment[ml]=കെഡിയിലെ വാലറ്റ് നിരന്തരപ്രവൃത്തി ഒരു അടയാളവാക്കു് ചോദിയ്ക്കുന്നു +Comment[mr]=केडीई पाकीट डीमनने गुप्तशब्दाची मागणी केली आहे. +Comment[nb]=KDEs lommeboknisse ber om et passord +Comment[nds]=De KDE-Knipp-Dämoon bruukt en Passwoort +Comment[nl]=De KDE-portefeuille-daemon vereist een wachtwoord +Comment[nn]=Lommeboktenesta i KDE treng eit passord +Comment[pa]=KDE ਵਾਲਟ ਡੈਮਨ ਨੇ ਪਾਸਵਰਡ ਦੀ ਮੰਗ ਕੀਤੀ ਹੈ +Comment[pl]=Usługa Portfela KDE wymaga hasła +Comment[pt]=O Servidor da Carteira do KDE está a pedir uma senha +Comment[pt_BR]=O servidor de carteiras do KDE está solicitando uma senha +Comment[ro]=Demonul de portofel KDE cere o parolă +Comment[ru]=Бумажник KDE запрашивает пароль +Comment[sa]=KDE Wallet Daemon गुप्तशब्दं याचते +Comment[si]=The KDE පසුම්බි ඩීමනය මුරපදයක් ඉල්ලයි +Comment[sk]=Démon KDE Wallet vyžaduje heslo +Comment[sl]=Ozadnji program KDE-jeve Listnice zahteva geslo +Comment[sr]=КДЕ‑ов демон новчаника захтева лозинку +Comment[sr@ijekavian]=КДЕ‑ов демон новчаника захтијева лозинку +Comment[sr@ijekavianlatin]=KDE‑ov demon novčanika zahtijeva lozinku +Comment[sr@latin]=KDE‑ov demon novčanika zahteva lozinku +Comment[sv]=KDE-plånboksdemonen begär ett lösenord +Comment[tg]=Низоми дохилии ҳамёнҳои KDE ниҳонвожаеро дархост мекунад +Comment[th]=บริการกระเป๋าคุมข้อมูลของ KDE ร้องขอรหัสผ่าน +Comment[tr]=KDE Cüzdan Ardalan Süreci bir parola istiyor +Comment[ug]=KDE ھەميان نازارەتچىسى ئىم سورايدۇ +Comment[uk]=Фонова служба торбинок KDE надіслала запит на пароль +Comment[vi]=Trình nền Ví KDE yêu cầu một mật khẩu +Comment[wa]=Li démon poite-manoye di KDE dimande on scret +Comment[zh_CN]=KDE 密码库守护程序请求密码 +Comment[zh_TW]=KDE 錢包守護程式需要密碼 +Action=Popup + +[Event/syncFailed] +Name=Sync Failed +Name[ar]=فشلت المزامنة +Name[az]=Eyniləşdirilmə Xətası +Name[bg]=Неуспешно синхронизиране +Name[bs]=Sinhronizacija neuspjela +Name[ca]=Ha fallat la sincronització +Name[ca@valencia]=No s'ha pogut sincronitzar +Name[cs]=Synchronizace selhala +Name[da]=Synkronisering mislykkedes +Name[de]=Abgleich fehlgeschlagen +Name[el]=Αποτυχία συγχρονισμού +Name[en_GB]=Sync Failed +Name[eo]=Sinkronigo Malsukcesis +Name[es]=Sincronización fallida +Name[et]=Sünkroonimine nurjus +Name[eu]=Sinkronizatzeak huts egin du +Name[fi]=Synkronointi epäonnistui +Name[fr]=Échec de la synchronisation +Name[gd]=Dh'fhàillig leis an sioncronachadh +Name[gl]=Fallou a sincronización +Name[he]=הסנכרון נכשל +Name[hu]=A szinkronizálás meghiúsult +Name[ia]=Il falleva synchronisar +Name[id]=Sinkronisasi Gagal +Name[is]=Samstilling mistókst +Name[it]=Sincronizzazione non riuscita +Name[ka]=სინქრონიზაცია ჩავარდა +Name[kk]=Қадамдастыру жаңылды +Name[ko]=동기화 실패 +Name[lt]=Sinchronizavimas nepavyko +Name[lv]=Sinhronizēšana neizdevās +Name[nb]=Synkronisering mislyktes +Name[nds]=Synkroniseren is fehlslaan +Name[nl]=Synchronisatie mislukt +Name[nn]=Feil ved synkronisering +Name[pa]=ਸਿੰਕ ਫੇਲ੍ਹ ਹੈ +Name[pl]=Nieudana synchronizacja +Name[pt]=A Sincronização Falhou +Name[pt_BR]=Falha na sincronização +Name[ro]=Sincronizare eșuată +Name[ru]=Ошибка синхронизации бумажника +Name[sa]=समन्वयनं विफलम् +Name[sk]=Synchronizácia zlyhala +Name[sl]=Uskladitev spodletela +Name[sr]=Синхронизација пропала +Name[sr@ijekavian]=Синхронизација пропала +Name[sr@ijekavianlatin]=Sinhronizacija propala +Name[sr@latin]=Sinhronizacija propala +Name[sv]=Synkronisering misslyckades +Name[tg]=Ҳамоҳангсозӣ қатъ шуд +Name[tr]=Eşzamanlama Başarısız +Name[ug]=قەدەمداشلىيالمىدى +Name[uk]=Спроба синхронізації зазнала невдачі +Name[vi]=Đồng bộ hoá thất bại +Name[zh_CN]=同步失败 +Name[zh_TW]=同步失敗 +Comment=KDE Wallet System failed to sync a wallet file to disk +Comment[ar]=فشل نظام «محفظة كِيدِي» في مزامنة ملف المحفظة مع القرص +Comment[az]=KDE Cüzdan Sistemi diskdə ona uyğun faylları saxlaya bilmədi +Comment[bg]=Грешка при синхронизиране на портфейл файла на диска +Comment[bs]=KDE Wallet Sistem nije uspio da sinhronizuje datoteku novčanika na disk +Comment[ca]=El sistema de carteres de KDE ha fallat en sincronitzar un fitxer de cartera al disc +Comment[ca@valencia]=El sistema de carteres de KDE ha fallat mentre se sincronitzava un fitxer de cartera al disc +Comment[cs]=Systému úschovny pro KDE selhala synchronizace úschovny na disk +Comment[da]=KDE's tegnebogsystem kunne ikke synkronisere en tegnebogsfil til disken +Comment[de]=Abgleich des KDE-Passwortspeicher mit einer Passwortspeicherdatei auf der Festplatte ist fehlgeschlagen. +Comment[el]=Το σύστημα πορτοφολιού του KDE απέτυχε να συγχρονίσει ενός πορτοφολιού στον δίσκο +Comment[en_GB]=KDE Wallet System failed to sync a wallet file to disk +Comment[eo]=KDE trezoreja sistemo malsukcesis sinkronigi trezordoesieron al disko +Comment[es]=El sistema de carteras de KDE ha fallado al sincronizar un archivo de cartera con el disco +Comment[et]=KDE turvalaekasüsteem ei suutnud sünkroonida turvalaekafaili kettale +Comment[eu]=KDE zorro-sistemak ezin izan du zorro bat diskora sinkronizatu +Comment[fi]=KDE:n lompakkojärjestelmä ei onnistunut tallentamaan lompakkotiedostoa levylle +Comment[fr]=Le système du portefeuille de KDE n'a pas réussi à synchroniser un fichier de portefeuille sur le disque +Comment[gd]=Cha deach le siostam sporan KDE faidhle sporain a shioncronachadh ris an diosga +Comment[gl]=O sistema de carteiras de KDE non puido sincronizar un ficheiro de carteira co disco. +Comment[he]=מערכת הארנק של KDE נכשלה בסנכרון קובץ הארנק לכונן +Comment[hu]=A KDE jelszókezelő rendszer nem tudta szinkronizálni a jelszófájlt a lemezre +Comment[ia]=Le sistema de portafolio de KDE (KDE Wallet System) falleva synchronisar un file de portafolio con le disco +Comment[id]=Sistem Wallet KDE gagal sinkronisasi file wallet ke cakram +Comment[is]=KDE Wallet-kerfið náði ekki að samstilla veskisskrá á disk +Comment[it]=Il sistema di portafogli di KDE non è riuscito a sincronizzare il file del portafogli sul disco +Comment[ka]=KDE-ის საფულის სისტემის დისკთან სინქრონიზაციის შეცდომა +Comment[kk]=KDE әмиян жүйесінің дискідегі әмиян файлымен қадамдастыру жаңылысы +Comment[ko]=KDE 지갑 시스템과 디스크의 지갑 상태를 동기화할 수 없음 +Comment[lt]=KDE slaptažodinių sistemai nepavyko sinchronizuoti slaptažodinės failo į diską +Comment[lv]=KDE maka sistēmai neizdevās sinhronizēt maka datni diskā +Comment[nb]=KDE Wallet System klarte ikke å synkronisere en lommebokfil til disk +Comment[nds]=Binnen KDE sien Knippsystem lett sik en Knipp nich mit de Datei op de Fastplaat synkroniseren +Comment[nl]=Het lukte het KDE portefeuillesysteem niet om een portefeuillebestand naar schijf te synchroniseren +Comment[nn]=Lommeboktenesta klarte ikkje synkronisera lommebokfila til disken +Comment[pa]=ਕੇਡੀਈ ਵਾਲਟ ਸਿਸਟਮ ਵਾਲਟ ਫਾਇਲ ਨੂੰ ਡਿਸਕ ਉੱਤੇ ਸਿੰਕ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ +Comment[pl]=Synchronizacja pliku portfela na dysku przez System portfela KDE zakończyła się niepowodzeniem +Comment[pt]=O sistema da Carteira do KDE não conseguiu sincronizar um ficheiro da carteira para o disco +Comment[pt_BR]=O Sistema da Carteiras do KDE não conseguiu sincronizar um arquivo de carteira com o disco +Comment[ro]=Sistemul de portofele KDE nu a putut sincroniza fișierul unui portofel cu discul +Comment[ru]=Не удалось сохранить бумажник в соответствующий ему файл на диске +Comment[sa]=KDE Wallet System एकं बटुकसञ्चिकां डिस्कं प्रति समन्वययितुं असफलम् अभवत् +Comment[sk]=Systému KDE peňaženky sa nepodarilo synchronizovať súbor peňaženky na disk +Comment[sl]=Sistem listnic za KDE ni uspel uskladiti datoteke z listnico na disku +Comment[sr]=К‑новчаник не може да синхронизује фајл новчаника на диск +Comment[sr@ijekavian]=К‑новчаник не може да синхронизује фајл новчаника на диск +Comment[sr@ijekavianlatin]=K‑novčanik ne može da sinhronizuje fajl novčanika na disk +Comment[sr@latin]=K‑novčanik ne može da sinhronizuje fajl novčanika na disk +Comment[sv]=KDE:s plånbokssystem misslyckades synkronisera en plånboksfil till disk +Comment[tg]=Низоми ҳамёнҳои KDE ҳангоми ҳамоҳангсозии файли ҳамён бо диск қатъ шуд +Comment[tr]=KDE Cüzdan Sistemi, diske bir cüzdan dosyası eşzamanlarken başarısız oldu. +Comment[ug]=KDE ھەميان سىستېمىسى ھەميان ھۆججىتىنى دىسكىغا قەدەمداشلىيالمىدى +Comment[uk]=Система торбинок KDE не змогла синхронізувати дані файла торбинок з диском +Comment[vi]=Hệ thống Ví KDE thất bại trong việc đồng bộ hoá một tệp ví vào đĩa +Comment[zh_CN]=KDE 密码库系统无法将密码库文件同步到磁盘 +Comment[zh_TW]=KDE 錢包系統在將錢包檔同步到磁碟時失敗 +Action=Popup diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/ktimeout.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/ktimeout.cpp new file mode 100644 index 0000000000..b2b95ba34e --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/ktimeout.cpp @@ -0,0 +1,65 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2003 George Staikos + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "ktimeout.h" +#include + +KTimeout::KTimeout(QObject *parent) + : QObject(parent) +{ +} + +KTimeout::~KTimeout() +{ +} + +void KTimeout::clear() +{ + for (int timerId : std::as_const(_timers)) { + killTimer(timerId); + } + _timers.clear(); +} + +void KTimeout::removeTimer(int id) +{ + const int timerId = _timers.value(id, 0); + if (timerId != 0) { + killTimer(timerId); + } + _timers.remove(id); +} + +void KTimeout::addTimer(int id, int timeout) +{ + if (_timers.contains(id)) { + return; + } + _timers.insert(id, startTimer(timeout)); +} + +void KTimeout::resetTimer(int id, int timeout) +{ + int timerId = _timers.value(id, 0); + if (timerId != 0) { + killTimer(timerId); + _timers.insert(id, startTimer(timeout)); + } +} + +void KTimeout::timerEvent(QTimerEvent *ev) +{ + QHash::const_iterator it = _timers.constBegin(); + for (; it != _timers.constEnd(); ++it) { + if (it.value() == ev->timerId()) { + Q_EMIT timedOut(it.key()); + return; + } + } +} + +#include "moc_ktimeout.cpp" diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/ktimeout.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/ktimeout.h new file mode 100644 index 0000000000..998def7281 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/ktimeout.h @@ -0,0 +1,38 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2003 George Staikos + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef _KTIMEOUT_H_ +#define _KTIMEOUT_H_ + +#include +#include + +// @internal +class KTimeout : public QObject +{ + Q_OBJECT +public: + explicit KTimeout(QObject *parent = nullptr); + ~KTimeout() override; + +Q_SIGNALS: + void timedOut(int id); + +public Q_SLOTS: + void resetTimer(int id, int timeout); + void addTimer(int id, int timeout); + void removeTimer(int id); + void clear(); + +protected: + void timerEvent(QTimerEvent *) override; + +private: + QHash _timers; +}; + +#endif diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwallet.portal b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwallet.portal new file mode 100644 index 0000000000..8198428a72 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwallet.portal @@ -0,0 +1,4 @@ +[portal] +DBusName=org.freedesktop.impl.portal.desktop.kwallet +Interfaces=org.freedesktop.impl.portal.Secret; +UseIn=kde diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletdbuscontext.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletdbuscontext.cpp new file mode 100644 index 0000000000..9f76445866 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletdbuscontext.cpp @@ -0,0 +1,17 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2022 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#include "kwalletdbuscontext.h" + +const QDBusMessage &KWalletDBusContext::message() const +{ + return QDBusContext::message(); +} + +QDBusConnection KWalletDBusContext::connection() const +{ + return QDBusContext::connection(); +} diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletdbuscontext.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletdbuscontext.h new file mode 100644 index 0000000000..87574f0617 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletdbuscontext.h @@ -0,0 +1,54 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2022 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#ifndef _KWALLETDBUSCONTEXT_H_ +#define _KWALLETDBUSCONTEXT_H_ + +#include "qdbuserror.h" +#include +#include +#include + +/* FDO_DBUS_CONTEXT macro will be replaced by KWalletDBusContextDummy during + * preprocessing if FDO_ENABLE_DUMMY_MESSAGE_CONNECTION was defined, + * otherwise we get QDBusContext. + * + * This is used for mocking QDBusContext in autotests. + * + * QDBusContext's connection() and message() member functions can't be called + * without a real connection context (this cause segfault). + * So we need to use KWalletDBusContextDummy in case some DBus-related + * member functions may call connection()/message(). + * + * This header defines FDO_DBUS_CONTEXT macro that should be used instead of + * QDBusContext in all DBus-related which we want to use in autotests. + */ + +#ifdef FDO_ENABLE_DUMMY_MESSAGE_CONNECTION + +class KWalletDBusContextDummy : public QDBusContext +{ +public: + const QDBusMessage &message() + { + static auto msg = QDBusMessage::createSignal(QStringLiteral("dummy"), QStringLiteral("dummy"), QStringLiteral("dummy")); + return msg; + } + QDBusConnection connection() const + { + return QDBusConnection::sessionBus(); + } +}; + +#define FDO_DBUS_CONTEXT KWalletDBusContextDummy + +#else + +#define FDO_DBUS_CONTEXT QDBusContext + +#endif + +#endif // _KWALLETDBUSCONTEXT_H_ diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopattributes.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopattributes.cpp new file mode 100644 index 0000000000..0a745366fc --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopattributes.cpp @@ -0,0 +1,340 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2021 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#include "kwalletfreedesktopattributes.h" + +#include "ksecretd.h" +#include "ksecretd_debug.h" +#include "kwalletfreedesktopcollection.h" +#include +#include +#include +#include + +KWalletFreedesktopAttributes::KWalletFreedesktopAttributes(const QString &walletName) +{ + const QString writeLocation = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kwalletd"); + _path = writeLocation + QChar::fromLatin1('/') + KSecretD::encodeWalletName(walletName) + QStringLiteral("_attributes.json"); + + read(); + + if (!_params.contains(FDO_KEY_CREATED)) { + const auto currentTime = QString::number(QDateTime::currentSecsSinceEpoch()); + _params[FDO_KEY_CREATED] = currentTime; + _params[FDO_KEY_MODIFIED] = currentTime; + } +} + +void KWalletFreedesktopAttributes::read() +{ + QByteArray content; + { + QFile file(_path); + file.open(QIODevice::ReadOnly | QIODevice::Text); + if (!file.isOpen()) { + qCDebug(KSECRETD_LOG) << "Can't read attributes file " << _path; + return; + } + content = file.readAll(); + } + + const auto jsonDoc = QJsonDocument::fromJson(content); + if (jsonDoc.isObject()) { + _params = jsonDoc.object(); + } else { + qCWarning(KSECRETD_LOG) << "Can't read attributes: the root element must be an JSON-object: " << _path; + _params = QJsonObject(); + } +} + +void KWalletFreedesktopAttributes::write() +{ + if (_params.empty()) { + QFile::remove(_path); + return; + } + + updateLastModified(); + + QSaveFile sf(_path); + if (!sf.open(QIODevice::WriteOnly | QIODevice::Unbuffered)) { + qCWarning(KSECRETD_LOG) << "Can't write attributes file: " << _path; + return; + } + sf.setPermissions(QSaveFile::ReadUser | QSaveFile::WriteUser); + + const QJsonDocument saveDoc(_params); + + const QByteArray jsonBytes = saveDoc.toJson(); + if (sf.write(jsonBytes) != jsonBytes.size()) { + sf.cancelWriting(); + qCWarning(KSECRETD_LOG) << "Cannot write attributes file " << _path; + return; + } + if (!sf.commit()) { + qCWarning(KSECRETD_LOG) << "Cannot commit attributes file " << _path; + } +} + +static QString entryLocationToStr(const EntryLocation &entryLocation) +{ + return entryLocation.folder + QChar::fromLatin1('/') + entryLocation.key; +} + +static EntryLocation splitToEntryLocation(const QString &entryLocation) +{ + const int slashPos = entryLocation.indexOf(QChar::fromLatin1('/')); + if (slashPos == -1) { + qCWarning(KSECRETD_LOG) << "Entry location '" << entryLocation << "' has no slash '/'"; + return {}; + } else { + return {entryLocation.left(slashPos), entryLocation.right((entryLocation.size() - slashPos) - 1)}; + } +} + +void KWalletFreedesktopAttributes::remove(const EntryLocation &entryLocation) +{ + _params.remove(entryLocationToStr(entryLocation)); + if (_params.empty()) { + QFile::remove(_path); + } else { + write(); + } +} + +void KWalletFreedesktopAttributes::deleteFile() +{ + QFile::remove(_path); +} + +void KWalletFreedesktopAttributes::renameLabel(const EntryLocation &oldLocation, const EntryLocation &newLocation) +{ + const QString oldLoc = entryLocationToStr(oldLocation); + + const auto found = _params.find(oldLoc); + if (found == _params.end() || !found->isObject()) { + qCWarning(KSECRETD_LOG) << "Can't rename label (!?)"; + return; + } + const auto obj = found->toObject(); + _params.erase(found); + _params.insert(entryLocationToStr(newLocation), obj); + + write(); +} + +void KWalletFreedesktopAttributes::renameWallet(const QString &newName) +{ + const QString writeLocation = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kwalletd"); + const QString newPath = writeLocation + QChar::fromLatin1('/') + newName + QStringLiteral("_attributes.json"); + + QFile::rename(_path, newPath); + _path = newPath; +} + +void KWalletFreedesktopAttributes::newItem(const EntryLocation &entryLocation) +{ + _params[entryLocationToStr(entryLocation)] = QJsonObject(); +} + +QList KWalletFreedesktopAttributes::matchAttributes(const StrStrMap &attributes) const +{ + QList items; + + for (auto i = _params.constBegin(); i != _params.constEnd(); ++i) { + if (!i->isObject()) { + continue; + } + + bool match = true; + const auto itemParams = i->toObject(); + const auto foundItemAttribs = itemParams.find(QStringLiteral("attributes")); + if (foundItemAttribs == itemParams.end() || !foundItemAttribs->isObject()) { + continue; + } + const auto itemAttribs = foundItemAttribs->toObject(); + + for (auto i = attributes.constBegin(); i != attributes.constEnd(); ++i) { + const auto foundKey = itemAttribs.find(i.key()); + if (foundKey == itemAttribs.end() || !foundKey->isString() || foundKey->toString() != i.value()) { + match = false; + break; + } + } + + if (match) { + items += splitToEntryLocation(i.key()); + } + } + + return items; +} + +void KWalletFreedesktopAttributes::setAttributes(const EntryLocation &entryLocation, const StrStrMap &attributes) +{ + QJsonObject jsonAttrs; + for (auto i = attributes.constBegin(); i != attributes.constEnd(); ++i) { + jsonAttrs.insert(i.key(), i.value()); + } + + const QString strLocation = entryLocationToStr(entryLocation); + const auto foundParams = _params.find(strLocation); + QJsonObject params; + if (foundParams != _params.end() && foundParams->isObject()) { + params = foundParams->toObject(); + } else { + return; + } + + if (jsonAttrs.empty()) { + params.remove(QStringLiteral("attributes")); + } else { + params[QStringLiteral("attributes")] = jsonAttrs; + } + + _params[strLocation] = params; + + write(); +} + +StrStrMap KWalletFreedesktopAttributes::getAttributes(const EntryLocation &entryLocation) const +{ + const auto foundObj = _params.find(entryLocationToStr(entryLocation)); + if (foundObj == _params.end() || !foundObj->isObject()) { + return StrStrMap(); + } + const auto jsonParams = foundObj->toObject(); + + const auto foundAttrs = jsonParams.find(QStringLiteral("attributes")); + if (foundAttrs == jsonParams.end() || !foundAttrs->isObject()) { + return StrStrMap(); + } + const auto jsonAttrs = foundAttrs->toObject(); + + StrStrMap itemAttrs; + + for (auto i = jsonAttrs.constBegin(); i != jsonAttrs.constEnd(); ++i) { + if (i.value().isString()) { + itemAttrs.insert(i.key(), i.value().toString()); + } + } + + return itemAttrs; +} + +QString KWalletFreedesktopAttributes::getStringParam(const EntryLocation &entryLocation, const QString ¶mName, const QString &defaultParam) const +{ + const auto foundParams = _params.find(entryLocationToStr(entryLocation)); + if (foundParams == _params.end() || !foundParams->isObject()) { + return defaultParam; + } + const auto params = foundParams->toObject(); + + const auto foundParam = params.find(paramName); + if (foundParam == params.end() || !foundParam->isString()) { + return defaultParam; + } + + return foundParam->toString(); +} + +qulonglong KWalletFreedesktopAttributes::getULongLongParam(const EntryLocation &entryLocation, const QString ¶mName, qulonglong defaultParam) const +{ + const auto str = getStringParam(entryLocation, paramName, QString::number(defaultParam)); + bool ok = false; + const auto result = str.toULongLong(&ok); + return ok ? result : defaultParam; +} + +void KWalletFreedesktopAttributes::setParam(const EntryLocation &entryLocation, const QString ¶mName, const QString ¶m) +{ + const auto entryLoc = entryLocationToStr(entryLocation); + const auto foundParams = _params.find(entryLoc); + if (foundParams == _params.end() || !foundParams->isObject()) { + return; + } + + auto params = foundParams->toObject(); + + params[paramName] = param; + _params[entryLoc] = params; + + write(); +} + +void KWalletFreedesktopAttributes::setParam(const EntryLocation &entryLocation, const QString ¶mName, qulonglong param) +{ + setParam(entryLocation, paramName, QString::number(param)); +} + +void KWalletFreedesktopAttributes::remove(const FdoUniqueLabel &itemUniqLabel) +{ + remove(itemUniqLabel.toEntryLocation()); +} + +void KWalletFreedesktopAttributes::setAttributes(const FdoUniqueLabel &itemUniqLabel, const StrStrMap &attributes) +{ + setAttributes(itemUniqLabel.toEntryLocation(), attributes); +} + +StrStrMap KWalletFreedesktopAttributes::getAttributes(const FdoUniqueLabel &itemUniqLabel) const +{ + return getAttributes(itemUniqLabel.toEntryLocation()); +} + +QString KWalletFreedesktopAttributes::getStringParam(const FdoUniqueLabel &itemUniqLabel, const QString ¶mName, const QString &defaultParam) const +{ + return getStringParam(itemUniqLabel.toEntryLocation(), paramName, defaultParam); +} + +qulonglong KWalletFreedesktopAttributes::getULongLongParam(const FdoUniqueLabel &itemUniqLabel, const QString ¶mName, qulonglong defaultParam) const +{ + return getULongLongParam(itemUniqLabel.toEntryLocation(), paramName, defaultParam); +} + +void KWalletFreedesktopAttributes::setParam(const FdoUniqueLabel &itemUniqLabel, const QString ¶mName, const QString ¶m) +{ + setParam(itemUniqLabel.toEntryLocation(), paramName, param); +} + +void KWalletFreedesktopAttributes::setParam(const FdoUniqueLabel &itemUniqLabel, const QString ¶mName, qulonglong param) +{ + setParam(itemUniqLabel.toEntryLocation(), paramName, param); +} + +QList KWalletFreedesktopAttributes::listItems() const +{ + QList items; + for (auto i = _params.constBegin(); i != _params.constEnd(); ++i) { + if (i->isObject()) { + items.push_back(splitToEntryLocation(i.key())); + } + } + return items; +} + +qulonglong KWalletFreedesktopAttributes::lastModified() const +{ + auto found = _params.constFind(FDO_KEY_MODIFIED); + if (found == _params.constEnd()) { + return 0; + } + return found->toString().toULongLong(); +} + +qulonglong KWalletFreedesktopAttributes::birthTime() const +{ + auto found = _params.constFind(FDO_KEY_CREATED); + if (found == _params.constEnd()) { + return 0; + } + return found->toString().toULongLong(); +} + +void KWalletFreedesktopAttributes::updateLastModified() +{ + _params[FDO_KEY_MODIFIED] = QString::number(QDateTime::currentSecsSinceEpoch()); +} diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopattributes.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopattributes.h new file mode 100644 index 0000000000..c4832e30bd --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopattributes.h @@ -0,0 +1,57 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2021 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#ifndef _KWALLETFREEDESKTOPATTRIBUTES_H_ +#define _KWALLETFREEDESKTOPATTRIBUTES_H_ + +#include "kwalletfreedesktopservice.h" +#include + +class KWalletFreedesktopAttributes : public QObject +{ +public: + KWalletFreedesktopAttributes(const QString &walletName); + + void read(); + void write(); + void remove(const EntryLocation &entryLocation); + void remove(const FdoUniqueLabel &itemUniqLabel); + void renameLabel(const EntryLocation &oldLocation, const EntryLocation &newLocation); + void deleteFile(); + void renameWallet(const QString &newName); + void newItem(const EntryLocation &entryLocation); + + QList matchAttributes(const StrStrMap &attributes) const; + void setAttributes(const EntryLocation &entryLocation, const StrStrMap &attributes); + StrStrMap getAttributes(const EntryLocation &entryLocation) const; + + void setAttributes(const FdoUniqueLabel &itemUniqLabel, const StrStrMap &attributes); + StrStrMap getAttributes(const FdoUniqueLabel &itemUniqLabel) const; + + QString getStringParam(const EntryLocation &entryLocation, const QString ¶mName, const QString &defaultParam) const; + qulonglong getULongLongParam(const EntryLocation &entryLocation, const QString ¶mName, qulonglong defaultParam) const; + + QString getStringParam(const FdoUniqueLabel &itemUniqLabel, const QString ¶mName, const QString &defaultParam) const; + qulonglong getULongLongParam(const FdoUniqueLabel &itemUniqLabel, const QString ¶mName, qulonglong defaultParam) const; + + void setParam(const EntryLocation &entryLocation, const QString ¶mName, const QString ¶m); + void setParam(const EntryLocation &entryLocation, const QString ¶mName, qulonglong param); + + void setParam(const FdoUniqueLabel &itemUniqLabel, const QString ¶mName, const QString ¶m); + void setParam(const FdoUniqueLabel &itemUniqLabel, const QString ¶mName, qulonglong param); + + qulonglong lastModified() const; + qulonglong birthTime() const; + void updateLastModified(); + + QList listItems() const; + +private: + QString _path; + QJsonObject _params; +}; + +#endif diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopcollection.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopcollection.cpp new file mode 100644 index 0000000000..ea030a7ca4 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopcollection.cpp @@ -0,0 +1,451 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2021 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#include "kwalletfreedesktopcollection.h" + +#include "ksecretd.h" +#include "kwalletfreedesktopcollectionadaptor.h" +#include "kwalletfreedesktopitem.h" + +KWalletFreedesktopCollection::KWalletFreedesktopCollection(KWalletFreedesktopService *service, + int handle, + const QString &walletName, + QDBusObjectPath objectPath) + : m_service(service) + , m_handle(handle) + , m_uniqueLabel(FdoUniqueLabel::fromName(walletName)) + , m_objectPath(std::move(objectPath)) + , m_itemAttribs(walletName) +{ + (void)new KWalletFreedesktopCollectionAdaptor(this); + QDBusConnection::sessionBus().registerObject(fdoObjectPath().path(), this); + + const QStringList aliases = fdoService()->readAliasesFor(walletName); + for (const auto &alias : aliases) { + QDBusConnection::sessionBus().registerObject(QStringLiteral(FDO_ALIAS_PATH) + alias, this); + } + + onWalletChangeState(handle); + + /* Create items described in the attributes file */ + if (m_handle == -1) { + const auto items = itemAttributes().listItems(); + for (const auto &entryLocation : items) { + if (!findItemByEntryLocation(entryLocation)) { + pushNewItem(entryLocation.toUniqueLabel(), nextItemPath()); + } + } + } +} + +QDBusObjectPath KWalletFreedesktopCollection::nextItemPath() +{ + return QDBusObjectPath(fdoObjectPath().path() + QChar::fromLatin1('/') + QString::number(m_itemCounter++)); +} + +const QString &KWalletFreedesktopCollection::label() const +{ + return m_uniqueLabel.label; +} + +void KWalletFreedesktopCollection::setLabel(const QString &newLabel) +{ + if (newLabel == label()) { + return; + } + + const auto oldName = m_uniqueLabel.toName(); + const auto newUniqLabel = fdoService()->makeUniqueCollectionLabel(newLabel); + const auto newName = newUniqLabel.toName(); + + int rc = backend()->renameWallet(oldName, newName); + if (rc == 0) { + const QStringList aliases = fdoService()->readAliasesFor(walletName()); + m_uniqueLabel = newUniqLabel; + const QString newName = walletName(); + for (const auto &alias : aliases) { + fdoService()->updateCollectionAlias(alias, newName); + } + + itemAttributes().renameWallet(newName); + } +} + +bool KWalletFreedesktopCollection::locked() const +{ + return m_handle < 0 || !backend()->isOpen(m_handle); +} + +QList KWalletFreedesktopCollection::items() const +{ + QList items; + + for (const auto &item : m_items) { + items.push_back(item.second->fdoObjectPath()); + } + + return items; +} + +qulonglong KWalletFreedesktopCollection::created() const +{ + return itemAttributes().birthTime(); +} + +qulonglong KWalletFreedesktopCollection::modified() const +{ + return itemAttributes().lastModified(); +} + +QDBusObjectPath +KWalletFreedesktopCollection::CreateItem(const PropertiesMap &properties, const FreedesktopSecret &secret, bool replace, QDBusObjectPath &prompt) +{ + prompt = QDBusObjectPath("/"); + + if (m_handle == -1) { + sendErrorReply(QStringLiteral("org.freedesktop.Secret.Error.IsLocked"), + QStringLiteral("Collection ") + fdoObjectPath().path() + QStringLiteral(" is locked")); + return QDBusObjectPath("/"); + } + + const auto labelFound = properties.map.find(QStringLiteral("org.freedesktop.Secret.Item.Label")); + if (labelFound == properties.map.end()) { + sendErrorReply(QDBusError::ErrorType::InvalidArgs, QStringLiteral("Item label is missing (org.freedesktop.Secret.Item.Label)")); + return QDBusObjectPath("/"); + } + if (!labelFound->canConvert()) { + sendErrorReply(QDBusError::ErrorType::InvalidArgs, QStringLiteral("Item label is not a string (org.freedesktop.Secret.Item.Label)")); + return QDBusObjectPath("/"); + } + + const QString fdoLabel = labelFound->toString(); + QString dir, label; + QDBusObjectPath itemPath; + + StrStrMap attribs; + const auto attribsFound = properties.map.find(QStringLiteral("org.freedesktop.Secret.Item.Attributes")); + if (attribsFound != properties.map.end() && attribsFound->canConvert()) { + attribs = attribsFound->value(); + } + + if (replace) { + /* Try find item with same attributes */ + const auto matchedItems = itemAttributes().matchAttributes(attribs); + + if (!matchedItems.empty()) { + const auto &entryLoc = matchedItems.constFirst(); + const auto item = findItemByEntryLocation(entryLoc); + if (item) { + itemPath = item->fdoObjectPath(); + dir = entryLoc.folder; + label = entryLoc.key; + } + } + } + + if (dir.isEmpty() && label.isEmpty()) { + const auto entryLocation = makeUniqueEntryLocation(fdoLabel); + dir = entryLocation.folder; + label = entryLocation.key; + itemPath = nextItemPath(); + } + + if (label.isEmpty()) { + sendErrorReply(QDBusError::ErrorType::InvalidArgs, QStringLiteral("Item label is invalid (org.freedesktop.Secret.Item.Label)")); + return QDBusObjectPath("/"); + } + + const qulonglong createTime = QDateTime::currentSecsSinceEpoch(); + const EntryLocation entryLoc{dir, label}; + itemAttributes().newItem(entryLoc); + itemAttributes().setParam(entryLoc, FDO_KEY_MIME, secret.mimeType); + itemAttributes().setParam(entryLoc, FDO_KEY_CREATED, createTime); + itemAttributes().setParam(entryLoc, FDO_KEY_MODIFIED, createTime); + itemAttributes().setAttributes(entryLoc, attribs); + + pushNewItem(entryLoc.toUniqueLabel(), itemPath); + + { + auto decrypted = secret; + if (!fdoService()->desecret(message(), decrypted)) { + sendErrorReply(QDBusError::ErrorType::InvalidObjectPath, QStringLiteral("Can't find session ") + secret.session.path()); + return QDBusObjectPath("/"); + } + + QString xdgSchema = QStringLiteral("org.kde.KWallet.Stream"); + const auto found = attribs.find(FDO_KEY_XDG_SCHEMA); + if (found != attribs.end()) { + xdgSchema = found.value(); + } + + const QString typeString = attribs.value(QStringLiteral("type")); + + if (typeString == QStringLiteral("map")) { + QJsonObject obj = QJsonDocument::fromJson(decrypted.value.toByteArray()).object(); + QMap map; + for (auto it = obj.constBegin(); it != obj.constEnd(); it++) { + map[it.key()] = it.value().toString(); + } + + QByteArray bytes; + QDataStream ds(&bytes, QIODevice::WriteOnly); + ds << map; + backend()->writeEntry(walletHandle(), dir, label, bytes, KWallet::Wallet::Map, FDO_APPID); + explicit_zero_mem(bytes.data(), bytes.size()); + } else if (xdgSchema == QStringLiteral("org.kde.KWallet.Password") || secret.mimeType.startsWith(QStringLiteral("text/"))) { + auto bytes = decrypted.value.toByteArray(); + auto str = QString::fromUtf8(bytes); + backend()->writePassword(walletHandle(), dir, label, str, FDO_APPID); + explicit_zero_mem(bytes.data(), bytes.size()); + explicit_zero_mem(str.data(), str.size() * sizeof(QChar)); + } else { + auto bytes = decrypted.value.toByteArray(); + backend()->writeEntry(walletHandle(), dir, label, bytes, KWallet::Wallet::Stream, FDO_APPID); + explicit_zero_mem(bytes.data(), bytes.size()); + } + } + + onItemCreated(itemPath); + + return itemPath; +} + +QDBusObjectPath KWalletFreedesktopCollection::Delete() +{ + const auto name = walletName(); + + const QStringList aliases = fdoService()->readAliasesFor(name); + for (const QString &alias : aliases) { + fdoService()->removeAlias(alias); + } + + backend()->deleteWallet(name); + QDBusConnection::sessionBus().unregisterObject(fdoObjectPath().path()); + m_service->onCollectionDeleted(fdoObjectPath()); + + return QDBusObjectPath("/"); +} + +QList KWalletFreedesktopCollection::SearchItems(const StrStrMap &attributes) +{ + QList result; + + for (const auto &entryLoc : m_itemAttribs.matchAttributes(attributes)) { + auto *itm = findItemByEntryLocation(entryLoc); + if (itm) { + result.push_back(itm->fdoObjectPath()); + } + } + + return result; +} + +int KWalletFreedesktopCollection::walletHandle() const +{ + return m_handle; +} + +KWalletFreedesktopItem *KWalletFreedesktopCollection::getItemByObjectPath(const QString &objectPath) const +{ + const auto found = m_items.find(objectPath); + if (found != m_items.end()) { + return found->second.get(); + } else { + return nullptr; + } +} + +KWalletFreedesktopItem *KWalletFreedesktopCollection::findItemByEntryLocation(const EntryLocation &entryLocation) const +{ + const auto uniqLabel = FdoUniqueLabel::fromEntryLocation(entryLocation); + + for (const auto &itemPair : m_items) { + auto *item = itemPair.second.get(); + if (item->uniqueLabel() == uniqLabel) { + return item; + } + } + + return nullptr; +} + +EntryLocation KWalletFreedesktopCollection::makeUniqueEntryLocation(const QString &label) +{ + QString dir, name; + + const int slashPos = label.indexOf(QChar::fromLatin1('/')); + if (slashPos == -1 || slashPos == label.size() - 1) { + dir = QStringLiteral(FDO_SECRETS_DEFAULT_DIR); + name = label; + } else { + dir = label.left(slashPos); + name = label.mid(slashPos + 1); + } + + int suffix = 0; + QString resultName = name; + while (backend()->hasEntry(m_handle, dir, resultName, FDO_APPID)) { + resultName = FdoUniqueLabel::makeName(name, suffix++); + } + + return {dir, resultName}; +} + +FdoUniqueLabel KWalletFreedesktopCollection::makeUniqueItemLabel(const QString &label) +{ + return makeUniqueEntryLocation(label).toUniqueLabel(); +} + +KWalletFreedesktopItem &KWalletFreedesktopCollection::pushNewItem(FdoUniqueLabel uniqLabel, const QDBusObjectPath &path) +{ + m_items.erase(path.path()); + auto item = std::make_unique(this, std::move(uniqLabel), path); + return *m_items.emplace(path.path(), std::move(item)).first->second; +} + +KWalletFreedesktopItem &KWalletFreedesktopCollection::pushNewItem(const QString &label, const QDBusObjectPath &path) +{ + return pushNewItem(makeUniqueItemLabel(label), path); +} + +KWalletFreedesktopService *KWalletFreedesktopCollection::fdoService() const +{ + return m_service; +} + +KSecretD *KWalletFreedesktopCollection::backend() const +{ + return fdoService()->backend(); +} + +QDBusObjectPath KWalletFreedesktopCollection::fdoObjectPath() const +{ + return m_objectPath; +} + +const FdoUniqueLabel &KWalletFreedesktopCollection::uniqueLabel() const +{ + return m_uniqueLabel; +} + +QString KWalletFreedesktopCollection::walletName() const +{ + return m_uniqueLabel.toName(); +} + +void KWalletFreedesktopCollection::onWalletChangeState(int handle) +{ + if (handle == m_handle) { + return; + } + + // this makes the subsequent metadata addition code execute only the + // first time an handle is added, right at ctor time + if (handle >= 0 && m_handle >= 0) { + m_handle = handle; + return; + } + + m_handle = handle; + + const QStringList folderList = backend()->folderList(m_handle, FDO_APPID); + for (const QString &folder : folderList) { + const QStringList entries = backend()->entryList(m_handle, folder, FDO_APPID); + + const qulonglong createTime = QDateTime::currentSecsSinceEpoch(); + for (const auto &entry : entries) { + const EntryLocation entryLoc{folder, entry}; + const auto itm = findItemByEntryLocation(entryLoc); + if (!itm) { + StrStrMap attr; + attr["server"] = folder; + attr["user"] = entry; + switch (backend()->entryType(m_handle, folder, entry, FDO_APPID)) { + case KWallet::Wallet::Stream: + attr["type"] = "binary"; + break; + case KWallet::Wallet::Map: + attr["type"] = "map"; + break; + case KWallet::Wallet::Password: + default: + attr["type"] = "plaintext"; + break; + } + itemAttributes().newItem(entryLoc); + itemAttributes().setParam(entryLoc, FDO_KEY_CREATED, createTime); + itemAttributes().setParam(entryLoc, FDO_KEY_MODIFIED, createTime); + itemAttributes().setAttributes(entryLoc, attr); + auto &newItem = pushNewItem(entryLoc.toUniqueLabel(), nextItemPath()); + newItem.setAttributes(attr); + Q_EMIT ItemCreated(newItem.fdoObjectPath()); + } else { + Q_EMIT ItemChanged(itm->fdoObjectPath()); + } + } + } +} + +void KWalletFreedesktopCollection::onItemCreated(const QDBusObjectPath &item) +{ + itemAttributes().updateLastModified(); + Q_EMIT ItemCreated(item); + + QVariantMap props; + props[QStringLiteral("Items")] = QVariant::fromValue(items()); + onPropertiesChanged(props); +} + +void KWalletFreedesktopCollection::onItemChanged(const QDBusObjectPath &item) +{ + itemAttributes().updateLastModified(); + Q_EMIT ItemChanged(item); +} + +void KWalletFreedesktopCollection::onItemDeleted(const QDBusObjectPath &item) +{ + itemAttributes().updateLastModified(); + const auto itemMapPos = m_items.find(item.path()); + if (itemMapPos == m_items.end()) { + return; + } + auto *itemPtr = itemMapPos->second.get(); + + /* This can be called in the context of the item that is currently being + * deleted. Therefore we should schedule deletion on the next event loop iteration + */ + itemPtr->setDeleted(); + itemPtr->deleteLater(); + itemMapPos->second.release(); + m_items.erase(itemMapPos); + + Q_EMIT ItemDeleted(item); + + QVariantMap props; + props[QStringLiteral("Items")] = QVariant::fromValue(items()); + onPropertiesChanged(props); +} + +void KWalletFreedesktopCollection::onPropertiesChanged(const QVariantMap &properties) +{ + auto msg = QDBusMessage::createSignal(fdoObjectPath().path(), QStringLiteral("org.freedesktop.DBus.Properties"), QStringLiteral("PropertiesChanged")); + auto args = QVariantList(); + args << QStringLiteral("org.freedesktop.Secret.Collection") << properties << QStringList(); + msg.setArguments(args); + QDBusConnection::sessionBus().send(msg); +} + +KWalletFreedesktopAttributes &KWalletFreedesktopCollection::itemAttributes() +{ + return m_itemAttribs; +} + +const KWalletFreedesktopAttributes &KWalletFreedesktopCollection::itemAttributes() const +{ + return m_itemAttribs; +} + +#include "moc_kwalletfreedesktopcollection.cpp" diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopcollection.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopcollection.h new file mode 100644 index 0000000000..978ec4177d --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopcollection.h @@ -0,0 +1,104 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2021 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#ifndef _KWALLETFREEDESKTOPCOLLECTION_H_ +#define _KWALLETFREEDESKTOPCOLLECTION_H_ +#include "kwalletfreedesktopattributes.h" +#include "kwalletfreedesktopservice.h" + +#define FDO_SECRETS_COLLECTION_PATH FDO_SECRETS_SERVICE_OBJECT "/collection/" +#define FDO_SECRETS_DEFAULT_DIR "Secret Service" +#define FDO_KEY_MODIFIED QStringLiteral("$fdo_modified") +#define FDO_KEY_CREATED QStringLiteral("$fdo_created") +#define FDO_KEY_MIME QStringLiteral("$fdo_mime_type") +#define FDO_KEY_XDG_SCHEMA QStringLiteral("xdg:schema") + +class KWalletFreedesktopItem; + +class KWalletFreedesktopCollection : public QObject, protected QDBusContext +{ + /* org.freedesktop.Secret.Collection properties */ +public: + Q_PROPERTY(qulonglong Created READ created) + qulonglong created() const; + + Q_PROPERTY(qulonglong Modified READ modified) + qulonglong modified() const; + + Q_PROPERTY(QList Items READ items) + QList items() const; + + Q_PROPERTY(QString Label READ label WRITE setLabel) + const QString &label() const; + void setLabel(const QString &value); + + Q_PROPERTY(bool Locked READ locked) + bool locked() const; + + Q_OBJECT + +public: + KWalletFreedesktopCollection(KWalletFreedesktopService *service, int handle, const QString &walletName, QDBusObjectPath objectPath); + + KWalletFreedesktopCollection(const KWalletFreedesktopCollection &) = delete; + KWalletFreedesktopCollection &operator=(const KWalletFreedesktopCollection &) = delete; + + KWalletFreedesktopCollection(KWalletFreedesktopCollection &&) = delete; + KWalletFreedesktopCollection &&operator=(KWalletFreedesktopCollection &&) = delete; + + EntryLocation makeUniqueEntryLocation(const QString &label); + FdoUniqueLabel makeUniqueItemLabel(const QString &label); + + QDBusObjectPath nextItemPath(); + + KWalletFreedesktopService *fdoService() const; + KSecretD *backend() const; + QDBusObjectPath fdoObjectPath() const; + const FdoUniqueLabel &uniqueLabel() const; + QString walletName() const; + int walletHandle() const; + + KWalletFreedesktopItem *getItemByObjectPath(const QString &objectPath) const; + KWalletFreedesktopItem *findItemByEntryLocation(const EntryLocation &entryLocation) const; + KWalletFreedesktopItem &pushNewItem(FdoUniqueLabel label, const QDBusObjectPath &path); + KWalletFreedesktopAttributes &itemAttributes(); + const KWalletFreedesktopAttributes &itemAttributes() const; + + /* Emitters */ + void onWalletChangeState(int handle); + void onItemCreated(const QDBusObjectPath &item); + void onItemChanged(const QDBusObjectPath &item); + void onItemDeleted(const QDBusObjectPath &item); + void onPropertiesChanged(const QVariantMap &properties); + +private: + KWalletFreedesktopItem &pushNewItem(const QString &label, const QDBusObjectPath &path); + +private: + KWalletFreedesktopService *m_service; + int m_handle; + FdoUniqueLabel m_uniqueLabel; + QDBusObjectPath m_objectPath; + KWalletFreedesktopAttributes m_itemAttribs; + std::map> m_items; + uint64_t m_itemCounter = 0; + + /* Freedesktop API */ + + /* org.freedesktop.Secret.Collection methods */ +public Q_SLOTS: + QDBusObjectPath CreateItem(const PropertiesMap &properties, const FreedesktopSecret &secret, bool replace, QDBusObjectPath &prompt); + QDBusObjectPath Delete(); + QList SearchItems(const StrStrMap &attributes); + + /* org.freedesktop.Secret.Service signals */ +Q_SIGNALS: + void ItemChanged(const QDBusObjectPath &item); + void ItemCreated(const QDBusObjectPath &item); + void ItemDeleted(const QDBusObjectPath &item); +}; + +#endif diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopitem.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopitem.cpp new file mode 100644 index 0000000000..7e764f394c --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopitem.cpp @@ -0,0 +1,236 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2021 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#include "kwalletfreedesktopitem.h" + +#include "ksecretd.h" +#include "ksecretd_debug.h" +#include "kwallet.h" +#include "kwalletfreedesktopcollection.h" +#include "kwalletfreedesktopitemadaptor.h" + +KWalletFreedesktopItem::KWalletFreedesktopItem(KWalletFreedesktopCollection *collection, FdoUniqueLabel uniqLabel, QDBusObjectPath path) + : m_collection(collection) + , m_uniqueLabel(std::move(uniqLabel)) + , m_path(std::move(path)) +{ + (void)new KWalletFreedesktopItemAdaptor(this); + QDBusConnection::sessionBus().registerObject(fdoObjectPath().path(), this); +} + +KWalletFreedesktopItem::~KWalletFreedesktopItem() +{ + onPropertiesChanged(QVariantMap()); + + QDBusConnection::sessionBus().unregisterObject(fdoObjectPath().path()); + + if (!m_wasDeleted) { + m_collection->onItemChanged(fdoObjectPath()); + } +} + +StrStrMap KWalletFreedesktopItem::attributes() const +{ + return fdoCollection()->itemAttributes().getAttributes(m_uniqueLabel); +} + +void KWalletFreedesktopItem::setAttributes(const StrStrMap &value) +{ + fdoCollection()->itemAttributes().setAttributes(m_uniqueLabel, value); +} + +qulonglong KWalletFreedesktopItem::created() const +{ + return fdoCollection()->itemAttributes().getULongLongParam(m_uniqueLabel, FDO_KEY_CREATED, fdoCollection()->modified()); +} + +qulonglong KWalletFreedesktopItem::modified() const +{ + return fdoCollection()->itemAttributes().getULongLongParam(m_uniqueLabel, FDO_KEY_MODIFIED, fdoCollection()->modified()); +} + +QString KWalletFreedesktopItem::label() const +{ + return m_uniqueLabel.label; +} + +void KWalletFreedesktopItem::setLabel(const QString &value) +{ + const auto entryLocation = m_uniqueLabel.toEntryLocation(); + m_uniqueLabel = fdoCollection()->makeUniqueItemLabel(value); + const auto newEntryLocation = m_uniqueLabel.toEntryLocation(); + + if (newEntryLocation.folder != entryLocation.folder) { + const auto data = backend()->readEntry(fdoCollection()->walletHandle(), entryLocation.folder, entryLocation.key, FDO_APPID); + backend()->writeEntry(fdoCollection()->walletHandle(), newEntryLocation.folder, newEntryLocation.key, data, FDO_APPID); + backend()->removeEntry(fdoCollection()->walletHandle(), entryLocation.folder, entryLocation.key, FDO_APPID); + } else if (newEntryLocation.key != entryLocation.key) { + backend()->renameEntry(fdoCollection()->walletHandle(), entryLocation.folder, entryLocation.key, newEntryLocation.key, FDO_APPID); + } + + fdoCollection()->itemAttributes().setParam(entryLocation, FDO_KEY_MODIFIED, static_cast(QDateTime::currentSecsSinceEpoch())); + fdoCollection()->itemAttributes().renameLabel(entryLocation, newEntryLocation); + + fdoCollection()->onItemChanged(fdoObjectPath()); +} + +bool KWalletFreedesktopItem::locked() const +{ + return m_collection->locked(); +} + +QString KWalletFreedesktopItem::type() const +{ + const auto attribs = fdoCollection()->itemAttributes().getAttributes(m_uniqueLabel); + const auto found = attribs.find(FDO_KEY_XDG_SCHEMA); + if (found != attribs.end()) { + return found.value(); + } else { + return QStringLiteral("org.freedesktop.Secret.Generic"); + } +} + +void KWalletFreedesktopItem::setType(const QString &value) +{ + auto attribs = fdoCollection()->itemAttributes().getAttributes(m_uniqueLabel); + attribs[FDO_KEY_XDG_SCHEMA] = value; + fdoCollection()->itemAttributes().setAttributes(m_uniqueLabel, attribs); +} + +QDBusObjectPath KWalletFreedesktopItem::Delete() +{ + const auto entryLocation = m_uniqueLabel.toEntryLocation(); + + backend()->removeEntry(fdoCollection()->walletHandle(), entryLocation.folder, entryLocation.key, FDO_APPID); + QDBusConnection::sessionBus().unregisterObject(fdoObjectPath().path()); + + m_collection->onItemDeleted(fdoObjectPath()); + + return QDBusObjectPath("/"); +} + +FreedesktopSecret KWalletFreedesktopItem::getSecret(const QDBusConnection &connection, const QDBusMessage &message, const QDBusObjectPath &session) +{ + const auto entryLocation = m_uniqueLabel.toEntryLocation(); + const auto mimeType = fdoCollection()->itemAttributes().getStringParam(entryLocation, FDO_KEY_MIME, QStringLiteral("application/octet-stream")); + + FreedesktopSecret fdoSecret; + + const auto entryType = backend()->entryType(fdoCollection()->walletHandle(), entryLocation.folder, entryLocation.key, FDO_APPID); + if (entryType == KWallet::Wallet::Password) { + auto password = backend()->readPassword(fdoCollection()->walletHandle(), entryLocation.folder, entryLocation.key, FDO_APPID); + auto bytes = password.toUtf8(); + fdoSecret = FreedesktopSecret(session, bytes, mimeType); + explicit_zero_mem(bytes.data(), bytes.size()); + explicit_zero_mem(password.data(), password.size() * sizeof(QChar)); + } else if (entryType == KWallet::Wallet::Map) { + auto serializedMap = backend()->readMap(fdoCollection()->walletHandle(), entryLocation.folder, entryLocation.key, FDO_APPID); + QMap map; + QDataStream ds(&serializedMap, QIODevice::ReadOnly); + ds >> map; + QJsonObject obj; + for (auto it = map.constBegin(); it != map.constEnd(); it++) { + obj.insert(it.key(), it.value()); + } + fdoSecret = FreedesktopSecret(session, QJsonDocument(obj).toJson(QJsonDocument::Compact), mimeType); + explicit_zero_mem(serializedMap.data(), serializedMap.size()); + } else { + auto bytes = backend()->readEntry(fdoCollection()->walletHandle(), entryLocation.folder, entryLocation.key, FDO_APPID); + fdoSecret = FreedesktopSecret(session, bytes, mimeType); + explicit_zero_mem(bytes.data(), bytes.size()); + } + + if (!fdoService()->ensecret(message, fdoSecret)) { + message.setDelayedReply(true); + connection.send(message.createErrorReply(QDBusError::ErrorType::UnknownObject, QStringLiteral("Can't find session ") + session.path())); + } + + return fdoSecret; +} + +FreedesktopSecret KWalletFreedesktopItem::GetSecret(const QDBusObjectPath &session) +{ + return getSecret(connection(), message(), session); +} + +void KWalletFreedesktopItem::SetSecret(const FreedesktopSecret &secret) +{ + const auto entryLocation = m_uniqueLabel.toEntryLocation(); + + fdoCollection()->itemAttributes().setParam(entryLocation, FDO_KEY_MIME, secret.mimeType); + fdoCollection()->itemAttributes().setParam(entryLocation, FDO_KEY_MODIFIED, static_cast(QDateTime::currentSecsSinceEpoch())); + + auto decrypted = secret; + if (!fdoService()->desecret(message(), decrypted)) { + sendErrorReply(QDBusError::ErrorType::UnknownObject, QStringLiteral("Can't find session ") + secret.session.path()); + return; + } + + QString xdgSchema = QStringLiteral("org.kde.KWallet.Stream"); + const auto attribs = fdoCollection()->itemAttributes().getAttributes(entryLocation); + const auto found = attribs.find(FDO_KEY_XDG_SCHEMA); + if (found != attribs.end()) { + xdgSchema = found.value(); + } + + if (xdgSchema == QStringLiteral("org.kde.KWallet.Password") || secret.mimeType.startsWith(QStringLiteral("text/"))) { + auto bytes = decrypted.value.toByteArray(); + auto str = QString::fromUtf8(bytes); + backend()->writePassword(fdoCollection()->walletHandle(), entryLocation.folder, entryLocation.key, str, FDO_APPID); + explicit_zero_mem(bytes.data(), bytes.size()); + explicit_zero_mem(str.data(), str.size() * sizeof(QChar)); + } else { + auto bytes = decrypted.value.toByteArray(); + backend()->writeEntry(fdoCollection()->walletHandle(), entryLocation.folder, entryLocation.key, bytes, KWallet::Wallet::Stream, FDO_APPID); + } +} + +KWalletFreedesktopCollection *KWalletFreedesktopItem::fdoCollection() const +{ + return m_collection; +} + +KWalletFreedesktopService *KWalletFreedesktopItem::fdoService() const +{ + return fdoCollection()->fdoService(); +} + +KSecretD *KWalletFreedesktopItem::backend() const +{ + return fdoCollection()->fdoService()->backend(); +} + +QDBusObjectPath KWalletFreedesktopItem::fdoObjectPath() const +{ + return m_path; +} + +const FdoUniqueLabel &KWalletFreedesktopItem::uniqueLabel() const +{ + return m_uniqueLabel; +} + +void KWalletFreedesktopItem::uniqueLabel(const FdoUniqueLabel &uniqueLabel) +{ + m_uniqueLabel = uniqueLabel; +} + +void KWalletFreedesktopItem::setDeleted() +{ + m_wasDeleted = true; + fdoCollection()->itemAttributes().remove(m_uniqueLabel); +} + +void KWalletFreedesktopItem::onPropertiesChanged(const QVariantMap &properties) +{ + auto msg = QDBusMessage::createSignal(fdoObjectPath().path(), QStringLiteral("org.freedesktop.DBus.Properties"), QStringLiteral("PropertiesChanged")); + auto args = QVariantList(); + args << QStringLiteral("org.freedesktop.Secret.Item") << properties << QStringList(); + msg.setArguments(args); + QDBusConnection::sessionBus().send(msg); +} + +#include "moc_kwalletfreedesktopitem.cpp" diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopitem.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopitem.h new file mode 100644 index 0000000000..f56c6bb86b --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopitem.h @@ -0,0 +1,87 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2021 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#ifndef _KWALLETFREEDESKTOPITEM_H_ +#define _KWALLETFREEDESKTOPITEM_H_ +#include "kwalletfreedesktopservice.h" + +static inline constexpr auto FDO_SS_MAGICK = 0x4950414f44465353ULL; + +class KSecretD; +class KWalletFreedesktopCollection; + +class KWalletFreedesktopItem : public QObject, protected FDO_DBUS_CONTEXT +{ + /* org.freedesktop.Secret.Item properties */ +public: + Q_PROPERTY(StrStrMap Attributes READ attributes WRITE setAttributes) + StrStrMap attributes() const; + void setAttributes(const StrStrMap &value); + + Q_PROPERTY(qulonglong Created READ created) + qulonglong created() const; + + Q_PROPERTY(QString Label READ label WRITE setLabel) + QString label() const; + void setLabel(const QString &value); + + Q_PROPERTY(bool Locked READ locked) + bool locked() const; + + Q_PROPERTY(qulonglong Modified READ modified) + qulonglong modified() const; + + Q_PROPERTY(QString Type READ type WRITE setType) + QString type() const; + void setType(const QString &value); + + Q_OBJECT + +public: + KWalletFreedesktopItem(KWalletFreedesktopCollection *collection, FdoUniqueLabel uniqLabel, QDBusObjectPath path); + ~KWalletFreedesktopItem(); + + KWalletFreedesktopItem(const KWalletFreedesktopItem &) = delete; + KWalletFreedesktopItem &operator=(const KWalletFreedesktopItem &) = delete; + + KWalletFreedesktopItem(KWalletFreedesktopItem &&) = delete; + KWalletFreedesktopItem &operator=(KWalletFreedesktopItem &&) = delete; + + KWalletFreedesktopCollection *fdoCollection() const; + KWalletFreedesktopService *fdoService() const; + KSecretD *backend() const; + QDBusObjectPath fdoObjectPath() const; + const FdoUniqueLabel &uniqueLabel() const; + void uniqueLabel(const FdoUniqueLabel &uniqLabel); + + /* + QVariantMap readMap() const; + void writeMap(const QVariantMap &data); + */ + + FreedesktopSecret getSecret(const QDBusConnection &connection, const QDBusMessage &message, const QDBusObjectPath &session); + void setDeleted(); + + /* Emitters */ + void onPropertiesChanged(const QVariantMap &properties); + void enableFdoFormat(); + +private: + KWalletFreedesktopCollection *m_collection; + FdoUniqueLabel m_uniqueLabel; + QDBusObjectPath m_path; + bool m_wasDeleted = false; + + /* Freedesktop API */ + + /* org.freedesktop.Secret.Item methods */ +public Q_SLOTS: + QDBusObjectPath Delete(); + FreedesktopSecret GetSecret(const QDBusObjectPath &session); + void SetSecret(const FreedesktopSecret &secret); +}; + +#endif diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopprompt.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopprompt.cpp new file mode 100644 index 0000000000..e837d502c0 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopprompt.cpp @@ -0,0 +1,135 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2021 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#include "kwalletfreedesktopprompt.h" + +#include "ksecretd.h" +#include "kwalletfreedesktopcollection.h" +#include "kwalletfreedesktoppromptadaptor.h" + +KWalletFreedesktopPrompt::KWalletFreedesktopPrompt(KWalletFreedesktopService *service, QDBusObjectPath objectPath, PromptType type, QString responseBusName) + : QObject(nullptr) + , m_service(service) + , m_objectPath(std::move(objectPath)) + , m_type(type) + , m_responseBusName(std::move(responseBusName)) +{ + (void)new KWalletFreedesktopPromptAdaptor(this); +} + +KWalletFreedesktopService *KWalletFreedesktopPrompt::fdoService() const +{ + return m_service; +} + +KSecretD *KWalletFreedesktopPrompt::backend() const +{ + return fdoService()->backend(); +} + +QDBusObjectPath KWalletFreedesktopPrompt::fdoObjectPath() const +{ + return m_objectPath; +} + +void KWalletFreedesktopPrompt::Dismiss() +{ + auto msg = QDBusMessage::createTargetedSignal(m_responseBusName, + fdoObjectPath().path(), + QStringLiteral("org.freedesktop.Secret.Prompt"), + QStringLiteral("Completed")); + QVariantList args; + // LibSecret wants a "valid" QDBusObjectPath here or it will just freeze + // Gnome-keyring also sends "/" as object path when the create dialog gets dismissed + args << true << QVariant::fromValue(QDBusVariant(QVariant::fromValue(QList{QDBusObjectPath(QStringLiteral("/"))}))); + msg.setArguments(args); + QDBusConnection::sessionBus().send(msg); + QDBusConnection::sessionBus().unregisterObject(fdoObjectPath().path()); +} + +void KWalletFreedesktopPrompt::Prompt(const QString &window_id) +{ + if (m_type != PromptType::Open && m_type != PromptType::Create) { + return; + } + + const int wId = window_id.toInt(); + for (auto properties : std::as_const(m_propertiesList)) { + /* When type is "PromptType::Open" the properties.label actually stores + * the wallet name + */ + QString walletName = properties.collectionLabel; + + if (m_type == PromptType::Create) { + walletName = fdoService()->makeUniqueWalletName(properties.collectionLabel); + properties.collectionLabel = walletName; + } + + if (!properties.alias.isEmpty()) { + fdoService()->createCollectionAlias(properties.alias, walletName); + } + + const int tId = backend()->openAsync(walletName, wId, FDO_APPID, false, connection(), message()); + m_transactionIds.insert(tId); + m_transactionIdToCollectionProperties.emplace(tId, std::move(properties)); + } +} + +void KWalletFreedesktopPrompt::walletAsyncOpened(int transactionId, int walletHandle) +{ + const auto found = m_transactionIds.find(transactionId); + + if (found != m_transactionIds.end()) { + const auto propertiesPos = m_transactionIdToCollectionProperties.find(transactionId); + if (walletHandle < 0 || propertiesPos == m_transactionIdToCollectionProperties.end()) { + Dismiss(); + fdoService()->deletePrompt(fdoObjectPath().path()); + return; + } + m_transactionIds.remove(transactionId); + + const QString &walletName = propertiesPos->second.collectionLabel; + const auto collectionPath = fdoService()->promptUnlockCollection(walletName, walletHandle); + m_result.push_back(propertiesPos->second.objectPath.path() == QStringLiteral("/") ? collectionPath : propertiesPos->second.objectPath); + } + + if (m_transactionIds.empty()) { + /* At this point there is no remaining transactions, so we able to complete prompt */ + + auto msg = QDBusMessage::createTargetedSignal(m_responseBusName, + fdoObjectPath().path(), + QStringLiteral("org.freedesktop.Secret.Prompt"), + QStringLiteral("Completed")); + QVariantList args; + args << false; + + if (m_type == PromptType::Create && m_result.size() < 2) { + /* Single object in dbus variant */ + args << QVariant::fromValue(QDBusVariant(QVariant::fromValue(m_result.empty() ? QDBusObjectPath("/") : m_result.front()))); + } else { + /* Object array in dbus variant */ + args << QVariant::fromValue(QDBusVariant(QVariant::fromValue(m_result))); + } + + msg.setArguments(args); + QDBusConnection::sessionBus().send(msg); + + fdoService()->deletePrompt(fdoObjectPath().path()); + } +} + +void KWalletFreedesktopPrompt::subscribeForWalletAsyncOpened() +{ + connect(backend(), &KSecretD::walletAsyncOpened, this, &KWalletFreedesktopPrompt::walletAsyncOpened); + QDBusConnection::sessionBus().registerObject(fdoObjectPath().path(), this); +} + +void KWalletFreedesktopPrompt::appendProperties(const QString &label, const QDBusObjectPath &objectPath, const QString &alias) +{ + m_propertiesList.push_back(CollectionProperties{label, objectPath, alias}); +} + +#include "moc_kwalletfreedesktopprompt.cpp" diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopprompt.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopprompt.h new file mode 100644 index 0000000000..fb9bd40a65 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopprompt.h @@ -0,0 +1,73 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2021 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#ifndef _KWALLETFREEDESKTOPPROMPT_H_ +#define _KWALLETFREEDESKTOPPROMPT_H_ + +#include "kwalletfreedesktopservice.h" + +#define FDO_SECRET_SERVICE_PROMPT_PATH FDO_SECRETS_SERVICE_OBJECT "/prompt/" + +class KSecretD; + +enum class PromptType { + Open, + Create, +}; + +class KWalletFreedesktopPrompt : public QObject, protected FDO_DBUS_CONTEXT +{ + Q_OBJECT + + struct CollectionProperties { + QString collectionLabel; + QDBusObjectPath objectPath; + QString alias; + }; + +public: + KWalletFreedesktopPrompt(KWalletFreedesktopService *service, QDBusObjectPath objectPath, PromptType type, QString responseBusName); + + KWalletFreedesktopPrompt(const KWalletFreedesktopPrompt &) = delete; + KWalletFreedesktopPrompt &operator=(const KWalletFreedesktopPrompt &) = delete; + + KWalletFreedesktopPrompt(KWalletFreedesktopPrompt &&) = delete; + KWalletFreedesktopPrompt &operator=(KWalletFreedesktopPrompt &&) = delete; + + KWalletFreedesktopService *fdoService() const; + KSecretD *backend() const; + QDBusObjectPath fdoObjectPath() const; + + void subscribeForWalletAsyncOpened(); + void appendProperties(const QString &label, const QDBusObjectPath &objectPath = QDBusObjectPath("/"), const QString &alias = {}); + +public Q_SLOTS: + void walletAsyncOpened(int transactionId, int walletHandle); + +private: + KWalletFreedesktopService *m_service; + QDBusObjectPath m_objectPath; + PromptType m_type; + QSet m_transactionIds; + QList m_result; + QList m_propertiesList; + std::map m_transactionIdToCollectionProperties; + QString m_responseBusName; + + /* Freedesktop API */ + + /* org.freedesktop.Secret.Prompt methods */ +public Q_SLOTS: + void Dismiss(); + void Prompt(const QString &window_id); + + /* org.freedesktop.Secret.Prompt signals */ +Q_SIGNALS: + /* Emitted manually now */ + void Completed(bool dismissed, const QDBusVariant &result); +}; + +#endif diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopservice.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopservice.cpp new file mode 100644 index 0000000000..6c667de4f5 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopservice.cpp @@ -0,0 +1,974 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2021 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#include "kwalletfreedesktopservice.h" + +#include "ksecretd.h" +#include "ksecretd_debug.h" +#include "kwalletfreedesktopcollection.h" +#include "kwalletfreedesktopitem.h" +#include "kwalletfreedesktopprompt.h" +#include "kwalletfreedesktopserviceadaptor.h" +#include "kwalletfreedesktopsession.h" +#include +#include +#include + +#ifdef Q_OS_WIN +#include +#endif + +[[maybe_unused]] int DBUS_SECRET_SERVICE_META_TYPE_REGISTER = []() { + qDBusRegisterMetaType(); + qDBusRegisterMetaType>(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + + return 0; +}(); + +namespace +{ +QString mangleInvalidObjectPathChars(const QString &str) +{ + const auto utf8Str = str.toUtf8(); + static constexpr char hex[] = "0123456789abcdef"; + static_assert(sizeof(hex) == 17); + + QString mangled; + mangled.reserve(utf8Str.size()); + + for (const auto &c : utf8Str) { + if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') && (c < '0' || c > '9') && c != '_') { + const auto cp = static_cast(c); + mangled.push_back(QChar::fromLatin1('_')); + mangled.push_back(QChar::fromLatin1(hex[cp >> 4])); + mangled.push_back(QChar::fromLatin1(hex[cp & 0x0f])); + } else { + mangled.push_back(QChar::fromLatin1(c)); + } + } + + return mangled; +} + +QCA::SymmetricKey deriveSymmetricKeyFromDhSecret(const QCA::SecureArray &commonSecret) +{ + auto paddedSecret = KWalletFreedesktopSessionAlgorithmDhAes::normalizeUnsignedDhValue(commonSecret.toByteArray()); + + return QCA::HKDF().makeKey(QCA::SecureArray(paddedSecret), {}, {}, FDO_SECRETS_CIPHER_KEY_SIZE); +} +} + +#define LABEL_NUMBER_PREFIX "__" +#define LABEL_NUMBER_POSTFIX "_" +#define LABEL_NUMBER_REGEX "(^.*)" LABEL_NUMBER_PREFIX "(\\d+)" LABEL_NUMBER_POSTFIX "$" + +EntryLocation EntryLocation::fromUniqueLabel(const FdoUniqueLabel &uniqLabel) +{ + QString dir; + QString name = uniqLabel.label; + + const int slashPos = uniqLabel.label.indexOf(QChar::fromLatin1('/')); + if (slashPos == -1 || slashPos == uniqLabel.label.size() - 1) { + dir = QStringLiteral(FDO_SECRETS_DEFAULT_DIR); + } else { + dir = uniqLabel.label.left(slashPos); + name = uniqLabel.label.right((uniqLabel.label.size() - dir.size()) - 1); + } + + return EntryLocation{dir, FdoUniqueLabel::makeName(name, uniqLabel.copyId)}; +} + +FdoUniqueLabel EntryLocation::toUniqueLabel() const +{ + return FdoUniqueLabel::fromEntryLocation(*this); +} + +FdoUniqueLabel FdoUniqueLabel::fromEntryLocation(const EntryLocation &entryLocation) +{ + const auto uniqLabel = FdoUniqueLabel::fromName(entryLocation.key); + + if (entryLocation.folder == QStringLiteral(FDO_SECRETS_DEFAULT_DIR)) { + return uniqLabel; + } else { + return {entryLocation.folder + QChar::fromLatin1('/') + uniqLabel.label, uniqLabel.copyId}; + } +} + +FdoUniqueLabel FdoUniqueLabel::fromName(const QString &name) +{ + static QRegularExpression regexp(QStringLiteral(LABEL_NUMBER_REGEX)); + + const auto match = regexp.match(name); + if (match.hasMatch()) { + const QString strNum = match.captured(2); + bool ok = false; + const int n = strNum.toInt(&ok); + if (ok) { + return FdoUniqueLabel{match.captured(1), n}; + } + } + return FdoUniqueLabel{name}; +} + +QString FdoUniqueLabel::makeName(const QString &label, int n) +{ + if (n == -1) { + return label; + } else { + return label + QStringLiteral(LABEL_NUMBER_PREFIX) + QString::number(n) + QStringLiteral(LABEL_NUMBER_POSTFIX); + } +} + +QString FdoUniqueLabel::toName() const +{ + return makeName(label, copyId); +} + +EntryLocation FdoUniqueLabel::toEntryLocation() const +{ + return EntryLocation::fromUniqueLabel(*this); +} + +QString KWalletFreedesktopService::wrapToCollectionPath(const QString &itemPath) +{ + /* Take only /org/freedesktop/secrets/collection/collection_name */ + return itemPath.section(QChar::fromLatin1('/'), 0, 5); +} + +KWalletFreedesktopService::KWalletFreedesktopService(KSecretD *parent) + : QObject(nullptr) + , m_parent(parent) + , m_kwalletrc(QStringLiteral("kwalletrc")) +{ + (void)new KWalletFreedesktopServiceAdaptor(this); + + /* register */ + QDBusConnection::sessionBus().registerObject(QStringLiteral(FDO_SECRETS_SERVICE_OBJECT), this); + + KConfig kwalletrc(QStringLiteral("kwalletrc")); + KConfigGroup cfgSecrets(&kwalletrc, "org.freedesktop.secrets"); + + if (cfgSecrets.readEntry("apiEnabled", true)) { + QDBusConnection::sessionBus().registerService(QStringLiteral("org.freedesktop.secrets")); + } + + QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.secretservicecompat")); + + if (!parent || !parent->isEnabled()) { + return; + } + + connect(m_parent, static_cast(&KSecretD::walletClosed), this, &KWalletFreedesktopService::lockCollection); + connect(m_parent, &KSecretD::entryUpdated, this, &KWalletFreedesktopService::entryUpdated); + connect(m_parent, &KSecretD::entryDeleted, this, &KWalletFreedesktopService::entryDeleted); + connect(m_parent, &KSecretD::entryRenamed, this, &KWalletFreedesktopService::entryRenamed); + connect(m_parent, &KSecretD::walletDeleted, this, &KWalletFreedesktopService::walletDeleted); + connect(m_parent, &KSecretD::walletCreated, this, &KWalletFreedesktopService::walletCreated); + + const auto walletNames = backend()->wallets(); + + /* Build collections */ + for (const QString &walletName : walletNames) { + if (walletName.isEmpty()) { + continue; + } + const auto objectPath = makeUniqueObjectPath(walletName); + auto collection = std::make_unique(this, -1, walletName, objectPath); + + m_collections.emplace(objectPath.path(), std::move(collection)); + } +} + +KWalletFreedesktopService::~KWalletFreedesktopService() = default; + +QList KWalletFreedesktopService::collections() const +{ + QList result; + result.reserve(m_collections.size()); + + for (const auto &collectionPair : m_collections) { + result.push_back(QDBusObjectPath(collectionPair.first)); + } + + return result; +} + +QDBusObjectPath KWalletFreedesktopService::CreateCollection(const QVariantMap &properties, const QString &alias, QDBusObjectPath &prompt) +{ + prompt.setPath(QStringLiteral("/")); + + const auto labelIter = properties.find(QStringLiteral("org.freedesktop.Secret.Collection.Label")); + if (labelIter == properties.end()) { + sendErrorReply(QDBusError::ErrorType::InvalidArgs, QStringLiteral("Collection.Label property is missing")); + return QDBusObjectPath("/"); + } + if (!labelIter->canConvert()) { + sendErrorReply(QDBusError::ErrorType::InvalidArgs, QStringLiteral("Type of Collection.Label property is invalid")); + return QDBusObjectPath("/"); + } + + prompt = nextPromptPath(); + auto fdoPromptPtr = std::make_unique(this, prompt, PromptType::Create, message().service()); + auto &fdoPrompt = *m_prompts.emplace(prompt.path(), std::move(fdoPromptPtr)).first->second; + + fdoPrompt.appendProperties(labelIter->toString(), QDBusObjectPath("/"), alias); + fdoPrompt.subscribeForWalletAsyncOpened(); + + return QDBusObjectPath("/"); +} + +FreedesktopSecretMap KWalletFreedesktopService::GetSecrets(const QList &items, const QDBusObjectPath &session) +{ + FreedesktopSecretMap result; + + for (const QDBusObjectPath &itemPath : items) { + const auto item = getItemByObjectPath(itemPath); + + if (item) { + result.insert(itemPath, item->getSecret(connection(), message(), session)); + } else { + sendErrorReply(QDBusError::ErrorType::InvalidArgs, QStringLiteral("Can't find item at path ") + itemPath.path()); + break; + } + } + + return result; +} + +QList KWalletFreedesktopService::Lock(const QList &objects, QDBusObjectPath &prompt) +{ + prompt = QDBusObjectPath("/"); + QList result; + + /* Try find in active collections */ + for (const QDBusObjectPath &object : objects) { + const QString collectionPath = wrapToCollectionPath(resolveIfAlias(object.path())); + + const auto foundCollection = m_collections.find(collectionPath); + if (foundCollection != m_collections.end()) { + const int walletHandle = foundCollection->second->walletHandle(); + const int rc = m_parent->close(walletHandle, true, FDO_APPID, message()); + + if (rc == 0) { + result.push_back(QDBusObjectPath(collectionPath)); + } else { + sendErrorReply(QDBusError::ErrorType::InvalidArgs, QStringLiteral("Can't lock object at path ") + collectionPath); + } + } else { + sendErrorReply(QDBusError::ErrorType::InvalidArgs, QStringLiteral("Collection at path ") + collectionPath + QStringLiteral(" does not exist")); + } + } + + return result; +} + +QDBusVariant KWalletFreedesktopService::OpenSession(const QString &algorithm, const QDBusVariant &input, QDBusObjectPath &result) +{ + std::unique_ptr sessionAlgorithm; + if (algorithm == QStringLiteral("plain")) { + sessionAlgorithm = createSessionAlgorithmPlain(); + } else if (algorithm == QStringLiteral("dh-ietf1024-sha256-aes128-cbc-pkcs7")) { + if (!input.variant().canConvert()) { + sendErrorReply(QDBusError::ErrorType::InvalidArgs, QStringLiteral("Second input argument must be a byte array.")); + return {}; + } + + sessionAlgorithm = createSessionAlgorithmDhAes(input.variant().toByteArray()); + } else { + sendErrorReply(QDBusError::ErrorType::NotSupported, + QStringLiteral("Algorithm ") + algorithm + + QStringLiteral(" is not supported. (only plain and dh-ietf1024-sha256-aes128-cbc-pkcs7 are supported)")); + return {}; + } + + if (!sessionAlgorithm) { + // Creation of session algorithm failed, createSessionAlgorithm...() method should have sent an error reply. + return {}; + } + + const QString sessionPath = createSession(std::move(sessionAlgorithm)); + result.setPath(sessionPath); + return QDBusVariant(QVariant(m_sessions[sessionPath]->negotiationOutput())); +} + +QDBusObjectPath KWalletFreedesktopService::ReadAlias(const QString &name) +{ + QString walletName; + + m_kwalletrc.reparseConfiguration(); + if (name == QStringLiteral("default")) { + KConfigGroup cfg(&m_kwalletrc, "Wallet"); + walletName = defaultWalletName(cfg); + + } else { + KConfigGroup cfg(&m_kwalletrc, "org.freedesktop.secrets.aliases"); + walletName = cfg.readEntry(name, QString()); + } + + if (!walletName.isEmpty()) { + const auto *collection = getCollectionByWalletName(walletName); + if (collection) { + return collection->fdoObjectPath(); + } + } + + return QDBusObjectPath("/"); +} + +QList KWalletFreedesktopService::SearchItems(const StrStrMap &attributes, QList &locked) +{ + QList unlocked; + + for (const auto &collectionPair : m_collections) { + auto &collection = *collectionPair.second; + + if (collection.locked()) { + locked += collection.SearchItems(attributes); + } else { + unlocked += collection.SearchItems(attributes); + } + } + + return unlocked; +} + +void KWalletFreedesktopService::SetAlias(const QString &name, const QDBusObjectPath &collectionPath) +{ + const auto foundCollection = m_collections.find(collectionPath.path()); + if (foundCollection == m_collections.end()) { + return; + } + + auto *collection = foundCollection->second.get(); + createCollectionAlias(name, collection); +} + +QString KWalletFreedesktopService::resolveIfAlias(QString alias) +{ + if (alias.startsWith(QStringLiteral(FDO_ALIAS_PATH))) { + const auto path = ReadAlias(alias.remove(0, QStringLiteral(FDO_ALIAS_PATH).size())).path(); + if (path != QStringLiteral("/")) { + alias = path; + } else { + sendErrorReply(QDBusError::ErrorType::InvalidArgs, QStringLiteral("Alias ") + alias + QStringLiteral(" does not exist")); + return {}; + } + } + + if (!alias.startsWith(QStringLiteral(FDO_SECRETS_COLLECTION_PATH))) { + sendErrorReply(QDBusError::ErrorType::InvalidArgs, QStringLiteral("Collection object path is invalid")); + return {}; + } + + return alias; +} + +struct UnlockedObject { + QString walletName; + QDBusObjectPath objectPath; +}; + +QList KWalletFreedesktopService::Unlock(const QList &objects, QDBusObjectPath &prompt) +{ + prompt = QDBusObjectPath("/"); + + QList result; + QList needUnlock; + + /* Try find in active collections */ + for (const QDBusObjectPath &object : objects) { + const QString strPath = object.path(); + const QString collectionPath = wrapToCollectionPath(resolveIfAlias(strPath)); + + const auto foundCollection = m_collections.find(collectionPath); + if (foundCollection != m_collections.end()) { + if (foundCollection->second->locked()) { + needUnlock.push_back({foundCollection->second->walletName(), QDBusObjectPath(strPath)}); + } else { + result.push_back(QDBusObjectPath(strPath)); + } + } else { + sendErrorReply(QDBusError::ErrorType::InvalidObjectPath, QStringLiteral("Object ") + strPath + QStringLiteral(" does not exist")); + return {}; + } + } + + if (!needUnlock.empty()) { + const auto promptPath = nextPromptPath(); + auto fdoPromptPtr = std::make_unique(this, promptPath, PromptType::Open, message().service()); + auto &fdoPrompt = *m_prompts.emplace(promptPath.path(), std::move(fdoPromptPtr)).first->second; + + prompt = QDBusObjectPath(promptPath); + + for (const auto &[walletName, objectPath] : std::as_const(needUnlock)) { + fdoPrompt.appendProperties(walletName, objectPath); + } + + fdoPrompt.subscribeForWalletAsyncOpened(); + } + return result; +} + +std::unique_ptr KWalletFreedesktopService::createSessionAlgorithmPlain() const +{ + return std::make_unique(); +} + +std::unique_ptr KWalletFreedesktopService::createSessionAlgorithmDhAes(const QByteArray &clientKey) const +{ + QCA::KeyGenerator keygen; + const auto dlGroup = QCA::DLGroup(keygen.createDLGroup(QCA::IETF_1024)); + if (dlGroup.isNull()) { + sendErrorReply(QDBusError::ErrorType::InvalidArgs, QStringLiteral("createDLGroup failed: maybe libqca-ossl is missing")); + return nullptr; + } + + auto privateKey = QCA::PrivateKey(keygen.createDH(dlGroup)); + const auto publicKey = QCA::PublicKey(privateKey); + const auto clientPublicKey = QCA::DHPublicKey(dlGroup, KWalletFreedesktopSessionAlgorithmDhAes::decodeUnsignedDhValue(clientKey)); + const auto commonSecret = privateKey.deriveKey(clientPublicKey); + const auto symmetricKey = deriveSymmetricKeyFromDhSecret(commonSecret); + + return std::make_unique(publicKey, symmetricKey); +} + +QString KWalletFreedesktopService::createSession(std::unique_ptr algorithm) +{ + const QString sessionPath = QStringLiteral(FDO_SECRETS_SESSION_PATH) + QString::number(++m_session_counter); + auto session = std::make_unique(this, std::move(algorithm), sessionPath, connection(), message()); + m_sessions[sessionPath] = std::move(session); + return sessionPath; +} + +QString KWalletFreedesktopService::defaultWalletName(KConfigGroup &cfg) +{ + auto walletName = cfg.readEntry("Default Wallet", "kdewallet"); + if (walletName.isEmpty()) { + walletName = QStringLiteral("kdewallet"); + } + return walletName; +} + +QDBusObjectPath KWalletFreedesktopService::promptUnlockCollection(const QString &walletName, int handle) +{ + auto *collection = getCollectionByWalletName(walletName); + QString objectPath; + + if (collection) { + collection->onWalletChangeState(handle); + onCollectionChanged(collection->fdoObjectPath()); + objectPath = collection->fdoObjectPath().path(); + } else { + const auto path = makeUniqueObjectPath(walletName); + objectPath = path.path(); + auto newCollection = std::make_unique(this, handle, walletName, path); + m_collections[objectPath] = std::move(newCollection); + onCollectionCreated(path); + } + + return QDBusObjectPath(objectPath); +} + +/* Triggered after KSecretD::walletClosed signal */ +void KWalletFreedesktopService::lockCollection(const QString &name) +{ + auto *collection = getCollectionByWalletName(name); + if (collection) { + collection->onWalletChangeState(-1); + onCollectionChanged(collection->fdoObjectPath()); + } +} + +/* Triggered after KSecretD::entryUpdated signal */ +void KWalletFreedesktopService::entryUpdated(const QString &walletName, const QString &folder, const QString &entryName) +{ + auto *collection = getCollectionByWalletName(walletName); + if (!collection) { + return; + } + + const EntryLocation entryLocation{folder, entryName}; + const auto *item = collection->findItemByEntryLocation(entryLocation); + if (item) { + collection->onItemChanged(item->fdoObjectPath()); + } else { + auto objectPath = collection->nextItemPath(); + collection->pushNewItem(entryLocation.toUniqueLabel(), objectPath); + collection->onItemCreated(objectPath); + } +} + +/* Triggered after KSecretD::entryDeleted signal */ +void KWalletFreedesktopService::entryDeleted(const QString &walletName, const QString &folder, const QString &entryName) +{ + auto *collection = getCollectionByWalletName(walletName); + if (!collection) { + return; + } + + const auto *item = collection->findItemByEntryLocation({folder, entryName}); + if (item) { + collection->onItemDeleted(item->fdoObjectPath()); + } +} + +/* Triggered after KSecretD::entryRenamed signal */ +void KWalletFreedesktopService::entryRenamed(const QString &walletName, const QString &folder, const QString &oldName, const QString &newName) +{ + auto *collection = getCollectionByWalletName(walletName); + if (!collection) { + return; + } + + const EntryLocation oldLocation{folder, oldName}; + const EntryLocation newLocation{folder, newName}; + + auto *item = collection->findItemByEntryLocation(oldLocation); + if (!item) { + /* Warn if label not found and not yet renamed */ + if (!collection->findItemByEntryLocation(newLocation)) { + qCWarning(KSECRETD_LOG) << "Cannot rename secret service label:" << FdoUniqueLabel::fromEntryLocation(oldLocation).label; + } + return; + } + + if (item) { + collection->itemAttributes().renameLabel(oldLocation, newLocation); + item->uniqueLabel(newLocation.toUniqueLabel()); + collection->onItemChanged(item->fdoObjectPath()); + } +} + +/* Triggered after KSecretD::walletDeleted signal */ +void KWalletFreedesktopService::walletDeleted(const QString &walletName) +{ + auto *collection = getCollectionByWalletName(walletName); + if (collection) { + collection->Delete(); + } +} + +/* Triggered after KSecretD::walletCreated signal */ +void KWalletFreedesktopService::walletCreated(const QString &walletName) +{ + const auto objectPath = makeUniqueObjectPath(walletName); + auto collection = std::make_unique(this, -1, walletName, objectPath); + m_collections.emplace(objectPath.path(), std::move(collection)); + onCollectionCreated(objectPath); +} + +bool KWalletFreedesktopService::desecret(const QDBusMessage &message, FreedesktopSecret &secret) +{ + const auto foundSession = m_sessions.find(secret.session.path()); + + if (foundSession != m_sessions.end()) { + const KWalletFreedesktopSession &session = *foundSession->second; + return session.decrypt(message, secret); + } + + return false; +} + +bool KWalletFreedesktopService::ensecret(const QDBusMessage &message, FreedesktopSecret &secret) +{ + const auto foundSession = m_sessions.find(secret.session.path()); + + if (foundSession != m_sessions.end()) { + const KWalletFreedesktopSession &session = *foundSession->second; + return session.encrypt(message, secret); + } + + return false; +} + +QDBusObjectPath KWalletFreedesktopService::nextPromptPath() +{ + static uint64_t id = 0; + return QDBusObjectPath(QStringLiteral(FDO_SECRET_SERVICE_PROMPT_PATH) + QStringLiteral("p") + QString::number(id++)); +} + +QDBusArgument &operator<<(QDBusArgument &arg, const FreedesktopSecret &secret) +{ + arg.beginStructure(); + arg << secret.session; + arg << secret.parameters; + arg << secret.value; + arg << secret.mimeType; + arg.endStructure(); + return arg; +} + +const QDBusArgument &operator>>(const QDBusArgument &arg, FreedesktopSecret &secret) +{ + arg.beginStructure(); + arg >> secret.session; + arg >> secret.parameters; + arg >> secret.value; + arg >> secret.mimeType; + arg.endStructure(); + return arg; +} + +QDataStream &operator<<(QDataStream &stream, const QCA::SecureArray &value) +{ + QByteArray bytes = value.toByteArray(); + stream << bytes; + explicit_zero_mem(bytes.data(), bytes.size()); + return stream; +} + +QDataStream &operator>>(QDataStream &stream, QCA::SecureArray &value) +{ + QByteArray bytes; + stream >> bytes; + value = QCA::SecureArray(bytes); + explicit_zero_mem(bytes.data(), bytes.size()); + return stream; +} + +QDBusArgument &operator<<(QDBusArgument &arg, const QCA::SecureArray &value) +{ + QByteArray bytes = value.toByteArray(); + arg << bytes; + explicit_zero_mem(bytes.data(), bytes.size()); + return arg; +} + +const QDBusArgument &operator>>(const QDBusArgument &arg, QCA::SecureArray &buf) +{ + QByteArray byteArray; + arg >> byteArray; + buf = QCA::SecureArray(byteArray); + explicit_zero_mem(byteArray.data(), byteArray.size()); + return arg; +} + +KSecretD *KWalletFreedesktopService::backend() const +{ + return m_parent; +} + +QDBusObjectPath KWalletFreedesktopService::fdoObjectPath() const +{ + return QDBusObjectPath(FDO_SECRETS_SERVICE_OBJECT); +} + +KWalletFreedesktopItem *KWalletFreedesktopService::getItemByObjectPath(const QDBusObjectPath &path) const +{ + const auto str = path.path(); + if (!str.startsWith(QStringLiteral(FDO_SECRETS_COLLECTION_PATH))) { + return nullptr; + } + + const QString collectionPath = wrapToCollectionPath(str); + const auto collectionPos = m_collections.find(collectionPath); + if (collectionPos == m_collections.end()) { + return nullptr; + } + + const auto &collection = collectionPos->second; + return collection->getItemByObjectPath(str); +} + +KWalletFreedesktopPrompt *KWalletFreedesktopService::getPromptByObjectPath(const QDBusObjectPath &path) const +{ + const auto foundPrompt = m_prompts.find(path.path()); + if (foundPrompt != m_prompts.end()) { + return foundPrompt->second.get(); + } else { + return nullptr; + } +} + +FdoUniqueLabel KWalletFreedesktopService::makeUniqueCollectionLabel(const QString &label) +{ + int n = -1; + auto walletName = label; + const QStringList wallets = backend()->wallets(); + + while (wallets.contains(walletName)) { + walletName = FdoUniqueLabel::makeName(label, ++n); + } + + return {label, n}; +} + +QString KWalletFreedesktopService::makeUniqueWalletName(const QString &labelPrefix) +{ + return makeUniqueCollectionLabel(labelPrefix).toName(); +} + +QDBusObjectPath KWalletFreedesktopService::makeUniqueObjectPath(const QString &walletName) const +{ + auto mangled = mangleInvalidObjectPathChars(walletName); + mangled.insert(0, QStringLiteral(FDO_SECRETS_COLLECTION_PATH)); + + QString result = mangled; + int postfix = 0; + while (m_collections.count(result)) { + result = mangled + QString::number(postfix++); + } + + return QDBusObjectPath(result); +} + +QStringList KWalletFreedesktopService::readAliasesFor(const QString &walletName) +{ + m_kwalletrc.reparseConfiguration(); + KConfigGroup cfg(&m_kwalletrc, "org.freedesktop.secrets.aliases"); + const auto map = cfg.entryMap(); + QStringList aliases; + + for (auto i = map.begin(); i != map.end(); ++i) { + if (i.value() == walletName) { + aliases.push_back(i.key()); + } + } + + KConfigGroup cfgWallet(&m_kwalletrc, "Wallet"); + if (defaultWalletName(cfgWallet) == walletName) { + aliases.push_back(QStringLiteral("default")); + } + + return aliases; +} + +void KWalletFreedesktopService::updateCollectionAlias(const QString &alias, const QString &walletName) +{ + QString sectName = QStringLiteral("org.freedesktop.secrets.aliases"); + QString sectKey = alias; + + if (alias == QStringLiteral("default")) { + sectName = QStringLiteral("Wallet"); + sectKey = QStringLiteral("Default Wallet"); + } + + KConfigGroup cfg(&m_kwalletrc, sectName); + cfg.writeEntry(sectKey, walletName); + m_kwalletrc.sync(); +} + +void KWalletFreedesktopService::createCollectionAlias(const QString &alias, const QString &walletName) +{ + QString sectName = QStringLiteral("org.freedesktop.secrets.aliases"); + QString sectKey = alias; + + if (alias == QStringLiteral("default")) { + sectName = QStringLiteral("Wallet"); + sectKey = QStringLiteral("Default Wallet"); + } + + m_kwalletrc.reparseConfiguration(); + KConfigGroup cfg(&m_kwalletrc, sectName); + + const QString prevWalletName = cfg.readEntry(sectKey, QString()); + if (!prevWalletName.isEmpty()) { + const auto *prevCollection = getCollectionByWalletName(prevWalletName); + if (prevCollection) { + QDBusConnection::sessionBus().unregisterObject(QStringLiteral(FDO_ALIAS_PATH) + alias); + } + } + + cfg.writeEntry(sectKey, walletName); + m_kwalletrc.sync(); + + auto *collection = getCollectionByWalletName(walletName); + if (collection) { + QDBusConnection::sessionBus().registerObject(QStringLiteral(FDO_ALIAS_PATH) + alias, collection); + } +} + +void KWalletFreedesktopService::createCollectionAlias(const QString &alias, KWalletFreedesktopCollection *collection) +{ + QString sectName = QStringLiteral("org.freedesktop.secrets.aliases"); + QString sectKey = alias; + + if (alias == QStringLiteral("default")) { + sectName = QStringLiteral("Wallet"); + sectKey = QStringLiteral("Default Wallet"); + } + + m_kwalletrc.reparseConfiguration(); + KConfigGroup cfg(&m_kwalletrc, sectName); + + const QString prevWalletName = cfg.readEntry(sectKey, ""); + if (!prevWalletName.isEmpty()) { + const auto *prevCollection = getCollectionByWalletName(prevWalletName); + if (prevCollection) { + QDBusConnection::sessionBus().unregisterObject(QStringLiteral(FDO_ALIAS_PATH) + alias); + } + } + + cfg.writeEntry(sectKey, collection->walletName()); + m_kwalletrc.sync(); + QDBusConnection::sessionBus().registerObject(QStringLiteral(FDO_ALIAS_PATH) + alias, collection); +} + +void KWalletFreedesktopService::removeAlias(const QString &alias) +{ + if (alias == QStringLiteral("default")) { + return; + } + + KConfigGroup cfg(&m_kwalletrc, "org.freedesktop.secrets.aliases"); + cfg.deleteEntry(alias); + m_kwalletrc.sync(); + QDBusConnection::sessionBus().unregisterObject(QStringLiteral(FDO_ALIAS_PATH) + alias); +} + +KWalletFreedesktopCollection *KWalletFreedesktopService::getCollectionByWalletName(const QString &walletName) const +{ + for (const auto &collectionKeyValue : m_collections) { + const auto collection = collectionKeyValue.second.get(); + if (collection->walletName() == walletName) { + return collection; + } + } + + return nullptr; +} + +void KWalletFreedesktopService::deletePrompt(const QString &objectPath) +{ + const auto foundPrompt = m_prompts.find(objectPath); + if (foundPrompt == m_prompts.end()) { + return; + } + + /* This can be called in the context of the prompt that is currently being + * deleted. Therefore, we should schedule deletion on the next event loop iteration + */ + foundPrompt->second->deleteLater(); + foundPrompt->second.release(); + m_prompts.erase(foundPrompt); +} + +void KWalletFreedesktopService::deleteSession(const QString &objectPath) +{ + const auto foundSession = m_sessions.find(objectPath); + if (foundSession == m_sessions.end()) { + return; + } + + /* This can be called in the context of the session that is currently being + * deleted. Therefore, we should schedule deletion on the next event loop iteration + */ + foundSession->second->deleteLater(); + foundSession->second.release(); + m_sessions.erase(foundSession); +} + +void KWalletFreedesktopService::onCollectionCreated(const QDBusObjectPath &path) +{ + Q_EMIT CollectionCreated(path); + + QVariantMap props; + props.insert(QStringLiteral("Collections"), QVariant::fromValue(collections())); + onPropertiesChanged(props); +} + +void KWalletFreedesktopService::onCollectionChanged(const QDBusObjectPath &path) +{ + Q_EMIT CollectionChanged(path); +} + +void KWalletFreedesktopService::onCollectionDeleted(const QDBusObjectPath &path) +{ + const auto collectionMapPos = m_collections.find(path.path()); + if (collectionMapPos == m_collections.end()) { + return; + } + auto &collectionPair = *collectionMapPos; + collectionPair.second->itemAttributes().deleteFile(); + + /* This can be called in the context of the collection that is currently being + * deleted. Therefore, we should schedule deletion on the next event loop iteration + */ + collectionPair.second->deleteLater(); + collectionPair.second.release(); + m_collections.erase(collectionMapPos); + + Q_EMIT CollectionDeleted(path); + + QVariantMap props; + props[QStringLiteral("Collections")] = QVariant::fromValue(collections()); + onPropertiesChanged(props); +} + +void KWalletFreedesktopService::onPropertiesChanged(const QVariantMap &properties) +{ + auto msg = QDBusMessage::createSignal(fdoObjectPath().path(), QStringLiteral("org.freedesktop.DBus.Properties"), QStringLiteral("PropertiesChanged")); + auto args = QVariantList(); + args << QStringLiteral("org.freedesktop.Secret.Service") << properties << QStringList(); + msg.setArguments(args); + QDBusConnection::sessionBus().send(msg); +} + +QDataStream &operator<<(QDataStream &stream, const QDBusObjectPath &value) +{ + return stream << value.path(); +} + +QDataStream &operator>>(QDataStream &stream, QDBusObjectPath &value) +{ + QString str; + stream >> str; + value = QDBusObjectPath(str); + return stream; +} + +const QDBusArgument &operator>>(const QDBusArgument &arg, PropertiesMap &value) +{ + arg.beginMap(); + value.map.clear(); + + while (!arg.atEnd()) { + arg.beginMapEntry(); + QString key; + QVariant val; + arg >> key >> val; + + /* For org.freedesktop.Secret.Item.Attributes */ + if (val.canConvert()) { + auto metaArg = val.value(); + StrStrMap metaMap; + metaArg >> metaMap; + val = QVariant::fromValue(metaMap); + } + value.map.insert(key, val); + + arg.endMapEntry(); + } + arg.endMap(); + + return arg; +} + +QDBusArgument &operator<<(QDBusArgument &arg, const PropertiesMap &value) +{ + arg << value.map; + return arg; +} + +void explicit_zero_mem(void *data, size_t size) +{ +#if defined(KSECRETD_HAVE_EXPLICIT_BZERO) + explicit_bzero(data, size); +#elif defined(KSECRETD_HAVE_RTLSECUREZEROMEMORY) + RtlSecureZeroMemory(data, size); +#else + auto p = reinterpret_cast(data); + for (size_t i = 0; i < size; ++i) { + p[i] = 0; + } +#endif +} + +#include "moc_kwalletfreedesktopservice.cpp" diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopservice.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopservice.h new file mode 100644 index 0000000000..bd574305f9 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopservice.h @@ -0,0 +1,228 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2021 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#ifndef _KWALLETFREEDESKTOPSERVICE_H_ +#define _KWALLETFREEDESKTOPSERVICE_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include "kwalletdbuscontext.h" + +#define FDO_APPID QString() +#define FDO_SECRETS_SERVICE_OBJECT "/org/freedesktop/secrets" +#define FDO_ALIAS_PATH "/org/freedesktop/secrets/aliases/" + +static inline constexpr size_t FDO_SECRETS_CIPHER_KEY_SIZE = 16; +static inline constexpr int FDO_DH_PUBLIC_KEY_SIZE = 128; + +class KSecretD; + +class FreedesktopSecret +{ +public: + FreedesktopSecret() = default; + + FreedesktopSecret(QDBusObjectPath iSession, const QCA::SecureArray &iValue, QString iMimeType) + : session(std::move(iSession)) + , value(iValue) + , mimeType(std::move(iMimeType)) + { + } + + friend QDBusArgument &operator<<(QDBusArgument &arg, const FreedesktopSecret &secret); + friend const QDBusArgument &operator>>(const QDBusArgument &arg, FreedesktopSecret &secret); + + QDBusObjectPath session; + QCA::SecureArray parameters; + QCA::SecureArray value; + QString mimeType; +}; + +struct PropertiesMap { + QVariantMap map; +}; + +struct EntryLocation { + static EntryLocation fromUniqueLabel(const struct FdoUniqueLabel &uniqLabel); + struct FdoUniqueLabel toUniqueLabel() const; + + bool operator==(const EntryLocation &rhs) const + { + return folder == rhs.folder && key == rhs.key; + } + + bool operator!=(const EntryLocation &rhs) const + { + return !(*this == rhs); + } + + QString folder; + QString key; +}; + +struct FdoUniqueLabel { + static FdoUniqueLabel fromEntryLocation(const EntryLocation &entryLocation); + static FdoUniqueLabel fromName(const QString &name); + static QString makeName(const QString &label, int copyId); + + bool operator==(const FdoUniqueLabel &rhs) const + { + return copyId == rhs.copyId && label == rhs.label; + } + + bool operator!=(const FdoUniqueLabel &rhs) const + { + return !(*this == rhs); + } + + QString toName() const; + EntryLocation toEntryLocation() const; + + QString label; + int copyId = -1; +}; + +typedef QMap FreedesktopSecretMap; +typedef QMap StrStrMap; + +Q_DECLARE_METATYPE(FreedesktopSecret) +Q_DECLARE_METATYPE(FreedesktopSecretMap) +Q_DECLARE_METATYPE(PropertiesMap) +Q_DECLARE_METATYPE(StrStrMap) +Q_DECLARE_METATYPE(QCA::SecureArray) + +class KWalletFreedesktopSession; +class KWalletFreedesktopSessionAlgorithm; +class KWalletFreedesktopCollection; +class KWalletFreedesktopPrompt; +class KWalletFreedesktopItem; + +class KWalletFreedesktopService : public QObject, protected FDO_DBUS_CONTEXT +{ + /* org.freedesktop.Secret.Service properties */ +public: + Q_PROPERTY(QList Collections READ collections) + QList collections() const; + + Q_OBJECT + +public: + explicit KWalletFreedesktopService(KSecretD *parent); + ~KWalletFreedesktopService(); + + KWalletFreedesktopService(const KWalletFreedesktopService &) = delete; + KWalletFreedesktopService &operator=(const KWalletFreedesktopService &) = delete; + + KWalletFreedesktopService(KWalletFreedesktopService &&) = delete; + KWalletFreedesktopService &operator=(KWalletFreedesktopService &&) = delete; + + static QString wrapToCollectionPath(const QString &itemPath); + + static QDBusObjectPath nextPromptPath(); + KSecretD *backend() const; + QDBusObjectPath fdoObjectPath() const; + + bool desecret(const QDBusMessage &message, FreedesktopSecret &secret); + bool ensecret(const QDBusMessage &message, FreedesktopSecret &secret); + KWalletFreedesktopItem *getItemByObjectPath(const QDBusObjectPath &path) const; + KWalletFreedesktopCollection *getCollectionByWalletName(const QString &walletName) const; + KWalletFreedesktopPrompt *getPromptByObjectPath(const QDBusObjectPath &path) const; + + FdoUniqueLabel makeUniqueCollectionLabel(const QString &label); + QString makeUniqueWalletName(const QString &labelPrefix); + QDBusObjectPath makeUniqueObjectPath(const QString &walletName) const; + + QString resolveIfAlias(QString alias); + QStringList readAliasesFor(const QString &walletName); + void createCollectionAlias(const QString &alias, KWalletFreedesktopCollection *collection); + void createCollectionAlias(const QString &alias, const QString &walletName); + void updateCollectionAlias(const QString &alias, const QString &walletName); + void removeAlias(const QString &alias); + + void deletePrompt(const QString &objectPath); + void deleteSession(const QString &objectPath); + QDBusObjectPath promptUnlockCollection(const QString &walletName, int handle); + + /* Emitters */ + void onCollectionCreated(const QDBusObjectPath &path); + void onCollectionChanged(const QDBusObjectPath &path); + void onCollectionDeleted(const QDBusObjectPath &path); + void onPropertiesChanged(const QVariantMap &properties); + +private Q_SLOTS: + void lockCollection(const QString &name); + void entryUpdated(const QString &walletName, const QString &folder, const QString &entryName); + void entryDeleted(const QString &walletName, const QString &folder, const QString &entryName); + void entryRenamed(const QString &walletName, const QString &folder, const QString &oldName, const QString &newName); + void walletDeleted(const QString &walletName); + void walletCreated(const QString &walletCreated); + /* + void slotServiceOwnerChanged(const QString &name, const QString &oldOwner, + const QString &newOwner); + */ + +private: + std::unique_ptr createSessionAlgorithmPlain() const; + std::unique_ptr createSessionAlgorithmDhAes(const QByteArray &clientKey) const; + QString createSession(std::unique_ptr algorithm); + QString defaultWalletName(KConfigGroup &cfg); + +private: + // must come first for the proper construction/destruction order + QCA::Initializer m_init; + + std::map> m_sessions; + std::map> m_collections; + std::map> m_prompts; + + uint64_t m_session_counter = 0; + + /* + QDBusServiceWatcher _serviceWatcher; + */ + KSecretD *m_parent; + KConfig m_kwalletrc; + + /* Freedesktop API */ + + /* org.freedesktop.Secret.Service methods */ +public Q_SLOTS: + QDBusObjectPath CreateCollection(const QVariantMap &properties, const QString &alias, QDBusObjectPath &prompt); + FreedesktopSecretMap GetSecrets(const QList &items, const QDBusObjectPath &session); + QList Lock(const QList &objects, QDBusObjectPath &Prompt); + QDBusVariant OpenSession(const QString &algorithm, const QDBusVariant &input, QDBusObjectPath &result); + QDBusObjectPath ReadAlias(const QString &name); + QList SearchItems(const StrStrMap &attributes, QList &locked); + void SetAlias(const QString &name, const QDBusObjectPath &collection); + QList Unlock(const QList &objects, QDBusObjectPath &prompt); + + /* org.freedesktop.Secret.Service signals */ +Q_SIGNALS: + void CollectionChanged(const QDBusObjectPath &collection); + void CollectionCreated(const QDBusObjectPath &collection); + void CollectionDeleted(const QDBusObjectPath &collection); +}; + +QDataStream &operator<<(QDataStream &stream, const QDBusObjectPath &value); +QDataStream &operator>>(QDataStream &stream, QDBusObjectPath &value); + +const QDBusArgument &operator>>(const QDBusArgument &arg, PropertiesMap &value); +QDBusArgument &operator<<(QDBusArgument &arg, const PropertiesMap &value); + +QDataStream &operator<<(QDataStream &stream, const QCA::SecureArray &value); +QDataStream &operator>>(QDataStream &stream, QCA::SecureArray &value); +QDBusArgument &operator<<(QDBusArgument &arg, const QCA::SecureArray &value); +const QDBusArgument &operator>>(const QDBusArgument &arg, QCA::SecureArray &buf); + +void explicit_zero_mem(void *data, size_t size); + +#endif diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopsession.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopsession.cpp new file mode 100644 index 0000000000..e20e929776 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopsession.cpp @@ -0,0 +1,165 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2021 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#include "kwalletfreedesktopsession.h" + +#include "kwalletfreedesktopsessionadaptor.h" +#include + +QByteArray KWalletFreedesktopSessionAlgorithmDhAes::normalizeUnsignedDhValue(QByteArray value) +{ + // Secret Service uses unsigned 1024-bit DH public keys on the wire. Normalize to exactly 128 bytes to match. + if (value.size() < FDO_DH_PUBLIC_KEY_SIZE) { + return value.prepend(FDO_DH_PUBLIC_KEY_SIZE - value.size(), '\0'); + } + if (value.size() > FDO_DH_PUBLIC_KEY_SIZE) { + // Keep the 128 least-significant bytes. + return value.last(FDO_DH_PUBLIC_KEY_SIZE); + } + return value; +} + +QCA::BigInteger KWalletFreedesktopSessionAlgorithmDhAes::decodeUnsignedDhValue(const QByteArray &value) +{ + auto normalized = normalizeUnsignedDhValue(value); + if (!normalized.isEmpty() && (static_cast(normalized.front()) & 0x80U)) { + normalized.prepend('\0'); + } + return QCA::BigInteger(QCA::SecureArray(normalized)); +} + +KWalletFreedesktopSession::KWalletFreedesktopSession(KWalletFreedesktopService *service, + std::unique_ptr algorithm, + QString sessionPath, + const QDBusConnection &connection, + const QDBusMessage &message) + : m_service(service) + , m_algorithm(std::move(algorithm)) + , m_sessionPath(std::move(sessionPath)) + , m_serviceBusName(message.service()) +{ + (void)new KWalletFreedesktopSessionAdaptor(this); + QDBusConnection::sessionBus().registerObject(m_sessionPath, this); + + m_serviceWatcher.setConnection(connection); + m_serviceWatcher.addWatchedService(m_serviceBusName); + m_serviceWatcher.setWatchMode(QDBusServiceWatcher::WatchForOwnerChange); + connect(&m_serviceWatcher, &QDBusServiceWatcher::serviceOwnerChanged, this, &KWalletFreedesktopSession::slotServiceOwnerChanged); +} + +void KWalletFreedesktopSession::slotServiceOwnerChanged(const QString &, const QString &, const QString &) +{ + fdoService()->deleteSession(m_sessionPath); +} + +void KWalletFreedesktopSession::Close() +{ + if (message().service() != m_serviceBusName) { + sendErrorReply(QDBusError::ErrorType::UnknownObject, QStringLiteral("Can't find session ") + m_sessionPath); + } else { + fdoService()->deleteSession(m_sessionPath); + } +} + +QByteArray KWalletFreedesktopSession::negotiationOutput() const +{ + return m_algorithm->negotiationOutput(); +} + +bool KWalletFreedesktopSession::encrypt(const QDBusMessage &message, FreedesktopSecret &secret) const +{ + if (message.service() != m_serviceBusName) { + return false; + } + + return m_algorithm->encrypt(secret); +} + +bool KWalletFreedesktopSession::decrypt(const QDBusMessage &message, FreedesktopSecret &secret) const +{ + if (message.service() != m_serviceBusName) { + return false; + } + + return m_algorithm->decrypt(secret); +} + +KWalletFreedesktopService *KWalletFreedesktopSession::fdoService() const +{ + return m_service; +} + +KSecretD *KWalletFreedesktopSession::backend() const +{ + return fdoService()->backend(); +} + +QDBusObjectPath KWalletFreedesktopSession::fdoObjectPath() const +{ + return QDBusObjectPath(m_sessionPath); +} + +QByteArray KWalletFreedesktopSessionAlgorithmPlain::negotiationOutput() const +{ + return QByteArray(); +} + +bool KWalletFreedesktopSessionAlgorithmPlain::encrypt(FreedesktopSecret &secret) const +{ + secret.parameters = QByteArray(); + return true; +} + +bool KWalletFreedesktopSessionAlgorithmPlain::decrypt(FreedesktopSecret &) const +{ + return true; +} + +KWalletFreedesktopSessionAlgorithmDhAes::KWalletFreedesktopSessionAlgorithmDhAes(const QCA::PublicKey &publicKey, QCA::SymmetricKey symmetricKey) + : m_publicKey(publicKey) + , m_symmetricKey(std::move(symmetricKey)) +{ +} + +QByteArray KWalletFreedesktopSessionAlgorithmDhAes::negotiationOutput() const +{ + return normalizeUnsignedDhValue(m_publicKey.toDH().y().toArray().toByteArray()); +} + +bool KWalletFreedesktopSessionAlgorithmDhAes::encrypt(FreedesktopSecret &secret) const +{ + auto initVector = QCA::InitializationVector(FDO_SECRETS_CIPHER_KEY_SIZE); + auto cipher = QCA::Cipher(QStringLiteral("aes128"), QCA::Cipher::CBC, QCA::Cipher::PKCS7, QCA::Encode, m_symmetricKey, initVector); + QCA::SecureArray result; + result.append(cipher.update(QCA::MemoryRegion(secret.value))); + if (cipher.ok()) { + result.append(cipher.final()); + if (cipher.ok()) { + secret.value = std::move(result); + secret.parameters = initVector; + return true; + } + } + return false; +} + +bool KWalletFreedesktopSessionAlgorithmDhAes::decrypt(FreedesktopSecret &secret) const +{ + auto cipher = + QCA::Cipher(QStringLiteral("aes128"), QCA::Cipher::CBC, QCA::Cipher::PKCS7, QCA::Decode, m_symmetricKey, QCA::InitializationVector(secret.parameters)); + QCA::SecureArray result; + result.append(cipher.update(QCA::MemoryRegion(secret.value))); + if (cipher.ok()) { + result.append(cipher.final()); + if (cipher.ok()) { + secret.value = std::move(result); + return true; + } + } + return false; +} + +#include "moc_kwalletfreedesktopsession.cpp" diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopsession.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopsession.h new file mode 100644 index 0000000000..a57d32d35c --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletfreedesktopsession.h @@ -0,0 +1,91 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2021 Slava Aseev + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#ifndef _KWALLETFREEDESKTOPSESSION_H_ +#define _KWALLETFREEDESKTOPSESSION_H_ + +#include "kwalletfreedesktopservice.h" +#include +#include +#include +#include + +#define FDO_SECRETS_SESSION_PATH FDO_SECRETS_SERVICE_OBJECT "/session/" + +class KSecretD; + +class KWalletFreedesktopSessionAlgorithm +{ +public: + virtual ~KWalletFreedesktopSessionAlgorithm() = default; + virtual QByteArray negotiationOutput() const = 0; + virtual bool encrypt(FreedesktopSecret &secret) const = 0; + virtual bool decrypt(FreedesktopSecret &secret) const = 0; +}; + +class KWalletFreedesktopSession : public QObject, protected QDBusContext +{ + Q_OBJECT + +public: + KWalletFreedesktopSession(class KWalletFreedesktopService *parent, + std::unique_ptr algorithm, + QString sessionPath, + const QDBusConnection &connection, + const QDBusMessage &message); + + KWalletFreedesktopService *fdoService() const; + + KSecretD *backend() const; + QDBusObjectPath fdoObjectPath() const; + + QByteArray negotiationOutput() const; + bool encrypt(const QDBusMessage &message, FreedesktopSecret &secret) const; + bool decrypt(const QDBusMessage &message, FreedesktopSecret &secret) const; + +private Q_SLOTS: + void slotServiceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner); + +private: + class KWalletFreedesktopService *m_service; + std::unique_ptr m_algorithm; + QString m_sessionPath; + QString m_serviceBusName; + QDBusServiceWatcher m_serviceWatcher; + + /* Freedesktop API */ + + /* org.freedesktop.Secret.Session methods */ +public Q_SLOTS: + void Close(); +}; + +class KWalletFreedesktopSessionAlgorithmPlain : public KWalletFreedesktopSessionAlgorithm +{ +public: + QByteArray negotiationOutput() const override; + bool encrypt(FreedesktopSecret &secret) const override; + bool decrypt(FreedesktopSecret &secret) const override; +}; + +class KWalletFreedesktopSessionAlgorithmDhAes : public KWalletFreedesktopSessionAlgorithm +{ +public: + KWalletFreedesktopSessionAlgorithmDhAes(const QCA::PublicKey &publicKey, QCA::SymmetricKey symmetricKey); + + static QByteArray normalizeUnsignedDhValue(QByteArray value); + static QCA::BigInteger decodeUnsignedDhValue(const QByteArray &value); + + QByteArray negotiationOutput() const override; + bool encrypt(FreedesktopSecret &secret) const override; + bool decrypt(FreedesktopSecret &secret) const override; + +private: + QCA::PublicKey m_publicKey; + QCA::SymmetricKey m_symmetricKey; +}; + +#endif diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletportalsecrets.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletportalsecrets.cpp new file mode 100644 index 0000000000..de2e5aa619 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletportalsecrets.cpp @@ -0,0 +1,88 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2023 Nicolas Fella + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "kwalletportalsecrets.h" + +#include "kwalletportalsecretsadaptor.h" + +#include + +KWalletPortalSecrets::KWalletPortalSecrets(KSecretD *parent) + : QObject(parent) + , m_kwalletd(parent) +{ + (void)new KWalletPortalSecretsAdaptor(this); + + QDBusConnection::sessionBus().registerObject(QStringLiteral("/org/freedesktop/portal/desktop"), this, QDBusConnection::ExportAdaptors); + QDBusConnection::sessionBus().registerService(QStringLiteral("org.freedesktop.impl.portal.desktop.kwallet")); + + connect(m_kwalletd, &KSecretD::walletAsyncOpened, this, &KWalletPortalSecrets::walletOpened); +} + +uint KWalletPortalSecrets::RetrieveSecret(const QDBusObjectPath &handle, + const QString &app_id, + const QDBusUnixFileDescriptor &fd, + const QVariantMap &options, + QVariantMap &results) +{ + Q_UNUSED(handle); + Q_UNUSED(options); + Q_UNUSED(results); + + setDelayedReply(true); + + const QString wallet = m_kwalletd->networkWallet(); + + int transactionId = m_kwalletd->openAsync(wallet, 0, "xdg-desktop-portal", false, connection(), message()); + Request request{message(), fd.fileDescriptor(), app_id}; + m_pendingRequests.insert(transactionId, request); + + return 0; +} + +void KWalletPortalSecrets::walletOpened(int transactionId, int walletHandle) +{ + if (!m_pendingRequests.contains(transactionId)) { + // wallet open request was not from us + return; + } + + const Request request = m_pendingRequests.take(transactionId); + + bool exists = m_kwalletd->hasEntry(walletHandle, "xdg-desktop-portal", request.appId, "xdg-desktop-portal"); + + QByteArray secret; + + if (exists) { + secret = m_kwalletd->readEntry(walletHandle, "xdg-desktop-portal", request.appId, "xdg-desktop-portal"); + } else { + secret = generateSecret(); + m_kwalletd->writeEntry(walletHandle, "xdg-desktop-portal", request.appId, secret, "xdg-desktop-portal"); + m_kwalletd->sync(walletHandle, "xdg-desktop-portal"); + } + + QFile outFile; + outFile.open(request.fd, QIODevice::ReadWrite); + + outFile.write(secret); + + const auto replyList = QVariantList{{(uint)0}, {{QVariantMap{}}}}; + auto reply = request.message.createReply(replyList); + QDBusConnection::sessionBus().send(reply); +} + +QByteArray KWalletPortalSecrets::generateSecret() const +{ + const int secretSize = 64; + QByteArray secret; + secret.resize(secretSize); + QRandomGenerator::securelySeeded().generate(secret.begin(), secret.end()); + + return secret; +} + +#include "moc_kwalletportalsecrets.cpp" diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletportalsecrets.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletportalsecrets.h new file mode 100644 index 0000000000..fed87312b5 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletportalsecrets.h @@ -0,0 +1,46 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2023 Nicolas Fella + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef KWALLETPORTALSECRETS_H +#define KWALLETPORTALSECRETS_H + +#include +#include +#include +#include + +#include "ksecretd.h" + +class KWalletPortalSecrets : public QObject, protected QDBusContext +{ + Q_OBJECT + +public: + KWalletPortalSecrets(KSecretD *parent); + +public Q_SLOTS: + uint + RetrieveSecret(const QDBusObjectPath &handle, const QString &app_id, const QDBusUnixFileDescriptor &fd, const QVariantMap &options, QVariantMap &results); + +private Q_SLOTS: + void walletOpened(int id, int handle); + +private: + struct Request { + QDBusMessage message; + int fd; + QString appId; + }; + + QByteArray generateSecret() const; + + QHash m_pendingRequests; + + KSecretD *m_kwalletd; +}; + +#endif diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletsessionstore.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletsessionstore.cpp new file mode 100644 index 0000000000..f9c9f4ef64 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletsessionstore.cpp @@ -0,0 +1,161 @@ +/* + This file is part of the KDE Wallet Daemon + SPDX-FileCopyrightText: 2008 Michael Leupold + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "kwalletsessionstore.h" + +class KWalletSessionStore::Session +{ +public: + QString m_service; // client dbus service (or empty) + int m_handle; // backend handle +}; + +KWalletSessionStore::KWalletSessionStore() +{ +} + +KWalletSessionStore::~KWalletSessionStore() +{ + for (const QList &l : std::as_const(m_sessions)) { + qDeleteAll(l); + } +} + +void KWalletSessionStore::addSession(const QString &appid, const QString &service, int handle) +{ + Session *sess = new Session(); + sess->m_service = service; + sess->m_handle = handle; + m_sessions[appid].append(sess); +} + +bool KWalletSessionStore::hasSession(const QString &appid, int handle) const +{ + if (!m_sessions.contains(appid)) { + return false; + } else if (handle == -1) { + return true; + } + + QList::const_iterator it; + QList::const_iterator end = m_sessions[appid].constEnd(); + for (it = m_sessions[appid].constBegin(); it != end; ++it) { + Q_ASSERT(*it); + if ((*it)->m_handle == handle) { + return true; + } + } + + return false; +} + +QList KWalletSessionStore::findSessions(const QString &service) const +{ + QList rc; + const QList sessionKeys(m_sessions.keys()); + for (const QString &appid : sessionKeys) { + const auto lst = m_sessions[appid]; + for (const Session *sess : lst) { + Q_ASSERT(sess); + if (sess->m_service == service) { + rc.append(qMakePair(appid, sess->m_handle)); + } + } + } + return rc; +} + +bool KWalletSessionStore::removeSession(const QString &appid, const QString &service, int handle) +{ + if (!m_sessions.contains(appid)) { + return false; + } + + QList::const_iterator it; + QList::const_iterator end = m_sessions[appid].constEnd(); + for (it = m_sessions[appid].constBegin(); it != end; ++it) { + Q_ASSERT(*it); + if ((*it)->m_service == service && (*it)->m_handle == handle) { + Session *sess = *it; + m_sessions[appid].removeAll(sess); + delete sess; + if (m_sessions[appid].isEmpty()) { + m_sessions.remove(appid); + } + return true; + } + } + + return false; +} + +int KWalletSessionStore::removeAllSessions(const QString &appid, int handle) +{ + if (!m_sessions.contains(appid)) { + return false; + } + + QList::iterator it; + QList::iterator end = m_sessions[appid].end(); + for (it = m_sessions[appid].begin(); it != end; ++it) { + Q_ASSERT(*it); + if ((*it)->m_handle == handle) { + delete *it; + *it = nullptr; + } + } + + int removed = m_sessions[appid].removeAll(nullptr); + if (m_sessions[appid].isEmpty()) { + m_sessions.remove(appid); + } + + return removed; +} + +int KWalletSessionStore::removeAllSessions(int handle) +{ + QList appremove; + int numrem = 0; + const QList sessionKeys(m_sessions.keys()); + for (const QString &appid : sessionKeys) { + QList::iterator it; + QList::iterator end = m_sessions[appid].end(); + for (it = m_sessions[appid].begin(); it != end; ++it) { + Q_ASSERT(*it); + if ((*it)->m_handle == handle) { + delete *it; + *it = nullptr; + numrem++; + } + } + // remove all zeroed sessions + m_sessions[appid].removeAll(nullptr); + if (m_sessions[appid].isEmpty()) { + appremove.append(appid); + } + } + + // now remove all applications without sessions + for (const QString &appid : std::as_const(appremove)) { + m_sessions.remove(appid); + } + + return numrem; +} + +QStringList KWalletSessionStore::getApplications(int handle) const +{ + QStringList rc; + const auto lst = m_sessions.keys(); + for (const QString &appid : lst) { + if (hasSession(appid, handle)) { + rc.append(appid); + } + } + return rc; +} diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletsessionstore.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletsessionstore.h new file mode 100644 index 0000000000..f959ea5b70 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletsessionstore.h @@ -0,0 +1,48 @@ +/* + This file is part of the KDE Wallet Daemon + SPDX-FileCopyrightText: 2008 Michael Leupold + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef _KWALLETSESSIONSTORE_H_ +#define _KWALLETSESSIONSTORE_H_ + +#include +#include +#include +#include +#include + +typedef QPair KWalletAppHandlePair; + +class KWalletSessionStore +{ +public: + KWalletSessionStore(); + ~KWalletSessionStore(); + + KWalletSessionStore(const KWalletSessionStore &) = delete; + KWalletSessionStore &operator=(const KWalletSessionStore &) = delete; + + // add a new session + void addSession(const QString &appid, const QString &service, int handle); + // check if the application has a session using that handle + bool hasSession(const QString &appid, int handle = -1) const; + // find all sessions a service has + QList findSessions(const QString &service) const; + // remove a specific session + bool removeSession(const QString &appid, const QString &service, int handle); + // remove all sessions an application has to a specific handle + int removeAllSessions(const QString &appid, int handle); + // remove all sessions related to a handle + int removeAllSessions(int handle); + // get all applications using a handle + QStringList getApplications(int handle) const; + +private: + class Session; + QHash> m_sessions; // appid => session +}; + +#endif // _KWALLETSESSIONSTORE_H_ diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizard.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizard.cpp new file mode 100644 index 0000000000..dd305492d7 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizard.cpp @@ -0,0 +1,317 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2004 George Staikos + + SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#include "kwalletwizard.h" + +#include "ui_kwalletwizardpageexplanation.h" +#include "ui_kwalletwizardpageintro.h" +#include "ui_kwalletwizardpageoptions.h" +#include "ui_kwalletwizardpagepassword.h" +#ifdef HAVE_GPGMEPP +#include "ui_kwalletwizardpagegpgkey.h" +#include "ui_kwalletwizardpagepasswordgpg.h" +#endif + +#include +#include +#include +#include + +#ifdef HAVE_GPGMEPP +#include +#include +#include +#include +#include +#endif + +class PageIntro : public QWizardPage +{ +public: + explicit PageIntro(QWidget *parent) + : QWizardPage(parent) + { + ui.setupUi(this); + + ui.ktitlewidget->setText("

" + i18n("KWallet") + "

"); + ui.ktitlewidget->setIcon(QIcon::fromTheme(QStringLiteral("kwalletmanager"))); + + bg = new QButtonGroup(this); + bg->setExclusive(true); + bg->addButton(ui._basic, 0); + bg->addButton(ui._advanced, 1); + + // force the "basic" button to be selected + ui._basic->setChecked(true); + } + + QButtonGroup *bg; + +private: + Ui::KWalletWizardPageIntro ui; +}; + +class PagePassword : public QWizardPage +{ +public: + explicit PagePassword(KWalletWizard *parent) + : QWizardPage(parent) + { + ui.setupUi(this); + + registerField(QStringLiteral("useWallet"), ui._useWallet); + registerField(QStringLiteral("pass1"), ui._pass1); + registerField(QStringLiteral("pass2"), ui._pass2); +#ifdef HAVE_GPGMEPP + registerField(QStringLiteral("useGPG"), ui._radioGpg); + registerField(QStringLiteral("useBlowfish"), ui._radioBlowfish); + connect(ui._radioBlowfish, &QRadioButton::toggled, parent, &KWalletWizard::passwordPageUpdate); +#endif + + connect(ui._useWallet, &QCheckBox::clicked, parent, &KWalletWizard::passwordPageUpdate); + connect(ui._pass1, &QLineEdit::textChanged, parent, &KWalletWizard::passwordPageUpdate); + connect(ui._pass2, &QLineEdit::textChanged, parent, &KWalletWizard::passwordPageUpdate); + ui._useWallet->setChecked(true); + } + + int nextId() const override + { +#ifdef HAVE_GPGMEPP + int nextId = -1; + if (field(QStringLiteral("useWallet")).toBool()) { + if (field(QStringLiteral("useBlowfish")).toBool()) { + nextId = static_cast(wizard())->wizardType() == KWalletWizard::Basic + ? -1 + : KWalletWizard::PageOptionsId; // same as non GPGMEPP case + } else { + nextId = KWalletWizard::PageGpgKeyId; + } + } + + return nextId; +#else + return static_cast(wizard())->wizardType() == KWalletWizard::Basic ? -1 : KWalletWizard::PageOptionsId; +#endif + } + + void setMatchLabelText(const QString &text) + { + ui._matchLabel->setText(text); + } + +private: +#ifdef HAVE_GPGMEPP + Ui::KWalletWizardPagePasswordGpg ui; +#else + Ui::KWalletWizardPagePassword ui; +#endif +}; + +#ifdef HAVE_GPGMEPP +typedef std::vector KeysVector; +Q_DECLARE_METATYPE(GpgME::Key) + +struct AddKeyToCombo { + QComboBox *_list; + AddKeyToCombo(QComboBox *list) + : _list(list) + { + } + void operator()(const GpgME::Key &k) + { + QString text = QStringLiteral("%1 (%2)").arg(k.shortKeyID(), k.userID(0).email()); + QVariant varKey; + varKey.setValue(k); + _list->addItem(text, varKey); + } +}; + +class PageGpgKey : public QWizardPage +{ +public: + explicit PageGpgKey(QWidget *parent) + : QWizardPage(parent) + , userHasGpgKeys(false) + { + ui.setupUi(this); + + registerField(QStringLiteral("gpgKey"), ui._gpgKey); + + KeysVector keys; + GpgME::initializeLibrary(); + GpgME::Error err = GpgME::checkEngine(GpgME::OpenPGP); + if (err) { + qDebug() << "OpenPGP not supported on your system!"; + KMessageBox::error( + this, + i18n("The GpgME library failed to initialize for the OpenPGP protocol. Please check your system's configuration then try again.")); + } else { + std::shared_ptr ctx(GpgME::Context::createForProtocol(GpgME::OpenPGP)); + if (nullptr == ctx) { + KMessageBox::error( + this, + i18n("The GpgME library failed to initialize for the OpenPGP protocol. Please check your system's configuration then try again.")); + } else { + ctx->setKeyListMode(GpgME::KeyListMode::Local); + err = ctx->startKeyListing(); + while (!err) { + GpgME::Key k = ctx->nextKey(err); + if (err) { + break; + } + if (!k.isInvalid() && k.canEncrypt() && (k.ownerTrust() == GpgME::Key::Ultimate)) { + keys.push_back(k); + } + } + ctx->endKeyListing(); + } + } + std::for_each(keys.begin(), keys.end(), AddKeyToCombo(ui._gpgKey)); + + userHasGpgKeys = keys.size() > 0; + if (userHasGpgKeys) { + ui.stackedWidget->setCurrentWidget(ui._pageWhenHasKeys); + } else { + ui.stackedWidget->setCurrentWidget(ui._pageNoKeys); + setFinalPage(true); + } + Q_EMIT completeChanged(); + } + + int nextId() const override + { + return static_cast(wizard())->wizardType() == KWalletWizard::Basic ? -1 : KWalletWizard::PageOptionsId; + } + + bool isComplete() const override + { + return userHasGpgKeys; + } + + bool hasGpgKeys() const + { + return userHasGpgKeys; + } + + GpgME::Key gpgKey() const + { + QVariant varKey = ui._gpgKey->itemData(field(QStringLiteral("gpgKey")).toInt()); + return varKey.value(); + } + +private: + Ui::KWalletWizardPageGpgKey ui; + bool userHasGpgKeys; +}; +#endif + +class PageOptions : public QWizardPage +{ +public: + explicit PageOptions(QWidget *parent) + : QWizardPage(parent) + { + ui.setupUi(this); + + registerField(QStringLiteral("closeWhenIdle"), ui._closeIdle); + registerField(QStringLiteral("networkWallet"), ui._networkWallet); + } + +private: + Ui::KWalletWizardPageOptions ui; +}; + +class PageExplanation : public QWizardPage +{ +public: + PageExplanation(QWidget *parent) + : QWizardPage(parent) + { + ui.setupUi(this); + setFinalPage(true); + } + +private: + Ui::KWalletWizardPageExplanation ui; +}; + +KWalletWizard::KWalletWizard(QWidget *parent) + : QWizard(parent) +{ + setOption(HaveFinishButtonOnEarlyPages); + + m_pageIntro = new PageIntro(this); + setPage(PageIntroId, m_pageIntro); + m_pagePasswd = new PagePassword(this); + setPage(PagePasswordId, m_pagePasswd); +#ifdef HAVE_GPGMEPP + m_pageGpgKey = new PageGpgKey(this); + setPage(PageGpgKeyId, m_pageGpgKey); +#endif + setPage(PageOptionsId, new PageOptions(this)); + setPage(PageExplanationId, new PageExplanation(this)); + + resize(500, 420); +} + +void KWalletWizard::passwordPageUpdate() +{ + bool complete = true; + if (field(QStringLiteral("useWallet")).toBool()) { +#ifdef HAVE_GPGMEPP + if (field(QStringLiteral("useBlowfish")).toBool()) { + m_pagePasswd->setFinalPage(wizardType() == Basic); + button(NextButton)->setVisible(wizardType() != Basic); +#endif + if (field(QStringLiteral("pass1")).toString() == field(QStringLiteral("pass2")).toString()) { + if (field(QStringLiteral("pass1")).toString().isEmpty()) { + m_pagePasswd->setMatchLabelText(i18n("Password is empty. (WARNING: Insecure)")); + } else { + m_pagePasswd->setMatchLabelText(i18n("Passwords match.")); + } + } else { + m_pagePasswd->setMatchLabelText(i18n("Passwords do not match.")); + complete = false; + } +#ifdef HAVE_GPGMEPP + } else { + m_pagePasswd->setFinalPage(false); + button(NextButton)->setEnabled(true); + return; + } +#endif + } else { + m_pagePasswd->setMatchLabelText(QString()); + } + button(wizardType() == Basic ? FinishButton : NextButton)->setEnabled(complete); +} + +KWalletWizard::WizardType KWalletWizard::wizardType() const +{ + return (KWalletWizard::WizardType)m_pageIntro->bg->checkedId(); +} + +void KWalletWizard::initializePage(int id) +{ + switch (id) { + case PagePasswordId: { + bool islast = m_pageIntro->bg->checkedId() == 0; + m_pagePasswd->setFinalPage(islast); + button(NextButton)->setVisible(!islast); + break; + } + } +} + +#ifdef HAVE_GPGMEPP +GpgME::Key KWalletWizard::gpgKey() const +{ + return m_pageGpgKey->gpgKey(); +} +#endif + +#include "moc_kwalletwizard.cpp" diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizard.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizard.h new file mode 100644 index 0000000000..76c38e7b51 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizard.h @@ -0,0 +1,60 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2004 George Staikos + + SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#ifndef KWALLETWIZARD_H +#define KWALLETWIZARD_H + +#include +#ifdef HAVE_GPGMEPP +#include +#endif + +class PageGpgKey; +class PagePassword; +class PageIntro; + +class KWalletWizard : public QWizard +{ + Q_OBJECT +public: + enum WizardType { + Basic, + Advanced + }; + + static const int PageIntroId = 0; + static const int PagePasswordId = 1; +#ifdef HAVE_GPGMEPP + static const int PageGpgKeyId = 2; +#endif + static const int PageOptionsId = 3; + static const int PageExplanationId = 4; + + explicit KWalletWizard(QWidget *parent = nullptr); + + WizardType wizardType() const; + +#ifdef HAVE_GPGMEPP + GpgME::Key gpgKey() const; +#endif // HAVE_GPGMEPP + +protected: + void initializePage(int id) override; + +protected Q_SLOTS: + friend class PagePassword; + void passwordPageUpdate(); + +private: + PageIntro *m_pageIntro; + PagePassword *m_pagePasswd; +#ifdef HAVE_GPGMEPP + PageGpgKey *m_pageGpgKey; +#endif +}; + +#endif diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizardpageexplanation.ui b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizardpageexplanation.ui new file mode 100644 index 0000000000..d07b79f6f1 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizardpageexplanation.ui @@ -0,0 +1,31 @@ + + + KWalletWizardPageExplanation + + + + 0 + 0 + 478 + 215 + + + + + + + <html><head/><body><p>The KDE Wallet system stores your data in a <span style=" font-style:italic;">wallet</span> file on your local hard disk. The data is only written in the encrypted form of your choice - blowfish algorithm with your password as the key or using a GPG encryption key. When a wallet is opened, the wallet manager application will launch and display an icon in the system tray. You can use this application to manage all of your wallets. It even permits you to drag wallets and wallet contents, allowing you to easily copy a wallet to a remote system.</p></body></html> + + + Qt::RichText + + + true + + + + + + + + diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizardpagegpgkey.ui b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizardpagegpgkey.ui new file mode 100644 index 0000000000..a01452deee --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizardpagegpgkey.ui @@ -0,0 +1,96 @@ + + + KWalletWizardPageGpgKey + + + + 0 + 0 + 436 + 309 + + + + + + + 0 + + + + + + + <html><head/><body><p>The GPG-based wallet use a GPG encryption key to securely encrypt data on disk. The key must be available when decrypting is needed or your wallet will not be accessible. For example, if you choose a SmartCard-based encryption key, the GPG system will prompt you to enter it and its associated PIN when attempting to open the wallet. <span style=" font-weight:600;">NOTE:</span> this list contains only &quot;ultimate-level&quot; trusted keys.</p></body></html> + + + Qt::AutoText + + + true + + + + + + + + + true + + + Select encryption GPG key: + + + + + + + true + + + + + + + + + Qt::Vertical + + + + 20 + 173 + + + + + + + + + + + + + 0 + 0 + + + + Unable to locate at least one <b>encrypting GPG key</b>. KDE Wallet needs such <b>encrypting key</b> to securely store passwords or other sensitive data on disk. If you still want to setup a GPG-based wallet, then cancel this wizard, set-up an <b>encrypting GPG key</b>, then retry this assistant. Otherwise, you may still click back, then choose a classic, blowfish encrypted file format on the previous page. + + + true + + + + + + + + + + + + diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizardpageintro.ui b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizardpageintro.ui new file mode 100644 index 0000000000..af8c2181ff --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizardpageintro.ui @@ -0,0 +1,127 @@ + + + KWalletWizardPageIntro + + + + 0 + 0 + 449 + 327 + + + + + + + The KDE Wallet System + + + + + + + + 0 + 0 + + + + Welcome to KWallet, the KDE Wallet System. KWallet allows you to store your passwords and other personal information on disk in an encrypted file, preventing others from viewing the information. This wizard will tell you about KWallet and help you configure it for the first time. + + + Qt::RichText + + + Qt::AlignVCenter + + + true + + + 12 + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + + + &Basic setup (recommended) + + + true + + + + + + + &Advanced setup + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 21 + 21 + + + + + + + + + KTitleWidget + QWidget +
ktitlewidget.h
+
+
+ + +
diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizardpageoptions.ui b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizardpageoptions.ui new file mode 100644 index 0000000000..0defc878a4 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizardpageoptions.ui @@ -0,0 +1,79 @@ + + KWalletWizardPageOptions + + + + 0 + 0 + 436 + 214 + + + + + + + The KDE Wallet system allows you to control the level of security of your personal data. Some of these settings do impact usability. While the default settings are generally acceptable for most users, you may wish to change some of them. You may further tune these settings from the KWallet control module. + + + Qt::RichText + + + Qt::AlignVCenter + + + true + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 21 + 10 + + + + + + + + Automatically close idle wallets + + + + + + + Store network passwords and local passwords in separate wallet files + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 21 + 10 + + + + + + + + + diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizardpagepassword.ui b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizardpagepassword.ui new file mode 100644 index 0000000000..5781395e0e --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizardpagepassword.ui @@ -0,0 +1,282 @@ + + KWalletWizardPagePassword + + + + 0 + 0 + 526 + 401 + + + + + + + Various applications may attempt to use the KDE wallet to store passwords or other information such as web form data and cookies. If you would like these applications to use the wallet, you must enable it now and choose a password. The password you choose <i>cannot</i> be recovered if it is lost, and will allow anyone who knows it to obtain all the information contained in the wallet. + + + Qt::RichText + + + true + + + + + + + Yes, I wish to use the KDE wallet to store my personal information. + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 21 + 51 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 111 + 31 + + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + false + + + Enter a new password: + + + Qt::AlignAbsolute|Qt::AlignBottom|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignHorizontal_Mask|Qt::AlignJustify|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing|Qt::AlignVCenter|Qt::AlignVertical_Mask + + + _pass1 + + + + + + + false + + + Verify password: + + + Qt::AlignAbsolute|Qt::AlignBottom|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignHorizontal_Mask|Qt::AlignJustify|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing|Qt::AlignVCenter|Qt::AlignVertical_Mask + + + _pass2 + + + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + false + + + QLineEdit::Password + + + + + + + false + + + QLineEdit::Password + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 101 + 21 + + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 21 + 70 + + + + + + + + + + + Qt::AlignAbsolute|Qt::AlignBottom|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignHorizontal_Mask|Qt::AlignJustify|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing|Qt::AlignVCenter|Qt::AlignVertical_Mask + + + + + + + + + _useWallet + toggled(bool) + textLabel1_3 + setEnabled(bool) + + + 108 + 119 + + + 217 + 226 + + + + + _useWallet + toggled(bool) + _pass1 + setEnabled(bool) + + + 455 + 125 + + + 394 + 226 + + + + + _useWallet + toggled(bool) + textLabel2_3 + setEnabled(bool) + + + 60 + 120 + + + 131 + 257 + + + + + _useWallet + toggled(bool) + _pass2 + setEnabled(bool) + + + 487 + 124 + + + 371 + 257 + + + + + _useWallet + clicked() + _pass1 + setFocus() + + + 259 + 119 + + + 269 + 237 + + + + + diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizardpagepasswordgpg.ui b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizardpagepasswordgpg.ui new file mode 100644 index 0000000000..765557630e --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/kwalletwizardpagepasswordgpg.ui @@ -0,0 +1,345 @@ + + + KWalletWizardPagePasswordGpg + + + + 0 + 0 + 448 + 385 + + + + + + + <html><head/><body><p>Various applications may attempt to use the KDE wallet to store passwords or other information such as web form data and cookies. If you would like these applications to use the wallet, you must enable it now and choose method for its encryption.</p><p>GPG method is more secure, but you must have configured at least one encrypting key on your system.</p><p>If you choose the classic format, be warned that the password you choose <span style=" font-style:italic;">cannot</span> be recovered if it is lost, and will allow anyone who knows it to obtain all the information contained in the wallet.</p></body></html> + + + Qt::RichText + + + true + + + + + + + Yes, I wish to use the KDE wallet to store my personal information. + + + + + + + false + + + + 0 + 0 + + + + What kind of encryption do you wish? + + + + + + false + + + Use GPG encryption, for better protection + + + true + + + + + + + false + + + Classic, blowfish encrypted file + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 28 + 28 + + + + + + + + + + 6 + + + 0 + + + + + false + + + Enter a new password: + + + Qt::AlignAbsolute|Qt::AlignBottom|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignHorizontal_Mask|Qt::AlignJustify|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing|Qt::AlignVCenter|Qt::AlignVertical_Mask + + + _pass1 + + + + + + + false + + + Verify password: + + + Qt::AlignAbsolute|Qt::AlignBottom|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignHorizontal_Mask|Qt::AlignJustify|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing|Qt::AlignVCenter|Qt::AlignVertical_Mask + + + _pass2 + + + + + + + + + 6 + + + 0 + + + + + false + + + QLineEdit::Password + + + + + + + false + + + QLineEdit::Password + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 98 + 18 + + + + + + + + + + + + + Qt::AlignAbsolute|Qt::AlignBottom|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignHorizontal_Mask|Qt::AlignJustify|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing|Qt::AlignVCenter|Qt::AlignVertical_Mask + + + + + + + Qt::Vertical + + + + 20 + 31 + + + + + + + + + + + + + + + _radioBlowfish + toggled(bool) + textLabel1_3 + setEnabled(bool) + + + 239 + 220 + + + 213 + 249 + + + + + _radioBlowfish + toggled(bool) + _pass1 + setEnabled(bool) + + + 239 + 220 + + + 331 + 249 + + + + + _radioBlowfish + toggled(bool) + textLabel2_3 + setEnabled(bool) + + + 239 + 220 + + + 142 + 277 + + + + + _radioBlowfish + toggled(bool) + _pass2 + setEnabled(bool) + + + 239 + 220 + + + 331 + 277 + + + + + _radioBlowfish + clicked() + _pass1 + setFocus() + + + 239 + 220 + + + 331 + 249 + + + + + _useWallet + toggled(bool) + _groupBox + setEnabled(bool) + + + 42 + 112 + + + 33 + 193 + + + + + _useWallet + toggled(bool) + _radioGpg + setEnabled(bool) + + + 50 + 112 + + + 63 + 166 + + + + + _useWallet + toggled(bool) + _radioBlowfish + setEnabled(bool) + + + 85 + 112 + + + 97 + 220 + + + + + diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/main.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/main.cpp new file mode 100644 index 0000000000..3fa6f3efb3 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/main.cpp @@ -0,0 +1,213 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2008 Michael Leupold + SPDX-FileCopyrightText: 2014 Alex Fiestas + + SPDX-License-Identifier: LGPL-2.0-only +*/ + +#include "ksecretd_debug.h" +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "../kwalletbackend/kwalletbackend.h" //For the hash size +#include "ksecretd.h" +#include "ksecretd_version.h" +#include "kwalletfreedesktopservice.h" + +#ifndef Q_OS_WIN +#include +#include +#include +#include + +#define BSIZE 1000 +static int pipefd = 0; +static int socketfd = 0; +#endif + +#ifndef Q_OS_WIN +// Waits until the PAM_MODULE sends the hash +static char *waitForHash() +{ + qCDebug(KSECRETD_LOG) << "ksecretd5: Waiting for hash on" << pipefd; + int totalRead = 0; + int readBytes = 0; + int attempts = 0; + char *buf = (char *)malloc(sizeof(char) * PBKDF2_SHA512_KEYSIZE); + memset(buf, '\0', PBKDF2_SHA512_KEYSIZE); + while (totalRead != PBKDF2_SHA512_KEYSIZE) { + readBytes = read(pipefd, buf + totalRead, PBKDF2_SHA512_KEYSIZE - totalRead); + if (readBytes == -1 || attempts > 5) { + free(buf); + return nullptr; + } + totalRead += readBytes; + ++attempts; + } + + close(pipefd); + return buf; +} + +// Waits until startkde sends the environment variables +static int waitForEnvironment() +{ + qCDebug(KSECRETD_LOG) << "ksecretd5: waitingForEnvironment on:" << socketfd; + + int s2; + struct sockaddr_un remote; + socklen_t t = sizeof(remote); + if ((s2 = accept(socketfd, (struct sockaddr *)&remote, &t)) == -1) { + qCWarning(KSECRETD_LOG) << "ksecretd5: Couldn't accept incoming connection"; + return -1; + } + qCDebug(KSECRETD_LOG) << "ksecretd5: client connected"; + + char str[BSIZE] = {'\0'}; + + int chop = 0; + FILE *s3 = fdopen(dup(s2), "r"); + while (!feof(s3)) { + if (fgets(str, BSIZE, s3)) { + chop = strlen(str) - 1; + if (str[chop] == '\n') { + str[chop] = '\0'; + } + putenv(strdup(str)); + } + } + fclose(s3); + + qCDebug(KSECRETD_LOG) << "ksecretd5: client disconnected"; + close(socketfd); + return 1; +} + +char *checkPamModule(int argc, char **argv) +{ + qCDebug(KSECRETD_LOG) << "ksecretd5: Checking for pam module"; + char *hash = nullptr; + int x = 1; + for (; x < argc; ++x) { + if (strcmp(argv[x], "--pam-login") != 0) { + continue; + } + qCDebug(KSECRETD_LOG) << "ksecretd5: Got pam-login param"; + argv[x] = nullptr; + x++; + // We need at least 2 extra arguments after --pam-login + if (x + 1 > argc) { + qCWarning(KSECRETD_LOG) << "ksecretd5: Invalid arguments (less than needed)"; + return nullptr; + } + + // first socket for the hash, comes from a pipe + pipefd = atoi(argv[x]); + argv[x] = nullptr; + x++; + // second socket for environment, comes from a localsocket + socketfd = atoi(argv[x]); + argv[x] = nullptr; + break; + } + + if (!pipefd || !socketfd) { + qCWarning(KSECRETD_LOG) << "Lacking a socket, pipe:" << pipefd << "env:" << socketfd; + return nullptr; + } + + hash = waitForHash(); + + if (hash == nullptr || waitForEnvironment() == -1) { + qCWarning(KSECRETD_LOG) << "ksecretd5: Hash or environment not received"; + free(hash); + return nullptr; + } + + return hash; +} +#endif + +int main(int argc, char **argv) +{ + char *hash = nullptr; +#ifndef Q_OS_WIN + if (getenv("PAM_KWALLET5_LOGIN")) { + hash = checkPamModule(argc, argv); + } +#endif + + QCoreApplication::setAttribute(Qt::AA_DisableSessionManager); + QApplication app(argc, argv); + app.setWindowIcon(QIcon::fromTheme(QStringLiteral("kwalletmanager"))); + + // this ksecretd5 program should be able to start with KDE4's ksecretd + // using ksecretd name would prevent KDBusService unique instance to initialize + // so we setApplicationName("ksecretd6") + KAboutData aboutdata("ksecretd", + i18n("KDE Wallet Service"), + KSECRETD_VERSION_STRING, + i18n("KDE Wallet Service"), + KAboutLicense::LGPL, + i18n("(C) 2002-2025, The KDE Developers")); + aboutdata.addAuthor(i18n("Valentin Rusu"), i18n("Former Maintainer, GPG backend support"), QStringLiteral("kde@rusu.info")); + aboutdata.addAuthor(i18n("Michael Leupold"), i18n("Former Maintainer"), QStringLiteral("lemma@confuego.org")); + aboutdata.addAuthor(i18n("George Staikos"), i18n("Former maintainer"), QStringLiteral("staikos@kde.org")); + aboutdata.addAuthor(i18n("Thiago Maceira"), i18n("D-Bus Interface"), QStringLiteral("thiago@kde.org")); + + KAboutData::setApplicationData(aboutdata); + + KCrash::initialize(); + + // BUG 509680: When launched by PAM (hash != nullptr), use Replace so that + // if a premature D-Bus-activated instance grabbed the bus name, the PAM + // instance takes over (it has the password hash for auto-unlock). + KDBusService dbusUniqueInstance(hash + ? (KDBusService::Unique | KDBusService::Replace) + : KDBusService::Unique); + + // NOTE: the command should be parsed only after KDBusService instantiation + QCommandLineParser cmdParser; + aboutdata.setupCommandLine(&cmdParser); + cmdParser.process(app); + + app.setQuitOnLastWindowClosed(false); + + // check if kwallet is disabled + if (!KSecretD::isEnabled()) { + qCDebug(KSECRETD_LOG) << "ksecretd is disabled!"; + + /* Do not keep dbus-daemon waiting for the org.freedesktop.secrets if kwallet is disabled */ + KWalletFreedesktopService(nullptr); + + return (-1); + } + + KSecretD secretd; + qCDebug(KSECRETD_LOG) << "ksecretd6 started"; + + if (hash) { + QByteArray passHash(hash, PBKDF2_SHA512_KEYSIZE); + int wallet = secretd.pamOpen(KWallet::Wallet::LocalWallet(), passHash, 0); + if (wallet < 0) { + qCWarning(KSECRETD_LOG) << "Wallet failed to get opened by PAM, error code is" << wallet; + } else { + qCDebug(KSECRETD_LOG) << "Wallet opened by PAM"; + } + free(hash); + } + + return app.exec(); +} diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/org.freedesktop.impl.portal.desktop.kwallet.service.in b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/org.freedesktop.impl.portal.desktop.kwallet.service.in new file mode 100644 index 0000000000..a82cb1469c --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/org.freedesktop.impl.portal.desktop.kwallet.service.in @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.freedesktop.impl.portal.desktop.kwallet +Exec=@KDE_INSTALL_FULL_BINDIR@/ksecretd diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/org.kde.ksecretd.desktop b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/org.kde.ksecretd.desktop new file mode 100644 index 0000000000..ca05f0f5a5 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/org.kde.ksecretd.desktop @@ -0,0 +1,52 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +[Desktop Entry] +Type=Application +Exec=ksecretd +Name=KDE Wallet Service +Name[ar]=خدمة حافظة كِيدِي +Name[az]=KDE Cüzdanı Xidməti +Name[bg]=Услуга Портфейл на KDE +Name[ca]=Servei de carteres de KDE +Name[ca@valencia]=Servei de carteres de KDE +Name[cs]=Služba úschovny KDE +Name[de]=KDE-Dienst für Passwortspeicher +Name[el]=Υπηρεσία πορτοφολιού του KDE +Name[en_GB]=KDE Wallet Service +Name[eo]=Trezoreja Servilo de KDE +Name[es]=Servicio de carteras de KDE +Name[eu]=KDEren zorro-zerbitzua +Name[fi]=KDE:n lompakkopalvelin +Name[fr]=Serveur de portefeuilles de KDE +Name[ga]=Seirbhís Sparáin KDE +Name[gl]=Servizo de carteiras de KDE +Name[he]=שירות הארנק של KDE +Name[hu]=KDE jelszókezelő szolgáltatás +Name[ia]=Servicio de Portafolio de KDE +Name[is]=KDE Wallet-þjónusta +Name[it]=Servizio portafogli di KDE +Name[ka]=KDE-ის საფულის სერვისი +Name[ko]=KDE 지갑 서비스 +Name[lt]=KDE slaptažodinės tarnyba +Name[lv]=KDE maka serviss +Name[nl]=KDE Portefeuilleservice +Name[nn]=KDE Lommebok-teneste +Name[pa]=KDE ਵਾਲਟ ਸਰਵਿਸ +Name[pl]=Usługa Portfela KDE +Name[pt]=Serviço da Carteira do KDE +Name[pt_BR]=Serviço de carteiras do KDE +Name[ro]=Serviciul de portofel KDE +Name[ru]=Служба бумажника KDE +Name[sa]=केडीई बटुआ सेवा +Name[sk]=Služba KDE Wallet +Name[sl]=Storitev KDE listnice +Name[sv]=KDE:s plånbokstjänst +Name[tr]=KDE Cüzdan Hizmeti +Name[ug]=KDE ھەميان مۇلازىمىتى +Name[uk]=Служба торбинок KDE +Name[vi]=Dịch vụ Ví KDE +Name[zh_CN]=KDE 密码库服务 +Name[zh_TW]=KDE 錢包伺服器 +NoDisplay=true +Icon=kwalletmanager diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/org.kde.kwalletd5.service.win.in b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/org.kde.kwalletd5.service.win.in new file mode 100644 index 0000000000..a9e6ae147d --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/org.kde.kwalletd5.service.win.in @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.kde.kwalletd5 +Exec=ksecretd diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/org.kde.kwalletd6.service.win.in b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/org.kde.kwalletd6.service.win.in new file mode 100644 index 0000000000..3bee931372 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/org.kde.kwalletd6.service.win.in @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.kde.kwalletd6 +Exec=ksecretd diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/org.kde.secretservicecompat.service.in b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/org.kde.secretservicecompat.service.in new file mode 100644 index 0000000000..2f2d714d68 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/ksecretd/org.kde.secretservicecompat.service.in @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.kde.secretservicecompat +Exec=@KDE_INSTALL_FULL_BINDIR@/ksecretd diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/CMakeLists.txt b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/CMakeLists.txt new file mode 100644 index 0000000000..63d11b30b6 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/CMakeLists.txt @@ -0,0 +1,88 @@ +add_definitions(-DTRANSLATION_DOMAIN="kwalletd6") + +include(CheckIncludeFiles) +include(GenerateExportHeader) + +########### Configure checks for kwalletbackend ############### + +check_include_files(stdint.h HAVE_STDINT_H) +check_include_files(sys/bitypes.h HAVE_SYS_BITYPES_H) +if (Gpgmepp_FOUND) + add_definitions(-DHAVE_GPGMEPP) + add_definitions(-DBOOST_NO_EXCEPTIONS) +endif(Gpgmepp_FOUND) + +configure_file (config-kwalletbackend.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kwalletbackend.h ) + +########### kwalletbackend ############### +find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Widgets DBus) +find_package(KF6CoreAddons ${KF_DEP_VERSION} REQUIRED) +find_package(KF6I18n ${KF_DEP_VERSION} REQUIRED) +find_package(KF6Notifications ${KF_DEP_VERSION} REQUIRED) +find_package(KF6WidgetsAddons ${KF_DEP_VERSION} REQUIRED) +find_package(KF6Config ${KF_DEP_VERSION} REQUIRED) + +find_package(LibGcrypt 1.5.0 REQUIRED) +set_package_properties(LibGcrypt PROPERTIES + TYPE REQUIRED + PURPOSE "kwalletd needs libgcrypt to perform PBKDF2-SHA512 hashing" + ) + +ecm_setup_version(${KF_VERSION} VARIABLE_PREFIX KWALLETBACKEND SOVERSION 6) + +add_library(KF6WalletBackend SHARED) + +set_target_properties(KF6WalletBackend PROPERTIES + VERSION ${KWALLETBACKEND_VERSION} + SOVERSION ${KWALLETBACKEND_SOVERSION} +) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../api/KWallet) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/../../api/KWallet) +include_directories(${LIBGCRYPT_INCLUDE_DIRS}) + +remove_definitions(-DQT_NO_CAST_FROM_ASCII) + +target_sources(KF6WalletBackend PRIVATE + blockcipher.cc + blowfish.cc + cbc.cc + sha1.cc + kwalletentry.cc + kwalletbackend.cc + backendpersisthandler.cpp +) +ecm_qt_declare_logging_category(KF6WalletBackend + HEADER kwalletbackend_debug.h + IDENTIFIER KWALLETBACKEND_LOG + CATEGORY_NAME kf.wallet.backend + OLD_CATEGORY_NAMES kf5.kwallet.kwalletbackend + DESCRIPTION "kwalletbackend" + EXPORT KWALLET +) + + +generate_export_header(KF6WalletBackend + BASE_NAME kwalletbackend +) + +target_link_libraries(KF6WalletBackend + Qt6::Widgets + KF6::WidgetsAddons + KF6::CoreAddons + KF6::Notifications + KF6::I18n + ${LIBGCRYPT_LIBRARIES} +) +if(Gpgmepp_FOUND) + target_link_libraries(KF6WalletBackend Gpgmepp) +endif(Gpgmepp_FOUND) + +# link with advapi32 on windows +if(WIN32 AND NOT WINCE) + target_link_libraries(KF6WalletBackend advapi32) +endif(WIN32 AND NOT WINCE) + +install(TARGETS KF6WalletBackend ${KF_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP) + +add_subdirectory(tests) diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/backendpersisthandler.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/backendpersisthandler.cpp new file mode 100644 index 0000000000..db6c0c6f52 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/backendpersisthandler.cpp @@ -0,0 +1,669 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2013 Valentin Rusu + + SPDX-License-Identifier: LGPL-2.0-only +*/ + +#include "backendpersisthandler.h" +#include "kwalletbackend_debug.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_GPGMEPP +#include +#include +#include +#include +#include +#include +#endif +#include "blowfish.h" +#include "cbc.h" +#include "kwalletbackend.h" +#include "sha1.h" + +#define KWALLET_CIPHER_BLOWFISH_ECB 0 // this was the old KWALLET_CIPHER_BLOWFISH_CBC +#define KWALLET_CIPHER_3DES_CBC 1 // unsupported +#define KWALLET_CIPHER_GPG 2 +#define KWALLET_CIPHER_BLOWFISH_CBC 3 + +#define KWALLET_HASH_SHA1 0 +#define KWALLET_HASH_MD5 1 // unsupported +#define KWALLET_HASH_PBKDF2_SHA512 2 // used when using kwallet with pam or since 4.13 version + +namespace KWallet +{ +typedef char Digest[16]; + +BackendPersistHandler *BackendPersistHandler::getPersistHandler(BackendCipherType cipherType) +{ + switch (cipherType) { + case BACKEND_CIPHER_BLOWFISH: + return new BlowfishPersistHandler; +#ifdef HAVE_GPGMEPP + case BACKEND_CIPHER_GPG: + return new GpgPersistHandler; +#endif // HAVE_GPGMEPP + default: + Q_ASSERT(0); + return nullptr; + } +} + +BackendPersistHandler *BackendPersistHandler::getPersistHandler(char magicBuf[12]) +{ + if ((magicBuf[2] == KWALLET_CIPHER_BLOWFISH_ECB || magicBuf[2] == KWALLET_CIPHER_BLOWFISH_CBC) + && (magicBuf[3] == KWALLET_HASH_SHA1 || magicBuf[3] == KWALLET_HASH_PBKDF2_SHA512)) { + bool useECBforReading = magicBuf[2] == KWALLET_CIPHER_BLOWFISH_ECB; + if (useECBforReading) { + qCDebug(KWALLETBACKEND_LOG) << "this wallet uses ECB encryption. It'll be converted to CBC on next save."; + } + return new BlowfishPersistHandler(useECBforReading); + } +#ifdef HAVE_GPGMEPP + if (magicBuf[2] == KWALLET_CIPHER_GPG && magicBuf[3] == 0) { + return new GpgPersistHandler; + } +#endif // HAVE_GPGMEPP + return nullptr; // unknown cipher or hash +} + +int BlowfishPersistHandler::write(Backend *wb, QSaveFile &sf, QByteArray &version, WId) +{ + assert(wb->_cipherType == BACKEND_CIPHER_BLOWFISH); + + if (_useECBforReading) { + qCDebug(KWALLETBACKEND_LOG) << "This wallet used ECB and is now saved using CBC"; + _useECBforReading = false; + } + + version[2] = KWALLET_CIPHER_BLOWFISH_CBC; + if (!wb->_useNewHash) { + version[3] = KWALLET_HASH_SHA1; + } else { + version[3] = KWALLET_HASH_PBKDF2_SHA512; // Since 4.13 we always use PBKDF2_SHA512 + } + + if (sf.write(version) != 4) { + sf.cancelWriting(); + return -4; // write error + } + + // Holds the hashes we write out + QByteArray hashes; + QDataStream hashStream(&hashes, QIODevice::WriteOnly); + QCryptographicHash md5(QCryptographicHash::Md5); + hashStream << static_cast(wb->_entries.count()); + + // Holds decrypted data prior to encryption + QByteArray decrypted; + + // FIXME: we should estimate the amount of data we will write in each + // buffer and resize them approximately in order to avoid extra + // resizes. + + // populate decrypted + QDataStream dStream(&decrypted, QIODevice::WriteOnly); + for (Backend::FolderMap::ConstIterator i = wb->_entries.constBegin(); i != wb->_entries.constEnd(); ++i) { + dStream << i.key(); + dStream << static_cast(i.value().count()); + + md5.reset(); + md5.addData(i.key().toUtf8()); + hashStream.writeRawData(md5.result().constData(), 16); + hashStream << static_cast(i.value().count()); + + for (Backend::EntryMap::ConstIterator j = i.value().constBegin(); j != i.value().constEnd(); ++j) { + dStream << j.key(); + dStream << static_cast(j.value()->type()); + dStream << j.value()->value(); + + md5.reset(); + md5.addData(j.key().toUtf8()); + hashStream.writeRawData(md5.result().constData(), 16); + } + } + + if (sf.write(hashes) != hashes.size()) { + sf.cancelWriting(); + return -4; // write error + } + + // calculate the hash of the file + SHA1 sha; + BlowFish _bf; + CipherBlockChain bf(&_bf); + + sha.process(decrypted.data(), decrypted.size()); + + // prepend and append the random data + QByteArray wholeFile; + long blksz = bf.blockSize(); + long newsize = decrypted.size() + blksz + // encrypted block + 4 + // file size + 20; // size of the SHA hash + + int delta = (blksz - (newsize % blksz)); + newsize += delta; + wholeFile.resize(newsize); + + QByteArray randBlock; + randBlock.resize(blksz + delta); + QRandomGenerator::securelySeeded().generate(randBlock.begin(), randBlock.end()); + + for (int i = 0; i < blksz; i++) { + wholeFile[i] = randBlock[i]; + } + + for (int i = 0; i < 4; i++) { + wholeFile[(int)(i + blksz)] = (decrypted.size() >> 8 * (3 - i)) & 0xff; + } + + for (int i = 0; i < decrypted.size(); i++) { + wholeFile[(int)(i + blksz + 4)] = decrypted[i]; + } + + for (int i = 0; i < delta; i++) { + wholeFile[(int)(i + blksz + 4 + decrypted.size())] = randBlock[(int)(i + blksz)]; + } + + const char *hash = (const char *)sha.hash(); + for (int i = 0; i < 20; i++) { + wholeFile[(int)(newsize - 20 + i)] = hash[i]; + } + + sha.reset(); + decrypted.fill(0); + + // encrypt the data + if (!bf.setKey(wb->_passhash.data(), wb->_passhash.size() * 8)) { + wholeFile.fill(0); + sf.cancelWriting(); + return -2; // encrypt error + } + + int rc = bf.encrypt(wholeFile.data(), wholeFile.size()); + if (rc < 0) { + wholeFile.fill(0); + sf.cancelWriting(); + return -2; // encrypt error + } + + // write the file + auto written = sf.write(wholeFile); + if (written != wholeFile.size()) { + wholeFile.fill(0); + sf.cancelWriting(); + return -4; // write error + } + if (!sf.commit()) { + qCDebug(KWALLETBACKEND_LOG) << "WARNING: wallet sync to disk failed! QSaveFile status was " << sf.errorString(); + wholeFile.fill(0); + return -4; // write error + } + + wholeFile.fill(0); + + return 0; +} + +int BlowfishPersistHandler::read(Backend *wb, QFile &db, WId) +{ + wb->_cipherType = BACKEND_CIPHER_BLOWFISH; + wb->_hashes.clear(); + // Read in the hashes + QDataStream hds(&db); + quint32 n; + hds >> n; + if (n > 0xffff) { // sanity check + return -43; + } + + for (size_t i = 0; i < n; ++i) { + Digest d; + Digest d2; // judgment day + MD5Digest ba; + QMap>::iterator it; + quint32 fsz; + if (hds.atEnd()) { + return -43; + } + hds.readRawData(d, 16); + hds >> fsz; + ba = MD5Digest(reinterpret_cast(d)); + it = wb->_hashes.insert(ba, QList()); + for (size_t j = 0; j < fsz; ++j) { + hds.readRawData(d2, 16); + ba = MD5Digest(d2); + (*it).append(ba); + } + } + + // Read in the rest of the file. + QByteArray encrypted = db.readAll(); + assert(encrypted.size() < db.size()); + + BlowFish _bf; + CipherBlockChain bf(&_bf, _useECBforReading); + int blksz = bf.blockSize(); + if ((encrypted.size() % blksz) != 0) { + return -5; // invalid file structure + } + + bf.setKey((void *)wb->_passhash.data(), wb->_passhash.size() * 8); + + if (!encrypted.data()) { + wb->_passhash.fill(0); + encrypted.fill(0); + return -7; // file structure error + } + + int rc = bf.decrypt(encrypted.data(), encrypted.size()); + if (rc < 0) { + wb->_passhash.fill(0); + encrypted.fill(0); + return -6; // decrypt error + } + + const char *t = encrypted.data(); + + // strip the leading data + t += blksz; // one block of random data + + // strip the file size off + long fsize = 0; + + fsize |= (long(*t) << 24) & 0xff000000; + t++; + fsize |= (long(*t) << 16) & 0x00ff0000; + t++; + fsize |= (long(*t) << 8) & 0x0000ff00; + t++; + fsize |= long(*t) & 0x000000ff; + t++; + + if (fsize < 0 || fsize > long(encrypted.size()) - blksz - 4) { + qCDebug(KWALLETBACKEND_LOG) << "fsize: " << fsize << " encrypted.size(): " << encrypted.size() << " blksz: " << blksz; + encrypted.fill(0); + return -9; // file structure error. + } + + // compute the hash ourself + SHA1 sha; + sha.process(t, fsize); + const char *testhash = (const char *)sha.hash(); + + // compare hashes + int sz = encrypted.size(); + for (int i = 0; i < 20; i++) { + if (testhash[i] != encrypted[sz - 20 + i]) { + encrypted.fill(0); + sha.reset(); + return -8; // hash error. + } + } + + sha.reset(); + + // chop off the leading blksz+4 bytes + QByteArray tmpenc(encrypted.data() + blksz + 4, fsize); + encrypted = tmpenc; + tmpenc.fill(0); + + // Load the data structures up + QDataStream eStream(encrypted); + + while (!eStream.atEnd()) { + QString folder; + quint32 n; + + eStream >> folder; + eStream >> n; + + // Force initialisation + wb->_entries[folder].clear(); + + for (size_t i = 0; i < n; ++i) { + QString key; + KWallet::Wallet::EntryType et = KWallet::Wallet::Unknown; + Entry *e = new Entry; + eStream >> key; + qint32 x = 0; // necessary to read properly + eStream >> x; + et = static_cast(x); + + switch (et) { + case KWallet::Wallet::Password: + case KWallet::Wallet::Stream: + case KWallet::Wallet::Map: + break; + default: // Unknown entry + delete e; + continue; + } + + QByteArray a; + eStream >> a; + e->setValue(a); + e->setType(et); + e->setKey(key); + wb->_entries[folder][key] = e; + } + } + + wb->_open = true; + encrypted.fill(0); + return 0; +} + +#ifdef HAVE_GPGMEPP +GpgME::Error initGpgME() +{ + GpgME::Error err; + static bool alreadyInitialized = false; + if (!alreadyInitialized) { + GpgME::initializeLibrary(); + err = GpgME::checkEngine(GpgME::OpenPGP); + if (err) { + qCDebug(KWALLETBACKEND_LOG) << "OpenPGP not supported!"; + } + alreadyInitialized = true; + } + return err; +} + +int GpgPersistHandler::write(Backend *wb, QSaveFile &sf, QByteArray &version, WId w) +{ + version[2] = KWALLET_CIPHER_GPG; + version[3] = 0; + if (sf.write(version) != 4) { + sf.cancelWriting(); + return -4; // write error + } + + GpgME::Error err = initGpgME(); + if (err) { + qCDebug(KWALLETBACKEND_LOG) << "initGpgME returned " << err.code(); + KMessageBox::errorWId(w, + i18n("Error when attempting to initialize OpenPGP while attempting to save the wallet %1. Error code is %2. " + "Please fix your system configuration, then try again.", + wb->_name.toHtmlEscaped(), + err.code())); + sf.cancelWriting(); + return -5; + } + + std::shared_ptr ctx(GpgME::Context::createForProtocol(GpgME::OpenPGP)); + if (!ctx) { + qCDebug(KWALLETBACKEND_LOG) << "Cannot setup OpenPGP context!"; + KMessageBox::errorWId(w, + i18n("Error when attempting to initialize OpenPGP while attempting to save the wallet %1. Please fix your system " + "configuration, then try again."), + wb->_name.toHtmlEscaped()); + return -6; + } + + assert(wb->_cipherType == BACKEND_CIPHER_GPG); + + QByteArray hashes; + QDataStream hashStream(&hashes, QIODevice::WriteOnly); + QCryptographicHash md5(QCryptographicHash::Md5); + hashStream << static_cast(wb->_entries.count()); + + QByteArray values; + QDataStream valueStream(&values, QIODevice::WriteOnly); + Backend::FolderMap::ConstIterator i = wb->_entries.constBegin(); + Backend::FolderMap::ConstIterator ie = wb->_entries.constEnd(); + for (; i != ie; ++i) { + valueStream << i.key(); + valueStream << static_cast(i.value().count()); + + md5.reset(); + md5.addData(i.key().toUtf8()); + hashStream.writeRawData(md5.result().constData(), 16); + hashStream << static_cast(i.value().count()); + + Backend::EntryMap::ConstIterator j = i.value().constBegin(); + Backend::EntryMap::ConstIterator je = i.value().constEnd(); + for (; j != je; ++j) { + valueStream << j.key(); + valueStream << static_cast(j.value()->type()); + valueStream << j.value()->value(); + + md5.reset(); + md5.addData(j.key().toUtf8()); + hashStream.writeRawData(md5.result().constData(), 16); + } + } + + QByteArray dataBuffer; + QDataStream dataStream(&dataBuffer, QIODevice::WriteOnly); + QString keyID(wb->_gpgKey.keyID()); + dataStream << keyID; + dataStream << hashes; + dataStream << values; + + GpgME::Data decryptedData(dataBuffer.data(), size_t(dataBuffer.size()), false); + GpgME::Data encryptedData; + std::vector keys; + keys.push_back(wb->_gpgKey); + const GpgME::EncryptionResult res = ctx->encrypt(keys, decryptedData, encryptedData, GpgME::Context::None); + if (res.error()) { + const int gpgerr = res.error().code(); + KMessageBox::errorWId(w, + i18n("Encryption error while attempting to save the wallet %1. Error code is %2 (%3). Please fix your system " + "configuration, then try again. This error may occur if you are not using a full trust GPG key. Please ensure you have the " + "secret key for the key you are using.", + wb->_name.toHtmlEscaped(), + gpgerr, + res.error().asString())); + qCDebug(KWALLETBACKEND_LOG) << "GpgME encryption error: " << gpgerr; + sf.cancelWriting(); + return -7; + } + + char buffer[4096]; + qint64 bytes = 0; + encryptedData.seek(0, SEEK_SET); + while ((bytes = encryptedData.read(buffer, sizeof(buffer) / sizeof(buffer[0]))) > 0) { + if (sf.write(buffer, bytes) != bytes) { + KMessageBox::errorWId(w, + i18n("File handling error while attempting to save the wallet %1. Error was %2. Please fix your system " + "configuration, then try again.", + wb->_name.toHtmlEscaped(), + sf.errorString())); + sf.cancelWriting(); + return -4; // write error + } + } + + if (!sf.commit()) { + qCDebug(KWALLETBACKEND_LOG) << "WARNING: wallet sync to disk failed! QSaveFile status was " << sf.errorString(); + return -4; // write error + } + + return 0; +} + +int GpgPersistHandler::read(Backend *wb, QFile &sf, WId w) +{ + GpgME::Error err = initGpgME(); + if (err) { + KMessageBox::errorWId(w, + i18n("Error when attempting to initialize OpenPGP while attempting to open the wallet %1. Error code is %2. " + "Please fix your system configuration, then try again.", + wb->_name.toHtmlEscaped(), + err.code())); + return -1; + } + + wb->_cipherType = BACKEND_CIPHER_GPG; + wb->_hashes.clear(); + + // the remainder of the file is GPG encrypted. Let's decrypt it + GpgME::Data encryptedData; + char buffer[4096]; + qint64 bytes = 0; + while ((bytes = sf.read(buffer, sizeof(buffer) / sizeof(buffer[0])))) { + encryptedData.write(buffer, bytes); + } + +retry_label: + std::shared_ptr ctx(GpgME::Context::createForProtocol(GpgME::OpenPGP)); + if (nullptr == ctx) { + KMessageBox::errorWId(w, + i18n("Error when attempting to initialize OpenPGP while attempting to open the wallet %1. Please fix your system " + "configuration, then try again.", + wb->_name.toHtmlEscaped())); + qCDebug(KWALLETBACKEND_LOG) << "Cannot setup OpenPGP context!"; + return -1; + } + + GpgME::Data decryptedData; + encryptedData.seek(0, SEEK_SET); + GpgME::DecryptionResult res = ctx->decrypt(encryptedData, decryptedData); + if (res.error()) { + qCDebug(KWALLETBACKEND_LOG) << "Error decrypting message: " << res.error().asString() << ", code " << res.error().code() << ", source " + << res.error().source(); + KGuiItem btnRetry(i18n("Retry")); + // FIXME the logic here should be a little more elaborate; a dialog box should be used with "retry", "cancel", but also "troubleshoot" with options to + // show card status and to kill scdaemon + int userChoice = + KMessageBox::warningTwoActionsWId(w, + i18n("Error when attempting to decrypt the wallet %1 using GPG. If you're using a SmartCard, " + "please ensure it's inserted then try again.

GPG error was %2
", + wb->_name.toHtmlEscaped(), + res.error().asString()), + i18n("kwalletd GPG backend"), + btnRetry, + KStandardGuiItem::cancel()); + if (userChoice == KMessageBox::PrimaryAction) { + decryptedData.seek(0, SEEK_SET); + goto retry_label; + } + return -1; + } + + decryptedData.seek(0, SEEK_SET); + QByteArray dataBuffer; + while ((bytes = decryptedData.read(buffer, sizeof(buffer) / sizeof(buffer[0])))) { + dataBuffer.append(buffer, bytes); + } + + // load the wallet from the decrypted data + QDataStream dataStream(dataBuffer); + QString keyID; + QByteArray hashes; + QByteArray values; + dataStream >> keyID; + dataStream >> hashes; + dataStream >> values; + + // locate the GPG key having the ID found inside the file. This will be needed later, when writing changes to disk. + QDataStream fileStream(&sf); + fileStream.setDevice(nullptr); + qCDebug(KWALLETBACKEND_LOG) << "This wallet was encrypted using GPG key with ID " << keyID; + + ctx->setKeyListMode(GpgME::KeyListMode::Local); + err = ctx->startKeyListing(); + while (!err) { + GpgME::Key k = ctx->nextKey(err); + if (err) { + break; + } + if (keyID == k.keyID()) { + qCDebug(KWALLETBACKEND_LOG) << "The key was found."; + wb->_gpgKey = k; + break; + } + } + ctx->endKeyListing(); + if (wb->_gpgKey.isNull()) { + KMessageBox::errorWId(w, + i18n("Error when attempting to open the wallet %1. The wallet was encrypted using the GPG Key ID %2 but this " + "key was not found on your system.", + wb->_name.toHtmlEscaped(), + keyID)); + return -1; + } + + QDataStream hashStream(hashes); + QDataStream valueStream(values); + + quint32 hashCount; + hashStream >> hashCount; + if (hashCount > 0xFFFF) { + return -43; + } + + quint32 folderCount = hashCount; + while (hashCount--) { + Digest d; + hashStream.readRawData(d, 16); + + quint32 folderSize; + hashStream >> folderSize; + + MD5Digest ba = MD5Digest(reinterpret_cast(d)); + QMap>::iterator it = wb->_hashes.insert(ba, QList()); + while (folderSize--) { + Digest d2; + hashStream.readRawData(d2, 16); + ba = MD5Digest(d2); + (*it).append(ba); + } + } + + while (folderCount--) { + QString folder; + valueStream >> folder; + + quint32 entryCount; + valueStream >> entryCount; + + wb->_entries[folder].clear(); + + while (entryCount--) { + KWallet::Wallet::EntryType et = KWallet::Wallet::Unknown; + Entry *e = new Entry; + + QString key; + valueStream >> key; + + qint32 x = 0; // necessary to read properly + valueStream >> x; + et = static_cast(x); + + switch (et) { + case KWallet::Wallet::Password: + case KWallet::Wallet::Stream: + case KWallet::Wallet::Map: + break; + default: // Unknown entry + delete e; + continue; + } + + QByteArray a; + valueStream >> a; + e->setValue(a); + e->setType(et); + e->setKey(key); + wb->_entries[folder][key] = e; + } + } + + wb->_open = true; + + return 0; +} +#endif // HAVE_GPGMEPP + +} // namespace diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/backendpersisthandler.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/backendpersisthandler.h new file mode 100644 index 0000000000..2fb4f1169b --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/backendpersisthandler.h @@ -0,0 +1,90 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2013 Valentin Rusu + + SPDX-License-Identifier: LGPL-2.0-only +*/ + +#ifndef BACKENDPERSISTHANDLER_H +#define BACKENDPERSISTHANDLER_H + +#define KWMAGIC_LEN 12 + +#include + +class QFile; +class QSaveFile; +namespace KWallet +{ +class Backend; + +enum BackendCipherType { + BACKEND_CIPHER_UNKNOWN, /// this is used by freshly allocated wallets + BACKEND_CIPHER_BLOWFISH, /// use the legacy blowfish cipher type +#ifdef HAVE_GPGMEPP + BACKEND_CIPHER_GPG, /// use GPG backend to encrypt wallet contents +#endif // HAVE_GPGMEPP +}; + +class BackendPersistHandler +{ +protected: + BackendPersistHandler() + { + } + +public: + virtual ~BackendPersistHandler() + { + } + /** + * This is a factory method used to get an instance of the backend suitable + * for reading/writing using the given cipher type + * + * @param cipherType indication of the backend that should be returned + * @return a pointer to an instance of the requested handler type. No need to delete this pointer, it's lifetime is taken care of by this factory + */ + static BackendPersistHandler *getPersistHandler(BackendCipherType cipherType); + static BackendPersistHandler *getPersistHandler(char magicBuf[KWMAGIC_LEN]); + + virtual int write(Backend *wb, QSaveFile &sf, QByteArray &version, WId w) = 0; + virtual int read(Backend *wb, QFile &sf, WId w) = 0; +}; + +class BlowfishPersistHandler : public BackendPersistHandler +{ +public: + explicit BlowfishPersistHandler(bool useECBforReading = false) + : _useECBforReading(useECBforReading) + { + } + ~BlowfishPersistHandler() override + { + } + + int write(Backend *wb, QSaveFile &sf, QByteArray &version, WId w) override; + int read(Backend *wb, QFile &sf, WId w) override; + +private: + bool _useECBforReading; +}; + +#ifdef HAVE_GPGMEPP +class GpgPersistHandler : public BackendPersistHandler +{ +public: + GpgPersistHandler() + { + } + ~GpgPersistHandler() override + { + } + + int write(Backend *wb, QSaveFile &sf, QByteArray &version, WId w) override; + int read(Backend *wb, QFile &sf, WId w) override; +}; +#endif // HAVE_GPGMEPP + +} // namespace + +#endif // BACKENDPERSISTHANDLER_H diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/blockcipher.cc b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/blockcipher.cc new file mode 100644 index 0000000000..8cbd89adf4 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/blockcipher.cc @@ -0,0 +1,23 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2001 George Staikos + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "blockcipher.h" + +BlockCipher::BlockCipher() +{ + _blksz = -1; +} + +BlockCipher::~BlockCipher() +{ +} + +int BlockCipher::blockSize() const +{ + return _blksz; +} + diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/blockcipher.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/blockcipher.h new file mode 100644 index 0000000000..7bac82ac79 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/blockcipher.h @@ -0,0 +1,64 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2001 George Staikos + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef BLOCKCIPHER_H +#define BLOCKCIPHER_H + +#include "kwalletbackend_export.h" + +/* @internal + */ +class KWALLETBACKEND_EXPORT BlockCipher +{ +public: + BlockCipher(); + virtual ~BlockCipher(); + + /* + * Return the current blocksize in bytes. + */ + int blockSize() const; + + /* + * Set the encryption key to key. Return true on success. + */ + virtual bool setKey(void *key, int bitlength) = 0; + + /* + * Get the required (or if it's variable, then the maximum) key + * length for this cipher in bits. + */ + virtual int keyLen() const = 0; + + /* + * True if the key is of a variable length. In this case, + * getKeyLen() will return the maximum length. + */ + virtual bool variableKeyLen() const = 0; + + /* + * True if all settings are good and we are ready to encrypt. + */ + virtual bool readyToGo() const = 0; + + /* + * Encrypt the block. Returns the number of bytes successfully + * encrypted. Can return -1 on error. + */ + virtual int encrypt(void *block, int len) = 0; + + /* + * Decrypt the block. Returns as does encrypt(); + */ + virtual int decrypt(void *block, int len) = 0; + +protected: + int _blksz; + int _keylen; // in bits +}; + +#endif // BLOCKCIPHER_H diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/blowfish.cc b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/blowfish.cc new file mode 100644 index 0000000000..da04c87030 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/blowfish.cc @@ -0,0 +1,255 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2001 George Staikos + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +// FIXME: should we unroll some loops? Optimization can be done here. + +/* Implementation of 16 rounds blowfish as described in: + * _Applied_Cryptography_ (c) Bruce Schneier, 1996. + */ + +#include "blowfish.h" + +#include +#include +#include + +#include "blowfishtables.h" + +// DO NOT INCLUDE THIS. IT BREAKS KWALLET. +// We need to live with -Wundef until someone really figures out the problem. +//#include // for Q_BYTE_ORDER and friends +// Workaround for -Wundef +#define Q_BIG_ENDIAN 1 +#define Q_BYTE_ORDER Q_BIG_ENDIAN + +BlowFish::BlowFish() +{ + _blksz = 8; + m_key = nullptr; + m_initialized = false; +} + +bool BlowFish::init() +{ + // Initialize the sboxes + for (int i = 0; i < 256; i++) { + m_S[0][i] = ks0[i]; + m_S[1][i] = ks1[i]; + m_S[2][i] = ks2[i]; + m_S[3][i] = ks3[i]; + } + + uint32_t datal = 0; + uint32_t datar = 0; + uint32_t data = 0; + int j = 0; + + // Update the sboxes and pbox. + for (int i = 0; i < 18; i++) { + data = 0; + for (int k = 0; k < 4; ++k) { + data = (data << 8) | ((unsigned char *)m_key)[j++]; + if (j >= m_keylen / 8) { + j = 0; + } + } + m_P[i] = P[i] ^ data; + } + + for (int i = 0; i < 18; i += 2) { + encipher(&datal, &datar); + m_P[i] = datal; + m_P[i + 1] = datar; + } + + for (int j = 0; j < 4; j++) { + for (int i = 0; i < 256; i += 2) { + encipher(&datal, &datar); + m_S[j][i] = datal; + m_S[j][i + 1] = datar; + } + } + + // Nice code from gpg's implementation... + // check to see if the key is weak and return error if so + for (int i = 0; i < 255; i++) { + for (int j = i + 1; j < 256; j++) { + if ((m_S[0][i] == m_S[0][j]) || (m_S[1][i] == m_S[1][j]) || + (m_S[2][i] == m_S[2][j]) || (m_S[3][i] == m_S[3][j])) { + return false; + } + } + } + + m_initialized = true; + + return true; +} + +BlowFish::~BlowFish() +{ + delete[](unsigned char *)m_key; + m_key = nullptr; +} + +int BlowFish::keyLen() const +{ + return 448; +} + +bool BlowFish::variableKeyLen() const +{ + return true; +} + +bool BlowFish::readyToGo() const +{ + return m_initialized; +} + +bool BlowFish::setKey(void *key, int bitlength) +{ + if (bitlength <= 0 || bitlength > 448 || bitlength % 8 != 0) { + return false; + } + + delete[](unsigned char *)m_key; + + m_key = new unsigned char[bitlength / 8]; + memcpy(m_key, key, bitlength / 8); + m_keylen = bitlength; + + return init(); +} +// clang-format off +#if Q_BYTE_ORDER == Q_BIG_ENDIAN +#define shuffle(x) do { \ + uint32_t r = x; \ + x = (r & 0xff000000) >> 24; \ + x |= (r & 0x00ff0000) >> 8; \ + x |= (r & 0x0000ff00) << 8; \ + x |= (r & 0x000000ff) << 24; \ + } while (0) +#endif +// clang-format on + +int BlowFish::encrypt(void *block, int len) +{ + uint32_t *d = (uint32_t *)block; + + if (!m_initialized || len % _blksz != 0) { + return -1; + } + + for (int i = 0; i < len / _blksz; i++) { +#if Q_BYTE_ORDER == Q_BIG_ENDIAN + shuffle(*d); + shuffle(*(d + 1)); +#endif + encipher(d, d + 1); +#if Q_BYTE_ORDER == Q_BIG_ENDIAN + shuffle(*d); + shuffle(*(d + 1)); +#endif + d += 2; + } + + return len; +} + +int BlowFish::decrypt(void *block, int len) +{ + uint32_t *d = (uint32_t *)block; + + if (!m_initialized || len % _blksz != 0) { + return -1; + } + + for (int i = 0; i < len / _blksz; i++) { +#if Q_BYTE_ORDER == Q_BIG_ENDIAN + shuffle(*d); + shuffle(*(d + 1)); +#endif + decipher(d, d + 1); +#if Q_BYTE_ORDER == Q_BIG_ENDIAN + shuffle(*d); + shuffle(*(d + 1)); +#endif + d += 2; + } + + return len; +} + +uint32_t BlowFish::F(uint32_t x) +{ + unsigned short a; + unsigned short b; + unsigned short c; + unsigned short d; + uint32_t y; + + d = x & 0x000000ff; + x >>= 8; + c = x & 0x000000ff; + x >>= 8; + b = x & 0x000000ff; + x >>= 8; + a = x & 0x000000ff; + + y = m_S[0][a] + m_S[1][b]; + y ^= m_S[2][c]; + y += m_S[3][d]; + + return y; +} + +void BlowFish::encipher(uint32_t *xl, uint32_t *xr) +{ + uint32_t Xl = *xl; + uint32_t Xr = *xr; + uint32_t temp; + + for (int i = 0; i < 16; ++i) { + Xl ^= m_P[i]; + Xr ^= F(Xl); + // Exchange + temp = Xl; Xl = Xr; Xr = temp; + } + + // Exchange + temp = Xl; Xl = Xr; Xr = temp; + + Xr ^= m_P[16]; + Xl ^= m_P[17]; + + *xl = Xl; + *xr = Xr; +} + +void BlowFish::decipher(uint32_t *xl, uint32_t *xr) +{ + uint32_t Xl = *xl; + uint32_t Xr = *xr; + uint32_t temp; + + for (int i = 17; i > 1; --i) { + Xl ^= m_P[i]; + Xr ^= F(Xl); + // Exchange + temp = Xl; Xl = Xr; Xr = temp; + } + + // Exchange + temp = Xl; Xl = Xr; Xr = temp; + + Xr ^= m_P[1]; + Xl ^= m_P[0]; + + *xl = Xl; + *xr = Xr; +} diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/blowfish.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/blowfish.h new file mode 100644 index 0000000000..5bc8a5de3f --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/blowfish.h @@ -0,0 +1,59 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2001 George Staikos + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef _BLOWFISH_H +#define _BLOWFISH_H + +#include + +#if HAVE_STDINT_H +#include +#endif +#include +#if HAVE_SYS_BITYPES_H +#include /* For uintXX_t on Tru64 */ +#endif + +#include "blockcipher.h" +#include "kwalletbackend_export.h" + +/* @internal + */ +class KWALLETBACKEND_EXPORT BlowFish : public BlockCipher +{ +public: + BlowFish(); + ~BlowFish() override; + + bool setKey(void *key, int bitlength) override; + + int keyLen() const override; + + bool variableKeyLen() const override; + + bool readyToGo() const override; + + int encrypt(void *block, int len) override; + + int decrypt(void *block, int len) override; + +private: + uint32_t m_S[4][256]; + uint32_t m_P[18]; + + void *m_key; + int m_keylen; // in bits + + bool m_initialized; + + bool init(); + uint32_t F(uint32_t x); + void encipher(uint32_t *xl, uint32_t *xr); + void decipher(uint32_t *xl, uint32_t *xr); +}; + +#endif diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/blowfishtables.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/blowfishtables.h new file mode 100644 index 0000000000..cd15fd536b --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/blowfishtables.h @@ -0,0 +1,120 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2001 George Staikos + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +// This is also from _Applied_Cryptography_. See blowfish.cc for more details. + +#ifndef BLOWFISHTABLES_H +#define BLOWFISHTABLES_H + +const unsigned long ks0[256] = { + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, + 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, 0xc5d1b023, 0x286085f0, + 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, 0xe65525f3, 0xaa55ab94, 0x57489862, + 0x63e81440, 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, + 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, + 0xe98575b1, 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a, + 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176, 0x66ca593e, + 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, + 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, + 0x409f60c4, 0x5e5c9ec2, 0x196a2463, 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, + 0x660f2807, 0x192e4bb3, 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, + 0xdb3222f8, 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, + 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, 0x9a53e479, + 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, 0x95dbda4d, 0xae909198, + 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, 0x4fad5ea0, 0x688fc31c, 0xd1cff191, + 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, + 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, + 0x2071b35e, 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9, + 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f, 0xf296ec6b, + 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a}; + +const unsigned long ks1[256] = { + 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, 0x193602a5, + 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, 0x4cdd2086, 0x8470eb26, + 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, + 0x5716f2b8, 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, + 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, + 0x4f6db908, 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, + 0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908, 0xdd433b37, + 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, + 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, 0x803e89d6, + 0x5266c825, 0x2e4cc978, 0x9c10b36a, 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, + 0xebadfe6e, 0xeac31f66, 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, + 0x5b6e2f84, 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, + 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 0x9b540b19, + 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, 0x57f584a5, 0x1b227263, + 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 0x5d4a14d9, 0xe864b7e3, 0x42105d14, + 0x203e13e0, 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, + 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, + 0x0c55f5ea, 0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, + 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, 0x675fda79, + 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7}; + +const unsigned long ks2[256] = { + 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, 0x1e39f62e, + 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, 0x96eb27b3, 0x55fd3941, + 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, + 0x7af4d6b6, 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, + 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 0x55a867bc, + 0xa1159a58, 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22, + 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, 0x257b7834, 0x602a9c60, 0xdff8e8a3, + 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, + 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, + 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, + 0xa091cf0b, 0xd9155ea3, 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, + 0x782ef11c, 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, + 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, 0x83426b33, + 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, + 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, 0xb90bace1, 0xbb8205d0, 0x11a86248, + 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, + 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 0xf0177a28, + 0xc0f586e0, 0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188, + 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, + 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0}; + +const unsigned long ks3[256] = { + 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, 0xb78c1b6b, + 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, 0x2939bbdb, 0xa9ba4650, + 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, 0x83c061ba, 0x9be96a4d, 0x8fe51550, + 0xba645bd6, 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, + 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, + 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba, + 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5, 0x03563482, + 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, + 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, + 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, + 0xaec2771b, 0xf64e6370, 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, + 0xce6ea048, 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, + 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, 0xf79e59b7, + 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, 0xb6c1075e, 0xe3056a0c, + 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, 0x1b0a7441, 0x4ba3348c, 0xc5be7120, + 0xc37632d8, 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, + 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, + 0x327a140a, 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3, + 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, + 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6}; + +const unsigned long P[18] = {0x243f6a88, + 0x85a308d3, + 0x13198a2e, + 0x03707344, + 0xa4093822, + 0x299f31d0, + 0x082efa98, + 0xec4e6c89, + 0x452821e6, + 0x38d01377, + 0xbe5466cf, + 0x34e90c6c, + 0xc0ac29b7, + 0xc97c50dd, + 0x3f84d5b5, + 0xb5470917, + 0x9216d5d9, + 0x8979fb1b}; + +#endif // BLOWFISHTABLES_H diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/cbc.cc b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/cbc.cc new file mode 100644 index 0000000000..2b86dd1a5a --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/cbc.cc @@ -0,0 +1,200 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2001 George Staikos + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "cbc.h" +#include "kwalletbackend_debug.h" +#include + +CipherBlockChain::CipherBlockChain(BlockCipher *cipher, bool useECBforReading) : + _cipher(cipher) + , _useECBforReading(useECBforReading) +{ + _next = nullptr; + _register = nullptr; + _len = -1; + _reader = _writer = 0L; + if (cipher) { + _blksz = cipher->blockSize(); + } +} + +CipherBlockChain::~CipherBlockChain() +{ + delete[](char *)_register; + _register = nullptr; + delete[](char *)_next; + _next = nullptr; +} + +bool CipherBlockChain::setKey(void *key, int bitlength) +{ + if (_cipher) { + return _cipher->setKey(key, bitlength); + } + return false; +} + +int CipherBlockChain::keyLen() const +{ + if (_cipher) { + return _cipher->keyLen(); + } + return -1; +} + +bool CipherBlockChain::variableKeyLen() const +{ + if (_cipher) { + return _cipher->variableKeyLen(); + } + return false; +} + +bool CipherBlockChain::readyToGo() const +{ + if (_cipher) { + return _cipher->readyToGo(); + } + return false; +} + +void CipherBlockChain::initRegister() { + if (_register == nullptr) { + size_t registerLen = _cipher->blockSize(); + _register = new unsigned char[registerLen]; + _len = registerLen; + } + memset(_register, 0, _len); +} + +int CipherBlockChain::encrypt(void *block, int len) +{ + if (_cipher && !_reader) { + int rc; + + _writer |= 1; + + initRegister(); + + if ((len % _len) >0) { + qCDebug(KWALLETBACKEND_LOG) << "Block length given encrypt (" << len << ") is not a multiple of " << _len; + return -1; + } + + char *elemBlock = static_cast(block); + for (int b = 0; b < len/_len; b++) { + + // This might be optimizable + char *tb = static_cast(elemBlock); + for (int i = 0; i < _len; i++) { + *tb++ ^= ((char *)_register)[i]; + } + + rc = _cipher->encrypt(elemBlock, _len); + + if (rc != -1) { + memcpy(_register, elemBlock, _len); + } + elemBlock += _len; + } + + return rc; + } + return -1; +} + +// This is the old decrypt method, that was decrypting using ECB +// instead of CBC +int CipherBlockChain::decryptECB(void *block, int len) { + if (_cipher && !_writer) { + int rc; + + _reader |= 1; + + if (!_register) { + _register = new unsigned char[len]; + _len = len; + memset(_register, 0, len); + } else if (len > _len) { + return -1; + } + + if (!_next) { + _next = new unsigned char[_len]; + } + memcpy(_next, block, _len); + + rc = _cipher->decrypt(block, len); + + if (rc != -1) { + // This might be optimizable + char *tb = (char *)block; + for (int i = 0; i < len; i++) { + tb[i] ^= ((char *)_register)[i]; + } + } + + void *temp; + temp = _next; + _next = _register; + _register = temp; + + return rc; + } + return -1; +} + +int CipherBlockChain::decrypt(void *block, int len) +{ + if (_useECBforReading) { + qCDebug(KWALLETBACKEND_LOG) << "decrypting using ECB!"; + return decryptECB(block, len); + } + + if (_cipher && !_writer) { + int rc = 0; + + _reader |= 1; + + initRegister(); + + if ((len % _len) >0) { + qCDebug(KWALLETBACKEND_LOG) << "Block length given for decrypt (" << len << ") is not a multiple of " << _len; + return -1; + } + + char *elemBlock = static_cast(block); + for (int b = 0; b < len/_len; b++) { + if (_next == nullptr) { + _next = new unsigned char[_len]; + } + memcpy(_next, elemBlock, _len); + + int bytesDecrypted = _cipher->decrypt(elemBlock, _len); + + if (bytesDecrypted != -1) { + rc += bytesDecrypted; + // This might be optimizable + char *tb = (char *)elemBlock; + for (int i = 0; i < _len; i++) { + *tb++ ^= ((char *)_register)[i]; + } + } + + void *temp; + temp = _next; + _next = _register; + _register = temp; + + elemBlock += _len; + } + + return rc; + } + return -1; +} + diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/cbc.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/cbc.h new file mode 100644 index 0000000000..4eabb65c47 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/cbc.h @@ -0,0 +1,52 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2001 George Staikos + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef __CBC__KO__H +#define __CBC__KO__H + +#include "blockcipher.h" + +/* @internal + * Initialize this class with a pointer to a valid, uninitialized BlockCipher + * and it will apply that cipher using CBC. You may want to make the + * initial block a full block of random data. Do not change the block size + * at any time!! You must pad it yourself. Also, you can only encrypt or + * decrypt. You can't do both with a given instance. After you call one, + * calls to the other will fail in this instance. + */ + +class CipherBlockChain : public BlockCipher +{ +public: + CipherBlockChain(BlockCipher *cipher, bool useECBforReading = false); + ~CipherBlockChain() override; + + bool setKey(void *key, int bitlength) override; + + int keyLen() const override; + + bool variableKeyLen() const override; + + bool readyToGo() const override; + + int encrypt(void *block, int len) override; + + int decrypt(void *block, int len) override; + +private: + void initRegister(); + int decryptECB(void *block, int len); + + BlockCipher *_cipher; + void *_register; + void *_next; + int _len; + int _reader, _writer; + bool _useECBforReading; +}; + +#endif diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/cbc.master.cc b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/cbc.master.cc new file mode 100644 index 0000000000..84ce5c558f --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/cbc.master.cc @@ -0,0 +1,133 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2001 George Staikos + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "cbc.h" +#include + +CipherBlockChain::CipherBlockChain(BlockCipher *cipher) : _cipher(cipher) +{ + _next = 0L; + _register = 0L; + _len = -1; + _reader = _writer = 0L; + if (cipher) { + _blksz = cipher->blockSize(); + } +} + +CipherBlockChain::~CipherBlockChain() +{ + delete[](char *)_register; + _register = 0L; + delete[](char *)_next; + _next = 0L; +} + +bool CipherBlockChain::setKey(void *key, int bitlength) +{ + if (_cipher) { + return _cipher->setKey(key, bitlength); + } + return false; +} + +int CipherBlockChain::keyLen() const +{ + if (_cipher) { + return _cipher->keyLen(); + } + return -1; +} + +bool CipherBlockChain::variableKeyLen() const +{ + if (_cipher) { + return _cipher->variableKeyLen(); + } + return false; +} + +bool CipherBlockChain::readyToGo() const +{ + if (_cipher) { + return _cipher->readyToGo(); + } + return false; +} + +int CipherBlockChain::encrypt(void *block, int len) +{ + if (_cipher && !_reader) { + int rc; + + _writer |= 1; + + if (!_register) { + _register = new unsigned char[len]; + _len = len; + memset(_register, 0, len); + } else if (len > _len) { + return -1; + } + + // This might be optimizable + char *tb = (char *)block; + for (int i = 0; i < len; i++) { + tb[i] ^= ((char *)_register)[i]; + } + + rc = _cipher->encrypt(block, len); + + if (rc != -1) { + memcpy(_register, block, len); + } + + return rc; + } + return -1; +} + +int CipherBlockChain::decrypt(void *block, int len) +{ + if (_cipher && !_writer) { + int rc; + + _reader |= 1; + + if (!_register) { + _register = new unsigned char[len]; + _len = len; + memset(_register, 0, len); + } else if (len > _len) { + return -1; + } + + if (!_next) { + _next = new unsigned char[_len]; + } + memcpy(_next, block, _len); + + rc = _cipher->decrypt(block, len); + + if (rc != -1) { + // This might be optimizable + char *tb = (char *)block; + for (int i = 0; i < len; i++) { + tb[i] ^= ((char *)_register)[i]; + } + } + + void *temp; + temp = _next; + _next = _register; + _register = temp; + + return rc; + } + return -1; +} + diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/config-kwalletbackend.h.cmake b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/config-kwalletbackend.h.cmake new file mode 100644 index 0000000000..bf73d7458e --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/config-kwalletbackend.h.cmake @@ -0,0 +1,3 @@ +#cmakedefine01 HAVE_STDINT_H + +#cmakedefine01 HAVE_SYS_BITYPES_H diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/kwalletbackend.cc b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/kwalletbackend.cc new file mode 100644 index 0000000000..f2559d0b62 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/kwalletbackend.cc @@ -0,0 +1,799 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2001-2004 George Staikos + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "kwalletbackend.h" +#include "kwalletbackend_debug.h" + +#include + +#include +#ifdef HAVE_GPGMEPP +#include +#endif +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "blowfish.h" +#include "sha1.h" +#include "cbc.h" + +#include +#include + +// quick fix to get random numbers on win32 +#ifdef Q_OS_WIN //krazy:exclude=cpp +#include +#include +#endif + +#define KWALLETSTORAGE_VERSION_MAJOR 0 +#define KWALLETSTORAGE_VERSION_MINOR 1 + +using namespace KWallet; + +#define KWMAGIC "KWALLET\n\r\0\r\n" + +static const QByteArray walletAllowedChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789^&'@{}[],$=!-#()%.+_\r\n\t\f\v "; + +/* The encoding works if the name contains at least one unsupported character. + * Names that were allowed prior to the Secret Service API patch remain intact. + */ +QString Backend::encodeWalletName(const QString &name) { + /* Use a semicolon as "percent" because it does not conflict with already allowed characters for wallet names + * and is allowed for file names + */ + return QString::fromUtf8(name.toUtf8().toPercentEncoding(walletAllowedChars, {}, ';')); +} + +QString Backend::decodeWalletName(const QString &encodedName) { + return QString::fromUtf8(QByteArray::fromPercentEncoding(encodedName.toUtf8(), ';')); +} + +gcry_error_t ensureGcryptInit() +{ + bool static gcry_secmem_init = false; + if (gcry_secmem_init) { + return 0; + } + gcry_error_t error = gcry_control(GCRYCTL_INIT_SECMEM, 32768, 0); + if (error != 0) { + qCWarning(KWALLETBACKEND_LOG) << "Can't get secure memory:" << error; + return error; + } + gcry_secmem_init = true; + + gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0); + + return error; +} + +class Backend::BackendPrivate +{ +}; + +// static void initKWalletDir() +// { +// KGlobal::dirs()->addResourceType("kwallet", 0, "share/apps/kwallet"); +// } + +Backend::Backend(const QString &name, bool isPath) + : d(nullptr), + _name(name), + _cipherType(KWallet::BACKEND_CIPHER_UNKNOWN) +{ +// initKWalletDir(); + + ensureGcryptInit(); + + if (isPath) { + _path = name; + } else { + _path = getSaveLocation() + '/' + encodeWalletName(_name) + ".kwl"; + } + + _open = false; +} + +Backend::~Backend() +{ + if (_open) { + close(); + } + delete d; +} + +QString Backend::getSaveLocation() +{ + QString writeLocation = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kwalletd"); + QDir writeDir(writeLocation); + if (!writeDir.exists()) { + if (!writeDir.mkpath(writeLocation)) { + qFatal("Cannot create wallet save location!"); + } + } + + // qCDebug(KWALLETBACKEND_LOG) << "Using saveLocation " + writeLocation; + return writeLocation; +} + +void Backend::setCipherType(BackendCipherType ct) +{ + // changing cipher type on already initialed wallets is not permitted + assert(_cipherType == KWallet::BACKEND_CIPHER_UNKNOWN); + _cipherType = ct; +} + +static int password2PBKDF2_SHA512(const QByteArray &password, QByteArray &hash, const QByteArray &salt) +{ + if (!gcry_check_version("1.5.0")) { + qCWarning(KWALLETBACKEND_LOG) << "libcrypt version is too old"; + return GPG_ERR_USER_2; + } + + gcry_error_t error = ensureGcryptInit(); + if (error != 0) { + return error; + } + + error = gcry_kdf_derive(password.constData(), password.size(), + GCRY_KDF_PBKDF2, GCRY_MD_SHA512, + salt.data(), salt.size(), + PBKDF2_SHA512_ITERATIONS, PBKDF2_SHA512_KEYSIZE, hash.data()); + + return error; +} + +// this should be SHA-512 for release probably +static int password2hash(const QByteArray &password, QByteArray &hash) +{ + SHA1 sha; + int shasz = sha.size() / 8; + + assert(shasz >= 20); + + QByteArray block1(shasz, 0); + + sha.process(password.data(), qMin(password.size(), 16)); + + // To make brute force take longer + for (int i = 0; i < 2000; i++) { + memcpy(block1.data(), sha.hash(), shasz); + sha.reset(); + sha.process(block1.data(), shasz); + } + + sha.reset(); + + if (password.size() > 16) { + sha.process(password.data() + 16, qMin(password.size() - 16, 16)); + QByteArray block2(shasz, 0); + // To make brute force take longer + for (int i = 0; i < 2000; i++) { + memcpy(block2.data(), sha.hash(), shasz); + sha.reset(); + sha.process(block2.data(), shasz); + } + + sha.reset(); + + if (password.size() > 32) { + sha.process(password.data() + 32, qMin(password.size() - 32, 16)); + + QByteArray block3(shasz, 0); + // To make brute force take longer + for (int i = 0; i < 2000; i++) { + memcpy(block3.data(), sha.hash(), shasz); + sha.reset(); + sha.process(block3.data(), shasz); + } + + sha.reset(); + + if (password.size() > 48) { + sha.process(password.data() + 48, password.size() - 48); + + QByteArray block4(shasz, 0); + // To make brute force take longer + for (int i = 0; i < 2000; i++) { + memcpy(block4.data(), sha.hash(), shasz); + sha.reset(); + sha.process(block4.data(), shasz); + } + + sha.reset(); + // split 14/14/14/14 + hash.resize(56); + memcpy(hash.data(), block1.data(), 14); + memcpy(hash.data() + 14, block2.data(), 14); + memcpy(hash.data() + 28, block3.data(), 14); + memcpy(hash.data() + 42, block4.data(), 14); + block4.fill(0); + } else { + // split 20/20/16 + hash.resize(56); + memcpy(hash.data(), block1.data(), 20); + memcpy(hash.data() + 20, block2.data(), 20); + memcpy(hash.data() + 40, block3.data(), 16); + } + block3.fill(0); + } else { + // split 20/20 + hash.resize(40); + memcpy(hash.data(), block1.data(), 20); + memcpy(hash.data() + 20, block2.data(), 20); + } + block2.fill(0); + } else { + // entirely block1 + hash.resize(20); + memcpy(hash.data(), block1.data(), 20); + } + + block1.fill(0); + + return 0; +} + +int Backend::deref() +{ + if (--_ref < 0) { + qCDebug(KWALLETBACKEND_LOG) << "refCount negative!"; + _ref = 0; + } + return _ref; +} + +bool Backend::exists(const QString &wallet) +{ + QString saveLocation = getSaveLocation(); + QString path = saveLocation + '/' + encodeWalletName(wallet) + QLatin1String(".kwl"); + // Note: 60 bytes is presently the minimum size of a wallet file. + // Anything smaller is junk. + return QFile::exists(path) && QFileInfo(path).size() >= 60; +} + +QString Backend::openRCToString(int rc) +{ + switch (rc) { + case -255: + return i18n("Already open."); + case -2: + return i18n("Error opening file."); + case -3: + return i18n("Not a wallet file."); + case -4: + return i18n("Unsupported file format revision."); + case -41: + return QStringLiteral("Unknown cipher or hash"); //FIXME: use i18n after string freeze + case -42: + return i18n("Unknown encryption scheme."); + case -43: + return i18n("Corrupt file?"); + case -8: + return i18n("Error validating wallet integrity. Possibly corrupted."); + case -5: + case -7: + case -9: + return i18n("Read error - possibly incorrect password."); + case -6: + return i18n("Decryption error."); + default: + return QString(); + } +} + +int Backend::open(const QByteArray &password, WId w) +{ + if (_open) { + return -255; // already open + } + + setPassword(password); + return openInternal(w); +} + +#ifdef HAVE_GPGMEPP +int Backend::open(const GpgME::Key &key) +{ + if (_open) { + return -255; // already open + } + _gpgKey = key; + return openInternal(); +} +#endif // HAVE_GPGMEPP + +int Backend::openPreHashed(const QByteArray &passwordHash) +{ + if (_open) { + return -255; // already open + } + + // check the password hash for correct size (currently fixed) + if (passwordHash.size() != 20 && passwordHash.size() != 40 && + passwordHash.size() != 56) { + return -42; // unsupported encryption scheme + } + + _passhash = passwordHash; + _newPassHash = passwordHash; + _useNewHash = true;//Only new hash is supported + + return openInternal(); +} + +int Backend::openInternal(WId w) +{ + // No wallet existed. Let's create it. + // Note: 60 bytes is presently the minimum size of a wallet file. + // Anything smaller is junk and should be deleted. + if (!QFile::exists(_path) || QFileInfo(_path).size() < 60) { + QFile newfile(_path); + if (!newfile.open(QIODevice::ReadWrite)) { + return -2; // error opening file + } + newfile.close(); + _open = true; + if (sync(w) != 0) { + return -2; + } + } + + QFile db(_path); + + if (!db.open(QIODevice::ReadOnly)) { + return -2; // error opening file + } + + char magicBuf[KWMAGIC_LEN]; + db.read(magicBuf, KWMAGIC_LEN); + if (memcmp(magicBuf, KWMAGIC, KWMAGIC_LEN) != 0) { + return -3; // bad magic + } + + db.read(magicBuf, 4); + + // First byte is major version, second byte is minor version + if (magicBuf[0] != KWALLETSTORAGE_VERSION_MAJOR) { + return -4; // unknown version + } + + //0 has been the MINOR version until 4.13, from that point we use it to upgrade the hash + if (magicBuf[1] == 1) { + qCDebug(KWALLETBACKEND_LOG) << "Wallet new enough, using new hash"; + swapToNewHash(); + } else if (magicBuf[1] != 0) { + qCDebug(KWALLETBACKEND_LOG) << "Wallet is old, sad panda :("; + return -4; // unknown version + } + + BackendPersistHandler *phandler = BackendPersistHandler::getPersistHandler(magicBuf); + if (nullptr == phandler) { + return -41; // unknown cipher or hash + } + int result = phandler->read(this, db, w); + delete phandler; + return result; +} + +void Backend::swapToNewHash() +{ + //Runtime error happened and we can't use the new hash + if (!_useNewHash) { + qCDebug(KWALLETBACKEND_LOG) << "Runtime error on the new hash"; + return; + } + _passhash.fill(0);//Making sure the old passhash is not around in memory + _passhash = _newPassHash;//Use the new hash, means the wallet is modern enough +} + +QByteArray Backend::createAndSaveSalt(const QString &path) const +{ + QFile saltFile(path); + saltFile.remove(); + + if (!saltFile.open(QIODevice::WriteOnly)) { + return QByteArray(); + } + saltFile.setPermissions(QFile::ReadUser | QFile::WriteUser); + + if (ensureGcryptInit() != 0) { + return QByteArray(); + } + + QByteArray salt(PBKDF2_SHA512_SALTSIZE, Qt::Initialization::Uninitialized); + gcry_randomize(salt.data(), salt.size(), GCRY_STRONG_RANDOM); + + + if (saltFile.write(salt) != PBKDF2_SHA512_SALTSIZE) { + return QByteArray(); + } + + saltFile.close(); + + return salt; +} + +int Backend::sync(WId w) +{ + if (!_open) { + return -255; // not open yet + } + + if (!QFile::exists(_path)) { + return -3; // File does not exist + } + + QSaveFile sf(_path); + + if (!sf.open(QIODevice::WriteOnly | QIODevice::Unbuffered)) { + return -1; // error opening file + } + sf.setPermissions(QFile::ReadUser | QFile::WriteUser); + + if (sf.write(KWMAGIC, KWMAGIC_LEN) != KWMAGIC_LEN) { + sf.cancelWriting(); + return -4; // write error + } + + // Write the version number + QByteArray version(4, 0); + version[0] = KWALLETSTORAGE_VERSION_MAJOR; + if (_useNewHash) { + version[1] = KWALLETSTORAGE_VERSION_MINOR; + //Use the sync to update the hash to PBKDF2_SHA512 + swapToNewHash(); + } else { + version[1] = 0; //was KWALLETSTORAGE_VERSION_MINOR before the new hash + } + + BackendPersistHandler *phandler = BackendPersistHandler::getPersistHandler(_cipherType); + if (nullptr == phandler) { + return -4; // write error + } + int rc = phandler->write(this, sf, version, w); + if (rc < 0) { + // Oops! wallet file sync filed! Display a notification about that + // TODO: change kwalletd status flags, when status flags will be implemented + KNotification *notification = new KNotification(QStringLiteral("syncFailed")); + notification->setText(i18n("Failed to sync wallet %1 to disk. Error codes are:\nRC %2\nSF %3. Please file a BUG report using this information to bugs.kde.org", _name, rc, sf.errorString())); + notification->sendEvent(); + } + delete phandler; + return rc; +} + +int Backend::closeInternal(bool save) +{ + // save if requested + if (save) { + int rc = sync(0); + if (rc != 0) { + return rc; + } + } + + // do the actual close + for (FolderMap::ConstIterator i = _entries.constBegin(); i != _entries.constEnd(); ++i) { + for (EntryMap::ConstIterator j = i.value().constBegin(); j != i.value().constEnd(); ++j) { + delete j.value(); + } + } + _entries.clear(); + _open = false; + + return 0; +} + +int Backend::close(bool save) +{ + int rc = closeInternal(save); + if (rc) + return rc; + + // empty the password hash + _passhash.fill(0); + _newPassHash.fill(0); + + return 0; +} + +const QString &Backend::walletName() const +{ + return _name; +} + +int Backend::renameWallet(const QString &newName, bool isPath) +{ + QString newPath; + const auto saveLocation = getSaveLocation(); + + if (isPath) { + newPath = newName; + } else { + newPath = saveLocation + QChar::fromLatin1('/') + encodeWalletName(newName) + QStringLiteral(".kwl"); + } + + if (newPath == _path) { + return 0; + } + + if (QFile::exists(newPath)) { + return -EEXIST; + } + + int rc = closeInternal(true); + if (rc) { + return rc; + } + + QFile::rename(_path, newPath); + QFile::rename(saveLocation + QChar::fromLatin1('/') + encodeWalletName(_name) + QStringLiteral(".salt"), + saveLocation + QChar::fromLatin1('/') + encodeWalletName(newName) + QStringLiteral(".salt")); + + _name = newName; + _path = newPath; + + rc = openInternal(); + if (rc) { + return rc; + } + + return 0; +} + +bool Backend::isOpen() const +{ + return _open; +} + +QStringList Backend::folderList() const +{ + return _entries.keys(); +} + +QStringList Backend::entryList() const +{ + return _entries[_folder].keys(); +} + +Entry *Backend::readEntry(const QString &key) +{ + Entry *rc = nullptr; + + if (_open && hasEntry(key)) { + rc = _entries[_folder][key]; + } + + return rc; +} + +#if KWALLET_BUILD_DEPRECATED_SINCE(5, 72) +QList Backend::readEntryList(const QString &key) +{ + QList rc; + + if (!_open) { + return rc; + } + + // HACK: see Wallet::WalletPrivate::forEachItemThatMatches() + const QString pattern = QRegularExpression::wildcardToRegularExpression(key).replace( + QLatin1String("[^/]"), QLatin1String(".")); + const QRegularExpression re(pattern); + + const EntryMap &map = _entries[_folder]; + for (EntryMap::ConstIterator i = map.begin(); i != map.end(); ++i) { + if (re.match(i.key()).hasMatch()) { + rc.append(i.value()); + } + } + return rc; +} +#endif + +QList Backend::entriesList() const +{ + if (!_open) { + return QList(); + } + const EntryMap &map = _entries[_folder]; + + return map.values(); +} + + +bool Backend::createFolder(const QString &f) +{ + if (_entries.contains(f)) { + return false; + } + + _entries.insert(f, EntryMap()); + + QCryptographicHash folderMd5(QCryptographicHash::Md5); + folderMd5.addData(f.toUtf8()); + _hashes.insert(MD5Digest(folderMd5.result()), QList()); + + return true; +} + +int Backend::renameEntry(const QString &oldName, const QString &newName) +{ + EntryMap &emap = _entries[_folder]; + EntryMap::Iterator oi = emap.find(oldName); + EntryMap::Iterator ni = emap.find(newName); + + if (oi != emap.end() && ni == emap.end()) { + Entry *e = oi.value(); + emap.erase(oi); + emap[newName] = e; + + QCryptographicHash folderMd5(QCryptographicHash::Md5); + folderMd5.addData(_folder.toUtf8()); + + HashMap::iterator i = _hashes.find(MD5Digest(folderMd5.result())); + if (i != _hashes.end()) { + QCryptographicHash oldMd5(QCryptographicHash::Md5); + QCryptographicHash newMd5(QCryptographicHash::Md5); + oldMd5.addData(oldName.toUtf8()); + newMd5.addData(newName.toUtf8()); + i.value().removeAll(MD5Digest(oldMd5.result())); + i.value().append(MD5Digest(newMd5.result())); + } + return 0; + } + + return -1; +} + +void Backend::writeEntry(Entry *e) +{ + if (!_open) { + return; + } + + if (!hasEntry(e->key())) { + _entries[_folder][e->key()] = new Entry; + } + _entries[_folder][e->key()]->copy(e); + + QCryptographicHash folderMd5(QCryptographicHash::Md5); + folderMd5.addData(_folder.toUtf8()); + + HashMap::iterator i = _hashes.find(MD5Digest(folderMd5.result())); + if (i != _hashes.end()) { + QCryptographicHash md5(QCryptographicHash::Md5); + md5.addData(e->key().toUtf8()); + i.value().append(MD5Digest(md5.result())); + } +} + +bool Backend::hasEntry(const QString &key) const +{ + return _entries.contains(_folder) && _entries[_folder].contains(key); +} + +bool Backend::removeEntry(const QString &key) +{ + if (!_open) { + return false; + } + + FolderMap::Iterator fi = _entries.find(_folder); + EntryMap::Iterator ei = fi.value().find(key); + + if (fi != _entries.end() && ei != fi.value().end()) { + delete ei.value(); + fi.value().erase(ei); + QCryptographicHash folderMd5(QCryptographicHash::Md5); + folderMd5.addData(_folder.toUtf8()); + + HashMap::iterator i = _hashes.find(MD5Digest(folderMd5.result())); + if (i != _hashes.end()) { + QCryptographicHash md5(QCryptographicHash::Md5); + md5.addData(key.toUtf8()); + i.value().removeAll(MD5Digest(md5.result())); + } + return true; + } + + return false; +} + +bool Backend::removeFolder(const QString &f) +{ + if (!_open) { + return false; + } + + FolderMap::Iterator fi = _entries.find(f); + + if (fi != _entries.end()) { + if (_folder == f) { + _folder.clear(); + } + + for (EntryMap::Iterator ei = fi.value().begin(); ei != fi.value().end(); ++ei) { + delete ei.value(); + } + + _entries.erase(fi); + + QCryptographicHash folderMd5(QCryptographicHash::Md5); + folderMd5.addData(f.toUtf8()); + _hashes.remove(MD5Digest(folderMd5.result())); + return true; + } + + return false; +} + +bool Backend::folderDoesNotExist(const QString &folder) const +{ + QCryptographicHash md5(QCryptographicHash::Md5); + md5.addData(folder.toUtf8()); + return !_hashes.contains(MD5Digest(md5.result())); +} + +bool Backend::entryDoesNotExist(const QString &folder, const QString &entry) const +{ + QCryptographicHash md5(QCryptographicHash::Md5); + md5.addData(folder.toUtf8()); + HashMap::const_iterator i = _hashes.find(MD5Digest(md5.result())); + if (i != _hashes.end()) { + md5.reset(); + md5.addData(entry.toUtf8()); + return !i.value().contains(MD5Digest(md5.result())); + } + return true; +} + +void Backend::setPassword(const QByteArray &password) +{ + _passhash.fill(0); // empty just in case + BlowFish _bf; + CipherBlockChain bf(&_bf); + _passhash.resize(bf.keyLen() / 8); + _newPassHash.resize(bf.keyLen() / 8); + _newPassHash.fill(0); + + password2hash(password, _passhash); + + QByteArray salt; + QFile saltFile(getSaveLocation() + '/' + encodeWalletName(_name) + ".salt"); + if (!saltFile.exists() || saltFile.size() == 0) { + salt = createAndSaveSalt(saltFile.fileName()); + } else { + if (!saltFile.open(QIODevice::ReadOnly)) { + salt = createAndSaveSalt(saltFile.fileName()); + } else { + salt = saltFile.readAll(); + } + } + + if (!salt.isEmpty() && password2PBKDF2_SHA512(password, _newPassHash, salt) == 0) { + qCDebug(KWALLETBACKEND_LOG) << "Setting useNewHash to true"; + _useNewHash = true; + } +} + +#ifdef HAVE_GPGMEPP +const GpgME::Key &Backend::gpgKey() const +{ + return _gpgKey; +} +#endif diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/kwalletbackend.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/kwalletbackend.h new file mode 100644 index 0000000000..09f1c5bb87 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/kwalletbackend.h @@ -0,0 +1,234 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2001-2004 George Staikos + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef _KWALLETBACKEND_H +#define _KWALLETBACKEND_H + +#include "backendpersisthandler.h" +#include "kwalletbackend_export.h" +#include "kwalletentry.h" +#include +#include +#include + +#ifdef HAVE_GPGMEPP +#include +#endif // HAVE_GPGMEPP + +#define PBKDF2_SHA512_KEYSIZE 56 +#define PBKDF2_SHA512_SALTSIZE 56 +#define PBKDF2_SHA512_ITERATIONS 50000 + +namespace KWallet +{ +/** + * @internal + */ +class MD5Digest : public QByteArray +{ +public: + MD5Digest() + : QByteArray(16, 0) + { + } + MD5Digest(const char *data) + : QByteArray(data, 16) + { + } + MD5Digest(const QByteArray &digest) + : QByteArray(digest) + { + } + virtual ~MD5Digest() + { + } + + int operator<(const MD5Digest &r) const + { + int i = 0; + char x, y; + for (; i < 16; ++i) { + x = at(i); + y = r.at(i); + if (x != y) { + break; + } + } + if (i < 16 && x < y) { + return 1; + } + return 0; + } +}; + +/* @internal + */ +class KWALLETBACKEND_EXPORT Backend +{ +public: + explicit Backend(const QString &name = QStringLiteral("kdewallet"), bool isPath = false); + ~Backend(); + + // Open and unlock the wallet. + // If opening succeeds, the password's hash will be remembered. + // If opening fails, the password's hash will be cleared. + int open(const QByteArray &password, WId w = 0); +#ifdef HAVE_GPGMEPP + int open(const GpgME::Key &key); +#endif + + // Open and unlock the wallet using a pre-hashed password. + // If opening succeeds, the password's hash will be remembered. + // If opening fails, the password's hash will be cleared. + int openPreHashed(const QByteArray &passwordHash); + + // Close the wallet, losing any changes. + // if save is true, the wallet is saved prior to closing it. + int close(bool save = false); + + // Write the wallet to disk + int sync(WId w); + + // Returns true if the current wallet is open. + bool isOpen() const; + + // Returns the current wallet name. + const QString &walletName() const; + + // Rename the wallet + int renameWallet(const QString &newName, bool isPath = false); + + // The list of folders. + QStringList folderList() const; + + // Force creation of a folder. + bool createFolder(const QString &f); + + // Change the folder. + void setFolder(const QString &f) + { + _folder = f; + } + + // Current folder. If empty, it's the global folder. + const QString &folder() const + { + return _folder; + } + + // Does it have this folder? + bool hasFolder(const QString &f) const + { + return _entries.contains(f); + } + + // Look up an entry. Returns null if it doesn't exist. + Entry *readEntry(const QString &key); + +#if KWALLET_BUILD_DEPRECATED_SINCE(5, 72) + // Look up a list of entries. Supports wildcards. + // You delete the list. + // Deprecated since 5.72, use entriesList() + QList readEntryList(const QString &key); +#endif + + // Get a list of all the entries in the current folder. + // @since 5.72 + QList entriesList() const; + + // Store an entry. + void writeEntry(Entry *e); + + // Does this folder contain this entry? + bool hasEntry(const QString &key) const; + + // Returns true if the entry was removed + bool removeEntry(const QString &key); + + // Returns true if the folder was removed + bool removeFolder(const QString &f); + + // The list of entries in this folder. + QStringList entryList() const; + + // Rename an entry in this folder. + int renameEntry(const QString &oldName, const QString &newName); + + // Set the password used for opening/closing the wallet. + // This does not sync the wallet to disk! + void setPassword(const QByteArray &password); + + int ref() + { + return ++_ref; + } + + int deref(); + + int refCount() const + { + return _ref; + } + + static bool exists(const QString &wallet); + + bool folderDoesNotExist(const QString &folder) const; + + bool entryDoesNotExist(const QString &folder, const QString &entry) const; + + static QString openRCToString(int rc); + + void setCipherType(BackendCipherType ct); + BackendCipherType cipherType() const + { + return _cipherType; + } +#ifdef HAVE_GPGMEPP + const GpgME::Key &gpgKey() const; +#endif + + static QString getSaveLocation(); + static QString encodeWalletName(const QString &name); + static QString decodeWalletName(const QString &encodedName); + +private: + Q_DISABLE_COPY(Backend) + class BackendPrivate; + BackendPrivate *const d; + QString _name; + QString _path; + bool _open; + bool _useNewHash = false; + QString _folder; + int _ref = 0; + // Map Folder->Entries + typedef QMap EntryMap; + typedef QMap FolderMap; + FolderMap _entries; + typedef QMap> HashMap; + HashMap _hashes; + QByteArray _passhash; // password hash used for saving the wallet + QByteArray _newPassHash; // Modern hash using KWALLET_HASH_PBKDF2_SHA512 + BackendCipherType _cipherType; // the kind of encryption used for this wallet + +#ifdef HAVE_GPGMEPP + GpgME::Key _gpgKey; +#endif + friend class BlowfishPersistHandler; + friend class GpgPersistHandler; + + // open the wallet with the password already set. This is + // called internally by both open and openPreHashed. + int openInternal(WId w = 0); + int closeInternal(bool save); + void swapToNewHash(); + QByteArray createAndSaveSalt(const QString &path) const; +}; + +} + +#endif diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/kwalletentry.cc b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/kwalletentry.cc new file mode 100644 index 0000000000..3bc7dcfdfa --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/kwalletentry.cc @@ -0,0 +1,78 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2001-2003 George Staikos + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "kwalletentry.h" + +using namespace KWallet; +#include +#include + +Entry::Entry() +{ +} + +Entry::~Entry() +{ + _value.fill(0); +} + +const QString &Entry::key() const +{ + return _key; +} + +const QByteArray &Entry::value() const +{ + return _value; +} + +QString Entry::password() const +{ + QString x; + QDataStream qds(_value); + qds >> x; + return x; +} + +void Entry::setValue(const QByteArray &val) +{ + // do a direct copy from one into the other without + // temporary variables + _value.fill(0); + _value = val; +} + +void Entry::setValue(const QString &val) +{ + _value.fill(0); + QDataStream qds(&_value, QIODevice::WriteOnly); + qds << val; +} + +void Entry::setKey(const QString &key) +{ + _key = key; +} + +Wallet::EntryType Entry::type() const +{ + return _type; +} + +void Entry::setType(Wallet::EntryType type) +{ + _type = type; +} + +void Entry::copy(const Entry *x) +{ + _type = x->_type; + _key = x->_key; + _value.fill(0); + _value = x->_value; +} + diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/kwalletentry.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/kwalletentry.h new file mode 100644 index 0000000000..2f92da0e07 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/kwalletentry.h @@ -0,0 +1,52 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2001-2003 George Staikos + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef _KWALLETENTRY_H +#define _KWALLETENTRY_H + +#include + +#include + +#include "kwalletbackend_export.h" + +namespace KWallet +{ +/* @internal + */ +class KWALLETBACKEND_EXPORT Entry +{ +public: + Entry(); + ~Entry(); + + const QString &key() const; + const QByteArray &value() const; + QString password() const; + const QByteArray &map() const + { + return value(); + } + + void setValue(const QByteArray &val); + void setValue(const QString &val); + void setKey(const QString &key); + + Wallet::EntryType type() const; + void setType(Wallet::EntryType type); + + void copy(const Entry *x); + +private: + QString _key; + QByteArray _value; + Wallet::EntryType _type; +}; + +} + +#endif diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/sha1.cc b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/sha1.cc new file mode 100644 index 0000000000..42fcab6651 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/sha1.cc @@ -0,0 +1,341 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2001 George Staikos + + Based heavily on SHA1 code from GPG 1.0.3: + SPDX-FileCopyrightText: 1998 FSF + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "sha1.h" + +#include + +// DO NOT INCLUDE THIS. IT BREAKS KWALLET. +// We need to live with -Wundef until someone really figures out the problem. +//#include // for Q_BYTE_ORDER and friends +// Workaround for -Wundef +#define Q_BIG_ENDIAN 1 +#define Q_BYTE_ORDER Q_BIG_ENDIAN + +#include +#if HAVE_SYS_BITYPES_H +#include /* For uintXX_t on Tru64 */ +#endif +#if HAVE_STDINT_H +#include +#endif + +#include + +// clang-format off +// FIXME: this can be optimized to one instruction on most cpus. +#define rol(x,y) ((x << y) | (x >> (32-y))) + +#define K1 0x5a827999L +#define K2 0x6ed9eba1L +#define K3 0x8f1bbcdcL +#define K4 0xca62c1d6L +#define F1(x,y,z) ( z ^ ( x & ( y ^ z ) ) ) +#define F2(x,y,z) ( x ^ y ^ z ) +#define F3(x,y,z) ( ( x & y ) | ( z & ( x | y ) ) ) +#define F4(x,y,z) ( x ^ y ^ z ) + +#define M(i) ( tm = x[i&0x0f] ^ x[(i-14)&0x0f] \ + ^ x[(i-8)&0x0f] ^ x[(i-3)&0x0f] \ + , (x[i&0x0f] = (tm << 1) | (tm >> 31))) + +#define R(a,b,c,d,e,f,k,m) do { e += rol(a, 5) \ + + f(b, c, d) \ + + k \ + + m; \ + b = rol(b, 30); \ +} while(0) +// clang-format on + +SHA1::SHA1() +{ + _hashlen = 160; + _init = false; + reset(); +} + +int SHA1::reset() +{ + _h0 = 0x67452301; + _h1 = 0xefcdab89; + _h2 = 0x98badcfe; + _h3 = 0x10325476; + _h4 = 0xc3d2e1f0; + _nblocks = 0; + _count = 0; + memset(_buf, 0, 56); // clear the buffer + + _init = true; + return 0; +} + +int SHA1::size() const +{ + return _hashlen; +} + +SHA1::~SHA1() +{ + +} + +void SHA1::transform(void *data) +{ + unsigned int a; + unsigned int b; + unsigned int c; + unsigned int d; + unsigned int e; + unsigned int tm; + unsigned int x[16]; + unsigned char *_data = (unsigned char *)data; + + a = _h0; + b = _h1; + c = _h2; + d = _h3; + e = _h4; + +#if Q_BYTE_ORDER == Q_BIG_ENDIAN + memcpy(x, _data, 64); +#else + int i; + unsigned char *p2; + for (i = 0, p2 = (unsigned char *)x; + i < 16; i++, p2 += 4) { + p2[3] = *_data++; + p2[2] = *_data++; + p2[1] = *_data++; + p2[0] = *_data++; + } +#endif + + R(a, b, c, d, e, F1, K1, x[ 0]); + R(e, a, b, c, d, F1, K1, x[ 1]); + R(d, e, a, b, c, F1, K1, x[ 2]); + R(c, d, e, a, b, F1, K1, x[ 3]); + R(b, c, d, e, a, F1, K1, x[ 4]); + R(a, b, c, d, e, F1, K1, x[ 5]); + R(e, a, b, c, d, F1, K1, x[ 6]); + R(d, e, a, b, c, F1, K1, x[ 7]); + R(c, d, e, a, b, F1, K1, x[ 8]); + R(b, c, d, e, a, F1, K1, x[ 9]); + R(a, b, c, d, e, F1, K1, x[10]); + R(e, a, b, c, d, F1, K1, x[11]); + R(d, e, a, b, c, F1, K1, x[12]); + R(c, d, e, a, b, F1, K1, x[13]); + R(b, c, d, e, a, F1, K1, x[14]); + R(a, b, c, d, e, F1, K1, x[15]); + R(e, a, b, c, d, F1, K1, M(16)); + R(d, e, a, b, c, F1, K1, M(17)); + R(c, d, e, a, b, F1, K1, M(18)); + R(b, c, d, e, a, F1, K1, M(19)); + R(a, b, c, d, e, F2, K2, M(20)); + R(e, a, b, c, d, F2, K2, M(21)); + R(d, e, a, b, c, F2, K2, M(22)); + R(c, d, e, a, b, F2, K2, M(23)); + R(b, c, d, e, a, F2, K2, M(24)); + R(a, b, c, d, e, F2, K2, M(25)); + R(e, a, b, c, d, F2, K2, M(26)); + R(d, e, a, b, c, F2, K2, M(27)); + R(c, d, e, a, b, F2, K2, M(28)); + R(b, c, d, e, a, F2, K2, M(29)); + R(a, b, c, d, e, F2, K2, M(30)); + R(e, a, b, c, d, F2, K2, M(31)); + R(d, e, a, b, c, F2, K2, M(32)); + R(c, d, e, a, b, F2, K2, M(33)); + R(b, c, d, e, a, F2, K2, M(34)); + R(a, b, c, d, e, F2, K2, M(35)); + R(e, a, b, c, d, F2, K2, M(36)); + R(d, e, a, b, c, F2, K2, M(37)); + R(c, d, e, a, b, F2, K2, M(38)); + R(b, c, d, e, a, F2, K2, M(39)); + R(a, b, c, d, e, F3, K3, M(40)); + R(e, a, b, c, d, F3, K3, M(41)); + R(d, e, a, b, c, F3, K3, M(42)); + R(c, d, e, a, b, F3, K3, M(43)); + R(b, c, d, e, a, F3, K3, M(44)); + R(a, b, c, d, e, F3, K3, M(45)); + R(e, a, b, c, d, F3, K3, M(46)); + R(d, e, a, b, c, F3, K3, M(47)); + R(c, d, e, a, b, F3, K3, M(48)); + R(b, c, d, e, a, F3, K3, M(49)); + R(a, b, c, d, e, F3, K3, M(50)); + R(e, a, b, c, d, F3, K3, M(51)); + R(d, e, a, b, c, F3, K3, M(52)); + R(c, d, e, a, b, F3, K3, M(53)); + R(b, c, d, e, a, F3, K3, M(54)); + R(a, b, c, d, e, F3, K3, M(55)); + R(e, a, b, c, d, F3, K3, M(56)); + R(d, e, a, b, c, F3, K3, M(57)); + R(c, d, e, a, b, F3, K3, M(58)); + R(b, c, d, e, a, F3, K3, M(59)); + R(a, b, c, d, e, F4, K4, M(60)); + R(e, a, b, c, d, F4, K4, M(61)); + R(d, e, a, b, c, F4, K4, M(62)); + R(c, d, e, a, b, F4, K4, M(63)); + R(b, c, d, e, a, F4, K4, M(64)); + R(a, b, c, d, e, F4, K4, M(65)); + R(e, a, b, c, d, F4, K4, M(66)); + R(d, e, a, b, c, F4, K4, M(67)); + R(c, d, e, a, b, F4, K4, M(68)); + R(b, c, d, e, a, F4, K4, M(69)); + R(a, b, c, d, e, F4, K4, M(70)); + R(e, a, b, c, d, F4, K4, M(71)); + R(d, e, a, b, c, F4, K4, M(72)); + R(c, d, e, a, b, F4, K4, M(73)); + R(b, c, d, e, a, F4, K4, M(74)); + R(a, b, c, d, e, F4, K4, M(75)); + R(e, a, b, c, d, F4, K4, M(76)); + R(d, e, a, b, c, F4, K4, M(77)); + R(c, d, e, a, b, F4, K4, M(78)); + R(b, c, d, e, a, F4, K4, M(79)); + + _h0 += a; + _h1 += b; + _h2 += c; + _h3 += d; + _h4 += e; + +} + +bool SHA1::readyToGo() const +{ + return _init; +} + +int SHA1::process(const void *block, int len) +{ + if (!_init) { + return -1; + } + + unsigned char *_block = (unsigned char *)block; + + int cnt = 0; + // Flush the buffer before proceeding + if (_count == 64) { + transform(_buf); + _count = 0; + _nblocks++; + } + + if (!_block) { + return 0; + } + + if (_count) { + for (; len && _count < 64; --len, ++cnt) { + _buf[_count++] = *_block++; + } + process(nullptr, 0); // flush the buffer if necessary + if (!len) { + return cnt; + } + } + + while (len >= 64) { + transform(_block); + _count = 0; + _nblocks++; + len -= 64; + cnt += 64; + _block += 64; + } + + for (; len && _count < 64; --len, ++cnt) { + _buf[_count++] = *_block++; + } + + return cnt; +} + +const unsigned char *SHA1::hash() +{ + unsigned int t; + unsigned int msb; + unsigned int lsb; + unsigned char *p; + + if (!_init) { + return (unsigned char *)_buf; + } + + process(nullptr, 0); + + msb = 0; + t = _nblocks; + + if ((lsb = t << 6) < t) { + msb++; + } + + msb += t >> 26; + t = lsb; + + if ((lsb = t + _count) < t) { + msb++; + } + + t = lsb; + + if ((lsb = t << 3) < t) { + msb++; + } + + msb += t >> 29; + + _buf[_count++] = 0x80; + + if (_count < 56) { + while (_count < 56) { + _buf[_count++] = 0; + } + } else { + while (_count < 64) { + _buf[_count++] = 0; + } + process(nullptr, 0); + memset(_buf, 0, 56); + } + + _buf[56] = msb >> 24; + _buf[57] = msb >> 16; + _buf[58] = msb >> 8; + _buf[59] = msb; + _buf[60] = lsb >> 24; + _buf[61] = lsb >> 16; + _buf[62] = lsb >> 8; + _buf[63] = lsb; + + transform(_buf); + + p = _buf; +// clang-format off +#if Q_BYTE_ORDER == Q_BIG_ENDIAN +#define X(a) do { *(uint32_t *)p = _h##a; p += 4; } while (0) +#else +#define X(a) do { *p++ = _h##a >> 24; *p++ = _h##a >> 16; \ + *p++ = _h##a >> 8; *p++ = _h##a; } while (0) +#endif +// clang-format on + + X(0); + X(1); + X(2); + X(3); + X(4); + +#undef X + + _init = false; + + return (unsigned char *)_buf; +} diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/sha1.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/sha1.h new file mode 100644 index 0000000000..794d636a28 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/sha1.h @@ -0,0 +1,61 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2001 George Staikos + + Based heavily on SHA1 code from GPG 1.0.3: + SPDX-FileCopyrightText: 1998 FSF + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef __sha1__ko__h +#define __sha1__ko__h + +#include "kwalletbackend_export.h" + +/* @internal + */ +class KWALLETBACKEND_EXPORT SHA1 +{ +public: + SHA1(); + ~SHA1(); + + /* + * The number of bits in the hash generated. + */ + int size() const; + + /* + * True if all settings are good and we are ready to hash. + */ + bool readyToGo() const; + + /* + * Process a block of data for the hash function. + */ + int process(const void *block, int len); + + /* + * Return the digest as a 20 byte array reference. + * Calling this makes readyToGo() == false. + */ + const unsigned char *hash(); + + /* + * Reset the digest so a new one can be calculated. + */ + int reset(); + +protected: + int _hashlen; + bool _init; + + long _h0, _h1, _h2, _h3, _h4; + long _nblocks; + int _count; + unsigned char _buf[64]; + void transform(void *data); +}; + +#endif diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/tests/CMakeLists.txt b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/tests/CMakeLists.txt new file mode 100644 index 0000000000..b4a65b666c --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/tests/CMakeLists.txt @@ -0,0 +1,22 @@ +set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} ) + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_BINARY_DIR}/.. +) + +include(ECMMarkAsTest) + +macro(kwallet_executable_tests) + foreach(_testname ${ARGN}) + add_executable(${_testname} ${_testname}.cpp) + ecm_mark_as_test(${_testname}) + target_link_libraries(${_testname} Qt6::Widgets KF6WalletBackend) + endforeach(_testname) +endmacro() + +kwallet_executable_tests( + backendtest + testbf + testsha +) diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/tests/backendtest.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/tests/backendtest.cpp new file mode 100644 index 0000000000..77f15d3907 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/tests/backendtest.cpp @@ -0,0 +1,43 @@ +#include +#include + +#include +#include + +#include "kwalletbackend.h" + +int main(int argc, char **argv) +{ + QApplication a(argc, argv); + a.setApplicationName(QStringLiteral("backendtest")); + + KWallet::Backend be(QStringLiteral("ktestwallet")); + printf("KWalletBackend constructed\n"); + + QByteArray apass("apassword", 9); + QByteArray bpass("bpassword", 9); + + printf("Passwords initialised.\n"); + be.setPassword(apass); + int rc = be.close(true); + + printf("be.close(true) returned %d (should be -255)\n", rc); + + rc = be.open(bpass); + + printf("be.open(bpass) returned %d (should be 0 or 1)\n", rc); + + rc = be.close(true); + + printf("be.close(true) returned %d (should be 0)\n", rc); + + rc = be.open(apass); + + printf("be.open(apass) returned %d (should be negative)\n", rc); + + rc = be.open(bpass); + + printf("be.open(bpass) returned %d (should be 0)\n", rc); + + return 0; +} diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/tests/testbf.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/tests/testbf.cpp new file mode 100644 index 0000000000..31ea014e37 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/tests/testbf.cpp @@ -0,0 +1,63 @@ +#include "blowfish.h" +#include "cbc.h" +#include +#include +#include + +int main() +{ + BlockCipher *bf; + char data[] = "This is a test."; + const char expect[] = "\x3f\x3c\x2d\xae\x8c\x7\x84\xf2\xa7\x6d\x28\xbd\xd\xb\xb8\x79"; + char key[] = "testkey"; + unsigned long et[] = {0x11223344}; + + printf("%d: 0x11 == %d and 0x44 == %d\n", ((unsigned char *)et)[0], 0x11, 0x44); + bf = new BlowFish(); + // bf = new CipherBlockChain(new BlowFish()); + + bf->setKey((void *)key, 7 * 8); + + if (!bf->readyToGo()) { + printf("Error: not ready to go!\n"); + return -1; + } + + printf("About to encrypt...\n"); + fflush(stdout); + if (-1 == bf->encrypt((void *)data, 16)) { + printf("Error: encrypt failed!\n"); + return -1; + } + + printf("Encryption done. data[] is now: "); + for (int i = 0; i < 16; i++) { + printf("0x%x ", data[i] & 0xff); + if ((data[i] & 0xff) != (expect[i] & 0xff)) { + printf("Error. This byte failed the comparison. It should have been 0x%x.\n", expect[i] & 0xff); + break; + } + } + printf("\n"); + + delete bf; + bf = new BlowFish(); + // bf = new CipherBlockChain(new BlowFish()); + bf->setKey((void *)key, 7 * 8); + + printf("About to decrypt...\n"); + fflush(stdout); + if (-1 == bf->decrypt((void *)data, 16)) { + printf("Error: decrypt failed!\n"); + return -1; + } + // bf->decrypt((void *)(data+8), 8); + + printf("All done! Result... data[] = \"%s\"\n", data); + if (strcmp(data, "This is a test.")) { + printf("ERROR. Decryption failed.\n"); + return -1; + } + + delete bf; +} diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/tests/testsha.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/tests/testsha.cpp new file mode 100644 index 0000000000..95e5c83173 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletbackend/tests/testsha.cpp @@ -0,0 +1,45 @@ +#include "sha1.h" +#include +#include +#include + +int main() +{ + SHA1 *sha1; + unsigned char data[] = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"; + unsigned long et[] = {0x11223344}; + int rc; + + printf("%d: 0x11 == %d and 0x44 == %d\n", ((unsigned char *)et)[0], 0x11, 0x44); + sha1 = new SHA1(); + + if (!sha1->readyToGo()) { + printf("Error: not ready to go!\n"); + return -1; + } + + printf("About to process [%s]\n", data); + rc = sha1->process(data, strlen((char *)data)); + + if (rc != strlen((char *)data)) { + printf("Error processing the data. rc=%d\n", rc); + } else { + printf("Done.\n"); + } + + const unsigned char *res = sha1->hash(); + + if (res) { + for (int i = 0; i < 20; i++) { + printf("%.2X", *res++); + if (i > 0 && (i - 1) % 2 == 0) { + printf(" "); + } + } + printf("\n"); + } else { + printf("Error - getHash() returned NULL!\n"); + } + + delete sha1; +} diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletd/secretserviceclient.cpp b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletd/secretserviceclient.cpp new file mode 100644 index 0000000000..3293a63956 --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletd/secretserviceclient.cpp @@ -0,0 +1,895 @@ +/* + SPDX-FileCopyrightText: 2024 Marco Martin + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "secretserviceclient.h" +#include "kwalletd_debug.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Copied from +// https://github.com/frankosterfeld/qtkeychain/blob/main/qtkeychain/libsecret.cpp +// This is intended to be a data format compatible with QtKeychain +const SecretSchema *qtKeychainSchema(void) +{ + static const SecretSchema schema = { + "org.qt.keychain", + SECRET_SCHEMA_DONT_MATCH_NAME, + {{"user", SECRET_SCHEMA_ATTRIBUTE_STRING}, {"server", SECRET_SCHEMA_ATTRIBUTE_STRING}, {"type", SECRET_SCHEMA_ATTRIBUTE_STRING}}}; + + return &schema; +} + +// Custom deleters for non GObject things +struct GListDeleter { + void operator()(GList *list) const + { + if (list) { + g_list_free(list); + } + } +}; + +struct GHashTableDeleter { + void operator()(GHashTable *table) const + { + if (table) { + g_hash_table_destroy(table); + } + } +}; + +struct SecretValueDeleter { + void operator()(SecretValue *value) const + { + if (value) { + secret_value_unref(value); + } + } +}; + +using GListPtr = std::unique_ptr; +using GHashTablePtr = std::unique_ptr; +using SecretValuePtr = std::unique_ptr; + +static bool wasErrorFree(GError **error) +{ + if (!*error) { + return true; + } + qCWarning(KWALLETD_LOG) << QString::fromUtf8((*error)->message); + g_error_free(*error); + *error = nullptr; + return false; +} + +static QString typeToString(SecretServiceClient::Type type) +{ + // Similar to QtKeychain implementation: adds the "map" datatype + switch (type) { + case SecretServiceClient::Base64: + return QStringLiteral("base64"); + case SecretServiceClient::Binary: + return QStringLiteral("binary"); + case SecretServiceClient::Map: + return QStringLiteral("map"); + default: + return QStringLiteral("plaintext"); + } +} + +static SecretServiceClient::Type stringToType(const QString &typeName) +{ + if (typeName == QStringLiteral("binary")) { + return SecretServiceClient::Binary; + } else if (typeName == QStringLiteral("base64")) { + return SecretServiceClient::Base64; + } else if (typeName == QStringLiteral("map")) { + return SecretServiceClient::Map; + } else { + return SecretServiceClient::PlainText; + } +} + +SecretServiceClient::SecretServiceClient(QObject *parent) + : QObject(parent) +{ + KConfig cfg(QStringLiteral("kwalletrc")); + KConfigGroup ksecretGroup(&cfg, QStringLiteral("KSecretD")); + m_useKSecretBackend = ksecretGroup.readEntry("Enabled", true); + + if (m_useKSecretBackend) { + // Tell libsecret where the secretservice api is + qputenv("SECRET_SERVICE_BUS_NAME", "org.kde.secretservicecompat"); + m_serviceBusName = QStringLiteral("org.kde.secretservicecompat"); + } else { + m_serviceBusName = QStringLiteral("org.freedesktop.secrets"); + } + + m_collectionDirtyTimer = new QTimer(this); + m_collectionDirtyTimer->setSingleShot(true); + m_collectionDirtyTimer->setInterval(100); + connect(m_collectionDirtyTimer, &QTimer::timeout, this, [this]() { + for (const QString &collection : std::as_const(m_dirtyCollections)) { + Q_EMIT collectionDirty(collection); + } + m_dirtyCollections.clear(); + }); + + m_serviceWatcher = new QDBusServiceWatcher(m_serviceBusName, QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this); + + connect(m_serviceWatcher, &QDBusServiceWatcher::serviceOwnerChanged, this, &SecretServiceClient::onServiceOwnerChanged); + + // Unconditionally try to connect to the service without checking it exists: + // it will try to dbus-activate it if not running + if (attemptConnection()) { + bool ok = false; + for (const QString &collection : listCollections(&ok)) { + watchCollection(collection, &ok); + } + } + + QDBusConnection bus = QDBusConnection::sessionBus(); + + // React to collections being created, either by us or somebody else + bus.connect(m_serviceBusName, + QStringLiteral("/org/freedesktop/secrets"), + QStringLiteral("org.freedesktop.Secret.Service"), + QStringLiteral("CollectionCreated"), + this, + SLOT(onCollectionCreated(QDBusObjectPath))); + bus.connect(m_serviceBusName, + QStringLiteral("/org/freedesktop/secrets"), + QStringLiteral("org.freedesktop.Secret.Service"), + QStringLiteral("CollectionDeleted"), + this, + SLOT(onCollectionDeleted(QDBusObjectPath))); +} + +QString SecretServiceClient::collectionLabelForPath(const QDBusObjectPath &path) +{ + if (!attemptConnection()) { + return {}; + } + QDBusInterface collectionInterface(m_serviceBusName, path.path(), QStringLiteral("org.freedesktop.Secret.Collection"), QDBusConnection::sessionBus()); + + if (!collectionInterface.isValid()) { + qCWarning(KWALLETD_LOG) << "Failed to connect to the DBus collection object:" << path.path(); + return {}; + } + + QVariant reply = collectionInterface.property("Label"); + + if (!reply.isValid()) { + qCWarning(KWALLETD_LOG) << "Error reading label:" << collectionInterface.lastError(); + return {}; + } + + return reply.toString(); +} + +SecretCollection *SecretServiceClient::retrieveCollection(const QString &name) +{ + if (!attemptConnection()) { + return nullptr; + } + + auto it = m_openCollections.find(name); + if (it != m_openCollections.end()) { + return it->second.get(); + } + + GListPtr collections = GListPtr(secret_service_get_collections(m_service.get())); + + for (GList *l = collections.get(); l != nullptr; l = l->next) { + SecretCollectionPtr colPtr = SecretCollectionPtr(SECRET_COLLECTION(l->data)); + const gchar *label = secret_collection_get_label(colPtr.get()); + if (QString::fromUtf8(label) == name) { + m_openCollections.insert(std::make_pair(name, std::move(colPtr))); + SecretCollection *collection = colPtr.get(); + return collection; + } + } + + return nullptr; +} + +SecretItemPtr +SecretServiceClient::retrieveItem(const QString &key, const SecretServiceClient::Type type, const QString &folder, const QString &collectionName, bool *ok) +{ + GError *error = nullptr; + + SecretCollection *collection = retrieveCollection(collectionName); + + GHashTablePtr attributes = GHashTablePtr(g_hash_table_new(g_str_hash, g_str_equal)); + g_hash_table_insert(attributes.get(), g_strdup("server"), g_strdup(folder.toUtf8().constData())); + g_hash_table_insert(attributes.get(), g_strdup("user"), g_strdup(key.toUtf8().constData())); + if (type != Unknown) { + g_hash_table_insert(attributes.get(), g_strdup("type"), g_strdup(typeToString(type).toUtf8().constData())); + } + + GListPtr glist = GListPtr(secret_collection_search_sync(collection, + qtKeychainSchema(), + attributes.get(), + static_cast(SECRET_SEARCH_ALL | SECRET_SEARCH_LOAD_SECRETS), + nullptr, + &error)); + + *ok = wasErrorFree(&error); + if (!*ok) { + return nullptr; + } + + SecretItem *item = nullptr; + if (glist) { + GList *iter = glist.get(); + if (iter != nullptr) { + item = static_cast(iter->data); + } + + } else { + qCWarning(KWALLETD_LOG) << i18n("Item not found"); + *ok = false; + } + + return SecretItemPtr(item); +} + +bool SecretServiceClient::attemptConnection() +{ + if (m_service) { + return true; + } + + GError *error = nullptr; + m_service = SecretServicePtr( + secret_service_get_sync(static_cast(SECRET_SERVICE_OPEN_SESSION | SECRET_SERVICE_LOAD_COLLECTIONS), nullptr, &error)); + + bool ok = wasErrorFree(&error); + + if (!ok || !m_service) { + qCWarning(KWALLETD_LOG) << i18n("Could not connect to Secret Service"); + return false; + } + + return true; +} + +void SecretServiceClient::watchCollection(const QString &collectionName, bool *ok) +{ + if (m_watchedCollections.contains(collectionName)) { + *ok = true; + return; + } + + SecretCollection *collection = retrieveCollection(collectionName); + + GObjectPtr proxy = GObjectPtr(G_DBUS_PROXY(collection)); + const QString path = QString::fromUtf8(g_strdup(g_dbus_proxy_get_object_path(proxy.get()))); + if (path.isEmpty()) { + *ok = false; + return; + } + + QDBusConnection::sessionBus().connect(m_serviceBusName, + path, + QStringLiteral("org.freedesktop.Secret.Collection"), + QStringLiteral("ItemChanged"), + this, + SLOT(onSecretItemChanged(QDBusObjectPath))); + QDBusConnection::sessionBus().connect(m_serviceBusName, + path, + QStringLiteral("org.freedesktop.Secret.Collection"), + QStringLiteral("ItemCreated"), + this, + SLOT(onSecretItemChanged(QDBusObjectPath))); + QDBusConnection::sessionBus().connect(m_serviceBusName, + path, + QStringLiteral("org.freedesktop.Secret.Collection"), + QStringLiteral("ItemDeleted"), + this, + SLOT(onSecretItemChanged(QDBusObjectPath))); + + m_watchedCollections.insert(collectionName); + *ok = true; +} + +void SecretServiceClient::onServiceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner) +{ + Q_UNUSED(serviceName); + Q_UNUSED(oldOwner); + + bool available = !newOwner.isEmpty(); + + m_openCollections.clear(); + + if (available && !m_service) { + GError *error = nullptr; + m_service = SecretServicePtr( + secret_service_get_sync(static_cast(SECRET_SERVICE_OPEN_SESSION | SECRET_SERVICE_LOAD_COLLECTIONS), nullptr, &error)); + available = wasErrorFree(&error); + } + + if (!available) { + m_service.reset(); + } + + qDebug() << "Secret Service availability changed:" << (available ? "Available" : "Unavailable"); + Q_EMIT serviceChanged(); +} + +void SecretServiceClient::onCollectionCreated(const QDBusObjectPath &path) +{ + const QString label = collectionLabelForPath(path); + if (label.isEmpty()) { + return; + } + + Q_EMIT collectionCreated(label); + Q_EMIT collectionListDirty(); +} + +void SecretServiceClient::onCollectionDeleted(const QDBusObjectPath &path) +{ + Q_UNUSED(path); + if (!attemptConnection()) { + return; + } + + // Only emitting collectionListDirty here as we can't know the actual label + // of the collection as is already deleted + Q_EMIT collectionListDirty(); +} + +void SecretServiceClient::onSecretItemChanged(const QDBusObjectPath &path) +{ + if (!attemptConnection()) { + return; + } + + // Don't trigger a reload if we did changes ourselves + if (m_updateInProgress) { + m_updateInProgress = false; + return; + } + + QStringList pieces = path.path().split(QStringLiteral("/"), Qt::SkipEmptyParts); + + // 6 items: /org/freedesktop/secrets/collection/collectionName/itemName + if (pieces.length() != 6) { + return; + } + pieces.pop_back(); + const QString collectionPath = QStringLiteral("/") % pieces.join(QStringLiteral("/")); + + const QString label = collectionLabelForPath(QDBusObjectPath(collectionPath)); + if (label.isEmpty()) { + return; + } + + m_dirtyCollections.insert(label); + m_collectionDirtyTimer->start(); +} + +void SecretServiceClient::handlePrompt(bool dismissed) +{ + Q_EMIT promptClosed(!dismissed); +} + +bool SecretServiceClient::useKSecretBackend() const +{ + return m_useKSecretBackend; +} + +bool SecretServiceClient::isAvailable() const +{ + return m_service != nullptr; +} + +bool SecretServiceClient::unlockCollection(const QString &collectionName, bool *ok) +{ + if (!attemptConnection()) { + *ok = false; + return false; + } + + GError *error = nullptr; + + SecretCollection *collection = retrieveCollection(collectionName); + + if (!collection) { + *ok = false; + return false; + } + + watchCollection(collectionName, ok); + + gboolean locked = secret_collection_get_locked(collection); + + if (locked) { + gboolean success = secret_service_unlock_sync(m_service.get(), g_list_append(nullptr, collection), nullptr, nullptr, &error); + *ok = wasErrorFree(&error); + if (!success) { + qCWarning(KWALLETD_LOG) << i18n("Unable to unlock collectionName %1", collectionName); + } + return success; + } + + return true; +} + +QString SecretServiceClient::defaultCollection(bool *ok) +{ + if (!attemptConnection()) { + *ok = false; + return QString(); + } + + QString label = QStringLiteral("kdewallet"); + + QDBusInterface serviceInterface(m_serviceBusName, + QStringLiteral("/org/freedesktop/secrets"), + QStringLiteral("org.freedesktop.Secret.Service"), + QDBusConnection::sessionBus()); + + if (!serviceInterface.isValid()) { + qCWarning(KWALLETD_LOG) << "Failed to connect to the DBus SecretService object"; + *ok = false; + return label; + } + + QDBusReply reply = serviceInterface.call(QStringLiteral("ReadAlias"), QStringLiteral("default")); + + if (!reply.isValid()) { + qCWarning(KWALLETD_LOG) << "Error reading label:" << reply.error().message(); + *ok = false; + return label; + } + + label = collectionLabelForPath(reply.value()); + + if (label.isEmpty()) { + *ok = false; + return QStringLiteral("kdewallet"); + } + + return label; +} + +void SecretServiceClient::setDefaultCollection(const QString &collectionName, bool *ok) +{ + if (!attemptConnection()) { + *ok = false; + return; + } + + GError *error = nullptr; + + SecretCollection *collection = retrieveCollection(collectionName); + + *ok = secret_service_set_alias_sync(m_service.get(), "default", collection, nullptr, &error); + + *ok = *ok && wasErrorFree(&error); +} + +QStringList SecretServiceClient::listCollections(bool *ok) +{ + if (!attemptConnection()) { + *ok = false; + return QStringList(); + } + + GError *error = nullptr; + + // secret_service_get_collections might be cached and can return stale contents + // force a reload of the collection list, see BUG:512135 + secret_service_load_collections_sync(m_service.get(), nullptr, &error); + if (!wasErrorFree(&error)) { + *ok = false; + return QStringList(); + } + GListPtr glist = GListPtr(secret_service_get_collections(m_service.get())); + + QStringList collections; + + if (glist) { + for (GList *iter = glist.get(); iter != nullptr; iter = iter->next) { + SecretCollection *collection = SECRET_COLLECTION(iter->data); + const gchar *rawLabel = secret_collection_get_label(collection); + const QString label = QString::fromUtf8(rawLabel); + if (!label.isEmpty()) { + collections.append(label); + } + } + } else { + qCDebug(KWALLETD_LOG) << i18n("No collections"); + } + + *ok = true; + return collections; +} + +QStringList SecretServiceClient::listFolders(const QString &collectionName, bool *ok) +{ + if (!attemptConnection()) { + *ok = false; + return {}; + } + + QSet folders; + + SecretCollection *collection = retrieveCollection(collectionName); + + if (!collection) { + *ok = false; + return {}; + } + GListPtr glist = GListPtr(secret_collection_get_items(collection)); + + if (glist) { + for (GList *iter = glist.get(); iter != nullptr; iter = iter->next) { + SecretItem *item = static_cast(iter->data); + + GHashTable *attributes = secret_item_get_attributes(item); + if (attributes) { + const gchar *value = (const char *)g_hash_table_lookup(attributes, "server"); + if (value) { + folders.insert(QString::fromUtf8(value)); + } + } + } + } else { + qCDebug(KWALLETD_LOG) << i18n("No entries"); + } + *ok = true; + return folders.values(); +} + +QStringList SecretServiceClient::listEntries(const QString &folder, const QString &collectionName, bool *ok) +{ + if (!attemptConnection()) { + *ok = false; + return {}; + } + + // TODO: deduplicate + QSet items; + GError *error = nullptr; + + SecretCollection *collection = retrieveCollection(collectionName); + + if (!collection) { + *ok = false; + return {}; + } + + GHashTablePtr attributes = GHashTablePtr(g_hash_table_new(g_str_hash, g_str_equal)); + g_hash_table_insert(attributes.get(), g_strdup("server"), g_strdup(folder.toUtf8().constData())); + + GListPtr glist = GListPtr(secret_collection_search_sync(collection, qtKeychainSchema(), attributes.get(), SECRET_SEARCH_ALL, nullptr, &error)); + + *ok = wasErrorFree(&error); + if (!*ok) { + return QStringList(); + } + + if (glist) { + for (GList *iter = glist.get(); iter != nullptr; iter = iter->next) { + SecretItemPtr item = SecretItemPtr(static_cast(iter->data)); + GHashTablePtr attributes = GHashTablePtr(secret_item_get_attributes(item.get())); + + if (attributes) { + const gchar *value = (const char *)g_hash_table_lookup(attributes.get(), "user"); + if (value) { + items.insert(QString::fromUtf8(value)); + } + } + } + } else { + qCDebug(KWALLETD_LOG) << i18n("No entries"); + } + + return items.values(); +} + +QHash SecretServiceClient::readMetadata(const QString &key, const QString &folder, const QString &collectionName, bool *ok) +{ + if (!attemptConnection()) { + *ok = false; + return {}; + } + + QHash hash; + + SecretItemPtr item = retrieveItem(key, Unknown, folder, collectionName, ok); + + if (!item) { + qCWarning(KWALLETD_LOG) << i18n("Entry not found, key: %1, folder: %2", key, folder); + return hash; + } + + GHashTablePtr attributes = GHashTablePtr(secret_item_get_attributes(item.get())); + + if (attributes) { + GHashTableIter attrIter; + gpointer key, value; + g_hash_table_iter_init(&attrIter, attributes.get()); + while (g_hash_table_iter_next(&attrIter, &key, &value)) { + QString keyString = QString::fromUtf8(static_cast(key)); + QString valueString = QString::fromUtf8(static_cast(value)); + hash.insert(keyString, valueString); + } + } + + return hash; +} + +void SecretServiceClient::createCollection(const QString &collectionName, bool *ok) +{ + if (!attemptConnection()) { + *ok = false; + return; + } + + GError *error = nullptr; + + secret_collection_create_sync(m_service.get(), collectionName.toUtf8().data(), nullptr, SECRET_COLLECTION_CREATE_NONE, nullptr, &error); + + *ok = wasErrorFree(&error); +} + +void SecretServiceClient::deleteCollection(const QString &collectionName, bool *ok) +{ + if (!attemptConnection()) { + *ok = false; + return; + } + + GError *error = nullptr; + + SecretCollection *collection = retrieveCollection(collectionName); + + *ok = secret_collection_delete_sync(collection, nullptr, &error); + m_openCollections.erase(collectionName); + m_watchedCollections.remove(collectionName); + + *ok = *ok && wasErrorFree(&error); + if (ok) { + Q_EMIT collectionDeleted(collectionName); + } +} + +void SecretServiceClient::deleteFolder(const QString &folder, const QString &collectionName, bool *ok) +{ + if (!attemptConnection()) { + *ok = false; + return; + } + + GError *error = nullptr; + + SecretCollection *collection = retrieveCollection(collectionName); + + GHashTablePtr attributes = GHashTablePtr(g_hash_table_new(g_str_hash, g_str_equal)); + g_hash_table_insert(attributes.get(), g_strdup("server"), g_strdup(folder.toUtf8().constData())); + + GListPtr glist = GListPtr(secret_collection_search_sync(collection, qtKeychainSchema(), attributes.get(), SECRET_SEARCH_ALL, nullptr, &error)); + + *ok = wasErrorFree(&error); + if (!*ok) { + return; + } + + if (glist) { + for (GList *iter = glist.get(); iter != nullptr; iter = iter->next) { + SecretItem *item = static_cast(iter->data); + m_updateInProgress = true; + secret_item_delete_sync(item, nullptr, &error); + *ok = wasErrorFree(&error); + g_object_unref(item); + } + } else { + qCWarning(KWALLETD_LOG) << i18n("No entries"); + } +} + +QByteArray +SecretServiceClient::readEntry(const QString &key, const SecretServiceClient::Type type, const QString &folder, const QString &collectionName, bool *ok) +{ + if (!attemptConnection()) { + *ok = false; + return {}; + } + + GError *error = nullptr; + QByteArray data; + + SecretItemPtr item = retrieveItem(key, type, folder, collectionName, ok); + + if (item) { + // Some providers like KeepassXC lock each item individually, and need to be + // unlocked by the user prior being able to access + if (secret_item_get_locked(item.get())) { + secret_service_unlock_sync(m_service.get(), g_list_append(nullptr, item.get()), nullptr, nullptr, &error); + *ok = wasErrorFree(&error); + if (!ok) { + qCWarning(KWALLETD_LOG) << i18n("Unable to unlock item"); + return data; + } + + secret_item_load_secret_sync(item.get(), nullptr, &error); + *ok = wasErrorFree(&error); + } + + SecretValuePtr secretValue = SecretValuePtr(secret_item_get_secret(item.get())); + + if (secretValue) { + if (type == SecretServiceClient::Binary) { + gsize length = 0; + const gchar *password = secret_value_get(secretValue.get(), &length); + return QByteArray(password, length); + } + + const gchar *password = secret_value_get_text(secretValue.get()); + if (type == SecretServiceClient::Base64) { + data = QByteArray::fromBase64(QByteArray(password)); + } else { + data = QByteArray(password); + } + } + } + + return data; +} + +void SecretServiceClient::renameEntry(const QString &display_name, + const QString &oldKey, + const QString &newKey, + const QString &folder, + const QString &collectionName, + bool *ok) +{ + SecretItemPtr item = retrieveItem(oldKey, Unknown, folder, collectionName, ok); + + if (!*ok) { + return; + } + if (!item) { + *ok = false; + qCWarning(KWALLETD_LOG) << i18n("Entry to rename not found"); + return; + } + + SecretItemPtr existingItem = retrieveItem(newKey, Unknown, folder, collectionName, ok); + if (existingItem) { + *ok = false; + qCWarning(KWALLETD_LOG) << i18n("Entry named %1 in folder %2 and wallet %3 already exists.", newKey, folder, collectionName); + return; + } + + QByteArray data; + + Type type = PlainText; + GHashTablePtr attributes = GHashTablePtr(secret_item_get_attributes(item.get())); + if (attributes) { + const gchar *value = (const char *)g_hash_table_lookup(attributes.get(), "type"); + if (value) { + type = stringToType(QString::fromUtf8(value)); + } + } else { + *ok = false; + qCWarning(KWALLETD_LOG) << i18n("Entry to rename incomplete"); + return; + } + + SecretValuePtr secretValue = SecretValuePtr(secret_item_get_secret(item.get())); + if (secretValue) { + const gchar *password = secret_value_get_text(secretValue.get()); + + if (type == Binary) { + data = QByteArray::fromBase64(QByteArray(password)); + } else { + data = QByteArray(password); + } + } else { + *ok = false; + qCWarning(KWALLETD_LOG) << i18n("Entry to rename incomplete"); + return; + } + + deleteEntry(oldKey, folder, collectionName, ok); + if (!*ok) { + return; + } + writeEntry(display_name, newKey, data, type, folder, collectionName, ok); +} + +void SecretServiceClient::writeEntry(const QString &display_name, + const QString &key, + const QByteArray &value, + const SecretServiceClient::Type type, + const QString &folder, + const QString &collectionName, + bool *ok) +{ + if (!attemptConnection()) { + *ok = false; + return; + } + + GError *error = nullptr; + + SecretCollection *collection = retrieveCollection(collectionName); + + QByteArray data; + if (type == SecretServiceClient::Base64) { + data = value.toBase64(); + } else { + data = value; + } + + QString mimeType; + if (type == SecretServiceClient::Binary) { + mimeType = QStringLiteral("application/octet-stream"); + } else { + mimeType = QStringLiteral("text/plain"); + } + + SecretValuePtr secretValue = SecretValuePtr(secret_value_new(data.constData(), -1, mimeType.toLatin1().constData())); + if (!secretValue) { + *ok = false; + qCWarning(KWALLETD_LOG) << i18n("Failed to create SecretValue"); + return; + } + + GHashTablePtr attributes = GHashTablePtr(g_hash_table_new(g_str_hash, g_str_equal)); + g_hash_table_insert(attributes.get(), g_strdup("user"), g_strdup(key.toUtf8().constData())); + g_hash_table_insert(attributes.get(), g_strdup("type"), g_strdup(typeToString(type).toUtf8().constData())); + g_hash_table_insert(attributes.get(), g_strdup("server"), g_strdup(folder.toUtf8().constData())); + + m_updateInProgress = true; + SecretItemPtr item = SecretItemPtr(secret_item_create_sync(collection, + qtKeychainSchema(), + attributes.get(), + display_name.toUtf8().constData(), + secretValue.get(), + SECRET_ITEM_CREATE_REPLACE, + nullptr, + &error)); + + *ok = wasErrorFree(&error); +} + +void SecretServiceClient::deleteEntry(const QString &key, const QString &folder, const QString &collectionName, bool *ok) +{ + if (!attemptConnection()) { + *ok = false; + return; + } + + GError *error = nullptr; + SecretItemPtr item = retrieveItem(key, Unknown, folder, collectionName, ok); + if (!*ok) { + return; + } + if (!item) { + *ok = false; + qCWarning(KWALLETD_LOG) << i18n("Entry to rename not found"); + return; + } + m_updateInProgress = true; + secret_item_delete_sync(item.get(), nullptr, &error); + *ok = wasErrorFree(&error); +} + +#include diff --git a/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletd/secretserviceclient.h b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletd/secretserviceclient.h new file mode 100644 index 0000000000..980e590c0e --- /dev/null +++ b/local/recipes/kde/kf6-kwallet/source/src/runtime/kwalletd/secretserviceclient.h @@ -0,0 +1,118 @@ +/* + SPDX-FileCopyrightText: 2024 Marco Martin + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#pragma once + +#include +#include + +#include + +class QDBusServiceWatcher; +class QTimer; + +// To allow gobject derived things with std::unique_ptr +struct GObjectDeleter { + template + void operator()(T *obj) const + { + if (obj) { + g_object_unref(obj); + } + } +}; + +template +using GObjectPtr = std::unique_ptr; +using SecretServicePtr = GObjectPtr; +using SecretCollectionPtr = GObjectPtr; +using SecretItemPtr = GObjectPtr; + +class SecretServiceClient : public QObject +{ + Q_OBJECT + +public: + enum Type { + PlainText = 0, + Base64, + Binary, + Map, + Unknown + }; + Q_ENUM(Type); + + SecretServiceClient(QObject *parent = nullptr); + + bool useKSecretBackend() const; + bool isAvailable() const; + + bool unlockCollection(const QString &collectionName, bool *ok); + + QString defaultCollection(bool *ok); + void setDefaultCollection(const QString &collectionName, bool *ok); + QStringList listCollections(bool *ok); + QStringList listFolders(const QString &collectionName, bool *ok); + + QStringList listEntries(const QString &folder, const QString &collectionName, bool *ok); + + QHash readMetadata(const QString &key, const QString &folder, const QString &collectionName, bool *ok); + + void createCollection(const QString &collectionName, bool *ok); + + void deleteCollection(const QString &collectionName, bool *ok); + + void deleteFolder(const QString &folder, const QString &collectionName, bool *ok); + + QByteArray readEntry(const QString &key, const Type type, const QString &folder, const QString &collectionName, bool *ok); + + void renameEntry(const QString &display_name, const QString &oldKey, const QString &newKey, const QString &folder, const QString &collectionName, bool *ok); + + void writeEntry(const QString &itemName, + const QString &key, + const QByteArray &value, + const SecretServiceClient::Type type, + const QString &folder, + const QString &collectionName, + bool *ok); + + void deleteEntry(const QString &key, const QString &folder, const QString &collectionName, bool *ok); + +Q_SIGNALS: + // Emitted when the service availability changed, or the service owner of secretservice has changed to a new one + void serviceChanged(); + void promptClosed(bool accepted); + void collectionListDirty(); + void collectionDirty(const QString &collection); + void collectionCreated(const QString &collection); + void collectionDeleted(const QString &collection); + +protected: + bool attemptConnection(); + void watchCollection(const QString &collectionName, bool *ok); + void onServiceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner); + + QString collectionLabelForPath(const QDBusObjectPath &path); + SecretCollection *retrieveCollection(const QString &name); + SecretItemPtr retrieveItem(const QString &key, const SecretServiceClient::Type type, const QString &folder, const QString &collectionName, bool *ok); + +protected Q_SLOTS: + void handlePrompt(bool dismissed); + void onCollectionCreated(const QDBusObjectPath &path); + void onCollectionDeleted(const QDBusObjectPath &path); + void onSecretItemChanged(const QDBusObjectPath &path); + +private: + SecretServicePtr m_service; + std::map m_openCollections; + QDBusServiceWatcher *m_serviceWatcher; + QSet m_watchedCollections; + QSet m_dirtyCollections; + QTimer *m_collectionDirtyTimer; + QString m_serviceBusName; + bool m_useKSecretBackend = false; + bool m_updateInProgress = false; +}; diff --git a/local/recipes/kde/kf6-kwidgetsaddons/source/autotests/kactionmenutest.cpp b/local/recipes/kde/kf6-kwidgetsaddons/source/autotests/kactionmenutest.cpp new file mode 100644 index 0000000000..d98e14fd8c --- /dev/null +++ b/local/recipes/kde/kf6-kwidgetsaddons/source/autotests/kactionmenutest.cpp @@ -0,0 +1,94 @@ +/* + * This file is part of the KDE libraries + * SPDX-FileCopyrightText: 2026 Nicolas Fella + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include + +#include +#include +#include + +class KActionMenuTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void initTestCase() + { + } + + void testActionMenu() + { + auto menu = new KActionMenu(nullptr); + + auto a1 = new QAction; + + menu->addAction(a1); + + QCOMPARE(menu->menu()->actions().size(), 1); + QCOMPARE(menu->menu()->actions()[0], a1); + + auto sep = menu->addSeparator(); + QVERIFY(sep->isSeparator()); + QCOMPARE(menu->menu()->actions().size(), 2); + QCOMPARE(menu->menu()->actions()[0], a1); + QCOMPARE(menu->menu()->actions()[1], sep); + + auto a2 = new QAction; + menu->insertAction(a1, a2); + QCOMPARE(menu->menu()->actions().size(), 3); + QCOMPARE(menu->menu()->actions()[0], a2); + QCOMPARE(menu->menu()->actions()[1], a1); + QCOMPARE(menu->menu()->actions()[2], sep); + + auto sep2 = menu->insertSeparator(a1); + QVERIFY(sep2->isSeparator()); + QCOMPARE(menu->menu()->actions().size(), 4); + QCOMPARE(menu->menu()->actions()[0], a2); + QCOMPARE(menu->menu()->actions()[1], sep2); + QCOMPARE(menu->menu()->actions()[2], a1); + QCOMPARE(menu->menu()->actions()[3], sep); + + menu->removeAction(a1); + QCOMPARE(menu->menu()->actions().size(), 3); + QCOMPARE(menu->menu()->actions()[0], a2); + QCOMPARE(menu->menu()->actions()[1], sep2); + QCOMPARE(menu->menu()->actions()[2], sep); + + QCOMPARE(menu->popupMode(), QToolButton::DelayedPopup); + menu->setPopupMode(QToolButton::MenuButtonPopup); + QCOMPARE(menu->popupMode(), QToolButton::MenuButtonPopup); + + auto parent = new QWidget; + auto w = menu->createWidget(parent); + QCOMPARE(w, nullptr); + + auto toolbar = new QToolBar; + auto toolbarButton = qobject_cast(menu->createWidget(toolbar)); + QVERIFY(toolbarButton); + + delete menu; + delete a1; + delete a2; + delete w; + delete toolbar; + } + + void testSetMenu() + { + auto actionMenu = new KActionMenu(nullptr); + + auto menu = std::make_unique(); + // setMenu doesn't take ownership, make sure nothing crashes or leaks + actionMenu->setMenu(menu.get()); + + delete actionMenu; + } +}; + +QTEST_MAIN(KActionMenuTest) + +#include "kactionmenutest.moc" diff --git a/local/recipes/kde/kf6-kwidgetsaddons/source/python/typesystem_kwidgetsaddons.xml b/local/recipes/kde/kf6-kwidgetsaddons/source/python/typesystem_kwidgetsaddons.xml new file mode 100644 index 0000000000..6fc44a39c6 --- /dev/null +++ b/local/recipes/kde/kf6-kwidgetsaddons/source/python/typesystem_kwidgetsaddons.xml @@ -0,0 +1,264 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/local/recipes/kde/kf6-kwidgetsaddons/source/src/highcontrasthelper.cpp b/local/recipes/kde/kf6-kwidgetsaddons/source/src/highcontrasthelper.cpp new file mode 100644 index 0000000000..03fb74825e --- /dev/null +++ b/local/recipes/kde/kf6-kwidgetsaddons/source/src/highcontrasthelper.cpp @@ -0,0 +1,46 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2025 g10 Code GmbH + SPDX-FileContributor: Ingo Klöcker + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "highcontrasthelper_p.h" + +#include +#include +#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) +#include +#else +#ifdef Q_OS_WIN +#include +#endif +#endif + +static bool isHighContrastModeActive() +{ +#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) + return QGuiApplication::styleHints()->accessibility()->contrastPreference() == Qt::ContrastPreference::HighContrast; +#else +#ifdef Q_OS_WIN + HIGHCONTRAST result; + result.cbSize = sizeof(HIGHCONTRAST); + if (SystemParametersInfo(SPI_GETHIGHCONTRAST, result.cbSize, &result, 0)) { + return (result.dwFlags & HCF_HIGHCONTRASTON); + } +#endif + return false; +#endif +} + +static bool isDefaultColorSchemeInUse() +{ + const QVariant colorSchemePathProperty = qApp->property("KDE_COLOR_SCHEME_PATH"); + return !colorSchemePathProperty.isValid() || colorSchemePathProperty.toString().isEmpty(); +} + +bool isHighContrastColorSchemeInUse() +{ + return isHighContrastModeActive() && isDefaultColorSchemeInUse(); +} diff --git a/local/recipes/kde/kf6-kwidgetsaddons/source/src/highcontrasthelper_p.h b/local/recipes/kde/kf6-kwidgetsaddons/source/src/highcontrasthelper_p.h new file mode 100644 index 0000000000..ebe1ef1b90 --- /dev/null +++ b/local/recipes/kde/kf6-kwidgetsaddons/source/src/highcontrasthelper_p.h @@ -0,0 +1,29 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 2025 g10 Code GmbH + SPDX-FileContributor: Ingo Klöcker + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef HIGHCONTRASTHELPER_P_H +#define HIGHCONTRASTHELPER_P_H + +// Standalone (pure Qt) functionality needed internally in more than +// one source file. + +/*! + * \internal + * + * Returns whether a high-contrast color scheme is currently in use. + * + * This can be used to avoid painting UI elements with colors that would + * cause bad contrast. This function returns true if high-contrast is + * active in the platform and if the default color scheme is in use. + * + * \note For Qt 6.9 and earlier high-contrast is only detected on Windows. + */ + +bool isHighContrastColorSchemeInUse(); + +#endif diff --git a/local/recipes/kde/kf6-kwidgetsaddons/source/src/kwidgetsaddons-index.qdoc b/local/recipes/kde/kf6-kwidgetsaddons/source/src/kwidgetsaddons-index.qdoc new file mode 100644 index 0000000000..f73bbdb3ea --- /dev/null +++ b/local/recipes/kde/kf6-kwidgetsaddons/source/src/kwidgetsaddons-index.qdoc @@ -0,0 +1,20 @@ +/*! + \page kwidgetsaddons-index.html + \title KWidgetsAddons + + Large set of desktop widgets. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {WidgetsAddons} {KF6::WidgetsAddons} + + \section1 API Reference + + \list + \li \l{KWidgetsAddons C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kwidgetsaddons/source/src/kwidgetsaddons.qdoc b/local/recipes/kde/kf6-kwidgetsaddons/source/src/kwidgetsaddons.qdoc new file mode 100644 index 0000000000..86db48f046 --- /dev/null +++ b/local/recipes/kde/kf6-kwidgetsaddons/source/src/kwidgetsaddons.qdoc @@ -0,0 +1,9 @@ +/*! + \module KWidgetsAddons + \title KWidgetsAddons C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent WidgetsAddons + + \brief Large set of desktop widgets. +*/ diff --git a/local/recipes/kde/kf6-kwidgetsaddons/source/src/kwidgetsaddons.qdocconf b/local/recipes/kde/kf6-kwidgetsaddons/source/src/kwidgetsaddons.qdocconf new file mode 100644 index 0000000000..e71834789a --- /dev/null +++ b/local/recipes/kde/kf6-kwidgetsaddons/source/src/kwidgetsaddons.qdocconf @@ -0,0 +1,37 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KWidgetsAddons +description = Large set of desktop widgets + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +imagedirs += ../docs/pics + +outputformats = HTML + +navigation.landingpage = "KWidgetsAddons" + +depends += \ + kde \ + qtcore \ + qtgui \ + qtwidgets + +qhp.projects = KWidgetsAddons + +qhp.KWidgetsAddons.file = kwidgetsaddons.qhp +qhp.KWidgetsAddons.namespace = org.kde.kwidgetsaddons.$QT_VERSION_TAG +qhp.KWidgetsAddons.virtualFolder = kwidgetsaddons +qhp.KWidgetsAddons.indexTitle = KWidgetsAddons +qhp.KWidgetsAddons.indexRoot = + +qhp.KWidgetsAddons.subprojects = classes +qhp.KWidgetsAddons.subprojects.classes.title = C++ Classes +qhp.KWidgetsAddons.subprojects.classes.indexTitle = KWidgetsAddons C++ Classes +qhp.KWidgetsAddons.subprojects.classes.selectors = class fake:headerfile +qhp.KWidgetsAddons.subprojects.classes.sortPages = true + +tagfile = kwidgetsaddons.tags diff --git a/local/recipes/kde/kf6-kwindowsystem/source/src/kwindowsystem-index.qdoc b/local/recipes/kde/kf6-kwindowsystem/source/src/kwindowsystem-index.qdoc new file mode 100644 index 0000000000..7fbc5f7f4b --- /dev/null +++ b/local/recipes/kde/kf6-kwindowsystem/source/src/kwindowsystem-index.qdoc @@ -0,0 +1,21 @@ +/*! + \page kwindowsystem-index.html + \title KWindowSystem + + Access to the windowing system + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {WindowSystem} {KF6::WindowSystem} + + \section1 API Reference + + \list + \li \l{KWindowSystem C++ Classes} + \li \l{KWindowSystem QML Types} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kwindowsystem/source/src/kwindowsystem.qdoc b/local/recipes/kde/kf6-kwindowsystem/source/src/kwindowsystem.qdoc new file mode 100644 index 0000000000..f17f8dad8d --- /dev/null +++ b/local/recipes/kde/kf6-kwindowsystem/source/src/kwindowsystem.qdoc @@ -0,0 +1,16 @@ +/*! + \module KWindowSystem + \title KWindowSystem C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent KWindowSystem + + \brief Access to the windowing system. + +*/ + +/*! + \qmlmodule org.kde.kwindowsystem + \title KWindowSystem QML Types + \brief Access to the windowing system + */ diff --git a/local/recipes/kde/kf6-kwindowsystem/source/src/kwindowsystem.qdocconf b/local/recipes/kde/kf6-kwindowsystem/source/src/kwindowsystem.qdocconf new file mode 100644 index 0000000000..d227daeec4 --- /dev/null +++ b/local/recipes/kde/kf6-kwindowsystem/source/src/kwindowsystem.qdocconf @@ -0,0 +1,36 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KWindowSystem +description = Access to the windowing system. + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +navigation.landingpage = "KWindowSystem" + +depends += qtcore qtquick qtquickcontrols qtgui + +qhp.projects = KWindowSystem + +qhp.KWindowSystem.file = kwindowsystem.qhp +qhp.KWindowSystem.namespace = org.kde.kwindowsystem.$QT_VERSION_TAG +qhp.KWindowSystem.virtualFolder = kwindowsystem +qhp.KWindowSystem.indexTitle = KWindowSystem +qhp.KWindowSystem.indexRoot = + +qhp.KWindowSystem.subprojects = classes qmltypes +qhp.KWindowSystem.subprojects.classes.title = C++ Classes +qhp.KWindowSystem.subprojects.classes.indexTitle = KWindowSystem C++ Classes +qhp.KWindowSystem.subprojects.classes.selectors = class fake:headerfile +qhp.KWindowSystem.subprojects.classes.sortPages = true + +qhp.KWindowSystem.subprojects.qmltypes.title = QML Types +qhp.KWindowSystem.subprojects.qmltypes.indexTitle = KWindowSystem QML Types +qhp.KWindowSystem.subprojects.qmltypes.selectors = qmltype +qhp.KWindowSystem.subprojects.qmltypes.sortPages = true + +tagfile = kwindowsystem.tags diff --git a/local/recipes/kde/kf6-kwindowsystem/source/src/platforms/wayland/helpers.h b/local/recipes/kde/kf6-kwindowsystem/source/src/platforms/wayland/helpers.h new file mode 100644 index 0000000000..62123cc712 --- /dev/null +++ b/local/recipes/kde/kf6-kwindowsystem/source/src/platforms/wayland/helpers.h @@ -0,0 +1,73 @@ +/* + SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#pragma once + +#include + +#include +#include + +#include + +struct wl_surface; +struct xdg_toplevel; + +inline wl_surface *surfaceForWindow(QWindow *window) +{ + if (!window) { + return nullptr; + } + + auto native = window->nativeInterface(); + if (!native) { + return nullptr; + } + + // NotificationWindow incorrectly relied on a side effect of an older version of this class + // In order to remain bug-compatiable, with that older usage, this is + // it can be dropped when we no longer support 6.3.0 or 6.3.1 + static bool isBuggyPlasma = + qApp->applicationName() == QLatin1String("plasmashell") && QVersionNumber::fromString(qApp->applicationVersion()) < QVersionNumber(6, 3, 4); + + if (isBuggyPlasma) { + window->create(); + } + + return native->surface(); +} + +inline xdg_toplevel *xdgToplevelForWindow(QWindow *window) +{ + if (!window) { + return nullptr; + } + + auto native = window->nativeInterface(); + + if (!native) { + return nullptr; + } + + return native->surfaceRole(); +} + +/*! + * \internal + * + * Some objects are children of the application object and therefore they are deleted after the QPA. + * + * The problem is that the wl_display object will be gone after the QPA is shut down. This can make the + * app crash when it attempts to clean up its proxy objects. The wl_proxy memory won't be released by + * wl_display_disconnect(), but wl_proxy objects will contain dangling display pointers. + * + * We need something better, but as of now, there is not a lot to work with. If you know that an object + * will live as long as the app, you may need to use this function before calling the destructor request. + */ +inline bool isQpaAlive() +{ + return qGuiApp; +} diff --git a/local/recipes/kde/kf6-kwindowsystem/source/src/platforms/wayland/waylandxdgdialogv1.cpp b/local/recipes/kde/kf6-kwindowsystem/source/src/platforms/wayland/waylandxdgdialogv1.cpp new file mode 100644 index 0000000000..aa4f6fdaa8 --- /dev/null +++ b/local/recipes/kde/kf6-kwindowsystem/source/src/platforms/wayland/waylandxdgdialogv1.cpp @@ -0,0 +1,47 @@ +/* + SPDX-FileCopyrightText: 2025 Kai Uwe Broulik + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "helpers.h" +#include "waylandxdgdialogv1_p.h" + +WaylandXdgDialogV1::WaylandXdgDialogV1(::xdg_dialog_v1 *object) + : QObject() + , QtWayland::xdg_dialog_v1(object) +{ +} + +WaylandXdgDialogV1::~WaylandXdgDialogV1() +{ + if (isQpaAlive()) { + destroy(); + } +} + +WaylandXdgDialogWmV1::WaylandXdgDialogWmV1() + : QWaylandClientExtensionTemplate(1) +{ + initialize(); +} + +WaylandXdgDialogWmV1::~WaylandXdgDialogWmV1() +{ + if (isQpaAlive() && isActive()) { + destroy(); + } +} + +WaylandXdgDialogWmV1 &WaylandXdgDialogWmV1::self() +{ + static WaylandXdgDialogWmV1 s_instance; + return s_instance; +} + +WaylandXdgDialogV1 *WaylandXdgDialogWmV1::getDialog(struct ::xdg_toplevel *toplevel) +{ + return new WaylandXdgDialogV1(get_xdg_dialog(toplevel)); +} + +#include "moc_waylandxdgdialogv1_p.cpp" diff --git a/local/recipes/kde/kf6-kwindowsystem/source/src/platforms/wayland/waylandxdgdialogv1_p.h b/local/recipes/kde/kf6-kwindowsystem/source/src/platforms/wayland/waylandxdgdialogv1_p.h new file mode 100644 index 0000000000..9ec7c2bf08 --- /dev/null +++ b/local/recipes/kde/kf6-kwindowsystem/source/src/platforms/wayland/waylandxdgdialogv1_p.h @@ -0,0 +1,36 @@ +/* + SPDX-FileCopyrightText: 2025 Kai Uwe Broulik + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef WAYLANDXDGDIALOGV1_P_H +#define WAYLANDXDGDIALOGV1_P_H + +#include "qwayland-xdg-dialog-v1.h" + +#include +#include + +class WaylandXdgDialogV1 : public QObject, public QtWayland::xdg_dialog_v1 +{ + Q_OBJECT +public: + explicit WaylandXdgDialogV1(::xdg_dialog_v1 *object); + ~WaylandXdgDialogV1() override; +}; + +class WaylandXdgDialogWmV1 : public QWaylandClientExtensionTemplate, public QtWayland::xdg_wm_dialog_v1 +{ +public: + ~WaylandXdgDialogWmV1() override; + + static WaylandXdgDialogWmV1 &self(); + + WaylandXdgDialogV1 *getDialog(struct ::xdg_toplevel *toplevel); + +private: + WaylandXdgDialogWmV1(); +}; + +#endif // WAYLANDXDGDIALOGV1_P_H diff --git a/local/recipes/kde/kf6-kwindowsystem/source/src/platforms/wayland/waylandxdgtopleveltagv1.cpp b/local/recipes/kde/kf6-kwindowsystem/source/src/platforms/wayland/waylandxdgtopleveltagv1.cpp new file mode 100644 index 0000000000..3499a45726 --- /dev/null +++ b/local/recipes/kde/kf6-kwindowsystem/source/src/platforms/wayland/waylandxdgtopleveltagv1.cpp @@ -0,0 +1,29 @@ +/* + SPDX-FileCopyrightText: 2025 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "helpers.h" +#include "waylandxdgtopleveltagv1_p.h" + +WaylandXdgToplevelTagManagerV1::WaylandXdgToplevelTagManagerV1() + : QWaylandClientExtensionTemplate(1) +{ + initialize(); +} + +WaylandXdgToplevelTagManagerV1::~WaylandXdgToplevelTagManagerV1() +{ + if (isQpaAlive() && isActive()) { + destroy(); + } +} + +WaylandXdgToplevelTagManagerV1 *WaylandXdgToplevelTagManagerV1::self() +{ + static WaylandXdgToplevelTagManagerV1 *instance = new WaylandXdgToplevelTagManagerV1; + return instance; +} + +#include "moc_waylandxdgtopleveltagv1_p.cpp" diff --git a/local/recipes/kde/kf6-kwindowsystem/source/src/platforms/wayland/waylandxdgtopleveltagv1_p.h b/local/recipes/kde/kf6-kwindowsystem/source/src/platforms/wayland/waylandxdgtopleveltagv1_p.h new file mode 100644 index 0000000000..62ff356891 --- /dev/null +++ b/local/recipes/kde/kf6-kwindowsystem/source/src/platforms/wayland/waylandxdgtopleveltagv1_p.h @@ -0,0 +1,24 @@ +/* + SPDX-FileCopyrightText: 2025 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#pragma once + +#include "qwayland-xdg-toplevel-tag-v1.h" + +#include + +class WaylandXdgToplevelTagManagerV1 : public QWaylandClientExtensionTemplate, public QtWayland::xdg_toplevel_tag_manager_v1 +{ + Q_OBJECT + +public: + ~WaylandXdgToplevelTagManagerV1() override; + + static WaylandXdgToplevelTagManagerV1 *self(); + +private: + WaylandXdgToplevelTagManagerV1(); +}; diff --git a/local/recipes/kde/kf6-kwindowsystem/source/tests/kwaylandextrastest.ui b/local/recipes/kde/kf6-kwindowsystem/source/tests/kwaylandextrastest.ui new file mode 100644 index 0000000000..23a8cae023 --- /dev/null +++ b/local/recipes/kde/kf6-kwindowsystem/source/tests/kwaylandextrastest.ui @@ -0,0 +1,140 @@ + + + KWaylandExtrasTest + + + + 0 + 0 + 258 + 206 + + + + KWaylandExtrasTest + + + + + + Update &Serial + + + + + + + + + Last Input Serial: + + + + + + + + 0 + 0 + + + + + + + Qt::TextInteractionFlag::LinksAccessibleByMouse|Qt::TextInteractionFlag::TextSelectableByKeyboard|Qt::TextInteractionFlag::TextSelectableByMouse + + + + + + + + + Request &Token + + + + + + + + + XDG Activation Token: + + + + + + + + 0 + 0 + + + + + + + Qt::TextInteractionFlag::LinksAccessibleByMouse|Qt::TextInteractionFlag::TextSelectableByKeyboard|Qt::TextInteractionFlag::TextSelectableByMouse + + + + + + + + + + + &Export Window + + + + + + + &Unexport Window + + + + + + + + + + + + 0 + 0 + + + + XDG Foreign Handle: + + + + + + + + 0 + 0 + + + + + + + Qt::TextInteractionFlag::LinksAccessibleByMouse|Qt::TextInteractionFlag::TextSelectableByKeyboard|Qt::TextInteractionFlag::TextSelectableByMouse + + + + + + + + + + diff --git a/local/recipes/kde/kf6-kxmlgui/source/po/am/kxmlgui6.po b/local/recipes/kde/kf6-kxmlgui/source/po/am/kxmlgui6.po new file mode 100644 index 0000000000..c6f8614a99 --- /dev/null +++ b/local/recipes/kde/kf6-kxmlgui/source/po/am/kxmlgui6.po @@ -0,0 +1,1335 @@ +# Copyright (C) 2026 This file is copyright: +# This file is distributed under the same license as the kxmlgui package. +# +# SPDX-FileCopyrightText: 2026 Wesenseged +msgid "" +msgstr "" +"Project-Id-Version: kxmlgui\n" +"Report-Msgid-Bugs-To: https://bugs.kde.org\n" +"POT-Creation-Date: 2026-05-12 00:41+0000\n" +"PO-Revision-Date: 2026-05-04 17:17+0300\n" +"Last-Translator: Wesenseged \n" +"Language-Team: English \n" +"Language: am\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 25.12.3\n" + +#: kaboutapplicationdialog.cpp:60 kaboutplugindialog.cpp:65 +#, kde-format +msgctxt "@title:window" +msgid "About %1" +msgstr "ስለ %1" + +#: kaboutapplicationdialog.cpp:88 kaboutplugindialog.cpp:84 +#, kde-format +msgctxt "@title:tab" +msgid "About" +msgstr "ስለ" + +#: kaboutapplicationdialog.cpp:94 +#, kde-format +msgctxt "@title:tab" +msgid "Components" +msgstr "ክፍሎች" + +#: kaboutapplicationdialog.cpp:104 kaboutplugindialog.cpp:92 +#, kde-format +msgctxt "@title:tab" +msgid "Author" +msgid_plural "Authors" +msgstr[0] "ጻፊ" +msgstr[1] "ጻፊዎች" + +#: kaboutapplicationdialog.cpp:111 kaboutplugindialog.cpp:99 +#, kde-format +msgctxt "@title:tab" +msgid "Thanks To" +msgstr "ምስጋና ለ" + +#: kaboutapplicationdialog.cpp:118 kaboutplugindialog.cpp:105 +#, kde-format +msgctxt "@title:tab" +msgid "Translation" +msgstr "ትርጛሜ" + +#: kaboutkdedialog_p.cpp:31 +#, kde-format +msgctxt "@title:window" +msgid "About KDE" +msgstr "ስለ KDE" + +#: kaboutkdedialog_p.cpp:34 +#, kde-format +msgid "KDE
Be Free!" +msgstr "KDE
ነፃ ሁን!" + +#: kaboutkdedialog_p.cpp:45 +#, kde-format +msgid "" +"KDE is a world-wide community of software engineers, artists, " +"writers, translators and creators who are committed to Free " +"Software development. KDE produces the Plasma desktop environment, " +"hundreds of applications, and the many software libraries that support them." +"

KDE is a cooperative enterprise: no single entity controls its " +"direction or products. Instead, we work together to achieve the common goal " +"of building the world's finest Free Software. Everyone is welcome to join and contribute to KDE, including you.

Visit %3 for more information about the KDE community and the " +"software we produce." +msgstr "" +"KDE ዓለም አቀፍ የሶፍትዌር መሐንዲሶች፣ አርቲስቶች፣ ጸሃፊዎች፣ ተርጓሚዎች እና ፈጣሪዎች ለነጻ ሶፍትዌር ልማት። KDE የፕላዝማ ዴስክቶፕ አካባቢን ፈጥሯል ፣ በመቶዎች የሚቆጠሩ " +"መተግበሪያዎች እና እነሱን የሚደግፉ ብዙ የሶፍትዌር ላይብረሪዎች።

KDE የትብብር ድርጅት ነው፡ አንድም " +"አካል አይቆጣጠረውም። አቅጣጫ ወይም ምርቶች. ይልቁንም የጋራ ግብን ለማሳካት በጋራ እንሰራለን። የዓለማችን ምርጥ ነፃ " +"ሶፍትዌር የመገንባት። ሁሉም ሰው ተጋብዘዋል ይቀላቀሉ እና ለKDE ያበርክቱ እርስዎን " +"ጨምሮ።

ይጎበኙ %3ተጨማሪ መረጃ ስለ KDE ማህበረሰብ እና ስለ " +"የምናመርተው ሶፍትዌር።" + +#: kaboutkdedialog_p.cpp:66 +#, kde-format +msgid "" +"Software can always be improved, and the KDE team is ready to do so. " +"However, you - the user - must tell us when something does not work as " +"expected or could be done better.

KDE has a bug tracking system. " +"Visit %1 or use the \"Report Bug...\" dialog from the " +"\"Help\" menu to report bugs.

If you have a suggestion for " +"improvement then you are welcome to use the bug tracking system to register " +"your wish. Make sure you use the severity called \"Wishlist\"." +msgstr "" +"ሶፍትዌሩ ሁልጊዜ ሊሻሻል ይችላል፣ እና የKDE ቡድን ይህን ለማድረግ ዝግጁ ነው። ሆኖም፣ እርስዎ - ተጠቃሚው " +"- የሆነ ነገር እንደተጠበቀው የማይሰራ ወይም የተሻለ ሊሆን የሚችል ከሆነ ሊነግሩን ይገባል።

KDE " +"የሳንካ መከታተያ ስርዓት አለው። %1ን ይጎብኙ ወይም ሳንካዎችን ሪፖርት ለማድረግ ከ\"እገዛ" +"\" ምናሌ ውስጥ ያለውን \"ስህተት ሪፖርት አድርግ…\" የሚለውን ንግግር ይጠቀሙ።

ለመሻሻል ሀሳብ " +"ካለዎት ምኞትዎን ለመመዝገብ የሳንካ መከታተያ ስርዓቱን መጠቀም ይችላሉ። \"የምኞት ዝርዝር\" የሚባለውን ክብደት " +"መጠቀምዎን ያረጋግጡ።" + +#: kaboutkdedialog_p.cpp:85 +#, kde-format +msgid "" +"You do not have to be a software developer to be a member of the KDE " +"team. You can join the language teams that translate program interfaces. You " +"can provide graphics, themes, sounds, and improved documentation. You decide!" +"

Visit %1 for information on some projects in " +"which you can participate.

If you need more information or " +"documentation, then a visit to %2 will provide you with " +"what you need." +msgstr "" +"የKDE ቡድን አባል ለመሆን የሶፍትዌር አበልፃጊ መሆን አይጠበቅብዎትም። የፕሮግራም በይነገጾችን የሚተረጉሙ " +"የቋንቋ ቡድኖችን መቀላቀል ይችላሉ። ግራፊክስ፣ ገጽታዎች፣ ድምጾች እና የተሻሻሉ ሰነዶችን ማቅረብ ይችላሉ። እርስዎ " +"ይወስኑ!

በሚሳተፉባቸው አንዳንድ ፕሮጀክቶች ላይ መረጃ ለማግኘት %1ን " +"ይጎብኙ።

ተጨማሪ መረጃ ወይም ሰነድ ከፈለጉ፣ %2ን መጎብኘት " +"የሚፈልጉትን ይሰጥዎታል። " + +#: kaboutkdedialog_p.cpp:108 +#, kde-format +msgid "" +"KDE software is and will always be available free of charge, however " +"creating it is not free.

To support development the KDE community " +"has formed the KDE e.V., a non-profit organization legally founded in " +"Germany. KDE e.V. represents the KDE community in legal and financial " +"matters. See %1 for information on KDE e.V.

KDE benefits from many kinds of contributions, including financial. We use " +"the funds to reimburse members and others for expenses they incur when " +"contributing. Further funds are used for legal support and organizing " +"conferences and meetings.

We would like to encourage you to " +"support our efforts with a financial donation, using one of the ways " +"described at %2.

Thank you very much in " +"advance for your support." +msgstr "" +"የKDE ሶፍትዌር ነፃ ነው እና ሁልጊዜም ነፃ እንደሆነ ይቀራል፤ ነገር ግን መፍጠሩ ነፃ አይደለም።

የKDE ማህበረሰብ ልማትን ለመደገፍ KDE e.V. የተባለ በህጋዊ መንገድ በጀርመን የተመሰረተ ለትርፍ " +"ያልተቋቋመ ድርጅት አቋቁሟል። KDE e.V. በህጋዊ እና በፋይናንሺያል ጉዳዮች የKDE ማህበረሰብን ይወክላል። ስለ KDE " +"e.V መረጃ ለማግኘት %1ን ይመልከቱ።

የKDE ጥቅሞችን ከብዙ አይነት " +"መዋጮዎች ፣ የገንዘብ ድጋፍን ጨምሮ። ገንዘቡን አባላትን እና ሌሎችን ሲያዋጡ ለሚያወጡት ወጪ ለመሸፈን እንጠቀማለን። " +"ተጨማሪ ገንዘቦች ለህጋዊ ድጋፍ እና ኮንፈረንሶችን እና ስብሰባዎችን ለማደራጀት ያገለግላሉ።

%2 ላይ ከተገለጹት መንገዶች አንዱን በመጠቀም ጥረታችንን በገንዘብ ልገሳ እንዲደግፉ " +"እናበረታታዎታለን።

ለድጋፍዎ አስቀድመን እናመሰግናለን።" + +#: kaboutkdedialog_p.cpp:128 +#, kde-format +msgctxt "@title:tab About KDE" +msgid "&About" +msgstr "ስለ(&A)" + +#: kaboutkdedialog_p.cpp:129 +#, kde-format +msgctxt "@title:tab" +msgid "&Report Bugs or Wishes" +msgstr "ስህተቶችን ወይም ምኞቶችን ሪፖርት አድርግ(&R)" + +#: kaboutkdedialog_p.cpp:130 +#, kde-format +msgctxt "@title:tab" +msgid "&Join KDE" +msgstr "KDEን ይቀላቀሉ(&J)" + +#: kaboutkdedialog_p.cpp:131 +#, kde-format +msgctxt "@title:tab" +msgid "&Support KDE" +msgstr "KDEን ይደግፉ(&S)" + +#: kabstractaboutdialog_p.cpp:47 +#, kde-format +msgctxt "Version version-number" +msgid "Version %1" +msgstr "ስሪት %1" + +#: kabstractaboutdialog_p.cpp:91 +#, kde-format +msgid "License: %1" +msgstr "ፈቃድ፦ %1" + +#: kabstractaboutdialog_p.cpp:118 +#, kde-format +msgctxt "@info Platform name" +msgid "%1 (%2)" +msgstr "%1 (%2)" + +#: kabstractaboutdialog_p.cpp:123 +#, kde-format +msgid "KDE Frameworks" +msgstr "KDE Frameworks" + +#: kabstractaboutdialog_p.cpp:124 +#, kde-format +msgctxt "@info" +msgid "Collection of libraries created by the KDE Community to extend Qt." +msgstr "Qtን ለማስፋፋት በKDE ማህበረሰብ የተፈጠሩ የላይብረሪዎች ስብስብ።" + +#: kabstractaboutdialog_p.cpp:128 +#, kde-format +msgid "Qt" +msgstr "Qt" + +#: kabstractaboutdialog_p.cpp:129 +#, kde-format +msgctxt "@info" +msgid "Cross-platform application development framework." +msgstr "በተለያዩ መድረኮች የሚሰራ የመተግበሪያ ማበልፀጊያ ፍሬምዎርክ።" + +#: kabstractaboutdialog_p.cpp:130 +#, kde-format +msgid "Using %1 and built against %2" +msgstr "%1 በመጠቀም እና በ%2 ላይ የተገነባ" + +#: kabstractaboutdialog_p.cpp:136 +#, kde-format +msgctxt "Linux packaging format" +msgid "Flatpak" +msgstr "Flatpak" + +#: kabstractaboutdialog_p.cpp:139 +#, kde-format +msgctxt "Linux packaging format" +msgid "Snap" +msgstr "Snap" + +#: kabstractaboutdialog_p.cpp:142 +#, kde-format +msgctxt "Linux packaging format" +msgid "AppImage" +msgstr "AppImage" + +#: kabstractaboutdialog_p.cpp:145 +#, kde-format +msgctxt "@info" +msgid "Distribution method." +msgstr "የማከፋፈያ ዘዴ።" + +#: kabstractaboutdialog_p.cpp:148 +#, kde-format +msgctxt "@info" +msgid "Underlying platform." +msgstr "መሰረታዊ መድረክ።" + +#: kabstractaboutdialog_p.cpp:176 +#, kde-format +msgctxt "@action:button" +msgid "Visit component's homepage" +msgstr "ኮምፖነንቶቹን መነሻ ገጽ ይጎብኙ" + +#: kabstractaboutdialog_p.cpp:177 +#, kde-format +msgctxt "@info:tooltip" +msgid "" +"Visit components's homepage\n" +"%1" +msgstr "" +"ኮምፖነንቶቹን መነሻ ገጽ ይጎብኙ\n" +"%1" + +#: kabstractaboutdialog_p.cpp:199 +#, kde-format +msgctxt "@action:button" +msgid "Copy to Clipboard" +msgstr "ወደ ቅንጥብ ሰሌዳ ይቅዱ" + +#: kabstractaboutdialog_p.cpp:259 +#, kde-format +msgctxt "@action:button" +msgid "Visit author's homepage" +msgstr "የጻፊውን መነሻ ገጽ ጎብኝ" + +#: kabstractaboutdialog_p.cpp:260 +#, kde-format +msgctxt "@info:tooltip" +msgid "" +"Visit author's homepage\n" +"%1" +msgstr "" +"የጻፊውን መነሻ ገጽ ጎብኝ\n" +"%1" + +#: kabstractaboutdialog_p.cpp:274 +#, kde-format +msgctxt "@action:button Send an email to a contributor" +msgid "Email contributor" +msgstr "የኢሜል አበርካች" + +#: kabstractaboutdialog_p.cpp:275 +#, kde-format +msgctxt "@info:tooltip" +msgid "Email contributor: %1" +msgstr "የኢሜል አበርካች፦ %1" + +#: kabstractaboutdialog_p.cpp:314 +#, kde-format +msgctxt "Reference to website" +msgid "" +"Please use %1 to report bugs.
If you have questions or need help, please " +"visit %2.
" +msgstr "" +"እባክዎን ስህተቶችን ሪፖርት ለማድረግ %1 ይጠቀሙ።
ጥያቄዎች ካሉዎት ወይም እርዳታ ከፈለጉ እባክዎ %2 " +"ይጎብኙ።
" + +#: kabstractaboutdialog_p.cpp:324 +#, kde-format +msgctxt "Reference to email address" +msgid "Please report bugs to %1.\n" +msgstr "እባክዎን ስህተቶችን ለ%1 ሪፖርት ያድርጉ።\n" + +#: kactionconflictdetector_p.h:37 +#, kde-format +msgid "" +"The key sequence '%1' is ambiguous. Use 'Configure Keyboard Shortcuts'\n" +"from the 'Settings' menu to solve the ambiguity.\n" +"No action will be triggered." +msgstr "" +"የ'%1' ቁልፍ ቅደም ተከተል አሻሚ ነው። 'የቁልፍ ሰሌዳ አቋራጮችን አዋቅር'ን ተጠቀም።\n" +"ከ'ቅንብሮች' ምናሌ ውስጥ አሻሚነቱን ለመፍታት።\n" +"ምንም እርምጃ አይቀሰቀስም።" + +#: kactionconflictdetector_p.h:41 +#, kde-format +msgctxt "@title:window" +msgid "Ambiguous shortcut detected" +msgstr "አሻሚ አቋራጭ ተገኝቷል" + +#: kbugreport.cpp:67 +#, kde-format +msgctxt "@title:window" +msgid "Submit Bug Report" +msgstr "የስህተት ሪፖርት ላክ" + +#: kbugreport.cpp:89 +#, kde-format +msgid "Submit Bug Report" +msgstr "የስህተት ሪፖርት ላክ" + +#: kbugreport.cpp:101 +#, kde-format +msgid "" +"The application for which you wish to submit a bug report - if incorrect, " +"please use the Report Bug menu item of the correct application" +msgstr "" +"የሳንካ ሪፖርት ማስገባት የሚፈልጉበት መተግበሪያ - የተሳሳተ ከሆነ፣ እባክዎን ትክክለኛውን መተግበሪያ የስህተት ሪፖርት " +"አድርግ ምናሌ ንጥል ይጠቀሙ።" + +#: kbugreport.cpp:102 +#, kde-format +msgid "Application: " +msgstr "መተግበሪያ፦" + +#: kbugreport.cpp:112 +#, kde-format +msgid "" +"The version of this application - please make sure that no newer version is " +"available before sending a bug report" +msgstr "የዚህ መተግበሪያ ስሪት - የሳንካ (bug) ሪፖርት ከመላክዎ በፊት አዲስ ስሪት እንዳልተገኘ እባክዎ ያረጋግጡ" + +#: kbugreport.cpp:113 +#, kde-format +msgid "Version:" +msgstr "ስሪት፦" + +#: kbugreport.cpp:118 +#, kde-format +msgid "no version set (programmer error)" +msgstr "ምንም ዕትም አልተገኘም (የፕሮግራም አድራጊ ስህተት)" + +#: kbugreport.cpp:122 +#, kde-format +msgctxt "%1 is the program version, %2 is the kde framework version" +msgid "%1 with KDE Frameworks %2" +msgstr "%1 ከKDE Frameworks ጋር %2" + +#: kbugreport.cpp:130 +#, kde-format +msgid "OS:" +msgstr "OS፦" + +#: kbugreport.cpp:135 +#, kde-format +msgctxt "" +"%1 is the operating system name, e.g. 'Windows 10', %2 is the CPU " +"architecture, e.g. 'x86_64'" +msgid "%1 (%2)" +msgstr "%1 (%2)" + +#: kbugreport.cpp:142 +#, kde-format +msgctxt "" +"%1 is the operating system name, e.g. 'Fedora Linux', %2 is the operating " +"system version, e.g. '35', %3 is the CPU architecture, e.g. 'x86_64'" +msgid "%1 %2 (%3)" +msgstr "%1 %2 (%3)" + +#: kbugreport.cpp:148 +#, kde-format +msgctxt "" +"%1 is the operating system name, e.g. 'Fedora Linux', %2 is the CPU " +"architecture, e.g. 'x86_64'" +msgid "%1 (%2)" +msgstr "%1 (%2)" + +#: kbugreport.cpp:162 +#, kde-format +msgid "" +"To submit a bug report, click on the button below. This will open a web " +"browser window on https://bugs.kde.org " +"where you will find a form to fill in. The information displayed above will " +"be transferred to that server." +msgstr "" +"የሳንካ (bug) ሪፖርት ለማስገባት ከታች ያለውን አዝራር ጠቅ ያድርጉ። ይህ በ https://bugs.kde.org ላይ የድር አሳሽ መስኮት ይከፍታል እና የሚሞሉትን ፎርም " +"ያገኛሉ። ከላይ የታየው መረጃ ወደዚያ አገልጋይ ይላካል።" + +#: kbugreport.cpp:168 +#, kde-format +msgid "" +"To submit a bug report, click on the button below. This will open a web " +"browser window on %2." +msgstr "" +"የሳንካ ሪፖርት ለማስገባት ከታች ያለውን አዝራር ጠቅ ያድርጉ። ይህ በ %2 ላይ " +"የድር አሳሽ መስኮት ይከፍታል።" + +#: kbugreport.cpp:185 +#, kde-format +msgctxt "@action:button" +msgid "&Launch Bug Report Wizard" +msgstr "የሳንካ ሪፖርት አዋቂን አስጀምር(&L)" + +#: kbugreport.cpp:187 +#, kde-format +msgctxt "@action:button" +msgid "&Submit Bug Report" +msgstr "የስህተት ሪፖርት ላክ(&S)" + +#: kcheckaccelerators.cpp:121 +#, kde-format +msgctxt "@title:window" +msgid "Dr. Klash' Accelerator Diagnosis" +msgstr "የDr. Klash የአቋራጭ ቁልፎች ምርመራ" + +#: kcheckaccelerators.cpp:128 +#, kde-format +msgctxt "@option:check" +msgid "Disable automatic checking" +msgstr "አውቶማቲክ ፍተሻን አሰናክል" + +#: kcheckaccelerators.cpp:174 +#, kde-format +msgid "

Accelerators changed

" +msgstr "

አክስሌተሮች ተቀይረዋል

" + +#: kcheckaccelerators.cpp:178 kcheckaccelerators.cpp:182 +#, kde-format +msgid "Old Text" +msgstr "የቆየ ጽሑፍ" + +#: kcheckaccelerators.cpp:178 kcheckaccelerators.cpp:187 +#, kde-format +msgid "New Text" +msgstr "አዲስ ጽሑፍ" + +#: kcheckaccelerators.cpp:182 +#, kde-format +msgid "

Accelerators removed

" +msgstr "

አክስሌተሮች ተወግደዋል

" + +#: kcheckaccelerators.cpp:186 +#, kde-format +msgid "

Accelerators added (just for your info)

" +msgstr "

አክስሌተሮች ታክለዋል (ለመረጃዎ ብቻ)

" + +#: kedittoolbar.cpp:332 +#, kde-format +msgctxt "@title:window" +msgid "Change Text" +msgstr "ጽሑፍ ቀይር" + +#: kedittoolbar.cpp:342 +#, kde-format +msgid "Icon te&xt:" +msgstr "የአዶ ጽሑፍ(&X)፦" + +#: kedittoolbar.cpp:347 +#, kde-format +msgctxt "@option:check" +msgid "&Hide text when toolbar shows text alongside icons" +msgstr "የመሳሪያ አሞሌ ከአዶዎች ጋር ጽሑፍ ሲያሳይ ጽሑፍን ደብቅ(&H)" + +#: kedittoolbar.cpp:596 +#, kde-format +msgctxt "@title:window" +msgid "Configure Toolbars" +msgstr "የመሣሪያ አሞሌዎችን ያዋቅሩ" + +#: kedittoolbar.cpp:659 +#, kde-format +msgid "" +"Do you really want to reset all toolbars of this application to their " +"default? The changes will be applied immediately." +msgstr "" +"በእርግጥ የዚህን መተግበሪያ ሁሉንም የመሣሪያ አሞሌዎች ወደ ነባሪ ሁኔታቸው መመለስ ይፈልጋሉ? ለውጦቹ ወዲያውኑ ተግባራዊ " +"ይሆናሉ።" + +#: kedittoolbar.cpp:660 +#, kde-format +msgid "Reset Toolbars" +msgstr "የመሣሪያ አሞሌዎችን ዳግም አስጀምር" + +#: kedittoolbar.cpp:661 +#, kde-format +msgid "Reset" +msgstr "ዳግም አስጀምር" + +#: kedittoolbar.cpp:980 +#, kde-format +msgid "&Toolbar:" +msgstr "የመሣሪያ አሞሌ(&T)፦" + +#. i18n("&New"), this); +#. new_toolbar->setPixmap(BarIcon("document-new", KIconLoader::SizeSmall)); +#. new_toolbar->setEnabled(false); // disabled until implemented +#. QPushButton *del_toolbar = new QPushButton(i18n("&Delete"), this); +#. del_toolbar->setPixmap(BarIcon("edit-delete", KIconLoader::SizeSmall)); +#. del_toolbar->setEnabled(false); // disabled until implemented +#. our list of inactive actions +#: kedittoolbar.cpp:996 +#, kde-format +msgid "A&vailable actions:" +msgstr "ዝግጁ ተግባራት(&A)፦" + +#: kedittoolbar.cpp:1017 kedittoolbar.cpp:1042 +#, kde-format +msgid "Filter" +msgstr "አጣራ" + +#: kedittoolbar.cpp:1020 +#, kde-format +msgid "Curr&ent actions:" +msgstr "&ያሉ ተግባራት፦" + +#: kedittoolbar.cpp:1045 +#, kde-format +msgctxt "@action:button" +msgid "Change &Icon…" +msgstr "&አዶ ቀይር…" + +#: kedittoolbar.cpp:1054 +#, kde-format +msgctxt "@action:button" +msgid "Change Te&xt…" +msgstr "&ጽሁፍ ቀይር…" + +#: kedittoolbar.cpp:1196 +#, kde-format +msgid "--- separator ---" +msgstr "--- separator ---" + +#: kedittoolbar.cpp:1197 +#, kde-format +msgid "--- expanding spacer ---" +msgstr "--- expanding spacer ---" + +#: kedittoolbar.cpp:1219 +#, kde-format +msgctxt "@item:intable Action name in toolbar editor" +msgid "%1" +msgstr "%1" + +#: kedittoolbar.cpp:1247 +#, kde-format +msgid "" +"This element will be replaced with all the elements of an embedded component." +msgstr "ይህ ኤለመንት በሁሉም የተከተተ አካል ንጥረ ነገሮች ይተካል።" + +#: kedittoolbar.cpp:1249 +#, kde-format +msgid "" +msgstr "" + +#: kedittoolbar.cpp:1251 +#, kde-format +msgid "" +msgstr "" + +#: kedittoolbar.cpp:1261 +#, kde-format +msgid "" +"This is a dynamic list of actions. You can move it, but if you remove it you " +"will not be able to re-add it." +msgstr "" +"ይህ ተለዋዋጭ የእርምጃዎች ዝርዝር ነው። ማንቀሳቀስ ይችላሉ ነገር ግን ካስወገዱት እርስዎ እንደገና መጨመር አይችሉም።" + +#: kedittoolbar.cpp:1262 +#, kde-format +msgid "ActionList: %1" +msgstr "የተግባራት ዝርዝር፦ %1" + +#: kedittoolbar.cpp:1363 kedittoolbar.cpp:1388 +#, kde-format +msgctxt "@label Action tooltip in toolbar editor, below the action list" +msgid "%1" +msgstr "%1" + +#: kedittoolbar.cpp:1616 +#, kde-format +msgid "Change Icon" +msgstr "አዶ ቀይር" + +#. i18n: ectx: Menu (help) +#: khelpmenu.cpp:167 ui_standards.rc:179 +#, kde-format +msgid "&Help" +msgstr "እርዳታ(&H)" + +#: kkeysequencewidget.cpp:146 +#, kde-format +msgctxt "@info:tooltip" +msgid "" +"Click on the button, then enter the shortcut like you would in the program.\n" +"Example for Ctrl+A: hold the Ctrl key and press A." +msgstr "" +"አዝራሩን ይጫኑ፣ ከዚያ በፕሮግራሙ ውስጥ እንደሚጠቀሙት አቋራጩን ያስገቡ።ምሳሌ፦ ለ Ctrl+A የ Ctrl ቁልፍን ተጭነው " +"ይያዙ እና Aን ይጫኑ።" + +#: kkeysequencewidget.cpp:150 +#, kde-format +msgctxt "@action:button" +msgid "Clear" +msgstr "አጽዳ" + +#: kkeysequencewidget.cpp:169 +#, kde-format +msgctxt "%1 is the number of conflicts" +msgid "Shortcut Conflict" +msgid_plural "Shortcut Conflicts" +msgstr[0] "የአቋራጭ ግጭት" +msgstr[1] "የአቋራጭ ግጭቶች" + +#: kkeysequencewidget.cpp:173 +#, kde-format +msgid "Shortcut '%1' for action '%2'\n" +msgstr "አቋራጭ '%1' ለተግባር '%2'\n" + +#: kkeysequencewidget.cpp:178 +#, kde-format +msgctxt "%1 is the number of ambiguous shortcut clashes (hidden)" +msgid "" +"The \"%2\" shortcut is ambiguous with the following shortcut.\n" +"Do you want to assign an empty shortcut to this action?\n" +"%3" +msgid_plural "" +"The \"%2\" shortcut is ambiguous with the following shortcuts.\n" +"Do you want to assign an empty shortcut to these actions?\n" +"%3" +msgstr[0] "" +"የ\"%2\" አቋራጭ ከሚከተለው አቋራጭ ጋር አሻሚ ነው።\n" +"ለዚህ ተግባር ባዶ አቋራጭ መመደብ ይፈልጋሉ?\n" +"%3" +msgstr[1] "" +"የ\"%2\" አቋራጭ ከሚከተሉት አቋራጮች ጋር አሻሚ ነው።\n" +"ለእነዚህ ድርጊቶች ባዶ አቋራጭ መመደብ ይፈልጋሉ?\n" +"%3" + +#: kkeysequencewidget.cpp:188 kkeysequencewidget.cpp:295 +#: kkeysequencewidget.cpp:357 +#, kde-format +msgctxt "@action:button" +msgid "Reassign" +msgstr "እንደገና መመደብ" + +#: kkeysequencewidget.cpp:193 +#, kde-format +msgctxt "@title:window" +msgid "Shortcut conflict" +msgstr "የአቋራጭ ግጭት" + +#: kkeysequencewidget.cpp:195 +#, kde-format +msgid "" +"The '%1' key combination is already used by the %2 action." +"
Please select a different one.
" +msgstr "" +"የ '%1' ቁልፍ ጥምረት አስቀድሞ በ%2 ድርጊት ጥቅም ላይ ውሏል።
እባክዎ የተለየ ይምረጡ።
" + +#: kkeysequencewidget.cpp:275 +#, kde-format +msgid "Shortcut '%1' in Application '%2' for action '%3'\n" +msgstr "አቋራጭ '%1' በመተግበሪያ '%2' ለድርጊት '%3'\n" + +#: kkeysequencewidget.cpp:284 +#, kde-format +msgctxt "" +"%1 is the number of conflicts (hidden), %2 is the key sequence of the " +"shortcut that is problematic" +msgid "The shortcut '%2' conflicts with the following key combination:\n" +msgid_plural "" +"The shortcut '%2' conflicts with the following key combinations:\n" +msgstr[0] "አቋራጭ '%2' ከሚከተለው የቁልፍ ጥምር ጋር ይጣራል፦\n" +msgstr[1] "አቋራጭ '%2' ከሚከተሉት የቁልፍ ጥምሮች ጋር ይጋጫል፦\n" + +#: kkeysequencewidget.cpp:291 +#, kde-format +msgctxt "%1 is the number of shortcuts with which there is a conflict" +msgid "Conflict with Registered Global Shortcut" +msgid_plural "Conflict with Registered Global Shortcuts" +msgstr[0] "ከተመዘገበ ዓለም-አቀፍ አቋራጭ ጋር ግጭት" +msgstr[1] "ከተመዘገበ ዓለም-አቀፍ አቋራጮች ጋር ግጭት" + +#: kkeysequencewidget.cpp:304 +#, kde-format +msgid "Reserved Shortcut" +msgstr "የተያዘ አቋራጭ" + +#: kkeysequencewidget.cpp:306 +#, kde-format +msgid "" +"The F12 key is reserved on Windows, so cannot be used for a global " +"shortcut.\n" +"Please choose another one." +msgstr "" +"F12 ቁልፍ በዊንዶውስ ላይ የተያዘ ነው፣ ስለዚህ ለአጠቃላይ አቋራጭ መጠቀም አይቻልም።\n" +"እባክዎ ሌላ ይምረጡ።" + +#: kkeysequencewidget.cpp:349 +#, kde-format +msgctxt "@title:window" +msgid "Conflict with Standard Application Shortcut" +msgstr "ከመደበኛ መተግበሪያ አቋራጭ ጋር ግጭት" + +#: kkeysequencewidget.cpp:351 +#, kde-format +msgid "" +"The '%1' key combination is also used for the standard action \"%2\" that " +"some applications use.\n" +"Do you really want to use it as a global shortcut as well?" +msgstr "" +"የ'%1' የቁልፍ ጥምረት አንዳንድ መተግበሪያዎች የሚጠቀሙበት መደበኛ እርምጃ \"%2\" ተብሎም ጥቅም ላይ ይውላል።\n" +"በእርግጥ እንደ ዓለም አቀፍ አቋራጭ መጠቀም ይፈልጋሉ?" + +#: kkeysequencewidget.cpp:395 +#, kde-format +msgctxt "What the user inputs now will be taken as the new shortcut" +msgid "Input" +msgstr "ግቤት" + +#: kkeysequencewidget.cpp:397 kshortcuteditwidget.cpp:51 +#, kde-format +msgctxt "No shortcut defined" +msgid "None" +msgstr "ምንም" + +#: klicensedialog_p.cpp:33 +#, kde-format +msgctxt "@title:window" +msgid "License Agreement" +msgstr "የፈቃድ ስምምነት" + +#: kmainwindow.cpp:257 +#, kde-format +msgctxt "NAME OF TRANSLATORS" +msgid "Your names" +msgstr "Abenezer Wesenseged" + +#: kmainwindow.cpp:258 +#, kde-format +msgctxt "EMAIL OF TRANSLATORS" +msgid "Your emails" +msgstr "wseged@proton.me" + +#: kmenumenuhandler_p.cpp:37 +#, kde-format +msgid "Add to Toolbar" +msgstr "ወደ የመሣሪያ አሞሌ ጨምር" + +#: kmenumenuhandler_p.cpp:224 +#, kde-format +msgctxt "@action:inmenu" +msgid "Configure Shortcut…" +msgstr "አቋራጭ መንገድ ያዋቅሩ…" + +#: kshortcuteditwidget.cpp:55 +#, kde-format +msgctxt "@option:radio" +msgid "Default:" +msgstr "ነባሪ፦" + +#: kshortcuteditwidget.cpp:62 +#, kde-format +msgctxt "@option:radio" +msgid "Custom:" +msgstr "ብጁ፦" + +#: kshortcutschemeseditor.cpp:32 +#, kde-format +msgctxt "@title:group" +msgid "Shortcut Schemes" +msgstr "አቋራጭ ስኪም" + +#: kshortcutschemeseditor.cpp:37 +#, kde-format +msgid "Current scheme:" +msgstr "የአሁኑ ስኪም፦" + +#: kshortcutschemeseditor.cpp:47 +#, kde-format +msgctxt "@action:button" +msgid "New…" +msgstr "አዲስ…" + +#: kshortcutschemeseditor.cpp:50 +#, kde-format +msgctxt "@action:button" +msgid "Delete" +msgstr "ሰርዝ" + +#: kshortcutschemeseditor.cpp:53 +#, kde-format +msgctxt "@action:button" +msgid "More Actions" +msgstr "ተጨማሪ ድርጊቶች" + +#: kshortcutschemeseditor.cpp:58 +#, kde-format +msgctxt "@action:inmenu" +msgid "Save shortcuts to scheme" +msgstr "አቋራጮችን በስኪሙ ውስጥ አስቀምጥ" + +#: kshortcutschemeseditor.cpp:62 +#, kde-format +msgctxt "@action:inmenu" +msgid "Export Scheme…" +msgstr "ስኪሙን ላክ…" + +#: kshortcutschemeseditor.cpp:66 +#, kde-format +msgctxt "@action:inmenu" +msgid "Import Scheme…" +msgstr "ስኪሙን አስገባ…" + +#: kshortcutschemeseditor.cpp:115 +#, kde-format +msgctxt "@title:window" +msgid "Name for New Scheme" +msgstr "ለአዲስ ስኪም ስም" + +#: kshortcutschemeseditor.cpp:115 +#, kde-format +msgid "Name for new scheme:" +msgstr "ለአዲስ ስኪም ስም፦" + +#: kshortcutschemeseditor.cpp:115 +#, kde-format +msgid "New Scheme" +msgstr "አዲስ ስኪም" + +#: kshortcutschemeseditor.cpp:121 +#, kde-format +msgid "A scheme with this name already exists." +msgstr "በዚህ ስም የተሰየመ ስኪም ቀድሞውኑ አለ።" + +#: kshortcutschemeseditor.cpp:151 +#, kde-format +msgid "" +"Do you really want to delete the scheme %1?\n" +"Note that this will not remove any system wide shortcut schemes." +msgstr "" +"በእርግጥ ስኪም %1ን ለመሰረዝ ይፈልጋሉ?ይህ በሲስተም ደረጃ ያሉ የአቋራጭ ስኬሞችን እንደማያስወግድ ልብ ይበሉ።" + +#: kshortcutschemeseditor.cpp:187 +#, kde-format +msgctxt "@title:window" +msgid "Export Shortcuts" +msgstr "አቋራጮችን ላክ" + +#: kshortcutschemeseditor.cpp:187 kshortcutschemeseditor.cpp:202 +#, kde-format +msgid "Shortcuts (*.shortcuts)" +msgstr "አቋራጮች (*.shortcuts)" + +#: kshortcutschemeseditor.cpp:202 +#, kde-format +msgctxt "@title:window" +msgid "Import Shortcuts" +msgstr "አቋራጮችን አስገባ" + +#: kshortcutschemeseditor.cpp:213 +#, kde-format +msgid "Shortcut scheme successfully saved." +msgstr "የአቋራጭ ስኪሙ በተሳካ ሁኔታ ተቀምጧል።" + +#: kshortcutschemeseditor.cpp:216 +#, kde-format +msgid "Error saving the shortcut scheme." +msgstr "የአቋራጭ ስኪሙን በማስቀመጥ ላይ ስህተት ተከስቷል።" + +#: kshortcutsdialog.cpp:70 +#, kde-format +msgid "" +"The current shortcut scheme is modified. Save before switching to the new " +"one?" +msgstr "አሁን ያለው የአቋራጭ ስኪም ተቀይሯል። ወደ አዲሱ ከመቀየር በፊት ማስቀመጥ ይፈልጋሉ?" + +#: kshortcutsdialog.cpp:124 +#, kde-format +msgid "Manage &Schemes" +msgstr "ስኪሞችን አስተዳድር (&S)" + +#: kshortcutsdialog.cpp:149 +#, kde-format +msgctxt "@title:window" +msgid "Configure Keyboard Shortcuts" +msgstr "የኪቦርድ አቋራጮችን ያዋቅሩ" + +#. i18n: ectx: property (whatsThis), widget (KTreeWidgetSearchLineWidget, searchFilter) +#: kshortcutsdialog.ui:16 +#, kde-format +msgid "" +"Search interactively for shortcut names (e.g. Copy) or combination of keys " +"(e.g. Ctrl+C) by typing them here." +msgstr "የአቋራጭ ስሞችን (ለምሳሌ፦ ቅዳ) ወይም የቁልፍ ጥምሮችን (ለምሳሌ፦ Ctrl+C) በመጻፍ እዚህ በቀጥታ ፈልግ።" + +#. i18n: ectx: property (whatsThis), widget (QTreeWidget, list) +#: kshortcutsdialog.ui:23 +#, kde-format +msgid "" +"Here you can see a list of key bindings, i.e. associations between actions " +"(e.g. 'Copy') shown in the left column and keys or combination of keys (e.g. " +"Ctrl+V) shown in the right column." +msgstr "" +"እዚህ የቁልፍ መያዣዎች ዝርዝር ማየት ይችላሉ፣ ማለትም በግራ አምድ የታዩ እርምጃዎች (ለምሳሌ “Copy”) እና በቀኝ " +"አምድየታዩ ቁልፎች ወይም የቁልፍ ጥምሮች (ለምሳሌ Ctrl+V) መካከል ያሉ ግንኙነቶች ናቸው።" + +#. i18n: ectx: property (text), widget (QTreeWidget, list) +#: kshortcutsdialog.ui:33 +#, kde-format +msgid "Action" +msgstr "ድርጊት" + +#. i18n: ectx: property (text), widget (QTreeWidget, list) +#: kshortcutsdialog.ui:38 +#, kde-format +msgid "Shortcut" +msgstr "አቋራጭ" + +#. i18n: ectx: property (text), widget (QTreeWidget, list) +#: kshortcutsdialog.ui:43 +#, kde-format +msgid "Alternate" +msgstr "ተለዋጭ" + +#. i18n: ectx: property (text), widget (QTreeWidget, list) +#: kshortcutsdialog.ui:48 +#, kde-format +msgid "Global" +msgstr "ዓለም አቀፍ" + +#. i18n: ectx: property (text), widget (QTreeWidget, list) +#: kshortcutsdialog.ui:53 +#, kde-format +msgid "Global Alternate" +msgstr "ዓለም አቀፍ አማራጭ" + +#. i18n: ectx: property (text), widget (QTreeWidget, list) +#: kshortcutsdialog.ui:58 +#, kde-format +msgid "Mouse Button Gesture" +msgstr "የመዳፊት አዝራር ምልክት" + +#. i18n: ectx: property (text), widget (QTreeWidget, list) +#: kshortcutsdialog.ui:63 +#, kde-format +msgid "Mouse Shape Gesture" +msgstr "የመዳፊት ቅርጽ ምልክት" + +#: kshortcutseditor.cpp:521 +#, kde-format +msgctxt "header for an applications shortcut list" +msgid "Shortcuts for %1" +msgstr "አቋራጮች ለ%1" + +#. i18n: ectx: property (text), widget (QLabel, priLabel) +#: kshortcutseditor.cpp:541 kshortcutwidget.ui:22 +#, kde-format +msgid "Main:" +msgstr "ዋና፦" + +#. i18n: ectx: property (text), widget (QLabel, altLabel) +#: kshortcutseditor.cpp:542 kshortcutwidget.ui:52 +#, kde-format +msgid "Alternate:" +msgstr "አማራጭ፦" + +#: kshortcutseditor.cpp:543 +#, kde-format +msgid "Global:" +msgstr "ዓለም አቀፍ፦" + +#: kshortcutseditor.cpp:544 +#, kde-format +msgid "Global alternate:" +msgstr "ዓለም አቀፍ አማራጭ፦" + +#: kshortcutseditor.cpp:560 +#, kde-format +msgid "Action Name" +msgstr "የድርጊት ስም" + +#: kshortcutseditor.cpp:564 +#, kde-format +msgid "Shortcuts" +msgstr "አቋራጮች" + +#: kshortcutseditor.cpp:568 +#, kde-format +msgid "Description" +msgstr "መግለጫ" + +#: kshortcutseditoritem.cpp:33 +#, kde-format +msgctxt "@item:intable Action name in shortcuts configuration" +msgid "%1" +msgstr "%1" + +#: kswitchlanguagedialog_p.cpp:137 +#, kde-format +msgctxt "@title:window" +msgid "Configure Language" +msgstr "ቋንቋ ያዋቅሩ" + +#: kswitchlanguagedialog_p.cpp:141 +#, kde-format +msgid "Please choose the language which should be used for this application:" +msgstr "እባክዎ ለዚህ መተግበሪያ ጥቅም ላይ መዋል ያለበትን ቋንቋ ይምረጡ፦" + +#: kswitchlanguagedialog_p.cpp:168 +#, kde-format +msgctxt "@action:button" +msgid "Add Fallback Language" +msgstr "የመተኪያ ቋንቋ ጨምር" + +#: kswitchlanguagedialog_p.cpp:169 +#, kde-format +msgctxt "@info:tooltip" +msgid "" +"Adds one more language which will be used if other translations do not " +"contain a proper translation." +msgstr "ሌሎች ትርጉሞች ትክክለኛ ትርጉም ካልያዙ ጥቅም ላይ የሚውል ተጨማሪ አንድ ቋንቋ ይጨምራል።" + +#: kswitchlanguagedialog_p.cpp:261 kswitchlanguagedialog_p.cpp:282 +#, kde-format +msgid "" +"The language for this application has been changed. The change will take " +"effect the next time the application is started." +msgstr "የዚህ መተግበሪያ ቋንቋ ተቀይሯል። ለውጡ ተግባራዊ የሚሆነው መተግበሪያው በሚቀጥለው ጊዜ ሲጀመር ነው።" + +#: kswitchlanguagedialog_p.cpp:262 +#, kde-format +msgctxt "@title:window" +msgid "Application Language Changed" +msgstr "የመተግበሪያ ቋንቋ ተቀይሯል" + +#: kswitchlanguagedialog_p.cpp:283 +#, kde-format +msgid "Application Language Changed" +msgstr "የመተግበሪያ ቋንቋ ተቀይሯል" + +#: kswitchlanguagedialog_p.cpp:368 +#, kde-format +msgid "Primary language:" +msgstr "ዋና ቋንቋ፡" + +#: kswitchlanguagedialog_p.cpp:368 +#, kde-format +msgid "Fallback language:" +msgstr "ተጠባባቂ ቋንቋ፦" + +#: kswitchlanguagedialog_p.cpp:383 +#, kde-format +msgctxt "@action:button" +msgid "Remove" +msgstr "አስውግድ" + +#: kswitchlanguagedialog_p.cpp:389 +#, kde-format +msgctxt "@info:tooltip" +msgid "" +"This is the main application language which will be used first, before any " +"other languages." +msgstr "ይህ ማንኛውም ሌላ ቋንቋ ከመጠቀሙ በፊት ቅድሚያ የሚሰጠው ዋናው የመተግበሪያ ቋንቋ ነው።" + +#: kswitchlanguagedialog_p.cpp:390 +#, kde-format +msgctxt "@info:tooltip" +msgid "" +"This is the language which will be used if any previous languages do not " +"contain a proper translation." +msgstr "ቀደምት ቋንቋዎች ትክክለኛ ትርጉም ካላካተቱ ጥቅም ላይ የሚውለው ቋንቋ ይህ ነው።" + +#: ktoolbar.cpp:309 ktoolbar.cpp:316 +#, kde-format +msgctxt "@title:menu" +msgid "Toolbar Settings" +msgstr "የመሣሪያ አሞሌ ቅንብሮች" + +#: ktoolbar.cpp:311 +#, kde-format +msgctxt "@title:menu" +msgid "Show Text" +msgstr "ጽሑፍ አሳይ" + +#: ktoolbar.cpp:318 +#, kde-format +msgctxt "Toolbar orientation" +msgid "Orientation" +msgstr "አቀማመጥ" + +#: ktoolbar.cpp:320 +#, kde-format +msgctxt "toolbar position string" +msgid "Top" +msgstr "ከላይ" + +#: ktoolbar.cpp:324 +#, kde-format +msgctxt "toolbar position string" +msgid "Left" +msgstr "ግራ" + +#: ktoolbar.cpp:327 +#, kde-format +msgctxt "toolbar position string" +msgid "Right" +msgstr "ቀኝ" + +#: ktoolbar.cpp:330 +#, kde-format +msgctxt "toolbar position string" +msgid "Bottom" +msgstr "ከታች" + +#: ktoolbar.cpp:341 +#, kde-format +msgid "Text Position" +msgstr "የጽሑፍ አቀማመጥ" + +#: ktoolbar.cpp:343 +#, kde-format +msgctxt "@item:inmenu" +msgid "Icons Only" +msgstr "አዶዎች ብቻ" + +#: ktoolbar.cpp:346 +#, kde-format +msgctxt "@item:inmenu" +msgid "Text Only" +msgstr "ጽሑፍ ብቻ" + +#: ktoolbar.cpp:349 +#, kde-format +msgctxt "@item:inmenu" +msgid "Text Alongside Icons" +msgstr "ጽሑፍ ከአዶዎች ጎን ለጎን" + +#: ktoolbar.cpp:352 +#, kde-format +msgctxt "@item:inmenu" +msgid "Text Under Icons" +msgstr "ጽሑፍ ከአዶዎች ስር" + +#: ktoolbar.cpp:363 +#, kde-format +msgid "Icon Size" +msgstr "የአዶ መጠን" + +#: ktoolbar.cpp:365 +#, kde-format +msgctxt "@item:inmenu Icon size" +msgid "Default" +msgstr "ነባሪ" + +#: ktoolbar.cpp:385 ktoolbar.cpp:409 +#, kde-format +msgid "Small (%1x%2)" +msgstr "ትንሽ (%1x%2)" + +#: ktoolbar.cpp:387 ktoolbar.cpp:411 +#, kde-format +msgid "Medium (%1x%2)" +msgstr "መካከለኛ (%1x%2)" + +#: ktoolbar.cpp:389 ktoolbar.cpp:413 +#, kde-format +msgid "Large (%1x%2)" +msgstr "ትልቅ (%1x%2)" + +#: ktoolbar.cpp:391 ktoolbar.cpp:415 +#, kde-format +msgid "Huge (%1x%2)" +msgstr "ግዙፍ (%1x%2)" + +#: ktoolbar.cpp:441 +#, kde-format +msgid "Lock Toolbar Positions" +msgstr "የመሣሪያ አሞሌ ቦታዎችን ቆልፍ" + +#: ktoolbarhandler.cpp:93 +#, kde-format +msgid "Toolbars Shown" +msgstr "የታዩ የመሣሪያ አሞሌዎች" + +#: ktooltiphelper.cpp:211 +#, kde-format +msgctxt "" +"@info:tooltip %1 is the tooltip of an action, %2 is its keyboard shorcut" +msgid "%1 (%2)" +msgstr "%1 (%2)" + +#: ktooltiphelper.cpp:279 +#, kde-format +msgctxt "@info:tooltip" +msgid "" +"Press Shift for more Info." +msgstr "ለተጨማሪ መረጃ Shift ይጫኑ።" + +#: ktooltiphelper.cpp:295 +#, kde-format +msgctxt "@info:tooltip keep short" +msgid "" +"%1
Press Shift for more." +msgstr "" +"%1
ለተጨማሪ መረጃ Shift ይጫኑ።" + +#: kundoactions.cpp:30 +#, kde-format +msgid "Redo" +msgstr "መልስ" + +#: kundoactions.cpp:49 +#, kde-format +msgid "Undo" +msgstr "ድገም" + +#: kxmlguibuilder.cpp:173 kxmlguibuilder.cpp:352 +#, kde-format +msgid "No text" +msgstr "ባዶ ጽሑፍ" + +#: kxmlguiwindow.cpp:203 +#, kde-format +msgid "Find Action…" +msgstr "እርምጃ ፈልግ…" + +#: kxmlguiwindow.cpp:573 +#, fuzzy, kde-format +msgid "" +"There are two actions (%1, %2) that want to use the same shortcut (%3). This " +"is most probably a bug. Please report it in bugs.kde.org" +msgstr "" +"ተመሳሳይ አቋራጭ መንገድ (%3) ለመጠቀም የሚፈልጉ ሁለት ተግባራት (%1፣ %2) አሉ። ይህ ምናልባት የሶፍትዌር ስህተት " +"(bug) ሊሆን ስለሚችል እባክዎን በ bugs.kde.org ሪፖርት " +"ያድርጉ።" + +#: kxmlguiwindow.cpp:578 +#, kde-format +msgid "Ambiguous Shortcuts" +msgstr "ያልተወሰኑ አቋራጮች" + +#. i18n: ectx: Menu (file) +#: ui_standards.rc:5 +#, kde-format +msgid "&File" +msgstr "ፋይል(&F)" + +#. i18n: ectx: Menu (game) +#: ui_standards.rc:34 +#, kde-format +msgid "&Game" +msgstr "ጌም(&G)" + +#. i18n: ectx: Menu (edit) +#: ui_standards.rc:61 +#, kde-format +msgid "&Edit" +msgstr "አርትዕ(&E)" + +#. i18n: ectx: Menu (move) +#: ui_standards.rc:84 +#, kde-format +msgctxt "@title:menu Game move" +msgid "&Move" +msgstr "አንቀሳቅስ (&M)" + +#. i18n: ectx: Menu (view) +#: ui_standards.rc:102 +#, kde-format +msgid "&View" +msgstr "እይታ(&V)" + +#. i18n: ectx: Menu (go) +#: ui_standards.rc:122 +#, kde-format +msgid "&Go" +msgstr "ሂድ(&G)" + +#. i18n: ectx: Menu (bookmarks) +#: ui_standards.rc:143 +#, kde-format +msgid "&Bookmarks" +msgstr "ዕልባቶች(&B)" + +#. i18n: ectx: Menu (tools) +#: ui_standards.rc:149 +#, kde-format +msgid "&Tools" +msgstr "መሳሪያዎች(&T)" + +#. i18n: ectx: Menu (settings) +#: ui_standards.rc:153 +#, kde-format +msgid "&Settings" +msgstr "ቅንብሮች(&S)" + +#. i18n: ectx: ToolBar (mainToolBar) +#: ui_standards.rc:195 +#, kde-format +msgid "Main Toolbar" +msgstr "ዋና የመሣሪያ አሞሌ" diff --git a/local/recipes/kde/kf6-kxmlgui/source/src/kactionconflictdetector_p.h b/local/recipes/kde/kf6-kxmlgui/source/src/kactionconflictdetector_p.h new file mode 100644 index 0000000000..3bcfe8ef11 --- /dev/null +++ b/local/recipes/kde/kf6-kxmlgui/source/src/kactionconflictdetector_p.h @@ -0,0 +1,48 @@ +/* + This file is part of the KDE libraries + SPDX-FileCopyrightText: 1999 Reginald Stadlbauer + SPDX-FileCopyrightText: 1999 Simon Hausmann + SPDX-FileCopyrightText: 2000 Nicolas Hadacek + SPDX-FileCopyrightText: 2000 Kurt Granroth + SPDX-FileCopyrightText: 2000 Michael Koch + SPDX-FileCopyrightText: 2001 Holger Freyther + SPDX-FileCopyrightText: 2002 Ellis Whitehead + SPDX-FileCopyrightText: 2002 Joseph Wenninger + SPDX-FileCopyrightText: 2005-2006 Hamish Rodda + + SPDX-License-Identifier: LGPL-2.0-only +*/ + +#include +#include + +#include +#include + +class KActionConflictDetector : public QObject +{ + Q_OBJECT +public: + explicit KActionConflictDetector(QObject *parent = nullptr) + : QObject(parent) + { + } + + bool eventFilter(QObject *watched, QEvent *event) override + { + if (event->type() == QEvent::Shortcut && qobject_cast(watched)) { + QShortcutEvent *se = static_cast(event); + if (se->isAmbiguous()) { + KMessageBox::information(nullptr, // No widget to be seen around here + i18n("The key sequence '%1' is ambiguous. Use 'Configure Keyboard Shortcuts'\n" + "from the 'Settings' menu to solve the ambiguity.\n" + "No action will be triggered.", + se->key().toString(QKeySequence::NativeText)), + i18nc("@title:window", "Ambiguous shortcut detected")); + return true; + } + } + + return QObject::eventFilter(watched, event); + } +}; diff --git a/local/recipes/kde/kf6-kxmlgui/source/src/kxmlgui-index.qdoc b/local/recipes/kde/kf6-kxmlgui/source/src/kxmlgui-index.qdoc new file mode 100644 index 0000000000..866b6e1681 --- /dev/null +++ b/local/recipes/kde/kf6-kxmlgui/source/src/kxmlgui-index.qdoc @@ -0,0 +1,20 @@ +/*! + \page kxmlgui-index.html + \title KXmlGui + + KXmlGui is a collection of convenience classes and widgets to manage your app's main window. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {XmlGui} {KF6::XmlGui} + + \section1 API Reference + + \list + \li \l{KXmlGui C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-kxmlgui/source/src/kxmlgui.qdoc b/local/recipes/kde/kf6-kxmlgui/source/src/kxmlgui.qdoc new file mode 100644 index 0000000000..a65e112ecb --- /dev/null +++ b/local/recipes/kde/kf6-kxmlgui/source/src/kxmlgui.qdoc @@ -0,0 +1,19 @@ +/*! + \module KXmlGui + \title KXmlGui C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent XmlGui + + \brief KXmlGui is a collection of convenience classes and widgets to manage your own main QtWidgets window. + + A window can be created using \l KXmlGuiWindow and \l KMainWindow. + + Shortcuts can be centrally managed using \l KActionCollection. + + The actions are configured through a XML description and hooks in the application code. The framework supports merging of multiple description for example for integrating actions from plugins. + + KXMLGui makes use of the Kiosk authorization functionality of KConfig (see the \l KAuthorized namespace in that framework). Notably, \l QAction instances added to a \l KActionCollection are disabled if \l KAuthorized::authorizeAction() reports that they are not authorized. The items on the standard help menu (\l KHelpMenu) can likewise be disabled based on Kiosk settings, and toolbar editing can be restricted. + + See \l KActionCollection, \l KHelpMenu and \l KToolBar documentation for more information. +*/ diff --git a/local/recipes/kde/kf6-kxmlgui/source/src/kxmlgui.qdocconf b/local/recipes/kde/kf6-kxmlgui/source/src/kxmlgui.qdocconf new file mode 100644 index 0000000000..1fa8eaade9 --- /dev/null +++ b/local/recipes/kde/kf6-kxmlgui/source/src/kxmlgui.qdocconf @@ -0,0 +1,33 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KXmlGui +description = Collection of convenience classes and widgets to manage your own main QtWidgets window + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +imagedirs = ../docs/pics + +outputformats = HTML + +navigation.landingpage = "KXmlGui" + +depends += qtcore qtgui qtwidgets qtxml kcoreaddons kconfigcore kconfiggui kglobalaccel kconfigwidgets + +qhp.projects = KXmlGui + +qhp.KXmlGui.file = kxmlgui.qhp +qhp.KXmlGui.namespace = org.kde.kxmlgui.$QT_VERSION_TAG +qhp.KXmlGui.virtualFolder = kxmlgui +qhp.KXmlGui.indexTitle = KXmlGui +qhp.KXmlGui.indexRoot = + +qhp.KXmlGui.subprojects = classes +qhp.KXmlGui.subprojects.classes.title = C++ Classes +qhp.KXmlGui.subprojects.classes.indexTitle = KXmlGui C++ Classes +qhp.KXmlGui.subprojects.classes.selectors = class fake:headerfile +qhp.KXmlGui.subprojects.classes.sortPages = true + +tagfile = kxmlgui.tags diff --git a/local/recipes/kde/kf6-kxmlgui/source/src/utils_p.h b/local/recipes/kde/kf6-kxmlgui/source/src/utils_p.h new file mode 100644 index 0000000000..a1d0001685 --- /dev/null +++ b/local/recipes/kde/kf6-kxmlgui/source/src/utils_p.h @@ -0,0 +1,24 @@ +/* + This file is part of the KDE libraries + + SPDX-FileCopyrightText: 2026 Waqar Ahmed + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#ifndef KXMLGUI_UTILS_H +#define KXMLGUI_UTILS_H + +#include + +// Case insensitive equality without calling toLower which allocates a new string +[[nodiscard]] static inline bool equals(QStringView a, QStringView b) +{ + return a.compare(b, Qt::CaseInsensitive) == 0; +} + +[[nodiscard]] static inline bool equals(QStringView a, std::string_view b) +{ + return a.compare(QLatin1String(b.data(), b.size()), Qt::CaseInsensitive) == 0; +} + +#endif diff --git a/local/recipes/kde/kf6-prison/source/src/lib/prison-index.qdoc b/local/recipes/kde/kf6-prison/source/src/lib/prison-index.qdoc new file mode 100644 index 0000000000..39e06ddda0 --- /dev/null +++ b/local/recipes/kde/kf6-prison/source/src/lib/prison-index.qdoc @@ -0,0 +1,23 @@ +/*! + \page prison-index.html + \title Prison + + Barcode Scanning and Rendering + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {Prison} {KF6::Prison} + + \section1 API Reference + + \list + \li \l{Prison C++ Classes} + \li \l{Prison QML Types} + \li \l{Prison Scanner C++ Classes} + \li \l{Prison Scanner QML Types} + \endlist +*/ diff --git a/local/recipes/kde/kf6-prison/source/src/lib/prison.qdoc b/local/recipes/kde/kf6-prison/source/src/lib/prison.qdoc new file mode 100644 index 0000000000..8dedc5b62a --- /dev/null +++ b/local/recipes/kde/kf6-prison/source/src/lib/prison.qdoc @@ -0,0 +1,18 @@ +/*! + \module Prison + \title Prison C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Prison + + \brief Barcode Rendering. + +*/ + +/*! + \qmlmodule org.kde.prison + \title Prison QML Types + \ingroup qmlmodules + \brief Barcode Rendering. + +*/ diff --git a/local/recipes/kde/kf6-prison/source/src/lib/prison.qdocconf b/local/recipes/kde/kf6-prison/source/src/lib/prison.qdocconf new file mode 100644 index 0000000000..5f6ea307df --- /dev/null +++ b/local/recipes/kde/kf6-prison/source/src/lib/prison.qdocconf @@ -0,0 +1,41 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = Prison +description = Barcode Rendering + +documentationinheaders = true + +headerdirs += . ../quick +sourcedirs += . ../quick + +outputformats = HTML + +navigation.landingpage = "Prison" + +depends += \ + kde \ + qtcore \ + qtgui \ + qtquick \ + prisonscanner + +qhp.projects = Prison + +qhp.Prison.file = prison.qhp +qhp.Prison.namespace = org.kde.prison.$QT_VERSION_TAG +qhp.Prison.virtualFolder = prison +qhp.Prison.indexTitle = Prison +qhp.Prison.indexRoot = + +qhp.Prison.subprojects = classes qmltypes +qhp.Prison.subprojects.classes.title = C++ Classes +qhp.Prison.subprojects.classes.indexTitle = Prison C++ Classes +qhp.Prison.subprojects.classes.selectors = class fake:headerfile +qhp.Prison.subprojects.classes.sortPages = true + +qhp.Prison.subprojects.qmltypes.title = QML Types +qhp.Prison.subprojects.qmltypes.indexTitle = Prison QML Types +qhp.Prison.subprojects.qmltypes.selectors = qmltype +qhp.Prison.subprojects.qmltypes.sortPages = true + +tagfile = prison.tags diff --git a/local/recipes/kde/kf6-prison/source/src/scanner/prisonscanner.qdoc b/local/recipes/kde/kf6-prison/source/src/scanner/prisonscanner.qdoc new file mode 100644 index 0000000000..17f890fc85 --- /dev/null +++ b/local/recipes/kde/kf6-prison/source/src/scanner/prisonscanner.qdoc @@ -0,0 +1,17 @@ +/*! + \module PrisonScanner + \title Prison Scanner C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Prison + \cmaketargetitem KF6::PrisonScanner + + \brief Barcode Scanning. +*/ + +/*! + \qmlmodule org.kde.prison.scanner + \title Prison Scanner QML Types + \ingroup qmlmodules + \brief Barcode Scanning. +*/ diff --git a/local/recipes/kde/kf6-prison/source/src/scanner/prisonscanner.qdocconf b/local/recipes/kde/kf6-prison/source/src/scanner/prisonscanner.qdocconf new file mode 100644 index 0000000000..222d5948a9 --- /dev/null +++ b/local/recipes/kde/kf6-prison/source/src/scanner/prisonscanner.qdocconf @@ -0,0 +1,39 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = PrisonScanner +description = Barcode Scanning + +documentationinheaders = true + +headerdirs += . ../scanner-quick +sourcedirs += . ../scanner-quick + +outputformats = HTML + +navigation.landingpage = "Prison" + +depends += \ + kde \ + qtcore \ + qtmultimedia + +qhp.projects = PrisonScanner + +qhp.PrisonScanner.file = prisonscanner.qhp +qhp.PrisonScanner.namespace = org.kde.prisonscanner.$QT_VERSION_TAG +qhp.PrisonScanner.virtualFolder = prisonscanner +qhp.PrisonScanner.indexTitle = Prison Scanner +qhp.PrisonScanner.indexRoot = + +qhp.PrisonScanner.subprojects = classes qmltypes +qhp.PrisonScanner.subprojects.classes.title = C++ Classes +qhp.PrisonScanner.subprojects.classes.indexTitle = Prison Scanner C++ Classes +qhp.PrisonScanner.subprojects.classes.selectors = class fake:headerfile +qhp.PrisonScanner.subprojects.classes.sortPages = true + +qhp.PrisonScanner.subprojects.qmltypes.title = QML Types +qhp.PrisonScanner.subprojects.qmltypes.indexTitle = Prison Scanner QML Types +qhp.PrisonScanner.subprojects.qmltypes.selectors = qmltype +qhp.PrisonScanner.subprojects.qmltypes.sortPages = true + +tagfile = prisonscanner.tags diff --git a/local/recipes/kde/kf6-pty/01-no-utmp.patch b/local/recipes/kde/kf6-pty/01-no-utmp.patch new file mode 100644 index 0000000000..25eace62f8 --- /dev/null +++ b/local/recipes/kde/kf6-pty/01-no-utmp.patch @@ -0,0 +1,37 @@ +--- a/src/kpty.cpp ++++ b/src/kpty.cpp +@@ -464,6 +464,9 @@ + } + + #else ++#if 0 ++ Q_UNUSED(user) ++ Q_UNUSED(remotehost) + #if HAVE_UTMPX + struct utmpx l_struct; + #else +@@ -532,6 +535,8 @@ + #endif + #endif + #endif ++#endif + } + + void KPty::logout() +@@ -551,6 +556,8 @@ + } + + #else ++#if 0 ++ return; + Q_D(KPty); + + const char *str_ptr = d->ttyName.data(); +@@ -611,6 +618,7 @@ + endutent(); + #endif + #endif ++#endif + #endif + } + diff --git a/local/recipes/kde/kf6-pty/source/src/kpty-index.qdoc b/local/recipes/kde/kf6-pty/source/src/kpty-index.qdoc new file mode 100644 index 0000000000..8b35382193 --- /dev/null +++ b/local/recipes/kde/kf6-pty/source/src/kpty-index.qdoc @@ -0,0 +1,20 @@ +/*! + \page kpty-index.html + \title KPty + + Interfacing with pseudo terminal devices. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {Pty} {KF6::Pty} + + \section1 API Reference + + \list + \li \l{KPty C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-pty/source/src/kpty.qdoc b/local/recipes/kde/kf6-pty/source/src/kpty.qdoc new file mode 100644 index 0000000000..e7c98d1fa3 --- /dev/null +++ b/local/recipes/kde/kf6-pty/source/src/kpty.qdoc @@ -0,0 +1,9 @@ +/*! + \module KPty + \title KPty C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Pty + + \brief Interfacing with pseudo terminal devices. +*/ diff --git a/local/recipes/kde/kf6-pty/source/src/kpty.qdocconf b/local/recipes/kde/kf6-pty/source/src/kpty.qdocconf new file mode 100644 index 0000000000..6606be20ba --- /dev/null +++ b/local/recipes/kde/kf6-pty/source/src/kpty.qdocconf @@ -0,0 +1,34 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KPty +description = Interfacing with pseudo terminal devices + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +navigation.landingpage = "KPty" + +depends += \ + kde \ + qtcore \ + kcoreaddons + +qhp.projects = KPty + +qhp.KPty.file = kpty.qhp +qhp.KPty.namespace = org.kde.kpty.$QT_VERSION_TAG +qhp.KPty.virtualFolder = kpty +qhp.KPty.indexTitle = KPty +qhp.KPty.indexRoot = + +qhp.KPty.subprojects = classes +qhp.KPty.subprojects.classes.title = C++ Classes +qhp.KPty.subprojects.classes.indexTitle = KPty C++ Classes +qhp.KPty.subprojects.classes.selectors = class fake:headerfile +qhp.KPty.subprojects.classes.sortPages = true + +tagfile = kpty.tags diff --git a/local/recipes/kde/kf6-pty/source/src/utmp_compat.h b/local/recipes/kde/kf6-pty/source/src/utmp_compat.h new file mode 100644 index 0000000000..14f068f35a --- /dev/null +++ b/local/recipes/kde/kf6-pty/source/src/utmp_compat.h @@ -0,0 +1,23 @@ +#ifndef REDOX_UTMP_COMPAT_H +#define REDOX_UTMP_COMPAT_H +struct utmp { char ut_line[32]; char ut_name[32]; char ut_host[256]; long ut_time; int ut_type; int ut_pid; int ut_session; char ut_id[4]; int ut_syslen; }; +struct utmpx { char ut_line[32]; char ut_name[32]; char ut_host[256]; struct { long tv_sec; long tv_usec; } ut_tv; int ut_type; int ut_pid; int ut_session; char ut_id[4]; int ut_syslen; }; +#define _PATH_UTMP "/dev/null" +#define _PATH_WTMP "/dev/null" +#define _PATH_UTMPX "/dev/null" +#define _PATH_WTMPX "/dev/null" +#define DEAD_PROCESS 0 +#define USER_PROCESS 0 +static inline void utmpname(const char *f) { (void)f; } +static inline void setutent(void) {} +static inline void endutent(void) {} +static inline struct utmp *getutline(struct utmp *u) { (void)u; return 0; } +static inline void pututline(struct utmp *u) { (void)u; } +static inline void updwtmp(const char *f, struct utmp *u) { (void)f; (void)u; } +static inline void utmpxname(const char *f) { (void)f; } +static inline void setutxent(void) {} +static inline void endutxent(void) {} +static inline struct utmpx *getutxline(struct utmpx *u) { (void)u; return 0; } +static inline void pututxline(struct utmpx *u) { (void)u; } +static inline void updwtmpx(const char *f, struct utmpx *u) { (void)f; (void)u; } +#endif diff --git a/local/recipes/kde/kf6-solid/source/autotests/predicatetest.cpp b/local/recipes/kde/kf6-solid/source/autotests/predicatetest.cpp new file mode 100644 index 0000000000..ad5d41f191 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/autotests/predicatetest.cpp @@ -0,0 +1,35 @@ +/* + SPDX-FileCopyrightText: 2025 Joshua Goins + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +// Qt includes +#include + +// Solid includes +#include + +class PredicateTest : public QObject +{ + Q_OBJECT +private Q_SLOTS: + void testParsing(); +}; + +QTEST_MAIN(PredicateTest) + +void PredicateTest::testParsing() +{ + Solid::Predicate equalPredicate = Solid::Predicate::fromString(QStringLiteral("IS OpticalDisc")); + QVERIFY(equalPredicate.isValid()); + QCOMPARE(equalPredicate.interfaceType(), Solid::DeviceInterface::OpticalDisc); + QCOMPARE(equalPredicate.isInterfaceTypeNegated(), false); + + Solid::Predicate notEqualPredicate = Solid::Predicate::fromString(QStringLiteral("IS_NOT OpticalDisc")); + QVERIFY(notEqualPredicate.isValid()); + QCOMPARE(notEqualPredicate.interfaceType(), Solid::DeviceInterface::OpticalDisc); + QCOMPARE(notEqualPredicate.isInterfaceTypeNegated(), true); +} + +#include "predicatetest.moc" diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/CMakeLists.txt b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/CMakeLists.txt new file mode 100644 index 0000000000..c91d2466f4 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/CMakeLists.txt @@ -0,0 +1,30 @@ +set(backend_sources + kdeconnectmanager.cpp + kdeconnectmanager.h + kdeconnectdevice.cpp + kdeconnectdevice.h + kdeconnectbattery.cpp + kdeconnectbattery.h + kdeconnectdeviceinterface.cpp + kdeconnectdeviceinterface.h + kdeconnectportablemediaplayer.cpp + kdeconnectportablemediaplayer.h + kdeconnectutils.cpp + kdeconnectutils.h + + dbus/kdeconnect_daemon_interface.cpp + dbus/kdeconnect_daemon_interface.h + dbus/kdeconnect_device_interface.cpp + dbus/kdeconnect_device_interface.h + dbus/kdeconnect_device_battery_interface.cpp + dbus/kdeconnect_device_battery_interface.h +) + +ecm_qt_declare_logging_category(backend_sources + HEADER kdeconnect_debug.h + IDENTIFIER Solid::Backends::KdeConnect::KDECONNECT + CATEGORY_NAME kf.solid.backends.kdeconnect + DESCRIPTION "KDE Connect (Solid)" + EXPORT SOLID +) + diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/kdeconnect_daemon_interface.cpp b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/kdeconnect_daemon_interface.cpp new file mode 100644 index 0000000000..7c6c74b728 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/kdeconnect_daemon_interface.cpp @@ -0,0 +1,28 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Source file was org.kde.kdeconnect.daemon.xml + * + * qdbusxml2cpp is Copyright (C) The Qt Company Ltd. and other contributors. + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#include "kdeconnect_daemon_interface.h" + +/* + * Implementation of interface class OrgKdeKdeconnectDaemonInterface + */ + +OrgKdeKdeconnectDaemonInterface::OrgKdeKdeconnectDaemonInterface(const QString &service, + const QString &path, + const QDBusConnection &connection, + QObject *parent) + : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) +{ +} + +OrgKdeKdeconnectDaemonInterface::~OrgKdeKdeconnectDaemonInterface() +{ +} diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/kdeconnect_daemon_interface.h b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/kdeconnect_daemon_interface.h new file mode 100644 index 0000000000..ea02c81263 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/kdeconnect_daemon_interface.h @@ -0,0 +1,171 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Source file was org.kde.kdeconnect.daemon.xml + * + * qdbusxml2cpp is Copyright (C) The Qt Company Ltd. and other contributors. + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#ifndef KDECONNECT_DAEMON_INTERFACE_H +#define KDECONNECT_DAEMON_INTERFACE_H + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Proxy class for interface org.kde.kdeconnect.daemon + */ +class OrgKdeKdeconnectDaemonInterface : public QDBusAbstractInterface +{ + Q_OBJECT +public: + static inline const char *staticInterfaceName() + { + return "org.kde.kdeconnect.daemon"; + } + +public: + OrgKdeKdeconnectDaemonInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); + + ~OrgKdeKdeconnectDaemonInterface(); + + Q_PROPERTY(QStringList customDevices READ customDevices WRITE setCustomDevices) + inline QStringList customDevices() const + { + return qvariant_cast(property("customDevices")); + } + inline void setCustomDevices(const QStringList &value) + { + setProperty("customDevices", QVariant::fromValue(value)); + } + + Q_PROPERTY(QStringList pairingRequests READ pairingRequests) + inline QStringList pairingRequests() const + { + return qvariant_cast(property("pairingRequests")); + } + +public Q_SLOTS: // METHODS + inline QDBusPendingReply announcedName() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("announcedName"), argumentList); + } + + inline QDBusPendingReply deviceIdByName(const QString &name) + { + QList argumentList; + argumentList << QVariant::fromValue(name); + return asyncCallWithArgumentList(QStringLiteral("deviceIdByName"), argumentList); + } + + inline QDBusPendingReply> deviceNames() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("deviceNames"), argumentList); + } + + inline QDBusPendingReply> deviceNames(bool onlyReachable) + { + QList argumentList; + argumentList << QVariant::fromValue(onlyReachable); + return asyncCallWithArgumentList(QStringLiteral("deviceNames"), argumentList); + } + + inline QDBusPendingReply> deviceNames(bool onlyReachable, bool onlyPaired) + { + QList argumentList; + argumentList << QVariant::fromValue(onlyReachable) << QVariant::fromValue(onlyPaired); + return asyncCallWithArgumentList(QStringLiteral("deviceNames"), argumentList); + } + + inline QDBusPendingReply devices() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("devices"), argumentList); + } + + inline QDBusPendingReply devices(bool onlyReachable) + { + QList argumentList; + argumentList << QVariant::fromValue(onlyReachable); + return asyncCallWithArgumentList(QStringLiteral("devices"), argumentList); + } + + inline QDBusPendingReply devices(bool onlyReachable, bool onlyPaired) + { + QList argumentList; + argumentList << QVariant::fromValue(onlyReachable) << QVariant::fromValue(onlyPaired); + return asyncCallWithArgumentList(QStringLiteral("devices"), argumentList); + } + + inline QDBusPendingReply<> forceOnNetworkChange() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("forceOnNetworkChange"), argumentList); + } + + inline QDBusPendingReply linkProviders() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("linkProviders"), argumentList); + } + + inline QDBusPendingReply selfId() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("selfId"), argumentList); + } + + inline QDBusPendingReply<> sendSimpleNotification(const QString &eventId, const QString &title, const QString &text, const QString &iconName) + { + QList argumentList; + argumentList << QVariant::fromValue(eventId) << QVariant::fromValue(title) << QVariant::fromValue(text) << QVariant::fromValue(iconName); + return asyncCallWithArgumentList(QStringLiteral("sendSimpleNotification"), argumentList); + } + + inline QDBusPendingReply<> setAnnouncedName(const QString &name) + { + QList argumentList; + argumentList << QVariant::fromValue(name); + return asyncCallWithArgumentList(QStringLiteral("setAnnouncedName"), argumentList); + } + + inline QDBusPendingReply<> setLinkProviderState(const QString &linkProvider, bool enabled) + { + QList argumentList; + argumentList << QVariant::fromValue(linkProvider) << QVariant::fromValue(enabled); + return asyncCallWithArgumentList(QStringLiteral("setLinkProviderState"), argumentList); + } + +Q_SIGNALS: // SIGNALS + void announcedNameChanged(const QString &announcedName); + void customDevicesChanged(const QStringList &customDevices); + void deviceAdded(const QString &id); + void deviceListChanged(); + void deviceRemoved(const QString &id); + void deviceVisibilityChanged(const QString &id, bool isVisible); + void linkProvidersChanged(const QStringList &linkProviders); + void pairingRequestsChanged(); +}; + +namespace org +{ +namespace kde +{ +namespace kdeconnect +{ +using daemon = ::OrgKdeKdeconnectDaemonInterface; +} +} +} + +#endif diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/kdeconnect_device_battery_interface.cpp b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/kdeconnect_device_battery_interface.cpp new file mode 100644 index 0000000000..e21111914a --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/kdeconnect_device_battery_interface.cpp @@ -0,0 +1,28 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Source file was org.kde.kdeconnect.device.battery.xml + * + * qdbusxml2cpp is Copyright (C) The Qt Company Ltd. and other contributors. + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#include "kdeconnect_device_battery_interface.h" + +/* + * Implementation of interface class OrgKdeKdeconnectDeviceBatteryInterface + */ + +OrgKdeKdeconnectDeviceBatteryInterface::OrgKdeKdeconnectDeviceBatteryInterface(const QString &service, + const QString &path, + const QDBusConnection &connection, + QObject *parent) + : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) +{ +} + +OrgKdeKdeconnectDeviceBatteryInterface::~OrgKdeKdeconnectDeviceBatteryInterface() +{ +} diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/kdeconnect_device_battery_interface.h b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/kdeconnect_device_battery_interface.h new file mode 100644 index 0000000000..1ffd3765df --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/kdeconnect_device_battery_interface.h @@ -0,0 +1,57 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Source file was org.kde.kdeconnect.device.battery.xml + * + * qdbusxml2cpp is Copyright (C) The Qt Company Ltd. and other contributors. + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#ifndef KDECONNECT_DEVICE_BATTERY_INTERFACE_H +#define KDECONNECT_DEVICE_BATTERY_INTERFACE_H + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Proxy class for interface org.kde.kdeconnect.device.battery + */ +class OrgKdeKdeconnectDeviceBatteryInterface : public QDBusAbstractInterface +{ + Q_OBJECT +public: + static inline const char *staticInterfaceName() + { + return "org.kde.kdeconnect.device.battery"; + } + +public: + OrgKdeKdeconnectDeviceBatteryInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); + + ~OrgKdeKdeconnectDeviceBatteryInterface(); + + Q_PROPERTY(int charge READ charge) + inline int charge() const + { + return qvariant_cast(property("charge")); + } + + Q_PROPERTY(bool isCharging READ isCharging) + inline bool isCharging() const + { + return qvariant_cast(property("isCharging")); + } + +public Q_SLOTS: // METHODS +Q_SIGNALS: // SIGNALS + void refreshed(bool isCharging, int charge); +}; + +#endif diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/kdeconnect_device_interface.cpp b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/kdeconnect_device_interface.cpp new file mode 100644 index 0000000000..cf96542a84 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/kdeconnect_device_interface.cpp @@ -0,0 +1,28 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Source file was org.kde.kdeconnect.device.xml + * + * qdbusxml2cpp is Copyright (C) The Qt Company Ltd. and other contributors. + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#include "kdeconnect_device_interface.h" + +/* + * Implementation of interface class OrgKdeKdeconnectDeviceInterface + */ + +OrgKdeKdeconnectDeviceInterface::OrgKdeKdeconnectDeviceInterface(const QString &service, + const QString &path, + const QDBusConnection &connection, + QObject *parent) + : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) +{ +} + +OrgKdeKdeconnectDeviceInterface::~OrgKdeKdeconnectDeviceInterface() +{ +} diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/kdeconnect_device_interface.h b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/kdeconnect_device_interface.h new file mode 100644 index 0000000000..b568a46405 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/kdeconnect_device_interface.h @@ -0,0 +1,236 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Source file was org.kde.kdeconnect.device.xml + * + * qdbusxml2cpp is Copyright (C) The Qt Company Ltd. and other contributors. + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#ifndef KDECONNECT_DEVICE_INTERFACE_H +#define KDECONNECT_DEVICE_INTERFACE_H + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Proxy class for interface org.kde.kdeconnect.device + */ +class OrgKdeKdeconnectDeviceInterface : public QDBusAbstractInterface +{ + Q_OBJECT +public: + static inline const char *staticInterfaceName() + { + return "org.kde.kdeconnect.device"; + } + +public: + OrgKdeKdeconnectDeviceInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); + + ~OrgKdeKdeconnectDeviceInterface(); + + Q_PROPERTY(QStringList activeProviderNames READ activeProviderNames) + inline QStringList activeProviderNames() const + { + return qvariant_cast(property("activeProviderNames")); + } + + Q_PROPERTY(QString iconName READ iconName) + inline QString iconName() const + { + return qvariant_cast(property("iconName")); + } + + Q_PROPERTY(bool isPairRequested READ isPairRequested) + inline bool isPairRequested() const + { + return qvariant_cast(property("isPairRequested")); + } + + Q_PROPERTY(bool isPairRequestedByPeer READ isPairRequestedByPeer) + inline bool isPairRequestedByPeer() const + { + return qvariant_cast(property("isPairRequestedByPeer")); + } + + Q_PROPERTY(bool isPaired READ isPaired) + inline bool isPaired() const + { + return qvariant_cast(property("isPaired")); + } + + Q_PROPERTY(bool isReachable READ isReachable) + inline bool isReachable() const + { + return qvariant_cast(property("isReachable")); + } + + Q_PROPERTY(QString name READ name) + inline QString name() const + { + return qvariant_cast(property("name")); + } + + Q_PROPERTY(int pairState READ pairState) + inline int pairState() const + { + return qvariant_cast(property("pairState")); + } + + Q_PROPERTY(QStringList reachableAddresses READ reachableAddresses) + inline QStringList reachableAddresses() const + { + return qvariant_cast(property("reachableAddresses")); + } + + Q_PROPERTY(QString statusIconName READ statusIconName) + inline QString statusIconName() const + { + return qvariant_cast(property("statusIconName")); + } + + Q_PROPERTY(QStringList supportedPlugins READ supportedPlugins) + inline QStringList supportedPlugins() const + { + return qvariant_cast(property("supportedPlugins")); + } + + Q_PROPERTY(QString type READ type) + inline QString type() const + { + return qvariant_cast(property("type")); + } + + Q_PROPERTY(QString verificationKey READ verificationKey) + inline QString verificationKey() const + { + return qvariant_cast(property("verificationKey")); + } + +public Q_SLOTS: // METHODS + inline QDBusPendingReply<> acceptPairing() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("acceptPairing"), argumentList); + } + + inline QDBusPendingReply<> cancelPairing() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("cancelPairing"), argumentList); + } + + inline QDBusPendingReply encryptionInfo() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("encryptionInfo"), argumentList); + } + + inline QDBusPendingReply hasPlugin(const QString &name) + { + QList argumentList; + argumentList << QVariant::fromValue(name); + return asyncCallWithArgumentList(QStringLiteral("hasPlugin"), argumentList); + } + + inline QDBusPendingReply isPairRequested() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("isPairRequested"), argumentList); + } + + inline QDBusPendingReply isPairRequestedByPeer() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("isPairRequestedByPeer"), argumentList); + } + + inline QDBusPendingReply isPaired() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("isPaired"), argumentList); + } + + inline QDBusPendingReply isPluginEnabled(const QString &pluginName) + { + QList argumentList; + argumentList << QVariant::fromValue(pluginName); + return asyncCallWithArgumentList(QStringLiteral("isPluginEnabled"), argumentList); + } + + inline QDBusPendingReply loadedPlugins() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("loadedPlugins"), argumentList); + } + + inline QDBusPendingReply pairStateAsInt() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("pairStateAsInt"), argumentList); + } + + inline QDBusPendingReply pluginIconName(const QString &pluginName) + { + QList argumentList; + argumentList << QVariant::fromValue(pluginName); + return asyncCallWithArgumentList(QStringLiteral("pluginIconName"), argumentList); + } + + inline QDBusPendingReply pluginsConfigFile() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("pluginsConfigFile"), argumentList); + } + + inline QDBusPendingReply<> reloadPlugins() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("reloadPlugins"), argumentList); + } + + inline QDBusPendingReply<> requestPairing() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("requestPairing"), argumentList); + } + + inline QDBusPendingReply<> setPluginEnabled(const QString &pluginName, bool enabled) + { + QList argumentList; + argumentList << QVariant::fromValue(pluginName) << QVariant::fromValue(enabled); + return asyncCallWithArgumentList(QStringLiteral("setPluginEnabled"), argumentList); + } + + inline QDBusPendingReply<> unpair() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("unpair"), argumentList); + } + + inline QDBusPendingReply verificationKey() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("verificationKey"), argumentList); + } + +Q_SIGNALS: // SIGNALS + void linksChanged(); + void nameChanged(const QString &name); + void pairStateChanged(int pairState); + void pairingFailed(const QString &error); + void pluginsChanged(); + void reachableChanged(bool reachable); + void statusIconNameChanged(); + void typeChanged(const QString &type); +}; + +#endif diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/org.kde.kdeconnect.daemon.xml b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/org.kde.kdeconnect.daemon.xml new file mode 100644 index 0000000000..9a5f2fee4f --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/org.kde.kdeconnect.daemon.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/org.kde.kdeconnect.device.battery.xml b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/org.kde.kdeconnect.device.battery.xml new file mode 100644 index 0000000000..9ae6f20067 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/org.kde.kdeconnect.device.battery.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/org.kde.kdeconnect.device.xml b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/org.kde.kdeconnect.device.xml new file mode 100644 index 0000000000..ba1b815158 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/dbus/org.kde.kdeconnect.device.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectbattery.cpp b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectbattery.cpp new file mode 100644 index 0000000000..536545e115 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectbattery.cpp @@ -0,0 +1,196 @@ +/* + * SPDX-FileCopyrightText: 2026 Kai Uwe Broulik + * + * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + */ + +#include "kdeconnectbattery.h" +#include "kdeconnect_debug.h" +#include "kdeconnectutils.h" + +using namespace Solid::Backends::KdeConnect; + +Battery::Battery(Device *device) + : DeviceInterface(device) + , m_batteryIface(Utils::dbusService(), device->dbusPath() + QLatin1String("/battery"), QDBusConnection::sessionBus()) +{ + const QString deviceType = m_device->deviceType(); + // TODO mediacenter? computer? + if (deviceType != QLatin1String("phone")) { + // TabletBattery is for graphics tablet, "tablet" device type is a tablet aka large smartphone. + m_batteryType = Solid::Battery::UnknownBattery; + } + + connect(&m_batteryIface, &OrgKdeKdeconnectDeviceBatteryInterface::refreshed, this, &Battery::refresh); + + { + auto message = Utils::getPropertyCall(m_batteryIface, QStringLiteral("charge")); + auto call = m_batteryIface.connection().asyncCall(message); + auto *watcher = new QDBusPendingCallWatcher(call, this); + connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, udi = device->udi(), watcher] { + watcher->deleteLater(); + + QDBusPendingReply reply = *watcher; + if (!reply.isValid()) { + qCWarning(KDECONNECT) << "Failed to fetch battery charge percent for" << udi << reply.error().message(); + } else { + refresh(std::nullopt, reply.value().variant().toInt()); + } + }); + } + + { + auto message = Utils::getPropertyCall(m_batteryIface, QStringLiteral("isCharging")); + auto call = m_batteryIface.connection().asyncCall(message); + auto *watcher = new QDBusPendingCallWatcher(call, this); + connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, udi = device->udi(), watcher] { + watcher->deleteLater(); + + QDBusPendingReply reply = *watcher; + if (!reply.isValid()) { + qCWarning(KDECONNECT) << "Failed to fetch battery charge state for" << udi << reply.error().message(); + } else { + refresh(reply.value().variant().toBool(), std::nullopt); + } + }); + } +} + +Battery::~Battery() = default; + +bool Battery::isPresent() const +{ + return chargePercent() > -1; +} + +Solid::Battery::BatteryType Battery::type() const +{ + return m_batteryType; +} + +int Battery::chargePercent() const +{ + return m_chargePercent.value_or(-1); +} + +int Battery::capacity() const +{ + return -1; +} + +int Battery::cycleCount() const +{ + return -1; +} + +bool Battery::isRechargeable() const +{ + return true; +} + +bool Battery::isPowerSupply() const +{ + return false; +} + +Solid::Battery::ChargeState Battery::chargeState() const +{ + if (m_isCharging.has_value()) { + if (m_isCharging.value()) { + return Solid::Battery::Charging; + } else if (isPresent()) { + if (chargePercent() == 100) { + return Solid::Battery::FullyCharged; + } else { + return Solid::Battery::Discharging; + } + } + } + + return Solid::Battery::NoCharge; +} + +qlonglong Battery::timeToEmpty() const +{ + return -1; +} + +qlonglong Battery::timeToFull() const +{ + return -1; +} + +Solid::Battery::Technology Battery::technology() const +{ + return Solid::Battery::UnknownTechnology; +} + +double Battery::energy() const +{ + return 0; +} + +double Battery::energyFull() const +{ + return 0; +} + +double Battery::energyFullDesign() const +{ + return 0; +} + +double Battery::energyRate() const +{ + return 0; +} + +double Battery::voltage() const +{ + return 0; +} + +double Battery::temperature() const +{ + return 0; +} + +QString Battery::serial() const +{ + return {}; +} + +qlonglong Battery::remainingTime() const +{ + return -1; +} + +void Battery::refresh(const std::optional &isCharging, const std::optional &charge) +{ + if (isCharging.has_value() && charge.has_value()) { + qCDebug(KDECONNECT) << m_device->udi() << "battery refreshed:" << charge.value() << "%" << (isCharging.value() ? "(charging)" : "(discharging)"); + } + + const auto oldChargePercent = chargePercent(); + const auto oldChargeState = chargeState(); + const auto oldPresent = isPresent(); + + if (isCharging.has_value()) { + m_isCharging = isCharging; + } + if (charge.has_value()) { + m_chargePercent = charge; + } + + if (oldChargePercent != chargePercent()) { + Q_EMIT chargePercentChanged(chargePercent(), m_device->udi()); + } + if (oldChargeState != chargeState()) { + Q_EMIT chargeStateChanged(chargeState(), m_device->udi()); + } + if (oldPresent != isPresent()) { + Q_EMIT presentStateChanged(isPresent(), m_device->udi()); + } +} + +#include "moc_kdeconnectbattery.cpp" diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectbattery.h b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectbattery.h new file mode 100644 index 0000000000..ae8041f452 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectbattery.h @@ -0,0 +1,104 @@ +/* + * SPDX-FileCopyrightText: 2026 Kai Uwe Broulik + * + * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + */ + +#ifndef SOLID_BACKENDS_KDECONNECT_BATTERY_H +#define SOLID_BACKENDS_KDECONNECT_BATTERY_H + +#include "kdeconnectdeviceinterface.h" +#include + +#include "dbus/kdeconnect_device_battery_interface.h" + +#include + +namespace Solid +{ +namespace Backends +{ +namespace KdeConnect +{ + +class Device; + +class Battery : public DeviceInterface, virtual public Solid::Ifaces::Battery +{ + Q_OBJECT + Q_INTERFACES(Solid::Ifaces::Battery) + +public: + Battery(Device *device); + ~Battery() override; + + bool isPresent() const override; + + Solid::Battery::BatteryType type() const override; + + int chargePercent() const override; + + int capacity() const override; + + int cycleCount() const override; + + bool isRechargeable() const override; + + bool isPowerSupply() const override; + + Solid::Battery::ChargeState chargeState() const override; + + qlonglong timeToEmpty() const override; + + qlonglong timeToFull() const override; + + Solid::Battery::Technology technology() const override; + + double energy() const override; + + double energyFull() const override; + + double energyFullDesign() const override; + + double energyRate() const override; + + double voltage() const override; + + double temperature() const override; + + QString serial() const override; + + qlonglong remainingTime() const override; + +Q_SIGNALS: + void presentStateChanged(bool newState, const QString &udi) override; + void chargePercentChanged(int value, const QString &udi = QString()) override; + void capacityChanged(int value, const QString &udi) override; + void cycleCountChanged(int value, const QString &udi) override; + void powerSupplyStateChanged(bool newState, const QString &udi) override; + void chargeStateChanged(int newState, const QString &udi = QString()) override; + void timeToEmptyChanged(qlonglong time, const QString &udi) override; + void timeToFullChanged(qlonglong time, const QString &udi) override; + void energyChanged(double energy, const QString &udi) override; + void energyFullChanged(double energyFull, const QString &udi) override; + void energyFullDesignChanged(double energyFullDesign, const QString &udi) override; + void energyRateChanged(double energyRate, const QString &udi) override; + void voltageChanged(double voltage, const QString &udi) override; + void temperatureChanged(double temperature, const QString &udi) override; + void remainingTimeChanged(qlonglong time, const QString &udi) override; + +private: + void refresh(const std::optional &isCharging, const std::optional &chargePercent); + + OrgKdeKdeconnectDeviceBatteryInterface m_batteryIface; + + mutable std::optional m_isCharging; + mutable std::optional m_chargePercent; + Solid::Battery::BatteryType m_batteryType = Solid::Battery::PhoneBattery; +}; + +} +} +} + +#endif // SOLID_BACKENDS_KDECONNECT_BATTERY_H diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectdevice.cpp b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectdevice.cpp new file mode 100644 index 0000000000..a564e63f07 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectdevice.cpp @@ -0,0 +1,119 @@ +/* + * SPDX-FileCopyrightText: 2026 Kai Uwe Broulik + * + * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + */ + +#include "kdeconnect_debug.h" + +#include "kdeconnectbattery.h" +#include "kdeconnectdevice.h" +#include "kdeconnectdeviceinterface.h" +#include "kdeconnectmanager.h" +#include "kdeconnectportablemediaplayer.h" +#include "kdeconnectutils.h" + +#include + +#include + +using namespace Solid::Backends::KdeConnect; + +Device::Device(Manager *manager, const QString &udi) + : Solid::Ifaces::Device() + , m_manager(manager) + , m_udi(udi) +{ + // We don't monitor any device properties here since most of that is handled by the manager. + // For example, (un)pairing a device will emit pairingRequestsChanged on the manager + // where it will update the device. Furthermore, once a device becomes reachable, we will + // update the list of loaded modules. + // NameChanged is the only signal we could realistically listen for but Solid::Device has + // no signal for that. + + const QStringList loadedPlugins = m_manager->deviceProperty(m_udi, QStringLiteral("loadedPlugins")).toStringList(); + + if (loadedPlugins.contains(QLatin1String("kdeconnect_battery"))) { + m_supportedDeviceTypes.insert(Solid::DeviceInterface::Type::Battery); + } + if (loadedPlugins.contains(QLatin1String("kdeconnect_sftp"))) { + m_supportedDeviceTypes.insert(Solid::DeviceInterface::PortableMediaPlayer); + } +} + +Device::~Device() = default; + +QObject *Device::createDeviceInterface(const Solid::DeviceInterface::Type &type) +{ + if (!queryDeviceInterface(type)) { + return nullptr; + } + + switch (type) { + case Solid::DeviceInterface::Battery: + return new Battery(this); + case Solid::DeviceInterface::PortableMediaPlayer: + return new PortableMediaPlayer(this); + default: + return nullptr; + } +} + +bool Device::queryDeviceInterface(const Solid::DeviceInterface::Type &type) const +{ + return m_supportedDeviceTypes.contains(type); +} + +QStringList Device::emblems() const +{ + // statusIconName? + return {}; +} + +QString Device::description() const +{ + return product(); +} + +QString Device::icon() const +{ + // iconName? + return QStringLiteral("kdeconnect"); +} + +QString Device::product() const +{ + return m_manager->deviceProperty(m_udi, QStringLiteral("name")).toString(); +} + +QString Device::deviceType() const +{ + return m_manager->deviceProperty(m_udi, QStringLiteral("type")).toString(); +} + +QString Device::vendor() const +{ + return {}; +} + +QString Device::udi() const +{ + return m_udi; +} + +QString Device::parentUdi() const +{ + return Utils::udiPrefix(); +} + +QString Device::deviceId() const +{ + return m_udi.section(QLatin1Char('/'), -1); +} + +QString Device::dbusPath() const +{ + return Utils::deviceDBusPath(deviceId()); +} + +#include "moc_kdeconnectdevice.cpp" diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectdevice.h b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectdevice.h new file mode 100644 index 0000000000..1f9bfc58c1 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectdevice.h @@ -0,0 +1,68 @@ +/* + * SPDX-FileCopyrightText: 2026 Kai Uwe Broulik + * + * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + */ + +#ifndef SOLID_BACKENDS_KDECONNECT_DEVICE_H +#define SOLID_BACKENDS_KDECONNECT_DEVICE_H + +#include +#include + +#include + +#include + +namespace Solid +{ +namespace Backends +{ +namespace KdeConnect +{ + +class Manager; + +class Device : public Solid::Ifaces::Device +{ + Q_OBJECT +public: + Device(Manager *manager, const QString &udi); + ~Device() override; + + // from kdeconnect-kde/core/pairstate.h + enum class PairState { + NotPaired, + Requested, + RequestedByPeer, + Paired, + }; + + QObject *createDeviceInterface(const Solid::DeviceInterface::Type &type) override; + bool queryDeviceInterface(const Solid::DeviceInterface::Type &type) const override; + QString description() const override; + QStringList emblems() const override; + QString icon() const override; + QString product() const override; + QString vendor() const override; + QString udi() const override; + QString parentUdi() const override; + + QString deviceType() const; + + QString deviceId() const; + QString dbusPath() const; + +private: + Manager *const m_manager; + QString m_udi; + mutable QStringList m_loadedPlugins; + + QSet m_supportedDeviceTypes; +}; + +} +} +} + +#endif // SOLID_BACKENDS_KDECONNECT_DEVICE_H diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectdeviceinterface.cpp b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectdeviceinterface.cpp new file mode 100644 index 0000000000..e5097c452a --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectdeviceinterface.cpp @@ -0,0 +1,19 @@ +/* + * SPDX-FileCopyrightText: 2026 Kai Uwe Broulik + * + * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + */ + +#include "kdeconnectdeviceinterface.h" + +using namespace Solid::Backends::KdeConnect; + +DeviceInterface::DeviceInterface(Device *device) + : QObject(device) + , m_device(device) +{ +} + +DeviceInterface::~DeviceInterface() = default; + +#include "moc_kdeconnectdeviceinterface.cpp" diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectdeviceinterface.h b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectdeviceinterface.h new file mode 100644 index 0000000000..a83f968160 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectdeviceinterface.h @@ -0,0 +1,41 @@ +/* + * SPDX-FileCopyrightText: 2026 Kai Uwe Broulik + * + * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + */ + +#ifndef SOLID_BACKENDS_KDECONNECT_DEVICEINTERFACE_H +#define SOLID_BACKENDS_KDECONNECT_DEVICEINTERFACE_H + +#include "kdeconnectdevice.h" +#include + +#include +#include +#include + +namespace Solid +{ +namespace Backends +{ +namespace KdeConnect +{ + +class Device; + +class DeviceInterface : public QObject, virtual public Solid::Ifaces::DeviceInterface +{ + Q_OBJECT + Q_INTERFACES(Solid::Ifaces::DeviceInterface) +public: + DeviceInterface(Device *device); + ~DeviceInterface() override; + +protected: + QPointer m_device; +}; +} +} +} + +#endif // SOLID_BACKENDS_KDECONNECT_DEVICEINTERFACE_H diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectmanager.cpp b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectmanager.cpp new file mode 100644 index 0000000000..37f7a775c7 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectmanager.cpp @@ -0,0 +1,342 @@ +/* + * SPDX-FileCopyrightText: 2026 Kai Uwe Broulik + * + * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + */ + +#include "kdeconnect_debug.h" + +#include "kdeconnectdevice.h" +#include "kdeconnectmanager.h" +#include "kdeconnectutils.h" + +#include +#include + +#include + +#include "../shared/rootdevice.h" + +#include "dbus/kdeconnect_device_interface.h" + +using namespace Solid::Backends::KdeConnect; +using namespace Solid::Backends::Shared; + +Manager::Manager(QObject *parent) + : Solid::Ifaces::DeviceManager(parent) + , m_daemonIface(Utils::dbusService(), QStringLiteral("/modules/kdeconnect"), QDBusConnection::sessionBus()) + , m_serviceWatcher(Utils::dbusService(), QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange) +{ + qDBusRegisterMetaType(); + + connect(&m_serviceWatcher, &QDBusServiceWatcher::serviceOwnerChanged, this, &Manager::onServiceOwnerChanged); + + connect(&m_daemonIface, &org::kde::kdeconnect::daemon::deviceAdded, this, &Manager::onDeviceAdded); + connect(&m_daemonIface, &org::kde::kdeconnect::daemon::deviceVisibilityChanged, this, &Manager::onDeviceVisibilityChanged); + connect(&m_daemonIface, &org::kde::kdeconnect::daemon::deviceRemoved, this, &Manager::onDeviceRemoved); + connect(&m_daemonIface, &org::kde::kdeconnect::daemon::pairingRequestsChanged, this, &Manager::onPairingRequestsChanged); + + reloadDevices(); +} + +Manager::~Manager() = default; + +std::unique_ptr Manager::createDevice(const QString &udi) +{ + if (udi == udiPrefix()) { + std::unique_ptr root = std::make_unique(udiPrefix()); + + root->setProduct(tr("KDE Connect")); + root->setDescription(tr("Battery and storage from connected devices")); + root->setIcon(QStringLiteral("kdeconnect")); + + return root; + + } else if (m_interestingDevices.contains(udi)) { + return std::make_unique(this, udi); + + } else { + return nullptr; + } +} + +QStringList Manager::devicesFromQuery(const QString &parentUdi, Solid::DeviceInterface::Type type) +{ + const QStringList allDev = allDevices(); + + QStringList result; + + if (!parentUdi.isEmpty()) { + for (const QString &udi : allDev) { + if (udi == udiPrefix()) { + continue; + } + + Device device(this, udi); + if (device.queryDeviceInterface(type) && device.parentUdi() == parentUdi) { + result << udi; + } + } + + return result; + } else if (type != Solid::DeviceInterface::Unknown) { + for (const QString &udi : allDev) { + if (udi == udiPrefix()) { + continue; + } + + Device device(this, udi); + if (device.queryDeviceInterface(type)) { + result << udi; + } + } + + return result; + } else { + return allDev; + } +} + +void Manager::reloadDevices() +{ + qCDebug(KDECONNECT) << "Loading devices..."; + + auto call = m_daemonIface.devices(true /*reachable*/, true /*paired*/); + auto *watcher = new QDBusPendingCallWatcher(call, this); + connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, watcher] { + watcher->deleteLater(); + + QDBusPendingReply reply = *watcher; + if (reply.isError()) { + qCWarning(KDECONNECT) << "Failed to get list of devices:" << reply.error().message(); + return; + } + + const QStringList newDeviceIds = reply.value(); + + const QStringList oldUdis = m_interestingDevices; + for (const QString &oldUdi : oldUdis) { + if (std::find_if(newDeviceIds.begin(), + newDeviceIds.end(), + [this, &oldUdi](const QString &deviceId) { + return udiFromDeviceId(deviceId) == oldUdi; + }) + == newDeviceIds.end()) { + qCDebug(KDECONNECT) << "Device gone" << oldUdi; + m_interestingDevices.removeOne(oldUdi); + m_cache.remove(oldUdi); + Q_EMIT deviceRemoved(oldUdi); + } + } + + for (const QString &deviceId : newDeviceIds) { + fetchDeviceProperties(deviceId); + } + }); +} + +void Manager::fetchDeviceProperties(const QString &deviceId) +{ + const QString udi = udiFromDeviceId(deviceId); + + qCDebug(KDECONNECT) << "Fetch device properties" << udi; + + OrgKdeKdeconnectDeviceInterface deviceIface(m_daemonIface.service(), Utils::deviceDBusPath(deviceId), m_daemonIface.connection()); + auto message = Utils::getAllPropertiesCall(deviceIface); + + auto call = m_daemonIface.connection().asyncCall(message); + auto *watcher = new QDBusPendingCallWatcher(call, this); + connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, watcher, udi, deviceId] { + watcher->deleteLater(); + + QDBusPendingReply reply = *watcher; + if (!reply.isValid()) { + qCWarning(KDECONNECT) << "Failed to get all device properties for" << udi << reply.error().message(); + return; + } + + const QVariantMap properties = reply.value(); + m_cache.insert(udi, properties); + + fetchLoadedModules(deviceId); + }); +} + +void Manager::fetchLoadedModules(const QString &deviceId) +{ + const QString udi = udiFromDeviceId(deviceId); + + if (!m_cache.value(udi).value(QStringLiteral("isReachable")).toBool()) { + // Cannot know what modules are loaded when it's unreachable. + return; + } + + qCDebug(KDECONNECT) << "Fetching loaded modules" << deviceId; + OrgKdeKdeconnectDeviceInterface deviceIface(m_daemonIface.service(), Utils::deviceDBusPath(deviceId), m_daemonIface.connection()); + auto pluginsCall = deviceIface.loadedPlugins(); + auto *pluginsWatcher = new QDBusPendingCallWatcher(pluginsCall); + connect(pluginsWatcher, &QDBusPendingCallWatcher::finished, this, [this, pluginsWatcher, udi] { + pluginsWatcher->deleteLater(); + + QDBusPendingReply pluginsReply = *pluginsWatcher; + if (!pluginsReply.isValid()) { + qCWarning(KDECONNECT) << "Failed to get loaded plugins for" << udi << pluginsReply.error().message(); + return; + } + + QVariantMap &deviceCache = m_cache[udi]; + const QStringList newLoadedPlugins = pluginsReply.value(); + + bool loadedPluginsChanged = false; + auto pluginsIt = deviceCache.find(QStringLiteral("loadedPlugins")); + if (pluginsIt != deviceCache.end()) { + loadedPluginsChanged = (newLoadedPlugins != *pluginsIt); + } + + deviceCache.insert(QStringLiteral("loadedPlugins"), newLoadedPlugins); + + addOrRemoveDevice(udi, loadedPluginsChanged); + }); +} + +QStringList Manager::allDevices() +{ + return m_interestingDevices; +} + +QSet Manager::supportedInterfaces() const +{ + return {Solid::DeviceInterface::Battery, Solid::DeviceInterface::PortableMediaPlayer}; +} + +QString Manager::udiPrefix() const +{ + return Utils::udiPrefix(); +} + +QString Manager::udiFromDeviceId(const QString &deviceId) const +{ + return udiPrefix() + QLatin1Char('/') + deviceId; +} + +QVariant Manager::deviceProperty(const QString &udi, const QString &property) const +{ + return m_cache.value(udi).value(property); +} + +void Manager::onServiceOwnerChanged(const QString &service, const QString &oldOwner, const QString &newOwner) +{ + Q_UNUSED(service); + + qCDebug(KDECONNECT) << "service owner changed from" << oldOwner << "to" << newOwner; + const QStringList devices = m_interestingDevices; + + m_interestingDevices.clear(); + m_cache.clear(); + + for (const QString &udi : devices) { + Q_EMIT deviceRemoved(udi); + } + + if (!newOwner.isEmpty()) { + reloadDevices(); + } +} + +void Manager::onDeviceAdded(const QString &deviceId) +{ + const QString udi = udiFromDeviceId(deviceId); + + if (m_interestingDevices.contains(udi)) { + return; + } + + qCDebug(KDECONNECT) << "Device added" << deviceId; + + // will emit deviceAdded + fetchDeviceProperties(deviceId); +} + +void Manager::onDeviceVisibilityChanged(const QString &deviceId, bool isReachable) +{ + const QString udi = udiFromDeviceId(deviceId); + qCDebug(KDECONNECT) << "Device reachability for" << udi << "changed to" << isReachable; + + auto cacheIt = m_cache.find(udi); + if (cacheIt == m_cache.end()) { + // Device wasn't cached before because it wasn't visible+reachable, fetch it now. + if (isReachable) { + fetchDeviceProperties(deviceId); + } + return; + } + + // When pairing a device, its visibility is emitted even when it hasn't really changed. + if (isReachable == cacheIt->value(QStringLiteral("isReachable")).toBool()) { + return; + } + + cacheIt->insert(QStringLiteral("isReachable"), isReachable); + + if (isReachable) { + // Will call addOrRemoveDevice once finished. + fetchLoadedModules(deviceId); + } else { + addOrRemoveDevice(udi); + } +} + +void Manager::onDeviceRemoved(const QString &deviceId) +{ + const QString udi = udiFromDeviceId(deviceId); + + const int deviceIndex = m_interestingDevices.indexOf(udi); + if (deviceIndex > -1) { + qCDebug(KDECONNECT) << "Device removed" << udi; + m_interestingDevices.remove(deviceIndex); + m_cache.remove(udi); + Q_EMIT deviceRemoved(udi); + } +} + +void Manager::onPairingRequestsChanged() +{ + // Check if any devices are now or no longer paired. + // This could probably be optimized... + qCDebug(KDECONNECT) << "Pairing requests changed, reloading devices"; + reloadDevices(); +} + +void Manager::addOrRemoveDevice(const QString &udi, bool loadedPluginsChanged) +{ + const QVariantMap deviceCache = m_cache.value(udi); + if (deviceCache.isEmpty()) { + return; + } + + const bool isReachable = deviceCache.value(QStringLiteral("isReachable")).toBool(); + const bool isPaired = deviceCache.value(QStringLiteral("isPaired")).toBool(); + const QStringList loadedPlugins = deviceCache.value(QStringLiteral("loadedPlugins")).toStringList(); + + const bool isInteresting = isReachable && isPaired && !loadedPlugins.isEmpty(); + + if (isInteresting) { + if (!m_interestingDevices.contains(udi)) { + qCDebug(KDECONNECT) << "Device is now interesting, adding" << udi; + m_interestingDevices.append(udi); + Q_EMIT deviceAdded(udi); + } + } else if (m_interestingDevices.contains(udi)) { + qCDebug(KDECONNECT) << "Device is no longer interesting, removing" << udi; + m_interestingDevices.removeOne(udi); + Q_EMIT deviceRemoved(udi); + } else if (loadedPluginsChanged) { + qCDebug(KDECONNECT) << "Loaded plugins changed, removing and re-adding" << udi; + m_interestingDevices.removeOne(udi); + Q_EMIT deviceRemoved(udi); + m_interestingDevices.append(udi); + Q_EMIT deviceAdded(udi); + } +} + +#include "moc_kdeconnectmanager.cpp" diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectmanager.h b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectmanager.h new file mode 100644 index 0000000000..21c429f453 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectmanager.h @@ -0,0 +1,63 @@ +/* + * SPDX-FileCopyrightText: 2026 Kai Uwe Broulik + * + * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + */ + +#ifndef SOLID_BACKENDS_KDECONNECT_MANAGER_H +#define SOLID_BACKENDS_KDECONNECT_MANAGER_H + +#include "solid/devices/ifaces/devicemanager.h" + +#include "dbus/kdeconnect_daemon_interface.h" + +#include +#include + +namespace Solid +{ +namespace Backends +{ +namespace KdeConnect +{ +class Manager : public Solid::Ifaces::DeviceManager +{ + Q_OBJECT + +public: + explicit Manager(QObject *parent); + ~Manager() override; + + std::unique_ptr createDevice(const QString &udi) override; + QStringList devicesFromQuery(const QString &parentUdi, Solid::DeviceInterface::Type type) override; + QStringList allDevices() override; + QSet supportedInterfaces() const override; + QString udiPrefix() const override; + + QVariant deviceProperty(const QString &udi, const QString &property) const; + +private: + QString udiFromDeviceId(const QString &deviceId) const; + void reloadDevices(); + void fetchDeviceProperties(const QString &deviceId); + void fetchLoadedModules(const QString &deviceId); + void addOrRemoveDevice(const QString &udi, bool loadedPluginsChanged = false); + + void onServiceOwnerChanged(const QString &service, const QString &oldOwner, const QString &newOwner); + void onDeviceAdded(const QString &deviceId); + void onDeviceVisibilityChanged(const QString &deviceId, bool visible); + void onDeviceRemoved(const QString &deviceId); + void onPairingRequestsChanged(); + + org::kde::kdeconnect::daemon m_daemonIface; + QDBusServiceWatcher m_serviceWatcher; + + QStringList m_interestingDevices; // paired and reachable. + QMap m_cache; +}; + +} +} +} + +#endif // SOLID_BACKENDS_KDECONNECT_MANAGER_H diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectportablemediaplayer.cpp b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectportablemediaplayer.cpp new file mode 100644 index 0000000000..04e9bf5d13 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectportablemediaplayer.cpp @@ -0,0 +1,39 @@ +/* + * SPDX-FileCopyrightText: 2026 Kai Uwe Broulik + * + * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + */ + +#include "kdeconnectportablemediaplayer.h" + +using namespace Solid::Backends::KdeConnect; + +PortableMediaPlayer::PortableMediaPlayer(Device *device) + : DeviceInterface(device) +{ +} + +PortableMediaPlayer::~PortableMediaPlayer() = default; + +QStringList PortableMediaPlayer::supportedProtocols() const +{ + return {QStringLiteral("kdeconnect")}; +} + +QStringList PortableMediaPlayer::supportedDrivers(QString protocol) const +{ + if (protocol == QLatin1String("kdeconnect")) { + return {QStringLiteral("sftp")}; + } + return {}; +} + +QVariant PortableMediaPlayer::driverHandle(const QString &driver) const +{ + if (driver == QLatin1String("sftp")) { + return m_device->deviceId(); + } + return {}; +} + +#include "moc_kdeconnectportablemediaplayer.cpp" diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectportablemediaplayer.h b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectportablemediaplayer.h new file mode 100644 index 0000000000..a3098ac171 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectportablemediaplayer.h @@ -0,0 +1,41 @@ +/* + * SPDX-FileCopyrightText: 2026 Kai Uwe Broulik + * + * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + */ + +#ifndef SOLID_BACKENDS_KDECONNECT_PORTABLEMEDIAPLAYER_H +#define SOLID_BACKENDS_KDECONNECT_PORTABLEMEDIAPLAYER_H + +#include "kdeconnectdeviceinterface.h" +#include + +#include + +namespace Solid +{ +namespace Backends +{ +namespace KdeConnect +{ +class Device; + +class PortableMediaPlayer : public DeviceInterface, virtual public Solid::Ifaces::PortableMediaPlayer +{ + Q_OBJECT + Q_INTERFACES(Solid::Ifaces::PortableMediaPlayer) + +public: + PortableMediaPlayer(Device *device); + ~PortableMediaPlayer() override; + + QStringList supportedProtocols() const override; + QStringList supportedDrivers(QString protocol = QString()) const override; + QVariant driverHandle(const QString &driver) const override; +}; + +} +} +} + +#endif // SOLID_BACKENDS_KDECONNECT_PORTABLEMEDIAPLAYER_H diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectutils.cpp b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectutils.cpp new file mode 100644 index 0000000000..01a5df9ea2 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectutils.cpp @@ -0,0 +1,54 @@ +/* + * SPDX-FileCopyrightText: 2026 Kai Uwe Broulik + * + * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + */ + +#include "kdeconnectutils.h" + +#include +#include + +namespace Solid +{ +namespace Backends +{ +namespace KdeConnect +{ +namespace Utils +{ + +QString udiPrefix() +{ + return QStringLiteral("/org/kde/solid/kdeconnect"); +} + +QString dbusService() +{ + return QStringLiteral("org.kde.kdeconnect"); +} + +QString deviceDBusPath(const QString &deviceId) +{ + return QStringLiteral("/modules/kdeconnect/devices/%1").arg(deviceId); +} + +QDBusMessage getAllPropertiesCall(QDBusAbstractInterface &iface) +{ + QDBusMessage message = + QDBusMessage::createMethodCall(iface.service(), iface.path(), QStringLiteral("org.freedesktop.DBus.Properties"), QStringLiteral("GetAll")); + message.setArguments({iface.interface()}); + return message; +} + +QDBusMessage getPropertyCall(QDBusAbstractInterface &iface, const QString &name) +{ + QDBusMessage message = + QDBusMessage::createMethodCall(iface.service(), iface.path(), QStringLiteral("org.freedesktop.DBus.Properties"), QStringLiteral("Get")); + message.setArguments({iface.interface(), name}); + return message; +} +} +} +} +} diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectutils.h b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectutils.h new file mode 100644 index 0000000000..88fb5fa114 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/kdeconnect/kdeconnectutils.h @@ -0,0 +1,40 @@ +/* + * SPDX-FileCopyrightText: 2026 Kai Uwe Broulik + * + * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + */ + +#ifndef SOLID_BACKENDS_KDECONNECT_UTILS_H +#define SOLID_BACKENDS_KDECONNECT_UTILS_H + +#include + +class QDBusAbstractInterface; + +#include + +namespace Solid +{ +namespace Backends +{ +namespace KdeConnect +{ +namespace Utils +{ + +QString udiPrefix(); + +QString dbusService(); + +QString deviceDBusPath(const QString &deviceId); + +QDBusMessage getAllPropertiesCall(QDBusAbstractInterface &iface); + +QDBusMessage getPropertyCall(QDBusAbstractInterface &iface, const QString &name); + +} // namespace Utils +} +} +} + +#endif // SOLID_BACKENDS_KDECONNECT_UTILS_H diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/udisks2/udisksutils.cpp b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/udisks2/udisksutils.cpp new file mode 100644 index 0000000000..b6d6d0ef96 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/udisks2/udisksutils.cpp @@ -0,0 +1,41 @@ +/* + SPDX-FileCopyrightText: 2012 Lukáš Tinkl + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "udisksutils.h" + +#include + +using namespace Solid::Backends::UDisks2; + +QByteArray Utils::sanitizeValue(const QByteArray &value) +{ + QByteArray blob = value; + // UDisks2 sends us null terminated strings, make sure to strip the extranous \0 in favor of the implicit \0. + // Otherwise comparision becomes unnecessarily complicated because 'foo\0' != 'foo'. QByteArrays are implicitly + // terminated already. + while (blob.endsWith('\0')) { + blob.chop(1); + } + return blob; +} + +QVariant Utils::sanitizeValue(const QVariant &value) +{ + if (value.userType() == QMetaType::QByteArray) { + return sanitizeValue(value.toByteArray()); + } else { + return value; + } +} + +QVariantMap Utils::sanitizeValue(const QVariantMap &map) +{ + QVariantMap ret = map; + for (QVariant &value : ret) { + value = sanitizeValue(value); + } + return ret; +} diff --git a/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/udisks2/udisksutils.h b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/udisks2/udisksutils.h new file mode 100644 index 0000000000..751055cdbd --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/devices/backends/udisks2/udisksutils.h @@ -0,0 +1,34 @@ +/* + SPDX-FileCopyrightText: 2024 Kai Uwe Broulik + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#ifndef UDISKSUTILS_H +#define UDISKSUTILS_H + +#include +#include +#include + +namespace Solid +{ +namespace Backends +{ +namespace UDisks2 +{ + +namespace Utils +{ + +QByteArray sanitizeValue(const QByteArray &value); +QVariant sanitizeValue(const QVariant &value); +QVariantMap sanitizeValue(const QVariantMap &map); + +} // Utils + +} // UDisks2 +} // Backends +} // Solid + +#endif // UDISKSUTILS_H diff --git a/local/recipes/kde/kf6-solid/source/src/solid/solid-index.qdoc b/local/recipes/kde/kf6-solid/source/src/solid/solid-index.qdoc new file mode 100644 index 0000000000..ed82ee5154 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/solid-index.qdoc @@ -0,0 +1,23 @@ +/*! + \page solid-index.html + \title Solid + + Solid is a device integration framework. + + It provides a way of querying and + interacting with hardware independently of the underlying operating system. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {Solid} {KF6::Solid} + + \section1 API Reference + + \list + \li \l{Solid C++ Classes} + \endlist +*/ diff --git a/local/recipes/kde/kf6-solid/source/src/solid/solid.qdoc b/local/recipes/kde/kf6-solid/source/src/solid/solid.qdoc new file mode 100644 index 0000000000..da73abfaa6 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/solid.qdoc @@ -0,0 +1,9 @@ +/*! + \module Solid + \title Solid C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Solid + + \brief Hardware Abstraction Framework. +*/ diff --git a/local/recipes/kde/kf6-solid/source/src/solid/solid.qdocconf b/local/recipes/kde/kf6-solid/source/src/solid/solid.qdocconf new file mode 100644 index 0000000000..555664ade4 --- /dev/null +++ b/local/recipes/kde/kf6-solid/source/src/solid/solid.qdocconf @@ -0,0 +1,35 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = Solid +description = Hardware Abstraction Framework + +documentationinheaders = true + +headerdirs += . +sourcedirs += . +excludedirs += devices/backends devices/interfaces + +outputformats = HTML + +navigation.landingpage = "Solid" + +depends += \ + kde \ + qtcore \ + qtgui \ + +qhp.projects = Solid + +qhp.Solid.file = solid.qhp +qhp.Solid.namespace = org.kde.purpose.$QT_VERSION_TAG +qhp.Solid.virtualFolder = solid +qhp.Solid.indexTitle = Solid +qhp.Solid.indexRoot = + +qhp.Solid.subprojects = classes +qhp.Solid.subprojects.classes.title = C++ Classes +qhp.Solid.subprojects.classes.indexTitle = Solid C++ Classes +qhp.Solid.subprojects.classes.selectors = class fake:headerfile +qhp.Solid.subprojects.classes.sortPages = true + +tagfile = solid.tags diff --git a/local/recipes/kde/kf6-sonnet/source/autotests/test_decorator.cpp b/local/recipes/kde/kf6-sonnet/source/autotests/test_decorator.cpp new file mode 100644 index 0000000000..c7c83ed60b --- /dev/null +++ b/local/recipes/kde/kf6-sonnet/source/autotests/test_decorator.cpp @@ -0,0 +1,50 @@ +/* + * SPDX-FileCopyrightText: 2025 Espen Sandøy Hustad + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "test_decorator.h" + +#include +#include +#include +#include + +#include + +QTEST_MAIN(SonnetDecoratorTest) + +/* + * This unit test was added because of https://bugs.kde.org/show_bug.cgi?id=492444 + * The main purpose is to test that there are no segfaults on object destruction + */ +void SonnetDecoratorTest::testDestroyTextDecorator() +{ + QScopedPointer parent(new QTextEdit(nullptr)); + Sonnet::SpellCheckDecorator *decorator = new Sonnet::SpellCheckDecorator(parent.get()); + decorator->deleteLater(); +} + +void SonnetDecoratorTest::testDestroyPlainTextDecorator() +{ + QScopedPointer parent(new QPlainTextEdit(nullptr)); + Sonnet::SpellCheckDecorator *decorator = new Sonnet::SpellCheckDecorator(parent.get()); + decorator->deleteLater(); +} + +// NOLINTBEGIN(clang-analyzer-cplusplus.NewDeleteLeaks) +void SonnetDecoratorTest::testDestroyTextEdit() +{ + QScopedPointer parent(new QTextEdit(nullptr)); + Sonnet::SpellCheckDecorator *decorator = new Sonnet::SpellCheckDecorator(parent.get()); + Q_UNUSED(decorator) +} + +void SonnetDecoratorTest::testDestroyPlainTextEdit() +{ + QScopedPointer parent(new QPlainTextEdit(nullptr)); + Sonnet::SpellCheckDecorator *decorator = new Sonnet::SpellCheckDecorator(parent.get()); + Q_UNUSED(decorator) +} +// NOLINTEND(clang-analyzer-cplusplus.NewDeleteLeaks) diff --git a/local/recipes/kde/kf6-sonnet/source/autotests/test_decorator.h b/local/recipes/kde/kf6-sonnet/source/autotests/test_decorator.h new file mode 100644 index 0000000000..ce02abcac2 --- /dev/null +++ b/local/recipes/kde/kf6-sonnet/source/autotests/test_decorator.h @@ -0,0 +1,22 @@ +/* + * SPDX-FileCopyrightText: 2025 Espen Sandøy Hustad + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef TEST_DECORATOR_H +#define TEST_DECORATOR_H + +#include + +class SonnetDecoratorTest : public QObject +{ + Q_OBJECT +private Q_SLOTS: + void testDestroyPlainTextDecorator(); + void testDestroyTextDecorator(); + void testDestroyPlainTextEdit(); + void testDestroyTextEdit(); +}; + +#endif diff --git a/local/recipes/kde/kf6-sonnet/source/src/core/sonnet-index.qdoc b/local/recipes/kde/kf6-sonnet/source/src/core/sonnet-index.qdoc new file mode 100644 index 0000000000..5fd7596b67 --- /dev/null +++ b/local/recipes/kde/kf6-sonnet/source/src/core/sonnet-index.qdoc @@ -0,0 +1,22 @@ +/*! + \page sonnet-index.html + \title Sonnet + + Sonnet is a spelling framework for Qt. + + \section1 Using the Module + + \include {module-use.qdocinc} {using the c++ api} + + \section2 Building with CMake + + \include {module-use.qdocinc} {building with cmake} {KF6} {Sonnet} {KF6::SonnetCore} + + \section1 API Reference + + \list + \li \l{Sonnet Core C++ Classes} + \li \l{Sonnet Ui C++ Classes} + \li \l{Sonnet QML Types} + \endlist +*/ diff --git a/local/recipes/kde/kf6-sonnet/source/src/core/sonnetcore.qdoc b/local/recipes/kde/kf6-sonnet/source/src/core/sonnetcore.qdoc new file mode 100644 index 0000000000..f7c79bba4d --- /dev/null +++ b/local/recipes/kde/kf6-sonnet/source/src/core/sonnetcore.qdoc @@ -0,0 +1,11 @@ +/*! + \module SonnetCore + \title Sonnet Core C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Sonnet + \cmaketargetitem KF6::SonnetCore + \brief Sonnet is a plugin-based spell checking library for Qt-based applications. + + It supports several different plugins, including HSpell, Enchant, ASpell and HUNSPELL. +*/ diff --git a/local/recipes/kde/kf6-sonnet/source/src/core/sonnetcore.qdocconf b/local/recipes/kde/kf6-sonnet/source/src/core/sonnetcore.qdocconf new file mode 100644 index 0000000000..3b7865b546 --- /dev/null +++ b/local/recipes/kde/kf6-sonnet/source/src/core/sonnetcore.qdocconf @@ -0,0 +1,33 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = SonnetCore +description = Spelling framework for Qt + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +imagedirs = ../docs/pics + +outputformats = HTML + +navigation.landingpage = "Sonnet" + +depends += kde qtwidgets qtquick qtcore sonnetui sonnetquick + +qhp.projects = SonnetCore + +qhp.SonnetCore.file = sonnetcore.qhp +qhp.SonnetCore.namespace = org.kde.sonnetcore.$QT_VERSION_TAG +qhp.SonnetCore.virtualFolder = sonnetcore +qhp.SonnetCore.indexTitle = Sonnet Core +qhp.SonnetCore.indexRoot = + +qhp.SonnetCore.subprojects = classes +qhp.SonnetCore.subprojects.classes.title = C++ Classes +qhp.SonnetCore.subprojects.classes.indexTitle = Sonnet Core C++ Classes +qhp.SonnetCore.subprojects.classes.selectors = class fake:headerfile +qhp.SonnetCore.subprojects.classes.sortPages = true + +tagfile = sonnetcore.tags diff --git a/local/recipes/kde/kf6-sonnet/source/src/quick/sonnetquick.qdoc b/local/recipes/kde/kf6-sonnet/source/src/quick/sonnetquick.qdoc new file mode 100644 index 0000000000..adc40e61b3 --- /dev/null +++ b/local/recipes/kde/kf6-sonnet/source/src/quick/sonnetquick.qdoc @@ -0,0 +1,6 @@ +/*! + \qmlmodule org.kde.sonnet + \title Sonnet QML Types + + \brief Spell checking. +*/ diff --git a/local/recipes/kde/kf6-sonnet/source/src/quick/sonnetquick.qdocconf b/local/recipes/kde/kf6-sonnet/source/src/quick/sonnetquick.qdocconf new file mode 100644 index 0000000000..47ce540ea8 --- /dev/null +++ b/local/recipes/kde/kf6-sonnet/source/src/quick/sonnetquick.qdocconf @@ -0,0 +1,35 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = SonnetQuick +description = Spell checking + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +outputformats = HTML + +navigation.landingpage = "Sonnet" + +depends += \ + kde \ + qtcore \ + qtqml \ + sonnetcore + +qhp.projects = SonnetQuick + +qhp.SonnetQuick.file = sonnetquick.qhp +qhp.SonnetQuick.namespace = org.kde.sonnetquick.$QT_VERSION_TAG +qhp.SonnetQuick.virtualFolder = sonnetquick +qhp.SonnetQuick.indexTitle = Sonnet QML +qhp.SonnetQuick.indexRoot = + +qhp.SonnetQuick.subprojects = qmltypes +qhp.SonnetQuick.subprojects.qmltypes.title = QML Types +qhp.SonnetQuick.subprojects.qmltypes.indexTitle = Sonnet QML Types +qhp.SonnetQuick.subprojects.qmltypes.selectors = qmltype +qhp.SonnetQuick.subprojects.qmltypes.sortPages = true + +tagfile = sonnetquick.tags diff --git a/local/recipes/kde/kf6-sonnet/source/src/ui/sonnetui.qdoc b/local/recipes/kde/kf6-sonnet/source/src/ui/sonnetui.qdoc new file mode 100644 index 0000000000..c97994050d --- /dev/null +++ b/local/recipes/kde/kf6-sonnet/source/src/ui/sonnetui.qdoc @@ -0,0 +1,11 @@ +/*! + \module SonnetUi + \title Sonnet Ui C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent Sonnet + \cmaketargetitem KF6::SonnetUi + \brief SonnetUi is a plugin-based spell checking library for Qt-based applications. + + It supports several different plugins, including HSpell, Enchant, ASpell and HUNSPELL. +*/ diff --git a/local/recipes/kde/kf6-sonnet/source/src/ui/sonnetui.qdocconf b/local/recipes/kde/kf6-sonnet/source/src/ui/sonnetui.qdocconf new file mode 100644 index 0000000000..d89d483ce4 --- /dev/null +++ b/local/recipes/kde/kf6-sonnet/source/src/ui/sonnetui.qdocconf @@ -0,0 +1,33 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = SonnetUi +description = Spelling framework for Qt + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +imagedirs = ../docs/pics + +outputformats = HTML + +navigation.landingpage = "Sonnet" + +depends += kde qtwidgets qtquick qtcore sonnetcore + +qhp.projects = SonnetUi + +qhp.SonnetUi.file = sonnetui.qhp +qhp.SonnetUi.namespace = org.kde.sonnetui.$QT_VERSION_TAG +qhp.SonnetUi.virtualFolder = sonnetui +qhp.SonnetUi.indexTitle = Sonnet UI +qhp.SonnetUi.indexRoot = + +qhp.SonnetUi.subprojects = classes +qhp.SonnetUi.subprojects.classes.title = C++ Classes +qhp.SonnetUi.subprojects.classes.indexTitle = Sonnet UI C++ Classes +qhp.SonnetUi.subprojects.classes.selectors = class fake:headerfile +qhp.SonnetUi.subprojects.classes.sortPages = true + +tagfile = sonnetui.tags diff --git a/local/recipes/kde/kirigami/source/autotests/tst_aboutitem.qml b/local/recipes/kde/kirigami/source/autotests/tst_aboutitem.qml new file mode 100644 index 0000000000..125aa829a1 --- /dev/null +++ b/local/recipes/kde/kirigami/source/autotests/tst_aboutitem.qml @@ -0,0 +1,44 @@ +// SPDX-FileCopyrightText: 2026 Nicolas Fella +// SPDX-License-Identifier: LGPL-2.0-or-later + +import QtQuick +import org.kde.kirigami as Kirigami +import QtTest +import KirigamiTestUtils + +TestCase { + name: "AboutItem" + + Kirigami.AboutItem { + aboutData: { + "displayName" : "KirigamiApp", + "productName" : "kirigami/app", + "componentName" : "kirigamiapp", + "shortDescription" : "A Kirigami example", + "homepage" : "", + "bugAddress" : "submit@bugs.kde.org", + "version" : "5.14.80", + "otherText" : "", + "authors" : [ + { + "name" : "...", + "task" : "", + "emailAddress" : "somebody@kde.org", + "webAddress" : "", + "ocsUsername" : "" + } + ], + "credits" : [], + "translators" : [], + "licenses" : [ + { + "name" : "GPL v2", + "text" : "long, boring, license text", + "spdx" : "GPL-2.0" + } + ], + "copyrightStatement" : "© 2010-2018 Plasma Development Team", + "desktopFileName" : "org.kde.kirigamiapp" + } + } +} diff --git a/local/recipes/kde/kirigami/source/autotests/tst_aboutpage.qml b/local/recipes/kde/kirigami/source/autotests/tst_aboutpage.qml new file mode 100644 index 0000000000..9a32380887 --- /dev/null +++ b/local/recipes/kde/kirigami/source/autotests/tst_aboutpage.qml @@ -0,0 +1,43 @@ +// SPDX-FileCopyrightText: 2026 Nicolas Fella +// SPDX-License-Identifier: LGPL-2.0-or-later + +import QtQuick +import org.kde.kirigami as Kirigami +import QtTest + +TestCase { + name: "AboutPage" + + Kirigami.AboutItem { + aboutData: { + "displayName" : "KirigamiApp", + "productName" : "kirigami/app", + "componentName" : "kirigamiapp", + "shortDescription" : "A Kirigami example", + "homepage" : "", + "bugAddress" : "submit@bugs.kde.org", + "version" : "5.14.80", + "otherText" : "", + "authors" : [ + { + "name" : "...", + "task" : "", + "emailAddress" : "somebody@kde.org", + "webAddress" : "", + "ocsUsername" : "" + } + ], + "credits" : [], + "translators" : [], + "licenses" : [ + { + "name" : "GPL v2", + "text" : "long, boring, license text", + "spdx" : "GPL-2.0" + } + ], + "copyrightStatement" : "© 2010-2018 Plasma Development Team", + "desktopFileName" : "org.kde.kirigamiapp" + } + } +} diff --git a/local/recipes/kde/kirigami/source/autotests/tst_abstractapplicationheader.qml b/local/recipes/kde/kirigami/source/autotests/tst_abstractapplicationheader.qml new file mode 100644 index 0000000000..fe3bd0c684 --- /dev/null +++ b/local/recipes/kde/kirigami/source/autotests/tst_abstractapplicationheader.qml @@ -0,0 +1,14 @@ +// SPDX-FileCopyrightText: 2026 Nicolas Fella +// SPDX-License-Identifier: LGPL-2.0-or-later + +import QtQuick +import org.kde.kirigami as Kirigami +import QtTest + +TestCase { + name: "AbstractApplicationHeader" + + Kirigami.AbstractApplicationHeader { + + } +} diff --git a/local/recipes/kde/kirigami/source/autotests/tst_abstractapplicationitem.qml b/local/recipes/kde/kirigami/source/autotests/tst_abstractapplicationitem.qml new file mode 100644 index 0000000000..6278a202b9 --- /dev/null +++ b/local/recipes/kde/kirigami/source/autotests/tst_abstractapplicationitem.qml @@ -0,0 +1,14 @@ +// SPDX-FileCopyrightText: 2026 Nicolas Fella +// SPDX-License-Identifier: LGPL-2.0-or-later + +import QtQuick +import org.kde.kirigami as Kirigami +import QtTest + +TestCase { + name: "AbstractApplicationItem" + + Kirigami.AbstractApplicationItem { + + } +} diff --git a/local/recipes/kde/kirigami/source/autotests/tst_abstractapplicationwindow.qml b/local/recipes/kde/kirigami/source/autotests/tst_abstractapplicationwindow.qml new file mode 100644 index 0000000000..c8dbb7627a --- /dev/null +++ b/local/recipes/kde/kirigami/source/autotests/tst_abstractapplicationwindow.qml @@ -0,0 +1,14 @@ +// SPDX-FileCopyrightText: 2026 Nicolas Fella +// SPDX-License-Identifier: LGPL-2.0-or-later + +import QtQuick +import org.kde.kirigami as Kirigami +import QtTest + +TestCase { + name: "AbstractApplicationWindow" + + Kirigami.AbstractApplicationWindow { + + } +} diff --git a/local/recipes/kde/kirigami/source/autotests/tst_badge.qml b/local/recipes/kde/kirigami/source/autotests/tst_badge.qml new file mode 100644 index 0000000000..2f23595f04 --- /dev/null +++ b/local/recipes/kde/kirigami/source/autotests/tst_badge.qml @@ -0,0 +1,56 @@ +/* + * SPDX-FileCopyrightText: 2026 Nate Graham + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Controls as QQC2 +import org.kde.kirigami as Kirigami +import QtTest + +TestCase { + name: "Badge" + visible: true + when: windowShown + + width: 500 + height: 500 + + Component { + id: textBadgeComponent + Kirigami.Badge { + text: "boom" + } + } + + Component { + id: iconBadgeComponent + Kirigami.Badge { + icon.name: "edit-bomb-symbolic" + } + } + + Component { + id: iconAndTextBadgeComponent + Kirigami.Badge { + icon.name: "edit-bomb-symbolic" + text: "boom" + } + } + + function test_textBadge() { + const badge = createTemporaryObject(textBadgeComponent, this); + verify(badge); + } + + function test_iconBadge() { + const badge = createTemporaryObject(iconBadgeComponent, this); + verify(badge); + } + + function test_iconAndTextBadge() { + const badge = createTemporaryObject(iconAndTextBadgeComponent, this); + verify(badge); + } +} diff --git a/local/recipes/kde/kirigami/source/autotests/tst_forms.qml b/local/recipes/kde/kirigami/source/autotests/tst_forms.qml new file mode 100644 index 0000000000..0288570b0a --- /dev/null +++ b/local/recipes/kde/kirigami/source/autotests/tst_forms.qml @@ -0,0 +1,408 @@ +/* + * SPDX-FileCopyrightText: 2022 Connor Carney + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ +pragma ComponentBehavior: Bound + +import QtQuick +import QtQuick.Window +import QtQuick.Layouts +import org.kde.kirigami as Kirigami +import QtTest + +TestCase { + id: testCase + name: "Forms" + + width: 400 + height: 400 + visible: true + + when: windowShown + + Component { + id: fractionalSizeRoundingComponent + Window { + property var item: fractionalSizeItem + width: 600 + height: 400 + Kirigami.Form { + anchors.fill: parent + Kirigami.FormGroup { + Kirigami.FormEntry { + contentItem: Item { + id: fractionalSizeItem + Layout.minimumWidth: 160.375 + implicitHeight: 17.001 + Layout.fillWidth: true + } + } + } + } + } + } + + Component { + id: multipleElementsComponent + Window { + id: rootWindow + property var item: formLayout + property var expectedMinimumSize: 200 + width: 600 + height: 400 + Kirigami.Form { + id: formLayout + anchors.fill: parent + Kirigami.FormGroup { + Repeater { + model: 200 + Kirigami.FormEntry { + contentItem: Item { + implicitWidth: rootWindow.expectedMinimumSize + implicitHeight: 20 + Layout.fillWidth: true + } + } + } + } + } + } + } + + function test_quick_relayout() { + let window = createTemporaryObject(multipleElementsComponent); + let item = window.item; + window.show(); + + verify(item.implicitWidth >= window.expectedMinimumSize, "implicit width of layout should match the implicit width of the elements within upon component creation"); + + window.close(); + } + + function test_fractional_width_rounding() { + let window = createTemporaryObject(fractionalSizeRoundingComponent); + let item = window.item; + window.show(); + tryVerify(() => {return item.width >= item.implicitWidth}, 1000, "implicit width should not be rounded down"); + fuzzyCompare(item.width, item.implicitWidth, 1); + + window.close(); + } + + function test_fractional_height_rounding() { + let window = createTemporaryObject(fractionalSizeRoundingComponent); + let item = window.item; + window.show(); + + verify(item.height >= item.implicitHeight, "implicit height should not be rounded down"); + fuzzyCompare(item.height, item.implicitHeight, 1); + + window.close(); + } + + + Component { + id: dynamicBuddyFormComponent + + Kirigami.Form { + id: form + + readonly property string labelText: "You found me!" + readonly property alias buddyColumn: buddyColumn + readonly property alias target1: target1 + readonly property alias target2: target2 + readonly property alias target3: target3 + + Kirigami.FormGroup { + Kirigami.FormEntry { + title: form.labelText + contentItem: ColumnLayout { + id: buddyColumn + + spacing: 0 + + Rectangle { + id: target1 + implicitWidth: 100 + implicitHeight: 100 + color: "red" + } + Rectangle { + id: target2 + implicitWidth: 100 + implicitHeight: 100 + color: "green" + Rectangle { + id: target3 + anchors.left: parent.left + anchors.bottom: parent.bottom + implicitWidth: 100 + implicitHeight: 100 + color: "blue" + } + } + } + } + } + } + } + + function findChildLabel(parent: Item, text: string): Text { + for (let i = 0; i < parent.children.length; i++) { + const child = parent.children[i]; + if ((child instanceof Text) && (child.text === text)) { + return child; + } else { + const label = findChildLabel(child, text); + if (label !== null) { + return label; + } + } + } + return null; + } + + function getYOffsetOfLabel(form: Kirigami.Form, label: Item): real { + return label.mapToItem(form, 0, 0).y; + } + + function test_dynamicBuddyFor() { + const form = createTemporaryObject(dynamicBuddyFormComponent, this); + compare(form.buddyColumn.Kirigami.FormData.buddyFor, form.buddyColumn); + + const label = findChildLabel(form, form.labelText); + verify(label); + + form.buddyColumn.Kirigami.FormData.buddyFor = form.target1; + compare(form.buddyColumn.Kirigami.FormData.buddyFor, form.target1); + waitForRendering(form) + const offset1 = getYOffsetOfLabel(form, label); + + form.buddyColumn.Kirigami.FormData.buddyFor = form.target2; + compare(form.buddyColumn.Kirigami.FormData.buddyFor, form.target2); + waitForRendering(form) + const offset2 = getYOffsetOfLabel(form, label); + + verify(offset1 < offset2); + } + + SignalSpy { + id: buddyChangeSpy + signalName: "buddyForChanged" + } + + Component { + id: buddyRepeaterFormComponent + + Kirigami.Form { + id: form + + readonly property string labelText: "You found me!" + readonly property alias buddyColumn: buddyColumn + property alias repeaterModel: repeater.model + property Item buddyCreatedByRepeater + + Kirigami.FormGroup { + Kirigami.FormEntry { + contentItem: ColumnLayout { + id: buddyColumn + + spacing: 0 + + Kirigami.FormData.label: form.labelText + + Repeater { + id: repeater + + model: 0 + + Rectangle { + implicitWidth: 100 + implicitHeight: 100 + color: "red" + } + + onItemAdded: (index, item) => { + form.buddyCreatedByRepeater = item; + buddyColumn.Kirigami.FormData.buddyFor = item; + } + } + } + } + } + } + } + + function test_buddyCreatedAndDestroyedByRepeater() { + // The point is to test automatic destruction as done by a Repeater + + const form = createTemporaryObject(buddyRepeaterFormComponent, this); + compare(form.buddyColumn.Kirigami.FormData.buddyFor, form.buddyColumn); + + buddyChangeSpy.target = form.buddyColumn.Kirigami.FormData; + buddyChangeSpy.clear(); + verify(buddyChangeSpy.valid); + + form.repeaterModel = 1; + + verify(form.buddyCreatedByRepeater); + compare(form.buddyColumn.Kirigami.FormData.buddyFor, form.buddyCreatedByRepeater); + compare(buddyChangeSpy.count, 1); + + form.repeaterModel = 0; + waitForRendering(form) + + verify(!form.buddyCreatedByRepeater); + compare(form.buddyColumn.Kirigami.FormData.buddyFor, form.buddyColumn); + compare(buddyChangeSpy.count, 2); + } + + Component { + id: buddyComponentFormComponent + + Kirigami.Form { + id: form + + readonly property string labelText: "You found me!" + readonly property alias buddyColumn: buddyColumn + + function addBuddyFromComponent(component: Component): Item { + const buddy = component.createObject(buddyColumn) as Item; + buddyColumn.Kirigami.FormData.buddyFor = buddy; + return buddy; + } + + Kirigami.FormGroup { + Kirigami.FormEntry { + contentItem: ColumnLayout { + id: buddyColumn + + spacing: 0 + + // Kirigami.FormData.label can be used in place of FormEntry.title + Kirigami.FormData.label: form.labelText + } + } + } + } + } + + Component { + id: buddyComponent + + Rectangle { + implicitWidth: 100 + implicitHeight: 100 + color: "red" + } + } + + function test_buddyCreatedAndDestroyedByComponent() { + // The point is to test manual destruction as done by calling destroy() + + const form = createTemporaryObject(buddyComponentFormComponent, this); + compare(form.buddyColumn.Kirigami.FormData.buddyFor, form.buddyColumn); + + buddyChangeSpy.target = form.buddyColumn.Kirigami.FormData; + buddyChangeSpy.clear(); + verify(buddyChangeSpy.valid); + + const buddy = form.addBuddyFromComponent(buddyComponent); + verify(buddy); + compare(form.buddyColumn.Kirigami.FormData.buddyFor, buddy); + compare(buddyChangeSpy.count, 1); + + waitForRendering(form) + + buddy.destroy(); + + waitForRendering(form) + + // should revert back to parent + compare(form.buddyColumn.Kirigami.FormData.buddyFor, form.buddyColumn); + compare(buddyChangeSpy.count, 2); + } + + Component { + id: formAlignmentGroupTest + + ColumnLayout { + property alias form1: form1 + property alias form2: form2 + property alias group1: group1 + property alias group2: group2 + property alias entry1: entry1 + property alias entry2: entry2 + property alias form2entry1: form2entry1 + property alias form2entry2: form2entry2 + + Kirigami.FormAlignmentGroup { + id: alignmentGroup + } + Kirigami.Form { + id: form1 + Layout.fillWidth: true + Kirigami.FormAlignmentGroup.group: alignmentGroup + Kirigami.FormGroup { + id: group1 + // Normal case, direct item + Kirigami.FormEntry { + id: entry1 + title: "First label" + contentItem: Rectangle { + color: "red" + implicitWidth: 100 + implicitHeight: 20 + } + } + Kirigami.FormEntry { + id: entry2 + title: "Second label" + contentItem: Rectangle { + color: "blue" + implicitWidth: 200 + implicitHeight: 20 + } + } + } + } + Kirigami.Form { + id: form2 + Layout.fillWidth: true + Kirigami.FormAlignmentGroup.group: alignmentGroup + Kirigami.FormGroup { + id: group2 + // Normal case, direct item + Kirigami.FormEntry { + id: form2entry1 + title: "Second Form First label" + contentItem: Rectangle { + color: "green" + implicitWidth: 50 + implicitHeight: 20 + } + } + Kirigami.FormEntry { + id: form2entry2 + title: "Second Form Second label" + contentItem: Rectangle { + color: "yellow" + implicitWidth: 250 + implicitHeight: 20 + } + } + } + } + } + } + + function test_formAlignment() { + const layout = createTemporaryObject(formAlignmentGroupTest, this); + waitForRendering(layout) + compare(layout.group1.width, layout.group2.width) + compare(layout.entry1.Kirigami.ScenePosition.x, layout.entry2.Kirigami.ScenePosition.x) + compare(layout.entry1.Kirigami.ScenePosition.x, layout.form2entry1.Kirigami.ScenePosition.x) + compare(layout.entry1.Kirigami.ScenePosition.x, layout.form2entry2.Kirigami.ScenePosition.x) + } +} diff --git a/local/recipes/kde/kirigami/source/autotests/tst_pageStackAttached.qml b/local/recipes/kde/kirigami/source/autotests/tst_pageStackAttached.qml new file mode 100644 index 0000000000..c56b5d0778 --- /dev/null +++ b/local/recipes/kde/kirigami/source/autotests/tst_pageStackAttached.qml @@ -0,0 +1,299 @@ +/* + * SPDX-FileCopyrightText: 2020 Arjen Hiemstra + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Controls as QQC +import QtTest +import org.kde.kirigami as Kirigami + +TestCase { + id: testCase + name: "PageStackAttachedTest" + + width: 400 + height: 400 + visible: true + + when: windowShown + + Kirigami.ApplicationWindow { + id: mainWindow + width: 480 + height: 360 + } + + component SamplePage: Kirigami.Page { + property Item outerStack: Kirigami.PageStack.pageStack + property alias innerRect: rect + Rectangle { + id: rect + color: "green" + property Item stackFromChild: Kirigami.PageStack.pageStack + } + } + + Component { + id: samplePage + + SamplePage { } + } + + component PageWithInnerStack: Kirigami.Page { + property Item stack: Kirigami.PageStack.pageStack + property alias subStack: stackView + QQC.StackView { + id: stackView + } + } + + Component { + id: pageWithInnerStack + + PageWithInnerStack { } + } + + component PageInLayer: Kirigami.Page { + property Item outerStack: Kirigami.PageStack.pageStack + property alias innerRect: rect + Rectangle { + id: rect + color: "blue" + property Item stackFromChild: Kirigami.PageStack.pageStack + } + } + + Component { + id: pageInLayer + + PageInLayer { } + } + + SignalSpy { + id: spyStackChanged + signalName: "pageStackChanged" + } + + + function initTestCase(): void { + mainWindow.show() + } + + function cleanupTestCase(): void { + mainWindow.close() + } + + function init(): void { + mainWindow.pageStack.clear() + spyStackChanged.clear() + } + + function test_accessPageRow(): void { + compare(mainWindow.pageStack.depth, 0) + mainWindow.pageStack.push(samplePage) + compare(mainWindow.pageStack.depth, 1) + + let pageRowFirstPage = mainWindow.pageStack.items[0] + + compare(pageRowFirstPage.outerStack, mainWindow.pageStack) + compare(pageRowFirstPage.innerRect.stackFromChild, mainWindow.pageStack) + } + + function test_accessInnerStack(): void { + compare(mainWindow.pageStack.depth, 0) + mainWindow.pageStack.push(pageWithInnerStack) + compare(mainWindow.pageStack.depth, 1) + + let pageRowFirstPage = mainWindow.pageStack.items[0] + compare(pageRowFirstPage.stack, mainWindow.pageStack) + + pageRowFirstPage.subStack.push(samplePage) + + compare(pageRowFirstPage.subStack.currentItem.outerStack, pageRowFirstPage.subStack) + compare(pageRowFirstPage.subStack.currentItem.innerRect.stackFromChild, pageRowFirstPage.subStack) + } + + function test_accessLayersStack(): void { + compare(mainWindow.pageStack.depth, 0) + mainWindow.pageStack.push(samplePage) + compare(mainWindow.pageStack.depth, 1) + + mainWindow.pageStack.layers.push(pageInLayer) + + let pageRowFirstPage = mainWindow.pageStack.items[0] + compare(pageRowFirstPage.outerStack, mainWindow.pageStack) + compare(pageRowFirstPage.innerRect.stackFromChild, mainWindow.pageStack) + + let layer1Page = mainWindow.pageStack.layers.currentItem as PageInLayer + compare(layer1Page.outerStack, mainWindow.pageStack.layers) + compare(layer1Page.innerRect.stackFromChild, mainWindow.pageStack.layers) + } + + function test_changeParent(): void { + compare(mainWindow.pageStack.depth, 0) + mainWindow.pageStack.push(samplePage) + compare(mainWindow.pageStack.depth, 1) + + let pageRowFirstPage = mainWindow.pageStack.items[0] as SamplePage + + compare(pageRowFirstPage.outerStack, mainWindow.pageStack) + compare(pageRowFirstPage.innerRect.stackFromChild, mainWindow.pageStack) + + mainWindow.pageStack.push(pageWithInnerStack) + compare(mainWindow.pageStack.depth, 2) + + let pageRowSecondPage = mainWindow.pageStack.items[1] as PageWithInnerStack + + compare(pageRowSecondPage.stack, mainWindow.pageStack) + + spyStackChanged.target = pageRowFirstPage.innerRect.Kirigami.PageStack + // First we make sure the internal stack has an attached property created + verify(pageRowSecondPage.subStack.Kirigami.PageStack.pageStack) + pageRowSecondPage.subStack.push(pageRowFirstPage.innerRect) + tryCompare(spyStackChanged, "count", 1) + compare(pageRowFirstPage.innerRect.parent, pageRowSecondPage.subStack) + compare(pageRowFirstPage.innerRect.stackFromChild, pageRowSecondPage.subStack); + } + + function test_changeParent_attachedNotExisting(): void { + // Here will reparent to a stackview in a page which + // doesn't have a stackattached created yet + compare(mainWindow.pageStack.depth, 0) + mainWindow.pageStack.push(samplePage) + compare(mainWindow.pageStack.depth, 1) + + let pageRowFirstPage = mainWindow.pageStack.items[0] as SamplePage + + compare(pageRowFirstPage.outerStack, mainWindow.pageStack) + compare(pageRowFirstPage.innerRect.stackFromChild, mainWindow.pageStack) + + mainWindow.pageStack.push(pageWithInnerStack) + compare(mainWindow.pageStack.depth, 2) + + let pageRowSecondPage = mainWindow.pageStack.items[1] as PageWithInnerStack + + compare(pageRowSecondPage.stack, mainWindow.pageStack) + + spyStackChanged.target = pageRowFirstPage.innerRect.Kirigami.PageStack + pageRowSecondPage.subStack.push(pageRowFirstPage.innerRect) + tryCompare(spyStackChanged, "count", 0) + // access the pagestack, ensuring it exists + verify(pageRowSecondPage.subStack.Kirigami.PageStack.pageStack) + // Now pageRowFirstPage.innerRect changed + tryCompare(spyStackChanged, "count", 1) + + compare(pageRowFirstPage.innerRect.parent, pageRowSecondPage.subStack) + compare(pageRowFirstPage.innerRect.stackFromChild, pageRowSecondPage.subStack); + } + + function test_attachedPushPopOnPageRow(): void { + compare(mainWindow.pageStack.depth, 0) + mainWindow.pageStack.push(samplePage) + compare(mainWindow.pageStack.depth, 1) + + let pageRowFirstPage = mainWindow.pageStack.items[0] as SamplePage + pageRowFirstPage.Kirigami.PageStack.push(samplePage); + compare(mainWindow.pageStack.depth, 2) + + let pageRowSecondPage = mainWindow.pageStack.items[1] as SamplePage + pageRowSecondPage.innerRect.Kirigami.PageStack.push(samplePage) + compare(mainWindow.pageStack.depth, 3) + + pageRowFirstPage.Kirigami.PageStack.pop(pageRowFirstPage) + compare(mainWindow.pageStack.depth, 1) + } + + function test_attachedPushPopOnStackView(): void { + compare(mainWindow.pageStack.depth, 0) + mainWindow.pageStack.push(pageWithInnerStack) + compare(mainWindow.pageStack.depth, 1) + + let pageRowFirstPage = mainWindow.pageStack.items[0] as PageWithInnerStack + pageRowFirstPage.subStack.push(samplePage) + compare(pageRowFirstPage.subStack.depth, 1) + + let subStackFirstPage = pageRowFirstPage.subStack.currentItem as SamplePage + + subStackFirstPage.Kirigami.PageStack.push(samplePage) + compare(pageRowFirstPage.subStack.depth, 2) + subStackFirstPage.Kirigami.PageStack.push(samplePage) + compare(pageRowFirstPage.subStack.depth, 3) + + subStackFirstPage.Kirigami.PageStack.pop(subStackFirstPage) + compare(pageRowFirstPage.subStack.depth, 1) + } + + function test_attachedReplaceOnPageRow(): void { + compare(mainWindow.pageStack.depth, 0) + mainWindow.pageStack.push(samplePage) + compare(mainWindow.pageStack.depth, 1) + + let pageRowFirstPage = mainWindow.pageStack.items[0] as SamplePage + pageRowFirstPage.Kirigami.PageStack.push(samplePage); + compare(mainWindow.pageStack.depth, 2) + + let pageRowSecondPage = mainWindow.pageStack.items[1] as SamplePage + pageRowSecondPage.innerRect.Kirigami.PageStack.replace(pageWithInnerStack) + compare(mainWindow.pageStack.depth, 2) + pageRowSecondPage = mainWindow.pageStack.items[1] + verify(pageRowSecondPage.hasOwnProperty("subStack")) + } + + function test_attachedReplaceOnStackView(): void { + compare(mainWindow.pageStack.depth, 0) + mainWindow.pageStack.push(pageWithInnerStack) + compare(mainWindow.pageStack.depth, 1) + + let pageRowFirstPage = mainWindow.pageStack.items[0] as PageWithInnerStack + pageRowFirstPage.subStack.push(samplePage) + compare(pageRowFirstPage.subStack.depth, 1) + + let subStackFirstPage = pageRowFirstPage.subStack.currentItem as SamplePage + + subStackFirstPage.Kirigami.PageStack.push(samplePage) + compare(pageRowFirstPage.subStack.depth, 2) + subStackFirstPage.Kirigami.PageStack.replace(pageWithInnerStack) + compare(pageRowFirstPage.subStack.depth, 2) + + verify(pageRowFirstPage.subStack.currentItem.hasOwnProperty("subStack")) + } + + function test_attachedClearOnPageRow(): void { + compare(mainWindow.pageStack.depth, 0) + mainWindow.pageStack.push(samplePage) + compare(mainWindow.pageStack.depth, 1) + + let pageRowFirstPage = mainWindow.pageStack.items[0] as SamplePage + pageRowFirstPage.Kirigami.PageStack.push(samplePage); + compare(mainWindow.pageStack.depth, 2) + + let pageRowSecondPage = mainWindow.pageStack.items[1] as SamplePage + pageRowSecondPage.innerRect.Kirigami.PageStack.push(samplePage) + compare(mainWindow.pageStack.depth, 3) + + pageRowFirstPage.Kirigami.PageStack.clear() + compare(mainWindow.pageStack.depth, 0) + } + + function test_attachedClearOnStackView(): void { + compare(mainWindow.pageStack.depth, 0) + mainWindow.pageStack.push(pageWithInnerStack) + compare(mainWindow.pageStack.depth, 1) + + let pageRowFirstPage = mainWindow.pageStack.items[0] as PageWithInnerStack + pageRowFirstPage.subStack.push(samplePage) + compare(pageRowFirstPage.subStack.depth, 1) + + let subStackFirstPage = pageRowFirstPage.subStack.currentItem as SamplePage + + subStackFirstPage.Kirigami.PageStack.push(samplePage) + compare(pageRowFirstPage.subStack.depth, 2) + subStackFirstPage.Kirigami.PageStack.push(samplePage) + compare(pageRowFirstPage.subStack.depth, 3) + + subStackFirstPage.Kirigami.PageStack.clear() + compare(pageRowFirstPage.subStack.depth, 0) + } +} diff --git a/local/recipes/kde/kirigami/source/autotests/tst_titleSubtitleWithActions.qml b/local/recipes/kde/kirigami/source/autotests/tst_titleSubtitleWithActions.qml new file mode 100644 index 0000000000..f02ae43374 --- /dev/null +++ b/local/recipes/kde/kirigami/source/autotests/tst_titleSubtitleWithActions.qml @@ -0,0 +1,66 @@ +/* + * SPDX-FileCopyrightText: 2025 Akseli Lahtinen + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Controls as QQC2 +import org.kde.kirigami as Kirigami +import QtTest + +TestCase { + id: testCase + + width: 400 + height: 400 + name: "TitleSubtitleWithActionsTest" + visible: false + Component { + id: testComponent + + Kirigami.TitleSubtitleWithActions { + title: "AAAA" + subtitle: "BBBB" + elide: Text.ElideRight + selected: false + actions: [ + Kirigami.Action { + icon.name: "edit-entry-symbolic" + text: "Modify item…" + onTriggered: console.warn("I dont actually do anything") + tooltip: text + }, + Kirigami.Action { + icon.name: "edit-delete-remove-symbolic" + text: "Remove item…" + onTriggered: console.warn("I also dont actually do anything") + tooltip: "Custom tooltip" + displayHint: Kirigami.DisplayHint.IconOnly + } + ] + } + } + + function test_verifyValues() { + const tc = createTemporaryObject(testComponent, this); + verify(tc instanceof Kirigami.TitleSubtitleWithActions); + verify(tc.title === "AAAA"); + verify(tc.subtitle === "BBBB"); + verify(tc.elide === Text.ElideRight); + verify(tc.selected === false); + verify(tc.displayHint === QQC2.Button.TextBesideIcon); + + verify(tc.actions[0] instanceof Kirigami.Action); + verify(tc.actions[0].icon.name === "edit-entry-symbolic"); + verify(tc.actions[0].text === "Modify item…"); + verify(tc.actions[0].tooltip === tc.actions[0].text); + verify(tc.actions[0].displayHint === Kirigami.DisplayHint.NoPreference); + + verify(tc.actions[1] instanceof Kirigami.Action); + verify(tc.actions[1].icon.name === "edit-delete-remove-symbolic"); + verify(tc.actions[1].text === "Remove item…"); + verify(tc.actions[1].tooltip === "Custom tooltip"); + verify(tc.actions[1].displayHint === Kirigami.DisplayHint.IconOnly); + } +} diff --git a/local/recipes/kde/kirigami/source/autotests/wheelhandler/ScrollView.qml b/local/recipes/kde/kirigami/source/autotests/wheelhandler/ScrollView.qml new file mode 100644 index 0000000000..57c2eeb36e --- /dev/null +++ b/local/recipes/kde/kirigami/source/autotests/wheelhandler/ScrollView.qml @@ -0,0 +1,39 @@ +/* SPDX-FileCopyrightText: 2021 Noah Davis + * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + */ + +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls as QQC2 + +import org.kde.kirigami as Kirigami + +T.ScrollView { + id: control + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + leftPadding: mirrored && T.ScrollBar.vertical && T.ScrollBar.vertical.visible && !Kirigami.Settings.isMobile ? T.ScrollBar.vertical.width : 0 + rightPadding: !mirrored && T.ScrollBar.vertical && T.ScrollBar.vertical.visible && !Kirigami.Settings.isMobile ? T.ScrollBar.vertical.width : 0 + bottomPadding: T.ScrollBar.horizontal && T.ScrollBar.horizontal.visible && !Kirigami.Settings.isMobile ? T.ScrollBar.horizontal.height : 0 + + T.ScrollBar.vertical: QQC2.ScrollBar { + parent: control + x: control.mirrored ? 0 : control.width - width + y: control.topPadding + height: control.availableHeight + active: control.T.ScrollBar.horizontal.active + stepSize: wheelHandler.verticalStepSize / control.contentHeight + } + + T.ScrollBar.horizontal: QQC2.ScrollBar { + parent: control + x: control.leftPadding + y: control.height - height + width: control.availableWidth + active: control.T.ScrollBar.vertical.active + stepSize: wheelHandler.horizontalStepSize / control.contentWidth + } +} diff --git a/local/recipes/kde/kirigami/source/cppcheck-suppressions.xml b/local/recipes/kde/kirigami/source/cppcheck-suppressions.xml new file mode 100644 index 0000000000..5f6568fb80 --- /dev/null +++ b/local/recipes/kde/kirigami/source/cppcheck-suppressions.xml @@ -0,0 +1,14 @@ + + + +returnByReference + + +constParameterPointer + + + +useStlAlgorithm + + + diff --git a/local/recipes/kde/kirigami/source/docs/includes/iconpropertiesgroup.qdocinc b/local/recipes/kde/kirigami/source/docs/includes/iconpropertiesgroup.qdocinc new file mode 100644 index 0000000000..bbc9b0fe5e --- /dev/null +++ b/local/recipes/kde/kirigami/source/docs/includes/iconpropertiesgroup.qdocinc @@ -0,0 +1,46 @@ +//! [grouped-properties] +\table +\header + \li Name + \li Description +\row + \li name + \li This property holds icon name. + + The icon will be loaded from the platform theme. If the icon is found + in the theme, it will always be used; even if icon.source is also set. + If the icon is not found, icon.source will be used instead. +\row + \li source + \li This property holds the icon source. + + The icon will be loaded as a regular image. +\row + \li width + \li This property holds the width of the icon. + +\row + \li height + \li This property holds the height of the icon. + +\row + \li color + \li This property holds the icon tint color. + + The icon is tinted with the specified color, unless the color is set to "transparent". + +\row + \li fromControlsIcon + \li Bind this icon to all matching properties of a Controls icon group. + + This function automatically binds all properties to matching properties + of a controls icon group, since we cannot just reuse the Controls icon + group. + + To use it, you can assign the result to an IconPropertiesGroup, like so: + \qml + icon: icon.fromControlsIcon(control.icon). + \endqml + +\endtable +//! [grouped-properties] diff --git a/local/recipes/kde/kirigami/source/docs/pics/FormEntryLayout.png b/local/recipes/kde/kirigami/source/docs/pics/FormEntryLayout.png new file mode 100644 index 0000000000..d050985bd5 Binary files /dev/null and b/local/recipes/kde/kirigami/source/docs/pics/FormEntryLayout.png differ diff --git a/local/recipes/kde/kirigami/source/docs/pics/FormEntryLayout.svg b/local/recipes/kde/kirigami/source/docs/pics/FormEntryLayout.svg new file mode 100644 index 0000000000..f1a8575b4a --- /dev/null +++ b/local/recipes/kde/kirigami/source/docs/pics/FormEntryLayout.svg @@ -0,0 +1,152 @@ + + + + + + + + + + LeadingItems + + Title + + Subtitle + TrailingItems + ContentItem + diff --git a/local/recipes/kde/kirigami/source/examples/simpleexamples/ListWithActionsExample.qml b/local/recipes/kde/kirigami/source/examples/simpleexamples/ListWithActionsExample.qml new file mode 100644 index 0000000000..5e49a69d8f --- /dev/null +++ b/local/recipes/kde/kirigami/source/examples/simpleexamples/ListWithActionsExample.qml @@ -0,0 +1,83 @@ +/* + * SPDX-FileCopyrightText: 2025 Akseli Lahtinen + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ +pragma ComponentBehavior: Bound + +import QtQuick +import QtQuick.Controls as QQC2 +import org.kde.kirigami as Kirigami + +Kirigami.ApplicationWindow { + id: root + pageStack.initialPage: page + + ListModel { + id: dragonModel + ListElement { + name: "Dragon Konqi" + title: "A very cool dragon" + } + ListElement { + name: "Dragon Kanqi" + title: "A very fierce dragon" + } + ListElement { + name: "Dragon Klinqli" + title: "A very chill dragon" + } + ListElement { + name: "Dragon Klynqi" + title: "A very sleepy dragon" + } + ListElement { + name: "Dragon Könqi" + title: "A very hungry dragon" + } + } + + + Component { + id: page + + Kirigami.ScrollablePage { + title: "Here Be Dragons" + ListView { + model: dragonModel + anchors.fill: parent + delegate: QQC2.ItemDelegate { + id: itemDelegate + + required property string name + required property string title + + Kirigami.Theme.useAlternateBackgroundColor: true + width: parent.width + + contentItem: Kirigami.TitleSubtitleWithActions { + title: itemDelegate.name + subtitle: itemDelegate.title + elide: Text.ElideRight + selected: itemDelegate.pressed || itemDelegate.highlighted + actions: [ + Kirigami.Action { + icon.name: "edit-entry-symbolic" + text: "Modify dragon…" + onTriggered: console.warn("Hi!") + tooltip: text + }, + Kirigami.Action { + icon.name: "edit-delete-remove-symbolic" + text: "Remove dragon…" + onTriggered: console.warn("Bye!") + tooltip: text + displayHint: Kirigami.DisplayHint.IconOnly + } + ] + } + } + } + } + } +} diff --git a/local/recipes/kde/kirigami/source/poqm/ga/libkirigami6_qt.po b/local/recipes/kde/kirigami/source/poqm/ga/libkirigami6_qt.po new file mode 100644 index 0000000000..3b00b0aa43 --- /dev/null +++ b/local/recipes/kde/kirigami/source/poqm/ga/libkirigami6_qt.po @@ -0,0 +1,279 @@ +msgid "" +msgstr "" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=5; plural=n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n < 11 ? " +"3 : 4\n" +"X-Qt-Contexts: true\n" + +#: controls/AboutItem.qml:166 +#, qt-format +msgctxt "AboutItem|" +msgid "%1 (%2)" +msgstr "" + +#: controls/AboutItem.qml:186 +#, qt-format +msgctxt "AboutItem|" +msgid "Send an email to %1" +msgstr "" + +#: controls/AboutItem.qml:228 +msgctxt "AboutItem|" +msgid "Get Involved" +msgstr "" + +#: controls/AboutItem.qml:234 +msgctxt "AboutItem|" +msgid "Donate" +msgstr "" + +#: controls/AboutItem.qml:251 +msgctxt "AboutItem|" +msgid "Report a Bug" +msgstr "" + +#: controls/AboutItem.qml:264 +msgctxt "AboutItem|" +msgid "Copyright" +msgstr "" + +#: controls/AboutItem.qml:313 +msgctxt "AboutItem|" +msgid "License:" +msgstr "" + +#: controls/AboutItem.qml:336 +#, qt-format +msgctxt "AboutItem|" +msgid "License: %1" +msgstr "" + +#: controls/AboutItem.qml:347 +msgctxt "AboutItem|" +msgid "Libraries in use" +msgstr "" + +#: controls/AboutItem.qml:379 +msgctxt "AboutItem|" +msgid "Authors" +msgstr "" + +#: controls/AboutItem.qml:389 +msgctxt "AboutItem|" +msgid "Show author photos" +msgstr "" + +#: controls/AboutItem.qml:400 +msgctxt "AboutItem|" +msgid "Credits" +msgstr "" + +#: controls/AboutItem.qml:412 +msgctxt "AboutItem|" +msgid "Translators" +msgstr "" + +#: controls/AboutPage.qml:102 +#, qt-format +msgctxt "AboutPage|" +msgid "About %1" +msgstr "" + +#: controls/AbstractApplicationWindow.qml:177 +msgctxt "AbstractApplicationWindow|" +msgid "Quit" +msgstr "" + +#: controls/ActionToolBar.qml:209 +msgctxt "ActionToolBar|" +msgid "More Actions" +msgstr "" + +#: controls/Chip.qml:45 +msgctxt "Chip|" +msgid "Remove" +msgstr "" + +#: controls/ContextDrawer.qml:64 +msgctxt "ContextDrawer|" +msgid "Actions" +msgstr "" + +#: controls/ContextualHelpButton.qml:60 +msgctxt "ContextualHelpButton|" +msgid "Show Contextual Help" +msgstr "" + +#: controls/GlobalDrawer.qml:365 +msgctxt "GlobalDrawer|" +msgid "Back" +msgstr "" + +#: controls/GlobalDrawer.qml:718 +msgctxt "GlobalDrawer|" +msgid "Close Sidebar" +msgstr "" + +#: controls/GlobalDrawer.qml:723 +msgctxt "GlobalDrawer|" +msgid "Open Sidebar" +msgstr "" + +#: controls/LoadingPlaceholder.qml:58 +msgctxt "LoadingPlaceholder|" +msgid "Loading…" +msgstr "" + +#: controls/PasswordField.qml:43 +msgctxt "PasswordField|" +msgid "Password" +msgstr "" + +#: controls/PasswordField.qml:46 +msgctxt "PasswordField|" +msgid "Hide Password" +msgstr "" + +#: controls/PasswordField.qml:46 +msgctxt "PasswordField|" +msgid "Show Password" +msgstr "" + +#: controls/private/globaltoolbar/HandleButton.qml:24 +msgctxt "HandleButton|" +msgid "Close menu" +msgstr "" + +#: controls/private/globaltoolbar/HandleButton.qml:24 +msgctxt "HandleButton|" +msgid "Open menu" +msgstr "" + +#: controls/private/globaltoolbar/NavigationButtons.qml:102 +msgctxt "NavigationButtons|" +msgid "Navigate Back" +msgstr "" + +#: controls/private/globaltoolbar/NavigationButtons.qml:119 +msgctxt "NavigationButtons|" +msgid "Navigate Forward" +msgstr "" + +#: controls/private/PrivateActionToolButton.qml:118 +#, qt-format +msgctxt "@info:tooltip %1 is a keyboard shorcut|" +msgid "Trigger this action with %1" +msgstr "" + +#: controls/private/PrivateActionToolButton.qml:125 +#, qt-format +msgctxt "" +"@info:tooltip %1 is the tooltip of an action, %2 is its keyboard shorcut|" +msgid "%1 (%2)" +msgstr "" + +#: controls/SearchField.qml:88 +msgctxt "SearchField|" +msgid "Search…" +msgstr "" + +#: controls/SearchField.qml:90 +msgctxt "SearchField|" +msgid "Search" +msgstr "" + +#: controls/SearchField.qml:100 +msgctxt "SearchField|" +msgid "Clear search" +msgstr "" + +#: controls/SelectableLabel.qml:297 +msgctxt "SelectableLabel|" +msgid "Copy" +msgstr "" + +#: controls/SelectableLabel.qml:310 +msgctxt "SelectableLabel|" +msgid "Select All" +msgstr "" + +#: controls/UrlButton.qml:52 +#, qt-format +msgctxt "UrlButton|@info:whatsthis" +msgid "Open link %1" +msgstr "" + +#: controls/UrlButton.qml:53 +msgctxt "UrlButton|@info:whatsthis" +msgid "Open link" +msgstr "" + +#: controls/UrlButton.qml:101 +msgctxt "UrlButton|" +msgid "Copy Link to Clipboard" +msgstr "" + +#: dialogs/DialogHeaderTopContent.qml:104 +msgctxt "DialogHeaderTopContent|@action:button close dialog" +msgid "Close" +msgstr "" + +#: platform/settings.cpp:219 +#, qt-format +msgctxt "Kirigami::Platform::Settings|" +msgid "KDE Frameworks %1" +msgstr "" + +#: platform/settings.cpp:221 +#, qt-format +msgctxt "Kirigami::Platform::Settings|" +msgid "The %1 windowing system" +msgstr "" + +#: platform/settings.cpp:222 +#, qt-format +msgctxt "Kirigami::Platform::Settings|" +msgid "Qt %2 (built against %3)" +msgstr "" + +#: templates/InlineMessage.qml:351 +msgctxt "InlineMessage|" +msgid "Success" +msgstr "" + +#: templates/InlineMessage.qml:353 +msgctxt "InlineMessage|" +msgid "Warning" +msgstr "" + +#: templates/InlineMessage.qml:355 +msgctxt "InlineMessage|" +msgid "Error" +msgstr "" + +#: templates/InlineMessage.qml:357 +msgctxt "InlineMessage|" +msgid "Note" +msgstr "" + +#: templates/InlineMessage.qml:444 +msgctxt "InlineMessage|" +msgid "Close" +msgstr "" + +#: templates/OverlayDrawer.qml:148 +msgctxt "OverlayDrawer|" +msgid "Close drawer" +msgstr "" + +#: templates/OverlayDrawer.qml:154 +msgctxt "OverlayDrawer|" +msgid "Open drawer" +msgstr "" + +#: templates/OverlaySheet.qml:298 +msgctxt "OverlaySheet|@action:button close dialog" +msgid "Close" +msgstr "" diff --git a/local/recipes/kde/kirigami/source/poqm/nb/libkirigami6_qt.po b/local/recipes/kde/kirigami/source/poqm/nb/libkirigami6_qt.po new file mode 100644 index 0000000000..671b16cfa1 --- /dev/null +++ b/local/recipes/kde/kirigami/source/poqm/nb/libkirigami6_qt.po @@ -0,0 +1,289 @@ +# Translation of libkirigami6_qt to Norwegian Bokmål +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"PO-Revision-Date: 2026-03-03 12:14+0100\n" +"Last-Translator: Kjetil Sorlund \n" +"Language-Team: Norwegian Bokmål \n" +"Language: nb\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Lokalize 25.12.2\n" +"X-Environment: kde\n" +"X-Accelerator-Marker: &\n" +"X-Text-Markup: qtrich\n" +"X-Qt-Contexts: true\n" + +#: controls/AboutItem.qml:166 +#, qt-format +msgctxt "AboutItem|" +msgid "%1 (%2)" +msgstr "%1 (%2)" + +#: controls/AboutItem.qml:186 +#, qt-format +msgctxt "AboutItem|" +msgid "Send an email to %1" +msgstr "Send e-post til %1" + +#: controls/AboutItem.qml:228 +msgctxt "AboutItem|" +msgid "Get Involved" +msgstr "Bli med" + +#: controls/AboutItem.qml:234 +msgctxt "AboutItem|" +msgid "Donate" +msgstr "Gi pengegave" + +#: controls/AboutItem.qml:251 +msgctxt "AboutItem|" +msgid "Report a Bug" +msgstr "Meld fra om feil" + +#: controls/AboutItem.qml:264 +msgctxt "AboutItem|" +msgid "Copyright" +msgstr "Opphavsrett" + +#: controls/AboutItem.qml:313 +msgctxt "AboutItem|" +msgid "License:" +msgstr "Lisens:" + +#: controls/AboutItem.qml:336 +#, qt-format +msgctxt "AboutItem|" +msgid "License: %1" +msgstr "Lisens: %1" + +#: controls/AboutItem.qml:347 +msgctxt "AboutItem|" +msgid "Libraries in use" +msgstr "Brukte bibliotek" + +#: controls/AboutItem.qml:379 +msgctxt "AboutItem|" +msgid "Authors" +msgstr "Opphavspersoner" + +#: controls/AboutItem.qml:389 +msgctxt "AboutItem|" +msgid "Show author photos" +msgstr "Vis bilde av opphavspersonene" + +#: controls/AboutItem.qml:400 +msgctxt "AboutItem|" +msgid "Credits" +msgstr "Bidragsytere" + +#: controls/AboutItem.qml:412 +msgctxt "AboutItem|" +msgid "Translators" +msgstr "Oversettere" + +#: controls/AboutPage.qml:102 +#, qt-format +msgctxt "AboutPage|" +msgid "About %1" +msgstr "Om %1" + +#: controls/AbstractApplicationWindow.qml:177 +msgctxt "AbstractApplicationWindow|" +msgid "Quit" +msgstr "Avslutt" + +#: controls/ActionToolBar.qml:209 +msgctxt "ActionToolBar|" +msgid "More Actions" +msgstr "Flere handlinger" + +#: controls/Chip.qml:45 +msgctxt "Chip|" +msgid "Remove" +msgstr "Fjern" + +#: controls/ContextDrawer.qml:64 +msgctxt "ContextDrawer|" +msgid "Actions" +msgstr "Handlinger" + +#: controls/ContextualHelpButton.qml:60 +msgctxt "ContextualHelpButton|" +msgid "Show Contextual Help" +msgstr "Vis emnehjelp" + +#: controls/GlobalDrawer.qml:365 +msgctxt "GlobalDrawer|" +msgid "Back" +msgstr "Tilbake" + +#: controls/GlobalDrawer.qml:718 +msgctxt "GlobalDrawer|" +msgid "Close Sidebar" +msgstr "Lukk sidestolpen" + +#: controls/GlobalDrawer.qml:723 +msgctxt "GlobalDrawer|" +msgid "Open Sidebar" +msgstr "Åpne sidestolpe" + +#: controls/LoadingPlaceholder.qml:58 +msgctxt "LoadingPlaceholder|" +msgid "Loading…" +msgstr "Laster …" + +#: controls/PasswordField.qml:43 +msgctxt "PasswordField|" +msgid "Password" +msgstr "Passord" + +#: controls/PasswordField.qml:46 +msgctxt "PasswordField|" +msgid "Hide Password" +msgstr "Skjul passord" + +#: controls/PasswordField.qml:46 +msgctxt "PasswordField|" +msgid "Show Password" +msgstr "Vis passord" + +#: controls/private/globaltoolbar/HandleButton.qml:24 +msgctxt "HandleButton|" +msgid "Close menu" +msgstr "Lukk meny" + +#: controls/private/globaltoolbar/HandleButton.qml:24 +msgctxt "HandleButton|" +msgid "Open menu" +msgstr "Åpne meny" + +#: controls/private/globaltoolbar/NavigationButtons.qml:102 +msgctxt "NavigationButtons|" +msgid "Navigate Back" +msgstr "Naviger tilbake" + +#: controls/private/globaltoolbar/NavigationButtons.qml:119 +msgctxt "NavigationButtons|" +msgid "Navigate Forward" +msgstr "Naviger frem" + +#: controls/private/PrivateActionToolButton.qml:118 +#, qt-format +msgctxt "@info:tooltip %1 is a keyboard shorcut|" +msgid "Trigger this action with %1" +msgstr "Utløs denne handlingen med %1" + +#: controls/private/PrivateActionToolButton.qml:125 +#, qt-format +msgctxt "" +"@info:tooltip %1 is the tooltip of an action, %2 is its keyboard shorcut|" +msgid "%1 (%2)" +msgstr "%1 (%2)" + +#: controls/SearchField.qml:88 +msgctxt "SearchField|" +msgid "Search…" +msgstr "Søk …" + +#: controls/SearchField.qml:90 +msgctxt "SearchField|" +msgid "Search" +msgstr "Søk" + +#: controls/SearchField.qml:100 +msgctxt "SearchField|" +msgid "Clear search" +msgstr "Tøm søkefelt" + +#: controls/SelectableLabel.qml:297 +msgctxt "SelectableLabel|" +msgid "Copy" +msgstr "Kopier" + +#: controls/SelectableLabel.qml:310 +msgctxt "SelectableLabel|" +msgid "Select All" +msgstr "Merk alle" + +#: controls/UrlButton.qml:52 +#, qt-format +msgctxt "UrlButton|@info:whatsthis" +msgid "Open link %1" +msgstr "Åpne lenka %1" + +#: controls/UrlButton.qml:53 +msgctxt "UrlButton|@info:whatsthis" +msgid "Open link" +msgstr "Åpne lenka" + +#: controls/UrlButton.qml:101 +msgctxt "UrlButton|" +msgid "Copy Link to Clipboard" +msgstr "Kopier lenka til utklippstavla" + +#: dialogs/DialogHeaderTopContent.qml:104 +msgctxt "DialogHeaderTopContent|@action:button close dialog" +msgid "Close" +msgstr "Lukk" + +#: platform/settings.cpp:219 +#, qt-format +msgctxt "Kirigami::Platform::Settings|" +msgid "KDE Frameworks %1" +msgstr "KDE Frameworks %1" + +#: platform/settings.cpp:221 +#, qt-format +msgctxt "Kirigami::Platform::Settings|" +msgid "The %1 windowing system" +msgstr "Vindussystemet %1" + +#: platform/settings.cpp:222 +#, qt-format +msgctxt "Kirigami::Platform::Settings|" +msgid "Qt %2 (built against %3)" +msgstr "Qt %2 (bygd mot %3)" + +#: templates/InlineMessage.qml:351 +msgctxt "InlineMessage|" +msgid "Success" +msgstr "Vellykket" + +#: templates/InlineMessage.qml:353 +msgctxt "InlineMessage|" +msgid "Warning" +msgstr "Advarsel" + +#: templates/InlineMessage.qml:355 +msgctxt "InlineMessage|" +msgid "Error" +msgstr "Feil" + +#: templates/InlineMessage.qml:357 +msgctxt "InlineMessage|" +msgid "Note" +msgstr "Merk" + +#: templates/InlineMessage.qml:444 +msgctxt "InlineMessage|" +msgid "Close" +msgstr "Lukk" + +#: templates/OverlayDrawer.qml:148 +msgctxt "OverlayDrawer|" +msgid "Close drawer" +msgstr "Lukk skuff" + +#: templates/OverlayDrawer.qml:154 +msgctxt "OverlayDrawer|" +msgid "Open drawer" +msgstr "Åpne skuff" + +#: templates/OverlaySheet.qml:298 +msgctxt "OverlaySheet|@action:button close dialog" +msgid "Close" +msgstr "Lukk" diff --git a/local/recipes/kde/kirigami/source/poqm/ug/libkirigami6_qt.po b/local/recipes/kde/kirigami/source/poqm/ug/libkirigami6_qt.po new file mode 100644 index 0000000000..f8f6bbcf2d --- /dev/null +++ b/local/recipes/kde/kirigami/source/poqm/ug/libkirigami6_qt.po @@ -0,0 +1,285 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: Abduqadir Abliz \n" +"Language-Team: \n" +"Language: ug\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Qt-Contexts: true\n" +"X-Generator: Poedit 3.9\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: controls/AboutItem.qml:166 +#, qt-format +msgctxt "AboutItem|" +msgid "%1 (%2)" +msgstr "%1 (%2)" + +#: controls/AboutItem.qml:186 +#, qt-format +msgctxt "AboutItem|" +msgid "Send an email to %1" +msgstr "%1 غا ئېلخەت يوللايدۇ" + +#: controls/AboutItem.qml:228 +msgctxt "AboutItem|" +msgid "Get Involved" +msgstr "" + +#: controls/AboutItem.qml:234 +msgctxt "AboutItem|" +msgid "Donate" +msgstr "ئىئانە" + +#: controls/AboutItem.qml:251 +msgctxt "AboutItem|" +msgid "Report a Bug" +msgstr "" + +#: controls/AboutItem.qml:264 +msgctxt "AboutItem|" +msgid "Copyright" +msgstr "نەشر ھوقۇقى" + +#: controls/AboutItem.qml:313 +msgctxt "AboutItem|" +msgid "License:" +msgstr "ئىجازەتنامە:" + +#: controls/AboutItem.qml:336 +#, qt-format +msgctxt "AboutItem|" +msgid "License: %1" +msgstr "ئىجازەتنامە: %1" + +#: controls/AboutItem.qml:347 +msgctxt "AboutItem|" +msgid "Libraries in use" +msgstr "" + +#: controls/AboutItem.qml:379 +msgctxt "AboutItem|" +msgid "Authors" +msgstr "يازغۇچى" + +#: controls/AboutItem.qml:389 +msgctxt "AboutItem|" +msgid "Show author photos" +msgstr "" + +#: controls/AboutItem.qml:400 +msgctxt "AboutItem|" +msgid "Credits" +msgstr "تەشەككۈر" + +#: controls/AboutItem.qml:412 +msgctxt "AboutItem|" +msgid "Translators" +msgstr "تەرجىمان" + +#: controls/AboutPage.qml:102 +#, qt-format +msgctxt "AboutPage|" +msgid "About %1" +msgstr "%1 ھەققىدە" + +#: controls/AbstractApplicationWindow.qml:177 +msgctxt "AbstractApplicationWindow|" +msgid "Quit" +msgstr "چىكىن" + +#: controls/ActionToolBar.qml:209 +msgctxt "ActionToolBar|" +msgid "More Actions" +msgstr "تېخىمۇ كۆپ مەشغۇلات" + +#: controls/Chip.qml:45 +msgctxt "Chip|" +msgid "Remove" +msgstr "چىقىرىۋەت" + +#: controls/ContextDrawer.qml:64 +msgctxt "ContextDrawer|" +msgid "Actions" +msgstr "مەشغۇلات" + +#: controls/ContextualHelpButton.qml:60 +msgctxt "ContextualHelpButton|" +msgid "Show Contextual Help" +msgstr "مۇناسىۋەتلىك ياردەمنى كۆرسەت" + +#: controls/GlobalDrawer.qml:365 +msgctxt "GlobalDrawer|" +msgid "Back" +msgstr "قايت" + +#: controls/GlobalDrawer.qml:718 +msgctxt "GlobalDrawer|" +msgid "Close Sidebar" +msgstr "" + +#: controls/GlobalDrawer.qml:723 +msgctxt "GlobalDrawer|" +msgid "Open Sidebar" +msgstr "" + +#: controls/LoadingPlaceholder.qml:58 +msgctxt "LoadingPlaceholder|" +msgid "Loading…" +msgstr "يۈكلەۋاتىدۇ…" + +#: controls/PasswordField.qml:43 +msgctxt "PasswordField|" +msgid "Password" +msgstr "ئىم" + +#: controls/PasswordField.qml:46 +msgctxt "PasswordField|" +msgid "Hide Password" +msgstr "ئىم يوشۇر" + +#: controls/PasswordField.qml:46 +msgctxt "PasswordField|" +msgid "Show Password" +msgstr "ئىم كۆرسەت" + +#: controls/private/globaltoolbar/HandleButton.qml:24 +msgctxt "HandleButton|" +msgid "Close menu" +msgstr "" + +#: controls/private/globaltoolbar/HandleButton.qml:24 +msgctxt "HandleButton|" +msgid "Open menu" +msgstr "" + +#: controls/private/globaltoolbar/NavigationButtons.qml:102 +msgctxt "NavigationButtons|" +msgid "Navigate Back" +msgstr "" + +#: controls/private/globaltoolbar/NavigationButtons.qml:119 +msgctxt "NavigationButtons|" +msgid "Navigate Forward" +msgstr "" + +#: controls/private/PrivateActionToolButton.qml:118 +#, qt-format +msgctxt "@info:tooltip %1 is a keyboard shorcut|" +msgid "Trigger this action with %1" +msgstr "" + +#: controls/private/PrivateActionToolButton.qml:125 +#, qt-format +msgctxt "" +"@info:tooltip %1 is the tooltip of an action, %2 is its keyboard shorcut|" +msgid "%1 (%2)" +msgstr "%1 (%2)" + +#: controls/SearchField.qml:88 +msgctxt "SearchField|" +msgid "Search…" +msgstr "ئىزدە…" + +#: controls/SearchField.qml:90 +msgctxt "SearchField|" +msgid "Search" +msgstr "ئىزدە" + +#: controls/SearchField.qml:100 +msgctxt "SearchField|" +msgid "Clear search" +msgstr "ئىزدەشنى تازىلا" + +#: controls/SelectableLabel.qml:297 +msgctxt "SelectableLabel|" +msgid "Copy" +msgstr "كۆچۈر" + +#: controls/SelectableLabel.qml:310 +msgctxt "SelectableLabel|" +msgid "Select All" +msgstr "ھەممىنى تاللا" + +#: controls/UrlButton.qml:52 +#, qt-format +msgctxt "UrlButton|@info:whatsthis" +msgid "Open link %1" +msgstr "" + +#: controls/UrlButton.qml:53 +msgctxt "UrlButton|@info:whatsthis" +msgid "Open link" +msgstr "" + +#: controls/UrlButton.qml:101 +msgctxt "UrlButton|" +msgid "Copy Link to Clipboard" +msgstr "" + +#: dialogs/DialogHeaderTopContent.qml:104 +msgctxt "DialogHeaderTopContent|@action:button close dialog" +msgid "Close" +msgstr "ياپ" + +#: platform/settings.cpp:219 +#, qt-format +msgctxt "Kirigami::Platform::Settings|" +msgid "KDE Frameworks %1" +msgstr "" + +#: platform/settings.cpp:221 +#, qt-format +msgctxt "Kirigami::Platform::Settings|" +msgid "The %1 windowing system" +msgstr "" + +#: platform/settings.cpp:222 +#, qt-format +msgctxt "Kirigami::Platform::Settings|" +msgid "Qt %2 (built against %3)" +msgstr "" + +#: templates/InlineMessage.qml:351 +msgctxt "InlineMessage|" +msgid "Success" +msgstr "مۇۋەپپەقىيەتلىك بولدى" + +#: templates/InlineMessage.qml:353 +msgctxt "InlineMessage|" +msgid "Warning" +msgstr "ئاگاھلاندۇرۇش" + +#: templates/InlineMessage.qml:355 +msgctxt "InlineMessage|" +msgid "Error" +msgstr "خاتالىق" + +#: templates/InlineMessage.qml:357 +msgctxt "InlineMessage|" +msgid "Note" +msgstr "ئىزاھات" + +#: templates/InlineMessage.qml:444 +msgctxt "InlineMessage|" +msgid "Close" +msgstr "ياپ" + +#: templates/OverlayDrawer.qml:148 +msgctxt "OverlayDrawer|" +msgid "Close drawer" +msgstr "" + +#: templates/OverlayDrawer.qml:154 +msgctxt "OverlayDrawer|" +msgid "Open drawer" +msgstr "" + +#: templates/OverlaySheet.qml:298 +msgctxt "OverlaySheet|@action:button close dialog" +msgid "Close" +msgstr "ياپ" diff --git a/local/recipes/kde/kirigami/source/src/controls/Badge.qml b/local/recipes/kde/kirigami/source/src/controls/Badge.qml new file mode 100644 index 0000000000..dd9704488d --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/controls/Badge.qml @@ -0,0 +1,127 @@ +/* + * SPDX-FileCopyrightText: 2025-2026 Nate Graham + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls as QQC2 + +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.templates as KT +import org.kde.kirigami.primitives as Primitives + + +KT.Badge { + id: root + + padding: Platform.Units.smallSpacing + topPadding: padding + // Extra horizontal padding looks better when pill-shaped with icons and long labels + horizontalPadding: internal.pillShaped && !internal.circular && internal.labelVisible ? (padding + Platform.Units.smallSpacing) : padding + leftPadding: horizontalPadding + (LayoutMirroring.enabled ? internal.extraTrailingPadding : 0) + rightPadding: horizontalPadding + (LayoutMirroring.enabled ? 0 : internal.extraTrailingPadding) + bottomPadding: padding + + spacing: Platform.Units.smallSpacing + + font.bold: true + font.pointSize: Platform.Theme.smallFont.pointSize + font.family: Platform.Theme.smallFont.family + + QtObject { + id: internal + + // Size and layout + property bool pillShaped + Binding on pillShaped { + value: root.text.length === 0 || label.lineCount === 1 + delayed: true // avoids binding loop; text may use two lines until the control resizes + } + readonly property bool labelVisible: root.text.length > 0 + readonly property bool circular: root.implicitContentWidth + root.padding * 2 <= root.implicitHeight + readonly property int extraTrailingPadding: internal.pillShaped && icon.visible && labelVisible ? Platform.Units.smallSpacing : 0 + + // Colors + // TODO: use unmodified semantically appropriate colors from the color scheme, once they exist + readonly property color borderColor: { + if (root.customColor !== Qt.color("transparent")) { + return Platform.ColorUtils.linearInterpolation(root.customColor, Platform.Theme.textColor, 0.5) + } + + switch (root.type) { + case KT.Badge.Type.Positive: + return Platform.Theme.positiveTextColor; + case KT.Badge.Type.Warning: + return Platform.Theme.neutralTextColor; + case KT.Badge.Type.Error: + return Platform.Theme.negativeTextColor; + default: + return Platform.Theme.activeTextColor; + } + } + readonly property color backgroundColor: root.customColor !== Qt.color("transparent") + ? root.customColor + : Platform.ColorUtils.tintWithAlpha(Platform.Theme.backgroundColor, borderColor, 0.2) + readonly property color textColor: { + if (root.customTextColor !== Qt.color("transparent")) { + return root.customTextColor; + } + + let baseTextColor = Platform.Theme.textColor + + // Ensure readability on arbitrary background colors, overriding + // the theme's text color if needed + if (Platform.ColorUtils.brightnessForColor(backgroundColor) == Platform.ColorUtils.brightnessForColor(baseTextColor)) { + baseTextColor = Platform.ColorUtils.brightnessForColor(backgroundColor) == Platform.ColorUtils.Light ? "black" : "white" + } + // 0.17 is the lowest we can go and still achieve WCAG AAA contrast ratio with the default colors + Platform.ColorUtils.linearInterpolation(baseTextColor, backgroundColor, 0.17) + } + } + + // Match styling of Kirigami.InlineMessage + background: Rectangle { + border.width: 1 + border.color: internal.borderColor + color: internal.backgroundColor + radius: internal.pillShaped ? root.height / 2 : Platform.Units.cornerRadius + } + + contentItem: RowLayout { + spacing: root.spacing + + Primitives.Icon { + id: icon + + Layout.preferredWidth: root.icon.width + Layout.preferredHeight: root.icon.height + Layout.alignment: internal.pillShaped ? Qt.AlignHCenter : Qt.AlignTop + + visible: source.length > 0 + + source: root.icon.name || root.icon.source || "" + + isMask: root.icon.color !== Qt.color("transparent") || root.icon.name.endsWith("-symbolic") + color: root.icon.color !== Qt.color("transparent") ? root.icon.color : internal.textColor + + } + + QQC2.Label { + id: label + + Layout.fillWidth: true + + visible: text.length > 0 + + text: root.text + color: internal.textColor + font: root.font + + wrapMode: Text.Wrap + horizontalAlignment: icon.valid ? Text.AlignLeft : Text.AlignHCenter + textFormat: Text.PlainText + } + } +} diff --git a/local/recipes/kde/kirigami/source/src/controls/CMakeLists.txt b/local/recipes/kde/kirigami/source/src/controls/CMakeLists.txt new file mode 100644 index 0000000000..f0cbf1ebd3 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/controls/CMakeLists.txt @@ -0,0 +1,126 @@ + +add_library(KirigamiControls) +ecm_add_qml_module(KirigamiControls URI "org.kde.kirigami.controls" VERSION 2.0 + CLASS_NAME KirigamiControlsPlugin + INSTALLED_PLUGIN_TARGET KF6KirigamiControlsplugin + DEPENDENCIES + QtQuick + TARGET KirigamiLayouts + TARGET KirigamiPlatform + TARGET KirigamiPrimitives + TARGET KirigamiTemplates +) + +ecm_qt_declare_logging_category(KirigamiControls + HEADER loggingcategory.h + IDENTIFIER KirigamiControlsLog + CATEGORY_NAME kf.kirigami.controls + DESCRIPTION "KirigamiControls" + EXPORT KIRIGAMI +) + +ecm_target_qml_sources(KirigamiControls SOURCES + AboutItem.qml + AboutPage.qml + AbstractApplicationHeader.qml + AbstractApplicationItem.qml + AbstractApplicationWindow.qml + AbstractCard.qml + Action.qml + ActionTextField.qml + ActionToolBar.qml + ApplicationItem.qml + ApplicationWindow.qml + Badge.qml + Card.qml + CardsLayout.qml + CardsListView.qml + Chip.qml + ContextDrawer.qml + ContextualHelpButton.qml + FlexColumn.qml + GlobalDrawer.qml + Heading.qml + InlineMessage.qml + InlineViewHeader.qml + LinkButton.qml + ListItemDragHandle.qml + ListSectionHeader.qml + LoadingPlaceholder.qml + NavigationTabBar.qml + NavigationTabButton.qml + OverlayDrawer.qml + OverlaySheet.qml + Page.qml + PagePoolAction.qml + PageRow.qml + PasswordField.qml + PlaceholderMessage.qml + ScrollablePage.qml + SearchField.qml + SelectableLabel.qml + SwipeListItem.qml + UrlButton.qml +) + +ecm_target_qml_sources(KirigamiControls PRIVATE PATH private SOURCES + private/ActionMenuItem.qml + private/ActionsMenu.qml + private/BannerImage.qml + private/ContextDrawerActionItem.qml + private/DefaultCardBackground.qml + private/DefaultChipBackground.qml + private/DefaultPageTitleDelegate.qml + private/EdgeShadow.qml + private/GlobalDrawerActionItem.qml + private/MobileDialogLayer.qml + private/PassiveNotificationsManager.qml + private/PrivateActionToolButton.qml + private/PullDownIndicator.qml + private/SwipeItemEventFilter.qml +) + +ecm_target_qml_sources(KirigamiControls PRIVATE PATH private/globaltoolbar SOURCES + private/globaltoolbar/BreadcrumbControl.qml + private/globaltoolbar/HandleButton.qml + private/globaltoolbar/NavigationButtons.qml + private/globaltoolbar/PageRowGlobalToolBarStyleGroup.qml + private/globaltoolbar/PageRowGlobalToolBarUI.qml + private/globaltoolbar/ToolBarPageFooter.qml + private/globaltoolbar/ToolBarPageHeader.qml +) + +target_include_directories(KirigamiControlsplugin PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..) + +target_sources(KirigamiControls PRIVATE + enums.h + pagepool.cpp + pagepool.h +) + +target_sources(KirigamiControlsplugin PRIVATE + kirigamicontrolsplugin.cpp + kirigamicontrolsplugin.h +) + +target_link_libraries(KirigamiControls + PUBLIC + Qt6::Core + Qt6::Gui + Qt6::Qml + Qt6::Quick + KirigamiPlatform +) + +set_target_properties(KirigamiControls PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION 6 + EXPORT_NAME "KirigamiControls" +) + +target_include_directories(KirigamiControls PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..) + +ecm_finalize_qml_module(KirigamiControls EXPORT KirigamiTargets) + +install(TARGETS KirigamiControls EXPORT KirigamiTargets ${KF_INSTALL_TARGETS_DEFAULT_ARGS}) + diff --git a/local/recipes/kde/kirigami/source/src/controls/enums.h b/local/recipes/kde/kirigami/source/src/controls/enums.h new file mode 100644 index 0000000000..825723a41a --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/controls/enums.h @@ -0,0 +1,50 @@ +/* + * SPDX-FileCopyrightText: 2016 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#ifndef ENUMS_H +#define ENUMS_H + +#include +#include + +namespace ApplicationHeaderStyle +{ +Q_NAMESPACE +QML_ELEMENT + +enum Status { + Auto = 0, + Breadcrumb, + Titles, + ToolBar, ///\since 5.48 + None, ///\since 5.48 +}; +Q_ENUM_NS(Status) + +enum NavigationButton { + NoNavigationButtons = 0, + ShowBackButton = 0x1, + ShowForwardButton = 0x2, +}; +Q_ENUM_NS(NavigationButton) +Q_DECLARE_FLAGS(NavigationButtons, NavigationButton) +} + +namespace MessageType +{ +Q_NAMESPACE +QML_ELEMENT + +enum Type { + Information = 0, + Positive, + Warning, + Error, +}; +Q_ENUM_NS(Type) +}; + +#endif // ENUMS_H diff --git a/local/recipes/kde/kirigami/source/src/controls/kirigamicontrolsplugin.cpp b/local/recipes/kde/kirigami/source/src/controls/kirigamicontrolsplugin.cpp new file mode 100644 index 0000000000..53a7654780 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/controls/kirigamicontrolsplugin.cpp @@ -0,0 +1,159 @@ +/* + * SPDX-FileCopyrightText: 2009 Alan Alpert + * SPDX-FileCopyrightText: 2010 Ménard Alexis + * SPDX-FileCopyrightText: 2010 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#include "kirigamicontrolsplugin.h" + +#include +#if defined(Q_OS_ANDROID) +#include +#endif +#include +#include + +#include "platform/styleselector.h" + +#ifdef KIRIGAMI_BUILD_TYPE_STATIC +#include "loggingcategory.h" +#include +#endif + +using namespace Qt::StringLiterals; + +// This is required for declarative registration to work on Windows. +// This is normally generated by Qt but since we need a manually written plugin +// file, we need to include this ourselves. +extern void qml_register_types_org_kde_kirigami_controls(); +Q_GHS_KEEP_REFERENCE(qml_register_types_org_kde_kirigami_controls) + +// we can't do this in the plugin object directly, as that can live in a different thread +// and event filters are only allowed in the same thread as the filtered object +class ControlsLanguageChangeEventFilter : public QObject +{ + Q_OBJECT +public: + bool eventFilter(QObject *receiver, QEvent *event) override + { + if (event->type() == QEvent::LanguageChange && receiver == QCoreApplication::instance()) { + Q_EMIT languageChangeEvent(); + } + return QObject::eventFilter(receiver, event); + } + +Q_SIGNALS: + void languageChangeEvent(); +}; + +KirigamiControlsPlugin::KirigamiControlsPlugin(QObject *parent) + : QQmlExtensionPlugin(parent) +{ + // See above. + volatile auto registration = &qml_register_types_org_kde_kirigami_controls; + Q_UNUSED(registration) + + auto filter = new ControlsLanguageChangeEventFilter; + filter->moveToThread(QCoreApplication::instance()->thread()); + QCoreApplication::instance()->installEventFilter(filter); + connect(qApp, &QCoreApplication::destroyed, qApp, [filter] { + delete filter; + }); +} + +QUrl KirigamiControlsPlugin::componentUrl(const QString &fileName) const +{ + return Kirigami::Platform::StyleSelector::componentUrlForModule(u"controls"_s, fileName); +} + +void KirigamiControlsPlugin::registerTypes(const char *uri) +{ +#if defined(Q_OS_ANDROID) + QResource::registerResource(u"assets:/android_rcc_bundle.rcc"_s); +#endif + + Q_ASSERT(QLatin1String(uri) == "org.kde.kirigami.controls"_L1); + + if (QIcon::themeName().isEmpty() && !qEnvironmentVariableIsSet("XDG_CURRENT_DESKTOP")) { +#if defined(Q_OS_ANDROID) + // Don't change the old icons location + QIcon::setThemeSearchPaths({u"assets:/qml/org/kde/kirigami"_s, u":/../icons"_s}); +#else + QIcon::setThemeSearchPaths({Kirigami::Platform::StyleSelector::resolveFilePath(u"."_s), u":/../icons"_s}); +#endif + QIcon::setThemeName(u"breeze-internal"_s); + } else { + QIcon::setFallbackSearchPaths(QIcon::fallbackSearchPaths() << Kirigami::Platform::StyleSelector::resolveFilePath(u"../icons"_s)); + } + + qmlRegisterType(componentUrl(u"Action.qml"_s), uri, 2, 0, "Action"); + qmlRegisterType(componentUrl(u"AbstractApplicationHeader.qml"_s), uri, 2, 0, "AbstractApplicationHeader"); + qmlRegisterType(componentUrl(u"AbstractApplicationWindow.qml"_s), uri, 2, 0, "AbstractApplicationWindow"); + qmlRegisterType(componentUrl(u"ApplicationWindow.qml"_s), uri, 2, 0, "ApplicationWindow"); + qmlRegisterType(componentUrl(u"OverlayDrawer.qml"_s), uri, 2, 0, "OverlayDrawer"); + qmlRegisterType(componentUrl(u"ContextDrawer.qml"_s), uri, 2, 0, "ContextDrawer"); + qmlRegisterType(componentUrl(u"GlobalDrawer.qml"_s), uri, 2, 0, "GlobalDrawer"); + qmlRegisterType(componentUrl(u"Heading.qml"_s), uri, 2, 0, "Heading"); + qmlRegisterType(componentUrl(u"PageRow.qml"_s), uri, 2, 0, "PageRow"); + qmlRegisterType(componentUrl(u"OverlaySheet.qml"_s), uri, 2, 0, "OverlaySheet"); + qmlRegisterType(componentUrl(u"Page.qml"_s), uri, 2, 0, "Page"); + qmlRegisterType(componentUrl(u"ScrollablePage.qml"_s), uri, 2, 0, "ScrollablePage"); + qmlRegisterType(componentUrl(u"SwipeListItem.qml"_s), uri, 2, 0, "SwipeListItem"); + qmlRegisterType(componentUrl(u"AbstractApplicationItem.qml"_s), uri, 2, 0, "AbstractApplicationItem"); + qmlRegisterType(componentUrl(u"ApplicationItem.qml"_s), uri, 2, 0, "ApplicationItem"); + qmlRegisterType(componentUrl(u"AbstractCard.qml"_s), uri, 2, 0, "AbstractCard"); + qmlRegisterType(componentUrl(u"Card.qml"_s), uri, 2, 0, "Card"); + qmlRegisterType(componentUrl(u"CardsListView.qml"_s), uri, 2, 0, "CardsListView"); + qmlRegisterType(componentUrl(u"CardsLayout.qml"_s), uri, 2, 0, "CardsLayout"); + qmlRegisterType(componentUrl(u"InlineMessage.qml"_s), uri, 2, 0, "InlineMessage"); + qmlRegisterType(componentUrl(u"ListItemDragHandle.qml"_s), uri, 2, 0, "ListItemDragHandle"); + qmlRegisterType(componentUrl(u"ActionToolBar.qml"_s), uri, 2, 0, "ActionToolBar"); + qmlRegisterType(componentUrl(u"AboutPage.qml"_s), uri, 2, 0, "AboutPage"); + qmlRegisterType(componentUrl(u"LinkButton.qml"_s), uri, 2, 0, "LinkButton"); + qmlRegisterType(componentUrl(u"UrlButton.qml"_s), uri, 2, 0, "UrlButton"); + qmlRegisterType(componentUrl(u"ActionTextField.qml"_s), uri, 2, 0, "ActionTextField"); + qmlRegisterType(componentUrl(u"SearchField.qml"_s), uri, 2, 0, "SearchField"); + qmlRegisterType(componentUrl(u"PasswordField.qml"_s), uri, 2, 0, "PasswordField"); + qmlRegisterType(componentUrl(u"ListSectionHeader.qml"_s), uri, 2, 0, "ListSectionHeader"); + qmlRegisterType(componentUrl(u"PagePoolAction.qml"_s), uri, 2, 0, "PagePoolAction"); + qmlRegisterType(componentUrl(u"PlaceholderMessage.qml"_s), uri, 2, 0, "PlaceholderMessage"); + qmlRegisterType(componentUrl(u"FlexColumn.qml"_s), uri, 2, 0, "FlexColumn"); + qmlRegisterType(componentUrl(u"AboutItem.qml"_s), uri, 2, 0, "AboutItem"); + qmlRegisterType(componentUrl(u"NavigationTabBar.qml"_s), uri, 2, 0, "NavigationTabBar"); + qmlRegisterType(componentUrl(u"NavigationTabButton.qml"_s), uri, 2, 0, "NavigationTabButton"); + qmlRegisterType(componentUrl(u"Chip.qml"_s), uri, 2, 0, "Chip"); + qmlRegisterType(componentUrl(u"LoadingPlaceholder.qml"_s), uri, 2, 0, "LoadingPlaceholder"); + qmlRegisterType(componentUrl(u"SelectableLabel.qml"_s), uri, 2, 0, "SelectableLabel"); + qmlRegisterType(componentUrl(u"InlineViewHeader.qml"_s), uri, 2, 0, "InlineViewHeader"); + qmlRegisterType(componentUrl(u"ContextualHelpButton.qml"_s), uri, 2, 0, "ContextualHelpButton"); +} + +void KirigamiControlsPlugin::initializeEngine(QQmlEngine *engine, const char *uri) +{ + Q_UNUSED(uri); + connect(this, &KirigamiControlsPlugin::languageChangeEvent, engine, &QQmlEngine::retranslate); +} + +#ifdef KIRIGAMI_BUILD_TYPE_STATIC +KirigamiControlsPlugin &KirigamiControlsPlugin::getInstance() +{ + static KirigamiControlsPlugin instance; + return instance; +} + +void KirigamiControlsPlugin::registerTypes(QQmlEngine *engine) +{ + if (engine) { + engine->addImportPath(QLatin1String(":/")); + } else { + qCWarning(KirigamiControlsLog) + << "Registering Kirigami on a null QQmlEngine instance - you likely want to pass a valid engine, or you will want to manually add the " + "qrc root path :/ to your import paths list so the engine is able to load the plugin"; + } +} +#endif + +#include "kirigamicontrolsplugin.moc" +#include "moc_kirigamicontrolsplugin.cpp" diff --git a/local/recipes/kde/kirigami/source/src/controls/kirigamicontrolsplugin.h b/local/recipes/kde/kirigami/source/src/controls/kirigamicontrolsplugin.h new file mode 100644 index 0000000000..f29dc1a49b --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/controls/kirigamicontrolsplugin.h @@ -0,0 +1,36 @@ +/* + * SPDX-FileCopyrightText: 2026 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#ifndef KIRIGAMICONTROLSPLUGIN_H +#define KIRIGAMICONTROLSPLUGIN_H + +#include +#include +#include + +class KirigamiControlsPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") + +public: + KirigamiControlsPlugin(QObject *parent = nullptr); + void registerTypes(const char *uri) override; + void initializeEngine(QQmlEngine *engine, const char *uri) override; + +#ifdef KIRIGAMI_BUILD_TYPE_STATIC + static KirigamiControlsPlugin &getInstance(); + static void registerTypes(QQmlEngine *engine = nullptr); +#endif + +Q_SIGNALS: + void languageChangeEvent(); + +private: + QUrl componentUrl(const QString &fileName) const; +}; + +#endif diff --git a/local/recipes/kde/kirigami/source/src/controls/pagepool.cpp b/local/recipes/kde/kirigami/source/src/controls/pagepool.cpp new file mode 100644 index 0000000000..017b4e0a3b --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/controls/pagepool.cpp @@ -0,0 +1,305 @@ +/* + * SPDX-FileCopyrightText: 2019 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#include "pagepool.h" + +#include +#include +#include +#include +#include + +#include "loggingcategory.h" + +PagePool::PagePool(QObject *parent) + : QObject(parent) +{ +} + +PagePool::~PagePool() +{ + for (QQmlComponent *component : std::as_const(m_componentForUrl)) { + component->deleteLater(); + } + m_componentForUrl.clear(); + + for (QQuickItem *item : std::as_const(m_itemForUrl)) { + if (!item->parentItem()) { + item->deleteLater(); + } else { + QQmlEngine::setObjectOwnership(item, QQmlEngine::JavaScriptOwnership); + } + } + m_itemForUrl.clear(); +} + +QUrl PagePool::lastLoadedUrl() const +{ + return m_lastLoadedUrl; +} + +QQuickItem *PagePool::lastLoadedItem() const +{ + return m_lastLoadedItem; +} + +QList PagePool::items() const +{ + return m_itemForUrl.values(); +} + +QList PagePool::urls() const +{ + return m_urlForItem.values(); +} + +void PagePool::setCachePages(bool cache) +{ + if (cache == m_cachePages) { + return; + } + + if (cache) { + clear(); + } + + m_cachePages = cache; + Q_EMIT cachePagesChanged(); +} + +bool PagePool::cachePages() const +{ + return m_cachePages; +} + +QQuickItem *PagePool::loadPage(const QString &url, QJSValue callback) +{ + return loadPageWithProperties(url, QVariantMap(), callback); +} + +QQuickItem *PagePool::allocatePage(QQmlComponent *component, const QVariantMap &properties) +{ + const auto ctx = qmlContext(this); + Q_ASSERT(ctx); + + QObject *obj = component->createWithInitialProperties(properties, ctx); + + if (!obj || component->isError()) { + qCWarning(KirigamiControlsLog) << component->errors(); + if (obj) { + obj->deleteLater(); + } + return nullptr; + } + + QQuickItem *item = qobject_cast(obj); + if (!item) { + qCWarning(KirigamiControlsLog) << "Storing Non-QQuickItem in PagePool not supported"; + obj->deleteLater(); + return nullptr; + } + + if (m_cachePages) { + QQmlEngine::setObjectOwnership(item, QQmlEngine::CppOwnership); + m_itemForUrl[component->url()] = item; + m_urlForItem[item] = component->url(); + Q_EMIT itemsChanged(); + Q_EMIT urlsChanged(); + + } else { + QQmlEngine::setObjectOwnership(item, QQmlEngine::JavaScriptOwnership); + } + + m_lastLoadedUrl = component->url(); + m_lastLoadedItem = item; + Q_EMIT lastLoadedUrlChanged(); + Q_EMIT lastLoadedItemChanged(); + + return item; +} + +QQuickItem *PagePool::loadPageWithProperties(const QString &url, const QVariantMap &properties, QJSValue callback) +{ + const auto engine = qmlEngine(this); + Q_ASSERT(engine); + + const QUrl actualUrl = resolvedUrl(url); + + auto found = m_itemForUrl.find(actualUrl); + if (found != m_itemForUrl.end()) { + m_lastLoadedUrl = found.key(); + m_lastLoadedItem = found.value(); + + if (callback.isCallable()) { + QJSValueList args = {engine->newQObject(found.value())}; + callback.call(args); + Q_EMIT lastLoadedUrlChanged(); + Q_EMIT lastLoadedItemChanged(); + // We could return the item, but for api coherence return null + return nullptr; + + } else { + Q_EMIT lastLoadedUrlChanged(); + Q_EMIT lastLoadedItemChanged(); + return found.value(); + } + } + + // Note component->url() and actualUrl will be the same. + QQmlComponent *&component = m_componentForUrl[actualUrl]; + if (!component) { + component = new QQmlComponent(engine, actualUrl, QQmlComponent::PreferSynchronous); + } + + if (component->status() == QQmlComponent::Loading) { + if (!callback.isCallable()) { + component->deleteLater(); + m_componentForUrl.remove(component->url()); + return nullptr; + } + + connect(component, &QQmlComponent::statusChanged, this, [this, engine, component, callback, properties](QQmlComponent::Status status) mutable { + if (status != QQmlComponent::Ready) { + qCWarning(KirigamiControlsLog) << component->errors(); + m_componentForUrl.remove(component->url()); + component->deleteLater(); + return; + } + + QQuickItem *item = allocatePage(component, properties); + if (item) { + QJSValueList args = {engine->newQObject(item)}; + callback.call(args); + } + }); + + return nullptr; + + } else if (component->status() != QQmlComponent::Ready) { + qCWarning(KirigamiControlsLog) << component->errors(); + return nullptr; + } + + QQuickItem *item = allocatePage(component, properties); + if (!item) { + return nullptr; + } + + if (callback.isCallable()) { + QJSValueList args = {engine->newQObject(item)}; + callback.call(args); + // We could return the item, but for api coherence return null + return nullptr; + } + return item; +} + +QUrl PagePool::resolvedUrl(const QString &stringUrl) const +{ + const auto ctx = qmlContext(this); + Q_ASSERT(ctx); + + QUrl actualUrl(stringUrl); + if (actualUrl.scheme().isEmpty()) { + actualUrl = ctx->resolvedUrl(actualUrl); + } + return actualUrl; +} + +bool PagePool::isLocalUrl(const QUrl &url) +{ + return url.isLocalFile() || url.scheme().isEmpty() || url.scheme() == QStringLiteral("qrc"); +} + +QUrl PagePool::urlForPage(QQuickItem *item) const +{ + return m_urlForItem.value(item); +} + +QQuickItem *PagePool::pageForUrl(const QUrl &url) const +{ + return m_itemForUrl.value(resolvedUrl(url.toString()), nullptr); +} + +bool PagePool::contains(const QVariant &page) const +{ + if (page.canConvert()) { + return m_urlForItem.contains(page.value()); + + } else if (page.canConvert()) { + const QUrl actualUrl = resolvedUrl(page.value()); + return m_itemForUrl.contains(actualUrl); + + } else { + return false; + } +} + +void PagePool::deletePage(const QVariant &page) +{ + if (!contains(page)) { + return; + } + + QQuickItem *item; + if (page.canConvert()) { + item = page.value(); + } else if (page.canConvert()) { + QString url = page.value(); + if (url.isEmpty()) { + return; + } + const QUrl actualUrl = resolvedUrl(page.value()); + + item = m_itemForUrl.value(actualUrl); + } else { + return; + } + + if (!item) { + return; + } + + const QUrl url = m_urlForItem.value(item); + + if (url.isEmpty()) { + return; + } + + m_itemForUrl.remove(url); + m_urlForItem.remove(item); + item->deleteLater(); + + Q_EMIT itemsChanged(); + Q_EMIT urlsChanged(); +} + +void PagePool::clear() +{ + for (const auto &component : std::as_const(m_componentForUrl)) { + component->deleteLater(); + } + m_componentForUrl.clear(); + + for (const auto &item : std::as_const(m_itemForUrl)) { + // items that had been deparented are safe to delete + if (!item->parentItem()) { + item->deleteLater(); + } + QQmlEngine::setObjectOwnership(item, QQmlEngine::JavaScriptOwnership); + } + m_itemForUrl.clear(); + m_urlForItem.clear(); + m_lastLoadedUrl = QUrl(); + m_lastLoadedItem = nullptr; + + Q_EMIT lastLoadedUrlChanged(); + Q_EMIT lastLoadedItemChanged(); + Q_EMIT itemsChanged(); + Q_EMIT urlsChanged(); +} + +#include "moc_pagepool.cpp" diff --git a/local/recipes/kde/kirigami/source/src/controls/pagepool.h b/local/recipes/kde/kirigami/source/src/controls/pagepool.h new file mode 100644 index 0000000000..62205b615f --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/controls/pagepool.h @@ -0,0 +1,164 @@ +/* + * SPDX-FileCopyrightText: 2019 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ +#pragma once + +#include +#include +#include + +/*! + * \qmltype PagePool + * \inqmlmodule org.kde.kirigami + * + * \brief A pool of Page items. + * + * Pages will be unique per url and the items + * will be kept around unless explicitly deleted. + * + * Instances are C++ owned and can be deleted only manually using deletePage(). + * + * Instance are unique per url: if you need 2 different instances for a page + * url, you should instantiate them in the traditional way + * or use a different PagePool instance. + * + * \sa PagePoolAction + */ +class PagePool : public QObject +{ + Q_OBJECT + QML_ELEMENT + /*! + * \qmlproperty url PagePool::lastLoadedUrl + * + * The last url that was loaded with loadPage. Useful if you need + * to have a "checked" state to buttons or list items that + * load the page when clicked. + */ + Q_PROPERTY(QUrl lastLoadedUrl READ lastLoadedUrl NOTIFY lastLoadedUrlChanged FINAL) + + /*! + * \qmlproperty Item PagePool::lastLoadedItem + * + * The last item that was loaded with loadPage. + */ + Q_PROPERTY(QQuickItem *lastLoadedItem READ lastLoadedItem NOTIFY lastLoadedItemChanged FINAL) + + /*! + * \qmlproperty list PagePool::items + * + * All items loaded/managed by the PagePool. + * \since 5.84 + */ + Q_PROPERTY(QList items READ items NOTIFY itemsChanged FINAL) + + /*! + * \qmlproperty list PagePool::urls + * + * All page URLs loaded/managed by the PagePool. + * \since 5.84 + */ + Q_PROPERTY(QList urls READ urls NOTIFY urlsChanged FINAL) + + /*! + * \qmlproperty bool PagePool::cachePages + * + * If \c true (default) the pages will be kept around, will have C++ ownership and + * only one instance per page will be created. + * If \c false the pages will have Javascript ownership (thus deleted on pop by the + * page stacks) and each call to loadPage will create a new page instance. When + * cachePages is false, Components get cached nevertheless. + */ + Q_PROPERTY(bool cachePages READ cachePages WRITE setCachePages NOTIFY cachePagesChanged FINAL) + +public: + PagePool(QObject *parent = nullptr); + ~PagePool() override; + + QUrl lastLoadedUrl() const; + QQuickItem *lastLoadedItem() const; + QList items() const; + QList urls() const; + + void setCachePages(bool cache); + bool cachePages() const; + + /*! + * Returns the instance of the item defined in the QML file identified + * by url, only one instance will be made per url if cachePAges is true. + * If the url is remote (i.e. http) don't rely on the return value but + * us the async callback instead. + * + * @param url full url of the item: it can be a well formed Url, an + * absolute path or a relative one to the path of the qml file the + * PagePool is instantiated from + * @param callback If we are loading a remote url, we can't have the + * item immediately but will be passed as a parameter to the provided + * callback. Normally, don't set a callback, use it only in case of + * remote urls + * @returns the page instance that will have been created if necessary. + * If the url is remote it will return null, as well will return null + * if the callback has been provided + */ + Q_INVOKABLE QQuickItem *loadPage(const QString &url, QJSValue callback = QJSValue()); + + Q_INVOKABLE QQuickItem *loadPageWithProperties(const QString &url, const QVariantMap &properties, QJSValue callback = QJSValue()); + + /*! + * @returns The url of the page for the given instance, empty if there is no correspondence + */ + Q_INVOKABLE QUrl urlForPage(QQuickItem *item) const; + + /*! + * @returns The page associated with a given URL, nullptr if there is no correspondence + */ + Q_INVOKABLE QQuickItem *pageForUrl(const QUrl &url) const; + + /*! + * @returns true if the is managed by the PagePool + * @param the page can be either a QQuickItem or an url + */ + Q_INVOKABLE bool contains(const QVariant &page) const; + + /*! + * Deletes the page (only if is managed by the pool. + * @param page either the url or the instance of the page + */ + Q_INVOKABLE void deletePage(const QVariant &page); + + /*! + * @returns full url from an absolute or relative path + */ + Q_INVOKABLE QUrl resolvedUrl(const QString &file) const; + + /*! + * @returns true if the url identifies a local resource (local file or a file inside Qt's resource system). + * False if the url points to a network location + */ + Q_INVOKABLE bool isLocalUrl(const QUrl &url); + + /*! + * Deletes all pages managed by the pool. + */ + Q_INVOKABLE void clear(); + +Q_SIGNALS: + void lastLoadedUrlChanged(); + void lastLoadedItemChanged(); + void itemsChanged(); + void urlsChanged(); + void cachePagesChanged(); + +private: + QQuickItem *allocatePage(QQmlComponent *component, const QVariantMap &properties); + + QUrl m_lastLoadedUrl; + QPointer m_lastLoadedItem; + QHash m_itemForUrl; + QHash m_componentForUrl; + QHash m_urlForItem; + + bool m_cachePages = true; +}; diff --git a/local/recipes/kde/kirigami/source/src/controls/private/PassiveNotificationsManager.qml b/local/recipes/kde/kirigami/source/src/controls/private/PassiveNotificationsManager.qml new file mode 100644 index 0000000000..f01e6766ef --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/controls/private/PassiveNotificationsManager.qml @@ -0,0 +1,282 @@ +/* + * SPDX-FileCopyrightText: 2015 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ +pragma ComponentBehavior: Bound + +import QtQuick +import QtQuick.Controls as QQC2 +import QtQuick.Templates as T +import QtQuick.Layouts +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.primitives as Primitives + +/*! + \brief PassiveNotificatiomodelnManager is meant to display small, passive and inline notifications in the app. + + It is used to show messages of limited importance that make sense only when + the user is using the application and wouldn't be suited as a global + system-wide notification. + \internal +*/ +Item { + id: root + + readonly property int maximumNotificationWidth: { + if (Platform.Settings.isMobile) { + return applicationWindow().width - Platform.Units.largeSpacing * 4 + } else { + return Math.min(Platform.Units.gridUnit * 25, applicationWindow().width / 1.5) + } + } + + readonly property int maximumNotificationCount: 4 + + function showNotification(message, timeout, actionText, callBack) { + if (!message) { + return; + } + + let interval = 7000; + + if (timeout === "short") { + interval = 4000; + } else if (timeout === "long") { + interval = 12000; + } else if (timeout > 0) { + interval = timeout; + } + + // this wrapper is necessary because of Qt casting a function into an object + const callBackWrapperObj = callBackWrapper.createObject(listView, { callBack }) + + // set empty string & function for qml not to complain + notificationsModel.append({ + text: message, + actionButtonText: actionText || "", + closeInterval: interval, + callBackWrapper: callBackWrapperObj + }) + // remove the oldest notification if new notification count would exceed 3 + if (notificationsModel.count === maximumNotificationCount) { + if ((listView.itemAtIndex(0) as T.Control).hovered === true) { + hideNotification(1) + } else { + hideNotification() + } + } + } + + /*! + * \brief Remove a notification at specific index. By default, index is set to 0. + */ + function hideNotification(index = 0) { + if (index >= 0 && notificationsModel.count > index) { + const callBackWrapperObj = notificationsModel.get(index).callBackWrapper + if (callBackWrapperObj) { + callBackWrapperObj.destroy() + } + notificationsModel.remove(index) + } + } + + // we have to set height to show more than one notification + height: Math.min(applicationWindow().height, Platform.Units.gridUnit * 10) + + implicitHeight: listView.implicitHeight + implicitWidth: listView.implicitWidth + + Platform.Theme.inherit: false + Platform.Theme.colorSet: Platform.Theme.Complementary + + ListModel { + id: notificationsModel + } + + ListView { + id: listView + + anchors.fill: parent + anchors.bottomMargin: Platform.Units.largeSpacing + + leftMargin: SafeArea.margins.left + rightMargin: SafeArea.margins.right + topMargin: SafeArea.margins.top + bottomMargin: SafeArea.margins.bottom + + implicitWidth: root.maximumNotificationWidth + spacing: Platform.Units.smallSpacing + model: notificationsModel + verticalLayoutDirection: ListView.BottomToTop + keyNavigationEnabled: false + reuseItems: false // do not reuse items, otherwise delegates do not hide themselves properly + focus: false + interactive: false + + add: Transition { + id: addAnimation + ParallelAnimation { + alwaysRunToEnd: true + NumberAnimation { + property: "opacity" + from: 0 + to: 1 + duration: Platform.Units.longDuration + easing.type: Easing.OutCubic + } + NumberAnimation { + property: "y" + from: addAnimation.ViewTransition.destination.y - Platform.Units.gridUnit * 3 + duration: Platform.Units.longDuration + easing.type: Easing.OutCubic + } + } + } + displaced: Transition { + ParallelAnimation { + alwaysRunToEnd: true + NumberAnimation { + property: "y" + duration: Platform.Units.longDuration + easing.type: Easing.InOutCubic + } + NumberAnimation { + property: "opacity" + duration: Platform.Units.longDuration + to: 1 + } + } + } + remove: Transition { + ParallelAnimation { + alwaysRunToEnd: true + NumberAnimation { + property: "opacity" + from: 1 + to: 0 + duration: Platform.Units.longDuration + easing.type: Easing.InCubic + } + NumberAnimation { + property: "y" + to: Platform.Units.gridUnit * 3 + duration: Platform.Units.longDuration + easing.type: Easing.InCubic + } + PropertyAction { + property: "transformOrigin" + value: Item.Bottom + } + PropertyAnimation { + property: "scale" + from: 1 + to: 0 + duration: Platform.Units.longDuration + easing.type: Easing.InCubic + } + } + } + delegate: QQC2.Control { + id: delegate + + required property int index + required property int closeInterval + required property string text + required property string actionButtonText + required property QtObject callBackWrapper + + hoverEnabled: true + // We force the delegate to be not visible when + // created, as this could cause some flickering + // otherwise; instead, we rely on `add` and + // `displaced` animations to change the opacity. + opacity: Platform.Units.longDuration > 0 ? 0 : 1 + + anchors.horizontalCenter: parent ? parent.horizontalCenter : undefined + width: Math.min(implicitWidth, root.maximumNotificationWidth) + implicitHeight: { + // HACK: contentItem.implicitHeight needs to be updated manually for some reason + void contentItem.implicitHeight; + return Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding); + } + z: { + if (delegate.hovered) { + return 2; + } else if (delegate.index === 0) { + return 1; + } else { + return 0; + } + } + + leftPadding: Platform.Units.largeSpacing + rightPadding: Platform.Units.largeSpacing + topPadding: Platform.Units.largeSpacing + bottomPadding: Platform.Units.largeSpacing + + contentItem: RowLayout { + id: mainLayout + + Platform.Theme.inherit: false + Platform.Theme.colorSet: root.Platform.Theme.colorSet + + spacing: Platform.Units.mediumSpacing + + TapHandler { + acceptedButtons: Qt.LeftButton + onTapped: eventPoint => root.hideNotification(delegate.index) + } + Timer { + id: timer + interval: delegate.closeInterval + running: !delegate.hovered + onTriggered: root.hideNotification(delegate.index) + } + + QQC2.Label { + id: label + text: delegate.text + elide: Text.ElideRight + wrapMode: Text.Wrap + Layout.fillWidth: true + Layout.alignment: Qt.AlignVCenter + } + + QQC2.Button { + id: actionButton + text: delegate.actionButtonText + visible: text.length > 0 + Layout.alignment: Qt.AlignVCenter + onClicked: { + const callBack = delegate.callBackWrapper.callBack + root.hideNotification(delegate.index) + if (callBack && (typeof callBack === "function")) { + callBack(); + } + } + } + } + background: Primitives.ShadowedRectangle { + Platform.Theme.inherit: false + Platform.Theme.colorSet: root.Platform.Theme.colorSet + shadow { + size: Platform.Units.gridUnit/2 + color: Qt.rgba(0, 0, 0, 0.4) + yOffset: 2 + } + radius: Platform.Units.cornerRadius + color: Platform.Theme.backgroundColor + opacity: 0.9 + } + } + } + Component { + id: callBackWrapper + QtObject { + property var callBack + } + } +} + diff --git a/local/recipes/kde/kirigami/source/src/controls/private/globaltoolbar/HandleButton.qml b/local/recipes/kde/kirigami/source/src/controls/private/globaltoolbar/HandleButton.qml new file mode 100644 index 0000000000..7bcb5b9ba9 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/controls/private/globaltoolbar/HandleButton.qml @@ -0,0 +1,89 @@ +/* + * SPDX-FileCopyrightText: 2018 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Controls as QQC +import org.kde.kirigami.controls as KC +import org.kde.kirigami.templates as KT +import "../" as P + +P.PrivateActionToolButton { + id: root + property KT.OverlayDrawer drawer + + icon.name: drawer?.position === 1 ? (drawer?.handleOpenIcon.name ?? "") : (drawer?.handleClosedIcon.name ?? "") + icon.source: drawer?.position === 1 ? (drawer?.handleOpenIcon.source ?? "") : (drawer?.handleClosedIcon.source ?? "") + + action: KC.Action { + children: root.drawer && (root.drawer as KC.GlobalDrawer)?.isMenu ? (root.drawer as KC.GlobalDrawer).actions : [] + tooltip: { + if (root.drawer && (root.drawer as KC.GlobalDrawer)?.isMenu) { + return checked ? qsTr("Close menu") : qsTr("Open menu"); + } + + return (root.QQC.ApplicationWindow.window as KC.ApplicationWindow)?.globalDrawer?.handleClosedToolTip || "" + } + } + + onClicked: { + if (!drawer || (root.drawer as KC.GlobalDrawer)?.isMenu) { + return; + } + if (drawer.visible) { + drawer.close(); + } else { + // CallLater is necessary for when the DragHandler still had grab + Qt.callLater(drawer.open); + } + } + + Connections { + // Only target the GlobalDrawer when it *is* a GlobalDrawer, since + // it can be something else, and that something else probably + // doesn't have an isMenuChanged() signal. + target: root.drawer as KC.GlobalDrawer + function onIsMenuChanged() { + if (!(root.drawer as KC.GlobalDrawer).isMenu && root.menu) { + root.menu.dismiss() + } + } + } + + + DragHandler { + target: null + acceptedDevices: PointerDevice.TouchScreen + xAxis { + enabled: root.drawer && (root.drawer.edge === Qt.LeftEdge || root.drawer.edge === Qt.RightEdge) + minimum: 0 + maximum: root.drawer?.contentItem.width ?? 0 + onActiveValueChanged: (delta) => { + let positionDelta = delta / root.drawer.contentItem.width; + if (root.drawer.edge === Qt.RightEdge) { + positionDelta *= -1; + } + root.drawer.position += positionDelta; + } + } + yAxis.enabled: false + onGrabChanged: (transition, point) => { + switch (transition) { + case PointerDevice.GrabExclusive: + case PointerDevice.GrabPassive: + root.drawer.peeking = true; + break; + case PointerDevice.UngrabExclusive: + case PointerDevice.UngrabPassive: + case PointerDevice.CancelGrabExclusive: + case PointerDevice.CancelGrabPassive: + root.drawer.peeking = false; + break; + default: + break; + } + } + } +} diff --git a/local/recipes/kde/kirigami/source/src/controls/private/globaltoolbar/NavigationButtons.qml b/local/recipes/kde/kirigami/source/src/controls/private/globaltoolbar/NavigationButtons.qml new file mode 100644 index 0000000000..54c64be47a --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/controls/private/globaltoolbar/NavigationButtons.qml @@ -0,0 +1,130 @@ +/* + * SPDX-FileCopyrightText: 2025 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ +pragma ComponentBehavior: Bound + +import QtQuick +import QtQuick.Controls as QQC +import QtQml +import QtQuick.Layouts +import org.kde.kirigami.controls as KC +import org.kde.kirigami.layouts as KL +import org.kde.kirigami.platform as Platform + +Loader { + id: root + + required property Item page + required property KC.PageRow pageStack + + active: { + if (!pageStack) { + return false; + } + + // We are in a layer, show buttons + // page can be null when the nav buttons are in the breadcrumbs header + if (page && page.QQC.StackView.view) { + return true; + } + + // The application doesn't want nav buttons + if (pageStack.globalToolBar.showNavigationButtons === KC.ApplicationHeaderStyle.NoNavigationButtons) { + return false + } + + //Don't show back button on pinned pages + if (page.KL.ColumnView.pinned && pageStack.columnView.columnResizeMode !== KL.ColumnView.SingleColumn) { + return false; + } + + const leadingPinned = page?.KL.ColumnView.view?.leadingVisibleItem?.KL.ColumnView.pinned && pageStack.columnView.columnResizeMode !== KL.ColumnView.SingleColumn + ? page.KL.ColumnView.view.leadingVisibleItem + : null; + const leadingPinnedWidth = leadingPinned?.width ?? 0 + const firstIndex = leadingPinned ? leadingPinned.KL.ColumnView.index + 1 : 0 + + // If we are on the first page and we don't want to show the forward button, don't + // show the back button either + if (!(pageStack.globalToolBar.showNavigationButtons & KC.ApplicationHeaderStyle.ShowForwardButton) && + page.KL.ColumnView.index === firstIndex) { + return false; + } + + // If we are in single page mode, always show if depth > 1 + if (pageStack.columnView.columnResizeMode === KL.ColumnView.SingleColumn) { + return pageStack.depth > 1; + } + + // Condition: the contents have to be bigger than what the ColumnView can show + // The gridUnit wiggle room is used to not flicker the button visibility during an animated resize for instance due to a sidebar collapse + const overflows = pageStack.columnView.contentWidth > pageStack.columnView.width + Platform.Units.gridUnit; + + // Index will be 0 at the first page in the row, -1 in a page belonging to a layer + if (!page || page.KL.ColumnView.index <= firstIndex) { + return overflows || pageStack.columnView.contentX > 0; + } + + // Condition: the page previous of this one is at least half scrolled away + const previousPage = pageStack.get(page.KL.ColumnView.index - 1); + let firstVisible = false; + if (LayoutMirroring.enabled) { + firstVisible = pageStack.width - (page.x + page.width - pageStack.columnView.contentX - leadingPinnedWidth) < previousPage.width / 2; + } else { + firstVisible = previousPage.x - pageStack.columnView.contentX - leadingPinnedWidth < -previousPage.width / 2; + } + + return overflows && firstVisible; + } + + visible: active + + sourceComponent: RowLayout { + id: layout + + spacing: Platform.Units.smallSpacing + + component NavButton: QQC.ToolButton { + id: navButton + display: QQC.ToolButton.IconOnly + + QQC.ToolTip { + visible: navButton.hovered + text: navButton.text + delay: Platform.Units.toolTipDelay + y: parent.height + } + } + NavButton { + icon.name: (LayoutMirroring.enabled ? "go-previous-symbolic-rtl" : "go-previous-symbolic") + text: qsTr("Navigate Back") + enabled: { + let isScrolled = !LayoutMirroring.enabled ? root.pageStack.columnView.contentX > 0 + : root.pageStack.columnView.contentWidth - root.pageStack.columnView.contentX !== root.pageStack.columnView.width + return root.page.QQC.StackView.view || (root.pageStack.depth > 1 && isScrolled); + } + visible: root.page.QQC.StackView.view || root.pageStack.globalToolBar.showNavigationButtons & KC.ApplicationHeaderStyle.ShowBackButton + onClicked: { + // When we are in a layer, pressing back doesn't change the index on the main ColumnView + if (!root.page.QQC.StackView.view) { + root.pageStack.currentIndex = root.page.KL.ColumnView.index; + } + root.pageStack.goBack(); + } + } + NavButton { + icon.name: (LayoutMirroring.enabled ? "go-next-symbolic-rtl" : "go-next-symbolic") + text: qsTr("Navigate Forward") + enabled: root.pageStack.currentIndex < root.pageStack.depth - 1 + // Visible when the application enabled it *and* we are not in a layer + visible: !root.page.QQC.StackView.view && root.pageStack.globalToolBar.showNavigationButtons & KC.ApplicationHeaderStyle.ShowForwardButton + onClicked: { + root.pageStack.currentIndex = root.page.KL.ColumnView.index; + root.pageStack.goForward(); + } + } + } +} + diff --git a/local/recipes/kde/kirigami/source/src/delegates/TitleSubtitleWithActions.qml b/local/recipes/kde/kirigami/source/src/delegates/TitleSubtitleWithActions.qml new file mode 100644 index 0000000000..209201864c --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/delegates/TitleSubtitleWithActions.qml @@ -0,0 +1,161 @@ +/* + * SPDX-FileCopyrightText: 2010 Marco Martin + * SPDX-FileCopyrightText: 2022 ivan tkachenko + * SPDX-FileCopyrightText: 2023 Arjen Hiemstra + * SPDX-FileCopyrightText: 2025 Akseli Lahtinen + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Templates as T +import QtQuick.Layouts +import org.kde.kirigami.controls as KirigamiControls +import org.kde.kirigami.platform as Platform + +/*! +\qmltype TitleSubtitleWithActions +\inqmlmodule org.kde.kirigami.delegates + +\brief A simple title delegate that has trailing actions. + +This is meant to be used in lists for items that have actions. +For example lists of usernames, with any related actions after them, +such as rename and delete actions. + +Example usage as contentItem of an ItemDelegate: + +\qml +ItemDelegate { + id: itemDelegate + icon: "user" + text: i18nc("@title:row", "Konqi") + readonly property string subtitle: i18nc("@label", "The Konqueror") + Accessible.description: subtitle + Kirigami.Theme.useAlternateBackgroundColor: true + + onClicked: [...] + + contentItem: Kirigami.TitleSubtitleWithActions { + title: itemDelegate.title + subtitle: itemDelegate.subtitle + elide: Text.ElideRight + selected: itemDelegate.pressed || itemDelegate.highlighted + actions: [ + Kirigami.Action { + icon.name: "edit-entry-symbolic" + text: i18nc("@action:button", "Modify user…") + onTriggered: [...] + tooltip: text + }, + Kirigami.Action { + icon.name: "edit-delete-remove-symbolic" + text: i18nc("@action:button", "Remove user…") + onTriggered: [...] + tooltip: text + displayHint: Kirigami.DisplayHint.IconOnly + } + ] + } +} +\endqml + +\sa IconTitleSubtitle +\sa TitleSubtitle +\sa ActionToolBar +\since 6.22 +*/ + +Item { + id: root + + /*! + \qmlproperty list TitleSubtitleWithActions::actions + + \brief This property holds a list of visible actions. + + These actions will be given to ActionToolBar. + To make an action be icons-only, set + \c displayHint: Kirigami.DisplayHint.IconOnly on it. + + Empty by default, so no actions will be present. + + \sa ActionToolBar + */ + property list actions + + /*! + The title to display. + */ + required property string title + + /*! + The subtitle to display. + + default: Empty \c string, so no subtitle is shown + */ + property string subtitle + + /*! + Should this item be displayed in a selected style? + + default: \c false + */ + property bool selected: false + + /*! + The text elision mode used for both the title and subtitle. + \qmlproperty enumeration TitleSubtitleWithActions::elide + + default: \c Text.ElideRight + */ + property int elide: Text.ElideRight + + /*! + This property determines how the icon and text are displayed within the button. + \qmlproperty enumeration TitleSubtitleWithActions::displayHint + + Permitted values are: + \list + \li Button.IconOnly + \li Button.TextOnly + \li Button.TextBesideIcon + \li Button.TextUnderIcon + \endlist + + default: \c Button.TextBesideIcon + + \sa ActionToolBar + \sa AbstractButton + */ + property alias displayHint: actionToolBar.display + + implicitWidth: layout.implicitWidth + implicitHeight: layout.implicitHeight + + RowLayout { + id: layout + anchors.fill: root + spacing: Platform.Units.smallSpacing + + TitleSubtitle { + id: titleSubtitle + Layout.fillWidth: true + Layout.maximumWidth: Math.ceil(implicitWidth) + Layout.alignment: Qt.AlignLeft + title: root.title + subtitle: root.subtitle + elide: root.elide + selected: root.selected + } + + KirigamiControls.ActionToolBar { + id: actionToolBar + Layout.fillWidth: true + Layout.fillHeight: true + actions: root.actions + alignment: Qt.AlignRight + flat: false + } + } +} diff --git a/local/recipes/kde/kirigami/source/src/dialogs/DialogHeader.qml b/local/recipes/kde/kirigami/source/src/dialogs/DialogHeader.qml new file mode 100644 index 0000000000..9ad01ef98b --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/dialogs/DialogHeader.qml @@ -0,0 +1,83 @@ +/* + SPDX-FileCopyrightText: 2021 Devin Lin + SPDX-FileCopyrightText: 2021 Noah Davis + SPDX-FileCopyrightText: 2022 ivan tkachenko + SPDX-FileCopyrightText: 2025 Nate Graham + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + */ +pragma ComponentBehavior: Bound + +import QtQuick +import QtQuick.Templates as T +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.primitives as Primitives +import org.kde.kirigami.dialogs as KDialogs + +/*! + \qmltype DialogHeader + \inqmlmodule org.kde.kirigami.dialogs + + \brief Base for a header, to be used as the header: item of a Dialog. + + Provides appropriate padding and a bottom separator when the dialog's content + is scrollable. + + Chiefly useful as the base element of a custom header. Example usage for this: + + \qml + import QtQuick + import org.kde.kirigami as Kirigami + import org.kde.kirigami.dialogs as KD + + Kirigami.Dialog { + id: myDialog + + title: i18n("My Dialog") + + standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel + + header: KDialogs.DialogHeader { + dialog: myDialog + contentItem: [...] + } + [...] + } + \endqml + */ +T.Control { + id: root + + /*! + \qmlproperty Dialog DialogHeader::dialog + This property points to the parent dialog, some of whose properties + need to be available here. + */ + required property T.Dialog dialog + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + padding: Platform.Units.largeSpacing + bottomPadding: verticalPadding + headerSeparator.implicitHeight // add space for bottom separator + + // Bottom separator shown when content is scrollable + background: Item { + Primitives.Separator { + id: headerSeparator + width: parent.width + anchors.bottom: parent.bottom + visible: if (root.dialog.contentItem instanceof T.Pane || root.dialog.contentItem instanceof Flickable) { + const itemContentHeight = (root.dialog.contentItem as T.Pane)?.contentHeight ?? (root.dialog.contentItem as Flickable)?.contentHeight + return root.dialog.contentItem.height < itemContentHeight; + } else { + return false; + } + } + } + + contentItem: KDialogs.DialogHeaderTopContent { + dialog: root.dialog + } +} diff --git a/local/recipes/kde/kirigami/source/src/dialogs/DialogHeaderTopContent.qml b/local/recipes/kde/kirigami/source/src/dialogs/DialogHeaderTopContent.qml new file mode 100644 index 0000000000..4e0e1b75ab --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/dialogs/DialogHeaderTopContent.qml @@ -0,0 +1,110 @@ +/* + SPDX-FileCopyrightText: 2021 Devin Lin + SPDX-FileCopyrightText: 2021 Noah Davis + SPDX-FileCopyrightText: 2022 ivan tkachenko + SPDX-FileCopyrightText: 2025 Nate Graham + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + */ + +import QtQuick +import QtQuick.Layouts +import QtQuick.Templates as T +import QtQuick.Controls as QQC2 +import org.kde.kirigami.controls as KirigamiControls +import org.kde.kirigami.platform as Platform + +/*! + \qmltype DialogHeaderTopContent + \inqmlmodule org.kde.kirigami.dialogs + + \brief Standard top content for a Dialog, including header text and an + optional close button. + + Provides appropriate padding and a bottom separator when the dialog's content + is scrollable. + + Chiefly useful as the first item in a `ColumnLayout` inside a custom header, + for when you want a custom header that only consists of extra content, and + does not need to override the standard content. Example usage for a this: + + \qml + import QtQuick + import QtQuick.Layouts + import org.kde.kirigami as Kirigami + import org.kde.kirigami.dialogs as KDialogs + + Kirigami.Dialog { + id: myDialog + + title: i18n("My Dialog") + + standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel + + header: KDialogs.DialogHeader { + dialog: myDialog + + contentItem: ColumnLayout { + Spacing: Kirigami.Units.smallSpacing + + KDialogs.DialogHeaderTopContent { + dialog: myDialog + } + + [...] + } + } + [...] + } + \endqml + */ +RowLayout { + id: root + + /*! + \qmlproperty Dialog DialogHeaderTopContent::dialog + + This property points to the parent dialog, some of whose properties + need to be available here. + */ + required property T.Dialog dialog + + /*! + \qmlproperty bool DialogHeaderTopContent::showCloseButton + + Whether the close button should be visible. + + Defaults to \c true. + */ + property alias showCloseButton: closeButton.visible + + spacing: Platform.Units.smallSpacing + + KirigamiControls.Heading { + Layout.fillWidth: true + Layout.alignment: Qt.AlignVCenter + + text: root.dialog.title.length === 0 ? " " : root.dialog.title // always have text to ensure header height + textFormat: Text.PlainText + elide: Text.ElideRight + + // use tooltip for long text that is elided + QQC2.ToolTip.visible: truncated && titleHoverHandler.hovered + QQC2.ToolTip.text: root.dialog.title + + HoverHandler { + id: titleHoverHandler + } + } + + QQC2.ToolButton { + id: closeButton + Layout.alignment: Qt.AlignRight | Qt.AlignTop + + icon.name: hovered ? "window-close" : "window-close-symbolic" + text: qsTr("Close", "@action:button close dialog") + display: QQC2.AbstractButton.IconOnly + visible: (root.dialog as Dialog)?.showCloseButton ?? true + + onClicked: root.dialog.reject() + } +} diff --git a/local/recipes/kde/kirigami/source/src/forms/CMakeLists.txt b/local/recipes/kde/kirigami/source/src/forms/CMakeLists.txt new file mode 100644 index 0000000000..eccc1782f0 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/CMakeLists.txt @@ -0,0 +1,148 @@ +add_library(KirigamiFormsPrivateTemplates) +ecm_add_qml_module(KirigamiFormsPrivateTemplates URI "org.kde.kirigami.forms.private.templates" + VERSION 2.0 + GENERATE_PLUGIN_SOURCE + INSTALLED_PLUGIN_TARGET KF6KirigamiFormsPrivateTemplatesplugin + DEPENDENCIES + QtQuick + TARGET KirigamiPlatform + TARGET KirigamiPrimitives + TARGET KirigamiLayouts +) + +set_target_properties(KirigamiFormsPrivateTemplates PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION 6 + EXPORT_NAME "KirigamiFormsPrivateTemplates" +) + +ecm_target_qml_sources(KirigamiFormsPrivateTemplates SOURCES + templates/FormAction.qml + templates/FormEntry.qml + templates/FormGroup.qml + templates/Form.qml + templates/FormSeparator.qml +) + +add_library(KirigamiFormsPrivateFlat) +ecm_add_qml_module(KirigamiFormsPrivateFlat URI "org.kde.kirigami.forms.private.flat" + VERSION 2.0 + GENERATE_PLUGIN_SOURCE + INSTALLED_PLUGIN_TARGET KF6KirigamiFormsPrivateFlatplugin + DEPENDENCIES + QtQuick + TARGET KirigamiPlatform + TARGET KirigamiPrimitives + TARGET KirigamiLayouts +) + +set_target_properties(KirigamiFormsPrivateFlat PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION 6 + EXPORT_NAME "KirigamiFormsPrivateFlat" +) + +ecm_target_qml_sources(KirigamiFormsPrivateFlat SOURCES + flat/FormAction.qml + flat/FormEntry.qml + flat/FormGroup.qml + flat/Form.qml + flat/FormSeparator.qml +) + +add_library(KirigamiFormsPrivateCards) +ecm_add_qml_module(KirigamiFormsPrivateCards URI "org.kde.kirigami.forms.private.cards" + VERSION 2.0 + GENERATE_PLUGIN_SOURCE + INSTALLED_PLUGIN_TARGET KF6KirigamiFormsPrivateCardsplugin + DEPENDENCIES + QtQuick + TARGET KirigamiPlatform + TARGET KirigamiPrimitives + TARGET KirigamiLayouts +) + +set_target_properties(KirigamiFormsPrivateCards PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION 6 + EXPORT_NAME "KirigamiFormsPrivateCards" +) + +ecm_target_qml_sources(KirigamiFormsPrivateCards SOURCES + cards/FormAction.qml + cards/FormEntry.qml + cards/FormGroup.qml + cards/Form.qml + cards/FormSeparator.qml +) + +add_library(KirigamiForms) + +ecm_add_qml_module(KirigamiForms URI "org.kde.kirigami.forms" VERSION 2.0 + CLASS_NAME KirigamiFormsPlugin + INSTALLED_PLUGIN_TARGET KF6KirigamiFormsplugin + DEPENDENCIES + "QtQuick.Controls" + TARGET KirigamiPlatform + TARGET KirigamiPrimitives + TARGET KirigamiLayouts + TARGET KirigamiFormsPrivateTemplates + OPTIONAL_IMPORTS + TARGET KirigamiFormsPrivateFlat + TARGET KirigamiFormsPrivateCards + DEFAULT_IMPORTS TARGET KirigamiFormsPrivateFlat +) + +set_target_properties(KirigamiForms PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION 6 + EXPORT_NAME "KirigamiForms" +) + +target_sources(KirigamiForms PRIVATE + formalignmentgroup.cpp +) + +target_sources(KirigamiFormsplugin PRIVATE + kirigamiformsplugin.cpp + kirigamiformsplugin.h +) + +if (NOT BUILD_SHARED_LIBS) + # Ensure we install the plugin library file as that's required to link + # against for static builds to work properly + target_link_libraries(KirigamiFormsplugin + PRIVATE + KirigamiFormsPrivateTemplatesplugin + KirigamiFormsPrivateFlatplugin + KirigamiFormsPrivateCardsplugin + Qt6::Qml + Qt6::Quick + ) + target_link_libraries(KirigamiForms + PRIVATE + Qt6::Qml + Qt6::Quick + ) + # for tests to find this under the name it's actually installed with' + add_library(KF6KirigamiFormsplugin ALIAS KirigamiFormsplugin) +else() + target_link_libraries(KirigamiForms + PRIVATE + KirigamiFormsPrivateTemplates + KirigamiFormsPrivateFlat + KirigamiFormsPrivateCards + Qt6::Qml + Qt6::Quick + ) +endif() + +ecm_finalize_qml_module(KirigamiFormsPrivateTemplates DESTINATION ${KDE_INSTALL_QMLDIR} EXPORT KirigamiTargets) +ecm_finalize_qml_module(KirigamiFormsPrivateFlat DESTINATION ${KDE_INSTALL_QMLDIR} EXPORT KirigamiTargets) +ecm_finalize_qml_module(KirigamiFormsPrivateCards DESTINATION ${KDE_INSTALL_QMLDIR} EXPORT KirigamiTargets) +ecm_finalize_qml_module(KirigamiForms DESTINATION ${KDE_INSTALL_QMLDIR} EXPORT KirigamiTargets) + +install(TARGETS KirigamiFormsPrivateTemplates EXPORT KirigamiTargets ${KF_INSTALL_DEFAULT_ARGUMENTS}) +install(TARGETS KirigamiFormsPrivateFlat EXPORT KirigamiTargets ${KF_INSTALL_DEFAULT_ARGUMENTS}) +install(TARGETS KirigamiFormsPrivateCards EXPORT KirigamiTargets ${KF_INSTALL_DEFAULT_ARGUMENTS}) +install(TARGETS KirigamiForms EXPORT KirigamiTargets ${KF_INSTALL_DEFAULT_ARGUMENTS}) diff --git a/local/recipes/kde/kirigami/source/src/forms/cards/Form.qml b/local/recipes/kde/kirigami/source/src/forms/cards/Form.qml new file mode 100644 index 0000000000..847b86d207 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/cards/Form.qml @@ -0,0 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2026 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import org.kde.kirigami.forms.private.templates as FT + +FT.Form {} diff --git a/local/recipes/kde/kirigami/source/src/forms/cards/FormAction.qml b/local/recipes/kde/kirigami/source/src/forms/cards/FormAction.qml new file mode 100644 index 0000000000..2bea009bc6 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/cards/FormAction.qml @@ -0,0 +1,31 @@ +/* + * SPDX-FileCopyrightText: 2026 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls as QQC +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.primitives as Primitives +import org.kde.kirigami.forms.private.templates as FT + +FT.FormAction { + id: root + + clickEnabled: true + + leadingItems: Primitives.Icon { + Layout.fillHeight: true + source: root.action.icon.name || root.action.icon.source + color: root.action.icon.color + Layout.preferredWidth: root.action.icon.width > 0 ? root.action.icon.width : Platform.Units.iconSizes.smallMedium + Layout.preferredHeight: root.action.icon.height > 0 ? root.action.icon.height : Platform.Units.iconSizes.smallMedium + } + + contentItem: QQC.Label { + text: root.action.text + } +} + diff --git a/local/recipes/kde/kirigami/source/src/forms/cards/FormEntry.qml b/local/recipes/kde/kirigami/source/src/forms/cards/FormEntry.qml new file mode 100644 index 0000000000..bfb2414543 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/cards/FormEntry.qml @@ -0,0 +1,200 @@ +/* + * SPDX-FileCopyrightText: 2026 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls as QQC +import QtQuick.Templates as T +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.primitives as Primitives +import org.kde.kirigami.layouts as KirigamiLayouts +import org.kde.kirigami.forms.private.templates as FT + +FT.FormEntry { + id: root + + implicitWidth: Math.max(mainLayout.implicitWidth + impl.padding * 2, Math.min(contentItemWrapper.implicitWidth, Platform.Units.gridUnit * 20 + impl.padding * 2)) + implicitHeight: impl.implicitHeight + + Layout.fillWidth: true + + hovered: impl.hovered + + //Internal: never rely on this + readonly property real __textLabelWidth: label.implicitWidth + + QQC.Label { + id: label + anchors { + top: parent.top + right: parent.left + rightMargin: -impl.leftPadding + Platform.Units.largeSpacing + topMargin: root.contentItem.KirigamiLayouts.FormData.buddyFor.y + root.contentItem.KirigamiLayouts.FormData.buddyFor.height/2 - label.height/2 + contentItemWrapper.y + impl.topPadding + } + visible: text.length > 0 && !impl.formLayout.__collapsed + Primitives.MnemonicData.enabled: { + const buddy = root.contentItem?.KirigamiLayouts.FormData.buddyFor; + if (buddy && buddy.enabled && buddy.visible && buddy.activeFocusOnTab) { + // Only set mnemonic if the buddy doesn't already have one. + const buddyMnemonic = buddy.Primitives.MnemonicData; + return !buddyMnemonic.label || !buddyMnemonic.enabled; + } else { + return false; + } + } + Primitives.MnemonicData.controlType: Primitives.MnemonicData.FormLabel + Primitives.MnemonicData.label: root.title + text: Primitives.MnemonicData.richTextLabel + wrapMode: Text.WordWrap + Accessible.name: Primitives.MnemonicData.plainTextLabel + // We should use this instead of the binding but this makes qt crash due to QTBUG-146127 + // Accessible.labelFor: visible ? root.contentItem : null + Shortcut { + sequence: label.Primitives.MnemonicData.sequence + onActivated: { + const buddy = root.contentItem?.KirigamiLayouts.FormData.buddyFor; + + const buttonBuddy = buddy as T.AbstractButton; + buttonBuddy.animateClick(); + } + } + } + + // Replace with Accessible.labelFor once QTBUG-146127 is fixed + Binding { + target: root.contentItem.Accessible + property: "labelledBy" + value: label.visible ? label : inlineLabel + } + + T.ItemDelegate { + id: impl + anchors.fill: parent + implicitWidth: mainLayout.implicitWidth + leftPadding + rightPadding + implicitHeight: mainLayout.implicitHeight + topPadding + bottomPadding + padding: Platform.Units.largeSpacing + Platform.Units.smallSpacing + + leftPadding: impl.formLayout.__collapsed ? padding : root.parent?.__assignedWidthForLabels + Platform.Units.largeSpacing * 2 + + readonly property bool nextIsFormEntry: root.parent?.visibleChildren[root.parent.visibleChildren.indexOf(root) + 1] instanceof FormEntry ?? false + readonly property bool prevIsFormEntry: root.parent?.visibleChildren[root.parent.visibleChildren.indexOf(root) - 1] instanceof FormEntry ?? false + + topPadding: prevIsFormEntry ? Platform.Units.largeSpacing : Platform.Units.largeSpacing + Platform.Units.smallSpacing + bottomPadding: nextIsFormEntry ? Platform.Units.largeSpacing : Platform.Units.largeSpacing + Platform.Units.smallSpacing + + readonly property Item formLayout: { + let candidate = root.parent + while (candidate) { + if (candidate instanceof Form) { + return candidate; + } + candidate = candidate.parent + } + return null + } + + hoverEnabled: clickEnabled && !Platform.Settings.hasTransientTouchInput + + onClicked: { + if (!clickEnabled) { + return; + } + const buddy = root.contentItem?.KirigamiLayouts.FormData.buddyFor; + buddy.forceActiveFocus(Qt.ShortcutFocusReason); + if (buddy instanceof T.AbstractButton) { + buddy.animateClick(); + } else if (buddy instanceof T.ComboBox) { + buddy.popup.open(); + } + + root.clicked() + } + + contentItem: GridLayout { + id: mainLayout + columnSpacing: Platform.Units.smallSpacing + rowSpacing: Platform.Units.smallSpacing + columns: 1 + leadingItems.visible + trailingItems.visible + QQC.Label { + id: inlineLabel + Layout.fillWidth: true + Layout.columnSpan: mainLayout.columns + visible: text.length > 0 && impl.formLayout.__collapsed + text: label.Primitives.MnemonicData.richTextLabel + wrapMode: Text.WordWrap + Accessible.name: label.Primitives.MnemonicData.plainTextLabel + } + RowLayout { + id: leadingItems + Layout.rowSpan: subtitleLabel.visible ? 2 : 1 + visible: children.length > 0 + spacing: Platform.Units.smallSpacing + children: root.leadingItems + } + QQC.Control { + id: contentItemWrapper + LayoutMirroring.childrenInherit: true + LayoutMirroring.enabled: contentItem instanceof QQC.Switch + ? Qt.application.layoutDirection === Qt.LeftToRight + : Qt.application.layoutDirection === Qt.RightToLeft + + leftPadding: 0 + rightPadding: 0 + topPadding: 0 + bottomPadding: 0 + Layout.fillWidth: true + Layout.alignment: Qt.AlignVCenter + visible: contentItem + contentItem: root.contentItem + Binding { + when: (contentItemWrapper.contentItem instanceof QQC.Switch) && (contentItemWrapper.contentItem?.contentItem ?? false) + target: contentItemWrapper.contentItem?.contentItem ?? null + property: "LayoutMirroring.enabled" + value: !contentItemWrapper.LayoutMirroring.enabled + } + } + + RowLayout { + id: trailingItems + Layout.rowSpan: subtitleLabel.visible ? 2 : 1 + Layout.minimumWidth: visible ? implicitWidth : 0 + visible: children.length > 0 + spacing: Platform.Units.smallSpacing + children: root.trailingItems + } + + QQC.Label { + id: subtitleLabel + Layout.fillWidth: true + visible: text.length > 0 + color: Platform.Theme.disabledTextColor + text: root.subtitle + wrapMode: Text.WordWrap + elide: Text.ElideRight + leftPadding: Application.layoutDirection === Qt.LeftToRight + ? root.contentItem.KirigamiLayouts.FormData.buddyFor?.indicator?.width ?? 0 + root.contentItem.KirigamiLayouts.FormData.buddyFor?.spacing ?? 0 + : padding + } + } + + background: Rectangle { + color: Platform.Theme.textColor + opacity: root.clickEnabled && (impl.hovered || impl.down) ? (impl.down || root.contentItem?.KirigamiLayouts.FormData.buddyFor?.down ? 0.1 : 0.05) : 0 + readonly property bool first: root.parent.children[0] === root + readonly property bool last: root.parent.children[root.parent.children.length - 1] === root + topLeftRadius: first ? Platform.Units.cornerRadius : 0 + topRightRadius: topLeftRadius + bottomLeftRadius: last ? Platform.Units.cornerRadius : 0 + bottomRightRadius: bottomLeftRadius + Behavior on opacity { + OpacityAnimator { + duration: Platform.Units.longDuration + easing.type: Easing.InOutQuad + } + } + } + } +} diff --git a/local/recipes/kde/kirigami/source/src/forms/cards/FormGroup.qml b/local/recipes/kde/kirigami/source/src/forms/cards/FormGroup.qml new file mode 100644 index 0000000000..c33e1338e9 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/cards/FormGroup.qml @@ -0,0 +1,67 @@ +/* + * SPDX-FileCopyrightText: 2026 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Layouts +import org.kde.kirigami.controls as KC +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.layouts as KirigamiLayouts +import org.kde.kirigami.forms.private.templates as FT + +FT.FormGroup { + id: root + + Layout.fillWidth: true + Layout.leftMargin: layout.compactMargins ? -Platform.Units.gridUnit : 0 + Layout.rightMargin: layout.compactMargins ? -Platform.Units.gridUnit : 0 + + default property alias entries: innerLayout.data + // remove the margins in order to not have relayouting loops + implicitWidth: layout.implicitWidth - Layout.leftMargin - Layout.rightMargin + implicitHeight: layout.implicitHeight + + readonly property real __maxTextLabelWidth: innerLayout.labelWidth + property alias __assignedWidthForLabels: innerLayout.__assignedWidthForLabels + + clip: layout.compactMargins + + KirigamiLayouts.HeaderFooterLayout { + id: layout + anchors { + fill: parent + leftMargin: layout.compactMargins ? -Platform.Units.cornerRadius : 0 + rightMargin:layout.compactMargins ? -Platform.Units.cornerRadius : 0 + } + property bool compactMargins: parentLayout.width >= parentLayout.parent.width + property ColumnLayout parentLayout: root.parent + spacing: Platform.Units.smallSpacing + + header: KC.Heading { + level: 5 + leftPadding: Platform.Units.cornerRadius + (layout.compactMargins ? Platform.Units.gridUnit : 0) + font.weight: Font.DemiBold + visible: text.length > 0 + text: root.title + } + contentItem: KC.AbstractCard { + padding: 0 + implicitWidth: innerLayout.implicitWidth + __assignedWidthForLabels + contentItem: ColumnLayout { + id: innerLayout + property real labelWidth: 0 + property real __assignedWidthForLabels: 0 + onImplicitWidthChanged: { + let w = 0; + for (let entry of children) { + w = Math.max(w, entry?.__textLabelWidth ?? 0); + } + labelWidth = w; + } + spacing: 0 + } + } + } +} diff --git a/local/recipes/kde/kirigami/source/src/forms/cards/FormSeparator.qml b/local/recipes/kde/kirigami/source/src/forms/cards/FormSeparator.qml new file mode 100644 index 0000000000..de3bc39054 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/cards/FormSeparator.qml @@ -0,0 +1,45 @@ +/* + * SPDX-FileCopyrightText: 2026 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Layouts +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.primitives as Primitives +import org.kde.kirigami.forms.private.templates as FT + +FT.FormSeparator { + id: root + + Layout.fillWidth: true + + implicitWidth: separator.implicitWidth + implicitHeight: separator.implicitHeight + + opacity: { + const idx = root.parent.visibleChildren.indexOf(root); + if (idx === -1) { + return 1; + } + return !root.parent.visibleChildren[idx - 1]?.hovered && !root.parent.visibleChildren[idx + 1]?.hovered; + } + Behavior on opacity { + OpacityAnimator { + duration: Platform.Units.longDuration + easing.type: Easing.InOutQuad + } + } + + Primitives.Separator { + id: separator + opacity: 0.5 + anchors { + left: parent.left + right: parent.right + leftMargin: Platform.Units.largeSpacing + rightMargin: Platform.Units.largeSpacing + } + } +} diff --git a/local/recipes/kde/kirigami/source/src/forms/flat/Form.qml b/local/recipes/kde/kirigami/source/src/forms/flat/Form.qml new file mode 100644 index 0000000000..847b86d207 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/flat/Form.qml @@ -0,0 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2026 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import org.kde.kirigami.forms.private.templates as FT + +FT.Form {} diff --git a/local/recipes/kde/kirigami/source/src/forms/flat/FormAction.qml b/local/recipes/kde/kirigami/source/src/forms/flat/FormAction.qml new file mode 100644 index 0000000000..5a4b7e6b11 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/flat/FormAction.qml @@ -0,0 +1,30 @@ +/* + * SPDX-FileCopyrightText: 2025 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Controls as QQC +import org.kde.kirigami.forms.private.templates as FT + +FT.FormAction { + id: root + + triggerIcon.name: "" + + contentItem: QQC.Button { + icon { + name: root.action.icon.name + source: root.action.icon.source + color: root.action.icon.color + width: root.action.icon.width + height: root.action.icon.height + } + text: root.action.text + onClicked: { + root.clicked(); + root.action.trigger(); + } + } +} diff --git a/local/recipes/kde/kirigami/source/src/forms/flat/FormEntry.qml b/local/recipes/kde/kirigami/source/src/forms/flat/FormEntry.qml new file mode 100644 index 0000000000..fe2510e260 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/flat/FormEntry.qml @@ -0,0 +1,154 @@ +/* + * SPDX-FileCopyrightText: 2025 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls as QQC +import QtQuick.Templates as T +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.primitives as Primitives +import org.kde.kirigami.layouts as KirigamiLayouts +import org.kde.kirigami.forms.private.templates as FT + +FT.FormEntry { + id: root + + implicitWidth: Math.max(contentItem.implicitWidth + impl.leftPadding * 2, Math.min(impl.implicitWidth, Platform.Units.gridUnit * 20 + impl.leftPadding * 2)) + implicitHeight: impl.implicitHeight + + Layout.fillWidth: true + + //Internal: never rely on this + readonly property real __textLabelWidth: label.implicitWidth + + QQC.Label { + id: label + anchors { + top: parent.top + right: parent.left + topMargin: root.contentItem.KirigamiLayouts.FormData.buddyFor.y + layout.y + root.contentItem.KirigamiLayouts.FormData.buddyFor.height/2 - label.height/2 + impl.topPadding + } + visible: text.length > 0 && !impl.formLayout.__collapsed + Primitives.MnemonicData.enabled: { + const buddy = root.contentItem?.KirigamiLayouts.FormData.buddyFor; + if (buddy && buddy.enabled && buddy.visible && buddy.activeFocusOnTab) { + // Only set mnemonic if the buddy doesn't already have one. + const buddyMnemonic = buddy.Primitives.MnemonicData; + return !buddyMnemonic.label || !buddyMnemonic.enabled; + } else { + return false; + } + } + Primitives.MnemonicData.controlType: Primitives.MnemonicData.FormLabel + Primitives.MnemonicData.label: root.title + text: Primitives.MnemonicData.richTextLabel + Accessible.name: Primitives.MnemonicData.plainTextLabel + // We should use this instead of the binding but this makes qt crash due to QTBUG-146127 + // Accessible.labelFor: visible ? root.contentItem : null + Shortcut { + sequence: label.Primitives.MnemonicData.sequence + onActivated: { + const buddy = root.contentItem?.KirigamiLayouts.FormData.buddyFor; + + const buttonBuddy = buddy as T.AbstractButton; + buttonBuddy.animateClick(); + } + } + TapHandler { + onTapped: { + if (!root.clickEnabled) { + return; + } + const buddy = root.contentItem?.KirigamiLayouts.FormData.buddyFor; + buddy.forceActiveFocus(Qt.ShortcutFocusReason); + root.clicked(); + } + } + } + + // Replace with Accessible.labelFor once QTBUG-146127 is fixed + Binding { + target: root.contentItem.Accessible + property: "labelledBy" + value: label.visible ? label : layout.header + } + + T.Control { + id: impl + anchors { + left: parent.left + top: parent.top + bottom: parent.bottom + } + width: layout.contentItem?.Layout.fillWidth ? parent.width : Math.min(implicitWidth, parent.width) + implicitWidth: mainLayout.implicitWidth + leftPadding + rightPadding + implicitHeight: mainLayout.implicitHeight + topPadding + bottomPadding + leftPadding: Platform.Units.largeSpacing + rightPadding: leftPadding + topPadding: 0 + bottomPadding: 0 + readonly property Item formLayout: { + let candidate = root.parent + while (candidate) { + if (candidate instanceof Form) { + return candidate; + } + candidate = candidate.parent + } + console.warn("Warning: FormEntry not inside a Form") + return null + } + + contentItem: RowLayout { + id: mainLayout + spacing: Platform.Units.smallSpacing + RowLayout { + id: leadingItems + visible: children.length > 0 + spacing: Platform.Units.smallSpacing + children: root.leadingItems + } + KirigamiLayouts.HeaderFooterLayout { + id: layout + Layout.fillWidth: true + Layout.minimumWidth: contentItem?.Layout.minimumWidth + Layout.preferredWidth: contentItem?.Layout.preferredWidth + Layout.maximumWidth: contentItem?.Layout.maximumWidth + + header: QQC.Label { + topPadding: root.parent.children[0] === root ? 0 : Platform.Units.largeSpacing + visible: impl.formLayout.__collapsed && text.length > 0 + // Accessible.labelFor: visible && root.contentItem ? root.contentItem : null + text: label.Primitives.MnemonicData.richTextLabel + } + + footer: QQC.Label { + font: Platform.Theme.smallFont + wrapMode: Text.WordWrap + elide: Text.ElideRight + visible: text.length > 0 + text: root.subtitle + leftPadding: + Application.layoutDirection === Qt.LeftToRight + ? (root.contentItem.KirigamiLayouts.FormData.buddyFor?.indicator?.width ?? 0) + root.contentItem.KirigamiLayouts.FormData.buddyFor?.spacing + : padding + rightPadding: Application.layoutDirection === Qt.RightToLeft + ? (root.contentItem.KirigamiLayouts.FormData.buddyFor?.indicator?.width ?? 0) + root.contentItem.KirigamiLayouts.FormData.buddyFor?.spacing + : padding + } + + contentItem: root.contentItem + } + RowLayout { + id: trailingItems + Layout.minimumWidth: implicitWidth + visible: children.length > 0 + spacing: Platform.Units.smallSpacing + children: root.trailingItems + } + } + } +} diff --git a/local/recipes/kde/kirigami/source/src/forms/flat/FormGroup.qml b/local/recipes/kde/kirigami/source/src/forms/flat/FormGroup.qml new file mode 100644 index 0000000000..030dd04eaa --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/flat/FormGroup.qml @@ -0,0 +1,82 @@ +/* + * SPDX-FileCopyrightText: 2025 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Layouts +import org.kde.kirigami.controls as KirigamiControls +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.primitives as Primitives +import org.kde.kirigami.layouts as KirigamiLayouts +import org.kde.kirigami.forms.private.templates as FT + + +FT.FormGroup { + id: root + + Layout.fillWidth: true + Layout.topMargin: separator.visible ? Platform.Units.largeSpacing * 3 : 0 + + // Don't document this, should never be used directly + default property alias entries: innerLayout.data + implicitWidth: layout.implicitWidth + implicitHeight: layout.implicitHeight + layout.y + + // Internal + readonly property real __maxTextLabelWidth: innerLayout.labelWidth + // Internal + property real __assignedWidthForLabels: 0 + + Primitives.Separator { + id: separator + visible: root.parent.visibleChildren[0] !== root && title.length === 0 + anchors { + left: parent.left + right: parent.right + top: parent.top + leftMargin: Platform.Units.largeSpacing + rightMargin: Platform.Units.largeSpacing + topMargin: -Platform.Units.largeSpacing - Platform.Units.smallSpacing + } + } + + KirigamiLayouts.HeaderFooterLayout { + id: layout + anchors { + fill: parent + topMargin: separator.visible ? Platform.Units.largeSpacing : 0 + } + spacing: Platform.Units.smallSpacing + + header: KirigamiControls.Heading { + level: 4 + horizontalAlignment: Text.AlignHCenter + font.weight: Font.DemiBold + visible: text.length > 0 + text: root.title + } + contentItem: Item { + implicitWidth: innerLayout.implicitWidth + __assignedWidthForLabels//+ innerLayout.labelWidth + implicitHeight: innerLayout.implicitHeight + ColumnLayout { + id: innerLayout + anchors { + fill: parent + leftMargin: root.parent.parent.__collapsed ? 0 : root.__assignedWidthForLabels + } + property real labelWidth: 0 + onImplicitWidthChanged: { + let w = 0; + for (let entry of children) { + w = Math.max(w, entry?.__textLabelWidth ?? 0); + } + labelWidth = w; + } + spacing: Platform.Units.smallSpacing + children: root.entries + } + } + } +} diff --git a/local/recipes/kde/kirigami/source/src/forms/flat/FormSeparator.qml b/local/recipes/kde/kirigami/source/src/forms/flat/FormSeparator.qml new file mode 100644 index 0000000000..cbc6b28d60 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/flat/FormSeparator.qml @@ -0,0 +1,19 @@ +/* + * SPDX-FileCopyrightText: 2025 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Layouts +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.forms.private.templates as FT + +FT.FormSeparator { + id: root + + Layout.fillWidth: true + + implicitWidth: Platform.Units.largeSpacing + implicitHeight: Platform.Units.largeSpacing +} diff --git a/local/recipes/kde/kirigami/source/src/forms/formalignmentgroup.cpp b/local/recipes/kde/kirigami/source/src/forms/formalignmentgroup.cpp new file mode 100644 index 0000000000..6128e01533 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/formalignmentgroup.cpp @@ -0,0 +1,130 @@ +/* + * SPDX-FileCopyrightText: 2026 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#include "formalignmentgroup_p.h" +#include + +FormAlignmentGroup::FormAlignmentGroup(QObject *parent) + : QObject(parent) +{ +} + +QQmlListProperty FormAlignmentGroup::forms() +{ + return QQmlListProperty(this, nullptr, forms_append, forms_count, forms_at, forms_clear, forms_replace, forms_removeLast); +} + +void FormAlignmentGroup::addForm(QQuickItem *form) +{ + if (!form || m_forms.contains(form)) { + return; + } + m_forms.append(form); + + connect(form, &QObject::destroyed, this, [this, form]() { + removeForm(form); + }); + + Q_EMIT formsChanged(); +} + +void FormAlignmentGroup::removeForm(QQuickItem *form) +{ + if (!m_forms.contains(form)) { + return; + } + + disconnect(form, &QObject::destroyed, this, nullptr); + + m_forms.removeAll(form); + Q_EMIT formsChanged(); +} + +FormAlignmentGroupAttached *FormAlignmentGroup::qmlAttachedProperties(QObject *object) +{ + return new FormAlignmentGroupAttached(object); +} + +void FormAlignmentGroup::forms_append(QQmlListProperty *prop, QQuickItem *form) +{ + FormAlignmentGroup *q = static_cast(prop->object); + q->addForm(form); +} + +qsizetype FormAlignmentGroup::forms_count(QQmlListProperty *prop) +{ + FormAlignmentGroup *q = static_cast(prop->object); + return q->m_forms.count(); +} + +QQuickItem *FormAlignmentGroup::forms_at(QQmlListProperty *prop, qsizetype index) +{ + FormAlignmentGroup *q = static_cast(prop->object); + if (index < 0 || index >= q->m_forms.count()) { + return nullptr; + } + return q->m_forms.value(index); +} + +void FormAlignmentGroup::forms_clear(QQmlListProperty *prop) +{ + FormAlignmentGroup *q = static_cast(prop->object); + + std::for_each(q->m_forms.constBegin(), q->m_forms.constEnd(), [q](QQuickItem *form) { + disconnect(form, &QObject::destroyed, q, nullptr); + return form; + }); + + q->m_forms.clear(); + Q_EMIT q->formsChanged(); +} + +void FormAlignmentGroup::forms_replace(QQmlListProperty *prop, qsizetype index, QQuickItem *form) +{ + FormAlignmentGroup *q = static_cast(prop->object); + if (index >= q->m_forms.size()) { + return; + } + + q->m_forms[index] = form; + Q_EMIT q->formsChanged(); +} + +void FormAlignmentGroup::forms_removeLast(QQmlListProperty *prop) +{ + FormAlignmentGroup *q = static_cast(prop->object); + if (!q->m_forms.isEmpty()) { + q->m_forms.removeLast(); + } +} + +////////////////////// QQuickButtonGroupAttached + +FormAlignmentGroupAttached::FormAlignmentGroupAttached(QObject *parent) + : QObject(parent) + , m_form(qobject_cast(parent)) +{ +} + +FormAlignmentGroup *FormAlignmentGroupAttached::group() const +{ + return m_group; +} + +void FormAlignmentGroupAttached::setGroup(FormAlignmentGroup *group) +{ + if (m_group) { + m_group->removeForm(m_form); + } + + m_group = group; + + if (m_form && m_group) { + group->addForm(m_form); + } + + Q_EMIT groupChanged(); +} diff --git a/local/recipes/kde/kirigami/source/src/forms/formalignmentgroup_p.h b/local/recipes/kde/kirigami/source/src/forms/formalignmentgroup_p.h new file mode 100644 index 0000000000..c93f47bbab --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/formalignmentgroup_p.h @@ -0,0 +1,105 @@ +/* + * SPDX-FileCopyrightText: 2026 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#ifndef FORMALIGNMENTGROUP_P_H +#define FORMALIGNMENTGROUP_P_H + +#include +#include +#include +#include + +class QQuickItem; +class FormAlignmentGroupAttached; + +/*! + \qmltype FormAlignmentGroup + \inqmlmodule org.kde.kirigami.forms + + \brief A group of forms that should be perfectly aligned with each other. + + Sometimes for implementation reasons there must be multiple Form instances in the same + encompassing layout. when the forms are not in collapsed mode, their tiles and contents need + to be perfectly aligned with each other, therefore while doing its layout, a form must + know about all the other forms in the group, so they can synchronize their size hints with each other. + + Use a FormAlignmentGroup instance and its attached property to add every form in the same group + + Example usage: + \qml + FormAlignGroup { + id: formGroup + } + + Form { + FormAlignGroup.group: formGroup + ... + } + + Form { + FormAlignGroup.group: formGroup + ... + } + \endqml + \sa Form + */ +class FormAlignmentGroup : public QObject +{ + Q_OBJECT + /*! + All the forms in this group. + */ + Q_PROPERTY(QQmlListProperty forms READ forms NOTIFY formsChanged FINAL) + QML_ELEMENT + QML_ATTACHED(FormAlignmentGroupAttached) + +public: + explicit FormAlignmentGroup(QObject *parent = nullptr); + + QQmlListProperty forms(); + + void addForm(QQuickItem *form); + void removeForm(QQuickItem *form); + + static FormAlignmentGroupAttached *qmlAttachedProperties(QObject *object); + +Q_SIGNALS: + void formsChanged(); + +private: + static void forms_append(QQmlListProperty *prop, QQuickItem *form); + static qsizetype forms_count(QQmlListProperty *prop); + static QQuickItem *forms_at(QQmlListProperty *prop, qsizetype index); + static void forms_clear(QQmlListProperty *prop); + static void forms_replace(QQmlListProperty *prop, qsizetype index, QQuickItem *form); + static void forms_removeLast(QQmlListProperty *prop); + + QList m_forms; +}; + +class FormAlignmentGroupAttached : public QObject +{ + Q_OBJECT + /*! + The group this form belongs to. The attached property makes sense to be used only inside a Form + */ + Q_PROPERTY(FormAlignmentGroup *group READ group WRITE setGroup NOTIFY groupChanged FINAL) + +public: + explicit FormAlignmentGroupAttached(QObject *parent = nullptr); + + FormAlignmentGroup *group() const; + void setGroup(FormAlignmentGroup *group); + +Q_SIGNALS: + void groupChanged(); + +private: + QQuickItem *m_form = nullptr; + QPointer m_group; +}; + +#endif diff --git a/local/recipes/kde/kirigami/source/src/forms/kirigamiformsplugin.cpp b/local/recipes/kde/kirigami/source/src/forms/kirigamiformsplugin.cpp new file mode 100644 index 0000000000..3e6bf1c02e --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/kirigamiformsplugin.cpp @@ -0,0 +1,41 @@ +/* + * SPDX-FileCopyrightText: 2009 Alan Alpert + * SPDX-FileCopyrightText: 2010 Ménard Alexis + * SPDX-FileCopyrightText: 2010 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#include "kirigamiformsplugin.h" + +// This is required for declarative registration to work on Windows. +// This is normally generated by Qt but since we need a manually written plugin +// file, we need to include this ourselves. +extern void qml_register_types_org_kde_kirigami_forms(); +Q_GHS_KEEP_REFERENCE(qml_register_types_org_kde_kirigami_forms) + +KirigamiFormsPlugin::KirigamiFormsPlugin(QObject *parent) + : QQmlExtensionPlugin(parent) +{ + // See above. + volatile auto registration = &qml_register_types_org_kde_kirigami_forms; + Q_UNUSED(registration) +} + +void KirigamiFormsPlugin::registerTypes(const char *uri) +{ + Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.kirigami.forms")); + + QString formsChoice = QString::fromLocal8Bit(qgetenv("KDE_KIRIGAMI_FORMS_STYLE")); + if (formsChoice.isEmpty() || formsChoice != QStringLiteral("flat")) { + formsChoice = QStringLiteral("cards"); + } + + qmlRegisterModuleImport(uri, + QQmlModuleImportModuleAny, + (QLatin1String("org.kde.kirigami.forms.private.") % formsChoice).toUtf8().constData(), + QQmlModuleImportLatest, + QQmlModuleImportAuto); +} + +#include "moc_kirigamiformsplugin.cpp" diff --git a/local/recipes/kde/kirigami/source/src/forms/kirigamiformsplugin.h b/local/recipes/kde/kirigami/source/src/forms/kirigamiformsplugin.h new file mode 100644 index 0000000000..3a14d5c96e --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/kirigamiformsplugin.h @@ -0,0 +1,25 @@ +/* + * SPDX-FileCopyrightText: 2009 Alan Alpert + * SPDX-FileCopyrightText: 2010 Ménard Alexis + * SPDX-FileCopyrightText: 2026 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#ifndef KIRIGAMIFORMSPLUGIN_H +#define KIRIGAMIFORMSPLUGIN_H + +#include +#include + +class KirigamiFormsPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") + +public: + KirigamiFormsPlugin(QObject *parent = nullptr); + void registerTypes(const char *uri) override; +}; + +#endif diff --git a/local/recipes/kde/kirigami/source/src/forms/templates/Form.qml b/local/recipes/kde/kirigami/source/src/forms/templates/Form.qml new file mode 100644 index 0000000000..714bb3bde1 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/templates/Form.qml @@ -0,0 +1,126 @@ +/* + * SPDX-FileCopyrightText: 2026 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Layouts +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.forms as Forms + +/*! + \qmltype Form + \inqmlmodule org.kde.kirigami.forms + + \brief The base class for Form conforming to the + Kirigami Human Interface Guidelines. + + This is the base element for forms, used for instance in settings pages. + We usually have a Page that contains a single Form, + which in turn contains one or more FormGroup, each formGroup containing one or more FormEntry. + + Example usage: + \qml + import QtQuick.Controls as QQC + import org.kde.kirigami as Kirigami + + Kirigami.Form { + Kirigami.FormGroup { + title: "Global Settings" + Kirigami.FormEntry { + contentItem: QQC.CheckBox { + text: "Show Sidebar" + } + } + Kirigami.FormEntry { + contentItem: QQC.CheckBox { + text: "Auto Save" + } + } + } + Kirigami.FormGroup { + title: "Theme Options" + Kirigami.FormEntry { + title: "Colors" + contentItem: QQC.CheckBox { + text: "Dark Theme" + } + } + Kirigami.FormSeparator {} + Kirigami.FormEntry { + contentItem: QQC.CheckBox { + text: "High Contrast" + } + } + ... + } + } + \endqml + \sa FormGroup + \sa FormEntry + \since 6.24 +*/ +Item { + id: root + + // Implementation detail, don't document + default property alias entries: layout.data + Accessible.role: Accessible.Form + + implicitWidth: layout.implicitWidth + Platform.Units.smallSpacing * 2 + implicitHeight: layout.implicitHeight + Platform.Units.smallSpacing * 2 + + // Internal, don't document + property bool __collapsed: false + + onWidthChanged: layout.relayoutLabels() + + ColumnLayout { + id: layout + property real labelWidth: 0 + property real twinImplicitWidth: 0 + onImplicitWidthChanged: relayoutLabels() + function relayoutLabels() { + let w = 0; + for (let entry of children) { + w = Math.max(w, entry?.__maxTextLabelWidth ?? 0); + } + + if (root.Forms.FormAlignmentGroup.group) { + for (let form of root.Forms.FormAlignmentGroup.group.forms) { + if (!(form instanceof Form) || !form.visible) { + continue; + } + for (let entry of form.entries) { + w = Math.max(w, entry?.__maxTextLabelWidth ?? 0); + } + } + } + + labelWidth = w; + for (let entry of children) { + if ("__assignedWidthForLabels" in entry) { + entry.__assignedWidthForLabels = w; + } + } + + if (root.Forms.FormAlignmentGroup.group) { + for (let form of root.Forms.FormAlignmentGroup.group.forms) { + if (!(form instanceof Form) || !form.visible) { + continue; + } + twinImplicitWidth = Math.max(twinImplicitWidth, form.children[0]?.implicitWidth); + } + } + + root.__collapsed = Math.max(implicitWidth, twinImplicitWidth) > root.width; + } + anchors.centerIn: parent + + width: root.__collapsed + ? Math.min(implicitWidth, parent.width, Platform.Units.gridUnit * 30) + : Math.min(Math.max(implicitWidth, twinImplicitWidth), parent.width) + spacing: Platform.Units.largeSpacing + Platform.Units.smallSpacing + } +} diff --git a/local/recipes/kde/kirigami/source/src/forms/templates/FormAction.qml b/local/recipes/kde/kirigami/source/src/forms/templates/FormAction.qml new file mode 100644 index 0000000000..a0d0399fae --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/templates/FormAction.qml @@ -0,0 +1,79 @@ +/* + * SPDX-FileCopyrightText: 2026 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls as QQC +import QtQuick.Templates as T +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.primitives as Primitives +import org.kde.kirigami.forms as Forms + + +/*! + \qmltype FormAction + \inqmlmodule org.kde.kirigami.forms + + \brief A specialized FormEntry for a big clickable action + + This component is used when the Form needs entries that represent a big clickable + action: they will act like a single big button and is controlled by its Action property. + Never override the contentItem property for a FormAction. + + Example usage: + \qml + import QtQuick.Controls as QQC + import org.kde.kirigami as Kirigami + + Kirigami.Form { + Kirigami.FormGroup { + title: "When Offline:" + Kirigami.FormAction { + action: Kirigami.Action { + icon.name: "offline-settings" + text: "Offline Settings" + onTriggered: { Code to open that settings page here } + } + } + ... + } + } + \endqml + \sa FormEntry + \since 6.24 +*/ +Forms.FormEntry { // Needs to be instantiated from the global forms import in order to resolve to the proper style + id: root + + /*! + \brief The main action for this Entry + + FormAction acts like a big button that represents and triggers it. + The action icon and text properties will be displayed to the user in this control, + and clicking anywhere on it will trigger the action. + */ + required property T.Action action + + /*! + An icon to be displayed on the rightof this FormEntry which represents what kind of + action this is. By default is "go-next-symbolic", which suggests this action is opening something + else or that is going to replace the PAge it's in. + */ + readonly property Primitives.IconPropertiesGroup triggerIcon: Primitives.IconPropertiesGroup { + name: "go-next-symbolic" + } + + onClicked: action.trigger(root) + + trailingItems: Primitives.Icon { + Layout.fillHeight: true + Layout.maximumHeight: root.triggerIcon.height <= 0 ? Platform.Units.iconSizes.smallMedium : Infinity + source: root.triggerIcon.name || root.triggerIcon.source + color: root.triggerIcon.color + Layout.preferredWidth: root.triggerIcon.width > 0 ? root.triggerIcon.width : -1 + Layout.preferredHeight: root.triggerIcon.height > 0 ? root.triggerIcon.height : -1 + } +} diff --git a/local/recipes/kde/kirigami/source/src/forms/templates/FormEntry.qml b/local/recipes/kde/kirigami/source/src/forms/templates/FormEntry.qml new file mode 100644 index 0000000000..ed62cb4b92 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/templates/FormEntry.qml @@ -0,0 +1,134 @@ +/* + * SPDX-FileCopyrightText: 2026 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Templates as T +import org.kde.kirigami.layouts as KirigamiLayouts + +/*! + \qmltype FormEntry + \inqmlmodule org.kde.kirigami.forms + + \brief The base type of all Form entries + + This element should always be positioned in a FormGroup. + It is The base for all the items livinging in a Form and will take + care of common styling and behaviors, like positioning of titles and subtitles, + background and what happens when the item is clicked even outside the contentItem. + + Example usage: + \qml + import QtQuick.Controls as QQC + import org.kde.kirigami as Kirigami + + Kirigami.Form { + Kirigami.FormGroup { + title: "Global Settings" + Kirigami.FormEntry { + contentItem: QQC.CheckBox { + text: "Show Sidebar" + } + } + Kirigami.FormEntry { + contentItem: QQC.CheckBox { + text: "Auto Save" + } + } + } + Kirigami.FormGroup { + title: "Theme Options" + Kirigami.FormEntry { + title: "Colors" + contentItem: QQC.CheckBox { + text: "Dark Theme" + } + } + Kirigami.FormSeparator {} + Kirigami.FormEntry { + contentItem: QQC.CheckBox { + text: "High Contrast" + } + } + ... + } + } + \endqml + + The form entry will contain a main central contentItem, with optional title, + subtitle, and leading and trailing items, with the following layout: + \image FormEntryLayout.png + + \sa Form + \sa FormGroup + \since 6.24 +*/ +Item { + id: root + + /*! + \brief Entry title. + + If set, a title will be displayed nearby the contentItem, either on top or on the left, + Depending from the style or form factor. Use this when the contentItem appearance doesn't + provide enough explanation on what it does. + */ + property string title: contentItem?.KirigamiLayouts.FormData.label + + /*! + \brief Extra subtitle. + + If set a subtitle (potentially on multiple lines) will be displayed under the contentItem. + Use this for form entries with a more technical meaning that need more explanation or + entries that contain a potentially dangerous action. + */ + property string subtitle + + /*! + \brief The main contents of this entry. + + The contentItem is what contains the main contents of the entry, which are usually a + simple Control such as a CheckBox, a TextField and so on. + If is needed to have more than one control, set a layout as contentItem, such as + a RowLayout, GridLAyout and so on. + */ + property Item contentItem + + /*! + \brief Items to be positioned before the contentItem + + a list of items to be laid out before the contentItem (at the left on LTR locales) + for instance a big icon, that will cover the cumulative height of the title, contentItem and subtitle. + */ + property list leadingItems + + /*! + \brief Items to be positioned after the contentItem + + a list of items to be laid out after the contentItem (at the right on LTR locales) + for instance a ContextualHelpButton, that will cover the cumulative height of the title, contentItem and subtitle. + */ + property list trailingItems + + /*! + \brief Make the whole entry behave like a button + + When true, clicking anywhere on this will emit the clicked signal. + Depending on contentITem, if it's a clickable item itself, the click will + be passed to it: for instance if contentItem is a CheckBox, clicking anywhere, + even outside the checkbox will toggle the CheckBox checked status. + */ + property bool clickEnabled: { + const buddy = root.contentItem?.KirigamiLayouts.FormData.buddyFor; + return buddy instanceof T.AbstractButton || buddy instanceof T.ComboBox || buddy instanceof T.TextField || buddy instanceof T.SpinBox || buddy instanceof T.TextArea; + } + + property bool hovered: false + + /*! + Emitted when the user clicks or taps over this Entry. + */ + signal clicked +} diff --git a/local/recipes/kde/kirigami/source/src/forms/templates/FormGroup.qml b/local/recipes/kde/kirigami/source/src/forms/templates/FormGroup.qml new file mode 100644 index 0000000000..b59b39fc4a --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/templates/FormGroup.qml @@ -0,0 +1,72 @@ +/* + * SPDX-FileCopyrightText: 2026 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +/*! + \qmltype FormGroup + \inqmlmodule org.kde.kirigami.forms + + \brief The container class that identifies a container of related controls in a form. + + This element should always be positioned in a Form. It is used to group together + related form controls, to separate different settings categories. + Every form should always have at least one FormGroup. + + A FormGroup should contain only elements of type FormEntry or FormSeparator (or derivates) + + Example usage: + \qml + import QtQuick.Controls as QQC + import org.kde.kirigami as Kirigami + + Kirigami.Form { + Kirigami.FormGroup { + title: "Global Settings" + Kirigami.FormEntry { + contentItem: QQC.CheckBox { + text: "Show Sidebar" + } + } + Kirigami.FormEntry { + contentItem: QQC.CheckBox { + text: "Auto Save" + } + } + } + Kirigami.FormGroup { + title: "Theme Options" + Kirigami.FormEntry { + title: "Colors" + contentItem: QQC.CheckBox { + text: "Dark Theme" + } + } + Kirigami.FormSeparator {} + Kirigami.FormEntry { + contentItem: QQC.CheckBox { + text: "High Contrast" + } + } + ... + } + } + \endqml + \sa Form + \sa FormEntry + \since 6.24 +*/ +import QtQuick + +Item { + id: root + + /*! + \brief Group title. + + If set, a title will be displayed on top of the form section, useful + for semantically group different settings categories + */ + property string title +} diff --git a/local/recipes/kde/kirigami/source/src/forms/templates/FormSeparator.qml b/local/recipes/kde/kirigami/source/src/forms/templates/FormSeparator.qml new file mode 100644 index 0000000000..05ef61eba3 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/forms/templates/FormSeparator.qml @@ -0,0 +1,47 @@ +/* + * SPDX-FileCopyrightText: 2026 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick + +/*! + \qmltype FormSeparator + \inqmlmodule org.kde.kirigami.forms + + \brief An item used to ssepare entries within a FormGroup + + This component is used when it's needed to separe entries within a FormGroup + for clarity, for instance if is needed to have separate subcategories within a FormGroup. + + Example usage: + \qml + import QtQuick.Controls as QQC + import org.kde.kirigami as Kirigami + + Kirigami.Form { + Kirigami.FormGroup { + title: "Theme Options" + Kirigami.FormEntry { + title: "Subsection 1" + contentItem: QQC.CheckBox { + text: "Dark Theme" + } + } + Kirigami.FormSeparator {} + Kirigami.FormEntry { + title: "Subsection 2" + contentItem: QQC.CheckBox { + text: "High Contrast" + } + } + ... + } + } + \endqml + \sa FormEntry + \sa FormGroup + \since 6.24 +*/ +Item {} diff --git a/local/recipes/kde/kirigami/source/src/kirigami-index.qdoc b/local/recipes/kde/kirigami/source/src/kirigami-index.qdoc new file mode 100644 index 0000000000..dff1f412b7 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/kirigami-index.qdoc @@ -0,0 +1,28 @@ +/*! + \page kirigami-index.html + \title Kirigami + + Kirigami is a set of \l {https://doc.qt.io/qt-6/qtquick-index.html} {QtQuick} components for building adaptable UIs based on \l {https://doc.qt.io/qt-6/qtquickcontrols-index.html} {QtQuick Controls 2}. + + Its goal is to enable creation of convergent applications that look and feel great on mobile as well as desktop devices and follow the \l {https://develop.kde.org/hig} {KDE Human Interface Guidelines} while being easy to use and not adding many dependencies. + + Kirigami works on a variety of platforms, such as \l {https://plasma-mobile.org/} {Plasma Mobile}, Desktop Linux, Android, MacOS, and Windows. + + A tutorial for Kirigami is available on the \l {https://develop.kde.org/docs/getting-started/kirigami/} {KDE Developer platform}. + + A list of additional QML learning resources is available in the \l {https://community.kde.org/Get_Involved/development/Learn#QtQuick/QML} {Community Wiki}. If you are not familiar with QML at all, the \l {https://www.qt.io/product/qt6/qml-book} {QML book} should be a good head start. + + If you have any questions about Kirigami, feel free to drop by the \l {https://go.kde.org/matrix/#/#kirigami:kde.org} {Kirigami group on Matrix}. + + \section1 API Reference + + \list + \li \l{Kirigami QML Types} + \li \l{Kirigami Delegates QML Types} + \li \l{Kirigami Primitives QML Types} + \li \l{Kirigami Platform QML Types} + \li \l{Kirigami Platform C++ Classes} + \li \l{Kirigami Layouts QML Types} + \li \l{Kirigami Dialogs QML Types} + \endlist +*/ diff --git a/local/recipes/kde/kirigami/source/src/kirigami.qdoc b/local/recipes/kde/kirigami/source/src/kirigami.qdoc new file mode 100644 index 0000000000..94fd7592e8 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/kirigami.qdoc @@ -0,0 +1,29 @@ +/*! + \qmlmodule org.kde.kirigami + \title Kirigami QML Types + \brief Kirigami Types +*/ + +/*! + \qmlmodule org.kde.kirigami.delegates + \title Kirigami Delegates QML Types + \brief Kirigami Delegates +*/ + +/*! + \qmlmodule org.kde.kirigami.primitives + \title Kirigami Primitives QML Types + \brief Kirigami Primitives +*/ + +/*! + \qmlmodule org.kde.kirigami.dialogs + \title Kirigami Dialogs QML Types + \brief Kirigami Dialogs +*/ + +/*! + \qmlmodule org.kde.kirigami.layouts + \title Kirigami Layouts QML Types + \brief Kirigami Layouts +*/ diff --git a/local/recipes/kde/kirigami/source/src/kirigami.qdocconf b/local/recipes/kde/kirigami/source/src/kirigami.qdocconf new file mode 100644 index 0000000000..9de3bfaab2 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/kirigami.qdocconf @@ -0,0 +1,54 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = Kirigami +description = Components for Convergent Applications + +documentationinheaders = true + +headerdirs += . +sourcedirs += . ../docs/includes +imagedirs = . ../docs/pics +exampledirs = . ../examples primitives/examples + +depends = kde qtcore qtqml qtquick qtquickcontrols kcoreaddons kirigamiplatform + +excludedirs = platform + +navigation.landingpage = "Kirigami" + +qhp.projects = Kirigami + +qhp.Kirigami.file = kirigami.qhp +qhp.Kirigami.namespace = org.kde.kirigami.$QT_VERSION_TAG +qhp.Kirigami.virtualFolder = kirigami +qhp.Kirigami.indexTitle = Kirigami +qhp.Kirigami.indexRoot = + +qhp.Kirigami.subprojects = controls delegates dialogs layouts primitives + +qhp.Kirigami.subprojects.controls.title = Kirigami QML Types +qhp.Kirigami.subprojects.controls.indexTitle = Kirigami QML Types +qhp.Kirigami.subprojects.controls.selectors = qmlmodule:org.kde.kirigami +qhp.Kirigami.subprojects.controls.sortPages = true + +qhp.Kirigami.subprojects.delegates.title = Kirigami Delegates QML Types +qhp.Kirigami.subprojects.delegates.indexTitle = Kirigami Delegates QML Types +qhp.Kirigami.subprojects.delegates.selectors = qmlmodule:org.kde.kirigami.delegates +qhp.Kirigami.subprojects.delegates.sortPages = true + +qhp.Kirigami.subprojects.dialogs.title = Kirigami Dialogs QML Types +qhp.Kirigami.subprojects.dialogs.indexTitle = Kirigami Dialogs QML Types +qhp.Kirigami.subprojects.dialogs.selectors = qmlmodule:org.kde.kirigami.dialogs +qhp.Kirigami.subprojects.dialogs.sortPages = true + +qhp.Kirigami.subprojects.layouts.title = Kirigami Layouts QML Types +qhp.Kirigami.subprojects.layouts.indexTitle = Kirigami Layouts QML Types +qhp.Kirigami.subprojects.layouts.selectors = qmlmodule:org.kde.kirigami.layouts +qhp.Kirigami.subprojects.layouts.sortPages = true + +qhp.Kirigami.subprojects.primitives.title = Kirigami Primitives QML Types +qhp.Kirigami.subprojects.primitives.indexTitle = Kirigami Primitives QML Types +qhp.Kirigami.subprojects.primitives.selectors = qmlmodule:org.kde.kirigami.primitives +qhp.Kirigami.subprojects.primitives.sortPages = true + +tagfile = kirigami.tags diff --git a/local/recipes/kde/kirigami/source/src/layouts/ColumnViewSeparator.qml b/local/recipes/kde/kirigami/source/src/layouts/ColumnViewSeparator.qml new file mode 100644 index 0000000000..535686a188 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/layouts/ColumnViewSeparator.qml @@ -0,0 +1,158 @@ +/* + * SPDX-FileCopyrightText: 2019 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ +pragma ComponentBehavior: Bound + +import QtQuick +import org.kde.kirigami.layouts as KirigamiLayouts +import org.kde.kirigami.primitives as Primitives +import org.kde.kirigami.platform as Platform + +Item { + id: separator + anchors.fill: parent + + readonly property bool isSeparator: true + property Item previousColumn + property Item column + property Item nextColumn + readonly property bool inToolBar: parent !== column + + visible: (column.KirigamiLayouts.ColumnView.view?.separatorVisible ?? false) && (column.KirigamiLayouts.ColumnView.view?.columnResizeMode !== KirigamiLayouts.ColumnView.SingleColumn ?? false) + + SeparatorHandle { + id: leftHandle + anchors { + left: parent.left + top: parent.top + bottom: parent.bottom + } + leadingColumn: LayoutMirroring.enabled ? separator.column : separator.previousColumn + trailingColumn: LayoutMirroring.enabled ? separator.nextColumn : separator.column + // If this handle touched the left ColumnView edge, hide it + visible: leadingColumn && trailingColumn && separator.column.KirigamiLayouts.ColumnView.view?.leadingVisibleItem !== separator.column + } + + SeparatorHandle { + id: rightHandle + anchors { + right: parent.right + top: parent.top + bottom: parent.bottom + rightMargin: -1 + } + leadingColumn: LayoutMirroring.enabled ? separator.previousColumn : separator.column + trailingColumn: LayoutMirroring.enabled ? separator.column : separator.nextColumn + visible: leadingColumn && trailingColumn && separator.column.KirigamiLayouts.ColumnView.view?.leadingVisibleItem !== separator.previousColumn + } + + component SeparatorHandle: Primitives.Separator { + id: handle + + property Item leadingColumn + property Item trailingColumn + + Platform.Theme.colorSet: Platform.Theme.Header + Platform.Theme.inherit: false + + visible: leadingColumn && trailingColumn + + MouseArea { + anchors { + fill: parent + leftMargin: -Platform.Units.smallSpacing + rightMargin: -Platform.Units.smallSpacing + } + + visible: { + if (!separator.column.KirigamiLayouts.ColumnView.view?.columnResizeMode === KirigamiLayouts.ColumnView.DynamicColumns ?? false) { + return false; + } + if (handle.leadingColumn?.KirigamiLayouts.ColumnView.interactiveResizeEnabled ?? false) { + return true; + } + if (handle.trailingColumn?.KirigamiLayouts.ColumnView.interactiveResizeEnabled ?? false) { + return true; + } + return false; + } + cursorShape: Qt.SplitHCursor + onPressed: mouse => { + if (handle.leadingColumn) { + handle.leadingColumn.KirigamiLayouts.ColumnView.interactiveResizing = true; + } + if (handle.trailingColumn) { + handle.trailingColumn.KirigamiLayouts.ColumnView.interactiveResizing = true; + } + } + onReleased: { + if (handle.leadingColumn) { + handle.leadingColumn.KirigamiLayouts.ColumnView.interactiveResizing = false; + } + if (handle.trailingColumn) { + handle.trailingColumn.KirigamiLayouts.ColumnView.interactiveResizing = false; + } + } + onCanceled: { + if (handle.leadingColumn) { + handle.leadingColumn.KirigamiLayouts.ColumnView.interactiveResizing = false; + } + if (handle.trailingColumn) { + handle.trailingColumn.KirigamiLayouts.ColumnView.interactiveResizing = false; + } + } + onPositionChanged: mouse => { + const newX = mapToItem(null, mouse.x, 0).x; + const leadingX = handle.leadingColumn?.mapToItem(null, 0, 0).x ?? 0; + const trailingX = handle.trailingColumn?.mapToItem(null, 0, 0).x ?? 0; + const view = separator.column.KirigamiLayouts.ColumnView.view; + + let leadingWidth = handle.leadingColumn.width; + let trailingWidth = handle.trailingColumn.width; + + // Minimum and maximum widths for the leading column + let leadingMinimumWidth = handle.leadingColumn.KirigamiLayouts.ColumnView.minimumWidth; + if (handle.leadingColumn.KirigamiLayouts.ColumnView.fillWidth) { + leadingMinimumWidth = view.columnWidth; + } + if (leadingMinimumWidth < 0) { + leadingMinimumWidth = Platform.Units.gridUnit * 8; + } + + // Minimum and maximum widths for the trailing column + let trailingMinimumWidth = handle.trailingColumn.KirigamiLayouts.ColumnView.minimumWidth; + if (handle.trailingColumn.KirigamiLayouts.ColumnView.fillWidth) { + trailingMinimumWidth = view.columnWidth; + } + if (trailingMinimumWidth < 0) { + trailingMinimumWidth = Platform.Units.gridUnit * 8; + } + + let leadingMaximumWidth = handle.leadingColumn.KirigamiLayouts.ColumnView.maximumWidth; + if (leadingMaximumWidth < 0) { + leadingMaximumWidth = leadingWidth + trailingWidth - trailingMinimumWidth; + } + + + let trailingMaximumWidth = handle.trailingColumn.KirigamiLayouts.ColumnView.maximumWidth; + if (trailingMaximumWidth < 0) { + trailingMaximumWidth = leadingWidth + trailingWidth - leadingMinimumWidth; + } + + + if (!handle.leadingColumn.KirigamiLayouts.ColumnView.fillWidth) { + handle.leadingColumn.KirigamiLayouts.ColumnView.preferredWidth = Math.max(leadingMinimumWidth, + Math.min(leadingMaximumWidth, + newX - leadingX)); + } + if (!handle.trailingColumn.KirigamiLayouts.ColumnView.fillWidth) { + handle.trailingColumn.KirigamiLayouts.ColumnView.preferredWidth = Math.max(trailingMinimumWidth, + Math.min(trailingMaximumWidth, + trailingX + handle.trailingColumn.width - newX)); + } + } + } + } +} diff --git a/local/recipes/kde/kirigami/source/src/layouts/pagestackattached.cpp b/local/recipes/kde/kirigami/source/src/layouts/pagestackattached.cpp new file mode 100644 index 0000000000..cae6af2913 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/layouts/pagestackattached.cpp @@ -0,0 +1,240 @@ +// SPDX-FileCopyrightText: 2024 Carl Schwan +// SPDX-License-Identifier: LGPL-2.1-or-later + +#include "pagestackattached.h" + +#include "formlayoutattached.h" +#include "loggingcategory.h" + +#include +#include +#include + +using namespace Qt::StringLiterals; + +template +bool callIfValid(QObject *object, const char *method, Args &&...args) +{ + auto metaObject = object->metaObject(); + auto index = metaObject->indexOfMethod(method); + if (index != -1) { + auto method = metaObject->method(index); + return method.invoke(object, args...); + } + + return false; +} + +bool tryCall(QObject *object, QByteArrayView pageRowMethod, QByteArrayView stackViewMethod, const QVariant &page, const QVariantMap &properties) +{ + const auto metaObject = object->metaObject(); + + QByteArray name = pageRowMethod + "(QVariant,QVariant)"; + if (auto index = metaObject->indexOfMethod(name.data()); index != -1) { + return metaObject->method(index).invoke(object, page, QVariant::fromValue(properties)); + } else if (QQmlComponent *component = page.value(); component != nullptr) { + return metaObject->invokeMethod(object, stackViewMethod.data(), component, properties); + } else if (QQuickItem *item = page.value(); item != nullptr) { + return metaObject->invokeMethod(object, stackViewMethod.data(), item, properties); + } else if (QUrl url = page.toUrl(); !url.isEmpty()) { + return metaObject->invokeMethod(object, stackViewMethod.data(), url, properties); + } + + return false; +} + +PageStackAttached::PageStackAttached(QObject *parent) + : QQuickAttachedPropertyPropagator(parent) +{ + m_parentItem = qobject_cast(parent); + + if (!m_parentItem) { + qCDebug(KirigamiLayoutsLog) << "PageStack must be attached to an Item" << parent; + return; + } + + if (hasStackCapabilities(m_parentItem)) { + setPageStack(m_parentItem); + } else if (!m_pageStack) { + QQuickItem *candidate = m_parentItem->parentItem(); + while (candidate) { + if (hasStackCapabilities(candidate)) { + qmlAttachedPropertiesObject(candidate, true); + break; + } + candidate = candidate->parentItem(); + } + } + + initialize(); +} + +QQuickItem *PageStackAttached::pageStack() const +{ + return m_pageStack; +} + +void PageStackAttached::setPageStack(QQuickItem *pageStack) +{ + if (!pageStack || m_pageStack == pageStack || !hasStackCapabilities(pageStack)) { + return; + } + + m_customStack = true; + m_pageStack = pageStack; + + propagatePageStack(pageStack); + + Q_EMIT pageStackChanged(); +} + +void PageStackAttached::propagatePageStack(QQuickItem *pageStack) +{ + if (!pageStack) { + return; + } + + if (!m_customStack && m_pageStack != pageStack) { + m_pageStack = pageStack; + Q_EMIT pageStackChanged(); + } + + const auto stacks = attachedChildren(); + for (QQuickAttachedPropertyPropagator *child : stacks) { + PageStackAttached *stackAttached = qobject_cast(child); + if (stackAttached) { + stackAttached->propagatePageStack(m_pageStack); + } + } +} + +void PageStackAttached::push(const QVariant &page, const QVariantMap &properties) +{ + if (!m_pageStack) { + qCWarning(KirigamiLayoutsLog) << "Pushing in an empty PageStackAttached"; + return; + } + + if (!tryCall(m_pageStack, "push", "pushItem", page, properties)) { + qCWarning(KirigamiLayoutsLog) << "Invalid parameters to push: " << page << properties; + } +} + +void PageStackAttached::replace(const QVariant &page, const QVariantMap &properties) +{ + if (!m_pageStack) { + qCWarning(KirigamiLayoutsLog) << "replacing in an empty PageStackAttached"; + return; + } + + if (!tryCall(m_pageStack, "replace", "replaceCurrentItem", page, properties)) { + qCWarning(KirigamiLayoutsLog) << "Invalid parameters to replace: " << page << properties; + } +} + +void PageStackAttached::pop(const QVariant &page) +{ + if (!m_pageStack) { + qCWarning(KirigamiLayoutsLog) << "Pushing in an empty PageStackAttached"; + return; + } + + if (callIfValid(m_pageStack, "pop(QVariant)", page)) { + return; + } else if (page.canConvert() && callIfValid(m_pageStack, "popToItem(QQuickItem*)", page.value())) { + return; + } else if (callIfValid(m_pageStack, "popCurrentItem()")) { + return; + } + + qCWarning(KirigamiLayoutsLog) << "Pop operation failed on stack" << m_pageStack << "with page" << page; +} + +void PageStackAttached::clear() +{ + if (!m_pageStack) { + qCWarning(KirigamiLayoutsLog) << "Clearing in an empty PageStackAttached"; + return; + } + + if (!callIfValid(m_pageStack, "clear()")) { + qCWarning(KirigamiLayoutsLog) << "Call to clear() failed"; + } +} + +bool PageStackAttached::hasStackCapabilities(QQuickItem *candidate) +{ + // Duck type the candidate in order to see if it can be used as a stack having the expected methods + auto metaObject = candidate->metaObject(); + Q_ASSERT(metaObject); + + auto hasPageRowOrStackViewMethod = [metaObject](QByteArrayView pageRowMethod, QByteArrayView stackViewMethod) -> bool { + // For PageRow, we require a single method that takes QVariant,QVariant as argument. + QByteArray name = pageRowMethod + "(QVariant,QVariant)"; + if (metaObject->indexOfMethod(name.data()) != -1) { + return true; + } + + // For StackView, we require three variants of the method. + name = stackViewMethod + "(QQmlComponent*,QVariantMap)"; + if (metaObject->indexOfMethod(name.data()) == -1) { + return false; + } + + name = stackViewMethod + "(QQuickItem*,QVariantMap)"; + if (metaObject->indexOfMethod(name.data()) == -1) { + return false; + } + + name = stackViewMethod + "(QUrl,QVariantMap)"; + if (metaObject->indexOfMethod(name.data()) == -1) { + return false; + } + + return true; + }; + + if (!hasPageRowOrStackViewMethod("push", "pushItem")) { + return false; + } + + if (!hasPageRowOrStackViewMethod("replace", "replaceCurrentItem")) { + return false; + } + + auto index = metaObject->indexOfMethod("pop(QVariant)"); + if (index == -1) { + index = metaObject->indexOfMethod("popToItem(QQuickItem*)"); + if (index == -1) { + return false; + } + index = metaObject->indexOfMethod("popCurrentItem()"); + if (index == -1) { + return false; + } + } + + index = metaObject->indexOfMethod("clear()"); + if (index == -1) { + return false; + } + + return true; +} + +PageStackAttached *PageStackAttached::qmlAttachedProperties(QObject *object) +{ + return new PageStackAttached(object); +} + +void PageStackAttached::attachedParentChange(QQuickAttachedPropertyPropagator *newParent, QQuickAttachedPropertyPropagator *oldParent) +{ + Q_UNUSED(oldParent); + + PageStackAttached *stackAttached = qobject_cast(newParent); + if (stackAttached) { + propagatePageStack(stackAttached->pageStack()); + } +} + +#include "moc_pagestackattached.cpp" diff --git a/local/recipes/kde/kirigami/source/src/layouts/pagestackattached.h b/local/recipes/kde/kirigami/source/src/layouts/pagestackattached.h new file mode 100644 index 0000000000..cfeb3f8d8a --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/layouts/pagestackattached.h @@ -0,0 +1,104 @@ +// SPDX-FileCopyrightText: 2024 Carl Schwan +// SPDX-License-Identifier: LGPL-2.1-or-later + +#pragma once + +#include +#include +#include +#include + +/*! + * \qmltype PageStack + * \inqmlmodule org.kde.kirigami.layouts + * + * \brief This attached property makes possible to access from anywhere the + * page stack this page was pushed into. + * + * It can be an instance of PageRow or + * a StackView from QtQuick Controls. + * + * \qml + * Kirigami.Page { + * id: root + * + * Button { + * text: "Push Page" + * onClicked: Kirigami.PageStack.push(Qt.resolvedurl("AnotherPage")); + * } + * } + * \endqml + * + * \since 6.10 + */ +class PageStackAttached : public QQuickAttachedPropertyPropagator +{ + Q_OBJECT + QML_NAMED_ELEMENT(PageStack) + QML_ATTACHED(PageStackAttached) + QML_UNCREATABLE("") + + /*! + * \qmlattachedproperty Item PageStack::pageStack + * + * This property holds the pageStack where this page was pushed. + * + * It will point to the proper instance in the parent hierarchy + * and normally is not necessary to explicitly write it. + * + * Write on this property only if it's desired this attached + * property and those of all the children to point to a different + * PageRow or StackView + */ + Q_PROPERTY(QQuickItem *pageStack READ pageStack WRITE setPageStack NOTIFY pageStackChanged) + +public: + explicit PageStackAttached(QObject *parent); + + QQuickItem *pageStack() const; + void setPageStack(QQuickItem *pageStack); + + /*! + * \qmlattachedmethod void PageStack::push(variant page, object properties) + */ + Q_INVOKABLE void push(const QVariant &page, const QVariantMap &properties = QVariantMap()); + + /*! + * \qmlattachedmethod void PageStack::replace(variant page, object properties) + */ + Q_INVOKABLE void replace(const QVariant &page, const QVariantMap &properties = QVariantMap()); + + /*! + * \qmlattachedmethod void PageStack::pop(variant page) + */ + Q_INVOKABLE void pop(const QVariant &page = QVariant()); + + /*! + * \qmlattachedmethod void PageStack::clear() + */ + Q_INVOKABLE void clear(); + + static PageStackAttached *qmlAttachedProperties(QObject *object); + +protected: + bool hasStackCapabilities(QQuickItem *candidate); + void propagatePageStack(QQuickItem *pageStack); + void attachedParentChange(QQuickAttachedPropertyPropagator *newParent, QQuickAttachedPropertyPropagator *oldParent) override; + +Q_SIGNALS: + void pageStackChanged(); + + /*! + * \qmlattachedsignal PageStack::closeDialog + * + * Close the currently opened dialog, which was opened with PageRow::pushDialogLayer. + * + * \since 6.20 + */ + void closeDialog(); + +private: + QPointer m_pageStack; + QPointer m_parentItem; + bool m_customStack = false; +}; diff --git a/local/recipes/kde/kirigami/source/src/platform/kirigamiplatform.qdoc b/local/recipes/kde/kirigami/source/src/platform/kirigamiplatform.qdoc new file mode 100644 index 0000000000..97b88c90eb --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/platform/kirigamiplatform.qdoc @@ -0,0 +1,26 @@ +/*! + \qmlmodule org.kde.kirigami.platform + \title Kirigami Platform QML Types + \brief Platform Integration Components. +*/ + +/*! + \module KirigamiPlatform + \title Kirigami Platform C++ Classes + \ingroup modules + \cmakepackage KF6 + \cmakecomponent KirigamiPlatform + + \brief Platform Integration Components. +*/ + +/*! + * \namespace Kirigami + * \inmodule KirigamiPlatform + */ + +/*! + * \namespace Kirigami::Platform + * \inmodule KirigamiPlatform + * \brief Platform Integration Components. + */ diff --git a/local/recipes/kde/kirigami/source/src/platform/kirigamiplatform.qdocconf b/local/recipes/kde/kirigami/source/src/platform/kirigamiplatform.qdocconf new file mode 100644 index 0000000000..4547dec33e --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/platform/kirigamiplatform.qdocconf @@ -0,0 +1,35 @@ +include($KDE_DOCS/global/qt-module-defaults.qdocconf) + +project = KirigamiPlatform +description = Platform Integration Components + +documentationinheaders = true + +headerdirs += . +sourcedirs += . + +depends = kde qtcore qtgui qtqml qtquick qtquickcontrols + +navigation.landingpage = "Kirigami" + +qhp.projects = KirigamiPlatform + +qhp.KirigamiPlatform.file = kirigamiplatform.qhp +qhp.KirigamiPlatform.namespace = org.kde.kirigamiplatform.$QT_VERSION_TAG +qhp.KirigamiPlatform.virtualFolder = kirigamiplatform +qhp.KirigamiPlatform.indexTitle = Kirigami Platform +qhp.KirigamiPlatform.indexRoot = + +qhp.KirigamiPlatform.subprojects = qmltypes classes + +qhp.KirigamiPlatform.subprojects.qmltypes.title = Kirigami Platform QML Types +qhp.KirigamiPlatform.subprojects.qmltypes.indexTitle = Kirigami Platform QML Types +qhp.KirigamiPlatform.subprojects.qmltypes.selectors = qmlclass +qhp.KirigamiPlatform.subprojects.qmltypes.sortPages = true + +qhp.KirigamiPlatform.subprojects.classes.title = Kirigami Platform C++ Classes +qhp.KirigamiPlatform.subprojects.classes.indexTitle = Kirigami Platform C++ Classes +qhp.KirigamiPlatform.subprojects.classes.selectors = class fake:headerfile +qhp.KirigamiPlatform.subprojects.classes.sortPages = true + +tagfile = kirigamiplatform.tags diff --git a/local/recipes/kde/kirigami/source/src/platform/stylehints.cpp b/local/recipes/kde/kirigami/source/src/platform/stylehints.cpp new file mode 100644 index 0000000000..378e74ae2e --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/platform/stylehints.cpp @@ -0,0 +1,137 @@ +/* + * SPDX-FileCopyrightText: 2026 Arjen Hiemstra + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#include "stylehints.h" + +#include + +namespace Kirigami +{ + +namespace Platform +{ + +class KIRIGAMIPLATFORM_NO_EXPORT StyleHints::Private +{ +public: + bool useAlternateBackgroundColor = false; + bool showFramedBackground = false; + int tickMarkStepSize = 0; + QString iconName; + QUrl iconSource; + + inline static std::function s_makeStyleHintsFunction; +}; + +StyleHints::StyleHints(QObject *parent) + : QObject(parent) + , d(std::make_unique()) +{ +} + +StyleHints::~StyleHints() noexcept +{ +} + +bool StyleHints::useAlternateBackgroundColor() const +{ + return d->useAlternateBackgroundColor; +} + +void StyleHints::setUseAlternateBackgroundColor(bool newUseAlternateBackgroundColor) +{ + if (newUseAlternateBackgroundColor == d->useAlternateBackgroundColor) { + return; + } + + d->useAlternateBackgroundColor = newUseAlternateBackgroundColor; + propertyChanged(ChangedProperty::UseAlternateBackgroundColor); + Q_EMIT useAlternateBackgroundColorChanged(); +} + +bool StyleHints::showFramedBackground() const +{ + return d->showFramedBackground; +} + +void StyleHints::setShowFramedBackground(bool newShowFramedBackground) +{ + if (newShowFramedBackground == d->showFramedBackground) { + return; + } + + d->showFramedBackground = newShowFramedBackground; + propertyChanged(ChangedProperty::ShowFramedBackground); + Q_EMIT showFramedBackgroundChanged(); +} + +int StyleHints::tickMarkStepSize() const +{ + return d->tickMarkStepSize; +} + +void StyleHints::setTickMarkStepSize(int newTickMarkStepSize) +{ + if (newTickMarkStepSize == d->tickMarkStepSize) { + return; + } + + d->tickMarkStepSize = newTickMarkStepSize; + propertyChanged(ChangedProperty::TickMarkStepSize); + Q_EMIT tickMarkStepSizeChanged(); +} + +QString StyleHints::iconName() const +{ + return d->iconName; +} + +void StyleHints::setIconName(const QString &newIconName) +{ + if (newIconName == d->iconName) { + return; + } + + d->iconName = newIconName; + propertyChanged(ChangedProperty::IconName); + Q_EMIT iconNameChanged(); +} + +QUrl StyleHints::iconSource() const +{ + return d->iconSource; +} + +void StyleHints::setIconSource(const QUrl &newIconSource) +{ + if (newIconSource == d->iconSource) { + return; + } + + d->iconSource = newIconSource; + Q_EMIT iconSourceChanged(); +} + +StyleHints *StyleHints::qmlAttachedProperties(QObject *object) +{ + if (Private::s_makeStyleHintsFunction) { + return Private::s_makeStyleHintsFunction(object); + } + + return new StyleHints(object); +} + +void StyleHints::setMakeStyleHintsFunction(const std::function &function) +{ + Private::s_makeStyleHintsFunction = function; +} + +void StyleHints::propertyChanged([[maybe_unused]] ChangedProperty change) +{ +} + +} +} diff --git a/local/recipes/kde/kirigami/source/src/platform/stylehints.h b/local/recipes/kde/kirigami/source/src/platform/stylehints.h new file mode 100644 index 0000000000..771d2f4480 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/platform/stylehints.h @@ -0,0 +1,159 @@ +/* + * SPDX-FileCopyrightText: 2026 Arjen Hiemstra + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#ifndef KIRIGAMI_PLATFORM_STYLEHINTS_H +#define KIRIGAMI_PLATFORM_STYLEHINTS_H + +#include +#include +#include +#include + +#include "kirigamiplatform_export.h" + +namespace Kirigami +{ +namespace Platform +{ +/*! + * \qmltype StyleHints + * \inqmlmodule org.kde.kirigami.platform + * + * \nativetype Kirigami::Platform::StyleHints + * + * \brief An attached type that contains hints for styles to use. + * + * The properties of StyleHints can be used by QtQuick styles to adjust how + * certain things look. Generally these properties are used to supplement the + * QtQuick Controls APIs is some way. + */ + +/*! + * \class Kirigami::Platform::StyleHints + * \inheaderfile Kirigami/Platform/StyleHints + * \inmodule KirigamiPlatform + * + * \brief A class providing an attached property to set hints for styles to use. + * + * This is mostly a class for QtQuick API. However, if you need to trigger + * specific behaviour in a custom style, you can call setMakeStyleHintsFunction() + * with a custom factory function to create a custom subclass of this class. The + * subclass can then respond to property changes of instances of this class. + */ +class KIRIGAMIPLATFORM_EXPORT StyleHints : public QObject +{ + Q_OBJECT + QML_ELEMENT + QML_ATTACHED(Kirigami::Platform::StyleHints) + QML_UNCREATABLE("Attached Property") + +public: + enum class ChangedProperty { + UseAlternateBackgroundColor, + ShowFramedBackground, + TickMarkStepSize, + IconName, + IconSource, + }; + + explicit StyleHints(QObject *parent = nullptr); + ~StyleHints() override; + + /*! + * \qmlproperty bool StyleHints::useAlternateBackgroundColor + * + * Should the background color use an alternating colors style. + */ + Q_PROPERTY(bool useAlternateBackgroundColor READ useAlternateBackgroundColor WRITE setUseAlternateBackgroundColor NOTIFY useAlternateBackgroundColorChanged) + bool useAlternateBackgroundColor() const; + void setUseAlternateBackgroundColor(bool newUseAlternateBackgroundColor); + Q_SIGNAL void useAlternateBackgroundColorChanged(); + + /*! + * \qmlproperty bool StyleHints::showFramedBackground + * + * Should the background use a framed rather than a plain style. + * + * Primarily intended for ScrollViews to indicate that the ScrollView should + * draw a frame. + */ + Q_PROPERTY(bool showFramedBackground READ showFramedBackground WRITE setShowFramedBackground NOTIFY showFramedBackgroundChanged) + bool showFramedBackground() const; + void setShowFramedBackground(bool newShowFramedBackground); + Q_SIGNAL void showFramedBackgroundChanged(); + + /*! + * \qmlproperty int StyleHints::tickMarkStepSize + * + * The step size to show tick marks at. + * + * A step size of 0 or less results in no tick marks being shown. + * This is mainly intended to be used by sliders. + */ + Q_PROPERTY(int tickMarkStepSize READ tickMarkStepSize WRITE setTickMarkStepSize NOTIFY tickMarkStepSizeChanged) + int tickMarkStepSize() const; + void setTickMarkStepSize(int newTickMarkStepSize); + Q_SIGNAL void tickMarkStepSizeChanged(); + + /*! + * \qmlproperty string StyleHints::iconName + * + * An icon theme name for an icon. + * + * To be used for controls that lack their own icon property, such as + * ComboBox. + */ + Q_PROPERTY(QString iconName READ iconName WRITE setIconName NOTIFY iconNameChanged) + QString iconName() const; + void setIconName(const QString &newIconName); + Q_SIGNAL void iconNameChanged(); + + /*! + * \qmlproperty url StyleHints::iconSource + * + * An icon source URL for an icon. + * + * To be used for controls that lack their own icon property, such as + * ComboBox. + */ + Q_PROPERTY(QUrl iconSource READ iconSource WRITE setIconSource NOTIFY iconSourceChanged) + QUrl iconSource() const; + void setIconSource(const QUrl &newIconSource); + Q_SIGNAL void iconSourceChanged(); + + static StyleHints *qmlAttachedProperties(QObject *object); + + /*! + * Set a different function to be used by qmlAttachedProperties() to create a StyleHints instance. + * + * This is provided to allow different platform plugins to provide their own + * StyleHints subclass. + * + * \todo KF7: This should really be part of PlatformPluginFactory but we + * cannot add new virtuals to it due to binary compatibility. Once we break + * binary compatibility, move this to PlatformPluginFactory. + */ + static void setMakeStyleHintsFunction(const std::function &function); + +protected: + /*! + * Helper function to notify subclasses of a property change. + * + * Reimplement this in a subclass to handle a change to one of the + * properties, without the overhead of making separate signal connections + * for each property. + */ + virtual void propertyChanged(ChangedProperty change); + +private: + class Private; + const std::unique_ptr d; +}; + +} +} + +#endif // KIRIGAMI_PLATFORM_STYLEHINTS_H diff --git a/local/recipes/kde/kirigami/source/src/polyfill/CMakeLists.txt b/local/recipes/kde/kirigami/source/src/polyfill/CMakeLists.txt new file mode 100644 index 0000000000..414dccc6e2 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/polyfill/CMakeLists.txt @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: ⓒ 2025 Volker Krause +# SPDX-License-Identifier: BSD-2-Clause + +add_library(KirigamiPolyfill) + +ecm_add_qml_module(KirigamiPolyfill URI "org.kde.kirigami.private.polyfill" + VERSION 1.0 + GENERATE_PLUGIN_SOURCE + INSTALLED_PLUGIN_TARGET KF6KirigamiPolyfillplugin + DEPENDENCIES QtQuick +) + +if (Qt6Quick_VERSION VERSION_LESS 6.9.0) + target_sources(KirigamiPolyfill PRIVATE + safearea.cpp + ) +endif() + +set_target_properties(KirigamiPolyfill PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION 6 + EXPORT_NAME "KirigamiPolyfill" +) + +target_link_libraries(KirigamiPolyfill PRIVATE Qt6::Quick) + +ecm_finalize_qml_module(KirigamiPolyfill EXPORT KirigamiTargets) + +install(TARGETS KirigamiPolyfill EXPORT KirigamiTargets ${KF_INSTALL_DEFAULT_ARGUMENTS}) diff --git a/local/recipes/kde/kirigami/source/src/polyfill/safearea.cpp b/local/recipes/kde/kirigami/source/src/polyfill/safearea.cpp new file mode 100644 index 0000000000..72b018869c --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/polyfill/safearea.cpp @@ -0,0 +1,23 @@ +// SPDX-FileCopyrightText: ⓒ 2025 Volker Krause +// SPDX-License-Identifier: LGPL-2.0-or-later + +#include "safearea.h" + +using namespace Kirigami; + +SafeAreaAttached::SafeAreaAttached(QObject *parent) + : QObject(parent) +{ +} + +QMarginsF SafeAreaAttached::margins() const +{ + return {}; +} + +SafeAreaAttached *SafeAreaAttached::qmlAttachedProperties(QObject *object) +{ + return new SafeAreaAttached(object); +} + +#include "moc_safearea.cpp" diff --git a/local/recipes/kde/kirigami/source/src/polyfill/safearea.h b/local/recipes/kde/kirigami/source/src/polyfill/safearea.h new file mode 100644 index 0000000000..a8052c5485 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/polyfill/safearea.h @@ -0,0 +1,53 @@ +// SPDX-FileCopyrightText: ⓒ 2025 Volker Krause +// SPDX-License-Identifier: LGPL-2.0-or-later + +#ifndef KIRIGAMI_SAFEAREA_H +#define KIRIGAMI_SAFEAREA_H + +#include +#include + +#include + +namespace Kirigami +{ + +/*! + * \qmltype SafeArea + * \inqmlmodule org.kde.kirigami.polyfill + * + * \brief A drop-in replacement for Qt's SafeArea attached property + * when using Qt prior to 6.9. When using Qt 6.9 or higher this type + * is not provided anymore so the "real" one from Qt gets used instead. + * + * Note that this has no actual functionality and will always report + * zero margins. + * + * This is for internal use only and will go away once the minimum Qt version + * for Kirigami has reached 6.9! + * + * \since 6.15 + */ +class SafeAreaAttached : public QObject +{ + Q_OBJECT + + Q_PROPERTY(QMarginsF margins READ margins NOTIFY marginsChanged FINAL) + + QML_NAMED_ELEMENT(SafeArea) + QML_ATTACHED(SafeAreaAttached) + QML_UNCREATABLE("") + +public: + explicit SafeAreaAttached(QObject *parent); + + [[nodiscard]] QMarginsF margins() const; + + [[nodiscard]] static SafeAreaAttached *qmlAttachedProperties(QObject *object); + +Q_SIGNALS: + void marginsChanged(); +}; +} + +#endif diff --git a/local/recipes/kde/kirigami/source/src/primitives/IconPropertiesGroup.qml b/local/recipes/kde/kirigami/source/src/primitives/IconPropertiesGroup.qml new file mode 100644 index 0000000000..2306339776 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/IconPropertiesGroup.qml @@ -0,0 +1,98 @@ +/* + * SPDX-FileCopyrightText: 2017 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQml + + +/*! + \qmltype IconPropertiesGroup + \inqmlmodule org.kde.kirigami.primitives + + \brief An object to be used as a grouped property compatible with QtQuickControls "icon" grouped property. + + Kirigami components which expose an icon grouped property use this class. + Use it if you are writing a component that exposes an icon that you wish to have an + icon property compatible with QtQuickControls one, with name, source, color, + width and height properties. + + \since 6.17 +*/ +QtObject { + /*! + \qmlproperty string name + + This property holds a freedesktop theme compatible name for the icon. + It is the preferred source for the icon + */ + property string name + + /*! + \qmlproperty var source + + This property can hold a full path to the icon, a QImage or a QIcon representing + the icon. Use this with care and prefer name when possible + */ + property var source + + /*! + \qmlproperty color color + + This property holds a color for the icon. + Only monochrome svg icons can be dynamically recolored. + */ + property color color: Qt.rgba(0, 0, 0, 0) + + /*! + \qmlproperty real width + + This property holds the preferred width for the icon. + This is a size hint for the icon. It depends from the control implementation + how this is enforced or not. + */ + property real width + + /*! + \qmlproperty real height + + This property holds the preferred height for the icon. + This is a size hint for the icon. It depends from the control implementation + how this is enforced or not. + */ + property real height + + /*! + \qmlmethod IconPropertiesGroup IconPropertiesGroup::fromControlsIcon(var icon) + + \a icon The icon to bind to. + + This method is used to bind an icon from a QtQuickControls to an IconPropertiesGroup + to have them to be kept in sync, use it as follows: + + \qml + import QtQuick + import QtQuick.Controls as QQC + import org.kde.kirigami as Kirigami + + Item { + Kirigami.PlaceholderMessage { + icon: icon.fromControlsIcon(button.icon) + } + QQC.Button { + id.button + } + } + \endqml + */ + function fromControlsIcon(icon) { + name = Qt.binding(() => icon.name) + source = Qt.binding(() => icon.source) + color = Qt.binding(() => icon.color) + width = Qt.binding(() => icon.width) + height = Qt.binding(() => icon.height) + return this + } +} diff --git a/local/recipes/kde/kirigami/source/src/primitives/alignedsizeattached.cpp b/local/recipes/kde/kirigami/source/src/primitives/alignedsizeattached.cpp new file mode 100644 index 0000000000..6afe1c8fac --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/alignedsizeattached.cpp @@ -0,0 +1,131 @@ +/* + * SPDX-FileCopyrightText: 2017 Marco Martin + * SPDX-FileCopyrightText: 2023 ivan tkachenko + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#include "alignedsizeattached.h" +#include +#include + +AlignedSizeAttached::AlignedSizeAttached(QObject *parent) + : QObject(parent) +{ + m_item = qobject_cast(parent); + + if (!m_item) { + qWarning() << "AlignedSizeAttached attached to" << parent << "Attaching to a non QQuickItem derived object won't work"; + return; + } + + connect(m_item, &QQuickItem::windowChanged, this, [this](QQuickWindow *window) { + if (m_window) { + m_window->removeEventFilter(this); + } + m_window = qobject_cast(m_item->window()); + if (!m_window) { + return; + } + m_window->installEventFilter(this); + dprChanged(); + }); + m_window = qobject_cast(m_item->window()); + if (!m_window) { + return; + } + dprChanged(); + m_window->installEventFilter(this); +} + +AlignedSizeAttached::~AlignedSizeAttached() +{ +} + +qreal AlignedSizeAttached::width() const +{ + return m_width; +} + +void AlignedSizeAttached::setWidth(qreal width) +{ + if (width == m_width) { + return; + } + + m_width = width; + + if (m_width >= 0) { + m_item->setWidth(alignedWidth()); + } + + Q_EMIT widthChanged(); +} + +void AlignedSizeAttached::resetWidth() +{ + m_width = -1.0; + Q_EMIT widthChanged(); +} + +qreal AlignedSizeAttached::height() const +{ + return m_height; +} + +void AlignedSizeAttached::setHeight(qreal height) +{ + if (height == m_height) { + return; + } + + m_height = height; + + if (m_height >= 0) { + m_item->setHeight(alignedHeight()); + } + + Q_EMIT heightChanged(); +} + +void AlignedSizeAttached::resetHeight() +{ + m_height = -1.0; + Q_EMIT heightChanged(); +} + +qreal AlignedSizeAttached::alignedWidth() const +{ + return std::round(m_width * m_dpr) / m_dpr; +} + +qreal AlignedSizeAttached::alignedHeight() const +{ + return std::round(m_height * m_dpr) / m_dpr; +} + +void AlignedSizeAttached::dprChanged() +{ + m_dpr = m_window->effectiveDevicePixelRatio(); + if (m_width >= 0) { + m_item->setWidth(alignedWidth()); + } + if (m_height >= 0) { + m_item->setHeight(alignedHeight()); + } +} + +bool AlignedSizeAttached::eventFilter(QObject *watched, QEvent *event) +{ + if (event->type() == QEvent::DevicePixelRatioChange) { + dprChanged(); + } + return QObject::eventFilter(watched, event); +} + +AlignedSizeAttached *AlignedSizeAttached::qmlAttachedProperties(QObject *object) +{ + return new AlignedSizeAttached(object); +} + +#include "moc_alignedsizeattached.cpp" diff --git a/local/recipes/kde/kirigami/source/src/primitives/alignedsizeattached.h b/local/recipes/kde/kirigami/source/src/primitives/alignedsizeattached.h new file mode 100644 index 0000000000..8cdddaf418 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/alignedsizeattached.h @@ -0,0 +1,95 @@ +/* + * SPDX-FileCopyrightText: 2018 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#ifndef ALIGNEDSIZEATTACHED_H +#define ALIGNEDSIZEATTACHED_H + +#include +#include +#include + +class QQuickItem; + +/*! + * \qmltype AlignedSize + * \inqmlmodule org.kde.kirigami.primitives + * + * \brief An attached property that aligns a size on the physical pixel grid. + * + * Transforms a size to the nearest one perfectly aligned to the pixel grid + * in case fractional scaling in used. + * \qml + * import org.kde.kirigami as Kirigami + * + * Rectangle { + * width: AlignedSize.alignedWidth + * height: AlignedSize.alignedHeight + * AlignedSize.width: Units.gridUnit + * AlignedSize.height: 1 + * } + * \endqml + * + * \since 6.20 + */ +class AlignedSizeAttached : public QObject +{ + Q_OBJECT + QML_ATTACHED(AlignedSizeAttached) + QML_NAMED_ELEMENT(AlignedSize) + QML_UNCREATABLE("") + + /*! + * \qmlattachedproperty real AlignedSize::width + * + * The width of the item in logical pixels + * + */ + Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged RESET resetWidth FINAL) + + /*! + * \qmlattachedproperty real AlignedSize::height + * + * The height of the item in logical pixels + * + */ + Q_PROPERTY(qreal height READ height WRITE setHeight NOTIFY heightChanged RESET resetHeight FINAL) + +public: + explicit AlignedSizeAttached(QObject *parent = nullptr); + ~AlignedSizeAttached() override; + + qreal width() const; + void setWidth(qreal width); + void resetWidth(); + + qreal height() const; + void setHeight(qreal height); + void resetHeight(); + + // QML attached property + static AlignedSizeAttached *qmlAttachedProperties(QObject *object); + + bool eventFilter(QObject *watched, QEvent *event) override; + +Q_SIGNALS: + void widthChanged(); + void heightChanged(); + +private: + qreal alignedWidth() const; + qreal alignedHeight() const; + void dprChanged(); + + QQuickItem *m_item = nullptr; + QPointer m_window; + qreal m_dpr = 1.0; + qreal m_width = -1.0; + qreal m_height = -1.0; +}; + +QML_DECLARE_TYPEINFO(AlignedSizeAttached, QML_HAS_ATTACHED_PROPERTIES) + +#endif // ALIGNEDSIZEATTACHED_H diff --git a/local/recipes/kde/kirigami/source/src/primitives/examples/icon/CustomSource.qml b/local/recipes/kde/kirigami/source/src/primitives/examples/icon/CustomSource.qml new file mode 100644 index 0000000000..4e88532d58 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/examples/icon/CustomSource.qml @@ -0,0 +1,5 @@ +import org.kde.kirigami as Kirigami + +Kirigami.Icon { + source: "image://provider/kirigami.svg" +} diff --git a/local/recipes/kde/kirigami/source/src/primitives/examples/icon/Fallback.qml b/local/recipes/kde/kirigami/source/src/primitives/examples/icon/Fallback.qml new file mode 100644 index 0000000000..d9c60a23b7 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/examples/icon/Fallback.qml @@ -0,0 +1,6 @@ +import org.kde.kirigami as Kirigami + +Kirigami.Icon { + source: "this-icon-does-not-exist" + fallback: "view-refresh" +} diff --git a/local/recipes/kde/kirigami/source/src/primitives/examples/icon/FilesystemSource.qml b/local/recipes/kde/kirigami/source/src/primitives/examples/icon/FilesystemSource.qml new file mode 100644 index 0000000000..78dda83dda --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/examples/icon/FilesystemSource.qml @@ -0,0 +1,5 @@ +import org.kde.kirigami as Kirigami + +Kirigami.Icon { + source: "/home/example/cool.svg" +} diff --git a/local/recipes/kde/kirigami/source/src/primitives/examples/icon/IconThemeSource.qml b/local/recipes/kde/kirigami/source/src/primitives/examples/icon/IconThemeSource.qml new file mode 100644 index 0000000000..cd53c43682 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/examples/icon/IconThemeSource.qml @@ -0,0 +1,5 @@ +import org.kde.kirigami as Kirigami + +Kirigami.Icon { + source: "view-refresh" +} diff --git a/local/recipes/kde/kirigami/source/src/primitives/examples/icon/InternetSource.qml b/local/recipes/kde/kirigami/source/src/primitives/examples/icon/InternetSource.qml new file mode 100644 index 0000000000..84526d65d5 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/examples/icon/InternetSource.qml @@ -0,0 +1,5 @@ +import org.kde.kirigami as Kirigami + +Kirigami.Icon { + source: "https://example.com/kirigami.png" +} diff --git a/local/recipes/kde/kirigami/source/src/primitives/examples/icon/ResourceSource.qml b/local/recipes/kde/kirigami/source/src/primitives/examples/icon/ResourceSource.qml new file mode 100644 index 0000000000..e3089961a1 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/examples/icon/ResourceSource.qml @@ -0,0 +1,5 @@ +import org.kde.kirigami as Kirigami + +Kirigami.Icon { + source: "qrc:/kirigami.svg" +} diff --git a/local/recipes/kde/kirigami/source/src/primitives/mnemonicattached.cpp b/local/recipes/kde/kirigami/source/src/primitives/mnemonicattached.cpp new file mode 100644 index 0000000000..72079d656c --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/mnemonicattached.cpp @@ -0,0 +1,503 @@ +/* + * SPDX-FileCopyrightText: 2017 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#include "mnemonicattached.h" +#include +#include +#include +#include +#include +#include + +QHash MnemonicAttached::s_sequenceToObject = QHash(); + +// If pos points to alphanumeric X in "...(X)...", which is preceded or +// followed only by non-alphanumerics, then "(X)" gets removed. +static QString removeReducedCJKAccMark(const QString &label, int pos) +{ + /* clang-format off */ + if (pos > 0 && pos + 1 < label.length() + && label[pos - 1] == QLatin1Char('(') + && label[pos + 1] == QLatin1Char(')') + && label[pos].isLetterOrNumber()) { /* clang-format on */ + // Check if at start or end, ignoring non-alphanumerics. + int len = label.length(); + int p1 = pos - 2; + while (p1 >= 0 && !label[p1].isLetterOrNumber()) { + --p1; + } + ++p1; + int p2 = pos + 2; + while (p2 < len && !label[p2].isLetterOrNumber()) { + ++p2; + } + --p2; + + const QStringView strView(label); + if (p1 == 0) { + return strView.left(pos - 1) + strView.mid(p2 + 1); + } else if (p2 + 1 == len) { + return strView.left(p1) + strView.mid(pos + 2); + } + } + return label; +} + +static QString removeAcceleratorMarker(const QString &label_) +{ + QString label = label_; + + int p = 0; + bool accmarkRemoved = false; + while (true) { + p = label.indexOf(QLatin1Char('&'), p); + if (p < 0 || p + 1 == label.length()) { + break; + } + + if (label.at(p + 1).isLetterOrNumber()) { + // Valid accelerator. + const QStringView sv(label); + label = sv.left(p) + sv.mid(p + 1); + + // May have been an accelerator in CJK-style "(&X)" + // at the start or end of text. + label = removeReducedCJKAccMark(label, p); + + accmarkRemoved = true; + } else if (label.at(p + 1) == QLatin1Char('&')) { + // Escaped accelerator marker. + const QStringView sv(label); + label = sv.left(p) + sv.mid(p + 1); + } + + ++p; + } + + // If no marker was removed, and there are CJK characters in the label, + // also try to remove reduced CJK marker -- something may have removed + // ampersand beforehand. + if (!accmarkRemoved) { + bool hasCJK = false; + for (const QChar c : std::as_const(label)) { + if (c.unicode() >= 0x2e00) { // rough, but should be sufficient + hasCJK = true; + break; + } + } + if (hasCJK) { + p = 0; + while (true) { + p = label.indexOf(QLatin1Char('('), p); + if (p < 0) { + break; + } + label = removeReducedCJKAccMark(label, p + 1); + ++p; + } + } + } + + return label; +} + +class MnemonicEventFilter : public QObject +{ + Q_OBJECT + +public: + static MnemonicEventFilter &instance() + { + static MnemonicEventFilter s_instance; + return s_instance; + } + + bool eventFilter(QObject *watched, QEvent *event) override + { + Q_UNUSED(watched); + + if (event->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast(event); + if (ke->key() == Qt::Key_Alt) { + m_altPressed = true; + Q_EMIT altPressed(); + } + } else if (event->type() == QEvent::KeyRelease) { + QKeyEvent *ke = static_cast(event); + if (ke->key() == Qt::Key_Alt) { + m_altPressed = false; + Q_EMIT altReleased(); + } + } else if (event->type() == QEvent::ApplicationStateChange) { + if (m_altPressed) { + m_altPressed = false; + Q_EMIT altReleased(); + } + } + + return false; + } + +Q_SIGNALS: + void altPressed(); + void altReleased(); + +private: + MnemonicEventFilter() + : QObject(nullptr) + { + qGuiApp->installEventFilter(this); + } + + bool m_altPressed = false; +}; + +MnemonicAttached::MnemonicAttached(QObject *parent) + : QObject(parent) +{ + connect(&MnemonicEventFilter::instance(), &MnemonicEventFilter::altPressed, this, &MnemonicAttached::onAltPressed); + connect(&MnemonicEventFilter::instance(), &MnemonicEventFilter::altReleased, this, &MnemonicAttached::onAltReleased); +} + +MnemonicAttached::~MnemonicAttached() +{ + s_sequenceToObject.remove(m_sequence); +} + +QWindow *MnemonicAttached::window() const +{ + if (auto *parentItem = qobject_cast(parent())) { + if (auto *window = parentItem->window()) { + if (auto *renderWindow = QQuickRenderControl::renderWindowFor(window)) { + return renderWindow; + } + + return window; + } + } + + return nullptr; +} + +void MnemonicAttached::onAltPressed() +{ + if (m_active || !m_enabled || m_richTextLabel.isEmpty()) { + return; + } + + auto *win = window(); + if (!win || !win->isActive()) { + return; + } + + m_actualRichTextLabel = m_richTextLabel; + Q_EMIT richTextLabelChanged(); + m_active = true; + Q_EMIT activeChanged(); +} + +void MnemonicAttached::onAltReleased() +{ + if (!m_active || m_richTextLabel.isEmpty()) { + return; + } + + // Disabling menmonics again is always fine, e.g. on window deactivation, + // don't check for enabled or window is active here. + + m_actualRichTextLabel = removeAcceleratorMarker(m_label); + Q_EMIT richTextLabelChanged(); + m_active = false; + Q_EMIT activeChanged(); +} + +// Algorithm adapted from KAccelString +void MnemonicAttached::calculateWeights() +{ + m_weights.clear(); + + int pos = 0; + bool start_character = true; + bool wanted_character = false; + + while (pos < m_label.length()) { + QChar c = m_label[pos]; + + // skip non typeable characters + if (!c.isLetterOrNumber() && c != QLatin1Char('&')) { + start_character = true; + ++pos; + continue; + } + + int weight = 1; + + // add special weight to first character + if (pos == 0) { + weight += FIRST_CHARACTER_EXTRA_WEIGHT; + // add weight to word beginnings + } else if (start_character) { + weight += WORD_BEGINNING_EXTRA_WEIGHT; + start_character = false; + } + + // add weight to characters that have an & beforehand + if (wanted_character) { + weight += WANTED_ACCEL_EXTRA_WEIGHT; + wanted_character = false; + } + + // add decreasing weight to left characters + if (pos < 50) { + weight += (50 - pos); + } + + // try to preserve the wanted accelerators + /* clang-format off */ + if (c == QLatin1Char('&') + && (pos != m_label.length() - 1 + && m_label[pos + 1] != QLatin1Char('&') + && m_label[pos + 1].isLetterOrNumber())) { /* clang-format on */ + wanted_character = true; + ++pos; + continue; + } + + while (m_weights.contains(weight)) { + ++weight; + } + + if (c != QLatin1Char('&')) { + m_weights[weight] = c; + } + + ++pos; + } + + // update our maximum weight + if (m_weights.isEmpty()) { + m_weight = m_baseWeight; + } else { + m_weight = m_baseWeight + (std::prev(m_weights.cend())).key(); + } +} + +void MnemonicAttached::updateSequence() +{ + const QKeySequence oldSequence = m_sequence; + + if (!m_sequence.isEmpty()) { + s_sequenceToObject.remove(m_sequence); + m_sequence = {}; + } + + calculateWeights(); + + // Preserve strings like "One & Two" where & is not an accelerator escape + const QString text = label().replace(QStringLiteral("& "), QStringLiteral("&& ")); + m_actualRichTextLabel = removeAcceleratorMarker(text); + + if (!m_enabled) { + // was the label already completely plain text? try to limit signal emission + if (m_mnemonicLabel != m_actualRichTextLabel) { + m_mnemonicLabel = m_actualRichTextLabel; + Q_EMIT mnemonicLabelChanged(); + Q_EMIT richTextLabelChanged(); + } + + if (m_sequence != oldSequence) { + Q_EMIT sequenceChanged(); + } + return; + } + + m_mnemonicLabel = text; + m_mnemonicLabel.replace(QRegularExpression(QLatin1String("\\&([^\\&])")), QStringLiteral("\\1")); + + if (!m_weights.isEmpty()) { + QMap::const_iterator i = m_weights.constEnd(); + do { + --i; + QChar c = i.value(); + + QKeySequence ks(QStringLiteral("Alt+") % c); + MnemonicAttached *otherMa = s_sequenceToObject.value(ks); + Q_ASSERT(otherMa != this); + if (!otherMa || otherMa->m_weight < m_weight) { + // the old shortcut is less valuable than the current: remove it + if (otherMa) { + s_sequenceToObject.remove(otherMa->sequence()); + otherMa->m_sequence = {}; + } + + s_sequenceToObject[ks] = this; + m_sequence = ks; + m_richTextLabel = text; + m_richTextLabel.replace(QRegularExpression(QLatin1String("\\&([^\\&])")), QStringLiteral("\\1")); + m_mnemonicLabel = text; + const int mnemonicPos = m_mnemonicLabel.indexOf(c); + + if (mnemonicPos > -1 && (mnemonicPos == 0 || m_mnemonicLabel[mnemonicPos - 1] != QLatin1Char('&'))) { + m_mnemonicLabel.replace(mnemonicPos, 1, QStringLiteral("&") % c); + } + + const int richTextPos = m_richTextLabel.indexOf(c); + if (richTextPos > -1) { + m_richTextLabel.replace(richTextPos, 1, QLatin1String("") % c % QLatin1String("")); + } + + // remap the sequence of the previous shortcut + if (otherMa) { + otherMa->updateSequence(); + } + + break; + } + } while (i != m_weights.constBegin()); + } + + if (m_sequence != oldSequence) { + Q_EMIT sequenceChanged(); + } + + Q_EMIT richTextLabelChanged(); + Q_EMIT mnemonicLabelChanged(); +} + +void MnemonicAttached::setLabel(const QString &text) +{ + if (m_label == text) { + return; + } + + m_label = text; + updateSequence(); + Q_EMIT labelChanged(); + Q_EMIT plainTextLabelChanged(); +} + +QString MnemonicAttached::richTextLabel() const +{ + if (!m_actualRichTextLabel.isEmpty()) { + return m_actualRichTextLabel; + } else { + return removeAcceleratorMarker(m_label); + } +} + +QString MnemonicAttached::mnemonicLabel() const +{ + return m_mnemonicLabel; +} + +QString MnemonicAttached::plainTextLabel() const +{ + return removeAcceleratorMarker(m_label); +} + +QString MnemonicAttached::label() const +{ + return m_label; +} + +void MnemonicAttached::setEnabled(bool enabled) +{ + if (m_enabled == enabled) { + return; + } + + m_enabled = enabled; + updateSequence(); + Q_EMIT enabledChanged(); +} + +bool MnemonicAttached::enabled() const +{ + return m_enabled; +} + +void MnemonicAttached::setControlType(MnemonicAttached::ControlType controlType) +{ + if (m_controlType == controlType) { + return; + } + + m_controlType = controlType; + + switch (controlType) { + case ActionElement: + m_baseWeight = ACTION_ELEMENT_WEIGHT; + break; + case DialogButton: + m_baseWeight = DIALOG_BUTTON_EXTRA_WEIGHT; + break; + case MenuItem: + m_baseWeight = MENU_ITEM_WEIGHT; + break; + case FormLabel: + m_baseWeight = FORM_LABEL_WEIGHT; + break; + default: + m_baseWeight = SECONDARY_CONTROL_WEIGHT; + break; + } + // update our maximum weight + if (m_weights.isEmpty()) { + m_weight = m_baseWeight; + } else { + m_weight = m_baseWeight + (std::prev(m_weights.constEnd())).key(); + } + Q_EMIT controlTypeChanged(); +} + +MnemonicAttached::ControlType MnemonicAttached::controlType() const +{ + return m_controlType; +} + +QKeySequence MnemonicAttached::sequence() +{ + return m_sequence; +} + +bool MnemonicAttached::active() const +{ + return m_active; +} + +MnemonicAttached *MnemonicAttached::qmlAttachedProperties(QObject *object) +{ + return new MnemonicAttached(object); +} + +void MnemonicAttached::setActive(bool active) +{ + // We can't rely on previous value when it's true since it can be + // caused by Alt key press and we need to remove the event filter + // additionally. False should be ok as it's a default state. + if (!m_active && m_active == active) { + return; + } + + m_active = active; + + if (m_active) { + if (m_actualRichTextLabel != m_richTextLabel) { + m_actualRichTextLabel = m_richTextLabel; + Q_EMIT richTextLabelChanged(); + } + + } else { + m_actualRichTextLabel = removeAcceleratorMarker(m_label); + Q_EMIT richTextLabelChanged(); + } + + Q_EMIT activeChanged(); +} + +#include "mnemonicattached.moc" + +#include "moc_mnemonicattached.cpp" diff --git a/local/recipes/kde/kirigami/source/src/primitives/mnemonicattached.h b/local/recipes/kde/kirigami/source/src/primitives/mnemonicattached.h new file mode 100644 index 0000000000..b5fcfd2f4a --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/mnemonicattached.h @@ -0,0 +1,212 @@ +/* + * SPDX-FileCopyrightText: 2017 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#ifndef MNEMONICATTACHED_H +#define MNEMONICATTACHED_H + +#include +#include + +#include + +/*! + * \qmltype MnemonicData + * \inqmlmodule org.kde.kirigami + * + * \brief An attached property used to calculate automated keyboard sequences + * to trigger actions based upon their text. + * + * If an "&" mnemonic is used (such as "&Ok"), the system will attempt to assign + * the desired letter giving it priority, otherwise a letter among the ones + * in the label will be used if possible and not conflicting. + * + * Different kinds of controls will have different priorities in assigning the + * shortcut: for instance the "Ok/Cancel" buttons in a dialog will have priority + * over fields of a FormLayout. + * + * Usually the developer shouldn't use this directly as base components + * already use this, but only when implementing a custom graphical Control. + * \since 2.3 + */ +class MnemonicAttached : public QObject +{ + Q_OBJECT + QML_NAMED_ELEMENT(MnemonicData) + QML_ATTACHED(MnemonicAttached) + QML_UNCREATABLE("Cannot create objects of type MnemonicData, use it as an attached property") + + /*! + * \qmlattachedproperty string MnemonicData::label + * + * The label of the control we want to compute a mnemonic for, instance + * "Label:" or "&Ok" + */ + Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged FINAL) + + /*! + * \qmlattachedproperty string MnemonicData::richTextLabel + * + * The user-visible final label, which will have the shortcut letter underlined, + * such as "Ok". + */ + Q_PROPERTY(QString richTextLabel READ richTextLabel NOTIFY richTextLabelChanged FINAL) + + /*! + * \qmlattachedproperty string MnemonicData::mnemonicLabel + * + * The label with an "&" mnemonic in the place which will have the shortcut + * assigned, regardless of whether the & was assigned by the user or automatically generated. + */ + Q_PROPERTY(QString mnemonicLabel READ mnemonicLabel NOTIFY mnemonicLabelChanged FINAL) + + /*! + * \qmlattachedproperty string MnemonicData::plainTextLabel + * + * The label in plain text with no markup nor & markers. + */ + Q_PROPERTY(QString plainTextLabel READ plainTextLabel NOTIFY plainTextLabelChanged FINAL) + + /*! + * \qmlattachedproperty bool MnemonicData::enabled + * + * Only if true this mnemonic will be considered for the global assignment. + * + * default: true + */ + Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged FINAL) + + /*! + * \qmlattachedproperty enumeration MnemonicData::controlType + * + * The type of control this mnemonic is attached: different types of controls have different importance and priority for shortcut assignment. + * + * \qmlenumeratorsfrom MnemonicAttached::ControlType + */ + Q_PROPERTY(MnemonicAttached::ControlType controlType READ controlType WRITE setControlType NOTIFY controlTypeChanged FINAL) + + /*! + * \qmlattachedproperty keysequence MnemonicData::sequence + * + * The final key sequence assigned, if any: it will be Alt+alphanumeric char. + */ + Q_PROPERTY(QKeySequence sequence READ sequence NOTIFY sequenceChanged FINAL) + + /*! + * \qmlattachedproperty bool MnemonicData::active + * + * True when the user is pressing alt and the accelerators should be shown. + * + * \since 5.72 + * \since 2.15 + */ + Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged FINAL) + +public: + /*! + * \value ActionElement pushbuttons, checkboxes etc + * \value DialogButton buttons for dialogs + * \value MenuItem Menu items + * \value FormLabel Buddy label in a FormLayout + * \value SecondaryControl Other controls that are considered not much important and low priority for shortcuts + */ + enum ControlType { + ActionElement, + DialogButton, + MenuItem, + FormLabel, + SecondaryControl, + }; + Q_ENUM(ControlType) + + explicit MnemonicAttached(QObject *parent = nullptr); + ~MnemonicAttached() override; + + void setLabel(const QString &text); + QString label() const; + + QString richTextLabel() const; + QString mnemonicLabel() const; + QString plainTextLabel() const; + + void setEnabled(bool enabled); + bool enabled() const; + + void setControlType(MnemonicAttached::ControlType controlType); + ControlType controlType() const; + + QKeySequence sequence(); + + void setActive(bool active); + bool active() const; + + // QML attached property + static MnemonicAttached *qmlAttachedProperties(QObject *object); + +protected: + void updateSequence(); + +Q_SIGNALS: + void labelChanged(); + void enabledChanged(); + void sequenceChanged(); + void richTextLabelChanged(); + void mnemonicLabelChanged(); + void plainTextLabelChanged(); + void controlTypeChanged(); + void activeChanged(); + +private: + QWindow *window() const; + + void onAltPressed(); + void onAltReleased(); + + void calculateWeights(); + + // TODO: to have support for DIALOG_BUTTON_EXTRA_WEIGHT etc, a type enum should be exported + enum { + // Additional weight for first character in string + FIRST_CHARACTER_EXTRA_WEIGHT = 50, + // Additional weight for the beginning of a word + WORD_BEGINNING_EXTRA_WEIGHT = 50, + // Additional weight for a 'wanted' accelerator ie string with '&' + WANTED_ACCEL_EXTRA_WEIGHT = 150, + // Default weight for an 'action' widget (ie, pushbuttons) + ACTION_ELEMENT_WEIGHT = 50, + // Additional weight for the dialog buttons (large, we basically never want these reassigned) + DIALOG_BUTTON_EXTRA_WEIGHT = 300, + // Weight for FormLayout labels (low) + FORM_LABEL_WEIGHT = 20, + // Weight for Secondary controls which are considered less important (low) + SECONDARY_CONTROL_WEIGHT = 10, + // Default weight for menu items + MENU_ITEM_WEIGHT = 250, + }; + + // order word letters by weight + int m_weight = 0; + int m_baseWeight = 0; + ControlType m_controlType = SecondaryControl; + QMap m_weights; + + QString m_label; + QString m_actualRichTextLabel; + QString m_richTextLabel; + QString m_mnemonicLabel; + QKeySequence m_sequence; + bool m_enabled = true; + bool m_active = false; + + QPointer m_window; + + // global mapping of mnemonics + // TODO: map by QWindow + static QHash s_sequenceToObject; +}; + +QML_DECLARE_TYPEINFO(MnemonicAttached, QML_HAS_ATTACHED_PROPERTIES) + +#endif // MnemonicATTACHED_H diff --git a/local/recipes/kde/kirigami/source/src/primitives/scenegraph/iconmaterial.cpp b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/iconmaterial.cpp new file mode 100644 index 0000000000..af181109fa --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/iconmaterial.cpp @@ -0,0 +1,26 @@ +/* + * SPDX-FileCopyrightText: 2026 Volodymyr Zolotopupov + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#include "iconmaterial.h" + +#include +#include + +void IconMaterial::updateRenderStateUniforms(const QSGMaterialShader::RenderState &state) +{ + const auto viewport = state.viewportRect(); + const float w = viewport.width(); + const float h = viewport.height(); + + const std::array viewportData = { + w * 0.5f, + h * 0.5f, + 2.0f / w, + 2.0f / h, + }; + + memcpy(uniformData().data() + sizeof(float) * 24, viewportData.data(), sizeof(viewportData)); +} diff --git a/local/recipes/kde/kirigami/source/src/primitives/scenegraph/iconmaterial.h b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/iconmaterial.h new file mode 100644 index 0000000000..7c32d89100 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/iconmaterial.h @@ -0,0 +1,18 @@ +/* + * SPDX-FileCopyrightText: 2026 Volodymyr Zolotopupov + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#pragma once + +#include "shadermaterial.h" + +class IconMaterial : public ShaderMaterial +{ +public: + using ShaderMaterial::ShaderMaterial; + +protected: + void updateRenderStateUniforms(const QSGMaterialShader::RenderState &state) override; +}; diff --git a/local/recipes/kde/kirigami/source/src/primitives/scenegraph/iconnode.cpp b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/iconnode.cpp new file mode 100644 index 0000000000..ce20d999ca --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/iconnode.cpp @@ -0,0 +1,14 @@ +/* + * SPDX-FileCopyrightText: 2026 Volodymyr Zolotopupov + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#include "iconnode.h" + +#include "iconmaterial.h" + +QSGMaterial *IconNode::createMaterialVariant(QSGMaterialType *variant) +{ + return new IconMaterial(variant); +} diff --git a/local/recipes/kde/kirigami/source/src/primitives/scenegraph/iconnode.h b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/iconnode.h new file mode 100644 index 0000000000..580fabb6da --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/iconnode.h @@ -0,0 +1,18 @@ +/* + * SPDX-FileCopyrightText: 2026 Volodymyr Zolotopupov + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#pragma once + +#include "shadernode.h" + +class IconNode : public ShaderNode +{ +public: + IconNode() = default; + +protected: + QSGMaterial *createMaterialVariant(QSGMaterialType *variant) override; +}; diff --git a/local/recipes/kde/kirigami/source/src/primitives/scenegraph/shadermaterial.cpp b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/shadermaterial.cpp new file mode 100644 index 0000000000..937cf2d68c --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/shadermaterial.cpp @@ -0,0 +1,178 @@ +/* + * SPDX-FileCopyrightText: 2020 Arjen Hiemstra + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#include "shadermaterial.h" + +#include +#include + +using namespace Qt::StringLiterals; + +ShaderMaterial::ShaderMaterial(const QString &name) + : m_name(name) +{ + m_type = typeForName(name); + setFlag(QSGMaterial::Blending, true); +} + +ShaderMaterial::ShaderMaterial(QSGMaterialType *type) + : m_type(type) +{ + m_name = nameForType(type); + setFlag(QSGMaterial::Blending, true); +} + +QString ShaderMaterial::name() const +{ + return m_name; +} + +QSGMaterialShader *ShaderMaterial::createShader(QSGRendererInterface::RenderMode) const +{ + return new ShaderMaterialShader{m_name}; +} + +QSGMaterialType *ShaderMaterial::type() const +{ + return m_type; +} + +int ShaderMaterial::compare(const QSGMaterial *other) const +{ + auto material = static_cast(other); + if (m_uniformData == material->m_uniformData && m_textures == material->m_textures) { + return 0; + } + + return QSGMaterial::compare(other); +} + +void ShaderMaterial::setUniformBufferSize(qsizetype size) +{ + if (size == m_uniformData.size()) { + return; + } + + m_uniformData = QByteArray{size, '\0'}; +} + +std::span ShaderMaterial::uniformData() +{ + return std::span(m_uniformData.data(), m_uniformData.size()); +} + +QSGTexture *ShaderMaterial::texture(int binding) +{ + return m_textures.value(binding, nullptr); +} + +void ShaderMaterial::setTexture(int binding, QSGTexture *texture) +{ + m_textures[binding] = texture; +} + +QSGTexture::Filtering ShaderMaterial::textureFiltering(int binding) const +{ + auto texture = m_textures.value(binding); + if (texture) { + return texture->filtering(); + } + + return QSGTexture::Linear; +} + +void ShaderMaterial::setTextureFiltering(int binding, QSGTexture::Filtering filtering) +{ + auto texture = m_textures.value(binding); + if (texture) { + texture->setFiltering(filtering); + } +} + +void ShaderMaterial::updateRenderStateUniforms(const QSGMaterialShader::RenderState &state) +{ + Q_UNUSED(state); +} + +QString ShaderMaterial::nameForType(QSGMaterialType *type) +{ + for (auto &[key, value] : s_materialTypes) { + if (value.get() == type) { + return key; + } + } + return QString(); +} + +QSGMaterialType *ShaderMaterial::typeForName(const QString &name) +{ + if (!s_materialTypes.contains(name)) { + s_materialTypes[name] = std::make_unique(); + } + return s_materialTypes[name].get(); +} + +ShaderMaterialShader::ShaderMaterialShader(const QString &shaderName) +{ + static const auto shaderRoot = QStringLiteral(":/qt/qml/org/kde/kirigami/primitives/shaders/"); + + setShaderFileName(Stage::VertexStage, shaderRoot + shaderName + u".vert.qsb"); + setShaderFileName(Stage::FragmentStage, shaderRoot + shaderName + u".frag.qsb"); +} + +bool ShaderMaterialShader::updateUniformData(RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) +{ + bool changed = false; + + auto data = state.uniformData()->data(); + auto remainingSize = std::size_t(state.uniformData()->size()); + + if (state.isMatrixDirty()) { + auto matrix = state.combinedMatrix(); + memcpy(data, matrix.data(), sizeof(float) * 16); + changed = true; + } + data += sizeof(float) * 16; + remainingSize -= sizeof(float) * 16; + + if (state.isOpacityDirty()) { + auto opacity = state.opacity(); + memcpy(data, &opacity, sizeof(float)); + changed = true; + } + + data += sizeof(float); + remainingSize -= sizeof(float); + + auto material = static_cast(newMaterial); + material->updateRenderStateUniforms(state); + + if (!oldMaterial || newMaterial->compare(oldMaterial) != 0) { + const auto uniformData = static_cast(newMaterial)->uniformData(); + memcpy(data, uniformData.data() + sizeof(float) * 17, remainingSize); + changed = true; + } + + return changed; +} + +void ShaderMaterialShader::updateSampledImage(QSGMaterialShader::RenderState &state, + int binding, + QSGTexture **texture, + QSGMaterial *newMaterial, + QSGMaterial *oldMaterial) +{ + Q_UNUSED(oldMaterial); + + auto material = static_cast(newMaterial); + auto source = material->texture(binding); + if (source) { + source->commitTextureOperations(state.rhi(), state.resourceUpdateBatch()); + *texture = source; + } else { + *texture = nullptr; + } +} diff --git a/local/recipes/kde/kirigami/source/src/primitives/scenegraph/shadermaterial.h b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/shadermaterial.h new file mode 100644 index 0000000000..d5c0940bfb --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/shadermaterial.h @@ -0,0 +1,71 @@ +/* + * SPDX-FileCopyrightText: 2025 Arjen Hiemstra + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#pragma once + +#include +#include +#include +#include + +#include "uniformdatastream.h" + +/** + * A material rendering a rectangle with a shadow. + * + * This material uses a distance field shader to render a rectangle with a + * shadow below it, optionally with rounded corners. + */ +class ShaderMaterial : public QSGMaterial +{ +public: + ShaderMaterial(const QString &name); + ShaderMaterial(QSGMaterialType *type); + + QString name() const; + + QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const override; + QSGMaterialType *type() const override; + int compare(const QSGMaterial *other) const override; + + void setUniformBufferSize(qsizetype size); + std::span uniformData(); + + QSGTexture *texture(int binding); + void setTexture(int binding, QSGTexture *texture); + + QSGTexture::Filtering textureFiltering(int binding) const; + void setTextureFiltering(int binding, QSGTexture::Filtering filtering); + + static QString nameForType(QSGMaterialType *type); + static QSGMaterialType *typeForName(const QString &name); + +protected: + virtual void updateRenderStateUniforms(const QSGMaterialShader::RenderState &state); + +private: + QString m_name; + QSGMaterialType *m_type; + + QByteArray m_uniformData; + QHash m_textures; + inline static std::unordered_map> s_materialTypes; + + friend class ShaderMaterialShader; +}; + +class ShaderMaterialShader : public QSGMaterialShader +{ +public: + ShaderMaterialShader(const QString &shaderName); + + bool updateUniformData(QSGMaterialShader::RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override; + void updateSampledImage(QSGMaterialShader::RenderState &state, // + int binding, + QSGTexture **texture, + QSGMaterial *newMaterial, + QSGMaterial *oldMaterial) override; +}; diff --git a/local/recipes/kde/kirigami/source/src/primitives/scenegraph/shadernode.cpp b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/shadernode.cpp new file mode 100644 index 0000000000..92c23bf43e --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/shadernode.cpp @@ -0,0 +1,291 @@ +/* + * SPDX-FileCopyrightText: 2025 Arjen Hiemstra + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#include "shadernode.h" + +#include "shadermaterial.h" +#include "texturecache.h" + +struct VertexLayout { + using RectPropertyFunction = qreal (QRectF::*)() const; + + RectPropertyFunction x; + RectPropertyFunction y; +}; + +static const std::array Vertices = { + VertexLayout{.x = &QRectF::left, .y = &QRectF::top}, + VertexLayout{.x = &QRectF::left, .y = &QRectF::bottom}, + VertexLayout{.x = &QRectF::right, .y = &QRectF::top}, + VertexLayout{.x = &QRectF::right, .y = &QRectF::bottom}, +}; + +ShaderNode::ShaderNode() + : m_rect(QRectF{0.0, 0.0, 1.0, 1.0}) + , m_uvs(16, QRectF{0.0, 0.0, 1.0, 1.0}) +{ + setFlags(QSGNode::OwnsGeometry | QSGNode::OwnsMaterial | QSGNode::UsePreprocess); +} + +ShaderNode::~ShaderNode() noexcept +{ + for (auto texture : std::as_const(m_textures)) { + if (texture.provider) { + texture.provider->disconnect(texture.providerConnection); + } + } + + delete[] m_attributeSet->attributes; + delete m_attributeSet; +} + +void ShaderNode::preprocess() +{ + for (const auto &info : std::as_const(m_textures)) { + if (info.provider) { + preprocessTexture(info); + } + } +} + +QRectF ShaderNode::rect() const +{ + return m_rect; +} + +void ShaderNode::setRect(const QRectF &newRect) +{ + if (newRect == m_rect) { + return; + } + + m_rect = newRect; + m_geometryUpdateNeeded = true; +} + +QRectF ShaderNode::uvs(TextureChannel channel) const +{ + Q_ASSERT(channel < m_textureChannels); + return m_uvs[channel]; +} + +void ShaderNode::setUVs(TextureChannel channel, const QRectF &newUvs) +{ + Q_ASSERT(channel < m_textureChannels); + + if (newUvs == m_uvs[channel]) { + return; + } + + m_uvs[channel] = newUvs; + m_geometryUpdateNeeded = true; +} + +QSGMaterialType *ShaderNode::materialVariant() const +{ + return m_materialVariant; +} + +void ShaderNode::setMaterialVariant(QSGMaterialType *variant) +{ + if (variant == m_materialVariant) { + return; + } + + m_materialVariant = variant; + + auto newMaterial = createMaterialVariant(m_materialVariant); + if (newMaterial) { + m_shaderMaterial = dynamic_cast(newMaterial); + setMaterial(newMaterial); + markDirty(QSGNode::DirtyMaterial); + } +} + +void ShaderNode::setShader(const QString &shader) +{ + setMaterialVariant(ShaderMaterial::typeForName(shader)); +} + +void ShaderNode::setUniformBufferSize(qsizetype size) +{ + if (!m_shaderMaterial) { + return; + } + + m_shaderMaterial->setUniformBufferSize(size); +} + +std::span ShaderNode::uniformData() +{ + if (!m_shaderMaterial) { + return std::span{}; + } + + return m_shaderMaterial->uniformData(); +} + +void ShaderNode::setTextureChannels(unsigned char count) +{ + if (count == m_textureChannels) { + return; + } + + m_textureChannels = std::clamp(count, uint8_t(1), uint8_t(16)); + + if (geometry()) { + setGeometry(nullptr); + delete[] m_attributeSet->attributes; + delete m_attributeSet; + } + + while (m_textures.size() > count) { + m_textures.removeLast(); + } + + m_geometryUpdateNeeded = true; +} + +void ShaderNode::setTexture(TextureChannel channel, const QImage &image, QQuickWindow *window, QQuickWindow::CreateTextureOptions options) +{ + if (!m_shaderMaterial) { + return; + } + + auto texture = TextureCache::loadTexture(window, image, options); + if (!texture) { + return; + } + + auto info = TextureInfo{ + .channel = channel, + .options = options, + .texture = texture, + .provider = nullptr, + .providerConnection = {}, + }; + + auto itr = std::find_if(m_textures.begin(), m_textures.end(), [channel](auto info) { + return info.channel == channel; + }); + if (itr != m_textures.end()) { + *itr = info; + } else { + m_textures.append(info); + } + + setUVs(channel, texture->normalizedTextureSubRect()); + + texture->setFiltering(QSGTexture::Filtering::Linear); + + m_shaderMaterial->setTexture(channel + 1, texture.get()); + markDirty(QSGNode::DirtyMaterial); +} + +void ShaderNode::setTexture(TextureChannel channel, QSGTextureProvider *provider, QQuickWindow::CreateTextureOptions options) +{ + if (!m_shaderMaterial) { + return; + } + + auto connection = QObject::connect(provider, &QSGTextureProvider::textureChanged, [this]() { + markDirty(QSGNode::DirtyMaterial); + }); + + auto info = TextureInfo{ + .channel = channel, + .options = options, + .texture = nullptr, + .provider = provider, + .providerConnection = connection, + }; + + auto itr = std::find_if(m_textures.begin(), m_textures.end(), [channel](auto info) { + return info.channel == channel; + }); + if (itr != m_textures.end()) { + if (itr->provider) { + itr->provider->disconnect(itr->providerConnection); + } + *itr = info; + } else { + m_textures.append(info); + } +} + +void ShaderNode::setTextureFiltering(TextureChannel channel, QSGTexture::Filtering filtering) +{ + auto itr = std::find_if(m_textures.begin(), m_textures.end(), [channel](auto info) { + return info.channel == channel; + }); + if (itr != m_textures.end()) { + itr->filtering = filtering; + if (itr->texture) { + itr->texture->setFiltering(filtering); + } + } +} + +void ShaderNode::update() +{ + if (m_geometryUpdateNeeded) { + const auto attributeCount = 1 + m_textureChannels; + + if (!geometry()) { + QSGGeometry::Attribute *attributes = new QSGGeometry::Attribute[attributeCount]; + attributes[0] = QSGGeometry::Attribute::createWithAttributeType(0, 2, QSGGeometry::FloatType, QSGGeometry::PositionAttribute); + + for (int i = 0; i < m_textureChannels; ++i) { + attributes[i + 1] = QSGGeometry::Attribute::createWithAttributeType(i + 1, 2, QSGGeometry::FloatType, QSGGeometry::TexCoordAttribute); + } + + m_attributeSet = + new QSGGeometry::AttributeSet{.count = attributeCount, .stride = int(sizeof(float)) * 2 * attributeCount, .attributes = attributes}; + + setGeometry(new QSGGeometry{*m_attributeSet, Vertices.size()}); + } + + auto vertices = static_cast(geometry()->vertexData()); + + auto index = 0; + for (auto layout : Vertices) { + vertices[index++] = (m_rect.*layout.x)(); + vertices[index++] = (m_rect.*layout.y)(); + + for (int channel = 0; channel < m_textureChannels; ++channel) { + auto uv = uvs(channel); + vertices[index++] = (uv.*layout.x)(); + vertices[index++] = (uv.*layout.y)(); + } + } + + markDirty(QSGNode::DirtyGeometry); + m_geometryUpdateNeeded = false; + } +} + +QSGMaterial *ShaderNode::createMaterialVariant(QSGMaterialType *variant) +{ + return new ShaderMaterial(variant); +} + +void ShaderNode::preprocessTexture(const TextureInfo &info) +{ + auto provider = info.provider; + if (!provider || !provider->texture() || !m_shaderMaterial) { + return; + } + + if (provider->texture()->isAtlasTexture() && !info.options.testFlag(QQuickWindow::TextureCanUseAtlas)) { + m_shaderMaterial->setTexture(info.channel + 1, provider->texture()->removedFromAtlas()); + } else { + m_shaderMaterial->setTexture(info.channel + 1, provider->texture()); + } + if (QSGDynamicTexture *dynamic_texture = qobject_cast(provider->texture())) { + dynamic_texture->updateTexture(); + } + m_shaderMaterial->setTextureFiltering(info.channel + 1, info.filtering); +} diff --git a/local/recipes/kde/kirigami/source/src/primitives/scenegraph/shadernode.h b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/shadernode.h new file mode 100644 index 0000000000..827d81304d --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/shadernode.h @@ -0,0 +1,162 @@ +/* + * SPDX-FileCopyrightText: 2025 Arjen Hiemstra + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include "uniformdatastream.h" + +class ShaderMaterial; + +/*! + * A base class for scene graph nodes that want to use a shader to render something. + */ +class ShaderNode : public QSGGeometryNode +{ +public: + using TextureChannel = unsigned char; + + struct TextureInfo { + TextureChannel channel = 0; + QQuickWindow::CreateTextureOptions options; + QSGTexture::Filtering filtering = QSGTexture::Linear; + std::shared_ptr texture = nullptr; + QPointer provider = nullptr; + QMetaObject::Connection providerConnection; + }; + + ShaderNode(); + ~ShaderNode() override; + + void preprocess() override; + + /*! + * The rectangle describing the geometry of this node. + */ + QRectF rect() const; + void setRect(const QRectF &newRect); + + /*! + * The UV coordinates of the geometry of this node. + */ + QRectF uvs(TextureChannel channel) const; + void setUVs(TextureChannel channel, const QRectF &newUvs); + + /*! + * The variant of the material used for rendering. + * + * This will be passed to createMaterialVariant() to perform the actual + * creation of the material. + */ + QSGMaterialType *materialVariant() const; + void setMaterialVariant(QSGMaterialType *variant); + + /*! + * Set the name of the shader to use for rendering. + * + * By default this will create and use an instance of ShaderMaterial that + * corresponds to the given shader. + */ + void setShader(const QString &shader); + + /*! + * Set the size of buffer used by the material for storing uniform values. + * + * The given size is in bytes. Note that you should account for all uniforms + * in your shader's uniform buffer. + */ + void setUniformBufferSize(qsizetype size); + + /*! + * A writeable view of the material's uniform data buffer. + * + * This can be used in combination with UniformDataStream to write the + * values of your uniforms. + */ + std::span uniformData(); + + /*! + * Set the number of texture channels. + * + * Each texture channel gets its own set of UV coordinates and texture. By + * default, the UVs will be set to (0, 0, 1, 1) unless the texture is an + * atlas texture, in which case coordinates matching the atlas will be used. + * Use setTexture() to set the texture to use for a channel. + */ + void setTextureChannels(unsigned char count); + + /*! + * Set the texture for a channel to an image. + * + * This will create a texture from \a image using \a window and the options + * specified by \a options, then assign it to texture channel \a channel. + * Textures created from images are cached, if an image has the same cache + * ID as a previous call to setTexture(), no new texture will be created. + */ + void setTexture(TextureChannel channel, const QImage &image, QQuickWindow *window, QQuickWindow::CreateTextureOptions options = {}); + + /*! + * Set the texture for a channel to a texture provider. + * + * This will use \a provider to provide the texture for channel \a channel. + * \a options will be used whenever a new texture is created from + * \a provider. + */ + void setTexture(TextureChannel channel, QSGTextureProvider *provider, QQuickWindow::CreateTextureOptions options = {}); + + /*! + * Set the texture filtering mode for texture \a channel to \a filtering. + */ + void setTextureFiltering(TextureChannel channel, QSGTexture::Filtering filtering); + + /*! + * Update internal state based on newly-set parameters. + * + * This is done as an explicit step to ensure we don't modify expensive GPU + * resources like geometry multiple times during a single update. + */ + virtual void update(); + + /*! + * Helper function that returns a pre-multiplied version of a color. + */ + static inline QColor toPremultiplied(const QColor &value) + { + return QColor::fromRgbF(value.redF() * value.alphaF(), // + value.greenF() * value.alphaF(), + value.blueF() * value.alphaF(), + value.alphaF()); + } + +protected: + /*! + * Create a new instance of a certain material variant. + * + * This should return a new instance of the material that matches \a variant, + * or nullptr if the specified variant cannot be handled by the current node. + */ + virtual QSGMaterial *createMaterialVariant(QSGMaterialType *variant); + +private: + void preprocessTexture(const TextureInfo &texture); + + QRectF m_rect; + QVarLengthArray m_uvs; + bool m_geometryUpdateNeeded = true; + unsigned char m_textureChannels = 1; + + QSGMaterialType *m_materialVariant = nullptr; + ShaderMaterial *m_shaderMaterial = nullptr; + + QList m_textures; + + QSGGeometry::AttributeSet *m_attributeSet = nullptr; +}; diff --git a/local/recipes/kde/kirigami/source/src/primitives/scenegraph/softwarerectanglenode.cpp b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/softwarerectanglenode.cpp new file mode 100644 index 0000000000..31355d9c0b --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/softwarerectanglenode.cpp @@ -0,0 +1,200 @@ +/* + * SPDX-FileCopyrightText: 2025 Arjen Hiemstra + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#include "softwarerectanglenode.h" + +#include +#include +#include + +#include "texturecache.h" + +SoftwareRectangleNode::SoftwareRectangleNode() +{ + setFlag(QSGNode::UsePreprocess); +} + +void SoftwareRectangleNode::setWindow(QQuickWindow *window) +{ + m_window = window; +} + +QRectF SoftwareRectangleNode::rect() const +{ + return m_rect; +} + +void SoftwareRectangleNode::setRect(const QRectF &rect) +{ + if (rect == m_rect) { + return; + } + + m_rect = rect; + markDirty(QSGNode::DirtyGeometry); +} + +void SoftwareRectangleNode::setColor(const QColor &color) +{ + if (color == m_color) { + return; + } + + m_color = color; + markDirty(QSGNode::DirtyMaterial); +} + +void SoftwareRectangleNode::setImage(const QImage &image) +{ + if (!m_window) { + return; + } + + if (m_imageNode) { + cleanupImageNode(); + } + + m_textureInfo = ShaderNode::TextureInfo{ + .channel = 0, + .options = {}, + .texture = TextureCache::loadTexture(m_window, image), + .provider = nullptr, + .providerConnection = {}, + }; + + if (!m_textureInfo.texture) { + return; + } + + m_imageNode = m_window->createImageNode(); + if (m_imageNode) { + m_imageNode->setTexture(m_textureInfo.texture.get()); + m_imageNode->setFiltering(QSGTexture::Filtering::Linear); + appendChildNode(m_imageNode); + } +} + +void SoftwareRectangleNode::setTextureProvider(QSGTextureProvider *provider) +{ + if (!m_window) { + return; + } + + if (m_imageNode) { + cleanupImageNode(); + } + + m_textureInfo = ShaderNode::TextureInfo{ + .channel = 0, + .options = {}, + .texture = nullptr, + .provider = provider, + .providerConnection = {}, + }; + + // The render node will be created in preprocess(). +} + +void SoftwareRectangleNode::setRadius(qreal radius) +{ + if (qFuzzyCompare(radius, m_radius)) { + return; + } + + m_radius = radius; + markDirty(QSGNode::DirtyMaterial); +} + +void SoftwareRectangleNode::setBorderWidth(qreal width) +{ + if (qFuzzyCompare(width, m_borderWidth)) { + return; + } + + m_borderWidth = width; + markDirty(QSGNode::DirtyMaterial); +} + +void SoftwareRectangleNode::setBorderColor(const QColor &color) +{ + if (color == m_borderColor) { + return; + } + + m_borderColor = color; + markDirty(QSGNode::DirtyMaterial); +} + +QSGRenderNode::RenderingFlags SoftwareRectangleNode::flags() const +{ + return BoundedRectRendering; +} + +void SoftwareRectangleNode::preprocess() +{ + auto provider = m_textureInfo.provider; + if (provider) { + QSGTexture *texture = provider->texture(); + if (QSGDynamicTexture *dynamic_texture = qobject_cast(texture)) { + dynamic_texture->updateTexture(); + } + + if (texture) { + if (!m_imageNode) { + m_imageNode = m_window->createImageNode(); + m_imageNode->setTexture(texture); + m_imageNode->setFiltering(QSGTexture::Filtering::Linear); + appendChildNode(m_imageNode); + } else { + m_imageNode->setTexture(texture); + } + } else if (m_imageNode) { + cleanupImageNode(); + } + } +} + +void SoftwareRectangleNode::render(const RenderState *state) +{ + auto painter = static_cast(m_window->rendererInterface()->getResource(m_window, QSGRendererInterface::PainterResource)); + Q_ASSERT(painter); + + const QRegion *clipRegion = state->clipRegion(); + if (clipRegion && !clipRegion->isEmpty()) { + painter->setClipRegion(*clipRegion, Qt::ReplaceClip); + } + + painter->setTransform(matrix()->toTransform()); + painter->setOpacity(inheritedOpacity()); + painter->setRenderHint(QPainter::Antialiasing, true); + painter->setPen(Qt::transparent); + + auto radius = std::min(m_radius, std::min(m_rect.width(), m_rect.height()) / 2); + auto borderWidth = std::floor(m_borderWidth); + + if (borderWidth > 0.0) { + painter->setBrush(m_borderColor); + painter->drawRoundedRect(m_rect, radius, radius); + } + + painter->setBrush(m_color); + auto adjustedRect = m_rect.adjusted(borderWidth, borderWidth, -borderWidth, -borderWidth); + painter->drawRoundedRect(adjustedRect, radius - borderWidth, radius - borderWidth); + + if (m_imageNode) { + static constexpr auto cornerAngle = 0.70710678; // sin(0.25pi) + auto cornerAdjustment = cornerAngle * (std::sqrt(std::pow(radius, 2.0) * 2.0) - radius + borderWidth); + auto withoutCorners = m_rect.adjusted(cornerAdjustment, cornerAdjustment, -cornerAdjustment, -cornerAdjustment); + m_imageNode->setRect(withoutCorners); + } +} + +void SoftwareRectangleNode::cleanupImageNode() +{ + removeChildNode(m_imageNode); + delete m_imageNode; + m_imageNode = nullptr; +} diff --git a/local/recipes/kde/kirigami/source/src/primitives/scenegraph/softwarerectanglenode.h b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/softwarerectanglenode.h new file mode 100644 index 0000000000..72898fdcc4 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/softwarerectanglenode.h @@ -0,0 +1,55 @@ +/* + * SPDX-FileCopyrightText: 2025 Arjen Hiemstra + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#pragma once + +#include +#include +#include + +#include "shadernode.h" + +class ShaderMaterial; + +/*! + * A scene graph node that implements rendering a rectangle with a color and + * texture for the software renderer. + */ +class SoftwareRectangleNode : public QSGRenderNode +{ +public: + SoftwareRectangleNode(); + + void setWindow(QQuickWindow *window); + + QRectF rect() const override; + void setRect(const QRectF &rect); + void setColor(const QColor &color); + void setImage(const QImage &image); + void setTextureProvider(QSGTextureProvider *provider); + void setRadius(qreal radius); + void setBorderWidth(qreal width); + void setBorderColor(const QColor &color); + + RenderingFlags flags() const override; + void preprocess() override; + void render(const RenderState *state) override; + +private: + void cleanupImageNode(); + + QQuickWindow *m_window = nullptr; + + QSGImageNode *m_imageNode = nullptr; + ShaderNode::TextureInfo m_textureInfo; + + QRectF m_rect; + // QImage m_image; + qreal m_radius = 0.0; + qreal m_borderWidth = 0.0; + QColor m_color = Qt::transparent; + QColor m_borderColor = Qt::transparent; +}; diff --git a/local/recipes/kde/kirigami/source/src/primitives/scenegraph/texturecache.cpp b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/texturecache.cpp new file mode 100644 index 0000000000..a882e70189 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/texturecache.cpp @@ -0,0 +1,44 @@ +/* + * SPDX-FileCopyrightText: 2011 Marco Martin + * SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez + * SPDX-FileCopyrightText: 2020 Carson Black + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#include "texturecache.h" + +#include + +std::shared_ptr TextureCache::loadTexture(QQuickWindow *window, const QImage &image, QQuickWindow::CreateTextureOptions options) +{ + if (image.isNull()) { + return nullptr; + } + + auto id = qMakePair(image.cacheKey(), window); + std::shared_ptr texture = s_cache.value(id).lock(); + + if (!texture) { + auto cleanAndDelete = [id](QSGTexture *texture) { + s_cache.remove(id); + delete texture; + }; + texture = std::shared_ptr(window->createTextureFromImage(image, options), cleanAndDelete); + s_cache[id] = texture; + } + + // if we have a cache in an atlas but our request cannot use an atlassed texture + // create a new texture and use that + // don't use removedFromAtlas() as that requires keeping a reference to the non atlased version + if (!(options & QQuickWindow::TextureCanUseAtlas) && texture->isAtlasTexture()) { + texture = std::shared_ptr(window->createTextureFromImage(image, options)); + } + + return texture; +} + +std::shared_ptr TextureCache::loadTexture(QQuickWindow *window, const QImage &image) +{ + return loadTexture(window, image, {}); +} diff --git a/local/recipes/kde/kirigami/source/src/primitives/scenegraph/texturecache.h b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/texturecache.h new file mode 100644 index 0000000000..c3c36ffc18 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/texturecache.h @@ -0,0 +1,29 @@ +/* + * SPDX-FileCopyrightText: 2011 Marco Martin + * SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez + * SPDX-FileCopyrightText: 2020 Carson Black + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#include + +class TextureCache +{ +public: + TextureCache() + { + } + + /** + * @returns the texture for a given @p window and @p image. + * + * If an @p image id is the same as one already provided before, we won't create + * a new texture and return a shared pointer to the existing texture. + */ + static std::shared_ptr loadTexture(QQuickWindow *window, const QImage &image, QQuickWindow::CreateTextureOptions options); + static std::shared_ptr loadTexture(QQuickWindow *window, const QImage &image); + +private: + inline static QHash, std::weak_ptr> s_cache; +}; diff --git a/local/recipes/kde/kirigami/source/src/primitives/scenegraph/uniformdatastream.h b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/uniformdatastream.h new file mode 100644 index 0000000000..3a21357c21 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/scenegraph/uniformdatastream.h @@ -0,0 +1,170 @@ +/* + * SPDX-FileCopyrightText: 2025 Arjen Hiemstra + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#pragma once + +#include + +#include +#include + +/*! + * A helper that simplifies writing uniform data for QSGMaterialShader. + */ +struct UniformDataStream { + inline UniformDataStream(std::span data) noexcept + : bytes(data.data()) + , remainingSize(data.size()) + { + } + + ~UniformDataStream() + { + } + + template + inline void skip(const Data &data = {}) + { + constexpr int dataSize = sizeof(Data); + align(dataSize); + Q_UNUSED(data); + + Q_ASSERT(remainingSize - dataSize >= 0); + + bytes += dataSize; + offset += dataSize; + remainingSize -= dataSize; + } + + inline void skipComponents(int count) + { + const int skipCount = count * 4; + align(4); + + Q_ASSERT(remainingSize - skipCount >= 0); + + bytes += skipCount; + offset += skipCount; + remainingSize -= skipCount; + } + + inline void skipMatrixOpacity() + { + align(Matrix4x4Size); + Q_ASSERT(remainingSize - Matrix4x4Size >= 0); + bytes += Matrix4x4Size; + offset += Matrix4x4Size; + remainingSize -= Matrix4x4Size; + + align(FloatSize); + Q_ASSERT(remainingSize - FloatSize >= 0); + bytes += FloatSize; + offset += FloatSize; + remainingSize -= FloatSize; + } + + template + friend inline UniformDataStream &operator<<(UniformDataStream &stream, const Data &data) + { + constexpr uint dataSize = sizeof(Data); + stream.align(dataSize); + + Q_ASSERT(stream.remainingSize - dataSize >= 0); + + memcpy(stream.bytes, &data, dataSize); + + stream.bytes += dataSize; + stream.offset += dataSize; + stream.remainingSize -= dataSize; + + return stream; + } + + friend inline UniformDataStream &operator<<(UniformDataStream &stream, const QMatrix4x4 &m) + { + stream.align(Matrix4x4Size); + + Q_ASSERT(stream.remainingSize - Matrix4x4Size >= 0); + + memcpy(stream.bytes, m.constData(), Matrix4x4Size); + stream.bytes += Matrix4x4Size; + stream.offset += Matrix4x4Size; + stream.remainingSize -= Matrix4x4Size; + + return stream; + } + + friend inline UniformDataStream &operator<<(UniformDataStream &stream, const QColor &color) + { + stream.align(ColorSize); + + Q_ASSERT(stream.remainingSize - ColorSize >= 0); + + std::array colorArray; + color.getRgbF(&colorArray[0], &colorArray[1], &colorArray[2], &colorArray[3]); + memcpy(stream.bytes, colorArray.data(), ColorSize); + + stream.bytes += ColorSize; + stream.offset += ColorSize; + stream.remainingSize -= ColorSize; + + return stream; + } + + template + friend inline UniformDataStream &operator<<(UniformDataStream &stream, const QList &v) + { + for (const auto &item : v) { + stream << item; + // Using std140, array elements are padded to a size of 16 bytes per element. + stream.align(16); + } + return stream; + } + + char *bytes; + int remainingSize; + int padding = 16; + int offset = 0; + +private: + static constexpr int FloatSize = sizeof(float); + static constexpr int ColorSize = FloatSize * 4; + static constexpr int Matrix4x4Size = FloatSize * 4 * 4; + + // Encode alignment rules for std140. + // Minimum alignment is 4 bytes. + // Vec2 alignment is 8 bytes. + // Vec3 and Vec4 alignment is 16 bytes. + inline void align(uint size) + { + if (size <= 4) { + const auto padding = offset % 4 > 0 ? 4 - offset % 4 : 0; + + Q_ASSERT(remainingSize - padding >= 0); + + offset += padding; + bytes += padding; + remainingSize -= padding; + } else if (size <= 8) { + auto padding = offset % 8 > 0 ? 8 - offset % 8 : 0; + + Q_ASSERT(remainingSize - padding >= 0); + + offset += padding; + bytes += padding; + remainingSize -= padding; + } else { + auto padding = offset % 16 > 0 ? 16 - offset % 16 : 0; + + Q_ASSERT(remainingSize - padding >= 0); + + offset += padding; + bytes += padding; + remainingSize -= padding; + } + } +}; diff --git a/local/recipes/kde/kirigami/source/src/primitives/scenepositionattached.cpp b/local/recipes/kde/kirigami/source/src/primitives/scenepositionattached.cpp new file mode 100644 index 0000000000..e77f16cf40 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/scenepositionattached.cpp @@ -0,0 +1,87 @@ +/* + * SPDX-FileCopyrightText: 2017 Marco Martin + * SPDX-FileCopyrightText: 2023 ivan tkachenko + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#include "scenepositionattached.h" +#include +#include + +ScenePositionAttached::ScenePositionAttached(QObject *parent) + : QObject(parent) +{ + m_item = qobject_cast(parent); + connectAncestors(m_item); +} + +ScenePositionAttached::~ScenePositionAttached() +{ +} + +qreal ScenePositionAttached::x() const +{ + qreal x = 0.0; + QQuickItem *item = m_item; + + while (item) { + x += item->x(); + item = item->parentItem(); + } + + return x; +} + +qreal ScenePositionAttached::y() const +{ + qreal y = 0.0; + QQuickItem *item = m_item; + + while (item) { + y += item->y(); + item = item->parentItem(); + } + + return y; +} + +void ScenePositionAttached::connectAncestors(QQuickItem *item) +{ + if (!item) { + return; + } + + QQuickItem *ancestor = item; + while (ancestor) { + m_ancestors << ancestor; + + connect(ancestor, &QQuickItem::xChanged, this, &ScenePositionAttached::xChanged); + connect(ancestor, &QQuickItem::yChanged, this, &ScenePositionAttached::yChanged); + connect(ancestor, &QQuickItem::parentChanged, this, [this, ancestor]() { + while (!m_ancestors.isEmpty()) { + QQuickItem *last = m_ancestors.takeLast(); + // Disconnect the item which had its parent changed too, + // because connectAncestors() would reconnect it next. + disconnect(last, nullptr, this, nullptr); + if (last == ancestor) { + break; + } + } + + connectAncestors(ancestor); + + Q_EMIT xChanged(); + Q_EMIT yChanged(); + }); + + ancestor = ancestor->parentItem(); + } +} + +ScenePositionAttached *ScenePositionAttached::qmlAttachedProperties(QObject *object) +{ + return new ScenePositionAttached(object); +} + +#include "moc_scenepositionattached.cpp" diff --git a/local/recipes/kde/kirigami/source/src/primitives/scenepositionattached.h b/local/recipes/kde/kirigami/source/src/primitives/scenepositionattached.h new file mode 100644 index 0000000000..7bb8d306c1 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/scenepositionattached.h @@ -0,0 +1,74 @@ +/* + * SPDX-FileCopyrightText: 2018 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#ifndef SCENEPOSITIONATTACHED_H +#define SCENEPOSITIONATTACHED_H + +#include +#include + +class QQuickItem; + +/*! + * \qmltype ScenePosition + * \inqmlmodule org.kde.kirigami + * + * \brief An attached property that contains the information about the scene position of the item. + * + * Its global x and y coordinates will update automatically and can be binded. + * \code + * import org.kde.kirigami as Kirigami + * Text { + * text: ScenePosition.x + * } + * \endcode + */ +class ScenePositionAttached : public QObject +{ + Q_OBJECT + QML_ELEMENT + QML_ATTACHED(ScenePositionAttached) + QML_NAMED_ELEMENT(ScenePosition) + QML_UNCREATABLE("") + + /*! \qmlattachedproperty double org.kde.kirigami::ScenePosition::x + * + * The global scene X position + * + */ + Q_PROPERTY(qreal x READ x NOTIFY xChanged FINAL) + + /*! \qmlattachedproperty double org.kde.kirigami::ScenePosition::y + * + * The global scene Y position + * + */ + Q_PROPERTY(qreal y READ y NOTIFY yChanged FINAL) + +public: + explicit ScenePositionAttached(QObject *parent = nullptr); + ~ScenePositionAttached() override; + + qreal x() const; + qreal y() const; + + // QML attached property + static ScenePositionAttached *qmlAttachedProperties(QObject *object); + +Q_SIGNALS: + void xChanged(); + void yChanged(); + +private: + void connectAncestors(QQuickItem *item); + + QQuickItem *m_item = nullptr; + QList m_ancestors; +}; + +QML_DECLARE_TYPEINFO(ScenePositionAttached, QML_HAS_ATTACHED_PROPERTIES) + +#endif // SCENEPOSITIONATTACHED_H diff --git a/local/recipes/kde/kirigami/source/src/primitives/shaders.cmake b/local/recipes/kde/kirigami/source/src/primitives/shaders.cmake new file mode 100644 index 0000000000..d395b2da71 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/shaders.cmake @@ -0,0 +1,91 @@ +# Qt insists on some paths in qt_add_shaders to be target-relative while others +# are not, making it impossible to put this in the shaders/ subdirectory. To +# keep things a bit organised and easier to follow, this is still a separate +# file that gets included. + +macro(add_shaders ARG_NAME) + cmake_parse_arguments(ARG "" "INPUT" "DEFINES" ${ARGV}) + qt6_add_shaders(KirigamiPrimitives "${ARG_NAME}" + BATCHABLE + PREFIX "/qt/qml/org/kde/kirigami/primitives/shaders" + FILES + "shaders/${ARG_INPUT}.vert" + "shaders/${ARG_INPUT}.frag" + OUTPUTS + "${ARG_NAME}.vert.qsb" + "${ARG_NAME}.frag.qsb" + OUTPUT_TARGETS _targets + DEFINES ${ARG_DEFINES} + ${_extra_options} + ) + install(TARGETS ${_targets} EXPORT KirigamiTargets ${KF_INSTALL_TARGETS_DEFAULT_ARGS}) +endmacro() + +add_shaders("shadowed_rectangle" + INPUT shadowedrectangle +) + +add_shaders("shadowed_border_rectangle" + INPUT shadowedrectangle + DEFINES ENABLE_BORDER=1 +) + +add_shaders("shadowed_texture" + INPUT shadowedrectangle + DEFINES ENABLE_TEXTURE=1 +) + +add_shaders("shadowed_border_texture" + INPUT shadowedrectangle + DEFINES + ENABLE_BORDER=1 + ENABLE_TEXTURE=1 +) + +add_shaders("shadowed_rectangle_lowpower" + INPUT shadowedrectangle + DEFINES ENABLE_LOWPOWER=1 +) + +add_shaders("shadowed_border_rectangle_lowpower" + INPUT shadowedrectangle + DEFINES + ENABLE_LOWPOWER=1 + ENABLE_BORDER=1 +) + +add_shaders("shadowed_texture_lowpower" + INPUT shadowedrectangle + DEFINES + ENABLE_LOWPOWER=1 + ENABLE_TEXTURE=1 +) + +add_shaders("shadowed_border_texture_lowpower" + INPUT shadowedrectangle + DEFINES + ENABLE_LOWPOWER=1 + ENABLE_BORDER=1 + ENABLE_TEXTURE=1 +) + +add_shaders("icon_default" + INPUT icon +) + +add_shaders("icon_mix" + INPUT icon + DEFINES ENABLE_MIX=1 +) + +add_shaders("icon_mask_default" + INPUT icon + DEFINES ENABLE_MASK=1 +) + +add_shaders("icon_mask_mix" + INPUT icon + DEFINES + ENABLE_MASK=1 + ENABLE_MIX=1 +) diff --git a/local/recipes/kde/kirigami/source/src/primitives/shaders/icon.frag b/local/recipes/kde/kirigami/source/src/primitives/shaders/icon.frag new file mode 100644 index 0000000000..5675a45fec --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/shaders/icon.frag @@ -0,0 +1,60 @@ +/* + * SPDX-FileCopyrightText: 2025 Arjen Hiemstra + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#version 440 + +layout(std140, binding = 0) uniform buf { + highp mat4 matrix; + mediump float opacity; + + mediump float mix_amount; + mediump float highlight_amount; + mediump float desaturate_amount; + mediump vec4 mask_color; + highp vec2 viewport_half; + highp vec2 inv_viewport_double; +} uniforms; + +layout(binding = 1) uniform sampler2D texture_source_0; +#ifdef ENABLE_MIX +layout(binding = 2) uniform sampler2D texture_source_1; +#endif + +layout(location = 0) in mediump vec2 uv0; +#ifdef ENABLE_MIX +layout(location = 1) in mediump vec2 uv1; +#endif +layout(location = 0) out mediump vec4 out_color; + +const mediump float desaturate_opacity = 0.5; + +mediump vec4 texture_color(sampler2D texture_source, mediump vec2 uv) +{ + mediump vec4 color = texture(texture_source, uv); +#ifdef ENABLE_MASK + color = vec4(uniforms.mask_color.xyz * color.a, color.a); +#endif + + // Highlight effect + const mediump float gamma = 1.0 / (2.0 * max(0.25, uniforms.highlight_amount * color.a) + 0.5); + color.rgb = pow(color.rgb, vec3(gamma)); + + // Desaturate effect + color = mix(color, vec4(vec3(dot(color.rgb, vec3(0.2126, 0.7152, 0.0722))) * desaturate_opacity, color.a * desaturate_opacity), uniforms.desaturate_amount); + + return color; +} + +void main() +{ +#ifdef ENABLE_MIX + mediump vec4 col = mix(texture_color(texture_source_1, uv1), texture_color(texture_source_0, uv0), uniforms.mix_amount); +#else + mediump vec4 col = texture_color(texture_source_0, uv0); +#endif + + out_color = col * uniforms.opacity; +} diff --git a/local/recipes/kde/kirigami/source/src/primitives/shaders/icon.vert b/local/recipes/kde/kirigami/source/src/primitives/shaders/icon.vert new file mode 100644 index 0000000000..857eb9ec44 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/primitives/shaders/icon.vert @@ -0,0 +1,43 @@ +/* + * SPDX-FileCopyrightText: 2025 Arjen Hiemstra + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#version 440 + +layout(std140, binding = 0) uniform buf { + highp mat4 matrix; + mediump float opacity; + + mediump float mix_amount; + mediump float highlight_amount; + mediump float desaturate_amount; + mediump vec4 mask_color; + highp vec2 viewport_half; + highp vec2 inv_viewport_double; +} uniforms; + +layout(location = 0) in highp vec4 in_vertex; +layout(location = 1) in mediump vec2 in_uv0; +layout(location = 0) out mediump vec2 uv0; + +#ifdef ENABLE_MIX +layout(location = 2) in mediump vec2 in_uv1; +layout(location = 1) out mediump vec2 uv1; +#endif + +out gl_PerVertex { vec4 gl_Position; }; + +void main() { + uv0 = in_uv0; +#ifdef ENABLE_MIX + uv1 = in_uv1; +#endif + highp vec4 position = uniforms.matrix * in_vertex; + highp vec2 pixel = ((position.xy / position.w) * uniforms.viewport_half) + + uniforms.viewport_half + 0.0001; + position.xy = (round(pixel) * uniforms.inv_viewport_double - 1.0) + * position.w; + gl_Position = position; +} diff --git a/local/recipes/kde/kirigami/source/src/templates/AbstractApplicationHeader.qml b/local/recipes/kde/kirigami/source/src/templates/AbstractApplicationHeader.qml new file mode 100644 index 0000000000..94b773867a --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/templates/AbstractApplicationHeader.qml @@ -0,0 +1,286 @@ +/* + * SPDX-FileCopyrightText: 2015 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Controls as QQC2 +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.controls as KirigamiControls +import org.kde.kirigami.primitives as Primitives +import org.kde.kirigami.layouts as KirigamiLayouts + +/*! + \qmltype AbstractApplicationHeader + \inqmlmodule org.kde.kirigami + + \brief An item that can be used as a title for the application. + + Scrolling the main page will make it taller or shorter (through the point of going away) + It's a behavior similar to the typical mobile web browser addressbar + the minimum, preferred and maximum heights of the item can be controlled with: + \list + \li minimumHeight: default is 0, i.e. hidden + \li preferredHeight: default is Units.gridUnit * 1.6 + \li maximumHeight: default is Units.gridUnit * 3 + \endlist + To achieve a titlebar that stays completely fixed just set the 3 sizes as the same. + */ +Item { + id: root + z: 90 + + /*! + */ + property real minimumHeight: { + const window = QQC2.ApplicationWindow.window as KirigamiControls.ApplicationWindow + if (window) { + return window.pageStack.globalToolBar.minimumHeight; + } else if (mainItem.applicationItem) { + return (mainItem.applicationItem as KirigamiControls.ApplicationItem).pageStack.globalToolBar.minimumHeight; + } + + return 0 + } + + // Use an inline arrow function, referring to an external normal function makes QV4 crash, see https://bugreports.qt.io/browse/QTBUG-119395 + /*! + */ + property real preferredHeight: { + const window = QQC2.ApplicationWindow.window as KirigamiControls.ApplicationWindow + if (window) { + return window.pageStack.globalToolBar.preferredHeight; + } else if (mainItem.applicationItem) { + return (mainItem.applicationItem as KirigamiControls.ApplicationItem).pageStack.globalToolBar.preferredHeight; + } + + return mainItem.children.reduce((accumulator, item) => { + return Math.max(accumulator, item.implicitHeight); + }, 0) + topPadding + bottomPadding + } + + /*! + */ + property real maximumHeight: { + const window = QQC2.ApplicationWindow.window as KirigamiControls.ApplicationWindow + if (window) { + return window.pageStack.globalToolBar.maximumHeight; + } else if (mainItem.applicationItem) { + return (mainItem.applicationItem as KirigamiControls.ApplicationItem).pageStack.globalToolBar.maximumHeight; + } + return Platform.Units.gridUnit * 3 + topPadding + bottomPadding; + } + + /*! + */ + property int position: QQC2.ToolBar.Header + + // These properties are items due to issues with multiple engine type registration + // The stronger types can probably be used after we depend on Qt 6.9 + /*! + */ + property /*Kirigami.PageRow*/ Item pageRow: __appWindow?.pageStack ?? null + + /*! + */ + property /*Kirigami.Page*/ Item page: pageRow?.currentItem as KirigamiControls.Page ?? null + + /*! + */ + default property alias contentItem: mainItem.data + + /*! + */ + readonly property int paintedHeight: headerItem.y + headerItem.height - 1 + + /*! + */ + property int leftPadding: Platform.Units.mediumSpacing + + /*! + */ + property int topPadding: Platform.Units.mediumSpacing + (pageRow ? pageRow.SafeArea.margins.top : 0) + + /*! + */ + property int rightPadding: Platform.Units.mediumSpacing + + /*! + */ + property int bottomPadding: Platform.Units.mediumSpacing + + /*! + */ + property bool separatorVisible: true + + /*! + This property specifies whether the header should be pushed back when + scrolling using the touch screen. + */ + property bool hideWhenTouchScrolling: root.pageRow?.globalToolBar.hideWhenTouchScrolling ?? false + + LayoutMirroring.enabled: Application.layoutDirection === Qt.RightToLeft + LayoutMirroring.childrenInherit: true + + Platform.Theme.inherit: true + + // FIXME: remove + property QtObject __appWindow: typeof applicationWindow !== "undefined" ? applicationWindow() : null + implicitHeight: preferredHeight + Primitives.AlignedSize.height: preferredHeight + + /*! + \brief This property holds the background item. + \note The background will be automatically sized to fill the whole control. + */ + property Item background + + onBackgroundChanged: { + background.z = -1; + background.parent = headerItem; + background.anchors.fill = headerItem; + } + + Component.onCompleted: { + AppHeaderSizeGroup.items.push(this); + + let candidate = parent; + while (candidate) { + mainItem.applicationItem = candidate as KirigamiControls.ApplicationItem; + if (mainItem.applicationItem) { + break; + } + candidate = candidate.parent; + } + } + + onMinimumHeightChanged: implicitHeight = preferredHeight; + onPreferredHeightChanged: implicitHeight = preferredHeight; + + NumberAnimation { + id: heightAnim + target: root + property: "implicitHeight" + duration: Platform.Units.longDuration + easing.type: Easing.InOutQuad + } + + Connections { + target: root.__appWindow + + function onControlsVisibleChanged() { + heightAnim.from = root.implicitHeight; + heightAnim.to = root.__appWindow.controlsVisible ? root.preferredHeight : 0; + heightAnim.restart(); + } + } + + Connections { + target: root.page?.KirigamiLayouts.ColumnView ?? null + + function onScrollIntention(event) { + headerItem.scrollIntentHandler(event); + } + } + + Primitives.Separator { + anchors { + left: parent.left + top: parent.top + right: parent.right + } + // Ideally also not visible when 'No Titlebar and Frame', but window flags are not bindable + visible: Window.window?.visibility !== Window.FullScreen ?? true + opacity: root.__appWindow?.controlsVisible ? 0 : 1 + Behavior on opacity { + NumberAnimation { + duration: Platform.Units.longDuration + easing.type: Easing.InOutQuad + } + } + } + + Item { + id: headerItem + anchors { + left: parent.left + right: parent.right + bottom: !Platform.Settings.isMobile || root.position === QQC2.ToolBar.Header ? parent.bottom : undefined + top: !Platform.Settings.isMobile || root.position === QQC2.ToolBar.Footer ? parent.top : undefined + } + + height: Math.max(root.height, root.minimumHeight > 0 ? root.minimumHeight : root.preferredHeight) + visible: root.height > 0 + + function scrollIntentHandler(event) { + if (!root.hideWhenTouchScrolling) { + return + } + + if (root.pageRow + && root.pageRow.globalToolBar.actualStyle !== KirigamiControls.ApplicationHeaderStyle.Breadcrumb) { + return; + } + if (!root.page.flickable || (root.page.flickable.atYBeginning && root.page.flickable.atYEnd)) { + return; + } + + root.implicitHeight = Math.max(0, Math.min(root.preferredHeight, root.implicitHeight + event.delta.y)) + event.accepted = root.implicitHeight > 0 && root.implicitHeight < root.preferredHeight; + slideResetTimer.restart(); + if ((root.page.flickable instanceof ListView) && root.page.flickable.verticalLayoutDirection === ListView.BottomToTop) { + root.page.flickable.contentY -= event.delta.y; + } + } + + Connections { + target: root.page?.globalToolBarItem ?? null + enabled: target + function onImplicitHeightChanged() { + root.implicitHeight = root.page.globalToolBarItem.implicitHeight; + } + } + + Timer { + id: slideResetTimer + interval: 500 + onTriggered: { + if ((root.pageRow?.wideMode ?? (root.__appWindow?.wideScreen ?? false)) || !Platform.Settings.isMobile) { + return; + } + if (root.height > root.minimumHeight + (root.preferredHeight - root.minimumHeight) / 2) { + heightAnim.to = root.preferredHeight; + } else { + heightAnim.to = root.minimumHeight; + } + heightAnim.from = root.implicitHeight + heightAnim.restart(); + } + } + + Item { + id: mainItem + clip: childrenRect.width > width + // Can't be a Kirigami.ApplicationItem due to recursive type registration + property Item applicationItem + + onChildrenChanged: { + for (const child of children) { + child.anchors.verticalCenter = verticalCenter; + } + } + + height: heightAnim.running ? root.preferredHeight : root.height - root.topPadding - root.bottomPadding + anchors { + left: parent.left + right: parent.right + bottom: parent.bottom + + leftMargin: root.leftPadding + rightMargin: root.rightPadding + bottomMargin: root.bottomPadding + } + } + } +} diff --git a/local/recipes/kde/kirigami/source/src/templates/AbstractCard.qml b/local/recipes/kde/kirigami/source/src/templates/AbstractCard.qml new file mode 100644 index 0000000000..ce5ccf74be --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/templates/AbstractCard.qml @@ -0,0 +1,142 @@ +/* + * SPDX-FileCopyrightText: 2018 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Layouts +import QtQuick.Templates as T +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.layouts as KirigamiLayouts + +/*! + \qmltype AbstractCard + \inqmlmodule org.kde.kirigami + + \brief The base item for all kinds of cards. + + A card is a visual object that groups its contents into a logical unit, + connecting them all together visually. Cards can be interactive and clickable, + or visual only, purely used for grouping. + + AbstractCard is an empty card, providing just the styling and basic + properties. Use an AbstractCard when you want the visual styling and grouping + of a card, but plan to fill it with your own custom content layout. Content is + organized into three properties: \c header, \c contentItem, and \c footer. + + The \l Card component provides a standard layout if your needs are less custom. + + \since 2.4 + */ +T.ItemDelegate { + id: root + +//BEGIN properties + /*! + \qmlproperty Item header + \brief This property holds an item that serves as a header. + + This item will be positioned on top if headerOrientation is Qt.Vertical + or on the left if it is Qt.Horizontal. + + \default null + */ + property alias header: headerFooterLayout.header + + /*! + \brief This property sets the card's orientation. + \list + \li Qt.Vertical: the header will be positioned on top + \li Qt.Horizontal: the header will be positioned on the leading side + \endlist + + \default Qt.Vertical + */ + property int headerOrientation: Qt.Vertical + + /*! + \qmlproperty Item footer + \brief This property holds an item that serves as a footer. + + This item will be positioned at the bottom if headerOrientation is Qt.Vertical + or on the right if it is Qt.Horizontal. + + \default null + */ + property alias footer: headerFooterLayout.footer + + /*! + \brief This property sets whether clicking or tapping on the card shows + visual click feedback. + + Use this if you want the card to perform an action in its \c onClicked signal + handler. + + \default false + */ + property bool showClickFeedback: false + +//END properties + + Layout.fillWidth: true + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + outerPaddingLayout.implicitWidth) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + outerPaddingLayout.implicitHeight) + + hoverEnabled: !Platform.Settings.tabletMode && showClickFeedback + + Platform.Theme.inherit: false + Platform.Theme.colorSet: Platform.Theme.View + + width: ListView.view ? ListView.view.width - ListView.view.leftMargin - ListView.view.rightMargin : undefined + padding: Platform.Units.largeSpacing + + // Card component repurposes control's contentItem property, so it has to + // reimplement content layout and its padding manually. + KirigamiLayouts.Padding { + id: outerPaddingLayout + + anchors.fill: parent + + topPadding: root.topPadding + leftPadding: root.leftPadding + rightPadding: root.rightPadding + bottomPadding: root.bottomPadding + + contentItem: KirigamiLayouts.HeaderFooterLayout { + id: headerFooterLayout + + contentItem: KirigamiLayouts.Padding { + id: innerPaddingLayout + + contentItem: root.contentItem + + // Hide it altogether, so that vertical padding won't be + // included in control's total implicit height. + visible: contentItem !== null + + topPadding: headerFooterLayout.header ? Platform.Units.largeSpacing : 0 + bottomPadding: headerFooterLayout.footer ? Platform.Units.largeSpacing : 0 + } + } + } + + // HACK: A Control like this ItemDelegate tries to manage its + // contentItem's positioning, so we need to override that. This is + // equivalent to declaring x/y/width/height bindings in QQC2 style + // implementations. + Connections { + target: root.contentItem + + function onXChanged() { + root.contentItem.x = 0; + } + + function onYChanged() { + root.contentItem.y = Qt.binding(() => innerPaddingLayout.topPadding); + } + } +} diff --git a/local/recipes/kde/kirigami/source/src/templates/AppHeaderSizeGroup.qml b/local/recipes/kde/kirigami/source/src/templates/AppHeaderSizeGroup.qml new file mode 100644 index 0000000000..7d6470fa84 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/templates/AppHeaderSizeGroup.qml @@ -0,0 +1,13 @@ +pragma Singleton + +/* + * SPDX-FileCopyrightText: 2020 Carson Black + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import org.kde.kirigami.layouts as KirigamiLayouts + +KirigamiLayouts.SizeGroup { + mode: KirigamiLayouts.SizeGroup.Height +} diff --git a/local/recipes/kde/kirigami/source/src/templates/Badge.qml b/local/recipes/kde/kirigami/source/src/templates/Badge.qml new file mode 100644 index 0000000000..76eb70330a --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/templates/Badge.qml @@ -0,0 +1,166 @@ +/* + * SPDX-FileCopyrightText: 2025-2026 Nate Graham + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Templates as T +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.primitives as Primitives + +/*! + \qmltype Badge + \inqmlmodule org.kde.kirigami + \inherits QQC2.Control + + \brief A badge with a colored background. + + Useful for badging something in an attention-getting way to indicate a + non-default status. Supports both text and an icon, both optional. + + If the badge has no text or has single-line text, it will have a highly + rounded, pill-shaped appearance. Otherwise it will be a rounded rectangle. + + Typical implementation: + \qml + import org.kde.kirigami as Kirigami + + Kirigami.Badge { + text: i18nc("@info badge text", "New!") + type: Kirigami.Badge.Type.Positive + } + \endqml + + Implemented as a number badge: + \qml + import org.kde.kirigami as Kirigami + + Kirigami.Badge { + text: 25 + } + \endqml + + Implemented as a warning with a re-colored icon: + \qml + import org.kde.kirigami as Kirigami + + Kirigami.Badge { + icon.name: "edit-bomb-symbolic" + text: i18nc("@info badge text", "The computer is about to explode") + type: Kirigami.Badge.Type.Negative + } + \endqml + + Implemented with a custom color and non-recolored icon: + \qml + import org.kde.kirigami as Kirigami + + Kirigami.Badge { + icon.name: "applications-science" + text: i18nc("@info badge text", "Science") + customColor: Kirigami.Theme.visitedLinkColor + } + \endqml + + \since 6.25 + */ + +T.Control { + id: root + + enum Type { + Information, + Positive, + Warning, + Error + } + + /*! + \qmlproperty string icon.name + \qmlproperty var icon.source + \qmlproperty color icon.color + \qmlproperty real icon.width + \qmlproperty real icon.height + \qmlproperty function icon.fromControlsIcon + + This grouped property determines the appearance of the optional icon. + + If you set the \c color property or pass an icon name ending in + "-symbolic", the icon will be masked and re-colored to match the text + color. + + The default is to display no icon. + + \include iconpropertiesgroup.qdocinc grouped-properties + */ + property Primitives.IconPropertiesGroup icon: Primitives.IconPropertiesGroup { + width: Platform.Units.iconSizes.sizeForLabels + height: Platform.Units.iconSizes.sizeForLabels + color: "transparent" + } + + /*! + \qmlproperty string text + + This property determines the label text in the badge. Long text will + wrap, but try to minimize text length anyway. The label is limited to + plain text. + + The default value is an empty string, i.e. no text. + + \since 6.25 + */ + property string text + + /*! + \qmlproperty enumeration Badge::type + + This property holds the badge type, which affects the badge's + default background color. + + One of + \list + \li Information + \li Positive + \li Warning + \li Error + \endlist + + The default is Kirigami.Badge.Type.Information, which the implementation + should use to produce a soft blue background with the Breeze color + scheme. + */ + property int type: Badge.Type.Information + + /*! + \qmlproperty color customColor + + When set, this property overrides the default background color that was + chosen by the implementation based on the \c type property. + + The implementation should set a legible text color for whatever + color is chosen here. For maximum control over the text color, + also set \c customTextColor. + + \since 6.25 + */ + property color customColor: "transparent" + + /*! + \qmlproperty color customTextColor + + When set, this property overrides the default text color that was + chosen by the implementation based on the \c type or \c customTextColor + properties. + + \since 6.25 + */ + property color customTextColor: "transparent" + + implicitHeight: Math.round(implicitContentHeight + topPadding + bottomPadding) + // Make sure it's a perfect square/circle if it would be slightly shorter than that + implicitWidth: Math.round(Math.max(implicitContentHeight + topPadding + bottomPadding, implicitContentWidth + leftPadding + rightPadding)) + + Accessible.name: text +} diff --git a/local/recipes/kde/kirigami/source/src/templates/CMakeLists.txt b/local/recipes/kde/kirigami/source/src/templates/CMakeLists.txt new file mode 100644 index 0000000000..0debfd886d --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/templates/CMakeLists.txt @@ -0,0 +1,45 @@ + +add_library(KirigamiTemplates) +ecm_add_qml_module(KirigamiTemplates URI "org.kde.kirigami.templates" + VERSION 2.0 + GENERATE_PLUGIN_SOURCE + INSTALLED_PLUGIN_TARGET KF6KirigamiTemplates +) + +set_source_files_properties(AppHeaderSizeGroup.qml PROPERTIES + QT_QML_SINGLETON_TYPE TRUE +) + +ecm_target_qml_sources(KirigamiTemplates SOURCES + AbstractApplicationHeader.qml + AbstractCard.qml + AppHeaderSizeGroup.qml + Badge.qml + Chip.qml + Heading.qml + InlineMessage.qml + LinkButton.qml + NavigationTabBar.qml + NavigationTabButton.qml + OverlayDrawer.qml + OverlaySheet.qml + InlineViewHeader.qml +) + +ecm_target_qml_sources(KirigamiTemplates PRIVATE PATH private SOURCES + private/BorderPropertiesGroup.qml + private/DrawerHandle.qml +) + +set_target_properties(KirigamiTemplates PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION 6 + EXPORT_NAME "KirigamiTemplates" +) + +target_include_directories(KirigamiTemplates PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..) + + +ecm_finalize_qml_module(KirigamiTemplates EXPORT KirigamiTargets) + +install(TARGETS KirigamiTemplates EXPORT KirigamiTargets ${KF_INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/local/recipes/kde/kirigami/source/src/templates/Chip.qml b/local/recipes/kde/kirigami/source/src/templates/Chip.qml new file mode 100644 index 0000000000..01710cbfd7 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/templates/Chip.qml @@ -0,0 +1,74 @@ +// SPDX-FileCopyrightText: 2022 Felipe Kinoshita +// SPDX-License-Identifier: LGPL-2.0-or-later + +import QtQuick +import QtQuick.Templates as T + +/*! + \qmltype Chip + \inqmlmodule org.kde.kirigami + + \brief A compact element that represents an attribute, action, or filter. + + Should be used in a group of multiple elements. e.g when displaying tags in a image viewer. + + Example usage: + \qml + import org.kde.kirigami as Kirigami + + Flow { + Repeater { + model: chipsModel + + Kirigami.Chip { + text: model.text + icon.name: "tag-symbolic" + closable: model.closable + onClicked: { + [...] + } + onRemoved: { + [...] + } + } + } + } + \endqml + + \since 2.19 + */ +T.AbstractButton { + id: chip + + // TODO qdoc this should be a property of the template + /*! + \qmlproperty Label Chip::labelItem + \brief This property holds the label item; used for accessing the usual Text properties. + */ + + /*! + \brief This property holds whether or not to display a close button. + + default: \c true + */ + property bool closable: true + + /*! + \brief This property holds whether the icon should be masked or not. This controls the Kirigami.Icon.isMask property. + + default: \c false + */ + property bool iconMask: false + + /*! + \brief This property holds whether the Chip should react to input or not. If set to false, click and hover events will be ignored. + + default: \c true + */ + property bool interactive: true + + /*! + \brief This signal is emitted when the close button has been clicked. + */ + signal removed() +} diff --git a/local/recipes/kde/kirigami/source/src/templates/Heading.qml b/local/recipes/kde/kirigami/source/src/templates/Heading.qml new file mode 100644 index 0000000000..336065d845 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/templates/Heading.qml @@ -0,0 +1,94 @@ +/* +* SPDX-FileCopyrightText: 2012 Sebastian Kügler +* SPDX-FileCopyrightText: 2026 Akseli Lahtinen +* +* SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +import QtQuick +import QtQuick.Controls as QQC2 +import org.kde.kirigami.platform as Platform + +/*! + \qmltype Heading + \inqmlmodule org.kde.kirigami + + \brief A pre-formatted label used for titles and section headers + + Use this component for titles and section headers. The characteristics of the + text will be automatically set according to the \c Kirigami.Theme. + + The most important property is \l text; use this to set the heading text to + be displayed. + + Example usage: + \code + import QtQuick.Layouts + import QtQuick.Controls as QQC2 + import org.kde.kirigami as Kirigami + [...] + ColumnLayout { + spacing: 0 + + Kirigami.Heading { + Layout.fillWidth: true + wrapMode: Text.Wrap + text: "Apples in the sunlight" + level: 2 + } + QQC2.Label { + Layout.fillWidth: true + wrapMode: Text.Wrap + text: "And this is why apples are amazing: let me tell you a story about this one time I was napping below a tree…" + } + [...] + } + \endcode + */ +QQC2.Label { + id: heading + /*! + \brief This property holds the level of the heading, which determines its size. + + This property holds the level, which determines how large the header is. + + Acceptable values range from 1 (big) to 5 (small). + + default: 1 + */ + property int level: 1 + + /*! + \brief This enumeration defines heading types. + + This enum helps with heading visibility (making it less or more important). + */ + enum Type { + Normal, + Primary, + Secondary + } + + /*! + \qmlproperty enumeration Heading::type + \brief This property holds the heading type. + + The type of heading. This can be: + \list + \li Kirigami.Heading.Type.Normal: Create a normal heading. + \li Kirigami.Heading.Type.Primary: Makes the heading more prominent. Useful + when making the heading bigger is not enough. + \li Kirigami.Heading.Type.Secondary: Makes the heading less prominent. + Useful when an heading is for a less important section in an application. + \endlist + + default: Kirigami.Heading.Type.Normal + + \since 5.82 + */ + property int type: Heading.Type.Normal + + Accessible.role: Accessible.Heading + + color: Platform.Theme.textColor +} diff --git a/local/recipes/kde/kirigami/source/src/templates/InlineMessage.qml b/local/recipes/kde/kirigami/source/src/templates/InlineMessage.qml new file mode 100644 index 0000000000..b993871c6c --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/templates/InlineMessage.qml @@ -0,0 +1,455 @@ +/* + * SPDX-FileCopyrightText: 2018 Eike Hein + * SPDX-FileCopyrightText: 2022 ivan tkachenko + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Controls as QQC2 +import QtQuick.Templates as T +import org.kde.kirigami.controls as KirigamiControls +import org.kde.kirigami.primitives as Primitives +import org.kde.kirigami.platform as Platform + +/*! + \qmltype InlineMessage + \inqmlmodule org.kde.kirigami + + \brief An inline message item with support for associated actions. + + InlineMessage can be used to provide non-modal information or interactivity + without requiring the use of a dialog. To learn when to use it, see + https://develop.kde.org/hig/status_changes/#in-app-notifications. + + InlineMessage has two visibility modes: inline (default) and borderless. The + inline version includes outer padding suitable for being displayed amidst + page content. The borderless version is best used used as a header or footer + where it is expected to touch the edges of its parent view, and is activated + using the \l position property. + + The InlineMessage item is hidden by default. It also manages its + height (and implicitHeight) during an animated reveal when shown. + You should avoid setting height on an InlineMessage unless it is + already visible. + + The \l type property determines the message's coloration and default icon. + This icon can be overridden using the \l icon property. + + No close button is shown by default, which means you're responsible for + hiding the message when it's no longer relevant. Optionally, a close button + can be added using the \l showCloseButton property. + + Actions are added from leading to trailing, and aligned to the trailing + position. If more actions are set than can fit, an overflow menu is provided. + + Example displayed inline: + \qml + import org.kde.kirigami as Kirigami + + Kirigami.InlineMessage { + type: Kirigami.MessageType.Error + + text: i18n("My error message") + + actions: [ + Kirigami.Action { + icon.name: "list-add" + text: i18n("Add") + onTriggered: source => { + // do stuff + } + }, + Kirigami.Action { + icon.name: "edit" + text: i18n("Edit") + onTriggered: source => { + // do stuff + } + } + ] + } + \endqml + + Example displayed in the header position: + \qml + import org.kde.kirigami as Kirigami + + Kirigami.Page { + header: Kirigami.InlineMessage { + position: Kirigami.InlineMessage.Position.Header + type: Kirigami.MessageType.Warning + + text: i18n("My warning message") + + actions: [ + Kirigami.Action { + icon.name: "edit-undo" + text: i18n("Undo") + onTriggered: source => { + // do stuff + } + } + ] + } + + // Add page content here + } +} +\endqml + + \since 5.45 + */ +T.Control { + id: root + + visible: false + + /*! + Defines a position for the message: whether it's to be used as an inline component inside the page, + a page header, or a page footer. + */ + enum Position { + Inline, + Header, + Footer + } + + /*! + \qmlproperty enumeration InlineMessage::position + + Adjust the look of the message based upon the position. + If a message is positioned in the header area or in the footer area + of a page, it might be desirable to not have borders but just a line + separating it from the content area. In this case, use the Header or + Footer position. + + Possible values are: + \list + \li InlineMessage.Position.Inline + \li InlineMessage.Position.Header + \li InlineMessage.Position.Footer + \endlist + + Default is InlineMessage.Position.Inline + */ + property int position: InlineMessage.Position.Inline + + /*! + This signal is emitted when a link is hovered in the message text. + + \a link The hovered link. + */ + signal linkHovered(string link) + + /*! + This signal is emitted when a link is clicked or tapped in the message text. + + \a link The clicked or tapped link. + */ + signal linkActivated(string link) + + /*! + \qmlproperty string InlineMessage::hoveredLink + + This property holds the link embedded in the message text that the user is hovering over. + */ + readonly property alias hoveredLink: label.hoveredLink + + /*! + \qmlproperty enumeration InlineMessage::type + + This property holds the message type. + One of + \list + \li Information + \li Positive + \li Warning + \li Error + \endlist + + The default is Kirigami.MessageType.Information. + */ + property int type: KirigamiControls.MessageType.Information + + /*! + \qmlproperty string icon.name + \qmlproperty var icon.source + \qmlproperty color icon.color + \qmlproperty real icon.width + \qmlproperty real icon.height + \qmlproperty function icon.fromControlsIcon + + This grouped property holds the description of an optional icon. + + \include iconpropertiesgroup.qdocinc grouped-properties + */ + property Primitives.IconPropertiesGroup icon: Primitives.IconPropertiesGroup {} + + /*! + This property holds the message text. + */ + property string text + + /*! + This property holds whether the close button is displayed. + + The default is \c false. + */ + property bool showCloseButton: false + + /*! + \qmlproperty list actions + + This property holds the list of actions to show. Actions are added from + leading to trailing. If more actions are set than can fit, an overflow + menu is provided. + */ + property list actions + + /*! + This property holds whether the current message item is animating. + */ + readonly property bool animating: _animating + + property bool _animating: false + + implicitHeight: visible ? (contentLayout.implicitHeight + topPadding + bottomPadding) : 0 + + padding: Platform.Units.smallSpacing + + Accessible.role: Accessible.AlertMessage + Accessible.ignored: !visible + + Behavior on implicitHeight { + enabled: !root.visible + + SequentialAnimation { + PropertyAction { targets: root; property: "_animating"; value: true } + NumberAnimation { duration: Platform.Units.longDuration } + } + } + + onVisibleChanged: { + if (!visible) { + contentLayout.opacity = 0; + } + } + + opacity: visible ? 1 : 0 + + Behavior on opacity { + enabled: !root.visible + + NumberAnimation { duration: Platform.Units.shortDuration } + } + + onOpacityChanged: { + if (opacity === 0) { + contentLayout.opacity = 0; + } else if (opacity === 1) { + contentLayout.opacity = 1; + } + } + + onImplicitHeightChanged: { + height = implicitHeight; + } + + contentItem: Item { + id: contentLayout + + // Used to defer opacity animation until we know if InlineMessage was + // initialized visible. + property bool complete: false + + Behavior on opacity { + enabled: root.visible && contentLayout.complete + + SequentialAnimation { + NumberAnimation { duration: Platform.Units.shortDuration * 2 } + PropertyAction { targets: root; property: "_animating"; value: false } + } + } + + implicitHeight: { + let maximumTopHeight = Math.max(label.implicitHeight, icon.implicitHeight, (root.showCloseButton ? closeButton.implicitHeight : 0)) + if (atBottom) { + return maximumTopHeight + actionsLayout.implicitHeight + Platform.Units.smallSpacing + } else { + return Math.max(maximumTopHeight, actionsLayout.implicitHeight) + } + } + + Accessible.ignored: true + + readonly property real fixedContentWidth: icon.width + Platform.Units.smallSpacing * 3 + (root.showCloseButton ? closeButton.width + Platform.Units.smallSpacing : 0) + readonly property real remainingWidth: width - fixedContentWidth - label.implicitWidth + readonly property bool multiline: remainingWidth <= 0 || atBottom + readonly property bool atBottom: (root.actions.length > 0) && (label.lineCount > 1 || actionsLayout.implicitWidth > remainingWidth) + + Primitives.Icon { + id: icon + + width: Platform.Units.iconSizes.smallMedium + height: Platform.Units.iconSizes.smallMedium + + anchors { + left: parent.left + leftMargin: Platform.Units.smallSpacing + topMargin: Platform.Units.smallSpacing + } + + states: [ + State { + name: "multi-line" + when: contentLayout.atBottom || label.height > icon.height * 1.7 + AnchorChanges { + target: icon + anchors.top: icon.parent.top + anchors.verticalCenter: undefined + } + }, + // States are evaluated in the order they are declared. + // This is a fallback state. + State { + name: "single-line" + when: true + AnchorChanges { + target: icon + anchors.top: undefined + anchors.verticalCenter: parent.verticalCenter + } + } + ] + + source: { + if (root.icon.name) { + return root.icon.name; + } else if (root.icon.source) { + return root.icon.source; + } + + switch (root.type) { + case KirigamiControls.MessageType.Positive: + return "emblem-success"; + case KirigamiControls.MessageType.Warning: + return "emblem-warning"; + case KirigamiControls.MessageType.Error: + return "emblem-error"; + default: + return "emblem-information"; + } + } + + color: root.icon.color + + Accessible.ignored: !root.visible + Accessible.name: { + switch (root.type) { + case KirigamiControls.MessageType.Positive: + return qsTr("Success"); + case KirigamiControls.MessageType.Warning: + return qsTr("Warning"); + case KirigamiControls.MessageType.Error: + return qsTr("Error"); + default: + return qsTr("Note"); + } + } + } + + KirigamiControls.SelectableLabel { + id: label + + anchors { + left: icon.right + leftMargin: Platform.Units.largeSpacing + top: parent.top + bottom: parent.bottom + } + + width: Math.min(parent.width - parent.fixedContentWidth, implicitWidth) + + color: Platform.Theme.textColor + wrapMode: Text.WordWrap + + text: root.text + + verticalAlignment: Text.AlignVCenter + + // QTBUG-117667 TextEdit (super-type of SelectableLabel) needs + // very specific state-management trick so it doesn't get stuck. + // State names serve purely as a description. + states: [ + State { + name: "multi-line" + when: contentLayout.multiline + AnchorChanges { + target: label + anchors.bottom: undefined + } + PropertyChanges { + label.height: label.implicitHeight + } + } + ] + + onLinkHovered: link => root.linkHovered(link) + onLinkActivated: link => root.linkActivated(link) + + Accessible.ignored: !root.visible + } + + KirigamiControls.ActionToolBar { + id: actionsLayout + + flat: false + actions: root.actions + visible: root.actions.length > 0 + Accessible.ignored: !visible || !root.visible + alignment: Qt.AlignRight + + anchors { + bottom: parent.bottom + right: (!contentLayout.atBottom && root.showCloseButton) ? closeButton.left : parent.right + rightMargin: !contentLayout.atBottom && root.showCloseButton ? Platform.Units.smallSpacing : 0 + } + + width: Math.min(implicitWidth, parent.width) + } + + QQC2.ToolButton { + id: closeButton + + visible: root.showCloseButton + + anchors { + verticalCenter: parent.verticalCenter + right: parent.right + } + + // Incompatible anchors need to be evaluated in a given order, + // which simple declarative bindings cannot assure + states: State { + name: "onTop" + when: contentLayout.atBottom + AnchorChanges { + target: closeButton + anchors.top: parent.top + anchors.verticalCenter: undefined + } + } + + text: qsTr("Close") + display: QQC2.ToolButton.IconOnly + icon.name: "dialog-close" + + onClicked: root.visible = false + + Accessible.ignored: !root.visible + } + + Component.onCompleted: complete = true + } +} diff --git a/local/recipes/kde/kirigami/source/src/templates/InlineViewHeader.qml b/local/recipes/kde/kirigami/source/src/templates/InlineViewHeader.qml new file mode 100644 index 0000000000..bfe8f6d624 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/templates/InlineViewHeader.qml @@ -0,0 +1,84 @@ +/* + * SPDX-FileCopyrightText: 2023 Nate Graham + * SPDX-FileCopyrightText: 2026 Akseli Lahtinen + * SPDX-License-Identifier: LGPL-2.0-or-later + */ +pragma ComponentBehavior: Bound + +import QtQuick +import QtQuick.Templates as T + +/*! + * \qmltype InlineViewHeader + * \inqmlmodule org.kde.kirigami + * + * \brief A fancy inline view header showing a title and optional actions. + * + * Designed to be set as the header: property of a ListView or GridView, this + * component provides a fancy inline header suitable for explaining the contents + * of its view to the user in an attractive and standardized way. + * + * Actions globally relevant to the view can be defined using the \l actions property. + * They will appear on the trailing side of the header as buttons, and collapse + * into an overflow menu when there isn't room to show them all. + * + * The \l width property must be manually set to the parent view's width. + * + * Example usage: + * \code + * import org.kde.kirigami as Kirigami + * + * ListView { + * id: listView + * + * headerPositioning: ListView.OverlayHeader + * header: InlineViewHeader { + * width: listView.width + * text: "My amazing view" + * actions: [ + * Kirigami.Action { + * icon.name: "list-add-symbolic" + * text: "Add item" + * onTriggered: { + * // do stuff + * } + * } + * ] + * } + * + * model: [...] + * delegate: [...] + * } + * \endcode + */ +T.ToolBar { + id: root + + //BEGIN properties + /*! + * \brief This property holds the title text. + */ + property string text + + /*! + * \qmlproperty list InlineViewHeader::actions + * + * This property holds the list of actions to show on the header. Actions + * are added from left to right. If more actions are set than can fit, an + * overflow menu is provided. + */ + property list actions + //END properties + + z: 999 // don't let content overlap it + + // HACK Due to the lack of a GridView.headerPositioning property, + // we need to "stick" ourselves to the top manually by translating Y accordingly. + // see see https://bugreports.qt.io/browse/QTBUG-117035. + // Conveniently, GridView is only attached to the root of the delegate (or headerItem), + // so this will only be done if the InlineViewHeader itself is the header item. + // And of course it won't be there for ListView either, where we have headerPositioning. + transform: Translate { + y: root.GridView.view ? root.GridView.view.contentY + root.height : 0 + } +} diff --git a/local/recipes/kde/kirigami/source/src/templates/LinkButton.qml b/local/recipes/kde/kirigami/source/src/templates/LinkButton.qml new file mode 100644 index 0000000000..59da8b76a8 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/templates/LinkButton.qml @@ -0,0 +1,134 @@ +/* + * SPDX-FileCopyrightText: 2018 Aleix Pol Gonzalez + * SPDX-FileCopyrightText: 2026 Akseli Lahtinen + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Controls as QQC2 +import QtQuick.Templates as T +import org.kde.kirigami.platform as Platform + +/*! + * \qmltype LinkButton + * \inqmlmodule org.kde.kirigami + * \brief A button that looks like a link. + * + * It uses the color scheme's link color, and triggers an action when clicked. + * + * This component should not be used directly; prefer an actual button to + * navigate within the app or trigger actions, and prefer a \l UrlButton to + * display a link to a web site or other remote resource. See also + * \l https://develop.kde.org/hig/getting_input/#signaling-interactivity + * + * \since 5.52 + */ +QQC2.Label { + id: control + + /*! + * \qmlproperty Action action + * An action that will be triggered when the button is clicked + * + * default: \c null; set an action to make it work. + */ + property T.Action action + + /*! + * \qmlproperty Qt::MouseButtons LinkButton::acceptedButtons + * \brief This property holds the mouse buttons that the mouse area reacts to. + * \sa MouseArea::acceptedButtons + * + * default: \c Qt.LeftButton + */ + property alias acceptedButtons: area.acceptedButtons + + /*! + * \qmlproperty MouseArea LinkButton::mouseArea + * \brief This property holds the mouse area element covering the button. + */ + property alias mouseArea: area + + /*! + * This property holds the normal color of the link when not pressed + * or disabled. + * + * default: \c Kirigami.Theme.linkColor + */ + property color normalColor: Platform.Theme.linkColor + + /*! + * This property holds the color of the link while pressed. + * + * default: Whatever the normal color is set to, but 200% darker. + */ + property color pressedColor: Qt.darker(normalColor) + + /*! + * This property holds the color of the link when disabled. + * + * default: \c Kirigami.Theme.textColor + */ + property color disabledColor: Platform.Theme.textColor + + activeFocusOnTab: true + Accessible.role: Accessible.Button + Accessible.name: text + Accessible.onPressAction: clicked({ button: Qt.LeftButton }) + + text: action?.text ?? "" + enabled: action?.enabled ?? true + + onClicked: action?.trigger() + + color: if (!enabled) { + return control.disabledColor; + } else if (area.containsPress) { + return control.pressedColor; + } else { + return control.normalColor; + } + + signal pressed(var mouse) + signal clicked(var mouse) + + Keys.onPressed: event => { + switch (event.key) { + case Qt.Key_Space: + case Qt.Key_Enter: + case Qt.Key_Return: + case Qt.Key_Select: + control.clicked({ button: Qt.LeftButton }); + event.accepted = true; + break; + case Qt.Key_Menu: + control.pressed({ button: Qt.RightButton }); + event.accepted = true; + break; + } + } + + MouseArea { + id: area + width: control.contentWidth + control.leftPadding + control.rightPadding + height: control.implicitHeight + x: { + switch (control.effectiveHorizontalAlignment) { + case Text.AlignLeft: + case Text.AlignJustify: + return 0; + case Text.AlignRight: + return control.width - width; + case Text.AlignHCenter: + return (control.width - width) / 2; + } + } + + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: mouse => control.clicked(mouse) + onPressed: mouse => control.pressed(mouse) + } +} diff --git a/local/recipes/kde/kirigami/source/src/templates/NavigationTabBar.qml b/local/recipes/kde/kirigami/source/src/templates/NavigationTabBar.qml new file mode 100644 index 0000000000..62caa290cc --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/templates/NavigationTabBar.qml @@ -0,0 +1,343 @@ +/* + * SPDX-FileCopyrightText: 2021 Devin Lin + * SPDX-FileCopyrightText: 2026 Akseli Lahtinen + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +pragma ComponentBehavior: Bound + +import QtQuick +import QtQml +import QtQuick.Layouts +import QtQuick.Controls as QQC +import QtQuick.Templates as T +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.controls as Controls +import org.kde.kirigami.templates as KT + +/*! + \qmltype NavigationTabBar + \inqmlmodule org.kde.kirigami + + \brief Page navigation tab-bar, used as an alternative to sidebars for 3-5 elements. A NavigationTabBar can be both used as a footer or a header for a page. It can be combined with secondary toolbars above (if in the footer) to provide page actions. + + Example usage: + \qml + + import QtQuick + import org.kde.kirigami as Kirigami + + Kirigami.ApplicationWindow { + title: "Clock" + + pageStack.initialPage: worldPage + + Kirigami.Page { + id: worldPage + title: "World" + visible: false + } + Kirigami.Page { + id: timersPage + title: "Timers" + visible: false + } + Kirigami.Page { + id: stopwatchPage + title: "Stopwatch" + visible: false + } + Kirigami.Page { + id: alarmsPage + title: "Alarms" + visible: false + } + + footer: Kirigami.NavigationTabBar { + actions: [ + Kirigami.Action { + icon.name: "globe" + text: "World" + checked: worldPage.visible + onTriggered: { + if (!worldPage.visible) { + while (pageStack.depth > 0) { + pageStack.pop(); + } + pageStack.push(worldPage); + } + } + }, + Kirigami.Action { + icon.name: "player-time" + text: "Timers" + checked: timersPage.visible + onTriggered: { + if (!timersPage.visible) { + while (pageStack.depth > 0) { + pageStack.pop(); + } + pageStack.push(timersPage); + } + } + }, + Kirigami.Action { + icon.name: "chronometer" + text: "Stopwatch" + checked: stopwatchPage.visible + onTriggered: { + if (!stopwatchPage.visible) { + while (pageStack.depth > 0) { + pageStack.pop(); + } + pageStack.push(stopwatchPage); + } + } + }, + Kirigami.Action { + icon.name: "notifications" + text: "Alarms" + checked: alarmsPage.visible + onTriggered: { + if (!alarmsPage.visible) { + while (pageStack.depth > 0) { + pageStack.pop(); + } + pageStack.push(alarmsPage); + } + } + } + ] + } + } +\endqml + + A NavigationTabBar can also be combined with a QtQuick SwipeView, through which swiping between Pages becomes possible. + + Example usage with a SwipeView: + \qml +import QtQuick +import QtQuick.Controls as QQC +import QtQuick.Layouts +import org.kde.kirigami as Kirigami + +Kirigami.Page { + title: "Clock" + QQC.SwipeView { + id: swipeView + anchors.fill: parent + clip: true + onCurrentIndexChanged: footer.currentIndex = currentIndex + Kirigami.Page { + id: worldPage + title: "World" + QQC.Label { + anchors.centerIn: parent + text: "Current Page: World" + } + } + Kirigami.Page { + [...] + } + ... + Kirigami.Page { + id: alarmsPage + title: "Alarms" + QQC.Label { + anchors.centerIn: parent + text: "Current Page: Alarms" + } + } + } + + footer: Kirigami.NavigationTabBar { + actions: [ + Kirigami.Action { + icon.name: "globe" + text: "World" + checked: true + onTriggered: swipeView.currentIndex = footer.currentIndex + }, + Kirigami.Action { + [...] + }, + ... + Kirigami.Action { + icon.name: "notifications" + text: "Alarms" + onTriggered: swipeView.currentIndex = footer.currentIndex + } + ] + } +} + + \endqml + + \sa NavigationTabButton + \since 5.87 + */ + +QQC.ToolBar { + id: root + +//BEGIN properties + /*! + \qmlproperty list actions + \brief This property holds the list of actions to be displayed in the toolbar. + + If the \c checked attribute in the action is set to \c true, the tab will be highlighted/selected. + */ + property list actions + + /*! + \qmlproperty list visibleActions + \brief This property holds a subset of visible actions of the list of actions. + + An action is considered visible if it is either a Kirigami.Action with + \c visible property set to true, or it is a plain QQC.Action. + */ + readonly property list visibleActions: actions + // Note: instanceof check implies `!== null` + .filter(action => action instanceof Controls.Action + ? action.visible + : action !== null + ) + + /*! + \brief The property holds the maximum width of the toolbar actions, before margins are added. + */ + property real maximumContentWidth: { + const minDelegateWidth = Platform.Units.gridUnit * 5; + // Always have at least the width of 5 items, so that small amounts of actions look natural. + return minDelegateWidth * Math.max(visibleActions.length, 5); + } + + /*! + \brief This property holds the index of currently checked tab. + + If the index set is out of bounds, or the triggered signal did not change any checked property of an action, the index + will remain the same. + */ + property int currentIndex: tabGroup.checkedButton && tabGroup.buttons.length > 0 ? (tabGroup.checkedButton as NavigationTabButton).tabIndex : -1 + + /*! + \brief This property holds the number of tab buttons. + */ + readonly property int count: tabGroup.buttons.length + + /*! + \qmlproperty ButtonGroup tabGroup + \brief This property holds the ButtonGroup used to manage the tabs. + */ + readonly property T.ButtonGroup tabGroup: tabGroup + + /*! + \brief This property holds the calculated width that buttons on the tab bar use. + + \since 5.102 + */ + property real buttonWidth: { + // Counting buttons because Repeaters can be counted among visibleChildren + let visibleButtonCount = 0; + const minWidth = contentItem.height * 0.75; + for (const visibleChild of contentItem.visibleChildren) { + if (contentItem.width / visibleButtonCount >= minWidth && // make buttons go off the screen if there is physically no room for them + visibleChild instanceof T.AbstractButton) { // Checking for AbstractButtons because any AbstractButton can act as a tab + ++visibleButtonCount; + } + } + + if (visibleButtonCount == 0) { + return 0; + } + + return Math.round(contentItem.width / visibleButtonCount); + } + + /*! + \ *brief Property for the delegate component that will be instantiated inside tab bar. + + \since 6.23 + */ + property Component delegate: Controls.NavigationTabButton { + id: delegate + + required property T.Action modelData + + parent: root.contentItem + action: modelData + // Workaround setting the action when checkable is not explicitly set making tabs uncheckable + onActionChanged: action.checkable = true + + Layout.minimumWidth: root.buttonWidth + Layout.maximumWidth: root.buttonWidth + Layout.fillHeight: true + } + + contentWidth: root.maximumContentWidth + + position: { + if (QQC.ApplicationWindow.window?.footer === root) { + return QQC.ToolBar.Footer + } else if (parent?.footer === root) { + return QQC.ToolBar.Footer + } else if (parent?.parent?.footer === parent) { + return QQC.ToolBar.Footer + } else { + return QQC.ToolBar.Header + } + } + + contentItem: RowLayout { + id: rowLayout + spacing: root.spacing + } +//END properties + + onCurrentIndexChanged: { + if (currentIndex === -1) { + if (tabGroup.checkState !== Qt.Unchecked) { + tabGroup.checkState = Qt.Unchecked; + } + return; + } + if (!tabGroup.checkedButton || (tabGroup.checkedButton as KT.NavigationTabButton).tabIndex !== currentIndex) { + const buttonForCurrentIndex = tabGroup.buttons[currentIndex] + if (buttonForCurrentIndex.action) { + // trigger also toggles and causes clicked() to be emitted + buttonForCurrentIndex.action.trigger(); + } else { + // toggle() does not trigger the action, + // so don't use it if you want to use an action. + // It also doesn't cause clicked() to be emitted. + buttonForCurrentIndex.toggle(); + } + } + } + + // Used to manage which tab is checked and change the currentIndex + T.ButtonGroup { + id: tabGroup + exclusive: true + buttons: root.contentItem.children.filter((child) => child !== instantiator) + + onCheckedButtonChanged: { + if (!checkedButton) { + return + } + if (root.currentIndex !== (checkedButton as KT.NavigationTabButton).tabIndex) { + root.currentIndex = (checkedButton as KT.NavigationTabButton).tabIndex; + } + } + } + + // Using a Repeater here because Instantiator was causing issues: + // NavigationTabButtons that were supposed to be destroyed were still + // registered as buttons in tabGroup. + // NOTE: This will make Repeater show up as child through visibleChildren + Repeater { + id: instantiator + model: root.visibleActions + delegate: root.delegate + } +} diff --git a/local/recipes/kde/kirigami/source/src/templates/NavigationTabButton.qml b/local/recipes/kde/kirigami/source/src/templates/NavigationTabButton.qml new file mode 100644 index 0000000000..90eb8d62fb --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/templates/NavigationTabButton.qml @@ -0,0 +1,110 @@ +/* SPDX-FileCopyrightText: 2021 Devin Lin + * SPDX-FileCopyrightText: 2021 Noah Davis + * SPDX-FileCopyrightText: 2026 Akseli Lahtinen + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Controls as QQC2 +import QtQuick.Templates as T +import org.kde.kirigami.controls as Controls +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.primitives as Primitives + +/*! + \qmltype NavigationTabButton + \inqmlmodule org.kde.kirigami + + \brief Navigation buttons to be used for the NavigationTabBar component. + + It supplies its own padding, and also supports using the AbstractButton::display property to be used in column lists. + + Alternative way to the actions property on NavigationTabBar, as it can be used + with Repeater to generate buttons from models. + + Example usage: + \code + Kirigami.NavigationTabBar { + id: navTabBar + Kirigami.NavigationTabButton { + visible: true + icon.name: "document-save" + text: `test ${tabIndex + 1}` + QQC2.ButtonGroup.group: navTabBar.tabGroup + } + Kirigami.NavigationTabButton { + visible: false + icon.name: "document-send" + text: `test ${tabIndex + 1}` + QQC2.ButtonGroup.group: navTabBar.tabGroup + } + actions: [ + Kirigami.Action { + visible: true + icon.name: "edit-copy" + icon.height: 32 + icon.width: 32 + text: `test 3` + checked: true + }, + Kirigami.Action { + visible: true + icon.name: "edit-cut" + text: `test 4` + checkable: true + }, + Kirigami.Action { + visible: false + icon.name: "edit-paste" + text: `test 5` + }, + Kirigami.Action { + visible: true + icon.source: "../logo.png" + text: `test 6` + checkable: true + } + ] + } + \endcode + + \since 5.87 + */ +T.TabButton { + id: control + + /*! + \brief This property tells the index of this tab within the tab bar. + */ + readonly property int tabIndex: { + let tabIdx = 0 + for (const child of parent.children) { + if (child === this) { + return tabIdx + } + // Checking for AbstractButtons because any AbstractButton can act as a tab + if (child instanceof T.AbstractButton) { + ++tabIdx + } + } + return -1 + } + + QQC2.ToolTip.text: (control.action as Controls.Action)?.tooltip ?? "" + QQC2.ToolTip.visible: (Platform.Settings.tabletMode ? pressed : hovered) && QQC2.ToolTip.text.length > 0 + QQC2.ToolTip.delay: Platform.Units.toolTipDelay + + Primitives.MnemonicData.enabled: enabled && visible + Primitives.MnemonicData.controlType: Primitives.MnemonicData.MenuItem + Primitives.MnemonicData.label: text + + Accessible.description: Primitives.MnemonicData.plainTextLabel + Accessible.onPressAction: control.animateClick() + + Shortcut { + //in case of explicit & the button manages it by itself + enabled: !(RegExp(/\&[^\&]/).test(control.text)) + sequence: control.Primitives.MnemonicData.sequence + onActivated: control.animateClick() + } +} diff --git a/local/recipes/kde/kirigami/source/src/templates/OverlayDrawer.qml b/local/recipes/kde/kirigami/source/src/templates/OverlayDrawer.qml new file mode 100644 index 0000000000..33b8f4b7ec --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/templates/OverlayDrawer.qml @@ -0,0 +1,581 @@ +/* + * SPDX-FileCopyrightText: 2012 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls as QQC2 +import org.kde.kirigami as Kirigami +import org.kde.kirigami.primitives as Primitives +import org.kde.kirigami.platform as Platform +import "private" as KTP + +/*! + \qmltype OverlayDrawer + \inqmlmodule org.kde.kirigami + + \brief A Drawer used to expose additional UI elements needed for + small secondary tasks for which the main UI elements are not needed. + + For example in Okular Mobile, an Overlay Drawer is used to display + thumbnails of all pages within a document along with a search field. + This is used for the distinct task of navigating to another page. + */ +T.Drawer { + id: root + +//BEGIN properties + /*! + \brief This property tells whether the drawer is open and visible. + + default: \c false + */ + property bool drawerOpen: false + + /*! + \brief This property tells whether the drawer is in a state between open + and closed. + + The drawer is visible but not completely open. This is usually the case when + the user is dragging the drawer from a screen edge, so the user is "peeking" + at what's in the drawer. + + default: \c false + */ + property bool peeking: false + + /*! + \brief This property tells whether the drawer is currently opening or closing itself. + */ + readonly property bool animating : enterAnimation.animating || exitAnimation.animating || positionResetAnim.running + + /*! + \brief This property holds whether the drawer can be collapsed to a + very thin, usually icon only sidebar. + + Only modal drawers are collapsible. Collapsible is not supported in + the mobile mode. + + \since 2.5 + */ + property bool collapsible: false + + /*! + \brief This property tells whether the drawer is collapsed to a + very thin sidebar, usually icon only. + + When true, the drawer will be collapsed to a very thin sidebar, + usually icon only. + + Only collapsible drawers can be collapsed. + + When collapsed, drawers can't be manually resized even when + interactiveResizeEnabled is true + + default: \c false + + \sa collapsible + */ + property bool collapsed: false + + /*! + \brief This property holds the size of the collapsed drawer. + + For vertical drawers this will be the width of the drawer and for horizontal + drawers this will be the height of the drawer. + + default: Units.iconSizes.medium, just enough to accommodate medium sized icons + */ + property int collapsedSize: Platform.Units.iconSizes.medium + + /*! + \qmlproperty string icon.name + \qmlproperty var icon.source + \qmlproperty color icon.color + \qmlproperty real icon.width + \qmlproperty real icon.height + \qmlproperty function icon.fromControlsIcon + + This property holds the options for handle's open icon. + + If no custom icon is set, a menu icon is shown for the application globalDrawer + and an overflow menu icon is shown for the contextDrawer. + That's the default for the GlobalDrawer and ContextDrawer components respectively. + + For OverlayDrawer the default is view-right-close or view-left-close depending on + the drawer location + + \since 2.5 + + \include iconpropertiesgroup.qdocinc grouped-properties + */ + readonly property Primitives.IconPropertiesGroup handleOpenIcon: Primitives.IconPropertiesGroup { + name: root.edge === Qt.RightEdge ? "view-right-close" : "view-left-close" + width: Platform.Units.iconSizes.smallMedium + height: width + } + + /*! + \qmlproperty string handleClosedIcon.name + \qmlproperty var handleClosedIcon.source + \qmlproperty color handleClosedIcon.color + \qmlproperty real handleClosedIcon.width + \qmlproperty real handleClosedIcon.height + \qmlproperty function handleClosedIcon.fromControlsIcon + + This grouped property holds the description of an optional icon. + + If no custom icon is set, an X icon is shown, + which will morph into the Menu or overflow icons. + + For OverlayDrawer the default is view-right-new or view-left-new depending on + the drawer location. + + \since 2.5 + */ + property Primitives.IconPropertiesGroup handleClosedIcon: Primitives.IconPropertiesGroup { + name: root.edge === Qt.RightEdge ? "view-right-new" : "view-left-new" + width: Platform.Units.iconSizes.smallMedium + height: width + } + + /*! + \brief This property holds the tooltip displayed when the drawer is open. + \since 2.15 + */ + property string handleOpenToolTip: qsTr("Close drawer") + + /*! + \brief This property holds the tooltip displayed when the drawer is closed. + \since 2.15 + */ + property string handleClosedToolTip: qsTr("Open drawer") + + /*! + \brief This property holds whether the handle is visible, to make opening the + drawer easier. + + Currently supported only on left and right drawers. + */ + property bool handleVisible: { + if (typeof applicationWindow === "function") { + const w = applicationWindow(); + if (w) { + return w.controlsVisible; + } + } + // For a generic-purpose OverlayDrawer its handle is visible by default + return true; + } + + /*! + \brief When true it will be possible to resize the drawer by dragging its edge with the mouse + + When the drawer is collapsed, drawers can't be manually resized even when + interactiveResizeEnabled is true + */ + property bool interactiveResizeEnabled: false + + /*! + \brief True when the user is resizing the drawer with the mouse + */ + property alias interactiveResizing: resizeHandle.pressed + + /*! + \brief The minimum size (width or height, depending on the edge) this drawer is allowed to be resized + + For left and right drawers the default is Platform.Units.gridUnit * 8 + For top and bottom drawers the default is Platform.Units.gridUnit * 4 + */ + property real minimumSize: { + switch (edge) { + case Qt.TopEdge: + case Qt.BottomEdge: + return Platform.Units.gridUnit * 4; + default: + return Platform.Units.gridUnit * 8; + } + } + + /*! + \brief The size (width or height, depending on the edge) the drawer wants to have when on left or right edges and not collapsed. + + Wnen interactiveResizing is true and the app wants to restore its saved custom drawer size, it should write to this property, width, height, implicitWidth and implicitHeight should not be touched. + + Default value is -1, which means the drawer will be sized following its contents size hints + */ + property real preferredSize: -1 + + /*! + \brief The maximum size (width or height, depending on the edge) this drawer is allowed to be resized + + For left and right drawers the default is the minimum between Platform.Units.gridUnit * 25 + and 80% of the window width + For Top and bottom drawers the default is the minimum between Platform.Units.gridUnit * 15 and half of + the window height + */ + property real maximumSize: { + switch (edge) { + case Qt.TopEdge: + case Qt.BottomEdge: + return Math.round(Math.min(T.ApplicationWindow.window.height * 0.5, Platform.Units.gridUnit * 15)); + default: + return Math.round(Math.min(T.ApplicationWindow.window.width * 0.8, Platform.Units.gridUnit * 25)); + } + } + + /*! + \brief Readonly property that points to the item that will act as a physical + handle for the Drawer. + */ + readonly property Item handle: KTP.DrawerHandle { + drawer: root + } +//END properties + + interactive: modal + + z: Kirigami.OverlayZStacking.z + + Platform.Theme.inherit: false + Platform.Theme.colorSet: modal ? Platform.Theme.View : Platform.Theme.Window + Platform.Theme.onColorSetChanged: { + contentItem.Platform.Theme.colorSet = Platform.Theme.colorSet + background.Platform.Theme.colorSet = Platform.Theme.colorSet + } + +//BEGIN reassign properties + padding: Platform.Units.smallSpacing + + y: modal ? 0 : ((T.ApplicationWindow.menuBar && T.ApplicationWindow.menuBar.visible ? T.ApplicationWindow.menuBar.height : 0) + (T.ApplicationWindow.header && T.ApplicationWindow.header.visible ? T.ApplicationWindow.header.height : 0)) + + height: parent && (root.edge === Qt.LeftEdge || root.edge === Qt.RightEdge) ? (modal ? parent.height : (parent.height - y - (T.ApplicationWindow.footer ? T.ApplicationWindow.footer.height : 0))) : implicitHeight + + parent: modal || edge === Qt.LeftEdge || edge === Qt.RightEdge ? T.Overlay.overlay : T.ApplicationWindow.contentItem + + edge: Qt.LeftEdge + modal: true + // Doesn't dim on isSidebarTransitioning to not flash a dark background + // see https://bugs.kde.org/502260 + dim: modal && !__internal.isSidebarTransitioning + + QQC2.Overlay.modal: Rectangle { + color: Qt.rgba(0, 0, 0, 0.35) + } + + dragMargin: enabled && (edge === Qt.LeftEdge || edge === Qt.RightEdge) ? Math.min(Platform.Units.gridUnit, Application.styleHints.startDragDistance) : 0 + + contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) + contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + + implicitWidth: contentWidth + leftPadding + rightPadding + implicitHeight: contentHeight + topPadding + bottomPadding + + enter: Transition { + enabled: !root.__internal.isSidebarTransitioning + SequentialAnimation { + id: enterAnimation + /* NOTE: why this? the running status of the enter transition is not relaible and + * the SmoothedAnimation is always marked as non running, + * so the only way to get to a reliable animating status is with this + */ + property bool animating + ScriptAction { + script: { + enterAnimation.animating = true + // on non modal dialog we don't want drawers in the overlay + if (!root.modal) { + root.background.parent.parent = root.T.Overlay.overlay.parent + } + } + } + NumberAnimation { + easing.type: Easing.OutQuad + duration: Platform.Units.longDuration + } + ScriptAction { + script: enterAnimation.animating = false + } + } + } + + exit: Transition { + enabled: !root.__internal.isSidebarTransitioning + SequentialAnimation { + id: exitAnimation + property bool animating + ScriptAction { + script: exitAnimation.animating = true + } + NumberAnimation { + easing.type: Easing.InQuad + duration: Platform.Units.longDuration + } + ScriptAction { + script: exitAnimation.animating = false + } + } + } +//END reassign properties + + +//BEGIN signal handlers + onCollapsedChanged: { + if (Platform.Settings.isMobile) { + collapsed = false; + } + if (!__internal.completed) { + return; + } + if ((!collapsible || modal) && collapsed) { + collapsed = true; + } + } + onCollapsibleChanged: { + if (Platform.Settings.isMobile) { + collapsible = false; + } + if (!__internal.completed) { + return; + } + if (!collapsible) { + collapsed = false; + } else if (modal) { + collapsible = false; + } + } + onModalChanged: { + if (!__internal.completed) { + return; + } + if (modal) { + collapsible = false; + } + __internal.isSidebarTransitioning = true + if (modal) { + position = 0 + drawerOpen = false + } + } + + onPositionChanged: { + if (peeking) { + visible = true + } + } + onVisibleChanged: { + if (peeking) { + visible = true + } else { + drawerOpen = visible; + } + if (__internal.isSidebarTransitioning) { + position = visible ? 1 : 0 + __internal.isSidebarTransitioning = false + } + } + onPeekingChanged: { + if (peeking) { + root.enter.enabled = false; + root.exit.enabled = false; + } else { + drawerOpen = position > 0.5 ? 1 : 0; + positionResetAnim.running = true + root.enter.enabled = true; + root.exit.enabled = true; + } + } + onDrawerOpenChanged: { + // sync this property only when the component is properly loaded + if (!__internal.completed) { + return; + } + positionResetAnim.running = false; + if (drawerOpen) { + open(); + } else { + close(); + } + Qt.callLater(() => root.handle.displayToolTip = true) + } + + Component.onCompleted: { + // if defined as drawerOpen by default in QML, don't animate + if (root.drawerOpen) { + root.enter.enabled = false; + root.visible = true; + root.position = 1; + root.enter.enabled = true; + } + __internal.completed = true; + contentItem.Platform.Theme.colorSet = Platform.Theme.colorSet; + background.Platform.Theme.colorSet = Platform.Theme.colorSet; + } +//END signal handlers + + // this is as hidden as it can get here + + component Internal: QtObject { + property bool completed + property bool isSidebarTransitioning + property SequentialAnimation positionResetAnim + } + + property Internal __internal: Internal { + //here in order to not be accessible from outside + completed: false + isSidebarTransitioning: false + positionResetAnim: SequentialAnimation { + id: positionResetAnim + property alias to: internalAnim.to + NumberAnimation { + id: internalAnim + target: root + to: root.drawerOpen ? 1 : 0 + property: "position" + duration: (root.position)*Platform.Units.longDuration + } + ScriptAction { + script: { + root.drawerOpen = internalAnim.to !== 0; + } + } + } + readonly property Item statesItem: Item { + states: [ + State { + when: root.collapsed + PropertyChanges { + root.implicitWidth: root.edge === Qt.TopEdge || root.edge === Qt.BottomEdge ? root.T.ApplicationWindow.window.width : Math.min(root.collapsedSize + root.leftPadding + root.rightPadding, Math.round(root.T.ApplicationWindow.window.width*0.8)) + + root.implicitHeight: root.edge === Qt.LeftEdge || root.edge === Qt.RightEdge ? root.T.ApplicationWindow.window.height : Math.min(root.collapsedSize + root.topPadding + root.bottomPadding, Math.round(root.T.ApplicationWindow.window.height*0.8)) + } + }, + State { + when: !root.collapsed + PropertyChanges { + root.implicitWidth: { + if (root.edge === Qt.TopEdge || root.edge === Qt.BottomEdge) { + return root.T.ApplicationWindow.window?.width ?? Platform.Units.gridUnit * 30; + } else { + const implicitWidth = root.preferredSize > 0 ? root.preferredSize : contentItem.implicitWidth; + return Math.max(root.minimumSize, Math.min(implicitWidth + root.leftPadding + root.rightPadding, root.maximumSize)) + } + } + + root.implicitHeight: { + if (root.edge === Qt.LeftEdge || root.edge === Qt.RightEdge) { + return root.T.ApplicationWindow.window?.height ?? Platform.Units.gridUnit * 5; + } else { + const implicitHeight = root.preferredSize > 0 ? root.preferredSize : contentItem.implicitHeight; + return Math.max(root.minimumSize, Math.min(implicitHeight + root.topPadding + root.bottomPadding, root.maximumSize)) + } + } + + root.contentWidth: root.contentItem.implicitWidth || (root.contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) + root.contentHeight: root.contentItem.implicitHeight || (root.contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + } + } + ] + transitions: Transition { + reversible: true + enabled: root.collapsible === true + NumberAnimation { + properties: root.edge === Qt.TopEdge || root.edge === Qt.BottomEdge ? "implicitHeight" : "implicitWidth" + duration: Platform.Units.longDuration + easing.type: Easing.InOutQuad + } + } + } + readonly property MouseArea resizeHandle: MouseArea { + id: resizeHandle + anchors.margins: -Platform.Units.smallSpacing + parent: root.background.parent + z: 999 + visible: root.interactiveResizeEnabled && !root.collapsed + width: Platform.Units.smallSpacing * 2 + height: Platform.Units.smallSpacing * 2 + cursorShape: { + switch (root.edge) { + case Qt.TopEdge: + case Qt.BottomEdge: + return Qt.SplitVCursor; + default: + return Qt.SplitHCursor; + } + } + preventStealing: true + property real startX + property real startY + property real startWidth; + property real startHeight; + + onPressed: mouse => { + const pos = mapToItem(null, mouse.x, mouse.y); + startX = pos.x; + startY = pos.y; + startWidth = root.width; + startHeight = root.height; + } + onPositionChanged: mouse => { + const pos = mapToItem(null, mouse.x, mouse.y); + switch (root.edge) { + case Qt.TopEdge: + root.preferredSize = startHeight + pos.y - startY; + break; + case Qt.BottomEdge: + root.preferredSize = startHeight - pos.y + startY; + break; + case Qt.RightEdge: + root.preferredSize = startWidth - pos.x + startX; + break; + case Qt.LeftEdge: + default: + root.preferredSize = startWidth + pos.x - startX; + } + } + + states: [ + State { + when: root.edge === Qt.LeftEdge + AnchorChanges { + target: resizeHandle + anchors.top: root.background.top + anchors.right: root.background.right + anchors.bottom: root.background.bottom + } + }, + State { + when: root.edge === Qt.RightEdge + AnchorChanges { + target: resizeHandle + anchors.top: root.background.top + anchors.left: root.background.left + anchors.bottom: root.background.bottom + } + }, + State { + when: root.edge === Qt.TopEdge + AnchorChanges { + target: resizeHandle + anchors.left: root.background.left + anchors.right: root.background.right + anchors.bottom: root.background.bottom + } + } + , + State { + when: root.edge === Qt.BottomEdge + AnchorChanges { + target: resizeHandle + anchors.left: root.background.left + anchors.right: root.background.right + anchors.top: root.background.top + } + } + ] + } + } +} diff --git a/local/recipes/kde/kirigami/source/src/templates/OverlaySheet.qml b/local/recipes/kde/kirigami/source/src/templates/OverlaySheet.qml new file mode 100644 index 0000000000..e0c92b9b74 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/templates/OverlaySheet.qml @@ -0,0 +1,445 @@ +/* + * SPDX-FileCopyrightText: 2016-2023 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls as QQC2 +import QtQuick.Templates as T +import org.kde.kirigami as Kirigami +import org.kde.kirigami.controls as KirigamiControls +import org.kde.kirigami.layouts as KirigamiLayouts +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.primitives as Primitives + +/*! + \qmltype Overlay + \inqmlmodule org.kde.kirigami + + \brief An overlay sheet that covers the current Page content. + + OverlaySheet is used for auxiliary display of narrow, read-only, scrollable + content. For more details, see + https://develop.kde.org/hig/displaying_content/#page-vs-dialog-vs-overlaysheet. + + Can be dismissed with a touch swipe when scrolled to the top or bottom. + + \note OverlaySheet needs a single child item defined. Do not override its + \c contentItem. + + Example usage: + \qml + Kirigami.OverlaySheet { + ColumnLayout { ... } + } + Kirigami.OverlaySheet { + ListView { ... } + } + \endqml + */ +T.Popup { + id: root + + Kirigami.OverlayZStacking.layer: Kirigami.OverlayZStacking.FullScreen + z: Kirigami.OverlayZStacking.z + + Platform.Theme.colorSet: Platform.Theme.View + Platform.Theme.inherit: false + +//BEGIN Own Properties + + /*! + \brief A title to be displayed in the header of this Sheet. + + default: empty string, and no header text will be displayed + */ + property string title + + /*! + \brief This property sets the visibility of the close button in the top-right corner. + + default: Only shown in desktop mode + */ + property bool showCloseButton: !Platform.Settings.isMobile + + /*! + \brief This property holds an optional item which will be used as the + sheet's header, and will always be displayed. + + default: \c null + */ + property Item header: KirigamiControls.Heading { + level: 2 + text: root.title + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight + + // use tooltip for long text that is elided + T.ToolTip.visible: truncated && titleHoverHandler.hovered + T.ToolTip.text: root.title + HoverHandler { + id: titleHoverHandler + } + } + + /*! + \brief An optional item which will be used as the sheet's footer, and + always kept on screen. + + default: \c null + */ + property Item footer + + default property alias flickableContentData: scrollView.contentData +//END Own Properties + +//BEGIN Reimplemented Properties + QQC2.Overlay.modal: Rectangle { + color: Qt.rgba(0, 0, 0, 0.3) + + // the opacity of the item is changed internally by QQuickPopup on open/close + Behavior on opacity { + OpacityAnimator { + duration: Platform.Units.longDuration + easing.type: Easing.InOutQuad + } + } + } + + modal: true + dim: true + + leftInset: -1 + rightInset: -1 + topInset: -1 + bottomInset: -1 + + closePolicy: T.Popup.CloseOnEscape + x: parent ? Math.round(parent.width / 2 - width / 2) : 0 + y: { + if (!parent) { + return 0; + } + const visualParentAdjust = sheetHandler.visualParent?.y ?? 0; + const wantedPosition = parent.height / 2 - implicitHeight / 2; + return Math.round(Math.max(visualParentAdjust, wantedPosition, Platform.Units.gridUnit * 3)); + } + + width: root.parent ? Math.min(root.parent.width, implicitWidth) : implicitWidth + implicitWidth: { + let width = parent?.width ?? 0; + if (!scrollView.itemForSizeHints) { + return width; + } else if (scrollView.itemForSizeHints.Layout.preferredWidth > 0) { + return Math.min(width, scrollView.itemForSizeHints.Layout.preferredWidth); + } else if (scrollView.itemForSizeHints.implicitWidth > 0) { + return Math.min(width, scrollView.itemForSizeHints.implicitWidth); + } else { + return width; + } + } + implicitHeight: { + let h = parent?.height ?? 0; + if (!scrollView.itemForSizeHints) { + return h - y; + } else if (scrollView.itemForSizeHints.Layout.preferredHeight > 0) { + h = scrollView.itemForSizeHints.Layout.preferredHeight; + } else if (scrollView.itemForSizeHints.implicitHeight > 0) { + h = scrollView.itemForSizeHints.implicitHeight + Platform.Units.largeSpacing * 2; + } else if ((scrollView.itemForSizeHints as Flickable)?.contentHeight > 0) { + h = (scrollView.itemForSizeHints as Flickable).contentHeight + Platform.Units.largeSpacing * 2; + } else { + h = scrollView.itemForSizeHints.height; + } + h += headerItem.implicitHeight + footerParent.implicitHeight + topPadding + bottomPadding; + return parent ? Math.min(h, parent.height - y) : h + } +//END Reimplemented Properties + +//BEGIN Signal handlers + onVisibleChanged: { + const flickable = scrollView.contentItem as Flickable; + flickable.contentY = flickable.originY - flickable.topMargin; + } + + Component.onCompleted: { + Qt.callLater(() => { + if (!root.parent && typeof applicationWindow !== "undefined") { + root.parent = applicationWindow().overlay + } + }); + } + + Connections { + target: root.parent + function onVisibleChanged() { + if (!root.parent.visible) { + root.close(); + } + } + } +//END Signal handlers + +//BEGIN UI + contentItem: MouseArea { + implicitWidth: mainLayout.implicitWidth + implicitHeight: mainLayout.implicitHeight + Platform.Theme.colorSet: root.Platform.Theme.colorSet + Platform.Theme.inherit: false + + property real scenePressY + property real lastY + property bool dragStarted + drag.filterChildren: true + DragHandler { + id: mouseDragBlocker + target: null + dragThreshold: 0 + acceptedDevices: PointerDevice.Mouse + onActiveChanged: { + if (active) { + parent.dragStarted = false; + } + } + } + + onPressed: mouse => { + scenePressY = mapToItem(null, mouse.x, mouse.y).y; + lastY = scenePressY; + dragStarted = false; + } + onPositionChanged: mouse => { + if (mouseDragBlocker.active) { + return; + } + const currentY = mapToItem(null, mouse.x, mouse.y).y; + + if (dragStarted && currentY !== lastY) { + translation.y += currentY - lastY; + } + if (Math.abs(currentY - scenePressY) > Application.styleHints.startDragDistance) { + dragStarted = true; + } + lastY = currentY; + } + onCanceled: restoreAnim.restart(); + onReleased: mouse => { + if (mouseDragBlocker.active) { + return; + } + if (Math.abs(mapToItem(null, mouse.x, mouse.y).y - scenePressY) > Platform.Units.gridUnit * 5) { + root.close(); + } else { + restoreAnim.restart(); + } + } + + ColumnLayout { + id: mainLayout + anchors.fill: parent + spacing: 0 + + Item { + id: headerItem + Layout.fillWidth: true + Layout.alignment: Qt.AlignTop + //Layout.margins: 1 + visible: root.header || root.showCloseButton + implicitHeight: Math.max(headerParent.implicitHeight, closeIcon.height)// + Platform.Units.smallSpacing * 2 + z: 2 + + Rectangle { + anchors { + top: parent.top + horizontalCenter: parent.horizontalCenter + topMargin: Platform.Units.smallSpacing + } + width: Math.round(Platform.Units.gridUnit * 3) + height: Math.round(Platform.Units.gridUnit / 4) + radius: height + color: Platform.Theme.textColor + opacity: 0.4 + visible: Platform.Settings.hasTransientTouchInput + } + KirigamiLayouts.Padding { + id: headerParent + + readonly property real leadingPadding: Platform.Units.largeSpacing + readonly property real trailingPadding: (root.showCloseButton ? closeIcon.width + closeIcon.anchors.rightMargin : 0) + Platform.Units.smallSpacing + + anchors.fill: parent + verticalPadding: Platform.Units.largeSpacing + leftPadding: root.mirrored ? trailingPadding : leadingPadding + rightPadding: root.mirrored ? leadingPadding : trailingPadding + + contentItem: root.header + } + QQC2.ToolButton { + id: closeIcon + + // We want to position the close button in the top-right + // corner if the header is very tall, but we want to + // vertically center it in a short header + readonly property bool tallHeader: parent.height > (Platform.Units.iconSizes.smallMedium + Platform.Units.largeSpacing * 2) + readonly property real tallHeaderMargins: Platform.Units.largeSpacing + readonly property real shortHeaderMargins: Math.round((headerItem.implicitHeight - implicitHeight) / 2) + + anchors { + top: parent.top + right: parent.right + margins: tallHeader ? tallHeaderMargins : shortHeaderMargins + } + z: 3 + + visible: root.showCloseButton + icon.name: closeIcon.hovered ? "window-close" : "window-close-symbolic" + text: qsTr("Close", "@action:button close dialog") + onClicked: root.close() + display: QQC2.AbstractButton.IconOnly + } + Primitives.Separator { + anchors { + right: parent.right + left: parent.left + top: parent.bottom + } + visible: scrollView.T.ScrollBar.vertical.visible + } + } + + // Here goes the main Sheet content + QQC2.ScrollView { + id: scrollView + Layout.fillWidth: true + Layout.fillHeight: true + clip: true + T.ScrollBar.horizontal.policy: T.ScrollBar.AlwaysOff + + property bool initialized: false + property Item itemForSizeHints + + // Important to not even access contentItem before it has been spontaneously created + contentWidth: initialized ? contentItem.width : width + contentHeight: itemForSizeHints?.implicitHeight ?? 0 + + onContentItemChanged: { + initialized = true; + const flickable = contentItem as Flickable; + flickable.boundsBehavior = Flickable.StopAtBounds; + if ((flickable instanceof ListView) || (flickable instanceof GridView)) { + itemForSizeHints = flickable; + return; + } + const content = flickable.contentItem; + content.childrenChanged.connect(() => { + for (const item of content.children) { + item.anchors.margins = Platform.Units.largeSpacing; + item.anchors.top = content.top; + item.anchors.left = content.left; + item.anchors.right = content.right; + } + itemForSizeHints = content.children?.[0] ?? null; + }); + } + } + + // Optional footer + Primitives.Separator { + Layout.fillWidth: true + visible: footerParent.visible + } + KirigamiLayouts.Padding { + id: footerParent + Layout.fillWidth: true + padding: Platform.Units.smallSpacing + contentItem: root.footer + visible: contentItem !== null + } + } + Translate { + id: translation + } + MouseArea { + id: sheetHandler + readonly property Item visualParent: root.parent?.contentItem ?? root.parent + x: -root.x + y: -root.y + z: -1 + width: visualParent?.width ?? 0 + height: (visualParent?.height ?? 0) * 2 + + property var pressPos + onPressed: mouse => { + pressPos = mapToItem(null, mouse.x, mouse.y) + } + onReleased: mouse => { + // onClicked is emitted even if the mouse was dragged a lot, so we have to check the Manhattan length by hand + // https://en.wikipedia.org/wiki/Taxicab_geometry + let pos = mapToItem(null, mouse.x, mouse.y) + if (Math.abs(pos.x - pressPos.x) + Math.abs(pos.y - pressPos.y) < Application.styleHints.startDragDistance) { + root.close(); + } + } + + NumberAnimation { + id: restoreAnim + target: translation + property: "y" + from: translation.y + to: 0 + easing.type: Easing.InOutQuad + duration: Platform.Units.longDuration + } + Component.onCompleted: { + root.contentItem.parent.transform = translation + root.contentItem.parent.clip = false + } + } + } +//END UI + +//BEGIN Transitions + enter: Transition { + ParallelAnimation { + NumberAnimation { + property: "opacity" + from: 0 + to: 1 + easing.type: Easing.InOutQuad + duration: Platform.Units.longDuration + } + NumberAnimation { + target: translation + property: "y" + from: Platform.Units.gridUnit * 5 + to: 0 + easing.type: Easing.InOutQuad + duration: Platform.Units.longDuration + } + } + } + + exit: Transition { + ParallelAnimation { + NumberAnimation { + property: "opacity" + from: 1 + to: 0 + easing.type: Easing.InOutQuad + duration: Platform.Units.longDuration + } + NumberAnimation { + target: translation + property: "y" + from: translation.y + to: translation.y >= 0 ? translation.y + Platform.Units.gridUnit * 5 : translation.y - Platform.Units.gridUnit * 5 + easing.type: Easing.InOutQuad + duration: Platform.Units.longDuration + } + } + } +//END Transitions +} + diff --git a/local/recipes/kde/kirigami/source/src/templates/private/BorderPropertiesGroup.qml b/local/recipes/kde/kirigami/source/src/templates/private/BorderPropertiesGroup.qml new file mode 100644 index 0000000000..907664fccb --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/templates/private/BorderPropertiesGroup.qml @@ -0,0 +1,19 @@ +/* + * SPDX-FileCopyrightText: 2020 Carson Black + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick + +QtObject { + /*! + \brief This property holds the color of this border. + */ + property color color + + /*! + \brief This property holds the width of this border. + */ + property real width +} diff --git a/local/recipes/kde/kirigami/source/src/templates/private/DrawerHandle.qml b/local/recipes/kde/kirigami/source/src/templates/private/DrawerHandle.qml new file mode 100644 index 0000000000..0b56a31fc3 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/templates/private/DrawerHandle.qml @@ -0,0 +1,205 @@ +/* + * SPDX-FileCopyrightText: 2023 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import QtQuick.Controls as QQC2 +import QtQuick.Templates as T +import org.kde.kirigami.platform as Platform +import org.kde.kirigami.templates as KT +import org.kde.kirigami.primitives as Primitives + +Item { + id: root + + /* + * This property is used to set when the tooltip is visible. + * It exists because the text is changed while the tooltip is still visible. + */ + property bool displayToolTip: true + + /* + * The drawer this handle will control + */ + // Should be KT.OverlayDrawer, but can't due to "Cyclic dependency" + property T.Drawer drawer + + readonly property T.Overlay overlay: drawer.T.Overlay.overlay + + // Above the Overlay when modal but below when non-modal and when the drawer is closed + // so that other overlays can be above it. + parent: overlay?.parent ?? null + z: overlay ? overlay.z + (drawer?.modal && (drawer as KT.OverlayDrawer)?.drawerOpen ? 1 : - 1) : 0 + + QQC2.ToolButton { + id: button + anchors.centerIn: parent + flat: false + + icon.name: root.drawer.position > 0 ? root.drawer.handleOpenIcon.name : root.drawer.handleClosedIcon.name + icon.source: root.drawer.position > 0 ? root.drawer.handleOpenIcon.source ?? "" : root.drawer.handleClosedIcon.source ?? "" + icon.width: root.drawer.handleOpenIcon.width + icon.height: root.drawer.handleOpenIcon.height + Accessible.name: QQC2.ToolTip.text + + onClicked: { + root.displayToolTip = false; + Qt.callLater(() => { + const oDrawer = root.drawer as KT.OverlayDrawer + oDrawer.drawerOpen = !oDrawer.drawerOpen; + }) + } + Keys.onEscapePressed: { + if (root.drawer.closePolicy & T.Popup.CloseOnEscape) { + root.drawer.drawerOpen = false; + } + } + + QQC2.ToolTip.visible: root.displayToolTip && hovered + QQC2.ToolTip.text: { + const oDrawer = root.drawer as KT.OverlayDrawer + return oDrawer.drawerOpen ? oDrawer.handleOpenToolTip : oDrawer.handleClosedToolTip + } + QQC2.ToolTip.delay: Platform.Units.toolTipDelay + + DragHandler { + target: null + acceptedDevices: PointerDevice.TouchScreen | PointerDevice.Stylus + xAxis { + enabled: root.drawer.edge === Qt.LeftEdge || root.drawer.edge === Qt.RightEdge + minimum: 0 + maximum: root.drawer.contentItem.width + onActiveValueChanged: (delta) => { + let positionDelta = delta / root.drawer.contentItem.width; + if (root.drawer.edge === Qt.RightEdge) { + positionDelta *= -1; + } + root.drawer.position += positionDelta; + } + } + yAxis.enabled: false + onGrabChanged: (transition, point) => { + switch (transition) { + case PointerDevice.GrabExclusive: + case PointerDevice.GrabPassive: + root.drawer.peeking = true; + break; + case PointerDevice.UngrabExclusive: + case PointerDevice.UngrabPassive: + case PointerDevice.CancelGrabExclusive: + case PointerDevice.CancelGrabPassive: + root.drawer.peeking = false; + break; + default: + break; + } + } + } + } + + property Item handleAnchor: { + if (typeof applicationWindow === "undefined") { + return null; + } + const window = applicationWindow(); + const globalToolBar = window.pageStack?.globalToolBar; + if (!globalToolBar) { + return null; + } + return (drawer.edge === Qt.LeftEdge && !LayoutMirroring.enabled) || (drawer.edge === Qt.RightEdge && LayoutMirroring.enabled) + ? globalToolBar.leftHandleAnchor + : globalToolBar.rightHandleAnchor; + } + + enabled: (drawer as KT.OverlayDrawer).handleVisible + + x: { + switch (drawer.edge) { + case Qt.LeftEdge: + return drawer.background.width * drawer.position + Platform.Units.smallSpacing; + case Qt.RightEdge: + return parent.width - (drawer.background.width * drawer.position) - width - Platform.Units.smallSpacing; + default: + return 0; + } + } + + Binding { + when: root.handleAnchor && root.anchors.bottom + target: root + property: "y" + value: root.handleAnchor ? root.handleAnchor.Primitives.ScenePosition.y : 0 + restoreMode: Binding.RestoreBinding + } + + anchors { + bottom: handleAnchor ? undefined : parent.bottom + bottomMargin: { + if (typeof applicationWindow === "undefined") { + return undefined; + } + const window = applicationWindow(); + + let margin = Platform.Units.smallSpacing; + if (window.footer) { + margin = window.footer.height + Platform.Units.smallSpacing; + } + + if (drawer.parent && drawer.height < drawer.parent.height) { + margin = drawer.parent.height - drawer.height - drawer.y + Platform.Units.smallSpacing; + } + + if (!window || !window.pageStack || + !window.pageStack.contentItem || + !window.pageStack.contentItem.itemAt) { + return margin; + } + + let item; + if (window.pageStack.layers.depth > 1) { + item = window.pageStack.layers.currentItem; + } else { + item = window.pageStack.contentItem.itemAt(window.pageStack.contentItem.contentX + x, 0); + } + + // try to take the last item + if (!item) { + item = window.pageStack.lastItem; + } + + let pageFooter = item && item.page ? item.page.footer : (item ? item.footer : undefined); + if (pageFooter && drawer.parent) { + margin = drawer.height < drawer.parent.height ? margin : margin + pageFooter.height + } + + return margin; + } + + Behavior on bottomMargin { + NumberAnimation { + duration: Platform.Units.shortDuration + easing.type: Easing.InOutQuad + } + } + } + + visible: drawer.enabled && drawer.modal && (drawer.edge === Qt.LeftEdge || drawer.edge === Qt.RightEdge) && opacity > 0 + width: handleAnchor?.visible ? handleAnchor.width : Platform.Units.iconSizes.smallMedium + Platform.Units.smallSpacing * 2 + height: handleAnchor?.visible ? handleAnchor.height : width + // NOTE: check on pageStack.depth is to keep and hack elisa is doing working + opacity: handleAnchor && applicationWindow()?.pageStack.depth > 0 + ? drawer.position * (root.drawer as KT.OverlayDrawer).handleVisible + : 1 + + transform: Translate { + x: (root.drawer as KT.OverlayDrawer).handleVisible ? 0 : (root.drawer.edge === Qt.LeftEdge ? -Math.max(root.width, button.width) : Math.max(root.width, button.width)) + Behavior on x { + NumberAnimation { + duration: Platform.Units.longDuration + easing.type: !(root.drawer as KT.OverlayDrawer).handleVisible ? Easing.OutQuad : Easing.InQuad + } + } + } +} diff --git a/local/recipes/kde/kirigami/source/src/templates/private/qmldir b/local/recipes/kde/kirigami/source/src/templates/private/qmldir new file mode 100644 index 0000000000..e7864b8be7 --- /dev/null +++ b/local/recipes/kde/kirigami/source/src/templates/private/qmldir @@ -0,0 +1,4 @@ +module org.kde.kirigami.templates.private + +BorderPropertiesGroup 1.0 BorderPropertiesGroup.qml +DrawerHandle 1.0 DrawerHandle.qml diff --git a/local/recipes/kde/kirigami/source/stubs/QtNetwork/QNetworkAccessManager b/local/recipes/kde/kirigami/source/stubs/QtNetwork/QNetworkAccessManager new file mode 100644 index 0000000000..c33f49c8ec --- /dev/null +++ b/local/recipes/kde/kirigami/source/stubs/QtNetwork/QNetworkAccessManager @@ -0,0 +1,12 @@ +#ifndef REDBEAR_QNETWORKACCESSMANAGER_STUB +#define REDBEAR_QNETWORKACCESSMANAGER_STUB +#include +class QNetworkReply; +class QNetworkRequest; +class QNetworkAccessManager : public QObject +{ +public: + QNetworkAccessManager(QObject *parent = nullptr) : QObject(parent) {} + QNetworkReply *get(const QNetworkRequest &) { return nullptr; } +}; +#endif diff --git a/local/recipes/kde/kirigami/source/stubs/QtNetwork/QNetworkRequest b/local/recipes/kde/kirigami/source/stubs/QtNetwork/QNetworkRequest new file mode 100644 index 0000000000..a72b8e6173 --- /dev/null +++ b/local/recipes/kde/kirigami/source/stubs/QtNetwork/QNetworkRequest @@ -0,0 +1,16 @@ +#ifndef REDBEAR_QNETWORKREQUEST_STUB +#define REDBEAR_QNETWORKREQUEST_STUB +#include +#include +class QNetworkRequest +{ +public: + enum Attribute { RedirectionTargetAttribute = 3010, CacheLoadControlAttribute = 3004 }; + enum CacheLoadControl { AlwaysNetwork = 0, PreferCache = 1, AlwaysCache = 2, PreferNetwork = 3 }; + QNetworkRequest(const QUrl &url = QUrl()) : m_url(url) {} + void setAttribute(Attribute, const QVariant &) {} + QUrl url() const { return m_url; } +private: + QUrl m_url; +}; +#endif diff --git a/local/recipes/kde/kirigami/source/tests/declarativePageRow.qml b/local/recipes/kde/kirigami/source/tests/declarativePageRow.qml new file mode 100644 index 0000000000..b7652940b8 --- /dev/null +++ b/local/recipes/kde/kirigami/source/tests/declarativePageRow.qml @@ -0,0 +1,127 @@ +/* SPDX-FileCopyrightText: 2026 Marco Martin + * SPDX-License-Identifier: LGPL-2.0-or-later + */ +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls as QQC +import org.kde.kirigami as Kirigami + +Kirigami.ApplicationWindow { + id: root + + pageStack.defaultColumnWidth: Kirigami.Units.gridUnit * 12 + + Kirigami.Page { + id: page1 + title: "Page 1" + } + Kirigami.Page { + id: page2 + title: "Page 2" + } + Kirigami.Page { + id: page3 + title: "Page 3" + } + Kirigami.Page { + id: page4 + title: "Page 4" + visible: false + } + + Item { + id: appStates + states: [ + State { + when: navTabBar.currentIndex === 0 + PropertyChanges { + target: root.pageStack + items: [page1,page2,page3] + } + PropertyChanges { + target: page1.Kirigami.ColumnView + fillWidth: false + } + PropertyChanges { + target: page2.Kirigami.ColumnView + fillWidth: true + reservedSpace: pageStack.defaultColumnWidth*2 + } + PropertyChanges { + target: page3.Kirigami.ColumnView + fillWidth: false + } + }, + State { + when: navTabBar.currentIndex === 1 + PropertyChanges { + target: root.pageStack + items: [page1,page3] + } + PropertyChanges { + target: page1.Kirigami.ColumnView + fillWidth: false + } + PropertyChanges { + target: page3.Kirigami.ColumnView + fillWidth: true + reservedSpace: page1.width + } + + }, + State { + when: navTabBar.currentIndex === 2 + PropertyChanges { + target: root.pageStack + items: [page3,page2] + } + PropertyChanges { + target: page2.Kirigami.ColumnView + fillWidth: false + } + PropertyChanges { + target: page2.Kirigami.ColumnView + fillWidth: true + reservedSpace: pageStack.defaultColumnWidth + } + }, + State { + when: navTabBar.currentIndex === 3 + PropertyChanges { + target: root.pageStack + items: [page4,page1] + } + PropertyChanges { + target: page4.Kirigami.ColumnView + fillWidth: false + } + PropertyChanges { + target: page1.Kirigami.ColumnView + fillWidth: true + reservedSpace: pageStack.defaultColumnWidth + } + } + ] + } + + footer: Kirigami.NavigationTabBar { + id: navTabBar + + currentIndex: 0 + + actions: [ + Kirigami.Action { + text: "State 1" + }, + Kirigami.Action { + text: "State2" + }, + Kirigami.Action { + text: "State3" + }, + Kirigami.Action { + text: "State4" + } + ] + } +} diff --git a/local/recipes/qt/qtbase/source/cmake/QtPublicSbomBuildToolHelpers.cmake b/local/recipes/qt/qtbase/source/cmake/QtPublicSbomBuildToolHelpers.cmake new file mode 100644 index 0000000000..ddc0d779aa --- /dev/null +++ b/local/recipes/qt/qtbase/source/cmake/QtPublicSbomBuildToolHelpers.cmake @@ -0,0 +1,367 @@ +# Copyright (C) 2026 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# Adds an SBOM build tool target to the current SBOM project. +# Expects the target not to be created yet. +# +# A build tool is something like a compiler, linker, cmake executable, which participates in the +# build process of the current project in some way. +# +# There is a predefined list of known tools which when specified will automatically query +# information like tool version and create an appropriate relationship comment. +# +# If CUSTOM is specified as the build tool type, it's expected that the caller sets any additional +# relevant SBOM options to the SBOM_ARGS option. +# +# If AUTO_ADD_PROJECT_RELATIONSHIP is specified, an automatic relationship entry is created +# that the tool is a BUILD_DEPENDENCY_OF the current project. +function(_qt_internal_add_sbom_build_tool target) + if(NOT QT_GENERATE_SBOM) + return() + endif() + + set(opt_args + AUTO_ADD_PROJECT_RELATIONSHIP + ) + set(single_args + BUILD_TOOL_TYPE + ) + set(multi_args + SBOM_ARGS + ) + cmake_parse_arguments(PARSE_ARGV 1 arg "${opt_args}" "${single_args}" "${multi_args}") + _qt_internal_validate_all_args_are_parsed(arg) + + set(known_build_tool_types + CMAKE + CMAKE_GENERATOR + + COMPILER + LINKER + + CUSTOM + ) + + if(NOT arg_BUILD_TOOL_TYPE) + message(FATAL_ERROR "BUILD_TOOL_TYPE must be specified.") + endif() + + if(NOT arg_BUILD_TOOL_TYPE IN_LIST known_build_tool_types) + message(FATAL_ERROR "Unknown BUILD_TOOL_TYPE value: ${arg_BUILD_TOOL_TYPE}") + endif() + + if(arg_BUILD_TOOL_TYPE STREQUAL "CUSTOM" AND arg_AUTO_ADD_PROJECT_RELATIONSHIP) + message(FATAL_ERROR + "AUTO_ADD_PROJECT_RELATIONSHIP cannot be used with CUSTOM BUILD_TOOL_TYPE. Consider " + "creating a relationship manually by passing appropriate SBOM_RELATIONSHIP_ENTRIES " + "to the SBOM_ARGS option.") + endif() + + string(TOLOWER "${arg_BUILD_TOOL_TYPE}" build_tool_type_lower_case) + + if(NOT arg_BUILD_TOOL_TYPE STREQUAL "CUSTOM") + set(build_tool_type_args "") + if(arg_AUTO_ADD_PROJECT_RELATIONSHIP) + list(APPEND build_tool_type_args GET_RELATIONSHIP_COMMENT) + endif() + + _qt_internal_sbom_handle_default_build_tool_type( + BUILD_TOOL_TYPE "${arg_BUILD_TOOL_TYPE}" + OUT_VAR_SBOM_ARGS extra_args + OUT_VAR_RELATIONSHIP_COMMENT relationship_comment + ${build_tool_type_args} + ) + endif() + + set(forward_args + ${arg_SBOM_ARGS} + SBOM_ENTITY_TYPE BUILD_TOOL + ) + if(extra_args) + list(APPEND forward_args ${extra_args}) + endif() + + _qt_internal_add_sbom("${target}" ${forward_args}) + + if(arg_AUTO_ADD_PROJECT_RELATIONSHIP) + _qt_internal_sbom_get_current_project_target(project_target) + set(relationships + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + "${target}" + SBOM_RELATIONSHIP_TYPE + BUILD_DEPENDENCY_OF + SBOM_RELATIONSHIP_TO + "${project_target}" + SBOM_RELATIONSHIP_COMMENT + "${relationship_comment}" + ) + _qt_internal_extend_sbom("${project_target}" + SBOM_RELATIONSHIP_ENTRIES + ${relationships} + ) + endif() +endfunction() + +# Adds a set of default build tools that CMake uses for the current SBOM project. +# This includes the compiler, cmake, the make tool, and optionally the linker. +function(_qt_internal_sbom_add_project_default_build_tools) + _qt_internal_sbom_get_project_default_build_tool_types(default_build_tool_types) + + foreach(build_tool_type IN LISTS default_build_tool_types) + _qt_internal_sbom_get_build_tool_target_for_type( + BUILD_TOOL_TYPE "${build_tool_type}" + OUT_VAR_TARGET target + ) + _qt_internal_add_sbom_build_tool("${target}" + BUILD_TOOL_TYPE "${build_tool_type}" + AUTO_ADD_PROJECT_RELATIONSHIP + ) + endforeach() +endfunction() + +# Returns the list of default build tool types that CMake uses for the current SBOM project. +function(_qt_internal_sbom_get_project_default_build_tool_types out_var) + set(default_build_tool_types + CMAKE + CMAKE_GENERATOR + COMPILER + ) + + if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.29") + list(APPEND default_build_tool_types LINKER) + endif() + + set(${out_var} "${default_build_tool_types}" PARENT_SCOPE) +endfunction() + +# Returns the target name for one of the project default build tool types. +function(_qt_internal_sbom_get_build_tool_target_for_type) + if(NOT QT_GENERATE_SBOM) + if(arg_OUT_VAR_TARGET) + set(${arg_OUT_VAR_TARGET} "" PARENT_SCOPE) + endif() + return() + endif() + + set(opt_args "") + set(single_args + BUILD_TOOL_TYPE + OUT_VAR_TARGET + ) + set(multi_args "") + cmake_parse_arguments(PARSE_ARGV 0 arg "${opt_args}" "${single_args}" "${multi_args}") + _qt_internal_validate_all_args_are_parsed(arg) + + if(NOT arg_BUILD_TOOL_TYPE) + message(FATAL_ERROR "BUILD_TOOL_TYPE must be specified.") + endif() + + if(NOT arg_OUT_VAR_TARGET) + message(FATAL_ERROR "OUT_VAR_TARGET must be specified.") + endif() + + set(known_types + CMAKE + CMAKE_GENERATOR + COMPILER + LINKER + ) + + if(NOT arg_BUILD_TOOL_TYPE IN_LIST known_types) + message(FATAL_ERROR "Unknown BUILD_TOOL_TYPE value: ${arg_BUILD_TOOL_TYPE}") + endif() + + _qt_internal_sbom_get_root_project_name_lower_case(project_name_lower_case) + set(prefix "${project_name_lower_case}SbomBuildTool") + + if(arg_BUILD_TOOL_TYPE STREQUAL "CMAKE") + set(target "${prefix}CMake") + elseif(arg_BUILD_TOOL_TYPE STREQUAL "CMAKE_GENERATOR") + set(target "${prefix}CMakeGenerator") + elseif(arg_BUILD_TOOL_TYPE STREQUAL "COMPILER") + set(target "${prefix}Compiler") + elseif(arg_BUILD_TOOL_TYPE STREQUAL "LINKER") + set(target "${prefix}Linker") + endif() + + set(${arg_OUT_VAR_TARGET} "${target}" PARENT_SCOPE) +endfunction() + +# Returns common build tool information depending on the build tool type. +function(_qt_internal_sbom_handle_default_build_tool_type) + set(opt_args + GET_RELATIONSHIP_COMMENT + ) + set(single_args + BUILD_TOOL_TYPE + OUT_VAR_SBOM_ARGS + OUT_VAR_RELATIONSHIP_COMMENT + ) + set(multi_args "") + cmake_parse_arguments(PARSE_ARGV 0 arg "${opt_args}" "${single_args}" "${multi_args}") + _qt_internal_validate_all_args_are_parsed(arg) + + if(NOT arg_BUILD_TOOL_TYPE) + message(FATAL_ERROR "BUILD_TOOL_TYPE must be specified.") + endif() + + if(NOT arg_OUT_VAR_SBOM_ARGS) + message(FATAL_ERROR "OUT_VAR_SBOM_ARGS must be specified.") + endif() + + if(arg_GET_RELATIONSHIP_COMMENT AND NOT arg_OUT_VAR_RELATIONSHIP_COMMENT) + message(FATAL_ERROR "OUT_VAR_RELATIONSHIP_COMMENT must be specified.") + endif() + + set(sbom_args "") + set(build_tool_args "") + + if(arg_GET_RELATIONSHIP_COMMENT) + _qt_internal_sbom_get_current_project_target(project_target) + _qt_internal_sbom_get_current_project_spdx_id(project_spdx_id) + endif() + + if(arg_BUILD_TOOL_TYPE STREQUAL "CMAKE") + set(sbom_args + FRIENDLY_PACKAGE_NAME "CMake" + PACKAGE_VERSION "${CMAKE_VERSION}" + ) + if(arg_GET_RELATIONSHIP_COMMENT) + string(CONCAT relationship_comment + "${project_spdx_id} is built using CMake version ${CMAKE_VERSION}" + ) + endif() + elseif(arg_BUILD_TOOL_TYPE STREQUAL "CMAKE_GENERATOR") + set(version "") + + set(sbom_args + FRIENDLY_PACKAGE_NAME "CMake generator ${CMAKE_GENERATOR}" + ) + + if((CMAKE_GENERATOR MATCHES "Ninja" + OR CMAKE_GENERATOR STREQUAL "Unix Makefiles" + OR CMAKE_GENERATOR STREQUAL "MinGW Makefiles" + OR CMAKE_GENERATOR STREQUAL "NMake Makefiles JOM" + OR CMAKE_GENERATOR STREQUAL "Xcode") + AND CMAKE_MAKE_PROGRAM + AND NOT QT_SBOM_NO_QUERY_MAKE_PROGRAM_VERSION + ) + if(CMAKE_GENERATOR STREQUAL "Xcode") + set(query_version_option "-version") + elseif(CMAKE_GENERATOR STREQUAL "NMake Makefiles JOM") + # Regular NMake Makefiles doesn't have a /version option, so we don't extract + # that atm. + set(query_version_option "/version") + else() + # Ninja, Unix Makefiles, MinGW Makefiles + set(query_version_option "--version") + endif() + + execute_process( + COMMAND "${CMAKE_MAKE_PROGRAM}" ${query_version_option} + OUTPUT_VARIABLE make_tool_output + ERROR_VARIABLE make_tool_output + RESULT_VARIABLE make_tool_version_result + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(make_tool_version_result EQUAL 0) + # Get the first line of output. + string(REGEX MATCH "^[^\n\r]+" version_first_line "${make_tool_output}") + + # Strip characters that might break CMake argument parsing or SBOM generation. + # Leave only alpha numeric characters, dots, dashes and spaces. + string(REGEX REPLACE "[^a-zA-Z0-9. -]" "" version_first_line + "${version_first_line}") + + set(version "${version_first_line}") + endif() + endif() + + if(version) + list(APPEND sbom_args PACKAGE_VERSION "${version}") + endif() + + if(arg_GET_RELATIONSHIP_COMMENT) + set(version_comment "") + if(version) + string(APPEND version_comment "version '${version}'") + endif() + + if(CMAKE_GENERATOR_PLATFORM) + string(APPEND version_comment + ", CMAKE_GENERATOR_PLATFORM '${CMAKE_GENERATOR_PLATFORM}'") + endif() + + if(CMAKE_GENERATOR_TOOLSET) + string(APPEND version_comment + ", CMAKE_GENERATOR_TOOLSET '${CMAKE_GENERATOR_TOOLSET}'") + endif() + + if(CMAKE_GENERATOR_INSTANCE) + string(APPEND version_comment + ", CMAKE_GENERATOR_INSTANCE '${CMAKE_GENERATOR_INSTANCE}'") + endif() + + # This isn't set for the Visual Studio generator. + if(CMAKE_MAKE_PROGRAM) + get_filename_component(make_program_name "${CMAKE_MAKE_PROGRAM}" NAME) + set(make_program_comment + "and CMAKE_MAKE_PROGRAM: '${make_program_name}' ") + endif() + + string(CONCAT relationship_comment + "${project_spdx_id} is built using generator CMAKE_GENERATOR: '${CMAKE_GENERATOR}' " + "${make_program_comment}" + "${version_comment}" + ) + endif() + elseif(arg_BUILD_TOOL_TYPE STREQUAL "COMPILER") + string(CONCAT package_summary + "The compiler as identified by CMake, running on '${CMAKE_HOST_SYSTEM_NAME}' " + "(${CMAKE_HOST_SYSTEM_PROCESSOR})") + + set(sbom_args + FRIENDLY_PACKAGE_NAME "Compiler ${CMAKE_CXX_COMPILER_ID}" + PACKAGE_SUMMARY "${package_summary}" + ) + + # CMake might not be able to extract the compiler version for all compilers. + if(CMAKE_CXX_COMPILER_VERSION) + list(APPEND sbom_args PACKAGE_VERSION "${CMAKE_CXX_COMPILER_VERSION}") + endif() + + if(arg_GET_RELATIONSHIP_COMMENT) + string(CONCAT relationship_comment + "${project_spdx_id} is built by compiler: '${CMAKE_CXX_COMPILER_ID}' " + "version: '${CMAKE_CXX_COMPILER_VERSION}' " + "frontend variant: '${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}'" + ) + endif() + elseif(arg_BUILD_TOOL_TYPE STREQUAL "LINKER") + # Note this info is only available with CMake 3.29+, caller needs to ensure they don't call + # this when the info is not available. + set(sbom_args + FRIENDLY_PACKAGE_NAME "Linker ${CMAKE_CXX_COMPILER_LINKER_ID}" + ) + + # CMake might not be able to extract the linker version for all platforms, e.g. for + # MinGW + GCC. + if(CMAKE_CXX_COMPILER_LINKER_VERSION) + list(APPEND sbom_args PACKAGE_VERSION "${CMAKE_CXX_COMPILER_LINKER_VERSION}") + endif() + + if(arg_GET_RELATIONSHIP_COMMENT) + string(CONCAT relationship_comment + "${project_spdx_id} is built by linker '${CMAKE_CXX_COMPILER_LINKER_ID}' " + "version '${CMAKE_CXX_COMPILER_LINKER_VERSION}' " + "frontend variant: '${CMAKE_CXX_COMPILER_LINKER_FRONTEND_VARIANT}'" + ) + endif() + endif() + + set(${arg_OUT_VAR_SBOM_ARGS} "${sbom_args}" PARENT_SCOPE) + if(arg_GET_RELATIONSHIP_COMMENT) + set(${arg_OUT_VAR_RELATIONSHIP_COMMENT} "${relationship_comment}" PARENT_SCOPE) + endif() +endfunction() diff --git a/local/recipes/qt/qtbase/source/cmake/QtPublicSbomExternalReferenceHelpers.cmake b/local/recipes/qt/qtbase/source/cmake/QtPublicSbomExternalReferenceHelpers.cmake new file mode 100644 index 0000000000..aa7e0419d1 --- /dev/null +++ b/local/recipes/qt/qtbase/source/cmake/QtPublicSbomExternalReferenceHelpers.cmake @@ -0,0 +1,704 @@ +# Copyright (C) 2026 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# Records a reference to an SBOM external document in the given 'target' for the currently active +# SBOM project. +# +# External SBOM targets can then reference this document target, to allow creating relationships +# bewteen current project and external SBOM entities. +# +# Currently the following SBOM_FORMAT formats are supported: +# - 'SPDX_V2_TAG_VALUE' +# - 'SPDX_V2_JSON' +# - 'CYDX_V1_JSON' +# +# For the SPDX format, the SPDX_V2_DOCUMENT_REF_ID option is required, which is used to identify +# the external document within the current project SBOM. +# +# In addition, we need the SPDX document namespace and file sha1 checksum. These can be passed +# explcitily, or parsed from the external document. +# +# 1) To parse them from the document, the relative or absolute document path should be passed via +# the EXTERNAL_DOCUMENT_FILE_PATH option. +# If the passed path is relative, it gets searched in 'EXTERNAL_DOCUMENT_SEARCH_PATHS'. +# The file must exist at the point when the API is called. +# +# 2) The values can be specified via the SPDX_V2_DOCUMENT_NAMESPACE and SPDX_V2_DOCUMENT_SHA1 +# options. +# +# For CycloneDX the CYDX_URN_SERIAL_NUMBER and CYDX_URN_BOM_VERSION options should be passed. +# Or they can be parsed via EXTERNAL_DOCUMENT_FILE_PATH. +function(_qt_internal_sbom_add_external_reference_document target) + if(NOT QT_GENERATE_SBOM) + return() + endif() + + set(opt_args + NO_SCAN_FILE_AT_CONFIGURE_TIME + ) + set(single_args + SBOM_FORMAT + EXTERNAL_DOCUMENT_FILE_PATH + + SPDX_V2_DOCUMENT_REF_ID + SPDX_V2_DOCUMENT_NAMESPACE + SPDX_V2_DOCUMENT_SHA1 + + CYDX_URN_SERIAL_NUMBER + CYDX_URN_BOM_VERSION + ) + set(multi_args + EXTERNAL_DOCUMENT_SEARCH_PATHS + ) + cmake_parse_arguments(PARSE_ARGV 1 arg "${opt_args}" "${single_args}" "${multi_args}") + _qt_internal_validate_all_args_are_parsed(arg) + + # We don't support SPDX v3 json at the moment. + set(supported_sbom_formats + CYDX_V1_JSON + SPDX_V2_TAG_VALUE + SPDX_V2_JSON + ) + + if(NOT arg_SBOM_FORMAT) + message(FATAL_ERROR "SBOM_FORMAT must be specified.") + endif() + + if(NOT arg_SBOM_FORMAT IN_LIST supported_sbom_formats) + message(FATAL_ERROR "Unsupported SBOM_FORMAT value: ${arg_SBOM_FORMAT}. " + "Currently supported values are: ${supported_sbom_formats}") + endif() + + if(NOT TARGET "${target}") + add_library("${target}" INTERFACE IMPORTED) + set_target_properties("${target}" PROPERTIES IMPORTED_GLOBAL TRUE) + endif() + + get_target_property(is_external_project_sbom_target "${target}" + _qt_sbom_is_external_project_sbom_target) + if(NOT is_external_project_sbom_target) + set_target_properties("${target}" PROPERTIES + _qt_sbom_is_custom_sbom_target "TRUE" + _qt_sbom_is_external_project_sbom_target "TRUE" + + # These aren't real values, but it's what we use to determine external packages + # during dependency handling. + _qt_sbom_spdx_repo_project_name_lowercase "fake_external_project_name_${target}" + _qt_sbom_spdx_relative_installed_repo_document_path "/fake_external_doc_path_${target}" + ) + endif() + + # Return early gracefully when we're requested to add a format that SBOM generation isn't + # enabled for. + if((arg_SBOM_FORMAT STREQUAL "SPDX_V2_TAG_VALUE" OR arg_SBOM_FORMAT STREQUAL "SPDX_V2_JSON") + AND NOT QT_SBOM_GENERATE_SPDX_V2) + message(DEBUG "SPDX v2 SBOM generation is not enabled, skipping adding external reference " + "for target '${target}'." + "\nSPDX_V2_DOCUMENT_REF_ID: '${arg_SPDX_V2_DOCUMENT_REF_ID}'" + "\nSPDX_V2_DOCUMENT_NAMESPACE: '${arg_SPDX_V2_DOCUMENT_NAMESPACE}'" + "\nEXTERNAL_DOCUMENT_FILE_PATH: '${arg_EXTERNAL_DOCUMENT_FILE_PATH}'" + ) + return() + endif() + + if(arg_SBOM_FORMAT STREQUAL "CYDX_V1_JSON" AND NOT QT_SBOM_GENERATE_CYDX_V1_6) + message(DEBUG + "CycloneDX v1 SBOM generation is not enabled, skipping adding external reference " + "for target '${target}'." + "\nCYDX_URN_SERIAL_NUMBER: '${arg_CYDX_URN_SERIAL_NUMBER}'" + "\nEXTERNAL_DOCUMENT_FILE_PATH: '${arg_EXTERNAL_DOCUMENT_FILE_PATH}'" + ) + return() + endif() + + # If an document file path is given and configure time scan opt out is not passed, search for + # the file and prefer the values extracted from it, rather than what can be passed to the + # function. + # If configure time scanning is opted out, we will require some of the information to be passed + # at explicitly. + if(arg_EXTERNAL_DOCUMENT_FILE_PATH AND NOT arg_NO_SCAN_FILE_AT_CONFIGURE_TIME) + set(document_search_path_args "") + if(arg_EXTERNAL_DOCUMENT_SEARCH_PATHS) + list(APPEND document_search_path_args + EXTERNAL_DOCUMENT_SEARCH_PATHS ${arg_EXTERNAL_DOCUMENT_SEARCH_PATHS}) + endif() + _qt_internal_sbom_get_external_reference_search_paths(document_search_paths + ${document_search_path_args} + ) + + set(find_file_args "") + if(document_search_paths) + list(APPEND find_file_args + EXTERNAL_DOCUMENT_SEARCH_PATHS ${document_search_paths}) + endif() + _qt_internal_sbom_find_external_reference_document(document_file_path + EXTERNAL_DOCUMENT_FILE_PATH "${arg_EXTERNAL_DOCUMENT_FILE_PATH}" + ${find_file_args} + ) + elseif(arg_EXTERNAL_DOCUMENT_FILE_PATH) + # If we don't scan at configure time, we still need to pass the document along at least + # for spdx v2. + set(document_file_path "${arg_EXTERNAL_DOCUMENT_FILE_PATH}") + endif() + + if(arg_SBOM_FORMAT STREQUAL "SPDX_V2_TAG_VALUE" OR arg_SBOM_FORMAT STREQUAL "SPDX_V2_JSON") + _qt_internal_forward_function_args( + FORWARD_PREFIX arg + FORWARD_OUT_VAR external_document_args + FORWARD_OPTIONS + NO_SCAN_FILE_AT_CONFIGURE_TIME + FORWARD_SINGLE + SBOM_FORMAT + SPDX_V2_DOCUMENT_REF_ID + SPDX_V2_DOCUMENT_NAMESPACE + SPDX_V2_DOCUMENT_SHA1 + FORWARD_MULTI + EXTERNAL_DOCUMENT_SEARCH_PATHS + ) + if(document_file_path) + list(APPEND external_document_args EXTERNAL_DOCUMENT_FILE_PATH "${document_file_path}") + endif() + _qt_internal_sbom_add_external_reference_document_spdx_v2(${target} + ${external_document_args} + ) + endif() + + if(arg_SBOM_FORMAT STREQUAL "CYDX_V1_JSON") + _qt_internal_forward_function_args( + FORWARD_PREFIX arg + FORWARD_OUT_VAR external_document_args + FORWARD_OPTIONS + NO_SCAN_FILE_AT_CONFIGURE_TIME + FORWARD_SINGLE + CYDX_URN_SERIAL_NUMBER + CYDX_URN_BOM_VERSION + ) + if(document_file_path) + list(APPEND external_document_args EXTERNAL_DOCUMENT_FILE_PATH "${document_file_path}") + endif() + _qt_internal_sbom_add_external_reference_document_cydx_v1(${target} + ${external_document_args} + ) + endif() +endfunction() + +# Handles adding an SPDX v2 external document reference, either in tag:value or json format. +# NO_SCAN_FILE_AT_CONFIGURE_TIME is an internal option, only used by the Qt build system +# to reference external documents that do not exist yet, but will exist at installation time. +function(_qt_internal_sbom_add_external_reference_document_spdx_v2 target) + set(opt_args + NO_SCAN_FILE_AT_CONFIGURE_TIME + ) + set(single_args + SBOM_FORMAT + EXTERNAL_DOCUMENT_FILE_PATH + + SPDX_V2_DOCUMENT_REF_ID + SPDX_V2_DOCUMENT_NAMESPACE + SPDX_V2_DOCUMENT_SHA1 + ) + set(multi_args + EXTERNAL_DOCUMENT_SEARCH_PATHS + ) + cmake_parse_arguments(PARSE_ARGV 1 arg "${opt_args}" "${single_args}" "${multi_args}") + _qt_internal_validate_all_args_are_parsed(arg) + + if(NOT arg_SPDX_V2_DOCUMENT_REF_ID) + message(FATAL_ERROR "SPDX_V2_DOCUMENT_REF_ID must be specified.") + endif() + + get_target_property(exising_external_document_ref "${target}" + _qt_sbom_spdx_v2_external_document_ref) + + if(exising_external_document_ref + AND NOT exising_external_document_ref STREQUAL arg_SPDX_V2_DOCUMENT_REF_ID) + message(FATAL_ERROR + "Target '${target}' already has an associated SPDX v2 external document reference " + "'${exising_external_document_ref}' set, but a new value " + "'${arg_SPDX_V2_DOCUMENT_REF_ID}' is being set. A target can't have more than one " + "value for the same SBOM format.") + endif() + + # Used later. + if(arg_SBOM_FORMAT STREQUAL "SPDX_V2_TAG_VALUE") + set(document_path_property_name "_qt_sbom_spdx_v2_document_tag_value_relative_path") + elseif(arg_SBOM_FORMAT STREQUAL "SPDX_V2_JSON") + set(document_path_property_name "_qt_sbom_spdx_v2_document_json_relative_path") + endif() + + # Check that the document ref id is unique for the current project. Error out if it is not + # unique, otherwise add to the known list. But allow for the use case of adding one of the + # missing formats, either a tag:value or a json spdx v2 document for the same target, + # as long as the same ref id is used. + get_cmake_property(known_external_document_target + _qt_known_external_documents_${arg_SPDX_V2_DOCUMENT_REF_ID}_target) + + set(should_add_new_ref_id TRUE) + if(known_external_document_target) + get_target_property(document_relative_path "${target}" "${document_path_property_name}") + + # If the property is already set, treat it as a duplication error. + if(document_relative_path) + message(FATAL_ERROR + "SPDX v2 external document reference '${arg_SPDX_V2_DOCUMENT_REF_ID}' was already " + "recorded when processing target '${known_external_document_target}', but is now " + "being added again to target '${target}', format '${arg_SBOM_FORMAT}'. " + "A SPDX document reference ID can only be recorded once for the current project " + "SPDX document.") + else() + # We are just updating a new format's relative file path. + set(should_add_new_ref_id FALSE) + endif() + endif() + + if(should_add_new_ref_id) + set_property(GLOBAL PROPERTY + _qt_known_external_documents_${arg_SPDX_V2_DOCUMENT_REF_ID} TRUE) + + set_property(GLOBAL PROPERTY + _qt_known_external_documents_${arg_SPDX_V2_DOCUMENT_REF_ID}_target "${target}") + + set_property(GLOBAL APPEND PROPERTY + _qt_known_external_documents "${arg_SPDX_V2_DOCUMENT_REF_ID}") + + set_target_properties("${target}" PROPERTIES + _qt_sbom_spdx_v2_external_document_ref "${arg_SPDX_V2_DOCUMENT_REF_ID}" + ) + endif() + + if(arg_EXTERNAL_DOCUMENT_FILE_PATH AND NOT arg_NO_SCAN_FILE_AT_CONFIGURE_TIME) + _qt_internal_sbom_parse_spdx_v2_document_namespace( + EXTERNAL_DOCUMENT_FILE_PATH "${arg_EXTERNAL_DOCUMENT_FILE_PATH}" + SBOM_FORMAT "${arg_SBOM_FORMAT}" + OUT_VAR_DOCUMENT_NAMESPACE document_namespace + ) + + if(NOT document_namespace) + message(FATAL_ERROR + "Failed to extract DocumentNamespace from SPDX v2 external document: " + "'${arg_EXTERNAL_DOCUMENT_FILE_PATH}'") + endif() + else() + if(NOT arg_SPDX_V2_DOCUMENT_NAMESPACE) + message(FATAL_ERROR + "SPDX_V2_DOCUMENT_NAMESPACE must be specified for target '${target}' if " + "EXTERNAL_DOCUMENT_FILE_PATH is not given or NO_SCAN_FILE_AT_CONFIGURE_TIME is " + "set.") + else() + set(document_namespace "${arg_SPDX_V2_DOCUMENT_NAMESPACE}") + endif() + endif() + + get_target_property(existing_document_namespace "${target}" + _qt_sbom_spdx_repo_document_namespace) + + if(existing_document_namespace + AND NOT existing_document_namespace STREQUAL document_namespace) + message(FATAL_ERROR + "Target '${target}' already has an associated SPDX v2 external document namespace " + "'${existing_document_namespace}' set, but a new value " + "'${document_namespace}' is being set. A target can't have more than one " + "value for the same SBOM format.") + endif() + + if(should_add_new_ref_id) + set_target_properties("${target}" PROPERTIES + _qt_sbom_spdx_repo_document_namespace "${document_namespace}" + ) + endif() + + # Save the document file path for querying if available. + if(arg_EXTERNAL_DOCUMENT_FILE_PATH) + set_target_properties("${target}" PROPERTIES + "${document_path_property_name}" "${arg_EXTERNAL_DOCUMENT_FILE_PATH}" + ) + endif() + + # SPDX v2 compared to CycloneDX also requires adding an explicit external document ref to the + # current's project SBOM document, which needs a namespace and a sha1 value. + set(forward_args "") + if(arg_EXTERNAL_DOCUMENT_FILE_PATH) + list(APPEND forward_args + EXTERNAL_DOCUMENT_FILE_PATH "${arg_EXTERNAL_DOCUMENT_FILE_PATH}") + endif() + + if(arg_EXTERNAL_DOCUMENT_SEARCH_PATHS) + list(APPEND forward_args + EXTERNAL_DOCUMENT_INSTALL_PREFIXES ${arg_EXTERNAL_DOCUMENT_SEARCH_PATHS}) + endif() + + if(arg_SPDX_V2_DOCUMENT_NAMESPACE) + list(APPEND forward_args + EXTERNAL_DOCUMENT_NAMESPACE "${arg_SPDX_V2_DOCUMENT_NAMESPACE}") + endif() + + if(arg_SPDX_V2_DOCUMENT_SHA1) + list(APPEND forward_args + EXTERNAL_DOCUMENT_SHA1 "${arg_SPDX_V2_DOCUMENT_SHA1}") + endif() + + if(should_add_new_ref_id) + _qt_internal_sbom_generate_add_external_reference( + EXTERNAL_DOCUMENT_SPDX_ID "${arg_SPDX_V2_DOCUMENT_REF_ID}" + SBOM_FORMAT "${arg_SBOM_FORMAT}" + ${forward_args} + ) + endif() +endfunction() + +# Parses out the SPDX v2 document namespace value out of an external SPDX document. +# Support SPDX v2.3 tag value and json formats for the file path. +# Errors out when the document namespace can't be found. +function(_qt_internal_sbom_parse_spdx_v2_document_namespace) + set(opt_args "") + set(single_args + SBOM_FORMAT + EXTERNAL_DOCUMENT_FILE_PATH + OUT_VAR_DOCUMENT_NAMESPACE + ) + set(multi_args "") + cmake_parse_arguments(PARSE_ARGV 0 arg "${opt_args}" "${single_args}" "${multi_args}") + _qt_internal_validate_all_args_are_parsed(arg) + + if(NOT arg_EXTERNAL_DOCUMENT_FILE_PATH) + message(FATAL_ERROR "EXTERNAL_DOCUMENT_FILE_PATH must be specified.") + endif() + + if(NOT EXISTS "${arg_EXTERNAL_DOCUMENT_FILE_PATH}") + message(FATAL_ERROR + "EXTERNAL_DOCUMENT_FILE_PATH '${arg_EXTERNAL_DOCUMENT_FILE_PATH}' does not exist.") + endif() + + if(NOT arg_OUT_VAR_DOCUMENT_NAMESPACE) + message(FATAL_ERROR "OUT_VAR_DOCUMENT_NAMESPACE must be specified.") + endif() + + if(NOT arg_SBOM_FORMAT) + message(FATAL_ERROR "SBOM_FORMAT must be specified.") + endif() + + file(READ "${arg_EXTERNAL_DOCUMENT_FILE_PATH}" ext_content) + + set(extra_error_message "") + + # Support extracting the namespace from both a tag:value and json document. + if(arg_SBOM_FORMAT STREQUAL "SPDX_V2_TAG_VALUE") + string(REGEX REPLACE "^.*[\r\n]DocumentNamespace:[ \t]*([^#\r\n]*).*$" + "\\1" document_namespace "${ext_content}") + elseif(arg_SBOM_FORMAT STREQUAL "SPDX_V2_JSON") + string(JSON document_namespace ERROR_VARIABLE document_namespace_error + GET "${ext_content}" "documentNamespace") + if(document_namespace_error) + set(extra_error_message "${document_namespace_error}") + endif() + endif() + + if(NOT document_namespace) + message(FATAL_ERROR + "Failed to extract DocumentNamespace from SPDX v2 external document: " + "'${arg_EXTERNAL_DOCUMENT_FILE_PATH}'") + endif() + + set(${arg_OUT_VAR_DOCUMENT_NAMESPACE} "${document_namespace}" PARENT_SCOPE) +endfunction() + +# Handles adding a CycloneDX v1 external document reference in json format. +function(_qt_internal_sbom_add_external_reference_document_cydx_v1 target) + set(opt_args + NO_SCAN_FILE_AT_CONFIGURE_TIME + ) + set(single_args + EXTERNAL_DOCUMENT_FILE_PATH + + CYDX_URN_SERIAL_NUMBER + CYDX_URN_BOM_VERSION + ) + set(multi_args "") + cmake_parse_arguments(PARSE_ARGV 1 arg "${opt_args}" "${single_args}" "${multi_args}") + _qt_internal_validate_all_args_are_parsed(arg) + + if(arg_EXTERNAL_DOCUMENT_FILE_PATH AND NOT arg_NO_SCAN_FILE_AT_CONFIGURE_TIME) + file(READ "${arg_EXTERNAL_DOCUMENT_FILE_PATH}" ext_content) + + string(JSON serial_number ERROR_VARIABLE serial_number_error GET "${ext_content}" + "serialNumber") + if(serial_number_error) + message(FATAL_ERROR + "Failed to extract CycloneDX serialNumber from external document: " + "'${arg_EXTERNAL_DOCUMENT_FILE_PATH}'") + endif() + + string(JSON urn_bom_version ERROR_VARIABLE bom_version_error GET "${ext_content}" + "version") + if(serial_number_error) + message(FATAL_ERROR + "Failed to extract CycloneDX bom version from external document: " + "'${arg_EXTERNAL_DOCUMENT_FILE_PATH}'") + endif() + else() + if(NOT arg_CYDX_URN_SERIAL_NUMBER) + message(FATAL_ERROR "CYDX_URN_SERIAL_NUMBER must be specified for target '${target}' " + "if EXTERNAL_DOCUMENT_FILE_PATH is not given or NO_SCAN_FILE_AT_CONFIGURE_TIME is " + "set.") + else() + set(serial_number "${arg_CYDX_URN_SERIAL_NUMBER}") + endif() + + if(arg_CYDX_URN_BOM_VERSION) + set(urn_bom_version "${arg_CYDX_URN_BOM_VERSION}") + else() + set(urn_bom_version "1") + endif() + endif() + + get_target_property(existing_bom_serial_number "${target}" + _qt_sbom_cydx_bom_serial_number_uuid) + + if(existing_bom_serial_number) + message(FATAL_ERROR "existing") + endif() + + if(existing_bom_serial_number AND NOT existing_bom_serial_number STREQUAL serial_number) + message(FATAL_ERROR + "Target '${target}' already has an associated CycloneDX external document serial " + "number '${existing_bom_serial_number}' set, but a new value " + "'${serial_number}' is being set. A target can't have more than one " + "value for the same SBOM format.") + endif() + + set_target_properties("${target}" PROPERTIES + _qt_sbom_cydx_bom_serial_number_uuid "${serial_number}" + _qt_sbom_cydx_urn_bom_version "${urn_bom_version}" + ) + + # Save the document file path for querying if available. + if(arg_EXTERNAL_DOCUMENT_FILE_PATH) + set_target_properties("${target}" PROPERTIES + "_qt_sbom_cydx_v1_6_document_json_relative_path" "${arg_EXTERNAL_DOCUMENT_FILE_PATH}" + ) + endif() +endfunction() + +# Returns a list of external document search paths, based on confguration options passed. +function(_qt_internal_sbom_get_external_reference_search_paths out_var) + if(NOT QT_GENERATE_SBOM) + set(${out_var} "" PARENT_SCOPE) + return() + endif() + + set(opt_args + SEARCH_IN_BUILD_SBOM_DIRS + SEARCH_IN_QT_PREFIXES + SEARCH_IN_DESTDIR_INSTALL_PREFIX_AT_INSTALL_TIME + ) + set(single_args "") + set(multi_args + EXTERNAL_DOCUMENT_SEARCH_PATHS + ) + cmake_parse_arguments(PARSE_ARGV 1 arg "${opt_args}" "${single_args}" "${multi_args}") + _qt_internal_validate_all_args_are_parsed(arg) + + set(search_paths "") + + # Add the current sbom build dirs as install prefixes, so that we can use ninja 'sbom' + # in top-level builds. This is needed because the external references will point + # to sbom docs in different build dirs, not just one. + # We also need it in case we are converting a json document to a tag/value format in the + # current build dir of the project, and want it to be found. + if(arg_SEARCH_IN_BUILD_SBOM_DIRS) + get_cmake_property(build_sbom_dirs _qt_internal_sbom_dirs) + if(build_sbom_dirs) + foreach(build_sbom_dir IN LISTS build_sbom_dirs) + list(APPEND search_paths "${build_sbom_dir}") + endforeach() + endif() + endif() + + get_cmake_property(project_search_paths _qt_internal_sbom_external_document_search_paths) + if(project_search_paths) + list(APPEND search_paths ${project_search_paths}) + endif() + + get_cmake_property(search_in_cmake_paths + _qt_internal_sbom_auto_search_external_documents_in_paths) + if(search_in_cmake_paths) + if(CMAKE_PREFIX_PATH) + list(APPEND search_paths ${CMAKE_PREFIX_PATH}) + endif() + if(CMAKE_FRAMEWORK_PATH) + list(APPEND search_paths ${CMAKE_FRAMEWORK_PATH}) + endif() + endif() + + # Always append the install time install prefix. + # The variable is escaped, so it is evaluated during cmake install time, so that the value + # can be overridden with cmake --install . --prefix . + if(arg_SEARCH_IN_DESTDIR_INSTALL_PREFIX_AT_INSTALL_TIME) + list(APPEND search_paths "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}") + endif() + + if(arg_EXTERNAL_DOCUMENT_SEARCH_PATHS) + list(APPEND search_paths ${arg_EXTERNAL_DOCUMENT_SEARCH_PATHS}) + endif() + + if(arg_SEARCH_IN_QT_PREFIXES AND QT6_INSTALL_PREFIX) + list(APPEND search_paths ${QT6_INSTALL_PREFIX}) + endif() + + if(arg_SEARCH_IN_QT_PREFIXES AND QT_ADDITIONAL_PACKAGES_PREFIX_PATH) + list(APPEND search_paths ${QT_ADDITIONAL_PACKAGES_PREFIX_PATH}) + endif() + + if(QT_ADDITIONAL_SBOM_DOCUMENT_PATHS) + list(APPEND search_paths ${QT_ADDITIONAL_SBOM_DOCUMENT_PATHS}) + endif() + + list(REMOVE_DUPLICATES search_paths) + + # On Windows we might get backslash paths from e.g. CMAKE_PREFIX_PATH. Convert them to forward + # slashes to avoid syntax errors when operating on them in + # _qt_internal_sbom_generate_add_external_reference. + set(search_paths_posix "") + foreach(search_path IN LISTS search_paths) + file(TO_CMAKE_PATH "${search_path}" search_path_posix) + list(APPEND search_paths_posix "${search_path_posix}") + endforeach() + + set(${out_var} "${search_paths_posix}" PARENT_SCOPE) +endfunction() + +# Given an absolute or relative path for an external document, searches for it in the given +# EXTERNAL_DOCUMENT_SEARCH_PATHS and returns the found path, or an empty string. +function(_qt_internal_sbom_find_external_reference_document out_var) + if(NOT QT_GENERATE_SBOM) + set(${out_var} "" PARENT_SCOPE) + return() + endif() + + set(opt_args "") + set(single_args + EXTERNAL_DOCUMENT_FILE_PATH + ) + set(multi_args + EXTERNAL_DOCUMENT_SEARCH_PATHS + ) + cmake_parse_arguments(PARSE_ARGV 1 arg "${opt_args}" "${single_args}" "${multi_args}") + _qt_internal_validate_all_args_are_parsed(arg) + + set(document_file_path "") + + set(maybe_external_document_file_path "${arg_EXTERNAL_DOCUMENT_FILE_PATH}") + + if(IS_ABSOLUTE "${maybe_external_document_file_path}" + AND EXISTS "${maybe_external_document_file_path}") + set(document_file_path "${maybe_external_document_file_path}") + set(${out_var} "${document_file_path}" PARENT_SCOPE) + return() + endif() + + set(relative_file_name "${maybe_external_document_file_path}") + list(JOIN arg_EXTERNAL_DOCUMENT_SEARCH_PATHS "\n" document_dir_paths_per_line) + + foreach(document_dir_path IN LISTS arg_EXTERNAL_DOCUMENT_SEARCH_PATHS) + set(maybe_document_file_path "${document_dir_path}/${relative_file_name}") + if(EXISTS "${maybe_document_file_path}") + set(document_file_path "${maybe_document_file_path}") + break() + endif() + endforeach() + + if(NOT document_file_path OR NOT EXISTS "${document_file_path}") + message(FATAL_ERROR "Could not find external SBOM document " + "${maybe_external_document_file_path}" + " in any of the document search paths: ${document_dir_paths_per_line} " + ) + endif() + + set(${out_var} "${document_file_path}" PARENT_SCOPE) +endfunction() + +# Queries information about the external reference document associated with the given target, and +# sets the values in the parent scope. +function(_qt_internal_sbom_query_external_reference_document target) + if(NOT QT_GENERATE_SBOM) + return() + endif() + + set(opt_args "") + set(single_args + OUT_VAR_PROJECT_NAME_LOWERCASE + + OUT_VAR_RELATIVE_SPDX_V2_TAG_VALUE_DOCUMENT_PATH + OUT_VAR_RELATIVE_SPDX_V2_JSON_DOCUMENT_PATH + OUT_VAR_RELATIVE_CYDX_V1_6_JSON_DOCUMENT_PATH + + OUT_VAR_SPDX_V2_DOCUMENT_REF_ID + OUT_VAR_SPDX_V2_DOCUMENT_NAMESPACE + + OUT_VAR_CYDX_URN_SERIAL_NUMBER + OUT_VAR_CYDX_URN_BOM_VERSION + ) + set(multi_args "") + cmake_parse_arguments(PARSE_ARGV 1 arg "${opt_args}" "${single_args}" "${multi_args}") + _qt_internal_validate_all_args_are_parsed(arg) + + if(NOT TARGET "${target}") + message(FATAL_ERROR "Target '${target}' does not exist.") + endif() + + get_target_property(is_external_project_sbom_target + "${target}" _qt_sbom_is_external_project_sbom_target) + + if(NOT is_external_project_sbom_target) + message(FATAL_ERROR "Target '${target}' is not an external project SBOM target.") + endif() + + if(arg_OUT_VAR_PROJECT_NAME_LOWERCASE) + get_target_property(project_name_lowecase "${target}" + _qt_sbom_spdx_repo_project_name_lowercase) + set(${arg_OUT_VAR_PROJECT_NAME_LOWERCASE} "${project_name_lowecase}" PARENT_SCOPE) + endif() + + if(arg_OUT_VAR_RELATIVE_SPDX_V2_TAG_VALUE_DOCUMENT_PATH) + get_target_property(document_spdx_v2_tag_value_relative_path "${target}" + _qt_sbom_spdx_v2_document_tag_value_relative_path) + set(${arg_OUT_VAR_RELATIVE_SPDX_V2_TAG_VALUE_DOCUMENT_PATH} + "${document_spdx_v2_tag_value_relative_path}" PARENT_SCOPE) + endif() + + if(arg_OUT_VAR_RELATIVE_SPDX_V2_JSON_DOCUMENT_PATH) + get_target_property(document_spdx_v2_json_relative_path "${target}" + _qt_sbom_spdx_v2_document_json_relative_path) + set(${arg_OUT_VAR_RELATIVE_SPDX_V2_JSON_DOCUMENT_PATH} + "${document_spdx_v2_json_relative_path}" PARENT_SCOPE) + endif() + + if(arg_OUT_VAR_RELATIVE_CYDX_V1_6_JSON_DOCUMENT_PATH) + get_target_property(document_cydx_v1_6_json_relative_path "${target}" + _qt_sbom_cydx_v1_6_document_json_relative_path) + set(${arg_OUT_VAR_RELATIVE_CYDX_V1_6_JSON_DOCUMENT_PATH} + "${document_cydx_v1_6_json_relative_path}" PARENT_SCOPE) + endif() + + if(arg_OUT_VAR_SPDX_V2_DOCUMENT_REF_ID) + get_target_property(spdx_external_document_ref "${target}" + _qt_sbom_spdx_v2_external_document_ref) + set(${arg_OUT_VAR_SPDX_V2_DOCUMENT_REF_ID} "${spdx_external_document_ref}" PARENT_SCOPE) + endif() + + if(arg_OUT_VAR_SPDX_V2_DOCUMENT_NAMESPACE) + get_target_property(spdx_document_namespace "${target}" + _qt_sbom_spdx_repo_document_namespace) + set(${arg_OUT_VAR_SPDX_V2_DOCUMENT_NAMESPACE} "${spdx_document_namespace}" PARENT_SCOPE) + endif() + + if(arg_OUT_VAR_CYDX_URN_SERIAL_NUMBER) + get_target_property(cydx_bom_serial_number "${target}" _qt_sbom_cydx_bom_serial_number_uuid) + set(${arg_OUT_VAR_CYDX_URN_SERIAL_NUMBER} "${cydx_bom_serial_number}" PARENT_SCOPE) + endif() + + if(arg_OUT_VAR_CYDX_URN_BOM_VERSION) + get_target_property(cydx_urn_bom_version "${target}" _qt_sbom_cydx_urn_bom_version) + set(${arg_OUT_VAR_CYDX_URN_BOM_VERSION} "${cydx_urn_bom_version}" PARENT_SCOPE) + endif() +endfunction() diff --git a/local/recipes/qt/qtbase/source/cmake/QtPublicSbomRelationshipHelpers.cmake b/local/recipes/qt/qtbase/source/cmake/QtPublicSbomRelationshipHelpers.cmake new file mode 100644 index 0000000000..b1f5de3255 --- /dev/null +++ b/local/recipes/qt/qtbase/source/cmake/QtPublicSbomRelationshipHelpers.cmake @@ -0,0 +1,531 @@ +# Copyright (C) 2025 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# Gets the spdx id of a target to be used in a sbom relationship entry. +# Errors out when either the target does not exist, or when an spdx id cannot be determined for +# the target. +# OPTION_NAME is used for error messages to provide context on which argument is being processed. +function(_qt_internal_sbom_get_spdx_id_for_target_in_relationship out_var) + set(opt_args "") + set(single_args + TARGET + OPTION_NAME + ) + set(multi_args "") + cmake_parse_arguments(PARSE_ARGV 1 arg "${opt_args}" "${single_args}" "${multi_args}") + _qt_internal_validate_all_args_are_parsed(arg) + + if(NOT TARGET "${arg_TARGET}") + message(FATAL_ERROR + "${arg_OPTION_NAME} target \"${arg_TARGET}\" does not exist.") + endif() + + _qt_internal_sbom_get_spdx_id_for_target("${arg_TARGET}" target_spdx_id) + + if(NOT target_spdx_id) + message(FATAL_ERROR + "Could not determine SPDX ID for OPTION_NAME '${arg_OPTION_NAME}' target " + "\"${arg_TARGET}\".") + endif() + + set(${out_var} "${target_spdx_id}" PARENT_SCOPE) +endfunction() + +# Parses a relationship entry and outputs an appropriately formatted relationship string. +# FROM and TO should list target names enriched with sbom info. +function(_qt_internal_sbom_serialize_sbom_relationship_entry) + set(opt_args + ESCAPE_CYDX_QUOTES + ) + set(single_args + SBOM_RELATIONSHIP_FROM + SBOM_RELATIONSHIP_TYPE + SBOM_RELATIONSHIP_COMMENT + OUTPUT_SBOM_FORMAT + CYDX_TOML_KEY + OUT_VAR_RELATIONSHIP_STRINGS + ) + set(multi_args + SBOM_RELATIONSHIP_TO # This is multi-value, to accomodate future spdx v3 + SBOM_FORMATS + ) + cmake_parse_arguments(PARSE_ARGV 0 arg "${opt_args}" "${single_args}" "${multi_args}") + _qt_internal_validate_all_args_are_parsed(arg) + + if(NOT arg_OUTPUT_SBOM_FORMAT) + message(FATAL_ERROR "OUTPUT_SBOM_FORMAT is required.") + endif() + + if(NOT arg_OUT_VAR_RELATIONSHIP_STRINGS) + message(FATAL_ERROR "OUT_VAR_RELATIONSHIP_STRINGS is required.") + endif() + + if(NOT arg_SBOM_RELATIONSHIP_FROM) + message(FATAL_ERROR "SBOM_RELATIONSHIP_FROM is required.") + endif() + + if(NOT arg_SBOM_RELATIONSHIP_TO) + message(FATAL_ERROR "SBOM_RELATIONSHIP_TO is required.") + endif() + + if(NOT arg_SBOM_RELATIONSHIP_TYPE) + message(FATAL_ERROR "SBOM_RELATIONSHIP_TYPE is required.") + endif() + + set(filtered_argn "${ARGN}") + list(FILTER filtered_argn INCLUDE REGEX "SBOM_RELATIONSHIP_FROM") + list(LENGTH filtered_argn from_count) + if(from_count GREATER 1) + message(FATAL_ERROR + "Multiple SBOM_RELATIONSHIP_FROM arguments found. Only one is expected for a single " + "entry. Perhaps you forgot to prepend a new SBOM_RELATIONSHIP_ENTRY before the next " + "relationship? \n" + "Relationship entry values below:\n${ARGN}" + ) + endif() + + _qt_internal_sbom_validate_spdx_v2_relationship_type( + RELATIONSHIP_TYPE "${arg_SBOM_RELATIONSHIP_TYPE}" + OUT_VAR_IS_VALID relationship_type_is_valid + ) + if(NOT relationship_type_is_valid) + message(FATAL_ERROR + "Invalid SPDX v2 SBOM_RELATIONSHIP_TYPE: '${arg_SBOM_RELATIONSHIP_TYPE}'.") + endif() + + _qt_internal_sbom_get_spdx_id_for_target_in_relationship(from_spdx_id + TARGET "${arg_SBOM_RELATIONSHIP_FROM}" + OPTION_NAME "SBOM_RELATIONSHIP_FROM" + ) + + _qt_internal_sbom_is_external_target_dependency("${arg_SBOM_RELATIONSHIP_FROM}" + OUT_VAR from_is_external + ) + + if(NOT arg_SBOM_FORMATS OR arg_SBOM_FORMATS STREQUAL "ALL") + set(active_formats "SPDX_V2" "CYDX_V1_6") + else() + set(active_formats ${arg_SBOM_FORMATS}) + endif() + + if(arg_OUTPUT_SBOM_FORMAT STREQUAL "SPDX_V2" AND arg_OUTPUT_SBOM_FORMAT IN_LIST active_formats) + # For SPDX, we build up the relationship string, and its associated comment if relevant. + set(spdx_relationship_list "") + + if(from_is_external) + _qt_internal_sbom_get_external_document_ref_spdx_id_from_sbom_target( + TARGET "${arg_SBOM_RELATIONSHIP_FROM}" + OUT_VAR external_reference_from + CREATE_TEMPORARY_REF_WHEN_MISSING + ) + + if(NOT external_reference_from) + message(FATAL_ERROR + "SBOM_RELATIONSHIP_FROM target '${arg_SBOM_RELATIONSHIP_FROM}' is an external " + "dependency, but its SPDX v2 external document reference id can't be " + "found. Consider limiting the relationship to a non-SPDX SBOM format using " + "the SBOM_FORMATS argument.") + endif() + string(APPEND external_reference_from ":") + else() + set(external_reference_from "") + endif() + + foreach(relationship_to IN LISTS arg_SBOM_RELATIONSHIP_TO) + _qt_internal_sbom_get_spdx_id_for_target_in_relationship(to_spdx_id + TARGET "${relationship_to}" + OPTION_NAME "SBOM_RELATIONSHIP_TO" + ) + + _qt_internal_sbom_is_external_target_dependency("${relationship_to}" + OUT_VAR to_is_external + ) + if(to_is_external) + _qt_internal_sbom_get_external_document_ref_spdx_id_from_sbom_target( + TARGET "${relationship_to}" + OUT_VAR external_reference_to + CREATE_TEMPORARY_REF_WHEN_MISSING + ) + + if(NOT external_reference_to) + message(FATAL_ERROR + "SBOM_RELATIONSHIP_TO target '${relationship_to}' is an external " + "dependency, but its SPDX v2 external document reference id can't be " + "found. Consider limiting the relationship to a non-SPDX SBOM format using " + "the SBOM_FORMATS argument.") + endif() + string(APPEND external_reference_to ":") + else() + set(external_reference_to "") + endif() + + string(CONCAT spdx_relationship + "Relationship:" + " ${external_reference_from}${from_spdx_id}" + " ${arg_SBOM_RELATIONSHIP_TYPE}" + " ${external_reference_to}${to_spdx_id}") + list(APPEND spdx_relationship_list "${spdx_relationship}") + + if(arg_SBOM_RELATIONSHIP_COMMENT) + string(CONCAT spdx_relationship_comment + "RelationshipComment: " + "${arg_SBOM_RELATIONSHIP_COMMENT}") + list(APPEND spdx_relationship_list "${spdx_relationship_comment}") + endif() + endforeach() + + set(${arg_OUT_VAR_RELATIONSHIP_STRINGS} "${spdx_relationship_list}" PARENT_SCOPE) + endif() + + if(arg_OUTPUT_SBOM_FORMAT STREQUAL "CYDX_V1_6" + AND arg_OUTPUT_SBOM_FORMAT IN_LIST active_formats) + set(cydx_toml_key "") + if(arg_CYDX_TOML_KEY) + set(cydx_toml_key "${arg_CYDX_TOML_KEY}") + endif() + + if(arg_ESCAPE_CYDX_QUOTES) + set(quote "\\\"") + else() + set(quote "\"") + endif() + + set(cydx_relationship_list "") + foreach(relationship_to IN LISTS arg_SBOM_RELATIONSHIP_TO) + _qt_internal_sbom_get_spdx_id_for_target_in_relationship(to_spdx_id + TARGET "${relationship_to}" + OPTION_NAME "SBOM_RELATIONSHIP_TO" + ) + + list(APPEND cydx_relationship_list " +[[${cydx_toml_key}relationships]] +relationship_from = ${quote}${from_spdx_id}${quote} +relationship_type = ${quote}${arg_SBOM_RELATIONSHIP_TYPE}${quote} +relationship_to = ${quote}${to_spdx_id}${quote} +relationship_comment = ${quote}${arg_SBOM_RELATIONSHIP_COMMENT}${quote} +") + endforeach() + + set(${arg_OUT_VAR_RELATIONSHIP_STRINGS} "${cydx_relationship_list}" PARENT_SCOPE) + endif() +endfunction() + +# Checks if a relationship type is valid, according to the list at +# https://spdx.github.io/spdx-spec/v2.3/relationships-between-SPDX-elements/ +function(_qt_internal_sbom_validate_spdx_v2_relationship_type) + if(NOT QT_GENERATE_SBOM) + if(arg_OUT_VAR_IS_VALID) + set(${arg_OUT_VAR_IS_VALID} "" PARENT_SCOPE) + endif() + + return() + endif() + + set(opt_args "") + set(single_args + RELATIONSHIP_TYPE + OUT_VAR_IS_VALID + ) + set(multi_args "") + + cmake_parse_arguments(PARSE_ARGV 0 arg "${opt_args}" "${single_args}" "${multi_args}") + _qt_internal_validate_all_args_are_parsed(arg) + + if(NOT arg_RELATIONSHIP_TYPE) + message(FATAL_ERROR "RELATIONSHIP_TYPE is required.") + endif() + + if(NOT arg_OUT_VAR_IS_VALID) + message(FATAL_ERROR "OUT_VAR_IS_VALID is required.") + endif() + + set(valid_types + DESCRIBES + DESCRIBED_BY + CONTAINS + CONTAINED_BY + DEPENDS_ON + DEPENDENCY_OF + DEPENDENCY_MANIFEST_OF + BUILD_DEPENDENCY_OF + DEV_DEPENDENCY_OF + OPTIONAL_DEPENDENCY_OF + PROVIDED_DEPENDENCY_OF + TEST_DEPENDENCY_OF + RUNTIME_DEPENDENCY_OF + EXAMPLE_OF + GENERATES + GENERATED_FROM + ANCESTOR_OF + DESCENDANT_OF + VARIANT_OF + DISTRIBUTION_ARTIFACT + PATCH_FOR + PATCH_APPLIED + COPY_OF + FILE_ADDED + FILE_DELETED + FILE_MODIFIED + EXPANDED_FROM_ARCHIVE + DYNAMIC_LINK + STATIC_LINK + DATA_FILE_OF + TEST_CASE_OF + BUILD_TOOL_OF + DEV_TOOL_OF + TEST_OF + TEST_TOOL_OF + DOCUMENTATION_OF + OPTIONAL_COMPONENT_OF + METAFILE_OF + PACKAGE_OF + AMENDS + PREREQUISITE_FOR + HAS_PREREQUISITE + REQUIREMENT_DESCRIPTION_FOR + SPECIFICATION_FOR + OTHER + ) + + if(arg_RELATIONSHIP_TYPE IN_LIST valid_types) + set(is_valid TRUE) + else() + set(is_valid FALSE) + endif() + + set(${arg_OUT_VAR_IS_VALID} "${is_valid}" PARENT_SCOPE) +endfunction() + + +# Processes a list of relationships entries and outputs a list of strings. +# ESCAPE_CYDX_QUOTES needs to be passed when the output is meant to be used in a +# file(APPEND staging_area_spdx_file block. +function(_qt_internal_sbom_serialize_relationship_entries) + set(opt_args + ESCAPE_CYDX_QUOTES + ) + set(single_args + OUTPUT_SBOM_FORMAT + CYDX_TOML_KEY + OUT_VAR_RELATIONSHIPS_STRINGS + ) + set(multi_args + SBOM_RELATIONSHIP_ENTRIES + ) + + cmake_parse_arguments(PARSE_ARGV 0 arg "${opt_args}" "${single_args}" "${multi_args}") + _qt_internal_validate_all_args_are_parsed(arg) + + if(NOT arg_OUTPUT_SBOM_FORMAT) + message(FATAL_ERROR "OUTPUT_SBOM_FORMAT is required.") + endif() + + if(NOT arg_OUT_VAR_RELATIONSHIPS_STRINGS) + message(FATAL_ERROR "OUT_VAR_RELATIONSHIPS_STRINGS is required.") + endif() + + # Collect each SBOM_RELATIONSHIP_ENTRY args into a separate variable. + set(entry_idx -1) + set(entry_indices "") + + foreach(entry_arg IN LISTS arg_SBOM_RELATIONSHIP_ENTRIES) + if(entry_arg STREQUAL "SBOM_RELATIONSHIP_ENTRY") + math(EXPR entry_idx "${entry_idx}+1") + list(APPEND entry_indices "${entry_idx}") + elseif(entry_idx GREATER_EQUAL 0) + list(APPEND entry_${entry_idx}_args "${entry_arg}") + else() + message(FATAL_ERROR "Missing SBOM_RELATIONSHIP_ENTRY keyword.") + endif() + endforeach() + + set(relationships_strings "") + + set(extra_entry_args "") + if(arg_CYDX_TOML_KEY) + list(APPEND extra_entry_args CYDX_TOML_KEY "${arg_CYDX_TOML_KEY}") + endif() + if(arg_ESCAPE_CYDX_QUOTES) + list(APPEND extra_entry_args ESCAPE_CYDX_QUOTES) + endif() + + foreach(entry_idx IN LISTS entry_indices) + _qt_internal_sbom_serialize_sbom_relationship_entry( + ${entry_${entry_idx}_args} + ${extra_entry_args} + OUTPUT_SBOM_FORMAT "${arg_OUTPUT_SBOM_FORMAT}" + OUT_VAR_RELATIONSHIP_STRINGS entry_relationship_strings + ) + if(entry_relationship_strings) + list(APPEND relationships_strings ${entry_relationship_strings}) + endif() + endforeach() + + set(${arg_OUT_VAR_RELATIONSHIPS_STRINGS} "${relationships_strings}" PARENT_SCOPE) +endfunction() + +# Collects relationships for a given target, and outputs them for each supported format. +# +# Collects relationships from the following sources: +# - target linkage +# - custom relationship entries +# - always adds a "contains" relationship to the parent project package +function(_qt_internal_sbom_handle_target_relationships target) + set(opt_args "") + set(single_args + SPDX_ID + PROJECT_SPDX_ID + OUT_VAR_SBOM_RELATIONSHIP_ENTRIES + OUT_VAR_SPDX_V2_RELATIONSHIPS # spdx v2, deprecated, still used by WebEngine + ) + set(multi_args + LIBRARIES + PUBLIC_LIBRARIES + SBOM_DEPENDENCIES + SBOM_RELATIONSHIPS # spdx v2 input, deprecated, still used by WebEngine + SBOM_RELATIONSHIP_ENTRIES + ) + + cmake_parse_arguments(PARSE_ARGV 1 arg "${opt_args}" "${single_args}" "${multi_args}") + _qt_internal_validate_all_args_are_parsed(arg) + + if(NOT arg_SPDX_ID) + message(FATAL_ERROR "SPDX_ID must be set") + endif() + + set(sbom_relationship_entries "") + set(external_target_dependencies "") + set(spdx_relationships "") # deprecated, but needed + + _qt_internal_forward_function_args( + FORWARD_PREFIX arg + FORWARD_OUT_VAR handle_target_dependencies_args + FORWARD_MULTI + LIBRARIES + PUBLIC_LIBRARIES + SBOM_DEPENDENCIES + ) + + # Get relationships based on target linkage. + _qt_internal_sbom_handle_target_dependencies("${target}" + SPDX_ID "${arg_SPDX_ID}" + ${handle_target_dependencies_args} + OUT_SBOM_RELATIONSHIP_ENTRIES target_relationship_entries + OUT_EXTERNAL_TARGET_DEPENDENCIES external_target_dependencies + ) + + if(target_relationship_entries) + list(APPEND sbom_relationship_entries ${target_relationship_entries}) + endif() + + # Get relationships specified manually. + if(arg_SBOM_RELATIONSHIP_ENTRIES) + list(APPEND sbom_relationship_entries ${arg_SBOM_RELATIONSHIP_ENTRIES}) + endif() + + # CycloneDX external dependencies need to be processed at the end of document generation, + # so record them. + if(external_target_dependencies) + _qt_internal_sbom_record_external_target_dependecies( + TARGETS ${external_target_dependencies} + ) + endif() + + # Handle deprecated SBOM_RELATIONSHIPS argument. + if(arg_SBOM_RELATIONSHIPS) + # This option is deprecated, but it's still used by older WebEngine versions. + # The values for the option were not expected to be prefixed with 'Relationship:', so make + # sure to add the prefix for each value. + set(extra_spdx_v2_relationships "") + foreach(spdx_v2_relationship IN LISTS arg_SBOM_RELATIONSHIPS) + if(NOT spdx_v2_relationship MATCHES "Relationship:") + string(PREPEND spdx_v2_relationship "Relationship: ") + endif() + list(APPEND extra_spdx_v2_relationships "${spdx_v2_relationship}") + endforeach() + list(APPEND spdx_relationships ${extra_spdx_v2_relationships}) + endif() + + # Add default "contains" spdx relationship to the project package. + _qt_internal_sbom_get_current_project_target(project_target) + list(PREPEND sbom_relationship_entries + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + "${project_target}" + SBOM_RELATIONSHIP_TYPE + CONTAINS + SBOM_RELATIONSHIP_TO + "${target}" + ) + + set(${arg_OUT_VAR_SBOM_RELATIONSHIP_ENTRIES} "${sbom_relationship_entries}" PARENT_SCOPE) + set(${arg_OUT_VAR_SPDX_V2_RELATIONSHIPS} "${spdx_relationships}" PARENT_SCOPE) +endfunction() + +function(_qt_internal_sbom_get_current_project_relationships out_var) + set(opt_args "") + set(single_args "") + set(multi_args + SBOM_RELATIONSHIP_ENTRIES + ) + cmake_parse_arguments(PARSE_ARGV 1 arg "${opt_args}" "${single_args}" "${multi_args}") + # No validation on purpose, there might be more options set. + + set(values "") + if(arg_SBOM_RELATIONSHIP_ENTRIES) + set(values ${arg_SBOM_RELATIONSHIP_ENTRIES}) + endif() + + set(${out_var} "${values}" PARENT_SCOPE) +endfunction() + +# Collects relationships for the currently active project, and serializes them for each supported +# format. +function(_qt_internal_sbom_handle_project_relationships) + set(opt_args "") + set(single_args + OUTPUT_SBOM_FORMAT + OUT_VAR_RELATIONSHIP_STRINGS + ) + set(multi_args "") + cmake_parse_arguments(PARSE_ARGV 0 arg "${opt_args}" "${single_args}" "${multi_args}") + _qt_internal_validate_all_args_are_parsed(arg) + + if(NOT arg_OUTPUT_SBOM_FORMAT) + message(FATAL_ERROR "OUTPUT_SBOM_FORMAT is required.") + endif() + + if(NOT arg_OUT_VAR_RELATIONSHIP_STRINGS) + message(FATAL_ERROR "OUT_VAR_RELATIONSHIP_STRINGS is required.") + endif() + + _qt_internal_sbom_get_current_project_target(project_target) + + get_target_property(project_finalize_args "${project_target}" _qt_finalize_sbom_args) + if(NOT project_finalize_args) + set(project_finalize_args "") + endif() + + _qt_internal_sbom_get_current_project_relationships(entries + ${project_finalize_args} + ) + + if(NOT entries) + set(${arg_OUT_VAR_RELATIONSHIP_STRINGS} "" PARENT_SCOPE) + return() + endif() + + set(relationship_entries_args "") + if(arg_OUTPUT_SBOM_FORMAT MATCHES "CYDX") + list(APPEND relationship_entries_args CYDX_TOML_KEY "root_component.") + endif() + + _qt_internal_sbom_serialize_relationship_entries( + ${relationship_entries_args} + OUTPUT_SBOM_FORMAT "${arg_OUTPUT_SBOM_FORMAT}" + OUT_VAR_RELATIONSHIPS_STRINGS relationships_strings + SBOM_RELATIONSHIP_ENTRIES ${entries} + ) + + set(${arg_OUT_VAR_RELATIONSHIP_STRINGS} "${relationships_strings}" PARENT_SCOPE) +endfunction() diff --git a/local/recipes/qt/qtbase/source/cmake/windows/app.exe.manifest.in b/local/recipes/qt/qtbase/source/cmake/windows/app.exe.manifest.in new file mode 100644 index 0000000000..634d9aefdb --- /dev/null +++ b/local/recipes/qt/qtbase/source/cmake/windows/app.exe.manifest.in @@ -0,0 +1,22 @@ + + + + + + + + + + + + true + + + + + + + + + + diff --git a/local/recipes/qt/qtbase/source/examples/widgets/itemviews/addressbook/contact.h b/local/recipes/qt/qtbase/source/examples/widgets/itemviews/addressbook/contact.h new file mode 100644 index 0000000000..e2c31288ee --- /dev/null +++ b/local/recipes/qt/qtbase/source/examples/widgets/itemviews/addressbook/contact.h @@ -0,0 +1,44 @@ +// Copyright (C) 2026 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#ifndef CONTACT_H +#define CONTACT_H + +#include +#include +#include + +//! [0] +struct Contact +{ + QString name; + QString address; + + friend bool comparesEqual(const Contact &lhs, const Contact &rhs) noexcept + { + return lhs.name == rhs.name && lhs.address == rhs.address; + } + + friend Qt::strong_ordering compareThreeWay(const Contact &lhs, const Contact &rhs) noexcept + { + int cmp = lhs.name.compare(rhs.name); + if (cmp == 0) + cmp = lhs.address.compare(rhs.address); + return Qt::compareThreeWay(cmp, 0); + } + + Q_DECLARE_STRONGLY_ORDERED(Contact) +}; + +inline QDataStream &operator<<(QDataStream &stream, const Contact &contact) +{ + return stream << contact.name << contact.address; +} + +inline QDataStream &operator>>(QDataStream &stream, Contact &contact) +{ + return stream >> contact.name >> contact.address; +} +//! [0] + +#endif // CONTACT_H diff --git a/local/recipes/qt/qtbase/source/examples/widgets/itemviews/basicsortfiltermodel/mailheader.h b/local/recipes/qt/qtbase/source/examples/widgets/itemviews/basicsortfiltermodel/mailheader.h new file mode 100644 index 0000000000..0eaedc248f --- /dev/null +++ b/local/recipes/qt/qtbase/source/examples/widgets/itemviews/basicsortfiltermodel/mailheader.h @@ -0,0 +1,25 @@ +// Copyright (C) 2026 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#ifndef MAILHEADER_H +#define MAILHEADER_H + +#include +#include +#include + +struct MailHeader +{ +private: + Q_GADGET + Q_PROPERTY(QString subject MEMBER subject) + Q_PROPERTY(QString sender MEMBER sender) + Q_PROPERTY(QDateTime date MEMBER date) + +public: + QString subject; + QString sender; + QDateTime date; +}; + +#endif // MAILHEADER_H diff --git a/local/recipes/qt/qtbase/source/examples/widgets/itemviews/combowidgetmapper/person.h b/local/recipes/qt/qtbase/source/examples/widgets/itemviews/combowidgetmapper/person.h new file mode 100644 index 0000000000..daf96d4818 --- /dev/null +++ b/local/recipes/qt/qtbase/source/examples/widgets/itemviews/combowidgetmapper/person.h @@ -0,0 +1,26 @@ +// Copyright (C) 2026 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#ifndef PERSON_H +#define PERSON_H + +#include +#include + +//! [Person] +struct Person +{ +private: + Q_GADGET + Q_PROPERTY(QString name MEMBER name) + Q_PROPERTY(QString address MEMBER address) + Q_PROPERTY(QString type MEMBER type) +public: + + QString name; + QString address; + QString type; +}; +//! [Person] + +#endif // PERSON_H diff --git a/local/recipes/qt/qtbase/source/examples/widgets/itemviews/customsortfiltermodel/mailheader.h b/local/recipes/qt/qtbase/source/examples/widgets/itemviews/customsortfiltermodel/mailheader.h new file mode 100644 index 0000000000..b8e464fcfb --- /dev/null +++ b/local/recipes/qt/qtbase/source/examples/widgets/itemviews/customsortfiltermodel/mailheader.h @@ -0,0 +1,27 @@ +// Copyright (C) 2026 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#ifndef MAILHEADER_H +#define MAILHEADER_H + +#include +#include +#include + +//! [0] +struct MailHeader +{ +private: + Q_GADGET + Q_PROPERTY(QString subject MEMBER subject) + Q_PROPERTY(QString sender MEMBER sender) + Q_PROPERTY(QDateTime date MEMBER date) + +public: + QString subject; + QString sender; + QDateTime date; +}; +//! [0] + +#endif // MAILHEADER_H diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/D3D12MemoryAllocator/patches/0002-Eliminate-another-GCC-warnining-in-D3D12MA.patch b/local/recipes/qt/qtbase/source/src/3rdparty/D3D12MemoryAllocator/patches/0002-Eliminate-another-GCC-warnining-in-D3D12MA.patch new file mode 100644 index 0000000000..24402852fe --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/D3D12MemoryAllocator/patches/0002-Eliminate-another-GCC-warnining-in-D3D12MA.patch @@ -0,0 +1,25 @@ +From be136dc8f18a6745b18907dd261e66d2eee8c6fc Mon Sep 17 00:00:00 2001 +From: Laszlo Agocs +Date: Fri, 16 Jan 2026 11:52:23 +0100 +Subject: [PATCH] Eliminate another GCC warnining in D3D12MA + +Change-Id: Ie381b10d4a0263c61ac2daf1c0912c2f8d6edbde +--- + src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.cpp b/src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.cpp +index 42b0ed9a39a..cdd0e790ee3 100644 +--- a/src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.cpp ++++ b/src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.cpp +@@ -141,6 +141,7 @@ especially to test compatibility with D3D12_RESOURCE_HEAP_TIER_1 on modern GPUs. + #pragma GCC diagnostic ignored "-Wswitch" + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" + #pragma GCC diagnostic ignored "-Wunused-function" ++#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" + #endif + + #if defined(__clang__) +-- +2.36.1.windows.1 + diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/harfbuzz-world.cc b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/harfbuzz-world.cc new file mode 100644 index 0000000000..138a57275e --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/harfbuzz-world.cc @@ -0,0 +1,169 @@ +#ifdef HB_FEATURES_H +#include HB_FEATURES_H +#endif + +/* Core library. */ +#include "OT/Var/VARC/VARC.cc" +#include "hb-aat-layout.cc" +#include "hb-aat-map.cc" +#include "hb-blob.cc" +#include "hb-buffer-serialize.cc" +#include "hb-buffer-verify.cc" +#include "hb-buffer.cc" +#include "hb-common.cc" +#include "hb-draw.cc" +#include "hb-face-builder.cc" +#include "hb-face.cc" +#include "hb-fallback-shape.cc" +#include "hb-font.cc" +#include "hb-map.cc" +#include "hb-number.cc" +#include "hb-ot-cff1-table.cc" +#include "hb-ot-cff2-table.cc" +#include "hb-ot-color.cc" +#include "hb-ot-face.cc" +#include "hb-ot-font.cc" +#include "hb-ot-layout.cc" +#include "hb-ot-map.cc" +#include "hb-ot-math.cc" +#include "hb-ot-meta.cc" +#include "hb-ot-metrics.cc" +#include "hb-ot-name.cc" +#include "hb-ot-shape-fallback.cc" +#include "hb-ot-shape-normalize.cc" +#include "hb-ot-shape.cc" +#include "hb-ot-shaper-arabic.cc" +#include "hb-ot-shaper-default.cc" +#include "hb-ot-shaper-hangul.cc" +#include "hb-ot-shaper-hebrew.cc" +#include "hb-ot-shaper-indic-table.cc" +#include "hb-ot-shaper-indic.cc" +#include "hb-ot-shaper-khmer.cc" +#include "hb-ot-shaper-myanmar.cc" +#include "hb-ot-shaper-syllabic.cc" +#include "hb-ot-shaper-thai.cc" +#include "hb-ot-shaper-use.cc" +#include "hb-ot-shaper-vowel-constraints.cc" +#include "hb-ot-tag.cc" +#include "hb-ot-var.cc" +#include "hb-outline.cc" +#include "hb-paint-bounded.cc" +#include "hb-paint-extents.cc" +#include "hb-paint.cc" +#include "hb-set.cc" +#include "hb-shape-plan.cc" +#include "hb-shape.cc" +#include "hb-shaper.cc" +#include "hb-static.cc" +#include "hb-style.cc" +#include "hb-ucd.cc" +#include "hb-unicode.cc" + +#ifdef HB_HAS_CAIRO +#include "hb-cairo-utils.cc" +#include "hb-cairo.cc" +#include "hb-static.cc" +#endif + +#ifdef HB_HAS_CORETEXT +#define HAVE_CORETEXT 1 +#include "hb-coretext-font.cc" +#include "hb-coretext-shape.cc" +#include "hb-coretext.cc" +#endif + +#ifdef HB_HAS_DIRECTWRITE +#define HAVE_DIRECTWRITE 1 +#include "hb-directwrite-font.cc" +#include "hb-directwrite-shape.cc" +#include "hb-directwrite.cc" +#endif + +#ifdef HB_HAS_FREETYPE +#define HAVE_FREETYPE 1 +#include "hb-ft.cc" +#endif + +#ifdef HB_HAS_GDI +#ifndef HAVE_GDI +#define HAVE_GDI 1 +#include "hb-gdi.cc" +#endif +#endif + +#ifdef HB_HAS_GLIB +#define HAVE_GLIB 1 +#include "hb-glib.cc" +#endif + +#ifdef HB_HAS_GRAPHITE +#define HAVE_GRAPHITE 1 +#include "hb-graphite2.cc" +#endif + +#ifdef HB_HAS_GPU +#include "hb-gpu-draw.cc" +#include "hb-gpu-paint.cc" +#include "hb-gpu.cc" +#include "hb-static.cc" +#endif + +#ifdef HB_HAS_ICU +#include "hb-icu.cc" +#endif + +#ifdef HB_HAS_RASTER +#include "hb-raster-draw.cc" +#include "hb-raster-image.cc" +#include "hb-raster-paint.cc" +#include "hb-raster.cc" +#include "hb-static.cc" +#endif + +#ifdef HB_HAS_SUBSET +#include "graph/gsubgpos-context.cc" +#include "hb-number.cc" +#include "hb-ot-cff1-table.cc" +#include "hb-ot-cff2-table.cc" +#include "hb-static.cc" +#include "hb-subset-cff-common.cc" +#include "hb-subset-cff1.cc" +#include "hb-subset-cff2-to-cff1.cc" +#include "hb-subset-cff2.cc" +#include "hb-subset-input.cc" +#include "hb-subset-instancer-iup.cc" +#include "hb-subset-instancer-solver.cc" +#include "hb-subset-plan-layout.cc" +#include "hb-subset-plan-var.cc" +#include "hb-subset-plan.cc" +#include "hb-subset-serialize.cc" +#include "hb-subset-table-cff.cc" +#include "hb-subset-table-color.cc" +#include "hb-subset-table-layout.cc" +#include "hb-subset-table-other.cc" +#include "hb-subset-table-var.cc" +#include "hb-subset.cc" +#endif + +#ifdef HB_HAS_UNISCRIBE +#define HAVE_UNISCRIBE 1 +#define HAVE_GDI 1 +#include "hb-uniscribe.cc" +#endif + +#ifdef HB_HAS_VECTOR +#include "hb-static.cc" +#include "hb-vector-draw.cc" +#include "hb-vector-paint-pdf.cc" +#include "hb-vector-paint-svg.cc" +#include "hb-vector-paint.cc" +#include "hb-vector-path.cc" +#include "hb-vector.cc" +#include "hb-zlib.cc" +#endif + +#ifdef HB_HAS_WASM +#define HAVE_WASM 1 +#include "hb-wasm-api.cc" +#include "hb-wasm-shape.cc" +#endif diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-cu2qu.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-cu2qu.hh new file mode 100644 index 0000000000..c98b140a1c --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-cu2qu.hh @@ -0,0 +1,193 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Cubic-to-quadratic Bézier conversion. + * Ported from fonttools cu2qu: + * https://github.com/fonttools/fonttools/blob/main/Lib/fontTools/cu2qu/cu2qu.py + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Author(s): Behdad Esfahbod + */ + +#ifndef HB_GPU_CU2QU_HH +#define HB_GPU_CU2QU_HH + +#include "hb-gpu-draw.hh" + +#include + + +/* Maximum approximation error in font units. + * 0.5 is well below one unit in any reasonable coordinate system. */ +#ifndef HB_GPU_CU2QU_TOLERANCE +#define HB_GPU_CU2QU_TOLERANCE 0.5 +#endif + +/* Maximum subdivision depth. Each level halves the parameter interval; + * at depth 10 the sub-curve spans 1/1024 of the original, so the + * quadratic error (O(dt^4)) is reduced by a factor of ~10^12. */ +#define HB_GPU_CU2QU_MAX_DEPTH 10 + + +struct hb_gpu_cu2qu_point_t +{ + double x, y; +}; + +static inline hb_gpu_cu2qu_point_t +hb_gpu_cu2qu_lerp (hb_gpu_cu2qu_point_t a, hb_gpu_cu2qu_point_t b, double t) +{ + return {a.x + (b.x - a.x) * t, + a.y + (b.y - a.y) * t}; +} + + +/* + * Check whether a cubic error curve stays within `tolerance` of the origin. + */ +static bool +hb_gpu_cubic_farthest_fit_inside (hb_gpu_cu2qu_point_t p0, + hb_gpu_cu2qu_point_t p1, + hb_gpu_cu2qu_point_t p2, + hb_gpu_cu2qu_point_t p3, + double tolerance, unsigned depth) +{ + if (hypot (p1.x, p1.y) <= tolerance && + hypot (p2.x, p2.y) <= tolerance) + return true; + + if (depth >= 8) + return false; + + hb_gpu_cu2qu_point_t mid = {(p0.x + 3 * (p1.x + p2.x) + p3.x) * 0.125, + (p0.y + 3 * (p1.y + p2.y) + p3.y) * 0.125}; + if (hypot (mid.x, mid.y) > tolerance) + return false; + + hb_gpu_cu2qu_point_t d3 = {(p3.x + p2.x - p1.x - p0.x) * 0.125, + (p3.y + p2.y - p1.y - p0.y) * 0.125}; + + return hb_gpu_cubic_farthest_fit_inside ( + p0, + hb_gpu_cu2qu_lerp (p0, p1, 0.5), + {mid.x - d3.x, mid.y - d3.y}, + mid, + tolerance, depth + 1 + ) && hb_gpu_cubic_farthest_fit_inside ( + mid, + {mid.x + d3.x, mid.y + d3.y}, + hb_gpu_cu2qu_lerp (p2, p3, 0.5), + p3, + tolerance, depth + 1 + ); +} + + +/* + * Try to approximate a cubic Bézier with a single quadratic. + */ +static bool +hb_gpu_cubic_approx_quadratic (hb_gpu_cu2qu_point_t c0, + hb_gpu_cu2qu_point_t c1, + hb_gpu_cu2qu_point_t c2, + hb_gpu_cu2qu_point_t c3, + double tolerance, + hb_gpu_cu2qu_point_t *q1) +{ + double ax = c1.x - c0.x, ay = c1.y - c0.y; + double dx = c3.x - c2.x, dy = c3.y - c2.y; + + double px = -ay, py = ax; + + double denom = px * dx + py * dy; + if (fabs (denom) < 1e-12) + return false; + + double h = (px * (c0.x - c2.x) + py * (c0.y - c2.y)) / denom; + + q1->x = c2.x + dx * h; + q1->y = c2.y + dy * h; + + hb_gpu_cu2qu_point_t err1 = {c0.x + (q1->x - c0.x) * (2.0 / 3.0) - c1.x, + c0.y + (q1->y - c0.y) * (2.0 / 3.0) - c1.y}; + hb_gpu_cu2qu_point_t err2 = {c3.x + (q1->x - c3.x) * (2.0 / 3.0) - c2.x, + c3.y + (q1->y - c3.y) * (2.0 / 3.0) - c2.y}; + + return hb_gpu_cubic_farthest_fit_inside ({0, 0}, err1, err2, {0, 0}, tolerance, 0); +} + + +/* + * Split a cubic at t = 0.5 (de Casteljau). + */ +static void +hb_gpu_split_cubic_half (hb_gpu_cu2qu_point_t c0, + hb_gpu_cu2qu_point_t c1, + hb_gpu_cu2qu_point_t c2, + hb_gpu_cu2qu_point_t c3, + hb_gpu_cu2qu_point_t out[7]) +{ + hb_gpu_cu2qu_point_t m01 = hb_gpu_cu2qu_lerp (c0, c1, 0.5); + hb_gpu_cu2qu_point_t m12 = hb_gpu_cu2qu_lerp (c1, c2, 0.5); + hb_gpu_cu2qu_point_t m23 = hb_gpu_cu2qu_lerp (c2, c3, 0.5); + hb_gpu_cu2qu_point_t m012 = hb_gpu_cu2qu_lerp (m01, m12, 0.5); + hb_gpu_cu2qu_point_t m123 = hb_gpu_cu2qu_lerp (m12, m23, 0.5); + hb_gpu_cu2qu_point_t mid = hb_gpu_cu2qu_lerp (m012, m123, 0.5); + + out[0] = c0; out[1] = m01; out[2] = m012; + out[3] = mid; + out[4] = m123; out[5] = m23; out[6] = c3; +} + + +/* + * Recursively convert a cubic into quadratic segments. + */ +static void +hb_gpu_cubic_to_quadratics (hb_gpu_draw_t *g, + hb_gpu_cu2qu_point_t c0, + hb_gpu_cu2qu_point_t c1, + hb_gpu_cu2qu_point_t c2, + hb_gpu_cu2qu_point_t c3, + double tolerance, unsigned depth) +{ + hb_gpu_cu2qu_point_t q1; + if (hb_gpu_cubic_approx_quadratic (c0, c1, c2, c3, tolerance, &q1)) + { + g->acc_conic_to (q1.x, q1.y, c3.x, c3.y); + return; + } + + if (depth >= HB_GPU_CU2QU_MAX_DEPTH) + { + g->acc_line_to (c3.x, c3.y); + return; + } + + hb_gpu_cu2qu_point_t pts[7]; + hb_gpu_split_cubic_half (c0, c1, c2, c3, pts); + hb_gpu_cubic_to_quadratics (g, pts[0], pts[1], pts[2], pts[3], tolerance, depth + 1); + hb_gpu_cubic_to_quadratics (g, pts[3], pts[4], pts[5], pts[6], tolerance, depth + 1); +} + + +#endif /* HB_GPU_CU2QU_HH */ diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment-glsl.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment-glsl.hh new file mode 100644 index 0000000000..9f645860a3 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment-glsl.hh @@ -0,0 +1,40 @@ +static const char *hb_gpu_draw_fragment_glsl = +"/*\n" +" * Copyright (C) 2026 Behdad Esfahbod\n" +" *\n" +" * This is part of HarfBuzz, a text shaping library.\n" +" *\n" +" * Permission is hereby granted, without written agreement and without\n" +" * license or royalty fees, to use, copy, modify, and distribute this\n" +" * software and its documentation for any purpose, provided that the\n" +" * above copyright notice and the following two paragraphs appear in\n" +" * all copies of this software.\n" +" *\n" +" * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\n" +" * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\n" +" * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\n" +" * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n" +" * DAMAGE.\n" +" *\n" +" * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\n" +" * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n" +" * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n" +" * ON AN \"AS IS\" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\n" +" * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n" +" */\n" +"\n" +"\n" +"/* Draw-renderer fragment shader entry. The heavy lifting (Slug\n" +" * coverage, MSAA, ppem, stem darkening) lives in the shared\n" +" * hb-gpu-fragment.glsl that must be prepended to this source;\n" +" * this file only adds the thin hb_gpu_draw() wrapper that lifts\n" +" * pixelsPerEm out of fwidth() at uniform control flow before\n" +" * calling the shared _hb_gpu_slug(). */\n" +"\n" +"\n" +"float hb_gpu_draw (vec2 renderCoord, uint glyphLoc_)\n" +"{\n" +" vec2 pixelsPerEm = 1.0 / fwidth (renderCoord);\n" +" return _hb_gpu_slug (renderCoord, pixelsPerEm, glyphLoc_);\n" +"}\n" +; diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment-hlsl.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment-hlsl.hh new file mode 100644 index 0000000000..740d810be3 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment-hlsl.hh @@ -0,0 +1,37 @@ +static const char *hb_gpu_draw_fragment_hlsl = +"/*\n" +" * Copyright (C) 2026 Behdad Esfahbod\n" +" *\n" +" * This is part of HarfBuzz, a text shaping library.\n" +" *\n" +" * Permission is hereby granted, without written agreement and without\n" +" * license or royalty fees, to use, copy, modify, and distribute this\n" +" * software and its documentation for any purpose, provided that the\n" +" * above copyright notice and the following two paragraphs appear in\n" +" * all copies of this software.\n" +" *\n" +" * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\n" +" * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\n" +" * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\n" +" * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n" +" * DAMAGE.\n" +" *\n" +" * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\n" +" * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n" +" * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n" +" * ON AN \"AS IS\" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\n" +" * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n" +" */\n" +"\n" +"\n" +"/* Draw-renderer fragment shader entry (HLSL). Heavy lifting\n" +" * (Slug coverage, MSAA, ppem, stem darkening) lives in the shared\n" +" * hb-gpu-fragment.hlsl that must be prepended to this source. */\n" +"\n" +"\n" +"float hb_gpu_draw (float2 renderCoord, uint glyphLoc_)\n" +"{\n" +" float2 pixelsPerEm = 1.0 / fwidth (renderCoord);\n" +" return _hb_gpu_slug (renderCoord, pixelsPerEm, glyphLoc_);\n" +"}\n" +; diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment-msl.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment-msl.hh new file mode 100644 index 0000000000..0c202eacfe --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment-msl.hh @@ -0,0 +1,38 @@ +static const char *hb_gpu_draw_fragment_msl = +"/*\n" +" * Copyright (C) 2026 Behdad Esfahbod\n" +" *\n" +" * This is part of HarfBuzz, a text shaping library.\n" +" *\n" +" * Permission is hereby granted, without written agreement and without\n" +" * license or royalty fees, to use, copy, modify, and distribute this\n" +" * software and its documentation for any purpose, provided that the\n" +" * above copyright notice and the following two paragraphs appear in\n" +" * all copies of this software.\n" +" *\n" +" * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\n" +" * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\n" +" * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\n" +" * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n" +" * DAMAGE.\n" +" *\n" +" * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\n" +" * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n" +" * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n" +" * ON AN \"AS IS\" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\n" +" * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n" +" */\n" +"\n" +"\n" +"/* Draw-renderer fragment shader entry (Metal). Heavy lifting\n" +" * (Slug coverage, MSAA, ppem, stem darkening) lives in the shared\n" +" * hb-gpu-fragment.msl that must be prepended to this source. */\n" +"\n" +"\n" +"float hb_gpu_draw (float2 renderCoord, uint glyphLoc_,\n" +" device const short4* hb_gpu_atlas)\n" +"{\n" +" float2 pixelsPerEm = 1.0 / fwidth (renderCoord);\n" +" return _hb_gpu_slug (renderCoord, pixelsPerEm, glyphLoc_, hb_gpu_atlas);\n" +"}\n" +; diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment-wgsl.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment-wgsl.hh new file mode 100644 index 0000000000..0e732e2630 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment-wgsl.hh @@ -0,0 +1,38 @@ +static const char *hb_gpu_draw_fragment_wgsl = +"/*\n" +" * Copyright (C) 2026 Behdad Esfahbod\n" +" *\n" +" * This is part of HarfBuzz, a text shaping library.\n" +" *\n" +" * Permission is hereby granted, without written agreement and without\n" +" * license or royalty fees, to use, copy, modify, and distribute this\n" +" * software and its documentation for any purpose, provided that the\n" +" * above copyright notice and the following two paragraphs appear in\n" +" * all copies of this software.\n" +" *\n" +" * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\n" +" * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\n" +" * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\n" +" * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n" +" * DAMAGE.\n" +" *\n" +" * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\n" +" * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n" +" * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n" +" * ON AN \"AS IS\" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\n" +" * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n" +" */\n" +"\n" +"\n" +"/* Draw-renderer fragment shader entry (WGSL). Heavy lifting\n" +" * (Slug coverage, MSAA, ppem, stem darkening) lives in the shared\n" +" * hb-gpu-fragment.wgsl that must be prepended to this source. */\n" +"\n" +"\n" +"fn hb_gpu_draw (renderCoord: vec2f, glyphLoc_: u32,\n" +" hb_gpu_atlas: ptr>, read>) -> f32\n" +"{\n" +" let pixelsPerEm = 1.0 / fwidth (renderCoord);\n" +" return _hb_gpu_slug (renderCoord, pixelsPerEm, glyphLoc_, hb_gpu_atlas);\n" +"}\n" +; diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment.glsl b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment.glsl new file mode 100644 index 0000000000..75f3c5ec7d --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment.glsl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + + +/* Draw-renderer fragment shader entry. The heavy lifting (Slug + * coverage, MSAA, ppem, stem darkening) lives in the shared + * hb-gpu-fragment.glsl that must be prepended to this source; + * this file only adds the thin hb_gpu_draw() wrapper that lifts + * pixelsPerEm out of fwidth() at uniform control flow before + * calling the shared _hb_gpu_slug(). */ + + +float hb_gpu_draw (vec2 renderCoord, uint glyphLoc_) +{ + vec2 pixelsPerEm = 1.0 / fwidth (renderCoord); + return _hb_gpu_slug (renderCoord, pixelsPerEm, glyphLoc_); +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment.hlsl b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment.hlsl new file mode 100644 index 0000000000..49e94409f8 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment.hlsl @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + + +/* Draw-renderer fragment shader entry (HLSL). Heavy lifting + * (Slug coverage, MSAA, ppem, stem darkening) lives in the shared + * hb-gpu-fragment.hlsl that must be prepended to this source. */ + + +float hb_gpu_draw (float2 renderCoord, uint glyphLoc_) +{ + float2 pixelsPerEm = 1.0 / fwidth (renderCoord); + return _hb_gpu_slug (renderCoord, pixelsPerEm, glyphLoc_); +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment.msl b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment.msl new file mode 100644 index 0000000000..d1c2a19236 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment.msl @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + + +/* Draw-renderer fragment shader entry (Metal). Heavy lifting + * (Slug coverage, MSAA, ppem, stem darkening) lives in the shared + * hb-gpu-fragment.msl that must be prepended to this source. */ + + +float hb_gpu_draw (float2 renderCoord, uint glyphLoc_, + device const short4* hb_gpu_atlas) +{ + float2 pixelsPerEm = 1.0 / fwidth (renderCoord); + return _hb_gpu_slug (renderCoord, pixelsPerEm, glyphLoc_, hb_gpu_atlas); +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment.wgsl b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment.wgsl new file mode 100644 index 0000000000..ca8e671c49 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw-fragment.wgsl @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + + +/* Draw-renderer fragment shader entry (WGSL). Heavy lifting + * (Slug coverage, MSAA, ppem, stem darkening) lives in the shared + * hb-gpu-fragment.wgsl that must be prepended to this source. */ + + +fn hb_gpu_draw (renderCoord: vec2f, glyphLoc_: u32, + hb_gpu_atlas: ptr>, read>) -> f32 +{ + let pixelsPerEm = 1.0 / fwidth (renderCoord); + return _hb_gpu_slug (renderCoord, pixelsPerEm, glyphLoc_, hb_gpu_atlas); +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw.cc b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw.cc new file mode 100644 index 0000000000..ea47532577 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw.cc @@ -0,0 +1,1176 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Author(s): Behdad Esfahbod + */ + +#include "hb.hh" + +#include "hb-gpu.h" +#include "hb-gpu-draw.hh" +#include "hb-gpu-cu2qu.hh" +#include "hb-machinery.hh" + +#include + +/* ---- Accumulator ---- */ + +static void +acc_update_extents (hb_gpu_draw_t *g, double x, double y) +{ + g->ext_min_x = hb_min (g->ext_min_x, x); + g->ext_min_y = hb_min (g->ext_min_y, y); + g->ext_max_x = hb_max (g->ext_max_x, x); + g->ext_max_y = hb_max (g->ext_max_y, y); +} + +static void +acc_emit (hb_gpu_draw_t *g, + bool contour_start, + double p1x, double p1y, + double p2x, double p2y, + double p3x, double p3y) +{ + if (unlikely (g->num_curves >= HB_GPU_DRAW_MAX_CURVES)) + { + g->success = false; + return; + } + + hb_gpu_curve_t c = {p1x, p1y, p2x, p2y, p3x, p3y, contour_start}; + if (unlikely (!g->curves.push_or_fail (c))) + { + g->success = false; + return; + } + + g->num_curves++; + g->current_x = p3x; + g->current_y = p3y; + + acc_update_extents (g, p1x, p1y); + acc_update_extents (g, p2x, p2y); + acc_update_extents (g, p3x, p3y); +} + +static void +acc_emit_conic (hb_gpu_draw_t *g, + double cx, double cy, + double x, double y) +{ + if (g->current_x == x && g->current_y == y) + return; + + bool contour_start = g->need_moveto; + if (g->need_moveto) { + g->start_x = g->current_x; + g->start_y = g->current_y; + g->need_moveto = false; + } + + acc_emit (g, contour_start, + g->current_x, g->current_y, cx, cy, x, y); +} + +void +hb_gpu_draw_t::acc_move_to (double x, double y) +{ + if (unlikely (!success)) + return; + + need_moveto = true; + current_x = x; + current_y = y; +} + +void +hb_gpu_draw_t::acc_line_to (double x, double y) +{ + if (unlikely (!success)) + return; + + acc_emit_conic (this, current_x, current_y, x, y); +} + +void +hb_gpu_draw_t::acc_conic_to (double cx, double cy, double x, double y) +{ + if (unlikely (!success)) + return; + + acc_emit_conic (this, cx, cy, x, y); +} + +void +hb_gpu_draw_t::acc_close_path () +{ + if (unlikely (!success)) + return; + + if (!need_moveto && + (current_x != start_x || current_y != start_y)) + acc_line_to (start_x, start_y); +} + + +void +hb_gpu_draw_t::acc_cubic_to (double c1x, double c1y, + double c2x, double c2y, + double x, double y) +{ + if (unlikely (!success)) + return; + + double c0x = current_x, c0y = current_y; + + if (c0x == x && c0y == y && + c1x == x && c1y == y && + c2x == x && c2y == y) + return; + + /* Degenerate cubic: all control points are collinear. + * Emit as a line instead of running cu2qu subdivision. */ + double dx = x - c0x, dy = y - c0y; + double len_sq = dx * dx + dy * dy; + if (len_sq > 0.) + { + double inv = 1.0 / len_sq; + double cross1 = (c1x - c0x) * dy - (c1y - c0y) * dx; + double cross2 = (c2x - c0x) * dy - (c2y - c0y) * dx; + if (cross1 * cross1 * inv <= HB_GPU_CU2QU_TOLERANCE * HB_GPU_CU2QU_TOLERANCE && + cross2 * cross2 * inv <= HB_GPU_CU2QU_TOLERANCE * HB_GPU_CU2QU_TOLERANCE) + { + acc_line_to (x, y); + return; + } + } + + hb_gpu_cubic_to_quadratics (this, + {c0x, c0y}, {c1x, c1y}, + {c2x, c2y}, {x, y}, + HB_GPU_CU2QU_TOLERANCE, 0); +} + + +/* ---- Draw funcs ---- */ + +static void +hb_gpu_draw_move_to (hb_draw_funcs_t *dfuncs HB_UNUSED, + void *data, + hb_draw_state_t *st HB_UNUSED, + float to_x, float to_y, + void *user_data HB_UNUSED) +{ + hb_gpu_draw_t *g = (hb_gpu_draw_t *) data; + g->acc_close_path (); + g->acc_move_to ((double) to_x, (double) to_y); +} + +static void +hb_gpu_draw_line_to (hb_draw_funcs_t *dfuncs HB_UNUSED, + void *data, + hb_draw_state_t *st HB_UNUSED, + float to_x, float to_y, + void *user_data HB_UNUSED) +{ + hb_gpu_draw_t *g = (hb_gpu_draw_t *) data; + g->acc_line_to ((double) to_x, (double) to_y); +} + +static void +hb_gpu_draw_quadratic_to (hb_draw_funcs_t *dfuncs HB_UNUSED, + void *data, + hb_draw_state_t *st HB_UNUSED, + float control_x, float control_y, + float to_x, float to_y, + void *user_data HB_UNUSED) +{ + hb_gpu_draw_t *g = (hb_gpu_draw_t *) data; + g->acc_conic_to ((double) control_x, (double) control_y, + (double) to_x, (double) to_y); +} + +static void +hb_gpu_draw_cubic_to (hb_draw_funcs_t *dfuncs HB_UNUSED, + void *data, + hb_draw_state_t *st HB_UNUSED, + float control1_x, float control1_y, + float control2_x, float control2_y, + float to_x, float to_y, + void *user_data HB_UNUSED) +{ + hb_gpu_draw_t *g = (hb_gpu_draw_t *) data; + g->acc_cubic_to ((double) control1_x, (double) control1_y, + (double) control2_x, (double) control2_y, + (double) to_x, (double) to_y); +} + +static void +hb_gpu_draw_close_path (hb_draw_funcs_t *dfuncs HB_UNUSED, + void *data, + hb_draw_state_t *st HB_UNUSED, + void *user_data HB_UNUSED) +{ + hb_gpu_draw_t *g = (hb_gpu_draw_t *) data; + g->acc_close_path (); +} + +static inline void free_static_gpu_draw_funcs (); + +static struct hb_gpu_draw_funcs_lazy_loader_t : hb_draw_funcs_lazy_loader_t +{ + static hb_draw_funcs_t *create () + { + hb_draw_funcs_t *funcs = hb_draw_funcs_create (); + + hb_draw_funcs_set_move_to_func (funcs, hb_gpu_draw_move_to, nullptr, nullptr); + hb_draw_funcs_set_line_to_func (funcs, hb_gpu_draw_line_to, nullptr, nullptr); + hb_draw_funcs_set_quadratic_to_func (funcs, hb_gpu_draw_quadratic_to, nullptr, nullptr); + hb_draw_funcs_set_cubic_to_func (funcs, hb_gpu_draw_cubic_to, nullptr, nullptr); + hb_draw_funcs_set_close_path_func (funcs, hb_gpu_draw_close_path, nullptr, nullptr); + + hb_draw_funcs_make_immutable (funcs); + + hb_atexit (free_static_gpu_draw_funcs); + + return funcs; + } +} static_gpu_draw_funcs; + +static inline void +free_static_gpu_draw_funcs () +{ + static_gpu_draw_funcs.free_instance (); +} + + +/* ---- Encode ---- */ + +struct hb_gpu_texel_t +{ + int16_t r, g, b, a; +}; + +static hb_position_t +clamp_to_hb_position (double v) +{ + return (hb_position_t) hb_clamp (v, + (double) hb_int_min (hb_position_t), + (double) hb_int_max (hb_position_t)); +} + +static inline int16_t +quantize (double v) +{ + return (int16_t) round (v * HB_GPU_UNITS_PER_EM); +} + +static inline int16_t +quantize_down (double v) +{ + return (int16_t) floor (v * HB_GPU_UNITS_PER_EM); +} + +static inline int16_t +quantize_up (double v) +{ + return (int16_t) ceil (v * HB_GPU_UNITS_PER_EM); +} + +static inline double +dequantize (int16_t v) +{ + return (double) v / HB_GPU_UNITS_PER_EM; +} + +static inline bool +quantize_down_fits_i16 (double v) +{ + double q = floor (v * HB_GPU_UNITS_PER_EM); + return q >= INT16_MIN && + q <= INT16_MAX; +} + +static inline bool +quantize_up_fits_i16 (double v) +{ + double q = ceil (v * HB_GPU_UNITS_PER_EM); + return q >= INT16_MIN && + q <= INT16_MAX; +} + +static inline int16_t +encode_offset (unsigned offset) +{ + return (int16_t) (offset - 32768u); +} + +static hb_gpu_encode_curve_info_t +encode_curve_info (const hb_gpu_curve_t *c) +{ + hb_gpu_encode_curve_info_t info; + + info.min_x = hb_min (hb_min (c->p1x, c->p2x), c->p3x); + info.max_x = hb_max (hb_max (c->p1x, c->p2x), c->p3x); + info.min_y = hb_min (hb_min (c->p1y, c->p2y), c->p3y); + info.max_y = hb_max (hb_max (c->p1y, c->p2y), c->p3y); + info.is_horizontal = c->p1y == c->p2y && c->p2y == c->p3y; + info.is_vertical = c->p1x == c->p2x && c->p2x == c->p3x; + info.hband_lo = 0; + info.hband_hi = -1; + info.vband_lo = 0; + info.vband_hi = -1; + + return info; +} + +static void +_hb_gpu_draw_get_extents (hb_gpu_draw_t *draw, + hb_glyph_extents_t *extents) +{ + if (unlikely (!draw->success) || + draw->num_curves == 0 || + draw->ext_min_x == HUGE_VAL) + { + extents->x_bearing = 0; + extents->y_bearing = 0; + extents->width = 0; + extents->height = 0; + return; + } + + double min_x = floor (draw->ext_min_x); + double min_y = floor (draw->ext_min_y); + double max_x = ceil (draw->ext_max_x); + double max_y = ceil (draw->ext_max_y); + + if (unlikely (!std::isfinite (min_x) || + !std::isfinite (min_y) || + !std::isfinite (max_x) || + !std::isfinite (max_y))) + { + extents->x_bearing = 0; + extents->y_bearing = 0; + extents->width = 0; + extents->height = 0; + return; + } + + extents->x_bearing = clamp_to_hb_position (min_x); + extents->y_bearing = clamp_to_hb_position (max_y); + extents->width = clamp_to_hb_position (max_x - min_x); + extents->height = clamp_to_hb_position (min_y - max_y); +} + + +/** + * hb_gpu_draw_encode: + * @draw: a GPU shape encoder + * @extents: (out) (nullable): where to store the computed glyph + * extents (in font units, Y-up). Pass `NULL` if not + * needed. + * + * Encodes the accumulated outlines into a compact blob + * suitable for GPU rendering. The blob data is an array of + * RGBA16I texels (8 bytes each) to be uploaded to a texture + * buffer object. + * + * The returned blob owns its own copy of the data. On success + * @draw is auto-cleared so it can be reused for the next glyph; + * user configuration (font scale) is preserved. + * + * Return value: (transfer full): + * An #hb_blob_t containing the encoded data, or `NULL` if encoding + * failed (allocation failure or accumulation error). When the + * encoder accumulated no outline (e.g. the glyph has no ink, like a + * space), returns the empty-blob singleton instead of `NULL`, so + * callers can distinguish "nothing to render" (length 0) from a + * real failure (`NULL`). + * + * Since: 14.0.0 + **/ +hb_blob_t * +hb_gpu_draw_encode (hb_gpu_draw_t *draw, + hb_glyph_extents_t *extents) +{ + /* Capture computed extents before auto-clear wipes them. */ + if (extents) + _hb_gpu_draw_get_extents (draw, extents); + HB_SCOPE_GUARD (hb_gpu_draw_clear (draw)); + + if (unlikely (!draw->success)) + return nullptr; + + const hb_gpu_curve_t *curves = draw->curves.arrayZ; + unsigned num_curves = draw->curves.length; + + if (num_curves == 0) + return hb_blob_get_empty (); + + hb_gpu_encode_scratch_t &s = draw->scratch; + + s.curve_infos.reset_if_error (); + s.hband_curve_counts.reset_if_error (); + s.vband_curve_counts.reset_if_error (); + s.hband_offsets.reset_if_error (); + s.vband_offsets.reset_if_error (); + s.hband_curves.reset_if_error (); + s.hband_curves_asc.reset_if_error (); + s.vband_curves.reset_if_error (); + s.vband_curves_asc.reset_if_error (); + s.hband_cursors.reset_if_error (); + s.vband_cursors.reset_if_error (); + s.curve_texel_offset.reset_if_error (); + + /* Compute per-curve info and extents */ + if (unlikely (!s.curve_infos.resize (num_curves))) + return nullptr; + + int16_t min_x_q = quantize_down (draw->ext_min_x); + int16_t min_y_q = quantize_down (draw->ext_min_y); + int16_t max_x_q = quantize_up (draw->ext_max_x); + int16_t max_y_q = quantize_up (draw->ext_max_y); + + double min_x = dequantize (min_x_q); + double min_y = dequantize (min_y_q); + double max_x = dequantize (max_x_q); + double max_y = dequantize (max_y_q); + + for (unsigned i = 0; i < num_curves; i++) + s.curve_infos.arrayZ[i] = encode_curve_info (&curves[i]); + + /* Choose number of bands (capped at 16 per Slug paper) */ + unsigned num_hbands = hb_min (num_curves, 16u); + unsigned num_vbands = hb_min (num_curves, 16u); + num_hbands = hb_max (num_hbands, 1u); + num_vbands = hb_max (num_vbands, 1u); + + double height = max_y - min_y; + double width = max_x - min_x; + + if (height <= 0) num_hbands = 1; + if (width <= 0) num_vbands = 1; + + double hband_size = height / num_hbands; + double vband_size = width / num_vbands; + + if (unlikely (!s.hband_curve_counts.resize (num_hbands) || + !s.vband_curve_counts.resize (num_vbands))) + return nullptr; + + for (unsigned b = 0; b < num_hbands; b++) s.hband_curve_counts.arrayZ[b] = 0; + for (unsigned b = 0; b < num_vbands; b++) s.vband_curve_counts.arrayZ[b] = 0; + + for (unsigned i = 0; i < num_curves; i++) + { + hb_gpu_encode_curve_info_t &info = s.curve_infos.arrayZ[i]; + + if (!info.is_horizontal) + { + if (height > 0) { + info.hband_lo = (int) floor ((info.min_y - min_y) / hband_size); + info.hband_hi = (int) floor ((info.max_y - min_y) / hband_size); + info.hband_lo = hb_max (info.hband_lo, 0); + info.hband_hi = hb_min (info.hband_hi, (int) num_hbands - 1); + for (int b = info.hband_lo; b <= info.hband_hi; b++) + s.hband_curve_counts.arrayZ[b]++; + } else { + info.hband_lo = 0; + info.hband_hi = 0; + s.hband_curve_counts.arrayZ[0]++; + } + } + + if (!info.is_vertical) + { + if (width > 0) { + info.vband_lo = (int) floor ((info.min_x - min_x) / vband_size); + info.vband_hi = (int) floor ((info.max_x - min_x) / vband_size); + info.vband_lo = hb_max (info.vband_lo, 0); + info.vband_hi = hb_min (info.vband_hi, (int) num_vbands - 1); + for (int b = info.vband_lo; b <= info.vband_hi; b++) + s.vband_curve_counts.arrayZ[b]++; + } else { + info.vband_lo = 0; + info.vband_hi = 0; + s.vband_curve_counts.arrayZ[0]++; + } + } + } + + if (unlikely (!s.hband_offsets.resize (num_hbands) || + !s.vband_offsets.resize (num_vbands))) + return nullptr; + + unsigned total_hband_indices = 0; + unsigned total_vband_indices = 0; + + for (unsigned b = 0; b < num_hbands; b++) { + s.hband_offsets.arrayZ[b] = total_hband_indices; + if (unlikely (hb_unsigned_add_overflows (total_hband_indices, + s.hband_curve_counts.arrayZ[b], + &total_hband_indices))) + return nullptr; + } + + for (unsigned b = 0; b < num_vbands; b++) { + s.vband_offsets.arrayZ[b] = total_vband_indices; + if (unlikely (hb_unsigned_add_overflows (total_vband_indices, + s.vband_curve_counts.arrayZ[b], + &total_vband_indices))) + return nullptr; + } + + /* Assign curves to bands */ + if (unlikely (!s.hband_curves.resize (total_hband_indices) || + !s.hband_curves_asc.resize (total_hband_indices) || + !s.vband_curves.resize (total_vband_indices) || + !s.vband_curves_asc.resize (total_vband_indices) || + !s.hband_cursors.resize (num_hbands) || + !s.vband_cursors.resize (num_vbands))) + return nullptr; + + for (unsigned b = 0; b < num_hbands; b++) s.hband_cursors.arrayZ[b] = s.hband_offsets.arrayZ[b]; + for (unsigned b = 0; b < num_vbands; b++) s.vband_cursors.arrayZ[b] = s.vband_offsets.arrayZ[b]; + + for (unsigned i = 0; i < num_curves; i++) + { + const hb_gpu_encode_curve_info_t &info = s.curve_infos.arrayZ[i]; + + for (int b = info.hband_lo; b <= info.hband_hi; b++) { + unsigned idx = s.hband_cursors.arrayZ[b]++; + s.hband_curves.arrayZ[idx] = i; + s.hband_curves_asc.arrayZ[idx] = i; + } + + for (int b = info.vband_lo; b <= info.vband_hi; b++) { + unsigned idx = s.vband_cursors.arrayZ[b]++; + s.vband_curves.arrayZ[idx] = i; + s.vband_curves_asc.arrayZ[idx] = i; + } + } + + /* Sort: descending by max, ascending by min */ + const hb_gpu_encode_curve_info_t *infos = s.curve_infos.arrayZ; + + for (unsigned b = 0; b < num_hbands; b++) + { + unsigned off = s.hband_offsets.arrayZ[b]; + unsigned count = s.hband_curve_counts.arrayZ[b]; + s.hband_curves.as_array ().sub_array (off, count) + .qsort ([infos] (const unsigned &a, const unsigned &b) { + return infos[a].max_x > infos[b].max_x; + }); + s.hband_curves_asc.as_array ().sub_array (off, count) + .qsort ([infos] (const unsigned &a, const unsigned &b) { + return infos[a].min_x < infos[b].min_x; + }); + } + + for (unsigned b = 0; b < num_vbands; b++) + { + unsigned off = s.vband_offsets.arrayZ[b]; + unsigned count = s.vband_curve_counts.arrayZ[b]; + s.vband_curves.as_array ().sub_array (off, count) + .qsort ([infos] (const unsigned &a, const unsigned &b) { + return infos[a].max_y > infos[b].max_y; + }); + s.vband_curves_asc.as_array ().sub_array (off, count) + .qsort ([infos] (const unsigned &a, const unsigned &b) { + return infos[a].min_y < infos[b].min_y; + }); + } + + /* Compute sizes */ + unsigned total_curve_indices; + if (unlikely (hb_unsigned_add_overflows (total_hband_indices, + total_vband_indices, + &total_curve_indices) || + hb_unsigned_mul_overflows (total_curve_indices, + 2, + &total_curve_indices))) + return nullptr; + + unsigned header_len = 2; + + unsigned num_contour_breaks = 0; + for (unsigned i = 0; i + 1 < num_curves; i++) + if (curves[i + 1].contour_start) + num_contour_breaks++; + + unsigned curve_data_len; + if (unlikely (hb_unsigned_add_overflows (num_curves, + num_contour_breaks, + &curve_data_len) || + hb_unsigned_add_overflows (curve_data_len, + 1, + &curve_data_len))) + return nullptr; + + unsigned band_headers_len; + if (unlikely (hb_unsigned_add_overflows (num_hbands, + num_vbands, + &band_headers_len))) + return nullptr; + + unsigned total_len = header_len; + if (unlikely (hb_unsigned_add_overflows (total_len, + band_headers_len, + &total_len) || + hb_unsigned_add_overflows (total_len, + total_curve_indices, + &total_len) || + hb_unsigned_add_overflows (total_len, + curve_data_len, + &total_len))) + return nullptr; + + /* Validate fits in uint16 offsets (stored as int16 with bias) */ + if (total_len > (unsigned) UINT16_MAX + 1u) + return nullptr; + + if (!quantize_down_fits_i16 (draw->ext_min_x) || + !quantize_down_fits_i16 (draw->ext_min_y) || + !quantize_up_fits_i16 (draw->ext_max_x) || + !quantize_up_fits_i16 (draw->ext_max_y)) + return nullptr; + + /* Allocate or reuse encode buffer */ + unsigned needed_bytes; + if (unlikely (hb_unsigned_mul_overflows (total_len, + sizeof (hb_gpu_texel_t), + &needed_bytes))) + return nullptr; + unsigned buf_capacity = 0; + char *replaced_recycled_buf = nullptr; + char *buf_raw = hb_blob_t::recycle_acquire (draw->recycled_blob, needed_bytes, + &buf_capacity, &replaced_recycled_buf); + if (unlikely (!buf_raw)) + return nullptr; + hb_gpu_texel_t *buf = (hb_gpu_texel_t *) (void *) buf_raw; + + unsigned curve_data_offset = header_len; + if (unlikely (hb_unsigned_add_overflows (curve_data_offset, + band_headers_len, + &curve_data_offset) || + hb_unsigned_add_overflows (curve_data_offset, + total_curve_indices, + &curve_data_offset))) + { + hb_blob_t::recycle_abort ((char *) buf, draw->recycled_blob); + return nullptr; + } + + /* Pack header */ + buf[0].r = min_x_q; + buf[0].g = min_y_q; + buf[0].b = max_x_q; + buf[0].a = max_y_q; + buf[1].r = (int16_t) num_hbands; + buf[1].g = (int16_t) num_vbands; + buf[1].b = (int16_t) hb_clamp (draw->x_scale, -32768, 32767); + buf[1].a = (int16_t) hb_clamp (draw->y_scale, -32768, 32767); + + /* Pack curve data with shared endpoints */ + if (unlikely (!s.curve_texel_offset.resize (num_curves))) + { + hb_blob_t::recycle_abort ((char *) buf, draw->recycled_blob); + return nullptr; + } + + unsigned texel = curve_data_offset; + + for (unsigned i = 0; i < num_curves; i++) + { + bool contour_start = curves[i].contour_start; + + if (contour_start) { + s.curve_texel_offset.arrayZ[i] = texel; + buf[texel].r = quantize (curves[i].p1x); + buf[texel].g = quantize (curves[i].p1y); + buf[texel].b = quantize (curves[i].p2x); + buf[texel].a = quantize (curves[i].p2y); + texel++; + } else { + s.curve_texel_offset.arrayZ[i] = texel - 1; + } + + bool has_next = i + 1 < num_curves && + !curves[i + 1].contour_start; + + buf[texel].r = quantize (curves[i].p3x); + buf[texel].g = quantize (curves[i].p3y); + if (has_next) { + buf[texel].b = quantize (curves[i + 1].p2x); + buf[texel].a = quantize (curves[i + 1].p2y); + } else { + buf[texel].b = 0; + buf[texel].a = 0; + } + texel++; + } + + /* Pack band headers and curve indices */ + unsigned index_offset = header_len + band_headers_len; + + for (unsigned b = 0; b < num_hbands; b++) + { + int16_t hband_split; + { + unsigned off = s.hband_offsets.arrayZ[b]; + unsigned n = s.hband_curve_counts.arrayZ[b]; + unsigned best_worst = n; + double best_split = (min_x + max_x) * 0.5; + unsigned left_count = n; + for (unsigned ci = 0; ci < n; ci++) { + double split = s.curve_infos.arrayZ[s.hband_curves.arrayZ[off + ci]].max_x; + unsigned right_count = ci + 1; + while (left_count && + s.curve_infos.arrayZ[s.hband_curves_asc.arrayZ[off + left_count - 1]].min_x > split) + left_count--; + unsigned worst = hb_max (right_count, left_count); + if (worst < best_worst) { + best_worst = worst; + best_split = split; + } + } + hband_split = quantize (best_split); + } + unsigned hdr = header_len + b; + unsigned desc_off = index_offset; + + for (unsigned ci = 0; ci < s.hband_curve_counts.arrayZ[b]; ci++) { + buf[index_offset].r = encode_offset (s.curve_texel_offset.arrayZ[s.hband_curves.arrayZ[s.hband_offsets.arrayZ[b] + ci]]); + buf[index_offset].g = 0; + buf[index_offset].b = 0; + buf[index_offset].a = 0; + index_offset++; + } + + unsigned asc_off = index_offset; + + for (unsigned ci = 0; ci < s.hband_curve_counts.arrayZ[b]; ci++) { + buf[index_offset].r = encode_offset (s.curve_texel_offset.arrayZ[s.hband_curves_asc.arrayZ[s.hband_offsets.arrayZ[b] + ci]]); + buf[index_offset].g = 0; + buf[index_offset].b = 0; + buf[index_offset].a = 0; + index_offset++; + } + + buf[hdr].r = (int16_t) s.hband_curve_counts.arrayZ[b]; + buf[hdr].g = encode_offset (desc_off); + buf[hdr].b = encode_offset (asc_off); + buf[hdr].a = hband_split; + } + + for (unsigned b = 0; b < num_vbands; b++) + { + int16_t vband_split; + { + unsigned off = s.vband_offsets.arrayZ[b]; + unsigned n = s.vband_curve_counts.arrayZ[b]; + unsigned best_worst = n; + double best_split = (min_y + max_y) * 0.5; + unsigned left_count = n; + for (unsigned ci = 0; ci < n; ci++) { + double split = s.curve_infos.arrayZ[s.vband_curves.arrayZ[off + ci]].max_y; + unsigned right_count = ci + 1; + while (left_count && + s.curve_infos.arrayZ[s.vband_curves_asc.arrayZ[off + left_count - 1]].min_y > split) + left_count--; + unsigned worst = hb_max (right_count, left_count); + if (worst < best_worst) { + best_worst = worst; + best_split = split; + } + } + vband_split = quantize (best_split); + } + + unsigned hdr = header_len + num_hbands + b; + unsigned desc_off = index_offset; + + for (unsigned ci = 0; ci < s.vband_curve_counts.arrayZ[b]; ci++) { + buf[index_offset].r = encode_offset (s.curve_texel_offset.arrayZ[s.vband_curves.arrayZ[s.vband_offsets.arrayZ[b] + ci]]); + buf[index_offset].g = 0; + buf[index_offset].b = 0; + buf[index_offset].a = 0; + index_offset++; + } + + unsigned asc_off = index_offset; + + for (unsigned ci = 0; ci < s.vband_curve_counts.arrayZ[b]; ci++) { + buf[index_offset].r = encode_offset (s.curve_texel_offset.arrayZ[s.vband_curves_asc.arrayZ[s.vband_offsets.arrayZ[b] + ci]]); + buf[index_offset].g = 0; + buf[index_offset].b = 0; + buf[index_offset].a = 0; + index_offset++; + } + + buf[hdr].r = (int16_t) s.vband_curve_counts.arrayZ[b]; + buf[hdr].g = encode_offset (desc_off); + buf[hdr].b = encode_offset (asc_off); + buf[hdr].a = vband_split; + } + + hb_blob_t *recycled = draw->recycled_blob; + draw->recycled_blob = nullptr; + return hb_blob_t::recycle_finalize ((char *) buf, buf_capacity, needed_bytes, + recycled, replaced_recycled_buf); +} + + +/* ---- Public API ---- */ + +/** + * hb_gpu_draw_create_or_fail: + * + * Creates a new GPU shape encoder. + * + * Return value: (transfer full): + * A newly allocated #hb_gpu_draw_t, or `NULL` on allocation failure. + * + * Since: 14.0.0 + **/ +hb_gpu_draw_t * +hb_gpu_draw_create_or_fail (void) +{ + return hb_object_create (); +} + +/** + * hb_gpu_draw_reference: (skip) + * @draw: a GPU shape encoder + * + * Increases the reference count on @draw by one. + * + * Return value: (transfer full): + * The referenced #hb_gpu_draw_t. + * + * Since: 14.0.0 + **/ +hb_gpu_draw_t * +hb_gpu_draw_reference (hb_gpu_draw_t *draw) +{ + return hb_object_reference (draw); +} + +/** + * hb_gpu_draw_destroy: (skip) + * @draw: a GPU shape encoder + * + * Decreases the reference count on @draw by one. When the + * reference count reaches zero, the encoder is freed. + * + * Since: 14.0.0 + **/ +void +hb_gpu_draw_destroy (hb_gpu_draw_t *draw) +{ + if (!hb_object_should_destroy (draw)) + return; + + hb_blob_destroy (draw->recycled_blob); + + hb_object_actually_destroy (draw); + hb_free (draw); +} + +/** + * hb_gpu_draw_set_user_data: (skip) + * @draw: a GPU shape encoder + * @key: the user-data key + * @data: a pointer to the user data + * @destroy: (nullable): a callback to call when @data is not needed anymore + * @replace: whether to replace an existing data with the same key + * + * Attaches user data to @draw. + * + * Return value: `true` if success, `false` otherwise + * + * Since: 14.0.0 + **/ +hb_bool_t +hb_gpu_draw_set_user_data (hb_gpu_draw_t *draw, + hb_user_data_key_t *key, + void *data, + hb_destroy_func_t destroy, + hb_bool_t replace) +{ + return hb_object_set_user_data (draw, key, data, destroy, replace); +} + +/** + * hb_gpu_draw_get_user_data: (skip) + * @draw: a GPU shape encoder + * @key: the user-data key + * + * Fetches the user-data associated with the specified key. + * + * Return value: (transfer none): + * A pointer to the user data + * + * Since: 14.0.0 + **/ +void * +hb_gpu_draw_get_user_data (const hb_gpu_draw_t *draw, + hb_user_data_key_t *key) +{ + return hb_object_get_user_data (draw, key); +} + +/** + * hb_gpu_draw_get_funcs: + * @draw: a GPU draw context. + * + * Fetches the #hb_draw_funcs_t that feeds outline data into + * @draw. Pass @draw as the @draw_data argument when calling + * the draw functions. + * + * Return value: (transfer none): + * The GPU draw functions + * + * Since: 14.2.0 + **/ +hb_draw_funcs_t * +hb_gpu_draw_get_funcs (const hb_gpu_draw_t *draw HB_UNUSED) +{ + return static_gpu_draw_funcs.get_unconst (); +} + +/** + * hb_gpu_draw_set_scale: + * @draw: a GPU shape encoder + * @x_scale: horizontal scale (typically from hb_font_get_scale()) + * @y_scale: vertical scale + * + * Sets the font scale so the encoded blob can embed it for + * shader use (e.g. computing pixels-per-em). Called + * automatically by hb_gpu_draw_glyph(). + * + * Since: 14.1.0 + **/ +void +hb_gpu_draw_set_scale (hb_gpu_draw_t *draw, + int x_scale, + int y_scale) +{ + draw->x_scale = x_scale; + draw->y_scale = y_scale; +} + +/** + * hb_gpu_draw_get_scale: + * @draw: a GPU shape encoder + * @x_scale: (out): horizontal scale + * @y_scale: (out): vertical scale + * + * Gets the font scale previously set via hb_gpu_draw_set_scale() or + * hb_gpu_draw_glyph(). + * + * Since: 14.2.0 + **/ +void +hb_gpu_draw_get_scale (const hb_gpu_draw_t *draw, + int *x_scale, + int *y_scale) +{ + if (x_scale) *x_scale = draw->x_scale; + if (y_scale) *y_scale = draw->y_scale; +} + +/** + * hb_gpu_draw_glyph_or_fail: + * @draw: a GPU shape encoder + * @font: font to draw from + * @glyph: glyph ID to draw + * + * Convenience to draw one glyph outline. Equivalent to: + * + * |[ + * hb_gpu_draw_set_scale (draw, x_scale, y_scale); + * hb_font_draw_glyph_or_fail (font, glyph, + * hb_gpu_draw_get_funcs (draw), draw); + * ]| + * + * Return value: `true` if the glyph was drawn, `false` if the font + * has no outlines for @glyph. + * + * Since: 14.2.0 + **/ +hb_bool_t +hb_gpu_draw_glyph_or_fail (hb_gpu_draw_t *draw, + hb_font_t *font, + hb_codepoint_t glyph) +{ + int x_scale, y_scale; + hb_font_get_scale (font, &x_scale, &y_scale); + hb_gpu_draw_set_scale (draw, x_scale, y_scale); + + return hb_font_draw_glyph_or_fail (font, glyph, + hb_gpu_draw_get_funcs (draw), + draw); +} + +/** + * hb_gpu_draw_glyph: + * @draw: a GPU shape encoder + * @font: font to draw from + * @glyph: glyph ID to draw + * + * Draws a single glyph outline into the encoder. Equivalent to + * hb_gpu_draw_glyph_or_fail() with the return value ignored. + * + * Since: 14.0.0 + **/ +void +hb_gpu_draw_glyph (hb_gpu_draw_t *draw, + hb_font_t *font, + hb_codepoint_t glyph) +{ + hb_gpu_draw_glyph_or_fail (draw, font, glyph); +} + +/** + * hb_gpu_draw_clear: + * @draw: a GPU shape encoder + * + * Discards accumulated outlines so @draw can be reused for another + * encode. User configuration (font scale) is preserved. Call + * hb_gpu_draw_reset() to also reset user configuration to defaults. + * + * Since: 14.2.0 + **/ +void +hb_gpu_draw_clear (hb_gpu_draw_t *draw) +{ + draw->start_x = draw->start_y = 0; + draw->current_x = draw->current_y = 0; + draw->need_moveto = true; + draw->num_curves = 0; + draw->success = true; + draw->curves.reset (); + + draw->ext_min_x = HUGE_VAL; + draw->ext_min_y = HUGE_VAL; + draw->ext_max_x = -HUGE_VAL; + draw->ext_max_y = -HUGE_VAL; +} + +/** + * hb_gpu_draw_reset: + * @draw: a GPU shape encoder + * + * Resets the encoder, discarding all accumulated outlines and + * resetting user configuration to defaults. + * + * Since: 14.0.0 + **/ +void +hb_gpu_draw_reset (hb_gpu_draw_t *draw) +{ + draw->x_scale = 0; + draw->y_scale = 0; + hb_gpu_draw_clear (draw); +} + +/** + * hb_gpu_draw_recycle_blob: + * @draw: a GPU shape encoder + * @blob: (transfer full): a blob previously returned by hb_gpu_draw_encode() + * + * Returns a blob to the encoder for potential reuse. + * The caller transfers ownership of @blob. + * + * Currently this simply destroys the blob. A future version + * may reclaim the underlying buffer to avoid allocation on the + * next hb_gpu_draw_encode() call. + * + * Since: 14.0.0 + **/ +void +hb_gpu_draw_recycle_blob (hb_gpu_draw_t *draw, + hb_blob_t *blob) +{ + hb_blob_t::recycle_stash (&draw->recycled_blob, blob); +} + + +#include "hb-gpu-draw-fragment-glsl.hh" +#include "hb-gpu-draw-fragment-msl.hh" +#include "hb-gpu-draw-fragment-wgsl.hh" +#include "hb-gpu-draw-fragment-hlsl.hh" + +/** + * hb_gpu_draw_shader_source: + * @stage: pipeline stage (vertex or fragment) + * @lang: shader language variant + * + * Returns the draw-renderer-specific shader source for the + * specified stage and language. The returned string is static + * and must not be freed. + * + * This source assumes the shared helpers returned by + * hb_gpu_shader_source() are concatenated ahead of it. The + * caller should assemble the full shader as + * `#version`-directive + hb_gpu_shader_source() + + * hb_gpu_draw_shader_source() + caller's `main()`. + * + * The vertex stage currently has no draw-specific helpers; this + * function returns an empty string for that stage so the caller + * can concatenate unconditionally. + * + * Return value: (transfer none): + * A shader source string, or `NULL` if @stage or @lang is + * unsupported. + * + * Since: 14.2.0 + **/ +const char * +hb_gpu_draw_shader_source (hb_gpu_shader_stage_t stage, + hb_gpu_shader_lang_t lang) +{ + switch (stage) { + case HB_GPU_SHADER_STAGE_FRAGMENT: + switch (lang) { + case HB_GPU_SHADER_LANG_GLSL: return hb_gpu_draw_fragment_glsl; + case HB_GPU_SHADER_LANG_MSL: return hb_gpu_draw_fragment_msl; + case HB_GPU_SHADER_LANG_WGSL: return hb_gpu_draw_fragment_wgsl; + case HB_GPU_SHADER_LANG_HLSL: return hb_gpu_draw_fragment_hlsl; + case HB_GPU_SHADER_LANG_INVALID: + default: return nullptr; + } + case HB_GPU_SHADER_STAGE_VERTEX: + switch (lang) { + case HB_GPU_SHADER_LANG_GLSL: + case HB_GPU_SHADER_LANG_MSL: + case HB_GPU_SHADER_LANG_WGSL: + case HB_GPU_SHADER_LANG_HLSL: return ""; + case HB_GPU_SHADER_LANG_INVALID: + default: return nullptr; + } + default: + return nullptr; + } +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw.hh new file mode 100644 index 0000000000..df67647df8 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-draw.hh @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Author(s): Behdad Esfahbod + */ + +#ifndef HB_GPU_DRAW_HH +#define HB_GPU_DRAW_HH + +#include "hb.hh" +#include "hb-gpu.h" +#include "hb-object.hh" +#include "hb-vector.hh" + +#include + + +#define HB_GPU_UNITS_PER_EM 4 + + +struct hb_gpu_curve_t +{ + double p1x, p1y; + double p2x, p2y; + double p3x, p3y; + bool contour_start; +}; + +struct hb_gpu_encode_curve_info_t +{ + double min_x, max_x, min_y, max_y; + bool is_horizontal; + bool is_vertical; + int hband_lo, hband_hi; + int vband_lo, vband_hi; +}; + +struct hb_gpu_encode_scratch_t +{ + hb_vector_t curve_infos; + hb_vector_t hband_curve_counts; + hb_vector_t vband_curve_counts; + hb_vector_t hband_offsets; + hb_vector_t vband_offsets; + hb_vector_t hband_curves; + hb_vector_t hband_curves_asc; + hb_vector_t vband_curves; + hb_vector_t vband_curves_asc; + hb_vector_t hband_cursors; + hb_vector_t vband_cursors; + hb_vector_t curve_texel_offset; + + void clear () + { + curve_infos.clear (); + hband_curve_counts.clear (); + vband_curve_counts.clear (); + hband_offsets.clear (); + vband_offsets.clear (); + hband_curves.clear (); + hband_curves_asc.clear (); + vband_curves.clear (); + vband_curves_asc.clear (); + hband_cursors.clear (); + vband_cursors.clear (); + curve_texel_offset.clear (); + } +}; + +struct hb_gpu_draw_t +{ + hb_object_header_t header; + + /* Accumulator state */ + double start_x = 0, start_y = 0; + double current_x = 0, current_y = 0; + bool need_moveto = true; + unsigned num_curves = 0; + bool success = true; + + hb_vector_t curves; + + /* Extents tracking (updated during accumulation) */ + double ext_min_x = HUGE_VAL; + double ext_min_y = HUGE_VAL; + double ext_max_x = -HUGE_VAL; + double ext_max_y = -HUGE_VAL; + + /* Font scale (set by hb_gpu_draw_set_scale or hb_gpu_draw_glyph). */ + int x_scale = 0; + int y_scale = 0; + + /* Encode scratch (reused across calls) */ + hb_gpu_encode_scratch_t scratch; + + /* Recycled blob for encode output */ + hb_blob_t *recycled_blob = nullptr; + + /* Internal accumulation methods */ + HB_INTERNAL void acc_move_to (double x, double y); + HB_INTERNAL void acc_line_to (double x, double y); + HB_INTERNAL void acc_conic_to (double cx, double cy, double x, double y); + HB_INTERNAL void acc_cubic_to (double c1x, double c1y, + double c2x, double c2y, + double x, double y); + HB_INTERNAL void acc_close_path (); +}; + + +#endif /* HB_GPU_DRAW_HH */ diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment-glsl.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment-glsl.hh new file mode 100644 index 0000000000..c7356fede5 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment-glsl.hh @@ -0,0 +1,341 @@ +static const char *hb_gpu_fragment_glsl = +"/*\n" +" * Copyright (C) 2026 Behdad Esfahbod\n" +" * Copyright (C) 2017 Eric Lengyel\n" +" *\n" +" * The _hb_gpu_slug body below is based on the Slug algorithm by\n" +" * Eric Lengyel: https://github.com/EricLengyel/Slug\n" +" *\n" +" * This is part of HarfBuzz, a text shaping library.\n" +" *\n" +" * Permission is hereby granted, without written agreement and without\n" +" * license or royalty fees, to use, copy, modify, and distribute this\n" +" * software and its documentation for any purpose, provided that the\n" +" * above copyright notice and the following two paragraphs appear in\n" +" * all copies of this software.\n" +" *\n" +" * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\n" +" * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\n" +" * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\n" +" * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n" +" * DAMAGE.\n" +" *\n" +" * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\n" +" * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n" +" * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n" +" * ON AN \"AS IS\" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\n" +" * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n" +" */\n" +"\n" +"\n" +"/* Shared fragment-shader helpers for the hb-gpu renderers.\n" +" *\n" +" * Requires GLSL 3.30 or GLSL ES 3.00.\n" +" *\n" +" * For GLSL ES 3.00 / WebGL2, define HB_GPU_ATLAS_2D before\n" +" * including this source. The atlas is then a 2D isampler2D\n" +" * texture of known width (set via hb_gpu_atlas_width uniform)\n" +" * instead of an isamplerBuffer.\n" +" *\n" +" * Exports:\n" +" * hb_gpu_fetch (offset) atlas lookup\n" +" * _hb_gpu_slug (rc, pixelsPerEm, glyphLoc) MSAA-aware Slug\n" +" * coverage (caller supplies\n" +" * pixelsPerEm so it can be\n" +" * invoked from non-uniform\n" +" * control flow)\n" +" * hb_gpu_ppem (rc, glyphLoc) pixels per em at fragment\n" +" * _hb_gpu_curve_counts (rc, glyphLoc) debug: per-pixel curve counts\n" +" * hb_gpu_stem_darken (cov, brightness, ppem) thin-stroke contrast\n" +" * correction\n" +" */\n" +"\n" +"\n" +"#ifndef HB_GPU_UNITS_PER_EM\n" +"#define HB_GPU_UNITS_PER_EM 4\n" +"#endif\n" +"\n" +"#define HB_GPU_INV_UNITS float(1.0 / float(HB_GPU_UNITS_PER_EM))\n" +"\n" +"\n" +"#ifdef HB_GPU_ATLAS_2D\n" +"uniform highp isampler2D hb_gpu_atlas;\n" +"uniform int hb_gpu_atlas_width;\n" +"ivec4 hb_gpu_fetch (int offset)\n" +"{\n" +" return texelFetch (hb_gpu_atlas,\n" +" ivec2 (offset % hb_gpu_atlas_width,\n" +" offset / hb_gpu_atlas_width), 0);\n" +"}\n" +"#else\n" +"uniform isamplerBuffer hb_gpu_atlas;\n" +"ivec4 hb_gpu_fetch (int offset)\n" +"{\n" +" return texelFetch (hb_gpu_atlas, offset);\n" +"}\n" +"#endif\n" +"\n" +"\n" +"uint _hb_gpu_calc_root_code (float y1, float y2, float y3)\n" +"{\n" +" uint i1 = floatBitsToUint (y1) >> 31U;\n" +" uint i2 = floatBitsToUint (y2) >> 30U;\n" +" uint i3 = floatBitsToUint (y3) >> 29U;\n" +"\n" +" uint shift = (i2 & 2U) | (i1 & ~2U);\n" +" shift = (i3 & 4U) | (shift & ~4U);\n" +"\n" +" return (0x2E74U >> shift) & 0x0101U;\n" +"}\n" +"\n" +"vec2 _hb_gpu_solve_horiz_poly (vec2 a, vec2 b, vec2 p1)\n" +"{\n" +" float ra = 1.0 / a.y;\n" +" float rb = 0.5 / b.y;\n" +"\n" +" float d = sqrt (max (b.y * b.y - a.y * p1.y, 0.0));\n" +" float t1 = (b.y - d) * ra;\n" +" float t2 = (b.y + d) * ra;\n" +"\n" +" if (a.y == 0.0)\n" +" t1 = t2 = p1.y * rb;\n" +"\n" +" return vec2 ((a.x * t1 - b.x * 2.0) * t1 + p1.x,\n" +" (a.x * t2 - b.x * 2.0) * t2 + p1.x);\n" +"}\n" +"\n" +"vec2 _hb_gpu_solve_vert_poly (vec2 a, vec2 b, vec2 p1)\n" +"{\n" +" float ra = 1.0 / a.x;\n" +" float rb = 0.5 / b.x;\n" +"\n" +" float d = sqrt (max (b.x * b.x - a.x * p1.x, 0.0));\n" +" float t1 = (b.x - d) * ra;\n" +" float t2 = (b.x + d) * ra;\n" +"\n" +" if (a.x == 0.0)\n" +" t1 = t2 = p1.x * rb;\n" +"\n" +" return vec2 ((a.y * t1 - b.y * 2.0) * t1 + p1.y,\n" +" (a.y * t2 - b.y * 2.0) * t2 + p1.y);\n" +"}\n" +"\n" +"float _hb_gpu_calc_coverage (float xcov, float ycov, float xwgt, float ywgt)\n" +"{\n" +" float coverage = max (abs (xcov * xwgt + ycov * ywgt) /\n" +" max (xwgt + ywgt, 1.0 / 65536.0),\n" +" min (abs (xcov), abs (ycov)));\n" +"\n" +" return clamp (coverage, 0.0, 1.0);\n" +"}\n" +"\n" +"/* Decoded glyph band info for a pixel position. */\n" +"struct _hb_gpu_glyph_info\n" +"{\n" +" int glyphLoc;\n" +" int bandBase;\n" +" ivec2 bandIndex;\n" +" int numHBands;\n" +" int numVBands;\n" +" vec2 scale;\n" +"};\n" +"\n" +"_hb_gpu_glyph_info _hb_gpu_decode_glyph (vec2 renderCoord, uint glyphLoc_)\n" +"{\n" +" _hb_gpu_glyph_info gi;\n" +" gi.glyphLoc = int (glyphLoc_);\n" +"\n" +" ivec4 header0 = hb_gpu_fetch (gi.glyphLoc);\n" +" ivec4 header1 = hb_gpu_fetch (gi.glyphLoc + 1);\n" +" vec4 ext = vec4 (header0) * HB_GPU_INV_UNITS;\n" +" gi.numHBands = header1.r;\n" +" gi.numVBands = header1.g;\n" +" gi.scale = vec2 (float (header1.b), float (header1.a));\n" +"\n" +" vec2 extSize = ext.zw - ext.xy;\n" +" vec2 bandScale = vec2 (float (gi.numVBands), float (gi.numHBands)) / max (extSize, vec2 (1.0 / 65536.0));\n" +" vec2 bandOffset = -ext.xy * bandScale;\n" +"\n" +" gi.bandIndex = clamp (ivec2 (renderCoord * bandScale + bandOffset),\n" +" ivec2 (0, 0),\n" +" ivec2 (gi.numVBands - 1, gi.numHBands - 1));\n" +"\n" +" gi.bandBase = gi.glyphLoc + 2;\n" +" return gi;\n" +"}\n" +"\n" +"/* Return pixels per em at this fragment. */\n" +"float hb_gpu_ppem (vec2 renderCoord, uint glyphLoc_)\n" +"{\n" +" _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_);\n" +" vec2 emsPerPixel = fwidth (renderCoord);\n" +" return min (gi.scale.x, gi.scale.y) /\n" +" max (emsPerPixel.x, emsPerPixel.y);\n" +"}\n" +"\n" +"/* Return per-pixel curve counts: (horizontal, vertical). */\n" +"ivec2 _hb_gpu_curve_counts (vec2 renderCoord, uint glyphLoc_)\n" +"{\n" +" _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_);\n" +" int hCount = hb_gpu_fetch (gi.bandBase + gi.bandIndex.y).r;\n" +" int vCount = hb_gpu_fetch (gi.bandBase + gi.numHBands + gi.bandIndex.x).r;\n" +" return ivec2 (hCount, vCount);\n" +"}\n" +"\n" +"/* Single-sample coverage in [0, 1]. */\n" +"float _hb_gpu_slug_single (vec2 renderCoord, vec2 pixelsPerEm, uint glyphLoc_)\n" +"{\n" +"\n" +" _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_);\n" +" int glyphLoc = gi.glyphLoc;\n" +" int bandBase = gi.bandBase;\n" +" int numHBands = gi.numHBands;\n" +"\n" +" float xcov = 0.0;\n" +" float xwgt = 0.0;\n" +"\n" +" ivec4 hbandData = hb_gpu_fetch (bandBase + gi.bandIndex.y);\n" +" int hCurveCount = hbandData.r;\n" +" /* Symmetric: choose rightward (desc) or leftward (asc) sort */\n" +" float hSplit = float (hbandData.a) * HB_GPU_INV_UNITS;\n" +" bool hLeftRay = (renderCoord.x < hSplit);\n" +" int hDataOffset = (hLeftRay ? hbandData.b : hbandData.g) + 32768;\n" +"\n" +" for (int ci = 0; ci < hCurveCount; ci++)\n" +" {\n" +" int curveOffset = hb_gpu_fetch (glyphLoc + hDataOffset + ci).r + 32768;\n" +"\n" +" ivec4 raw12 = hb_gpu_fetch (glyphLoc + curveOffset);\n" +" ivec4 raw3 = hb_gpu_fetch (glyphLoc + curveOffset + 1);\n" +"\n" +" vec4 q12 = vec4 (raw12) * HB_GPU_INV_UNITS;\n" +" vec2 q3 = vec2 (raw3.rg) * HB_GPU_INV_UNITS;\n" +"\n" +" vec4 p12 = q12 - vec4 (renderCoord, renderCoord);\n" +" vec2 p3 = q3 - renderCoord;\n" +"\n" +" if (hLeftRay) {\n" +" if (min (min (p12.x, p12.z), p3.x) * pixelsPerEm.x > 0.5) break;\n" +" } else {\n" +" if (max (max (p12.x, p12.z), p3.x) * pixelsPerEm.x < -0.5) break;\n" +" }\n" +"\n" +" uint code = _hb_gpu_calc_root_code (p12.y, p12.w, p3.y);\n" +" if (code != 0U)\n" +" {\n" +" vec2 a = q12.xy - q12.zw * 2.0 + q3;\n" +" vec2 b = q12.xy - q12.zw;\n" +" vec2 r = _hb_gpu_solve_horiz_poly (a, b, p12.xy) * pixelsPerEm.x;\n" +" /* For leftward ray: saturate(0.5 - r) counts coverage from the left */\n" +" vec2 cov = hLeftRay ? clamp (vec2 (0.5) - r, 0.0, 1.0)\n" +" : clamp (r + vec2 (0.5), 0.0, 1.0);\n" +"\n" +" if ((code & 1U) != 0U)\n" +" {\n" +" xcov += cov.x;\n" +" xwgt = max (xwgt, clamp (1.0 - abs (r.x) * 2.0, 0.0, 1.0));\n" +" }\n" +"\n" +" if (code > 1U)\n" +" {\n" +" xcov -= cov.y;\n" +" xwgt = max (xwgt, clamp (1.0 - abs (r.y) * 2.0, 0.0, 1.0));\n" +" }\n" +" }\n" +" }\n" +"\n" +" float ycov = 0.0;\n" +" float ywgt = 0.0;\n" +"\n" +" ivec4 vbandData = hb_gpu_fetch (bandBase + numHBands + gi.bandIndex.x);\n" +" int vCurveCount = vbandData.r;\n" +" float vSplit = float (vbandData.a) * HB_GPU_INV_UNITS;\n" +" bool vLeftRay = (renderCoord.y < vSplit);\n" +" int vDataOffset = (vLeftRay ? vbandData.b : vbandData.g) + 32768;\n" +"\n" +" for (int ci = 0; ci < vCurveCount; ci++)\n" +" {\n" +" int curveOffset = hb_gpu_fetch (glyphLoc + vDataOffset + ci).r + 32768;\n" +"\n" +" ivec4 raw12 = hb_gpu_fetch (glyphLoc + curveOffset);\n" +" ivec4 raw3 = hb_gpu_fetch (glyphLoc + curveOffset + 1);\n" +"\n" +" vec4 q12 = vec4 (raw12) * HB_GPU_INV_UNITS;\n" +" vec2 q3 = vec2 (raw3.rg) * HB_GPU_INV_UNITS;\n" +"\n" +" vec4 p12 = q12 - vec4 (renderCoord, renderCoord);\n" +" vec2 p3 = q3 - renderCoord;\n" +"\n" +" if (vLeftRay) {\n" +" if (min (min (p12.y, p12.w), p3.y) * pixelsPerEm.y > 0.5) break;\n" +" } else {\n" +" if (max (max (p12.y, p12.w), p3.y) * pixelsPerEm.y < -0.5) break;\n" +" }\n" +"\n" +" uint code = _hb_gpu_calc_root_code (p12.x, p12.z, p3.x);\n" +" if (code != 0U)\n" +" {\n" +" vec2 a = q12.xy - q12.zw * 2.0 + q3;\n" +" vec2 b = q12.xy - q12.zw;\n" +" vec2 r = _hb_gpu_solve_vert_poly (a, b, p12.xy) * pixelsPerEm.y;\n" +" vec2 cov = vLeftRay ? clamp (vec2 (0.5) - r, 0.0, 1.0)\n" +" : clamp (r + vec2 (0.5), 0.0, 1.0);\n" +"\n" +" if ((code & 1U) != 0U)\n" +" {\n" +" ycov -= cov.x;\n" +" ywgt = max (ywgt, clamp (1.0 - abs (r.x) * 2.0, 0.0, 1.0));\n" +" }\n" +"\n" +" if (code > 1U)\n" +" {\n" +" ycov += cov.y;\n" +" ywgt = max (ywgt, clamp (1.0 - abs (r.y) * 2.0, 0.0, 1.0));\n" +" }\n" +" }\n" +" }\n" +"\n" +" return _hb_gpu_calc_coverage (xcov, ycov, xwgt, ywgt);\n" +"}\n" +"\n" +"/* MSAA-aware Slug coverage. Caller supplies pixelsPerEm so this\n" +" * function can be invoked from non-uniform control flow (for\n" +" * example inside an op-stream branch in hb-gpu-paint-fragment.wgsl,\n" +" * where WGSL would otherwise reject an fwidth call). */\n" +"float _hb_gpu_slug (vec2 renderCoord, vec2 pixelsPerEm, uint glyphLoc_)\n" +"{\n" +" float c = _hb_gpu_slug_single (renderCoord, pixelsPerEm, glyphLoc_);\n" +"\n" +"#ifndef HB_GPU_NO_MSAA\n" +" float ppem = hb_gpu_ppem (renderCoord, glyphLoc_);\n" +"\n" +" if (ppem < 16.0)\n" +" {\n" +" vec2 emsPerPixel = 1.0 / pixelsPerEm;\n" +" vec2 d = emsPerPixel * (1.0 / 3.0);\n" +" float msaa = 0.25 *\n" +" (_hb_gpu_slug_single (renderCoord + vec2 (-d.x, -d.y), pixelsPerEm, glyphLoc_) +\n" +" _hb_gpu_slug_single (renderCoord + vec2 ( d.x, -d.y), pixelsPerEm, glyphLoc_) +\n" +" _hb_gpu_slug_single (renderCoord + vec2 (-d.x, d.y), pixelsPerEm, glyphLoc_) +\n" +" _hb_gpu_slug_single (renderCoord + vec2 ( d.x, d.y), pixelsPerEm, glyphLoc_));\n" +"\n" +" c = mix (c, msaa, smoothstep (16.0, 8.0, ppem));\n" +" }\n" +"#endif\n" +"\n" +" return c;\n" +"}\n" +"\n" +"/* Stem darkening for small sizes.\n" +" *\n" +" * coverage: output of hb_gpu_draw / _hb_gpu_slug\n" +" * brightness: foreground brightness in [0, 1]\n" +" * ppem: pixels per em at this fragment\n" +" */\n" +"float hb_gpu_stem_darken (float coverage, float brightness, float ppem)\n" +"{\n" +" return pow (coverage,\n" +" mix (pow (2.0, brightness - 0.5), 1.0,\n" +" smoothstep (8.0, 48.0, ppem)));\n" +"}\n" +; diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment-hlsl.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment-hlsl.hh new file mode 100644 index 0000000000..bfe2c93011 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment-hlsl.hh @@ -0,0 +1,316 @@ +static const char *hb_gpu_fragment_hlsl = +"/*\n" +" * Copyright (C) 2026 Behdad Esfahbod\n" +" *\n" +" * This is part of HarfBuzz, a text shaping library.\n" +" *\n" +" * Permission is hereby granted, without written agreement and without\n" +" * license or royalty fees, to use, copy, modify, and distribute this\n" +" * software and its documentation for any purpose, provided that the\n" +" * above copyright notice and the following two paragraphs appear in\n" +" * all copies of this software.\n" +" *\n" +" * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\n" +" * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\n" +" * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\n" +" * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n" +" * DAMAGE.\n" +" *\n" +" * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\n" +" * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n" +" * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n" +" * ON AN \"AS IS\" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\n" +" * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n" +" */\n" +"\n" +"\n" +"/* Shared fragment-shader helpers for the hb-gpu renderers.\n" +" *\n" +" * Requires Shader Model 5.0+.\n" +" *\n" +" * The caller must declare:\n" +" * StructuredBuffer hb_gpu_atlas : register(t0);\n" +" */\n" +"\n" +"\n" +"#ifndef HB_GPU_UNITS_PER_EM\n" +"#define HB_GPU_UNITS_PER_EM 4\n" +"#endif\n" +"\n" +"#define HB_GPU_INV_UNITS (1.0 / (float) HB_GPU_UNITS_PER_EM)\n" +"\n" +"\n" +"int4 hb_gpu_fetch (int offset)\n" +"{\n" +" return hb_gpu_atlas[offset];\n" +"}\n" +"uint _hb_gpu_calc_root_code (float y1, float y2, float y3)\n" +"{\n" +" uint i1 = asuint (y1) >> 31u;\n" +" uint i2 = asuint (y2) >> 30u;\n" +" uint i3 = asuint (y3) >> 29u;\n" +"\n" +" uint shift = (i2 & 2u) | (i1 & ~2u);\n" +" shift = (i3 & 4u) | (shift & ~4u);\n" +"\n" +" return (0x2E74u >> shift) & 0x0101u;\n" +"}\n" +"\n" +"float2 _hb_gpu_solve_horiz_poly (float2 a, float2 b, float2 p1)\n" +"{\n" +" float ra = 1.0 / a.y;\n" +" float rb = 0.5 / b.y;\n" +"\n" +" float d = sqrt (max (b.y * b.y - a.y * p1.y, 0.0));\n" +" float t1 = (b.y - d) * ra;\n" +" float t2 = (b.y + d) * ra;\n" +"\n" +" if (a.y == 0.0)\n" +" t1 = t2 = p1.y * rb;\n" +"\n" +" return float2 ((a.x * t1 - b.x * 2.0) * t1 + p1.x,\n" +" (a.x * t2 - b.x * 2.0) * t2 + p1.x);\n" +"}\n" +"\n" +"float2 _hb_gpu_solve_vert_poly (float2 a, float2 b, float2 p1)\n" +"{\n" +" float ra = 1.0 / a.x;\n" +" float rb = 0.5 / b.x;\n" +"\n" +" float d = sqrt (max (b.x * b.x - a.x * p1.x, 0.0));\n" +" float t1 = (b.x - d) * ra;\n" +" float t2 = (b.x + d) * ra;\n" +"\n" +" if (a.x == 0.0)\n" +" t1 = t2 = p1.x * rb;\n" +"\n" +" return float2 ((a.y * t1 - b.y * 2.0) * t1 + p1.y,\n" +" (a.y * t2 - b.y * 2.0) * t2 + p1.y);\n" +"}\n" +"\n" +"float _hb_gpu_calc_coverage (float xcov, float ycov, float xwgt, float ywgt)\n" +"{\n" +" float coverage = max (abs (xcov * xwgt + ycov * ywgt) /\n" +" max (xwgt + ywgt, 1.0 / 65536.0),\n" +" min (abs (xcov), abs (ycov)));\n" +"\n" +" return clamp (coverage, 0.0, 1.0);\n" +"}\n" +"\n" +"\n" +"struct _hb_gpu_glyph_info\n" +"{\n" +" int glyphLoc;\n" +" int bandBase;\n" +" int2 bandIndex;\n" +" int numHBands;\n" +" int numVBands;\n" +" float2 scale;\n" +"};\n" +"\n" +"_hb_gpu_glyph_info _hb_gpu_decode_glyph (float2 renderCoord, uint glyphLoc_)\n" +"{\n" +" _hb_gpu_glyph_info gi;\n" +" gi.glyphLoc = (int) glyphLoc_;\n" +"\n" +" int4 header0 = hb_gpu_fetch (gi.glyphLoc);\n" +" int4 header1 = hb_gpu_fetch (gi.glyphLoc + 1);\n" +" float4 ext = (float4) header0 * HB_GPU_INV_UNITS;\n" +" gi.numHBands = header1.r;\n" +" gi.numVBands = header1.g;\n" +" gi.scale = float2 ((float) header1.b, (float) header1.a);\n" +"\n" +" float2 extSize = ext.zw - ext.xy;\n" +" float2 bandScale = float2 ((float) gi.numVBands, (float) gi.numHBands) / max (extSize, float2 (1.0 / 65536.0, 1.0 / 65536.0));\n" +" float2 bandOffset = -ext.xy * bandScale;\n" +"\n" +" gi.bandIndex = clamp ((int2) (renderCoord * bandScale + bandOffset),\n" +" int2 (0, 0),\n" +" int2 (gi.numVBands - 1, gi.numHBands - 1));\n" +"\n" +" gi.bandBase = gi.glyphLoc + 2;\n" +" return gi;\n" +"}\n" +"\n" +"/* Return pixels per em at this fragment.\n" +" *\n" +" * renderCoord: em-space sample position\n" +" * glyphLoc: texel offset of glyph blob in atlas\n" +" */\n" +"float hb_gpu_ppem (float2 renderCoord, uint glyphLoc_)\n" +"{\n" +" _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_);\n" +" float2 emsPerPixel = fwidth (renderCoord);\n" +" return min (gi.scale.x, gi.scale.y) /\n" +" max (emsPerPixel.x, emsPerPixel.y);\n" +"}\n" +"\n" +"int2 _hb_gpu_curve_counts (float2 renderCoord, uint glyphLoc_)\n" +"{\n" +" _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_);\n" +" int hCount = hb_gpu_fetch (gi.bandBase + gi.bandIndex.y).r;\n" +" int vCount = hb_gpu_fetch (gi.bandBase + gi.numHBands + gi.bandIndex.x).r;\n" +" return int2 (hCount, vCount);\n" +"}\n" +"\n" +"\n" +"/* Single-sample coverage in [0, 1]. */\n" +"float _hb_gpu_slug_single (float2 renderCoord, float2 pixelsPerEm, uint glyphLoc_)\n" +"{\n" +"\n" +" _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_);\n" +" int glyphLoc = gi.glyphLoc;\n" +" int bandBase = gi.bandBase;\n" +" int numHBands = gi.numHBands;\n" +"\n" +" float xcov = 0.0;\n" +" float xwgt = 0.0;\n" +"\n" +" int4 hbandData = hb_gpu_fetch (bandBase + gi.bandIndex.y);\n" +" int hCurveCount = hbandData.r;\n" +" float hSplit = (float) hbandData.a * HB_GPU_INV_UNITS;\n" +" bool hLeftRay = (renderCoord.x < hSplit);\n" +" int hDataOffset = (hLeftRay ? hbandData.b : hbandData.g) + 32768;\n" +"\n" +" for (int ci = 0; ci < hCurveCount; ci++)\n" +" {\n" +" int curveOffset = hb_gpu_fetch (glyphLoc + hDataOffset + ci).r + 32768;\n" +"\n" +" int4 raw12 = hb_gpu_fetch (glyphLoc + curveOffset);\n" +" int4 raw3 = hb_gpu_fetch (glyphLoc + curveOffset + 1);\n" +"\n" +" float4 q12 = (float4) raw12 * HB_GPU_INV_UNITS;\n" +" float2 q3 = (float2) raw3.rg * HB_GPU_INV_UNITS;\n" +"\n" +" float4 p12 = q12 - float4 (renderCoord, renderCoord);\n" +" float2 p3 = q3 - renderCoord;\n" +"\n" +" if (hLeftRay) {\n" +" if (min (min (p12.x, p12.z), p3.x) * pixelsPerEm.x > 0.5) break;\n" +" } else {\n" +" if (max (max (p12.x, p12.z), p3.x) * pixelsPerEm.x < -0.5) break;\n" +" }\n" +"\n" +" uint code = _hb_gpu_calc_root_code (p12.y, p12.w, p3.y);\n" +" if (code != 0u)\n" +" {\n" +" float2 a = q12.xy - q12.zw * 2.0 + q3;\n" +" float2 b = q12.xy - q12.zw;\n" +" float2 r = _hb_gpu_solve_horiz_poly (a, b, p12.xy) * pixelsPerEm.x;\n" +" float2 cov = hLeftRay ? clamp (float2 (0.5, 0.5) - r, 0.0, 1.0)\n" +" : clamp (r + float2 (0.5, 0.5), 0.0, 1.0);\n" +"\n" +" if ((code & 1u) != 0u)\n" +" {\n" +" xcov += cov.x;\n" +" xwgt = max (xwgt, clamp (1.0 - abs (r.x) * 2.0, 0.0, 1.0));\n" +" }\n" +"\n" +" if (code > 1u)\n" +" {\n" +" xcov -= cov.y;\n" +" xwgt = max (xwgt, clamp (1.0 - abs (r.y) * 2.0, 0.0, 1.0));\n" +" }\n" +" }\n" +" }\n" +"\n" +" float ycov = 0.0;\n" +" float ywgt = 0.0;\n" +"\n" +" int4 vbandData = hb_gpu_fetch (bandBase + numHBands + gi.bandIndex.x);\n" +" int vCurveCount = vbandData.r;\n" +" float vSplit = (float) vbandData.a * HB_GPU_INV_UNITS;\n" +" bool vLeftRay = (renderCoord.y < vSplit);\n" +" int vDataOffset = (vLeftRay ? vbandData.b : vbandData.g) + 32768;\n" +"\n" +" for (int ci = 0; ci < vCurveCount; ci++)\n" +" {\n" +" int curveOffset = hb_gpu_fetch (glyphLoc + vDataOffset + ci).r + 32768;\n" +"\n" +" int4 raw12 = hb_gpu_fetch (glyphLoc + curveOffset);\n" +" int4 raw3 = hb_gpu_fetch (glyphLoc + curveOffset + 1);\n" +"\n" +" float4 q12 = (float4) raw12 * HB_GPU_INV_UNITS;\n" +" float2 q3 = (float2) raw3.rg * HB_GPU_INV_UNITS;\n" +"\n" +" float4 p12 = q12 - float4 (renderCoord, renderCoord);\n" +" float2 p3 = q3 - renderCoord;\n" +"\n" +" if (vLeftRay) {\n" +" if (min (min (p12.y, p12.w), p3.y) * pixelsPerEm.y > 0.5) break;\n" +" } else {\n" +" if (max (max (p12.y, p12.w), p3.y) * pixelsPerEm.y < -0.5) break;\n" +" }\n" +"\n" +" uint code = _hb_gpu_calc_root_code (p12.x, p12.z, p3.x);\n" +" if (code != 0u)\n" +" {\n" +" float2 a = q12.xy - q12.zw * 2.0 + q3;\n" +" float2 b = q12.xy - q12.zw;\n" +" float2 r = _hb_gpu_solve_vert_poly (a, b, p12.xy) * pixelsPerEm.y;\n" +" float2 cov = vLeftRay ? clamp (float2 (0.5, 0.5) - r, 0.0, 1.0)\n" +" : clamp (r + float2 (0.5, 0.5), 0.0, 1.0);\n" +"\n" +" if ((code & 1u) != 0u)\n" +" {\n" +" ycov -= cov.x;\n" +" ywgt = max (ywgt, clamp (1.0 - abs (r.x) * 2.0, 0.0, 1.0));\n" +" }\n" +"\n" +" if (code > 1u)\n" +" {\n" +" ycov += cov.y;\n" +" ywgt = max (ywgt, clamp (1.0 - abs (r.y) * 2.0, 0.0, 1.0));\n" +" }\n" +" }\n" +" }\n" +"\n" +" return _hb_gpu_calc_coverage (xcov, ycov, xwgt, ywgt);\n" +"}\n" +"\n" +"/* Return coverage in [0, 1].\n" +" *\n" +" * Caller must declare: StructuredBuffer hb_gpu_atlas\n" +" *\n" +" * renderCoord: em-space sample position\n" +" * glyphLoc: texel offset of glyph blob in atlas\n" +" */\n" +"/* The MSAA-aware implementation. Caller supplies pixelsPerEm so\n" +" * this function can be invoked from non-uniform control flow (for\n" +" * example from a paint op-stream branch). */\n" +"float _hb_gpu_slug (float2 renderCoord, float2 pixelsPerEm, uint glyphLoc_)\n" +"{\n" +" float c = _hb_gpu_slug_single (renderCoord, pixelsPerEm, glyphLoc_);\n" +"\n" +"#ifndef HB_GPU_NO_MSAA\n" +" float ppem = hb_gpu_ppem (renderCoord, glyphLoc_);\n" +"\n" +" if (ppem < 16.0)\n" +" {\n" +" float2 emsPerPixel = 1.0 / pixelsPerEm;\n" +" float2 d = emsPerPixel * (1.0 / 3.0);\n" +" float msaa = 0.25 *\n" +" (_hb_gpu_slug_single (renderCoord + float2 (-d.x, -d.y), pixelsPerEm, glyphLoc_) +\n" +" _hb_gpu_slug_single (renderCoord + float2 ( d.x, -d.y), pixelsPerEm, glyphLoc_) +\n" +" _hb_gpu_slug_single (renderCoord + float2 (-d.x, d.y), pixelsPerEm, glyphLoc_) +\n" +" _hb_gpu_slug_single (renderCoord + float2 ( d.x, d.y), pixelsPerEm, glyphLoc_));\n" +"\n" +" c = lerp (c, msaa, smoothstep (16.0, 8.0, ppem));\n" +" }\n" +"#endif\n" +"\n" +" return c;\n" +"}\n" +"/* Stem darkening for small sizes.\n" +" *\n" +" * coverage: output of hb_gpu_draw\n" +" * brightness: foreground brightness in [0, 1]\n" +" * ppem: pixels per em at this fragment\n" +" */\n" +"float hb_gpu_stem_darken (float coverage, float brightness, float ppem)\n" +"{\n" +" return pow (coverage,\n" +" lerp (pow (2.0, brightness - 0.5), 1.0,\n" +" smoothstep (8.0, 48.0, ppem)));\n" +"}\n" +; diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment-msl.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment-msl.hh new file mode 100644 index 0000000000..e30a504214 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment-msl.hh @@ -0,0 +1,322 @@ +static const char *hb_gpu_fragment_msl = +"/*\n" +" * Copyright (C) 2026 Behdad Esfahbod\n" +" *\n" +" * This is part of HarfBuzz, a text shaping library.\n" +" *\n" +" * Permission is hereby granted, without written agreement and without\n" +" * license or royalty fees, to use, copy, modify, and distribute this\n" +" * software and its documentation for any purpose, provided that the\n" +" * above copyright notice and the following two paragraphs appear in\n" +" * all copies of this software.\n" +" *\n" +" * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\n" +" * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\n" +" * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\n" +" * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n" +" * DAMAGE.\n" +" *\n" +" * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\n" +" * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n" +" * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n" +" * ON AN \"AS IS\" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\n" +" * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n" +" */\n" +"\n" +"\n" +"/* Shared fragment-shader helpers for the hb-gpu renderers.\n" +" *\n" +" * Requires Metal Shading Language 2.0.\n" +" */\n" +"\n" +"\n" +"#ifndef HB_GPU_UNITS_PER_EM\n" +"#define HB_GPU_UNITS_PER_EM 4\n" +"#endif\n" +"\n" +"#define HB_GPU_INV_UNITS float(1.0 / float(HB_GPU_UNITS_PER_EM))\n" +"\n" +"\n" +"int4 hb_gpu_fetch (device const short4* hb_gpu_atlas, int offset)\n" +"{\n" +" return int4 (hb_gpu_atlas[offset]);\n" +"}\n" +"\n" +"uint _hb_gpu_calc_root_code (float y1, float y2, float y3)\n" +"{\n" +" uint i1 = as_type (y1) >> 31U;\n" +" uint i2 = as_type (y2) >> 30U;\n" +" uint i3 = as_type (y3) >> 29U;\n" +"\n" +" uint shift = (i2 & 2U) | (i1 & ~2U);\n" +" shift = (i3 & 4U) | (shift & ~4U);\n" +"\n" +" return (0x2E74U >> shift) & 0x0101U;\n" +"}\n" +"\n" +"float2 _hb_gpu_solve_horiz_poly (float2 a, float2 b, float2 p1)\n" +"{\n" +" float ra = 1.0 / a.y;\n" +" float rb = 0.5 / b.y;\n" +"\n" +" float d = sqrt (max (b.y * b.y - a.y * p1.y, 0.0));\n" +" float t1 = (b.y - d) * ra;\n" +" float t2 = (b.y + d) * ra;\n" +"\n" +" if (a.y == 0.0)\n" +" t1 = t2 = p1.y * rb;\n" +"\n" +" return float2 ((a.x * t1 - b.x * 2.0) * t1 + p1.x,\n" +" (a.x * t2 - b.x * 2.0) * t2 + p1.x);\n" +"}\n" +"\n" +"float2 _hb_gpu_solve_vert_poly (float2 a, float2 b, float2 p1)\n" +"{\n" +" float ra = 1.0 / a.x;\n" +" float rb = 0.5 / b.x;\n" +"\n" +" float d = sqrt (max (b.x * b.x - a.x * p1.x, 0.0));\n" +" float t1 = (b.x - d) * ra;\n" +" float t2 = (b.x + d) * ra;\n" +"\n" +" if (a.x == 0.0)\n" +" t1 = t2 = p1.x * rb;\n" +"\n" +" return float2 ((a.y * t1 - b.y * 2.0) * t1 + p1.y,\n" +" (a.y * t2 - b.y * 2.0) * t2 + p1.y);\n" +"}\n" +"\n" +"float _hb_gpu_calc_coverage (float xcov, float ycov, float xwgt, float ywgt)\n" +"{\n" +" float coverage = max (abs (xcov * xwgt + ycov * ywgt) /\n" +" max (xwgt + ywgt, 1.0 / 65536.0),\n" +" min (abs (xcov), abs (ycov)));\n" +"\n" +" return clamp (coverage, 0.0, 1.0);\n" +"}\n" +"\n" +"/* Decoded glyph band info for a pixel position. */\n" +"struct _hb_gpu_glyph_info\n" +"{\n" +" int glyphLoc;\n" +" int bandBase;\n" +" int2 bandIndex;\n" +" int numHBands;\n" +" int numVBands;\n" +" float2 scale;\n" +"};\n" +"\n" +"_hb_gpu_glyph_info _hb_gpu_decode_glyph (float2 renderCoord, uint glyphLoc_,\n" +" device const short4* hb_gpu_atlas)\n" +"{\n" +" _hb_gpu_glyph_info gi;\n" +" gi.glyphLoc = int (glyphLoc_);\n" +"\n" +" int4 header0 = hb_gpu_fetch (hb_gpu_atlas, gi.glyphLoc);\n" +" int4 header1 = hb_gpu_fetch (hb_gpu_atlas, gi.glyphLoc + 1);\n" +" float4 ext = float4 (header0) * HB_GPU_INV_UNITS;\n" +" gi.numHBands = header1.r;\n" +" gi.numVBands = header1.g;\n" +" gi.scale = float2 (float (header1.b), float (header1.a));\n" +"\n" +" float2 extSize = ext.zw - ext.xy;\n" +" float2 bandScale = float2 (float (gi.numVBands), float (gi.numHBands)) / max (extSize, float2 (1.0 / 65536.0));\n" +" float2 bandOffset = -ext.xy * bandScale;\n" +"\n" +" gi.bandIndex = clamp (int2 (renderCoord * bandScale + bandOffset),\n" +" int2 (0, 0),\n" +" int2 (gi.numVBands - 1, gi.numHBands - 1));\n" +"\n" +" gi.bandBase = gi.glyphLoc + 2;\n" +" return gi;\n" +"}\n" +"\n" +"/* Return pixels per em at this fragment.\n" +" *\n" +" * renderCoord: em-space sample position\n" +" * glyphLoc: texel offset of glyph blob in atlas\n" +" */\n" +"float hb_gpu_ppem (float2 renderCoord, uint glyphLoc_,\n" +" device const short4* hb_gpu_atlas)\n" +"{\n" +" _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_, hb_gpu_atlas);\n" +" float2 emsPerPixel = fwidth (renderCoord);\n" +" return min (gi.scale.x, gi.scale.y) /\n" +" max (emsPerPixel.x, emsPerPixel.y);\n" +"}\n" +"\n" +"/* Return per-pixel curve counts: (horizontal, vertical). */\n" +"int2 _hb_gpu_curve_counts (float2 renderCoord, uint glyphLoc_,\n" +" device const short4* hb_gpu_atlas)\n" +"{\n" +" _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_, hb_gpu_atlas);\n" +" int hCount = hb_gpu_fetch (hb_gpu_atlas, gi.bandBase + gi.bandIndex.y).r;\n" +" int vCount = hb_gpu_fetch (hb_gpu_atlas, gi.bandBase + gi.numHBands + gi.bandIndex.x).r;\n" +" return int2 (hCount, vCount);\n" +"}\n" +"\n" +"/* Single-sample coverage in [0, 1]. */\n" +"float _hb_gpu_slug_single (float2 renderCoord, float2 pixelsPerEm, uint glyphLoc_,\n" +" device const short4* hb_gpu_atlas)\n" +"{\n" +"\n" +" _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_, hb_gpu_atlas);\n" +" int glyphLoc = gi.glyphLoc;\n" +" int bandBase = gi.bandBase;\n" +" int numHBands = gi.numHBands;\n" +"\n" +" float xcov = 0.0;\n" +" float xwgt = 0.0;\n" +"\n" +" int4 hbandData = hb_gpu_fetch (hb_gpu_atlas, bandBase + gi.bandIndex.y);\n" +" int hCurveCount = hbandData.r;\n" +" /* Symmetric: choose rightward (desc) or leftward (asc) sort */\n" +" float hSplit = float (hbandData.a) * HB_GPU_INV_UNITS;\n" +" bool hLeftRay = (renderCoord.x < hSplit);\n" +" int hDataOffset = (hLeftRay ? hbandData.b : hbandData.g) + 32768;\n" +"\n" +" for (int ci = 0; ci < hCurveCount; ci++)\n" +" {\n" +" int curveOffset = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + hDataOffset + ci).r + 32768;\n" +"\n" +" int4 raw12 = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + curveOffset);\n" +" int4 raw3 = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + curveOffset + 1);\n" +"\n" +" float4 q12 = float4 (raw12) * HB_GPU_INV_UNITS;\n" +" float2 q3 = float2 (raw3.rg) * HB_GPU_INV_UNITS;\n" +"\n" +" float4 p12 = q12 - float4 (renderCoord, renderCoord);\n" +" float2 p3 = q3 - renderCoord;\n" +"\n" +" if (hLeftRay) {\n" +" if (min (min (p12.x, p12.z), p3.x) * pixelsPerEm.x > 0.5) break;\n" +" } else {\n" +" if (max (max (p12.x, p12.z), p3.x) * pixelsPerEm.x < -0.5) break;\n" +" }\n" +"\n" +" uint code = _hb_gpu_calc_root_code (p12.y, p12.w, p3.y);\n" +" if (code != 0U)\n" +" {\n" +" float2 a = q12.xy - q12.zw * 2.0 + q3;\n" +" float2 b = q12.xy - q12.zw;\n" +" float2 r = _hb_gpu_solve_horiz_poly (a, b, p12.xy) * pixelsPerEm.x;\n" +" /* For leftward ray: saturate(0.5 - r) counts coverage from the left */\n" +" float2 cov = hLeftRay ? clamp (float2 (0.5) - r, 0.0, 1.0)\n" +" : clamp (r + float2 (0.5), 0.0, 1.0);\n" +"\n" +" if ((code & 1U) != 0U)\n" +" {\n" +" xcov += cov.x;\n" +" xwgt = max (xwgt, clamp (1.0 - abs (r.x) * 2.0, 0.0, 1.0));\n" +" }\n" +"\n" +" if (code > 1U)\n" +" {\n" +" xcov -= cov.y;\n" +" xwgt = max (xwgt, clamp (1.0 - abs (r.y) * 2.0, 0.0, 1.0));\n" +" }\n" +" }\n" +" }\n" +"\n" +" float ycov = 0.0;\n" +" float ywgt = 0.0;\n" +"\n" +" int4 vbandData = hb_gpu_fetch (hb_gpu_atlas, bandBase + numHBands + gi.bandIndex.x);\n" +" int vCurveCount = vbandData.r;\n" +" float vSplit = float (vbandData.a) * HB_GPU_INV_UNITS;\n" +" bool vLeftRay = (renderCoord.y < vSplit);\n" +" int vDataOffset = (vLeftRay ? vbandData.b : vbandData.g) + 32768;\n" +"\n" +" for (int ci = 0; ci < vCurveCount; ci++)\n" +" {\n" +" int curveOffset = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + vDataOffset + ci).r + 32768;\n" +"\n" +" int4 raw12 = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + curveOffset);\n" +" int4 raw3 = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + curveOffset + 1);\n" +"\n" +" float4 q12 = float4 (raw12) * HB_GPU_INV_UNITS;\n" +" float2 q3 = float2 (raw3.rg) * HB_GPU_INV_UNITS;\n" +"\n" +" float4 p12 = q12 - float4 (renderCoord, renderCoord);\n" +" float2 p3 = q3 - renderCoord;\n" +"\n" +" if (vLeftRay) {\n" +" if (min (min (p12.y, p12.w), p3.y) * pixelsPerEm.y > 0.5) break;\n" +" } else {\n" +" if (max (max (p12.y, p12.w), p3.y) * pixelsPerEm.y < -0.5) break;\n" +" }\n" +"\n" +" uint code = _hb_gpu_calc_root_code (p12.x, p12.z, p3.x);\n" +" if (code != 0U)\n" +" {\n" +" float2 a = q12.xy - q12.zw * 2.0 + q3;\n" +" float2 b = q12.xy - q12.zw;\n" +" float2 r = _hb_gpu_solve_vert_poly (a, b, p12.xy) * pixelsPerEm.y;\n" +" float2 cov = vLeftRay ? clamp (float2 (0.5) - r, 0.0, 1.0)\n" +" : clamp (r + float2 (0.5), 0.0, 1.0);\n" +"\n" +" if ((code & 1U) != 0U)\n" +" {\n" +" ycov -= cov.x;\n" +" ywgt = max (ywgt, clamp (1.0 - abs (r.x) * 2.0, 0.0, 1.0));\n" +" }\n" +"\n" +" if (code > 1U)\n" +" {\n" +" ycov += cov.y;\n" +" ywgt = max (ywgt, clamp (1.0 - abs (r.y) * 2.0, 0.0, 1.0));\n" +" }\n" +" }\n" +" }\n" +"\n" +" return _hb_gpu_calc_coverage (xcov, ycov, xwgt, ywgt);\n" +"}\n" +"\n" +"/* Return coverage in [0, 1].\n" +" *\n" +" * renderCoord: em-space sample position\n" +" * glyphLoc: texel offset of glyph blob in atlas\n" +" * hb_gpu_atlas: device pointer to the atlas buffer\n" +" */\n" +"/* The MSAA-aware implementation. Caller supplies pixelsPerEm so\n" +" * this function can be invoked from non-uniform control flow (for\n" +" * example from a paint op-stream branch where a recomputed fwidth\n" +" * would be rejected by strict derivative-uniformity rules). */\n" +"float _hb_gpu_slug (float2 renderCoord, float2 pixelsPerEm, uint glyphLoc_,\n" +" device const short4* hb_gpu_atlas)\n" +"{\n" +" float c = _hb_gpu_slug_single (renderCoord, pixelsPerEm, glyphLoc_, hb_gpu_atlas);\n" +"\n" +"#ifndef HB_GPU_NO_MSAA\n" +" float ppem = hb_gpu_ppem (renderCoord, glyphLoc_, hb_gpu_atlas);\n" +"\n" +" if (ppem < 16.0)\n" +" {\n" +" float2 emsPerPixel = 1.0 / pixelsPerEm;\n" +" float2 d = emsPerPixel * (1.0 / 3.0);\n" +" float msaa = 0.25 *\n" +" (_hb_gpu_slug_single (renderCoord + float2 (-d.x, -d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) +\n" +" _hb_gpu_slug_single (renderCoord + float2 ( d.x, -d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) +\n" +" _hb_gpu_slug_single (renderCoord + float2 (-d.x, d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) +\n" +" _hb_gpu_slug_single (renderCoord + float2 ( d.x, d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas));\n" +"\n" +" c = mix (c, msaa, smoothstep (16.0, 8.0, ppem));\n" +" }\n" +"#endif\n" +"\n" +" return c;\n" +"}\n" +"\n" +"/* Stem darkening for small sizes.\n" +" *\n" +" * coverage: output of hb_gpu_draw\n" +" * brightness: foreground brightness in [0, 1]\n" +" * ppem: pixels per em at this fragment\n" +" */\n" +"float hb_gpu_stem_darken (float coverage, float brightness, float ppem)\n" +"{\n" +" return pow (coverage,\n" +" mix (pow (2.0, brightness - 0.5), 1.0,\n" +" smoothstep (8.0, 48.0, ppem)));\n" +"}\n" +; diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment-wgsl.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment-wgsl.hh new file mode 100644 index 0000000000..e77698e5ea --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment-wgsl.hh @@ -0,0 +1,331 @@ +static const char *hb_gpu_fragment_wgsl = +"/*\n" +" * Copyright (C) 2026 Behdad Esfahbod\n" +" *\n" +" * This is part of HarfBuzz, a text shaping library.\n" +" *\n" +" * Permission is hereby granted, without written agreement and without\n" +" * license or royalty fees, to use, copy, modify, and distribute this\n" +" * software and its documentation for any purpose, provided that the\n" +" * above copyright notice and the following two paragraphs appear in\n" +" * all copies of this software.\n" +" *\n" +" * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\n" +" * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\n" +" * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\n" +" * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n" +" * DAMAGE.\n" +" *\n" +" * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\n" +" * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n" +" * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n" +" * ON AN \"AS IS\" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\n" +" * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n" +" */\n" +"\n" +"\n" +"/* Shared fragment-shader helpers for the hb-gpu renderers.\n" +" *\n" +" * Requires WGSL (WebGPU Shading Language).\n" +" */\n" +"\n" +"\n" +"const HB_GPU_UNITS_PER_EM: f32 = 4.0;\n" +"const HB_GPU_INV_UNITS: f32 = 1.0 / 4.0;\n" +"\n" +"\n" +"fn hb_gpu_fetch (hb_gpu_atlas: ptr>, read>,\n" +" offset: i32) -> vec4\n" +"{\n" +" return (*hb_gpu_atlas)[offset];\n" +"}\n" +"fn _hb_gpu_calc_root_code (y1: f32, y2: f32, y3: f32) -> u32\n" +"{\n" +" let i1 = bitcast (y1) >> 31u;\n" +" let i2 = bitcast (y2) >> 30u;\n" +" let i3 = bitcast (y3) >> 29u;\n" +"\n" +" var shift = (i2 & 2u) | (i1 & ~2u);\n" +" shift = (i3 & 4u) | (shift & ~4u);\n" +"\n" +" return (0x2E74u >> shift) & 0x0101u;\n" +"}\n" +"\n" +"fn _hb_gpu_solve_horiz_poly (a: vec2f, b: vec2f, p1: vec2f) -> vec2f\n" +"{\n" +" let ra = 1.0 / a.y;\n" +" let rb = 0.5 / b.y;\n" +"\n" +" let d = sqrt (max (b.y * b.y - a.y * p1.y, 0.0));\n" +" var t1 = (b.y - d) * ra;\n" +" var t2 = (b.y + d) * ra;\n" +"\n" +" if (a.y == 0.0) {\n" +" t1 = p1.y * rb;\n" +" t2 = t1;\n" +" }\n" +"\n" +" return vec2f ((a.x * t1 - b.x * 2.0) * t1 + p1.x,\n" +" (a.x * t2 - b.x * 2.0) * t2 + p1.x);\n" +"}\n" +"\n" +"fn _hb_gpu_solve_vert_poly (a: vec2f, b: vec2f, p1: vec2f) -> vec2f\n" +"{\n" +" let ra = 1.0 / a.x;\n" +" let rb = 0.5 / b.x;\n" +"\n" +" let d = sqrt (max (b.x * b.x - a.x * p1.x, 0.0));\n" +" var t1 = (b.x - d) * ra;\n" +" var t2 = (b.x + d) * ra;\n" +"\n" +" if (a.x == 0.0) {\n" +" t1 = p1.x * rb;\n" +" t2 = t1;\n" +" }\n" +"\n" +" return vec2f ((a.y * t1 - b.y * 2.0) * t1 + p1.y,\n" +" (a.y * t2 - b.y * 2.0) * t2 + p1.y);\n" +"}\n" +"\n" +"fn _hb_gpu_calc_coverage (xcov: f32, ycov: f32, xwgt: f32, ywgt: f32) -> f32\n" +"{\n" +" let coverage = max (abs (xcov * xwgt + ycov * ywgt) /\n" +" max (xwgt + ywgt, 1.0 / 65536.0),\n" +" min (abs (xcov), abs (ycov)));\n" +"\n" +" return clamp (coverage, 0.0, 1.0);\n" +"}\n" +"\n" +"/* Decoded glyph band info for a pixel position. */\n" +"struct _hb_gpu_glyph_info\n" +"{\n" +" glyphLoc: i32,\n" +" bandBase: i32,\n" +" bandIndex: vec2,\n" +" numHBands: i32,\n" +" numVBands: i32,\n" +" scale: vec2f,\n" +"}\n" +"\n" +"fn _hb_gpu_decode_glyph (renderCoord: vec2f, glyphLoc_: u32,\n" +" hb_gpu_atlas: ptr>, read>) -> _hb_gpu_glyph_info\n" +"{\n" +" var gi: _hb_gpu_glyph_info;\n" +" gi.glyphLoc = i32 (glyphLoc_);\n" +"\n" +" let header0 = hb_gpu_fetch (hb_gpu_atlas, gi.glyphLoc);\n" +" let header1 = hb_gpu_fetch (hb_gpu_atlas, gi.glyphLoc + 1);\n" +" let ext = vec4f (header0) * HB_GPU_INV_UNITS;\n" +" gi.numHBands = header1.r;\n" +" gi.numVBands = header1.g;\n" +" gi.scale = vec2f (f32 (header1.b), f32 (header1.a));\n" +"\n" +" let extSize = ext.zw - ext.xy;\n" +" let bandScale = vec2f (f32 (gi.numVBands), f32 (gi.numHBands)) / max (extSize, vec2f (1.0 / 65536.0));\n" +" let bandOffset = -ext.xy * bandScale;\n" +"\n" +" gi.bandIndex = clamp (vec2 (renderCoord * bandScale + bandOffset),\n" +" vec2 (0, 0),\n" +" vec2 (gi.numVBands - 1, gi.numHBands - 1));\n" +"\n" +" gi.bandBase = gi.glyphLoc + 2;\n" +" return gi;\n" +"}\n" +"\n" +"/* Return pixels per em at this fragment.\n" +" *\n" +" * renderCoord: em-space sample position\n" +" * glyphLoc: texel offset of glyph blob in atlas\n" +" */\n" +"fn hb_gpu_ppem (renderCoord: vec2f, glyphLoc_: u32,\n" +" hb_gpu_atlas: ptr>, read>) -> f32\n" +"{\n" +" let gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_, hb_gpu_atlas);\n" +" let emsPerPixel = fwidth (renderCoord);\n" +" return min (gi.scale.x, gi.scale.y) /\n" +" max (emsPerPixel.x, emsPerPixel.y);\n" +"}\n" +"\n" +"/* Return per-pixel curve counts: (horizontal, vertical). */\n" +"fn _hb_gpu_curve_counts (renderCoord: vec2f, glyphLoc_: u32,\n" +" hb_gpu_atlas: ptr>, read>) -> vec2\n" +"{\n" +" let gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_, hb_gpu_atlas);\n" +" let hCount = hb_gpu_fetch (hb_gpu_atlas, gi.bandBase + gi.bandIndex.y).r;\n" +" let vCount = hb_gpu_fetch (hb_gpu_atlas, gi.bandBase + gi.numHBands + gi.bandIndex.x).r;\n" +" return vec2 (hCount, vCount);\n" +"}\n" +"\n" +"/* Single-sample coverage in [0, 1]. */\n" +"fn _hb_gpu_slug_single (renderCoord: vec2f, pixelsPerEm: vec2f, glyphLoc_: u32,\n" +" hb_gpu_atlas: ptr>, read>) -> f32\n" +"{\n" +"\n" +" let gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_, hb_gpu_atlas);\n" +" let glyphLoc = gi.glyphLoc;\n" +" let bandBase = gi.bandBase;\n" +" let numHBands = gi.numHBands;\n" +"\n" +" var xcov: f32 = 0.0;\n" +" var xwgt: f32 = 0.0;\n" +"\n" +" let hbandData = hb_gpu_fetch (hb_gpu_atlas, bandBase + gi.bandIndex.y);\n" +" let hCurveCount = hbandData.r;\n" +" /* Symmetric: choose rightward (desc) or leftward (asc) sort */\n" +" let hSplit = f32 (hbandData.a) * HB_GPU_INV_UNITS;\n" +" let hLeftRay = (renderCoord.x < hSplit);\n" +" var hDataOffset: i32;\n" +" if (hLeftRay) { hDataOffset = hbandData.b + 32768; }\n" +" else { hDataOffset = hbandData.g + 32768; }\n" +"\n" +" for (var ci: i32 = 0; ci < hCurveCount; ci++)\n" +" {\n" +" let curveOffset = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + hDataOffset + ci).r + 32768;\n" +"\n" +" let raw12 = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + curveOffset);\n" +" let raw3 = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + curveOffset + 1);\n" +"\n" +" let q12 = vec4f (raw12) * HB_GPU_INV_UNITS;\n" +" let q3 = vec2f (vec2 (raw3.r, raw3.g)) * HB_GPU_INV_UNITS;\n" +"\n" +" let p12 = q12 - vec4f (renderCoord, renderCoord);\n" +" let p3 = q3 - renderCoord;\n" +"\n" +" if (hLeftRay) {\n" +" if (min (min (p12.x, p12.z), p3.x) * pixelsPerEm.x > 0.5) { break; }\n" +" } else {\n" +" if (max (max (p12.x, p12.z), p3.x) * pixelsPerEm.x < -0.5) { break; }\n" +" }\n" +"\n" +" let code = _hb_gpu_calc_root_code (p12.y, p12.w, p3.y);\n" +" if (code != 0u)\n" +" {\n" +" let a = q12.xy - q12.zw * 2.0 + q3;\n" +" let b = q12.xy - q12.zw;\n" +" let r = _hb_gpu_solve_horiz_poly (a, b, p12.xy) * pixelsPerEm.x;\n" +" /* For leftward ray: saturate(0.5 - r) counts coverage from the left */\n" +" var cov: vec2f;\n" +" if (hLeftRay) { cov = clamp (vec2f (0.5) - r, vec2f (0.0), vec2f (1.0)); }\n" +" else { cov = clamp (r + vec2f (0.5), vec2f (0.0), vec2f (1.0)); }\n" +"\n" +" if ((code & 1u) != 0u)\n" +" {\n" +" xcov += cov.x;\n" +" xwgt = max (xwgt, clamp (1.0 - abs (r.x) * 2.0, 0.0, 1.0));\n" +" }\n" +"\n" +" if (code > 1u)\n" +" {\n" +" xcov -= cov.y;\n" +" xwgt = max (xwgt, clamp (1.0 - abs (r.y) * 2.0, 0.0, 1.0));\n" +" }\n" +" }\n" +" }\n" +"\n" +" var ycov: f32 = 0.0;\n" +" var ywgt: f32 = 0.0;\n" +"\n" +" let vbandData = hb_gpu_fetch (hb_gpu_atlas, bandBase + numHBands + gi.bandIndex.x);\n" +" let vCurveCount = vbandData.r;\n" +" let vSplit = f32 (vbandData.a) * HB_GPU_INV_UNITS;\n" +" let vLeftRay = (renderCoord.y < vSplit);\n" +" var vDataOffset: i32;\n" +" if (vLeftRay) { vDataOffset = vbandData.b + 32768; }\n" +" else { vDataOffset = vbandData.g + 32768; }\n" +"\n" +" for (var ci: i32 = 0; ci < vCurveCount; ci++)\n" +" {\n" +" let curveOffset = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + vDataOffset + ci).r + 32768;\n" +"\n" +" let raw12 = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + curveOffset);\n" +" let raw3 = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + curveOffset + 1);\n" +"\n" +" let q12 = vec4f (raw12) * HB_GPU_INV_UNITS;\n" +" let q3 = vec2f (vec2 (raw3.r, raw3.g)) * HB_GPU_INV_UNITS;\n" +"\n" +" let p12 = q12 - vec4f (renderCoord, renderCoord);\n" +" let p3 = q3 - renderCoord;\n" +"\n" +" if (vLeftRay) {\n" +" if (min (min (p12.y, p12.w), p3.y) * pixelsPerEm.y > 0.5) { break; }\n" +" } else {\n" +" if (max (max (p12.y, p12.w), p3.y) * pixelsPerEm.y < -0.5) { break; }\n" +" }\n" +"\n" +" let code = _hb_gpu_calc_root_code (p12.x, p12.z, p3.x);\n" +" if (code != 0u)\n" +" {\n" +" let a = q12.xy - q12.zw * 2.0 + q3;\n" +" let b = q12.xy - q12.zw;\n" +" let r = _hb_gpu_solve_vert_poly (a, b, p12.xy) * pixelsPerEm.y;\n" +" var cov: vec2f;\n" +" if (vLeftRay) { cov = clamp (vec2f (0.5) - r, vec2f (0.0), vec2f (1.0)); }\n" +" else { cov = clamp (r + vec2f (0.5), vec2f (0.0), vec2f (1.0)); }\n" +"\n" +" if ((code & 1u) != 0u)\n" +" {\n" +" ycov -= cov.x;\n" +" ywgt = max (ywgt, clamp (1.0 - abs (r.x) * 2.0, 0.0, 1.0));\n" +" }\n" +"\n" +" if (code > 1u)\n" +" {\n" +" ycov += cov.y;\n" +" ywgt = max (ywgt, clamp (1.0 - abs (r.y) * 2.0, 0.0, 1.0));\n" +" }\n" +" }\n" +" }\n" +"\n" +" return _hb_gpu_calc_coverage (xcov, ycov, xwgt, ywgt);\n" +"}\n" +"\n" +"/* Return coverage in [0, 1].\n" +" *\n" +" * renderCoord: em-space sample position\n" +" * glyphLoc: texel offset of glyph blob in atlas\n" +" * hb_gpu_atlas: storage buffer pointer to the atlas\n" +" */\n" +"/* The MSAA-aware implementation. Caller supplies pixelsPerEm so\n" +" * this function can be invoked from non-uniform control flow (for\n" +" * example inside an op-stream branch in hb-gpu-paint-fragment.wgsl,\n" +" * where WGSL would otherwise reject an fwidth call). */\n" +"fn _hb_gpu_slug (renderCoord: vec2f, pixelsPerEm: vec2f, glyphLoc_: u32,\n" +" hb_gpu_atlas: ptr>, read>) -> f32\n" +"{\n" +" var c = _hb_gpu_slug_single (renderCoord, pixelsPerEm, glyphLoc_, hb_gpu_atlas);\n" +"\n" +" /* Inline ppem from pixelsPerEm so we don't re-enter hb_gpu_ppem\n" +" * (which would call fwidth again -- rejected by WGSL when this\n" +" * function is invoked from non-uniform control flow). */\n" +" let gi_pp = _hb_gpu_decode_glyph (renderCoord, glyphLoc_, hb_gpu_atlas);\n" +" let ppem = min (gi_pp.scale.x, gi_pp.scale.y) *\n" +" min (pixelsPerEm.x, pixelsPerEm.y);\n" +"\n" +" if (ppem < 16.0)\n" +" {\n" +" let emsPerPixel = 1.0 / pixelsPerEm;\n" +" let d = emsPerPixel * (1.0 / 3.0);\n" +" let msaa = 0.25 *\n" +" (_hb_gpu_slug_single (renderCoord + vec2f (-d.x, -d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) +\n" +" _hb_gpu_slug_single (renderCoord + vec2f ( d.x, -d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) +\n" +" _hb_gpu_slug_single (renderCoord + vec2f (-d.x, d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) +\n" +" _hb_gpu_slug_single (renderCoord + vec2f ( d.x, d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas));\n" +"\n" +" c = mix (c, msaa, smoothstep (16.0, 8.0, ppem));\n" +" }\n" +"\n" +" return c;\n" +"}\n" +"/* Stem darkening for small sizes.\n" +" *\n" +" * coverage: output of hb_gpu_draw\n" +" * brightness: foreground brightness in [0, 1]\n" +" * ppem: pixels per em at this fragment\n" +" */\n" +"fn hb_gpu_stem_darken (coverage: f32, brightness: f32, ppem: f32) -> f32\n" +"{\n" +" return pow (coverage,\n" +" mix (pow (2.0, brightness - 0.5), 1.0,\n" +" smoothstep (8.0, 48.0, ppem)));\n" +"}\n" +; diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment.glsl b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment.glsl new file mode 100644 index 0000000000..23b14a0ba4 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment.glsl @@ -0,0 +1,339 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * Copyright (C) 2017 Eric Lengyel + * + * The _hb_gpu_slug body below is based on the Slug algorithm by + * Eric Lengyel: https://github.com/EricLengyel/Slug + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + + +/* Shared fragment-shader helpers for the hb-gpu renderers. + * + * Requires GLSL 3.30 or GLSL ES 3.00. + * + * For GLSL ES 3.00 / WebGL2, define HB_GPU_ATLAS_2D before + * including this source. The atlas is then a 2D isampler2D + * texture of known width (set via hb_gpu_atlas_width uniform) + * instead of an isamplerBuffer. + * + * Exports: + * hb_gpu_fetch (offset) atlas lookup + * _hb_gpu_slug (rc, pixelsPerEm, glyphLoc) MSAA-aware Slug + * coverage (caller supplies + * pixelsPerEm so it can be + * invoked from non-uniform + * control flow) + * hb_gpu_ppem (rc, glyphLoc) pixels per em at fragment + * _hb_gpu_curve_counts (rc, glyphLoc) debug: per-pixel curve counts + * hb_gpu_stem_darken (cov, brightness, ppem) thin-stroke contrast + * correction + */ + + +#ifndef HB_GPU_UNITS_PER_EM +#define HB_GPU_UNITS_PER_EM 4 +#endif + +#define HB_GPU_INV_UNITS float(1.0 / float(HB_GPU_UNITS_PER_EM)) + + +#ifdef HB_GPU_ATLAS_2D +uniform highp isampler2D hb_gpu_atlas; +uniform int hb_gpu_atlas_width; +ivec4 hb_gpu_fetch (int offset) +{ + return texelFetch (hb_gpu_atlas, + ivec2 (offset % hb_gpu_atlas_width, + offset / hb_gpu_atlas_width), 0); +} +#else +uniform isamplerBuffer hb_gpu_atlas; +ivec4 hb_gpu_fetch (int offset) +{ + return texelFetch (hb_gpu_atlas, offset); +} +#endif + + +uint _hb_gpu_calc_root_code (float y1, float y2, float y3) +{ + uint i1 = floatBitsToUint (y1) >> 31U; + uint i2 = floatBitsToUint (y2) >> 30U; + uint i3 = floatBitsToUint (y3) >> 29U; + + uint shift = (i2 & 2U) | (i1 & ~2U); + shift = (i3 & 4U) | (shift & ~4U); + + return (0x2E74U >> shift) & 0x0101U; +} + +vec2 _hb_gpu_solve_horiz_poly (vec2 a, vec2 b, vec2 p1) +{ + float ra = 1.0 / a.y; + float rb = 0.5 / b.y; + + float d = sqrt (max (b.y * b.y - a.y * p1.y, 0.0)); + float t1 = (b.y - d) * ra; + float t2 = (b.y + d) * ra; + + if (a.y == 0.0) + t1 = t2 = p1.y * rb; + + return vec2 ((a.x * t1 - b.x * 2.0) * t1 + p1.x, + (a.x * t2 - b.x * 2.0) * t2 + p1.x); +} + +vec2 _hb_gpu_solve_vert_poly (vec2 a, vec2 b, vec2 p1) +{ + float ra = 1.0 / a.x; + float rb = 0.5 / b.x; + + float d = sqrt (max (b.x * b.x - a.x * p1.x, 0.0)); + float t1 = (b.x - d) * ra; + float t2 = (b.x + d) * ra; + + if (a.x == 0.0) + t1 = t2 = p1.x * rb; + + return vec2 ((a.y * t1 - b.y * 2.0) * t1 + p1.y, + (a.y * t2 - b.y * 2.0) * t2 + p1.y); +} + +float _hb_gpu_calc_coverage (float xcov, float ycov, float xwgt, float ywgt) +{ + float coverage = max (abs (xcov * xwgt + ycov * ywgt) / + max (xwgt + ywgt, 1.0 / 65536.0), + min (abs (xcov), abs (ycov))); + + return clamp (coverage, 0.0, 1.0); +} + +/* Decoded glyph band info for a pixel position. */ +struct _hb_gpu_glyph_info +{ + int glyphLoc; + int bandBase; + ivec2 bandIndex; + int numHBands; + int numVBands; + vec2 scale; +}; + +_hb_gpu_glyph_info _hb_gpu_decode_glyph (vec2 renderCoord, uint glyphLoc_) +{ + _hb_gpu_glyph_info gi; + gi.glyphLoc = int (glyphLoc_); + + ivec4 header0 = hb_gpu_fetch (gi.glyphLoc); + ivec4 header1 = hb_gpu_fetch (gi.glyphLoc + 1); + vec4 ext = vec4 (header0) * HB_GPU_INV_UNITS; + gi.numHBands = header1.r; + gi.numVBands = header1.g; + gi.scale = vec2 (float (header1.b), float (header1.a)); + + vec2 extSize = ext.zw - ext.xy; + vec2 bandScale = vec2 (float (gi.numVBands), float (gi.numHBands)) / max (extSize, vec2 (1.0 / 65536.0)); + vec2 bandOffset = -ext.xy * bandScale; + + gi.bandIndex = clamp (ivec2 (renderCoord * bandScale + bandOffset), + ivec2 (0, 0), + ivec2 (gi.numVBands - 1, gi.numHBands - 1)); + + gi.bandBase = gi.glyphLoc + 2; + return gi; +} + +/* Return pixels per em at this fragment. */ +float hb_gpu_ppem (vec2 renderCoord, uint glyphLoc_) +{ + _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_); + vec2 emsPerPixel = fwidth (renderCoord); + return min (gi.scale.x, gi.scale.y) / + max (emsPerPixel.x, emsPerPixel.y); +} + +/* Return per-pixel curve counts: (horizontal, vertical). */ +ivec2 _hb_gpu_curve_counts (vec2 renderCoord, uint glyphLoc_) +{ + _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_); + int hCount = hb_gpu_fetch (gi.bandBase + gi.bandIndex.y).r; + int vCount = hb_gpu_fetch (gi.bandBase + gi.numHBands + gi.bandIndex.x).r; + return ivec2 (hCount, vCount); +} + +/* Single-sample coverage in [0, 1]. */ +float _hb_gpu_slug_single (vec2 renderCoord, vec2 pixelsPerEm, uint glyphLoc_) +{ + + _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_); + int glyphLoc = gi.glyphLoc; + int bandBase = gi.bandBase; + int numHBands = gi.numHBands; + + float xcov = 0.0; + float xwgt = 0.0; + + ivec4 hbandData = hb_gpu_fetch (bandBase + gi.bandIndex.y); + int hCurveCount = hbandData.r; + /* Symmetric: choose rightward (desc) or leftward (asc) sort */ + float hSplit = float (hbandData.a) * HB_GPU_INV_UNITS; + bool hLeftRay = (renderCoord.x < hSplit); + int hDataOffset = (hLeftRay ? hbandData.b : hbandData.g) + 32768; + + for (int ci = 0; ci < hCurveCount; ci++) + { + int curveOffset = hb_gpu_fetch (glyphLoc + hDataOffset + ci).r + 32768; + + ivec4 raw12 = hb_gpu_fetch (glyphLoc + curveOffset); + ivec4 raw3 = hb_gpu_fetch (glyphLoc + curveOffset + 1); + + vec4 q12 = vec4 (raw12) * HB_GPU_INV_UNITS; + vec2 q3 = vec2 (raw3.rg) * HB_GPU_INV_UNITS; + + vec4 p12 = q12 - vec4 (renderCoord, renderCoord); + vec2 p3 = q3 - renderCoord; + + if (hLeftRay) { + if (min (min (p12.x, p12.z), p3.x) * pixelsPerEm.x > 0.5) break; + } else { + if (max (max (p12.x, p12.z), p3.x) * pixelsPerEm.x < -0.5) break; + } + + uint code = _hb_gpu_calc_root_code (p12.y, p12.w, p3.y); + if (code != 0U) + { + vec2 a = q12.xy - q12.zw * 2.0 + q3; + vec2 b = q12.xy - q12.zw; + vec2 r = _hb_gpu_solve_horiz_poly (a, b, p12.xy) * pixelsPerEm.x; + /* For leftward ray: saturate(0.5 - r) counts coverage from the left */ + vec2 cov = hLeftRay ? clamp (vec2 (0.5) - r, 0.0, 1.0) + : clamp (r + vec2 (0.5), 0.0, 1.0); + + if ((code & 1U) != 0U) + { + xcov += cov.x; + xwgt = max (xwgt, clamp (1.0 - abs (r.x) * 2.0, 0.0, 1.0)); + } + + if (code > 1U) + { + xcov -= cov.y; + xwgt = max (xwgt, clamp (1.0 - abs (r.y) * 2.0, 0.0, 1.0)); + } + } + } + + float ycov = 0.0; + float ywgt = 0.0; + + ivec4 vbandData = hb_gpu_fetch (bandBase + numHBands + gi.bandIndex.x); + int vCurveCount = vbandData.r; + float vSplit = float (vbandData.a) * HB_GPU_INV_UNITS; + bool vLeftRay = (renderCoord.y < vSplit); + int vDataOffset = (vLeftRay ? vbandData.b : vbandData.g) + 32768; + + for (int ci = 0; ci < vCurveCount; ci++) + { + int curveOffset = hb_gpu_fetch (glyphLoc + vDataOffset + ci).r + 32768; + + ivec4 raw12 = hb_gpu_fetch (glyphLoc + curveOffset); + ivec4 raw3 = hb_gpu_fetch (glyphLoc + curveOffset + 1); + + vec4 q12 = vec4 (raw12) * HB_GPU_INV_UNITS; + vec2 q3 = vec2 (raw3.rg) * HB_GPU_INV_UNITS; + + vec4 p12 = q12 - vec4 (renderCoord, renderCoord); + vec2 p3 = q3 - renderCoord; + + if (vLeftRay) { + if (min (min (p12.y, p12.w), p3.y) * pixelsPerEm.y > 0.5) break; + } else { + if (max (max (p12.y, p12.w), p3.y) * pixelsPerEm.y < -0.5) break; + } + + uint code = _hb_gpu_calc_root_code (p12.x, p12.z, p3.x); + if (code != 0U) + { + vec2 a = q12.xy - q12.zw * 2.0 + q3; + vec2 b = q12.xy - q12.zw; + vec2 r = _hb_gpu_solve_vert_poly (a, b, p12.xy) * pixelsPerEm.y; + vec2 cov = vLeftRay ? clamp (vec2 (0.5) - r, 0.0, 1.0) + : clamp (r + vec2 (0.5), 0.0, 1.0); + + if ((code & 1U) != 0U) + { + ycov -= cov.x; + ywgt = max (ywgt, clamp (1.0 - abs (r.x) * 2.0, 0.0, 1.0)); + } + + if (code > 1U) + { + ycov += cov.y; + ywgt = max (ywgt, clamp (1.0 - abs (r.y) * 2.0, 0.0, 1.0)); + } + } + } + + return _hb_gpu_calc_coverage (xcov, ycov, xwgt, ywgt); +} + +/* MSAA-aware Slug coverage. Caller supplies pixelsPerEm so this + * function can be invoked from non-uniform control flow (for + * example inside an op-stream branch in hb-gpu-paint-fragment.wgsl, + * where WGSL would otherwise reject an fwidth call). */ +float _hb_gpu_slug (vec2 renderCoord, vec2 pixelsPerEm, uint glyphLoc_) +{ + float c = _hb_gpu_slug_single (renderCoord, pixelsPerEm, glyphLoc_); + +#ifndef HB_GPU_NO_MSAA + float ppem = hb_gpu_ppem (renderCoord, glyphLoc_); + + if (ppem < 16.0) + { + vec2 emsPerPixel = 1.0 / pixelsPerEm; + vec2 d = emsPerPixel * (1.0 / 3.0); + float msaa = 0.25 * + (_hb_gpu_slug_single (renderCoord + vec2 (-d.x, -d.y), pixelsPerEm, glyphLoc_) + + _hb_gpu_slug_single (renderCoord + vec2 ( d.x, -d.y), pixelsPerEm, glyphLoc_) + + _hb_gpu_slug_single (renderCoord + vec2 (-d.x, d.y), pixelsPerEm, glyphLoc_) + + _hb_gpu_slug_single (renderCoord + vec2 ( d.x, d.y), pixelsPerEm, glyphLoc_)); + + c = mix (c, msaa, smoothstep (16.0, 8.0, ppem)); + } +#endif + + return c; +} + +/* Stem darkening for small sizes. + * + * coverage: output of hb_gpu_draw / _hb_gpu_slug + * brightness: foreground brightness in [0, 1] + * ppem: pixels per em at this fragment + */ +float hb_gpu_stem_darken (float coverage, float brightness, float ppem) +{ + return pow (coverage, + mix (pow (2.0, brightness - 0.5), 1.0, + smoothstep (8.0, 48.0, ppem))); +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment.hlsl b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment.hlsl new file mode 100644 index 0000000000..a0c69d6cd8 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment.hlsl @@ -0,0 +1,314 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + + +/* Shared fragment-shader helpers for the hb-gpu renderers. + * + * Requires Shader Model 5.0+. + * + * The caller must declare: + * StructuredBuffer hb_gpu_atlas : register(t0); + */ + + +#ifndef HB_GPU_UNITS_PER_EM +#define HB_GPU_UNITS_PER_EM 4 +#endif + +#define HB_GPU_INV_UNITS (1.0 / (float) HB_GPU_UNITS_PER_EM) + + +int4 hb_gpu_fetch (int offset) +{ + return hb_gpu_atlas[offset]; +} +uint _hb_gpu_calc_root_code (float y1, float y2, float y3) +{ + uint i1 = asuint (y1) >> 31u; + uint i2 = asuint (y2) >> 30u; + uint i3 = asuint (y3) >> 29u; + + uint shift = (i2 & 2u) | (i1 & ~2u); + shift = (i3 & 4u) | (shift & ~4u); + + return (0x2E74u >> shift) & 0x0101u; +} + +float2 _hb_gpu_solve_horiz_poly (float2 a, float2 b, float2 p1) +{ + float ra = 1.0 / a.y; + float rb = 0.5 / b.y; + + float d = sqrt (max (b.y * b.y - a.y * p1.y, 0.0)); + float t1 = (b.y - d) * ra; + float t2 = (b.y + d) * ra; + + if (a.y == 0.0) + t1 = t2 = p1.y * rb; + + return float2 ((a.x * t1 - b.x * 2.0) * t1 + p1.x, + (a.x * t2 - b.x * 2.0) * t2 + p1.x); +} + +float2 _hb_gpu_solve_vert_poly (float2 a, float2 b, float2 p1) +{ + float ra = 1.0 / a.x; + float rb = 0.5 / b.x; + + float d = sqrt (max (b.x * b.x - a.x * p1.x, 0.0)); + float t1 = (b.x - d) * ra; + float t2 = (b.x + d) * ra; + + if (a.x == 0.0) + t1 = t2 = p1.x * rb; + + return float2 ((a.y * t1 - b.y * 2.0) * t1 + p1.y, + (a.y * t2 - b.y * 2.0) * t2 + p1.y); +} + +float _hb_gpu_calc_coverage (float xcov, float ycov, float xwgt, float ywgt) +{ + float coverage = max (abs (xcov * xwgt + ycov * ywgt) / + max (xwgt + ywgt, 1.0 / 65536.0), + min (abs (xcov), abs (ycov))); + + return clamp (coverage, 0.0, 1.0); +} + + +struct _hb_gpu_glyph_info +{ + int glyphLoc; + int bandBase; + int2 bandIndex; + int numHBands; + int numVBands; + float2 scale; +}; + +_hb_gpu_glyph_info _hb_gpu_decode_glyph (float2 renderCoord, uint glyphLoc_) +{ + _hb_gpu_glyph_info gi; + gi.glyphLoc = (int) glyphLoc_; + + int4 header0 = hb_gpu_fetch (gi.glyphLoc); + int4 header1 = hb_gpu_fetch (gi.glyphLoc + 1); + float4 ext = (float4) header0 * HB_GPU_INV_UNITS; + gi.numHBands = header1.r; + gi.numVBands = header1.g; + gi.scale = float2 ((float) header1.b, (float) header1.a); + + float2 extSize = ext.zw - ext.xy; + float2 bandScale = float2 ((float) gi.numVBands, (float) gi.numHBands) / max (extSize, float2 (1.0 / 65536.0, 1.0 / 65536.0)); + float2 bandOffset = -ext.xy * bandScale; + + gi.bandIndex = clamp ((int2) (renderCoord * bandScale + bandOffset), + int2 (0, 0), + int2 (gi.numVBands - 1, gi.numHBands - 1)); + + gi.bandBase = gi.glyphLoc + 2; + return gi; +} + +/* Return pixels per em at this fragment. + * + * renderCoord: em-space sample position + * glyphLoc: texel offset of glyph blob in atlas + */ +float hb_gpu_ppem (float2 renderCoord, uint glyphLoc_) +{ + _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_); + float2 emsPerPixel = fwidth (renderCoord); + return min (gi.scale.x, gi.scale.y) / + max (emsPerPixel.x, emsPerPixel.y); +} + +int2 _hb_gpu_curve_counts (float2 renderCoord, uint glyphLoc_) +{ + _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_); + int hCount = hb_gpu_fetch (gi.bandBase + gi.bandIndex.y).r; + int vCount = hb_gpu_fetch (gi.bandBase + gi.numHBands + gi.bandIndex.x).r; + return int2 (hCount, vCount); +} + + +/* Single-sample coverage in [0, 1]. */ +float _hb_gpu_slug_single (float2 renderCoord, float2 pixelsPerEm, uint glyphLoc_) +{ + + _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_); + int glyphLoc = gi.glyphLoc; + int bandBase = gi.bandBase; + int numHBands = gi.numHBands; + + float xcov = 0.0; + float xwgt = 0.0; + + int4 hbandData = hb_gpu_fetch (bandBase + gi.bandIndex.y); + int hCurveCount = hbandData.r; + float hSplit = (float) hbandData.a * HB_GPU_INV_UNITS; + bool hLeftRay = (renderCoord.x < hSplit); + int hDataOffset = (hLeftRay ? hbandData.b : hbandData.g) + 32768; + + for (int ci = 0; ci < hCurveCount; ci++) + { + int curveOffset = hb_gpu_fetch (glyphLoc + hDataOffset + ci).r + 32768; + + int4 raw12 = hb_gpu_fetch (glyphLoc + curveOffset); + int4 raw3 = hb_gpu_fetch (glyphLoc + curveOffset + 1); + + float4 q12 = (float4) raw12 * HB_GPU_INV_UNITS; + float2 q3 = (float2) raw3.rg * HB_GPU_INV_UNITS; + + float4 p12 = q12 - float4 (renderCoord, renderCoord); + float2 p3 = q3 - renderCoord; + + if (hLeftRay) { + if (min (min (p12.x, p12.z), p3.x) * pixelsPerEm.x > 0.5) break; + } else { + if (max (max (p12.x, p12.z), p3.x) * pixelsPerEm.x < -0.5) break; + } + + uint code = _hb_gpu_calc_root_code (p12.y, p12.w, p3.y); + if (code != 0u) + { + float2 a = q12.xy - q12.zw * 2.0 + q3; + float2 b = q12.xy - q12.zw; + float2 r = _hb_gpu_solve_horiz_poly (a, b, p12.xy) * pixelsPerEm.x; + float2 cov = hLeftRay ? clamp (float2 (0.5, 0.5) - r, 0.0, 1.0) + : clamp (r + float2 (0.5, 0.5), 0.0, 1.0); + + if ((code & 1u) != 0u) + { + xcov += cov.x; + xwgt = max (xwgt, clamp (1.0 - abs (r.x) * 2.0, 0.0, 1.0)); + } + + if (code > 1u) + { + xcov -= cov.y; + xwgt = max (xwgt, clamp (1.0 - abs (r.y) * 2.0, 0.0, 1.0)); + } + } + } + + float ycov = 0.0; + float ywgt = 0.0; + + int4 vbandData = hb_gpu_fetch (bandBase + numHBands + gi.bandIndex.x); + int vCurveCount = vbandData.r; + float vSplit = (float) vbandData.a * HB_GPU_INV_UNITS; + bool vLeftRay = (renderCoord.y < vSplit); + int vDataOffset = (vLeftRay ? vbandData.b : vbandData.g) + 32768; + + for (int ci = 0; ci < vCurveCount; ci++) + { + int curveOffset = hb_gpu_fetch (glyphLoc + vDataOffset + ci).r + 32768; + + int4 raw12 = hb_gpu_fetch (glyphLoc + curveOffset); + int4 raw3 = hb_gpu_fetch (glyphLoc + curveOffset + 1); + + float4 q12 = (float4) raw12 * HB_GPU_INV_UNITS; + float2 q3 = (float2) raw3.rg * HB_GPU_INV_UNITS; + + float4 p12 = q12 - float4 (renderCoord, renderCoord); + float2 p3 = q3 - renderCoord; + + if (vLeftRay) { + if (min (min (p12.y, p12.w), p3.y) * pixelsPerEm.y > 0.5) break; + } else { + if (max (max (p12.y, p12.w), p3.y) * pixelsPerEm.y < -0.5) break; + } + + uint code = _hb_gpu_calc_root_code (p12.x, p12.z, p3.x); + if (code != 0u) + { + float2 a = q12.xy - q12.zw * 2.0 + q3; + float2 b = q12.xy - q12.zw; + float2 r = _hb_gpu_solve_vert_poly (a, b, p12.xy) * pixelsPerEm.y; + float2 cov = vLeftRay ? clamp (float2 (0.5, 0.5) - r, 0.0, 1.0) + : clamp (r + float2 (0.5, 0.5), 0.0, 1.0); + + if ((code & 1u) != 0u) + { + ycov -= cov.x; + ywgt = max (ywgt, clamp (1.0 - abs (r.x) * 2.0, 0.0, 1.0)); + } + + if (code > 1u) + { + ycov += cov.y; + ywgt = max (ywgt, clamp (1.0 - abs (r.y) * 2.0, 0.0, 1.0)); + } + } + } + + return _hb_gpu_calc_coverage (xcov, ycov, xwgt, ywgt); +} + +/* Return coverage in [0, 1]. + * + * Caller must declare: StructuredBuffer hb_gpu_atlas + * + * renderCoord: em-space sample position + * glyphLoc: texel offset of glyph blob in atlas + */ +/* The MSAA-aware implementation. Caller supplies pixelsPerEm so + * this function can be invoked from non-uniform control flow (for + * example from a paint op-stream branch). */ +float _hb_gpu_slug (float2 renderCoord, float2 pixelsPerEm, uint glyphLoc_) +{ + float c = _hb_gpu_slug_single (renderCoord, pixelsPerEm, glyphLoc_); + +#ifndef HB_GPU_NO_MSAA + float ppem = hb_gpu_ppem (renderCoord, glyphLoc_); + + if (ppem < 16.0) + { + float2 emsPerPixel = 1.0 / pixelsPerEm; + float2 d = emsPerPixel * (1.0 / 3.0); + float msaa = 0.25 * + (_hb_gpu_slug_single (renderCoord + float2 (-d.x, -d.y), pixelsPerEm, glyphLoc_) + + _hb_gpu_slug_single (renderCoord + float2 ( d.x, -d.y), pixelsPerEm, glyphLoc_) + + _hb_gpu_slug_single (renderCoord + float2 (-d.x, d.y), pixelsPerEm, glyphLoc_) + + _hb_gpu_slug_single (renderCoord + float2 ( d.x, d.y), pixelsPerEm, glyphLoc_)); + + c = lerp (c, msaa, smoothstep (16.0, 8.0, ppem)); + } +#endif + + return c; +} +/* Stem darkening for small sizes. + * + * coverage: output of hb_gpu_draw + * brightness: foreground brightness in [0, 1] + * ppem: pixels per em at this fragment + */ +float hb_gpu_stem_darken (float coverage, float brightness, float ppem) +{ + return pow (coverage, + lerp (pow (2.0, brightness - 0.5), 1.0, + smoothstep (8.0, 48.0, ppem))); +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment.msl b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment.msl new file mode 100644 index 0000000000..bb7da496db --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment.msl @@ -0,0 +1,320 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + + +/* Shared fragment-shader helpers for the hb-gpu renderers. + * + * Requires Metal Shading Language 2.0. + */ + + +#ifndef HB_GPU_UNITS_PER_EM +#define HB_GPU_UNITS_PER_EM 4 +#endif + +#define HB_GPU_INV_UNITS float(1.0 / float(HB_GPU_UNITS_PER_EM)) + + +int4 hb_gpu_fetch (device const short4* hb_gpu_atlas, int offset) +{ + return int4 (hb_gpu_atlas[offset]); +} + +uint _hb_gpu_calc_root_code (float y1, float y2, float y3) +{ + uint i1 = as_type (y1) >> 31U; + uint i2 = as_type (y2) >> 30U; + uint i3 = as_type (y3) >> 29U; + + uint shift = (i2 & 2U) | (i1 & ~2U); + shift = (i3 & 4U) | (shift & ~4U); + + return (0x2E74U >> shift) & 0x0101U; +} + +float2 _hb_gpu_solve_horiz_poly (float2 a, float2 b, float2 p1) +{ + float ra = 1.0 / a.y; + float rb = 0.5 / b.y; + + float d = sqrt (max (b.y * b.y - a.y * p1.y, 0.0)); + float t1 = (b.y - d) * ra; + float t2 = (b.y + d) * ra; + + if (a.y == 0.0) + t1 = t2 = p1.y * rb; + + return float2 ((a.x * t1 - b.x * 2.0) * t1 + p1.x, + (a.x * t2 - b.x * 2.0) * t2 + p1.x); +} + +float2 _hb_gpu_solve_vert_poly (float2 a, float2 b, float2 p1) +{ + float ra = 1.0 / a.x; + float rb = 0.5 / b.x; + + float d = sqrt (max (b.x * b.x - a.x * p1.x, 0.0)); + float t1 = (b.x - d) * ra; + float t2 = (b.x + d) * ra; + + if (a.x == 0.0) + t1 = t2 = p1.x * rb; + + return float2 ((a.y * t1 - b.y * 2.0) * t1 + p1.y, + (a.y * t2 - b.y * 2.0) * t2 + p1.y); +} + +float _hb_gpu_calc_coverage (float xcov, float ycov, float xwgt, float ywgt) +{ + float coverage = max (abs (xcov * xwgt + ycov * ywgt) / + max (xwgt + ywgt, 1.0 / 65536.0), + min (abs (xcov), abs (ycov))); + + return clamp (coverage, 0.0, 1.0); +} + +/* Decoded glyph band info for a pixel position. */ +struct _hb_gpu_glyph_info +{ + int glyphLoc; + int bandBase; + int2 bandIndex; + int numHBands; + int numVBands; + float2 scale; +}; + +_hb_gpu_glyph_info _hb_gpu_decode_glyph (float2 renderCoord, uint glyphLoc_, + device const short4* hb_gpu_atlas) +{ + _hb_gpu_glyph_info gi; + gi.glyphLoc = int (glyphLoc_); + + int4 header0 = hb_gpu_fetch (hb_gpu_atlas, gi.glyphLoc); + int4 header1 = hb_gpu_fetch (hb_gpu_atlas, gi.glyphLoc + 1); + float4 ext = float4 (header0) * HB_GPU_INV_UNITS; + gi.numHBands = header1.r; + gi.numVBands = header1.g; + gi.scale = float2 (float (header1.b), float (header1.a)); + + float2 extSize = ext.zw - ext.xy; + float2 bandScale = float2 (float (gi.numVBands), float (gi.numHBands)) / max (extSize, float2 (1.0 / 65536.0)); + float2 bandOffset = -ext.xy * bandScale; + + gi.bandIndex = clamp (int2 (renderCoord * bandScale + bandOffset), + int2 (0, 0), + int2 (gi.numVBands - 1, gi.numHBands - 1)); + + gi.bandBase = gi.glyphLoc + 2; + return gi; +} + +/* Return pixels per em at this fragment. + * + * renderCoord: em-space sample position + * glyphLoc: texel offset of glyph blob in atlas + */ +float hb_gpu_ppem (float2 renderCoord, uint glyphLoc_, + device const short4* hb_gpu_atlas) +{ + _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_, hb_gpu_atlas); + float2 emsPerPixel = fwidth (renderCoord); + return min (gi.scale.x, gi.scale.y) / + max (emsPerPixel.x, emsPerPixel.y); +} + +/* Return per-pixel curve counts: (horizontal, vertical). */ +int2 _hb_gpu_curve_counts (float2 renderCoord, uint glyphLoc_, + device const short4* hb_gpu_atlas) +{ + _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_, hb_gpu_atlas); + int hCount = hb_gpu_fetch (hb_gpu_atlas, gi.bandBase + gi.bandIndex.y).r; + int vCount = hb_gpu_fetch (hb_gpu_atlas, gi.bandBase + gi.numHBands + gi.bandIndex.x).r; + return int2 (hCount, vCount); +} + +/* Single-sample coverage in [0, 1]. */ +float _hb_gpu_slug_single (float2 renderCoord, float2 pixelsPerEm, uint glyphLoc_, + device const short4* hb_gpu_atlas) +{ + + _hb_gpu_glyph_info gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_, hb_gpu_atlas); + int glyphLoc = gi.glyphLoc; + int bandBase = gi.bandBase; + int numHBands = gi.numHBands; + + float xcov = 0.0; + float xwgt = 0.0; + + int4 hbandData = hb_gpu_fetch (hb_gpu_atlas, bandBase + gi.bandIndex.y); + int hCurveCount = hbandData.r; + /* Symmetric: choose rightward (desc) or leftward (asc) sort */ + float hSplit = float (hbandData.a) * HB_GPU_INV_UNITS; + bool hLeftRay = (renderCoord.x < hSplit); + int hDataOffset = (hLeftRay ? hbandData.b : hbandData.g) + 32768; + + for (int ci = 0; ci < hCurveCount; ci++) + { + int curveOffset = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + hDataOffset + ci).r + 32768; + + int4 raw12 = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + curveOffset); + int4 raw3 = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + curveOffset + 1); + + float4 q12 = float4 (raw12) * HB_GPU_INV_UNITS; + float2 q3 = float2 (raw3.rg) * HB_GPU_INV_UNITS; + + float4 p12 = q12 - float4 (renderCoord, renderCoord); + float2 p3 = q3 - renderCoord; + + if (hLeftRay) { + if (min (min (p12.x, p12.z), p3.x) * pixelsPerEm.x > 0.5) break; + } else { + if (max (max (p12.x, p12.z), p3.x) * pixelsPerEm.x < -0.5) break; + } + + uint code = _hb_gpu_calc_root_code (p12.y, p12.w, p3.y); + if (code != 0U) + { + float2 a = q12.xy - q12.zw * 2.0 + q3; + float2 b = q12.xy - q12.zw; + float2 r = _hb_gpu_solve_horiz_poly (a, b, p12.xy) * pixelsPerEm.x; + /* For leftward ray: saturate(0.5 - r) counts coverage from the left */ + float2 cov = hLeftRay ? clamp (float2 (0.5) - r, 0.0, 1.0) + : clamp (r + float2 (0.5), 0.0, 1.0); + + if ((code & 1U) != 0U) + { + xcov += cov.x; + xwgt = max (xwgt, clamp (1.0 - abs (r.x) * 2.0, 0.0, 1.0)); + } + + if (code > 1U) + { + xcov -= cov.y; + xwgt = max (xwgt, clamp (1.0 - abs (r.y) * 2.0, 0.0, 1.0)); + } + } + } + + float ycov = 0.0; + float ywgt = 0.0; + + int4 vbandData = hb_gpu_fetch (hb_gpu_atlas, bandBase + numHBands + gi.bandIndex.x); + int vCurveCount = vbandData.r; + float vSplit = float (vbandData.a) * HB_GPU_INV_UNITS; + bool vLeftRay = (renderCoord.y < vSplit); + int vDataOffset = (vLeftRay ? vbandData.b : vbandData.g) + 32768; + + for (int ci = 0; ci < vCurveCount; ci++) + { + int curveOffset = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + vDataOffset + ci).r + 32768; + + int4 raw12 = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + curveOffset); + int4 raw3 = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + curveOffset + 1); + + float4 q12 = float4 (raw12) * HB_GPU_INV_UNITS; + float2 q3 = float2 (raw3.rg) * HB_GPU_INV_UNITS; + + float4 p12 = q12 - float4 (renderCoord, renderCoord); + float2 p3 = q3 - renderCoord; + + if (vLeftRay) { + if (min (min (p12.y, p12.w), p3.y) * pixelsPerEm.y > 0.5) break; + } else { + if (max (max (p12.y, p12.w), p3.y) * pixelsPerEm.y < -0.5) break; + } + + uint code = _hb_gpu_calc_root_code (p12.x, p12.z, p3.x); + if (code != 0U) + { + float2 a = q12.xy - q12.zw * 2.0 + q3; + float2 b = q12.xy - q12.zw; + float2 r = _hb_gpu_solve_vert_poly (a, b, p12.xy) * pixelsPerEm.y; + float2 cov = vLeftRay ? clamp (float2 (0.5) - r, 0.0, 1.0) + : clamp (r + float2 (0.5), 0.0, 1.0); + + if ((code & 1U) != 0U) + { + ycov -= cov.x; + ywgt = max (ywgt, clamp (1.0 - abs (r.x) * 2.0, 0.0, 1.0)); + } + + if (code > 1U) + { + ycov += cov.y; + ywgt = max (ywgt, clamp (1.0 - abs (r.y) * 2.0, 0.0, 1.0)); + } + } + } + + return _hb_gpu_calc_coverage (xcov, ycov, xwgt, ywgt); +} + +/* Return coverage in [0, 1]. + * + * renderCoord: em-space sample position + * glyphLoc: texel offset of glyph blob in atlas + * hb_gpu_atlas: device pointer to the atlas buffer + */ +/* The MSAA-aware implementation. Caller supplies pixelsPerEm so + * this function can be invoked from non-uniform control flow (for + * example from a paint op-stream branch where a recomputed fwidth + * would be rejected by strict derivative-uniformity rules). */ +float _hb_gpu_slug (float2 renderCoord, float2 pixelsPerEm, uint glyphLoc_, + device const short4* hb_gpu_atlas) +{ + float c = _hb_gpu_slug_single (renderCoord, pixelsPerEm, glyphLoc_, hb_gpu_atlas); + +#ifndef HB_GPU_NO_MSAA + float ppem = hb_gpu_ppem (renderCoord, glyphLoc_, hb_gpu_atlas); + + if (ppem < 16.0) + { + float2 emsPerPixel = 1.0 / pixelsPerEm; + float2 d = emsPerPixel * (1.0 / 3.0); + float msaa = 0.25 * + (_hb_gpu_slug_single (renderCoord + float2 (-d.x, -d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) + + _hb_gpu_slug_single (renderCoord + float2 ( d.x, -d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) + + _hb_gpu_slug_single (renderCoord + float2 (-d.x, d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) + + _hb_gpu_slug_single (renderCoord + float2 ( d.x, d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas)); + + c = mix (c, msaa, smoothstep (16.0, 8.0, ppem)); + } +#endif + + return c; +} + +/* Stem darkening for small sizes. + * + * coverage: output of hb_gpu_draw + * brightness: foreground brightness in [0, 1] + * ppem: pixels per em at this fragment + */ +float hb_gpu_stem_darken (float coverage, float brightness, float ppem) +{ + return pow (coverage, + mix (pow (2.0, brightness - 0.5), 1.0, + smoothstep (8.0, 48.0, ppem))); +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment.wgsl b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment.wgsl new file mode 100644 index 0000000000..0fac0c384f --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-fragment.wgsl @@ -0,0 +1,329 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + + +/* Shared fragment-shader helpers for the hb-gpu renderers. + * + * Requires WGSL (WebGPU Shading Language). + */ + + +const HB_GPU_UNITS_PER_EM: f32 = 4.0; +const HB_GPU_INV_UNITS: f32 = 1.0 / 4.0; + + +fn hb_gpu_fetch (hb_gpu_atlas: ptr>, read>, + offset: i32) -> vec4 +{ + return (*hb_gpu_atlas)[offset]; +} +fn _hb_gpu_calc_root_code (y1: f32, y2: f32, y3: f32) -> u32 +{ + let i1 = bitcast (y1) >> 31u; + let i2 = bitcast (y2) >> 30u; + let i3 = bitcast (y3) >> 29u; + + var shift = (i2 & 2u) | (i1 & ~2u); + shift = (i3 & 4u) | (shift & ~4u); + + return (0x2E74u >> shift) & 0x0101u; +} + +fn _hb_gpu_solve_horiz_poly (a: vec2f, b: vec2f, p1: vec2f) -> vec2f +{ + let ra = 1.0 / a.y; + let rb = 0.5 / b.y; + + let d = sqrt (max (b.y * b.y - a.y * p1.y, 0.0)); + var t1 = (b.y - d) * ra; + var t2 = (b.y + d) * ra; + + if (a.y == 0.0) { + t1 = p1.y * rb; + t2 = t1; + } + + return vec2f ((a.x * t1 - b.x * 2.0) * t1 + p1.x, + (a.x * t2 - b.x * 2.0) * t2 + p1.x); +} + +fn _hb_gpu_solve_vert_poly (a: vec2f, b: vec2f, p1: vec2f) -> vec2f +{ + let ra = 1.0 / a.x; + let rb = 0.5 / b.x; + + let d = sqrt (max (b.x * b.x - a.x * p1.x, 0.0)); + var t1 = (b.x - d) * ra; + var t2 = (b.x + d) * ra; + + if (a.x == 0.0) { + t1 = p1.x * rb; + t2 = t1; + } + + return vec2f ((a.y * t1 - b.y * 2.0) * t1 + p1.y, + (a.y * t2 - b.y * 2.0) * t2 + p1.y); +} + +fn _hb_gpu_calc_coverage (xcov: f32, ycov: f32, xwgt: f32, ywgt: f32) -> f32 +{ + let coverage = max (abs (xcov * xwgt + ycov * ywgt) / + max (xwgt + ywgt, 1.0 / 65536.0), + min (abs (xcov), abs (ycov))); + + return clamp (coverage, 0.0, 1.0); +} + +/* Decoded glyph band info for a pixel position. */ +struct _hb_gpu_glyph_info +{ + glyphLoc: i32, + bandBase: i32, + bandIndex: vec2, + numHBands: i32, + numVBands: i32, + scale: vec2f, +} + +fn _hb_gpu_decode_glyph (renderCoord: vec2f, glyphLoc_: u32, + hb_gpu_atlas: ptr>, read>) -> _hb_gpu_glyph_info +{ + var gi: _hb_gpu_glyph_info; + gi.glyphLoc = i32 (glyphLoc_); + + let header0 = hb_gpu_fetch (hb_gpu_atlas, gi.glyphLoc); + let header1 = hb_gpu_fetch (hb_gpu_atlas, gi.glyphLoc + 1); + let ext = vec4f (header0) * HB_GPU_INV_UNITS; + gi.numHBands = header1.r; + gi.numVBands = header1.g; + gi.scale = vec2f (f32 (header1.b), f32 (header1.a)); + + let extSize = ext.zw - ext.xy; + let bandScale = vec2f (f32 (gi.numVBands), f32 (gi.numHBands)) / max (extSize, vec2f (1.0 / 65536.0)); + let bandOffset = -ext.xy * bandScale; + + gi.bandIndex = clamp (vec2 (renderCoord * bandScale + bandOffset), + vec2 (0, 0), + vec2 (gi.numVBands - 1, gi.numHBands - 1)); + + gi.bandBase = gi.glyphLoc + 2; + return gi; +} + +/* Return pixels per em at this fragment. + * + * renderCoord: em-space sample position + * glyphLoc: texel offset of glyph blob in atlas + */ +fn hb_gpu_ppem (renderCoord: vec2f, glyphLoc_: u32, + hb_gpu_atlas: ptr>, read>) -> f32 +{ + let gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_, hb_gpu_atlas); + let emsPerPixel = fwidth (renderCoord); + return min (gi.scale.x, gi.scale.y) / + max (emsPerPixel.x, emsPerPixel.y); +} + +/* Return per-pixel curve counts: (horizontal, vertical). */ +fn _hb_gpu_curve_counts (renderCoord: vec2f, glyphLoc_: u32, + hb_gpu_atlas: ptr>, read>) -> vec2 +{ + let gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_, hb_gpu_atlas); + let hCount = hb_gpu_fetch (hb_gpu_atlas, gi.bandBase + gi.bandIndex.y).r; + let vCount = hb_gpu_fetch (hb_gpu_atlas, gi.bandBase + gi.numHBands + gi.bandIndex.x).r; + return vec2 (hCount, vCount); +} + +/* Single-sample coverage in [0, 1]. */ +fn _hb_gpu_slug_single (renderCoord: vec2f, pixelsPerEm: vec2f, glyphLoc_: u32, + hb_gpu_atlas: ptr>, read>) -> f32 +{ + + let gi = _hb_gpu_decode_glyph (renderCoord, glyphLoc_, hb_gpu_atlas); + let glyphLoc = gi.glyphLoc; + let bandBase = gi.bandBase; + let numHBands = gi.numHBands; + + var xcov: f32 = 0.0; + var xwgt: f32 = 0.0; + + let hbandData = hb_gpu_fetch (hb_gpu_atlas, bandBase + gi.bandIndex.y); + let hCurveCount = hbandData.r; + /* Symmetric: choose rightward (desc) or leftward (asc) sort */ + let hSplit = f32 (hbandData.a) * HB_GPU_INV_UNITS; + let hLeftRay = (renderCoord.x < hSplit); + var hDataOffset: i32; + if (hLeftRay) { hDataOffset = hbandData.b + 32768; } + else { hDataOffset = hbandData.g + 32768; } + + for (var ci: i32 = 0; ci < hCurveCount; ci++) + { + let curveOffset = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + hDataOffset + ci).r + 32768; + + let raw12 = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + curveOffset); + let raw3 = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + curveOffset + 1); + + let q12 = vec4f (raw12) * HB_GPU_INV_UNITS; + let q3 = vec2f (vec2 (raw3.r, raw3.g)) * HB_GPU_INV_UNITS; + + let p12 = q12 - vec4f (renderCoord, renderCoord); + let p3 = q3 - renderCoord; + + if (hLeftRay) { + if (min (min (p12.x, p12.z), p3.x) * pixelsPerEm.x > 0.5) { break; } + } else { + if (max (max (p12.x, p12.z), p3.x) * pixelsPerEm.x < -0.5) { break; } + } + + let code = _hb_gpu_calc_root_code (p12.y, p12.w, p3.y); + if (code != 0u) + { + let a = q12.xy - q12.zw * 2.0 + q3; + let b = q12.xy - q12.zw; + let r = _hb_gpu_solve_horiz_poly (a, b, p12.xy) * pixelsPerEm.x; + /* For leftward ray: saturate(0.5 - r) counts coverage from the left */ + var cov: vec2f; + if (hLeftRay) { cov = clamp (vec2f (0.5) - r, vec2f (0.0), vec2f (1.0)); } + else { cov = clamp (r + vec2f (0.5), vec2f (0.0), vec2f (1.0)); } + + if ((code & 1u) != 0u) + { + xcov += cov.x; + xwgt = max (xwgt, clamp (1.0 - abs (r.x) * 2.0, 0.0, 1.0)); + } + + if (code > 1u) + { + xcov -= cov.y; + xwgt = max (xwgt, clamp (1.0 - abs (r.y) * 2.0, 0.0, 1.0)); + } + } + } + + var ycov: f32 = 0.0; + var ywgt: f32 = 0.0; + + let vbandData = hb_gpu_fetch (hb_gpu_atlas, bandBase + numHBands + gi.bandIndex.x); + let vCurveCount = vbandData.r; + let vSplit = f32 (vbandData.a) * HB_GPU_INV_UNITS; + let vLeftRay = (renderCoord.y < vSplit); + var vDataOffset: i32; + if (vLeftRay) { vDataOffset = vbandData.b + 32768; } + else { vDataOffset = vbandData.g + 32768; } + + for (var ci: i32 = 0; ci < vCurveCount; ci++) + { + let curveOffset = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + vDataOffset + ci).r + 32768; + + let raw12 = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + curveOffset); + let raw3 = hb_gpu_fetch (hb_gpu_atlas, glyphLoc + curveOffset + 1); + + let q12 = vec4f (raw12) * HB_GPU_INV_UNITS; + let q3 = vec2f (vec2 (raw3.r, raw3.g)) * HB_GPU_INV_UNITS; + + let p12 = q12 - vec4f (renderCoord, renderCoord); + let p3 = q3 - renderCoord; + + if (vLeftRay) { + if (min (min (p12.y, p12.w), p3.y) * pixelsPerEm.y > 0.5) { break; } + } else { + if (max (max (p12.y, p12.w), p3.y) * pixelsPerEm.y < -0.5) { break; } + } + + let code = _hb_gpu_calc_root_code (p12.x, p12.z, p3.x); + if (code != 0u) + { + let a = q12.xy - q12.zw * 2.0 + q3; + let b = q12.xy - q12.zw; + let r = _hb_gpu_solve_vert_poly (a, b, p12.xy) * pixelsPerEm.y; + var cov: vec2f; + if (vLeftRay) { cov = clamp (vec2f (0.5) - r, vec2f (0.0), vec2f (1.0)); } + else { cov = clamp (r + vec2f (0.5), vec2f (0.0), vec2f (1.0)); } + + if ((code & 1u) != 0u) + { + ycov -= cov.x; + ywgt = max (ywgt, clamp (1.0 - abs (r.x) * 2.0, 0.0, 1.0)); + } + + if (code > 1u) + { + ycov += cov.y; + ywgt = max (ywgt, clamp (1.0 - abs (r.y) * 2.0, 0.0, 1.0)); + } + } + } + + return _hb_gpu_calc_coverage (xcov, ycov, xwgt, ywgt); +} + +/* Return coverage in [0, 1]. + * + * renderCoord: em-space sample position + * glyphLoc: texel offset of glyph blob in atlas + * hb_gpu_atlas: storage buffer pointer to the atlas + */ +/* The MSAA-aware implementation. Caller supplies pixelsPerEm so + * this function can be invoked from non-uniform control flow (for + * example inside an op-stream branch in hb-gpu-paint-fragment.wgsl, + * where WGSL would otherwise reject an fwidth call). */ +fn _hb_gpu_slug (renderCoord: vec2f, pixelsPerEm: vec2f, glyphLoc_: u32, + hb_gpu_atlas: ptr>, read>) -> f32 +{ + var c = _hb_gpu_slug_single (renderCoord, pixelsPerEm, glyphLoc_, hb_gpu_atlas); + + /* Inline ppem from pixelsPerEm so we don't re-enter hb_gpu_ppem + * (which would call fwidth again -- rejected by WGSL when this + * function is invoked from non-uniform control flow). */ + let gi_pp = _hb_gpu_decode_glyph (renderCoord, glyphLoc_, hb_gpu_atlas); + let ppem = min (gi_pp.scale.x, gi_pp.scale.y) * + min (pixelsPerEm.x, pixelsPerEm.y); + + if (ppem < 16.0) + { + let emsPerPixel = 1.0 / pixelsPerEm; + let d = emsPerPixel * (1.0 / 3.0); + let msaa = 0.25 * + (_hb_gpu_slug_single (renderCoord + vec2f (-d.x, -d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) + + _hb_gpu_slug_single (renderCoord + vec2f ( d.x, -d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) + + _hb_gpu_slug_single (renderCoord + vec2f (-d.x, d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas) + + _hb_gpu_slug_single (renderCoord + vec2f ( d.x, d.y), pixelsPerEm, glyphLoc_, hb_gpu_atlas)); + + c = mix (c, msaa, smoothstep (16.0, 8.0, ppem)); + } + + return c; +} +/* Stem darkening for small sizes. + * + * coverage: output of hb_gpu_draw + * brightness: foreground brightness in [0, 1] + * ppem: pixels per em at this fragment + */ +fn hb_gpu_stem_darken (coverage: f32, brightness: f32, ppem: f32) -> f32 +{ + return pow (coverage, + mix (pow (2.0, brightness - 0.5), 1.0, + smoothstep (8.0, 48.0, ppem))); +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment-glsl.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment-glsl.hh new file mode 100644 index 0000000000..c6d00aef0d --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment-glsl.hh @@ -0,0 +1,409 @@ +static const char *hb_gpu_paint_fragment_glsl = +"/*\n" +" * Copyright (C) 2026 Behdad Esfahbod\n" +" *\n" +" * This is part of HarfBuzz, a text shaping library.\n" +" *\n" +" * Permission is hereby granted, without written agreement and without\n" +" * license or royalty fees, to use, copy, modify, and distribute this\n" +" * software and its documentation for any purpose, provided that the\n" +" * above copyright notice and the following two paragraphs appear in\n" +" * all copies of this software.\n" +" *\n" +" * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\n" +" * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\n" +" * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\n" +" * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n" +" * DAMAGE.\n" +" *\n" +" * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\n" +" * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n" +" * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n" +" * ON AN \"AS IS\" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\n" +" * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n" +" */\n" +"\n" +"\n" +"/* Paint-renderer fragment shader.\n" +" *\n" +" * Assumes the shared fragment helpers (hb-gpu-fragment.glsl) and\n" +" * the draw-renderer fragment helpers (hb-gpu-draw-fragment.glsl)\n" +" * are prepended to this source. The draw helper provides\n" +" * hb_gpu_draw() which this interpreter calls to compute clip-glyph\n" +" * coverage.\n" +" */\n" +"\n" +"\n" +"/* Fetch the i'th stop of a gradient color line starting at @stops_base\n" +" * (2 texels per stop). Resolves is_foreground to @foreground. */\n" +"vec4 _hb_gpu_stop_color (int stops_base, int i, vec4 foreground, out float offset)\n" +"{\n" +" ivec4 a = hb_gpu_fetch (stops_base + i * 2);\n" +" offset = float (a.r) / 32767.0;\n" +" ivec4 b = hb_gpu_fetch (stops_base + i * 2 + 1);\n" +" if ((a.g & 1) != 0)\n" +" return vec4 (foreground.rgb, foreground.a * (float (b.a) / 32767.0));\n" +" return vec4 (b) / 32767.0;\n" +"}\n" +"\n" +"/* Apply the color-line extend mode to a projected `t` value. */\n" +"float _hb_gpu_extend_t (float t, int extend)\n" +"{\n" +" if (extend == 1) { /* HB_PAINT_EXTEND_REPEAT */\n" +" return t - floor (t);\n" +" } else if (extend == 2) { /* HB_PAINT_EXTEND_REFLECT */\n" +" float u = t - 2.0 * floor (t * 0.5);\n" +" return u > 1.0 ? 2.0 - u : u;\n" +" }\n" +" return clamp (t, 0.0, 1.0); /* PAD (default) */\n" +"}\n" +"\n" +"/* Walk stops starting at @stops_base and return the sampled color\n" +" * at @t. Same logic reused by all gradient subtypes. */\n" +"vec4 _hb_gpu_eval_stops (int stops_base, int stop_count, float t, vec4 foreground)\n" +"{\n" +" float off_prev;\n" +" vec4 col_prev = _hb_gpu_stop_color (stops_base, 0, foreground, off_prev);\n" +" if (t <= off_prev)\n" +" return col_prev;\n" +" for (int i = 1; i < stop_count; i++)\n" +" {\n" +" float off;\n" +" vec4 col = _hb_gpu_stop_color (stops_base, i, foreground, off);\n" +" if (t <= off)\n" +" {\n" +" float span = off - off_prev;\n" +" float f = span > 1e-6 ? (t - off_prev) / span : 0.0;\n" +" /* Interpolate in premultiplied space per OpenType COLR spec. */\n" +" vec4 p0 = vec4 (col_prev.rgb * col_prev.a, col_prev.a);\n" +" vec4 p1 = vec4 (col.rgb * col.a, col.a);\n" +" vec4 pm = mix (p0, p1, f);\n" +" return pm.a > 1e-6 ? vec4 (pm.rgb / pm.a, pm.a) : vec4 (0.0);\n" +" }\n" +" col_prev = col;\n" +" off_prev = off;\n" +" }\n" +" return col_prev;\n" +"}\n" +"\n" +"/* Apply the stored 2x2 M^-1 (row-major i16 Q10) to @v. Scaling\n" +" * renderCoord deltas back into canonical gradient space. */\n" +"vec2 _hb_gpu_apply_minv (ivec4 m, vec2 v)\n" +"{\n" +" vec4 mf = vec4 (m) * (1.0 / 1024.0);\n" +" return vec2 (mf.x * v.x + mf.y * v.y,\n" +" mf.z * v.x + mf.w * v.y);\n" +"}\n" +"\n" +"/* Sample a linear gradient whose param blob starts at @grad_base:\n" +" * texel 0: (p0_rendered.x, p0_rendered.y, d_canonical.x, d_canonical.y)\n" +" * texel 1: L^-1 as i16 Q10 (row-major)\n" +" * texels 2..: stops (2 texels each)\n" +" * Evaluate t in untransformed space. */\n" +"vec4 _hb_gpu_sample_linear (vec2 renderCoord, int grad_base,\n" +" int stop_count, int extend, vec4 foreground)\n" +"{\n" +" ivec4 t0 = hb_gpu_fetch (grad_base);\n" +" ivec4 m = hb_gpu_fetch (grad_base + 1);\n" +" vec2 p0_r = vec2 (float (t0.r), float (t0.g));\n" +" vec2 d = vec2 (float (t0.b), float (t0.a));\n" +" float denom = dot (d, d);\n" +" if (denom < 1e-6) return vec4 (0.0);\n" +" vec2 p = _hb_gpu_apply_minv (m, renderCoord - p0_r);\n" +" float t = dot (p, d) / denom;\n" +" t = _hb_gpu_extend_t (t, extend);\n" +"\n" +" return _hb_gpu_eval_stops (grad_base + 2, stop_count, t, foreground);\n" +"}\n" +"\n" +"/* Sample a two-circle radial gradient whose param blob starts at\n" +" * @grad_base:\n" +" * texel 0: (c0_rendered.x, c0_rendered.y, d_canonical.x, d_canonical.y)\n" +" * d = c1 - c0 in untransformed space\n" +" * texel 1: (r0, r1, _, _) in untransformed font units\n" +" * texel 2: L^-1 as i16 Q10 (row-major)\n" +" * texels 3..: stops (2 texels each)\n" +" * Solves |p - t*cd|^2 = (r0 + t*(r1-r0))^2 with p in untransformed\n" +" * space, so non-uniform scale / shear on the transform becomes a\n" +" * proper ellipse-in-rendered-space instead of a scalar-fudge. */\n" +"vec4 _hb_gpu_sample_radial (vec2 renderCoord, int grad_base,\n" +" int stop_count, int extend, vec4 foreground)\n" +"{\n" +" ivec4 t0 = hb_gpu_fetch (grad_base);\n" +" ivec4 t1 = hb_gpu_fetch (grad_base + 1);\n" +" ivec4 m = hb_gpu_fetch (grad_base + 2);\n" +" vec2 c0_r = vec2 (float (t0.r), float (t0.g));\n" +" vec2 cd = vec2 (float (t0.b), float (t0.a));\n" +" float r0 = float (t1.r);\n" +" float r1 = float (t1.g);\n" +"\n" +" float dr = r1 - r0;\n" +" vec2 p = _hb_gpu_apply_minv (m, renderCoord - c0_r);\n" +"\n" +" float A = dot (cd, cd) - dr * dr;\n" +" float B = -2.0 * (dot (p, cd) + r0 * dr);\n" +" float C = dot (p, p) - r0 * r0;\n" +"\n" +" float t;\n" +" if (abs (A) > 1e-6)\n" +" {\n" +" float disc = B * B - 4.0 * A * C;\n" +" if (disc < 0.0) return vec4 (0.0);\n" +" float sq = sqrt (disc);\n" +" /* Prefer the larger root; fall back to the smaller if the\n" +" * larger gives a negative interpolated radius. */\n" +" float t1 = (-B + sq) / (2.0 * A);\n" +" float t2 = (-B - sq) / (2.0 * A);\n" +" t = (r0 + t1 * dr >= 0.0) ? t1 : t2;\n" +" }\n" +" else\n" +" {\n" +" if (abs (B) < 1e-6) return vec4 (0.0);\n" +" t = -C / B;\n" +" }\n" +"\n" +" t = _hb_gpu_extend_t (t, extend);\n" +" return _hb_gpu_eval_stops (grad_base + 3, stop_count, t, foreground);\n" +"}\n" +"\n" +"/* Sample a sweep gradient whose param blob starts at @grad_base:\n" +" * texel 0: (center_rendered.x, center_rendered.y, start_q14, end_q14)\n" +" * start/end are Q14 fractions of pi in untransformed space\n" +" * texel 1: L^-1 as i16 Q10 (row-major)\n" +" * texels 2..: stops (2 texels each) */\n" +"vec4 _hb_gpu_sample_sweep (vec2 renderCoord, int grad_base,\n" +" int stop_count, int extend, vec4 foreground)\n" +"{\n" +" ivec4 t0 = hb_gpu_fetch (grad_base);\n" +" ivec4 m = hb_gpu_fetch (grad_base + 1);\n" +" vec2 c_r = vec2 (float (t0.r), float (t0.g));\n" +" float a0 = float (t0.b) / 16384.0; /* fraction of pi */\n" +" float a1 = float (t0.a) / 16384.0;\n" +" float span = a1 - a0;\n" +" if (abs (span) < 1e-6) return vec4 (0.0);\n" +"\n" +" vec2 p = _hb_gpu_apply_minv (m, renderCoord - c_r);\n" +" /* atan2 returns (-pi, pi]; normalize to [0, 2) fractions of pi. */\n" +" float ang = atan (p.y, p.x) / 3.14159265358979;\n" +" if (ang < 0.0) ang += 2.0;\n" +" float t = (ang - a0) / span;\n" +" t = _hb_gpu_extend_t (t, extend);\n" +" return _hb_gpu_eval_stops (grad_base + 2, stop_count, t, foreground);\n" +"}\n" +"\n" +"/* Composite two premultiplied RGBA layers using one of the COLRv1\n" +" * compositing modes. Unsupported modes fall back to SRC_OVER.\n" +" * Values match hb_paint_composite_mode_t. */\n" +"vec4 _hb_gpu_composite (vec4 src, vec4 dst, int mode)\n" +"{\n" +" vec4 r = src + dst * (1.0 - src.a); /* SRC_OVER default */\n" +"\n" +" /* Approximate unsupported COLRv1 modes with the nearest Porter-Duff\n" +" * mode we do implement. Better a recognizable rendering than a\n" +" * silent SRC_OVER fallback. DIFFERENCE / EXCLUSION / HSL_* are\n" +" * not similar enough to anything we have, so they still fall\n" +" * through to SRC_OVER below. */\n" +" if (mode == 14 || mode == 18 || mode == 19) mode = 23; /* OVERLAY / COLOR_BURN / HARD_LIGHT -> MULTIPLY */\n" +" else if (mode == 17 || mode == 20) mode = 13; /* COLOR_DODGE / SOFT_LIGHT -> SCREEN */\n" +"\n" +" if (mode == 0) r = vec4 (0.0); /* CLEAR */\n" +" else if (mode == 1) r = src; /* SRC */\n" +" else if (mode == 2) r = dst; /* DST */\n" +" else if (mode == 4) r = dst + src * (1.0 - dst.a); /* DST_OVER */\n" +" else if (mode == 5) r = src * dst.a; /* SRC_IN */\n" +" else if (mode == 6) r = dst * src.a; /* DST_IN */\n" +" else if (mode == 7) r = src * (1.0 - dst.a); /* SRC_OUT */\n" +" else if (mode == 8) r = dst * (1.0 - src.a); /* DST_OUT */\n" +" else if (mode == 9) /* SRC_ATOP */\n" +" r = src * dst.a + dst * (1.0 - src.a);\n" +" else if (mode == 10) /* DST_ATOP */\n" +" r = dst * src.a + src * (1.0 - dst.a);\n" +" else if (mode == 11) /* XOR */\n" +" r = src * (1.0 - dst.a) + dst * (1.0 - src.a);\n" +" else if (mode == 12) /* PLUS */\n" +" r = min (src + dst, vec4 (1.0));\n" +" else if (mode == 13) { /* SCREEN (premul) */\n" +" r.rgb = src.rgb + dst.rgb - src.rgb * dst.rgb;\n" +" r.a = src.a + dst.a - src.a * dst.a;\n" +" }\n" +" else if (mode == 15) { /* DARKEN */\n" +" r.rgb = min (src.rgb * dst.a, dst.rgb * src.a)\n" +" + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a);\n" +" r.a = src.a + dst.a - src.a * dst.a;\n" +" }\n" +" else if (mode == 16) { /* LIGHTEN */\n" +" r.rgb = max (src.rgb * dst.a, dst.rgb * src.a)\n" +" + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a);\n" +" r.a = src.a + dst.a - src.a * dst.a;\n" +" }\n" +" else if (mode == 23) { /* MULTIPLY (premul) */\n" +" r.rgb = src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a)\n" +" + src.rgb * dst.rgb;\n" +" r.a = src.a + dst.a - src.a * dst.a;\n" +" }\n" +" /* SRC_OVER (3) and DIFFERENCE / EXCLUSION / HSL_* (21, 22, 24-27)\n" +" * fall through to the SRC_OVER default. */\n" +"\n" +" return r;\n" +"}\n" +"\n" +"/* Wrap _hb_gpu_slug with a sub-glyph extents bail-out. Many\n" +" * paint layers cover a small region of the outer glyph quad; for\n" +" * fragments outside the layer's bbox (with an AA + MSAA-spread\n" +" * margin) the slug coverage is exactly 0, so we can skip the\n" +" * band/curve walk entirely. */\n" +"float _hb_gpu_slug_clipped (vec2 renderCoord, vec2 pixelsPerEm, uint glyphLoc_)\n" +"{\n" +" ivec4 header0 = hb_gpu_fetch (int (glyphLoc_));\n" +" vec4 ext = vec4 (header0) * HB_GPU_INV_UNITS;\n" +" vec2 margin = 2.0 / pixelsPerEm;\n" +" if (any (lessThan (renderCoord, ext.xy - margin)) ||\n" +" any (greaterThan (renderCoord, ext.zw + margin)))\n" +" return 0.0;\n" +" return _hb_gpu_slug (renderCoord, pixelsPerEm, glyphLoc_);\n" +"}\n" +"\n" +"/* Combine slug coverages from all clip outlines on the current\n" +" * layer. Factored out of LAYER_SOLID and LAYER_GRADIENT so the\n" +" * shader has one set of inlined slug walks instead of two. flags\n" +" * bits: 0x100 = HAS_CLIP2; 0x200 = HAS_CLIP3 (HAS_CLIP3 implies\n" +" * HAS_CLIP2). */\n" +"float _hb_gpu_layer_coverage (vec2 renderCoord, vec2 pixelsPerEm,\n" +" int base, int flags,\n" +" int clip1_payload, int clip2_payload, int clip3_payload)\n" +"{\n" +" float cov = _hb_gpu_slug_clipped (renderCoord, pixelsPerEm,\n" +" uint (base + clip1_payload));\n" +" if ((flags & 0x100) != 0)\n" +" {\n" +" cov *= _hb_gpu_slug_clipped (renderCoord, pixelsPerEm,\n" +" uint (base + clip2_payload));\n" +" if ((flags & 0x200) != 0)\n" +" cov *= _hb_gpu_slug_clipped (renderCoord, pixelsPerEm,\n" +" uint (base + clip3_payload));\n" +" }\n" +" return cov;\n" +"}\n" +"\n" +"/* Walks the paint blob's flat op stream and returns a\n" +" * premultiplied RGBA coverage value for the current fragment.\n" +" *\n" +" * glyphLoc: atlas texel offset of the paint-blob header.\n" +" * foreground: caller-supplied foreground color, used when an op\n" +" * sets the is_foreground flag.\n" +" */\n" +"#define HB_GPU_PAINT_GROUP_DEPTH 4\n" +"\n" +"vec4 hb_gpu_paint (vec2 renderCoord, uint glyphLoc, vec4 foreground,\n" +" out float coverage)\n" +"{\n" +" /* fwidth once, at uniform control flow: every per-layer\n" +" * coverage sample below uses this pre-computed pixelsPerEm via\n" +" * _hb_gpu_slug. */\n" +" vec2 pixelsPerEm = 1.0 / fwidth (renderCoord);\n" +"\n" +" int base = int (glyphLoc);\n" +" ivec4 h0 = hb_gpu_fetch (base); /* (num_ops, _, _, _) */\n" +" ivec4 h2 = hb_gpu_fetch (base + 2); /* (ops_offset, _, _, _) */\n" +" int num_ops = h0.r;\n" +" int cursor = base + h2.r;\n" +"\n" +" vec4 acc = vec4 (0.0);\n" +" vec4 group_stack[HB_GPU_PAINT_GROUP_DEPTH];\n" +" int sp = 0;\n" +" coverage = 0.0;\n" +"\n" +" for (int i = 0; i < num_ops; i++)\n" +" {\n" +" ivec4 op = hb_gpu_fetch (cursor);\n" +" int op_type = op.r;\n" +" int aux = op.g;\n" +" int payload = (op.b << 16) | (op.a & 0xffff);\n" +"\n" +" if (op_type == 0) /* LAYER_SOLID */\n" +" {\n" +" /* texel 1: (clip2_hi, clip2_lo, clip3_hi, clip3_lo) -- valid\n" +" * per HAS_CLIP2 / HAS_CLIP3 flag bits.\n" +" * texel 2: RGBA as signed Q15. */\n" +" ivec4 op2 = hb_gpu_fetch (cursor + 1);\n" +" int clip2_payload = (op2.r << 16) | (op2.g & 0xffff);\n" +" int clip3_payload = (op2.b << 16) | (op2.a & 0xffff);\n" +" ivec4 ct = hb_gpu_fetch (cursor + 2);\n" +" vec4 col = ((aux & 1) != 0)\n" +" ? vec4 (foreground.rgb, foreground.a * (float (ct.a) / 32767.0))\n" +" : vec4 (ct) / 32767.0;\n" +"\n" +" float cov = _hb_gpu_layer_coverage (renderCoord, pixelsPerEm,\n" +" base, aux,\n" +" payload, clip2_payload, clip3_payload);\n" +" coverage = max (coverage, cov);\n" +" vec4 src = vec4 (col.rgb * col.a, col.a) * cov;\n" +" acc = src + acc * (1.0 - src.a);\n" +"\n" +" cursor += 3;\n" +" }\n" +" else if (op_type == 1) /* LAYER_GRADIENT */\n" +" {\n" +" /* texel 1: (clip2_hi, clip2_lo, clip3_hi, clip3_lo) -- valid\n" +" * per HAS_CLIP2 / HAS_CLIP3 flag bits.\n" +" * texel 2: (grad_payload_hi, grad_payload_lo, extend, stop_count) */\n" +" ivec4 op2 = hb_gpu_fetch (cursor + 1);\n" +" int clip2_payload = (op2.r << 16) | (op2.g & 0xffff);\n" +" int clip3_payload = (op2.b << 16) | (op2.a & 0xffff);\n" +" ivec4 op3 = hb_gpu_fetch (cursor + 2);\n" +" int grad_payload = (op3.r << 16) | (op3.g & 0xffff);\n" +" int extend = op3.b;\n" +" int stop_count = op3.a;\n" +" int subtype = aux & 0xff;\n" +"\n" +" vec4 col = vec4 (0.0);\n" +" if (subtype == 0) /* linear */\n" +" col = _hb_gpu_sample_linear (renderCoord,\n" +" base + grad_payload,\n" +" stop_count, extend, foreground);\n" +" else if (subtype == 1) /* radial */\n" +" col = _hb_gpu_sample_radial (renderCoord,\n" +" base + grad_payload,\n" +" stop_count, extend, foreground);\n" +" else if (subtype == 2) /* sweep */\n" +" col = _hb_gpu_sample_sweep (renderCoord,\n" +" base + grad_payload,\n" +" stop_count, extend, foreground);\n" +"\n" +" float cov = _hb_gpu_layer_coverage (renderCoord, pixelsPerEm,\n" +" base, aux,\n" +" payload, clip2_payload, clip3_payload);\n" +" coverage = max (coverage, cov);\n" +" vec4 src = vec4 (col.rgb * col.a, col.a) * cov;\n" +" acc = src + acc * (1.0 - src.a);\n" +"\n" +" cursor += 3;\n" +" }\n" +" else if (op_type == 2) /* PUSH_GROUP */\n" +" {\n" +" if (sp < HB_GPU_PAINT_GROUP_DEPTH) {\n" +" group_stack[sp] = acc;\n" +" sp++;\n" +" }\n" +" acc = vec4 (0.0);\n" +" cursor += 1;\n" +" }\n" +" else if (op_type == 3) /* POP_GROUP */\n" +" {\n" +" if (sp > 0) {\n" +" sp--;\n" +" vec4 src = acc;\n" +" vec4 dst = group_stack[sp];\n" +" acc = _hb_gpu_composite (src, dst, aux);\n" +" }\n" +" cursor += 1;\n" +" }\n" +" else\n" +" {\n" +" break;\n" +" }\n" +" }\n" +"\n" +" return acc;\n" +"}\n" +; diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment-hlsl.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment-hlsl.hh new file mode 100644 index 0000000000..844782f4d6 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment-hlsl.hh @@ -0,0 +1,352 @@ +static const char *hb_gpu_paint_fragment_hlsl = +"/*\n" +" * Copyright (C) 2026 Behdad Esfahbod\n" +" *\n" +" * This is part of HarfBuzz, a text shaping library.\n" +" *\n" +" * Permission is hereby granted, without written agreement and without\n" +" * license or royalty fees, to use, copy, modify, and distribute this\n" +" * software and its documentation for any purpose, provided that the\n" +" * above copyright notice and the following two paragraphs appear in\n" +" * all copies of this software.\n" +" *\n" +" * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\n" +" * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\n" +" * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\n" +" * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n" +" * DAMAGE.\n" +" *\n" +" * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\n" +" * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n" +" * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n" +" * ON AN \"AS IS\" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\n" +" * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n" +" */\n" +"\n" +"\n" +"/* Paint-renderer fragment shader (HLSL).\n" +" *\n" +" * Assumes the shared fragment helpers (hb-gpu-fragment.hlsl) and\n" +" * the draw-renderer fragment helpers (hb-gpu-draw-fragment.hlsl)\n" +" * are prepended to this source.\n" +" */\n" +"\n" +"\n" +"float4 _hb_gpu_stop_color (int stops_base, int i, float4 foreground,\n" +" out float offset)\n" +"{\n" +" int4 a = hb_gpu_fetch (stops_base + i * 2);\n" +" offset = (float) a.r / 32767.0;\n" +" int4 b = hb_gpu_fetch (stops_base + i * 2 + 1);\n" +" if ((a.g & 1) != 0)\n" +" return float4 (foreground.rgb, foreground.a * ((float) b.a / 32767.0));\n" +" return (float4) b / 32767.0;\n" +"}\n" +"\n" +"float _hb_gpu_extend_t (float t, int extend)\n" +"{\n" +" if (extend == 1) return t - floor (t);\n" +" if (extend == 2) {\n" +" float u = t - 2.0 * floor (t * 0.5);\n" +" return u > 1.0 ? 2.0 - u : u;\n" +" }\n" +" return clamp (t, 0.0, 1.0);\n" +"}\n" +"\n" +"float4 _hb_gpu_eval_stops (int stops_base, int stop_count, float t, float4 foreground)\n" +"{\n" +" float off_prev;\n" +" float4 col_prev = _hb_gpu_stop_color (stops_base, 0, foreground, off_prev);\n" +" if (t <= off_prev) return col_prev;\n" +" for (int i = 1; i < stop_count; i++)\n" +" {\n" +" float off;\n" +" float4 col = _hb_gpu_stop_color (stops_base, i, foreground, off);\n" +" if (t <= off)\n" +" {\n" +" float span = off - off_prev;\n" +" float f = span > 1e-6 ? (t - off_prev) / span : 0.0;\n" +" float4 p0 = float4 (col_prev.rgb * col_prev.a, col_prev.a);\n" +" float4 p1 = float4 (col.rgb * col.a, col.a);\n" +" float4 pm = lerp (p0, p1, f);\n" +" return pm.a > 1e-6 ? float4 (pm.rgb / pm.a, pm.a) : float4 (0.0);\n" +" }\n" +" col_prev = col;\n" +" off_prev = off;\n" +" }\n" +" return col_prev;\n" +"}\n" +"\n" +"/* Apply the stored 2x2 M^-1 (row-major i16 Q10) to a vector. */\n" +"float2 _hb_gpu_apply_minv (int4 m, float2 v)\n" +"{\n" +" float4 mf = (float4) m * (1.0 / 1024.0);\n" +" return float2 (mf.x * v.x + mf.y * v.y,\n" +" mf.z * v.x + mf.w * v.y);\n" +"}\n" +"\n" +"float4 _hb_gpu_sample_linear (float2 renderCoord, int grad_base,\n" +" int stop_count, int extend, float4 foreground)\n" +"{\n" +" int4 t0 = hb_gpu_fetch (grad_base);\n" +" int4 m = hb_gpu_fetch (grad_base + 1);\n" +" float2 p0_r = float2 ((float) t0.r, (float) t0.g);\n" +" float2 d = float2 ((float) t0.b, (float) t0.a);\n" +" float denom = dot (d, d);\n" +" if (denom < 1e-6) return float4 (0.0, 0.0, 0.0, 0.0);\n" +" float2 p = _hb_gpu_apply_minv (m, renderCoord - p0_r);\n" +" float t = dot (p, d) / denom;\n" +" t = _hb_gpu_extend_t (t, extend);\n" +" return _hb_gpu_eval_stops (grad_base + 2, stop_count, t, foreground);\n" +"}\n" +"\n" +"float4 _hb_gpu_sample_radial (float2 renderCoord, int grad_base,\n" +" int stop_count, int extend, float4 foreground)\n" +"{\n" +" int4 t0 = hb_gpu_fetch (grad_base);\n" +" int4 t1 = hb_gpu_fetch (grad_base + 1);\n" +" int4 m = hb_gpu_fetch (grad_base + 2);\n" +" float2 c0_r = float2 ((float) t0.r, (float) t0.g);\n" +" float2 cd = float2 ((float) t0.b, (float) t0.a);\n" +" float r0 = (float) t1.r;\n" +" float r1 = (float) t1.g;\n" +"\n" +" float dr = r1 - r0;\n" +" float2 p = _hb_gpu_apply_minv (m, renderCoord - c0_r);\n" +"\n" +" float A = dot (cd, cd) - dr * dr;\n" +" float B = -2.0 * (dot (p, cd) + r0 * dr);\n" +" float C = dot (p, p) - r0 * r0;\n" +"\n" +" float t;\n" +" if (abs (A) > 1e-6)\n" +" {\n" +" float disc = B * B - 4.0 * A * C;\n" +" if (disc < 0.0) return float4 (0.0, 0.0, 0.0, 0.0);\n" +" float sq = sqrt (disc);\n" +" float t1r = (-B + sq) / (2.0 * A);\n" +" float t2r = (-B - sq) / (2.0 * A);\n" +" t = (r0 + t1r * dr >= 0.0) ? t1r : t2r;\n" +" }\n" +" else\n" +" {\n" +" if (abs (B) < 1e-6) return float4 (0.0, 0.0, 0.0, 0.0);\n" +" t = -C / B;\n" +" }\n" +" t = _hb_gpu_extend_t (t, extend);\n" +" return _hb_gpu_eval_stops (grad_base + 3, stop_count, t, foreground);\n" +"}\n" +"\n" +"float4 _hb_gpu_sample_sweep (float2 renderCoord, int grad_base,\n" +" int stop_count, int extend, float4 foreground)\n" +"{\n" +" int4 t0 = hb_gpu_fetch (grad_base);\n" +" int4 m = hb_gpu_fetch (grad_base + 1);\n" +" float2 c_r = float2 ((float) t0.r, (float) t0.g);\n" +" float a0 = (float) t0.b / 16384.0;\n" +" float a1 = (float) t0.a / 16384.0;\n" +" float span = a1 - a0;\n" +" if (abs (span) < 1e-6) return float4 (0.0, 0.0, 0.0, 0.0);\n" +"\n" +" float2 p = _hb_gpu_apply_minv (m, renderCoord - c_r);\n" +" float ang = atan2 (p.y, p.x) / 3.14159265358979;\n" +" if (ang < 0.0) ang += 2.0;\n" +" float t = (ang - a0) / span;\n" +" t = _hb_gpu_extend_t (t, extend);\n" +" return _hb_gpu_eval_stops (grad_base + 2, stop_count, t, foreground);\n" +"}\n" +"\n" +"float4 _hb_gpu_composite (float4 src, float4 dst, int mode)\n" +"{\n" +" float4 r = src + dst * (1.0 - src.a); /* SRC_OVER default */\n" +"\n" +" /* Mode numbers match hb_paint_composite_mode_t. Approximate\n" +" * unsupported modes with the nearest Porter-Duff mode we do\n" +" * implement; DIFFERENCE / EXCLUSION / HSL_* still fall through to\n" +" * SRC_OVER below. */\n" +" if (mode == 14 || mode == 18 || mode == 19) mode = 23; /* OVERLAY / COLOR_BURN / HARD_LIGHT -> MULTIPLY */\n" +" else if (mode == 17 || mode == 20) mode = 13; /* COLOR_DODGE / SOFT_LIGHT -> SCREEN */\n" +"\n" +" if (mode == 0) r = float4 (0.0, 0.0, 0.0, 0.0); /* CLEAR */\n" +" else if (mode == 1) r = src; /* SRC */\n" +" else if (mode == 2) r = dst; /* DST */\n" +" else if (mode == 4) r = dst + src * (1.0 - dst.a); /* DST_OVER */\n" +" else if (mode == 5) r = src * dst.a; /* SRC_IN */\n" +" else if (mode == 6) r = dst * src.a; /* DST_IN */\n" +" else if (mode == 7) r = src * (1.0 - dst.a); /* SRC_OUT */\n" +" else if (mode == 8) r = dst * (1.0 - src.a); /* DST_OUT */\n" +" else if (mode == 9) r = src * dst.a + dst * (1.0 - src.a); /* SRC_ATOP */\n" +" else if (mode == 10) r = dst * src.a + src * (1.0 - dst.a); /* DST_ATOP */\n" +" else if (mode == 11) r = src * (1.0 - dst.a) + dst * (1.0 - src.a); /* XOR */\n" +" else if (mode == 12) r = min (src + dst, float4 (1.0, 1.0, 1.0, 1.0)); /* PLUS */\n" +" else if (mode == 13) { /* SCREEN (premul) */\n" +" r.rgb = src.rgb + dst.rgb - src.rgb * dst.rgb;\n" +" r.a = src.a + dst.a - src.a * dst.a;\n" +" }\n" +" else if (mode == 15) { /* DARKEN */\n" +" r.rgb = min (src.rgb * dst.a, dst.rgb * src.a)\n" +" + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a);\n" +" r.a = src.a + dst.a - src.a * dst.a;\n" +" }\n" +" else if (mode == 16) { /* LIGHTEN */\n" +" r.rgb = max (src.rgb * dst.a, dst.rgb * src.a)\n" +" + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a);\n" +" r.a = src.a + dst.a - src.a * dst.a;\n" +" }\n" +" else if (mode == 23) { /* MULTIPLY (premul) */\n" +" r.rgb = src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a)\n" +" + src.rgb * dst.rgb;\n" +" r.a = src.a + dst.a - src.a * dst.a;\n" +" }\n" +" /* SRC_OVER (3) and DIFFERENCE / EXCLUSION / HSL_* (21, 22, 24-27)\n" +" * fall through to the SRC_OVER default. */\n" +" return r;\n" +"}\n" +"\n" +"/* Wrap _hb_gpu_slug with a sub-glyph extents bail-out. Many\n" +" * paint layers cover a small region of the outer glyph quad; for\n" +" * fragments outside the layer's bbox (with an AA + MSAA-spread\n" +" * margin) the slug coverage is exactly 0, so we can skip the\n" +" * band/curve walk entirely. */\n" +"float _hb_gpu_slug_clipped (float2 renderCoord, float2 pixelsPerEm, uint glyphLoc_)\n" +"{\n" +" int4 header0 = hb_gpu_fetch ((int) glyphLoc_);\n" +" float4 ext = (float4) header0 * HB_GPU_INV_UNITS;\n" +" float2 margin = 2.0 / pixelsPerEm;\n" +" if (any (renderCoord < ext.xy - margin) ||\n" +" any (renderCoord > ext.zw + margin))\n" +" return 0.0;\n" +" return _hb_gpu_slug (renderCoord, pixelsPerEm, glyphLoc_);\n" +"}\n" +"\n" +"/* Combine slug coverages from all clip outlines on the layer.\n" +" * Factored so the shader has one set of inlined slug walks\n" +" * instead of two (one per LAYER op type). flags bits: 0x100 =\n" +" * HAS_CLIP2; 0x200 = HAS_CLIP3 (HAS_CLIP3 implies HAS_CLIP2). */\n" +"float _hb_gpu_layer_coverage (float2 renderCoord, float2 pixelsPerEm,\n" +" int base, int flags,\n" +" int clip1_payload, int clip2_payload, int clip3_payload)\n" +"{\n" +" float cov = _hb_gpu_slug_clipped (renderCoord, pixelsPerEm,\n" +" (uint) (base + clip1_payload));\n" +" if ((flags & 0x100) != 0)\n" +" {\n" +" cov *= _hb_gpu_slug_clipped (renderCoord, pixelsPerEm,\n" +" (uint) (base + clip2_payload));\n" +" if ((flags & 0x200) != 0)\n" +" cov *= _hb_gpu_slug_clipped (renderCoord, pixelsPerEm,\n" +" (uint) (base + clip3_payload));\n" +" }\n" +" return cov;\n" +"}\n" +"\n" +"#define HB_GPU_PAINT_GROUP_DEPTH 4\n" +"\n" +"float4 hb_gpu_paint (float2 renderCoord, uint glyphLoc_, float4 foreground,\n" +" out float coverage)\n" +"{\n" +" /* fwidth once, at uniform control flow. */\n" +" float2 pixelsPerEm = 1.0 / fwidth (renderCoord);\n" +"\n" +" int base = (int) glyphLoc_;\n" +" int4 h0 = hb_gpu_fetch (base); /* (num_ops, _, _, _) */\n" +" int4 h2 = hb_gpu_fetch (base + 2); /* (ops_offset, _, _, _) */\n" +" int num_ops = h0.r;\n" +" int cursor = base + h2.r;\n" +"\n" +" float4 acc = float4 (0.0, 0.0, 0.0, 0.0);\n" +" float4 group_stack[HB_GPU_PAINT_GROUP_DEPTH];\n" +" coverage = 0.0;\n" +" int sp = 0;\n" +"\n" +" for (int i = 0; i < num_ops; i++)\n" +" {\n" +" int4 op = hb_gpu_fetch (cursor);\n" +" int op_type = op.r;\n" +" int aux = op.g;\n" +" int payload = (op.b << 16) | (op.a & 0xffff);\n" +"\n" +" if (op_type == 0) /* LAYER_SOLID */\n" +" {\n" +" /* texel 1: (clip2_hi, clip2_lo, clip3_hi, clip3_lo) -- valid\n" +" * per HAS_CLIP2 / HAS_CLIP3 flag bits.\n" +" * texel 2: RGBA as signed Q15. */\n" +" int4 op2 = hb_gpu_fetch (cursor + 1);\n" +" int clip2_payload = (op2.r << 16) | (op2.g & 0xffff);\n" +" int clip3_payload = (op2.b << 16) | (op2.a & 0xffff);\n" +" int4 ct = hb_gpu_fetch (cursor + 2);\n" +" float4 col = ((aux & 1) != 0)\n" +" ? float4 (foreground.rgb, foreground.a * ((float) ct.a / 32767.0))\n" +" : (float4) ct / 32767.0;\n" +"\n" +" float cov = _hb_gpu_layer_coverage (renderCoord, pixelsPerEm,\n" +" base, aux,\n" +" payload, clip2_payload, clip3_payload);\n" +" coverage = max (coverage, cov);\n" +" float4 src = float4 (col.rgb * col.a, col.a) * cov;\n" +" acc = src + acc * (1.0 - src.a);\n" +"\n" +" cursor += 3;\n" +" }\n" +" else if (op_type == 1) /* LAYER_GRADIENT */\n" +" {\n" +" int4 op2 = hb_gpu_fetch (cursor + 1);\n" +" int clip2_payload = (op2.r << 16) | (op2.g & 0xffff);\n" +" int clip3_payload = (op2.b << 16) | (op2.a & 0xffff);\n" +" int4 op3 = hb_gpu_fetch (cursor + 2);\n" +" int grad_payload = (op3.r << 16) | (op3.g & 0xffff);\n" +" int extend = op3.b;\n" +" int stop_count = op3.a;\n" +" int subtype = aux & 0xff;\n" +"\n" +" float4 col = float4 (0.0, 0.0, 0.0, 0.0);\n" +" if (subtype == 0)\n" +" col = _hb_gpu_sample_linear (renderCoord,\n" +" base + grad_payload,\n" +" stop_count, extend, foreground);\n" +" else if (subtype == 1)\n" +" col = _hb_gpu_sample_radial (renderCoord,\n" +" base + grad_payload,\n" +" stop_count, extend, foreground);\n" +" else if (subtype == 2)\n" +" col = _hb_gpu_sample_sweep (renderCoord,\n" +" base + grad_payload,\n" +" stop_count, extend, foreground);\n" +"\n" +" float cov = _hb_gpu_layer_coverage (renderCoord, pixelsPerEm,\n" +" base, aux,\n" +" payload, clip2_payload, clip3_payload);\n" +" coverage = max (coverage, cov);\n" +" float4 src = float4 (col.rgb * col.a, col.a) * cov;\n" +" acc = src + acc * (1.0 - src.a);\n" +"\n" +" cursor += 3;\n" +" }\n" +" else if (op_type == 2)\n" +" {\n" +" if (sp < HB_GPU_PAINT_GROUP_DEPTH) {\n" +" group_stack[sp] = acc;\n" +" sp++;\n" +" }\n" +" acc = float4 (0.0, 0.0, 0.0, 0.0);\n" +" cursor += 1;\n" +" }\n" +" else if (op_type == 3)\n" +" {\n" +" if (sp > 0) {\n" +" sp--;\n" +" float4 src = acc;\n" +" float4 dst = group_stack[sp];\n" +" acc = _hb_gpu_composite (src, dst, aux);\n" +" }\n" +" cursor += 1;\n" +" }\n" +" else\n" +" {\n" +" break;\n" +" }\n" +" }\n" +"\n" +" return acc;\n" +"}\n" +; diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment-msl.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment-msl.hh new file mode 100644 index 0000000000..dcffcfd031 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment-msl.hh @@ -0,0 +1,378 @@ +static const char *hb_gpu_paint_fragment_msl = +"/*\n" +" * Copyright (C) 2026 Behdad Esfahbod\n" +" *\n" +" * This is part of HarfBuzz, a text shaping library.\n" +" *\n" +" * Permission is hereby granted, without written agreement and without\n" +" * license or royalty fees, to use, copy, modify, and distribute this\n" +" * software and its documentation for any purpose, provided that the\n" +" * above copyright notice and the following two paragraphs appear in\n" +" * all copies of this software.\n" +" *\n" +" * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\n" +" * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\n" +" * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\n" +" * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n" +" * DAMAGE.\n" +" *\n" +" * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\n" +" * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n" +" * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n" +" * ON AN \"AS IS\" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\n" +" * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n" +" */\n" +"\n" +"\n" +"/* Paint-renderer fragment shader (Metal).\n" +" *\n" +" * Assumes the shared fragment helpers (hb-gpu-fragment.msl) and\n" +" * the draw-renderer fragment helpers (hb-gpu-draw-fragment.msl)\n" +" * are prepended to this source.\n" +" */\n" +"\n" +"\n" +"/* Fetch the i'th stop (2 texels per stop), resolving is_foreground. */\n" +"static float4 _hb_gpu_stop_color (device const short4* hb_gpu_atlas,\n" +" int stops_base, int i, float4 foreground,\n" +" thread float &offset)\n" +"{\n" +" int4 a = int4 (hb_gpu_atlas[stops_base + i * 2]);\n" +" offset = float (a.r) / 32767.0;\n" +" int4 b = int4 (hb_gpu_atlas[stops_base + i * 2 + 1]);\n" +" if ((a.g & 1) != 0)\n" +" return float4 (foreground.rgb, foreground.a * (float (b.a) / 32767.0));\n" +" return float4 (b) / 32767.0;\n" +"}\n" +"\n" +"static float _hb_gpu_extend_t (float t, int extend)\n" +"{\n" +" if (extend == 1) return t - floor (t);\n" +" if (extend == 2) {\n" +" float u = t - 2.0 * floor (t * 0.5);\n" +" return u > 1.0 ? 2.0 - u : u;\n" +" }\n" +" return clamp (t, 0.0, 1.0);\n" +"}\n" +"\n" +"static float4 _hb_gpu_eval_stops (device const short4* hb_gpu_atlas,\n" +" int stops_base, int stop_count,\n" +" float t, float4 foreground)\n" +"{\n" +" float off_prev;\n" +" float4 col_prev = _hb_gpu_stop_color (hb_gpu_atlas, stops_base, 0, foreground, off_prev);\n" +" if (t <= off_prev) return col_prev;\n" +" for (int i = 1; i < stop_count; i++)\n" +" {\n" +" float off;\n" +" float4 col = _hb_gpu_stop_color (hb_gpu_atlas, stops_base, i, foreground, off);\n" +" if (t <= off)\n" +" {\n" +" float span = off - off_prev;\n" +" float f = span > 1e-6 ? (t - off_prev) / span : 0.0;\n" +" float4 p0 = float4 (col_prev.rgb * col_prev.a, col_prev.a);\n" +" float4 p1 = float4 (col.rgb * col.a, col.a);\n" +" float4 pm = mix (p0, p1, f);\n" +" return pm.a > 1e-6 ? float4 (pm.rgb / pm.a, pm.a) : float4 (0.0);\n" +" }\n" +" col_prev = col;\n" +" off_prev = off;\n" +" }\n" +" return col_prev;\n" +"}\n" +"\n" +"/* Apply the stored 2x2 M^-1 (row-major i16 Q10) to a vector. */\n" +"static float2 _hb_gpu_apply_minv (int4 m, float2 v)\n" +"{\n" +" float4 mf = float4 (m) * (1.0 / 1024.0);\n" +" return float2 (mf.x * v.x + mf.y * v.y,\n" +" mf.z * v.x + mf.w * v.y);\n" +"}\n" +"\n" +"static float4 _hb_gpu_sample_linear (float2 renderCoord, int grad_base,\n" +" int stop_count, int extend,\n" +" float4 foreground,\n" +" device const short4* hb_gpu_atlas)\n" +"{\n" +" int4 t0 = int4 (hb_gpu_atlas[grad_base]);\n" +" int4 m = int4 (hb_gpu_atlas[grad_base + 1]);\n" +" float2 p0_r = float2 (float (t0.r), float (t0.g));\n" +" float2 d = float2 (float (t0.b), float (t0.a));\n" +" float denom = dot (d, d);\n" +" if (denom < 1e-6) return float4 (0.0);\n" +" float2 p = _hb_gpu_apply_minv (m, renderCoord - p0_r);\n" +" float t = dot (p, d) / denom;\n" +" t = _hb_gpu_extend_t (t, extend);\n" +" return _hb_gpu_eval_stops (hb_gpu_atlas, grad_base + 2, stop_count, t, foreground);\n" +"}\n" +"\n" +"static float4 _hb_gpu_sample_radial (float2 renderCoord, int grad_base,\n" +" int stop_count, int extend,\n" +" float4 foreground,\n" +" device const short4* hb_gpu_atlas)\n" +"{\n" +" int4 t0 = int4 (hb_gpu_atlas[grad_base]);\n" +" int4 t1 = int4 (hb_gpu_atlas[grad_base + 1]);\n" +" int4 m = int4 (hb_gpu_atlas[grad_base + 2]);\n" +" float2 c0_r = float2 (float (t0.r), float (t0.g));\n" +" float2 cd = float2 (float (t0.b), float (t0.a));\n" +" float r0 = float (t1.r);\n" +" float r1 = float (t1.g);\n" +"\n" +" float dr = r1 - r0;\n" +" float2 p = _hb_gpu_apply_minv (m, renderCoord - c0_r);\n" +"\n" +" float A = dot (cd, cd) - dr * dr;\n" +" float B = -2.0 * (dot (p, cd) + r0 * dr);\n" +" float C = dot (p, p) - r0 * r0;\n" +"\n" +" float t;\n" +" if (abs (A) > 1e-6)\n" +" {\n" +" float disc = B * B - 4.0 * A * C;\n" +" if (disc < 0.0) return float4 (0.0);\n" +" float sq = sqrt (disc);\n" +" float t1r = (-B + sq) / (2.0 * A);\n" +" float t2r = (-B - sq) / (2.0 * A);\n" +" t = (r0 + t1r * dr >= 0.0) ? t1r : t2r;\n" +" }\n" +" else\n" +" {\n" +" if (abs (B) < 1e-6) return float4 (0.0);\n" +" t = -C / B;\n" +" }\n" +" t = _hb_gpu_extend_t (t, extend);\n" +" return _hb_gpu_eval_stops (hb_gpu_atlas, grad_base + 3, stop_count, t, foreground);\n" +"}\n" +"\n" +"static float4 _hb_gpu_sample_sweep (float2 renderCoord, int grad_base,\n" +" int stop_count, int extend,\n" +" float4 foreground,\n" +" device const short4* hb_gpu_atlas)\n" +"{\n" +" int4 t0 = int4 (hb_gpu_atlas[grad_base]);\n" +" int4 m = int4 (hb_gpu_atlas[grad_base + 1]);\n" +" float2 c_r = float2 (float (t0.r), float (t0.g));\n" +" float a0 = float (t0.b) / 16384.0;\n" +" float a1 = float (t0.a) / 16384.0;\n" +" float span = a1 - a0;\n" +" if (abs (span) < 1e-6) return float4 (0.0);\n" +"\n" +" float2 p = _hb_gpu_apply_minv (m, renderCoord - c_r);\n" +" float ang = atan2 (p.y, p.x) / 3.14159265358979;\n" +" if (ang < 0.0) ang += 2.0;\n" +" float t = (ang - a0) / span;\n" +" t = _hb_gpu_extend_t (t, extend);\n" +" return _hb_gpu_eval_stops (hb_gpu_atlas, grad_base + 2, stop_count, t, foreground);\n" +"}\n" +"\n" +"static float4 _hb_gpu_composite (float4 src, float4 dst, int mode)\n" +"{\n" +" float4 r = src + dst * (1.0 - src.a); /* SRC_OVER default */\n" +"\n" +" /* Mode numbers match hb_paint_composite_mode_t. SRC_OVER (3) is\n" +" * the default `r` above. */\n" +"\n" +" /* Approximate unsupported modes with the nearest Porter-Duff mode\n" +" * we do implement. DIFFERENCE / EXCLUSION / HSL_* still fall\n" +" * through to SRC_OVER below. */\n" +" if (mode == 14 || mode == 18 || mode == 19) mode = 23; /* OVERLAY / COLOR_BURN / HARD_LIGHT -> MULTIPLY */\n" +" else if (mode == 17 || mode == 20) mode = 13; /* COLOR_DODGE / SOFT_LIGHT -> SCREEN */\n" +"\n" +" if (mode == 0) r = float4 (0.0); /* CLEAR */\n" +" else if (mode == 1) r = src; /* SRC */\n" +" else if (mode == 2) r = dst; /* DST */\n" +" else if (mode == 4) r = dst + src * (1.0 - dst.a); /* DST_OVER */\n" +" else if (mode == 5) r = src * dst.a; /* SRC_IN */\n" +" else if (mode == 6) r = dst * src.a; /* DST_IN */\n" +" else if (mode == 7) r = src * (1.0 - dst.a); /* SRC_OUT */\n" +" else if (mode == 8) r = dst * (1.0 - src.a); /* DST_OUT */\n" +" else if (mode == 9) /* SRC_ATOP */\n" +" r = src * dst.a + dst * (1.0 - src.a);\n" +" else if (mode == 10) /* DST_ATOP */\n" +" r = dst * src.a + src * (1.0 - dst.a);\n" +" else if (mode == 11) /* XOR */\n" +" r = src * (1.0 - dst.a) + dst * (1.0 - src.a);\n" +" else if (mode == 12) /* PLUS */\n" +" r = min (src + dst, float4 (1.0));\n" +" else if (mode == 13) { /* SCREEN (premul) */\n" +" r.rgb = src.rgb + dst.rgb - src.rgb * dst.rgb;\n" +" r.a = src.a + dst.a - src.a * dst.a;\n" +" }\n" +" else if (mode == 15) { /* DARKEN */\n" +" r.rgb = min (src.rgb * dst.a, dst.rgb * src.a)\n" +" + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a);\n" +" r.a = src.a + dst.a - src.a * dst.a;\n" +" }\n" +" else if (mode == 16) { /* LIGHTEN */\n" +" r.rgb = max (src.rgb * dst.a, dst.rgb * src.a)\n" +" + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a);\n" +" r.a = src.a + dst.a - src.a * dst.a;\n" +" }\n" +" else if (mode == 23) { /* MULTIPLY (premul) */\n" +" r.rgb = src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a)\n" +" + src.rgb * dst.rgb;\n" +" r.a = src.a + dst.a - src.a * dst.a;\n" +" }\n" +" /* SRC_OVER (3) and DIFFERENCE / EXCLUSION / HSL_* (21, 22, 24-27)\n" +" * fall through to the SRC_OVER default. */\n" +"\n" +" return r;\n" +"}\n" +"\n" +"/* Wrap _hb_gpu_slug with a sub-glyph extents bail-out. Many\n" +" * paint layers cover a small region of the outer glyph quad; for\n" +" * fragments outside the layer's bbox (with an AA + MSAA-spread\n" +" * margin) the slug coverage is exactly 0, so we can skip the\n" +" * band/curve walk entirely. */\n" +"float _hb_gpu_slug_clipped (float2 renderCoord, float2 pixelsPerEm, uint glyphLoc_,\n" +" device const short4* hb_gpu_atlas)\n" +"{\n" +" int4 header0 = hb_gpu_fetch (hb_gpu_atlas, int (glyphLoc_));\n" +" float4 ext = float4 (header0) * HB_GPU_INV_UNITS;\n" +" float2 margin = 2.0 / pixelsPerEm;\n" +" if (any (renderCoord < ext.xy - margin) ||\n" +" any (renderCoord > ext.zw + margin))\n" +" return 0.0;\n" +" return _hb_gpu_slug (renderCoord, pixelsPerEm, glyphLoc_, hb_gpu_atlas);\n" +"}\n" +"\n" +"/* Combine slug coverages from all clip outlines on the layer.\n" +" * Factored out so the shader has one set of inlined slug walks\n" +" * instead of two (one per LAYER op type). flags bits: 0x100 =\n" +" * HAS_CLIP2; 0x200 = HAS_CLIP3 (HAS_CLIP3 implies HAS_CLIP2). */\n" +"static float\n" +"_hb_gpu_layer_coverage (float2 renderCoord, float2 pixelsPerEm,\n" +" int base, int flags,\n" +" int clip1_payload, int clip2_payload, int clip3_payload,\n" +" device const short4* hb_gpu_atlas)\n" +"{\n" +" float cov = _hb_gpu_slug_clipped (renderCoord, pixelsPerEm,\n" +" uint (base + clip1_payload), hb_gpu_atlas);\n" +" if ((flags & 0x100) != 0)\n" +" {\n" +" cov *= _hb_gpu_slug_clipped (renderCoord, pixelsPerEm,\n" +" uint (base + clip2_payload), hb_gpu_atlas);\n" +" if ((flags & 0x200) != 0)\n" +" cov *= _hb_gpu_slug_clipped (renderCoord, pixelsPerEm,\n" +" uint (base + clip3_payload), hb_gpu_atlas);\n" +" }\n" +" return cov;\n" +"}\n" +"\n" +"#define HB_GPU_PAINT_GROUP_DEPTH 4\n" +"\n" +"float4 hb_gpu_paint (float2 renderCoord, uint glyphLoc_, float4 foreground,\n" +" device const short4* hb_gpu_atlas,\n" +" thread float &coverage)\n" +"{\n" +" /* fwidth once, at uniform control flow. */\n" +" float2 pixelsPerEm = 1.0 / fwidth (renderCoord);\n" +"\n" +" int base = int (glyphLoc_);\n" +" int4 h0 = int4 (hb_gpu_atlas[base]); /* (num_ops, _, _, _) */\n" +" int4 h2 = int4 (hb_gpu_atlas[base + 2]); /* (ops_offset, _, _, _) */\n" +" int num_ops = h0.r;\n" +" int cursor = base + h2.r;\n" +"\n" +" float4 acc = float4 (0.0);\n" +" float4 group_stack[HB_GPU_PAINT_GROUP_DEPTH];\n" +" int sp = 0;\n" +" coverage = 0.0;\n" +"\n" +" for (int i = 0; i < num_ops; i++)\n" +" {\n" +" int4 op = int4 (hb_gpu_atlas[cursor]);\n" +" int op_type = op.r;\n" +" int aux = op.g;\n" +" int payload = (op.b << 16) | (op.a & 0xffff);\n" +"\n" +" if (op_type == 0) /* LAYER_SOLID */\n" +" {\n" +" /* texel 1: (clip2_hi, clip2_lo, clip3_hi, clip3_lo) -- valid\n" +" * per HAS_CLIP2 / HAS_CLIP3 flag bits.\n" +" * texel 2: RGBA as signed Q15. */\n" +" int4 op2 = int4 (hb_gpu_atlas[cursor + 1]);\n" +" int clip2_payload = (op2.r << 16) | (op2.g & 0xffff);\n" +" int clip3_payload = (op2.b << 16) | (op2.a & 0xffff);\n" +" int4 ct = int4 (hb_gpu_atlas[cursor + 2]);\n" +" float4 col = ((aux & 1) != 0)\n" +" ? float4 (foreground.rgb, foreground.a * (float (ct.a) / 32767.0))\n" +" : float4 (ct) / 32767.0;\n" +"\n" +" float cov = _hb_gpu_layer_coverage (renderCoord, pixelsPerEm,\n" +" base, aux,\n" +" payload, clip2_payload, clip3_payload,\n" +" hb_gpu_atlas);\n" +" coverage = max (coverage, cov);\n" +" float4 src = float4 (col.rgb * col.a, col.a) * cov;\n" +" acc = src + acc * (1.0 - src.a);\n" +"\n" +" cursor += 3;\n" +" }\n" +" else if (op_type == 1) /* LAYER_GRADIENT */\n" +" {\n" +" int4 op2 = int4 (hb_gpu_atlas[cursor + 1]);\n" +" int clip2_payload = (op2.r << 16) | (op2.g & 0xffff);\n" +" int clip3_payload = (op2.b << 16) | (op2.a & 0xffff);\n" +" int4 op3 = int4 (hb_gpu_atlas[cursor + 2]);\n" +" int grad_payload = (op3.r << 16) | (op3.g & 0xffff);\n" +" int extend = op3.b;\n" +" int stop_count = op3.a;\n" +" int subtype = aux & 0xff;\n" +"\n" +" float4 col = float4 (0.0);\n" +" if (subtype == 0)\n" +" col = _hb_gpu_sample_linear (renderCoord,\n" +" base + grad_payload,\n" +" stop_count, extend, foreground,\n" +" hb_gpu_atlas);\n" +" else if (subtype == 1)\n" +" col = _hb_gpu_sample_radial (renderCoord,\n" +" base + grad_payload,\n" +" stop_count, extend, foreground,\n" +" hb_gpu_atlas);\n" +" else if (subtype == 2)\n" +" col = _hb_gpu_sample_sweep (renderCoord,\n" +" base + grad_payload,\n" +" stop_count, extend, foreground,\n" +" hb_gpu_atlas);\n" +"\n" +" float cov = _hb_gpu_layer_coverage (renderCoord, pixelsPerEm,\n" +" base, aux,\n" +" payload, clip2_payload, clip3_payload,\n" +" hb_gpu_atlas);\n" +" coverage = max (coverage, cov);\n" +" float4 src = float4 (col.rgb * col.a, col.a) * cov;\n" +" acc = src + acc * (1.0 - src.a);\n" +"\n" +" cursor += 3;\n" +" }\n" +" else if (op_type == 2) /* PUSH_GROUP */\n" +" {\n" +" if (sp < HB_GPU_PAINT_GROUP_DEPTH) {\n" +" group_stack[sp] = acc;\n" +" sp++;\n" +" }\n" +" acc = float4 (0.0);\n" +" cursor += 1;\n" +" }\n" +" else if (op_type == 3) /* POP_GROUP */\n" +" {\n" +" if (sp > 0) {\n" +" sp--;\n" +" float4 src = acc;\n" +" float4 dst = group_stack[sp];\n" +" acc = _hb_gpu_composite (src, dst, aux);\n" +" }\n" +" cursor += 1;\n" +" }\n" +" else\n" +" {\n" +" break;\n" +" }\n" +" }\n" +"\n" +" return acc;\n" +"}\n" +; diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment-wgsl.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment-wgsl.hh new file mode 100644 index 0000000000..0dd70aaecb --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment-wgsl.hh @@ -0,0 +1,375 @@ +static const char *hb_gpu_paint_fragment_wgsl = +"/*\n" +" * Copyright (C) 2026 Behdad Esfahbod\n" +" *\n" +" * This is part of HarfBuzz, a text shaping library.\n" +" *\n" +" * Permission is hereby granted, without written agreement and without\n" +" * license or royalty fees, to use, copy, modify, and distribute this\n" +" * software and its documentation for any purpose, provided that the\n" +" * above copyright notice and the following two paragraphs appear in\n" +" * all copies of this software.\n" +" *\n" +" * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\n" +" * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\n" +" * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\n" +" * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n" +" * DAMAGE.\n" +" *\n" +" * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\n" +" * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n" +" * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n" +" * ON AN \"AS IS\" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\n" +" * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n" +" */\n" +"\n" +"\n" +"/* Paint-renderer fragment shader (WGSL).\n" +" *\n" +" * Assumes the shared fragment helpers (hb-gpu-fragment.wgsl) and\n" +" * the draw-renderer fragment helpers (hb-gpu-draw-fragment.wgsl)\n" +" * are prepended to this source.\n" +" *\n" +" * atlas is passed as an explicit storage-buffer pointer parameter,\n" +" * matching WGSL's scoping rules.\n" +" */\n" +"\n" +"\n" +"fn _hb_gpu_stop_color (hb_gpu_atlas: ptr>, read>,\n" +" stops_base: i32, i: i32, foreground: vec4f,\n" +" offset: ptr) -> vec4f\n" +"{\n" +" let a = hb_gpu_fetch (hb_gpu_atlas, stops_base + i * 2);\n" +" *offset = f32 (a.r) / 32767.0;\n" +" let b = hb_gpu_fetch (hb_gpu_atlas, stops_base + i * 2 + 1);\n" +" if ((a.g & 1) != 0) {\n" +" return vec4f (foreground.rgb, foreground.a * (f32 (b.a) / 32767.0));\n" +" }\n" +" return vec4f (b) / 32767.0;\n" +"}\n" +"\n" +"fn _hb_gpu_extend_t (t: f32, extend: i32) -> f32\n" +"{\n" +" if (extend == 1) { return t - floor (t); }\n" +" if (extend == 2) {\n" +" let u = t - 2.0 * floor (t * 0.5);\n" +" if (u > 1.0) { return 2.0 - u; }\n" +" return u;\n" +" }\n" +" return clamp (t, 0.0, 1.0);\n" +"}\n" +"\n" +"fn _hb_gpu_eval_stops (hb_gpu_atlas: ptr>, read>,\n" +" stops_base: i32, stop_count: i32,\n" +" t: f32, foreground: vec4f) -> vec4f\n" +"{\n" +" var off_prev: f32;\n" +" var col_prev = _hb_gpu_stop_color (hb_gpu_atlas, stops_base, 0, foreground, &off_prev);\n" +" if (t <= off_prev) { return col_prev; }\n" +" for (var i: i32 = 1; i < stop_count; i = i + 1)\n" +" {\n" +" var off: f32;\n" +" let col = _hb_gpu_stop_color (hb_gpu_atlas, stops_base, i, foreground, &off);\n" +" if (t <= off)\n" +" {\n" +" let span = off - off_prev;\n" +" var f: f32 = 0.0;\n" +" if (span > 1e-6) { f = (t - off_prev) / span; }\n" +" let p0 = vec4f (col_prev.rgb * col_prev.a, col_prev.a);\n" +" let p1 = vec4f (col.rgb * col.a, col.a);\n" +" let pm = mix (p0, p1, f);\n" +" if (pm.a > 1e-6) { return vec4f (pm.rgb / pm.a, pm.a); }\n" +" return vec4f (0.0);\n" +" }\n" +" col_prev = col;\n" +" off_prev = off;\n" +" }\n" +" return col_prev;\n" +"}\n" +"\n" +"/* Apply the stored 2x2 M^-1 (row-major i16 Q10) to a vector. */\n" +"fn _hb_gpu_apply_minv (m: vec4, v: vec2f) -> vec2f\n" +"{\n" +" let mf = vec4f (m) * (1.0 / 1024.0);\n" +" return vec2f (mf.x * v.x + mf.y * v.y,\n" +" mf.z * v.x + mf.w * v.y);\n" +"}\n" +"\n" +"fn _hb_gpu_sample_linear (renderCoord: vec2f, grad_base: i32,\n" +" stop_count: i32, extend: i32, foreground: vec4f,\n" +" hb_gpu_atlas: ptr>, read>) -> vec4f\n" +"{\n" +" let t0 = hb_gpu_fetch (hb_gpu_atlas, grad_base);\n" +" let m = hb_gpu_fetch (hb_gpu_atlas, grad_base + 1);\n" +" let p0_r = vec2f (f32 (t0.r), f32 (t0.g));\n" +" let d = vec2f (f32 (t0.b), f32 (t0.a));\n" +" let denom = dot (d, d);\n" +" if (denom < 1e-6) { return vec4f (0.0); }\n" +" let p = _hb_gpu_apply_minv (m, renderCoord - p0_r);\n" +" var t = dot (p, d) / denom;\n" +" t = _hb_gpu_extend_t (t, extend);\n" +" return _hb_gpu_eval_stops (hb_gpu_atlas, grad_base + 2, stop_count, t, foreground);\n" +"}\n" +"\n" +"fn _hb_gpu_sample_radial (renderCoord: vec2f, grad_base: i32,\n" +" stop_count: i32, extend: i32, foreground: vec4f,\n" +" hb_gpu_atlas: ptr>, read>) -> vec4f\n" +"{\n" +" let t0 = hb_gpu_fetch (hb_gpu_atlas, grad_base);\n" +" let t1 = hb_gpu_fetch (hb_gpu_atlas, grad_base + 1);\n" +" let m = hb_gpu_fetch (hb_gpu_atlas, grad_base + 2);\n" +" let c0_r = vec2f (f32 (t0.r), f32 (t0.g));\n" +" let cd = vec2f (f32 (t0.b), f32 (t0.a));\n" +" let r0 = f32 (t1.r);\n" +" let r1 = f32 (t1.g);\n" +"\n" +" let dr = r1 - r0;\n" +" let p = _hb_gpu_apply_minv (m, renderCoord - c0_r);\n" +"\n" +" let A = dot (cd, cd) - dr * dr;\n" +" let B = -2.0 * (dot (p, cd) + r0 * dr);\n" +" let C = dot (p, p) - r0 * r0;\n" +"\n" +" var t: f32;\n" +" if (abs (A) > 1e-6)\n" +" {\n" +" let disc = B * B - 4.0 * A * C;\n" +" if (disc < 0.0) { return vec4f (0.0); }\n" +" let sq = sqrt (disc);\n" +" let t1r = (-B + sq) / (2.0 * A);\n" +" let t2r = (-B - sq) / (2.0 * A);\n" +" if (r0 + t1r * dr >= 0.0) { t = t1r; } else { t = t2r; }\n" +" }\n" +" else\n" +" {\n" +" if (abs (B) < 1e-6) { return vec4f (0.0); }\n" +" t = -C / B;\n" +" }\n" +" t = _hb_gpu_extend_t (t, extend);\n" +" return _hb_gpu_eval_stops (hb_gpu_atlas, grad_base + 3, stop_count, t, foreground);\n" +"}\n" +"\n" +"fn _hb_gpu_sample_sweep (renderCoord: vec2f, grad_base: i32,\n" +" stop_count: i32, extend: i32, foreground: vec4f,\n" +" hb_gpu_atlas: ptr>, read>) -> vec4f\n" +"{\n" +" let t0 = hb_gpu_fetch (hb_gpu_atlas, grad_base);\n" +" let m = hb_gpu_fetch (hb_gpu_atlas, grad_base + 1);\n" +" let c_r = vec2f (f32 (t0.r), f32 (t0.g));\n" +" let a0 = f32 (t0.b) / 16384.0;\n" +" let a1 = f32 (t0.a) / 16384.0;\n" +" let span = a1 - a0;\n" +" if (abs (span) < 1e-6) { return vec4f (0.0); }\n" +"\n" +" let p = _hb_gpu_apply_minv (m, renderCoord - c_r);\n" +" var ang = atan2 (p.y, p.x) / 3.14159265358979;\n" +" if (ang < 0.0) { ang = ang + 2.0; }\n" +" var t = (ang - a0) / span;\n" +" t = _hb_gpu_extend_t (t, extend);\n" +" return _hb_gpu_eval_stops (hb_gpu_atlas, grad_base + 2, stop_count, t, foreground);\n" +"}\n" +"\n" +"fn _hb_gpu_composite (src: vec4f, dst: vec4f, mode_in: i32) -> vec4f\n" +"{\n" +" var r = src + dst * (1.0 - src.a); /* SRC_OVER default */\n" +"\n" +" /* Mode numbers match hb_paint_composite_mode_t. Approximate\n" +" * unsupported modes with the nearest Porter-Duff mode we do\n" +" * implement; DIFFERENCE / EXCLUSION / HSL_* still fall through to\n" +" * SRC_OVER below. */\n" +" var mode = mode_in;\n" +" if (mode == 14 || mode == 18 || mode == 19) { mode = 23; } /* OVERLAY / COLOR_BURN / HARD_LIGHT -> MULTIPLY */\n" +" else if (mode == 17 || mode == 20) { mode = 13; } /* COLOR_DODGE / SOFT_LIGHT -> SCREEN */\n" +"\n" +" if (mode == 0) { r = vec4f (0.0); } /* CLEAR */\n" +" else if (mode == 1) { r = src; } /* SRC */\n" +" else if (mode == 2) { r = dst; } /* DST */\n" +" else if (mode == 4) { r = dst + src * (1.0 - dst.a); } /* DST_OVER */\n" +" else if (mode == 5) { r = src * dst.a; } /* SRC_IN */\n" +" else if (mode == 6) { r = dst * src.a; } /* DST_IN */\n" +" else if (mode == 7) { r = src * (1.0 - dst.a); } /* SRC_OUT */\n" +" else if (mode == 8) { r = dst * (1.0 - src.a); } /* DST_OUT */\n" +" else if (mode == 9) { r = src * dst.a + dst * (1.0 - src.a); } /* SRC_ATOP */\n" +" else if (mode == 10) { r = dst * src.a + src * (1.0 - dst.a); } /* DST_ATOP */\n" +" else if (mode == 11) { r = src * (1.0 - dst.a) + dst * (1.0 - src.a); } /* XOR */\n" +" else if (mode == 12) { r = min (src + dst, vec4f (1.0)); } /* PLUS */\n" +" else if (mode == 13) { /* SCREEN (premul) */\n" +" r = vec4f (src.rgb + dst.rgb - src.rgb * dst.rgb,\n" +" src.a + dst.a - src.a * dst.a);\n" +" }\n" +" else if (mode == 15) { /* DARKEN */\n" +" r = vec4f (min (src.rgb * dst.a, dst.rgb * src.a)\n" +" + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a),\n" +" src.a + dst.a - src.a * dst.a);\n" +" }\n" +" else if (mode == 16) { /* LIGHTEN */\n" +" r = vec4f (max (src.rgb * dst.a, dst.rgb * src.a)\n" +" + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a),\n" +" src.a + dst.a - src.a * dst.a);\n" +" }\n" +" else if (mode == 23) { /* MULTIPLY (premul) */\n" +" r = vec4f (src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a)\n" +" + src.rgb * dst.rgb,\n" +" src.a + dst.a - src.a * dst.a);\n" +" }\n" +" /* SRC_OVER (3) and DIFFERENCE / EXCLUSION / HSL_* (21, 22, 24-27)\n" +" * fall through to the SRC_OVER default. */\n" +" return r;\n" +"}\n" +"\n" +"/* Wrap _hb_gpu_slug with a sub-glyph extents bail-out. Many\n" +" * paint layers cover a small region of the outer glyph quad; for\n" +" * fragments outside the layer's bbox (with an AA + MSAA-spread\n" +" * margin) the slug coverage is exactly 0, so we can skip the\n" +" * band/curve walk entirely. */\n" +"fn _hb_gpu_slug_clipped (renderCoord: vec2f, pixelsPerEm: vec2f, glyphLoc_: u32,\n" +" hb_gpu_atlas: ptr>, read>) -> f32\n" +"{\n" +" let header0 = hb_gpu_fetch (hb_gpu_atlas, i32 (glyphLoc_));\n" +" let ext = vec4f (header0) * HB_GPU_INV_UNITS;\n" +" let margin = 2.0 / pixelsPerEm;\n" +" if (any (renderCoord < ext.xy - margin) ||\n" +" any (renderCoord > ext.zw + margin)) {\n" +" return 0.0;\n" +" }\n" +" return _hb_gpu_slug (renderCoord, pixelsPerEm, glyphLoc_, hb_gpu_atlas);\n" +"}\n" +"\n" +"/* Combine slug coverages from all clip outlines on the layer.\n" +" * Factored so the shader has one set of inlined slug walks\n" +" * instead of two (one per LAYER op type). flags bits: 0x100 =\n" +" * HAS_CLIP2; 0x200 = HAS_CLIP3 (HAS_CLIP3 implies HAS_CLIP2). */\n" +"fn _hb_gpu_layer_coverage (renderCoord: vec2f, pixelsPerEm: vec2f,\n" +" base: i32, flags: i32,\n" +" clip1_payload: i32, clip2_payload: i32, clip3_payload: i32,\n" +" hb_gpu_atlas: ptr>, read>) -> f32\n" +"{\n" +" var cov = _hb_gpu_slug_clipped (renderCoord, pixelsPerEm,\n" +" u32 (base + clip1_payload), hb_gpu_atlas);\n" +" if ((flags & 0x100) != 0) {\n" +" cov = cov * _hb_gpu_slug_clipped (renderCoord, pixelsPerEm,\n" +" u32 (base + clip2_payload), hb_gpu_atlas);\n" +" if ((flags & 0x200) != 0) {\n" +" cov = cov * _hb_gpu_slug_clipped (renderCoord, pixelsPerEm,\n" +" u32 (base + clip3_payload), hb_gpu_atlas);\n" +" }\n" +" }\n" +" return cov;\n" +"}\n" +"\n" +"const HB_GPU_PAINT_GROUP_DEPTH: i32 = 4;\n" +"\n" +"fn hb_gpu_paint (renderCoord: vec2f, glyphLoc_: u32, foreground: vec4f,\n" +" hb_gpu_atlas: ptr>, read>,\n" +" coverage: ptr) -> vec4f\n" +"{\n" +" /* Compute pixelsPerEm once here at uniform control flow. WGSL\n" +" * rejects fwidth inside a loop-conditional branch, so we call\n" +" * _hb_gpu_slug (the MSAA-aware implementation that takes a\n" +" * pre-computed pixelsPerEm) instead of the top-level\n" +" * hb_gpu_draw() which would re-call fwidth. */\n" +" let emsPerPixel = fwidth (renderCoord);\n" +" let pixelsPerEm = 1.0 / emsPerPixel;\n" +"\n" +" let base = i32 (glyphLoc_);\n" +" let h0 = hb_gpu_fetch (hb_gpu_atlas, base); // (num_ops, _, _, _)\n" +" let h2 = hb_gpu_fetch (hb_gpu_atlas, base + 2); // (ops_offset, _, _, _)\n" +" let num_ops = h0.r;\n" +" var cursor = base + h2.r;\n" +"\n" +" var acc = vec4f (0.0);\n" +" var group_stack: array;\n" +" var sp: i32 = 0;\n" +" *coverage = 0.0;\n" +"\n" +" for (var i: i32 = 0; i < num_ops; i = i + 1)\n" +" {\n" +" let op = hb_gpu_fetch (hb_gpu_atlas, cursor);\n" +" let op_type = op.r;\n" +" let aux = op.g;\n" +" let payload = (op.b << 16) | (op.a & 0xffff);\n" +"\n" +" if (op_type == 0) { // LAYER_SOLID\n" +" // texel 1: (clip2_hi, clip2_lo, clip3_hi, clip3_lo) -- valid\n" +" // per HAS_CLIP2 / HAS_CLIP3 flag bits.\n" +" // texel 2: RGBA as signed Q15.\n" +" let op2 = hb_gpu_fetch (hb_gpu_atlas, cursor + 1);\n" +" let clip2_payload = (op2.r << 16) | (op2.g & 0xffff);\n" +" let clip3_payload = (op2.b << 16) | (op2.a & 0xffff);\n" +" let ct = hb_gpu_fetch (hb_gpu_atlas, cursor + 2);\n" +" var col: vec4f;\n" +" if ((aux & 1) != 0) {\n" +" col = vec4f (foreground.rgb, foreground.a * (f32 (ct.a) / 32767.0));\n" +" } else {\n" +" col = vec4f (ct) / 32767.0;\n" +" }\n" +"\n" +" let cov = _hb_gpu_layer_coverage (renderCoord, pixelsPerEm,\n" +" base, aux,\n" +" payload, clip2_payload, clip3_payload,\n" +" hb_gpu_atlas);\n" +" *coverage = max (*coverage, cov);\n" +" let src = vec4f (col.rgb * col.a, col.a) * cov;\n" +" acc = src + acc * (1.0 - src.a);\n" +"\n" +" cursor = cursor + 3;\n" +" } else if (op_type == 1) { // LAYER_GRADIENT\n" +" let op2 = hb_gpu_fetch (hb_gpu_atlas, cursor + 1);\n" +" let clip2_payload = (op2.r << 16) | (op2.g & 0xffff);\n" +" let clip3_payload = (op2.b << 16) | (op2.a & 0xffff);\n" +" let op3 = hb_gpu_fetch (hb_gpu_atlas, cursor + 2);\n" +" let grad_payload = (op3.r << 16) | (op3.g & 0xffff);\n" +" let extend = op3.b;\n" +" let stop_count = op3.a;\n" +" let subtype = aux & 0xff;\n" +"\n" +" var col = vec4f (0.0);\n" +" if (subtype == 0) {\n" +" col = _hb_gpu_sample_linear (renderCoord,\n" +" base + grad_payload,\n" +" stop_count, extend, foreground,\n" +" hb_gpu_atlas);\n" +" } else if (subtype == 1) {\n" +" col = _hb_gpu_sample_radial (renderCoord,\n" +" base + grad_payload,\n" +" stop_count, extend, foreground,\n" +" hb_gpu_atlas);\n" +" } else if (subtype == 2) {\n" +" col = _hb_gpu_sample_sweep (renderCoord,\n" +" base + grad_payload,\n" +" stop_count, extend, foreground,\n" +" hb_gpu_atlas);\n" +" }\n" +"\n" +" let cov = _hb_gpu_layer_coverage (renderCoord, pixelsPerEm,\n" +" base, aux,\n" +" payload, clip2_payload, clip3_payload,\n" +" hb_gpu_atlas);\n" +" *coverage = max (*coverage, cov);\n" +" let src = vec4f (col.rgb * col.a, col.a) * cov;\n" +" acc = src + acc * (1.0 - src.a);\n" +"\n" +" cursor = cursor + 3;\n" +" } else if (op_type == 2) { // PUSH_GROUP\n" +" if (sp < HB_GPU_PAINT_GROUP_DEPTH) {\n" +" group_stack[sp] = acc;\n" +" sp = sp + 1;\n" +" }\n" +" acc = vec4f (0.0);\n" +" cursor = cursor + 1;\n" +" } else if (op_type == 3) { // POP_GROUP\n" +" if (sp > 0) {\n" +" sp = sp - 1;\n" +" let src = acc;\n" +" let dst = group_stack[sp];\n" +" acc = _hb_gpu_composite (src, dst, aux);\n" +" }\n" +" cursor = cursor + 1;\n" +" } else {\n" +" break;\n" +" }\n" +" }\n" +"\n" +" return acc;\n" +"}\n" +; diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment.glsl b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment.glsl new file mode 100644 index 0000000000..37fa00f94e --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment.glsl @@ -0,0 +1,407 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + + +/* Paint-renderer fragment shader. + * + * Assumes the shared fragment helpers (hb-gpu-fragment.glsl) and + * the draw-renderer fragment helpers (hb-gpu-draw-fragment.glsl) + * are prepended to this source. The draw helper provides + * hb_gpu_draw() which this interpreter calls to compute clip-glyph + * coverage. + */ + + +/* Fetch the i'th stop of a gradient color line starting at @stops_base + * (2 texels per stop). Resolves is_foreground to @foreground. */ +vec4 _hb_gpu_stop_color (int stops_base, int i, vec4 foreground, out float offset) +{ + ivec4 a = hb_gpu_fetch (stops_base + i * 2); + offset = float (a.r) / 32767.0; + ivec4 b = hb_gpu_fetch (stops_base + i * 2 + 1); + if ((a.g & 1) != 0) + return vec4 (foreground.rgb, foreground.a * (float (b.a) / 32767.0)); + return vec4 (b) / 32767.0; +} + +/* Apply the color-line extend mode to a projected `t` value. */ +float _hb_gpu_extend_t (float t, int extend) +{ + if (extend == 1) { /* HB_PAINT_EXTEND_REPEAT */ + return t - floor (t); + } else if (extend == 2) { /* HB_PAINT_EXTEND_REFLECT */ + float u = t - 2.0 * floor (t * 0.5); + return u > 1.0 ? 2.0 - u : u; + } + return clamp (t, 0.0, 1.0); /* PAD (default) */ +} + +/* Walk stops starting at @stops_base and return the sampled color + * at @t. Same logic reused by all gradient subtypes. */ +vec4 _hb_gpu_eval_stops (int stops_base, int stop_count, float t, vec4 foreground) +{ + float off_prev; + vec4 col_prev = _hb_gpu_stop_color (stops_base, 0, foreground, off_prev); + if (t <= off_prev) + return col_prev; + for (int i = 1; i < stop_count; i++) + { + float off; + vec4 col = _hb_gpu_stop_color (stops_base, i, foreground, off); + if (t <= off) + { + float span = off - off_prev; + float f = span > 1e-6 ? (t - off_prev) / span : 0.0; + /* Interpolate in premultiplied space per OpenType COLR spec. */ + vec4 p0 = vec4 (col_prev.rgb * col_prev.a, col_prev.a); + vec4 p1 = vec4 (col.rgb * col.a, col.a); + vec4 pm = mix (p0, p1, f); + return pm.a > 1e-6 ? vec4 (pm.rgb / pm.a, pm.a) : vec4 (0.0); + } + col_prev = col; + off_prev = off; + } + return col_prev; +} + +/* Apply the stored 2x2 M^-1 (row-major i16 Q10) to @v. Scaling + * renderCoord deltas back into canonical gradient space. */ +vec2 _hb_gpu_apply_minv (ivec4 m, vec2 v) +{ + vec4 mf = vec4 (m) * (1.0 / 1024.0); + return vec2 (mf.x * v.x + mf.y * v.y, + mf.z * v.x + mf.w * v.y); +} + +/* Sample a linear gradient whose param blob starts at @grad_base: + * texel 0: (p0_rendered.x, p0_rendered.y, d_canonical.x, d_canonical.y) + * texel 1: L^-1 as i16 Q10 (row-major) + * texels 2..: stops (2 texels each) + * Evaluate t in untransformed space. */ +vec4 _hb_gpu_sample_linear (vec2 renderCoord, int grad_base, + int stop_count, int extend, vec4 foreground) +{ + ivec4 t0 = hb_gpu_fetch (grad_base); + ivec4 m = hb_gpu_fetch (grad_base + 1); + vec2 p0_r = vec2 (float (t0.r), float (t0.g)); + vec2 d = vec2 (float (t0.b), float (t0.a)); + float denom = dot (d, d); + if (denom < 1e-6) return vec4 (0.0); + vec2 p = _hb_gpu_apply_minv (m, renderCoord - p0_r); + float t = dot (p, d) / denom; + t = _hb_gpu_extend_t (t, extend); + + return _hb_gpu_eval_stops (grad_base + 2, stop_count, t, foreground); +} + +/* Sample a two-circle radial gradient whose param blob starts at + * @grad_base: + * texel 0: (c0_rendered.x, c0_rendered.y, d_canonical.x, d_canonical.y) + * d = c1 - c0 in untransformed space + * texel 1: (r0, r1, _, _) in untransformed font units + * texel 2: L^-1 as i16 Q10 (row-major) + * texels 3..: stops (2 texels each) + * Solves |p - t*cd|^2 = (r0 + t*(r1-r0))^2 with p in untransformed + * space, so non-uniform scale / shear on the transform becomes a + * proper ellipse-in-rendered-space instead of a scalar-fudge. */ +vec4 _hb_gpu_sample_radial (vec2 renderCoord, int grad_base, + int stop_count, int extend, vec4 foreground) +{ + ivec4 t0 = hb_gpu_fetch (grad_base); + ivec4 t1 = hb_gpu_fetch (grad_base + 1); + ivec4 m = hb_gpu_fetch (grad_base + 2); + vec2 c0_r = vec2 (float (t0.r), float (t0.g)); + vec2 cd = vec2 (float (t0.b), float (t0.a)); + float r0 = float (t1.r); + float r1 = float (t1.g); + + float dr = r1 - r0; + vec2 p = _hb_gpu_apply_minv (m, renderCoord - c0_r); + + float A = dot (cd, cd) - dr * dr; + float B = -2.0 * (dot (p, cd) + r0 * dr); + float C = dot (p, p) - r0 * r0; + + float t; + if (abs (A) > 1e-6) + { + float disc = B * B - 4.0 * A * C; + if (disc < 0.0) return vec4 (0.0); + float sq = sqrt (disc); + /* Prefer the larger root; fall back to the smaller if the + * larger gives a negative interpolated radius. */ + float t1 = (-B + sq) / (2.0 * A); + float t2 = (-B - sq) / (2.0 * A); + t = (r0 + t1 * dr >= 0.0) ? t1 : t2; + } + else + { + if (abs (B) < 1e-6) return vec4 (0.0); + t = -C / B; + } + + t = _hb_gpu_extend_t (t, extend); + return _hb_gpu_eval_stops (grad_base + 3, stop_count, t, foreground); +} + +/* Sample a sweep gradient whose param blob starts at @grad_base: + * texel 0: (center_rendered.x, center_rendered.y, start_q14, end_q14) + * start/end are Q14 fractions of pi in untransformed space + * texel 1: L^-1 as i16 Q10 (row-major) + * texels 2..: stops (2 texels each) */ +vec4 _hb_gpu_sample_sweep (vec2 renderCoord, int grad_base, + int stop_count, int extend, vec4 foreground) +{ + ivec4 t0 = hb_gpu_fetch (grad_base); + ivec4 m = hb_gpu_fetch (grad_base + 1); + vec2 c_r = vec2 (float (t0.r), float (t0.g)); + float a0 = float (t0.b) / 16384.0; /* fraction of pi */ + float a1 = float (t0.a) / 16384.0; + float span = a1 - a0; + if (abs (span) < 1e-6) return vec4 (0.0); + + vec2 p = _hb_gpu_apply_minv (m, renderCoord - c_r); + /* atan2 returns (-pi, pi]; normalize to [0, 2) fractions of pi. */ + float ang = atan (p.y, p.x) / 3.14159265358979; + if (ang < 0.0) ang += 2.0; + float t = (ang - a0) / span; + t = _hb_gpu_extend_t (t, extend); + return _hb_gpu_eval_stops (grad_base + 2, stop_count, t, foreground); +} + +/* Composite two premultiplied RGBA layers using one of the COLRv1 + * compositing modes. Unsupported modes fall back to SRC_OVER. + * Values match hb_paint_composite_mode_t. */ +vec4 _hb_gpu_composite (vec4 src, vec4 dst, int mode) +{ + vec4 r = src + dst * (1.0 - src.a); /* SRC_OVER default */ + + /* Approximate unsupported COLRv1 modes with the nearest Porter-Duff + * mode we do implement. Better a recognizable rendering than a + * silent SRC_OVER fallback. DIFFERENCE / EXCLUSION / HSL_* are + * not similar enough to anything we have, so they still fall + * through to SRC_OVER below. */ + if (mode == 14 || mode == 18 || mode == 19) mode = 23; /* OVERLAY / COLOR_BURN / HARD_LIGHT -> MULTIPLY */ + else if (mode == 17 || mode == 20) mode = 13; /* COLOR_DODGE / SOFT_LIGHT -> SCREEN */ + + if (mode == 0) r = vec4 (0.0); /* CLEAR */ + else if (mode == 1) r = src; /* SRC */ + else if (mode == 2) r = dst; /* DST */ + else if (mode == 4) r = dst + src * (1.0 - dst.a); /* DST_OVER */ + else if (mode == 5) r = src * dst.a; /* SRC_IN */ + else if (mode == 6) r = dst * src.a; /* DST_IN */ + else if (mode == 7) r = src * (1.0 - dst.a); /* SRC_OUT */ + else if (mode == 8) r = dst * (1.0 - src.a); /* DST_OUT */ + else if (mode == 9) /* SRC_ATOP */ + r = src * dst.a + dst * (1.0 - src.a); + else if (mode == 10) /* DST_ATOP */ + r = dst * src.a + src * (1.0 - dst.a); + else if (mode == 11) /* XOR */ + r = src * (1.0 - dst.a) + dst * (1.0 - src.a); + else if (mode == 12) /* PLUS */ + r = min (src + dst, vec4 (1.0)); + else if (mode == 13) { /* SCREEN (premul) */ + r.rgb = src.rgb + dst.rgb - src.rgb * dst.rgb; + r.a = src.a + dst.a - src.a * dst.a; + } + else if (mode == 15) { /* DARKEN */ + r.rgb = min (src.rgb * dst.a, dst.rgb * src.a) + + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a); + r.a = src.a + dst.a - src.a * dst.a; + } + else if (mode == 16) { /* LIGHTEN */ + r.rgb = max (src.rgb * dst.a, dst.rgb * src.a) + + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a); + r.a = src.a + dst.a - src.a * dst.a; + } + else if (mode == 23) { /* MULTIPLY (premul) */ + r.rgb = src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a) + + src.rgb * dst.rgb; + r.a = src.a + dst.a - src.a * dst.a; + } + /* SRC_OVER (3) and DIFFERENCE / EXCLUSION / HSL_* (21, 22, 24-27) + * fall through to the SRC_OVER default. */ + + return r; +} + +/* Wrap _hb_gpu_slug with a sub-glyph extents bail-out. Many + * paint layers cover a small region of the outer glyph quad; for + * fragments outside the layer's bbox (with an AA + MSAA-spread + * margin) the slug coverage is exactly 0, so we can skip the + * band/curve walk entirely. */ +float _hb_gpu_slug_clipped (vec2 renderCoord, vec2 pixelsPerEm, uint glyphLoc_) +{ + ivec4 header0 = hb_gpu_fetch (int (glyphLoc_)); + vec4 ext = vec4 (header0) * HB_GPU_INV_UNITS; + vec2 margin = 2.0 / pixelsPerEm; + if (any (lessThan (renderCoord, ext.xy - margin)) || + any (greaterThan (renderCoord, ext.zw + margin))) + return 0.0; + return _hb_gpu_slug (renderCoord, pixelsPerEm, glyphLoc_); +} + +/* Combine slug coverages from all clip outlines on the current + * layer. Factored out of LAYER_SOLID and LAYER_GRADIENT so the + * shader has one set of inlined slug walks instead of two. flags + * bits: 0x100 = HAS_CLIP2; 0x200 = HAS_CLIP3 (HAS_CLIP3 implies + * HAS_CLIP2). */ +float _hb_gpu_layer_coverage (vec2 renderCoord, vec2 pixelsPerEm, + int base, int flags, + int clip1_payload, int clip2_payload, int clip3_payload) +{ + float cov = _hb_gpu_slug_clipped (renderCoord, pixelsPerEm, + uint (base + clip1_payload)); + if ((flags & 0x100) != 0) + { + cov *= _hb_gpu_slug_clipped (renderCoord, pixelsPerEm, + uint (base + clip2_payload)); + if ((flags & 0x200) != 0) + cov *= _hb_gpu_slug_clipped (renderCoord, pixelsPerEm, + uint (base + clip3_payload)); + } + return cov; +} + +/* Walks the paint blob's flat op stream and returns a + * premultiplied RGBA coverage value for the current fragment. + * + * glyphLoc: atlas texel offset of the paint-blob header. + * foreground: caller-supplied foreground color, used when an op + * sets the is_foreground flag. + */ +#define HB_GPU_PAINT_GROUP_DEPTH 4 + +vec4 hb_gpu_paint (vec2 renderCoord, uint glyphLoc, vec4 foreground, + out float coverage) +{ + /* fwidth once, at uniform control flow: every per-layer + * coverage sample below uses this pre-computed pixelsPerEm via + * _hb_gpu_slug. */ + vec2 pixelsPerEm = 1.0 / fwidth (renderCoord); + + int base = int (glyphLoc); + ivec4 h0 = hb_gpu_fetch (base); /* (num_ops, _, _, _) */ + ivec4 h2 = hb_gpu_fetch (base + 2); /* (ops_offset, _, _, _) */ + int num_ops = h0.r; + int cursor = base + h2.r; + + vec4 acc = vec4 (0.0); + vec4 group_stack[HB_GPU_PAINT_GROUP_DEPTH]; + int sp = 0; + coverage = 0.0; + + for (int i = 0; i < num_ops; i++) + { + ivec4 op = hb_gpu_fetch (cursor); + int op_type = op.r; + int aux = op.g; + int payload = (op.b << 16) | (op.a & 0xffff); + + if (op_type == 0) /* LAYER_SOLID */ + { + /* texel 1: (clip2_hi, clip2_lo, clip3_hi, clip3_lo) -- valid + * per HAS_CLIP2 / HAS_CLIP3 flag bits. + * texel 2: RGBA as signed Q15. */ + ivec4 op2 = hb_gpu_fetch (cursor + 1); + int clip2_payload = (op2.r << 16) | (op2.g & 0xffff); + int clip3_payload = (op2.b << 16) | (op2.a & 0xffff); + ivec4 ct = hb_gpu_fetch (cursor + 2); + vec4 col = ((aux & 1) != 0) + ? vec4 (foreground.rgb, foreground.a * (float (ct.a) / 32767.0)) + : vec4 (ct) / 32767.0; + + float cov = _hb_gpu_layer_coverage (renderCoord, pixelsPerEm, + base, aux, + payload, clip2_payload, clip3_payload); + coverage = max (coverage, cov); + vec4 src = vec4 (col.rgb * col.a, col.a) * cov; + acc = src + acc * (1.0 - src.a); + + cursor += 3; + } + else if (op_type == 1) /* LAYER_GRADIENT */ + { + /* texel 1: (clip2_hi, clip2_lo, clip3_hi, clip3_lo) -- valid + * per HAS_CLIP2 / HAS_CLIP3 flag bits. + * texel 2: (grad_payload_hi, grad_payload_lo, extend, stop_count) */ + ivec4 op2 = hb_gpu_fetch (cursor + 1); + int clip2_payload = (op2.r << 16) | (op2.g & 0xffff); + int clip3_payload = (op2.b << 16) | (op2.a & 0xffff); + ivec4 op3 = hb_gpu_fetch (cursor + 2); + int grad_payload = (op3.r << 16) | (op3.g & 0xffff); + int extend = op3.b; + int stop_count = op3.a; + int subtype = aux & 0xff; + + vec4 col = vec4 (0.0); + if (subtype == 0) /* linear */ + col = _hb_gpu_sample_linear (renderCoord, + base + grad_payload, + stop_count, extend, foreground); + else if (subtype == 1) /* radial */ + col = _hb_gpu_sample_radial (renderCoord, + base + grad_payload, + stop_count, extend, foreground); + else if (subtype == 2) /* sweep */ + col = _hb_gpu_sample_sweep (renderCoord, + base + grad_payload, + stop_count, extend, foreground); + + float cov = _hb_gpu_layer_coverage (renderCoord, pixelsPerEm, + base, aux, + payload, clip2_payload, clip3_payload); + coverage = max (coverage, cov); + vec4 src = vec4 (col.rgb * col.a, col.a) * cov; + acc = src + acc * (1.0 - src.a); + + cursor += 3; + } + else if (op_type == 2) /* PUSH_GROUP */ + { + if (sp < HB_GPU_PAINT_GROUP_DEPTH) { + group_stack[sp] = acc; + sp++; + } + acc = vec4 (0.0); + cursor += 1; + } + else if (op_type == 3) /* POP_GROUP */ + { + if (sp > 0) { + sp--; + vec4 src = acc; + vec4 dst = group_stack[sp]; + acc = _hb_gpu_composite (src, dst, aux); + } + cursor += 1; + } + else + { + break; + } + } + + return acc; +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment.hlsl b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment.hlsl new file mode 100644 index 0000000000..4a0da60586 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment.hlsl @@ -0,0 +1,350 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + + +/* Paint-renderer fragment shader (HLSL). + * + * Assumes the shared fragment helpers (hb-gpu-fragment.hlsl) and + * the draw-renderer fragment helpers (hb-gpu-draw-fragment.hlsl) + * are prepended to this source. + */ + + +float4 _hb_gpu_stop_color (int stops_base, int i, float4 foreground, + out float offset) +{ + int4 a = hb_gpu_fetch (stops_base + i * 2); + offset = (float) a.r / 32767.0; + int4 b = hb_gpu_fetch (stops_base + i * 2 + 1); + if ((a.g & 1) != 0) + return float4 (foreground.rgb, foreground.a * ((float) b.a / 32767.0)); + return (float4) b / 32767.0; +} + +float _hb_gpu_extend_t (float t, int extend) +{ + if (extend == 1) return t - floor (t); + if (extend == 2) { + float u = t - 2.0 * floor (t * 0.5); + return u > 1.0 ? 2.0 - u : u; + } + return clamp (t, 0.0, 1.0); +} + +float4 _hb_gpu_eval_stops (int stops_base, int stop_count, float t, float4 foreground) +{ + float off_prev; + float4 col_prev = _hb_gpu_stop_color (stops_base, 0, foreground, off_prev); + if (t <= off_prev) return col_prev; + for (int i = 1; i < stop_count; i++) + { + float off; + float4 col = _hb_gpu_stop_color (stops_base, i, foreground, off); + if (t <= off) + { + float span = off - off_prev; + float f = span > 1e-6 ? (t - off_prev) / span : 0.0; + float4 p0 = float4 (col_prev.rgb * col_prev.a, col_prev.a); + float4 p1 = float4 (col.rgb * col.a, col.a); + float4 pm = lerp (p0, p1, f); + return pm.a > 1e-6 ? float4 (pm.rgb / pm.a, pm.a) : float4 (0.0); + } + col_prev = col; + off_prev = off; + } + return col_prev; +} + +/* Apply the stored 2x2 M^-1 (row-major i16 Q10) to a vector. */ +float2 _hb_gpu_apply_minv (int4 m, float2 v) +{ + float4 mf = (float4) m * (1.0 / 1024.0); + return float2 (mf.x * v.x + mf.y * v.y, + mf.z * v.x + mf.w * v.y); +} + +float4 _hb_gpu_sample_linear (float2 renderCoord, int grad_base, + int stop_count, int extend, float4 foreground) +{ + int4 t0 = hb_gpu_fetch (grad_base); + int4 m = hb_gpu_fetch (grad_base + 1); + float2 p0_r = float2 ((float) t0.r, (float) t0.g); + float2 d = float2 ((float) t0.b, (float) t0.a); + float denom = dot (d, d); + if (denom < 1e-6) return float4 (0.0, 0.0, 0.0, 0.0); + float2 p = _hb_gpu_apply_minv (m, renderCoord - p0_r); + float t = dot (p, d) / denom; + t = _hb_gpu_extend_t (t, extend); + return _hb_gpu_eval_stops (grad_base + 2, stop_count, t, foreground); +} + +float4 _hb_gpu_sample_radial (float2 renderCoord, int grad_base, + int stop_count, int extend, float4 foreground) +{ + int4 t0 = hb_gpu_fetch (grad_base); + int4 t1 = hb_gpu_fetch (grad_base + 1); + int4 m = hb_gpu_fetch (grad_base + 2); + float2 c0_r = float2 ((float) t0.r, (float) t0.g); + float2 cd = float2 ((float) t0.b, (float) t0.a); + float r0 = (float) t1.r; + float r1 = (float) t1.g; + + float dr = r1 - r0; + float2 p = _hb_gpu_apply_minv (m, renderCoord - c0_r); + + float A = dot (cd, cd) - dr * dr; + float B = -2.0 * (dot (p, cd) + r0 * dr); + float C = dot (p, p) - r0 * r0; + + float t; + if (abs (A) > 1e-6) + { + float disc = B * B - 4.0 * A * C; + if (disc < 0.0) return float4 (0.0, 0.0, 0.0, 0.0); + float sq = sqrt (disc); + float t1r = (-B + sq) / (2.0 * A); + float t2r = (-B - sq) / (2.0 * A); + t = (r0 + t1r * dr >= 0.0) ? t1r : t2r; + } + else + { + if (abs (B) < 1e-6) return float4 (0.0, 0.0, 0.0, 0.0); + t = -C / B; + } + t = _hb_gpu_extend_t (t, extend); + return _hb_gpu_eval_stops (grad_base + 3, stop_count, t, foreground); +} + +float4 _hb_gpu_sample_sweep (float2 renderCoord, int grad_base, + int stop_count, int extend, float4 foreground) +{ + int4 t0 = hb_gpu_fetch (grad_base); + int4 m = hb_gpu_fetch (grad_base + 1); + float2 c_r = float2 ((float) t0.r, (float) t0.g); + float a0 = (float) t0.b / 16384.0; + float a1 = (float) t0.a / 16384.0; + float span = a1 - a0; + if (abs (span) < 1e-6) return float4 (0.0, 0.0, 0.0, 0.0); + + float2 p = _hb_gpu_apply_minv (m, renderCoord - c_r); + float ang = atan2 (p.y, p.x) / 3.14159265358979; + if (ang < 0.0) ang += 2.0; + float t = (ang - a0) / span; + t = _hb_gpu_extend_t (t, extend); + return _hb_gpu_eval_stops (grad_base + 2, stop_count, t, foreground); +} + +float4 _hb_gpu_composite (float4 src, float4 dst, int mode) +{ + float4 r = src + dst * (1.0 - src.a); /* SRC_OVER default */ + + /* Mode numbers match hb_paint_composite_mode_t. Approximate + * unsupported modes with the nearest Porter-Duff mode we do + * implement; DIFFERENCE / EXCLUSION / HSL_* still fall through to + * SRC_OVER below. */ + if (mode == 14 || mode == 18 || mode == 19) mode = 23; /* OVERLAY / COLOR_BURN / HARD_LIGHT -> MULTIPLY */ + else if (mode == 17 || mode == 20) mode = 13; /* COLOR_DODGE / SOFT_LIGHT -> SCREEN */ + + if (mode == 0) r = float4 (0.0, 0.0, 0.0, 0.0); /* CLEAR */ + else if (mode == 1) r = src; /* SRC */ + else if (mode == 2) r = dst; /* DST */ + else if (mode == 4) r = dst + src * (1.0 - dst.a); /* DST_OVER */ + else if (mode == 5) r = src * dst.a; /* SRC_IN */ + else if (mode == 6) r = dst * src.a; /* DST_IN */ + else if (mode == 7) r = src * (1.0 - dst.a); /* SRC_OUT */ + else if (mode == 8) r = dst * (1.0 - src.a); /* DST_OUT */ + else if (mode == 9) r = src * dst.a + dst * (1.0 - src.a); /* SRC_ATOP */ + else if (mode == 10) r = dst * src.a + src * (1.0 - dst.a); /* DST_ATOP */ + else if (mode == 11) r = src * (1.0 - dst.a) + dst * (1.0 - src.a); /* XOR */ + else if (mode == 12) r = min (src + dst, float4 (1.0, 1.0, 1.0, 1.0)); /* PLUS */ + else if (mode == 13) { /* SCREEN (premul) */ + r.rgb = src.rgb + dst.rgb - src.rgb * dst.rgb; + r.a = src.a + dst.a - src.a * dst.a; + } + else if (mode == 15) { /* DARKEN */ + r.rgb = min (src.rgb * dst.a, dst.rgb * src.a) + + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a); + r.a = src.a + dst.a - src.a * dst.a; + } + else if (mode == 16) { /* LIGHTEN */ + r.rgb = max (src.rgb * dst.a, dst.rgb * src.a) + + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a); + r.a = src.a + dst.a - src.a * dst.a; + } + else if (mode == 23) { /* MULTIPLY (premul) */ + r.rgb = src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a) + + src.rgb * dst.rgb; + r.a = src.a + dst.a - src.a * dst.a; + } + /* SRC_OVER (3) and DIFFERENCE / EXCLUSION / HSL_* (21, 22, 24-27) + * fall through to the SRC_OVER default. */ + return r; +} + +/* Wrap _hb_gpu_slug with a sub-glyph extents bail-out. Many + * paint layers cover a small region of the outer glyph quad; for + * fragments outside the layer's bbox (with an AA + MSAA-spread + * margin) the slug coverage is exactly 0, so we can skip the + * band/curve walk entirely. */ +float _hb_gpu_slug_clipped (float2 renderCoord, float2 pixelsPerEm, uint glyphLoc_) +{ + int4 header0 = hb_gpu_fetch ((int) glyphLoc_); + float4 ext = (float4) header0 * HB_GPU_INV_UNITS; + float2 margin = 2.0 / pixelsPerEm; + if (any (renderCoord < ext.xy - margin) || + any (renderCoord > ext.zw + margin)) + return 0.0; + return _hb_gpu_slug (renderCoord, pixelsPerEm, glyphLoc_); +} + +/* Combine slug coverages from all clip outlines on the layer. + * Factored so the shader has one set of inlined slug walks + * instead of two (one per LAYER op type). flags bits: 0x100 = + * HAS_CLIP2; 0x200 = HAS_CLIP3 (HAS_CLIP3 implies HAS_CLIP2). */ +float _hb_gpu_layer_coverage (float2 renderCoord, float2 pixelsPerEm, + int base, int flags, + int clip1_payload, int clip2_payload, int clip3_payload) +{ + float cov = _hb_gpu_slug_clipped (renderCoord, pixelsPerEm, + (uint) (base + clip1_payload)); + if ((flags & 0x100) != 0) + { + cov *= _hb_gpu_slug_clipped (renderCoord, pixelsPerEm, + (uint) (base + clip2_payload)); + if ((flags & 0x200) != 0) + cov *= _hb_gpu_slug_clipped (renderCoord, pixelsPerEm, + (uint) (base + clip3_payload)); + } + return cov; +} + +#define HB_GPU_PAINT_GROUP_DEPTH 4 + +float4 hb_gpu_paint (float2 renderCoord, uint glyphLoc_, float4 foreground, + out float coverage) +{ + /* fwidth once, at uniform control flow. */ + float2 pixelsPerEm = 1.0 / fwidth (renderCoord); + + int base = (int) glyphLoc_; + int4 h0 = hb_gpu_fetch (base); /* (num_ops, _, _, _) */ + int4 h2 = hb_gpu_fetch (base + 2); /* (ops_offset, _, _, _) */ + int num_ops = h0.r; + int cursor = base + h2.r; + + float4 acc = float4 (0.0, 0.0, 0.0, 0.0); + float4 group_stack[HB_GPU_PAINT_GROUP_DEPTH]; + coverage = 0.0; + int sp = 0; + + for (int i = 0; i < num_ops; i++) + { + int4 op = hb_gpu_fetch (cursor); + int op_type = op.r; + int aux = op.g; + int payload = (op.b << 16) | (op.a & 0xffff); + + if (op_type == 0) /* LAYER_SOLID */ + { + /* texel 1: (clip2_hi, clip2_lo, clip3_hi, clip3_lo) -- valid + * per HAS_CLIP2 / HAS_CLIP3 flag bits. + * texel 2: RGBA as signed Q15. */ + int4 op2 = hb_gpu_fetch (cursor + 1); + int clip2_payload = (op2.r << 16) | (op2.g & 0xffff); + int clip3_payload = (op2.b << 16) | (op2.a & 0xffff); + int4 ct = hb_gpu_fetch (cursor + 2); + float4 col = ((aux & 1) != 0) + ? float4 (foreground.rgb, foreground.a * ((float) ct.a / 32767.0)) + : (float4) ct / 32767.0; + + float cov = _hb_gpu_layer_coverage (renderCoord, pixelsPerEm, + base, aux, + payload, clip2_payload, clip3_payload); + coverage = max (coverage, cov); + float4 src = float4 (col.rgb * col.a, col.a) * cov; + acc = src + acc * (1.0 - src.a); + + cursor += 3; + } + else if (op_type == 1) /* LAYER_GRADIENT */ + { + int4 op2 = hb_gpu_fetch (cursor + 1); + int clip2_payload = (op2.r << 16) | (op2.g & 0xffff); + int clip3_payload = (op2.b << 16) | (op2.a & 0xffff); + int4 op3 = hb_gpu_fetch (cursor + 2); + int grad_payload = (op3.r << 16) | (op3.g & 0xffff); + int extend = op3.b; + int stop_count = op3.a; + int subtype = aux & 0xff; + + float4 col = float4 (0.0, 0.0, 0.0, 0.0); + if (subtype == 0) + col = _hb_gpu_sample_linear (renderCoord, + base + grad_payload, + stop_count, extend, foreground); + else if (subtype == 1) + col = _hb_gpu_sample_radial (renderCoord, + base + grad_payload, + stop_count, extend, foreground); + else if (subtype == 2) + col = _hb_gpu_sample_sweep (renderCoord, + base + grad_payload, + stop_count, extend, foreground); + + float cov = _hb_gpu_layer_coverage (renderCoord, pixelsPerEm, + base, aux, + payload, clip2_payload, clip3_payload); + coverage = max (coverage, cov); + float4 src = float4 (col.rgb * col.a, col.a) * cov; + acc = src + acc * (1.0 - src.a); + + cursor += 3; + } + else if (op_type == 2) + { + if (sp < HB_GPU_PAINT_GROUP_DEPTH) { + group_stack[sp] = acc; + sp++; + } + acc = float4 (0.0, 0.0, 0.0, 0.0); + cursor += 1; + } + else if (op_type == 3) + { + if (sp > 0) { + sp--; + float4 src = acc; + float4 dst = group_stack[sp]; + acc = _hb_gpu_composite (src, dst, aux); + } + cursor += 1; + } + else + { + break; + } + } + + return acc; +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment.msl b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment.msl new file mode 100644 index 0000000000..6829d12ad2 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment.msl @@ -0,0 +1,376 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + + +/* Paint-renderer fragment shader (Metal). + * + * Assumes the shared fragment helpers (hb-gpu-fragment.msl) and + * the draw-renderer fragment helpers (hb-gpu-draw-fragment.msl) + * are prepended to this source. + */ + + +/* Fetch the i'th stop (2 texels per stop), resolving is_foreground. */ +static float4 _hb_gpu_stop_color (device const short4* hb_gpu_atlas, + int stops_base, int i, float4 foreground, + thread float &offset) +{ + int4 a = int4 (hb_gpu_atlas[stops_base + i * 2]); + offset = float (a.r) / 32767.0; + int4 b = int4 (hb_gpu_atlas[stops_base + i * 2 + 1]); + if ((a.g & 1) != 0) + return float4 (foreground.rgb, foreground.a * (float (b.a) / 32767.0)); + return float4 (b) / 32767.0; +} + +static float _hb_gpu_extend_t (float t, int extend) +{ + if (extend == 1) return t - floor (t); + if (extend == 2) { + float u = t - 2.0 * floor (t * 0.5); + return u > 1.0 ? 2.0 - u : u; + } + return clamp (t, 0.0, 1.0); +} + +static float4 _hb_gpu_eval_stops (device const short4* hb_gpu_atlas, + int stops_base, int stop_count, + float t, float4 foreground) +{ + float off_prev; + float4 col_prev = _hb_gpu_stop_color (hb_gpu_atlas, stops_base, 0, foreground, off_prev); + if (t <= off_prev) return col_prev; + for (int i = 1; i < stop_count; i++) + { + float off; + float4 col = _hb_gpu_stop_color (hb_gpu_atlas, stops_base, i, foreground, off); + if (t <= off) + { + float span = off - off_prev; + float f = span > 1e-6 ? (t - off_prev) / span : 0.0; + float4 p0 = float4 (col_prev.rgb * col_prev.a, col_prev.a); + float4 p1 = float4 (col.rgb * col.a, col.a); + float4 pm = mix (p0, p1, f); + return pm.a > 1e-6 ? float4 (pm.rgb / pm.a, pm.a) : float4 (0.0); + } + col_prev = col; + off_prev = off; + } + return col_prev; +} + +/* Apply the stored 2x2 M^-1 (row-major i16 Q10) to a vector. */ +static float2 _hb_gpu_apply_minv (int4 m, float2 v) +{ + float4 mf = float4 (m) * (1.0 / 1024.0); + return float2 (mf.x * v.x + mf.y * v.y, + mf.z * v.x + mf.w * v.y); +} + +static float4 _hb_gpu_sample_linear (float2 renderCoord, int grad_base, + int stop_count, int extend, + float4 foreground, + device const short4* hb_gpu_atlas) +{ + int4 t0 = int4 (hb_gpu_atlas[grad_base]); + int4 m = int4 (hb_gpu_atlas[grad_base + 1]); + float2 p0_r = float2 (float (t0.r), float (t0.g)); + float2 d = float2 (float (t0.b), float (t0.a)); + float denom = dot (d, d); + if (denom < 1e-6) return float4 (0.0); + float2 p = _hb_gpu_apply_minv (m, renderCoord - p0_r); + float t = dot (p, d) / denom; + t = _hb_gpu_extend_t (t, extend); + return _hb_gpu_eval_stops (hb_gpu_atlas, grad_base + 2, stop_count, t, foreground); +} + +static float4 _hb_gpu_sample_radial (float2 renderCoord, int grad_base, + int stop_count, int extend, + float4 foreground, + device const short4* hb_gpu_atlas) +{ + int4 t0 = int4 (hb_gpu_atlas[grad_base]); + int4 t1 = int4 (hb_gpu_atlas[grad_base + 1]); + int4 m = int4 (hb_gpu_atlas[grad_base + 2]); + float2 c0_r = float2 (float (t0.r), float (t0.g)); + float2 cd = float2 (float (t0.b), float (t0.a)); + float r0 = float (t1.r); + float r1 = float (t1.g); + + float dr = r1 - r0; + float2 p = _hb_gpu_apply_minv (m, renderCoord - c0_r); + + float A = dot (cd, cd) - dr * dr; + float B = -2.0 * (dot (p, cd) + r0 * dr); + float C = dot (p, p) - r0 * r0; + + float t; + if (abs (A) > 1e-6) + { + float disc = B * B - 4.0 * A * C; + if (disc < 0.0) return float4 (0.0); + float sq = sqrt (disc); + float t1r = (-B + sq) / (2.0 * A); + float t2r = (-B - sq) / (2.0 * A); + t = (r0 + t1r * dr >= 0.0) ? t1r : t2r; + } + else + { + if (abs (B) < 1e-6) return float4 (0.0); + t = -C / B; + } + t = _hb_gpu_extend_t (t, extend); + return _hb_gpu_eval_stops (hb_gpu_atlas, grad_base + 3, stop_count, t, foreground); +} + +static float4 _hb_gpu_sample_sweep (float2 renderCoord, int grad_base, + int stop_count, int extend, + float4 foreground, + device const short4* hb_gpu_atlas) +{ + int4 t0 = int4 (hb_gpu_atlas[grad_base]); + int4 m = int4 (hb_gpu_atlas[grad_base + 1]); + float2 c_r = float2 (float (t0.r), float (t0.g)); + float a0 = float (t0.b) / 16384.0; + float a1 = float (t0.a) / 16384.0; + float span = a1 - a0; + if (abs (span) < 1e-6) return float4 (0.0); + + float2 p = _hb_gpu_apply_minv (m, renderCoord - c_r); + float ang = atan2 (p.y, p.x) / 3.14159265358979; + if (ang < 0.0) ang += 2.0; + float t = (ang - a0) / span; + t = _hb_gpu_extend_t (t, extend); + return _hb_gpu_eval_stops (hb_gpu_atlas, grad_base + 2, stop_count, t, foreground); +} + +static float4 _hb_gpu_composite (float4 src, float4 dst, int mode) +{ + float4 r = src + dst * (1.0 - src.a); /* SRC_OVER default */ + + /* Mode numbers match hb_paint_composite_mode_t. SRC_OVER (3) is + * the default `r` above. */ + + /* Approximate unsupported modes with the nearest Porter-Duff mode + * we do implement. DIFFERENCE / EXCLUSION / HSL_* still fall + * through to SRC_OVER below. */ + if (mode == 14 || mode == 18 || mode == 19) mode = 23; /* OVERLAY / COLOR_BURN / HARD_LIGHT -> MULTIPLY */ + else if (mode == 17 || mode == 20) mode = 13; /* COLOR_DODGE / SOFT_LIGHT -> SCREEN */ + + if (mode == 0) r = float4 (0.0); /* CLEAR */ + else if (mode == 1) r = src; /* SRC */ + else if (mode == 2) r = dst; /* DST */ + else if (mode == 4) r = dst + src * (1.0 - dst.a); /* DST_OVER */ + else if (mode == 5) r = src * dst.a; /* SRC_IN */ + else if (mode == 6) r = dst * src.a; /* DST_IN */ + else if (mode == 7) r = src * (1.0 - dst.a); /* SRC_OUT */ + else if (mode == 8) r = dst * (1.0 - src.a); /* DST_OUT */ + else if (mode == 9) /* SRC_ATOP */ + r = src * dst.a + dst * (1.0 - src.a); + else if (mode == 10) /* DST_ATOP */ + r = dst * src.a + src * (1.0 - dst.a); + else if (mode == 11) /* XOR */ + r = src * (1.0 - dst.a) + dst * (1.0 - src.a); + else if (mode == 12) /* PLUS */ + r = min (src + dst, float4 (1.0)); + else if (mode == 13) { /* SCREEN (premul) */ + r.rgb = src.rgb + dst.rgb - src.rgb * dst.rgb; + r.a = src.a + dst.a - src.a * dst.a; + } + else if (mode == 15) { /* DARKEN */ + r.rgb = min (src.rgb * dst.a, dst.rgb * src.a) + + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a); + r.a = src.a + dst.a - src.a * dst.a; + } + else if (mode == 16) { /* LIGHTEN */ + r.rgb = max (src.rgb * dst.a, dst.rgb * src.a) + + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a); + r.a = src.a + dst.a - src.a * dst.a; + } + else if (mode == 23) { /* MULTIPLY (premul) */ + r.rgb = src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a) + + src.rgb * dst.rgb; + r.a = src.a + dst.a - src.a * dst.a; + } + /* SRC_OVER (3) and DIFFERENCE / EXCLUSION / HSL_* (21, 22, 24-27) + * fall through to the SRC_OVER default. */ + + return r; +} + +/* Wrap _hb_gpu_slug with a sub-glyph extents bail-out. Many + * paint layers cover a small region of the outer glyph quad; for + * fragments outside the layer's bbox (with an AA + MSAA-spread + * margin) the slug coverage is exactly 0, so we can skip the + * band/curve walk entirely. */ +float _hb_gpu_slug_clipped (float2 renderCoord, float2 pixelsPerEm, uint glyphLoc_, + device const short4* hb_gpu_atlas) +{ + int4 header0 = hb_gpu_fetch (hb_gpu_atlas, int (glyphLoc_)); + float4 ext = float4 (header0) * HB_GPU_INV_UNITS; + float2 margin = 2.0 / pixelsPerEm; + if (any (renderCoord < ext.xy - margin) || + any (renderCoord > ext.zw + margin)) + return 0.0; + return _hb_gpu_slug (renderCoord, pixelsPerEm, glyphLoc_, hb_gpu_atlas); +} + +/* Combine slug coverages from all clip outlines on the layer. + * Factored out so the shader has one set of inlined slug walks + * instead of two (one per LAYER op type). flags bits: 0x100 = + * HAS_CLIP2; 0x200 = HAS_CLIP3 (HAS_CLIP3 implies HAS_CLIP2). */ +static float +_hb_gpu_layer_coverage (float2 renderCoord, float2 pixelsPerEm, + int base, int flags, + int clip1_payload, int clip2_payload, int clip3_payload, + device const short4* hb_gpu_atlas) +{ + float cov = _hb_gpu_slug_clipped (renderCoord, pixelsPerEm, + uint (base + clip1_payload), hb_gpu_atlas); + if ((flags & 0x100) != 0) + { + cov *= _hb_gpu_slug_clipped (renderCoord, pixelsPerEm, + uint (base + clip2_payload), hb_gpu_atlas); + if ((flags & 0x200) != 0) + cov *= _hb_gpu_slug_clipped (renderCoord, pixelsPerEm, + uint (base + clip3_payload), hb_gpu_atlas); + } + return cov; +} + +#define HB_GPU_PAINT_GROUP_DEPTH 4 + +float4 hb_gpu_paint (float2 renderCoord, uint glyphLoc_, float4 foreground, + device const short4* hb_gpu_atlas, + thread float &coverage) +{ + /* fwidth once, at uniform control flow. */ + float2 pixelsPerEm = 1.0 / fwidth (renderCoord); + + int base = int (glyphLoc_); + int4 h0 = int4 (hb_gpu_atlas[base]); /* (num_ops, _, _, _) */ + int4 h2 = int4 (hb_gpu_atlas[base + 2]); /* (ops_offset, _, _, _) */ + int num_ops = h0.r; + int cursor = base + h2.r; + + float4 acc = float4 (0.0); + float4 group_stack[HB_GPU_PAINT_GROUP_DEPTH]; + int sp = 0; + coverage = 0.0; + + for (int i = 0; i < num_ops; i++) + { + int4 op = int4 (hb_gpu_atlas[cursor]); + int op_type = op.r; + int aux = op.g; + int payload = (op.b << 16) | (op.a & 0xffff); + + if (op_type == 0) /* LAYER_SOLID */ + { + /* texel 1: (clip2_hi, clip2_lo, clip3_hi, clip3_lo) -- valid + * per HAS_CLIP2 / HAS_CLIP3 flag bits. + * texel 2: RGBA as signed Q15. */ + int4 op2 = int4 (hb_gpu_atlas[cursor + 1]); + int clip2_payload = (op2.r << 16) | (op2.g & 0xffff); + int clip3_payload = (op2.b << 16) | (op2.a & 0xffff); + int4 ct = int4 (hb_gpu_atlas[cursor + 2]); + float4 col = ((aux & 1) != 0) + ? float4 (foreground.rgb, foreground.a * (float (ct.a) / 32767.0)) + : float4 (ct) / 32767.0; + + float cov = _hb_gpu_layer_coverage (renderCoord, pixelsPerEm, + base, aux, + payload, clip2_payload, clip3_payload, + hb_gpu_atlas); + coverage = max (coverage, cov); + float4 src = float4 (col.rgb * col.a, col.a) * cov; + acc = src + acc * (1.0 - src.a); + + cursor += 3; + } + else if (op_type == 1) /* LAYER_GRADIENT */ + { + int4 op2 = int4 (hb_gpu_atlas[cursor + 1]); + int clip2_payload = (op2.r << 16) | (op2.g & 0xffff); + int clip3_payload = (op2.b << 16) | (op2.a & 0xffff); + int4 op3 = int4 (hb_gpu_atlas[cursor + 2]); + int grad_payload = (op3.r << 16) | (op3.g & 0xffff); + int extend = op3.b; + int stop_count = op3.a; + int subtype = aux & 0xff; + + float4 col = float4 (0.0); + if (subtype == 0) + col = _hb_gpu_sample_linear (renderCoord, + base + grad_payload, + stop_count, extend, foreground, + hb_gpu_atlas); + else if (subtype == 1) + col = _hb_gpu_sample_radial (renderCoord, + base + grad_payload, + stop_count, extend, foreground, + hb_gpu_atlas); + else if (subtype == 2) + col = _hb_gpu_sample_sweep (renderCoord, + base + grad_payload, + stop_count, extend, foreground, + hb_gpu_atlas); + + float cov = _hb_gpu_layer_coverage (renderCoord, pixelsPerEm, + base, aux, + payload, clip2_payload, clip3_payload, + hb_gpu_atlas); + coverage = max (coverage, cov); + float4 src = float4 (col.rgb * col.a, col.a) * cov; + acc = src + acc * (1.0 - src.a); + + cursor += 3; + } + else if (op_type == 2) /* PUSH_GROUP */ + { + if (sp < HB_GPU_PAINT_GROUP_DEPTH) { + group_stack[sp] = acc; + sp++; + } + acc = float4 (0.0); + cursor += 1; + } + else if (op_type == 3) /* POP_GROUP */ + { + if (sp > 0) { + sp--; + float4 src = acc; + float4 dst = group_stack[sp]; + acc = _hb_gpu_composite (src, dst, aux); + } + cursor += 1; + } + else + { + break; + } + } + + return acc; +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment.wgsl b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment.wgsl new file mode 100644 index 0000000000..6e462e9bbf --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint-fragment.wgsl @@ -0,0 +1,373 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + + +/* Paint-renderer fragment shader (WGSL). + * + * Assumes the shared fragment helpers (hb-gpu-fragment.wgsl) and + * the draw-renderer fragment helpers (hb-gpu-draw-fragment.wgsl) + * are prepended to this source. + * + * atlas is passed as an explicit storage-buffer pointer parameter, + * matching WGSL's scoping rules. + */ + + +fn _hb_gpu_stop_color (hb_gpu_atlas: ptr>, read>, + stops_base: i32, i: i32, foreground: vec4f, + offset: ptr) -> vec4f +{ + let a = hb_gpu_fetch (hb_gpu_atlas, stops_base + i * 2); + *offset = f32 (a.r) / 32767.0; + let b = hb_gpu_fetch (hb_gpu_atlas, stops_base + i * 2 + 1); + if ((a.g & 1) != 0) { + return vec4f (foreground.rgb, foreground.a * (f32 (b.a) / 32767.0)); + } + return vec4f (b) / 32767.0; +} + +fn _hb_gpu_extend_t (t: f32, extend: i32) -> f32 +{ + if (extend == 1) { return t - floor (t); } + if (extend == 2) { + let u = t - 2.0 * floor (t * 0.5); + if (u > 1.0) { return 2.0 - u; } + return u; + } + return clamp (t, 0.0, 1.0); +} + +fn _hb_gpu_eval_stops (hb_gpu_atlas: ptr>, read>, + stops_base: i32, stop_count: i32, + t: f32, foreground: vec4f) -> vec4f +{ + var off_prev: f32; + var col_prev = _hb_gpu_stop_color (hb_gpu_atlas, stops_base, 0, foreground, &off_prev); + if (t <= off_prev) { return col_prev; } + for (var i: i32 = 1; i < stop_count; i = i + 1) + { + var off: f32; + let col = _hb_gpu_stop_color (hb_gpu_atlas, stops_base, i, foreground, &off); + if (t <= off) + { + let span = off - off_prev; + var f: f32 = 0.0; + if (span > 1e-6) { f = (t - off_prev) / span; } + let p0 = vec4f (col_prev.rgb * col_prev.a, col_prev.a); + let p1 = vec4f (col.rgb * col.a, col.a); + let pm = mix (p0, p1, f); + if (pm.a > 1e-6) { return vec4f (pm.rgb / pm.a, pm.a); } + return vec4f (0.0); + } + col_prev = col; + off_prev = off; + } + return col_prev; +} + +/* Apply the stored 2x2 M^-1 (row-major i16 Q10) to a vector. */ +fn _hb_gpu_apply_minv (m: vec4, v: vec2f) -> vec2f +{ + let mf = vec4f (m) * (1.0 / 1024.0); + return vec2f (mf.x * v.x + mf.y * v.y, + mf.z * v.x + mf.w * v.y); +} + +fn _hb_gpu_sample_linear (renderCoord: vec2f, grad_base: i32, + stop_count: i32, extend: i32, foreground: vec4f, + hb_gpu_atlas: ptr>, read>) -> vec4f +{ + let t0 = hb_gpu_fetch (hb_gpu_atlas, grad_base); + let m = hb_gpu_fetch (hb_gpu_atlas, grad_base + 1); + let p0_r = vec2f (f32 (t0.r), f32 (t0.g)); + let d = vec2f (f32 (t0.b), f32 (t0.a)); + let denom = dot (d, d); + if (denom < 1e-6) { return vec4f (0.0); } + let p = _hb_gpu_apply_minv (m, renderCoord - p0_r); + var t = dot (p, d) / denom; + t = _hb_gpu_extend_t (t, extend); + return _hb_gpu_eval_stops (hb_gpu_atlas, grad_base + 2, stop_count, t, foreground); +} + +fn _hb_gpu_sample_radial (renderCoord: vec2f, grad_base: i32, + stop_count: i32, extend: i32, foreground: vec4f, + hb_gpu_atlas: ptr>, read>) -> vec4f +{ + let t0 = hb_gpu_fetch (hb_gpu_atlas, grad_base); + let t1 = hb_gpu_fetch (hb_gpu_atlas, grad_base + 1); + let m = hb_gpu_fetch (hb_gpu_atlas, grad_base + 2); + let c0_r = vec2f (f32 (t0.r), f32 (t0.g)); + let cd = vec2f (f32 (t0.b), f32 (t0.a)); + let r0 = f32 (t1.r); + let r1 = f32 (t1.g); + + let dr = r1 - r0; + let p = _hb_gpu_apply_minv (m, renderCoord - c0_r); + + let A = dot (cd, cd) - dr * dr; + let B = -2.0 * (dot (p, cd) + r0 * dr); + let C = dot (p, p) - r0 * r0; + + var t: f32; + if (abs (A) > 1e-6) + { + let disc = B * B - 4.0 * A * C; + if (disc < 0.0) { return vec4f (0.0); } + let sq = sqrt (disc); + let t1r = (-B + sq) / (2.0 * A); + let t2r = (-B - sq) / (2.0 * A); + if (r0 + t1r * dr >= 0.0) { t = t1r; } else { t = t2r; } + } + else + { + if (abs (B) < 1e-6) { return vec4f (0.0); } + t = -C / B; + } + t = _hb_gpu_extend_t (t, extend); + return _hb_gpu_eval_stops (hb_gpu_atlas, grad_base + 3, stop_count, t, foreground); +} + +fn _hb_gpu_sample_sweep (renderCoord: vec2f, grad_base: i32, + stop_count: i32, extend: i32, foreground: vec4f, + hb_gpu_atlas: ptr>, read>) -> vec4f +{ + let t0 = hb_gpu_fetch (hb_gpu_atlas, grad_base); + let m = hb_gpu_fetch (hb_gpu_atlas, grad_base + 1); + let c_r = vec2f (f32 (t0.r), f32 (t0.g)); + let a0 = f32 (t0.b) / 16384.0; + let a1 = f32 (t0.a) / 16384.0; + let span = a1 - a0; + if (abs (span) < 1e-6) { return vec4f (0.0); } + + let p = _hb_gpu_apply_minv (m, renderCoord - c_r); + var ang = atan2 (p.y, p.x) / 3.14159265358979; + if (ang < 0.0) { ang = ang + 2.0; } + var t = (ang - a0) / span; + t = _hb_gpu_extend_t (t, extend); + return _hb_gpu_eval_stops (hb_gpu_atlas, grad_base + 2, stop_count, t, foreground); +} + +fn _hb_gpu_composite (src: vec4f, dst: vec4f, mode_in: i32) -> vec4f +{ + var r = src + dst * (1.0 - src.a); /* SRC_OVER default */ + + /* Mode numbers match hb_paint_composite_mode_t. Approximate + * unsupported modes with the nearest Porter-Duff mode we do + * implement; DIFFERENCE / EXCLUSION / HSL_* still fall through to + * SRC_OVER below. */ + var mode = mode_in; + if (mode == 14 || mode == 18 || mode == 19) { mode = 23; } /* OVERLAY / COLOR_BURN / HARD_LIGHT -> MULTIPLY */ + else if (mode == 17 || mode == 20) { mode = 13; } /* COLOR_DODGE / SOFT_LIGHT -> SCREEN */ + + if (mode == 0) { r = vec4f (0.0); } /* CLEAR */ + else if (mode == 1) { r = src; } /* SRC */ + else if (mode == 2) { r = dst; } /* DST */ + else if (mode == 4) { r = dst + src * (1.0 - dst.a); } /* DST_OVER */ + else if (mode == 5) { r = src * dst.a; } /* SRC_IN */ + else if (mode == 6) { r = dst * src.a; } /* DST_IN */ + else if (mode == 7) { r = src * (1.0 - dst.a); } /* SRC_OUT */ + else if (mode == 8) { r = dst * (1.0 - src.a); } /* DST_OUT */ + else if (mode == 9) { r = src * dst.a + dst * (1.0 - src.a); } /* SRC_ATOP */ + else if (mode == 10) { r = dst * src.a + src * (1.0 - dst.a); } /* DST_ATOP */ + else if (mode == 11) { r = src * (1.0 - dst.a) + dst * (1.0 - src.a); } /* XOR */ + else if (mode == 12) { r = min (src + dst, vec4f (1.0)); } /* PLUS */ + else if (mode == 13) { /* SCREEN (premul) */ + r = vec4f (src.rgb + dst.rgb - src.rgb * dst.rgb, + src.a + dst.a - src.a * dst.a); + } + else if (mode == 15) { /* DARKEN */ + r = vec4f (min (src.rgb * dst.a, dst.rgb * src.a) + + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a), + src.a + dst.a - src.a * dst.a); + } + else if (mode == 16) { /* LIGHTEN */ + r = vec4f (max (src.rgb * dst.a, dst.rgb * src.a) + + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a), + src.a + dst.a - src.a * dst.a); + } + else if (mode == 23) { /* MULTIPLY (premul) */ + r = vec4f (src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a) + + src.rgb * dst.rgb, + src.a + dst.a - src.a * dst.a); + } + /* SRC_OVER (3) and DIFFERENCE / EXCLUSION / HSL_* (21, 22, 24-27) + * fall through to the SRC_OVER default. */ + return r; +} + +/* Wrap _hb_gpu_slug with a sub-glyph extents bail-out. Many + * paint layers cover a small region of the outer glyph quad; for + * fragments outside the layer's bbox (with an AA + MSAA-spread + * margin) the slug coverage is exactly 0, so we can skip the + * band/curve walk entirely. */ +fn _hb_gpu_slug_clipped (renderCoord: vec2f, pixelsPerEm: vec2f, glyphLoc_: u32, + hb_gpu_atlas: ptr>, read>) -> f32 +{ + let header0 = hb_gpu_fetch (hb_gpu_atlas, i32 (glyphLoc_)); + let ext = vec4f (header0) * HB_GPU_INV_UNITS; + let margin = 2.0 / pixelsPerEm; + if (any (renderCoord < ext.xy - margin) || + any (renderCoord > ext.zw + margin)) { + return 0.0; + } + return _hb_gpu_slug (renderCoord, pixelsPerEm, glyphLoc_, hb_gpu_atlas); +} + +/* Combine slug coverages from all clip outlines on the layer. + * Factored so the shader has one set of inlined slug walks + * instead of two (one per LAYER op type). flags bits: 0x100 = + * HAS_CLIP2; 0x200 = HAS_CLIP3 (HAS_CLIP3 implies HAS_CLIP2). */ +fn _hb_gpu_layer_coverage (renderCoord: vec2f, pixelsPerEm: vec2f, + base: i32, flags: i32, + clip1_payload: i32, clip2_payload: i32, clip3_payload: i32, + hb_gpu_atlas: ptr>, read>) -> f32 +{ + var cov = _hb_gpu_slug_clipped (renderCoord, pixelsPerEm, + u32 (base + clip1_payload), hb_gpu_atlas); + if ((flags & 0x100) != 0) { + cov = cov * _hb_gpu_slug_clipped (renderCoord, pixelsPerEm, + u32 (base + clip2_payload), hb_gpu_atlas); + if ((flags & 0x200) != 0) { + cov = cov * _hb_gpu_slug_clipped (renderCoord, pixelsPerEm, + u32 (base + clip3_payload), hb_gpu_atlas); + } + } + return cov; +} + +const HB_GPU_PAINT_GROUP_DEPTH: i32 = 4; + +fn hb_gpu_paint (renderCoord: vec2f, glyphLoc_: u32, foreground: vec4f, + hb_gpu_atlas: ptr>, read>, + coverage: ptr) -> vec4f +{ + /* Compute pixelsPerEm once here at uniform control flow. WGSL + * rejects fwidth inside a loop-conditional branch, so we call + * _hb_gpu_slug (the MSAA-aware implementation that takes a + * pre-computed pixelsPerEm) instead of the top-level + * hb_gpu_draw() which would re-call fwidth. */ + let emsPerPixel = fwidth (renderCoord); + let pixelsPerEm = 1.0 / emsPerPixel; + + let base = i32 (glyphLoc_); + let h0 = hb_gpu_fetch (hb_gpu_atlas, base); // (num_ops, _, _, _) + let h2 = hb_gpu_fetch (hb_gpu_atlas, base + 2); // (ops_offset, _, _, _) + let num_ops = h0.r; + var cursor = base + h2.r; + + var acc = vec4f (0.0); + var group_stack: array; + var sp: i32 = 0; + *coverage = 0.0; + + for (var i: i32 = 0; i < num_ops; i = i + 1) + { + let op = hb_gpu_fetch (hb_gpu_atlas, cursor); + let op_type = op.r; + let aux = op.g; + let payload = (op.b << 16) | (op.a & 0xffff); + + if (op_type == 0) { // LAYER_SOLID + // texel 1: (clip2_hi, clip2_lo, clip3_hi, clip3_lo) -- valid + // per HAS_CLIP2 / HAS_CLIP3 flag bits. + // texel 2: RGBA as signed Q15. + let op2 = hb_gpu_fetch (hb_gpu_atlas, cursor + 1); + let clip2_payload = (op2.r << 16) | (op2.g & 0xffff); + let clip3_payload = (op2.b << 16) | (op2.a & 0xffff); + let ct = hb_gpu_fetch (hb_gpu_atlas, cursor + 2); + var col: vec4f; + if ((aux & 1) != 0) { + col = vec4f (foreground.rgb, foreground.a * (f32 (ct.a) / 32767.0)); + } else { + col = vec4f (ct) / 32767.0; + } + + let cov = _hb_gpu_layer_coverage (renderCoord, pixelsPerEm, + base, aux, + payload, clip2_payload, clip3_payload, + hb_gpu_atlas); + *coverage = max (*coverage, cov); + let src = vec4f (col.rgb * col.a, col.a) * cov; + acc = src + acc * (1.0 - src.a); + + cursor = cursor + 3; + } else if (op_type == 1) { // LAYER_GRADIENT + let op2 = hb_gpu_fetch (hb_gpu_atlas, cursor + 1); + let clip2_payload = (op2.r << 16) | (op2.g & 0xffff); + let clip3_payload = (op2.b << 16) | (op2.a & 0xffff); + let op3 = hb_gpu_fetch (hb_gpu_atlas, cursor + 2); + let grad_payload = (op3.r << 16) | (op3.g & 0xffff); + let extend = op3.b; + let stop_count = op3.a; + let subtype = aux & 0xff; + + var col = vec4f (0.0); + if (subtype == 0) { + col = _hb_gpu_sample_linear (renderCoord, + base + grad_payload, + stop_count, extend, foreground, + hb_gpu_atlas); + } else if (subtype == 1) { + col = _hb_gpu_sample_radial (renderCoord, + base + grad_payload, + stop_count, extend, foreground, + hb_gpu_atlas); + } else if (subtype == 2) { + col = _hb_gpu_sample_sweep (renderCoord, + base + grad_payload, + stop_count, extend, foreground, + hb_gpu_atlas); + } + + let cov = _hb_gpu_layer_coverage (renderCoord, pixelsPerEm, + base, aux, + payload, clip2_payload, clip3_payload, + hb_gpu_atlas); + *coverage = max (*coverage, cov); + let src = vec4f (col.rgb * col.a, col.a) * cov; + acc = src + acc * (1.0 - src.a); + + cursor = cursor + 3; + } else if (op_type == 2) { // PUSH_GROUP + if (sp < HB_GPU_PAINT_GROUP_DEPTH) { + group_stack[sp] = acc; + sp = sp + 1; + } + acc = vec4f (0.0); + cursor = cursor + 1; + } else if (op_type == 3) { // POP_GROUP + if (sp > 0) { + sp = sp - 1; + let src = acc; + let dst = group_stack[sp]; + acc = _hb_gpu_composite (src, dst, aux); + } + cursor = cursor + 1; + } else { + break; + } + } + + return acc; +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint.cc b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint.cc new file mode 100644 index 0000000000..ca892653f8 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint.cc @@ -0,0 +1,1620 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Author(s): Behdad Esfahbod + */ + +#include "hb.hh" + +#include "hb-gpu.h" +#include "hb-gpu-paint.hh" +#include "hb-draw.hh" +#include "hb-machinery.hh" +#include "hb-paint.hh" + + +/* ---- Paint callbacks ---- */ + +/* Op-type tags. Must match the layout documented in + * hb-gpu-paint.hh. */ +enum { + HB_GPU_PAINT_OP_LAYER_SOLID = 0, + HB_GPU_PAINT_OP_LAYER_GRADIENT = 1, + HB_GPU_PAINT_OP_PUSH_GROUP = 2, + HB_GPU_PAINT_OP_POP_GROUP = 3, +}; + +/* Encoder limits. Hitting any of these flips paint->unsupported and + * makes hb_gpu_paint_encode() return NULL rather than emit a blob + * that would render incorrectly. */ +#define HB_GPU_PAINT_MAX_OPS 0x7fff /* num_ops is i16 in the blob header */ +#define HB_GPU_PAINT_MAX_GROUP_DEPTH 4 /* matches HB_GPU_PAINT_GROUP_DEPTH in fragment shader */ +#define HB_GPU_PAINT_MAX_CLIP_DEPTH 3 /* shader can intersect up to 3 clip outlines per layer */ + +/* Layer-op flag bits (LAYER_SOLID texel 0 .g, LAYER_GRADIENT + * texel 0 .g where bits 0-7 hold the gradient subtype). */ +#define HB_GPU_PAINT_FLAG_IS_FOREGROUND 0x0001 +#define HB_GPU_PAINT_FLAG_HAS_CLIP2 0x0100 +#define HB_GPU_PAINT_FLAG_HAS_CLIP3 0x0200 + +static hb_bool_t +hb_gpu_paint_custom_palette_color (hb_paint_funcs_t *funcs HB_UNUSED, + void *paint_data, + unsigned color_index, + hb_color_t *color, + void *user_data HB_UNUSED) +{ + hb_gpu_paint_t *c = (hb_gpu_paint_t *) paint_data; + if (likely (c->custom_palette && hb_map_has (c->custom_palette, color_index))) + { + *color = hb_map_get (c->custom_palette, color_index); + return true; + } + return false; +} + +static void +hb_gpu_paint_push_clip_glyph (hb_paint_funcs_t *funcs HB_UNUSED, + void *paint_data, + hb_codepoint_t glyph, + hb_font_t *font, + void *user_data HB_UNUSED) +{ + hb_gpu_paint_t *c = (hb_gpu_paint_t *) paint_data; + + if (unlikely (c->clip_depth >= HB_GPU_PAINT_MAX_CLIP_DEPTH)) + { + c->unsupported = true; + c->clip_depth++; + return; + } + c->clip_stack[c->clip_depth] = { glyph, font, c->cur_transform, -1, 0, 0, 0, 0 }; + c->clip_depth++; +} + +static void +hb_gpu_paint_pop_clip (hb_paint_funcs_t *funcs HB_UNUSED, + void *paint_data, + void *user_data HB_UNUSED) +{ + hb_gpu_paint_t *c = (hb_gpu_paint_t *) paint_data; + if (likely (c->clip_depth > 0)) c->clip_depth--; +} + +/* Arbitrary-path clip: hand the caller the same hb_gpu_draw + * funcs the encoder uses for glyph outlines, with scratch_draw + * as the accumulator. push_clip_path_end encodes the captured + * geometry into a sub-blob and commits it to clip_stack just + * like a glyph clip. No font ref needed — the sub-blob is a + * self-contained slug bundle. */ +static hb_draw_funcs_t * +hb_gpu_paint_push_clip_path_start (hb_paint_funcs_t *funcs HB_UNUSED, + void *paint_data, + void **draw_data, + void *user_data HB_UNUSED) +{ + hb_gpu_paint_t *c = (hb_gpu_paint_t *) paint_data; + + if (unlikely (c->clip_depth >= HB_GPU_PAINT_MAX_CLIP_DEPTH)) + { + c->unsupported = true; + *draw_data = nullptr; + return nullptr; + } + + if (unlikely (!c->scratch_draw)) + { + c->scratch_draw = hb_gpu_draw_create_or_fail (); + if (unlikely (!c->scratch_draw)) + { + c->unsupported = true; + *draw_data = nullptr; + return nullptr; + } + } + + hb_gpu_draw_clear (c->scratch_draw); + hb_gpu_draw_set_scale (c->scratch_draw, c->x_scale, c->y_scale); + + c->pending_clip_path_transform = c->cur_transform; + c->pending_clip_path = true; + + *draw_data = c->scratch_draw; + return hb_gpu_draw_get_funcs (c->scratch_draw); +} + +static void +hb_gpu_paint_push_clip_path_end (hb_paint_funcs_t *funcs HB_UNUSED, + void *paint_data, + void *user_data HB_UNUSED) +{ + hb_gpu_paint_t *c = (hb_gpu_paint_t *) paint_data; + + if (unlikely (!c->pending_clip_path)) + return; + c->pending_clip_path = false; + + hb_glyph_extents_t ext; + hb_blob_t *blob = hb_gpu_draw_encode (c->scratch_draw, &ext); + if (unlikely (!blob || !c->sub_blobs.push_or_fail (blob))) + { + hb_blob_destroy (blob); + c->unsupported = true; + return; + } + int idx = (int) (c->sub_blobs.length - 1); + + int x0 = ext.x_bearing; + int x1 = (int) ((int64_t) ext.x_bearing + ext.width); + int y0 = ext.y_bearing; + int y1 = (int) ((int64_t) ext.y_bearing + ext.height); + + c->clip_stack[c->clip_depth] = { + HB_CODEPOINT_INVALID, nullptr, + c->pending_clip_path_transform, + idx, + hb_min (x0, x1), hb_min (y0, y1), + hb_max (x0, x1), hb_max (y0, y1), + }; + c->clip_depth++; +} + +static void +hb_gpu_paint_push_transform (hb_paint_funcs_t *funcs HB_UNUSED, + void *paint_data, + float xx, float yx, + float xy, float yy, + float dx, float dy, + void *user_data HB_UNUSED) +{ + hb_gpu_paint_t *c = (hb_gpu_paint_t *) paint_data; + if (unlikely (!c->transform_stack.push_or_fail (c->cur_transform))) + { + c->unsupported = true; + return; + } + hb_transform_t t (xx, yx, xy, yy, dx, dy); + c->cur_transform.multiply (t); /* cur = cur * t */ +} + +static void +hb_gpu_paint_pop_transform (hb_paint_funcs_t *funcs HB_UNUSED, + void *paint_data, + void *user_data HB_UNUSED) +{ + hb_gpu_paint_t *c = (hb_gpu_paint_t *) paint_data; + if (unlikely (!c->transform_stack.length)) + return; + c->cur_transform = c->transform_stack.arrayZ[c->transform_stack.length - 1]; + c->transform_stack.shrink (c->transform_stack.length - 1); +} + +/* Emit a 1-texel control op. Used for PUSH_GROUP / POP_GROUP. */ +static void +emit_control_op (hb_gpu_paint_t *c, int16_t op_type, int16_t aux) +{ + if (unlikely (c->num_ops >= HB_GPU_PAINT_MAX_OPS)) + { + c->unsupported = true; + return; + } + if (unlikely (!c->ops.resize (c->ops.length + 4))) + { + c->unsupported = true; + return; + } + int16_t *o = &c->ops.arrayZ[c->ops.length - 4]; + o[0] = op_type; + o[1] = aux; + o[2] = 0; + o[3] = 0; + c->num_ops++; +} + +static void +hb_gpu_paint_push_group (hb_paint_funcs_t *funcs HB_UNUSED, + void *paint_data, + void *user_data HB_UNUSED) +{ + hb_gpu_paint_t *c = (hb_gpu_paint_t *) paint_data; + c->group_depth++; + if (unlikely (c->group_depth > HB_GPU_PAINT_MAX_GROUP_DEPTH)) + { + c->unsupported = true; + return; + } + emit_control_op (c, HB_GPU_PAINT_OP_PUSH_GROUP, 0); +} + +static void +hb_gpu_paint_pop_group (hb_paint_funcs_t *funcs HB_UNUSED, + void *paint_data, + hb_paint_composite_mode_t mode, + void *user_data HB_UNUSED) +{ + hb_gpu_paint_t *c = (hb_gpu_paint_t *) paint_data; + bool was_in_range = c->group_depth <= HB_GPU_PAINT_MAX_GROUP_DEPTH; + if (likely (c->group_depth > 0)) c->group_depth--; + if (was_in_range) + emit_control_op (c, HB_GPU_PAINT_OP_POP_GROUP, (int16_t) mode); +} + +/* Quantize unsigned byte 0..255 to signed Q15 0..32767. */ +static inline int16_t +color_to_q15 (unsigned byte_value) +{ + return (int16_t) ((byte_value * 32767u + 127u) / 255u); +} + +static inline void +color_to_q15_rgba (hb_color_t color, int16_t out[4]) +{ + out[0] = color_to_q15 (hb_color_get_red (color)); + out[1] = color_to_q15 (hb_color_get_green (color)); + out[2] = color_to_q15 (hb_color_get_blue (color)); + out[3] = color_to_q15 (hb_color_get_alpha (color)); +} + +static inline int16_t +clamp_i16 (float v) +{ + if (v <= -32768.f) return -32768; + if (v >= 32767.f) return 32767; + return (int16_t) v; +} + +/* Compute the 2x2 inverse of the transform's linear part, quantize + * each entry to i16 Q10 (multiplier 1024) and write row-major into + * @out: (m00, m01, m10, m11) such that applying it gives + * (M^-1 * v).x = m00 * v.x + m01 * v.y + * (M^-1 * v).y = m10 * v.x + m11 * v.y + * Range [-32, 32), precision ~0.001 -- covers typical COLRv1 + * PaintTransform values with headroom. Callers who need to skip + * transforms for degenerate cases can check for is_identity before + * doing the extra work in-shader, but we always emit so the format + * stays uniform. */ +static inline void +linv_q10 (const hb_transform_t &t, int16_t out[4]) +{ + float det = t.xx * t.yy - t.xy * t.yx; + float inv = fabsf (det) > 1e-12f ? 1.0f / det : 0.0f; + out[0] = clamp_i16 ( t.yy * inv * 1024.f); + out[1] = clamp_i16 (-t.xy * inv * 1024.f); + out[2] = clamp_i16 (-t.yx * inv * 1024.f); + out[3] = clamp_i16 ( t.xx * inv * 1024.f); +} + +/* Transforming pen: applies an affine transform to each outline + * point before forwarding to a downstream hb_draw_funcs_t. The + * downstream's inline draw-state bookkeeping runs against a + * separate state (down_st) so transformed-space updates don't + * pollute the caller's pre-transform state. */ +struct hb_gpu_paint_pen_t +{ + hb_transform_t transform; + hb_draw_funcs_t *dfuncs; + void *data; + hb_draw_state_t down_st; +}; + +static void +hb_gpu_paint_pen_move_to (hb_draw_funcs_t *dfuncs HB_UNUSED, + void *data, hb_draw_state_t *st HB_UNUSED, + float to_x, float to_y, + void *user_data HB_UNUSED) +{ + auto *c = (hb_gpu_paint_pen_t *) data; + c->transform.transform_point (to_x, to_y); + c->dfuncs->move_to (c->data, c->down_st, to_x, to_y); +} + +static void +hb_gpu_paint_pen_line_to (hb_draw_funcs_t *dfuncs HB_UNUSED, + void *data, hb_draw_state_t *st HB_UNUSED, + float to_x, float to_y, + void *user_data HB_UNUSED) +{ + auto *c = (hb_gpu_paint_pen_t *) data; + c->transform.transform_point (to_x, to_y); + c->dfuncs->line_to (c->data, c->down_st, to_x, to_y); +} + +static void +hb_gpu_paint_pen_quadratic_to (hb_draw_funcs_t *dfuncs HB_UNUSED, + void *data, hb_draw_state_t *st HB_UNUSED, + float c_x, float c_y, + float to_x, float to_y, + void *user_data HB_UNUSED) +{ + auto *c = (hb_gpu_paint_pen_t *) data; + c->transform.transform_point (c_x, c_y); + c->transform.transform_point (to_x, to_y); + c->dfuncs->quadratic_to (c->data, c->down_st, c_x, c_y, to_x, to_y); +} + +static void +hb_gpu_paint_pen_cubic_to (hb_draw_funcs_t *dfuncs HB_UNUSED, + void *data, hb_draw_state_t *st HB_UNUSED, + float c1_x, float c1_y, + float c2_x, float c2_y, + float to_x, float to_y, + void *user_data HB_UNUSED) +{ + auto *c = (hb_gpu_paint_pen_t *) data; + c->transform.transform_point (c1_x, c1_y); + c->transform.transform_point (c2_x, c2_y); + c->transform.transform_point (to_x, to_y); + c->dfuncs->cubic_to (c->data, c->down_st, c1_x, c1_y, c2_x, c2_y, to_x, to_y); +} + +static void +hb_gpu_paint_pen_close_path (hb_draw_funcs_t *dfuncs HB_UNUSED, + void *data, hb_draw_state_t *st HB_UNUSED, + void *user_data HB_UNUSED) +{ + auto *c = (hb_gpu_paint_pen_t *) data; + c->dfuncs->close_path (c->data, c->down_st); +} + +static inline void free_static_gpu_paint_pen_funcs (); + +static struct hb_gpu_paint_pen_funcs_lazy_loader_t + : hb_draw_funcs_lazy_loader_t +{ + static hb_draw_funcs_t *create () + { + hb_draw_funcs_t *funcs = hb_draw_funcs_create (); + hb_draw_funcs_set_move_to_func (funcs, hb_gpu_paint_pen_move_to, nullptr, nullptr); + hb_draw_funcs_set_line_to_func (funcs, hb_gpu_paint_pen_line_to, nullptr, nullptr); + hb_draw_funcs_set_quadratic_to_func (funcs, hb_gpu_paint_pen_quadratic_to, nullptr, nullptr); + hb_draw_funcs_set_cubic_to_func (funcs, hb_gpu_paint_pen_cubic_to, nullptr, nullptr); + hb_draw_funcs_set_close_path_func (funcs, hb_gpu_paint_pen_close_path, nullptr, nullptr); + hb_draw_funcs_make_immutable (funcs); + hb_atexit (free_static_gpu_paint_pen_funcs); + return funcs; + } +} static_gpu_paint_pen_funcs; + +static inline void +free_static_gpu_paint_pen_funcs () +{ + static_gpu_paint_pen_funcs.free_instance (); +} + +/* Rasterize @clip's glyph outline into a new sub-blob and + * accumulate its extents. Returns the sub_blob index (>= 0) on + * success, or -1 if the outline is empty / the layer should be + * skipped. Sets c->unsupported on hard failure. */ +static int +emit_clip_sub_blob (hb_gpu_paint_t *c, + const hb_gpu_paint_t::pending_clip_t &clip) +{ + /* Path clips were already encoded into sub_blobs at + * push_clip_path_end time; just accumulate extents and hand + * back the pre-baked index. */ + if (clip.sub_blob_index >= 0) + { + c->ext_min_x = hb_min (c->ext_min_x, clip.ext_x0); + c->ext_max_x = hb_max (c->ext_max_x, clip.ext_x1); + c->ext_min_y = hb_min (c->ext_min_y, clip.ext_y0); + c->ext_max_y = hb_max (c->ext_max_y, clip.ext_y1); + return clip.sub_blob_index; + } + + if (unlikely (!c->scratch_draw)) + { + c->scratch_draw = hb_gpu_draw_create_or_fail (); + if (unlikely (!c->scratch_draw)) + { + c->unsupported = true; + return -1; + } + } + hb_gpu_draw_clear (c->scratch_draw); + + bool ok; + if (clip.transform.is_identity ()) + { + /* Fast path: feed the glyph outline straight into the draw + * encoder with no adapter. */ + ok = hb_gpu_draw_glyph_or_fail (c->scratch_draw, clip.font, clip.glyph); + } + else + { + /* Transform each outline point by the transform that was + * current at push_clip_glyph time -- NOT the innermost + * cur_transform, which may have additional PaintTransform + * wrappers from the paint child underneath. */ + int x_scale, y_scale; + hb_font_get_scale (clip.font, &x_scale, &y_scale); + hb_gpu_draw_set_scale (c->scratch_draw, x_scale, y_scale); + + hb_gpu_paint_pen_t pen = {}; + pen.transform = clip.transform; + pen.dfuncs = hb_gpu_draw_get_funcs (c->scratch_draw); + pen.data = c->scratch_draw; + pen.down_st = HB_DRAW_STATE_DEFAULT; + ok = hb_font_draw_glyph_or_fail (clip.font, clip.glyph, + static_gpu_paint_pen_funcs.get_unconst (), + &pen); + /* Close any trailing open path on the downstream state, since + * hb_font_draw_glyph_or_fail only closes via our pen's state. */ + pen.dfuncs->close_path (pen.data, pen.down_st); + } + if (!ok) + return -1; /* Clip glyph has no outline -- skip. */ + + hb_glyph_extents_t ext; + hb_blob_t *blob = hb_gpu_draw_encode (c->scratch_draw, &ext); + if (unlikely (!blob || !c->sub_blobs.push_or_fail (blob))) + { + hb_blob_destroy (blob); + c->unsupported = true; + return -1; + } + + /* Accumulate extents: x_bearing/y_bearing are top-left, width + * positive, height negative (growing down). */ + int x0 = ext.x_bearing; + int x1 = (int) ((int64_t) ext.x_bearing + ext.width); + int y0 = ext.y_bearing; + int y1 = (int) ((int64_t) ext.y_bearing + ext.height); + c->ext_min_x = hb_min (c->ext_min_x, hb_min (x0, x1)); + c->ext_max_x = hb_max (c->ext_max_x, hb_max (x0, x1)); + c->ext_min_y = hb_min (c->ext_min_y, hb_min (y0, y1)); + c->ext_max_y = hb_max (c->ext_max_y, hb_max (y0, y1)); + + return (int) (c->sub_blobs.length - 1); +} + +/* Emit a sub-blob for every clip currently on the stack and return + * their indices in @out (set to -1 for unused slots). Returns + * false if any clip's outline is empty (caller should skip the + * layer entirely) or hb_gpu_draw_encode failed. */ +static bool +emit_all_clip_sub_blobs (hb_gpu_paint_t *c, int out[HB_GPU_PAINT_MAX_CLIP_DEPTH]) +{ + for (unsigned i = 0; i < HB_GPU_PAINT_MAX_CLIP_DEPTH; i++) + out[i] = -1; + for (unsigned i = 0; i < hb_min (c->clip_depth, (unsigned) HB_GPU_PAINT_MAX_CLIP_DEPTH); i++) + { + out[i] = emit_clip_sub_blob (c, c->clip_stack[i]); + if (out[i] < 0) + return false; + } + return true; +} + +/* Emit a 3-texel LAYER_GRADIENT op header (excluding the + * gradient-meta texel which the caller fills in). @subtype is + * 0 = linear, 1 = radial, 2 = sweep. */ +static int16_t * +emit_gradient_op_header (hb_gpu_paint_t *c, unsigned subtype, + const int clip_idx[HB_GPU_PAINT_MAX_CLIP_DEPTH]) +{ + if (unlikely (!c->ops.resize (c->ops.length + 12))) + { c->unsupported = true; return nullptr; } + int16_t *o = &c->ops.arrayZ[c->ops.length - 12]; + int16_t flags = (int16_t) subtype; + if (clip_idx[1] >= 0) flags |= HB_GPU_PAINT_FLAG_HAS_CLIP2; + if (clip_idx[2] >= 0) flags |= HB_GPU_PAINT_FLAG_HAS_CLIP3; + o[0] = HB_GPU_PAINT_OP_LAYER_GRADIENT; + o[1] = flags; + o[2] = (int16_t) ((clip_idx[0] >> 16) & 0xffff); + o[3] = (int16_t) (clip_idx[0] & 0xffff); + o[4] = clip_idx[1] >= 0 ? (int16_t) ((clip_idx[1] >> 16) & 0xffff) : 0; + o[5] = clip_idx[1] >= 0 ? (int16_t) (clip_idx[1] & 0xffff) : 0; + o[6] = clip_idx[2] >= 0 ? (int16_t) ((clip_idx[2] >> 16) & 0xffff) : 0; + o[7] = clip_idx[2] >= 0 ? (int16_t) (clip_idx[2] & 0xffff) : 0; + return o + 8; /* texel 2: gradient meta -- caller fills */ +} + +static void +hb_gpu_paint_emit_solid (hb_gpu_paint_t *c, + hb_bool_t is_foreground, + hb_color_t color) +{ + if (unlikely (c->clip_depth == 0)) + return; + if (unlikely (c->num_ops >= HB_GPU_PAINT_MAX_OPS)) + { + c->unsupported = true; + return; + } + + int clip_idx[HB_GPU_PAINT_MAX_CLIP_DEPTH]; + if (!emit_all_clip_sub_blobs (c, clip_idx)) + return; + + /* Emit LAYER_SOLID op: 3 texels (12 int16s). + * texel 0: op_type, flags, clip1_hi, clip1_lo + * texel 1: clip2_hi, clip2_lo, 0, 0 (only meaningful if HAS_CLIP2) + * texel 2: r_q15, g_q15, b_q15, a_q15 + * Payloads hold sub_blob indices; hb_gpu_paint_encode() patches + * them into texel offsets at serialize time. + * flags bit 0: use shader foreground uniform instead of the + * baked color (so runtime foreground-color changes still work). + * flags bit 8: a second clip outline is present in texel 1. */ + if (unlikely (!c->ops.resize (c->ops.length + 12))) + { + c->unsupported = true; + return; + } + int16_t *o = &c->ops.arrayZ[c->ops.length - 12]; + int16_t flags = (int16_t) (is_foreground ? HB_GPU_PAINT_FLAG_IS_FOREGROUND : 0); + if (clip_idx[1] >= 0) flags |= HB_GPU_PAINT_FLAG_HAS_CLIP2; + if (clip_idx[2] >= 0) flags |= HB_GPU_PAINT_FLAG_HAS_CLIP3; + o[0] = HB_GPU_PAINT_OP_LAYER_SOLID; + o[1] = flags; + o[2] = (int16_t) ((clip_idx[0] >> 16) & 0xffff); + o[3] = (int16_t) (clip_idx[0] & 0xffff); + o[4] = clip_idx[1] >= 0 ? (int16_t) ((clip_idx[1] >> 16) & 0xffff) : 0; + o[5] = clip_idx[1] >= 0 ? (int16_t) (clip_idx[1] & 0xffff) : 0; + o[6] = clip_idx[2] >= 0 ? (int16_t) ((clip_idx[2] >> 16) & 0xffff) : 0; + o[7] = clip_idx[2] >= 0 ? (int16_t) (clip_idx[2] & 0xffff) : 0; + color_to_q15_rgba (color, o + 8); + c->num_ops++; +} + +/* Append a color line (@count stops) to @grad_data in the encoded + * stop format used by gradient ops: 2 texels per stop. + * texel a: (offset_q15, flags, _, _) with flags bit 0 = is_foreground + * texel b: (r_q15, g_q15, b_q15, a_q15) + * Returns false on allocation failure. */ +static bool +append_color_stops (hb_vector_t &grad_data, + const hb_color_stop_t *stops, + unsigned count) +{ + unsigned base = grad_data.length; + if (unlikely (!grad_data.resize (base + count * 8))) + return false; + int16_t *p = grad_data.arrayZ + base; + for (unsigned i = 0; i < count; i++) + { + float off = stops[i].offset; + if (off < -1.f) off = -1.f; + else if (off > 1.f) off = 1.f; + p[0] = (int16_t) (off * 32767.f); + p[1] = (int16_t) (stops[i].is_foreground ? 1 : 0); + p[2] = 0; + p[3] = 0; + color_to_q15_rgba (stops[i].color, p + 4); + p += 8; + } + return true; +} + +static void +hb_gpu_paint_emit_linear (hb_gpu_paint_t *c, + hb_color_line_t *color_line, + float x0, float y0, + float x1, float y1, + float x2, float y2) +{ + if (unlikely (c->clip_depth == 0)) + return; + if (unlikely (c->num_ops >= HB_GPU_PAINT_MAX_OPS)) + { + c->unsupported = true; + return; + } + + /* Resolve stops (triggers custom_palette_color, etc). */ + if (unlikely (!c->fetch_color_stops (color_line))) + return; + hb_color_stop_t *stops = c->color_stops_scratch.arrayZ; + unsigned got = c->color_stops_scratch.length; + + hb_paint_extend_t extend = hb_color_line_get_extend (color_line); + + /* Emit clip sub-blob(s) first. */ + int clip_idx[HB_GPU_PAINT_MAX_CLIP_DEPTH]; + if (!emit_all_clip_sub_blobs (c, clip_idx)) return; + + /* Build gradient params sub-blob. + * texel 0: (p0_rendered_x, p0_rendered_y, d_canonical_x, d_canonical_y) + * i16 font units; d = p1 - p0 stored in untransformed space + * texel 1: L^-1 as 4 i16 Q10 (row-major) + * texels 2..N: color stops (2 texels each) + * The shader computes p_canonical = L^-1 * (renderCoord - p0_rendered) + * and evaluates t = dot(p_canonical, d) / dot(d, d) in + * untransformed space, so affine distortions of the axis are + * handled exactly rather than approximated. */ + hb_vector_t grad_data; + if (unlikely (!grad_data.resize (8))) + { c->unsupported = true; return; } + + float lx0, ly0, lx1, ly1; + hb_paint_reduce_linear_anchors (x0, y0, x1, y1, x2, y2, &lx0, &ly0, &lx1, &ly1); + /* Normalize stops to [0,1]; shift axis endpoints to compensate. */ + float mn, mx; + hb_paint_normalize_color_line (stops, got, &mn, &mx); + float dx = lx1 - lx0, dy = ly1 - ly0; + float ax0 = lx0 + mn * dx, ay0 = ly0 + mn * dy; + float ax1 = lx0 + mx * dx, ay1 = ly0 + mx * dy; + /* p0 in rendered space; d in untransformed space. */ + float p0x_r = ax0, p0y_r = ay0; + c->cur_transform.transform_point (p0x_r, p0y_r); + grad_data[0] = clamp_i16 (p0x_r); + grad_data[1] = clamp_i16 (p0y_r); + grad_data[2] = clamp_i16 (ax1 - ax0); + grad_data[3] = clamp_i16 (ay1 - ay0); + int16_t Linv[4]; + linv_q10 (c->cur_transform, Linv); + grad_data[4] = Linv[0]; + grad_data[5] = Linv[1]; + grad_data[6] = Linv[2]; + grad_data[7] = Linv[3]; + + if (unlikely (!append_color_stops (grad_data, stops, got))) + { c->unsupported = true; return; } + + unsigned grad_bytes = grad_data.length * sizeof (int16_t); + hb_blob_t *grad_blob = hb_blob_create ((const char *) grad_data.arrayZ, + grad_bytes, HB_MEMORY_MODE_DUPLICATE, + nullptr, nullptr); + if (unlikely (!grad_blob || !c->sub_blobs.push_or_fail (grad_blob))) + { + hb_blob_destroy (grad_blob); + c->unsupported = true; + return; + } + unsigned grad_idx = c->sub_blobs.length - 1; + + int16_t *meta = emit_gradient_op_header (c, 0 /* linear */, clip_idx); + if (unlikely (!meta)) return; + meta[0] = (int16_t) ((grad_idx >> 16) & 0xffff); + meta[1] = (int16_t) (grad_idx & 0xffff); + meta[2] = (int16_t) extend; + meta[3] = (int16_t) got; + c->num_ops++; +} + +static void +hb_gpu_paint_emit_radial (hb_gpu_paint_t *c, + hb_color_line_t *color_line, + float x0, float y0, float r0, + float x1, float y1, float r1) +{ + if (unlikely (c->clip_depth == 0)) + return; + if (unlikely (c->num_ops >= HB_GPU_PAINT_MAX_OPS)) + { + c->unsupported = true; + return; + } + + if (unlikely (!c->fetch_color_stops (color_line))) + return; + hb_color_stop_t *stops = c->color_stops_scratch.arrayZ; + unsigned got = c->color_stops_scratch.length; + + hb_paint_extend_t extend = hb_color_line_get_extend (color_line); + + int clip_idx[HB_GPU_PAINT_MAX_CLIP_DEPTH]; + if (!emit_all_clip_sub_blobs (c, clip_idx)) return; + + /* Build gradient params sub-blob. + * texel 0: (c0_rendered_x, c0_rendered_y, d_canonical_x, d_canonical_y) + * where d = c1 - c0 in untransformed space + * texel 1: (r0, r1, _, _) in untransformed font units (i16) + * texel 2: L^-1 as 4 i16 Q10 (row-major) + * texels 3..N: color stops (2 texels each) + * Shader computes p_canonical = L^-1 * (renderCoord - c0_rendered) + * then solves |p - t*d|^2 = (r0 + t*(r1-r0))^2 in the + * untransformed frame, so non-uniform scale / shear (which would + * turn the circle into an ellipse in rendered space) is handled + * exactly. + */ + hb_vector_t grad_data; + if (unlikely (!grad_data.resize (12))) + { c->unsupported = true; return; } + float mn, mx; + hb_paint_normalize_color_line (stops, got, &mn, &mx); + float dx = x1 - x0, dy = y1 - y0, dr = r1 - r0; + float cx0 = x0 + mn * dx, cy0 = y0 + mn * dy, cr0 = r0 + mn * dr; + float cx1 = x0 + mx * dx, cy1 = y0 + mx * dy, cr1 = r0 + mx * dr; + /* c0 in rendered space; d (= c1 - c0) and radii in untransformed. */ + float cx0_r = cx0, cy0_r = cy0; + c->cur_transform.transform_point (cx0_r, cy0_r); + grad_data[0] = clamp_i16 (cx0_r); + grad_data[1] = clamp_i16 (cy0_r); + grad_data[2] = clamp_i16 (cx1 - cx0); + grad_data[3] = clamp_i16 (cy1 - cy0); + grad_data[4] = clamp_i16 (cr0); + grad_data[5] = clamp_i16 (cr1); + grad_data[6] = 0; + grad_data[7] = 0; + int16_t Linv[4]; + linv_q10 (c->cur_transform, Linv); + grad_data[8] = Linv[0]; + grad_data[9] = Linv[1]; + grad_data[10] = Linv[2]; + grad_data[11] = Linv[3]; + + if (unlikely (!append_color_stops (grad_data, stops, got))) + { c->unsupported = true; return; } + + unsigned grad_bytes = grad_data.length * sizeof (int16_t); + hb_blob_t *grad_blob = hb_blob_create ((const char *) grad_data.arrayZ, + grad_bytes, HB_MEMORY_MODE_DUPLICATE, + nullptr, nullptr); + if (unlikely (!grad_blob || !c->sub_blobs.push_or_fail (grad_blob))) + { + hb_blob_destroy (grad_blob); + c->unsupported = true; + return; + } + unsigned grad_idx = c->sub_blobs.length - 1; + + int16_t *meta = emit_gradient_op_header (c, 1 /* radial */, clip_idx); + if (unlikely (!meta)) return; + meta[0] = (int16_t) ((grad_idx >> 16) & 0xffff); + meta[1] = (int16_t) (grad_idx & 0xffff); + meta[2] = (int16_t) extend; + meta[3] = (int16_t) got; + c->num_ops++; +} + +static void +hb_gpu_paint_color (hb_paint_funcs_t *funcs HB_UNUSED, + void *paint_data, + hb_bool_t is_foreground, + hb_color_t color, + void *user_data HB_UNUSED) +{ + hb_gpu_paint_emit_solid ((hb_gpu_paint_t *) paint_data, is_foreground, color); +} + +static void +hb_gpu_paint_linear_gradient (hb_paint_funcs_t *funcs HB_UNUSED, + void *paint_data, + hb_color_line_t *color_line, + float x0, float y0, + float x1, float y1, + float x2, float y2, + void *user_data HB_UNUSED) +{ + hb_gpu_paint_emit_linear ((hb_gpu_paint_t *) paint_data, color_line, + x0, y0, x1, y1, x2, y2); +} + +static void +hb_gpu_paint_radial_gradient (hb_paint_funcs_t *funcs HB_UNUSED, + void *paint_data, + hb_color_line_t *color_line, + float x0, float y0, float r0, + float x1, float y1, float r1, + void *user_data HB_UNUSED) +{ + hb_gpu_paint_emit_radial ((hb_gpu_paint_t *) paint_data, color_line, + x0, y0, r0, x1, y1, r1); +} + +static void +hb_gpu_paint_emit_sweep (hb_gpu_paint_t *c, + hb_color_line_t *color_line, + float cx, float cy, + float start_angle, float end_angle) +{ + if (unlikely (c->clip_depth == 0)) + return; + if (unlikely (c->num_ops >= HB_GPU_PAINT_MAX_OPS)) + { + c->unsupported = true; + return; + } + + unsigned count = hb_color_line_get_color_stops (color_line, 0, nullptr, nullptr); + if (unlikely (!count)) + return; + hb_color_stop_t stack_stops[16]; + hb_color_stop_t *stops = stack_stops; + hb_color_stop_t *heap_stops = nullptr; + if (count > 16) + { + heap_stops = (hb_color_stop_t *) hb_malloc (count * sizeof (hb_color_stop_t)); + if (unlikely (!heap_stops)) { c->unsupported = true; return; } + stops = heap_stops; + } + unsigned got = count; + hb_color_line_get_color_stops (color_line, 0, &got, stops); + + hb_paint_extend_t extend = hb_color_line_get_extend (color_line); + + int clip_idx[HB_GPU_PAINT_MAX_CLIP_DEPTH]; + if (!emit_all_clip_sub_blobs (c, clip_idx)) { hb_free (heap_stops); return; } + + /* Build gradient params sub-blob. + * texel 0: (center_rendered_x, center_rendered_y, + * start_q14, end_q14) + * angles in radians, stored as Q14 fractions of pi; start/end + * stay in untransformed space (no rotation baked in). + * texel 1: L^-1 as 4 i16 Q10 (row-major) + * texels 2..N: color stops (2 texels each) + * Shader does p = L^-1 * (renderCoord - center_rendered) and + * atan2 on p, so non-uniform scale / shear angular distortion is + * handled exactly. + */ + hb_vector_t grad_data; + if (unlikely (!grad_data.resize (8))) + { c->unsupported = true; hb_free (heap_stops); return; } + + float mn, mx; + hb_paint_normalize_color_line (stops, got, &mn, &mx); + float a_span = end_angle - start_angle; + float a_lo = start_angle + mn * a_span; + float a_hi = start_angle + mx * a_span; + auto rad_to_q14_pi = [] (float rad) -> int16_t { + float v = rad * (float) (1.0 / M_PI); /* fraction of pi */ + if (v <= -2.f) return -32768; + if (v >= 2.f) return 32767; + return (int16_t) (v * 16384.f); + }; + /* center in rendered space; angles stay canonical. */ + float tcx = cx, tcy = cy; + c->cur_transform.transform_point (tcx, tcy); + grad_data[0] = clamp_i16 (tcx); + grad_data[1] = clamp_i16 (tcy); + grad_data[2] = rad_to_q14_pi (a_lo); + grad_data[3] = rad_to_q14_pi (a_hi); + int16_t Linv[4]; + linv_q10 (c->cur_transform, Linv); + grad_data[4] = Linv[0]; + grad_data[5] = Linv[1]; + grad_data[6] = Linv[2]; + grad_data[7] = Linv[3]; + + if (unlikely (!append_color_stops (grad_data, stops, got))) + { c->unsupported = true; hb_free (heap_stops); return; } + hb_free (heap_stops); + + unsigned grad_bytes = grad_data.length * sizeof (int16_t); + hb_blob_t *grad_blob = hb_blob_create ((const char *) grad_data.arrayZ, + grad_bytes, HB_MEMORY_MODE_DUPLICATE, + nullptr, nullptr); + if (unlikely (!grad_blob || !c->sub_blobs.push_or_fail (grad_blob))) + { + hb_blob_destroy (grad_blob); + c->unsupported = true; + return; + } + unsigned grad_idx = c->sub_blobs.length - 1; + + int16_t *meta = emit_gradient_op_header (c, 2 /* sweep */, clip_idx); + if (unlikely (!meta)) return; + meta[0] = (int16_t) ((grad_idx >> 16) & 0xffff); + meta[1] = (int16_t) (grad_idx & 0xffff); + meta[2] = (int16_t) extend; + meta[3] = (int16_t) got; + c->num_ops++; +} + +static void +hb_gpu_paint_sweep_gradient (hb_paint_funcs_t *funcs HB_UNUSED, + void *paint_data, + hb_color_line_t *color_line, + float cx, float cy, + float start_angle, + float end_angle, + void *user_data HB_UNUSED) +{ + hb_gpu_paint_emit_sweep ((hb_gpu_paint_t *) paint_data, color_line, + cx, cy, start_angle, end_angle); +} + +/* PaintImage isn't representable by our slug+gradient encoder; mark + * unsupported so the caller learns the glyph won't render rather + * than getting a partial blob. PaintRectangleClip is intentionally + * left to the default no-op: the encoder simply ignores the + * rectangle (output is bigger than it should be, but renders). */ +static hb_bool_t +hb_gpu_paint_image (hb_paint_funcs_t *funcs HB_UNUSED, + void *paint_data, + hb_blob_t *image HB_UNUSED, + unsigned int width HB_UNUSED, + unsigned int height HB_UNUSED, + hb_tag_t format HB_UNUSED, + float slant HB_UNUSED, + hb_glyph_extents_t *extents HB_UNUSED, + void *user_data HB_UNUSED) +{ + ((hb_gpu_paint_t *) paint_data)->unsupported = true; + return false; +} + +static inline void free_static_gpu_paint_funcs (); + +static struct hb_gpu_paint_funcs_lazy_loader_t + : hb_paint_funcs_lazy_loader_t +{ + static hb_paint_funcs_t *create () + { + hb_paint_funcs_t *funcs = hb_paint_funcs_create (); + + hb_paint_funcs_set_push_transform_func (funcs, hb_gpu_paint_push_transform, nullptr, nullptr); + hb_paint_funcs_set_pop_transform_func (funcs, hb_gpu_paint_pop_transform, nullptr, nullptr); + hb_paint_funcs_set_push_clip_glyph_func (funcs, hb_gpu_paint_push_clip_glyph, nullptr, nullptr); + hb_paint_funcs_set_push_clip_path_start_func (funcs, hb_gpu_paint_push_clip_path_start, nullptr, nullptr); + hb_paint_funcs_set_push_clip_path_end_func (funcs, hb_gpu_paint_push_clip_path_end, nullptr, nullptr); + hb_paint_funcs_set_pop_clip_func (funcs, hb_gpu_paint_pop_clip, nullptr, nullptr); + hb_paint_funcs_set_push_group_func (funcs, hb_gpu_paint_push_group, nullptr, nullptr); + hb_paint_funcs_set_pop_group_func (funcs, hb_gpu_paint_pop_group, nullptr, nullptr); + hb_paint_funcs_set_color_func (funcs, hb_gpu_paint_color, nullptr, nullptr); + hb_paint_funcs_set_linear_gradient_func (funcs, hb_gpu_paint_linear_gradient, nullptr, nullptr); + hb_paint_funcs_set_radial_gradient_func (funcs, hb_gpu_paint_radial_gradient, nullptr, nullptr); + hb_paint_funcs_set_sweep_gradient_func (funcs, hb_gpu_paint_sweep_gradient, nullptr, nullptr); + hb_paint_funcs_set_custom_palette_color_func (funcs, hb_gpu_paint_custom_palette_color, nullptr, nullptr); + /* PaintImage can't be represented by our slug+gradient encoder. */ + hb_paint_funcs_set_image_func (funcs, hb_gpu_paint_image, nullptr, nullptr); + + hb_paint_funcs_make_immutable (funcs); + + hb_atexit (free_static_gpu_paint_funcs); + + return funcs; + } +} static_gpu_paint_funcs; + +static inline void +free_static_gpu_paint_funcs () +{ + static_gpu_paint_funcs.free_instance (); +} + + +/* ---- Public API ---- */ + +/** + * hb_gpu_paint_create_or_fail: + * + * Creates a new GPU color-glyph paint encoder. + * + * Return value: (transfer full): + * A newly allocated #hb_gpu_paint_t, or `NULL` on allocation + * failure. + * + * Since: 14.2.0 + **/ +hb_gpu_paint_t * +hb_gpu_paint_create_or_fail (void) +{ + return hb_object_create (); +} + +/** + * hb_gpu_paint_reference: (skip) + * @paint: a GPU color-glyph paint encoder + * + * Increases the reference count on @paint by one. + * + * Return value: (transfer full): + * The referenced #hb_gpu_paint_t. + * + * Since: 14.2.0 + **/ +hb_gpu_paint_t * +hb_gpu_paint_reference (hb_gpu_paint_t *paint) +{ + return hb_object_reference (paint); +} + +/** + * hb_gpu_paint_destroy: (skip) + * @paint: a GPU color-glyph paint encoder + * + * Decreases the reference count on @paint by one. When the + * reference count reaches zero, the encoder is freed. + * + * Since: 14.2.0 + **/ +void +hb_gpu_paint_destroy (hb_gpu_paint_t *paint) +{ + if (!hb_object_should_destroy (paint)) + return; + + hb_map_destroy (paint->custom_palette); + for (hb_blob_t *b : paint->sub_blobs) + hb_blob_destroy (b); + hb_gpu_draw_destroy (paint->scratch_draw); + hb_blob_destroy (paint->recycled_blob); + + hb_object_actually_destroy (paint); + hb_free (paint); +} + +/** + * hb_gpu_paint_set_user_data: (skip) + * @paint: a GPU color-glyph paint encoder + * @key: the user-data key + * @data: a pointer to the user data + * @destroy: (nullable): a callback to call when @data is not needed anymore + * @replace: whether to replace an existing data with the same key + * + * Attaches user data to @paint. + * + * Return value: `true` if success, `false` otherwise + * + * Since: 14.2.0 + **/ +hb_bool_t +hb_gpu_paint_set_user_data (hb_gpu_paint_t *paint, + hb_user_data_key_t *key, + void *data, + hb_destroy_func_t destroy, + hb_bool_t replace) +{ + return hb_object_set_user_data (paint, key, data, destroy, replace); +} + +/** + * hb_gpu_paint_get_user_data: (skip) + * @paint: a GPU color-glyph paint encoder + * @key: the user-data key + * + * Fetches the user data associated with the specified key. + * + * Return value: (transfer none): + * A pointer to the user data. + * + * Since: 14.2.0 + **/ +void * +hb_gpu_paint_get_user_data (const hb_gpu_paint_t *paint, + hb_user_data_key_t *key) +{ + return hb_object_get_user_data (paint, key); +} + +/** + * hb_gpu_paint_get_funcs: + * @paint: a GPU paint context. + * + * Fetches the #hb_paint_funcs_t that feeds paint data into + * @paint. Pass @paint as the @paint_data argument when + * calling the paint functions. + * + * Return value: (transfer none): + * The GPU paint functions + * + * Since: 14.2.0 + **/ +hb_paint_funcs_t * +hb_gpu_paint_get_funcs (const hb_gpu_paint_t *paint HB_UNUSED) +{ + return static_gpu_paint_funcs.get_unconst (); +} + +/** + * hb_gpu_paint_set_palette: + * @paint: a GPU color-glyph paint encoder + * @palette: palette index + * + * Selects which font palette is used when paint callbacks look up + * indexed colors. Default is palette 0. + * + * Since: 14.2.0 + **/ +void +hb_gpu_paint_set_palette (hb_gpu_paint_t *paint, + unsigned palette) +{ + paint->palette = palette; +} + +/** + * hb_gpu_paint_get_palette: + * @paint: a GPU color-glyph paint encoder + * + * Returns the palette index previously set on @paint, or 0 if none + * was set. + * + * Return value: the palette index. + * + * Since: 14.2.0 + **/ +unsigned +hb_gpu_paint_get_palette (const hb_gpu_paint_t *paint) +{ + return paint->palette; +} + +/** + * hb_gpu_paint_clear_custom_palette_colors: + * @paint: a GPU color-glyph paint encoder + * + * Clears all custom palette color overrides previously set on @paint. + * + * Since: 14.2.0 + **/ +void +hb_gpu_paint_clear_custom_palette_colors (hb_gpu_paint_t *paint) +{ + if (paint->custom_palette) + hb_map_clear (paint->custom_palette); +} + +/** + * hb_gpu_paint_set_custom_palette_color: + * @paint: a GPU color-glyph paint encoder + * @color_index: palette index to override + * @color: replacement color + * + * Overrides one font palette color entry. Overrides are keyed by + * @color_index and persist on @paint until cleared (or replaced for + * the same index). + * + * Return value: `true` if the override was set; `false` on allocation failure. + * + * Since: 14.2.0 + **/ +hb_bool_t +hb_gpu_paint_set_custom_palette_color (hb_gpu_paint_t *paint, + unsigned int color_index, + hb_color_t color) +{ + if (unlikely (!paint->custom_palette)) + { + paint->custom_palette = hb_map_create (); + if (unlikely (!paint->custom_palette)) + return false; + } + hb_map_set (paint->custom_palette, color_index, color); + return hb_map_allocation_successful (paint->custom_palette); +} + +/** + * hb_gpu_paint_set_scale: + * @paint: a GPU color-glyph paint encoder + * @x_scale: horizontal scale (typically from hb_font_get_scale()) + * @y_scale: vertical scale + * + * Sets the font scale used to dimension clip-glyph slug outlines + * inside the encoded blob. Called automatically by + * hb_gpu_paint_glyph(). + * + * Since: 14.2.0 + **/ +void +hb_gpu_paint_set_scale (hb_gpu_paint_t *paint, + int x_scale, + int y_scale) +{ + paint->x_scale = x_scale; + paint->y_scale = y_scale; +} + +/** + * hb_gpu_paint_get_scale: + * @paint: a GPU color-glyph paint encoder + * @x_scale: (out): horizontal scale + * @y_scale: (out): vertical scale + * + * Fetches the font scale previously set on @paint. + * + * Since: 14.2.0 + **/ +void +hb_gpu_paint_get_scale (const hb_gpu_paint_t *paint, + int *x_scale, + int *y_scale) +{ + if (x_scale) *x_scale = paint->x_scale; + if (y_scale) *y_scale = paint->y_scale; +} + +/** + * hb_gpu_paint_glyph_or_fail: + * @paint: a GPU color-glyph paint encoder + * @font: font to paint from + * @glyph: glyph ID to paint + * + * Convenience to feed @glyph's paint tree into the encoder. + * Equivalent to: + * + * |[ + * hb_gpu_paint_set_scale (paint, x_scale, y_scale); + * hb_font_paint_glyph_or_fail (font, glyph, + * hb_gpu_paint_get_funcs (paint), paint, + * palette, HB_COLOR (0, 0, 0, 0xff)); + * ]| + * + * Encoder-level limitations (unsupported paint ops, group-stack + * overflow) do NOT fail here -- they surface later from + * hb_gpu_paint_encode() which returns `NULL`. + * + * Return value: `true` if the font had paint data for @glyph, + * `false` otherwise. + * + * Since: 14.2.0 + **/ +hb_bool_t +hb_gpu_paint_glyph_or_fail (hb_gpu_paint_t *paint, + hb_font_t *font, + hb_codepoint_t glyph) +{ + int x_scale, y_scale; + hb_font_get_scale (font, &x_scale, &y_scale); + hb_gpu_paint_set_scale (paint, x_scale, y_scale); + return hb_font_paint_glyph_or_fail (font, glyph, + hb_gpu_paint_get_funcs (paint), paint, + paint->palette, + /* Foreground RGB is not read from + * the encoded blob -- the + * is_foreground flag routes to the + * shader's foreground uniform. + * Alpha must be opaque so the + * baked color carries only the + * paint-tree alpha (which the + * shader applies on top of the + * uniform). */ + HB_COLOR (0, 0, 0, 0xff)); +} + +/** + * hb_gpu_paint_glyph: + * @paint: a GPU color-glyph paint encoder + * @font: font to paint from + * @glyph: glyph ID to paint + * + * Feeds @glyph into the encoder. Unlike + * hb_gpu_paint_glyph_or_fail(), non-color glyphs are handled + * transparently via a synthesized foreground-colored layer, + * so any glyph with an outline produces output. + * + * Since: 14.2.0 + **/ +void +hb_gpu_paint_glyph (hb_gpu_paint_t *paint, + hb_font_t *font, + hb_codepoint_t glyph) +{ + int x_scale, y_scale; + hb_font_get_scale (font, &x_scale, &y_scale); + hb_gpu_paint_set_scale (paint, x_scale, y_scale); + hb_font_paint_glyph (font, glyph, + hb_gpu_paint_get_funcs (paint), paint, + paint->palette, + /* Foreground RGB is not read from + * the encoded blob -- the + * is_foreground flag routes to the + * shader's foreground uniform. + * Alpha must be opaque so the + * baked color carries only the + * paint-tree alpha (which the + * shader applies on top of the + * uniform). */ + HB_COLOR (0, 0, 0, 0xff)); +} + +/** + * hb_gpu_paint_encode: + * @paint: a GPU color-glyph paint encoder + * @extents: (out): receives the glyph's ink extents in font units + * + * Encodes the accumulated paint state into a GPU-renderable blob + * and writes the glyph's ink extents to @extents. + * + * On return @paint is auto-cleared so it can be reused for the + * next glyph; user configuration (palette, foreground, custom + * palette overrides) is preserved. + * + * Return value: (transfer full): + * A newly allocated blob, or `NULL` if the paint walk hit an + * unsupported feature (see hb_gpu_paint_glyph()'s return value) or + * encoding failed (allocation failure). When the paint accumulated + * no ink (e.g. a space glyph) returns the empty-blob singleton, so + * callers can distinguish "nothing to render" (length 0) from a + * real failure (`NULL`). + * + * Since: 14.2.0 + **/ +hb_blob_t * +hb_gpu_paint_encode (hb_gpu_paint_t *paint, + hb_glyph_extents_t *extents) +{ + HB_SCOPE_GUARD (hb_gpu_paint_clear (paint)); + + if (unlikely (paint->unsupported)) + return nullptr; + /* No ink (e.g. space glyph): return the empty-blob singleton, not + * nullptr. Same convention as hb_gpu_draw_encode(); callers can + * distinguish "nothing to render" (length 0) from "encoder + * failed" (NULL). */ + if (paint->num_ops == 0) + return hb_blob_get_empty (); + + /* Layout: + * header (3 texels = 24 bytes) + * op stream (ops.length i16 words, multiple of 4) + * sub-payloads (concat of each sub_blob's data, 8-byte + * aligned since draw blobs are RGBA16I) + */ + const unsigned header_texels = 3; + const unsigned texel_bytes = 8; + + unsigned ops_texels = paint->ops.length / 4; + unsigned sub_bytes = 0; + for (hb_blob_t *b : paint->sub_blobs) + sub_bytes += hb_blob_get_length (b); + /* Sub-blobs come from the draw encoder which produces 8-byte + * aligned blobs; assert so we notice if that ever changes. */ + if (unlikely (sub_bytes % texel_bytes)) + return nullptr; + + unsigned total_bytes = header_texels * texel_bytes + + paint->ops.length * 2 + + sub_bytes; + + unsigned buf_capacity = 0; + char *replaced_recycled_buf = nullptr; + char *buf_raw = hb_blob_t::recycle_acquire (paint->recycled_blob, total_bytes, + &buf_capacity, &replaced_recycled_buf); + if (unlikely (!buf_raw)) + return nullptr; + int16_t *buf = (int16_t *) (void *) buf_raw; + + /* Compute each sub_blob's texel offset (relative to blob base). */ + unsigned sub_offsets_count = paint->sub_blobs.length; + hb_vector_t sub_offsets; + if (unlikely (!sub_offsets.resize (sub_offsets_count))) + { + hb_blob_t::recycle_abort (buf_raw, paint->recycled_blob); + return nullptr; + } + unsigned cursor = header_texels + ops_texels; + for (unsigned i = 0; i < sub_offsets_count; i++) + { + sub_offsets[i] = cursor; + cursor += hb_blob_get_length (paint->sub_blobs[i]) / texel_bytes; + } + + /* Header. */ + buf[0] = (int16_t) paint->num_ops; + buf[1] = 0; + buf[2] = 0; + buf[3] = 0; + buf[4] = (int16_t) hb_clamp (paint->ext_min_x, -0x7fff, 0x7fff); + buf[5] = (int16_t) hb_clamp (paint->ext_min_y, -0x7fff, 0x7fff); + buf[6] = (int16_t) hb_clamp (paint->ext_max_x, -0x7fff, 0x7fff); + buf[7] = (int16_t) hb_clamp (paint->ext_max_y, -0x7fff, 0x7fff); + buf[8] = (int16_t) header_texels; + buf[9] = 0; + buf[10] = 0; + buf[11] = 0; + + /* Op stream: copy raw, then patch payload slots to texel + * offsets where op_type indicates a sub_blob reference. */ + int16_t *ops_out = buf + header_texels * 4; + hb_memcpy (ops_out, paint->ops.arrayZ, paint->ops.length * 2); + + unsigned i = 0; + while (i < paint->ops.length) + { + int16_t op_type = ops_out[i]; + switch (op_type) + { + case HB_GPU_PAINT_OP_LAYER_SOLID: + case HB_GPU_PAINT_OP_LAYER_GRADIENT: + { + int16_t flags = ops_out[i + 1]; + /* Sub-blob slots in i16 offsets within the op: + * clip1: [i+2, i+3] -- always present + * clip2: [i+4, i+5] -- only if HAS_CLIP2 + * clip3: [i+6, i+7] -- only if HAS_CLIP3 + * grad : [i+8, i+9] (LAYER_GRADIENT only) */ + unsigned slots[4] = { + 2, + (flags & HB_GPU_PAINT_FLAG_HAS_CLIP2) ? 4u : 0u, + (flags & HB_GPU_PAINT_FLAG_HAS_CLIP3) ? 6u : 0u, + op_type == HB_GPU_PAINT_OP_LAYER_GRADIENT ? 8u : 0u + }; + for (unsigned k = 0; k < 4; k++) + { + if (!slots[k]) continue; + unsigned p = i + slots[k]; + unsigned idx = ((uint16_t) ops_out[p] << 16) + | (uint16_t) ops_out[p + 1]; + if (idx < sub_offsets_count) + { + unsigned off = sub_offsets[idx]; + ops_out[p] = (int16_t) ((off >> 16) & 0xffff); + ops_out[p + 1] = (int16_t) (off & 0xffff); + } + } + i += 12; /* 3 texels */ + break; + } + case HB_GPU_PAINT_OP_PUSH_GROUP: + case HB_GPU_PAINT_OP_POP_GROUP: + i += 4; /* 1 texel */ + break; + default: + hb_blob_t::recycle_abort (buf_raw, paint->recycled_blob); + return nullptr; + } + } + + /* Sub-payloads: concat in recorded order. */ + char *dst = (char *) buf + header_texels * texel_bytes + + paint->ops.length * 2; + for (hb_blob_t *b : paint->sub_blobs) + { + unsigned len = hb_blob_get_length (b); + hb_memcpy (dst, hb_blob_get_data (b, nullptr), len); + dst += len; + } + + if (extents) + { + extents->x_bearing = paint->ext_min_x; + extents->y_bearing = paint->ext_max_y; + extents->width = (int) ((int64_t) paint->ext_max_x - paint->ext_min_x); + extents->height = (int) ((int64_t) paint->ext_min_y - paint->ext_max_y); + } + + hb_blob_t *recycled = paint->recycled_blob; + paint->recycled_blob = nullptr; + return hb_blob_t::recycle_finalize (buf_raw, buf_capacity, total_bytes, + recycled, replaced_recycled_buf); +} + +/** + * hb_gpu_paint_clear: + * @paint: a GPU color-glyph paint encoder + * + * Discards accumulated paint state so @paint can be reused for + * another encode. User configuration (font scale) is preserved. + * + * Since: 14.2.0 + **/ +void +hb_gpu_paint_clear (hb_gpu_paint_t *paint) +{ + /* Use reset() not resize(0): if an earlier push_or_fail() set + * the vector's error state (common under failing-malloc), + * resize(0) short-circuits without clearing length. A + * subsequent clear would double-destroy the blob pointers left + * in the array, or keep stale ops across encodes. */ + paint->ops.reset (); + paint->num_ops = 0; + for (hb_blob_t *b : paint->sub_blobs) + hb_blob_destroy (b); + paint->sub_blobs.reset (); + paint->clip_depth = 0; + paint->pending_clip_path = false; + paint->unsupported = false; + paint->cur_transform = {1, 0, 0, 1, 0, 0}; + paint->transform_stack.reset (); + paint->ext_min_x = 0x7fffffff; + paint->ext_min_y = 0x7fffffff; + paint->ext_max_x = -0x7fffffff; + paint->ext_max_y = -0x7fffffff; +} + +/** + * hb_gpu_paint_reset: + * @paint: a GPU color-glyph paint encoder + * + * Resets @paint, discarding accumulated state and user + * configuration. + * + * Since: 14.2.0 + **/ +void +hb_gpu_paint_reset (hb_gpu_paint_t *paint) +{ + paint->x_scale = 0; + paint->y_scale = 0; + paint->palette = 0; + hb_map_destroy (paint->custom_palette); + paint->custom_palette = nullptr; + hb_gpu_paint_clear (paint); +} + +/** + * hb_gpu_paint_recycle_blob: + * @paint: a GPU color-glyph paint encoder + * @blob: (transfer full): a blob previously returned by hb_gpu_paint_encode() + * + * Returns a blob to the encoder for potential reuse. The caller + * transfers ownership of @blob. + * + * If @blob came from hb_gpu_paint_encode() its underlying buffer + * will be reused by the next call to hb_gpu_paint_encode(), + * avoiding a malloc / blob allocation per glyph. + * + * Since: 14.2.0 + **/ +void +hb_gpu_paint_recycle_blob (hb_gpu_paint_t *paint, + hb_blob_t *blob) +{ + hb_blob_t::recycle_stash (&paint->recycled_blob, blob); +} + + +#include "hb-gpu-paint-fragment-glsl.hh" +#include "hb-gpu-paint-fragment-msl.hh" +#include "hb-gpu-paint-fragment-wgsl.hh" +#include "hb-gpu-paint-fragment-hlsl.hh" + +/** + * hb_gpu_paint_shader_source: + * @stage: pipeline stage (vertex or fragment) + * @lang: shader language variant + * + * Returns the paint-renderer-specific shader source for the + * specified stage and language. The returned string is static + * and must not be freed. + * + * This source assumes both the shared helpers + * (hb_gpu_shader_source()) and the draw-renderer helpers + * (hb_gpu_draw_shader_source()) are concatenated ahead of it -- + * the paint interpreter invokes hb_gpu_draw() to compute + * clip-glyph coverage. Full assembly: + * + * [#version] + hb_gpu_shader_source () + * + hb_gpu_draw_shader_source () + * + hb_gpu_paint_shader_source () + * + caller's main () + * + * Only GLSL fragment is implemented today; other languages and + * the vertex stage return the empty string so callers can + * concatenate unconditionally. + * + * Return value: (transfer none): + * A shader source string, or `NULL` if @stage or @lang is + * unsupported. + * + * Since: 14.2.0 + **/ +const char * +hb_gpu_paint_shader_source (hb_gpu_shader_stage_t stage, + hb_gpu_shader_lang_t lang) +{ + switch (stage) { + case HB_GPU_SHADER_STAGE_FRAGMENT: + switch (lang) { + case HB_GPU_SHADER_LANG_GLSL: return hb_gpu_paint_fragment_glsl; + case HB_GPU_SHADER_LANG_MSL: return hb_gpu_paint_fragment_msl; + case HB_GPU_SHADER_LANG_WGSL: return hb_gpu_paint_fragment_wgsl; + case HB_GPU_SHADER_LANG_HLSL: return hb_gpu_paint_fragment_hlsl; + case HB_GPU_SHADER_LANG_INVALID: + default: return nullptr; + } + case HB_GPU_SHADER_STAGE_VERTEX: + switch (lang) { + case HB_GPU_SHADER_LANG_GLSL: + case HB_GPU_SHADER_LANG_MSL: + case HB_GPU_SHADER_LANG_WGSL: + case HB_GPU_SHADER_LANG_HLSL: return ""; + case HB_GPU_SHADER_LANG_INVALID: + default: return nullptr; + } + default: + return nullptr; + } +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint.hh new file mode 100644 index 0000000000..84b405459e --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-paint.hh @@ -0,0 +1,339 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Author(s): Behdad Esfahbod + */ + +#ifndef HB_GPU_PAINT_HH +#define HB_GPU_PAINT_HH + +#include "hb.hh" +#include "hb-gpu.h" +#include "hb-geometry.hh" +#include "hb-map.hh" +#include "hb-object.hh" + + +/* + * hb_gpu_paint_t encoded-blob design + * ================================== + * + * One blob per glyph. One quad per glyph. The fragment shader + * is the interpreter: it walks a flat op stream per pixel, maintains + * a small group stack, and composites the result. + * + * The encoder turns a COLRv1 paint tree (visited via hb_paint_funcs_t + * callbacks) into a pre-order op stream plus embedded sub-payloads, + * all packed into a single RGBA16I blob suitable for + * hb_blob_t-style upload into the same shared atlas used by the + * draw renderer. + * + * --- Top-level layout -------------------------------------------- + * + * [header] + * [op stream] -- variable number of op records + * [sub-payloads] -- clip-glyph Slug draw blobs and + * gradient parameter blobs, referenced + * by intra-blob offsets from the ops + * + * Every offset in the blob is a texel index (RGBA16I, 8 bytes per + * texel) relative to the blob's base address. The caller uploads + * the blob at some atlas_base offset and adds that base to the + * glyph's vertex attribute; the fragment shader sees one absolute + * atlas offset per glyph and discovers everything else by walking + * inside. + * + * --- Header ------------------------------------------------------- + * + * texel 0: (num_ops:i16, reserved:i16, reserved:i16, reserved:i16) + * texel 1: (ext_min_x:i16, ext_min_y:i16, + * ext_max_x:i16, ext_max_y:i16) -- in HB_GPU units + * texel 2: (ops_offset:i16, reserved:i16, + * reserved:i16, reserved:i16) + * + * --- Op record ---------------------------------------------------- + * + * Each op is exactly one RGBA16I texel (4 int16s): + * + * (op_type:i16, op_aux:i16, payload_hi:i16, payload_lo:i16) + * + * op_type values: + * + * 0 LAYER_SOLID + * aux = flags (bit 0 = is_foreground) + * payload = clip_glyph_offset (texel index) + * followed by one extra texel: + * (r_q15:i16, g_q15:i16, b_q15:i16, a_q15:i16) + * flags bit 0: is_foreground -- use the shader's foreground + * uniform/varying instead of the baked color + * (so runtime foreground changes still work) + * + * 1 LAYER_GRADIENT + * aux = gradient subtype (0=linear, 1=radial, 2=sweep) + * payload = clip_glyph_offset (texel index) + * followed by one extra texel: + * (grad_offset_hi:i16, grad_offset_lo:i16, + * reserved:i16, reserved:i16) + * + * 2 PUSH_GROUP + * aux = 0 + * payload = 0 + * + * 3 POP_GROUP + * aux = composite mode, enumerated 0..27 matching + * hb_paint_composite_mode_t + * payload = 0 + * + * The fragment shader reads the first texel, inspects op_type, + * and knows from the type whether a trailing texel follows. Ops + * are therefore mixed-size but self-delimiting. + * + * --- Sub-payload: clip-glyph Slug draw blob ---------------------- + * + * Exactly the format produced by hb_gpu_draw_encode(). Referenced + * by LAYER_SOLID and LAYER_GRADIENT. + * + * The outline fed into the draw encoder has the enclosing paint + * transform baked in at CPU encode time. v1 does not dedup + * outlines that differ only by translation; v2 may keep the outline + * in canonical pre-translate space and store a per-op (dx, dy) + * offset in the aux/payload slots. + * + * --- Sub-payload: gradient parameter blob ------------------------ + * + * texels 0..2 : inverse affine transform, 6 components as + * q15.16 fixed point (two int16 per component, + * int part then fraction) + * texel 3 : (grad_subtype:i16, extend_mode:i16, + * reserved:i16, reserved:i16) + * texels 4..N : subtype-specific params + * linear: (x0, y0, px, py) -- two texels + * where p is the foot of perpendicular + * from p2 onto the p0..p1 line + * radial: (x0, y0, x1, y1), (r0, r1, _, _) + * sweep: (x0, y0, start_q14, end_q14) + * angles in q14 fractions of pi + * texels ... : color stops, each one texel: + * (offset_q8<<1 | last_stop_bit, + * palette_index:i16, + * flags:i16, + * alpha_q15:i16) + * flags / alpha_q15 semantics match LAYER_SOLID. + * The last stop is marked by the LSB of + * offset_q8 being 1 (offsets quantized to q8 so + * the bit is free for the marker). + * + * --- Shader entry point ----------------------------------------- + * + * vec4 hb_gpu_paint (vec2 renderCoord, uint glyphLoc, + * vec4 foreground); + * + * Returns premultiplied RGBA. The caller passes foreground in + * explicitly; sourcing it from a uniform, a per-quad flat varying, + * or anywhere else is the caller's decision. + * + * Colors are baked into the blob at encode time (as signed Q15 + * RGBA in a single texel per layer). There is no runtime palette + * buffer to bind or size. Palette selection and per-run custom + * palette overrides are set on the encoder via + * hb_gpu_paint_set_palette() / hb_gpu_paint_set_custom_palette_color(); + * changing either invalidates previously encoded blobs and requires + * re-encoding. The is_foreground flag still routes through the + * shader's foreground parameter so a dark-mode toggle does not + * require re-encoding. + * + * --- Fragment-shader contract ------------------------------------ + * + * Per pixel: + * acc = vec4 (0) -- transparent + * stack = array + * sp = 0 + * + * for op in ops: + * LAYER_SOLID: + * cov = hb_gpu_draw (texcoord, clip_glyph_offset) + * col = is_foreground ? v_foreground : rgba_q15 / 32767 + * acc = src_over (col * cov, acc) + * LAYER_GRADIENT: + * cov = hb_gpu_draw (texcoord, clip_glyph_offset) + * col = sample_gradient (texcoord, grad_offset, subtype) + * acc = src_over (col * cov, acc) + * PUSH_GROUP: + * stack[sp++] = acc + * acc = vec4 (0) + * POP_GROUP: + * acc = composite (stack[--sp], acc, composite_mode) + * + * write acc to gl_FragColor + * + * HB_GPU_PAINT_GROUP_DEPTH is compile-time fixed at 4. Encoder + * validates nesting depth and fails encode if a paint tree exceeds + * it. Typical COLRv1 emoji nest 0..2 groups deep. + * + * --- Encoder state ---------------------------------------------- + * + * hb_gpu_paint_t accumulates, during hb_font_paint_glyph_or_fail: + * + * - transform stack (visited push/pop_transform) + * - current clip-glyph snapshot captured on push_clip_glyph: + * (font, codepoint, transform_at_push) + * consumed by the next color / gradient callback to emit a + * LAYER_SOLID or LAYER_GRADIENT op + * - flat op buffer + * - flat sub-payload buffer (bytes; offsets recorded as ops emit) + * - scratch hb_gpu_draw_t used to rasterize each clip-glyph + * outline under its baked transform + * - scratch int16 vector for gradient encoding + * - current group depth counter (for validation against + * HB_GPU_PAINT_GROUP_DEPTH) + * - recycled output blob + * + * To preserve palette indices across harfbuzz's paint pipeline + * (which resolves them to hb_color_t before the color / color-stop + * callbacks fire), the encoder registers a custom_palette_color + * callback that returns a sentinel hb_color_t with the palette + * index embedded. Downstream color / color-stop callbacks decode + * the sentinel to recover the index. Foreground colors are + * signalled independently by the is_foreground flag that harfbuzz + * supplies, so the sentinel never collides with a genuine + * foreground request. + * + * On hb_gpu_paint_encode: + * - emit header (num_ops, extents, ops_offset) + * - emit op stream + * - append accumulated sub-payload buffer + * - patch any ops that held byte offsets to convert to texel + * offsets + * - return blob + * + * --- Out of scope for v1 ---------------------------------------- + * + * - Clip-rectangle paints (push_clip_rectangle / pop_clip). + * COLRv1 allows them but they are rare; v1 emits nothing for + * them and the caller loses clipping precision. v2 adds a + * RECT_CLIP op with four fixed-point extents. + * - Paint images (hb_paint_funcs_set_image_func). Always + * returns unhandled. Images are better served by a separate + * bitmap path. + */ + +struct hb_gpu_paint_t +{ + hb_object_header_t header; + + /* Persistent configuration (survives hb_gpu_paint_clear). */ + unsigned palette = 0; + hb_map_t *custom_palette = nullptr; + + /* Current effective affine (stack is grown/shrunk by + * push_transform / pop_transform callbacks). */ + hb_transform_t cur_transform = {1, 0, 0, 1, 0, 0}; + hb_vector_t> transform_stack; + + /* Font scale (set by hb_gpu_paint_glyph()). */ + int x_scale = 0; + int y_scale = 0; + + /* Accumulator state (cleared by hb_gpu_paint_clear). */ + + /* Flat int16 op stream. Each op is a sequence of i16 words + * whose total length is determined by the op type (see the + * design notes at the top of this file). */ + hb_vector_t ops; + unsigned num_ops = 0; + + /* Clip-glyph Slug sub-blobs collected during paint walk. + * Referenced by sub_blob_index recorded inside ops; + * hb_gpu_paint_encode() concatenates them after the op stream and + * patches the recorded indices into texel offsets. */ + hb_vector_t sub_blobs; + + /* Nesting depth of push_group / pop_group. We bail (set + * `unsupported`) if it exceeds HB_GPU_PAINT_MAX_GROUP_DEPTH, + * which matches HB_GPU_PAINT_GROUP_DEPTH in the fragment shader. */ + unsigned group_depth = 0; + + /* Stack of pending clips. Each color/gradient op consumes the + * current state of this stack: the layer is rendered where ALL + * stacked clips are opaque (intersection). Capped at depth + * HB_GPU_PAINT_MAX_CLIP_DEPTH; deeper pushes set `unsupported`. + * The transform is the one current at push_clip_glyph time -- + * the clip outline is defined in that coord space, a subsequent + * gradient params callback may run under deeper transforms which + * we use for the gradient but not the clip outline. */ + struct pending_clip_t + { + hb_codepoint_t glyph; /* HB_CODEPOINT_INVALID for path clips */ + hb_font_t *font; /* borrowed; nullptr for path clips */ + hb_transform_t transform; + /* Path clips are encoded into a sub-blob at push_clip_path_end + * time; glyph clips re-encode per consuming layer. For path + * clips, sub_blob_index is the pre-baked index and ext_* the + * captured design-unit extents. For glyph clips, sub_blob_index + * is -1 and the ext_* fields are unused. */ + int sub_blob_index; + int ext_x0, ext_y0, ext_x1, ext_y1; + }; + pending_clip_t clip_stack[3]; + unsigned clip_depth = 0; + + /* Carries the cur_transform captured at push_clip_path_start + * through to push_clip_path_end, where the encoded clip is + * committed to clip_stack. */ + hb_transform_t pending_clip_path_transform = {}; + bool pending_clip_path = false; + + /* Set when the paint walk emits v1-only callbacks we do not yet + * support. hb_gpu_paint_encode() returns NULL in that case. */ + bool unsupported = false; + + /* Extents in font design units, accumulated across layers. */ + int ext_min_x = 0x7fffffff; + int ext_min_y = 0x7fffffff; + int ext_max_x = -0x7fffffff; + int ext_max_y = -0x7fffffff; + + /* Scratch: used to rasterize each clip-glyph outline. */ + hb_gpu_draw_t *scratch_draw = nullptr; + + /* Scratch: color stops fetched per gradient callback. */ + hb_vector_t color_stops_scratch; + + /* Recycled output blob. */ + hb_blob_t *recycled_blob = nullptr; + + bool fetch_color_stops (hb_color_line_t *color_line) + { + unsigned count = hb_color_line_get_color_stops (color_line, 0, nullptr, nullptr); + if (unlikely (!count || !color_stops_scratch.resize (count))) + { + color_stops_scratch.resize (0); + return false; + } + hb_color_line_get_color_stops (color_line, 0, &count, color_stops_scratch.arrayZ); + return true; + } +}; + + +#endif /* HB_GPU_PAINT_HH */ diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex-glsl.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex-glsl.hh new file mode 100644 index 0000000000..85be07b668 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex-glsl.hh @@ -0,0 +1,72 @@ +static const char *hb_gpu_vertex_glsl = +"/*\n" +" * Copyright (C) 2026 Behdad Esfahbod\n" +" *\n" +" * This is part of HarfBuzz, a text shaping library.\n" +" *\n" +" * Permission is hereby granted, without written agreement and without\n" +" * license or royalty fees, to use, copy, modify, and distribute this\n" +" * software and its documentation for any purpose, provided that the\n" +" * above copyright notice and the following two paragraphs appear in\n" +" * all copies of this software.\n" +" *\n" +" * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\n" +" * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\n" +" * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\n" +" * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n" +" * DAMAGE.\n" +" *\n" +" * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\n" +" * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n" +" * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n" +" * ON AN \"AS IS\" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\n" +" * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n" +" */\n" +"\n" +"\n" +"/* Requires GLSL 3.30 or GLSL ES 3.00. */\n" +"\n" +"\n" +"/* Dilate a glyph vertex by half a pixel on screen.\n" +" *\n" +" * position: object-space vertex position (modified in place)\n" +" * texcoord: em-space sample coordinates (modified in place)\n" +" * normal: object-space outward normal at this vertex\n" +" * jac: inverse of the 2x2 linear part of the em-to-object transform,\n" +" * stored row-major as (j00, j01, j10, j11). Maps object-space\n" +" * displacements back to em-space for texcoord adjustment.\n" +" * For simple scaling with y-flip (the common case):\n" +" * em-to-object = [[s, 0], [0, -s]]\n" +" * jac = (1/s, 0, 0, -1/s)\n" +" * m: model-view-projection matrix\n" +" * viewport: viewport size in pixels\n" +" */\n" +"void hb_gpu_dilate (inout vec2 position, inout vec2 texcoord,\n" +" vec2 normal, vec4 jac,\n" +" mat4 m, vec2 viewport)\n" +"{\n" +" vec2 n = normalize (normal);\n" +"\n" +" vec4 clipPos = m * vec4 (position, 0.0, 1.0);\n" +" vec4 clipN = m * vec4 (n, 0.0, 0.0);\n" +"\n" +" float s = clipPos.w;\n" +" float t = clipN.w;\n" +"\n" +" float u = (s * clipN.x - t * clipPos.x) * viewport.x;\n" +" float v = (s * clipN.y - t * clipPos.y) * viewport.y;\n" +"\n" +" float s2 = s * s;\n" +" float st = s * t;\n" +" float uv = u * u + v * v;\n" +"\n" +" float denom = uv - st * st;\n" +" float d = abs (denom) > 1.0 / 16777216.0\n" +" ? s2 * (st + sqrt (uv)) / denom\n" +" : 0.0;\n" +"\n" +" vec2 dPos = d * normal;\n" +" position += dPos;\n" +" texcoord += vec2 (dot (dPos, jac.xy), dot (dPos, jac.zw));\n" +"}\n" +; diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex-hlsl.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex-hlsl.hh new file mode 100644 index 0000000000..7ba297aebe --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex-hlsl.hh @@ -0,0 +1,67 @@ +static const char *hb_gpu_vertex_hlsl = +"/*\n" +" * Copyright (C) 2026 Behdad Esfahbod\n" +" *\n" +" * This is part of HarfBuzz, a text shaping library.\n" +" *\n" +" * Permission is hereby granted, without written agreement and without\n" +" * license or royalty fees, to use, copy, modify, and distribute this\n" +" * software and its documentation for any purpose, provided that the\n" +" * above copyright notice and the following two paragraphs appear in\n" +" * all copies of this software.\n" +" *\n" +" * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\n" +" * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\n" +" * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\n" +" * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n" +" * DAMAGE.\n" +" *\n" +" * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\n" +" * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n" +" * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n" +" * ON AN \"AS IS\" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\n" +" * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n" +" */\n" +"\n" +"\n" +"/* Requires Shader Model 5.0+. */\n" +"\n" +"\n" +"/* Dilate a glyph vertex by half a pixel on screen.\n" +" *\n" +" * position: object-space vertex position (modified in place)\n" +" * texcoord: em-space sample coordinates (modified in place)\n" +" * normal: object-space outward normal at this vertex\n" +" * jac: inverse of the 2x2 linear part of the em-to-object transform\n" +" * m: model-view-projection matrix\n" +" * viewport: viewport size in pixels\n" +" */\n" +"void hb_gpu_dilate (inout float2 position, inout float2 texcoord,\n" +" float2 normal, float4 jac,\n" +" float4x4 m, float2 viewport)\n" +"{\n" +" float2 n = normalize (normal);\n" +"\n" +" float4 clipPos = mul (m, float4 (position, 0.0, 1.0));\n" +" float4 clipN = mul (m, float4 (n, 0.0, 0.0));\n" +"\n" +" float s = clipPos.w;\n" +" float t = clipN.w;\n" +"\n" +" float u = (s * clipN.x - t * clipPos.x) * viewport.x;\n" +" float v = (s * clipN.y - t * clipPos.y) * viewport.y;\n" +"\n" +" float s2 = s * s;\n" +" float st = s * t;\n" +" float uv = u * u + v * v;\n" +"\n" +" float denom = uv - st * st;\n" +" float d = abs (denom) > 1.0 / 16777216.0\n" +" ? s2 * (st + sqrt (uv)) / denom\n" +" : 0.0;\n" +"\n" +" float2 dPos = d * normal;\n" +" position += dPos;\n" +" texcoord += float2 (dot (dPos, jac.xy), dot (dPos, jac.zw));\n" +"}\n" +; diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex-msl.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex-msl.hh new file mode 100644 index 0000000000..3d662992ba --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex-msl.hh @@ -0,0 +1,72 @@ +static const char *hb_gpu_vertex_msl = +"/*\n" +" * Copyright (C) 2026 Behdad Esfahbod\n" +" *\n" +" * This is part of HarfBuzz, a text shaping library.\n" +" *\n" +" * Permission is hereby granted, without written agreement and without\n" +" * license or royalty fees, to use, copy, modify, and distribute this\n" +" * software and its documentation for any purpose, provided that the\n" +" * above copyright notice and the following two paragraphs appear in\n" +" * all copies of this software.\n" +" *\n" +" * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\n" +" * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\n" +" * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\n" +" * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n" +" * DAMAGE.\n" +" *\n" +" * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\n" +" * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n" +" * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n" +" * ON AN \"AS IS\" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\n" +" * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n" +" */\n" +"\n" +"\n" +"/* Requires Metal Shading Language 2.0. */\n" +"\n" +"\n" +"/* Dilate a glyph vertex by half a pixel on screen.\n" +" *\n" +" * position: object-space vertex position (modified in place)\n" +" * texcoord: em-space sample coordinates (modified in place)\n" +" * normal: object-space outward normal at this vertex\n" +" * jac: inverse of the 2x2 linear part of the em-to-object transform,\n" +" * stored row-major as (j00, j01, j10, j11). Maps object-space\n" +" * displacements back to em-space for texcoord adjustment.\n" +" * For simple scaling with y-flip (the common case):\n" +" * em-to-object = [[s, 0], [0, -s]]\n" +" * jac = (1/s, 0, 0, -1/s)\n" +" * m: model-view-projection matrix\n" +" * viewport: viewport size in pixels\n" +" */\n" +"void hb_gpu_dilate (thread float2& position, thread float2& texcoord,\n" +" float2 normal, float4 jac,\n" +" float4x4 m, float2 viewport)\n" +"{\n" +" float2 n = normalize (normal);\n" +"\n" +" float4 clipPos = m * float4 (position, 0.0, 1.0);\n" +" float4 clipN = m * float4 (n, 0.0, 0.0);\n" +"\n" +" float s = clipPos.w;\n" +" float t = clipN.w;\n" +"\n" +" float u = (s * clipN.x - t * clipPos.x) * viewport.x;\n" +" float v = (s * clipN.y - t * clipPos.y) * viewport.y;\n" +"\n" +" float s2 = s * s;\n" +" float st = s * t;\n" +" float uv = u * u + v * v;\n" +"\n" +" float denom = uv - st * st;\n" +" float d = abs (denom) > 1.0 / 16777216.0\n" +" ? s2 * (st + sqrt (uv)) / denom\n" +" : 0.0;\n" +"\n" +" float2 dPos = d * normal;\n" +" position += dPos;\n" +" texcoord += float2 (dot (dPos, jac.xy), dot (dPos, jac.zw));\n" +"}\n" +; diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex-wgsl.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex-wgsl.hh new file mode 100644 index 0000000000..c10a3a405f --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex-wgsl.hh @@ -0,0 +1,79 @@ +static const char *hb_gpu_vertex_wgsl = +"/*\n" +" * Copyright (C) 2026 Behdad Esfahbod\n" +" *\n" +" * This is part of HarfBuzz, a text shaping library.\n" +" *\n" +" * Permission is hereby granted, without written agreement and without\n" +" * license or royalty fees, to use, copy, modify, and distribute this\n" +" * software and its documentation for any purpose, provided that the\n" +" * above copyright notice and the following two paragraphs appear in\n" +" * all copies of this software.\n" +" *\n" +" * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\n" +" * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\n" +" * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\n" +" * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n" +" * DAMAGE.\n" +" *\n" +" * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\n" +" * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n" +" * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n" +" * ON AN \"AS IS\" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\n" +" * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n" +" */\n" +"\n" +"\n" +"/* Requires WGSL (WebGPU Shading Language). */\n" +"\n" +"\n" +"/* Dilate a glyph vertex by half a pixel on screen.\n" +" *\n" +" * position: object-space vertex position (modified in place)\n" +" * texcoord: em-space sample coordinates (modified in place)\n" +" * normal: object-space outward normal at this vertex\n" +" * jac: inverse of the 2x2 linear part of the em-to-object transform,\n" +" * stored row-major as (j00, j01, j10, j11). Maps object-space\n" +" * displacements back to em-space for texcoord adjustment.\n" +" * For simple scaling with y-flip (the common case):\n" +" * em-to-object = [[s, 0], [0, -s]]\n" +" * jac = (1/s, 0, 0, -1/s)\n" +" * m: model-view-projection matrix\n" +" * viewport: viewport size in pixels\n" +" *\n" +" * Returns (new_position, new_texcoord).\n" +" */\n" +"fn hb_gpu_dilate (position: vec2f, texcoord: vec2f,\n" +" normal: vec2f, jac: vec4f,\n" +" m: mat4x4f, viewport: vec2f) -> array\n" +"{\n" +" let n = normalize (normal);\n" +"\n" +" let clipPos = m * vec4f (position, 0.0, 1.0);\n" +" let clipN = m * vec4f (n, 0.0, 0.0);\n" +"\n" +" let s = clipPos.w;\n" +" let t = clipN.w;\n" +"\n" +" let u = (s * clipN.x - t * clipPos.x) * viewport.x;\n" +" let v = (s * clipN.y - t * clipPos.y) * viewport.y;\n" +"\n" +" let s2 = s * s;\n" +" let st = s * t;\n" +" let uv = u * u + v * v;\n" +"\n" +" let denom = uv - st * st;\n" +" var d: f32;\n" +" if (abs (denom) > 1.0 / 16777216.0) {\n" +" d = s2 * (st + sqrt (uv)) / denom;\n" +" } else {\n" +" d = 0.0;\n" +" }\n" +"\n" +" let dPos = d * normal;\n" +" return array (\n" +" position + dPos,\n" +" texcoord + vec2f (dot (dPos, jac.xy), dot (dPos, jac.zw))\n" +" );\n" +"}\n" +; diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex.glsl b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex.glsl new file mode 100644 index 0000000000..fd746599ad --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex.glsl @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + + +/* Requires GLSL 3.30 or GLSL ES 3.00. */ + + +/* Dilate a glyph vertex by half a pixel on screen. + * + * position: object-space vertex position (modified in place) + * texcoord: em-space sample coordinates (modified in place) + * normal: object-space outward normal at this vertex + * jac: inverse of the 2x2 linear part of the em-to-object transform, + * stored row-major as (j00, j01, j10, j11). Maps object-space + * displacements back to em-space for texcoord adjustment. + * For simple scaling with y-flip (the common case): + * em-to-object = [[s, 0], [0, -s]] + * jac = (1/s, 0, 0, -1/s) + * m: model-view-projection matrix + * viewport: viewport size in pixels + */ +void hb_gpu_dilate (inout vec2 position, inout vec2 texcoord, + vec2 normal, vec4 jac, + mat4 m, vec2 viewport) +{ + vec2 n = normalize (normal); + + vec4 clipPos = m * vec4 (position, 0.0, 1.0); + vec4 clipN = m * vec4 (n, 0.0, 0.0); + + float s = clipPos.w; + float t = clipN.w; + + float u = (s * clipN.x - t * clipPos.x) * viewport.x; + float v = (s * clipN.y - t * clipPos.y) * viewport.y; + + float s2 = s * s; + float st = s * t; + float uv = u * u + v * v; + + float denom = uv - st * st; + float d = abs (denom) > 1.0 / 16777216.0 + ? s2 * (st + sqrt (uv)) / denom + : 0.0; + + vec2 dPos = d * normal; + position += dPos; + texcoord += vec2 (dot (dPos, jac.xy), dot (dPos, jac.zw)); +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex.hlsl b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex.hlsl new file mode 100644 index 0000000000..c15d44437a --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex.hlsl @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + + +/* Requires Shader Model 5.0+. */ + + +/* Dilate a glyph vertex by half a pixel on screen. + * + * position: object-space vertex position (modified in place) + * texcoord: em-space sample coordinates (modified in place) + * normal: object-space outward normal at this vertex + * jac: inverse of the 2x2 linear part of the em-to-object transform + * m: model-view-projection matrix + * viewport: viewport size in pixels + */ +void hb_gpu_dilate (inout float2 position, inout float2 texcoord, + float2 normal, float4 jac, + float4x4 m, float2 viewport) +{ + float2 n = normalize (normal); + + float4 clipPos = mul (m, float4 (position, 0.0, 1.0)); + float4 clipN = mul (m, float4 (n, 0.0, 0.0)); + + float s = clipPos.w; + float t = clipN.w; + + float u = (s * clipN.x - t * clipPos.x) * viewport.x; + float v = (s * clipN.y - t * clipPos.y) * viewport.y; + + float s2 = s * s; + float st = s * t; + float uv = u * u + v * v; + + float denom = uv - st * st; + float d = abs (denom) > 1.0 / 16777216.0 + ? s2 * (st + sqrt (uv)) / denom + : 0.0; + + float2 dPos = d * normal; + position += dPos; + texcoord += float2 (dot (dPos, jac.xy), dot (dPos, jac.zw)); +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex.msl b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex.msl new file mode 100644 index 0000000000..8f5c44c7f7 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex.msl @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + + +/* Requires Metal Shading Language 2.0. */ + + +/* Dilate a glyph vertex by half a pixel on screen. + * + * position: object-space vertex position (modified in place) + * texcoord: em-space sample coordinates (modified in place) + * normal: object-space outward normal at this vertex + * jac: inverse of the 2x2 linear part of the em-to-object transform, + * stored row-major as (j00, j01, j10, j11). Maps object-space + * displacements back to em-space for texcoord adjustment. + * For simple scaling with y-flip (the common case): + * em-to-object = [[s, 0], [0, -s]] + * jac = (1/s, 0, 0, -1/s) + * m: model-view-projection matrix + * viewport: viewport size in pixels + */ +void hb_gpu_dilate (thread float2& position, thread float2& texcoord, + float2 normal, float4 jac, + float4x4 m, float2 viewport) +{ + float2 n = normalize (normal); + + float4 clipPos = m * float4 (position, 0.0, 1.0); + float4 clipN = m * float4 (n, 0.0, 0.0); + + float s = clipPos.w; + float t = clipN.w; + + float u = (s * clipN.x - t * clipPos.x) * viewport.x; + float v = (s * clipN.y - t * clipPos.y) * viewport.y; + + float s2 = s * s; + float st = s * t; + float uv = u * u + v * v; + + float denom = uv - st * st; + float d = abs (denom) > 1.0 / 16777216.0 + ? s2 * (st + sqrt (uv)) / denom + : 0.0; + + float2 dPos = d * normal; + position += dPos; + texcoord += float2 (dot (dPos, jac.xy), dot (dPos, jac.zw)); +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex.wgsl b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex.wgsl new file mode 100644 index 0000000000..419f73fc57 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu-vertex.wgsl @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + + +/* Requires WGSL (WebGPU Shading Language). */ + + +/* Dilate a glyph vertex by half a pixel on screen. + * + * position: object-space vertex position (modified in place) + * texcoord: em-space sample coordinates (modified in place) + * normal: object-space outward normal at this vertex + * jac: inverse of the 2x2 linear part of the em-to-object transform, + * stored row-major as (j00, j01, j10, j11). Maps object-space + * displacements back to em-space for texcoord adjustment. + * For simple scaling with y-flip (the common case): + * em-to-object = [[s, 0], [0, -s]] + * jac = (1/s, 0, 0, -1/s) + * m: model-view-projection matrix + * viewport: viewport size in pixels + * + * Returns (new_position, new_texcoord). + */ +fn hb_gpu_dilate (position: vec2f, texcoord: vec2f, + normal: vec2f, jac: vec4f, + m: mat4x4f, viewport: vec2f) -> array +{ + let n = normalize (normal); + + let clipPos = m * vec4f (position, 0.0, 1.0); + let clipN = m * vec4f (n, 0.0, 0.0); + + let s = clipPos.w; + let t = clipN.w; + + let u = (s * clipN.x - t * clipPos.x) * viewport.x; + let v = (s * clipN.y - t * clipPos.y) * viewport.y; + + let s2 = s * s; + let st = s * t; + let uv = u * u + v * v; + + let denom = uv - st * st; + var d: f32; + if (abs (denom) > 1.0 / 16777216.0) { + d = s2 * (st + sqrt (uv)) / denom; + } else { + d = 0.0; + } + + let dPos = d * normal; + return array ( + position + dPos, + texcoord + vec2f (dot (dPos, jac.xy), dot (dPos, jac.zw)) + ); +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu.cc b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu.cc new file mode 100644 index 0000000000..ee98cb686c --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu.cc @@ -0,0 +1,583 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Author(s): Behdad Esfahbod + */ + +#include "hb.hh" + +#include "hb-gpu.h" +#include "hb-blob.hh" + +/** + * SECTION:hb-gpu + * @title: hb-gpu + * @short_description: GPU text rendering + * @include: hb-gpu.h + * + * This module provides GPU-side text rendering. Glyph data is + * encoded on the CPU into compact blobs that the GPU decodes and + * rasterizes directly in the fragment shader, with no intermediate + * bitmap atlas. + * + * Two renderers share the same atlas, vertex stage, and pipeline: + * + * - Draw, an antialiased monochrome coverage mask for outline + * glyphs. + * - Paint, a premultiplied-RGBA color accumulator for COLRv0 and + * COLRv1 glyphs. Paint also renders plain monochrome outlines + * (as a single foreground-colored layer), at some cost over the + * Draw path. + * + * Applications typically pick one renderer per font, based on + * whether the font has a color paint table (see + * hb_ot_color_has_paint()). The Draw path is meaningfully faster + * than Paint on monochrome fonts, so using Paint unconditionally + * leaves performance on the table. + * + * See the [live web demo](https://harfbuzz.github.io/hb-gpu-demo/). + * + * # Draw + * + * The draw renderer implements the + * [Slug](https://github.com/EricLengyel/Slug) algorithm by Eric + * Lengyel. It produces an antialiased coverage mask in the + * fragment shader, suitable for compositing over any background + * or multiplying with any foreground color. + * + * ## Encoding + * + * Each glyph is encoded independently into an opaque blob of + * RGBA16I texels (8 bytes each). Typical encoding flow: + * + * |[ + * hb_gpu_draw_t *draw = hb_gpu_draw_create_or_fail (); + * + * hb_gpu_draw_glyph (draw, font, gid); + * hb_blob_t *blob = hb_gpu_draw_encode (draw); + * + * // Upload hb_blob_get_data(blob) to the atlas at some offset. + * unsigned atlas_offset = upload_to_atlas (blob); + * + * hb_gpu_draw_recycle_blob (draw, blob); + * // repeat for more glyphs... + * + * hb_gpu_draw_destroy (draw); + * ]| + * + * Create the encoder once and reuse it across glyphs. + * hb_gpu_draw_encode() auto-clears the accumulated outlines on + * return, so the next call to hb_gpu_draw_glyph() starts fresh; + * user configuration (font scale) is preserved. Pass the + * encoded blob back via hb_gpu_draw_recycle_blob() after upload + * to recycle the buffer across encodes. + * + * ## Atlas setup + * + * All encoded blobs are uploaded into a single GL_TEXTURE_BUFFER + * backed by a GL_RGBA16I format buffer. Each glyph occupies a + * contiguous range of texels at a known offset: + * + * |[ + * GLuint buf, tex; + * glGenBuffers (1, &buf); + * glGenTextures (1, &tex); + * + * glBindBuffer (GL_TEXTURE_BUFFER, buf); + * glBufferData (GL_TEXTURE_BUFFER, capacity * 8, NULL, GL_STATIC_DRAW); + * + * glBindTexture (GL_TEXTURE_BUFFER, tex); + * glTexBuffer (GL_TEXTURE_BUFFER, GL_RGBA16I, buf); + * + * // Upload a glyph blob at 'offset' texels: + * glBufferSubData (GL_TEXTURE_BUFFER, + * offset * 8, + * hb_blob_get_length (blob), + * hb_blob_get_data (blob, NULL)); + * ]| + * + * ## Shader compilation + * + * The library provides GLSL source strings for shared helpers + * (atlas access, vertex dilation) and for the draw-renderer stage + * code. Prepend a #version directive, concatenate shared and + * draw sources in order, and append your own main(): + * + * |[ + * const char *vert_sources[] = { + * "#version 330\n", + * hb_gpu_shader_source (HB_GPU_SHADER_STAGE_VERTEX, + * HB_GPU_SHADER_LANG_GLSL), + * hb_gpu_draw_shader_source (HB_GPU_SHADER_STAGE_VERTEX, + * HB_GPU_SHADER_LANG_GLSL), + * your_vertex_main + * }; + * glShaderSource (vert_shader, 4, vert_sources, NULL); + * // Same pattern for the fragment shader. + * ]| + * + * hb_gpu_draw_shader_source() returns an empty string for the + * vertex stage, so the assembly order above is safe. + * + * ## Vertex shader + * + * The vertex library provides one function: + * + * |[ + * void hb_gpu_dilate (inout vec2 position, inout vec2 texcoord, + * vec2 normal, vec4 jac, + * mat4 m, vec2 viewport); + * ]| + * + * This expands each glyph quad by approximately half a pixel on + * screen to ensure proper antialiasing coverage at the edges. + * It must be called in the vertex shader before computing + * gl_Position. + * + * Per-vertex attributes for each glyph quad (2 triangles, 6 + * vertices, 4 unique corners): + * + * - position (vec2): object-space vertex position, computed from + * the glyph's bounding box. For corner (cx, cy) where cx,cy + * are 0 or 1: + * |[ + * pos.x = pen_x + scale * lerp(extent_min_x, extent_max_x, cx) + * pos.y = pen_y - scale * lerp(extent_min_y, extent_max_y, cy) + * ]| + * where scale = font_size / upem. + * + * - texcoord (vec2): em-space texture coordinates, equal to the + * raw extent values: `(ex, ey)` where ex/ey are the glyph's + * bounding box corners in font design units. The fragment shader + * samples the encoded blob in this coordinate space. + * + * - normal (vec2): outward normal at each corner. + * `(-1, +1)` for (0,0), `(+1, +1)` for (1,0), + * `(-1, -1)` for (0,1), `(+1, -1)` for (1,1). + * Note: y is negated relative to cx,cy because the common + * em-to-object transform flips y. + * + * - jac (vec4): maps object-space displacements back to + * em-space after dilation, stored row-major as + * (j00, j01, j10, j11). For the common case of uniform + * scaling with y-flip: + * |[ + * jac = vec4(emPerPos, 0.0, 0.0, -emPerPos) + * ]| + * where emPerPos = upem / font_size. For non-trivial + * transforms, see the hb_gpu_dilate source. + * + * - m (mat4): the model-view-projection matrix (uniform). + * + * - viewport (vec2): the viewport size in pixels (uniform). + * + * A typical vertex main: + * + * |[ + * uniform mat4 u_matViewProjection; + * uniform vec2 u_viewport; + * + * in vec2 a_position; + * in vec2 a_texcoord; + * in vec2 a_normal; + * in float a_emPerPos; + * in uint a_glyphLoc; + * + * out vec2 v_texcoord; + * flat out uint v_glyphLoc; + * + * void main () { + * vec2 pos = a_position; + * vec2 tex = a_texcoord; + * vec4 jac = vec4 (a_emPerPos, 0.0, 0.0, -a_emPerPos); + * hb_gpu_dilate (pos, tex, a_normal, jac, + * u_matViewProjection, u_viewport); + * gl_Position = u_matViewProjection * vec4 (pos, 0.0, 1.0); + * v_texcoord = tex; + * v_glyphLoc = a_glyphLoc; + * } + * ]| + * + * ## Font scale + * + * The encoder works in font design units (upem). For best + * results, do not set a scale on the #hb_font_t passed to + * hb_gpu_draw_glyph() — leave it at the default (upem). + * Scaling is applied later when computing vertex positions: + * + * |[ + * float scale = font_size / upem; + * pos.x = pen_x + scale * extent_x; + * pos.y = pen_y - scale * extent_y; + * ]| + * + * If you do set a font scale (e.g. for hinting), the encoded + * blob and extents will be in the scaled coordinate space, + * and you must adjust emPerPos accordingly. + * + * ## Dilation + * + * Each glyph is rendered on a screen-aligned quad whose + * corners match the glyph's bounding box. Without dilation, + * the antialiased edges at the quad boundary get clipped — the + * fragment shader needs at least half a pixel of padding + * around the glyph to produce smooth coverage gradients. + * + * hb_gpu_dilate computes a perspective-correct half-pixel + * expansion. It adjusts both the vertex position (expanding + * the quad) and the texcoord (so the fragment shader samples + * the right location in em-space after expansion). + * + * The `jac` parameter maps object-space displacements back to + * em-space. For the common case of uniform scaling with + * y-flip (`pos.y = pen_y - scale * ey`): + * + * |[ + * float emPerPos = upem / font_size; + * jac = vec4(emPerPos, 0.0, 0.0, -emPerPos); + * ]| + * + * For non-uniform scaling or shearing transforms, jac is the + * 2x2 inverse of the em-to-object linear transform, stored + * row-major. + * + * ### Static dilation alternative + * + * Applications that do not need perspective correctness (e.g. + * strictly 2D rendering at known sizes) can skip hb_gpu_dilate + * and instead expand each quad vertex by a fixed amount along + * its normal, based on the minimum expected font size: + * + * |[ + * float min_ppem = 10.0; // smallest expected size in pixels + * float pad = 0.5 * upem / min_ppem; // half-pixel in em units + * pos += normal * pad * scale; + * texcoord += normal * pad; + * ]| + * + * This over-dilates at larger sizes (wasting fill rate on + * transparent pixels) but is simpler to implement and avoids + * the need for the MVP matrix and viewport size in the vertex + * shader. + * + * ## Fragment shader + * + * The fragment library provides two functions: + * + * |[ + * float hb_gpu_draw (vec2 renderCoord, uint glyphLoc); + * ]| + * + * It requires the `hb_gpu_atlas` uniform to be bound to the + * texture containing the encoded glyph data. By default this + * is an `isamplerBuffer` (GL_TEXTURE_BUFFER). For platforms + * without texture buffers (e.g. WebGL2), define + * `HB_GPU_ATLAS_2D` before including the shader source; the + * atlas then becomes an `isampler2D` and a + * `uniform int hb_gpu_atlas_width` must also be set to the + * texture width. + * + * Parameters: + * + * - renderCoord: the interpolated em-space coordinate from + * the vertex shader (v_texcoord). + * + * - glyphLoc: the texel offset of this glyph's encoded blob + * in the atlas buffer. Passed as a flat varying from the + * vertex shader. + * + * Returns the coverage in [0, 1]: 1.0 inside the glyph, 0.0 + * outside, with antialiased edges. + * + * A typical fragment main: + * + * |[ + * in vec2 v_texcoord; + * flat in uint v_glyphLoc; + * out vec4 fragColor; + * + * void main () { + * float coverage = hb_gpu_draw (v_texcoord, v_glyphLoc); + * fragColor = vec4 (0.0, 0.0, 0.0, coverage); + * } + * ]| + * + * The coverage value can be used with alpha blending + * (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) to composite + * over a background, or multiplied with any color. + * + * ## Stem darkening + * + * |[ + * float hb_gpu_stem_darken (float coverage, float brightness, float ppem); + * ]| + * + * Optional stem darkening adjusts coverage at small sizes so + * thin stems are not washed out by gamma correction. + * + * Parameters: + * + * - coverage: a coverage / alpha value in [0, 1]. For + * hb_gpu_draw() this is the returned coverage; for + * hb_gpu_paint() use the edge coverage out parameter. + * + * - brightness: brightness of the color that will end up on + * screen for this fragment, in [0, 1], computed as + * `dot (straight_color.rgb, vec3 (1.0 / 3.0))`. + * + * - ppem: pixels per em at this fragment, computed as + * `1.0 / max (fwidth (v_texcoord).x, fwidth (v_texcoord).y)`. + * + * Example — draw path: + * + * |[ + * float coverage = hb_gpu_draw (v_texcoord, v_glyphLoc); + * float brightness = dot (u_foreground.rgb, vec3 (1.0 / 3.0)); + * float ppem = 1.0 / max (fwidth (v_texcoord).x, + * fwidth (v_texcoord).y); + * coverage = hb_gpu_stem_darken (coverage, brightness, ppem); + * ]| + * + * Example — paint path: hb_gpu_paint() returns a separate + * edge coverage value that tracks the maximum antialiasing + * coverage across paint layers. Apply stem darkening and gamma to this + * edge coverage, then scale the premultiplied color to match. + * Interior fragments (coverage == 1) are left untouched. + * + * |[ + * float cov; + * vec4 c = hb_gpu_paint (v_texcoord, v_glyphLoc, u_foreground, cov); + * if (cov > 0.0 && cov < 1.0) { + * float brightness = c.a > 0.0 + * ? dot (c.rgb, vec3 (1.0 / 3.0)) / c.a : 0.0; + * float ppem = 1.0 / max (fwidth (v_texcoord).x, + * fwidth (v_texcoord).y); + * float adj = hb_gpu_stem_darken (cov, brightness, ppem); + * c *= adj / cov; + * } + * ]| + * + * # Paint + * + * The paint renderer walks the font's paint tree (COLRv0 layers + * or COLRv1 paint subtree) and records one layer op per solid or + * gradient fill, each with its own clip outline encoded as a Slug + * (so the paint renderer reuses the draw renderer internally for + * clips). Palette colors and custom overrides are resolved and + * baked into the blob at encode time, so the shader does not need + * a separate palette uniform. + * + * Monochrome (non-color) glyphs are handled transparently: + * hb_gpu_paint_glyph() synthesizes a single foreground-colored + * layer from the glyph's outline, so callers can use the paint + * renderer uniformly for any font. This costs more per fragment + * than the Draw path, but the rendered result is the same. + * + * ## Encoding + * + * |[ + * hb_gpu_paint_t *paint = hb_gpu_paint_create_or_fail (); + * + * // Optional: select a palette and install any custom-palette + * // overrides before hb_gpu_paint_glyph — their values are baked + * // into the encoded blob. (The foreground color is NOT set here: + * // it stays a shader uniform so dark-mode and color-change + * // toggles take effect without re-encoding.) + * hb_gpu_paint_set_palette (paint, 0); + * hb_gpu_paint_set_custom_palette_color (paint, 2, + * HB_COLOR (0xff, 0, 0, 0xff)); + * + * hb_gpu_paint_glyph (paint, font, gid); + * hb_glyph_extents_t ext; + * hb_blob_t *blob = hb_gpu_paint_encode (paint, &ext); + * + * // Upload hb_blob_get_data(blob) to the same atlas used by draw. + * unsigned atlas_offset = upload_to_atlas (blob); + * + * hb_gpu_paint_recycle_blob (paint, blob); + * // repeat for more glyphs... + * + * hb_gpu_paint_destroy (paint); + * ]| + * + * As with the draw encoder, create the paint encoder once and + * reuse it. hb_gpu_paint_encode() auto-clears on return; user + * configuration (palette, custom-palette overrides) is preserved + * across encodes. Because colors are baked, changing any of that + * configuration afterwards requires re-encoding the affected + * glyphs. The encoded blob's texel format is the same RGBA16I + * as the draw renderer's, so both kinds of blobs can coexist in + * one atlas at different offsets. + * + * ## Shader composition + * + * Same pattern as the draw renderer but using + * hb_gpu_paint_shader_source() for the paint-specific helpers. + * The vertex stage is identical — hb_gpu_paint_shader_source() + * returns an empty string for HB_GPU_SHADER_STAGE_VERTEX, so the + * fixed assembly order still works: + * + * |[ + * const char *frag_sources[] = { + * "#version 330\n", + * hb_gpu_shader_source (HB_GPU_SHADER_STAGE_FRAGMENT, + * HB_GPU_SHADER_LANG_GLSL), + * hb_gpu_paint_shader_source (HB_GPU_SHADER_STAGE_FRAGMENT, + * HB_GPU_SHADER_LANG_GLSL), + * your_fragment_main + * }; + * glShaderSource (frag_shader, 4, frag_sources, NULL); + * ]| + * + * The atlas setup, vertex attributes, dilation, and font scaling + * guidance from the Draw section all apply unchanged. + * + * ## Fragment shader + * + * The paint library provides one function: + * + * |[ + * vec4 hb_gpu_paint (vec2 renderCoord, uint glyphLoc, vec4 foreground, + * out float coverage); + * ]| + * + * Parameters: + * + * - renderCoord: the interpolated em-space coordinate from the + * vertex shader (v_texcoord), as for hb_gpu_draw(). + * + * - glyphLoc: the texel offset of this glyph's encoded paint blob + * in the atlas, passed as a flat varying from the vertex shader. + * + * - foreground: the foreground color used to resolve palette + * entries that COLRv1 marks as "foreground color". The encoder + * only records the is-foreground flag per layer/stop; the actual + * color is substituted here at render time, so runtime + * foreground-color changes (e.g. a dark-mode toggle) take effect + * without re-encoding any glyphs. + * + * - coverage (out): the maximum antialiasing coverage across all + * paint layers. Fractional values (between 0 and 1) indicate + * antialiased edge pixels; 0 means fully outside, 1 means fully + * inside. Stem darkening and gamma correction should be applied + * to this value rather than to the returned color, so that + * interior paint colors are unaffected. See the stem darkening + * notes in the Draw section. + * + * Returns premultiplied RGBA: fully transparent outside the glyph, + * composited layers inside. Use (GL_ONE, GL_ONE_MINUS_SRC_ALPHA) + * blending to composite over a background. + * + * A typical fragment main: + * + * |[ + * uniform vec4 u_foreground; + * uniform float u_gamma; + * uniform float u_stem_darkening; + * in vec2 v_texcoord; + * flat in uint v_glyphLoc; + * out vec4 fragColor; + * + * void main () { + * float cov; + * vec4 c = hb_gpu_paint (v_texcoord, v_glyphLoc, u_foreground, cov); + * if (cov > 0.0 && cov < 1.0) { + * float adj = cov; + * if (u_stem_darkening > 0.0) { + * float brightness = c.a > 0.0 + * ? dot (c.rgb, vec3 (1.0 / 3.0)) / c.a : 0.0; + * adj = hb_gpu_stem_darken (adj, brightness, + * 1.0 / max (fwidth (v_texcoord).x, fwidth (v_texcoord).y)); + * } + * if (u_gamma != 1.0) + * adj = pow (adj, u_gamma); + * c *= adj / cov; + * } + * fragColor = c; + * } + * ]| + **/ + + +#include "hb-gpu-fragment-glsl.hh" +#include "hb-gpu-fragment-msl.hh" +#include "hb-gpu-fragment-wgsl.hh" +#include "hb-gpu-fragment-hlsl.hh" +#include "hb-gpu-vertex-glsl.hh" +#include "hb-gpu-vertex-msl.hh" +#include "hb-gpu-vertex-wgsl.hh" +#include "hb-gpu-vertex-hlsl.hh" + +/** + * hb_gpu_shader_source: + * @stage: pipeline stage (vertex or fragment) + * @lang: shader language variant + * + * Returns the shared helper shader source used by the hb-gpu + * renderers for the specified stage and language. The returned + * string is static and must not be freed. + * + * The shared source defines utilities such as the atlas sampler + * and the `hb_gpu_fetch()` accessor for the fragment stage, and + * the `hb_gpu_dilate()` helper for the vertex stage. Each + * renderer-specific source (for example, + * hb_gpu_draw_shader_source()) assumes these helpers are already + * in scope — callers should concatenate a `#version` directive, + * then this shared source, then the renderer-specific source, + * then their own `main()`. + * + * Return value: (transfer none): + * A shader source string, or `NULL` if @stage or @lang is + * unsupported. + * + * Since: 14.2.0 + **/ +const char * +hb_gpu_shader_source (hb_gpu_shader_stage_t stage, + hb_gpu_shader_lang_t lang) +{ + switch (stage) { + case HB_GPU_SHADER_STAGE_FRAGMENT: + switch (lang) { + case HB_GPU_SHADER_LANG_GLSL: return hb_gpu_fragment_glsl; + case HB_GPU_SHADER_LANG_MSL: return hb_gpu_fragment_msl; + case HB_GPU_SHADER_LANG_WGSL: return hb_gpu_fragment_wgsl; + case HB_GPU_SHADER_LANG_HLSL: return hb_gpu_fragment_hlsl; + case HB_GPU_SHADER_LANG_INVALID: + default: return nullptr; + } + case HB_GPU_SHADER_STAGE_VERTEX: + switch (lang) { + case HB_GPU_SHADER_LANG_GLSL: return hb_gpu_vertex_glsl; + case HB_GPU_SHADER_LANG_MSL: return hb_gpu_vertex_msl; + case HB_GPU_SHADER_LANG_WGSL: return hb_gpu_vertex_wgsl; + case HB_GPU_SHADER_LANG_HLSL: return hb_gpu_vertex_hlsl; + case HB_GPU_SHADER_LANG_INVALID: + default: return nullptr; + } + default: + return nullptr; + } +} + + diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu.h b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu.h new file mode 100644 index 0000000000..4b752209c1 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-gpu.h @@ -0,0 +1,278 @@ +/* + * Copyright (C) 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Author(s): Behdad Esfahbod + */ + +#ifndef HB_GPU_H +#define HB_GPU_H + +#include "hb.h" + +HB_BEGIN_DECLS + + +/** + * hb_gpu_shader_lang_t: + * @HB_GPU_SHADER_LANG_INVALID: Sentinel for an invalid or unspecified language. + * @HB_GPU_SHADER_LANG_GLSL: GLSL (OpenGL 3.3 / OpenGL ES 3.0 / WebGL 2.0) + * @HB_GPU_SHADER_LANG_WGSL: WGSL (WebGPU) + * @HB_GPU_SHADER_LANG_MSL: MSL (Metal) + * @HB_GPU_SHADER_LANG_HLSL: HLSL (Direct3D) + * + * Shader language variant. + * + * Since: 14.0.0 + */ +typedef enum { + HB_GPU_SHADER_LANG_INVALID, + HB_GPU_SHADER_LANG_GLSL, + HB_GPU_SHADER_LANG_WGSL, + HB_GPU_SHADER_LANG_MSL, + HB_GPU_SHADER_LANG_HLSL, +} hb_gpu_shader_lang_t; + +/** + * hb_gpu_shader_stage_t: + * @HB_GPU_SHADER_STAGE_VERTEX: Vertex shader stage. + * @HB_GPU_SHADER_STAGE_FRAGMENT: Fragment shader stage. + * + * Shader pipeline stage. + * + * Since: 14.2.0 + */ +typedef enum { + HB_GPU_SHADER_STAGE_VERTEX, + HB_GPU_SHADER_STAGE_FRAGMENT, +} hb_gpu_shader_stage_t; + +HB_EXTERN const char * +hb_gpu_shader_source (hb_gpu_shader_stage_t stage, + hb_gpu_shader_lang_t lang); + +HB_EXTERN const char * +hb_gpu_draw_shader_source (hb_gpu_shader_stage_t stage, + hb_gpu_shader_lang_t lang); + + +/** + * hb_gpu_draw_t: + * + * An opaque GPU shape encoder. Accumulates outlines via draw + * callbacks, then encodes them into a compact blob for GPU + * rendering. + * + * Since: 14.0.0 + */ +typedef struct hb_gpu_draw_t hb_gpu_draw_t; + +HB_EXTERN hb_gpu_draw_t * +hb_gpu_draw_create_or_fail (void); + +HB_EXTERN hb_gpu_draw_t * +hb_gpu_draw_reference (hb_gpu_draw_t *draw); + +HB_EXTERN void +hb_gpu_draw_destroy (hb_gpu_draw_t *draw); + +HB_EXTERN hb_bool_t +hb_gpu_draw_set_user_data (hb_gpu_draw_t *draw, + hb_user_data_key_t *key, + void *data, + hb_destroy_func_t destroy, + hb_bool_t replace); + +HB_EXTERN void * +hb_gpu_draw_get_user_data (const hb_gpu_draw_t *draw, + hb_user_data_key_t *key); + + +/* Scale */ + +HB_EXTERN void +hb_gpu_draw_set_scale (hb_gpu_draw_t *draw, + int x_scale, + int y_scale); + +HB_EXTERN void +hb_gpu_draw_get_scale (const hb_gpu_draw_t *draw, + int *x_scale, + int *y_scale); + +/* Draw */ + +HB_EXTERN hb_draw_funcs_t * +hb_gpu_draw_get_funcs (const hb_gpu_draw_t *draw); + +HB_EXTERN void +hb_gpu_draw_glyph (hb_gpu_draw_t *draw, + hb_font_t *font, + hb_codepoint_t glyph); + +HB_EXTERN hb_bool_t +hb_gpu_draw_glyph_or_fail (hb_gpu_draw_t *draw, + hb_font_t *font, + hb_codepoint_t glyph); + +/* For arbitrary shapes beyond a single glyph, callers feed + * outlines straight into the draw encoder via hb_draw_move_to() + * / hb_draw_line_to() / hb_draw_quadratic_to() / + * hb_draw_cubic_to() / hb_draw_close_path() with the funcs from + * hb_gpu_draw_get_funcs() and the hb_gpu_draw_t as data. The + * helpers hb_draw_line() / hb_draw_rectangle() / hb_draw_circle() + * cover common primitives (tapered lines, rectangles, circles). + * + * Coordinate system: the blob format quantizes coordinates to + * 16 bits with a fixed scale of 4 units per coordinate step, + * so the usable range is roughly +/-8000 units and the + * effective precision is ~0.25 units. Choose a coordinate + * scale where: + * + * (a) the overall bounding box stays within +/-8000, and + * (b) your smallest feature (stroke width, detail) is at + * least 1-2 units. + * + * Font-unit-style coordinates (e.g. a 1000-unit em) satisfy + * both comfortably. Tightly normalized coordinates (e.g. a + * 0..1 unit square) do not: a 1-pixel stroke in that space + * quantizes to zero and vanishes. Scale the rendered quad / + * vertex transform externally to reach larger on-screen sizes. + */ + + +/* Encode */ + +HB_EXTERN hb_blob_t * +hb_gpu_draw_encode (hb_gpu_draw_t *draw, + hb_glyph_extents_t *extents); + +HB_EXTERN void +hb_gpu_draw_clear (hb_gpu_draw_t *draw); + +HB_EXTERN void +hb_gpu_draw_reset (hb_gpu_draw_t *draw); + +HB_EXTERN void +hb_gpu_draw_recycle_blob (hb_gpu_draw_t *draw, + hb_blob_t *blob); + + +/** + * hb_gpu_paint_t: + * + * An opaque GPU color-glyph encoder. Accumulates color-glyph + * paint state via paint callbacks, then encodes it into a compact + * blob for GPU rendering. + * + * Since: 14.2.0 + */ +typedef struct hb_gpu_paint_t hb_gpu_paint_t; + +HB_EXTERN hb_gpu_paint_t * +hb_gpu_paint_create_or_fail (void); + +HB_EXTERN hb_gpu_paint_t * +hb_gpu_paint_reference (hb_gpu_paint_t *paint); + +HB_EXTERN void +hb_gpu_paint_destroy (hb_gpu_paint_t *paint); + +HB_EXTERN hb_bool_t +hb_gpu_paint_set_user_data (hb_gpu_paint_t *paint, + hb_user_data_key_t *key, + void *data, + hb_destroy_func_t destroy, + hb_bool_t replace); + +HB_EXTERN void * +hb_gpu_paint_get_user_data (const hb_gpu_paint_t *paint, + hb_user_data_key_t *key); + +HB_EXTERN hb_paint_funcs_t * +hb_gpu_paint_get_funcs (const hb_gpu_paint_t *paint); + +HB_EXTERN void +hb_gpu_paint_set_palette (hb_gpu_paint_t *paint, + unsigned palette); + +HB_EXTERN unsigned +hb_gpu_paint_get_palette (const hb_gpu_paint_t *paint); + +HB_EXTERN void +hb_gpu_paint_clear_custom_palette_colors (hb_gpu_paint_t *paint); + +HB_EXTERN hb_bool_t +hb_gpu_paint_set_custom_palette_color (hb_gpu_paint_t *paint, + unsigned int color_index, + hb_color_t color); + +HB_EXTERN void +hb_gpu_paint_set_scale (hb_gpu_paint_t *paint, + int x_scale, + int y_scale); + +HB_EXTERN void +hb_gpu_paint_get_scale (const hb_gpu_paint_t *paint, + int *x_scale, + int *y_scale); + +HB_EXTERN void +hb_gpu_paint_glyph (hb_gpu_paint_t *paint, + hb_font_t *font, + hb_codepoint_t glyph); + +HB_EXTERN hb_bool_t +hb_gpu_paint_glyph_or_fail (hb_gpu_paint_t *paint, + hb_font_t *font, + hb_codepoint_t glyph); + +HB_EXTERN hb_blob_t * +hb_gpu_paint_encode (hb_gpu_paint_t *paint, + hb_glyph_extents_t *extents); + +HB_EXTERN void +hb_gpu_paint_clear (hb_gpu_paint_t *paint); + +HB_EXTERN void +hb_gpu_paint_reset (hb_gpu_paint_t *paint); + +HB_EXTERN void +hb_gpu_paint_recycle_blob (hb_gpu_paint_t *paint, + hb_blob_t *blob); + +HB_EXTERN const char * +hb_gpu_paint_shader_source (hb_gpu_shader_stage_t stage, + hb_gpu_shader_lang_t lang); + + +HB_END_DECLS + + +#if defined(__cplusplus) && defined(HB_CPLUSPLUS_HH) +namespace hb { +HB_DEFINE_VTABLE (gpu_draw, nullptr); +HB_DEFINE_VTABLE (gpu_paint, nullptr); +} // namespace hb +#endif + +#endif /* HB_GPU_H */ diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-raster.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-raster.hh new file mode 100644 index 0000000000..852aee8445 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-raster.hh @@ -0,0 +1,81 @@ +/* + * Copyright © 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Author(s): Behdad Esfahbod + */ + +#ifndef HB_RASTER_HH +#define HB_RASTER_HH + +#include "hb.hh" + +/* Shared pixel helpers (used by paint and image compositing). */ + +static HB_ALWAYS_INLINE uint8_t +hb_raster_div255 (unsigned a) +{ + if (true) + { + // An approximation. Slightly faster. + // https://github.com/linebender/vello/blob/ab58009c8289e83689cd0effc4e34d1c6e8b51f5/sparse_strips/vello_cpu/src/util.rs#L10-L63 + return (a + 255) >> 8; + } + + return (uint8_t) ((a + 128 + ((a + 128) >> 8)) >> 8); +} + +static HB_ALWAYS_INLINE uint32_t +hb_raster_pack_pixel (uint8_t b, uint8_t g, uint8_t r, uint8_t a) +{ + return (uint32_t) b | ((uint32_t) g << 8) | ((uint32_t) r << 16) | ((uint32_t) a << 24); +} + +/* SRC_OVER: premultiplied src over premultiplied dst. */ +static HB_ALWAYS_INLINE uint32_t +hb_raster_src_over (uint32_t src, uint32_t dst) +{ + uint8_t sa = (uint8_t) (src >> 24); + if (sa == 255) return src; + if (sa == 0) return dst; + unsigned inv_sa = 255 - sa; + uint8_t rb = hb_raster_div255 ((dst & 0xFF) * inv_sa) + (uint8_t) (src & 0xFF); + uint8_t rg = hb_raster_div255 (((dst >> 8) & 0xFF) * inv_sa) + (uint8_t) ((src >> 8) & 0xFF); + uint8_t rr = hb_raster_div255 (((dst >> 16) & 0xFF) * inv_sa) + (uint8_t) ((src >> 16) & 0xFF); + uint8_t ra = hb_raster_div255 (((dst >> 24) & 0xFF) * inv_sa) + sa; + return (uint32_t) rb | ((uint32_t) rg << 8) | ((uint32_t) rr << 16) | ((uint32_t) ra << 24); +} + +/* Scale a premultiplied pixel by an alpha [0,255]. */ +static HB_ALWAYS_INLINE uint32_t +hb_raster_alpha_mul (uint32_t px, unsigned a) +{ + if (a == 255) return px; + if (a == 0) return 0; + uint8_t rb = hb_raster_div255 ((px & 0xFF) * a); + uint8_t rg = hb_raster_div255 (((px >> 8) & 0xFF) * a); + uint8_t rr = hb_raster_div255 (((px >> 16) & 0xFF) * a); + uint8_t ra = hb_raster_div255 (((px >> 24) & 0xFF) * a); + return (uint32_t) rb | ((uint32_t) rg << 8) | ((uint32_t) rr << 16) | ((uint32_t) ra << 24); +} + +#endif /* HB_RASTER_HH */ diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-buf.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-buf.hh new file mode 100644 index 0000000000..d09f907de6 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-buf.hh @@ -0,0 +1,191 @@ +/* + * Copyright © 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Author(s): Behdad Esfahbod + */ + +#ifndef HB_VECTOR_BUF_HH +#define HB_VECTOR_BUF_HH + +#include "hb.hh" +#include "hb-vector.hh" +#include +#include +#include + +HB_INTERNAL const char * +hb_vector_decimal_point_get (void); + +struct hb_vector_buf_t : hb_vector_t +{ + unsigned precision = 2; + + unsigned scale_precision () const + { return precision < 7 ? 7 : precision; } + + bool append_len (const char *s, unsigned l) + { + unsigned old_len = length; + if (unlikely (!resize_dirty ((int) (old_len + l)))) + return false; + hb_memcpy (arrayZ + old_len, s, l); + return true; + } + + bool append_c (char ch) + { return push_or_fail (ch); } + + bool append_str (const char *s) + { return append_len (s, (unsigned) strlen (s)); } + + bool append_unsigned (unsigned v) + { + char tmp[16]; + snprintf (tmp, sizeof (tmp), "%u", v); + return append_len (tmp, (unsigned) strlen (tmp)); + } + + bool append_hex_byte (unsigned v) + { + char tmp[2] = {"0123456789ABCDEF"[(v >> 4) & 15], + "0123456789ABCDEF"[v & 15]}; + return append_len (tmp, 2); + } + + void append_num (float v) + { append_num (v, precision); } + + void append_num (float v, unsigned p) + { + if (p > 12) p = 12; + + float rounded_zero_threshold = 0.5f; + for (unsigned i = 0; i < p; i++) + rounded_zero_threshold *= 0.1f; + if (fabsf (v) < rounded_zero_threshold) + v = 0.f; + + if (!(v == v) || !std::isfinite (v)) + { + append_c ('0'); + return; + } + + char fmt[6]; + snprintf (fmt, sizeof (fmt), "%%.%uf", p); + char out[128]; + snprintf (out, sizeof (out), fmt, (double) v); + + const char *decimal_point = hb_vector_decimal_point_get (); + + if (decimal_point[0] != '.' || decimal_point[1] != '\0') + { + char *dp = strstr (out, decimal_point); + if (dp) + { + unsigned dp_len = (unsigned) strlen (decimal_point); + unsigned tail_len = (unsigned) strlen (dp + dp_len); + memmove (dp + 1, dp + dp_len, tail_len + 1); + *dp = '.'; + } + } + + char *dot = strchr (out, '.'); + if (dot) + { + char *end = out + strlen (out) - 1; + while (end > dot && *end == '0') + *end-- = '\0'; + if (end == dot) + *end = '\0'; + } + + append_len (out, (unsigned) strlen (out)); + } + + void append_svg_color (hb_color_t color, bool with_alpha) + { + unsigned r = hb_color_get_red (color); + unsigned g = hb_color_get_green (color); + unsigned b = hb_color_get_blue (color); + unsigned a = hb_color_get_alpha (color); + append_c ('#'); + if (((r >> 4) == (r & 0xF)) && + ((g >> 4) == (g & 0xF)) && + ((b >> 4) == (b & 0xF))) + { + append_c ("0123456789ABCDEF"[r & 0xF]); + append_c ("0123456789ABCDEF"[g & 0xF]); + append_c ("0123456789ABCDEF"[b & 0xF]); + } + else + { + append_hex_byte (r); + append_hex_byte (g); + append_hex_byte (b); + } + if (with_alpha && a != 255) + { + append_str ("\" fill-opacity=\""); + append_num (a / 255.f, 4); + } + } + + bool append_base64 (const uint8_t *data, unsigned len) + { + unsigned out_len = ((len + 2) / 3) * 4; + unsigned old_len = length; + if (unlikely (!resize_dirty ((int) (old_len + out_len)))) + return false; + + char *dst = arrayZ + old_len; + unsigned di = 0; + unsigned i = 0; + while (i + 2 < len) + { + unsigned v = ((unsigned) data[i] << 16) | + ((unsigned) data[i + 1] << 8) | + ((unsigned) data[i + 2]); + dst[di++] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(v >> 18) & 63]; + dst[di++] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(v >> 12) & 63]; + dst[di++] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(v >> 6) & 63]; + dst[di++] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[v & 63]; + i += 3; + } + + if (i < len) + { + unsigned v = (unsigned) data[i] << 16; + if (i + 1 < len) + v |= (unsigned) data[i + 1] << 8; + dst[di++] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(v >> 18) & 63]; + dst[di++] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(v >> 12) & 63]; + dst[di++] = (i + 1 < len) ? "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(v >> 6) & 63] : '='; + dst[di++] = '='; + } + + return true; + } +}; + +#endif /* HB_VECTOR_BUF_HH */ diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-draw.cc b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-draw.cc new file mode 100644 index 0000000000..1a96cb003d --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-draw.cc @@ -0,0 +1,936 @@ +/* + * Copyright © 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Author(s): Behdad Esfahbod + */ + +#include "hb.hh" + +#include "hb-vector-draw.hh" +#include "hb-vector-path.hh" + +#include +#include + +HB_UNUSED static inline bool +hb_vector_svg_buffer_contains (const hb_vector_buf_t &buf, const char *needle) +{ + unsigned nlen = (unsigned) strlen (needle); + if (!nlen || buf.length < nlen) + return false; + + for (unsigned i = 0; i + nlen <= buf.length; i++) + if (buf.arrayZ[i] == needle[0] && + !memcmp (buf.arrayZ + i, needle, nlen)) + return true; + return false; +} + +/* ---- SVG draw callbacks ---- */ + +static void hb_vector_draw_svg_move_to (hb_draw_funcs_t *, void *dd, hb_draw_state_t *, float x, float y, void *) +{ auto *d = (hb_vector_draw_t *) dd; d->path.append_c ('M'); d->append_xy_svg (x, y); } + +static void hb_vector_draw_svg_line_to (hb_draw_funcs_t *, void *dd, hb_draw_state_t *, float x, float y, void *) +{ auto *d = (hb_vector_draw_t *) dd; d->path.append_c ('L'); d->append_xy_svg (x, y); } + +static void hb_vector_draw_svg_quadratic_to (hb_draw_funcs_t *, void *dd, hb_draw_state_t *, float cx, float cy, float x, float y, void *) +{ auto *d = (hb_vector_draw_t *) dd; d->path.append_c ('Q'); d->append_xy_svg (cx, cy); d->path.append_c (' '); d->append_xy_svg (x, y); } + +static void hb_vector_draw_svg_cubic_to (hb_draw_funcs_t *, void *dd, hb_draw_state_t *, float c1x, float c1y, float c2x, float c2y, float x, float y, void *) +{ auto *d = (hb_vector_draw_t *) dd; d->path.append_c ('C'); d->append_xy_svg (c1x, c1y); d->path.append_c (' '); d->append_xy_svg (c2x, c2y); d->path.append_c (' '); d->append_xy_svg (x, y); } + +static void hb_vector_draw_svg_close_path (hb_draw_funcs_t *, void *dd, hb_draw_state_t *, void *) +{ ((hb_vector_draw_t *) dd)->path.append_c ('Z'); } + + +/* ---- PDF draw callbacks ---- */ + +static void hb_vector_draw_pdf_move_to (hb_draw_funcs_t *, void *dd, hb_draw_state_t *, float x, float y, void *) +{ auto *d = (hb_vector_draw_t *) dd; d->append_xy_pdf (x, y); d->path.append_str (" m\n"); } + +static void hb_vector_draw_pdf_line_to (hb_draw_funcs_t *, void *dd, hb_draw_state_t *, float x, float y, void *) +{ auto *d = (hb_vector_draw_t *) dd; d->append_xy_pdf (x, y); d->path.append_str (" l\n"); } + +/* No quadratic_to — null fallback auto-promotes to cubic. */ + +static void hb_vector_draw_pdf_cubic_to (hb_draw_funcs_t *, void *dd, hb_draw_state_t *, float c1x, float c1y, float c2x, float c2y, float x, float y, void *) +{ auto *d = (hb_vector_draw_t *) dd; d->append_xy_pdf (c1x, c1y); d->path.append_c (' '); d->append_xy_pdf (c2x, c2y); d->path.append_c (' '); d->append_xy_pdf (x, y); d->path.append_str (" c\n"); } + +static void hb_vector_draw_pdf_close_path (hb_draw_funcs_t *, void *dd, hb_draw_state_t *, void *) +{ ((hb_vector_draw_t *) dd)->path.append_str ("h\n"); } + + +/* ---- Lazy loaders ---- */ + +static inline void free_static_vector_draw_svg_funcs (); +static struct hb_vector_draw_svg_funcs_lazy_loader_t + : hb_draw_funcs_lazy_loader_t +{ + static hb_draw_funcs_t *create () + { + hb_draw_funcs_t *funcs = hb_draw_funcs_create (); + hb_draw_funcs_set_move_to_func (funcs, (hb_draw_move_to_func_t) hb_vector_draw_svg_move_to, nullptr, nullptr); + hb_draw_funcs_set_line_to_func (funcs, (hb_draw_line_to_func_t) hb_vector_draw_svg_line_to, nullptr, nullptr); + hb_draw_funcs_set_quadratic_to_func (funcs, (hb_draw_quadratic_to_func_t) hb_vector_draw_svg_quadratic_to, nullptr, nullptr); + hb_draw_funcs_set_cubic_to_func (funcs, (hb_draw_cubic_to_func_t) hb_vector_draw_svg_cubic_to, nullptr, nullptr); + hb_draw_funcs_set_close_path_func (funcs, (hb_draw_close_path_func_t) hb_vector_draw_svg_close_path, nullptr, nullptr); + hb_draw_funcs_make_immutable (funcs); + hb_atexit (free_static_vector_draw_svg_funcs); + return funcs; + } +} static_vector_draw_svg_funcs; +static inline void free_static_vector_draw_svg_funcs () { static_vector_draw_svg_funcs.free_instance (); } + +static inline void free_static_vector_draw_pdf_funcs (); +static struct hb_vector_draw_pdf_funcs_lazy_loader_t + : hb_draw_funcs_lazy_loader_t +{ + static hb_draw_funcs_t *create () + { + hb_draw_funcs_t *funcs = hb_draw_funcs_create (); + hb_draw_funcs_set_move_to_func (funcs, (hb_draw_move_to_func_t) hb_vector_draw_pdf_move_to, nullptr, nullptr); + hb_draw_funcs_set_line_to_func (funcs, (hb_draw_line_to_func_t) hb_vector_draw_pdf_line_to, nullptr, nullptr); + /* No quadratic_to: null fallback auto-promotes to cubic. */ + hb_draw_funcs_set_cubic_to_func (funcs, (hb_draw_cubic_to_func_t) hb_vector_draw_pdf_cubic_to, nullptr, nullptr); + hb_draw_funcs_set_close_path_func (funcs, (hb_draw_close_path_func_t) hb_vector_draw_pdf_close_path, nullptr, nullptr); + hb_draw_funcs_make_immutable (funcs); + hb_atexit (free_static_vector_draw_pdf_funcs); + return funcs; + } +} static_vector_draw_pdf_funcs; +static inline void free_static_vector_draw_pdf_funcs () { static_vector_draw_pdf_funcs.free_instance (); } + + + +/** + * hb_vector_draw_create_or_fail: + * @format: output format. + * + * Creates a new draw context for vector output. + * + * Return value: (nullable): a newly allocated #hb_vector_draw_t, or `NULL` on failure. + * + * Since: 13.0.0 + */ +hb_vector_draw_t * +hb_vector_draw_create_or_fail (hb_vector_format_t format) +{ + switch (format) + { + case HB_VECTOR_FORMAT_SVG: + case HB_VECTOR_FORMAT_PDF: + break; + case HB_VECTOR_FORMAT_INVALID: default: + return nullptr; + } + + hb_vector_draw_t *draw = hb_object_create (); + if (unlikely (!draw)) + return nullptr; + draw->format = format; + draw->defs.alloc (2048); + draw->body.alloc (8192); + draw->path.alloc (2048); + return draw; +} + +/** + * hb_vector_draw_reference: + * @draw: a draw context. + * + * Increases the reference count of @draw. + * + * Return value: (transfer full): referenced @draw. + * + * Since: 13.0.0 + */ +hb_vector_draw_t * +hb_vector_draw_reference (hb_vector_draw_t *draw) +{ + return hb_object_reference (draw); +} + +/** + * hb_vector_draw_destroy: + * @draw: a draw context. + * + * Decreases the reference count of @draw and destroys it when it reaches zero. + * + * Since: 13.0.0 + */ +void +hb_vector_draw_destroy (hb_vector_draw_t *draw) +{ + if (!hb_object_should_destroy (draw)) + return; + + hb_blob_destroy (draw->recycled_blob); + hb_object_actually_destroy (draw); + hb_free (draw); +} + +/** + * hb_vector_draw_set_user_data: + * @draw: a draw context. + * @key: user-data key. + * @data: user-data value. + * @destroy: (nullable): destroy callback for @data. + * @replace: whether to replace an existing value for @key. + * + * Attaches user data to @draw. + * + * Return value: `true` on success, `false` otherwise. + * + * Since: 13.0.0 + */ +hb_bool_t +hb_vector_draw_set_user_data (hb_vector_draw_t *draw, + hb_user_data_key_t *key, + void *data, + hb_destroy_func_t destroy, + hb_bool_t replace) +{ + return hb_object_set_user_data (draw, key, data, destroy, replace); +} + +/** + * hb_vector_draw_get_user_data: + * @draw: a draw context. + * @key: user-data key. + * + * Gets previously attached user data from @draw. + * + * Return value: (nullable): user-data value associated with @key. + * + * Since: 13.0.0 + */ +void * +hb_vector_draw_get_user_data (const hb_vector_draw_t *draw, + hb_user_data_key_t *key) +{ + return hb_object_get_user_data (draw, key); +} + +/** + * hb_vector_draw_set_transform: + * @draw: a draw context. + * @xx: transform xx component. + * @yx: transform yx component. + * @xy: transform xy component. + * @yy: transform yy component. + * @dx: transform x translation. + * @dy: transform y translation. + * + * Sets the affine transform used when drawing glyphs. + * + * Since: 13.0.0 + */ +void +hb_vector_draw_set_transform (hb_vector_draw_t *draw, + float xx, float yx, + float xy, float yy, + float dx, float dy) +{ + draw->transform = {xx, yx, xy, yy, dx, dy}; +} + +/** + * hb_vector_draw_get_transform: + * @draw: a draw context. + * @xx: (out) (nullable): transform xx component. + * @yx: (out) (nullable): transform yx component. + * @xy: (out) (nullable): transform xy component. + * @yy: (out) (nullable): transform yy component. + * @dx: (out) (nullable): transform x translation. + * @dy: (out) (nullable): transform y translation. + * + * Gets the affine transform used when drawing glyphs. + * + * Since: 13.0.0 + */ +void +hb_vector_draw_get_transform (const hb_vector_draw_t *draw, + float *xx, float *yx, + float *xy, float *yy, + float *dx, float *dy) +{ + if (xx) *xx = draw->transform.xx; + if (yx) *yx = draw->transform.yx; + if (xy) *xy = draw->transform.xy; + if (yy) *yy = draw->transform.yy; + if (dx) *dx = draw->transform.x0; + if (dy) *dy = draw->transform.y0; +} + +/** + * hb_vector_draw_set_scale_factor: + * @draw: a draw context. + * @x_scale_factor: x scale factor. + * @y_scale_factor: y scale factor. + * + * Sets additional output scaling factors. + * + * Since: 13.0.0 + */ +void +hb_vector_draw_set_scale_factor (hb_vector_draw_t *draw, + float x_scale_factor, + float y_scale_factor) +{ + draw->x_scale_factor = x_scale_factor > 0.f ? x_scale_factor : 1.f; + draw->y_scale_factor = y_scale_factor > 0.f ? y_scale_factor : 1.f; +} + +/** + * hb_vector_draw_get_scale_factor: + * @draw: a draw context. + * @x_scale_factor: (out) (nullable): x scale factor. + * @y_scale_factor: (out) (nullable): y scale factor. + * + * Gets additional output scaling factors. + * + * Since: 13.0.0 + */ +void +hb_vector_draw_get_scale_factor (const hb_vector_draw_t *draw, + float *x_scale_factor, + float *y_scale_factor) +{ + if (x_scale_factor) *x_scale_factor = draw->x_scale_factor; + if (y_scale_factor) *y_scale_factor = draw->y_scale_factor; +} + +/** + * hb_vector_draw_set_extents: + * @draw: a draw context. + * @extents: (nullable): output extents to set or expand. + * + * Sets or expands output extents on @draw. Passing `NULL` clears extents. + * + * Since: 13.0.0 + */ +void +hb_vector_draw_set_extents (hb_vector_draw_t *draw, + const hb_vector_extents_t *extents) +{ + if (!extents) + { + draw->extents = {0, 0, 0, 0}; + draw->has_extents = false; + return; + } + + if (extents->width == 0.f || extents->height == 0.f) + return; + + /* Caller-supplied extents are in input-space; divide by + * scale_factor so they end up in output-space, matching + * the per-glyph extents accumulated via + * hb_vector_set_glyph_extents_common (which applies the + * same divide). Normalize so origin is the min corner and + * width/height are positive — callers may pass a + * glyph-extents-style box with negative height. */ + float x0 = extents->x / draw->x_scale_factor; + float y0 = extents->y / draw->y_scale_factor; + float x1 = x0 + extents->width / draw->x_scale_factor; + float y1 = y0 + extents->height / draw->y_scale_factor; + hb_vector_extents_t e = { + hb_min (x0, x1), hb_min (y0, y1), + fabsf (x1 - x0), fabsf (y1 - y0), + }; + + if (draw->has_extents) + { + float x0 = hb_min (draw->extents.x, e.x); + float y0 = hb_min (draw->extents.y, e.y); + float x1 = hb_max (draw->extents.x + draw->extents.width, + e.x + e.width); + float y1 = hb_max (draw->extents.y + draw->extents.height, + e.y + e.height); + draw->extents = {x0, y0, x1 - x0, y1 - y0}; + } + else + { + draw->extents = e; + draw->has_extents = true; + } +} + +/** + * hb_vector_draw_get_extents: + * @draw: a draw context. + * @extents: (out) (nullable): where to store current output extents. + * + * Gets current output extents from @draw. + * + * Return value: `true` if extents are set, `false` otherwise. + * + * Since: 13.0.0 + */ +hb_bool_t +hb_vector_draw_get_extents (const hb_vector_draw_t *draw, + hb_vector_extents_t *extents) +{ + if (!draw->has_extents) + return false; + + if (extents) + *extents = draw->extents; + return true; +} + +/** + * hb_vector_draw_set_glyph_extents: + * @draw: a draw context. + * @glyph_extents: glyph extents in font units. + * + * Expands @draw extents using @glyph_extents under the current transform. + * + * Return value: `true` on success, `false` otherwise. + * + * Since: 13.0.0 + */ +hb_bool_t +hb_vector_draw_set_glyph_extents (hb_vector_draw_t *draw, + const hb_glyph_extents_t *glyph_extents) +{ + hb_bool_t has_extents = draw->has_extents; + hb_bool_t ret = hb_vector_set_glyph_extents_common (draw->transform, + draw->x_scale_factor, + draw->y_scale_factor, + glyph_extents, + &draw->extents, + &has_extents); + draw->has_extents = has_extents; + return ret; +} + +/** + * hb_vector_draw_get_format: + * @draw: a vector draw context. + * + * Gets the output format @draw was created with. + * + * Return value: the output format. + * + * Since: 14.2.0 + */ +hb_vector_format_t +hb_vector_draw_get_format (const hb_vector_draw_t *draw) +{ + return draw->format; +} + +/** + * hb_vector_draw_get_funcs: + * @draw: a vector draw context. + * + * Gets draw callbacks for feeding outline data into @draw. + * Pass @draw as the @draw_data argument when calling them. + * + * Return value: (transfer none): immutable #hb_draw_funcs_t. + * + * Since: 14.2.0 + */ +hb_draw_funcs_t * +hb_vector_draw_get_funcs (const hb_vector_draw_t *draw) +{ + switch (draw ? draw->format : HB_VECTOR_FORMAT_INVALID) + { + case HB_VECTOR_FORMAT_SVG: return static_vector_draw_svg_funcs.get_unconst (); + case HB_VECTOR_FORMAT_PDF: return static_vector_draw_pdf_funcs.get_unconst (); + case HB_VECTOR_FORMAT_INVALID: default: return nullptr; + } +} + +/** + * hb_vector_draw_new_path: + * @draw: a draw context. + * + * Flushes any pending path and starts a new one. Call this + * between glyphs to separate their outlines so fill rules + * don't interact across glyphs. + * + * Since: 14.2.0 + */ +void +hb_vector_draw_new_path (hb_vector_draw_t *draw) +{ + draw->new_path (); +} + +/** + * hb_vector_draw_glyph_or_fail: + * @draw: a draw context. + * @font: font object. + * @glyph: glyph ID. + * @extents_mode: extents update mode. + * + * Convenience to draw one glyph into @draw. Equivalent to: + * + * |[ + * // extend extents if requested + * hb_vector_draw_new_path (draw); + * hb_font_draw_glyph_or_fail (font, glyph, + * hb_vector_draw_get_funcs (draw), draw); + * ]| + * + * Return value: `true` if glyph data was emitted, `false` otherwise. + * + * Since: 14.2.0 + */ +hb_bool_t +hb_vector_draw_glyph_or_fail (hb_vector_draw_t *draw, + hb_font_t *font, + hb_codepoint_t glyph, + hb_vector_extents_mode_t extents_mode) +{ + + if (extents_mode == HB_VECTOR_EXTENTS_MODE_EXPAND) + { + hb_glyph_extents_t ge; + if (hb_font_get_glyph_extents (font, glyph, &ge)) + { + hb_bool_t has_extents = draw->has_extents; + hb_vector_set_glyph_extents_common (draw->transform, + draw->x_scale_factor, + draw->y_scale_factor, + &ge, + &draw->extents, + &has_extents); + draw->has_extents = has_extents; + } + } + + draw->new_path (); + return hb_font_draw_glyph_or_fail (font, glyph, hb_vector_draw_get_funcs (draw), draw); +} + +/** + * hb_vector_draw_glyph: + * @draw: a draw context. + * @font: font object. + * @glyph: glyph ID. + * @extents_mode: extents update mode. + * + * Draws one glyph into @draw. Equivalent to + * hb_vector_draw_glyph_or_fail() with the return value ignored. + * + * Since: 14.2.0 + */ +void +hb_vector_draw_glyph (hb_vector_draw_t *draw, + hb_font_t *font, + hb_codepoint_t glyph, + hb_vector_extents_mode_t extents_mode) +{ + hb_vector_draw_glyph_or_fail (draw, font, glyph, extents_mode); +} + + +/** + * hb_vector_draw_set_precision: + * @draw: a draw context. + * @precision: decimal precision. + * + * Sets numeric output precision for draw output. + * + * Since: 14.2.0 + */ +void +hb_vector_draw_set_precision (hb_vector_draw_t *draw, + unsigned precision) +{ + draw->set_precision (precision); +} + +/** + * hb_vector_draw_get_precision: + * @draw: a draw context. + * + * Returns the numeric output precision previously set on @draw, + * or the default if none was set. + * + * Return value: the precision. + * + * Since: 14.2.0 + */ +unsigned +hb_vector_draw_get_precision (const hb_vector_draw_t *draw) +{ + return draw->get_precision (); +} + +/** + * hb_vector_draw_set_foreground: + * @draw: a draw context. + * @foreground: foreground fill color. + * + * Sets the fill color for drawn glyph outlines. + * Default is opaque black. + * + * Since: 14.2.0 + */ +void +hb_vector_draw_set_foreground (hb_vector_draw_t *draw, + hb_color_t foreground) +{ + draw->flush_path (); + draw->foreground = foreground; +} + +/** + * hb_vector_draw_get_foreground: + * @draw: a draw context. + * + * Returns the foreground fill color. + * + * Return value: the foreground color. + * + * Since: 14.2.0 + */ +hb_color_t +hb_vector_draw_get_foreground (const hb_vector_draw_t *draw) +{ + return draw->foreground; +} + +/** + * hb_vector_draw_set_background: + * @draw: a draw context. + * @background: background color. + * + * Sets the background color. If non-transparent, a filled + * rectangle covering the extents is emitted behind all content. + * Default is transparent (no background). + * + * Since: 14.2.0 + */ +void +hb_vector_draw_set_background (hb_vector_draw_t *draw, + hb_color_t background) +{ + draw->background = background; +} + +/** + * hb_vector_draw_get_background: + * @draw: a draw context. + * + * Returns the background color. + * + * Return value: the background color. + * + * Since: 14.2.0 + */ +hb_color_t +hb_vector_draw_get_background (const hb_vector_draw_t *draw) +{ + return draw->background; +} + +static hb_blob_t * +hb_vector_draw_render_pdf (hb_vector_draw_t *draw) +{ + draw->flush_path (); + if (!draw->has_extents) + return nullptr; + + /* Collect the content stream. The path coordinates are in + * SVG space (Y-down). Prepend a CTM that flips Y so the + * PDF page (Y-up) renders correctly. */ + float ex = draw->extents.x; + float ey = draw->extents.y; + float ew = draw->extents.width; + float eh = draw->extents.height; + + hb_vector_buf_t stream; + stream.alloc (draw->body.length + draw->path.length + 256); + + /* Background rect. */ + if (hb_color_get_alpha (draw->background)) + { + float a = hb_color_get_alpha (draw->background) / 255.f; + if (a < 1.f - 1.f / 512.f) + { + stream.append_num (a, 4); + stream.append_str (" ca gs\n"); + } + stream.append_num (hb_color_get_red (draw->background) / 255.f, 4); + stream.append_c (' '); + stream.append_num (hb_color_get_green (draw->background) / 255.f, 4); + stream.append_c (' '); + stream.append_num (hb_color_get_blue (draw->background) / 255.f, 4); + stream.append_str (" rg\n"); + stream.append_num (ex); + stream.append_c (' '); + stream.append_num (-(ey + eh)); + stream.append_c (' '); + stream.append_num (ew); + stream.append_c (' '); + stream.append_num (eh); + stream.append_str (" re f\n"); + } + + draw->flush_path (); + if (draw->body.length) + stream.append_len (draw->body.arrayZ, draw->body.length); + + /* Build PDF objects, tracking byte offsets for xref. */ + hb_vector_buf_t out; + hb_buf_recover_recycled (draw->recycled_blob, &out); + out.alloc (stream.length + 512); + + unsigned offsets[5]; /* objects 1-4, plus end */ + + out.append_str ("%PDF-1.4\n%\xC0\xC1\xC2\xC3\n"); + + /* Object 1: Catalog */ + offsets[0] = out.length; + out.append_str ("1 0 obj\n<< /Type /Catalog /Pages 2 0 R >>\nendobj\n"); + + /* Object 2: Pages */ + offsets[1] = out.length; + out.append_str ("2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n"); + + /* Object 3: Page. Extents are in SVG space (y = -font_y). + * Convert back: font Y range = [-(ey+eh) .. -ey]. */ + offsets[2] = out.length; + out.append_str ("3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox ["); + out.append_num (ex); + out.append_c (' '); + out.append_num (-(ey + eh)); + out.append_c (' '); + out.append_num (ex + ew); + out.append_c (' '); + out.append_num (-ey); + out.append_str ("] /Contents 4 0 R"); + if (draw->pdf_extgstate_dict.length) + { + out.append_str (" /Resources << /ExtGState << "); + out.append_len (draw->pdf_extgstate_dict.arrayZ, draw->pdf_extgstate_dict.length); + out.append_str (">> >>"); + } + out.append_str (" >>\nendobj\n"); + + /* Object 4: Content stream */ + offsets[3] = out.length; + out.append_str ("4 0 obj\n<< /Length "); + out.append_unsigned (stream.length); + out.append_str (" >>\nstream\n"); + out.append_len (stream.arrayZ, stream.length); + out.append_str ("endstream\nendobj\n"); + + /* Cross-reference table */ + unsigned xref_offset = out.length; + out.append_str ("xref\n0 5\n"); + out.append_str ("0000000000 65535 f \n"); + for (unsigned i = 0; i < 4; i++) + { + char tmp[21]; + snprintf (tmp, sizeof (tmp), "%010u 00000 n \n", offsets[i]); + out.append_len (tmp, 20); + } + + /* Trailer */ + out.append_str ("trailer\n<< /Size 5 /Root 1 0 R >>\nstartxref\n"); + out.append_unsigned (xref_offset); + out.append_str ("\n%%EOF\n"); + + hb_blob_t *blob = hb_buf_blob_from (&draw->recycled_blob, &out); + + hb_vector_draw_clear (draw); + + return blob; +} + +static hb_blob_t * +hb_vector_draw_render_svg (hb_vector_draw_t *draw) +{ + draw->flush_path (); + if (!draw->has_extents) + return nullptr; + + hb_vector_buf_t out; + hb_buf_recover_recycled (draw->recycled_blob, &out); + unsigned estimated = draw->defs.length + + (draw->body.length ? draw->body.length : draw->path.length) + + 256; + out.alloc (estimated); + /* Extents are in Y-up (font) space. SVG is Y-down. + * The global scale(1,-1) wrapper flips content; the + * viewBox maps the flipped range. */ + float vb_x = draw->extents.x; + float vb_y = -(draw->extents.y + draw->extents.height); + float vb_w = draw->extents.width; + float vb_h = draw->extents.height; + out.append_str ("\n"); + + if (draw->defs.length) + { + out.append_str ("\n"); + out.append_len (draw->defs.arrayZ, draw->defs.length); + out.append_str ("\n"); + } + + /* Background rect. */ + if (hb_color_get_alpha (draw->background)) + { + out.append_str ("background)); + out.append_c (','); + out.append_unsigned (hb_color_get_green (draw->background)); + out.append_c (','); + out.append_unsigned (hb_color_get_blue (draw->background)); + out.append_str (")\""); + if (hb_color_get_alpha (draw->background) < 255) + { + out.append_str (" fill-opacity=\""); + out.append_num (hb_color_get_alpha (draw->background) / 255.f, 4); + out.append_c ('"'); + } + out.append_str ("/>\n"); + } + + draw->flush_path (); + if (draw->body.length) + { + out.append_str ("\n"); + out.append_len (draw->body.arrayZ, draw->body.length); + out.append_str ("\n"); + } + + out.append_str ("\n"); + + hb_blob_t *blob = hb_buf_blob_from (&draw->recycled_blob, &out); + + hb_vector_draw_clear (draw); + + return blob; +} + +/** + * hb_vector_draw_render: + * @draw: a draw context. + * + * Renders accumulated draw content to an output blob. + * + * Return value: (transfer full) (nullable): output blob, or `NULL` if rendering cannot proceed. + * + * Since: 13.0.0 + */ +hb_blob_t * +hb_vector_draw_render (hb_vector_draw_t *draw) +{ + switch (draw->format) + { + case HB_VECTOR_FORMAT_SVG: + return hb_vector_draw_render_svg (draw); + + case HB_VECTOR_FORMAT_PDF: + return hb_vector_draw_render_pdf (draw); + + case HB_VECTOR_FORMAT_INVALID: default: + return nullptr; + } +} + +/** + * hb_vector_draw_clear: + * @draw: a draw context. + * + * Discards accumulated draw output so @draw can be reused for + * another render. User configuration (transform, scale factors, + * precision) is preserved. Call hb_vector_draw_reset() to + * also reset user configuration to defaults. + * + * Since: 14.2.0 + */ +void +hb_vector_draw_clear (hb_vector_draw_t *draw) +{ + draw->extents = {0, 0, 0, 0}; + draw->has_extents = false; + draw->defs.clear (); + draw->body.clear (); + draw->path.clear (); +} + +/** + * hb_vector_draw_reset: + * @draw: a draw context. + * + * Resets @draw state and clears accumulated content. + * + * Since: 13.0.0 + */ +void +hb_vector_draw_reset (hb_vector_draw_t *draw) +{ + draw->transform = {1, 0, 0, 1, 0, 0}; + draw->x_scale_factor = 1.f; + draw->y_scale_factor = 1.f; + draw->set_precision (2); + hb_vector_draw_clear (draw); +} + +/** + * hb_vector_draw_recycle_blob: + * @draw: a draw context. + * @blob: (nullable): previously rendered blob to recycle. + * + * Provides a blob for internal buffer reuse by later render calls. + * + * Since: 13.0.0 + */ +void +hb_vector_draw_recycle_blob (hb_vector_draw_t *draw, + hb_blob_t *blob) +{ + hb_blob_destroy (draw->recycled_blob); + draw->recycled_blob = nullptr; + if (!blob || blob == hb_blob_get_empty ()) + return; + draw->recycled_blob = blob; +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-draw.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-draw.hh new file mode 100644 index 0000000000..0158cfd419 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-draw.hh @@ -0,0 +1,138 @@ +/* + * Copyright © 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Author(s): Behdad Esfahbod + */ + +#ifndef HB_VECTOR_DRAW_HH +#define HB_VECTOR_DRAW_HH + +#include "hb.hh" + +#include "hb-vector.h" +#include "hb-geometry.hh" +#include "hb-machinery.hh" +#include "hb-vector-buf.hh" +#include "hb-vector-internal.hh" + +struct hb_vector_draw_t +{ + hb_object_header_t header; + + hb_vector_format_t format = HB_VECTOR_FORMAT_INVALID; + hb_transform_t<> transform = {1, 0, 0, 1, 0, 0}; + float x_scale_factor = 1.f; + float y_scale_factor = 1.f; + hb_vector_extents_t extents = {0, 0, 0, 0}; + bool has_extents = false; + hb_color_t foreground = HB_COLOR (0, 0, 0, 255); + hb_color_t background = HB_COLOR (0, 0, 0, 0); + + hb_vector_buf_t defs; + hb_vector_buf_t body; + hb_vector_buf_t path; + hb_vector_buf_t pdf_extgstate_dict; + unsigned pdf_extgstate_count = 0; + + void set_precision (unsigned p) + { + p = hb_min (p, 12u); + defs.precision = p; + body.precision = p; + path.precision = p; + } + + unsigned get_precision () const { return path.precision; } + hb_blob_t *recycled_blob = nullptr; + + void new_path () + { + flush_path (); + } + + void flush_path () + { + if (!path.length) return; + switch (format) + { + case HB_VECTOR_FORMAT_PDF: flush_path_pdf (); break; + case HB_VECTOR_FORMAT_SVG: flush_path_svg (); break; + case HB_VECTOR_FORMAT_INVALID: default: break; + } + path.shrink (0); + } + + void flush_path_pdf () + { + unsigned a = hb_color_get_alpha (foreground); + if (a < 255) + { + unsigned gs_idx = pdf_extgstate_count++; + body.append_str ("/GS"); + body.append_unsigned (gs_idx); + body.append_str (" gs\n"); + + pdf_extgstate_dict.append_str ("/GS"); + pdf_extgstate_dict.append_unsigned (gs_idx); + pdf_extgstate_dict.append_str (" << /Type /ExtGState /ca "); + pdf_extgstate_dict.append_num (a / 255.f, 4); + pdf_extgstate_dict.append_str (" >> "); + } + body.append_num (hb_color_get_red (foreground) / 255.f, 4); + body.append_c (' '); + body.append_num (hb_color_get_green (foreground) / 255.f, 4); + body.append_c (' '); + body.append_num (hb_color_get_blue (foreground) / 255.f, 4); + body.append_str (" rg\n"); + body.append_len (path.arrayZ, path.length); + body.append_str ("f\n"); + } + + void flush_path_svg () + { + body.append_str ("\n"); + } + + void transform_xy (float x, float y, float *tx, float *ty) + { + hb_vector_transform_point (transform, x_scale_factor, y_scale_factor, x, y, tx, ty); + } + + void append_xy (float x, float y, char sep) + { + float tx, ty; + transform_xy (x, y, &tx, &ty); + path.append_num (tx, path.precision); + path.append_c (sep); + path.append_num (ty, path.precision); + } + + void append_xy_svg (float x, float y) { append_xy (x, y, ','); } + void append_xy_pdf (float x, float y) { append_xy (x, y, ' '); } +}; + +#endif /* HB_VECTOR_DRAW_HH */ diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-internal.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-internal.hh new file mode 100644 index 0000000000..999ec2bdc6 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-internal.hh @@ -0,0 +1,266 @@ +/* + * Copyright © 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Author(s): Behdad Esfahbod + */ + +#ifndef HB_VECTOR_INTERNAL_HH +#define HB_VECTOR_INTERNAL_HH + +#include "hb-vector.h" + +struct hb_vector_blob_meta_t +{ + char *data; + int allocated; + bool transferred; + bool in_replace; +}; + +static hb_user_data_key_t hb_vector_blob_meta_user_data_key; + +static inline void +hb_vector_blob_meta_set_buffer (hb_vector_blob_meta_t *meta, + char *data, + int allocated) +{ + meta->data = data; + meta->allocated = allocated; + meta->transferred = false; +} + +static inline void +hb_vector_blob_meta_release_buffer (hb_vector_blob_meta_t *meta) +{ + if (!meta) + return; + if (!meta->transferred && meta->data) + hb_free (meta->data); + meta->data = nullptr; + meta->allocated = 0; + meta->transferred = true; +} + +static inline void +hb_vector_blob_meta_destroy (void *data) +{ + auto *meta = (hb_vector_blob_meta_t *) data; + hb_vector_blob_meta_release_buffer (meta); + if (meta->in_replace) + { + meta->in_replace = false; + return; + } + hb_free (meta); +} + +static inline hb_blob_t * +hb_buf_blob_from (hb_blob_t **recycled_blob, + hb_vector_buf_t *buf) +{ + unsigned len = 0; + int allocated = 0; + char *data = buf->steal (&len, &allocated); + if (!data) + return nullptr; + + hb_blob_t *blob = nullptr; + if (*recycled_blob) + blob = *recycled_blob; + bool reused_blob = blob && blob != hb_blob_get_empty (); + bool new_meta = false; + auto *meta = reused_blob + ? (hb_vector_blob_meta_t *) hb_blob_get_user_data (blob, &hb_vector_blob_meta_user_data_key) + : nullptr; + if (!meta) + { + meta = (hb_vector_blob_meta_t *) hb_malloc (sizeof (hb_vector_blob_meta_t)); + if (!meta) + { + hb_free (data); + return nullptr; + } + meta->data = nullptr; + meta->allocated = 0; + meta->transferred = true; + meta->in_replace = false; + new_meta = true; + } + + if (reused_blob) + { + meta->in_replace = true; + blob->replace_buffer (data, len, HB_MEMORY_MODE_WRITABLE, meta, hb_vector_blob_meta_destroy); + hb_vector_blob_meta_set_buffer (meta, data, allocated); + } + else + { + hb_vector_blob_meta_set_buffer (meta, data, allocated); + blob = hb_blob_create_or_fail (data, len, HB_MEMORY_MODE_WRITABLE, meta, hb_vector_blob_meta_destroy); + if (unlikely (!blob)) + return nullptr; + } + + if (unlikely (blob == hb_blob_get_empty ())) + { + if (new_meta) + hb_free (meta); + hb_free (data); + return nullptr; + } + + if (new_meta && + !hb_blob_set_user_data (blob, + &hb_vector_blob_meta_user_data_key, + meta, + nullptr, + true)) + { + if (!reused_blob) + hb_blob_destroy (blob); + return nullptr; + } + + if (*recycled_blob) + *recycled_blob = nullptr; + + return blob; +} + +static inline void +hb_buf_recover_recycled (hb_blob_t *blob, + hb_vector_buf_t *buf) +{ + if (!blob) + return; + + auto *meta = (hb_vector_blob_meta_t *) hb_blob_get_user_data (blob, &hb_vector_blob_meta_user_data_key); + if (!meta || meta->transferred || !meta->data) + return; + + buf->recycle_buffer (meta->data, 0, meta->allocated); + meta->data = nullptr; + meta->allocated = 0; + meta->transferred = true; +} + +static inline void +hb_vector_transform_point (const hb_transform_t<> &t, + float x_scale_factor, + float y_scale_factor, + float x, float y, + float *tx, float *ty) +{ + float xx = x, yy = y; + t.transform_point (xx, yy); + /* Setters force scale factors > 0; trust them here. */ + *tx = xx / x_scale_factor; + *ty = yy / y_scale_factor; +} + +static inline hb_bool_t +hb_vector_set_glyph_extents_common (const hb_transform_t<> &transform, + float x_scale_factor, + float y_scale_factor, + const hb_glyph_extents_t *glyph_extents, + hb_vector_extents_t *extents, + hb_bool_t *has_extents) +{ + float x0 = (float) glyph_extents->x_bearing; + float y0 = (float) glyph_extents->y_bearing; + float x1 = x0 + glyph_extents->width; + float y1 = y0 + glyph_extents->height; + + float px[4] = {x0, x0, x1, x1}; + float py[4] = {y0, y1, y0, y1}; + + float tx, ty; + hb_vector_transform_point (transform, x_scale_factor, y_scale_factor, px[0], py[0], &tx, &ty); + float tx_min = tx, tx_max = tx; + float ty_min = ty, ty_max = ty; + + for (unsigned i = 1; i < 4; i++) + { + hb_vector_transform_point (transform, x_scale_factor, y_scale_factor, px[i], py[i], &tx, &ty); + tx_min = hb_min (tx_min, tx); + tx_max = hb_max (tx_max, tx); + ty_min = hb_min (ty_min, ty); + ty_max = hb_max (ty_max, ty); + } + + if (tx_max <= tx_min || ty_max <= ty_min) + return false; + + if (*has_extents) + { + float x0 = hb_min (extents->x, tx_min); + float y0 = hb_min (extents->y, ty_min); + float x1 = hb_max (extents->x + extents->width, tx_max); + float y1 = hb_max (extents->y + extents->height, ty_max); + *extents = {x0, y0, x1 - x0, y1 - y0}; + } + else + { + *extents = {tx_min, ty_min, tx_max - tx_min, ty_max - ty_min}; + *has_extents = true; + } + return true; +} + +static inline void +hb_vector_svg_append_instance_transform (hb_vector_buf_t *out, + unsigned precision, + float x_scale_factor, + float y_scale_factor, + float xx, float yx, + float xy, float yy, + float tx, float ty) +{ + if (xx == 1.f && yx == 0.f && xy == 0.f && yy == 1.f) + { + out->append_str ("translate("); + out->append_num (tx / x_scale_factor, precision); + out->append_c (','); + out->append_num (-ty / y_scale_factor, precision); + out->append_str (") scale(1,-1)"); + } + else + { + unsigned sprec = out->scale_precision (); + out->append_str ("matrix("); + out->append_num (xx, sprec); + out->append_c (','); + out->append_num (yx, sprec); + out->append_c (','); + out->append_num (-xy, sprec); + out->append_c (','); + out->append_num (-yy, sprec); + out->append_c (','); + out->append_num (tx / x_scale_factor, precision); + out->append_c (','); + out->append_num (-ty / y_scale_factor, precision); + out->append_c (')'); + } +} + +#endif /* HB_VECTOR_INTERNAL_HH */ diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-paint-pdf.cc b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-paint-pdf.cc new file mode 100644 index 0000000000..64b52e421d --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-paint-pdf.cc @@ -0,0 +1,1716 @@ +/* + * Copyright © 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Author(s): Behdad Esfahbod + */ + +#include "hb.hh" + +#include "hb-vector-paint.hh" +#include "hb-vector-draw.hh" +#include "hb-paint.hh" + +#include +#include + +#ifdef HAVE_ZLIB +#include +#endif + +/* PDF paint backend for COLRv0/v1 color font rendering. + * + * Supports: + * - Solid colors with alpha (via ExtGState) + * - Glyph and rectangle clipping + * - Affine transforms + * - Groups (save/restore) + * - Linear gradients (PDF Type 2 axial shading) + * - Radial gradients (PDF Type 3 radial shading) + * - Sweep gradients (approximated via solid fallback) + */ + + +/* ---- PDF object collector ---- */ + +struct hb_pdf_obj_t +{ + hb_vector_buf_t data; +}; + +/* Collects extra PDF objects (shadings, functions, ExtGState) + * during painting. Referenced from the content stream by name + * (e.g. /SH0, /GS0) and emitted at render time. */ +static bool +hb_pdf_build_indexed_smask (hb_vector_buf_t *out, + const char *idat_data, unsigned idat_len, + unsigned width, unsigned height, + const uint8_t *trns, unsigned trns_len); + +struct hb_pdf_resources_t +{ + hb_vector_t objects; /* extra objects, starting at id 5 */ + hb_vector_buf_t extgstate_dict; /* /GS0 5 0 R /GS1 6 0 R ... */ + hb_vector_buf_t shading_dict; /* /SH0 7 0 R ... */ + hb_vector_buf_t xobject_dict; /* /Im0 8 0 R ... */ + unsigned extgstate_count = 0; + unsigned shading_count = 0; + unsigned xobject_count = 0; + + unsigned add_object (hb_vector_buf_t &&obj_data) + { + unsigned id = 5 + objects.length; /* objects 1-4 are fixed */ + hb_pdf_obj_t obj; + obj.data = std::move (obj_data); + objects.push (std::move (obj)); + return id; + } + + /* Add ExtGState for fill opacity, return resource name index. */ + unsigned add_extgstate_alpha (float alpha) + { + unsigned idx = extgstate_count++; + hb_vector_buf_t obj; + obj.append_str ("<< /Type /ExtGState /ca "); + obj.append_num (alpha, 4); + obj.append_str (" >>"); + unsigned obj_id = add_object (std::move (obj)); + + extgstate_dict.append_str ("/GS"); + extgstate_dict.append_unsigned (idx); + extgstate_dict.append_c (' '); + extgstate_dict.append_unsigned (obj_id); + extgstate_dict.append_str (" 0 R "); + return idx; + } + + /* Add ExtGState for blend mode, return resource name index. */ + unsigned add_extgstate_blend (const char *bm) + { + unsigned idx = extgstate_count++; + hb_vector_buf_t obj; + obj.append_str ("<< /Type /ExtGState /BM /"); + obj.append_str (bm); + obj.append_str (" >>"); + unsigned obj_id = add_object (std::move (obj)); + + extgstate_dict.append_str ("/GS"); + extgstate_dict.append_unsigned (idx); + extgstate_dict.append_c (' '); + extgstate_dict.append_unsigned (obj_id); + extgstate_dict.append_str (" 0 R "); + return idx; + } + + /* Add ExtGState with an SMask (soft mask) referencing a Form XObject + * that paints a DeviceGray shading. Returns the ExtGState resource index. */ + unsigned add_extgstate_smask (unsigned alpha_shading_id, + float bbox_x, float bbox_y, + float bbox_w, float bbox_h, + unsigned precision) + { + /* Form XObject: transparency group painting the alpha shading. */ + hb_vector_buf_t form_stream; + form_stream.append_str ("/SHa sh\n"); + + hb_vector_buf_t form; + form.append_str ("<< /Type /XObject /Subtype /Form\n"); + form.append_str ("/BBox ["); + form.append_num (bbox_x, precision); + form.append_c (' '); + form.append_num (bbox_y, precision); + form.append_c (' '); + form.append_num (bbox_x + bbox_w, precision); + form.append_c (' '); + form.append_num (bbox_y + bbox_h, precision); + form.append_str ("]\n/Group << /S /Transparency /CS /DeviceGray >>\n"); + form.append_str ("/Resources << /Shading << /SHa "); + form.append_unsigned (alpha_shading_id); + form.append_str (" 0 R >> >>\n"); + form.append_str ("/Length "); + form.append_unsigned (form_stream.length); + form.append_str (" >>\nstream\n"); + form.append_len (form_stream.arrayZ, form_stream.length); + form.append_str ("endstream"); + unsigned form_id = add_object (std::move (form)); + + /* ExtGState with luminosity soft mask. */ + unsigned idx = extgstate_count++; + hb_vector_buf_t gs; + gs.append_str ("<< /Type /ExtGState\n"); + gs.append_str ("/SMask << /Type /Mask /S /Luminosity /G "); + gs.append_unsigned (form_id); + gs.append_str (" 0 R >> >>"); + unsigned gs_id = add_object (std::move (gs)); + + extgstate_dict.append_str ("/GS"); + extgstate_dict.append_unsigned (idx); + extgstate_dict.append_c (' '); + extgstate_dict.append_unsigned (gs_id); + extgstate_dict.append_str (" 0 R "); + return idx; + } + + /* Add a shading, return resource name index. */ + unsigned add_shading (hb_vector_buf_t &&shading_data) + { + unsigned obj_id = add_object (std::move (shading_data)); + return add_shading_by_id (obj_id); + } + + /* Register an already-allocated object as a shading resource. */ + unsigned add_shading_by_id (unsigned obj_id) + { + unsigned idx = shading_count++; + shading_dict.append_str ("/SH"); + shading_dict.append_unsigned (idx); + shading_dict.append_c (' '); + shading_dict.append_unsigned (obj_id); + shading_dict.append_str (" 0 R "); + return idx; + } + + /* Add an XObject image, return resource name index. + * idat_data/idat_len is the concatenated PNG IDAT payload (zlib data). + * colors is 1 (gray), 3 (RGB), or 4 (RGBA); for indexed, pass colors=1. + * plte/plte_len is the PLTE chunk data for indexed images (may be null). */ + unsigned add_xobject_png_image (const char *idat_data, unsigned idat_len, + unsigned width, unsigned height, + unsigned colors, bool has_alpha, + const uint8_t *plte = nullptr, + unsigned plte_len = 0, + const uint8_t *trns = nullptr, + unsigned trns_len = 0) + { + unsigned idx = xobject_count++; + hb_vector_buf_t obj; + obj.append_str ("<< /Type /XObject /Subtype /Image\n"); + obj.append_str ("/Width "); + obj.append_unsigned (width); + obj.append_str (" /Height "); + obj.append_unsigned (height); + obj.append_str ("\n/BitsPerComponent 8\n"); + + if (plte && plte_len >= 3) + { + /* Indexed color: /ColorSpace [/Indexed /DeviceRGB N ] */ + unsigned n_entries = plte_len / 3; + obj.append_str ("/ColorSpace [/Indexed /DeviceRGB "); + obj.append_unsigned (n_entries - 1); + obj.append_str (" <"); + for (unsigned i = 0; i < n_entries * 3; i++) + { + obj.append_c ("0123456789ABCDEF"[plte[i] >> 4]); + obj.append_c ("0123456789ABCDEF"[plte[i] & 0xF]); + } + obj.append_str (">]\n"); + } + else + { + obj.append_str ("/ColorSpace "); + unsigned color_channels = has_alpha ? colors - 1 : colors; + obj.append_str (color_channels == 1 ? "/DeviceGray" : "/DeviceRGB"); + obj.append_c ('\n'); + } + + /* Build SMask for indexed images with tRNS transparency. */ + unsigned smask_id = 0; + if (plte && trns && trns_len) + { + hb_vector_buf_t smask_stream; + if (hb_pdf_build_indexed_smask (&smask_stream, idat_data, idat_len, + width, height, trns, trns_len)) + { + hb_vector_buf_t smask_obj; + smask_obj.append_str ("<< /Type /XObject /Subtype /Image\n"); + smask_obj.append_str ("/Width "); + smask_obj.append_unsigned (width); + smask_obj.append_str (" /Height "); + smask_obj.append_unsigned (height); + smask_obj.append_str ("\n/ColorSpace /DeviceGray /BitsPerComponent 8\n"); + smask_obj.append_str ("/Length "); + smask_obj.append_unsigned (smask_stream.length); + smask_obj.append_str (" >>\nstream\n"); + smask_obj.append_len (smask_stream.arrayZ, smask_stream.length); + smask_obj.append_str ("\nendstream"); + smask_id = add_object (std::move (smask_obj)); + } + } + + if (smask_id) + { + obj.append_str ("/SMask "); + obj.append_unsigned (smask_id); + obj.append_str (" 0 R\n"); + } + + obj.append_str ("/Filter /FlateDecode\n"); + obj.append_str ("/DecodeParms << /Predictor 15 /Colors "); + obj.append_unsigned (colors); + obj.append_str (" /BitsPerComponent 8 /Columns "); + obj.append_unsigned (width); + obj.append_str (" >>\n"); + obj.append_str ("/Length "); + obj.append_unsigned (idat_len); + obj.append_str (" >>\nstream\n"); + obj.append_len (idat_data, idat_len); + obj.append_str ("\nendstream"); + + (void) has_alpha; + + unsigned obj_id = add_object (std::move (obj)); + + xobject_dict.append_str ("/Im"); + xobject_dict.append_unsigned (idx); + xobject_dict.append_c (' '); + xobject_dict.append_unsigned (obj_id); + xobject_dict.append_str (" 0 R "); + return idx; + } +}; + +/* Store resources pointer in the paint struct's defs buffer + * (repurposed — defs is unused for PDF). */ +static hb_pdf_resources_t * +hb_pdf_get_resources (hb_vector_paint_t *paint) +{ + if (!paint->defs.length) + { + /* First call: allocate and store. */ + auto *res = (hb_pdf_resources_t *) hb_calloc (1, sizeof (hb_pdf_resources_t)); + if (unlikely (!res)) return nullptr; + new (res) hb_pdf_resources_t (); + if (unlikely (!paint->defs.resize (sizeof (void *)))) + { + res->~hb_pdf_resources_t (); + hb_free (res); + return nullptr; + } + memcpy (paint->defs.arrayZ, &res, sizeof (void *)); + } + hb_pdf_resources_t *res; + memcpy (&res, paint->defs.arrayZ, sizeof (void *)); + return res; +} + +void +hb_vector_paint_pdf_free_resources (hb_vector_paint_t *paint) +{ + if (paint->defs.length >= sizeof (void *)) + { + hb_pdf_resources_t *res; + memcpy (&res, paint->defs.arrayZ, sizeof (void *)); + if (res) + { + res->~hb_pdf_resources_t (); + hb_free (res); + } + } + paint->defs.clear (); +} + + +/* ---- helpers ---- */ + + +/* Emit a glyph outline as PDF path operators into buf. */ +static void +hb_pdf_emit_glyph_path (hb_vector_paint_t *paint, + hb_font_t *font, + hb_codepoint_t glyph, + hb_vector_buf_t *buf) +{ + hb_vector_path_sink_t sink = {&paint->path, paint->get_precision (), + paint->x_scale_factor, paint->y_scale_factor}; + paint->path.clear (); + hb_font_draw_glyph (font, glyph, + hb_vector_pdf_path_draw_funcs_get (), + &sink); + buf->append_len (paint->path.arrayZ, paint->path.length); + paint->path.clear (); +} + + +/* ---- paint callbacks ---- */ + +static void +hb_pdf_paint_push_transform (hb_paint_funcs_t *, + void *paint_data, + float xx, float yx, + float xy, float yy, + float dx, float dy, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + + auto &body = paint->current_body (); + unsigned sprec = body.scale_precision (); + body.append_str ("q\n"); + body.append_num (xx, sprec); + body.append_c (' '); + body.append_num (yx, sprec); + body.append_c (' '); + body.append_num (xy, sprec); + body.append_c (' '); + body.append_num (yy, sprec); + body.append_c (' '); + body.append_num (paint->sx (dx)); + body.append_c (' '); + body.append_num (paint->sy (dy)); + body.append_str (" cm\n"); +} + +static void +hb_pdf_paint_pop_transform (hb_paint_funcs_t *, + void *paint_data, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + paint->current_body ().append_str ("Q\n"); +} + +static void +hb_pdf_paint_push_clip_glyph (hb_paint_funcs_t *, + void *paint_data, + hb_codepoint_t glyph, + hb_font_t *font, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + + auto &body = paint->current_body (); + body.append_str ("q\n"); + hb_pdf_emit_glyph_path (paint, font, glyph, &body); + body.append_str ("W n\n"); +} + +static void +hb_pdf_paint_push_clip_rectangle (hb_paint_funcs_t *, + void *paint_data, + float xmin, float ymin, + float xmax, float ymax, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + + auto &body = paint->current_body (); + body.append_str ("q\n"); + body.append_num (paint->sx (xmin)); + body.append_c (' '); + body.append_num (paint->sy (ymin)); + body.append_c (' '); + body.append_num (paint->sx (xmax - xmin)); + body.append_c (' '); + body.append_num (paint->sy (ymax - ymin)); + body.append_str (" re W n\n"); +} + +static hb_draw_funcs_t * +hb_pdf_paint_push_clip_path_start (hb_paint_funcs_t *, + void *paint_data, + void **draw_data, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + { + *draw_data = nullptr; + return nullptr; + } + + auto &body = paint->current_body (); + body.append_str ("q\n"); + /* Stream path operators straight into the body; end() seals + * the path with "W n" to turn it into the clip region. + * Coordinates arrive in font-scale; the sink divides by + * scale_factor so they land in output space. */ + paint->clip_path_sink = {&body, paint->get_precision (), + paint->x_scale_factor, + paint->y_scale_factor}; + *draw_data = &paint->clip_path_sink; + return hb_vector_pdf_path_draw_funcs_get (); +} + +static void +hb_pdf_paint_push_clip_path_end (hb_paint_funcs_t *, + void *paint_data, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + paint->current_body ().append_str ("W n\n"); +} + +static void +hb_pdf_paint_pop_clip (hb_paint_funcs_t *, + void *paint_data, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + paint->current_body ().append_str ("Q\n"); +} + +/* Paint a solid color, including alpha via ExtGState. */ +static void +hb_pdf_paint_solid_color (hb_vector_paint_t *paint, hb_color_t c) +{ + auto &body = paint->current_body (); + + float r = hb_color_get_red (c) / 255.f; + float g = hb_color_get_green (c) / 255.f; + float b = hb_color_get_blue (c) / 255.f; + float a = hb_color_get_alpha (c) / 255.f; + + if (a < 1.f / 255.f) + return; + + /* Set alpha via ExtGState if needed. */ + if (a < 1.f - 1.f / 512.f) + { + auto *res = hb_pdf_get_resources (paint); + if (res) + { + unsigned gs_idx = res->add_extgstate_alpha (a); + body.append_str ("/GS"); + body.append_unsigned (gs_idx); + body.append_str (" gs\n"); + } + } + + /* Set fill color. */ + body.append_num (r, 4); + body.append_c (' '); + body.append_num (g, 4); + body.append_c (' '); + body.append_num (b, 4); + body.append_str (" rg\n"); + + /* Paint a huge rect (will be clipped). */ + body.append_str ("-32767 -32767 65534 65534 re f\n"); +} + +static void +hb_pdf_paint_color (hb_paint_funcs_t *, + void *paint_data, + hb_bool_t, + hb_color_t color, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + + hb_pdf_paint_solid_color (paint, color); +} + +/* Build an uncompressed alpha mask from indexed PNG IDAT data + tRNS. + * Decompresses IDAT, un-filters PNG rows, maps palette indices to alpha. */ +static bool +hb_pdf_build_indexed_smask (hb_vector_buf_t *out, + const char *idat_data, unsigned idat_len, + unsigned width, unsigned height, + const uint8_t *trns, unsigned trns_len) +{ +#ifndef HAVE_ZLIB + (void) out; (void) idat_data; (void) idat_len; + (void) width; (void) height; (void) trns; (void) trns_len; + return false; +#else + /* Decompress IDAT (zlib). */ + unsigned raw_len = (width + 1) * height; /* 1 filter byte per row + width bytes */ + uint8_t *raw = (uint8_t *) hb_malloc (raw_len); + if (!raw) return false; + HB_SCOPE_GUARD (hb_free (raw)); + + z_stream stream = {}; + stream.next_in = (Bytef *) idat_data; + stream.avail_in = idat_len; + stream.next_out = (Bytef *) raw; + stream.avail_out = raw_len; + + if (inflateInit (&stream) != Z_OK) + return false; + int status = inflate (&stream, Z_FINISH); + unsigned long total_out = stream.total_out; + inflateEnd (&stream); + if (status != Z_STREAM_END || total_out != raw_len) + return false; + + /* Un-filter and map to alpha. */ + if (!out->resize (width * height)) + return false; + + uint8_t *unfiltered = (uint8_t *) hb_malloc (width); + if (!unfiltered) + return false; + HB_SCOPE_GUARD (hb_free (unfiltered)); + + uint8_t *prev_unfiltered = (uint8_t *) hb_calloc (width, 1); + if (!prev_unfiltered) + return false; + HB_SCOPE_GUARD (hb_free (prev_unfiltered)); + + for (unsigned y = 0; y < height; y++) + { + uint8_t *row = raw + y * (width + 1); + uint8_t filter = row[0]; + uint8_t *pixels = row + 1; + + for (unsigned x = 0; x < width; x++) + { + uint8_t a = (x > 0) ? unfiltered[x - 1] : 0; + uint8_t b = prev_unfiltered[x]; + uint8_t c = (x > 0) ? prev_unfiltered[x - 1] : 0; + uint8_t val = pixels[x]; + + switch (filter) + { + case 0: unfiltered[x] = val; break; /* None */ + case 1: unfiltered[x] = val + a; break; /* Sub */ + case 2: unfiltered[x] = val + b; break; /* Up */ + case 3: unfiltered[x] = val + (uint8_t) (((unsigned) a + b) / 2); break; /* Average */ + case 4: /* Paeth */ + { + int p = (int) a + (int) b - (int) c; + int pa = abs (p - (int) a); + int pb = abs (p - (int) b); + int pc = abs (p - (int) c); + uint8_t pr = (pa <= pb && pa <= pc) ? a : (pb <= pc) ? b : c; + unfiltered[x] = val + pr; + break; + } + default: unfiltered[x] = val; break; + } + + /* Map palette index to alpha. */ + uint8_t idx = unfiltered[x]; + out->arrayZ[y * width + x] = (idx < trns_len) ? trns[idx] : 0xFF; + } + + /* Swap buffers. */ + uint8_t *tmp = prev_unfiltered; + prev_unfiltered = unfiltered; + unfiltered = tmp; + } + + return true; +#endif +} + +/* Read a big-endian uint32 from a byte pointer. */ +static inline uint32_t +hb_pdf_png_u32 (const uint8_t *p) +{ + return ((uint32_t) p[0] << 24) | ((uint32_t) p[1] << 16) | + ((uint32_t) p[2] << 8) | (uint32_t) p[3]; +} + +static hb_bool_t +hb_pdf_paint_image (hb_paint_funcs_t *, + void *paint_data, + hb_blob_t *image, + unsigned width, + unsigned height, + hb_tag_t format, + float slant HB_UNUSED, + hb_glyph_extents_t *extents, + void *) +{ + if (format != HB_TAG ('p','n','g',' ')) + return false; + if (!extents || !width || !height) + return false; + + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return false; + auto *res = hb_pdf_get_resources (paint); + if (unlikely (!res)) + return false; + + unsigned len = 0; + const uint8_t *data = (const uint8_t *) hb_blob_get_data (image, &len); + if (!data || len < 8) + return false; + + /* Verify PNG signature. */ + static const uint8_t png_sig[8] = {137, 80, 78, 71, 13, 10, 26, 10}; + if (hb_memcmp (data, png_sig, 8) != 0) + return false; + + /* Parse PNG chunks: extract IHDR and concatenate IDAT payloads. */ + unsigned png_w = 0, png_h = 0; + unsigned colors = 3; /* default RGB */ + uint8_t color_type = 2; + bool has_alpha = false; + const uint8_t *plte_data = nullptr; + unsigned plte_len = 0; + const uint8_t *trns_data = nullptr; + unsigned trns_len = 0; + hb_vector_buf_t idat; + + unsigned pos = 8; + while (pos + 12 <= len) + { + uint32_t chunk_len = hb_pdf_png_u32 (data + pos); + uint32_t chunk_type = hb_pdf_png_u32 (data + pos + 4); + if (pos + 12 + chunk_len > len) + break; + const uint8_t *chunk_data = data + pos + 8; + + if (chunk_type == 0x49484452u) /* IHDR */ + { + if (chunk_len < 13) return false; + png_w = hb_pdf_png_u32 (chunk_data); + png_h = hb_pdf_png_u32 (chunk_data + 4); + uint8_t bit_depth = chunk_data[8]; + color_type = chunk_data[9]; + if (bit_depth != 8) return false; /* only 8-bit supported */ + + switch (color_type) + { + case 0: colors = 1; has_alpha = false; break; /* Grayscale */ + case 2: colors = 3; has_alpha = false; break; /* RGB */ + case 3: colors = 1; has_alpha = false; break; /* Indexed */ + case 4: colors = 2; has_alpha = true; break; /* Gray+Alpha */ + case 6: colors = 4; has_alpha = true; break; /* RGBA */ + default: return false; + } + } + else if (chunk_type == 0x504C5445u) /* PLTE */ + { + plte_data = chunk_data; + plte_len = chunk_len; + } + else if (chunk_type == 0x74524E53u) /* tRNS */ + { + trns_data = chunk_data; + trns_len = chunk_len; + } + else if (chunk_type == 0x49444154u) /* IDAT */ + { + idat.append_len ((const char *) chunk_data, chunk_len); + } + else if (chunk_type == 0x49454E44u) /* IEND */ + break; + + pos += 12 + chunk_len; + } + + if (!png_w || !png_h || !idat.length) + return false; + + unsigned im_idx = res->add_xobject_png_image (idat.arrayZ, idat.length, + png_w, png_h, + colors, has_alpha, + plte_data, plte_len, + trns_data, trns_len); + + /* Emit: save state, set CTM to map image (0,0)-(1,1) to extents, paint. */ + auto &body = paint->current_body (); + body.append_str ("q\n"); + + /* Image space: (0,0) at bottom-left, (1,1) at top-right. + * We need to map to extents (x_bearing, y_bearing+height) .. (x_bearing+width, y_bearing). + * Since font coords are Y-up like PDF, y_bearing is the top. */ + float ix = (float) extents->x_bearing; + float iy = (float) extents->y_bearing + (float) extents->height; + float iw = (float) extents->width; + float ih = (float) -extents->height; /* negative because image Y goes up but height is negative in extents */ + + body.append_num (paint->sx (iw)); + body.append_str (" 0 0 "); + body.append_num (paint->sy (ih)); + body.append_c (' '); + body.append_num (paint->sx (ix)); + body.append_c (' '); + body.append_num (paint->sy (iy)); + body.append_str (" cm\n"); + + body.append_str ("/Im"); + body.append_unsigned (im_idx); + body.append_str (" Do\nQ\n"); + + return true; +} + +/* ---- Gradient helpers ---- */ + +static bool +hb_pdf_gradient_needs_alpha (hb_array_t stops) +{ + for (const auto &s : stops) + if (hb_color_get_alpha (s.color) != 255) + return true; + return false; +} + +/* Build a PDF Type 2 (exponential interpolation) function for + * a single alpha stop pair (DeviceGray, scalar output). */ +static void +hb_pdf_build_alpha_interpolation_function (hb_vector_buf_t *obj, + float a0, float a1) +{ + obj->append_str ("<< /FunctionType 2 /Domain [0 1] /N 1\n"); + obj->append_str ("/C0 ["); + obj->append_num (a0, 4); + obj->append_str ("]\n/C1 ["); + obj->append_num (a1, 4); + obj->append_str ("] >>"); +} + +/* Build a stitching function (Type 3) for the alpha channel of + * pre-populated paint->color_stops_scratch (already sorted+normalized). */ +static unsigned +hb_pdf_build_alpha_gradient_function_from_stops (hb_pdf_resources_t *res, + hb_vector_paint_t *paint) +{ + unsigned count = paint->color_stops_scratch.length; + + if (count < 2) + { + float a = count ? hb_color_get_alpha (paint->color_stops_scratch.arrayZ[0].color) / 255.f : 1.f; + hb_vector_buf_t obj; + hb_pdf_build_alpha_interpolation_function (&obj, a, a); + return res->add_object (std::move (obj)); + } + + if (count == 2) + { + hb_vector_buf_t obj; + hb_pdf_build_alpha_interpolation_function (&obj, + hb_color_get_alpha (paint->color_stops_scratch.arrayZ[0].color) / 255.f, + hb_color_get_alpha (paint->color_stops_scratch.arrayZ[1].color) / 255.f); + return res->add_object (std::move (obj)); + } + + hb_vector_t sub_func_ids; + for (unsigned i = 0; i + 1 < count; i++) + { + hb_vector_buf_t sub; + hb_pdf_build_alpha_interpolation_function (&sub, + hb_color_get_alpha (paint->color_stops_scratch.arrayZ[i].color) / 255.f, + hb_color_get_alpha (paint->color_stops_scratch.arrayZ[i + 1].color) / 255.f); + sub_func_ids.push (res->add_object (std::move (sub))); + } + + hb_vector_buf_t obj; + obj.append_str ("<< /FunctionType 3 /Domain [0 1]\n"); + obj.append_str ("/Functions ["); + for (unsigned i = 0; i < sub_func_ids.length; i++) + { + if (i) obj.append_c (' '); + obj.append_unsigned (sub_func_ids.arrayZ[i]); + obj.append_str (" 0 R"); + } + obj.append_str ("]\n/Bounds ["); + for (unsigned i = 1; i + 1 < count; i++) + { + if (i > 1) obj.append_c (' '); + obj.append_num (paint->color_stops_scratch.arrayZ[i].offset, 4); + } + obj.append_str ("]\n/Encode ["); + for (unsigned i = 0; i + 1 < count; i++) + { + if (i) obj.append_c (' '); + obj.append_str ("0 1"); + } + obj.append_str ("] >>"); + return res->add_object (std::move (obj)); +} + +/* Build a PDF Type 2 (exponential interpolation) function for + * a single color stop pair. */ +static void +hb_pdf_build_interpolation_function (hb_vector_buf_t *obj, + hb_color_t c0, hb_color_t c1) +{ + obj->append_str ("<< /FunctionType 2 /Domain [0 1] /N 1\n"); + obj->append_str ("/C0 ["); + obj->append_num (hb_color_get_red (c0) / 255.f, 4); + obj->append_c (' '); + obj->append_num (hb_color_get_green (c0) / 255.f, 4); + obj->append_c (' '); + obj->append_num (hb_color_get_blue (c0) / 255.f, 4); + obj->append_str ("]\n/C1 ["); + obj->append_num (hb_color_get_red (c1) / 255.f, 4); + obj->append_c (' '); + obj->append_num (hb_color_get_green (c1) / 255.f, 4); + obj->append_c (' '); + obj->append_num (hb_color_get_blue (c1) / 255.f, 4); + obj->append_str ("] >>"); +} + +/* Build a stitching function (Type 3) from pre-populated + * paint->color_stops_scratch (already sorted+normalized). */ +static unsigned +hb_pdf_build_gradient_function_from_stops (hb_pdf_resources_t *res, + hb_vector_paint_t *paint) +{ + unsigned count = paint->color_stops_scratch.length; + + if (count < 2) + { + /* Single stop: constant function. */ + hb_color_t c = count ? paint->color_stops_scratch.arrayZ[0].color + : HB_COLOR (0, 0, 0, 255); + hb_vector_buf_t obj; + hb_pdf_build_interpolation_function (&obj, c, c); + return res->add_object (std::move (obj)); + } + + /* Sort by offset. */ + paint->color_stops_scratch.as_array ().qsort ( + [] (const hb_color_stop_t &a, const hb_color_stop_t &b) + { return a.offset < b.offset; }); + + if (count == 2) + { + /* Two stops: single interpolation function. */ + hb_vector_buf_t obj; + hb_pdf_build_interpolation_function (&obj, + paint->color_stops_scratch.arrayZ[0].color, + paint->color_stops_scratch.arrayZ[1].color); + return res->add_object (std::move (obj)); + } + + /* Multiple stops: create sub-functions and stitch. */ + hb_vector_t sub_func_ids; + for (unsigned i = 0; i + 1 < count; i++) + { + hb_vector_buf_t sub; + hb_pdf_build_interpolation_function (&sub, + paint->color_stops_scratch.arrayZ[i].color, + paint->color_stops_scratch.arrayZ[i + 1].color); + sub_func_ids.push (res->add_object (std::move (sub))); + } + + /* Stitching function (Type 3). */ + hb_vector_buf_t obj; + obj.append_str ("<< /FunctionType 3 /Domain [0 1]\n"); + + /* Functions array. */ + obj.append_str ("/Functions ["); + for (unsigned i = 0; i < sub_func_ids.length; i++) + { + if (i) obj.append_c (' '); + obj.append_unsigned (sub_func_ids.arrayZ[i]); + obj.append_str (" 0 R"); + } + obj.append_str ("]\n"); + + /* Bounds. */ + obj.append_str ("/Bounds ["); + for (unsigned i = 1; i + 1 < count; i++) + { + if (i > 1) obj.append_c (' '); + obj.append_num (paint->color_stops_scratch.arrayZ[i].offset, 4); + } + obj.append_str ("]\n"); + + /* Encode array. */ + obj.append_str ("/Encode ["); + for (unsigned i = 0; i + 1 < count; i++) + { + if (i) obj.append_c (' '); + obj.append_str ("0 1"); + } + obj.append_str ("] >>"); + + return res->add_object (std::move (obj)); +} + +static void +hb_pdf_paint_linear_gradient (hb_paint_funcs_t *, + void *paint_data, + hb_color_line_t *color_line, + float x0, float y0, + float x1, float y1, + float x2 HB_UNUSED, float y2 HB_UNUSED, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + auto *res = hb_pdf_get_resources (paint); + if (unlikely (!res)) + return; + + /* Fetch, normalize stops to [0,1], and adjust coordinates. */ + if (!paint->fetch_color_stops (color_line)) + return; + hb_vector_t &stops = paint->color_stops_scratch; + + float mn, mx; + hb_paint_normalize_color_line (stops.arrayZ, stops.length, &mn, &mx); + float gx0 = x0 + mn * (x1 - x0); + float gy0 = y0 + mn * (y1 - y0); + float gx1 = x0 + mx * (x1 - x0); + float gy1 = y0 + mx * (y1 - y0); + + unsigned func_id = hb_pdf_build_gradient_function_from_stops (res, paint); + + hb_paint_extend_t extend = hb_color_line_get_extend (color_line); + const char *extend_str = (extend == HB_PAINT_EXTEND_PAD) + ? "/Extend [true true]\n" : ""; + + /* Build Type 2 (axial) shading — color only. */ + hb_vector_buf_t sh; + sh.append_str ("<< /ShadingType 2 /ColorSpace /DeviceRGB\n"); + sh.append_str ("/Coords ["); + sh.append_num (paint->sx (gx0)); + sh.append_c (' '); + sh.append_num (paint->sy (gy0)); + sh.append_c (' '); + sh.append_num (paint->sx (gx1)); + sh.append_c (' '); + sh.append_num (paint->sy (gy1)); + sh.append_str ("]\n/Function "); + sh.append_unsigned (func_id); + sh.append_str (" 0 R\n"); + sh.append_str (extend_str); + sh.append_str (">>"); + + unsigned sh_idx = res->add_shading (std::move (sh)); + + auto &body = paint->current_body (); + + bool needs_alpha = hb_pdf_gradient_needs_alpha (stops); + if (needs_alpha) + { + unsigned alpha_func_id = hb_pdf_build_alpha_gradient_function_from_stops (res, paint); + + hb_vector_buf_t ash; + ash.append_str ("<< /ShadingType 2 /ColorSpace /DeviceGray\n"); + ash.append_str ("/Coords ["); + ash.append_num (paint->sx (gx0)); + ash.append_c (' '); + ash.append_num (paint->sy (gy0)); + ash.append_c (' '); + ash.append_num (paint->sx (gx1)); + ash.append_c (' '); + ash.append_num (paint->sy (gy1)); + ash.append_str ("]\n/Function "); + ash.append_unsigned (alpha_func_id); + ash.append_str (" 0 R\n"); + ash.append_str (extend_str); + ash.append_str (">>"); + unsigned alpha_sh_id = res->add_object (std::move (ash)); + + unsigned gs_idx = res->add_extgstate_smask (alpha_sh_id, + paint->sx (gx0), paint->sy (gy0), + paint->sx (gx1 - gx0), paint->sy (gy1 - gy0), + paint->get_precision ()); + body.append_str ("/GS"); + body.append_unsigned (gs_idx); + body.append_str (" gs\n"); + } + + body.append_str ("/SH"); + body.append_unsigned (sh_idx); + body.append_str (" sh\n"); +} + +static void +hb_pdf_paint_radial_gradient (hb_paint_funcs_t *, + void *paint_data, + hb_color_line_t *color_line, + float x0, float y0, float r0, + float x1, float y1, float r1, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + auto *res = hb_pdf_get_resources (paint); + if (unlikely (!res)) + return; + + /* Fetch, normalize stops to [0,1], and adjust coordinates. */ + if (!paint->fetch_color_stops (color_line)) + return; + hb_vector_t &stops = paint->color_stops_scratch; + + float mn, mx; + hb_paint_normalize_color_line (stops.arrayZ, stops.length, &mn, &mx); + float gx0 = x0 + mn * (x1 - x0); + float gy0 = y0 + mn * (y1 - y0); + float gr0 = r0 + mn * (r1 - r0); + float gx1 = x0 + mx * (x1 - x0); + float gy1 = y0 + mx * (y1 - y0); + float gr1 = r0 + mx * (r1 - r0); + + unsigned func_id = hb_pdf_build_gradient_function_from_stops (res, paint); + + hb_paint_extend_t extend = hb_color_line_get_extend (color_line); + const char *extend_str = (extend == HB_PAINT_EXTEND_PAD) + ? "/Extend [true true]\n" : ""; + + /* Build Type 3 (radial) shading — color only. */ + hb_vector_buf_t sh; + sh.append_str ("<< /ShadingType 3 /ColorSpace /DeviceRGB\n"); + sh.append_str ("/Coords ["); + sh.append_num (paint->sx (gx0)); + sh.append_c (' '); + sh.append_num (paint->sy (gy0)); + sh.append_c (' '); + sh.append_num (paint->sx (gr0)); + sh.append_c (' '); + sh.append_num (paint->sx (gx1)); + sh.append_c (' '); + sh.append_num (paint->sy (gy1)); + sh.append_c (' '); + sh.append_num (paint->sx (gr1)); + sh.append_str ("]\n/Function "); + sh.append_unsigned (func_id); + sh.append_str (" 0 R\n"); + sh.append_str (extend_str); + sh.append_str (">>"); + + unsigned sh_idx = res->add_shading (std::move (sh)); + + auto &body = paint->current_body (); + + bool needs_alpha = hb_pdf_gradient_needs_alpha (stops); + if (needs_alpha) + { + unsigned alpha_func_id = hb_pdf_build_alpha_gradient_function_from_stops (res, paint); + + hb_vector_buf_t ash; + ash.append_str ("<< /ShadingType 3 /ColorSpace /DeviceGray\n"); + ash.append_str ("/Coords ["); + ash.append_num (paint->sx (gx0)); + ash.append_c (' '); + ash.append_num (paint->sy (gy0)); + ash.append_c (' '); + ash.append_num (paint->sx (gr0)); + ash.append_c (' '); + ash.append_num (paint->sx (gx1)); + ash.append_c (' '); + ash.append_num (paint->sy (gy1)); + ash.append_c (' '); + ash.append_num (paint->sx (gr1)); + ash.append_str ("]\n/Function "); + ash.append_unsigned (alpha_func_id); + ash.append_str (" 0 R\n"); + ash.append_str (extend_str); + ash.append_str (">>"); + unsigned alpha_sh_id = res->add_object (std::move (ash)); + + /* BBox: enclosing square of the outer circle. */ + float cx = (gr1 >= gr0) ? gx1 : gx0; + float cy = (gr1 >= gr0) ? gy1 : gy0; + float rr = hb_max (gr0, gr1); + unsigned gs_idx = res->add_extgstate_smask (alpha_sh_id, + paint->sx (cx - rr), paint->sy (cy - rr), + paint->sx (2 * rr), paint->sy (2 * rr), + paint->get_precision ()); + body.append_str ("/GS"); + body.append_unsigned (gs_idx); + body.append_str (" gs\n"); + } + + body.append_str ("/SH"); + body.append_unsigned (sh_idx); + body.append_str (" sh\n"); +} + + +/* Encode a 16-bit big-endian unsigned value into buf. */ +static void +hb_pdf_encode_u16 (hb_vector_buf_t *buf, uint16_t v) +{ + char bytes[2] = {(char) (v >> 8), (char) (v & 0xFF)}; + buf->append_len (bytes, 2); +} + +/* Encode a coordinate as 16-bit value relative to Decode range. */ +static void +hb_pdf_encode_coord (hb_vector_buf_t *buf, + float val, float lo, float hi) +{ + float t = (val - lo) / (hi - lo); + t = hb_clamp (t, 0.f, 1.f); + hb_pdf_encode_u16 (buf, (uint16_t) (t * 65535.f + 0.5f)); +} + +/* Encode RGB from hb_color_t as 3 bytes. */ +static void +hb_pdf_encode_color_rgb (hb_vector_buf_t *buf, hb_color_t c) +{ + char rgb[3] = {(char) hb_color_get_red (c), + (char) hb_color_get_green (c), + (char) hb_color_get_blue (c)}; + buf->append_len (rgb, 3); +} + +/* Encode alpha from hb_color_t as 1 byte (gray). */ +static void +hb_pdf_encode_color_alpha (hb_vector_buf_t *buf, hb_color_t c) +{ + char a = (char) hb_color_get_alpha (c); + buf->append_len (&a, 1); +} + +/* Encode one Coons patch control point. */ +static void +hb_pdf_encode_point (hb_vector_buf_t *buf, + float x, float y, + float xlo, float xhi, + float ylo, float yhi) +{ + hb_pdf_encode_coord (buf, x, xlo, xhi); + hb_pdf_encode_coord (buf, y, ylo, yhi); +} + +/* Emit one Coons patch sector into the mesh stream(s). + * Splits large arcs into sub-patches of max 90°. + * If alpha_mesh is non-null, emits a parallel DeviceGray + * patch with the alpha channel. */ +static void +hb_pdf_add_sweep_patch (hb_vector_buf_t *mesh, + hb_vector_buf_t *alpha_mesh, + float cx, float cy, + float xlo, float xhi, float ylo, float yhi, + float a0, hb_color_t c0_in, + float a1, hb_color_t c1_in) +{ + const float R = 32767.f; + const float eps = 0.5f; + const float MAX_SECTOR = (float) M_PI / 2.f; + + int num_splits = (int) ceilf (fabsf (a1 - a0) / MAX_SECTOR); + if (num_splits < 1) num_splits = 1; + + for (int s = 0; s < num_splits; s++) + { + float k0 = (float) s / num_splits; + float k1 = (float) (s + 1) / num_splits; + float sa0 = a0 + k0 * (a1 - a0); + float sa1 = a0 + k1 * (a1 - a0); + hb_color_t sc0 = hb_color_lerp (c0_in, c1_in, k0); + hb_color_t sc1 = hb_color_lerp (c0_in, c1_in, k1); + + float da = sa1 - sa0; + float kappa = (4.f / 3.f) * tanf (da / 4.f); + + float cos0 = cosf (sa0), sin0 = sinf (sa0); + float cos1 = cosf (sa1), sin1 = sinf (sa1); + + float p0x = cx + eps * cos0, p0y = cy + eps * sin0; + float p3x = cx + R * cos0, p3y = cy + R * sin0; + float p6x = cx + R * cos1, p6y = cy + R * sin1; + float p9x = cx + eps * cos1, p9y = cy + eps * sin1; + + /* Edge 1: p0→p3, radial straight line. */ + float e1_1x = p0x + (p3x - p0x) / 3.f; + float e1_1y = p0y + (p3y - p0y) / 3.f; + float e1_2x = p0x + 2.f * (p3x - p0x) / 3.f; + float e1_2y = p0y + 2.f * (p3y - p0y) / 3.f; + + /* Edge 2: p3→p6, outer arc. */ + float e2_1x = p3x + kappa * R * (-sin0); + float e2_1y = p3y + kappa * R * ( cos0); + float e2_2x = p6x - kappa * R * (-sin1); + float e2_2y = p6y - kappa * R * ( cos1); + + /* Edge 3: p6→p9, radial straight line. */ + float e3_1x = p6x + (p9x - p6x) / 3.f; + float e3_1y = p6y + (p9y - p6y) / 3.f; + float e3_2x = p6x + 2.f * (p9x - p6x) / 3.f; + float e3_2y = p6y + 2.f * (p9y - p6y) / 3.f; + + /* Edge 4: p9→p0, inner arc. */ + float e4_1x = p9x + kappa * eps * (-sin1); + float e4_1y = p9y + kappa * eps * ( cos1); + float e4_2x = p0x - kappa * eps * (-sin0); + float e4_2y = p0y - kappa * eps * ( cos0); + + mesh->append_c ('\0'); /* flag = 0, new patch */ + + hb_pdf_encode_point (mesh, p0x, p0y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (mesh, e1_1x, e1_1y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (mesh, e1_2x, e1_2y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (mesh, p3x, p3y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (mesh, e2_1x, e2_1y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (mesh, e2_2x, e2_2y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (mesh, p6x, p6y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (mesh, e3_1x, e3_1y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (mesh, e3_2x, e3_2y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (mesh, p9x, p9y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (mesh, e4_1x, e4_1y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (mesh, e4_2x, e4_2y, xlo, xhi, ylo, yhi); + + hb_pdf_encode_color_rgb (mesh, sc0); /* inner start */ + hb_pdf_encode_color_rgb (mesh, sc0); /* outer start */ + hb_pdf_encode_color_rgb (mesh, sc1); /* outer end */ + hb_pdf_encode_color_rgb (mesh, sc1); /* inner end */ + + if (alpha_mesh) + { + alpha_mesh->append_c ('\0'); + + hb_pdf_encode_point (alpha_mesh, p0x, p0y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (alpha_mesh, e1_1x, e1_1y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (alpha_mesh, e1_2x, e1_2y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (alpha_mesh, p3x, p3y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (alpha_mesh, e2_1x, e2_1y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (alpha_mesh, e2_2x, e2_2y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (alpha_mesh, p6x, p6y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (alpha_mesh, e3_1x, e3_1y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (alpha_mesh, e3_2x, e3_2y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (alpha_mesh, p9x, p9y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (alpha_mesh, e4_1x, e4_1y, xlo, xhi, ylo, yhi); + hb_pdf_encode_point (alpha_mesh, e4_2x, e4_2y, xlo, xhi, ylo, yhi); + + hb_pdf_encode_color_alpha (alpha_mesh, sc0); + hb_pdf_encode_color_alpha (alpha_mesh, sc0); + hb_pdf_encode_color_alpha (alpha_mesh, sc1); + hb_pdf_encode_color_alpha (alpha_mesh, sc1); + } + } +} + +/* Callback context + trampoline for hb_paint_sweep_gradient_tiles. */ +struct hb_pdf_sweep_ctx_t { + hb_vector_buf_t *mesh; + hb_vector_buf_t *alpha_mesh; + float cx, cy, xlo, xhi, ylo, yhi; +}; + +static void +hb_pdf_sweep_emit_patch (float a0, hb_color_t c0, + float a1, hb_color_t c1, + void *user_data) +{ + auto *ctx = (hb_pdf_sweep_ctx_t *) user_data; + hb_pdf_add_sweep_patch (ctx->mesh, ctx->alpha_mesh, + ctx->cx, ctx->cy, + ctx->xlo, ctx->xhi, ctx->ylo, ctx->yhi, + a0, c0, a1, c1); +} + +static void +hb_pdf_paint_sweep_gradient (hb_paint_funcs_t *, + void *paint_data, + hb_color_line_t *color_line, + float cx, float cy, + float start_angle, + float end_angle, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + auto *res = hb_pdf_get_resources (paint); + if (unlikely (!res)) + return; + + /* Get and sort color stops. */ + if (!paint->fetch_color_stops (color_line)) + return; + hb_vector_t &stops = paint->color_stops_scratch; + stops.as_array ().qsort ( + [] (const hb_color_stop_t &a, const hb_color_stop_t &b) + { return a.offset < b.offset; }); + + hb_paint_extend_t extend = hb_color_line_get_extend (color_line); + + const float R = 32767.f; + float scx = paint->sx (cx), scy = paint->sy (cy); + float xlo = scx - R - 1, xhi = scx + R + 1; + float ylo = scy - R - 1, yhi = scy + R + 1; + + bool needs_alpha = hb_pdf_gradient_needs_alpha (stops); + + hb_vector_buf_t mesh; + hb_vector_buf_t alpha_mesh; + mesh.alloc (256); + if (needs_alpha) + alpha_mesh.alloc (256); + + hb_pdf_sweep_ctx_t ctx { &mesh, needs_alpha ? &alpha_mesh : nullptr, + scx, scy, xlo, xhi, ylo, yhi }; + hb_paint_sweep_gradient_tiles (stops.arrayZ, stops.length, extend, + start_angle, end_angle, + hb_pdf_sweep_emit_patch, &ctx); + + if (!mesh.length) + return; + + auto hb_pdf_build_mesh_shading = [&] (hb_vector_buf_t &m, + const char *cs, + const char *decode_suffix) -> unsigned + { + hb_vector_buf_t sh; + sh.append_str ("<< /ShadingType 6 /ColorSpace /"); + sh.append_str (cs); + sh.append_str ("\n/BitsPerCoordinate 16 /BitsPerComponent 8 /BitsPerFlag 8\n"); + sh.append_str ("/Decode ["); + sh.append_num (xlo, 2); + sh.append_c (' '); + sh.append_num (xhi, 2); + sh.append_c (' '); + sh.append_num (ylo, 2); + sh.append_c (' '); + sh.append_num (yhi, 2); + sh.append_str (decode_suffix); + sh.append_str ("]\n/Length "); + sh.append_unsigned (m.length); + sh.append_str (" >>\nstream\n"); + sh.append_len (m.arrayZ, m.length); + sh.append_str ("\nendstream"); + return res->add_object (std::move (sh)); + }; + + unsigned sh_obj_id = hb_pdf_build_mesh_shading (mesh, "DeviceRGB", + " 0 1 0 1 0 1"); + unsigned sh_idx = res->add_shading_by_id (sh_obj_id); + + auto &body = paint->current_body (); + + if (needs_alpha && alpha_mesh.length) + { + unsigned alpha_sh_id = hb_pdf_build_mesh_shading (alpha_mesh, "DeviceGray", + " 0 1"); + unsigned gs_idx = res->add_extgstate_smask (alpha_sh_id, + xlo, ylo, + xhi - xlo, yhi - ylo, + paint->get_precision ()); + body.append_str ("/GS"); + body.append_unsigned (gs_idx); + body.append_str (" gs\n"); + } + + body.append_str ("/SH"); + body.append_unsigned (sh_idx); + body.append_str (" sh\n"); +} + +static const char * +hb_pdf_blend_mode_name (hb_paint_composite_mode_t mode) +{ + switch (mode) + { + case HB_PAINT_COMPOSITE_MODE_MULTIPLY: return "Multiply"; + case HB_PAINT_COMPOSITE_MODE_SCREEN: return "Screen"; + case HB_PAINT_COMPOSITE_MODE_OVERLAY: return "Overlay"; + case HB_PAINT_COMPOSITE_MODE_DARKEN: return "Darken"; + case HB_PAINT_COMPOSITE_MODE_LIGHTEN: return "Lighten"; + case HB_PAINT_COMPOSITE_MODE_COLOR_DODGE: return "ColorDodge"; + case HB_PAINT_COMPOSITE_MODE_COLOR_BURN: return "ColorBurn"; + case HB_PAINT_COMPOSITE_MODE_HARD_LIGHT: return "HardLight"; + case HB_PAINT_COMPOSITE_MODE_SOFT_LIGHT: return "SoftLight"; + case HB_PAINT_COMPOSITE_MODE_DIFFERENCE: return "Difference"; + case HB_PAINT_COMPOSITE_MODE_EXCLUSION: return "Exclusion"; + case HB_PAINT_COMPOSITE_MODE_HSL_HUE: return "Hue"; + case HB_PAINT_COMPOSITE_MODE_HSL_SATURATION: return "Saturation"; + case HB_PAINT_COMPOSITE_MODE_HSL_COLOR: return "Color"; + case HB_PAINT_COMPOSITE_MODE_HSL_LUMINOSITY: return "Luminosity"; + /* Porter-Duff modes have no PDF blend-mode equivalent; approximate + * the two that have a plausible color-blend analog, and let the + * rest fall through to Normal (SRC_OVER). */ + case HB_PAINT_COMPOSITE_MODE_PLUS: return "Screen"; + case HB_PAINT_COMPOSITE_MODE_XOR: return "Difference"; + case HB_PAINT_COMPOSITE_MODE_CLEAR: + case HB_PAINT_COMPOSITE_MODE_SRC: + case HB_PAINT_COMPOSITE_MODE_DEST: + case HB_PAINT_COMPOSITE_MODE_SRC_OVER: + case HB_PAINT_COMPOSITE_MODE_DEST_OVER: + case HB_PAINT_COMPOSITE_MODE_SRC_IN: + case HB_PAINT_COMPOSITE_MODE_DEST_IN: + case HB_PAINT_COMPOSITE_MODE_SRC_OUT: + case HB_PAINT_COMPOSITE_MODE_DEST_OUT: + case HB_PAINT_COMPOSITE_MODE_SRC_ATOP: + case HB_PAINT_COMPOSITE_MODE_DEST_ATOP: + default: return nullptr; /* Normal */ + } +} + +static void +hb_pdf_paint_push_group (hb_paint_funcs_t *, + void *paint_data, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + paint->current_body ().append_str ("q\n"); +} + +static void +hb_pdf_paint_push_group_for (hb_paint_funcs_t *, + void *paint_data, + hb_paint_composite_mode_t mode, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + + auto &body = paint->current_body (); + body.append_str ("q\n"); + + const char *bm = hb_pdf_blend_mode_name (mode); + if (bm) + { + auto *res = hb_pdf_get_resources (paint); + if (likely (res)) + { + unsigned gs_idx = res->add_extgstate_blend (bm); + body.append_str ("/GS"); + body.append_unsigned (gs_idx); + body.append_str (" gs\n"); + } + } +} + +static void +hb_pdf_paint_pop_group (hb_paint_funcs_t *, + void *paint_data, + hb_paint_composite_mode_t mode HB_UNUSED, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + paint->current_body ().append_str ("Q\n"); +} + + +/* ---- lazy loader for paint funcs ---- */ + +static inline void free_static_pdf_paint_funcs (); + +static struct hb_pdf_paint_funcs_lazy_loader_t + : hb_paint_funcs_lazy_loader_t +{ + static hb_paint_funcs_t *create () + { + hb_paint_funcs_t *funcs = hb_paint_funcs_create (); + hb_paint_funcs_set_push_transform_func (funcs, (hb_paint_push_transform_func_t) hb_pdf_paint_push_transform, nullptr, nullptr); + hb_paint_funcs_set_pop_transform_func (funcs, (hb_paint_pop_transform_func_t) hb_pdf_paint_pop_transform, nullptr, nullptr); + hb_paint_funcs_set_push_clip_glyph_func (funcs, (hb_paint_push_clip_glyph_func_t) hb_pdf_paint_push_clip_glyph, nullptr, nullptr); + hb_paint_funcs_set_push_clip_rectangle_func (funcs, (hb_paint_push_clip_rectangle_func_t) hb_pdf_paint_push_clip_rectangle, nullptr, nullptr); + hb_paint_funcs_set_push_clip_path_start_func (funcs, (hb_paint_push_clip_path_start_func_t) hb_pdf_paint_push_clip_path_start, nullptr, nullptr); + hb_paint_funcs_set_push_clip_path_end_func (funcs, (hb_paint_push_clip_path_end_func_t) hb_pdf_paint_push_clip_path_end, nullptr, nullptr); + hb_paint_funcs_set_pop_clip_func (funcs, (hb_paint_pop_clip_func_t) hb_pdf_paint_pop_clip, nullptr, nullptr); + hb_paint_funcs_set_color_func (funcs, (hb_paint_color_func_t) hb_pdf_paint_color, nullptr, nullptr); + hb_paint_funcs_set_image_func (funcs, (hb_paint_image_func_t) hb_pdf_paint_image, nullptr, nullptr); + hb_paint_funcs_set_linear_gradient_func (funcs, (hb_paint_linear_gradient_func_t) hb_pdf_paint_linear_gradient, nullptr, nullptr); + hb_paint_funcs_set_radial_gradient_func (funcs, (hb_paint_radial_gradient_func_t) hb_pdf_paint_radial_gradient, nullptr, nullptr); + hb_paint_funcs_set_sweep_gradient_func (funcs, (hb_paint_sweep_gradient_func_t) hb_pdf_paint_sweep_gradient, nullptr, nullptr); + hb_paint_funcs_set_push_group_func (funcs, (hb_paint_push_group_func_t) hb_pdf_paint_push_group, nullptr, nullptr); + hb_paint_funcs_set_push_group_for_func (funcs, (hb_paint_push_group_for_func_t) hb_pdf_paint_push_group_for, nullptr, nullptr); + hb_paint_funcs_set_pop_group_func (funcs, (hb_paint_pop_group_func_t) hb_pdf_paint_pop_group, nullptr, nullptr); + hb_paint_funcs_make_immutable (funcs); + hb_atexit (free_static_pdf_paint_funcs); + return funcs; + } +} static_pdf_paint_funcs; + +static inline void +free_static_pdf_paint_funcs () +{ + static_pdf_paint_funcs.free_instance (); +} + +hb_paint_funcs_t * +hb_vector_paint_pdf_funcs_get () +{ + return static_pdf_paint_funcs.get_unconst (); +} + + +/* ---- render ---- */ + +hb_blob_t * +hb_vector_paint_render_pdf (hb_vector_paint_t *paint) +{ + if (!paint->has_extents) + return nullptr; + if (!paint->group_stack.length || + !paint->group_stack.arrayZ[0].length) + return nullptr; + + hb_vector_buf_t &content = paint->group_stack.arrayZ[0]; + hb_pdf_resources_t *res = hb_pdf_get_resources (paint); + + float ex = paint->extents.x; + float ey = paint->extents.y; + float ew = paint->extents.width; + float eh = paint->extents.height; + + unsigned num_extra = res ? res->objects.length : 0; + unsigned total_objects = 4 + num_extra; /* 1-based: 1..total_objects */ + + /* Build PDF. */ + hb_vector_buf_t out; + hb_buf_recover_recycled (paint->recycled_blob, &out); + out.alloc (content.length + num_extra * 128 + 1024); + + hb_vector_t offsets; + if (unlikely (!offsets.resize (total_objects))) + return nullptr; + + out.append_str ("%PDF-1.4\n%\xC0\xC1\xC2\xC3\n"); + + /* Object 1: Catalog */ + offsets.arrayZ[0] = out.length; + out.append_str ("1 0 obj\n<< /Type /Catalog /Pages 2 0 R >>\nendobj\n"); + + /* Object 2: Pages */ + offsets.arrayZ[1] = out.length; + out.append_str ("2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n"); + + /* Object 3: Page */ + offsets.arrayZ[2] = out.length; + out.append_str ("3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox ["); + out.append_num (ex); + out.append_c (' '); + out.append_num (-(ey + eh)); + out.append_c (' '); + out.append_num (ex + ew); + out.append_c (' '); + out.append_num (-ey); + out.append_str ("]\n/Contents 4 0 R"); + + /* Resources. */ + bool has_resources = res && + (res->extgstate_dict.length || res->shading_dict.length || res->xobject_dict.length); + if (has_resources) + { + out.append_str ("\n/Resources <<"); + if (res->extgstate_dict.length) + { + out.append_str (" /ExtGState << "); + out.append_len (res->extgstate_dict.arrayZ, res->extgstate_dict.length); + out.append_str (">>"); + } + if (res->shading_dict.length) + { + out.append_str (" /Shading << "); + out.append_len (res->shading_dict.arrayZ, res->shading_dict.length); + out.append_str (">>"); + } + if (res->xobject_dict.length) + { + out.append_str (" /XObject << "); + out.append_len (res->xobject_dict.arrayZ, res->xobject_dict.length); + out.append_str (">>"); + } + out.append_str (" >>"); + } + + out.append_str (" >>\nendobj\n"); + + /* Build content stream: optional background rect + glyph content. */ + hb_vector_buf_t bg_prefix; + if (hb_color_get_alpha (paint->background)) + { + float r = hb_color_get_red (paint->background) / 255.f; + float g = hb_color_get_green (paint->background) / 255.f; + float b = hb_color_get_blue (paint->background) / 255.f; + float a = hb_color_get_alpha (paint->background) / 255.f; + if (a < 1.f - 1.f / 512.f) + { + if (res) + { + unsigned gs_idx = res->add_extgstate_alpha (a); + bg_prefix.append_str ("/GS"); + bg_prefix.append_unsigned (gs_idx); + bg_prefix.append_str (" gs\n"); + } + } + bg_prefix.append_num (r, 4); + bg_prefix.append_c (' '); + bg_prefix.append_num (g, 4); + bg_prefix.append_c (' '); + bg_prefix.append_num (b, 4); + bg_prefix.append_str (" rg\n"); + bg_prefix.append_num (ex); + bg_prefix.append_c (' '); + bg_prefix.append_num (-(ey + eh)); + bg_prefix.append_c (' '); + bg_prefix.append_num (ew); + bg_prefix.append_c (' '); + bg_prefix.append_num (eh); + bg_prefix.append_str (" re f\n"); + } + unsigned stream_len = bg_prefix.length + content.length; + + /* Object 4: Content stream */ + offsets.arrayZ[3] = out.length; + out.append_str ("4 0 obj\n<< /Length "); + out.append_unsigned (stream_len); + out.append_str (" >>\nstream\n"); + out.append_len (bg_prefix.arrayZ, bg_prefix.length); + out.append_len (content.arrayZ, content.length); + out.append_str ("endstream\nendobj\n"); + + /* Extra objects (functions, shadings, ExtGState). */ + for (unsigned i = 0; i < num_extra; i++) + { + offsets.arrayZ[4 + i] = out.length; + out.append_unsigned (5 + i); + out.append_str (" 0 obj\n"); + auto &obj = res->objects.arrayZ[i]; + out.append_len (obj.data.arrayZ, obj.data.length); + out.append_str ("\nendobj\n"); + } + + /* Cross-reference table */ + unsigned xref_offset = out.length; + out.append_str ("xref\n0 "); + out.append_unsigned (total_objects + 1); + out.append_str ("\n0000000000 65535 f \n"); + for (unsigned i = 0; i < total_objects; i++) + { + char tmp[21]; + snprintf (tmp, sizeof (tmp), "%010u 00000 n \n", offsets.arrayZ[i]); + out.append_len (tmp, 20); + } + + /* Trailer */ + out.append_str ("trailer\n<< /Size "); + out.append_unsigned (total_objects + 1); + out.append_str (" /Root 1 0 R >>\nstartxref\n"); + out.append_unsigned (xref_offset); + out.append_str ("\n%%EOF\n"); + + hb_blob_t *blob = hb_buf_blob_from (&paint->recycled_blob, &out); + + hb_vector_paint_clear (paint); + + return blob; +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-paint-svg.cc b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-paint-svg.cc new file mode 100644 index 0000000000..eca53e39a6 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-paint-svg.cc @@ -0,0 +1,941 @@ +/* + * Copyright © 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Author(s): Behdad Esfahbod + */ + +#include "hb.hh" + +#include "hb-vector-paint.hh" +#include "hb-paint.hh" +#include "hb-vector-path.hh" + +#include + +static const char * +hb_vector_svg_extend_mode_str (hb_paint_extend_t ext) +{ + switch (ext) + { + case HB_PAINT_EXTEND_PAD: return "pad"; + case HB_PAINT_EXTEND_REPEAT: return "repeat"; + case HB_PAINT_EXTEND_REFLECT: return "reflect"; + default: return "pad"; + } +} + +static void +hb_vector_svg_emit_color_stops (hb_vector_paint_t *paint, + hb_vector_buf_t *buf, + hb_vector_t *stops) +{ + for (unsigned i = 0; i < stops->length; i++) + { + hb_color_t c = stops->arrayZ[i].color; + buf->append_str ("append_num (stops->arrayZ[i].offset, 4); + buf->append_str ("\" stop-color=\"rgb("); + buf->append_unsigned (hb_color_get_red (c)); + buf->append_c (','); + buf->append_unsigned (hb_color_get_green (c)); + buf->append_c (','); + buf->append_unsigned (hb_color_get_blue (c)); + buf->append_str (")\""); + if (hb_color_get_alpha (c) != 255) + { + buf->append_str (" stop-opacity=\""); + buf->append_num (hb_color_get_alpha (c) / 255.f, 4); + buf->append_c ('"'); + } + buf->append_str ("/>\n"); + } +} + +static const char * +hb_vector_svg_composite_mode_str (hb_paint_composite_mode_t mode) +{ + switch (mode) + { + /* Porter-Duff modes have no SVG mix-blend-mode equivalent; + * approximate the two that have a plausible color-blend analog, + * and let the rest fall through to normal (SRC_OVER). */ + case HB_PAINT_COMPOSITE_MODE_PLUS: return "screen"; + case HB_PAINT_COMPOSITE_MODE_XOR: return "difference"; + case HB_PAINT_COMPOSITE_MODE_CLEAR: + case HB_PAINT_COMPOSITE_MODE_SRC: + case HB_PAINT_COMPOSITE_MODE_DEST: + case HB_PAINT_COMPOSITE_MODE_DEST_OVER: + case HB_PAINT_COMPOSITE_MODE_SRC_IN: + case HB_PAINT_COMPOSITE_MODE_DEST_IN: + case HB_PAINT_COMPOSITE_MODE_SRC_OUT: + case HB_PAINT_COMPOSITE_MODE_DEST_OUT: + case HB_PAINT_COMPOSITE_MODE_SRC_ATOP: + case HB_PAINT_COMPOSITE_MODE_DEST_ATOP: + return nullptr; + case HB_PAINT_COMPOSITE_MODE_SRC_OVER: return "normal"; + case HB_PAINT_COMPOSITE_MODE_SCREEN: return "screen"; + case HB_PAINT_COMPOSITE_MODE_OVERLAY: return "overlay"; + case HB_PAINT_COMPOSITE_MODE_DARKEN: return "darken"; + case HB_PAINT_COMPOSITE_MODE_LIGHTEN: return "lighten"; + case HB_PAINT_COMPOSITE_MODE_COLOR_DODGE: return "color-dodge"; + case HB_PAINT_COMPOSITE_MODE_COLOR_BURN: return "color-burn"; + case HB_PAINT_COMPOSITE_MODE_HARD_LIGHT: return "hard-light"; + case HB_PAINT_COMPOSITE_MODE_SOFT_LIGHT: return "soft-light"; + case HB_PAINT_COMPOSITE_MODE_DIFFERENCE: return "difference"; + case HB_PAINT_COMPOSITE_MODE_EXCLUSION: return "exclusion"; + case HB_PAINT_COMPOSITE_MODE_MULTIPLY: return "multiply"; + case HB_PAINT_COMPOSITE_MODE_HSL_HUE: return "hue"; + case HB_PAINT_COMPOSITE_MODE_HSL_SATURATION: return "saturation"; + case HB_PAINT_COMPOSITE_MODE_HSL_COLOR: return "color"; + case HB_PAINT_COMPOSITE_MODE_HSL_LUMINOSITY: return "luminosity"; + default: return nullptr; + } +} + +struct hb_vector_svg_point_t { float x, y; }; +struct hb_vector_svg_rgba_t { float r, g, b, a; }; + +static inline float +hb_vector_svg_lerp (float a, float b, float t) +{ return a + (b - a) * t; } + +static inline float +hb_vector_svg_clamp01 (float v) +{ + if (v < 0.f) return 0.f; + if (v > 1.f) return 1.f; + return v; +} + +static inline hb_vector_svg_rgba_t +hb_vector_svg_rgba_from_hb_color (hb_color_t c) +{ + return {(float) hb_color_get_red (c) / 255.f, + (float) hb_color_get_green (c) / 255.f, + (float) hb_color_get_blue (c) / 255.f, + (float) hb_color_get_alpha (c) / 255.f}; +} + +static inline hb_color_t +hb_vector_svg_hb_color_from_rgba (const hb_vector_svg_rgba_t &c) +{ + unsigned r = (unsigned) roundf (hb_vector_svg_clamp01 (c.r) * 255.f); + unsigned g = (unsigned) roundf (hb_vector_svg_clamp01 (c.g) * 255.f); + unsigned b = (unsigned) roundf (hb_vector_svg_clamp01 (c.b) * 255.f); + unsigned a = (unsigned) roundf (hb_vector_svg_clamp01 (c.a) * 255.f); + return HB_COLOR (b, g, r, a); +} + +static inline hb_vector_svg_rgba_t +hb_vector_svg_lerp_rgba (const hb_vector_svg_rgba_t &c0, + const hb_vector_svg_rgba_t &c1, + float t) +{ + return {hb_vector_svg_lerp (c0.r, c1.r, t), + hb_vector_svg_lerp (c0.g, c1.g, t), + hb_vector_svg_lerp (c0.b, c1.b, t), + hb_vector_svg_lerp (c0.a, c1.a, t)}; +} + +static inline float hb_vector_svg_dot (const hb_vector_svg_point_t &p, const hb_vector_svg_point_t &q) { return p.x * q.x + p.y * q.y; } +static inline hb_vector_svg_point_t hb_vector_svg_add (const hb_vector_svg_point_t &p, const hb_vector_svg_point_t &q) { return {p.x + q.x, p.y + q.y}; } +static inline hb_vector_svg_point_t hb_vector_svg_sub (const hb_vector_svg_point_t &p, const hb_vector_svg_point_t &q) { return {p.x - q.x, p.y - q.y}; } +static inline hb_vector_svg_point_t hb_vector_svg_scale (const hb_vector_svg_point_t &p, float f) { return {p.x * f, p.y * f}; } + +static inline hb_vector_svg_point_t +hb_vector_svg_normalize (const hb_vector_svg_point_t &p) +{ + float len = sqrtf (hb_vector_svg_dot (p, p)); + if (len == 0.f) return {0.f, 0.f}; + return hb_vector_svg_scale (p, 1.f / len); +} + +static void +hb_vector_svg_add_sweep_patch (hb_vector_buf_t *body, + unsigned precision, + float cx, float cy, float radius, + float a0, const hb_vector_svg_rgba_t &c0_in, + float a1, const hb_vector_svg_rgba_t &c1_in) +{ + static const float max_angle = HB_PI / 16.f; + hb_vector_svg_point_t center = {cx, cy}; + int num_splits = (int) ceilf (fabsf (a1 - a0) / max_angle); + if (num_splits < 1) num_splits = 1; + + hb_vector_svg_point_t p0 = {cosf (a0), sinf (a0)}; + hb_vector_svg_rgba_t color0 = c0_in; + + for (int a = 0; a < num_splits; a++) + { + float k = (a + 1.f) / num_splits; + float angle1 = hb_vector_svg_lerp (a0, a1, k); + hb_vector_svg_rgba_t color1 = hb_vector_svg_lerp_rgba (c0_in, c1_in, k); + + hb_vector_svg_point_t p1 = {cosf (angle1), sinf (angle1)}; + hb_vector_svg_point_t sp0 = hb_vector_svg_add (center, hb_vector_svg_scale (p0, radius)); + hb_vector_svg_point_t sp1 = hb_vector_svg_add (center, hb_vector_svg_scale (p1, radius)); + + hb_vector_svg_point_t A = hb_vector_svg_normalize (hb_vector_svg_add (p0, p1)); + hb_vector_svg_point_t U = {-A.y, A.x}; + float up0 = hb_vector_svg_dot (U, p0); + float up1 = hb_vector_svg_dot (U, p1); + if (fabsf (up0) < 1e-6f || fabsf (up1) < 1e-6f) + { + p0 = p1; + color0 = color1; + continue; + } + hb_vector_svg_point_t C0 = hb_vector_svg_add (A, hb_vector_svg_scale (U, hb_vector_svg_dot (hb_vector_svg_sub (p0, A), p0) / up0)); + hb_vector_svg_point_t C1 = hb_vector_svg_add (A, hb_vector_svg_scale (U, hb_vector_svg_dot (hb_vector_svg_sub (p1, A), p1) / up1)); + + hb_vector_svg_point_t sc0 = hb_vector_svg_add (center, hb_vector_svg_scale (hb_vector_svg_add (C0, hb_vector_svg_scale (hb_vector_svg_sub (C0, p0), 0.33333f)), radius)); + hb_vector_svg_point_t sc1 = hb_vector_svg_add (center, hb_vector_svg_scale (hb_vector_svg_add (C1, hb_vector_svg_scale (hb_vector_svg_sub (C1, p1), 0.33333f)), radius)); + + hb_vector_svg_rgba_t mid_color = hb_vector_svg_lerp_rgba (color0, color1, 0.5f); + hb_color_t mid = hb_vector_svg_hb_color_from_rgba (mid_color); + + body->append_str ("append_num (center.x, precision); + body->append_c (','); + body->append_num (center.y, precision); + body->append_str ("L"); + body->append_num (sp0.x, precision); + body->append_c (','); + body->append_num (sp0.y, precision); + body->append_str ("C"); + body->append_num (sc0.x, precision); + body->append_c (','); + body->append_num (sc0.y, precision); + body->append_c (' '); + body->append_num (sc1.x, precision); + body->append_c (','); + body->append_num (sc1.y, precision); + body->append_c (' '); + body->append_num (sp1.x, precision); + body->append_c (','); + body->append_num (sp1.y, precision); + body->append_str ("Z\" fill=\""); + body->append_svg_color (mid, true); + body->append_str ("\"/>\n"); + + p0 = p1; + color0 = color1; + } +} + +/* Callback context + trampoline for hb_paint_sweep_gradient_tiles. */ +struct hb_vector_svg_sweep_ctx_t +{ + hb_vector_buf_t *body; + unsigned precision; + float cx, cy, radius; +}; + +static void +hb_vector_svg_sweep_emit_patch (float a0, hb_color_t c0, + float a1, hb_color_t c1, + void *user_data) +{ + auto *ctx = (hb_vector_svg_sweep_ctx_t *) user_data; + hb_vector_svg_add_sweep_patch (ctx->body, ctx->precision, + ctx->cx, ctx->cy, ctx->radius, + a0, hb_vector_svg_rgba_from_hb_color (c0), + a1, hb_vector_svg_rgba_from_hb_color (c1)); +} + + +static void hb_vector_paint_push_transform (hb_paint_funcs_t *, void *, + float, float, float, float, float, float, + void *); +static void hb_vector_paint_pop_transform (hb_paint_funcs_t *, void *, void *); +static void hb_vector_paint_push_clip_glyph (hb_paint_funcs_t *, void *, hb_codepoint_t, hb_font_t *, void *); +static void hb_vector_paint_push_clip_rectangle (hb_paint_funcs_t *, void *, float, float, float, float, void *); +static hb_draw_funcs_t * hb_vector_paint_push_clip_path_start (hb_paint_funcs_t *, void *, void **, void *); +static void hb_vector_paint_push_clip_path_end (hb_paint_funcs_t *, void *, void *); +static void hb_vector_paint_pop_clip (hb_paint_funcs_t *, void *, void *); +static void hb_vector_paint_color (hb_paint_funcs_t *, void *, hb_bool_t, hb_color_t, void *); +static hb_bool_t hb_vector_paint_image (hb_paint_funcs_t *, void *, hb_blob_t *, unsigned, unsigned, hb_tag_t, float, hb_glyph_extents_t *, void *); +static void hb_vector_paint_linear_gradient (hb_paint_funcs_t *, void *, hb_color_line_t *, float, float, float, float, float, float, void *); +static void hb_vector_paint_radial_gradient (hb_paint_funcs_t *, void *, hb_color_line_t *, float, float, float, float, float, float, void *); +static void hb_vector_paint_sweep_gradient (hb_paint_funcs_t *, void *, hb_color_line_t *, float, float, float, float, void *); +static void hb_vector_paint_push_group (hb_paint_funcs_t *, void *, void *); +static void hb_vector_paint_pop_group (hb_paint_funcs_t *, void *, hb_paint_composite_mode_t, void *); +static hb_bool_t hb_vector_paint_color_glyph (hb_paint_funcs_t *, void *, hb_codepoint_t, hb_font_t *, void *); +static hb_bool_t +hb_vector_paint_custom_palette_color (hb_paint_funcs_t *pfuncs HB_UNUSED, + void *paint_data, + unsigned color_index, + hb_color_t *color, + void *user_data HB_UNUSED) +{ + hb_vector_paint_t *paint = (hb_vector_paint_t *) paint_data; + if (!color) + return false; + + hb_color_t *value = nullptr; + if (!paint->custom_palette_colors.has (color_index, &value) || !value) + return false; + *color = *value; + return true; +} + +static inline void free_static_vector_paint_funcs (); +static struct hb_vector_paint_funcs_lazy_loader_t + : hb_paint_funcs_lazy_loader_t +{ + static hb_paint_funcs_t *create () + { + hb_paint_funcs_t *funcs = hb_paint_funcs_create (); + hb_paint_funcs_set_push_transform_func (funcs, (hb_paint_push_transform_func_t) hb_vector_paint_push_transform, nullptr, nullptr); + hb_paint_funcs_set_pop_transform_func (funcs, (hb_paint_pop_transform_func_t) hb_vector_paint_pop_transform, nullptr, nullptr); + hb_paint_funcs_set_push_clip_glyph_func (funcs, (hb_paint_push_clip_glyph_func_t) hb_vector_paint_push_clip_glyph, nullptr, nullptr); + hb_paint_funcs_set_push_clip_rectangle_func (funcs, (hb_paint_push_clip_rectangle_func_t) hb_vector_paint_push_clip_rectangle, nullptr, nullptr); + hb_paint_funcs_set_push_clip_path_start_func (funcs, (hb_paint_push_clip_path_start_func_t) hb_vector_paint_push_clip_path_start, nullptr, nullptr); + hb_paint_funcs_set_push_clip_path_end_func (funcs, (hb_paint_push_clip_path_end_func_t) hb_vector_paint_push_clip_path_end, nullptr, nullptr); + hb_paint_funcs_set_pop_clip_func (funcs, (hb_paint_pop_clip_func_t) hb_vector_paint_pop_clip, nullptr, nullptr); + hb_paint_funcs_set_color_func (funcs, (hb_paint_color_func_t) hb_vector_paint_color, nullptr, nullptr); + hb_paint_funcs_set_image_func (funcs, (hb_paint_image_func_t) hb_vector_paint_image, nullptr, nullptr); + hb_paint_funcs_set_linear_gradient_func (funcs, (hb_paint_linear_gradient_func_t) hb_vector_paint_linear_gradient, nullptr, nullptr); + hb_paint_funcs_set_radial_gradient_func (funcs, (hb_paint_radial_gradient_func_t) hb_vector_paint_radial_gradient, nullptr, nullptr); + hb_paint_funcs_set_sweep_gradient_func (funcs, (hb_paint_sweep_gradient_func_t) hb_vector_paint_sweep_gradient, nullptr, nullptr); + hb_paint_funcs_set_push_group_func (funcs, (hb_paint_push_group_func_t) hb_vector_paint_push_group, nullptr, nullptr); + hb_paint_funcs_set_pop_group_func (funcs, (hb_paint_pop_group_func_t) hb_vector_paint_pop_group, nullptr, nullptr); + hb_paint_funcs_set_color_glyph_func (funcs, (hb_paint_color_glyph_func_t) hb_vector_paint_color_glyph, nullptr, nullptr); + hb_paint_funcs_set_custom_palette_color_func (funcs, (hb_paint_custom_palette_color_func_t) hb_vector_paint_custom_palette_color, nullptr, nullptr); + hb_paint_funcs_make_immutable (funcs); + hb_atexit (free_static_vector_paint_funcs); + return funcs; + } +} static_vector_paint_funcs; + +static inline void +free_static_vector_paint_funcs () +{ + static_vector_paint_funcs.free_instance (); +} + +hb_paint_funcs_t * +hb_vector_paint_svg_funcs_get () +{ + return static_vector_paint_funcs.get_unconst (); +} + + +static void +hb_vector_paint_push_transform (hb_paint_funcs_t *, + void *paint_data, + float xx, float yx, + float xy, float yy, + float dx, float dy, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + + if (unlikely (paint->transform_group_overflow_depth)) + { + paint->transform_group_overflow_depth++; + return; + } + if (unlikely (paint->transform_group_depth >= 64)) + { + paint->transform_group_overflow_depth = 1; + return; + } + + hb_bool_t opened = + !(fabsf (xx - 1.f) < 1e-6f && fabsf (yx) < 1e-6f && + fabsf (xy) < 1e-6f && fabsf (yy - 1.f) < 1e-6f && + fabsf (paint->sx (dx)) < 1e-6f && fabsf (paint->sy (dy)) < 1e-6f); + paint->transform_group_open_mask = (paint->transform_group_open_mask << 1) | (opened ? 1ull : 0ull); + paint->transform_group_depth++; + + if (!opened) + return; + + auto &body = paint->current_body (); + unsigned sprec = paint->defs.scale_precision (); + body.append_str ("sx (dx)); + body.append_c (','); + body.append_num (paint->sy (dy)); + body.append_str (")\">\n"); +} + +static void +hb_vector_paint_pop_transform (hb_paint_funcs_t *, + void *paint_data, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + if (unlikely (paint->transform_group_overflow_depth)) + { + paint->transform_group_overflow_depth--; + return; + } + if (!paint->transform_group_depth) + return; + paint->transform_group_depth--; + hb_bool_t opened = !!(paint->transform_group_open_mask & 1ull); + paint->transform_group_open_mask >>= 1; + if (opened) + paint->current_body ().append_str ("\n"); +} + +static void +hb_vector_paint_push_clip_glyph (hb_paint_funcs_t *, + void *paint_data, + hb_codepoint_t glyph, + hb_font_t *font, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + + const char *pfx = paint->id_prefix; + unsigned pfx_len = paint->id_prefix_length; + + paint->path.clear (); + { + hb_vector_path_sink_t sink = {&paint->path, paint->get_precision (), + paint->x_scale_factor, paint->y_scale_factor}; + hb_font_draw_glyph (font, glyph, hb_vector_svg_path_draw_funcs_get (), &sink); + } + + unsigned def_id = paint->path_def_count++; + paint->defs.append_str ("defs.append_len (pfx, pfx_len); + paint->defs.append_c ('p'); + paint->defs.append_unsigned (def_id); + paint->defs.append_str ("\" d=\""); + paint->defs.append_len (paint->path.arrayZ, paint->path.length); + paint->defs.append_str ("\"/>\n"); + paint->defs.append_str ("defs.append_len (pfx, pfx_len); + paint->defs.append_str ("clip-p"); + paint->defs.append_unsigned (def_id); + paint->defs.append_str ("\">defs.append_len (pfx, pfx_len); + paint->defs.append_c ('p'); + paint->defs.append_unsigned (def_id); + paint->defs.append_str ("\"/>\n"); + + paint->current_body ().append_str ("current_body ().append_len (pfx, pfx_len); + paint->current_body ().append_str ("clip-p"); + paint->current_body ().append_unsigned (def_id); + paint->current_body ().append_str (")\">\n"); +} + +static void +hb_vector_paint_push_clip_rectangle (hb_paint_funcs_t *, + void *paint_data, + float xmin, float ymin, + float xmax, float ymax, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + + const char *pfx = paint->id_prefix; + unsigned pfx_len = paint->id_prefix_length; + unsigned clip_id = paint->clip_rect_counter++; + paint->defs.append_str ("defs.append_len (pfx, pfx_len); + paint->defs.append_c ('c'); + paint->defs.append_unsigned (clip_id); + paint->defs.append_str ("\">defs.append_num (paint->sx (xmin)); + paint->defs.append_str ("\" y=\""); + paint->defs.append_num (paint->sy (ymin)); + paint->defs.append_str ("\" width=\""); + paint->defs.append_num (paint->sx (xmax - xmin)); + paint->defs.append_str ("\" height=\""); + paint->defs.append_num (paint->sy (ymax - ymin)); + paint->defs.append_str ("\"/>\n"); + + paint->current_body ().append_str ("current_body ().append_len (pfx, pfx_len); + paint->current_body ().append_c ('c'); + paint->current_body ().append_unsigned (clip_id); + paint->current_body ().append_str (")\">\n"); +} + +static hb_draw_funcs_t * +hb_vector_paint_push_clip_path_start (hb_paint_funcs_t *, + void *paint_data, + void **draw_data, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + { + *draw_data = nullptr; + return nullptr; + } + + paint->path.clear (); + paint->clip_path_sink = {&paint->path, paint->get_precision (), + paint->x_scale_factor, + paint->y_scale_factor}; + *draw_data = &paint->clip_path_sink; + return hb_vector_svg_path_draw_funcs_get (); +} + +static void +hb_vector_paint_push_clip_path_end (hb_paint_funcs_t *, + void *paint_data, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + + const char *pfx = paint->id_prefix; + unsigned pfx_len = paint->id_prefix_length; + unsigned clip_id = paint->clip_path_counter++; + + /* The accumulated path is in font Y-up coords (the + * convention used inside per-glyph + * wrappers); this clip is emitted at base body level + * (free-form between glyphs), so flip its geometry inside + * the clipPath via the path's own transform attribute, + * keeping the body's at body Y-down. */ + paint->defs.append_str ("defs.append_len (pfx, pfx_len); + paint->defs.append_str ("cp"); + paint->defs.append_unsigned (clip_id); + paint->defs.append_str ("\">defs.append_len (paint->path.arrayZ, paint->path.length); + paint->defs.append_str ("\"/>\n"); + + paint->current_body ().append_str ("current_body ().append_len (pfx, pfx_len); + paint->current_body ().append_str ("cp"); + paint->current_body ().append_unsigned (clip_id); + paint->current_body ().append_str (")\">\n"); +} + +static void +hb_vector_paint_pop_clip (hb_paint_funcs_t *, + void *paint_data, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + paint->current_body ().append_str ("\n"); +} + +static void +hb_vector_paint_color (hb_paint_funcs_t *, + void *paint_data, + hb_bool_t, + hb_color_t color, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + + auto &body = paint->current_body (); + body.append_str ("\n"); +} + +static hb_bool_t +hb_vector_paint_image (hb_paint_funcs_t *, + void *paint_data, + hb_blob_t *image, + unsigned width, + unsigned height, + hb_tag_t format, + float slant HB_UNUSED, + hb_glyph_extents_t *extents, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return false; + + auto &body = paint->current_body (); + if (format == HB_TAG ('p','n','g',' ')) + { + if (!extents || !width || !height) + return false; + + unsigned len = 0; + const char *png_data = hb_blob_get_data (image, &len); + if (!png_data || !len) + return false; + + body.append_str ("sx ((float) extents->x_bearing)); + body.append_c (','); + body.append_num (paint->sy ((float) extents->y_bearing)); + body.append_str (") scale("); + body.append_num (paint->sx ((float) extents->width) / width); + body.append_c (','); + body.append_num (paint->sy ((float) extents->height) / height); + body.append_str (")\">\n"); + + body.append_str ("\n\n"); + + return true; + } + + return false; +} + +static void +hb_vector_paint_linear_gradient (hb_paint_funcs_t *, + void *paint_data, + hb_color_line_t *color_line, + float x0, float y0, + float x1, float y1, + float x2, float y2, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + + if (!paint->fetch_color_stops (color_line)) + return; + hb_vector_t &stops = paint->color_stops_scratch; + + /* Sort + rescale stops to [0, 1]; shift the gradient axis + * by the original (mn, mx) so the visible gradient stays + * put. SVG requires offsets in [0,1]; + * out-of-range stops would otherwise be silently clamped. */ + float mn, mx; + hb_paint_normalize_color_line (stops.arrayZ, stops.length, &mn, &mx); + + const char *pfx = paint->id_prefix; + unsigned pfx_len = paint->id_prefix_length; + unsigned grad_id = paint->gradient_counter++; + + /* Reduce COLR's 3-anchor (P0, P1, P2) to SVG's 2-point + * (start, end) gradient. */ + float lx0, ly0, lx1, ly1; + hb_paint_reduce_linear_anchors (x0, y0, x1, y1, x2, y2, + &lx0, &ly0, &lx1, &ly1); + float gx0 = lx0 + mn * (lx1 - lx0); + float gy0 = ly0 + mn * (ly1 - ly0); + float gx1 = lx0 + mx * (lx1 - lx0); + float gy1 = ly0 + mx * (ly1 - ly0); + + paint->defs.append_str ("defs.append_len (pfx, pfx_len); + paint->defs.append_str ("gr"); + paint->defs.append_unsigned (grad_id); + paint->defs.append_str ("\" gradientUnits=\"userSpaceOnUse\" x1=\""); + paint->defs.append_num (paint->sx (gx0)); + paint->defs.append_str ("\" y1=\""); + paint->defs.append_num (paint->sy (gy0)); + paint->defs.append_str ("\" x2=\""); + paint->defs.append_num (paint->sx (gx1)); + paint->defs.append_str ("\" y2=\""); + paint->defs.append_num (paint->sy (gy1)); + paint->defs.append_str ("\" spreadMethod=\""); + paint->defs.append_str (hb_vector_svg_extend_mode_str (hb_color_line_get_extend (color_line))); + paint->defs.append_str ("\">\n"); + hb_vector_svg_emit_color_stops (paint, &paint->defs, &stops); + paint->defs.append_str ("\n"); + + paint->current_body ().append_str ( + "current_body ().append_len (pfx, pfx_len); + paint->current_body ().append_str ("gr"); + paint->current_body ().append_unsigned (grad_id); + paint->current_body ().append_str (")\"/>\n"); +} + +static void +hb_vector_paint_radial_gradient (hb_paint_funcs_t *, + void *paint_data, + hb_color_line_t *color_line, + float x0, float y0, float r0, + float x1, float y1, float r1, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + + if (!paint->fetch_color_stops (color_line)) + return; + hb_vector_t &stops = paint->color_stops_scratch; + + float mn, mx; + hb_paint_normalize_color_line (stops.arrayZ, stops.length, &mn, &mx); + + /* Shift centers + radii by (mn, mx) along the gradient axis + * to compensate for rescaling stops to [0, 1]. */ + float gx0 = x0 + mn * (x1 - x0); + float gy0 = y0 + mn * (y1 - y0); + float gr0 = r0 + mn * (r1 - r0); + float gx1 = x0 + mx * (x1 - x0); + float gy1 = y0 + mx * (y1 - y0); + float gr1 = r0 + mx * (r1 - r0); + + const char *pfx = paint->id_prefix; + unsigned pfx_len = paint->id_prefix_length; + unsigned grad_id = paint->gradient_counter++; + + paint->defs.append_str ("defs.append_len (pfx, pfx_len); + paint->defs.append_str ("gr"); + paint->defs.append_unsigned (grad_id); + paint->defs.append_str ("\" gradientUnits=\"userSpaceOnUse\" cx=\""); + paint->defs.append_num (paint->sx (gx1)); + paint->defs.append_str ("\" cy=\""); + paint->defs.append_num (paint->sy (gy1)); + paint->defs.append_str ("\" r=\""); + paint->defs.append_num (paint->sx (gr1)); + paint->defs.append_str ("\" fx=\""); + paint->defs.append_num (paint->sx (gx0)); + paint->defs.append_str ("\" fy=\""); + paint->defs.append_num (paint->sy (gy0)); + if (gr0 > 0) + { + paint->defs.append_str ("\" fr=\""); + paint->defs.append_num (paint->sx (gr0)); + } + paint->defs.append_str ("\" spreadMethod=\""); + paint->defs.append_str (hb_vector_svg_extend_mode_str (hb_color_line_get_extend (color_line))); + paint->defs.append_str ("\">\n"); + hb_vector_svg_emit_color_stops (paint, &paint->defs, &stops); + paint->defs.append_str ("\n"); + + paint->current_body ().append_str ( + "current_body ().append_len (pfx, pfx_len); + paint->current_body ().append_str ("gr"); + paint->current_body ().append_unsigned (grad_id); + paint->current_body ().append_str (")\"/>\n"); +} + +static void +hb_vector_paint_sweep_gradient (hb_paint_funcs_t *, + void *paint_data, + hb_color_line_t *color_line, + float cx, float cy, + float start_angle, float end_angle, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + + if (!paint->fetch_color_stops (color_line)) + return; + hb_vector_t &stops = paint->color_stops_scratch; + + float mn, mx; + hb_paint_normalize_color_line (stops.arrayZ, stops.length, &mn, &mx); + + /* Shift the angle range to compensate for rescaling stops + * to [0, 1]. */ + float ga0 = start_angle + mn * (end_angle - start_angle); + float ga1 = start_angle + mx * (end_angle - start_angle); + + hb_vector_svg_sweep_ctx_t ctx { + &paint->current_body (), paint->get_precision (), paint->sx (cx), paint->sy (cy), 32767.f + }; + hb_paint_sweep_gradient_tiles (stops.arrayZ, stops.length, + hb_color_line_get_extend (color_line), + ga0, ga1, + hb_vector_svg_sweep_emit_patch, + &ctx); +} + +static void +hb_vector_paint_push_group (hb_paint_funcs_t *, + void *paint_data, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + if (unlikely (!paint->group_stack.push_or_fail (hb_vector_buf_t {}))) + return; +} + +static void +hb_vector_paint_pop_group (hb_paint_funcs_t *, + void *paint_data, + hb_paint_composite_mode_t mode, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return; + if (paint->group_stack.length < 2) + return; + + hb_vector_buf_t group = paint->group_stack.pop (); + auto &body = paint->current_body (); + + const char *blend = hb_vector_svg_composite_mode_str (mode); + if (blend) + { + body.append_str ("\n"); + body.append_len (group.arrayZ, group.length); + body.append_str ("\n"); + } + else + body.append_len (group.arrayZ, group.length); +} + +static hb_bool_t +hb_vector_paint_color_glyph (hb_paint_funcs_t *, + void *paint_data, + hb_codepoint_t glyph, + hb_font_t *font, + void *) +{ + auto *paint = (hb_vector_paint_t *) paint_data; + if (unlikely (!paint->ensure_initialized ())) + return false; + if (unlikely (paint->color_glyph_depth >= HB_MAX_NESTING_LEVEL)) + return false; + if (unlikely (hb_set_has (paint->active_color_glyphs, glyph))) + return false; + + paint->color_glyph_depth++; + hb_set_add (paint->active_color_glyphs, glyph); + + hb_font_paint_glyph (font, glyph, + hb_vector_paint_svg_funcs_get (), + paint, + paint->palette, + paint->foreground); + hb_set_del (paint->active_color_glyphs, glyph); + paint->color_glyph_depth--; + return true; +} + + + + +hb_blob_t * +hb_vector_paint_render_svg (hb_vector_paint_t *paint) +{ + if (!paint->has_extents) + return nullptr; + + if (unlikely (!paint->ensure_initialized ())) + return nullptr; + + hb_vector_buf_t out; + hb_buf_recover_recycled (paint->recycled_blob, &out); + unsigned estimated = paint->defs.length + + paint->group_stack.arrayZ[0].length + + 320; + out.alloc (estimated); + float vb_x = paint->extents.x; + float vb_y = -(paint->extents.y + paint->extents.height); + float vb_w = paint->extents.width; + float vb_h = paint->extents.height; + out.append_str ("\n"); + + if (paint->defs.length) + { + out.append_str ("\n"); + out.append_len (paint->defs.arrayZ, paint->defs.length); + out.append_str ("\n"); + } + + if (hb_color_get_alpha (paint->background)) + { + out.append_str ("background)); + out.append_c (','); + out.append_unsigned (hb_color_get_green (paint->background)); + out.append_c (','); + out.append_unsigned (hb_color_get_blue (paint->background)); + out.append_str (")\""); + if (hb_color_get_alpha (paint->background) < 255) + { + out.append_str (" fill-opacity=\""); + out.append_num (hb_color_get_alpha (paint->background) / 255.f, 4); + out.append_c ('"'); + } + out.append_str ("/>\n"); + } + + out.append_str ("\n"); + out.append_len (paint->group_stack.arrayZ[0].arrayZ, paint->group_stack.arrayZ[0].length); + out.append_str ("\n"); + + out.append_str ("\n"); + + hb_blob_t *blob = hb_buf_blob_from (&paint->recycled_blob, &out); + + hb_vector_paint_clear (paint); + + return blob; +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-paint.cc b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-paint.cc new file mode 100644 index 0000000000..5d66c2ac65 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-paint.cc @@ -0,0 +1,820 @@ +/* + * Copyright © 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Author(s): Behdad Esfahbod + */ + +#include "hb.hh" +#include "hb-vector-paint.hh" +#include "hb-vector-path.hh" +#include "hb-font.hh" + +/** + * hb_vector_paint_create_or_fail: + * @format: output format. + * + * Creates a new paint context for vector output. + * + * Return value: (nullable): a newly allocated #hb_vector_paint_t, or `NULL` on failure. + * + * Since: 13.0.0 + */ +hb_vector_paint_t * +hb_vector_paint_create_or_fail (hb_vector_format_t format) +{ + switch (format) + { + case HB_VECTOR_FORMAT_SVG: + case HB_VECTOR_FORMAT_PDF: + break; + case HB_VECTOR_FORMAT_INVALID: default: + return nullptr; + } + + hb_vector_paint_t *paint = hb_object_create (); + if (unlikely (!paint)) + return nullptr; + paint->format = format; + + paint->active_color_glyphs = hb_set_create (); + paint->defs.alloc (4096); + paint->path.alloc (2048); + paint->captured_scratch.alloc (4096); + paint->color_stops_scratch.alloc (16); + + return paint; +} + +/** + * hb_vector_paint_reference: + * @paint: a paint context. + * + * Increases the reference count of @paint. + * + * Return value: (transfer full): referenced @paint. + * + * Since: 13.0.0 + */ +hb_vector_paint_t * +hb_vector_paint_reference (hb_vector_paint_t *paint) +{ + return hb_object_reference (paint); +} + +/** + * hb_vector_paint_destroy: + * @paint: a paint context. + * + * Decreases the reference count of @paint and destroys it when it reaches zero. + * + * Since: 13.0.0 + */ +void +hb_vector_paint_destroy (hb_vector_paint_t *paint) +{ + if (!hb_object_should_destroy (paint)) + return; + + if (paint->format == HB_VECTOR_FORMAT_PDF) + hb_vector_paint_pdf_free_resources (paint); + hb_blob_destroy (paint->recycled_blob); + hb_set_destroy (paint->active_color_glyphs); + hb_free (paint->id_prefix); + hb_object_actually_destroy (paint); + hb_free (paint); +} + +/** + * hb_vector_paint_set_user_data: + * @paint: a paint context. + * @key: user-data key. + * @data: user-data value. + * @destroy: (nullable): destroy callback for @data. + * @replace: whether to replace an existing value for @key. + * + * Attaches user data to @paint. + * + * Return value: `true` on success, `false` otherwise. + * + * Since: 13.0.0 + */ +hb_bool_t +hb_vector_paint_set_user_data (hb_vector_paint_t *paint, + hb_user_data_key_t *key, + void *data, + hb_destroy_func_t destroy, + hb_bool_t replace) +{ + return hb_object_set_user_data (paint, key, data, destroy, replace); +} + +/** + * hb_vector_paint_get_user_data: + * @paint: a paint context. + * @key: user-data key. + * + * Gets previously attached user data from @paint. + * + * Return value: (nullable): user-data value associated with @key. + * + * Since: 13.0.0 + */ +void * +hb_vector_paint_get_user_data (const hb_vector_paint_t *paint, + hb_user_data_key_t *key) +{ + return hb_object_get_user_data (paint, key); +} + +/** + * hb_vector_paint_set_transform: + * @paint: a paint context. + * @xx: transform xx component. + * @yx: transform yx component. + * @xy: transform xy component. + * @yy: transform yy component. + * @dx: transform x translation. + * @dy: transform y translation. + * + * Sets the affine transform used when painting glyphs. + * + * Since: 13.0.0 + */ +void +hb_vector_paint_set_transform (hb_vector_paint_t *paint, + float xx, float yx, + float xy, float yy, + float dx, float dy) +{ + paint->transform = {xx, yx, xy, yy, dx, dy}; +} + +/** + * hb_vector_paint_get_transform: + * @paint: a paint context. + * @xx: (out) (nullable): transform xx component. + * @yx: (out) (nullable): transform yx component. + * @xy: (out) (nullable): transform xy component. + * @yy: (out) (nullable): transform yy component. + * @dx: (out) (nullable): transform x translation. + * @dy: (out) (nullable): transform y translation. + * + * Gets the affine transform used when painting glyphs. + * + * Since: 13.0.0 + */ +void +hb_vector_paint_get_transform (const hb_vector_paint_t *paint, + float *xx, float *yx, + float *xy, float *yy, + float *dx, float *dy) +{ + if (xx) *xx = paint->transform.xx; + if (yx) *yx = paint->transform.yx; + if (xy) *xy = paint->transform.xy; + if (yy) *yy = paint->transform.yy; + if (dx) *dx = paint->transform.x0; + if (dy) *dy = paint->transform.y0; +} + +/** + * hb_vector_paint_set_scale_factor: + * @paint: a paint context. + * @x_scale_factor: x scale factor. + * @y_scale_factor: y scale factor. + * + * Sets additional output scaling factors. + * + * Since: 13.0.0 + */ +void +hb_vector_paint_set_scale_factor (hb_vector_paint_t *paint, + float x_scale_factor, + float y_scale_factor) +{ + paint->x_scale_factor = x_scale_factor > 0.f ? x_scale_factor : 1.f; + paint->y_scale_factor = y_scale_factor > 0.f ? y_scale_factor : 1.f; +} + +/** + * hb_vector_paint_get_scale_factor: + * @paint: a paint context. + * @x_scale_factor: (out) (nullable): x scale factor. + * @y_scale_factor: (out) (nullable): y scale factor. + * + * Gets additional output scaling factors. + * + * Since: 13.0.0 + */ +void +hb_vector_paint_get_scale_factor (const hb_vector_paint_t *paint, + float *x_scale_factor, + float *y_scale_factor) +{ + if (x_scale_factor) *x_scale_factor = paint->x_scale_factor; + if (y_scale_factor) *y_scale_factor = paint->y_scale_factor; +} + +/** + * hb_vector_paint_set_extents: + * @paint: a paint context. + * @extents: (nullable): output extents to set or expand. + * + * Sets or expands output extents on @paint. Passing `NULL` clears extents. + * + * Since: 13.0.0 + */ +void +hb_vector_paint_set_extents (hb_vector_paint_t *paint, + const hb_vector_extents_t *extents) +{ + if (!extents) + { + paint->extents = {0, 0, 0, 0}; + paint->has_extents = false; + return; + } + + if (extents->width == 0.f || extents->height == 0.f) + return; + + /* Caller-supplied extents are in input-space; divide by + * scale_factor so they end up in output-space, matching + * the per-glyph extents accumulated via + * hb_vector_set_glyph_extents_common (which applies the + * same divide). Normalize so origin is the min corner and + * width/height are positive — callers may pass a + * glyph-extents-style box with negative height. */ + float x0 = extents->x / paint->x_scale_factor; + float y0 = extents->y / paint->y_scale_factor; + float x1 = x0 + extents->width / paint->x_scale_factor; + float y1 = y0 + extents->height / paint->y_scale_factor; + hb_vector_extents_t e = { + hb_min (x0, x1), hb_min (y0, y1), + fabsf (x1 - x0), fabsf (y1 - y0), + }; + + if (paint->has_extents) + { + float x0 = hb_min (paint->extents.x, e.x); + float y0 = hb_min (paint->extents.y, e.y); + float x1 = hb_max (paint->extents.x + paint->extents.width, + e.x + e.width); + float y1 = hb_max (paint->extents.y + paint->extents.height, + e.y + e.height); + paint->extents = {x0, y0, x1 - x0, y1 - y0}; + } + else + { + paint->extents = e; + paint->has_extents = true; + } +} + +/** + * hb_vector_paint_get_extents: + * @paint: a paint context. + * @extents: (out) (nullable): where to store current output extents. + * + * Gets current output extents from @paint. + * + * Return value: `true` if extents are set, `false` otherwise. + * + * Since: 13.0.0 + */ +hb_bool_t +hb_vector_paint_get_extents (const hb_vector_paint_t *paint, + hb_vector_extents_t *extents) +{ + if (!paint->has_extents) + return false; + + if (extents) + *extents = paint->extents; + return true; +} + +/** + * hb_vector_paint_set_glyph_extents: + * @paint: a paint context. + * @glyph_extents: glyph extents in font units. + * + * Expands @paint extents using @glyph_extents under the current transform. + * + * Return value: `true` on success, `false` otherwise. + * + * Since: 13.0.0 + */ +hb_bool_t +hb_vector_paint_set_glyph_extents (hb_vector_paint_t *paint, + const hb_glyph_extents_t *glyph_extents) +{ + hb_bool_t has_extents = paint->has_extents; + hb_bool_t ret = hb_vector_set_glyph_extents_common (paint->transform, + paint->x_scale_factor, + paint->y_scale_factor, + glyph_extents, + &paint->extents, + &has_extents); + paint->has_extents = has_extents; + return ret; +} + +/** + * hb_vector_paint_set_foreground: + * @paint: a paint context. + * @foreground: foreground color used for COLR foreground paints. + * + * Sets fallback foreground color used by paint operations. + * + * Since: 13.0.0 + */ +void +hb_vector_paint_set_foreground (hb_vector_paint_t *paint, + hb_color_t foreground) +{ + paint->foreground = foreground; +} + +/** + * hb_vector_paint_get_foreground: + * @paint: a paint context. + * + * Returns the foreground color previously set on @paint, or the + * default opaque black if none was set. + * + * Return value: the foreground color. + * + * Since: 14.2.0 + */ +hb_color_t +hb_vector_paint_get_foreground (const hb_vector_paint_t *paint) +{ + return paint->foreground; +} + +/** + * hb_vector_paint_set_background: + * @paint: a paint context. + * @background: background color. + * + * Sets the background color for @paint. If set to a non-transparent + * value, the renderer emits a filled rectangle covering the extents + * behind all glyph content. Default is transparent (no background). + * + * Since: 14.2.0 + */ +void +hb_vector_paint_set_background (hb_vector_paint_t *paint, + hb_color_t background) +{ + paint->background = background; +} + +/** + * hb_vector_paint_get_background: + * @paint: a paint context. + * + * Returns the background color previously set on @paint, or + * transparent if none was set. + * + * Return value: the background color. + * + * Since: 14.2.0 + */ +hb_color_t +hb_vector_paint_get_background (const hb_vector_paint_t *paint) +{ + return paint->background; +} + +/** + * hb_vector_paint_set_palette: + * @paint: a paint context. + * @palette: palette index for color glyph painting. + * + * Sets the color palette index used by paint operations. + * + * Since: 13.0.0 + */ +void +hb_vector_paint_set_palette (hb_vector_paint_t *paint, + int palette) +{ + paint->palette = palette; +} + +/** + * hb_vector_paint_get_palette: + * @paint: a paint context. + * + * Returns the palette index previously set on @paint, or 0 if none + * was set. + * + * Return value: the palette index. + * + * Since: 14.2.0 + */ +int +hb_vector_paint_get_palette (const hb_vector_paint_t *paint) +{ + return paint->palette; +} + +/** + * hb_vector_paint_set_custom_palette_color: + * @paint: a paint context. + * @color_index: color index to override. + * @color: replacement color. + * + * Overrides one font palette color entry for subsequent paint operations. + * Overrides are keyed by @color_index and persist on @paint until cleared + * (or replaced for the same index). + * + * These overrides are consulted by paint operations that resolve CPAL + * entries, including SVG glyph content using `var(--colorN)`. + * + * Since: 13.0.0 + */ +void +hb_vector_paint_set_custom_palette_color (hb_vector_paint_t *paint, + unsigned color_index, + hb_color_t color) +{ + paint->custom_palette_colors.set (color_index, color); +} + +/** + * hb_vector_paint_clear_custom_palette_colors: + * @paint: a paint context. + * + * Clears all custom palette color overrides previously set on @paint. + * + * After this call, palette lookups use the selected font palette without + * custom override entries. + * + * Since: 13.0.0 + */ +void +hb_vector_paint_clear_custom_palette_colors (hb_vector_paint_t *paint) +{ + paint->custom_palette_colors.clear (); +} + +/** + * hb_vector_paint_get_format: + * @paint: a vector paint context. + * + * Gets the output format @paint was created with. + * + * Return value: the output format. + * + * Since: 14.2.0 + */ +hb_vector_format_t +hb_vector_paint_get_format (const hb_vector_paint_t *paint) +{ + return paint->format; +} + +/** + * hb_vector_paint_get_funcs: + * @paint: a vector paint context. + * + * Gets paint callbacks for emitting paint operations into @paint. + * Pass @paint as the @paint_data argument when calling them. + * + * Return value: (transfer none): immutable #hb_paint_funcs_t. + * + * Since: 14.2.0 + */ +hb_paint_funcs_t * +hb_vector_paint_get_funcs (const hb_vector_paint_t *paint) +{ + switch (paint ? paint->format : HB_VECTOR_FORMAT_INVALID) + { + case HB_VECTOR_FORMAT_PDF: + return hb_vector_paint_pdf_funcs_get (); + case HB_VECTOR_FORMAT_SVG: + return hb_vector_paint_svg_funcs_get (); + case HB_VECTOR_FORMAT_INVALID: + default: + return nullptr; + } +} + + +static hb_bool_t +hb_vector_paint_glyph_impl (hb_vector_paint_t *paint, + hb_font_t *font, + hb_codepoint_t glyph, + hb_vector_extents_mode_t extents_mode, + hb_bool_t fallible) +{ + if (extents_mode == HB_VECTOR_EXTENTS_MODE_EXPAND) + { + hb_glyph_extents_t ge; + if (hb_font_get_glyph_extents (font, glyph, &ge)) + { + hb_bool_t has_extents = paint->has_extents; + hb_vector_set_glyph_extents_common (paint->transform, + paint->x_scale_factor, + paint->y_scale_factor, + &ge, + &paint->extents, + &has_extents); + paint->has_extents = has_extents; + } + } + + hb_paint_funcs_t *funcs = hb_vector_paint_get_funcs (paint); + hb_paint_push_transform (funcs, paint, + paint->transform.xx, paint->transform.yx, + paint->transform.xy, paint->transform.yy, + paint->transform.x0, paint->transform.y0); + + hb_bool_t ret = true; + if (fallible) + ret = hb_font_paint_glyph_or_fail (font, glyph, + funcs, paint, + (unsigned) paint->palette, + paint->foreground); + else + hb_font_paint_glyph (font, glyph, + funcs, paint, + (unsigned) paint->palette, + paint->foreground); + + hb_paint_pop_transform (funcs, paint); + return ret; +} + +/** + * hb_vector_paint_glyph_or_fail: + * @paint: a paint context. + * @font: font object. + * @glyph: glyph ID. + * @extents_mode: extents update mode. + * + * Convenience to paint one color glyph into @paint. + * Equivalent to: + * + * |[ + * // extend extents if requested + * hb_paint_funcs_t *funcs = hb_vector_paint_get_funcs (paint); + * hb_paint_push_transform (funcs, paint, ...transform...); + * hb_font_paint_glyph_or_fail (font, glyph, funcs, paint, + * palette, foreground); + * hb_paint_pop_transform (funcs, paint); + * ]| + * + * Return value: `true` if glyph paint data was emitted, `false` otherwise. + * + * Since: 14.2.0 + */ +hb_bool_t +hb_vector_paint_glyph_or_fail (hb_vector_paint_t *paint, + hb_font_t *font, + hb_codepoint_t glyph, + hb_vector_extents_mode_t extents_mode) +{ + return hb_vector_paint_glyph_impl (paint, font, glyph, + extents_mode, true); +} + +/** + * hb_vector_paint_glyph: + * @paint: a paint context. + * @font: font object. + * @glyph: glyph ID. + * @extents_mode: extents update mode. + * + * Paints one glyph into @paint. Unlike + * hb_vector_paint_glyph_or_fail(), glyphs with no color paint + * data fall back to a synthesized foreground-colored outline, + * so any glyph with an outline or bitmap image produces output. + * + * Since: 14.2.0 + */ +void +hb_vector_paint_glyph (hb_vector_paint_t *paint, + hb_font_t *font, + hb_codepoint_t glyph, + hb_vector_extents_mode_t extents_mode) +{ + hb_vector_paint_glyph_impl (paint, font, glyph, + extents_mode, false); +} + +/** + * hb_vector_paint_set_svg_prefix: + * @paint: a paint context. + * @prefix: a null-terminated ASCII string to prepend to every emitted + * SVG `id` and `url(#...)` reference, or `NULL` for none. + * + * Namespaces the paint's SVG output. Callers that inject multiple + * hb-vector SVGs into the same document (e.g. several glyph previews + * on one page) must set a distinct prefix per context so that the + * short IDs hb-vector uses for clipPaths, gradients, and use-refs + * don't collide in the DOM. + * + * No effect on PDF output. + * + * Since: 14.2.0 + */ +void +hb_vector_paint_set_svg_prefix (hb_vector_paint_t *paint, + const char *prefix) +{ + char *old = paint->id_prefix; + paint->id_prefix = nullptr; + paint->id_prefix_length = 0; + if (prefix && *prefix) + { + unsigned len = strlen (prefix); + char *copy = (char *) hb_malloc (len + 1); + if (likely (copy)) + { + hb_memcpy (copy, prefix, len); + copy[len] = '\0'; + paint->id_prefix = copy; + paint->id_prefix_length = len; + } + } + hb_free (old); +} + +/** + * hb_vector_paint_get_svg_prefix: + * @paint: a paint context. + * + * Returns the SVG id prefix previously set on @paint, or `""` if + * none was set. The pointer remains valid until the next call to + * hb_vector_paint_set_svg_prefix() or hb_vector_paint_reset() on the + * same context. + * + * Return value: the SVG id prefix. + * + * Since: 14.2.0 + */ +const char * +hb_vector_paint_get_svg_prefix (const hb_vector_paint_t *paint) +{ + return paint->id_prefix ? paint->id_prefix : ""; +} + +/** + * hb_vector_paint_set_precision: + * @paint: a paint context. + * @precision: decimal precision. + * + * Sets numeric output precision for paint output. + * + * Since: 14.2.0 + */ +void +hb_vector_paint_set_precision (hb_vector_paint_t *paint, + unsigned precision) +{ + paint->set_precision (precision); +} + +/** + * hb_vector_paint_get_precision: + * @paint: a paint context. + * + * Returns the numeric output precision previously set on @paint, + * or the default if none was set. + * + * Return value: the precision. + * + * Since: 14.2.0 + */ +unsigned +hb_vector_paint_get_precision (const hb_vector_paint_t *paint) +{ + return paint->get_precision (); +} + +/** + * hb_vector_paint_clear: + * @paint: a paint context. + * + * Discards accumulated paint output so @paint can be reused for + * another render. User configuration (transform, scale factors, + * precision, foreground, palette, custom palette colors) + * is preserved. Call hb_vector_paint_reset() to also reset + * user configuration to defaults. + * + * Since: 14.2.0 + */ +void +hb_vector_paint_clear (hb_vector_paint_t *paint) +{ + paint->extents = {0, 0, 0, 0}; + paint->has_extents = false; + + if (paint->format == HB_VECTOR_FORMAT_PDF) + hb_vector_paint_pdf_free_resources (paint); + paint->defs.clear (); + paint->path.clear (); + paint->group_stack.clear (); + paint->transform_group_open_mask = 0; + paint->transform_group_depth = 0; + paint->transform_group_overflow_depth = 0; + paint->clip_rect_counter = 0; + paint->clip_path_counter = 0; + paint->gradient_counter = 0; + paint->color_glyph_depth = 0; + paint->path_def_count = 0; + hb_set_clear (paint->active_color_glyphs); + paint->color_stops_scratch.clear (); + paint->captured_scratch.clear (); +} + + +/** + * hb_vector_paint_render: + * @paint: a paint context. + * + * Renders accumulated paint content to an output blob. + * + * Return value: (transfer full) (nullable): output blob, or `NULL` if rendering cannot proceed. + * + * Since: 13.0.0 + */ +hb_blob_t * +hb_vector_paint_render (hb_vector_paint_t *paint) +{ + switch (paint->format) + { + case HB_VECTOR_FORMAT_SVG: + return hb_vector_paint_render_svg (paint); + + case HB_VECTOR_FORMAT_PDF: + return hb_vector_paint_render_pdf (paint); + + case HB_VECTOR_FORMAT_INVALID: default: + return nullptr; + } +} + +/** + * hb_vector_paint_reset: + * @paint: a paint context. + * + * Resets @paint state and clears accumulated content. + * + * Since: 13.0.0 + */ +void +hb_vector_paint_reset (hb_vector_paint_t *paint) +{ + paint->transform = {1, 0, 0, 1, 0, 0}; + paint->x_scale_factor = 1.f; + paint->y_scale_factor = 1.f; + paint->foreground = HB_COLOR (0, 0, 0, 255); + paint->palette = 0; + paint->set_precision (2); + hb_vector_paint_clear (paint); +} + +/** + * hb_vector_paint_recycle_blob: + * @paint: a paint context. + * @blob: (nullable): previously rendered blob to recycle. + * + * Provides a blob for internal buffer reuse by later render calls. + * + * Since: 13.0.0 + */ +void +hb_vector_paint_recycle_blob (hb_vector_paint_t *paint, + hb_blob_t *blob) +{ + hb_blob_destroy (paint->recycled_blob); + paint->recycled_blob = nullptr; + if (!blob || blob == hb_blob_get_empty ()) + return; + paint->recycled_blob = blob; +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-paint.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-paint.hh new file mode 100644 index 0000000000..1bc7d8776a --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-paint.hh @@ -0,0 +1,129 @@ +/* + * Copyright © 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Author(s): Behdad Esfahbod + */ + +#ifndef HB_VECTOR_PAINT_HH +#define HB_VECTOR_PAINT_HH + +#include "hb.hh" + +#include "hb-vector.h" +#include "hb-geometry.hh" +#include "hb-machinery.hh" +#include "hb-map.hh" +#include "hb-vector-path.hh" +#include "hb-vector-buf.hh" +#include "hb-vector-internal.hh" + + +struct hb_vector_paint_t +{ + hb_object_header_t header; + + hb_vector_format_t format = HB_VECTOR_FORMAT_INVALID; + hb_transform_t<> transform = {1, 0, 0, 1, 0, 0}; + float x_scale_factor = 1.f; + float y_scale_factor = 1.f; + hb_vector_extents_t extents = {0, 0, 0, 0}; + bool has_extents = false; + + hb_color_t foreground = HB_COLOR (0, 0, 0, 255); + hb_color_t background = HB_COLOR (0, 0, 0, 0); + int palette = 0; + hb_hashmap_t custom_palette_colors; + char *id_prefix = nullptr; + unsigned id_prefix_length = 0; + + hb_vector_buf_t defs; + hb_vector_buf_t path; + hb_vector_t group_stack; + uint64_t transform_group_open_mask = 0; + unsigned transform_group_depth = 0; + unsigned transform_group_overflow_depth = 0; + + unsigned clip_rect_counter = 0; + unsigned clip_path_counter = 0; + hb_vector_path_sink_t clip_path_sink = {nullptr, 0, 1.f, 1.f}; + unsigned gradient_counter = 0; + unsigned color_glyph_depth = 0; + unsigned path_def_count = 0; + hb_set_t *active_color_glyphs = nullptr; + hb_vector_t color_stops_scratch; + hb_vector_buf_t captured_scratch; + hb_blob_t *recycled_blob = nullptr; + + hb_vector_buf_t ¤t_body () { return group_stack.tail (); } + + float sx (float v) const { return v / x_scale_factor; } + float sy (float v) const { return v / y_scale_factor; } + + bool fetch_color_stops (hb_color_line_t *color_line) + { + unsigned count = hb_color_line_get_color_stops (color_line, 0, nullptr, nullptr); + if (unlikely (!count || !color_stops_scratch.resize (count))) + { + color_stops_scratch.resize (0); + return false; + } + hb_color_line_get_color_stops (color_line, 0, &count, color_stops_scratch.arrayZ); + return true; + } + + void set_precision (unsigned p) + { + p = hb_min (p, 12u); + defs.precision = p; + path.precision = p; + } + + unsigned get_precision () const { return path.precision; } + + bool ensure_initialized () + { + if (group_stack.length) + return !group_stack.in_error () && + !group_stack.tail ().in_error (); + if (unlikely (!group_stack.push_or_fail ())) + return false; + group_stack.tail ().alloc (4096); + if (unlikely (group_stack.tail ().in_error ())) + { + group_stack.pop (); + return false; + } + return true; + } +}; + +/* Implemented in hb-vector-paint-svg.cc */ +HB_INTERNAL hb_paint_funcs_t * hb_vector_paint_svg_funcs_get (); +HB_INTERNAL hb_blob_t * hb_vector_paint_render_svg (hb_vector_paint_t *paint); + +/* Implemented in hb-vector-paint-pdf.cc */ +HB_INTERNAL hb_paint_funcs_t * hb_vector_paint_pdf_funcs_get (); +HB_INTERNAL hb_blob_t * hb_vector_paint_render_pdf (hb_vector_paint_t *paint); +HB_INTERNAL void hb_vector_paint_pdf_free_resources (hb_vector_paint_t *paint); + +#endif /* HB_VECTOR_PAINT_HH */ diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-path.cc b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-path.cc new file mode 100644 index 0000000000..e63726873d --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-path.cc @@ -0,0 +1,214 @@ +/* + * Copyright © 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Author(s): Behdad Esfahbod + */ + +#include "hb.hh" + +#include "hb-geometry.hh" +#include "hb-machinery.hh" +#include "hb-vector-path.hh" +#include "hb-vector-buf.hh" +#include "hb-vector-internal.hh" + + +/* ---- SVG path callbacks ---- */ + +static inline void +hb_vector_svg_path_append_xy (hb_vector_path_sink_t *s, float x, float y) +{ + s->path->append_num (x / s->x_scale, s->precision); + s->path->append_c (','); + s->path->append_num (y / s->y_scale, s->precision); +} + +static void +hb_vector_svg_path_move_to (hb_draw_funcs_t *, void *draw_data, hb_draw_state_t *, + float to_x, float to_y, void *) +{ + auto *s = (hb_vector_path_sink_t *) draw_data; + s->path->append_c ('M'); + hb_vector_svg_path_append_xy (s, to_x, to_y); +} + +static void +hb_vector_svg_path_line_to (hb_draw_funcs_t *, void *draw_data, hb_draw_state_t *, + float to_x, float to_y, void *) +{ + auto *s = (hb_vector_path_sink_t *) draw_data; + s->path->append_c ('L'); + hb_vector_svg_path_append_xy (s, to_x, to_y); +} + +static void +hb_vector_svg_path_quadratic_to (hb_draw_funcs_t *, void *draw_data, hb_draw_state_t *, + float cx, float cy, float to_x, float to_y, void *) +{ + auto *s = (hb_vector_path_sink_t *) draw_data; + s->path->append_c ('Q'); + hb_vector_svg_path_append_xy (s, cx, cy); + s->path->append_c (' '); + hb_vector_svg_path_append_xy (s, to_x, to_y); +} + +static void +hb_vector_svg_path_cubic_to (hb_draw_funcs_t *, void *draw_data, hb_draw_state_t *, + float c1x, float c1y, float c2x, float c2y, + float to_x, float to_y, void *) +{ + auto *s = (hb_vector_path_sink_t *) draw_data; + s->path->append_c ('C'); + hb_vector_svg_path_append_xy (s, c1x, c1y); + s->path->append_c (' '); + hb_vector_svg_path_append_xy (s, c2x, c2y); + s->path->append_c (' '); + hb_vector_svg_path_append_xy (s, to_x, to_y); +} + +static void +hb_vector_svg_path_close_path (hb_draw_funcs_t *, void *draw_data, hb_draw_state_t *, void *) +{ + auto *s = (hb_vector_path_sink_t *) draw_data; + s->path->append_c ('Z'); +} + + +/* ---- PDF path callbacks ---- */ + +static inline void +hb_vector_pdf_path_append_xy (hb_vector_path_sink_t *s, float x, float y) +{ + s->path->append_num (x / s->x_scale, s->precision); + s->path->append_c (' '); + s->path->append_num (y / s->y_scale, s->precision); +} + +static void +hb_vector_pdf_path_move_to (hb_draw_funcs_t *, void *draw_data, hb_draw_state_t *, + float to_x, float to_y, void *) +{ + auto *s = (hb_vector_path_sink_t *) draw_data; + hb_vector_pdf_path_append_xy (s, to_x, to_y); + s->path->append_str (" m\n"); +} + +static void +hb_vector_pdf_path_line_to (hb_draw_funcs_t *, void *draw_data, hb_draw_state_t *, + float to_x, float to_y, void *) +{ + auto *s = (hb_vector_path_sink_t *) draw_data; + hb_vector_pdf_path_append_xy (s, to_x, to_y); + s->path->append_str (" l\n"); +} + +/* No quadratic_to — the null fallback auto-promotes to cubic. */ + +static void +hb_vector_pdf_path_cubic_to (hb_draw_funcs_t *, void *draw_data, hb_draw_state_t *, + float c1x, float c1y, float c2x, float c2y, + float to_x, float to_y, void *) +{ + auto *s = (hb_vector_path_sink_t *) draw_data; + hb_vector_pdf_path_append_xy (s, c1x, c1y); + s->path->append_c (' '); + hb_vector_pdf_path_append_xy (s, c2x, c2y); + s->path->append_c (' '); + hb_vector_pdf_path_append_xy (s, to_x, to_y); + s->path->append_str (" c\n"); +} + +static void +hb_vector_pdf_path_close_path (hb_draw_funcs_t *, void *draw_data, hb_draw_state_t *, void *) +{ + auto *s = (hb_vector_path_sink_t *) draw_data; + s->path->append_str ("h\n"); +} + + +/* ---- Lazy loaders ---- */ + +static inline void free_static_vector_svg_path_draw_funcs (); +static struct hb_vector_svg_path_draw_funcs_lazy_loader_t + : hb_draw_funcs_lazy_loader_t +{ + static hb_draw_funcs_t *create () + { + hb_draw_funcs_t *funcs = hb_draw_funcs_create (); + hb_draw_funcs_set_move_to_func (funcs, (hb_draw_move_to_func_t) hb_vector_svg_path_move_to, nullptr, nullptr); + hb_draw_funcs_set_line_to_func (funcs, (hb_draw_line_to_func_t) hb_vector_svg_path_line_to, nullptr, nullptr); + hb_draw_funcs_set_quadratic_to_func (funcs, (hb_draw_quadratic_to_func_t) hb_vector_svg_path_quadratic_to, nullptr, nullptr); + hb_draw_funcs_set_cubic_to_func (funcs, (hb_draw_cubic_to_func_t) hb_vector_svg_path_cubic_to, nullptr, nullptr); + hb_draw_funcs_set_close_path_func (funcs, (hb_draw_close_path_func_t) hb_vector_svg_path_close_path, nullptr, nullptr); + hb_draw_funcs_make_immutable (funcs); + hb_atexit (free_static_vector_svg_path_draw_funcs); + return funcs; + } +} static_vector_svg_path_draw_funcs; + +static inline void +free_static_vector_svg_path_draw_funcs () +{ static_vector_svg_path_draw_funcs.free_instance (); } + +hb_draw_funcs_t * +hb_vector_svg_path_draw_funcs_get () +{ return static_vector_svg_path_draw_funcs.get_unconst (); } + + +static inline void free_static_vector_pdf_path_draw_funcs (); +static struct hb_vector_pdf_path_draw_funcs_lazy_loader_t + : hb_draw_funcs_lazy_loader_t +{ + static hb_draw_funcs_t *create () + { + hb_draw_funcs_t *funcs = hb_draw_funcs_create (); + hb_draw_funcs_set_move_to_func (funcs, (hb_draw_move_to_func_t) hb_vector_pdf_path_move_to, nullptr, nullptr); + hb_draw_funcs_set_line_to_func (funcs, (hb_draw_line_to_func_t) hb_vector_pdf_path_line_to, nullptr, nullptr); + /* No quadratic_to: the null fallback auto-promotes to cubic. */ + hb_draw_funcs_set_cubic_to_func (funcs, (hb_draw_cubic_to_func_t) hb_vector_pdf_path_cubic_to, nullptr, nullptr); + hb_draw_funcs_set_close_path_func (funcs, (hb_draw_close_path_func_t) hb_vector_pdf_path_close_path, nullptr, nullptr); + hb_draw_funcs_make_immutable (funcs); + hb_atexit (free_static_vector_pdf_path_draw_funcs); + return funcs; + } +} static_vector_pdf_path_draw_funcs; + +static inline void +free_static_vector_pdf_path_draw_funcs () +{ static_vector_pdf_path_draw_funcs.free_instance (); } + +hb_draw_funcs_t * +hb_vector_pdf_path_draw_funcs_get () +{ return static_vector_pdf_path_draw_funcs.get_unconst (); } + + +hb_draw_funcs_t * +hb_vector_path_draw_funcs_get (hb_vector_format_t format) +{ + switch (format) + { + case HB_VECTOR_FORMAT_SVG: return hb_vector_svg_path_draw_funcs_get (); + case HB_VECTOR_FORMAT_PDF: return hb_vector_pdf_path_draw_funcs_get (); + case HB_VECTOR_FORMAT_INVALID: default: return nullptr; + } +} diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-path.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-path.hh new file mode 100644 index 0000000000..9936428d3d --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-vector-path.hh @@ -0,0 +1,58 @@ +/* + * Copyright © 2026 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Author(s): Behdad Esfahbod + */ + +#ifndef HB_VECTOR_PATH_HH +#define HB_VECTOR_PATH_HH + +#include "hb.hh" +#include "hb-vector.hh" +#include "hb-vector.h" +#include "hb-draw.h" +#include "hb-vector-buf.hh" + +/* Lightweight path sink: serializes hb_draw_* calls into an + * external char buffer as either SVG path-data or PDF path + * operators, depending on format. Used by the vector paint + * backends to accumulate arbitrary clip paths (and by the + * SVG backend to emit glyph outlines into defs). */ +struct hb_vector_path_sink_t +{ + hb_vector_buf_t *path; + unsigned precision; + float x_scale; + float y_scale; +}; + +HB_INTERNAL hb_draw_funcs_t * +hb_vector_svg_path_draw_funcs_get (); + +HB_INTERNAL hb_draw_funcs_t * +hb_vector_pdf_path_draw_funcs_get (); + +HB_INTERNAL hb_draw_funcs_t * +hb_vector_path_draw_funcs_get (hb_vector_format_t format); + +#endif /* HB_VECTOR_PATH_HH */ diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-zlib.cc b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-zlib.cc new file mode 100644 index 0000000000..f17c5d6dd2 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-zlib.cc @@ -0,0 +1,92 @@ +#ifndef HB_ZLIB_CC +#define HB_ZLIB_CC +#ifdef HB_ZLIB_CC /* Pacify -Wunused-macros. */ + +#include "hb.hh" + +#include "hb-zlib.hh" + +#ifdef HAVE_ZLIB +#include +#endif + +hb_blob_t * +hb_blob_decompress_gzip (hb_blob_t *blob, + unsigned max_output_len) +{ +#ifndef HAVE_ZLIB + return nullptr; +#else + unsigned compressed_len = 0; + const uint8_t *compressed = (const uint8_t *) hb_blob_get_data (blob, &compressed_len); + if (!compressed || !compressed_len) + return nullptr; + + z_stream stream = {}; + stream.next_in = (Bytef *) compressed; + stream.avail_in = compressed_len; + + if (inflateInit2 (&stream, 16 + MAX_WBITS) != Z_OK) + return nullptr; + HB_SCOPE_GUARD (inflateEnd (&stream)); + + uint32_t expected_size = 0; + hb_gzip_get_uncompressed_size ((const char *) compressed, + compressed_len, + &expected_size); + + size_t allocated = hb_min ((size_t) hb_max (expected_size, 4096u), + (size_t) max_output_len); + char *output = (char *) hb_malloc (allocated); + if (!output) + return nullptr; + auto output_guard = hb_make_scope_guard ([&]() { hb_free (output); }); + + int status = Z_OK; + while (true) + { + size_t produced = (size_t) stream.total_out; + if (unlikely (produced >= (size_t) max_output_len)) + return nullptr; + + if (produced == allocated) + { + size_t new_allocated = hb_min (allocated * 2, (size_t) max_output_len); + if (unlikely (new_allocated <= allocated)) + return nullptr; + + char *new_output = (char *) hb_realloc (output, new_allocated); + if (unlikely (!new_output)) + return nullptr; + + output = new_output; + allocated = new_allocated; + } + + stream.next_out = (Bytef *) output + stream.total_out; + stream.avail_out = (uInt) (allocated - (size_t) stream.total_out); + + status = inflate (&stream, Z_FINISH); + if (status == Z_STREAM_END) + break; + + if ((status == Z_OK || status == Z_BUF_ERROR) && stream.avail_out == 0) + continue; + + return nullptr; + } + + if (unlikely ((size_t) stream.total_out > (size_t) max_output_len)) + return nullptr; + + output_guard.release (); + return hb_blob_create_or_fail (output, + (unsigned) stream.total_out, + HB_MEMORY_MODE_WRITABLE, + output, + hb_free); +#endif +} + +#endif /* HB_ZLIB_CC pacify */ +#endif /* HB_ZLIB_CC guard */ diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-zlib.hh b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-zlib.hh new file mode 100644 index 0000000000..3b8eb791a1 --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/harfbuzz-ng/src/hb-zlib.hh @@ -0,0 +1,37 @@ +#ifndef HB_ZLIB_HH +#define HB_ZLIB_HH + +#include "hb-blob.hh" + +static inline bool +hb_blob_is_gzip (const char *data, + unsigned data_len) +{ + return data_len >= 3 && + (unsigned char) data[0] == 0x1Fu && + (unsigned char) data[1] == 0x8Bu && + (unsigned char) data[2] == 0x08u; +} + +static inline bool +hb_gzip_get_uncompressed_size (const char *data, + unsigned data_len, + uint32_t *size) +{ + if (data_len < 4) + return false; + + const unsigned char *trailer = (const unsigned char *) data + data_len - 4; + if (size) + *size = (uint32_t) trailer[0] | + ((uint32_t) trailer[1] << 8) | + ((uint32_t) trailer[2] << 16) | + ((uint32_t) trailer[3] << 24); + return true; +} + +HB_INTERNAL hb_blob_t * +hb_blob_decompress_gzip (hb_blob_t *blob, + unsigned max_output_len); + +#endif /* HB_ZLIB_HH */ diff --git a/local/recipes/qt/qtbase/source/src/3rdparty/pcre2/src/pcre2_match_next.c b/local/recipes/qt/qtbase/source/src/3rdparty/pcre2/src/pcre2_match_next.c new file mode 100644 index 0000000000..ecd21d380d --- /dev/null +++ b/local/recipes/qt/qtbase/source/src/3rdparty/pcre2/src/pcre2_match_next.c @@ -0,0 +1,171 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Original API code Copyright (c) 1997-2012 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +#include "pcre2_internal.h" + + + +/* Advance the offset by one code unit, and return the new value. +It is only called when the offset is not at the end of the subject. */ + +static PCRE2_SIZE do_bumpalong(pcre2_match_data *match_data, + PCRE2_SIZE offset) +{ +PCRE2_SPTR subject = match_data->subject; +PCRE2_SIZE subject_length = match_data->subject_length; +#ifdef SUPPORT_UNICODE +BOOL utf = (match_data->code->overall_options & PCRE2_UTF) != 0; +#endif + +/* Skip over CRLF as an atomic sequence, if CRLF is configured as a newline +sequence. */ + +if (subject[offset] == CHAR_CR && offset + 1 < subject_length && + subject[offset + 1] == CHAR_LF) + { + switch(match_data->code->newline_convention) + { + case PCRE2_NEWLINE_CRLF: + case PCRE2_NEWLINE_ANY: + case PCRE2_NEWLINE_ANYCRLF: + return offset + 2; + } + } + +/* Advance by one full character if in UTF mode. */ + +#ifdef SUPPORT_UNICODE +if (utf) + { + PCRE2_SPTR next = subject + offset + 1; + PCRE2_SPTR subject_end = subject + subject_length; + + (void)subject_end; /* Suppress warning; 32-bit FORWARDCHARTEST ignores this */ + FORWARDCHARTEST(next, subject_end); + return next - subject; + } +#endif + +return offset + 1; +} + + + +/************************************************* +* Advance the match * +*************************************************/ + +PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION +pcre2_next_match(pcre2_match_data *match_data, PCRE2_SIZE *pstart_offset, + uint32_t *poptions) +{ +int rc = match_data->rc; +PCRE2_SIZE start_offset = match_data->start_offset; +PCRE2_SIZE *ovector = match_data->ovector; + +/* Match error, or no match: no further iteration possible. In previous versions +of PCRE2, we recommended that clients use a strategy which involved retrying in +certain cases after PCRE2_ERROR_NOMATCH, but this is no longer required. */ + +if (rc < 0) + return FALSE; + +/* Match succeeded: get the start offset for the next match */ + +/* Although \K can affect the position of ovector[0], there are no ways to do +anything surprising with ovector[1], which must always be >= start_offset. */ + +PCRE2_ASSERT(ovector[1] >= start_offset); + +/* Special handling for patterns which contain \K in a lookaround, which enables +the match start to be pushed back to before the starting search offset +(ovector[0] < start_offset) or after the match ends (ovector[0] > ovector[1]). +This is not a problem if ovector[1] > start_offset, because in this case, we can +just attempt the next match at ovector[1]: we are making progress, which is all +that we require. + +However, if we have ovector[1] == start_offset, then we have a very rare case +which must be handled specially, because it's a non-empty match which +nonetheless fails to make progress through the subject. */ + +if (ovector[0] != start_offset && ovector[1] == start_offset) + { + /* If the match end is at the end of the subject, we are done. */ + + if (start_offset >= match_data->subject_length) + return FALSE; + + /* Otherwise, bump along by one code unit, and do a normal search. */ + + *pstart_offset = do_bumpalong(match_data, ovector[1]); + *poptions = 0; + return TRUE; + } + +/* If the previous match was for an empty string, we are finished if we are at +the end of the subject. Otherwise, arrange to run another match at the same +point to see if a non-empty match can be found. */ + +if (ovector[0] == ovector[1]) + { + /* If the match is at the end of the subject, we are done. */ + + if (ovector[0] >= match_data->subject_length) + return FALSE; + + /* Otherwise, continue at this exact same point, but we must set the flag + which ensures that we don't return the exact same empty match again. */ + + *pstart_offset = ovector[1]; + *poptions = PCRE2_NOTEMPTY_ATSTART; + return TRUE; + } + +/* Finally, we must be in the happy state of a non-empty match, where the end of +the match is further on in the subject than start_offset, so we are easily able +to continue and make progress. */ + +*pstart_offset = ovector[1]; +*poptions = 0; +return TRUE; +} + +/* End of pcre2_match_next.c */ diff --git a/local/recipes/qt/qtbase/source/tests/auto/bic/data/qt.6.11.0.linux-gcc-amd64.txt b/local/recipes/qt/qtbase/source/tests/auto/bic/data/qt.6.11.0.linux-gcc-amd64.txt new file mode 100644 index 0000000000..f866c0d12b --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/bic/data/qt.6.11.0.linux-gcc-amd64.txt @@ -0,0 +1,31467 @@ +Class std::__failure_type + size=1 align=1 + base size=0 base align=1 +std::__failure_type (0x0x7319bf9352a0) 0 empty + +Class std::__do_is_destructible_impl + size=1 align=1 + base size=0 base align=1 +std::__do_is_destructible_impl (0x0x7319bf9851e0) 0 empty + +Class std::__do_is_nt_destructible_impl + size=1 align=1 + base size=0 base align=1 +std::__do_is_nt_destructible_impl (0x0x7319bf985420) 0 empty + +Class std::__do_is_implicitly_default_constructible_impl + size=1 align=1 + base size=0 base align=1 +std::__do_is_implicitly_default_constructible_impl (0x0x7319bf9b9300) 0 empty + +Class std::__make_unsigned_selector_base + size=1 align=1 + base size=0 base align=1 +std::__make_unsigned_selector_base (0x0x7319bf9ecc60) 0 empty + +Class std::__do_common_type_impl + size=1 align=1 + base size=0 base align=1 +std::__do_common_type_impl (0x0x7319bca64660) 0 empty + +Class std::__invoke_memfun_ref + size=1 align=1 + base size=0 base align=1 +std::__invoke_memfun_ref (0x0x7319bca64c00) 0 empty + +Class std::__invoke_memfun_deref + size=1 align=1 + base size=0 base align=1 +std::__invoke_memfun_deref (0x0x7319bca64c60) 0 empty + +Class std::__invoke_memobj_ref + size=1 align=1 + base size=0 base align=1 +std::__invoke_memobj_ref (0x0x7319bca64cc0) 0 empty + +Class std::__invoke_memobj_deref + size=1 align=1 + base size=0 base align=1 +std::__invoke_memobj_deref (0x0x7319bca64d20) 0 empty + +Class std::__invoke_other + size=1 align=1 + base size=0 base align=1 +std::__invoke_other (0x0x7319bca64d80) 0 empty + +Class std::__result_of_memfun_ref_impl + size=1 align=1 + base size=0 base align=1 +std::__result_of_memfun_ref_impl (0x0x7319bca64e40) 0 empty + +Class std::__result_of_memfun_deref_impl + size=1 align=1 + base size=0 base align=1 +std::__result_of_memfun_deref_impl (0x0x7319bca64f00) 0 empty + +Class std::__result_of_memobj_ref_impl + size=1 align=1 + base size=0 base align=1 +std::__result_of_memobj_ref_impl (0x0x7319bca9c000) 0 empty + +Class std::__result_of_memobj_deref_impl + size=1 align=1 + base size=0 base align=1 +std::__result_of_memobj_deref_impl (0x0x7319bca9c0c0) 0 empty + +Class std::__result_of_other_impl + size=1 align=1 + base size=0 base align=1 +std::__result_of_other_impl (0x0x7319bca9c420) 0 empty + +Class std::__swappable_details::__do_is_swappable_impl + size=1 align=1 + base size=0 base align=1 +std::__swappable_details::__do_is_swappable_impl (0x0x7319bca9c780) 0 empty + +Class std::__swappable_details::__do_is_nothrow_swappable_impl + size=1 align=1 + base size=0 base align=1 +std::__swappable_details::__do_is_nothrow_swappable_impl (0x0x7319bca9c7e0) 0 empty + +Class std::__swappable_with_details::__do_is_swappable_with_impl + size=1 align=1 + base size=0 base align=1 +std::__swappable_with_details::__do_is_swappable_with_impl (0x0x7319bca9ca80) 0 empty + +Class std::__swappable_with_details::__do_is_nothrow_swappable_with_impl + size=1 align=1 + base size=0 base align=1 +std::__swappable_with_details::__do_is_nothrow_swappable_with_impl (0x0x7319bca9cae0) 0 empty + +Class std::__nonesuchbase + size=1 align=1 + base size=0 base align=1 +std::__nonesuchbase (0x0x7319bcae9420) 0 empty + +Class std::__nonesuch + size=1 align=1 + base size=1 base align=1 +std::__nonesuch (0x0x7319bca9fb60) 0 empty +std::__nonesuchbase (0x0x7319bcae9480) 0 empty + +Class std::piecewise_construct_t + size=1 align=1 + base size=0 base align=1 +std::piecewise_construct_t (0x0x7319bcb38960) 0 empty + +Class std::in_place_t + size=1 align=1 + base size=0 base align=1 +std::in_place_t (0x0x7319bcbbcb40) 0 empty + +Class QtPrivate::Deprecated_t + size=1 align=1 + base size=0 base align=1 +QtPrivate::Deprecated_t (0x0x7319bcbbcde0) 0 empty + +Class std::__numeric_limits_base + size=1 align=1 + base size=0 base align=1 +std::__numeric_limits_base (0x0x7319bc8032a0) 0 empty + +Class QSysInfo + size=1 align=1 + base size=0 base align=1 +QSysInfo (0x0x7319bc8be960) 0 empty + +Class QMessageLogContext + size=32 align=8 + base size=32 base align=8 +QMessageLogContext (0x0x7319bc8be9c0) 0 + +Class QMessageLogger + size=32 align=8 + base size=32 base align=8 +QMessageLogger (0x0x7319bc8bec00) 0 + +Class QtPrivate::CompareAgainstLiteralZero + size=1 align=1 + base size=0 base align=1 +QtPrivate::CompareAgainstLiteralZero (0x0x7319bc906480) 0 empty + +Class std::__true_type + size=1 align=1 + base size=0 base align=1 +std::__true_type (0x0x7319bc9066c0) 0 empty + +Class std::__false_type + size=1 align=1 + base size=0 base align=1 +std::__false_type (0x0x7319bc906720) 0 empty + +Class std::input_iterator_tag + size=1 align=1 + base size=0 base align=1 +std::input_iterator_tag (0x0x7319bc959de0) 0 empty + +Class std::output_iterator_tag + size=1 align=1 + base size=0 base align=1 +std::output_iterator_tag (0x0x7319bc959e40) 0 empty + +Class std::forward_iterator_tag + size=1 align=1 + base size=1 base align=1 +std::forward_iterator_tag (0x0x7319bcb4ebc8) 0 empty +std::input_iterator_tag (0x0x7319bc959ea0) 0 empty + +Class std::bidirectional_iterator_tag + size=1 align=1 + base size=1 base align=1 +std::bidirectional_iterator_tag (0x0x7319bcb4ec30) 0 empty +std::forward_iterator_tag (0x0x7319bcb4ec98) 0 empty +std::input_iterator_tag (0x0x7319bc959f00) 0 empty + +Class std::random_access_iterator_tag + size=1 align=1 + base size=1 base align=1 +std::random_access_iterator_tag (0x0x7319bcb4ed00) 0 empty +std::bidirectional_iterator_tag (0x0x7319bcb4ed68) 0 empty +std::forward_iterator_tag (0x0x7319bcb4edd0) 0 empty +std::input_iterator_tag (0x0x7319bc959f60) 0 empty + +Class __gnu_cxx::__ops::_Iter_less_iter + size=1 align=1 + base size=0 base align=1 +__gnu_cxx::__ops::_Iter_less_iter (0x0x7319bc612ea0) 0 empty + +Class __gnu_cxx::__ops::_Iter_less_val + size=1 align=1 + base size=0 base align=1 +__gnu_cxx::__ops::_Iter_less_val (0x0x7319bc643000) 0 empty + +Class __gnu_cxx::__ops::_Val_less_iter + size=1 align=1 + base size=0 base align=1 +__gnu_cxx::__ops::_Val_less_iter (0x0x7319bc643300) 0 empty + +Class __gnu_cxx::__ops::_Iter_equal_to_iter + size=1 align=1 + base size=0 base align=1 +__gnu_cxx::__ops::_Iter_equal_to_iter (0x0x7319bc643600) 0 empty + +Class __gnu_cxx::__ops::_Iter_equal_to_val + size=1 align=1 + base size=0 base align=1 +__gnu_cxx::__ops::_Iter_equal_to_val (0x0x7319bc643720) 0 empty + +Class __locale_struct + size=232 align=8 + base size=232 base align=8 +__locale_struct (0x0x7319bc722960) 0 + +Class timeval + size=16 align=8 + base size=16 base align=8 +timeval (0x0x7319bc722c60) 0 + +Class timespec + size=16 align=8 + base size=16 base align=8 +timespec (0x0x7319bc722cc0) 0 + +Class __pthread_internal_list + size=16 align=8 + base size=16 base align=8 +__pthread_internal_list (0x0x7319bc722e40) 0 + +Class __pthread_internal_slist + size=8 align=8 + base size=8 base align=8 +__pthread_internal_slist (0x0x7319bc722ea0) 0 + +Class __pthread_mutex_s + size=40 align=8 + base size=40 base align=8 +__pthread_mutex_s (0x0x7319bc722f00) 0 + +Class __pthread_rwlock_arch_t + size=56 align=8 + base size=56 base align=8 +__pthread_rwlock_arch_t (0x0x7319bc722f60) 0 + +Class __pthread_cond_s + size=48 align=8 + base size=48 base align=8 +__pthread_cond_s (0x0x7319bc760000) 0 + +Class pthread_attr_t + size=56 align=8 + base size=56 base align=8 +pthread_attr_t (0x0x7319bc760180) 0 + +Class random_data + size=48 align=8 + base size=48 base align=8 +random_data (0x0x7319bc760420) 0 + +Class drand48_data + size=24 align=8 + base size=24 base align=8 +drand48_data (0x0x7319bc760480) 0 + +Vtable for std::exception +std::exception::_ZTVSt9exception: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt9exception) +16 (int (*)(...))std::exception::~exception +24 (int (*)(...))std::exception::~exception +32 (int (*)(...))std::exception::what + +Class std::exception + size=8 align=8 + base size=8 base align=8 +std::exception (0x0x7319bc413240) 0 nearly-empty + vptr=((& std::exception::_ZTVSt9exception) + 16) + +Vtable for std::bad_alloc +std::bad_alloc::_ZTVSt9bad_alloc: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt9bad_alloc) +16 (int (*)(...))std::bad_alloc::~bad_alloc +24 (int (*)(...))std::bad_alloc::~bad_alloc +32 (int (*)(...))std::bad_alloc::what + +Class std::bad_alloc + size=8 align=8 + base size=8 base align=8 +std::bad_alloc (0x0x7319bc9b9270) 0 nearly-empty + vptr=((& std::bad_alloc::_ZTVSt9bad_alloc) + 16) +std::exception (0x0x7319bc4134e0) 0 nearly-empty + primary-for std::bad_alloc (0x0x7319bc9b9270) + +Vtable for std::bad_array_new_length +std::bad_array_new_length::_ZTVSt20bad_array_new_length: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt20bad_array_new_length) +16 (int (*)(...))std::bad_array_new_length::~bad_array_new_length +24 (int (*)(...))std::bad_array_new_length::~bad_array_new_length +32 (int (*)(...))std::bad_array_new_length::what + +Class std::bad_array_new_length + size=8 align=8 + base size=8 base align=8 +std::bad_array_new_length (0x0x7319bc9b92d8) 0 nearly-empty + vptr=((& std::bad_array_new_length::_ZTVSt20bad_array_new_length) + 16) +std::bad_alloc (0x0x7319bc9b9340) 0 nearly-empty + primary-for std::bad_array_new_length (0x0x7319bc9b92d8) +std::exception (0x0x7319bc413720) 0 nearly-empty + primary-for std::bad_alloc (0x0x7319bc9b9340) + +Class std::nothrow_t + size=1 align=1 + base size=0 base align=1 +std::nothrow_t (0x0x7319bc413900) 0 empty + +Class std::__erased_type + size=1 align=1 + base size=0 base align=1 +std::__erased_type (0x0x7319bc2d8180) 0 empty + +Class std::allocator_arg_t + size=1 align=1 + base size=0 base align=1 +std::allocator_arg_t (0x0x7319bc2d81e0) 0 empty + +Class std::__uses_alloc_base + size=1 align=1 + base size=0 base align=1 +std::__uses_alloc_base (0x0x7319bc2d8360) 0 empty + +Class std::__uses_alloc0::_Sink + size=1 align=1 + base size=0 base align=1 +std::__uses_alloc0::_Sink (0x0x7319bc2d8420) 0 empty + +Class std::__uses_alloc0 + size=1 align=1 + base size=1 base align=1 +std::__uses_alloc0 (0x0x7319bc2e2138) 0 +std::__uses_alloc_base (0x0x7319bc2d83c0) 0 empty + +Class std::_Swallow_assign + size=1 align=1 + base size=0 base align=1 +std::_Swallow_assign (0x0x7319bc071a80) 0 empty + +Class std::_Hash_impl + size=1 align=1 + base size=0 base align=1 +std::_Hash_impl (0x0x7319bc0ea2a0) 0 empty + +Class std::_Fnv_hash_impl + size=1 align=1 + base size=0 base align=1 +std::_Fnv_hash_impl (0x0x7319bc0ea420) 0 empty + +Vtable for std::type_info +std::type_info::_ZTVSt9type_info: 8 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt9type_info) +16 (int (*)(...))std::type_info::~type_info +24 (int (*)(...))std::type_info::~type_info +32 (int (*)(...))std::type_info::__is_pointer_p +40 (int (*)(...))std::type_info::__is_function_p +48 (int (*)(...))std::type_info::__do_catch +56 (int (*)(...))std::type_info::__do_upcast + +Class std::type_info + size=16 align=8 + base size=16 base align=8 +std::type_info (0x0x7319bc16ede0) 0 + vptr=((& std::type_info::_ZTVSt9type_info) + 16) + +Vtable for std::bad_cast +std::bad_cast::_ZTVSt8bad_cast: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt8bad_cast) +16 (int (*)(...))std::bad_cast::~bad_cast +24 (int (*)(...))std::bad_cast::~bad_cast +32 (int (*)(...))std::bad_cast::what + +Class std::bad_cast + size=8 align=8 + base size=8 base align=8 +std::bad_cast (0x0x7319bc1a9000) 0 nearly-empty + vptr=((& std::bad_cast::_ZTVSt8bad_cast) + 16) +std::exception (0x0x7319bc1a51e0) 0 nearly-empty + primary-for std::bad_cast (0x0x7319bc1a9000) + +Vtable for std::bad_typeid +std::bad_typeid::_ZTVSt10bad_typeid: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt10bad_typeid) +16 (int (*)(...))std::bad_typeid::~bad_typeid +24 (int (*)(...))std::bad_typeid::~bad_typeid +32 (int (*)(...))std::bad_typeid::what + +Class std::bad_typeid + size=8 align=8 + base size=8 base align=8 +std::bad_typeid (0x0x7319bc1a9068) 0 nearly-empty + vptr=((& std::bad_typeid::_ZTVSt10bad_typeid) + 16) +std::exception (0x0x7319bc1a53c0) 0 nearly-empty + primary-for std::bad_typeid (0x0x7319bc1a9068) + +Vtable for std::bad_function_call +std::bad_function_call::_ZTVSt17bad_function_call: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt17bad_function_call) +16 (int (*)(...))std::bad_function_call::~bad_function_call +24 (int (*)(...))std::bad_function_call::~bad_function_call +32 (int (*)(...))std::bad_function_call::what + +Class std::bad_function_call + size=8 align=8 + base size=8 base align=8 +std::bad_function_call (0x0x7319bc1a90d0) 0 nearly-empty + vptr=((& std::bad_function_call::_ZTVSt17bad_function_call) + 16) +std::exception (0x0x7319bc1a55a0) 0 nearly-empty + primary-for std::bad_function_call (0x0x7319bc1a90d0) + +Class std::_Nocopy_types + size=16 align=8 + base size=16 base align=8 +std::_Nocopy_types (0x0x7319bc1a5660) 0 + +Class std::_Any_data + size=16 align=8 + base size=16 base align=8 +std::_Any_data (0x0x7319bc1a56c0) 0 + +Class std::_Function_base + size=24 align=8 + base size=24 base align=8 +std::_Function_base (0x0x7319bc1a58a0) 0 + +Class std::__allocator_traits_base + size=1 align=1 + base size=0 base align=1 +std::__allocator_traits_base (0x0x7319bbec5300) 0 empty + +Class std::__detail::_Identity + size=1 align=1 + base size=0 base align=1 +std::__detail::_Identity (0x0x7319bbf4c2a0) 0 empty + +Class std::__detail::_Select1st + size=1 align=1 + base size=0 base align=1 +std::__detail::_Select1st (0x0x7319bbf4c360) 0 empty + +Class std::__detail::_Hash_node_base + size=8 align=8 + base size=8 base align=8 +std::__detail::_Hash_node_base (0x0x7319bbf4c840) 0 + +Class std::__detail::_Mod_range_hashing + size=1 align=1 + base size=0 base align=1 +std::__detail::_Mod_range_hashing (0x0x7319bbf6f780) 0 empty + +Class std::__detail::_Default_ranged_hash + size=1 align=1 + base size=0 base align=1 +std::__detail::_Default_ranged_hash (0x0x7319bbf6f840) 0 empty + +Class std::__detail::_Prime_rehash_policy + size=16 align=8 + base size=16 base align=8 +std::__detail::_Prime_rehash_policy (0x0x7319bbf6f8a0) 0 + +Class std::__detail::_Mask_range_hashing + size=1 align=1 + base size=0 base align=1 +std::__detail::_Mask_range_hashing (0x0x7319bbf6fc60) 0 empty + +Class std::__detail::_Power2_rehash_policy + size=16 align=8 + base size=16 base align=8 +std::__detail::_Power2_rehash_policy (0x0x7319bbf6fe40) 0 + +Class std::_Enable_default_constructor_tag + size=1 align=1 + base size=0 base align=1 +std::_Enable_default_constructor_tag (0x0x7319bbd822a0) 0 empty + +Class std::_Bit_reference + size=16 align=8 + base size=16 base align=8 +std::_Bit_reference (0x0x7319bb43a360) 0 + +Class std::_Bit_iterator_base + size=16 align=8 + base size=12 base align=8 +std::_Bit_iterator_base (0x0x7319bb7118f0) 0 +std::iterator (0x0x7319bb43aae0) 0 empty + +Class std::_Bit_iterator + size=16 align=8 + base size=12 base align=8 +std::_Bit_iterator (0x0x7319bb7119c0) 0 +std::_Bit_iterator_base (0x0x7319bb711a28) 0 +std::iterator (0x0x7319bb46d0c0) 0 empty + +Class std::_Bit_const_iterator + size=16 align=8 + base size=12 base align=8 +std::_Bit_const_iterator (0x0x7319bb711b60) 0 +std::_Bit_iterator_base (0x0x7319bb711bc8) 0 +std::iterator (0x0x7319bb46d900) 0 empty + +Class __pstl::execution::v1::sequenced_policy + size=1 align=1 + base size=0 base align=1 +__pstl::execution::v1::sequenced_policy (0x0x7319bb250c60) 0 empty + +Class __pstl::execution::v1::parallel_policy + size=1 align=1 + base size=0 base align=1 +__pstl::execution::v1::parallel_policy (0x0x7319bb250de0) 0 empty + +Class __pstl::execution::v1::parallel_unsequenced_policy + size=1 align=1 + base size=0 base align=1 +__pstl::execution::v1::parallel_unsequenced_policy (0x0x7319bb250f60) 0 empty + +Class __pstl::execution::v1::unsequenced_policy + size=1 align=1 + base size=0 base align=1 +__pstl::execution::v1::unsequenced_policy (0x0x7319bb27b120) 0 empty + +Class QFlag + size=4 align=4 + base size=4 base align=4 +QFlag (0x0x7319bb27b540) 0 + +Class QIncompatibleFlag + size=4 align=4 + base size=4 base align=4 +QIncompatibleFlag (0x0x7319bb335b40) 0 + +Class std::__atomic_flag_base + size=1 align=1 + base size=1 base align=1 +std::__atomic_flag_base (0x0x7319bb3c43c0) 0 + +Class std::atomic_flag + size=1 align=1 + base size=1 base align=1 +std::atomic_flag (0x0x7319bb37fbc8) 0 +std::__atomic_flag_base (0x0x7319bb3c4420) 0 + +Class QAtomicInt + size=4 align=4 + base size=4 base align=4 +QAtomicInt (0x0x7319bb1e83a8) 0 +QAtomicInteger (0x0x7319bb1e8410) 0 +QBasicAtomicInteger (0x0x7319baf4c9c0) 0 + +Vtable for std::bad_exception +std::bad_exception::_ZTVSt13bad_exception: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt13bad_exception) +16 (int (*)(...))std::bad_exception::~bad_exception +24 (int (*)(...))std::bad_exception::~bad_exception +32 (int (*)(...))std::bad_exception::what + +Class std::bad_exception + size=8 align=8 + base size=8 base align=8 +std::bad_exception (0x0x7319bb1e84e0) 0 nearly-empty + vptr=((& std::bad_exception::_ZTVSt13bad_exception) + 16) +std::exception (0x0x7319baf4ce40) 0 nearly-empty + primary-for std::bad_exception (0x0x7319bb1e84e0) + +Class std::__exception_ptr::exception_ptr + size=8 align=8 + base size=8 base align=8 +std::__exception_ptr::exception_ptr (0x0x7319baf95060) 0 + +Vtable for std::nested_exception +std::nested_exception::_ZTVSt16nested_exception: 4 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt16nested_exception) +16 (int (*)(...))std::nested_exception::~nested_exception +24 (int (*)(...))std::nested_exception::~nested_exception + +Class std::nested_exception + size=16 align=8 + base size=16 base align=8 +std::nested_exception (0x0x7319baf95ba0) 0 + vptr=((& std::nested_exception::_ZTVSt16nested_exception) + 16) + +Class std::nullopt_t + size=1 align=1 + base size=0 base align=1 +std::nullopt_t (0x0x7319bafc02a0) 0 empty + +Vtable for std::bad_optional_access +std::bad_optional_access::_ZTVSt19bad_optional_access: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt19bad_optional_access) +16 (int (*)(...))std::bad_optional_access::~bad_optional_access +24 (int (*)(...))std::bad_optional_access::~bad_optional_access +32 (int (*)(...))std::bad_optional_access::what + +Class std::bad_optional_access + size=8 align=8 + base size=8 base align=8 +std::bad_optional_access (0x0x7319bb1e8548) 0 nearly-empty + vptr=((& std::bad_optional_access::_ZTVSt19bad_optional_access) + 16) +std::exception (0x0x7319bafc04e0) 0 nearly-empty + primary-for std::bad_optional_access (0x0x7319bb1e8548) + +Class std::__detail::__variant::__variant_cookie + size=1 align=1 + base size=0 base align=1 +std::__detail::__variant::__variant_cookie (0x0x7319bacc1ea0) 0 empty + +Class std::__detail::__variant::__variant_idx_cookie + size=1 align=1 + base size=0 base align=1 +std::__detail::__variant::__variant_idx_cookie (0x0x7319bacc1f00) 0 empty + +Class std::monostate + size=1 align=1 + base size=0 base align=1 +std::monostate (0x0x7319bad8af00) 0 empty + +Vtable for std::bad_variant_access +std::bad_variant_access::_ZTVSt18bad_variant_access: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt18bad_variant_access) +16 (int (*)(...))std::bad_variant_access::~bad_variant_access +24 (int (*)(...))std::bad_variant_access::~bad_variant_access +32 (int (*)(...))std::bad_variant_access::what + +Class std::bad_variant_access + size=16 align=8 + base size=16 base align=8 +std::bad_variant_access (0x0x7319bad7b548) 0 + vptr=((& std::bad_variant_access::_ZTVSt18bad_variant_access) + 16) +std::exception (0x0x7319badf3480) 0 nearly-empty + primary-for std::bad_variant_access (0x0x7319bad7b548) + +Class QtPrivate::QVersionTag + size=16 align=8 + base size=16 base align=8 +QtPrivate::QVersionTag (0x0x7319ba67a960) 0 + +Class lconv + size=96 align=8 + base size=96 base align=8 +lconv (0x0x7319ba6df960) 0 + +Class sched_param + size=4 align=4 + base size=4 base align=4 +sched_param (0x0x7319ba6dfa20) 0 + +Class timex + size=208 align=8 + base size=208 base align=8 +timex (0x0x7319ba6dfae0) 0 + +Class tm + size=56 align=8 + base size=56 base align=8 +tm (0x0x7319ba6dfb40) 0 + +Class itimerspec + size=32 align=8 + base size=32 base align=8 +itimerspec (0x0x7319ba6dfba0) 0 + +Class __jmp_buf_tag + size=200 align=8 + base size=200 base align=8 +__jmp_buf_tag (0x0x7319ba6dfc00) 0 + +Class _pthread_cleanup_buffer + size=32 align=8 + base size=32 base align=8 +_pthread_cleanup_buffer (0x0x7319ba6dfc60) 0 + +Class __cancel_jmp_buf_tag + size=72 align=8 + base size=72 base align=8 +__cancel_jmp_buf_tag (0x0x7319ba6dfcc0) 0 + +Class __pthread_cleanup_frame + size=24 align=8 + base size=24 base align=8 +__pthread_cleanup_frame (0x0x7319ba6dfd80) 0 + +Class __pthread_cleanup_class + size=24 align=8 + base size=24 base align=8 +__pthread_cleanup_class (0x0x7319ba6dfde0) 0 + +Vtable for __cxxabiv1::__forced_unwind +__cxxabiv1::__forced_unwind::_ZTVN10__cxxabiv115__forced_unwindE: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN10__cxxabiv115__forced_unwindE) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual + +Class __cxxabiv1::__forced_unwind + size=8 align=8 + base size=8 base align=8 +__cxxabiv1::__forced_unwind (0x0x7319ba405b40) 0 nearly-empty + vptr=((& __cxxabiv1::__forced_unwind::_ZTVN10__cxxabiv115__forced_unwindE) + 16) + +Class _G_fpos_t + size=16 align=8 + base size=16 base align=8 +_G_fpos_t (0x0x7319ba278cc0) 0 + +Class _G_fpos64_t + size=16 align=8 + base size=16 base align=8 +_G_fpos64_t (0x0x7319ba278d20) 0 + +Class _IO_FILE + size=216 align=8 + base size=216 base align=8 +_IO_FILE (0x0x7319ba278d80) 0 + +Class _IO_cookie_io_functions_t + size=32 align=8 + base size=32 base align=8 +_IO_cookie_io_functions_t (0x0x7319ba278de0) 0 + +Class std::locale + size=8 align=8 + base size=8 base align=8 +std::locale (0x0x7319b9e59780) 0 + +Vtable for std::locale::facet +std::locale::facet::_ZTVNSt6locale5facetE: 4 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTINSt6locale5facetE) +16 (int (*)(...))std::locale::facet::~facet +24 (int (*)(...))std::locale::facet::~facet + +Class std::locale::facet + size=16 align=8 + base size=12 base align=8 +std::locale::facet (0x0x7319b9e59b40) 0 + vptr=((& std::locale::facet::_ZTVNSt6locale5facetE) + 16) + +Class std::locale::id + size=8 align=8 + base size=8 base align=8 +std::locale::id (0x0x7319b9e59de0) 0 + +Class std::locale::_Impl + size=40 align=8 + base size=40 base align=8 +std::locale::_Impl (0x0x7319b9ea2000) 0 + +Class std::__cow_string + size=8 align=8 + base size=8 base align=8 +std::__cow_string (0x0x7319b9ea2f00) 0 + +Vtable for std::logic_error +std::logic_error::_ZTVSt11logic_error: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt11logic_error) +16 (int (*)(...))std::logic_error::~logic_error +24 (int (*)(...))std::logic_error::~logic_error +32 (int (*)(...))std::logic_error::what + +Class std::logic_error + size=16 align=8 + base size=16 base align=8 +std::logic_error (0x0x7319ba178a90) 0 + vptr=((& std::logic_error::_ZTVSt11logic_error) + 16) +std::exception (0x0x7319b9f04000) 0 nearly-empty + primary-for std::logic_error (0x0x7319ba178a90) + +Vtable for std::domain_error +std::domain_error::_ZTVSt12domain_error: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt12domain_error) +16 (int (*)(...))std::domain_error::~domain_error +24 (int (*)(...))std::domain_error::~domain_error +32 (int (*)(...))std::logic_error::what + +Class std::domain_error + size=16 align=8 + base size=16 base align=8 +std::domain_error (0x0x7319ba178af8) 0 + vptr=((& std::domain_error::_ZTVSt12domain_error) + 16) +std::logic_error (0x0x7319ba178b60) 0 + primary-for std::domain_error (0x0x7319ba178af8) +std::exception (0x0x7319b9f04060) 0 nearly-empty + primary-for std::logic_error (0x0x7319ba178b60) + +Vtable for std::invalid_argument +std::invalid_argument::_ZTVSt16invalid_argument: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt16invalid_argument) +16 (int (*)(...))std::invalid_argument::~invalid_argument +24 (int (*)(...))std::invalid_argument::~invalid_argument +32 (int (*)(...))std::logic_error::what + +Class std::invalid_argument + size=16 align=8 + base size=16 base align=8 +std::invalid_argument (0x0x7319ba178bc8) 0 + vptr=((& std::invalid_argument::_ZTVSt16invalid_argument) + 16) +std::logic_error (0x0x7319ba178c30) 0 + primary-for std::invalid_argument (0x0x7319ba178bc8) +std::exception (0x0x7319b9f040c0) 0 nearly-empty + primary-for std::logic_error (0x0x7319ba178c30) + +Vtable for std::length_error +std::length_error::_ZTVSt12length_error: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt12length_error) +16 (int (*)(...))std::length_error::~length_error +24 (int (*)(...))std::length_error::~length_error +32 (int (*)(...))std::logic_error::what + +Class std::length_error + size=16 align=8 + base size=16 base align=8 +std::length_error (0x0x7319ba178c98) 0 + vptr=((& std::length_error::_ZTVSt12length_error) + 16) +std::logic_error (0x0x7319ba178d00) 0 + primary-for std::length_error (0x0x7319ba178c98) +std::exception (0x0x7319b9f04120) 0 nearly-empty + primary-for std::logic_error (0x0x7319ba178d00) + +Vtable for std::out_of_range +std::out_of_range::_ZTVSt12out_of_range: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt12out_of_range) +16 (int (*)(...))std::out_of_range::~out_of_range +24 (int (*)(...))std::out_of_range::~out_of_range +32 (int (*)(...))std::logic_error::what + +Class std::out_of_range + size=16 align=8 + base size=16 base align=8 +std::out_of_range (0x0x7319ba178d68) 0 + vptr=((& std::out_of_range::_ZTVSt12out_of_range) + 16) +std::logic_error (0x0x7319ba178dd0) 0 + primary-for std::out_of_range (0x0x7319ba178d68) +std::exception (0x0x7319b9f04180) 0 nearly-empty + primary-for std::logic_error (0x0x7319ba178dd0) + +Vtable for std::runtime_error +std::runtime_error::_ZTVSt13runtime_error: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt13runtime_error) +16 (int (*)(...))std::runtime_error::~runtime_error +24 (int (*)(...))std::runtime_error::~runtime_error +32 (int (*)(...))std::runtime_error::what + +Class std::runtime_error + size=16 align=8 + base size=16 base align=8 +std::runtime_error (0x0x7319ba178e38) 0 + vptr=((& std::runtime_error::_ZTVSt13runtime_error) + 16) +std::exception (0x0x7319b9f041e0) 0 nearly-empty + primary-for std::runtime_error (0x0x7319ba178e38) + +Vtable for std::range_error +std::range_error::_ZTVSt11range_error: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt11range_error) +16 (int (*)(...))std::range_error::~range_error +24 (int (*)(...))std::range_error::~range_error +32 (int (*)(...))std::runtime_error::what + +Class std::range_error + size=16 align=8 + base size=16 base align=8 +std::range_error (0x0x7319ba178ea0) 0 + vptr=((& std::range_error::_ZTVSt11range_error) + 16) +std::runtime_error (0x0x7319ba178f08) 0 + primary-for std::range_error (0x0x7319ba178ea0) +std::exception (0x0x7319b9f04240) 0 nearly-empty + primary-for std::runtime_error (0x0x7319ba178f08) + +Vtable for std::overflow_error +std::overflow_error::_ZTVSt14overflow_error: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt14overflow_error) +16 (int (*)(...))std::overflow_error::~overflow_error +24 (int (*)(...))std::overflow_error::~overflow_error +32 (int (*)(...))std::runtime_error::what + +Class std::overflow_error + size=16 align=8 + base size=16 base align=8 +std::overflow_error (0x0x7319ba178f70) 0 + vptr=((& std::overflow_error::_ZTVSt14overflow_error) + 16) +std::runtime_error (0x0x7319b9f39000) 0 + primary-for std::overflow_error (0x0x7319ba178f70) +std::exception (0x0x7319b9f042a0) 0 nearly-empty + primary-for std::runtime_error (0x0x7319b9f39000) + +Vtable for std::underflow_error +std::underflow_error::_ZTVSt15underflow_error: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt15underflow_error) +16 (int (*)(...))std::underflow_error::~underflow_error +24 (int (*)(...))std::underflow_error::~underflow_error +32 (int (*)(...))std::runtime_error::what + +Class std::underflow_error + size=16 align=8 + base size=16 base align=8 +std::underflow_error (0x0x7319b9f39068) 0 + vptr=((& std::underflow_error::_ZTVSt15underflow_error) + 16) +std::runtime_error (0x0x7319b9f390d0) 0 + primary-for std::underflow_error (0x0x7319b9f39068) +std::exception (0x0x7319b9f04300) 0 nearly-empty + primary-for std::runtime_error (0x0x7319b9f390d0) + +Vtable for std::_V2::error_category +std::_V2::error_category::_ZTVNSt3_V214error_categoryE: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTINSt3_V214error_categoryE) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))std::_V2::error_category::_M_message +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))std::_V2::error_category::default_error_condition +64 (int (*)(...))std::_V2::error_category::equivalent +72 (int (*)(...))std::_V2::error_category::equivalent + +Class std::_V2::error_category + size=8 align=8 + base size=8 base align=8 +std::_V2::error_category (0x0x7319b9f04480) 0 nearly-empty + vptr=((& std::_V2::error_category::_ZTVNSt3_V214error_categoryE) + 16) + +Class std::error_code + size=16 align=8 + base size=16 base align=8 +std::error_code (0x0x7319b9f047e0) 0 + +Class std::error_condition + size=16 align=8 + base size=16 base align=8 +std::error_condition (0x0x7319b9f72000) 0 + +Vtable for std::system_error +std::system_error::_ZTVSt12system_error: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt12system_error) +16 (int (*)(...))std::system_error::~system_error +24 (int (*)(...))std::system_error::~system_error +32 (int (*)(...))std::runtime_error::what + +Class std::system_error + size=32 align=8 + base size=32 base align=8 +std::system_error (0x0x7319b9f394e0) 0 + vptr=((& std::system_error::_ZTVSt12system_error) + 16) +std::runtime_error (0x0x7319b9f39548) 0 + primary-for std::system_error (0x0x7319b9f394e0) +std::exception (0x0x7319b9f72ba0) 0 nearly-empty + primary-for std::runtime_error (0x0x7319b9f39548) + +Vtable for std::ios_base::failure +std::ios_base::failure::_ZTVNSt8ios_base7failureB5cxx11E: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTINSt8ios_base7failureB5cxx11E) +16 (int (*)(...))std::ios_base::failure::~failure +24 (int (*)(...))std::ios_base::failure::~failure +32 (int (*)(...))std::ios_base::failure::what + +Class std::ios_base::failure + size=32 align=8 + base size=32 base align=8 +std::ios_base::failure (0x0x7319b9f39820) 0 + vptr=((& std::ios_base::failure::_ZTVNSt8ios_base7failureB5cxx11E) + 16) +std::system_error (0x0x7319b9f39888) 0 + primary-for std::ios_base::failure (0x0x7319b9f39820) +std::runtime_error (0x0x7319b9f398f0) 0 + primary-for std::system_error (0x0x7319b9f39888) +std::exception (0x0x7319b9fd82a0) 0 nearly-empty + primary-for std::runtime_error (0x0x7319b9f398f0) + +Class std::ios_base::_Callback_list + size=24 align=8 + base size=24 base align=8 +std::ios_base::_Callback_list (0x0x7319b9fd8300) 0 + +Class std::ios_base::_Words + size=16 align=8 + base size=16 base align=8 +std::ios_base::_Words (0x0x7319b9fd8360) 0 + +Class std::ios_base::Init + size=1 align=1 + base size=0 base align=1 +std::ios_base::Init (0x0x7319b9fd83c0) 0 empty + +Vtable for std::ios_base +std::ios_base::_ZTVSt8ios_base: 4 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt8ios_base) +16 (int (*)(...))std::ios_base::~ios_base +24 (int (*)(...))std::ios_base::~ios_base + +Class std::ios_base + size=216 align=8 + base size=216 base align=8 +std::ios_base (0x0x7319b9fd8240) 0 + vptr=((& std::ios_base::_ZTVSt8ios_base) + 16) + +Vtable for __gnu_cxx::__concurrence_lock_error +__gnu_cxx::__concurrence_lock_error::_ZTVN9__gnu_cxx24__concurrence_lock_errorE: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN9__gnu_cxx24__concurrence_lock_errorE) +16 (int (*)(...))__gnu_cxx::__concurrence_lock_error::~__concurrence_lock_error +24 (int (*)(...))__gnu_cxx::__concurrence_lock_error::~__concurrence_lock_error +32 (int (*)(...))__gnu_cxx::__concurrence_lock_error::what + +Class __gnu_cxx::__concurrence_lock_error + size=8 align=8 + base size=8 base align=8 +__gnu_cxx::__concurrence_lock_error (0x0x7319b9c7f750) 0 nearly-empty + vptr=((& __gnu_cxx::__concurrence_lock_error::_ZTVN9__gnu_cxx24__concurrence_lock_errorE) + 16) +std::exception (0x0x7319b9d9b900) 0 nearly-empty + primary-for __gnu_cxx::__concurrence_lock_error (0x0x7319b9c7f750) + +Vtable for __gnu_cxx::__concurrence_unlock_error +__gnu_cxx::__concurrence_unlock_error::_ZTVN9__gnu_cxx26__concurrence_unlock_errorE: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN9__gnu_cxx26__concurrence_unlock_errorE) +16 (int (*)(...))__gnu_cxx::__concurrence_unlock_error::~__concurrence_unlock_error +24 (int (*)(...))__gnu_cxx::__concurrence_unlock_error::~__concurrence_unlock_error +32 (int (*)(...))__gnu_cxx::__concurrence_unlock_error::what + +Class __gnu_cxx::__concurrence_unlock_error + size=8 align=8 + base size=8 base align=8 +__gnu_cxx::__concurrence_unlock_error (0x0x7319b9c7f7b8) 0 nearly-empty + vptr=((& __gnu_cxx::__concurrence_unlock_error::_ZTVN9__gnu_cxx26__concurrence_unlock_errorE) + 16) +std::exception (0x0x7319b9d9ba20) 0 nearly-empty + primary-for __gnu_cxx::__concurrence_unlock_error (0x0x7319b9c7f7b8) + +Vtable for __gnu_cxx::__concurrence_broadcast_error +__gnu_cxx::__concurrence_broadcast_error::_ZTVN9__gnu_cxx29__concurrence_broadcast_errorE: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN9__gnu_cxx29__concurrence_broadcast_errorE) +16 (int (*)(...))__gnu_cxx::__concurrence_broadcast_error::~__concurrence_broadcast_error +24 (int (*)(...))__gnu_cxx::__concurrence_broadcast_error::~__concurrence_broadcast_error +32 (int (*)(...))__gnu_cxx::__concurrence_broadcast_error::what + +Class __gnu_cxx::__concurrence_broadcast_error + size=8 align=8 + base size=8 base align=8 +__gnu_cxx::__concurrence_broadcast_error (0x0x7319b9c7f820) 0 nearly-empty + vptr=((& __gnu_cxx::__concurrence_broadcast_error::_ZTVN9__gnu_cxx29__concurrence_broadcast_errorE) + 16) +std::exception (0x0x7319b9d9bb40) 0 nearly-empty + primary-for __gnu_cxx::__concurrence_broadcast_error (0x0x7319b9c7f820) + +Vtable for __gnu_cxx::__concurrence_wait_error +__gnu_cxx::__concurrence_wait_error::_ZTVN9__gnu_cxx24__concurrence_wait_errorE: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN9__gnu_cxx24__concurrence_wait_errorE) +16 (int (*)(...))__gnu_cxx::__concurrence_wait_error::~__concurrence_wait_error +24 (int (*)(...))__gnu_cxx::__concurrence_wait_error::~__concurrence_wait_error +32 (int (*)(...))__gnu_cxx::__concurrence_wait_error::what + +Class __gnu_cxx::__concurrence_wait_error + size=8 align=8 + base size=8 base align=8 +__gnu_cxx::__concurrence_wait_error (0x0x7319b9c7f8f0) 0 nearly-empty + vptr=((& __gnu_cxx::__concurrence_wait_error::_ZTVN9__gnu_cxx24__concurrence_wait_errorE) + 16) +std::exception (0x0x7319b9d9bc60) 0 nearly-empty + primary-for __gnu_cxx::__concurrence_wait_error (0x0x7319b9c7f8f0) + +Class __gnu_cxx::__mutex + size=40 align=8 + base size=40 base align=8 +__gnu_cxx::__mutex (0x0x7319b9dcd540) 0 + +Class __gnu_cxx::__recursive_mutex + size=40 align=8 + base size=40 base align=8 +__gnu_cxx::__recursive_mutex (0x0x7319b9dcd8a0) 0 + +Class __gnu_cxx::__scoped_lock + size=8 align=8 + base size=8 base align=8 +__gnu_cxx::__scoped_lock (0x0x7319b9dcdba0) 0 + +Class __gnu_cxx::__cond + size=48 align=8 + base size=48 base align=8 +__gnu_cxx::__cond (0x0x7319b9dcdf00) 0 + +Vtable for std::bad_weak_ptr +std::bad_weak_ptr::_ZTVSt12bad_weak_ptr: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt12bad_weak_ptr) +16 (int (*)(...))std::bad_weak_ptr::~bad_weak_ptr +24 (int (*)(...))std::bad_weak_ptr::~bad_weak_ptr +32 (int (*)(...))std::bad_weak_ptr::what + +Class std::bad_weak_ptr + size=8 align=8 + base size=8 base align=8 +std::bad_weak_ptr (0x0x7319b9c7f9c0) 0 nearly-empty + vptr=((& std::bad_weak_ptr::_ZTVSt12bad_weak_ptr) + 16) +std::exception (0x0x7319b9df6240) 0 nearly-empty + primary-for std::bad_weak_ptr (0x0x7319b9c7f9c0) + +Class std::_Sp_make_shared_tag + size=1 align=1 + base size=0 base align=1 +std::_Sp_make_shared_tag (0x0x7319b9a35f00) 0 empty + +Class std::__sp_array_delete + size=1 align=1 + base size=0 base align=1 +std::__sp_array_delete (0x0x7319b9a61480) 0 empty + +Class std::_Sp_locker + size=2 align=1 + base size=2 base align=1 +std::_Sp_locker (0x0x7319b9baa300) 0 + +Class q20::identity::is_transparent + size=1 align=1 + base size=0 base align=1 +q20::identity::is_transparent (0x0x7319b9be0720) 0 empty + +Class q20::identity + size=1 align=1 + base size=0 base align=1 +q20::identity (0x0x7319b9be06c0) 0 empty + +Class std::chrono::_V2::system_clock + size=1 align=1 + base size=0 base align=1 +std::chrono::_V2::system_clock (0x0x7319b98fd2a0) 0 empty + +Class std::chrono::_V2::steady_clock + size=1 align=1 + base size=0 base align=1 +std::chrono::_V2::steady_clock (0x0x7319b99808a0) 0 empty + +Class std::filesystem::__file_clock + size=1 align=1 + base size=0 base align=1 +std::filesystem::__file_clock (0x0x7319b9652480) 0 empty + +Class std::_Rb_tree_node_base + size=32 align=8 + base size=32 base align=8 +std::_Rb_tree_node_base (0x0x7319b96ced80) 0 + +Class std::_Rb_tree_header + size=40 align=8 + base size=40 base align=8 +std::_Rb_tree_header (0x0x7319b9718120) 0 + +Class std::__mutex_base + size=40 align=8 + base size=40 base align=8 +std::__mutex_base (0x0x7319b9592000) 0 + +Class std::mutex + size=40 align=8 + base size=40 base align=8 +std::mutex (0x0x7319b9454b60) 0 +std::__mutex_base (0x0x7319b9592060) 0 + +Class std::__condvar + size=48 align=8 + base size=48 base align=8 +std::__condvar (0x0x7319b9592240) 0 + +Class std::defer_lock_t + size=1 align=1 + base size=0 base align=1 +std::defer_lock_t (0x0x7319b95928a0) 0 empty + +Class std::try_to_lock_t + size=1 align=1 + base size=0 base align=1 +std::try_to_lock_t (0x0x7319b9592900) 0 empty + +Class std::adopt_lock_t + size=1 align=1 + base size=0 base align=1 +std::adopt_lock_t (0x0x7319b9592960) 0 empty + +Class std::__shared_mutex_pthread + size=56 align=8 + base size=56 base align=8 +std::__shared_mutex_pthread (0x0x7319b9592de0) 0 + +Class std::shared_mutex + size=56 align=8 + base size=56 base align=8 +std::shared_mutex (0x0x7319b95cd120) 0 + +Class std::shared_timed_mutex + size=56 align=8 + base size=56 base align=8 +std::shared_timed_mutex (0x0x7319b9454bc8) 0 +std::__shared_mutex_pthread (0x0x7319b95cd420) 0 + +Vtable for std::pmr::memory_resource +std::pmr::memory_resource::_ZTVNSt3pmr15memory_resourceE: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTINSt3pmr15memory_resourceE) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual + +Class std::pmr::memory_resource + size=8 align=8 + base size=8 base align=8 +std::pmr::memory_resource (0x0x7319b9207ae0) 0 nearly-empty + vptr=((& std::pmr::memory_resource::_ZTVNSt3pmr15memory_resourceE) + 16) + +Class std::pmr::pool_options + size=16 align=8 + base size=16 base align=8 +std::pmr::pool_options (0x0x7319b92415a0) 0 + +Class std::pmr::__pool_resource + size=56 align=8 + base size=52 base align=8 +std::pmr::__pool_resource (0x0x7319b9241600) 0 + +Vtable for std::pmr::synchronized_pool_resource +std::pmr::synchronized_pool_resource::_ZTVNSt3pmr26synchronized_pool_resourceE: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTINSt3pmr26synchronized_pool_resourceE) +16 (int (*)(...))std::pmr::synchronized_pool_resource::~synchronized_pool_resource +24 (int (*)(...))std::pmr::synchronized_pool_resource::~synchronized_pool_resource +32 (int (*)(...))std::pmr::synchronized_pool_resource::do_allocate +40 (int (*)(...))std::pmr::synchronized_pool_resource::do_deallocate +48 (int (*)(...))std::pmr::synchronized_pool_resource::do_is_equal + +Class std::pmr::synchronized_pool_resource + size=136 align=8 + base size=136 base align=8 +std::pmr::synchronized_pool_resource (0x0x7319b9211af8) 0 + vptr=((& std::pmr::synchronized_pool_resource::_ZTVNSt3pmr26synchronized_pool_resourceE) + 16) +std::pmr::memory_resource (0x0x7319b92a16c0) 0 nearly-empty + primary-for std::pmr::synchronized_pool_resource (0x0x7319b9211af8) + +Vtable for std::pmr::unsynchronized_pool_resource +std::pmr::unsynchronized_pool_resource::_ZTVNSt3pmr28unsynchronized_pool_resourceE: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTINSt3pmr28unsynchronized_pool_resourceE) +16 (int (*)(...))std::pmr::unsynchronized_pool_resource::~unsynchronized_pool_resource +24 (int (*)(...))std::pmr::unsynchronized_pool_resource::~unsynchronized_pool_resource +32 (int (*)(...))std::pmr::unsynchronized_pool_resource::do_allocate +40 (int (*)(...))std::pmr::unsynchronized_pool_resource::do_deallocate +48 (int (*)(...))std::pmr::unsynchronized_pool_resource::do_is_equal + +Class std::pmr::unsynchronized_pool_resource + size=72 align=8 + base size=72 base align=8 +std::pmr::unsynchronized_pool_resource (0x0x7319b9211b60) 0 + vptr=((& std::pmr::unsynchronized_pool_resource::_ZTVNSt3pmr28unsynchronized_pool_resourceE) + 16) +std::pmr::memory_resource (0x0x7319b92a1f00) 0 nearly-empty + primary-for std::pmr::unsynchronized_pool_resource (0x0x7319b9211b60) + +Vtable for std::pmr::monotonic_buffer_resource +std::pmr::monotonic_buffer_resource::_ZTVNSt3pmr25monotonic_buffer_resourceE: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTINSt3pmr25monotonic_buffer_resourceE) +16 (int (*)(...))std::pmr::monotonic_buffer_resource::~monotonic_buffer_resource +24 (int (*)(...))std::pmr::monotonic_buffer_resource::~monotonic_buffer_resource +32 (int (*)(...))std::pmr::monotonic_buffer_resource::do_allocate +40 (int (*)(...))std::pmr::monotonic_buffer_resource::do_deallocate +48 (int (*)(...))std::pmr::monotonic_buffer_resource::do_is_equal + +Class std::pmr::monotonic_buffer_resource + size=64 align=8 + base size=64 base align=8 +std::pmr::monotonic_buffer_resource (0x0x7319b9211bc8) 0 + vptr=((& std::pmr::monotonic_buffer_resource::_ZTVNSt3pmr25monotonic_buffer_resourceE) + 16) +std::pmr::memory_resource (0x0x7319b933c540) 0 nearly-empty + primary-for std::pmr::monotonic_buffer_resource (0x0x7319b9211bc8) + +Class Qt::partial_ordering + size=1 align=1 + base size=1 base align=1 +Qt::partial_ordering (0x0x7319b93de120) 0 + +Class Qt::weak_ordering + size=1 align=1 + base size=1 base align=1 +Qt::weak_ordering (0x0x7319b93def60) 0 + +Class Qt::strong_ordering + size=1 align=1 + base size=1 base align=1 +Qt::strong_ordering (0x0x7319b901ac60) 0 + +Class QPartialOrdering + size=1 align=1 + base size=1 base align=1 +QPartialOrdering (0x0x7319b911a5a0) 0 + +Class Qt::Disambiguated_t + size=1 align=1 + base size=0 base align=1 +Qt::Disambiguated_t (0x0x7319b8aa7d20) 0 empty + +Class QInternal + size=1 align=1 + base size=0 base align=1 +QInternal (0x0x7319b88e33c0) 0 empty + +Class QKeyCombination + size=4 align=4 + base size=4 base align=4 +QKeyCombination (0x0x7319b88e3420) 0 + +Class QtPrivate::FunctorCallBase + size=1 align=1 + base size=0 base align=1 +QtPrivate::FunctorCallBase (0x0x7319b897b3c0) 0 empty + +Class QtPrivate::QSlotObjectBase::Deleter + size=1 align=1 + base size=0 base align=1 +QtPrivate::QSlotObjectBase::Deleter (0x0x7319b8604180) 0 empty + +Class QtPrivate::QSlotObjectBase + size=16 align=8 + base size=16 base align=8 +QtPrivate::QSlotObjectBase (0x0x7319b8604120) 0 + +Class QtPrivate::SlotObjSharedPtr + size=8 align=8 + base size=8 base align=8 +QtPrivate::SlotObjSharedPtr (0x0x7319b876ca80) 0 + +Class QMethodRawArguments + size=8 align=8 + base size=8 base align=8 +QMethodRawArguments (0x0x7319b87d9720) 0 + +Class QGenericArgument + size=16 align=8 + base size=16 base align=8 +QGenericArgument (0x0x7319b87d9780) 0 + +Class QGenericReturnArgument + size=16 align=8 + base size=16 base align=8 +QGenericReturnArgument (0x0x7319b87ed0d0) 0 +QGenericArgument (0x0x7319b87d9a20) 0 + +Class QMetaMethodArgument + size=24 align=8 + base size=24 base align=8 +QMetaMethodArgument (0x0x7319b87d9ea0) 0 + +Class QMetaMethodReturnArgument + size=24 align=8 + base size=24 base align=8 +QMetaMethodReturnArgument (0x0x7319b87d9f00) 0 + +Class QMetaObject::SuperData + size=8 align=8 + base size=8 base align=8 +QMetaObject::SuperData (0x0x7319b84074e0) 0 + +Class QMetaObject::Data + size=56 align=8 + base size=56 base align=8 +QMetaObject::Data (0x0x7319b8407540) 0 + +Class QMetaObject + size=56 align=8 + base size=56 base align=8 +QMetaObject (0x0x7319b8407480) 0 + +Class QMetaObject::Connection + size=8 align=8 + base size=8 base align=8 +QMetaObject::Connection (0x0x7319b846d420) 0 + +Class QLatin1Char + size=1 align=1 + base size=1 base align=1 +QLatin1Char (0x0x7319b846dcc0) 0 + +Class QChar + size=2 align=2 + base size=2 base align=2 +QChar (0x0x7319b84cf300) 0 + +Class QtPrivate::RefCount + size=4 align=4 + base size=4 base align=4 +QtPrivate::RefCount (0x0x7319b82ade40) 0 + +Class QArrayData + size=16 align=8 + base size=16 base align=8 +QArrayData (0x0x7319b82d7180) 0 + +Class QtPrivate::AlignedQArrayData + size=16 align=16 + base size=16 base align=16 +QtPrivate::AlignedQArrayData (0x0x7319b82c72d8) 0 +QArrayData (0x0x7319b82d79c0) 0 + +Class QtPrivate::QContainerImplHelper + size=1 align=1 + base size=0 base align=1 +QtPrivate::QContainerImplHelper (0x0x7319b83a5960) 0 empty + +Class qxp::nonesuch + size=1 align=1 + base size=0 base align=1 +qxp::nonesuch (0x0x7319b83a5b40) 0 empty + +Class QByteArrayView + size=16 align=8 + base size=16 base align=8 +QByteArrayView (0x0x7319b8131960) 0 + +Class QByteArray + size=24 align=8 + base size=24 base align=8 +QByteArray (0x0x7319b7ef9c00) 0 + +Class QByteArray::FromBase64Result + size=32 align=8 + base size=28 base align=8 +QByteArray::FromBase64Result (0x0x7319b7a8fd80) 0 + +Class QStringView + size=16 align=8 + base size=16 base align=8 +QStringView (0x0x7319b7b6d600) 0 + +Class QChar::fromUcs4(char32_t)::R + size=4 align=2 + base size=4 base align=2 +QChar::fromUcs4(char32_t)::R (0x0x7319b7602f60) 0 + +Class QLatin1String + size=16 align=8 + base size=16 base align=8 +QLatin1String (0x0x7319b76283c0) 0 + +Class QtPrivate::hide_char8_t + size=1 align=1 + base size=0 base align=1 +QtPrivate::hide_char8_t (0x0x7319b750bc60) 0 empty + +Class QtPrivate::wrap_char + size=1 align=1 + base size=0 base align=1 +QtPrivate::wrap_char (0x0x7319b750bcc0) 0 empty + +Class QAnyStringView::QCharContainer + size=2 align=2 + base size=2 base align=2 +QAnyStringView::QCharContainer (0x0x7319b723e060) 0 + +Class QAnyStringView + size=16 align=8 + base size=16 base align=8 +QAnyStringView (0x0x7319b723e000) 0 + +Class QStringTokenizerBaseBase::tokenizer_state + size=24 align=8 + base size=24 base align=8 +QStringTokenizerBaseBase::tokenizer_state (0x0x7319b73ae180) 0 + +Class QStringTokenizerBaseBase + size=8 align=4 + base size=8 base align=4 +QStringTokenizerBaseBase (0x0x7319b73ae120) 0 + +Class QString + size=24 align=8 + base size=24 base align=8 +QString (0x0x7319b708b8a0) 0 + +Class QtPrivate::ArgBase + size=1 align=1 + base size=1 base align=1 +QtPrivate::ArgBase (0x0x7319b687a0c0) 0 + +Class QtPrivate::QStringViewArg + size=24 align=8 + base size=24 base align=8 +QtPrivate::QStringViewArg (0x0x7319b683e6e8) 0 +QtPrivate::ArgBase (0x0x7319b687a120) 0 + +Class QtPrivate::QLatin1StringArg + size=24 align=8 + base size=24 base align=8 +QtPrivate::QLatin1StringArg (0x0x7319b683e7b8) 0 +QtPrivate::ArgBase (0x0x7319b687a360) 0 + +Class QtPrivate::QAnyStringArg + size=24 align=8 + base size=24 base align=8 +QtPrivate::QAnyStringArg (0x0x7319b683e820) 0 +QtPrivate::ArgBase (0x0x7319b687a5a0) 0 + +Class QAbstractConcatenable + size=1 align=1 + base size=0 base align=1 +QAbstractConcatenable (0x0x7319b68adde0) 0 empty + +Class QStringConverterBase::State + size=48 align=8 + base size=48 base align=8 +QStringConverterBase::State (0x0x7319b694e240) 0 + +Class QStringConverterBase + size=1 align=1 + base size=0 base align=1 +QStringConverterBase (0x0x7319b694e1e0) 0 empty + +Class QStringConverter::Interface + size=40 align=8 + base size=40 base align=8 +QStringConverter::Interface (0x0x7319b694eba0) 0 + +Class QStringConverter + size=56 align=8 + base size=56 base align=8 +QStringConverter (0x0x7319b6918a90) 0 +QStringConverterBase (0x0x7319b694eb40) 0 empty + +Class QStringEncoder + size=56 align=8 + base size=56 base align=8 +QStringEncoder (0x0x7319b69beea0) 0 +QStringConverter (0x0x7319b69bef08) 0 +QStringConverterBase (0x0x7319b69db5a0) 0 empty + +Class QStringDecoder + size=56 align=8 + base size=56 base align=8 +QStringDecoder (0x0x7319b66a1000) 0 +QStringConverter (0x0x7319b66a1068) 0 +QStringConverterBase (0x0x7319b66869c0) 0 empty + +Class QHashSeed + size=8 align=8 + base size=8 base align=8 +QHashSeed (0x0x7319b66bbde0) 0 + +Class QtPrivate::QHashCombineMixer + size=1 align=1 + base size=0 base align=1 +QtPrivate::QHashCombineMixer (0x0x7319b6719900) 0 empty + +Class QtPrivate::QHashCombineCommutativeMixer + size=1 align=1 + base size=1 base align=1 +QtPrivate::QHashCombineCommutativeMixer (0x0x7319b66a1af8) 0 empty +std::plus (0x0x7319b66a1b60) 0 empty +std::binary_function (0x0x7319b6719a80) 0 empty + +Class QStringMatcher + size=312 align=8 + base size=312 base align=8 +QStringMatcher (0x0x7319b65de720) 0 + +Class QScopedPointerPodDeleter + size=1 align=1 + base size=0 base align=1 +QScopedPointerPodDeleter (0x0x7319b629bba0) 0 empty + +Class QIODeviceBase + size=1 align=1 + base size=0 base align=1 +QIODeviceBase (0x0x7319b62cf960) 0 empty + +Class QDataStream + size=32 align=8 + base size=30 base align=8 +QDataStream (0x0x7319b6591b60) 0 +QIODeviceBase (0x0x7319b62cf9c0) 0 empty + +Class QtPrivate::StreamStateSaver + size=16 align=8 + base size=12 base align=8 +QtPrivate::StreamStateSaver (0x0x7319b62cfc60) 0 + +Class qfloat16::Wrap + size=2 align=2 + base size=2 base align=2 +qfloat16::Wrap (0x0x7319b63a6600) 0 + +Class qfloat16 + size=2 align=2 + base size=2 base align=2 +qfloat16 (0x0x7319b63a65a0) 0 + +Class QtMetaContainerPrivate::QMetaContainerInterface + size=120 align=8 + base size=120 base align=8 +QtMetaContainerPrivate::QMetaContainerInterface (0x0x7319b5f41960) 0 + +Class QtMetaContainerPrivate::QMetaSequenceInterface + size=216 align=8 + base size=216 base align=8 +QtMetaContainerPrivate::QMetaSequenceInterface (0x0x7319b5ed1618) 0 +QtMetaContainerPrivate::QMetaContainerInterface (0x0x7319b5f41a20) 0 + +Class QtMetaContainerPrivate::QMetaAssociationInterface + size=240 align=8 + base size=240 base align=8 +QtMetaContainerPrivate::QMetaAssociationInterface (0x0x7319b5ed1680) 0 +QtMetaContainerPrivate::QMetaContainerInterface (0x0x7319b5f41ae0) 0 + +Class QMetaContainer + size=8 align=8 + base size=8 base align=8 +QMetaContainer (0x0x7319b5c72600) 0 + +Class QMetaSequence + size=8 align=8 + base size=8 base align=8 +QMetaSequence (0x0x7319b5ed17b8) 0 +QMetaContainer (0x0x7319b5c727e0) 0 + +Class QMetaAssociation + size=8 align=8 + base size=8 base align=8 +QMetaAssociation (0x0x7319b5ed1888) 0 +QMetaContainer (0x0x7319b5c72e40) 0 + +Class std::__detail::_List_node_base + size=16 align=8 + base size=16 base align=8 +std::__detail::_List_node_base (0x0x7319b5cc7600) 0 + +Class std::__detail::_List_node_header + size=24 align=8 + base size=24 base align=8 +std::__detail::_List_node_header (0x0x7319b5ed1958) 0 +std::__detail::_List_node_base (0x0x7319b5cc7660) 0 + +Class QtPrivate::QMetaTypeInterface + size=112 align=8 + base size=112 base align=8 +QtPrivate::QMetaTypeInterface (0x0x7319b5daa660) 0 + +Class QMetaType + size=8 align=8 + base size=8 base align=8 +QMetaType (0x0x7319b5daaba0) 0 + +Class QtMetaTypePrivate::QPairVariantInterfaceImpl + size=40 align=8 + base size=40 base align=8 +QtMetaTypePrivate::QPairVariantInterfaceImpl (0x0x7319b5aac240) 0 + +Class QtPrivate::QTypeNormalizer + size=16 align=8 + base size=16 base align=8 +QtPrivate::QTypeNormalizer (0x0x7319b59cc180) 0 + +Class QBindingStatus + size=32 align=8 + base size=32 base align=8 +QBindingStatus (0x0x7319b5216420) 0 + +Class QBindingStorage + size=16 align=8 + base size=16 base align=8 +QBindingStorage (0x0x7319b5216480) 0 + +Vtable for QObjectData +QObjectData::_ZTV11QObjectData: 4 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QObjectData) +16 (int (*)(...))__cxa_pure_virtual +24 (int (*)(...))__cxa_pure_virtual + +Class QObjectData + size=80 align=8 + base size=80 base align=8 +QObjectData (0x0x7319b52166c0) 0 + vptr=((& QObjectData::_ZTV11QObjectData) + 16) + +Class QObject::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QObject::QPrivateSignal (0x0x7319b5216e40) 0 empty + +Vtable for QObject +QObject::_ZTV7QObject: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI7QObject) +16 (int (*)(...))QObject::metaObject +24 (int (*)(...))QObject::qt_metacast +32 (int (*)(...))QObject::qt_metacall +40 (int (*)(...))QObject::~QObject +48 (int (*)(...))QObject::~QObject +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QObject + size=16 align=8 + base size=16 base align=8 +QObject (0x0x7319b5216de0) 0 + vptr=((& QObject::_ZTV7QObject) + 16) + +Class QSignalBlocker + size=16 align=8 + base size=10 base align=8 +QSignalBlocker (0x0x7319b532f000) 0 + +Class QAbstractAnimation::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAbstractAnimation::QPrivateSignal (0x0x7319b532f900) 0 empty + +Vtable for QAbstractAnimation +QAbstractAnimation::_ZTV18QAbstractAnimation: 18 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QAbstractAnimation) +16 (int (*)(...))QAbstractAnimation::metaObject +24 (int (*)(...))QAbstractAnimation::qt_metacast +32 (int (*)(...))QAbstractAnimation::qt_metacall +40 0 +48 0 +56 (int (*)(...))QAbstractAnimation::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))QAbstractAnimation::updateState +136 (int (*)(...))QAbstractAnimation::updateDirection + +Class QAbstractAnimation + size=16 align=8 + base size=16 base align=8 +QAbstractAnimation (0x0x7319b523a8f0) 0 + vptr=((& QAbstractAnimation::_ZTV18QAbstractAnimation) + 16) +QObject (0x0x7319b532f8a0) 0 + primary-for QAbstractAnimation (0x0x7319b523a8f0) + +Class QAnimationDriver::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAnimationDriver::QPrivateSignal (0x0x7319b532fc60) 0 empty + +Vtable for QAnimationDriver +QAnimationDriver::_ZTV16QAnimationDriver: 18 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI16QAnimationDriver) +16 (int (*)(...))QAnimationDriver::metaObject +24 (int (*)(...))QAnimationDriver::qt_metacast +32 (int (*)(...))QAnimationDriver::qt_metacall +40 (int (*)(...))QAnimationDriver::~QAnimationDriver +48 (int (*)(...))QAnimationDriver::~QAnimationDriver +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QAnimationDriver::advance +120 (int (*)(...))QAnimationDriver::elapsed +128 (int (*)(...))QAnimationDriver::start +136 (int (*)(...))QAnimationDriver::stop + +Class QAnimationDriver + size=16 align=8 + base size=16 base align=8 +QAnimationDriver (0x0x7319b523a958) 0 + vptr=((& QAnimationDriver::_ZTV16QAnimationDriver) + 16) +QObject (0x0x7319b532fc00) 0 + primary-for QAnimationDriver (0x0x7319b523a958) + +Class QDeadlineTimer + size=16 align=8 + base size=16 base align=8 +QDeadlineTimer (0x0x7319b532fde0) 0 + +Class QEventLoop::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QEventLoop::QPrivateSignal (0x0x7319b507d900) 0 empty + +Vtable for QEventLoop +QEventLoop::_ZTV10QEventLoop: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QEventLoop) +16 (int (*)(...))QEventLoop::metaObject +24 (int (*)(...))QEventLoop::qt_metacast +32 (int (*)(...))QEventLoop::qt_metacall +40 (int (*)(...))QEventLoop::~QEventLoop +48 (int (*)(...))QEventLoop::~QEventLoop +56 (int (*)(...))QEventLoop::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QEventLoop + size=16 align=8 + base size=16 base align=8 +QEventLoop (0x0x7319b508eea0) 0 + vptr=((& QEventLoop::_ZTV10QEventLoop) + 16) +QObject (0x0x7319b507d8a0) 0 + primary-for QEventLoop (0x0x7319b508eea0) + +Class QEventLoopLocker + size=8 align=8 + base size=8 base align=8 +QEventLoopLocker (0x0x7319b50eb0c0) 0 + +Class QAbstractEventDispatcher::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAbstractEventDispatcher::QPrivateSignal (0x0x7319b50eb540) 0 empty + +Class QAbstractEventDispatcher::TimerInfo + size=12 align=4 + base size=12 base align=4 +QAbstractEventDispatcher::TimerInfo (0x0x7319b50eb5a0) 0 + +Class QAbstractEventDispatcher::TimerInfoV2 + size=16 align=8 + base size=16 base align=8 +QAbstractEventDispatcher::TimerInfoV2 (0x0x7319b50eb600) 0 + +Vtable for QAbstractEventDispatcher +QAbstractEventDispatcher::_ZTV24QAbstractEventDispatcher: 26 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI24QAbstractEventDispatcher) +16 (int (*)(...))QAbstractEventDispatcher::metaObject +24 (int (*)(...))QAbstractEventDispatcher::qt_metacast +32 (int (*)(...))QAbstractEventDispatcher::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))__cxa_pure_virtual +160 (int (*)(...))__cxa_pure_virtual +168 (int (*)(...))__cxa_pure_virtual +176 (int (*)(...))__cxa_pure_virtual +184 (int (*)(...))__cxa_pure_virtual +192 (int (*)(...))QAbstractEventDispatcher::startingUp +200 (int (*)(...))QAbstractEventDispatcher::closingDown + +Class QAbstractEventDispatcher + size=16 align=8 + base size=16 base align=8 +QAbstractEventDispatcher (0x0x7319b50b11a0) 0 + vptr=((& QAbstractEventDispatcher::_ZTV24QAbstractEventDispatcher) + 16) +QObject (0x0x7319b50eb4e0) 0 + primary-for QAbstractEventDispatcher (0x0x7319b50b11a0) + +Class QAbstractEventDispatcherV2::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAbstractEventDispatcherV2::QPrivateSignal (0x0x7319b51bf3c0) 0 empty + +Vtable for QAbstractEventDispatcherV2 +QAbstractEventDispatcherV2::_ZTV26QAbstractEventDispatcherV2: 31 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI26QAbstractEventDispatcherV2) +16 (int (*)(...))QAbstractEventDispatcherV2::metaObject +24 (int (*)(...))QAbstractEventDispatcherV2::qt_metacast +32 (int (*)(...))QAbstractEventDispatcherV2::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))QAbstractEventDispatcherV2::registerTimer +144 (int (*)(...))QAbstractEventDispatcherV2::unregisterTimer +152 (int (*)(...))__cxa_pure_virtual +160 (int (*)(...))QAbstractEventDispatcherV2::registeredTimers +168 (int (*)(...))QAbstractEventDispatcherV2::remainingTime +176 (int (*)(...))__cxa_pure_virtual +184 (int (*)(...))__cxa_pure_virtual +192 (int (*)(...))QAbstractEventDispatcher::startingUp +200 (int (*)(...))QAbstractEventDispatcher::closingDown +208 (int (*)(...))__cxa_pure_virtual +216 (int (*)(...))__cxa_pure_virtual +224 (int (*)(...))__cxa_pure_virtual +232 (int (*)(...))__cxa_pure_virtual +240 (int (*)(...))QAbstractEventDispatcherV2::processEventsWithDeadline + +Class QAbstractEventDispatcherV2 + size=16 align=8 + base size=16 base align=8 +QAbstractEventDispatcherV2 (0x0x7319b51b0ea0) 0 + vptr=((& QAbstractEventDispatcherV2::_ZTV26QAbstractEventDispatcherV2) + 16) +QAbstractEventDispatcher (0x0x7319b51b0f08) 0 + primary-for QAbstractEventDispatcherV2 (0x0x7319b51b0ea0) +QObject (0x0x7319b51bf360) 0 + primary-for QAbstractEventDispatcher (0x0x7319b51b0f08) + +Class QHashDummyValue + size=1 align=1 + base size=0 base align=1 +QHashDummyValue (0x0x7319b51bf540) 0 empty + +Class QHashPrivate::SpanConstants + size=1 align=1 + base size=0 base align=1 +QHashPrivate::SpanConstants (0x0x7319b4e052a0) 0 empty + +Vtable for QTextStream +QTextStream::_ZTV11QTextStream: 4 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QTextStream) +16 (int (*)(...))QTextStream::~QTextStream +24 (int (*)(...))QTextStream::~QTextStream + +Class QTextStream + size=16 align=8 + base size=16 base align=8 +QTextStream (0x0x7319b4e59138) 0 + vptr=((& QTextStream::_ZTV11QTextStream) + 16) +QIODeviceBase (0x0x7319b4c45660) 0 empty + +Class QTextStreamManipulator + size=40 align=8 + base size=38 base align=8 +QTextStreamManipulator (0x0x7319b4a2c600) 0 + +Class QContiguousCacheData + size=40 align=8 + base size=40 base align=8 +QContiguousCacheData (0x0x7319b4a2cd20) 0 + +Class QSharedData + size=4 align=4 + base size=4 base align=4 +QSharedData (0x0x7319b4acb720) 0 + +Class QAdoptSharedDataTag + size=1 align=1 + base size=0 base align=1 +QAdoptSharedDataTag (0x0x7319b4acba80) 0 empty + +Class QtSharedPointer::NormalDeleter + size=1 align=1 + base size=0 base align=1 +QtSharedPointer::NormalDeleter (0x0x7319b4b60660) 0 empty + +Class QtSharedPointer::ExternalRefCountData + size=16 align=8 + base size=16 base align=8 +QtSharedPointer::ExternalRefCountData (0x0x7319b4b607e0) 0 + +Class QtPrivate::EnableInternalData + size=1 align=1 + base size=0 base align=1 +QtPrivate::EnableInternalData (0x0x7319b482bd20) 0 empty + +Class QVLABaseBase::free_deleter + size=1 align=1 + base size=0 base align=1 +QVLABaseBase::free_deleter (0x0x7319b4234120) 0 empty + +Class QVLABaseBase + size=24 align=8 + base size=24 base align=8 +QVLABaseBase (0x0x7319b42340c0) 0 + +Class QDebug::Stream + size=88 align=8 + base size=88 base align=8 +QDebug::Stream (0x0x7319b4048840) 0 + +Class QDebug + size=8 align=8 + base size=8 base align=8 +QDebug (0x0x7319b400f5b0) 0 +QIODeviceBase (0x0x7319b40487e0) 0 empty + +Class QDebugStateSaver + size=8 align=8 + base size=8 base align=8 +QDebugStateSaver (0x0x7319b3eafd80) 0 + +Class QNoDebug + size=1 align=1 + base size=0 base align=1 +QNoDebug (0x0x7319b3c22540) 0 empty + +Class QVariant::CborValueStandIn + size=24 align=8 + base size=24 base align=8 +QVariant::CborValueStandIn (0x0x7319b3a9fd80) 0 + +Class QVariant::PrivateShared + size=8 align=8 + base size=8 base align=8 +QVariant::PrivateShared (0x0x7319b3a9fde0) 0 + +Class QVariant::Private + size=32 align=8 + base size=32 base align=8 +QVariant::Private (0x0x7319b3a9fea0) 0 + +Class QVariant + size=32 align=8 + base size=32 base align=8 +QVariant (0x0x7319b3a9fd20) 0 + +Class QtPrivate::QVariantTypeCoercer + size=32 align=8 + base size=32 base align=8 +QtPrivate::QVariantTypeCoercer (0x0x7319b3966660) 0 + +Class QVariantConstPointer + size=32 align=8 + base size=32 base align=8 +QVariantConstPointer (0x0x7319b39668a0) 0 + +Class QModelRoleData + size=40 align=8 + base size=40 base align=8 +QModelRoleData (0x0x7319b3966a80) 0 + +Class QModelRoleDataSpan + size=16 align=8 + base size=16 base align=8 +QModelRoleDataSpan (0x0x7319b39db1e0) 0 + +Class QModelIndex + size=24 align=8 + base size=24 base align=8 +QModelIndex (0x0x7319b362b660) 0 + +Class QPersistentModelIndex + size=8 align=8 + base size=8 base align=8 +QPersistentModelIndex (0x0x7319b36f7de0) 0 + +Class QAbstractItemModel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAbstractItemModel::QPrivateSignal (0x0x7319b37a5cc0) 0 empty + +Vtable for QAbstractItemModel +QAbstractItemModel::_ZTV18QAbstractItemModel: 51 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QAbstractItemModel) +16 (int (*)(...))QAbstractItemModel::metaObject +24 (int (*)(...))QAbstractItemModel::qt_metacast +32 (int (*)(...))QAbstractItemModel::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))QAbstractItemModel::sibling +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))QAbstractItemModel::hasChildren +160 (int (*)(...))__cxa_pure_virtual +168 (int (*)(...))QAbstractItemModel::setData +176 (int (*)(...))QAbstractItemModel::headerData +184 (int (*)(...))QAbstractItemModel::setHeaderData +192 (int (*)(...))QAbstractItemModel::itemData +200 (int (*)(...))QAbstractItemModel::setItemData +208 (int (*)(...))QAbstractItemModel::clearItemData +216 (int (*)(...))QAbstractItemModel::mimeTypes +224 (int (*)(...))QAbstractItemModel::mimeData +232 (int (*)(...))QAbstractItemModel::canDropMimeData +240 (int (*)(...))QAbstractItemModel::dropMimeData +248 (int (*)(...))QAbstractItemModel::supportedDropActions +256 (int (*)(...))QAbstractItemModel::supportedDragActions +264 (int (*)(...))QAbstractItemModel::insertRows +272 (int (*)(...))QAbstractItemModel::insertColumns +280 (int (*)(...))QAbstractItemModel::removeRows +288 (int (*)(...))QAbstractItemModel::removeColumns +296 (int (*)(...))QAbstractItemModel::moveRows +304 (int (*)(...))QAbstractItemModel::moveColumns +312 (int (*)(...))QAbstractItemModel::fetchMore +320 (int (*)(...))QAbstractItemModel::canFetchMore +328 (int (*)(...))QAbstractItemModel::flags +336 (int (*)(...))QAbstractItemModel::sort +344 (int (*)(...))QAbstractItemModel::buddy +352 (int (*)(...))QAbstractItemModel::match +360 (int (*)(...))QAbstractItemModel::span +368 (int (*)(...))QAbstractItemModel::roleNames +376 (int (*)(...))QAbstractItemModel::multiData +384 (int (*)(...))QAbstractItemModel::submit +392 (int (*)(...))QAbstractItemModel::revert +400 (int (*)(...))QAbstractItemModel::resetInternalData + +Class QAbstractItemModel + size=16 align=8 + base size=16 base align=8 +QAbstractItemModel (0x0x7319b37baa90) 0 + vptr=((& QAbstractItemModel::_ZTV18QAbstractItemModel) + 16) +QObject (0x0x7319b37a5c60) 0 + primary-for QAbstractItemModel (0x0x7319b37baa90) + +Class QAbstractTableModel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAbstractTableModel::QPrivateSignal (0x0x7319b351dc60) 0 empty + +Vtable for QAbstractTableModel +QAbstractTableModel::_ZTV19QAbstractTableModel: 51 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QAbstractTableModel) +16 (int (*)(...))QAbstractTableModel::metaObject +24 (int (*)(...))QAbstractTableModel::qt_metacast +32 (int (*)(...))QAbstractTableModel::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QAbstractTableModel::index +120 (int (*)(...))QAbstractTableModel::parent +128 (int (*)(...))QAbstractTableModel::sibling +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))QAbstractTableModel::hasChildren +160 (int (*)(...))__cxa_pure_virtual +168 (int (*)(...))QAbstractItemModel::setData +176 (int (*)(...))QAbstractItemModel::headerData +184 (int (*)(...))QAbstractItemModel::setHeaderData +192 (int (*)(...))QAbstractItemModel::itemData +200 (int (*)(...))QAbstractItemModel::setItemData +208 (int (*)(...))QAbstractItemModel::clearItemData +216 (int (*)(...))QAbstractItemModel::mimeTypes +224 (int (*)(...))QAbstractItemModel::mimeData +232 (int (*)(...))QAbstractItemModel::canDropMimeData +240 (int (*)(...))QAbstractTableModel::dropMimeData +248 (int (*)(...))QAbstractItemModel::supportedDropActions +256 (int (*)(...))QAbstractItemModel::supportedDragActions +264 (int (*)(...))QAbstractItemModel::insertRows +272 (int (*)(...))QAbstractItemModel::insertColumns +280 (int (*)(...))QAbstractItemModel::removeRows +288 (int (*)(...))QAbstractItemModel::removeColumns +296 (int (*)(...))QAbstractItemModel::moveRows +304 (int (*)(...))QAbstractItemModel::moveColumns +312 (int (*)(...))QAbstractItemModel::fetchMore +320 (int (*)(...))QAbstractItemModel::canFetchMore +328 (int (*)(...))QAbstractTableModel::flags +336 (int (*)(...))QAbstractItemModel::sort +344 (int (*)(...))QAbstractItemModel::buddy +352 (int (*)(...))QAbstractItemModel::match +360 (int (*)(...))QAbstractItemModel::span +368 (int (*)(...))QAbstractItemModel::roleNames +376 (int (*)(...))QAbstractItemModel::multiData +384 (int (*)(...))QAbstractItemModel::submit +392 (int (*)(...))QAbstractItemModel::revert +400 (int (*)(...))QAbstractItemModel::resetInternalData + +Class QAbstractTableModel + size=16 align=8 + base size=16 base align=8 +QAbstractTableModel (0x0x7319b34b5270) 0 + vptr=((& QAbstractTableModel::_ZTV19QAbstractTableModel) + 16) +QAbstractItemModel (0x0x7319b34b52d8) 0 + primary-for QAbstractTableModel (0x0x7319b34b5270) +QObject (0x0x7319b351dc00) 0 + primary-for QAbstractItemModel (0x0x7319b34b52d8) + +Class QAbstractListModel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAbstractListModel::QPrivateSignal (0x0x7319b351dd80) 0 empty + +Vtable for QAbstractListModel +QAbstractListModel::_ZTV18QAbstractListModel: 51 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QAbstractListModel) +16 (int (*)(...))QAbstractListModel::metaObject +24 (int (*)(...))QAbstractListModel::qt_metacast +32 (int (*)(...))QAbstractListModel::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QAbstractListModel::index +120 (int (*)(...))QAbstractListModel::parent +128 (int (*)(...))QAbstractListModel::sibling +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))QAbstractListModel::columnCount +152 (int (*)(...))QAbstractListModel::hasChildren +160 (int (*)(...))__cxa_pure_virtual +168 (int (*)(...))QAbstractItemModel::setData +176 (int (*)(...))QAbstractItemModel::headerData +184 (int (*)(...))QAbstractItemModel::setHeaderData +192 (int (*)(...))QAbstractItemModel::itemData +200 (int (*)(...))QAbstractItemModel::setItemData +208 (int (*)(...))QAbstractItemModel::clearItemData +216 (int (*)(...))QAbstractItemModel::mimeTypes +224 (int (*)(...))QAbstractItemModel::mimeData +232 (int (*)(...))QAbstractItemModel::canDropMimeData +240 (int (*)(...))QAbstractListModel::dropMimeData +248 (int (*)(...))QAbstractItemModel::supportedDropActions +256 (int (*)(...))QAbstractItemModel::supportedDragActions +264 (int (*)(...))QAbstractItemModel::insertRows +272 (int (*)(...))QAbstractItemModel::insertColumns +280 (int (*)(...))QAbstractItemModel::removeRows +288 (int (*)(...))QAbstractItemModel::removeColumns +296 (int (*)(...))QAbstractItemModel::moveRows +304 (int (*)(...))QAbstractItemModel::moveColumns +312 (int (*)(...))QAbstractItemModel::fetchMore +320 (int (*)(...))QAbstractItemModel::canFetchMore +328 (int (*)(...))QAbstractListModel::flags +336 (int (*)(...))QAbstractItemModel::sort +344 (int (*)(...))QAbstractItemModel::buddy +352 (int (*)(...))QAbstractItemModel::match +360 (int (*)(...))QAbstractItemModel::span +368 (int (*)(...))QAbstractItemModel::roleNames +376 (int (*)(...))QAbstractItemModel::multiData +384 (int (*)(...))QAbstractItemModel::submit +392 (int (*)(...))QAbstractItemModel::revert +400 (int (*)(...))QAbstractItemModel::resetInternalData + +Class QAbstractListModel + size=16 align=8 + base size=16 base align=8 +QAbstractListModel (0x0x7319b34b5340) 0 + vptr=((& QAbstractListModel::_ZTV18QAbstractListModel) + 16) +QAbstractItemModel (0x0x7319b34b53a8) 0 + primary-for QAbstractListModel (0x0x7319b34b5340) +QObject (0x0x7319b351dd20) 0 + primary-for QAbstractItemModel (0x0x7319b34b53a8) + +Vtable for QAbstractNativeEventFilter +QAbstractNativeEventFilter::_ZTV26QAbstractNativeEventFilter: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI26QAbstractNativeEventFilter) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual + +Class QAbstractNativeEventFilter + size=16 align=8 + base size=16 base align=8 +QAbstractNativeEventFilter (0x0x7319b32299c0) 0 + vptr=((& QAbstractNativeEventFilter::_ZTV26QAbstractNativeEventFilter) + 16) + +Class QAbstractProxyModel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAbstractProxyModel::QPrivateSignal (0x0x7319b3229a80) 0 empty + +Vtable for QAbstractProxyModel +QAbstractProxyModel::_ZTV19QAbstractProxyModel: 56 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QAbstractProxyModel) +16 (int (*)(...))QAbstractProxyModel::metaObject +24 (int (*)(...))QAbstractProxyModel::qt_metacast +32 (int (*)(...))QAbstractProxyModel::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))QAbstractProxyModel::sibling +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))QAbstractProxyModel::hasChildren +160 (int (*)(...))QAbstractProxyModel::data +168 (int (*)(...))QAbstractProxyModel::setData +176 (int (*)(...))QAbstractProxyModel::headerData +184 (int (*)(...))QAbstractProxyModel::setHeaderData +192 (int (*)(...))QAbstractProxyModel::itemData +200 (int (*)(...))QAbstractProxyModel::setItemData +208 (int (*)(...))QAbstractProxyModel::clearItemData +216 (int (*)(...))QAbstractProxyModel::mimeTypes +224 (int (*)(...))QAbstractProxyModel::mimeData +232 (int (*)(...))QAbstractProxyModel::canDropMimeData +240 (int (*)(...))QAbstractProxyModel::dropMimeData +248 (int (*)(...))QAbstractProxyModel::supportedDropActions +256 (int (*)(...))QAbstractProxyModel::supportedDragActions +264 (int (*)(...))QAbstractItemModel::insertRows +272 (int (*)(...))QAbstractItemModel::insertColumns +280 (int (*)(...))QAbstractItemModel::removeRows +288 (int (*)(...))QAbstractItemModel::removeColumns +296 (int (*)(...))QAbstractItemModel::moveRows +304 (int (*)(...))QAbstractItemModel::moveColumns +312 (int (*)(...))QAbstractProxyModel::fetchMore +320 (int (*)(...))QAbstractProxyModel::canFetchMore +328 (int (*)(...))QAbstractProxyModel::flags +336 (int (*)(...))QAbstractProxyModel::sort +344 (int (*)(...))QAbstractProxyModel::buddy +352 (int (*)(...))QAbstractItemModel::match +360 (int (*)(...))QAbstractProxyModel::span +368 (int (*)(...))QAbstractProxyModel::roleNames +376 (int (*)(...))QAbstractItemModel::multiData +384 (int (*)(...))QAbstractProxyModel::submit +392 (int (*)(...))QAbstractProxyModel::revert +400 (int (*)(...))QAbstractItemModel::resetInternalData +408 (int (*)(...))QAbstractProxyModel::setSourceModel +416 (int (*)(...))__cxa_pure_virtual +424 (int (*)(...))__cxa_pure_virtual +432 (int (*)(...))QAbstractProxyModel::mapSelectionToSource +440 (int (*)(...))QAbstractProxyModel::mapSelectionFromSource + +Class QAbstractProxyModel + size=16 align=8 + base size=16 base align=8 +QAbstractProxyModel (0x0x7319b322d478) 0 + vptr=((& QAbstractProxyModel::_ZTV19QAbstractProxyModel) + 16) +QAbstractItemModel (0x0x7319b322d4e0) 0 + primary-for QAbstractProxyModel (0x0x7319b322d478) +QObject (0x0x7319b3229a20) 0 + primary-for QAbstractItemModel (0x0x7319b322d4e0) + +Class QAnimationGroup::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAnimationGroup::QPrivateSignal (0x0x7319b3229c60) 0 empty + +Vtable for QAnimationGroup +QAnimationGroup::_ZTV15QAnimationGroup: 18 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QAnimationGroup) +16 (int (*)(...))QAnimationGroup::metaObject +24 (int (*)(...))QAnimationGroup::qt_metacast +32 (int (*)(...))QAnimationGroup::qt_metacall +40 0 +48 0 +56 (int (*)(...))QAnimationGroup::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))QAbstractAnimation::updateState +136 (int (*)(...))QAbstractAnimation::updateDirection + +Class QAnimationGroup + size=16 align=8 + base size=16 base align=8 +QAnimationGroup (0x0x7319b322d548) 0 + vptr=((& QAnimationGroup::_ZTV15QAnimationGroup) + 16) +QAbstractAnimation (0x0x7319b322d5b0) 0 + primary-for QAnimationGroup (0x0x7319b322d548) +QObject (0x0x7319b3229c00) 0 + primary-for QAbstractAnimation (0x0x7319b322d5b0) + +Class QBasicMutex + size=8 align=8 + base size=8 base align=8 +QBasicMutex (0x0x7319b327d120) 0 + +Class QMutex + size=8 align=8 + base size=8 base align=8 +QMutex (0x0x7319b322d618) 0 +QBasicMutex (0x0x7319b32e0000) 0 + +Class QRecursiveMutex + size=24 align=8 + base size=24 base align=8 +QRecursiveMutex (0x0x7319b32e0480) 0 + +Class QBasicTimer + size=4 align=4 + base size=4 base align=4 +QBasicTimer (0x0x7319b32e0e40) 0 + +Class QEvent::InputEventTag + size=1 align=1 + base size=0 base align=1 +QEvent::InputEventTag (0x0x7319b33c1e40) 0 empty + +Class QEvent::PointerEventTag + size=1 align=1 + base size=0 base align=1 +QEvent::PointerEventTag (0x0x7319b33c1ea0) 0 empty + +Class QEvent::SinglePointEventTag + size=1 align=1 + base size=0 base align=1 +QEvent::SinglePointEventTag (0x0x7319b33c1f00) 0 empty + +Vtable for QEvent +QEvent::_ZTV6QEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI6QEvent) +16 (int (*)(...))QEvent::~QEvent +24 (int (*)(...))QEvent::~QEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QEvent::clone + +Class QEvent + size=16 align=8 + base size=16 base align=8 +QEvent (0x0x7319b33c1de0) 0 + vptr=((& QEvent::_ZTV6QEvent) + 16) + +Vtable for QTimerEvent +QTimerEvent::_ZTV11QTimerEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QTimerEvent) +16 (int (*)(...))QTimerEvent::~QTimerEvent +24 (int (*)(...))QTimerEvent::~QTimerEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QTimerEvent::clone + +Class QTimerEvent + size=24 align=8 + base size=20 base align=8 +QTimerEvent (0x0x7319b33c7dd0) 0 + vptr=((& QTimerEvent::_ZTV11QTimerEvent) + 16) +QEvent (0x0x7319b300c8a0) 0 + primary-for QTimerEvent (0x0x7319b33c7dd0) + +Vtable for QChildEvent +QChildEvent::_ZTV11QChildEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QChildEvent) +16 (int (*)(...))QChildEvent::~QChildEvent +24 (int (*)(...))QChildEvent::~QChildEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QChildEvent::clone + +Class QChildEvent + size=24 align=8 + base size=24 base align=8 +QChildEvent (0x0x7319b33c7e38) 0 + vptr=((& QChildEvent::_ZTV11QChildEvent) + 16) +QEvent (0x0x7319b300ca20) 0 + primary-for QChildEvent (0x0x7319b33c7e38) + +Vtable for QDynamicPropertyChangeEvent +QDynamicPropertyChangeEvent::_ZTV27QDynamicPropertyChangeEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI27QDynamicPropertyChangeEvent) +16 (int (*)(...))QDynamicPropertyChangeEvent::~QDynamicPropertyChangeEvent +24 (int (*)(...))QDynamicPropertyChangeEvent::~QDynamicPropertyChangeEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QDynamicPropertyChangeEvent::clone + +Class QDynamicPropertyChangeEvent + size=40 align=8 + base size=40 base align=8 +QDynamicPropertyChangeEvent (0x0x7319b33c7ea0) 0 + vptr=((& QDynamicPropertyChangeEvent::_ZTV27QDynamicPropertyChangeEvent) + 16) +QEvent (0x0x7319b300cc00) 0 + primary-for QDynamicPropertyChangeEvent (0x0x7319b33c7ea0) + +Class QCoreApplication::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QCoreApplication::QPrivateSignal (0x0x7319b3046060) 0 empty + +Vtable for QCoreApplication +QCoreApplication::_ZTV16QCoreApplication: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI16QCoreApplication) +16 (int (*)(...))QCoreApplication::metaObject +24 (int (*)(...))QCoreApplication::qt_metacast +32 (int (*)(...))QCoreApplication::qt_metacall +40 (int (*)(...))QCoreApplication::~QCoreApplication +48 (int (*)(...))QCoreApplication::~QCoreApplication +56 (int (*)(...))QCoreApplication::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QCoreApplication::notify +120 (int (*)(...))QCoreApplication::compressEvent + +Class QCoreApplication + size=16 align=8 + base size=16 base align=8 +QCoreApplication (0x0x7319b3044068) 0 + vptr=((& QCoreApplication::_ZTV16QCoreApplication) + 16) +QObject (0x0x7319b3046000) 0 + primary-for QCoreApplication (0x0x7319b3044068) + +Class QAssociativeIterator + size=16 align=8 + base size=16 base align=8 +QAssociativeIterator (0x0x7319b3044a28) 0 +QIterator (0x0x7319b3044a90) 0 +QBaseIterator (0x0x7319b3046f00) 0 + +Class QAssociativeConstIterator + size=16 align=8 + base size=16 base align=8 +QAssociativeConstIterator (0x0x7319b3044bc8) 0 +QConstIterator (0x0x7319b3044c30) 0 +QBaseIterator (0x0x7319b30ba540) 0 + +Class QAssociativeIterable + size=24 align=8 + base size=24 base align=8 +QAssociativeIterable (0x0x7319b3044d00) 0 +QIterable (0x0x7319b30baa80) 0 + +Class QBitArray + size=24 align=8 + base size=24 base align=8 +QBitArray (0x0x7319b2e01f00) 0 + +Class QBitRef + size=16 align=8 + base size=16 base align=8 +QBitRef (0x0x7319b2e6f900) 0 + +Class QIODevice::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QIODevice::QPrivateSignal (0x0x7319b2f434e0) 0 empty + +Vtable for QIODevice +QIODevice::_ZTV9QIODevice: 31 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QIODevice) +16 (int (*)(...))QIODevice::metaObject +24 (int (*)(...))QIODevice::qt_metacast +32 (int (*)(...))QIODevice::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QIODevice::isSequential +120 (int (*)(...))QIODevice::open +128 (int (*)(...))QIODevice::close +136 (int (*)(...))QIODevice::pos +144 (int (*)(...))QIODevice::size +152 (int (*)(...))QIODevice::seek +160 (int (*)(...))QIODevice::atEnd +168 (int (*)(...))QIODevice::reset +176 (int (*)(...))QIODevice::bytesAvailable +184 (int (*)(...))QIODevice::bytesToWrite +192 (int (*)(...))QIODevice::canReadLine +200 (int (*)(...))QIODevice::waitForReadyRead +208 (int (*)(...))QIODevice::waitForBytesWritten +216 (int (*)(...))__cxa_pure_virtual +224 (int (*)(...))QIODevice::readLineData +232 (int (*)(...))QIODevice::skipData +240 (int (*)(...))__cxa_pure_virtual + +Class QIODevice + size=16 align=8 + base size=16 base align=8 +QIODevice (0x0x7319b2f3da10) 0 + vptr=((& QIODevice::_ZTV9QIODevice) + 16) +QObject (0x0x7319b2f43420) 0 + primary-for QIODevice (0x0x7319b2f3da10) +QIODeviceBase (0x0x7319b2f43480) 0 empty + +Class QBuffer::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QBuffer::QPrivateSignal (0x0x7319b2c58a20) 0 empty + +Vtable for QBuffer +QBuffer::_ZTV7QBuffer: 31 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI7QBuffer) +16 (int (*)(...))QBuffer::metaObject +24 (int (*)(...))QBuffer::qt_metacast +32 (int (*)(...))QBuffer::qt_metacall +40 (int (*)(...))QBuffer::~QBuffer +48 (int (*)(...))QBuffer::~QBuffer +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QBuffer::connectNotify +104 (int (*)(...))QBuffer::disconnectNotify +112 (int (*)(...))QIODevice::isSequential +120 (int (*)(...))QBuffer::open +128 (int (*)(...))QBuffer::close +136 (int (*)(...))QBuffer::pos +144 (int (*)(...))QBuffer::size +152 (int (*)(...))QBuffer::seek +160 (int (*)(...))QBuffer::atEnd +168 (int (*)(...))QIODevice::reset +176 (int (*)(...))QIODevice::bytesAvailable +184 (int (*)(...))QIODevice::bytesToWrite +192 (int (*)(...))QBuffer::canReadLine +200 (int (*)(...))QIODevice::waitForReadyRead +208 (int (*)(...))QIODevice::waitForBytesWritten +216 (int (*)(...))QBuffer::readData +224 (int (*)(...))QIODevice::readLineData +232 (int (*)(...))QIODevice::skipData +240 (int (*)(...))QBuffer::writeData + +Class QBuffer + size=16 align=8 + base size=16 base align=8 +QBuffer (0x0x7319b2c693a8) 0 + vptr=((& QBuffer::_ZTV7QBuffer) + 16) +QIODevice (0x0x7319b2f8e070) 0 + primary-for QBuffer (0x0x7319b2c693a8) +QObject (0x0x7319b2c58960) 0 + primary-for QIODevice (0x0x7319b2f8e070) +QIODeviceBase (0x0x7319b2c589c0) 0 empty + +Class QByteArrayMatcher::Data + size=272 align=8 + base size=272 base align=8 +QByteArrayMatcher::Data (0x0x7319b2c58c00) 0 + +Class QByteArrayMatcher + size=1056 align=8 + base size=1056 base align=8 +QByteArrayMatcher (0x0x7319b2c58ba0) 0 + +Class QStaticByteArrayMatcherBase::Skiptable + size=256 align=1 + base size=256 base align=1 +QStaticByteArrayMatcherBase::Skiptable (0x0x7319b2c58f60) 0 + +Class QStaticByteArrayMatcherBase + size=256 align=16 + base size=256 base align=16 +QStaticByteArrayMatcherBase (0x0x7319b2c58f00) 0 + +Class QLocale + size=8 align=8 + base size=8 base align=8 +QLocale (0x0x7319b2cef660) 0 + +Class QCalendar::YearMonthDay + size=12 align=4 + base size=12 base align=4 +QCalendar::YearMonthDay (0x0x7319bb335480) 0 + +Class QCalendar::SystemId + size=8 align=8 + base size=8 base align=8 +QCalendar::SystemId (0x0x7319bb359360) 0 + +Class QCalendar + size=8 align=8 + base size=8 base align=8 +QCalendar (0x0x7319bb3353c0) 0 + +Class QCborError + size=4 align=4 + base size=4 base align=4 +QCborError (0x0x7319ba50f9c0) 0 + +Class QDate + size=8 align=8 + base size=8 base align=8 +QDate (0x0x7319b7e09c00) 0 + +Class QTime + size=4 align=4 + base size=4 base align=4 +QTime (0x0x7319b6030de0) 0 + +Class QDateTime::ShortData + size=8 align=8 + base size=8 base align=8 +QDateTime::ShortData (0x0x7319b399cd80) 0 + +Class QDateTime::Data + size=8 align=8 + base size=8 base align=8 +QDateTime::Data (0x0x7319b399cde0) 0 + +Class QDateTime + size=8 align=8 + base size=8 base align=8 +QDateTime (0x0x7319b399cb40) 0 + +Class QRegularExpression + size=8 align=8 + base size=8 base align=8 +QRegularExpression (0x0x7319bba17600) 0 + +Class QRegularExpressionMatch + size=8 align=8 + base size=8 base align=8 +QRegularExpressionMatch (0x0x7319b7e91d20) 0 + +Class QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIteratorSentinel + size=1 align=1 + base size=0 base align=1 +QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIteratorSentinel (0x0x7319b7da9900) 0 empty + +Class QRegularExpressionMatchIterator + size=8 align=8 + base size=8 base align=8 +QRegularExpressionMatchIterator (0x0x7319b7da9de0) 0 + +Class QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator + size=24 align=8 + base size=17 base align=8 +QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator (0x0x7319b7da9f60) 0 + +Class QUrl + size=8 align=8 + base size=8 base align=8 +QUrl (0x0x7319b79a4c00) 0 + +Class QUuid::Id128Bytes + size=16 align=16 + base size=16 base align=16 +QUuid::Id128Bytes (0x0x7319bb11ff60) 0 + +Class QUuid + size=16 align=4 + base size=16 base align=4 +QUuid (0x0x7319bb11ff00) 0 + +Class QCborParserError + size=16 align=8 + base size=16 base align=8 +QCborParserError (0x0x7319b875b240) 0 + +Class QCborValue + size=24 align=8 + base size=20 base align=8 +QCborValue (0x0x7319b875b300) 0 + +Class QCborValueConstRef + size=16 align=8 + base size=16 base align=8 +QCborValueConstRef (0x0x7319b7801420) 0 + +Class QCborValueRef + size=16 align=8 + base size=16 base align=8 +QCborValueRef (0x0x7319bb9984e0) 0 +QCborValueConstRef (0x0x7319b71007e0) 0 + +Class QCborArray::Iterator + size=16 align=8 + base size=16 base align=8 +QCborArray::Iterator (0x0x7319b716acc0) 0 + +Class QCborArray::ConstIterator + size=16 align=8 + base size=16 base align=8 +QCborArray::ConstIterator (0x0x7319b716ad20) 0 + +Class QCborArray + size=8 align=8 + base size=8 base align=8 +QCborArray (0x0x7319b716ac60) 0 + +Class QCborMap::Iterator + size=16 align=8 + base size=16 base align=8 +QCborMap::Iterator (0x0x7319b510c360) 0 + +Class QCborMap::ConstIterator + size=16 align=8 + base size=16 base align=8 +QCborMap::ConstIterator (0x0x7319b510c3c0) 0 + +Class QCborMap + size=8 align=8 + base size=8 base align=8 +QCborMap (0x0x7319b510c300) 0 + +Class QCborStreamReader + size=24 align=8 + base size=20 base align=8 +QCborStreamReader (0x0x7319b7413660) 0 + +Class QCborStreamWriter + size=8 align=8 + base size=8 base align=8 +QCborStreamWriter (0x0x7319b6d9fae0) 0 + +Class QtPrivate::RefCounted + size=4 align=4 + base size=4 base align=4 +QtPrivate::RefCounted (0x0x7319bfb83120) 0 + +Class QPropertyBindingPrivatePtr + size=8 align=8 + base size=8 base align=8 +QPropertyBindingPrivatePtr (0x0x7319bfb832a0) 0 + +Class QUntypedPropertyData + size=1 align=1 + base size=0 base align=1 +QUntypedPropertyData (0x0x7319b7349c00) 0 empty + +Class QPropertyProxyBindingData + size=24 align=8 + base size=24 base align=8 +QPropertyProxyBindingData (0x0x7319b7349c60) 0 + +Class QtPrivate::MSVCWorkAround + size=1 align=1 + base size=0 base align=1 +QtPrivate::MSVCWorkAround (0x0x7319b7349cc0) 0 empty + +Class QtPrivate::BindingFunctionVTable + size=32 align=8 + base size=32 base align=8 +QtPrivate::BindingFunctionVTable (0x0x7319b7349d20) 0 + +Class QtPrivate::QPropertyBindingFunction + size=16 align=8 + base size=16 base align=8 +QtPrivate::QPropertyBindingFunction (0x0x7319b68b0300) 0 + +Class QtPrivate::QPropertyBindingData + size=8 align=8 + base size=8 base align=8 +QtPrivate::QPropertyBindingData (0x0x7319b68b0360) 0 + +Class std::experimental::fundamentals_v2::source_location + size=24 align=8 + base size=24 base align=8 +std::experimental::fundamentals_v2::source_location (0x0x7319b68b0b40) 0 + +Class QScopedPropertyUpdateGroup + size=1 align=1 + base size=0 base align=1 +QScopedPropertyUpdateGroup (0x0x7319b4605000) 0 empty + +Class QPropertyBindingSourceLocation + size=24 align=8 + base size=24 base align=8 +QPropertyBindingSourceLocation (0x0x7319b4605600) 0 + +Class QPropertyBindingError + size=8 align=8 + base size=8 base align=8 +QPropertyBindingError (0x0x7319b4605960) 0 + +Class QUntypedPropertyBinding + size=8 align=8 + base size=8 base align=8 +QUntypedPropertyBinding (0x0x7319b4605ea0) 0 + +Class QPropertyObserverBase + size=24 align=8 + base size=24 base align=8 +QPropertyObserverBase (0x0x7319b7ae7120) 0 + +Class QPropertyObserver + size=24 align=8 + base size=24 base align=8 +QPropertyObserver (0x0x7319bb6be9c0) 0 +QPropertyObserverBase (0x0x7319b7ae72a0) 0 + +Class QPropertyNotifier + size=56 align=8 + base size=56 base align=8 +QPropertyNotifier (0x0x7319bb6bea28) 0 +QPropertyObserver (0x0x7319bb6beb60) 0 +QPropertyObserverBase (0x0x7319b7ae7780) 0 + +Class QtPrivate::QBindableInterface + size=56 align=8 + base size=56 base align=8 +QtPrivate::QBindableInterface (0x0x7319b6ec7e40) 0 + +Class QUntypedBindable + size=16 align=8 + base size=16 base align=8 +QUntypedBindable (0x0x7319b6d67300) 0 + +Class QTimer::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTimer::QPrivateSignal (0x0x7319b74427e0) 0 empty + +Vtable for QTimer +QTimer::_ZTV6QTimer: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI6QTimer) +16 (int (*)(...))QTimer::metaObject +24 (int (*)(...))QTimer::qt_metacast +32 (int (*)(...))QTimer::qt_metacall +40 (int (*)(...))QTimer::~QTimer +48 (int (*)(...))QTimer::~QTimer +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QTimer::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QTimer + size=16 align=8 + base size=16 base align=8 +QTimer (0x0x7319bb6dc068) 0 + vptr=((& QTimer::_ZTV6QTimer) + 16) +QObject (0x0x7319b7442780) 0 + primary-for QTimer (0x0x7319bb6dc068) + +Class QChronoTimer::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QChronoTimer::QPrivateSignal (0x0x7319b3d5bc00) 0 empty + +Vtable for QChronoTimer +QChronoTimer::_ZTV12QChronoTimer: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QChronoTimer) +16 (int (*)(...))QChronoTimer::metaObject +24 (int (*)(...))QChronoTimer::qt_metacast +32 (int (*)(...))QChronoTimer::qt_metacall +40 (int (*)(...))QChronoTimer::~QChronoTimer +48 (int (*)(...))QChronoTimer::~QChronoTimer +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QChronoTimer::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QChronoTimer + size=16 align=8 + base size=16 base align=8 +QChronoTimer (0x0x7319bb6dc9c0) 0 + vptr=((& QChronoTimer::_ZTV12QChronoTimer) + 16) +QObject (0x0x7319b3d5bba0) 0 + primary-for QChronoTimer (0x0x7319bb6dc9c0) + +Class QCollatorSortKey + size=8 align=8 + base size=8 base align=8 +QCollatorSortKey (0x0x7319b2803240) 0 + +Class QCollator + size=8 align=8 + base size=8 base align=8 +QCollator (0x0x7319b28033c0) 0 + +Class QCommandLineOption + size=8 align=8 + base size=8 base align=8 +QCommandLineOption (0x0x7319b282f7e0) 0 + +Class QCommandLineParser + size=8 align=8 + base size=8 base align=8 +QCommandLineParser (0x0x7319b2855d20) 0 + +Class QConcatenateTablesProxyModel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QConcatenateTablesProxyModel::QPrivateSignal (0x0x7319b2855e40) 0 empty + +Vtable for QConcatenateTablesProxyModel +QConcatenateTablesProxyModel::_ZTV28QConcatenateTablesProxyModel: 51 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI28QConcatenateTablesProxyModel) +16 (int (*)(...))QConcatenateTablesProxyModel::metaObject +24 (int (*)(...))QConcatenateTablesProxyModel::qt_metacast +32 (int (*)(...))QConcatenateTablesProxyModel::qt_metacall +40 (int (*)(...))QConcatenateTablesProxyModel::~QConcatenateTablesProxyModel +48 (int (*)(...))QConcatenateTablesProxyModel::~QConcatenateTablesProxyModel +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QConcatenateTablesProxyModel::index +120 (int (*)(...))QConcatenateTablesProxyModel::parent +128 (int (*)(...))QAbstractItemModel::sibling +136 (int (*)(...))QConcatenateTablesProxyModel::rowCount +144 (int (*)(...))QConcatenateTablesProxyModel::columnCount +152 (int (*)(...))QAbstractItemModel::hasChildren +160 (int (*)(...))QConcatenateTablesProxyModel::data +168 (int (*)(...))QConcatenateTablesProxyModel::setData +176 (int (*)(...))QConcatenateTablesProxyModel::headerData +184 (int (*)(...))QAbstractItemModel::setHeaderData +192 (int (*)(...))QConcatenateTablesProxyModel::itemData +200 (int (*)(...))QConcatenateTablesProxyModel::setItemData +208 (int (*)(...))QAbstractItemModel::clearItemData +216 (int (*)(...))QConcatenateTablesProxyModel::mimeTypes +224 (int (*)(...))QConcatenateTablesProxyModel::mimeData +232 (int (*)(...))QConcatenateTablesProxyModel::canDropMimeData +240 (int (*)(...))QConcatenateTablesProxyModel::dropMimeData +248 (int (*)(...))QAbstractItemModel::supportedDropActions +256 (int (*)(...))QAbstractItemModel::supportedDragActions +264 (int (*)(...))QAbstractItemModel::insertRows +272 (int (*)(...))QAbstractItemModel::insertColumns +280 (int (*)(...))QAbstractItemModel::removeRows +288 (int (*)(...))QAbstractItemModel::removeColumns +296 (int (*)(...))QAbstractItemModel::moveRows +304 (int (*)(...))QAbstractItemModel::moveColumns +312 (int (*)(...))QAbstractItemModel::fetchMore +320 (int (*)(...))QAbstractItemModel::canFetchMore +328 (int (*)(...))QConcatenateTablesProxyModel::flags +336 (int (*)(...))QAbstractItemModel::sort +344 (int (*)(...))QAbstractItemModel::buddy +352 (int (*)(...))QAbstractItemModel::match +360 (int (*)(...))QConcatenateTablesProxyModel::span +368 (int (*)(...))QConcatenateTablesProxyModel::roleNames +376 (int (*)(...))QAbstractItemModel::multiData +384 (int (*)(...))QAbstractItemModel::submit +392 (int (*)(...))QAbstractItemModel::revert +400 (int (*)(...))QAbstractItemModel::resetInternalData + +Class QConcatenateTablesProxyModel + size=16 align=8 + base size=16 base align=8 +QConcatenateTablesProxyModel (0x0x7319b68296e8) 0 + vptr=((& QConcatenateTablesProxyModel::_ZTV28QConcatenateTablesProxyModel) + 16) +QAbstractItemModel (0x0x7319b68298f0) 0 + primary-for QConcatenateTablesProxyModel (0x0x7319b68296e8) +QObject (0x0x7319b2855de0) 0 + primary-for QAbstractItemModel (0x0x7319b68298f0) + +Class QCryptographicHash + size=8 align=8 + base size=8 base align=8 +QCryptographicHash (0x0x7319b2883000) 0 + +Class std::filesystem::space_info + size=24 align=8 + base size=24 base align=8 +std::filesystem::space_info (0x0x7319b28be120) 0 + +Class std::ctype_base + size=1 align=1 + base size=0 base align=1 +std::ctype_base (0x0x7319b28cb6c0) 0 empty + +Class std::__num_base + size=1 align=1 + base size=0 base align=1 +std::__num_base (0x0x7319b28e6ae0) 0 empty + +Class std::time_base + size=1 align=1 + base size=0 base align=1 +std::time_base (0x0x7319b29466c0) 0 empty + +Class std::money_base::pattern + size=4 align=1 + base size=4 base align=1 +std::money_base::pattern (0x0x7319b298f9c0) 0 + +Class std::money_base + size=1 align=1 + base size=0 base align=1 +std::money_base (0x0x7319b298f960) 0 empty + +Class std::messages_base + size=1 align=1 + base size=0 base align=1 +std::messages_base (0x0x7319b29a8f60) 0 empty + +Class std::codecvt_base + size=1 align=1 + base size=0 base align=1 +std::codecvt_base (0x0x7319b29c9ae0) 0 empty + +VTT for std::basic_ostream +std::basic_ostream::_ZTTSo: 2 entries +0 ((& std::basic_ostream::_ZTVSo) + 24) +8 ((& std::basic_ostream::_ZTVSo) + 64) + +VTT for std::basic_ostream +std::basic_ostream::_ZTTSt13basic_ostreamIwSt11char_traitsIwEE: 2 entries +0 ((& std::basic_ostream::_ZTVSt13basic_ostreamIwSt11char_traitsIwEE) + 24) +8 ((& std::basic_ostream::_ZTVSt13basic_ostreamIwSt11char_traitsIwEE) + 64) + +VTT for std::basic_istream +std::basic_istream::_ZTTSi: 2 entries +0 ((& std::basic_istream::_ZTVSi) + 24) +8 ((& std::basic_istream::_ZTVSi) + 64) + +VTT for std::basic_istream +std::basic_istream::_ZTTSt13basic_istreamIwSt11char_traitsIwEE: 2 entries +0 ((& std::basic_istream::_ZTVSt13basic_istreamIwSt11char_traitsIwEE) + 24) +8 ((& std::basic_istream::_ZTVSt13basic_istreamIwSt11char_traitsIwEE) + 64) + +Construction vtable for std::basic_istream (0x0x7319b461c3a8 instance) in std::basic_iostream +std::basic_iostream::_ZTCSd0_Si: 10 entries +0 24 +8 (int (*)(...))0 +16 (int (*)(...))(& _ZTISi) +24 0 +32 0 +40 18446744073709551592 +48 (int (*)(...))-24 +56 (int (*)(...))(& _ZTISi) +64 0 +72 0 + +Construction vtable for std::basic_ostream (0x0x7319b461c478 instance) in std::basic_iostream +std::basic_iostream::_ZTCSd16_So: 10 entries +0 8 +8 (int (*)(...))0 +16 (int (*)(...))(& _ZTISo) +24 0 +32 0 +40 18446744073709551608 +48 (int (*)(...))-8 +56 (int (*)(...))(& _ZTISo) +64 0 +72 0 + +VTT for std::basic_iostream +std::basic_iostream::_ZTTSd: 7 entries +0 ((& std::basic_iostream::_ZTVSd) + 24) +8 ((& std::basic_iostream::_ZTCSd0_Si) + 24) +16 ((& std::basic_iostream::_ZTCSd0_Si) + 64) +24 ((& std::basic_iostream::_ZTCSd16_So) + 24) +32 ((& std::basic_iostream::_ZTCSd16_So) + 64) +40 ((& std::basic_iostream::_ZTVSd) + 104) +48 ((& std::basic_iostream::_ZTVSd) + 64) + +Construction vtable for std::basic_istream (0x0x7319b461c8f0 instance) in std::basic_iostream +std::basic_iostream::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE0_St13basic_istreamIwS1_E: 10 entries +0 24 +8 (int (*)(...))0 +16 (int (*)(...))(& _ZTISt13basic_istreamIwSt11char_traitsIwEE) +24 0 +32 0 +40 18446744073709551592 +48 (int (*)(...))-24 +56 (int (*)(...))(& _ZTISt13basic_istreamIwSt11char_traitsIwEE) +64 0 +72 0 + +Construction vtable for std::basic_ostream (0x0x7319b461ca28 instance) in std::basic_iostream +std::basic_iostream::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE16_St13basic_ostreamIwS1_E: 10 entries +0 8 +8 (int (*)(...))0 +16 (int (*)(...))(& _ZTISt13basic_ostreamIwSt11char_traitsIwEE) +24 0 +32 0 +40 18446744073709551608 +48 (int (*)(...))-8 +56 (int (*)(...))(& _ZTISt13basic_ostreamIwSt11char_traitsIwEE) +64 0 +72 0 + +VTT for std::basic_iostream +std::basic_iostream::_ZTTSt14basic_iostreamIwSt11char_traitsIwEE: 7 entries +0 ((& std::basic_iostream::_ZTVSt14basic_iostreamIwSt11char_traitsIwEE) + 24) +8 ((& std::basic_iostream::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE0_St13basic_istreamIwS1_E) + 24) +16 ((& std::basic_iostream::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE0_St13basic_istreamIwS1_E) + 64) +24 ((& std::basic_iostream::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE16_St13basic_ostreamIwS1_E) + 24) +32 ((& std::basic_iostream::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE16_St13basic_ostreamIwS1_E) + 64) +40 ((& std::basic_iostream::_ZTVSt14basic_iostreamIwSt11char_traitsIwEE) + 104) +48 ((& std::basic_iostream::_ZTVSt14basic_iostreamIwSt11char_traitsIwEE) + 64) + +Construction vtable for std::basic_istream (0x0x7319b464b2d8 instance) in std::__cxx11::basic_istringstream +std::__cxx11::basic_istringstream::_ZTCNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE0_Si: 10 entries +0 120 +8 (int (*)(...))0 +16 (int (*)(...))(& _ZTISi) +24 0 +32 0 +40 18446744073709551496 +48 (int (*)(...))-120 +56 (int (*)(...))(& _ZTISi) +64 0 +72 0 + +VTT for std::__cxx11::basic_istringstream +std::__cxx11::basic_istringstream::_ZTTNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE: 4 entries +0 ((& std::__cxx11::basic_istringstream::_ZTVNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE) + 24) +8 ((& std::__cxx11::basic_istringstream::_ZTCNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE0_Si) + 24) +16 ((& std::__cxx11::basic_istringstream::_ZTCNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE0_Si) + 64) +24 ((& std::__cxx11::basic_istringstream::_ZTVNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE) + 64) + +Construction vtable for std::basic_ostream (0x0x7319b464b478 instance) in std::__cxx11::basic_ostringstream +std::__cxx11::basic_ostringstream::_ZTCNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEE0_So: 10 entries +0 112 +8 (int (*)(...))0 +16 (int (*)(...))(& _ZTISo) +24 0 +32 0 +40 18446744073709551504 +48 (int (*)(...))-112 +56 (int (*)(...))(& _ZTISo) +64 0 +72 0 + +VTT for std::__cxx11::basic_ostringstream +std::__cxx11::basic_ostringstream::_ZTTNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEE: 4 entries +0 ((& std::__cxx11::basic_ostringstream::_ZTVNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEE) + 24) +8 ((& std::__cxx11::basic_ostringstream::_ZTCNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEE0_So) + 24) +16 ((& std::__cxx11::basic_ostringstream::_ZTCNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEE0_So) + 64) +24 ((& std::__cxx11::basic_ostringstream::_ZTVNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEE) + 64) + +Construction vtable for std::basic_iostream (0x0x7319b277a5b0 instance) in std::__cxx11::basic_stringstream +std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE0_Sd: 15 entries +0 128 +8 (int (*)(...))0 +16 (int (*)(...))(& _ZTISd) +24 0 +32 0 +40 112 +48 (int (*)(...))-16 +56 (int (*)(...))(& _ZTISd) +64 0 +72 0 +80 18446744073709551488 +88 (int (*)(...))-128 +96 (int (*)(...))(& _ZTISd) +104 0 +112 0 + +Construction vtable for std::basic_istream (0x0x7319b464b680 instance) in std::__cxx11::basic_stringstream +std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE0_Si: 10 entries +0 128 +8 (int (*)(...))0 +16 (int (*)(...))(& _ZTISi) +24 0 +32 0 +40 18446744073709551488 +48 (int (*)(...))-128 +56 (int (*)(...))(& _ZTISi) +64 0 +72 0 + +Construction vtable for std::basic_ostream (0x0x7319b464b5b0 instance) in std::__cxx11::basic_stringstream +std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE16_So: 10 entries +0 112 +8 (int (*)(...))0 +16 (int (*)(...))(& _ZTISo) +24 0 +32 0 +40 18446744073709551504 +48 (int (*)(...))-112 +56 (int (*)(...))(& _ZTISo) +64 0 +72 0 + +VTT for std::__cxx11::basic_stringstream +std::__cxx11::basic_stringstream::_ZTTNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE: 10 entries +0 ((& std::__cxx11::basic_stringstream::_ZTVNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE) + 24) +8 ((& std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE0_Sd) + 24) +16 ((& std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE0_Si) + 24) +24 ((& std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE0_Si) + 64) +32 ((& std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE16_So) + 24) +40 ((& std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE16_So) + 64) +48 ((& std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE0_Sd) + 104) +56 ((& std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE0_Sd) + 64) +64 ((& std::__cxx11::basic_stringstream::_ZTVNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE) + 104) +72 ((& std::__cxx11::basic_stringstream::_ZTVNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE) + 64) + +Construction vtable for std::basic_istream (0x0x7319b464b820 instance) in std::__cxx11::basic_istringstream +std::__cxx11::basic_istringstream::_ZTCNSt7__cxx1119basic_istringstreamIwSt11char_traitsIwESaIwEEE0_St13basic_istreamIwS2_E: 10 entries +0 120 +8 (int (*)(...))0 +16 (int (*)(...))(& _ZTISt13basic_istreamIwSt11char_traitsIwEE) +24 0 +32 0 +40 18446744073709551496 +48 (int (*)(...))-120 +56 (int (*)(...))(& _ZTISt13basic_istreamIwSt11char_traitsIwEE) +64 0 +72 0 + +VTT for std::__cxx11::basic_istringstream +std::__cxx11::basic_istringstream::_ZTTNSt7__cxx1119basic_istringstreamIwSt11char_traitsIwESaIwEEE: 4 entries +0 ((& std::__cxx11::basic_istringstream::_ZTVNSt7__cxx1119basic_istringstreamIwSt11char_traitsIwESaIwEEE) + 24) +8 ((& std::__cxx11::basic_istringstream::_ZTCNSt7__cxx1119basic_istringstreamIwSt11char_traitsIwESaIwEEE0_St13basic_istreamIwS2_E) + 24) +16 ((& std::__cxx11::basic_istringstream::_ZTCNSt7__cxx1119basic_istringstreamIwSt11char_traitsIwESaIwEEE0_St13basic_istreamIwS2_E) + 64) +24 ((& std::__cxx11::basic_istringstream::_ZTVNSt7__cxx1119basic_istringstreamIwSt11char_traitsIwESaIwEEE) + 64) + +Construction vtable for std::basic_ostream (0x0x7319b464baf8 instance) in std::__cxx11::basic_ostringstream +std::__cxx11::basic_ostringstream::_ZTCNSt7__cxx1119basic_ostringstreamIwSt11char_traitsIwESaIwEEE0_St13basic_ostreamIwS2_E: 10 entries +0 112 +8 (int (*)(...))0 +16 (int (*)(...))(& _ZTISt13basic_ostreamIwSt11char_traitsIwEE) +24 0 +32 0 +40 18446744073709551504 +48 (int (*)(...))-112 +56 (int (*)(...))(& _ZTISt13basic_ostreamIwSt11char_traitsIwEE) +64 0 +72 0 + +VTT for std::__cxx11::basic_ostringstream +std::__cxx11::basic_ostringstream::_ZTTNSt7__cxx1119basic_ostringstreamIwSt11char_traitsIwESaIwEEE: 4 entries +0 ((& std::__cxx11::basic_ostringstream::_ZTVNSt7__cxx1119basic_ostringstreamIwSt11char_traitsIwESaIwEEE) + 24) +8 ((& std::__cxx11::basic_ostringstream::_ZTCNSt7__cxx1119basic_ostringstreamIwSt11char_traitsIwESaIwEEE0_St13basic_ostreamIwS2_E) + 24) +16 ((& std::__cxx11::basic_ostringstream::_ZTCNSt7__cxx1119basic_ostringstreamIwSt11char_traitsIwESaIwEEE0_St13basic_ostreamIwS2_E) + 64) +24 ((& std::__cxx11::basic_ostringstream::_ZTVNSt7__cxx1119basic_ostringstreamIwSt11char_traitsIwESaIwEEE) + 64) + +Construction vtable for std::basic_iostream (0x0x7319b277a9a0 instance) in std::__cxx11::basic_stringstream +std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIwSt11char_traitsIwESaIwEEE0_St14basic_iostreamIwS2_E: 15 entries +0 128 +8 (int (*)(...))0 +16 (int (*)(...))(& _ZTISt14basic_iostreamIwSt11char_traitsIwEE) +24 0 +32 0 +40 112 +48 (int (*)(...))-16 +56 (int (*)(...))(& _ZTISt14basic_iostreamIwSt11char_traitsIwEE) +64 0 +72 0 +80 18446744073709551488 +88 (int (*)(...))-128 +96 (int (*)(...))(& _ZTISt14basic_iostreamIwSt11char_traitsIwEE) +104 0 +112 0 + +Construction vtable for std::basic_istream (0x0x7319b464bd00 instance) in std::__cxx11::basic_stringstream +std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIwSt11char_traitsIwESaIwEEE0_St13basic_istreamIwS2_E: 10 entries +0 128 +8 (int (*)(...))0 +16 (int (*)(...))(& _ZTISt13basic_istreamIwSt11char_traitsIwEE) +24 0 +32 0 +40 18446744073709551488 +48 (int (*)(...))-128 +56 (int (*)(...))(& _ZTISt13basic_istreamIwSt11char_traitsIwEE) +64 0 +72 0 + +Construction vtable for std::basic_ostream (0x0x7319b464bdd0 instance) in std::__cxx11::basic_stringstream +std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIwSt11char_traitsIwESaIwEEE16_St13basic_ostreamIwS2_E: 10 entries +0 112 +8 (int (*)(...))0 +16 (int (*)(...))(& _ZTISt13basic_ostreamIwSt11char_traitsIwEE) +24 0 +32 0 +40 18446744073709551504 +48 (int (*)(...))-112 +56 (int (*)(...))(& _ZTISt13basic_ostreamIwSt11char_traitsIwEE) +64 0 +72 0 + +VTT for std::__cxx11::basic_stringstream +std::__cxx11::basic_stringstream::_ZTTNSt7__cxx1118basic_stringstreamIwSt11char_traitsIwESaIwEEE: 10 entries +0 ((& std::__cxx11::basic_stringstream::_ZTVNSt7__cxx1118basic_stringstreamIwSt11char_traitsIwESaIwEEE) + 24) +8 ((& std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIwSt11char_traitsIwESaIwEEE0_St14basic_iostreamIwS2_E) + 24) +16 ((& std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIwSt11char_traitsIwESaIwEEE0_St13basic_istreamIwS2_E) + 24) +24 ((& std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIwSt11char_traitsIwESaIwEEE0_St13basic_istreamIwS2_E) + 64) +32 ((& std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIwSt11char_traitsIwESaIwEEE16_St13basic_ostreamIwS2_E) + 24) +40 ((& std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIwSt11char_traitsIwESaIwEEE16_St13basic_ostreamIwS2_E) + 64) +48 ((& std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIwSt11char_traitsIwESaIwEEE0_St14basic_iostreamIwS2_E) + 104) +56 ((& std::__cxx11::basic_stringstream::_ZTCNSt7__cxx1118basic_stringstreamIwSt11char_traitsIwESaIwEEE0_St14basic_iostreamIwS2_E) + 64) +64 ((& std::__cxx11::basic_stringstream::_ZTVNSt7__cxx1118basic_stringstreamIwSt11char_traitsIwESaIwEEE) + 104) +72 ((& std::__cxx11::basic_stringstream::_ZTVNSt7__cxx1118basic_stringstreamIwSt11char_traitsIwESaIwEEE) + 64) + +Class std::_Resetiosflags + size=4 align=4 + base size=4 base align=4 +std::_Resetiosflags (0x0x7319b27b81e0) 0 + +Class std::_Setiosflags + size=4 align=4 + base size=4 base align=4 +std::_Setiosflags (0x0x7319b27b8360) 0 + +Class std::_Setbase + size=4 align=4 + base size=4 base align=4 +std::_Setbase (0x0x7319b27b84e0) 0 + +Class std::_Setprecision + size=4 align=4 + base size=4 base align=4 +std::_Setprecision (0x0x7319b27b87e0) 0 + +Class std::_Setw + size=4 align=4 + base size=4 base align=4 +std::_Setw (0x0x7319b27b8960) 0 + +Class std::filesystem::__cxx11::path::_List::_Impl_deleter + size=1 align=1 + base size=0 base align=1 +std::filesystem::__cxx11::path::_List::_Impl_deleter (0x0x7319b242d000) 0 empty + +Class std::filesystem::__cxx11::path::_List + size=8 align=8 + base size=8 base align=8 +std::filesystem::__cxx11::path::_List (0x0x7319b2400f60) 0 + +Class std::filesystem::__cxx11::path + size=40 align=8 + base size=40 base align=8 +std::filesystem::__cxx11::path (0x0x7319b2400f00) 0 + +Vtable for std::filesystem::__cxx11::filesystem_error +std::filesystem::__cxx11::filesystem_error::_ZTVNSt10filesystem7__cxx1116filesystem_errorE: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTINSt10filesystem7__cxx1116filesystem_errorE) +16 (int (*)(...))std::filesystem::__cxx11::filesystem_error::~filesystem_error +24 (int (*)(...))std::filesystem::__cxx11::filesystem_error::~filesystem_error +32 (int (*)(...))std::filesystem::__cxx11::filesystem_error::what + +Class std::filesystem::__cxx11::filesystem_error + size=48 align=8 + base size=48 base align=8 +std::filesystem::__cxx11::filesystem_error (0x0x7319b4660e38) 0 + vptr=((& std::filesystem::__cxx11::filesystem_error::_ZTVNSt10filesystem7__cxx1116filesystem_errorE) + 16) +std::system_error (0x0x7319b4660ea0) 0 + primary-for std::filesystem::__cxx11::filesystem_error (0x0x7319b4660e38) +std::runtime_error (0x0x7319b4660f08) 0 + primary-for std::system_error (0x0x7319b4660ea0) +std::exception (0x0x7319b24dfba0) 0 nearly-empty + primary-for std::runtime_error (0x0x7319b4660f08) + +Class std::filesystem::__cxx11::path::_Cmpt + size=48 align=8 + base size=48 base align=8 +std::filesystem::__cxx11::path::_Cmpt (0x0x7319b4662208) 0 +std::filesystem::__cxx11::path (0x0x7319b25170c0) 0 + +Class std::filesystem::__cxx11::path::iterator + size=24 align=8 + base size=17 base align=8 +std::filesystem::__cxx11::path::iterator (0x0x7319b2517420) 0 + +Class std::filesystem::file_status + size=8 align=4 + base size=8 base align=4 +std::filesystem::file_status (0x0x7319b255b600) 0 + +Class std::filesystem::__cxx11::directory_entry + size=48 align=8 + base size=41 base align=8 +std::filesystem::__cxx11::directory_entry (0x0x7319b255bae0) 0 + +Class std::filesystem::__cxx11::__directory_iterator_proxy + size=48 align=8 + base size=48 base align=8 +std::filesystem::__cxx11::__directory_iterator_proxy (0x0x7319b25861e0) 0 + +Class std::filesystem::__cxx11::directory_iterator + size=16 align=8 + base size=16 base align=8 +std::filesystem::__cxx11::directory_iterator (0x0x7319b2586960) 0 + +Class std::filesystem::__cxx11::recursive_directory_iterator + size=16 align=8 + base size=16 base align=8 +std::filesystem::__cxx11::recursive_directory_iterator (0x0x7319b25bd360) 0 + +Class QFileDevice::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QFileDevice::QPrivateSignal (0x0x7319b2223b40) 0 empty + +Vtable for QFileDevice +QFileDevice::_ZTV11QFileDevice: 35 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QFileDevice) +16 (int (*)(...))QFileDevice::metaObject +24 (int (*)(...))QFileDevice::qt_metacast +32 (int (*)(...))QFileDevice::qt_metacall +40 (int (*)(...))QFileDevice::~QFileDevice +48 (int (*)(...))QFileDevice::~QFileDevice +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QFileDevice::isSequential +120 (int (*)(...))QIODevice::open +128 (int (*)(...))QFileDevice::close +136 (int (*)(...))QFileDevice::pos +144 (int (*)(...))QFileDevice::size +152 (int (*)(...))QFileDevice::seek +160 (int (*)(...))QFileDevice::atEnd +168 (int (*)(...))QIODevice::reset +176 (int (*)(...))QIODevice::bytesAvailable +184 (int (*)(...))QIODevice::bytesToWrite +192 (int (*)(...))QIODevice::canReadLine +200 (int (*)(...))QIODevice::waitForReadyRead +208 (int (*)(...))QIODevice::waitForBytesWritten +216 (int (*)(...))QFileDevice::readData +224 (int (*)(...))QFileDevice::readLineData +232 (int (*)(...))QIODevice::skipData +240 (int (*)(...))QFileDevice::writeData +248 (int (*)(...))QFileDevice::fileName +256 (int (*)(...))QFileDevice::resize +264 (int (*)(...))QFileDevice::permissions +272 (int (*)(...))QFileDevice::setPermissions + +Class QFileDevice + size=16 align=8 + base size=16 base align=8 +QFileDevice (0x0x7319b46736e8) 0 + vptr=((& QFileDevice::_ZTV11QFileDevice) + 16) +QIODevice (0x0x7319b25fff50) 0 + primary-for QFileDevice (0x0x7319b46736e8) +QObject (0x0x7319b2223a80) 0 + primary-for QIODevice (0x0x7319b25fff50) +QIODeviceBase (0x0x7319b2223ae0) 0 empty + +Class QDirListing::DirEntry + size=8 align=8 + base size=8 base align=8 +QDirListing::DirEntry (0x0x7319b226dd20) 0 + +Class QDirListing::sentinel + size=1 align=1 + base size=0 base align=1 +QDirListing::sentinel (0x0x7319b226dd80) 0 empty + +Class QDirListing::const_iterator + size=8 align=8 + base size=8 base align=8 +QDirListing::const_iterator (0x0x7319b226dde0) 0 + +Class QDirListing + size=8 align=8 + base size=8 base align=8 +QDirListing (0x0x7319b226dcc0) 0 + +Class QFile::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QFile::QPrivateSignal (0x0x7319b230d300) 0 empty + +Vtable for QFile +QFile::_ZTV5QFile: 35 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI5QFile) +16 (int (*)(...))QFile::metaObject +24 (int (*)(...))QFile::qt_metacast +32 (int (*)(...))QFile::qt_metacall +40 (int (*)(...))QFile::~QFile +48 (int (*)(...))QFile::~QFile +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QFileDevice::isSequential +120 (int (*)(...))QFile::open +128 (int (*)(...))QFileDevice::close +136 (int (*)(...))QFileDevice::pos +144 (int (*)(...))QFile::size +152 (int (*)(...))QFileDevice::seek +160 (int (*)(...))QFileDevice::atEnd +168 (int (*)(...))QIODevice::reset +176 (int (*)(...))QIODevice::bytesAvailable +184 (int (*)(...))QIODevice::bytesToWrite +192 (int (*)(...))QIODevice::canReadLine +200 (int (*)(...))QIODevice::waitForReadyRead +208 (int (*)(...))QIODevice::waitForBytesWritten +216 (int (*)(...))QFileDevice::readData +224 (int (*)(...))QFileDevice::readLineData +232 (int (*)(...))QIODevice::skipData +240 (int (*)(...))QFileDevice::writeData +248 (int (*)(...))QFile::fileName +256 (int (*)(...))QFile::resize +264 (int (*)(...))QFile::permissions +272 (int (*)(...))QFile::setPermissions + +Class QFile + size=16 align=8 + base size=16 base align=8 +QFile (0x0x7319b4675270) 0 + vptr=((& QFile::_ZTV5QFile) + 16) +QFileDevice (0x0x7319b46752d8) 0 + primary-for QFile (0x0x7319b4675270) +QIODevice (0x0x7319b230c2a0) 0 + primary-for QFileDevice (0x0x7319b46752d8) +QObject (0x0x7319b230d240) 0 + primary-for QIODevice (0x0x7319b230c2a0) +QIODeviceBase (0x0x7319b230d2a0) 0 empty + +Class QTimeZone::ShortData + size=8 align=8 + base size=8 base align=8 +QTimeZone::ShortData (0x0x7319b230dc60) 0 + +Class QTimeZone::Data + size=8 align=8 + base size=8 base align=8 +QTimeZone::Data (0x0x7319b230dcc0) 0 + +Class QTimeZone::OffsetData + size=48 align=8 + base size=44 base align=8 +QTimeZone::OffsetData (0x0x7319b230dd20) 0 + +Class QTimeZone + size=8 align=8 + base size=8 base align=8 +QTimeZone (0x0x7319b230dc00) 0 + +Class QFileInfo + size=8 align=8 + base size=8 base align=8 +QFileInfo (0x0x7319b23a6900) 0 + +Class QDir + size=8 align=8 + base size=8 base align=8 +QDir (0x0x7319b2030840) 0 + +Class QDirIterator + size=8 align=8 + base size=8 base align=8 +QDirIterator (0x0x7319b2174720) 0 + +Class QEasingCurve + size=8 align=8 + base size=8 base align=8 +QEasingCurve (0x0x7319b1ead240) 0 + +Class QElapsedTimer + size=16 align=8 + base size=16 base align=8 +QElapsedTimer (0x0x7319b1ee46c0) 0 + +Vtable for QException +QException::_ZTV10QException: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QException) +16 (int (*)(...))QException::~QException +24 (int (*)(...))QException::~QException +32 (int (*)(...))std::exception::what +40 (int (*)(...))QException::raise +48 (int (*)(...))QException::clone + +Class QException + size=8 align=8 + base size=8 base align=8 +QException (0x0x7319b47681a0) 0 nearly-empty + vptr=((& QException::_ZTV10QException) + 16) +std::exception (0x0x7319b1ee4ba0) 0 nearly-empty + primary-for QException (0x0x7319b47681a0) + +Vtable for QUnhandledException +QUnhandledException::_ZTV19QUnhandledException: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QUnhandledException) +16 (int (*)(...))QUnhandledException::~QUnhandledException +24 (int (*)(...))QUnhandledException::~QUnhandledException +32 (int (*)(...))std::exception::what +40 (int (*)(...))QUnhandledException::raise +48 (int (*)(...))QUnhandledException::clone + +Class QUnhandledException + size=16 align=8 + base size=16 base align=8 +QUnhandledException (0x0x7319b4768208) 0 + vptr=((& QUnhandledException::_ZTV19QUnhandledException) + 16) +QException (0x0x7319b4768270) 0 nearly-empty + primary-for QUnhandledException (0x0x7319b4768208) +std::exception (0x0x7319b1ee4c00) 0 nearly-empty + primary-for QException (0x0x7319b4768270) + +Class QtPrivate::ExceptionStore + size=8 align=8 + base size=8 base align=8 +QtPrivate::ExceptionStore (0x0x7319b1f340c0) 0 + +Vtable for QFactoryInterface +QFactoryInterface::_ZTV17QFactoryInterface: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QFactoryInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual + +Class QFactoryInterface + size=8 align=8 + base size=8 base align=8 +QFactoryInterface (0x0x7319b1f34120) 0 nearly-empty + vptr=((& QFactoryInterface::_ZTV17QFactoryInterface) + 16) + +Class QFileSelector::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QFileSelector::QPrivateSignal (0x0x7319b1f34540) 0 empty + +Vtable for QFileSelector +QFileSelector::_ZTV13QFileSelector: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QFileSelector) +16 (int (*)(...))QFileSelector::metaObject +24 (int (*)(...))QFileSelector::qt_metacast +32 (int (*)(...))QFileSelector::qt_metacall +40 (int (*)(...))QFileSelector::~QFileSelector +48 (int (*)(...))QFileSelector::~QFileSelector +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QFileSelector + size=16 align=8 + base size=16 base align=8 +QFileSelector (0x0x7319b4768618) 0 + vptr=((& QFileSelector::_ZTV13QFileSelector) + 16) +QObject (0x0x7319b1f344e0) 0 + primary-for QFileSelector (0x0x7319b4768618) + +Class QFileSystemWatcher::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QFileSystemWatcher::QPrivateSignal (0x0x7319b1f34720) 0 empty + +Vtable for QFileSystemWatcher +QFileSystemWatcher::_ZTV18QFileSystemWatcher: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QFileSystemWatcher) +16 (int (*)(...))QFileSystemWatcher::metaObject +24 (int (*)(...))QFileSystemWatcher::qt_metacast +32 (int (*)(...))QFileSystemWatcher::qt_metacall +40 (int (*)(...))QFileSystemWatcher::~QFileSystemWatcher +48 (int (*)(...))QFileSystemWatcher::~QFileSystemWatcher +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QFileSystemWatcher + size=16 align=8 + base size=16 base align=8 +QFileSystemWatcher (0x0x7319b4768478) 0 + vptr=((& QFileSystemWatcher::_ZTV18QFileSystemWatcher) + 16) +QObject (0x0x7319b1f346c0) 0 + primary-for QFileSystemWatcher (0x0x7319b4768478) + +Class QtPrivate::ResultItem + size=16 align=8 + base size=16 base align=8 +QtPrivate::ResultItem (0x0x7319b1f348a0) 0 + +Class QtPrivate::ResultIteratorBase + size=16 align=8 + base size=12 base align=8 +QtPrivate::ResultIteratorBase (0x0x7319b1f34ea0) 0 + +Vtable for QtPrivate::ResultStoreBase +QtPrivate::ResultStoreBase::_ZTVN9QtPrivate15ResultStoreBaseE: 4 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN9QtPrivate15ResultStoreBaseE) +16 (int (*)(...))QtPrivate::ResultStoreBase::~ResultStoreBase +24 (int (*)(...))QtPrivate::ResultStoreBase::~ResultStoreBase + +Class QtPrivate::ResultStoreBase + size=48 align=8 + base size=44 base align=8 +QtPrivate::ResultStoreBase (0x0x7319b1c44060) 0 + vptr=((& QtPrivate::ResultStoreBase::_ZTVN9QtPrivate15ResultStoreBaseE) + 16) + +Vtable for QFutureInterfaceBase +QFutureInterfaceBase::_ZTV20QFutureInterfaceBase: 4 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QFutureInterfaceBase) +16 (int (*)(...))QFutureInterfaceBase::~QFutureInterfaceBase +24 (int (*)(...))QFutureInterfaceBase::~QFutureInterfaceBase + +Class QFutureInterfaceBase + size=16 align=8 + base size=16 base align=8 +QFutureInterfaceBase (0x0x7319b1c7b720) 0 + vptr=((& QFutureInterfaceBase::_ZTV20QFutureInterfaceBase) + 16) + +Class std::__recursive_mutex_base + size=40 align=8 + base size=40 base align=8 +std::__recursive_mutex_base (0x0x7319b1cc95a0) 0 + +Class std::recursive_mutex + size=40 align=8 + base size=40 base align=8 +std::recursive_mutex (0x0x7319b4773a28) 0 +std::__recursive_mutex_base (0x0x7319b1cc9600) 0 + +Class std::timed_mutex + size=40 align=8 + base size=40 base align=8 +std::timed_mutex (0x0x7319b1cca9a0) 0 +std::__mutex_base (0x0x7319b1cc9a80) 0 +std::__timed_mutex_impl (0x0x7319b1cc9ae0) 0 empty + +Class std::recursive_timed_mutex + size=40 align=8 + base size=40 base align=8 +std::recursive_timed_mutex (0x0x7319b1ccad90) 0 +std::__recursive_mutex_base (0x0x7319b1cc9ea0) 0 +std::__timed_mutex_impl (0x0x7319b1cc9f00) 0 empty + +Class std::once_flag + size=4 align=4 + base size=4 base align=4 +std::once_flag (0x0x7319b1cf0cc0) 0 + +Class std::once_flag::_Prepare_execution + size=1 align=1 + base size=0 base align=1 +std::once_flag::_Prepare_execution (0x0x7319b1cf0d20) 0 empty + +Class std::condition_variable + size=48 align=8 + base size=48 base align=8 +std::condition_variable (0x0x7319b1d0c240) 0 + +Class std::__at_thread_exit_elt + size=16 align=8 + base size=16 base align=8 +std::__at_thread_exit_elt (0x0x7319b1d0c6c0) 0 + +Class std::_V2::condition_variable_any + size=64 align=8 + base size=64 base align=8 +std::_V2::condition_variable_any (0x0x7319b1d0c720) 0 + +Class std::__atomic_futex_unsigned_base + size=1 align=1 + base size=0 base align=1 +std::__atomic_futex_unsigned_base (0x0x7319b1d755a0) 0 empty + +Vtable for std::thread::_State +std::thread::_State::_ZTVNSt6thread6_StateE: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTINSt6thread6_StateE) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual + +Class std::thread::_State + size=8 align=8 + base size=8 base align=8 +std::thread::_State (0x0x7319b1d75ea0) 0 nearly-empty + vptr=((& std::thread::_State::_ZTVNSt6thread6_StateE) + 16) + +Class std::thread::id + size=8 align=8 + base size=8 base align=8 +std::thread::id (0x0x7319b1d75f00) 0 + +Class std::thread + size=8 align=8 + base size=8 base align=8 +std::thread (0x0x7319b1d75e40) 0 + +Vtable for std::future_error +std::future_error::_ZTVSt12future_error: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTISt12future_error) +16 (int (*)(...))std::future_error::~future_error +24 (int (*)(...))std::future_error::~future_error +32 (int (*)(...))std::future_error::what + +Class std::future_error + size=32 align=8 + base size=32 base align=8 +std::future_error (0x0x7319b4777ea0) 0 + vptr=((& std::future_error::_ZTVSt12future_error) + 16) +std::logic_error (0x0x7319b4777f08) 0 + primary-for std::future_error (0x0x7319b4777ea0) +std::exception (0x0x7319b1dba420) 0 nearly-empty + primary-for std::logic_error (0x0x7319b4777f08) + +Class std::__future_base::_Result_base::_Deleter + size=1 align=1 + base size=0 base align=1 +std::__future_base::_Result_base::_Deleter (0x0x7319b1dbab40) 0 empty + +Vtable for std::__future_base::_Result_base +std::__future_base::_Result_base::_ZTVNSt13__future_base12_Result_baseE: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTINSt13__future_base12_Result_baseE) +16 (int (*)(...))__cxa_pure_virtual +24 0 +32 0 + +Class std::__future_base::_Result_base + size=16 align=8 + base size=16 base align=8 +std::__future_base::_Result_base (0x0x7319b1dbaae0) 0 + vptr=((& std::__future_base::_Result_base::_ZTVNSt13__future_base12_Result_baseE) + 16) + +Class std::__future_base::_State_baseV2::__exception_ptr_tag + size=1 align=1 + base size=0 base align=1 +std::__future_base::_State_baseV2::__exception_ptr_tag (0x0x7319b1abb480) 0 empty + +Class std::__future_base::_State_baseV2::_Make_ready + size=32 align=8 + base size=32 base align=8 +std::__future_base::_State_baseV2::_Make_ready (0x0x7319b4789340) 0 +std::__at_thread_exit_elt (0x0x7319b1abb540) 0 + +Vtable for std::__future_base::_State_baseV2 +std::__future_base::_State_baseV2::_ZTVNSt13__future_base13_State_baseV2E: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTINSt13__future_base13_State_baseV2E) +16 (int (*)(...))std::__future_base::_State_baseV2::~_State_baseV2 +24 (int (*)(...))std::__future_base::_State_baseV2::~_State_baseV2 +32 (int (*)(...))std::__future_base::_State_baseV2::_M_complete_async +40 (int (*)(...))std::__future_base::_State_baseV2::_M_is_deferred_future + +Class std::__future_base::_State_baseV2 + size=32 align=8 + base size=28 base align=8 +std::__future_base::_State_baseV2 (0x0x7319b1dbacc0) 0 + vptr=((& std::__future_base::_State_baseV2::_ZTVNSt13__future_base13_State_baseV2E) + 16) + +Class std::__future_base + size=1 align=1 + base size=0 base align=1 +std::__future_base (0x0x7319b1dbaa80) 0 empty + +Vtable for std::__future_base::_Async_state_commonV2 +std::__future_base::_Async_state_commonV2::_ZTVNSt13__future_base21_Async_state_commonV2E: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTINSt13__future_base21_Async_state_commonV2E) +16 (int (*)(...))std::__future_base::_Async_state_commonV2::~_Async_state_commonV2 +24 (int (*)(...))std::__future_base::_Async_state_commonV2::~_Async_state_commonV2 +32 (int (*)(...))std::__future_base::_Async_state_commonV2::_M_complete_async +40 (int (*)(...))std::__future_base::_State_baseV2::_M_is_deferred_future + +Class std::__future_base::_Async_state_commonV2 + size=48 align=8 + base size=44 base align=8 +std::__future_base::_Async_state_commonV2 (0x0x7319b47a69c0) 0 + vptr=((& std::__future_base::_Async_state_commonV2::_ZTVNSt13__future_base21_Async_state_commonV2E) + 16) +std::__future_base::_State_baseV2 (0x0x7319b1620f60) 0 + primary-for std::__future_base::_Async_state_commonV2 (0x0x7319b47a69c0) + +Class QThread::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QThread::QPrivateSignal (0x0x7319b1648660) 0 empty + +Vtable for QThread +QThread::_ZTV7QThread: 15 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI7QThread) +16 (int (*)(...))QThread::metaObject +24 (int (*)(...))QThread::qt_metacast +32 (int (*)(...))QThread::qt_metacall +40 (int (*)(...))QThread::~QThread +48 (int (*)(...))QThread::~QThread +56 (int (*)(...))QThread::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QThread::run + +Class QThread + size=16 align=8 + base size=16 base align=8 +QThread (0x0x7319b47a6d00) 0 + vptr=((& QThread::_ZTV7QThread) + 16) +QObject (0x0x7319b1648600) 0 + primary-for QThread (0x0x7319b47a6d00) + +Vtable for QRunnable +QRunnable::_ZTV9QRunnable: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QRunnable) +16 (int (*)(...))__cxa_pure_virtual +24 0 +32 0 + +Class QRunnable + size=16 align=8 + base size=9 base align=8 +QRunnable (0x0x7319b1648a80) 0 + vptr=((& QRunnable::_ZTV9QRunnable) + 16) + +Class QRunnable::QGenericRunnable::HelperBase + size=8 align=8 + base size=8 base align=8 +QRunnable::QGenericRunnable::HelperBase (0x0x7319b1648c00) 0 + +Vtable for QRunnable::QGenericRunnable +QRunnable::QGenericRunnable::_ZTVN9QRunnable16QGenericRunnableE: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN9QRunnable16QGenericRunnableE) +16 (int (*)(...))QRunnable::QGenericRunnable::run +24 (int (*)(...))QRunnable::QGenericRunnable::~QGenericRunnable +32 (int (*)(...))QRunnable::QGenericRunnable::~QGenericRunnable + +Class QRunnable::QGenericRunnable + size=24 align=8 + base size=24 base align=8 +QRunnable::QGenericRunnable (0x0x7319b47a6d68) 0 + vptr=((& QRunnable::QGenericRunnable::_ZTVN9QRunnable16QGenericRunnableE) + 16) +QRunnable (0x0x7319b1648ba0) 0 + primary-for QRunnable::QGenericRunnable (0x0x7319b47a6d68) + +Class QThreadPool::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QThreadPool::QPrivateSignal (0x0x7319b1676420) 0 empty + +Vtable for QThreadPool +QThreadPool::_ZTV11QThreadPool: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QThreadPool) +16 (int (*)(...))QThreadPool::metaObject +24 (int (*)(...))QThreadPool::qt_metacast +32 (int (*)(...))QThreadPool::qt_metacall +40 (int (*)(...))QThreadPool::~QThreadPool +48 (int (*)(...))QThreadPool::~QThreadPool +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QThreadPool + size=16 align=8 + base size=16 base align=8 +QThreadPool (0x0x7319b47a6f08) 0 + vptr=((& QThreadPool::_ZTV11QThreadPool) + 16) +QObject (0x0x7319b16763c0) 0 + primary-for QThreadPool (0x0x7319b47a6f08) + +Class QtPrivate::UnwrapHandler + size=1 align=1 + base size=0 base align=1 +QtPrivate::UnwrapHandler (0x0x7319b16e3780) 0 empty + +Class QFutureWatcherBase::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QFutureWatcherBase::QPrivateSignal (0x0x7319b14007e0) 0 empty + +Vtable for QFutureWatcherBase +QFutureWatcherBase::_ZTV18QFutureWatcherBase: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QFutureWatcherBase) +16 (int (*)(...))QFutureWatcherBase::metaObject +24 (int (*)(...))QFutureWatcherBase::qt_metacast +32 (int (*)(...))QFutureWatcherBase::qt_metacall +40 0 +48 0 +56 (int (*)(...))QFutureWatcherBase::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QFutureWatcherBase::connectNotify +104 (int (*)(...))QFutureWatcherBase::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual + +Class QFutureWatcherBase + size=16 align=8 + base size=16 base align=8 +QFutureWatcherBase (0x0x7319b4378750) 0 + vptr=((& QFutureWatcherBase::_ZTV18QFutureWatcherBase) + 16) +QObject (0x0x7319b1400780) 0 + primary-for QFutureWatcherBase (0x0x7319b4378750) + +Class QIdentityProxyModel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QIdentityProxyModel::QPrivateSignal (0x0x7319b1400d20) 0 empty + +Vtable for QIdentityProxyModel +QIdentityProxyModel::_ZTV19QIdentityProxyModel: 56 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QIdentityProxyModel) +16 (int (*)(...))QIdentityProxyModel::metaObject +24 (int (*)(...))QIdentityProxyModel::qt_metacast +32 (int (*)(...))QIdentityProxyModel::qt_metacall +40 (int (*)(...))QIdentityProxyModel::~QIdentityProxyModel +48 (int (*)(...))QIdentityProxyModel::~QIdentityProxyModel +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QIdentityProxyModel::index +120 (int (*)(...))QIdentityProxyModel::parent +128 (int (*)(...))QIdentityProxyModel::sibling +136 (int (*)(...))QIdentityProxyModel::rowCount +144 (int (*)(...))QIdentityProxyModel::columnCount +152 (int (*)(...))QAbstractProxyModel::hasChildren +160 (int (*)(...))QAbstractProxyModel::data +168 (int (*)(...))QAbstractProxyModel::setData +176 (int (*)(...))QIdentityProxyModel::headerData +184 (int (*)(...))QAbstractProxyModel::setHeaderData +192 (int (*)(...))QAbstractProxyModel::itemData +200 (int (*)(...))QAbstractProxyModel::setItemData +208 (int (*)(...))QAbstractProxyModel::clearItemData +216 (int (*)(...))QAbstractProxyModel::mimeTypes +224 (int (*)(...))QAbstractProxyModel::mimeData +232 (int (*)(...))QAbstractProxyModel::canDropMimeData +240 (int (*)(...))QIdentityProxyModel::dropMimeData +248 (int (*)(...))QAbstractProxyModel::supportedDropActions +256 (int (*)(...))QAbstractProxyModel::supportedDragActions +264 (int (*)(...))QIdentityProxyModel::insertRows +272 (int (*)(...))QIdentityProxyModel::insertColumns +280 (int (*)(...))QIdentityProxyModel::removeRows +288 (int (*)(...))QIdentityProxyModel::removeColumns +296 (int (*)(...))QIdentityProxyModel::moveRows +304 (int (*)(...))QIdentityProxyModel::moveColumns +312 (int (*)(...))QAbstractProxyModel::fetchMore +320 (int (*)(...))QAbstractProxyModel::canFetchMore +328 (int (*)(...))QAbstractProxyModel::flags +336 (int (*)(...))QAbstractProxyModel::sort +344 (int (*)(...))QAbstractProxyModel::buddy +352 (int (*)(...))QIdentityProxyModel::match +360 (int (*)(...))QAbstractProxyModel::span +368 (int (*)(...))QAbstractProxyModel::roleNames +376 (int (*)(...))QAbstractItemModel::multiData +384 (int (*)(...))QAbstractProxyModel::submit +392 (int (*)(...))QAbstractProxyModel::revert +400 (int (*)(...))QAbstractItemModel::resetInternalData +408 (int (*)(...))QIdentityProxyModel::setSourceModel +416 (int (*)(...))QIdentityProxyModel::mapToSource +424 (int (*)(...))QIdentityProxyModel::mapFromSource +432 (int (*)(...))QIdentityProxyModel::mapSelectionToSource +440 (int (*)(...))QIdentityProxyModel::mapSelectionFromSource + +Class QIdentityProxyModel + size=16 align=8 + base size=16 base align=8 +QIdentityProxyModel (0x0x7319b40edc30) 0 + vptr=((& QIdentityProxyModel::_ZTV19QIdentityProxyModel) + 16) +QAbstractProxyModel (0x0x7319b40eddd0) 0 + primary-for QIdentityProxyModel (0x0x7319b40edc30) +QAbstractItemModel (0x0x7319b411af08) 0 + primary-for QAbstractProxyModel (0x0x7319b40eddd0) +QObject (0x0x7319b1400cc0) 0 + primary-for QAbstractItemModel (0x0x7319b411af08) + +Class QItemSelectionRange + size=16 align=8 + base size=16 base align=8 +QItemSelectionRange (0x0x7319b1400ea0) 0 + +Class QItemSelectionModel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QItemSelectionModel::QPrivateSignal (0x0x7319b14606c0) 0 empty + +Vtable for QItemSelectionModel +QItemSelectionModel::_ZTV19QItemSelectionModel: 20 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QItemSelectionModel) +16 (int (*)(...))QItemSelectionModel::metaObject +24 (int (*)(...))QItemSelectionModel::qt_metacast +32 (int (*)(...))QItemSelectionModel::qt_metacall +40 (int (*)(...))QItemSelectionModel::~QItemSelectionModel +48 (int (*)(...))QItemSelectionModel::~QItemSelectionModel +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QItemSelectionModel::setCurrentIndex +120 (int (*)(...))QItemSelectionModel::select +128 (int (*)(...))QItemSelectionModel::select +136 (int (*)(...))QItemSelectionModel::clear +144 (int (*)(...))QItemSelectionModel::reset +152 (int (*)(...))QItemSelectionModel::clearCurrentIndex + +Class QItemSelectionModel + size=16 align=8 + base size=16 base align=8 +QItemSelectionModel (0x0x7319b3716f70) 0 + vptr=((& QItemSelectionModel::_ZTV19QItemSelectionModel) + 16) +QObject (0x0x7319b1460660) 0 + primary-for QItemSelectionModel (0x0x7319b3716f70) + +Class QItemSelection + size=24 align=8 + base size=24 base align=8 +QItemSelection (0x0x7319b34b5208) 0 +QList (0x0x7319b322d138) 0 +QListSpecialMethods (0x0x7319b322d1a0) 0 empty +QListSpecialMethodsBase (0x0x7319b14b21e0) 0 empty + +Class QJsonParseError + size=8 align=4 + base size=8 base align=4 +QJsonParseError (0x0x7319b1556780) 0 + +Class QJsonDocument + size=8 align=8 + base size=8 base align=8 +QJsonDocument (0x0x7319b1556840) 0 + +Class QJsonValue + size=24 align=8 + base size=24 base align=8 +QJsonValue (0x0x7319b1290d80) 0 + +Class QJsonValueConstRef + size=16 align=8 + base size=16 base align=8 +QJsonValueConstRef (0x0x7319b12e4300) 0 + +Class QJsonValueRef + size=16 align=8 + base size=16 base align=8 +QJsonValueRef (0x0x7319b12ddd00) 0 +QJsonValueConstRef (0x0x7319b1309600) 0 + +Class QJsonArray::iterator + size=16 align=8 + base size=16 base align=8 +QJsonArray::iterator (0x0x7319b13227e0) 0 + +Class QJsonArray::const_iterator + size=16 align=8 + base size=16 base align=8 +QJsonArray::const_iterator (0x0x7319b1322840) 0 + +Class QJsonArray + size=8 align=8 + base size=8 base align=8 +QJsonArray (0x0x7319b1322780) 0 + +Class QJsonObject::iterator + size=16 align=8 + base size=16 base align=8 +QJsonObject::iterator (0x0x7319b13e6c60) 0 + +Class QJsonObject::const_iterator + size=16 align=8 + base size=16 base align=8 +QJsonObject::const_iterator (0x0x7319b13e6cc0) 0 + +Class QJsonObject + size=8 align=8 + base size=8 base align=8 +QJsonObject (0x0x7319b13e6c00) 0 + +Class QtPrivate::QCaseSensitiveLatin1Hash + size=1 align=1 + base size=0 base align=1 +QtPrivate::QCaseSensitiveLatin1Hash (0x0x7319b1116960) 0 empty + +Class QtPrivate::QCaseInsensitiveLatin1Hash + size=1 align=1 + base size=0 base align=1 +QtPrivate::QCaseInsensitiveLatin1Hash (0x0x7319b1116a20) 0 empty + +Class QLatin1StringMatcher + size=544 align=16 + base size=544 base align=16 +QLatin1StringMatcher (0x0x7319b1116cc0) 0 + +Class QLibrary::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QLibrary::QPrivateSignal (0x0x7319b1116ea0) 0 empty + +Vtable for QLibrary +QLibrary::_ZTV8QLibrary: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI8QLibrary) +16 (int (*)(...))QLibrary::metaObject +24 (int (*)(...))QLibrary::qt_metacast +32 (int (*)(...))QLibrary::qt_metacall +40 (int (*)(...))QLibrary::~QLibrary +48 (int (*)(...))QLibrary::~QLibrary +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QLibrary + size=24 align=8 + base size=24 base align=8 +QLibrary (0x0x7319b1122340) 0 + vptr=((& QLibrary::_ZTV8QLibrary) + 16) +QObject (0x0x7319b1116e40) 0 + primary-for QLibrary (0x0x7319b1122340) + +Class QTypeRevision + size=2 align=1 + base size=2 base align=1 +QTypeRevision (0x0x7319b11546c0) 0 + +Class QVersionNumber::SegmentStorage + size=8 align=8 + base size=8 base align=8 +QVersionNumber::SegmentStorage (0x0x7319b11dbde0) 0 + +Class QVersionNumber::It + size=16 align=8 + base size=16 base align=8 +QVersionNumber::It (0x0x7319b11dbea0) 0 + +Class QVersionNumber + size=8 align=8 + base size=8 base align=8 +QVersionNumber (0x0x7319b11dbd80) 0 + +Class QLibraryInfo + size=1 align=1 + base size=0 base align=1 +QLibraryInfo (0x0x7319b0f5ca20) 0 empty + +Class QtPrivate::QCheckedIntegers::AssertReportPolicy + size=1 align=1 + base size=0 base align=1 +QtPrivate::QCheckedIntegers::AssertReportPolicy (0x0x7319b0f5cd20) 0 empty + +Class QPoint + size=8 align=4 + base size=8 base align=4 +QPoint (0x0x7319b0f96780) 0 + +Class QPointF + size=16 align=8 + base size=16 base align=8 +QPointF (0x0x7319b0c3bba0) 0 + +Class QLine + size=16 align=4 + base size=16 base align=4 +QLine (0x0x7319b0cbe360) 0 + +Class QLineF + size=32 align=8 + base size=32 base align=8 +QLineF (0x0x7319b0d15c00) 0 + +Class QLockFile + size=8 align=8 + base size=8 base align=8 +QLockFile (0x0x7319b0d94c00) 0 + +Class QLoggingCategory::AtomicBools + size=4 align=1 + base size=4 base align=1 +QLoggingCategory::AtomicBools (0x0x7319b0ab4480) 0 + +Class QLoggingCategory::UnregisteredInitialization + size=1 align=1 + base size=0 base align=1 +QLoggingCategory::UnregisteredInitialization (0x0x7319b0ab4660) 0 empty + +Class QLoggingCategory + size=24 align=8 + base size=24 base align=8 +QLoggingCategory (0x0x7319b0ab4420) 0 + +Class QMargins + size=16 align=4 + base size=16 base align=4 +QMargins (0x0x7319b0ab4b40) 0 + +Class QMarginsF + size=32 align=8 + base size=32 base align=8 +QMarginsF (0x0x7319b0ba2000) 0 + +Class QMessageAuthenticationCode + size=8 align=8 + base size=8 base align=8 +QMessageAuthenticationCode (0x0x7319b0827660) 0 + +Class QtMetaContainerPrivate::AssociativeIterator + size=16 align=8 + base size=16 base align=8 +QtMetaContainerPrivate::AssociativeIterator (0x0x7319b081e680) 0 +QIterator (0x0x7319b081e6e8) 0 +QBaseIterator (0x0x7319b0827ba0) 0 + +Class QtMetaContainerPrivate::AssociativeConstIterator + size=16 align=8 + base size=16 base align=8 +QtMetaContainerPrivate::AssociativeConstIterator (0x0x7319b08754e0) 0 +QConstIterator (0x0x7319b0875548) 0 +QBaseIterator (0x0x7319b0864f60) 0 + +Class QtMetaContainerPrivate::Association + size=24 align=8 + base size=24 base align=8 +QtMetaContainerPrivate::Association (0x0x7319b089da28) 0 +QIterable (0x0x7319b08a3c60) 0 + +Class QMetaMethod::Data + size=8 align=8 + base size=8 base align=8 +QMetaMethod::Data (0x0x7319b08f7060) 0 + +Class QMetaMethod + size=16 align=8 + base size=16 base align=8 +QMetaMethod (0x0x7319b08f7000) 0 + +Class QMetaEnum::Data + size=8 align=8 + base size=8 base align=8 +QMetaEnum::Data (0x0x7319b094ec60) 0 + +Class QMetaEnum + size=16 align=8 + base size=16 base align=8 +QMetaEnum (0x0x7319b094ec00) 0 + +Class QMetaProperty::Data + size=8 align=8 + base size=8 base align=8 +QMetaProperty::Data (0x0x7319b0991f60) 0 + +Class QMetaProperty + size=32 align=8 + base size=32 base align=8 +QMetaProperty (0x0x7319b0991f00) 0 + +Class QMetaClassInfo::Data + size=8 align=8 + base size=8 base align=8 +QMetaClassInfo::Data (0x0x7319b09b7660) 0 + +Class QMetaClassInfo + size=16 align=8 + base size=16 base align=8 +QMetaClassInfo (0x0x7319b09b7600) 0 + +Class QtMetaContainerPrivate::SequentialIterator + size=16 align=8 + base size=16 base align=8 +QtMetaContainerPrivate::SequentialIterator (0x0x7319b09f3618) 0 +QIterator (0x0x7319b09f3680) 0 +QBaseIterator (0x0x7319b09e6de0) 0 + +Class QtMetaContainerPrivate::SequentialConstIterator + size=16 align=8 + base size=16 base align=8 +QtMetaContainerPrivate::SequentialConstIterator (0x0x7319b0650a90) 0 +QConstIterator (0x0x7319b0650af8) 0 +QBaseIterator (0x0x7319b065a1e0) 0 + +Class QtMetaContainerPrivate::Sequence + size=24 align=8 + base size=24 base align=8 +QtMetaContainerPrivate::Sequence (0x0x7319b06b7618) 0 +QIterable (0x0x7319b06a2d20) 0 + +Class QMimeData::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QMimeData::QPrivateSignal (0x0x7319b06f82a0) 0 empty + +Vtable for QMimeData +QMimeData::_ZTV9QMimeData: 17 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QMimeData) +16 (int (*)(...))QMimeData::metaObject +24 (int (*)(...))QMimeData::qt_metacast +32 (int (*)(...))QMimeData::qt_metacall +40 (int (*)(...))QMimeData::~QMimeData +48 (int (*)(...))QMimeData::~QMimeData +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QMimeData::hasFormat +120 (int (*)(...))QMimeData::formats +128 (int (*)(...))QMimeData::retrieveData + +Class QMimeData + size=16 align=8 + base size=16 base align=8 +QMimeData (0x0x7319b06b78f0) 0 + vptr=((& QMimeData::_ZTV9QMimeData) + 16) +QObject (0x0x7319b06f8240) 0 + primary-for QMimeData (0x0x7319b06b78f0) + +Class QMimeType + size=8 align=8 + base size=8 base align=8 +QMimeType (0x0x7319b06f8420) 0 + +Class QMimeDatabase + size=8 align=8 + base size=8 base align=8 +QMimeDatabase (0x0x7319b0772900) 0 + +Class QObjectCleanupHandler::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QObjectCleanupHandler::QPrivateSignal (0x0x7319b07729c0) 0 empty + +Vtable for QObjectCleanupHandler +QObjectCleanupHandler::_ZTV21QObjectCleanupHandler: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI21QObjectCleanupHandler) +16 (int (*)(...))QObjectCleanupHandler::metaObject +24 (int (*)(...))QObjectCleanupHandler::qt_metacast +32 (int (*)(...))QObjectCleanupHandler::qt_metacall +40 (int (*)(...))QObjectCleanupHandler::~QObjectCleanupHandler +48 (int (*)(...))QObjectCleanupHandler::~QObjectCleanupHandler +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QObjectCleanupHandler + size=40 align=8 + base size=40 base align=8 +QObjectCleanupHandler (0x0x7319b07822d8) 0 + vptr=((& QObjectCleanupHandler::_ZTV21QObjectCleanupHandler) + 16) +QObject (0x0x7319b0772960) 0 + primary-for QObjectCleanupHandler (0x0x7319b07822d8) + +Class QOperatingSystemVersionBase + size=16 align=4 + base size=16 base align=4 +QOperatingSystemVersionBase (0x0x7319b0772a80) 0 + +Class QOperatingSystemVersionUnexported + size=16 align=4 + base size=16 base align=4 +QOperatingSystemVersionUnexported (0x0x7319b0782340) 0 +QOperatingSystemVersionBase (0x0x7319b07a2420) 0 + +Class QOperatingSystemVersion + size=16 align=4 + base size=16 base align=4 +QOperatingSystemVersion (0x0x7319b0782410) 0 +QOperatingSystemVersionUnexported (0x0x7319b0782478) 0 +QOperatingSystemVersionBase (0x0x7319b07a2660) 0 + +Class QParallelAnimationGroup::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QParallelAnimationGroup::QPrivateSignal (0x0x7319b07f7840) 0 empty + +Vtable for QParallelAnimationGroup +QParallelAnimationGroup::_ZTV23QParallelAnimationGroup: 18 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI23QParallelAnimationGroup) +16 (int (*)(...))QParallelAnimationGroup::metaObject +24 (int (*)(...))QParallelAnimationGroup::qt_metacast +32 (int (*)(...))QParallelAnimationGroup::qt_metacall +40 (int (*)(...))QParallelAnimationGroup::~QParallelAnimationGroup +48 (int (*)(...))QParallelAnimationGroup::~QParallelAnimationGroup +56 (int (*)(...))QParallelAnimationGroup::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QParallelAnimationGroup::duration +120 (int (*)(...))QParallelAnimationGroup::updateCurrentTime +128 (int (*)(...))QParallelAnimationGroup::updateState +136 (int (*)(...))QParallelAnimationGroup::updateDirection + +Class QParallelAnimationGroup + size=16 align=8 + base size=16 base align=8 +QParallelAnimationGroup (0x0x7319b07fba28) 0 + vptr=((& QParallelAnimationGroup::_ZTV23QParallelAnimationGroup) + 16) +QAnimationGroup (0x0x7319b07fba90) 0 + primary-for QParallelAnimationGroup (0x0x7319b07fba28) +QAbstractAnimation (0x0x7319b07fbaf8) 0 + primary-for QAnimationGroup (0x0x7319b07fba90) +QObject (0x0x7319b07f77e0) 0 + primary-for QAbstractAnimation (0x0x7319b07fbaf8) + +Class QPauseAnimation::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QPauseAnimation::QPrivateSignal (0x0x7319b07f7a20) 0 empty + +Vtable for QPauseAnimation +QPauseAnimation::_ZTV15QPauseAnimation: 18 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QPauseAnimation) +16 (int (*)(...))QPauseAnimation::metaObject +24 (int (*)(...))QPauseAnimation::qt_metacast +32 (int (*)(...))QPauseAnimation::qt_metacall +40 (int (*)(...))QPauseAnimation::~QPauseAnimation +48 (int (*)(...))QPauseAnimation::~QPauseAnimation +56 (int (*)(...))QPauseAnimation::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QPauseAnimation::duration +120 (int (*)(...))QPauseAnimation::updateCurrentTime +128 (int (*)(...))QAbstractAnimation::updateState +136 (int (*)(...))QAbstractAnimation::updateDirection + +Class QPauseAnimation + size=16 align=8 + base size=16 base align=8 +QPauseAnimation (0x0x7319b07fbb60) 0 + vptr=((& QPauseAnimation::_ZTV15QPauseAnimation) + 16) +QAbstractAnimation (0x0x7319b07fbbc8) 0 + primary-for QPauseAnimation (0x0x7319b07fbb60) +QObject (0x0x7319b07f79c0) 0 + primary-for QAbstractAnimation (0x0x7319b07fbbc8) + +Class QPermission + size=40 align=8 + base size=40 base align=8 +QPermission (0x0x7319b07f7ba0) 0 + +Class QLocationPermission::ShortData + size=8 align=1 + base size=8 base align=1 +QLocationPermission::ShortData (0x0x7319b07f7e40) 0 + +Class QLocationPermission::U + size=8 align=8 + base size=8 base align=8 +QLocationPermission::U (0x0x7319b07f7ea0) 0 + +Class QLocationPermission + size=8 align=8 + base size=8 base align=8 +QLocationPermission (0x0x7319b07f7de0) 0 + +Class QCalendarPermission::ShortData + size=8 align=1 + base size=8 base align=1 +QCalendarPermission::ShortData (0x0x7319b04954e0) 0 + +Class QCalendarPermission::U + size=8 align=8 + base size=8 base align=8 +QCalendarPermission::U (0x0x7319b0495540) 0 + +Class QCalendarPermission + size=8 align=8 + base size=8 base align=8 +QCalendarPermission (0x0x7319b0495480) 0 + +Class QContactsPermission::ShortData + size=8 align=1 + base size=8 base align=1 +QContactsPermission::ShortData (0x0x7319b04f9a20) 0 + +Class QContactsPermission::U + size=8 align=8 + base size=8 base align=8 +QContactsPermission::U (0x0x7319b04f9a80) 0 + +Class QContactsPermission + size=8 align=8 + base size=8 base align=8 +QContactsPermission (0x0x7319b04f99c0) 0 + +Class QBluetoothPermission::ShortData + size=8 align=1 + base size=8 base align=1 +QBluetoothPermission::ShortData (0x0x7319b055af60) 0 + +Class QBluetoothPermission::U + size=8 align=8 + base size=8 base align=8 +QBluetoothPermission::U (0x0x7319b057a000) 0 + +Class QBluetoothPermission + size=8 align=8 + base size=8 base align=8 +QBluetoothPermission (0x0x7319b055af00) 0 + +Class QCameraPermission::ShortData + size=8 align=1 + base size=8 base align=1 +QCameraPermission::ShortData (0x0x7319b0218960) 0 + +Class QCameraPermission::U + size=8 align=8 + base size=8 base align=8 +QCameraPermission::U (0x0x7319b02189c0) 0 + +Class QCameraPermission + size=8 align=8 + base size=8 base align=8 +QCameraPermission (0x0x7319b0218900) 0 + +Class QMicrophonePermission::ShortData + size=8 align=1 + base size=8 base align=1 +QMicrophonePermission::ShortData (0x0x7319b029c300) 0 + +Class QMicrophonePermission::U + size=8 align=8 + base size=8 base align=8 +QMicrophonePermission::U (0x0x7319b029c360) 0 + +Class QMicrophonePermission + size=8 align=8 + base size=8 base align=8 +QMicrophonePermission (0x0x7319b029c2a0) 0 + +Class QPluginMetaData::Header + size=4 align=1 + base size=4 base align=1 +QPluginMetaData::Header (0x0x7319b0331600) 0 + +Class QPluginMetaData::MagicHeader + size=16 align=1 + base size=16 base align=1 +QPluginMetaData::MagicHeader (0x0x7319b0331660) 0 + +Class QPluginMetaData::ElfNoteHeader + size=32 align=8 + base size=28 base align=8 +QPluginMetaData::ElfNoteHeader (0x0x7319b03316c0) 0 + +Class QPluginMetaData + size=16 align=8 + base size=16 base align=8 +QPluginMetaData (0x0x7319b03315a0) 0 + +Class QStaticPlugin + size=24 align=8 + base size=24 base align=8 +QStaticPlugin (0x0x7319b0331cc0) 0 + +Class QPluginLoader::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QPluginLoader::QPrivateSignal (0x0x7319b0396000) 0 empty + +Vtable for QPluginLoader +QPluginLoader::_ZTV13QPluginLoader: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QPluginLoader) +16 (int (*)(...))QPluginLoader::metaObject +24 (int (*)(...))QPluginLoader::qt_metacast +32 (int (*)(...))QPluginLoader::qt_metacall +40 (int (*)(...))QPluginLoader::~QPluginLoader +48 (int (*)(...))QPluginLoader::~QPluginLoader +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QPluginLoader + size=32 align=8 + base size=25 base align=8 +QPluginLoader (0x0x7319b03846e8) 0 + vptr=((& QPluginLoader::_ZTV13QPluginLoader) + 16) +QObject (0x0x7319b0370f60) 0 + primary-for QPluginLoader (0x0x7319b03846e8) + +Class QProcessEnvironment + size=8 align=8 + base size=8 base align=8 +QProcessEnvironment (0x0x7319b03960c0) 0 + +Class QProcess::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QProcess::QPrivateSignal (0x0x7319b00234e0) 0 empty + +Class QProcess::UnixProcessParameters + size=32 align=4 + base size=32 base align=4 +QProcess::UnixProcessParameters (0x0x7319b0023540) 0 + +Class QProcess::Use_setChildProcessModifier_Instead + size=1 align=1 + base size=0 base align=1 +QProcess::Use_setChildProcessModifier_Instead (0x0x7319b0023840) 0 empty + +Vtable for QProcess +QProcess::_ZTV8QProcess: 32 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI8QProcess) +16 (int (*)(...))QProcess::metaObject +24 (int (*)(...))QProcess::qt_metacast +32 (int (*)(...))QProcess::qt_metacall +40 (int (*)(...))QProcess::~QProcess +48 (int (*)(...))QProcess::~QProcess +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QProcess::isSequential +120 (int (*)(...))QProcess::open +128 (int (*)(...))QProcess::close +136 (int (*)(...))QIODevice::pos +144 (int (*)(...))QIODevice::size +152 (int (*)(...))QIODevice::seek +160 (int (*)(...))QIODevice::atEnd +168 (int (*)(...))QIODevice::reset +176 (int (*)(...))QIODevice::bytesAvailable +184 (int (*)(...))QProcess::bytesToWrite +192 (int (*)(...))QIODevice::canReadLine +200 (int (*)(...))QProcess::waitForReadyRead +208 (int (*)(...))QProcess::waitForBytesWritten +216 (int (*)(...))QProcess::readData +224 (int (*)(...))QIODevice::readLineData +232 (int (*)(...))QIODevice::skipData +240 (int (*)(...))QProcess::writeData +248 (int (*)(...))QProcess::setupChildProcess + +Class QProcess + size=16 align=8 + base size=16 base align=8 +QProcess (0x0x7319b00255b0) 0 + vptr=((& QProcess::_ZTV8QProcess) + 16) +QIODevice (0x0x7319b03ea850) 0 + primary-for QProcess (0x0x7319b00255b0) +QObject (0x0x7319b0023420) 0 + primary-for QIODevice (0x0x7319b03ea850) +QIODeviceBase (0x0x7319b0023480) 0 empty + +Class QVariantAnimation::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QVariantAnimation::QPrivateSignal (0x0x7319b0087720) 0 empty + +Vtable for QVariantAnimation +QVariantAnimation::_ZTV17QVariantAnimation: 20 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QVariantAnimation) +16 (int (*)(...))QVariantAnimation::metaObject +24 (int (*)(...))QVariantAnimation::qt_metacast +32 (int (*)(...))QVariantAnimation::qt_metacall +40 (int (*)(...))QVariantAnimation::~QVariantAnimation +48 (int (*)(...))QVariantAnimation::~QVariantAnimation +56 (int (*)(...))QVariantAnimation::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QVariantAnimation::duration +120 (int (*)(...))QVariantAnimation::updateCurrentTime +128 (int (*)(...))QVariantAnimation::updateState +136 (int (*)(...))QAbstractAnimation::updateDirection +144 (int (*)(...))QVariantAnimation::updateCurrentValue +152 (int (*)(...))QVariantAnimation::interpolated + +Class QVariantAnimation + size=16 align=8 + base size=16 base align=8 +QVariantAnimation (0x0x7319b00259c0) 0 + vptr=((& QVariantAnimation::_ZTV17QVariantAnimation) + 16) +QAbstractAnimation (0x0x7319b0025a28) 0 + primary-for QVariantAnimation (0x0x7319b00259c0) +QObject (0x0x7319b00876c0) 0 + primary-for QAbstractAnimation (0x0x7319b0025a28) + +Class QPropertyAnimation::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QPropertyAnimation::QPrivateSignal (0x0x7319b0087960) 0 empty + +Vtable for QPropertyAnimation +QPropertyAnimation::_ZTV18QPropertyAnimation: 20 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QPropertyAnimation) +16 (int (*)(...))QPropertyAnimation::metaObject +24 (int (*)(...))QPropertyAnimation::qt_metacast +32 (int (*)(...))QPropertyAnimation::qt_metacall +40 (int (*)(...))QPropertyAnimation::~QPropertyAnimation +48 (int (*)(...))QPropertyAnimation::~QPropertyAnimation +56 (int (*)(...))QPropertyAnimation::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QVariantAnimation::duration +120 (int (*)(...))QVariantAnimation::updateCurrentTime +128 (int (*)(...))QPropertyAnimation::updateState +136 (int (*)(...))QAbstractAnimation::updateDirection +144 (int (*)(...))QPropertyAnimation::updateCurrentValue +152 (int (*)(...))QVariantAnimation::interpolated + +Class QPropertyAnimation + size=16 align=8 + base size=16 base align=8 +QPropertyAnimation (0x0x7319b0025a90) 0 + vptr=((& QPropertyAnimation::_ZTV18QPropertyAnimation) + 16) +QVariantAnimation (0x0x7319b0025af8) 0 + primary-for QPropertyAnimation (0x0x7319b0025a90) +QAbstractAnimation (0x0x7319b0025b60) 0 + primary-for QVariantAnimation (0x0x7319b0025af8) +QObject (0x0x7319b0087900) 0 + primary-for QAbstractAnimation (0x0x7319b0025b60) + +Class std::random_device + size=5000 align=8 + base size=5000 base align=8 +std::random_device (0x0x7319b015a1e0) 0 + +Class std::bernoulli_distribution::param_type + size=8 align=8 + base size=8 base align=8 +std::bernoulli_distribution::param_type (0x0x7319afe50540) 0 + +Class std::bernoulli_distribution + size=8 align=8 + base size=8 base align=8 +std::bernoulli_distribution (0x0x7319afe504e0) 0 + +Class std::seed_seq + size=24 align=8 + base size=24 base align=8 +std::seed_seq (0x0x7319afc09c60) 0 + +Class QRandomGenerator::InitialRandomData + size=16 align=8 + base size=16 base align=8 +QRandomGenerator::InitialRandomData (0x0x7319afa3a360) 0 + +Class QRandomGenerator::Storage + size=2504 align=8 + base size=2504 base align=8 +QRandomGenerator::Storage (0x0x7319afa3a3c0) 0 + +Class QRandomGenerator + size=2512 align=8 + base size=2512 base align=8 +QRandomGenerator (0x0x7319afa3a300) 0 + +Class QRandomGenerator64 + size=2512 align=8 + base size=2512 base align=8 +QRandomGenerator64 (0x0x7319afaa6068) 0 +QRandomGenerator (0x0x7319afabc8a0) 0 + +Vtable for QRangeModelDetails::AutoConnectContext +QRangeModelDetails::AutoConnectContext::_ZTVN18QRangeModelDetails18AutoConnectContextE: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN18QRangeModelDetails18AutoConnectContextE) +16 (int (*)(...))QObject::metaObject +24 (int (*)(...))QObject::qt_metacast +32 (int (*)(...))QObject::qt_metacall +40 (int (*)(...))QRangeModelDetails::AutoConnectContext::~AutoConnectContext +48 (int (*)(...))QRangeModelDetails::AutoConnectContext::~AutoConnectContext +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QRangeModelDetails::AutoConnectContext + size=24 align=8 + base size=20 base align=8 +QRangeModelDetails::AutoConnectContext (0x0x7319afb76d68) 0 + vptr=((& QRangeModelDetails::AutoConnectContext::_ZTVN18QRangeModelDetails18AutoConnectContextE) + 16) +QObject (0x0x7319af8236c0) 0 + primary-for QRangeModelDetails::AutoConnectContext (0x0x7319afb76d68) + +Class QRangeModelDetails::PropertyCache + size=8 align=8 + base size=8 base align=8 +QRangeModelDetails::PropertyCache (0x0x7319af8239c0) 0 + +Class QRangeModelDetails::ConnectionStorage::Connection + size=16 align=8 + base size=16 base align=8 +QRangeModelDetails::ConnectionStorage::Connection (0x0x7319af8f3120) 0 + +Class QRangeModelDetails::ConnectionStorage + size=16 align=8 + base size=16 base align=8 +QRangeModelDetails::ConnectionStorage (0x0x7319af8f30c0) 0 + +Class QRangeModelImplBase + size=16 align=8 + base size=16 base align=8 +QRangeModelImplBase (0x0x7319af993c30) 0 +QtPrivate::QQuasiVirtualInterface (0x0x7319af98ea20) 0 + +Class QRangeModel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QRangeModel::QPrivateSignal (0x0x7319af335720) 0 empty + +Vtable for QRangeModel +QRangeModel::_ZTV11QRangeModel: 51 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QRangeModel) +16 (int (*)(...))QRangeModel::metaObject +24 (int (*)(...))QRangeModel::qt_metacast +32 (int (*)(...))QRangeModel::qt_metacall +40 (int (*)(...))QRangeModel::~QRangeModel +48 (int (*)(...))QRangeModel::~QRangeModel +56 (int (*)(...))QRangeModel::event +64 (int (*)(...))QRangeModel::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QRangeModel::index +120 (int (*)(...))QRangeModel::parent +128 (int (*)(...))QRangeModel::sibling +136 (int (*)(...))QRangeModel::rowCount +144 (int (*)(...))QRangeModel::columnCount +152 (int (*)(...))QRangeModel::hasChildren +160 (int (*)(...))QRangeModel::data +168 (int (*)(...))QRangeModel::setData +176 (int (*)(...))QRangeModel::headerData +184 (int (*)(...))QRangeModel::setHeaderData +192 (int (*)(...))QRangeModel::itemData +200 (int (*)(...))QRangeModel::setItemData +208 (int (*)(...))QRangeModel::clearItemData +216 (int (*)(...))QRangeModel::mimeTypes +224 (int (*)(...))QRangeModel::mimeData +232 (int (*)(...))QRangeModel::canDropMimeData +240 (int (*)(...))QRangeModel::dropMimeData +248 (int (*)(...))QRangeModel::supportedDropActions +256 (int (*)(...))QRangeModel::supportedDragActions +264 (int (*)(...))QRangeModel::insertRows +272 (int (*)(...))QRangeModel::insertColumns +280 (int (*)(...))QRangeModel::removeRows +288 (int (*)(...))QRangeModel::removeColumns +296 (int (*)(...))QRangeModel::moveRows +304 (int (*)(...))QRangeModel::moveColumns +312 (int (*)(...))QRangeModel::fetchMore +320 (int (*)(...))QRangeModel::canFetchMore +328 (int (*)(...))QRangeModel::flags +336 (int (*)(...))QRangeModel::sort +344 (int (*)(...))QRangeModel::buddy +352 (int (*)(...))QRangeModel::match +360 (int (*)(...))QRangeModel::span +368 (int (*)(...))QRangeModel::roleNames +376 (int (*)(...))QRangeModel::multiData +384 (int (*)(...))QAbstractItemModel::submit +392 (int (*)(...))QAbstractItemModel::revert +400 (int (*)(...))QRangeModel::resetInternalData + +Class QRangeModel + size=16 align=8 + base size=16 base align=8 +QRangeModel (0x0x7319af47ac30) 0 + vptr=((& QRangeModel::_ZTV11QRangeModel) + 16) +QAbstractItemModel (0x0x7319af47ac98) 0 + primary-for QRangeModel (0x0x7319af47ac30) +QObject (0x0x7319af3356c0) 0 + primary-for QAbstractItemModel (0x0x7319af47ac98) + +Class QBasicReadWriteLock + size=8 align=8 + base size=8 base align=8 +QBasicReadWriteLock (0x0x7319aee8c120) 0 + +Class QReadWriteLock + size=8 align=8 + base size=8 base align=8 +QReadWriteLock (0x0x7319aee0cf70) 0 +QBasicReadWriteLock (0x0x7319aee8cf60) 0 + +Class QReadLocker + size=8 align=8 + base size=8 base align=8 +QReadLocker (0x0x7319aef03540) 0 + +Class QWriteLocker + size=8 align=8 + base size=8 base align=8 +QWriteLocker (0x0x7319aef03a20) 0 + +Class QSize + size=8 align=4 + base size=8 base align=4 +QSize (0x0x7319aef03f00) 0 + +Class QSizeF + size=16 align=8 + base size=16 base align=8 +QSizeF (0x0x7319aeff4600) 0 + +Class QRect + size=16 align=4 + base size=16 base align=4 +QRect (0x0x7319aec94d80) 0 + +Class QRectF + size=32 align=8 + base size=32 base align=8 +QRectF (0x0x7319aeadf780) 0 + +Class QResource + size=8 align=8 + base size=8 base align=8 +QResource (0x0x7319ae83a0c0) 0 + +Class QSaveFile::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSaveFile::QPrivateSignal (0x0x7319ae83a3c0) 0 empty + +Vtable for QSaveFile +QSaveFile::_ZTV9QSaveFile: 35 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QSaveFile) +16 (int (*)(...))QSaveFile::metaObject +24 (int (*)(...))QSaveFile::qt_metacast +32 (int (*)(...))QSaveFile::qt_metacall +40 (int (*)(...))QSaveFile::~QSaveFile +48 (int (*)(...))QSaveFile::~QSaveFile +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QFileDevice::isSequential +120 (int (*)(...))QSaveFile::open +128 (int (*)(...))QSaveFile::close +136 (int (*)(...))QFileDevice::pos +144 (int (*)(...))QFileDevice::size +152 (int (*)(...))QFileDevice::seek +160 (int (*)(...))QFileDevice::atEnd +168 (int (*)(...))QIODevice::reset +176 (int (*)(...))QIODevice::bytesAvailable +184 (int (*)(...))QIODevice::bytesToWrite +192 (int (*)(...))QIODevice::canReadLine +200 (int (*)(...))QIODevice::waitForReadyRead +208 (int (*)(...))QIODevice::waitForBytesWritten +216 (int (*)(...))QFileDevice::readData +224 (int (*)(...))QFileDevice::readLineData +232 (int (*)(...))QIODevice::skipData +240 (int (*)(...))QSaveFile::writeData +248 (int (*)(...))QSaveFile::fileName +256 (int (*)(...))QFileDevice::resize +264 (int (*)(...))QFileDevice::permissions +272 (int (*)(...))QFileDevice::setPermissions + +Class QSaveFile + size=16 align=8 + base size=16 base align=8 +QSaveFile (0x0x7319aebb4f70) 0 + vptr=((& QSaveFile::_ZTV9QSaveFile) + 16) +QFileDevice (0x0x7319ae857000) 0 + primary-for QSaveFile (0x0x7319aebb4f70) +QIODevice (0x0x7319ae817a80) 0 + primary-for QFileDevice (0x0x7319ae857000) +QObject (0x0x7319ae83a300) 0 + primary-for QIODevice (0x0x7319ae817a80) +QIODeviceBase (0x0x7319ae83a360) 0 empty + +Class QSemaphore + size=8 align=8 + base size=8 base align=8 +QSemaphore (0x0x7319ae83a840) 0 + +Class QSemaphoreReleaser + size=16 align=8 + base size=12 base align=8 +QSemaphoreReleaser (0x0x7319ae83ac60) 0 + +Class QSequentialAnimationGroup::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSequentialAnimationGroup::QPrivateSignal (0x0x7319ae8cb540) 0 empty + +Vtable for QSequentialAnimationGroup +QSequentialAnimationGroup::_ZTV25QSequentialAnimationGroup: 18 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI25QSequentialAnimationGroup) +16 (int (*)(...))QSequentialAnimationGroup::metaObject +24 (int (*)(...))QSequentialAnimationGroup::qt_metacast +32 (int (*)(...))QSequentialAnimationGroup::qt_metacall +40 (int (*)(...))QSequentialAnimationGroup::~QSequentialAnimationGroup +48 (int (*)(...))QSequentialAnimationGroup::~QSequentialAnimationGroup +56 (int (*)(...))QSequentialAnimationGroup::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QSequentialAnimationGroup::duration +120 (int (*)(...))QSequentialAnimationGroup::updateCurrentTime +128 (int (*)(...))QSequentialAnimationGroup::updateState +136 (int (*)(...))QSequentialAnimationGroup::updateDirection + +Class QSequentialAnimationGroup + size=16 align=8 + base size=16 base align=8 +QSequentialAnimationGroup (0x0x7319ae857138) 0 + vptr=((& QSequentialAnimationGroup::_ZTV25QSequentialAnimationGroup) + 16) +QAnimationGroup (0x0x7319ae8571a0) 0 + primary-for QSequentialAnimationGroup (0x0x7319ae857138) +QAbstractAnimation (0x0x7319ae857208) 0 + primary-for QAnimationGroup (0x0x7319ae8571a0) +QObject (0x0x7319ae8cb4e0) 0 + primary-for QAbstractAnimation (0x0x7319ae857208) + +Class QSequentialIterator + size=16 align=8 + base size=16 base align=8 +QSequentialIterator (0x0x7319ae857270) 0 +QIterator (0x0x7319ae8572d8) 0 +QBaseIterator (0x0x7319ae8cb6c0) 0 + +Class QSequentialConstIterator + size=16 align=8 + base size=16 base align=8 +QSequentialConstIterator (0x0x7319ae857340) 0 +QConstIterator (0x0x7319ae8573a8) 0 +QBaseIterator (0x0x7319ae8cb8a0) 0 + +Class QSequentialIterable + size=24 align=8 + base size=24 base align=8 +QSequentialIterable (0x0x7319ae857410) 0 +QIterable (0x0x7319ae8cba80) 0 + +Class QSettings::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSettings::QPrivateSignal (0x0x7319ae616360) 0 empty + +Vtable for QSettings +QSettings::_ZTV9QSettings: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QSettings) +16 (int (*)(...))QSettings::metaObject +24 (int (*)(...))QSettings::qt_metacast +32 (int (*)(...))QSettings::qt_metacall +40 (int (*)(...))QSettings::~QSettings +48 (int (*)(...))QSettings::~QSettings +56 (int (*)(...))QSettings::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QSettings + size=16 align=8 + base size=16 base align=8 +QSettings (0x0x7319ae602c30) 0 + vptr=((& QSettings::_ZTV9QSettings) + 16) +QObject (0x0x7319ae616300) 0 + primary-for QSettings (0x0x7319ae602c30) + +Class QNativeIpcKey::TypeAndFlags + size=8 align=4 + base size=8 base align=4 +QNativeIpcKey::TypeAndFlags (0x0x7319ae616780) 0 + +Class QNativeIpcKey + size=40 align=8 + base size=40 base align=8 +QNativeIpcKey (0x0x7319ae616720) 0 + +Class QSharedMemory::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSharedMemory::QPrivateSignal (0x0x7319ae772240) 0 empty + +Vtable for QSharedMemory +QSharedMemory::_ZTV13QSharedMemory: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QSharedMemory) +16 (int (*)(...))QSharedMemory::metaObject +24 (int (*)(...))QSharedMemory::qt_metacast +32 (int (*)(...))QSharedMemory::qt_metacall +40 (int (*)(...))QSharedMemory::~QSharedMemory +48 (int (*)(...))QSharedMemory::~QSharedMemory +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QSharedMemory + size=16 align=8 + base size=16 base align=8 +QSharedMemory (0x0x7319ae762a90) 0 + vptr=((& QSharedMemory::_ZTV13QSharedMemory) + 16) +QObject (0x0x7319ae7721e0) 0 + primary-for QSharedMemory (0x0x7319ae762a90) + +Class QSignalMapper::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSignalMapper::QPrivateSignal (0x0x7319ae772600) 0 empty + +Vtable for QSignalMapper +QSignalMapper::_ZTV13QSignalMapper: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QSignalMapper) +16 (int (*)(...))QSignalMapper::metaObject +24 (int (*)(...))QSignalMapper::qt_metacast +32 (int (*)(...))QSignalMapper::qt_metacall +40 (int (*)(...))QSignalMapper::~QSignalMapper +48 (int (*)(...))QSignalMapper::~QSignalMapper +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QSignalMapper + size=16 align=8 + base size=16 base align=8 +QSignalMapper (0x0x7319ae762af8) 0 + vptr=((& QSignalMapper::_ZTV13QSignalMapper) + 16) +QObject (0x0x7319ae7725a0) 0 + primary-for QSignalMapper (0x0x7319ae762af8) + +Class __uintr_frame + size=24 align=8 + base size=24 base align=8 +__uintr_frame (0x0x7319ae43a900) 0 + +Class QSocketNotifier::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSocketNotifier::QPrivateSignal (0x0x7319ac948060) 0 empty + +Vtable for QSocketNotifier +QSocketNotifier::_ZTV15QSocketNotifier: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QSocketNotifier) +16 (int (*)(...))QSocketNotifier::metaObject +24 (int (*)(...))QSocketNotifier::qt_metacast +32 (int (*)(...))QSocketNotifier::qt_metacall +40 (int (*)(...))QSocketNotifier::~QSocketNotifier +48 (int (*)(...))QSocketNotifier::~QSocketNotifier +56 (int (*)(...))QSocketNotifier::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QSocketNotifier + size=16 align=8 + base size=16 base align=8 +QSocketNotifier (0x0x7319ac922270) 0 + vptr=((& QSocketNotifier::_ZTV15QSocketNotifier) + 16) +QObject (0x0x7319ac948000) 0 + primary-for QSocketNotifier (0x0x7319ac922270) + +Class QSocketDescriptor + size=4 align=4 + base size=4 base align=4 +QSocketDescriptor (0x0x7319ac9481e0) 0 + +Class QSortFilterProxyModel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSortFilterProxyModel::QPrivateSignal (0x0x7319ac9ad960) 0 empty + +Vtable for QSortFilterProxyModel +QSortFilterProxyModel::_ZTV21QSortFilterProxyModel: 59 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI21QSortFilterProxyModel) +16 (int (*)(...))QSortFilterProxyModel::metaObject +24 (int (*)(...))QSortFilterProxyModel::qt_metacast +32 (int (*)(...))QSortFilterProxyModel::qt_metacall +40 (int (*)(...))QSortFilterProxyModel::~QSortFilterProxyModel +48 (int (*)(...))QSortFilterProxyModel::~QSortFilterProxyModel +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QSortFilterProxyModel::index +120 (int (*)(...))QSortFilterProxyModel::parent +128 (int (*)(...))QSortFilterProxyModel::sibling +136 (int (*)(...))QSortFilterProxyModel::rowCount +144 (int (*)(...))QSortFilterProxyModel::columnCount +152 (int (*)(...))QSortFilterProxyModel::hasChildren +160 (int (*)(...))QSortFilterProxyModel::data +168 (int (*)(...))QSortFilterProxyModel::setData +176 (int (*)(...))QSortFilterProxyModel::headerData +184 (int (*)(...))QSortFilterProxyModel::setHeaderData +192 (int (*)(...))QAbstractProxyModel::itemData +200 (int (*)(...))QAbstractProxyModel::setItemData +208 (int (*)(...))QAbstractProxyModel::clearItemData +216 (int (*)(...))QSortFilterProxyModel::mimeTypes +224 (int (*)(...))QSortFilterProxyModel::mimeData +232 (int (*)(...))QAbstractProxyModel::canDropMimeData +240 (int (*)(...))QSortFilterProxyModel::dropMimeData +248 (int (*)(...))QSortFilterProxyModel::supportedDropActions +256 (int (*)(...))QAbstractProxyModel::supportedDragActions +264 (int (*)(...))QSortFilterProxyModel::insertRows +272 (int (*)(...))QSortFilterProxyModel::insertColumns +280 (int (*)(...))QSortFilterProxyModel::removeRows +288 (int (*)(...))QSortFilterProxyModel::removeColumns +296 (int (*)(...))QAbstractItemModel::moveRows +304 (int (*)(...))QAbstractItemModel::moveColumns +312 (int (*)(...))QSortFilterProxyModel::fetchMore +320 (int (*)(...))QSortFilterProxyModel::canFetchMore +328 (int (*)(...))QSortFilterProxyModel::flags +336 (int (*)(...))QSortFilterProxyModel::sort +344 (int (*)(...))QSortFilterProxyModel::buddy +352 (int (*)(...))QSortFilterProxyModel::match +360 (int (*)(...))QSortFilterProxyModel::span +368 (int (*)(...))QAbstractProxyModel::roleNames +376 (int (*)(...))QAbstractItemModel::multiData +384 (int (*)(...))QAbstractProxyModel::submit +392 (int (*)(...))QAbstractProxyModel::revert +400 (int (*)(...))QAbstractItemModel::resetInternalData +408 (int (*)(...))QSortFilterProxyModel::setSourceModel +416 (int (*)(...))QSortFilterProxyModel::mapToSource +424 (int (*)(...))QSortFilterProxyModel::mapFromSource +432 (int (*)(...))QSortFilterProxyModel::mapSelectionToSource +440 (int (*)(...))QSortFilterProxyModel::mapSelectionFromSource +448 (int (*)(...))QSortFilterProxyModel::filterAcceptsRow +456 (int (*)(...))QSortFilterProxyModel::filterAcceptsColumn +464 (int (*)(...))QSortFilterProxyModel::lessThan + +Class QSortFilterProxyModel + size=16 align=8 + base size=16 base align=8 +QSortFilterProxyModel (0x0x7319ac9a3b60) 0 + vptr=((& QSortFilterProxyModel::_ZTV21QSortFilterProxyModel) + 16) +QAbstractProxyModel (0x0x7319ac9a3bc8) 0 + primary-for QSortFilterProxyModel (0x0x7319ac9a3b60) +QAbstractItemModel (0x0x7319ac9a3c30) 0 + primary-for QAbstractProxyModel (0x0x7319ac9a3bc8) +QObject (0x0x7319ac9ad900) 0 + primary-for QAbstractItemModel (0x0x7319ac9a3c30) + +Class QStandardPaths + size=1 align=1 + base size=0 base align=1 +QStandardPaths (0x0x7319ac63d360) 0 empty + +Class QStorageInfo + size=8 align=8 + base size=8 base align=8 +QStorageInfo (0x0x7319ac6bd960) 0 + +Class QStringListModel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QStringListModel::QPrivateSignal (0x0x7319ac78a600) 0 empty + +Vtable for QStringListModel +QStringListModel::_ZTV16QStringListModel: 51 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI16QStringListModel) +16 (int (*)(...))QStringListModel::metaObject +24 (int (*)(...))QStringListModel::qt_metacast +32 (int (*)(...))QStringListModel::qt_metacall +40 (int (*)(...))QStringListModel::~QStringListModel +48 (int (*)(...))QStringListModel::~QStringListModel +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QAbstractListModel::index +120 (int (*)(...))QAbstractListModel::parent +128 (int (*)(...))QStringListModel::sibling +136 (int (*)(...))QStringListModel::rowCount +144 (int (*)(...))QAbstractListModel::columnCount +152 (int (*)(...))QAbstractListModel::hasChildren +160 (int (*)(...))QStringListModel::data +168 (int (*)(...))QStringListModel::setData +176 (int (*)(...))QAbstractItemModel::headerData +184 (int (*)(...))QAbstractItemModel::setHeaderData +192 (int (*)(...))QStringListModel::itemData +200 (int (*)(...))QStringListModel::setItemData +208 (int (*)(...))QStringListModel::clearItemData +216 (int (*)(...))QAbstractItemModel::mimeTypes +224 (int (*)(...))QAbstractItemModel::mimeData +232 (int (*)(...))QAbstractItemModel::canDropMimeData +240 (int (*)(...))QAbstractListModel::dropMimeData +248 (int (*)(...))QStringListModel::supportedDropActions +256 (int (*)(...))QAbstractItemModel::supportedDragActions +264 (int (*)(...))QStringListModel::insertRows +272 (int (*)(...))QAbstractItemModel::insertColumns +280 (int (*)(...))QStringListModel::removeRows +288 (int (*)(...))QAbstractItemModel::removeColumns +296 (int (*)(...))QStringListModel::moveRows +304 (int (*)(...))QAbstractItemModel::moveColumns +312 (int (*)(...))QAbstractItemModel::fetchMore +320 (int (*)(...))QAbstractItemModel::canFetchMore +328 (int (*)(...))QStringListModel::flags +336 (int (*)(...))QStringListModel::sort +344 (int (*)(...))QAbstractItemModel::buddy +352 (int (*)(...))QAbstractItemModel::match +360 (int (*)(...))QAbstractItemModel::span +368 (int (*)(...))QAbstractItemModel::roleNames +376 (int (*)(...))QAbstractItemModel::multiData +384 (int (*)(...))QAbstractItemModel::submit +392 (int (*)(...))QAbstractItemModel::revert +400 (int (*)(...))QAbstractItemModel::resetInternalData + +Class QStringListModel + size=40 align=8 + base size=40 base align=8 +QStringListModel (0x0x7319ac7891a0) 0 + vptr=((& QStringListModel::_ZTV16QStringListModel) + 16) +QAbstractListModel (0x0x7319ac789208) 0 + primary-for QStringListModel (0x0x7319ac7891a0) +QAbstractItemModel (0x0x7319ac789270) 0 + primary-for QAbstractListModel (0x0x7319ac789208) +QObject (0x0x7319ac78a5a0) 0 + primary-for QAbstractItemModel (0x0x7319ac789270) + +Class QSystemSemaphore + size=8 align=8 + base size=8 base align=8 +QSystemSemaphore (0x0x7319ac78a6c0) 0 + +Class QTemporaryDir + size=8 align=8 + base size=8 base align=8 +QTemporaryDir (0x0x7319ac540000) 0 + +Class QTemporaryFile::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTemporaryFile::QPrivateSignal (0x0x7319ac540420) 0 empty + +Vtable for QTemporaryFile +QTemporaryFile::_ZTV14QTemporaryFile: 35 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QTemporaryFile) +16 (int (*)(...))QTemporaryFile::metaObject +24 (int (*)(...))QTemporaryFile::qt_metacast +32 (int (*)(...))QTemporaryFile::qt_metacall +40 (int (*)(...))QTemporaryFile::~QTemporaryFile +48 (int (*)(...))QTemporaryFile::~QTemporaryFile +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QFileDevice::isSequential +120 (int (*)(...))QTemporaryFile::open +128 (int (*)(...))QFileDevice::close +136 (int (*)(...))QFileDevice::pos +144 (int (*)(...))QFile::size +152 (int (*)(...))QFileDevice::seek +160 (int (*)(...))QFileDevice::atEnd +168 (int (*)(...))QIODevice::reset +176 (int (*)(...))QIODevice::bytesAvailable +184 (int (*)(...))QIODevice::bytesToWrite +192 (int (*)(...))QIODevice::canReadLine +200 (int (*)(...))QIODevice::waitForReadyRead +208 (int (*)(...))QIODevice::waitForBytesWritten +216 (int (*)(...))QFileDevice::readData +224 (int (*)(...))QFileDevice::readLineData +232 (int (*)(...))QIODevice::skipData +240 (int (*)(...))QFileDevice::writeData +248 (int (*)(...))QTemporaryFile::fileName +256 (int (*)(...))QFile::resize +264 (int (*)(...))QFile::permissions +272 (int (*)(...))QFile::setPermissions + +Class QTemporaryFile + size=16 align=8 + base size=16 base align=8 +QTemporaryFile (0x0x7319ac50bc30) 0 + vptr=((& QTemporaryFile::_ZTV14QTemporaryFile) + 16) +QFile (0x0x7319ac50bc98) 0 + primary-for QTemporaryFile (0x0x7319ac50bc30) +QFileDevice (0x0x7319ac50bd00) 0 + primary-for QFile (0x0x7319ac50bc98) +QIODevice (0x0x7319ac50c8c0) 0 + primary-for QFileDevice (0x0x7319ac50bd00) +QObject (0x0x7319ac540360) 0 + primary-for QIODevice (0x0x7319ac50c8c0) +QIODeviceBase (0x0x7319ac5403c0) 0 empty + +Class QTextBoundaryFinder + size=72 align=8 + base size=72 base align=8 +QTextBoundaryFinder (0x0x7319ac540840) 0 + +Class QThreadStorageData + size=4 align=4 + base size=4 base align=4 +QThreadStorageData (0x0x7319ac20b720) 0 + +Class QTimeLine::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTimeLine::QPrivateSignal (0x0x7319ac20be40) 0 empty + +Vtable for QTimeLine +QTimeLine::_ZTV9QTimeLine: 15 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QTimeLine) +16 (int (*)(...))QTimeLine::metaObject +24 (int (*)(...))QTimeLine::qt_metacast +32 (int (*)(...))QTimeLine::qt_metacall +40 (int (*)(...))QTimeLine::~QTimeLine +48 (int (*)(...))QTimeLine::~QTimeLine +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QTimeLine::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QTimeLine::valueForTime + +Class QTimeLine + size=16 align=8 + base size=16 base align=8 +QTimeLine (0x0x7319ac5f6d00) 0 + vptr=((& QTimeLine::_ZTV9QTimeLine) + 16) +QObject (0x0x7319ac20bde0) 0 + primary-for QTimeLine (0x0x7319ac5f6d00) + +Class QTranslator::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTranslator::QPrivateSignal (0x0x7319ac298060) 0 empty + +Vtable for QTranslator +QTranslator::_ZTV11QTranslator: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QTranslator) +16 (int (*)(...))QTranslator::metaObject +24 (int (*)(...))QTranslator::qt_metacast +32 (int (*)(...))QTranslator::qt_metacall +40 (int (*)(...))QTranslator::~QTranslator +48 (int (*)(...))QTranslator::~QTranslator +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QTranslator::translate +120 (int (*)(...))QTranslator::isEmpty + +Class QTranslator + size=16 align=8 + base size=16 base align=8 +QTranslator (0x0x7319ac5f6d68) 0 + vptr=((& QTranslator::_ZTV11QTranslator) + 16) +QObject (0x0x7319ac298000) 0 + primary-for QTranslator (0x0x7319ac5f6d68) + +Class QTransposeProxyModel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTransposeProxyModel::QPrivateSignal (0x0x7319ac298240) 0 empty + +Vtable for QTransposeProxyModel +QTransposeProxyModel::_ZTV20QTransposeProxyModel: 56 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QTransposeProxyModel) +16 (int (*)(...))QTransposeProxyModel::metaObject +24 (int (*)(...))QTransposeProxyModel::qt_metacast +32 (int (*)(...))QTransposeProxyModel::qt_metacall +40 (int (*)(...))QTransposeProxyModel::~QTransposeProxyModel +48 (int (*)(...))QTransposeProxyModel::~QTransposeProxyModel +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QTransposeProxyModel::index +120 (int (*)(...))QTransposeProxyModel::parent +128 (int (*)(...))QAbstractProxyModel::sibling +136 (int (*)(...))QTransposeProxyModel::rowCount +144 (int (*)(...))QTransposeProxyModel::columnCount +152 (int (*)(...))QAbstractProxyModel::hasChildren +160 (int (*)(...))QAbstractProxyModel::data +168 (int (*)(...))QAbstractProxyModel::setData +176 (int (*)(...))QTransposeProxyModel::headerData +184 (int (*)(...))QTransposeProxyModel::setHeaderData +192 (int (*)(...))QTransposeProxyModel::itemData +200 (int (*)(...))QTransposeProxyModel::setItemData +208 (int (*)(...))QAbstractProxyModel::clearItemData +216 (int (*)(...))QAbstractProxyModel::mimeTypes +224 (int (*)(...))QAbstractProxyModel::mimeData +232 (int (*)(...))QAbstractProxyModel::canDropMimeData +240 (int (*)(...))QAbstractProxyModel::dropMimeData +248 (int (*)(...))QAbstractProxyModel::supportedDropActions +256 (int (*)(...))QAbstractProxyModel::supportedDragActions +264 (int (*)(...))QTransposeProxyModel::insertRows +272 (int (*)(...))QTransposeProxyModel::insertColumns +280 (int (*)(...))QTransposeProxyModel::removeRows +288 (int (*)(...))QTransposeProxyModel::removeColumns +296 (int (*)(...))QTransposeProxyModel::moveRows +304 (int (*)(...))QTransposeProxyModel::moveColumns +312 (int (*)(...))QAbstractProxyModel::fetchMore +320 (int (*)(...))QAbstractProxyModel::canFetchMore +328 (int (*)(...))QAbstractProxyModel::flags +336 (int (*)(...))QTransposeProxyModel::sort +344 (int (*)(...))QAbstractProxyModel::buddy +352 (int (*)(...))QAbstractItemModel::match +360 (int (*)(...))QTransposeProxyModel::span +368 (int (*)(...))QAbstractProxyModel::roleNames +376 (int (*)(...))QAbstractItemModel::multiData +384 (int (*)(...))QAbstractProxyModel::submit +392 (int (*)(...))QAbstractProxyModel::revert +400 (int (*)(...))QAbstractItemModel::resetInternalData +408 (int (*)(...))QTransposeProxyModel::setSourceModel +416 (int (*)(...))QTransposeProxyModel::mapToSource +424 (int (*)(...))QTransposeProxyModel::mapFromSource +432 (int (*)(...))QAbstractProxyModel::mapSelectionToSource +440 (int (*)(...))QAbstractProxyModel::mapSelectionFromSource + +Class QTransposeProxyModel + size=16 align=8 + base size=16 base align=8 +QTransposeProxyModel (0x0x7319ac5f6dd0) 0 + vptr=((& QTransposeProxyModel::_ZTV20QTransposeProxyModel) + 16) +QAbstractProxyModel (0x0x7319ac5f6e38) 0 + primary-for QTransposeProxyModel (0x0x7319ac5f6dd0) +QAbstractItemModel (0x0x7319ac5f6ea0) 0 + primary-for QAbstractProxyModel (0x0x7319ac5f6e38) +QObject (0x0x7319ac2981e0) 0 + primary-for QAbstractItemModel (0x0x7319ac5f6ea0) + +Class QUrlQuery + size=8 align=8 + base size=8 base align=8 +QUrlQuery (0x0x7319ac2983c0) 0 + +Class QWaitCondition + size=8 align=8 + base size=8 base align=8 +QWaitCondition (0x0x7319ac3b7420) 0 + +Class QtPrivate::QXmlString + size=24 align=8 + base size=24 base align=8 +QtPrivate::QXmlString (0x0x7319ac3b7540) 0 + +Class QXmlStreamAttribute + size=104 align=8 + base size=97 base align=8 +QXmlStreamAttribute (0x0x7319ac017de0) 0 + +Class QXmlStreamAttributes + size=24 align=8 + base size=24 base align=8 +QXmlStreamAttributes (0x0x7319ac089888) 0 +QList (0x0x7319ac0898f0) 0 +QListSpecialMethods (0x0x7319ac089958) 0 empty +QListSpecialMethodsBase (0x0x7319ac09f300) 0 empty + +Class QXmlStreamNamespaceDeclaration + size=48 align=8 + base size=48 base align=8 +QXmlStreamNamespaceDeclaration (0x0x7319ac09fb40) 0 + +Class QXmlStreamNotationDeclaration + size=72 align=8 + base size=72 base align=8 +QXmlStreamNotationDeclaration (0x0x7319ac155ba0) 0 + +Class QXmlStreamEntityDeclaration + size=120 align=8 + base size=120 base align=8 +QXmlStreamEntityDeclaration (0x0x7319ac1acc00) 0 + +Vtable for QXmlStreamEntityResolver +QXmlStreamEntityResolver::_ZTV24QXmlStreamEntityResolver: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI24QXmlStreamEntityResolver) +16 (int (*)(...))QXmlStreamEntityResolver::~QXmlStreamEntityResolver +24 (int (*)(...))QXmlStreamEntityResolver::~QXmlStreamEntityResolver +32 (int (*)(...))QXmlStreamEntityResolver::resolveEntity +40 (int (*)(...))QXmlStreamEntityResolver::resolveUndeclaredEntity + +Class QXmlStreamEntityResolver + size=8 align=8 + base size=8 base align=8 +QXmlStreamEntityResolver (0x0x7319abe02f60) 0 nearly-empty + vptr=((& QXmlStreamEntityResolver::_ZTV24QXmlStreamEntityResolver) + 16) + +Class QXmlStreamReader::PrivateConstructorTag + size=1 align=1 + base size=0 base align=1 +QXmlStreamReader::PrivateConstructorTag (0x0x7319abe29060) 0 empty + +Class QXmlStreamReader + size=8 align=8 + base size=8 base align=8 +QXmlStreamReader (0x0x7319abe29000) 0 + +Class QXmlStreamWriter + size=8 align=8 + base size=8 base align=8 +QXmlStreamWriter (0x0x7319abf88d20) 0 + +Class QtConcurrent::TaskStartParameters + size=16 align=8 + base size=16 base align=8 +QtConcurrent::TaskStartParameters (0x0x7319abd27d80) 0 + +Class QtConcurrent::Median + size=72 align=8 + base size=70 base align=8 +QtConcurrent::Median (0x0x7319abdd2060) 0 + +Class QtConcurrent::ThreadEngineBarrier + size=16 align=8 + base size=16 base align=8 +QtConcurrent::ThreadEngineBarrier (0x0x7319abdd2480) 0 + +Vtable for QtConcurrent::ThreadEngineBase +QtConcurrent::ThreadEngineBase::_ZTVN12QtConcurrent16ThreadEngineBaseE: 11 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN12QtConcurrent16ThreadEngineBaseE) +16 (int (*)(...))QtConcurrent::ThreadEngineBase::run +24 0 +32 0 +40 (int (*)(...))QtConcurrent::ThreadEngineBase::start +48 (int (*)(...))QtConcurrent::ThreadEngineBase::finish +56 (int (*)(...))QtConcurrent::ThreadEngineBase::threadFunction +64 (int (*)(...))QtConcurrent::ThreadEngineBase::shouldStartThread +72 (int (*)(...))QtConcurrent::ThreadEngineBase::shouldThrottleThread +80 (int (*)(...))__cxa_pure_virtual + +Class QtConcurrent::ThreadEngineBase + size=64 align=8 + base size=64 base align=8 +QtConcurrent::ThreadEngineBase (0x0x7319abd7e618) 0 + vptr=((& QtConcurrent::ThreadEngineBase::_ZTVN12QtConcurrent16ThreadEngineBaseE) + 16) +QRunnable (0x0x7319abdd2540) 0 + primary-for QtConcurrent::ThreadEngineBase (0x0x7319abd7e618) + +Class QtConcurrent::BlockSizeManager + size=176 align=8 + base size=172 base align=8 +QtConcurrent::BlockSizeManager (0x0x7319aba09060) 0 + +Class QtPrivate::PushBackWrapper + size=1 align=1 + base size=0 base align=1 +QtPrivate::PushBackWrapper (0x0x7319aba31ea0) 0 empty + +Class QDBusAbstractAdaptor::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDBusAbstractAdaptor::QPrivateSignal (0x0x7319abbff540) 0 empty + +Vtable for QDBusAbstractAdaptor +QDBusAbstractAdaptor::_ZTV20QDBusAbstractAdaptor: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QDBusAbstractAdaptor) +16 (int (*)(...))QDBusAbstractAdaptor::metaObject +24 (int (*)(...))QDBusAbstractAdaptor::qt_metacast +32 (int (*)(...))QDBusAbstractAdaptor::qt_metacall +40 (int (*)(...))QDBusAbstractAdaptor::~QDBusAbstractAdaptor +48 (int (*)(...))QDBusAbstractAdaptor::~QDBusAbstractAdaptor +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QDBusAbstractAdaptor + size=16 align=8 + base size=16 base align=8 +QDBusAbstractAdaptor (0x0x7319abbb4270) 0 + vptr=((& QDBusAbstractAdaptor::_ZTV20QDBusAbstractAdaptor) + 16) +QObject (0x0x7319abbff4e0) 0 + primary-for QDBusAbstractAdaptor (0x0x7319abbb4270) + +Class QDBusError + size=64 align=8 + base size=64 base align=8 +QDBusError (0x0x7319abbff6c0) 0 + +Class QDBusMessage + size=8 align=8 + base size=8 base align=8 +QDBusMessage (0x0x7319ab8af2a0) 0 + +Class QDBusObjectPath + size=24 align=8 + base size=24 base align=8 +QDBusObjectPath (0x0x7319ab92d3c0) 0 + +Class QDBusSignature + size=24 align=8 + base size=24 base align=8 +QDBusSignature (0x0x7319ab9ae0c0) 0 + +Class QDBusVariant + size=32 align=8 + base size=32 base align=8 +QDBusVariant (0x0x7319ab603cc0) 0 + +Class QDBusConnection + size=8 align=8 + base size=8 base align=8 +QDBusConnection (0x0x7319ab6e2300) 0 + +Class QDBusPendingCall + size=8 align=8 + base size=8 base align=8 +QDBusPendingCall (0x0x7319ab7b7e40) 0 + +Class QDBusPendingCallWatcher::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDBusPendingCallWatcher::QPrivateSignal (0x0x7319ab504240) 0 empty + +Vtable for QDBusPendingCallWatcher +QDBusPendingCallWatcher::_ZTV23QDBusPendingCallWatcher: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI23QDBusPendingCallWatcher) +16 (int (*)(...))QDBusPendingCallWatcher::metaObject +24 (int (*)(...))QDBusPendingCallWatcher::qt_metacast +32 (int (*)(...))QDBusPendingCallWatcher::qt_metacall +40 (int (*)(...))QDBusPendingCallWatcher::~QDBusPendingCallWatcher +48 (int (*)(...))QDBusPendingCallWatcher::~QDBusPendingCallWatcher +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QDBusPendingCallWatcher + size=24 align=8 + base size=24 base align=8 +QDBusPendingCallWatcher (0x0x7319ab4fd380) 0 + vptr=((& QDBusPendingCallWatcher::_ZTV23QDBusPendingCallWatcher) + 16) +QObject (0x0x7319ab504180) 0 + primary-for QDBusPendingCallWatcher (0x0x7319ab4fd380) +QDBusPendingCall (0x0x7319ab5041e0) 16 + +Vtable for QDBusAbstractInterfaceBase +QDBusAbstractInterfaceBase::_ZTV26QDBusAbstractInterfaceBase: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI26QDBusAbstractInterfaceBase) +16 (int (*)(...))QObject::metaObject +24 (int (*)(...))QObject::qt_metacast +32 (int (*)(...))QDBusAbstractInterfaceBase::qt_metacall +40 (int (*)(...))QDBusAbstractInterfaceBase::~QDBusAbstractInterfaceBase +48 (int (*)(...))QDBusAbstractInterfaceBase::~QDBusAbstractInterfaceBase +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QDBusAbstractInterfaceBase + size=16 align=8 + base size=16 base align=8 +QDBusAbstractInterfaceBase (0x0x7319ab502478) 0 + vptr=((& QDBusAbstractInterfaceBase::_ZTV26QDBusAbstractInterfaceBase) + 16) +QObject (0x0x7319ab504300) 0 + primary-for QDBusAbstractInterfaceBase (0x0x7319ab502478) + +Class QDBusAbstractInterface::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDBusAbstractInterface::QPrivateSignal (0x0x7319ab504480) 0 empty + +Vtable for QDBusAbstractInterface +QDBusAbstractInterface::_ZTV22QDBusAbstractInterface: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI22QDBusAbstractInterface) +16 (int (*)(...))QDBusAbstractInterface::metaObject +24 (int (*)(...))QDBusAbstractInterface::qt_metacast +32 (int (*)(...))QDBusAbstractInterface::qt_metacall +40 (int (*)(...))QDBusAbstractInterface::~QDBusAbstractInterface +48 (int (*)(...))QDBusAbstractInterface::~QDBusAbstractInterface +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QDBusAbstractInterface::connectNotify +104 (int (*)(...))QDBusAbstractInterface::disconnectNotify + +Class QDBusAbstractInterface + size=16 align=8 + base size=16 base align=8 +QDBusAbstractInterface (0x0x7319ab5024e0) 0 + vptr=((& QDBusAbstractInterface::_ZTV22QDBusAbstractInterface) + 16) +QDBusAbstractInterfaceBase (0x0x7319ab502548) 0 + primary-for QDBusAbstractInterface (0x0x7319ab5024e0) +QObject (0x0x7319ab504420) 0 + primary-for QDBusAbstractInterfaceBase (0x0x7319ab502548) + +Class QDBusArgument + size=8 align=8 + base size=8 base align=8 +QDBusArgument (0x0x7319ab504840) 0 + +Class QDBusPendingReplyBase + size=8 align=8 + base size=8 base align=8 +QDBusPendingReplyBase (0x0x7319ab00b068) 0 +QDBusPendingCall (0x0x7319ab3eaae0) 0 + +Class QDBusConnectionInterface::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDBusConnectionInterface::QPrivateSignal (0x0x7319ab06b600) 0 empty + +Vtable for QDBusConnectionInterface +QDBusConnectionInterface::_ZTV24QDBusConnectionInterface: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI24QDBusConnectionInterface) +16 (int (*)(...))QDBusConnectionInterface::metaObject +24 (int (*)(...))QDBusConnectionInterface::qt_metacast +32 (int (*)(...))QDBusConnectionInterface::qt_metacall +40 (int (*)(...))QDBusConnectionInterface::~QDBusConnectionInterface +48 (int (*)(...))QDBusConnectionInterface::~QDBusConnectionInterface +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QDBusConnectionInterface::connectNotify +104 (int (*)(...))QDBusConnectionInterface::disconnectNotify + +Class QDBusConnectionInterface + size=16 align=8 + base size=16 base align=8 +QDBusConnectionInterface (0x0x7319ab00b2d8) 0 + vptr=((& QDBusConnectionInterface::_ZTV24QDBusConnectionInterface) + 16) +QDBusAbstractInterface (0x0x7319ab00b340) 0 + primary-for QDBusConnectionInterface (0x0x7319ab00b2d8) +QDBusAbstractInterfaceBase (0x0x7319ab00b3a8) 0 + primary-for QDBusAbstractInterface (0x0x7319ab00b340) +QObject (0x0x7319ab06b5a0) 0 + primary-for QDBusAbstractInterfaceBase (0x0x7319ab00b3a8) + +Class QDBusContext + size=8 align=8 + base size=8 base align=8 +QDBusContext (0x0x7319ab06ba80) 0 + +Vtable for QDBusInterface +QDBusInterface::_ZTV14QDBusInterface: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QDBusInterface) +16 (int (*)(...))QDBusInterface::metaObject +24 (int (*)(...))QDBusInterface::qt_metacast +32 (int (*)(...))QDBusInterface::qt_metacall +40 (int (*)(...))QDBusInterface::~QDBusInterface +48 (int (*)(...))QDBusInterface::~QDBusInterface +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QDBusAbstractInterface::connectNotify +104 (int (*)(...))QDBusAbstractInterface::disconnectNotify + +Class QDBusInterface + size=16 align=8 + base size=16 base align=8 +QDBusInterface (0x0x7319ab00b410) 0 + vptr=((& QDBusInterface::_ZTV14QDBusInterface) + 16) +QDBusAbstractInterface (0x0x7319ab00b478) 0 + primary-for QDBusInterface (0x0x7319ab00b410) +QDBusAbstractInterfaceBase (0x0x7319ab00b4e0) 0 + primary-for QDBusAbstractInterface (0x0x7319ab00b478) +QObject (0x0x7319ab06bae0) 0 + primary-for QDBusAbstractInterfaceBase (0x0x7319ab00b4e0) + +Class QDBusMetaType + size=1 align=1 + base size=0 base align=1 +QDBusMetaType (0x0x7319ab06bc00) 0 empty + +Class QDBusServer::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDBusServer::QPrivateSignal (0x0x7319ab06bea0) 0 empty + +Vtable for QDBusServer +QDBusServer::_ZTV11QDBusServer: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QDBusServer) +16 (int (*)(...))QDBusServer::metaObject +24 (int (*)(...))QDBusServer::qt_metacast +32 (int (*)(...))QDBusServer::qt_metacall +40 (int (*)(...))QDBusServer::~QDBusServer +48 (int (*)(...))QDBusServer::~QDBusServer +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QDBusServer + size=24 align=8 + base size=24 base align=8 +QDBusServer (0x0x7319ab00b548) 0 + vptr=((& QDBusServer::_ZTV11QDBusServer) + 16) +QObject (0x0x7319ab06be40) 0 + primary-for QDBusServer (0x0x7319ab00b548) + +Class QDBusServiceWatcher::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDBusServiceWatcher::QPrivateSignal (0x0x7319ab0cc000) 0 empty + +Vtable for QDBusServiceWatcher +QDBusServiceWatcher::_ZTV19QDBusServiceWatcher: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QDBusServiceWatcher) +16 (int (*)(...))QDBusServiceWatcher::metaObject +24 (int (*)(...))QDBusServiceWatcher::qt_metacast +32 (int (*)(...))QDBusServiceWatcher::qt_metacall +40 (int (*)(...))QDBusServiceWatcher::~QDBusServiceWatcher +48 (int (*)(...))QDBusServiceWatcher::~QDBusServiceWatcher +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QDBusServiceWatcher + size=16 align=8 + base size=16 base align=8 +QDBusServiceWatcher (0x0x7319ab00b5b0) 0 + vptr=((& QDBusServiceWatcher::_ZTV19QDBusServiceWatcher) + 16) +QObject (0x0x7319ab06bf60) 0 + primary-for QDBusServiceWatcher (0x0x7319ab00b5b0) + +Class QDBusUnixFileDescriptor + size=8 align=8 + base size=8 base align=8 +QDBusUnixFileDescriptor (0x0x7319ab0cc780) 0 + +Class QDBusVirtualObject::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDBusVirtualObject::QPrivateSignal (0x0x7319ab1f1c60) 0 empty + +Vtable for QDBusVirtualObject +QDBusVirtualObject::_ZTV18QDBusVirtualObject: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QDBusVirtualObject) +16 (int (*)(...))QDBusVirtualObject::metaObject +24 (int (*)(...))QDBusVirtualObject::qt_metacast +32 (int (*)(...))QDBusVirtualObject::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual + +Class QDBusVirtualObject + size=16 align=8 + base size=16 base align=8 +QDBusVirtualObject (0x0x7319aae0ec98) 0 + vptr=((& QDBusVirtualObject::_ZTV18QDBusVirtualObject) + 16) +QObject (0x0x7319ab1f1c00) 0 + primary-for QDBusVirtualObject (0x0x7319aae0ec98) + +Vtable for QPaintDevice +QPaintDevice::_ZTV12QPaintDevice: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QPaintDevice) +16 0 +24 0 +32 (int (*)(...))QPaintDevice::devType +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))QPaintDevice::metric +56 (int (*)(...))QPaintDevice::initPainter +64 (int (*)(...))QPaintDevice::redirected +72 (int (*)(...))QPaintDevice::sharedPainter + +Class QPaintDevice + size=16 align=8 + base size=10 base align=8 +QPaintDevice (0x0x7319ab1f1d20) 0 + vptr=((& QPaintDevice::_ZTV12QPaintDevice) + 16) + +Class QRgba64 + size=8 align=8 + base size=8 base align=8 +QRgba64 (0x0x7319aae3a7e0) 0 + +Class QColor::CT + size=10 align=2 + base size=10 base align=2 +QColor::CT (0x0x7319aaef7c00) 0 + +Class QColor + size=16 align=4 + base size=14 base align=4 +QColor (0x0x7319aaef7ba0) 0 + +Class QPixelFormat + size=8 align=8 + base size=8 base align=8 +QPixelFormat (0x0x7319aafc1240) 0 + +Class QPolygon + size=24 align=8 + base size=24 base align=8 +QPolygon (0x0x7319aad06750) 0 +QList (0x0x7319aad067b8) 0 +QListSpecialMethods (0x0x7319aad06820) 0 empty +QListSpecialMethodsBase (0x0x7319aad088a0) 0 empty + +Class QPolygonF + size=24 align=8 + base size=24 base align=8 +QPolygonF (0x0x7319aaa340d0) 0 +QList (0x0x7319aaa34138) 0 +QListSpecialMethods (0x0x7319aaa341a0) 0 empty +QListSpecialMethodsBase (0x0x7319aaa21540) 0 empty + +Class QRegion::QRegionData + size=16 align=8 + base size=16 base align=8 +QRegion::QRegionData (0x0x7319aaae2f60) 0 + +Class QRegion + size=8 align=8 + base size=8 base align=8 +QRegion (0x0x7319aaae2f00) 0 + +Class QTransform::Affine + size=8 align=8 + base size=8 base align=8 +QTransform::Affine (0x0x7319aab74600) 0 + +Class QTransform + size=80 align=8 + base size=74 base align=8 +QTransform (0x0x7319aab745a0) 0 + +Vtable for QImage +QImage::_ZTV6QImage: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI6QImage) +16 (int (*)(...))QImage::~QImage +24 (int (*)(...))QImage::~QImage +32 (int (*)(...))QImage::devType +40 (int (*)(...))QImage::paintEngine +48 (int (*)(...))QImage::metric +56 (int (*)(...))QPaintDevice::initPainter +64 (int (*)(...))QPaintDevice::redirected +72 (int (*)(...))QPaintDevice::sharedPainter + +Class QImage + size=24 align=8 + base size=24 base align=8 +QImage (0x0x7319aabe4a90) 0 + vptr=((& QImage::_ZTV6QImage) + 16) +QPaintDevice (0x0x7319aa80c780) 0 + primary-for QImage (0x0x7319aabe4a90) + +Vtable for QPixmap +QPixmap::_ZTV7QPixmap: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI7QPixmap) +16 (int (*)(...))QPixmap::~QPixmap +24 (int (*)(...))QPixmap::~QPixmap +32 (int (*)(...))QPixmap::devType +40 (int (*)(...))QPixmap::paintEngine +48 (int (*)(...))QPixmap::metric +56 (int (*)(...))QPaintDevice::initPainter +64 (int (*)(...))QPaintDevice::redirected +72 (int (*)(...))QPaintDevice::sharedPainter + +Class QPixmap + size=24 align=8 + base size=24 base align=8 +QPixmap (0x0x7319aa8e5680) 0 + vptr=((& QPixmap::_ZTV7QPixmap) + 16) +QPaintDevice (0x0x7319aa8ee420) 0 + primary-for QPixmap (0x0x7319aa8e5680) + +Class QIcon + size=8 align=8 + base size=8 base align=8 +QIcon (0x0x7319aa9a47e0) 0 + +Vtable for QAbstractFileIconProvider +QAbstractFileIconProvider::_ZTV25QAbstractFileIconProvider: 9 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI25QAbstractFileIconProvider) +16 (int (*)(...))QAbstractFileIconProvider::~QAbstractFileIconProvider +24 (int (*)(...))QAbstractFileIconProvider::~QAbstractFileIconProvider +32 (int (*)(...))QAbstractFileIconProvider::icon +40 (int (*)(...))QAbstractFileIconProvider::icon +48 (int (*)(...))QAbstractFileIconProvider::type +56 (int (*)(...))QAbstractFileIconProvider::setOptions +64 (int (*)(...))QAbstractFileIconProvider::options + +Class QAbstractFileIconProvider + size=16 align=8 + base size=16 base align=8 +QAbstractFileIconProvider (0x0x7319aa61ad20) 0 + vptr=((& QAbstractFileIconProvider::_ZTV25QAbstractFileIconProvider) + 16) + +Class QVector2D + size=8 align=4 + base size=8 base align=4 +QVector2D (0x0x7319aa656540) 0 + +Class QVector3D + size=12 align=4 + base size=12 base align=4 +QVector3D (0x0x7319aa7058a0) 0 + +Class QVector4D + size=16 align=4 + base size=16 base align=4 +QVector4D (0x0x7319aa772de0) 0 + +Class QScreen::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QScreen::QPrivateSignal (0x0x7319aa56e360) 0 empty + +Vtable for QScreen +QScreen::_ZTV7QScreen: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI7QScreen) +16 (int (*)(...))QScreen::metaObject +24 (int (*)(...))QScreen::qt_metacast +32 (int (*)(...))QScreen::qt_metacall +40 (int (*)(...))QScreen::~QScreen +48 (int (*)(...))QScreen::~QScreen +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QScreen + size=16 align=8 + base size=16 base align=8 +QScreen (0x0x7319aa4f99c0) 0 + vptr=((& QScreen::_ZTV7QScreen) + 16) +QObject (0x0x7319aa56e300) 0 + primary-for QScreen (0x0x7319aa4f99c0) + +Class QInputMethod::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QInputMethod::QPrivateSignal (0x0x7319aa56e5a0) 0 empty + +Vtable for QInputMethod +QInputMethod::_ZTV12QInputMethod: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QInputMethod) +16 (int (*)(...))QInputMethod::metaObject +24 (int (*)(...))QInputMethod::qt_metacast +32 (int (*)(...))QInputMethod::qt_metacall +40 (int (*)(...))QInputMethod::~QInputMethod +48 (int (*)(...))QInputMethod::~QInputMethod +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QInputMethod + size=16 align=8 + base size=16 base align=8 +QInputMethod (0x0x7319aa4f9a28) 0 + vptr=((& QInputMethod::_ZTV12QInputMethod) + 16) +QObject (0x0x7319aa56e540) 0 + primary-for QInputMethod (0x0x7319aa4f9a28) + +Class QGuiApplication::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGuiApplication::QPrivateSignal (0x0x7319aa56e840) 0 empty + +Vtable for QGuiApplication +QGuiApplication::_ZTV15QGuiApplication: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QGuiApplication) +16 (int (*)(...))QGuiApplication::metaObject +24 (int (*)(...))QGuiApplication::qt_metacast +32 (int (*)(...))QGuiApplication::qt_metacall +40 (int (*)(...))QGuiApplication::~QGuiApplication +48 (int (*)(...))QGuiApplication::~QGuiApplication +56 (int (*)(...))QGuiApplication::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QGuiApplication::notify +120 (int (*)(...))QGuiApplication::compressEvent + +Class QGuiApplication + size=16 align=8 + base size=16 base align=8 +QGuiApplication (0x0x7319aa4f9a90) 0 + vptr=((& QGuiApplication::_ZTV15QGuiApplication) + 16) +QCoreApplication (0x0x7319aa4f9af8) 0 + primary-for QGuiApplication (0x0x7319aa4f9a90) +QObject (0x0x7319aa56e7e0) 0 + primary-for QCoreApplication (0x0x7319aa4f9af8) + +Class QNativeInterface::QX11Application::TypeInfo + size=1 align=1 + base size=0 base align=1 +QNativeInterface::QX11Application::TypeInfo (0x0x7319aa56eb40) 0 empty + +Vtable for QNativeInterface::QX11Application +QNativeInterface::QX11Application::_ZTVN16QNativeInterface15QX11ApplicationE: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN16QNativeInterface15QX11ApplicationE) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual + +Class QNativeInterface::QX11Application + size=8 align=8 + base size=8 base align=8 +QNativeInterface::QX11Application (0x0x7319aa56eae0) 0 nearly-empty + vptr=((& QNativeInterface::QX11Application::_ZTVN16QNativeInterface15QX11ApplicationE) + 16) + +Class QNativeInterface::QWaylandApplication::TypeInfo + size=1 align=1 + base size=0 base align=1 +QNativeInterface::QWaylandApplication::TypeInfo (0x0x7319aa56ec00) 0 empty + +Vtable for QNativeInterface::QWaylandApplication +QNativeInterface::QWaylandApplication::_ZTVN16QNativeInterface19QWaylandApplicationE: 13 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN16QNativeInterface19QWaylandApplicationE) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))__cxa_pure_virtual +96 (int (*)(...))__cxa_pure_virtual + +Class QNativeInterface::QWaylandApplication + size=8 align=8 + base size=8 base align=8 +QNativeInterface::QWaylandApplication (0x0x7319aa56eba0) 0 nearly-empty + vptr=((& QNativeInterface::QWaylandApplication::_ZTVN16QNativeInterface19QWaylandApplicationE) + 16) + +Class QNativeInterface::QWaylandScreen::TypeInfo + size=1 align=1 + base size=0 base align=1 +QNativeInterface::QWaylandScreen::TypeInfo (0x0x7319aa56ed20) 0 empty + +Vtable for QNativeInterface::QWaylandScreen +QNativeInterface::QWaylandScreen::_ZTVN16QNativeInterface14QWaylandScreenE: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN16QNativeInterface14QWaylandScreenE) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual + +Class QNativeInterface::QWaylandScreen + size=8 align=8 + base size=8 base align=8 +QNativeInterface::QWaylandScreen (0x0x7319aa56ecc0) 0 nearly-empty + vptr=((& QNativeInterface::QWaylandScreen::_ZTVN16QNativeInterface14QWaylandScreenE) + 16) + +Class QInputDevice::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QInputDevice::QPrivateSignal (0x0x7319aa56ede0) 0 empty + +Vtable for QInputDevice +QInputDevice::_ZTV12QInputDevice: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QInputDevice) +16 (int (*)(...))QInputDevice::metaObject +24 (int (*)(...))QInputDevice::qt_metacast +32 (int (*)(...))QInputDevice::qt_metacall +40 (int (*)(...))QInputDevice::~QInputDevice +48 (int (*)(...))QInputDevice::~QInputDevice +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QInputDevice + size=16 align=8 + base size=16 base align=8 +QInputDevice (0x0x7319aa4f9b60) 0 + vptr=((& QInputDevice::_ZTV12QInputDevice) + 16) +QObject (0x0x7319aa56ed80) 0 + primary-for QInputDevice (0x0x7319aa4f9b60) + +Class QPointingDeviceUniqueId + size=8 align=8 + base size=8 base align=8 +QPointingDeviceUniqueId (0x0x7319aa5fdba0) 0 + +Class QPointingDevice::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QPointingDevice::QPrivateSignal (0x0x7319aa2ec9c0) 0 empty + +Vtable for QPointingDevice +QPointingDevice::_ZTV15QPointingDevice: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QPointingDevice) +16 (int (*)(...))QPointingDevice::metaObject +24 (int (*)(...))QPointingDevice::qt_metacast +32 (int (*)(...))QPointingDevice::qt_metacall +40 (int (*)(...))QPointingDevice::~QPointingDevice +48 (int (*)(...))QPointingDevice::~QPointingDevice +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QPointingDevice + size=16 align=8 + base size=16 base align=8 +QPointingDevice (0x0x7319aa2fa680) 0 + vptr=((& QPointingDevice::_ZTV15QPointingDevice) + 16) +QInputDevice (0x0x7319aa2fa6e8) 0 + primary-for QPointingDevice (0x0x7319aa2fa680) +QObject (0x0x7319aa2ec960) 0 + primary-for QInputDevice (0x0x7319aa2fa6e8) + +Class QEventPoint + size=8 align=8 + base size=8 base align=8 +QEventPoint (0x0x7319aa35e5a0) 0 + +Class QKeySequence + size=8 align=8 + base size=8 base align=8 +QKeySequence (0x0x7319aa042b40) 0 + +Vtable for QInputEvent +QInputEvent::_ZTV11QInputEvent: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QInputEvent) +16 (int (*)(...))QInputEvent::~QInputEvent +24 (int (*)(...))QInputEvent::~QInputEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QInputEvent::clone +48 (int (*)(...))QInputEvent::setTimestamp + +Class QInputEvent + size=40 align=8 + base size=40 base align=8 +QInputEvent (0x0x7319aa0b9c98) 0 + vptr=((& QInputEvent::_ZTV11QInputEvent) + 16) +QEvent (0x0x7319aa0adde0) 0 + primary-for QInputEvent (0x0x7319aa0b9c98) + +Vtable for QPointerEvent +QPointerEvent::_ZTV13QPointerEvent: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QPointerEvent) +16 (int (*)(...))QPointerEvent::~QPointerEvent +24 (int (*)(...))QPointerEvent::~QPointerEvent +32 (int (*)(...))QPointerEvent::setAccepted +40 (int (*)(...))QPointerEvent::clone +48 (int (*)(...))QPointerEvent::setTimestamp +56 (int (*)(...))QPointerEvent::isBeginEvent +64 (int (*)(...))QPointerEvent::isUpdateEvent +72 (int (*)(...))QPointerEvent::isEndEvent + +Class QPointerEvent + size=64 align=8 + base size=64 base align=8 +QPointerEvent (0x0x7319aa0b9d00) 0 + vptr=((& QPointerEvent::_ZTV13QPointerEvent) + 16) +QInputEvent (0x0x7319aa0b9d68) 0 + primary-for QPointerEvent (0x0x7319aa0b9d00) +QEvent (0x0x7319aa0e10c0) 0 + primary-for QInputEvent (0x0x7319aa0b9d68) + +Vtable for QSinglePointEvent +QSinglePointEvent::_ZTV17QSinglePointEvent: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QSinglePointEvent) +16 (int (*)(...))QSinglePointEvent::~QSinglePointEvent +24 (int (*)(...))QSinglePointEvent::~QSinglePointEvent +32 (int (*)(...))QPointerEvent::setAccepted +40 (int (*)(...))QSinglePointEvent::clone +48 (int (*)(...))QPointerEvent::setTimestamp +56 (int (*)(...))QSinglePointEvent::isBeginEvent +64 (int (*)(...))QSinglePointEvent::isUpdateEvent +72 (int (*)(...))QSinglePointEvent::isEndEvent + +Class QSinglePointEvent + size=80 align=8 + base size=80 base align=8 +QSinglePointEvent (0x0x7319aa0b9f70) 0 + vptr=((& QSinglePointEvent::_ZTV17QSinglePointEvent) + 16) +QPointerEvent (0x0x7319aa164000) 0 + primary-for QSinglePointEvent (0x0x7319aa0b9f70) +QInputEvent (0x0x7319aa164068) 0 + primary-for QPointerEvent (0x0x7319aa164000) +QEvent (0x0x7319aa0e1600) 0 + primary-for QInputEvent (0x0x7319aa164068) + +Vtable for QEnterEvent +QEnterEvent::_ZTV11QEnterEvent: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QEnterEvent) +16 (int (*)(...))QEnterEvent::~QEnterEvent +24 (int (*)(...))QEnterEvent::~QEnterEvent +32 (int (*)(...))QPointerEvent::setAccepted +40 (int (*)(...))QEnterEvent::clone +48 (int (*)(...))QPointerEvent::setTimestamp +56 (int (*)(...))QSinglePointEvent::isBeginEvent +64 (int (*)(...))QSinglePointEvent::isUpdateEvent +72 (int (*)(...))QSinglePointEvent::isEndEvent + +Class QEnterEvent + size=80 align=8 + base size=80 base align=8 +QEnterEvent (0x0x7319aa1640d0) 0 + vptr=((& QEnterEvent::_ZTV11QEnterEvent) + 16) +QSinglePointEvent (0x0x7319aa164138) 0 + primary-for QEnterEvent (0x0x7319aa1640d0) +QPointerEvent (0x0x7319aa1641a0) 0 + primary-for QSinglePointEvent (0x0x7319aa164138) +QInputEvent (0x0x7319aa164208) 0 + primary-for QPointerEvent (0x0x7319aa1641a0) +QEvent (0x0x7319aa0e1900) 0 + primary-for QInputEvent (0x0x7319aa164208) + +Vtable for QMouseEvent +QMouseEvent::_ZTV11QMouseEvent: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QMouseEvent) +16 (int (*)(...))QMouseEvent::~QMouseEvent +24 (int (*)(...))QMouseEvent::~QMouseEvent +32 (int (*)(...))QPointerEvent::setAccepted +40 (int (*)(...))QMouseEvent::clone +48 (int (*)(...))QPointerEvent::setTimestamp +56 (int (*)(...))QSinglePointEvent::isBeginEvent +64 (int (*)(...))QSinglePointEvent::isUpdateEvent +72 (int (*)(...))QSinglePointEvent::isEndEvent + +Class QMouseEvent + size=80 align=8 + base size=80 base align=8 +QMouseEvent (0x0x7319aa164270) 0 + vptr=((& QMouseEvent::_ZTV11QMouseEvent) + 16) +QSinglePointEvent (0x0x7319aa1642d8) 0 + primary-for QMouseEvent (0x0x7319aa164270) +QPointerEvent (0x0x7319aa164340) 0 + primary-for QSinglePointEvent (0x0x7319aa1642d8) +QInputEvent (0x0x7319aa1643a8) 0 + primary-for QPointerEvent (0x0x7319aa164340) +QEvent (0x0x7319aa0e1cc0) 0 + primary-for QInputEvent (0x0x7319aa1643a8) + +Vtable for QHoverEvent +QHoverEvent::_ZTV11QHoverEvent: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QHoverEvent) +16 (int (*)(...))QHoverEvent::~QHoverEvent +24 (int (*)(...))QHoverEvent::~QHoverEvent +32 (int (*)(...))QPointerEvent::setAccepted +40 (int (*)(...))QHoverEvent::clone +48 (int (*)(...))QPointerEvent::setTimestamp +56 (int (*)(...))QSinglePointEvent::isBeginEvent +64 (int (*)(...))QHoverEvent::isUpdateEvent +72 (int (*)(...))QSinglePointEvent::isEndEvent + +Class QHoverEvent + size=96 align=8 + base size=96 base align=8 +QHoverEvent (0x0x7319aa164410) 0 + vptr=((& QHoverEvent::_ZTV11QHoverEvent) + 16) +QSinglePointEvent (0x0x7319aa164478) 0 + primary-for QHoverEvent (0x0x7319aa164410) +QPointerEvent (0x0x7319aa1644e0) 0 + primary-for QSinglePointEvent (0x0x7319aa164478) +QInputEvent (0x0x7319aa164548) 0 + primary-for QPointerEvent (0x0x7319aa1644e0) +QEvent (0x0x7319aa1a80c0) 0 + primary-for QInputEvent (0x0x7319aa164548) + +Vtable for QWheelEvent +QWheelEvent::_ZTV11QWheelEvent: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QWheelEvent) +16 (int (*)(...))QWheelEvent::~QWheelEvent +24 (int (*)(...))QWheelEvent::~QWheelEvent +32 (int (*)(...))QPointerEvent::setAccepted +40 (int (*)(...))QWheelEvent::clone +48 (int (*)(...))QPointerEvent::setTimestamp +56 (int (*)(...))QWheelEvent::isBeginEvent +64 (int (*)(...))QWheelEvent::isUpdateEvent +72 (int (*)(...))QWheelEvent::isEndEvent + +Class QWheelEvent + size=96 align=8 + base size=96 base align=8 +QWheelEvent (0x0x7319aa1645b0) 0 + vptr=((& QWheelEvent::_ZTV11QWheelEvent) + 16) +QSinglePointEvent (0x0x7319aa164618) 0 + primary-for QWheelEvent (0x0x7319aa1645b0) +QPointerEvent (0x0x7319aa164680) 0 + primary-for QSinglePointEvent (0x0x7319aa164618) +QInputEvent (0x0x7319aa1646e8) 0 + primary-for QPointerEvent (0x0x7319aa164680) +QEvent (0x0x7319aa1a8300) 0 + primary-for QInputEvent (0x0x7319aa1646e8) + +Vtable for QTabletEvent +QTabletEvent::_ZTV12QTabletEvent: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QTabletEvent) +16 (int (*)(...))QTabletEvent::~QTabletEvent +24 (int (*)(...))QTabletEvent::~QTabletEvent +32 (int (*)(...))QPointerEvent::setAccepted +40 (int (*)(...))QTabletEvent::clone +48 (int (*)(...))QPointerEvent::setTimestamp +56 (int (*)(...))QSinglePointEvent::isBeginEvent +64 (int (*)(...))QSinglePointEvent::isUpdateEvent +72 (int (*)(...))QSinglePointEvent::isEndEvent + +Class QTabletEvent + size=96 align=8 + base size=96 base align=8 +QTabletEvent (0x0x7319aa164750) 0 + vptr=((& QTabletEvent::_ZTV12QTabletEvent) + 16) +QSinglePointEvent (0x0x7319aa1647b8) 0 + primary-for QTabletEvent (0x0x7319aa164750) +QPointerEvent (0x0x7319aa164820) 0 + primary-for QSinglePointEvent (0x0x7319aa1647b8) +QInputEvent (0x0x7319aa164888) 0 + primary-for QPointerEvent (0x0x7319aa164820) +QEvent (0x0x7319aa1a8600) 0 + primary-for QInputEvent (0x0x7319aa164888) + +Vtable for QNativeGestureEvent +QNativeGestureEvent::_ZTV19QNativeGestureEvent: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QNativeGestureEvent) +16 (int (*)(...))QNativeGestureEvent::~QNativeGestureEvent +24 (int (*)(...))QNativeGestureEvent::~QNativeGestureEvent +32 (int (*)(...))QPointerEvent::setAccepted +40 (int (*)(...))QNativeGestureEvent::clone +48 (int (*)(...))QPointerEvent::setTimestamp +56 (int (*)(...))QSinglePointEvent::isBeginEvent +64 (int (*)(...))QSinglePointEvent::isUpdateEvent +72 (int (*)(...))QSinglePointEvent::isEndEvent + +Class QNativeGestureEvent + size=112 align=8 + base size=112 base align=8 +QNativeGestureEvent (0x0x7319aa1648f0) 0 + vptr=((& QNativeGestureEvent::_ZTV19QNativeGestureEvent) + 16) +QSinglePointEvent (0x0x7319aa164958) 0 + primary-for QNativeGestureEvent (0x0x7319aa1648f0) +QPointerEvent (0x0x7319aa1649c0) 0 + primary-for QSinglePointEvent (0x0x7319aa164958) +QInputEvent (0x0x7319aa164a28) 0 + primary-for QPointerEvent (0x0x7319aa1649c0) +QEvent (0x0x7319aa1a8cc0) 0 + primary-for QInputEvent (0x0x7319aa164a28) + +Vtable for QKeyEvent +QKeyEvent::_ZTV9QKeyEvent: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QKeyEvent) +16 (int (*)(...))QKeyEvent::~QKeyEvent +24 (int (*)(...))QKeyEvent::~QKeyEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QKeyEvent::clone +48 (int (*)(...))QInputEvent::setTimestamp + +Class QKeyEvent + size=88 align=8 + base size=82 base align=8 +QKeyEvent (0x0x7319aa164a90) 0 + vptr=((& QKeyEvent::_ZTV9QKeyEvent) + 16) +QInputEvent (0x0x7319aa164af8) 0 + primary-for QKeyEvent (0x0x7319aa164a90) +QEvent (0x0x7319aa1fc0c0) 0 + primary-for QInputEvent (0x0x7319aa164af8) + +Vtable for QFocusEvent +QFocusEvent::_ZTV11QFocusEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QFocusEvent) +16 (int (*)(...))QFocusEvent::~QFocusEvent +24 (int (*)(...))QFocusEvent::~QFocusEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QFocusEvent::clone + +Class QFocusEvent + size=24 align=8 + base size=20 base align=8 +QFocusEvent (0x0x7319aa164b60) 0 + vptr=((& QFocusEvent::_ZTV11QFocusEvent) + 16) +QEvent (0x0x7319aa1fc4e0) 0 + primary-for QFocusEvent (0x0x7319aa164b60) + +Vtable for QPaintEvent +QPaintEvent::_ZTV11QPaintEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QPaintEvent) +16 (int (*)(...))QPaintEvent::~QPaintEvent +24 (int (*)(...))QPaintEvent::~QPaintEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QPaintEvent::clone + +Class QPaintEvent + size=48 align=8 + base size=41 base align=8 +QPaintEvent (0x0x7319aa164bc8) 0 + vptr=((& QPaintEvent::_ZTV11QPaintEvent) + 16) +QEvent (0x0x7319aa1fc600) 0 + primary-for QPaintEvent (0x0x7319aa164bc8) + +Vtable for QMoveEvent +QMoveEvent::_ZTV10QMoveEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QMoveEvent) +16 (int (*)(...))QMoveEvent::~QMoveEvent +24 (int (*)(...))QMoveEvent::~QMoveEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QMoveEvent::clone + +Class QMoveEvent + size=32 align=8 + base size=32 base align=8 +QMoveEvent (0x0x7319aa164c30) 0 + vptr=((& QMoveEvent::_ZTV10QMoveEvent) + 16) +QEvent (0x0x7319aa1fc720) 0 + primary-for QMoveEvent (0x0x7319aa164c30) + +Vtable for QExposeEvent +QExposeEvent::_ZTV12QExposeEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QExposeEvent) +16 (int (*)(...))QExposeEvent::~QExposeEvent +24 (int (*)(...))QExposeEvent::~QExposeEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QExposeEvent::clone + +Class QExposeEvent + size=24 align=8 + base size=24 base align=8 +QExposeEvent (0x0x7319aa164c98) 0 + vptr=((& QExposeEvent::_ZTV12QExposeEvent) + 16) +QEvent (0x0x7319aa1fc840) 0 + primary-for QExposeEvent (0x0x7319aa164c98) + +Vtable for QPlatformSurfaceEvent +QPlatformSurfaceEvent::_ZTV21QPlatformSurfaceEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI21QPlatformSurfaceEvent) +16 (int (*)(...))QPlatformSurfaceEvent::~QPlatformSurfaceEvent +24 (int (*)(...))QPlatformSurfaceEvent::~QPlatformSurfaceEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QPlatformSurfaceEvent::clone + +Class QPlatformSurfaceEvent + size=24 align=8 + base size=20 base align=8 +QPlatformSurfaceEvent (0x0x7319aa164d00) 0 + vptr=((& QPlatformSurfaceEvent::_ZTV21QPlatformSurfaceEvent) + 16) +QEvent (0x0x7319aa1fc900) 0 + primary-for QPlatformSurfaceEvent (0x0x7319aa164d00) + +Vtable for QResizeEvent +QResizeEvent::_ZTV12QResizeEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QResizeEvent) +16 (int (*)(...))QResizeEvent::~QResizeEvent +24 (int (*)(...))QResizeEvent::~QResizeEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QResizeEvent::clone + +Class QResizeEvent + size=32 align=8 + base size=32 base align=8 +QResizeEvent (0x0x7319aa164d68) 0 + vptr=((& QResizeEvent::_ZTV12QResizeEvent) + 16) +QEvent (0x0x7319aa1fc9c0) 0 + primary-for QResizeEvent (0x0x7319aa164d68) + +Vtable for QCloseEvent +QCloseEvent::_ZTV11QCloseEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QCloseEvent) +16 (int (*)(...))QCloseEvent::~QCloseEvent +24 (int (*)(...))QCloseEvent::~QCloseEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QCloseEvent::clone + +Class QCloseEvent + size=16 align=8 + base size=16 base align=8 +QCloseEvent (0x0x7319aa164dd0) 0 + vptr=((& QCloseEvent::_ZTV11QCloseEvent) + 16) +QEvent (0x0x7319aa1fcae0) 0 + primary-for QCloseEvent (0x0x7319aa164dd0) + +Vtable for QIconDragEvent +QIconDragEvent::_ZTV14QIconDragEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QIconDragEvent) +16 (int (*)(...))QIconDragEvent::~QIconDragEvent +24 (int (*)(...))QIconDragEvent::~QIconDragEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QIconDragEvent::clone + +Class QIconDragEvent + size=16 align=8 + base size=16 base align=8 +QIconDragEvent (0x0x7319aa164e38) 0 + vptr=((& QIconDragEvent::_ZTV14QIconDragEvent) + 16) +QEvent (0x0x7319aa1fcb40) 0 + primary-for QIconDragEvent (0x0x7319aa164e38) + +Vtable for QShowEvent +QShowEvent::_ZTV10QShowEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QShowEvent) +16 (int (*)(...))QShowEvent::~QShowEvent +24 (int (*)(...))QShowEvent::~QShowEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QShowEvent::clone + +Class QShowEvent + size=16 align=8 + base size=16 base align=8 +QShowEvent (0x0x7319aa164ea0) 0 + vptr=((& QShowEvent::_ZTV10QShowEvent) + 16) +QEvent (0x0x7319aa1fcba0) 0 + primary-for QShowEvent (0x0x7319aa164ea0) + +Vtable for QHideEvent +QHideEvent::_ZTV10QHideEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QHideEvent) +16 (int (*)(...))QHideEvent::~QHideEvent +24 (int (*)(...))QHideEvent::~QHideEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QHideEvent::clone + +Class QHideEvent + size=16 align=8 + base size=16 base align=8 +QHideEvent (0x0x7319aa164f08) 0 + vptr=((& QHideEvent::_ZTV10QHideEvent) + 16) +QEvent (0x0x7319aa1fcc00) 0 + primary-for QHideEvent (0x0x7319aa164f08) + +Vtable for QContextMenuEvent +QContextMenuEvent::_ZTV17QContextMenuEvent: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QContextMenuEvent) +16 (int (*)(...))QContextMenuEvent::~QContextMenuEvent +24 (int (*)(...))QContextMenuEvent::~QContextMenuEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QContextMenuEvent::clone +48 (int (*)(...))QInputEvent::setTimestamp + +Class QContextMenuEvent + size=64 align=8 + base size=57 base align=8 +QContextMenuEvent (0x0x7319aa164f70) 0 + vptr=((& QContextMenuEvent::_ZTV17QContextMenuEvent) + 16) +QInputEvent (0x0x7319a9e66000) 0 + primary-for QContextMenuEvent (0x0x7319aa164f70) +QEvent (0x0x7319aa1fcc60) 0 + primary-for QInputEvent (0x0x7319a9e66000) + +Class QInputMethodEvent::Attribute + size=48 align=8 + base size=48 base align=8 +QInputMethodEvent::Attribute (0x0x7319a9e7a000) 0 + +Vtable for QInputMethodEvent +QInputMethodEvent::_ZTV17QInputMethodEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QInputMethodEvent) +16 (int (*)(...))QInputMethodEvent::~QInputMethodEvent +24 (int (*)(...))QInputMethodEvent::~QInputMethodEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QInputMethodEvent::clone + +Class QInputMethodEvent + size=96 align=8 + base size=96 base align=8 +QInputMethodEvent (0x0x7319a9e66068) 0 + vptr=((& QInputMethodEvent::_ZTV17QInputMethodEvent) + 16) +QEvent (0x0x7319aa1fcf60) 0 + primary-for QInputMethodEvent (0x0x7319a9e66068) + +Class QInputMethodQueryEvent::QueryPair + size=40 align=8 + base size=40 base align=8 +QInputMethodQueryEvent::QueryPair (0x0x7319a9f37780) 0 + +Vtable for QInputMethodQueryEvent +QInputMethodQueryEvent::_ZTV22QInputMethodQueryEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI22QInputMethodQueryEvent) +16 (int (*)(...))QInputMethodQueryEvent::~QInputMethodQueryEvent +24 (int (*)(...))QInputMethodQueryEvent::~QInputMethodQueryEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QInputMethodQueryEvent::clone + +Class QInputMethodQueryEvent + size=48 align=8 + base size=48 base align=8 +QInputMethodQueryEvent (0x0x7319a9f39680) 0 + vptr=((& QInputMethodQueryEvent::_ZTV22QInputMethodQueryEvent) + 16) +QEvent (0x0x7319a9f37720) 0 + primary-for QInputMethodQueryEvent (0x0x7319a9f39680) + +Vtable for QDropEvent +QDropEvent::_ZTV10QDropEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QDropEvent) +16 (int (*)(...))QDropEvent::~QDropEvent +24 (int (*)(...))QDropEvent::~QDropEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QDropEvent::clone + +Class QDropEvent + size=64 align=8 + base size=64 base align=8 +QDropEvent (0x0x7319a9feef08) 0 + vptr=((& QDropEvent::_ZTV10QDropEvent) + 16) +QEvent (0x0x7319a9ff6540) 0 + primary-for QDropEvent (0x0x7319a9feef08) + +Vtable for QDragMoveEvent +QDragMoveEvent::_ZTV14QDragMoveEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QDragMoveEvent) +16 (int (*)(...))QDragMoveEvent::~QDragMoveEvent +24 (int (*)(...))QDragMoveEvent::~QDragMoveEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QDragMoveEvent::clone + +Class QDragMoveEvent + size=80 align=8 + base size=80 base align=8 +QDragMoveEvent (0x0x7319a9feef70) 0 + vptr=((& QDragMoveEvent::_ZTV14QDragMoveEvent) + 16) +QDropEvent (0x0x7319a9c1d000) 0 + primary-for QDragMoveEvent (0x0x7319a9feef70) +QEvent (0x0x7319a9ff6a20) 0 + primary-for QDropEvent (0x0x7319a9c1d000) + +Vtable for QDragEnterEvent +QDragEnterEvent::_ZTV15QDragEnterEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QDragEnterEvent) +16 (int (*)(...))QDragEnterEvent::~QDragEnterEvent +24 (int (*)(...))QDragEnterEvent::~QDragEnterEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QDragEnterEvent::clone + +Class QDragEnterEvent + size=80 align=8 + base size=80 base align=8 +QDragEnterEvent (0x0x7319a9c1d068) 0 + vptr=((& QDragEnterEvent::_ZTV15QDragEnterEvent) + 16) +QDragMoveEvent (0x0x7319a9c1d0d0) 0 + primary-for QDragEnterEvent (0x0x7319a9c1d068) +QDropEvent (0x0x7319a9c1d138) 0 + primary-for QDragMoveEvent (0x0x7319a9c1d0d0) +QEvent (0x0x7319a9ff6c60) 0 + primary-for QDropEvent (0x0x7319a9c1d138) + +Vtable for QDragLeaveEvent +QDragLeaveEvent::_ZTV15QDragLeaveEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QDragLeaveEvent) +16 (int (*)(...))QDragLeaveEvent::~QDragLeaveEvent +24 (int (*)(...))QDragLeaveEvent::~QDragLeaveEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QDragLeaveEvent::clone + +Class QDragLeaveEvent + size=16 align=8 + base size=16 base align=8 +QDragLeaveEvent (0x0x7319a9c1d1a0) 0 + vptr=((& QDragLeaveEvent::_ZTV15QDragLeaveEvent) + 16) +QEvent (0x0x7319a9ff6cc0) 0 + primary-for QDragLeaveEvent (0x0x7319a9c1d1a0) + +Vtable for QHelpEvent +QHelpEvent::_ZTV10QHelpEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QHelpEvent) +16 (int (*)(...))QHelpEvent::~QHelpEvent +24 (int (*)(...))QHelpEvent::~QHelpEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QHelpEvent::clone + +Class QHelpEvent + size=32 align=8 + base size=32 base align=8 +QHelpEvent (0x0x7319a9c1d208) 0 + vptr=((& QHelpEvent::_ZTV10QHelpEvent) + 16) +QEvent (0x0x7319a9ff6d20) 0 + primary-for QHelpEvent (0x0x7319a9c1d208) + +Vtable for QStatusTipEvent +QStatusTipEvent::_ZTV15QStatusTipEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QStatusTipEvent) +16 (int (*)(...))QStatusTipEvent::~QStatusTipEvent +24 (int (*)(...))QStatusTipEvent::~QStatusTipEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QStatusTipEvent::clone + +Class QStatusTipEvent + size=40 align=8 + base size=40 base align=8 +QStatusTipEvent (0x0x7319a9c1d270) 0 + vptr=((& QStatusTipEvent::_ZTV15QStatusTipEvent) + 16) +QEvent (0x0x7319a9c46000) 0 + primary-for QStatusTipEvent (0x0x7319a9c1d270) + +Vtable for QWhatsThisClickedEvent +QWhatsThisClickedEvent::_ZTV22QWhatsThisClickedEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI22QWhatsThisClickedEvent) +16 (int (*)(...))QWhatsThisClickedEvent::~QWhatsThisClickedEvent +24 (int (*)(...))QWhatsThisClickedEvent::~QWhatsThisClickedEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QWhatsThisClickedEvent::clone + +Class QWhatsThisClickedEvent + size=40 align=8 + base size=40 base align=8 +QWhatsThisClickedEvent (0x0x7319a9c1d2d8) 0 + vptr=((& QWhatsThisClickedEvent::_ZTV22QWhatsThisClickedEvent) + 16) +QEvent (0x0x7319a9c460c0) 0 + primary-for QWhatsThisClickedEvent (0x0x7319a9c1d2d8) + +Vtable for QActionEvent +QActionEvent::_ZTV12QActionEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QActionEvent) +16 (int (*)(...))QActionEvent::~QActionEvent +24 (int (*)(...))QActionEvent::~QActionEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QActionEvent::clone + +Class QActionEvent + size=32 align=8 + base size=32 base align=8 +QActionEvent (0x0x7319a9c1d340) 0 + vptr=((& QActionEvent::_ZTV12QActionEvent) + 16) +QEvent (0x0x7319a9c46180) 0 + primary-for QActionEvent (0x0x7319a9c1d340) + +Vtable for QFileOpenEvent +QFileOpenEvent::_ZTV14QFileOpenEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QFileOpenEvent) +16 (int (*)(...))QFileOpenEvent::~QFileOpenEvent +24 (int (*)(...))QFileOpenEvent::~QFileOpenEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QFileOpenEvent::clone + +Class QFileOpenEvent + size=48 align=8 + base size=48 base align=8 +QFileOpenEvent (0x0x7319a9c1d3a8) 0 + vptr=((& QFileOpenEvent::_ZTV14QFileOpenEvent) + 16) +QEvent (0x0x7319a9c462a0) 0 + primary-for QFileOpenEvent (0x0x7319a9c1d3a8) + +Vtable for QToolBarChangeEvent +QToolBarChangeEvent::_ZTV19QToolBarChangeEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QToolBarChangeEvent) +16 (int (*)(...))QToolBarChangeEvent::~QToolBarChangeEvent +24 (int (*)(...))QToolBarChangeEvent::~QToolBarChangeEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QToolBarChangeEvent::clone + +Class QToolBarChangeEvent + size=24 align=8 + base size=17 base align=8 +QToolBarChangeEvent (0x0x7319a9c1d410) 0 + vptr=((& QToolBarChangeEvent::_ZTV19QToolBarChangeEvent) + 16) +QEvent (0x0x7319a9c463c0) 0 + primary-for QToolBarChangeEvent (0x0x7319a9c1d410) + +Vtable for QShortcutEvent +QShortcutEvent::_ZTV14QShortcutEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QShortcutEvent) +16 (int (*)(...))QShortcutEvent::~QShortcutEvent +24 (int (*)(...))QShortcutEvent::~QShortcutEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QShortcutEvent::clone + +Class QShortcutEvent + size=32 align=8 + base size=29 base align=8 +QShortcutEvent (0x0x7319a9c1d478) 0 + vptr=((& QShortcutEvent::_ZTV14QShortcutEvent) + 16) +QEvent (0x0x7319a9c46480) 0 + primary-for QShortcutEvent (0x0x7319a9c1d478) + +Vtable for QWindowStateChangeEvent +QWindowStateChangeEvent::_ZTV23QWindowStateChangeEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI23QWindowStateChangeEvent) +16 (int (*)(...))QWindowStateChangeEvent::~QWindowStateChangeEvent +24 (int (*)(...))QWindowStateChangeEvent::~QWindowStateChangeEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QWindowStateChangeEvent::clone + +Class QWindowStateChangeEvent + size=24 align=8 + base size=21 base align=8 +QWindowStateChangeEvent (0x0x7319a9c1d4e0) 0 + vptr=((& QWindowStateChangeEvent::_ZTV23QWindowStateChangeEvent) + 16) +QEvent (0x0x7319a9c46600) 0 + primary-for QWindowStateChangeEvent (0x0x7319a9c1d4e0) + +Vtable for QTouchEvent +QTouchEvent::_ZTV11QTouchEvent: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QTouchEvent) +16 (int (*)(...))QTouchEvent::~QTouchEvent +24 (int (*)(...))QTouchEvent::~QTouchEvent +32 (int (*)(...))QPointerEvent::setAccepted +40 (int (*)(...))QTouchEvent::clone +48 (int (*)(...))QPointerEvent::setTimestamp +56 (int (*)(...))QTouchEvent::isBeginEvent +64 (int (*)(...))QTouchEvent::isUpdateEvent +72 (int (*)(...))QTouchEvent::isEndEvent + +Class QTouchEvent + size=80 align=8 + base size=79 base align=8 +QTouchEvent (0x0x7319a9c1d548) 0 + vptr=((& QTouchEvent::_ZTV11QTouchEvent) + 16) +QPointerEvent (0x0x7319a9c1d5b0) 0 + primary-for QTouchEvent (0x0x7319a9c1d548) +QInputEvent (0x0x7319a9c1d618) 0 + primary-for QPointerEvent (0x0x7319a9c1d5b0) +QEvent (0x0x7319a9c466c0) 0 + primary-for QInputEvent (0x0x7319a9c1d618) + +Vtable for QScrollPrepareEvent +QScrollPrepareEvent::_ZTV19QScrollPrepareEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QScrollPrepareEvent) +16 (int (*)(...))QScrollPrepareEvent::~QScrollPrepareEvent +24 (int (*)(...))QScrollPrepareEvent::~QScrollPrepareEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QScrollPrepareEvent::clone + +Class QScrollPrepareEvent + size=96 align=8 + base size=96 base align=8 +QScrollPrepareEvent (0x0x7319a9c1d680) 0 + vptr=((& QScrollPrepareEvent::_ZTV19QScrollPrepareEvent) + 16) +QEvent (0x0x7319a9c46840) 0 + primary-for QScrollPrepareEvent (0x0x7319a9c1d680) + +Vtable for QScrollEvent +QScrollEvent::_ZTV12QScrollEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QScrollEvent) +16 (int (*)(...))QScrollEvent::~QScrollEvent +24 (int (*)(...))QScrollEvent::~QScrollEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QScrollEvent::clone + +Class QScrollEvent + size=56 align=8 + base size=52 base align=8 +QScrollEvent (0x0x7319a9c1d6e8) 0 + vptr=((& QScrollEvent::_ZTV12QScrollEvent) + 16) +QEvent (0x0x7319a9c46a20) 0 + primary-for QScrollEvent (0x0x7319a9c1d6e8) + +Vtable for QScreenOrientationChangeEvent +QScreenOrientationChangeEvent::_ZTV29QScreenOrientationChangeEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI29QScreenOrientationChangeEvent) +16 (int (*)(...))QScreenOrientationChangeEvent::~QScreenOrientationChangeEvent +24 (int (*)(...))QScreenOrientationChangeEvent::~QScreenOrientationChangeEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QScreenOrientationChangeEvent::clone + +Class QScreenOrientationChangeEvent + size=32 align=8 + base size=28 base align=8 +QScreenOrientationChangeEvent (0x0x7319a9c1d750) 0 + vptr=((& QScreenOrientationChangeEvent::_ZTV29QScreenOrientationChangeEvent) + 16) +QEvent (0x0x7319a9c46ba0) 0 + primary-for QScreenOrientationChangeEvent (0x0x7319a9c1d750) + +Vtable for QApplicationStateChangeEvent +QApplicationStateChangeEvent::_ZTV28QApplicationStateChangeEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI28QApplicationStateChangeEvent) +16 (int (*)(...))QApplicationStateChangeEvent::~QApplicationStateChangeEvent +24 (int (*)(...))QApplicationStateChangeEvent::~QApplicationStateChangeEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QApplicationStateChangeEvent::clone + +Class QApplicationStateChangeEvent + size=24 align=8 + base size=20 base align=8 +QApplicationStateChangeEvent (0x0x7319a9c1d7b8) 0 + vptr=((& QApplicationStateChangeEvent::_ZTV28QApplicationStateChangeEvent) + 16) +QEvent (0x0x7319a9c46cc0) 0 + primary-for QApplicationStateChangeEvent (0x0x7319a9c1d7b8) + +Vtable for QChildWindowEvent +QChildWindowEvent::_ZTV17QChildWindowEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QChildWindowEvent) +16 (int (*)(...))QChildWindowEvent::~QChildWindowEvent +24 (int (*)(...))QChildWindowEvent::~QChildWindowEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QChildWindowEvent::clone + +Class QChildWindowEvent + size=24 align=8 + base size=24 base align=8 +QChildWindowEvent (0x0x7319a9c1d820) 0 + vptr=((& QChildWindowEvent::_ZTV17QChildWindowEvent) + 16) +QEvent (0x0x7319a9c46d80) 0 + primary-for QChildWindowEvent (0x0x7319a9c1d820) + +Class QFont::Tag + size=4 align=4 + base size=4 base align=4 +QFont::Tag (0x0x7319a9c46ea0) 0 + +Class QFont + size=16 align=8 + base size=12 base align=8 +QFont (0x0x7319a9c46e40) 0 + +Class QFontDatabase + size=1 align=1 + base size=0 base align=1 +QFontDatabase (0x0x7319a9ab3d20) 0 empty + +Class QRawFont + size=8 align=8 + base size=8 base align=8 +QRawFont (0x0x7319a9ab3f00) 0 + +Class QGlyphRun + size=8 align=8 + base size=8 base align=8 +QGlyphRun (0x0x7319a9b99780) 0 + +Vtable for QAbstractUndoItem +QAbstractUndoItem::_ZTV17QAbstractUndoItem: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QAbstractUndoItem) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual + +Class QAbstractUndoItem + size=8 align=8 + base size=8 base align=8 +QAbstractUndoItem (0x0x7319a988aa20) 0 nearly-empty + vptr=((& QAbstractUndoItem::_ZTV17QAbstractUndoItem) + 16) + +Class QTextDocument::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTextDocument::QPrivateSignal (0x0x7319a988aae0) 0 empty + +Vtable for QTextDocument +QTextDocument::_ZTV13QTextDocument: 17 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QTextDocument) +16 (int (*)(...))QTextDocument::metaObject +24 (int (*)(...))QTextDocument::qt_metacast +32 (int (*)(...))QTextDocument::qt_metacall +40 (int (*)(...))QTextDocument::~QTextDocument +48 (int (*)(...))QTextDocument::~QTextDocument +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QTextDocument::clear +120 (int (*)(...))QTextDocument::createObject +128 (int (*)(...))QTextDocument::loadResource + +Class QTextDocument + size=16 align=8 + base size=16 base align=8 +QTextDocument (0x0x7319a988df08) 0 + vptr=((& QTextDocument::_ZTV13QTextDocument) + 16) +QObject (0x0x7319a988aa80) 0 + primary-for QTextDocument (0x0x7319a988df08) + +Class QBrushDataPointerDeleter + size=1 align=1 + base size=0 base align=1 +QBrushDataPointerDeleter (0x0x7319a9918cc0) 0 empty + +Class QBrush + size=8 align=8 + base size=8 base align=8 +QBrush (0x0x7319a9918d20) 0 + +Class QBrushData + size=104 align=8 + base size=104 base align=8 +QBrushData (0x0x7319a9746d20) 0 + +Class QGradient::QGradientData + size=48 align=8 + base size=48 base align=8 +QGradient::QGradientData (0x0x7319a9746f60) 0 + +Class QGradient + size=88 align=8 + base size=88 base align=8 +QGradient (0x0x7319a9746f00) 0 + +Class QLinearGradient + size=88 align=8 + base size=88 base align=8 +QLinearGradient (0x0x7319a97c0068) 0 +QGradient (0x0x7319a9795c60) 0 + +Class QRadialGradient + size=88 align=8 + base size=88 base align=8 +QRadialGradient (0x0x7319a97c00d0) 0 +QGradient (0x0x7319a9795d80) 0 + +Class QConicalGradient + size=88 align=8 + base size=88 base align=8 +QConicalGradient (0x0x7319a97c0138) 0 +QGradient (0x0x7319a9795ea0) 0 + +Class QPen + size=8 align=8 + base size=8 base align=8 +QPen (0x0x7319a942d300) 0 + +Class QTextOption::Tab + size=16 align=8 + base size=14 base align=8 +QTextOption::Tab (0x0x7319a94dbba0) 0 + +Class QTextOption + size=24 align=8 + base size=24 base align=8 +QTextOption (0x0x7319a94dbb40) 0 + +Class QTextLength + size=16 align=8 + base size=16 base align=8 +QTextLength (0x0x7319a95b0180) 0 + +Class QTextFormat + size=16 align=8 + base size=12 base align=8 +QTextFormat (0x0x7319a9205360) 0 + +Class QTextCharFormat + size=16 align=8 + base size=12 base align=8 +QTextCharFormat (0x0x7319a934f340) 0 +QTextFormat (0x0x7319a933dba0) 0 + +Class QTextBlockFormat + size=16 align=8 + base size=12 base align=8 +QTextBlockFormat (0x0x7319a90a7478) 0 +QTextFormat (0x0x7319a908fe40) 0 + +Class QTextListFormat + size=16 align=8 + base size=12 base align=8 +QTextListFormat (0x0x7319a9106bc8) 0 +QTextFormat (0x0x7319a9100de0) 0 + +Class QTextImageFormat + size=16 align=8 + base size=12 base align=8 +QTextImageFormat (0x0x7319aaefb000) 0 +QTextCharFormat (0x0x7319aaefb2d8) 0 +QTextFormat (0x0x7319abf4a660) 0 + +Class QTextFrameFormat + size=16 align=8 + base size=12 base align=8 +QTextFrameFormat (0x0x7319b476d478) 0 +QTextFormat (0x0x7319bb4926c0) 0 + +Class QTextTableFormat + size=16 align=8 + base size=12 base align=8 +QTextTableFormat (0x0x7319b4623478) 0 +QTextFrameFormat (0x0x7319b4623750) 0 +QTextFormat (0x0x7319b2826360) 0 + +Class QTextTableCellFormat + size=16 align=8 + base size=12 base align=8 +QTextTableCellFormat (0x0x7319bb6a1dd0) 0 +QTextCharFormat (0x0x7319bb6a1f70) 0 +QTextFormat (0x0x7319b1aa3120) 0 + +Class QTextCursor + size=8 align=8 + base size=8 base align=8 +QTextCursor (0x0x7319b1502240) 0 + +Class QTextInlineObject + size=16 align=8 + base size=16 base align=8 +QTextInlineObject (0x0x7319b0f0dae0) 0 + +Class QTextLayout::FormatRange + size=24 align=8 + base size=24 base align=8 +QTextLayout::FormatRange (0x0x7319b0f38780) 0 + +Class QTextLayout + size=8 align=8 + base size=8 base align=8 +QTextLayout (0x0x7319b0f386c0) 0 + +Class QTextLine + size=16 align=8 + base size=16 base align=8 +QTextLine (0x0x7319b067ea80) 0 + +Class QPalette + size=16 align=8 + base size=12 base align=8 +QPalette (0x0x7319b07573c0) 0 + +Class QAbstractTextDocumentLayout::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAbstractTextDocumentLayout::QPrivateSignal (0x0x7319ae616180) 0 empty + +Class QAbstractTextDocumentLayout::Selection + size=24 align=8 + base size=24 base align=8 +QAbstractTextDocumentLayout::Selection (0x0x7319ae6161e0) 0 + +Class QAbstractTextDocumentLayout::PaintContext + size=80 align=8 + base size=80 base align=8 +QAbstractTextDocumentLayout::PaintContext (0x0x7319ae6162a0) 0 + +Vtable for QAbstractTextDocumentLayout +QAbstractTextDocumentLayout::_ZTV27QAbstractTextDocumentLayout: 24 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI27QAbstractTextDocumentLayout) +16 (int (*)(...))QAbstractTextDocumentLayout::metaObject +24 (int (*)(...))QAbstractTextDocumentLayout::qt_metacast +32 (int (*)(...))QAbstractTextDocumentLayout::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))__cxa_pure_virtual +160 (int (*)(...))__cxa_pure_virtual +168 (int (*)(...))QAbstractTextDocumentLayout::resizeInlineObject +176 (int (*)(...))QAbstractTextDocumentLayout::positionInlineObject +184 (int (*)(...))QAbstractTextDocumentLayout::drawInlineObject + +Class QAbstractTextDocumentLayout + size=16 align=8 + base size=16 base align=8 +QAbstractTextDocumentLayout (0x0x7319b09ce208) 0 + vptr=((& QAbstractTextDocumentLayout::_ZTV27QAbstractTextDocumentLayout) + 16) +QObject (0x0x7319ae616060) 0 + primary-for QAbstractTextDocumentLayout (0x0x7319b09ce208) + +Vtable for QTextObjectInterface +QTextObjectInterface::_ZTV20QTextObjectInterface: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QTextObjectInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual + +Class QTextObjectInterface + size=8 align=8 + base size=8 base align=8 +QTextObjectInterface (0x0x7319ab9e44e0) 0 nearly-empty + vptr=((& QTextObjectInterface::_ZTV20QTextObjectInterface) + 16) + +Class QAccessibilityHints::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAccessibilityHints::QPrivateSignal (0x0x7319ab63de40) 0 empty + +Vtable for QAccessibilityHints +QAccessibilityHints::_ZTV19QAccessibilityHints: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QAccessibilityHints) +16 (int (*)(...))QAccessibilityHints::metaObject +24 (int (*)(...))QAccessibilityHints::qt_metacast +32 (int (*)(...))QAccessibilityHints::qt_metacall +40 (int (*)(...))QAccessibilityHints::~QAccessibilityHints +48 (int (*)(...))QAccessibilityHints::~QAccessibilityHints +56 (int (*)(...))QAccessibilityHints::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QAccessibilityHints + size=16 align=8 + base size=16 base align=8 +QAccessibilityHints (0x0x7319af9939c0) 0 + vptr=((& QAccessibilityHints::_ZTV19QAccessibilityHints) + 16) +QObject (0x0x7319ab63dd80) 0 + primary-for QAccessibilityHints (0x0x7319af9939c0) + +Class QAccessible::State + size=8 align=8 + base size=8 base align=8 +QAccessible::State (0x0x7319ab68a660) 0 + +Vtable for QAccessible::ActivationObserver +QAccessible::ActivationObserver::_ZTVN11QAccessible18ActivationObserverE: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN11QAccessible18ActivationObserverE) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual + +Class QAccessible::ActivationObserver + size=8 align=8 + base size=8 base align=8 +QAccessible::ActivationObserver (0x0x7319ab68a6c0) 0 nearly-empty + vptr=((& QAccessible::ActivationObserver::_ZTVN11QAccessible18ActivationObserverE) + 16) + +Class QAccessible + size=1 align=1 + base size=0 base align=1 +QAccessible (0x0x7319ab664d20) 0 empty + +Vtable for QAccessibleInterface +QAccessibleInterface::_ZTV20QAccessibleInterface: 23 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QAccessibleInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))QAccessibleInterface::window +56 (int (*)(...))QAccessibleInterface::relations +64 (int (*)(...))QAccessibleInterface::focusChild +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))__cxa_pure_virtual +96 (int (*)(...))__cxa_pure_virtual +104 (int (*)(...))__cxa_pure_virtual +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))QAccessibleInterface::foregroundColor +160 (int (*)(...))QAccessibleInterface::backgroundColor +168 (int (*)(...))QAccessibleInterface::virtual_hook +176 (int (*)(...))QAccessibleInterface::interface_cast + +Class QAccessibleInterface + size=8 align=8 + base size=8 base align=8 +QAccessibleInterface (0x0x7319ab5b4000) 0 nearly-empty + vptr=((& QAccessibleInterface::_ZTV20QAccessibleInterface) + 16) + +Vtable for QAccessibleTextInterface +QAccessibleTextInterface::_ZTV24QAccessibleTextInterface: 20 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI24QAccessibleTextInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))__cxa_pure_virtual +96 (int (*)(...))QAccessibleTextInterface::textBeforeOffset +104 (int (*)(...))QAccessibleTextInterface::textAfterOffset +112 (int (*)(...))QAccessibleTextInterface::textAtOffset +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))__cxa_pure_virtual + +Class QAccessibleTextInterface + size=8 align=8 + base size=8 base align=8 +QAccessibleTextInterface (0x0x7319ab0ccba0) 0 nearly-empty + vptr=((& QAccessibleTextInterface::_ZTV24QAccessibleTextInterface) + 16) + +Vtable for QAccessibleEditableTextInterface +QAccessibleEditableTextInterface::_ZTV32QAccessibleEditableTextInterface: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI32QAccessibleEditableTextInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual + +Class QAccessibleEditableTextInterface + size=8 align=8 + base size=8 base align=8 +QAccessibleEditableTextInterface (0x0x7319ab1c4d80) 0 nearly-empty + vptr=((& QAccessibleEditableTextInterface::_ZTV32QAccessibleEditableTextInterface) + 16) + +Vtable for QAccessibleValueInterface +QAccessibleValueInterface::_ZTV25QAccessibleValueInterface: 9 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI25QAccessibleValueInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual + +Class QAccessibleValueInterface + size=8 align=8 + base size=8 base align=8 +QAccessibleValueInterface (0x0x7319aae83060) 0 nearly-empty + vptr=((& QAccessibleValueInterface::_ZTV25QAccessibleValueInterface) + 16) + +Vtable for QAccessibleTableCellInterface +QAccessibleTableCellInterface::_ZTV29QAccessibleTableCellInterface: 12 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI29QAccessibleTableCellInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))__cxa_pure_virtual + +Class QAccessibleTableCellInterface + size=8 align=8 + base size=8 base align=8 +QAccessibleTableCellInterface (0x0x7319aae830c0) 0 nearly-empty + vptr=((& QAccessibleTableCellInterface::_ZTV29QAccessibleTableCellInterface) + 16) + +Vtable for QAccessibleTableInterface +QAccessibleTableInterface::_ZTV25QAccessibleTableInterface: 24 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI25QAccessibleTableInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))__cxa_pure_virtual +96 (int (*)(...))__cxa_pure_virtual +104 (int (*)(...))__cxa_pure_virtual +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))__cxa_pure_virtual +160 (int (*)(...))__cxa_pure_virtual +168 (int (*)(...))__cxa_pure_virtual +176 (int (*)(...))__cxa_pure_virtual +184 (int (*)(...))__cxa_pure_virtual + +Class QAccessibleTableInterface + size=8 align=8 + base size=8 base align=8 +QAccessibleTableInterface (0x0x7319aae83d20) 0 nearly-empty + vptr=((& QAccessibleTableInterface::_ZTV25QAccessibleTableInterface) + 16) + +Vtable for QAccessibleActionInterface +QAccessibleActionInterface::_ZTV26QAccessibleActionInterface: 9 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI26QAccessibleActionInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))QAccessibleActionInterface::localizedActionName +48 (int (*)(...))QAccessibleActionInterface::localizedActionDescription +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual + +Class QAccessibleActionInterface + size=8 align=8 + base size=8 base align=8 +QAccessibleActionInterface (0x0x7319aae83d80) 0 nearly-empty + vptr=((& QAccessibleActionInterface::_ZTV26QAccessibleActionInterface) + 16) + +Vtable for QAccessibleImageInterface +QAccessibleImageInterface::_ZTV25QAccessibleImageInterface: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI25QAccessibleImageInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual + +Class QAccessibleImageInterface + size=8 align=8 + base size=8 base align=8 +QAccessibleImageInterface (0x0x7319aaed62a0) 0 nearly-empty + vptr=((& QAccessibleImageInterface::_ZTV25QAccessibleImageInterface) + 16) + +Vtable for QAccessibleHyperlinkInterface +QAccessibleHyperlinkInterface::_ZTV29QAccessibleHyperlinkInterface: 9 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI29QAccessibleHyperlinkInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual + +Class QAccessibleHyperlinkInterface + size=8 align=8 + base size=8 base align=8 +QAccessibleHyperlinkInterface (0x0x7319aaed6720) 0 nearly-empty + vptr=((& QAccessibleHyperlinkInterface::_ZTV29QAccessibleHyperlinkInterface) + 16) + +Vtable for QAccessibleSelectionInterface +QAccessibleSelectionInterface::_ZTV29QAccessibleSelectionInterface: 12 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI29QAccessibleSelectionInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))QAccessibleSelectionInterface::selectedItem +56 (int (*)(...))QAccessibleSelectionInterface::isSelected +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))__cxa_pure_virtual + +Class QAccessibleSelectionInterface + size=8 align=8 + base size=8 base align=8 +QAccessibleSelectionInterface (0x0x7319aaed6780) 0 nearly-empty + vptr=((& QAccessibleSelectionInterface::_ZTV29QAccessibleSelectionInterface) + 16) + +Vtable for QAccessibleAttributesInterface +QAccessibleAttributesInterface::_ZTV30QAccessibleAttributesInterface: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI30QAccessibleAttributesInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual + +Class QAccessibleAttributesInterface + size=8 align=8 + base size=8 base align=8 +QAccessibleAttributesInterface (0x0x7319aaed6f00) 0 nearly-empty + vptr=((& QAccessibleAttributesInterface::_ZTV30QAccessibleAttributesInterface) + 16) + +Vtable for QAccessibleEvent +QAccessibleEvent::_ZTV16QAccessibleEvent: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI16QAccessibleEvent) +16 (int (*)(...))QAccessibleEvent::~QAccessibleEvent +24 (int (*)(...))QAccessibleEvent::~QAccessibleEvent +32 (int (*)(...))QAccessibleEvent::accessibleInterface + +Class QAccessibleEvent + size=32 align=8 + base size=28 base align=8 +QAccessibleEvent (0x0x7319aaed6f60) 0 + vptr=((& QAccessibleEvent::_ZTV16QAccessibleEvent) + 16) + +Vtable for QAccessibleStateChangeEvent +QAccessibleStateChangeEvent::_ZTV27QAccessibleStateChangeEvent: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI27QAccessibleStateChangeEvent) +16 (int (*)(...))QAccessibleStateChangeEvent::~QAccessibleStateChangeEvent +24 (int (*)(...))QAccessibleStateChangeEvent::~QAccessibleStateChangeEvent +32 (int (*)(...))QAccessibleEvent::accessibleInterface + +Class QAccessibleStateChangeEvent + size=40 align=8 + base size=40 base align=8 +QAccessibleStateChangeEvent (0x0x7319af1748f0) 0 + vptr=((& QAccessibleStateChangeEvent::_ZTV27QAccessibleStateChangeEvent) + 16) +QAccessibleEvent (0x0x7319aaae2360) 0 + primary-for QAccessibleStateChangeEvent (0x0x7319af1748f0) + +Vtable for QAccessibleTextCursorEvent +QAccessibleTextCursorEvent::_ZTV26QAccessibleTextCursorEvent: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI26QAccessibleTextCursorEvent) +16 (int (*)(...))QAccessibleTextCursorEvent::~QAccessibleTextCursorEvent +24 (int (*)(...))QAccessibleTextCursorEvent::~QAccessibleTextCursorEvent +32 (int (*)(...))QAccessibleEvent::accessibleInterface + +Class QAccessibleTextCursorEvent + size=32 align=8 + base size=32 base align=8 +QAccessibleTextCursorEvent (0x0x7319aef73000) 0 + vptr=((& QAccessibleTextCursorEvent::_ZTV26QAccessibleTextCursorEvent) + 16) +QAccessibleEvent (0x0x7319aab51c00) 0 + primary-for QAccessibleTextCursorEvent (0x0x7319aef73000) + +Vtable for QAccessibleTextSelectionEvent +QAccessibleTextSelectionEvent::_ZTV29QAccessibleTextSelectionEvent: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI29QAccessibleTextSelectionEvent) +16 (int (*)(...))QAccessibleTextSelectionEvent::~QAccessibleTextSelectionEvent +24 (int (*)(...))QAccessibleTextSelectionEvent::~QAccessibleTextSelectionEvent +32 (int (*)(...))QAccessibleEvent::accessibleInterface + +Class QAccessibleTextSelectionEvent + size=40 align=8 + base size=40 base align=8 +QAccessibleTextSelectionEvent (0x0x7319aef73a90) 0 + vptr=((& QAccessibleTextSelectionEvent::_ZTV29QAccessibleTextSelectionEvent) + 16) +QAccessibleTextCursorEvent (0x0x7319aef73af8) 0 + primary-for QAccessibleTextSelectionEvent (0x0x7319aef73a90) +QAccessibleEvent (0x0x7319aa89e4e0) 0 + primary-for QAccessibleTextCursorEvent (0x0x7319aef73af8) + +Vtable for QAccessibleTextInsertEvent +QAccessibleTextInsertEvent::_ZTV26QAccessibleTextInsertEvent: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI26QAccessibleTextInsertEvent) +16 (int (*)(...))QAccessibleTextInsertEvent::~QAccessibleTextInsertEvent +24 (int (*)(...))QAccessibleTextInsertEvent::~QAccessibleTextInsertEvent +32 (int (*)(...))QAccessibleEvent::accessibleInterface + +Class QAccessibleTextInsertEvent + size=64 align=8 + base size=64 base align=8 +QAccessibleTextInsertEvent (0x0x7319aef73dd0) 0 + vptr=((& QAccessibleTextInsertEvent::_ZTV26QAccessibleTextInsertEvent) + 16) +QAccessibleTextCursorEvent (0x0x7319aefaf0d0) 0 + primary-for QAccessibleTextInsertEvent (0x0x7319aef73dd0) +QAccessibleEvent (0x0x7319aa9f51e0) 0 + primary-for QAccessibleTextCursorEvent (0x0x7319aefaf0d0) + +Vtable for QAccessibleTextRemoveEvent +QAccessibleTextRemoveEvent::_ZTV26QAccessibleTextRemoveEvent: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI26QAccessibleTextRemoveEvent) +16 (int (*)(...))QAccessibleTextRemoveEvent::~QAccessibleTextRemoveEvent +24 (int (*)(...))QAccessibleTextRemoveEvent::~QAccessibleTextRemoveEvent +32 (int (*)(...))QAccessibleEvent::accessibleInterface + +Class QAccessibleTextRemoveEvent + size=64 align=8 + base size=64 base align=8 +QAccessibleTextRemoveEvent (0x0x7319aefaf138) 0 + vptr=((& QAccessibleTextRemoveEvent::_ZTV26QAccessibleTextRemoveEvent) + 16) +QAccessibleTextCursorEvent (0x0x7319aefaff70) 0 + primary-for QAccessibleTextRemoveEvent (0x0x7319aefaf138) +QAccessibleEvent (0x0x7319aa6e5360) 0 + primary-for QAccessibleTextCursorEvent (0x0x7319aefaff70) + +Vtable for QAccessibleTextUpdateEvent +QAccessibleTextUpdateEvent::_ZTV26QAccessibleTextUpdateEvent: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI26QAccessibleTextUpdateEvent) +16 (int (*)(...))QAccessibleTextUpdateEvent::~QAccessibleTextUpdateEvent +24 (int (*)(...))QAccessibleTextUpdateEvent::~QAccessibleTextUpdateEvent +32 (int (*)(...))QAccessibleEvent::accessibleInterface + +Class QAccessibleTextUpdateEvent + size=88 align=8 + base size=88 base align=8 +QAccessibleTextUpdateEvent (0x0x7319aefc9000) 0 + vptr=((& QAccessibleTextUpdateEvent::_ZTV26QAccessibleTextUpdateEvent) + 16) +QAccessibleTextCursorEvent (0x0x7319aefc9138) 0 + primary-for QAccessibleTextUpdateEvent (0x0x7319aefc9000) +QAccessibleEvent (0x0x7319aa772480) 0 + primary-for QAccessibleTextCursorEvent (0x0x7319aefc9138) + +Vtable for QAccessibleValueChangeEvent +QAccessibleValueChangeEvent::_ZTV27QAccessibleValueChangeEvent: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI27QAccessibleValueChangeEvent) +16 (int (*)(...))QAccessibleValueChangeEvent::~QAccessibleValueChangeEvent +24 (int (*)(...))QAccessibleValueChangeEvent::~QAccessibleValueChangeEvent +32 (int (*)(...))QAccessibleEvent::accessibleInterface + +Class QAccessibleValueChangeEvent + size=64 align=8 + base size=64 base align=8 +QAccessibleValueChangeEvent (0x0x7319aefc97b8) 0 + vptr=((& QAccessibleValueChangeEvent::_ZTV27QAccessibleValueChangeEvent) + 16) +QAccessibleEvent (0x0x7319aa0201e0) 0 + primary-for QAccessibleValueChangeEvent (0x0x7319aefc97b8) + +Vtable for QAccessibleTableModelChangeEvent +QAccessibleTableModelChangeEvent::_ZTV32QAccessibleTableModelChangeEvent: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI32QAccessibleTableModelChangeEvent) +16 (int (*)(...))QAccessibleTableModelChangeEvent::~QAccessibleTableModelChangeEvent +24 (int (*)(...))QAccessibleTableModelChangeEvent::~QAccessibleTableModelChangeEvent +32 (int (*)(...))QAccessibleEvent::accessibleInterface + +Class QAccessibleTableModelChangeEvent + size=48 align=8 + base size=48 base align=8 +QAccessibleTableModelChangeEvent (0x0x7319aefc9820) 0 + vptr=((& QAccessibleTableModelChangeEvent::_ZTV32QAccessibleTableModelChangeEvent) + 16) +QAccessibleEvent (0x0x7319aa0ad000) 0 + primary-for QAccessibleTableModelChangeEvent (0x0x7319aefc9820) + +Vtable for QAccessibleAnnouncementEvent +QAccessibleAnnouncementEvent::_ZTV28QAccessibleAnnouncementEvent: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI28QAccessibleAnnouncementEvent) +16 (int (*)(...))QAccessibleAnnouncementEvent::~QAccessibleAnnouncementEvent +24 (int (*)(...))QAccessibleAnnouncementEvent::~QAccessibleAnnouncementEvent +32 (int (*)(...))QAccessibleEvent::accessibleInterface + +Class QAccessibleAnnouncementEvent + size=64 align=8 + base size=60 base align=8 +QAccessibleAnnouncementEvent (0x0x7319aefc9888) 0 + vptr=((& QAccessibleAnnouncementEvent::_ZTV28QAccessibleAnnouncementEvent) + 16) +QAccessibleEvent (0x0x7319a9da73c0) 0 + primary-for QAccessibleAnnouncementEvent (0x0x7319aefc9888) + +Vtable for QAccessibleBridge +QAccessibleBridge::_ZTV17QAccessibleBridge: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QAccessibleBridge) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual + +Class QAccessibleBridge + size=8 align=8 + base size=8 base align=8 +QAccessibleBridge (0x0x7319a9b768a0) 0 nearly-empty + vptr=((& QAccessibleBridge::_ZTV17QAccessibleBridge) + 16) + +Class QAccessibleBridgePlugin::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAccessibleBridgePlugin::QPrivateSignal (0x0x7319a986a360) 0 empty + +Vtable for QAccessibleBridgePlugin +QAccessibleBridgePlugin::_ZTV23QAccessibleBridgePlugin: 15 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI23QAccessibleBridgePlugin) +16 (int (*)(...))QAccessibleBridgePlugin::metaObject +24 (int (*)(...))QAccessibleBridgePlugin::qt_metacast +32 (int (*)(...))QAccessibleBridgePlugin::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual + +Class QAccessibleBridgePlugin + size=16 align=8 + base size=16 base align=8 +QAccessibleBridgePlugin (0x0x7319aefc9bc8) 0 + vptr=((& QAccessibleBridgePlugin::_ZTV23QAccessibleBridgePlugin) + 16) +QObject (0x0x7319a986a300) 0 + primary-for QAccessibleBridgePlugin (0x0x7319aefc9bc8) + +Vtable for QAccessibleObject +QAccessibleObject::_ZTV17QAccessibleObject: 23 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QAccessibleObject) +16 0 +24 0 +32 (int (*)(...))QAccessibleObject::isValid +40 (int (*)(...))QAccessibleObject::object +48 (int (*)(...))QAccessibleInterface::window +56 (int (*)(...))QAccessibleInterface::relations +64 (int (*)(...))QAccessibleInterface::focusChild +72 (int (*)(...))QAccessibleObject::childAt +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))__cxa_pure_virtual +96 (int (*)(...))__cxa_pure_virtual +104 (int (*)(...))__cxa_pure_virtual +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))QAccessibleObject::setText +128 (int (*)(...))QAccessibleObject::rect +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))QAccessibleInterface::foregroundColor +160 (int (*)(...))QAccessibleInterface::backgroundColor +168 (int (*)(...))QAccessibleInterface::virtual_hook +176 (int (*)(...))QAccessibleInterface::interface_cast + +Class QAccessibleObject + size=16 align=8 + base size=16 base align=8 +QAccessibleObject (0x0x7319aefc9c30) 0 + vptr=((& QAccessibleObject::_ZTV17QAccessibleObject) + 16) +QAccessibleInterface (0x0x7319a986a4e0) 0 nearly-empty + primary-for QAccessibleObject (0x0x7319aefc9c30) + +Vtable for QAccessibleApplication +QAccessibleApplication::_ZTV22QAccessibleApplication: 23 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI22QAccessibleApplication) +16 (int (*)(...))QAccessibleApplication::~QAccessibleApplication +24 (int (*)(...))QAccessibleApplication::~QAccessibleApplication +32 (int (*)(...))QAccessibleObject::isValid +40 (int (*)(...))QAccessibleObject::object +48 (int (*)(...))QAccessibleApplication::window +56 (int (*)(...))QAccessibleInterface::relations +64 (int (*)(...))QAccessibleApplication::focusChild +72 (int (*)(...))QAccessibleObject::childAt +80 (int (*)(...))QAccessibleApplication::parent +88 (int (*)(...))QAccessibleApplication::child +96 (int (*)(...))QAccessibleApplication::childCount +104 (int (*)(...))QAccessibleApplication::indexOfChild +112 (int (*)(...))QAccessibleApplication::text +120 (int (*)(...))QAccessibleObject::setText +128 (int (*)(...))QAccessibleObject::rect +136 (int (*)(...))QAccessibleApplication::role +144 (int (*)(...))QAccessibleApplication::state +152 (int (*)(...))QAccessibleInterface::foregroundColor +160 (int (*)(...))QAccessibleInterface::backgroundColor +168 (int (*)(...))QAccessibleInterface::virtual_hook +176 (int (*)(...))QAccessibleInterface::interface_cast + +Class QAccessibleApplication + size=16 align=8 + base size=16 base align=8 +QAccessibleApplication (0x0x7319aec576e8) 0 + vptr=((& QAccessibleApplication::_ZTV22QAccessibleApplication) + 16) +QAccessibleObject (0x0x7319aec57750) 0 + primary-for QAccessibleApplication (0x0x7319aec576e8) +QAccessibleInterface (0x0x7319a986aae0) 0 nearly-empty + primary-for QAccessibleObject (0x0x7319aec57750) + +Class QAccessiblePlugin::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAccessiblePlugin::QPrivateSignal (0x0x7319a988a0c0) 0 empty + +Vtable for QAccessiblePlugin +QAccessiblePlugin::_ZTV17QAccessiblePlugin: 15 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QAccessiblePlugin) +16 (int (*)(...))QAccessiblePlugin::metaObject +24 (int (*)(...))QAccessiblePlugin::qt_metacast +32 (int (*)(...))QAccessiblePlugin::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual + +Class QAccessiblePlugin + size=16 align=8 + base size=16 base align=8 +QAccessiblePlugin (0x0x7319aec57a28) 0 + vptr=((& QAccessiblePlugin::_ZTV17QAccessiblePlugin) + 16) +QObject (0x0x7319a986ab40) 0 + primary-for QAccessiblePlugin (0x0x7319aec57a28) + +Class QAction::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAction::QPrivateSignal (0x0x7319a99ef4e0) 0 empty + +Vtable for QAction +QAction::_ZTV7QAction: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI7QAction) +16 (int (*)(...))QAction::metaObject +24 (int (*)(...))QAction::qt_metacast +32 (int (*)(...))QAction::qt_metacall +40 (int (*)(...))QAction::~QAction +48 (int (*)(...))QAction::~QAction +56 (int (*)(...))QAction::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QAction + size=16 align=8 + base size=16 base align=8 +QAction (0x0x7319aec57d00) 0 + vptr=((& QAction::_ZTV7QAction) + 16) +QObject (0x0x7319a99ef480) 0 + primary-for QAction (0x0x7319aec57d00) + +Class QActionGroup::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QActionGroup::QPrivateSignal (0x0x7319a9580840) 0 empty + +Vtable for QActionGroup +QActionGroup::_ZTV12QActionGroup: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QActionGroup) +16 (int (*)(...))QActionGroup::metaObject +24 (int (*)(...))QActionGroup::qt_metacast +32 (int (*)(...))QActionGroup::qt_metacall +40 (int (*)(...))QActionGroup::~QActionGroup +48 (int (*)(...))QActionGroup::~QActionGroup +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QActionGroup + size=16 align=8 + base size=16 base align=8 +QActionGroup (0x0x7319aec57d68) 0 + vptr=((& QActionGroup::_ZTV12QActionGroup) + 16) +QObject (0x0x7319a9580780) 0 + primary-for QActionGroup (0x0x7319aec57d68) + +Class QSurfaceFormat + size=8 align=8 + base size=8 base align=8 +QSurfaceFormat (0x0x7319a95b0cc0) 0 + +Vtable for QSurface +QSurface::_ZTV8QSurface: 8 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI8QSurface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual + +Class QSurface + size=24 align=8 + base size=24 base align=8 +QSurface (0x0x7319a90745a0) 0 + vptr=((& QSurface::_ZTV8QSurface) + 16) + +Vtable for QBitmap +QBitmap::_ZTV7QBitmap: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI7QBitmap) +16 (int (*)(...))QBitmap::~QBitmap +24 (int (*)(...))QBitmap::~QBitmap +32 (int (*)(...))QPixmap::devType +40 (int (*)(...))QPixmap::paintEngine +48 (int (*)(...))QPixmap::metric +56 (int (*)(...))QPaintDevice::initPainter +64 (int (*)(...))QPaintDevice::redirected +72 (int (*)(...))QPaintDevice::sharedPainter + +Class QBitmap + size=24 align=8 + base size=24 base align=8 +QBitmap (0x0x7319ae857f08) 0 + vptr=((& QBitmap::_ZTV7QBitmap) + 16) +QPixmap (0x0x7319ae95a138) 0 + primary-for QBitmap (0x0x7319ae857f08) +QPaintDevice (0x0x7319a914da80) 0 + primary-for QPixmap (0x0x7319ae95a138) + +Class QCursor + size=8 align=8 + base size=8 base align=8 +QCursor (0x0x7319a9a18420) 0 + +Class QWindow::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QWindow::QPrivateSignal (0x0x7319aa792780) 0 empty + +Vtable for QWindow +QWindow::_ZTV7QWindow: 47 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI7QWindow) +16 (int (*)(...))QWindow::metaObject +24 (int (*)(...))QWindow::qt_metacast +32 (int (*)(...))QWindow::qt_metacall +40 (int (*)(...))QWindow::~QWindow +48 (int (*)(...))QWindow::~QWindow +56 (int (*)(...))QWindow::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWindow::surfaceType +120 (int (*)(...))QWindow::format +128 (int (*)(...))QWindow::size +136 (int (*)(...))QWindow::accessibleRoot +144 (int (*)(...))QWindow::focusObject +152 (int (*)(...))QWindow::exposeEvent +160 (int (*)(...))QWindow::resizeEvent +168 (int (*)(...))QWindow::paintEvent +176 (int (*)(...))QWindow::moveEvent +184 (int (*)(...))QWindow::focusInEvent +192 (int (*)(...))QWindow::focusOutEvent +200 (int (*)(...))QWindow::showEvent +208 (int (*)(...))QWindow::hideEvent +216 (int (*)(...))QWindow::closeEvent +224 (int (*)(...))QWindow::keyPressEvent +232 (int (*)(...))QWindow::keyReleaseEvent +240 (int (*)(...))QWindow::mousePressEvent +248 (int (*)(...))QWindow::mouseReleaseEvent +256 (int (*)(...))QWindow::mouseDoubleClickEvent +264 (int (*)(...))QWindow::mouseMoveEvent +272 (int (*)(...))QWindow::wheelEvent +280 (int (*)(...))QWindow::touchEvent +288 (int (*)(...))QWindow::tabletEvent +296 (int (*)(...))QWindow::nativeEvent +304 (int (*)(...))QWindow::surfaceHandle +312 (int (*)(...))-16 +320 (int (*)(...))(& _ZTI7QWindow) +328 (int (*)(...))QWindow::_ZThn16_N7QWindowD1Ev +336 (int (*)(...))QWindow::_ZThn16_N7QWindowD0Ev +344 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv +352 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv +360 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv +368 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv + +Class QWindow + size=40 align=8 + base size=40 base align=8 +QWindow (0x0x7319aeb72770) 0 + vptr=((& QWindow::_ZTV7QWindow) + 16) +QObject (0x0x7319aa7926c0) 0 + primary-for QWindow (0x0x7319aeb72770) +QSurface (0x0x7319aa792720) 16 + vptr=((& QWindow::_ZTV7QWindow) + 328) + +Class QBackingStore + size=8 align=8 + base size=8 base align=8 +QBackingStore (0x0x7319afa53060) 0 + +Class QClipboard::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QClipboard::QPrivateSignal (0x0x7319afa53180) 0 empty + +Vtable for QClipboard +QClipboard::_ZTV10QClipboard: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QClipboard) +16 (int (*)(...))QClipboard::metaObject +24 (int (*)(...))QClipboard::qt_metacast +32 (int (*)(...))QClipboard::qt_metacall +40 (int (*)(...))QClipboard::~QClipboard +48 (int (*)(...))QClipboard::~QClipboard +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QClipboard + size=16 align=8 + base size=16 base align=8 +QClipboard (0x0x7319ab89ad00) 0 + vptr=((& QClipboard::_ZTV10QClipboard) + 16) +QObject (0x0x7319afa53120) 0 + primary-for QClipboard (0x0x7319ab89ad00) + +Class QColorTransform + size=8 align=8 + base size=8 base align=8 +QColorTransform (0x0x7319afa53660) 0 + +Class QColorSpace::PrimaryPoints + size=64 align=8 + base size=64 base align=8 +QColorSpace::PrimaryPoints (0x0x7319b0dac0c0) 0 + +Class QColorSpace + size=8 align=8 + base size=8 base align=8 +QColorSpace (0x0x7319b0dac060) 0 + +Class QDesktopServices + size=1 align=1 + base size=0 base align=1 +QDesktopServices (0x0x7319b098a5a0) 0 empty + +Class QDrag::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDrag::QPrivateSignal (0x0x7319b098a660) 0 empty + +Vtable for QDrag +QDrag::_ZTV5QDrag: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI5QDrag) +16 (int (*)(...))QDrag::metaObject +24 (int (*)(...))QDrag::qt_metacast +32 (int (*)(...))QDrag::qt_metacall +40 (int (*)(...))QDrag::~QDrag +48 (int (*)(...))QDrag::~QDrag +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QDrag + size=16 align=8 + base size=16 base align=8 +QDrag (0x0x7319aa8cc680) 0 + vptr=((& QDrag::_ZTV5QDrag) + 16) +QObject (0x0x7319b098a600) 0 + primary-for QDrag (0x0x7319aa8cc680) + +Class QFileSystemModel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QFileSystemModel::QPrivateSignal (0x0x7319b098a840) 0 empty + +Vtable for QFileSystemModel +QFileSystemModel::_ZTV16QFileSystemModel: 51 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI16QFileSystemModel) +16 (int (*)(...))QFileSystemModel::metaObject +24 (int (*)(...))QFileSystemModel::qt_metacast +32 (int (*)(...))QFileSystemModel::qt_metacall +40 (int (*)(...))QFileSystemModel::~QFileSystemModel +48 (int (*)(...))QFileSystemModel::~QFileSystemModel +56 (int (*)(...))QFileSystemModel::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QFileSystemModel::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QFileSystemModel::index +120 (int (*)(...))QFileSystemModel::parent +128 (int (*)(...))QFileSystemModel::sibling +136 (int (*)(...))QFileSystemModel::rowCount +144 (int (*)(...))QFileSystemModel::columnCount +152 (int (*)(...))QFileSystemModel::hasChildren +160 (int (*)(...))QFileSystemModel::data +168 (int (*)(...))QFileSystemModel::setData +176 (int (*)(...))QFileSystemModel::headerData +184 (int (*)(...))QAbstractItemModel::setHeaderData +192 (int (*)(...))QAbstractItemModel::itemData +200 (int (*)(...))QAbstractItemModel::setItemData +208 (int (*)(...))QAbstractItemModel::clearItemData +216 (int (*)(...))QFileSystemModel::mimeTypes +224 (int (*)(...))QFileSystemModel::mimeData +232 (int (*)(...))QAbstractItemModel::canDropMimeData +240 (int (*)(...))QFileSystemModel::dropMimeData +248 (int (*)(...))QFileSystemModel::supportedDropActions +256 (int (*)(...))QAbstractItemModel::supportedDragActions +264 (int (*)(...))QAbstractItemModel::insertRows +272 (int (*)(...))QAbstractItemModel::insertColumns +280 (int (*)(...))QAbstractItemModel::removeRows +288 (int (*)(...))QAbstractItemModel::removeColumns +296 (int (*)(...))QAbstractItemModel::moveRows +304 (int (*)(...))QAbstractItemModel::moveColumns +312 (int (*)(...))QFileSystemModel::fetchMore +320 (int (*)(...))QFileSystemModel::canFetchMore +328 (int (*)(...))QFileSystemModel::flags +336 (int (*)(...))QFileSystemModel::sort +344 (int (*)(...))QAbstractItemModel::buddy +352 (int (*)(...))QAbstractItemModel::match +360 (int (*)(...))QAbstractItemModel::span +368 (int (*)(...))QFileSystemModel::roleNames +376 (int (*)(...))QAbstractItemModel::multiData +384 (int (*)(...))QAbstractItemModel::submit +392 (int (*)(...))QAbstractItemModel::revert +400 (int (*)(...))QAbstractItemModel::resetInternalData + +Class QFileSystemModel + size=16 align=8 + base size=16 base align=8 +QFileSystemModel (0x0x7319aa8cc8f0) 0 + vptr=((& QFileSystemModel::_ZTV16QFileSystemModel) + 16) +QAbstractItemModel (0x0x7319aa8ccbc8) 0 + primary-for QFileSystemModel (0x0x7319aa8cc8f0) +QObject (0x0x7319b098a7e0) 0 + primary-for QAbstractItemModel (0x0x7319aa8ccbc8) + +Class QFontVariableAxis + size=8 align=8 + base size=8 base align=8 +QFontVariableAxis (0x0x7319aef34060) 0 + +Class QFontInfo + size=8 align=8 + base size=8 base align=8 +QFontInfo (0x0x7319aecd13c0) 0 + +Class QFontMetrics + size=8 align=8 + base size=8 base align=8 +QFontMetrics (0x0x7319aea262a0) 0 + +Class QFontMetricsF + size=8 align=8 + base size=8 base align=8 +QFontMetricsF (0x0x7319ae80f2a0) 0 + +Class QGenericPlugin::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGenericPlugin::QPrivateSignal (0x0x7319aac93f60) 0 empty + +Vtable for QGenericPlugin +QGenericPlugin::_ZTV14QGenericPlugin: 15 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QGenericPlugin) +16 (int (*)(...))QGenericPlugin::metaObject +24 (int (*)(...))QGenericPlugin::qt_metacast +32 (int (*)(...))QGenericPlugin::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual + +Class QGenericPlugin + size=16 align=8 + base size=16 base align=8 +QGenericPlugin (0x0x7319aacab548) 0 + vptr=((& QGenericPlugin::_ZTV14QGenericPlugin) + 16) +QObject (0x0x7319aac93f00) 0 + primary-for QGenericPlugin (0x0x7319aacab548) + +Class QGenericPluginFactory + size=1 align=1 + base size=0 base align=1 +QGenericPluginFactory (0x0x7319aacbc060) 0 empty + +Class QIconEngine::ScaledPixmapArgument + size=48 align=8 + base size=48 base align=8 +QIconEngine::ScaledPixmapArgument (0x0x7319aacbc120) 0 + +Vtable for QIconEngine +QIconEngine::_ZTV11QIconEngine: 18 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QIconEngine) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))QIconEngine::actualSize +48 (int (*)(...))QIconEngine::pixmap +56 (int (*)(...))QIconEngine::addPixmap +64 (int (*)(...))QIconEngine::addFile +72 (int (*)(...))QIconEngine::key +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))QIconEngine::read +96 (int (*)(...))QIconEngine::write +104 (int (*)(...))QIconEngine::availableSizes +112 (int (*)(...))QIconEngine::iconName +120 (int (*)(...))QIconEngine::isNull +128 (int (*)(...))QIconEngine::scaledPixmap +136 (int (*)(...))QIconEngine::virtual_hook + +Class QIconEngine + size=8 align=8 + base size=8 base align=8 +QIconEngine (0x0x7319aacbc0c0) 0 nearly-empty + vptr=((& QIconEngine::_ZTV11QIconEngine) + 16) + +Class QIconEnginePlugin::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QIconEnginePlugin::QPrivateSignal (0x0x7319aacbc1e0) 0 empty + +Vtable for QIconEnginePlugin +QIconEnginePlugin::_ZTV17QIconEnginePlugin: 15 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QIconEnginePlugin) +16 (int (*)(...))QIconEnginePlugin::metaObject +24 (int (*)(...))QIconEnginePlugin::qt_metacast +32 (int (*)(...))QIconEnginePlugin::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual + +Class QIconEnginePlugin + size=16 align=8 + base size=16 base align=8 +QIconEnginePlugin (0x0x7319aacab5b0) 0 + vptr=((& QIconEnginePlugin::_ZTV17QIconEnginePlugin) + 16) +QObject (0x0x7319aacbc180) 0 + primary-for QIconEnginePlugin (0x0x7319aacab5b0) + +Vtable for QImageIOHandler +QImageIOHandler::_ZTV15QImageIOHandler: 17 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QImageIOHandler) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))QImageIOHandler::write +56 (int (*)(...))QImageIOHandler::option +64 (int (*)(...))QImageIOHandler::setOption +72 (int (*)(...))QImageIOHandler::supportsOption +80 (int (*)(...))QImageIOHandler::jumpToNextImage +88 (int (*)(...))QImageIOHandler::jumpToImage +96 (int (*)(...))QImageIOHandler::loopCount +104 (int (*)(...))QImageIOHandler::imageCount +112 (int (*)(...))QImageIOHandler::nextImageDelay +120 (int (*)(...))QImageIOHandler::currentImageNumber +128 (int (*)(...))QImageIOHandler::currentImageRect + +Class QImageIOHandler + size=16 align=8 + base size=16 base align=8 +QImageIOHandler (0x0x7319aacbc2a0) 0 + vptr=((& QImageIOHandler::_ZTV15QImageIOHandler) + 16) + +Class QImageIOPlugin::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QImageIOPlugin::QPrivateSignal (0x0x7319aacbc4e0) 0 empty + +Vtable for QImageIOPlugin +QImageIOPlugin::_ZTV14QImageIOPlugin: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QImageIOPlugin) +16 (int (*)(...))QImageIOPlugin::metaObject +24 (int (*)(...))QImageIOPlugin::qt_metacast +32 (int (*)(...))QImageIOPlugin::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual + +Class QImageIOPlugin + size=16 align=8 + base size=16 base align=8 +QImageIOPlugin (0x0x7319aacab618) 0 + vptr=((& QImageIOPlugin::_ZTV14QImageIOPlugin) + 16) +QObject (0x0x7319aacbc480) 0 + primary-for QImageIOPlugin (0x0x7319aacab618) + +Class QImageReader + size=8 align=8 + base size=8 base align=8 +QImageReader (0x0x7319aacbcae0) 0 + +Class QImageWriter + size=8 align=8 + base size=8 base align=8 +QImageWriter (0x0x7319aacbcba0) 0 + +Class QMatrix4x4 + size=68 align=4 + base size=68 base align=4 +QMatrix4x4 (0x0x7319aacbcc60) 0 + +Class QMovie::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QMovie::QPrivateSignal (0x0x7319aa498300) 0 empty + +Vtable for QMovie +QMovie::_ZTV6QMovie: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI6QMovie) +16 (int (*)(...))QMovie::metaObject +24 (int (*)(...))QMovie::qt_metacast +32 (int (*)(...))QMovie::qt_metacall +40 (int (*)(...))QMovie::~QMovie +48 (int (*)(...))QMovie::~QMovie +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QMovie + size=16 align=8 + base size=16 base align=8 +QMovie (0x0x7319aa79e478) 0 + vptr=((& QMovie::_ZTV6QMovie) + 16) +QObject (0x0x7319aa4982a0) 0 + primary-for QMovie (0x0x7319aa79e478) + +Class QOffscreenSurface::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QOffscreenSurface::QPrivateSignal (0x0x7319aa4986c0) 0 empty + +Vtable for QOffscreenSurface +QOffscreenSurface::_ZTV17QOffscreenSurface: 26 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QOffscreenSurface) +16 (int (*)(...))QOffscreenSurface::metaObject +24 (int (*)(...))QOffscreenSurface::qt_metacast +32 (int (*)(...))QOffscreenSurface::qt_metacall +40 (int (*)(...))QOffscreenSurface::~QOffscreenSurface +48 (int (*)(...))QOffscreenSurface::~QOffscreenSurface +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QOffscreenSurface::surfaceType +120 (int (*)(...))QOffscreenSurface::format +128 (int (*)(...))QOffscreenSurface::size +136 (int (*)(...))QOffscreenSurface::surfaceHandle +144 (int (*)(...))-16 +152 (int (*)(...))(& _ZTI17QOffscreenSurface) +160 (int (*)(...))QOffscreenSurface::_ZThn16_N17QOffscreenSurfaceD1Ev +168 (int (*)(...))QOffscreenSurface::_ZThn16_N17QOffscreenSurfaceD0Ev +176 (int (*)(...))QOffscreenSurface::_ZThn16_NK17QOffscreenSurface6formatEv +184 (int (*)(...))QOffscreenSurface::_ZThn16_NK17QOffscreenSurface13surfaceHandleEv +192 (int (*)(...))QOffscreenSurface::_ZThn16_NK17QOffscreenSurface11surfaceTypeEv +200 (int (*)(...))QOffscreenSurface::_ZThn16_NK17QOffscreenSurface4sizeEv + +Class QOffscreenSurface + size=40 align=8 + base size=40 base align=8 +QOffscreenSurface (0x0x7319aa4a07e0) 0 + vptr=((& QOffscreenSurface::_ZTV17QOffscreenSurface) + 16) +QObject (0x0x7319aa498600) 0 + primary-for QOffscreenSurface (0x0x7319aa4a07e0) +QSurface (0x0x7319aa498660) 16 + vptr=((& QOffscreenSurface::_ZTV17QOffscreenSurface) + 160) + +Class QOpenGLContextGroup::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QOpenGLContextGroup::QPrivateSignal (0x0x7319aa498960) 0 empty + +Vtable for QOpenGLContextGroup +QOpenGLContextGroup::_ZTV19QOpenGLContextGroup: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QOpenGLContextGroup) +16 (int (*)(...))QOpenGLContextGroup::metaObject +24 (int (*)(...))QOpenGLContextGroup::qt_metacast +32 (int (*)(...))QOpenGLContextGroup::qt_metacall +40 (int (*)(...))QOpenGLContextGroup::~QOpenGLContextGroup +48 (int (*)(...))QOpenGLContextGroup::~QOpenGLContextGroup +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QOpenGLContextGroup + size=16 align=8 + base size=16 base align=8 +QOpenGLContextGroup (0x0x7319aa79e4e0) 0 + vptr=((& QOpenGLContextGroup::_ZTV19QOpenGLContextGroup) + 16) +QObject (0x0x7319aa498900) 0 + primary-for QOpenGLContextGroup (0x0x7319aa79e4e0) + +Class QOpenGLContext::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QOpenGLContext::QPrivateSignal (0x0x7319aa498b40) 0 empty + +Vtable for QOpenGLContext +QOpenGLContext::_ZTV14QOpenGLContext: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QOpenGLContext) +16 (int (*)(...))QOpenGLContext::metaObject +24 (int (*)(...))QOpenGLContext::qt_metacast +32 (int (*)(...))QOpenGLContext::qt_metacall +40 (int (*)(...))QOpenGLContext::~QOpenGLContext +48 (int (*)(...))QOpenGLContext::~QOpenGLContext +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QOpenGLContext + size=16 align=8 + base size=16 base align=8 +QOpenGLContext (0x0x7319aa79e548) 0 + vptr=((& QOpenGLContext::_ZTV14QOpenGLContext) + 16) +QObject (0x0x7319aa498ae0) 0 + primary-for QOpenGLContext (0x0x7319aa79e548) + +Class QNativeInterface::QGLXContext::TypeInfo + size=1 align=1 + base size=0 base align=1 +QNativeInterface::QGLXContext::TypeInfo (0x0x7319aa498d80) 0 empty + +Vtable for QNativeInterface::QGLXContext +QNativeInterface::QGLXContext::_ZTVN16QNativeInterface11QGLXContextE: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN16QNativeInterface11QGLXContextE) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual + +Class QNativeInterface::QGLXContext + size=8 align=8 + base size=8 base align=8 +QNativeInterface::QGLXContext (0x0x7319aa498d20) 0 nearly-empty + vptr=((& QNativeInterface::QGLXContext::_ZTVN16QNativeInterface11QGLXContextE) + 16) + +Class QNativeInterface::QEGLContext::TypeInfo + size=1 align=1 + base size=0 base align=1 +QNativeInterface::QEGLContext::TypeInfo (0x0x7319aa498e40) 0 empty + +Vtable for QNativeInterface::QEGLContext +QNativeInterface::QEGLContext::_ZTVN16QNativeInterface11QEGLContextE: 8 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN16QNativeInterface11QEGLContextE) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual + +Class QNativeInterface::QEGLContext + size=8 align=8 + base size=8 base align=8 +QNativeInterface::QEGLContext (0x0x7319aa498de0) 0 nearly-empty + vptr=((& QNativeInterface::QEGLContext::_ZTVN16QNativeInterface11QEGLContextE) + 16) + +Class QOpenGLFunctions + size=8 align=8 + base size=8 base align=8 +QOpenGLFunctions (0x0x7319aa498ea0) 0 + +Class QOpenGLFunctionsPrivate::Functions + size=1152 align=8 + base size=1152 base align=8 +QOpenGLFunctionsPrivate::Functions (0x0x7319aed6d6c0) 0 + +Class QOpenGLFunctionsPrivate + size=1152 align=8 + base size=1152 base align=8 +QOpenGLFunctionsPrivate (0x0x7319aed6d660) 0 + +Class QOpenGLExtraFunctions + size=8 align=8 + base size=8 base align=8 +QOpenGLExtraFunctions (0x0x7319aa79ea90) 0 +QOpenGLFunctions (0x0x7319aea59480) 0 + +Class QOpenGLExtraFunctionsPrivate::Functions + size=1728 align=8 + base size=1728 base align=8 +QOpenGLExtraFunctionsPrivate::Functions (0x0x7319aea597e0) 0 + +Class QOpenGLExtraFunctionsPrivate + size=2880 align=8 + base size=2880 base align=8 +QOpenGLExtraFunctionsPrivate (0x0x7319aa79eaf8) 0 +QOpenGLFunctionsPrivate (0x0x7319aea59780) 0 + +Class QPageSize + size=8 align=8 + base size=8 base align=8 +QPageSize (0x0x7319aad282a0) 0 + +Class QPageLayout + size=8 align=8 + base size=8 base align=8 +QPageLayout (0x0x7319aa257f00) 0 + +Class QPageRanges::Range + size=8 align=4 + base size=8 base align=4 +QPageRanges::Range (0x0x7319acee7540) 0 + +Class QPageRanges + size=8 align=8 + base size=8 base align=8 +QPageRanges (0x0x7319acee74e0) 0 + +Vtable for QPagedPaintDevice +QPagedPaintDevice::_ZTV17QPagedPaintDevice: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QPagedPaintDevice) +16 0 +24 0 +32 (int (*)(...))QPaintDevice::devType +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))QPaintDevice::metric +56 (int (*)(...))QPaintDevice::initPainter +64 (int (*)(...))QPaintDevice::redirected +72 (int (*)(...))QPaintDevice::sharedPainter +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))QPagedPaintDevice::setPageLayout +96 (int (*)(...))QPagedPaintDevice::setPageSize +104 (int (*)(...))QPagedPaintDevice::setPageOrientation +112 (int (*)(...))QPagedPaintDevice::setPageMargins +120 (int (*)(...))QPagedPaintDevice::setPageRanges + +Class QPagedPaintDevice + size=24 align=8 + base size=24 base align=8 +QPagedPaintDevice (0x0x7319b2233958) 0 + vptr=((& QPagedPaintDevice::_ZTV17QPagedPaintDevice) + 16) +QPaintDevice (0x0x7319b2236ae0) 0 + primary-for QPagedPaintDevice (0x0x7319b2233958) + +Class QPaintDeviceWindow::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QPaintDeviceWindow::QPrivateSignal (0x0x7319b2236c60) 0 empty + +Vtable for QPaintDeviceWindow +QPaintDeviceWindow::_ZTV18QPaintDeviceWindow: 59 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QPaintDeviceWindow) +16 (int (*)(...))QPaintDeviceWindow::metaObject +24 (int (*)(...))QPaintDeviceWindow::qt_metacast +32 (int (*)(...))QPaintDeviceWindow::qt_metacall +40 (int (*)(...))QPaintDeviceWindow::~QPaintDeviceWindow +48 (int (*)(...))QPaintDeviceWindow::~QPaintDeviceWindow +56 (int (*)(...))QPaintDeviceWindow::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWindow::surfaceType +120 (int (*)(...))QWindow::format +128 (int (*)(...))QWindow::size +136 (int (*)(...))QWindow::accessibleRoot +144 (int (*)(...))QWindow::focusObject +152 (int (*)(...))QPaintDeviceWindow::exposeEvent +160 (int (*)(...))QWindow::resizeEvent +168 (int (*)(...))QPaintDeviceWindow::paintEvent +176 (int (*)(...))QWindow::moveEvent +184 (int (*)(...))QWindow::focusInEvent +192 (int (*)(...))QWindow::focusOutEvent +200 (int (*)(...))QWindow::showEvent +208 (int (*)(...))QWindow::hideEvent +216 (int (*)(...))QWindow::closeEvent +224 (int (*)(...))QWindow::keyPressEvent +232 (int (*)(...))QWindow::keyReleaseEvent +240 (int (*)(...))QWindow::mousePressEvent +248 (int (*)(...))QWindow::mouseReleaseEvent +256 (int (*)(...))QWindow::mouseDoubleClickEvent +264 (int (*)(...))QWindow::mouseMoveEvent +272 (int (*)(...))QWindow::wheelEvent +280 (int (*)(...))QWindow::touchEvent +288 (int (*)(...))QWindow::tabletEvent +296 (int (*)(...))QWindow::nativeEvent +304 (int (*)(...))QWindow::surfaceHandle +312 (int (*)(...))QPaintDeviceWindow::metric +320 (int (*)(...))QPaintDeviceWindow::paintEngine +328 (int (*)(...))-16 +336 (int (*)(...))(& _ZTI18QPaintDeviceWindow) +344 (int (*)(...))QPaintDeviceWindow::_ZThn16_N18QPaintDeviceWindowD1Ev +352 (int (*)(...))QPaintDeviceWindow::_ZThn16_N18QPaintDeviceWindowD0Ev +360 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv +368 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv +376 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv +384 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv +392 (int (*)(...))-40 +400 (int (*)(...))(& _ZTI18QPaintDeviceWindow) +408 (int (*)(...))QPaintDeviceWindow::_ZThn40_N18QPaintDeviceWindowD1Ev +416 (int (*)(...))QPaintDeviceWindow::_ZThn40_N18QPaintDeviceWindowD0Ev +424 (int (*)(...))QPaintDevice::devType +432 (int (*)(...))QPaintDeviceWindow::_ZThn40_NK18QPaintDeviceWindow11paintEngineEv +440 (int (*)(...))QPaintDeviceWindow::_ZThn40_NK18QPaintDeviceWindow6metricEN12QPaintDevice17PaintDeviceMetricE +448 (int (*)(...))QPaintDevice::initPainter +456 (int (*)(...))QPaintDevice::redirected +464 (int (*)(...))QPaintDevice::sharedPainter + +Class QPaintDeviceWindow + size=56 align=8 + base size=50 base align=8 +QPaintDeviceWindow (0x0x7319ab3faee0) 0 + vptr=((& QPaintDeviceWindow::_ZTV18QPaintDeviceWindow) + 16) +QWindow (0x0x7319ab3faf50) 0 + primary-for QPaintDeviceWindow (0x0x7319ab3faee0) +QObject (0x0x7319b2236b40) 0 + primary-for QWindow (0x0x7319ab3faf50) +QSurface (0x0x7319b2236ba0) 16 + vptr=((& QPaintDeviceWindow::_ZTV18QPaintDeviceWindow) + 344) +QPaintDevice (0x0x7319b2236c00) 40 + vptr=((& QPaintDeviceWindow::_ZTV18QPaintDeviceWindow) + 408) + +Class QPainter::PixmapFragment + size=80 align=8 + base size=80 base align=8 +QPainter::PixmapFragment (0x0x7319b2236e40) 0 + +Class QPainter + size=8 align=8 + base size=8 base align=8 +QPainter (0x0x7319b2236de0) 0 + +Class QTextItem + size=1 align=1 + base size=0 base align=1 +QTextItem (0x0x7319a91ee060) 0 empty + +Vtable for QPaintEngine +QPaintEngine::_ZTV12QPaintEngine: 26 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QPaintEngine) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))QPaintEngine::drawRects +64 (int (*)(...))QPaintEngine::drawRects +72 (int (*)(...))QPaintEngine::drawLines +80 (int (*)(...))QPaintEngine::drawLines +88 (int (*)(...))QPaintEngine::drawEllipse +96 (int (*)(...))QPaintEngine::drawEllipse +104 (int (*)(...))QPaintEngine::drawPath +112 (int (*)(...))QPaintEngine::drawPoints +120 (int (*)(...))QPaintEngine::drawPoints +128 (int (*)(...))QPaintEngine::drawPolygon +136 (int (*)(...))QPaintEngine::drawPolygon +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))QPaintEngine::drawTextItem +160 (int (*)(...))QPaintEngine::drawTiledPixmap +168 (int (*)(...))QPaintEngine::drawImage +176 (int (*)(...))QPaintEngine::coordinateOffset +184 (int (*)(...))__cxa_pure_virtual +192 (int (*)(...))QPaintEngine::createPixmap +200 (int (*)(...))QPaintEngine::createPixmapFromImage + +Class QPaintEngine + size=32 align=8 + base size=32 base align=8 +QPaintEngine (0x0x7319a91f4de0) 0 + vptr=((& QPaintEngine::_ZTV12QPaintEngine) + 16) + +Class QPaintEngineState + size=4 align=4 + base size=4 base align=4 +QPaintEngineState (0x0x7319c4809a80) 0 + +Class QPainterPath::Element + size=24 align=8 + base size=24 base align=8 +QPainterPath::Element (0x0x7319c483bc60) 0 + +Class QPainterPath + size=8 align=8 + base size=8 base align=8 +QPainterPath (0x0x7319c483bc00) 0 + +Class QPainterPathStroker + size=8 align=8 + base size=8 base align=8 +QPainterPathStroker (0x0x7319c488aa80) 0 + +Class QPainterStateGuard + size=16 align=8 + base size=12 base align=8 +QPainterStateGuard (0x0x7319c489a1e0) 0 + +Class QPdfOutputIntent + size=8 align=8 + base size=8 base align=8 +QPdfOutputIntent (0x0x7319c489ade0) 0 + +Class QPdfWriter::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QPdfWriter::QPrivateSignal (0x0x7319c48c71e0) 0 empty + +Vtable for QPdfWriter +QPdfWriter::_ZTV10QPdfWriter: 33 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QPdfWriter) +16 (int (*)(...))QPdfWriter::metaObject +24 (int (*)(...))QPdfWriter::qt_metacast +32 (int (*)(...))QPdfWriter::qt_metacall +40 (int (*)(...))QPdfWriter::~QPdfWriter +48 (int (*)(...))QPdfWriter::~QPdfWriter +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QPdfWriter::newPage +120 (int (*)(...))QPdfWriter::paintEngine +128 (int (*)(...))QPdfWriter::metric +136 (int (*)(...))-16 +144 (int (*)(...))(& _ZTI10QPdfWriter) +152 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriterD1Ev +160 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriterD0Ev +168 (int (*)(...))QPaintDevice::devType +176 (int (*)(...))QPdfWriter::_ZThn16_NK10QPdfWriter11paintEngineEv +184 (int (*)(...))QPdfWriter::_ZThn16_NK10QPdfWriter6metricEN12QPaintDevice17PaintDeviceMetricE +192 (int (*)(...))QPaintDevice::initPainter +200 (int (*)(...))QPaintDevice::redirected +208 (int (*)(...))QPaintDevice::sharedPainter +216 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriter7newPageEv +224 (int (*)(...))QPagedPaintDevice::setPageLayout +232 (int (*)(...))QPagedPaintDevice::setPageSize +240 (int (*)(...))QPagedPaintDevice::setPageOrientation +248 (int (*)(...))QPagedPaintDevice::setPageMargins +256 (int (*)(...))QPagedPaintDevice::setPageRanges + +Class QPdfWriter + size=40 align=8 + base size=40 base align=8 +QPdfWriter (0x0x7319c48c17e0) 0 + vptr=((& QPdfWriter::_ZTV10QPdfWriter) + 16) +QObject (0x0x7319c48c7120) 0 + primary-for QPdfWriter (0x0x7319c48c17e0) +QPagedPaintDevice (0x0x7319c48c8138) 16 + vptr=((& QPdfWriter::_ZTV10QPdfWriter) + 152) +QPaintDevice (0x0x7319c48c7180) 16 + primary-for QPagedPaintDevice (0x0x7319c48c8138) + +Vtable for QPicture +QPicture::_ZTV8QPicture: 11 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI8QPicture) +16 (int (*)(...))QPicture::~QPicture +24 (int (*)(...))QPicture::~QPicture +32 (int (*)(...))QPicture::devType +40 (int (*)(...))QPicture::paintEngine +48 (int (*)(...))QPicture::metric +56 (int (*)(...))QPaintDevice::initPainter +64 (int (*)(...))QPaintDevice::redirected +72 (int (*)(...))QPaintDevice::sharedPainter +80 (int (*)(...))QPicture::setData + +Class QPicture + size=24 align=8 + base size=24 base align=8 +QPicture (0x0x7319c48c81a0) 0 + vptr=((& QPicture::_ZTV8QPicture) + 16) +QPaintDevice (0x0x7319c48c7480) 0 + primary-for QPicture (0x0x7319c48c81a0) + +Class QPixmapCache::Key + size=8 align=8 + base size=8 base align=8 +QPixmapCache::Key (0x0x7319c48f8840) 0 + +Class QPixmapCache + size=1 align=1 + base size=0 base align=1 +QPixmapCache (0x0x7319c48f87e0) 0 empty + +Class QQuaternion::Axis + size=12 align=4 + base size=12 base align=4 +QQuaternion::Axis (0x0x7319c4908d80) 0 + +Class QQuaternion::Axes + size=36 align=4 + base size=36 base align=4 +QQuaternion::Axes (0x0x7319c4908e40) 0 + +Class QQuaternion + size=16 align=4 + base size=16 base align=4 +QQuaternion (0x0x7319c4908d20) 0 + +Class QRasterWindow::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QRasterWindow::QPrivateSignal (0x0x7319c4938a20) 0 empty + +Vtable for QRasterWindow +QRasterWindow::_ZTV13QRasterWindow: 60 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QRasterWindow) +16 (int (*)(...))QRasterWindow::metaObject +24 (int (*)(...))QRasterWindow::qt_metacast +32 (int (*)(...))QRasterWindow::qt_metacall +40 (int (*)(...))QRasterWindow::~QRasterWindow +48 (int (*)(...))QRasterWindow::~QRasterWindow +56 (int (*)(...))QPaintDeviceWindow::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWindow::surfaceType +120 (int (*)(...))QWindow::format +128 (int (*)(...))QWindow::size +136 (int (*)(...))QWindow::accessibleRoot +144 (int (*)(...))QWindow::focusObject +152 (int (*)(...))QPaintDeviceWindow::exposeEvent +160 (int (*)(...))QRasterWindow::resizeEvent +168 (int (*)(...))QPaintDeviceWindow::paintEvent +176 (int (*)(...))QWindow::moveEvent +184 (int (*)(...))QWindow::focusInEvent +192 (int (*)(...))QWindow::focusOutEvent +200 (int (*)(...))QWindow::showEvent +208 (int (*)(...))QWindow::hideEvent +216 (int (*)(...))QWindow::closeEvent +224 (int (*)(...))QWindow::keyPressEvent +232 (int (*)(...))QWindow::keyReleaseEvent +240 (int (*)(...))QWindow::mousePressEvent +248 (int (*)(...))QWindow::mouseReleaseEvent +256 (int (*)(...))QWindow::mouseDoubleClickEvent +264 (int (*)(...))QWindow::mouseMoveEvent +272 (int (*)(...))QWindow::wheelEvent +280 (int (*)(...))QWindow::touchEvent +288 (int (*)(...))QWindow::tabletEvent +296 (int (*)(...))QWindow::nativeEvent +304 (int (*)(...))QWindow::surfaceHandle +312 (int (*)(...))QRasterWindow::metric +320 (int (*)(...))QPaintDeviceWindow::paintEngine +328 (int (*)(...))QRasterWindow::redirected +336 (int (*)(...))-16 +344 (int (*)(...))(& _ZTI13QRasterWindow) +352 (int (*)(...))QRasterWindow::_ZThn16_N13QRasterWindowD1Ev +360 (int (*)(...))QRasterWindow::_ZThn16_N13QRasterWindowD0Ev +368 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv +376 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv +384 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv +392 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv +400 (int (*)(...))-40 +408 (int (*)(...))(& _ZTI13QRasterWindow) +416 (int (*)(...))QRasterWindow::_ZThn40_N13QRasterWindowD1Ev +424 (int (*)(...))QRasterWindow::_ZThn40_N13QRasterWindowD0Ev +432 (int (*)(...))QPaintDevice::devType +440 (int (*)(...))QPaintDeviceWindow::_ZThn40_NK18QPaintDeviceWindow11paintEngineEv +448 (int (*)(...))QRasterWindow::_ZThn40_NK13QRasterWindow6metricEN12QPaintDevice17PaintDeviceMetricE +456 (int (*)(...))QPaintDevice::initPainter +464 (int (*)(...))QRasterWindow::_ZThn40_NK13QRasterWindow10redirectedEP6QPoint +472 (int (*)(...))QPaintDevice::sharedPainter + +Class QRasterWindow + size=56 align=8 + base size=50 base align=8 +QRasterWindow (0x0x7319c49248f0) 0 + vptr=((& QRasterWindow::_ZTV13QRasterWindow) + 16) +QPaintDeviceWindow (0x0x7319c4935770) 0 + primary-for QRasterWindow (0x0x7319c49248f0) +QWindow (0x0x7319c49357e0) 0 + primary-for QPaintDeviceWindow (0x0x7319c4935770) +QObject (0x0x7319c4938900) 0 + primary-for QWindow (0x0x7319c49357e0) +QSurface (0x0x7319c4938960) 16 + vptr=((& QRasterWindow::_ZTV13QRasterWindow) + 352) +QPaintDevice (0x0x7319c49389c0) 40 + vptr=((& QRasterWindow::_ZTV13QRasterWindow) + 416) + +Class QSessionManager::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSessionManager::QPrivateSignal (0x0x7319c494f7e0) 0 empty + +Vtable for QSessionManager +QSessionManager::_ZTV15QSessionManager: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QSessionManager) +16 (int (*)(...))QSessionManager::metaObject +24 (int (*)(...))QSessionManager::qt_metacast +32 (int (*)(...))QSessionManager::qt_metacall +40 (int (*)(...))QSessionManager::~QSessionManager +48 (int (*)(...))QSessionManager::~QSessionManager +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QSessionManager + size=16 align=8 + base size=16 base align=8 +QSessionManager (0x0x7319c49249c0) 0 + vptr=((& QSessionManager::_ZTV15QSessionManager) + 16) +QObject (0x0x7319c494f780) 0 + primary-for QSessionManager (0x0x7319c49249c0) + +Class QShortcut::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QShortcut::QPrivateSignal (0x0x7319c494f9c0) 0 empty + +Vtable for QShortcut +QShortcut::_ZTV9QShortcut: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QShortcut) +16 (int (*)(...))QShortcut::metaObject +24 (int (*)(...))QShortcut::qt_metacast +32 (int (*)(...))QShortcut::qt_metacall +40 (int (*)(...))QShortcut::~QShortcut +48 (int (*)(...))QShortcut::~QShortcut +56 (int (*)(...))QShortcut::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QShortcut + size=16 align=8 + base size=16 base align=8 +QShortcut (0x0x7319c4924a28) 0 + vptr=((& QShortcut::_ZTV9QShortcut) + 16) +QObject (0x0x7319c494f960) 0 + primary-for QShortcut (0x0x7319c4924a28) + +Vtable for QStandardItem +QStandardItem::_ZTV13QStandardItem: 12 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QStandardItem) +16 (int (*)(...))QStandardItem::~QStandardItem +24 (int (*)(...))QStandardItem::~QStandardItem +32 (int (*)(...))QStandardItem::data +40 (int (*)(...))QStandardItem::multiData +48 (int (*)(...))QStandardItem::setData +56 (int (*)(...))QStandardItem::clone +64 (int (*)(...))QStandardItem::type +72 (int (*)(...))QStandardItem::read +80 (int (*)(...))QStandardItem::write +88 (int (*)(...))QStandardItem::operator< + +Class QStandardItem + size=16 align=8 + base size=16 base align=8 +QStandardItem (0x0x7319c494fea0) 0 + vptr=((& QStandardItem::_ZTV13QStandardItem) + 16) + +Class QStandardItemModel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QStandardItemModel::QPrivateSignal (0x0x7319c49ca2a0) 0 empty + +Vtable for QStandardItemModel +QStandardItemModel::_ZTV18QStandardItemModel: 51 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QStandardItemModel) +16 (int (*)(...))QStandardItemModel::metaObject +24 (int (*)(...))QStandardItemModel::qt_metacast +32 (int (*)(...))QStandardItemModel::qt_metacall +40 (int (*)(...))QStandardItemModel::~QStandardItemModel +48 (int (*)(...))QStandardItemModel::~QStandardItemModel +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QStandardItemModel::index +120 (int (*)(...))QStandardItemModel::parent +128 (int (*)(...))QAbstractItemModel::sibling +136 (int (*)(...))QStandardItemModel::rowCount +144 (int (*)(...))QStandardItemModel::columnCount +152 (int (*)(...))QStandardItemModel::hasChildren +160 (int (*)(...))QStandardItemModel::data +168 (int (*)(...))QStandardItemModel::setData +176 (int (*)(...))QStandardItemModel::headerData +184 (int (*)(...))QStandardItemModel::setHeaderData +192 (int (*)(...))QStandardItemModel::itemData +200 (int (*)(...))QStandardItemModel::setItemData +208 (int (*)(...))QStandardItemModel::clearItemData +216 (int (*)(...))QStandardItemModel::mimeTypes +224 (int (*)(...))QStandardItemModel::mimeData +232 (int (*)(...))QAbstractItemModel::canDropMimeData +240 (int (*)(...))QStandardItemModel::dropMimeData +248 (int (*)(...))QStandardItemModel::supportedDropActions +256 (int (*)(...))QAbstractItemModel::supportedDragActions +264 (int (*)(...))QStandardItemModel::insertRows +272 (int (*)(...))QStandardItemModel::insertColumns +280 (int (*)(...))QStandardItemModel::removeRows +288 (int (*)(...))QStandardItemModel::removeColumns +296 (int (*)(...))QAbstractItemModel::moveRows +304 (int (*)(...))QAbstractItemModel::moveColumns +312 (int (*)(...))QAbstractItemModel::fetchMore +320 (int (*)(...))QAbstractItemModel::canFetchMore +328 (int (*)(...))QStandardItemModel::flags +336 (int (*)(...))QStandardItemModel::sort +344 (int (*)(...))QAbstractItemModel::buddy +352 (int (*)(...))QAbstractItemModel::match +360 (int (*)(...))QAbstractItemModel::span +368 (int (*)(...))QStandardItemModel::roleNames +376 (int (*)(...))QStandardItemModel::multiData +384 (int (*)(...))QAbstractItemModel::submit +392 (int (*)(...))QAbstractItemModel::revert +400 (int (*)(...))QAbstractItemModel::resetInternalData + +Class QStandardItemModel + size=16 align=8 + base size=16 base align=8 +QStandardItemModel (0x0x7319c49a4208) 0 + vptr=((& QStandardItemModel::_ZTV18QStandardItemModel) + 16) +QAbstractItemModel (0x0x7319c49a4270) 0 + primary-for QStandardItemModel (0x0x7319c49a4208) +QObject (0x0x7319c49ca240) 0 + primary-for QAbstractItemModel (0x0x7319c49a4270) + +Class QStaticText + size=8 align=8 + base size=8 base align=8 +QStaticText (0x0x7319c49ca600) 0 + +Class QStyleHints::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QStyleHints::QPrivateSignal (0x0x7319c3809240) 0 empty + +Vtable for QStyleHints +QStyleHints::_ZTV11QStyleHints: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QStyleHints) +16 (int (*)(...))QStyleHints::metaObject +24 (int (*)(...))QStyleHints::qt_metacast +32 (int (*)(...))QStyleHints::qt_metacall +40 (int (*)(...))QStyleHints::~QStyleHints +48 (int (*)(...))QStyleHints::~QStyleHints +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QStyleHints + size=16 align=8 + base size=16 base align=8 +QStyleHints (0x0x7319c3808138) 0 + vptr=((& QStyleHints::_ZTV11QStyleHints) + 16) +QObject (0x0x7319c38091e0) 0 + primary-for QStyleHints (0x0x7319c3808138) + +Class QTextObject::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTextObject::QPrivateSignal (0x0x7319c3809480) 0 empty + +Vtable for QTextObject +QTextObject::_ZTV11QTextObject: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QTextObject) +16 (int (*)(...))QTextObject::metaObject +24 (int (*)(...))QTextObject::qt_metacast +32 (int (*)(...))QTextObject::qt_metacall +40 (int (*)(...))QTextObject::~QTextObject +48 (int (*)(...))QTextObject::~QTextObject +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QTextObject + size=16 align=8 + base size=16 base align=8 +QTextObject (0x0x7319c38081a0) 0 + vptr=((& QTextObject::_ZTV11QTextObject) + 16) +QObject (0x0x7319c3809420) 0 + primary-for QTextObject (0x0x7319c38081a0) + +Class QTextBlockGroup::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTextBlockGroup::QPrivateSignal (0x0x7319c3809660) 0 empty + +Vtable for QTextBlockGroup +QTextBlockGroup::_ZTV15QTextBlockGroup: 17 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QTextBlockGroup) +16 (int (*)(...))QTextBlockGroup::metaObject +24 (int (*)(...))QTextBlockGroup::qt_metacast +32 (int (*)(...))QTextBlockGroup::qt_metacall +40 (int (*)(...))QTextBlockGroup::~QTextBlockGroup +48 (int (*)(...))QTextBlockGroup::~QTextBlockGroup +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QTextBlockGroup::blockInserted +120 (int (*)(...))QTextBlockGroup::blockRemoved +128 (int (*)(...))QTextBlockGroup::blockFormatChanged + +Class QTextBlockGroup + size=16 align=8 + base size=16 base align=8 +QTextBlockGroup (0x0x7319c3808208) 0 + vptr=((& QTextBlockGroup::_ZTV15QTextBlockGroup) + 16) +QTextObject (0x0x7319c3808270) 0 + primary-for QTextBlockGroup (0x0x7319c3808208) +QObject (0x0x7319c3809600) 0 + primary-for QTextObject (0x0x7319c3808270) + +Vtable for QTextFrameLayoutData +QTextFrameLayoutData::_ZTV20QTextFrameLayoutData: 4 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QTextFrameLayoutData) +16 (int (*)(...))QTextFrameLayoutData::~QTextFrameLayoutData +24 (int (*)(...))QTextFrameLayoutData::~QTextFrameLayoutData + +Class QTextFrameLayoutData + size=8 align=8 + base size=8 base align=8 +QTextFrameLayoutData (0x0x7319c38097e0) 0 nearly-empty + vptr=((& QTextFrameLayoutData::_ZTV20QTextFrameLayoutData) + 16) + +Class QTextFrame::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTextFrame::QPrivateSignal (0x0x7319c38098a0) 0 empty + +Class QTextFrame::iterator + size=32 align=8 + base size=28 base align=8 +QTextFrame::iterator (0x0x7319c3809900) 0 + +Vtable for QTextFrame +QTextFrame::_ZTV10QTextFrame: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QTextFrame) +16 (int (*)(...))QTextFrame::metaObject +24 (int (*)(...))QTextFrame::qt_metacast +32 (int (*)(...))QTextFrame::qt_metacall +40 (int (*)(...))QTextFrame::~QTextFrame +48 (int (*)(...))QTextFrame::~QTextFrame +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QTextFrame + size=16 align=8 + base size=16 base align=8 +QTextFrame (0x0x7319c38082d8) 0 + vptr=((& QTextFrame::_ZTV10QTextFrame) + 16) +QTextObject (0x0x7319c3808340) 0 + primary-for QTextFrame (0x0x7319c38082d8) +QObject (0x0x7319c3809840) 0 + primary-for QTextObject (0x0x7319c3808340) + +Vtable for QTextBlockUserData +QTextBlockUserData::_ZTV18QTextBlockUserData: 4 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QTextBlockUserData) +16 (int (*)(...))QTextBlockUserData::~QTextBlockUserData +24 (int (*)(...))QTextBlockUserData::~QTextBlockUserData + +Class QTextBlockUserData + size=8 align=8 + base size=8 base align=8 +QTextBlockUserData (0x0x7319c3838c00) 0 nearly-empty + vptr=((& QTextBlockUserData::_ZTV18QTextBlockUserData) + 16) + +Class QTextBlock::iterator + size=24 align=8 + base size=20 base align=8 +QTextBlock::iterator (0x0x7319c3838cc0) 0 + +Class QTextBlock + size=16 align=8 + base size=12 base align=8 +QTextBlock (0x0x7319c3838c60) 0 + +Class QTextFragment + size=16 align=8 + base size=16 base align=8 +QTextFragment (0x0x7319c3859f60) 0 + +Class QSyntaxHighlighter::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSyntaxHighlighter::QPrivateSignal (0x0x7319c38703c0) 0 empty + +Vtable for QSyntaxHighlighter +QSyntaxHighlighter::_ZTV18QSyntaxHighlighter: 15 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QSyntaxHighlighter) +16 (int (*)(...))QSyntaxHighlighter::metaObject +24 (int (*)(...))QSyntaxHighlighter::qt_metacast +32 (int (*)(...))QSyntaxHighlighter::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual + +Class QSyntaxHighlighter + size=16 align=8 + base size=16 base align=8 +QSyntaxHighlighter (0x0x7319c386e9c0) 0 + vptr=((& QSyntaxHighlighter::_ZTV18QSyntaxHighlighter) + 16) +QObject (0x0x7319c3870360) 0 + primary-for QSyntaxHighlighter (0x0x7319c386e9c0) + +Class QTextDocumentFragment + size=8 align=8 + base size=8 base align=8 +QTextDocumentFragment (0x0x7319c3870540) 0 + +Class QTextDocumentWriter + size=8 align=8 + base size=8 base align=8 +QTextDocumentWriter (0x0x7319c38705a0) 0 + +Class QTextList::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTextList::QPrivateSignal (0x0x7319c3870660) 0 empty + +Vtable for QTextList +QTextList::_ZTV9QTextList: 17 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QTextList) +16 (int (*)(...))QTextList::metaObject +24 (int (*)(...))QTextList::qt_metacast +32 (int (*)(...))QTextList::qt_metacall +40 (int (*)(...))QTextList::~QTextList +48 (int (*)(...))QTextList::~QTextList +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QTextBlockGroup::blockInserted +120 (int (*)(...))QTextBlockGroup::blockRemoved +128 (int (*)(...))QTextBlockGroup::blockFormatChanged + +Class QTextList + size=16 align=8 + base size=16 base align=8 +QTextList (0x0x7319c386ea28) 0 + vptr=((& QTextList::_ZTV9QTextList) + 16) +QTextBlockGroup (0x0x7319c386ea90) 0 + primary-for QTextList (0x0x7319c386ea28) +QTextObject (0x0x7319c386eaf8) 0 + primary-for QTextBlockGroup (0x0x7319c386ea90) +QObject (0x0x7319c3870600) 0 + primary-for QTextObject (0x0x7319c386eaf8) + +Class QTextTableCell + size=16 align=8 + base size=12 base align=8 +QTextTableCell (0x0x7319c3870a20) 0 + +Class QTextTable::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTextTable::QPrivateSignal (0x0x7319c388d2a0) 0 empty + +Vtable for QTextTable +QTextTable::_ZTV10QTextTable: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QTextTable) +16 (int (*)(...))QTextTable::metaObject +24 (int (*)(...))QTextTable::qt_metacast +32 (int (*)(...))QTextTable::qt_metacall +40 (int (*)(...))QTextTable::~QTextTable +48 (int (*)(...))QTextTable::~QTextTable +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QTextTable + size=16 align=8 + base size=16 base align=8 +QTextTable (0x0x7319c386eb60) 0 + vptr=((& QTextTable::_ZTV10QTextTable) + 16) +QTextFrame (0x0x7319c386ebc8) 0 + primary-for QTextTable (0x0x7319c386eb60) +QTextObject (0x0x7319c386ec30) 0 + primary-for QTextFrame (0x0x7319c386ebc8) +QObject (0x0x7319c388d240) 0 + primary-for QTextObject (0x0x7319c386ec30) + +Class QUndoGroup::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QUndoGroup::QPrivateSignal (0x0x7319c388d660) 0 empty + +Vtable for QUndoGroup +QUndoGroup::_ZTV10QUndoGroup: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QUndoGroup) +16 (int (*)(...))QUndoGroup::metaObject +24 (int (*)(...))QUndoGroup::qt_metacast +32 (int (*)(...))QUndoGroup::qt_metacall +40 (int (*)(...))QUndoGroup::~QUndoGroup +48 (int (*)(...))QUndoGroup::~QUndoGroup +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QUndoGroup + size=16 align=8 + base size=16 base align=8 +QUndoGroup (0x0x7319c386ec98) 0 + vptr=((& QUndoGroup::_ZTV10QUndoGroup) + 16) +QObject (0x0x7319c388d600) 0 + primary-for QUndoGroup (0x0x7319c386ec98) + +Vtable for QUndoCommand +QUndoCommand::_ZTV12QUndoCommand: 8 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QUndoCommand) +16 (int (*)(...))QUndoCommand::~QUndoCommand +24 (int (*)(...))QUndoCommand::~QUndoCommand +32 (int (*)(...))QUndoCommand::undo +40 (int (*)(...))QUndoCommand::redo +48 (int (*)(...))QUndoCommand::id +56 (int (*)(...))QUndoCommand::mergeWith + +Class QUndoCommand + size=16 align=8 + base size=16 base align=8 +QUndoCommand (0x0x7319c388d7e0) 0 + vptr=((& QUndoCommand::_ZTV12QUndoCommand) + 16) + +Class QUndoStack::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QUndoStack::QPrivateSignal (0x0x7319c388d8a0) 0 empty + +Vtable for QUndoStack +QUndoStack::_ZTV10QUndoStack: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QUndoStack) +16 (int (*)(...))QUndoStack::metaObject +24 (int (*)(...))QUndoStack::qt_metacast +32 (int (*)(...))QUndoStack::qt_metacall +40 (int (*)(...))QUndoStack::~QUndoStack +48 (int (*)(...))QUndoStack::~QUndoStack +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QUndoStack + size=16 align=8 + base size=16 base align=8 +QUndoStack (0x0x7319c386ed00) 0 + vptr=((& QUndoStack::_ZTV10QUndoStack) + 16) +QObject (0x0x7319c388d840) 0 + primary-for QUndoStack (0x0x7319c386ed00) + +Class QValidator::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QValidator::QPrivateSignal (0x0x7319c388da80) 0 empty + +Vtable for QValidator +QValidator::_ZTV10QValidator: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QValidator) +16 (int (*)(...))QValidator::metaObject +24 (int (*)(...))QValidator::qt_metacast +32 (int (*)(...))QValidator::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))QValidator::fixup + +Class QValidator + size=16 align=8 + base size=16 base align=8 +QValidator (0x0x7319c386ed68) 0 + vptr=((& QValidator::_ZTV10QValidator) + 16) +QObject (0x0x7319c388da20) 0 + primary-for QValidator (0x0x7319c386ed68) + +Class QIntValidator::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QIntValidator::QPrivateSignal (0x0x7319c388dd20) 0 empty + +Vtable for QIntValidator +QIntValidator::_ZTV13QIntValidator: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QIntValidator) +16 (int (*)(...))QIntValidator::metaObject +24 (int (*)(...))QIntValidator::qt_metacast +32 (int (*)(...))QIntValidator::qt_metacall +40 (int (*)(...))QIntValidator::~QIntValidator +48 (int (*)(...))QIntValidator::~QIntValidator +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QIntValidator::validate +120 (int (*)(...))QIntValidator::fixup + +Class QIntValidator + size=24 align=8 + base size=24 base align=8 +QIntValidator (0x0x7319c386edd0) 0 + vptr=((& QIntValidator::_ZTV13QIntValidator) + 16) +QValidator (0x0x7319c386ee38) 0 + primary-for QIntValidator (0x0x7319c386edd0) +QObject (0x0x7319c388dcc0) 0 + primary-for QValidator (0x0x7319c386ee38) + +Class QDoubleValidator::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDoubleValidator::QPrivateSignal (0x0x7319c388df00) 0 empty + +Vtable for QDoubleValidator +QDoubleValidator::_ZTV16QDoubleValidator: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI16QDoubleValidator) +16 (int (*)(...))QDoubleValidator::metaObject +24 (int (*)(...))QDoubleValidator::qt_metacast +32 (int (*)(...))QDoubleValidator::qt_metacall +40 (int (*)(...))QDoubleValidator::~QDoubleValidator +48 (int (*)(...))QDoubleValidator::~QDoubleValidator +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QDoubleValidator::validate +120 (int (*)(...))QDoubleValidator::fixup + +Class QDoubleValidator + size=40 align=8 + base size=36 base align=8 +QDoubleValidator (0x0x7319c386eea0) 0 + vptr=((& QDoubleValidator::_ZTV16QDoubleValidator) + 16) +QValidator (0x0x7319c386ef08) 0 + primary-for QDoubleValidator (0x0x7319c386eea0) +QObject (0x0x7319c388dea0) 0 + primary-for QValidator (0x0x7319c386ef08) + +Class QRegularExpressionValidator::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QRegularExpressionValidator::QPrivateSignal (0x0x7319c38c4300) 0 empty + +Vtable for QRegularExpressionValidator +QRegularExpressionValidator::_ZTV27QRegularExpressionValidator: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI27QRegularExpressionValidator) +16 (int (*)(...))QRegularExpressionValidator::metaObject +24 (int (*)(...))QRegularExpressionValidator::qt_metacast +32 (int (*)(...))QRegularExpressionValidator::qt_metacall +40 (int (*)(...))QRegularExpressionValidator::~QRegularExpressionValidator +48 (int (*)(...))QRegularExpressionValidator::~QRegularExpressionValidator +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QRegularExpressionValidator::validate +120 (int (*)(...))QValidator::fixup + +Class QRegularExpressionValidator + size=16 align=8 + base size=16 base align=8 +QRegularExpressionValidator (0x0x7319c386ef70) 0 + vptr=((& QRegularExpressionValidator::_ZTV27QRegularExpressionValidator) + 16) +QValidator (0x0x7319c38c7000) 0 + primary-for QRegularExpressionValidator (0x0x7319c386ef70) +QObject (0x0x7319c38c42a0) 0 + primary-for QValidator (0x0x7319c38c7000) + +Class QSizePolicy::Bits + size=4 align=4 + base size=4 base align=4 +QSizePolicy::Bits (0x0x7319c38c44e0) 0 + +Class QSizePolicy + size=4 align=4 + base size=4 base align=4 +QSizePolicy (0x0x7319c38c4480) 0 + +Class QWidgetData + size=88 align=8 + base size=88 base align=8 +QWidgetData (0x0x7319c390a3c0) 0 + +Class QWidget::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QWidget::QPrivateSignal (0x0x7319c390a4e0) 0 empty + +Vtable for QWidget +QWidget::_ZTV7QWidget: 64 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI7QWidget) +16 (int (*)(...))QWidget::metaObject +24 (int (*)(...))QWidget::qt_metacast +32 (int (*)(...))QWidget::qt_metacall +40 (int (*)(...))QWidget::~QWidget +48 (int (*)(...))QWidget::~QWidget +56 (int (*)(...))QWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))-16 +440 (int (*)(...))(& _ZTI7QWidget) +448 (int (*)(...))QWidget::_ZThn16_N7QWidgetD1Ev +456 (int (*)(...))QWidget::_ZThn16_N7QWidgetD0Ev +464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QWidget + size=40 align=8 + base size=40 base align=8 +QWidget (0x0x7319c38f9d90) 0 + vptr=((& QWidget::_ZTV7QWidget) + 16) +QObject (0x0x7319c390a420) 0 + primary-for QWidget (0x0x7319c38f9d90) +QPaintDevice (0x0x7319c390a480) 16 + vptr=((& QWidget::_ZTV7QWidget) + 448) + +Class QAbstractButton::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAbstractButton::QPrivateSignal (0x0x7319c396fe40) 0 empty + +Vtable for QAbstractButton +QAbstractButton::_ZTV15QAbstractButton: 67 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QAbstractButton) +16 (int (*)(...))QAbstractButton::metaObject +24 (int (*)(...))QAbstractButton::qt_metacast +32 (int (*)(...))QAbstractButton::qt_metacall +40 0 +48 0 +56 (int (*)(...))QAbstractButton::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QAbstractButton::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractButton::mousePressEvent +176 (int (*)(...))QAbstractButton::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QAbstractButton::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QAbstractButton::keyPressEvent +216 (int (*)(...))QAbstractButton::keyReleaseEvent +224 (int (*)(...))QAbstractButton::focusInEvent +232 (int (*)(...))QAbstractButton::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))__cxa_pure_virtual +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QAbstractButton::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QAbstractButton::hitButton +440 (int (*)(...))QAbstractButton::checkStateSet +448 (int (*)(...))QAbstractButton::nextCheckState +456 (int (*)(...))-16 +464 (int (*)(...))(& _ZTI15QAbstractButton) +472 0 +480 0 +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QAbstractButton + size=40 align=8 + base size=40 base align=8 +QAbstractButton (0x0x7319c3902ea0) 0 + vptr=((& QAbstractButton::_ZTV15QAbstractButton) + 16) +QWidget (0x0x7319c397b310) 0 + primary-for QAbstractButton (0x0x7319c3902ea0) +QObject (0x0x7319c396fd80) 0 + primary-for QWidget (0x0x7319c397b310) +QPaintDevice (0x0x7319c396fde0) 16 + vptr=((& QAbstractButton::_ZTV15QAbstractButton) + 472) + +Class QAbstractSpinBox::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAbstractSpinBox::QPrivateSignal (0x0x7319c398b0c0) 0 empty + +Vtable for QAbstractSpinBox +QAbstractSpinBox::_ZTV16QAbstractSpinBox: 70 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI16QAbstractSpinBox) +16 (int (*)(...))QAbstractSpinBox::metaObject +24 (int (*)(...))QAbstractSpinBox::qt_metacast +32 (int (*)(...))QAbstractSpinBox::qt_metacall +40 (int (*)(...))QAbstractSpinBox::~QAbstractSpinBox +48 (int (*)(...))QAbstractSpinBox::~QAbstractSpinBox +56 (int (*)(...))QAbstractSpinBox::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QAbstractSpinBox::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QAbstractSpinBox::sizeHint +136 (int (*)(...))QAbstractSpinBox::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractSpinBox::mousePressEvent +176 (int (*)(...))QAbstractSpinBox::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QAbstractSpinBox::mouseMoveEvent +200 (int (*)(...))QAbstractSpinBox::wheelEvent +208 (int (*)(...))QAbstractSpinBox::keyPressEvent +216 (int (*)(...))QAbstractSpinBox::keyReleaseEvent +224 (int (*)(...))QAbstractSpinBox::focusInEvent +232 (int (*)(...))QAbstractSpinBox::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QAbstractSpinBox::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QAbstractSpinBox::resizeEvent +280 (int (*)(...))QAbstractSpinBox::closeEvent +288 (int (*)(...))QAbstractSpinBox::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QAbstractSpinBox::showEvent +352 (int (*)(...))QAbstractSpinBox::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QAbstractSpinBox::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QAbstractSpinBox::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QAbstractSpinBox::validate +440 (int (*)(...))QAbstractSpinBox::fixup +448 (int (*)(...))QAbstractSpinBox::stepBy +456 (int (*)(...))QAbstractSpinBox::clear +464 (int (*)(...))QAbstractSpinBox::initStyleOption +472 (int (*)(...))QAbstractSpinBox::stepEnabled +480 (int (*)(...))-16 +488 (int (*)(...))(& _ZTI16QAbstractSpinBox) +496 (int (*)(...))QAbstractSpinBox::_ZThn16_N16QAbstractSpinBoxD1Ev +504 (int (*)(...))QAbstractSpinBox::_ZThn16_N16QAbstractSpinBoxD0Ev +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +552 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QAbstractSpinBox + size=40 align=8 + base size=40 base align=8 +QAbstractSpinBox (0x0x7319c3902f08) 0 + vptr=((& QAbstractSpinBox::_ZTV16QAbstractSpinBox) + 16) +QWidget (0x0x7319c397b4d0) 0 + primary-for QAbstractSpinBox (0x0x7319c3902f08) +QObject (0x0x7319c398b000) 0 + primary-for QWidget (0x0x7319c397b4d0) +QPaintDevice (0x0x7319c398b060) 16 + vptr=((& QAbstractSpinBox::_ZTV16QAbstractSpinBox) + 496) + +Class QAbstractSlider::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAbstractSlider::QPrivateSignal (0x0x7319c398ba80) 0 empty + +Vtable for QAbstractSlider +QAbstractSlider::_ZTV15QAbstractSlider: 65 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QAbstractSlider) +16 (int (*)(...))QAbstractSlider::metaObject +24 (int (*)(...))QAbstractSlider::qt_metacast +32 (int (*)(...))QAbstractSlider::qt_metacall +40 (int (*)(...))QAbstractSlider::~QAbstractSlider +48 (int (*)(...))QAbstractSlider::~QAbstractSlider +56 (int (*)(...))QAbstractSlider::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QAbstractSlider::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QAbstractSlider::wheelEvent +208 (int (*)(...))QAbstractSlider::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QAbstractSlider::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QAbstractSlider::sliderChange +440 (int (*)(...))-16 +448 (int (*)(...))(& _ZTI15QAbstractSlider) +456 (int (*)(...))QAbstractSlider::_ZThn16_N15QAbstractSliderD1Ev +464 (int (*)(...))QAbstractSlider::_ZThn16_N15QAbstractSliderD0Ev +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QAbstractSlider + size=40 align=8 + base size=40 base align=8 +QAbstractSlider (0x0x7319c39a0208) 0 + vptr=((& QAbstractSlider::_ZTV15QAbstractSlider) + 16) +QWidget (0x0x7319c39b90e0) 0 + primary-for QAbstractSlider (0x0x7319c39a0208) +QObject (0x0x7319c398b9c0) 0 + primary-for QWidget (0x0x7319c39b90e0) +QPaintDevice (0x0x7319c398ba20) 16 + vptr=((& QAbstractSlider::_ZTV15QAbstractSlider) + 456) + +Class QSlider::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSlider::QPrivateSignal (0x0x7319c398bcc0) 0 empty + +Vtable for QSlider +QSlider::_ZTV7QSlider: 66 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI7QSlider) +16 (int (*)(...))QSlider::metaObject +24 (int (*)(...))QSlider::qt_metacast +32 (int (*)(...))QSlider::qt_metacall +40 (int (*)(...))QSlider::~QSlider +48 (int (*)(...))QSlider::~QSlider +56 (int (*)(...))QSlider::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QAbstractSlider::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QSlider::sizeHint +136 (int (*)(...))QSlider::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QSlider::mousePressEvent +176 (int (*)(...))QSlider::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QSlider::mouseMoveEvent +200 (int (*)(...))QAbstractSlider::wheelEvent +208 (int (*)(...))QAbstractSlider::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QSlider::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QAbstractSlider::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QAbstractSlider::sliderChange +440 (int (*)(...))QSlider::initStyleOption +448 (int (*)(...))-16 +456 (int (*)(...))(& _ZTI7QSlider) +464 (int (*)(...))QSlider::_ZThn16_N7QSliderD1Ev +472 (int (*)(...))QSlider::_ZThn16_N7QSliderD0Ev +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QSlider + size=40 align=8 + base size=40 base align=8 +QSlider (0x0x7319c39a0270) 0 + vptr=((& QSlider::_ZTV7QSlider) + 16) +QAbstractSlider (0x0x7319c39a02d8) 0 + primary-for QSlider (0x0x7319c39a0270) +QWidget (0x0x7319c39b97e0) 0 + primary-for QAbstractSlider (0x0x7319c39a02d8) +QObject (0x0x7319c398bc00) 0 + primary-for QWidget (0x0x7319c39b97e0) +QPaintDevice (0x0x7319c398bc60) 16 + vptr=((& QSlider::_ZTV7QSlider) + 464) + +Class QStyle::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QStyle::QPrivateSignal (0x0x7319c398bf60) 0 empty + +Vtable for QStyle +QStyle::_ZTV6QStyle: 37 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI6QStyle) +16 (int (*)(...))QStyle::metaObject +24 (int (*)(...))QStyle::qt_metacast +32 (int (*)(...))QStyle::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QStyle::polish +120 (int (*)(...))QStyle::unpolish +128 (int (*)(...))QStyle::polish +136 (int (*)(...))QStyle::unpolish +144 (int (*)(...))QStyle::polish +152 (int (*)(...))QStyle::itemTextRect +160 (int (*)(...))QStyle::itemPixmapRect +168 (int (*)(...))QStyle::drawItemText +176 (int (*)(...))QStyle::drawItemPixmap +184 (int (*)(...))QStyle::standardPalette +192 (int (*)(...))__cxa_pure_virtual +200 (int (*)(...))__cxa_pure_virtual +208 (int (*)(...))__cxa_pure_virtual +216 (int (*)(...))__cxa_pure_virtual +224 (int (*)(...))__cxa_pure_virtual +232 (int (*)(...))__cxa_pure_virtual +240 (int (*)(...))__cxa_pure_virtual +248 (int (*)(...))__cxa_pure_virtual +256 (int (*)(...))__cxa_pure_virtual +264 (int (*)(...))__cxa_pure_virtual +272 (int (*)(...))__cxa_pure_virtual +280 (int (*)(...))__cxa_pure_virtual +288 (int (*)(...))__cxa_pure_virtual + +Class QStyle + size=16 align=8 + base size=16 base align=8 +QStyle (0x0x7319c39a0340) 0 + vptr=((& QStyle::_ZTV6QStyle) + 16) +QObject (0x0x7319c398bf00) 0 + primary-for QStyle (0x0x7319c39a0340) + +Class QTabBar::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTabBar::QPrivateSignal (0x0x7319c361f4e0) 0 empty + +Vtable for QTabBar +QTabBar::_ZTV7QTabBar: 70 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI7QTabBar) +16 (int (*)(...))QTabBar::metaObject +24 (int (*)(...))QTabBar::qt_metacast +32 (int (*)(...))QTabBar::qt_metacall +40 (int (*)(...))QTabBar::~QTabBar +48 (int (*)(...))QTabBar::~QTabBar +56 (int (*)(...))QTabBar::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QTabBar::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QTabBar::sizeHint +136 (int (*)(...))QTabBar::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QTabBar::mousePressEvent +176 (int (*)(...))QTabBar::mouseReleaseEvent +184 (int (*)(...))QTabBar::mouseDoubleClickEvent +192 (int (*)(...))QTabBar::mouseMoveEvent +200 (int (*)(...))QTabBar::wheelEvent +208 (int (*)(...))QTabBar::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QTabBar::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QTabBar::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QTabBar::showEvent +352 (int (*)(...))QTabBar::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QTabBar::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QTabBar::tabSizeHint +440 (int (*)(...))QTabBar::minimumTabSizeHint +448 (int (*)(...))QTabBar::tabInserted +456 (int (*)(...))QTabBar::tabRemoved +464 (int (*)(...))QTabBar::tabLayoutChange +472 (int (*)(...))QTabBar::initStyleOption +480 (int (*)(...))-16 +488 (int (*)(...))(& _ZTI7QTabBar) +496 (int (*)(...))QTabBar::_ZThn16_N7QTabBarD1Ev +504 (int (*)(...))QTabBar::_ZThn16_N7QTabBarD0Ev +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +552 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QTabBar + size=40 align=8 + base size=40 base align=8 +QTabBar (0x0x7319c39a0888) 0 + vptr=((& QTabBar::_ZTV7QTabBar) + 16) +QWidget (0x0x7319c3600a10) 0 + primary-for QTabBar (0x0x7319c39a0888) +QObject (0x0x7319c361f420) 0 + primary-for QWidget (0x0x7319c3600a10) +QPaintDevice (0x0x7319c361f480) 16 + vptr=((& QTabBar::_ZTV7QTabBar) + 496) + +Class QTabWidget::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTabWidget::QPrivateSignal (0x0x7319c361f7e0) 0 empty + +Vtable for QTabWidget +QTabWidget::_ZTV10QTabWidget: 67 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QTabWidget) +16 (int (*)(...))QTabWidget::metaObject +24 (int (*)(...))QTabWidget::qt_metacast +32 (int (*)(...))QTabWidget::qt_metacall +40 (int (*)(...))QTabWidget::~QTabWidget +48 (int (*)(...))QTabWidget::~QTabWidget +56 (int (*)(...))QTabWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QTabWidget::sizeHint +136 (int (*)(...))QTabWidget::minimumSizeHint +144 (int (*)(...))QTabWidget::heightForWidth +152 (int (*)(...))QTabWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QTabWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QTabWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QTabWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QTabWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QTabWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QTabWidget::tabInserted +440 (int (*)(...))QTabWidget::tabRemoved +448 (int (*)(...))QTabWidget::initStyleOption +456 (int (*)(...))-16 +464 (int (*)(...))(& _ZTI10QTabWidget) +472 (int (*)(...))QTabWidget::_ZThn16_N10QTabWidgetD1Ev +480 (int (*)(...))QTabWidget::_ZThn16_N10QTabWidgetD0Ev +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QTabWidget + size=40 align=8 + base size=40 base align=8 +QTabWidget (0x0x7319c39a08f0) 0 + vptr=((& QTabWidget::_ZTV10QTabWidget) + 16) +QWidget (0x0x7319c363d2a0) 0 + primary-for QTabWidget (0x0x7319c39a08f0) +QObject (0x0x7319c361f720) 0 + primary-for QWidget (0x0x7319c363d2a0) +QPaintDevice (0x0x7319c361f780) 16 + vptr=((& QTabWidget::_ZTV10QTabWidget) + 472) + +Class QRubberBand::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QRubberBand::QPrivateSignal (0x0x7319c361fba0) 0 empty + +Vtable for QRubberBand +QRubberBand::_ZTV11QRubberBand: 65 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QRubberBand) +16 (int (*)(...))QRubberBand::metaObject +24 (int (*)(...))QRubberBand::qt_metacast +32 (int (*)(...))QRubberBand::qt_metacall +40 (int (*)(...))QRubberBand::~QRubberBand +48 (int (*)(...))QRubberBand::~QRubberBand +56 (int (*)(...))QRubberBand::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QRubberBand::paintEvent +264 (int (*)(...))QRubberBand::moveEvent +272 (int (*)(...))QRubberBand::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QRubberBand::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QRubberBand::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QRubberBand::initStyleOption +440 (int (*)(...))-16 +448 (int (*)(...))(& _ZTI11QRubberBand) +456 (int (*)(...))QRubberBand::_ZThn16_N11QRubberBandD1Ev +464 (int (*)(...))QRubberBand::_ZThn16_N11QRubberBandD0Ev +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QRubberBand + size=40 align=8 + base size=40 base align=8 +QRubberBand (0x0x7319c39a0958) 0 + vptr=((& QRubberBand::_ZTV11QRubberBand) + 16) +QWidget (0x0x7319c363d8c0) 0 + primary-for QRubberBand (0x0x7319c39a0958) +QObject (0x0x7319c361fae0) 0 + primary-for QWidget (0x0x7319c363d8c0) +QPaintDevice (0x0x7319c361fb40) 16 + vptr=((& QRubberBand::_ZTV11QRubberBand) + 456) + +Class QFrame::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QFrame::QPrivateSignal (0x0x7319c3671000) 0 empty + +Vtable for QFrame +QFrame::_ZTV6QFrame: 65 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI6QFrame) +16 (int (*)(...))QFrame::metaObject +24 (int (*)(...))QFrame::qt_metacast +32 (int (*)(...))QFrame::qt_metacall +40 (int (*)(...))QFrame::~QFrame +48 (int (*)(...))QFrame::~QFrame +56 (int (*)(...))QFrame::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QFrame::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QFrame::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QFrame::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))-16 +448 (int (*)(...))(& _ZTI6QFrame) +456 (int (*)(...))QFrame::_ZThn16_N6QFrameD1Ev +464 (int (*)(...))QFrame::_ZThn16_N6QFrameD0Ev +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QFrame + size=40 align=8 + base size=40 base align=8 +QFrame (0x0x7319c39a09c0) 0 + vptr=((& QFrame::_ZTV6QFrame) + 16) +QWidget (0x0x7319c363dd90) 0 + primary-for QFrame (0x0x7319c39a09c0) +QObject (0x0x7319c361ff00) 0 + primary-for QWidget (0x0x7319c363dd90) +QPaintDevice (0x0x7319c361ff60) 16 + vptr=((& QFrame::_ZTV6QFrame) + 456) + +Class QStyleOption + size=64 align=8 + base size=64 base align=8 +QStyleOption (0x0x7319c3671840) 0 + +Class QStyleOptionFocusRect + size=80 align=8 + base size=80 base align=8 +QStyleOptionFocusRect (0x0x7319c39a0bc8) 0 +QStyleOption (0x0x7319c36718a0) 0 + +Class QStyleOptionFrame + size=80 align=8 + base size=80 base align=8 +QStyleOptionFrame (0x0x7319c39a0c30) 0 +QStyleOption (0x0x7319c3671ae0) 0 + +Class QStyleOptionTabWidgetFrame + size=136 align=8 + base size=132 base align=8 +QStyleOptionTabWidgetFrame (0x0x7319c39a0f08) 0 +QStyleOption (0x0x7319c36a5840) 0 + +Class QStyleOptionTabBarBase + size=104 align=8 + base size=101 base align=8 +QStyleOptionTabBarBase (0x0x7319c39a0f70) 0 +QStyleOption (0x0x7319c36a5a80) 0 + +Class QStyleOptionHeader + size=136 align=8 + base size=132 base align=8 +QStyleOptionHeader (0x0x7319c36b6000) 0 +QStyleOption (0x0x7319c36a5cc0) 0 + +Class QStyleOptionHeaderV2 + size=136 align=8 + base size=136 base align=8 +QStyleOptionHeaderV2 (0x0x7319c36b6068) 0 +QStyleOptionHeader (0x0x7319c36b60d0) 0 +QStyleOption (0x0x7319c36bf600) 0 + +Class QStyleOptionButton + size=112 align=8 + base size=112 base align=8 +QStyleOptionButton (0x0x7319c36b61a0) 0 +QStyleOption (0x0x7319c36bf9c0) 0 + +Class QStyleOptionTab + size=160 align=8 + base size=156 base align=8 +QStyleOptionTab (0x0x7319c36b6478) 0 +QStyleOption (0x0x7319c36e1720) 0 + +Class QStyleOptionToolBar + size=88 align=8 + base size=88 base align=8 +QStyleOptionToolBar (0x0x7319c36b6c30) 0 +QStyleOption (0x0x7319c3719cc0) 0 + +Class QStyleOptionProgressBar + size=112 align=8 + base size=111 base align=8 +QStyleOptionProgressBar (0x0x7319c36b6f08) 0 +QStyleOption (0x0x7319c3740a20) 0 + +Class QStyleOptionMenuItem + size=152 align=8 + base size=152 base align=8 +QStyleOptionMenuItem (0x0x7319c36b6f70) 0 +QStyleOption (0x0x7319c3740c60) 0 + +Class QStyleOptionMenuItemV2 + size=160 align=8 + base size=156 base align=8 +QStyleOptionMenuItemV2 (0x0x7319c3753000) 0 +QStyleOptionMenuItem (0x0x7319c3753068) 0 +QStyleOption (0x0x7319c3740ea0) 0 + +Class QStyleOptionDockWidget + size=96 align=8 + base size=92 base align=8 +QStyleOptionDockWidget (0x0x7319c3753138) 0 +QStyleOption (0x0x7319c37595a0) 0 + +Class QStyleOptionViewItem + size=208 align=8 + base size=208 base align=8 +QStyleOptionViewItem (0x0x7319c37531a0) 0 +QStyleOption (0x0x7319c37597e0) 0 + +Class QStyleOptionToolBox + size=104 align=8 + base size=104 base align=8 +QStyleOptionToolBox (0x0x7319c3753478) 0 +QStyleOption (0x0x7319c377d540) 0 + +Class QStyleOptionRubberBand + size=72 align=8 + base size=69 base align=8 +QStyleOptionRubberBand (0x0x7319c37534e0) 0 +QStyleOption (0x0x7319c377d780) 0 + +Class QStyleOptionComplex + size=72 align=8 + base size=72 base align=8 +QStyleOptionComplex (0x0x7319c3753548) 0 +QStyleOption (0x0x7319c377da20) 0 + +Class QStyleOptionSlider + size=128 align=8 + base size=128 base align=8 +QStyleOptionSlider (0x0x7319c37535b0) 0 +QStyleOptionComplex (0x0x7319c3753618) 0 +QStyleOption (0x0x7319c37923c0) 0 + +Class QStyleOptionSpinBox + size=88 align=8 + base size=81 base align=8 +QStyleOptionSpinBox (0x0x7319c37536e8) 0 +QStyleOptionComplex (0x0x7319c3753750) 0 +QStyleOption (0x0x7319c3792e40) 0 + +Class QStyleOptionToolButton + size=152 align=8 + base size=152 base align=8 +QStyleOptionToolButton (0x0x7319c3753820) 0 +QStyleOptionComplex (0x0x7319c3753888) 0 +QStyleOption (0x0x7319c37a3600) 0 + +Class QStyleOptionComboBox + size=144 align=8 + base size=140 base align=8 +QStyleOptionComboBox (0x0x7319c3753b60) 0 +QStyleOptionComplex (0x0x7319c3753bc8) 0 +QStyleOption (0x0x7319c37c2360) 0 + +Class QStyleOptionTitleBar + size=112 align=8 + base size=112 base align=8 +QStyleOptionTitleBar (0x0x7319c3753c30) 0 +QStyleOptionComplex (0x0x7319c3753c98) 0 +QStyleOption (0x0x7319c37c25a0) 0 + +Class QStyleOptionGroupBox + size=136 align=8 + base size=132 base align=8 +QStyleOptionGroupBox (0x0x7319c3753d00) 0 +QStyleOptionComplex (0x0x7319c3753d68) 0 +QStyleOption (0x0x7319c37c27e0) 0 + +Class QStyleOptionSizeGrip + size=80 align=8 + base size=76 base align=8 +QStyleOptionSizeGrip (0x0x7319c3753dd0) 0 +QStyleOptionComplex (0x0x7319c3753e38) 0 +QStyleOption (0x0x7319c37c2a20) 0 + +Class QStyleOptionGraphicsItem + size=96 align=8 + base size=96 base align=8 +QStyleOptionGraphicsItem (0x0x7319c3753ea0) 0 +QStyleOption (0x0x7319c37c2c60) 0 + +Class QStyleHintReturn + size=8 align=4 + base size=8 base align=4 +QStyleHintReturn (0x0x7319c37de000) 0 + +Class QStyleHintReturnMask + size=16 align=8 + base size=16 base align=8 +QStyleHintReturnMask (0x0x7319c3753f08) 0 +QStyleHintReturn (0x0x7319c37de060) 0 + +Class QStyleHintReturnVariant + size=40 align=8 + base size=40 base align=8 +QStyleHintReturnVariant (0x0x7319c3753680) 0 +QStyleHintReturn (0x0x7319c37de0c0) 0 + +Class QAbstractItemDelegate::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAbstractItemDelegate::QPrivateSignal (0x0x7319c37de240) 0 empty + +Vtable for QAbstractItemDelegate +QAbstractItemDelegate::_ZTV21QAbstractItemDelegate: 24 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI21QAbstractItemDelegate) +16 (int (*)(...))QAbstractItemDelegate::metaObject +24 (int (*)(...))QAbstractItemDelegate::qt_metacast +32 (int (*)(...))QAbstractItemDelegate::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))QAbstractItemDelegate::createEditor +136 (int (*)(...))QAbstractItemDelegate::destroyEditor +144 (int (*)(...))QAbstractItemDelegate::setEditorData +152 (int (*)(...))QAbstractItemDelegate::setModelData +160 (int (*)(...))QAbstractItemDelegate::updateEditorGeometry +168 (int (*)(...))QAbstractItemDelegate::editorEvent +176 (int (*)(...))QAbstractItemDelegate::helpEvent +184 (int (*)(...))QAbstractItemDelegate::paintingRoles + +Class QAbstractItemDelegate + size=16 align=8 + base size=16 base align=8 +QAbstractItemDelegate (0x0x7319c37e5068) 0 + vptr=((& QAbstractItemDelegate::_ZTV21QAbstractItemDelegate) + 16) +QObject (0x0x7319c37de1e0) 0 + primary-for QAbstractItemDelegate (0x0x7319c37e5068) + +Class QAbstractScrollArea::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAbstractScrollArea::QPrivateSignal (0x0x7319c37de480) 0 empty + +Vtable for QAbstractScrollArea +QAbstractScrollArea::_ZTV19QAbstractScrollArea: 69 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QAbstractScrollArea) +16 (int (*)(...))QAbstractScrollArea::metaObject +24 (int (*)(...))QAbstractScrollArea::qt_metacast +32 (int (*)(...))QAbstractScrollArea::qt_metacall +40 (int (*)(...))QAbstractScrollArea::~QAbstractScrollArea +48 (int (*)(...))QAbstractScrollArea::~QAbstractScrollArea +56 (int (*)(...))QAbstractScrollArea::event +64 (int (*)(...))QAbstractScrollArea::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QAbstractScrollArea::sizeHint +136 (int (*)(...))QAbstractScrollArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractScrollArea::mousePressEvent +176 (int (*)(...))QAbstractScrollArea::mouseReleaseEvent +184 (int (*)(...))QAbstractScrollArea::mouseDoubleClickEvent +192 (int (*)(...))QAbstractScrollArea::mouseMoveEvent +200 (int (*)(...))QAbstractScrollArea::wheelEvent +208 (int (*)(...))QAbstractScrollArea::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QAbstractScrollArea::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QAbstractScrollArea::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QAbstractScrollArea::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QAbstractScrollArea::dragEnterEvent +320 (int (*)(...))QAbstractScrollArea::dragMoveEvent +328 (int (*)(...))QAbstractScrollArea::dragLeaveEvent +336 (int (*)(...))QAbstractScrollArea::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QFrame::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QAbstractScrollArea::setupViewport +448 (int (*)(...))QAbstractScrollArea::viewportEvent +456 (int (*)(...))QAbstractScrollArea::scrollContentsBy +464 (int (*)(...))QAbstractScrollArea::viewportSizeHint +472 (int (*)(...))-16 +480 (int (*)(...))(& _ZTI19QAbstractScrollArea) +488 (int (*)(...))QAbstractScrollArea::_ZThn16_N19QAbstractScrollAreaD1Ev +496 (int (*)(...))QAbstractScrollArea::_ZThn16_N19QAbstractScrollAreaD0Ev +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QAbstractScrollArea + size=40 align=8 + base size=40 base align=8 +QAbstractScrollArea (0x0x7319c37e50d0) 0 + vptr=((& QAbstractScrollArea::_ZTV19QAbstractScrollArea) + 16) +QFrame (0x0x7319c37e5138) 0 + primary-for QAbstractScrollArea (0x0x7319c37e50d0) +QWidget (0x0x7319c37e8310) 0 + primary-for QFrame (0x0x7319c37e5138) +QObject (0x0x7319c37de3c0) 0 + primary-for QWidget (0x0x7319c37e8310) +QPaintDevice (0x0x7319c37de420) 16 + vptr=((& QAbstractScrollArea::_ZTV19QAbstractScrollArea) + 488) + +Class QAbstractItemView::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAbstractItemView::QPrivateSignal (0x0x7319c37de780) 0 empty + +Vtable for QAbstractItemView +QAbstractItemView::_ZTV17QAbstractItemView: 108 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QAbstractItemView) +16 (int (*)(...))QAbstractItemView::metaObject +24 (int (*)(...))QAbstractItemView::qt_metacast +32 (int (*)(...))QAbstractItemView::qt_metacall +40 0 +48 0 +56 (int (*)(...))QAbstractItemView::event +64 (int (*)(...))QAbstractItemView::eventFilter +72 (int (*)(...))QAbstractItemView::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QAbstractScrollArea::sizeHint +136 (int (*)(...))QAbstractScrollArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractItemView::mousePressEvent +176 (int (*)(...))QAbstractItemView::mouseReleaseEvent +184 (int (*)(...))QAbstractItemView::mouseDoubleClickEvent +192 (int (*)(...))QAbstractItemView::mouseMoveEvent +200 (int (*)(...))QAbstractScrollArea::wheelEvent +208 (int (*)(...))QAbstractItemView::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QAbstractItemView::focusInEvent +232 (int (*)(...))QAbstractItemView::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QAbstractScrollArea::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QAbstractItemView::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QAbstractScrollArea::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QAbstractItemView::dragEnterEvent +320 (int (*)(...))QAbstractItemView::dragMoveEvent +328 (int (*)(...))QAbstractItemView::dragLeaveEvent +336 (int (*)(...))QAbstractItemView::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QFrame::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QAbstractItemView::inputMethodEvent +416 (int (*)(...))QAbstractItemView::inputMethodQuery +424 (int (*)(...))QAbstractItemView::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QAbstractScrollArea::setupViewport +448 (int (*)(...))QAbstractItemView::viewportEvent +456 (int (*)(...))QAbstractScrollArea::scrollContentsBy +464 (int (*)(...))QAbstractItemView::viewportSizeHint +472 (int (*)(...))QAbstractItemView::setModel +480 (int (*)(...))QAbstractItemView::setSelectionModel +488 (int (*)(...))QAbstractItemView::keyboardSearch +496 (int (*)(...))__cxa_pure_virtual +504 (int (*)(...))__cxa_pure_virtual +512 (int (*)(...))__cxa_pure_virtual +520 (int (*)(...))QAbstractItemView::sizeHintForRow +528 (int (*)(...))QAbstractItemView::sizeHintForColumn +536 (int (*)(...))QAbstractItemView::itemDelegateForIndex +544 (int (*)(...))QAbstractItemView::reset +552 (int (*)(...))QAbstractItemView::setRootIndex +560 (int (*)(...))QAbstractItemView::doItemsLayout +568 (int (*)(...))QAbstractItemView::selectAll +576 (int (*)(...))QAbstractItemView::dataChanged +584 (int (*)(...))QAbstractItemView::rowsInserted +592 (int (*)(...))QAbstractItemView::rowsAboutToBeRemoved +600 (int (*)(...))QAbstractItemView::selectionChanged +608 (int (*)(...))QAbstractItemView::currentChanged +616 (int (*)(...))QAbstractItemView::updateEditorData +624 (int (*)(...))QAbstractItemView::updateEditorGeometries +632 (int (*)(...))QAbstractItemView::updateGeometries +640 (int (*)(...))QAbstractItemView::verticalScrollbarAction +648 (int (*)(...))QAbstractItemView::horizontalScrollbarAction +656 (int (*)(...))QAbstractItemView::verticalScrollbarValueChanged +664 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged +672 (int (*)(...))QAbstractItemView::closeEditor +680 (int (*)(...))QAbstractItemView::commitData +688 (int (*)(...))QAbstractItemView::editorDestroyed +696 (int (*)(...))__cxa_pure_virtual +704 (int (*)(...))__cxa_pure_virtual +712 (int (*)(...))__cxa_pure_virtual +720 (int (*)(...))__cxa_pure_virtual +728 (int (*)(...))__cxa_pure_virtual +736 (int (*)(...))__cxa_pure_virtual +744 (int (*)(...))QAbstractItemView::selectedIndexes +752 (int (*)(...))QAbstractItemView::edit +760 (int (*)(...))QAbstractItemView::selectionCommand +768 (int (*)(...))QAbstractItemView::startDrag +776 (int (*)(...))QAbstractItemView::initViewItemOption +784 (int (*)(...))-16 +792 (int (*)(...))(& _ZTI17QAbstractItemView) +800 0 +808 0 +816 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +824 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +832 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +840 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +848 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +856 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QAbstractItemView + size=40 align=8 + base size=40 base align=8 +QAbstractItemView (0x0x7319c37e51a0) 0 + vptr=((& QAbstractItemView::_ZTV17QAbstractItemView) + 16) +QAbstractScrollArea (0x0x7319c37e5208) 0 + primary-for QAbstractItemView (0x0x7319c37e51a0) +QFrame (0x0x7319c37e5270) 0 + primary-for QAbstractScrollArea (0x0x7319c37e5208) +QWidget (0x0x7319c37e8700) 0 + primary-for QFrame (0x0x7319c37e5270) +QObject (0x0x7319c37de6c0) 0 + primary-for QWidget (0x0x7319c37e8700) +QPaintDevice (0x0x7319c37de720) 16 + vptr=((& QAbstractItemView::_ZTV17QAbstractItemView) + 800) + +Vtable for QAccessibleWidget +QAccessibleWidget::_ZTV17QAccessibleWidget: 35 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QAccessibleWidget) +16 (int (*)(...))QAccessibleWidget::~QAccessibleWidget +24 (int (*)(...))QAccessibleWidget::~QAccessibleWidget +32 (int (*)(...))QAccessibleWidget::isValid +40 (int (*)(...))QAccessibleObject::object +48 (int (*)(...))QAccessibleWidget::window +56 (int (*)(...))QAccessibleWidget::relations +64 (int (*)(...))QAccessibleWidget::focusChild +72 (int (*)(...))QAccessibleObject::childAt +80 (int (*)(...))QAccessibleWidget::parent +88 (int (*)(...))QAccessibleWidget::child +96 (int (*)(...))QAccessibleWidget::childCount +104 (int (*)(...))QAccessibleWidget::indexOfChild +112 (int (*)(...))QAccessibleWidget::text +120 (int (*)(...))QAccessibleObject::setText +128 (int (*)(...))QAccessibleWidget::rect +136 (int (*)(...))QAccessibleWidget::role +144 (int (*)(...))QAccessibleWidget::state +152 (int (*)(...))QAccessibleWidget::foregroundColor +160 (int (*)(...))QAccessibleWidget::backgroundColor +168 (int (*)(...))QAccessibleInterface::virtual_hook +176 (int (*)(...))QAccessibleWidget::interface_cast +184 (int (*)(...))QAccessibleWidget::actionNames +192 (int (*)(...))QAccessibleWidget::doAction +200 (int (*)(...))QAccessibleWidget::keyBindingsForAction +208 (int (*)(...))-16 +216 (int (*)(...))(& _ZTI17QAccessibleWidget) +224 (int (*)(...))QAccessibleWidget::_ZThn16_N17QAccessibleWidgetD1Ev +232 (int (*)(...))QAccessibleWidget::_ZThn16_N17QAccessibleWidgetD0Ev +240 (int (*)(...))QAccessibleWidget::_ZThn16_NK17QAccessibleWidget11actionNamesEv +248 (int (*)(...))QAccessibleActionInterface::localizedActionName +256 (int (*)(...))QAccessibleActionInterface::localizedActionDescription +264 (int (*)(...))QAccessibleWidget::_ZThn16_N17QAccessibleWidget8doActionERK7QString +272 (int (*)(...))QAccessibleWidget::_ZThn16_NK17QAccessibleWidget20keyBindingsForActionERK7QString + +Class QAccessibleWidget + size=32 align=8 + base size=32 base align=8 +QAccessibleWidget (0x0x7319c343b690) 0 + vptr=((& QAccessibleWidget::_ZTV17QAccessibleWidget) + 16) +QAccessibleObject (0x0x7319c37e5548) 0 + primary-for QAccessibleWidget (0x0x7319c343b690) +QAccessibleInterface (0x0x7319c343e360) 0 nearly-empty + primary-for QAccessibleObject (0x0x7319c37e5548) +QAccessibleActionInterface (0x0x7319c343e3c0) 16 nearly-empty + vptr=((& QAccessibleWidget::_ZTV17QAccessibleWidget) + 224) + +Vtable for QAccessibleWidgetV2 +QAccessibleWidgetV2::_ZTV19QAccessibleWidgetV2: 43 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QAccessibleWidgetV2) +16 (int (*)(...))QAccessibleWidgetV2::~QAccessibleWidgetV2 +24 (int (*)(...))QAccessibleWidgetV2::~QAccessibleWidgetV2 +32 (int (*)(...))QAccessibleWidget::isValid +40 (int (*)(...))QAccessibleObject::object +48 (int (*)(...))QAccessibleWidget::window +56 (int (*)(...))QAccessibleWidget::relations +64 (int (*)(...))QAccessibleWidget::focusChild +72 (int (*)(...))QAccessibleObject::childAt +80 (int (*)(...))QAccessibleWidget::parent +88 (int (*)(...))QAccessibleWidget::child +96 (int (*)(...))QAccessibleWidget::childCount +104 (int (*)(...))QAccessibleWidget::indexOfChild +112 (int (*)(...))QAccessibleWidget::text +120 (int (*)(...))QAccessibleObject::setText +128 (int (*)(...))QAccessibleWidget::rect +136 (int (*)(...))QAccessibleWidget::role +144 (int (*)(...))QAccessibleWidget::state +152 (int (*)(...))QAccessibleWidget::foregroundColor +160 (int (*)(...))QAccessibleWidget::backgroundColor +168 (int (*)(...))QAccessibleInterface::virtual_hook +176 (int (*)(...))QAccessibleWidgetV2::interface_cast +184 (int (*)(...))QAccessibleWidget::actionNames +192 (int (*)(...))QAccessibleWidget::doAction +200 (int (*)(...))QAccessibleWidget::keyBindingsForAction +208 (int (*)(...))QAccessibleWidgetV2::attributeKeys +216 (int (*)(...))QAccessibleWidgetV2::attributeValue +224 (int (*)(...))-16 +232 (int (*)(...))(& _ZTI19QAccessibleWidgetV2) +240 (int (*)(...))QAccessibleWidgetV2::_ZThn16_N19QAccessibleWidgetV2D1Ev +248 (int (*)(...))QAccessibleWidgetV2::_ZThn16_N19QAccessibleWidgetV2D0Ev +256 (int (*)(...))QAccessibleWidget::_ZThn16_NK17QAccessibleWidget11actionNamesEv +264 (int (*)(...))QAccessibleActionInterface::localizedActionName +272 (int (*)(...))QAccessibleActionInterface::localizedActionDescription +280 (int (*)(...))QAccessibleWidget::_ZThn16_N17QAccessibleWidget8doActionERK7QString +288 (int (*)(...))QAccessibleWidget::_ZThn16_NK17QAccessibleWidget20keyBindingsForActionERK7QString +296 (int (*)(...))-32 +304 (int (*)(...))(& _ZTI19QAccessibleWidgetV2) +312 (int (*)(...))QAccessibleWidgetV2::_ZThn32_N19QAccessibleWidgetV2D1Ev +320 (int (*)(...))QAccessibleWidgetV2::_ZThn32_N19QAccessibleWidgetV2D0Ev +328 (int (*)(...))QAccessibleWidgetV2::_ZThn32_NK19QAccessibleWidgetV213attributeKeysEv +336 (int (*)(...))QAccessibleWidgetV2::_ZThn32_NK19QAccessibleWidgetV214attributeValueEN11QAccessible9AttributeE + +Class QAccessibleWidgetV2 + size=40 align=8 + base size=40 base align=8 +QAccessibleWidgetV2 (0x0x7319c343b700) 0 + vptr=((& QAccessibleWidgetV2::_ZTV19QAccessibleWidgetV2) + 16) +QAccessibleWidget (0x0x7319c343b770) 0 + primary-for QAccessibleWidgetV2 (0x0x7319c343b700) +QAccessibleObject (0x0x7319c37e55b0) 0 + primary-for QAccessibleWidget (0x0x7319c343b770) +QAccessibleInterface (0x0x7319c343e480) 0 nearly-empty + primary-for QAccessibleObject (0x0x7319c37e55b0) +QAccessibleActionInterface (0x0x7319c343e4e0) 16 nearly-empty + vptr=((& QAccessibleWidgetV2::_ZTV19QAccessibleWidgetV2) + 240) +QAccessibleAttributesInterface (0x0x7319c343e540) 32 nearly-empty + vptr=((& QAccessibleWidgetV2::_ZTV19QAccessibleWidgetV2) + 312) + +Class QApplication::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QApplication::QPrivateSignal (0x0x7319c343e660) 0 empty + +Vtable for QApplication +QApplication::_ZTV12QApplication: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QApplication) +16 (int (*)(...))QApplication::metaObject +24 (int (*)(...))QApplication::qt_metacast +32 (int (*)(...))QApplication::qt_metacall +40 (int (*)(...))QApplication::~QApplication +48 (int (*)(...))QApplication::~QApplication +56 (int (*)(...))QApplication::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QApplication::notify +120 (int (*)(...))QApplication::compressEvent + +Class QApplication + size=16 align=8 + base size=16 base align=8 +QApplication (0x0x7319c37e5618) 0 + vptr=((& QApplication::_ZTV12QApplication) + 16) +QGuiApplication (0x0x7319c37e5680) 0 + primary-for QApplication (0x0x7319c37e5618) +QCoreApplication (0x0x7319c37e56e8) 0 + primary-for QGuiApplication (0x0x7319c37e5680) +QObject (0x0x7319c343e600) 0 + primary-for QCoreApplication (0x0x7319c37e56e8) + +Vtable for QLayoutItem +QLayoutItem::_ZTV11QLayoutItem: 19 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QLayoutItem) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))QLayoutItem::hasHeightForWidth +96 (int (*)(...))QLayoutItem::heightForWidth +104 (int (*)(...))QLayoutItem::minimumHeightForWidth +112 (int (*)(...))QLayoutItem::invalidate +120 (int (*)(...))QLayoutItem::widget +128 (int (*)(...))QLayoutItem::layout +136 (int (*)(...))QLayoutItem::spacerItem +144 (int (*)(...))QLayoutItem::controlTypes + +Class QLayoutItem + size=16 align=8 + base size=12 base align=8 +QLayoutItem (0x0x7319c343e900) 0 + vptr=((& QLayoutItem::_ZTV11QLayoutItem) + 16) + +Vtable for QSpacerItem +QSpacerItem::_ZTV11QSpacerItem: 19 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QSpacerItem) +16 (int (*)(...))QSpacerItem::~QSpacerItem +24 (int (*)(...))QSpacerItem::~QSpacerItem +32 (int (*)(...))QSpacerItem::sizeHint +40 (int (*)(...))QSpacerItem::minimumSize +48 (int (*)(...))QSpacerItem::maximumSize +56 (int (*)(...))QSpacerItem::expandingDirections +64 (int (*)(...))QSpacerItem::setGeometry +72 (int (*)(...))QSpacerItem::geometry +80 (int (*)(...))QSpacerItem::isEmpty +88 (int (*)(...))QLayoutItem::hasHeightForWidth +96 (int (*)(...))QLayoutItem::heightForWidth +104 (int (*)(...))QLayoutItem::minimumHeightForWidth +112 (int (*)(...))QLayoutItem::invalidate +120 (int (*)(...))QLayoutItem::widget +128 (int (*)(...))QLayoutItem::layout +136 (int (*)(...))QSpacerItem::spacerItem +144 (int (*)(...))QLayoutItem::controlTypes + +Class QSpacerItem + size=40 align=8 + base size=40 base align=8 +QSpacerItem (0x0x7319c37e5750) 0 + vptr=((& QSpacerItem::_ZTV11QSpacerItem) + 16) +QLayoutItem (0x0x7319c343eb40) 0 + primary-for QSpacerItem (0x0x7319c37e5750) + +Vtable for QWidgetItem +QWidgetItem::_ZTV11QWidgetItem: 19 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QWidgetItem) +16 (int (*)(...))QWidgetItem::~QWidgetItem +24 (int (*)(...))QWidgetItem::~QWidgetItem +32 (int (*)(...))QWidgetItem::sizeHint +40 (int (*)(...))QWidgetItem::minimumSize +48 (int (*)(...))QWidgetItem::maximumSize +56 (int (*)(...))QWidgetItem::expandingDirections +64 (int (*)(...))QWidgetItem::setGeometry +72 (int (*)(...))QWidgetItem::geometry +80 (int (*)(...))QWidgetItem::isEmpty +88 (int (*)(...))QWidgetItem::hasHeightForWidth +96 (int (*)(...))QWidgetItem::heightForWidth +104 (int (*)(...))QWidgetItem::minimumHeightForWidth +112 (int (*)(...))QLayoutItem::invalidate +120 (int (*)(...))QWidgetItem::widget +128 (int (*)(...))QLayoutItem::layout +136 (int (*)(...))QLayoutItem::spacerItem +144 (int (*)(...))QWidgetItem::controlTypes + +Class QWidgetItem + size=24 align=8 + base size=24 base align=8 +QWidgetItem (0x0x7319c37e57b8) 0 + vptr=((& QWidgetItem::_ZTV11QWidgetItem) + 16) +QLayoutItem (0x0x7319c343ed80) 0 + primary-for QWidgetItem (0x0x7319c37e57b8) + +Vtable for QWidgetItemV2 +QWidgetItemV2::_ZTV13QWidgetItemV2: 19 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QWidgetItemV2) +16 (int (*)(...))QWidgetItemV2::~QWidgetItemV2 +24 (int (*)(...))QWidgetItemV2::~QWidgetItemV2 +32 (int (*)(...))QWidgetItemV2::sizeHint +40 (int (*)(...))QWidgetItemV2::minimumSize +48 (int (*)(...))QWidgetItemV2::maximumSize +56 (int (*)(...))QWidgetItem::expandingDirections +64 (int (*)(...))QWidgetItem::setGeometry +72 (int (*)(...))QWidgetItem::geometry +80 (int (*)(...))QWidgetItem::isEmpty +88 (int (*)(...))QWidgetItem::hasHeightForWidth +96 (int (*)(...))QWidgetItemV2::heightForWidth +104 (int (*)(...))QWidgetItem::minimumHeightForWidth +112 (int (*)(...))QLayoutItem::invalidate +120 (int (*)(...))QWidgetItem::widget +128 (int (*)(...))QLayoutItem::layout +136 (int (*)(...))QLayoutItem::spacerItem +144 (int (*)(...))QWidgetItem::controlTypes + +Class QWidgetItemV2 + size=88 align=8 + base size=88 base align=8 +QWidgetItemV2 (0x0x7319c37e5820) 0 + vptr=((& QWidgetItemV2::_ZTV13QWidgetItemV2) + 16) +QWidgetItem (0x0x7319c37e5888) 0 + primary-for QWidgetItemV2 (0x0x7319c37e5820) +QLayoutItem (0x0x7319c343ef60) 0 + primary-for QWidgetItem (0x0x7319c37e5888) + +Class QLayout::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QLayout::QPrivateSignal (0x0x7319c3470120) 0 empty + +Vtable for QLayout +QLayout::_ZTV7QLayout: 51 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI7QLayout) +16 (int (*)(...))QLayout::metaObject +24 (int (*)(...))QLayout::qt_metacast +32 (int (*)(...))QLayout::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QLayout::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QLayout::spacing +120 (int (*)(...))QLayout::setSpacing +128 (int (*)(...))QLayout::invalidate +136 (int (*)(...))QLayout::geometry +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))QLayout::expandingDirections +160 (int (*)(...))QLayout::minimumSize +168 (int (*)(...))QLayout::maximumSize +176 (int (*)(...))QLayout::setGeometry +184 (int (*)(...))__cxa_pure_virtual +192 (int (*)(...))__cxa_pure_virtual +200 (int (*)(...))QLayout::indexOf +208 (int (*)(...))QLayout::indexOf +216 (int (*)(...))__cxa_pure_virtual +224 (int (*)(...))QLayout::isEmpty +232 (int (*)(...))QLayout::controlTypes +240 (int (*)(...))QLayout::replaceWidget +248 (int (*)(...))QLayout::layout +256 (int (*)(...))-16 +264 (int (*)(...))(& _ZTI7QLayout) +272 0 +280 0 +288 (int (*)(...))__cxa_pure_virtual +296 (int (*)(...))QLayout::_ZThn16_NK7QLayout11minimumSizeEv +304 (int (*)(...))QLayout::_ZThn16_NK7QLayout11maximumSizeEv +312 (int (*)(...))QLayout::_ZThn16_NK7QLayout19expandingDirectionsEv +320 (int (*)(...))QLayout::_ZThn16_N7QLayout11setGeometryERK5QRect +328 (int (*)(...))QLayout::_ZThn16_NK7QLayout8geometryEv +336 (int (*)(...))QLayout::_ZThn16_NK7QLayout7isEmptyEv +344 (int (*)(...))QLayoutItem::hasHeightForWidth +352 (int (*)(...))QLayoutItem::heightForWidth +360 (int (*)(...))QLayoutItem::minimumHeightForWidth +368 (int (*)(...))QLayout::_ZThn16_N7QLayout10invalidateEv +376 (int (*)(...))QLayoutItem::widget +384 (int (*)(...))QLayout::_ZThn16_N7QLayout6layoutEv +392 (int (*)(...))QLayoutItem::spacerItem +400 (int (*)(...))QLayout::_ZThn16_NK7QLayout12controlTypesEv + +Class QLayout + size=32 align=8 + base size=28 base align=8 +QLayout (0x0x7319c346d1c0) 0 + vptr=((& QLayout::_ZTV7QLayout) + 16) +QObject (0x0x7319c3470060) 0 + primary-for QLayout (0x0x7319c346d1c0) +QLayoutItem (0x0x7319c34700c0) 16 + vptr=((& QLayout::_ZTV7QLayout) + 272) + +Class QGridLayout::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGridLayout::QPrivateSignal (0x0x7319c3470420) 0 empty + +Vtable for QGridLayout +QGridLayout::_ZTV11QGridLayout: 55 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QGridLayout) +16 (int (*)(...))QGridLayout::metaObject +24 (int (*)(...))QGridLayout::qt_metacast +32 (int (*)(...))QGridLayout::qt_metacall +40 (int (*)(...))QGridLayout::~QGridLayout +48 (int (*)(...))QGridLayout::~QGridLayout +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QLayout::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QGridLayout::spacing +120 (int (*)(...))QGridLayout::setSpacing +128 (int (*)(...))QGridLayout::invalidate +136 (int (*)(...))QLayout::geometry +144 (int (*)(...))QGridLayout::addItem +152 (int (*)(...))QGridLayout::expandingDirections +160 (int (*)(...))QGridLayout::minimumSize +168 (int (*)(...))QGridLayout::maximumSize +176 (int (*)(...))QGridLayout::setGeometry +184 (int (*)(...))QGridLayout::itemAt +192 (int (*)(...))QGridLayout::takeAt +200 (int (*)(...))QLayout::indexOf +208 (int (*)(...))QLayout::indexOf +216 (int (*)(...))QGridLayout::count +224 (int (*)(...))QLayout::isEmpty +232 (int (*)(...))QLayout::controlTypes +240 (int (*)(...))QLayout::replaceWidget +248 (int (*)(...))QLayout::layout +256 (int (*)(...))QGridLayout::sizeHint +264 (int (*)(...))QGridLayout::hasHeightForWidth +272 (int (*)(...))QGridLayout::heightForWidth +280 (int (*)(...))QGridLayout::minimumHeightForWidth +288 (int (*)(...))-16 +296 (int (*)(...))(& _ZTI11QGridLayout) +304 (int (*)(...))QGridLayout::_ZThn16_N11QGridLayoutD1Ev +312 (int (*)(...))QGridLayout::_ZThn16_N11QGridLayoutD0Ev +320 (int (*)(...))QGridLayout::_ZThn16_NK11QGridLayout8sizeHintEv +328 (int (*)(...))QGridLayout::_ZThn16_NK11QGridLayout11minimumSizeEv +336 (int (*)(...))QGridLayout::_ZThn16_NK11QGridLayout11maximumSizeEv +344 (int (*)(...))QGridLayout::_ZThn16_NK11QGridLayout19expandingDirectionsEv +352 (int (*)(...))QGridLayout::_ZThn16_N11QGridLayout11setGeometryERK5QRect +360 (int (*)(...))QLayout::_ZThn16_NK7QLayout8geometryEv +368 (int (*)(...))QLayout::_ZThn16_NK7QLayout7isEmptyEv +376 (int (*)(...))QGridLayout::_ZThn16_NK11QGridLayout17hasHeightForWidthEv +384 (int (*)(...))QGridLayout::_ZThn16_NK11QGridLayout14heightForWidthEi +392 (int (*)(...))QGridLayout::_ZThn16_NK11QGridLayout21minimumHeightForWidthEi +400 (int (*)(...))QGridLayout::_ZThn16_N11QGridLayout10invalidateEv +408 (int (*)(...))QLayoutItem::widget +416 (int (*)(...))QLayout::_ZThn16_N7QLayout6layoutEv +424 (int (*)(...))QLayoutItem::spacerItem +432 (int (*)(...))QLayout::_ZThn16_NK7QLayout12controlTypesEv + +Class QGridLayout + size=32 align=8 + base size=28 base align=8 +QGridLayout (0x0x7319c37e58f0) 0 + vptr=((& QGridLayout::_ZTV11QGridLayout) + 16) +QLayout (0x0x7319c346d700) 0 + primary-for QGridLayout (0x0x7319c37e58f0) +QObject (0x0x7319c3470360) 0 + primary-for QLayout (0x0x7319c346d700) +QLayoutItem (0x0x7319c34703c0) 16 + vptr=((& QGridLayout::_ZTV11QGridLayout) + 304) + +Class QBoxLayout::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QBoxLayout::QPrivateSignal (0x0x7319c34706c0) 0 empty + +Vtable for QBoxLayout +QBoxLayout::_ZTV10QBoxLayout: 55 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QBoxLayout) +16 (int (*)(...))QBoxLayout::metaObject +24 (int (*)(...))QBoxLayout::qt_metacast +32 (int (*)(...))QBoxLayout::qt_metacall +40 (int (*)(...))QBoxLayout::~QBoxLayout +48 (int (*)(...))QBoxLayout::~QBoxLayout +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QLayout::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QBoxLayout::spacing +120 (int (*)(...))QBoxLayout::setSpacing +128 (int (*)(...))QBoxLayout::invalidate +136 (int (*)(...))QLayout::geometry +144 (int (*)(...))QBoxLayout::addItem +152 (int (*)(...))QBoxLayout::expandingDirections +160 (int (*)(...))QBoxLayout::minimumSize +168 (int (*)(...))QBoxLayout::maximumSize +176 (int (*)(...))QBoxLayout::setGeometry +184 (int (*)(...))QBoxLayout::itemAt +192 (int (*)(...))QBoxLayout::takeAt +200 (int (*)(...))QLayout::indexOf +208 (int (*)(...))QLayout::indexOf +216 (int (*)(...))QBoxLayout::count +224 (int (*)(...))QLayout::isEmpty +232 (int (*)(...))QLayout::controlTypes +240 (int (*)(...))QLayout::replaceWidget +248 (int (*)(...))QLayout::layout +256 (int (*)(...))QBoxLayout::sizeHint +264 (int (*)(...))QBoxLayout::hasHeightForWidth +272 (int (*)(...))QBoxLayout::heightForWidth +280 (int (*)(...))QBoxLayout::minimumHeightForWidth +288 (int (*)(...))-16 +296 (int (*)(...))(& _ZTI10QBoxLayout) +304 (int (*)(...))QBoxLayout::_ZThn16_N10QBoxLayoutD1Ev +312 (int (*)(...))QBoxLayout::_ZThn16_N10QBoxLayoutD0Ev +320 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout8sizeHintEv +328 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout11minimumSizeEv +336 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout11maximumSizeEv +344 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout19expandingDirectionsEv +352 (int (*)(...))QBoxLayout::_ZThn16_N10QBoxLayout11setGeometryERK5QRect +360 (int (*)(...))QLayout::_ZThn16_NK7QLayout8geometryEv +368 (int (*)(...))QLayout::_ZThn16_NK7QLayout7isEmptyEv +376 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout17hasHeightForWidthEv +384 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout14heightForWidthEi +392 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout21minimumHeightForWidthEi +400 (int (*)(...))QBoxLayout::_ZThn16_N10QBoxLayout10invalidateEv +408 (int (*)(...))QLayoutItem::widget +416 (int (*)(...))QLayout::_ZThn16_N7QLayout6layoutEv +424 (int (*)(...))QLayoutItem::spacerItem +432 (int (*)(...))QLayout::_ZThn16_NK7QLayout12controlTypesEv + +Class QBoxLayout + size=32 align=8 + base size=28 base align=8 +QBoxLayout (0x0x7319c37e5958) 0 + vptr=((& QBoxLayout::_ZTV10QBoxLayout) + 16) +QLayout (0x0x7319c346d930) 0 + primary-for QBoxLayout (0x0x7319c37e5958) +QObject (0x0x7319c3470600) 0 + primary-for QLayout (0x0x7319c346d930) +QLayoutItem (0x0x7319c3470660) 16 + vptr=((& QBoxLayout::_ZTV10QBoxLayout) + 304) + +Class QHBoxLayout::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QHBoxLayout::QPrivateSignal (0x0x7319c3470900) 0 empty + +Vtable for QHBoxLayout +QHBoxLayout::_ZTV11QHBoxLayout: 55 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QHBoxLayout) +16 (int (*)(...))QHBoxLayout::metaObject +24 (int (*)(...))QHBoxLayout::qt_metacast +32 (int (*)(...))QHBoxLayout::qt_metacall +40 (int (*)(...))QHBoxLayout::~QHBoxLayout +48 (int (*)(...))QHBoxLayout::~QHBoxLayout +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QLayout::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QBoxLayout::spacing +120 (int (*)(...))QBoxLayout::setSpacing +128 (int (*)(...))QBoxLayout::invalidate +136 (int (*)(...))QLayout::geometry +144 (int (*)(...))QBoxLayout::addItem +152 (int (*)(...))QBoxLayout::expandingDirections +160 (int (*)(...))QBoxLayout::minimumSize +168 (int (*)(...))QBoxLayout::maximumSize +176 (int (*)(...))QBoxLayout::setGeometry +184 (int (*)(...))QBoxLayout::itemAt +192 (int (*)(...))QBoxLayout::takeAt +200 (int (*)(...))QLayout::indexOf +208 (int (*)(...))QLayout::indexOf +216 (int (*)(...))QBoxLayout::count +224 (int (*)(...))QLayout::isEmpty +232 (int (*)(...))QLayout::controlTypes +240 (int (*)(...))QLayout::replaceWidget +248 (int (*)(...))QLayout::layout +256 (int (*)(...))QBoxLayout::sizeHint +264 (int (*)(...))QBoxLayout::hasHeightForWidth +272 (int (*)(...))QBoxLayout::heightForWidth +280 (int (*)(...))QBoxLayout::minimumHeightForWidth +288 (int (*)(...))-16 +296 (int (*)(...))(& _ZTI11QHBoxLayout) +304 (int (*)(...))QHBoxLayout::_ZThn16_N11QHBoxLayoutD1Ev +312 (int (*)(...))QHBoxLayout::_ZThn16_N11QHBoxLayoutD0Ev +320 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout8sizeHintEv +328 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout11minimumSizeEv +336 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout11maximumSizeEv +344 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout19expandingDirectionsEv +352 (int (*)(...))QBoxLayout::_ZThn16_N10QBoxLayout11setGeometryERK5QRect +360 (int (*)(...))QLayout::_ZThn16_NK7QLayout8geometryEv +368 (int (*)(...))QLayout::_ZThn16_NK7QLayout7isEmptyEv +376 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout17hasHeightForWidthEv +384 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout14heightForWidthEi +392 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout21minimumHeightForWidthEi +400 (int (*)(...))QBoxLayout::_ZThn16_N10QBoxLayout10invalidateEv +408 (int (*)(...))QLayoutItem::widget +416 (int (*)(...))QLayout::_ZThn16_N7QLayout6layoutEv +424 (int (*)(...))QLayoutItem::spacerItem +432 (int (*)(...))QLayout::_ZThn16_NK7QLayout12controlTypesEv + +Class QHBoxLayout + size=32 align=8 + base size=28 base align=8 +QHBoxLayout (0x0x7319c37e59c0) 0 + vptr=((& QHBoxLayout::_ZTV11QHBoxLayout) + 16) +QBoxLayout (0x0x7319c37e5a28) 0 + primary-for QHBoxLayout (0x0x7319c37e59c0) +QLayout (0x0x7319c346dd90) 0 + primary-for QBoxLayout (0x0x7319c37e5a28) +QObject (0x0x7319c3470840) 0 + primary-for QLayout (0x0x7319c346dd90) +QLayoutItem (0x0x7319c34708a0) 16 + vptr=((& QHBoxLayout::_ZTV11QHBoxLayout) + 304) + +Class QVBoxLayout::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QVBoxLayout::QPrivateSignal (0x0x7319c3470a80) 0 empty + +Vtable for QVBoxLayout +QVBoxLayout::_ZTV11QVBoxLayout: 55 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QVBoxLayout) +16 (int (*)(...))QVBoxLayout::metaObject +24 (int (*)(...))QVBoxLayout::qt_metacast +32 (int (*)(...))QVBoxLayout::qt_metacall +40 (int (*)(...))QVBoxLayout::~QVBoxLayout +48 (int (*)(...))QVBoxLayout::~QVBoxLayout +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QLayout::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QBoxLayout::spacing +120 (int (*)(...))QBoxLayout::setSpacing +128 (int (*)(...))QBoxLayout::invalidate +136 (int (*)(...))QLayout::geometry +144 (int (*)(...))QBoxLayout::addItem +152 (int (*)(...))QBoxLayout::expandingDirections +160 (int (*)(...))QBoxLayout::minimumSize +168 (int (*)(...))QBoxLayout::maximumSize +176 (int (*)(...))QBoxLayout::setGeometry +184 (int (*)(...))QBoxLayout::itemAt +192 (int (*)(...))QBoxLayout::takeAt +200 (int (*)(...))QLayout::indexOf +208 (int (*)(...))QLayout::indexOf +216 (int (*)(...))QBoxLayout::count +224 (int (*)(...))QLayout::isEmpty +232 (int (*)(...))QLayout::controlTypes +240 (int (*)(...))QLayout::replaceWidget +248 (int (*)(...))QLayout::layout +256 (int (*)(...))QBoxLayout::sizeHint +264 (int (*)(...))QBoxLayout::hasHeightForWidth +272 (int (*)(...))QBoxLayout::heightForWidth +280 (int (*)(...))QBoxLayout::minimumHeightForWidth +288 (int (*)(...))-16 +296 (int (*)(...))(& _ZTI11QVBoxLayout) +304 (int (*)(...))QVBoxLayout::_ZThn16_N11QVBoxLayoutD1Ev +312 (int (*)(...))QVBoxLayout::_ZThn16_N11QVBoxLayoutD0Ev +320 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout8sizeHintEv +328 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout11minimumSizeEv +336 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout11maximumSizeEv +344 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout19expandingDirectionsEv +352 (int (*)(...))QBoxLayout::_ZThn16_N10QBoxLayout11setGeometryERK5QRect +360 (int (*)(...))QLayout::_ZThn16_NK7QLayout8geometryEv +368 (int (*)(...))QLayout::_ZThn16_NK7QLayout7isEmptyEv +376 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout17hasHeightForWidthEv +384 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout14heightForWidthEi +392 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout21minimumHeightForWidthEi +400 (int (*)(...))QBoxLayout::_ZThn16_N10QBoxLayout10invalidateEv +408 (int (*)(...))QLayoutItem::widget +416 (int (*)(...))QLayout::_ZThn16_N7QLayout6layoutEv +424 (int (*)(...))QLayoutItem::spacerItem +432 (int (*)(...))QLayout::_ZThn16_NK7QLayout12controlTypesEv + +Class QVBoxLayout + size=32 align=8 + base size=28 base align=8 +QVBoxLayout (0x0x7319c37e5a90) 0 + vptr=((& QVBoxLayout::_ZTV11QVBoxLayout) + 16) +QBoxLayout (0x0x7319c37e5af8) 0 + primary-for QVBoxLayout (0x0x7319c37e5a90) +QLayout (0x0x7319c346de70) 0 + primary-for QBoxLayout (0x0x7319c37e5af8) +QObject (0x0x7319c34709c0) 0 + primary-for QLayout (0x0x7319c346de70) +QLayoutItem (0x0x7319c3470a20) 16 + vptr=((& QVBoxLayout::_ZTV11QVBoxLayout) + 304) + +Class QButtonGroup::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QButtonGroup::QPrivateSignal (0x0x7319c3470ba0) 0 empty + +Vtable for QButtonGroup +QButtonGroup::_ZTV12QButtonGroup: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QButtonGroup) +16 (int (*)(...))QButtonGroup::metaObject +24 (int (*)(...))QButtonGroup::qt_metacast +32 (int (*)(...))QButtonGroup::qt_metacall +40 (int (*)(...))QButtonGroup::~QButtonGroup +48 (int (*)(...))QButtonGroup::~QButtonGroup +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QButtonGroup + size=16 align=8 + base size=16 base align=8 +QButtonGroup (0x0x7319c37e5b60) 0 + vptr=((& QButtonGroup::_ZTV12QButtonGroup) + 16) +QObject (0x0x7319c3470b40) 0 + primary-for QButtonGroup (0x0x7319c37e5b60) + +Class QCalendarWidget::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QCalendarWidget::QPrivateSignal (0x0x7319c3470de0) 0 empty + +Vtable for QCalendarWidget +QCalendarWidget::_ZTV15QCalendarWidget: 65 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QCalendarWidget) +16 (int (*)(...))QCalendarWidget::metaObject +24 (int (*)(...))QCalendarWidget::qt_metacast +32 (int (*)(...))QCalendarWidget::qt_metacall +40 (int (*)(...))QCalendarWidget::~QCalendarWidget +48 (int (*)(...))QCalendarWidget::~QCalendarWidget +56 (int (*)(...))QCalendarWidget::event +64 (int (*)(...))QCalendarWidget::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QCalendarWidget::sizeHint +136 (int (*)(...))QCalendarWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QCalendarWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QCalendarWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QCalendarWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QCalendarWidget::paintCell +440 (int (*)(...))-16 +448 (int (*)(...))(& _ZTI15QCalendarWidget) +456 (int (*)(...))QCalendarWidget::_ZThn16_N15QCalendarWidgetD1Ev +464 (int (*)(...))QCalendarWidget::_ZThn16_N15QCalendarWidgetD0Ev +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QCalendarWidget + size=40 align=8 + base size=40 base align=8 +QCalendarWidget (0x0x7319c37e5bc8) 0 + vptr=((& QCalendarWidget::_ZTV15QCalendarWidget) + 16) +QWidget (0x0x7319c34b40e0) 0 + primary-for QCalendarWidget (0x0x7319c37e5bc8) +QObject (0x0x7319c3470d20) 0 + primary-for QWidget (0x0x7319c34b40e0) +QPaintDevice (0x0x7319c3470d80) 16 + vptr=((& QCalendarWidget::_ZTV15QCalendarWidget) + 456) + +Class QCheckBox::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QCheckBox::QPrivateSignal (0x0x7319c34c82a0) 0 empty + +Vtable for QCheckBox +QCheckBox::_ZTV9QCheckBox: 68 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QCheckBox) +16 (int (*)(...))QCheckBox::metaObject +24 (int (*)(...))QCheckBox::qt_metacast +32 (int (*)(...))QCheckBox::qt_metacall +40 (int (*)(...))QCheckBox::~QCheckBox +48 (int (*)(...))QCheckBox::~QCheckBox +56 (int (*)(...))QCheckBox::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QAbstractButton::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QCheckBox::sizeHint +136 (int (*)(...))QCheckBox::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractButton::mousePressEvent +176 (int (*)(...))QAbstractButton::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QCheckBox::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QAbstractButton::keyPressEvent +216 (int (*)(...))QAbstractButton::keyReleaseEvent +224 (int (*)(...))QAbstractButton::focusInEvent +232 (int (*)(...))QAbstractButton::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QCheckBox::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QAbstractButton::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QCheckBox::hitButton +440 (int (*)(...))QCheckBox::checkStateSet +448 (int (*)(...))QCheckBox::nextCheckState +456 (int (*)(...))QCheckBox::initStyleOption +464 (int (*)(...))-16 +472 (int (*)(...))(& _ZTI9QCheckBox) +480 (int (*)(...))QCheckBox::_ZThn16_N9QCheckBoxD1Ev +488 (int (*)(...))QCheckBox::_ZThn16_N9QCheckBoxD0Ev +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QCheckBox + size=40 align=8 + base size=40 base align=8 +QCheckBox (0x0x7319c37e5c30) 0 + vptr=((& QCheckBox::_ZTV9QCheckBox) + 16) +QAbstractButton (0x0x7319c37e5c98) 0 + primary-for QCheckBox (0x0x7319c37e5c30) +QWidget (0x0x7319c34b48c0) 0 + primary-for QAbstractButton (0x0x7319c37e5c98) +QObject (0x0x7319c34c81e0) 0 + primary-for QWidget (0x0x7319c34b48c0) +QPaintDevice (0x0x7319c34c8240) 16 + vptr=((& QCheckBox::_ZTV9QCheckBox) + 480) + +Class QDialog::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDialog::QPrivateSignal (0x0x7319c34c84e0) 0 empty + +Vtable for QDialog +QDialog::_ZTV7QDialog: 69 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI7QDialog) +16 (int (*)(...))QDialog::metaObject +24 (int (*)(...))QDialog::qt_metacast +32 (int (*)(...))QDialog::qt_metacall +40 (int (*)(...))QDialog::~QDialog +48 (int (*)(...))QDialog::~QDialog +56 (int (*)(...))QWidget::event +64 (int (*)(...))QDialog::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QDialog::setVisible +128 (int (*)(...))QDialog::sizeHint +136 (int (*)(...))QDialog::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QDialog::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QDialog::resizeEvent +280 (int (*)(...))QDialog::closeEvent +288 (int (*)(...))QDialog::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QDialog::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDialog::open +440 (int (*)(...))QDialog::exec +448 (int (*)(...))QDialog::done +456 (int (*)(...))QDialog::accept +464 (int (*)(...))QDialog::reject +472 (int (*)(...))-16 +480 (int (*)(...))(& _ZTI7QDialog) +488 (int (*)(...))QDialog::_ZThn16_N7QDialogD1Ev +496 (int (*)(...))QDialog::_ZThn16_N7QDialogD0Ev +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QDialog + size=40 align=8 + base size=40 base align=8 +QDialog (0x0x7319c37e5d00) 0 + vptr=((& QDialog::_ZTV7QDialog) + 16) +QWidget (0x0x7319c34b4a80) 0 + primary-for QDialog (0x0x7319c37e5d00) +QObject (0x0x7319c34c8420) 0 + primary-for QWidget (0x0x7319c34b4a80) +QPaintDevice (0x0x7319c34c8480) 16 + vptr=((& QDialog::_ZTV7QDialog) + 488) + +Class QColorDialog::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QColorDialog::QPrivateSignal (0x0x7319c34c87e0) 0 empty + +Vtable for QColorDialog +QColorDialog::_ZTV12QColorDialog: 69 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QColorDialog) +16 (int (*)(...))QColorDialog::metaObject +24 (int (*)(...))QColorDialog::qt_metacast +32 (int (*)(...))QColorDialog::qt_metacall +40 (int (*)(...))QColorDialog::~QColorDialog +48 (int (*)(...))QColorDialog::~QColorDialog +56 (int (*)(...))QWidget::event +64 (int (*)(...))QDialog::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QColorDialog::setVisible +128 (int (*)(...))QDialog::sizeHint +136 (int (*)(...))QDialog::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QDialog::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QDialog::resizeEvent +280 (int (*)(...))QDialog::closeEvent +288 (int (*)(...))QDialog::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QDialog::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QColorDialog::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDialog::open +440 (int (*)(...))QDialog::exec +448 (int (*)(...))QColorDialog::done +456 (int (*)(...))QDialog::accept +464 (int (*)(...))QDialog::reject +472 (int (*)(...))-16 +480 (int (*)(...))(& _ZTI12QColorDialog) +488 (int (*)(...))QColorDialog::_ZThn16_N12QColorDialogD1Ev +496 (int (*)(...))QColorDialog::_ZThn16_N12QColorDialogD0Ev +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QColorDialog + size=40 align=8 + base size=40 base align=8 +QColorDialog (0x0x7319c37e5d68) 0 + vptr=((& QColorDialog::_ZTV12QColorDialog) + 16) +QDialog (0x0x7319c37e5dd0) 0 + primary-for QColorDialog (0x0x7319c37e5d68) +QWidget (0x0x7319c34b4e00) 0 + primary-for QDialog (0x0x7319c37e5dd0) +QObject (0x0x7319c34c8720) 0 + primary-for QWidget (0x0x7319c34b4e00) +QPaintDevice (0x0x7319c34c8780) 16 + vptr=((& QColorDialog::_ZTV12QColorDialog) + 488) + +Class QColormap + size=8 align=8 + base size=8 base align=8 +QColormap (0x0x7319c3503540) 0 + +Class QColumnView::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QColumnView::QPrivateSignal (0x0x7319c3503660) 0 empty + +Vtable for QColumnView +QColumnView::_ZTV11QColumnView: 109 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QColumnView) +16 (int (*)(...))QColumnView::metaObject +24 (int (*)(...))QColumnView::qt_metacast +32 (int (*)(...))QColumnView::qt_metacall +40 (int (*)(...))QColumnView::~QColumnView +48 (int (*)(...))QColumnView::~QColumnView +56 (int (*)(...))QAbstractItemView::event +64 (int (*)(...))QAbstractItemView::eventFilter +72 (int (*)(...))QAbstractItemView::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QColumnView::sizeHint +136 (int (*)(...))QAbstractScrollArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractItemView::mousePressEvent +176 (int (*)(...))QAbstractItemView::mouseReleaseEvent +184 (int (*)(...))QAbstractItemView::mouseDoubleClickEvent +192 (int (*)(...))QAbstractItemView::mouseMoveEvent +200 (int (*)(...))QAbstractScrollArea::wheelEvent +208 (int (*)(...))QAbstractItemView::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QAbstractItemView::focusInEvent +232 (int (*)(...))QAbstractItemView::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QAbstractScrollArea::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QColumnView::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QAbstractScrollArea::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QAbstractItemView::dragEnterEvent +320 (int (*)(...))QAbstractItemView::dragMoveEvent +328 (int (*)(...))QAbstractItemView::dragLeaveEvent +336 (int (*)(...))QAbstractItemView::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QFrame::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QAbstractItemView::inputMethodEvent +416 (int (*)(...))QAbstractItemView::inputMethodQuery +424 (int (*)(...))QAbstractItemView::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QAbstractScrollArea::setupViewport +448 (int (*)(...))QAbstractItemView::viewportEvent +456 (int (*)(...))QColumnView::scrollContentsBy +464 (int (*)(...))QAbstractItemView::viewportSizeHint +472 (int (*)(...))QColumnView::setModel +480 (int (*)(...))QColumnView::setSelectionModel +488 (int (*)(...))QAbstractItemView::keyboardSearch +496 (int (*)(...))QColumnView::visualRect +504 (int (*)(...))QColumnView::scrollTo +512 (int (*)(...))QColumnView::indexAt +520 (int (*)(...))QAbstractItemView::sizeHintForRow +528 (int (*)(...))QAbstractItemView::sizeHintForColumn +536 (int (*)(...))QAbstractItemView::itemDelegateForIndex +544 (int (*)(...))QAbstractItemView::reset +552 (int (*)(...))QColumnView::setRootIndex +560 (int (*)(...))QAbstractItemView::doItemsLayout +568 (int (*)(...))QColumnView::selectAll +576 (int (*)(...))QAbstractItemView::dataChanged +584 (int (*)(...))QColumnView::rowsInserted +592 (int (*)(...))QAbstractItemView::rowsAboutToBeRemoved +600 (int (*)(...))QAbstractItemView::selectionChanged +608 (int (*)(...))QColumnView::currentChanged +616 (int (*)(...))QAbstractItemView::updateEditorData +624 (int (*)(...))QAbstractItemView::updateEditorGeometries +632 (int (*)(...))QAbstractItemView::updateGeometries +640 (int (*)(...))QAbstractItemView::verticalScrollbarAction +648 (int (*)(...))QAbstractItemView::horizontalScrollbarAction +656 (int (*)(...))QAbstractItemView::verticalScrollbarValueChanged +664 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged +672 (int (*)(...))QAbstractItemView::closeEditor +680 (int (*)(...))QAbstractItemView::commitData +688 (int (*)(...))QAbstractItemView::editorDestroyed +696 (int (*)(...))QColumnView::moveCursor +704 (int (*)(...))QColumnView::horizontalOffset +712 (int (*)(...))QColumnView::verticalOffset +720 (int (*)(...))QColumnView::isIndexHidden +728 (int (*)(...))QColumnView::setSelection +736 (int (*)(...))QColumnView::visualRegionForSelection +744 (int (*)(...))QAbstractItemView::selectedIndexes +752 (int (*)(...))QAbstractItemView::edit +760 (int (*)(...))QAbstractItemView::selectionCommand +768 (int (*)(...))QAbstractItemView::startDrag +776 (int (*)(...))QAbstractItemView::initViewItemOption +784 (int (*)(...))QColumnView::createColumn +792 (int (*)(...))-16 +800 (int (*)(...))(& _ZTI11QColumnView) +808 (int (*)(...))QColumnView::_ZThn16_N11QColumnViewD1Ev +816 (int (*)(...))QColumnView::_ZThn16_N11QColumnViewD0Ev +824 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +832 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +840 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +848 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +856 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +864 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QColumnView + size=40 align=8 + base size=40 base align=8 +QColumnView (0x0x7319c34f20d0) 0 + vptr=((& QColumnView::_ZTV11QColumnView) + 16) +QAbstractItemView (0x0x7319c34f2138) 0 + primary-for QColumnView (0x0x7319c34f20d0) +QAbstractScrollArea (0x0x7319c34f21a0) 0 + primary-for QAbstractItemView (0x0x7319c34f2138) +QFrame (0x0x7319c34f2208) 0 + primary-for QAbstractScrollArea (0x0x7319c34f21a0) +QWidget (0x0x7319c34e1c40) 0 + primary-for QFrame (0x0x7319c34f2208) +QObject (0x0x7319c35035a0) 0 + primary-for QWidget (0x0x7319c34e1c40) +QPaintDevice (0x0x7319c3503600) 16 + vptr=((& QColumnView::_ZTV11QColumnView) + 808) + +Class QComboBox::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QComboBox::QPrivateSignal (0x0x7319c35038a0) 0 empty + +Vtable for QComboBox +QComboBox::_ZTV9QComboBox: 68 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QComboBox) +16 (int (*)(...))QComboBox::metaObject +24 (int (*)(...))QComboBox::qt_metacast +32 (int (*)(...))QComboBox::qt_metacall +40 (int (*)(...))QComboBox::~QComboBox +48 (int (*)(...))QComboBox::~QComboBox +56 (int (*)(...))QComboBox::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QComboBox::sizeHint +136 (int (*)(...))QComboBox::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QComboBox::mousePressEvent +176 (int (*)(...))QComboBox::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QComboBox::wheelEvent +208 (int (*)(...))QComboBox::keyPressEvent +216 (int (*)(...))QComboBox::keyReleaseEvent +224 (int (*)(...))QComboBox::focusInEvent +232 (int (*)(...))QComboBox::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QComboBox::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QComboBox::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QComboBox::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QComboBox::showEvent +352 (int (*)(...))QComboBox::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QComboBox::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QComboBox::inputMethodEvent +416 (int (*)(...))QComboBox::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QComboBox::setModel +440 (int (*)(...))QComboBox::showPopup +448 (int (*)(...))QComboBox::hidePopup +456 (int (*)(...))QComboBox::initStyleOption +464 (int (*)(...))-16 +472 (int (*)(...))(& _ZTI9QComboBox) +480 (int (*)(...))QComboBox::_ZThn16_N9QComboBoxD1Ev +488 (int (*)(...))QComboBox::_ZThn16_N9QComboBoxD0Ev +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QComboBox + size=40 align=8 + base size=40 base align=8 +QComboBox (0x0x7319c34f2270) 0 + vptr=((& QComboBox::_ZTV9QComboBox) + 16) +QWidget (0x0x7319c34e1e00) 0 + primary-for QComboBox (0x0x7319c34f2270) +QObject (0x0x7319c35037e0) 0 + primary-for QWidget (0x0x7319c34e1e00) +QPaintDevice (0x0x7319c3503840) 16 + vptr=((& QComboBox::_ZTV9QComboBox) + 480) + +Class QPushButton::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QPushButton::QPrivateSignal (0x0x7319c3503f00) 0 empty + +Vtable for QPushButton +QPushButton::_ZTV11QPushButton: 68 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QPushButton) +16 (int (*)(...))QPushButton::metaObject +24 (int (*)(...))QPushButton::qt_metacast +32 (int (*)(...))QPushButton::qt_metacall +40 (int (*)(...))QPushButton::~QPushButton +48 (int (*)(...))QPushButton::~QPushButton +56 (int (*)(...))QPushButton::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QAbstractButton::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QPushButton::sizeHint +136 (int (*)(...))QPushButton::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractButton::mousePressEvent +176 (int (*)(...))QAbstractButton::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QPushButton::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QPushButton::keyPressEvent +216 (int (*)(...))QAbstractButton::keyReleaseEvent +224 (int (*)(...))QPushButton::focusInEvent +232 (int (*)(...))QPushButton::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QPushButton::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QAbstractButton::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QPushButton::hitButton +440 (int (*)(...))QAbstractButton::checkStateSet +448 (int (*)(...))QAbstractButton::nextCheckState +456 (int (*)(...))QPushButton::initStyleOption +464 (int (*)(...))-16 +472 (int (*)(...))(& _ZTI11QPushButton) +480 (int (*)(...))QPushButton::_ZThn16_N11QPushButtonD1Ev +488 (int (*)(...))QPushButton::_ZThn16_N11QPushButtonD0Ev +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QPushButton + size=40 align=8 + base size=40 base align=8 +QPushButton (0x0x7319c34f22d8) 0 + vptr=((& QPushButton::_ZTV11QPushButton) + 16) +QAbstractButton (0x0x7319c34f2340) 0 + primary-for QPushButton (0x0x7319c34f22d8) +QWidget (0x0x7319c3520a10) 0 + primary-for QAbstractButton (0x0x7319c34f2340) +QObject (0x0x7319c3503e40) 0 + primary-for QWidget (0x0x7319c3520a10) +QPaintDevice (0x0x7319c3503ea0) 16 + vptr=((& QPushButton::_ZTV11QPushButton) + 480) + +Class QCommandLinkButton::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QCommandLinkButton::QPrivateSignal (0x0x7319c3542180) 0 empty + +Vtable for QCommandLinkButton +QCommandLinkButton::_ZTV18QCommandLinkButton: 68 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QCommandLinkButton) +16 (int (*)(...))QCommandLinkButton::metaObject +24 (int (*)(...))QCommandLinkButton::qt_metacast +32 (int (*)(...))QCommandLinkButton::qt_metacall +40 (int (*)(...))QCommandLinkButton::~QCommandLinkButton +48 (int (*)(...))QCommandLinkButton::~QCommandLinkButton +56 (int (*)(...))QCommandLinkButton::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QAbstractButton::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QCommandLinkButton::sizeHint +136 (int (*)(...))QCommandLinkButton::minimumSizeHint +144 (int (*)(...))QCommandLinkButton::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractButton::mousePressEvent +176 (int (*)(...))QAbstractButton::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QPushButton::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QPushButton::keyPressEvent +216 (int (*)(...))QAbstractButton::keyReleaseEvent +224 (int (*)(...))QPushButton::focusInEvent +232 (int (*)(...))QPushButton::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QCommandLinkButton::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QAbstractButton::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QPushButton::hitButton +440 (int (*)(...))QAbstractButton::checkStateSet +448 (int (*)(...))QAbstractButton::nextCheckState +456 (int (*)(...))QCommandLinkButton::initStyleOption +464 (int (*)(...))-16 +472 (int (*)(...))(& _ZTI18QCommandLinkButton) +480 (int (*)(...))QCommandLinkButton::_ZThn16_N18QCommandLinkButtonD1Ev +488 (int (*)(...))QCommandLinkButton::_ZThn16_N18QCommandLinkButtonD0Ev +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QCommandLinkButton + size=40 align=8 + base size=40 base align=8 +QCommandLinkButton (0x0x7319c34f23a8) 0 + vptr=((& QCommandLinkButton::_ZTV18QCommandLinkButton) + 16) +QPushButton (0x0x7319c34f2410) 0 + primary-for QCommandLinkButton (0x0x7319c34f23a8) +QAbstractButton (0x0x7319c34f2478) 0 + primary-for QPushButton (0x0x7319c34f2410) +QWidget (0x0x7319c3520bd0) 0 + primary-for QAbstractButton (0x0x7319c34f2478) +QObject (0x0x7319c35420c0) 0 + primary-for QWidget (0x0x7319c3520bd0) +QPaintDevice (0x0x7319c3542120) 16 + vptr=((& QCommandLinkButton::_ZTV18QCommandLinkButton) + 480) + +Class QCommonStyle::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QCommonStyle::QPrivateSignal (0x0x7319c3542360) 0 empty + +Vtable for QCommonStyle +QCommonStyle::_ZTV12QCommonStyle: 37 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QCommonStyle) +16 (int (*)(...))QCommonStyle::metaObject +24 (int (*)(...))QCommonStyle::qt_metacast +32 (int (*)(...))QCommonStyle::qt_metacall +40 (int (*)(...))QCommonStyle::~QCommonStyle +48 (int (*)(...))QCommonStyle::~QCommonStyle +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QCommonStyle::polish +120 (int (*)(...))QCommonStyle::unpolish +128 (int (*)(...))QCommonStyle::polish +136 (int (*)(...))QCommonStyle::unpolish +144 (int (*)(...))QCommonStyle::polish +152 (int (*)(...))QStyle::itemTextRect +160 (int (*)(...))QStyle::itemPixmapRect +168 (int (*)(...))QStyle::drawItemText +176 (int (*)(...))QStyle::drawItemPixmap +184 (int (*)(...))QStyle::standardPalette +192 (int (*)(...))QCommonStyle::drawPrimitive +200 (int (*)(...))QCommonStyle::drawControl +208 (int (*)(...))QCommonStyle::subElementRect +216 (int (*)(...))QCommonStyle::drawComplexControl +224 (int (*)(...))QCommonStyle::hitTestComplexControl +232 (int (*)(...))QCommonStyle::subControlRect +240 (int (*)(...))QCommonStyle::pixelMetric +248 (int (*)(...))QCommonStyle::sizeFromContents +256 (int (*)(...))QCommonStyle::styleHint +264 (int (*)(...))QCommonStyle::standardPixmap +272 (int (*)(...))QCommonStyle::standardIcon +280 (int (*)(...))QCommonStyle::generatedIconPixmap +288 (int (*)(...))QCommonStyle::layoutSpacing + +Class QCommonStyle + size=16 align=8 + base size=16 base align=8 +QCommonStyle (0x0x7319c34f24e0) 0 + vptr=((& QCommonStyle::_ZTV12QCommonStyle) + 16) +QStyle (0x0x7319c34f2548) 0 + primary-for QCommonStyle (0x0x7319c34f24e0) +QObject (0x0x7319c3542300) 0 + primary-for QStyle (0x0x7319c34f2548) + +Class QCompleter::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QCompleter::QPrivateSignal (0x0x7319c3542540) 0 empty + +Vtable for QCompleter +QCompleter::_ZTV10QCompleter: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QCompleter) +16 (int (*)(...))QCompleter::metaObject +24 (int (*)(...))QCompleter::qt_metacast +32 (int (*)(...))QCompleter::qt_metacall +40 (int (*)(...))QCompleter::~QCompleter +48 (int (*)(...))QCompleter::~QCompleter +56 (int (*)(...))QCompleter::event +64 (int (*)(...))QCompleter::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QCompleter::pathFromIndex +120 (int (*)(...))QCompleter::splitPath + +Class QCompleter + size=16 align=8 + base size=16 base align=8 +QCompleter (0x0x7319c34f25b0) 0 + vptr=((& QCompleter::_ZTV10QCompleter) + 16) +QObject (0x0x7319c35424e0) 0 + primary-for QCompleter (0x0x7319c34f25b0) + +Class QDataWidgetMapper::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDataWidgetMapper::QPrivateSignal (0x0x7319c35428a0) 0 empty + +Vtable for QDataWidgetMapper +QDataWidgetMapper::_ZTV17QDataWidgetMapper: 15 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QDataWidgetMapper) +16 (int (*)(...))QDataWidgetMapper::metaObject +24 (int (*)(...))QDataWidgetMapper::qt_metacast +32 (int (*)(...))QDataWidgetMapper::qt_metacall +40 (int (*)(...))QDataWidgetMapper::~QDataWidgetMapper +48 (int (*)(...))QDataWidgetMapper::~QDataWidgetMapper +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QDataWidgetMapper::setCurrentIndex + +Class QDataWidgetMapper + size=16 align=8 + base size=16 base align=8 +QDataWidgetMapper (0x0x7319c34f2618) 0 + vptr=((& QDataWidgetMapper::_ZTV17QDataWidgetMapper) + 16) +QObject (0x0x7319c3542840) 0 + primary-for QDataWidgetMapper (0x0x7319c34f2618) + +Class QDateTimeEdit::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDateTimeEdit::QPrivateSignal (0x0x7319c3542ba0) 0 empty + +Vtable for QDateTimeEdit +QDateTimeEdit::_ZTV13QDateTimeEdit: 72 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QDateTimeEdit) +16 (int (*)(...))QDateTimeEdit::metaObject +24 (int (*)(...))QDateTimeEdit::qt_metacast +32 (int (*)(...))QDateTimeEdit::qt_metacall +40 (int (*)(...))QDateTimeEdit::~QDateTimeEdit +48 (int (*)(...))QDateTimeEdit::~QDateTimeEdit +56 (int (*)(...))QDateTimeEdit::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QAbstractSpinBox::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QDateTimeEdit::sizeHint +136 (int (*)(...))QAbstractSpinBox::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QDateTimeEdit::mousePressEvent +176 (int (*)(...))QAbstractSpinBox::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QAbstractSpinBox::mouseMoveEvent +200 (int (*)(...))QDateTimeEdit::wheelEvent +208 (int (*)(...))QDateTimeEdit::keyPressEvent +216 (int (*)(...))QAbstractSpinBox::keyReleaseEvent +224 (int (*)(...))QDateTimeEdit::focusInEvent +232 (int (*)(...))QAbstractSpinBox::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QDateTimeEdit::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QAbstractSpinBox::resizeEvent +280 (int (*)(...))QAbstractSpinBox::closeEvent +288 (int (*)(...))QAbstractSpinBox::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QAbstractSpinBox::showEvent +352 (int (*)(...))QAbstractSpinBox::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QAbstractSpinBox::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QAbstractSpinBox::inputMethodQuery +424 (int (*)(...))QDateTimeEdit::focusNextPrevChild +432 (int (*)(...))QDateTimeEdit::validate +440 (int (*)(...))QDateTimeEdit::fixup +448 (int (*)(...))QDateTimeEdit::stepBy +456 (int (*)(...))QDateTimeEdit::clear +464 (int (*)(...))QDateTimeEdit::initStyleOption +472 (int (*)(...))QDateTimeEdit::stepEnabled +480 (int (*)(...))QDateTimeEdit::dateTimeFromText +488 (int (*)(...))QDateTimeEdit::textFromDateTime +496 (int (*)(...))-16 +504 (int (*)(...))(& _ZTI13QDateTimeEdit) +512 (int (*)(...))QDateTimeEdit::_ZThn16_N13QDateTimeEditD1Ev +520 (int (*)(...))QDateTimeEdit::_ZThn16_N13QDateTimeEditD0Ev +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +552 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +560 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +568 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QDateTimeEdit + size=40 align=8 + base size=40 base align=8 +QDateTimeEdit (0x0x7319c34f2680) 0 + vptr=((& QDateTimeEdit::_ZTV13QDateTimeEdit) + 16) +QAbstractSpinBox (0x0x7319c34f26e8) 0 + primary-for QDateTimeEdit (0x0x7319c34f2680) +QWidget (0x0x7319c35577e0) 0 + primary-for QAbstractSpinBox (0x0x7319c34f26e8) +QObject (0x0x7319c3542ae0) 0 + primary-for QWidget (0x0x7319c35577e0) +QPaintDevice (0x0x7319c3542b40) 16 + vptr=((& QDateTimeEdit::_ZTV13QDateTimeEdit) + 512) + +Class QTimeEdit::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTimeEdit::QPrivateSignal (0x0x7319c3599240) 0 empty + +Vtable for QTimeEdit +QTimeEdit::_ZTV9QTimeEdit: 72 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QTimeEdit) +16 (int (*)(...))QTimeEdit::metaObject +24 (int (*)(...))QTimeEdit::qt_metacast +32 (int (*)(...))QTimeEdit::qt_metacall +40 (int (*)(...))QTimeEdit::~QTimeEdit +48 (int (*)(...))QTimeEdit::~QTimeEdit +56 (int (*)(...))QDateTimeEdit::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QAbstractSpinBox::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QDateTimeEdit::sizeHint +136 (int (*)(...))QAbstractSpinBox::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QDateTimeEdit::mousePressEvent +176 (int (*)(...))QAbstractSpinBox::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QAbstractSpinBox::mouseMoveEvent +200 (int (*)(...))QDateTimeEdit::wheelEvent +208 (int (*)(...))QDateTimeEdit::keyPressEvent +216 (int (*)(...))QAbstractSpinBox::keyReleaseEvent +224 (int (*)(...))QDateTimeEdit::focusInEvent +232 (int (*)(...))QAbstractSpinBox::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QDateTimeEdit::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QAbstractSpinBox::resizeEvent +280 (int (*)(...))QAbstractSpinBox::closeEvent +288 (int (*)(...))QAbstractSpinBox::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QAbstractSpinBox::showEvent +352 (int (*)(...))QAbstractSpinBox::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QAbstractSpinBox::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QAbstractSpinBox::inputMethodQuery +424 (int (*)(...))QDateTimeEdit::focusNextPrevChild +432 (int (*)(...))QDateTimeEdit::validate +440 (int (*)(...))QDateTimeEdit::fixup +448 (int (*)(...))QDateTimeEdit::stepBy +456 (int (*)(...))QDateTimeEdit::clear +464 (int (*)(...))QDateTimeEdit::initStyleOption +472 (int (*)(...))QDateTimeEdit::stepEnabled +480 (int (*)(...))QDateTimeEdit::dateTimeFromText +488 (int (*)(...))QDateTimeEdit::textFromDateTime +496 (int (*)(...))-16 +504 (int (*)(...))(& _ZTI9QTimeEdit) +512 (int (*)(...))QTimeEdit::_ZThn16_N9QTimeEditD1Ev +520 (int (*)(...))QTimeEdit::_ZThn16_N9QTimeEditD0Ev +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +552 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +560 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +568 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QTimeEdit + size=40 align=8 + base size=40 base align=8 +QTimeEdit (0x0x7319c34f29c0) 0 + vptr=((& QTimeEdit::_ZTV9QTimeEdit) + 16) +QDateTimeEdit (0x0x7319c34f2a28) 0 + primary-for QTimeEdit (0x0x7319c34f29c0) +QAbstractSpinBox (0x0x7319c34f2a90) 0 + primary-for QDateTimeEdit (0x0x7319c34f2a28) +QWidget (0x0x7319c359a070) 0 + primary-for QAbstractSpinBox (0x0x7319c34f2a90) +QObject (0x0x7319c3599180) 0 + primary-for QWidget (0x0x7319c359a070) +QPaintDevice (0x0x7319c35991e0) 16 + vptr=((& QTimeEdit::_ZTV9QTimeEdit) + 512) + +Class QDateEdit::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDateEdit::QPrivateSignal (0x0x7319c35993c0) 0 empty + +Vtable for QDateEdit +QDateEdit::_ZTV9QDateEdit: 72 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QDateEdit) +16 (int (*)(...))QDateEdit::metaObject +24 (int (*)(...))QDateEdit::qt_metacast +32 (int (*)(...))QDateEdit::qt_metacall +40 (int (*)(...))QDateEdit::~QDateEdit +48 (int (*)(...))QDateEdit::~QDateEdit +56 (int (*)(...))QDateTimeEdit::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QAbstractSpinBox::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QDateTimeEdit::sizeHint +136 (int (*)(...))QAbstractSpinBox::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QDateTimeEdit::mousePressEvent +176 (int (*)(...))QAbstractSpinBox::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QAbstractSpinBox::mouseMoveEvent +200 (int (*)(...))QDateTimeEdit::wheelEvent +208 (int (*)(...))QDateTimeEdit::keyPressEvent +216 (int (*)(...))QAbstractSpinBox::keyReleaseEvent +224 (int (*)(...))QDateTimeEdit::focusInEvent +232 (int (*)(...))QAbstractSpinBox::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QDateTimeEdit::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QAbstractSpinBox::resizeEvent +280 (int (*)(...))QAbstractSpinBox::closeEvent +288 (int (*)(...))QAbstractSpinBox::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QAbstractSpinBox::showEvent +352 (int (*)(...))QAbstractSpinBox::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QAbstractSpinBox::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QAbstractSpinBox::inputMethodQuery +424 (int (*)(...))QDateTimeEdit::focusNextPrevChild +432 (int (*)(...))QDateTimeEdit::validate +440 (int (*)(...))QDateTimeEdit::fixup +448 (int (*)(...))QDateTimeEdit::stepBy +456 (int (*)(...))QDateTimeEdit::clear +464 (int (*)(...))QDateTimeEdit::initStyleOption +472 (int (*)(...))QDateTimeEdit::stepEnabled +480 (int (*)(...))QDateTimeEdit::dateTimeFromText +488 (int (*)(...))QDateTimeEdit::textFromDateTime +496 (int (*)(...))-16 +504 (int (*)(...))(& _ZTI9QDateEdit) +512 (int (*)(...))QDateEdit::_ZThn16_N9QDateEditD1Ev +520 (int (*)(...))QDateEdit::_ZThn16_N9QDateEditD0Ev +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +552 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +560 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +568 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QDateEdit + size=40 align=8 + base size=40 base align=8 +QDateEdit (0x0x7319c34f2af8) 0 + vptr=((& QDateEdit::_ZTV9QDateEdit) + 16) +QDateTimeEdit (0x0x7319c34f2b60) 0 + primary-for QDateEdit (0x0x7319c34f2af8) +QAbstractSpinBox (0x0x7319c34f2bc8) 0 + primary-for QDateTimeEdit (0x0x7319c34f2b60) +QWidget (0x0x7319c359a150) 0 + primary-for QAbstractSpinBox (0x0x7319c34f2bc8) +QObject (0x0x7319c3599300) 0 + primary-for QWidget (0x0x7319c359a150) +QPaintDevice (0x0x7319c3599360) 16 + vptr=((& QDateEdit::_ZTV9QDateEdit) + 512) + +Class QDial::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDial::QPrivateSignal (0x0x7319c35997e0) 0 empty + +Vtable for QDial +QDial::_ZTV5QDial: 66 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI5QDial) +16 (int (*)(...))QDial::metaObject +24 (int (*)(...))QDial::qt_metacast +32 (int (*)(...))QDial::qt_metacall +40 (int (*)(...))QDial::~QDial +48 (int (*)(...))QDial::~QDial +56 (int (*)(...))QDial::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QAbstractSlider::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QDial::sizeHint +136 (int (*)(...))QDial::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QDial::mousePressEvent +176 (int (*)(...))QDial::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QDial::mouseMoveEvent +200 (int (*)(...))QAbstractSlider::wheelEvent +208 (int (*)(...))QAbstractSlider::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QDial::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QDial::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QAbstractSlider::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDial::sliderChange +440 (int (*)(...))QDial::initStyleOption +448 (int (*)(...))-16 +456 (int (*)(...))(& _ZTI5QDial) +464 (int (*)(...))QDial::_ZThn16_N5QDialD1Ev +472 (int (*)(...))QDial::_ZThn16_N5QDialD0Ev +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QDial + size=40 align=8 + base size=40 base align=8 +QDial (0x0x7319c34f2c30) 0 + vptr=((& QDial::_ZTV5QDial) + 16) +QAbstractSlider (0x0x7319c34f2c98) 0 + primary-for QDial (0x0x7319c34f2c30) +QWidget (0x0x7319c359a540) 0 + primary-for QAbstractSlider (0x0x7319c34f2c98) +QObject (0x0x7319c3599720) 0 + primary-for QWidget (0x0x7319c359a540) +QPaintDevice (0x0x7319c3599780) 16 + vptr=((& QDial::_ZTV5QDial) + 464) + +Class QDialogButtonBox::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDialogButtonBox::QPrivateSignal (0x0x7319c3599a20) 0 empty + +Vtable for QDialogButtonBox +QDialogButtonBox::_ZTV16QDialogButtonBox: 64 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI16QDialogButtonBox) +16 (int (*)(...))QDialogButtonBox::metaObject +24 (int (*)(...))QDialogButtonBox::qt_metacast +32 (int (*)(...))QDialogButtonBox::qt_metacall +40 (int (*)(...))QDialogButtonBox::~QDialogButtonBox +48 (int (*)(...))QDialogButtonBox::~QDialogButtonBox +56 (int (*)(...))QDialogButtonBox::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QDialogButtonBox::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))-16 +440 (int (*)(...))(& _ZTI16QDialogButtonBox) +448 (int (*)(...))QDialogButtonBox::_ZThn16_N16QDialogButtonBoxD1Ev +456 (int (*)(...))QDialogButtonBox::_ZThn16_N16QDialogButtonBoxD0Ev +464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QDialogButtonBox + size=40 align=8 + base size=40 base align=8 +QDialogButtonBox (0x0x7319c34f2d00) 0 + vptr=((& QDialogButtonBox::_ZTV16QDialogButtonBox) + 16) +QWidget (0x0x7319c359a700) 0 + primary-for QDialogButtonBox (0x0x7319c34f2d00) +QObject (0x0x7319c3599960) 0 + primary-for QWidget (0x0x7319c359a700) +QPaintDevice (0x0x7319c35999c0) 16 + vptr=((& QDialogButtonBox::_ZTV16QDialogButtonBox) + 448) + +Class QDockWidget::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDockWidget::QPrivateSignal (0x0x7319c35db2a0) 0 empty + +Vtable for QDockWidget +QDockWidget::_ZTV11QDockWidget: 65 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QDockWidget) +16 (int (*)(...))QDockWidget::metaObject +24 (int (*)(...))QDockWidget::qt_metacast +32 (int (*)(...))QDockWidget::qt_metacall +40 (int (*)(...))QDockWidget::~QDockWidget +48 (int (*)(...))QDockWidget::~QDockWidget +56 (int (*)(...))QDockWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QDockWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QDockWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QDockWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDockWidget::initStyleOption +440 (int (*)(...))-16 +448 (int (*)(...))(& _ZTI11QDockWidget) +456 (int (*)(...))QDockWidget::_ZThn16_N11QDockWidgetD1Ev +464 (int (*)(...))QDockWidget::_ZThn16_N11QDockWidgetD0Ev +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QDockWidget + size=40 align=8 + base size=40 base align=8 +QDockWidget (0x0x7319c35e1000) 0 + vptr=((& QDockWidget::_ZTV11QDockWidget) + 16) +QWidget (0x0x7319c35b8d20) 0 + primary-for QDockWidget (0x0x7319c35e1000) +QObject (0x0x7319c35db1e0) 0 + primary-for QWidget (0x0x7319c35b8d20) +QPaintDevice (0x0x7319c35db240) 16 + vptr=((& QDockWidget::_ZTV11QDockWidget) + 456) + +Class QTileRules + size=8 align=4 + base size=8 base align=4 +QTileRules (0x0x7319c35dbb40) 0 + +Class QErrorMessage::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QErrorMessage::QPrivateSignal (0x0x7319c3214840) 0 empty + +Vtable for QErrorMessage +QErrorMessage::_ZTV13QErrorMessage: 69 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QErrorMessage) +16 (int (*)(...))QErrorMessage::metaObject +24 (int (*)(...))QErrorMessage::qt_metacast +32 (int (*)(...))QErrorMessage::qt_metacall +40 (int (*)(...))QErrorMessage::~QErrorMessage +48 (int (*)(...))QErrorMessage::~QErrorMessage +56 (int (*)(...))QWidget::event +64 (int (*)(...))QDialog::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QDialog::setVisible +128 (int (*)(...))QDialog::sizeHint +136 (int (*)(...))QDialog::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QDialog::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QDialog::resizeEvent +280 (int (*)(...))QDialog::closeEvent +288 (int (*)(...))QDialog::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QDialog::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QErrorMessage::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDialog::open +440 (int (*)(...))QDialog::exec +448 (int (*)(...))QErrorMessage::done +456 (int (*)(...))QDialog::accept +464 (int (*)(...))QDialog::reject +472 (int (*)(...))-16 +480 (int (*)(...))(& _ZTI13QErrorMessage) +488 (int (*)(...))QErrorMessage::_ZThn16_N13QErrorMessageD1Ev +496 (int (*)(...))QErrorMessage::_ZThn16_N13QErrorMessageD0Ev +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QErrorMessage + size=40 align=8 + base size=40 base align=8 +QErrorMessage (0x0x7319c35e1680) 0 + vptr=((& QErrorMessage::_ZTV13QErrorMessage) + 16) +QDialog (0x0x7319c35e16e8) 0 + primary-for QErrorMessage (0x0x7319c35e1680) +QWidget (0x0x7319c32135b0) 0 + primary-for QDialog (0x0x7319c35e16e8) +QObject (0x0x7319c3214780) 0 + primary-for QWidget (0x0x7319c32135b0) +QPaintDevice (0x0x7319c32147e0) 16 + vptr=((& QErrorMessage::_ZTV13QErrorMessage) + 488) + +Class QFileDialog::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QFileDialog::QPrivateSignal (0x0x7319c3214a80) 0 empty + +Vtable for QFileDialog +QFileDialog::_ZTV11QFileDialog: 69 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QFileDialog) +16 (int (*)(...))QFileDialog::metaObject +24 (int (*)(...))QFileDialog::qt_metacast +32 (int (*)(...))QFileDialog::qt_metacall +40 (int (*)(...))QFileDialog::~QFileDialog +48 (int (*)(...))QFileDialog::~QFileDialog +56 (int (*)(...))QWidget::event +64 (int (*)(...))QDialog::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QFileDialog::setVisible +128 (int (*)(...))QDialog::sizeHint +136 (int (*)(...))QDialog::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QDialog::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QDialog::resizeEvent +280 (int (*)(...))QDialog::closeEvent +288 (int (*)(...))QDialog::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QDialog::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QFileDialog::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDialog::open +440 (int (*)(...))QDialog::exec +448 (int (*)(...))QFileDialog::done +456 (int (*)(...))QFileDialog::accept +464 (int (*)(...))QDialog::reject +472 (int (*)(...))-16 +480 (int (*)(...))(& _ZTI11QFileDialog) +488 (int (*)(...))QFileDialog::_ZThn16_N11QFileDialogD1Ev +496 (int (*)(...))QFileDialog::_ZThn16_N11QFileDialogD0Ev +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QFileDialog + size=40 align=8 + base size=40 base align=8 +QFileDialog (0x0x7319c35e1750) 0 + vptr=((& QFileDialog::_ZTV11QFileDialog) + 16) +QDialog (0x0x7319c35e17b8) 0 + primary-for QFileDialog (0x0x7319c35e1750) +QWidget (0x0x7319c3213770) 0 + primary-for QDialog (0x0x7319c35e17b8) +QObject (0x0x7319c32149c0) 0 + primary-for QWidget (0x0x7319c3213770) +QPaintDevice (0x0x7319c3214a20) 16 + vptr=((& QFileDialog::_ZTV11QFileDialog) + 488) + +Vtable for QFileIconProvider +QFileIconProvider::_ZTV17QFileIconProvider: 9 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QFileIconProvider) +16 (int (*)(...))QFileIconProvider::~QFileIconProvider +24 (int (*)(...))QFileIconProvider::~QFileIconProvider +32 (int (*)(...))QFileIconProvider::icon +40 (int (*)(...))QFileIconProvider::icon +48 (int (*)(...))QAbstractFileIconProvider::type +56 (int (*)(...))QAbstractFileIconProvider::setOptions +64 (int (*)(...))QAbstractFileIconProvider::options + +Class QFileIconProvider + size=16 align=8 + base size=16 base align=8 +QFileIconProvider (0x0x7319c35e1a90) 0 + vptr=((& QFileIconProvider::_ZTV17QFileIconProvider) + 16) +QAbstractFileIconProvider (0x0x7319c3265c60) 0 + primary-for QFileIconProvider (0x0x7319c35e1a90) + +Class QFocusFrame::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QFocusFrame::QPrivateSignal (0x0x7319c3265e40) 0 empty + +Vtable for QFocusFrame +QFocusFrame::_ZTV11QFocusFrame: 65 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QFocusFrame) +16 (int (*)(...))QFocusFrame::metaObject +24 (int (*)(...))QFocusFrame::qt_metacast +32 (int (*)(...))QFocusFrame::qt_metacall +40 (int (*)(...))QFocusFrame::~QFocusFrame +48 (int (*)(...))QFocusFrame::~QFocusFrame +56 (int (*)(...))QFocusFrame::event +64 (int (*)(...))QFocusFrame::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QFocusFrame::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QFocusFrame::initStyleOption +440 (int (*)(...))-16 +448 (int (*)(...))(& _ZTI11QFocusFrame) +456 (int (*)(...))QFocusFrame::_ZThn16_N11QFocusFrameD1Ev +464 (int (*)(...))QFocusFrame::_ZThn16_N11QFocusFrameD0Ev +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QFocusFrame + size=40 align=8 + base size=40 base align=8 +QFocusFrame (0x0x7319c35e1af8) 0 + vptr=((& QFocusFrame::_ZTV11QFocusFrame) + 16) +QWidget (0x0x7319c3237e70) 0 + primary-for QFocusFrame (0x0x7319c35e1af8) +QObject (0x0x7319c3265d80) 0 + primary-for QWidget (0x0x7319c3237e70) +QPaintDevice (0x0x7319c3265de0) 16 + vptr=((& QFocusFrame::_ZTV11QFocusFrame) + 456) + +Class QFontComboBox::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QFontComboBox::QPrivateSignal (0x0x7319c327d0c0) 0 empty + +Vtable for QFontComboBox +QFontComboBox::_ZTV13QFontComboBox: 68 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QFontComboBox) +16 (int (*)(...))QFontComboBox::metaObject +24 (int (*)(...))QFontComboBox::qt_metacast +32 (int (*)(...))QFontComboBox::qt_metacall +40 (int (*)(...))QFontComboBox::~QFontComboBox +48 (int (*)(...))QFontComboBox::~QFontComboBox +56 (int (*)(...))QFontComboBox::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QFontComboBox::sizeHint +136 (int (*)(...))QComboBox::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QComboBox::mousePressEvent +176 (int (*)(...))QComboBox::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QComboBox::wheelEvent +208 (int (*)(...))QComboBox::keyPressEvent +216 (int (*)(...))QComboBox::keyReleaseEvent +224 (int (*)(...))QComboBox::focusInEvent +232 (int (*)(...))QComboBox::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QComboBox::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QComboBox::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QComboBox::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QComboBox::showEvent +352 (int (*)(...))QComboBox::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QComboBox::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QComboBox::inputMethodEvent +416 (int (*)(...))QComboBox::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QComboBox::setModel +440 (int (*)(...))QComboBox::showPopup +448 (int (*)(...))QComboBox::hidePopup +456 (int (*)(...))QComboBox::initStyleOption +464 (int (*)(...))-16 +472 (int (*)(...))(& _ZTI13QFontComboBox) +480 (int (*)(...))QFontComboBox::_ZThn16_N13QFontComboBoxD1Ev +488 (int (*)(...))QFontComboBox::_ZThn16_N13QFontComboBoxD0Ev +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QFontComboBox + size=40 align=8 + base size=40 base align=8 +QFontComboBox (0x0x7319c35e1b60) 0 + vptr=((& QFontComboBox::_ZTV13QFontComboBox) + 16) +QComboBox (0x0x7319c35e1bc8) 0 + primary-for QFontComboBox (0x0x7319c35e1b60) +QWidget (0x0x7319c327c070) 0 + primary-for QComboBox (0x0x7319c35e1bc8) +QObject (0x0x7319c327d000) 0 + primary-for QWidget (0x0x7319c327c070) +QPaintDevice (0x0x7319c327d060) 16 + vptr=((& QFontComboBox::_ZTV13QFontComboBox) + 480) + +Class QFontDialog::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QFontDialog::QPrivateSignal (0x0x7319c327d900) 0 empty + +Vtable for QFontDialog +QFontDialog::_ZTV11QFontDialog: 69 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QFontDialog) +16 (int (*)(...))QFontDialog::metaObject +24 (int (*)(...))QFontDialog::qt_metacast +32 (int (*)(...))QFontDialog::qt_metacall +40 (int (*)(...))QFontDialog::~QFontDialog +48 (int (*)(...))QFontDialog::~QFontDialog +56 (int (*)(...))QWidget::event +64 (int (*)(...))QFontDialog::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QFontDialog::setVisible +128 (int (*)(...))QDialog::sizeHint +136 (int (*)(...))QDialog::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QDialog::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QDialog::resizeEvent +280 (int (*)(...))QDialog::closeEvent +288 (int (*)(...))QDialog::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QDialog::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QFontDialog::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDialog::open +440 (int (*)(...))QDialog::exec +448 (int (*)(...))QFontDialog::done +456 (int (*)(...))QDialog::accept +464 (int (*)(...))QDialog::reject +472 (int (*)(...))-16 +480 (int (*)(...))(& _ZTI11QFontDialog) +488 (int (*)(...))QFontDialog::_ZThn16_N11QFontDialogD1Ev +496 (int (*)(...))QFontDialog::_ZThn16_N11QFontDialogD0Ev +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QFontDialog + size=40 align=8 + base size=40 base align=8 +QFontDialog (0x0x7319c35e1ea0) 0 + vptr=((& QFontDialog::_ZTV11QFontDialog) + 16) +QDialog (0x0x7319c35e1f08) 0 + primary-for QFontDialog (0x0x7319c35e1ea0) +QWidget (0x0x7319c327c850) 0 + primary-for QDialog (0x0x7319c35e1f08) +QObject (0x0x7319c327d840) 0 + primary-for QWidget (0x0x7319c327c850) +QPaintDevice (0x0x7319c327d8a0) 16 + vptr=((& QFontDialog::_ZTV11QFontDialog) + 488) + +Class QFormLayout::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QFormLayout::QPrivateSignal (0x0x7319c32c7720) 0 empty + +Class QFormLayout::TakeRowResult + size=16 align=8 + base size=16 base align=8 +QFormLayout::TakeRowResult (0x0x7319c32c7780) 0 + +Vtable for QFormLayout +QFormLayout::_ZTV11QFormLayout: 54 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QFormLayout) +16 (int (*)(...))QFormLayout::metaObject +24 (int (*)(...))QFormLayout::qt_metacast +32 (int (*)(...))QFormLayout::qt_metacall +40 (int (*)(...))QFormLayout::~QFormLayout +48 (int (*)(...))QFormLayout::~QFormLayout +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QLayout::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QFormLayout::spacing +120 (int (*)(...))QFormLayout::setSpacing +128 (int (*)(...))QFormLayout::invalidate +136 (int (*)(...))QLayout::geometry +144 (int (*)(...))QFormLayout::addItem +152 (int (*)(...))QFormLayout::expandingDirections +160 (int (*)(...))QFormLayout::minimumSize +168 (int (*)(...))QLayout::maximumSize +176 (int (*)(...))QFormLayout::setGeometry +184 (int (*)(...))QFormLayout::itemAt +192 (int (*)(...))QFormLayout::takeAt +200 (int (*)(...))QLayout::indexOf +208 (int (*)(...))QLayout::indexOf +216 (int (*)(...))QFormLayout::count +224 (int (*)(...))QLayout::isEmpty +232 (int (*)(...))QLayout::controlTypes +240 (int (*)(...))QLayout::replaceWidget +248 (int (*)(...))QLayout::layout +256 (int (*)(...))QFormLayout::sizeHint +264 (int (*)(...))QFormLayout::hasHeightForWidth +272 (int (*)(...))QFormLayout::heightForWidth +280 (int (*)(...))-16 +288 (int (*)(...))(& _ZTI11QFormLayout) +296 (int (*)(...))QFormLayout::_ZThn16_N11QFormLayoutD1Ev +304 (int (*)(...))QFormLayout::_ZThn16_N11QFormLayoutD0Ev +312 (int (*)(...))QFormLayout::_ZThn16_NK11QFormLayout8sizeHintEv +320 (int (*)(...))QFormLayout::_ZThn16_NK11QFormLayout11minimumSizeEv +328 (int (*)(...))QLayout::_ZThn16_NK7QLayout11maximumSizeEv +336 (int (*)(...))QFormLayout::_ZThn16_NK11QFormLayout19expandingDirectionsEv +344 (int (*)(...))QFormLayout::_ZThn16_N11QFormLayout11setGeometryERK5QRect +352 (int (*)(...))QLayout::_ZThn16_NK7QLayout8geometryEv +360 (int (*)(...))QLayout::_ZThn16_NK7QLayout7isEmptyEv +368 (int (*)(...))QFormLayout::_ZThn16_NK11QFormLayout17hasHeightForWidthEv +376 (int (*)(...))QFormLayout::_ZThn16_NK11QFormLayout14heightForWidthEi +384 (int (*)(...))QLayoutItem::minimumHeightForWidth +392 (int (*)(...))QFormLayout::_ZThn16_N11QFormLayout10invalidateEv +400 (int (*)(...))QLayoutItem::widget +408 (int (*)(...))QLayout::_ZThn16_N7QLayout6layoutEv +416 (int (*)(...))QLayoutItem::spacerItem +424 (int (*)(...))QLayout::_ZThn16_NK7QLayout12controlTypesEv + +Class QFormLayout + size=32 align=8 + base size=28 base align=8 +QFormLayout (0x0x7319c32b0340) 0 + vptr=((& QFormLayout::_ZTV11QFormLayout) + 16) +QLayout (0x0x7319c32ca4d0) 0 + primary-for QFormLayout (0x0x7319c32b0340) +QObject (0x0x7319c32c7660) 0 + primary-for QLayout (0x0x7319c32ca4d0) +QLayoutItem (0x0x7319c32c76c0) 16 + vptr=((& QFormLayout::_ZTV11QFormLayout) + 296) + +Class QGesture::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGesture::QPrivateSignal (0x0x7319c3314900) 0 empty + +Vtable for QGesture +QGesture::_ZTV8QGesture: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI8QGesture) +16 (int (*)(...))QGesture::metaObject +24 (int (*)(...))QGesture::qt_metacast +32 (int (*)(...))QGesture::qt_metacall +40 (int (*)(...))QGesture::~QGesture +48 (int (*)(...))QGesture::~QGesture +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QGesture + size=16 align=8 + base size=16 base align=8 +QGesture (0x0x7319c3318068) 0 + vptr=((& QGesture::_ZTV8QGesture) + 16) +QObject (0x0x7319c33148a0) 0 + primary-for QGesture (0x0x7319c3318068) + +Class QPanGesture::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QPanGesture::QPrivateSignal (0x0x7319c3314ae0) 0 empty + +Vtable for QPanGesture +QPanGesture::_ZTV11QPanGesture: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QPanGesture) +16 (int (*)(...))QPanGesture::metaObject +24 (int (*)(...))QPanGesture::qt_metacast +32 (int (*)(...))QPanGesture::qt_metacall +40 (int (*)(...))QPanGesture::~QPanGesture +48 (int (*)(...))QPanGesture::~QPanGesture +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QPanGesture + size=16 align=8 + base size=16 base align=8 +QPanGesture (0x0x7319c33180d0) 0 + vptr=((& QPanGesture::_ZTV11QPanGesture) + 16) +QGesture (0x0x7319c3318138) 0 + primary-for QPanGesture (0x0x7319c33180d0) +QObject (0x0x7319c3314a80) 0 + primary-for QGesture (0x0x7319c3318138) + +Class QPinchGesture::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QPinchGesture::QPrivateSignal (0x0x7319c3314cc0) 0 empty + +Vtable for QPinchGesture +QPinchGesture::_ZTV13QPinchGesture: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QPinchGesture) +16 (int (*)(...))QPinchGesture::metaObject +24 (int (*)(...))QPinchGesture::qt_metacast +32 (int (*)(...))QPinchGesture::qt_metacall +40 (int (*)(...))QPinchGesture::~QPinchGesture +48 (int (*)(...))QPinchGesture::~QPinchGesture +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QPinchGesture + size=16 align=8 + base size=16 base align=8 +QPinchGesture (0x0x7319c33181a0) 0 + vptr=((& QPinchGesture::_ZTV13QPinchGesture) + 16) +QGesture (0x0x7319c3318208) 0 + primary-for QPinchGesture (0x0x7319c33181a0) +QObject (0x0x7319c3314c60) 0 + primary-for QGesture (0x0x7319c3318208) + +Class QSwipeGesture::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSwipeGesture::QPrivateSignal (0x0x7319c336d060) 0 empty + +Vtable for QSwipeGesture +QSwipeGesture::_ZTV13QSwipeGesture: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QSwipeGesture) +16 (int (*)(...))QSwipeGesture::metaObject +24 (int (*)(...))QSwipeGesture::qt_metacast +32 (int (*)(...))QSwipeGesture::qt_metacall +40 (int (*)(...))QSwipeGesture::~QSwipeGesture +48 (int (*)(...))QSwipeGesture::~QSwipeGesture +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QSwipeGesture + size=16 align=8 + base size=16 base align=8 +QSwipeGesture (0x0x7319c336b618) 0 + vptr=((& QSwipeGesture::_ZTV13QSwipeGesture) + 16) +QGesture (0x0x7319c336b680) 0 + primary-for QSwipeGesture (0x0x7319c336b618) +QObject (0x0x7319c336d000) 0 + primary-for QGesture (0x0x7319c336b680) + +Class QTapGesture::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTapGesture::QPrivateSignal (0x0x7319c336d300) 0 empty + +Vtable for QTapGesture +QTapGesture::_ZTV11QTapGesture: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QTapGesture) +16 (int (*)(...))QTapGesture::metaObject +24 (int (*)(...))QTapGesture::qt_metacast +32 (int (*)(...))QTapGesture::qt_metacall +40 (int (*)(...))QTapGesture::~QTapGesture +48 (int (*)(...))QTapGesture::~QTapGesture +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QTapGesture + size=16 align=8 + base size=16 base align=8 +QTapGesture (0x0x7319c336b6e8) 0 + vptr=((& QTapGesture::_ZTV11QTapGesture) + 16) +QGesture (0x0x7319c336b750) 0 + primary-for QTapGesture (0x0x7319c336b6e8) +QObject (0x0x7319c336d2a0) 0 + primary-for QGesture (0x0x7319c336b750) + +Class QTapAndHoldGesture::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTapAndHoldGesture::QPrivateSignal (0x0x7319c336d4e0) 0 empty + +Vtable for QTapAndHoldGesture +QTapAndHoldGesture::_ZTV18QTapAndHoldGesture: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QTapAndHoldGesture) +16 (int (*)(...))QTapAndHoldGesture::metaObject +24 (int (*)(...))QTapAndHoldGesture::qt_metacast +32 (int (*)(...))QTapAndHoldGesture::qt_metacall +40 (int (*)(...))QTapAndHoldGesture::~QTapAndHoldGesture +48 (int (*)(...))QTapAndHoldGesture::~QTapAndHoldGesture +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QTapAndHoldGesture + size=16 align=8 + base size=16 base align=8 +QTapAndHoldGesture (0x0x7319c336b7b8) 0 + vptr=((& QTapAndHoldGesture::_ZTV18QTapAndHoldGesture) + 16) +QGesture (0x0x7319c336b820) 0 + primary-for QTapAndHoldGesture (0x0x7319c336b7b8) +QObject (0x0x7319c336d480) 0 + primary-for QGesture (0x0x7319c336b820) + +Vtable for QGestureEvent +QGestureEvent::_ZTV13QGestureEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QGestureEvent) +16 (int (*)(...))QGestureEvent::~QGestureEvent +24 (int (*)(...))QGestureEvent::~QGestureEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QEvent::clone + +Class QGestureEvent + size=64 align=8 + base size=64 base align=8 +QGestureEvent (0x0x7319c336b888) 0 + vptr=((& QGestureEvent::_ZTV13QGestureEvent) + 16) +QEvent (0x0x7319c336d660) 0 + primary-for QGestureEvent (0x0x7319c336b888) + +Vtable for QGestureRecognizer +QGestureRecognizer::_ZTV18QGestureRecognizer: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QGestureRecognizer) +16 0 +24 0 +32 (int (*)(...))QGestureRecognizer::create +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))QGestureRecognizer::reset + +Class QGestureRecognizer + size=8 align=8 + base size=8 base align=8 +QGestureRecognizer (0x0x7319c3000f60) 0 nearly-empty + vptr=((& QGestureRecognizer::_ZTV18QGestureRecognizer) + 16) + +Vtable for QGraphicsItem +QGraphicsItem::_ZTV13QGraphicsItem: 39 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QGraphicsItem) +16 0 +24 0 +32 (int (*)(...))QGraphicsItem::advance +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))QGraphicsItem::shape +56 (int (*)(...))QGraphicsItem::contains +64 (int (*)(...))QGraphicsItem::collidesWithItem +72 (int (*)(...))QGraphicsItem::collidesWithPath +80 (int (*)(...))QGraphicsItem::isObscuredBy +88 (int (*)(...))QGraphicsItem::opaqueArea +96 (int (*)(...))__cxa_pure_virtual +104 (int (*)(...))QGraphicsItem::type +112 (int (*)(...))QGraphicsItem::sceneEventFilter +120 (int (*)(...))QGraphicsItem::sceneEvent +128 (int (*)(...))QGraphicsItem::contextMenuEvent +136 (int (*)(...))QGraphicsItem::dragEnterEvent +144 (int (*)(...))QGraphicsItem::dragLeaveEvent +152 (int (*)(...))QGraphicsItem::dragMoveEvent +160 (int (*)(...))QGraphicsItem::dropEvent +168 (int (*)(...))QGraphicsItem::focusInEvent +176 (int (*)(...))QGraphicsItem::focusOutEvent +184 (int (*)(...))QGraphicsItem::hoverEnterEvent +192 (int (*)(...))QGraphicsItem::hoverMoveEvent +200 (int (*)(...))QGraphicsItem::hoverLeaveEvent +208 (int (*)(...))QGraphicsItem::keyPressEvent +216 (int (*)(...))QGraphicsItem::keyReleaseEvent +224 (int (*)(...))QGraphicsItem::mousePressEvent +232 (int (*)(...))QGraphicsItem::mouseMoveEvent +240 (int (*)(...))QGraphicsItem::mouseReleaseEvent +248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent +256 (int (*)(...))QGraphicsItem::wheelEvent +264 (int (*)(...))QGraphicsItem::inputMethodEvent +272 (int (*)(...))QGraphicsItem::inputMethodQuery +280 (int (*)(...))QGraphicsItem::itemChange +288 (int (*)(...))QGraphicsItem::supportsExtension +296 (int (*)(...))QGraphicsItem::setExtension +304 (int (*)(...))QGraphicsItem::extension + +Class QGraphicsItem + size=16 align=8 + base size=16 base align=8 +QGraphicsItem (0x0x7319c3011540) 0 + vptr=((& QGraphicsItem::_ZTV13QGraphicsItem) + 16) + +Class QGraphicsObject::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGraphicsObject::QPrivateSignal (0x0x7319c3086b40) 0 empty + +Vtable for QGraphicsObject +QGraphicsObject::_ZTV15QGraphicsObject: 53 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QGraphicsObject) +16 (int (*)(...))QGraphicsObject::metaObject +24 (int (*)(...))QGraphicsObject::qt_metacast +32 (int (*)(...))QGraphicsObject::qt_metacall +40 0 +48 0 +56 (int (*)(...))QGraphicsObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))-16 +120 (int (*)(...))(& _ZTI15QGraphicsObject) +128 0 +136 0 +144 (int (*)(...))QGraphicsItem::advance +152 (int (*)(...))__cxa_pure_virtual +160 (int (*)(...))QGraphicsItem::shape +168 (int (*)(...))QGraphicsItem::contains +176 (int (*)(...))QGraphicsItem::collidesWithItem +184 (int (*)(...))QGraphicsItem::collidesWithPath +192 (int (*)(...))QGraphicsItem::isObscuredBy +200 (int (*)(...))QGraphicsItem::opaqueArea +208 (int (*)(...))__cxa_pure_virtual +216 (int (*)(...))QGraphicsItem::type +224 (int (*)(...))QGraphicsItem::sceneEventFilter +232 (int (*)(...))QGraphicsItem::sceneEvent +240 (int (*)(...))QGraphicsItem::contextMenuEvent +248 (int (*)(...))QGraphicsItem::dragEnterEvent +256 (int (*)(...))QGraphicsItem::dragLeaveEvent +264 (int (*)(...))QGraphicsItem::dragMoveEvent +272 (int (*)(...))QGraphicsItem::dropEvent +280 (int (*)(...))QGraphicsItem::focusInEvent +288 (int (*)(...))QGraphicsItem::focusOutEvent +296 (int (*)(...))QGraphicsItem::hoverEnterEvent +304 (int (*)(...))QGraphicsItem::hoverMoveEvent +312 (int (*)(...))QGraphicsItem::hoverLeaveEvent +320 (int (*)(...))QGraphicsItem::keyPressEvent +328 (int (*)(...))QGraphicsItem::keyReleaseEvent +336 (int (*)(...))QGraphicsItem::mousePressEvent +344 (int (*)(...))QGraphicsItem::mouseMoveEvent +352 (int (*)(...))QGraphicsItem::mouseReleaseEvent +360 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent +368 (int (*)(...))QGraphicsItem::wheelEvent +376 (int (*)(...))QGraphicsItem::inputMethodEvent +384 (int (*)(...))QGraphicsItem::inputMethodQuery +392 (int (*)(...))QGraphicsItem::itemChange +400 (int (*)(...))QGraphicsItem::supportsExtension +408 (int (*)(...))QGraphicsItem::setExtension +416 (int (*)(...))QGraphicsItem::extension + +Class QGraphicsObject + size=32 align=8 + base size=32 base align=8 +QGraphicsObject (0x0x7319c3066e70) 0 + vptr=((& QGraphicsObject::_ZTV15QGraphicsObject) + 16) +QObject (0x0x7319c3086a80) 0 + primary-for QGraphicsObject (0x0x7319c3066e70) +QGraphicsItem (0x0x7319c3086ae0) 16 + vptr=((& QGraphicsObject::_ZTV15QGraphicsObject) + 128) + +Vtable for QAbstractGraphicsShapeItem +QAbstractGraphicsShapeItem::_ZTV26QAbstractGraphicsShapeItem: 39 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI26QAbstractGraphicsShapeItem) +16 0 +24 0 +32 (int (*)(...))QGraphicsItem::advance +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))QGraphicsItem::shape +56 (int (*)(...))QGraphicsItem::contains +64 (int (*)(...))QGraphicsItem::collidesWithItem +72 (int (*)(...))QGraphicsItem::collidesWithPath +80 (int (*)(...))QAbstractGraphicsShapeItem::isObscuredBy +88 (int (*)(...))QAbstractGraphicsShapeItem::opaqueArea +96 (int (*)(...))__cxa_pure_virtual +104 (int (*)(...))QGraphicsItem::type +112 (int (*)(...))QGraphicsItem::sceneEventFilter +120 (int (*)(...))QGraphicsItem::sceneEvent +128 (int (*)(...))QGraphicsItem::contextMenuEvent +136 (int (*)(...))QGraphicsItem::dragEnterEvent +144 (int (*)(...))QGraphicsItem::dragLeaveEvent +152 (int (*)(...))QGraphicsItem::dragMoveEvent +160 (int (*)(...))QGraphicsItem::dropEvent +168 (int (*)(...))QGraphicsItem::focusInEvent +176 (int (*)(...))QGraphicsItem::focusOutEvent +184 (int (*)(...))QGraphicsItem::hoverEnterEvent +192 (int (*)(...))QGraphicsItem::hoverMoveEvent +200 (int (*)(...))QGraphicsItem::hoverLeaveEvent +208 (int (*)(...))QGraphicsItem::keyPressEvent +216 (int (*)(...))QGraphicsItem::keyReleaseEvent +224 (int (*)(...))QGraphicsItem::mousePressEvent +232 (int (*)(...))QGraphicsItem::mouseMoveEvent +240 (int (*)(...))QGraphicsItem::mouseReleaseEvent +248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent +256 (int (*)(...))QGraphicsItem::wheelEvent +264 (int (*)(...))QGraphicsItem::inputMethodEvent +272 (int (*)(...))QGraphicsItem::inputMethodQuery +280 (int (*)(...))QGraphicsItem::itemChange +288 (int (*)(...))QGraphicsItem::supportsExtension +296 (int (*)(...))QGraphicsItem::setExtension +304 (int (*)(...))QGraphicsItem::extension + +Class QAbstractGraphicsShapeItem + size=16 align=8 + base size=16 base align=8 +QAbstractGraphicsShapeItem (0x0x7319c300c6e8) 0 + vptr=((& QAbstractGraphicsShapeItem::_ZTV26QAbstractGraphicsShapeItem) + 16) +QGraphicsItem (0x0x7319c3086c00) 0 + primary-for QAbstractGraphicsShapeItem (0x0x7319c300c6e8) + +Vtable for QGraphicsPathItem +QGraphicsPathItem::_ZTV17QGraphicsPathItem: 39 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QGraphicsPathItem) +16 (int (*)(...))QGraphicsPathItem::~QGraphicsPathItem +24 (int (*)(...))QGraphicsPathItem::~QGraphicsPathItem +32 (int (*)(...))QGraphicsItem::advance +40 (int (*)(...))QGraphicsPathItem::boundingRect +48 (int (*)(...))QGraphicsPathItem::shape +56 (int (*)(...))QGraphicsPathItem::contains +64 (int (*)(...))QGraphicsItem::collidesWithItem +72 (int (*)(...))QGraphicsItem::collidesWithPath +80 (int (*)(...))QGraphicsPathItem::isObscuredBy +88 (int (*)(...))QGraphicsPathItem::opaqueArea +96 (int (*)(...))QGraphicsPathItem::paint +104 (int (*)(...))QGraphicsPathItem::type +112 (int (*)(...))QGraphicsItem::sceneEventFilter +120 (int (*)(...))QGraphicsItem::sceneEvent +128 (int (*)(...))QGraphicsItem::contextMenuEvent +136 (int (*)(...))QGraphicsItem::dragEnterEvent +144 (int (*)(...))QGraphicsItem::dragLeaveEvent +152 (int (*)(...))QGraphicsItem::dragMoveEvent +160 (int (*)(...))QGraphicsItem::dropEvent +168 (int (*)(...))QGraphicsItem::focusInEvent +176 (int (*)(...))QGraphicsItem::focusOutEvent +184 (int (*)(...))QGraphicsItem::hoverEnterEvent +192 (int (*)(...))QGraphicsItem::hoverMoveEvent +200 (int (*)(...))QGraphicsItem::hoverLeaveEvent +208 (int (*)(...))QGraphicsItem::keyPressEvent +216 (int (*)(...))QGraphicsItem::keyReleaseEvent +224 (int (*)(...))QGraphicsItem::mousePressEvent +232 (int (*)(...))QGraphicsItem::mouseMoveEvent +240 (int (*)(...))QGraphicsItem::mouseReleaseEvent +248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent +256 (int (*)(...))QGraphicsItem::wheelEvent +264 (int (*)(...))QGraphicsItem::inputMethodEvent +272 (int (*)(...))QGraphicsItem::inputMethodQuery +280 (int (*)(...))QGraphicsItem::itemChange +288 (int (*)(...))QGraphicsPathItem::supportsExtension +296 (int (*)(...))QGraphicsPathItem::setExtension +304 (int (*)(...))QGraphicsPathItem::extension + +Class QGraphicsPathItem + size=16 align=8 + base size=16 base align=8 +QGraphicsPathItem (0x0x7319c300c750) 0 + vptr=((& QGraphicsPathItem::_ZTV17QGraphicsPathItem) + 16) +QAbstractGraphicsShapeItem (0x0x7319c300c7b8) 0 + primary-for QGraphicsPathItem (0x0x7319c300c750) +QGraphicsItem (0x0x7319c3086d20) 0 + primary-for QAbstractGraphicsShapeItem (0x0x7319c300c7b8) + +Vtable for QGraphicsRectItem +QGraphicsRectItem::_ZTV17QGraphicsRectItem: 39 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QGraphicsRectItem) +16 (int (*)(...))QGraphicsRectItem::~QGraphicsRectItem +24 (int (*)(...))QGraphicsRectItem::~QGraphicsRectItem +32 (int (*)(...))QGraphicsItem::advance +40 (int (*)(...))QGraphicsRectItem::boundingRect +48 (int (*)(...))QGraphicsRectItem::shape +56 (int (*)(...))QGraphicsRectItem::contains +64 (int (*)(...))QGraphicsItem::collidesWithItem +72 (int (*)(...))QGraphicsItem::collidesWithPath +80 (int (*)(...))QGraphicsRectItem::isObscuredBy +88 (int (*)(...))QGraphicsRectItem::opaqueArea +96 (int (*)(...))QGraphicsRectItem::paint +104 (int (*)(...))QGraphicsRectItem::type +112 (int (*)(...))QGraphicsItem::sceneEventFilter +120 (int (*)(...))QGraphicsItem::sceneEvent +128 (int (*)(...))QGraphicsItem::contextMenuEvent +136 (int (*)(...))QGraphicsItem::dragEnterEvent +144 (int (*)(...))QGraphicsItem::dragLeaveEvent +152 (int (*)(...))QGraphicsItem::dragMoveEvent +160 (int (*)(...))QGraphicsItem::dropEvent +168 (int (*)(...))QGraphicsItem::focusInEvent +176 (int (*)(...))QGraphicsItem::focusOutEvent +184 (int (*)(...))QGraphicsItem::hoverEnterEvent +192 (int (*)(...))QGraphicsItem::hoverMoveEvent +200 (int (*)(...))QGraphicsItem::hoverLeaveEvent +208 (int (*)(...))QGraphicsItem::keyPressEvent +216 (int (*)(...))QGraphicsItem::keyReleaseEvent +224 (int (*)(...))QGraphicsItem::mousePressEvent +232 (int (*)(...))QGraphicsItem::mouseMoveEvent +240 (int (*)(...))QGraphicsItem::mouseReleaseEvent +248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent +256 (int (*)(...))QGraphicsItem::wheelEvent +264 (int (*)(...))QGraphicsItem::inputMethodEvent +272 (int (*)(...))QGraphicsItem::inputMethodQuery +280 (int (*)(...))QGraphicsItem::itemChange +288 (int (*)(...))QGraphicsRectItem::supportsExtension +296 (int (*)(...))QGraphicsRectItem::setExtension +304 (int (*)(...))QGraphicsRectItem::extension + +Class QGraphicsRectItem + size=16 align=8 + base size=16 base align=8 +QGraphicsRectItem (0x0x7319c300c820) 0 + vptr=((& QGraphicsRectItem::_ZTV17QGraphicsRectItem) + 16) +QAbstractGraphicsShapeItem (0x0x7319c300c888) 0 + primary-for QGraphicsRectItem (0x0x7319c300c820) +QGraphicsItem (0x0x7319c3086e40) 0 + primary-for QAbstractGraphicsShapeItem (0x0x7319c300c888) + +Vtable for QGraphicsEllipseItem +QGraphicsEllipseItem::_ZTV20QGraphicsEllipseItem: 39 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QGraphicsEllipseItem) +16 (int (*)(...))QGraphicsEllipseItem::~QGraphicsEllipseItem +24 (int (*)(...))QGraphicsEllipseItem::~QGraphicsEllipseItem +32 (int (*)(...))QGraphicsItem::advance +40 (int (*)(...))QGraphicsEllipseItem::boundingRect +48 (int (*)(...))QGraphicsEllipseItem::shape +56 (int (*)(...))QGraphicsEllipseItem::contains +64 (int (*)(...))QGraphicsItem::collidesWithItem +72 (int (*)(...))QGraphicsItem::collidesWithPath +80 (int (*)(...))QGraphicsEllipseItem::isObscuredBy +88 (int (*)(...))QGraphicsEllipseItem::opaqueArea +96 (int (*)(...))QGraphicsEllipseItem::paint +104 (int (*)(...))QGraphicsEllipseItem::type +112 (int (*)(...))QGraphicsItem::sceneEventFilter +120 (int (*)(...))QGraphicsItem::sceneEvent +128 (int (*)(...))QGraphicsItem::contextMenuEvent +136 (int (*)(...))QGraphicsItem::dragEnterEvent +144 (int (*)(...))QGraphicsItem::dragLeaveEvent +152 (int (*)(...))QGraphicsItem::dragMoveEvent +160 (int (*)(...))QGraphicsItem::dropEvent +168 (int (*)(...))QGraphicsItem::focusInEvent +176 (int (*)(...))QGraphicsItem::focusOutEvent +184 (int (*)(...))QGraphicsItem::hoverEnterEvent +192 (int (*)(...))QGraphicsItem::hoverMoveEvent +200 (int (*)(...))QGraphicsItem::hoverLeaveEvent +208 (int (*)(...))QGraphicsItem::keyPressEvent +216 (int (*)(...))QGraphicsItem::keyReleaseEvent +224 (int (*)(...))QGraphicsItem::mousePressEvent +232 (int (*)(...))QGraphicsItem::mouseMoveEvent +240 (int (*)(...))QGraphicsItem::mouseReleaseEvent +248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent +256 (int (*)(...))QGraphicsItem::wheelEvent +264 (int (*)(...))QGraphicsItem::inputMethodEvent +272 (int (*)(...))QGraphicsItem::inputMethodQuery +280 (int (*)(...))QGraphicsItem::itemChange +288 (int (*)(...))QGraphicsEllipseItem::supportsExtension +296 (int (*)(...))QGraphicsEllipseItem::setExtension +304 (int (*)(...))QGraphicsEllipseItem::extension + +Class QGraphicsEllipseItem + size=16 align=8 + base size=16 base align=8 +QGraphicsEllipseItem (0x0x7319c300c8f0) 0 + vptr=((& QGraphicsEllipseItem::_ZTV20QGraphicsEllipseItem) + 16) +QAbstractGraphicsShapeItem (0x0x7319c300c958) 0 + primary-for QGraphicsEllipseItem (0x0x7319c300c8f0) +QGraphicsItem (0x0x7319c30af000) 0 + primary-for QAbstractGraphicsShapeItem (0x0x7319c300c958) + +Vtable for QGraphicsPolygonItem +QGraphicsPolygonItem::_ZTV20QGraphicsPolygonItem: 39 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QGraphicsPolygonItem) +16 (int (*)(...))QGraphicsPolygonItem::~QGraphicsPolygonItem +24 (int (*)(...))QGraphicsPolygonItem::~QGraphicsPolygonItem +32 (int (*)(...))QGraphicsItem::advance +40 (int (*)(...))QGraphicsPolygonItem::boundingRect +48 (int (*)(...))QGraphicsPolygonItem::shape +56 (int (*)(...))QGraphicsPolygonItem::contains +64 (int (*)(...))QGraphicsItem::collidesWithItem +72 (int (*)(...))QGraphicsItem::collidesWithPath +80 (int (*)(...))QGraphicsPolygonItem::isObscuredBy +88 (int (*)(...))QGraphicsPolygonItem::opaqueArea +96 (int (*)(...))QGraphicsPolygonItem::paint +104 (int (*)(...))QGraphicsPolygonItem::type +112 (int (*)(...))QGraphicsItem::sceneEventFilter +120 (int (*)(...))QGraphicsItem::sceneEvent +128 (int (*)(...))QGraphicsItem::contextMenuEvent +136 (int (*)(...))QGraphicsItem::dragEnterEvent +144 (int (*)(...))QGraphicsItem::dragLeaveEvent +152 (int (*)(...))QGraphicsItem::dragMoveEvent +160 (int (*)(...))QGraphicsItem::dropEvent +168 (int (*)(...))QGraphicsItem::focusInEvent +176 (int (*)(...))QGraphicsItem::focusOutEvent +184 (int (*)(...))QGraphicsItem::hoverEnterEvent +192 (int (*)(...))QGraphicsItem::hoverMoveEvent +200 (int (*)(...))QGraphicsItem::hoverLeaveEvent +208 (int (*)(...))QGraphicsItem::keyPressEvent +216 (int (*)(...))QGraphicsItem::keyReleaseEvent +224 (int (*)(...))QGraphicsItem::mousePressEvent +232 (int (*)(...))QGraphicsItem::mouseMoveEvent +240 (int (*)(...))QGraphicsItem::mouseReleaseEvent +248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent +256 (int (*)(...))QGraphicsItem::wheelEvent +264 (int (*)(...))QGraphicsItem::inputMethodEvent +272 (int (*)(...))QGraphicsItem::inputMethodQuery +280 (int (*)(...))QGraphicsItem::itemChange +288 (int (*)(...))QGraphicsPolygonItem::supportsExtension +296 (int (*)(...))QGraphicsPolygonItem::setExtension +304 (int (*)(...))QGraphicsPolygonItem::extension + +Class QGraphicsPolygonItem + size=16 align=8 + base size=16 base align=8 +QGraphicsPolygonItem (0x0x7319c300c9c0) 0 + vptr=((& QGraphicsPolygonItem::_ZTV20QGraphicsPolygonItem) + 16) +QAbstractGraphicsShapeItem (0x0x7319c300ca28) 0 + primary-for QGraphicsPolygonItem (0x0x7319c300c9c0) +QGraphicsItem (0x0x7319c30af180) 0 + primary-for QAbstractGraphicsShapeItem (0x0x7319c300ca28) + +Vtable for QGraphicsLineItem +QGraphicsLineItem::_ZTV17QGraphicsLineItem: 39 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QGraphicsLineItem) +16 (int (*)(...))QGraphicsLineItem::~QGraphicsLineItem +24 (int (*)(...))QGraphicsLineItem::~QGraphicsLineItem +32 (int (*)(...))QGraphicsItem::advance +40 (int (*)(...))QGraphicsLineItem::boundingRect +48 (int (*)(...))QGraphicsLineItem::shape +56 (int (*)(...))QGraphicsLineItem::contains +64 (int (*)(...))QGraphicsItem::collidesWithItem +72 (int (*)(...))QGraphicsItem::collidesWithPath +80 (int (*)(...))QGraphicsLineItem::isObscuredBy +88 (int (*)(...))QGraphicsLineItem::opaqueArea +96 (int (*)(...))QGraphicsLineItem::paint +104 (int (*)(...))QGraphicsLineItem::type +112 (int (*)(...))QGraphicsItem::sceneEventFilter +120 (int (*)(...))QGraphicsItem::sceneEvent +128 (int (*)(...))QGraphicsItem::contextMenuEvent +136 (int (*)(...))QGraphicsItem::dragEnterEvent +144 (int (*)(...))QGraphicsItem::dragLeaveEvent +152 (int (*)(...))QGraphicsItem::dragMoveEvent +160 (int (*)(...))QGraphicsItem::dropEvent +168 (int (*)(...))QGraphicsItem::focusInEvent +176 (int (*)(...))QGraphicsItem::focusOutEvent +184 (int (*)(...))QGraphicsItem::hoverEnterEvent +192 (int (*)(...))QGraphicsItem::hoverMoveEvent +200 (int (*)(...))QGraphicsItem::hoverLeaveEvent +208 (int (*)(...))QGraphicsItem::keyPressEvent +216 (int (*)(...))QGraphicsItem::keyReleaseEvent +224 (int (*)(...))QGraphicsItem::mousePressEvent +232 (int (*)(...))QGraphicsItem::mouseMoveEvent +240 (int (*)(...))QGraphicsItem::mouseReleaseEvent +248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent +256 (int (*)(...))QGraphicsItem::wheelEvent +264 (int (*)(...))QGraphicsItem::inputMethodEvent +272 (int (*)(...))QGraphicsItem::inputMethodQuery +280 (int (*)(...))QGraphicsItem::itemChange +288 (int (*)(...))QGraphicsLineItem::supportsExtension +296 (int (*)(...))QGraphicsLineItem::setExtension +304 (int (*)(...))QGraphicsLineItem::extension + +Class QGraphicsLineItem + size=16 align=8 + base size=16 base align=8 +QGraphicsLineItem (0x0x7319c300ca90) 0 + vptr=((& QGraphicsLineItem::_ZTV17QGraphicsLineItem) + 16) +QGraphicsItem (0x0x7319c30af2a0) 0 + primary-for QGraphicsLineItem (0x0x7319c300ca90) + +Vtable for QGraphicsPixmapItem +QGraphicsPixmapItem::_ZTV19QGraphicsPixmapItem: 39 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QGraphicsPixmapItem) +16 (int (*)(...))QGraphicsPixmapItem::~QGraphicsPixmapItem +24 (int (*)(...))QGraphicsPixmapItem::~QGraphicsPixmapItem +32 (int (*)(...))QGraphicsItem::advance +40 (int (*)(...))QGraphicsPixmapItem::boundingRect +48 (int (*)(...))QGraphicsPixmapItem::shape +56 (int (*)(...))QGraphicsPixmapItem::contains +64 (int (*)(...))QGraphicsItem::collidesWithItem +72 (int (*)(...))QGraphicsItem::collidesWithPath +80 (int (*)(...))QGraphicsPixmapItem::isObscuredBy +88 (int (*)(...))QGraphicsPixmapItem::opaqueArea +96 (int (*)(...))QGraphicsPixmapItem::paint +104 (int (*)(...))QGraphicsPixmapItem::type +112 (int (*)(...))QGraphicsItem::sceneEventFilter +120 (int (*)(...))QGraphicsItem::sceneEvent +128 (int (*)(...))QGraphicsItem::contextMenuEvent +136 (int (*)(...))QGraphicsItem::dragEnterEvent +144 (int (*)(...))QGraphicsItem::dragLeaveEvent +152 (int (*)(...))QGraphicsItem::dragMoveEvent +160 (int (*)(...))QGraphicsItem::dropEvent +168 (int (*)(...))QGraphicsItem::focusInEvent +176 (int (*)(...))QGraphicsItem::focusOutEvent +184 (int (*)(...))QGraphicsItem::hoverEnterEvent +192 (int (*)(...))QGraphicsItem::hoverMoveEvent +200 (int (*)(...))QGraphicsItem::hoverLeaveEvent +208 (int (*)(...))QGraphicsItem::keyPressEvent +216 (int (*)(...))QGraphicsItem::keyReleaseEvent +224 (int (*)(...))QGraphicsItem::mousePressEvent +232 (int (*)(...))QGraphicsItem::mouseMoveEvent +240 (int (*)(...))QGraphicsItem::mouseReleaseEvent +248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent +256 (int (*)(...))QGraphicsItem::wheelEvent +264 (int (*)(...))QGraphicsItem::inputMethodEvent +272 (int (*)(...))QGraphicsItem::inputMethodQuery +280 (int (*)(...))QGraphicsItem::itemChange +288 (int (*)(...))QGraphicsPixmapItem::supportsExtension +296 (int (*)(...))QGraphicsPixmapItem::setExtension +304 (int (*)(...))QGraphicsPixmapItem::extension + +Class QGraphicsPixmapItem + size=16 align=8 + base size=16 base align=8 +QGraphicsPixmapItem (0x0x7319c300caf8) 0 + vptr=((& QGraphicsPixmapItem::_ZTV19QGraphicsPixmapItem) + 16) +QGraphicsItem (0x0x7319c30af420) 0 + primary-for QGraphicsPixmapItem (0x0x7319c300caf8) + +Class QGraphicsTextItem::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGraphicsTextItem::QPrivateSignal (0x0x7319c30af660) 0 empty + +Vtable for QGraphicsTextItem +QGraphicsTextItem::_ZTV17QGraphicsTextItem: 82 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QGraphicsTextItem) +16 (int (*)(...))QGraphicsTextItem::metaObject +24 (int (*)(...))QGraphicsTextItem::qt_metacast +32 (int (*)(...))QGraphicsTextItem::qt_metacall +40 (int (*)(...))QGraphicsTextItem::~QGraphicsTextItem +48 (int (*)(...))QGraphicsTextItem::~QGraphicsTextItem +56 (int (*)(...))QGraphicsObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QGraphicsTextItem::boundingRect +120 (int (*)(...))QGraphicsTextItem::shape +128 (int (*)(...))QGraphicsTextItem::contains +136 (int (*)(...))QGraphicsTextItem::paint +144 (int (*)(...))QGraphicsTextItem::isObscuredBy +152 (int (*)(...))QGraphicsTextItem::opaqueArea +160 (int (*)(...))QGraphicsTextItem::type +168 (int (*)(...))QGraphicsTextItem::sceneEvent +176 (int (*)(...))QGraphicsTextItem::mousePressEvent +184 (int (*)(...))QGraphicsTextItem::mouseMoveEvent +192 (int (*)(...))QGraphicsTextItem::mouseReleaseEvent +200 (int (*)(...))QGraphicsTextItem::mouseDoubleClickEvent +208 (int (*)(...))QGraphicsTextItem::contextMenuEvent +216 (int (*)(...))QGraphicsTextItem::keyPressEvent +224 (int (*)(...))QGraphicsTextItem::keyReleaseEvent +232 (int (*)(...))QGraphicsTextItem::focusInEvent +240 (int (*)(...))QGraphicsTextItem::focusOutEvent +248 (int (*)(...))QGraphicsTextItem::dragEnterEvent +256 (int (*)(...))QGraphicsTextItem::dragLeaveEvent +264 (int (*)(...))QGraphicsTextItem::dragMoveEvent +272 (int (*)(...))QGraphicsTextItem::dropEvent +280 (int (*)(...))QGraphicsTextItem::inputMethodEvent +288 (int (*)(...))QGraphicsTextItem::hoverEnterEvent +296 (int (*)(...))QGraphicsTextItem::hoverMoveEvent +304 (int (*)(...))QGraphicsTextItem::hoverLeaveEvent +312 (int (*)(...))QGraphicsTextItem::inputMethodQuery +320 (int (*)(...))QGraphicsTextItem::supportsExtension +328 (int (*)(...))QGraphicsTextItem::setExtension +336 (int (*)(...))QGraphicsTextItem::extension +344 (int (*)(...))-16 +352 (int (*)(...))(& _ZTI17QGraphicsTextItem) +360 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItemD1Ev +368 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItemD0Ev +376 (int (*)(...))QGraphicsItem::advance +384 (int (*)(...))QGraphicsTextItem::_ZThn16_NK17QGraphicsTextItem12boundingRectEv +392 (int (*)(...))QGraphicsTextItem::_ZThn16_NK17QGraphicsTextItem5shapeEv +400 (int (*)(...))QGraphicsTextItem::_ZThn16_NK17QGraphicsTextItem8containsERK7QPointF +408 (int (*)(...))QGraphicsItem::collidesWithItem +416 (int (*)(...))QGraphicsItem::collidesWithPath +424 (int (*)(...))QGraphicsTextItem::_ZThn16_NK17QGraphicsTextItem12isObscuredByEPK13QGraphicsItem +432 (int (*)(...))QGraphicsTextItem::_ZThn16_NK17QGraphicsTextItem10opaqueAreaEv +440 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget +448 (int (*)(...))QGraphicsTextItem::_ZThn16_NK17QGraphicsTextItem4typeEv +456 (int (*)(...))QGraphicsItem::sceneEventFilter +464 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem10sceneEventEP6QEvent +472 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem16contextMenuEventEP30QGraphicsSceneContextMenuEvent +480 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem14dragEnterEventEP27QGraphicsSceneDragDropEvent +488 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem14dragLeaveEventEP27QGraphicsSceneDragDropEvent +496 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem13dragMoveEventEP27QGraphicsSceneDragDropEvent +504 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem9dropEventEP27QGraphicsSceneDragDropEvent +512 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem12focusInEventEP11QFocusEvent +520 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem13focusOutEventEP11QFocusEvent +528 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem15hoverEnterEventEP24QGraphicsSceneHoverEvent +536 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem14hoverMoveEventEP24QGraphicsSceneHoverEvent +544 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem15hoverLeaveEventEP24QGraphicsSceneHoverEvent +552 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem13keyPressEventEP9QKeyEvent +560 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem15keyReleaseEventEP9QKeyEvent +568 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem15mousePressEventEP24QGraphicsSceneMouseEvent +576 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem14mouseMoveEventEP24QGraphicsSceneMouseEvent +584 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem17mouseReleaseEventEP24QGraphicsSceneMouseEvent +592 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem21mouseDoubleClickEventEP24QGraphicsSceneMouseEvent +600 (int (*)(...))QGraphicsItem::wheelEvent +608 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem16inputMethodEventEP17QInputMethodEvent +616 (int (*)(...))QGraphicsTextItem::_ZThn16_NK17QGraphicsTextItem16inputMethodQueryEN2Qt16InputMethodQueryE +624 (int (*)(...))QGraphicsItem::itemChange +632 (int (*)(...))QGraphicsTextItem::_ZThn16_NK17QGraphicsTextItem17supportsExtensionEN13QGraphicsItem9ExtensionE +640 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem12setExtensionEN13QGraphicsItem9ExtensionERK8QVariant +648 (int (*)(...))QGraphicsTextItem::_ZThn16_NK17QGraphicsTextItem9extensionERK8QVariant + +Class QGraphicsTextItem + size=40 align=8 + base size=40 base align=8 +QGraphicsTextItem (0x0x7319c300cb60) 0 + vptr=((& QGraphicsTextItem::_ZTV17QGraphicsTextItem) + 16) +QGraphicsObject (0x0x7319c309fb60) 0 + primary-for QGraphicsTextItem (0x0x7319c300cb60) +QObject (0x0x7319c30af5a0) 0 + primary-for QGraphicsObject (0x0x7319c309fb60) +QGraphicsItem (0x0x7319c30af600) 16 + vptr=((& QGraphicsTextItem::_ZTV17QGraphicsTextItem) + 360) + +Vtable for QGraphicsSimpleTextItem +QGraphicsSimpleTextItem::_ZTV23QGraphicsSimpleTextItem: 39 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI23QGraphicsSimpleTextItem) +16 (int (*)(...))QGraphicsSimpleTextItem::~QGraphicsSimpleTextItem +24 (int (*)(...))QGraphicsSimpleTextItem::~QGraphicsSimpleTextItem +32 (int (*)(...))QGraphicsItem::advance +40 (int (*)(...))QGraphicsSimpleTextItem::boundingRect +48 (int (*)(...))QGraphicsSimpleTextItem::shape +56 (int (*)(...))QGraphicsSimpleTextItem::contains +64 (int (*)(...))QGraphicsItem::collidesWithItem +72 (int (*)(...))QGraphicsItem::collidesWithPath +80 (int (*)(...))QGraphicsSimpleTextItem::isObscuredBy +88 (int (*)(...))QGraphicsSimpleTextItem::opaqueArea +96 (int (*)(...))QGraphicsSimpleTextItem::paint +104 (int (*)(...))QGraphicsSimpleTextItem::type +112 (int (*)(...))QGraphicsItem::sceneEventFilter +120 (int (*)(...))QGraphicsItem::sceneEvent +128 (int (*)(...))QGraphicsItem::contextMenuEvent +136 (int (*)(...))QGraphicsItem::dragEnterEvent +144 (int (*)(...))QGraphicsItem::dragLeaveEvent +152 (int (*)(...))QGraphicsItem::dragMoveEvent +160 (int (*)(...))QGraphicsItem::dropEvent +168 (int (*)(...))QGraphicsItem::focusInEvent +176 (int (*)(...))QGraphicsItem::focusOutEvent +184 (int (*)(...))QGraphicsItem::hoverEnterEvent +192 (int (*)(...))QGraphicsItem::hoverMoveEvent +200 (int (*)(...))QGraphicsItem::hoverLeaveEvent +208 (int (*)(...))QGraphicsItem::keyPressEvent +216 (int (*)(...))QGraphicsItem::keyReleaseEvent +224 (int (*)(...))QGraphicsItem::mousePressEvent +232 (int (*)(...))QGraphicsItem::mouseMoveEvent +240 (int (*)(...))QGraphicsItem::mouseReleaseEvent +248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent +256 (int (*)(...))QGraphicsItem::wheelEvent +264 (int (*)(...))QGraphicsItem::inputMethodEvent +272 (int (*)(...))QGraphicsItem::inputMethodQuery +280 (int (*)(...))QGraphicsItem::itemChange +288 (int (*)(...))QGraphicsSimpleTextItem::supportsExtension +296 (int (*)(...))QGraphicsSimpleTextItem::setExtension +304 (int (*)(...))QGraphicsSimpleTextItem::extension + +Class QGraphicsSimpleTextItem + size=16 align=8 + base size=16 base align=8 +QGraphicsSimpleTextItem (0x0x7319c300cc98) 0 + vptr=((& QGraphicsSimpleTextItem::_ZTV23QGraphicsSimpleTextItem) + 16) +QAbstractGraphicsShapeItem (0x0x7319c300cd00) 0 + primary-for QGraphicsSimpleTextItem (0x0x7319c300cc98) +QGraphicsItem (0x0x7319c30af900) 0 + primary-for QAbstractGraphicsShapeItem (0x0x7319c300cd00) + +Vtable for QGraphicsItemGroup +QGraphicsItemGroup::_ZTV18QGraphicsItemGroup: 39 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QGraphicsItemGroup) +16 (int (*)(...))QGraphicsItemGroup::~QGraphicsItemGroup +24 (int (*)(...))QGraphicsItemGroup::~QGraphicsItemGroup +32 (int (*)(...))QGraphicsItem::advance +40 (int (*)(...))QGraphicsItemGroup::boundingRect +48 (int (*)(...))QGraphicsItem::shape +56 (int (*)(...))QGraphicsItem::contains +64 (int (*)(...))QGraphicsItem::collidesWithItem +72 (int (*)(...))QGraphicsItem::collidesWithPath +80 (int (*)(...))QGraphicsItemGroup::isObscuredBy +88 (int (*)(...))QGraphicsItemGroup::opaqueArea +96 (int (*)(...))QGraphicsItemGroup::paint +104 (int (*)(...))QGraphicsItemGroup::type +112 (int (*)(...))QGraphicsItem::sceneEventFilter +120 (int (*)(...))QGraphicsItem::sceneEvent +128 (int (*)(...))QGraphicsItem::contextMenuEvent +136 (int (*)(...))QGraphicsItem::dragEnterEvent +144 (int (*)(...))QGraphicsItem::dragLeaveEvent +152 (int (*)(...))QGraphicsItem::dragMoveEvent +160 (int (*)(...))QGraphicsItem::dropEvent +168 (int (*)(...))QGraphicsItem::focusInEvent +176 (int (*)(...))QGraphicsItem::focusOutEvent +184 (int (*)(...))QGraphicsItem::hoverEnterEvent +192 (int (*)(...))QGraphicsItem::hoverMoveEvent +200 (int (*)(...))QGraphicsItem::hoverLeaveEvent +208 (int (*)(...))QGraphicsItem::keyPressEvent +216 (int (*)(...))QGraphicsItem::keyReleaseEvent +224 (int (*)(...))QGraphicsItem::mousePressEvent +232 (int (*)(...))QGraphicsItem::mouseMoveEvent +240 (int (*)(...))QGraphicsItem::mouseReleaseEvent +248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent +256 (int (*)(...))QGraphicsItem::wheelEvent +264 (int (*)(...))QGraphicsItem::inputMethodEvent +272 (int (*)(...))QGraphicsItem::inputMethodQuery +280 (int (*)(...))QGraphicsItem::itemChange +288 (int (*)(...))QGraphicsItem::supportsExtension +296 (int (*)(...))QGraphicsItem::setExtension +304 (int (*)(...))QGraphicsItem::extension + +Class QGraphicsItemGroup + size=16 align=8 + base size=16 base align=8 +QGraphicsItemGroup (0x0x7319c300cd68) 0 + vptr=((& QGraphicsItemGroup::_ZTV18QGraphicsItemGroup) + 16) +QGraphicsItem (0x0x7319c30afa20) 0 + primary-for QGraphicsItemGroup (0x0x7319c300cd68) + +Vtable for QGraphicsLayoutItem +QGraphicsLayoutItem::_ZTV19QGraphicsLayoutItem: 9 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QGraphicsLayoutItem) +16 0 +24 0 +32 (int (*)(...))QGraphicsLayoutItem::setGeometry +40 (int (*)(...))QGraphicsLayoutItem::getContentsMargins +48 (int (*)(...))QGraphicsLayoutItem::updateGeometry +56 (int (*)(...))QGraphicsLayoutItem::isEmpty +64 (int (*)(...))__cxa_pure_virtual + +Class QGraphicsLayoutItem + size=16 align=8 + base size=16 base align=8 +QGraphicsLayoutItem (0x0x7319c3102000) 0 + vptr=((& QGraphicsLayoutItem::_ZTV19QGraphicsLayoutItem) + 16) + +Vtable for QGraphicsLayout +QGraphicsLayout::_ZTV15QGraphicsLayout: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QGraphicsLayout) +16 0 +24 0 +32 (int (*)(...))QGraphicsLayoutItem::setGeometry +40 (int (*)(...))QGraphicsLayout::getContentsMargins +48 (int (*)(...))QGraphicsLayout::updateGeometry +56 (int (*)(...))QGraphicsLayoutItem::isEmpty +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))QGraphicsLayout::invalidate +80 (int (*)(...))QGraphicsLayout::widgetEvent +88 (int (*)(...))__cxa_pure_virtual +96 (int (*)(...))__cxa_pure_virtual +104 (int (*)(...))__cxa_pure_virtual + +Class QGraphicsLayout + size=16 align=8 + base size=16 base align=8 +QGraphicsLayout (0x0x7319c30f99c0) 0 + vptr=((& QGraphicsLayout::_ZTV15QGraphicsLayout) + 16) +QGraphicsLayoutItem (0x0x7319c31028a0) 0 + primary-for QGraphicsLayout (0x0x7319c30f99c0) + +Class QGraphicsAnchor::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGraphicsAnchor::QPrivateSignal (0x0x7319c3102d80) 0 empty + +Vtable for QGraphicsAnchor +QGraphicsAnchor::_ZTV15QGraphicsAnchor: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QGraphicsAnchor) +16 (int (*)(...))QGraphicsAnchor::metaObject +24 (int (*)(...))QGraphicsAnchor::qt_metacast +32 (int (*)(...))QGraphicsAnchor::qt_metacall +40 (int (*)(...))QGraphicsAnchor::~QGraphicsAnchor +48 (int (*)(...))QGraphicsAnchor::~QGraphicsAnchor +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QGraphicsAnchor + size=16 align=8 + base size=16 base align=8 +QGraphicsAnchor (0x0x7319c30f9af8) 0 + vptr=((& QGraphicsAnchor::_ZTV15QGraphicsAnchor) + 16) +QObject (0x0x7319c3102d20) 0 + primary-for QGraphicsAnchor (0x0x7319c30f9af8) + +Vtable for QGraphicsAnchorLayout +QGraphicsAnchorLayout::_ZTV21QGraphicsAnchorLayout: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI21QGraphicsAnchorLayout) +16 (int (*)(...))QGraphicsAnchorLayout::~QGraphicsAnchorLayout +24 (int (*)(...))QGraphicsAnchorLayout::~QGraphicsAnchorLayout +32 (int (*)(...))QGraphicsAnchorLayout::setGeometry +40 (int (*)(...))QGraphicsLayout::getContentsMargins +48 (int (*)(...))QGraphicsLayout::updateGeometry +56 (int (*)(...))QGraphicsLayoutItem::isEmpty +64 (int (*)(...))QGraphicsAnchorLayout::sizeHint +72 (int (*)(...))QGraphicsAnchorLayout::invalidate +80 (int (*)(...))QGraphicsLayout::widgetEvent +88 (int (*)(...))QGraphicsAnchorLayout::count +96 (int (*)(...))QGraphicsAnchorLayout::itemAt +104 (int (*)(...))QGraphicsAnchorLayout::removeAt + +Class QGraphicsAnchorLayout + size=16 align=8 + base size=16 base align=8 +QGraphicsAnchorLayout (0x0x7319c30f9b60) 0 + vptr=((& QGraphicsAnchorLayout::_ZTV21QGraphicsAnchorLayout) + 16) +QGraphicsLayout (0x0x7319c30f9bc8) 0 + primary-for QGraphicsAnchorLayout (0x0x7319c30f9b60) +QGraphicsLayoutItem (0x0x7319c3102f00) 0 + primary-for QGraphicsLayout (0x0x7319c30f9bc8) + +Class QGraphicsEffect::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGraphicsEffect::QPrivateSignal (0x0x7319c312e0c0) 0 empty + +Vtable for QGraphicsEffect +QGraphicsEffect::_ZTV15QGraphicsEffect: 17 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QGraphicsEffect) +16 (int (*)(...))QGraphicsEffect::metaObject +24 (int (*)(...))QGraphicsEffect::qt_metacast +32 (int (*)(...))QGraphicsEffect::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QGraphicsEffect::boundingRectFor +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))QGraphicsEffect::sourceChanged + +Class QGraphicsEffect + size=16 align=8 + base size=16 base align=8 +QGraphicsEffect (0x0x7319c30f9c30) 0 + vptr=((& QGraphicsEffect::_ZTV15QGraphicsEffect) + 16) +QObject (0x0x7319c312e060) 0 + primary-for QGraphicsEffect (0x0x7319c30f9c30) + +Class QGraphicsColorizeEffect::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGraphicsColorizeEffect::QPrivateSignal (0x0x7319c312e8a0) 0 empty + +Vtable for QGraphicsColorizeEffect +QGraphicsColorizeEffect::_ZTV23QGraphicsColorizeEffect: 17 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI23QGraphicsColorizeEffect) +16 (int (*)(...))QGraphicsColorizeEffect::metaObject +24 (int (*)(...))QGraphicsColorizeEffect::qt_metacast +32 (int (*)(...))QGraphicsColorizeEffect::qt_metacall +40 (int (*)(...))QGraphicsColorizeEffect::~QGraphicsColorizeEffect +48 (int (*)(...))QGraphicsColorizeEffect::~QGraphicsColorizeEffect +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QGraphicsEffect::boundingRectFor +120 (int (*)(...))QGraphicsColorizeEffect::draw +128 (int (*)(...))QGraphicsEffect::sourceChanged + +Class QGraphicsColorizeEffect + size=16 align=8 + base size=16 base align=8 +QGraphicsColorizeEffect (0x0x7319c30f9f08) 0 + vptr=((& QGraphicsColorizeEffect::_ZTV23QGraphicsColorizeEffect) + 16) +QGraphicsEffect (0x0x7319c30f9f70) 0 + primary-for QGraphicsColorizeEffect (0x0x7319c30f9f08) +QObject (0x0x7319c312e840) 0 + primary-for QGraphicsEffect (0x0x7319c30f9f70) + +Class QGraphicsBlurEffect::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGraphicsBlurEffect::QPrivateSignal (0x0x7319c312ea80) 0 empty + +Vtable for QGraphicsBlurEffect +QGraphicsBlurEffect::_ZTV19QGraphicsBlurEffect: 17 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QGraphicsBlurEffect) +16 (int (*)(...))QGraphicsBlurEffect::metaObject +24 (int (*)(...))QGraphicsBlurEffect::qt_metacast +32 (int (*)(...))QGraphicsBlurEffect::qt_metacall +40 (int (*)(...))QGraphicsBlurEffect::~QGraphicsBlurEffect +48 (int (*)(...))QGraphicsBlurEffect::~QGraphicsBlurEffect +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QGraphicsBlurEffect::boundingRectFor +120 (int (*)(...))QGraphicsBlurEffect::draw +128 (int (*)(...))QGraphicsEffect::sourceChanged + +Class QGraphicsBlurEffect + size=16 align=8 + base size=16 base align=8 +QGraphicsBlurEffect (0x0x7319c315d000) 0 + vptr=((& QGraphicsBlurEffect::_ZTV19QGraphicsBlurEffect) + 16) +QGraphicsEffect (0x0x7319c315d068) 0 + primary-for QGraphicsBlurEffect (0x0x7319c315d000) +QObject (0x0x7319c312ea20) 0 + primary-for QGraphicsEffect (0x0x7319c315d068) + +Class QGraphicsDropShadowEffect::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGraphicsDropShadowEffect::QPrivateSignal (0x0x7319c317b360) 0 empty + +Vtable for QGraphicsDropShadowEffect +QGraphicsDropShadowEffect::_ZTV25QGraphicsDropShadowEffect: 17 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI25QGraphicsDropShadowEffect) +16 (int (*)(...))QGraphicsDropShadowEffect::metaObject +24 (int (*)(...))QGraphicsDropShadowEffect::qt_metacast +32 (int (*)(...))QGraphicsDropShadowEffect::qt_metacall +40 (int (*)(...))QGraphicsDropShadowEffect::~QGraphicsDropShadowEffect +48 (int (*)(...))QGraphicsDropShadowEffect::~QGraphicsDropShadowEffect +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QGraphicsDropShadowEffect::boundingRectFor +120 (int (*)(...))QGraphicsDropShadowEffect::draw +128 (int (*)(...))QGraphicsEffect::sourceChanged + +Class QGraphicsDropShadowEffect + size=16 align=8 + base size=16 base align=8 +QGraphicsDropShadowEffect (0x0x7319c315d340) 0 + vptr=((& QGraphicsDropShadowEffect::_ZTV25QGraphicsDropShadowEffect) + 16) +QGraphicsEffect (0x0x7319c315d3a8) 0 + primary-for QGraphicsDropShadowEffect (0x0x7319c315d340) +QObject (0x0x7319c317b300) 0 + primary-for QGraphicsEffect (0x0x7319c315d3a8) + +Class QGraphicsOpacityEffect::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGraphicsOpacityEffect::QPrivateSignal (0x0x7319c317b780) 0 empty + +Vtable for QGraphicsOpacityEffect +QGraphicsOpacityEffect::_ZTV22QGraphicsOpacityEffect: 17 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI22QGraphicsOpacityEffect) +16 (int (*)(...))QGraphicsOpacityEffect::metaObject +24 (int (*)(...))QGraphicsOpacityEffect::qt_metacast +32 (int (*)(...))QGraphicsOpacityEffect::qt_metacall +40 (int (*)(...))QGraphicsOpacityEffect::~QGraphicsOpacityEffect +48 (int (*)(...))QGraphicsOpacityEffect::~QGraphicsOpacityEffect +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QGraphicsEffect::boundingRectFor +120 (int (*)(...))QGraphicsOpacityEffect::draw +128 (int (*)(...))QGraphicsEffect::sourceChanged + +Class QGraphicsOpacityEffect + size=16 align=8 + base size=16 base align=8 +QGraphicsOpacityEffect (0x0x7319c315d410) 0 + vptr=((& QGraphicsOpacityEffect::_ZTV22QGraphicsOpacityEffect) + 16) +QGraphicsEffect (0x0x7319c315d478) 0 + primary-for QGraphicsOpacityEffect (0x0x7319c315d410) +QObject (0x0x7319c317b720) 0 + primary-for QGraphicsEffect (0x0x7319c315d478) + +Vtable for QGraphicsGridLayout +QGraphicsGridLayout::_ZTV19QGraphicsGridLayout: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QGraphicsGridLayout) +16 (int (*)(...))QGraphicsGridLayout::~QGraphicsGridLayout +24 (int (*)(...))QGraphicsGridLayout::~QGraphicsGridLayout +32 (int (*)(...))QGraphicsGridLayout::setGeometry +40 (int (*)(...))QGraphicsLayout::getContentsMargins +48 (int (*)(...))QGraphicsLayout::updateGeometry +56 (int (*)(...))QGraphicsLayoutItem::isEmpty +64 (int (*)(...))QGraphicsGridLayout::sizeHint +72 (int (*)(...))QGraphicsGridLayout::invalidate +80 (int (*)(...))QGraphicsLayout::widgetEvent +88 (int (*)(...))QGraphicsGridLayout::count +96 (int (*)(...))QGraphicsGridLayout::itemAt +104 (int (*)(...))QGraphicsGridLayout::removeAt + +Class QGraphicsGridLayout + size=16 align=8 + base size=16 base align=8 +QGraphicsGridLayout (0x0x7319c315d4e0) 0 + vptr=((& QGraphicsGridLayout::_ZTV19QGraphicsGridLayout) + 16) +QGraphicsLayout (0x0x7319c315d548) 0 + primary-for QGraphicsGridLayout (0x0x7319c315d4e0) +QGraphicsLayoutItem (0x0x7319c317b900) 0 + primary-for QGraphicsLayout (0x0x7319c315d548) + +Class QGraphicsItemAnimation::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGraphicsItemAnimation::QPrivateSignal (0x0x7319c317bae0) 0 empty + +Vtable for QGraphicsItemAnimation +QGraphicsItemAnimation::_ZTV22QGraphicsItemAnimation: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI22QGraphicsItemAnimation) +16 (int (*)(...))QGraphicsItemAnimation::metaObject +24 (int (*)(...))QGraphicsItemAnimation::qt_metacast +32 (int (*)(...))QGraphicsItemAnimation::qt_metacall +40 (int (*)(...))QGraphicsItemAnimation::~QGraphicsItemAnimation +48 (int (*)(...))QGraphicsItemAnimation::~QGraphicsItemAnimation +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QGraphicsItemAnimation::beforeAnimationStep +120 (int (*)(...))QGraphicsItemAnimation::afterAnimationStep + +Class QGraphicsItemAnimation + size=24 align=8 + base size=24 base align=8 +QGraphicsItemAnimation (0x0x7319c315d680) 0 + vptr=((& QGraphicsItemAnimation::_ZTV22QGraphicsItemAnimation) + 16) +QObject (0x0x7319c317ba80) 0 + primary-for QGraphicsItemAnimation (0x0x7319c315d680) + +Vtable for QGraphicsLinearLayout +QGraphicsLinearLayout::_ZTV21QGraphicsLinearLayout: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI21QGraphicsLinearLayout) +16 (int (*)(...))QGraphicsLinearLayout::~QGraphicsLinearLayout +24 (int (*)(...))QGraphicsLinearLayout::~QGraphicsLinearLayout +32 (int (*)(...))QGraphicsLinearLayout::setGeometry +40 (int (*)(...))QGraphicsLayout::getContentsMargins +48 (int (*)(...))QGraphicsLayout::updateGeometry +56 (int (*)(...))QGraphicsLayoutItem::isEmpty +64 (int (*)(...))QGraphicsLinearLayout::sizeHint +72 (int (*)(...))QGraphicsLinearLayout::invalidate +80 (int (*)(...))QGraphicsLayout::widgetEvent +88 (int (*)(...))QGraphicsLinearLayout::count +96 (int (*)(...))QGraphicsLinearLayout::itemAt +104 (int (*)(...))QGraphicsLinearLayout::removeAt + +Class QGraphicsLinearLayout + size=16 align=8 + base size=16 base align=8 +QGraphicsLinearLayout (0x0x7319c315d6e8) 0 + vptr=((& QGraphicsLinearLayout::_ZTV21QGraphicsLinearLayout) + 16) +QGraphicsLayout (0x0x7319c315d750) 0 + primary-for QGraphicsLinearLayout (0x0x7319c315d6e8) +QGraphicsLayoutItem (0x0x7319c317bba0) 0 + primary-for QGraphicsLayout (0x0x7319c315d750) + +Class QGraphicsWidget::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGraphicsWidget::QPrivateSignal (0x0x7319c317bea0) 0 empty + +Vtable for QGraphicsWidget +QGraphicsWidget::_ZTV15QGraphicsWidget: 93 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QGraphicsWidget) +16 (int (*)(...))QGraphicsWidget::metaObject +24 (int (*)(...))QGraphicsWidget::qt_metacast +32 (int (*)(...))QGraphicsWidget::qt_metacall +40 (int (*)(...))QGraphicsWidget::~QGraphicsWidget +48 (int (*)(...))QGraphicsWidget::~QGraphicsWidget +56 (int (*)(...))QGraphicsWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QGraphicsWidget::setGeometry +120 (int (*)(...))QGraphicsWidget::getContentsMargins +128 (int (*)(...))QGraphicsWidget::type +136 (int (*)(...))QGraphicsWidget::paint +144 (int (*)(...))QGraphicsWidget::paintWindowFrame +152 (int (*)(...))QGraphicsWidget::boundingRect +160 (int (*)(...))QGraphicsWidget::shape +168 (int (*)(...))QGraphicsWidget::initStyleOption +176 (int (*)(...))QGraphicsWidget::sizeHint +184 (int (*)(...))QGraphicsWidget::updateGeometry +192 (int (*)(...))QGraphicsWidget::itemChange +200 (int (*)(...))QGraphicsWidget::propertyChange +208 (int (*)(...))QGraphicsWidget::sceneEvent +216 (int (*)(...))QGraphicsWidget::windowFrameEvent +224 (int (*)(...))QGraphicsWidget::windowFrameSectionAt +232 (int (*)(...))QGraphicsWidget::changeEvent +240 (int (*)(...))QGraphicsWidget::closeEvent +248 (int (*)(...))QGraphicsWidget::focusInEvent +256 (int (*)(...))QGraphicsWidget::focusNextPrevChild +264 (int (*)(...))QGraphicsWidget::focusOutEvent +272 (int (*)(...))QGraphicsWidget::hideEvent +280 (int (*)(...))QGraphicsWidget::moveEvent +288 (int (*)(...))QGraphicsWidget::polishEvent +296 (int (*)(...))QGraphicsWidget::resizeEvent +304 (int (*)(...))QGraphicsWidget::showEvent +312 (int (*)(...))QGraphicsWidget::hoverMoveEvent +320 (int (*)(...))QGraphicsWidget::hoverLeaveEvent +328 (int (*)(...))QGraphicsWidget::grabMouseEvent +336 (int (*)(...))QGraphicsWidget::ungrabMouseEvent +344 (int (*)(...))QGraphicsWidget::grabKeyboardEvent +352 (int (*)(...))QGraphicsWidget::ungrabKeyboardEvent +360 (int (*)(...))-16 +368 (int (*)(...))(& _ZTI15QGraphicsWidget) +376 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidgetD1Ev +384 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidgetD0Ev +392 (int (*)(...))QGraphicsItem::advance +400 (int (*)(...))QGraphicsWidget::_ZThn16_NK15QGraphicsWidget12boundingRectEv +408 (int (*)(...))QGraphicsWidget::_ZThn16_NK15QGraphicsWidget5shapeEv +416 (int (*)(...))QGraphicsItem::contains +424 (int (*)(...))QGraphicsItem::collidesWithItem +432 (int (*)(...))QGraphicsItem::collidesWithPath +440 (int (*)(...))QGraphicsItem::isObscuredBy +448 (int (*)(...))QGraphicsItem::opaqueArea +456 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget +464 (int (*)(...))QGraphicsWidget::_ZThn16_NK15QGraphicsWidget4typeEv +472 (int (*)(...))QGraphicsItem::sceneEventFilter +480 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidget10sceneEventEP6QEvent +488 (int (*)(...))QGraphicsItem::contextMenuEvent +496 (int (*)(...))QGraphicsItem::dragEnterEvent +504 (int (*)(...))QGraphicsItem::dragLeaveEvent +512 (int (*)(...))QGraphicsItem::dragMoveEvent +520 (int (*)(...))QGraphicsItem::dropEvent +528 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidget12focusInEventEP11QFocusEvent +536 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidget13focusOutEventEP11QFocusEvent +544 (int (*)(...))QGraphicsItem::hoverEnterEvent +552 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidget14hoverMoveEventEP24QGraphicsSceneHoverEvent +560 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidget15hoverLeaveEventEP24QGraphicsSceneHoverEvent +568 (int (*)(...))QGraphicsItem::keyPressEvent +576 (int (*)(...))QGraphicsItem::keyReleaseEvent +584 (int (*)(...))QGraphicsItem::mousePressEvent +592 (int (*)(...))QGraphicsItem::mouseMoveEvent +600 (int (*)(...))QGraphicsItem::mouseReleaseEvent +608 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent +616 (int (*)(...))QGraphicsItem::wheelEvent +624 (int (*)(...))QGraphicsItem::inputMethodEvent +632 (int (*)(...))QGraphicsItem::inputMethodQuery +640 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidget10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant +648 (int (*)(...))QGraphicsItem::supportsExtension +656 (int (*)(...))QGraphicsItem::setExtension +664 (int (*)(...))QGraphicsItem::extension +672 (int (*)(...))-32 +680 (int (*)(...))(& _ZTI15QGraphicsWidget) +688 (int (*)(...))QGraphicsWidget::_ZThn32_N15QGraphicsWidgetD1Ev +696 (int (*)(...))QGraphicsWidget::_ZThn32_N15QGraphicsWidgetD0Ev +704 (int (*)(...))QGraphicsWidget::_ZThn32_N15QGraphicsWidget11setGeometryERK6QRectF +712 (int (*)(...))QGraphicsWidget::_ZThn32_NK15QGraphicsWidget18getContentsMarginsEPdS0_S0_S0_ +720 (int (*)(...))QGraphicsWidget::_ZThn32_N15QGraphicsWidget14updateGeometryEv +728 (int (*)(...))QGraphicsLayoutItem::isEmpty +736 (int (*)(...))QGraphicsWidget::_ZThn32_NK15QGraphicsWidget8sizeHintEN2Qt8SizeHintERK6QSizeF + +Class QGraphicsWidget + size=48 align=8 + base size=48 base align=8 +QGraphicsWidget (0x0x7319c3164e70) 0 + vptr=((& QGraphicsWidget::_ZTV15QGraphicsWidget) + 16) +QGraphicsObject (0x0x7319c3164ee0) 0 + primary-for QGraphicsWidget (0x0x7319c3164e70) +QObject (0x0x7319c317bd80) 0 + primary-for QGraphicsObject (0x0x7319c3164ee0) +QGraphicsItem (0x0x7319c317bde0) 16 + vptr=((& QGraphicsWidget::_ZTV15QGraphicsWidget) + 376) +QGraphicsLayoutItem (0x0x7319c317be40) 32 + vptr=((& QGraphicsWidget::_ZTV15QGraphicsWidget) + 688) + +Class QGraphicsProxyWidget::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGraphicsProxyWidget::QPrivateSignal (0x0x7319c31cf360) 0 empty + +Vtable for QGraphicsProxyWidget +QGraphicsProxyWidget::_ZTV20QGraphicsProxyWidget: 108 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QGraphicsProxyWidget) +16 (int (*)(...))QGraphicsProxyWidget::metaObject +24 (int (*)(...))QGraphicsProxyWidget::qt_metacast +32 (int (*)(...))QGraphicsProxyWidget::qt_metacall +40 (int (*)(...))QGraphicsProxyWidget::~QGraphicsProxyWidget +48 (int (*)(...))QGraphicsProxyWidget::~QGraphicsProxyWidget +56 (int (*)(...))QGraphicsProxyWidget::event +64 (int (*)(...))QGraphicsProxyWidget::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QGraphicsProxyWidget::setGeometry +120 (int (*)(...))QGraphicsWidget::getContentsMargins +128 (int (*)(...))QGraphicsProxyWidget::type +136 (int (*)(...))QGraphicsProxyWidget::paint +144 (int (*)(...))QGraphicsWidget::paintWindowFrame +152 (int (*)(...))QGraphicsWidget::boundingRect +160 (int (*)(...))QGraphicsWidget::shape +168 (int (*)(...))QGraphicsWidget::initStyleOption +176 (int (*)(...))QGraphicsProxyWidget::sizeHint +184 (int (*)(...))QGraphicsWidget::updateGeometry +192 (int (*)(...))QGraphicsProxyWidget::itemChange +200 (int (*)(...))QGraphicsWidget::propertyChange +208 (int (*)(...))QGraphicsWidget::sceneEvent +216 (int (*)(...))QGraphicsWidget::windowFrameEvent +224 (int (*)(...))QGraphicsWidget::windowFrameSectionAt +232 (int (*)(...))QGraphicsWidget::changeEvent +240 (int (*)(...))QGraphicsWidget::closeEvent +248 (int (*)(...))QGraphicsProxyWidget::focusInEvent +256 (int (*)(...))QGraphicsProxyWidget::focusNextPrevChild +264 (int (*)(...))QGraphicsProxyWidget::focusOutEvent +272 (int (*)(...))QGraphicsProxyWidget::hideEvent +280 (int (*)(...))QGraphicsWidget::moveEvent +288 (int (*)(...))QGraphicsWidget::polishEvent +296 (int (*)(...))QGraphicsProxyWidget::resizeEvent +304 (int (*)(...))QGraphicsProxyWidget::showEvent +312 (int (*)(...))QGraphicsProxyWidget::hoverMoveEvent +320 (int (*)(...))QGraphicsProxyWidget::hoverLeaveEvent +328 (int (*)(...))QGraphicsProxyWidget::grabMouseEvent +336 (int (*)(...))QGraphicsProxyWidget::ungrabMouseEvent +344 (int (*)(...))QGraphicsWidget::grabKeyboardEvent +352 (int (*)(...))QGraphicsWidget::ungrabKeyboardEvent +360 (int (*)(...))QGraphicsProxyWidget::contextMenuEvent +368 (int (*)(...))QGraphicsProxyWidget::dragEnterEvent +376 (int (*)(...))QGraphicsProxyWidget::dragLeaveEvent +384 (int (*)(...))QGraphicsProxyWidget::dragMoveEvent +392 (int (*)(...))QGraphicsProxyWidget::dropEvent +400 (int (*)(...))QGraphicsProxyWidget::hoverEnterEvent +408 (int (*)(...))QGraphicsProxyWidget::mouseMoveEvent +416 (int (*)(...))QGraphicsProxyWidget::mousePressEvent +424 (int (*)(...))QGraphicsProxyWidget::mouseReleaseEvent +432 (int (*)(...))QGraphicsProxyWidget::mouseDoubleClickEvent +440 (int (*)(...))QGraphicsProxyWidget::wheelEvent +448 (int (*)(...))QGraphicsProxyWidget::keyPressEvent +456 (int (*)(...))QGraphicsProxyWidget::keyReleaseEvent +464 (int (*)(...))QGraphicsProxyWidget::inputMethodQuery +472 (int (*)(...))QGraphicsProxyWidget::inputMethodEvent +480 (int (*)(...))-16 +488 (int (*)(...))(& _ZTI20QGraphicsProxyWidget) +496 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidgetD1Ev +504 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidgetD0Ev +512 (int (*)(...))QGraphicsItem::advance +520 (int (*)(...))QGraphicsWidget::_ZThn16_NK15QGraphicsWidget12boundingRectEv +528 (int (*)(...))QGraphicsWidget::_ZThn16_NK15QGraphicsWidget5shapeEv +536 (int (*)(...))QGraphicsItem::contains +544 (int (*)(...))QGraphicsItem::collidesWithItem +552 (int (*)(...))QGraphicsItem::collidesWithPath +560 (int (*)(...))QGraphicsItem::isObscuredBy +568 (int (*)(...))QGraphicsItem::opaqueArea +576 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget +584 (int (*)(...))QGraphicsProxyWidget::_ZThn16_NK20QGraphicsProxyWidget4typeEv +592 (int (*)(...))QGraphicsItem::sceneEventFilter +600 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidget10sceneEventEP6QEvent +608 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget16contextMenuEventEP30QGraphicsSceneContextMenuEvent +616 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget14dragEnterEventEP27QGraphicsSceneDragDropEvent +624 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget14dragLeaveEventEP27QGraphicsSceneDragDropEvent +632 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget13dragMoveEventEP27QGraphicsSceneDragDropEvent +640 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget9dropEventEP27QGraphicsSceneDragDropEvent +648 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget12focusInEventEP11QFocusEvent +656 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget13focusOutEventEP11QFocusEvent +664 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget15hoverEnterEventEP24QGraphicsSceneHoverEvent +672 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget14hoverMoveEventEP24QGraphicsSceneHoverEvent +680 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget15hoverLeaveEventEP24QGraphicsSceneHoverEvent +688 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget13keyPressEventEP9QKeyEvent +696 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget15keyReleaseEventEP9QKeyEvent +704 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget15mousePressEventEP24QGraphicsSceneMouseEvent +712 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget14mouseMoveEventEP24QGraphicsSceneMouseEvent +720 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget17mouseReleaseEventEP24QGraphicsSceneMouseEvent +728 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget21mouseDoubleClickEventEP24QGraphicsSceneMouseEvent +736 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget10wheelEventEP24QGraphicsSceneWheelEvent +744 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget16inputMethodEventEP17QInputMethodEvent +752 (int (*)(...))QGraphicsProxyWidget::_ZThn16_NK20QGraphicsProxyWidget16inputMethodQueryEN2Qt16InputMethodQueryE +760 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant +768 (int (*)(...))QGraphicsItem::supportsExtension +776 (int (*)(...))QGraphicsItem::setExtension +784 (int (*)(...))QGraphicsItem::extension +792 (int (*)(...))-32 +800 (int (*)(...))(& _ZTI20QGraphicsProxyWidget) +808 (int (*)(...))QGraphicsProxyWidget::_ZThn32_N20QGraphicsProxyWidgetD1Ev +816 (int (*)(...))QGraphicsProxyWidget::_ZThn32_N20QGraphicsProxyWidgetD0Ev +824 (int (*)(...))QGraphicsProxyWidget::_ZThn32_N20QGraphicsProxyWidget11setGeometryERK6QRectF +832 (int (*)(...))QGraphicsWidget::_ZThn32_NK15QGraphicsWidget18getContentsMarginsEPdS0_S0_S0_ +840 (int (*)(...))QGraphicsWidget::_ZThn32_N15QGraphicsWidget14updateGeometryEv +848 (int (*)(...))QGraphicsLayoutItem::isEmpty +856 (int (*)(...))QGraphicsProxyWidget::_ZThn32_NK20QGraphicsProxyWidget8sizeHintEN2Qt8SizeHintERK6QSizeF + +Class QGraphicsProxyWidget + size=48 align=8 + base size=48 base align=8 +QGraphicsProxyWidget (0x0x7319c315d888) 0 + vptr=((& QGraphicsProxyWidget::_ZTV20QGraphicsProxyWidget) + 16) +QGraphicsWidget (0x0x7319c31ce310) 0 + primary-for QGraphicsProxyWidget (0x0x7319c315d888) +QGraphicsObject (0x0x7319c31ce380) 0 + primary-for QGraphicsWidget (0x0x7319c31ce310) +QObject (0x0x7319c31cf240) 0 + primary-for QGraphicsObject (0x0x7319c31ce380) +QGraphicsItem (0x0x7319c31cf2a0) 16 + vptr=((& QGraphicsProxyWidget::_ZTV20QGraphicsProxyWidget) + 496) +QGraphicsLayoutItem (0x0x7319c31cf300) 32 + vptr=((& QGraphicsProxyWidget::_ZTV20QGraphicsProxyWidget) + 808) + +Class QGraphicsScene::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGraphicsScene::QPrivateSignal (0x0x7319c31cf6c0) 0 empty + +Vtable for QGraphicsScene +QGraphicsScene::_ZTV14QGraphicsScene: 35 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QGraphicsScene) +16 (int (*)(...))QGraphicsScene::metaObject +24 (int (*)(...))QGraphicsScene::qt_metacast +32 (int (*)(...))QGraphicsScene::qt_metacall +40 (int (*)(...))QGraphicsScene::~QGraphicsScene +48 (int (*)(...))QGraphicsScene::~QGraphicsScene +56 (int (*)(...))QGraphicsScene::event +64 (int (*)(...))QGraphicsScene::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QGraphicsScene::inputMethodQuery +120 (int (*)(...))QGraphicsScene::contextMenuEvent +128 (int (*)(...))QGraphicsScene::dragEnterEvent +136 (int (*)(...))QGraphicsScene::dragMoveEvent +144 (int (*)(...))QGraphicsScene::dragLeaveEvent +152 (int (*)(...))QGraphicsScene::dropEvent +160 (int (*)(...))QGraphicsScene::focusInEvent +168 (int (*)(...))QGraphicsScene::focusOutEvent +176 (int (*)(...))QGraphicsScene::helpEvent +184 (int (*)(...))QGraphicsScene::keyPressEvent +192 (int (*)(...))QGraphicsScene::keyReleaseEvent +200 (int (*)(...))QGraphicsScene::mousePressEvent +208 (int (*)(...))QGraphicsScene::mouseMoveEvent +216 (int (*)(...))QGraphicsScene::mouseReleaseEvent +224 (int (*)(...))QGraphicsScene::mouseDoubleClickEvent +232 (int (*)(...))QGraphicsScene::wheelEvent +240 (int (*)(...))QGraphicsScene::inputMethodEvent +248 (int (*)(...))QGraphicsScene::drawBackground +256 (int (*)(...))QGraphicsScene::drawForeground +264 (int (*)(...))QGraphicsScene::drawItems +272 (int (*)(...))QGraphicsScene::focusNextPrevChild + +Class QGraphicsScene + size=16 align=8 + base size=16 base align=8 +QGraphicsScene (0x0x7319c315da90) 0 + vptr=((& QGraphicsScene::_ZTV14QGraphicsScene) + 16) +QObject (0x0x7319c31cf660) 0 + primary-for QGraphicsScene (0x0x7319c315da90) + +Vtable for QGraphicsSceneEvent +QGraphicsSceneEvent::_ZTV19QGraphicsSceneEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QGraphicsSceneEvent) +16 (int (*)(...))QGraphicsSceneEvent::~QGraphicsSceneEvent +24 (int (*)(...))QGraphicsSceneEvent::~QGraphicsSceneEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QEvent::clone + +Class QGraphicsSceneEvent + size=24 align=8 + base size=24 base align=8 +QGraphicsSceneEvent (0x0x7319c2e20340) 0 + vptr=((& QGraphicsSceneEvent::_ZTV19QGraphicsSceneEvent) + 16) +QEvent (0x0x7319c2e22960) 0 + primary-for QGraphicsSceneEvent (0x0x7319c2e20340) + +Vtable for QGraphicsSceneMouseEvent +QGraphicsSceneMouseEvent::_ZTV24QGraphicsSceneMouseEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI24QGraphicsSceneMouseEvent) +16 (int (*)(...))QGraphicsSceneMouseEvent::~QGraphicsSceneMouseEvent +24 (int (*)(...))QGraphicsSceneMouseEvent::~QGraphicsSceneMouseEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QEvent::clone + +Class QGraphicsSceneMouseEvent + size=24 align=8 + base size=24 base align=8 +QGraphicsSceneMouseEvent (0x0x7319c2e203a8) 0 + vptr=((& QGraphicsSceneMouseEvent::_ZTV24QGraphicsSceneMouseEvent) + 16) +QGraphicsSceneEvent (0x0x7319c2e20410) 0 + primary-for QGraphicsSceneMouseEvent (0x0x7319c2e203a8) +QEvent (0x0x7319c2e22b40) 0 + primary-for QGraphicsSceneEvent (0x0x7319c2e20410) + +Vtable for QGraphicsSceneWheelEvent +QGraphicsSceneWheelEvent::_ZTV24QGraphicsSceneWheelEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI24QGraphicsSceneWheelEvent) +16 (int (*)(...))QGraphicsSceneWheelEvent::~QGraphicsSceneWheelEvent +24 (int (*)(...))QGraphicsSceneWheelEvent::~QGraphicsSceneWheelEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QEvent::clone + +Class QGraphicsSceneWheelEvent + size=24 align=8 + base size=24 base align=8 +QGraphicsSceneWheelEvent (0x0x7319c2e20478) 0 + vptr=((& QGraphicsSceneWheelEvent::_ZTV24QGraphicsSceneWheelEvent) + 16) +QGraphicsSceneEvent (0x0x7319c2e204e0) 0 + primary-for QGraphicsSceneWheelEvent (0x0x7319c2e20478) +QEvent (0x0x7319c2e22c60) 0 + primary-for QGraphicsSceneEvent (0x0x7319c2e204e0) + +Vtable for QGraphicsSceneContextMenuEvent +QGraphicsSceneContextMenuEvent::_ZTV30QGraphicsSceneContextMenuEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI30QGraphicsSceneContextMenuEvent) +16 (int (*)(...))QGraphicsSceneContextMenuEvent::~QGraphicsSceneContextMenuEvent +24 (int (*)(...))QGraphicsSceneContextMenuEvent::~QGraphicsSceneContextMenuEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QEvent::clone + +Class QGraphicsSceneContextMenuEvent + size=24 align=8 + base size=24 base align=8 +QGraphicsSceneContextMenuEvent (0x0x7319c2e20548) 0 + vptr=((& QGraphicsSceneContextMenuEvent::_ZTV30QGraphicsSceneContextMenuEvent) + 16) +QGraphicsSceneEvent (0x0x7319c2e205b0) 0 + primary-for QGraphicsSceneContextMenuEvent (0x0x7319c2e20548) +QEvent (0x0x7319c2e22d80) 0 + primary-for QGraphicsSceneEvent (0x0x7319c2e205b0) + +Vtable for QGraphicsSceneHoverEvent +QGraphicsSceneHoverEvent::_ZTV24QGraphicsSceneHoverEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI24QGraphicsSceneHoverEvent) +16 (int (*)(...))QGraphicsSceneHoverEvent::~QGraphicsSceneHoverEvent +24 (int (*)(...))QGraphicsSceneHoverEvent::~QGraphicsSceneHoverEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QEvent::clone + +Class QGraphicsSceneHoverEvent + size=24 align=8 + base size=24 base align=8 +QGraphicsSceneHoverEvent (0x0x7319c2e20618) 0 + vptr=((& QGraphicsSceneHoverEvent::_ZTV24QGraphicsSceneHoverEvent) + 16) +QGraphicsSceneEvent (0x0x7319c2e20680) 0 + primary-for QGraphicsSceneHoverEvent (0x0x7319c2e20618) +QEvent (0x0x7319c2e22ea0) 0 + primary-for QGraphicsSceneEvent (0x0x7319c2e20680) + +Vtable for QGraphicsSceneHelpEvent +QGraphicsSceneHelpEvent::_ZTV23QGraphicsSceneHelpEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI23QGraphicsSceneHelpEvent) +16 (int (*)(...))QGraphicsSceneHelpEvent::~QGraphicsSceneHelpEvent +24 (int (*)(...))QGraphicsSceneHelpEvent::~QGraphicsSceneHelpEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QEvent::clone + +Class QGraphicsSceneHelpEvent + size=24 align=8 + base size=24 base align=8 +QGraphicsSceneHelpEvent (0x0x7319c2e206e8) 0 + vptr=((& QGraphicsSceneHelpEvent::_ZTV23QGraphicsSceneHelpEvent) + 16) +QGraphicsSceneEvent (0x0x7319c2e20750) 0 + primary-for QGraphicsSceneHelpEvent (0x0x7319c2e206e8) +QEvent (0x0x7319c2e76000) 0 + primary-for QGraphicsSceneEvent (0x0x7319c2e20750) + +Vtable for QGraphicsSceneDragDropEvent +QGraphicsSceneDragDropEvent::_ZTV27QGraphicsSceneDragDropEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI27QGraphicsSceneDragDropEvent) +16 (int (*)(...))QGraphicsSceneDragDropEvent::~QGraphicsSceneDragDropEvent +24 (int (*)(...))QGraphicsSceneDragDropEvent::~QGraphicsSceneDragDropEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QEvent::clone + +Class QGraphicsSceneDragDropEvent + size=24 align=8 + base size=24 base align=8 +QGraphicsSceneDragDropEvent (0x0x7319c2e207b8) 0 + vptr=((& QGraphicsSceneDragDropEvent::_ZTV27QGraphicsSceneDragDropEvent) + 16) +QGraphicsSceneEvent (0x0x7319c2e20820) 0 + primary-for QGraphicsSceneDragDropEvent (0x0x7319c2e207b8) +QEvent (0x0x7319c2e76120) 0 + primary-for QGraphicsSceneEvent (0x0x7319c2e20820) + +Vtable for QGraphicsSceneResizeEvent +QGraphicsSceneResizeEvent::_ZTV25QGraphicsSceneResizeEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI25QGraphicsSceneResizeEvent) +16 (int (*)(...))QGraphicsSceneResizeEvent::~QGraphicsSceneResizeEvent +24 (int (*)(...))QGraphicsSceneResizeEvent::~QGraphicsSceneResizeEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QEvent::clone + +Class QGraphicsSceneResizeEvent + size=24 align=8 + base size=24 base align=8 +QGraphicsSceneResizeEvent (0x0x7319c2e20888) 0 + vptr=((& QGraphicsSceneResizeEvent::_ZTV25QGraphicsSceneResizeEvent) + 16) +QGraphicsSceneEvent (0x0x7319c2e208f0) 0 + primary-for QGraphicsSceneResizeEvent (0x0x7319c2e20888) +QEvent (0x0x7319c2e76240) 0 + primary-for QGraphicsSceneEvent (0x0x7319c2e208f0) + +Vtable for QGraphicsSceneMoveEvent +QGraphicsSceneMoveEvent::_ZTV23QGraphicsSceneMoveEvent: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI23QGraphicsSceneMoveEvent) +16 (int (*)(...))QGraphicsSceneMoveEvent::~QGraphicsSceneMoveEvent +24 (int (*)(...))QGraphicsSceneMoveEvent::~QGraphicsSceneMoveEvent +32 (int (*)(...))QEvent::setAccepted +40 (int (*)(...))QEvent::clone + +Class QGraphicsSceneMoveEvent + size=24 align=8 + base size=24 base align=8 +QGraphicsSceneMoveEvent (0x0x7319c2e20958) 0 + vptr=((& QGraphicsSceneMoveEvent::_ZTV23QGraphicsSceneMoveEvent) + 16) +QGraphicsSceneEvent (0x0x7319c2e209c0) 0 + primary-for QGraphicsSceneMoveEvent (0x0x7319c2e20958) +QEvent (0x0x7319c2e76360) 0 + primary-for QGraphicsSceneEvent (0x0x7319c2e209c0) + +Class QGraphicsTransform::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGraphicsTransform::QPrivateSignal (0x0x7319c2e764e0) 0 empty + +Vtable for QGraphicsTransform +QGraphicsTransform::_ZTV18QGraphicsTransform: 15 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QGraphicsTransform) +16 (int (*)(...))QGraphicsTransform::metaObject +24 (int (*)(...))QGraphicsTransform::qt_metacast +32 (int (*)(...))QGraphicsTransform::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual + +Class QGraphicsTransform + size=16 align=8 + base size=16 base align=8 +QGraphicsTransform (0x0x7319c2e20a28) 0 + vptr=((& QGraphicsTransform::_ZTV18QGraphicsTransform) + 16) +QObject (0x0x7319c2e76480) 0 + primary-for QGraphicsTransform (0x0x7319c2e20a28) + +Class QGraphicsScale::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGraphicsScale::QPrivateSignal (0x0x7319c2e766c0) 0 empty + +Vtable for QGraphicsScale +QGraphicsScale::_ZTV14QGraphicsScale: 15 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QGraphicsScale) +16 (int (*)(...))QGraphicsScale::metaObject +24 (int (*)(...))QGraphicsScale::qt_metacast +32 (int (*)(...))QGraphicsScale::qt_metacall +40 (int (*)(...))QGraphicsScale::~QGraphicsScale +48 (int (*)(...))QGraphicsScale::~QGraphicsScale +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QGraphicsScale::applyTo + +Class QGraphicsScale + size=16 align=8 + base size=16 base align=8 +QGraphicsScale (0x0x7319c2e20a90) 0 + vptr=((& QGraphicsScale::_ZTV14QGraphicsScale) + 16) +QGraphicsTransform (0x0x7319c2e20af8) 0 + primary-for QGraphicsScale (0x0x7319c2e20a90) +QObject (0x0x7319c2e76660) 0 + primary-for QGraphicsTransform (0x0x7319c2e20af8) + +Class QGraphicsRotation::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGraphicsRotation::QPrivateSignal (0x0x7319c2e768a0) 0 empty + +Vtable for QGraphicsRotation +QGraphicsRotation::_ZTV17QGraphicsRotation: 15 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QGraphicsRotation) +16 (int (*)(...))QGraphicsRotation::metaObject +24 (int (*)(...))QGraphicsRotation::qt_metacast +32 (int (*)(...))QGraphicsRotation::qt_metacall +40 (int (*)(...))QGraphicsRotation::~QGraphicsRotation +48 (int (*)(...))QGraphicsRotation::~QGraphicsRotation +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QGraphicsRotation::applyTo + +Class QGraphicsRotation + size=16 align=8 + base size=16 base align=8 +QGraphicsRotation (0x0x7319c2e20b60) 0 + vptr=((& QGraphicsRotation::_ZTV17QGraphicsRotation) + 16) +QGraphicsTransform (0x0x7319c2e20bc8) 0 + primary-for QGraphicsRotation (0x0x7319c2e20b60) +QObject (0x0x7319c2e76840) 0 + primary-for QGraphicsTransform (0x0x7319c2e20bc8) + +Class QScrollArea::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QScrollArea::QPrivateSignal (0x0x7319c2e76ae0) 0 empty + +Vtable for QScrollArea +QScrollArea::_ZTV11QScrollArea: 69 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QScrollArea) +16 (int (*)(...))QScrollArea::metaObject +24 (int (*)(...))QScrollArea::qt_metacast +32 (int (*)(...))QScrollArea::qt_metacall +40 (int (*)(...))QScrollArea::~QScrollArea +48 (int (*)(...))QScrollArea::~QScrollArea +56 (int (*)(...))QScrollArea::event +64 (int (*)(...))QScrollArea::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QScrollArea::sizeHint +136 (int (*)(...))QAbstractScrollArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractScrollArea::mousePressEvent +176 (int (*)(...))QAbstractScrollArea::mouseReleaseEvent +184 (int (*)(...))QAbstractScrollArea::mouseDoubleClickEvent +192 (int (*)(...))QAbstractScrollArea::mouseMoveEvent +200 (int (*)(...))QAbstractScrollArea::wheelEvent +208 (int (*)(...))QAbstractScrollArea::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QAbstractScrollArea::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QScrollArea::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QAbstractScrollArea::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QAbstractScrollArea::dragEnterEvent +320 (int (*)(...))QAbstractScrollArea::dragMoveEvent +328 (int (*)(...))QAbstractScrollArea::dragLeaveEvent +336 (int (*)(...))QAbstractScrollArea::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QFrame::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QScrollArea::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QAbstractScrollArea::setupViewport +448 (int (*)(...))QAbstractScrollArea::viewportEvent +456 (int (*)(...))QScrollArea::scrollContentsBy +464 (int (*)(...))QScrollArea::viewportSizeHint +472 (int (*)(...))-16 +480 (int (*)(...))(& _ZTI11QScrollArea) +488 (int (*)(...))QScrollArea::_ZThn16_N11QScrollAreaD1Ev +496 (int (*)(...))QScrollArea::_ZThn16_N11QScrollAreaD0Ev +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QScrollArea + size=40 align=8 + base size=40 base align=8 +QScrollArea (0x0x7319c2e20c30) 0 + vptr=((& QScrollArea::_ZTV11QScrollArea) + 16) +QAbstractScrollArea (0x0x7319c2e20c98) 0 + primary-for QScrollArea (0x0x7319c2e20c30) +QFrame (0x0x7319c2e20d00) 0 + primary-for QAbstractScrollArea (0x0x7319c2e20c98) +QWidget (0x0x7319c2e8b3f0) 0 + primary-for QFrame (0x0x7319c2e20d00) +QObject (0x0x7319c2e76a20) 0 + primary-for QWidget (0x0x7319c2e8b3f0) +QPaintDevice (0x0x7319c2e76a80) 16 + vptr=((& QScrollArea::_ZTV11QScrollArea) + 488) + +Class QGraphicsView::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGraphicsView::QPrivateSignal (0x0x7319c2e76d20) 0 empty + +Vtable for QGraphicsView +QGraphicsView::_ZTV13QGraphicsView: 72 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QGraphicsView) +16 (int (*)(...))QGraphicsView::metaObject +24 (int (*)(...))QGraphicsView::qt_metacast +32 (int (*)(...))QGraphicsView::qt_metacall +40 (int (*)(...))QGraphicsView::~QGraphicsView +48 (int (*)(...))QGraphicsView::~QGraphicsView +56 (int (*)(...))QGraphicsView::event +64 (int (*)(...))QAbstractScrollArea::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QGraphicsView::sizeHint +136 (int (*)(...))QAbstractScrollArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QGraphicsView::mousePressEvent +176 (int (*)(...))QGraphicsView::mouseReleaseEvent +184 (int (*)(...))QGraphicsView::mouseDoubleClickEvent +192 (int (*)(...))QGraphicsView::mouseMoveEvent +200 (int (*)(...))QGraphicsView::wheelEvent +208 (int (*)(...))QGraphicsView::keyPressEvent +216 (int (*)(...))QGraphicsView::keyReleaseEvent +224 (int (*)(...))QGraphicsView::focusInEvent +232 (int (*)(...))QGraphicsView::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QGraphicsView::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QGraphicsView::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QGraphicsView::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QGraphicsView::dragEnterEvent +320 (int (*)(...))QGraphicsView::dragMoveEvent +328 (int (*)(...))QGraphicsView::dragLeaveEvent +336 (int (*)(...))QGraphicsView::dropEvent +344 (int (*)(...))QGraphicsView::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QFrame::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QGraphicsView::inputMethodEvent +416 (int (*)(...))QGraphicsView::inputMethodQuery +424 (int (*)(...))QGraphicsView::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QGraphicsView::setupViewport +448 (int (*)(...))QGraphicsView::viewportEvent +456 (int (*)(...))QGraphicsView::scrollContentsBy +464 (int (*)(...))QAbstractScrollArea::viewportSizeHint +472 (int (*)(...))QGraphicsView::drawBackground +480 (int (*)(...))QGraphicsView::drawForeground +488 (int (*)(...))QGraphicsView::drawItems +496 (int (*)(...))-16 +504 (int (*)(...))(& _ZTI13QGraphicsView) +512 (int (*)(...))QGraphicsView::_ZThn16_N13QGraphicsViewD1Ev +520 (int (*)(...))QGraphicsView::_ZThn16_N13QGraphicsViewD0Ev +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +552 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +560 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +568 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QGraphicsView + size=40 align=8 + base size=40 base align=8 +QGraphicsView (0x0x7319c2e20d68) 0 + vptr=((& QGraphicsView::_ZTV13QGraphicsView) + 16) +QAbstractScrollArea (0x0x7319c2e20dd0) 0 + primary-for QGraphicsView (0x0x7319c2e20d68) +QFrame (0x0x7319c2e20e38) 0 + primary-for QAbstractScrollArea (0x0x7319c2e20dd0) +QWidget (0x0x7319c2e8b5b0) 0 + primary-for QFrame (0x0x7319c2e20e38) +QObject (0x0x7319c2e76c60) 0 + primary-for QWidget (0x0x7319c2e8b5b0) +QPaintDevice (0x0x7319c2e76cc0) 16 + vptr=((& QGraphicsView::_ZTV13QGraphicsView) + 512) + +Class QGroupBox::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QGroupBox::QPrivateSignal (0x0x7319c2f22240) 0 empty + +Vtable for QGroupBox +QGroupBox::_ZTV9QGroupBox: 65 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QGroupBox) +16 (int (*)(...))QGroupBox::metaObject +24 (int (*)(...))QGroupBox::qt_metacast +32 (int (*)(...))QGroupBox::qt_metacall +40 (int (*)(...))QGroupBox::~QGroupBox +48 (int (*)(...))QGroupBox::~QGroupBox +56 (int (*)(...))QGroupBox::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QGroupBox::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QGroupBox::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QGroupBox::mousePressEvent +176 (int (*)(...))QGroupBox::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QGroupBox::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QGroupBox::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QGroupBox::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QGroupBox::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QGroupBox::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QGroupBox::initStyleOption +440 (int (*)(...))-16 +448 (int (*)(...))(& _ZTI9QGroupBox) +456 (int (*)(...))QGroupBox::_ZThn16_N9QGroupBoxD1Ev +464 (int (*)(...))QGroupBox::_ZThn16_N9QGroupBoxD0Ev +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QGroupBox + size=40 align=8 + base size=40 base align=8 +QGroupBox (0x0x7319c2ed33a8) 0 + vptr=((& QGroupBox::_ZTV9QGroupBox) + 16) +QWidget (0x0x7319c2eede00) 0 + primary-for QGroupBox (0x0x7319c2ed33a8) +QObject (0x0x7319c2f22180) 0 + primary-for QWidget (0x0x7319c2eede00) +QPaintDevice (0x0x7319c2f221e0) 16 + vptr=((& QGroupBox::_ZTV9QGroupBox) + 456) + +Class QHeaderView::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QHeaderView::QPrivateSignal (0x0x7319c2f22480) 0 empty + +Vtable for QHeaderView +QHeaderView::_ZTV11QHeaderView: 112 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QHeaderView) +16 (int (*)(...))QHeaderView::metaObject +24 (int (*)(...))QHeaderView::qt_metacast +32 (int (*)(...))QHeaderView::qt_metacall +40 (int (*)(...))QHeaderView::~QHeaderView +48 (int (*)(...))QHeaderView::~QHeaderView +56 (int (*)(...))QHeaderView::event +64 (int (*)(...))QAbstractItemView::eventFilter +72 (int (*)(...))QAbstractItemView::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QHeaderView::setVisible +128 (int (*)(...))QHeaderView::sizeHint +136 (int (*)(...))QAbstractScrollArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QHeaderView::mousePressEvent +176 (int (*)(...))QHeaderView::mouseReleaseEvent +184 (int (*)(...))QHeaderView::mouseDoubleClickEvent +192 (int (*)(...))QHeaderView::mouseMoveEvent +200 (int (*)(...))QAbstractScrollArea::wheelEvent +208 (int (*)(...))QAbstractItemView::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QAbstractItemView::focusInEvent +232 (int (*)(...))QAbstractItemView::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QHeaderView::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QAbstractItemView::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QAbstractScrollArea::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QAbstractItemView::dragEnterEvent +320 (int (*)(...))QAbstractItemView::dragMoveEvent +328 (int (*)(...))QAbstractItemView::dragLeaveEvent +336 (int (*)(...))QAbstractItemView::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QFrame::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QAbstractItemView::inputMethodEvent +416 (int (*)(...))QAbstractItemView::inputMethodQuery +424 (int (*)(...))QAbstractItemView::focusNextPrevChild +432 (int (*)(...))QHeaderView::initStyleOption +440 (int (*)(...))QAbstractScrollArea::setupViewport +448 (int (*)(...))QHeaderView::viewportEvent +456 (int (*)(...))QHeaderView::scrollContentsBy +464 (int (*)(...))QAbstractItemView::viewportSizeHint +472 (int (*)(...))QHeaderView::setModel +480 (int (*)(...))QAbstractItemView::setSelectionModel +488 (int (*)(...))QAbstractItemView::keyboardSearch +496 (int (*)(...))QHeaderView::visualRect +504 (int (*)(...))QHeaderView::scrollTo +512 (int (*)(...))QHeaderView::indexAt +520 (int (*)(...))QAbstractItemView::sizeHintForRow +528 (int (*)(...))QAbstractItemView::sizeHintForColumn +536 (int (*)(...))QAbstractItemView::itemDelegateForIndex +544 (int (*)(...))QHeaderView::reset +552 (int (*)(...))QAbstractItemView::setRootIndex +560 (int (*)(...))QHeaderView::doItemsLayout +568 (int (*)(...))QAbstractItemView::selectAll +576 (int (*)(...))QHeaderView::dataChanged +584 (int (*)(...))QHeaderView::rowsInserted +592 (int (*)(...))QAbstractItemView::rowsAboutToBeRemoved +600 (int (*)(...))QAbstractItemView::selectionChanged +608 (int (*)(...))QHeaderView::currentChanged +616 (int (*)(...))QAbstractItemView::updateEditorData +624 (int (*)(...))QAbstractItemView::updateEditorGeometries +632 (int (*)(...))QHeaderView::updateGeometries +640 (int (*)(...))QAbstractItemView::verticalScrollbarAction +648 (int (*)(...))QAbstractItemView::horizontalScrollbarAction +656 (int (*)(...))QAbstractItemView::verticalScrollbarValueChanged +664 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged +672 (int (*)(...))QAbstractItemView::closeEditor +680 (int (*)(...))QAbstractItemView::commitData +688 (int (*)(...))QAbstractItemView::editorDestroyed +696 (int (*)(...))QHeaderView::moveCursor +704 (int (*)(...))QHeaderView::horizontalOffset +712 (int (*)(...))QHeaderView::verticalOffset +720 (int (*)(...))QHeaderView::isIndexHidden +728 (int (*)(...))QHeaderView::setSelection +736 (int (*)(...))QHeaderView::visualRegionForSelection +744 (int (*)(...))QAbstractItemView::selectedIndexes +752 (int (*)(...))QAbstractItemView::edit +760 (int (*)(...))QAbstractItemView::selectionCommand +768 (int (*)(...))QAbstractItemView::startDrag +776 (int (*)(...))QAbstractItemView::initViewItemOption +784 (int (*)(...))QHeaderView::paintSection +792 (int (*)(...))QHeaderView::sectionSizeFromContents +800 (int (*)(...))QHeaderView::initStyleOptionForIndex +808 (int (*)(...))QHeaderView::initStyleOption +816 (int (*)(...))-16 +824 (int (*)(...))(& _ZTI11QHeaderView) +832 (int (*)(...))QHeaderView::_ZThn16_N11QHeaderViewD1Ev +840 (int (*)(...))QHeaderView::_ZThn16_N11QHeaderViewD0Ev +848 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +856 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +864 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +872 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +880 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +888 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QHeaderView + size=40 align=8 + base size=40 base align=8 +QHeaderView (0x0x7319c2ed3410) 0 + vptr=((& QHeaderView::_ZTV11QHeaderView) + 16) +QAbstractItemView (0x0x7319c2ed3478) 0 + primary-for QHeaderView (0x0x7319c2ed3410) +QAbstractScrollArea (0x0x7319c2ed34e0) 0 + primary-for QAbstractItemView (0x0x7319c2ed3478) +QFrame (0x0x7319c2ed3548) 0 + primary-for QAbstractScrollArea (0x0x7319c2ed34e0) +QWidget (0x0x7319c2f33000) 0 + primary-for QFrame (0x0x7319c2ed3548) +QObject (0x0x7319c2f223c0) 0 + primary-for QWidget (0x0x7319c2f33000) +QPaintDevice (0x0x7319c2f22420) 16 + vptr=((& QHeaderView::_ZTV11QHeaderView) + 832) + +Class QLineEdit::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QLineEdit::QPrivateSignal (0x0x7319c2f22900) 0 empty + +Vtable for QLineEdit +QLineEdit::_ZTV9QLineEdit: 65 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QLineEdit) +16 (int (*)(...))QLineEdit::metaObject +24 (int (*)(...))QLineEdit::qt_metacast +32 (int (*)(...))QLineEdit::qt_metacall +40 (int (*)(...))QLineEdit::~QLineEdit +48 (int (*)(...))QLineEdit::~QLineEdit +56 (int (*)(...))QLineEdit::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QLineEdit::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QLineEdit::sizeHint +136 (int (*)(...))QLineEdit::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QLineEdit::mousePressEvent +176 (int (*)(...))QLineEdit::mouseReleaseEvent +184 (int (*)(...))QLineEdit::mouseDoubleClickEvent +192 (int (*)(...))QLineEdit::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QLineEdit::keyPressEvent +216 (int (*)(...))QLineEdit::keyReleaseEvent +224 (int (*)(...))QLineEdit::focusInEvent +232 (int (*)(...))QLineEdit::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QLineEdit::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QLineEdit::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QLineEdit::dragEnterEvent +320 (int (*)(...))QLineEdit::dragMoveEvent +328 (int (*)(...))QLineEdit::dragLeaveEvent +336 (int (*)(...))QLineEdit::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QLineEdit::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QLineEdit::inputMethodEvent +416 (int (*)(...))QLineEdit::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QLineEdit::initStyleOption +440 (int (*)(...))-16 +448 (int (*)(...))(& _ZTI9QLineEdit) +456 (int (*)(...))QLineEdit::_ZThn16_N9QLineEditD1Ev +464 (int (*)(...))QLineEdit::_ZThn16_N9QLineEditD0Ev +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QLineEdit + size=40 align=8 + base size=40 base align=8 +QLineEdit (0x0x7319c2ed35b0) 0 + vptr=((& QLineEdit::_ZTV9QLineEdit) + 16) +QWidget (0x0x7319c2f33690) 0 + primary-for QLineEdit (0x0x7319c2ed35b0) +QObject (0x0x7319c2f22840) 0 + primary-for QWidget (0x0x7319c2f33690) +QPaintDevice (0x0x7319c2f228a0) 16 + vptr=((& QLineEdit::_ZTV9QLineEdit) + 456) + +Class QInputDialog::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QInputDialog::QPrivateSignal (0x0x7319c2f22cc0) 0 empty + +Vtable for QInputDialog +QInputDialog::_ZTV12QInputDialog: 69 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QInputDialog) +16 (int (*)(...))QInputDialog::metaObject +24 (int (*)(...))QInputDialog::qt_metacast +32 (int (*)(...))QInputDialog::qt_metacall +40 (int (*)(...))QInputDialog::~QInputDialog +48 (int (*)(...))QInputDialog::~QInputDialog +56 (int (*)(...))QWidget::event +64 (int (*)(...))QDialog::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QInputDialog::setVisible +128 (int (*)(...))QInputDialog::sizeHint +136 (int (*)(...))QInputDialog::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QDialog::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QDialog::resizeEvent +280 (int (*)(...))QDialog::closeEvent +288 (int (*)(...))QDialog::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QDialog::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDialog::open +440 (int (*)(...))QDialog::exec +448 (int (*)(...))QInputDialog::done +456 (int (*)(...))QDialog::accept +464 (int (*)(...))QDialog::reject +472 (int (*)(...))-16 +480 (int (*)(...))(& _ZTI12QInputDialog) +488 (int (*)(...))QInputDialog::_ZThn16_N12QInputDialogD1Ev +496 (int (*)(...))QInputDialog::_ZThn16_N12QInputDialogD0Ev +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QInputDialog + size=40 align=8 + base size=40 base align=8 +QInputDialog (0x0x7319c2ed3618) 0 + vptr=((& QInputDialog::_ZTV12QInputDialog) + 16) +QDialog (0x0x7319c2ed3680) 0 + primary-for QInputDialog (0x0x7319c2ed3618) +QWidget (0x0x7319c2f33cb0) 0 + primary-for QDialog (0x0x7319c2ed3680) +QObject (0x0x7319c2f22c00) 0 + primary-for QWidget (0x0x7319c2f33cb0) +QPaintDevice (0x0x7319c2f22c60) 16 + vptr=((& QInputDialog::_ZTV12QInputDialog) + 488) + +Class QItemDelegate::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QItemDelegate::QPrivateSignal (0x0x7319c2f99420) 0 empty + +Vtable for QItemDelegate +QItemDelegate::_ZTV13QItemDelegate: 28 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QItemDelegate) +16 (int (*)(...))QItemDelegate::metaObject +24 (int (*)(...))QItemDelegate::qt_metacast +32 (int (*)(...))QItemDelegate::qt_metacall +40 (int (*)(...))QItemDelegate::~QItemDelegate +48 (int (*)(...))QItemDelegate::~QItemDelegate +56 (int (*)(...))QObject::event +64 (int (*)(...))QItemDelegate::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QItemDelegate::paint +120 (int (*)(...))QItemDelegate::sizeHint +128 (int (*)(...))QItemDelegate::createEditor +136 (int (*)(...))QAbstractItemDelegate::destroyEditor +144 (int (*)(...))QItemDelegate::setEditorData +152 (int (*)(...))QItemDelegate::setModelData +160 (int (*)(...))QItemDelegate::updateEditorGeometry +168 (int (*)(...))QItemDelegate::editorEvent +176 (int (*)(...))QAbstractItemDelegate::helpEvent +184 (int (*)(...))QAbstractItemDelegate::paintingRoles +192 (int (*)(...))QItemDelegate::drawDisplay +200 (int (*)(...))QItemDelegate::drawDecoration +208 (int (*)(...))QItemDelegate::drawFocus +216 (int (*)(...))QItemDelegate::drawCheck + +Class QItemDelegate + size=16 align=8 + base size=16 base align=8 +QItemDelegate (0x0x7319c2ed3958) 0 + vptr=((& QItemDelegate::_ZTV13QItemDelegate) + 16) +QAbstractItemDelegate (0x0x7319c2ed39c0) 0 + primary-for QItemDelegate (0x0x7319c2ed3958) +QObject (0x0x7319c2f993c0) 0 + primary-for QAbstractItemDelegate (0x0x7319c2ed39c0) + +Vtable for QItemEditorCreatorBase +QItemEditorCreatorBase::_ZTV22QItemEditorCreatorBase: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI22QItemEditorCreatorBase) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual + +Class QItemEditorCreatorBase + size=8 align=8 + base size=8 base align=8 +QItemEditorCreatorBase (0x0x7319c2f995a0) 0 nearly-empty + vptr=((& QItemEditorCreatorBase::_ZTV22QItemEditorCreatorBase) + 16) + +Vtable for QItemEditorFactory +QItemEditorFactory::_ZTV18QItemEditorFactory: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QItemEditorFactory) +16 (int (*)(...))QItemEditorFactory::~QItemEditorFactory +24 (int (*)(...))QItemEditorFactory::~QItemEditorFactory +32 (int (*)(...))QItemEditorFactory::createEditor +40 (int (*)(...))QItemEditorFactory::valuePropertyName + +Class QItemEditorFactory + size=16 align=8 + base size=16 base align=8 +QItemEditorFactory (0x0x7319c2f99900) 0 + vptr=((& QItemEditorFactory::_ZTV18QItemEditorFactory) + 16) + +Class QKeySequenceEdit::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QKeySequenceEdit::QPrivateSignal (0x0x7319c2f99de0) 0 empty + +Vtable for QKeySequenceEdit +QKeySequenceEdit::_ZTV16QKeySequenceEdit: 64 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI16QKeySequenceEdit) +16 (int (*)(...))QKeySequenceEdit::metaObject +24 (int (*)(...))QKeySequenceEdit::qt_metacast +32 (int (*)(...))QKeySequenceEdit::qt_metacall +40 (int (*)(...))QKeySequenceEdit::~QKeySequenceEdit +48 (int (*)(...))QKeySequenceEdit::~QKeySequenceEdit +56 (int (*)(...))QKeySequenceEdit::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QKeySequenceEdit::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QKeySequenceEdit::keyPressEvent +216 (int (*)(...))QKeySequenceEdit::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QKeySequenceEdit::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))-16 +440 (int (*)(...))(& _ZTI16QKeySequenceEdit) +448 (int (*)(...))QKeySequenceEdit::_ZThn16_N16QKeySequenceEditD1Ev +456 (int (*)(...))QKeySequenceEdit::_ZThn16_N16QKeySequenceEditD0Ev +464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QKeySequenceEdit + size=40 align=8 + base size=40 base align=8 +QKeySequenceEdit (0x0x7319c2ed3af8) 0 + vptr=((& QKeySequenceEdit::_ZTV16QKeySequenceEdit) + 16) +QWidget (0x0x7319c2ff78c0) 0 + primary-for QKeySequenceEdit (0x0x7319c2ed3af8) +QObject (0x0x7319c2f99d20) 0 + primary-for QWidget (0x0x7319c2ff78c0) +QPaintDevice (0x0x7319c2f99d80) 16 + vptr=((& QKeySequenceEdit::_ZTV16QKeySequenceEdit) + 448) + +Class QLabel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QLabel::QPrivateSignal (0x0x7319c2c0f060) 0 empty + +Vtable for QLabel +QLabel::_ZTV6QLabel: 65 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI6QLabel) +16 (int (*)(...))QLabel::metaObject +24 (int (*)(...))QLabel::qt_metacast +32 (int (*)(...))QLabel::qt_metacall +40 (int (*)(...))QLabel::~QLabel +48 (int (*)(...))QLabel::~QLabel +56 (int (*)(...))QLabel::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QLabel::sizeHint +136 (int (*)(...))QLabel::minimumSizeHint +144 (int (*)(...))QLabel::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QLabel::mousePressEvent +176 (int (*)(...))QLabel::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QLabel::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QLabel::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QLabel::focusInEvent +232 (int (*)(...))QLabel::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QLabel::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QLabel::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QLabel::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QLabel::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))-16 +448 (int (*)(...))(& _ZTI6QLabel) +456 (int (*)(...))QLabel::_ZThn16_N6QLabelD1Ev +464 (int (*)(...))QLabel::_ZThn16_N6QLabelD0Ev +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QLabel + size=40 align=8 + base size=40 base align=8 +QLabel (0x0x7319c2ed3b60) 0 + vptr=((& QLabel::_ZTV6QLabel) + 16) +QFrame (0x0x7319c2ed3bc8) 0 + primary-for QLabel (0x0x7319c2ed3b60) +QWidget (0x0x7319c2ff7a80) 0 + primary-for QFrame (0x0x7319c2ed3bc8) +QObject (0x0x7319c2f99f60) 0 + primary-for QWidget (0x0x7319c2ff7a80) +QPaintDevice (0x0x7319c2c0f000) 16 + vptr=((& QLabel::_ZTV6QLabel) + 456) + +Class QLCDNumber::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QLCDNumber::QPrivateSignal (0x0x7319c2c0f360) 0 empty + +Vtable for QLCDNumber +QLCDNumber::_ZTV10QLCDNumber: 65 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QLCDNumber) +16 (int (*)(...))QLCDNumber::metaObject +24 (int (*)(...))QLCDNumber::qt_metacast +32 (int (*)(...))QLCDNumber::qt_metacall +40 (int (*)(...))QLCDNumber::~QLCDNumber +48 (int (*)(...))QLCDNumber::~QLCDNumber +56 (int (*)(...))QLCDNumber::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QLCDNumber::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QLCDNumber::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QFrame::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))-16 +448 (int (*)(...))(& _ZTI10QLCDNumber) +456 (int (*)(...))QLCDNumber::_ZThn16_N10QLCDNumberD1Ev +464 (int (*)(...))QLCDNumber::_ZThn16_N10QLCDNumberD0Ev +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QLCDNumber + size=40 align=8 + base size=40 base align=8 +QLCDNumber (0x0x7319c2ed3c30) 0 + vptr=((& QLCDNumber::_ZTV10QLCDNumber) + 16) +QFrame (0x0x7319c2ed3c98) 0 + primary-for QLCDNumber (0x0x7319c2ed3c30) +QWidget (0x0x7319c2ff7d20) 0 + primary-for QFrame (0x0x7319c2ed3c98) +QObject (0x0x7319c2c0f2a0) 0 + primary-for QWidget (0x0x7319c2ff7d20) +QPaintDevice (0x0x7319c2c0f300) 16 + vptr=((& QLCDNumber::_ZTV10QLCDNumber) + 456) + +Class QListView::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QListView::QPrivateSignal (0x0x7319c2c0f720) 0 empty + +Vtable for QListView +QListView::_ZTV9QListView: 108 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QListView) +16 (int (*)(...))QListView::metaObject +24 (int (*)(...))QListView::qt_metacast +32 (int (*)(...))QListView::qt_metacall +40 (int (*)(...))QListView::~QListView +48 (int (*)(...))QListView::~QListView +56 (int (*)(...))QListView::event +64 (int (*)(...))QAbstractItemView::eventFilter +72 (int (*)(...))QListView::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QAbstractScrollArea::sizeHint +136 (int (*)(...))QAbstractScrollArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractItemView::mousePressEvent +176 (int (*)(...))QListView::mouseReleaseEvent +184 (int (*)(...))QAbstractItemView::mouseDoubleClickEvent +192 (int (*)(...))QListView::mouseMoveEvent +200 (int (*)(...))QListView::wheelEvent +208 (int (*)(...))QAbstractItemView::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QAbstractItemView::focusInEvent +232 (int (*)(...))QAbstractItemView::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QListView::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QListView::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QAbstractScrollArea::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QAbstractItemView::dragEnterEvent +320 (int (*)(...))QListView::dragMoveEvent +328 (int (*)(...))QListView::dragLeaveEvent +336 (int (*)(...))QListView::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QFrame::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QAbstractItemView::inputMethodEvent +416 (int (*)(...))QAbstractItemView::inputMethodQuery +424 (int (*)(...))QAbstractItemView::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QAbstractScrollArea::setupViewport +448 (int (*)(...))QAbstractItemView::viewportEvent +456 (int (*)(...))QListView::scrollContentsBy +464 (int (*)(...))QListView::viewportSizeHint +472 (int (*)(...))QAbstractItemView::setModel +480 (int (*)(...))QAbstractItemView::setSelectionModel +488 (int (*)(...))QAbstractItemView::keyboardSearch +496 (int (*)(...))QListView::visualRect +504 (int (*)(...))QListView::scrollTo +512 (int (*)(...))QListView::indexAt +520 (int (*)(...))QAbstractItemView::sizeHintForRow +528 (int (*)(...))QAbstractItemView::sizeHintForColumn +536 (int (*)(...))QAbstractItemView::itemDelegateForIndex +544 (int (*)(...))QListView::reset +552 (int (*)(...))QListView::setRootIndex +560 (int (*)(...))QListView::doItemsLayout +568 (int (*)(...))QAbstractItemView::selectAll +576 (int (*)(...))QListView::dataChanged +584 (int (*)(...))QListView::rowsInserted +592 (int (*)(...))QListView::rowsAboutToBeRemoved +600 (int (*)(...))QListView::selectionChanged +608 (int (*)(...))QListView::currentChanged +616 (int (*)(...))QAbstractItemView::updateEditorData +624 (int (*)(...))QAbstractItemView::updateEditorGeometries +632 (int (*)(...))QListView::updateGeometries +640 (int (*)(...))QAbstractItemView::verticalScrollbarAction +648 (int (*)(...))QAbstractItemView::horizontalScrollbarAction +656 (int (*)(...))QAbstractItemView::verticalScrollbarValueChanged +664 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged +672 (int (*)(...))QAbstractItemView::closeEditor +680 (int (*)(...))QAbstractItemView::commitData +688 (int (*)(...))QAbstractItemView::editorDestroyed +696 (int (*)(...))QListView::moveCursor +704 (int (*)(...))QListView::horizontalOffset +712 (int (*)(...))QListView::verticalOffset +720 (int (*)(...))QListView::isIndexHidden +728 (int (*)(...))QListView::setSelection +736 (int (*)(...))QListView::visualRegionForSelection +744 (int (*)(...))QListView::selectedIndexes +752 (int (*)(...))QAbstractItemView::edit +760 (int (*)(...))QAbstractItemView::selectionCommand +768 (int (*)(...))QListView::startDrag +776 (int (*)(...))QListView::initViewItemOption +784 (int (*)(...))-16 +792 (int (*)(...))(& _ZTI9QListView) +800 (int (*)(...))QListView::_ZThn16_N9QListViewD1Ev +808 (int (*)(...))QListView::_ZThn16_N9QListViewD0Ev +816 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +824 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +832 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +840 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +848 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +856 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QListView + size=40 align=8 + base size=40 base align=8 +QListView (0x0x7319c2ed3d00) 0 + vptr=((& QListView::_ZTV9QListView) + 16) +QAbstractItemView (0x0x7319c2ed3d68) 0 + primary-for QListView (0x0x7319c2ed3d00) +QAbstractScrollArea (0x0x7319c2ed3dd0) 0 + primary-for QAbstractItemView (0x0x7319c2ed3d68) +QFrame (0x0x7319c2ed3e38) 0 + primary-for QAbstractScrollArea (0x0x7319c2ed3dd0) +QWidget (0x0x7319c2c2b3f0) 0 + primary-for QFrame (0x0x7319c2ed3e38) +QObject (0x0x7319c2c0f660) 0 + primary-for QWidget (0x0x7319c2c2b3f0) +QPaintDevice (0x0x7319c2c0f6c0) 16 + vptr=((& QListView::_ZTV9QListView) + 800) + +Vtable for QListWidgetItem +QListWidgetItem::_ZTV15QListWidgetItem: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QListWidgetItem) +16 (int (*)(...))QListWidgetItem::~QListWidgetItem +24 (int (*)(...))QListWidgetItem::~QListWidgetItem +32 (int (*)(...))QListWidgetItem::clone +40 (int (*)(...))QListWidgetItem::data +48 (int (*)(...))QListWidgetItem::setData +56 (int (*)(...))QListWidgetItem::operator< +64 (int (*)(...))QListWidgetItem::read +72 (int (*)(...))QListWidgetItem::write + +Class QListWidgetItem + size=40 align=8 + base size=36 base align=8 +QListWidgetItem (0x0x7319c2c0fc60) 0 + vptr=((& QListWidgetItem::_ZTV15QListWidgetItem) + 16) + +Class QListWidget::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QListWidget::QPrivateSignal (0x0x7319c2c89b40) 0 empty + +Vtable for QListWidget +QListWidget::_ZTV11QListWidget: 112 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QListWidget) +16 (int (*)(...))QListWidget::metaObject +24 (int (*)(...))QListWidget::qt_metacast +32 (int (*)(...))QListWidget::qt_metacall +40 (int (*)(...))QListWidget::~QListWidget +48 (int (*)(...))QListWidget::~QListWidget +56 (int (*)(...))QListWidget::event +64 (int (*)(...))QAbstractItemView::eventFilter +72 (int (*)(...))QListView::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QAbstractScrollArea::sizeHint +136 (int (*)(...))QAbstractScrollArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractItemView::mousePressEvent +176 (int (*)(...))QListView::mouseReleaseEvent +184 (int (*)(...))QAbstractItemView::mouseDoubleClickEvent +192 (int (*)(...))QListView::mouseMoveEvent +200 (int (*)(...))QListView::wheelEvent +208 (int (*)(...))QAbstractItemView::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QAbstractItemView::focusInEvent +232 (int (*)(...))QAbstractItemView::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QListView::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QListView::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QAbstractScrollArea::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QAbstractItemView::dragEnterEvent +320 (int (*)(...))QListView::dragMoveEvent +328 (int (*)(...))QListView::dragLeaveEvent +336 (int (*)(...))QListWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QFrame::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QAbstractItemView::inputMethodEvent +416 (int (*)(...))QAbstractItemView::inputMethodQuery +424 (int (*)(...))QAbstractItemView::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QAbstractScrollArea::setupViewport +448 (int (*)(...))QAbstractItemView::viewportEvent +456 (int (*)(...))QListView::scrollContentsBy +464 (int (*)(...))QListView::viewportSizeHint +472 (int (*)(...))QListWidget::setModel +480 (int (*)(...))QListWidget::setSelectionModel +488 (int (*)(...))QAbstractItemView::keyboardSearch +496 (int (*)(...))QListView::visualRect +504 (int (*)(...))QListView::scrollTo +512 (int (*)(...))QListView::indexAt +520 (int (*)(...))QAbstractItemView::sizeHintForRow +528 (int (*)(...))QAbstractItemView::sizeHintForColumn +536 (int (*)(...))QAbstractItemView::itemDelegateForIndex +544 (int (*)(...))QListView::reset +552 (int (*)(...))QListView::setRootIndex +560 (int (*)(...))QListView::doItemsLayout +568 (int (*)(...))QAbstractItemView::selectAll +576 (int (*)(...))QListView::dataChanged +584 (int (*)(...))QListView::rowsInserted +592 (int (*)(...))QListView::rowsAboutToBeRemoved +600 (int (*)(...))QListView::selectionChanged +608 (int (*)(...))QListView::currentChanged +616 (int (*)(...))QAbstractItemView::updateEditorData +624 (int (*)(...))QAbstractItemView::updateEditorGeometries +632 (int (*)(...))QListView::updateGeometries +640 (int (*)(...))QAbstractItemView::verticalScrollbarAction +648 (int (*)(...))QAbstractItemView::horizontalScrollbarAction +656 (int (*)(...))QAbstractItemView::verticalScrollbarValueChanged +664 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged +672 (int (*)(...))QAbstractItemView::closeEditor +680 (int (*)(...))QAbstractItemView::commitData +688 (int (*)(...))QAbstractItemView::editorDestroyed +696 (int (*)(...))QListView::moveCursor +704 (int (*)(...))QListView::horizontalOffset +712 (int (*)(...))QListView::verticalOffset +720 (int (*)(...))QListView::isIndexHidden +728 (int (*)(...))QListView::setSelection +736 (int (*)(...))QListView::visualRegionForSelection +744 (int (*)(...))QListView::selectedIndexes +752 (int (*)(...))QAbstractItemView::edit +760 (int (*)(...))QAbstractItemView::selectionCommand +768 (int (*)(...))QListView::startDrag +776 (int (*)(...))QListView::initViewItemOption +784 (int (*)(...))QListWidget::mimeTypes +792 (int (*)(...))QListWidget::mimeData +800 (int (*)(...))QListWidget::dropMimeData +808 (int (*)(...))QListWidget::supportedDropActions +816 (int (*)(...))-16 +824 (int (*)(...))(& _ZTI11QListWidget) +832 (int (*)(...))QListWidget::_ZThn16_N11QListWidgetD1Ev +840 (int (*)(...))QListWidget::_ZThn16_N11QListWidgetD0Ev +848 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +856 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +864 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +872 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +880 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +888 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QListWidget + size=40 align=8 + base size=40 base align=8 +QListWidget (0x0x7319c2c92270) 0 + vptr=((& QListWidget::_ZTV11QListWidget) + 16) +QListView (0x0x7319c2c922d8) 0 + primary-for QListWidget (0x0x7319c2c92270) +QAbstractItemView (0x0x7319c2c92340) 0 + primary-for QListView (0x0x7319c2c922d8) +QAbstractScrollArea (0x0x7319c2c923a8) 0 + primary-for QAbstractItemView (0x0x7319c2c92340) +QFrame (0x0x7319c2c92410) 0 + primary-for QAbstractScrollArea (0x0x7319c2c923a8) +QWidget (0x0x7319c2c6bd90) 0 + primary-for QFrame (0x0x7319c2c92410) +QObject (0x0x7319c2c89a80) 0 + primary-for QWidget (0x0x7319c2c6bd90) +QPaintDevice (0x0x7319c2c89ae0) 16 + vptr=((& QListWidget::_ZTV11QListWidget) + 832) + +Class QMainWindow::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QMainWindow::QPrivateSignal (0x0x7319c2cb2060) 0 empty + +Vtable for QMainWindow +QMainWindow::_ZTV11QMainWindow: 65 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QMainWindow) +16 (int (*)(...))QMainWindow::metaObject +24 (int (*)(...))QMainWindow::qt_metacast +32 (int (*)(...))QMainWindow::qt_metacall +40 (int (*)(...))QMainWindow::~QMainWindow +48 (int (*)(...))QMainWindow::~QMainWindow +56 (int (*)(...))QMainWindow::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QMainWindow::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QMainWindow::createPopupMenu +440 (int (*)(...))-16 +448 (int (*)(...))(& _ZTI11QMainWindow) +456 (int (*)(...))QMainWindow::_ZThn16_N11QMainWindowD1Ev +464 (int (*)(...))QMainWindow::_ZThn16_N11QMainWindowD0Ev +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QMainWindow + size=40 align=8 + base size=40 base align=8 +QMainWindow (0x0x7319c2c92478) 0 + vptr=((& QMainWindow::_ZTV11QMainWindow) + 16) +QWidget (0x0x7319c2cae2a0) 0 + primary-for QMainWindow (0x0x7319c2c92478) +QObject (0x0x7319c2c89f60) 0 + primary-for QWidget (0x0x7319c2cae2a0) +QPaintDevice (0x0x7319c2cb2000) 16 + vptr=((& QMainWindow::_ZTV11QMainWindow) + 456) + +Class QMdiArea::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QMdiArea::QPrivateSignal (0x0x7319c2cb2960) 0 empty + +Vtable for QMdiArea +QMdiArea::_ZTV8QMdiArea: 69 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI8QMdiArea) +16 (int (*)(...))QMdiArea::metaObject +24 (int (*)(...))QMdiArea::qt_metacast +32 (int (*)(...))QMdiArea::qt_metacall +40 (int (*)(...))QMdiArea::~QMdiArea +48 (int (*)(...))QMdiArea::~QMdiArea +56 (int (*)(...))QMdiArea::event +64 (int (*)(...))QMdiArea::eventFilter +72 (int (*)(...))QMdiArea::timerEvent +80 (int (*)(...))QMdiArea::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QMdiArea::sizeHint +136 (int (*)(...))QMdiArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractScrollArea::mousePressEvent +176 (int (*)(...))QAbstractScrollArea::mouseReleaseEvent +184 (int (*)(...))QAbstractScrollArea::mouseDoubleClickEvent +192 (int (*)(...))QAbstractScrollArea::mouseMoveEvent +200 (int (*)(...))QAbstractScrollArea::wheelEvent +208 (int (*)(...))QAbstractScrollArea::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QMdiArea::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QMdiArea::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QAbstractScrollArea::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QAbstractScrollArea::dragEnterEvent +320 (int (*)(...))QAbstractScrollArea::dragMoveEvent +328 (int (*)(...))QAbstractScrollArea::dragLeaveEvent +336 (int (*)(...))QAbstractScrollArea::dropEvent +344 (int (*)(...))QMdiArea::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QFrame::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QMdiArea::setupViewport +448 (int (*)(...))QMdiArea::viewportEvent +456 (int (*)(...))QMdiArea::scrollContentsBy +464 (int (*)(...))QAbstractScrollArea::viewportSizeHint +472 (int (*)(...))-16 +480 (int (*)(...))(& _ZTI8QMdiArea) +488 (int (*)(...))QMdiArea::_ZThn16_N8QMdiAreaD1Ev +496 (int (*)(...))QMdiArea::_ZThn16_N8QMdiAreaD0Ev +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QMdiArea + size=40 align=8 + base size=40 base align=8 +QMdiArea (0x0x7319c2c92750) 0 + vptr=((& QMdiArea::_ZTV8QMdiArea) + 16) +QAbstractScrollArea (0x0x7319c2c927b8) 0 + primary-for QMdiArea (0x0x7319c2c92750) +QFrame (0x0x7319c2c92820) 0 + primary-for QAbstractScrollArea (0x0x7319c2c927b8) +QWidget (0x0x7319c2caebd0) 0 + primary-for QFrame (0x0x7319c2c92820) +QObject (0x0x7319c2cb28a0) 0 + primary-for QWidget (0x0x7319c2caebd0) +QPaintDevice (0x0x7319c2cb2900) 16 + vptr=((& QMdiArea::_ZTV8QMdiArea) + 488) + +Class QMdiSubWindow::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QMdiSubWindow::QPrivateSignal (0x0x7319c2d2d2a0) 0 empty + +Vtable for QMdiSubWindow +QMdiSubWindow::_ZTV13QMdiSubWindow: 64 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QMdiSubWindow) +16 (int (*)(...))QMdiSubWindow::metaObject +24 (int (*)(...))QMdiSubWindow::qt_metacast +32 (int (*)(...))QMdiSubWindow::qt_metacall +40 (int (*)(...))QMdiSubWindow::~QMdiSubWindow +48 (int (*)(...))QMdiSubWindow::~QMdiSubWindow +56 (int (*)(...))QMdiSubWindow::event +64 (int (*)(...))QMdiSubWindow::eventFilter +72 (int (*)(...))QMdiSubWindow::timerEvent +80 (int (*)(...))QMdiSubWindow::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QMdiSubWindow::sizeHint +136 (int (*)(...))QMdiSubWindow::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QMdiSubWindow::mousePressEvent +176 (int (*)(...))QMdiSubWindow::mouseReleaseEvent +184 (int (*)(...))QMdiSubWindow::mouseDoubleClickEvent +192 (int (*)(...))QMdiSubWindow::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QMdiSubWindow::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QMdiSubWindow::focusInEvent +232 (int (*)(...))QMdiSubWindow::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QMdiSubWindow::leaveEvent +256 (int (*)(...))QMdiSubWindow::paintEvent +264 (int (*)(...))QMdiSubWindow::moveEvent +272 (int (*)(...))QMdiSubWindow::resizeEvent +280 (int (*)(...))QMdiSubWindow::closeEvent +288 (int (*)(...))QMdiSubWindow::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QMdiSubWindow::showEvent +352 (int (*)(...))QMdiSubWindow::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QMdiSubWindow::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))-16 +440 (int (*)(...))(& _ZTI13QMdiSubWindow) +448 (int (*)(...))QMdiSubWindow::_ZThn16_N13QMdiSubWindowD1Ev +456 (int (*)(...))QMdiSubWindow::_ZThn16_N13QMdiSubWindowD0Ev +464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QMdiSubWindow + size=40 align=8 + base size=40 base align=8 +QMdiSubWindow (0x0x7319c2c92af8) 0 + vptr=((& QMdiSubWindow::_ZTV13QMdiSubWindow) + 16) +QWidget (0x0x7319c2d0a540) 0 + primary-for QMdiSubWindow (0x0x7319c2c92af8) +QObject (0x0x7319c2d2d1e0) 0 + primary-for QWidget (0x0x7319c2d0a540) +QPaintDevice (0x0x7319c2d2d240) 16 + vptr=((& QMdiSubWindow::_ZTV13QMdiSubWindow) + 448) + +Class QMenu::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QMenu::QPrivateSignal (0x0x7319c2d2da20) 0 empty + +Vtable for QMenu +QMenu::_ZTV5QMenu: 65 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI5QMenu) +16 (int (*)(...))QMenu::metaObject +24 (int (*)(...))QMenu::qt_metacast +32 (int (*)(...))QMenu::qt_metacall +40 (int (*)(...))QMenu::~QMenu +48 (int (*)(...))QMenu::~QMenu +56 (int (*)(...))QMenu::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QMenu::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QMenu::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QMenu::mousePressEvent +176 (int (*)(...))QMenu::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QMenu::mouseMoveEvent +200 (int (*)(...))QMenu::wheelEvent +208 (int (*)(...))QMenu::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QMenu::enterEvent +248 (int (*)(...))QMenu::leaveEvent +256 (int (*)(...))QMenu::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QMenu::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QMenu::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QMenu::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QMenu::focusNextPrevChild +432 (int (*)(...))QMenu::initStyleOption +440 (int (*)(...))-16 +448 (int (*)(...))(& _ZTI5QMenu) +456 (int (*)(...))QMenu::_ZThn16_N5QMenuD1Ev +464 (int (*)(...))QMenu::_ZThn16_N5QMenuD0Ev +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QMenu + size=40 align=8 + base size=40 base align=8 +QMenu (0x0x7319c2c92dd0) 0 + vptr=((& QMenu::_ZTV5QMenu) + 16) +QWidget (0x0x7319c2d0abd0) 0 + primary-for QMenu (0x0x7319c2c92dd0) +QObject (0x0x7319c2d2d960) 0 + primary-for QWidget (0x0x7319c2d0abd0) +QPaintDevice (0x0x7319c2d2d9c0) 16 + vptr=((& QMenu::_ZTV5QMenu) + 456) + +Class QMenuBar::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QMenuBar::QPrivateSignal (0x0x7319c2d2dea0) 0 empty + +Vtable for QMenuBar +QMenuBar::_ZTV8QMenuBar: 65 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI8QMenuBar) +16 (int (*)(...))QMenuBar::metaObject +24 (int (*)(...))QMenuBar::qt_metacast +32 (int (*)(...))QMenuBar::qt_metacall +40 (int (*)(...))QMenuBar::~QMenuBar +48 (int (*)(...))QMenuBar::~QMenuBar +56 (int (*)(...))QMenuBar::event +64 (int (*)(...))QMenuBar::eventFilter +72 (int (*)(...))QMenuBar::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QMenuBar::setVisible +128 (int (*)(...))QMenuBar::sizeHint +136 (int (*)(...))QMenuBar::minimumSizeHint +144 (int (*)(...))QMenuBar::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QMenuBar::mousePressEvent +176 (int (*)(...))QMenuBar::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QMenuBar::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QMenuBar::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QMenuBar::focusInEvent +232 (int (*)(...))QMenuBar::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QMenuBar::leaveEvent +256 (int (*)(...))QMenuBar::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QMenuBar::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QMenuBar::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QMenuBar::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QMenuBar::initStyleOption +440 (int (*)(...))-16 +448 (int (*)(...))(& _ZTI8QMenuBar) +456 (int (*)(...))QMenuBar::_ZThn16_N8QMenuBarD1Ev +464 (int (*)(...))QMenuBar::_ZThn16_N8QMenuBarD0Ev +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QMenuBar + size=40 align=8 + base size=40 base align=8 +QMenuBar (0x0x7319c2c92e38) 0 + vptr=((& QMenuBar::_ZTV8QMenuBar) + 16) +QWidget (0x0x7319c2d8a000) 0 + primary-for QMenuBar (0x0x7319c2c92e38) +QObject (0x0x7319c2d2dde0) 0 + primary-for QWidget (0x0x7319c2d8a000) +QPaintDevice (0x0x7319c2d2de40) 16 + vptr=((& QMenuBar::_ZTV8QMenuBar) + 456) + +Class QMessageBox::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QMessageBox::QPrivateSignal (0x0x7319c2d9d120) 0 empty + +Vtable for QMessageBox +QMessageBox::_ZTV11QMessageBox: 69 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QMessageBox) +16 (int (*)(...))QMessageBox::metaObject +24 (int (*)(...))QMessageBox::qt_metacast +32 (int (*)(...))QMessageBox::qt_metacall +40 (int (*)(...))QMessageBox::~QMessageBox +48 (int (*)(...))QMessageBox::~QMessageBox +56 (int (*)(...))QMessageBox::event +64 (int (*)(...))QDialog::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QDialog::setVisible +128 (int (*)(...))QDialog::sizeHint +136 (int (*)(...))QDialog::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QMessageBox::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QMessageBox::resizeEvent +280 (int (*)(...))QMessageBox::closeEvent +288 (int (*)(...))QDialog::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QMessageBox::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QMessageBox::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDialog::open +440 (int (*)(...))QDialog::exec +448 (int (*)(...))QDialog::done +456 (int (*)(...))QDialog::accept +464 (int (*)(...))QDialog::reject +472 (int (*)(...))-16 +480 (int (*)(...))(& _ZTI11QMessageBox) +488 (int (*)(...))QMessageBox::_ZThn16_N11QMessageBoxD1Ev +496 (int (*)(...))QMessageBox::_ZThn16_N11QMessageBoxD0Ev +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QMessageBox + size=40 align=8 + base size=40 base align=8 +QMessageBox (0x0x7319c2c92ea0) 0 + vptr=((& QMessageBox::_ZTV11QMessageBox) + 16) +QDialog (0x0x7319c2c92f08) 0 + primary-for QMessageBox (0x0x7319c2c92ea0) +QWidget (0x0x7319c2d8a1c0) 0 + primary-for QDialog (0x0x7319c2c92f08) +QObject (0x0x7319c2d9d060) 0 + primary-for QWidget (0x0x7319c2d8a1c0) +QPaintDevice (0x0x7319c2d9d0c0) 16 + vptr=((& QMessageBox::_ZTV11QMessageBox) + 488) + +Class QTextEdit::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTextEdit::QPrivateSignal (0x0x7319c2def120) 0 empty + +Class QTextEdit::ExtraSelection + size=24 align=8 + base size=24 base align=8 +QTextEdit::ExtraSelection (0x0x7319c2def180) 0 + +Vtable for QTextEdit +QTextEdit::_ZTV9QTextEdit: 74 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QTextEdit) +16 (int (*)(...))QTextEdit::metaObject +24 (int (*)(...))QTextEdit::qt_metacast +32 (int (*)(...))QTextEdit::qt_metacall +40 (int (*)(...))QTextEdit::~QTextEdit +48 (int (*)(...))QTextEdit::~QTextEdit +56 (int (*)(...))QTextEdit::event +64 (int (*)(...))QAbstractScrollArea::eventFilter +72 (int (*)(...))QTextEdit::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QAbstractScrollArea::sizeHint +136 (int (*)(...))QAbstractScrollArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QTextEdit::mousePressEvent +176 (int (*)(...))QTextEdit::mouseReleaseEvent +184 (int (*)(...))QTextEdit::mouseDoubleClickEvent +192 (int (*)(...))QTextEdit::mouseMoveEvent +200 (int (*)(...))QTextEdit::wheelEvent +208 (int (*)(...))QTextEdit::keyPressEvent +216 (int (*)(...))QTextEdit::keyReleaseEvent +224 (int (*)(...))QTextEdit::focusInEvent +232 (int (*)(...))QTextEdit::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QTextEdit::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QTextEdit::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QTextEdit::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QTextEdit::dragEnterEvent +320 (int (*)(...))QTextEdit::dragMoveEvent +328 (int (*)(...))QTextEdit::dragLeaveEvent +336 (int (*)(...))QTextEdit::dropEvent +344 (int (*)(...))QTextEdit::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QTextEdit::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QTextEdit::inputMethodEvent +416 (int (*)(...))QTextEdit::inputMethodQuery +424 (int (*)(...))QTextEdit::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QAbstractScrollArea::setupViewport +448 (int (*)(...))QAbstractScrollArea::viewportEvent +456 (int (*)(...))QTextEdit::scrollContentsBy +464 (int (*)(...))QAbstractScrollArea::viewportSizeHint +472 (int (*)(...))QTextEdit::loadResource +480 (int (*)(...))QTextEdit::createMimeDataFromSelection +488 (int (*)(...))QTextEdit::canInsertFromMimeData +496 (int (*)(...))QTextEdit::insertFromMimeData +504 (int (*)(...))QTextEdit::doSetTextCursor +512 (int (*)(...))-16 +520 (int (*)(...))(& _ZTI9QTextEdit) +528 (int (*)(...))QTextEdit::_ZThn16_N9QTextEditD1Ev +536 (int (*)(...))QTextEdit::_ZThn16_N9QTextEditD0Ev +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +552 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +560 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +568 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +576 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +584 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QTextEdit + size=40 align=8 + base size=40 base align=8 +QTextEdit (0x0x7319c2dc2208) 0 + vptr=((& QTextEdit::_ZTV9QTextEdit) + 16) +QAbstractScrollArea (0x0x7319c2dc2270) 0 + primary-for QTextEdit (0x0x7319c2dc2208) +QFrame (0x0x7319c2dc22d8) 0 + primary-for QAbstractScrollArea (0x0x7319c2dc2270) +QWidget (0x0x7319c2dea1c0) 0 + primary-for QFrame (0x0x7319c2dc22d8) +QObject (0x0x7319c2def060) 0 + primary-for QWidget (0x0x7319c2dea1c0) +QPaintDevice (0x0x7319c2def0c0) 16 + vptr=((& QTextEdit::_ZTV9QTextEdit) + 528) + +Class QPlainTextEdit::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QPlainTextEdit::QPrivateSignal (0x0x7319c2defc00) 0 empty + +Vtable for QPlainTextEdit +QPlainTextEdit::_ZTV14QPlainTextEdit: 74 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QPlainTextEdit) +16 (int (*)(...))QPlainTextEdit::metaObject +24 (int (*)(...))QPlainTextEdit::qt_metacast +32 (int (*)(...))QPlainTextEdit::qt_metacall +40 (int (*)(...))QPlainTextEdit::~QPlainTextEdit +48 (int (*)(...))QPlainTextEdit::~QPlainTextEdit +56 (int (*)(...))QPlainTextEdit::event +64 (int (*)(...))QAbstractScrollArea::eventFilter +72 (int (*)(...))QPlainTextEdit::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QAbstractScrollArea::sizeHint +136 (int (*)(...))QAbstractScrollArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QPlainTextEdit::mousePressEvent +176 (int (*)(...))QPlainTextEdit::mouseReleaseEvent +184 (int (*)(...))QPlainTextEdit::mouseDoubleClickEvent +192 (int (*)(...))QPlainTextEdit::mouseMoveEvent +200 (int (*)(...))QPlainTextEdit::wheelEvent +208 (int (*)(...))QPlainTextEdit::keyPressEvent +216 (int (*)(...))QPlainTextEdit::keyReleaseEvent +224 (int (*)(...))QPlainTextEdit::focusInEvent +232 (int (*)(...))QPlainTextEdit::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QPlainTextEdit::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QPlainTextEdit::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QPlainTextEdit::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QPlainTextEdit::dragEnterEvent +320 (int (*)(...))QPlainTextEdit::dragMoveEvent +328 (int (*)(...))QPlainTextEdit::dragLeaveEvent +336 (int (*)(...))QPlainTextEdit::dropEvent +344 (int (*)(...))QPlainTextEdit::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QPlainTextEdit::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QPlainTextEdit::inputMethodEvent +416 (int (*)(...))QPlainTextEdit::inputMethodQuery +424 (int (*)(...))QPlainTextEdit::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QAbstractScrollArea::setupViewport +448 (int (*)(...))QAbstractScrollArea::viewportEvent +456 (int (*)(...))QPlainTextEdit::scrollContentsBy +464 (int (*)(...))QAbstractScrollArea::viewportSizeHint +472 (int (*)(...))QPlainTextEdit::loadResource +480 (int (*)(...))QPlainTextEdit::createMimeDataFromSelection +488 (int (*)(...))QPlainTextEdit::canInsertFromMimeData +496 (int (*)(...))QPlainTextEdit::insertFromMimeData +504 (int (*)(...))QPlainTextEdit::doSetTextCursor +512 (int (*)(...))-16 +520 (int (*)(...))(& _ZTI14QPlainTextEdit) +528 (int (*)(...))QPlainTextEdit::_ZThn16_N14QPlainTextEditD1Ev +536 (int (*)(...))QPlainTextEdit::_ZThn16_N14QPlainTextEditD0Ev +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +552 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +560 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +568 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +576 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +584 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QPlainTextEdit + size=40 align=8 + base size=40 base align=8 +QPlainTextEdit (0x0x7319c2dc25b0) 0 + vptr=((& QPlainTextEdit::_ZTV14QPlainTextEdit) + 16) +QAbstractScrollArea (0x0x7319c2dc2618) 0 + primary-for QPlainTextEdit (0x0x7319c2dc25b0) +QFrame (0x0x7319c2dc2680) 0 + primary-for QAbstractScrollArea (0x0x7319c2dc2618) +QWidget (0x0x7319c2dead20) 0 + primary-for QFrame (0x0x7319c2dc2680) +QObject (0x0x7319c2defb40) 0 + primary-for QWidget (0x0x7319c2dead20) +QPaintDevice (0x0x7319c2defba0) 16 + vptr=((& QPlainTextEdit::_ZTV14QPlainTextEdit) + 528) + +Class QPlainTextDocumentLayout::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QPlainTextDocumentLayout::QPrivateSignal (0x0x7319a8e68180) 0 empty + +Vtable for QPlainTextDocumentLayout +QPlainTextDocumentLayout::_ZTV24QPlainTextDocumentLayout: 24 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI24QPlainTextDocumentLayout) +16 (int (*)(...))QPlainTextDocumentLayout::metaObject +24 (int (*)(...))QPlainTextDocumentLayout::qt_metacast +32 (int (*)(...))QPlainTextDocumentLayout::qt_metacall +40 (int (*)(...))QPlainTextDocumentLayout::~QPlainTextDocumentLayout +48 (int (*)(...))QPlainTextDocumentLayout::~QPlainTextDocumentLayout +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QPlainTextDocumentLayout::draw +120 (int (*)(...))QPlainTextDocumentLayout::hitTest +128 (int (*)(...))QPlainTextDocumentLayout::pageCount +136 (int (*)(...))QPlainTextDocumentLayout::documentSize +144 (int (*)(...))QPlainTextDocumentLayout::frameBoundingRect +152 (int (*)(...))QPlainTextDocumentLayout::blockBoundingRect +160 (int (*)(...))QPlainTextDocumentLayout::documentChanged +168 (int (*)(...))QAbstractTextDocumentLayout::resizeInlineObject +176 (int (*)(...))QAbstractTextDocumentLayout::positionInlineObject +184 (int (*)(...))QAbstractTextDocumentLayout::drawInlineObject + +Class QPlainTextDocumentLayout + size=16 align=8 + base size=16 base align=8 +QPlainTextDocumentLayout (0x0x7319c2dc26e8) 0 + vptr=((& QPlainTextDocumentLayout::_ZTV24QPlainTextDocumentLayout) + 16) +QAbstractTextDocumentLayout (0x0x7319c2dc2750) 0 + primary-for QPlainTextDocumentLayout (0x0x7319c2dc26e8) +QObject (0x0x7319a8e68120) 0 + primary-for QAbstractTextDocumentLayout (0x0x7319c2dc2750) + +Class QProgressBar::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QProgressBar::QPrivateSignal (0x0x7319a8e683c0) 0 empty + +Vtable for QProgressBar +QProgressBar::_ZTV12QProgressBar: 66 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QProgressBar) +16 (int (*)(...))QProgressBar::metaObject +24 (int (*)(...))QProgressBar::qt_metacast +32 (int (*)(...))QProgressBar::qt_metacall +40 (int (*)(...))QProgressBar::~QProgressBar +48 (int (*)(...))QProgressBar::~QProgressBar +56 (int (*)(...))QProgressBar::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QProgressBar::sizeHint +136 (int (*)(...))QProgressBar::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QProgressBar::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QProgressBar::text +440 (int (*)(...))QProgressBar::initStyleOption +448 (int (*)(...))-16 +456 (int (*)(...))(& _ZTI12QProgressBar) +464 (int (*)(...))QProgressBar::_ZThn16_N12QProgressBarD1Ev +472 (int (*)(...))QProgressBar::_ZThn16_N12QProgressBarD0Ev +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QProgressBar + size=40 align=8 + base size=40 base align=8 +QProgressBar (0x0x7319c2dc27b8) 0 + vptr=((& QProgressBar::_ZTV12QProgressBar) + 16) +QWidget (0x0x7319a8e65540) 0 + primary-for QProgressBar (0x0x7319c2dc27b8) +QObject (0x0x7319a8e68300) 0 + primary-for QWidget (0x0x7319a8e65540) +QPaintDevice (0x0x7319a8e68360) 16 + vptr=((& QProgressBar::_ZTV12QProgressBar) + 464) + +Class QProgressDialog::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QProgressDialog::QPrivateSignal (0x0x7319a8e686c0) 0 empty + +Vtable for QProgressDialog +QProgressDialog::_ZTV15QProgressDialog: 69 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QProgressDialog) +16 (int (*)(...))QProgressDialog::metaObject +24 (int (*)(...))QProgressDialog::qt_metacast +32 (int (*)(...))QProgressDialog::qt_metacall +40 (int (*)(...))QProgressDialog::~QProgressDialog +48 (int (*)(...))QProgressDialog::~QProgressDialog +56 (int (*)(...))QWidget::event +64 (int (*)(...))QDialog::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QDialog::setVisible +128 (int (*)(...))QProgressDialog::sizeHint +136 (int (*)(...))QDialog::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QDialog::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QProgressDialog::resizeEvent +280 (int (*)(...))QProgressDialog::closeEvent +288 (int (*)(...))QDialog::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QProgressDialog::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QProgressDialog::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDialog::open +440 (int (*)(...))QDialog::exec +448 (int (*)(...))QDialog::done +456 (int (*)(...))QDialog::accept +464 (int (*)(...))QDialog::reject +472 (int (*)(...))-16 +480 (int (*)(...))(& _ZTI15QProgressDialog) +488 (int (*)(...))QProgressDialog::_ZThn16_N15QProgressDialogD1Ev +496 (int (*)(...))QProgressDialog::_ZThn16_N15QProgressDialogD0Ev +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QProgressDialog + size=40 align=8 + base size=40 base align=8 +QProgressDialog (0x0x7319c2dc2820) 0 + vptr=((& QProgressDialog::_ZTV15QProgressDialog) + 16) +QDialog (0x0x7319c2dc2888) 0 + primary-for QProgressDialog (0x0x7319c2dc2820) +QWidget (0x0x7319a8e658c0) 0 + primary-for QDialog (0x0x7319c2dc2888) +QObject (0x0x7319a8e68600) 0 + primary-for QWidget (0x0x7319a8e658c0) +QPaintDevice (0x0x7319a8e68660) 16 + vptr=((& QProgressDialog::_ZTV15QProgressDialog) + 488) + +Class QProxyStyle::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QProxyStyle::QPrivateSignal (0x0x7319a8e688a0) 0 empty + +Vtable for QProxyStyle +QProxyStyle::_ZTV11QProxyStyle: 37 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QProxyStyle) +16 (int (*)(...))QProxyStyle::metaObject +24 (int (*)(...))QProxyStyle::qt_metacast +32 (int (*)(...))QProxyStyle::qt_metacall +40 (int (*)(...))QProxyStyle::~QProxyStyle +48 (int (*)(...))QProxyStyle::~QProxyStyle +56 (int (*)(...))QProxyStyle::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QProxyStyle::polish +120 (int (*)(...))QProxyStyle::unpolish +128 (int (*)(...))QProxyStyle::polish +136 (int (*)(...))QProxyStyle::unpolish +144 (int (*)(...))QProxyStyle::polish +152 (int (*)(...))QProxyStyle::itemTextRect +160 (int (*)(...))QProxyStyle::itemPixmapRect +168 (int (*)(...))QProxyStyle::drawItemText +176 (int (*)(...))QProxyStyle::drawItemPixmap +184 (int (*)(...))QProxyStyle::standardPalette +192 (int (*)(...))QProxyStyle::drawPrimitive +200 (int (*)(...))QProxyStyle::drawControl +208 (int (*)(...))QProxyStyle::subElementRect +216 (int (*)(...))QProxyStyle::drawComplexControl +224 (int (*)(...))QProxyStyle::hitTestComplexControl +232 (int (*)(...))QProxyStyle::subControlRect +240 (int (*)(...))QProxyStyle::pixelMetric +248 (int (*)(...))QProxyStyle::sizeFromContents +256 (int (*)(...))QProxyStyle::styleHint +264 (int (*)(...))QProxyStyle::standardPixmap +272 (int (*)(...))QProxyStyle::standardIcon +280 (int (*)(...))QProxyStyle::generatedIconPixmap +288 (int (*)(...))QProxyStyle::layoutSpacing + +Class QProxyStyle + size=16 align=8 + base size=16 base align=8 +QProxyStyle (0x0x7319c2dc28f0) 0 + vptr=((& QProxyStyle::_ZTV11QProxyStyle) + 16) +QCommonStyle (0x0x7319c2dc2958) 0 + primary-for QProxyStyle (0x0x7319c2dc28f0) +QStyle (0x0x7319c2dc29c0) 0 + primary-for QCommonStyle (0x0x7319c2dc2958) +QObject (0x0x7319a8e68840) 0 + primary-for QStyle (0x0x7319c2dc29c0) + +Class QRadioButton::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QRadioButton::QPrivateSignal (0x0x7319a8e68ae0) 0 empty + +Vtable for QRadioButton +QRadioButton::_ZTV12QRadioButton: 68 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QRadioButton) +16 (int (*)(...))QRadioButton::metaObject +24 (int (*)(...))QRadioButton::qt_metacast +32 (int (*)(...))QRadioButton::qt_metacall +40 (int (*)(...))QRadioButton::~QRadioButton +48 (int (*)(...))QRadioButton::~QRadioButton +56 (int (*)(...))QRadioButton::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QAbstractButton::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QRadioButton::sizeHint +136 (int (*)(...))QRadioButton::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractButton::mousePressEvent +176 (int (*)(...))QAbstractButton::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QRadioButton::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QAbstractButton::keyPressEvent +216 (int (*)(...))QAbstractButton::keyReleaseEvent +224 (int (*)(...))QAbstractButton::focusInEvent +232 (int (*)(...))QAbstractButton::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QRadioButton::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QAbstractButton::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QRadioButton::hitButton +440 (int (*)(...))QAbstractButton::checkStateSet +448 (int (*)(...))QAbstractButton::nextCheckState +456 (int (*)(...))QRadioButton::initStyleOption +464 (int (*)(...))-16 +472 (int (*)(...))(& _ZTI12QRadioButton) +480 (int (*)(...))QRadioButton::_ZThn16_N12QRadioButtonD1Ev +488 (int (*)(...))QRadioButton::_ZThn16_N12QRadioButtonD0Ev +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QRadioButton + size=40 align=8 + base size=40 base align=8 +QRadioButton (0x0x7319c2dc2a28) 0 + vptr=((& QRadioButton::_ZTV12QRadioButton) + 16) +QAbstractButton (0x0x7319c2dc2a90) 0 + primary-for QRadioButton (0x0x7319c2dc2a28) +QWidget (0x0x7319a8e65bd0) 0 + primary-for QAbstractButton (0x0x7319c2dc2a90) +QObject (0x0x7319a8e68a20) 0 + primary-for QWidget (0x0x7319a8e65bd0) +QPaintDevice (0x0x7319a8e68a80) 16 + vptr=((& QRadioButton::_ZTV12QRadioButton) + 480) + +Class QRhiWidget::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QRhiWidget::QPrivateSignal (0x0x7319a8e68d20) 0 empty + +Vtable for QRhiWidget +QRhiWidget::_ZTV10QRhiWidget: 67 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QRhiWidget) +16 (int (*)(...))QRhiWidget::metaObject +24 (int (*)(...))QRhiWidget::qt_metacast +32 (int (*)(...))QRhiWidget::qt_metacall +40 (int (*)(...))QRhiWidget::~QRhiWidget +48 (int (*)(...))QRhiWidget::~QRhiWidget +56 (int (*)(...))QRhiWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QRhiWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QRhiWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QRhiWidget::initialize +440 (int (*)(...))QRhiWidget::render +448 (int (*)(...))QRhiWidget::releaseResources +456 (int (*)(...))-16 +464 (int (*)(...))(& _ZTI10QRhiWidget) +472 (int (*)(...))QRhiWidget::_ZThn16_N10QRhiWidgetD1Ev +480 (int (*)(...))QRhiWidget::_ZThn16_N10QRhiWidgetD0Ev +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QRhiWidget + size=40 align=8 + base size=40 base align=8 +QRhiWidget (0x0x7319c2dc2af8) 0 + vptr=((& QRhiWidget::_ZTV10QRhiWidget) + 16) +QWidget (0x0x7319a8e65d90) 0 + primary-for QRhiWidget (0x0x7319c2dc2af8) +QObject (0x0x7319a8e68c60) 0 + primary-for QWidget (0x0x7319a8e65d90) +QPaintDevice (0x0x7319a8e68cc0) 16 + vptr=((& QRhiWidget::_ZTV10QRhiWidget) + 472) + +Class QScrollBar::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QScrollBar::QPrivateSignal (0x0x7319a8ec9180) 0 empty + +Vtable for QScrollBar +QScrollBar::_ZTV10QScrollBar: 66 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QScrollBar) +16 (int (*)(...))QScrollBar::metaObject +24 (int (*)(...))QScrollBar::qt_metacast +32 (int (*)(...))QScrollBar::qt_metacall +40 (int (*)(...))QScrollBar::~QScrollBar +48 (int (*)(...))QScrollBar::~QScrollBar +56 (int (*)(...))QScrollBar::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QAbstractSlider::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QScrollBar::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QScrollBar::mousePressEvent +176 (int (*)(...))QScrollBar::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QScrollBar::mouseMoveEvent +200 (int (*)(...))QScrollBar::wheelEvent +208 (int (*)(...))QAbstractSlider::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QScrollBar::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QScrollBar::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QScrollBar::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QAbstractSlider::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QScrollBar::sliderChange +440 (int (*)(...))QScrollBar::initStyleOption +448 (int (*)(...))-16 +456 (int (*)(...))(& _ZTI10QScrollBar) +464 (int (*)(...))QScrollBar::_ZThn16_N10QScrollBarD1Ev +472 (int (*)(...))QScrollBar::_ZThn16_N10QScrollBarD0Ev +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QScrollBar + size=40 align=8 + base size=40 base align=8 +QScrollBar (0x0x7319c2dc2b60) 0 + vptr=((& QScrollBar::_ZTV10QScrollBar) + 16) +QAbstractSlider (0x0x7319c2dc2bc8) 0 + primary-for QScrollBar (0x0x7319c2dc2b60) +QWidget (0x0x7319a8eb7620) 0 + primary-for QAbstractSlider (0x0x7319c2dc2bc8) +QObject (0x0x7319a8ec90c0) 0 + primary-for QWidget (0x0x7319a8eb7620) +QPaintDevice (0x0x7319a8ec9120) 16 + vptr=((& QScrollBar::_ZTV10QScrollBar) + 464) + +Vtable for QScrollerProperties +QScrollerProperties::_ZTV19QScrollerProperties: 4 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QScrollerProperties) +16 (int (*)(...))QScrollerProperties::~QScrollerProperties +24 (int (*)(...))QScrollerProperties::~QScrollerProperties + +Class QScrollerProperties + size=16 align=8 + base size=16 base align=8 +QScrollerProperties (0x0x7319a8ec9300) 0 + vptr=((& QScrollerProperties::_ZTV19QScrollerProperties) + 16) + +Class QScroller::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QScroller::QPrivateSignal (0x0x7319a8f35a80) 0 empty + +Vtable for QScroller +QScroller::_ZTV9QScroller: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QScroller) +16 (int (*)(...))QScroller::metaObject +24 (int (*)(...))QScroller::qt_metacast +32 (int (*)(...))QScroller::qt_metacall +40 (int (*)(...))QScroller::~QScroller +48 (int (*)(...))QScroller::~QScroller +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QScroller + size=24 align=8 + base size=24 base align=8 +QScroller (0x0x7319a8f43bc8) 0 + vptr=((& QScroller::_ZTV9QScroller) + 16) +QObject (0x0x7319a8f35a20) 0 + primary-for QScroller (0x0x7319a8f43bc8) + +Class QSizeGrip::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSizeGrip::QPrivateSignal (0x0x7319a8f35d80) 0 empty + +Vtable for QSizeGrip +QSizeGrip::_ZTV9QSizeGrip: 64 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QSizeGrip) +16 (int (*)(...))QSizeGrip::metaObject +24 (int (*)(...))QSizeGrip::qt_metacast +32 (int (*)(...))QSizeGrip::qt_metacall +40 (int (*)(...))QSizeGrip::~QSizeGrip +48 (int (*)(...))QSizeGrip::~QSizeGrip +56 (int (*)(...))QSizeGrip::event +64 (int (*)(...))QSizeGrip::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QSizeGrip::setVisible +128 (int (*)(...))QSizeGrip::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QSizeGrip::mousePressEvent +176 (int (*)(...))QSizeGrip::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QSizeGrip::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QSizeGrip::paintEvent +264 (int (*)(...))QSizeGrip::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QSizeGrip::showEvent +352 (int (*)(...))QSizeGrip::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))-16 +440 (int (*)(...))(& _ZTI9QSizeGrip) +448 (int (*)(...))QSizeGrip::_ZThn16_N9QSizeGripD1Ev +456 (int (*)(...))QSizeGrip::_ZThn16_N9QSizeGripD0Ev +464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QSizeGrip + size=40 align=8 + base size=40 base align=8 +QSizeGrip (0x0x7319a8f43c30) 0 + vptr=((& QSizeGrip::_ZTV9QSizeGrip) + 16) +QWidget (0x0x7319a8f30b60) 0 + primary-for QSizeGrip (0x0x7319a8f43c30) +QObject (0x0x7319a8f35cc0) 0 + primary-for QWidget (0x0x7319a8f30b60) +QPaintDevice (0x0x7319a8f35d20) 16 + vptr=((& QSizeGrip::_ZTV9QSizeGrip) + 448) + +Class QSpinBox::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSpinBox::QPrivateSignal (0x0x7319a8f69000) 0 empty + +Vtable for QSpinBox +QSpinBox::_ZTV8QSpinBox: 72 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI8QSpinBox) +16 (int (*)(...))QSpinBox::metaObject +24 (int (*)(...))QSpinBox::qt_metacast +32 (int (*)(...))QSpinBox::qt_metacall +40 (int (*)(...))QSpinBox::~QSpinBox +48 (int (*)(...))QSpinBox::~QSpinBox +56 (int (*)(...))QSpinBox::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QAbstractSpinBox::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QAbstractSpinBox::sizeHint +136 (int (*)(...))QAbstractSpinBox::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractSpinBox::mousePressEvent +176 (int (*)(...))QAbstractSpinBox::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QAbstractSpinBox::mouseMoveEvent +200 (int (*)(...))QAbstractSpinBox::wheelEvent +208 (int (*)(...))QAbstractSpinBox::keyPressEvent +216 (int (*)(...))QAbstractSpinBox::keyReleaseEvent +224 (int (*)(...))QAbstractSpinBox::focusInEvent +232 (int (*)(...))QAbstractSpinBox::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QAbstractSpinBox::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QAbstractSpinBox::resizeEvent +280 (int (*)(...))QAbstractSpinBox::closeEvent +288 (int (*)(...))QAbstractSpinBox::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QAbstractSpinBox::showEvent +352 (int (*)(...))QAbstractSpinBox::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QAbstractSpinBox::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QAbstractSpinBox::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QSpinBox::validate +440 (int (*)(...))QSpinBox::fixup +448 (int (*)(...))QAbstractSpinBox::stepBy +456 (int (*)(...))QAbstractSpinBox::clear +464 (int (*)(...))QAbstractSpinBox::initStyleOption +472 (int (*)(...))QAbstractSpinBox::stepEnabled +480 (int (*)(...))QSpinBox::valueFromText +488 (int (*)(...))QSpinBox::textFromValue +496 (int (*)(...))-16 +504 (int (*)(...))(& _ZTI8QSpinBox) +512 (int (*)(...))QSpinBox::_ZThn16_N8QSpinBoxD1Ev +520 (int (*)(...))QSpinBox::_ZThn16_N8QSpinBoxD0Ev +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +552 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +560 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +568 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QSpinBox + size=40 align=8 + base size=40 base align=8 +QSpinBox (0x0x7319a8f43c98) 0 + vptr=((& QSpinBox::_ZTV8QSpinBox) + 16) +QAbstractSpinBox (0x0x7319a8f43d00) 0 + primary-for QSpinBox (0x0x7319a8f43c98) +QWidget (0x0x7319a8f30d20) 0 + primary-for QAbstractSpinBox (0x0x7319a8f43d00) +QObject (0x0x7319a8f35f00) 0 + primary-for QWidget (0x0x7319a8f30d20) +QPaintDevice (0x0x7319a8f35f60) 16 + vptr=((& QSpinBox::_ZTV8QSpinBox) + 512) + +Class QDoubleSpinBox::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDoubleSpinBox::QPrivateSignal (0x0x7319a8f69240) 0 empty + +Vtable for QDoubleSpinBox +QDoubleSpinBox::_ZTV14QDoubleSpinBox: 72 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QDoubleSpinBox) +16 (int (*)(...))QDoubleSpinBox::metaObject +24 (int (*)(...))QDoubleSpinBox::qt_metacast +32 (int (*)(...))QDoubleSpinBox::qt_metacall +40 (int (*)(...))QDoubleSpinBox::~QDoubleSpinBox +48 (int (*)(...))QDoubleSpinBox::~QDoubleSpinBox +56 (int (*)(...))QAbstractSpinBox::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QAbstractSpinBox::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QAbstractSpinBox::sizeHint +136 (int (*)(...))QAbstractSpinBox::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractSpinBox::mousePressEvent +176 (int (*)(...))QAbstractSpinBox::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QAbstractSpinBox::mouseMoveEvent +200 (int (*)(...))QAbstractSpinBox::wheelEvent +208 (int (*)(...))QAbstractSpinBox::keyPressEvent +216 (int (*)(...))QAbstractSpinBox::keyReleaseEvent +224 (int (*)(...))QAbstractSpinBox::focusInEvent +232 (int (*)(...))QAbstractSpinBox::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QAbstractSpinBox::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QAbstractSpinBox::resizeEvent +280 (int (*)(...))QAbstractSpinBox::closeEvent +288 (int (*)(...))QAbstractSpinBox::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QAbstractSpinBox::showEvent +352 (int (*)(...))QAbstractSpinBox::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QAbstractSpinBox::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QAbstractSpinBox::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDoubleSpinBox::validate +440 (int (*)(...))QDoubleSpinBox::fixup +448 (int (*)(...))QAbstractSpinBox::stepBy +456 (int (*)(...))QAbstractSpinBox::clear +464 (int (*)(...))QAbstractSpinBox::initStyleOption +472 (int (*)(...))QAbstractSpinBox::stepEnabled +480 (int (*)(...))QDoubleSpinBox::valueFromText +488 (int (*)(...))QDoubleSpinBox::textFromValue +496 (int (*)(...))-16 +504 (int (*)(...))(& _ZTI14QDoubleSpinBox) +512 (int (*)(...))QDoubleSpinBox::_ZThn16_N14QDoubleSpinBoxD1Ev +520 (int (*)(...))QDoubleSpinBox::_ZThn16_N14QDoubleSpinBoxD0Ev +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +552 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +560 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +568 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QDoubleSpinBox + size=40 align=8 + base size=40 base align=8 +QDoubleSpinBox (0x0x7319a8f43d68) 0 + vptr=((& QDoubleSpinBox::_ZTV14QDoubleSpinBox) + 16) +QAbstractSpinBox (0x0x7319a8f43dd0) 0 + primary-for QDoubleSpinBox (0x0x7319a8f43d68) +QWidget (0x0x7319a8f30ee0) 0 + primary-for QAbstractSpinBox (0x0x7319a8f43dd0) +QObject (0x0x7319a8f69180) 0 + primary-for QWidget (0x0x7319a8f30ee0) +QPaintDevice (0x0x7319a8f691e0) 16 + vptr=((& QDoubleSpinBox::_ZTV14QDoubleSpinBox) + 512) + +Class QSplashScreen::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSplashScreen::QPrivateSignal (0x0x7319a8f69480) 0 empty + +Vtable for QSplashScreen +QSplashScreen::_ZTV13QSplashScreen: 65 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QSplashScreen) +16 (int (*)(...))QSplashScreen::metaObject +24 (int (*)(...))QSplashScreen::qt_metacast +32 (int (*)(...))QSplashScreen::qt_metacall +40 (int (*)(...))QSplashScreen::~QSplashScreen +48 (int (*)(...))QSplashScreen::~QSplashScreen +56 (int (*)(...))QSplashScreen::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QSplashScreen::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QSplashScreen::drawContents +440 (int (*)(...))-16 +448 (int (*)(...))(& _ZTI13QSplashScreen) +456 (int (*)(...))QSplashScreen::_ZThn16_N13QSplashScreenD1Ev +464 (int (*)(...))QSplashScreen::_ZThn16_N13QSplashScreenD0Ev +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QSplashScreen + size=40 align=8 + base size=40 base align=8 +QSplashScreen (0x0x7319a8f43e38) 0 + vptr=((& QSplashScreen::_ZTV13QSplashScreen) + 16) +QWidget (0x0x7319a8f830e0) 0 + primary-for QSplashScreen (0x0x7319a8f43e38) +QObject (0x0x7319a8f693c0) 0 + primary-for QWidget (0x0x7319a8f830e0) +QPaintDevice (0x0x7319a8f69420) 16 + vptr=((& QSplashScreen::_ZTV13QSplashScreen) + 456) + +Class QSplitter::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSplitter::QPrivateSignal (0x0x7319a8f696c0) 0 empty + +Vtable for QSplitter +QSplitter::_ZTV9QSplitter: 66 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QSplitter) +16 (int (*)(...))QSplitter::metaObject +24 (int (*)(...))QSplitter::qt_metacast +32 (int (*)(...))QSplitter::qt_metacall +40 (int (*)(...))QSplitter::~QSplitter +48 (int (*)(...))QSplitter::~QSplitter +56 (int (*)(...))QSplitter::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QSplitter::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QSplitter::sizeHint +136 (int (*)(...))QSplitter::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QFrame::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QSplitter::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QSplitter::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QSplitter::createHandle +448 (int (*)(...))-16 +456 (int (*)(...))(& _ZTI9QSplitter) +464 (int (*)(...))QSplitter::_ZThn16_N9QSplitterD1Ev +472 (int (*)(...))QSplitter::_ZThn16_N9QSplitterD0Ev +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QSplitter + size=40 align=8 + base size=40 base align=8 +QSplitter (0x0x7319a8f43ea0) 0 + vptr=((& QSplitter::_ZTV9QSplitter) + 16) +QFrame (0x0x7319a8f43f08) 0 + primary-for QSplitter (0x0x7319a8f43ea0) +QWidget (0x0x7319a8f832a0) 0 + primary-for QFrame (0x0x7319a8f43f08) +QObject (0x0x7319a8f69600) 0 + primary-for QWidget (0x0x7319a8f832a0) +QPaintDevice (0x0x7319a8f69660) 16 + vptr=((& QSplitter::_ZTV9QSplitter) + 464) + +Class QSplitterHandle::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSplitterHandle::QPrivateSignal (0x0x7319a8f69900) 0 empty + +Vtable for QSplitterHandle +QSplitterHandle::_ZTV15QSplitterHandle: 64 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QSplitterHandle) +16 (int (*)(...))QSplitterHandle::metaObject +24 (int (*)(...))QSplitterHandle::qt_metacast +32 (int (*)(...))QSplitterHandle::qt_metacall +40 (int (*)(...))QSplitterHandle::~QSplitterHandle +48 (int (*)(...))QSplitterHandle::~QSplitterHandle +56 (int (*)(...))QSplitterHandle::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QSplitterHandle::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QSplitterHandle::mousePressEvent +176 (int (*)(...))QSplitterHandle::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QSplitterHandle::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QSplitterHandle::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QSplitterHandle::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))-16 +440 (int (*)(...))(& _ZTI15QSplitterHandle) +448 (int (*)(...))QSplitterHandle::_ZThn16_N15QSplitterHandleD1Ev +456 (int (*)(...))QSplitterHandle::_ZThn16_N15QSplitterHandleD0Ev +464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QSplitterHandle + size=40 align=8 + base size=40 base align=8 +QSplitterHandle (0x0x7319a8f43f70) 0 + vptr=((& QSplitterHandle::_ZTV15QSplitterHandle) + 16) +QWidget (0x0x7319a8f83460) 0 + primary-for QSplitterHandle (0x0x7319a8f43f70) +QObject (0x0x7319a8f69840) 0 + primary-for QWidget (0x0x7319a8f83460) +QPaintDevice (0x0x7319a8f698a0) 16 + vptr=((& QSplitterHandle::_ZTV15QSplitterHandle) + 448) + +Class QStackedLayout::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QStackedLayout::QPrivateSignal (0x0x7319a8f69b40) 0 empty + +Vtable for QStackedLayout +QStackedLayout::_ZTV14QStackedLayout: 54 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QStackedLayout) +16 (int (*)(...))QStackedLayout::metaObject +24 (int (*)(...))QStackedLayout::qt_metacast +32 (int (*)(...))QStackedLayout::qt_metacall +40 (int (*)(...))QStackedLayout::~QStackedLayout +48 (int (*)(...))QStackedLayout::~QStackedLayout +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QLayout::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QLayout::spacing +120 (int (*)(...))QLayout::setSpacing +128 (int (*)(...))QLayout::invalidate +136 (int (*)(...))QLayout::geometry +144 (int (*)(...))QStackedLayout::addItem +152 (int (*)(...))QLayout::expandingDirections +160 (int (*)(...))QStackedLayout::minimumSize +168 (int (*)(...))QLayout::maximumSize +176 (int (*)(...))QStackedLayout::setGeometry +184 (int (*)(...))QStackedLayout::itemAt +192 (int (*)(...))QStackedLayout::takeAt +200 (int (*)(...))QLayout::indexOf +208 (int (*)(...))QLayout::indexOf +216 (int (*)(...))QStackedLayout::count +224 (int (*)(...))QLayout::isEmpty +232 (int (*)(...))QLayout::controlTypes +240 (int (*)(...))QLayout::replaceWidget +248 (int (*)(...))QLayout::layout +256 (int (*)(...))QStackedLayout::sizeHint +264 (int (*)(...))QStackedLayout::hasHeightForWidth +272 (int (*)(...))QStackedLayout::heightForWidth +280 (int (*)(...))-16 +288 (int (*)(...))(& _ZTI14QStackedLayout) +296 (int (*)(...))QStackedLayout::_ZThn16_N14QStackedLayoutD1Ev +304 (int (*)(...))QStackedLayout::_ZThn16_N14QStackedLayoutD0Ev +312 (int (*)(...))QStackedLayout::_ZThn16_NK14QStackedLayout8sizeHintEv +320 (int (*)(...))QStackedLayout::_ZThn16_NK14QStackedLayout11minimumSizeEv +328 (int (*)(...))QLayout::_ZThn16_NK7QLayout11maximumSizeEv +336 (int (*)(...))QLayout::_ZThn16_NK7QLayout19expandingDirectionsEv +344 (int (*)(...))QStackedLayout::_ZThn16_N14QStackedLayout11setGeometryERK5QRect +352 (int (*)(...))QLayout::_ZThn16_NK7QLayout8geometryEv +360 (int (*)(...))QLayout::_ZThn16_NK7QLayout7isEmptyEv +368 (int (*)(...))QStackedLayout::_ZThn16_NK14QStackedLayout17hasHeightForWidthEv +376 (int (*)(...))QStackedLayout::_ZThn16_NK14QStackedLayout14heightForWidthEi +384 (int (*)(...))QLayoutItem::minimumHeightForWidth +392 (int (*)(...))QLayout::_ZThn16_N7QLayout10invalidateEv +400 (int (*)(...))QLayoutItem::widget +408 (int (*)(...))QLayout::_ZThn16_N7QLayout6layoutEv +416 (int (*)(...))QLayoutItem::spacerItem +424 (int (*)(...))QLayout::_ZThn16_NK7QLayout12controlTypesEv + +Class QStackedLayout + size=32 align=8 + base size=28 base align=8 +QStackedLayout (0x0x7319a8fae000) 0 + vptr=((& QStackedLayout::_ZTV14QStackedLayout) + 16) +QLayout (0x0x7319a8f83620) 0 + primary-for QStackedLayout (0x0x7319a8fae000) +QObject (0x0x7319a8f69a80) 0 + primary-for QLayout (0x0x7319a8f83620) +QLayoutItem (0x0x7319a8f69ae0) 16 + vptr=((& QStackedLayout::_ZTV14QStackedLayout) + 296) + +Class QStackedWidget::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QStackedWidget::QPrivateSignal (0x0x7319a8f69e40) 0 empty + +Vtable for QStackedWidget +QStackedWidget::_ZTV14QStackedWidget: 65 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QStackedWidget) +16 (int (*)(...))QStackedWidget::metaObject +24 (int (*)(...))QStackedWidget::qt_metacast +32 (int (*)(...))QStackedWidget::qt_metacall +40 (int (*)(...))QStackedWidget::~QStackedWidget +48 (int (*)(...))QStackedWidget::~QStackedWidget +56 (int (*)(...))QStackedWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QFrame::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QFrame::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QFrame::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))-16 +448 (int (*)(...))(& _ZTI14QStackedWidget) +456 (int (*)(...))QStackedWidget::_ZThn16_N14QStackedWidgetD1Ev +464 (int (*)(...))QStackedWidget::_ZThn16_N14QStackedWidgetD0Ev +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QStackedWidget + size=40 align=8 + base size=40 base align=8 +QStackedWidget (0x0x7319a8fae068) 0 + vptr=((& QStackedWidget::_ZTV14QStackedWidget) + 16) +QFrame (0x0x7319a8fae0d0) 0 + primary-for QStackedWidget (0x0x7319a8fae068) +QWidget (0x0x7319a8f839a0) 0 + primary-for QFrame (0x0x7319a8fae0d0) +QObject (0x0x7319a8f69d80) 0 + primary-for QWidget (0x0x7319a8f839a0) +QPaintDevice (0x0x7319a8f69de0) 16 + vptr=((& QStackedWidget::_ZTV14QStackedWidget) + 456) + +Class QStatusBar::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QStatusBar::QPrivateSignal (0x0x7319a8fce0c0) 0 empty + +Vtable for QStatusBar +QStatusBar::_ZTV10QStatusBar: 64 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QStatusBar) +16 (int (*)(...))QStatusBar::metaObject +24 (int (*)(...))QStatusBar::qt_metacast +32 (int (*)(...))QStatusBar::qt_metacall +40 (int (*)(...))QStatusBar::~QStatusBar +48 (int (*)(...))QStatusBar::~QStatusBar +56 (int (*)(...))QStatusBar::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QStatusBar::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QStatusBar::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QStatusBar::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))-16 +440 (int (*)(...))(& _ZTI10QStatusBar) +448 (int (*)(...))QStatusBar::_ZThn16_N10QStatusBarD1Ev +456 (int (*)(...))QStatusBar::_ZThn16_N10QStatusBarD0Ev +464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QStatusBar + size=40 align=8 + base size=40 base align=8 +QStatusBar (0x0x7319a8fae138) 0 + vptr=((& QStatusBar::_ZTV10QStatusBar) + 16) +QWidget (0x0x7319a8f83b60) 0 + primary-for QStatusBar (0x0x7319a8fae138) +QObject (0x0x7319a8fce000) 0 + primary-for QWidget (0x0x7319a8f83b60) +QPaintDevice (0x0x7319a8fce060) 16 + vptr=((& QStatusBar::_ZTV10QStatusBar) + 448) + +Class QStyledItemDelegate::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QStyledItemDelegate::QPrivateSignal (0x0x7319a8fce2a0) 0 empty + +Vtable for QStyledItemDelegate +QStyledItemDelegate::_ZTV19QStyledItemDelegate: 26 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QStyledItemDelegate) +16 (int (*)(...))QStyledItemDelegate::metaObject +24 (int (*)(...))QStyledItemDelegate::qt_metacast +32 (int (*)(...))QStyledItemDelegate::qt_metacall +40 (int (*)(...))QStyledItemDelegate::~QStyledItemDelegate +48 (int (*)(...))QStyledItemDelegate::~QStyledItemDelegate +56 (int (*)(...))QObject::event +64 (int (*)(...))QStyledItemDelegate::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QStyledItemDelegate::paint +120 (int (*)(...))QStyledItemDelegate::sizeHint +128 (int (*)(...))QStyledItemDelegate::createEditor +136 (int (*)(...))QAbstractItemDelegate::destroyEditor +144 (int (*)(...))QStyledItemDelegate::setEditorData +152 (int (*)(...))QStyledItemDelegate::setModelData +160 (int (*)(...))QStyledItemDelegate::updateEditorGeometry +168 (int (*)(...))QStyledItemDelegate::editorEvent +176 (int (*)(...))QAbstractItemDelegate::helpEvent +184 (int (*)(...))QAbstractItemDelegate::paintingRoles +192 (int (*)(...))QStyledItemDelegate::displayText +200 (int (*)(...))QStyledItemDelegate::initStyleOption + +Class QStyledItemDelegate + size=16 align=8 + base size=16 base align=8 +QStyledItemDelegate (0x0x7319a8fae1a0) 0 + vptr=((& QStyledItemDelegate::_ZTV19QStyledItemDelegate) + 16) +QAbstractItemDelegate (0x0x7319a8fae208) 0 + primary-for QStyledItemDelegate (0x0x7319a8fae1a0) +QObject (0x0x7319a8fce240) 0 + primary-for QAbstractItemDelegate (0x0x7319a8fae208) + +Class QStyleFactory + size=1 align=1 + base size=0 base align=1 +QStyleFactory (0x0x7319a8fce420) 0 empty + +Class QStylePainter + size=24 align=8 + base size=24 base align=8 +QStylePainter (0x0x7319a8fae270) 0 +QPainter (0x0x7319a8fce480) 0 + +Class QStylePlugin::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QStylePlugin::QPrivateSignal (0x0x7319a8fced20) 0 empty + +Vtable for QStylePlugin +QStylePlugin::_ZTV12QStylePlugin: 15 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QStylePlugin) +16 (int (*)(...))QStylePlugin::metaObject +24 (int (*)(...))QStylePlugin::qt_metacast +32 (int (*)(...))QStylePlugin::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual + +Class QStylePlugin + size=16 align=8 + base size=16 base align=8 +QStylePlugin (0x0x7319a8fae2d8) 0 + vptr=((& QStylePlugin::_ZTV12QStylePlugin) + 16) +QObject (0x0x7319a8fcecc0) 0 + primary-for QStylePlugin (0x0x7319a8fae2d8) + +Class QSystemTrayIcon::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSystemTrayIcon::QPrivateSignal (0x0x7319a8fcee40) 0 empty + +Vtable for QSystemTrayIcon +QSystemTrayIcon::_ZTV15QSystemTrayIcon: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QSystemTrayIcon) +16 (int (*)(...))QSystemTrayIcon::metaObject +24 (int (*)(...))QSystemTrayIcon::qt_metacast +32 (int (*)(...))QSystemTrayIcon::qt_metacall +40 (int (*)(...))QSystemTrayIcon::~QSystemTrayIcon +48 (int (*)(...))QSystemTrayIcon::~QSystemTrayIcon +56 (int (*)(...))QSystemTrayIcon::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QSystemTrayIcon + size=16 align=8 + base size=16 base align=8 +QSystemTrayIcon (0x0x7319a8fae340) 0 + vptr=((& QSystemTrayIcon::_ZTV15QSystemTrayIcon) + 16) +QObject (0x0x7319a8fcede0) 0 + primary-for QSystemTrayIcon (0x0x7319a8fae340) + +Class QTableView::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTableView::QPrivateSignal (0x0x7319a8c07180) 0 empty + +Vtable for QTableView +QTableView::_ZTV10QTableView: 108 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QTableView) +16 (int (*)(...))QTableView::metaObject +24 (int (*)(...))QTableView::qt_metacast +32 (int (*)(...))QTableView::qt_metacall +40 (int (*)(...))QTableView::~QTableView +48 (int (*)(...))QTableView::~QTableView +56 (int (*)(...))QAbstractItemView::event +64 (int (*)(...))QAbstractItemView::eventFilter +72 (int (*)(...))QTableView::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QAbstractScrollArea::sizeHint +136 (int (*)(...))QAbstractScrollArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractItemView::mousePressEvent +176 (int (*)(...))QAbstractItemView::mouseReleaseEvent +184 (int (*)(...))QAbstractItemView::mouseDoubleClickEvent +192 (int (*)(...))QAbstractItemView::mouseMoveEvent +200 (int (*)(...))QAbstractScrollArea::wheelEvent +208 (int (*)(...))QAbstractItemView::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QAbstractItemView::focusInEvent +232 (int (*)(...))QAbstractItemView::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QTableView::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QAbstractItemView::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QAbstractScrollArea::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QAbstractItemView::dragEnterEvent +320 (int (*)(...))QAbstractItemView::dragMoveEvent +328 (int (*)(...))QAbstractItemView::dragLeaveEvent +336 (int (*)(...))QTableView::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QFrame::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QAbstractItemView::inputMethodEvent +416 (int (*)(...))QAbstractItemView::inputMethodQuery +424 (int (*)(...))QAbstractItemView::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QAbstractScrollArea::setupViewport +448 (int (*)(...))QAbstractItemView::viewportEvent +456 (int (*)(...))QTableView::scrollContentsBy +464 (int (*)(...))QTableView::viewportSizeHint +472 (int (*)(...))QTableView::setModel +480 (int (*)(...))QTableView::setSelectionModel +488 (int (*)(...))QAbstractItemView::keyboardSearch +496 (int (*)(...))QTableView::visualRect +504 (int (*)(...))QTableView::scrollTo +512 (int (*)(...))QTableView::indexAt +520 (int (*)(...))QTableView::sizeHintForRow +528 (int (*)(...))QTableView::sizeHintForColumn +536 (int (*)(...))QAbstractItemView::itemDelegateForIndex +544 (int (*)(...))QAbstractItemView::reset +552 (int (*)(...))QTableView::setRootIndex +560 (int (*)(...))QTableView::doItemsLayout +568 (int (*)(...))QAbstractItemView::selectAll +576 (int (*)(...))QAbstractItemView::dataChanged +584 (int (*)(...))QAbstractItemView::rowsInserted +592 (int (*)(...))QAbstractItemView::rowsAboutToBeRemoved +600 (int (*)(...))QTableView::selectionChanged +608 (int (*)(...))QTableView::currentChanged +616 (int (*)(...))QAbstractItemView::updateEditorData +624 (int (*)(...))QAbstractItemView::updateEditorGeometries +632 (int (*)(...))QTableView::updateGeometries +640 (int (*)(...))QTableView::verticalScrollbarAction +648 (int (*)(...))QTableView::horizontalScrollbarAction +656 (int (*)(...))QAbstractItemView::verticalScrollbarValueChanged +664 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged +672 (int (*)(...))QAbstractItemView::closeEditor +680 (int (*)(...))QAbstractItemView::commitData +688 (int (*)(...))QAbstractItemView::editorDestroyed +696 (int (*)(...))QTableView::moveCursor +704 (int (*)(...))QTableView::horizontalOffset +712 (int (*)(...))QTableView::verticalOffset +720 (int (*)(...))QTableView::isIndexHidden +728 (int (*)(...))QTableView::setSelection +736 (int (*)(...))QTableView::visualRegionForSelection +744 (int (*)(...))QTableView::selectedIndexes +752 (int (*)(...))QAbstractItemView::edit +760 (int (*)(...))QAbstractItemView::selectionCommand +768 (int (*)(...))QAbstractItemView::startDrag +776 (int (*)(...))QTableView::initViewItemOption +784 (int (*)(...))-16 +792 (int (*)(...))(& _ZTI10QTableView) +800 (int (*)(...))QTableView::_ZThn16_N10QTableViewD1Ev +808 (int (*)(...))QTableView::_ZThn16_N10QTableViewD0Ev +816 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +824 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +832 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +840 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +848 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +856 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QTableView + size=40 align=8 + base size=40 base align=8 +QTableView (0x0x7319a8fae3a8) 0 + vptr=((& QTableView::_ZTV10QTableView) + 16) +QAbstractItemView (0x0x7319a8fae410) 0 + primary-for QTableView (0x0x7319a8fae3a8) +QAbstractScrollArea (0x0x7319a8fae478) 0 + primary-for QAbstractItemView (0x0x7319a8fae410) +QFrame (0x0x7319a8fae4e0) 0 + primary-for QAbstractScrollArea (0x0x7319a8fae478) +QWidget (0x0x7319a8feed90) 0 + primary-for QFrame (0x0x7319a8fae4e0) +QObject (0x0x7319a8c070c0) 0 + primary-for QWidget (0x0x7319a8feed90) +QPaintDevice (0x0x7319a8c07120) 16 + vptr=((& QTableView::_ZTV10QTableView) + 800) + +Class QTableWidgetSelectionRange + size=16 align=4 + base size=16 base align=4 +QTableWidgetSelectionRange (0x0x7319a8c07300) 0 + +Vtable for QTableWidgetItem +QTableWidgetItem::_ZTV16QTableWidgetItem: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI16QTableWidgetItem) +16 (int (*)(...))QTableWidgetItem::~QTableWidgetItem +24 (int (*)(...))QTableWidgetItem::~QTableWidgetItem +32 (int (*)(...))QTableWidgetItem::clone +40 (int (*)(...))QTableWidgetItem::data +48 (int (*)(...))QTableWidgetItem::setData +56 (int (*)(...))QTableWidgetItem::operator< +64 (int (*)(...))QTableWidgetItem::read +72 (int (*)(...))QTableWidgetItem::write + +Class QTableWidgetItem + size=64 align=8 + base size=60 base align=8 +QTableWidgetItem (0x0x7319a8c077e0) 0 + vptr=((& QTableWidgetItem::_ZTV16QTableWidgetItem) + 16) + +Class QTableWidget::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTableWidget::QPrivateSignal (0x0x7319a8c83a20) 0 empty + +Vtable for QTableWidget +QTableWidget::_ZTV12QTableWidget: 112 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QTableWidget) +16 (int (*)(...))QTableWidget::metaObject +24 (int (*)(...))QTableWidget::qt_metacast +32 (int (*)(...))QTableWidget::qt_metacall +40 (int (*)(...))QTableWidget::~QTableWidget +48 (int (*)(...))QTableWidget::~QTableWidget +56 (int (*)(...))QTableWidget::event +64 (int (*)(...))QAbstractItemView::eventFilter +72 (int (*)(...))QTableView::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QAbstractScrollArea::sizeHint +136 (int (*)(...))QAbstractScrollArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractItemView::mousePressEvent +176 (int (*)(...))QAbstractItemView::mouseReleaseEvent +184 (int (*)(...))QAbstractItemView::mouseDoubleClickEvent +192 (int (*)(...))QAbstractItemView::mouseMoveEvent +200 (int (*)(...))QAbstractScrollArea::wheelEvent +208 (int (*)(...))QAbstractItemView::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QAbstractItemView::focusInEvent +232 (int (*)(...))QAbstractItemView::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QTableView::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QAbstractItemView::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QAbstractScrollArea::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QAbstractItemView::dragEnterEvent +320 (int (*)(...))QAbstractItemView::dragMoveEvent +328 (int (*)(...))QAbstractItemView::dragLeaveEvent +336 (int (*)(...))QTableWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QFrame::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QAbstractItemView::inputMethodEvent +416 (int (*)(...))QAbstractItemView::inputMethodQuery +424 (int (*)(...))QAbstractItemView::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QAbstractScrollArea::setupViewport +448 (int (*)(...))QAbstractItemView::viewportEvent +456 (int (*)(...))QTableView::scrollContentsBy +464 (int (*)(...))QTableView::viewportSizeHint +472 (int (*)(...))QTableWidget::setModel +480 (int (*)(...))QTableView::setSelectionModel +488 (int (*)(...))QAbstractItemView::keyboardSearch +496 (int (*)(...))QTableView::visualRect +504 (int (*)(...))QTableView::scrollTo +512 (int (*)(...))QTableView::indexAt +520 (int (*)(...))QTableView::sizeHintForRow +528 (int (*)(...))QTableView::sizeHintForColumn +536 (int (*)(...))QAbstractItemView::itemDelegateForIndex +544 (int (*)(...))QAbstractItemView::reset +552 (int (*)(...))QTableView::setRootIndex +560 (int (*)(...))QTableView::doItemsLayout +568 (int (*)(...))QAbstractItemView::selectAll +576 (int (*)(...))QAbstractItemView::dataChanged +584 (int (*)(...))QAbstractItemView::rowsInserted +592 (int (*)(...))QAbstractItemView::rowsAboutToBeRemoved +600 (int (*)(...))QTableView::selectionChanged +608 (int (*)(...))QTableView::currentChanged +616 (int (*)(...))QAbstractItemView::updateEditorData +624 (int (*)(...))QAbstractItemView::updateEditorGeometries +632 (int (*)(...))QTableView::updateGeometries +640 (int (*)(...))QTableView::verticalScrollbarAction +648 (int (*)(...))QTableView::horizontalScrollbarAction +656 (int (*)(...))QAbstractItemView::verticalScrollbarValueChanged +664 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged +672 (int (*)(...))QAbstractItemView::closeEditor +680 (int (*)(...))QAbstractItemView::commitData +688 (int (*)(...))QAbstractItemView::editorDestroyed +696 (int (*)(...))QTableView::moveCursor +704 (int (*)(...))QTableView::horizontalOffset +712 (int (*)(...))QTableView::verticalOffset +720 (int (*)(...))QTableView::isIndexHidden +728 (int (*)(...))QTableView::setSelection +736 (int (*)(...))QTableView::visualRegionForSelection +744 (int (*)(...))QTableView::selectedIndexes +752 (int (*)(...))QAbstractItemView::edit +760 (int (*)(...))QAbstractItemView::selectionCommand +768 (int (*)(...))QAbstractItemView::startDrag +776 (int (*)(...))QTableView::initViewItemOption +784 (int (*)(...))QTableWidget::mimeTypes +792 (int (*)(...))QTableWidget::mimeData +800 (int (*)(...))QTableWidget::dropMimeData +808 (int (*)(...))QTableWidget::supportedDropActions +816 (int (*)(...))-16 +824 (int (*)(...))(& _ZTI12QTableWidget) +832 (int (*)(...))QTableWidget::_ZThn16_N12QTableWidgetD1Ev +840 (int (*)(...))QTableWidget::_ZThn16_N12QTableWidgetD0Ev +848 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +856 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +864 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +872 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +880 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +888 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QTableWidget + size=40 align=8 + base size=40 base align=8 +QTableWidget (0x0x7319a8faebc8) 0 + vptr=((& QTableWidget::_ZTV12QTableWidget) + 16) +QTableView (0x0x7319a8faec30) 0 + primary-for QTableWidget (0x0x7319a8faebc8) +QAbstractItemView (0x0x7319a8faec98) 0 + primary-for QTableView (0x0x7319a8faec30) +QAbstractScrollArea (0x0x7319a8faed00) 0 + primary-for QAbstractItemView (0x0x7319a8faec98) +QFrame (0x0x7319a8faed68) 0 + primary-for QAbstractScrollArea (0x0x7319a8faed00) +QWidget (0x0x7319a8c8c1c0) 0 + primary-for QFrame (0x0x7319a8faed68) +QObject (0x0x7319a8c83960) 0 + primary-for QWidget (0x0x7319a8c8c1c0) +QPaintDevice (0x0x7319a8c839c0) 16 + vptr=((& QTableWidget::_ZTV12QTableWidget) + 832) + +Class QTextBrowser::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTextBrowser::QPrivateSignal (0x0x7319a8c83de0) 0 empty + +Vtable for QTextBrowser +QTextBrowser::_ZTV12QTextBrowser: 79 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QTextBrowser) +16 (int (*)(...))QTextBrowser::metaObject +24 (int (*)(...))QTextBrowser::qt_metacast +32 (int (*)(...))QTextBrowser::qt_metacall +40 (int (*)(...))QTextBrowser::~QTextBrowser +48 (int (*)(...))QTextBrowser::~QTextBrowser +56 (int (*)(...))QTextBrowser::event +64 (int (*)(...))QAbstractScrollArea::eventFilter +72 (int (*)(...))QTextEdit::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QAbstractScrollArea::sizeHint +136 (int (*)(...))QAbstractScrollArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QTextBrowser::mousePressEvent +176 (int (*)(...))QTextBrowser::mouseReleaseEvent +184 (int (*)(...))QTextEdit::mouseDoubleClickEvent +192 (int (*)(...))QTextBrowser::mouseMoveEvent +200 (int (*)(...))QTextEdit::wheelEvent +208 (int (*)(...))QTextBrowser::keyPressEvent +216 (int (*)(...))QTextEdit::keyReleaseEvent +224 (int (*)(...))QTextEdit::focusInEvent +232 (int (*)(...))QTextBrowser::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QTextBrowser::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QTextEdit::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QTextEdit::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QTextEdit::dragEnterEvent +320 (int (*)(...))QTextEdit::dragMoveEvent +328 (int (*)(...))QTextEdit::dragLeaveEvent +336 (int (*)(...))QTextEdit::dropEvent +344 (int (*)(...))QTextEdit::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QTextEdit::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QTextEdit::inputMethodEvent +416 (int (*)(...))QTextEdit::inputMethodQuery +424 (int (*)(...))QTextBrowser::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QAbstractScrollArea::setupViewport +448 (int (*)(...))QAbstractScrollArea::viewportEvent +456 (int (*)(...))QTextEdit::scrollContentsBy +464 (int (*)(...))QAbstractScrollArea::viewportSizeHint +472 (int (*)(...))QTextBrowser::loadResource +480 (int (*)(...))QTextEdit::createMimeDataFromSelection +488 (int (*)(...))QTextEdit::canInsertFromMimeData +496 (int (*)(...))QTextEdit::insertFromMimeData +504 (int (*)(...))QTextEdit::doSetTextCursor +512 (int (*)(...))QTextBrowser::backward +520 (int (*)(...))QTextBrowser::forward +528 (int (*)(...))QTextBrowser::home +536 (int (*)(...))QTextBrowser::reload +544 (int (*)(...))QTextBrowser::doSetSource +552 (int (*)(...))-16 +560 (int (*)(...))(& _ZTI12QTextBrowser) +568 (int (*)(...))QTextBrowser::_ZThn16_N12QTextBrowserD1Ev +576 (int (*)(...))QTextBrowser::_ZThn16_N12QTextBrowserD0Ev +584 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +592 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +600 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +608 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +616 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +624 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QTextBrowser + size=40 align=8 + base size=40 base align=8 +QTextBrowser (0x0x7319a8faedd0) 0 + vptr=((& QTextBrowser::_ZTV12QTextBrowser) + 16) +QTextEdit (0x0x7319a8faee38) 0 + primary-for QTextBrowser (0x0x7319a8faedd0) +QAbstractScrollArea (0x0x7319a8faeea0) 0 + primary-for QTextEdit (0x0x7319a8faee38) +QFrame (0x0x7319a8faef08) 0 + primary-for QAbstractScrollArea (0x0x7319a8faeea0) +QWidget (0x0x7319a8c8c540) 0 + primary-for QFrame (0x0x7319a8faef08) +QObject (0x0x7319a8c83d20) 0 + primary-for QWidget (0x0x7319a8c8c540) +QPaintDevice (0x0x7319a8c83d80) 16 + vptr=((& QTextBrowser::_ZTV12QTextBrowser) + 568) + +Class QToolBar::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QToolBar::QPrivateSignal (0x0x7319a8cbe060) 0 empty + +Vtable for QToolBar +QToolBar::_ZTV8QToolBar: 65 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI8QToolBar) +16 (int (*)(...))QToolBar::metaObject +24 (int (*)(...))QToolBar::qt_metacast +32 (int (*)(...))QToolBar::qt_metacall +40 (int (*)(...))QToolBar::~QToolBar +48 (int (*)(...))QToolBar::~QToolBar +56 (int (*)(...))QToolBar::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QToolBar::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QToolBar::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QToolBar::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QToolBar::initStyleOption +440 (int (*)(...))-16 +448 (int (*)(...))(& _ZTI8QToolBar) +456 (int (*)(...))QToolBar::_ZThn16_N8QToolBarD1Ev +464 (int (*)(...))QToolBar::_ZThn16_N8QToolBarD0Ev +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QToolBar + size=40 align=8 + base size=40 base align=8 +QToolBar (0x0x7319a8faef70) 0 + vptr=((& QToolBar::_ZTV8QToolBar) + 16) +QWidget (0x0x7319a8c8c700) 0 + primary-for QToolBar (0x0x7319a8faef70) +QObject (0x0x7319a8c83f60) 0 + primary-for QWidget (0x0x7319a8c8c700) +QPaintDevice (0x0x7319a8cbe000) 16 + vptr=((& QToolBar::_ZTV8QToolBar) + 456) + +Class QToolBox::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QToolBox::QPrivateSignal (0x0x7319a8cbe360) 0 empty + +Vtable for QToolBox +QToolBox::_ZTV8QToolBox: 67 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI8QToolBox) +16 (int (*)(...))QToolBox::metaObject +24 (int (*)(...))QToolBox::qt_metacast +32 (int (*)(...))QToolBox::qt_metacall +40 (int (*)(...))QToolBox::~QToolBox +48 (int (*)(...))QToolBox::~QToolBox +56 (int (*)(...))QToolBox::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QFrame::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QFrame::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QToolBox::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QToolBox::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QToolBox::itemInserted +448 (int (*)(...))QToolBox::itemRemoved +456 (int (*)(...))-16 +464 (int (*)(...))(& _ZTI8QToolBox) +472 (int (*)(...))QToolBox::_ZThn16_N8QToolBoxD1Ev +480 (int (*)(...))QToolBox::_ZThn16_N8QToolBoxD0Ev +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QToolBox + size=40 align=8 + base size=40 base align=8 +QToolBox (0x0x7319a8cd1000) 0 + vptr=((& QToolBox::_ZTV8QToolBox) + 16) +QFrame (0x0x7319a8cd1068) 0 + primary-for QToolBox (0x0x7319a8cd1000) +QWidget (0x0x7319a8c8c9a0) 0 + primary-for QFrame (0x0x7319a8cd1068) +QObject (0x0x7319a8cbe2a0) 0 + primary-for QWidget (0x0x7319a8c8c9a0) +QPaintDevice (0x0x7319a8cbe300) 16 + vptr=((& QToolBox::_ZTV8QToolBox) + 472) + +Class QToolButton::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QToolButton::QPrivateSignal (0x0x7319a8cbe6c0) 0 empty + +Vtable for QToolButton +QToolButton::_ZTV11QToolButton: 68 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QToolButton) +16 (int (*)(...))QToolButton::metaObject +24 (int (*)(...))QToolButton::qt_metacast +32 (int (*)(...))QToolButton::qt_metacall +40 (int (*)(...))QToolButton::~QToolButton +48 (int (*)(...))QToolButton::~QToolButton +56 (int (*)(...))QToolButton::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QToolButton::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QToolButton::sizeHint +136 (int (*)(...))QToolButton::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QToolButton::mousePressEvent +176 (int (*)(...))QToolButton::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QAbstractButton::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QAbstractButton::keyPressEvent +216 (int (*)(...))QAbstractButton::keyReleaseEvent +224 (int (*)(...))QAbstractButton::focusInEvent +232 (int (*)(...))QAbstractButton::focusOutEvent +240 (int (*)(...))QToolButton::enterEvent +248 (int (*)(...))QToolButton::leaveEvent +256 (int (*)(...))QToolButton::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QToolButton::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QToolButton::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QToolButton::hitButton +440 (int (*)(...))QToolButton::checkStateSet +448 (int (*)(...))QToolButton::nextCheckState +456 (int (*)(...))QToolButton::initStyleOption +464 (int (*)(...))-16 +472 (int (*)(...))(& _ZTI11QToolButton) +480 (int (*)(...))QToolButton::_ZThn16_N11QToolButtonD1Ev +488 (int (*)(...))QToolButton::_ZThn16_N11QToolButtonD0Ev +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QToolButton + size=40 align=8 + base size=40 base align=8 +QToolButton (0x0x7319a8cd10d0) 0 + vptr=((& QToolButton::_ZTV11QToolButton) + 16) +QAbstractButton (0x0x7319a8cd1138) 0 + primary-for QToolButton (0x0x7319a8cd10d0) +QWidget (0x0x7319a8c8ccb0) 0 + primary-for QAbstractButton (0x0x7319a8cd1138) +QObject (0x0x7319a8cbe600) 0 + primary-for QWidget (0x0x7319a8c8ccb0) +QPaintDevice (0x0x7319a8cbe660) 16 + vptr=((& QToolButton::_ZTV11QToolButton) + 480) + +Class QToolTip + size=1 align=1 + base size=0 base align=1 +QToolTip (0x0x7319a8cbe900) 0 empty + +Class QTreeView::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTreeView::QPrivateSignal (0x0x7319a8cbea80) 0 empty + +Vtable for QTreeView +QTreeView::_ZTV9QTreeView: 110 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QTreeView) +16 (int (*)(...))QTreeView::metaObject +24 (int (*)(...))QTreeView::qt_metacast +32 (int (*)(...))QTreeView::qt_metacall +40 (int (*)(...))QTreeView::~QTreeView +48 (int (*)(...))QTreeView::~QTreeView +56 (int (*)(...))QAbstractItemView::event +64 (int (*)(...))QAbstractItemView::eventFilter +72 (int (*)(...))QTreeView::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QAbstractScrollArea::sizeHint +136 (int (*)(...))QAbstractScrollArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QTreeView::mousePressEvent +176 (int (*)(...))QTreeView::mouseReleaseEvent +184 (int (*)(...))QTreeView::mouseDoubleClickEvent +192 (int (*)(...))QTreeView::mouseMoveEvent +200 (int (*)(...))QAbstractScrollArea::wheelEvent +208 (int (*)(...))QTreeView::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QAbstractItemView::focusInEvent +232 (int (*)(...))QAbstractItemView::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QTreeView::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QAbstractItemView::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QAbstractScrollArea::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QAbstractItemView::dragEnterEvent +320 (int (*)(...))QTreeView::dragMoveEvent +328 (int (*)(...))QAbstractItemView::dragLeaveEvent +336 (int (*)(...))QAbstractItemView::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QTreeView::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QAbstractItemView::inputMethodEvent +416 (int (*)(...))QAbstractItemView::inputMethodQuery +424 (int (*)(...))QAbstractItemView::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QAbstractScrollArea::setupViewport +448 (int (*)(...))QTreeView::viewportEvent +456 (int (*)(...))QTreeView::scrollContentsBy +464 (int (*)(...))QTreeView::viewportSizeHint +472 (int (*)(...))QTreeView::setModel +480 (int (*)(...))QTreeView::setSelectionModel +488 (int (*)(...))QTreeView::keyboardSearch +496 (int (*)(...))QTreeView::visualRect +504 (int (*)(...))QTreeView::scrollTo +512 (int (*)(...))QTreeView::indexAt +520 (int (*)(...))QAbstractItemView::sizeHintForRow +528 (int (*)(...))QTreeView::sizeHintForColumn +536 (int (*)(...))QAbstractItemView::itemDelegateForIndex +544 (int (*)(...))QTreeView::reset +552 (int (*)(...))QTreeView::setRootIndex +560 (int (*)(...))QTreeView::doItemsLayout +568 (int (*)(...))QTreeView::selectAll +576 (int (*)(...))QTreeView::dataChanged +584 (int (*)(...))QTreeView::rowsInserted +592 (int (*)(...))QTreeView::rowsAboutToBeRemoved +600 (int (*)(...))QTreeView::selectionChanged +608 (int (*)(...))QTreeView::currentChanged +616 (int (*)(...))QAbstractItemView::updateEditorData +624 (int (*)(...))QAbstractItemView::updateEditorGeometries +632 (int (*)(...))QTreeView::updateGeometries +640 (int (*)(...))QAbstractItemView::verticalScrollbarAction +648 (int (*)(...))QTreeView::horizontalScrollbarAction +656 (int (*)(...))QTreeView::verticalScrollbarValueChanged +664 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged +672 (int (*)(...))QAbstractItemView::closeEditor +680 (int (*)(...))QAbstractItemView::commitData +688 (int (*)(...))QAbstractItemView::editorDestroyed +696 (int (*)(...))QTreeView::moveCursor +704 (int (*)(...))QTreeView::horizontalOffset +712 (int (*)(...))QTreeView::verticalOffset +720 (int (*)(...))QTreeView::isIndexHidden +728 (int (*)(...))QTreeView::setSelection +736 (int (*)(...))QTreeView::visualRegionForSelection +744 (int (*)(...))QTreeView::selectedIndexes +752 (int (*)(...))QAbstractItemView::edit +760 (int (*)(...))QAbstractItemView::selectionCommand +768 (int (*)(...))QAbstractItemView::startDrag +776 (int (*)(...))QAbstractItemView::initViewItemOption +784 (int (*)(...))QTreeView::drawRow +792 (int (*)(...))QTreeView::drawBranches +800 (int (*)(...))-16 +808 (int (*)(...))(& _ZTI9QTreeView) +816 (int (*)(...))QTreeView::_ZThn16_N9QTreeViewD1Ev +824 (int (*)(...))QTreeView::_ZThn16_N9QTreeViewD0Ev +832 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +840 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +848 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +856 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +864 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +872 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QTreeView + size=40 align=8 + base size=40 base align=8 +QTreeView (0x0x7319a8cd11a0) 0 + vptr=((& QTreeView::_ZTV9QTreeView) + 16) +QAbstractItemView (0x0x7319a8cd1208) 0 + primary-for QTreeView (0x0x7319a8cd11a0) +QAbstractScrollArea (0x0x7319a8cd1270) 0 + primary-for QAbstractItemView (0x0x7319a8cd1208) +QFrame (0x0x7319a8cd12d8) 0 + primary-for QAbstractScrollArea (0x0x7319a8cd1270) +QWidget (0x0x7319a8cf5150) 0 + primary-for QFrame (0x0x7319a8cd12d8) +QObject (0x0x7319a8cbe9c0) 0 + primary-for QWidget (0x0x7319a8cf5150) +QPaintDevice (0x0x7319a8cbea20) 16 + vptr=((& QTreeView::_ZTV9QTreeView) + 816) + +Class QTreeWidgetItemIterator + size=24 align=8 + base size=20 base align=8 +QTreeWidgetItemIterator (0x0x7319a8cbec00) 0 + +Vtable for QTreeWidgetItem +QTreeWidgetItem::_ZTV15QTreeWidgetItem: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QTreeWidgetItem) +16 (int (*)(...))QTreeWidgetItem::~QTreeWidgetItem +24 (int (*)(...))QTreeWidgetItem::~QTreeWidgetItem +32 (int (*)(...))QTreeWidgetItem::clone +40 (int (*)(...))QTreeWidgetItem::data +48 (int (*)(...))QTreeWidgetItem::setData +56 (int (*)(...))QTreeWidgetItem::operator< +64 (int (*)(...))QTreeWidgetItem::read +72 (int (*)(...))QTreeWidgetItem::write + +Class QTreeWidgetItem + size=96 align=8 + base size=92 base align=8 +QTreeWidgetItem (0x0x7319a8d48540) 0 + vptr=((& QTreeWidgetItem::_ZTV15QTreeWidgetItem) + 16) + +Class QTreeWidget::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTreeWidget::QPrivateSignal (0x0x7319a8a0e120) 0 empty + +Vtable for QTreeWidget +QTreeWidget::_ZTV11QTreeWidget: 114 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QTreeWidget) +16 (int (*)(...))QTreeWidget::metaObject +24 (int (*)(...))QTreeWidget::qt_metacast +32 (int (*)(...))QTreeWidget::qt_metacall +40 (int (*)(...))QTreeWidget::~QTreeWidget +48 (int (*)(...))QTreeWidget::~QTreeWidget +56 (int (*)(...))QTreeWidget::event +64 (int (*)(...))QAbstractItemView::eventFilter +72 (int (*)(...))QTreeView::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QAbstractScrollArea::sizeHint +136 (int (*)(...))QAbstractScrollArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QTreeView::mousePressEvent +176 (int (*)(...))QTreeView::mouseReleaseEvent +184 (int (*)(...))QTreeView::mouseDoubleClickEvent +192 (int (*)(...))QTreeView::mouseMoveEvent +200 (int (*)(...))QAbstractScrollArea::wheelEvent +208 (int (*)(...))QTreeView::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QAbstractItemView::focusInEvent +232 (int (*)(...))QAbstractItemView::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QTreeView::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QAbstractItemView::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QAbstractScrollArea::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QAbstractItemView::dragEnterEvent +320 (int (*)(...))QTreeView::dragMoveEvent +328 (int (*)(...))QAbstractItemView::dragLeaveEvent +336 (int (*)(...))QTreeWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QTreeView::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QAbstractItemView::inputMethodEvent +416 (int (*)(...))QAbstractItemView::inputMethodQuery +424 (int (*)(...))QAbstractItemView::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QAbstractScrollArea::setupViewport +448 (int (*)(...))QTreeView::viewportEvent +456 (int (*)(...))QTreeView::scrollContentsBy +464 (int (*)(...))QTreeView::viewportSizeHint +472 (int (*)(...))QTreeWidget::setModel +480 (int (*)(...))QTreeWidget::setSelectionModel +488 (int (*)(...))QTreeView::keyboardSearch +496 (int (*)(...))QTreeView::visualRect +504 (int (*)(...))QTreeView::scrollTo +512 (int (*)(...))QTreeView::indexAt +520 (int (*)(...))QAbstractItemView::sizeHintForRow +528 (int (*)(...))QTreeView::sizeHintForColumn +536 (int (*)(...))QAbstractItemView::itemDelegateForIndex +544 (int (*)(...))QTreeView::reset +552 (int (*)(...))QTreeView::setRootIndex +560 (int (*)(...))QTreeView::doItemsLayout +568 (int (*)(...))QTreeView::selectAll +576 (int (*)(...))QTreeView::dataChanged +584 (int (*)(...))QTreeView::rowsInserted +592 (int (*)(...))QTreeView::rowsAboutToBeRemoved +600 (int (*)(...))QTreeView::selectionChanged +608 (int (*)(...))QTreeView::currentChanged +616 (int (*)(...))QAbstractItemView::updateEditorData +624 (int (*)(...))QAbstractItemView::updateEditorGeometries +632 (int (*)(...))QTreeView::updateGeometries +640 (int (*)(...))QAbstractItemView::verticalScrollbarAction +648 (int (*)(...))QTreeView::horizontalScrollbarAction +656 (int (*)(...))QTreeView::verticalScrollbarValueChanged +664 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged +672 (int (*)(...))QAbstractItemView::closeEditor +680 (int (*)(...))QAbstractItemView::commitData +688 (int (*)(...))QAbstractItemView::editorDestroyed +696 (int (*)(...))QTreeView::moveCursor +704 (int (*)(...))QTreeView::horizontalOffset +712 (int (*)(...))QTreeView::verticalOffset +720 (int (*)(...))QTreeView::isIndexHidden +728 (int (*)(...))QTreeView::setSelection +736 (int (*)(...))QTreeView::visualRegionForSelection +744 (int (*)(...))QTreeView::selectedIndexes +752 (int (*)(...))QAbstractItemView::edit +760 (int (*)(...))QAbstractItemView::selectionCommand +768 (int (*)(...))QAbstractItemView::startDrag +776 (int (*)(...))QAbstractItemView::initViewItemOption +784 (int (*)(...))QTreeView::drawRow +792 (int (*)(...))QTreeView::drawBranches +800 (int (*)(...))QTreeWidget::mimeTypes +808 (int (*)(...))QTreeWidget::mimeData +816 (int (*)(...))QTreeWidget::dropMimeData +824 (int (*)(...))QTreeWidget::supportedDropActions +832 (int (*)(...))-16 +840 (int (*)(...))(& _ZTI11QTreeWidget) +848 (int (*)(...))QTreeWidget::_ZThn16_N11QTreeWidgetD1Ev +856 (int (*)(...))QTreeWidget::_ZThn16_N11QTreeWidgetD0Ev +864 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +872 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +880 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +888 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +896 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +904 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QTreeWidget + size=40 align=8 + base size=40 base align=8 +QTreeWidget (0x0x7319a8dc13a8) 0 + vptr=((& QTreeWidget::_ZTV11QTreeWidget) + 16) +QTreeView (0x0x7319a8dc1410) 0 + primary-for QTreeWidget (0x0x7319a8dc13a8) +QAbstractItemView (0x0x7319a8dc1478) 0 + primary-for QTreeView (0x0x7319a8dc1410) +QAbstractScrollArea (0x0x7319a8dc14e0) 0 + primary-for QAbstractItemView (0x0x7319a8dc1478) +QFrame (0x0x7319a8dc1548) 0 + primary-for QAbstractScrollArea (0x0x7319a8dc14e0) +QWidget (0x0x7319a8a0a380) 0 + primary-for QFrame (0x0x7319a8dc1548) +QObject (0x0x7319a8a0e060) 0 + primary-for QWidget (0x0x7319a8a0a380) +QPaintDevice (0x0x7319a8a0e0c0) 16 + vptr=((& QTreeWidget::_ZTV11QTreeWidget) + 848) + +Class QUndoView::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QUndoView::QPrivateSignal (0x0x7319a8a0e540) 0 empty + +Vtable for QUndoView +QUndoView::_ZTV9QUndoView: 108 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QUndoView) +16 (int (*)(...))QUndoView::metaObject +24 (int (*)(...))QUndoView::qt_metacast +32 (int (*)(...))QUndoView::qt_metacall +40 (int (*)(...))QUndoView::~QUndoView +48 (int (*)(...))QUndoView::~QUndoView +56 (int (*)(...))QListView::event +64 (int (*)(...))QAbstractItemView::eventFilter +72 (int (*)(...))QListView::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QAbstractScrollArea::sizeHint +136 (int (*)(...))QAbstractScrollArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractItemView::mousePressEvent +176 (int (*)(...))QListView::mouseReleaseEvent +184 (int (*)(...))QAbstractItemView::mouseDoubleClickEvent +192 (int (*)(...))QListView::mouseMoveEvent +200 (int (*)(...))QListView::wheelEvent +208 (int (*)(...))QAbstractItemView::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QAbstractItemView::focusInEvent +232 (int (*)(...))QAbstractItemView::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QListView::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QListView::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QAbstractScrollArea::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QAbstractItemView::dragEnterEvent +320 (int (*)(...))QListView::dragMoveEvent +328 (int (*)(...))QListView::dragLeaveEvent +336 (int (*)(...))QListView::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QFrame::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QAbstractItemView::inputMethodEvent +416 (int (*)(...))QAbstractItemView::inputMethodQuery +424 (int (*)(...))QAbstractItemView::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QAbstractScrollArea::setupViewport +448 (int (*)(...))QAbstractItemView::viewportEvent +456 (int (*)(...))QListView::scrollContentsBy +464 (int (*)(...))QListView::viewportSizeHint +472 (int (*)(...))QAbstractItemView::setModel +480 (int (*)(...))QAbstractItemView::setSelectionModel +488 (int (*)(...))QAbstractItemView::keyboardSearch +496 (int (*)(...))QListView::visualRect +504 (int (*)(...))QListView::scrollTo +512 (int (*)(...))QListView::indexAt +520 (int (*)(...))QAbstractItemView::sizeHintForRow +528 (int (*)(...))QAbstractItemView::sizeHintForColumn +536 (int (*)(...))QAbstractItemView::itemDelegateForIndex +544 (int (*)(...))QListView::reset +552 (int (*)(...))QListView::setRootIndex +560 (int (*)(...))QListView::doItemsLayout +568 (int (*)(...))QAbstractItemView::selectAll +576 (int (*)(...))QListView::dataChanged +584 (int (*)(...))QListView::rowsInserted +592 (int (*)(...))QListView::rowsAboutToBeRemoved +600 (int (*)(...))QListView::selectionChanged +608 (int (*)(...))QListView::currentChanged +616 (int (*)(...))QAbstractItemView::updateEditorData +624 (int (*)(...))QAbstractItemView::updateEditorGeometries +632 (int (*)(...))QListView::updateGeometries +640 (int (*)(...))QAbstractItemView::verticalScrollbarAction +648 (int (*)(...))QAbstractItemView::horizontalScrollbarAction +656 (int (*)(...))QAbstractItemView::verticalScrollbarValueChanged +664 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged +672 (int (*)(...))QAbstractItemView::closeEditor +680 (int (*)(...))QAbstractItemView::commitData +688 (int (*)(...))QAbstractItemView::editorDestroyed +696 (int (*)(...))QListView::moveCursor +704 (int (*)(...))QListView::horizontalOffset +712 (int (*)(...))QListView::verticalOffset +720 (int (*)(...))QListView::isIndexHidden +728 (int (*)(...))QListView::setSelection +736 (int (*)(...))QListView::visualRegionForSelection +744 (int (*)(...))QListView::selectedIndexes +752 (int (*)(...))QAbstractItemView::edit +760 (int (*)(...))QAbstractItemView::selectionCommand +768 (int (*)(...))QListView::startDrag +776 (int (*)(...))QListView::initViewItemOption +784 (int (*)(...))-16 +792 (int (*)(...))(& _ZTI9QUndoView) +800 (int (*)(...))QUndoView::_ZThn16_N9QUndoViewD1Ev +808 (int (*)(...))QUndoView::_ZThn16_N9QUndoViewD0Ev +816 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +824 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +832 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +840 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +848 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +856 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QUndoView + size=40 align=8 + base size=40 base align=8 +QUndoView (0x0x7319a8dc15b0) 0 + vptr=((& QUndoView::_ZTV9QUndoView) + 16) +QListView (0x0x7319a8dc1618) 0 + primary-for QUndoView (0x0x7319a8dc15b0) +QAbstractItemView (0x0x7319a8dc1680) 0 + primary-for QListView (0x0x7319a8dc1618) +QAbstractScrollArea (0x0x7319a8dc16e8) 0 + primary-for QAbstractItemView (0x0x7319a8dc1680) +QFrame (0x0x7319a8dc1750) 0 + primary-for QAbstractScrollArea (0x0x7319a8dc16e8) +QWidget (0x0x7319a8a0a770) 0 + primary-for QFrame (0x0x7319a8dc1750) +QObject (0x0x7319a8a0e480) 0 + primary-for QWidget (0x0x7319a8a0a770) +QPaintDevice (0x0x7319a8a0e4e0) 16 + vptr=((& QUndoView::_ZTV9QUndoView) + 800) + +Class QWhatsThis + size=1 align=1 + base size=0 base align=1 +QWhatsThis (0x0x7319a8a0e6c0) 0 empty + +Class QWidgetAction::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QWidgetAction::QPrivateSignal (0x0x7319a8a0e780) 0 empty + +Vtable for QWidgetAction +QWidgetAction::_ZTV13QWidgetAction: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QWidgetAction) +16 (int (*)(...))QWidgetAction::metaObject +24 (int (*)(...))QWidgetAction::qt_metacast +32 (int (*)(...))QWidgetAction::qt_metacall +40 (int (*)(...))QWidgetAction::~QWidgetAction +48 (int (*)(...))QWidgetAction::~QWidgetAction +56 (int (*)(...))QWidgetAction::event +64 (int (*)(...))QWidgetAction::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidgetAction::createWidget +120 (int (*)(...))QWidgetAction::deleteWidget + +Class QWidgetAction + size=16 align=8 + base size=16 base align=8 +QWidgetAction (0x0x7319a8dc17b8) 0 + vptr=((& QWidgetAction::_ZTV13QWidgetAction) + 16) +QAction (0x0x7319a8dc1820) 0 + primary-for QWidgetAction (0x0x7319a8dc17b8) +QObject (0x0x7319a8a0e720) 0 + primary-for QAction (0x0x7319a8dc1820) + +Class QWizard::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QWizard::QPrivateSignal (0x0x7319a8a0e9c0) 0 empty + +Vtable for QWizard +QWizard::_ZTV7QWizard: 73 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI7QWizard) +16 (int (*)(...))QWizard::metaObject +24 (int (*)(...))QWizard::qt_metacast +32 (int (*)(...))QWizard::qt_metacall +40 (int (*)(...))QWizard::~QWizard +48 (int (*)(...))QWizard::~QWizard +56 (int (*)(...))QWizard::event +64 (int (*)(...))QDialog::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWizard::setVisible +128 (int (*)(...))QWizard::sizeHint +136 (int (*)(...))QDialog::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QDialog::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWizard::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWizard::resizeEvent +280 (int (*)(...))QDialog::closeEvent +288 (int (*)(...))QDialog::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QDialog::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDialog::open +440 (int (*)(...))QDialog::exec +448 (int (*)(...))QWizard::done +456 (int (*)(...))QDialog::accept +464 (int (*)(...))QDialog::reject +472 (int (*)(...))QWizard::validateCurrentPage +480 (int (*)(...))QWizard::nextId +488 (int (*)(...))QWizard::initializePage +496 (int (*)(...))QWizard::cleanupPage +504 (int (*)(...))-16 +512 (int (*)(...))(& _ZTI7QWizard) +520 (int (*)(...))QWizard::_ZThn16_N7QWizardD1Ev +528 (int (*)(...))QWizard::_ZThn16_N7QWizardD0Ev +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +552 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +560 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +568 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +576 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QWizard + size=40 align=8 + base size=40 base align=8 +QWizard (0x0x7319a8dc1888) 0 + vptr=((& QWizard::_ZTV7QWizard) + 16) +QDialog (0x0x7319a8dc18f0) 0 + primary-for QWizard (0x0x7319a8dc1888) +QWidget (0x0x7319a8a0aa80) 0 + primary-for QDialog (0x0x7319a8dc18f0) +QObject (0x0x7319a8a0e900) 0 + primary-for QWidget (0x0x7319a8a0aa80) +QPaintDevice (0x0x7319a8a0e960) 16 + vptr=((& QWizard::_ZTV7QWizard) + 520) + +Class QWizardPage::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QWizardPage::QPrivateSignal (0x0x7319a8a7d3c0) 0 empty + +Vtable for QWizardPage +QWizardPage::_ZTV11QWizardPage: 69 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QWizardPage) +16 (int (*)(...))QWizardPage::metaObject +24 (int (*)(...))QWizardPage::qt_metacast +32 (int (*)(...))QWizardPage::qt_metacall +40 (int (*)(...))QWizardPage::~QWizardPage +48 (int (*)(...))QWizardPage::~QWizardPage +56 (int (*)(...))QWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QWizardPage::initializePage +440 (int (*)(...))QWizardPage::cleanupPage +448 (int (*)(...))QWizardPage::validatePage +456 (int (*)(...))QWizardPage::isComplete +464 (int (*)(...))QWizardPage::nextId +472 (int (*)(...))-16 +480 (int (*)(...))(& _ZTI11QWizardPage) +488 (int (*)(...))QWizardPage::_ZThn16_N11QWizardPageD1Ev +496 (int (*)(...))QWizardPage::_ZThn16_N11QWizardPageD0Ev +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QWizardPage + size=40 align=8 + base size=40 base align=8 +QWizardPage (0x0x7319a8dc1bc8) 0 + vptr=((& QWizardPage::_ZTV11QWizardPage) + 16) +QWidget (0x0x7319a8a7b460) 0 + primary-for QWizardPage (0x0x7319a8dc1bc8) +QObject (0x0x7319a8a7d300) 0 + primary-for QWidget (0x0x7319a8a7b460) +QPaintDevice (0x0x7319a8a7d360) 16 + vptr=((& QWizardPage::_ZTV11QWizardPage) + 488) + +Vtable for QDesignerCustomWidgetInterface +QDesignerCustomWidgetInterface::_ZTV30QDesignerCustomWidgetInterface: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI30QDesignerCustomWidgetInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))__cxa_pure_virtual +96 (int (*)(...))QDesignerCustomWidgetInterface::isInitialized +104 (int (*)(...))QDesignerCustomWidgetInterface::initialize +112 (int (*)(...))QDesignerCustomWidgetInterface::domXml +120 (int (*)(...))QDesignerCustomWidgetInterface::codeTemplate + +Class QDesignerCustomWidgetInterface + size=8 align=8 + base size=8 base align=8 +QDesignerCustomWidgetInterface (0x0x7319a8a7d540) 0 nearly-empty + vptr=((& QDesignerCustomWidgetInterface::_ZTV30QDesignerCustomWidgetInterface) + 16) + +Vtable for QDesignerCustomWidgetCollectionInterface +QDesignerCustomWidgetCollectionInterface::_ZTV40QDesignerCustomWidgetCollectionInterface: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI40QDesignerCustomWidgetCollectionInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual + +Class QDesignerCustomWidgetCollectionInterface + size=8 align=8 + base size=8 base align=8 +QDesignerCustomWidgetCollectionInterface (0x0x7319a8ab0480) 0 nearly-empty + vptr=((& QDesignerCustomWidgetCollectionInterface::_ZTV40QDesignerCustomWidgetCollectionInterface) + 16) + +Class QDomImplementation + size=8 align=8 + base size=8 base align=8 +QDomImplementation (0x0x7319a8ab08a0) 0 + +Class QDomNode + size=8 align=8 + base size=8 base align=8 +QDomNode (0x0x7319a8ab0900) 0 + +Class QDomNodeList::It + size=16 align=8 + base size=16 base align=8 +QDomNodeList::It (0x0x7319a8ab09c0) 0 + +Class QDomNodeList + size=8 align=8 + base size=8 base align=8 +QDomNodeList (0x0x7319a8ab0960) 0 + +Class QDomDocumentType + size=8 align=8 + base size=8 base align=8 +QDomDocumentType (0x0x7319a8aad5b0) 0 +QDomNode (0x0x7319a8af1ae0) 0 + +Class QDomDocument::ParseResult + size=40 align=8 + base size=40 base align=8 +QDomDocument::ParseResult (0x0x7319a8af1c00) 0 + +Class QDomDocument + size=8 align=8 + base size=8 base align=8 +QDomDocument (0x0x7319a8aad618) 0 +QDomNode (0x0x7319a8af1ba0) 0 + +Class QDomNamedNodeMap + size=8 align=8 + base size=8 base align=8 +QDomNamedNodeMap (0x0x7319a8b41060) 0 + +Class QDomDocumentFragment + size=8 align=8 + base size=8 base align=8 +QDomDocumentFragment (0x0x7319a8aad8f0) 0 +QDomNode (0x0x7319a8b411e0) 0 + +Class QDomCharacterData + size=8 align=8 + base size=8 base align=8 +QDomCharacterData (0x0x7319a8aad958) 0 +QDomNode (0x0x7319a8b412a0) 0 + +Class QDomAttr + size=8 align=8 + base size=8 base align=8 +QDomAttr (0x0x7319a8aad9c0) 0 +QDomNode (0x0x7319a8b41300) 0 + +Class QDomElement + size=8 align=8 + base size=8 base align=8 +QDomElement (0x0x7319a8aada28) 0 +QDomNode (0x0x7319a8b413c0) 0 + +Class QDomText + size=8 align=8 + base size=8 base align=8 +QDomText (0x0x7319a8aada90) 0 +QDomCharacterData (0x0x7319a8aadaf8) 0 +QDomNode (0x0x7319a8b41600) 0 + +Class QDomComment + size=8 align=8 + base size=8 base align=8 +QDomComment (0x0x7319a8aadb60) 0 +QDomCharacterData (0x0x7319a8aadbc8) 0 +QDomNode (0x0x7319a8b416c0) 0 + +Class QDomCDATASection + size=8 align=8 + base size=8 base align=8 +QDomCDATASection (0x0x7319a8aadc30) 0 +QDomText (0x0x7319a8aadc98) 0 +QDomCharacterData (0x0x7319a8aadd00) 0 +QDomNode (0x0x7319a8b41780) 0 + +Class QDomNotation + size=8 align=8 + base size=8 base align=8 +QDomNotation (0x0x7319a8aadd68) 0 +QDomNode (0x0x7319a8b41840) 0 + +Class QDomEntity + size=8 align=8 + base size=8 base align=8 +QDomEntity (0x0x7319a8aaddd0) 0 +QDomNode (0x0x7319a8b41900) 0 + +Class QDomEntityReference + size=8 align=8 + base size=8 base align=8 +QDomEntityReference (0x0x7319a8aade38) 0 +QDomNode (0x0x7319a8b419c0) 0 + +Class QDomProcessingInstruction + size=8 align=8 + base size=8 base align=8 +QDomProcessingInstruction (0x0x7319a8aadea0) 0 +QDomNode (0x0x7319a8b41a80) 0 + +Class QOpenGLBuffer + size=8 align=8 + base size=8 base align=8 +QOpenGLBuffer (0x0x7319a8b41b40) 0 + +Class QOpenGLDebugMessage + size=8 align=8 + base size=8 base align=8 +QOpenGLDebugMessage (0x0x7319a8bd4240) 0 + +Class QOpenGLDebugLogger::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QOpenGLDebugLogger::QPrivateSignal (0x0x7319a88983c0) 0 empty + +Vtable for QOpenGLDebugLogger +QOpenGLDebugLogger::_ZTV18QOpenGLDebugLogger: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QOpenGLDebugLogger) +16 (int (*)(...))QOpenGLDebugLogger::metaObject +24 (int (*)(...))QOpenGLDebugLogger::qt_metacast +32 (int (*)(...))QOpenGLDebugLogger::qt_metacall +40 (int (*)(...))QOpenGLDebugLogger::~QOpenGLDebugLogger +48 (int (*)(...))QOpenGLDebugLogger::~QOpenGLDebugLogger +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QOpenGLDebugLogger + size=16 align=8 + base size=16 base align=8 +QOpenGLDebugLogger (0x0x7319a8837e38) 0 + vptr=((& QOpenGLDebugLogger::_ZTV18QOpenGLDebugLogger) + 16) +QObject (0x0x7319a8898360) 0 + primary-for QOpenGLDebugLogger (0x0x7319a8837e38) + +Vtable for QOpenGLFramebufferObject +QOpenGLFramebufferObject::_ZTV24QOpenGLFramebufferObject: 4 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI24QOpenGLFramebufferObject) +16 (int (*)(...))QOpenGLFramebufferObject::~QOpenGLFramebufferObject +24 (int (*)(...))QOpenGLFramebufferObject::~QOpenGLFramebufferObject + +Class QOpenGLFramebufferObject + size=16 align=8 + base size=16 base align=8 +QOpenGLFramebufferObject (0x0x7319a88ce180) 0 + vptr=((& QOpenGLFramebufferObject::_ZTV24QOpenGLFramebufferObject) + 16) + +Class QOpenGLFramebufferObjectFormat + size=8 align=8 + base size=8 base align=8 +QOpenGLFramebufferObjectFormat (0x0x7319a88ce420) 0 + +Vtable for QOpenGLPaintDevice +QOpenGLPaintDevice::_ZTV18QOpenGLPaintDevice: 11 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QOpenGLPaintDevice) +16 (int (*)(...))QOpenGLPaintDevice::~QOpenGLPaintDevice +24 (int (*)(...))QOpenGLPaintDevice::~QOpenGLPaintDevice +32 (int (*)(...))QOpenGLPaintDevice::devType +40 (int (*)(...))QOpenGLPaintDevice::paintEngine +48 (int (*)(...))QOpenGLPaintDevice::metric +56 (int (*)(...))QPaintDevice::initPainter +64 (int (*)(...))QPaintDevice::redirected +72 (int (*)(...))QPaintDevice::sharedPainter +80 (int (*)(...))QOpenGLPaintDevice::ensureActiveTarget + +Class QOpenGLPaintDevice + size=24 align=8 + base size=24 base align=8 +QOpenGLPaintDevice (0x0x7319a88ca4e0) 0 + vptr=((& QOpenGLPaintDevice::_ZTV18QOpenGLPaintDevice) + 16) +QPaintDevice (0x0x7319a88ce480) 0 + primary-for QOpenGLPaintDevice (0x0x7319a88ca4e0) + +Class QOpenGLPixelTransferOptions + size=8 align=8 + base size=8 base align=8 +QOpenGLPixelTransferOptions (0x0x7319a88ce6c0) 0 + +Class QOpenGLShader::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QOpenGLShader::QPrivateSignal (0x0x7319a8956a20) 0 empty + +Vtable for QOpenGLShader +QOpenGLShader::_ZTV13QOpenGLShader: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QOpenGLShader) +16 (int (*)(...))QOpenGLShader::metaObject +24 (int (*)(...))QOpenGLShader::qt_metacast +32 (int (*)(...))QOpenGLShader::qt_metacall +40 (int (*)(...))QOpenGLShader::~QOpenGLShader +48 (int (*)(...))QOpenGLShader::~QOpenGLShader +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QOpenGLShader + size=16 align=8 + base size=16 base align=8 +QOpenGLShader (0x0x7319a8955c30) 0 + vptr=((& QOpenGLShader::_ZTV13QOpenGLShader) + 16) +QObject (0x0x7319a89569c0) 0 + primary-for QOpenGLShader (0x0x7319a8955c30) + +Class QOpenGLShaderProgram::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QOpenGLShaderProgram::QPrivateSignal (0x0x7319a8990180) 0 empty + +Vtable for QOpenGLShaderProgram +QOpenGLShaderProgram::_ZTV20QOpenGLShaderProgram: 15 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QOpenGLShaderProgram) +16 (int (*)(...))QOpenGLShaderProgram::metaObject +24 (int (*)(...))QOpenGLShaderProgram::qt_metacast +32 (int (*)(...))QOpenGLShaderProgram::qt_metacall +40 (int (*)(...))QOpenGLShaderProgram::~QOpenGLShaderProgram +48 (int (*)(...))QOpenGLShaderProgram::~QOpenGLShaderProgram +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QOpenGLShaderProgram::link + +Class QOpenGLShaderProgram + size=16 align=8 + base size=16 base align=8 +QOpenGLShaderProgram (0x0x7319a8955f08) 0 + vptr=((& QOpenGLShaderProgram::_ZTV20QOpenGLShaderProgram) + 16) +QObject (0x0x7319a8990120) 0 + primary-for QOpenGLShaderProgram (0x0x7319a8955f08) + +Class QOpenGLTexture + size=8 align=8 + base size=8 base align=8 +QOpenGLTexture (0x0x7319a8990300) 0 + +Class QOpenGLTextureBlitter + size=8 align=8 + base size=8 base align=8 +QOpenGLTextureBlitter (0x0x7319a8621660) 0 + +Class QOpenGLTimerQuery::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QOpenGLTimerQuery::QPrivateSignal (0x0x7319a86218a0) 0 empty + +Vtable for QOpenGLTimerQuery +QOpenGLTimerQuery::_ZTV17QOpenGLTimerQuery: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QOpenGLTimerQuery) +16 (int (*)(...))QOpenGLTimerQuery::metaObject +24 (int (*)(...))QOpenGLTimerQuery::qt_metacast +32 (int (*)(...))QOpenGLTimerQuery::qt_metacall +40 (int (*)(...))QOpenGLTimerQuery::~QOpenGLTimerQuery +48 (int (*)(...))QOpenGLTimerQuery::~QOpenGLTimerQuery +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QOpenGLTimerQuery + size=16 align=8 + base size=16 base align=8 +QOpenGLTimerQuery (0x0x7319a8623208) 0 + vptr=((& QOpenGLTimerQuery::_ZTV17QOpenGLTimerQuery) + 16) +QObject (0x0x7319a8621840) 0 + primary-for QOpenGLTimerQuery (0x0x7319a8623208) + +Class QOpenGLTimeMonitor::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QOpenGLTimeMonitor::QPrivateSignal (0x0x7319a8621a80) 0 empty + +Vtable for QOpenGLTimeMonitor +QOpenGLTimeMonitor::_ZTV18QOpenGLTimeMonitor: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QOpenGLTimeMonitor) +16 (int (*)(...))QOpenGLTimeMonitor::metaObject +24 (int (*)(...))QOpenGLTimeMonitor::qt_metacast +32 (int (*)(...))QOpenGLTimeMonitor::qt_metacall +40 (int (*)(...))QOpenGLTimeMonitor::~QOpenGLTimeMonitor +48 (int (*)(...))QOpenGLTimeMonitor::~QOpenGLTimeMonitor +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QOpenGLTimeMonitor + size=16 align=8 + base size=16 base align=8 +QOpenGLTimeMonitor (0x0x7319a8623270) 0 + vptr=((& QOpenGLTimeMonitor::_ZTV18QOpenGLTimeMonitor) + 16) +QObject (0x0x7319a8621a20) 0 + primary-for QOpenGLTimeMonitor (0x0x7319a8623270) + +Class QOpenGLVersionStatus + size=12 align=4 + base size=12 base align=4 +QOpenGLVersionStatus (0x0x7319a8621c00) 0 + +Class QOpenGLVersionFunctionsBackend + size=16 align=8 + base size=12 base align=8 +QOpenGLVersionFunctionsBackend (0x0x7319a86dfc00) 0 + +Class QOpenGLVersionFunctionsStorage + size=8 align=8 + base size=8 base align=8 +QOpenGLVersionFunctionsStorage (0x0x7319a86dfde0) 0 + +Class QAbstractOpenGLFunctionsPrivate + size=16 align=8 + base size=9 base align=8 +QAbstractOpenGLFunctionsPrivate (0x0x7319a86dfe40) 0 + +Vtable for QAbstractOpenGLFunctions +QAbstractOpenGLFunctions::_ZTV24QAbstractOpenGLFunctions: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI24QAbstractOpenGLFunctions) +16 (int (*)(...))QAbstractOpenGLFunctions::~QAbstractOpenGLFunctions +24 (int (*)(...))QAbstractOpenGLFunctions::~QAbstractOpenGLFunctions +32 (int (*)(...))QAbstractOpenGLFunctions::initializeOpenGLFunctions + +Class QAbstractOpenGLFunctions + size=16 align=8 + base size=16 base align=8 +QAbstractOpenGLFunctions (0x0x7319a86f7060) 0 + vptr=((& QAbstractOpenGLFunctions::_ZTV24QAbstractOpenGLFunctions) + 16) + +Class QOpenGLFunctions_1_0_CoreBackend::Functions + size=384 align=8 + base size=384 base align=8 +QOpenGLFunctions_1_0_CoreBackend::Functions (0x0x7319a86f7240) 0 + +Class QOpenGLFunctions_1_0_CoreBackend + size=400 align=8 + base size=400 base align=8 +QOpenGLFunctions_1_0_CoreBackend (0x0x7319a86dba28) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a86f71e0) 0 + +Class QOpenGLFunctions_1_1_CoreBackend::Functions + size=128 align=8 + base size=128 base align=8 +QOpenGLFunctions_1_1_CoreBackend::Functions (0x0x7319a86f75a0) 0 + +Class QOpenGLFunctions_1_1_CoreBackend + size=144 align=8 + base size=144 base align=8 +QOpenGLFunctions_1_1_CoreBackend (0x0x7319a86dba90) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a86f7540) 0 + +Class QOpenGLFunctions_1_2_CoreBackend::Functions + size=48 align=8 + base size=48 base align=8 +QOpenGLFunctions_1_2_CoreBackend::Functions (0x0x7319a86f7900) 0 + +Class QOpenGLFunctions_1_2_CoreBackend + size=64 align=8 + base size=64 base align=8 +QOpenGLFunctions_1_2_CoreBackend (0x0x7319a86dbaf8) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a86f78a0) 0 + +Class QOpenGLFunctions_1_3_CoreBackend::Functions + size=72 align=8 + base size=72 base align=8 +QOpenGLFunctions_1_3_CoreBackend::Functions (0x0x7319a86f7c60) 0 + +Class QOpenGLFunctions_1_3_CoreBackend + size=88 align=8 + base size=88 base align=8 +QOpenGLFunctions_1_3_CoreBackend (0x0x7319a86dbb60) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a86f7c00) 0 + +Class QOpenGLFunctions_1_4_CoreBackend::Functions + size=56 align=8 + base size=56 base align=8 +QOpenGLFunctions_1_4_CoreBackend::Functions (0x0x7319a871b000) 0 + +Class QOpenGLFunctions_1_4_CoreBackend + size=72 align=8 + base size=72 base align=8 +QOpenGLFunctions_1_4_CoreBackend (0x0x7319a86dbbc8) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a86f7f60) 0 + +Class QOpenGLFunctions_1_5_CoreBackend::Functions + size=152 align=8 + base size=152 base align=8 +QOpenGLFunctions_1_5_CoreBackend::Functions (0x0x7319a871b360) 0 + +Class QOpenGLFunctions_1_5_CoreBackend + size=168 align=8 + base size=168 base align=8 +QOpenGLFunctions_1_5_CoreBackend (0x0x7319a86dbc30) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a871b300) 0 + +Class QOpenGLFunctions_2_0_CoreBackend::Functions + size=744 align=8 + base size=744 base align=8 +QOpenGLFunctions_2_0_CoreBackend::Functions (0x0x7319a871b6c0) 0 + +Class QOpenGLFunctions_2_0_CoreBackend + size=760 align=8 + base size=760 base align=8 +QOpenGLFunctions_2_0_CoreBackend (0x0x7319a86dbc98) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a871b660) 0 + +Class QOpenGLFunctions_2_1_CoreBackend::Functions + size=48 align=8 + base size=48 base align=8 +QOpenGLFunctions_2_1_CoreBackend::Functions (0x0x7319a871ba20) 0 + +Class QOpenGLFunctions_2_1_CoreBackend + size=64 align=8 + base size=64 base align=8 +QOpenGLFunctions_2_1_CoreBackend (0x0x7319a86dbd00) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a871b9c0) 0 + +Class QOpenGLFunctions_3_0_CoreBackend::Functions + size=672 align=8 + base size=672 base align=8 +QOpenGLFunctions_3_0_CoreBackend::Functions (0x0x7319a871bd80) 0 + +Class QOpenGLFunctions_3_0_CoreBackend + size=688 align=8 + base size=688 base align=8 +QOpenGLFunctions_3_0_CoreBackend (0x0x7319a86dbd68) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a871bd20) 0 + +Class QOpenGLFunctions_3_1_CoreBackend::Functions + size=96 align=8 + base size=96 base align=8 +QOpenGLFunctions_3_1_CoreBackend::Functions (0x0x7319a8753120) 0 + +Class QOpenGLFunctions_3_1_CoreBackend + size=112 align=8 + base size=112 base align=8 +QOpenGLFunctions_3_1_CoreBackend (0x0x7319a86dbdd0) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a87530c0) 0 + +Class QOpenGLFunctions_3_2_CoreBackend::Functions + size=152 align=8 + base size=152 base align=8 +QOpenGLFunctions_3_2_CoreBackend::Functions (0x0x7319a8753480) 0 + +Class QOpenGLFunctions_3_2_CoreBackend + size=168 align=8 + base size=168 base align=8 +QOpenGLFunctions_3_2_CoreBackend (0x0x7319a86dbe38) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a8753420) 0 + +Class QOpenGLFunctions_3_3_CoreBackend::Functions + size=464 align=8 + base size=464 base align=8 +QOpenGLFunctions_3_3_CoreBackend::Functions (0x0x7319a87537e0) 0 + +Class QOpenGLFunctions_3_3_CoreBackend + size=480 align=8 + base size=480 base align=8 +QOpenGLFunctions_3_3_CoreBackend (0x0x7319a86dbea0) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a8753780) 0 + +Class QOpenGLFunctions_4_0_CoreBackend::Functions + size=368 align=8 + base size=368 base align=8 +QOpenGLFunctions_4_0_CoreBackend::Functions (0x0x7319a8753b40) 0 + +Class QOpenGLFunctions_4_0_CoreBackend + size=384 align=8 + base size=384 base align=8 +QOpenGLFunctions_4_0_CoreBackend (0x0x7319a86dbf08) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a8753ae0) 0 + +Class QOpenGLFunctions_4_1_CoreBackend::Functions + size=704 align=8 + base size=704 base align=8 +QOpenGLFunctions_4_1_CoreBackend::Functions (0x0x7319a8753ea0) 0 + +Class QOpenGLFunctions_4_1_CoreBackend + size=720 align=8 + base size=720 base align=8 +QOpenGLFunctions_4_1_CoreBackend (0x0x7319a86dbf70) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a8753e40) 0 + +Class QOpenGLFunctions_4_2_CoreBackend::Functions + size=96 align=8 + base size=96 base align=8 +QOpenGLFunctions_4_2_CoreBackend::Functions (0x0x7319a878e240) 0 + +Class QOpenGLFunctions_4_2_CoreBackend + size=112 align=8 + base size=112 base align=8 +QOpenGLFunctions_4_2_CoreBackend (0x0x7319a878f000) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a878e1e0) 0 + +Class QOpenGLFunctions_4_3_CoreBackend::Functions + size=344 align=8 + base size=344 base align=8 +QOpenGLFunctions_4_3_CoreBackend::Functions (0x0x7319a878e5a0) 0 + +Class QOpenGLFunctions_4_3_CoreBackend + size=360 align=8 + base size=360 base align=8 +QOpenGLFunctions_4_3_CoreBackend (0x0x7319a878f068) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a878e540) 0 + +Class QOpenGLFunctions_4_4_CoreBackend::Functions + size=72 align=8 + base size=72 base align=8 +QOpenGLFunctions_4_4_CoreBackend::Functions (0x0x7319a878e900) 0 + +Class QOpenGLFunctions_4_4_CoreBackend + size=88 align=8 + base size=88 base align=8 +QOpenGLFunctions_4_4_CoreBackend (0x0x7319a878f0d0) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a878e8a0) 0 + +Class QOpenGLFunctions_4_5_CoreBackend::Functions + size=848 align=8 + base size=848 base align=8 +QOpenGLFunctions_4_5_CoreBackend::Functions (0x0x7319a878ec60) 0 + +Class QOpenGLFunctions_4_5_CoreBackend + size=864 align=8 + base size=864 base align=8 +QOpenGLFunctions_4_5_CoreBackend (0x0x7319a878f138) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a878ec00) 0 + +Class QOpenGLFunctions_1_0_DeprecatedBackend::Functions + size=2064 align=8 + base size=2064 base align=8 +QOpenGLFunctions_1_0_DeprecatedBackend::Functions (0x0x7319a87c4000) 0 + +Class QOpenGLFunctions_1_0_DeprecatedBackend + size=2080 align=8 + base size=2080 base align=8 +QOpenGLFunctions_1_0_DeprecatedBackend (0x0x7319a878f1a0) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a878ef60) 0 + +Class QOpenGLFunctions_1_1_DeprecatedBackend::Functions + size=136 align=8 + base size=136 base align=8 +QOpenGLFunctions_1_1_DeprecatedBackend::Functions (0x0x7319a87c4360) 0 + +Class QOpenGLFunctions_1_1_DeprecatedBackend + size=152 align=8 + base size=152 base align=8 +QOpenGLFunctions_1_1_DeprecatedBackend (0x0x7319a878f208) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a87c4300) 0 + +Class QOpenGLFunctions_1_2_DeprecatedBackend::Functions + size=256 align=8 + base size=256 base align=8 +QOpenGLFunctions_1_2_DeprecatedBackend::Functions (0x0x7319a87c46c0) 0 + +Class QOpenGLFunctions_1_2_DeprecatedBackend + size=272 align=8 + base size=272 base align=8 +QOpenGLFunctions_1_2_DeprecatedBackend (0x0x7319a878f270) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a87c4660) 0 + +Class QOpenGLFunctions_1_3_DeprecatedBackend::Functions + size=296 align=8 + base size=296 base align=8 +QOpenGLFunctions_1_3_DeprecatedBackend::Functions (0x0x7319a87c4a20) 0 + +Class QOpenGLFunctions_1_3_DeprecatedBackend + size=312 align=8 + base size=312 base align=8 +QOpenGLFunctions_1_3_DeprecatedBackend (0x0x7319a878f2d8) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a87c49c0) 0 + +Class QOpenGLFunctions_1_4_DeprecatedBackend::Functions + size=304 align=8 + base size=304 base align=8 +QOpenGLFunctions_1_4_DeprecatedBackend::Functions (0x0x7319a87c4d80) 0 + +Class QOpenGLFunctions_1_4_DeprecatedBackend + size=320 align=8 + base size=320 base align=8 +QOpenGLFunctions_1_4_DeprecatedBackend (0x0x7319a878f340) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a87c4d20) 0 + +Class QOpenGLFunctions_2_0_DeprecatedBackend::Functions + size=288 align=8 + base size=288 base align=8 +QOpenGLFunctions_2_0_DeprecatedBackend::Functions (0x0x7319a8411120) 0 + +Class QOpenGLFunctions_2_0_DeprecatedBackend + size=304 align=8 + base size=304 base align=8 +QOpenGLFunctions_2_0_DeprecatedBackend (0x0x7319a878f3a8) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a84110c0) 0 + +Class QOpenGLFunctions_3_0_DeprecatedBackend::Functions + size=160 align=8 + base size=160 base align=8 +QOpenGLFunctions_3_0_DeprecatedBackend::Functions (0x0x7319a8411480) 0 + +Class QOpenGLFunctions_3_0_DeprecatedBackend + size=176 align=8 + base size=176 base align=8 +QOpenGLFunctions_3_0_DeprecatedBackend (0x0x7319a878f410) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a8411420) 0 + +Class QOpenGLFunctions_3_3_DeprecatedBackend::Functions + size=240 align=8 + base size=240 base align=8 +QOpenGLFunctions_3_3_DeprecatedBackend::Functions (0x0x7319a84117e0) 0 + +Class QOpenGLFunctions_3_3_DeprecatedBackend + size=256 align=8 + base size=256 base align=8 +QOpenGLFunctions_3_3_DeprecatedBackend (0x0x7319a878f478) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a8411780) 0 + +Class QOpenGLFunctions_4_5_DeprecatedBackend::Functions + size=96 align=8 + base size=96 base align=8 +QOpenGLFunctions_4_5_DeprecatedBackend::Functions (0x0x7319a8411b40) 0 + +Class QOpenGLFunctions_4_5_DeprecatedBackend + size=112 align=8 + base size=112 base align=8 +QOpenGLFunctions_4_5_DeprecatedBackend (0x0x7319a878f4e0) 0 +QOpenGLVersionFunctionsBackend (0x0x7319a8411ae0) 0 + +Class QOpenGLVersionProfile + size=8 align=8 + base size=8 base align=8 +QOpenGLVersionProfile (0x0x7319a8411e40) 0 + +Class QOpenGLVersionFunctionsFactory + size=1 align=1 + base size=0 base align=1 +QOpenGLVersionFunctionsFactory (0x0x7319a8438000) 0 empty + +Class QOpenGLVertexArrayObject::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QOpenGLVertexArrayObject::QPrivateSignal (0x0x7319a8438120) 0 empty + +Class QOpenGLVertexArrayObject::Binder + size=8 align=8 + base size=8 base align=8 +QOpenGLVertexArrayObject::Binder (0x0x7319a8438180) 0 + +Vtable for QOpenGLVertexArrayObject +QOpenGLVertexArrayObject::_ZTV24QOpenGLVertexArrayObject: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI24QOpenGLVertexArrayObject) +16 (int (*)(...))QOpenGLVertexArrayObject::metaObject +24 (int (*)(...))QOpenGLVertexArrayObject::qt_metacast +32 (int (*)(...))QOpenGLVertexArrayObject::qt_metacall +40 (int (*)(...))QOpenGLVertexArrayObject::~QOpenGLVertexArrayObject +48 (int (*)(...))QOpenGLVertexArrayObject::~QOpenGLVertexArrayObject +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QOpenGLVertexArrayObject + size=16 align=8 + base size=16 base align=8 +QOpenGLVertexArrayObject (0x0x7319a878f548) 0 + vptr=((& QOpenGLVertexArrayObject::_ZTV24QOpenGLVertexArrayObject) + 16) +QObject (0x0x7319a84380c0) 0 + primary-for QOpenGLVertexArrayObject (0x0x7319a878f548) + +Class QOpenGLWindow::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QOpenGLWindow::QPrivateSignal (0x0x7319a84387e0) 0 empty + +Vtable for QOpenGLWindow +QOpenGLWindow::_ZTV13QOpenGLWindow: 65 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QOpenGLWindow) +16 (int (*)(...))QOpenGLWindow::metaObject +24 (int (*)(...))QOpenGLWindow::qt_metacast +32 (int (*)(...))QOpenGLWindow::qt_metacall +40 (int (*)(...))QOpenGLWindow::~QOpenGLWindow +48 (int (*)(...))QOpenGLWindow::~QOpenGLWindow +56 (int (*)(...))QPaintDeviceWindow::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWindow::surfaceType +120 (int (*)(...))QWindow::format +128 (int (*)(...))QWindow::size +136 (int (*)(...))QWindow::accessibleRoot +144 (int (*)(...))QWindow::focusObject +152 (int (*)(...))QPaintDeviceWindow::exposeEvent +160 (int (*)(...))QOpenGLWindow::resizeEvent +168 (int (*)(...))QOpenGLWindow::paintEvent +176 (int (*)(...))QWindow::moveEvent +184 (int (*)(...))QWindow::focusInEvent +192 (int (*)(...))QWindow::focusOutEvent +200 (int (*)(...))QWindow::showEvent +208 (int (*)(...))QWindow::hideEvent +216 (int (*)(...))QWindow::closeEvent +224 (int (*)(...))QWindow::keyPressEvent +232 (int (*)(...))QWindow::keyReleaseEvent +240 (int (*)(...))QWindow::mousePressEvent +248 (int (*)(...))QWindow::mouseReleaseEvent +256 (int (*)(...))QWindow::mouseDoubleClickEvent +264 (int (*)(...))QWindow::mouseMoveEvent +272 (int (*)(...))QWindow::wheelEvent +280 (int (*)(...))QWindow::touchEvent +288 (int (*)(...))QWindow::tabletEvent +296 (int (*)(...))QWindow::nativeEvent +304 (int (*)(...))QWindow::surfaceHandle +312 (int (*)(...))QOpenGLWindow::metric +320 (int (*)(...))QPaintDeviceWindow::paintEngine +328 (int (*)(...))QOpenGLWindow::initializeGL +336 (int (*)(...))QOpenGLWindow::resizeGL +344 (int (*)(...))QOpenGLWindow::paintGL +352 (int (*)(...))QOpenGLWindow::paintUnderGL +360 (int (*)(...))QOpenGLWindow::paintOverGL +368 (int (*)(...))QOpenGLWindow::redirected +376 (int (*)(...))-16 +384 (int (*)(...))(& _ZTI13QOpenGLWindow) +392 (int (*)(...))QOpenGLWindow::_ZThn16_N13QOpenGLWindowD1Ev +400 (int (*)(...))QOpenGLWindow::_ZThn16_N13QOpenGLWindowD0Ev +408 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv +416 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv +424 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv +432 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv +440 (int (*)(...))-40 +448 (int (*)(...))(& _ZTI13QOpenGLWindow) +456 (int (*)(...))QOpenGLWindow::_ZThn40_N13QOpenGLWindowD1Ev +464 (int (*)(...))QOpenGLWindow::_ZThn40_N13QOpenGLWindowD0Ev +472 (int (*)(...))QPaintDevice::devType +480 (int (*)(...))QPaintDeviceWindow::_ZThn40_NK18QPaintDeviceWindow11paintEngineEv +488 (int (*)(...))QOpenGLWindow::_ZThn40_NK13QOpenGLWindow6metricEN12QPaintDevice17PaintDeviceMetricE +496 (int (*)(...))QPaintDevice::initPainter +504 (int (*)(...))QOpenGLWindow::_ZThn40_NK13QOpenGLWindow10redirectedEP6QPoint +512 (int (*)(...))QPaintDevice::sharedPainter + +Class QOpenGLWindow + size=56 align=8 + base size=50 base align=8 +QOpenGLWindow (0x0x7319a878f5b0) 0 + vptr=((& QOpenGLWindow::_ZTV13QOpenGLWindow) + 16) +QPaintDeviceWindow (0x0x7319a8421cb0) 0 + primary-for QOpenGLWindow (0x0x7319a878f5b0) +QWindow (0x0x7319a8421d20) 0 + primary-for QPaintDeviceWindow (0x0x7319a8421cb0) +QObject (0x0x7319a84386c0) 0 + primary-for QWindow (0x0x7319a8421d20) +QSurface (0x0x7319a8438720) 16 + vptr=((& QOpenGLWindow::_ZTV13QOpenGLWindow) + 392) +QPaintDevice (0x0x7319a8438780) 40 + vptr=((& QOpenGLWindow::_ZTV13QOpenGLWindow) + 456) + +Class QOpenGLWidget::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QOpenGLWidget::QPrivateSignal (0x0x7319a8438a20) 0 empty + +Vtable for QOpenGLWidget +QOpenGLWidget::_ZTV13QOpenGLWidget: 67 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QOpenGLWidget) +16 (int (*)(...))QOpenGLWidget::metaObject +24 (int (*)(...))QOpenGLWidget::qt_metacast +32 (int (*)(...))QOpenGLWidget::qt_metacall +40 (int (*)(...))QOpenGLWidget::~QOpenGLWidget +48 (int (*)(...))QOpenGLWidget::~QOpenGLWidget +56 (int (*)(...))QOpenGLWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QOpenGLWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QOpenGLWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QOpenGLWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QOpenGLWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QOpenGLWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QOpenGLWidget::initializeGL +440 (int (*)(...))QOpenGLWidget::resizeGL +448 (int (*)(...))QOpenGLWidget::paintGL +456 (int (*)(...))-16 +464 (int (*)(...))(& _ZTI13QOpenGLWidget) +472 (int (*)(...))QOpenGLWidget::_ZThn16_N13QOpenGLWidgetD1Ev +480 (int (*)(...))QOpenGLWidget::_ZThn16_N13QOpenGLWidgetD0Ev +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +496 (int (*)(...))QOpenGLWidget::_ZThn16_NK13QOpenGLWidget11paintEngineEv +504 (int (*)(...))QOpenGLWidget::_ZThn16_NK13QOpenGLWidget6metricEN12QPaintDevice17PaintDeviceMetricE +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +520 (int (*)(...))QOpenGLWidget::_ZThn16_NK13QOpenGLWidget10redirectedEP6QPoint +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QOpenGLWidget + size=40 align=8 + base size=40 base align=8 +QOpenGLWidget (0x0x7319a878f680) 0 + vptr=((& QOpenGLWidget::_ZTV13QOpenGLWidget) + 16) +QWidget (0x0x7319a8456070) 0 + primary-for QOpenGLWidget (0x0x7319a878f680) +QObject (0x0x7319a8438960) 0 + primary-for QWidget (0x0x7319a8456070) +QPaintDevice (0x0x7319a84389c0) 16 + vptr=((& QOpenGLWidget::_ZTV13QOpenGLWidget) + 472) + +Class QDesignerActionEditorInterface::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDesignerActionEditorInterface::QPrivateSignal (0x0x7319a8438de0) 0 empty + +Vtable for QDesignerActionEditorInterface +QDesignerActionEditorInterface::_ZTV30QDesignerActionEditorInterface: 68 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI30QDesignerActionEditorInterface) +16 (int (*)(...))QDesignerActionEditorInterface::metaObject +24 (int (*)(...))QDesignerActionEditorInterface::qt_metacast +32 (int (*)(...))QDesignerActionEditorInterface::qt_metacall +40 0 +48 0 +56 (int (*)(...))QWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDesignerActionEditorInterface::core +440 (int (*)(...))__cxa_pure_virtual +448 (int (*)(...))__cxa_pure_virtual +456 (int (*)(...))__cxa_pure_virtual +464 (int (*)(...))-16 +472 (int (*)(...))(& _ZTI30QDesignerActionEditorInterface) +480 0 +488 0 +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QDesignerActionEditorInterface + size=40 align=8 + base size=40 base align=8 +QDesignerActionEditorInterface (0x0x7319a878f750) 0 + vptr=((& QDesignerActionEditorInterface::_ZTV30QDesignerActionEditorInterface) + 16) +QWidget (0x0x7319a84565b0) 0 + primary-for QDesignerActionEditorInterface (0x0x7319a878f750) +QObject (0x0x7319a8438d20) 0 + primary-for QWidget (0x0x7319a84565b0) +QPaintDevice (0x0x7319a8438d80) 16 + vptr=((& QDesignerActionEditorInterface::_ZTV30QDesignerActionEditorInterface) + 480) + +Vtable for QDesignerDnDItemInterface +QDesignerDnDItemInterface::_ZTV25QDesignerDnDItemInterface: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI25QDesignerDnDItemInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual + +Class QDesignerDnDItemInterface + size=8 align=8 + base size=8 base align=8 +QDesignerDnDItemInterface (0x0x7319a8438ea0) 0 nearly-empty + vptr=((& QDesignerDnDItemInterface::_ZTV25QDesignerDnDItemInterface) + 16) + +Vtable for QAbstractFormBuilder +QAbstractFormBuilder::_ZTV20QAbstractFormBuilder: 42 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QAbstractFormBuilder) +16 (int (*)(...))QAbstractFormBuilder::~QAbstractFormBuilder +24 (int (*)(...))QAbstractFormBuilder::~QAbstractFormBuilder +32 (int (*)(...))QAbstractFormBuilder::load +40 (int (*)(...))QAbstractFormBuilder::save +48 (int (*)(...))QAbstractFormBuilder::loadExtraInfo +56 (int (*)(...))QAbstractFormBuilder::create +64 (int (*)(...))QAbstractFormBuilder::create +72 (int (*)(...))QAbstractFormBuilder::create +80 (int (*)(...))QAbstractFormBuilder::create +88 (int (*)(...))QAbstractFormBuilder::create +96 (int (*)(...))QAbstractFormBuilder::create +104 (int (*)(...))QAbstractFormBuilder::addMenuAction +112 (int (*)(...))QAbstractFormBuilder::applyProperties +120 (int (*)(...))QAbstractFormBuilder::applyTabStops +128 (int (*)(...))QAbstractFormBuilder::createWidget +136 (int (*)(...))QAbstractFormBuilder::createLayout +144 (int (*)(...))QAbstractFormBuilder::createAction +152 (int (*)(...))QAbstractFormBuilder::createActionGroup +160 (int (*)(...))QAbstractFormBuilder::createCustomWidgets +168 (int (*)(...))QAbstractFormBuilder::createConnections +176 (int (*)(...))QAbstractFormBuilder::createResources +184 (int (*)(...))QAbstractFormBuilder::addItem +192 (int (*)(...))QAbstractFormBuilder::addItem +200 (int (*)(...))QAbstractFormBuilder::saveExtraInfo +208 (int (*)(...))QAbstractFormBuilder::saveDom +216 (int (*)(...))QAbstractFormBuilder::createActionRefDom +224 (int (*)(...))QAbstractFormBuilder::createDom +232 (int (*)(...))QAbstractFormBuilder::createDom +240 (int (*)(...))QAbstractFormBuilder::createDom +248 (int (*)(...))QAbstractFormBuilder::createDom +256 (int (*)(...))QAbstractFormBuilder::createDom +264 (int (*)(...))QAbstractFormBuilder::createDom +272 (int (*)(...))QAbstractFormBuilder::saveConnections +280 (int (*)(...))QAbstractFormBuilder::saveCustomWidgets +288 (int (*)(...))QAbstractFormBuilder::saveTabStops +296 (int (*)(...))QAbstractFormBuilder::saveResources +304 (int (*)(...))QAbstractFormBuilder::computeProperties +312 (int (*)(...))QAbstractFormBuilder::checkProperty +320 (int (*)(...))QAbstractFormBuilder::createProperty +328 (int (*)(...))QAbstractFormBuilder::layoutInfo + +Class QAbstractFormBuilder + size=16 align=8 + base size=16 base align=8 +QAbstractFormBuilder (0x0x7319a8438f00) 0 + vptr=((& QAbstractFormBuilder::_ZTV20QAbstractFormBuilder) + 16) + +Class QDesignerFormEditorInterface::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDesignerFormEditorInterface::QPrivateSignal (0x0x7319a84a2180) 0 empty + +Vtable for QDesignerFormEditorInterface +QDesignerFormEditorInterface::_ZTV28QDesignerFormEditorInterface: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI28QDesignerFormEditorInterface) +16 (int (*)(...))QDesignerFormEditorInterface::metaObject +24 (int (*)(...))QDesignerFormEditorInterface::qt_metacast +32 (int (*)(...))QDesignerFormEditorInterface::qt_metacall +40 (int (*)(...))QDesignerFormEditorInterface::~QDesignerFormEditorInterface +48 (int (*)(...))QDesignerFormEditorInterface::~QDesignerFormEditorInterface +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QDesignerFormEditorInterface + size=24 align=8 + base size=24 base align=8 +QDesignerFormEditorInterface (0x0x7319a878f7b8) 0 + vptr=((& QDesignerFormEditorInterface::_ZTV28QDesignerFormEditorInterface) + 16) +QObject (0x0x7319a84a2120) 0 + primary-for QDesignerFormEditorInterface (0x0x7319a878f7b8) + +Vtable for QDesignerFormEditorPluginInterface +QDesignerFormEditorPluginInterface::_ZTV34QDesignerFormEditorPluginInterface: 8 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI34QDesignerFormEditorPluginInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual + +Class QDesignerFormEditorPluginInterface + size=8 align=8 + base size=8 base align=8 +QDesignerFormEditorPluginInterface (0x0x7319a85978a0) 0 nearly-empty + vptr=((& QDesignerFormEditorPluginInterface::_ZTV34QDesignerFormEditorPluginInterface) + 16) + +Class QDesignerFormWindowInterface::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDesignerFormWindowInterface::QPrivateSignal (0x0x7319a8597d20) 0 empty + +Vtable for QDesignerFormWindowInterface +QDesignerFormWindowInterface::_ZTV28QDesignerFormWindowInterface: 121 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI28QDesignerFormWindowInterface) +16 (int (*)(...))QDesignerFormWindowInterface::metaObject +24 (int (*)(...))QDesignerFormWindowInterface::qt_metacast +32 (int (*)(...))QDesignerFormWindowInterface::qt_metacall +40 0 +48 0 +56 (int (*)(...))QWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))__cxa_pure_virtual +440 (int (*)(...))__cxa_pure_virtual +448 (int (*)(...))__cxa_pure_virtual +456 (int (*)(...))__cxa_pure_virtual +464 (int (*)(...))__cxa_pure_virtual +472 (int (*)(...))__cxa_pure_virtual +480 (int (*)(...))__cxa_pure_virtual +488 (int (*)(...))__cxa_pure_virtual +496 (int (*)(...))__cxa_pure_virtual +504 (int (*)(...))__cxa_pure_virtual +512 (int (*)(...))__cxa_pure_virtual +520 (int (*)(...))__cxa_pure_virtual +528 (int (*)(...))__cxa_pure_virtual +536 (int (*)(...))__cxa_pure_virtual +544 (int (*)(...))__cxa_pure_virtual +552 (int (*)(...))__cxa_pure_virtual +560 (int (*)(...))__cxa_pure_virtual +568 (int (*)(...))__cxa_pure_virtual +576 (int (*)(...))__cxa_pure_virtual +584 (int (*)(...))__cxa_pure_virtual +592 (int (*)(...))__cxa_pure_virtual +600 (int (*)(...))__cxa_pure_virtual +608 (int (*)(...))__cxa_pure_virtual +616 (int (*)(...))__cxa_pure_virtual +624 (int (*)(...))__cxa_pure_virtual +632 (int (*)(...))QDesignerFormWindowInterface::core +640 (int (*)(...))__cxa_pure_virtual +648 (int (*)(...))__cxa_pure_virtual +656 (int (*)(...))__cxa_pure_virtual +664 (int (*)(...))__cxa_pure_virtual +672 (int (*)(...))__cxa_pure_virtual +680 (int (*)(...))__cxa_pure_virtual +688 (int (*)(...))__cxa_pure_virtual +696 (int (*)(...))__cxa_pure_virtual +704 (int (*)(...))__cxa_pure_virtual +712 (int (*)(...))__cxa_pure_virtual +720 (int (*)(...))__cxa_pure_virtual +728 (int (*)(...))__cxa_pure_virtual +736 (int (*)(...))__cxa_pure_virtual +744 (int (*)(...))__cxa_pure_virtual +752 (int (*)(...))__cxa_pure_virtual +760 (int (*)(...))__cxa_pure_virtual +768 (int (*)(...))__cxa_pure_virtual +776 (int (*)(...))__cxa_pure_virtual +784 (int (*)(...))__cxa_pure_virtual +792 (int (*)(...))__cxa_pure_virtual +800 (int (*)(...))__cxa_pure_virtual +808 (int (*)(...))__cxa_pure_virtual +816 (int (*)(...))__cxa_pure_virtual +824 (int (*)(...))__cxa_pure_virtual +832 (int (*)(...))__cxa_pure_virtual +840 (int (*)(...))__cxa_pure_virtual +848 (int (*)(...))__cxa_pure_virtual +856 (int (*)(...))__cxa_pure_virtual +864 (int (*)(...))__cxa_pure_virtual +872 (int (*)(...))__cxa_pure_virtual +880 (int (*)(...))__cxa_pure_virtual +888 (int (*)(...))-16 +896 (int (*)(...))(& _ZTI28QDesignerFormWindowInterface) +904 0 +912 0 +920 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +928 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +936 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +944 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +952 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +960 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QDesignerFormWindowInterface + size=40 align=8 + base size=40 base align=8 +QDesignerFormWindowInterface (0x0x7319a85a0410) 0 + vptr=((& QDesignerFormWindowInterface::_ZTV28QDesignerFormWindowInterface) + 16) +QWidget (0x0x7319a8542f50) 0 + primary-for QDesignerFormWindowInterface (0x0x7319a85a0410) +QObject (0x0x7319a8597c60) 0 + primary-for QWidget (0x0x7319a8542f50) +QPaintDevice (0x0x7319a8597cc0) 16 + vptr=((& QDesignerFormWindowInterface::_ZTV28QDesignerFormWindowInterface) + 904) + +Vtable for QDesignerFormWindowCursorInterface +QDesignerFormWindowCursorInterface::_ZTV34QDesignerFormWindowCursorInterface: 17 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI34QDesignerFormWindowCursorInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))__cxa_pure_virtual +96 (int (*)(...))__cxa_pure_virtual +104 (int (*)(...))__cxa_pure_virtual +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual + +Class QDesignerFormWindowCursorInterface + size=8 align=8 + base size=8 base align=8 +QDesignerFormWindowCursorInterface (0x0x7319a8597ea0) 0 nearly-empty + vptr=((& QDesignerFormWindowCursorInterface::_ZTV34QDesignerFormWindowCursorInterface) + 16) + +Class QDesignerFormWindowManagerInterface::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDesignerFormWindowManagerInterface::QPrivateSignal (0x0x7319a8597f60) 0 empty + +Vtable for QDesignerFormWindowManagerInterface +QDesignerFormWindowManagerInterface::_ZTV35QDesignerFormWindowManagerInterface: 29 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI35QDesignerFormWindowManagerInterface) +16 (int (*)(...))QDesignerFormWindowManagerInterface::metaObject +24 (int (*)(...))QDesignerFormWindowManagerInterface::qt_metacast +32 (int (*)(...))QDesignerFormWindowManagerInterface::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))__cxa_pure_virtual +160 (int (*)(...))__cxa_pure_virtual +168 (int (*)(...))__cxa_pure_virtual +176 (int (*)(...))__cxa_pure_virtual +184 (int (*)(...))__cxa_pure_virtual +192 (int (*)(...))__cxa_pure_virtual +200 (int (*)(...))__cxa_pure_virtual +208 (int (*)(...))__cxa_pure_virtual +216 (int (*)(...))__cxa_pure_virtual +224 (int (*)(...))__cxa_pure_virtual + +Class QDesignerFormWindowManagerInterface + size=16 align=8 + base size=16 base align=8 +QDesignerFormWindowManagerInterface (0x0x7319a85a0478) 0 + vptr=((& QDesignerFormWindowManagerInterface::_ZTV35QDesignerFormWindowManagerInterface) + 16) +QObject (0x0x7319a8597f00) 0 + primary-for QDesignerFormWindowManagerInterface (0x0x7319a85a0478) + +Class QDesignerFormWindowToolInterface::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDesignerFormWindowToolInterface::QPrivateSignal (0x0x7319a85fe2a0) 0 empty + +Vtable for QDesignerFormWindowToolInterface +QDesignerFormWindowToolInterface::_ZTV32QDesignerFormWindowToolInterface: 23 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI32QDesignerFormWindowToolInterface) +16 (int (*)(...))QDesignerFormWindowToolInterface::metaObject +24 (int (*)(...))QDesignerFormWindowToolInterface::qt_metacast +32 (int (*)(...))QDesignerFormWindowToolInterface::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))__cxa_pure_virtual +160 (int (*)(...))QDesignerFormWindowToolInterface::saveToDom +168 (int (*)(...))QDesignerFormWindowToolInterface::loadFromDom +176 (int (*)(...))__cxa_pure_virtual + +Class QDesignerFormWindowToolInterface + size=16 align=8 + base size=16 base align=8 +QDesignerFormWindowToolInterface (0x0x7319a85a04e0) 0 + vptr=((& QDesignerFormWindowToolInterface::_ZTV32QDesignerFormWindowToolInterface) + 16) +QObject (0x0x7319a85fe240) 0 + primary-for QDesignerFormWindowToolInterface (0x0x7319a85a04e0) + +Class QDesignerIntegrationInterface::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDesignerIntegrationInterface::QPrivateSignal (0x0x7319a85fe480) 0 empty + +Vtable for QDesignerIntegrationInterface +QDesignerIntegrationInterface::_ZTV29QDesignerIntegrationInterface: 34 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI29QDesignerIntegrationInterface) +16 (int (*)(...))QDesignerIntegrationInterface::metaObject +24 (int (*)(...))QDesignerIntegrationInterface::qt_metacast +32 (int (*)(...))QDesignerIntegrationInterface::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))__cxa_pure_virtual +160 (int (*)(...))__cxa_pure_virtual +168 (int (*)(...))__cxa_pure_virtual +176 (int (*)(...))__cxa_pure_virtual +184 (int (*)(...))__cxa_pure_virtual +192 (int (*)(...))__cxa_pure_virtual +200 (int (*)(...))__cxa_pure_virtual +208 (int (*)(...))__cxa_pure_virtual +216 (int (*)(...))__cxa_pure_virtual +224 (int (*)(...))__cxa_pure_virtual +232 (int (*)(...))__cxa_pure_virtual +240 (int (*)(...))__cxa_pure_virtual +248 (int (*)(...))__cxa_pure_virtual +256 (int (*)(...))__cxa_pure_virtual +264 (int (*)(...))__cxa_pure_virtual + +Class QDesignerIntegrationInterface + size=24 align=8 + base size=24 base align=8 +QDesignerIntegrationInterface (0x0x7319a85a0548) 0 + vptr=((& QDesignerIntegrationInterface::_ZTV29QDesignerIntegrationInterface) + 16) +QObject (0x0x7319a85fe420) 0 + primary-for QDesignerIntegrationInterface (0x0x7319a85a0548) + +Class QDesignerIntegration::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDesignerIntegration::QPrivateSignal (0x0x7319a82f3d80) 0 empty + +Vtable for QDesignerIntegration +QDesignerIntegration::_ZTV20QDesignerIntegration: 34 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QDesignerIntegration) +16 (int (*)(...))QDesignerIntegration::metaObject +24 (int (*)(...))QDesignerIntegration::qt_metacast +32 (int (*)(...))QDesignerIntegration::qt_metacall +40 (int (*)(...))QDesignerIntegration::~QDesignerIntegration +48 (int (*)(...))QDesignerIntegration::~QDesignerIntegration +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QDesignerIntegration::containerWindow +120 (int (*)(...))QDesignerIntegration::createResourceBrowser +128 (int (*)(...))QDesignerIntegration::headerSuffix +136 (int (*)(...))QDesignerIntegration::setHeaderSuffix +144 (int (*)(...))QDesignerIntegration::isHeaderLowercase +152 (int (*)(...))QDesignerIntegration::setHeaderLowercase +160 (int (*)(...))QDesignerIntegration::features +168 (int (*)(...))QDesignerIntegration::resourceFileWatcherBehaviour +176 (int (*)(...))QDesignerIntegration::setResourceFileWatcherBehaviour +184 (int (*)(...))QDesignerIntegration::contextHelpId +192 (int (*)(...))QDesignerIntegration::setFeatures +200 (int (*)(...))QDesignerIntegration::updateProperty +208 (int (*)(...))QDesignerIntegration::updateProperty +216 (int (*)(...))QDesignerIntegration::resetProperty +224 (int (*)(...))QDesignerIntegration::addDynamicProperty +232 (int (*)(...))QDesignerIntegration::removeDynamicProperty +240 (int (*)(...))QDesignerIntegration::updateActiveFormWindow +248 (int (*)(...))QDesignerIntegration::setupFormWindow +256 (int (*)(...))QDesignerIntegration::updateSelection +264 (int (*)(...))QDesignerIntegration::updateCustomWidgetPlugins + +Class QDesignerIntegration + size=32 align=8 + base size=32 base align=8 +QDesignerIntegration (0x0x7319a83190d0) 0 + vptr=((& QDesignerIntegration::_ZTV20QDesignerIntegration) + 16) +QDesignerIntegrationInterface (0x0x7319a8319138) 0 + primary-for QDesignerIntegration (0x0x7319a83190d0) +QObject (0x0x7319a82f3d20) 0 + primary-for QDesignerIntegrationInterface (0x0x7319a8319138) + +Vtable for QAbstractExtensionFactory +QAbstractExtensionFactory::_ZTV25QAbstractExtensionFactory: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI25QAbstractExtensionFactory) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual + +Class QAbstractExtensionFactory + size=8 align=8 + base size=8 base align=8 +QAbstractExtensionFactory (0x0x7319a800cf00) 0 nearly-empty + vptr=((& QAbstractExtensionFactory::_ZTV25QAbstractExtensionFactory) + 16) + +Vtable for QAbstractExtensionManager +QAbstractExtensionManager::_ZTV25QAbstractExtensionManager: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI25QAbstractExtensionManager) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual + +Class QAbstractExtensionManager + size=8 align=8 + base size=8 base align=8 +QAbstractExtensionManager (0x0x7319a8041300) 0 nearly-empty + vptr=((& QAbstractExtensionManager::_ZTV25QAbstractExtensionManager) + 16) + +Vtable for QDesignerLanguageExtension +QDesignerLanguageExtension::_ZTV26QDesignerLanguageExtension: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI26QDesignerLanguageExtension) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))__cxa_pure_virtual +96 (int (*)(...))__cxa_pure_virtual +104 (int (*)(...))__cxa_pure_virtual + +Class QDesignerLanguageExtension + size=8 align=8 + base size=8 base align=8 +QDesignerLanguageExtension (0x0x7319a8041720) 0 nearly-empty + vptr=((& QDesignerLanguageExtension::_ZTV26QDesignerLanguageExtension) + 16) + +Vtable for QDesignerMetaDataBaseItemInterface +QDesignerMetaDataBaseItemInterface::_ZTV34QDesignerMetaDataBaseItemInterface: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI34QDesignerMetaDataBaseItemInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual + +Class QDesignerMetaDataBaseItemInterface + size=8 align=8 + base size=8 base align=8 +QDesignerMetaDataBaseItemInterface (0x0x7319a8041b40) 0 nearly-empty + vptr=((& QDesignerMetaDataBaseItemInterface::_ZTV34QDesignerMetaDataBaseItemInterface) + 16) + +Class QDesignerMetaDataBaseInterface::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDesignerMetaDataBaseInterface::QPrivateSignal (0x0x7319a8041c00) 0 empty + +Vtable for QDesignerMetaDataBaseInterface +QDesignerMetaDataBaseInterface::_ZTV30QDesignerMetaDataBaseInterface: 19 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI30QDesignerMetaDataBaseInterface) +16 (int (*)(...))QDesignerMetaDataBaseInterface::metaObject +24 (int (*)(...))QDesignerMetaDataBaseInterface::qt_metacast +32 (int (*)(...))QDesignerMetaDataBaseInterface::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual + +Class QDesignerMetaDataBaseInterface + size=16 align=8 + base size=16 base align=8 +QDesignerMetaDataBaseInterface (0x0x7319a801e5b0) 0 + vptr=((& QDesignerMetaDataBaseInterface::_ZTV30QDesignerMetaDataBaseInterface) + 16) +QObject (0x0x7319a8041ba0) 0 + primary-for QDesignerMetaDataBaseInterface (0x0x7319a801e5b0) + +Class QDesignerNewFormWidgetInterface::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDesignerNewFormWidgetInterface::QPrivateSignal (0x0x7319a8041d80) 0 empty + +Vtable for QDesignerNewFormWidgetInterface +QDesignerNewFormWidgetInterface::_ZTV31QDesignerNewFormWidgetInterface: 66 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI31QDesignerNewFormWidgetInterface) +16 (int (*)(...))QDesignerNewFormWidgetInterface::metaObject +24 (int (*)(...))QDesignerNewFormWidgetInterface::qt_metacast +32 (int (*)(...))QDesignerNewFormWidgetInterface::qt_metacall +40 0 +48 0 +56 (int (*)(...))QWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))__cxa_pure_virtual +440 (int (*)(...))__cxa_pure_virtual +448 (int (*)(...))-16 +456 (int (*)(...))(& _ZTI31QDesignerNewFormWidgetInterface) +464 0 +472 0 +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QDesignerNewFormWidgetInterface + size=40 align=8 + base size=40 base align=8 +QDesignerNewFormWidgetInterface (0x0x7319a801e618) 0 + vptr=((& QDesignerNewFormWidgetInterface::_ZTV31QDesignerNewFormWidgetInterface) + 16) +QWidget (0x0x7319a83e4850) 0 + primary-for QDesignerNewFormWidgetInterface (0x0x7319a801e618) +QObject (0x0x7319a8041cc0) 0 + primary-for QWidget (0x0x7319a83e4850) +QPaintDevice (0x0x7319a8041d20) 16 + vptr=((& QDesignerNewFormWidgetInterface::_ZTV31QDesignerNewFormWidgetInterface) + 464) + +Class QDesignerObjectInspectorInterface::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDesignerObjectInspectorInterface::QPrivateSignal (0x0x7319a8041f00) 0 empty + +Vtable for QDesignerObjectInspectorInterface +QDesignerObjectInspectorInterface::_ZTV33QDesignerObjectInspectorInterface: 66 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI33QDesignerObjectInspectorInterface) +16 (int (*)(...))QDesignerObjectInspectorInterface::metaObject +24 (int (*)(...))QDesignerObjectInspectorInterface::qt_metacast +32 (int (*)(...))QDesignerObjectInspectorInterface::qt_metacall +40 0 +48 0 +56 (int (*)(...))QWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDesignerObjectInspectorInterface::core +440 (int (*)(...))__cxa_pure_virtual +448 (int (*)(...))-16 +456 (int (*)(...))(& _ZTI33QDesignerObjectInspectorInterface) +464 0 +472 0 +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QDesignerObjectInspectorInterface + size=40 align=8 + base size=40 base align=8 +QDesignerObjectInspectorInterface (0x0x7319a801e680) 0 + vptr=((& QDesignerObjectInspectorInterface::_ZTV33QDesignerObjectInspectorInterface) + 16) +QWidget (0x0x7319a83e4930) 0 + primary-for QDesignerObjectInspectorInterface (0x0x7319a801e680) +QObject (0x0x7319a8041e40) 0 + primary-for QWidget (0x0x7319a83e4930) +QPaintDevice (0x0x7319a8041ea0) 16 + vptr=((& QDesignerObjectInspectorInterface::_ZTV33QDesignerObjectInspectorInterface) + 464) + +Vtable for QDesignerOptionsPageInterface +QDesignerOptionsPageInterface::_ZTV29QDesignerOptionsPageInterface: 8 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI29QDesignerOptionsPageInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual + +Class QDesignerOptionsPageInterface + size=8 align=8 + base size=8 base align=8 +QDesignerOptionsPageInterface (0x0x7319a807a000) 0 nearly-empty + vptr=((& QDesignerOptionsPageInterface::_ZTV29QDesignerOptionsPageInterface) + 16) + +Class QDesignerPromotionInterface::PromotedClass + size=16 align=8 + base size=16 base align=8 +QDesignerPromotionInterface::PromotedClass (0x0x7319a807a0c0) 0 + +Vtable for QDesignerPromotionInterface +QDesignerPromotionInterface::_ZTV27QDesignerPromotionInterface: 11 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI27QDesignerPromotionInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual + +Class QDesignerPromotionInterface + size=8 align=8 + base size=8 base align=8 +QDesignerPromotionInterface (0x0x7319a807a060) 0 nearly-empty + vptr=((& QDesignerPromotionInterface::_ZTV27QDesignerPromotionInterface) + 16) + +Class QDesignerPropertyEditorInterface::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDesignerPropertyEditorInterface::QPrivateSignal (0x0x7319a807a1e0) 0 empty + +Vtable for QDesignerPropertyEditorInterface +QDesignerPropertyEditorInterface::_ZTV32QDesignerPropertyEditorInterface: 71 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI32QDesignerPropertyEditorInterface) +16 (int (*)(...))QDesignerPropertyEditorInterface::metaObject +24 (int (*)(...))QDesignerPropertyEditorInterface::qt_metacast +32 (int (*)(...))QDesignerPropertyEditorInterface::qt_metacall +40 0 +48 0 +56 (int (*)(...))QWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDesignerPropertyEditorInterface::core +440 (int (*)(...))__cxa_pure_virtual +448 (int (*)(...))__cxa_pure_virtual +456 (int (*)(...))__cxa_pure_virtual +464 (int (*)(...))__cxa_pure_virtual +472 (int (*)(...))__cxa_pure_virtual +480 (int (*)(...))__cxa_pure_virtual +488 (int (*)(...))-16 +496 (int (*)(...))(& _ZTI32QDesignerPropertyEditorInterface) +504 0 +512 0 +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +552 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +560 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QDesignerPropertyEditorInterface + size=40 align=8 + base size=40 base align=8 +QDesignerPropertyEditorInterface (0x0x7319a801e6e8) 0 + vptr=((& QDesignerPropertyEditorInterface::_ZTV32QDesignerPropertyEditorInterface) + 16) +QWidget (0x0x7319a83e4a10) 0 + primary-for QDesignerPropertyEditorInterface (0x0x7319a801e6e8) +QObject (0x0x7319a807a120) 0 + primary-for QWidget (0x0x7319a83e4a10) +QPaintDevice (0x0x7319a807a180) 16 + vptr=((& QDesignerPropertyEditorInterface::_ZTV32QDesignerPropertyEditorInterface) + 504) + +Class QDesignerResourceBrowserInterface::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDesignerResourceBrowserInterface::QPrivateSignal (0x0x7319a807a360) 0 empty + +Vtable for QDesignerResourceBrowserInterface +QDesignerResourceBrowserInterface::_ZTV33QDesignerResourceBrowserInterface: 66 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI33QDesignerResourceBrowserInterface) +16 (int (*)(...))QDesignerResourceBrowserInterface::metaObject +24 (int (*)(...))QDesignerResourceBrowserInterface::qt_metacast +32 (int (*)(...))QDesignerResourceBrowserInterface::qt_metacall +40 0 +48 0 +56 (int (*)(...))QWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))__cxa_pure_virtual +440 (int (*)(...))__cxa_pure_virtual +448 (int (*)(...))-16 +456 (int (*)(...))(& _ZTI33QDesignerResourceBrowserInterface) +464 0 +472 0 +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QDesignerResourceBrowserInterface + size=40 align=8 + base size=40 base align=8 +QDesignerResourceBrowserInterface (0x0x7319a801e750) 0 + vptr=((& QDesignerResourceBrowserInterface::_ZTV33QDesignerResourceBrowserInterface) + 16) +QWidget (0x0x7319a83e4af0) 0 + primary-for QDesignerResourceBrowserInterface (0x0x7319a801e750) +QObject (0x0x7319a807a2a0) 0 + primary-for QWidget (0x0x7319a83e4af0) +QPaintDevice (0x0x7319a807a300) 16 + vptr=((& QDesignerResourceBrowserInterface::_ZTV33QDesignerResourceBrowserInterface) + 464) + +Vtable for QDesignerSettingsInterface +QDesignerSettingsInterface::_ZTV26QDesignerSettingsInterface: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI26QDesignerSettingsInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual + +Class QDesignerSettingsInterface + size=8 align=8 + base size=8 base align=8 +QDesignerSettingsInterface (0x0x7319a807a420) 0 nearly-empty + vptr=((& QDesignerSettingsInterface::_ZTV26QDesignerSettingsInterface) + 16) + +Class QDesignerWidgetBoxInterface::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDesignerWidgetBoxInterface::QPrivateSignal (0x0x7319a807a540) 0 empty + +Class QDesignerWidgetBoxInterface::Widget + size=8 align=8 + base size=8 base align=8 +QDesignerWidgetBoxInterface::Widget (0x0x7319a807a5a0) 0 + +Class QDesignerWidgetBoxInterface::Category + size=56 align=8 + base size=56 base align=8 +QDesignerWidgetBoxInterface::Category (0x0x7319a807aa80) 0 + +Vtable for QDesignerWidgetBoxInterface +QDesignerWidgetBoxInterface::_ZTV27QDesignerWidgetBoxInterface: 77 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI27QDesignerWidgetBoxInterface) +16 (int (*)(...))QDesignerWidgetBoxInterface::metaObject +24 (int (*)(...))QDesignerWidgetBoxInterface::qt_metacast +32 (int (*)(...))QDesignerWidgetBoxInterface::qt_metacall +40 0 +48 0 +56 (int (*)(...))QWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))__cxa_pure_virtual +440 (int (*)(...))__cxa_pure_virtual +448 (int (*)(...))__cxa_pure_virtual +456 (int (*)(...))__cxa_pure_virtual +464 (int (*)(...))__cxa_pure_virtual +472 (int (*)(...))__cxa_pure_virtual +480 (int (*)(...))__cxa_pure_virtual +488 (int (*)(...))__cxa_pure_virtual +496 (int (*)(...))__cxa_pure_virtual +504 (int (*)(...))__cxa_pure_virtual +512 (int (*)(...))__cxa_pure_virtual +520 (int (*)(...))__cxa_pure_virtual +528 (int (*)(...))__cxa_pure_virtual +536 (int (*)(...))-16 +544 (int (*)(...))(& _ZTI27QDesignerWidgetBoxInterface) +552 0 +560 0 +568 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +576 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +584 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +592 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +600 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +608 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QDesignerWidgetBoxInterface + size=40 align=8 + base size=40 base align=8 +QDesignerWidgetBoxInterface (0x0x7319a801e7b8) 0 + vptr=((& QDesignerWidgetBoxInterface::_ZTV27QDesignerWidgetBoxInterface) + 16) +QWidget (0x0x7319a83e4bd0) 0 + primary-for QDesignerWidgetBoxInterface (0x0x7319a801e7b8) +QObject (0x0x7319a807a480) 0 + primary-for QWidget (0x0x7319a83e4bd0) +QPaintDevice (0x0x7319a807a4e0) 16 + vptr=((& QDesignerWidgetBoxInterface::_ZTV27QDesignerWidgetBoxInterface) + 552) + +Vtable for QDesignerWidgetDataBaseItemInterface +QDesignerWidgetDataBaseItemInterface::_ZTV36QDesignerWidgetDataBaseItemInterface: 30 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI36QDesignerWidgetDataBaseItemInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))__cxa_pure_virtual +96 (int (*)(...))__cxa_pure_virtual +104 (int (*)(...))__cxa_pure_virtual +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))__cxa_pure_virtual +160 (int (*)(...))__cxa_pure_virtual +168 (int (*)(...))__cxa_pure_virtual +176 (int (*)(...))__cxa_pure_virtual +184 (int (*)(...))__cxa_pure_virtual +192 (int (*)(...))__cxa_pure_virtual +200 (int (*)(...))__cxa_pure_virtual +208 (int (*)(...))__cxa_pure_virtual +216 (int (*)(...))__cxa_pure_virtual +224 (int (*)(...))__cxa_pure_virtual +232 (int (*)(...))__cxa_pure_virtual + +Class QDesignerWidgetDataBaseItemInterface + size=8 align=8 + base size=8 base align=8 +QDesignerWidgetDataBaseItemInterface (0x0x7319a8158600) 0 nearly-empty + vptr=((& QDesignerWidgetDataBaseItemInterface::_ZTV36QDesignerWidgetDataBaseItemInterface) + 16) + +Class QDesignerWidgetDataBaseInterface::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDesignerWidgetDataBaseInterface::QPrivateSignal (0x0x7319a8158720) 0 empty + +Vtable for QDesignerWidgetDataBaseInterface +QDesignerWidgetDataBaseInterface::_ZTV32QDesignerWidgetDataBaseInterface: 22 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI32QDesignerWidgetDataBaseInterface) +16 (int (*)(...))QDesignerWidgetDataBaseInterface::metaObject +24 (int (*)(...))QDesignerWidgetDataBaseInterface::qt_metacast +32 (int (*)(...))QDesignerWidgetDataBaseInterface::qt_metacall +40 (int (*)(...))QDesignerWidgetDataBaseInterface::~QDesignerWidgetDataBaseInterface +48 (int (*)(...))QDesignerWidgetDataBaseInterface::~QDesignerWidgetDataBaseInterface +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QDesignerWidgetDataBaseInterface::count +120 (int (*)(...))QDesignerWidgetDataBaseInterface::item +128 (int (*)(...))QDesignerWidgetDataBaseInterface::indexOf +136 (int (*)(...))QDesignerWidgetDataBaseInterface::insert +144 (int (*)(...))QDesignerWidgetDataBaseInterface::append +152 (int (*)(...))QDesignerWidgetDataBaseInterface::indexOfObject +160 (int (*)(...))QDesignerWidgetDataBaseInterface::indexOfClassName +168 (int (*)(...))QDesignerWidgetDataBaseInterface::core + +Class QDesignerWidgetDataBaseInterface + size=40 align=8 + base size=40 base align=8 +QDesignerWidgetDataBaseInterface (0x0x7319a815cf70) 0 + vptr=((& QDesignerWidgetDataBaseInterface::_ZTV32QDesignerWidgetDataBaseInterface) + 16) +QObject (0x0x7319a81586c0) 0 + primary-for QDesignerWidgetDataBaseInterface (0x0x7319a815cf70) + +Class QDesignerWidgetFactoryInterface::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDesignerWidgetFactoryInterface::QPrivateSignal (0x0x7319a8158f00) 0 empty + +Vtable for QDesignerWidgetFactoryInterface +QDesignerWidgetFactoryInterface::_ZTV31QDesignerWidgetFactoryInterface: 21 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI31QDesignerWidgetFactoryInterface) +16 (int (*)(...))QDesignerWidgetFactoryInterface::metaObject +24 (int (*)(...))QDesignerWidgetFactoryInterface::qt_metacast +32 (int (*)(...))QDesignerWidgetFactoryInterface::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))__cxa_pure_virtual +160 (int (*)(...))__cxa_pure_virtual + +Class QDesignerWidgetFactoryInterface + size=16 align=8 + base size=16 base align=8 +QDesignerWidgetFactoryInterface (0x0x7319a817a5b0) 0 + vptr=((& QDesignerWidgetFactoryInterface::_ZTV31QDesignerWidgetFactoryInterface) + 16) +QObject (0x0x7319a8158ea0) 0 + primary-for QDesignerWidgetFactoryInterface (0x0x7319a817a5b0) + +Vtable for QDesignerContainerExtension +QDesignerContainerExtension::_ZTV27QDesignerContainerExtension: 13 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI27QDesignerContainerExtension) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))__cxa_pure_virtual +96 (int (*)(...))__cxa_pure_virtual + +Class QDesignerContainerExtension + size=8 align=8 + base size=8 base align=8 +QDesignerContainerExtension (0x0x7319a81ca000) 0 nearly-empty + vptr=((& QDesignerContainerExtension::_ZTV27QDesignerContainerExtension) + 16) + +Vtable for QDesignerDynamicPropertySheetExtension +QDesignerDynamicPropertySheetExtension::_ZTV38QDesignerDynamicPropertySheetExtension: 9 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI38QDesignerDynamicPropertySheetExtension) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual + +Class QDesignerDynamicPropertySheetExtension + size=8 align=8 + base size=8 base align=8 +QDesignerDynamicPropertySheetExtension (0x0x7319a81ca420) 0 nearly-empty + vptr=((& QDesignerDynamicPropertySheetExtension::_ZTV38QDesignerDynamicPropertySheetExtension) + 16) + +Vtable for QDesignerExtraInfoExtension +QDesignerExtraInfoExtension::_ZTV27QDesignerExtraInfoExtension: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI27QDesignerExtraInfoExtension) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual + +Class QDesignerExtraInfoExtension + size=32 align=8 + base size=32 base align=8 +QDesignerExtraInfoExtension (0x0x7319a81ca8a0) 0 + vptr=((& QDesignerExtraInfoExtension::_ZTV27QDesignerExtraInfoExtension) + 16) + +Vtable for QFormBuilder +QFormBuilder::_ZTV12QFormBuilder: 43 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QFormBuilder) +16 (int (*)(...))QFormBuilder::~QFormBuilder +24 (int (*)(...))QFormBuilder::~QFormBuilder +32 (int (*)(...))QAbstractFormBuilder::load +40 (int (*)(...))QAbstractFormBuilder::save +48 (int (*)(...))QAbstractFormBuilder::loadExtraInfo +56 (int (*)(...))QFormBuilder::create +64 (int (*)(...))QFormBuilder::create +72 (int (*)(...))QFormBuilder::create +80 (int (*)(...))QFormBuilder::create +88 (int (*)(...))QFormBuilder::create +96 (int (*)(...))QFormBuilder::create +104 (int (*)(...))QAbstractFormBuilder::addMenuAction +112 (int (*)(...))QFormBuilder::applyProperties +120 (int (*)(...))QAbstractFormBuilder::applyTabStops +128 (int (*)(...))QFormBuilder::createWidget +136 (int (*)(...))QFormBuilder::createLayout +144 (int (*)(...))QAbstractFormBuilder::createAction +152 (int (*)(...))QAbstractFormBuilder::createActionGroup +160 (int (*)(...))QAbstractFormBuilder::createCustomWidgets +168 (int (*)(...))QFormBuilder::createConnections +176 (int (*)(...))QAbstractFormBuilder::createResources +184 (int (*)(...))QFormBuilder::addItem +192 (int (*)(...))QFormBuilder::addItem +200 (int (*)(...))QAbstractFormBuilder::saveExtraInfo +208 (int (*)(...))QAbstractFormBuilder::saveDom +216 (int (*)(...))QAbstractFormBuilder::createActionRefDom +224 (int (*)(...))QAbstractFormBuilder::createDom +232 (int (*)(...))QAbstractFormBuilder::createDom +240 (int (*)(...))QAbstractFormBuilder::createDom +248 (int (*)(...))QAbstractFormBuilder::createDom +256 (int (*)(...))QAbstractFormBuilder::createDom +264 (int (*)(...))QAbstractFormBuilder::createDom +272 (int (*)(...))QAbstractFormBuilder::saveConnections +280 (int (*)(...))QAbstractFormBuilder::saveCustomWidgets +288 (int (*)(...))QAbstractFormBuilder::saveTabStops +296 (int (*)(...))QAbstractFormBuilder::saveResources +304 (int (*)(...))QAbstractFormBuilder::computeProperties +312 (int (*)(...))QAbstractFormBuilder::checkProperty +320 (int (*)(...))QAbstractFormBuilder::createProperty +328 (int (*)(...))QAbstractFormBuilder::layoutInfo +336 (int (*)(...))QFormBuilder::updateCustomWidgets + +Class QFormBuilder + size=16 align=8 + base size=16 base align=8 +QFormBuilder (0x0x7319a817a888) 0 + vptr=((& QFormBuilder::_ZTV12QFormBuilder) + 16) +QAbstractFormBuilder (0x0x7319a81cacc0) 0 + primary-for QFormBuilder (0x0x7319a817a888) + +Vtable for QDesignerLayoutDecorationExtension +QDesignerLayoutDecorationExtension::_ZTV34QDesignerLayoutDecorationExtension: 19 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI34QDesignerLayoutDecorationExtension) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))__cxa_pure_virtual +96 (int (*)(...))__cxa_pure_virtual +104 (int (*)(...))__cxa_pure_virtual +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual + +Class QDesignerLayoutDecorationExtension + size=8 align=8 + base size=8 base align=8 +QDesignerLayoutDecorationExtension (0x0x7319a81cad20) 0 nearly-empty + vptr=((& QDesignerLayoutDecorationExtension::_ZTV34QDesignerLayoutDecorationExtension) + 16) + +Vtable for QDesignerMemberSheetExtension +QDesignerMemberSheetExtension::_ZTV29QDesignerMemberSheetExtension: 18 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI29QDesignerMemberSheetExtension) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))__cxa_pure_virtual +96 (int (*)(...))__cxa_pure_virtual +104 (int (*)(...))__cxa_pure_virtual +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual + +Class QDesignerMemberSheetExtension + size=8 align=8 + base size=8 base align=8 +QDesignerMemberSheetExtension (0x0x7319a7e01180) 0 nearly-empty + vptr=((& QDesignerMemberSheetExtension::_ZTV29QDesignerMemberSheetExtension) + 16) + +Vtable for QDesignerPropertySheetExtension +QDesignerPropertySheetExtension::_ZTV31QDesignerPropertySheetExtension: 20 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI31QDesignerPropertySheetExtension) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))__cxa_pure_virtual +96 (int (*)(...))__cxa_pure_virtual +104 (int (*)(...))__cxa_pure_virtual +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))__cxa_pure_virtual + +Class QDesignerPropertySheetExtension + size=8 align=8 + base size=8 base align=8 +QDesignerPropertySheetExtension (0x0x7319a7e015a0) 0 nearly-empty + vptr=((& QDesignerPropertySheetExtension::_ZTV31QDesignerPropertySheetExtension) + 16) + +Class QExtensionManager::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QExtensionManager::QPrivateSignal (0x0x7319a7e01a80) 0 empty + +Vtable for QExtensionManager +QExtensionManager::_ZTV17QExtensionManager: 24 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QExtensionManager) +16 (int (*)(...))QExtensionManager::metaObject +24 (int (*)(...))QExtensionManager::qt_metacast +32 (int (*)(...))QExtensionManager::qt_metacall +40 (int (*)(...))QExtensionManager::~QExtensionManager +48 (int (*)(...))QExtensionManager::~QExtensionManager +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QExtensionManager::registerExtensions +120 (int (*)(...))QExtensionManager::unregisterExtensions +128 (int (*)(...))QExtensionManager::extension +136 (int (*)(...))-16 +144 (int (*)(...))(& _ZTI17QExtensionManager) +152 (int (*)(...))QExtensionManager::_ZThn16_N17QExtensionManagerD1Ev +160 (int (*)(...))QExtensionManager::_ZThn16_N17QExtensionManagerD0Ev +168 (int (*)(...))QExtensionManager::_ZThn16_N17QExtensionManager18registerExtensionsEP25QAbstractExtensionFactoryRK7QString +176 (int (*)(...))QExtensionManager::_ZThn16_N17QExtensionManager20unregisterExtensionsEP25QAbstractExtensionFactoryRK7QString +184 (int (*)(...))QExtensionManager::_ZThn16_NK17QExtensionManager9extensionEP7QObjectRK7QString + +Class QExtensionManager + size=56 align=8 + base size=56 base align=8 +QExtensionManager (0x0x7319a81f6690) 0 + vptr=((& QExtensionManager::_ZTV17QExtensionManager) + 16) +QObject (0x0x7319a7e019c0) 0 + primary-for QExtensionManager (0x0x7319a81f6690) +QAbstractExtensionManager (0x0x7319a7e01a20) 16 nearly-empty + vptr=((& QExtensionManager::_ZTV17QExtensionManager) + 152) + +Vtable for QDesignerTaskMenuExtension +QDesignerTaskMenuExtension::_ZTV26QDesignerTaskMenuExtension: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI26QDesignerTaskMenuExtension) +16 0 +24 0 +32 (int (*)(...))QDesignerTaskMenuExtension::preferredEditAction +40 (int (*)(...))__cxa_pure_virtual + +Class QDesignerTaskMenuExtension + size=8 align=8 + base size=8 base align=8 +QDesignerTaskMenuExtension (0x0x7319a7e7d360) 0 nearly-empty + vptr=((& QDesignerTaskMenuExtension::_ZTV26QDesignerTaskMenuExtension) + 16) + +Vtable for QSqlDriverCreatorBase +QSqlDriverCreatorBase::_ZTV21QSqlDriverCreatorBase: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI21QSqlDriverCreatorBase) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual + +Class QSqlDriverCreatorBase + size=8 align=8 + base size=8 base align=8 +QSqlDriverCreatorBase (0x0x7319a7e7dcc0) 0 nearly-empty + vptr=((& QSqlDriverCreatorBase::_ZTV21QSqlDriverCreatorBase) + 16) + +Class QSqlDatabaseDefaultConnectionName + size=1 align=1 + base size=0 base align=1 +QSqlDatabaseDefaultConnectionName (0x0x7319a7e7dde0) 0 empty + +Class QSqlDatabase + size=8 align=8 + base size=8 base align=8 +QSqlDatabase (0x0x7319a7e7f4e0) 0 +QSqlDatabaseDefaultConnectionName (0x0x7319a7e7dea0) 0 empty + +Class QSqlDriver::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSqlDriver::QPrivateSignal (0x0x7319a7e7df60) 0 empty + +Vtable for QSqlDriver +QSqlDriver::_ZTV10QSqlDriver: 39 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QSqlDriver) +16 (int (*)(...))QSqlDriver::metaObject +24 (int (*)(...))QSqlDriver::qt_metacast +32 (int (*)(...))QSqlDriver::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QSqlDriver::isOpen +120 (int (*)(...))QSqlDriver::beginTransaction +128 (int (*)(...))QSqlDriver::commitTransaction +136 (int (*)(...))QSqlDriver::rollbackTransaction +144 (int (*)(...))QSqlDriver::tables +152 (int (*)(...))QSqlDriver::primaryIndex +160 (int (*)(...))QSqlDriver::record +168 (int (*)(...))QSqlDriver::formatValue +176 (int (*)(...))QSqlDriver::escapeIdentifier +184 (int (*)(...))QSqlDriver::sqlStatement +192 (int (*)(...))QSqlDriver::handle +200 (int (*)(...))__cxa_pure_virtual +208 (int (*)(...))__cxa_pure_virtual +216 (int (*)(...))__cxa_pure_virtual +224 (int (*)(...))__cxa_pure_virtual +232 (int (*)(...))QSqlDriver::subscribeToNotification +240 (int (*)(...))QSqlDriver::unsubscribeFromNotification +248 (int (*)(...))QSqlDriver::subscribedToNotifications +256 (int (*)(...))QSqlDriver::isIdentifierEscaped +264 (int (*)(...))QSqlDriver::stripDelimiters +272 (int (*)(...))QSqlDriver::maximumIdentifierLength +280 (int (*)(...))QSqlDriver::cancelQuery +288 (int (*)(...))QSqlDriver::setOpen +296 (int (*)(...))QSqlDriver::setOpenError +304 (int (*)(...))QSqlDriver::setLastError + +Class QSqlDriver + size=16 align=8 + base size=16 base align=8 +QSqlDriver (0x0x7319a7e7f548) 0 + vptr=((& QSqlDriver::_ZTV10QSqlDriver) + 16) +QObject (0x0x7319a7e7df00) 0 + primary-for QSqlDriver (0x0x7319a7e7f548) + +Class QSqlDriverPlugin::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSqlDriverPlugin::QPrivateSignal (0x0x7319a7f51180) 0 empty + +Vtable for QSqlDriverPlugin +QSqlDriverPlugin::_ZTV16QSqlDriverPlugin: 15 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI16QSqlDriverPlugin) +16 (int (*)(...))QSqlDriverPlugin::metaObject +24 (int (*)(...))QSqlDriverPlugin::qt_metacast +32 (int (*)(...))QSqlDriverPlugin::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual + +Class QSqlDriverPlugin + size=16 align=8 + base size=16 base align=8 +QSqlDriverPlugin (0x0x7319a7e7f5b0) 0 + vptr=((& QSqlDriverPlugin::_ZTV16QSqlDriverPlugin) + 16) +QObject (0x0x7319a7f51120) 0 + primary-for QSqlDriverPlugin (0x0x7319a7e7f5b0) + +Class QSqlError + size=8 align=8 + base size=8 base align=8 +QSqlError (0x0x7319a7f515a0) 0 + +Class QSqlField + size=40 align=8 + base size=40 base align=8 +QSqlField (0x0x7319a7fcc7e0) 0 + +Class QSqlRecord + size=8 align=8 + base size=8 base align=8 +QSqlRecord (0x0x7319a7c55f60) 0 + +Class QSqlIndex + size=80 align=8 + base size=80 base align=8 +QSqlIndex (0x0x7319a7ce7f70) 0 +QSqlRecord (0x0x7319a7cf80c0) 0 + +Class QSqlQuery + size=8 align=8 + base size=8 base align=8 +QSqlQuery (0x0x7319a7d89540) 0 + +Class QSqlQueryModel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSqlQueryModel::QPrivateSignal (0x0x7319a7d89900) 0 empty + +Vtable for QSqlQueryModel +QSqlQueryModel::_ZTV14QSqlQueryModel: 54 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QSqlQueryModel) +16 (int (*)(...))QSqlQueryModel::metaObject +24 (int (*)(...))QSqlQueryModel::qt_metacast +32 (int (*)(...))QSqlQueryModel::qt_metacall +40 (int (*)(...))QSqlQueryModel::~QSqlQueryModel +48 (int (*)(...))QSqlQueryModel::~QSqlQueryModel +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QAbstractTableModel::index +120 (int (*)(...))QAbstractTableModel::parent +128 (int (*)(...))QAbstractTableModel::sibling +136 (int (*)(...))QSqlQueryModel::rowCount +144 (int (*)(...))QSqlQueryModel::columnCount +152 (int (*)(...))QAbstractTableModel::hasChildren +160 (int (*)(...))QSqlQueryModel::data +168 (int (*)(...))QAbstractItemModel::setData +176 (int (*)(...))QSqlQueryModel::headerData +184 (int (*)(...))QSqlQueryModel::setHeaderData +192 (int (*)(...))QAbstractItemModel::itemData +200 (int (*)(...))QAbstractItemModel::setItemData +208 (int (*)(...))QAbstractItemModel::clearItemData +216 (int (*)(...))QAbstractItemModel::mimeTypes +224 (int (*)(...))QAbstractItemModel::mimeData +232 (int (*)(...))QAbstractItemModel::canDropMimeData +240 (int (*)(...))QAbstractTableModel::dropMimeData +248 (int (*)(...))QAbstractItemModel::supportedDropActions +256 (int (*)(...))QAbstractItemModel::supportedDragActions +264 (int (*)(...))QAbstractItemModel::insertRows +272 (int (*)(...))QSqlQueryModel::insertColumns +280 (int (*)(...))QAbstractItemModel::removeRows +288 (int (*)(...))QSqlQueryModel::removeColumns +296 (int (*)(...))QAbstractItemModel::moveRows +304 (int (*)(...))QAbstractItemModel::moveColumns +312 (int (*)(...))QSqlQueryModel::fetchMore +320 (int (*)(...))QSqlQueryModel::canFetchMore +328 (int (*)(...))QAbstractTableModel::flags +336 (int (*)(...))QAbstractItemModel::sort +344 (int (*)(...))QAbstractItemModel::buddy +352 (int (*)(...))QAbstractItemModel::match +360 (int (*)(...))QAbstractItemModel::span +368 (int (*)(...))QSqlQueryModel::roleNames +376 (int (*)(...))QAbstractItemModel::multiData +384 (int (*)(...))QAbstractItemModel::submit +392 (int (*)(...))QAbstractItemModel::revert +400 (int (*)(...))QAbstractItemModel::resetInternalData +408 (int (*)(...))QSqlQueryModel::clear +416 (int (*)(...))QSqlQueryModel::queryChange +424 (int (*)(...))QSqlQueryModel::indexInQuery + +Class QSqlQueryModel + size=16 align=8 + base size=16 base align=8 +QSqlQueryModel (0x0x7319a7d86b60) 0 + vptr=((& QSqlQueryModel::_ZTV14QSqlQueryModel) + 16) +QAbstractTableModel (0x0x7319a7d86bc8) 0 + primary-for QSqlQueryModel (0x0x7319a7d86b60) +QAbstractItemModel (0x0x7319a7d86c30) 0 + primary-for QAbstractTableModel (0x0x7319a7d86bc8) +QObject (0x0x7319a7d898a0) 0 + primary-for QAbstractItemModel (0x0x7319a7d86c30) + +Class QSqlTableModel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSqlTableModel::QPrivateSignal (0x0x7319a7d89ae0) 0 empty + +Vtable for QSqlTableModel +QSqlTableModel::_ZTV14QSqlTableModel: 66 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QSqlTableModel) +16 (int (*)(...))QSqlTableModel::metaObject +24 (int (*)(...))QSqlTableModel::qt_metacast +32 (int (*)(...))QSqlTableModel::qt_metacall +40 (int (*)(...))QSqlTableModel::~QSqlTableModel +48 (int (*)(...))QSqlTableModel::~QSqlTableModel +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QAbstractTableModel::index +120 (int (*)(...))QAbstractTableModel::parent +128 (int (*)(...))QAbstractTableModel::sibling +136 (int (*)(...))QSqlTableModel::rowCount +144 (int (*)(...))QSqlQueryModel::columnCount +152 (int (*)(...))QAbstractTableModel::hasChildren +160 (int (*)(...))QSqlTableModel::data +168 (int (*)(...))QSqlTableModel::setData +176 (int (*)(...))QSqlTableModel::headerData +184 (int (*)(...))QSqlQueryModel::setHeaderData +192 (int (*)(...))QAbstractItemModel::itemData +200 (int (*)(...))QAbstractItemModel::setItemData +208 (int (*)(...))QSqlTableModel::clearItemData +216 (int (*)(...))QAbstractItemModel::mimeTypes +224 (int (*)(...))QAbstractItemModel::mimeData +232 (int (*)(...))QAbstractItemModel::canDropMimeData +240 (int (*)(...))QAbstractTableModel::dropMimeData +248 (int (*)(...))QAbstractItemModel::supportedDropActions +256 (int (*)(...))QAbstractItemModel::supportedDragActions +264 (int (*)(...))QSqlTableModel::insertRows +272 (int (*)(...))QSqlQueryModel::insertColumns +280 (int (*)(...))QSqlTableModel::removeRows +288 (int (*)(...))QSqlTableModel::removeColumns +296 (int (*)(...))QAbstractItemModel::moveRows +304 (int (*)(...))QAbstractItemModel::moveColumns +312 (int (*)(...))QSqlQueryModel::fetchMore +320 (int (*)(...))QSqlQueryModel::canFetchMore +328 (int (*)(...))QSqlTableModel::flags +336 (int (*)(...))QSqlTableModel::sort +344 (int (*)(...))QAbstractItemModel::buddy +352 (int (*)(...))QAbstractItemModel::match +360 (int (*)(...))QAbstractItemModel::span +368 (int (*)(...))QSqlQueryModel::roleNames +376 (int (*)(...))QAbstractItemModel::multiData +384 (int (*)(...))QSqlTableModel::submit +392 (int (*)(...))QSqlTableModel::revert +400 (int (*)(...))QAbstractItemModel::resetInternalData +408 (int (*)(...))QSqlTableModel::clear +416 (int (*)(...))QSqlQueryModel::queryChange +424 (int (*)(...))QSqlTableModel::indexInQuery +432 (int (*)(...))QSqlTableModel::setTable +440 (int (*)(...))QSqlTableModel::setEditStrategy +448 (int (*)(...))QSqlTableModel::setSort +456 (int (*)(...))QSqlTableModel::setFilter +464 (int (*)(...))QSqlTableModel::revertRow +472 (int (*)(...))QSqlTableModel::select +480 (int (*)(...))QSqlTableModel::selectRow +488 (int (*)(...))QSqlTableModel::updateRowInTable +496 (int (*)(...))QSqlTableModel::insertRowIntoTable +504 (int (*)(...))QSqlTableModel::deleteRowFromTable +512 (int (*)(...))QSqlTableModel::orderByClause +520 (int (*)(...))QSqlTableModel::selectStatement + +Class QSqlTableModel + size=16 align=8 + base size=16 base align=8 +QSqlTableModel (0x0x7319a7d86c98) 0 + vptr=((& QSqlTableModel::_ZTV14QSqlTableModel) + 16) +QSqlQueryModel (0x0x7319a7d86d00) 0 + primary-for QSqlTableModel (0x0x7319a7d86c98) +QAbstractTableModel (0x0x7319a7d86d68) 0 + primary-for QSqlQueryModel (0x0x7319a7d86d00) +QAbstractItemModel (0x0x7319a7d86dd0) 0 + primary-for QAbstractTableModel (0x0x7319a7d86d68) +QObject (0x0x7319a7d89a80) 0 + primary-for QAbstractItemModel (0x0x7319a7d86dd0) + +Class QSqlRelation + size=72 align=8 + base size=72 base align=8 +QSqlRelation (0x0x7319a7d89c60) 0 + +Class QSqlRelationalTableModel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSqlRelationalTableModel::QPrivateSignal (0x0x7319a7a13f60) 0 empty + +Vtable for QSqlRelationalTableModel +QSqlRelationalTableModel::_ZTV24QSqlRelationalTableModel: 68 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI24QSqlRelationalTableModel) +16 (int (*)(...))QSqlRelationalTableModel::metaObject +24 (int (*)(...))QSqlRelationalTableModel::qt_metacast +32 (int (*)(...))QSqlRelationalTableModel::qt_metacall +40 (int (*)(...))QSqlRelationalTableModel::~QSqlRelationalTableModel +48 (int (*)(...))QSqlRelationalTableModel::~QSqlRelationalTableModel +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QAbstractTableModel::index +120 (int (*)(...))QAbstractTableModel::parent +128 (int (*)(...))QAbstractTableModel::sibling +136 (int (*)(...))QSqlTableModel::rowCount +144 (int (*)(...))QSqlQueryModel::columnCount +152 (int (*)(...))QAbstractTableModel::hasChildren +160 (int (*)(...))QSqlRelationalTableModel::data +168 (int (*)(...))QSqlRelationalTableModel::setData +176 (int (*)(...))QSqlTableModel::headerData +184 (int (*)(...))QSqlQueryModel::setHeaderData +192 (int (*)(...))QAbstractItemModel::itemData +200 (int (*)(...))QAbstractItemModel::setItemData +208 (int (*)(...))QSqlTableModel::clearItemData +216 (int (*)(...))QAbstractItemModel::mimeTypes +224 (int (*)(...))QAbstractItemModel::mimeData +232 (int (*)(...))QAbstractItemModel::canDropMimeData +240 (int (*)(...))QAbstractTableModel::dropMimeData +248 (int (*)(...))QAbstractItemModel::supportedDropActions +256 (int (*)(...))QAbstractItemModel::supportedDragActions +264 (int (*)(...))QSqlTableModel::insertRows +272 (int (*)(...))QSqlQueryModel::insertColumns +280 (int (*)(...))QSqlTableModel::removeRows +288 (int (*)(...))QSqlRelationalTableModel::removeColumns +296 (int (*)(...))QAbstractItemModel::moveRows +304 (int (*)(...))QAbstractItemModel::moveColumns +312 (int (*)(...))QSqlQueryModel::fetchMore +320 (int (*)(...))QSqlQueryModel::canFetchMore +328 (int (*)(...))QSqlTableModel::flags +336 (int (*)(...))QSqlTableModel::sort +344 (int (*)(...))QAbstractItemModel::buddy +352 (int (*)(...))QAbstractItemModel::match +360 (int (*)(...))QAbstractItemModel::span +368 (int (*)(...))QSqlQueryModel::roleNames +376 (int (*)(...))QAbstractItemModel::multiData +384 (int (*)(...))QSqlTableModel::submit +392 (int (*)(...))QSqlTableModel::revert +400 (int (*)(...))QAbstractItemModel::resetInternalData +408 (int (*)(...))QSqlRelationalTableModel::clear +416 (int (*)(...))QSqlQueryModel::queryChange +424 (int (*)(...))QSqlTableModel::indexInQuery +432 (int (*)(...))QSqlRelationalTableModel::setTable +440 (int (*)(...))QSqlTableModel::setEditStrategy +448 (int (*)(...))QSqlTableModel::setSort +456 (int (*)(...))QSqlTableModel::setFilter +464 (int (*)(...))QSqlRelationalTableModel::revertRow +472 (int (*)(...))QSqlRelationalTableModel::select +480 (int (*)(...))QSqlTableModel::selectRow +488 (int (*)(...))QSqlRelationalTableModel::updateRowInTable +496 (int (*)(...))QSqlRelationalTableModel::insertRowIntoTable +504 (int (*)(...))QSqlTableModel::deleteRowFromTable +512 (int (*)(...))QSqlRelationalTableModel::orderByClause +520 (int (*)(...))QSqlRelationalTableModel::selectStatement +528 (int (*)(...))QSqlRelationalTableModel::setRelation +536 (int (*)(...))QSqlRelationalTableModel::relationModel + +Class QSqlRelationalTableModel + size=16 align=8 + base size=16 base align=8 +QSqlRelationalTableModel (0x0x7319a7a295b0) 0 + vptr=((& QSqlRelationalTableModel::_ZTV24QSqlRelationalTableModel) + 16) +QSqlTableModel (0x0x7319a7a29618) 0 + primary-for QSqlRelationalTableModel (0x0x7319a7a295b0) +QSqlQueryModel (0x0x7319a7a29680) 0 + primary-for QSqlTableModel (0x0x7319a7a29618) +QAbstractTableModel (0x0x7319a7a296e8) 0 + primary-for QSqlQueryModel (0x0x7319a7a29680) +QAbstractItemModel (0x0x7319a7a29750) 0 + primary-for QAbstractTableModel (0x0x7319a7a296e8) +QObject (0x0x7319a7a13f00) 0 + primary-for QAbstractItemModel (0x0x7319a7a29750) + +Vtable for QSqlResult +QSqlResult::_ZTV10QSqlResult: 33 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QSqlResult) +16 0 +24 0 +32 (int (*)(...))QSqlResult::handle +40 (int (*)(...))QSqlResult::setAt +48 (int (*)(...))QSqlResult::setActive +56 (int (*)(...))QSqlResult::setLastError +64 (int (*)(...))QSqlResult::setQuery +72 (int (*)(...))QSqlResult::setSelect +80 (int (*)(...))QSqlResult::setForwardOnly +88 (int (*)(...))QSqlResult::exec +96 (int (*)(...))QSqlResult::prepare +104 (int (*)(...))QSqlResult::savePrepare +112 (int (*)(...))QSqlResult::bindValue +120 (int (*)(...))QSqlResult::bindValue +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))__cxa_pure_virtual +160 (int (*)(...))QSqlResult::fetchNext +168 (int (*)(...))QSqlResult::fetchPrevious +176 (int (*)(...))__cxa_pure_virtual +184 (int (*)(...))__cxa_pure_virtual +192 (int (*)(...))__cxa_pure_virtual +200 (int (*)(...))__cxa_pure_virtual +208 (int (*)(...))QSqlResult::record +216 (int (*)(...))QSqlResult::lastInsertId +224 (int (*)(...))QSqlResult::virtual_hook +232 (int (*)(...))QSqlResult::execBatch +240 (int (*)(...))QSqlResult::detachFromResultSet +248 (int (*)(...))QSqlResult::setNumericalPrecisionPolicy +256 (int (*)(...))QSqlResult::nextResult + +Class QSqlResult + size=16 align=8 + base size=16 base align=8 +QSqlResult (0x0x7319a7a43120) 0 + vptr=((& QSqlResult::_ZTV10QSqlResult) + 16) + +Class QHelpGlobal + size=1 align=1 + base size=0 base align=1 +QHelpGlobal (0x0x7319a7a43240) 0 empty + +Class QCompressedHelpInfo + size=8 align=8 + base size=8 base align=8 +QCompressedHelpInfo (0x0x7319a7a432a0) 0 + +Class QHelpContentItem + size=8 align=8 + base size=8 base align=8 +QHelpContentItem (0x0x7319a7a436c0) 0 + +Class QHelpContentModel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QHelpContentModel::QPrivateSignal (0x0x7319a7a43780) 0 empty + +Vtable for QHelpContentModel +QHelpContentModel::_ZTV17QHelpContentModel: 51 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QHelpContentModel) +16 (int (*)(...))QHelpContentModel::metaObject +24 (int (*)(...))QHelpContentModel::qt_metacast +32 (int (*)(...))QHelpContentModel::qt_metacall +40 (int (*)(...))QHelpContentModel::~QHelpContentModel +48 (int (*)(...))QHelpContentModel::~QHelpContentModel +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QHelpContentModel::index +120 (int (*)(...))QHelpContentModel::parent +128 (int (*)(...))QAbstractItemModel::sibling +136 (int (*)(...))QHelpContentModel::rowCount +144 (int (*)(...))QHelpContentModel::columnCount +152 (int (*)(...))QAbstractItemModel::hasChildren +160 (int (*)(...))QHelpContentModel::data +168 (int (*)(...))QAbstractItemModel::setData +176 (int (*)(...))QAbstractItemModel::headerData +184 (int (*)(...))QAbstractItemModel::setHeaderData +192 (int (*)(...))QAbstractItemModel::itemData +200 (int (*)(...))QAbstractItemModel::setItemData +208 (int (*)(...))QAbstractItemModel::clearItemData +216 (int (*)(...))QAbstractItemModel::mimeTypes +224 (int (*)(...))QAbstractItemModel::mimeData +232 (int (*)(...))QAbstractItemModel::canDropMimeData +240 (int (*)(...))QAbstractItemModel::dropMimeData +248 (int (*)(...))QAbstractItemModel::supportedDropActions +256 (int (*)(...))QAbstractItemModel::supportedDragActions +264 (int (*)(...))QAbstractItemModel::insertRows +272 (int (*)(...))QAbstractItemModel::insertColumns +280 (int (*)(...))QAbstractItemModel::removeRows +288 (int (*)(...))QAbstractItemModel::removeColumns +296 (int (*)(...))QAbstractItemModel::moveRows +304 (int (*)(...))QAbstractItemModel::moveColumns +312 (int (*)(...))QAbstractItemModel::fetchMore +320 (int (*)(...))QAbstractItemModel::canFetchMore +328 (int (*)(...))QAbstractItemModel::flags +336 (int (*)(...))QAbstractItemModel::sort +344 (int (*)(...))QAbstractItemModel::buddy +352 (int (*)(...))QAbstractItemModel::match +360 (int (*)(...))QAbstractItemModel::span +368 (int (*)(...))QAbstractItemModel::roleNames +376 (int (*)(...))QAbstractItemModel::multiData +384 (int (*)(...))QAbstractItemModel::submit +392 (int (*)(...))QAbstractItemModel::revert +400 (int (*)(...))QAbstractItemModel::resetInternalData + +Class QHelpContentModel + size=24 align=8 + base size=24 base align=8 +QHelpContentModel (0x0x7319a7a299c0) 0 + vptr=((& QHelpContentModel::_ZTV17QHelpContentModel) + 16) +QAbstractItemModel (0x0x7319a7a29a28) 0 + primary-for QHelpContentModel (0x0x7319a7a299c0) +QObject (0x0x7319a7a43720) 0 + primary-for QAbstractItemModel (0x0x7319a7a29a28) + +Class QHelpContentWidget::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QHelpContentWidget::QPrivateSignal (0x0x7319a7a43900) 0 empty + +Vtable for QHelpContentWidget +QHelpContentWidget::_ZTV18QHelpContentWidget: 110 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QHelpContentWidget) +16 (int (*)(...))QHelpContentWidget::metaObject +24 (int (*)(...))QHelpContentWidget::qt_metacast +32 (int (*)(...))QHelpContentWidget::qt_metacall +40 (int (*)(...))QHelpContentWidget::~QHelpContentWidget +48 (int (*)(...))QHelpContentWidget::~QHelpContentWidget +56 (int (*)(...))QAbstractItemView::event +64 (int (*)(...))QAbstractItemView::eventFilter +72 (int (*)(...))QTreeView::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QAbstractScrollArea::sizeHint +136 (int (*)(...))QAbstractScrollArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QTreeView::mousePressEvent +176 (int (*)(...))QTreeView::mouseReleaseEvent +184 (int (*)(...))QTreeView::mouseDoubleClickEvent +192 (int (*)(...))QTreeView::mouseMoveEvent +200 (int (*)(...))QAbstractScrollArea::wheelEvent +208 (int (*)(...))QTreeView::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QAbstractItemView::focusInEvent +232 (int (*)(...))QAbstractItemView::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QTreeView::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QAbstractItemView::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QAbstractScrollArea::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QAbstractItemView::dragEnterEvent +320 (int (*)(...))QTreeView::dragMoveEvent +328 (int (*)(...))QAbstractItemView::dragLeaveEvent +336 (int (*)(...))QAbstractItemView::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QTreeView::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QAbstractItemView::inputMethodEvent +416 (int (*)(...))QAbstractItemView::inputMethodQuery +424 (int (*)(...))QAbstractItemView::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QAbstractScrollArea::setupViewport +448 (int (*)(...))QTreeView::viewportEvent +456 (int (*)(...))QTreeView::scrollContentsBy +464 (int (*)(...))QTreeView::viewportSizeHint +472 (int (*)(...))QTreeView::setModel +480 (int (*)(...))QTreeView::setSelectionModel +488 (int (*)(...))QTreeView::keyboardSearch +496 (int (*)(...))QTreeView::visualRect +504 (int (*)(...))QTreeView::scrollTo +512 (int (*)(...))QTreeView::indexAt +520 (int (*)(...))QAbstractItemView::sizeHintForRow +528 (int (*)(...))QTreeView::sizeHintForColumn +536 (int (*)(...))QAbstractItemView::itemDelegateForIndex +544 (int (*)(...))QTreeView::reset +552 (int (*)(...))QTreeView::setRootIndex +560 (int (*)(...))QTreeView::doItemsLayout +568 (int (*)(...))QTreeView::selectAll +576 (int (*)(...))QTreeView::dataChanged +584 (int (*)(...))QTreeView::rowsInserted +592 (int (*)(...))QTreeView::rowsAboutToBeRemoved +600 (int (*)(...))QTreeView::selectionChanged +608 (int (*)(...))QTreeView::currentChanged +616 (int (*)(...))QAbstractItemView::updateEditorData +624 (int (*)(...))QAbstractItemView::updateEditorGeometries +632 (int (*)(...))QTreeView::updateGeometries +640 (int (*)(...))QAbstractItemView::verticalScrollbarAction +648 (int (*)(...))QTreeView::horizontalScrollbarAction +656 (int (*)(...))QTreeView::verticalScrollbarValueChanged +664 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged +672 (int (*)(...))QAbstractItemView::closeEditor +680 (int (*)(...))QAbstractItemView::commitData +688 (int (*)(...))QAbstractItemView::editorDestroyed +696 (int (*)(...))QTreeView::moveCursor +704 (int (*)(...))QTreeView::horizontalOffset +712 (int (*)(...))QTreeView::verticalOffset +720 (int (*)(...))QTreeView::isIndexHidden +728 (int (*)(...))QTreeView::setSelection +736 (int (*)(...))QTreeView::visualRegionForSelection +744 (int (*)(...))QTreeView::selectedIndexes +752 (int (*)(...))QAbstractItemView::edit +760 (int (*)(...))QAbstractItemView::selectionCommand +768 (int (*)(...))QAbstractItemView::startDrag +776 (int (*)(...))QAbstractItemView::initViewItemOption +784 (int (*)(...))QTreeView::drawRow +792 (int (*)(...))QTreeView::drawBranches +800 (int (*)(...))-16 +808 (int (*)(...))(& _ZTI18QHelpContentWidget) +816 (int (*)(...))QHelpContentWidget::_ZThn16_N18QHelpContentWidgetD1Ev +824 (int (*)(...))QHelpContentWidget::_ZThn16_N18QHelpContentWidgetD0Ev +832 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +840 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +848 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +856 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +864 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +872 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QHelpContentWidget + size=64 align=8 + base size=64 base align=8 +QHelpContentWidget (0x0x7319a7a29a90) 0 + vptr=((& QHelpContentWidget::_ZTV18QHelpContentWidget) + 16) +QTreeView (0x0x7319a7a29af8) 0 + primary-for QHelpContentWidget (0x0x7319a7a29a90) +QAbstractItemView (0x0x7319a7a29b60) 0 + primary-for QTreeView (0x0x7319a7a29af8) +QAbstractScrollArea (0x0x7319a7a29bc8) 0 + primary-for QAbstractItemView (0x0x7319a7a29b60) +QFrame (0x0x7319a7a29c30) 0 + primary-for QAbstractScrollArea (0x0x7319a7a29bc8) +QWidget (0x0x7319a7a748c0) 0 + primary-for QFrame (0x0x7319a7a29c30) +QObject (0x0x7319a7a43840) 0 + primary-for QWidget (0x0x7319a7a748c0) +QPaintDevice (0x0x7319a7a438a0) 16 + vptr=((& QHelpContentWidget::_ZTV18QHelpContentWidget) + 816) + +Class QHelpEngineCore::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QHelpEngineCore::QPrivateSignal (0x0x7319a7a43a20) 0 empty + +Vtable for QHelpEngineCore +QHelpEngineCore::_ZTV15QHelpEngineCore: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QHelpEngineCore) +16 (int (*)(...))QHelpEngineCore::metaObject +24 (int (*)(...))QHelpEngineCore::qt_metacast +32 (int (*)(...))QHelpEngineCore::qt_metacall +40 (int (*)(...))QHelpEngineCore::~QHelpEngineCore +48 (int (*)(...))QHelpEngineCore::~QHelpEngineCore +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QHelpEngineCore + size=24 align=8 + base size=24 base align=8 +QHelpEngineCore (0x0x7319a7a29c98) 0 + vptr=((& QHelpEngineCore::_ZTV15QHelpEngineCore) + 16) +QObject (0x0x7319a7a439c0) 0 + primary-for QHelpEngineCore (0x0x7319a7a29c98) + +Class QHelpEngine::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QHelpEngine::QPrivateSignal (0x0x7319a7a43b40) 0 empty + +Vtable for QHelpEngine +QHelpEngine::_ZTV11QHelpEngine: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QHelpEngine) +16 (int (*)(...))QHelpEngine::metaObject +24 (int (*)(...))QHelpEngine::qt_metacast +32 (int (*)(...))QHelpEngine::qt_metacall +40 (int (*)(...))QHelpEngine::~QHelpEngine +48 (int (*)(...))QHelpEngine::~QHelpEngine +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QHelpEngine + size=32 align=8 + base size=32 base align=8 +QHelpEngine (0x0x7319a7a29d00) 0 + vptr=((& QHelpEngine::_ZTV11QHelpEngine) + 16) +QHelpEngineCore (0x0x7319a7a29d68) 0 + primary-for QHelpEngine (0x0x7319a7a29d00) +QObject (0x0x7319a7a43ae0) 0 + primary-for QHelpEngineCore (0x0x7319a7a29d68) + +Class QHelpFilterData + size=8 align=8 + base size=8 base align=8 +QHelpFilterData (0x0x7319a7a43c00) 0 + +Class QHelpFilterEngine::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QHelpFilterEngine::QPrivateSignal (0x0x7319a7b2d0c0) 0 empty + +Vtable for QHelpFilterEngine +QHelpFilterEngine::_ZTV17QHelpFilterEngine: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QHelpFilterEngine) +16 (int (*)(...))QHelpFilterEngine::metaObject +24 (int (*)(...))QHelpFilterEngine::qt_metacast +32 (int (*)(...))QHelpFilterEngine::qt_metacall +40 (int (*)(...))QHelpFilterEngine::~QHelpFilterEngine +48 (int (*)(...))QHelpFilterEngine::~QHelpFilterEngine +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QHelpFilterEngine + size=24 align=8 + base size=24 base align=8 +QHelpFilterEngine (0x0x7319a7a298f0) 0 + vptr=((& QHelpFilterEngine::_ZTV17QHelpFilterEngine) + 16) +QObject (0x0x7319a7b2d060) 0 + primary-for QHelpFilterEngine (0x0x7319a7a298f0) + +Class QHelpFilterSettingsWidget::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QHelpFilterSettingsWidget::QPrivateSignal (0x0x7319a7b2d240) 0 empty + +Vtable for QHelpFilterSettingsWidget +QHelpFilterSettingsWidget::_ZTV25QHelpFilterSettingsWidget: 64 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI25QHelpFilterSettingsWidget) +16 (int (*)(...))QHelpFilterSettingsWidget::metaObject +24 (int (*)(...))QHelpFilterSettingsWidget::qt_metacast +32 (int (*)(...))QHelpFilterSettingsWidget::qt_metacall +40 (int (*)(...))QHelpFilterSettingsWidget::~QHelpFilterSettingsWidget +48 (int (*)(...))QHelpFilterSettingsWidget::~QHelpFilterSettingsWidget +56 (int (*)(...))QWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))-16 +440 (int (*)(...))(& _ZTI25QHelpFilterSettingsWidget) +448 (int (*)(...))QHelpFilterSettingsWidget::_ZThn16_N25QHelpFilterSettingsWidgetD1Ev +456 (int (*)(...))QHelpFilterSettingsWidget::_ZThn16_N25QHelpFilterSettingsWidgetD0Ev +464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QHelpFilterSettingsWidget + size=48 align=8 + base size=48 base align=8 +QHelpFilterSettingsWidget (0x0x7319a7a29f08) 0 + vptr=((& QHelpFilterSettingsWidget::_ZTV25QHelpFilterSettingsWidget) + 16) +QWidget (0x0x7319a7b14380) 0 + primary-for QHelpFilterSettingsWidget (0x0x7319a7a29f08) +QObject (0x0x7319a7b2d180) 0 + primary-for QWidget (0x0x7319a7b14380) +QPaintDevice (0x0x7319a7b2d1e0) 16 + vptr=((& QHelpFilterSettingsWidget::_ZTV25QHelpFilterSettingsWidget) + 448) + +Class QHelpIndexModel::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QHelpIndexModel::QPrivateSignal (0x0x7319a7b2d4e0) 0 empty + +Vtable for QHelpIndexModel +QHelpIndexModel::_ZTV15QHelpIndexModel: 51 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QHelpIndexModel) +16 (int (*)(...))QHelpIndexModel::metaObject +24 (int (*)(...))QHelpIndexModel::qt_metacast +32 (int (*)(...))QHelpIndexModel::qt_metacall +40 (int (*)(...))QHelpIndexModel::~QHelpIndexModel +48 (int (*)(...))QHelpIndexModel::~QHelpIndexModel +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QAbstractListModel::index +120 (int (*)(...))QAbstractListModel::parent +128 (int (*)(...))QStringListModel::sibling +136 (int (*)(...))QStringListModel::rowCount +144 (int (*)(...))QAbstractListModel::columnCount +152 (int (*)(...))QAbstractListModel::hasChildren +160 (int (*)(...))QStringListModel::data +168 (int (*)(...))QStringListModel::setData +176 (int (*)(...))QAbstractItemModel::headerData +184 (int (*)(...))QAbstractItemModel::setHeaderData +192 (int (*)(...))QStringListModel::itemData +200 (int (*)(...))QStringListModel::setItemData +208 (int (*)(...))QStringListModel::clearItemData +216 (int (*)(...))QAbstractItemModel::mimeTypes +224 (int (*)(...))QAbstractItemModel::mimeData +232 (int (*)(...))QAbstractItemModel::canDropMimeData +240 (int (*)(...))QAbstractListModel::dropMimeData +248 (int (*)(...))QStringListModel::supportedDropActions +256 (int (*)(...))QAbstractItemModel::supportedDragActions +264 (int (*)(...))QStringListModel::insertRows +272 (int (*)(...))QAbstractItemModel::insertColumns +280 (int (*)(...))QStringListModel::removeRows +288 (int (*)(...))QAbstractItemModel::removeColumns +296 (int (*)(...))QStringListModel::moveRows +304 (int (*)(...))QAbstractItemModel::moveColumns +312 (int (*)(...))QAbstractItemModel::fetchMore +320 (int (*)(...))QAbstractItemModel::canFetchMore +328 (int (*)(...))QStringListModel::flags +336 (int (*)(...))QStringListModel::sort +344 (int (*)(...))QAbstractItemModel::buddy +352 (int (*)(...))QAbstractItemModel::match +360 (int (*)(...))QAbstractItemModel::span +368 (int (*)(...))QAbstractItemModel::roleNames +376 (int (*)(...))QAbstractItemModel::multiData +384 (int (*)(...))QAbstractItemModel::submit +392 (int (*)(...))QAbstractItemModel::revert +400 (int (*)(...))QAbstractItemModel::resetInternalData + +Class QHelpIndexModel + size=48 align=8 + base size=48 base align=8 +QHelpIndexModel (0x0x7319a7b57000) 0 + vptr=((& QHelpIndexModel::_ZTV15QHelpIndexModel) + 16) +QStringListModel (0x0x7319a7b57068) 0 + primary-for QHelpIndexModel (0x0x7319a7b57000) +QAbstractListModel (0x0x7319a7b570d0) 0 + primary-for QStringListModel (0x0x7319a7b57068) +QAbstractItemModel (0x0x7319a7b57138) 0 + primary-for QAbstractListModel (0x0x7319a7b570d0) +QObject (0x0x7319a7b2d480) 0 + primary-for QAbstractItemModel (0x0x7319a7b57138) + +Class QHelpIndexWidget::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QHelpIndexWidget::QPrivateSignal (0x0x7319a7b2d660) 0 empty + +Vtable for QHelpIndexWidget +QHelpIndexWidget::_ZTV16QHelpIndexWidget: 108 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI16QHelpIndexWidget) +16 (int (*)(...))QHelpIndexWidget::metaObject +24 (int (*)(...))QHelpIndexWidget::qt_metacast +32 (int (*)(...))QHelpIndexWidget::qt_metacall +40 (int (*)(...))QHelpIndexWidget::~QHelpIndexWidget +48 (int (*)(...))QHelpIndexWidget::~QHelpIndexWidget +56 (int (*)(...))QListView::event +64 (int (*)(...))QAbstractItemView::eventFilter +72 (int (*)(...))QListView::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QAbstractScrollArea::sizeHint +136 (int (*)(...))QAbstractScrollArea::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QAbstractItemView::mousePressEvent +176 (int (*)(...))QListView::mouseReleaseEvent +184 (int (*)(...))QAbstractItemView::mouseDoubleClickEvent +192 (int (*)(...))QListView::mouseMoveEvent +200 (int (*)(...))QListView::wheelEvent +208 (int (*)(...))QAbstractItemView::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QAbstractItemView::focusInEvent +232 (int (*)(...))QAbstractItemView::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QListView::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QListView::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QAbstractScrollArea::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QAbstractItemView::dragEnterEvent +320 (int (*)(...))QListView::dragMoveEvent +328 (int (*)(...))QListView::dragLeaveEvent +336 (int (*)(...))QListView::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QFrame::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QAbstractItemView::inputMethodEvent +416 (int (*)(...))QAbstractItemView::inputMethodQuery +424 (int (*)(...))QAbstractItemView::focusNextPrevChild +432 (int (*)(...))QFrame::initStyleOption +440 (int (*)(...))QAbstractScrollArea::setupViewport +448 (int (*)(...))QAbstractItemView::viewportEvent +456 (int (*)(...))QListView::scrollContentsBy +464 (int (*)(...))QListView::viewportSizeHint +472 (int (*)(...))QAbstractItemView::setModel +480 (int (*)(...))QAbstractItemView::setSelectionModel +488 (int (*)(...))QAbstractItemView::keyboardSearch +496 (int (*)(...))QListView::visualRect +504 (int (*)(...))QListView::scrollTo +512 (int (*)(...))QListView::indexAt +520 (int (*)(...))QAbstractItemView::sizeHintForRow +528 (int (*)(...))QAbstractItemView::sizeHintForColumn +536 (int (*)(...))QAbstractItemView::itemDelegateForIndex +544 (int (*)(...))QListView::reset +552 (int (*)(...))QListView::setRootIndex +560 (int (*)(...))QListView::doItemsLayout +568 (int (*)(...))QAbstractItemView::selectAll +576 (int (*)(...))QListView::dataChanged +584 (int (*)(...))QListView::rowsInserted +592 (int (*)(...))QListView::rowsAboutToBeRemoved +600 (int (*)(...))QListView::selectionChanged +608 (int (*)(...))QListView::currentChanged +616 (int (*)(...))QAbstractItemView::updateEditorData +624 (int (*)(...))QAbstractItemView::updateEditorGeometries +632 (int (*)(...))QListView::updateGeometries +640 (int (*)(...))QAbstractItemView::verticalScrollbarAction +648 (int (*)(...))QAbstractItemView::horizontalScrollbarAction +656 (int (*)(...))QAbstractItemView::verticalScrollbarValueChanged +664 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged +672 (int (*)(...))QAbstractItemView::closeEditor +680 (int (*)(...))QAbstractItemView::commitData +688 (int (*)(...))QAbstractItemView::editorDestroyed +696 (int (*)(...))QListView::moveCursor +704 (int (*)(...))QListView::horizontalOffset +712 (int (*)(...))QListView::verticalOffset +720 (int (*)(...))QListView::isIndexHidden +728 (int (*)(...))QListView::setSelection +736 (int (*)(...))QListView::visualRegionForSelection +744 (int (*)(...))QListView::selectedIndexes +752 (int (*)(...))QAbstractItemView::edit +760 (int (*)(...))QAbstractItemView::selectionCommand +768 (int (*)(...))QListView::startDrag +776 (int (*)(...))QListView::initViewItemOption +784 (int (*)(...))-16 +792 (int (*)(...))(& _ZTI16QHelpIndexWidget) +800 (int (*)(...))QHelpIndexWidget::_ZThn16_N16QHelpIndexWidgetD1Ev +808 (int (*)(...))QHelpIndexWidget::_ZThn16_N16QHelpIndexWidgetD0Ev +816 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +824 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +832 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +840 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +848 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +856 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QHelpIndexWidget + size=40 align=8 + base size=40 base align=8 +QHelpIndexWidget (0x0x7319a7b571a0) 0 + vptr=((& QHelpIndexWidget::_ZTV16QHelpIndexWidget) + 16) +QListView (0x0x7319a7b57208) 0 + primary-for QHelpIndexWidget (0x0x7319a7b571a0) +QAbstractItemView (0x0x7319a7b57270) 0 + primary-for QListView (0x0x7319a7b57208) +QAbstractScrollArea (0x0x7319a7b572d8) 0 + primary-for QAbstractItemView (0x0x7319a7b57270) +QFrame (0x0x7319a7b57340) 0 + primary-for QAbstractScrollArea (0x0x7319a7b572d8) +QWidget (0x0x7319a7b145b0) 0 + primary-for QFrame (0x0x7319a7b57340) +QObject (0x0x7319a7b2d5a0) 0 + primary-for QWidget (0x0x7319a7b145b0) +QPaintDevice (0x0x7319a7b2d600) 16 + vptr=((& QHelpIndexWidget::_ZTV16QHelpIndexWidget) + 800) + +Class QHelpLink + size=32 align=8 + base size=32 base align=8 +QHelpLink (0x0x7319a7b2d720) 0 + +Class QHelpSearchResult + size=8 align=8 + base size=8 base align=8 +QHelpSearchResult (0x0x7319a7b2d780) 0 + +Class QHelpSearchQuery + size=32 align=8 + base size=32 base align=8 +QHelpSearchQuery (0x0x7319a7b2db40) 0 + +Class QHelpSearchEngine::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QHelpSearchEngine::QPrivateSignal (0x0x7319a7bbe0c0) 0 empty + +Vtable for QHelpSearchEngine +QHelpSearchEngine::_ZTV17QHelpSearchEngine: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QHelpSearchEngine) +16 (int (*)(...))QHelpSearchEngine::metaObject +24 (int (*)(...))QHelpSearchEngine::qt_metacast +32 (int (*)(...))QHelpSearchEngine::qt_metacall +40 (int (*)(...))QHelpSearchEngine::~QHelpSearchEngine +48 (int (*)(...))QHelpSearchEngine::~QHelpSearchEngine +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QHelpSearchEngine + size=24 align=8 + base size=24 base align=8 +QHelpSearchEngine (0x0x7319a7b575b0) 0 + vptr=((& QHelpSearchEngine::_ZTV17QHelpSearchEngine) + 16) +QObject (0x0x7319a7bbe060) 0 + primary-for QHelpSearchEngine (0x0x7319a7b575b0) + +Class QHelpSearchEngineCore::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QHelpSearchEngineCore::QPrivateSignal (0x0x7319a7bbe1e0) 0 empty + +Vtable for QHelpSearchEngineCore +QHelpSearchEngineCore::_ZTV21QHelpSearchEngineCore: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI21QHelpSearchEngineCore) +16 (int (*)(...))QHelpSearchEngineCore::metaObject +24 (int (*)(...))QHelpSearchEngineCore::qt_metacast +32 (int (*)(...))QHelpSearchEngineCore::qt_metacall +40 (int (*)(...))QHelpSearchEngineCore::~QHelpSearchEngineCore +48 (int (*)(...))QHelpSearchEngineCore::~QHelpSearchEngineCore +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QHelpSearchEngineCore + size=16 align=8 + base size=16 base align=8 +QHelpSearchEngineCore (0x0x7319a7b57618) 0 + vptr=((& QHelpSearchEngineCore::_ZTV21QHelpSearchEngineCore) + 16) +QObject (0x0x7319a7bbe180) 0 + primary-for QHelpSearchEngineCore (0x0x7319a7b57618) + +Class QHelpSearchQueryWidget::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QHelpSearchQueryWidget::QPrivateSignal (0x0x7319a7bbe420) 0 empty + +Vtable for QHelpSearchQueryWidget +QHelpSearchQueryWidget::_ZTV22QHelpSearchQueryWidget: 64 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI22QHelpSearchQueryWidget) +16 (int (*)(...))QHelpSearchQueryWidget::metaObject +24 (int (*)(...))QHelpSearchQueryWidget::qt_metacast +32 (int (*)(...))QHelpSearchQueryWidget::qt_metacall +40 (int (*)(...))QHelpSearchQueryWidget::~QHelpSearchQueryWidget +48 (int (*)(...))QHelpSearchQueryWidget::~QHelpSearchQueryWidget +56 (int (*)(...))QWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QHelpSearchQueryWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QHelpSearchQueryWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))-16 +440 (int (*)(...))(& _ZTI22QHelpSearchQueryWidget) +448 (int (*)(...))QHelpSearchQueryWidget::_ZThn16_N22QHelpSearchQueryWidgetD1Ev +456 (int (*)(...))QHelpSearchQueryWidget::_ZThn16_N22QHelpSearchQueryWidgetD0Ev +464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QHelpSearchQueryWidget + size=48 align=8 + base size=48 base align=8 +QHelpSearchQueryWidget (0x0x7319a7b57680) 0 + vptr=((& QHelpSearchQueryWidget::_ZTV22QHelpSearchQueryWidget) + 16) +QWidget (0x0x7319a7bb9770) 0 + primary-for QHelpSearchQueryWidget (0x0x7319a7b57680) +QObject (0x0x7319a7bbe360) 0 + primary-for QWidget (0x0x7319a7bb9770) +QPaintDevice (0x0x7319a7bbe3c0) 16 + vptr=((& QHelpSearchQueryWidget::_ZTV22QHelpSearchQueryWidget) + 448) + +Class QHelpSearchResultWidget::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QHelpSearchResultWidget::QPrivateSignal (0x0x7319a7bbe5a0) 0 empty + +Vtable for QHelpSearchResultWidget +QHelpSearchResultWidget::_ZTV23QHelpSearchResultWidget: 64 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI23QHelpSearchResultWidget) +16 (int (*)(...))QHelpSearchResultWidget::metaObject +24 (int (*)(...))QHelpSearchResultWidget::qt_metacast +32 (int (*)(...))QHelpSearchResultWidget::qt_metacall +40 (int (*)(...))QHelpSearchResultWidget::~QHelpSearchResultWidget +48 (int (*)(...))QHelpSearchResultWidget::~QHelpSearchResultWidget +56 (int (*)(...))QWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QHelpSearchResultWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))-16 +440 (int (*)(...))(& _ZTI23QHelpSearchResultWidget) +448 (int (*)(...))QHelpSearchResultWidget::_ZThn16_N23QHelpSearchResultWidgetD1Ev +456 (int (*)(...))QHelpSearchResultWidget::_ZThn16_N23QHelpSearchResultWidgetD0Ev +464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QHelpSearchResultWidget + size=48 align=8 + base size=48 base align=8 +QHelpSearchResultWidget (0x0x7319a7b576e8) 0 + vptr=((& QHelpSearchResultWidget::_ZTV23QHelpSearchResultWidget) + 16) +QWidget (0x0x7319a7bb9850) 0 + primary-for QHelpSearchResultWidget (0x0x7319a7b576e8) +QObject (0x0x7319a7bbe4e0) 0 + primary-for QWidget (0x0x7319a7bb9850) +QPaintDevice (0x0x7319a7bbe540) 16 + vptr=((& QHelpSearchResultWidget::_ZTV23QHelpSearchResultWidget) + 448) + +Class QHttpHeaders + size=8 align=8 + base size=8 base align=8 +QHttpHeaders (0x0x7319a7bbe9c0) 0 + +Class QNetworkRequest + size=8 align=8 + base size=8 base align=8 +QNetworkRequest (0x0x7319a787fb40) 0 + +Class QNetworkCacheMetaData + size=8 align=8 + base size=8 base align=8 +QNetworkCacheMetaData (0x0x7319a7991300) 0 + +Class QAbstractNetworkCache::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAbstractNetworkCache::QPrivateSignal (0x0x7319a76124e0) 0 empty + +Vtable for QAbstractNetworkCache +QAbstractNetworkCache::_ZTV21QAbstractNetworkCache: 22 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI21QAbstractNetworkCache) +16 (int (*)(...))QAbstractNetworkCache::metaObject +24 (int (*)(...))QAbstractNetworkCache::qt_metacast +32 (int (*)(...))QAbstractNetworkCache::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))__cxa_pure_virtual +160 (int (*)(...))__cxa_pure_virtual +168 (int (*)(...))__cxa_pure_virtual + +Class QAbstractNetworkCache + size=16 align=8 + base size=16 base align=8 +QAbstractNetworkCache (0x0x7319a76192d8) 0 + vptr=((& QAbstractNetworkCache::_ZTV21QAbstractNetworkCache) + 16) +QObject (0x0x7319a7612480) 0 + primary-for QAbstractNetworkCache (0x0x7319a76192d8) + +Class QAbstractSocket::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAbstractSocket::QPrivateSignal (0x0x7319a7612720) 0 empty + +Vtable for QAbstractSocket +QAbstractSocket::_ZTV15QAbstractSocket: 42 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QAbstractSocket) +16 (int (*)(...))QAbstractSocket::metaObject +24 (int (*)(...))QAbstractSocket::qt_metacast +32 (int (*)(...))QAbstractSocket::qt_metacall +40 (int (*)(...))QAbstractSocket::~QAbstractSocket +48 (int (*)(...))QAbstractSocket::~QAbstractSocket +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QAbstractSocket::isSequential +120 (int (*)(...))QIODevice::open +128 (int (*)(...))QAbstractSocket::close +136 (int (*)(...))QIODevice::pos +144 (int (*)(...))QIODevice::size +152 (int (*)(...))QIODevice::seek +160 (int (*)(...))QIODevice::atEnd +168 (int (*)(...))QIODevice::reset +176 (int (*)(...))QAbstractSocket::bytesAvailable +184 (int (*)(...))QAbstractSocket::bytesToWrite +192 (int (*)(...))QIODevice::canReadLine +200 (int (*)(...))QAbstractSocket::waitForReadyRead +208 (int (*)(...))QAbstractSocket::waitForBytesWritten +216 (int (*)(...))QAbstractSocket::readData +224 (int (*)(...))QAbstractSocket::readLineData +232 (int (*)(...))QAbstractSocket::skipData +240 (int (*)(...))QAbstractSocket::writeData +248 (int (*)(...))QAbstractSocket::resume +256 (int (*)(...))QAbstractSocket::bind +264 (int (*)(...))QAbstractSocket::connectToHost +272 (int (*)(...))QAbstractSocket::disconnectFromHost +280 (int (*)(...))QAbstractSocket::setReadBufferSize +288 (int (*)(...))QAbstractSocket::socketDescriptor +296 (int (*)(...))QAbstractSocket::setSocketDescriptor +304 (int (*)(...))QAbstractSocket::setSocketOption +312 (int (*)(...))QAbstractSocket::socketOption +320 (int (*)(...))QAbstractSocket::waitForConnected +328 (int (*)(...))QAbstractSocket::waitForDisconnected + +Class QAbstractSocket + size=16 align=8 + base size=16 base align=8 +QAbstractSocket (0x0x7319a7619340) 0 + vptr=((& QAbstractSocket::_ZTV15QAbstractSocket) + 16) +QIODevice (0x0x7319a762c070) 0 + primary-for QAbstractSocket (0x0x7319a7619340) +QObject (0x0x7319a7612660) 0 + primary-for QIODevice (0x0x7319a762c070) +QIODeviceBase (0x0x7319a76126c0) 0 empty + +Class QAuthenticator + size=8 align=8 + base size=8 base align=8 +QAuthenticator (0x0x7319a7774300) 0 + +Class QDnsDomainNameRecord + size=8 align=8 + base size=8 base align=8 +QDnsDomainNameRecord (0x0x7319a7774720) 0 + +Class QDnsHostAddressRecord + size=8 align=8 + base size=8 base align=8 +QDnsHostAddressRecord (0x0x7319a7434840) 0 + +Class QDnsMailExchangeRecord + size=8 align=8 + base size=8 base align=8 +QDnsMailExchangeRecord (0x0x7319a74b0960) 0 + +Class QDnsServiceRecord + size=8 align=8 + base size=8 base align=8 +QDnsServiceRecord (0x0x7319a7530a80) 0 + +Class QDnsTextRecord + size=8 align=8 + base size=8 base align=8 +QDnsTextRecord (0x0x7319a75c5060) 0 + +Class QDnsTlsAssociationRecord + size=8 align=8 + base size=8 base align=8 +QDnsTlsAssociationRecord (0x0x7319a722f7e0) 0 + +Class QDnsLookup::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDnsLookup::QPrivateSignal (0x0x7319a7280660) 0 empty + +Vtable for QDnsLookup +QDnsLookup::_ZTV10QDnsLookup: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QDnsLookup) +16 (int (*)(...))QDnsLookup::metaObject +24 (int (*)(...))QDnsLookup::qt_metacast +32 (int (*)(...))QDnsLookup::qt_metacall +40 (int (*)(...))QDnsLookup::~QDnsLookup +48 (int (*)(...))QDnsLookup::~QDnsLookup +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QDnsLookup + size=16 align=8 + base size=16 base align=8 +QDnsLookup (0x0x7319a727ce38) 0 + vptr=((& QDnsLookup::_ZTV10QDnsLookup) + 16) +QObject (0x0x7319a7280600) 0 + primary-for QDnsLookup (0x0x7319a727ce38) + +Class QIPv6Address + size=16 align=1 + base size=16 base align=1 +QIPv6Address (0x0x7319a7280de0) 0 + +Class QHostAddress + size=8 align=8 + base size=8 base align=8 +QHostAddress (0x0x7319a7280f00) 0 + +Class QTcpSocket::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTcpSocket::QPrivateSignal (0x0x7319a739e540) 0 empty + +Vtable for QTcpSocket +QTcpSocket::_ZTV10QTcpSocket: 42 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QTcpSocket) +16 (int (*)(...))QTcpSocket::metaObject +24 (int (*)(...))QTcpSocket::qt_metacast +32 (int (*)(...))QTcpSocket::qt_metacall +40 (int (*)(...))QTcpSocket::~QTcpSocket +48 (int (*)(...))QTcpSocket::~QTcpSocket +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QAbstractSocket::isSequential +120 (int (*)(...))QIODevice::open +128 (int (*)(...))QAbstractSocket::close +136 (int (*)(...))QIODevice::pos +144 (int (*)(...))QIODevice::size +152 (int (*)(...))QIODevice::seek +160 (int (*)(...))QIODevice::atEnd +168 (int (*)(...))QIODevice::reset +176 (int (*)(...))QAbstractSocket::bytesAvailable +184 (int (*)(...))QAbstractSocket::bytesToWrite +192 (int (*)(...))QIODevice::canReadLine +200 (int (*)(...))QAbstractSocket::waitForReadyRead +208 (int (*)(...))QAbstractSocket::waitForBytesWritten +216 (int (*)(...))QAbstractSocket::readData +224 (int (*)(...))QAbstractSocket::readLineData +232 (int (*)(...))QAbstractSocket::skipData +240 (int (*)(...))QAbstractSocket::writeData +248 (int (*)(...))QAbstractSocket::resume +256 (int (*)(...))QAbstractSocket::bind +264 (int (*)(...))QAbstractSocket::connectToHost +272 (int (*)(...))QAbstractSocket::disconnectFromHost +280 (int (*)(...))QAbstractSocket::setReadBufferSize +288 (int (*)(...))QAbstractSocket::socketDescriptor +296 (int (*)(...))QAbstractSocket::setSocketDescriptor +304 (int (*)(...))QAbstractSocket::setSocketOption +312 (int (*)(...))QAbstractSocket::socketOption +320 (int (*)(...))QAbstractSocket::waitForConnected +328 (int (*)(...))QAbstractSocket::waitForDisconnected + +Class QTcpSocket + size=16 align=8 + base size=16 base align=8 +QTcpSocket (0x0x7319a7399a28) 0 + vptr=((& QTcpSocket::_ZTV10QTcpSocket) + 16) +QAbstractSocket (0x0x7319a7399a90) 0 + primary-for QTcpSocket (0x0x7319a7399a28) +QIODevice (0x0x7319a72fcd90) 0 + primary-for QAbstractSocket (0x0x7319a7399a90) +QObject (0x0x7319a739e480) 0 + primary-for QIODevice (0x0x7319a72fcd90) +QIODeviceBase (0x0x7319a739e4e0) 0 empty + +Class QSslCertificate + size=8 align=8 + base size=8 base align=8 +QSslCertificate (0x0x7319a73d6840) 0 + +Class QSslError + size=8 align=8 + base size=8 base align=8 +QSslError (0x0x7319a70c86c0) 0 + +Class QSslSocket::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSslSocket::QPrivateSignal (0x0x7319a6f170c0) 0 empty + +Vtable for QSslSocket +QSslSocket::_ZTV10QSslSocket: 42 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QSslSocket) +16 (int (*)(...))QSslSocket::metaObject +24 (int (*)(...))QSslSocket::qt_metacast +32 (int (*)(...))QSslSocket::qt_metacall +40 (int (*)(...))QSslSocket::~QSslSocket +48 (int (*)(...))QSslSocket::~QSslSocket +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QAbstractSocket::isSequential +120 (int (*)(...))QIODevice::open +128 (int (*)(...))QSslSocket::close +136 (int (*)(...))QIODevice::pos +144 (int (*)(...))QIODevice::size +152 (int (*)(...))QIODevice::seek +160 (int (*)(...))QSslSocket::atEnd +168 (int (*)(...))QIODevice::reset +176 (int (*)(...))QSslSocket::bytesAvailable +184 (int (*)(...))QSslSocket::bytesToWrite +192 (int (*)(...))QSslSocket::canReadLine +200 (int (*)(...))QSslSocket::waitForReadyRead +208 (int (*)(...))QSslSocket::waitForBytesWritten +216 (int (*)(...))QSslSocket::readData +224 (int (*)(...))QAbstractSocket::readLineData +232 (int (*)(...))QSslSocket::skipData +240 (int (*)(...))QSslSocket::writeData +248 (int (*)(...))QSslSocket::resume +256 (int (*)(...))QAbstractSocket::bind +264 (int (*)(...))QSslSocket::connectToHost +272 (int (*)(...))QSslSocket::disconnectFromHost +280 (int (*)(...))QSslSocket::setReadBufferSize +288 (int (*)(...))QAbstractSocket::socketDescriptor +296 (int (*)(...))QSslSocket::setSocketDescriptor +304 (int (*)(...))QSslSocket::setSocketOption +312 (int (*)(...))QSslSocket::socketOption +320 (int (*)(...))QSslSocket::waitForConnected +328 (int (*)(...))QSslSocket::waitForDisconnected + +Class QSslSocket + size=16 align=8 + base size=16 base align=8 +QSslSocket (0x0x7319a6efbb60) 0 + vptr=((& QSslSocket::_ZTV10QSslSocket) + 16) +QTcpSocket (0x0x7319a6efbbc8) 0 + primary-for QSslSocket (0x0x7319a6efbb60) +QAbstractSocket (0x0x7319a6efbc30) 0 + primary-for QTcpSocket (0x0x7319a6efbbc8) +QIODevice (0x0x7319a6f08070) 0 + primary-for QAbstractSocket (0x0x7319a6efbc30) +QObject (0x0x7319a6f17000) 0 + primary-for QIODevice (0x0x7319a6f08070) +QIODeviceBase (0x0x7319a6f17060) 0 empty + +Class QDtlsClientVerifier::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDtlsClientVerifier::QPrivateSignal (0x0x7319a6f17420) 0 empty + +Class QDtlsClientVerifier::GeneratorParameters + size=32 align=8 + base size=32 base align=8 +QDtlsClientVerifier::GeneratorParameters (0x0x7319a6f17480) 0 + +Vtable for QDtlsClientVerifier +QDtlsClientVerifier::_ZTV19QDtlsClientVerifier: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QDtlsClientVerifier) +16 (int (*)(...))QDtlsClientVerifier::metaObject +24 (int (*)(...))QDtlsClientVerifier::qt_metacast +32 (int (*)(...))QDtlsClientVerifier::qt_metacall +40 (int (*)(...))QDtlsClientVerifier::~QDtlsClientVerifier +48 (int (*)(...))QDtlsClientVerifier::~QDtlsClientVerifier +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QDtlsClientVerifier + size=16 align=8 + base size=16 base align=8 +QDtlsClientVerifier (0x0x7319a6efbc98) 0 + vptr=((& QDtlsClientVerifier::_ZTV19QDtlsClientVerifier) + 16) +QObject (0x0x7319a6f173c0) 0 + primary-for QDtlsClientVerifier (0x0x7319a6efbc98) + +Class QDtls::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QDtls::QPrivateSignal (0x0x7319a6f17660) 0 empty + +Vtable for QDtls +QDtls::_ZTV5QDtls: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI5QDtls) +16 (int (*)(...))QDtls::metaObject +24 (int (*)(...))QDtls::qt_metacast +32 (int (*)(...))QDtls::qt_metacall +40 (int (*)(...))QDtls::~QDtls +48 (int (*)(...))QDtls::~QDtls +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QDtls + size=16 align=8 + base size=16 base align=8 +QDtls (0x0x7319a6efbd00) 0 + vptr=((& QDtls::_ZTV5QDtls) + 16) +QObject (0x0x7319a6f17600) 0 + primary-for QDtls (0x0x7319a6efbd00) + +Class QHttpPart + size=8 align=8 + base size=8 base align=8 +QHttpPart (0x0x7319a6f177e0) 0 + +Class QHttpMultiPart::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QHttpMultiPart::QPrivateSignal (0x0x7319a6ff4ae0) 0 empty + +Vtable for QHttpMultiPart +QHttpMultiPart::_ZTV14QHttpMultiPart: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QHttpMultiPart) +16 (int (*)(...))QHttpMultiPart::metaObject +24 (int (*)(...))QHttpMultiPart::qt_metacast +32 (int (*)(...))QHttpMultiPart::qt_metacall +40 (int (*)(...))QHttpMultiPart::~QHttpMultiPart +48 (int (*)(...))QHttpMultiPart::~QHttpMultiPart +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QHttpMultiPart + size=16 align=8 + base size=16 base align=8 +QHttpMultiPart (0x0x7319a6c01680) 0 + vptr=((& QHttpMultiPart::_ZTV14QHttpMultiPart) + 16) +QObject (0x0x7319a6ff4a80) 0 + primary-for QHttpMultiPart (0x0x7319a6c01680) + +Class QFormDataPartBuilder + size=16 align=8 + base size=16 base align=8 +QFormDataPartBuilder (0x0x7319a6ff4c60) 0 + +Class QFormDataBuilder + size=8 align=8 + base size=8 base align=8 +QFormDataBuilder (0x0x7319a6c78060) 0 + +Class QHostInfo + size=8 align=8 + base size=8 base align=8 +QHostInfo (0x0x7319a6d26ae0) 0 + +Class QHstsPolicy + size=8 align=8 + base size=8 base align=8 +QHstsPolicy (0x0x7319a6d9c720) 0 + +Class QHttp1Configuration::ShortData + size=8 align=1 + base size=8 base align=1 +QHttp1Configuration::ShortData (0x0x7319a6a32f00) 0 + +Class QHttp1Configuration::U + size=8 align=8 + base size=8 base align=8 +QHttp1Configuration::U (0x0x7319a6a32f60) 0 + +Class QHttp1Configuration + size=8 align=8 + base size=8 base align=8 +QHttp1Configuration (0x0x7319a6a32ea0) 0 + +Class QHttp2Configuration + size=8 align=8 + base size=8 base align=8 +QHttp2Configuration (0x0x7319a6b3d120) 0 + +Class QLocalServer::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QLocalServer::QPrivateSignal (0x0x7319a6bd8240) 0 empty + +Vtable for QLocalServer +QLocalServer::_ZTV12QLocalServer: 17 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QLocalServer) +16 (int (*)(...))QLocalServer::metaObject +24 (int (*)(...))QLocalServer::qt_metacast +32 (int (*)(...))QLocalServer::qt_metacall +40 (int (*)(...))QLocalServer::~QLocalServer +48 (int (*)(...))QLocalServer::~QLocalServer +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QLocalServer::hasPendingConnections +120 (int (*)(...))QLocalServer::nextPendingConnection +128 (int (*)(...))QLocalServer::incomingConnection + +Class QLocalServer + size=16 align=8 + base size=16 base align=8 +QLocalServer (0x0x7319a6bc8f08) 0 + vptr=((& QLocalServer::_ZTV12QLocalServer) + 16) +QObject (0x0x7319a6bd81e0) 0 + primary-for QLocalServer (0x0x7319a6bc8f08) + +Class QLocalSocket::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QLocalSocket::QPrivateSignal (0x0x7319a6bd8b40) 0 empty + +Vtable for QLocalSocket +QLocalSocket::_ZTV12QLocalSocket: 31 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QLocalSocket) +16 (int (*)(...))QLocalSocket::metaObject +24 (int (*)(...))QLocalSocket::qt_metacast +32 (int (*)(...))QLocalSocket::qt_metacall +40 (int (*)(...))QLocalSocket::~QLocalSocket +48 (int (*)(...))QLocalSocket::~QLocalSocket +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QLocalSocket::isSequential +120 (int (*)(...))QLocalSocket::open +128 (int (*)(...))QLocalSocket::close +136 (int (*)(...))QIODevice::pos +144 (int (*)(...))QIODevice::size +152 (int (*)(...))QIODevice::seek +160 (int (*)(...))QIODevice::atEnd +168 (int (*)(...))QIODevice::reset +176 (int (*)(...))QLocalSocket::bytesAvailable +184 (int (*)(...))QLocalSocket::bytesToWrite +192 (int (*)(...))QLocalSocket::canReadLine +200 (int (*)(...))QLocalSocket::waitForReadyRead +208 (int (*)(...))QLocalSocket::waitForBytesWritten +216 (int (*)(...))QLocalSocket::readData +224 (int (*)(...))QLocalSocket::readLineData +232 (int (*)(...))QLocalSocket::skipData +240 (int (*)(...))QLocalSocket::writeData + +Class QLocalSocket + size=16 align=8 + base size=16 base align=8 +QLocalSocket (0x0x7319a6bf9208) 0 + vptr=((& QLocalSocket::_ZTV12QLocalSocket) + 16) +QIODevice (0x0x7319a6bf6540) 0 + primary-for QLocalSocket (0x0x7319a6bf9208) +QObject (0x0x7319a6bd8a80) 0 + primary-for QIODevice (0x0x7319a6bf6540) +QIODeviceBase (0x0x7319a6bd8ae0) 0 empty + +Class QSslConfiguration + size=8 align=8 + base size=8 base align=8 +QSslConfiguration (0x0x7319a68bd300) 0 + +Class QSslPreSharedKeyAuthenticator + size=8 align=8 + base size=8 base align=8 +QSslPreSharedKeyAuthenticator (0x0x7319a6633180) 0 + +Class QNetworkAccessManager::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QNetworkAccessManager::QPrivateSignal (0x0x7319a6729180) 0 empty + +Vtable for QNetworkAccessManager +QNetworkAccessManager::_ZTV21QNetworkAccessManager: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI21QNetworkAccessManager) +16 (int (*)(...))QNetworkAccessManager::metaObject +24 (int (*)(...))QNetworkAccessManager::qt_metacast +32 (int (*)(...))QNetworkAccessManager::qt_metacall +40 (int (*)(...))QNetworkAccessManager::~QNetworkAccessManager +48 (int (*)(...))QNetworkAccessManager::~QNetworkAccessManager +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QNetworkAccessManager::supportedSchemes +120 (int (*)(...))QNetworkAccessManager::createRequest + +Class QNetworkAccessManager + size=16 align=8 + base size=16 base align=8 +QNetworkAccessManager (0x0x7319a66e3b60) 0 + vptr=((& QNetworkAccessManager::_ZTV21QNetworkAccessManager) + 16) +QObject (0x0x7319a6729120) 0 + primary-for QNetworkAccessManager (0x0x7319a66e3b60) + +Class QNetworkCookie + size=8 align=8 + base size=8 base align=8 +QNetworkCookie (0x0x7319a6729480) 0 + +Class QNetworkCookieJar::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QNetworkCookieJar::QPrivateSignal (0x0x7319a67fc840) 0 empty + +Vtable for QNetworkCookieJar +QNetworkCookieJar::_ZTV17QNetworkCookieJar: 20 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QNetworkCookieJar) +16 (int (*)(...))QNetworkCookieJar::metaObject +24 (int (*)(...))QNetworkCookieJar::qt_metacast +32 (int (*)(...))QNetworkCookieJar::qt_metacall +40 (int (*)(...))QNetworkCookieJar::~QNetworkCookieJar +48 (int (*)(...))QNetworkCookieJar::~QNetworkCookieJar +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QNetworkCookieJar::cookiesForUrl +120 (int (*)(...))QNetworkCookieJar::setCookiesFromUrl +128 (int (*)(...))QNetworkCookieJar::insertCookie +136 (int (*)(...))QNetworkCookieJar::updateCookie +144 (int (*)(...))QNetworkCookieJar::deleteCookie +152 (int (*)(...))QNetworkCookieJar::validateCookie + +Class QNetworkCookieJar + size=16 align=8 + base size=16 base align=8 +QNetworkCookieJar (0x0x7319a67f0a90) 0 + vptr=((& QNetworkCookieJar::_ZTV17QNetworkCookieJar) + 16) +QObject (0x0x7319a67fc7e0) 0 + primary-for QNetworkCookieJar (0x0x7319a67f0a90) + +Class QNetworkDatagram + size=8 align=8 + base size=8 base align=8 +QNetworkDatagram (0x0x7319a67fc9c0) 0 + +Class QNetworkDiskCache::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QNetworkDiskCache::QPrivateSignal (0x0x7319a6476d80) 0 empty + +Vtable for QNetworkDiskCache +QNetworkDiskCache::_ZTV17QNetworkDiskCache: 23 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QNetworkDiskCache) +16 (int (*)(...))QNetworkDiskCache::metaObject +24 (int (*)(...))QNetworkDiskCache::qt_metacast +32 (int (*)(...))QNetworkDiskCache::qt_metacall +40 (int (*)(...))QNetworkDiskCache::~QNetworkDiskCache +48 (int (*)(...))QNetworkDiskCache::~QNetworkDiskCache +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QNetworkDiskCache::metaData +120 (int (*)(...))QNetworkDiskCache::updateMetaData +128 (int (*)(...))QNetworkDiskCache::data +136 (int (*)(...))QNetworkDiskCache::remove +144 (int (*)(...))QNetworkDiskCache::cacheSize +152 (int (*)(...))QNetworkDiskCache::prepare +160 (int (*)(...))QNetworkDiskCache::insert +168 (int (*)(...))QNetworkDiskCache::clear +176 (int (*)(...))QNetworkDiskCache::expire + +Class QNetworkDiskCache + size=16 align=8 + base size=16 base align=8 +QNetworkDiskCache (0x0x7319a64777b8) 0 + vptr=((& QNetworkDiskCache::_ZTV17QNetworkDiskCache) + 16) +QAbstractNetworkCache (0x0x7319a6477820) 0 + primary-for QNetworkDiskCache (0x0x7319a64777b8) +QObject (0x0x7319a6476d20) 0 + primary-for QAbstractNetworkCache (0x0x7319a6477820) + +Class QNetworkInformation::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QNetworkInformation::QPrivateSignal (0x0x7319a6476f60) 0 empty + +Vtable for QNetworkInformation +QNetworkInformation::_ZTV19QNetworkInformation: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QNetworkInformation) +16 (int (*)(...))QNetworkInformation::metaObject +24 (int (*)(...))QNetworkInformation::qt_metacast +32 (int (*)(...))QNetworkInformation::qt_metacall +40 (int (*)(...))QNetworkInformation::~QNetworkInformation +48 (int (*)(...))QNetworkInformation::~QNetworkInformation +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QNetworkInformation + size=16 align=8 + base size=16 base align=8 +QNetworkInformation (0x0x7319a6477888) 0 + vptr=((& QNetworkInformation::_ZTV19QNetworkInformation) + 16) +QObject (0x0x7319a6476f00) 0 + primary-for QNetworkInformation (0x0x7319a6477888) + +Class QNetworkAddressEntry + size=8 align=8 + base size=8 base align=8 +QNetworkAddressEntry (0x0x7319a64bc8a0) 0 + +Class QNetworkInterface + size=8 align=8 + base size=8 base align=8 +QNetworkInterface (0x0x7319a62dca20) 0 + +Class QNetworkProxyQuery + size=8 align=8 + base size=8 base align=8 +QNetworkProxyQuery (0x0x7319a606a780) 0 + +Class QNetworkProxy + size=8 align=8 + base size=8 base align=8 +QNetworkProxy (0x0x7319a610e8a0) 0 + +Vtable for QNetworkProxyFactory +QNetworkProxyFactory::_ZTV20QNetworkProxyFactory: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QNetworkProxyFactory) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual + +Class QNetworkProxyFactory + size=8 align=8 + base size=8 base align=8 +QNetworkProxyFactory (0x0x7319a5e46060) 0 nearly-empty + vptr=((& QNetworkProxyFactory::_ZTV20QNetworkProxyFactory) + 16) + +Class QNetworkReply::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QNetworkReply::QPrivateSignal (0x0x7319a5e46c00) 0 empty + +Vtable for QNetworkReply +QNetworkReply::_ZTV13QNetworkReply: 37 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QNetworkReply) +16 (int (*)(...))QNetworkReply::metaObject +24 (int (*)(...))QNetworkReply::qt_metacast +32 (int (*)(...))QNetworkReply::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QNetworkReply::isSequential +120 (int (*)(...))QIODevice::open +128 (int (*)(...))QNetworkReply::close +136 (int (*)(...))QIODevice::pos +144 (int (*)(...))QIODevice::size +152 (int (*)(...))QIODevice::seek +160 (int (*)(...))QIODevice::atEnd +168 (int (*)(...))QIODevice::reset +176 (int (*)(...))QIODevice::bytesAvailable +184 (int (*)(...))QIODevice::bytesToWrite +192 (int (*)(...))QIODevice::canReadLine +200 (int (*)(...))QIODevice::waitForReadyRead +208 (int (*)(...))QIODevice::waitForBytesWritten +216 (int (*)(...))__cxa_pure_virtual +224 (int (*)(...))QIODevice::readLineData +232 (int (*)(...))QIODevice::skipData +240 (int (*)(...))QNetworkReply::writeData +248 (int (*)(...))QNetworkReply::setReadBufferSize +256 (int (*)(...))__cxa_pure_virtual +264 (int (*)(...))QNetworkReply::ignoreSslErrors +272 (int (*)(...))QNetworkReply::sslConfigurationImplementation +280 (int (*)(...))QNetworkReply::setSslConfigurationImplementation +288 (int (*)(...))QNetworkReply::ignoreSslErrorsImplementation + +Class QNetworkReply + size=16 align=8 + base size=16 base align=8 +QNetworkReply (0x0x7319a5e552d8) 0 + vptr=((& QNetworkReply::_ZTV13QNetworkReply) + 16) +QIODevice (0x0x7319a5e5a0e0) 0 + primary-for QNetworkReply (0x0x7319a5e552d8) +QObject (0x0x7319a5e46b40) 0 + primary-for QIODevice (0x0x7319a5e5a0e0) +QIODeviceBase (0x0x7319a5e46ba0) 0 empty + +Class QNetworkRequestFactory + size=8 align=8 + base size=8 base align=8 +QNetworkRequestFactory (0x0x7319a5ec8d80) 0 + +Class QOcspResponse + size=8 align=8 + base size=8 base align=8 +QOcspResponse (0x0x7319a5f70a20) 0 + +Class QRestAccessManager::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QRestAccessManager::QPrivateSignal (0x0x7319a5c2f780) 0 empty + +Vtable for QRestAccessManager +QRestAccessManager::_ZTV18QRestAccessManager: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QRestAccessManager) +16 (int (*)(...))QRestAccessManager::metaObject +24 (int (*)(...))QRestAccessManager::qt_metacast +32 (int (*)(...))QRestAccessManager::qt_metacall +40 (int (*)(...))QRestAccessManager::~QRestAccessManager +48 (int (*)(...))QRestAccessManager::~QRestAccessManager +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QRestAccessManager + size=16 align=8 + base size=16 base align=8 +QRestAccessManager (0x0x7319a5c22958) 0 + vptr=((& QRestAccessManager::_ZTV18QRestAccessManager) + 16) +QObject (0x0x7319a5c2f720) 0 + primary-for QRestAccessManager (0x0x7319a5c22958) + +Class QRestReply + size=24 align=8 + base size=24 base align=8 +QRestReply (0x0x7319a5c9fcc0) 0 + +Class QSslCertificateExtension + size=8 align=8 + base size=8 base align=8 +QSslCertificateExtension (0x0x7319a5d353c0) 0 + +Class QSslCipher + size=8 align=8 + base size=8 base align=8 +QSslCipher (0x0x7319a5dcd3c0) 0 + +Class QSslDiffieHellmanParameters + size=8 align=8 + base size=8 base align=8 +QSslDiffieHellmanParameters (0x0x7319a5b78840) 0 + +Class QSslEllipticCurve + size=4 align=4 + base size=4 base align=4 +QSslEllipticCurve (0x0x7319a5bce960) 0 + +Class QSslKey + size=8 align=8 + base size=8 base align=8 +QSslKey (0x0x7319a5835900) 0 + +Class QTcpServer::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTcpServer::QPrivateSignal (0x0x7319a58d5ba0) 0 empty + +Vtable for QTcpServer +QTcpServer::_ZTV10QTcpServer: 17 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QTcpServer) +16 (int (*)(...))QTcpServer::metaObject +24 (int (*)(...))QTcpServer::qt_metacast +32 (int (*)(...))QTcpServer::qt_metacall +40 (int (*)(...))QTcpServer::~QTcpServer +48 (int (*)(...))QTcpServer::~QTcpServer +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QTcpServer::hasPendingConnections +120 (int (*)(...))QTcpServer::nextPendingConnection +128 (int (*)(...))QTcpServer::incomingConnection + +Class QTcpServer + size=16 align=8 + base size=16 base align=8 +QTcpServer (0x0x7319a58e0888) 0 + vptr=((& QTcpServer::_ZTV10QTcpServer) + 16) +QObject (0x0x7319a58d5b40) 0 + primary-for QTcpServer (0x0x7319a58e0888) + +Class QSslServer::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSslServer::QPrivateSignal (0x0x7319a58d5d80) 0 empty + +Vtable for QSslServer +QSslServer::_ZTV10QSslServer: 17 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QSslServer) +16 (int (*)(...))QSslServer::metaObject +24 (int (*)(...))QSslServer::qt_metacast +32 (int (*)(...))QSslServer::qt_metacall +40 (int (*)(...))QSslServer::~QSslServer +48 (int (*)(...))QSslServer::~QSslServer +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QTcpServer::hasPendingConnections +120 (int (*)(...))QTcpServer::nextPendingConnection +128 (int (*)(...))QSslServer::incomingConnection + +Class QSslServer + size=16 align=8 + base size=16 base align=8 +QSslServer (0x0x7319a58e08f0) 0 + vptr=((& QSslServer::_ZTV10QSslServer) + 16) +QTcpServer (0x0x7319a58e0958) 0 + primary-for QSslServer (0x0x7319a58e08f0) +QObject (0x0x7319a58d5d20) 0 + primary-for QTcpServer (0x0x7319a58e0958) + +Class QUdpSocket::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QUdpSocket::QPrivateSignal (0x0x7319a591d000) 0 empty + +Vtable for QUdpSocket +QUdpSocket::_ZTV10QUdpSocket: 42 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QUdpSocket) +16 (int (*)(...))QUdpSocket::metaObject +24 (int (*)(...))QUdpSocket::qt_metacast +32 (int (*)(...))QUdpSocket::qt_metacall +40 (int (*)(...))QUdpSocket::~QUdpSocket +48 (int (*)(...))QUdpSocket::~QUdpSocket +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QAbstractSocket::isSequential +120 (int (*)(...))QIODevice::open +128 (int (*)(...))QAbstractSocket::close +136 (int (*)(...))QIODevice::pos +144 (int (*)(...))QIODevice::size +152 (int (*)(...))QIODevice::seek +160 (int (*)(...))QIODevice::atEnd +168 (int (*)(...))QIODevice::reset +176 (int (*)(...))QAbstractSocket::bytesAvailable +184 (int (*)(...))QAbstractSocket::bytesToWrite +192 (int (*)(...))QIODevice::canReadLine +200 (int (*)(...))QAbstractSocket::waitForReadyRead +208 (int (*)(...))QAbstractSocket::waitForBytesWritten +216 (int (*)(...))QAbstractSocket::readData +224 (int (*)(...))QAbstractSocket::readLineData +232 (int (*)(...))QAbstractSocket::skipData +240 (int (*)(...))QAbstractSocket::writeData +248 (int (*)(...))QAbstractSocket::resume +256 (int (*)(...))QAbstractSocket::bind +264 (int (*)(...))QAbstractSocket::connectToHost +272 (int (*)(...))QAbstractSocket::disconnectFromHost +280 (int (*)(...))QAbstractSocket::setReadBufferSize +288 (int (*)(...))QAbstractSocket::socketDescriptor +296 (int (*)(...))QAbstractSocket::setSocketDescriptor +304 (int (*)(...))QAbstractSocket::setSocketOption +312 (int (*)(...))QAbstractSocket::socketOption +320 (int (*)(...))QAbstractSocket::waitForConnected +328 (int (*)(...))QAbstractSocket::waitForDisconnected + +Class QUdpSocket + size=16 align=8 + base size=16 base align=8 +QUdpSocket (0x0x7319a58e09c0) 0 + vptr=((& QUdpSocket::_ZTV10QUdpSocket) + 16) +QAbstractSocket (0x0x7319a58e0a28) 0 + primary-for QUdpSocket (0x0x7319a58e09c0) +QIODevice (0x0x7319a587faf0) 0 + primary-for QAbstractSocket (0x0x7319a58e0a28) +QObject (0x0x7319a58d5f00) 0 + primary-for QIODevice (0x0x7319a587faf0) +QIODeviceBase (0x0x7319a58d5f60) 0 empty + +Class QAbstractPrintDialog::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAbstractPrintDialog::QPrivateSignal (0x0x7319a591d300) 0 empty + +Vtable for QAbstractPrintDialog +QAbstractPrintDialog::_ZTV20QAbstractPrintDialog: 69 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QAbstractPrintDialog) +16 (int (*)(...))QAbstractPrintDialog::metaObject +24 (int (*)(...))QAbstractPrintDialog::qt_metacast +32 (int (*)(...))QAbstractPrintDialog::qt_metacall +40 (int (*)(...))QAbstractPrintDialog::~QAbstractPrintDialog +48 (int (*)(...))QAbstractPrintDialog::~QAbstractPrintDialog +56 (int (*)(...))QWidget::event +64 (int (*)(...))QDialog::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QDialog::setVisible +128 (int (*)(...))QDialog::sizeHint +136 (int (*)(...))QDialog::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QDialog::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QDialog::resizeEvent +280 (int (*)(...))QDialog::closeEvent +288 (int (*)(...))QDialog::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QDialog::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDialog::open +440 (int (*)(...))QDialog::exec +448 (int (*)(...))QDialog::done +456 (int (*)(...))QDialog::accept +464 (int (*)(...))QDialog::reject +472 (int (*)(...))-16 +480 (int (*)(...))(& _ZTI20QAbstractPrintDialog) +488 (int (*)(...))QAbstractPrintDialog::_ZThn16_N20QAbstractPrintDialogD1Ev +496 (int (*)(...))QAbstractPrintDialog::_ZThn16_N20QAbstractPrintDialogD0Ev +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QAbstractPrintDialog + size=40 align=8 + base size=40 base align=8 +QAbstractPrintDialog (0x0x7319a58e0a90) 0 + vptr=((& QAbstractPrintDialog::_ZTV20QAbstractPrintDialog) + 16) +QDialog (0x0x7319a58e0af8) 0 + primary-for QAbstractPrintDialog (0x0x7319a58e0a90) +QWidget (0x0x7319a587fd90) 0 + primary-for QDialog (0x0x7319a58e0af8) +QObject (0x0x7319a591d240) 0 + primary-for QWidget (0x0x7319a587fd90) +QPaintDevice (0x0x7319a591d2a0) 16 + vptr=((& QAbstractPrintDialog::_ZTV20QAbstractPrintDialog) + 488) + +Class QPageSetupDialog::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QPageSetupDialog::QPrivateSignal (0x0x7319a591dc00) 0 empty + +Vtable for QPageSetupDialog +QPageSetupDialog::_ZTV16QPageSetupDialog: 69 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI16QPageSetupDialog) +16 (int (*)(...))QPageSetupDialog::metaObject +24 (int (*)(...))QPageSetupDialog::qt_metacast +32 (int (*)(...))QPageSetupDialog::qt_metacall +40 (int (*)(...))QPageSetupDialog::~QPageSetupDialog +48 (int (*)(...))QPageSetupDialog::~QPageSetupDialog +56 (int (*)(...))QWidget::event +64 (int (*)(...))QDialog::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QDialog::setVisible +128 (int (*)(...))QDialog::sizeHint +136 (int (*)(...))QDialog::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QDialog::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QDialog::resizeEvent +280 (int (*)(...))QDialog::closeEvent +288 (int (*)(...))QDialog::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QDialog::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDialog::open +440 (int (*)(...))QPageSetupDialog::exec +448 (int (*)(...))QPageSetupDialog::done +456 (int (*)(...))QDialog::accept +464 (int (*)(...))QDialog::reject +472 (int (*)(...))-16 +480 (int (*)(...))(& _ZTI16QPageSetupDialog) +488 (int (*)(...))QPageSetupDialog::_ZThn16_N16QPageSetupDialogD1Ev +496 (int (*)(...))QPageSetupDialog::_ZThn16_N16QPageSetupDialogD0Ev +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QPageSetupDialog + size=40 align=8 + base size=40 base align=8 +QPageSetupDialog (0x0x7319a58e0dd0) 0 + vptr=((& QPageSetupDialog::_ZTV16QPageSetupDialog) + 16) +QDialog (0x0x7319a58e0e38) 0 + primary-for QPageSetupDialog (0x0x7319a58e0dd0) +QWidget (0x0x7319a59367e0) 0 + primary-for QDialog (0x0x7319a58e0e38) +QObject (0x0x7319a591db40) 0 + primary-for QWidget (0x0x7319a59367e0) +QPaintDevice (0x0x7319a591dba0) 16 + vptr=((& QPageSetupDialog::_ZTV16QPageSetupDialog) + 488) + +Class QPrintDialog::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QPrintDialog::QPrivateSignal (0x0x7319a591de40) 0 empty + +Vtable for QPrintDialog +QPrintDialog::_ZTV12QPrintDialog: 69 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QPrintDialog) +16 (int (*)(...))QPrintDialog::metaObject +24 (int (*)(...))QPrintDialog::qt_metacast +32 (int (*)(...))QPrintDialog::qt_metacall +40 (int (*)(...))QPrintDialog::~QPrintDialog +48 (int (*)(...))QPrintDialog::~QPrintDialog +56 (int (*)(...))QWidget::event +64 (int (*)(...))QDialog::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QPrintDialog::setVisible +128 (int (*)(...))QDialog::sizeHint +136 (int (*)(...))QDialog::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QDialog::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QDialog::resizeEvent +280 (int (*)(...))QDialog::closeEvent +288 (int (*)(...))QDialog::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QDialog::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDialog::open +440 (int (*)(...))QPrintDialog::exec +448 (int (*)(...))QPrintDialog::done +456 (int (*)(...))QPrintDialog::accept +464 (int (*)(...))QDialog::reject +472 (int (*)(...))-16 +480 (int (*)(...))(& _ZTI12QPrintDialog) +488 (int (*)(...))QPrintDialog::_ZThn16_N12QPrintDialogD1Ev +496 (int (*)(...))QPrintDialog::_ZThn16_N12QPrintDialogD0Ev +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QPrintDialog + size=40 align=8 + base size=40 base align=8 +QPrintDialog (0x0x7319a58e0ea0) 0 + vptr=((& QPrintDialog::_ZTV12QPrintDialog) + 16) +QAbstractPrintDialog (0x0x7319a58e0f08) 0 + primary-for QPrintDialog (0x0x7319a58e0ea0) +QDialog (0x0x7319a58e0f70) 0 + primary-for QAbstractPrintDialog (0x0x7319a58e0f08) +QWidget (0x0x7319a59369a0) 0 + primary-for QDialog (0x0x7319a58e0f70) +QObject (0x0x7319a591dd80) 0 + primary-for QWidget (0x0x7319a59369a0) +QPaintDevice (0x0x7319a591dde0) 16 + vptr=((& QPrintDialog::_ZTV12QPrintDialog) + 488) + +Vtable for QPrinter +QPrinter::_ZTV8QPrinter: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI8QPrinter) +16 (int (*)(...))QPrinter::~QPrinter +24 (int (*)(...))QPrinter::~QPrinter +32 (int (*)(...))QPrinter::devType +40 (int (*)(...))QPrinter::paintEngine +48 (int (*)(...))QPrinter::metric +56 (int (*)(...))QPaintDevice::initPainter +64 (int (*)(...))QPaintDevice::redirected +72 (int (*)(...))QPaintDevice::sharedPainter +80 (int (*)(...))QPrinter::newPage +88 (int (*)(...))QPagedPaintDevice::setPageLayout +96 (int (*)(...))QPagedPaintDevice::setPageSize +104 (int (*)(...))QPagedPaintDevice::setPageOrientation +112 (int (*)(...))QPagedPaintDevice::setPageMargins +120 (int (*)(...))QPagedPaintDevice::setPageRanges + +Class QPrinter + size=32 align=8 + base size=32 base align=8 +QPrinter (0x0x7319a59ed000) 0 + vptr=((& QPrinter::_ZTV8QPrinter) + 16) +QPagedPaintDevice (0x0x7319a59ed068) 0 + primary-for QPrinter (0x0x7319a59ed000) +QPaintDevice (0x0x7319a59ee000) 0 + primary-for QPagedPaintDevice (0x0x7319a59ed068) + +Vtable for QPrintEngine +QPrintEngine::_ZTV12QPrintEngine: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QPrintEngine) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual + +Class QPrintEngine + size=8 align=8 + base size=8 base align=8 +QPrintEngine (0x0x7319a59eeb40) 0 nearly-empty + vptr=((& QPrintEngine::_ZTV12QPrintEngine) + 16) + +Class QPrinterInfo + size=8 align=8 + base size=8 base align=8 +QPrinterInfo (0x0x7319a59eeba0) 0 + +Class QPrintPreviewDialog::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QPrintPreviewDialog::QPrivateSignal (0x0x7319a59eede0) 0 empty + +Vtable for QPrintPreviewDialog +QPrintPreviewDialog::_ZTV19QPrintPreviewDialog: 69 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QPrintPreviewDialog) +16 (int (*)(...))QPrintPreviewDialog::metaObject +24 (int (*)(...))QPrintPreviewDialog::qt_metacast +32 (int (*)(...))QPrintPreviewDialog::qt_metacall +40 (int (*)(...))QPrintPreviewDialog::~QPrintPreviewDialog +48 (int (*)(...))QPrintPreviewDialog::~QPrintPreviewDialog +56 (int (*)(...))QWidget::event +64 (int (*)(...))QDialog::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QPrintPreviewDialog::setVisible +128 (int (*)(...))QDialog::sizeHint +136 (int (*)(...))QDialog::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QDialog::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QDialog::resizeEvent +280 (int (*)(...))QDialog::closeEvent +288 (int (*)(...))QDialog::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QDialog::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))QDialog::open +440 (int (*)(...))QDialog::exec +448 (int (*)(...))QPrintPreviewDialog::done +456 (int (*)(...))QDialog::accept +464 (int (*)(...))QDialog::reject +472 (int (*)(...))-16 +480 (int (*)(...))(& _ZTI19QPrintPreviewDialog) +488 (int (*)(...))QPrintPreviewDialog::_ZThn16_N19QPrintPreviewDialogD1Ev +496 (int (*)(...))QPrintPreviewDialog::_ZThn16_N19QPrintPreviewDialogD0Ev +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QPrintPreviewDialog + size=40 align=8 + base size=40 base align=8 +QPrintPreviewDialog (0x0x7319a59ed618) 0 + vptr=((& QPrintPreviewDialog::_ZTV19QPrintPreviewDialog) + 16) +QDialog (0x0x7319a59ed680) 0 + primary-for QPrintPreviewDialog (0x0x7319a59ed618) +QWidget (0x0x7319a5632150) 0 + primary-for QDialog (0x0x7319a59ed680) +QObject (0x0x7319a59eed20) 0 + primary-for QWidget (0x0x7319a5632150) +QPaintDevice (0x0x7319a59eed80) 16 + vptr=((& QPrintPreviewDialog::_ZTV19QPrintPreviewDialog) + 488) + +Class QPrintPreviewWidget::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QPrintPreviewWidget::QPrivateSignal (0x0x7319a5663060) 0 empty + +Vtable for QPrintPreviewWidget +QPrintPreviewWidget::_ZTV19QPrintPreviewWidget: 64 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QPrintPreviewWidget) +16 (int (*)(...))QPrintPreviewWidget::metaObject +24 (int (*)(...))QPrintPreviewWidget::qt_metacast +32 (int (*)(...))QPrintPreviewWidget::qt_metacall +40 (int (*)(...))QPrintPreviewWidget::~QPrintPreviewWidget +48 (int (*)(...))QPrintPreviewWidget::~QPrintPreviewWidget +56 (int (*)(...))QWidget::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWidget::devType +120 (int (*)(...))QPrintPreviewWidget::setVisible +128 (int (*)(...))QWidget::sizeHint +136 (int (*)(...))QWidget::minimumSizeHint +144 (int (*)(...))QWidget::heightForWidth +152 (int (*)(...))QWidget::hasHeightForWidth +160 (int (*)(...))QWidget::paintEngine +168 (int (*)(...))QWidget::mousePressEvent +176 (int (*)(...))QWidget::mouseReleaseEvent +184 (int (*)(...))QWidget::mouseDoubleClickEvent +192 (int (*)(...))QWidget::mouseMoveEvent +200 (int (*)(...))QWidget::wheelEvent +208 (int (*)(...))QWidget::keyPressEvent +216 (int (*)(...))QWidget::keyReleaseEvent +224 (int (*)(...))QWidget::focusInEvent +232 (int (*)(...))QWidget::focusOutEvent +240 (int (*)(...))QWidget::enterEvent +248 (int (*)(...))QWidget::leaveEvent +256 (int (*)(...))QWidget::paintEvent +264 (int (*)(...))QWidget::moveEvent +272 (int (*)(...))QWidget::resizeEvent +280 (int (*)(...))QWidget::closeEvent +288 (int (*)(...))QWidget::contextMenuEvent +296 (int (*)(...))QWidget::tabletEvent +304 (int (*)(...))QWidget::actionEvent +312 (int (*)(...))QWidget::dragEnterEvent +320 (int (*)(...))QWidget::dragMoveEvent +328 (int (*)(...))QWidget::dragLeaveEvent +336 (int (*)(...))QWidget::dropEvent +344 (int (*)(...))QWidget::showEvent +352 (int (*)(...))QWidget::hideEvent +360 (int (*)(...))QWidget::nativeEvent +368 (int (*)(...))QWidget::changeEvent +376 (int (*)(...))QWidget::metric +384 (int (*)(...))QWidget::initPainter +392 (int (*)(...))QWidget::redirected +400 (int (*)(...))QWidget::sharedPainter +408 (int (*)(...))QWidget::inputMethodEvent +416 (int (*)(...))QWidget::inputMethodQuery +424 (int (*)(...))QWidget::focusNextPrevChild +432 (int (*)(...))-16 +440 (int (*)(...))(& _ZTI19QPrintPreviewWidget) +448 (int (*)(...))QPrintPreviewWidget::_ZThn16_N19QPrintPreviewWidgetD1Ev +456 (int (*)(...))QPrintPreviewWidget::_ZThn16_N19QPrintPreviewWidgetD0Ev +464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv +472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv +480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE +488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter +496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint +504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv + +Class QPrintPreviewWidget + size=40 align=8 + base size=40 base align=8 +QPrintPreviewWidget (0x0x7319a59ed6e8) 0 + vptr=((& QPrintPreviewWidget::_ZTV19QPrintPreviewWidget) + 16) +QWidget (0x0x7319a5632310) 0 + primary-for QPrintPreviewWidget (0x0x7319a59ed6e8) +QObject (0x0x7319a59eef60) 0 + primary-for QWidget (0x0x7319a5632310) +QPaintDevice (0x0x7319a5663000) 16 + vptr=((& QPrintPreviewWidget::_ZTV19QPrintPreviewWidget) + 448) + +Class QJSValue + size=8 align=8 + base size=8 base align=8 +QJSValue (0x0x7319a56631e0) 0 + +Class QJSNumberCoercion + size=8 align=8 + base size=8 base align=8 +QJSNumberCoercion (0x0x7319a5719de0) 0 + +Class QJSPrimitiveUndefined + size=1 align=1 + base size=0 base align=1 +QJSPrimitiveUndefined (0x0x7319a5743780) 0 empty + +Class QJSPrimitiveNull + size=1 align=1 + base size=0 base align=1 +QJSPrimitiveNull (0x0x7319a57437e0) 0 empty + +Class QJSPrimitiveValue::AddOperators + size=1 align=1 + base size=0 base align=1 +QJSPrimitiveValue::AddOperators (0x0x7319a5743900) 0 empty + +Class QJSPrimitiveValue::SubOperators + size=1 align=1 + base size=1 base align=1 +QJSPrimitiveValue::SubOperators (0x0x7319a5723820) 0 empty +QJSPrimitiveValue::StringNaNOperators (0x0x7319a57439c0) 0 empty + +Class QJSPrimitiveValue::MulOperators + size=1 align=1 + base size=1 base align=1 +QJSPrimitiveValue::MulOperators (0x0x7319a5723888) 0 empty +QJSPrimitiveValue::StringNaNOperators (0x0x7319a5743a80) 0 empty + +Class QJSPrimitiveValue::DivOperators + size=1 align=1 + base size=1 base align=1 +QJSPrimitiveValue::DivOperators (0x0x7319a57238f0) 0 empty +QJSPrimitiveValue::StringNaNOperators (0x0x7319a5743b40) 0 empty + +Class QJSPrimitiveValue::QJSPrimitiveValuePrivate + size=32 align=8 + base size=25 base align=8 +QJSPrimitiveValue::QJSPrimitiveValuePrivate (0x0x7319a5743ba0) 0 + +Class QJSPrimitiveValue + size=32 align=8 + base size=32 base align=8 +QJSPrimitiveValue (0x0x7319a5743840) 0 + +Class QJSManagedValue + size=8 align=8 + base size=8 base align=8 +QJSManagedValue (0x0x7319a5580060) 0 + +Class QQmlDebuggingEnabler + size=1 align=1 + base size=0 base align=1 +QQmlDebuggingEnabler (0x0x7319a5580360) 0 empty + +Class {anonymous}::QQmlTriviallyDestructibleDebuggingEnabler + size=1 align=1 + base size=0 base align=1 +{anonymous}::QQmlTriviallyDestructibleDebuggingEnabler (0x0x7319a55805a0) 0 empty + +Class QJSEngine::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QJSEngine::QPrivateSignal (0x0x7319a55bdd80) 0 empty + +Vtable for QJSEngine +QJSEngine::_ZTV9QJSEngine: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI9QJSEngine) +16 (int (*)(...))QJSEngine::metaObject +24 (int (*)(...))QJSEngine::qt_metacast +32 (int (*)(...))QJSEngine::qt_metacall +40 (int (*)(...))QJSEngine::~QJSEngine +48 (int (*)(...))QJSEngine::~QJSEngine +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QJSEngine + size=24 align=8 + base size=24 base align=8 +QJSEngine (0x0x7319a55c5e38) 0 + vptr=((& QJSEngine::_ZTV9QJSEngine) + 16) +QObject (0x0x7319a55bdd20) 0 + primary-for QJSEngine (0x0x7319a55c5e38) + +Class QQmlListReference + size=8 align=8 + base size=8 base align=8 +QQmlListReference (0x0x7319a52b49c0) 0 + +Class QJSListIndexClamp + size=1 align=1 + base size=0 base align=1 +QJSListIndexClamp (0x0x7319a52d7ae0) 0 empty + +Class QJSListForInIterator + size=16 align=8 + base size=16 base align=8 +QJSListForInIterator (0x0x7319a53495a0) 0 + +Class QJSListForOfIterator + size=8 align=8 + base size=8 base align=8 +QJSListForOfIterator (0x0x7319a5376000) 0 + +Class QJSValueIterator + size=8 align=8 + base size=8 base align=8 +QJSValueIterator (0x0x7319a5376a20) 0 + +Vtable for QQmlParserStatus +QQmlParserStatus::_ZTV16QQmlParserStatus: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI16QQmlParserStatus) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual + +Class QQmlParserStatus + size=16 align=8 + base size=16 base align=8 +QQmlParserStatus (0x0x7319a5376c00) 0 + vptr=((& QQmlParserStatus::_ZTV16QQmlParserStatus) + 16) + +Vtable for QQmlPropertyValueSource +QQmlPropertyValueSource::_ZTV23QQmlPropertyValueSource: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI23QQmlPropertyValueSource) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual + +Class QQmlPropertyValueSource + size=8 align=8 + base size=8 base align=8 +QQmlPropertyValueSource (0x0x7319a53af000) 0 nearly-empty + vptr=((& QQmlPropertyValueSource::_ZTV23QQmlPropertyValueSource) + 16) + +Class QQmlPrivate::RegisterType + size=184 align=8 + base size=180 base align=8 +QQmlPrivate::RegisterType (0x0x7319a53dea20) 0 + +Class QQmlPrivate::RegisterTypeAndRevisions + size=168 align=8 + base size=168 base align=8 +QQmlPrivate::RegisterTypeAndRevisions (0x0x7319a53deae0) 0 + +Class QQmlPrivate::RegisterInterface + size=48 align=8 + base size=42 base align=8 +QQmlPrivate::RegisterInterface (0x0x7319a53deb40) 0 + +Class QQmlPrivate::RegisterAutoParent + size=16 align=8 + base size=16 base align=8 +QQmlPrivate::RegisterAutoParent (0x0x7319a53deba0) 0 + +Class QQmlPrivate::RegisterSingletonType + size=136 align=8 + base size=130 base align=8 +QQmlPrivate::RegisterSingletonType (0x0x7319a53dec00) 0 + +Class QQmlPrivate::RegisterSingletonTypeAndRevisions + size=104 align=8 + base size=104 base align=8 +QQmlPrivate::RegisterSingletonTypeAndRevisions (0x0x7319a53def60) 0 + +Class QQmlPrivate::RegisterCompositeType + size=40 align=8 + base size=40 base align=8 +QQmlPrivate::RegisterCompositeType (0x0x7319a5031060) 0 + +Class QQmlPrivate::RegisterCompositeSingletonType + size=40 align=8 + base size=40 base align=8 +QQmlPrivate::RegisterCompositeSingletonType (0x0x7319a50310c0) 0 + +Class QQmlPrivate::RegisterSequentialContainer + size=56 align=8 + base size=50 base align=8 +QQmlPrivate::RegisterSequentialContainer (0x0x7319a5031120) 0 + +Class QQmlPrivate::RegisterSequentialContainerAndRevisions + size=56 align=8 + base size=56 base align=8 +QQmlPrivate::RegisterSequentialContainerAndRevisions (0x0x7319a5031180) 0 + +Vtable for QQmlPrivate::AOTTrackedLocalsStorage +QQmlPrivate::AOTTrackedLocalsStorage::_ZTVN11QQmlPrivate23AOTTrackedLocalsStorageE: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN11QQmlPrivate23AOTTrackedLocalsStorageE) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual + +Class QQmlPrivate::AOTTrackedLocalsStorage + size=8 align=8 + base size=8 base align=8 +QQmlPrivate::AOTTrackedLocalsStorage (0x0x7319a50311e0) 0 nearly-empty + vptr=((& QQmlPrivate::AOTTrackedLocalsStorage::_ZTVN11QQmlPrivate23AOTTrackedLocalsStorageE) + 16) + +Class QQmlPrivate::AOTCompiledContext + size=32 align=8 + base size=32 base align=8 +QQmlPrivate::AOTCompiledContext (0x0x7319a50312a0) 0 + +Class QQmlPrivate::AOTCompiledFunction + size=24 align=8 + base size=24 base align=8 +QQmlPrivate::AOTCompiledFunction (0x0x7319a50315a0) 0 + +Class QQmlPrivate::CachedQmlUnit + size=24 align=8 + base size=24 base align=8 +QQmlPrivate::CachedQmlUnit (0x0x7319a5031600) 0 + +Class QQmlPrivate::RegisterQmlUnitCacheHook + size=16 align=8 + base size=16 base align=8 +QQmlPrivate::RegisterQmlUnitCacheHook (0x0x7319a5031660) 0 + +Class QQmlPrivate::SingletonFunctor + size=24 align=8 + base size=17 base align=8 +QQmlPrivate::SingletonFunctor (0x0x7319a50316c0) 0 + +Class QQmlPrivate::SingletonInstanceFunctor + size=24 align=8 + base size=24 base align=8 +QQmlPrivate::SingletonInstanceFunctor (0x0x7319a5031900) 0 + +Class QQmlTypeNotAvailable::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQmlTypeNotAvailable::QPrivateSignal (0x0x7319a50b7900) 0 empty + +Vtable for QQmlTypeNotAvailable +QQmlTypeNotAvailable::_ZTV20QQmlTypeNotAvailable: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QQmlTypeNotAvailable) +16 (int (*)(...))QQmlTypeNotAvailable::metaObject +24 (int (*)(...))QQmlTypeNotAvailable::qt_metacast +32 (int (*)(...))QQmlTypeNotAvailable::qt_metacall +40 (int (*)(...))QQmlTypeNotAvailable::~QQmlTypeNotAvailable +48 (int (*)(...))QQmlTypeNotAvailable::~QQmlTypeNotAvailable +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QQmlTypeNotAvailable + size=16 align=8 + base size=16 base align=8 +QQmlTypeNotAvailable (0x0x7319a50bf478) 0 + vptr=((& QQmlTypeNotAvailable::_ZTV20QQmlTypeNotAvailable) + 16) +QObject (0x0x7319a50b78a0) 0 + primary-for QQmlTypeNotAvailable (0x0x7319a50bf478) + +Vtable for QQmlAbstractUrlInterceptor +QQmlAbstractUrlInterceptor::_ZTV26QQmlAbstractUrlInterceptor: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI26QQmlAbstractUrlInterceptor) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual + +Class QQmlAbstractUrlInterceptor + size=8 align=8 + base size=8 base align=8 +QQmlAbstractUrlInterceptor (0x0x7319a5108e40) 0 nearly-empty + vptr=((& QQmlAbstractUrlInterceptor::_ZTV26QQmlAbstractUrlInterceptor) + 16) + +Class QQmlError + size=8 align=8 + base size=8 base align=8 +QQmlError (0x0x7319a5108ea0) 0 + +Class QQmlImageProviderBase::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQmlImageProviderBase::QPrivateSignal (0x0x7319a5166f60) 0 empty + +Vtable for QQmlImageProviderBase +QQmlImageProviderBase::_ZTV21QQmlImageProviderBase: 16 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI21QQmlImageProviderBase) +16 (int (*)(...))QQmlImageProviderBase::metaObject +24 (int (*)(...))QQmlImageProviderBase::qt_metacast +32 (int (*)(...))QQmlImageProviderBase::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual + +Class QQmlImageProviderBase + size=16 align=8 + base size=16 base align=8 +QQmlImageProviderBase (0x0x7319a5173d68) 0 + vptr=((& QQmlImageProviderBase::_ZTV21QQmlImageProviderBase) + 16) +QObject (0x0x7319a5166f00) 0 + primary-for QQmlImageProviderBase (0x0x7319a5173d68) + +Class QQmlEngine::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQmlEngine::QPrivateSignal (0x0x7319a5194600) 0 empty + +Vtable for QQmlEngine +QQmlEngine::_ZTV10QQmlEngine: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QQmlEngine) +16 (int (*)(...))QQmlEngine::metaObject +24 (int (*)(...))QQmlEngine::qt_metacast +32 (int (*)(...))QQmlEngine::qt_metacall +40 (int (*)(...))QQmlEngine::~QQmlEngine +48 (int (*)(...))QQmlEngine::~QQmlEngine +56 (int (*)(...))QQmlEngine::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QQmlEngine + size=24 align=8 + base size=24 base align=8 +QQmlEngine (0x0x7319a51a5068) 0 + vptr=((& QQmlEngine::_ZTV10QQmlEngine) + 16) +QJSEngine (0x0x7319a51a50d0) 0 + primary-for QQmlEngine (0x0x7319a51a5068) +QObject (0x0x7319a51945a0) 0 + primary-for QJSEngine (0x0x7319a51a50d0) + +Class QQmlApplicationEngine::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQmlApplicationEngine::QPrivateSignal (0x0x7319a5194960) 0 empty + +Vtable for QQmlApplicationEngine +QQmlApplicationEngine::_ZTV21QQmlApplicationEngine: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI21QQmlApplicationEngine) +16 (int (*)(...))QQmlApplicationEngine::metaObject +24 (int (*)(...))QQmlApplicationEngine::qt_metacast +32 (int (*)(...))QQmlApplicationEngine::qt_metacall +40 (int (*)(...))QQmlApplicationEngine::~QQmlApplicationEngine +48 (int (*)(...))QQmlApplicationEngine::~QQmlApplicationEngine +56 (int (*)(...))QQmlEngine::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QQmlApplicationEngine + size=24 align=8 + base size=24 base align=8 +QQmlApplicationEngine (0x0x7319a51a5138) 0 + vptr=((& QQmlApplicationEngine::_ZTV21QQmlApplicationEngine) + 16) +QQmlEngine (0x0x7319a51a51a0) 0 + primary-for QQmlApplicationEngine (0x0x7319a51a5138) +QJSEngine (0x0x7319a51a5208) 0 + primary-for QQmlEngine (0x0x7319a51a51a0) +QObject (0x0x7319a5194900) 0 + primary-for QJSEngine (0x0x7319a51a5208) + +Class QQmlComponent::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQmlComponent::QPrivateSignal (0x0x7319a5194b40) 0 empty + +Vtable for QQmlComponent +QQmlComponent::_ZTV13QQmlComponent: 17 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QQmlComponent) +16 (int (*)(...))QQmlComponent::metaObject +24 (int (*)(...))QQmlComponent::qt_metacast +32 (int (*)(...))QQmlComponent::qt_metacall +40 (int (*)(...))QQmlComponent::~QQmlComponent +48 (int (*)(...))QQmlComponent::~QQmlComponent +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QQmlComponent::create +120 (int (*)(...))QQmlComponent::beginCreate +128 (int (*)(...))QQmlComponent::completeCreate + +Class QQmlComponent + size=16 align=8 + base size=16 base align=8 +QQmlComponent (0x0x7319a51a5270) 0 + vptr=((& QQmlComponent::_ZTV13QQmlComponent) + 16) +QObject (0x0x7319a5194ae0) 0 + primary-for QQmlComponent (0x0x7319a51a5270) + +Class QQmlContext::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQmlContext::QPrivateSignal (0x0x7319a5194f60) 0 empty + +Class QQmlContext::PropertyPair + size=56 align=8 + base size=56 base align=8 +QQmlContext::PropertyPair (0x0x7319a4e76000) 0 + +Vtable for QQmlContext +QQmlContext::_ZTV11QQmlContext: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QQmlContext) +16 (int (*)(...))QQmlContext::metaObject +24 (int (*)(...))QQmlContext::qt_metacast +32 (int (*)(...))QQmlContext::qt_metacall +40 (int (*)(...))QQmlContext::~QQmlContext +48 (int (*)(...))QQmlContext::~QQmlContext +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QQmlContext + size=16 align=8 + base size=16 base align=8 +QQmlContext (0x0x7319b3abcbc8) 0 + vptr=((& QQmlContext::_ZTV11QQmlContext) + 16) +QObject (0x0x7319a5194f00) 0 + primary-for QQmlContext (0x0x7319b3abcbc8) + +Class QQmlScriptString + size=8 align=8 + base size=8 base align=8 +QQmlScriptString (0x0x7319a4e76180) 0 + +Class QQmlExpression::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQmlExpression::QPrivateSignal (0x0x7319a4ef56c0) 0 empty + +Vtable for QQmlExpression +QQmlExpression::_ZTV14QQmlExpression: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QQmlExpression) +16 (int (*)(...))QQmlExpression::metaObject +24 (int (*)(...))QQmlExpression::qt_metacast +32 (int (*)(...))QQmlExpression::qt_metacall +40 (int (*)(...))QQmlExpression::~QQmlExpression +48 (int (*)(...))QQmlExpression::~QQmlExpression +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QQmlExpression + size=16 align=8 + base size=16 base align=8 +QQmlExpression (0x0x7319a4efa068) 0 + vptr=((& QQmlExpression::_ZTV14QQmlExpression) + 16) +QObject (0x0x7319a4ef5660) 0 + primary-for QQmlExpression (0x0x7319a4efa068) + +Vtable for QQmlTypesExtensionInterface +QQmlTypesExtensionInterface::_ZTV27QQmlTypesExtensionInterface: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI27QQmlTypesExtensionInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual + +Class QQmlTypesExtensionInterface + size=8 align=8 + base size=8 base align=8 +QQmlTypesExtensionInterface (0x0x7319a4ef5840) 0 nearly-empty + vptr=((& QQmlTypesExtensionInterface::_ZTV27QQmlTypesExtensionInterface) + 16) + +Vtable for QQmlExtensionInterface +QQmlExtensionInterface::_ZTV22QQmlExtensionInterface: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI22QQmlExtensionInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual + +Class QQmlExtensionInterface + size=8 align=8 + base size=8 base align=8 +QQmlExtensionInterface (0x0x7319a4efa0d0) 0 nearly-empty + vptr=((& QQmlExtensionInterface::_ZTV22QQmlExtensionInterface) + 16) +QQmlTypesExtensionInterface (0x0x7319a4ef58a0) 0 nearly-empty + primary-for QQmlExtensionInterface (0x0x7319a4efa0d0) + +Vtable for QQmlEngineExtensionInterface +QQmlEngineExtensionInterface::_ZTV28QQmlEngineExtensionInterface: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI28QQmlEngineExtensionInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual + +Class QQmlEngineExtensionInterface + size=8 align=8 + base size=8 base align=8 +QQmlEngineExtensionInterface (0x0x7319a4ef5900) 0 nearly-empty + vptr=((& QQmlEngineExtensionInterface::_ZTV28QQmlEngineExtensionInterface) + 16) + +Class QQmlExtensionPlugin::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQmlExtensionPlugin::QPrivateSignal (0x0x7319a4f35480) 0 empty + +Vtable for QQmlExtensionPlugin +QQmlExtensionPlugin::_ZTV19QQmlExtensionPlugin: 23 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QQmlExtensionPlugin) +16 (int (*)(...))QQmlExtensionPlugin::metaObject +24 (int (*)(...))QQmlExtensionPlugin::qt_metacast +32 (int (*)(...))QQmlExtensionPlugin::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))QQmlExtensionPlugin::unregisterTypes +128 (int (*)(...))QQmlExtensionPlugin::initializeEngine +136 (int (*)(...))-16 +144 (int (*)(...))(& _ZTI19QQmlExtensionPlugin) +152 0 +160 0 +168 (int (*)(...))__cxa_pure_virtual +176 (int (*)(...))QQmlExtensionPlugin::_ZThn16_N19QQmlExtensionPlugin16initializeEngineEP10QQmlEnginePKc + +Class QQmlExtensionPlugin + size=24 align=8 + base size=24 base align=8 +QQmlExtensionPlugin (0x0x7319a4f3e000) 0 + vptr=((& QQmlExtensionPlugin::_ZTV19QQmlExtensionPlugin) + 16) +QObject (0x0x7319a4f353c0) 0 + primary-for QQmlExtensionPlugin (0x0x7319a4f3e000) +QQmlExtensionInterface (0x0x7319a4efa3a8) 16 nearly-empty + vptr=((& QQmlExtensionPlugin::_ZTV19QQmlExtensionPlugin) + 152) +QQmlTypesExtensionInterface (0x0x7319a4f35420) 16 nearly-empty + primary-for QQmlExtensionInterface (0x0x7319a4efa3a8) + +Class QQmlEngineExtensionPlugin::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQmlEngineExtensionPlugin::QPrivateSignal (0x0x7319a4f356c0) 0 empty + +Vtable for QQmlEngineExtensionPlugin +QQmlEngineExtensionPlugin::_ZTV25QQmlEngineExtensionPlugin: 20 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI25QQmlEngineExtensionPlugin) +16 (int (*)(...))QQmlEngineExtensionPlugin::metaObject +24 (int (*)(...))QQmlEngineExtensionPlugin::qt_metacast +32 (int (*)(...))QQmlEngineExtensionPlugin::qt_metacall +40 (int (*)(...))QQmlEngineExtensionPlugin::~QQmlEngineExtensionPlugin +48 (int (*)(...))QQmlEngineExtensionPlugin::~QQmlEngineExtensionPlugin +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QQmlEngineExtensionPlugin::initializeEngine +120 (int (*)(...))-16 +128 (int (*)(...))(& _ZTI25QQmlEngineExtensionPlugin) +136 (int (*)(...))QQmlEngineExtensionPlugin::_ZThn16_N25QQmlEngineExtensionPluginD1Ev +144 (int (*)(...))QQmlEngineExtensionPlugin::_ZThn16_N25QQmlEngineExtensionPluginD0Ev +152 (int (*)(...))QQmlEngineExtensionPlugin::_ZThn16_N25QQmlEngineExtensionPlugin16initializeEngineEP10QQmlEnginePKc + +Class QQmlEngineExtensionPlugin + size=24 align=8 + base size=24 base align=8 +QQmlEngineExtensionPlugin (0x0x7319a4f3e1c0) 0 + vptr=((& QQmlEngineExtensionPlugin::_ZTV25QQmlEngineExtensionPlugin) + 16) +QObject (0x0x7319a4f35600) 0 + primary-for QQmlEngineExtensionPlugin (0x0x7319a4f3e1c0) +QQmlEngineExtensionInterface (0x0x7319a4f35660) 16 nearly-empty + vptr=((& QQmlEngineExtensionPlugin::_ZTV25QQmlEngineExtensionPlugin) + 136) + +Class QQmlFile + size=8 align=8 + base size=8 base align=8 +QQmlFile (0x0x7319a4f35780) 0 + +Class QQmlFileSelector::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQmlFileSelector::QPrivateSignal (0x0x7319a4f35840) 0 empty + +Vtable for QQmlFileSelector +QQmlFileSelector::_ZTV16QQmlFileSelector: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI16QQmlFileSelector) +16 (int (*)(...))QQmlFileSelector::metaObject +24 (int (*)(...))QQmlFileSelector::qt_metacast +32 (int (*)(...))QQmlFileSelector::qt_metacall +40 (int (*)(...))QQmlFileSelector::~QQmlFileSelector +48 (int (*)(...))QQmlFileSelector::~QQmlFileSelector +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QQmlFileSelector + size=16 align=8 + base size=16 base align=8 +QQmlFileSelector (0x0x7319a4efa478) 0 + vptr=((& QQmlFileSelector::_ZTV16QQmlFileSelector) + 16) +QObject (0x0x7319a4f357e0) 0 + primary-for QQmlFileSelector (0x0x7319a4efa478) + +Vtable for QQmlIncubator +QQmlIncubator::_ZTV13QQmlIncubator: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QQmlIncubator) +16 (int (*)(...))QQmlIncubator::~QQmlIncubator +24 (int (*)(...))QQmlIncubator::~QQmlIncubator +32 (int (*)(...))QQmlIncubator::statusChanged +40 (int (*)(...))QQmlIncubator::setInitialState + +Class QQmlIncubator + size=16 align=8 + base size=16 base align=8 +QQmlIncubator (0x0x7319a4f359c0) 0 + vptr=((& QQmlIncubator::_ZTV13QQmlIncubator) + 16) + +Vtable for QQmlIncubationController +QQmlIncubationController::_ZTV24QQmlIncubationController: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI24QQmlIncubationController) +16 (int (*)(...))QQmlIncubationController::~QQmlIncubationController +24 (int (*)(...))QQmlIncubationController::~QQmlIncubationController +32 (int (*)(...))QQmlIncubationController::incubatingObjectCountChanged + +Class QQmlIncubationController + size=16 align=8 + base size=16 base align=8 +QQmlIncubationController (0x0x7319a4f35a20) 0 + vptr=((& QQmlIncubationController::_ZTV24QQmlIncubationController) + 16) + +Class QQmlInfo + size=16 align=8 + base size=16 base align=8 +QQmlInfo (0x0x7319a4efa4e0) 0 +QDebug (0x0x7319a4efa548) 0 +QIODeviceBase (0x0x7319a4f35a80) 0 empty + +Class QQmlModuleRegistration + size=8 align=8 + base size=8 base align=8 +QQmlModuleRegistration (0x0x7319a4c09b40) 0 + +Vtable for QQmlNetworkAccessManagerFactory +QQmlNetworkAccessManagerFactory::_ZTV31QQmlNetworkAccessManagerFactory: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI31QQmlNetworkAccessManagerFactory) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual + +Class QQmlNetworkAccessManagerFactory + size=8 align=8 + base size=8 base align=8 +QQmlNetworkAccessManagerFactory (0x0x7319a4c09ba0) 0 nearly-empty + vptr=((& QQmlNetworkAccessManagerFactory::_ZTV31QQmlNetworkAccessManagerFactory) + 16) + +Class QQmlProperty + size=8 align=8 + base size=8 base align=8 +QQmlProperty (0x0x7319a4c09c00) 0 + +Class QQmlPropertyMap::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQmlPropertyMap::QPrivateSignal (0x0x7319a4cacae0) 0 empty + +Vtable for QQmlPropertyMap +QQmlPropertyMap::_ZTV15QQmlPropertyMap: 15 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QQmlPropertyMap) +16 (int (*)(...))QQmlPropertyMap::metaObject +24 (int (*)(...))QQmlPropertyMap::qt_metacast +32 (int (*)(...))QQmlPropertyMap::qt_metacall +40 (int (*)(...))QQmlPropertyMap::~QQmlPropertyMap +48 (int (*)(...))QQmlPropertyMap::~QQmlPropertyMap +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QQmlPropertyMap::updateValue + +Class QQmlPropertyMap + size=16 align=8 + base size=16 base align=8 +QQmlPropertyMap (0x0x7319a4cb4958) 0 + vptr=((& QQmlPropertyMap::_ZTV15QQmlPropertyMap) + 16) +QObject (0x0x7319a4caca80) 0 + primary-for QQmlPropertyMap (0x0x7319a4cb4958) + +Class QQuickTransform::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQuickTransform::QPrivateSignal (0x0x7319a4ce0540) 0 empty + +Vtable for QQuickTransform +QQuickTransform::_ZTV15QQuickTransform: 15 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QQuickTransform) +16 (int (*)(...))QQuickTransform::metaObject +24 (int (*)(...))QQuickTransform::qt_metacast +32 (int (*)(...))QQuickTransform::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual + +Class QQuickTransform + size=16 align=8 + base size=16 base align=8 +QQuickTransform (0x0x7319a4cb4af8) 0 + vptr=((& QQuickTransform::_ZTV15QQuickTransform) + 16) +QObject (0x0x7319a4ce04e0) 0 + primary-for QQuickTransform (0x0x7319a4cb4af8) + +Class QQuickItem::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQuickItem::QPrivateSignal (0x0x7319a4ce07e0) 0 empty + +Class QQuickItem::ItemChangeData + size=8 align=8 + base size=8 base align=8 +QQuickItem::ItemChangeData (0x0x7319a4ce0840) 0 + +Class QQuickItem::UpdatePaintNodeData + size=8 align=8 + base size=8 base align=8 +QQuickItem::UpdatePaintNodeData (0x0x7319a4ce08a0) 0 + +Vtable for QQuickItem +QQuickItem::_ZTV10QQuickItem: 54 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QQuickItem) +16 (int (*)(...))QQuickItem::metaObject +24 (int (*)(...))QQuickItem::qt_metacast +32 (int (*)(...))QQuickItem::qt_metacall +40 (int (*)(...))QQuickItem::~QQuickItem +48 (int (*)(...))QQuickItem::~QQuickItem +56 (int (*)(...))QQuickItem::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QQuickItem::boundingRect +120 (int (*)(...))QQuickItem::clipRect +128 (int (*)(...))QQuickItem::contains +136 (int (*)(...))QQuickItem::inputMethodQuery +144 (int (*)(...))QQuickItem::isTextureProvider +152 (int (*)(...))QQuickItem::textureProvider +160 (int (*)(...))QQuickItem::itemChange +168 (int (*)(...))QQuickItem::geometryChange +176 (int (*)(...))QQuickItem::classBegin +184 (int (*)(...))QQuickItem::componentComplete +192 (int (*)(...))QQuickItem::keyPressEvent +200 (int (*)(...))QQuickItem::keyReleaseEvent +208 (int (*)(...))QQuickItem::inputMethodEvent +216 (int (*)(...))QQuickItem::focusInEvent +224 (int (*)(...))QQuickItem::focusOutEvent +232 (int (*)(...))QQuickItem::mousePressEvent +240 (int (*)(...))QQuickItem::mouseMoveEvent +248 (int (*)(...))QQuickItem::mouseReleaseEvent +256 (int (*)(...))QQuickItem::mouseDoubleClickEvent +264 (int (*)(...))QQuickItem::mouseUngrabEvent +272 (int (*)(...))QQuickItem::touchUngrabEvent +280 (int (*)(...))QQuickItem::wheelEvent +288 (int (*)(...))QQuickItem::touchEvent +296 (int (*)(...))QQuickItem::hoverEnterEvent +304 (int (*)(...))QQuickItem::hoverMoveEvent +312 (int (*)(...))QQuickItem::hoverLeaveEvent +320 (int (*)(...))QQuickItem::dragEnterEvent +328 (int (*)(...))QQuickItem::dragMoveEvent +336 (int (*)(...))QQuickItem::dragLeaveEvent +344 (int (*)(...))QQuickItem::dropEvent +352 (int (*)(...))QQuickItem::childMouseEventFilter +360 (int (*)(...))QQuickItem::updatePaintNode +368 (int (*)(...))QQuickItem::releaseResources +376 (int (*)(...))QQuickItem::updatePolish +384 (int (*)(...))-16 +392 (int (*)(...))(& _ZTI10QQuickItem) +400 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItemD1Ev +408 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItemD0Ev +416 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem10classBeginEv +424 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem17componentCompleteEv + +Class QQuickItem + size=32 align=8 + base size=32 base align=8 +QQuickItem (0x0x7319a4c9ae00) 0 + vptr=((& QQuickItem::_ZTV10QQuickItem) + 16) +QObject (0x0x7319a4ce0720) 0 + primary-for QQuickItem (0x0x7319a4c9ae00) +QQmlParserStatus (0x0x7319a4ce0780) 16 + vptr=((& QQuickItem::_ZTV10QQuickItem) + 400) + +Class QQuickFramebufferObject::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQuickFramebufferObject::QPrivateSignal (0x0x7319a4d81a20) 0 empty + +Vtable for QQuickFramebufferObject::Renderer +QQuickFramebufferObject::Renderer::_ZTVN23QQuickFramebufferObject8RendererE: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN23QQuickFramebufferObject8RendererE) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))QQuickFramebufferObject::Renderer::createFramebufferObject +48 (int (*)(...))QQuickFramebufferObject::Renderer::synchronize + +Class QQuickFramebufferObject::Renderer + size=16 align=8 + base size=16 base align=8 +QQuickFramebufferObject::Renderer (0x0x7319a4d81a80) 0 + vptr=((& QQuickFramebufferObject::Renderer::_ZTVN23QQuickFramebufferObject8RendererE) + 16) + +Vtable for QQuickFramebufferObject +QQuickFramebufferObject::_ZTV23QQuickFramebufferObject: 55 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI23QQuickFramebufferObject) +16 (int (*)(...))QQuickFramebufferObject::metaObject +24 (int (*)(...))QQuickFramebufferObject::qt_metacast +32 (int (*)(...))QQuickFramebufferObject::qt_metacall +40 0 +48 0 +56 (int (*)(...))QQuickItem::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QQuickItem::boundingRect +120 (int (*)(...))QQuickItem::clipRect +128 (int (*)(...))QQuickItem::contains +136 (int (*)(...))QQuickItem::inputMethodQuery +144 (int (*)(...))QQuickFramebufferObject::isTextureProvider +152 (int (*)(...))QQuickFramebufferObject::textureProvider +160 (int (*)(...))QQuickItem::itemChange +168 (int (*)(...))QQuickFramebufferObject::geometryChange +176 (int (*)(...))QQuickItem::classBegin +184 (int (*)(...))QQuickItem::componentComplete +192 (int (*)(...))QQuickItem::keyPressEvent +200 (int (*)(...))QQuickItem::keyReleaseEvent +208 (int (*)(...))QQuickItem::inputMethodEvent +216 (int (*)(...))QQuickItem::focusInEvent +224 (int (*)(...))QQuickItem::focusOutEvent +232 (int (*)(...))QQuickItem::mousePressEvent +240 (int (*)(...))QQuickItem::mouseMoveEvent +248 (int (*)(...))QQuickItem::mouseReleaseEvent +256 (int (*)(...))QQuickItem::mouseDoubleClickEvent +264 (int (*)(...))QQuickItem::mouseUngrabEvent +272 (int (*)(...))QQuickItem::touchUngrabEvent +280 (int (*)(...))QQuickItem::wheelEvent +288 (int (*)(...))QQuickItem::touchEvent +296 (int (*)(...))QQuickItem::hoverEnterEvent +304 (int (*)(...))QQuickItem::hoverMoveEvent +312 (int (*)(...))QQuickItem::hoverLeaveEvent +320 (int (*)(...))QQuickItem::dragEnterEvent +328 (int (*)(...))QQuickItem::dragMoveEvent +336 (int (*)(...))QQuickItem::dragLeaveEvent +344 (int (*)(...))QQuickItem::dropEvent +352 (int (*)(...))QQuickItem::childMouseEventFilter +360 (int (*)(...))QQuickFramebufferObject::updatePaintNode +368 (int (*)(...))QQuickFramebufferObject::releaseResources +376 (int (*)(...))QQuickItem::updatePolish +384 (int (*)(...))__cxa_pure_virtual +392 (int (*)(...))-16 +400 (int (*)(...))(& _ZTI23QQuickFramebufferObject) +408 0 +416 0 +424 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem10classBeginEv +432 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem17componentCompleteEv + +Class QQuickFramebufferObject + size=32 align=8 + base size=32 base align=8 +QQuickFramebufferObject (0x0x7319a4cb4dd0) 0 + vptr=((& QQuickFramebufferObject::_ZTV23QQuickFramebufferObject) + 16) +QQuickItem (0x0x7319a4d84850) 0 + primary-for QQuickFramebufferObject (0x0x7319a4cb4dd0) +QObject (0x0x7319a4d81960) 0 + primary-for QQuickItem (0x0x7319a4d84850) +QQmlParserStatus (0x0x7319a4d819c0) 16 + vptr=((& QQuickFramebufferObject::_ZTV23QQuickFramebufferObject) + 408) + +Class QQuickGraphicsConfiguration + size=8 align=8 + base size=8 base align=8 +QQuickGraphicsConfiguration (0x0x7319a4d81c00) 0 + +Class VkExtent2D + size=8 align=4 + base size=8 base align=4 +VkExtent2D (0x0x7319a4d81c60) 0 + +Class VkExtent3D + size=12 align=4 + base size=12 base align=4 +VkExtent3D (0x0x7319a4d81cc0) 0 + +Class VkOffset2D + size=8 align=4 + base size=8 base align=4 +VkOffset2D (0x0x7319a4d81d20) 0 + +Class VkOffset3D + size=12 align=4 + base size=12 base align=4 +VkOffset3D (0x0x7319a4d81d80) 0 + +Class VkRect2D + size=16 align=4 + base size=16 base align=4 +VkRect2D (0x0x7319a4d81de0) 0 + +Class VkBaseInStructure + size=16 align=8 + base size=16 base align=8 +VkBaseInStructure (0x0x7319a4d81e40) 0 + +Class VkBaseOutStructure + size=16 align=8 + base size=16 base align=8 +VkBaseOutStructure (0x0x7319a4d81ea0) 0 + +Class VkBufferMemoryBarrier + size=56 align=8 + base size=56 base align=8 +VkBufferMemoryBarrier (0x0x7319a4d81f00) 0 + +Class VkDispatchIndirectCommand + size=12 align=4 + base size=12 base align=4 +VkDispatchIndirectCommand (0x0x7319a4d81f60) 0 + +Class VkDrawIndexedIndirectCommand + size=20 align=4 + base size=20 base align=4 +VkDrawIndexedIndirectCommand (0x0x7319a4aaa000) 0 + +Class VkDrawIndirectCommand + size=16 align=4 + base size=16 base align=4 +VkDrawIndirectCommand (0x0x7319a4aaa060) 0 + +Class VkImageSubresourceRange + size=20 align=4 + base size=20 base align=4 +VkImageSubresourceRange (0x0x7319a4aaa0c0) 0 + +Class VkImageMemoryBarrier + size=72 align=8 + base size=72 base align=8 +VkImageMemoryBarrier (0x0x7319a4aaa120) 0 + +Class VkMemoryBarrier + size=24 align=8 + base size=24 base align=8 +VkMemoryBarrier (0x0x7319a4aaa1e0) 0 + +Class VkPipelineCacheHeaderVersionOne + size=32 align=4 + base size=32 base align=4 +VkPipelineCacheHeaderVersionOne (0x0x7319a4aaa240) 0 + +Class VkAllocationCallbacks + size=48 align=8 + base size=48 base align=8 +VkAllocationCallbacks (0x0x7319a4aaa2a0) 0 + +Class VkApplicationInfo + size=48 align=8 + base size=48 base align=8 +VkApplicationInfo (0x0x7319a4aaa300) 0 + +Class VkFormatProperties + size=12 align=4 + base size=12 base align=4 +VkFormatProperties (0x0x7319a4aaa360) 0 + +Class VkImageFormatProperties + size=32 align=8 + base size=32 base align=8 +VkImageFormatProperties (0x0x7319a4aaa3c0) 0 + +Class VkInstanceCreateInfo + size=64 align=8 + base size=64 base align=8 +VkInstanceCreateInfo (0x0x7319a4aaa420) 0 + +Class VkMemoryHeap + size=16 align=8 + base size=16 base align=8 +VkMemoryHeap (0x0x7319a4aaa480) 0 + +Class VkMemoryType + size=8 align=4 + base size=8 base align=4 +VkMemoryType (0x0x7319a4aaa4e0) 0 + +Class VkPhysicalDeviceFeatures + size=220 align=4 + base size=220 base align=4 +VkPhysicalDeviceFeatures (0x0x7319a4aaa540) 0 + +Class VkPhysicalDeviceLimits + size=504 align=8 + base size=504 base align=8 +VkPhysicalDeviceLimits (0x0x7319a4aaa5a0) 0 + +Class VkPhysicalDeviceMemoryProperties + size=520 align=8 + base size=520 base align=8 +VkPhysicalDeviceMemoryProperties (0x0x7319a4aaa600) 0 + +Class VkPhysicalDeviceSparseProperties + size=20 align=4 + base size=20 base align=4 +VkPhysicalDeviceSparseProperties (0x0x7319a4aaa660) 0 + +Class VkPhysicalDeviceProperties + size=824 align=8 + base size=824 base align=8 +VkPhysicalDeviceProperties (0x0x7319a4aaa6c0) 0 + +Class VkQueueFamilyProperties + size=24 align=4 + base size=24 base align=4 +VkQueueFamilyProperties (0x0x7319a4aaa720) 0 + +Class VkDeviceQueueCreateInfo + size=40 align=8 + base size=40 base align=8 +VkDeviceQueueCreateInfo (0x0x7319a4aaa780) 0 + +Class VkDeviceCreateInfo + size=72 align=8 + base size=72 base align=8 +VkDeviceCreateInfo (0x0x7319a4aaa7e0) 0 + +Class VkExtensionProperties + size=260 align=4 + base size=260 base align=4 +VkExtensionProperties (0x0x7319a4aaa8a0) 0 + +Class VkLayerProperties + size=520 align=4 + base size=520 base align=4 +VkLayerProperties (0x0x7319a4aaa900) 0 + +Class VkSubmitInfo + size=72 align=8 + base size=72 base align=8 +VkSubmitInfo (0x0x7319a4aaa960) 0 + +Class VkMappedMemoryRange + size=40 align=8 + base size=40 base align=8 +VkMappedMemoryRange (0x0x7319a4aaa9c0) 0 + +Class VkMemoryAllocateInfo + size=32 align=8 + base size=32 base align=8 +VkMemoryAllocateInfo (0x0x7319a4aaaa20) 0 + +Class VkMemoryRequirements + size=24 align=8 + base size=24 base align=8 +VkMemoryRequirements (0x0x7319a4aaaa80) 0 + +Class VkSparseMemoryBind + size=40 align=8 + base size=40 base align=8 +VkSparseMemoryBind (0x0x7319a4aaaae0) 0 + +Class VkSparseBufferMemoryBindInfo + size=24 align=8 + base size=24 base align=8 +VkSparseBufferMemoryBindInfo (0x0x7319a4aaab40) 0 + +Class VkSparseImageOpaqueMemoryBindInfo + size=24 align=8 + base size=24 base align=8 +VkSparseImageOpaqueMemoryBindInfo (0x0x7319a4aaaba0) 0 + +Class VkImageSubresource + size=12 align=4 + base size=12 base align=4 +VkImageSubresource (0x0x7319a4aaac00) 0 + +Class VkSparseImageMemoryBind + size=64 align=8 + base size=64 base align=8 +VkSparseImageMemoryBind (0x0x7319a4aaac60) 0 + +Class VkSparseImageMemoryBindInfo + size=24 align=8 + base size=24 base align=8 +VkSparseImageMemoryBindInfo (0x0x7319a4aaacc0) 0 + +Class VkBindSparseInfo + size=96 align=8 + base size=96 base align=8 +VkBindSparseInfo (0x0x7319a4aaad20) 0 + +Class VkSparseImageFormatProperties + size=20 align=4 + base size=20 base align=4 +VkSparseImageFormatProperties (0x0x7319a4aaad80) 0 + +Class VkSparseImageMemoryRequirements + size=48 align=8 + base size=48 base align=8 +VkSparseImageMemoryRequirements (0x0x7319a4aaade0) 0 + +Class VkFenceCreateInfo + size=24 align=8 + base size=24 base align=8 +VkFenceCreateInfo (0x0x7319a4aaae40) 0 + +Class VkSemaphoreCreateInfo + size=24 align=8 + base size=24 base align=8 +VkSemaphoreCreateInfo (0x0x7319a4aaaea0) 0 + +Class VkEventCreateInfo + size=24 align=8 + base size=24 base align=8 +VkEventCreateInfo (0x0x7319a4aaaf00) 0 + +Class VkQueryPoolCreateInfo + size=32 align=8 + base size=32 base align=8 +VkQueryPoolCreateInfo (0x0x7319a4aaaf60) 0 + +Class VkBufferCreateInfo + size=56 align=8 + base size=56 base align=8 +VkBufferCreateInfo (0x0x7319a4aca000) 0 + +Class VkBufferViewCreateInfo + size=56 align=8 + base size=56 base align=8 +VkBufferViewCreateInfo (0x0x7319a4aca060) 0 + +Class VkImageCreateInfo + size=88 align=8 + base size=88 base align=8 +VkImageCreateInfo (0x0x7319a4aca0c0) 0 + +Class VkSubresourceLayout + size=40 align=8 + base size=40 base align=8 +VkSubresourceLayout (0x0x7319a4aca120) 0 + +Class VkComponentMapping + size=16 align=4 + base size=16 base align=4 +VkComponentMapping (0x0x7319a4aca180) 0 + +Class VkImageViewCreateInfo + size=80 align=8 + base size=80 base align=8 +VkImageViewCreateInfo (0x0x7319a4aca1e0) 0 + +Class VkShaderModuleCreateInfo + size=40 align=8 + base size=40 base align=8 +VkShaderModuleCreateInfo (0x0x7319a4aca240) 0 + +Class VkPipelineCacheCreateInfo + size=40 align=8 + base size=40 base align=8 +VkPipelineCacheCreateInfo (0x0x7319a4aca2a0) 0 + +Class VkSpecializationMapEntry + size=16 align=8 + base size=16 base align=8 +VkSpecializationMapEntry (0x0x7319a4aca300) 0 + +Class VkSpecializationInfo + size=32 align=8 + base size=32 base align=8 +VkSpecializationInfo (0x0x7319a4aca360) 0 + +Class VkPipelineShaderStageCreateInfo + size=48 align=8 + base size=48 base align=8 +VkPipelineShaderStageCreateInfo (0x0x7319a4aca3c0) 0 + +Class VkComputePipelineCreateInfo + size=96 align=8 + base size=96 base align=8 +VkComputePipelineCreateInfo (0x0x7319a4aca420) 0 + +Class VkVertexInputBindingDescription + size=12 align=4 + base size=12 base align=4 +VkVertexInputBindingDescription (0x0x7319a4aca480) 0 + +Class VkVertexInputAttributeDescription + size=16 align=4 + base size=16 base align=4 +VkVertexInputAttributeDescription (0x0x7319a4aca4e0) 0 + +Class VkPipelineVertexInputStateCreateInfo + size=48 align=8 + base size=48 base align=8 +VkPipelineVertexInputStateCreateInfo (0x0x7319a4aca540) 0 + +Class VkPipelineInputAssemblyStateCreateInfo + size=32 align=8 + base size=32 base align=8 +VkPipelineInputAssemblyStateCreateInfo (0x0x7319a4aca5a0) 0 + +Class VkPipelineTessellationStateCreateInfo + size=24 align=8 + base size=24 base align=8 +VkPipelineTessellationStateCreateInfo (0x0x7319a4aca600) 0 + +Class VkViewport + size=24 align=4 + base size=24 base align=4 +VkViewport (0x0x7319a4aca660) 0 + +Class VkPipelineViewportStateCreateInfo + size=48 align=8 + base size=48 base align=8 +VkPipelineViewportStateCreateInfo (0x0x7319a4aca6c0) 0 + +Class VkPipelineRasterizationStateCreateInfo + size=64 align=8 + base size=64 base align=8 +VkPipelineRasterizationStateCreateInfo (0x0x7319a4aca720) 0 + +Class VkPipelineMultisampleStateCreateInfo + size=48 align=8 + base size=48 base align=8 +VkPipelineMultisampleStateCreateInfo (0x0x7319a4aca780) 0 + +Class VkStencilOpState + size=28 align=4 + base size=28 base align=4 +VkStencilOpState (0x0x7319a4aca7e0) 0 + +Class VkPipelineDepthStencilStateCreateInfo + size=104 align=8 + base size=104 base align=8 +VkPipelineDepthStencilStateCreateInfo (0x0x7319a4aca840) 0 + +Class VkPipelineColorBlendAttachmentState + size=32 align=4 + base size=32 base align=4 +VkPipelineColorBlendAttachmentState (0x0x7319a4aca8a0) 0 + +Class VkPipelineColorBlendStateCreateInfo + size=56 align=8 + base size=56 base align=8 +VkPipelineColorBlendStateCreateInfo (0x0x7319a4aca900) 0 + +Class VkPipelineDynamicStateCreateInfo + size=32 align=8 + base size=32 base align=8 +VkPipelineDynamicStateCreateInfo (0x0x7319a4aca960) 0 + +Class VkGraphicsPipelineCreateInfo + size=144 align=8 + base size=144 base align=8 +VkGraphicsPipelineCreateInfo (0x0x7319a4aca9c0) 0 + +Class VkPushConstantRange + size=12 align=4 + base size=12 base align=4 +VkPushConstantRange (0x0x7319a4acaa20) 0 + +Class VkPipelineLayoutCreateInfo + size=48 align=8 + base size=48 base align=8 +VkPipelineLayoutCreateInfo (0x0x7319a4acaa80) 0 + +Class VkSamplerCreateInfo + size=80 align=8 + base size=80 base align=8 +VkSamplerCreateInfo (0x0x7319a4acaae0) 0 + +Class VkCopyDescriptorSet + size=56 align=8 + base size=56 base align=8 +VkCopyDescriptorSet (0x0x7319a4acab40) 0 + +Class VkDescriptorBufferInfo + size=24 align=8 + base size=24 base align=8 +VkDescriptorBufferInfo (0x0x7319a4acaba0) 0 + +Class VkDescriptorImageInfo + size=24 align=8 + base size=24 base align=8 +VkDescriptorImageInfo (0x0x7319a4acac00) 0 + +Class VkDescriptorPoolSize + size=8 align=4 + base size=8 base align=4 +VkDescriptorPoolSize (0x0x7319a4acac60) 0 + +Class VkDescriptorPoolCreateInfo + size=40 align=8 + base size=40 base align=8 +VkDescriptorPoolCreateInfo (0x0x7319a4acacc0) 0 + +Class VkDescriptorSetAllocateInfo + size=40 align=8 + base size=40 base align=8 +VkDescriptorSetAllocateInfo (0x0x7319a4acad20) 0 + +Class VkDescriptorSetLayoutBinding + size=24 align=8 + base size=24 base align=8 +VkDescriptorSetLayoutBinding (0x0x7319a4acad80) 0 + +Class VkDescriptorSetLayoutCreateInfo + size=32 align=8 + base size=32 base align=8 +VkDescriptorSetLayoutCreateInfo (0x0x7319a4acade0) 0 + +Class VkWriteDescriptorSet + size=64 align=8 + base size=64 base align=8 +VkWriteDescriptorSet (0x0x7319a4acae40) 0 + +Class VkAttachmentDescription + size=36 align=4 + base size=36 base align=4 +VkAttachmentDescription (0x0x7319a4acaf00) 0 + +Class VkAttachmentReference + size=8 align=4 + base size=8 base align=4 +VkAttachmentReference (0x0x7319a4acaf60) 0 + +Class VkFramebufferCreateInfo + size=64 align=8 + base size=64 base align=8 +VkFramebufferCreateInfo (0x0x7319a4ae7000) 0 + +Class VkSubpassDescription + size=72 align=8 + base size=72 base align=8 +VkSubpassDescription (0x0x7319a4ae7060) 0 + +Class VkSubpassDependency + size=28 align=4 + base size=28 base align=4 +VkSubpassDependency (0x0x7319a4ae7120) 0 + +Class VkRenderPassCreateInfo + size=64 align=8 + base size=64 base align=8 +VkRenderPassCreateInfo (0x0x7319a4ae7180) 0 + +Class VkCommandPoolCreateInfo + size=24 align=8 + base size=24 base align=8 +VkCommandPoolCreateInfo (0x0x7319a4ae71e0) 0 + +Class VkCommandBufferAllocateInfo + size=32 align=8 + base size=32 base align=8 +VkCommandBufferAllocateInfo (0x0x7319a4ae7240) 0 + +Class VkCommandBufferInheritanceInfo + size=56 align=8 + base size=56 base align=8 +VkCommandBufferInheritanceInfo (0x0x7319a4ae72a0) 0 + +Class VkCommandBufferBeginInfo + size=32 align=8 + base size=32 base align=8 +VkCommandBufferBeginInfo (0x0x7319a4ae7300) 0 + +Class VkBufferCopy + size=24 align=8 + base size=24 base align=8 +VkBufferCopy (0x0x7319a4ae7360) 0 + +Class VkImageSubresourceLayers + size=16 align=4 + base size=16 base align=4 +VkImageSubresourceLayers (0x0x7319a4ae73c0) 0 + +Class VkBufferImageCopy + size=56 align=8 + base size=56 base align=8 +VkBufferImageCopy (0x0x7319a4ae7420) 0 + +Class VkClearColorValue + size=16 align=4 + base size=16 base align=4 +VkClearColorValue (0x0x7319a4ae7480) 0 + +Class VkClearDepthStencilValue + size=8 align=4 + base size=8 base align=4 +VkClearDepthStencilValue (0x0x7319a4ae74e0) 0 + +Class VkClearValue + size=16 align=4 + base size=16 base align=4 +VkClearValue (0x0x7319a4ae7540) 0 + +Class VkClearAttachment + size=24 align=4 + base size=24 base align=4 +VkClearAttachment (0x0x7319a4ae75a0) 0 + +Class VkClearRect + size=24 align=4 + base size=24 base align=4 +VkClearRect (0x0x7319a4ae7600) 0 + +Class VkImageBlit + size=80 align=4 + base size=80 base align=4 +VkImageBlit (0x0x7319a4ae7660) 0 + +Class VkImageCopy + size=68 align=4 + base size=68 base align=4 +VkImageCopy (0x0x7319a4ae76c0) 0 + +Class VkImageResolve + size=68 align=4 + base size=68 base align=4 +VkImageResolve (0x0x7319a4ae7720) 0 + +Class VkRenderPassBeginInfo + size=64 align=8 + base size=64 base align=8 +VkRenderPassBeginInfo (0x0x7319a4ae7780) 0 + +Class VkPhysicalDeviceSubgroupProperties + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceSubgroupProperties (0x0x7319a4ae77e0) 0 + +Class VkBindBufferMemoryInfo + size=40 align=8 + base size=40 base align=8 +VkBindBufferMemoryInfo (0x0x7319a4ae7840) 0 + +Class VkBindImageMemoryInfo + size=40 align=8 + base size=40 base align=8 +VkBindImageMemoryInfo (0x0x7319a4ae78a0) 0 + +Class VkPhysicalDevice16BitStorageFeatures + size=32 align=8 + base size=32 base align=8 +VkPhysicalDevice16BitStorageFeatures (0x0x7319a4ae7900) 0 + +Class VkMemoryDedicatedRequirements + size=24 align=8 + base size=24 base align=8 +VkMemoryDedicatedRequirements (0x0x7319a4ae7960) 0 + +Class VkMemoryDedicatedAllocateInfo + size=32 align=8 + base size=32 base align=8 +VkMemoryDedicatedAllocateInfo (0x0x7319a4ae79c0) 0 + +Class VkMemoryAllocateFlagsInfo + size=24 align=8 + base size=24 base align=8 +VkMemoryAllocateFlagsInfo (0x0x7319a4ae7a20) 0 + +Class VkDeviceGroupRenderPassBeginInfo + size=32 align=8 + base size=32 base align=8 +VkDeviceGroupRenderPassBeginInfo (0x0x7319a4ae7a80) 0 + +Class VkDeviceGroupCommandBufferBeginInfo + size=24 align=8 + base size=24 base align=8 +VkDeviceGroupCommandBufferBeginInfo (0x0x7319a4ae7ae0) 0 + +Class VkDeviceGroupSubmitInfo + size=64 align=8 + base size=64 base align=8 +VkDeviceGroupSubmitInfo (0x0x7319a4ae7b40) 0 + +Class VkDeviceGroupBindSparseInfo + size=24 align=8 + base size=24 base align=8 +VkDeviceGroupBindSparseInfo (0x0x7319a4ae7ba0) 0 + +Class VkBindBufferMemoryDeviceGroupInfo + size=32 align=8 + base size=32 base align=8 +VkBindBufferMemoryDeviceGroupInfo (0x0x7319a4ae7c00) 0 + +Class VkBindImageMemoryDeviceGroupInfo + size=48 align=8 + base size=48 base align=8 +VkBindImageMemoryDeviceGroupInfo (0x0x7319a4ae7c60) 0 + +Class VkPhysicalDeviceGroupProperties + size=288 align=8 + base size=288 base align=8 +VkPhysicalDeviceGroupProperties (0x0x7319a4ae7cc0) 0 + +Class VkDeviceGroupDeviceCreateInfo + size=32 align=8 + base size=32 base align=8 +VkDeviceGroupDeviceCreateInfo (0x0x7319a4ae7d20) 0 + +Class VkBufferMemoryRequirementsInfo2 + size=24 align=8 + base size=24 base align=8 +VkBufferMemoryRequirementsInfo2 (0x0x7319a4ae7d80) 0 + +Class VkImageMemoryRequirementsInfo2 + size=24 align=8 + base size=24 base align=8 +VkImageMemoryRequirementsInfo2 (0x0x7319a4ae7de0) 0 + +Class VkImageSparseMemoryRequirementsInfo2 + size=24 align=8 + base size=24 base align=8 +VkImageSparseMemoryRequirementsInfo2 (0x0x7319a4ae7e40) 0 + +Class VkMemoryRequirements2 + size=40 align=8 + base size=40 base align=8 +VkMemoryRequirements2 (0x0x7319a4ae7ea0) 0 + +Class VkSparseImageMemoryRequirements2 + size=64 align=8 + base size=64 base align=8 +VkSparseImageMemoryRequirements2 (0x0x7319a4ae7f00) 0 + +Class VkPhysicalDeviceFeatures2 + size=240 align=8 + base size=240 base align=8 +VkPhysicalDeviceFeatures2 (0x0x7319a4ae7f60) 0 + +Class VkPhysicalDeviceProperties2 + size=840 align=8 + base size=840 base align=8 +VkPhysicalDeviceProperties2 (0x0x7319a4b60000) 0 + +Class VkFormatProperties2 + size=32 align=8 + base size=32 base align=8 +VkFormatProperties2 (0x0x7319a4b60060) 0 + +Class VkImageFormatProperties2 + size=48 align=8 + base size=48 base align=8 +VkImageFormatProperties2 (0x0x7319a4b600c0) 0 + +Class VkPhysicalDeviceImageFormatInfo2 + size=40 align=8 + base size=40 base align=8 +VkPhysicalDeviceImageFormatInfo2 (0x0x7319a4b60120) 0 + +Class VkQueueFamilyProperties2 + size=40 align=8 + base size=40 base align=8 +VkQueueFamilyProperties2 (0x0x7319a4b60180) 0 + +Class VkPhysicalDeviceMemoryProperties2 + size=536 align=8 + base size=536 base align=8 +VkPhysicalDeviceMemoryProperties2 (0x0x7319a4b601e0) 0 + +Class VkSparseImageFormatProperties2 + size=40 align=8 + base size=40 base align=8 +VkSparseImageFormatProperties2 (0x0x7319a4b60240) 0 + +Class VkPhysicalDeviceSparseImageFormatInfo2 + size=40 align=8 + base size=40 base align=8 +VkPhysicalDeviceSparseImageFormatInfo2 (0x0x7319a4b602a0) 0 + +Class VkPhysicalDevicePointClippingProperties + size=24 align=8 + base size=24 base align=8 +VkPhysicalDevicePointClippingProperties (0x0x7319a4b60300) 0 + +Class VkInputAttachmentAspectReference + size=12 align=4 + base size=12 base align=4 +VkInputAttachmentAspectReference (0x0x7319a4b60360) 0 + +Class VkRenderPassInputAttachmentAspectCreateInfo + size=32 align=8 + base size=32 base align=8 +VkRenderPassInputAttachmentAspectCreateInfo (0x0x7319a4b603c0) 0 + +Class VkImageViewUsageCreateInfo + size=24 align=8 + base size=24 base align=8 +VkImageViewUsageCreateInfo (0x0x7319a4b60420) 0 + +Class VkPipelineTessellationDomainOriginStateCreateInfo + size=24 align=8 + base size=24 base align=8 +VkPipelineTessellationDomainOriginStateCreateInfo (0x0x7319a4b60480) 0 + +Class VkRenderPassMultiviewCreateInfo + size=64 align=8 + base size=64 base align=8 +VkRenderPassMultiviewCreateInfo (0x0x7319a4b604e0) 0 + +Class VkPhysicalDeviceMultiviewFeatures + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceMultiviewFeatures (0x0x7319a4b60540) 0 + +Class VkPhysicalDeviceMultiviewProperties + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceMultiviewProperties (0x0x7319a4b605a0) 0 + +Class VkPhysicalDeviceVariablePointersFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceVariablePointersFeatures (0x0x7319a4b60600) 0 + +Class VkPhysicalDeviceProtectedMemoryFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceProtectedMemoryFeatures (0x0x7319a4b60660) 0 + +Class VkPhysicalDeviceProtectedMemoryProperties + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceProtectedMemoryProperties (0x0x7319a4b606c0) 0 + +Class VkDeviceQueueInfo2 + size=32 align=8 + base size=32 base align=8 +VkDeviceQueueInfo2 (0x0x7319a4b60720) 0 + +Class VkProtectedSubmitInfo + size=24 align=8 + base size=24 base align=8 +VkProtectedSubmitInfo (0x0x7319a4b60780) 0 + +Class VkSamplerYcbcrConversionCreateInfo + size=64 align=8 + base size=64 base align=8 +VkSamplerYcbcrConversionCreateInfo (0x0x7319a4b607e0) 0 + +Class VkSamplerYcbcrConversionInfo + size=24 align=8 + base size=24 base align=8 +VkSamplerYcbcrConversionInfo (0x0x7319a4b608a0) 0 + +Class VkBindImagePlaneMemoryInfo + size=24 align=8 + base size=24 base align=8 +VkBindImagePlaneMemoryInfo (0x0x7319a4b60900) 0 + +Class VkImagePlaneMemoryRequirementsInfo + size=24 align=8 + base size=24 base align=8 +VkImagePlaneMemoryRequirementsInfo (0x0x7319a4b60960) 0 + +Class VkPhysicalDeviceSamplerYcbcrConversionFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceSamplerYcbcrConversionFeatures (0x0x7319a4b609c0) 0 + +Class VkSamplerYcbcrConversionImageFormatProperties + size=24 align=8 + base size=24 base align=8 +VkSamplerYcbcrConversionImageFormatProperties (0x0x7319a4b60a20) 0 + +Class VkDescriptorUpdateTemplateEntry + size=32 align=8 + base size=32 base align=8 +VkDescriptorUpdateTemplateEntry (0x0x7319a4b60a80) 0 + +Class VkDescriptorUpdateTemplateCreateInfo + size=72 align=8 + base size=72 base align=8 +VkDescriptorUpdateTemplateCreateInfo (0x0x7319a4b60ae0) 0 + +Class VkExternalMemoryProperties + size=12 align=4 + base size=12 base align=4 +VkExternalMemoryProperties (0x0x7319a4b60ba0) 0 + +Class VkPhysicalDeviceExternalImageFormatInfo + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceExternalImageFormatInfo (0x0x7319a4b60c00) 0 + +Class VkExternalImageFormatProperties + size=32 align=8 + base size=32 base align=8 +VkExternalImageFormatProperties (0x0x7319a4b60c60) 0 + +Class VkPhysicalDeviceExternalBufferInfo + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceExternalBufferInfo (0x0x7319a4b60cc0) 0 + +Class VkExternalBufferProperties + size=32 align=8 + base size=32 base align=8 +VkExternalBufferProperties (0x0x7319a4b60d20) 0 + +Class VkPhysicalDeviceIDProperties + size=64 align=8 + base size=64 base align=8 +VkPhysicalDeviceIDProperties (0x0x7319a4b60d80) 0 + +Class VkExternalMemoryImageCreateInfo + size=24 align=8 + base size=24 base align=8 +VkExternalMemoryImageCreateInfo (0x0x7319a4b60de0) 0 + +Class VkExternalMemoryBufferCreateInfo + size=24 align=8 + base size=24 base align=8 +VkExternalMemoryBufferCreateInfo (0x0x7319a4b60e40) 0 + +Class VkExportMemoryAllocateInfo + size=24 align=8 + base size=24 base align=8 +VkExportMemoryAllocateInfo (0x0x7319a4b60ea0) 0 + +Class VkPhysicalDeviceExternalFenceInfo + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceExternalFenceInfo (0x0x7319a4b60f00) 0 + +Class VkExternalFenceProperties + size=32 align=8 + base size=32 base align=8 +VkExternalFenceProperties (0x0x7319a4b60f60) 0 + +Class VkExportFenceCreateInfo + size=24 align=8 + base size=24 base align=8 +VkExportFenceCreateInfo (0x0x7319a4b75000) 0 + +Class VkExportSemaphoreCreateInfo + size=24 align=8 + base size=24 base align=8 +VkExportSemaphoreCreateInfo (0x0x7319a4b75060) 0 + +Class VkPhysicalDeviceExternalSemaphoreInfo + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceExternalSemaphoreInfo (0x0x7319a4b750c0) 0 + +Class VkExternalSemaphoreProperties + size=32 align=8 + base size=32 base align=8 +VkExternalSemaphoreProperties (0x0x7319a4b75120) 0 + +Class VkPhysicalDeviceMaintenance3Properties + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceMaintenance3Properties (0x0x7319a4b75180) 0 + +Class VkDescriptorSetLayoutSupport + size=24 align=8 + base size=24 base align=8 +VkDescriptorSetLayoutSupport (0x0x7319a4b751e0) 0 + +Class VkPhysicalDeviceShaderDrawParametersFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceShaderDrawParametersFeatures (0x0x7319a4b75240) 0 + +Class VkPhysicalDeviceVulkan11Features + size=64 align=8 + base size=64 base align=8 +VkPhysicalDeviceVulkan11Features (0x0x7319a4b752a0) 0 + +Class VkPhysicalDeviceVulkan11Properties + size=112 align=8 + base size=112 base align=8 +VkPhysicalDeviceVulkan11Properties (0x0x7319a4b75300) 0 + +Class VkPhysicalDeviceVulkan12Features + size=208 align=8 + base size=208 base align=8 +VkPhysicalDeviceVulkan12Features (0x0x7319a4b75360) 0 + +Class VkConformanceVersion + size=4 align=1 + base size=4 base align=1 +VkConformanceVersion (0x0x7319a4b753c0) 0 + +Class VkPhysicalDeviceVulkan12Properties + size=736 align=8 + base size=736 base align=8 +VkPhysicalDeviceVulkan12Properties (0x0x7319a4b75420) 0 + +Class VkImageFormatListCreateInfo + size=32 align=8 + base size=32 base align=8 +VkImageFormatListCreateInfo (0x0x7319a4b75480) 0 + +Class VkAttachmentDescription2 + size=56 align=8 + base size=56 base align=8 +VkAttachmentDescription2 (0x0x7319a4b754e0) 0 + +Class VkAttachmentReference2 + size=32 align=8 + base size=32 base align=8 +VkAttachmentReference2 (0x0x7319a4b75540) 0 + +Class VkSubpassDescription2 + size=88 align=8 + base size=88 base align=8 +VkSubpassDescription2 (0x0x7319a4b755a0) 0 + +Class VkSubpassDependency2 + size=48 align=8 + base size=48 base align=8 +VkSubpassDependency2 (0x0x7319a4b75600) 0 + +Class VkRenderPassCreateInfo2 + size=80 align=8 + base size=80 base align=8 +VkRenderPassCreateInfo2 (0x0x7319a4b756c0) 0 + +Class VkSubpassBeginInfo + size=24 align=8 + base size=24 base align=8 +VkSubpassBeginInfo (0x0x7319a4b75720) 0 + +Class VkSubpassEndInfo + size=16 align=8 + base size=16 base align=8 +VkSubpassEndInfo (0x0x7319a4b75780) 0 + +Class VkPhysicalDevice8BitStorageFeatures + size=32 align=8 + base size=32 base align=8 +VkPhysicalDevice8BitStorageFeatures (0x0x7319a4b757e0) 0 + +Class VkPhysicalDeviceDriverProperties + size=536 align=8 + base size=536 base align=8 +VkPhysicalDeviceDriverProperties (0x0x7319a4b75840) 0 + +Class VkPhysicalDeviceShaderAtomicInt64Features + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceShaderAtomicInt64Features (0x0x7319a4b758a0) 0 + +Class VkPhysicalDeviceShaderFloat16Int8Features + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceShaderFloat16Int8Features (0x0x7319a4b75900) 0 + +Class VkPhysicalDeviceFloatControlsProperties + size=88 align=8 + base size=88 base align=8 +VkPhysicalDeviceFloatControlsProperties (0x0x7319a4b75960) 0 + +Class VkDescriptorSetLayoutBindingFlagsCreateInfo + size=32 align=8 + base size=32 base align=8 +VkDescriptorSetLayoutBindingFlagsCreateInfo (0x0x7319a4b759c0) 0 + +Class VkPhysicalDeviceDescriptorIndexingFeatures + size=96 align=8 + base size=96 base align=8 +VkPhysicalDeviceDescriptorIndexingFeatures (0x0x7319a4b75a20) 0 + +Class VkPhysicalDeviceDescriptorIndexingProperties + size=112 align=8 + base size=112 base align=8 +VkPhysicalDeviceDescriptorIndexingProperties (0x0x7319a4b75a80) 0 + +Class VkDescriptorSetVariableDescriptorCountAllocateInfo + size=32 align=8 + base size=32 base align=8 +VkDescriptorSetVariableDescriptorCountAllocateInfo (0x0x7319a4b75ae0) 0 + +Class VkDescriptorSetVariableDescriptorCountLayoutSupport + size=24 align=8 + base size=24 base align=8 +VkDescriptorSetVariableDescriptorCountLayoutSupport (0x0x7319a4b75b40) 0 + +Class VkSubpassDescriptionDepthStencilResolve + size=32 align=8 + base size=32 base align=8 +VkSubpassDescriptionDepthStencilResolve (0x0x7319a4b75ba0) 0 + +Class VkPhysicalDeviceDepthStencilResolveProperties + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceDepthStencilResolveProperties (0x0x7319a4b75c00) 0 + +Class VkPhysicalDeviceScalarBlockLayoutFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceScalarBlockLayoutFeatures (0x0x7319a4b75c60) 0 + +Class VkImageStencilUsageCreateInfo + size=24 align=8 + base size=24 base align=8 +VkImageStencilUsageCreateInfo (0x0x7319a4b75cc0) 0 + +Class VkSamplerReductionModeCreateInfo + size=24 align=8 + base size=24 base align=8 +VkSamplerReductionModeCreateInfo (0x0x7319a4b75d20) 0 + +Class VkPhysicalDeviceSamplerFilterMinmaxProperties + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceSamplerFilterMinmaxProperties (0x0x7319a4b75d80) 0 + +Class VkPhysicalDeviceVulkanMemoryModelFeatures + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceVulkanMemoryModelFeatures (0x0x7319a4b75de0) 0 + +Class VkPhysicalDeviceImagelessFramebufferFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceImagelessFramebufferFeatures (0x0x7319a4b75e40) 0 + +Class VkFramebufferAttachmentImageInfo + size=48 align=8 + base size=48 base align=8 +VkFramebufferAttachmentImageInfo (0x0x7319a4b75ea0) 0 + +Class VkFramebufferAttachmentsCreateInfo + size=32 align=8 + base size=32 base align=8 +VkFramebufferAttachmentsCreateInfo (0x0x7319a4b75f00) 0 + +Class VkRenderPassAttachmentBeginInfo + size=32 align=8 + base size=32 base align=8 +VkRenderPassAttachmentBeginInfo (0x0x7319a4b75f60) 0 + +Class VkPhysicalDeviceUniformBufferStandardLayoutFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceUniformBufferStandardLayoutFeatures (0x0x7319a4bac000) 0 + +Class VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures (0x0x7319a4bac060) 0 + +Class VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures (0x0x7319a4bac0c0) 0 + +Class VkAttachmentReferenceStencilLayout + size=24 align=8 + base size=24 base align=8 +VkAttachmentReferenceStencilLayout (0x0x7319a4bac120) 0 + +Class VkAttachmentDescriptionStencilLayout + size=24 align=8 + base size=24 base align=8 +VkAttachmentDescriptionStencilLayout (0x0x7319a4bac180) 0 + +Class VkPhysicalDeviceHostQueryResetFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceHostQueryResetFeatures (0x0x7319a4bac1e0) 0 + +Class VkPhysicalDeviceTimelineSemaphoreFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceTimelineSemaphoreFeatures (0x0x7319a4bac240) 0 + +Class VkPhysicalDeviceTimelineSemaphoreProperties + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceTimelineSemaphoreProperties (0x0x7319a4bac2a0) 0 + +Class VkSemaphoreTypeCreateInfo + size=32 align=8 + base size=32 base align=8 +VkSemaphoreTypeCreateInfo (0x0x7319a4bac300) 0 + +Class VkTimelineSemaphoreSubmitInfo + size=48 align=8 + base size=48 base align=8 +VkTimelineSemaphoreSubmitInfo (0x0x7319a4bac360) 0 + +Class VkSemaphoreWaitInfo + size=40 align=8 + base size=40 base align=8 +VkSemaphoreWaitInfo (0x0x7319a4bac3c0) 0 + +Class VkSemaphoreSignalInfo + size=32 align=8 + base size=32 base align=8 +VkSemaphoreSignalInfo (0x0x7319a4bac420) 0 + +Class VkPhysicalDeviceBufferDeviceAddressFeatures + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceBufferDeviceAddressFeatures (0x0x7319a4bac480) 0 + +Class VkBufferDeviceAddressInfo + size=24 align=8 + base size=24 base align=8 +VkBufferDeviceAddressInfo (0x0x7319a4bac4e0) 0 + +Class VkBufferOpaqueCaptureAddressCreateInfo + size=24 align=8 + base size=24 base align=8 +VkBufferOpaqueCaptureAddressCreateInfo (0x0x7319a4bac540) 0 + +Class VkMemoryOpaqueCaptureAddressAllocateInfo + size=24 align=8 + base size=24 base align=8 +VkMemoryOpaqueCaptureAddressAllocateInfo (0x0x7319a4bac5a0) 0 + +Class VkDeviceMemoryOpaqueCaptureAddressInfo + size=24 align=8 + base size=24 base align=8 +VkDeviceMemoryOpaqueCaptureAddressInfo (0x0x7319a4bac600) 0 + +Class VkPhysicalDeviceVulkan13Features + size=80 align=8 + base size=80 base align=8 +VkPhysicalDeviceVulkan13Features (0x0x7319a4bac660) 0 + +Class VkPhysicalDeviceVulkan13Properties + size=216 align=8 + base size=216 base align=8 +VkPhysicalDeviceVulkan13Properties (0x0x7319a4bac6c0) 0 + +Class VkPipelineCreationFeedback + size=16 align=8 + base size=16 base align=8 +VkPipelineCreationFeedback (0x0x7319a4bac720) 0 + +Class VkPipelineCreationFeedbackCreateInfo + size=40 align=8 + base size=40 base align=8 +VkPipelineCreationFeedbackCreateInfo (0x0x7319a4bac780) 0 + +Class VkPhysicalDeviceShaderTerminateInvocationFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceShaderTerminateInvocationFeatures (0x0x7319a4bac7e0) 0 + +Class VkPhysicalDeviceToolProperties + size=1048 align=8 + base size=1048 base align=8 +VkPhysicalDeviceToolProperties (0x0x7319a4bac840) 0 + +Class VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures (0x0x7319a4bac8a0) 0 + +Class VkPhysicalDevicePrivateDataFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDevicePrivateDataFeatures (0x0x7319a4bac900) 0 + +Class VkDevicePrivateDataCreateInfo + size=24 align=8 + base size=24 base align=8 +VkDevicePrivateDataCreateInfo (0x0x7319a4bac960) 0 + +Class VkPrivateDataSlotCreateInfo + size=24 align=8 + base size=24 base align=8 +VkPrivateDataSlotCreateInfo (0x0x7319a4bac9c0) 0 + +Class VkPhysicalDevicePipelineCreationCacheControlFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDevicePipelineCreationCacheControlFeatures (0x0x7319a4baca20) 0 + +Class VkMemoryBarrier2 + size=48 align=8 + base size=48 base align=8 +VkMemoryBarrier2 (0x0x7319a4baca80) 0 + +Class VkBufferMemoryBarrier2 + size=80 align=8 + base size=80 base align=8 +VkBufferMemoryBarrier2 (0x0x7319a4bacae0) 0 + +Class VkImageMemoryBarrier2 + size=96 align=8 + base size=96 base align=8 +VkImageMemoryBarrier2 (0x0x7319a4bacb40) 0 + +Class VkDependencyInfo + size=64 align=8 + base size=64 base align=8 +VkDependencyInfo (0x0x7319a4bacba0) 0 + +Class VkSemaphoreSubmitInfo + size=48 align=8 + base size=48 base align=8 +VkSemaphoreSubmitInfo (0x0x7319a4bacc00) 0 + +Class VkCommandBufferSubmitInfo + size=32 align=8 + base size=32 base align=8 +VkCommandBufferSubmitInfo (0x0x7319a4bacc60) 0 + +Class VkSubmitInfo2 + size=64 align=8 + base size=64 base align=8 +VkSubmitInfo2 (0x0x7319a4baccc0) 0 + +Class VkPhysicalDeviceSynchronization2Features + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceSynchronization2Features (0x0x7319a4bacd20) 0 + +Class VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures (0x0x7319a4bacd80) 0 + +Class VkPhysicalDeviceImageRobustnessFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceImageRobustnessFeatures (0x0x7319a4bacde0) 0 + +Class VkBufferCopy2 + size=40 align=8 + base size=40 base align=8 +VkBufferCopy2 (0x0x7319a4bace40) 0 + +Class VkCopyBufferInfo2 + size=48 align=8 + base size=48 base align=8 +VkCopyBufferInfo2 (0x0x7319a4bacea0) 0 + +Class VkImageCopy2 + size=88 align=8 + base size=88 base align=8 +VkImageCopy2 (0x0x7319a4bacf00) 0 + +Class VkCopyImageInfo2 + size=56 align=8 + base size=56 base align=8 +VkCopyImageInfo2 (0x0x7319a4bacf60) 0 + +Class VkBufferImageCopy2 + size=72 align=8 + base size=72 base align=8 +VkBufferImageCopy2 (0x0x7319a4be6000) 0 + +Class VkCopyBufferToImageInfo2 + size=48 align=8 + base size=48 base align=8 +VkCopyBufferToImageInfo2 (0x0x7319a4be6060) 0 + +Class VkCopyImageToBufferInfo2 + size=56 align=8 + base size=56 base align=8 +VkCopyImageToBufferInfo2 (0x0x7319a4be60c0) 0 + +Class VkImageBlit2 + size=96 align=8 + base size=96 base align=8 +VkImageBlit2 (0x0x7319a4be6120) 0 + +Class VkBlitImageInfo2 + size=64 align=8 + base size=64 base align=8 +VkBlitImageInfo2 (0x0x7319a4be6180) 0 + +Class VkImageResolve2 + size=88 align=8 + base size=88 base align=8 +VkImageResolve2 (0x0x7319a4be61e0) 0 + +Class VkResolveImageInfo2 + size=56 align=8 + base size=56 base align=8 +VkResolveImageInfo2 (0x0x7319a4be6240) 0 + +Class VkPhysicalDeviceSubgroupSizeControlFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceSubgroupSizeControlFeatures (0x0x7319a4be62a0) 0 + +Class VkPhysicalDeviceSubgroupSizeControlProperties + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceSubgroupSizeControlProperties (0x0x7319a4be6300) 0 + +Class VkPipelineShaderStageRequiredSubgroupSizeCreateInfo + size=24 align=8 + base size=24 base align=8 +VkPipelineShaderStageRequiredSubgroupSizeCreateInfo (0x0x7319a4be6360) 0 + +Class VkPhysicalDeviceInlineUniformBlockFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceInlineUniformBlockFeatures (0x0x7319a4be63c0) 0 + +Class VkPhysicalDeviceInlineUniformBlockProperties + size=40 align=8 + base size=40 base align=8 +VkPhysicalDeviceInlineUniformBlockProperties (0x0x7319a4be6420) 0 + +Class VkWriteDescriptorSetInlineUniformBlock + size=32 align=8 + base size=32 base align=8 +VkWriteDescriptorSetInlineUniformBlock (0x0x7319a4be6480) 0 + +Class VkDescriptorPoolInlineUniformBlockCreateInfo + size=24 align=8 + base size=24 base align=8 +VkDescriptorPoolInlineUniformBlockCreateInfo (0x0x7319a4be64e0) 0 + +Class VkPhysicalDeviceTextureCompressionASTCHDRFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceTextureCompressionASTCHDRFeatures (0x0x7319a4be6540) 0 + +Class VkRenderingAttachmentInfo + size=72 align=8 + base size=72 base align=8 +VkRenderingAttachmentInfo (0x0x7319a4be65a0) 0 + +Class VkRenderingInfo + size=72 align=8 + base size=72 base align=8 +VkRenderingInfo (0x0x7319a4be6660) 0 + +Class VkPipelineRenderingCreateInfo + size=40 align=8 + base size=40 base align=8 +VkPipelineRenderingCreateInfo (0x0x7319a4be6720) 0 + +Class VkPhysicalDeviceDynamicRenderingFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceDynamicRenderingFeatures (0x0x7319a4be6780) 0 + +Class VkCommandBufferInheritanceRenderingInfo + size=56 align=8 + base size=56 base align=8 +VkCommandBufferInheritanceRenderingInfo (0x0x7319a4be67e0) 0 + +Class VkPhysicalDeviceShaderIntegerDotProductFeatures + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceShaderIntegerDotProductFeatures (0x0x7319a4be6840) 0 + +Class VkPhysicalDeviceShaderIntegerDotProductProperties + size=136 align=8 + base size=136 base align=8 +VkPhysicalDeviceShaderIntegerDotProductProperties (0x0x7319a4be68a0) 0 + +Class VkPhysicalDeviceTexelBufferAlignmentProperties + size=48 align=8 + base size=48 base align=8 +VkPhysicalDeviceTexelBufferAlignmentProperties (0x0x7319a4be6900) 0 + +Class VkFormatProperties3 + size=40 align=8 + base size=40 base align=8 +VkFormatProperties3 (0x0x7319a4be6960) 0 + +Class VkPhysicalDeviceMaintenance4Features + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceMaintenance4Features (0x0x7319a4be69c0) 0 + +Class VkPhysicalDeviceMaintenance4Properties + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceMaintenance4Properties (0x0x7319a4be6a20) 0 + +Class VkDeviceBufferMemoryRequirements + size=24 align=8 + base size=24 base align=8 +VkDeviceBufferMemoryRequirements (0x0x7319a4be6a80) 0 + +Class VkDeviceImageMemoryRequirements + size=32 align=8 + base size=32 base align=8 +VkDeviceImageMemoryRequirements (0x0x7319a4be6ae0) 0 + +Class VkSurfaceCapabilitiesKHR + size=52 align=4 + base size=52 base align=4 +VkSurfaceCapabilitiesKHR (0x0x7319a4be6b40) 0 + +Class VkSurfaceFormatKHR + size=8 align=4 + base size=8 base align=4 +VkSurfaceFormatKHR (0x0x7319a4be6c00) 0 + +Class VkSwapchainCreateInfoKHR + size=104 align=8 + base size=104 base align=8 +VkSwapchainCreateInfoKHR (0x0x7319a4be6c60) 0 + +Class VkPresentInfoKHR + size=64 align=8 + base size=64 base align=8 +VkPresentInfoKHR (0x0x7319a4be6cc0) 0 + +Class VkImageSwapchainCreateInfoKHR + size=24 align=8 + base size=24 base align=8 +VkImageSwapchainCreateInfoKHR (0x0x7319a4be6d20) 0 + +Class VkBindImageMemorySwapchainInfoKHR + size=32 align=8 + base size=32 base align=8 +VkBindImageMemorySwapchainInfoKHR (0x0x7319a4be6d80) 0 + +Class VkAcquireNextImageInfoKHR + size=56 align=8 + base size=56 base align=8 +VkAcquireNextImageInfoKHR (0x0x7319a4be6de0) 0 + +Class VkDeviceGroupPresentCapabilitiesKHR + size=152 align=8 + base size=152 base align=8 +VkDeviceGroupPresentCapabilitiesKHR (0x0x7319a4be6e40) 0 + +Class VkDeviceGroupPresentInfoKHR + size=40 align=8 + base size=40 base align=8 +VkDeviceGroupPresentInfoKHR (0x0x7319a4be6ea0) 0 + +Class VkDeviceGroupSwapchainCreateInfoKHR + size=24 align=8 + base size=24 base align=8 +VkDeviceGroupSwapchainCreateInfoKHR (0x0x7319a4be6f00) 0 + +Class VkDisplayModeParametersKHR + size=12 align=4 + base size=12 base align=4 +VkDisplayModeParametersKHR (0x0x7319a4be6f60) 0 + +Class VkDisplayModeCreateInfoKHR + size=32 align=8 + base size=32 base align=8 +VkDisplayModeCreateInfoKHR (0x0x7319a4820000) 0 + +Class VkDisplayModePropertiesKHR + size=24 align=8 + base size=24 base align=8 +VkDisplayModePropertiesKHR (0x0x7319a4820060) 0 + +Class VkDisplayPlaneCapabilitiesKHR + size=68 align=4 + base size=68 base align=4 +VkDisplayPlaneCapabilitiesKHR (0x0x7319a48200c0) 0 + +Class VkDisplayPlanePropertiesKHR + size=16 align=8 + base size=16 base align=8 +VkDisplayPlanePropertiesKHR (0x0x7319a4820120) 0 + +Class VkDisplayPropertiesKHR + size=48 align=8 + base size=48 base align=8 +VkDisplayPropertiesKHR (0x0x7319a4820180) 0 + +Class VkDisplaySurfaceCreateInfoKHR + size=64 align=8 + base size=64 base align=8 +VkDisplaySurfaceCreateInfoKHR (0x0x7319a48201e0) 0 + +Class VkDisplayPresentInfoKHR + size=56 align=8 + base size=56 base align=8 +VkDisplayPresentInfoKHR (0x0x7319a48202a0) 0 + +Class VkRenderingFragmentShadingRateAttachmentInfoKHR + size=40 align=8 + base size=40 base align=8 +VkRenderingFragmentShadingRateAttachmentInfoKHR (0x0x7319a4820300) 0 + +Class VkRenderingFragmentDensityMapAttachmentInfoEXT + size=32 align=8 + base size=32 base align=8 +VkRenderingFragmentDensityMapAttachmentInfoEXT (0x0x7319a4820360) 0 + +Class VkAttachmentSampleCountInfoAMD + size=40 align=8 + base size=40 base align=8 +VkAttachmentSampleCountInfoAMD (0x0x7319a48203c0) 0 + +Class VkMultiviewPerViewAttributesInfoNVX + size=24 align=8 + base size=24 base align=8 +VkMultiviewPerViewAttributesInfoNVX (0x0x7319a4820420) 0 + +Class VkImportMemoryFdInfoKHR + size=24 align=8 + base size=24 base align=8 +VkImportMemoryFdInfoKHR (0x0x7319a4820480) 0 + +Class VkMemoryFdPropertiesKHR + size=24 align=8 + base size=24 base align=8 +VkMemoryFdPropertiesKHR (0x0x7319a48204e0) 0 + +Class VkMemoryGetFdInfoKHR + size=32 align=8 + base size=32 base align=8 +VkMemoryGetFdInfoKHR (0x0x7319a4820540) 0 + +Class VkImportSemaphoreFdInfoKHR + size=40 align=8 + base size=40 base align=8 +VkImportSemaphoreFdInfoKHR (0x0x7319a48205a0) 0 + +Class VkSemaphoreGetFdInfoKHR + size=32 align=8 + base size=32 base align=8 +VkSemaphoreGetFdInfoKHR (0x0x7319a4820600) 0 + +Class VkPhysicalDevicePushDescriptorPropertiesKHR + size=24 align=8 + base size=24 base align=8 +VkPhysicalDevicePushDescriptorPropertiesKHR (0x0x7319a4820660) 0 + +Class VkRectLayerKHR + size=20 align=4 + base size=20 base align=4 +VkRectLayerKHR (0x0x7319a48206c0) 0 + +Class VkPresentRegionKHR + size=16 align=8 + base size=16 base align=8 +VkPresentRegionKHR (0x0x7319a4820720) 0 + +Class VkPresentRegionsKHR + size=32 align=8 + base size=32 base align=8 +VkPresentRegionsKHR (0x0x7319a4820780) 0 + +Class VkSharedPresentSurfaceCapabilitiesKHR + size=24 align=8 + base size=24 base align=8 +VkSharedPresentSurfaceCapabilitiesKHR (0x0x7319a48207e0) 0 + +Class VkImportFenceFdInfoKHR + size=40 align=8 + base size=40 base align=8 +VkImportFenceFdInfoKHR (0x0x7319a4820840) 0 + +Class VkFenceGetFdInfoKHR + size=32 align=8 + base size=32 base align=8 +VkFenceGetFdInfoKHR (0x0x7319a48208a0) 0 + +Class VkPhysicalDevicePerformanceQueryFeaturesKHR + size=24 align=8 + base size=24 base align=8 +VkPhysicalDevicePerformanceQueryFeaturesKHR (0x0x7319a4820900) 0 + +Class VkPhysicalDevicePerformanceQueryPropertiesKHR + size=24 align=8 + base size=24 base align=8 +VkPhysicalDevicePerformanceQueryPropertiesKHR (0x0x7319a4820960) 0 + +Class VkPerformanceCounterKHR + size=48 align=8 + base size=48 base align=8 +VkPerformanceCounterKHR (0x0x7319a48209c0) 0 + +Class VkPerformanceCounterDescriptionKHR + size=792 align=8 + base size=792 base align=8 +VkPerformanceCounterDescriptionKHR (0x0x7319a4820a20) 0 + +Class VkQueryPoolPerformanceCreateInfoKHR + size=32 align=8 + base size=32 base align=8 +VkQueryPoolPerformanceCreateInfoKHR (0x0x7319a4820a80) 0 + +Class VkPerformanceCounterResultKHR + size=8 align=8 + base size=8 base align=8 +VkPerformanceCounterResultKHR (0x0x7319a4820ae0) 0 + +Class VkAcquireProfilingLockInfoKHR + size=32 align=8 + base size=32 base align=8 +VkAcquireProfilingLockInfoKHR (0x0x7319a4820b40) 0 + +Class VkPerformanceQuerySubmitInfoKHR + size=24 align=8 + base size=24 base align=8 +VkPerformanceQuerySubmitInfoKHR (0x0x7319a4820ba0) 0 + +Class VkPhysicalDeviceSurfaceInfo2KHR + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceSurfaceInfo2KHR (0x0x7319a4820c00) 0 + +Class VkSurfaceCapabilities2KHR + size=72 align=8 + base size=72 base align=8 +VkSurfaceCapabilities2KHR (0x0x7319a4820c60) 0 + +Class VkSurfaceFormat2KHR + size=24 align=8 + base size=24 base align=8 +VkSurfaceFormat2KHR (0x0x7319a4820cc0) 0 + +Class VkDisplayProperties2KHR + size=64 align=8 + base size=64 base align=8 +VkDisplayProperties2KHR (0x0x7319a4820d20) 0 + +Class VkDisplayPlaneProperties2KHR + size=32 align=8 + base size=32 base align=8 +VkDisplayPlaneProperties2KHR (0x0x7319a4820d80) 0 + +Class VkDisplayModeProperties2KHR + size=40 align=8 + base size=40 base align=8 +VkDisplayModeProperties2KHR (0x0x7319a4820de0) 0 + +Class VkDisplayPlaneInfo2KHR + size=32 align=8 + base size=32 base align=8 +VkDisplayPlaneInfo2KHR (0x0x7319a4820e40) 0 + +Class VkDisplayPlaneCapabilities2KHR + size=88 align=8 + base size=88 base align=8 +VkDisplayPlaneCapabilities2KHR (0x0x7319a4820ea0) 0 + +Class VkPhysicalDeviceShaderClockFeaturesKHR + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceShaderClockFeaturesKHR (0x0x7319a4820f00) 0 + +Class VkDeviceQueueGlobalPriorityCreateInfoKHR + size=24 align=8 + base size=24 base align=8 +VkDeviceQueueGlobalPriorityCreateInfoKHR (0x0x7319a4820f60) 0 + +Class VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR (0x0x7319a4862000) 0 + +Class VkQueueFamilyGlobalPriorityPropertiesKHR + size=88 align=8 + base size=88 base align=8 +VkQueueFamilyGlobalPriorityPropertiesKHR (0x0x7319a4862060) 0 + +Class VkFragmentShadingRateAttachmentInfoKHR + size=32 align=8 + base size=32 base align=8 +VkFragmentShadingRateAttachmentInfoKHR (0x0x7319a48620c0) 0 + +Class VkPipelineFragmentShadingRateStateCreateInfoKHR + size=32 align=8 + base size=32 base align=8 +VkPipelineFragmentShadingRateStateCreateInfoKHR (0x0x7319a4862120) 0 + +Class VkPhysicalDeviceFragmentShadingRateFeaturesKHR + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceFragmentShadingRateFeaturesKHR (0x0x7319a4862180) 0 + +Class VkPhysicalDeviceFragmentShadingRatePropertiesKHR + size=96 align=8 + base size=96 base align=8 +VkPhysicalDeviceFragmentShadingRatePropertiesKHR (0x0x7319a48621e0) 0 + +Class VkPhysicalDeviceFragmentShadingRateKHR + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceFragmentShadingRateKHR (0x0x7319a4862240) 0 + +Class VkSurfaceProtectedCapabilitiesKHR + size=24 align=8 + base size=24 base align=8 +VkSurfaceProtectedCapabilitiesKHR (0x0x7319a48622a0) 0 + +Class VkPhysicalDevicePresentWaitFeaturesKHR + size=24 align=8 + base size=24 base align=8 +VkPhysicalDevicePresentWaitFeaturesKHR (0x0x7319a4862300) 0 + +Class VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR + size=24 align=8 + base size=24 base align=8 +VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR (0x0x7319a4862360) 0 + +Class VkPipelineInfoKHR + size=24 align=8 + base size=24 base align=8 +VkPipelineInfoKHR (0x0x7319a48623c0) 0 + +Class VkPipelineExecutablePropertiesKHR + size=536 align=8 + base size=536 base align=8 +VkPipelineExecutablePropertiesKHR (0x0x7319a4862420) 0 + +Class VkPipelineExecutableInfoKHR + size=32 align=8 + base size=32 base align=8 +VkPipelineExecutableInfoKHR (0x0x7319a4862480) 0 + +Class VkPipelineExecutableStatisticValueKHR + size=8 align=8 + base size=8 base align=8 +VkPipelineExecutableStatisticValueKHR (0x0x7319a48624e0) 0 + +Class VkPipelineExecutableStatisticKHR + size=544 align=8 + base size=544 base align=8 +VkPipelineExecutableStatisticKHR (0x0x7319a4862540) 0 + +Class VkPipelineExecutableInternalRepresentationKHR + size=552 align=8 + base size=552 base align=8 +VkPipelineExecutableInternalRepresentationKHR (0x0x7319a48625a0) 0 + +Class VkPipelineLibraryCreateInfoKHR + size=32 align=8 + base size=32 base align=8 +VkPipelineLibraryCreateInfoKHR (0x0x7319a4862600) 0 + +Class VkPresentIdKHR + size=32 align=8 + base size=32 base align=8 +VkPresentIdKHR (0x0x7319a4862660) 0 + +Class VkPhysicalDevicePresentIdFeaturesKHR + size=24 align=8 + base size=24 base align=8 +VkPhysicalDevicePresentIdFeaturesKHR (0x0x7319a48626c0) 0 + +Class VkQueueFamilyCheckpointProperties2NV + size=24 align=8 + base size=24 base align=8 +VkQueueFamilyCheckpointProperties2NV (0x0x7319a4862720) 0 + +Class VkCheckpointData2NV + size=32 align=8 + base size=32 base align=8 +VkCheckpointData2NV (0x0x7319a4862780) 0 + +Class VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR (0x0x7319a48627e0) 0 + +Class VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR (0x0x7319a4862840) 0 + +Class VkDebugReportCallbackCreateInfoEXT + size=40 align=8 + base size=40 base align=8 +VkDebugReportCallbackCreateInfoEXT (0x0x7319a48628a0) 0 + +Class VkPipelineRasterizationStateRasterizationOrderAMD + size=24 align=8 + base size=24 base align=8 +VkPipelineRasterizationStateRasterizationOrderAMD (0x0x7319a4862900) 0 + +Class VkDebugMarkerObjectNameInfoEXT + size=40 align=8 + base size=40 base align=8 +VkDebugMarkerObjectNameInfoEXT (0x0x7319a4862960) 0 + +Class VkDebugMarkerObjectTagInfoEXT + size=56 align=8 + base size=56 base align=8 +VkDebugMarkerObjectTagInfoEXT (0x0x7319a48629c0) 0 + +Class VkDebugMarkerMarkerInfoEXT + size=40 align=8 + base size=40 base align=8 +VkDebugMarkerMarkerInfoEXT (0x0x7319a4862a20) 0 + +Class VkDedicatedAllocationImageCreateInfoNV + size=24 align=8 + base size=24 base align=8 +VkDedicatedAllocationImageCreateInfoNV (0x0x7319a4862a80) 0 + +Class VkDedicatedAllocationBufferCreateInfoNV + size=24 align=8 + base size=24 base align=8 +VkDedicatedAllocationBufferCreateInfoNV (0x0x7319a4862ae0) 0 + +Class VkDedicatedAllocationMemoryAllocateInfoNV + size=32 align=8 + base size=32 base align=8 +VkDedicatedAllocationMemoryAllocateInfoNV (0x0x7319a4862b40) 0 + +Class VkPhysicalDeviceTransformFeedbackFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceTransformFeedbackFeaturesEXT (0x0x7319a4862ba0) 0 + +Class VkPhysicalDeviceTransformFeedbackPropertiesEXT + size=64 align=8 + base size=64 base align=8 +VkPhysicalDeviceTransformFeedbackPropertiesEXT (0x0x7319a4862c00) 0 + +Class VkPipelineRasterizationStateStreamCreateInfoEXT + size=24 align=8 + base size=24 base align=8 +VkPipelineRasterizationStateStreamCreateInfoEXT (0x0x7319a4862c60) 0 + +Class VkCuModuleCreateInfoNVX + size=32 align=8 + base size=32 base align=8 +VkCuModuleCreateInfoNVX (0x0x7319a4862cc0) 0 + +Class VkCuFunctionCreateInfoNVX + size=32 align=8 + base size=32 base align=8 +VkCuFunctionCreateInfoNVX (0x0x7319a4862d20) 0 + +Class VkCuLaunchInfoNVX + size=88 align=8 + base size=88 base align=8 +VkCuLaunchInfoNVX (0x0x7319a4862d80) 0 + +Class VkImageViewHandleInfoNVX + size=40 align=8 + base size=40 base align=8 +VkImageViewHandleInfoNVX (0x0x7319a4862de0) 0 + +Class VkImageViewAddressPropertiesNVX + size=32 align=8 + base size=32 base align=8 +VkImageViewAddressPropertiesNVX (0x0x7319a4862e40) 0 + +Class VkTextureLODGatherFormatPropertiesAMD + size=24 align=8 + base size=24 base align=8 +VkTextureLODGatherFormatPropertiesAMD (0x0x7319a4862ea0) 0 + +Class VkShaderResourceUsageAMD + size=32 align=8 + base size=32 base align=8 +VkShaderResourceUsageAMD (0x0x7319a4862f00) 0 + +Class VkShaderStatisticsInfoAMD + size=72 align=8 + base size=72 base align=8 +VkShaderStatisticsInfoAMD (0x0x7319a4862f60) 0 + +Class VkPhysicalDeviceCornerSampledImageFeaturesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceCornerSampledImageFeaturesNV (0x0x7319a48a0000) 0 + +Class VkExternalImageFormatPropertiesNV + size=48 align=8 + base size=48 base align=8 +VkExternalImageFormatPropertiesNV (0x0x7319a48a0060) 0 + +Class VkExternalMemoryImageCreateInfoNV + size=24 align=8 + base size=24 base align=8 +VkExternalMemoryImageCreateInfoNV (0x0x7319a48a00c0) 0 + +Class VkExportMemoryAllocateInfoNV + size=24 align=8 + base size=24 base align=8 +VkExportMemoryAllocateInfoNV (0x0x7319a48a0120) 0 + +Class VkValidationFlagsEXT + size=32 align=8 + base size=32 base align=8 +VkValidationFlagsEXT (0x0x7319a48a0180) 0 + +Class VkImageViewASTCDecodeModeEXT + size=24 align=8 + base size=24 base align=8 +VkImageViewASTCDecodeModeEXT (0x0x7319a48a01e0) 0 + +Class VkPhysicalDeviceASTCDecodeFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceASTCDecodeFeaturesEXT (0x0x7319a48a0240) 0 + +Class VkConditionalRenderingBeginInfoEXT + size=40 align=8 + base size=40 base align=8 +VkConditionalRenderingBeginInfoEXT (0x0x7319a48a02a0) 0 + +Class VkPhysicalDeviceConditionalRenderingFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceConditionalRenderingFeaturesEXT (0x0x7319a48a0300) 0 + +Class VkCommandBufferInheritanceConditionalRenderingInfoEXT + size=24 align=8 + base size=24 base align=8 +VkCommandBufferInheritanceConditionalRenderingInfoEXT (0x0x7319a48a0360) 0 + +Class VkViewportWScalingNV + size=8 align=4 + base size=8 base align=4 +VkViewportWScalingNV (0x0x7319a48a03c0) 0 + +Class VkPipelineViewportWScalingStateCreateInfoNV + size=32 align=8 + base size=32 base align=8 +VkPipelineViewportWScalingStateCreateInfoNV (0x0x7319a48a0420) 0 + +Class VkSurfaceCapabilities2EXT + size=72 align=8 + base size=72 base align=8 +VkSurfaceCapabilities2EXT (0x0x7319a48a0480) 0 + +Class VkDisplayPowerInfoEXT + size=24 align=8 + base size=24 base align=8 +VkDisplayPowerInfoEXT (0x0x7319a48a04e0) 0 + +Class VkDeviceEventInfoEXT + size=24 align=8 + base size=24 base align=8 +VkDeviceEventInfoEXT (0x0x7319a48a0540) 0 + +Class VkDisplayEventInfoEXT + size=24 align=8 + base size=24 base align=8 +VkDisplayEventInfoEXT (0x0x7319a48a05a0) 0 + +Class VkSwapchainCounterCreateInfoEXT + size=24 align=8 + base size=24 base align=8 +VkSwapchainCounterCreateInfoEXT (0x0x7319a48a0600) 0 + +Class VkRefreshCycleDurationGOOGLE + size=8 align=8 + base size=8 base align=8 +VkRefreshCycleDurationGOOGLE (0x0x7319a48a0660) 0 + +Class VkPastPresentationTimingGOOGLE + size=40 align=8 + base size=40 base align=8 +VkPastPresentationTimingGOOGLE (0x0x7319a48a06c0) 0 + +Class VkPresentTimeGOOGLE + size=16 align=8 + base size=16 base align=8 +VkPresentTimeGOOGLE (0x0x7319a48a0720) 0 + +Class VkPresentTimesInfoGOOGLE + size=32 align=8 + base size=32 base align=8 +VkPresentTimesInfoGOOGLE (0x0x7319a48a0780) 0 + +Class VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX (0x0x7319a48a07e0) 0 + +Class VkViewportSwizzleNV + size=16 align=4 + base size=16 base align=4 +VkViewportSwizzleNV (0x0x7319a48a0840) 0 + +Class VkPipelineViewportSwizzleStateCreateInfoNV + size=32 align=8 + base size=32 base align=8 +VkPipelineViewportSwizzleStateCreateInfoNV (0x0x7319a48a08a0) 0 + +Class VkPhysicalDeviceDiscardRectanglePropertiesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceDiscardRectanglePropertiesEXT (0x0x7319a48a0900) 0 + +Class VkPipelineDiscardRectangleStateCreateInfoEXT + size=40 align=8 + base size=40 base align=8 +VkPipelineDiscardRectangleStateCreateInfoEXT (0x0x7319a48a0960) 0 + +Class VkPhysicalDeviceConservativeRasterizationPropertiesEXT + size=56 align=8 + base size=56 base align=8 +VkPhysicalDeviceConservativeRasterizationPropertiesEXT (0x0x7319a48a09c0) 0 + +Class VkPipelineRasterizationConservativeStateCreateInfoEXT + size=32 align=8 + base size=32 base align=8 +VkPipelineRasterizationConservativeStateCreateInfoEXT (0x0x7319a48a0a20) 0 + +Class VkPhysicalDeviceDepthClipEnableFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceDepthClipEnableFeaturesEXT (0x0x7319a48a0a80) 0 + +Class VkPipelineRasterizationDepthClipStateCreateInfoEXT + size=24 align=8 + base size=24 base align=8 +VkPipelineRasterizationDepthClipStateCreateInfoEXT (0x0x7319a48a0ae0) 0 + +Class VkXYColorEXT + size=8 align=4 + base size=8 base align=4 +VkXYColorEXT (0x0x7319a48a0b40) 0 + +Class VkHdrMetadataEXT + size=64 align=8 + base size=64 base align=8 +VkHdrMetadataEXT (0x0x7319a48a0ba0) 0 + +Class VkDebugUtilsLabelEXT + size=40 align=8 + base size=40 base align=8 +VkDebugUtilsLabelEXT (0x0x7319a48a0c60) 0 + +Class VkDebugUtilsObjectNameInfoEXT + size=40 align=8 + base size=40 base align=8 +VkDebugUtilsObjectNameInfoEXT (0x0x7319a48a0cc0) 0 + +Class VkDebugUtilsMessengerCallbackDataEXT + size=96 align=8 + base size=96 base align=8 +VkDebugUtilsMessengerCallbackDataEXT (0x0x7319a48a0d20) 0 + +Class VkDebugUtilsMessengerCreateInfoEXT + size=48 align=8 + base size=48 base align=8 +VkDebugUtilsMessengerCreateInfoEXT (0x0x7319a48a0d80) 0 + +Class VkDebugUtilsObjectTagInfoEXT + size=56 align=8 + base size=56 base align=8 +VkDebugUtilsObjectTagInfoEXT (0x0x7319a48a0de0) 0 + +Class VkSampleLocationEXT + size=8 align=4 + base size=8 base align=4 +VkSampleLocationEXT (0x0x7319a48a0e40) 0 + +Class VkSampleLocationsInfoEXT + size=40 align=8 + base size=40 base align=8 +VkSampleLocationsInfoEXT (0x0x7319a48a0ea0) 0 + +Class VkAttachmentSampleLocationsEXT + size=48 align=8 + base size=48 base align=8 +VkAttachmentSampleLocationsEXT (0x0x7319a48a0f00) 0 + +Class VkSubpassSampleLocationsEXT + size=48 align=8 + base size=48 base align=8 +VkSubpassSampleLocationsEXT (0x0x7319a48a0f60) 0 + +Class VkRenderPassSampleLocationsBeginInfoEXT + size=48 align=8 + base size=48 base align=8 +VkRenderPassSampleLocationsBeginInfoEXT (0x0x7319a48ce000) 0 + +Class VkPipelineSampleLocationsStateCreateInfoEXT + size=64 align=8 + base size=64 base align=8 +VkPipelineSampleLocationsStateCreateInfoEXT (0x0x7319a48ce060) 0 + +Class VkPhysicalDeviceSampleLocationsPropertiesEXT + size=48 align=8 + base size=48 base align=8 +VkPhysicalDeviceSampleLocationsPropertiesEXT (0x0x7319a48ce0c0) 0 + +Class VkMultisamplePropertiesEXT + size=24 align=8 + base size=24 base align=8 +VkMultisamplePropertiesEXT (0x0x7319a48ce120) 0 + +Class VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT (0x0x7319a48ce180) 0 + +Class VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT + size=40 align=8 + base size=40 base align=8 +VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT (0x0x7319a48ce1e0) 0 + +Class VkPipelineColorBlendAdvancedStateCreateInfoEXT + size=32 align=8 + base size=32 base align=8 +VkPipelineColorBlendAdvancedStateCreateInfoEXT (0x0x7319a48ce240) 0 + +Class VkPipelineCoverageToColorStateCreateInfoNV + size=32 align=8 + base size=32 base align=8 +VkPipelineCoverageToColorStateCreateInfoNV (0x0x7319a48ce2a0) 0 + +Class VkPipelineCoverageModulationStateCreateInfoNV + size=40 align=8 + base size=40 base align=8 +VkPipelineCoverageModulationStateCreateInfoNV (0x0x7319a48ce300) 0 + +Class VkPhysicalDeviceShaderSMBuiltinsPropertiesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceShaderSMBuiltinsPropertiesNV (0x0x7319a48ce360) 0 + +Class VkPhysicalDeviceShaderSMBuiltinsFeaturesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceShaderSMBuiltinsFeaturesNV (0x0x7319a48ce3c0) 0 + +Class VkDrmFormatModifierPropertiesEXT + size=16 align=8 + base size=16 base align=8 +VkDrmFormatModifierPropertiesEXT (0x0x7319a48ce420) 0 + +Class VkDrmFormatModifierPropertiesListEXT + size=32 align=8 + base size=32 base align=8 +VkDrmFormatModifierPropertiesListEXT (0x0x7319a48ce480) 0 + +Class VkPhysicalDeviceImageDrmFormatModifierInfoEXT + size=40 align=8 + base size=40 base align=8 +VkPhysicalDeviceImageDrmFormatModifierInfoEXT (0x0x7319a48ce4e0) 0 + +Class VkImageDrmFormatModifierListCreateInfoEXT + size=32 align=8 + base size=32 base align=8 +VkImageDrmFormatModifierListCreateInfoEXT (0x0x7319a48ce540) 0 + +Class VkImageDrmFormatModifierExplicitCreateInfoEXT + size=40 align=8 + base size=40 base align=8 +VkImageDrmFormatModifierExplicitCreateInfoEXT (0x0x7319a48ce5a0) 0 + +Class VkImageDrmFormatModifierPropertiesEXT + size=24 align=8 + base size=24 base align=8 +VkImageDrmFormatModifierPropertiesEXT (0x0x7319a48ce600) 0 + +Class VkDrmFormatModifierProperties2EXT + size=24 align=8 + base size=24 base align=8 +VkDrmFormatModifierProperties2EXT (0x0x7319a48ce660) 0 + +Class VkDrmFormatModifierPropertiesList2EXT + size=32 align=8 + base size=32 base align=8 +VkDrmFormatModifierPropertiesList2EXT (0x0x7319a48ce6c0) 0 + +Class VkValidationCacheCreateInfoEXT + size=40 align=8 + base size=40 base align=8 +VkValidationCacheCreateInfoEXT (0x0x7319a48ce720) 0 + +Class VkShaderModuleValidationCacheCreateInfoEXT + size=24 align=8 + base size=24 base align=8 +VkShaderModuleValidationCacheCreateInfoEXT (0x0x7319a48ce780) 0 + +Class VkShadingRatePaletteNV + size=16 align=8 + base size=16 base align=8 +VkShadingRatePaletteNV (0x0x7319a48ce7e0) 0 + +Class VkPipelineViewportShadingRateImageStateCreateInfoNV + size=32 align=8 + base size=32 base align=8 +VkPipelineViewportShadingRateImageStateCreateInfoNV (0x0x7319a48ce840) 0 + +Class VkPhysicalDeviceShadingRateImageFeaturesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceShadingRateImageFeaturesNV (0x0x7319a48ce8a0) 0 + +Class VkPhysicalDeviceShadingRateImagePropertiesNV + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceShadingRateImagePropertiesNV (0x0x7319a48ce900) 0 + +Class VkCoarseSampleLocationNV + size=12 align=4 + base size=12 base align=4 +VkCoarseSampleLocationNV (0x0x7319a48ce960) 0 + +Class VkCoarseSampleOrderCustomNV + size=24 align=8 + base size=24 base align=8 +VkCoarseSampleOrderCustomNV (0x0x7319a48ce9c0) 0 + +Class VkPipelineViewportCoarseSampleOrderStateCreateInfoNV + size=32 align=8 + base size=32 base align=8 +VkPipelineViewportCoarseSampleOrderStateCreateInfoNV (0x0x7319a48cea20) 0 + +Class VkRayTracingShaderGroupCreateInfoNV + size=40 align=8 + base size=40 base align=8 +VkRayTracingShaderGroupCreateInfoNV (0x0x7319a48cea80) 0 + +Class VkRayTracingPipelineCreateInfoNV + size=80 align=8 + base size=80 base align=8 +VkRayTracingPipelineCreateInfoNV (0x0x7319a48ceae0) 0 + +Class VkGeometryTrianglesNV + size=96 align=8 + base size=96 base align=8 +VkGeometryTrianglesNV (0x0x7319a48ceb40) 0 + +Class VkGeometryAABBNV + size=40 align=8 + base size=40 base align=8 +VkGeometryAABBNV (0x0x7319a48ceba0) 0 + +Class VkGeometryDataNV + size=136 align=8 + base size=136 base align=8 +VkGeometryDataNV (0x0x7319a48cec00) 0 + +Class VkGeometryNV + size=168 align=8 + base size=168 base align=8 +VkGeometryNV (0x0x7319a48cec60) 0 + +Class VkAccelerationStructureInfoNV + size=40 align=8 + base size=40 base align=8 +VkAccelerationStructureInfoNV (0x0x7319a48cecc0) 0 + +Class VkAccelerationStructureCreateInfoNV + size=64 align=8 + base size=64 base align=8 +VkAccelerationStructureCreateInfoNV (0x0x7319a48ced20) 0 + +Class VkBindAccelerationStructureMemoryInfoNV + size=56 align=8 + base size=56 base align=8 +VkBindAccelerationStructureMemoryInfoNV (0x0x7319a48ced80) 0 + +Class VkWriteDescriptorSetAccelerationStructureNV + size=32 align=8 + base size=32 base align=8 +VkWriteDescriptorSetAccelerationStructureNV (0x0x7319a48cede0) 0 + +Class VkAccelerationStructureMemoryRequirementsInfoNV + size=32 align=8 + base size=32 base align=8 +VkAccelerationStructureMemoryRequirementsInfoNV (0x0x7319a48cee40) 0 + +Class VkPhysicalDeviceRayTracingPropertiesNV + size=64 align=8 + base size=64 base align=8 +VkPhysicalDeviceRayTracingPropertiesNV (0x0x7319a48ceea0) 0 + +Class VkTransformMatrixKHR + size=48 align=4 + base size=48 base align=4 +VkTransformMatrixKHR (0x0x7319a48cef60) 0 + +Class VkAabbPositionsKHR + size=24 align=4 + base size=24 base align=4 +VkAabbPositionsKHR (0x0x7319a48ff000) 0 + +Class VkAccelerationStructureInstanceKHR + size=64 align=8 + base size=64 base align=8 +VkAccelerationStructureInstanceKHR (0x0x7319a48ff060) 0 + +Class VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV (0x0x7319a48ff0c0) 0 + +Class VkPipelineRepresentativeFragmentTestStateCreateInfoNV + size=24 align=8 + base size=24 base align=8 +VkPipelineRepresentativeFragmentTestStateCreateInfoNV (0x0x7319a48ff120) 0 + +Class VkPhysicalDeviceImageViewImageFormatInfoEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceImageViewImageFormatInfoEXT (0x0x7319a48ff180) 0 + +Class VkFilterCubicImageViewImageFormatPropertiesEXT + size=24 align=8 + base size=24 base align=8 +VkFilterCubicImageViewImageFormatPropertiesEXT (0x0x7319a48ff1e0) 0 + +Class VkImportMemoryHostPointerInfoEXT + size=32 align=8 + base size=32 base align=8 +VkImportMemoryHostPointerInfoEXT (0x0x7319a48ff240) 0 + +Class VkMemoryHostPointerPropertiesEXT + size=24 align=8 + base size=24 base align=8 +VkMemoryHostPointerPropertiesEXT (0x0x7319a48ff2a0) 0 + +Class VkPhysicalDeviceExternalMemoryHostPropertiesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceExternalMemoryHostPropertiesEXT (0x0x7319a48ff300) 0 + +Class VkPipelineCompilerControlCreateInfoAMD + size=24 align=8 + base size=24 base align=8 +VkPipelineCompilerControlCreateInfoAMD (0x0x7319a48ff360) 0 + +Class VkCalibratedTimestampInfoEXT + size=24 align=8 + base size=24 base align=8 +VkCalibratedTimestampInfoEXT (0x0x7319a48ff3c0) 0 + +Class VkPhysicalDeviceShaderCorePropertiesAMD + size=72 align=8 + base size=72 base align=8 +VkPhysicalDeviceShaderCorePropertiesAMD (0x0x7319a48ff420) 0 + +Class VkDeviceMemoryOverallocationCreateInfoAMD + size=24 align=8 + base size=24 base align=8 +VkDeviceMemoryOverallocationCreateInfoAMD (0x0x7319a48ff480) 0 + +Class VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT (0x0x7319a48ff4e0) 0 + +Class VkVertexInputBindingDivisorDescriptionEXT + size=8 align=4 + base size=8 base align=4 +VkVertexInputBindingDivisorDescriptionEXT (0x0x7319a48ff540) 0 + +Class VkPipelineVertexInputDivisorStateCreateInfoEXT + size=32 align=8 + base size=32 base align=8 +VkPipelineVertexInputDivisorStateCreateInfoEXT (0x0x7319a48ff5a0) 0 + +Class VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT (0x0x7319a48ff600) 0 + +Class VkPhysicalDeviceComputeShaderDerivativesFeaturesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceComputeShaderDerivativesFeaturesNV (0x0x7319a48ff660) 0 + +Class VkPhysicalDeviceMeshShaderFeaturesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceMeshShaderFeaturesNV (0x0x7319a48ff6c0) 0 + +Class VkPhysicalDeviceMeshShaderPropertiesNV + size=88 align=8 + base size=88 base align=8 +VkPhysicalDeviceMeshShaderPropertiesNV (0x0x7319a48ff720) 0 + +Class VkDrawMeshTasksIndirectCommandNV + size=8 align=4 + base size=8 base align=4 +VkDrawMeshTasksIndirectCommandNV (0x0x7319a48ff780) 0 + +Class VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV (0x0x7319a48ff7e0) 0 + +Class VkPhysicalDeviceShaderImageFootprintFeaturesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceShaderImageFootprintFeaturesNV (0x0x7319a48ff840) 0 + +Class VkPipelineViewportExclusiveScissorStateCreateInfoNV + size=32 align=8 + base size=32 base align=8 +VkPipelineViewportExclusiveScissorStateCreateInfoNV (0x0x7319a48ff8a0) 0 + +Class VkPhysicalDeviceExclusiveScissorFeaturesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceExclusiveScissorFeaturesNV (0x0x7319a48ff900) 0 + +Class VkQueueFamilyCheckpointPropertiesNV + size=24 align=8 + base size=24 base align=8 +VkQueueFamilyCheckpointPropertiesNV (0x0x7319a48ff960) 0 + +Class VkCheckpointDataNV + size=32 align=8 + base size=32 base align=8 +VkCheckpointDataNV (0x0x7319a48ff9c0) 0 + +Class VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL (0x0x7319a48ffa20) 0 + +Class VkPerformanceValueDataINTEL + size=8 align=8 + base size=8 base align=8 +VkPerformanceValueDataINTEL (0x0x7319a48ffa80) 0 + +Class VkPerformanceValueINTEL + size=16 align=8 + base size=16 base align=8 +VkPerformanceValueINTEL (0x0x7319a48ffae0) 0 + +Class VkInitializePerformanceApiInfoINTEL + size=24 align=8 + base size=24 base align=8 +VkInitializePerformanceApiInfoINTEL (0x0x7319a48ffb40) 0 + +Class VkQueryPoolPerformanceQueryCreateInfoINTEL + size=24 align=8 + base size=24 base align=8 +VkQueryPoolPerformanceQueryCreateInfoINTEL (0x0x7319a48ffba0) 0 + +Class VkPerformanceMarkerInfoINTEL + size=24 align=8 + base size=24 base align=8 +VkPerformanceMarkerInfoINTEL (0x0x7319a48ffc00) 0 + +Class VkPerformanceStreamMarkerInfoINTEL + size=24 align=8 + base size=24 base align=8 +VkPerformanceStreamMarkerInfoINTEL (0x0x7319a48ffc60) 0 + +Class VkPerformanceOverrideInfoINTEL + size=32 align=8 + base size=32 base align=8 +VkPerformanceOverrideInfoINTEL (0x0x7319a48ffcc0) 0 + +Class VkPerformanceConfigurationAcquireInfoINTEL + size=24 align=8 + base size=24 base align=8 +VkPerformanceConfigurationAcquireInfoINTEL (0x0x7319a48ffd20) 0 + +Class VkPhysicalDevicePCIBusInfoPropertiesEXT + size=32 align=8 + base size=32 base align=8 +VkPhysicalDevicePCIBusInfoPropertiesEXT (0x0x7319a48ffd80) 0 + +Class VkDisplayNativeHdrSurfaceCapabilitiesAMD + size=24 align=8 + base size=24 base align=8 +VkDisplayNativeHdrSurfaceCapabilitiesAMD (0x0x7319a48ffde0) 0 + +Class VkSwapchainDisplayNativeHdrCreateInfoAMD + size=24 align=8 + base size=24 base align=8 +VkSwapchainDisplayNativeHdrCreateInfoAMD (0x0x7319a48ffe40) 0 + +Class VkPhysicalDeviceFragmentDensityMapFeaturesEXT + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceFragmentDensityMapFeaturesEXT (0x0x7319a48ffea0) 0 + +Class VkPhysicalDeviceFragmentDensityMapPropertiesEXT + size=40 align=8 + base size=40 base align=8 +VkPhysicalDeviceFragmentDensityMapPropertiesEXT (0x0x7319a48fff00) 0 + +Class VkRenderPassFragmentDensityMapCreateInfoEXT + size=24 align=8 + base size=24 base align=8 +VkRenderPassFragmentDensityMapCreateInfoEXT (0x0x7319a48fff60) 0 + +Class VkPhysicalDeviceShaderCoreProperties2AMD + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceShaderCoreProperties2AMD (0x0x7319a492d000) 0 + +Class VkPhysicalDeviceCoherentMemoryFeaturesAMD + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceCoherentMemoryFeaturesAMD (0x0x7319a492d060) 0 + +Class VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT (0x0x7319a492d0c0) 0 + +Class VkPhysicalDeviceMemoryBudgetPropertiesEXT + size=272 align=8 + base size=272 base align=8 +VkPhysicalDeviceMemoryBudgetPropertiesEXT (0x0x7319a492d120) 0 + +Class VkPhysicalDeviceMemoryPriorityFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceMemoryPriorityFeaturesEXT (0x0x7319a492d180) 0 + +Class VkMemoryPriorityAllocateInfoEXT + size=24 align=8 + base size=24 base align=8 +VkMemoryPriorityAllocateInfoEXT (0x0x7319a492d1e0) 0 + +Class VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV (0x0x7319a492d240) 0 + +Class VkPhysicalDeviceBufferDeviceAddressFeaturesEXT + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceBufferDeviceAddressFeaturesEXT (0x0x7319a492d2a0) 0 + +Class VkBufferDeviceAddressCreateInfoEXT + size=24 align=8 + base size=24 base align=8 +VkBufferDeviceAddressCreateInfoEXT (0x0x7319a492d300) 0 + +Class VkValidationFeaturesEXT + size=48 align=8 + base size=48 base align=8 +VkValidationFeaturesEXT (0x0x7319a492d360) 0 + +Class VkCooperativeMatrixPropertiesNV + size=48 align=8 + base size=48 base align=8 +VkCooperativeMatrixPropertiesNV (0x0x7319a492d3c0) 0 + +Class VkPhysicalDeviceCooperativeMatrixFeaturesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceCooperativeMatrixFeaturesNV (0x0x7319a492d480) 0 + +Class VkPhysicalDeviceCooperativeMatrixPropertiesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceCooperativeMatrixPropertiesNV (0x0x7319a492d4e0) 0 + +Class VkPhysicalDeviceCoverageReductionModeFeaturesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceCoverageReductionModeFeaturesNV (0x0x7319a492d540) 0 + +Class VkPipelineCoverageReductionStateCreateInfoNV + size=24 align=8 + base size=24 base align=8 +VkPipelineCoverageReductionStateCreateInfoNV (0x0x7319a492d5a0) 0 + +Class VkFramebufferMixedSamplesCombinationNV + size=32 align=8 + base size=32 base align=8 +VkFramebufferMixedSamplesCombinationNV (0x0x7319a492d600) 0 + +Class VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT (0x0x7319a492d660) 0 + +Class VkPhysicalDeviceYcbcrImageArraysFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceYcbcrImageArraysFeaturesEXT (0x0x7319a492d6c0) 0 + +Class VkPhysicalDeviceProvokingVertexFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceProvokingVertexFeaturesEXT (0x0x7319a492d720) 0 + +Class VkPhysicalDeviceProvokingVertexPropertiesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceProvokingVertexPropertiesEXT (0x0x7319a492d780) 0 + +Class VkPipelineRasterizationProvokingVertexStateCreateInfoEXT + size=24 align=8 + base size=24 base align=8 +VkPipelineRasterizationProvokingVertexStateCreateInfoEXT (0x0x7319a492d7e0) 0 + +Class VkHeadlessSurfaceCreateInfoEXT + size=24 align=8 + base size=24 base align=8 +VkHeadlessSurfaceCreateInfoEXT (0x0x7319a492d840) 0 + +Class VkPhysicalDeviceLineRasterizationFeaturesEXT + size=40 align=8 + base size=40 base align=8 +VkPhysicalDeviceLineRasterizationFeaturesEXT (0x0x7319a492d8a0) 0 + +Class VkPhysicalDeviceLineRasterizationPropertiesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceLineRasterizationPropertiesEXT (0x0x7319a492d900) 0 + +Class VkPipelineRasterizationLineStateCreateInfoEXT + size=32 align=8 + base size=32 base align=8 +VkPipelineRasterizationLineStateCreateInfoEXT (0x0x7319a492d960) 0 + +Class VkPhysicalDeviceShaderAtomicFloatFeaturesEXT + size=64 align=8 + base size=64 base align=8 +VkPhysicalDeviceShaderAtomicFloatFeaturesEXT (0x0x7319a492d9c0) 0 + +Class VkPhysicalDeviceIndexTypeUint8FeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceIndexTypeUint8FeaturesEXT (0x0x7319a492da20) 0 + +Class VkPhysicalDeviceExtendedDynamicStateFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceExtendedDynamicStateFeaturesEXT (0x0x7319a492da80) 0 + +Class VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT + size=64 align=8 + base size=64 base align=8 +VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT (0x0x7319a492dae0) 0 + +Class VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV + size=56 align=8 + base size=56 base align=8 +VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV (0x0x7319a492db40) 0 + +Class VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV (0x0x7319a492dba0) 0 + +Class VkGraphicsShaderGroupCreateInfoNV + size=48 align=8 + base size=48 base align=8 +VkGraphicsShaderGroupCreateInfoNV (0x0x7319a492dc00) 0 + +Class VkGraphicsPipelineShaderGroupsCreateInfoNV + size=48 align=8 + base size=48 base align=8 +VkGraphicsPipelineShaderGroupsCreateInfoNV (0x0x7319a492dc60) 0 + +Class VkBindShaderGroupIndirectCommandNV + size=4 align=4 + base size=4 base align=4 +VkBindShaderGroupIndirectCommandNV (0x0x7319a492dcc0) 0 + +Class VkBindIndexBufferIndirectCommandNV + size=16 align=8 + base size=16 base align=8 +VkBindIndexBufferIndirectCommandNV (0x0x7319a492dd20) 0 + +Class VkBindVertexBufferIndirectCommandNV + size=16 align=8 + base size=16 base align=8 +VkBindVertexBufferIndirectCommandNV (0x0x7319a492dd80) 0 + +Class VkSetStateFlagsIndirectCommandNV + size=4 align=4 + base size=4 base align=4 +VkSetStateFlagsIndirectCommandNV (0x0x7319a492dde0) 0 + +Class VkIndirectCommandsStreamNV + size=16 align=8 + base size=16 base align=8 +VkIndirectCommandsStreamNV (0x0x7319a492de40) 0 + +Class VkIndirectCommandsLayoutTokenNV + size=88 align=8 + base size=88 base align=8 +VkIndirectCommandsLayoutTokenNV (0x0x7319a492dea0) 0 + +Class VkIndirectCommandsLayoutCreateInfoNV + size=56 align=8 + base size=56 base align=8 +VkIndirectCommandsLayoutCreateInfoNV (0x0x7319a492df00) 0 + +Class VkGeneratedCommandsInfoNV + size=120 align=8 + base size=120 base align=8 +VkGeneratedCommandsInfoNV (0x0x7319a492df60) 0 + +Class VkGeneratedCommandsMemoryRequirementsInfoNV + size=48 align=8 + base size=48 base align=8 +VkGeneratedCommandsMemoryRequirementsInfoNV (0x0x7319a4957000) 0 + +Class VkPhysicalDeviceInheritedViewportScissorFeaturesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceInheritedViewportScissorFeaturesNV (0x0x7319a4957060) 0 + +Class VkCommandBufferInheritanceViewportScissorInfoNV + size=32 align=8 + base size=32 base align=8 +VkCommandBufferInheritanceViewportScissorInfoNV (0x0x7319a49570c0) 0 + +Class VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT (0x0x7319a4957120) 0 + +Class VkRenderPassTransformBeginInfoQCOM + size=24 align=8 + base size=24 base align=8 +VkRenderPassTransformBeginInfoQCOM (0x0x7319a4957180) 0 + +Class VkCommandBufferInheritanceRenderPassTransformInfoQCOM + size=40 align=8 + base size=40 base align=8 +VkCommandBufferInheritanceRenderPassTransformInfoQCOM (0x0x7319a49571e0) 0 + +Class VkPhysicalDeviceDeviceMemoryReportFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceDeviceMemoryReportFeaturesEXT (0x0x7319a4957240) 0 + +Class VkDeviceMemoryReportCallbackDataEXT + size=64 align=8 + base size=64 base align=8 +VkDeviceMemoryReportCallbackDataEXT (0x0x7319a49572a0) 0 + +Class VkDeviceDeviceMemoryReportCreateInfoEXT + size=40 align=8 + base size=40 base align=8 +VkDeviceDeviceMemoryReportCreateInfoEXT (0x0x7319a4957300) 0 + +Class VkPhysicalDeviceRobustness2FeaturesEXT + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceRobustness2FeaturesEXT (0x0x7319a4957360) 0 + +Class VkPhysicalDeviceRobustness2PropertiesEXT + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceRobustness2PropertiesEXT (0x0x7319a49573c0) 0 + +Class VkSamplerCustomBorderColorCreateInfoEXT + size=40 align=8 + base size=40 base align=8 +VkSamplerCustomBorderColorCreateInfoEXT (0x0x7319a4957420) 0 + +Class VkPhysicalDeviceCustomBorderColorPropertiesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceCustomBorderColorPropertiesEXT (0x0x7319a4957480) 0 + +Class VkPhysicalDeviceCustomBorderColorFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceCustomBorderColorFeaturesEXT (0x0x7319a49574e0) 0 + +Class VkPhysicalDeviceDiagnosticsConfigFeaturesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceDiagnosticsConfigFeaturesNV (0x0x7319a4957540) 0 + +Class VkDeviceDiagnosticsConfigCreateInfoNV + size=24 align=8 + base size=24 base align=8 +VkDeviceDiagnosticsConfigCreateInfoNV (0x0x7319a49575a0) 0 + +Class VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV (0x0x7319a4957600) 0 + +Class VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV (0x0x7319a4957660) 0 + +Class VkPipelineFragmentShadingRateEnumStateCreateInfoNV + size=32 align=8 + base size=32 base align=8 +VkPipelineFragmentShadingRateEnumStateCreateInfoNV (0x0x7319a49576c0) 0 + +Class VkDeviceOrHostAddressConstKHR + size=8 align=8 + base size=8 base align=8 +VkDeviceOrHostAddressConstKHR (0x0x7319a4957720) 0 + +Class VkAccelerationStructureGeometryMotionTrianglesDataNV + size=24 align=8 + base size=24 base align=8 +VkAccelerationStructureGeometryMotionTrianglesDataNV (0x0x7319a4957780) 0 + +Class VkAccelerationStructureMotionInfoNV + size=24 align=8 + base size=24 base align=8 +VkAccelerationStructureMotionInfoNV (0x0x7319a49577e0) 0 + +Class VkAccelerationStructureMatrixMotionInstanceNV + size=112 align=8 + base size=112 base align=8 +VkAccelerationStructureMatrixMotionInstanceNV (0x0x7319a4957840) 0 + +Class VkSRTDataNV + size=64 align=4 + base size=64 base align=4 +VkSRTDataNV (0x0x7319a49578a0) 0 + +Class VkAccelerationStructureSRTMotionInstanceNV + size=144 align=8 + base size=144 base align=8 +VkAccelerationStructureSRTMotionInstanceNV (0x0x7319a4957900) 0 + +Class VkAccelerationStructureMotionInstanceDataNV + size=144 align=8 + base size=144 base align=8 +VkAccelerationStructureMotionInstanceDataNV (0x0x7319a4957960) 0 + +Class VkAccelerationStructureMotionInstanceNV + size=152 align=8 + base size=152 base align=8 +VkAccelerationStructureMotionInstanceNV (0x0x7319a49579c0) 0 + +Class VkPhysicalDeviceRayTracingMotionBlurFeaturesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceRayTracingMotionBlurFeaturesNV (0x0x7319a4957a20) 0 + +Class VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT (0x0x7319a4957a80) 0 + +Class VkPhysicalDeviceFragmentDensityMap2FeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceFragmentDensityMap2FeaturesEXT (0x0x7319a4957ae0) 0 + +Class VkPhysicalDeviceFragmentDensityMap2PropertiesEXT + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceFragmentDensityMap2PropertiesEXT (0x0x7319a4957b40) 0 + +Class VkCopyCommandTransformInfoQCOM + size=24 align=8 + base size=24 base align=8 +VkCopyCommandTransformInfoQCOM (0x0x7319a4957ba0) 0 + +Class VkPhysicalDevice4444FormatsFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDevice4444FormatsFeaturesEXT (0x0x7319a4957c00) 0 + +Class VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesARM + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesARM (0x0x7319a4957c60) 0 + +Class VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT (0x0x7319a4957cc0) 0 + +Class VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE (0x0x7319a4957d20) 0 + +Class VkMutableDescriptorTypeListVALVE + size=16 align=8 + base size=16 base align=8 +VkMutableDescriptorTypeListVALVE (0x0x7319a4957d80) 0 + +Class VkMutableDescriptorTypeCreateInfoVALVE + size=32 align=8 + base size=32 base align=8 +VkMutableDescriptorTypeCreateInfoVALVE (0x0x7319a4957de0) 0 + +Class VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT (0x0x7319a4957e40) 0 + +Class VkVertexInputBindingDescription2EXT + size=32 align=8 + base size=32 base align=8 +VkVertexInputBindingDescription2EXT (0x0x7319a4957ea0) 0 + +Class VkVertexInputAttributeDescription2EXT + size=32 align=8 + base size=32 base align=8 +VkVertexInputAttributeDescription2EXT (0x0x7319a4957f00) 0 + +Class VkPhysicalDeviceDrmPropertiesEXT + size=56 align=8 + base size=56 base align=8 +VkPhysicalDeviceDrmPropertiesEXT (0x0x7319a4957f60) 0 + +Class VkPhysicalDeviceDepthClipControlFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceDepthClipControlFeaturesEXT (0x0x7319a497b000) 0 + +Class VkPipelineViewportDepthClipControlCreateInfoEXT + size=24 align=8 + base size=24 base align=8 +VkPipelineViewportDepthClipControlCreateInfoEXT (0x0x7319a497b060) 0 + +Class VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT (0x0x7319a497b0c0) 0 + +Class VkSubpassShadingPipelineCreateInfoHUAWEI + size=32 align=8 + base size=32 base align=8 +VkSubpassShadingPipelineCreateInfoHUAWEI (0x0x7319a497b120) 0 + +Class VkPhysicalDeviceSubpassShadingFeaturesHUAWEI + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceSubpassShadingFeaturesHUAWEI (0x0x7319a497b180) 0 + +Class VkPhysicalDeviceSubpassShadingPropertiesHUAWEI + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceSubpassShadingPropertiesHUAWEI (0x0x7319a497b1e0) 0 + +Class VkPhysicalDeviceInvocationMaskFeaturesHUAWEI + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceInvocationMaskFeaturesHUAWEI (0x0x7319a497b240) 0 + +Class VkMemoryGetRemoteAddressInfoNV + size=32 align=8 + base size=32 base align=8 +VkMemoryGetRemoteAddressInfoNV (0x0x7319a497b2a0) 0 + +Class VkPhysicalDeviceExternalMemoryRDMAFeaturesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceExternalMemoryRDMAFeaturesNV (0x0x7319a497b300) 0 + +Class VkPhysicalDeviceExtendedDynamicState2FeaturesEXT + size=32 align=8 + base size=32 base align=8 +VkPhysicalDeviceExtendedDynamicState2FeaturesEXT (0x0x7319a497b360) 0 + +Class VkPhysicalDeviceColorWriteEnableFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceColorWriteEnableFeaturesEXT (0x0x7319a497b3c0) 0 + +Class VkPipelineColorWriteCreateInfoEXT + size=32 align=8 + base size=32 base align=8 +VkPipelineColorWriteCreateInfoEXT (0x0x7319a497b420) 0 + +Class VkPhysicalDeviceImageViewMinLodFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceImageViewMinLodFeaturesEXT (0x0x7319a497b480) 0 + +Class VkImageViewMinLodCreateInfoEXT + size=24 align=8 + base size=24 base align=8 +VkImageViewMinLodCreateInfoEXT (0x0x7319a497b4e0) 0 + +Class VkPhysicalDeviceMultiDrawFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceMultiDrawFeaturesEXT (0x0x7319a497b540) 0 + +Class VkPhysicalDeviceMultiDrawPropertiesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceMultiDrawPropertiesEXT (0x0x7319a497b5a0) 0 + +Class VkMultiDrawInfoEXT + size=8 align=4 + base size=8 base align=4 +VkMultiDrawInfoEXT (0x0x7319a497b600) 0 + +Class VkMultiDrawIndexedInfoEXT + size=12 align=4 + base size=12 base align=4 +VkMultiDrawIndexedInfoEXT (0x0x7319a497b660) 0 + +Class VkPhysicalDeviceBorderColorSwizzleFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceBorderColorSwizzleFeaturesEXT (0x0x7319a497b6c0) 0 + +Class VkSamplerBorderColorComponentMappingCreateInfoEXT + size=40 align=8 + base size=40 base align=8 +VkSamplerBorderColorComponentMappingCreateInfoEXT (0x0x7319a497b720) 0 + +Class VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT + size=24 align=8 + base size=24 base align=8 +VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT (0x0x7319a497b780) 0 + +Class VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM (0x0x7319a497b7e0) 0 + +Class VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM (0x0x7319a497b840) 0 + +Class VkSubpassFragmentDensityMapOffsetEndInfoQCOM + size=32 align=8 + base size=32 base align=8 +VkSubpassFragmentDensityMapOffsetEndInfoQCOM (0x0x7319a497b8a0) 0 + +Class VkPhysicalDeviceLinearColorAttachmentFeaturesNV + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceLinearColorAttachmentFeaturesNV (0x0x7319a497b900) 0 + +Class VkDeviceOrHostAddressKHR + size=8 align=8 + base size=8 base align=8 +VkDeviceOrHostAddressKHR (0x0x7319a497b960) 0 + +Class VkAccelerationStructureBuildRangeInfoKHR + size=16 align=4 + base size=16 base align=4 +VkAccelerationStructureBuildRangeInfoKHR (0x0x7319a497b9c0) 0 + +Class VkAccelerationStructureGeometryTrianglesDataKHR + size=64 align=8 + base size=64 base align=8 +VkAccelerationStructureGeometryTrianglesDataKHR (0x0x7319a497ba20) 0 + +Class VkAccelerationStructureGeometryAabbsDataKHR + size=32 align=8 + base size=32 base align=8 +VkAccelerationStructureGeometryAabbsDataKHR (0x0x7319a497ba80) 0 + +Class VkAccelerationStructureGeometryInstancesDataKHR + size=32 align=8 + base size=32 base align=8 +VkAccelerationStructureGeometryInstancesDataKHR (0x0x7319a497bae0) 0 + +Class VkAccelerationStructureGeometryDataKHR + size=64 align=8 + base size=64 base align=8 +VkAccelerationStructureGeometryDataKHR (0x0x7319a497bb40) 0 + +Class VkAccelerationStructureGeometryKHR + size=96 align=8 + base size=96 base align=8 +VkAccelerationStructureGeometryKHR (0x0x7319a497bba0) 0 + +Class VkAccelerationStructureBuildGeometryInfoKHR + size=80 align=8 + base size=80 base align=8 +VkAccelerationStructureBuildGeometryInfoKHR (0x0x7319a497bc00) 0 + +Class VkAccelerationStructureCreateInfoKHR + size=64 align=8 + base size=64 base align=8 +VkAccelerationStructureCreateInfoKHR (0x0x7319a497bc60) 0 + +Class VkWriteDescriptorSetAccelerationStructureKHR + size=32 align=8 + base size=32 base align=8 +VkWriteDescriptorSetAccelerationStructureKHR (0x0x7319a497bcc0) 0 + +Class VkPhysicalDeviceAccelerationStructureFeaturesKHR + size=40 align=8 + base size=40 base align=8 +VkPhysicalDeviceAccelerationStructureFeaturesKHR (0x0x7319a497bd20) 0 + +Class VkPhysicalDeviceAccelerationStructurePropertiesKHR + size=64 align=8 + base size=64 base align=8 +VkPhysicalDeviceAccelerationStructurePropertiesKHR (0x0x7319a497bd80) 0 + +Class VkAccelerationStructureDeviceAddressInfoKHR + size=24 align=8 + base size=24 base align=8 +VkAccelerationStructureDeviceAddressInfoKHR (0x0x7319a497be40) 0 + +Class VkAccelerationStructureVersionInfoKHR + size=24 align=8 + base size=24 base align=8 +VkAccelerationStructureVersionInfoKHR (0x0x7319a497bea0) 0 + +Class VkCopyAccelerationStructureToMemoryInfoKHR + size=40 align=8 + base size=40 base align=8 +VkCopyAccelerationStructureToMemoryInfoKHR (0x0x7319a497bf00) 0 + +Class VkCopyMemoryToAccelerationStructureInfoKHR + size=40 align=8 + base size=40 base align=8 +VkCopyMemoryToAccelerationStructureInfoKHR (0x0x7319a497bf60) 0 + +Class VkCopyAccelerationStructureInfoKHR + size=40 align=8 + base size=40 base align=8 +VkCopyAccelerationStructureInfoKHR (0x0x7319a4999000) 0 + +Class VkAccelerationStructureBuildSizesInfoKHR + size=40 align=8 + base size=40 base align=8 +VkAccelerationStructureBuildSizesInfoKHR (0x0x7319a4999060) 0 + +Class VkRayTracingShaderGroupCreateInfoKHR + size=48 align=8 + base size=48 base align=8 +VkRayTracingShaderGroupCreateInfoKHR (0x0x7319a49990c0) 0 + +Class VkRayTracingPipelineInterfaceCreateInfoKHR + size=24 align=8 + base size=24 base align=8 +VkRayTracingPipelineInterfaceCreateInfoKHR (0x0x7319a4999120) 0 + +Class VkRayTracingPipelineCreateInfoKHR + size=104 align=8 + base size=104 base align=8 +VkRayTracingPipelineCreateInfoKHR (0x0x7319a4999180) 0 + +Class VkPhysicalDeviceRayTracingPipelineFeaturesKHR + size=40 align=8 + base size=40 base align=8 +VkPhysicalDeviceRayTracingPipelineFeaturesKHR (0x0x7319a49991e0) 0 + +Class VkPhysicalDeviceRayTracingPipelinePropertiesKHR + size=48 align=8 + base size=48 base align=8 +VkPhysicalDeviceRayTracingPipelinePropertiesKHR (0x0x7319a4999240) 0 + +Class VkStridedDeviceAddressRegionKHR + size=24 align=8 + base size=24 base align=8 +VkStridedDeviceAddressRegionKHR (0x0x7319a4999300) 0 + +Class VkTraceRaysIndirectCommandKHR + size=12 align=4 + base size=12 base align=4 +VkTraceRaysIndirectCommandKHR (0x0x7319a4999360) 0 + +Class VkPhysicalDeviceRayQueryFeaturesKHR + size=24 align=8 + base size=24 base align=8 +VkPhysicalDeviceRayQueryFeaturesKHR (0x0x7319a49993c0) 0 + +Class QVulkanLayer + size=64 align=8 + base size=64 base align=8 +QVulkanLayer (0x0x7319a4999420) 0 + +Class QVulkanExtension + size=32 align=8 + base size=28 base align=8 +QVulkanExtension (0x0x7319a4626000) 0 + +Class QVulkanInstance + size=8 align=8 + base size=8 base align=8 +QVulkanInstance (0x0x7319a466a5a0) 0 + +Class QQuickGraphicsDevice + size=8 align=8 + base size=8 base align=8 +QQuickGraphicsDevice (0x0x7319a4483360) 0 + +Class QQuickTextureFactory::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQuickTextureFactory::QPrivateSignal (0x0x7319a4483420) 0 empty + +Vtable for QQuickTextureFactory +QQuickTextureFactory::_ZTV20QQuickTextureFactory: 18 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QQuickTextureFactory) +16 (int (*)(...))QQuickTextureFactory::metaObject +24 (int (*)(...))QQuickTextureFactory::qt_metacast +32 (int (*)(...))QQuickTextureFactory::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))QQuickTextureFactory::image + +Class QQuickTextureFactory + size=16 align=8 + base size=16 base align=8 +QQuickTextureFactory (0x0x7319a4474208) 0 + vptr=((& QQuickTextureFactory::_ZTV20QQuickTextureFactory) + 16) +QObject (0x0x7319a44833c0) 0 + primary-for QQuickTextureFactory (0x0x7319a4474208) + +Class QQuickImageResponse::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQuickImageResponse::QPrivateSignal (0x0x7319a4483540) 0 empty + +Vtable for QQuickImageResponse +QQuickImageResponse::_ZTV19QQuickImageResponse: 17 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QQuickImageResponse) +16 (int (*)(...))QQuickImageResponse::metaObject +24 (int (*)(...))QQuickImageResponse::qt_metacast +32 (int (*)(...))QQuickImageResponse::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))QQuickImageResponse::errorString +128 (int (*)(...))QQuickImageResponse::cancel + +Class QQuickImageResponse + size=16 align=8 + base size=16 base align=8 +QQuickImageResponse (0x0x7319a4474270) 0 + vptr=((& QQuickImageResponse::_ZTV19QQuickImageResponse) + 16) +QObject (0x0x7319a44834e0) 0 + primary-for QQuickImageResponse (0x0x7319a4474270) + +Class QQuickImageProvider::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQuickImageProvider::QPrivateSignal (0x0x7319a4483720) 0 empty + +Vtable for QQuickImageProvider +QQuickImageProvider::_ZTV19QQuickImageProvider: 19 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QQuickImageProvider) +16 (int (*)(...))QQuickImageProvider::metaObject +24 (int (*)(...))QQuickImageProvider::qt_metacast +32 (int (*)(...))QQuickImageProvider::qt_metacall +40 (int (*)(...))QQuickImageProvider::~QQuickImageProvider +48 (int (*)(...))QQuickImageProvider::~QQuickImageProvider +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QQuickImageProvider::imageType +120 (int (*)(...))QQuickImageProvider::flags +128 (int (*)(...))QQuickImageProvider::requestImage +136 (int (*)(...))QQuickImageProvider::requestPixmap +144 (int (*)(...))QQuickImageProvider::requestTexture + +Class QQuickImageProvider + size=24 align=8 + base size=24 base align=8 +QQuickImageProvider (0x0x7319a44742d8) 0 + vptr=((& QQuickImageProvider::_ZTV19QQuickImageProvider) + 16) +QQmlImageProviderBase (0x0x7319a4474340) 0 + primary-for QQuickImageProvider (0x0x7319a44742d8) +QObject (0x0x7319a44836c0) 0 + primary-for QQmlImageProviderBase (0x0x7319a4474340) + +Vtable for QQuickAsyncImageProvider +QQuickAsyncImageProvider::_ZTV24QQuickAsyncImageProvider: 20 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI24QQuickAsyncImageProvider) +16 (int (*)(...))QQuickImageProvider::metaObject +24 (int (*)(...))QQuickImageProvider::qt_metacast +32 (int (*)(...))QQuickImageProvider::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QQuickImageProvider::imageType +120 (int (*)(...))QQuickImageProvider::flags +128 (int (*)(...))QQuickImageProvider::requestImage +136 (int (*)(...))QQuickImageProvider::requestPixmap +144 (int (*)(...))QQuickImageProvider::requestTexture +152 (int (*)(...))__cxa_pure_virtual + +Class QQuickAsyncImageProvider + size=32 align=8 + base size=32 base align=8 +QQuickAsyncImageProvider (0x0x7319a44744e0) 0 + vptr=((& QQuickAsyncImageProvider::_ZTV24QQuickAsyncImageProvider) + 16) +QQuickImageProvider (0x0x7319a4474548) 0 + primary-for QQuickAsyncImageProvider (0x0x7319a44744e0) +QQmlImageProviderBase (0x0x7319a44745b0) 0 + primary-for QQuickImageProvider (0x0x7319a4474548) +QObject (0x0x7319a4483d80) 0 + primary-for QQmlImageProviderBase (0x0x7319a44745b0) + +Class QQuickItemGrabResult::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQuickItemGrabResult::QPrivateSignal (0x0x7319a4483e40) 0 empty + +Vtable for QQuickItemGrabResult +QQuickItemGrabResult::_ZTV20QQuickItemGrabResult: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QQuickItemGrabResult) +16 (int (*)(...))QQuickItemGrabResult::metaObject +24 (int (*)(...))QQuickItemGrabResult::qt_metacast +32 (int (*)(...))QQuickItemGrabResult::qt_metacall +40 (int (*)(...))QQuickItemGrabResult::~QQuickItemGrabResult +48 (int (*)(...))QQuickItemGrabResult::~QQuickItemGrabResult +56 (int (*)(...))QQuickItemGrabResult::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QQuickItemGrabResult + size=16 align=8 + base size=16 base align=8 +QQuickItemGrabResult (0x0x7319a4474618) 0 + vptr=((& QQuickItemGrabResult::_ZTV20QQuickItemGrabResult) + 16) +QObject (0x0x7319a4483de0) 0 + primary-for QQuickItemGrabResult (0x0x7319a4474618) + +Class QQuickPaintedItem::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQuickPaintedItem::QPrivateSignal (0x0x7319a452f120) 0 empty + +Vtable for QQuickPaintedItem +QQuickPaintedItem::_ZTV17QQuickPaintedItem: 55 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QQuickPaintedItem) +16 (int (*)(...))QQuickPaintedItem::metaObject +24 (int (*)(...))QQuickPaintedItem::qt_metacast +32 (int (*)(...))QQuickPaintedItem::qt_metacall +40 0 +48 0 +56 (int (*)(...))QQuickItem::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QQuickItem::boundingRect +120 (int (*)(...))QQuickItem::clipRect +128 (int (*)(...))QQuickItem::contains +136 (int (*)(...))QQuickItem::inputMethodQuery +144 (int (*)(...))QQuickPaintedItem::isTextureProvider +152 (int (*)(...))QQuickPaintedItem::textureProvider +160 (int (*)(...))QQuickPaintedItem::itemChange +168 (int (*)(...))QQuickItem::geometryChange +176 (int (*)(...))QQuickItem::classBegin +184 (int (*)(...))QQuickItem::componentComplete +192 (int (*)(...))QQuickItem::keyPressEvent +200 (int (*)(...))QQuickItem::keyReleaseEvent +208 (int (*)(...))QQuickItem::inputMethodEvent +216 (int (*)(...))QQuickItem::focusInEvent +224 (int (*)(...))QQuickItem::focusOutEvent +232 (int (*)(...))QQuickItem::mousePressEvent +240 (int (*)(...))QQuickItem::mouseMoveEvent +248 (int (*)(...))QQuickItem::mouseReleaseEvent +256 (int (*)(...))QQuickItem::mouseDoubleClickEvent +264 (int (*)(...))QQuickItem::mouseUngrabEvent +272 (int (*)(...))QQuickItem::touchUngrabEvent +280 (int (*)(...))QQuickItem::wheelEvent +288 (int (*)(...))QQuickItem::touchEvent +296 (int (*)(...))QQuickItem::hoverEnterEvent +304 (int (*)(...))QQuickItem::hoverMoveEvent +312 (int (*)(...))QQuickItem::hoverLeaveEvent +320 (int (*)(...))QQuickItem::dragEnterEvent +328 (int (*)(...))QQuickItem::dragMoveEvent +336 (int (*)(...))QQuickItem::dragLeaveEvent +344 (int (*)(...))QQuickItem::dropEvent +352 (int (*)(...))QQuickItem::childMouseEventFilter +360 (int (*)(...))QQuickPaintedItem::updatePaintNode +368 (int (*)(...))QQuickPaintedItem::releaseResources +376 (int (*)(...))QQuickItem::updatePolish +384 (int (*)(...))__cxa_pure_virtual +392 (int (*)(...))-16 +400 (int (*)(...))(& _ZTI17QQuickPaintedItem) +408 0 +416 0 +424 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem10classBeginEv +432 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem17componentCompleteEv + +Class QQuickPaintedItem + size=32 align=8 + base size=32 base align=8 +QQuickPaintedItem (0x0x7319a4474680) 0 + vptr=((& QQuickPaintedItem::_ZTV17QQuickPaintedItem) + 16) +QQuickItem (0x0x7319a442ee00) 0 + primary-for QQuickPaintedItem (0x0x7319a4474680) +QObject (0x0x7319a452f060) 0 + primary-for QQuickItem (0x0x7319a442ee00) +QQmlParserStatus (0x0x7319a452f0c0) 16 + vptr=((& QQuickPaintedItem::_ZTV17QQuickPaintedItem) + 408) + +Class QQuickRenderControl::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQuickRenderControl::QPrivateSignal (0x0x7319a452fa20) 0 empty + +Vtable for QQuickRenderControl +QQuickRenderControl::_ZTV19QQuickRenderControl: 15 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI19QQuickRenderControl) +16 (int (*)(...))QQuickRenderControl::metaObject +24 (int (*)(...))QQuickRenderControl::qt_metacast +32 (int (*)(...))QQuickRenderControl::qt_metacall +40 (int (*)(...))QQuickRenderControl::~QQuickRenderControl +48 (int (*)(...))QQuickRenderControl::~QQuickRenderControl +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QQuickRenderControl::renderWindow + +Class QQuickRenderControl + size=16 align=8 + base size=16 base align=8 +QQuickRenderControl (0x0x7319a4474958) 0 + vptr=((& QQuickRenderControl::_ZTV19QQuickRenderControl) + 16) +QObject (0x0x7319a452f9c0) 0 + primary-for QQuickRenderControl (0x0x7319a4474958) + +Class QQuickRenderTarget + size=8 align=8 + base size=8 base align=8 +QQuickRenderTarget (0x0x7319a452fc00) 0 + +Vtable for QQuickRhiItemRenderer +QQuickRhiItemRenderer::_ZTV21QQuickRhiItemRenderer: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI21QQuickRhiItemRenderer) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual + +Class QQuickRhiItemRenderer + size=16 align=8 + base size=16 base align=8 +QQuickRhiItemRenderer (0x0x7319a422b2a0) 0 + vptr=((& QQuickRhiItemRenderer::_ZTV21QQuickRhiItemRenderer) + 16) + +Class QQuickRhiItem::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQuickRhiItem::QPrivateSignal (0x0x7319a422b3c0) 0 empty + +Vtable for QQuickRhiItem +QQuickRhiItem::_ZTV13QQuickRhiItem: 55 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QQuickRhiItem) +16 (int (*)(...))QQuickRhiItem::metaObject +24 (int (*)(...))QQuickRhiItem::qt_metacast +32 (int (*)(...))QQuickRhiItem::qt_metacall +40 0 +48 0 +56 (int (*)(...))QQuickRhiItem::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QQuickItem::boundingRect +120 (int (*)(...))QQuickItem::clipRect +128 (int (*)(...))QQuickItem::contains +136 (int (*)(...))QQuickItem::inputMethodQuery +144 (int (*)(...))QQuickRhiItem::isTextureProvider +152 (int (*)(...))QQuickRhiItem::textureProvider +160 (int (*)(...))QQuickItem::itemChange +168 (int (*)(...))QQuickRhiItem::geometryChange +176 (int (*)(...))QQuickItem::classBegin +184 (int (*)(...))QQuickItem::componentComplete +192 (int (*)(...))QQuickItem::keyPressEvent +200 (int (*)(...))QQuickItem::keyReleaseEvent +208 (int (*)(...))QQuickItem::inputMethodEvent +216 (int (*)(...))QQuickItem::focusInEvent +224 (int (*)(...))QQuickItem::focusOutEvent +232 (int (*)(...))QQuickItem::mousePressEvent +240 (int (*)(...))QQuickItem::mouseMoveEvent +248 (int (*)(...))QQuickItem::mouseReleaseEvent +256 (int (*)(...))QQuickItem::mouseDoubleClickEvent +264 (int (*)(...))QQuickItem::mouseUngrabEvent +272 (int (*)(...))QQuickItem::touchUngrabEvent +280 (int (*)(...))QQuickItem::wheelEvent +288 (int (*)(...))QQuickItem::touchEvent +296 (int (*)(...))QQuickItem::hoverEnterEvent +304 (int (*)(...))QQuickItem::hoverMoveEvent +312 (int (*)(...))QQuickItem::hoverLeaveEvent +320 (int (*)(...))QQuickItem::dragEnterEvent +328 (int (*)(...))QQuickItem::dragMoveEvent +336 (int (*)(...))QQuickItem::dragLeaveEvent +344 (int (*)(...))QQuickItem::dropEvent +352 (int (*)(...))QQuickItem::childMouseEventFilter +360 (int (*)(...))QQuickRhiItem::updatePaintNode +368 (int (*)(...))QQuickRhiItem::releaseResources +376 (int (*)(...))QQuickItem::updatePolish +384 (int (*)(...))__cxa_pure_virtual +392 (int (*)(...))-16 +400 (int (*)(...))(& _ZTI13QQuickRhiItem) +408 0 +416 0 +424 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem10classBeginEv +432 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem17componentCompleteEv + +Class QQuickRhiItem + size=32 align=8 + base size=32 base align=8 +QQuickRhiItem (0x0x7319a4474c30) 0 + vptr=((& QQuickRhiItem::_ZTV13QQuickRhiItem) + 16) +QQuickItem (0x0x7319a4537e00) 0 + primary-for QQuickRhiItem (0x0x7319a4474c30) +QObject (0x0x7319a422b300) 0 + primary-for QQuickItem (0x0x7319a4537e00) +QQmlParserStatus (0x0x7319a422b360) 16 + vptr=((& QQuickRhiItem::_ZTV13QQuickRhiItem) + 408) + +Class QQuickTextDocument::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQuickTextDocument::QPrivateSignal (0x0x7319a422b660) 0 empty + +Vtable for QQuickTextDocument +QQuickTextDocument::_ZTV18QQuickTextDocument: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QQuickTextDocument) +16 (int (*)(...))QQuickTextDocument::metaObject +24 (int (*)(...))QQuickTextDocument::qt_metacast +32 (int (*)(...))QQuickTextDocument::qt_metacall +40 (int (*)(...))QQuickTextDocument::~QQuickTextDocument +48 (int (*)(...))QQuickTextDocument::~QQuickTextDocument +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QQuickTextDocument + size=16 align=8 + base size=16 base align=8 +QQuickTextDocument (0x0x7319a4474c98) 0 + vptr=((& QQuickTextDocument::_ZTV18QQuickTextDocument) + 16) +QObject (0x0x7319a422b600) 0 + primary-for QQuickTextDocument (0x0x7319a4474c98) + +Class QSGGeometry::Attribute + size=16 align=4 + base size=16 base align=4 +QSGGeometry::Attribute (0x0x7319a422b960) 0 + +Class QSGGeometry::AttributeSet + size=16 align=8 + base size=16 base align=8 +QSGGeometry::AttributeSet (0x0x7319a422b9c0) 0 + +Class QSGGeometry::Point2D + size=8 align=4 + base size=8 base align=4 +QSGGeometry::Point2D (0x0x7319a422ba20) 0 + +Class QSGGeometry::TexturedPoint2D + size=16 align=4 + base size=16 base align=4 +QSGGeometry::TexturedPoint2D (0x0x7319a422ba80) 0 + +Class QSGGeometry::ColoredPoint2D + size=12 align=4 + base size=12 base align=4 +QSGGeometry::ColoredPoint2D (0x0x7319a422bae0) 0 + +Vtable for QSGGeometry +QSGGeometry::_ZTV11QSGGeometry: 4 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QSGGeometry) +16 (int (*)(...))QSGGeometry::~QSGGeometry +24 (int (*)(...))QSGGeometry::~QSGGeometry + +Class QSGGeometry + size=128 align=8 + base size=128 base align=8 +QSGGeometry (0x0x7319a422b900) 0 + vptr=((& QSGGeometry::_ZTV11QSGGeometry) + 16) + +Vtable for QSGNode +QSGNode::_ZTV7QSGNode: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI7QSGNode) +16 (int (*)(...))QSGNode::~QSGNode +24 (int (*)(...))QSGNode::~QSGNode +32 (int (*)(...))QSGNode::isSubtreeBlocked +40 (int (*)(...))QSGNode::preprocess + +Class QSGNode + size=72 align=8 + base size=72 base align=8 +QSGNode (0x0x7319a42e8660) 0 + vptr=((& QSGNode::_ZTV7QSGNode) + 16) + +Vtable for QSGBasicGeometryNode +QSGBasicGeometryNode::_ZTV20QSGBasicGeometryNode: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QSGBasicGeometryNode) +16 (int (*)(...))QSGBasicGeometryNode::~QSGBasicGeometryNode +24 (int (*)(...))QSGBasicGeometryNode::~QSGBasicGeometryNode +32 (int (*)(...))QSGNode::isSubtreeBlocked +40 (int (*)(...))QSGNode::preprocess + +Class QSGBasicGeometryNode + size=104 align=8 + base size=104 base align=8 +QSGBasicGeometryNode (0x0x7319a4343208) 0 + vptr=((& QSGBasicGeometryNode::_ZTV20QSGBasicGeometryNode) + 16) +QSGNode (0x0x7319a436f720) 0 + primary-for QSGBasicGeometryNode (0x0x7319a4343208) + +Vtable for QSGGeometryNode +QSGGeometryNode::_ZTV15QSGGeometryNode: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI15QSGGeometryNode) +16 (int (*)(...))QSGGeometryNode::~QSGGeometryNode +24 (int (*)(...))QSGGeometryNode::~QSGGeometryNode +32 (int (*)(...))QSGNode::isSubtreeBlocked +40 (int (*)(...))QSGNode::preprocess + +Class QSGGeometryNode + size=136 align=8 + base size=136 base align=8 +QSGGeometryNode (0x0x7319a4343270) 0 + vptr=((& QSGGeometryNode::_ZTV15QSGGeometryNode) + 16) +QSGBasicGeometryNode (0x0x7319a43432d8) 0 + primary-for QSGGeometryNode (0x0x7319a4343270) +QSGNode (0x0x7319a436f9c0) 0 + primary-for QSGBasicGeometryNode (0x0x7319a43432d8) + +Vtable for QSGClipNode +QSGClipNode::_ZTV11QSGClipNode: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QSGClipNode) +16 (int (*)(...))QSGClipNode::~QSGClipNode +24 (int (*)(...))QSGClipNode::~QSGClipNode +32 (int (*)(...))QSGNode::isSubtreeBlocked +40 (int (*)(...))QSGNode::preprocess + +Class QSGClipNode + size=144 align=8 + base size=144 base align=8 +QSGClipNode (0x0x7319a4343340) 0 + vptr=((& QSGClipNode::_ZTV11QSGClipNode) + 16) +QSGBasicGeometryNode (0x0x7319a43433a8) 0 + primary-for QSGClipNode (0x0x7319a4343340) +QSGNode (0x0x7319a436fba0) 0 + primary-for QSGBasicGeometryNode (0x0x7319a43433a8) + +Vtable for QSGTransformNode +QSGTransformNode::_ZTV16QSGTransformNode: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI16QSGTransformNode) +16 (int (*)(...))QSGTransformNode::~QSGTransformNode +24 (int (*)(...))QSGTransformNode::~QSGTransformNode +32 (int (*)(...))QSGNode::isSubtreeBlocked +40 (int (*)(...))QSGNode::preprocess + +Class QSGTransformNode + size=208 align=8 + base size=208 base align=8 +QSGTransformNode (0x0x7319a4343410) 0 + vptr=((& QSGTransformNode::_ZTV16QSGTransformNode) + 16) +QSGNode (0x0x7319a436fcc0) 0 + primary-for QSGTransformNode (0x0x7319a4343410) + +Vtable for QSGRootNode +QSGRootNode::_ZTV11QSGRootNode: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QSGRootNode) +16 (int (*)(...))QSGRootNode::~QSGRootNode +24 (int (*)(...))QSGRootNode::~QSGRootNode +32 (int (*)(...))QSGNode::isSubtreeBlocked +40 (int (*)(...))QSGNode::preprocess + +Class QSGRootNode + size=96 align=8 + base size=96 base align=8 +QSGRootNode (0x0x7319a4343478) 0 + vptr=((& QSGRootNode::_ZTV11QSGRootNode) + 16) +QSGNode (0x0x7319a436fde0) 0 + primary-for QSGRootNode (0x0x7319a4343478) + +Vtable for QSGOpacityNode +QSGOpacityNode::_ZTV14QSGOpacityNode: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QSGOpacityNode) +16 (int (*)(...))QSGOpacityNode::~QSGOpacityNode +24 (int (*)(...))QSGOpacityNode::~QSGOpacityNode +32 (int (*)(...))QSGOpacityNode::isSubtreeBlocked +40 (int (*)(...))QSGNode::preprocess + +Class QSGOpacityNode + size=88 align=8 + base size=88 base align=8 +QSGOpacityNode (0x0x7319a4343b60) 0 + vptr=((& QSGOpacityNode::_ZTV14QSGOpacityNode) + 16) +QSGNode (0x0x7319a43a8600) 0 + primary-for QSGOpacityNode (0x0x7319a4343b60) + +Vtable for QSGNodeVisitor +QSGNodeVisitor::_ZTV14QSGNodeVisitor: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QSGNodeVisitor) +16 (int (*)(...))QSGNodeVisitor::~QSGNodeVisitor +24 (int (*)(...))QSGNodeVisitor::~QSGNodeVisitor +32 (int (*)(...))QSGNodeVisitor::enterTransformNode +40 (int (*)(...))QSGNodeVisitor::leaveTransformNode +48 (int (*)(...))QSGNodeVisitor::enterClipNode +56 (int (*)(...))QSGNodeVisitor::leaveClipNode +64 (int (*)(...))QSGNodeVisitor::enterGeometryNode +72 (int (*)(...))QSGNodeVisitor::leaveGeometryNode +80 (int (*)(...))QSGNodeVisitor::enterOpacityNode +88 (int (*)(...))QSGNodeVisitor::leaveOpacityNode +96 (int (*)(...))QSGNodeVisitor::visitNode +104 (int (*)(...))QSGNodeVisitor::visitChildren + +Class QSGNodeVisitor + size=8 align=8 + base size=8 base align=8 +QSGNodeVisitor (0x0x7319a43a8720) 0 nearly-empty + vptr=((& QSGNodeVisitor::_ZTV14QSGNodeVisitor) + 16) + +Vtable for QSGRendererInterface +QSGRendererInterface::_ZTV20QSGRendererInterface: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QSGRendererInterface) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))QSGRendererInterface::getResource +48 (int (*)(...))QSGRendererInterface::getResource +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual + +Class QSGRendererInterface + size=8 align=8 + base size=8 base align=8 +QSGRendererInterface (0x0x7319a40c2000) 0 nearly-empty + vptr=((& QSGRendererInterface::_ZTV20QSGRendererInterface) + 16) + +Class QQuickWindow::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQuickWindow::QPrivateSignal (0x0x7319a40c2ba0) 0 empty + +Class QQuickWindow::GraphicsStateInfo + size=8 align=4 + base size=8 base align=4 +QQuickWindow::GraphicsStateInfo (0x0x7319a40c2c00) 0 + +Vtable for QQuickWindow +QQuickWindow::_ZTV12QQuickWindow: 47 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QQuickWindow) +16 (int (*)(...))QQuickWindow::metaObject +24 (int (*)(...))QQuickWindow::qt_metacast +32 (int (*)(...))QQuickWindow::qt_metacall +40 (int (*)(...))QQuickWindow::~QQuickWindow +48 (int (*)(...))QQuickWindow::~QQuickWindow +56 (int (*)(...))QQuickWindow::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWindow::surfaceType +120 (int (*)(...))QWindow::format +128 (int (*)(...))QWindow::size +136 (int (*)(...))QQuickWindow::accessibleRoot +144 (int (*)(...))QQuickWindow::focusObject +152 (int (*)(...))QQuickWindow::exposeEvent +160 (int (*)(...))QQuickWindow::resizeEvent +168 (int (*)(...))QWindow::paintEvent +176 (int (*)(...))QWindow::moveEvent +184 (int (*)(...))QQuickWindow::focusInEvent +192 (int (*)(...))QQuickWindow::focusOutEvent +200 (int (*)(...))QQuickWindow::showEvent +208 (int (*)(...))QQuickWindow::hideEvent +216 (int (*)(...))QQuickWindow::closeEvent +224 (int (*)(...))QQuickWindow::keyPressEvent +232 (int (*)(...))QQuickWindow::keyReleaseEvent +240 (int (*)(...))QQuickWindow::mousePressEvent +248 (int (*)(...))QQuickWindow::mouseReleaseEvent +256 (int (*)(...))QQuickWindow::mouseDoubleClickEvent +264 (int (*)(...))QQuickWindow::mouseMoveEvent +272 (int (*)(...))QQuickWindow::wheelEvent +280 (int (*)(...))QWindow::touchEvent +288 (int (*)(...))QQuickWindow::tabletEvent +296 (int (*)(...))QWindow::nativeEvent +304 (int (*)(...))QWindow::surfaceHandle +312 (int (*)(...))-16 +320 (int (*)(...))(& _ZTI12QQuickWindow) +328 (int (*)(...))QQuickWindow::_ZThn16_N12QQuickWindowD1Ev +336 (int (*)(...))QQuickWindow::_ZThn16_N12QQuickWindowD0Ev +344 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv +352 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv +360 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv +368 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv + +Class QQuickWindow + size=40 align=8 + base size=40 base align=8 +QQuickWindow (0x0x7319a41600d0) 0 + vptr=((& QQuickWindow::_ZTV12QQuickWindow) + 16) +QWindow (0x0x7319a40c5ee0) 0 + primary-for QQuickWindow (0x0x7319a41600d0) +QObject (0x0x7319a40c2ae0) 0 + primary-for QWindow (0x0x7319a40c5ee0) +QSurface (0x0x7319a40c2b40) 16 + vptr=((& QQuickWindow::_ZTV12QQuickWindow) + 328) + +Class QQuickView::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QQuickView::QPrivateSignal (0x0x7319a3ec2000) 0 empty + +Vtable for QQuickView +QQuickView::_ZTV10QQuickView: 47 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QQuickView) +16 (int (*)(...))QQuickView::metaObject +24 (int (*)(...))QQuickView::qt_metacast +32 (int (*)(...))QQuickView::qt_metacall +40 (int (*)(...))QQuickView::~QQuickView +48 (int (*)(...))QQuickView::~QQuickView +56 (int (*)(...))QQuickWindow::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QQuickView::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))QWindow::surfaceType +120 (int (*)(...))QWindow::format +128 (int (*)(...))QWindow::size +136 (int (*)(...))QQuickWindow::accessibleRoot +144 (int (*)(...))QQuickWindow::focusObject +152 (int (*)(...))QQuickWindow::exposeEvent +160 (int (*)(...))QQuickView::resizeEvent +168 (int (*)(...))QWindow::paintEvent +176 (int (*)(...))QWindow::moveEvent +184 (int (*)(...))QQuickWindow::focusInEvent +192 (int (*)(...))QQuickWindow::focusOutEvent +200 (int (*)(...))QQuickWindow::showEvent +208 (int (*)(...))QQuickWindow::hideEvent +216 (int (*)(...))QQuickWindow::closeEvent +224 (int (*)(...))QQuickView::keyPressEvent +232 (int (*)(...))QQuickView::keyReleaseEvent +240 (int (*)(...))QQuickView::mousePressEvent +248 (int (*)(...))QQuickView::mouseReleaseEvent +256 (int (*)(...))QQuickWindow::mouseDoubleClickEvent +264 (int (*)(...))QQuickView::mouseMoveEvent +272 (int (*)(...))QQuickWindow::wheelEvent +280 (int (*)(...))QWindow::touchEvent +288 (int (*)(...))QQuickWindow::tabletEvent +296 (int (*)(...))QWindow::nativeEvent +304 (int (*)(...))QWindow::surfaceHandle +312 (int (*)(...))-16 +320 (int (*)(...))(& _ZTI10QQuickView) +328 (int (*)(...))QQuickView::_ZThn16_N10QQuickViewD1Ev +336 (int (*)(...))QQuickView::_ZThn16_N10QQuickViewD0Ev +344 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv +352 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv +360 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv +368 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv + +Class QQuickView + size=40 align=8 + base size=40 base align=8 +QQuickView (0x0x7319a3ea3548) 0 + vptr=((& QQuickView::_ZTV10QQuickView) + 16) +QQuickWindow (0x0x7319a3ea35b0) 0 + primary-for QQuickView (0x0x7319a3ea3548) +QWindow (0x0x7319a3eac0e0) 0 + primary-for QQuickWindow (0x0x7319a3ea35b0) +QObject (0x0x7319a3e9cf00) 0 + primary-for QWindow (0x0x7319a3eac0e0) +QSurface (0x0x7319a3e9cf60) 16 + vptr=((& QQuickView::_ZTV10QQuickView) + 328) + +Class QSGMaterialType + size=1 align=1 + base size=0 base align=1 +QSGMaterialType (0x0x7319a3ec2300) 0 empty + +Class QSGMaterialShader::RenderState + size=16 align=8 + base size=16 base align=8 +QSGMaterialShader::RenderState (0x0x7319a3ec23c0) 0 + +Class QSGMaterialShader::GraphicsPipelineState + size=60 align=4 + base size=60 base align=4 +QSGMaterialShader::GraphicsPipelineState (0x0x7319a3ec26c0) 0 + +Vtable for QSGMaterialShader +QSGMaterialShader::_ZTV17QSGMaterialShader: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QSGMaterialShader) +16 (int (*)(...))QSGMaterialShader::~QSGMaterialShader +24 (int (*)(...))QSGMaterialShader::~QSGMaterialShader +32 (int (*)(...))QSGMaterialShader::updateUniformData +40 (int (*)(...))QSGMaterialShader::updateSampledImage +48 (int (*)(...))QSGMaterialShader::updateGraphicsPipelineState + +Class QSGMaterialShader + size=16 align=8 + base size=16 base align=8 +QSGMaterialShader (0x0x7319a3ec2360) 0 + vptr=((& QSGMaterialShader::_ZTV17QSGMaterialShader) + 16) + +Vtable for QSGMaterial +QSGMaterial::_ZTV11QSGMaterial: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QSGMaterial) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))QSGMaterial::compare + +Class QSGMaterial + size=24 align=8 + base size=24 base align=8 +QSGMaterial (0x0x7319a3fa4960) 0 + vptr=((& QSGMaterial::_ZTV11QSGMaterial) + 16) + +Vtable for QSGFlatColorMaterial +QSGFlatColorMaterial::_ZTV20QSGFlatColorMaterial: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QSGFlatColorMaterial) +16 (int (*)(...))QSGFlatColorMaterial::~QSGFlatColorMaterial +24 (int (*)(...))QSGFlatColorMaterial::~QSGFlatColorMaterial +32 (int (*)(...))QSGFlatColorMaterial::type +40 (int (*)(...))QSGFlatColorMaterial::createShader +48 (int (*)(...))QSGFlatColorMaterial::compare + +Class QSGFlatColorMaterial + size=40 align=8 + base size=40 base align=8 +QSGFlatColorMaterial (0x0x7319a3d30000) 0 + vptr=((& QSGFlatColorMaterial::_ZTV20QSGFlatColorMaterial) + 16) +QSGMaterial (0x0x7319a3fa4f60) 0 + primary-for QSGFlatColorMaterial (0x0x7319a3d30000) + +Class QNativeInterface::QSGOpenGLTexture::TypeInfo + size=1 align=1 + base size=0 base align=1 +QNativeInterface::QSGOpenGLTexture::TypeInfo (0x0x7319a3d360c0) 0 empty + +Vtable for QNativeInterface::QSGOpenGLTexture +QNativeInterface::QSGOpenGLTexture::_ZTVN16QNativeInterface16QSGOpenGLTextureE: 5 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN16QNativeInterface16QSGOpenGLTextureE) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual + +Class QNativeInterface::QSGOpenGLTexture + size=8 align=8 + base size=8 base align=8 +QNativeInterface::QSGOpenGLTexture (0x0x7319a3d36060) 0 nearly-empty + vptr=((& QNativeInterface::QSGOpenGLTexture::_ZTVN16QNativeInterface16QSGOpenGLTextureE) + 16) + +Class QNativeInterface::QSGVulkanTexture::TypeInfo + size=1 align=1 + base size=0 base align=1 +QNativeInterface::QSGVulkanTexture::TypeInfo (0x0x7319a3d361e0) 0 empty + +Vtable for QNativeInterface::QSGVulkanTexture +QNativeInterface::QSGVulkanTexture::_ZTVN16QNativeInterface16QSGVulkanTextureE: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN16QNativeInterface16QSGVulkanTextureE) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual + +Class QNativeInterface::QSGVulkanTexture + size=8 align=8 + base size=8 base align=8 +QNativeInterface::QSGVulkanTexture (0x0x7319a3d36180) 0 nearly-empty + vptr=((& QNativeInterface::QSGVulkanTexture::_ZTVN16QNativeInterface16QSGVulkanTextureE) + 16) + +Class QSGTexture::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSGTexture::QPrivateSignal (0x0x7319a3d36300) 0 empty + +Vtable for QSGTexture +QSGTexture::_ZTV10QSGTexture: 23 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI10QSGTexture) +16 (int (*)(...))QSGTexture::metaObject +24 (int (*)(...))QSGTexture::qt_metacast +32 (int (*)(...))QSGTexture::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))QSGTexture::rhiTexture +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))QSGTexture::normalizedTextureSubRect +160 (int (*)(...))QSGTexture::isAtlasTexture +168 (int (*)(...))QSGTexture::removedFromAtlas +176 (int (*)(...))QSGTexture::commitTextureOperations + +Class QSGTexture + size=16 align=8 + base size=16 base align=8 +QSGTexture (0x0x7319a3d30068) 0 + vptr=((& QSGTexture::_ZTV10QSGTexture) + 16) +QObject (0x0x7319a3d362a0) 0 + primary-for QSGTexture (0x0x7319a3d30068) + +Class QSGDynamicTexture::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSGDynamicTexture::QPrivateSignal (0x0x7319a3d365a0) 0 empty + +Vtable for QSGDynamicTexture +QSGDynamicTexture::_ZTV17QSGDynamicTexture: 24 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QSGDynamicTexture) +16 (int (*)(...))QSGDynamicTexture::metaObject +24 (int (*)(...))QSGDynamicTexture::qt_metacast +32 (int (*)(...))QSGDynamicTexture::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))QSGTexture::rhiTexture +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))QSGTexture::normalizedTextureSubRect +160 (int (*)(...))QSGTexture::isAtlasTexture +168 (int (*)(...))QSGTexture::removedFromAtlas +176 (int (*)(...))QSGTexture::commitTextureOperations +184 (int (*)(...))__cxa_pure_virtual + +Class QSGDynamicTexture + size=16 align=8 + base size=16 base align=8 +QSGDynamicTexture (0x0x7319a3d300d0) 0 + vptr=((& QSGDynamicTexture::_ZTV17QSGDynamicTexture) + 16) +QSGTexture (0x0x7319a3d30138) 0 + primary-for QSGDynamicTexture (0x0x7319a3d300d0) +QObject (0x0x7319a3d36540) 0 + primary-for QSGTexture (0x0x7319a3d30138) + +Vtable for QSGImageNode +QSGImageNode::_ZTV12QSGImageNode: 22 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QSGImageNode) +16 0 +24 0 +32 (int (*)(...))QSGNode::isSubtreeBlocked +40 (int (*)(...))QSGNode::preprocess +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))__cxa_pure_virtual +96 (int (*)(...))__cxa_pure_virtual +104 (int (*)(...))__cxa_pure_virtual +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))__cxa_pure_virtual +160 (int (*)(...))__cxa_pure_virtual +168 (int (*)(...))__cxa_pure_virtual + +Class QSGImageNode + size=136 align=8 + base size=136 base align=8 +QSGImageNode (0x0x7319a3d301a0) 0 + vptr=((& QSGImageNode::_ZTV12QSGImageNode) + 16) +QSGGeometryNode (0x0x7319a3d30208) 0 + primary-for QSGImageNode (0x0x7319a3d301a0) +QSGBasicGeometryNode (0x0x7319a3d30270) 0 + primary-for QSGGeometryNode (0x0x7319a3d30208) +QSGNode (0x0x7319a3d36660) 0 + primary-for QSGBasicGeometryNode (0x0x7319a3d30270) + +Vtable for QSGNinePatchNode +QSGNinePatchNode::_ZTV16QSGNinePatchNode: 11 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI16QSGNinePatchNode) +16 0 +24 0 +32 (int (*)(...))QSGNode::isSubtreeBlocked +40 (int (*)(...))QSGNode::preprocess +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual + +Class QSGNinePatchNode + size=136 align=8 + base size=136 base align=8 +QSGNinePatchNode (0x0x7319a3d30548) 0 + vptr=((& QSGNinePatchNode::_ZTV16QSGNinePatchNode) + 16) +QSGGeometryNode (0x0x7319a3d305b0) 0 + primary-for QSGNinePatchNode (0x0x7319a3d30548) +QSGBasicGeometryNode (0x0x7319a3d30618) 0 + primary-for QSGGeometryNode (0x0x7319a3d305b0) +QSGNode (0x0x7319a3d36cc0) 0 + primary-for QSGBasicGeometryNode (0x0x7319a3d30618) + +Vtable for QSGRectangleNode +QSGRectangleNode::_ZTV16QSGRectangleNode: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI16QSGRectangleNode) +16 0 +24 0 +32 (int (*)(...))QSGNode::isSubtreeBlocked +40 (int (*)(...))QSGNode::preprocess +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual + +Class QSGRectangleNode + size=136 align=8 + base size=136 base align=8 +QSGRectangleNode (0x0x7319a3d30680) 0 + vptr=((& QSGRectangleNode::_ZTV16QSGRectangleNode) + 16) +QSGGeometryNode (0x0x7319a3d306e8) 0 + primary-for QSGRectangleNode (0x0x7319a3d30680) +QSGBasicGeometryNode (0x0x7319a3d30750) 0 + primary-for QSGGeometryNode (0x0x7319a3d306e8) +QSGNode (0x0x7319a3d36d20) 0 + primary-for QSGBasicGeometryNode (0x0x7319a3d30750) + +Vtable for QSGRenderNode::RenderState +QSGRenderNode::RenderState::_ZTVN13QSGRenderNode11RenderStateE: 11 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTIN13QSGRenderNode11RenderStateE) +16 0 +24 0 +32 (int (*)(...))__cxa_pure_virtual +40 (int (*)(...))__cxa_pure_virtual +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))QSGRenderNode::RenderState::get + +Class QSGRenderNode::RenderState + size=8 align=8 + base size=8 base align=8 +QSGRenderNode::RenderState (0x0x7319a3d36e40) 0 nearly-empty + vptr=((& QSGRenderNode::RenderState::_ZTVN13QSGRenderNode11RenderStateE) + 16) + +Vtable for QSGRenderNode +QSGRenderNode::_ZTV13QSGRenderNode: 12 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QSGRenderNode) +16 0 +24 0 +32 (int (*)(...))QSGNode::isSubtreeBlocked +40 (int (*)(...))QSGNode::preprocess +48 (int (*)(...))QSGRenderNode::changedStates +56 (int (*)(...))QSGRenderNode::prepare +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))QSGRenderNode::releaseResources +80 (int (*)(...))QSGRenderNode::flags +88 (int (*)(...))QSGRenderNode::rect + +Class QSGRenderNode + size=80 align=8 + base size=80 base align=8 +QSGRenderNode (0x0x7319a3d307b8) 0 + vptr=((& QSGRenderNode::_ZTV13QSGRenderNode) + 16) +QSGNode (0x0x7319a3d36de0) 0 + primary-for QSGRenderNode (0x0x7319a3d307b8) + +Vtable for QSGSimpleRectNode +QSGSimpleRectNode::_ZTV17QSGSimpleRectNode: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI17QSGSimpleRectNode) +16 (int (*)(...))QSGSimpleRectNode::~QSGSimpleRectNode +24 (int (*)(...))QSGSimpleRectNode::~QSGSimpleRectNode +32 (int (*)(...))QSGNode::isSubtreeBlocked +40 (int (*)(...))QSGNode::preprocess + +Class QSGSimpleRectNode + size=312 align=8 + base size=312 base align=8 +QSGSimpleRectNode (0x0x7319a3d30d00) 0 + vptr=((& QSGSimpleRectNode::_ZTV17QSGSimpleRectNode) + 16) +QSGGeometryNode (0x0x7319a3d30d68) 0 + primary-for QSGSimpleRectNode (0x0x7319a3d30d00) +QSGBasicGeometryNode (0x0x7319a3d30dd0) 0 + primary-for QSGGeometryNode (0x0x7319a3d30d68) +QSGNode (0x0x7319a3a1c960) 0 + primary-for QSGBasicGeometryNode (0x0x7319a3d30dd0) + +Vtable for QSGOpaqueTextureMaterial +QSGOpaqueTextureMaterial::_ZTV24QSGOpaqueTextureMaterial: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI24QSGOpaqueTextureMaterial) +16 (int (*)(...))QSGOpaqueTextureMaterial::~QSGOpaqueTextureMaterial +24 (int (*)(...))QSGOpaqueTextureMaterial::~QSGOpaqueTextureMaterial +32 (int (*)(...))QSGOpaqueTextureMaterial::type +40 (int (*)(...))QSGOpaqueTextureMaterial::createShader +48 (int (*)(...))QSGOpaqueTextureMaterial::compare + +Class QSGOpaqueTextureMaterial + size=40 align=8 + base size=36 base align=8 +QSGOpaqueTextureMaterial (0x0x7319a3d30e38) 0 + vptr=((& QSGOpaqueTextureMaterial::_ZTV24QSGOpaqueTextureMaterial) + 16) +QSGMaterial (0x0x7319a3a1ca20) 0 + primary-for QSGOpaqueTextureMaterial (0x0x7319a3d30e38) + +Vtable for QSGTextureMaterial +QSGTextureMaterial::_ZTV18QSGTextureMaterial: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QSGTextureMaterial) +16 (int (*)(...))QSGTextureMaterial::~QSGTextureMaterial +24 (int (*)(...))QSGTextureMaterial::~QSGTextureMaterial +32 (int (*)(...))QSGTextureMaterial::type +40 (int (*)(...))QSGTextureMaterial::createShader +48 (int (*)(...))QSGOpaqueTextureMaterial::compare + +Class QSGTextureMaterial + size=40 align=8 + base size=36 base align=8 +QSGTextureMaterial (0x0x7319a3d30ea0) 0 + vptr=((& QSGTextureMaterial::_ZTV18QSGTextureMaterial) + 16) +QSGOpaqueTextureMaterial (0x0x7319a3d30f08) 0 + primary-for QSGTextureMaterial (0x0x7319a3d30ea0) +QSGMaterial (0x0x7319a3a1cea0) 0 + primary-for QSGOpaqueTextureMaterial (0x0x7319a3d30f08) + +Vtable for QSGSimpleTextureNode +QSGSimpleTextureNode::_ZTV20QSGSimpleTextureNode: 6 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI20QSGSimpleTextureNode) +16 (int (*)(...))QSGSimpleTextureNode::~QSGSimpleTextureNode +24 (int (*)(...))QSGSimpleTextureNode::~QSGSimpleTextureNode +32 (int (*)(...))QSGNode::isSubtreeBlocked +40 (int (*)(...))QSGNode::preprocess + +Class QSGSimpleTextureNode + size=376 align=8 + base size=376 base align=8 +QSGSimpleTextureNode (0x0x7319a3d30f70) 0 + vptr=((& QSGSimpleTextureNode::_ZTV20QSGSimpleTextureNode) + 16) +QSGGeometryNode (0x0x7319a3b3b000) 0 + primary-for QSGSimpleTextureNode (0x0x7319a3d30f70) +QSGBasicGeometryNode (0x0x7319a3b3b068) 0 + primary-for QSGGeometryNode (0x0x7319a3b3b000) +QSGNode (0x0x7319a3a1cf00) 0 + primary-for QSGBasicGeometryNode (0x0x7319a3b3b068) + +Vtable for QSGTextNode +QSGTextNode::_ZTV11QSGTextNode: 29 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI11QSGTextNode) +16 0 +24 0 +32 (int (*)(...))QSGNode::isSubtreeBlocked +40 (int (*)(...))QSGNode::preprocess +48 (int (*)(...))__cxa_pure_virtual +56 (int (*)(...))__cxa_pure_virtual +64 (int (*)(...))__cxa_pure_virtual +72 (int (*)(...))__cxa_pure_virtual +80 (int (*)(...))__cxa_pure_virtual +88 (int (*)(...))__cxa_pure_virtual +96 (int (*)(...))__cxa_pure_virtual +104 (int (*)(...))__cxa_pure_virtual +112 (int (*)(...))__cxa_pure_virtual +120 (int (*)(...))__cxa_pure_virtual +128 (int (*)(...))__cxa_pure_virtual +136 (int (*)(...))__cxa_pure_virtual +144 (int (*)(...))__cxa_pure_virtual +152 (int (*)(...))__cxa_pure_virtual +160 (int (*)(...))__cxa_pure_virtual +168 (int (*)(...))__cxa_pure_virtual +176 (int (*)(...))__cxa_pure_virtual +184 (int (*)(...))__cxa_pure_virtual +192 (int (*)(...))__cxa_pure_virtual +200 (int (*)(...))__cxa_pure_virtual +208 (int (*)(...))__cxa_pure_virtual +216 (int (*)(...))__cxa_pure_virtual +224 (int (*)(...))__cxa_pure_virtual + +Class QSGTextNode + size=208 align=8 + base size=208 base align=8 +QSGTextNode (0x0x7319a3b3b340) 0 + vptr=((& QSGTextNode::_ZTV11QSGTextNode) + 16) +QSGTransformNode (0x0x7319a3b3b3a8) 0 + primary-for QSGTextNode (0x0x7319a3b3b340) +QSGNode (0x0x7319a3b47900) 0 + primary-for QSGTransformNode (0x0x7319a3b3b3a8) + +Class QSGTextureProvider::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSGTextureProvider::QPrivateSignal (0x0x7319a3b47a80) 0 empty + +Vtable for QSGTextureProvider +QSGTextureProvider::_ZTV18QSGTextureProvider: 15 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI18QSGTextureProvider) +16 (int (*)(...))QSGTextureProvider::metaObject +24 (int (*)(...))QSGTextureProvider::qt_metacast +32 (int (*)(...))QSGTextureProvider::qt_metacall +40 0 +48 0 +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify +112 (int (*)(...))__cxa_pure_virtual + +Class QSGTextureProvider + size=16 align=8 + base size=16 base align=8 +QSGTextureProvider (0x0x7319a3b3b4e0) 0 + vptr=((& QSGTextureProvider::_ZTV18QSGTextureProvider) + 16) +QObject (0x0x7319a3b47a20) 0 + primary-for QSGTextureProvider (0x0x7319a3b3b4e0) + +Vtable for QSGVertexColorMaterial +QSGVertexColorMaterial::_ZTV22QSGVertexColorMaterial: 7 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI22QSGVertexColorMaterial) +16 (int (*)(...))QSGVertexColorMaterial::~QSGVertexColorMaterial +24 (int (*)(...))QSGVertexColorMaterial::~QSGVertexColorMaterial +32 (int (*)(...))QSGVertexColorMaterial::type +40 (int (*)(...))QSGVertexColorMaterial::createShader +48 (int (*)(...))QSGVertexColorMaterial::compare + +Class QSGVertexColorMaterial + size=24 align=8 + base size=24 base align=8 +QSGVertexColorMaterial (0x0x7319a3b3b548) 0 + vptr=((& QSGVertexColorMaterial::_ZTV22QSGVertexColorMaterial) + 16) +QSGMaterial (0x0x7319a3b47b40) 0 + primary-for QSGVertexColorMaterial (0x0x7319a3b3b548) + +Class QAbstractItemModelTester::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QAbstractItemModelTester::QPrivateSignal (0x0x7319a3b47c00) 0 empty + +Vtable for QAbstractItemModelTester +QAbstractItemModelTester::_ZTV24QAbstractItemModelTester: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI24QAbstractItemModelTester) +16 (int (*)(...))QAbstractItemModelTester::metaObject +24 (int (*)(...))QAbstractItemModelTester::qt_metacast +32 (int (*)(...))QAbstractItemModelTester::qt_metacall +40 (int (*)(...))QAbstractItemModelTester::~QAbstractItemModelTester +48 (int (*)(...))QAbstractItemModelTester::~QAbstractItemModelTester +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QAbstractItemModelTester + size=16 align=8 + base size=16 base align=8 +QAbstractItemModelTester (0x0x7319a3b3b5b0) 0 + vptr=((& QAbstractItemModelTester::_ZTV24QAbstractItemModelTester) + 16) +QObject (0x0x7319a3b47ba0) 0 + primary-for QAbstractItemModelTester (0x0x7319a3b3b5b0) + +Class QTest::QBenchmarkIterationController + size=4 align=4 + base size=4 base align=4 +QTest::QBenchmarkIterationController (0x0x7319a3b47d80) 0 + +Class QTest::Internal::QCborValueFormatter + size=1 align=1 + base size=0 base align=1 +QTest::Internal::QCborValueFormatter (0x0x7319a39bfa20) 0 empty + +Class QTest::ThrowOnFailEnabler + size=1 align=1 + base size=0 base align=1 +QTest::ThrowOnFailEnabler (0x0x7319a3408180) 0 empty + +Class QTest::ThrowOnSkipEnabler + size=1 align=1 + base size=0 base align=1 +QTest::ThrowOnSkipEnabler (0x0x7319a34084e0) 0 empty + +Class QTest::ThrowOnFailDisabler + size=1 align=1 + base size=0 base align=1 +QTest::ThrowOnFailDisabler (0x0x7319a3408840) 0 empty + +Class QTest::ThrowOnSkipDisabler + size=1 align=1 + base size=0 base align=1 +QTest::ThrowOnSkipDisabler (0x0x7319a3408ba0) 0 empty + +Class QTestEventLoop::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QTestEventLoop::QPrivateSignal (0x0x7319a34666c0) 0 empty + +Vtable for QTestEventLoop +QTestEventLoop::_ZTV14QTestEventLoop: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI14QTestEventLoop) +16 (int (*)(...))QTestEventLoop::metaObject +24 (int (*)(...))QTestEventLoop::qt_metacast +32 (int (*)(...))QTestEventLoop::qt_metacall +40 (int (*)(...))QTestEventLoop::~QTestEventLoop +48 (int (*)(...))QTestEventLoop::~QTestEventLoop +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QTestEventLoop::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QTestEventLoop + size=32 align=8 + base size=32 base align=8 +QTestEventLoop (0x0x7319a37efdd0) 0 + vptr=((& QTestEventLoop::_ZTV14QTestEventLoop) + 16) +QObject (0x0x7319a3466660) 0 + primary-for QTestEventLoop (0x0x7319a37efdd0) + +Class QSignalSpy::ObjectSignal + size=24 align=8 + base size=24 base align=8 +QSignalSpy::ObjectSignal (0x0x7319a34e0ae0) 0 + +Class QSignalSpy + size=128 align=8 + base size=128 base align=8 +QSignalSpy (0x0x7319a34f3680) 0 +QList > (0x0x7319a34f36e8) 0 +QListSpecialMethods > (0x0x7319a34f3750) 0 empty +QListSpecialMethodsBase > (0x0x7319a34e0a80) 0 empty + +Class QTestData + size=8 align=8 + base size=8 base align=8 +QTestData (0x0x7319a32ca600) 0 + +Vtable for QSvgGenerator +QSvgGenerator::_ZTV13QSvgGenerator: 10 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI13QSvgGenerator) +16 (int (*)(...))QSvgGenerator::~QSvgGenerator +24 (int (*)(...))QSvgGenerator::~QSvgGenerator +32 (int (*)(...))QPaintDevice::devType +40 (int (*)(...))QSvgGenerator::paintEngine +48 (int (*)(...))QSvgGenerator::metric +56 (int (*)(...))QSvgGenerator::initPainter +64 (int (*)(...))QPaintDevice::redirected +72 (int (*)(...))QPaintDevice::sharedPainter + +Class QSvgGenerator + size=24 align=8 + base size=24 base align=8 +QSvgGenerator (0x0x7319a32aaa90) 0 + vptr=((& QSvgGenerator::_ZTV13QSvgGenerator) + 16) +QPaintDevice (0x0x7319a3343420) 0 + primary-for QSvgGenerator (0x0x7319a32aaa90) + +Class QSvgRenderer::QPrivateSignal + size=1 align=1 + base size=0 base align=1 +QSvgRenderer::QPrivateSignal (0x0x7319a3343660) 0 empty + +Vtable for QSvgRenderer +QSvgRenderer::_ZTV12QSvgRenderer: 14 entries +0 (int (*)(...))0 +8 (int (*)(...))(& _ZTI12QSvgRenderer) +16 (int (*)(...))QSvgRenderer::metaObject +24 (int (*)(...))QSvgRenderer::qt_metacast +32 (int (*)(...))QSvgRenderer::qt_metacall +40 (int (*)(...))QSvgRenderer::~QSvgRenderer +48 (int (*)(...))QSvgRenderer::~QSvgRenderer +56 (int (*)(...))QObject::event +64 (int (*)(...))QObject::eventFilter +72 (int (*)(...))QObject::timerEvent +80 (int (*)(...))QObject::childEvent +88 (int (*)(...))QObject::customEvent +96 (int (*)(...))QObject::connectNotify +104 (int (*)(...))QObject::disconnectNotify + +Class QSvgRenderer + size=16 align=8 + base size=16 base align=8 +QSvgRenderer (0x0x7319a32aaaf8) 0 + vptr=((& QSvgRenderer::_ZTV12QSvgRenderer) + 16) +QObject (0x0x7319a3343600) 0 + primary-for QSvgRenderer (0x0x7319a32aaaf8) + diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/CMakeLists.txt b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/CMakeLists.txt new file mode 100644 index 0000000000..28cbd4b139 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (C) 2026 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) +project(${RunCMake_TEST} LANGUAGES CXX) +include(${RunCMake_TEST}.cmake) diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/RunCMakeTest.cmake b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/RunCMakeTest.cmake new file mode 100644 index 0000000000..3efcee71f8 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/RunCMakeTest.cmake @@ -0,0 +1,26 @@ +include(QtRunCMake) + +set(cmake_opts "-DQt6_DIR=${Qt6_DIR}") + +# Test that I18N_SOURCE_LANGUAGE changes CFBundleDevelopmentRegion. +set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/source-language-de-build") +run_cmake_with_options(source-language-de ${cmake_opts}) + +set(RunCMake_TEST_NO_CLEAN TRUE) +run_cmake_command(source-language-de-build ${CMAKE_COMMAND} --build .) + +# Test that I18N_SOURCE_LANGUAGE without I18N_TRANSLATED_LANGUAGES still works. +set(RunCMake_TEST_NO_CLEAN FALSE) +set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/source-language-only-build") +run_cmake_with_options(source-language-only ${cmake_opts}) + +set(RunCMake_TEST_NO_CLEAN TRUE) +run_cmake_command(source-language-only-build ${CMAKE_COMMAND} --build .) + +# Test that the default I18N_SOURCE_LANGUAGE ("en") keeps CFBundleDevelopmentRegion as "en". +set(RunCMake_TEST_NO_CLEAN FALSE) +set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/default-language-build") +run_cmake_with_options(default-language ${cmake_opts}) + +set(RunCMake_TEST_NO_CLEAN TRUE) +run_cmake_command(default-language-build ${CMAKE_COMMAND} --build .) diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/default-language-build-check.cmake b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/default-language-build-check.cmake new file mode 100644 index 0000000000..869615f4fe --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/default-language-build-check.cmake @@ -0,0 +1,14 @@ +execute_process( + COMMAND /usr/libexec/PlistBuddy -c "print CFBundleDevelopmentRegion" + "${RunCMake_TEST_BINARY_DIR}/app.app/Contents/Info.plist" + OUTPUT_VARIABLE dev_region + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE result +) +if(NOT result EQUAL 0) + set(RunCMake_TEST_FAILED + "Failed to read CFBundleDevelopmentRegion from Info.plist") +elseif(NOT dev_region STREQUAL "en") + set(RunCMake_TEST_FAILED + "CFBundleDevelopmentRegion is '${dev_region}', expected 'en'") +endif() diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/default-language.cmake b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/default-language.cmake new file mode 100644 index 0000000000..d00392c3d5 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/default-language.cmake @@ -0,0 +1,8 @@ +find_package(Qt6 REQUIRED COMPONENTS Core) + +qt_standard_project_setup( + I18N_TRANSLATED_LANGUAGES pl +) + +qt_add_executable(app MACOSX_BUNDLE main.cpp) +target_link_libraries(app PRIVATE Qt6::Core) diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/main.cpp b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/main.cpp new file mode 100644 index 0000000000..cfc613b6c4 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/main.cpp @@ -0,0 +1,7 @@ +// Copyright (C) 2026 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +int main(int argc, char *argv[]) +{ + return 0; +} diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/source-language-de-build-check.cmake b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/source-language-de-build-check.cmake new file mode 100644 index 0000000000..6cc40975ee --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/source-language-de-build-check.cmake @@ -0,0 +1,14 @@ +execute_process( + COMMAND /usr/libexec/PlistBuddy -c "print CFBundleDevelopmentRegion" + "${RunCMake_TEST_BINARY_DIR}/app.app/Contents/Info.plist" + OUTPUT_VARIABLE dev_region + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE result +) +if(NOT result EQUAL 0) + set(RunCMake_TEST_FAILED + "Failed to read CFBundleDevelopmentRegion from Info.plist") +elseif(NOT dev_region STREQUAL "de") + set(RunCMake_TEST_FAILED + "CFBundleDevelopmentRegion is '${dev_region}', expected 'de'") +endif() diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/source-language-de.cmake b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/source-language-de.cmake new file mode 100644 index 0000000000..986baf710f --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/source-language-de.cmake @@ -0,0 +1,9 @@ +find_package(Qt6 REQUIRED COMPONENTS Core) + +qt_standard_project_setup( + I18N_SOURCE_LANGUAGE de + I18N_TRANSLATED_LANGUAGES pl +) + +qt_add_executable(app MACOSX_BUNDLE main.cpp) +target_link_libraries(app PRIVATE Qt6::Core) diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/source-language-only-build-check.cmake b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/source-language-only-build-check.cmake new file mode 100644 index 0000000000..6cc40975ee --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/source-language-only-build-check.cmake @@ -0,0 +1,14 @@ +execute_process( + COMMAND /usr/libexec/PlistBuddy -c "print CFBundleDevelopmentRegion" + "${RunCMake_TEST_BINARY_DIR}/app.app/Contents/Info.plist" + OUTPUT_VARIABLE dev_region + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE result +) +if(NOT result EQUAL 0) + set(RunCMake_TEST_FAILED + "Failed to read CFBundleDevelopmentRegion from Info.plist") +elseif(NOT dev_region STREQUAL "de") + set(RunCMake_TEST_FAILED + "CFBundleDevelopmentRegion is '${dev_region}', expected 'de'") +endif() diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/source-language-only.cmake b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/source-language-only.cmake new file mode 100644 index 0000000000..c950735644 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/ApplePlistI18n/source-language-only.cmake @@ -0,0 +1,8 @@ +find_package(Qt6 REQUIRED COMPONENTS Core) + +qt_standard_project_setup( + I18N_SOURCE_LANGUAGE de +) + +qt_add_executable(app MACOSX_BUNDLE main.cpp) +target_link_libraries(app PRIVATE Qt6::Core) diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/MainConfig.cmake.in b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/MainConfig.cmake.in new file mode 100644 index 0000000000..0887f986a9 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/MainConfig.cmake.in @@ -0,0 +1,3 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/MainTargets.cmake") diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/build_tools-install-check.cmake b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/build_tools-install-check.cmake new file mode 100644 index 0000000000..8cd5803a24 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/build_tools-install-check.cmake @@ -0,0 +1,4 @@ +# Include generic check.cmake +include("${CMAKE_CURRENT_LIST_DIR}/check.cmake") + +check_cydx_v1_6_dependencies(TARGETS_CATEGORY "RELATIONSHIP") diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/build_tools.cmake b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/build_tools.cmake new file mode 100644 index 0000000000..321f37b547 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/build_tools.cmake @@ -0,0 +1,181 @@ +# Needed to make the sbom functions available. +find_package(Qt6 REQUIRED Core) + +include(CommonResultGenIntro) + +_qt_internal_setup_sbom( + GENERATE_SBOM_DEFAULT "TRUE" +) + +function(create_sbom_lib_target target) + add_library(${target} STATIC) + target_sources(${target} PRIVATE sources/utils_helper.cpp) + install(TARGETS ${target} + EXPORT MainTargets + ARCHIVE DESTINATION lib + ) + _qt_internal_add_sbom(${target} + TYPE "LIBRARY" + RUNTIME_PATH bin + ARCHIVE_PATH lib + LIBRARY_PATH lib + ) + + # This is used the by spdx and cydx deps checking code. + _qt_internal_sbom_get_spdx_id_for_target(${target} ${target}_spdx_id) + set(${target}_spdx_id "${${target}_spdx_id}" PARENT_SCOPE) + + add_known_target(${target} + CATEGORY "RELATIONSHIP" + SPDX_ID "${${target}_spdx_id}" + ) + + bubble_up_extra_result_code() +endfunction() + +macro(set_common_sbom_begin_args out_var) + set(${out_var} + SBOM_PROJECT_NAME "${SBOM_PROJECT_NAME}" + SUPPLIER "${SBOM_SUPPLIER}" + SUPPLIER_URL "${SBOM_SUPPLIER_URL}" + VERSION "${SBOM_VERSION}" + ) +endmacro() + +# Some of these variables are used by CommonResultGen.cmake. +set(SBOM_SUPPLIER "QtProjectTest") +set(SBOM_SUPPLIER_URL "https://qt-project.org/SbomTest") +set(SBOM_VERSION "1.0.0") + +# Case 1, check that the default project build tools are created +set(SBOM_PROJECT_NAME "001-auto-tools") +set_common_sbom_begin_args(sbom_begin_args) +_qt_internal_sbom_begin_project( + ${sbom_begin_args} +) + +_qt_internal_sbom_get_project_default_build_tool_types(default_build_tools_types) +if(QT_GENERATE_SBOM) + foreach(build_tool_type IN LISTS default_build_tools_types) + _qt_internal_sbom_get_build_tool_target_for_type( + BUILD_TOOL_TYPE "${build_tool_type}" + OUT_VAR_TARGET target + ) + if(NOT TARGET "${target}") + message(FATAL_ERROR + "Expected build tool target '${target}' for build tool type " + "'${build_tool_type}' does not exist.") + endif() + endforeach() +endif() +_qt_internal_sbom_end_project() + +# Case 2, check that the default project build tools are not created +set(SBOM_PROJECT_NAME "002-no-auto-tools") +set_common_sbom_begin_args(sbom_begin_args) +_qt_internal_sbom_begin_project( + ${sbom_begin_args} + NO_AUTO_ADD_BUILD_TOOLS +) + +if(QT_GENERATE_SBOM) + foreach(build_tool_type IN LISTS default_build_tools_types) + _qt_internal_sbom_get_build_tool_target_for_type( + BUILD_TOOL_TYPE "${build_tool_type}" + OUT_VAR_TARGET target + ) + if(TARGET "${target}") + message(FATAL_ERROR + "Expected build tool target '${target}' for build tool type " + "'${build_tool_type}' exists, when it shouldn't.") + endif() + endforeach() +endif() +_qt_internal_sbom_end_project() + +# Case 3, check that we can create the pre-defined tool types manually +set(SBOM_PROJECT_NAME "003-manual-predefined-tools") +set_common_sbom_begin_args(sbom_begin_args) +_qt_internal_sbom_begin_project( + ${sbom_begin_args} + NO_AUTO_ADD_BUILD_TOOLS +) + +if(QT_GENERATE_SBOM) + foreach(build_tool_type IN LISTS default_build_tools_types) + _qt_internal_sbom_get_build_tool_target_for_type( + BUILD_TOOL_TYPE "${build_tool_type}" + OUT_VAR_TARGET target + ) + _qt_internal_add_sbom_build_tool("${target}" + BUILD_TOOL_TYPE "${build_tool_type}" + ) + if(NOT TARGET "${target}") + message(FATAL_ERROR + "Expected build tool target '${target}' for build tool type " + "'${build_tool_type}' does not exist.") + endif() + endforeach() +endif() +_qt_internal_sbom_end_project() + +# Case 4, add a custom build tool +set(SBOM_PROJECT_NAME "004-custom-tool") +set_common_sbom_begin_args(sbom_begin_args) +_qt_internal_sbom_begin_project( + ${sbom_begin_args} + NO_AUTO_ADD_BUILD_TOOLS +) + +set(build_tool_target "BuildToolHammer") +_qt_internal_sbom_get_current_project_target(project_target) +_qt_internal_add_sbom_build_tool("${build_tool_target}" + BUILD_TOOL_TYPE "CUSTOM" + SBOM_ARGS + FRIENDLY_PACKAGE_NAME "Hammer" + PACKAGE_VERSION "1.2.3" + PACKAGE_SUMMARY "Very shiny hammer" + LICENSE_EXPRESSION "MIT" + DOWNLOAD_LOCATION "https://veryshinyhammers.com/packages/hammer-1.2.3.tar.gz" + SUPPLIER "Handyman Central" + COPYRIGHTS "Handyman Central Copyright (C)" + SBOM_RELATIONSHIP_ENTRIES + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + "${build_tool_target}" + SBOM_RELATIONSHIP_TYPE + DEV_DEPENDENCY_OF + SBOM_RELATIONSHIP_TO + "${project_target}" + SBOM_RELATIONSHIP_COMMENT + "Project is hammered in using Hammer version 1.2.3" +) + +if(QT_GENERATE_SBOM) + if(NOT TARGET "${build_tool_target}") + message(FATAL_ERROR + "Expected build tool target '${build_tool_target}' does not exist.") + endif() +endif() + +# Case 4, add an extra relationship that a library is generated using the above tool +if(QT_GENERATE_SBOM) + _qt_internal_sbom_get_spdx_id_for_target(${build_tool_target} ${build_tool_target}_spdx_id) +endif() +create_sbom_lib_target(Plank) +_qt_internal_extend_sbom(Plank + SBOM_RELATIONSHIP_ENTRIES + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + "Plank" + SBOM_RELATIONSHIP_TYPE + GENERATED_FROM + SBOM_RELATIONSHIP_TO + "${build_tool_target}" +) +add_assert_str_exists_in_spdx_v2_3_doc("Relationship: ${Plank_spdx_id} GENERATED_FROM ${${build_tool_target}_spdx_id}") +add_cydx_v1_6_deps_to_result_file(Plank DEPS "${${build_tool_target}_spdx_id}") + +_qt_internal_sbom_end_project() + +include(CommonResultGen) diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/project_relationships-install-check.cmake b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/project_relationships-install-check.cmake new file mode 100644 index 0000000000..8cd5803a24 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/project_relationships-install-check.cmake @@ -0,0 +1,4 @@ +# Include generic check.cmake +include("${CMAKE_CURRENT_LIST_DIR}/check.cmake") + +check_cydx_v1_6_dependencies(TARGETS_CATEGORY "RELATIONSHIP") diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/project_relationships.cmake b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/project_relationships.cmake new file mode 100644 index 0000000000..c19f2e510e --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/project_relationships.cmake @@ -0,0 +1,87 @@ +# Needed to make the sbom functions available. +find_package(Qt6 REQUIRED Core) + +include(CommonResultGenIntro) + +_qt_internal_setup_sbom( + GENERATE_SBOM_DEFAULT "TRUE" +) + +# This is used by common_result_gen.cmake. +set(SBOM_VERSION "1.0.0") + +_qt_internal_sbom_begin_project( + SUPPLIER "QtProjectTest" + SUPPLIER_URL "https://qt-project.org/SbomTest" + VERSION "${SBOM_VERSION}" +) + +function(create_sbom_lib_target target) + add_library(${target} STATIC) + target_sources(${target} PRIVATE sources/utils_helper.cpp) + install(TARGETS ${target} + ARCHIVE DESTINATION lib + ) + _qt_internal_add_sbom(${target} + TYPE "LIBRARY" + RUNTIME_PATH bin + ARCHIVE_PATH lib + LIBRARY_PATH lib + ) + + # This is used the by spdx and cydx deps checking code. + _qt_internal_sbom_get_spdx_id_for_target(${target} ${target}_spdx_id) + set(${target}_spdx_id "${${target}_spdx_id}" PARENT_SCOPE) + + add_known_target(${target} + CATEGORY "RELATIONSHIP" + SPDX_ID "${${target}_spdx_id}" + ) + + bubble_up_extra_result_code() +endfunction() + +foreach(idx RANGE 1 2) + set(target "t${idx}") + create_sbom_lib_target(${target}) + _qt_internal_sbom_get_spdx_id_for_target(${target} ${target}_spdx_id) +endforeach() + +_qt_internal_sbom_get_current_project_spdx_id(project_spdx_id) +_qt_internal_sbom_get_current_project_target(project_target) + +# Case 1 +# Check that the new SBOM_RELATIONSHIP_ENTRIES works for project relationships. +_qt_internal_extend_sbom("${project_target}" + SBOM_RELATIONSHIP_ENTRIES + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + "t1" + SBOM_RELATIONSHIP_TYPE + DESCENDANT_OF + SBOM_RELATIONSHIP_TO + "${project_target}" +) +add_assert_str_exists_in_spdx_v2_3_doc("Relationship: ${t1_spdx_id} DESCENDANT_OF ${project_spdx_id}") +add_cydx_v1_6_deps_to_result_file(t1 DEPS "${project_spdx_id}") + +# Case 2 +# Check that multiple to relationships can be added. +_qt_internal_extend_sbom("${project_target}" + SBOM_RELATIONSHIP_ENTRIES + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + "t2" + SBOM_RELATIONSHIP_TYPE + BUILD_DEPENDENCY_OF # not really true, but good for testing + SBOM_RELATIONSHIP_TO + "t1" + "${project_target}" +) +add_assert_str_exists_in_spdx_v2_3_doc("Relationship: ${t2_spdx_id} BUILD_DEPENDENCY_OF ${t1_spdx_id}") +add_assert_str_exists_in_spdx_v2_3_doc("Relationship: ${t2_spdx_id} BUILD_DEPENDENCY_OF ${project_spdx_id}") +add_cydx_v1_6_deps_to_result_file(t2 DEPS ${project_spdx_id} ${t1_spdx_id}) + +_qt_internal_sbom_end_project() + +include(CommonResultGen) diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/spdx_suffixes.cmake b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/spdx_suffixes.cmake new file mode 100644 index 0000000000..7bcea13a81 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/spdx_suffixes.cmake @@ -0,0 +1,180 @@ +# Needed to make the sbom functions available. +find_package(Qt6 REQUIRED Core) + +include(CommonResultGenIntro) + +_qt_internal_setup_sbom( + GENERATE_SBOM_DEFAULT "TRUE" +) + +include(CMakePackageConfigHelpers) +function(create_sbom_lib_target target) + add_library(${target} STATIC) + target_sources(${target} PRIVATE sources/utils_helper.cpp) + install(TARGETS ${target} + EXPORT MainTargets + ARCHIVE DESTINATION lib + ) + _qt_internal_add_sbom(${target} + TYPE "LIBRARY" + RUNTIME_PATH bin + ARCHIVE_PATH lib + LIBRARY_PATH lib + ) + + # The installation bits are needed for the follow-up test which checks 'DocumentRef-' values. + if(INSTALL_EXPORT_TARGETS) + install(EXPORT MainTargets + NAMESPACE Main:: + DESTINATION lib/cmake/Main + ) + configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/MainConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/MainConfig.cmake" + INSTALL_DESTINATION lib/cmake/Main + ) + + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MainConfig.cmake + DESTINATION lib/cmake/Main ) + endif() + + # This is used the by spdx and cydx deps checking code. + _qt_internal_sbom_get_spdx_id_for_target(${target} ${target}_spdx_id) + set(${target}_spdx_id "${${target}_spdx_id}" PARENT_SCOPE) +endfunction() + +macro(set_common_sbom_begin_args out_var) + set(${out_var} + SBOM_PROJECT_NAME "${SBOM_PROJECT_NAME}" + SUPPLIER "${SBOM_SUPPLIER}" + SUPPLIER_URL "${SBOM_SUPPLIER_URL}" + VERSION "${SBOM_VERSION}" + ) +endmacro() + +macro(check_unique_suffix_in_spdx_id target unique_suffix) + if(QT_GENERATE_SBOM) + if(NOT "${${target}_spdx_id}" MATCHES "${unique_suffix}") + message(FATAL_ERROR + "Expected unique suffix '${unique_suffix}' to be part of the spdx id for target " + "'${target}', but got '${${target}_spdx_id}'") + endif() + endif() +endmacro() + +# Macro to check spdx id of target exactly ends with the given string +macro(check_spdx_id_for_target_ends_with target expected_ending) + if(QT_GENERATE_SBOM) + if(NOT "${${target}_spdx_id}" MATCHES "${expected_ending}$") + message(FATAL_ERROR + "Expected spdx id '${${target}_spdx_id}' for target '${target}' to end with " + "'${expected_ending}', but it did not.") + endif() + endif() +endmacro() + +# Some of these variables are used by CommonResultGen.cmake. +set(SBOM_PROJECT_NAME "001-auto-suffix") +set(SBOM_SUPPLIER "QtProjectTest") +set(SBOM_SUPPLIER_URL "https://qt-project.org/SbomTest") + +# Case 1, default auto added hash suffix +set(SBOM_VERSION "1.0.0") +set_common_sbom_begin_args(sbom_begin_args) +_qt_internal_sbom_begin_project( + ${sbom_begin_args} +) +_qt_internal_sbom_get_spdx_id_unique_suffix(unique_suffix) +create_sbom_lib_target(lib_001) +check_unique_suffix_in_spdx_id(lib_001 "${unique_suffix}") +_qt_internal_sbom_end_project() + +# Case 2, no auto spdx suffix +set(SBOM_PROJECT_NAME "002-no-suffix") +set_common_sbom_begin_args(sbom_begin_args) +_qt_internal_sbom_begin_project( + ${sbom_begin_args} + NO_AUTO_SPDX_ID_SUFFIX +) +_qt_internal_sbom_get_spdx_id_unique_suffix(unique_suffix) +if(QT_GENERATE_SBOM AND NOT "${unique_suffix}" STREQUAL "") + message(FATAL_ERROR + "Expected unique suffix to be empty when NO_AUTO_SPDX_ID_SUFFIX is used, but got " + "'${unique_suffix}'") +endif() +create_sbom_lib_target(lib_002) +check_spdx_id_for_target_ends_with(lib_002 "lib-002") +_qt_internal_sbom_end_project() + +# Case 3, custom spdx suffix +set(SBOM_PROJECT_NAME "003-custom-suffix") +set_common_sbom_begin_args(sbom_begin_args) +_qt_internal_sbom_begin_project( + ${sbom_begin_args} + SPDX_ID_SUFFIX "my-custom-suffix" +) +_qt_internal_sbom_get_spdx_id_unique_suffix(unique_suffix) +if(QT_GENERATE_SBOM AND NOT "${unique_suffix}" STREQUAL "-my-custom-suffix") + message(FATAL_ERROR + "Expected unique suffix to be '-my-custom-suffix', but got '${unique_suffix}'") +endif() +# Also install the target, to query its DocumentRef- id in a follow-up test. +set(INSTALL_EXPORT_TARGETS ON) +create_sbom_lib_target(lib_003) +check_unique_suffix_in_spdx_id(lib_003 "${unique_suffix}") +_qt_internal_sbom_end_project() +unset(INSTALL_EXPORT_TARGETS) + +# Case 4, global no auto add suffix +set(SBOM_PROJECT_NAME "004-global-no-auto-suffix") +set_common_sbom_begin_args(sbom_begin_args) +set(QT_SBOM_NO_AUTO_SPDX_SUFFIX ON) +_qt_internal_sbom_begin_project( + ${sbom_begin_args} +) +_qt_internal_sbom_get_spdx_id_unique_suffix(unique_suffix) +if(QT_GENERATE_SBOM AND NOT "${unique_suffix}" STREQUAL "") + message(FATAL_ERROR + "Expected unique suffix to be empty when QT_SBOM_NO_AUTO_SPDX_SUFFIX is set, but got " + "'${unique_suffix}'") +endif() +create_sbom_lib_target(lib_004) +check_spdx_id_for_target_ends_with(lib_004 "lib-004") +_qt_internal_sbom_end_project() +unset(QT_SBOM_NO_AUTO_SPDX_SUFFIX) + +# Case 5, fake deterministic id +set(SBOM_PROJECT_NAME "005-deterministic") +set_common_sbom_begin_args(sbom_begin_args) +set(QT_SBOM_FAKE_DETERMINISTIC_BUILD ON) +_qt_internal_sbom_begin_project( + ${sbom_begin_args} +) +_qt_internal_sbom_get_spdx_id_unique_suffix(unique_suffix) +if(QT_GENERATE_SBOM AND NOT "${unique_suffix}" STREQUAL "-fake-id-suffix") + message(FATAL_ERROR + "Expected unique suffix to be '-fake-id-suffix', but got '${unique_suffix}'") +endif() +create_sbom_lib_target(lib_005) +check_unique_suffix_in_spdx_id(lib_005 "${unique_suffix}") +_qt_internal_sbom_end_project() +unset(QT_SBOM_FAKE_DETERMINISTIC_BUILD) + +# Case 6, shorter hash length +set(SBOM_PROJECT_NAME "006-short-hash") +set_common_sbom_begin_args(sbom_begin_args) +_qt_internal_sbom_begin_project( + ${sbom_begin_args} + SPDX_ID_SUFFIX_HASH_LENGTH 4 +) +_qt_internal_sbom_get_spdx_id_unique_suffix(unique_suffix) +string(LENGTH "${unique_suffix}" unique_suffix_length) +if(QT_GENERATE_SBOM AND NOT unique_suffix_length EQUAL 5) + message(FATAL_ERROR + "Expected unique suffix length to be 5 (4 chars + the preceding dash) when " + "SPDX_ID_HASH_LENGTH is set to 4, but got " + "'${unique_suffix}' with length ${unique_suffix_length}") +endif() +_qt_internal_sbom_end_project() + +include(CommonResultGen) diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/spdx_suffixes_external.cmake b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/spdx_suffixes_external.cmake new file mode 100644 index 0000000000..4fcb093fb9 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/spdx_suffixes_external.cmake @@ -0,0 +1,85 @@ +# Needed to make the sbom functions available. +find_package(Qt6 REQUIRED Core) + +# Find the Main package and make its targets available. We will query +# the DocumentRef SPDX ids to check them. +find_package(Main REQUIRED) + +function(create_sbom_lib_target target) + add_library(${target} STATIC) + target_sources(${target} PRIVATE sources/utils_helper.cpp) + install(TARGETS ${target} + ARCHIVE DESTINATION lib + ) + _qt_internal_add_sbom(${target} + TYPE "LIBRARY" + RUNTIME_PATH bin + ARCHIVE_PATH lib + LIBRARY_PATH lib + ) + + # This is used the by spdx and cydx deps checking code. + _qt_internal_sbom_get_spdx_id_for_target(${target} ${target}_spdx_id) + set(${target}_spdx_id "${${target}_spdx_id}" PARENT_SCOPE) + + add_known_target(${target} + CATEGORY "RELATIONSHIP" + SPDX_ID "${${target}_spdx_id}" + ) + + bubble_up_extra_result_code() +endfunction() + +include(CommonResultGenIntro) + +_qt_internal_setup_sbom( + GENERATE_SBOM_DEFAULT "TRUE" +) + +# This is used by CommonResultGen.cmake. +set(SBOM_VERSION "1.0.0") +set(SBOM_PROJECT_NAME "ExtSpdxSuffixes") + +_qt_internal_sbom_begin_project( + SBOM_PROJECT_NAME "${SBOM_PROJECT_NAME}" + SUPPLIER "QtProjectTest" + SUPPLIER_URL "https://qt-project.org/SbomTest" + VERSION "${SBOM_VERSION}" +) + +# Case 1, check that the exported DocumentRef id is the one we expect +# The ref is defined in case 003 of the spdx_suffixes test. +_qt_internal_sbom_get_external_document_ref_spdx_id_from_sbom_target( + TARGET "Main::lib_003" + OUT_VAR target_external_doc_ref_id +) +set(expected_ref "DocumentRef-003-custom-suffix-my-custom-suffix") +if(QT_GENERATE_SBOM AND NOT "${target_external_doc_ref_id}" STREQUAL "${expected_ref}") + message(FATAL_ERROR + "Expected external document ref id for target 'Main::lib_003' to be '${expected_ref}', " + "but got '${target_external_doc_ref_id}'") +endif() + +# Case 2, check that if we set the document ref id to empty to simulate as if it was never +# exported, adding a relationship on such a target still works due to temporary auto-creation of +# a ref id. +set_target_properties(Main::lib_003 PROPERTIES + _qt_sbom_spdx_v2_external_document_ref "" + _qt_sbom_spdx_v2_external_spdx_id "" +) +_qt_internal_sbom_get_spdx_id_for_target(Main::lib_003 lib_003_spdx_id) + +create_sbom_lib_target(c1) +target_link_libraries(c1 PRIVATE Main::lib_003) + +# First end the project, so that the temporary external doc ref id is generated. +_qt_internal_sbom_end_project() + +# Now we can query the doc ref id to check it. +get_target_property(external_doc_ref_id Main::lib_003 _qt_sbom_spdx_v2_external_document_ref) +add_assert_str_exists_in_spdx_v2_3_doc( + "Relationship: ${c1_spdx_id} DEPENDS_ON ${external_doc_ref_id}:${lib_003_spdx_id}") +add_cydx_v1_6_deps_to_result_file(c1 DEPS "${lib_003_spdx_id}") + +include(CommonResultGen) + diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/target_relationships-install-check.cmake b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/target_relationships-install-check.cmake new file mode 100644 index 0000000000..8cd5803a24 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/target_relationships-install-check.cmake @@ -0,0 +1,4 @@ +# Include generic check.cmake +include("${CMAKE_CURRENT_LIST_DIR}/check.cmake") + +check_cydx_v1_6_dependencies(TARGETS_CATEGORY "RELATIONSHIP") diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/target_relationships.cmake b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/target_relationships.cmake new file mode 100644 index 0000000000..30fc8b968e --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/target_relationships.cmake @@ -0,0 +1,224 @@ +# Needed to make the sbom functions available. +find_package(Qt6 REQUIRED Core) + +include(CommonResultGenIntro) + +_qt_internal_setup_sbom( + GENERATE_SBOM_DEFAULT "TRUE" +) + +# This is used by common_result_gen.cmake. +set(SBOM_VERSION "1.0.0") +set(SBOM_PROJECT_NAME "TargetRels") + +_qt_internal_sbom_begin_project( + SBOM_PROJECT_NAME "${SBOM_PROJECT_NAME}" + SUPPLIER "QtProjectTest" + SUPPLIER_URL "https://qt-project.org/SbomTest" + VERSION "${SBOM_VERSION}" +) + +include(CMakePackageConfigHelpers) +function(create_sbom_lib_target target) + add_library(${target} STATIC) + target_sources(${target} PRIVATE sources/utils_helper.cpp) + install(TARGETS ${target} + EXPORT MainTargets + ARCHIVE DESTINATION lib + ) + _qt_internal_add_sbom(${target} + TYPE "LIBRARY" + RUNTIME_PATH bin + ARCHIVE_PATH lib + LIBRARY_PATH lib + ) + + # The installation bits are needed for the follow-up test which creates relationships on + # targets from external documents. + install(EXPORT MainTargets + NAMESPACE Main:: + DESTINATION lib/cmake/Main + ) + configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/MainConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/MainConfig.cmake" + INSTALL_DESTINATION lib/cmake/Main + ) + + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MainConfig.cmake + DESTINATION lib/cmake/Main ) + + # This is used the by spdx and cydx deps checking code. + _qt_internal_sbom_get_spdx_id_for_target(${target} ${target}_spdx_id) + set(${target}_spdx_id "${${target}_spdx_id}" PARENT_SCOPE) + + add_known_target(${target} + CATEGORY "RELATIONSHIP" + SPDX_ID "${${target}_spdx_id}" + ) + + bubble_up_extra_result_code() +endfunction() + +foreach(idx RANGE 1 10) + set(target "t${idx}") + create_sbom_lib_target(${target}) +endforeach() + +# Case 1 +# Check that the deprecated SPDX v2 specific SBOM_RELATIONSHIPS option still works. +# CYDX dep does not get added. +set(relationship "${t2_spdx_id} DEPENDS_ON ${t1_spdx_id}") +_qt_internal_extend_sbom(t2 SBOM_RELATIONSHIPS "${relationship}") +add_assert_str_exists_in_spdx_v2_3_doc("Relationship: ${t2_spdx_id} DEPENDS_ON ${t1_spdx_id}") +add_cydx_v1_6_deps_to_result_file(t2 DEPS "") + +# Case 2 +# Check that the new SBOM_RELATIONSHIP_ENTRIES works. +_qt_internal_extend_sbom(t3 + SBOM_RELATIONSHIP_ENTRIES + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + "t3" + SBOM_RELATIONSHIP_TYPE + DEPENDS_ON + SBOM_RELATIONSHIP_TO + "t2" + SBOM_RELATIONSHIP_COMMENT + "t3 depends on t2" +) +add_assert_str_exists_in_spdx_v2_3_doc("Relationship: ${t3_spdx_id} DEPENDS_ON ${t2_spdx_id}") +add_assert_str_exists_in_spdx_v2_3_doc("RelationshipComment: t3 depends on t2") +add_cydx_v1_6_deps_to_result_file(t3 DEPS "${t2_spdx_id}") + +# Case 3 +# Check that multiple to relationships can be added. +_qt_internal_extend_sbom(t4 + SBOM_RELATIONSHIP_ENTRIES + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + "t4" + SBOM_RELATIONSHIP_TYPE + DEPENDS_ON + SBOM_RELATIONSHIP_TO + "t1" + "t2" + "t3" +) +add_assert_str_exists_in_spdx_v2_3_doc("Relationship: ${t4_spdx_id} DEPENDS_ON ${t1_spdx_id}") +add_assert_str_exists_in_spdx_v2_3_doc("Relationship: ${t4_spdx_id} DEPENDS_ON ${t2_spdx_id}") +add_assert_str_exists_in_spdx_v2_3_doc("Relationship: ${t4_spdx_id} DEPENDS_ON ${t3_spdx_id}") +add_cydx_v1_6_deps_to_result_file(t4 DEPS ${t1_spdx_id} ${t2_spdx_id} ${t3_spdx_id}) + +# Case 4 +# Check that using both SBOM_RELATIONSHIP_ENTRIES and SBOM_RELATIONSHIPS works. +# The SBOM_RELATIONSHIPS value does not get added to CYDX. +set(relationship "${t5_spdx_id} DEPENDS_ON ${t1_spdx_id}") +_qt_internal_extend_sbom(t5 + SBOM_RELATIONSHIPS "${relationship}" + SBOM_RELATIONSHIP_ENTRIES + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + "t5" + SBOM_RELATIONSHIP_TYPE + DEPENDS_ON + SBOM_RELATIONSHIP_TO + "t2" +) +add_assert_str_exists_in_spdx_v2_3_doc("Relationship: ${t5_spdx_id} DEPENDS_ON ${t1_spdx_id}") +add_assert_str_exists_in_spdx_v2_3_doc("Relationship: ${t5_spdx_id} DEPENDS_ON ${t2_spdx_id}") +add_cydx_v1_6_deps_to_result_file(t5 DEPS ${t2_spdx_id}) + +# Case 5 +# Check that duplicate entries are removed. +_qt_internal_extend_sbom(t6 + SBOM_RELATIONSHIP_ENTRIES + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + "t6" + SBOM_RELATIONSHIP_TYPE + DEPENDS_ON + SBOM_RELATIONSHIP_TO + "t1" + "t1" + "t1" + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + "t6" + SBOM_RELATIONSHIP_TYPE + DEPENDS_ON + SBOM_RELATIONSHIP_TO + "t2" + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + "t6" + SBOM_RELATIONSHIP_TYPE + DEPENDS_ON + SBOM_RELATIONSHIP_TO + "t2" + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + "t6" + SBOM_RELATIONSHIP_TYPE + DEPENDS_ON + SBOM_RELATIONSHIP_TO + "t3" +) +add_assert_str_exists_in_spdx_v2_3_doc("Relationship: ${t6_spdx_id} DEPENDS_ON ${t1_spdx_id}") +add_assert_str_exists_in_spdx_v2_3_doc("Relationship: ${t6_spdx_id} DEPENDS_ON ${t2_spdx_id}") +add_assert_str_exists_in_spdx_v2_3_doc("Relationship: ${t6_spdx_id} DEPENDS_ON ${t3_spdx_id}") +add_cydx_v1_6_deps_to_result_file(t6 DEPS ${t1_spdx_id} ${t2_spdx_id} ${t3_spdx_id}) + +# Case 6 +# Check that we can add relationships for specific formats only. +_qt_internal_extend_sbom(t7 + SBOM_RELATIONSHIP_ENTRIES + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + "t7" + SBOM_RELATIONSHIP_TYPE + DEPENDS_ON + SBOM_RELATIONSHIP_TO + "t1" + SBOM_FORMATS SPDX_V2 +) +add_assert_str_exists_in_spdx_v2_3_doc("Relationship: ${t7_spdx_id} DEPENDS_ON ${t1_spdx_id}") + +_qt_internal_extend_sbom(t8 + SBOM_RELATIONSHIP_ENTRIES + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + "t8" + SBOM_RELATIONSHIP_TYPE + DEPENDS_ON + SBOM_RELATIONSHIP_TO + "t1" + SBOM_FORMATS CYDX_V1_6 +) +add_cydx_v1_6_deps_to_result_file(t8 DEPS ${t1_spdx_id}) + +_qt_internal_extend_sbom(t9 + SBOM_RELATIONSHIP_ENTRIES + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + "t9" + SBOM_RELATIONSHIP_TYPE + DEPENDS_ON + SBOM_RELATIONSHIP_TO + "t1" + SBOM_FORMATS SPDX_V2 CYDX_V1_6 +) +add_assert_str_exists_in_spdx_v2_3_doc("Relationship: ${t9_spdx_id} DEPENDS_ON ${t1_spdx_id}") +add_cydx_v1_6_deps_to_result_file(t9 DEPS ${t1_spdx_id}) + +# Case 7 check that manual setting of SBOM_DEPENDENCIES works +_qt_internal_extend_sbom(t10 + SBOM_DEPENDENCIES t8 t9 +) +add_assert_str_exists_in_spdx_v2_3_doc("Relationship: ${t10_spdx_id} DEPENDS_ON ${t8_spdx_id}") +add_assert_str_exists_in_spdx_v2_3_doc("Relationship: ${t10_spdx_id} DEPENDS_ON ${t9_spdx_id}") +add_cydx_v1_6_deps_to_result_file(t10 DEPS ${t8_spdx_id} ${t9_spdx_id}) + +_qt_internal_sbom_end_project() + +include(CommonResultGen) diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/target_relationships_external-install-check.cmake b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/target_relationships_external-install-check.cmake new file mode 100644 index 0000000000..8cd5803a24 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/target_relationships_external-install-check.cmake @@ -0,0 +1,4 @@ +# Include generic check.cmake +include("${CMAKE_CURRENT_LIST_DIR}/check.cmake") + +check_cydx_v1_6_dependencies(TARGETS_CATEGORY "RELATIONSHIP") diff --git a/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/target_relationships_external.cmake b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/target_relationships_external.cmake new file mode 100644 index 0000000000..f3faf93901 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/cmake/RunCMake/Sbom/target_relationships_external.cmake @@ -0,0 +1,324 @@ +# Needed to make the sbom functions available. +find_package(Qt6 REQUIRED Core) + +# Find the Main package and make its targets available. We will query +# their SPDX ids to manually create external SBOM targets and relationships on them. +find_package(Main REQUIRED) + +include(CommonResultGenIntro) + +_qt_internal_setup_sbom( + GENERATE_SBOM_DEFAULT "TRUE" +) + +# This is used by common_result_gen.cmake. +set(SBOM_VERSION "1.0.0") +set(SBOM_PROJECT_NAME "ExtTargetRels") + +_qt_internal_sbom_begin_project( + SBOM_PROJECT_NAME "${SBOM_PROJECT_NAME}" + SUPPLIER "QtProjectTest" + SUPPLIER_URL "https://qt-project.org/SbomTest" + VERSION "${SBOM_VERSION}" +) + +function(create_sbom_lib_target target) + add_library(${target} STATIC) + target_sources(${target} PRIVATE sources/utils_helper.cpp) + install(TARGETS ${target} + ARCHIVE DESTINATION lib + ) + _qt_internal_add_sbom(${target} + TYPE "LIBRARY" + RUNTIME_PATH bin + ARCHIVE_PATH lib + LIBRARY_PATH lib + ) + + # This is used the by spdx and cydx deps checking code. + _qt_internal_sbom_get_spdx_id_for_target(${target} ${target}_spdx_id) + set(${target}_spdx_id "${${target}_spdx_id}" PARENT_SCOPE) + + add_known_target(${target} + CATEGORY "RELATIONSHIP" + SPDX_ID "${${target}_spdx_id}" + ) + + bubble_up_extra_result_code() +endfunction() + +function(get_target_prop_or_error out_var target prop) + get_target_property(result "${target}" "${prop}") + if(NOT result) + message(FATAL_ERROR "Target '${target}' does not have property '${prop}'") + endif() + set(${out_var} "${result}" PARENT_SCOPE) +endfunction() + +# Query the external document id and other info from one of the Main package targets, so we can +# manually add external reference documents. +set(first_main_target "Main::t1") + +if(QT_GENERATE_SBOM) + get_target_prop_or_error(spdx_external_document_ref_id "${first_main_target}" + _qt_sbom_spdx_v2_external_document_ref) + + get_target_prop_or_error(spdx_document_namespace "${first_main_target}" + _qt_sbom_spdx_repo_document_namespace) + + get_target_prop_or_error(cydx_bom_serial_number "${first_main_target}" + _qt_sbom_cydx_bom_serial_number_uuid) + + get_target_prop_or_error(cydx_urn_bom_version "${first_main_target}" + _qt_sbom_cydx_external_urn_bom_version) + + get_target_prop_or_error(spdx_v2_tag_value_path "${first_main_target}" + _qt_sbom_spdx_v2_document_tag_value_relative_path) + + get_target_prop_or_error(spdx_v2_json_path "${first_main_target}" + _qt_sbom_spdx_v2_document_json_relative_path) + + get_target_prop_or_error(cydx_v1_6_json_path "${first_main_target}" + _qt_sbom_cydx_v1_6_document_json_relative_path) +endif() + +# Case 1 +# Manually add spdx and cydx format external documents to the same target. +_qt_internal_sbom_add_external_reference_document(ExtDoc1 + SBOM_FORMAT "SPDX_V2_TAG_VALUE" + SPDX_V2_DOCUMENT_REF_ID "${spdx_external_document_ref_id}" + EXTERNAL_DOCUMENT_FILE_PATH + "${spdx_v2_tag_value_path}" +) + +_qt_internal_sbom_add_external_reference_document(ExtDoc1 + SBOM_FORMAT "SPDX_V2_JSON" + SPDX_V2_DOCUMENT_REF_ID "${spdx_external_document_ref_id}" + EXTERNAL_DOCUMENT_FILE_PATH + "${spdx_v2_json_path}" +) + +_qt_internal_sbom_add_external_reference_document(ExtDoc1 + SBOM_FORMAT "CYDX_V1_JSON" + EXTERNAL_DOCUMENT_FILE_PATH + "${cydx_v1_6_json_path}" +) + +# Case 2 +# Manually add spdx and cydx format external documents to separate targets. +_qt_internal_sbom_add_external_reference_document(ExtDoc2Spdx + SBOM_FORMAT "SPDX_V2_TAG_VALUE" + SPDX_V2_DOCUMENT_REF_ID "${spdx_external_document_ref_id}-v2" + EXTERNAL_DOCUMENT_FILE_PATH + "${spdx_v2_tag_value_path}" +) + +_qt_internal_sbom_add_external_reference_document(ExtDoc3Cydx + SBOM_FORMAT "CYDX_V1_JSON" + EXTERNAL_DOCUMENT_FILE_PATH + "${cydx_v1_6_json_path}" +) + +# Case 3 +# Add the same docs, but instead of parsing the documents to extract the spdx namespace, sha1, +# and cydx serial numbers, specify them explicitly. +# For SPDX, we need to provide the SHA1, so we have to compute it first from the file path. +set(spdx_v2_sha1 "EMPTY_SHA") +if(QT_SBOM_GENERATE_SPDX_V2) + _qt_internal_sbom_get_external_reference_search_paths(document_search_paths) + _qt_internal_sbom_find_external_reference_document(spdx_v2_tag_value_absolute_path + EXTERNAL_DOCUMENT_FILE_PATH "${spdx_v2_tag_value_path}" + EXTERNAL_DOCUMENT_SEARCH_PATHS "${document_search_paths}" + ) + if(QT_GENERATE_SBOM) + file(SHA1 "${spdx_v2_tag_value_absolute_path}" spdx_v2_sha1) + endif() +endif() + +_qt_internal_sbom_add_external_reference_document(ExtDoc4 + SBOM_FORMAT "SPDX_V2_TAG_VALUE" + SPDX_V2_DOCUMENT_REF_ID "${spdx_external_document_ref_id}-v4" + SPDX_V2_DOCUMENT_NAMESPACE "${spdx_document_namespace}" + SPDX_V2_DOCUMENT_SHA1 "${spdx_v2_sha1}" +) + +_qt_internal_sbom_add_external_reference_document(ExtDoc4 + SBOM_FORMAT "CYDX_V1_JSON" + CYDX_URN_SERIAL_NUMBER "${cydx_bom_serial_number}" + CYDX_URN_BOM_VERSION "${cydx_urn_bom_version}" +) + +# Case 4 +# Add reference to a SPDX v2.3 JSON document. +# It should be able to parse out the namespace out of the document. +_qt_internal_sbom_add_external_reference_document(ExtDoc5 + SBOM_FORMAT "SPDX_V2_JSON" + SPDX_V2_DOCUMENT_REF_ID "${spdx_external_document_ref_id}-v5" + EXTERNAL_DOCUMENT_FILE_PATH + "${spdx_v2_json_path}" +) + +# Case 5 +# Query the various external document properties and confirm they have expected values. +# The main_target extracted values are just relative paths, but the values set by the function +# below will be either -NOTFOUND or relative or absolute paths. +_qt_internal_sbom_query_external_reference_document(ExtDoc1 + OUT_VAR_PROJECT_NAME_LOWERCASE extdoc1_project_name_lowercase + + OUT_VAR_RELATIVE_SPDX_V2_TAG_VALUE_DOCUMENT_PATH extdoc1_spdx_v2_tag_value_relative_path + OUT_VAR_RELATIVE_SPDX_V2_JSON_DOCUMENT_PATH extdoc1_spdx_v2_json_relative_path + OUT_VAR_RELATIVE_CYDX_V1_6_JSON_DOCUMENT_PATH extdoc1_cydx_v1_6_json_relative_path + + OUT_VAR_SPDX_V2_DOCUMENT_REF_ID extdoc1_spdx_v2_document_ref_id + OUT_VAR_SPDX_V2_DOCUMENT_NAMESPACE extdoc1_spdx_v2_document_namespace + + OUT_VAR_CYDX_URN_SERIAL_NUMBER extdoc1_cydx_urn_serial_number + OUT_VAR_CYDX_URN_BOM_VERSION extdoc1_cydx_urn_bom_version +) + +if(QT_GENERATE_SBOM AND QT_SBOM_GENERATE_SPDX_V2) + if(NOT extdoc1_spdx_v2_tag_value_relative_path + OR NOT extdoc1_spdx_v2_tag_value_relative_path MATCHES "${spdx_v2_tag_value_path}") + message(FATAL_ERROR "Expected relative path '${spdx_v2_tag_value_path}' but got " + "'${extdoc1_spdx_v2_tag_value_relative_path}'") + endif() + + if(NOT extdoc1_spdx_v2_json_relative_path + OR NOT extdoc1_spdx_v2_json_relative_path MATCHES "${spdx_v2_json_path}") + message(FATAL_ERROR "Expected relative path '${spdx_v2_json_path}' but got " + "'${extdoc1_spdx_v2_json_relative_path}'") + endif() + + if(NOT extdoc1_spdx_v2_document_ref_id + OR NOT extdoc1_spdx_v2_document_ref_id MATCHES "${spdx_external_document_ref_id}") + message(FATAL_ERROR + "Expected SPDX v2 document ref id '${spdx_external_document_ref_id}' but got " + "'${extdoc1_spdx_v2_document_ref_id}'") + endif() + + if(NOT extdoc1_spdx_v2_document_namespace + OR NOT extdoc1_spdx_v2_document_namespace MATCHES "${spdx_document_namespace}") + message(FATAL_ERROR + "Expected SPDX v2 document namespace '${spdx_document_namespace}' but got" + " '${extdoc1_spdx_v2_document_namespace}'") + endif() +endif() + +if(QT_GENERATE_SBOM AND QT_SBOM_GENERATE_CYDX_V1_6) + if(NOT extdoc1_cydx_v1_6_json_relative_path + OR NOT extdoc1_cydx_v1_6_json_relative_path MATCHES "${cydx_v1_6_json_path}") + message(FATAL_ERROR "Expected relative path '${cydx_v1_6_json_path}' but got " + "'${extdoc1_cydx_v1_6_json_relative_path}'") + endif() + + if(NOT extdoc1_cydx_urn_serial_number + OR NOT extdoc1_cydx_urn_serial_number MATCHES "${cydx_bom_serial_number}") + message(FATAL_ERROR "Expected CYDX urn serial number '${cydx_bom_serial_number}' but got " + "'${extdoc1_cydx_urn_serial_number}'") + endif() + + if(NOT extdoc1_cydx_urn_bom_version + OR NOT extdoc1_cydx_urn_bom_version MATCHES "${cydx_urn_bom_version}") + message(FATAL_ERROR "Expected CYDX urn bom version '${cydx_urn_bom_version}' but got " + "'${extdoc1_cydx_urn_bom_version}'") + endif() +endif() + +# External sbom targets test cases. + +foreach(idx RANGE 1 3) + # c for consumer + set(target "c${idx}") + create_sbom_lib_target(${target}) +endforeach() + +foreach(idx RANGE 1 3) + set(main_target "Main::t${idx}") + # mt for main target + set(main_prefix "mt${idx}") + _qt_internal_sbom_get_spdx_id_for_target(${main_target} ${main_prefix}_spdx_id) +endforeach() + +# Case 1 +# Create an target representing an external SBOM package / component. +# An external SBOM target is always associated with an external reference document. +# We extract and use the spdx id from Main's exported targets, basically recreating them manually +# as external. +_qt_internal_add_sbom(t1_ext + SPDX_ID "${mt1_spdx_id}" + IS_EXTERNAL_SBOM_ENTITY + EXTERNAL_SBOM_DOCUMENT_TARGET ExtDoc1 + SBOM_ENTITY_TYPE LIBRARY +) + +# Case 2 +# Add a relationship on the external target. This adds a relationship for both spdx and cydx +# formats, because the external document target has info for both. +_qt_internal_extend_sbom(c1 + SBOM_RELATIONSHIP_ENTRIES + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + c1 + SBOM_RELATIONSHIP_TYPE + DEPENDS_ON + SBOM_RELATIONSHIP_TO + t1_ext + SBOM_RELATIONSHIP_COMMENT + "c1 depends on t1_ext" +) +add_assert_str_exists_in_spdx_v2_3_doc( + "Relationship: ${c1_spdx_id} DEPENDS_ON ${extdoc1_spdx_v2_document_ref_id}:${mt1_spdx_id}") +add_cydx_v1_6_deps_to_result_file(c1 DEPS "${mt1_spdx_id}") + +# Case 3 +# Add relationship to an external target that is only defined in one format. +_qt_internal_add_sbom(t2_ext + SPDX_ID "${mt2_spdx_id}" + IS_EXTERNAL_SBOM_ENTITY + EXTERNAL_SBOM_DOCUMENT_TARGET ExtDoc2Spdx + SBOM_ENTITY_TYPE LIBRARY +) +_qt_internal_add_sbom(t3_ext + SPDX_ID "${mt3_spdx_id}" + IS_EXTERNAL_SBOM_ENTITY + EXTERNAL_SBOM_DOCUMENT_TARGET ExtDoc3Cydx + SBOM_ENTITY_TYPE LIBRARY +) + +_qt_internal_extend_sbom(c2 + SBOM_RELATIONSHIP_ENTRIES + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + c2 + SBOM_RELATIONSHIP_TYPE + DEPENDS_ON + SBOM_RELATIONSHIP_TO + t2_ext + SBOM_RELATIONSHIP_COMMENT + "c2 depends on t2_ext" + SBOM_FORMATS SPDX_V2 +) +_qt_internal_sbom_query_external_reference_document(ExtDoc2Spdx + OUT_VAR_SPDX_V2_DOCUMENT_REF_ID extdoc2_spdx_v2_document_ref_id +) +add_assert_str_exists_in_spdx_v2_3_doc( + "Relationship: ${c2_spdx_id} DEPENDS_ON ${extdoc2_spdx_v2_document_ref_id}:${mt2_spdx_id}") + +_qt_internal_extend_sbom(c3 + SBOM_RELATIONSHIP_ENTRIES + SBOM_RELATIONSHIP_ENTRY + SBOM_RELATIONSHIP_FROM + c3 + SBOM_RELATIONSHIP_TYPE + DEPENDS_ON + SBOM_RELATIONSHIP_TO + t3_ext + SBOM_RELATIONSHIP_COMMENT + "c3 depends on t3_ext" + SBOM_FORMATS CYDX_V1_6 +) +add_cydx_v1_6_deps_to_result_file(c3 DEPS "${mt3_spdx_id}") + +_qt_internal_sbom_end_project() + +include(CommonResultGen) diff --git a/local/recipes/qt/qtbase/source/tests/auto/corelib/global/qglobal/warnings.cpp b/local/recipes/qt/qtbase/source/tests/auto/corelib/global/qglobal/warnings.cpp new file mode 100644 index 0000000000..107f5c5450 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/corelib/global/qglobal/warnings.cpp @@ -0,0 +1,28 @@ +// Copyright (C) 2025 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include + +namespace DisableDeprecatedMacro { +class Object : public QObject +{ + Q_OBJECT +public: + using QObject::QObject; + enum E { A, B, C, D }; + enum F { None = 0x0, One = 0x1, Two = 0x2, Three = 0x4 }; + Q_DECLARE_FLAGS(Flags, F) + QT_WARNING_PUSH + QT_WARNING_DISABLE_DEPRECATED + Q_ENUMS(E) + Q_FLAGS(Flags) + QT_WARNING_POP +}; +} // namespace DisableDeprecatedMacro + +extern void warnings_linker_hook() +{ + [[maybe_unused]] DisableDeprecatedMacro::Object o; +} + +#include "warnings.moc" diff --git a/local/recipes/qt/qtbase/source/tests/auto/corelib/kernel/qapplicationstatic_static_qcoreapplication/CMakeLists.txt b/local/recipes/qt/qtbase/source/tests/auto/corelib/kernel/qapplicationstatic_static_qcoreapplication/CMakeLists.txt new file mode 100644 index 0000000000..36b4782b61 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/corelib/kernel/qapplicationstatic_static_qcoreapplication/CMakeLists.txt @@ -0,0 +1,16 @@ +# Copyright (C) 2025 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qapplicationstatic_static_qcoreapplication LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + +get_target_property(target_type Qt6::Core TYPE) +if (NOT WIN32 OR NOT target_type STREQUAL STATIC_LIBRARY) + qt_internal_add_test(tst_qapplicationstatic_static_qcoreapplication + SOURCES + tst_qapplicationstatic_static_qcoreapplication.cpp + ) +endif() diff --git a/local/recipes/qt/qtbase/source/tests/auto/corelib/kernel/qapplicationstatic_static_qcoreapplication/tst_qapplicationstatic_static_qcoreapplication.cpp b/local/recipes/qt/qtbase/source/tests/auto/corelib/kernel/qapplicationstatic_static_qcoreapplication/tst_qapplicationstatic_static_qcoreapplication.cpp new file mode 100644 index 0000000000..970ad3d898 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/corelib/kernel/qapplicationstatic_static_qcoreapplication/tst_qapplicationstatic_static_qcoreapplication.cpp @@ -0,0 +1,41 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include +#include "QtCore/qapplicationstatic.h" + +// In a 'realistic' scenario this QCoreApplication would be in a separate +// TU. But for this test it suffices to just force it to be initialized before +// the application static object +static int argc = 1; +static char arg1[] = "./tst_qapplicationstatic_static_qcoreapplication"; +static char *argv[] = { arg1, nullptr }; +// Note: the order of these two statics matters because it defines the order of +// initialization within this TU! +static QCoreApplication app(argc, argv); +Q_APPLICATION_STATIC(QObject, tstObject) + +class tst_qapplicationstatic_static_qcoreapplication : public QObject +{ + Q_OBJECT + +private slots: + void initialize() const; +}; + +void tst_qapplicationstatic_static_qcoreapplication::initialize() const +{ + tstObject(); // Just initialize the object + // What we are interested in testing is destruction! + // Prior to fixing QTBUG-140413 this scenario would result in a crash on + // exit. + // What happened is that, because of the static-deinitialization order, + // we would invoke the dtor of the APPLICATION_STATIC, which deletes the + // contained object. Next in order is the QCoreApplication, which emits the + // destroyed() signal, to which APPLICATION_STATIC is connected. + // It then attempted to destroy the contained object again, leading to a + // double-free / "heap-use-after-delete". +} + +QTEST_APPLESS_MAIN(tst_qapplicationstatic_static_qcoreapplication) +#include "tst_qapplicationstatic_static_qcoreapplication.moc" diff --git a/local/recipes/qt/qtbase/source/tests/auto/corelib/thread/qthreadstorage/warnonexit.cpp b/local/recipes/qt/qtbase/source/tests/auto/corelib/thread/qthreadstorage/warnonexit.cpp new file mode 100644 index 0000000000..473c63be06 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/corelib/thread/qthreadstorage/warnonexit.cpp @@ -0,0 +1,30 @@ +// Copyright (C) 2026 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include +#include +#include + +struct S +{ + ~S() {} + int i = 0; +}; + +Q_GLOBAL_STATIC(QThreadStorage, object1) +Q_GLOBAL_STATIC(QThreadStorage, object2) + +int main(int argc, char **argv) +{ + // IMPORTANT: do not create any QObjects prior to QCoreApplication + qputenv("QT_FORCE_STDERR_LOGGING", "1"); + qputenv("QT_FATAL_WARNINGS", "1"); + + // one object before and one after QCoreApplication + object1->localData().i = 1; + QCoreApplication app(argc, argv); + object2->localData().i = 2; + + // exit without destroying the QCoreApplication + exit(0); +} diff --git a/local/recipes/qt/qtbase/source/tests/auto/gui/kernel/qbackingstore/BLACKLIST b/local/recipes/qt/qtbase/source/tests/auto/gui/kernel/qbackingstore/BLACKLIST new file mode 100644 index 0000000000..3c8f155857 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/gui/kernel/qbackingstore/BLACKLIST @@ -0,0 +1,2 @@ +[flush] +wayland diff --git a/local/recipes/qt/qtbase/source/tests/auto/gui/rhi/qrhi/data/fullscreenquad.vert b/local/recipes/qt/qtbase/source/tests/auto/gui/rhi/qrhi/data/fullscreenquad.vert new file mode 100644 index 0000000000..359896d080 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/gui/rhi/qrhi/data/fullscreenquad.vert @@ -0,0 +1,10 @@ +#version 440 + +layout (location = 0) out vec2 v_uv; + +void main() +{ + // https://www.saschawillems.de/blog/2016/08/13/vulkan-tutorial-on-rendering-a-fullscreen-quad-without-buffers/ + v_uv = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2); + gl_Position = vec4(v_uv * 2.0 - 1.0, 0.0, 1.0); +} diff --git a/local/recipes/qt/qtbase/source/tests/auto/gui/rhi/qrhi/data/fullscreenquad.vert.qsb b/local/recipes/qt/qtbase/source/tests/auto/gui/rhi/qrhi/data/fullscreenquad.vert.qsb new file mode 100644 index 0000000000..7388db8876 Binary files /dev/null and b/local/recipes/qt/qtbase/source/tests/auto/gui/rhi/qrhi/data/fullscreenquad.vert.qsb differ diff --git a/local/recipes/qt/qtbase/source/tests/auto/gui/rhi/qrhi/data/fullscreenquad_color.frag b/local/recipes/qt/qtbase/source/tests/auto/gui/rhi/qrhi/data/fullscreenquad_color.frag new file mode 100644 index 0000000000..d0a48ea5f6 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/gui/rhi/qrhi/data/fullscreenquad_color.frag @@ -0,0 +1,14 @@ +#version 440 + +layout(location = 0) in vec2 v_uv; +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf +{ + vec4 color; +}; + +void main() +{ + fragColor = color; +} diff --git a/local/recipes/qt/qtbase/source/tests/auto/gui/rhi/qrhi/data/fullscreenquad_color.frag.qsb b/local/recipes/qt/qtbase/source/tests/auto/gui/rhi/qrhi/data/fullscreenquad_color.frag.qsb new file mode 100644 index 0000000000..8ec905097b Binary files /dev/null and b/local/recipes/qt/qtbase/source/tests/auto/gui/rhi/qrhi/data/fullscreenquad_color.frag.qsb differ diff --git a/local/recipes/qt/qtbase/source/tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST b/local/recipes/qt/qtbase/source/tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST new file mode 100644 index 0000000000..417802d926 --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST @@ -0,0 +1,2 @@ +[isActive] +wayland diff --git a/local/recipes/qt/qtbase/source/tests/auto/widgets/itemviews/qlistview/BLACKLIST b/local/recipes/qt/qtbase/source/tests/auto/widgets/itemviews/qlistview/BLACKLIST new file mode 100644 index 0000000000..90e4d3b06d --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/widgets/itemviews/qlistview/BLACKLIST @@ -0,0 +1,2 @@ +[styleOptionViewItem] +wayland diff --git a/local/recipes/qt/qtbase/source/tests/auto/widgets/widgets/qlabel/BLACKLIST b/local/recipes/qt/qtbase/source/tests/auto/widgets/widgets/qlabel/BLACKLIST new file mode 100644 index 0000000000..274da0140a --- /dev/null +++ b/local/recipes/qt/qtbase/source/tests/auto/widgets/widgets/qlabel/BLACKLIST @@ -0,0 +1,4 @@ +# QTQAINFRA-7765 & QTQAINFRA-7765 +[linkHoverLeave] +darwin +android diff --git a/local/recipes/qt/qtshadertools/source.tar b/local/recipes/qt/qtshadertools/source.tar new file mode 100644 index 0000000000..811bf3bd26 Binary files /dev/null and b/local/recipes/qt/qtshadertools/source.tar differ diff --git a/local/recipes/qt/qtshadertools/source/.cmake.conf b/local/recipes/qt/qtshadertools/source/.cmake.conf new file mode 100644 index 0000000000..b6be1cf82d --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/.cmake.conf @@ -0,0 +1,10 @@ +set(QT_REPO_MODULE_VERSION "6.11.1") +set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1") + +list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES + "QT_ENABLE_STRICT_MODE_UP_TO=QT_VERSION_CHECK(6,11,0)" + # not yet in strict mode: + "QT_LEAN_HEADERS=2" + "QT_NO_SINGLE_ARGUMENT_QHASH_OVERLOAD=1" + "QT_NO_QPAIR=1" +) diff --git a/local/recipes/qt/qtshadertools/source/.gitreview b/local/recipes/qt/qtshadertools/source/.gitreview new file mode 100644 index 0000000000..b4d1841418 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=codereview.qt-project.org +project=qt/qtshadertools +defaultbranch=dev diff --git a/local/recipes/qt/qtshadertools/source/.tag b/local/recipes/qt/qtshadertools/source/.tag new file mode 100644 index 0000000000..b74c7fb11d --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/.tag @@ -0,0 +1 @@ +b3b8537b3c5ab01919e30b87d48d2f1ba1f2a3fe diff --git a/local/recipes/qt/qtshadertools/source/CMakeLists.txt b/local/recipes/qt/qtshadertools/source/CMakeLists.txt new file mode 100644 index 0000000000..e82e535c61 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/CMakeLists.txt @@ -0,0 +1,38 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# Generated from qtshadertools.pro. + +cmake_minimum_required(VERSION 3.16) + +include(.cmake.conf) +project(QtShaderTools + VERSION "${QT_REPO_MODULE_VERSION}" + DESCRIPTION "Qt ShaderTools Libraries" + HOMEPAGE_URL "https://qt.io/" + LANGUAGES CXX C +) +find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals) # special case + +qt_internal_project_setup() + +find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED Core) +find_package(Qt6 ${PROJECT_VERSION} QUIET CONFIG OPTIONAL_COMPONENTS Gui) + +if(INTEGRITY) +add_compile_definitions(__inline=inline) +endif() + +if(NOT TARGET Qt::Gui) + message(NOTICE "Skipping the build as the condition \"TARGET Qt::Gui\" is not met.") + return() +endif() +if(WATCHOS) + message(NOTICE "Skipping the build as the condition \"NOT WATCHOS\" is not met.") + return() +endif() + +# Ensure macros are available when configuring tests in-tree with the Qt build +include(tools/qsb/Qt6ShaderToolsMacros.cmake) + +qt_build_repo() diff --git a/local/recipes/qt/qtshadertools/source/LICENSES/AML-glslang.txt b/local/recipes/qt/qtshadertools/source/LICENSES/AML-glslang.txt new file mode 100644 index 0000000000..49ee4d9166 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/LICENSES/AML-glslang.txt @@ -0,0 +1,24 @@ +Copyright (c) 2002, NVIDIA Corporation. + +NVIDIA Corporation("NVIDIA") supplies this software to you in consideration of your agreement to the following terms, and your use, +installation, modification or redistribution of this NVIDIA software constitutes acceptance of these terms. If you do not agree with +these terms, please do not use, install, modify or redistribute this NVIDIA software. + +In consideration of your agreement to abide by the following terms, and subject to these terms, NVIDIA grants you a personal, +non-exclusive license, under NVIDIA's copyrights in this original NVIDIA software (the " NVIDIA Software"), to use, reproduce, +modify and redistribute the NVIDIA Software, with or without modifications, in source and/or binary forms; provided that if you +redistribute the NVIDIA Software, you must retain the copyright notice of NVIDIA, this notice and the following text and disclaimers +in all such redistributions of the NVIDIA Software. Neither the name, trademarks, service marks nor logos of NVIDIA Corporation may +be used to endorse or promote products derived from the NVIDIA Software without specific prior written permission from NVIDIA. +Except as expressly stated in this notice, no other rights or licenses express or implied, are granted by NVIDIA herein, including +but not limited to any patent rights that may be infringed by your derivative works or by other works in which the NVIDIA Software +may be incorporated. No hardware is licensed hereunder. + +THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, +INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, +OR ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER PRODUCTS. + +IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN +ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY +OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/local/recipes/qt/qtshadertools/source/LICENSES/Apache-2.0.txt b/local/recipes/qt/qtshadertools/source/LICENSES/Apache-2.0.txt new file mode 100644 index 0000000000..137069b823 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/LICENSES/Apache-2.0.txt @@ -0,0 +1,73 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/local/recipes/qt/qtshadertools/source/LICENSES/BSD-3-Clause.txt b/local/recipes/qt/qtshadertools/source/LICENSES/BSD-3-Clause.txt new file mode 100644 index 0000000000..b91bbd8946 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/LICENSES/BSD-3-Clause.txt @@ -0,0 +1,9 @@ +Copyright (c) . + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/local/recipes/qt/qtshadertools/source/LICENSES/Bison-exception-2.2.txt b/local/recipes/qt/qtshadertools/source/LICENSES/Bison-exception-2.2.txt new file mode 100644 index 0000000000..992f83f5df --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/LICENSES/Bison-exception-2.2.txt @@ -0,0 +1,12 @@ +Bison Exception + +As a special exception, you may create a larger work that contains part or all +of the Bison parser skeleton and distribute that work under terms of your +choice, so long as that work isn't itself a parser generator using the +skeleton or a modified version thereof as a parser skeleton. Alternatively, +if you modify or redistribute the parser skeleton itself, you may (at your +option) remove this special exception, which will cause the skeleton and the +resulting Bison output files to be licensed under the GNU General Public +License without this special exception. + +This special exception was added by the Free Software Foundation in version 2.2 of Bison. diff --git a/local/recipes/qt/qtshadertools/source/LICENSES/GFDL-1.3-no-invariants-only.txt b/local/recipes/qt/qtshadertools/source/LICENSES/GFDL-1.3-no-invariants-only.txt new file mode 100644 index 0000000000..857214dd84 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/LICENSES/GFDL-1.3-no-invariants-only.txt @@ -0,0 +1,451 @@ + + GNU Free Documentation License + Version 1.3, 3 November 2008 + + + Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +0. PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +functional and useful document "free" in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of "copyleft", which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + + +1. APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The "Document", below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as "you". You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A "Modified Version" of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A "Secondary Section" is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The "Invariant Sections" are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The "Cover Texts" are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A "Transparent" copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not "Transparent" is called "Opaque". + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML, PostScript or PDF designed for human modification. Examples of +transparent image formats include PNG, XCF and JPG. Opaque formats +include proprietary formats that can be read and edited only by +proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML, PostScript or PDF produced by some word +processors for output purposes only. + +The "Title Page" means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, "Title Page" means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +The "publisher" means any person or entity that distributes copies of +the Document to the public. + +A section "Entitled XYZ" means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as "Acknowledgements", +"Dedications", "Endorsements", or "History".) To "Preserve the Title" +of such a section when you modify the Document means that it remains a +section "Entitled XYZ" according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + +2. VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no +other conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + + +3. COPYING IN QUANTITY + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to +give them a chance to provide you with an updated version of the +Document. + + +4. MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission. +B. List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has fewer than five), + unless they release you from this requirement. +C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. +D. Preserve all the copyright notices of the Document. +E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. +F. Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below. +G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice. +H. Include an unaltered copy of this License. +I. Preserve the section Entitled "History", Preserve its Title, and add + to it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section Entitled "History" in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. +J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions + it was based on. These may be placed in the "History" section. + You may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission. +K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section all + the substance and tone of each of the contributor acknowledgements + and/or dedications given therein. +L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. +M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. +N. Do not retitle any existing section to be Entitled "Endorsements" + or to conflict in title with any Invariant Section. +O. Preserve any Warranty Disclaimers. + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled "Endorsements", provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + + +5. COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled "History" +in the various original documents, forming one section Entitled +"History"; likewise combine any sections Entitled "Acknowledgements", +and any sections Entitled "Dedications". You must delete all sections +Entitled "Endorsements". + + +6. COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other +documents released under this License, and replace the individual +copies of this License in the various documents with a single copy +that is included in the collection, provided that you follow the rules +of this License for verbatim copying of each of the documents in all +other respects. + +You may extract a single document from such a collection, and +distribute it individually under this License, provided you insert a +copy of this License into the extracted document, and follow this +License in all other respects regarding verbatim copying of that +document. + + +7. AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an "aggregate" if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. + + +8. TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +If a section in the Document is Entitled "Acknowledgements", +"Dedications", or "History", the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. + + +9. TERMINATION + +You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. + + +10. FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions of the +GNU Free Documentation License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in +detail to address new problems or concerns. See +https://www.gnu.org/licenses/. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. + +11. RELICENSING + +"Massive Multiauthor Collaboration Site" (or "MMC Site") means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +"Massive Multiauthor Collaboration" (or "MMC") contained in the site +means any set of copyrightable works thus published on the MMC site. + +"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. + +"Incorporate" means to publish or republish a Document, in whole or in +part, as part of another Document. + +An MMC is "eligible for relicensing" if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole or +in part into the MMC, (1) had no cover texts or invariant sections, and +(2) were thus incorporated prior to November 1, 2008. + +The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. + + +ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + + Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled "GNU + Free Documentation License". + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. diff --git a/local/recipes/qt/qtshadertools/source/LICENSES/GPL-2.0-only.txt b/local/recipes/qt/qtshadertools/source/LICENSES/GPL-2.0-only.txt new file mode 100644 index 0000000000..d159169d10 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/LICENSES/GPL-2.0-only.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/local/recipes/qt/qtshadertools/source/LICENSES/GPL-3.0-only.txt b/local/recipes/qt/qtshadertools/source/LICENSES/GPL-3.0-only.txt new file mode 100644 index 0000000000..94a9ed024d --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/LICENSES/GPL-3.0-only.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/local/recipes/qt/qtshadertools/source/LICENSES/GPL-3.0-or-later.txt b/local/recipes/qt/qtshadertools/source/LICENSES/GPL-3.0-or-later.txt new file mode 100644 index 0000000000..e755a483e0 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/LICENSES/GPL-3.0-or-later.txt @@ -0,0 +1,170 @@ +GNU GENERAL PUBLIC LICENSE +Version 3, 29 June 2007 + +Copyright © 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The GNU General Public License is a free, copyleft license for software and other kinds of works. + +The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. + +Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. + +Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based on the Program. + + To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. + 1. Source Code. + The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. + + A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. + + The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. + + The Corresponding Source for a work in source code form is that same work. + 2. Basic Permissions. + All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. + + When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. + 4. Conveying Verbatim Copies. + You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. + 5. Conveying Modified Source Versions. + You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: + a) The work must carry prominent notices stating that you modified it, and giving a relevant date. + b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". + c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. + d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. + + A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. + 6. Conveying Non-Source Forms. + You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: + a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. + b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. + c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. + d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. + e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. + + If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). + + The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. + 7. Additional Terms. + "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: + a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or + b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or + c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or + d) Limiting the use for publicity purposes of names of licensors or authors of the material; or + e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or + f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. + + All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. + 8. Termination. + You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). + + However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. + + Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. + 9. Acceptance Not Required for Having Copies. + You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. + 10. Automatic Licensing of Downstream Recipients. + Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. + 11. Patents. + A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. + + If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. + + A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. + 12. No Surrender of Others' Freedom. + If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. + 13. Use with the GNU Affero General Public License. + Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. + 14. Revised Versions of this License. + The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. + + Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. + 15. Disclaimer of Warranty. + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + 16. Limitation of Liability. + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. diff --git a/local/recipes/qt/qtshadertools/source/LICENSES/LGPL-3.0-only.txt b/local/recipes/qt/qtshadertools/source/LICENSES/LGPL-3.0-only.txt new file mode 100644 index 0000000000..65c5ca88a6 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/LICENSES/LGPL-3.0-only.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/local/recipes/qt/qtshadertools/source/LICENSES/LicenseRef-MIT-Khronos-old.txt b/local/recipes/qt/qtshadertools/source/LICENSES/LicenseRef-MIT-Khronos-old.txt new file mode 100644 index 0000000000..430863bc98 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/LICENSES/LicenseRef-MIT-Khronos-old.txt @@ -0,0 +1,23 @@ +Copyright (c) 2014-2020 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and/or associated documentation files (the "Materials"), +to deal in the Materials without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Materials, and to permit persons to whom the +Materials are furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Materials. + +MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ + +THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +IN THE MATERIALS. diff --git a/local/recipes/qt/qtshadertools/source/LICENSES/LicenseRef-Qt-Commercial.txt b/local/recipes/qt/qtshadertools/source/LICENSES/LicenseRef-Qt-Commercial.txt new file mode 100644 index 0000000000..825b1f358b --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/LICENSES/LicenseRef-Qt-Commercial.txt @@ -0,0 +1,8 @@ +Licensees holding valid commercial Qt licenses may use this software in +accordance with the the terms contained in a written agreement between +you and The Qt Company. Alternatively, the terms and conditions that were +accepted by the licensee when buying and/or downloading the +software do apply. + +For the latest licensing terms and conditions, see https://www.qt.io/terms-conditions. +For further information use the contact form at https://www.qt.io/contact-us. diff --git a/local/recipes/qt/qtshadertools/source/LICENSES/MIT.txt b/local/recipes/qt/qtshadertools/source/LICENSES/MIT.txt new file mode 100644 index 0000000000..bc65af3cbd --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/LICENSES/MIT.txt @@ -0,0 +1,11 @@ + + +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/local/recipes/qt/qtshadertools/source/LICENSES/Qt-GPL-exception-1.0.txt b/local/recipes/qt/qtshadertools/source/LICENSES/Qt-GPL-exception-1.0.txt new file mode 100644 index 0000000000..d0322bf0e4 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/LICENSES/Qt-GPL-exception-1.0.txt @@ -0,0 +1,22 @@ +The Qt Company GPL Exception 1.0 + +Exception 1: + +As a special exception you may create a larger work which contains the +output of this application and distribute that work under terms of your +choice, so long as the work is not otherwise derived from or based on +this application and so long as the work does not in itself generate +output that contains the output from this application in its original +or modified form. + +Exception 2: + +As a special exception, you have permission to combine this application +with Plugins licensed under the terms of your choice, to produce an +executable, and to copy and distribute the resulting executable under +the terms of your choice. However, the executable must be accompanied +by a prominent notice offering all users of the executable the entire +source code to this application, excluding the source code of the +independent modules, but including any changes you have made to this +application, under the terms of this license. + diff --git a/local/recipes/qt/qtshadertools/source/REUSE.toml b/local/recipes/qt/qtshadertools/source/REUSE.toml new file mode 100644 index 0000000000..e2a8f51108 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/REUSE.toml @@ -0,0 +1,58 @@ +version = 1 + +[[annotations]] +path = ["tests/**.frag", "tests/**.vert", "tests/**.comp", "tests/**.tesc", + "tests/**.glsl", "tests/**.tese", "tests/**.geom", "tests/**.hlsl", + "**.inc", "**.spv"] +precedence = "closest" +SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd." +SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GPL-3.0-only" + +[[annotations]] +path = ["**.bat"] +precedence = "closest" +comment = "tools" +SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd." +SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0" + +[[annotations]] +path = ["**.in", "**.pro", "**CMakeLists.txt", ".cmake.conf", "**.yaml", + "**ci_config_linux.json", ".tag"] +precedence = "closest" +comment = "build system" +SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd." +SPDX-License-Identifier = "BSD-3-Clause" + +[[annotations]] +path = ["**/.gitattributes", "**.gitignore", "**/.gitreview"] +precedence = "closest" +comment = "infrastructure" +SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd." +SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause" + +[[annotations]] +path = ["**/doc/snippets/**"] +comment = "this must be after the build system table because example and snippets take precedence over build system" +precedence = "closest" +SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd." +SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause" + +[[annotations]] +path = ["**/doc/images/**", "**.qdocconf", "**.patch"] +comment = "documentation" +precedence = "closest" +SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd." +SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only" + +[[annotations]] +path = ["**.toml", "licenseRule.json"] +precedence = "override" +SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd." +SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause" + +[[annotations]] +path = ["**/qt_attribution.json"] +precedence = "override" +SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd." +SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only" + diff --git a/local/recipes/qt/qtshadertools/source/coin/axivion/ci_config_linux.json b/local/recipes/qt/qtshadertools/source/coin/axivion/ci_config_linux.json new file mode 100644 index 0000000000..b7ae35f299 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/coin/axivion/ci_config_linux.json @@ -0,0 +1,40 @@ +{ + "Project": { + "BuildSystemIntegration": { + "child_order": [ + "GCCSetup", + "CMake", + "LinkLibraries" + ] + }, + "CMake": { + "_active": true, + "_copy_from": "CMakeIntegration", + "build_environment": {}, + "build_options": "-j4", + "generate_options": "--fresh", + "generator": "Ninja" + }, + "GCCSetup": { + "_active": true, + "_copy_from": "Command", + "build_command": "gccsetup --cc gcc --cxx g++ --config ../../../axivion/" + }, + "LinkLibraries": { + "_active": true, + "_copy_from": "AxivionLinker", + "input_files": [ + "build/lib/lib*.so*.ir" + ], + "ir": "build/$(env:TESTED_MODULE_COIN).ir" + } + }, + "_Format": "1.0", + "_Version": "7.6.2", + "_VersionNum": [ + 7, + 6, + 2, + 12725 + ] +} diff --git a/local/recipes/qt/qtshadertools/source/coin/module_config.yaml b/local/recipes/qt/qtshadertools/source/coin/module_config.yaml new file mode 100644 index 0000000000..b7fc636269 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/coin/module_config.yaml @@ -0,0 +1,16 @@ +version: 2 +accept_configuration: + condition: property + property: features + not_contains_value: Disable + +instructions: + Build: + - type: EnvironmentVariable + variableName: VERIFY_SOURCE_SBOM + variableValue: "ON" + - !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml" + + Test: + - !include "{{qt/qtbase}}/coin_module_test_template_v3.yaml" + - !include "{{qt/qtbase}}/coin_module_test_docs.yaml" diff --git a/local/recipes/qt/qtshadertools/source/dependencies.yaml b/local/recipes/qt/qtshadertools/source/dependencies.yaml new file mode 100644 index 0000000000..d32a7c3d5f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/dependencies.yaml @@ -0,0 +1,4 @@ +dependencies: + ../qtbase: + ref: 59c81a3c2247b821b9b84b4eb8d939b77e07e276 + required: true diff --git a/local/recipes/qt/qtshadertools/source/dist/REUSE.toml b/local/recipes/qt/qtshadertools/source/dist/REUSE.toml new file mode 100644 index 0000000000..6e06fc5353 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/dist/REUSE.toml @@ -0,0 +1,8 @@ +version = 1 + +[[annotations]] +path = ["*"] +precedence = "override" +comment = "Licensed as documentation." +SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd." +SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only" diff --git a/local/recipes/qt/qtshadertools/source/dist/changes-6.0.0 b/local/recipes/qt/qtshadertools/source/dist/changes-6.0.0 new file mode 100644 index 0000000000..f1f569f39b --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/dist/changes-6.0.0 @@ -0,0 +1,17 @@ +Qt 6.0.0 is a new major version release of Qt. It is not binary compatible with +earlier Qt releases. + +The goal has been to retain as much source compatibility with Qt 5.15 as +possible, but some changes were inevitable to make Qt a better framework. + +To make it easier to port to Qt 6.0, we have created a porting guide to +summarize those changes and provide guidance to handle them. In the guide, you +can find links to articles about changes that may affect your application and +help you transition from Qt 5.15 to Qt 6.0: + +https://doc.qt.io/qt-6/portingguide.html + +For more details refer to the online documentation of Qt 6.0: + +https://doc.qt.io/qt-6/index.html + diff --git a/local/recipes/qt/qtshadertools/source/licenseRule.json b/local/recipes/qt/qtshadertools/source/licenseRule.json new file mode 100644 index 0000000000..3ee3665665 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/licenseRule.json @@ -0,0 +1,118 @@ +[ + { + "comment": ["file_pattern_ending: strings matched against the end of a file name.", + "location keys: regular expression matched against the beginning of", + "the file path (relative to the git submodule root).", + "spdx: list of SPDX-License-Expression's allowed in the matching files.", + "-------------------------------------------------------", + "Files with the following endings are Build System licensed,", + "unless they are examples", + "Files with other endings can also be build system files" + ], + "file_pattern_ending": ["CMakeLists.txt", ".cmake", ".pro", ".pri", ".prf", + "configure", "configure.bat", "cmake.in", "plist.in", "CMakeLists.txt.in", + "Makefile", ".conf", ".yml", ".cfg", ".yaml", ".tag", ".dynlist", + ".qsb.d.in"], + "location": { + "": { + "comment": "Default", + "file type": "build system", + "spdx": ["BSD-3-Clause"] + }, + "(.*)(examples/|snippets/)": { + "comment": "Example takes precedence", + "file type": "examples and snippets", + "spdx": ["LicenseRef-Qt-Commercial OR BSD-3-Clause"] + } + } + }, + { + "comments": ["Files with the following endings are infrastructure licensed"], + "file_pattern_ending": [".gitattributes", ".gitignore", ".gitmodules", ".gitreview", + "clang-format", "licenseRule.json", "REUSE.toml"], + "location":{ + "": { + "comment": "Default", + "file type": "infrastructure", + "spdx": ["LicenseRef-Qt-Commercial OR BSD-3-Clause"] + } + } + }, + { + "comments": ["Files with the following endings are Tool licensed,", + "unless they are examples.", + "Files with other endings can also be tool files."], + "file_pattern_ending": [".sh", ".py", ".pl", ".bat", ".ps1"], + "location":{ + "": { + "comment": "Default", + "file type": "tools and utils", + "spdx": ["LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0"] + }, + "(.*)(examples/|snippets/)": { + "comment": "Example takes precedence", + "file type": "examples and snippets", + "spdx": ["LicenseRef-Qt-Commercial OR BSD-3-Clause"] + } + } + }, + { + "comment": "Files with the following endings are Documentation licensed.", + "file_pattern_ending": [".qdoc", ".qdocinc" , ".qdocconf", ".txt", "README", "qt_attribution.json"], + "location":{ + "": { + "comment": "", + "file type": "documentation", + "spdx": ["LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"] + } + } + }, + { + "comment": ["All other files", + "The licensing is defined only by the file location in the Qt module repository.", + "NO key for this case!", + "This needs to be the last entry of the file."], + "location": { + "": { + "comment": "Default", + "file type": "module and plugin", + "spdx": ["LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only"] + }, + "dist/": { + "comment": "Default", + "file type": "documentation", + "spdx": ["LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"] + }, + "coin/": { + "comment": "Default", + "file type": "build system", + "spdx": ["BSD-3-Clause"] + }, + "src/shadertools/doc/images/": { + "comment": "Default", + "file type": "documentation", + "spdx": ["LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"] + }, + "src/": { + "comment": "Default", + "file type": "module and plugin", + "spdx": ["LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only"] + }, + "tools/": { + "comment": "Default", + "file type": "tools and utils", + "spdx": ["LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0"] + }, + "tests/": { + "comment": "Default", + "file type": "test", + "spdx": ["LicenseRef-Qt-Commercial OR GPL-3.0-only"] + }, + "(.*)(examples/|snippets/)": { + "comment": "Default", + "file type": "examples and snippets", + "spdx": ["LicenseRef-Qt-Commercial OR BSD-3-Clause"] + } + } + } +] diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/COPYRIGHT.txt b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/COPYRIGHT.txt new file mode 100644 index 0000000000..47c2cc21ee --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/COPYRIGHT.txt @@ -0,0 +1,6 @@ +Copyright 2015-2020 Arm Limited +Copyright (c) 2014-2019 The Khronos Group Inc. +Copyright 2019-2020 Hans-Kristian Arntzen +Copyright 2016-2020 Robert Konrad +Copyright 2016-2020 The Brenwill Workshop Ltd. +Copyright 2018-2020 Bradley Austin Davis diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/GLSL.std.450.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/GLSL.std.450.h new file mode 100644 index 0000000000..2686fc4ea7 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/GLSL.std.450.h @@ -0,0 +1,114 @@ +/* + * Copyright 2014-2016,2021 The Khronos Group, Inc. + * SPDX-License-Identifier: MIT + * + * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS + * STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND + * HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +*/ + +#ifndef GLSLstd450_H +#define GLSLstd450_H + +static const int GLSLstd450Version = 100; +static const int GLSLstd450Revision = 3; + +enum GLSLstd450 { + GLSLstd450Bad = 0, // Don't use + + GLSLstd450Round = 1, + GLSLstd450RoundEven = 2, + GLSLstd450Trunc = 3, + GLSLstd450FAbs = 4, + GLSLstd450SAbs = 5, + GLSLstd450FSign = 6, + GLSLstd450SSign = 7, + GLSLstd450Floor = 8, + GLSLstd450Ceil = 9, + GLSLstd450Fract = 10, + + GLSLstd450Radians = 11, + GLSLstd450Degrees = 12, + GLSLstd450Sin = 13, + GLSLstd450Cos = 14, + GLSLstd450Tan = 15, + GLSLstd450Asin = 16, + GLSLstd450Acos = 17, + GLSLstd450Atan = 18, + GLSLstd450Sinh = 19, + GLSLstd450Cosh = 20, + GLSLstd450Tanh = 21, + GLSLstd450Asinh = 22, + GLSLstd450Acosh = 23, + GLSLstd450Atanh = 24, + GLSLstd450Atan2 = 25, + + GLSLstd450Pow = 26, + GLSLstd450Exp = 27, + GLSLstd450Log = 28, + GLSLstd450Exp2 = 29, + GLSLstd450Log2 = 30, + GLSLstd450Sqrt = 31, + GLSLstd450InverseSqrt = 32, + + GLSLstd450Determinant = 33, + GLSLstd450MatrixInverse = 34, + + GLSLstd450Modf = 35, // second operand needs an OpVariable to write to + GLSLstd450ModfStruct = 36, // no OpVariable operand + GLSLstd450FMin = 37, + GLSLstd450UMin = 38, + GLSLstd450SMin = 39, + GLSLstd450FMax = 40, + GLSLstd450UMax = 41, + GLSLstd450SMax = 42, + GLSLstd450FClamp = 43, + GLSLstd450UClamp = 44, + GLSLstd450SClamp = 45, + GLSLstd450FMix = 46, + GLSLstd450IMix = 47, // Reserved + GLSLstd450Step = 48, + GLSLstd450SmoothStep = 49, + + GLSLstd450Fma = 50, + GLSLstd450Frexp = 51, // second operand needs an OpVariable to write to + GLSLstd450FrexpStruct = 52, // no OpVariable operand + GLSLstd450Ldexp = 53, + + GLSLstd450PackSnorm4x8 = 54, + GLSLstd450PackUnorm4x8 = 55, + GLSLstd450PackSnorm2x16 = 56, + GLSLstd450PackUnorm2x16 = 57, + GLSLstd450PackHalf2x16 = 58, + GLSLstd450PackDouble2x32 = 59, + GLSLstd450UnpackSnorm2x16 = 60, + GLSLstd450UnpackUnorm2x16 = 61, + GLSLstd450UnpackHalf2x16 = 62, + GLSLstd450UnpackSnorm4x8 = 63, + GLSLstd450UnpackUnorm4x8 = 64, + GLSLstd450UnpackDouble2x32 = 65, + + GLSLstd450Length = 66, + GLSLstd450Distance = 67, + GLSLstd450Cross = 68, + GLSLstd450Normalize = 69, + GLSLstd450FaceForward = 70, + GLSLstd450Reflect = 71, + GLSLstd450Refract = 72, + + GLSLstd450FindILsb = 73, + GLSLstd450FindSMsb = 74, + GLSLstd450FindUMsb = 75, + + GLSLstd450InterpolateAtCentroid = 76, + GLSLstd450InterpolateAtSample = 77, + GLSLstd450InterpolateAtOffset = 78, + + GLSLstd450NMin = 79, + GLSLstd450NMax = 80, + GLSLstd450NClamp = 81, + + GLSLstd450Count +}; + +#endif // #ifndef GLSLstd450_H diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/LICENSE b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/Makefile b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/Makefile new file mode 100644 index 0000000000..b44eb5e8c9 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/Makefile @@ -0,0 +1,44 @@ +# Copyright 2016-2021 The Khronos Group Inc. +# SPDX-License-Identifier: Apache-2.0 + +TARGET := spirv-cross + +SOURCES := $(wildcard spirv_*.cpp) +CLI_SOURCES := main.cpp + +OBJECTS := $(SOURCES:.cpp=.o) +CLI_OBJECTS := $(CLI_SOURCES:.cpp=.o) + +STATIC_LIB := lib$(TARGET).a + +DEPS := $(OBJECTS:.o=.d) $(CLI_OBJECTS:.o=.d) + +CXXFLAGS += -std=c++11 -Wall -Wextra -Wshadow -Wno-deprecated-declarations + +ifeq ($(DEBUG), 1) + CXXFLAGS += -O0 -g +else + CXXFLAGS += -O2 -DNDEBUG +endif + +ifeq ($(SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS), 1) + CXXFLAGS += -DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS -fno-exceptions +endif + +all: $(TARGET) + +-include $(DEPS) + +$(TARGET): $(CLI_OBJECTS) $(STATIC_LIB) + $(CXX) -o $@ $(CLI_OBJECTS) $(STATIC_LIB) $(LDFLAGS) + +$(STATIC_LIB): $(OBJECTS) + $(AR) rcs $@ $(OBJECTS) + +%.o: %.cpp + $(CXX) -c -o $@ $< $(CXXFLAGS) -MMD + +clean: + rm -f $(TARGET) $(OBJECTS) $(CLI_OBJECTS) $(STATIC_LIB) $(DEPS) + +.PHONY: clean diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/NonSemanticShaderDebugInfo100.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/NonSemanticShaderDebugInfo100.h new file mode 100644 index 0000000000..b276b560cb --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/NonSemanticShaderDebugInfo100.h @@ -0,0 +1,171 @@ +// Copyright (c) 2018-2024 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +#ifndef SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_ +#define SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + NonSemanticShaderDebugInfo100Version = 100, + NonSemanticShaderDebugInfo100Version_BitWidthPadding = 0x7fffffff +}; +enum { + NonSemanticShaderDebugInfo100Revision = 6, + NonSemanticShaderDebugInfo100Revision_BitWidthPadding = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100Instructions { + NonSemanticShaderDebugInfo100DebugInfoNone = 0, + NonSemanticShaderDebugInfo100DebugCompilationUnit = 1, + NonSemanticShaderDebugInfo100DebugTypeBasic = 2, + NonSemanticShaderDebugInfo100DebugTypePointer = 3, + NonSemanticShaderDebugInfo100DebugTypeQualifier = 4, + NonSemanticShaderDebugInfo100DebugTypeArray = 5, + NonSemanticShaderDebugInfo100DebugTypeVector = 6, + NonSemanticShaderDebugInfo100DebugTypedef = 7, + NonSemanticShaderDebugInfo100DebugTypeFunction = 8, + NonSemanticShaderDebugInfo100DebugTypeEnum = 9, + NonSemanticShaderDebugInfo100DebugTypeComposite = 10, + NonSemanticShaderDebugInfo100DebugTypeMember = 11, + NonSemanticShaderDebugInfo100DebugTypeInheritance = 12, + NonSemanticShaderDebugInfo100DebugTypePtrToMember = 13, + NonSemanticShaderDebugInfo100DebugTypeTemplate = 14, + NonSemanticShaderDebugInfo100DebugTypeTemplateParameter = 15, + NonSemanticShaderDebugInfo100DebugTypeTemplateTemplateParameter = 16, + NonSemanticShaderDebugInfo100DebugTypeTemplateParameterPack = 17, + NonSemanticShaderDebugInfo100DebugGlobalVariable = 18, + NonSemanticShaderDebugInfo100DebugFunctionDeclaration = 19, + NonSemanticShaderDebugInfo100DebugFunction = 20, + NonSemanticShaderDebugInfo100DebugLexicalBlock = 21, + NonSemanticShaderDebugInfo100DebugLexicalBlockDiscriminator = 22, + NonSemanticShaderDebugInfo100DebugScope = 23, + NonSemanticShaderDebugInfo100DebugNoScope = 24, + NonSemanticShaderDebugInfo100DebugInlinedAt = 25, + NonSemanticShaderDebugInfo100DebugLocalVariable = 26, + NonSemanticShaderDebugInfo100DebugInlinedVariable = 27, + NonSemanticShaderDebugInfo100DebugDeclare = 28, + NonSemanticShaderDebugInfo100DebugValue = 29, + NonSemanticShaderDebugInfo100DebugOperation = 30, + NonSemanticShaderDebugInfo100DebugExpression = 31, + NonSemanticShaderDebugInfo100DebugMacroDef = 32, + NonSemanticShaderDebugInfo100DebugMacroUndef = 33, + NonSemanticShaderDebugInfo100DebugImportedEntity = 34, + NonSemanticShaderDebugInfo100DebugSource = 35, + NonSemanticShaderDebugInfo100DebugFunctionDefinition = 101, + NonSemanticShaderDebugInfo100DebugSourceContinued = 102, + NonSemanticShaderDebugInfo100DebugLine = 103, + NonSemanticShaderDebugInfo100DebugNoLine = 104, + NonSemanticShaderDebugInfo100DebugBuildIdentifier = 105, + NonSemanticShaderDebugInfo100DebugStoragePath = 106, + NonSemanticShaderDebugInfo100DebugEntryPoint = 107, + NonSemanticShaderDebugInfo100DebugTypeMatrix = 108, + NonSemanticShaderDebugInfo100InstructionsMax = 0x7fffffff +}; + + +enum NonSemanticShaderDebugInfo100DebugInfoFlags { + NonSemanticShaderDebugInfo100None = 0x0000, + NonSemanticShaderDebugInfo100FlagIsProtected = 0x01, + NonSemanticShaderDebugInfo100FlagIsPrivate = 0x02, + NonSemanticShaderDebugInfo100FlagIsPublic = 0x03, + NonSemanticShaderDebugInfo100FlagIsLocal = 0x04, + NonSemanticShaderDebugInfo100FlagIsDefinition = 0x08, + NonSemanticShaderDebugInfo100FlagFwdDecl = 0x10, + NonSemanticShaderDebugInfo100FlagArtificial = 0x20, + NonSemanticShaderDebugInfo100FlagExplicit = 0x40, + NonSemanticShaderDebugInfo100FlagPrototyped = 0x80, + NonSemanticShaderDebugInfo100FlagObjectPointer = 0x100, + NonSemanticShaderDebugInfo100FlagStaticMember = 0x200, + NonSemanticShaderDebugInfo100FlagIndirectVariable = 0x400, + NonSemanticShaderDebugInfo100FlagLValueReference = 0x800, + NonSemanticShaderDebugInfo100FlagRValueReference = 0x1000, + NonSemanticShaderDebugInfo100FlagIsOptimized = 0x2000, + NonSemanticShaderDebugInfo100FlagIsEnumClass = 0x4000, + NonSemanticShaderDebugInfo100FlagTypePassByValue = 0x8000, + NonSemanticShaderDebugInfo100FlagTypePassByReference = 0x10000, + NonSemanticShaderDebugInfo100FlagUnknownPhysicalLayout = 0x20000, + NonSemanticShaderDebugInfo100DebugInfoFlagsMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100BuildIdentifierFlags { + NonSemanticShaderDebugInfo100IdentifierPossibleDuplicates = 0x01, + NonSemanticShaderDebugInfo100BuildIdentifierFlagsMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100DebugBaseTypeAttributeEncoding { + NonSemanticShaderDebugInfo100Unspecified = 0, + NonSemanticShaderDebugInfo100Address = 1, + NonSemanticShaderDebugInfo100Boolean = 2, + NonSemanticShaderDebugInfo100Float = 3, + NonSemanticShaderDebugInfo100Signed = 4, + NonSemanticShaderDebugInfo100SignedChar = 5, + NonSemanticShaderDebugInfo100Unsigned = 6, + NonSemanticShaderDebugInfo100UnsignedChar = 7, + NonSemanticShaderDebugInfo100DebugBaseTypeAttributeEncodingMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100DebugCompositeType { + NonSemanticShaderDebugInfo100Class = 0, + NonSemanticShaderDebugInfo100Structure = 1, + NonSemanticShaderDebugInfo100Union = 2, + NonSemanticShaderDebugInfo100DebugCompositeTypeMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100DebugTypeQualifier { + NonSemanticShaderDebugInfo100ConstType = 0, + NonSemanticShaderDebugInfo100VolatileType = 1, + NonSemanticShaderDebugInfo100RestrictType = 2, + NonSemanticShaderDebugInfo100AtomicType = 3, + NonSemanticShaderDebugInfo100DebugTypeQualifierMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100DebugOperation { + NonSemanticShaderDebugInfo100Deref = 0, + NonSemanticShaderDebugInfo100Plus = 1, + NonSemanticShaderDebugInfo100Minus = 2, + NonSemanticShaderDebugInfo100PlusUconst = 3, + NonSemanticShaderDebugInfo100BitPiece = 4, + NonSemanticShaderDebugInfo100Swap = 5, + NonSemanticShaderDebugInfo100Xderef = 6, + NonSemanticShaderDebugInfo100StackValue = 7, + NonSemanticShaderDebugInfo100Constu = 8, + NonSemanticShaderDebugInfo100Fragment = 9, + NonSemanticShaderDebugInfo100DebugOperationMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100DebugImportedEntity { + NonSemanticShaderDebugInfo100ImportedModule = 0, + NonSemanticShaderDebugInfo100ImportedDeclaration = 1, + NonSemanticShaderDebugInfo100DebugImportedEntityMax = 0x7fffffff +}; + + +#ifdef __cplusplus +} +#endif + +#endif // SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/REUSE.toml b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/REUSE.toml new file mode 100644 index 0000000000..b2524f2fe9 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/REUSE.toml @@ -0,0 +1,6 @@ +version = 1 + +[[annotations]] +path = ["*"] +precedence = "closest" +SPDX-License-Identifier = "Apache-2.0 OR MIT" diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/qt_attribution.json b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/qt_attribution.json new file mode 100644 index 0000000000..83b7774477 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/qt_attribution.json @@ -0,0 +1,19 @@ +[ + { + "Id": "spirvcross", + "Name": "SPIRV-Cross", + "QDocModule": "qtshadertools", + "Description": "A practical tool and library for performing reflection on SPIR-V and disassembling SPIR-V back to high level languages.", + "QtUsage": "Shader code generation.", + + "Homepage": "https://github.com/KhronosGroup/SPIRV-Cross", + "PURL": [ + "pkg:github/KhronosGroup/SPIRV-Cross@$" + ], + "Comment": "No relevant CPE found", + "Version": "998146d76fc5cbb2726f44c55e25fa28a573a782", + "License": "Apache License 2.0 and MIT Khronos - old variant", + "LicenseId": "Apache-2.0 AND LicenseRef-MIT-Khronos-old", + "CopyrightFile": "COPYRIGHT.txt" + } +] diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv.h new file mode 100644 index 0000000000..0f58605308 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv.h @@ -0,0 +1,5288 @@ +/* +** Copyright (c) 2014-2024 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +/* +** Enumeration tokens for SPIR-V, in various styles: +** C, C++, C++11, JSON, Lua, Python, C#, D, Beef +** +** - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +** - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +** - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +** - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +** - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +** - C# will use enum classes in the Specification class located in the "Spv" namespace, +** e.g.: Spv.Specification.SourceLanguage.GLSL +** - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL +** - Beef will use enum classes in the Specification class located in the "Spv" namespace, +** e.g.: Spv.Specification.SourceLanguage.GLSL +** +** Some tokens act like mask values, which can be OR'd together, +** while others are mutually exclusive. The mask-like ones have +** "Mask" in their name, and a parallel enum that has the shift +** amount (1 << x) for each corresponding enumerant. +*/ + +#ifndef spirv_H +#define spirv_H + +typedef unsigned int SpvId; + +#define SPV_VERSION 0x10600 +#define SPV_REVISION 1 + +static const unsigned int SpvMagicNumber = 0x07230203; +static const unsigned int SpvVersion = 0x00010600; +static const unsigned int SpvRevision = 1; +static const unsigned int SpvOpCodeMask = 0xffff; +static const unsigned int SpvWordCountShift = 16; + +typedef enum SpvSourceLanguage_ { + SpvSourceLanguageUnknown = 0, + SpvSourceLanguageESSL = 1, + SpvSourceLanguageGLSL = 2, + SpvSourceLanguageOpenCL_C = 3, + SpvSourceLanguageOpenCL_CPP = 4, + SpvSourceLanguageHLSL = 5, + SpvSourceLanguageCPP_for_OpenCL = 6, + SpvSourceLanguageSYCL = 7, + SpvSourceLanguageHERO_C = 8, + SpvSourceLanguageNZSL = 9, + SpvSourceLanguageWGSL = 10, + SpvSourceLanguageSlang = 11, + SpvSourceLanguageZig = 12, + SpvSourceLanguageRust = 13, + SpvSourceLanguageMax = 0x7fffffff, +} SpvSourceLanguage; + +typedef enum SpvExecutionModel_ { + SpvExecutionModelVertex = 0, + SpvExecutionModelTessellationControl = 1, + SpvExecutionModelTessellationEvaluation = 2, + SpvExecutionModelGeometry = 3, + SpvExecutionModelFragment = 4, + SpvExecutionModelGLCompute = 5, + SpvExecutionModelKernel = 6, + SpvExecutionModelTaskNV = 5267, + SpvExecutionModelMeshNV = 5268, + SpvExecutionModelRayGenerationKHR = 5313, + SpvExecutionModelRayGenerationNV = 5313, + SpvExecutionModelIntersectionKHR = 5314, + SpvExecutionModelIntersectionNV = 5314, + SpvExecutionModelAnyHitKHR = 5315, + SpvExecutionModelAnyHitNV = 5315, + SpvExecutionModelClosestHitKHR = 5316, + SpvExecutionModelClosestHitNV = 5316, + SpvExecutionModelMissKHR = 5317, + SpvExecutionModelMissNV = 5317, + SpvExecutionModelCallableKHR = 5318, + SpvExecutionModelCallableNV = 5318, + SpvExecutionModelTaskEXT = 5364, + SpvExecutionModelMeshEXT = 5365, + SpvExecutionModelMax = 0x7fffffff, +} SpvExecutionModel; + +typedef enum SpvAddressingModel_ { + SpvAddressingModelLogical = 0, + SpvAddressingModelPhysical32 = 1, + SpvAddressingModelPhysical64 = 2, + SpvAddressingModelPhysicalStorageBuffer64 = 5348, + SpvAddressingModelPhysicalStorageBuffer64EXT = 5348, + SpvAddressingModelMax = 0x7fffffff, +} SpvAddressingModel; + +typedef enum SpvMemoryModel_ { + SpvMemoryModelSimple = 0, + SpvMemoryModelGLSL450 = 1, + SpvMemoryModelOpenCL = 2, + SpvMemoryModelVulkan = 3, + SpvMemoryModelVulkanKHR = 3, + SpvMemoryModelMax = 0x7fffffff, +} SpvMemoryModel; + +typedef enum SpvExecutionMode_ { + SpvExecutionModeInvocations = 0, + SpvExecutionModeSpacingEqual = 1, + SpvExecutionModeSpacingFractionalEven = 2, + SpvExecutionModeSpacingFractionalOdd = 3, + SpvExecutionModeVertexOrderCw = 4, + SpvExecutionModeVertexOrderCcw = 5, + SpvExecutionModePixelCenterInteger = 6, + SpvExecutionModeOriginUpperLeft = 7, + SpvExecutionModeOriginLowerLeft = 8, + SpvExecutionModeEarlyFragmentTests = 9, + SpvExecutionModePointMode = 10, + SpvExecutionModeXfb = 11, + SpvExecutionModeDepthReplacing = 12, + SpvExecutionModeDepthGreater = 14, + SpvExecutionModeDepthLess = 15, + SpvExecutionModeDepthUnchanged = 16, + SpvExecutionModeLocalSize = 17, + SpvExecutionModeLocalSizeHint = 18, + SpvExecutionModeInputPoints = 19, + SpvExecutionModeInputLines = 20, + SpvExecutionModeInputLinesAdjacency = 21, + SpvExecutionModeTriangles = 22, + SpvExecutionModeInputTrianglesAdjacency = 23, + SpvExecutionModeQuads = 24, + SpvExecutionModeIsolines = 25, + SpvExecutionModeOutputVertices = 26, + SpvExecutionModeOutputPoints = 27, + SpvExecutionModeOutputLineStrip = 28, + SpvExecutionModeOutputTriangleStrip = 29, + SpvExecutionModeVecTypeHint = 30, + SpvExecutionModeContractionOff = 31, + SpvExecutionModeInitializer = 33, + SpvExecutionModeFinalizer = 34, + SpvExecutionModeSubgroupSize = 35, + SpvExecutionModeSubgroupsPerWorkgroup = 36, + SpvExecutionModeSubgroupsPerWorkgroupId = 37, + SpvExecutionModeLocalSizeId = 38, + SpvExecutionModeLocalSizeHintId = 39, + SpvExecutionModeNonCoherentColorAttachmentReadEXT = 4169, + SpvExecutionModeNonCoherentDepthAttachmentReadEXT = 4170, + SpvExecutionModeNonCoherentStencilAttachmentReadEXT = 4171, + SpvExecutionModeSubgroupUniformControlFlowKHR = 4421, + SpvExecutionModePostDepthCoverage = 4446, + SpvExecutionModeDenormPreserve = 4459, + SpvExecutionModeDenormFlushToZero = 4460, + SpvExecutionModeSignedZeroInfNanPreserve = 4461, + SpvExecutionModeRoundingModeRTE = 4462, + SpvExecutionModeRoundingModeRTZ = 4463, + SpvExecutionModeNonCoherentTileAttachmentReadQCOM = 4489, + SpvExecutionModeTileShadingRateQCOM = 4490, + SpvExecutionModeEarlyAndLateFragmentTestsAMD = 5017, + SpvExecutionModeStencilRefReplacingEXT = 5027, + SpvExecutionModeCoalescingAMDX = 5069, + SpvExecutionModeIsApiEntryAMDX = 5070, + SpvExecutionModeMaxNodeRecursionAMDX = 5071, + SpvExecutionModeStaticNumWorkgroupsAMDX = 5072, + SpvExecutionModeShaderIndexAMDX = 5073, + SpvExecutionModeMaxNumWorkgroupsAMDX = 5077, + SpvExecutionModeStencilRefUnchangedFrontAMD = 5079, + SpvExecutionModeStencilRefGreaterFrontAMD = 5080, + SpvExecutionModeStencilRefLessFrontAMD = 5081, + SpvExecutionModeStencilRefUnchangedBackAMD = 5082, + SpvExecutionModeStencilRefGreaterBackAMD = 5083, + SpvExecutionModeStencilRefLessBackAMD = 5084, + SpvExecutionModeQuadDerivativesKHR = 5088, + SpvExecutionModeRequireFullQuadsKHR = 5089, + SpvExecutionModeSharesInputWithAMDX = 5102, + SpvExecutionModeOutputLinesEXT = 5269, + SpvExecutionModeOutputLinesNV = 5269, + SpvExecutionModeOutputPrimitivesEXT = 5270, + SpvExecutionModeOutputPrimitivesNV = 5270, + SpvExecutionModeDerivativeGroupQuadsKHR = 5289, + SpvExecutionModeDerivativeGroupQuadsNV = 5289, + SpvExecutionModeDerivativeGroupLinearKHR = 5290, + SpvExecutionModeDerivativeGroupLinearNV = 5290, + SpvExecutionModeOutputTrianglesEXT = 5298, + SpvExecutionModeOutputTrianglesNV = 5298, + SpvExecutionModePixelInterlockOrderedEXT = 5366, + SpvExecutionModePixelInterlockUnorderedEXT = 5367, + SpvExecutionModeSampleInterlockOrderedEXT = 5368, + SpvExecutionModeSampleInterlockUnorderedEXT = 5369, + SpvExecutionModeShadingRateInterlockOrderedEXT = 5370, + SpvExecutionModeShadingRateInterlockUnorderedEXT = 5371, + SpvExecutionModeSharedLocalMemorySizeINTEL = 5618, + SpvExecutionModeRoundingModeRTPINTEL = 5620, + SpvExecutionModeRoundingModeRTNINTEL = 5621, + SpvExecutionModeFloatingPointModeALTINTEL = 5622, + SpvExecutionModeFloatingPointModeIEEEINTEL = 5623, + SpvExecutionModeMaxWorkgroupSizeINTEL = 5893, + SpvExecutionModeMaxWorkDimINTEL = 5894, + SpvExecutionModeNoGlobalOffsetINTEL = 5895, + SpvExecutionModeNumSIMDWorkitemsINTEL = 5896, + SpvExecutionModeSchedulerTargetFmaxMhzINTEL = 5903, + SpvExecutionModeMaximallyReconvergesKHR = 6023, + SpvExecutionModeFPFastMathDefault = 6028, + SpvExecutionModeStreamingInterfaceINTEL = 6154, + SpvExecutionModeRegisterMapInterfaceINTEL = 6160, + SpvExecutionModeNamedBarrierCountINTEL = 6417, + SpvExecutionModeMaximumRegistersINTEL = 6461, + SpvExecutionModeMaximumRegistersIdINTEL = 6462, + SpvExecutionModeNamedMaximumRegistersINTEL = 6463, + SpvExecutionModeMax = 0x7fffffff, +} SpvExecutionMode; + +typedef enum SpvStorageClass_ { + SpvStorageClassUniformConstant = 0, + SpvStorageClassInput = 1, + SpvStorageClassUniform = 2, + SpvStorageClassOutput = 3, + SpvStorageClassWorkgroup = 4, + SpvStorageClassCrossWorkgroup = 5, + SpvStorageClassPrivate = 6, + SpvStorageClassFunction = 7, + SpvStorageClassGeneric = 8, + SpvStorageClassPushConstant = 9, + SpvStorageClassAtomicCounter = 10, + SpvStorageClassImage = 11, + SpvStorageClassStorageBuffer = 12, + SpvStorageClassTileImageEXT = 4172, + SpvStorageClassTileAttachmentQCOM = 4491, + SpvStorageClassNodePayloadAMDX = 5068, + SpvStorageClassCallableDataKHR = 5328, + SpvStorageClassCallableDataNV = 5328, + SpvStorageClassIncomingCallableDataKHR = 5329, + SpvStorageClassIncomingCallableDataNV = 5329, + SpvStorageClassRayPayloadKHR = 5338, + SpvStorageClassRayPayloadNV = 5338, + SpvStorageClassHitAttributeKHR = 5339, + SpvStorageClassHitAttributeNV = 5339, + SpvStorageClassIncomingRayPayloadKHR = 5342, + SpvStorageClassIncomingRayPayloadNV = 5342, + SpvStorageClassShaderRecordBufferKHR = 5343, + SpvStorageClassShaderRecordBufferNV = 5343, + SpvStorageClassPhysicalStorageBuffer = 5349, + SpvStorageClassPhysicalStorageBufferEXT = 5349, + SpvStorageClassHitObjectAttributeNV = 5385, + SpvStorageClassTaskPayloadWorkgroupEXT = 5402, + SpvStorageClassCodeSectionINTEL = 5605, + SpvStorageClassDeviceOnlyINTEL = 5936, + SpvStorageClassHostOnlyINTEL = 5937, + SpvStorageClassMax = 0x7fffffff, +} SpvStorageClass; + +typedef enum SpvDim_ { + SpvDim1D = 0, + SpvDim2D = 1, + SpvDim3D = 2, + SpvDimCube = 3, + SpvDimRect = 4, + SpvDimBuffer = 5, + SpvDimSubpassData = 6, + SpvDimTileImageDataEXT = 4173, + SpvDimMax = 0x7fffffff, +} SpvDim; + +typedef enum SpvSamplerAddressingMode_ { + SpvSamplerAddressingModeNone = 0, + SpvSamplerAddressingModeClampToEdge = 1, + SpvSamplerAddressingModeClamp = 2, + SpvSamplerAddressingModeRepeat = 3, + SpvSamplerAddressingModeRepeatMirrored = 4, + SpvSamplerAddressingModeMax = 0x7fffffff, +} SpvSamplerAddressingMode; + +typedef enum SpvSamplerFilterMode_ { + SpvSamplerFilterModeNearest = 0, + SpvSamplerFilterModeLinear = 1, + SpvSamplerFilterModeMax = 0x7fffffff, +} SpvSamplerFilterMode; + +typedef enum SpvImageFormat_ { + SpvImageFormatUnknown = 0, + SpvImageFormatRgba32f = 1, + SpvImageFormatRgba16f = 2, + SpvImageFormatR32f = 3, + SpvImageFormatRgba8 = 4, + SpvImageFormatRgba8Snorm = 5, + SpvImageFormatRg32f = 6, + SpvImageFormatRg16f = 7, + SpvImageFormatR11fG11fB10f = 8, + SpvImageFormatR16f = 9, + SpvImageFormatRgba16 = 10, + SpvImageFormatRgb10A2 = 11, + SpvImageFormatRg16 = 12, + SpvImageFormatRg8 = 13, + SpvImageFormatR16 = 14, + SpvImageFormatR8 = 15, + SpvImageFormatRgba16Snorm = 16, + SpvImageFormatRg16Snorm = 17, + SpvImageFormatRg8Snorm = 18, + SpvImageFormatR16Snorm = 19, + SpvImageFormatR8Snorm = 20, + SpvImageFormatRgba32i = 21, + SpvImageFormatRgba16i = 22, + SpvImageFormatRgba8i = 23, + SpvImageFormatR32i = 24, + SpvImageFormatRg32i = 25, + SpvImageFormatRg16i = 26, + SpvImageFormatRg8i = 27, + SpvImageFormatR16i = 28, + SpvImageFormatR8i = 29, + SpvImageFormatRgba32ui = 30, + SpvImageFormatRgba16ui = 31, + SpvImageFormatRgba8ui = 32, + SpvImageFormatR32ui = 33, + SpvImageFormatRgb10a2ui = 34, + SpvImageFormatRg32ui = 35, + SpvImageFormatRg16ui = 36, + SpvImageFormatRg8ui = 37, + SpvImageFormatR16ui = 38, + SpvImageFormatR8ui = 39, + SpvImageFormatR64ui = 40, + SpvImageFormatR64i = 41, + SpvImageFormatMax = 0x7fffffff, +} SpvImageFormat; + +typedef enum SpvImageChannelOrder_ { + SpvImageChannelOrderR = 0, + SpvImageChannelOrderA = 1, + SpvImageChannelOrderRG = 2, + SpvImageChannelOrderRA = 3, + SpvImageChannelOrderRGB = 4, + SpvImageChannelOrderRGBA = 5, + SpvImageChannelOrderBGRA = 6, + SpvImageChannelOrderARGB = 7, + SpvImageChannelOrderIntensity = 8, + SpvImageChannelOrderLuminance = 9, + SpvImageChannelOrderRx = 10, + SpvImageChannelOrderRGx = 11, + SpvImageChannelOrderRGBx = 12, + SpvImageChannelOrderDepth = 13, + SpvImageChannelOrderDepthStencil = 14, + SpvImageChannelOrdersRGB = 15, + SpvImageChannelOrdersRGBx = 16, + SpvImageChannelOrdersRGBA = 17, + SpvImageChannelOrdersBGRA = 18, + SpvImageChannelOrderABGR = 19, + SpvImageChannelOrderMax = 0x7fffffff, +} SpvImageChannelOrder; + +typedef enum SpvImageChannelDataType_ { + SpvImageChannelDataTypeSnormInt8 = 0, + SpvImageChannelDataTypeSnormInt16 = 1, + SpvImageChannelDataTypeUnormInt8 = 2, + SpvImageChannelDataTypeUnormInt16 = 3, + SpvImageChannelDataTypeUnormShort565 = 4, + SpvImageChannelDataTypeUnormShort555 = 5, + SpvImageChannelDataTypeUnormInt101010 = 6, + SpvImageChannelDataTypeSignedInt8 = 7, + SpvImageChannelDataTypeSignedInt16 = 8, + SpvImageChannelDataTypeSignedInt32 = 9, + SpvImageChannelDataTypeUnsignedInt8 = 10, + SpvImageChannelDataTypeUnsignedInt16 = 11, + SpvImageChannelDataTypeUnsignedInt32 = 12, + SpvImageChannelDataTypeHalfFloat = 13, + SpvImageChannelDataTypeFloat = 14, + SpvImageChannelDataTypeUnormInt24 = 15, + SpvImageChannelDataTypeUnormInt101010_2 = 16, + SpvImageChannelDataTypeUnormInt10X6EXT = 17, + SpvImageChannelDataTypeUnsignedIntRaw10EXT = 19, + SpvImageChannelDataTypeUnsignedIntRaw12EXT = 20, + SpvImageChannelDataTypeUnormInt2_101010EXT = 21, + SpvImageChannelDataTypeUnsignedInt10X6EXT = 22, + SpvImageChannelDataTypeUnsignedInt12X4EXT = 23, + SpvImageChannelDataTypeUnsignedInt14X2EXT = 24, + SpvImageChannelDataTypeUnormInt12X4EXT = 25, + SpvImageChannelDataTypeUnormInt14X2EXT = 26, + SpvImageChannelDataTypeMax = 0x7fffffff, +} SpvImageChannelDataType; + +typedef enum SpvImageOperandsShift_ { + SpvImageOperandsBiasShift = 0, + SpvImageOperandsLodShift = 1, + SpvImageOperandsGradShift = 2, + SpvImageOperandsConstOffsetShift = 3, + SpvImageOperandsOffsetShift = 4, + SpvImageOperandsConstOffsetsShift = 5, + SpvImageOperandsSampleShift = 6, + SpvImageOperandsMinLodShift = 7, + SpvImageOperandsMakeTexelAvailableShift = 8, + SpvImageOperandsMakeTexelAvailableKHRShift = 8, + SpvImageOperandsMakeTexelVisibleShift = 9, + SpvImageOperandsMakeTexelVisibleKHRShift = 9, + SpvImageOperandsNonPrivateTexelShift = 10, + SpvImageOperandsNonPrivateTexelKHRShift = 10, + SpvImageOperandsVolatileTexelShift = 11, + SpvImageOperandsVolatileTexelKHRShift = 11, + SpvImageOperandsSignExtendShift = 12, + SpvImageOperandsZeroExtendShift = 13, + SpvImageOperandsNontemporalShift = 14, + SpvImageOperandsOffsetsShift = 16, + SpvImageOperandsMax = 0x7fffffff, +} SpvImageOperandsShift; + +typedef enum SpvImageOperandsMask_ { + SpvImageOperandsMaskNone = 0, + SpvImageOperandsBiasMask = 0x00000001, + SpvImageOperandsLodMask = 0x00000002, + SpvImageOperandsGradMask = 0x00000004, + SpvImageOperandsConstOffsetMask = 0x00000008, + SpvImageOperandsOffsetMask = 0x00000010, + SpvImageOperandsConstOffsetsMask = 0x00000020, + SpvImageOperandsSampleMask = 0x00000040, + SpvImageOperandsMinLodMask = 0x00000080, + SpvImageOperandsMakeTexelAvailableMask = 0x00000100, + SpvImageOperandsMakeTexelAvailableKHRMask = 0x00000100, + SpvImageOperandsMakeTexelVisibleMask = 0x00000200, + SpvImageOperandsMakeTexelVisibleKHRMask = 0x00000200, + SpvImageOperandsNonPrivateTexelMask = 0x00000400, + SpvImageOperandsNonPrivateTexelKHRMask = 0x00000400, + SpvImageOperandsVolatileTexelMask = 0x00000800, + SpvImageOperandsVolatileTexelKHRMask = 0x00000800, + SpvImageOperandsSignExtendMask = 0x00001000, + SpvImageOperandsZeroExtendMask = 0x00002000, + SpvImageOperandsNontemporalMask = 0x00004000, + SpvImageOperandsOffsetsMask = 0x00010000, +} SpvImageOperandsMask; + +typedef enum SpvFPFastMathModeShift_ { + SpvFPFastMathModeNotNaNShift = 0, + SpvFPFastMathModeNotInfShift = 1, + SpvFPFastMathModeNSZShift = 2, + SpvFPFastMathModeAllowRecipShift = 3, + SpvFPFastMathModeFastShift = 4, + SpvFPFastMathModeAllowContractShift = 16, + SpvFPFastMathModeAllowContractFastINTELShift = 16, + SpvFPFastMathModeAllowReassocShift = 17, + SpvFPFastMathModeAllowReassocINTELShift = 17, + SpvFPFastMathModeAllowTransformShift = 18, + SpvFPFastMathModeMax = 0x7fffffff, +} SpvFPFastMathModeShift; + +typedef enum SpvFPFastMathModeMask_ { + SpvFPFastMathModeMaskNone = 0, + SpvFPFastMathModeNotNaNMask = 0x00000001, + SpvFPFastMathModeNotInfMask = 0x00000002, + SpvFPFastMathModeNSZMask = 0x00000004, + SpvFPFastMathModeAllowRecipMask = 0x00000008, + SpvFPFastMathModeFastMask = 0x00000010, + SpvFPFastMathModeAllowContractMask = 0x00010000, + SpvFPFastMathModeAllowContractFastINTELMask = 0x00010000, + SpvFPFastMathModeAllowReassocMask = 0x00020000, + SpvFPFastMathModeAllowReassocINTELMask = 0x00020000, + SpvFPFastMathModeAllowTransformMask = 0x00040000, +} SpvFPFastMathModeMask; + +typedef enum SpvFPRoundingMode_ { + SpvFPRoundingModeRTE = 0, + SpvFPRoundingModeRTZ = 1, + SpvFPRoundingModeRTP = 2, + SpvFPRoundingModeRTN = 3, + SpvFPRoundingModeMax = 0x7fffffff, +} SpvFPRoundingMode; + +typedef enum SpvLinkageType_ { + SpvLinkageTypeExport = 0, + SpvLinkageTypeImport = 1, + SpvLinkageTypeLinkOnceODR = 2, + SpvLinkageTypeMax = 0x7fffffff, +} SpvLinkageType; + +typedef enum SpvAccessQualifier_ { + SpvAccessQualifierReadOnly = 0, + SpvAccessQualifierWriteOnly = 1, + SpvAccessQualifierReadWrite = 2, + SpvAccessQualifierMax = 0x7fffffff, +} SpvAccessQualifier; + +typedef enum SpvFunctionParameterAttribute_ { + SpvFunctionParameterAttributeZext = 0, + SpvFunctionParameterAttributeSext = 1, + SpvFunctionParameterAttributeByVal = 2, + SpvFunctionParameterAttributeSret = 3, + SpvFunctionParameterAttributeNoAlias = 4, + SpvFunctionParameterAttributeNoCapture = 5, + SpvFunctionParameterAttributeNoWrite = 6, + SpvFunctionParameterAttributeNoReadWrite = 7, + SpvFunctionParameterAttributeRuntimeAlignedINTEL = 5940, + SpvFunctionParameterAttributeMax = 0x7fffffff, +} SpvFunctionParameterAttribute; + +typedef enum SpvDecoration_ { + SpvDecorationRelaxedPrecision = 0, + SpvDecorationSpecId = 1, + SpvDecorationBlock = 2, + SpvDecorationBufferBlock = 3, + SpvDecorationRowMajor = 4, + SpvDecorationColMajor = 5, + SpvDecorationArrayStride = 6, + SpvDecorationMatrixStride = 7, + SpvDecorationGLSLShared = 8, + SpvDecorationGLSLPacked = 9, + SpvDecorationCPacked = 10, + SpvDecorationBuiltIn = 11, + SpvDecorationNoPerspective = 13, + SpvDecorationFlat = 14, + SpvDecorationPatch = 15, + SpvDecorationCentroid = 16, + SpvDecorationSample = 17, + SpvDecorationInvariant = 18, + SpvDecorationRestrict = 19, + SpvDecorationAliased = 20, + SpvDecorationVolatile = 21, + SpvDecorationConstant = 22, + SpvDecorationCoherent = 23, + SpvDecorationNonWritable = 24, + SpvDecorationNonReadable = 25, + SpvDecorationUniform = 26, + SpvDecorationUniformId = 27, + SpvDecorationSaturatedConversion = 28, + SpvDecorationStream = 29, + SpvDecorationLocation = 30, + SpvDecorationComponent = 31, + SpvDecorationIndex = 32, + SpvDecorationBinding = 33, + SpvDecorationDescriptorSet = 34, + SpvDecorationOffset = 35, + SpvDecorationXfbBuffer = 36, + SpvDecorationXfbStride = 37, + SpvDecorationFuncParamAttr = 38, + SpvDecorationFPRoundingMode = 39, + SpvDecorationFPFastMathMode = 40, + SpvDecorationLinkageAttributes = 41, + SpvDecorationNoContraction = 42, + SpvDecorationInputAttachmentIndex = 43, + SpvDecorationAlignment = 44, + SpvDecorationMaxByteOffset = 45, + SpvDecorationAlignmentId = 46, + SpvDecorationMaxByteOffsetId = 47, + SpvDecorationSaturatedToLargestFloat8NormalConversionEXT = 4216, + SpvDecorationNoSignedWrap = 4469, + SpvDecorationNoUnsignedWrap = 4470, + SpvDecorationWeightTextureQCOM = 4487, + SpvDecorationBlockMatchTextureQCOM = 4488, + SpvDecorationBlockMatchSamplerQCOM = 4499, + SpvDecorationExplicitInterpAMD = 4999, + SpvDecorationNodeSharesPayloadLimitsWithAMDX = 5019, + SpvDecorationNodeMaxPayloadsAMDX = 5020, + SpvDecorationTrackFinishWritingAMDX = 5078, + SpvDecorationPayloadNodeNameAMDX = 5091, + SpvDecorationPayloadNodeBaseIndexAMDX = 5098, + SpvDecorationPayloadNodeSparseArrayAMDX = 5099, + SpvDecorationPayloadNodeArraySizeAMDX = 5100, + SpvDecorationPayloadDispatchIndirectAMDX = 5105, + SpvDecorationOverrideCoverageNV = 5248, + SpvDecorationPassthroughNV = 5250, + SpvDecorationViewportRelativeNV = 5252, + SpvDecorationSecondaryViewportRelativeNV = 5256, + SpvDecorationPerPrimitiveEXT = 5271, + SpvDecorationPerPrimitiveNV = 5271, + SpvDecorationPerViewNV = 5272, + SpvDecorationPerTaskNV = 5273, + SpvDecorationPerVertexKHR = 5285, + SpvDecorationPerVertexNV = 5285, + SpvDecorationNonUniform = 5300, + SpvDecorationNonUniformEXT = 5300, + SpvDecorationRestrictPointer = 5355, + SpvDecorationRestrictPointerEXT = 5355, + SpvDecorationAliasedPointer = 5356, + SpvDecorationAliasedPointerEXT = 5356, + SpvDecorationHitObjectShaderRecordBufferNV = 5386, + SpvDecorationBindlessSamplerNV = 5398, + SpvDecorationBindlessImageNV = 5399, + SpvDecorationBoundSamplerNV = 5400, + SpvDecorationBoundImageNV = 5401, + SpvDecorationSIMTCallINTEL = 5599, + SpvDecorationReferencedIndirectlyINTEL = 5602, + SpvDecorationClobberINTEL = 5607, + SpvDecorationSideEffectsINTEL = 5608, + SpvDecorationVectorComputeVariableINTEL = 5624, + SpvDecorationFuncParamIOKindINTEL = 5625, + SpvDecorationVectorComputeFunctionINTEL = 5626, + SpvDecorationStackCallINTEL = 5627, + SpvDecorationGlobalVariableOffsetINTEL = 5628, + SpvDecorationCounterBuffer = 5634, + SpvDecorationHlslCounterBufferGOOGLE = 5634, + SpvDecorationHlslSemanticGOOGLE = 5635, + SpvDecorationUserSemantic = 5635, + SpvDecorationUserTypeGOOGLE = 5636, + SpvDecorationFunctionRoundingModeINTEL = 5822, + SpvDecorationFunctionDenormModeINTEL = 5823, + SpvDecorationRegisterINTEL = 5825, + SpvDecorationMemoryINTEL = 5826, + SpvDecorationNumbanksINTEL = 5827, + SpvDecorationBankwidthINTEL = 5828, + SpvDecorationMaxPrivateCopiesINTEL = 5829, + SpvDecorationSinglepumpINTEL = 5830, + SpvDecorationDoublepumpINTEL = 5831, + SpvDecorationMaxReplicatesINTEL = 5832, + SpvDecorationSimpleDualPortINTEL = 5833, + SpvDecorationMergeINTEL = 5834, + SpvDecorationBankBitsINTEL = 5835, + SpvDecorationForcePow2DepthINTEL = 5836, + SpvDecorationStridesizeINTEL = 5883, + SpvDecorationWordsizeINTEL = 5884, + SpvDecorationTrueDualPortINTEL = 5885, + SpvDecorationBurstCoalesceINTEL = 5899, + SpvDecorationCacheSizeINTEL = 5900, + SpvDecorationDontStaticallyCoalesceINTEL = 5901, + SpvDecorationPrefetchINTEL = 5902, + SpvDecorationStallEnableINTEL = 5905, + SpvDecorationFuseLoopsInFunctionINTEL = 5907, + SpvDecorationMathOpDSPModeINTEL = 5909, + SpvDecorationAliasScopeINTEL = 5914, + SpvDecorationNoAliasINTEL = 5915, + SpvDecorationInitiationIntervalINTEL = 5917, + SpvDecorationMaxConcurrencyINTEL = 5918, + SpvDecorationPipelineEnableINTEL = 5919, + SpvDecorationBufferLocationINTEL = 5921, + SpvDecorationIOPipeStorageINTEL = 5944, + SpvDecorationFunctionFloatingPointModeINTEL = 6080, + SpvDecorationSingleElementVectorINTEL = 6085, + SpvDecorationVectorComputeCallableFunctionINTEL = 6087, + SpvDecorationMediaBlockIOINTEL = 6140, + SpvDecorationStallFreeINTEL = 6151, + SpvDecorationFPMaxErrorDecorationINTEL = 6170, + SpvDecorationLatencyControlLabelINTEL = 6172, + SpvDecorationLatencyControlConstraintINTEL = 6173, + SpvDecorationConduitKernelArgumentINTEL = 6175, + SpvDecorationRegisterMapKernelArgumentINTEL = 6176, + SpvDecorationMMHostInterfaceAddressWidthINTEL = 6177, + SpvDecorationMMHostInterfaceDataWidthINTEL = 6178, + SpvDecorationMMHostInterfaceLatencyINTEL = 6179, + SpvDecorationMMHostInterfaceReadWriteModeINTEL = 6180, + SpvDecorationMMHostInterfaceMaxBurstINTEL = 6181, + SpvDecorationMMHostInterfaceWaitRequestINTEL = 6182, + SpvDecorationStableKernelArgumentINTEL = 6183, + SpvDecorationHostAccessINTEL = 6188, + SpvDecorationInitModeINTEL = 6190, + SpvDecorationImplementInRegisterMapINTEL = 6191, + SpvDecorationConditionalINTEL = 6247, + SpvDecorationCacheControlLoadINTEL = 6442, + SpvDecorationCacheControlStoreINTEL = 6443, + SpvDecorationMax = 0x7fffffff, +} SpvDecoration; + +typedef enum SpvBuiltIn_ { + SpvBuiltInPosition = 0, + SpvBuiltInPointSize = 1, + SpvBuiltInClipDistance = 3, + SpvBuiltInCullDistance = 4, + SpvBuiltInVertexId = 5, + SpvBuiltInInstanceId = 6, + SpvBuiltInPrimitiveId = 7, + SpvBuiltInInvocationId = 8, + SpvBuiltInLayer = 9, + SpvBuiltInViewportIndex = 10, + SpvBuiltInTessLevelOuter = 11, + SpvBuiltInTessLevelInner = 12, + SpvBuiltInTessCoord = 13, + SpvBuiltInPatchVertices = 14, + SpvBuiltInFragCoord = 15, + SpvBuiltInPointCoord = 16, + SpvBuiltInFrontFacing = 17, + SpvBuiltInSampleId = 18, + SpvBuiltInSamplePosition = 19, + SpvBuiltInSampleMask = 20, + SpvBuiltInFragDepth = 22, + SpvBuiltInHelperInvocation = 23, + SpvBuiltInNumWorkgroups = 24, + SpvBuiltInWorkgroupSize = 25, + SpvBuiltInWorkgroupId = 26, + SpvBuiltInLocalInvocationId = 27, + SpvBuiltInGlobalInvocationId = 28, + SpvBuiltInLocalInvocationIndex = 29, + SpvBuiltInWorkDim = 30, + SpvBuiltInGlobalSize = 31, + SpvBuiltInEnqueuedWorkgroupSize = 32, + SpvBuiltInGlobalOffset = 33, + SpvBuiltInGlobalLinearId = 34, + SpvBuiltInSubgroupSize = 36, + SpvBuiltInSubgroupMaxSize = 37, + SpvBuiltInNumSubgroups = 38, + SpvBuiltInNumEnqueuedSubgroups = 39, + SpvBuiltInSubgroupId = 40, + SpvBuiltInSubgroupLocalInvocationId = 41, + SpvBuiltInVertexIndex = 42, + SpvBuiltInInstanceIndex = 43, + SpvBuiltInCoreIDARM = 4160, + SpvBuiltInCoreCountARM = 4161, + SpvBuiltInCoreMaxIDARM = 4162, + SpvBuiltInWarpIDARM = 4163, + SpvBuiltInWarpMaxIDARM = 4164, + SpvBuiltInSubgroupEqMask = 4416, + SpvBuiltInSubgroupEqMaskKHR = 4416, + SpvBuiltInSubgroupGeMask = 4417, + SpvBuiltInSubgroupGeMaskKHR = 4417, + SpvBuiltInSubgroupGtMask = 4418, + SpvBuiltInSubgroupGtMaskKHR = 4418, + SpvBuiltInSubgroupLeMask = 4419, + SpvBuiltInSubgroupLeMaskKHR = 4419, + SpvBuiltInSubgroupLtMask = 4420, + SpvBuiltInSubgroupLtMaskKHR = 4420, + SpvBuiltInBaseVertex = 4424, + SpvBuiltInBaseInstance = 4425, + SpvBuiltInDrawIndex = 4426, + SpvBuiltInPrimitiveShadingRateKHR = 4432, + SpvBuiltInDeviceIndex = 4438, + SpvBuiltInViewIndex = 4440, + SpvBuiltInShadingRateKHR = 4444, + SpvBuiltInTileOffsetQCOM = 4492, + SpvBuiltInTileDimensionQCOM = 4493, + SpvBuiltInTileApronSizeQCOM = 4494, + SpvBuiltInBaryCoordNoPerspAMD = 4992, + SpvBuiltInBaryCoordNoPerspCentroidAMD = 4993, + SpvBuiltInBaryCoordNoPerspSampleAMD = 4994, + SpvBuiltInBaryCoordSmoothAMD = 4995, + SpvBuiltInBaryCoordSmoothCentroidAMD = 4996, + SpvBuiltInBaryCoordSmoothSampleAMD = 4997, + SpvBuiltInBaryCoordPullModelAMD = 4998, + SpvBuiltInFragStencilRefEXT = 5014, + SpvBuiltInRemainingRecursionLevelsAMDX = 5021, + SpvBuiltInShaderIndexAMDX = 5073, + SpvBuiltInViewportMaskNV = 5253, + SpvBuiltInSecondaryPositionNV = 5257, + SpvBuiltInSecondaryViewportMaskNV = 5258, + SpvBuiltInPositionPerViewNV = 5261, + SpvBuiltInViewportMaskPerViewNV = 5262, + SpvBuiltInFullyCoveredEXT = 5264, + SpvBuiltInTaskCountNV = 5274, + SpvBuiltInPrimitiveCountNV = 5275, + SpvBuiltInPrimitiveIndicesNV = 5276, + SpvBuiltInClipDistancePerViewNV = 5277, + SpvBuiltInCullDistancePerViewNV = 5278, + SpvBuiltInLayerPerViewNV = 5279, + SpvBuiltInMeshViewCountNV = 5280, + SpvBuiltInMeshViewIndicesNV = 5281, + SpvBuiltInBaryCoordKHR = 5286, + SpvBuiltInBaryCoordNV = 5286, + SpvBuiltInBaryCoordNoPerspKHR = 5287, + SpvBuiltInBaryCoordNoPerspNV = 5287, + SpvBuiltInFragSizeEXT = 5292, + SpvBuiltInFragmentSizeNV = 5292, + SpvBuiltInFragInvocationCountEXT = 5293, + SpvBuiltInInvocationsPerPixelNV = 5293, + SpvBuiltInPrimitivePointIndicesEXT = 5294, + SpvBuiltInPrimitiveLineIndicesEXT = 5295, + SpvBuiltInPrimitiveTriangleIndicesEXT = 5296, + SpvBuiltInCullPrimitiveEXT = 5299, + SpvBuiltInLaunchIdKHR = 5319, + SpvBuiltInLaunchIdNV = 5319, + SpvBuiltInLaunchSizeKHR = 5320, + SpvBuiltInLaunchSizeNV = 5320, + SpvBuiltInWorldRayOriginKHR = 5321, + SpvBuiltInWorldRayOriginNV = 5321, + SpvBuiltInWorldRayDirectionKHR = 5322, + SpvBuiltInWorldRayDirectionNV = 5322, + SpvBuiltInObjectRayOriginKHR = 5323, + SpvBuiltInObjectRayOriginNV = 5323, + SpvBuiltInObjectRayDirectionKHR = 5324, + SpvBuiltInObjectRayDirectionNV = 5324, + SpvBuiltInRayTminKHR = 5325, + SpvBuiltInRayTminNV = 5325, + SpvBuiltInRayTmaxKHR = 5326, + SpvBuiltInRayTmaxNV = 5326, + SpvBuiltInInstanceCustomIndexKHR = 5327, + SpvBuiltInInstanceCustomIndexNV = 5327, + SpvBuiltInObjectToWorldKHR = 5330, + SpvBuiltInObjectToWorldNV = 5330, + SpvBuiltInWorldToObjectKHR = 5331, + SpvBuiltInWorldToObjectNV = 5331, + SpvBuiltInHitTNV = 5332, + SpvBuiltInHitKindKHR = 5333, + SpvBuiltInHitKindNV = 5333, + SpvBuiltInCurrentRayTimeNV = 5334, + SpvBuiltInHitTriangleVertexPositionsKHR = 5335, + SpvBuiltInHitMicroTriangleVertexPositionsNV = 5337, + SpvBuiltInHitMicroTriangleVertexBarycentricsNV = 5344, + SpvBuiltInIncomingRayFlagsKHR = 5351, + SpvBuiltInIncomingRayFlagsNV = 5351, + SpvBuiltInRayGeometryIndexKHR = 5352, + SpvBuiltInHitIsSphereNV = 5359, + SpvBuiltInHitIsLSSNV = 5360, + SpvBuiltInHitSpherePositionNV = 5361, + SpvBuiltInWarpsPerSMNV = 5374, + SpvBuiltInSMCountNV = 5375, + SpvBuiltInWarpIDNV = 5376, + SpvBuiltInSMIDNV = 5377, + SpvBuiltInHitLSSPositionsNV = 5396, + SpvBuiltInHitKindFrontFacingMicroTriangleNV = 5405, + SpvBuiltInHitKindBackFacingMicroTriangleNV = 5406, + SpvBuiltInHitSphereRadiusNV = 5420, + SpvBuiltInHitLSSRadiiNV = 5421, + SpvBuiltInClusterIDNV = 5436, + SpvBuiltInCullMaskKHR = 6021, + SpvBuiltInMax = 0x7fffffff, +} SpvBuiltIn; + +typedef enum SpvSelectionControlShift_ { + SpvSelectionControlFlattenShift = 0, + SpvSelectionControlDontFlattenShift = 1, + SpvSelectionControlMax = 0x7fffffff, +} SpvSelectionControlShift; + +typedef enum SpvSelectionControlMask_ { + SpvSelectionControlMaskNone = 0, + SpvSelectionControlFlattenMask = 0x00000001, + SpvSelectionControlDontFlattenMask = 0x00000002, +} SpvSelectionControlMask; + +typedef enum SpvLoopControlShift_ { + SpvLoopControlUnrollShift = 0, + SpvLoopControlDontUnrollShift = 1, + SpvLoopControlDependencyInfiniteShift = 2, + SpvLoopControlDependencyLengthShift = 3, + SpvLoopControlMinIterationsShift = 4, + SpvLoopControlMaxIterationsShift = 5, + SpvLoopControlIterationMultipleShift = 6, + SpvLoopControlPeelCountShift = 7, + SpvLoopControlPartialCountShift = 8, + SpvLoopControlInitiationIntervalINTELShift = 16, + SpvLoopControlMaxConcurrencyINTELShift = 17, + SpvLoopControlDependencyArrayINTELShift = 18, + SpvLoopControlPipelineEnableINTELShift = 19, + SpvLoopControlLoopCoalesceINTELShift = 20, + SpvLoopControlMaxInterleavingINTELShift = 21, + SpvLoopControlSpeculatedIterationsINTELShift = 22, + SpvLoopControlNoFusionINTELShift = 23, + SpvLoopControlLoopCountINTELShift = 24, + SpvLoopControlMaxReinvocationDelayINTELShift = 25, + SpvLoopControlMax = 0x7fffffff, +} SpvLoopControlShift; + +typedef enum SpvLoopControlMask_ { + SpvLoopControlMaskNone = 0, + SpvLoopControlUnrollMask = 0x00000001, + SpvLoopControlDontUnrollMask = 0x00000002, + SpvLoopControlDependencyInfiniteMask = 0x00000004, + SpvLoopControlDependencyLengthMask = 0x00000008, + SpvLoopControlMinIterationsMask = 0x00000010, + SpvLoopControlMaxIterationsMask = 0x00000020, + SpvLoopControlIterationMultipleMask = 0x00000040, + SpvLoopControlPeelCountMask = 0x00000080, + SpvLoopControlPartialCountMask = 0x00000100, + SpvLoopControlInitiationIntervalINTELMask = 0x00010000, + SpvLoopControlMaxConcurrencyINTELMask = 0x00020000, + SpvLoopControlDependencyArrayINTELMask = 0x00040000, + SpvLoopControlPipelineEnableINTELMask = 0x00080000, + SpvLoopControlLoopCoalesceINTELMask = 0x00100000, + SpvLoopControlMaxInterleavingINTELMask = 0x00200000, + SpvLoopControlSpeculatedIterationsINTELMask = 0x00400000, + SpvLoopControlNoFusionINTELMask = 0x00800000, + SpvLoopControlLoopCountINTELMask = 0x01000000, + SpvLoopControlMaxReinvocationDelayINTELMask = 0x02000000, +} SpvLoopControlMask; + +typedef enum SpvFunctionControlShift_ { + SpvFunctionControlInlineShift = 0, + SpvFunctionControlDontInlineShift = 1, + SpvFunctionControlPureShift = 2, + SpvFunctionControlConstShift = 3, + SpvFunctionControlOptNoneEXTShift = 16, + SpvFunctionControlOptNoneINTELShift = 16, + SpvFunctionControlMax = 0x7fffffff, +} SpvFunctionControlShift; + +typedef enum SpvFunctionControlMask_ { + SpvFunctionControlMaskNone = 0, + SpvFunctionControlInlineMask = 0x00000001, + SpvFunctionControlDontInlineMask = 0x00000002, + SpvFunctionControlPureMask = 0x00000004, + SpvFunctionControlConstMask = 0x00000008, + SpvFunctionControlOptNoneEXTMask = 0x00010000, + SpvFunctionControlOptNoneINTELMask = 0x00010000, +} SpvFunctionControlMask; + +typedef enum SpvMemorySemanticsShift_ { + SpvMemorySemanticsAcquireShift = 1, + SpvMemorySemanticsReleaseShift = 2, + SpvMemorySemanticsAcquireReleaseShift = 3, + SpvMemorySemanticsSequentiallyConsistentShift = 4, + SpvMemorySemanticsUniformMemoryShift = 6, + SpvMemorySemanticsSubgroupMemoryShift = 7, + SpvMemorySemanticsWorkgroupMemoryShift = 8, + SpvMemorySemanticsCrossWorkgroupMemoryShift = 9, + SpvMemorySemanticsAtomicCounterMemoryShift = 10, + SpvMemorySemanticsImageMemoryShift = 11, + SpvMemorySemanticsOutputMemoryShift = 12, + SpvMemorySemanticsOutputMemoryKHRShift = 12, + SpvMemorySemanticsMakeAvailableShift = 13, + SpvMemorySemanticsMakeAvailableKHRShift = 13, + SpvMemorySemanticsMakeVisibleShift = 14, + SpvMemorySemanticsMakeVisibleKHRShift = 14, + SpvMemorySemanticsVolatileShift = 15, + SpvMemorySemanticsMax = 0x7fffffff, +} SpvMemorySemanticsShift; + +typedef enum SpvMemorySemanticsMask_ { + SpvMemorySemanticsMaskNone = 0, + SpvMemorySemanticsAcquireMask = 0x00000002, + SpvMemorySemanticsReleaseMask = 0x00000004, + SpvMemorySemanticsAcquireReleaseMask = 0x00000008, + SpvMemorySemanticsSequentiallyConsistentMask = 0x00000010, + SpvMemorySemanticsUniformMemoryMask = 0x00000040, + SpvMemorySemanticsSubgroupMemoryMask = 0x00000080, + SpvMemorySemanticsWorkgroupMemoryMask = 0x00000100, + SpvMemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, + SpvMemorySemanticsAtomicCounterMemoryMask = 0x00000400, + SpvMemorySemanticsImageMemoryMask = 0x00000800, + SpvMemorySemanticsOutputMemoryMask = 0x00001000, + SpvMemorySemanticsOutputMemoryKHRMask = 0x00001000, + SpvMemorySemanticsMakeAvailableMask = 0x00002000, + SpvMemorySemanticsMakeAvailableKHRMask = 0x00002000, + SpvMemorySemanticsMakeVisibleMask = 0x00004000, + SpvMemorySemanticsMakeVisibleKHRMask = 0x00004000, + SpvMemorySemanticsVolatileMask = 0x00008000, +} SpvMemorySemanticsMask; + +typedef enum SpvMemoryAccessShift_ { + SpvMemoryAccessVolatileShift = 0, + SpvMemoryAccessAlignedShift = 1, + SpvMemoryAccessNontemporalShift = 2, + SpvMemoryAccessMakePointerAvailableShift = 3, + SpvMemoryAccessMakePointerAvailableKHRShift = 3, + SpvMemoryAccessMakePointerVisibleShift = 4, + SpvMemoryAccessMakePointerVisibleKHRShift = 4, + SpvMemoryAccessNonPrivatePointerShift = 5, + SpvMemoryAccessNonPrivatePointerKHRShift = 5, + SpvMemoryAccessAliasScopeINTELMaskShift = 16, + SpvMemoryAccessNoAliasINTELMaskShift = 17, + SpvMemoryAccessMax = 0x7fffffff, +} SpvMemoryAccessShift; + +typedef enum SpvMemoryAccessMask_ { + SpvMemoryAccessMaskNone = 0, + SpvMemoryAccessVolatileMask = 0x00000001, + SpvMemoryAccessAlignedMask = 0x00000002, + SpvMemoryAccessNontemporalMask = 0x00000004, + SpvMemoryAccessMakePointerAvailableMask = 0x00000008, + SpvMemoryAccessMakePointerAvailableKHRMask = 0x00000008, + SpvMemoryAccessMakePointerVisibleMask = 0x00000010, + SpvMemoryAccessMakePointerVisibleKHRMask = 0x00000010, + SpvMemoryAccessNonPrivatePointerMask = 0x00000020, + SpvMemoryAccessNonPrivatePointerKHRMask = 0x00000020, + SpvMemoryAccessAliasScopeINTELMaskMask = 0x00010000, + SpvMemoryAccessNoAliasINTELMaskMask = 0x00020000, +} SpvMemoryAccessMask; + +typedef enum SpvScope_ { + SpvScopeCrossDevice = 0, + SpvScopeDevice = 1, + SpvScopeWorkgroup = 2, + SpvScopeSubgroup = 3, + SpvScopeInvocation = 4, + SpvScopeQueueFamily = 5, + SpvScopeQueueFamilyKHR = 5, + SpvScopeShaderCallKHR = 6, + SpvScopeMax = 0x7fffffff, +} SpvScope; + +typedef enum SpvGroupOperation_ { + SpvGroupOperationReduce = 0, + SpvGroupOperationInclusiveScan = 1, + SpvGroupOperationExclusiveScan = 2, + SpvGroupOperationClusteredReduce = 3, + SpvGroupOperationPartitionedReduceNV = 6, + SpvGroupOperationPartitionedInclusiveScanNV = 7, + SpvGroupOperationPartitionedExclusiveScanNV = 8, + SpvGroupOperationMax = 0x7fffffff, +} SpvGroupOperation; + +typedef enum SpvKernelEnqueueFlags_ { + SpvKernelEnqueueFlagsNoWait = 0, + SpvKernelEnqueueFlagsWaitKernel = 1, + SpvKernelEnqueueFlagsWaitWorkGroup = 2, + SpvKernelEnqueueFlagsMax = 0x7fffffff, +} SpvKernelEnqueueFlags; + +typedef enum SpvKernelProfilingInfoShift_ { + SpvKernelProfilingInfoCmdExecTimeShift = 0, + SpvKernelProfilingInfoMax = 0x7fffffff, +} SpvKernelProfilingInfoShift; + +typedef enum SpvKernelProfilingInfoMask_ { + SpvKernelProfilingInfoMaskNone = 0, + SpvKernelProfilingInfoCmdExecTimeMask = 0x00000001, +} SpvKernelProfilingInfoMask; + +typedef enum SpvCapability_ { + SpvCapabilityMatrix = 0, + SpvCapabilityShader = 1, + SpvCapabilityGeometry = 2, + SpvCapabilityTessellation = 3, + SpvCapabilityAddresses = 4, + SpvCapabilityLinkage = 5, + SpvCapabilityKernel = 6, + SpvCapabilityVector16 = 7, + SpvCapabilityFloat16Buffer = 8, + SpvCapabilityFloat16 = 9, + SpvCapabilityFloat64 = 10, + SpvCapabilityInt64 = 11, + SpvCapabilityInt64Atomics = 12, + SpvCapabilityImageBasic = 13, + SpvCapabilityImageReadWrite = 14, + SpvCapabilityImageMipmap = 15, + SpvCapabilityPipes = 17, + SpvCapabilityGroups = 18, + SpvCapabilityDeviceEnqueue = 19, + SpvCapabilityLiteralSampler = 20, + SpvCapabilityAtomicStorage = 21, + SpvCapabilityInt16 = 22, + SpvCapabilityTessellationPointSize = 23, + SpvCapabilityGeometryPointSize = 24, + SpvCapabilityImageGatherExtended = 25, + SpvCapabilityStorageImageMultisample = 27, + SpvCapabilityUniformBufferArrayDynamicIndexing = 28, + SpvCapabilitySampledImageArrayDynamicIndexing = 29, + SpvCapabilityStorageBufferArrayDynamicIndexing = 30, + SpvCapabilityStorageImageArrayDynamicIndexing = 31, + SpvCapabilityClipDistance = 32, + SpvCapabilityCullDistance = 33, + SpvCapabilityImageCubeArray = 34, + SpvCapabilitySampleRateShading = 35, + SpvCapabilityImageRect = 36, + SpvCapabilitySampledRect = 37, + SpvCapabilityGenericPointer = 38, + SpvCapabilityInt8 = 39, + SpvCapabilityInputAttachment = 40, + SpvCapabilitySparseResidency = 41, + SpvCapabilityMinLod = 42, + SpvCapabilitySampled1D = 43, + SpvCapabilityImage1D = 44, + SpvCapabilitySampledCubeArray = 45, + SpvCapabilitySampledBuffer = 46, + SpvCapabilityImageBuffer = 47, + SpvCapabilityImageMSArray = 48, + SpvCapabilityStorageImageExtendedFormats = 49, + SpvCapabilityImageQuery = 50, + SpvCapabilityDerivativeControl = 51, + SpvCapabilityInterpolationFunction = 52, + SpvCapabilityTransformFeedback = 53, + SpvCapabilityGeometryStreams = 54, + SpvCapabilityStorageImageReadWithoutFormat = 55, + SpvCapabilityStorageImageWriteWithoutFormat = 56, + SpvCapabilityMultiViewport = 57, + SpvCapabilitySubgroupDispatch = 58, + SpvCapabilityNamedBarrier = 59, + SpvCapabilityPipeStorage = 60, + SpvCapabilityGroupNonUniform = 61, + SpvCapabilityGroupNonUniformVote = 62, + SpvCapabilityGroupNonUniformArithmetic = 63, + SpvCapabilityGroupNonUniformBallot = 64, + SpvCapabilityGroupNonUniformShuffle = 65, + SpvCapabilityGroupNonUniformShuffleRelative = 66, + SpvCapabilityGroupNonUniformClustered = 67, + SpvCapabilityGroupNonUniformQuad = 68, + SpvCapabilityShaderLayer = 69, + SpvCapabilityShaderViewportIndex = 70, + SpvCapabilityUniformDecoration = 71, + SpvCapabilityCoreBuiltinsARM = 4165, + SpvCapabilityTileImageColorReadAccessEXT = 4166, + SpvCapabilityTileImageDepthReadAccessEXT = 4167, + SpvCapabilityTileImageStencilReadAccessEXT = 4168, + SpvCapabilityTensorsARM = 4174, + SpvCapabilityStorageTensorArrayDynamicIndexingARM = 4175, + SpvCapabilityStorageTensorArrayNonUniformIndexingARM = 4176, + SpvCapabilityGraphARM = 4191, + SpvCapabilityCooperativeMatrixLayoutsARM = 4201, + SpvCapabilityFloat8EXT = 4212, + SpvCapabilityFloat8CooperativeMatrixEXT = 4213, + SpvCapabilityFragmentShadingRateKHR = 4422, + SpvCapabilitySubgroupBallotKHR = 4423, + SpvCapabilityDrawParameters = 4427, + SpvCapabilityWorkgroupMemoryExplicitLayoutKHR = 4428, + SpvCapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR = 4429, + SpvCapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR = 4430, + SpvCapabilitySubgroupVoteKHR = 4431, + SpvCapabilityStorageBuffer16BitAccess = 4433, + SpvCapabilityStorageUniformBufferBlock16 = 4433, + SpvCapabilityStorageUniform16 = 4434, + SpvCapabilityUniformAndStorageBuffer16BitAccess = 4434, + SpvCapabilityStoragePushConstant16 = 4435, + SpvCapabilityStorageInputOutput16 = 4436, + SpvCapabilityDeviceGroup = 4437, + SpvCapabilityMultiView = 4439, + SpvCapabilityVariablePointersStorageBuffer = 4441, + SpvCapabilityVariablePointers = 4442, + SpvCapabilityAtomicStorageOps = 4445, + SpvCapabilitySampleMaskPostDepthCoverage = 4447, + SpvCapabilityStorageBuffer8BitAccess = 4448, + SpvCapabilityUniformAndStorageBuffer8BitAccess = 4449, + SpvCapabilityStoragePushConstant8 = 4450, + SpvCapabilityDenormPreserve = 4464, + SpvCapabilityDenormFlushToZero = 4465, + SpvCapabilitySignedZeroInfNanPreserve = 4466, + SpvCapabilityRoundingModeRTE = 4467, + SpvCapabilityRoundingModeRTZ = 4468, + SpvCapabilityRayQueryProvisionalKHR = 4471, + SpvCapabilityRayQueryKHR = 4472, + SpvCapabilityUntypedPointersKHR = 4473, + SpvCapabilityRayTraversalPrimitiveCullingKHR = 4478, + SpvCapabilityRayTracingKHR = 4479, + SpvCapabilityTextureSampleWeightedQCOM = 4484, + SpvCapabilityTextureBoxFilterQCOM = 4485, + SpvCapabilityTextureBlockMatchQCOM = 4486, + SpvCapabilityTileShadingQCOM = 4495, + SpvCapabilityCooperativeMatrixConversionQCOM = 4496, + SpvCapabilityTextureBlockMatch2QCOM = 4498, + SpvCapabilityFloat16ImageAMD = 5008, + SpvCapabilityImageGatherBiasLodAMD = 5009, + SpvCapabilityFragmentMaskAMD = 5010, + SpvCapabilityStencilExportEXT = 5013, + SpvCapabilityImageReadWriteLodAMD = 5015, + SpvCapabilityInt64ImageEXT = 5016, + SpvCapabilityShaderClockKHR = 5055, + SpvCapabilityShaderEnqueueAMDX = 5067, + SpvCapabilityQuadControlKHR = 5087, + SpvCapabilityInt4TypeINTEL = 5112, + SpvCapabilityInt4CooperativeMatrixINTEL = 5114, + SpvCapabilityBFloat16TypeKHR = 5116, + SpvCapabilityBFloat16DotProductKHR = 5117, + SpvCapabilityBFloat16CooperativeMatrixKHR = 5118, + SpvCapabilitySampleMaskOverrideCoverageNV = 5249, + SpvCapabilityGeometryShaderPassthroughNV = 5251, + SpvCapabilityShaderViewportIndexLayerEXT = 5254, + SpvCapabilityShaderViewportIndexLayerNV = 5254, + SpvCapabilityShaderViewportMaskNV = 5255, + SpvCapabilityShaderStereoViewNV = 5259, + SpvCapabilityPerViewAttributesNV = 5260, + SpvCapabilityFragmentFullyCoveredEXT = 5265, + SpvCapabilityMeshShadingNV = 5266, + SpvCapabilityImageFootprintNV = 5282, + SpvCapabilityMeshShadingEXT = 5283, + SpvCapabilityFragmentBarycentricKHR = 5284, + SpvCapabilityFragmentBarycentricNV = 5284, + SpvCapabilityComputeDerivativeGroupQuadsKHR = 5288, + SpvCapabilityComputeDerivativeGroupQuadsNV = 5288, + SpvCapabilityFragmentDensityEXT = 5291, + SpvCapabilityShadingRateNV = 5291, + SpvCapabilityGroupNonUniformPartitionedNV = 5297, + SpvCapabilityShaderNonUniform = 5301, + SpvCapabilityShaderNonUniformEXT = 5301, + SpvCapabilityRuntimeDescriptorArray = 5302, + SpvCapabilityRuntimeDescriptorArrayEXT = 5302, + SpvCapabilityInputAttachmentArrayDynamicIndexing = 5303, + SpvCapabilityInputAttachmentArrayDynamicIndexingEXT = 5303, + SpvCapabilityUniformTexelBufferArrayDynamicIndexing = 5304, + SpvCapabilityUniformTexelBufferArrayDynamicIndexingEXT = 5304, + SpvCapabilityStorageTexelBufferArrayDynamicIndexing = 5305, + SpvCapabilityStorageTexelBufferArrayDynamicIndexingEXT = 5305, + SpvCapabilityUniformBufferArrayNonUniformIndexing = 5306, + SpvCapabilityUniformBufferArrayNonUniformIndexingEXT = 5306, + SpvCapabilitySampledImageArrayNonUniformIndexing = 5307, + SpvCapabilitySampledImageArrayNonUniformIndexingEXT = 5307, + SpvCapabilityStorageBufferArrayNonUniformIndexing = 5308, + SpvCapabilityStorageBufferArrayNonUniformIndexingEXT = 5308, + SpvCapabilityStorageImageArrayNonUniformIndexing = 5309, + SpvCapabilityStorageImageArrayNonUniformIndexingEXT = 5309, + SpvCapabilityInputAttachmentArrayNonUniformIndexing = 5310, + SpvCapabilityInputAttachmentArrayNonUniformIndexingEXT = 5310, + SpvCapabilityUniformTexelBufferArrayNonUniformIndexing = 5311, + SpvCapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311, + SpvCapabilityStorageTexelBufferArrayNonUniformIndexing = 5312, + SpvCapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312, + SpvCapabilityRayTracingPositionFetchKHR = 5336, + SpvCapabilityRayTracingNV = 5340, + SpvCapabilityRayTracingMotionBlurNV = 5341, + SpvCapabilityVulkanMemoryModel = 5345, + SpvCapabilityVulkanMemoryModelKHR = 5345, + SpvCapabilityVulkanMemoryModelDeviceScope = 5346, + SpvCapabilityVulkanMemoryModelDeviceScopeKHR = 5346, + SpvCapabilityPhysicalStorageBufferAddresses = 5347, + SpvCapabilityPhysicalStorageBufferAddressesEXT = 5347, + SpvCapabilityComputeDerivativeGroupLinearKHR = 5350, + SpvCapabilityComputeDerivativeGroupLinearNV = 5350, + SpvCapabilityRayTracingProvisionalKHR = 5353, + SpvCapabilityCooperativeMatrixNV = 5357, + SpvCapabilityFragmentShaderSampleInterlockEXT = 5363, + SpvCapabilityFragmentShaderShadingRateInterlockEXT = 5372, + SpvCapabilityShaderSMBuiltinsNV = 5373, + SpvCapabilityFragmentShaderPixelInterlockEXT = 5378, + SpvCapabilityDemoteToHelperInvocation = 5379, + SpvCapabilityDemoteToHelperInvocationEXT = 5379, + SpvCapabilityDisplacementMicromapNV = 5380, + SpvCapabilityRayTracingOpacityMicromapEXT = 5381, + SpvCapabilityShaderInvocationReorderNV = 5383, + SpvCapabilityBindlessTextureNV = 5390, + SpvCapabilityRayQueryPositionFetchKHR = 5391, + SpvCapabilityCooperativeVectorNV = 5394, + SpvCapabilityAtomicFloat16VectorNV = 5404, + SpvCapabilityRayTracingDisplacementMicromapNV = 5409, + SpvCapabilityRawAccessChainsNV = 5414, + SpvCapabilityRayTracingSpheresGeometryNV = 5418, + SpvCapabilityRayTracingLinearSweptSpheresGeometryNV = 5419, + SpvCapabilityCooperativeMatrixReductionsNV = 5430, + SpvCapabilityCooperativeMatrixConversionsNV = 5431, + SpvCapabilityCooperativeMatrixPerElementOperationsNV = 5432, + SpvCapabilityCooperativeMatrixTensorAddressingNV = 5433, + SpvCapabilityCooperativeMatrixBlockLoadsNV = 5434, + SpvCapabilityCooperativeVectorTrainingNV = 5435, + SpvCapabilityRayTracingClusterAccelerationStructureNV = 5437, + SpvCapabilityTensorAddressingNV = 5439, + SpvCapabilitySubgroupShuffleINTEL = 5568, + SpvCapabilitySubgroupBufferBlockIOINTEL = 5569, + SpvCapabilitySubgroupImageBlockIOINTEL = 5570, + SpvCapabilitySubgroupImageMediaBlockIOINTEL = 5579, + SpvCapabilityRoundToInfinityINTEL = 5582, + SpvCapabilityFloatingPointModeINTEL = 5583, + SpvCapabilityIntegerFunctions2INTEL = 5584, + SpvCapabilityFunctionPointersINTEL = 5603, + SpvCapabilityIndirectReferencesINTEL = 5604, + SpvCapabilityAsmINTEL = 5606, + SpvCapabilityAtomicFloat32MinMaxEXT = 5612, + SpvCapabilityAtomicFloat64MinMaxEXT = 5613, + SpvCapabilityAtomicFloat16MinMaxEXT = 5616, + SpvCapabilityVectorComputeINTEL = 5617, + SpvCapabilityVectorAnyINTEL = 5619, + SpvCapabilityExpectAssumeKHR = 5629, + SpvCapabilitySubgroupAvcMotionEstimationINTEL = 5696, + SpvCapabilitySubgroupAvcMotionEstimationIntraINTEL = 5697, + SpvCapabilitySubgroupAvcMotionEstimationChromaINTEL = 5698, + SpvCapabilityVariableLengthArrayINTEL = 5817, + SpvCapabilityFunctionFloatControlINTEL = 5821, + SpvCapabilityFPGAMemoryAttributesINTEL = 5824, + SpvCapabilityFPFastMathModeINTEL = 5837, + SpvCapabilityArbitraryPrecisionIntegersINTEL = 5844, + SpvCapabilityArbitraryPrecisionFloatingPointINTEL = 5845, + SpvCapabilityUnstructuredLoopControlsINTEL = 5886, + SpvCapabilityFPGALoopControlsINTEL = 5888, + SpvCapabilityKernelAttributesINTEL = 5892, + SpvCapabilityFPGAKernelAttributesINTEL = 5897, + SpvCapabilityFPGAMemoryAccessesINTEL = 5898, + SpvCapabilityFPGAClusterAttributesINTEL = 5904, + SpvCapabilityLoopFuseINTEL = 5906, + SpvCapabilityFPGADSPControlINTEL = 5908, + SpvCapabilityMemoryAccessAliasingINTEL = 5910, + SpvCapabilityFPGAInvocationPipeliningAttributesINTEL = 5916, + SpvCapabilityFPGABufferLocationINTEL = 5920, + SpvCapabilityArbitraryPrecisionFixedPointINTEL = 5922, + SpvCapabilityUSMStorageClassesINTEL = 5935, + SpvCapabilityRuntimeAlignedAttributeINTEL = 5939, + SpvCapabilityIOPipesINTEL = 5943, + SpvCapabilityBlockingPipesINTEL = 5945, + SpvCapabilityFPGARegINTEL = 5948, + SpvCapabilityDotProductInputAll = 6016, + SpvCapabilityDotProductInputAllKHR = 6016, + SpvCapabilityDotProductInput4x8Bit = 6017, + SpvCapabilityDotProductInput4x8BitKHR = 6017, + SpvCapabilityDotProductInput4x8BitPacked = 6018, + SpvCapabilityDotProductInput4x8BitPackedKHR = 6018, + SpvCapabilityDotProduct = 6019, + SpvCapabilityDotProductKHR = 6019, + SpvCapabilityRayCullMaskKHR = 6020, + SpvCapabilityCooperativeMatrixKHR = 6022, + SpvCapabilityReplicatedCompositesEXT = 6024, + SpvCapabilityBitInstructions = 6025, + SpvCapabilityGroupNonUniformRotateKHR = 6026, + SpvCapabilityFloatControls2 = 6029, + SpvCapabilityFMAKHR = 6030, + SpvCapabilityAtomicFloat32AddEXT = 6033, + SpvCapabilityAtomicFloat64AddEXT = 6034, + SpvCapabilityLongCompositesINTEL = 6089, + SpvCapabilityOptNoneEXT = 6094, + SpvCapabilityOptNoneINTEL = 6094, + SpvCapabilityAtomicFloat16AddEXT = 6095, + SpvCapabilityDebugInfoModuleINTEL = 6114, + SpvCapabilityBFloat16ConversionINTEL = 6115, + SpvCapabilitySplitBarrierINTEL = 6141, + SpvCapabilityArithmeticFenceEXT = 6144, + SpvCapabilityFPGAClusterAttributesV2INTEL = 6150, + SpvCapabilityFPGAKernelAttributesv2INTEL = 6161, + SpvCapabilityTaskSequenceINTEL = 6162, + SpvCapabilityFPMaxErrorINTEL = 6169, + SpvCapabilityFPGALatencyControlINTEL = 6171, + SpvCapabilityFPGAArgumentInterfacesINTEL = 6174, + SpvCapabilityGlobalVariableHostAccessINTEL = 6187, + SpvCapabilityGlobalVariableFPGADecorationsINTEL = 6189, + SpvCapabilitySubgroupBufferPrefetchINTEL = 6220, + SpvCapabilitySubgroup2DBlockIOINTEL = 6228, + SpvCapabilitySubgroup2DBlockTransformINTEL = 6229, + SpvCapabilitySubgroup2DBlockTransposeINTEL = 6230, + SpvCapabilitySubgroupMatrixMultiplyAccumulateINTEL = 6236, + SpvCapabilityTernaryBitwiseFunctionINTEL = 6241, + SpvCapabilityUntypedVariableLengthArrayINTEL = 6243, + SpvCapabilitySpecConditionalINTEL = 6245, + SpvCapabilityFunctionVariantsINTEL = 6246, + SpvCapabilityGroupUniformArithmeticKHR = 6400, + SpvCapabilityTensorFloat32RoundingINTEL = 6425, + SpvCapabilityMaskedGatherScatterINTEL = 6427, + SpvCapabilityCacheControlsINTEL = 6441, + SpvCapabilityRegisterLimitsINTEL = 6460, + SpvCapabilityBindlessImagesINTEL = 6528, + SpvCapabilityMax = 0x7fffffff, +} SpvCapability; + +typedef enum SpvRayFlagsShift_ { + SpvRayFlagsOpaqueKHRShift = 0, + SpvRayFlagsNoOpaqueKHRShift = 1, + SpvRayFlagsTerminateOnFirstHitKHRShift = 2, + SpvRayFlagsSkipClosestHitShaderKHRShift = 3, + SpvRayFlagsCullBackFacingTrianglesKHRShift = 4, + SpvRayFlagsCullFrontFacingTrianglesKHRShift = 5, + SpvRayFlagsCullOpaqueKHRShift = 6, + SpvRayFlagsCullNoOpaqueKHRShift = 7, + SpvRayFlagsSkipBuiltinPrimitivesNVShift = 8, + SpvRayFlagsSkipTrianglesKHRShift = 8, + SpvRayFlagsSkipAABBsKHRShift = 9, + SpvRayFlagsForceOpacityMicromap2StateEXTShift = 10, + SpvRayFlagsMax = 0x7fffffff, +} SpvRayFlagsShift; + +typedef enum SpvRayFlagsMask_ { + SpvRayFlagsMaskNone = 0, + SpvRayFlagsOpaqueKHRMask = 0x00000001, + SpvRayFlagsNoOpaqueKHRMask = 0x00000002, + SpvRayFlagsTerminateOnFirstHitKHRMask = 0x00000004, + SpvRayFlagsSkipClosestHitShaderKHRMask = 0x00000008, + SpvRayFlagsCullBackFacingTrianglesKHRMask = 0x00000010, + SpvRayFlagsCullFrontFacingTrianglesKHRMask = 0x00000020, + SpvRayFlagsCullOpaqueKHRMask = 0x00000040, + SpvRayFlagsCullNoOpaqueKHRMask = 0x00000080, + SpvRayFlagsSkipBuiltinPrimitivesNVMask = 0x00000100, + SpvRayFlagsSkipTrianglesKHRMask = 0x00000100, + SpvRayFlagsSkipAABBsKHRMask = 0x00000200, + SpvRayFlagsForceOpacityMicromap2StateEXTMask = 0x00000400, +} SpvRayFlagsMask; + +typedef enum SpvRayQueryIntersection_ { + SpvRayQueryIntersectionRayQueryCandidateIntersectionKHR = 0, + SpvRayQueryIntersectionRayQueryCommittedIntersectionKHR = 1, + SpvRayQueryIntersectionMax = 0x7fffffff, +} SpvRayQueryIntersection; + +typedef enum SpvRayQueryCommittedIntersectionType_ { + SpvRayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionNoneKHR = 0, + SpvRayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionTriangleKHR = 1, + SpvRayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionGeneratedKHR = 2, + SpvRayQueryCommittedIntersectionTypeMax = 0x7fffffff, +} SpvRayQueryCommittedIntersectionType; + +typedef enum SpvRayQueryCandidateIntersectionType_ { + SpvRayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionTriangleKHR = 0, + SpvRayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionAABBKHR = 1, + SpvRayQueryCandidateIntersectionTypeMax = 0x7fffffff, +} SpvRayQueryCandidateIntersectionType; + +typedef enum SpvFragmentShadingRateShift_ { + SpvFragmentShadingRateVertical2PixelsShift = 0, + SpvFragmentShadingRateVertical4PixelsShift = 1, + SpvFragmentShadingRateHorizontal2PixelsShift = 2, + SpvFragmentShadingRateHorizontal4PixelsShift = 3, + SpvFragmentShadingRateMax = 0x7fffffff, +} SpvFragmentShadingRateShift; + +typedef enum SpvFragmentShadingRateMask_ { + SpvFragmentShadingRateMaskNone = 0, + SpvFragmentShadingRateVertical2PixelsMask = 0x00000001, + SpvFragmentShadingRateVertical4PixelsMask = 0x00000002, + SpvFragmentShadingRateHorizontal2PixelsMask = 0x00000004, + SpvFragmentShadingRateHorizontal4PixelsMask = 0x00000008, +} SpvFragmentShadingRateMask; + +typedef enum SpvFPDenormMode_ { + SpvFPDenormModePreserve = 0, + SpvFPDenormModeFlushToZero = 1, + SpvFPDenormModeMax = 0x7fffffff, +} SpvFPDenormMode; + +typedef enum SpvFPOperationMode_ { + SpvFPOperationModeIEEE = 0, + SpvFPOperationModeALT = 1, + SpvFPOperationModeMax = 0x7fffffff, +} SpvFPOperationMode; + +typedef enum SpvQuantizationModes_ { + SpvQuantizationModesTRN = 0, + SpvQuantizationModesTRN_ZERO = 1, + SpvQuantizationModesRND = 2, + SpvQuantizationModesRND_ZERO = 3, + SpvQuantizationModesRND_INF = 4, + SpvQuantizationModesRND_MIN_INF = 5, + SpvQuantizationModesRND_CONV = 6, + SpvQuantizationModesRND_CONV_ODD = 7, + SpvQuantizationModesMax = 0x7fffffff, +} SpvQuantizationModes; + +typedef enum SpvOverflowModes_ { + SpvOverflowModesWRAP = 0, + SpvOverflowModesSAT = 1, + SpvOverflowModesSAT_ZERO = 2, + SpvOverflowModesSAT_SYM = 3, + SpvOverflowModesMax = 0x7fffffff, +} SpvOverflowModes; + +typedef enum SpvPackedVectorFormat_ { + SpvPackedVectorFormatPackedVectorFormat4x8Bit = 0, + SpvPackedVectorFormatPackedVectorFormat4x8BitKHR = 0, + SpvPackedVectorFormatMax = 0x7fffffff, +} SpvPackedVectorFormat; + +typedef enum SpvCooperativeMatrixOperandsShift_ { + SpvCooperativeMatrixOperandsMatrixASignedComponentsKHRShift = 0, + SpvCooperativeMatrixOperandsMatrixBSignedComponentsKHRShift = 1, + SpvCooperativeMatrixOperandsMatrixCSignedComponentsKHRShift = 2, + SpvCooperativeMatrixOperandsMatrixResultSignedComponentsKHRShift = 3, + SpvCooperativeMatrixOperandsSaturatingAccumulationKHRShift = 4, + SpvCooperativeMatrixOperandsMax = 0x7fffffff, +} SpvCooperativeMatrixOperandsShift; + +typedef enum SpvCooperativeMatrixOperandsMask_ { + SpvCooperativeMatrixOperandsMaskNone = 0, + SpvCooperativeMatrixOperandsMatrixASignedComponentsKHRMask = 0x00000001, + SpvCooperativeMatrixOperandsMatrixBSignedComponentsKHRMask = 0x00000002, + SpvCooperativeMatrixOperandsMatrixCSignedComponentsKHRMask = 0x00000004, + SpvCooperativeMatrixOperandsMatrixResultSignedComponentsKHRMask = 0x00000008, + SpvCooperativeMatrixOperandsSaturatingAccumulationKHRMask = 0x00000010, +} SpvCooperativeMatrixOperandsMask; + +typedef enum SpvCooperativeMatrixLayout_ { + SpvCooperativeMatrixLayoutRowMajorKHR = 0, + SpvCooperativeMatrixLayoutColumnMajorKHR = 1, + SpvCooperativeMatrixLayoutRowBlockedInterleavedARM = 4202, + SpvCooperativeMatrixLayoutColumnBlockedInterleavedARM = 4203, + SpvCooperativeMatrixLayoutMax = 0x7fffffff, +} SpvCooperativeMatrixLayout; + +typedef enum SpvCooperativeMatrixUse_ { + SpvCooperativeMatrixUseMatrixAKHR = 0, + SpvCooperativeMatrixUseMatrixBKHR = 1, + SpvCooperativeMatrixUseMatrixAccumulatorKHR = 2, + SpvCooperativeMatrixUseMax = 0x7fffffff, +} SpvCooperativeMatrixUse; + +typedef enum SpvCooperativeMatrixReduceShift_ { + SpvCooperativeMatrixReduceRowShift = 0, + SpvCooperativeMatrixReduceColumnShift = 1, + SpvCooperativeMatrixReduce2x2Shift = 2, + SpvCooperativeMatrixReduceMax = 0x7fffffff, +} SpvCooperativeMatrixReduceShift; + +typedef enum SpvCooperativeMatrixReduceMask_ { + SpvCooperativeMatrixReduceMaskNone = 0, + SpvCooperativeMatrixReduceRowMask = 0x00000001, + SpvCooperativeMatrixReduceColumnMask = 0x00000002, + SpvCooperativeMatrixReduce2x2Mask = 0x00000004, +} SpvCooperativeMatrixReduceMask; + +typedef enum SpvTensorClampMode_ { + SpvTensorClampModeUndefined = 0, + SpvTensorClampModeConstant = 1, + SpvTensorClampModeClampToEdge = 2, + SpvTensorClampModeRepeat = 3, + SpvTensorClampModeRepeatMirrored = 4, + SpvTensorClampModeMax = 0x7fffffff, +} SpvTensorClampMode; + +typedef enum SpvTensorAddressingOperandsShift_ { + SpvTensorAddressingOperandsTensorViewShift = 0, + SpvTensorAddressingOperandsDecodeFuncShift = 1, + SpvTensorAddressingOperandsMax = 0x7fffffff, +} SpvTensorAddressingOperandsShift; + +typedef enum SpvTensorAddressingOperandsMask_ { + SpvTensorAddressingOperandsMaskNone = 0, + SpvTensorAddressingOperandsTensorViewMask = 0x00000001, + SpvTensorAddressingOperandsDecodeFuncMask = 0x00000002, +} SpvTensorAddressingOperandsMask; + +typedef enum SpvTensorOperandsShift_ { + SpvTensorOperandsNontemporalARMShift = 0, + SpvTensorOperandsOutOfBoundsValueARMShift = 1, + SpvTensorOperandsMakeElementAvailableARMShift = 2, + SpvTensorOperandsMakeElementVisibleARMShift = 3, + SpvTensorOperandsNonPrivateElementARMShift = 4, + SpvTensorOperandsMax = 0x7fffffff, +} SpvTensorOperandsShift; + +typedef enum SpvTensorOperandsMask_ { + SpvTensorOperandsMaskNone = 0, + SpvTensorOperandsNontemporalARMMask = 0x00000001, + SpvTensorOperandsOutOfBoundsValueARMMask = 0x00000002, + SpvTensorOperandsMakeElementAvailableARMMask = 0x00000004, + SpvTensorOperandsMakeElementVisibleARMMask = 0x00000008, + SpvTensorOperandsNonPrivateElementARMMask = 0x00000010, +} SpvTensorOperandsMask; + +typedef enum SpvInitializationModeQualifier_ { + SpvInitializationModeQualifierInitOnDeviceReprogramINTEL = 0, + SpvInitializationModeQualifierInitOnDeviceResetINTEL = 1, + SpvInitializationModeQualifierMax = 0x7fffffff, +} SpvInitializationModeQualifier; + +typedef enum SpvHostAccessQualifier_ { + SpvHostAccessQualifierNoneINTEL = 0, + SpvHostAccessQualifierReadINTEL = 1, + SpvHostAccessQualifierWriteINTEL = 2, + SpvHostAccessQualifierReadWriteINTEL = 3, + SpvHostAccessQualifierMax = 0x7fffffff, +} SpvHostAccessQualifier; + +typedef enum SpvLoadCacheControl_ { + SpvLoadCacheControlUncachedINTEL = 0, + SpvLoadCacheControlCachedINTEL = 1, + SpvLoadCacheControlStreamingINTEL = 2, + SpvLoadCacheControlInvalidateAfterReadINTEL = 3, + SpvLoadCacheControlConstCachedINTEL = 4, + SpvLoadCacheControlMax = 0x7fffffff, +} SpvLoadCacheControl; + +typedef enum SpvStoreCacheControl_ { + SpvStoreCacheControlUncachedINTEL = 0, + SpvStoreCacheControlWriteThroughINTEL = 1, + SpvStoreCacheControlWriteBackINTEL = 2, + SpvStoreCacheControlStreamingINTEL = 3, + SpvStoreCacheControlMax = 0x7fffffff, +} SpvStoreCacheControl; + +typedef enum SpvNamedMaximumNumberOfRegisters_ { + SpvNamedMaximumNumberOfRegistersAutoINTEL = 0, + SpvNamedMaximumNumberOfRegistersMax = 0x7fffffff, +} SpvNamedMaximumNumberOfRegisters; + +typedef enum SpvMatrixMultiplyAccumulateOperandsShift_ { + SpvMatrixMultiplyAccumulateOperandsMatrixASignedComponentsINTELShift = 0, + SpvMatrixMultiplyAccumulateOperandsMatrixBSignedComponentsINTELShift = 1, + SpvMatrixMultiplyAccumulateOperandsMatrixCBFloat16INTELShift = 2, + SpvMatrixMultiplyAccumulateOperandsMatrixResultBFloat16INTELShift = 3, + SpvMatrixMultiplyAccumulateOperandsMatrixAPackedInt8INTELShift = 4, + SpvMatrixMultiplyAccumulateOperandsMatrixBPackedInt8INTELShift = 5, + SpvMatrixMultiplyAccumulateOperandsMatrixAPackedInt4INTELShift = 6, + SpvMatrixMultiplyAccumulateOperandsMatrixBPackedInt4INTELShift = 7, + SpvMatrixMultiplyAccumulateOperandsMatrixATF32INTELShift = 8, + SpvMatrixMultiplyAccumulateOperandsMatrixBTF32INTELShift = 9, + SpvMatrixMultiplyAccumulateOperandsMatrixAPackedFloat16INTELShift = 10, + SpvMatrixMultiplyAccumulateOperandsMatrixBPackedFloat16INTELShift = 11, + SpvMatrixMultiplyAccumulateOperandsMatrixAPackedBFloat16INTELShift = 12, + SpvMatrixMultiplyAccumulateOperandsMatrixBPackedBFloat16INTELShift = 13, + SpvMatrixMultiplyAccumulateOperandsMax = 0x7fffffff, +} SpvMatrixMultiplyAccumulateOperandsShift; + +typedef enum SpvMatrixMultiplyAccumulateOperandsMask_ { + SpvMatrixMultiplyAccumulateOperandsMaskNone = 0, + SpvMatrixMultiplyAccumulateOperandsMatrixASignedComponentsINTELMask = 0x00000001, + SpvMatrixMultiplyAccumulateOperandsMatrixBSignedComponentsINTELMask = 0x00000002, + SpvMatrixMultiplyAccumulateOperandsMatrixCBFloat16INTELMask = 0x00000004, + SpvMatrixMultiplyAccumulateOperandsMatrixResultBFloat16INTELMask = 0x00000008, + SpvMatrixMultiplyAccumulateOperandsMatrixAPackedInt8INTELMask = 0x00000010, + SpvMatrixMultiplyAccumulateOperandsMatrixBPackedInt8INTELMask = 0x00000020, + SpvMatrixMultiplyAccumulateOperandsMatrixAPackedInt4INTELMask = 0x00000040, + SpvMatrixMultiplyAccumulateOperandsMatrixBPackedInt4INTELMask = 0x00000080, + SpvMatrixMultiplyAccumulateOperandsMatrixATF32INTELMask = 0x00000100, + SpvMatrixMultiplyAccumulateOperandsMatrixBTF32INTELMask = 0x00000200, + SpvMatrixMultiplyAccumulateOperandsMatrixAPackedFloat16INTELMask = 0x00000400, + SpvMatrixMultiplyAccumulateOperandsMatrixBPackedFloat16INTELMask = 0x00000800, + SpvMatrixMultiplyAccumulateOperandsMatrixAPackedBFloat16INTELMask = 0x00001000, + SpvMatrixMultiplyAccumulateOperandsMatrixBPackedBFloat16INTELMask = 0x00002000, +} SpvMatrixMultiplyAccumulateOperandsMask; + +typedef enum SpvRawAccessChainOperandsShift_ { + SpvRawAccessChainOperandsRobustnessPerComponentNVShift = 0, + SpvRawAccessChainOperandsRobustnessPerElementNVShift = 1, + SpvRawAccessChainOperandsMax = 0x7fffffff, +} SpvRawAccessChainOperandsShift; + +typedef enum SpvRawAccessChainOperandsMask_ { + SpvRawAccessChainOperandsMaskNone = 0, + SpvRawAccessChainOperandsRobustnessPerComponentNVMask = 0x00000001, + SpvRawAccessChainOperandsRobustnessPerElementNVMask = 0x00000002, +} SpvRawAccessChainOperandsMask; + +typedef enum SpvFPEncoding_ { + SpvFPEncodingBFloat16KHR = 0, + SpvFPEncodingFloat8E4M3EXT = 4214, + SpvFPEncodingFloat8E5M2EXT = 4215, + SpvFPEncodingMax = 0x7fffffff, +} SpvFPEncoding; + +typedef enum SpvCooperativeVectorMatrixLayout_ { + SpvCooperativeVectorMatrixLayoutRowMajorNV = 0, + SpvCooperativeVectorMatrixLayoutColumnMajorNV = 1, + SpvCooperativeVectorMatrixLayoutInferencingOptimalNV = 2, + SpvCooperativeVectorMatrixLayoutTrainingOptimalNV = 3, + SpvCooperativeVectorMatrixLayoutMax = 0x7fffffff, +} SpvCooperativeVectorMatrixLayout; + +typedef enum SpvComponentType_ { + SpvComponentTypeFloat16NV = 0, + SpvComponentTypeFloat32NV = 1, + SpvComponentTypeFloat64NV = 2, + SpvComponentTypeSignedInt8NV = 3, + SpvComponentTypeSignedInt16NV = 4, + SpvComponentTypeSignedInt32NV = 5, + SpvComponentTypeSignedInt64NV = 6, + SpvComponentTypeUnsignedInt8NV = 7, + SpvComponentTypeUnsignedInt16NV = 8, + SpvComponentTypeUnsignedInt32NV = 9, + SpvComponentTypeUnsignedInt64NV = 10, + SpvComponentTypeSignedInt8PackedNV = 1000491000, + SpvComponentTypeUnsignedInt8PackedNV = 1000491001, + SpvComponentTypeFloatE4M3NV = 1000491002, + SpvComponentTypeFloatE5M2NV = 1000491003, + SpvComponentTypeMax = 0x7fffffff, +} SpvComponentType; + +typedef enum SpvOp_ { + SpvOpNop = 0, + SpvOpUndef = 1, + SpvOpSourceContinued = 2, + SpvOpSource = 3, + SpvOpSourceExtension = 4, + SpvOpName = 5, + SpvOpMemberName = 6, + SpvOpString = 7, + SpvOpLine = 8, + SpvOpExtension = 10, + SpvOpExtInstImport = 11, + SpvOpExtInst = 12, + SpvOpMemoryModel = 14, + SpvOpEntryPoint = 15, + SpvOpExecutionMode = 16, + SpvOpCapability = 17, + SpvOpTypeVoid = 19, + SpvOpTypeBool = 20, + SpvOpTypeInt = 21, + SpvOpTypeFloat = 22, + SpvOpTypeVector = 23, + SpvOpTypeMatrix = 24, + SpvOpTypeImage = 25, + SpvOpTypeSampler = 26, + SpvOpTypeSampledImage = 27, + SpvOpTypeArray = 28, + SpvOpTypeRuntimeArray = 29, + SpvOpTypeStruct = 30, + SpvOpTypeOpaque = 31, + SpvOpTypePointer = 32, + SpvOpTypeFunction = 33, + SpvOpTypeEvent = 34, + SpvOpTypeDeviceEvent = 35, + SpvOpTypeReserveId = 36, + SpvOpTypeQueue = 37, + SpvOpTypePipe = 38, + SpvOpTypeForwardPointer = 39, + SpvOpConstantTrue = 41, + SpvOpConstantFalse = 42, + SpvOpConstant = 43, + SpvOpConstantComposite = 44, + SpvOpConstantSampler = 45, + SpvOpConstantNull = 46, + SpvOpSpecConstantTrue = 48, + SpvOpSpecConstantFalse = 49, + SpvOpSpecConstant = 50, + SpvOpSpecConstantComposite = 51, + SpvOpSpecConstantOp = 52, + SpvOpFunction = 54, + SpvOpFunctionParameter = 55, + SpvOpFunctionEnd = 56, + SpvOpFunctionCall = 57, + SpvOpVariable = 59, + SpvOpImageTexelPointer = 60, + SpvOpLoad = 61, + SpvOpStore = 62, + SpvOpCopyMemory = 63, + SpvOpCopyMemorySized = 64, + SpvOpAccessChain = 65, + SpvOpInBoundsAccessChain = 66, + SpvOpPtrAccessChain = 67, + SpvOpArrayLength = 68, + SpvOpGenericPtrMemSemantics = 69, + SpvOpInBoundsPtrAccessChain = 70, + SpvOpDecorate = 71, + SpvOpMemberDecorate = 72, + SpvOpDecorationGroup = 73, + SpvOpGroupDecorate = 74, + SpvOpGroupMemberDecorate = 75, + SpvOpVectorExtractDynamic = 77, + SpvOpVectorInsertDynamic = 78, + SpvOpVectorShuffle = 79, + SpvOpCompositeConstruct = 80, + SpvOpCompositeExtract = 81, + SpvOpCompositeInsert = 82, + SpvOpCopyObject = 83, + SpvOpTranspose = 84, + SpvOpSampledImage = 86, + SpvOpImageSampleImplicitLod = 87, + SpvOpImageSampleExplicitLod = 88, + SpvOpImageSampleDrefImplicitLod = 89, + SpvOpImageSampleDrefExplicitLod = 90, + SpvOpImageSampleProjImplicitLod = 91, + SpvOpImageSampleProjExplicitLod = 92, + SpvOpImageSampleProjDrefImplicitLod = 93, + SpvOpImageSampleProjDrefExplicitLod = 94, + SpvOpImageFetch = 95, + SpvOpImageGather = 96, + SpvOpImageDrefGather = 97, + SpvOpImageRead = 98, + SpvOpImageWrite = 99, + SpvOpImage = 100, + SpvOpImageQueryFormat = 101, + SpvOpImageQueryOrder = 102, + SpvOpImageQuerySizeLod = 103, + SpvOpImageQuerySize = 104, + SpvOpImageQueryLod = 105, + SpvOpImageQueryLevels = 106, + SpvOpImageQuerySamples = 107, + SpvOpConvertFToU = 109, + SpvOpConvertFToS = 110, + SpvOpConvertSToF = 111, + SpvOpConvertUToF = 112, + SpvOpUConvert = 113, + SpvOpSConvert = 114, + SpvOpFConvert = 115, + SpvOpQuantizeToF16 = 116, + SpvOpConvertPtrToU = 117, + SpvOpSatConvertSToU = 118, + SpvOpSatConvertUToS = 119, + SpvOpConvertUToPtr = 120, + SpvOpPtrCastToGeneric = 121, + SpvOpGenericCastToPtr = 122, + SpvOpGenericCastToPtrExplicit = 123, + SpvOpBitcast = 124, + SpvOpSNegate = 126, + SpvOpFNegate = 127, + SpvOpIAdd = 128, + SpvOpFAdd = 129, + SpvOpISub = 130, + SpvOpFSub = 131, + SpvOpIMul = 132, + SpvOpFMul = 133, + SpvOpUDiv = 134, + SpvOpSDiv = 135, + SpvOpFDiv = 136, + SpvOpUMod = 137, + SpvOpSRem = 138, + SpvOpSMod = 139, + SpvOpFRem = 140, + SpvOpFMod = 141, + SpvOpVectorTimesScalar = 142, + SpvOpMatrixTimesScalar = 143, + SpvOpVectorTimesMatrix = 144, + SpvOpMatrixTimesVector = 145, + SpvOpMatrixTimesMatrix = 146, + SpvOpOuterProduct = 147, + SpvOpDot = 148, + SpvOpIAddCarry = 149, + SpvOpISubBorrow = 150, + SpvOpUMulExtended = 151, + SpvOpSMulExtended = 152, + SpvOpAny = 154, + SpvOpAll = 155, + SpvOpIsNan = 156, + SpvOpIsInf = 157, + SpvOpIsFinite = 158, + SpvOpIsNormal = 159, + SpvOpSignBitSet = 160, + SpvOpLessOrGreater = 161, + SpvOpOrdered = 162, + SpvOpUnordered = 163, + SpvOpLogicalEqual = 164, + SpvOpLogicalNotEqual = 165, + SpvOpLogicalOr = 166, + SpvOpLogicalAnd = 167, + SpvOpLogicalNot = 168, + SpvOpSelect = 169, + SpvOpIEqual = 170, + SpvOpINotEqual = 171, + SpvOpUGreaterThan = 172, + SpvOpSGreaterThan = 173, + SpvOpUGreaterThanEqual = 174, + SpvOpSGreaterThanEqual = 175, + SpvOpULessThan = 176, + SpvOpSLessThan = 177, + SpvOpULessThanEqual = 178, + SpvOpSLessThanEqual = 179, + SpvOpFOrdEqual = 180, + SpvOpFUnordEqual = 181, + SpvOpFOrdNotEqual = 182, + SpvOpFUnordNotEqual = 183, + SpvOpFOrdLessThan = 184, + SpvOpFUnordLessThan = 185, + SpvOpFOrdGreaterThan = 186, + SpvOpFUnordGreaterThan = 187, + SpvOpFOrdLessThanEqual = 188, + SpvOpFUnordLessThanEqual = 189, + SpvOpFOrdGreaterThanEqual = 190, + SpvOpFUnordGreaterThanEqual = 191, + SpvOpShiftRightLogical = 194, + SpvOpShiftRightArithmetic = 195, + SpvOpShiftLeftLogical = 196, + SpvOpBitwiseOr = 197, + SpvOpBitwiseXor = 198, + SpvOpBitwiseAnd = 199, + SpvOpNot = 200, + SpvOpBitFieldInsert = 201, + SpvOpBitFieldSExtract = 202, + SpvOpBitFieldUExtract = 203, + SpvOpBitReverse = 204, + SpvOpBitCount = 205, + SpvOpDPdx = 207, + SpvOpDPdy = 208, + SpvOpFwidth = 209, + SpvOpDPdxFine = 210, + SpvOpDPdyFine = 211, + SpvOpFwidthFine = 212, + SpvOpDPdxCoarse = 213, + SpvOpDPdyCoarse = 214, + SpvOpFwidthCoarse = 215, + SpvOpEmitVertex = 218, + SpvOpEndPrimitive = 219, + SpvOpEmitStreamVertex = 220, + SpvOpEndStreamPrimitive = 221, + SpvOpControlBarrier = 224, + SpvOpMemoryBarrier = 225, + SpvOpAtomicLoad = 227, + SpvOpAtomicStore = 228, + SpvOpAtomicExchange = 229, + SpvOpAtomicCompareExchange = 230, + SpvOpAtomicCompareExchangeWeak = 231, + SpvOpAtomicIIncrement = 232, + SpvOpAtomicIDecrement = 233, + SpvOpAtomicIAdd = 234, + SpvOpAtomicISub = 235, + SpvOpAtomicSMin = 236, + SpvOpAtomicUMin = 237, + SpvOpAtomicSMax = 238, + SpvOpAtomicUMax = 239, + SpvOpAtomicAnd = 240, + SpvOpAtomicOr = 241, + SpvOpAtomicXor = 242, + SpvOpPhi = 245, + SpvOpLoopMerge = 246, + SpvOpSelectionMerge = 247, + SpvOpLabel = 248, + SpvOpBranch = 249, + SpvOpBranchConditional = 250, + SpvOpSwitch = 251, + SpvOpKill = 252, + SpvOpReturn = 253, + SpvOpReturnValue = 254, + SpvOpUnreachable = 255, + SpvOpLifetimeStart = 256, + SpvOpLifetimeStop = 257, + SpvOpGroupAsyncCopy = 259, + SpvOpGroupWaitEvents = 260, + SpvOpGroupAll = 261, + SpvOpGroupAny = 262, + SpvOpGroupBroadcast = 263, + SpvOpGroupIAdd = 264, + SpvOpGroupFAdd = 265, + SpvOpGroupFMin = 266, + SpvOpGroupUMin = 267, + SpvOpGroupSMin = 268, + SpvOpGroupFMax = 269, + SpvOpGroupUMax = 270, + SpvOpGroupSMax = 271, + SpvOpReadPipe = 274, + SpvOpWritePipe = 275, + SpvOpReservedReadPipe = 276, + SpvOpReservedWritePipe = 277, + SpvOpReserveReadPipePackets = 278, + SpvOpReserveWritePipePackets = 279, + SpvOpCommitReadPipe = 280, + SpvOpCommitWritePipe = 281, + SpvOpIsValidReserveId = 282, + SpvOpGetNumPipePackets = 283, + SpvOpGetMaxPipePackets = 284, + SpvOpGroupReserveReadPipePackets = 285, + SpvOpGroupReserveWritePipePackets = 286, + SpvOpGroupCommitReadPipe = 287, + SpvOpGroupCommitWritePipe = 288, + SpvOpEnqueueMarker = 291, + SpvOpEnqueueKernel = 292, + SpvOpGetKernelNDrangeSubGroupCount = 293, + SpvOpGetKernelNDrangeMaxSubGroupSize = 294, + SpvOpGetKernelWorkGroupSize = 295, + SpvOpGetKernelPreferredWorkGroupSizeMultiple = 296, + SpvOpRetainEvent = 297, + SpvOpReleaseEvent = 298, + SpvOpCreateUserEvent = 299, + SpvOpIsValidEvent = 300, + SpvOpSetUserEventStatus = 301, + SpvOpCaptureEventProfilingInfo = 302, + SpvOpGetDefaultQueue = 303, + SpvOpBuildNDRange = 304, + SpvOpImageSparseSampleImplicitLod = 305, + SpvOpImageSparseSampleExplicitLod = 306, + SpvOpImageSparseSampleDrefImplicitLod = 307, + SpvOpImageSparseSampleDrefExplicitLod = 308, + SpvOpImageSparseSampleProjImplicitLod = 309, + SpvOpImageSparseSampleProjExplicitLod = 310, + SpvOpImageSparseSampleProjDrefImplicitLod = 311, + SpvOpImageSparseSampleProjDrefExplicitLod = 312, + SpvOpImageSparseFetch = 313, + SpvOpImageSparseGather = 314, + SpvOpImageSparseDrefGather = 315, + SpvOpImageSparseTexelsResident = 316, + SpvOpNoLine = 317, + SpvOpAtomicFlagTestAndSet = 318, + SpvOpAtomicFlagClear = 319, + SpvOpImageSparseRead = 320, + SpvOpSizeOf = 321, + SpvOpTypePipeStorage = 322, + SpvOpConstantPipeStorage = 323, + SpvOpCreatePipeFromPipeStorage = 324, + SpvOpGetKernelLocalSizeForSubgroupCount = 325, + SpvOpGetKernelMaxNumSubgroups = 326, + SpvOpTypeNamedBarrier = 327, + SpvOpNamedBarrierInitialize = 328, + SpvOpMemoryNamedBarrier = 329, + SpvOpModuleProcessed = 330, + SpvOpExecutionModeId = 331, + SpvOpDecorateId = 332, + SpvOpGroupNonUniformElect = 333, + SpvOpGroupNonUniformAll = 334, + SpvOpGroupNonUniformAny = 335, + SpvOpGroupNonUniformAllEqual = 336, + SpvOpGroupNonUniformBroadcast = 337, + SpvOpGroupNonUniformBroadcastFirst = 338, + SpvOpGroupNonUniformBallot = 339, + SpvOpGroupNonUniformInverseBallot = 340, + SpvOpGroupNonUniformBallotBitExtract = 341, + SpvOpGroupNonUniformBallotBitCount = 342, + SpvOpGroupNonUniformBallotFindLSB = 343, + SpvOpGroupNonUniformBallotFindMSB = 344, + SpvOpGroupNonUniformShuffle = 345, + SpvOpGroupNonUniformShuffleXor = 346, + SpvOpGroupNonUniformShuffleUp = 347, + SpvOpGroupNonUniformShuffleDown = 348, + SpvOpGroupNonUniformIAdd = 349, + SpvOpGroupNonUniformFAdd = 350, + SpvOpGroupNonUniformIMul = 351, + SpvOpGroupNonUniformFMul = 352, + SpvOpGroupNonUniformSMin = 353, + SpvOpGroupNonUniformUMin = 354, + SpvOpGroupNonUniformFMin = 355, + SpvOpGroupNonUniformSMax = 356, + SpvOpGroupNonUniformUMax = 357, + SpvOpGroupNonUniformFMax = 358, + SpvOpGroupNonUniformBitwiseAnd = 359, + SpvOpGroupNonUniformBitwiseOr = 360, + SpvOpGroupNonUniformBitwiseXor = 361, + SpvOpGroupNonUniformLogicalAnd = 362, + SpvOpGroupNonUniformLogicalOr = 363, + SpvOpGroupNonUniformLogicalXor = 364, + SpvOpGroupNonUniformQuadBroadcast = 365, + SpvOpGroupNonUniformQuadSwap = 366, + SpvOpCopyLogical = 400, + SpvOpPtrEqual = 401, + SpvOpPtrNotEqual = 402, + SpvOpPtrDiff = 403, + SpvOpColorAttachmentReadEXT = 4160, + SpvOpDepthAttachmentReadEXT = 4161, + SpvOpStencilAttachmentReadEXT = 4162, + SpvOpTypeTensorARM = 4163, + SpvOpTensorReadARM = 4164, + SpvOpTensorWriteARM = 4165, + SpvOpTensorQuerySizeARM = 4166, + SpvOpGraphConstantARM = 4181, + SpvOpGraphEntryPointARM = 4182, + SpvOpGraphARM = 4183, + SpvOpGraphInputARM = 4184, + SpvOpGraphSetOutputARM = 4185, + SpvOpGraphEndARM = 4186, + SpvOpTypeGraphARM = 4190, + SpvOpTerminateInvocation = 4416, + SpvOpTypeUntypedPointerKHR = 4417, + SpvOpUntypedVariableKHR = 4418, + SpvOpUntypedAccessChainKHR = 4419, + SpvOpUntypedInBoundsAccessChainKHR = 4420, + SpvOpSubgroupBallotKHR = 4421, + SpvOpSubgroupFirstInvocationKHR = 4422, + SpvOpUntypedPtrAccessChainKHR = 4423, + SpvOpUntypedInBoundsPtrAccessChainKHR = 4424, + SpvOpUntypedArrayLengthKHR = 4425, + SpvOpUntypedPrefetchKHR = 4426, + SpvOpFmaKHR = 4427, + SpvOpSubgroupAllKHR = 4428, + SpvOpSubgroupAnyKHR = 4429, + SpvOpSubgroupAllEqualKHR = 4430, + SpvOpGroupNonUniformRotateKHR = 4431, + SpvOpSubgroupReadInvocationKHR = 4432, + SpvOpExtInstWithForwardRefsKHR = 4433, + SpvOpUntypedGroupAsyncCopyKHR = 4434, + SpvOpTraceRayKHR = 4445, + SpvOpExecuteCallableKHR = 4446, + SpvOpConvertUToAccelerationStructureKHR = 4447, + SpvOpIgnoreIntersectionKHR = 4448, + SpvOpTerminateRayKHR = 4449, + SpvOpSDot = 4450, + SpvOpSDotKHR = 4450, + SpvOpUDot = 4451, + SpvOpUDotKHR = 4451, + SpvOpSUDot = 4452, + SpvOpSUDotKHR = 4452, + SpvOpSDotAccSat = 4453, + SpvOpSDotAccSatKHR = 4453, + SpvOpUDotAccSat = 4454, + SpvOpUDotAccSatKHR = 4454, + SpvOpSUDotAccSat = 4455, + SpvOpSUDotAccSatKHR = 4455, + SpvOpTypeCooperativeMatrixKHR = 4456, + SpvOpCooperativeMatrixLoadKHR = 4457, + SpvOpCooperativeMatrixStoreKHR = 4458, + SpvOpCooperativeMatrixMulAddKHR = 4459, + SpvOpCooperativeMatrixLengthKHR = 4460, + SpvOpConstantCompositeReplicateEXT = 4461, + SpvOpSpecConstantCompositeReplicateEXT = 4462, + SpvOpCompositeConstructReplicateEXT = 4463, + SpvOpTypeRayQueryKHR = 4472, + SpvOpRayQueryInitializeKHR = 4473, + SpvOpRayQueryTerminateKHR = 4474, + SpvOpRayQueryGenerateIntersectionKHR = 4475, + SpvOpRayQueryConfirmIntersectionKHR = 4476, + SpvOpRayQueryProceedKHR = 4477, + SpvOpRayQueryGetIntersectionTypeKHR = 4479, + SpvOpImageSampleWeightedQCOM = 4480, + SpvOpImageBoxFilterQCOM = 4481, + SpvOpImageBlockMatchSSDQCOM = 4482, + SpvOpImageBlockMatchSADQCOM = 4483, + SpvOpBitCastArrayQCOM = 4497, + SpvOpImageBlockMatchWindowSSDQCOM = 4500, + SpvOpImageBlockMatchWindowSADQCOM = 4501, + SpvOpImageBlockMatchGatherSSDQCOM = 4502, + SpvOpImageBlockMatchGatherSADQCOM = 4503, + SpvOpCompositeConstructCoopMatQCOM = 4540, + SpvOpCompositeExtractCoopMatQCOM = 4541, + SpvOpExtractSubArrayQCOM = 4542, + SpvOpGroupIAddNonUniformAMD = 5000, + SpvOpGroupFAddNonUniformAMD = 5001, + SpvOpGroupFMinNonUniformAMD = 5002, + SpvOpGroupUMinNonUniformAMD = 5003, + SpvOpGroupSMinNonUniformAMD = 5004, + SpvOpGroupFMaxNonUniformAMD = 5005, + SpvOpGroupUMaxNonUniformAMD = 5006, + SpvOpGroupSMaxNonUniformAMD = 5007, + SpvOpFragmentMaskFetchAMD = 5011, + SpvOpFragmentFetchAMD = 5012, + SpvOpReadClockKHR = 5056, + SpvOpAllocateNodePayloadsAMDX = 5074, + SpvOpEnqueueNodePayloadsAMDX = 5075, + SpvOpTypeNodePayloadArrayAMDX = 5076, + SpvOpFinishWritingNodePayloadAMDX = 5078, + SpvOpNodePayloadArrayLengthAMDX = 5090, + SpvOpIsNodePayloadValidAMDX = 5101, + SpvOpConstantStringAMDX = 5103, + SpvOpSpecConstantStringAMDX = 5104, + SpvOpGroupNonUniformQuadAllKHR = 5110, + SpvOpGroupNonUniformQuadAnyKHR = 5111, + SpvOpHitObjectRecordHitMotionNV = 5249, + SpvOpHitObjectRecordHitWithIndexMotionNV = 5250, + SpvOpHitObjectRecordMissMotionNV = 5251, + SpvOpHitObjectGetWorldToObjectNV = 5252, + SpvOpHitObjectGetObjectToWorldNV = 5253, + SpvOpHitObjectGetObjectRayDirectionNV = 5254, + SpvOpHitObjectGetObjectRayOriginNV = 5255, + SpvOpHitObjectTraceRayMotionNV = 5256, + SpvOpHitObjectGetShaderRecordBufferHandleNV = 5257, + SpvOpHitObjectGetShaderBindingTableRecordIndexNV = 5258, + SpvOpHitObjectRecordEmptyNV = 5259, + SpvOpHitObjectTraceRayNV = 5260, + SpvOpHitObjectRecordHitNV = 5261, + SpvOpHitObjectRecordHitWithIndexNV = 5262, + SpvOpHitObjectRecordMissNV = 5263, + SpvOpHitObjectExecuteShaderNV = 5264, + SpvOpHitObjectGetCurrentTimeNV = 5265, + SpvOpHitObjectGetAttributesNV = 5266, + SpvOpHitObjectGetHitKindNV = 5267, + SpvOpHitObjectGetPrimitiveIndexNV = 5268, + SpvOpHitObjectGetGeometryIndexNV = 5269, + SpvOpHitObjectGetInstanceIdNV = 5270, + SpvOpHitObjectGetInstanceCustomIndexNV = 5271, + SpvOpHitObjectGetWorldRayDirectionNV = 5272, + SpvOpHitObjectGetWorldRayOriginNV = 5273, + SpvOpHitObjectGetRayTMaxNV = 5274, + SpvOpHitObjectGetRayTMinNV = 5275, + SpvOpHitObjectIsEmptyNV = 5276, + SpvOpHitObjectIsHitNV = 5277, + SpvOpHitObjectIsMissNV = 5278, + SpvOpReorderThreadWithHitObjectNV = 5279, + SpvOpReorderThreadWithHintNV = 5280, + SpvOpTypeHitObjectNV = 5281, + SpvOpImageSampleFootprintNV = 5283, + SpvOpTypeCooperativeVectorNV = 5288, + SpvOpCooperativeVectorMatrixMulNV = 5289, + SpvOpCooperativeVectorOuterProductAccumulateNV = 5290, + SpvOpCooperativeVectorReduceSumAccumulateNV = 5291, + SpvOpCooperativeVectorMatrixMulAddNV = 5292, + SpvOpCooperativeMatrixConvertNV = 5293, + SpvOpEmitMeshTasksEXT = 5294, + SpvOpSetMeshOutputsEXT = 5295, + SpvOpGroupNonUniformPartitionNV = 5296, + SpvOpWritePackedPrimitiveIndices4x8NV = 5299, + SpvOpFetchMicroTriangleVertexPositionNV = 5300, + SpvOpFetchMicroTriangleVertexBarycentricNV = 5301, + SpvOpCooperativeVectorLoadNV = 5302, + SpvOpCooperativeVectorStoreNV = 5303, + SpvOpReportIntersectionKHR = 5334, + SpvOpReportIntersectionNV = 5334, + SpvOpIgnoreIntersectionNV = 5335, + SpvOpTerminateRayNV = 5336, + SpvOpTraceNV = 5337, + SpvOpTraceMotionNV = 5338, + SpvOpTraceRayMotionNV = 5339, + SpvOpRayQueryGetIntersectionTriangleVertexPositionsKHR = 5340, + SpvOpTypeAccelerationStructureKHR = 5341, + SpvOpTypeAccelerationStructureNV = 5341, + SpvOpExecuteCallableNV = 5344, + SpvOpRayQueryGetClusterIdNV = 5345, + SpvOpRayQueryGetIntersectionClusterIdNV = 5345, + SpvOpHitObjectGetClusterIdNV = 5346, + SpvOpTypeCooperativeMatrixNV = 5358, + SpvOpCooperativeMatrixLoadNV = 5359, + SpvOpCooperativeMatrixStoreNV = 5360, + SpvOpCooperativeMatrixMulAddNV = 5361, + SpvOpCooperativeMatrixLengthNV = 5362, + SpvOpBeginInvocationInterlockEXT = 5364, + SpvOpEndInvocationInterlockEXT = 5365, + SpvOpCooperativeMatrixReduceNV = 5366, + SpvOpCooperativeMatrixLoadTensorNV = 5367, + SpvOpCooperativeMatrixStoreTensorNV = 5368, + SpvOpCooperativeMatrixPerElementOpNV = 5369, + SpvOpTypeTensorLayoutNV = 5370, + SpvOpTypeTensorViewNV = 5371, + SpvOpCreateTensorLayoutNV = 5372, + SpvOpTensorLayoutSetDimensionNV = 5373, + SpvOpTensorLayoutSetStrideNV = 5374, + SpvOpTensorLayoutSliceNV = 5375, + SpvOpTensorLayoutSetClampValueNV = 5376, + SpvOpCreateTensorViewNV = 5377, + SpvOpTensorViewSetDimensionNV = 5378, + SpvOpTensorViewSetStrideNV = 5379, + SpvOpDemoteToHelperInvocation = 5380, + SpvOpDemoteToHelperInvocationEXT = 5380, + SpvOpIsHelperInvocationEXT = 5381, + SpvOpTensorViewSetClipNV = 5382, + SpvOpTensorLayoutSetBlockSizeNV = 5384, + SpvOpCooperativeMatrixTransposeNV = 5390, + SpvOpConvertUToImageNV = 5391, + SpvOpConvertUToSamplerNV = 5392, + SpvOpConvertImageToUNV = 5393, + SpvOpConvertSamplerToUNV = 5394, + SpvOpConvertUToSampledImageNV = 5395, + SpvOpConvertSampledImageToUNV = 5396, + SpvOpSamplerImageAddressingModeNV = 5397, + SpvOpRawAccessChainNV = 5398, + SpvOpRayQueryGetIntersectionSpherePositionNV = 5427, + SpvOpRayQueryGetIntersectionSphereRadiusNV = 5428, + SpvOpRayQueryGetIntersectionLSSPositionsNV = 5429, + SpvOpRayQueryGetIntersectionLSSRadiiNV = 5430, + SpvOpRayQueryGetIntersectionLSSHitValueNV = 5431, + SpvOpHitObjectGetSpherePositionNV = 5432, + SpvOpHitObjectGetSphereRadiusNV = 5433, + SpvOpHitObjectGetLSSPositionsNV = 5434, + SpvOpHitObjectGetLSSRadiiNV = 5435, + SpvOpHitObjectIsSphereHitNV = 5436, + SpvOpHitObjectIsLSSHitNV = 5437, + SpvOpRayQueryIsSphereHitNV = 5438, + SpvOpRayQueryIsLSSHitNV = 5439, + SpvOpSubgroupShuffleINTEL = 5571, + SpvOpSubgroupShuffleDownINTEL = 5572, + SpvOpSubgroupShuffleUpINTEL = 5573, + SpvOpSubgroupShuffleXorINTEL = 5574, + SpvOpSubgroupBlockReadINTEL = 5575, + SpvOpSubgroupBlockWriteINTEL = 5576, + SpvOpSubgroupImageBlockReadINTEL = 5577, + SpvOpSubgroupImageBlockWriteINTEL = 5578, + SpvOpSubgroupImageMediaBlockReadINTEL = 5580, + SpvOpSubgroupImageMediaBlockWriteINTEL = 5581, + SpvOpUCountLeadingZerosINTEL = 5585, + SpvOpUCountTrailingZerosINTEL = 5586, + SpvOpAbsISubINTEL = 5587, + SpvOpAbsUSubINTEL = 5588, + SpvOpIAddSatINTEL = 5589, + SpvOpUAddSatINTEL = 5590, + SpvOpIAverageINTEL = 5591, + SpvOpUAverageINTEL = 5592, + SpvOpIAverageRoundedINTEL = 5593, + SpvOpUAverageRoundedINTEL = 5594, + SpvOpISubSatINTEL = 5595, + SpvOpUSubSatINTEL = 5596, + SpvOpIMul32x16INTEL = 5597, + SpvOpUMul32x16INTEL = 5598, + SpvOpConstantFunctionPointerINTEL = 5600, + SpvOpFunctionPointerCallINTEL = 5601, + SpvOpAsmTargetINTEL = 5609, + SpvOpAsmINTEL = 5610, + SpvOpAsmCallINTEL = 5611, + SpvOpAtomicFMinEXT = 5614, + SpvOpAtomicFMaxEXT = 5615, + SpvOpAssumeTrueKHR = 5630, + SpvOpExpectKHR = 5631, + SpvOpDecorateString = 5632, + SpvOpDecorateStringGOOGLE = 5632, + SpvOpMemberDecorateString = 5633, + SpvOpMemberDecorateStringGOOGLE = 5633, + SpvOpVmeImageINTEL = 5699, + SpvOpTypeVmeImageINTEL = 5700, + SpvOpTypeAvcImePayloadINTEL = 5701, + SpvOpTypeAvcRefPayloadINTEL = 5702, + SpvOpTypeAvcSicPayloadINTEL = 5703, + SpvOpTypeAvcMcePayloadINTEL = 5704, + SpvOpTypeAvcMceResultINTEL = 5705, + SpvOpTypeAvcImeResultINTEL = 5706, + SpvOpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707, + SpvOpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708, + SpvOpTypeAvcImeSingleReferenceStreaminINTEL = 5709, + SpvOpTypeAvcImeDualReferenceStreaminINTEL = 5710, + SpvOpTypeAvcRefResultINTEL = 5711, + SpvOpTypeAvcSicResultINTEL = 5712, + SpvOpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713, + SpvOpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714, + SpvOpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715, + SpvOpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716, + SpvOpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717, + SpvOpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718, + SpvOpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719, + SpvOpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720, + SpvOpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721, + SpvOpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722, + SpvOpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723, + SpvOpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724, + SpvOpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725, + SpvOpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726, + SpvOpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727, + SpvOpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728, + SpvOpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729, + SpvOpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730, + SpvOpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731, + SpvOpSubgroupAvcMceConvertToImePayloadINTEL = 5732, + SpvOpSubgroupAvcMceConvertToImeResultINTEL = 5733, + SpvOpSubgroupAvcMceConvertToRefPayloadINTEL = 5734, + SpvOpSubgroupAvcMceConvertToRefResultINTEL = 5735, + SpvOpSubgroupAvcMceConvertToSicPayloadINTEL = 5736, + SpvOpSubgroupAvcMceConvertToSicResultINTEL = 5737, + SpvOpSubgroupAvcMceGetMotionVectorsINTEL = 5738, + SpvOpSubgroupAvcMceGetInterDistortionsINTEL = 5739, + SpvOpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740, + SpvOpSubgroupAvcMceGetInterMajorShapeINTEL = 5741, + SpvOpSubgroupAvcMceGetInterMinorShapeINTEL = 5742, + SpvOpSubgroupAvcMceGetInterDirectionsINTEL = 5743, + SpvOpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744, + SpvOpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745, + SpvOpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746, + SpvOpSubgroupAvcImeInitializeINTEL = 5747, + SpvOpSubgroupAvcImeSetSingleReferenceINTEL = 5748, + SpvOpSubgroupAvcImeSetDualReferenceINTEL = 5749, + SpvOpSubgroupAvcImeRefWindowSizeINTEL = 5750, + SpvOpSubgroupAvcImeAdjustRefOffsetINTEL = 5751, + SpvOpSubgroupAvcImeConvertToMcePayloadINTEL = 5752, + SpvOpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753, + SpvOpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754, + SpvOpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755, + SpvOpSubgroupAvcImeSetWeightedSadINTEL = 5756, + SpvOpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757, + SpvOpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758, + SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759, + SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760, + SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761, + SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762, + SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763, + SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764, + SpvOpSubgroupAvcImeConvertToMceResultINTEL = 5765, + SpvOpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766, + SpvOpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767, + SpvOpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768, + SpvOpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769, + SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770, + SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771, + SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772, + SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773, + SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774, + SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775, + SpvOpSubgroupAvcImeGetBorderReachedINTEL = 5776, + SpvOpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777, + SpvOpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778, + SpvOpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779, + SpvOpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780, + SpvOpSubgroupAvcFmeInitializeINTEL = 5781, + SpvOpSubgroupAvcBmeInitializeINTEL = 5782, + SpvOpSubgroupAvcRefConvertToMcePayloadINTEL = 5783, + SpvOpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784, + SpvOpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785, + SpvOpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786, + SpvOpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787, + SpvOpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788, + SpvOpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789, + SpvOpSubgroupAvcRefConvertToMceResultINTEL = 5790, + SpvOpSubgroupAvcSicInitializeINTEL = 5791, + SpvOpSubgroupAvcSicConfigureSkcINTEL = 5792, + SpvOpSubgroupAvcSicConfigureIpeLumaINTEL = 5793, + SpvOpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794, + SpvOpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795, + SpvOpSubgroupAvcSicConvertToMcePayloadINTEL = 5796, + SpvOpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797, + SpvOpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798, + SpvOpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799, + SpvOpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800, + SpvOpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801, + SpvOpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802, + SpvOpSubgroupAvcSicEvaluateIpeINTEL = 5803, + SpvOpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804, + SpvOpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805, + SpvOpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806, + SpvOpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807, + SpvOpSubgroupAvcSicConvertToMceResultINTEL = 5808, + SpvOpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809, + SpvOpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810, + SpvOpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811, + SpvOpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812, + SpvOpSubgroupAvcSicGetIpeChromaModeINTEL = 5813, + SpvOpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814, + SpvOpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815, + SpvOpSubgroupAvcSicGetInterRawSadsINTEL = 5816, + SpvOpVariableLengthArrayINTEL = 5818, + SpvOpSaveMemoryINTEL = 5819, + SpvOpRestoreMemoryINTEL = 5820, + SpvOpArbitraryFloatSinCosPiINTEL = 5840, + SpvOpArbitraryFloatCastINTEL = 5841, + SpvOpArbitraryFloatCastFromIntINTEL = 5842, + SpvOpArbitraryFloatCastToIntINTEL = 5843, + SpvOpArbitraryFloatAddINTEL = 5846, + SpvOpArbitraryFloatSubINTEL = 5847, + SpvOpArbitraryFloatMulINTEL = 5848, + SpvOpArbitraryFloatDivINTEL = 5849, + SpvOpArbitraryFloatGTINTEL = 5850, + SpvOpArbitraryFloatGEINTEL = 5851, + SpvOpArbitraryFloatLTINTEL = 5852, + SpvOpArbitraryFloatLEINTEL = 5853, + SpvOpArbitraryFloatEQINTEL = 5854, + SpvOpArbitraryFloatRecipINTEL = 5855, + SpvOpArbitraryFloatRSqrtINTEL = 5856, + SpvOpArbitraryFloatCbrtINTEL = 5857, + SpvOpArbitraryFloatHypotINTEL = 5858, + SpvOpArbitraryFloatSqrtINTEL = 5859, + SpvOpArbitraryFloatLogINTEL = 5860, + SpvOpArbitraryFloatLog2INTEL = 5861, + SpvOpArbitraryFloatLog10INTEL = 5862, + SpvOpArbitraryFloatLog1pINTEL = 5863, + SpvOpArbitraryFloatExpINTEL = 5864, + SpvOpArbitraryFloatExp2INTEL = 5865, + SpvOpArbitraryFloatExp10INTEL = 5866, + SpvOpArbitraryFloatExpm1INTEL = 5867, + SpvOpArbitraryFloatSinINTEL = 5868, + SpvOpArbitraryFloatCosINTEL = 5869, + SpvOpArbitraryFloatSinCosINTEL = 5870, + SpvOpArbitraryFloatSinPiINTEL = 5871, + SpvOpArbitraryFloatCosPiINTEL = 5872, + SpvOpArbitraryFloatASinINTEL = 5873, + SpvOpArbitraryFloatASinPiINTEL = 5874, + SpvOpArbitraryFloatACosINTEL = 5875, + SpvOpArbitraryFloatACosPiINTEL = 5876, + SpvOpArbitraryFloatATanINTEL = 5877, + SpvOpArbitraryFloatATanPiINTEL = 5878, + SpvOpArbitraryFloatATan2INTEL = 5879, + SpvOpArbitraryFloatPowINTEL = 5880, + SpvOpArbitraryFloatPowRINTEL = 5881, + SpvOpArbitraryFloatPowNINTEL = 5882, + SpvOpLoopControlINTEL = 5887, + SpvOpAliasDomainDeclINTEL = 5911, + SpvOpAliasScopeDeclINTEL = 5912, + SpvOpAliasScopeListDeclINTEL = 5913, + SpvOpFixedSqrtINTEL = 5923, + SpvOpFixedRecipINTEL = 5924, + SpvOpFixedRsqrtINTEL = 5925, + SpvOpFixedSinINTEL = 5926, + SpvOpFixedCosINTEL = 5927, + SpvOpFixedSinCosINTEL = 5928, + SpvOpFixedSinPiINTEL = 5929, + SpvOpFixedCosPiINTEL = 5930, + SpvOpFixedSinCosPiINTEL = 5931, + SpvOpFixedLogINTEL = 5932, + SpvOpFixedExpINTEL = 5933, + SpvOpPtrCastToCrossWorkgroupINTEL = 5934, + SpvOpCrossWorkgroupCastToPtrINTEL = 5938, + SpvOpReadPipeBlockingINTEL = 5946, + SpvOpWritePipeBlockingINTEL = 5947, + SpvOpFPGARegINTEL = 5949, + SpvOpRayQueryGetRayTMinKHR = 6016, + SpvOpRayQueryGetRayFlagsKHR = 6017, + SpvOpRayQueryGetIntersectionTKHR = 6018, + SpvOpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019, + SpvOpRayQueryGetIntersectionInstanceIdKHR = 6020, + SpvOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021, + SpvOpRayQueryGetIntersectionGeometryIndexKHR = 6022, + SpvOpRayQueryGetIntersectionPrimitiveIndexKHR = 6023, + SpvOpRayQueryGetIntersectionBarycentricsKHR = 6024, + SpvOpRayQueryGetIntersectionFrontFaceKHR = 6025, + SpvOpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026, + SpvOpRayQueryGetIntersectionObjectRayDirectionKHR = 6027, + SpvOpRayQueryGetIntersectionObjectRayOriginKHR = 6028, + SpvOpRayQueryGetWorldRayDirectionKHR = 6029, + SpvOpRayQueryGetWorldRayOriginKHR = 6030, + SpvOpRayQueryGetIntersectionObjectToWorldKHR = 6031, + SpvOpRayQueryGetIntersectionWorldToObjectKHR = 6032, + SpvOpAtomicFAddEXT = 6035, + SpvOpTypeBufferSurfaceINTEL = 6086, + SpvOpTypeStructContinuedINTEL = 6090, + SpvOpConstantCompositeContinuedINTEL = 6091, + SpvOpSpecConstantCompositeContinuedINTEL = 6092, + SpvOpCompositeConstructContinuedINTEL = 6096, + SpvOpConvertFToBF16INTEL = 6116, + SpvOpConvertBF16ToFINTEL = 6117, + SpvOpControlBarrierArriveINTEL = 6142, + SpvOpControlBarrierWaitINTEL = 6143, + SpvOpArithmeticFenceEXT = 6145, + SpvOpTaskSequenceCreateINTEL = 6163, + SpvOpTaskSequenceAsyncINTEL = 6164, + SpvOpTaskSequenceGetINTEL = 6165, + SpvOpTaskSequenceReleaseINTEL = 6166, + SpvOpTypeTaskSequenceINTEL = 6199, + SpvOpSubgroupBlockPrefetchINTEL = 6221, + SpvOpSubgroup2DBlockLoadINTEL = 6231, + SpvOpSubgroup2DBlockLoadTransformINTEL = 6232, + SpvOpSubgroup2DBlockLoadTransposeINTEL = 6233, + SpvOpSubgroup2DBlockPrefetchINTEL = 6234, + SpvOpSubgroup2DBlockStoreINTEL = 6235, + SpvOpSubgroupMatrixMultiplyAccumulateINTEL = 6237, + SpvOpBitwiseFunctionINTEL = 6242, + SpvOpUntypedVariableLengthArrayINTEL = 6244, + SpvOpConditionalExtensionINTEL = 6248, + SpvOpConditionalEntryPointINTEL = 6249, + SpvOpConditionalCapabilityINTEL = 6250, + SpvOpSpecConstantTargetINTEL = 6251, + SpvOpSpecConstantArchitectureINTEL = 6252, + SpvOpSpecConstantCapabilitiesINTEL = 6253, + SpvOpConditionalCopyObjectINTEL = 6254, + SpvOpGroupIMulKHR = 6401, + SpvOpGroupFMulKHR = 6402, + SpvOpGroupBitwiseAndKHR = 6403, + SpvOpGroupBitwiseOrKHR = 6404, + SpvOpGroupBitwiseXorKHR = 6405, + SpvOpGroupLogicalAndKHR = 6406, + SpvOpGroupLogicalOrKHR = 6407, + SpvOpGroupLogicalXorKHR = 6408, + SpvOpRoundFToTF32INTEL = 6426, + SpvOpMaskedGatherINTEL = 6428, + SpvOpMaskedScatterINTEL = 6429, + SpvOpConvertHandleToImageINTEL = 6529, + SpvOpConvertHandleToSamplerINTEL = 6530, + SpvOpConvertHandleToSampledImageINTEL = 6531, + SpvOpMax = 0x7fffffff, +} SpvOp; + +#ifdef SPV_ENABLE_UTILITY_CODE +#ifndef __cplusplus +#include +#endif +inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultType) { + *hasResult = *hasResultType = false; + switch (opcode) { + default: /* unknown opcode */ break; + case SpvOpNop: *hasResult = false; *hasResultType = false; break; + case SpvOpUndef: *hasResult = true; *hasResultType = true; break; + case SpvOpSourceContinued: *hasResult = false; *hasResultType = false; break; + case SpvOpSource: *hasResult = false; *hasResultType = false; break; + case SpvOpSourceExtension: *hasResult = false; *hasResultType = false; break; + case SpvOpName: *hasResult = false; *hasResultType = false; break; + case SpvOpMemberName: *hasResult = false; *hasResultType = false; break; + case SpvOpString: *hasResult = true; *hasResultType = false; break; + case SpvOpLine: *hasResult = false; *hasResultType = false; break; + case SpvOpExtension: *hasResult = false; *hasResultType = false; break; + case SpvOpExtInstImport: *hasResult = true; *hasResultType = false; break; + case SpvOpExtInst: *hasResult = true; *hasResultType = true; break; + case SpvOpMemoryModel: *hasResult = false; *hasResultType = false; break; + case SpvOpEntryPoint: *hasResult = false; *hasResultType = false; break; + case SpvOpExecutionMode: *hasResult = false; *hasResultType = false; break; + case SpvOpCapability: *hasResult = false; *hasResultType = false; break; + case SpvOpTypeVoid: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeBool: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeInt: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeFloat: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeVector: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeMatrix: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeImage: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeSampler: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeSampledImage: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeArray: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeRuntimeArray: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeStruct: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeOpaque: *hasResult = true; *hasResultType = false; break; + case SpvOpTypePointer: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeFunction: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeEvent: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeDeviceEvent: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeReserveId: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeQueue: *hasResult = true; *hasResultType = false; break; + case SpvOpTypePipe: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeForwardPointer: *hasResult = false; *hasResultType = false; break; + case SpvOpConstantTrue: *hasResult = true; *hasResultType = true; break; + case SpvOpConstantFalse: *hasResult = true; *hasResultType = true; break; + case SpvOpConstant: *hasResult = true; *hasResultType = true; break; + case SpvOpConstantComposite: *hasResult = true; *hasResultType = true; break; + case SpvOpConstantSampler: *hasResult = true; *hasResultType = true; break; + case SpvOpConstantNull: *hasResult = true; *hasResultType = true; break; + case SpvOpSpecConstantTrue: *hasResult = true; *hasResultType = true; break; + case SpvOpSpecConstantFalse: *hasResult = true; *hasResultType = true; break; + case SpvOpSpecConstant: *hasResult = true; *hasResultType = true; break; + case SpvOpSpecConstantComposite: *hasResult = true; *hasResultType = true; break; + case SpvOpSpecConstantOp: *hasResult = true; *hasResultType = true; break; + case SpvOpFunction: *hasResult = true; *hasResultType = true; break; + case SpvOpFunctionParameter: *hasResult = true; *hasResultType = true; break; + case SpvOpFunctionEnd: *hasResult = false; *hasResultType = false; break; + case SpvOpFunctionCall: *hasResult = true; *hasResultType = true; break; + case SpvOpVariable: *hasResult = true; *hasResultType = true; break; + case SpvOpImageTexelPointer: *hasResult = true; *hasResultType = true; break; + case SpvOpLoad: *hasResult = true; *hasResultType = true; break; + case SpvOpStore: *hasResult = false; *hasResultType = false; break; + case SpvOpCopyMemory: *hasResult = false; *hasResultType = false; break; + case SpvOpCopyMemorySized: *hasResult = false; *hasResultType = false; break; + case SpvOpAccessChain: *hasResult = true; *hasResultType = true; break; + case SpvOpInBoundsAccessChain: *hasResult = true; *hasResultType = true; break; + case SpvOpPtrAccessChain: *hasResult = true; *hasResultType = true; break; + case SpvOpArrayLength: *hasResult = true; *hasResultType = true; break; + case SpvOpGenericPtrMemSemantics: *hasResult = true; *hasResultType = true; break; + case SpvOpInBoundsPtrAccessChain: *hasResult = true; *hasResultType = true; break; + case SpvOpDecorate: *hasResult = false; *hasResultType = false; break; + case SpvOpMemberDecorate: *hasResult = false; *hasResultType = false; break; + case SpvOpDecorationGroup: *hasResult = true; *hasResultType = false; break; + case SpvOpGroupDecorate: *hasResult = false; *hasResultType = false; break; + case SpvOpGroupMemberDecorate: *hasResult = false; *hasResultType = false; break; + case SpvOpVectorExtractDynamic: *hasResult = true; *hasResultType = true; break; + case SpvOpVectorInsertDynamic: *hasResult = true; *hasResultType = true; break; + case SpvOpVectorShuffle: *hasResult = true; *hasResultType = true; break; + case SpvOpCompositeConstruct: *hasResult = true; *hasResultType = true; break; + case SpvOpCompositeExtract: *hasResult = true; *hasResultType = true; break; + case SpvOpCompositeInsert: *hasResult = true; *hasResultType = true; break; + case SpvOpCopyObject: *hasResult = true; *hasResultType = true; break; + case SpvOpTranspose: *hasResult = true; *hasResultType = true; break; + case SpvOpSampledImage: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleImplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleExplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageFetch: *hasResult = true; *hasResultType = true; break; + case SpvOpImageGather: *hasResult = true; *hasResultType = true; break; + case SpvOpImageDrefGather: *hasResult = true; *hasResultType = true; break; + case SpvOpImageRead: *hasResult = true; *hasResultType = true; break; + case SpvOpImageWrite: *hasResult = false; *hasResultType = false; break; + case SpvOpImage: *hasResult = true; *hasResultType = true; break; + case SpvOpImageQueryFormat: *hasResult = true; *hasResultType = true; break; + case SpvOpImageQueryOrder: *hasResult = true; *hasResultType = true; break; + case SpvOpImageQuerySizeLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageQuerySize: *hasResult = true; *hasResultType = true; break; + case SpvOpImageQueryLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageQueryLevels: *hasResult = true; *hasResultType = true; break; + case SpvOpImageQuerySamples: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertFToU: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertFToS: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertSToF: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertUToF: *hasResult = true; *hasResultType = true; break; + case SpvOpUConvert: *hasResult = true; *hasResultType = true; break; + case SpvOpSConvert: *hasResult = true; *hasResultType = true; break; + case SpvOpFConvert: *hasResult = true; *hasResultType = true; break; + case SpvOpQuantizeToF16: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertPtrToU: *hasResult = true; *hasResultType = true; break; + case SpvOpSatConvertSToU: *hasResult = true; *hasResultType = true; break; + case SpvOpSatConvertUToS: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertUToPtr: *hasResult = true; *hasResultType = true; break; + case SpvOpPtrCastToGeneric: *hasResult = true; *hasResultType = true; break; + case SpvOpGenericCastToPtr: *hasResult = true; *hasResultType = true; break; + case SpvOpGenericCastToPtrExplicit: *hasResult = true; *hasResultType = true; break; + case SpvOpBitcast: *hasResult = true; *hasResultType = true; break; + case SpvOpSNegate: *hasResult = true; *hasResultType = true; break; + case SpvOpFNegate: *hasResult = true; *hasResultType = true; break; + case SpvOpIAdd: *hasResult = true; *hasResultType = true; break; + case SpvOpFAdd: *hasResult = true; *hasResultType = true; break; + case SpvOpISub: *hasResult = true; *hasResultType = true; break; + case SpvOpFSub: *hasResult = true; *hasResultType = true; break; + case SpvOpIMul: *hasResult = true; *hasResultType = true; break; + case SpvOpFMul: *hasResult = true; *hasResultType = true; break; + case SpvOpUDiv: *hasResult = true; *hasResultType = true; break; + case SpvOpSDiv: *hasResult = true; *hasResultType = true; break; + case SpvOpFDiv: *hasResult = true; *hasResultType = true; break; + case SpvOpUMod: *hasResult = true; *hasResultType = true; break; + case SpvOpSRem: *hasResult = true; *hasResultType = true; break; + case SpvOpSMod: *hasResult = true; *hasResultType = true; break; + case SpvOpFRem: *hasResult = true; *hasResultType = true; break; + case SpvOpFMod: *hasResult = true; *hasResultType = true; break; + case SpvOpVectorTimesScalar: *hasResult = true; *hasResultType = true; break; + case SpvOpMatrixTimesScalar: *hasResult = true; *hasResultType = true; break; + case SpvOpVectorTimesMatrix: *hasResult = true; *hasResultType = true; break; + case SpvOpMatrixTimesVector: *hasResult = true; *hasResultType = true; break; + case SpvOpMatrixTimesMatrix: *hasResult = true; *hasResultType = true; break; + case SpvOpOuterProduct: *hasResult = true; *hasResultType = true; break; + case SpvOpDot: *hasResult = true; *hasResultType = true; break; + case SpvOpIAddCarry: *hasResult = true; *hasResultType = true; break; + case SpvOpISubBorrow: *hasResult = true; *hasResultType = true; break; + case SpvOpUMulExtended: *hasResult = true; *hasResultType = true; break; + case SpvOpSMulExtended: *hasResult = true; *hasResultType = true; break; + case SpvOpAny: *hasResult = true; *hasResultType = true; break; + case SpvOpAll: *hasResult = true; *hasResultType = true; break; + case SpvOpIsNan: *hasResult = true; *hasResultType = true; break; + case SpvOpIsInf: *hasResult = true; *hasResultType = true; break; + case SpvOpIsFinite: *hasResult = true; *hasResultType = true; break; + case SpvOpIsNormal: *hasResult = true; *hasResultType = true; break; + case SpvOpSignBitSet: *hasResult = true; *hasResultType = true; break; + case SpvOpLessOrGreater: *hasResult = true; *hasResultType = true; break; + case SpvOpOrdered: *hasResult = true; *hasResultType = true; break; + case SpvOpUnordered: *hasResult = true; *hasResultType = true; break; + case SpvOpLogicalEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpLogicalNotEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpLogicalOr: *hasResult = true; *hasResultType = true; break; + case SpvOpLogicalAnd: *hasResult = true; *hasResultType = true; break; + case SpvOpLogicalNot: *hasResult = true; *hasResultType = true; break; + case SpvOpSelect: *hasResult = true; *hasResultType = true; break; + case SpvOpIEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpINotEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpUGreaterThan: *hasResult = true; *hasResultType = true; break; + case SpvOpSGreaterThan: *hasResult = true; *hasResultType = true; break; + case SpvOpUGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpSGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpULessThan: *hasResult = true; *hasResultType = true; break; + case SpvOpSLessThan: *hasResult = true; *hasResultType = true; break; + case SpvOpULessThanEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpSLessThanEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpFOrdEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpFUnordEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpFOrdNotEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpFUnordNotEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpFOrdLessThan: *hasResult = true; *hasResultType = true; break; + case SpvOpFUnordLessThan: *hasResult = true; *hasResultType = true; break; + case SpvOpFOrdGreaterThan: *hasResult = true; *hasResultType = true; break; + case SpvOpFUnordGreaterThan: *hasResult = true; *hasResultType = true; break; + case SpvOpFOrdLessThanEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpFUnordLessThanEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpFOrdGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpFUnordGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpShiftRightLogical: *hasResult = true; *hasResultType = true; break; + case SpvOpShiftRightArithmetic: *hasResult = true; *hasResultType = true; break; + case SpvOpShiftLeftLogical: *hasResult = true; *hasResultType = true; break; + case SpvOpBitwiseOr: *hasResult = true; *hasResultType = true; break; + case SpvOpBitwiseXor: *hasResult = true; *hasResultType = true; break; + case SpvOpBitwiseAnd: *hasResult = true; *hasResultType = true; break; + case SpvOpNot: *hasResult = true; *hasResultType = true; break; + case SpvOpBitFieldInsert: *hasResult = true; *hasResultType = true; break; + case SpvOpBitFieldSExtract: *hasResult = true; *hasResultType = true; break; + case SpvOpBitFieldUExtract: *hasResult = true; *hasResultType = true; break; + case SpvOpBitReverse: *hasResult = true; *hasResultType = true; break; + case SpvOpBitCount: *hasResult = true; *hasResultType = true; break; + case SpvOpDPdx: *hasResult = true; *hasResultType = true; break; + case SpvOpDPdy: *hasResult = true; *hasResultType = true; break; + case SpvOpFwidth: *hasResult = true; *hasResultType = true; break; + case SpvOpDPdxFine: *hasResult = true; *hasResultType = true; break; + case SpvOpDPdyFine: *hasResult = true; *hasResultType = true; break; + case SpvOpFwidthFine: *hasResult = true; *hasResultType = true; break; + case SpvOpDPdxCoarse: *hasResult = true; *hasResultType = true; break; + case SpvOpDPdyCoarse: *hasResult = true; *hasResultType = true; break; + case SpvOpFwidthCoarse: *hasResult = true; *hasResultType = true; break; + case SpvOpEmitVertex: *hasResult = false; *hasResultType = false; break; + case SpvOpEndPrimitive: *hasResult = false; *hasResultType = false; break; + case SpvOpEmitStreamVertex: *hasResult = false; *hasResultType = false; break; + case SpvOpEndStreamPrimitive: *hasResult = false; *hasResultType = false; break; + case SpvOpControlBarrier: *hasResult = false; *hasResultType = false; break; + case SpvOpMemoryBarrier: *hasResult = false; *hasResultType = false; break; + case SpvOpAtomicLoad: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicStore: *hasResult = false; *hasResultType = false; break; + case SpvOpAtomicExchange: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicCompareExchange: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicCompareExchangeWeak: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicIIncrement: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicIDecrement: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicIAdd: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicISub: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicSMin: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicUMin: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicSMax: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicUMax: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicAnd: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicOr: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicXor: *hasResult = true; *hasResultType = true; break; + case SpvOpPhi: *hasResult = true; *hasResultType = true; break; + case SpvOpLoopMerge: *hasResult = false; *hasResultType = false; break; + case SpvOpSelectionMerge: *hasResult = false; *hasResultType = false; break; + case SpvOpLabel: *hasResult = true; *hasResultType = false; break; + case SpvOpBranch: *hasResult = false; *hasResultType = false; break; + case SpvOpBranchConditional: *hasResult = false; *hasResultType = false; break; + case SpvOpSwitch: *hasResult = false; *hasResultType = false; break; + case SpvOpKill: *hasResult = false; *hasResultType = false; break; + case SpvOpReturn: *hasResult = false; *hasResultType = false; break; + case SpvOpReturnValue: *hasResult = false; *hasResultType = false; break; + case SpvOpUnreachable: *hasResult = false; *hasResultType = false; break; + case SpvOpLifetimeStart: *hasResult = false; *hasResultType = false; break; + case SpvOpLifetimeStop: *hasResult = false; *hasResultType = false; break; + case SpvOpGroupAsyncCopy: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupWaitEvents: *hasResult = false; *hasResultType = false; break; + case SpvOpGroupAll: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupAny: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupBroadcast: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupIAdd: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupFAdd: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupFMin: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupUMin: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupSMin: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupFMax: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupUMax: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupSMax: *hasResult = true; *hasResultType = true; break; + case SpvOpReadPipe: *hasResult = true; *hasResultType = true; break; + case SpvOpWritePipe: *hasResult = true; *hasResultType = true; break; + case SpvOpReservedReadPipe: *hasResult = true; *hasResultType = true; break; + case SpvOpReservedWritePipe: *hasResult = true; *hasResultType = true; break; + case SpvOpReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; + case SpvOpReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; + case SpvOpCommitReadPipe: *hasResult = false; *hasResultType = false; break; + case SpvOpCommitWritePipe: *hasResult = false; *hasResultType = false; break; + case SpvOpIsValidReserveId: *hasResult = true; *hasResultType = true; break; + case SpvOpGetNumPipePackets: *hasResult = true; *hasResultType = true; break; + case SpvOpGetMaxPipePackets: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupCommitReadPipe: *hasResult = false; *hasResultType = false; break; + case SpvOpGroupCommitWritePipe: *hasResult = false; *hasResultType = false; break; + case SpvOpEnqueueMarker: *hasResult = true; *hasResultType = true; break; + case SpvOpEnqueueKernel: *hasResult = true; *hasResultType = true; break; + case SpvOpGetKernelNDrangeSubGroupCount: *hasResult = true; *hasResultType = true; break; + case SpvOpGetKernelNDrangeMaxSubGroupSize: *hasResult = true; *hasResultType = true; break; + case SpvOpGetKernelWorkGroupSize: *hasResult = true; *hasResultType = true; break; + case SpvOpGetKernelPreferredWorkGroupSizeMultiple: *hasResult = true; *hasResultType = true; break; + case SpvOpRetainEvent: *hasResult = false; *hasResultType = false; break; + case SpvOpReleaseEvent: *hasResult = false; *hasResultType = false; break; + case SpvOpCreateUserEvent: *hasResult = true; *hasResultType = true; break; + case SpvOpIsValidEvent: *hasResult = true; *hasResultType = true; break; + case SpvOpSetUserEventStatus: *hasResult = false; *hasResultType = false; break; + case SpvOpCaptureEventProfilingInfo: *hasResult = false; *hasResultType = false; break; + case SpvOpGetDefaultQueue: *hasResult = true; *hasResultType = true; break; + case SpvOpBuildNDRange: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseSampleImplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseSampleExplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseFetch: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseGather: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseDrefGather: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseTexelsResident: *hasResult = true; *hasResultType = true; break; + case SpvOpNoLine: *hasResult = false; *hasResultType = false; break; + case SpvOpAtomicFlagTestAndSet: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicFlagClear: *hasResult = false; *hasResultType = false; break; + case SpvOpImageSparseRead: *hasResult = true; *hasResultType = true; break; + case SpvOpSizeOf: *hasResult = true; *hasResultType = true; break; + case SpvOpTypePipeStorage: *hasResult = true; *hasResultType = false; break; + case SpvOpConstantPipeStorage: *hasResult = true; *hasResultType = true; break; + case SpvOpCreatePipeFromPipeStorage: *hasResult = true; *hasResultType = true; break; + case SpvOpGetKernelLocalSizeForSubgroupCount: *hasResult = true; *hasResultType = true; break; + case SpvOpGetKernelMaxNumSubgroups: *hasResult = true; *hasResultType = true; break; + case SpvOpTypeNamedBarrier: *hasResult = true; *hasResultType = false; break; + case SpvOpNamedBarrierInitialize: *hasResult = true; *hasResultType = true; break; + case SpvOpMemoryNamedBarrier: *hasResult = false; *hasResultType = false; break; + case SpvOpModuleProcessed: *hasResult = false; *hasResultType = false; break; + case SpvOpExecutionModeId: *hasResult = false; *hasResultType = false; break; + case SpvOpDecorateId: *hasResult = false; *hasResultType = false; break; + case SpvOpGroupNonUniformElect: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformAll: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformAny: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformAllEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBroadcast: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBroadcastFirst: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBallot: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformInverseBallot: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBallotBitExtract: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBallotBitCount: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBallotFindLSB: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBallotFindMSB: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformShuffle: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformShuffleXor: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformShuffleUp: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformShuffleDown: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformIAdd: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformFAdd: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformIMul: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformFMul: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformSMin: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformUMin: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformFMin: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformSMax: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformUMax: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformFMax: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBitwiseAnd: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBitwiseOr: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBitwiseXor: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformLogicalAnd: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformLogicalOr: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformLogicalXor: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformQuadBroadcast: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformQuadSwap: *hasResult = true; *hasResultType = true; break; + case SpvOpCopyLogical: *hasResult = true; *hasResultType = true; break; + case SpvOpPtrEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpPtrNotEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpPtrDiff: *hasResult = true; *hasResultType = true; break; + case SpvOpColorAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpDepthAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpStencilAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpTypeTensorARM: *hasResult = true; *hasResultType = false; break; + case SpvOpTensorReadARM: *hasResult = true; *hasResultType = true; break; + case SpvOpTensorWriteARM: *hasResult = false; *hasResultType = false; break; + case SpvOpTensorQuerySizeARM: *hasResult = true; *hasResultType = true; break; + case SpvOpGraphConstantARM: *hasResult = true; *hasResultType = true; break; + case SpvOpGraphEntryPointARM: *hasResult = false; *hasResultType = false; break; + case SpvOpGraphARM: *hasResult = true; *hasResultType = true; break; + case SpvOpGraphInputARM: *hasResult = true; *hasResultType = true; break; + case SpvOpGraphSetOutputARM: *hasResult = false; *hasResultType = false; break; + case SpvOpGraphEndARM: *hasResult = false; *hasResultType = false; break; + case SpvOpTypeGraphARM: *hasResult = true; *hasResultType = false; break; + case SpvOpTerminateInvocation: *hasResult = false; *hasResultType = false; break; + case SpvOpTypeUntypedPointerKHR: *hasResult = true; *hasResultType = false; break; + case SpvOpUntypedVariableKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpUntypedAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpUntypedInBoundsAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpUntypedPtrAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpUntypedInBoundsPtrAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpUntypedArrayLengthKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpUntypedPrefetchKHR: *hasResult = false; *hasResultType = false; break; + case SpvOpFmaKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpExtInstWithForwardRefsKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpUntypedGroupAsyncCopyKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpTraceRayKHR: *hasResult = false; *hasResultType = false; break; + case SpvOpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break; + case SpvOpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case SpvOpTerminateRayKHR: *hasResult = false; *hasResultType = false; break; + case SpvOpSDot: *hasResult = true; *hasResultType = true; break; + case SpvOpUDot: *hasResult = true; *hasResultType = true; break; + case SpvOpSUDot: *hasResult = true; *hasResultType = true; break; + case SpvOpSDotAccSat: *hasResult = true; *hasResultType = true; break; + case SpvOpUDotAccSat: *hasResult = true; *hasResultType = true; break; + case SpvOpSUDotAccSat: *hasResult = true; *hasResultType = true; break; + case SpvOpTypeCooperativeMatrixKHR: *hasResult = true; *hasResultType = false; break; + case SpvOpCooperativeMatrixLoadKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break; + case SpvOpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpSpecConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpCompositeConstructReplicateEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break; + case SpvOpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break; + case SpvOpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break; + case SpvOpRayQueryGenerateIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case SpvOpRayQueryConfirmIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case SpvOpRayQueryProceedKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionTypeKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleWeightedQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBoxFilterQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBlockMatchSSDQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBlockMatchSADQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpBitCastArrayQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBlockMatchWindowSSDQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBlockMatchWindowSADQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBlockMatchGatherSSDQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBlockMatchGatherSADQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpCompositeConstructCoopMatQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpCompositeExtractCoopMatQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpExtractSubArrayQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupUMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupSMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupFMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupUMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupSMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpReadClockKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpAllocateNodePayloadsAMDX: *hasResult = true; *hasResultType = true; break; + case SpvOpEnqueueNodePayloadsAMDX: *hasResult = false; *hasResultType = false; break; + case SpvOpTypeNodePayloadArrayAMDX: *hasResult = true; *hasResultType = false; break; + case SpvOpFinishWritingNodePayloadAMDX: *hasResult = true; *hasResultType = true; break; + case SpvOpNodePayloadArrayLengthAMDX: *hasResult = true; *hasResultType = true; break; + case SpvOpIsNodePayloadValidAMDX: *hasResult = true; *hasResultType = true; break; + case SpvOpConstantStringAMDX: *hasResult = true; *hasResultType = false; break; + case SpvOpSpecConstantStringAMDX: *hasResult = true; *hasResultType = false; break; + case SpvOpGroupNonUniformQuadAllKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformQuadAnyKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectRecordHitMotionNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectRecordHitWithIndexMotionNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectRecordMissMotionNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectGetWorldToObjectNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetObjectToWorldNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetObjectRayDirectionNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetObjectRayOriginNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectGetShaderRecordBufferHandleNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetShaderBindingTableRecordIndexNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectRecordEmptyNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectTraceRayNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectRecordHitNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectRecordHitWithIndexNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectRecordMissNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectExecuteShaderNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectGetCurrentTimeNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetAttributesNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectGetHitKindNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetPrimitiveIndexNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetGeometryIndexNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetInstanceIdNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetInstanceCustomIndexNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetWorldRayDirectionNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetWorldRayOriginNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetRayTMaxNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetRayTMinNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectIsEmptyNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectIsHitNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectIsMissNV: *hasResult = true; *hasResultType = true; break; + case SpvOpReorderThreadWithHitObjectNV: *hasResult = false; *hasResultType = false; break; + case SpvOpReorderThreadWithHintNV: *hasResult = false; *hasResultType = false; break; + case SpvOpTypeHitObjectNV: *hasResult = true; *hasResultType = false; break; + case SpvOpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break; + case SpvOpTypeCooperativeVectorNV: *hasResult = true; *hasResultType = false; break; + case SpvOpCooperativeVectorMatrixMulNV: *hasResult = true; *hasResultType = true; break; + case SpvOpCooperativeVectorOuterProductAccumulateNV: *hasResult = false; *hasResultType = false; break; + case SpvOpCooperativeVectorReduceSumAccumulateNV: *hasResult = false; *hasResultType = false; break; + case SpvOpCooperativeVectorMatrixMulAddNV: *hasResult = true; *hasResultType = true; break; + case SpvOpCooperativeMatrixConvertNV: *hasResult = true; *hasResultType = true; break; + case SpvOpEmitMeshTasksEXT: *hasResult = false; *hasResultType = false; break; + case SpvOpSetMeshOutputsEXT: *hasResult = false; *hasResultType = false; break; + case SpvOpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break; + case SpvOpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break; + case SpvOpFetchMicroTriangleVertexPositionNV: *hasResult = true; *hasResultType = true; break; + case SpvOpFetchMicroTriangleVertexBarycentricNV: *hasResult = true; *hasResultType = true; break; + case SpvOpCooperativeVectorLoadNV: *hasResult = true; *hasResultType = true; break; + case SpvOpCooperativeVectorStoreNV: *hasResult = false; *hasResultType = false; break; + case SpvOpReportIntersectionKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break; + case SpvOpTerminateRayNV: *hasResult = false; *hasResultType = false; break; + case SpvOpTraceNV: *hasResult = false; *hasResultType = false; break; + case SpvOpTraceMotionNV: *hasResult = false; *hasResultType = false; break; + case SpvOpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; + case SpvOpRayQueryGetIntersectionTriangleVertexPositionsKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpTypeAccelerationStructureKHR: *hasResult = true; *hasResultType = false; break; + case SpvOpExecuteCallableNV: *hasResult = false; *hasResultType = false; break; + case SpvOpRayQueryGetIntersectionClusterIdNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetClusterIdNV: *hasResult = true; *hasResultType = true; break; + case SpvOpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break; + case SpvOpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break; + case SpvOpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break; + case SpvOpCooperativeMatrixMulAddNV: *hasResult = true; *hasResultType = true; break; + case SpvOpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break; + case SpvOpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; + case SpvOpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; + case SpvOpCooperativeMatrixReduceNV: *hasResult = true; *hasResultType = true; break; + case SpvOpCooperativeMatrixLoadTensorNV: *hasResult = true; *hasResultType = true; break; + case SpvOpCooperativeMatrixStoreTensorNV: *hasResult = false; *hasResultType = false; break; + case SpvOpCooperativeMatrixPerElementOpNV: *hasResult = true; *hasResultType = true; break; + case SpvOpTypeTensorLayoutNV: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeTensorViewNV: *hasResult = true; *hasResultType = false; break; + case SpvOpCreateTensorLayoutNV: *hasResult = true; *hasResultType = true; break; + case SpvOpTensorLayoutSetDimensionNV: *hasResult = true; *hasResultType = true; break; + case SpvOpTensorLayoutSetStrideNV: *hasResult = true; *hasResultType = true; break; + case SpvOpTensorLayoutSliceNV: *hasResult = true; *hasResultType = true; break; + case SpvOpTensorLayoutSetClampValueNV: *hasResult = true; *hasResultType = true; break; + case SpvOpCreateTensorViewNV: *hasResult = true; *hasResultType = true; break; + case SpvOpTensorViewSetDimensionNV: *hasResult = true; *hasResultType = true; break; + case SpvOpTensorViewSetStrideNV: *hasResult = true; *hasResultType = true; break; + case SpvOpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break; + case SpvOpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpTensorViewSetClipNV: *hasResult = true; *hasResultType = true; break; + case SpvOpTensorLayoutSetBlockSizeNV: *hasResult = true; *hasResultType = true; break; + case SpvOpCooperativeMatrixTransposeNV: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertUToImageNV: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertImageToUNV: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertSamplerToUNV: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertUToSampledImageNV: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break; + case SpvOpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break; + case SpvOpRawAccessChainNV: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionSpherePositionNV: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionSphereRadiusNV: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionLSSPositionsNV: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionLSSRadiiNV: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionLSSHitValueNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetSpherePositionNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetSphereRadiusNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetLSSPositionsNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetLSSRadiiNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectIsSphereHitNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectIsLSSHitNV: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryIsSphereHitNV: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryIsLSSHitNV: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupShuffleXorINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpSubgroupImageBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupImageBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpSubgroupImageMediaBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupImageMediaBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpUCountLeadingZerosINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpUCountTrailingZerosINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpAbsISubINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpAbsUSubINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpIAddSatINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpUAddSatINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpIAverageINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpUAverageINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpIAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpUAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpISubSatINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpUSubSatINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpAsmTargetINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpAsmINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpAsmCallINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicFMinEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicFMaxEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpAssumeTrueKHR: *hasResult = false; *hasResultType = false; break; + case SpvOpExpectKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpDecorateString: *hasResult = false; *hasResultType = false; break; + case SpvOpMemberDecorateString: *hasResult = false; *hasResultType = false; break; + case SpvOpVmeImageINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpTypeVmeImageINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcImePayloadINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcRefPayloadINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcSicPayloadINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcMcePayloadINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcMceResultINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcImeResultINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcImeResultSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcImeResultDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcImeSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcImeDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcRefResultINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcSicResultINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceSetInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceSetInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceSetAcOnlyHaarINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceConvertToImePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceConvertToImeResultINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceConvertToRefPayloadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceConvertToRefResultINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceConvertToSicPayloadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceConvertToSicResultINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetBestInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetInterMajorShapeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetInterMinorShapeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetInterDirectionsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetInterMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetInterReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeSetSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeSetDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeRefWindowSizeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeAdjustRefOffsetINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeSetMaxMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeSetWeightedSadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeStripDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetBorderReachedINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcFmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcBmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcRefConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcRefSetBidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcRefSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcRefEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcRefConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicConfigureSkcINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicConfigureIpeLumaINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicConfigureIpeLumaChromaINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicGetMotionVectorMaskINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicEvaluateIpeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicGetIpeLumaShapeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicGetPackedIpeLumaModesINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicGetIpeChromaModeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicGetInterRawSadsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpVariableLengthArrayINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSaveMemoryINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpRestoreMemoryINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpArbitraryFloatSinCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatCastINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatCastFromIntINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatCastToIntINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatAddINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatSubINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatMulINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatDivINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatGTINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatGEINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatLTINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatLEINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatEQINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatRecipINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatRSqrtINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatCbrtINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatHypotINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatSqrtINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatLogINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatLog2INTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatLog10INTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatLog1pINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatExpINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatExp2INTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatExp10INTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatExpm1INTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatSinINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatCosINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatSinCosINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatSinPiINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatASinINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatASinPiINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatACosINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatACosPiINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatATanINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatATanPiINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatATan2INTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatPowINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpLoopControlINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpAliasDomainDeclINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpAliasScopeDeclINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpAliasScopeListDeclINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpFixedSinINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpFixedCosINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpFixedSinCosINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpFixedSinPiINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpFixedCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpFixedSinCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpFixedLogINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpFixedExpINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpPtrCastToCrossWorkgroupINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpCrossWorkgroupCastToPtrINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpReadPipeBlockingINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpWritePipeBlockingINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpFPGARegINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetRayTMinKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetRayFlagsKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionTKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionInstanceCustomIndexKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionInstanceIdKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionGeometryIndexKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionPrimitiveIndexKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionBarycentricsKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionFrontFaceKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionCandidateAABBOpaqueKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionObjectRayDirectionKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionObjectRayOriginKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetWorldRayDirectionKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetWorldRayOriginKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionObjectToWorldKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpRayQueryGetIntersectionWorldToObjectKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicFAddEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpTypeBufferSurfaceINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpCompositeConstructContinuedINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertFToBF16INTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertBF16ToFINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpArithmeticFenceEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpTaskSequenceCreateINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpTaskSequenceAsyncINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpTaskSequenceGetINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpTaskSequenceReleaseINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpTypeTaskSequenceINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpSubgroupBlockPrefetchINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpSubgroup2DBlockLoadINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpSubgroup2DBlockLoadTransformINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpSubgroup2DBlockLoadTransposeINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpSubgroup2DBlockPrefetchINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpSubgroup2DBlockStoreINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpSubgroupMatrixMultiplyAccumulateINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpBitwiseFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpUntypedVariableLengthArrayINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpConditionalExtensionINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpConditionalEntryPointINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpConditionalCapabilityINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpSpecConstantTargetINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSpecConstantArchitectureINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSpecConstantCapabilitiesINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpConditionalCopyObjectINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupIMulKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupFMulKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpRoundFToTF32INTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpMaskedGatherINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpMaskedScatterINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpConvertHandleToImageINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertHandleToSamplerINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertHandleToSampledImageINTEL: *hasResult = true; *hasResultType = true; break; + } +} +inline const char* SpvSourceLanguageToString(SpvSourceLanguage value) { + switch (value) { + case SpvSourceLanguageUnknown: return "Unknown"; + case SpvSourceLanguageESSL: return "ESSL"; + case SpvSourceLanguageGLSL: return "GLSL"; + case SpvSourceLanguageOpenCL_C: return "OpenCL_C"; + case SpvSourceLanguageOpenCL_CPP: return "OpenCL_CPP"; + case SpvSourceLanguageHLSL: return "HLSL"; + case SpvSourceLanguageCPP_for_OpenCL: return "CPP_for_OpenCL"; + case SpvSourceLanguageSYCL: return "SYCL"; + case SpvSourceLanguageHERO_C: return "HERO_C"; + case SpvSourceLanguageNZSL: return "NZSL"; + case SpvSourceLanguageWGSL: return "WGSL"; + case SpvSourceLanguageSlang: return "Slang"; + case SpvSourceLanguageZig: return "Zig"; + case SpvSourceLanguageRust: return "Rust"; + default: return "Unknown"; + } +} + +inline const char* SpvExecutionModelToString(SpvExecutionModel value) { + switch (value) { + case SpvExecutionModelVertex: return "Vertex"; + case SpvExecutionModelTessellationControl: return "TessellationControl"; + case SpvExecutionModelTessellationEvaluation: return "TessellationEvaluation"; + case SpvExecutionModelGeometry: return "Geometry"; + case SpvExecutionModelFragment: return "Fragment"; + case SpvExecutionModelGLCompute: return "GLCompute"; + case SpvExecutionModelKernel: return "Kernel"; + case SpvExecutionModelTaskNV: return "TaskNV"; + case SpvExecutionModelMeshNV: return "MeshNV"; + case SpvExecutionModelRayGenerationKHR: return "RayGenerationKHR"; + case SpvExecutionModelIntersectionKHR: return "IntersectionKHR"; + case SpvExecutionModelAnyHitKHR: return "AnyHitKHR"; + case SpvExecutionModelClosestHitKHR: return "ClosestHitKHR"; + case SpvExecutionModelMissKHR: return "MissKHR"; + case SpvExecutionModelCallableKHR: return "CallableKHR"; + case SpvExecutionModelTaskEXT: return "TaskEXT"; + case SpvExecutionModelMeshEXT: return "MeshEXT"; + default: return "Unknown"; + } +} + +inline const char* SpvAddressingModelToString(SpvAddressingModel value) { + switch (value) { + case SpvAddressingModelLogical: return "Logical"; + case SpvAddressingModelPhysical32: return "Physical32"; + case SpvAddressingModelPhysical64: return "Physical64"; + case SpvAddressingModelPhysicalStorageBuffer64: return "PhysicalStorageBuffer64"; + default: return "Unknown"; + } +} + +inline const char* SpvMemoryModelToString(SpvMemoryModel value) { + switch (value) { + case SpvMemoryModelSimple: return "Simple"; + case SpvMemoryModelGLSL450: return "GLSL450"; + case SpvMemoryModelOpenCL: return "OpenCL"; + case SpvMemoryModelVulkan: return "Vulkan"; + default: return "Unknown"; + } +} + +inline const char* SpvExecutionModeToString(SpvExecutionMode value) { + switch (value) { + case SpvExecutionModeInvocations: return "Invocations"; + case SpvExecutionModeSpacingEqual: return "SpacingEqual"; + case SpvExecutionModeSpacingFractionalEven: return "SpacingFractionalEven"; + case SpvExecutionModeSpacingFractionalOdd: return "SpacingFractionalOdd"; + case SpvExecutionModeVertexOrderCw: return "VertexOrderCw"; + case SpvExecutionModeVertexOrderCcw: return "VertexOrderCcw"; + case SpvExecutionModePixelCenterInteger: return "PixelCenterInteger"; + case SpvExecutionModeOriginUpperLeft: return "OriginUpperLeft"; + case SpvExecutionModeOriginLowerLeft: return "OriginLowerLeft"; + case SpvExecutionModeEarlyFragmentTests: return "EarlyFragmentTests"; + case SpvExecutionModePointMode: return "PointMode"; + case SpvExecutionModeXfb: return "Xfb"; + case SpvExecutionModeDepthReplacing: return "DepthReplacing"; + case SpvExecutionModeDepthGreater: return "DepthGreater"; + case SpvExecutionModeDepthLess: return "DepthLess"; + case SpvExecutionModeDepthUnchanged: return "DepthUnchanged"; + case SpvExecutionModeLocalSize: return "LocalSize"; + case SpvExecutionModeLocalSizeHint: return "LocalSizeHint"; + case SpvExecutionModeInputPoints: return "InputPoints"; + case SpvExecutionModeInputLines: return "InputLines"; + case SpvExecutionModeInputLinesAdjacency: return "InputLinesAdjacency"; + case SpvExecutionModeTriangles: return "Triangles"; + case SpvExecutionModeInputTrianglesAdjacency: return "InputTrianglesAdjacency"; + case SpvExecutionModeQuads: return "Quads"; + case SpvExecutionModeIsolines: return "Isolines"; + case SpvExecutionModeOutputVertices: return "OutputVertices"; + case SpvExecutionModeOutputPoints: return "OutputPoints"; + case SpvExecutionModeOutputLineStrip: return "OutputLineStrip"; + case SpvExecutionModeOutputTriangleStrip: return "OutputTriangleStrip"; + case SpvExecutionModeVecTypeHint: return "VecTypeHint"; + case SpvExecutionModeContractionOff: return "ContractionOff"; + case SpvExecutionModeInitializer: return "Initializer"; + case SpvExecutionModeFinalizer: return "Finalizer"; + case SpvExecutionModeSubgroupSize: return "SubgroupSize"; + case SpvExecutionModeSubgroupsPerWorkgroup: return "SubgroupsPerWorkgroup"; + case SpvExecutionModeSubgroupsPerWorkgroupId: return "SubgroupsPerWorkgroupId"; + case SpvExecutionModeLocalSizeId: return "LocalSizeId"; + case SpvExecutionModeLocalSizeHintId: return "LocalSizeHintId"; + case SpvExecutionModeNonCoherentColorAttachmentReadEXT: return "NonCoherentColorAttachmentReadEXT"; + case SpvExecutionModeNonCoherentDepthAttachmentReadEXT: return "NonCoherentDepthAttachmentReadEXT"; + case SpvExecutionModeNonCoherentStencilAttachmentReadEXT: return "NonCoherentStencilAttachmentReadEXT"; + case SpvExecutionModeSubgroupUniformControlFlowKHR: return "SubgroupUniformControlFlowKHR"; + case SpvExecutionModePostDepthCoverage: return "PostDepthCoverage"; + case SpvExecutionModeDenormPreserve: return "DenormPreserve"; + case SpvExecutionModeDenormFlushToZero: return "DenormFlushToZero"; + case SpvExecutionModeSignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve"; + case SpvExecutionModeRoundingModeRTE: return "RoundingModeRTE"; + case SpvExecutionModeRoundingModeRTZ: return "RoundingModeRTZ"; + case SpvExecutionModeNonCoherentTileAttachmentReadQCOM: return "NonCoherentTileAttachmentReadQCOM"; + case SpvExecutionModeTileShadingRateQCOM: return "TileShadingRateQCOM"; + case SpvExecutionModeEarlyAndLateFragmentTestsAMD: return "EarlyAndLateFragmentTestsAMD"; + case SpvExecutionModeStencilRefReplacingEXT: return "StencilRefReplacingEXT"; + case SpvExecutionModeCoalescingAMDX: return "CoalescingAMDX"; + case SpvExecutionModeIsApiEntryAMDX: return "IsApiEntryAMDX"; + case SpvExecutionModeMaxNodeRecursionAMDX: return "MaxNodeRecursionAMDX"; + case SpvExecutionModeStaticNumWorkgroupsAMDX: return "StaticNumWorkgroupsAMDX"; + case SpvExecutionModeShaderIndexAMDX: return "ShaderIndexAMDX"; + case SpvExecutionModeMaxNumWorkgroupsAMDX: return "MaxNumWorkgroupsAMDX"; + case SpvExecutionModeStencilRefUnchangedFrontAMD: return "StencilRefUnchangedFrontAMD"; + case SpvExecutionModeStencilRefGreaterFrontAMD: return "StencilRefGreaterFrontAMD"; + case SpvExecutionModeStencilRefLessFrontAMD: return "StencilRefLessFrontAMD"; + case SpvExecutionModeStencilRefUnchangedBackAMD: return "StencilRefUnchangedBackAMD"; + case SpvExecutionModeStencilRefGreaterBackAMD: return "StencilRefGreaterBackAMD"; + case SpvExecutionModeStencilRefLessBackAMD: return "StencilRefLessBackAMD"; + case SpvExecutionModeQuadDerivativesKHR: return "QuadDerivativesKHR"; + case SpvExecutionModeRequireFullQuadsKHR: return "RequireFullQuadsKHR"; + case SpvExecutionModeSharesInputWithAMDX: return "SharesInputWithAMDX"; + case SpvExecutionModeOutputLinesEXT: return "OutputLinesEXT"; + case SpvExecutionModeOutputPrimitivesEXT: return "OutputPrimitivesEXT"; + case SpvExecutionModeDerivativeGroupQuadsKHR: return "DerivativeGroupQuadsKHR"; + case SpvExecutionModeDerivativeGroupLinearKHR: return "DerivativeGroupLinearKHR"; + case SpvExecutionModeOutputTrianglesEXT: return "OutputTrianglesEXT"; + case SpvExecutionModePixelInterlockOrderedEXT: return "PixelInterlockOrderedEXT"; + case SpvExecutionModePixelInterlockUnorderedEXT: return "PixelInterlockUnorderedEXT"; + case SpvExecutionModeSampleInterlockOrderedEXT: return "SampleInterlockOrderedEXT"; + case SpvExecutionModeSampleInterlockUnorderedEXT: return "SampleInterlockUnorderedEXT"; + case SpvExecutionModeShadingRateInterlockOrderedEXT: return "ShadingRateInterlockOrderedEXT"; + case SpvExecutionModeShadingRateInterlockUnorderedEXT: return "ShadingRateInterlockUnorderedEXT"; + case SpvExecutionModeSharedLocalMemorySizeINTEL: return "SharedLocalMemorySizeINTEL"; + case SpvExecutionModeRoundingModeRTPINTEL: return "RoundingModeRTPINTEL"; + case SpvExecutionModeRoundingModeRTNINTEL: return "RoundingModeRTNINTEL"; + case SpvExecutionModeFloatingPointModeALTINTEL: return "FloatingPointModeALTINTEL"; + case SpvExecutionModeFloatingPointModeIEEEINTEL: return "FloatingPointModeIEEEINTEL"; + case SpvExecutionModeMaxWorkgroupSizeINTEL: return "MaxWorkgroupSizeINTEL"; + case SpvExecutionModeMaxWorkDimINTEL: return "MaxWorkDimINTEL"; + case SpvExecutionModeNoGlobalOffsetINTEL: return "NoGlobalOffsetINTEL"; + case SpvExecutionModeNumSIMDWorkitemsINTEL: return "NumSIMDWorkitemsINTEL"; + case SpvExecutionModeSchedulerTargetFmaxMhzINTEL: return "SchedulerTargetFmaxMhzINTEL"; + case SpvExecutionModeMaximallyReconvergesKHR: return "MaximallyReconvergesKHR"; + case SpvExecutionModeFPFastMathDefault: return "FPFastMathDefault"; + case SpvExecutionModeStreamingInterfaceINTEL: return "StreamingInterfaceINTEL"; + case SpvExecutionModeRegisterMapInterfaceINTEL: return "RegisterMapInterfaceINTEL"; + case SpvExecutionModeNamedBarrierCountINTEL: return "NamedBarrierCountINTEL"; + case SpvExecutionModeMaximumRegistersINTEL: return "MaximumRegistersINTEL"; + case SpvExecutionModeMaximumRegistersIdINTEL: return "MaximumRegistersIdINTEL"; + case SpvExecutionModeNamedMaximumRegistersINTEL: return "NamedMaximumRegistersINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvStorageClassToString(SpvStorageClass value) { + switch (value) { + case SpvStorageClassUniformConstant: return "UniformConstant"; + case SpvStorageClassInput: return "Input"; + case SpvStorageClassUniform: return "Uniform"; + case SpvStorageClassOutput: return "Output"; + case SpvStorageClassWorkgroup: return "Workgroup"; + case SpvStorageClassCrossWorkgroup: return "CrossWorkgroup"; + case SpvStorageClassPrivate: return "Private"; + case SpvStorageClassFunction: return "Function"; + case SpvStorageClassGeneric: return "Generic"; + case SpvStorageClassPushConstant: return "PushConstant"; + case SpvStorageClassAtomicCounter: return "AtomicCounter"; + case SpvStorageClassImage: return "Image"; + case SpvStorageClassStorageBuffer: return "StorageBuffer"; + case SpvStorageClassTileImageEXT: return "TileImageEXT"; + case SpvStorageClassTileAttachmentQCOM: return "TileAttachmentQCOM"; + case SpvStorageClassNodePayloadAMDX: return "NodePayloadAMDX"; + case SpvStorageClassCallableDataKHR: return "CallableDataKHR"; + case SpvStorageClassIncomingCallableDataKHR: return "IncomingCallableDataKHR"; + case SpvStorageClassRayPayloadKHR: return "RayPayloadKHR"; + case SpvStorageClassHitAttributeKHR: return "HitAttributeKHR"; + case SpvStorageClassIncomingRayPayloadKHR: return "IncomingRayPayloadKHR"; + case SpvStorageClassShaderRecordBufferKHR: return "ShaderRecordBufferKHR"; + case SpvStorageClassPhysicalStorageBuffer: return "PhysicalStorageBuffer"; + case SpvStorageClassHitObjectAttributeNV: return "HitObjectAttributeNV"; + case SpvStorageClassTaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT"; + case SpvStorageClassCodeSectionINTEL: return "CodeSectionINTEL"; + case SpvStorageClassDeviceOnlyINTEL: return "DeviceOnlyINTEL"; + case SpvStorageClassHostOnlyINTEL: return "HostOnlyINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvDimToString(SpvDim value) { + switch (value) { + case SpvDim1D: return "1D"; + case SpvDim2D: return "2D"; + case SpvDim3D: return "3D"; + case SpvDimCube: return "Cube"; + case SpvDimRect: return "Rect"; + case SpvDimBuffer: return "Buffer"; + case SpvDimSubpassData: return "SubpassData"; + case SpvDimTileImageDataEXT: return "TileImageDataEXT"; + default: return "Unknown"; + } +} + +inline const char* SpvSamplerAddressingModeToString(SpvSamplerAddressingMode value) { + switch (value) { + case SpvSamplerAddressingModeNone: return "None"; + case SpvSamplerAddressingModeClampToEdge: return "ClampToEdge"; + case SpvSamplerAddressingModeClamp: return "Clamp"; + case SpvSamplerAddressingModeRepeat: return "Repeat"; + case SpvSamplerAddressingModeRepeatMirrored: return "RepeatMirrored"; + default: return "Unknown"; + } +} + +inline const char* SpvSamplerFilterModeToString(SpvSamplerFilterMode value) { + switch (value) { + case SpvSamplerFilterModeNearest: return "Nearest"; + case SpvSamplerFilterModeLinear: return "Linear"; + default: return "Unknown"; + } +} + +inline const char* SpvImageFormatToString(SpvImageFormat value) { + switch (value) { + case SpvImageFormatUnknown: return "Unknown"; + case SpvImageFormatRgba32f: return "Rgba32f"; + case SpvImageFormatRgba16f: return "Rgba16f"; + case SpvImageFormatR32f: return "R32f"; + case SpvImageFormatRgba8: return "Rgba8"; + case SpvImageFormatRgba8Snorm: return "Rgba8Snorm"; + case SpvImageFormatRg32f: return "Rg32f"; + case SpvImageFormatRg16f: return "Rg16f"; + case SpvImageFormatR11fG11fB10f: return "R11fG11fB10f"; + case SpvImageFormatR16f: return "R16f"; + case SpvImageFormatRgba16: return "Rgba16"; + case SpvImageFormatRgb10A2: return "Rgb10A2"; + case SpvImageFormatRg16: return "Rg16"; + case SpvImageFormatRg8: return "Rg8"; + case SpvImageFormatR16: return "R16"; + case SpvImageFormatR8: return "R8"; + case SpvImageFormatRgba16Snorm: return "Rgba16Snorm"; + case SpvImageFormatRg16Snorm: return "Rg16Snorm"; + case SpvImageFormatRg8Snorm: return "Rg8Snorm"; + case SpvImageFormatR16Snorm: return "R16Snorm"; + case SpvImageFormatR8Snorm: return "R8Snorm"; + case SpvImageFormatRgba32i: return "Rgba32i"; + case SpvImageFormatRgba16i: return "Rgba16i"; + case SpvImageFormatRgba8i: return "Rgba8i"; + case SpvImageFormatR32i: return "R32i"; + case SpvImageFormatRg32i: return "Rg32i"; + case SpvImageFormatRg16i: return "Rg16i"; + case SpvImageFormatRg8i: return "Rg8i"; + case SpvImageFormatR16i: return "R16i"; + case SpvImageFormatR8i: return "R8i"; + case SpvImageFormatRgba32ui: return "Rgba32ui"; + case SpvImageFormatRgba16ui: return "Rgba16ui"; + case SpvImageFormatRgba8ui: return "Rgba8ui"; + case SpvImageFormatR32ui: return "R32ui"; + case SpvImageFormatRgb10a2ui: return "Rgb10a2ui"; + case SpvImageFormatRg32ui: return "Rg32ui"; + case SpvImageFormatRg16ui: return "Rg16ui"; + case SpvImageFormatRg8ui: return "Rg8ui"; + case SpvImageFormatR16ui: return "R16ui"; + case SpvImageFormatR8ui: return "R8ui"; + case SpvImageFormatR64ui: return "R64ui"; + case SpvImageFormatR64i: return "R64i"; + default: return "Unknown"; + } +} + +inline const char* SpvImageChannelOrderToString(SpvImageChannelOrder value) { + switch (value) { + case SpvImageChannelOrderR: return "R"; + case SpvImageChannelOrderA: return "A"; + case SpvImageChannelOrderRG: return "RG"; + case SpvImageChannelOrderRA: return "RA"; + case SpvImageChannelOrderRGB: return "RGB"; + case SpvImageChannelOrderRGBA: return "RGBA"; + case SpvImageChannelOrderBGRA: return "BGRA"; + case SpvImageChannelOrderARGB: return "ARGB"; + case SpvImageChannelOrderIntensity: return "Intensity"; + case SpvImageChannelOrderLuminance: return "Luminance"; + case SpvImageChannelOrderRx: return "Rx"; + case SpvImageChannelOrderRGx: return "RGx"; + case SpvImageChannelOrderRGBx: return "RGBx"; + case SpvImageChannelOrderDepth: return "Depth"; + case SpvImageChannelOrderDepthStencil: return "DepthStencil"; + case SpvImageChannelOrdersRGB: return "sRGB"; + case SpvImageChannelOrdersRGBx: return "sRGBx"; + case SpvImageChannelOrdersRGBA: return "sRGBA"; + case SpvImageChannelOrdersBGRA: return "sBGRA"; + case SpvImageChannelOrderABGR: return "ABGR"; + default: return "Unknown"; + } +} + +inline const char* SpvImageChannelDataTypeToString(SpvImageChannelDataType value) { + switch (value) { + case SpvImageChannelDataTypeSnormInt8: return "SnormInt8"; + case SpvImageChannelDataTypeSnormInt16: return "SnormInt16"; + case SpvImageChannelDataTypeUnormInt8: return "UnormInt8"; + case SpvImageChannelDataTypeUnormInt16: return "UnormInt16"; + case SpvImageChannelDataTypeUnormShort565: return "UnormShort565"; + case SpvImageChannelDataTypeUnormShort555: return "UnormShort555"; + case SpvImageChannelDataTypeUnormInt101010: return "UnormInt101010"; + case SpvImageChannelDataTypeSignedInt8: return "SignedInt8"; + case SpvImageChannelDataTypeSignedInt16: return "SignedInt16"; + case SpvImageChannelDataTypeSignedInt32: return "SignedInt32"; + case SpvImageChannelDataTypeUnsignedInt8: return "UnsignedInt8"; + case SpvImageChannelDataTypeUnsignedInt16: return "UnsignedInt16"; + case SpvImageChannelDataTypeUnsignedInt32: return "UnsignedInt32"; + case SpvImageChannelDataTypeHalfFloat: return "HalfFloat"; + case SpvImageChannelDataTypeFloat: return "Float"; + case SpvImageChannelDataTypeUnormInt24: return "UnormInt24"; + case SpvImageChannelDataTypeUnormInt101010_2: return "UnormInt101010_2"; + case SpvImageChannelDataTypeUnormInt10X6EXT: return "UnormInt10X6EXT"; + case SpvImageChannelDataTypeUnsignedIntRaw10EXT: return "UnsignedIntRaw10EXT"; + case SpvImageChannelDataTypeUnsignedIntRaw12EXT: return "UnsignedIntRaw12EXT"; + case SpvImageChannelDataTypeUnormInt2_101010EXT: return "UnormInt2_101010EXT"; + case SpvImageChannelDataTypeUnsignedInt10X6EXT: return "UnsignedInt10X6EXT"; + case SpvImageChannelDataTypeUnsignedInt12X4EXT: return "UnsignedInt12X4EXT"; + case SpvImageChannelDataTypeUnsignedInt14X2EXT: return "UnsignedInt14X2EXT"; + case SpvImageChannelDataTypeUnormInt12X4EXT: return "UnormInt12X4EXT"; + case SpvImageChannelDataTypeUnormInt14X2EXT: return "UnormInt14X2EXT"; + default: return "Unknown"; + } +} + +inline const char* SpvFPRoundingModeToString(SpvFPRoundingMode value) { + switch (value) { + case SpvFPRoundingModeRTE: return "RTE"; + case SpvFPRoundingModeRTZ: return "RTZ"; + case SpvFPRoundingModeRTP: return "RTP"; + case SpvFPRoundingModeRTN: return "RTN"; + default: return "Unknown"; + } +} + +inline const char* SpvLinkageTypeToString(SpvLinkageType value) { + switch (value) { + case SpvLinkageTypeExport: return "Export"; + case SpvLinkageTypeImport: return "Import"; + case SpvLinkageTypeLinkOnceODR: return "LinkOnceODR"; + default: return "Unknown"; + } +} + +inline const char* SpvAccessQualifierToString(SpvAccessQualifier value) { + switch (value) { + case SpvAccessQualifierReadOnly: return "ReadOnly"; + case SpvAccessQualifierWriteOnly: return "WriteOnly"; + case SpvAccessQualifierReadWrite: return "ReadWrite"; + default: return "Unknown"; + } +} + +inline const char* SpvFunctionParameterAttributeToString(SpvFunctionParameterAttribute value) { + switch (value) { + case SpvFunctionParameterAttributeZext: return "Zext"; + case SpvFunctionParameterAttributeSext: return "Sext"; + case SpvFunctionParameterAttributeByVal: return "ByVal"; + case SpvFunctionParameterAttributeSret: return "Sret"; + case SpvFunctionParameterAttributeNoAlias: return "NoAlias"; + case SpvFunctionParameterAttributeNoCapture: return "NoCapture"; + case SpvFunctionParameterAttributeNoWrite: return "NoWrite"; + case SpvFunctionParameterAttributeNoReadWrite: return "NoReadWrite"; + case SpvFunctionParameterAttributeRuntimeAlignedINTEL: return "RuntimeAlignedINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvDecorationToString(SpvDecoration value) { + switch (value) { + case SpvDecorationRelaxedPrecision: return "RelaxedPrecision"; + case SpvDecorationSpecId: return "SpecId"; + case SpvDecorationBlock: return "Block"; + case SpvDecorationBufferBlock: return "BufferBlock"; + case SpvDecorationRowMajor: return "RowMajor"; + case SpvDecorationColMajor: return "ColMajor"; + case SpvDecorationArrayStride: return "ArrayStride"; + case SpvDecorationMatrixStride: return "MatrixStride"; + case SpvDecorationGLSLShared: return "GLSLShared"; + case SpvDecorationGLSLPacked: return "GLSLPacked"; + case SpvDecorationCPacked: return "CPacked"; + case SpvDecorationBuiltIn: return "BuiltIn"; + case SpvDecorationNoPerspective: return "NoPerspective"; + case SpvDecorationFlat: return "Flat"; + case SpvDecorationPatch: return "Patch"; + case SpvDecorationCentroid: return "Centroid"; + case SpvDecorationSample: return "Sample"; + case SpvDecorationInvariant: return "Invariant"; + case SpvDecorationRestrict: return "Restrict"; + case SpvDecorationAliased: return "Aliased"; + case SpvDecorationVolatile: return "Volatile"; + case SpvDecorationConstant: return "Constant"; + case SpvDecorationCoherent: return "Coherent"; + case SpvDecorationNonWritable: return "NonWritable"; + case SpvDecorationNonReadable: return "NonReadable"; + case SpvDecorationUniform: return "Uniform"; + case SpvDecorationUniformId: return "UniformId"; + case SpvDecorationSaturatedConversion: return "SaturatedConversion"; + case SpvDecorationStream: return "Stream"; + case SpvDecorationLocation: return "Location"; + case SpvDecorationComponent: return "Component"; + case SpvDecorationIndex: return "Index"; + case SpvDecorationBinding: return "Binding"; + case SpvDecorationDescriptorSet: return "DescriptorSet"; + case SpvDecorationOffset: return "Offset"; + case SpvDecorationXfbBuffer: return "XfbBuffer"; + case SpvDecorationXfbStride: return "XfbStride"; + case SpvDecorationFuncParamAttr: return "FuncParamAttr"; + case SpvDecorationFPRoundingMode: return "FPRoundingMode"; + case SpvDecorationFPFastMathMode: return "FPFastMathMode"; + case SpvDecorationLinkageAttributes: return "LinkageAttributes"; + case SpvDecorationNoContraction: return "NoContraction"; + case SpvDecorationInputAttachmentIndex: return "InputAttachmentIndex"; + case SpvDecorationAlignment: return "Alignment"; + case SpvDecorationMaxByteOffset: return "MaxByteOffset"; + case SpvDecorationAlignmentId: return "AlignmentId"; + case SpvDecorationMaxByteOffsetId: return "MaxByteOffsetId"; + case SpvDecorationSaturatedToLargestFloat8NormalConversionEXT: return "SaturatedToLargestFloat8NormalConversionEXT"; + case SpvDecorationNoSignedWrap: return "NoSignedWrap"; + case SpvDecorationNoUnsignedWrap: return "NoUnsignedWrap"; + case SpvDecorationWeightTextureQCOM: return "WeightTextureQCOM"; + case SpvDecorationBlockMatchTextureQCOM: return "BlockMatchTextureQCOM"; + case SpvDecorationBlockMatchSamplerQCOM: return "BlockMatchSamplerQCOM"; + case SpvDecorationExplicitInterpAMD: return "ExplicitInterpAMD"; + case SpvDecorationNodeSharesPayloadLimitsWithAMDX: return "NodeSharesPayloadLimitsWithAMDX"; + case SpvDecorationNodeMaxPayloadsAMDX: return "NodeMaxPayloadsAMDX"; + case SpvDecorationTrackFinishWritingAMDX: return "TrackFinishWritingAMDX"; + case SpvDecorationPayloadNodeNameAMDX: return "PayloadNodeNameAMDX"; + case SpvDecorationPayloadNodeBaseIndexAMDX: return "PayloadNodeBaseIndexAMDX"; + case SpvDecorationPayloadNodeSparseArrayAMDX: return "PayloadNodeSparseArrayAMDX"; + case SpvDecorationPayloadNodeArraySizeAMDX: return "PayloadNodeArraySizeAMDX"; + case SpvDecorationPayloadDispatchIndirectAMDX: return "PayloadDispatchIndirectAMDX"; + case SpvDecorationOverrideCoverageNV: return "OverrideCoverageNV"; + case SpvDecorationPassthroughNV: return "PassthroughNV"; + case SpvDecorationViewportRelativeNV: return "ViewportRelativeNV"; + case SpvDecorationSecondaryViewportRelativeNV: return "SecondaryViewportRelativeNV"; + case SpvDecorationPerPrimitiveEXT: return "PerPrimitiveEXT"; + case SpvDecorationPerViewNV: return "PerViewNV"; + case SpvDecorationPerTaskNV: return "PerTaskNV"; + case SpvDecorationPerVertexKHR: return "PerVertexKHR"; + case SpvDecorationNonUniform: return "NonUniform"; + case SpvDecorationRestrictPointer: return "RestrictPointer"; + case SpvDecorationAliasedPointer: return "AliasedPointer"; + case SpvDecorationHitObjectShaderRecordBufferNV: return "HitObjectShaderRecordBufferNV"; + case SpvDecorationBindlessSamplerNV: return "BindlessSamplerNV"; + case SpvDecorationBindlessImageNV: return "BindlessImageNV"; + case SpvDecorationBoundSamplerNV: return "BoundSamplerNV"; + case SpvDecorationBoundImageNV: return "BoundImageNV"; + case SpvDecorationSIMTCallINTEL: return "SIMTCallINTEL"; + case SpvDecorationReferencedIndirectlyINTEL: return "ReferencedIndirectlyINTEL"; + case SpvDecorationClobberINTEL: return "ClobberINTEL"; + case SpvDecorationSideEffectsINTEL: return "SideEffectsINTEL"; + case SpvDecorationVectorComputeVariableINTEL: return "VectorComputeVariableINTEL"; + case SpvDecorationFuncParamIOKindINTEL: return "FuncParamIOKindINTEL"; + case SpvDecorationVectorComputeFunctionINTEL: return "VectorComputeFunctionINTEL"; + case SpvDecorationStackCallINTEL: return "StackCallINTEL"; + case SpvDecorationGlobalVariableOffsetINTEL: return "GlobalVariableOffsetINTEL"; + case SpvDecorationCounterBuffer: return "CounterBuffer"; + case SpvDecorationHlslSemanticGOOGLE: return "HlslSemanticGOOGLE"; + case SpvDecorationUserTypeGOOGLE: return "UserTypeGOOGLE"; + case SpvDecorationFunctionRoundingModeINTEL: return "FunctionRoundingModeINTEL"; + case SpvDecorationFunctionDenormModeINTEL: return "FunctionDenormModeINTEL"; + case SpvDecorationRegisterINTEL: return "RegisterINTEL"; + case SpvDecorationMemoryINTEL: return "MemoryINTEL"; + case SpvDecorationNumbanksINTEL: return "NumbanksINTEL"; + case SpvDecorationBankwidthINTEL: return "BankwidthINTEL"; + case SpvDecorationMaxPrivateCopiesINTEL: return "MaxPrivateCopiesINTEL"; + case SpvDecorationSinglepumpINTEL: return "SinglepumpINTEL"; + case SpvDecorationDoublepumpINTEL: return "DoublepumpINTEL"; + case SpvDecorationMaxReplicatesINTEL: return "MaxReplicatesINTEL"; + case SpvDecorationSimpleDualPortINTEL: return "SimpleDualPortINTEL"; + case SpvDecorationMergeINTEL: return "MergeINTEL"; + case SpvDecorationBankBitsINTEL: return "BankBitsINTEL"; + case SpvDecorationForcePow2DepthINTEL: return "ForcePow2DepthINTEL"; + case SpvDecorationStridesizeINTEL: return "StridesizeINTEL"; + case SpvDecorationWordsizeINTEL: return "WordsizeINTEL"; + case SpvDecorationTrueDualPortINTEL: return "TrueDualPortINTEL"; + case SpvDecorationBurstCoalesceINTEL: return "BurstCoalesceINTEL"; + case SpvDecorationCacheSizeINTEL: return "CacheSizeINTEL"; + case SpvDecorationDontStaticallyCoalesceINTEL: return "DontStaticallyCoalesceINTEL"; + case SpvDecorationPrefetchINTEL: return "PrefetchINTEL"; + case SpvDecorationStallEnableINTEL: return "StallEnableINTEL"; + case SpvDecorationFuseLoopsInFunctionINTEL: return "FuseLoopsInFunctionINTEL"; + case SpvDecorationMathOpDSPModeINTEL: return "MathOpDSPModeINTEL"; + case SpvDecorationAliasScopeINTEL: return "AliasScopeINTEL"; + case SpvDecorationNoAliasINTEL: return "NoAliasINTEL"; + case SpvDecorationInitiationIntervalINTEL: return "InitiationIntervalINTEL"; + case SpvDecorationMaxConcurrencyINTEL: return "MaxConcurrencyINTEL"; + case SpvDecorationPipelineEnableINTEL: return "PipelineEnableINTEL"; + case SpvDecorationBufferLocationINTEL: return "BufferLocationINTEL"; + case SpvDecorationIOPipeStorageINTEL: return "IOPipeStorageINTEL"; + case SpvDecorationFunctionFloatingPointModeINTEL: return "FunctionFloatingPointModeINTEL"; + case SpvDecorationSingleElementVectorINTEL: return "SingleElementVectorINTEL"; + case SpvDecorationVectorComputeCallableFunctionINTEL: return "VectorComputeCallableFunctionINTEL"; + case SpvDecorationMediaBlockIOINTEL: return "MediaBlockIOINTEL"; + case SpvDecorationStallFreeINTEL: return "StallFreeINTEL"; + case SpvDecorationFPMaxErrorDecorationINTEL: return "FPMaxErrorDecorationINTEL"; + case SpvDecorationLatencyControlLabelINTEL: return "LatencyControlLabelINTEL"; + case SpvDecorationLatencyControlConstraintINTEL: return "LatencyControlConstraintINTEL"; + case SpvDecorationConduitKernelArgumentINTEL: return "ConduitKernelArgumentINTEL"; + case SpvDecorationRegisterMapKernelArgumentINTEL: return "RegisterMapKernelArgumentINTEL"; + case SpvDecorationMMHostInterfaceAddressWidthINTEL: return "MMHostInterfaceAddressWidthINTEL"; + case SpvDecorationMMHostInterfaceDataWidthINTEL: return "MMHostInterfaceDataWidthINTEL"; + case SpvDecorationMMHostInterfaceLatencyINTEL: return "MMHostInterfaceLatencyINTEL"; + case SpvDecorationMMHostInterfaceReadWriteModeINTEL: return "MMHostInterfaceReadWriteModeINTEL"; + case SpvDecorationMMHostInterfaceMaxBurstINTEL: return "MMHostInterfaceMaxBurstINTEL"; + case SpvDecorationMMHostInterfaceWaitRequestINTEL: return "MMHostInterfaceWaitRequestINTEL"; + case SpvDecorationStableKernelArgumentINTEL: return "StableKernelArgumentINTEL"; + case SpvDecorationHostAccessINTEL: return "HostAccessINTEL"; + case SpvDecorationInitModeINTEL: return "InitModeINTEL"; + case SpvDecorationImplementInRegisterMapINTEL: return "ImplementInRegisterMapINTEL"; + case SpvDecorationConditionalINTEL: return "ConditionalINTEL"; + case SpvDecorationCacheControlLoadINTEL: return "CacheControlLoadINTEL"; + case SpvDecorationCacheControlStoreINTEL: return "CacheControlStoreINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvBuiltInToString(SpvBuiltIn value) { + switch (value) { + case SpvBuiltInPosition: return "Position"; + case SpvBuiltInPointSize: return "PointSize"; + case SpvBuiltInClipDistance: return "ClipDistance"; + case SpvBuiltInCullDistance: return "CullDistance"; + case SpvBuiltInVertexId: return "VertexId"; + case SpvBuiltInInstanceId: return "InstanceId"; + case SpvBuiltInPrimitiveId: return "PrimitiveId"; + case SpvBuiltInInvocationId: return "InvocationId"; + case SpvBuiltInLayer: return "Layer"; + case SpvBuiltInViewportIndex: return "ViewportIndex"; + case SpvBuiltInTessLevelOuter: return "TessLevelOuter"; + case SpvBuiltInTessLevelInner: return "TessLevelInner"; + case SpvBuiltInTessCoord: return "TessCoord"; + case SpvBuiltInPatchVertices: return "PatchVertices"; + case SpvBuiltInFragCoord: return "FragCoord"; + case SpvBuiltInPointCoord: return "PointCoord"; + case SpvBuiltInFrontFacing: return "FrontFacing"; + case SpvBuiltInSampleId: return "SampleId"; + case SpvBuiltInSamplePosition: return "SamplePosition"; + case SpvBuiltInSampleMask: return "SampleMask"; + case SpvBuiltInFragDepth: return "FragDepth"; + case SpvBuiltInHelperInvocation: return "HelperInvocation"; + case SpvBuiltInNumWorkgroups: return "NumWorkgroups"; + case SpvBuiltInWorkgroupSize: return "WorkgroupSize"; + case SpvBuiltInWorkgroupId: return "WorkgroupId"; + case SpvBuiltInLocalInvocationId: return "LocalInvocationId"; + case SpvBuiltInGlobalInvocationId: return "GlobalInvocationId"; + case SpvBuiltInLocalInvocationIndex: return "LocalInvocationIndex"; + case SpvBuiltInWorkDim: return "WorkDim"; + case SpvBuiltInGlobalSize: return "GlobalSize"; + case SpvBuiltInEnqueuedWorkgroupSize: return "EnqueuedWorkgroupSize"; + case SpvBuiltInGlobalOffset: return "GlobalOffset"; + case SpvBuiltInGlobalLinearId: return "GlobalLinearId"; + case SpvBuiltInSubgroupSize: return "SubgroupSize"; + case SpvBuiltInSubgroupMaxSize: return "SubgroupMaxSize"; + case SpvBuiltInNumSubgroups: return "NumSubgroups"; + case SpvBuiltInNumEnqueuedSubgroups: return "NumEnqueuedSubgroups"; + case SpvBuiltInSubgroupId: return "SubgroupId"; + case SpvBuiltInSubgroupLocalInvocationId: return "SubgroupLocalInvocationId"; + case SpvBuiltInVertexIndex: return "VertexIndex"; + case SpvBuiltInInstanceIndex: return "InstanceIndex"; + case SpvBuiltInCoreIDARM: return "CoreIDARM"; + case SpvBuiltInCoreCountARM: return "CoreCountARM"; + case SpvBuiltInCoreMaxIDARM: return "CoreMaxIDARM"; + case SpvBuiltInWarpIDARM: return "WarpIDARM"; + case SpvBuiltInWarpMaxIDARM: return "WarpMaxIDARM"; + case SpvBuiltInSubgroupEqMask: return "SubgroupEqMask"; + case SpvBuiltInSubgroupGeMask: return "SubgroupGeMask"; + case SpvBuiltInSubgroupGtMask: return "SubgroupGtMask"; + case SpvBuiltInSubgroupLeMask: return "SubgroupLeMask"; + case SpvBuiltInSubgroupLtMask: return "SubgroupLtMask"; + case SpvBuiltInBaseVertex: return "BaseVertex"; + case SpvBuiltInBaseInstance: return "BaseInstance"; + case SpvBuiltInDrawIndex: return "DrawIndex"; + case SpvBuiltInPrimitiveShadingRateKHR: return "PrimitiveShadingRateKHR"; + case SpvBuiltInDeviceIndex: return "DeviceIndex"; + case SpvBuiltInViewIndex: return "ViewIndex"; + case SpvBuiltInShadingRateKHR: return "ShadingRateKHR"; + case SpvBuiltInTileOffsetQCOM: return "TileOffsetQCOM"; + case SpvBuiltInTileDimensionQCOM: return "TileDimensionQCOM"; + case SpvBuiltInTileApronSizeQCOM: return "TileApronSizeQCOM"; + case SpvBuiltInBaryCoordNoPerspAMD: return "BaryCoordNoPerspAMD"; + case SpvBuiltInBaryCoordNoPerspCentroidAMD: return "BaryCoordNoPerspCentroidAMD"; + case SpvBuiltInBaryCoordNoPerspSampleAMD: return "BaryCoordNoPerspSampleAMD"; + case SpvBuiltInBaryCoordSmoothAMD: return "BaryCoordSmoothAMD"; + case SpvBuiltInBaryCoordSmoothCentroidAMD: return "BaryCoordSmoothCentroidAMD"; + case SpvBuiltInBaryCoordSmoothSampleAMD: return "BaryCoordSmoothSampleAMD"; + case SpvBuiltInBaryCoordPullModelAMD: return "BaryCoordPullModelAMD"; + case SpvBuiltInFragStencilRefEXT: return "FragStencilRefEXT"; + case SpvBuiltInRemainingRecursionLevelsAMDX: return "RemainingRecursionLevelsAMDX"; + case SpvBuiltInShaderIndexAMDX: return "ShaderIndexAMDX"; + case SpvBuiltInViewportMaskNV: return "ViewportMaskNV"; + case SpvBuiltInSecondaryPositionNV: return "SecondaryPositionNV"; + case SpvBuiltInSecondaryViewportMaskNV: return "SecondaryViewportMaskNV"; + case SpvBuiltInPositionPerViewNV: return "PositionPerViewNV"; + case SpvBuiltInViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; + case SpvBuiltInFullyCoveredEXT: return "FullyCoveredEXT"; + case SpvBuiltInTaskCountNV: return "TaskCountNV"; + case SpvBuiltInPrimitiveCountNV: return "PrimitiveCountNV"; + case SpvBuiltInPrimitiveIndicesNV: return "PrimitiveIndicesNV"; + case SpvBuiltInClipDistancePerViewNV: return "ClipDistancePerViewNV"; + case SpvBuiltInCullDistancePerViewNV: return "CullDistancePerViewNV"; + case SpvBuiltInLayerPerViewNV: return "LayerPerViewNV"; + case SpvBuiltInMeshViewCountNV: return "MeshViewCountNV"; + case SpvBuiltInMeshViewIndicesNV: return "MeshViewIndicesNV"; + case SpvBuiltInBaryCoordKHR: return "BaryCoordKHR"; + case SpvBuiltInBaryCoordNoPerspKHR: return "BaryCoordNoPerspKHR"; + case SpvBuiltInFragSizeEXT: return "FragSizeEXT"; + case SpvBuiltInFragInvocationCountEXT: return "FragInvocationCountEXT"; + case SpvBuiltInPrimitivePointIndicesEXT: return "PrimitivePointIndicesEXT"; + case SpvBuiltInPrimitiveLineIndicesEXT: return "PrimitiveLineIndicesEXT"; + case SpvBuiltInPrimitiveTriangleIndicesEXT: return "PrimitiveTriangleIndicesEXT"; + case SpvBuiltInCullPrimitiveEXT: return "CullPrimitiveEXT"; + case SpvBuiltInLaunchIdKHR: return "LaunchIdKHR"; + case SpvBuiltInLaunchSizeKHR: return "LaunchSizeKHR"; + case SpvBuiltInWorldRayOriginKHR: return "WorldRayOriginKHR"; + case SpvBuiltInWorldRayDirectionKHR: return "WorldRayDirectionKHR"; + case SpvBuiltInObjectRayOriginKHR: return "ObjectRayOriginKHR"; + case SpvBuiltInObjectRayDirectionKHR: return "ObjectRayDirectionKHR"; + case SpvBuiltInRayTminKHR: return "RayTminKHR"; + case SpvBuiltInRayTmaxKHR: return "RayTmaxKHR"; + case SpvBuiltInInstanceCustomIndexKHR: return "InstanceCustomIndexKHR"; + case SpvBuiltInObjectToWorldKHR: return "ObjectToWorldKHR"; + case SpvBuiltInWorldToObjectKHR: return "WorldToObjectKHR"; + case SpvBuiltInHitTNV: return "HitTNV"; + case SpvBuiltInHitKindKHR: return "HitKindKHR"; + case SpvBuiltInCurrentRayTimeNV: return "CurrentRayTimeNV"; + case SpvBuiltInHitTriangleVertexPositionsKHR: return "HitTriangleVertexPositionsKHR"; + case SpvBuiltInHitMicroTriangleVertexPositionsNV: return "HitMicroTriangleVertexPositionsNV"; + case SpvBuiltInHitMicroTriangleVertexBarycentricsNV: return "HitMicroTriangleVertexBarycentricsNV"; + case SpvBuiltInIncomingRayFlagsKHR: return "IncomingRayFlagsKHR"; + case SpvBuiltInRayGeometryIndexKHR: return "RayGeometryIndexKHR"; + case SpvBuiltInHitIsSphereNV: return "HitIsSphereNV"; + case SpvBuiltInHitIsLSSNV: return "HitIsLSSNV"; + case SpvBuiltInHitSpherePositionNV: return "HitSpherePositionNV"; + case SpvBuiltInWarpsPerSMNV: return "WarpsPerSMNV"; + case SpvBuiltInSMCountNV: return "SMCountNV"; + case SpvBuiltInWarpIDNV: return "WarpIDNV"; + case SpvBuiltInSMIDNV: return "SMIDNV"; + case SpvBuiltInHitLSSPositionsNV: return "HitLSSPositionsNV"; + case SpvBuiltInHitKindFrontFacingMicroTriangleNV: return "HitKindFrontFacingMicroTriangleNV"; + case SpvBuiltInHitKindBackFacingMicroTriangleNV: return "HitKindBackFacingMicroTriangleNV"; + case SpvBuiltInHitSphereRadiusNV: return "HitSphereRadiusNV"; + case SpvBuiltInHitLSSRadiiNV: return "HitLSSRadiiNV"; + case SpvBuiltInClusterIDNV: return "ClusterIDNV"; + case SpvBuiltInCullMaskKHR: return "CullMaskKHR"; + default: return "Unknown"; + } +} + +inline const char* SpvScopeToString(SpvScope value) { + switch (value) { + case SpvScopeCrossDevice: return "CrossDevice"; + case SpvScopeDevice: return "Device"; + case SpvScopeWorkgroup: return "Workgroup"; + case SpvScopeSubgroup: return "Subgroup"; + case SpvScopeInvocation: return "Invocation"; + case SpvScopeQueueFamily: return "QueueFamily"; + case SpvScopeShaderCallKHR: return "ShaderCallKHR"; + default: return "Unknown"; + } +} + +inline const char* SpvGroupOperationToString(SpvGroupOperation value) { + switch (value) { + case SpvGroupOperationReduce: return "Reduce"; + case SpvGroupOperationInclusiveScan: return "InclusiveScan"; + case SpvGroupOperationExclusiveScan: return "ExclusiveScan"; + case SpvGroupOperationClusteredReduce: return "ClusteredReduce"; + case SpvGroupOperationPartitionedReduceNV: return "PartitionedReduceNV"; + case SpvGroupOperationPartitionedInclusiveScanNV: return "PartitionedInclusiveScanNV"; + case SpvGroupOperationPartitionedExclusiveScanNV: return "PartitionedExclusiveScanNV"; + default: return "Unknown"; + } +} + +inline const char* SpvKernelEnqueueFlagsToString(SpvKernelEnqueueFlags value) { + switch (value) { + case SpvKernelEnqueueFlagsNoWait: return "NoWait"; + case SpvKernelEnqueueFlagsWaitKernel: return "WaitKernel"; + case SpvKernelEnqueueFlagsWaitWorkGroup: return "WaitWorkGroup"; + default: return "Unknown"; + } +} + +inline const char* SpvCapabilityToString(SpvCapability value) { + switch (value) { + case SpvCapabilityMatrix: return "Matrix"; + case SpvCapabilityShader: return "Shader"; + case SpvCapabilityGeometry: return "Geometry"; + case SpvCapabilityTessellation: return "Tessellation"; + case SpvCapabilityAddresses: return "Addresses"; + case SpvCapabilityLinkage: return "Linkage"; + case SpvCapabilityKernel: return "Kernel"; + case SpvCapabilityVector16: return "Vector16"; + case SpvCapabilityFloat16Buffer: return "Float16Buffer"; + case SpvCapabilityFloat16: return "Float16"; + case SpvCapabilityFloat64: return "Float64"; + case SpvCapabilityInt64: return "Int64"; + case SpvCapabilityInt64Atomics: return "Int64Atomics"; + case SpvCapabilityImageBasic: return "ImageBasic"; + case SpvCapabilityImageReadWrite: return "ImageReadWrite"; + case SpvCapabilityImageMipmap: return "ImageMipmap"; + case SpvCapabilityPipes: return "Pipes"; + case SpvCapabilityGroups: return "Groups"; + case SpvCapabilityDeviceEnqueue: return "DeviceEnqueue"; + case SpvCapabilityLiteralSampler: return "LiteralSampler"; + case SpvCapabilityAtomicStorage: return "AtomicStorage"; + case SpvCapabilityInt16: return "Int16"; + case SpvCapabilityTessellationPointSize: return "TessellationPointSize"; + case SpvCapabilityGeometryPointSize: return "GeometryPointSize"; + case SpvCapabilityImageGatherExtended: return "ImageGatherExtended"; + case SpvCapabilityStorageImageMultisample: return "StorageImageMultisample"; + case SpvCapabilityUniformBufferArrayDynamicIndexing: return "UniformBufferArrayDynamicIndexing"; + case SpvCapabilitySampledImageArrayDynamicIndexing: return "SampledImageArrayDynamicIndexing"; + case SpvCapabilityStorageBufferArrayDynamicIndexing: return "StorageBufferArrayDynamicIndexing"; + case SpvCapabilityStorageImageArrayDynamicIndexing: return "StorageImageArrayDynamicIndexing"; + case SpvCapabilityClipDistance: return "ClipDistance"; + case SpvCapabilityCullDistance: return "CullDistance"; + case SpvCapabilityImageCubeArray: return "ImageCubeArray"; + case SpvCapabilitySampleRateShading: return "SampleRateShading"; + case SpvCapabilityImageRect: return "ImageRect"; + case SpvCapabilitySampledRect: return "SampledRect"; + case SpvCapabilityGenericPointer: return "GenericPointer"; + case SpvCapabilityInt8: return "Int8"; + case SpvCapabilityInputAttachment: return "InputAttachment"; + case SpvCapabilitySparseResidency: return "SparseResidency"; + case SpvCapabilityMinLod: return "MinLod"; + case SpvCapabilitySampled1D: return "Sampled1D"; + case SpvCapabilityImage1D: return "Image1D"; + case SpvCapabilitySampledCubeArray: return "SampledCubeArray"; + case SpvCapabilitySampledBuffer: return "SampledBuffer"; + case SpvCapabilityImageBuffer: return "ImageBuffer"; + case SpvCapabilityImageMSArray: return "ImageMSArray"; + case SpvCapabilityStorageImageExtendedFormats: return "StorageImageExtendedFormats"; + case SpvCapabilityImageQuery: return "ImageQuery"; + case SpvCapabilityDerivativeControl: return "DerivativeControl"; + case SpvCapabilityInterpolationFunction: return "InterpolationFunction"; + case SpvCapabilityTransformFeedback: return "TransformFeedback"; + case SpvCapabilityGeometryStreams: return "GeometryStreams"; + case SpvCapabilityStorageImageReadWithoutFormat: return "StorageImageReadWithoutFormat"; + case SpvCapabilityStorageImageWriteWithoutFormat: return "StorageImageWriteWithoutFormat"; + case SpvCapabilityMultiViewport: return "MultiViewport"; + case SpvCapabilitySubgroupDispatch: return "SubgroupDispatch"; + case SpvCapabilityNamedBarrier: return "NamedBarrier"; + case SpvCapabilityPipeStorage: return "PipeStorage"; + case SpvCapabilityGroupNonUniform: return "GroupNonUniform"; + case SpvCapabilityGroupNonUniformVote: return "GroupNonUniformVote"; + case SpvCapabilityGroupNonUniformArithmetic: return "GroupNonUniformArithmetic"; + case SpvCapabilityGroupNonUniformBallot: return "GroupNonUniformBallot"; + case SpvCapabilityGroupNonUniformShuffle: return "GroupNonUniformShuffle"; + case SpvCapabilityGroupNonUniformShuffleRelative: return "GroupNonUniformShuffleRelative"; + case SpvCapabilityGroupNonUniformClustered: return "GroupNonUniformClustered"; + case SpvCapabilityGroupNonUniformQuad: return "GroupNonUniformQuad"; + case SpvCapabilityShaderLayer: return "ShaderLayer"; + case SpvCapabilityShaderViewportIndex: return "ShaderViewportIndex"; + case SpvCapabilityUniformDecoration: return "UniformDecoration"; + case SpvCapabilityCoreBuiltinsARM: return "CoreBuiltinsARM"; + case SpvCapabilityTileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT"; + case SpvCapabilityTileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT"; + case SpvCapabilityTileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT"; + case SpvCapabilityTensorsARM: return "TensorsARM"; + case SpvCapabilityStorageTensorArrayDynamicIndexingARM: return "StorageTensorArrayDynamicIndexingARM"; + case SpvCapabilityStorageTensorArrayNonUniformIndexingARM: return "StorageTensorArrayNonUniformIndexingARM"; + case SpvCapabilityGraphARM: return "GraphARM"; + case SpvCapabilityCooperativeMatrixLayoutsARM: return "CooperativeMatrixLayoutsARM"; + case SpvCapabilityFloat8EXT: return "Float8EXT"; + case SpvCapabilityFloat8CooperativeMatrixEXT: return "Float8CooperativeMatrixEXT"; + case SpvCapabilityFragmentShadingRateKHR: return "FragmentShadingRateKHR"; + case SpvCapabilitySubgroupBallotKHR: return "SubgroupBallotKHR"; + case SpvCapabilityDrawParameters: return "DrawParameters"; + case SpvCapabilityWorkgroupMemoryExplicitLayoutKHR: return "WorkgroupMemoryExplicitLayoutKHR"; + case SpvCapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR: return "WorkgroupMemoryExplicitLayout8BitAccessKHR"; + case SpvCapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR: return "WorkgroupMemoryExplicitLayout16BitAccessKHR"; + case SpvCapabilitySubgroupVoteKHR: return "SubgroupVoteKHR"; + case SpvCapabilityStorageBuffer16BitAccess: return "StorageBuffer16BitAccess"; + case SpvCapabilityStorageUniform16: return "StorageUniform16"; + case SpvCapabilityStoragePushConstant16: return "StoragePushConstant16"; + case SpvCapabilityStorageInputOutput16: return "StorageInputOutput16"; + case SpvCapabilityDeviceGroup: return "DeviceGroup"; + case SpvCapabilityMultiView: return "MultiView"; + case SpvCapabilityVariablePointersStorageBuffer: return "VariablePointersStorageBuffer"; + case SpvCapabilityVariablePointers: return "VariablePointers"; + case SpvCapabilityAtomicStorageOps: return "AtomicStorageOps"; + case SpvCapabilitySampleMaskPostDepthCoverage: return "SampleMaskPostDepthCoverage"; + case SpvCapabilityStorageBuffer8BitAccess: return "StorageBuffer8BitAccess"; + case SpvCapabilityUniformAndStorageBuffer8BitAccess: return "UniformAndStorageBuffer8BitAccess"; + case SpvCapabilityStoragePushConstant8: return "StoragePushConstant8"; + case SpvCapabilityDenormPreserve: return "DenormPreserve"; + case SpvCapabilityDenormFlushToZero: return "DenormFlushToZero"; + case SpvCapabilitySignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve"; + case SpvCapabilityRoundingModeRTE: return "RoundingModeRTE"; + case SpvCapabilityRoundingModeRTZ: return "RoundingModeRTZ"; + case SpvCapabilityRayQueryProvisionalKHR: return "RayQueryProvisionalKHR"; + case SpvCapabilityRayQueryKHR: return "RayQueryKHR"; + case SpvCapabilityUntypedPointersKHR: return "UntypedPointersKHR"; + case SpvCapabilityRayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR"; + case SpvCapabilityRayTracingKHR: return "RayTracingKHR"; + case SpvCapabilityTextureSampleWeightedQCOM: return "TextureSampleWeightedQCOM"; + case SpvCapabilityTextureBoxFilterQCOM: return "TextureBoxFilterQCOM"; + case SpvCapabilityTextureBlockMatchQCOM: return "TextureBlockMatchQCOM"; + case SpvCapabilityTileShadingQCOM: return "TileShadingQCOM"; + case SpvCapabilityCooperativeMatrixConversionQCOM: return "CooperativeMatrixConversionQCOM"; + case SpvCapabilityTextureBlockMatch2QCOM: return "TextureBlockMatch2QCOM"; + case SpvCapabilityFloat16ImageAMD: return "Float16ImageAMD"; + case SpvCapabilityImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD"; + case SpvCapabilityFragmentMaskAMD: return "FragmentMaskAMD"; + case SpvCapabilityStencilExportEXT: return "StencilExportEXT"; + case SpvCapabilityImageReadWriteLodAMD: return "ImageReadWriteLodAMD"; + case SpvCapabilityInt64ImageEXT: return "Int64ImageEXT"; + case SpvCapabilityShaderClockKHR: return "ShaderClockKHR"; + case SpvCapabilityShaderEnqueueAMDX: return "ShaderEnqueueAMDX"; + case SpvCapabilityQuadControlKHR: return "QuadControlKHR"; + case SpvCapabilityInt4TypeINTEL: return "Int4TypeINTEL"; + case SpvCapabilityInt4CooperativeMatrixINTEL: return "Int4CooperativeMatrixINTEL"; + case SpvCapabilityBFloat16TypeKHR: return "BFloat16TypeKHR"; + case SpvCapabilityBFloat16DotProductKHR: return "BFloat16DotProductKHR"; + case SpvCapabilityBFloat16CooperativeMatrixKHR: return "BFloat16CooperativeMatrixKHR"; + case SpvCapabilitySampleMaskOverrideCoverageNV: return "SampleMaskOverrideCoverageNV"; + case SpvCapabilityGeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV"; + case SpvCapabilityShaderViewportIndexLayerEXT: return "ShaderViewportIndexLayerEXT"; + case SpvCapabilityShaderViewportMaskNV: return "ShaderViewportMaskNV"; + case SpvCapabilityShaderStereoViewNV: return "ShaderStereoViewNV"; + case SpvCapabilityPerViewAttributesNV: return "PerViewAttributesNV"; + case SpvCapabilityFragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT"; + case SpvCapabilityMeshShadingNV: return "MeshShadingNV"; + case SpvCapabilityImageFootprintNV: return "ImageFootprintNV"; + case SpvCapabilityMeshShadingEXT: return "MeshShadingEXT"; + case SpvCapabilityFragmentBarycentricKHR: return "FragmentBarycentricKHR"; + case SpvCapabilityComputeDerivativeGroupQuadsKHR: return "ComputeDerivativeGroupQuadsKHR"; + case SpvCapabilityFragmentDensityEXT: return "FragmentDensityEXT"; + case SpvCapabilityGroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV"; + case SpvCapabilityShaderNonUniform: return "ShaderNonUniform"; + case SpvCapabilityRuntimeDescriptorArray: return "RuntimeDescriptorArray"; + case SpvCapabilityInputAttachmentArrayDynamicIndexing: return "InputAttachmentArrayDynamicIndexing"; + case SpvCapabilityUniformTexelBufferArrayDynamicIndexing: return "UniformTexelBufferArrayDynamicIndexing"; + case SpvCapabilityStorageTexelBufferArrayDynamicIndexing: return "StorageTexelBufferArrayDynamicIndexing"; + case SpvCapabilityUniformBufferArrayNonUniformIndexing: return "UniformBufferArrayNonUniformIndexing"; + case SpvCapabilitySampledImageArrayNonUniformIndexing: return "SampledImageArrayNonUniformIndexing"; + case SpvCapabilityStorageBufferArrayNonUniformIndexing: return "StorageBufferArrayNonUniformIndexing"; + case SpvCapabilityStorageImageArrayNonUniformIndexing: return "StorageImageArrayNonUniformIndexing"; + case SpvCapabilityInputAttachmentArrayNonUniformIndexing: return "InputAttachmentArrayNonUniformIndexing"; + case SpvCapabilityUniformTexelBufferArrayNonUniformIndexing: return "UniformTexelBufferArrayNonUniformIndexing"; + case SpvCapabilityStorageTexelBufferArrayNonUniformIndexing: return "StorageTexelBufferArrayNonUniformIndexing"; + case SpvCapabilityRayTracingPositionFetchKHR: return "RayTracingPositionFetchKHR"; + case SpvCapabilityRayTracingNV: return "RayTracingNV"; + case SpvCapabilityRayTracingMotionBlurNV: return "RayTracingMotionBlurNV"; + case SpvCapabilityVulkanMemoryModel: return "VulkanMemoryModel"; + case SpvCapabilityVulkanMemoryModelDeviceScope: return "VulkanMemoryModelDeviceScope"; + case SpvCapabilityPhysicalStorageBufferAddresses: return "PhysicalStorageBufferAddresses"; + case SpvCapabilityComputeDerivativeGroupLinearKHR: return "ComputeDerivativeGroupLinearKHR"; + case SpvCapabilityRayTracingProvisionalKHR: return "RayTracingProvisionalKHR"; + case SpvCapabilityCooperativeMatrixNV: return "CooperativeMatrixNV"; + case SpvCapabilityFragmentShaderSampleInterlockEXT: return "FragmentShaderSampleInterlockEXT"; + case SpvCapabilityFragmentShaderShadingRateInterlockEXT: return "FragmentShaderShadingRateInterlockEXT"; + case SpvCapabilityShaderSMBuiltinsNV: return "ShaderSMBuiltinsNV"; + case SpvCapabilityFragmentShaderPixelInterlockEXT: return "FragmentShaderPixelInterlockEXT"; + case SpvCapabilityDemoteToHelperInvocation: return "DemoteToHelperInvocation"; + case SpvCapabilityDisplacementMicromapNV: return "DisplacementMicromapNV"; + case SpvCapabilityRayTracingOpacityMicromapEXT: return "RayTracingOpacityMicromapEXT"; + case SpvCapabilityShaderInvocationReorderNV: return "ShaderInvocationReorderNV"; + case SpvCapabilityBindlessTextureNV: return "BindlessTextureNV"; + case SpvCapabilityRayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR"; + case SpvCapabilityCooperativeVectorNV: return "CooperativeVectorNV"; + case SpvCapabilityAtomicFloat16VectorNV: return "AtomicFloat16VectorNV"; + case SpvCapabilityRayTracingDisplacementMicromapNV: return "RayTracingDisplacementMicromapNV"; + case SpvCapabilityRawAccessChainsNV: return "RawAccessChainsNV"; + case SpvCapabilityRayTracingSpheresGeometryNV: return "RayTracingSpheresGeometryNV"; + case SpvCapabilityRayTracingLinearSweptSpheresGeometryNV: return "RayTracingLinearSweptSpheresGeometryNV"; + case SpvCapabilityCooperativeMatrixReductionsNV: return "CooperativeMatrixReductionsNV"; + case SpvCapabilityCooperativeMatrixConversionsNV: return "CooperativeMatrixConversionsNV"; + case SpvCapabilityCooperativeMatrixPerElementOperationsNV: return "CooperativeMatrixPerElementOperationsNV"; + case SpvCapabilityCooperativeMatrixTensorAddressingNV: return "CooperativeMatrixTensorAddressingNV"; + case SpvCapabilityCooperativeMatrixBlockLoadsNV: return "CooperativeMatrixBlockLoadsNV"; + case SpvCapabilityCooperativeVectorTrainingNV: return "CooperativeVectorTrainingNV"; + case SpvCapabilityRayTracingClusterAccelerationStructureNV: return "RayTracingClusterAccelerationStructureNV"; + case SpvCapabilityTensorAddressingNV: return "TensorAddressingNV"; + case SpvCapabilitySubgroupShuffleINTEL: return "SubgroupShuffleINTEL"; + case SpvCapabilitySubgroupBufferBlockIOINTEL: return "SubgroupBufferBlockIOINTEL"; + case SpvCapabilitySubgroupImageBlockIOINTEL: return "SubgroupImageBlockIOINTEL"; + case SpvCapabilitySubgroupImageMediaBlockIOINTEL: return "SubgroupImageMediaBlockIOINTEL"; + case SpvCapabilityRoundToInfinityINTEL: return "RoundToInfinityINTEL"; + case SpvCapabilityFloatingPointModeINTEL: return "FloatingPointModeINTEL"; + case SpvCapabilityIntegerFunctions2INTEL: return "IntegerFunctions2INTEL"; + case SpvCapabilityFunctionPointersINTEL: return "FunctionPointersINTEL"; + case SpvCapabilityIndirectReferencesINTEL: return "IndirectReferencesINTEL"; + case SpvCapabilityAsmINTEL: return "AsmINTEL"; + case SpvCapabilityAtomicFloat32MinMaxEXT: return "AtomicFloat32MinMaxEXT"; + case SpvCapabilityAtomicFloat64MinMaxEXT: return "AtomicFloat64MinMaxEXT"; + case SpvCapabilityAtomicFloat16MinMaxEXT: return "AtomicFloat16MinMaxEXT"; + case SpvCapabilityVectorComputeINTEL: return "VectorComputeINTEL"; + case SpvCapabilityVectorAnyINTEL: return "VectorAnyINTEL"; + case SpvCapabilityExpectAssumeKHR: return "ExpectAssumeKHR"; + case SpvCapabilitySubgroupAvcMotionEstimationINTEL: return "SubgroupAvcMotionEstimationINTEL"; + case SpvCapabilitySubgroupAvcMotionEstimationIntraINTEL: return "SubgroupAvcMotionEstimationIntraINTEL"; + case SpvCapabilitySubgroupAvcMotionEstimationChromaINTEL: return "SubgroupAvcMotionEstimationChromaINTEL"; + case SpvCapabilityVariableLengthArrayINTEL: return "VariableLengthArrayINTEL"; + case SpvCapabilityFunctionFloatControlINTEL: return "FunctionFloatControlINTEL"; + case SpvCapabilityFPGAMemoryAttributesINTEL: return "FPGAMemoryAttributesINTEL"; + case SpvCapabilityFPFastMathModeINTEL: return "FPFastMathModeINTEL"; + case SpvCapabilityArbitraryPrecisionIntegersINTEL: return "ArbitraryPrecisionIntegersINTEL"; + case SpvCapabilityArbitraryPrecisionFloatingPointINTEL: return "ArbitraryPrecisionFloatingPointINTEL"; + case SpvCapabilityUnstructuredLoopControlsINTEL: return "UnstructuredLoopControlsINTEL"; + case SpvCapabilityFPGALoopControlsINTEL: return "FPGALoopControlsINTEL"; + case SpvCapabilityKernelAttributesINTEL: return "KernelAttributesINTEL"; + case SpvCapabilityFPGAKernelAttributesINTEL: return "FPGAKernelAttributesINTEL"; + case SpvCapabilityFPGAMemoryAccessesINTEL: return "FPGAMemoryAccessesINTEL"; + case SpvCapabilityFPGAClusterAttributesINTEL: return "FPGAClusterAttributesINTEL"; + case SpvCapabilityLoopFuseINTEL: return "LoopFuseINTEL"; + case SpvCapabilityFPGADSPControlINTEL: return "FPGADSPControlINTEL"; + case SpvCapabilityMemoryAccessAliasingINTEL: return "MemoryAccessAliasingINTEL"; + case SpvCapabilityFPGAInvocationPipeliningAttributesINTEL: return "FPGAInvocationPipeliningAttributesINTEL"; + case SpvCapabilityFPGABufferLocationINTEL: return "FPGABufferLocationINTEL"; + case SpvCapabilityArbitraryPrecisionFixedPointINTEL: return "ArbitraryPrecisionFixedPointINTEL"; + case SpvCapabilityUSMStorageClassesINTEL: return "USMStorageClassesINTEL"; + case SpvCapabilityRuntimeAlignedAttributeINTEL: return "RuntimeAlignedAttributeINTEL"; + case SpvCapabilityIOPipesINTEL: return "IOPipesINTEL"; + case SpvCapabilityBlockingPipesINTEL: return "BlockingPipesINTEL"; + case SpvCapabilityFPGARegINTEL: return "FPGARegINTEL"; + case SpvCapabilityDotProductInputAll: return "DotProductInputAll"; + case SpvCapabilityDotProductInput4x8Bit: return "DotProductInput4x8Bit"; + case SpvCapabilityDotProductInput4x8BitPacked: return "DotProductInput4x8BitPacked"; + case SpvCapabilityDotProduct: return "DotProduct"; + case SpvCapabilityRayCullMaskKHR: return "RayCullMaskKHR"; + case SpvCapabilityCooperativeMatrixKHR: return "CooperativeMatrixKHR"; + case SpvCapabilityReplicatedCompositesEXT: return "ReplicatedCompositesEXT"; + case SpvCapabilityBitInstructions: return "BitInstructions"; + case SpvCapabilityGroupNonUniformRotateKHR: return "GroupNonUniformRotateKHR"; + case SpvCapabilityFloatControls2: return "FloatControls2"; + case SpvCapabilityFMAKHR: return "FMAKHR"; + case SpvCapabilityAtomicFloat32AddEXT: return "AtomicFloat32AddEXT"; + case SpvCapabilityAtomicFloat64AddEXT: return "AtomicFloat64AddEXT"; + case SpvCapabilityLongCompositesINTEL: return "LongCompositesINTEL"; + case SpvCapabilityOptNoneEXT: return "OptNoneEXT"; + case SpvCapabilityAtomicFloat16AddEXT: return "AtomicFloat16AddEXT"; + case SpvCapabilityDebugInfoModuleINTEL: return "DebugInfoModuleINTEL"; + case SpvCapabilityBFloat16ConversionINTEL: return "BFloat16ConversionINTEL"; + case SpvCapabilitySplitBarrierINTEL: return "SplitBarrierINTEL"; + case SpvCapabilityArithmeticFenceEXT: return "ArithmeticFenceEXT"; + case SpvCapabilityFPGAClusterAttributesV2INTEL: return "FPGAClusterAttributesV2INTEL"; + case SpvCapabilityFPGAKernelAttributesv2INTEL: return "FPGAKernelAttributesv2INTEL"; + case SpvCapabilityTaskSequenceINTEL: return "TaskSequenceINTEL"; + case SpvCapabilityFPMaxErrorINTEL: return "FPMaxErrorINTEL"; + case SpvCapabilityFPGALatencyControlINTEL: return "FPGALatencyControlINTEL"; + case SpvCapabilityFPGAArgumentInterfacesINTEL: return "FPGAArgumentInterfacesINTEL"; + case SpvCapabilityGlobalVariableHostAccessINTEL: return "GlobalVariableHostAccessINTEL"; + case SpvCapabilityGlobalVariableFPGADecorationsINTEL: return "GlobalVariableFPGADecorationsINTEL"; + case SpvCapabilitySubgroupBufferPrefetchINTEL: return "SubgroupBufferPrefetchINTEL"; + case SpvCapabilitySubgroup2DBlockIOINTEL: return "Subgroup2DBlockIOINTEL"; + case SpvCapabilitySubgroup2DBlockTransformINTEL: return "Subgroup2DBlockTransformINTEL"; + case SpvCapabilitySubgroup2DBlockTransposeINTEL: return "Subgroup2DBlockTransposeINTEL"; + case SpvCapabilitySubgroupMatrixMultiplyAccumulateINTEL: return "SubgroupMatrixMultiplyAccumulateINTEL"; + case SpvCapabilityTernaryBitwiseFunctionINTEL: return "TernaryBitwiseFunctionINTEL"; + case SpvCapabilityUntypedVariableLengthArrayINTEL: return "UntypedVariableLengthArrayINTEL"; + case SpvCapabilitySpecConditionalINTEL: return "SpecConditionalINTEL"; + case SpvCapabilityFunctionVariantsINTEL: return "FunctionVariantsINTEL"; + case SpvCapabilityGroupUniformArithmeticKHR: return "GroupUniformArithmeticKHR"; + case SpvCapabilityTensorFloat32RoundingINTEL: return "TensorFloat32RoundingINTEL"; + case SpvCapabilityMaskedGatherScatterINTEL: return "MaskedGatherScatterINTEL"; + case SpvCapabilityCacheControlsINTEL: return "CacheControlsINTEL"; + case SpvCapabilityRegisterLimitsINTEL: return "RegisterLimitsINTEL"; + case SpvCapabilityBindlessImagesINTEL: return "BindlessImagesINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvRayQueryIntersectionToString(SpvRayQueryIntersection value) { + switch (value) { + case SpvRayQueryIntersectionRayQueryCandidateIntersectionKHR: return "RayQueryCandidateIntersectionKHR"; + case SpvRayQueryIntersectionRayQueryCommittedIntersectionKHR: return "RayQueryCommittedIntersectionKHR"; + default: return "Unknown"; + } +} + +inline const char* SpvRayQueryCommittedIntersectionTypeToString(SpvRayQueryCommittedIntersectionType value) { + switch (value) { + case SpvRayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionNoneKHR: return "RayQueryCommittedIntersectionNoneKHR"; + case SpvRayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionTriangleKHR: return "RayQueryCommittedIntersectionTriangleKHR"; + case SpvRayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionGeneratedKHR: return "RayQueryCommittedIntersectionGeneratedKHR"; + default: return "Unknown"; + } +} + +inline const char* SpvRayQueryCandidateIntersectionTypeToString(SpvRayQueryCandidateIntersectionType value) { + switch (value) { + case SpvRayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionTriangleKHR: return "RayQueryCandidateIntersectionTriangleKHR"; + case SpvRayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionAABBKHR: return "RayQueryCandidateIntersectionAABBKHR"; + default: return "Unknown"; + } +} + +inline const char* SpvFPDenormModeToString(SpvFPDenormMode value) { + switch (value) { + case SpvFPDenormModePreserve: return "Preserve"; + case SpvFPDenormModeFlushToZero: return "FlushToZero"; + default: return "Unknown"; + } +} + +inline const char* SpvFPOperationModeToString(SpvFPOperationMode value) { + switch (value) { + case SpvFPOperationModeIEEE: return "IEEE"; + case SpvFPOperationModeALT: return "ALT"; + default: return "Unknown"; + } +} + +inline const char* SpvQuantizationModesToString(SpvQuantizationModes value) { + switch (value) { + case SpvQuantizationModesTRN: return "TRN"; + case SpvQuantizationModesTRN_ZERO: return "TRN_ZERO"; + case SpvQuantizationModesRND: return "RND"; + case SpvQuantizationModesRND_ZERO: return "RND_ZERO"; + case SpvQuantizationModesRND_INF: return "RND_INF"; + case SpvQuantizationModesRND_MIN_INF: return "RND_MIN_INF"; + case SpvQuantizationModesRND_CONV: return "RND_CONV"; + case SpvQuantizationModesRND_CONV_ODD: return "RND_CONV_ODD"; + default: return "Unknown"; + } +} + +inline const char* SpvOverflowModesToString(SpvOverflowModes value) { + switch (value) { + case SpvOverflowModesWRAP: return "WRAP"; + case SpvOverflowModesSAT: return "SAT"; + case SpvOverflowModesSAT_ZERO: return "SAT_ZERO"; + case SpvOverflowModesSAT_SYM: return "SAT_SYM"; + default: return "Unknown"; + } +} + +inline const char* SpvPackedVectorFormatToString(SpvPackedVectorFormat value) { + switch (value) { + case SpvPackedVectorFormatPackedVectorFormat4x8Bit: return "PackedVectorFormat4x8Bit"; + default: return "Unknown"; + } +} + +inline const char* SpvCooperativeMatrixLayoutToString(SpvCooperativeMatrixLayout value) { + switch (value) { + case SpvCooperativeMatrixLayoutRowMajorKHR: return "RowMajorKHR"; + case SpvCooperativeMatrixLayoutColumnMajorKHR: return "ColumnMajorKHR"; + case SpvCooperativeMatrixLayoutRowBlockedInterleavedARM: return "RowBlockedInterleavedARM"; + case SpvCooperativeMatrixLayoutColumnBlockedInterleavedARM: return "ColumnBlockedInterleavedARM"; + default: return "Unknown"; + } +} + +inline const char* SpvCooperativeMatrixUseToString(SpvCooperativeMatrixUse value) { + switch (value) { + case SpvCooperativeMatrixUseMatrixAKHR: return "MatrixAKHR"; + case SpvCooperativeMatrixUseMatrixBKHR: return "MatrixBKHR"; + case SpvCooperativeMatrixUseMatrixAccumulatorKHR: return "MatrixAccumulatorKHR"; + default: return "Unknown"; + } +} + +inline const char* SpvTensorClampModeToString(SpvTensorClampMode value) { + switch (value) { + case SpvTensorClampModeUndefined: return "Undefined"; + case SpvTensorClampModeConstant: return "Constant"; + case SpvTensorClampModeClampToEdge: return "ClampToEdge"; + case SpvTensorClampModeRepeat: return "Repeat"; + case SpvTensorClampModeRepeatMirrored: return "RepeatMirrored"; + default: return "Unknown"; + } +} + +inline const char* SpvInitializationModeQualifierToString(SpvInitializationModeQualifier value) { + switch (value) { + case SpvInitializationModeQualifierInitOnDeviceReprogramINTEL: return "InitOnDeviceReprogramINTEL"; + case SpvInitializationModeQualifierInitOnDeviceResetINTEL: return "InitOnDeviceResetINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvHostAccessQualifierToString(SpvHostAccessQualifier value) { + switch (value) { + case SpvHostAccessQualifierNoneINTEL: return "NoneINTEL"; + case SpvHostAccessQualifierReadINTEL: return "ReadINTEL"; + case SpvHostAccessQualifierWriteINTEL: return "WriteINTEL"; + case SpvHostAccessQualifierReadWriteINTEL: return "ReadWriteINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvLoadCacheControlToString(SpvLoadCacheControl value) { + switch (value) { + case SpvLoadCacheControlUncachedINTEL: return "UncachedINTEL"; + case SpvLoadCacheControlCachedINTEL: return "CachedINTEL"; + case SpvLoadCacheControlStreamingINTEL: return "StreamingINTEL"; + case SpvLoadCacheControlInvalidateAfterReadINTEL: return "InvalidateAfterReadINTEL"; + case SpvLoadCacheControlConstCachedINTEL: return "ConstCachedINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvStoreCacheControlToString(SpvStoreCacheControl value) { + switch (value) { + case SpvStoreCacheControlUncachedINTEL: return "UncachedINTEL"; + case SpvStoreCacheControlWriteThroughINTEL: return "WriteThroughINTEL"; + case SpvStoreCacheControlWriteBackINTEL: return "WriteBackINTEL"; + case SpvStoreCacheControlStreamingINTEL: return "StreamingINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvNamedMaximumNumberOfRegistersToString(SpvNamedMaximumNumberOfRegisters value) { + switch (value) { + case SpvNamedMaximumNumberOfRegistersAutoINTEL: return "AutoINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvFPEncodingToString(SpvFPEncoding value) { + switch (value) { + case SpvFPEncodingBFloat16KHR: return "BFloat16KHR"; + case SpvFPEncodingFloat8E4M3EXT: return "Float8E4M3EXT"; + case SpvFPEncodingFloat8E5M2EXT: return "Float8E5M2EXT"; + default: return "Unknown"; + } +} + +inline const char* SpvCooperativeVectorMatrixLayoutToString(SpvCooperativeVectorMatrixLayout value) { + switch (value) { + case SpvCooperativeVectorMatrixLayoutRowMajorNV: return "RowMajorNV"; + case SpvCooperativeVectorMatrixLayoutColumnMajorNV: return "ColumnMajorNV"; + case SpvCooperativeVectorMatrixLayoutInferencingOptimalNV: return "InferencingOptimalNV"; + case SpvCooperativeVectorMatrixLayoutTrainingOptimalNV: return "TrainingOptimalNV"; + default: return "Unknown"; + } +} + +inline const char* SpvComponentTypeToString(SpvComponentType value) { + switch (value) { + case SpvComponentTypeFloat16NV: return "Float16NV"; + case SpvComponentTypeFloat32NV: return "Float32NV"; + case SpvComponentTypeFloat64NV: return "Float64NV"; + case SpvComponentTypeSignedInt8NV: return "SignedInt8NV"; + case SpvComponentTypeSignedInt16NV: return "SignedInt16NV"; + case SpvComponentTypeSignedInt32NV: return "SignedInt32NV"; + case SpvComponentTypeSignedInt64NV: return "SignedInt64NV"; + case SpvComponentTypeUnsignedInt8NV: return "UnsignedInt8NV"; + case SpvComponentTypeUnsignedInt16NV: return "UnsignedInt16NV"; + case SpvComponentTypeUnsignedInt32NV: return "UnsignedInt32NV"; + case SpvComponentTypeUnsignedInt64NV: return "UnsignedInt64NV"; + case SpvComponentTypeSignedInt8PackedNV: return "SignedInt8PackedNV"; + case SpvComponentTypeUnsignedInt8PackedNV: return "UnsignedInt8PackedNV"; + case SpvComponentTypeFloatE4M3NV: return "FloatE4M3NV"; + case SpvComponentTypeFloatE5M2NV: return "FloatE5M2NV"; + default: return "Unknown"; + } +} + +inline const char* SpvOpToString(SpvOp value) { + switch (value) { + case SpvOpNop: return "OpNop"; + case SpvOpUndef: return "OpUndef"; + case SpvOpSourceContinued: return "OpSourceContinued"; + case SpvOpSource: return "OpSource"; + case SpvOpSourceExtension: return "OpSourceExtension"; + case SpvOpName: return "OpName"; + case SpvOpMemberName: return "OpMemberName"; + case SpvOpString: return "OpString"; + case SpvOpLine: return "OpLine"; + case SpvOpExtension: return "OpExtension"; + case SpvOpExtInstImport: return "OpExtInstImport"; + case SpvOpExtInst: return "OpExtInst"; + case SpvOpMemoryModel: return "OpMemoryModel"; + case SpvOpEntryPoint: return "OpEntryPoint"; + case SpvOpExecutionMode: return "OpExecutionMode"; + case SpvOpCapability: return "OpCapability"; + case SpvOpTypeVoid: return "OpTypeVoid"; + case SpvOpTypeBool: return "OpTypeBool"; + case SpvOpTypeInt: return "OpTypeInt"; + case SpvOpTypeFloat: return "OpTypeFloat"; + case SpvOpTypeVector: return "OpTypeVector"; + case SpvOpTypeMatrix: return "OpTypeMatrix"; + case SpvOpTypeImage: return "OpTypeImage"; + case SpvOpTypeSampler: return "OpTypeSampler"; + case SpvOpTypeSampledImage: return "OpTypeSampledImage"; + case SpvOpTypeArray: return "OpTypeArray"; + case SpvOpTypeRuntimeArray: return "OpTypeRuntimeArray"; + case SpvOpTypeStruct: return "OpTypeStruct"; + case SpvOpTypeOpaque: return "OpTypeOpaque"; + case SpvOpTypePointer: return "OpTypePointer"; + case SpvOpTypeFunction: return "OpTypeFunction"; + case SpvOpTypeEvent: return "OpTypeEvent"; + case SpvOpTypeDeviceEvent: return "OpTypeDeviceEvent"; + case SpvOpTypeReserveId: return "OpTypeReserveId"; + case SpvOpTypeQueue: return "OpTypeQueue"; + case SpvOpTypePipe: return "OpTypePipe"; + case SpvOpTypeForwardPointer: return "OpTypeForwardPointer"; + case SpvOpConstantTrue: return "OpConstantTrue"; + case SpvOpConstantFalse: return "OpConstantFalse"; + case SpvOpConstant: return "OpConstant"; + case SpvOpConstantComposite: return "OpConstantComposite"; + case SpvOpConstantSampler: return "OpConstantSampler"; + case SpvOpConstantNull: return "OpConstantNull"; + case SpvOpSpecConstantTrue: return "OpSpecConstantTrue"; + case SpvOpSpecConstantFalse: return "OpSpecConstantFalse"; + case SpvOpSpecConstant: return "OpSpecConstant"; + case SpvOpSpecConstantComposite: return "OpSpecConstantComposite"; + case SpvOpSpecConstantOp: return "OpSpecConstantOp"; + case SpvOpFunction: return "OpFunction"; + case SpvOpFunctionParameter: return "OpFunctionParameter"; + case SpvOpFunctionEnd: return "OpFunctionEnd"; + case SpvOpFunctionCall: return "OpFunctionCall"; + case SpvOpVariable: return "OpVariable"; + case SpvOpImageTexelPointer: return "OpImageTexelPointer"; + case SpvOpLoad: return "OpLoad"; + case SpvOpStore: return "OpStore"; + case SpvOpCopyMemory: return "OpCopyMemory"; + case SpvOpCopyMemorySized: return "OpCopyMemorySized"; + case SpvOpAccessChain: return "OpAccessChain"; + case SpvOpInBoundsAccessChain: return "OpInBoundsAccessChain"; + case SpvOpPtrAccessChain: return "OpPtrAccessChain"; + case SpvOpArrayLength: return "OpArrayLength"; + case SpvOpGenericPtrMemSemantics: return "OpGenericPtrMemSemantics"; + case SpvOpInBoundsPtrAccessChain: return "OpInBoundsPtrAccessChain"; + case SpvOpDecorate: return "OpDecorate"; + case SpvOpMemberDecorate: return "OpMemberDecorate"; + case SpvOpDecorationGroup: return "OpDecorationGroup"; + case SpvOpGroupDecorate: return "OpGroupDecorate"; + case SpvOpGroupMemberDecorate: return "OpGroupMemberDecorate"; + case SpvOpVectorExtractDynamic: return "OpVectorExtractDynamic"; + case SpvOpVectorInsertDynamic: return "OpVectorInsertDynamic"; + case SpvOpVectorShuffle: return "OpVectorShuffle"; + case SpvOpCompositeConstruct: return "OpCompositeConstruct"; + case SpvOpCompositeExtract: return "OpCompositeExtract"; + case SpvOpCompositeInsert: return "OpCompositeInsert"; + case SpvOpCopyObject: return "OpCopyObject"; + case SpvOpTranspose: return "OpTranspose"; + case SpvOpSampledImage: return "OpSampledImage"; + case SpvOpImageSampleImplicitLod: return "OpImageSampleImplicitLod"; + case SpvOpImageSampleExplicitLod: return "OpImageSampleExplicitLod"; + case SpvOpImageSampleDrefImplicitLod: return "OpImageSampleDrefImplicitLod"; + case SpvOpImageSampleDrefExplicitLod: return "OpImageSampleDrefExplicitLod"; + case SpvOpImageSampleProjImplicitLod: return "OpImageSampleProjImplicitLod"; + case SpvOpImageSampleProjExplicitLod: return "OpImageSampleProjExplicitLod"; + case SpvOpImageSampleProjDrefImplicitLod: return "OpImageSampleProjDrefImplicitLod"; + case SpvOpImageSampleProjDrefExplicitLod: return "OpImageSampleProjDrefExplicitLod"; + case SpvOpImageFetch: return "OpImageFetch"; + case SpvOpImageGather: return "OpImageGather"; + case SpvOpImageDrefGather: return "OpImageDrefGather"; + case SpvOpImageRead: return "OpImageRead"; + case SpvOpImageWrite: return "OpImageWrite"; + case SpvOpImage: return "OpImage"; + case SpvOpImageQueryFormat: return "OpImageQueryFormat"; + case SpvOpImageQueryOrder: return "OpImageQueryOrder"; + case SpvOpImageQuerySizeLod: return "OpImageQuerySizeLod"; + case SpvOpImageQuerySize: return "OpImageQuerySize"; + case SpvOpImageQueryLod: return "OpImageQueryLod"; + case SpvOpImageQueryLevels: return "OpImageQueryLevels"; + case SpvOpImageQuerySamples: return "OpImageQuerySamples"; + case SpvOpConvertFToU: return "OpConvertFToU"; + case SpvOpConvertFToS: return "OpConvertFToS"; + case SpvOpConvertSToF: return "OpConvertSToF"; + case SpvOpConvertUToF: return "OpConvertUToF"; + case SpvOpUConvert: return "OpUConvert"; + case SpvOpSConvert: return "OpSConvert"; + case SpvOpFConvert: return "OpFConvert"; + case SpvOpQuantizeToF16: return "OpQuantizeToF16"; + case SpvOpConvertPtrToU: return "OpConvertPtrToU"; + case SpvOpSatConvertSToU: return "OpSatConvertSToU"; + case SpvOpSatConvertUToS: return "OpSatConvertUToS"; + case SpvOpConvertUToPtr: return "OpConvertUToPtr"; + case SpvOpPtrCastToGeneric: return "OpPtrCastToGeneric"; + case SpvOpGenericCastToPtr: return "OpGenericCastToPtr"; + case SpvOpGenericCastToPtrExplicit: return "OpGenericCastToPtrExplicit"; + case SpvOpBitcast: return "OpBitcast"; + case SpvOpSNegate: return "OpSNegate"; + case SpvOpFNegate: return "OpFNegate"; + case SpvOpIAdd: return "OpIAdd"; + case SpvOpFAdd: return "OpFAdd"; + case SpvOpISub: return "OpISub"; + case SpvOpFSub: return "OpFSub"; + case SpvOpIMul: return "OpIMul"; + case SpvOpFMul: return "OpFMul"; + case SpvOpUDiv: return "OpUDiv"; + case SpvOpSDiv: return "OpSDiv"; + case SpvOpFDiv: return "OpFDiv"; + case SpvOpUMod: return "OpUMod"; + case SpvOpSRem: return "OpSRem"; + case SpvOpSMod: return "OpSMod"; + case SpvOpFRem: return "OpFRem"; + case SpvOpFMod: return "OpFMod"; + case SpvOpVectorTimesScalar: return "OpVectorTimesScalar"; + case SpvOpMatrixTimesScalar: return "OpMatrixTimesScalar"; + case SpvOpVectorTimesMatrix: return "OpVectorTimesMatrix"; + case SpvOpMatrixTimesVector: return "OpMatrixTimesVector"; + case SpvOpMatrixTimesMatrix: return "OpMatrixTimesMatrix"; + case SpvOpOuterProduct: return "OpOuterProduct"; + case SpvOpDot: return "OpDot"; + case SpvOpIAddCarry: return "OpIAddCarry"; + case SpvOpISubBorrow: return "OpISubBorrow"; + case SpvOpUMulExtended: return "OpUMulExtended"; + case SpvOpSMulExtended: return "OpSMulExtended"; + case SpvOpAny: return "OpAny"; + case SpvOpAll: return "OpAll"; + case SpvOpIsNan: return "OpIsNan"; + case SpvOpIsInf: return "OpIsInf"; + case SpvOpIsFinite: return "OpIsFinite"; + case SpvOpIsNormal: return "OpIsNormal"; + case SpvOpSignBitSet: return "OpSignBitSet"; + case SpvOpLessOrGreater: return "OpLessOrGreater"; + case SpvOpOrdered: return "OpOrdered"; + case SpvOpUnordered: return "OpUnordered"; + case SpvOpLogicalEqual: return "OpLogicalEqual"; + case SpvOpLogicalNotEqual: return "OpLogicalNotEqual"; + case SpvOpLogicalOr: return "OpLogicalOr"; + case SpvOpLogicalAnd: return "OpLogicalAnd"; + case SpvOpLogicalNot: return "OpLogicalNot"; + case SpvOpSelect: return "OpSelect"; + case SpvOpIEqual: return "OpIEqual"; + case SpvOpINotEqual: return "OpINotEqual"; + case SpvOpUGreaterThan: return "OpUGreaterThan"; + case SpvOpSGreaterThan: return "OpSGreaterThan"; + case SpvOpUGreaterThanEqual: return "OpUGreaterThanEqual"; + case SpvOpSGreaterThanEqual: return "OpSGreaterThanEqual"; + case SpvOpULessThan: return "OpULessThan"; + case SpvOpSLessThan: return "OpSLessThan"; + case SpvOpULessThanEqual: return "OpULessThanEqual"; + case SpvOpSLessThanEqual: return "OpSLessThanEqual"; + case SpvOpFOrdEqual: return "OpFOrdEqual"; + case SpvOpFUnordEqual: return "OpFUnordEqual"; + case SpvOpFOrdNotEqual: return "OpFOrdNotEqual"; + case SpvOpFUnordNotEqual: return "OpFUnordNotEqual"; + case SpvOpFOrdLessThan: return "OpFOrdLessThan"; + case SpvOpFUnordLessThan: return "OpFUnordLessThan"; + case SpvOpFOrdGreaterThan: return "OpFOrdGreaterThan"; + case SpvOpFUnordGreaterThan: return "OpFUnordGreaterThan"; + case SpvOpFOrdLessThanEqual: return "OpFOrdLessThanEqual"; + case SpvOpFUnordLessThanEqual: return "OpFUnordLessThanEqual"; + case SpvOpFOrdGreaterThanEqual: return "OpFOrdGreaterThanEqual"; + case SpvOpFUnordGreaterThanEqual: return "OpFUnordGreaterThanEqual"; + case SpvOpShiftRightLogical: return "OpShiftRightLogical"; + case SpvOpShiftRightArithmetic: return "OpShiftRightArithmetic"; + case SpvOpShiftLeftLogical: return "OpShiftLeftLogical"; + case SpvOpBitwiseOr: return "OpBitwiseOr"; + case SpvOpBitwiseXor: return "OpBitwiseXor"; + case SpvOpBitwiseAnd: return "OpBitwiseAnd"; + case SpvOpNot: return "OpNot"; + case SpvOpBitFieldInsert: return "OpBitFieldInsert"; + case SpvOpBitFieldSExtract: return "OpBitFieldSExtract"; + case SpvOpBitFieldUExtract: return "OpBitFieldUExtract"; + case SpvOpBitReverse: return "OpBitReverse"; + case SpvOpBitCount: return "OpBitCount"; + case SpvOpDPdx: return "OpDPdx"; + case SpvOpDPdy: return "OpDPdy"; + case SpvOpFwidth: return "OpFwidth"; + case SpvOpDPdxFine: return "OpDPdxFine"; + case SpvOpDPdyFine: return "OpDPdyFine"; + case SpvOpFwidthFine: return "OpFwidthFine"; + case SpvOpDPdxCoarse: return "OpDPdxCoarse"; + case SpvOpDPdyCoarse: return "OpDPdyCoarse"; + case SpvOpFwidthCoarse: return "OpFwidthCoarse"; + case SpvOpEmitVertex: return "OpEmitVertex"; + case SpvOpEndPrimitive: return "OpEndPrimitive"; + case SpvOpEmitStreamVertex: return "OpEmitStreamVertex"; + case SpvOpEndStreamPrimitive: return "OpEndStreamPrimitive"; + case SpvOpControlBarrier: return "OpControlBarrier"; + case SpvOpMemoryBarrier: return "OpMemoryBarrier"; + case SpvOpAtomicLoad: return "OpAtomicLoad"; + case SpvOpAtomicStore: return "OpAtomicStore"; + case SpvOpAtomicExchange: return "OpAtomicExchange"; + case SpvOpAtomicCompareExchange: return "OpAtomicCompareExchange"; + case SpvOpAtomicCompareExchangeWeak: return "OpAtomicCompareExchangeWeak"; + case SpvOpAtomicIIncrement: return "OpAtomicIIncrement"; + case SpvOpAtomicIDecrement: return "OpAtomicIDecrement"; + case SpvOpAtomicIAdd: return "OpAtomicIAdd"; + case SpvOpAtomicISub: return "OpAtomicISub"; + case SpvOpAtomicSMin: return "OpAtomicSMin"; + case SpvOpAtomicUMin: return "OpAtomicUMin"; + case SpvOpAtomicSMax: return "OpAtomicSMax"; + case SpvOpAtomicUMax: return "OpAtomicUMax"; + case SpvOpAtomicAnd: return "OpAtomicAnd"; + case SpvOpAtomicOr: return "OpAtomicOr"; + case SpvOpAtomicXor: return "OpAtomicXor"; + case SpvOpPhi: return "OpPhi"; + case SpvOpLoopMerge: return "OpLoopMerge"; + case SpvOpSelectionMerge: return "OpSelectionMerge"; + case SpvOpLabel: return "OpLabel"; + case SpvOpBranch: return "OpBranch"; + case SpvOpBranchConditional: return "OpBranchConditional"; + case SpvOpSwitch: return "OpSwitch"; + case SpvOpKill: return "OpKill"; + case SpvOpReturn: return "OpReturn"; + case SpvOpReturnValue: return "OpReturnValue"; + case SpvOpUnreachable: return "OpUnreachable"; + case SpvOpLifetimeStart: return "OpLifetimeStart"; + case SpvOpLifetimeStop: return "OpLifetimeStop"; + case SpvOpGroupAsyncCopy: return "OpGroupAsyncCopy"; + case SpvOpGroupWaitEvents: return "OpGroupWaitEvents"; + case SpvOpGroupAll: return "OpGroupAll"; + case SpvOpGroupAny: return "OpGroupAny"; + case SpvOpGroupBroadcast: return "OpGroupBroadcast"; + case SpvOpGroupIAdd: return "OpGroupIAdd"; + case SpvOpGroupFAdd: return "OpGroupFAdd"; + case SpvOpGroupFMin: return "OpGroupFMin"; + case SpvOpGroupUMin: return "OpGroupUMin"; + case SpvOpGroupSMin: return "OpGroupSMin"; + case SpvOpGroupFMax: return "OpGroupFMax"; + case SpvOpGroupUMax: return "OpGroupUMax"; + case SpvOpGroupSMax: return "OpGroupSMax"; + case SpvOpReadPipe: return "OpReadPipe"; + case SpvOpWritePipe: return "OpWritePipe"; + case SpvOpReservedReadPipe: return "OpReservedReadPipe"; + case SpvOpReservedWritePipe: return "OpReservedWritePipe"; + case SpvOpReserveReadPipePackets: return "OpReserveReadPipePackets"; + case SpvOpReserveWritePipePackets: return "OpReserveWritePipePackets"; + case SpvOpCommitReadPipe: return "OpCommitReadPipe"; + case SpvOpCommitWritePipe: return "OpCommitWritePipe"; + case SpvOpIsValidReserveId: return "OpIsValidReserveId"; + case SpvOpGetNumPipePackets: return "OpGetNumPipePackets"; + case SpvOpGetMaxPipePackets: return "OpGetMaxPipePackets"; + case SpvOpGroupReserveReadPipePackets: return "OpGroupReserveReadPipePackets"; + case SpvOpGroupReserveWritePipePackets: return "OpGroupReserveWritePipePackets"; + case SpvOpGroupCommitReadPipe: return "OpGroupCommitReadPipe"; + case SpvOpGroupCommitWritePipe: return "OpGroupCommitWritePipe"; + case SpvOpEnqueueMarker: return "OpEnqueueMarker"; + case SpvOpEnqueueKernel: return "OpEnqueueKernel"; + case SpvOpGetKernelNDrangeSubGroupCount: return "OpGetKernelNDrangeSubGroupCount"; + case SpvOpGetKernelNDrangeMaxSubGroupSize: return "OpGetKernelNDrangeMaxSubGroupSize"; + case SpvOpGetKernelWorkGroupSize: return "OpGetKernelWorkGroupSize"; + case SpvOpGetKernelPreferredWorkGroupSizeMultiple: return "OpGetKernelPreferredWorkGroupSizeMultiple"; + case SpvOpRetainEvent: return "OpRetainEvent"; + case SpvOpReleaseEvent: return "OpReleaseEvent"; + case SpvOpCreateUserEvent: return "OpCreateUserEvent"; + case SpvOpIsValidEvent: return "OpIsValidEvent"; + case SpvOpSetUserEventStatus: return "OpSetUserEventStatus"; + case SpvOpCaptureEventProfilingInfo: return "OpCaptureEventProfilingInfo"; + case SpvOpGetDefaultQueue: return "OpGetDefaultQueue"; + case SpvOpBuildNDRange: return "OpBuildNDRange"; + case SpvOpImageSparseSampleImplicitLod: return "OpImageSparseSampleImplicitLod"; + case SpvOpImageSparseSampleExplicitLod: return "OpImageSparseSampleExplicitLod"; + case SpvOpImageSparseSampleDrefImplicitLod: return "OpImageSparseSampleDrefImplicitLod"; + case SpvOpImageSparseSampleDrefExplicitLod: return "OpImageSparseSampleDrefExplicitLod"; + case SpvOpImageSparseSampleProjImplicitLod: return "OpImageSparseSampleProjImplicitLod"; + case SpvOpImageSparseSampleProjExplicitLod: return "OpImageSparseSampleProjExplicitLod"; + case SpvOpImageSparseSampleProjDrefImplicitLod: return "OpImageSparseSampleProjDrefImplicitLod"; + case SpvOpImageSparseSampleProjDrefExplicitLod: return "OpImageSparseSampleProjDrefExplicitLod"; + case SpvOpImageSparseFetch: return "OpImageSparseFetch"; + case SpvOpImageSparseGather: return "OpImageSparseGather"; + case SpvOpImageSparseDrefGather: return "OpImageSparseDrefGather"; + case SpvOpImageSparseTexelsResident: return "OpImageSparseTexelsResident"; + case SpvOpNoLine: return "OpNoLine"; + case SpvOpAtomicFlagTestAndSet: return "OpAtomicFlagTestAndSet"; + case SpvOpAtomicFlagClear: return "OpAtomicFlagClear"; + case SpvOpImageSparseRead: return "OpImageSparseRead"; + case SpvOpSizeOf: return "OpSizeOf"; + case SpvOpTypePipeStorage: return "OpTypePipeStorage"; + case SpvOpConstantPipeStorage: return "OpConstantPipeStorage"; + case SpvOpCreatePipeFromPipeStorage: return "OpCreatePipeFromPipeStorage"; + case SpvOpGetKernelLocalSizeForSubgroupCount: return "OpGetKernelLocalSizeForSubgroupCount"; + case SpvOpGetKernelMaxNumSubgroups: return "OpGetKernelMaxNumSubgroups"; + case SpvOpTypeNamedBarrier: return "OpTypeNamedBarrier"; + case SpvOpNamedBarrierInitialize: return "OpNamedBarrierInitialize"; + case SpvOpMemoryNamedBarrier: return "OpMemoryNamedBarrier"; + case SpvOpModuleProcessed: return "OpModuleProcessed"; + case SpvOpExecutionModeId: return "OpExecutionModeId"; + case SpvOpDecorateId: return "OpDecorateId"; + case SpvOpGroupNonUniformElect: return "OpGroupNonUniformElect"; + case SpvOpGroupNonUniformAll: return "OpGroupNonUniformAll"; + case SpvOpGroupNonUniformAny: return "OpGroupNonUniformAny"; + case SpvOpGroupNonUniformAllEqual: return "OpGroupNonUniformAllEqual"; + case SpvOpGroupNonUniformBroadcast: return "OpGroupNonUniformBroadcast"; + case SpvOpGroupNonUniformBroadcastFirst: return "OpGroupNonUniformBroadcastFirst"; + case SpvOpGroupNonUniformBallot: return "OpGroupNonUniformBallot"; + case SpvOpGroupNonUniformInverseBallot: return "OpGroupNonUniformInverseBallot"; + case SpvOpGroupNonUniformBallotBitExtract: return "OpGroupNonUniformBallotBitExtract"; + case SpvOpGroupNonUniformBallotBitCount: return "OpGroupNonUniformBallotBitCount"; + case SpvOpGroupNonUniformBallotFindLSB: return "OpGroupNonUniformBallotFindLSB"; + case SpvOpGroupNonUniformBallotFindMSB: return "OpGroupNonUniformBallotFindMSB"; + case SpvOpGroupNonUniformShuffle: return "OpGroupNonUniformShuffle"; + case SpvOpGroupNonUniformShuffleXor: return "OpGroupNonUniformShuffleXor"; + case SpvOpGroupNonUniformShuffleUp: return "OpGroupNonUniformShuffleUp"; + case SpvOpGroupNonUniformShuffleDown: return "OpGroupNonUniformShuffleDown"; + case SpvOpGroupNonUniformIAdd: return "OpGroupNonUniformIAdd"; + case SpvOpGroupNonUniformFAdd: return "OpGroupNonUniformFAdd"; + case SpvOpGroupNonUniformIMul: return "OpGroupNonUniformIMul"; + case SpvOpGroupNonUniformFMul: return "OpGroupNonUniformFMul"; + case SpvOpGroupNonUniformSMin: return "OpGroupNonUniformSMin"; + case SpvOpGroupNonUniformUMin: return "OpGroupNonUniformUMin"; + case SpvOpGroupNonUniformFMin: return "OpGroupNonUniformFMin"; + case SpvOpGroupNonUniformSMax: return "OpGroupNonUniformSMax"; + case SpvOpGroupNonUniformUMax: return "OpGroupNonUniformUMax"; + case SpvOpGroupNonUniformFMax: return "OpGroupNonUniformFMax"; + case SpvOpGroupNonUniformBitwiseAnd: return "OpGroupNonUniformBitwiseAnd"; + case SpvOpGroupNonUniformBitwiseOr: return "OpGroupNonUniformBitwiseOr"; + case SpvOpGroupNonUniformBitwiseXor: return "OpGroupNonUniformBitwiseXor"; + case SpvOpGroupNonUniformLogicalAnd: return "OpGroupNonUniformLogicalAnd"; + case SpvOpGroupNonUniformLogicalOr: return "OpGroupNonUniformLogicalOr"; + case SpvOpGroupNonUniformLogicalXor: return "OpGroupNonUniformLogicalXor"; + case SpvOpGroupNonUniformQuadBroadcast: return "OpGroupNonUniformQuadBroadcast"; + case SpvOpGroupNonUniformQuadSwap: return "OpGroupNonUniformQuadSwap"; + case SpvOpCopyLogical: return "OpCopyLogical"; + case SpvOpPtrEqual: return "OpPtrEqual"; + case SpvOpPtrNotEqual: return "OpPtrNotEqual"; + case SpvOpPtrDiff: return "OpPtrDiff"; + case SpvOpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT"; + case SpvOpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT"; + case SpvOpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT"; + case SpvOpTypeTensorARM: return "OpTypeTensorARM"; + case SpvOpTensorReadARM: return "OpTensorReadARM"; + case SpvOpTensorWriteARM: return "OpTensorWriteARM"; + case SpvOpTensorQuerySizeARM: return "OpTensorQuerySizeARM"; + case SpvOpGraphConstantARM: return "OpGraphConstantARM"; + case SpvOpGraphEntryPointARM: return "OpGraphEntryPointARM"; + case SpvOpGraphARM: return "OpGraphARM"; + case SpvOpGraphInputARM: return "OpGraphInputARM"; + case SpvOpGraphSetOutputARM: return "OpGraphSetOutputARM"; + case SpvOpGraphEndARM: return "OpGraphEndARM"; + case SpvOpTypeGraphARM: return "OpTypeGraphARM"; + case SpvOpTerminateInvocation: return "OpTerminateInvocation"; + case SpvOpTypeUntypedPointerKHR: return "OpTypeUntypedPointerKHR"; + case SpvOpUntypedVariableKHR: return "OpUntypedVariableKHR"; + case SpvOpUntypedAccessChainKHR: return "OpUntypedAccessChainKHR"; + case SpvOpUntypedInBoundsAccessChainKHR: return "OpUntypedInBoundsAccessChainKHR"; + case SpvOpSubgroupBallotKHR: return "OpSubgroupBallotKHR"; + case SpvOpSubgroupFirstInvocationKHR: return "OpSubgroupFirstInvocationKHR"; + case SpvOpUntypedPtrAccessChainKHR: return "OpUntypedPtrAccessChainKHR"; + case SpvOpUntypedInBoundsPtrAccessChainKHR: return "OpUntypedInBoundsPtrAccessChainKHR"; + case SpvOpUntypedArrayLengthKHR: return "OpUntypedArrayLengthKHR"; + case SpvOpUntypedPrefetchKHR: return "OpUntypedPrefetchKHR"; + case SpvOpFmaKHR: return "OpFmaKHR"; + case SpvOpSubgroupAllKHR: return "OpSubgroupAllKHR"; + case SpvOpSubgroupAnyKHR: return "OpSubgroupAnyKHR"; + case SpvOpSubgroupAllEqualKHR: return "OpSubgroupAllEqualKHR"; + case SpvOpGroupNonUniformRotateKHR: return "OpGroupNonUniformRotateKHR"; + case SpvOpSubgroupReadInvocationKHR: return "OpSubgroupReadInvocationKHR"; + case SpvOpExtInstWithForwardRefsKHR: return "OpExtInstWithForwardRefsKHR"; + case SpvOpUntypedGroupAsyncCopyKHR: return "OpUntypedGroupAsyncCopyKHR"; + case SpvOpTraceRayKHR: return "OpTraceRayKHR"; + case SpvOpExecuteCallableKHR: return "OpExecuteCallableKHR"; + case SpvOpConvertUToAccelerationStructureKHR: return "OpConvertUToAccelerationStructureKHR"; + case SpvOpIgnoreIntersectionKHR: return "OpIgnoreIntersectionKHR"; + case SpvOpTerminateRayKHR: return "OpTerminateRayKHR"; + case SpvOpSDot: return "OpSDot"; + case SpvOpUDot: return "OpUDot"; + case SpvOpSUDot: return "OpSUDot"; + case SpvOpSDotAccSat: return "OpSDotAccSat"; + case SpvOpUDotAccSat: return "OpUDotAccSat"; + case SpvOpSUDotAccSat: return "OpSUDotAccSat"; + case SpvOpTypeCooperativeMatrixKHR: return "OpTypeCooperativeMatrixKHR"; + case SpvOpCooperativeMatrixLoadKHR: return "OpCooperativeMatrixLoadKHR"; + case SpvOpCooperativeMatrixStoreKHR: return "OpCooperativeMatrixStoreKHR"; + case SpvOpCooperativeMatrixMulAddKHR: return "OpCooperativeMatrixMulAddKHR"; + case SpvOpCooperativeMatrixLengthKHR: return "OpCooperativeMatrixLengthKHR"; + case SpvOpConstantCompositeReplicateEXT: return "OpConstantCompositeReplicateEXT"; + case SpvOpSpecConstantCompositeReplicateEXT: return "OpSpecConstantCompositeReplicateEXT"; + case SpvOpCompositeConstructReplicateEXT: return "OpCompositeConstructReplicateEXT"; + case SpvOpTypeRayQueryKHR: return "OpTypeRayQueryKHR"; + case SpvOpRayQueryInitializeKHR: return "OpRayQueryInitializeKHR"; + case SpvOpRayQueryTerminateKHR: return "OpRayQueryTerminateKHR"; + case SpvOpRayQueryGenerateIntersectionKHR: return "OpRayQueryGenerateIntersectionKHR"; + case SpvOpRayQueryConfirmIntersectionKHR: return "OpRayQueryConfirmIntersectionKHR"; + case SpvOpRayQueryProceedKHR: return "OpRayQueryProceedKHR"; + case SpvOpRayQueryGetIntersectionTypeKHR: return "OpRayQueryGetIntersectionTypeKHR"; + case SpvOpImageSampleWeightedQCOM: return "OpImageSampleWeightedQCOM"; + case SpvOpImageBoxFilterQCOM: return "OpImageBoxFilterQCOM"; + case SpvOpImageBlockMatchSSDQCOM: return "OpImageBlockMatchSSDQCOM"; + case SpvOpImageBlockMatchSADQCOM: return "OpImageBlockMatchSADQCOM"; + case SpvOpBitCastArrayQCOM: return "OpBitCastArrayQCOM"; + case SpvOpImageBlockMatchWindowSSDQCOM: return "OpImageBlockMatchWindowSSDQCOM"; + case SpvOpImageBlockMatchWindowSADQCOM: return "OpImageBlockMatchWindowSADQCOM"; + case SpvOpImageBlockMatchGatherSSDQCOM: return "OpImageBlockMatchGatherSSDQCOM"; + case SpvOpImageBlockMatchGatherSADQCOM: return "OpImageBlockMatchGatherSADQCOM"; + case SpvOpCompositeConstructCoopMatQCOM: return "OpCompositeConstructCoopMatQCOM"; + case SpvOpCompositeExtractCoopMatQCOM: return "OpCompositeExtractCoopMatQCOM"; + case SpvOpExtractSubArrayQCOM: return "OpExtractSubArrayQCOM"; + case SpvOpGroupIAddNonUniformAMD: return "OpGroupIAddNonUniformAMD"; + case SpvOpGroupFAddNonUniformAMD: return "OpGroupFAddNonUniformAMD"; + case SpvOpGroupFMinNonUniformAMD: return "OpGroupFMinNonUniformAMD"; + case SpvOpGroupUMinNonUniformAMD: return "OpGroupUMinNonUniformAMD"; + case SpvOpGroupSMinNonUniformAMD: return "OpGroupSMinNonUniformAMD"; + case SpvOpGroupFMaxNonUniformAMD: return "OpGroupFMaxNonUniformAMD"; + case SpvOpGroupUMaxNonUniformAMD: return "OpGroupUMaxNonUniformAMD"; + case SpvOpGroupSMaxNonUniformAMD: return "OpGroupSMaxNonUniformAMD"; + case SpvOpFragmentMaskFetchAMD: return "OpFragmentMaskFetchAMD"; + case SpvOpFragmentFetchAMD: return "OpFragmentFetchAMD"; + case SpvOpReadClockKHR: return "OpReadClockKHR"; + case SpvOpAllocateNodePayloadsAMDX: return "OpAllocateNodePayloadsAMDX"; + case SpvOpEnqueueNodePayloadsAMDX: return "OpEnqueueNodePayloadsAMDX"; + case SpvOpTypeNodePayloadArrayAMDX: return "OpTypeNodePayloadArrayAMDX"; + case SpvOpFinishWritingNodePayloadAMDX: return "OpFinishWritingNodePayloadAMDX"; + case SpvOpNodePayloadArrayLengthAMDX: return "OpNodePayloadArrayLengthAMDX"; + case SpvOpIsNodePayloadValidAMDX: return "OpIsNodePayloadValidAMDX"; + case SpvOpConstantStringAMDX: return "OpConstantStringAMDX"; + case SpvOpSpecConstantStringAMDX: return "OpSpecConstantStringAMDX"; + case SpvOpGroupNonUniformQuadAllKHR: return "OpGroupNonUniformQuadAllKHR"; + case SpvOpGroupNonUniformQuadAnyKHR: return "OpGroupNonUniformQuadAnyKHR"; + case SpvOpHitObjectRecordHitMotionNV: return "OpHitObjectRecordHitMotionNV"; + case SpvOpHitObjectRecordHitWithIndexMotionNV: return "OpHitObjectRecordHitWithIndexMotionNV"; + case SpvOpHitObjectRecordMissMotionNV: return "OpHitObjectRecordMissMotionNV"; + case SpvOpHitObjectGetWorldToObjectNV: return "OpHitObjectGetWorldToObjectNV"; + case SpvOpHitObjectGetObjectToWorldNV: return "OpHitObjectGetObjectToWorldNV"; + case SpvOpHitObjectGetObjectRayDirectionNV: return "OpHitObjectGetObjectRayDirectionNV"; + case SpvOpHitObjectGetObjectRayOriginNV: return "OpHitObjectGetObjectRayOriginNV"; + case SpvOpHitObjectTraceRayMotionNV: return "OpHitObjectTraceRayMotionNV"; + case SpvOpHitObjectGetShaderRecordBufferHandleNV: return "OpHitObjectGetShaderRecordBufferHandleNV"; + case SpvOpHitObjectGetShaderBindingTableRecordIndexNV: return "OpHitObjectGetShaderBindingTableRecordIndexNV"; + case SpvOpHitObjectRecordEmptyNV: return "OpHitObjectRecordEmptyNV"; + case SpvOpHitObjectTraceRayNV: return "OpHitObjectTraceRayNV"; + case SpvOpHitObjectRecordHitNV: return "OpHitObjectRecordHitNV"; + case SpvOpHitObjectRecordHitWithIndexNV: return "OpHitObjectRecordHitWithIndexNV"; + case SpvOpHitObjectRecordMissNV: return "OpHitObjectRecordMissNV"; + case SpvOpHitObjectExecuteShaderNV: return "OpHitObjectExecuteShaderNV"; + case SpvOpHitObjectGetCurrentTimeNV: return "OpHitObjectGetCurrentTimeNV"; + case SpvOpHitObjectGetAttributesNV: return "OpHitObjectGetAttributesNV"; + case SpvOpHitObjectGetHitKindNV: return "OpHitObjectGetHitKindNV"; + case SpvOpHitObjectGetPrimitiveIndexNV: return "OpHitObjectGetPrimitiveIndexNV"; + case SpvOpHitObjectGetGeometryIndexNV: return "OpHitObjectGetGeometryIndexNV"; + case SpvOpHitObjectGetInstanceIdNV: return "OpHitObjectGetInstanceIdNV"; + case SpvOpHitObjectGetInstanceCustomIndexNV: return "OpHitObjectGetInstanceCustomIndexNV"; + case SpvOpHitObjectGetWorldRayDirectionNV: return "OpHitObjectGetWorldRayDirectionNV"; + case SpvOpHitObjectGetWorldRayOriginNV: return "OpHitObjectGetWorldRayOriginNV"; + case SpvOpHitObjectGetRayTMaxNV: return "OpHitObjectGetRayTMaxNV"; + case SpvOpHitObjectGetRayTMinNV: return "OpHitObjectGetRayTMinNV"; + case SpvOpHitObjectIsEmptyNV: return "OpHitObjectIsEmptyNV"; + case SpvOpHitObjectIsHitNV: return "OpHitObjectIsHitNV"; + case SpvOpHitObjectIsMissNV: return "OpHitObjectIsMissNV"; + case SpvOpReorderThreadWithHitObjectNV: return "OpReorderThreadWithHitObjectNV"; + case SpvOpReorderThreadWithHintNV: return "OpReorderThreadWithHintNV"; + case SpvOpTypeHitObjectNV: return "OpTypeHitObjectNV"; + case SpvOpImageSampleFootprintNV: return "OpImageSampleFootprintNV"; + case SpvOpTypeCooperativeVectorNV: return "OpTypeCooperativeVectorNV"; + case SpvOpCooperativeVectorMatrixMulNV: return "OpCooperativeVectorMatrixMulNV"; + case SpvOpCooperativeVectorOuterProductAccumulateNV: return "OpCooperativeVectorOuterProductAccumulateNV"; + case SpvOpCooperativeVectorReduceSumAccumulateNV: return "OpCooperativeVectorReduceSumAccumulateNV"; + case SpvOpCooperativeVectorMatrixMulAddNV: return "OpCooperativeVectorMatrixMulAddNV"; + case SpvOpCooperativeMatrixConvertNV: return "OpCooperativeMatrixConvertNV"; + case SpvOpEmitMeshTasksEXT: return "OpEmitMeshTasksEXT"; + case SpvOpSetMeshOutputsEXT: return "OpSetMeshOutputsEXT"; + case SpvOpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV"; + case SpvOpWritePackedPrimitiveIndices4x8NV: return "OpWritePackedPrimitiveIndices4x8NV"; + case SpvOpFetchMicroTriangleVertexPositionNV: return "OpFetchMicroTriangleVertexPositionNV"; + case SpvOpFetchMicroTriangleVertexBarycentricNV: return "OpFetchMicroTriangleVertexBarycentricNV"; + case SpvOpCooperativeVectorLoadNV: return "OpCooperativeVectorLoadNV"; + case SpvOpCooperativeVectorStoreNV: return "OpCooperativeVectorStoreNV"; + case SpvOpReportIntersectionKHR: return "OpReportIntersectionKHR"; + case SpvOpIgnoreIntersectionNV: return "OpIgnoreIntersectionNV"; + case SpvOpTerminateRayNV: return "OpTerminateRayNV"; + case SpvOpTraceNV: return "OpTraceNV"; + case SpvOpTraceMotionNV: return "OpTraceMotionNV"; + case SpvOpTraceRayMotionNV: return "OpTraceRayMotionNV"; + case SpvOpRayQueryGetIntersectionTriangleVertexPositionsKHR: return "OpRayQueryGetIntersectionTriangleVertexPositionsKHR"; + case SpvOpTypeAccelerationStructureKHR: return "OpTypeAccelerationStructureKHR"; + case SpvOpExecuteCallableNV: return "OpExecuteCallableNV"; + case SpvOpRayQueryGetClusterIdNV: return "OpRayQueryGetClusterIdNV"; + case SpvOpHitObjectGetClusterIdNV: return "OpHitObjectGetClusterIdNV"; + case SpvOpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV"; + case SpvOpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV"; + case SpvOpCooperativeMatrixStoreNV: return "OpCooperativeMatrixStoreNV"; + case SpvOpCooperativeMatrixMulAddNV: return "OpCooperativeMatrixMulAddNV"; + case SpvOpCooperativeMatrixLengthNV: return "OpCooperativeMatrixLengthNV"; + case SpvOpBeginInvocationInterlockEXT: return "OpBeginInvocationInterlockEXT"; + case SpvOpEndInvocationInterlockEXT: return "OpEndInvocationInterlockEXT"; + case SpvOpCooperativeMatrixReduceNV: return "OpCooperativeMatrixReduceNV"; + case SpvOpCooperativeMatrixLoadTensorNV: return "OpCooperativeMatrixLoadTensorNV"; + case SpvOpCooperativeMatrixStoreTensorNV: return "OpCooperativeMatrixStoreTensorNV"; + case SpvOpCooperativeMatrixPerElementOpNV: return "OpCooperativeMatrixPerElementOpNV"; + case SpvOpTypeTensorLayoutNV: return "OpTypeTensorLayoutNV"; + case SpvOpTypeTensorViewNV: return "OpTypeTensorViewNV"; + case SpvOpCreateTensorLayoutNV: return "OpCreateTensorLayoutNV"; + case SpvOpTensorLayoutSetDimensionNV: return "OpTensorLayoutSetDimensionNV"; + case SpvOpTensorLayoutSetStrideNV: return "OpTensorLayoutSetStrideNV"; + case SpvOpTensorLayoutSliceNV: return "OpTensorLayoutSliceNV"; + case SpvOpTensorLayoutSetClampValueNV: return "OpTensorLayoutSetClampValueNV"; + case SpvOpCreateTensorViewNV: return "OpCreateTensorViewNV"; + case SpvOpTensorViewSetDimensionNV: return "OpTensorViewSetDimensionNV"; + case SpvOpTensorViewSetStrideNV: return "OpTensorViewSetStrideNV"; + case SpvOpDemoteToHelperInvocation: return "OpDemoteToHelperInvocation"; + case SpvOpIsHelperInvocationEXT: return "OpIsHelperInvocationEXT"; + case SpvOpTensorViewSetClipNV: return "OpTensorViewSetClipNV"; + case SpvOpTensorLayoutSetBlockSizeNV: return "OpTensorLayoutSetBlockSizeNV"; + case SpvOpCooperativeMatrixTransposeNV: return "OpCooperativeMatrixTransposeNV"; + case SpvOpConvertUToImageNV: return "OpConvertUToImageNV"; + case SpvOpConvertUToSamplerNV: return "OpConvertUToSamplerNV"; + case SpvOpConvertImageToUNV: return "OpConvertImageToUNV"; + case SpvOpConvertSamplerToUNV: return "OpConvertSamplerToUNV"; + case SpvOpConvertUToSampledImageNV: return "OpConvertUToSampledImageNV"; + case SpvOpConvertSampledImageToUNV: return "OpConvertSampledImageToUNV"; + case SpvOpSamplerImageAddressingModeNV: return "OpSamplerImageAddressingModeNV"; + case SpvOpRawAccessChainNV: return "OpRawAccessChainNV"; + case SpvOpRayQueryGetIntersectionSpherePositionNV: return "OpRayQueryGetIntersectionSpherePositionNV"; + case SpvOpRayQueryGetIntersectionSphereRadiusNV: return "OpRayQueryGetIntersectionSphereRadiusNV"; + case SpvOpRayQueryGetIntersectionLSSPositionsNV: return "OpRayQueryGetIntersectionLSSPositionsNV"; + case SpvOpRayQueryGetIntersectionLSSRadiiNV: return "OpRayQueryGetIntersectionLSSRadiiNV"; + case SpvOpRayQueryGetIntersectionLSSHitValueNV: return "OpRayQueryGetIntersectionLSSHitValueNV"; + case SpvOpHitObjectGetSpherePositionNV: return "OpHitObjectGetSpherePositionNV"; + case SpvOpHitObjectGetSphereRadiusNV: return "OpHitObjectGetSphereRadiusNV"; + case SpvOpHitObjectGetLSSPositionsNV: return "OpHitObjectGetLSSPositionsNV"; + case SpvOpHitObjectGetLSSRadiiNV: return "OpHitObjectGetLSSRadiiNV"; + case SpvOpHitObjectIsSphereHitNV: return "OpHitObjectIsSphereHitNV"; + case SpvOpHitObjectIsLSSHitNV: return "OpHitObjectIsLSSHitNV"; + case SpvOpRayQueryIsSphereHitNV: return "OpRayQueryIsSphereHitNV"; + case SpvOpRayQueryIsLSSHitNV: return "OpRayQueryIsLSSHitNV"; + case SpvOpSubgroupShuffleINTEL: return "OpSubgroupShuffleINTEL"; + case SpvOpSubgroupShuffleDownINTEL: return "OpSubgroupShuffleDownINTEL"; + case SpvOpSubgroupShuffleUpINTEL: return "OpSubgroupShuffleUpINTEL"; + case SpvOpSubgroupShuffleXorINTEL: return "OpSubgroupShuffleXorINTEL"; + case SpvOpSubgroupBlockReadINTEL: return "OpSubgroupBlockReadINTEL"; + case SpvOpSubgroupBlockWriteINTEL: return "OpSubgroupBlockWriteINTEL"; + case SpvOpSubgroupImageBlockReadINTEL: return "OpSubgroupImageBlockReadINTEL"; + case SpvOpSubgroupImageBlockWriteINTEL: return "OpSubgroupImageBlockWriteINTEL"; + case SpvOpSubgroupImageMediaBlockReadINTEL: return "OpSubgroupImageMediaBlockReadINTEL"; + case SpvOpSubgroupImageMediaBlockWriteINTEL: return "OpSubgroupImageMediaBlockWriteINTEL"; + case SpvOpUCountLeadingZerosINTEL: return "OpUCountLeadingZerosINTEL"; + case SpvOpUCountTrailingZerosINTEL: return "OpUCountTrailingZerosINTEL"; + case SpvOpAbsISubINTEL: return "OpAbsISubINTEL"; + case SpvOpAbsUSubINTEL: return "OpAbsUSubINTEL"; + case SpvOpIAddSatINTEL: return "OpIAddSatINTEL"; + case SpvOpUAddSatINTEL: return "OpUAddSatINTEL"; + case SpvOpIAverageINTEL: return "OpIAverageINTEL"; + case SpvOpUAverageINTEL: return "OpUAverageINTEL"; + case SpvOpIAverageRoundedINTEL: return "OpIAverageRoundedINTEL"; + case SpvOpUAverageRoundedINTEL: return "OpUAverageRoundedINTEL"; + case SpvOpISubSatINTEL: return "OpISubSatINTEL"; + case SpvOpUSubSatINTEL: return "OpUSubSatINTEL"; + case SpvOpIMul32x16INTEL: return "OpIMul32x16INTEL"; + case SpvOpUMul32x16INTEL: return "OpUMul32x16INTEL"; + case SpvOpConstantFunctionPointerINTEL: return "OpConstantFunctionPointerINTEL"; + case SpvOpFunctionPointerCallINTEL: return "OpFunctionPointerCallINTEL"; + case SpvOpAsmTargetINTEL: return "OpAsmTargetINTEL"; + case SpvOpAsmINTEL: return "OpAsmINTEL"; + case SpvOpAsmCallINTEL: return "OpAsmCallINTEL"; + case SpvOpAtomicFMinEXT: return "OpAtomicFMinEXT"; + case SpvOpAtomicFMaxEXT: return "OpAtomicFMaxEXT"; + case SpvOpAssumeTrueKHR: return "OpAssumeTrueKHR"; + case SpvOpExpectKHR: return "OpExpectKHR"; + case SpvOpDecorateString: return "OpDecorateString"; + case SpvOpMemberDecorateString: return "OpMemberDecorateString"; + case SpvOpVmeImageINTEL: return "OpVmeImageINTEL"; + case SpvOpTypeVmeImageINTEL: return "OpTypeVmeImageINTEL"; + case SpvOpTypeAvcImePayloadINTEL: return "OpTypeAvcImePayloadINTEL"; + case SpvOpTypeAvcRefPayloadINTEL: return "OpTypeAvcRefPayloadINTEL"; + case SpvOpTypeAvcSicPayloadINTEL: return "OpTypeAvcSicPayloadINTEL"; + case SpvOpTypeAvcMcePayloadINTEL: return "OpTypeAvcMcePayloadINTEL"; + case SpvOpTypeAvcMceResultINTEL: return "OpTypeAvcMceResultINTEL"; + case SpvOpTypeAvcImeResultINTEL: return "OpTypeAvcImeResultINTEL"; + case SpvOpTypeAvcImeResultSingleReferenceStreamoutINTEL: return "OpTypeAvcImeResultSingleReferenceStreamoutINTEL"; + case SpvOpTypeAvcImeResultDualReferenceStreamoutINTEL: return "OpTypeAvcImeResultDualReferenceStreamoutINTEL"; + case SpvOpTypeAvcImeSingleReferenceStreaminINTEL: return "OpTypeAvcImeSingleReferenceStreaminINTEL"; + case SpvOpTypeAvcImeDualReferenceStreaminINTEL: return "OpTypeAvcImeDualReferenceStreaminINTEL"; + case SpvOpTypeAvcRefResultINTEL: return "OpTypeAvcRefResultINTEL"; + case SpvOpTypeAvcSicResultINTEL: return "OpTypeAvcSicResultINTEL"; + case SpvOpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL"; + case SpvOpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL"; + case SpvOpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL"; + case SpvOpSubgroupAvcMceSetInterShapePenaltyINTEL: return "OpSubgroupAvcMceSetInterShapePenaltyINTEL"; + case SpvOpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL"; + case SpvOpSubgroupAvcMceSetInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceSetInterDirectionPenaltyINTEL"; + case SpvOpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL"; + case SpvOpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: return "OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL"; + case SpvOpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL"; + case SpvOpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL"; + case SpvOpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL"; + case SpvOpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: return "OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL"; + case SpvOpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL"; + case SpvOpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL"; + case SpvOpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL"; + case SpvOpSubgroupAvcMceSetAcOnlyHaarINTEL: return "OpSubgroupAvcMceSetAcOnlyHaarINTEL"; + case SpvOpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL"; + case SpvOpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL"; + case SpvOpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL"; + case SpvOpSubgroupAvcMceConvertToImePayloadINTEL: return "OpSubgroupAvcMceConvertToImePayloadINTEL"; + case SpvOpSubgroupAvcMceConvertToImeResultINTEL: return "OpSubgroupAvcMceConvertToImeResultINTEL"; + case SpvOpSubgroupAvcMceConvertToRefPayloadINTEL: return "OpSubgroupAvcMceConvertToRefPayloadINTEL"; + case SpvOpSubgroupAvcMceConvertToRefResultINTEL: return "OpSubgroupAvcMceConvertToRefResultINTEL"; + case SpvOpSubgroupAvcMceConvertToSicPayloadINTEL: return "OpSubgroupAvcMceConvertToSicPayloadINTEL"; + case SpvOpSubgroupAvcMceConvertToSicResultINTEL: return "OpSubgroupAvcMceConvertToSicResultINTEL"; + case SpvOpSubgroupAvcMceGetMotionVectorsINTEL: return "OpSubgroupAvcMceGetMotionVectorsINTEL"; + case SpvOpSubgroupAvcMceGetInterDistortionsINTEL: return "OpSubgroupAvcMceGetInterDistortionsINTEL"; + case SpvOpSubgroupAvcMceGetBestInterDistortionsINTEL: return "OpSubgroupAvcMceGetBestInterDistortionsINTEL"; + case SpvOpSubgroupAvcMceGetInterMajorShapeINTEL: return "OpSubgroupAvcMceGetInterMajorShapeINTEL"; + case SpvOpSubgroupAvcMceGetInterMinorShapeINTEL: return "OpSubgroupAvcMceGetInterMinorShapeINTEL"; + case SpvOpSubgroupAvcMceGetInterDirectionsINTEL: return "OpSubgroupAvcMceGetInterDirectionsINTEL"; + case SpvOpSubgroupAvcMceGetInterMotionVectorCountINTEL: return "OpSubgroupAvcMceGetInterMotionVectorCountINTEL"; + case SpvOpSubgroupAvcMceGetInterReferenceIdsINTEL: return "OpSubgroupAvcMceGetInterReferenceIdsINTEL"; + case SpvOpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL"; + case SpvOpSubgroupAvcImeInitializeINTEL: return "OpSubgroupAvcImeInitializeINTEL"; + case SpvOpSubgroupAvcImeSetSingleReferenceINTEL: return "OpSubgroupAvcImeSetSingleReferenceINTEL"; + case SpvOpSubgroupAvcImeSetDualReferenceINTEL: return "OpSubgroupAvcImeSetDualReferenceINTEL"; + case SpvOpSubgroupAvcImeRefWindowSizeINTEL: return "OpSubgroupAvcImeRefWindowSizeINTEL"; + case SpvOpSubgroupAvcImeAdjustRefOffsetINTEL: return "OpSubgroupAvcImeAdjustRefOffsetINTEL"; + case SpvOpSubgroupAvcImeConvertToMcePayloadINTEL: return "OpSubgroupAvcImeConvertToMcePayloadINTEL"; + case SpvOpSubgroupAvcImeSetMaxMotionVectorCountINTEL: return "OpSubgroupAvcImeSetMaxMotionVectorCountINTEL"; + case SpvOpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: return "OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL"; + case SpvOpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: return "OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL"; + case SpvOpSubgroupAvcImeSetWeightedSadINTEL: return "OpSubgroupAvcImeSetWeightedSadINTEL"; + case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL"; + case SpvOpSubgroupAvcImeEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceINTEL"; + case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL"; + case SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL"; + case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL"; + case SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL"; + case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL"; + case SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL"; + case SpvOpSubgroupAvcImeConvertToMceResultINTEL: return "OpSubgroupAvcImeConvertToMceResultINTEL"; + case SpvOpSubgroupAvcImeGetSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeGetSingleReferenceStreaminINTEL"; + case SpvOpSubgroupAvcImeGetDualReferenceStreaminINTEL: return "OpSubgroupAvcImeGetDualReferenceStreaminINTEL"; + case SpvOpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL"; + case SpvOpSubgroupAvcImeStripDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripDualReferenceStreamoutINTEL"; + case SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL"; + case SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL"; + case SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL"; + case SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL"; + case SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL"; + case SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL"; + case SpvOpSubgroupAvcImeGetBorderReachedINTEL: return "OpSubgroupAvcImeGetBorderReachedINTEL"; + case SpvOpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: return "OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL"; + case SpvOpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: return "OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL"; + case SpvOpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL"; + case SpvOpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL"; + case SpvOpSubgroupAvcFmeInitializeINTEL: return "OpSubgroupAvcFmeInitializeINTEL"; + case SpvOpSubgroupAvcBmeInitializeINTEL: return "OpSubgroupAvcBmeInitializeINTEL"; + case SpvOpSubgroupAvcRefConvertToMcePayloadINTEL: return "OpSubgroupAvcRefConvertToMcePayloadINTEL"; + case SpvOpSubgroupAvcRefSetBidirectionalMixDisableINTEL: return "OpSubgroupAvcRefSetBidirectionalMixDisableINTEL"; + case SpvOpSubgroupAvcRefSetBilinearFilterEnableINTEL: return "OpSubgroupAvcRefSetBilinearFilterEnableINTEL"; + case SpvOpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL"; + case SpvOpSubgroupAvcRefEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithDualReferenceINTEL"; + case SpvOpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL"; + case SpvOpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL"; + case SpvOpSubgroupAvcRefConvertToMceResultINTEL: return "OpSubgroupAvcRefConvertToMceResultINTEL"; + case SpvOpSubgroupAvcSicInitializeINTEL: return "OpSubgroupAvcSicInitializeINTEL"; + case SpvOpSubgroupAvcSicConfigureSkcINTEL: return "OpSubgroupAvcSicConfigureSkcINTEL"; + case SpvOpSubgroupAvcSicConfigureIpeLumaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaINTEL"; + case SpvOpSubgroupAvcSicConfigureIpeLumaChromaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaChromaINTEL"; + case SpvOpSubgroupAvcSicGetMotionVectorMaskINTEL: return "OpSubgroupAvcSicGetMotionVectorMaskINTEL"; + case SpvOpSubgroupAvcSicConvertToMcePayloadINTEL: return "OpSubgroupAvcSicConvertToMcePayloadINTEL"; + case SpvOpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL"; + case SpvOpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL"; + case SpvOpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL"; + case SpvOpSubgroupAvcSicSetBilinearFilterEnableINTEL: return "OpSubgroupAvcSicSetBilinearFilterEnableINTEL"; + case SpvOpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: return "OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL"; + case SpvOpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: return "OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL"; + case SpvOpSubgroupAvcSicEvaluateIpeINTEL: return "OpSubgroupAvcSicEvaluateIpeINTEL"; + case SpvOpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL"; + case SpvOpSubgroupAvcSicEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithDualReferenceINTEL"; + case SpvOpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL"; + case SpvOpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL"; + case SpvOpSubgroupAvcSicConvertToMceResultINTEL: return "OpSubgroupAvcSicConvertToMceResultINTEL"; + case SpvOpSubgroupAvcSicGetIpeLumaShapeINTEL: return "OpSubgroupAvcSicGetIpeLumaShapeINTEL"; + case SpvOpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL"; + case SpvOpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL"; + case SpvOpSubgroupAvcSicGetPackedIpeLumaModesINTEL: return "OpSubgroupAvcSicGetPackedIpeLumaModesINTEL"; + case SpvOpSubgroupAvcSicGetIpeChromaModeINTEL: return "OpSubgroupAvcSicGetIpeChromaModeINTEL"; + case SpvOpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL"; + case SpvOpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL"; + case SpvOpSubgroupAvcSicGetInterRawSadsINTEL: return "OpSubgroupAvcSicGetInterRawSadsINTEL"; + case SpvOpVariableLengthArrayINTEL: return "OpVariableLengthArrayINTEL"; + case SpvOpSaveMemoryINTEL: return "OpSaveMemoryINTEL"; + case SpvOpRestoreMemoryINTEL: return "OpRestoreMemoryINTEL"; + case SpvOpArbitraryFloatSinCosPiINTEL: return "OpArbitraryFloatSinCosPiINTEL"; + case SpvOpArbitraryFloatCastINTEL: return "OpArbitraryFloatCastINTEL"; + case SpvOpArbitraryFloatCastFromIntINTEL: return "OpArbitraryFloatCastFromIntINTEL"; + case SpvOpArbitraryFloatCastToIntINTEL: return "OpArbitraryFloatCastToIntINTEL"; + case SpvOpArbitraryFloatAddINTEL: return "OpArbitraryFloatAddINTEL"; + case SpvOpArbitraryFloatSubINTEL: return "OpArbitraryFloatSubINTEL"; + case SpvOpArbitraryFloatMulINTEL: return "OpArbitraryFloatMulINTEL"; + case SpvOpArbitraryFloatDivINTEL: return "OpArbitraryFloatDivINTEL"; + case SpvOpArbitraryFloatGTINTEL: return "OpArbitraryFloatGTINTEL"; + case SpvOpArbitraryFloatGEINTEL: return "OpArbitraryFloatGEINTEL"; + case SpvOpArbitraryFloatLTINTEL: return "OpArbitraryFloatLTINTEL"; + case SpvOpArbitraryFloatLEINTEL: return "OpArbitraryFloatLEINTEL"; + case SpvOpArbitraryFloatEQINTEL: return "OpArbitraryFloatEQINTEL"; + case SpvOpArbitraryFloatRecipINTEL: return "OpArbitraryFloatRecipINTEL"; + case SpvOpArbitraryFloatRSqrtINTEL: return "OpArbitraryFloatRSqrtINTEL"; + case SpvOpArbitraryFloatCbrtINTEL: return "OpArbitraryFloatCbrtINTEL"; + case SpvOpArbitraryFloatHypotINTEL: return "OpArbitraryFloatHypotINTEL"; + case SpvOpArbitraryFloatSqrtINTEL: return "OpArbitraryFloatSqrtINTEL"; + case SpvOpArbitraryFloatLogINTEL: return "OpArbitraryFloatLogINTEL"; + case SpvOpArbitraryFloatLog2INTEL: return "OpArbitraryFloatLog2INTEL"; + case SpvOpArbitraryFloatLog10INTEL: return "OpArbitraryFloatLog10INTEL"; + case SpvOpArbitraryFloatLog1pINTEL: return "OpArbitraryFloatLog1pINTEL"; + case SpvOpArbitraryFloatExpINTEL: return "OpArbitraryFloatExpINTEL"; + case SpvOpArbitraryFloatExp2INTEL: return "OpArbitraryFloatExp2INTEL"; + case SpvOpArbitraryFloatExp10INTEL: return "OpArbitraryFloatExp10INTEL"; + case SpvOpArbitraryFloatExpm1INTEL: return "OpArbitraryFloatExpm1INTEL"; + case SpvOpArbitraryFloatSinINTEL: return "OpArbitraryFloatSinINTEL"; + case SpvOpArbitraryFloatCosINTEL: return "OpArbitraryFloatCosINTEL"; + case SpvOpArbitraryFloatSinCosINTEL: return "OpArbitraryFloatSinCosINTEL"; + case SpvOpArbitraryFloatSinPiINTEL: return "OpArbitraryFloatSinPiINTEL"; + case SpvOpArbitraryFloatCosPiINTEL: return "OpArbitraryFloatCosPiINTEL"; + case SpvOpArbitraryFloatASinINTEL: return "OpArbitraryFloatASinINTEL"; + case SpvOpArbitraryFloatASinPiINTEL: return "OpArbitraryFloatASinPiINTEL"; + case SpvOpArbitraryFloatACosINTEL: return "OpArbitraryFloatACosINTEL"; + case SpvOpArbitraryFloatACosPiINTEL: return "OpArbitraryFloatACosPiINTEL"; + case SpvOpArbitraryFloatATanINTEL: return "OpArbitraryFloatATanINTEL"; + case SpvOpArbitraryFloatATanPiINTEL: return "OpArbitraryFloatATanPiINTEL"; + case SpvOpArbitraryFloatATan2INTEL: return "OpArbitraryFloatATan2INTEL"; + case SpvOpArbitraryFloatPowINTEL: return "OpArbitraryFloatPowINTEL"; + case SpvOpArbitraryFloatPowRINTEL: return "OpArbitraryFloatPowRINTEL"; + case SpvOpArbitraryFloatPowNINTEL: return "OpArbitraryFloatPowNINTEL"; + case SpvOpLoopControlINTEL: return "OpLoopControlINTEL"; + case SpvOpAliasDomainDeclINTEL: return "OpAliasDomainDeclINTEL"; + case SpvOpAliasScopeDeclINTEL: return "OpAliasScopeDeclINTEL"; + case SpvOpAliasScopeListDeclINTEL: return "OpAliasScopeListDeclINTEL"; + case SpvOpFixedSqrtINTEL: return "OpFixedSqrtINTEL"; + case SpvOpFixedRecipINTEL: return "OpFixedRecipINTEL"; + case SpvOpFixedRsqrtINTEL: return "OpFixedRsqrtINTEL"; + case SpvOpFixedSinINTEL: return "OpFixedSinINTEL"; + case SpvOpFixedCosINTEL: return "OpFixedCosINTEL"; + case SpvOpFixedSinCosINTEL: return "OpFixedSinCosINTEL"; + case SpvOpFixedSinPiINTEL: return "OpFixedSinPiINTEL"; + case SpvOpFixedCosPiINTEL: return "OpFixedCosPiINTEL"; + case SpvOpFixedSinCosPiINTEL: return "OpFixedSinCosPiINTEL"; + case SpvOpFixedLogINTEL: return "OpFixedLogINTEL"; + case SpvOpFixedExpINTEL: return "OpFixedExpINTEL"; + case SpvOpPtrCastToCrossWorkgroupINTEL: return "OpPtrCastToCrossWorkgroupINTEL"; + case SpvOpCrossWorkgroupCastToPtrINTEL: return "OpCrossWorkgroupCastToPtrINTEL"; + case SpvOpReadPipeBlockingINTEL: return "OpReadPipeBlockingINTEL"; + case SpvOpWritePipeBlockingINTEL: return "OpWritePipeBlockingINTEL"; + case SpvOpFPGARegINTEL: return "OpFPGARegINTEL"; + case SpvOpRayQueryGetRayTMinKHR: return "OpRayQueryGetRayTMinKHR"; + case SpvOpRayQueryGetRayFlagsKHR: return "OpRayQueryGetRayFlagsKHR"; + case SpvOpRayQueryGetIntersectionTKHR: return "OpRayQueryGetIntersectionTKHR"; + case SpvOpRayQueryGetIntersectionInstanceCustomIndexKHR: return "OpRayQueryGetIntersectionInstanceCustomIndexKHR"; + case SpvOpRayQueryGetIntersectionInstanceIdKHR: return "OpRayQueryGetIntersectionInstanceIdKHR"; + case SpvOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: return "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR"; + case SpvOpRayQueryGetIntersectionGeometryIndexKHR: return "OpRayQueryGetIntersectionGeometryIndexKHR"; + case SpvOpRayQueryGetIntersectionPrimitiveIndexKHR: return "OpRayQueryGetIntersectionPrimitiveIndexKHR"; + case SpvOpRayQueryGetIntersectionBarycentricsKHR: return "OpRayQueryGetIntersectionBarycentricsKHR"; + case SpvOpRayQueryGetIntersectionFrontFaceKHR: return "OpRayQueryGetIntersectionFrontFaceKHR"; + case SpvOpRayQueryGetIntersectionCandidateAABBOpaqueKHR: return "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR"; + case SpvOpRayQueryGetIntersectionObjectRayDirectionKHR: return "OpRayQueryGetIntersectionObjectRayDirectionKHR"; + case SpvOpRayQueryGetIntersectionObjectRayOriginKHR: return "OpRayQueryGetIntersectionObjectRayOriginKHR"; + case SpvOpRayQueryGetWorldRayDirectionKHR: return "OpRayQueryGetWorldRayDirectionKHR"; + case SpvOpRayQueryGetWorldRayOriginKHR: return "OpRayQueryGetWorldRayOriginKHR"; + case SpvOpRayQueryGetIntersectionObjectToWorldKHR: return "OpRayQueryGetIntersectionObjectToWorldKHR"; + case SpvOpRayQueryGetIntersectionWorldToObjectKHR: return "OpRayQueryGetIntersectionWorldToObjectKHR"; + case SpvOpAtomicFAddEXT: return "OpAtomicFAddEXT"; + case SpvOpTypeBufferSurfaceINTEL: return "OpTypeBufferSurfaceINTEL"; + case SpvOpTypeStructContinuedINTEL: return "OpTypeStructContinuedINTEL"; + case SpvOpConstantCompositeContinuedINTEL: return "OpConstantCompositeContinuedINTEL"; + case SpvOpSpecConstantCompositeContinuedINTEL: return "OpSpecConstantCompositeContinuedINTEL"; + case SpvOpCompositeConstructContinuedINTEL: return "OpCompositeConstructContinuedINTEL"; + case SpvOpConvertFToBF16INTEL: return "OpConvertFToBF16INTEL"; + case SpvOpConvertBF16ToFINTEL: return "OpConvertBF16ToFINTEL"; + case SpvOpControlBarrierArriveINTEL: return "OpControlBarrierArriveINTEL"; + case SpvOpControlBarrierWaitINTEL: return "OpControlBarrierWaitINTEL"; + case SpvOpArithmeticFenceEXT: return "OpArithmeticFenceEXT"; + case SpvOpTaskSequenceCreateINTEL: return "OpTaskSequenceCreateINTEL"; + case SpvOpTaskSequenceAsyncINTEL: return "OpTaskSequenceAsyncINTEL"; + case SpvOpTaskSequenceGetINTEL: return "OpTaskSequenceGetINTEL"; + case SpvOpTaskSequenceReleaseINTEL: return "OpTaskSequenceReleaseINTEL"; + case SpvOpTypeTaskSequenceINTEL: return "OpTypeTaskSequenceINTEL"; + case SpvOpSubgroupBlockPrefetchINTEL: return "OpSubgroupBlockPrefetchINTEL"; + case SpvOpSubgroup2DBlockLoadINTEL: return "OpSubgroup2DBlockLoadINTEL"; + case SpvOpSubgroup2DBlockLoadTransformINTEL: return "OpSubgroup2DBlockLoadTransformINTEL"; + case SpvOpSubgroup2DBlockLoadTransposeINTEL: return "OpSubgroup2DBlockLoadTransposeINTEL"; + case SpvOpSubgroup2DBlockPrefetchINTEL: return "OpSubgroup2DBlockPrefetchINTEL"; + case SpvOpSubgroup2DBlockStoreINTEL: return "OpSubgroup2DBlockStoreINTEL"; + case SpvOpSubgroupMatrixMultiplyAccumulateINTEL: return "OpSubgroupMatrixMultiplyAccumulateINTEL"; + case SpvOpBitwiseFunctionINTEL: return "OpBitwiseFunctionINTEL"; + case SpvOpUntypedVariableLengthArrayINTEL: return "OpUntypedVariableLengthArrayINTEL"; + case SpvOpConditionalExtensionINTEL: return "OpConditionalExtensionINTEL"; + case SpvOpConditionalEntryPointINTEL: return "OpConditionalEntryPointINTEL"; + case SpvOpConditionalCapabilityINTEL: return "OpConditionalCapabilityINTEL"; + case SpvOpSpecConstantTargetINTEL: return "OpSpecConstantTargetINTEL"; + case SpvOpSpecConstantArchitectureINTEL: return "OpSpecConstantArchitectureINTEL"; + case SpvOpSpecConstantCapabilitiesINTEL: return "OpSpecConstantCapabilitiesINTEL"; + case SpvOpConditionalCopyObjectINTEL: return "OpConditionalCopyObjectINTEL"; + case SpvOpGroupIMulKHR: return "OpGroupIMulKHR"; + case SpvOpGroupFMulKHR: return "OpGroupFMulKHR"; + case SpvOpGroupBitwiseAndKHR: return "OpGroupBitwiseAndKHR"; + case SpvOpGroupBitwiseOrKHR: return "OpGroupBitwiseOrKHR"; + case SpvOpGroupBitwiseXorKHR: return "OpGroupBitwiseXorKHR"; + case SpvOpGroupLogicalAndKHR: return "OpGroupLogicalAndKHR"; + case SpvOpGroupLogicalOrKHR: return "OpGroupLogicalOrKHR"; + case SpvOpGroupLogicalXorKHR: return "OpGroupLogicalXorKHR"; + case SpvOpRoundFToTF32INTEL: return "OpRoundFToTF32INTEL"; + case SpvOpMaskedGatherINTEL: return "OpMaskedGatherINTEL"; + case SpvOpMaskedScatterINTEL: return "OpMaskedScatterINTEL"; + case SpvOpConvertHandleToImageINTEL: return "OpConvertHandleToImageINTEL"; + case SpvOpConvertHandleToSamplerINTEL: return "OpConvertHandleToSamplerINTEL"; + case SpvOpConvertHandleToSampledImageINTEL: return "OpConvertHandleToSampledImageINTEL"; + default: return "Unknown"; + } +} + +#endif /* SPV_ENABLE_UTILITY_CODE */ + +#endif + diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv.hpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv.hpp new file mode 100644 index 0000000000..9f4af57cf3 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv.hpp @@ -0,0 +1,5358 @@ +// Copyright (c) 2014-2024 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// This header is automatically generated by the same tool that creates +// the Binary Section of the SPIR-V specification. + +// Enumeration tokens for SPIR-V, in various styles: +// C, C++, C++11, JSON, Lua, Python, C#, D, Beef +// +// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// - C# will use enum classes in the Specification class located in the "Spv" namespace, +// e.g.: Spv.Specification.SourceLanguage.GLSL +// - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL +// - Beef will use enum classes in the Specification class located in the "Spv" namespace, +// e.g.: Spv.Specification.SourceLanguage.GLSL +// +// Some tokens act like mask values, which can be OR'd together, +// while others are mutually exclusive. The mask-like ones have +// "Mask" in their name, and a parallel enum that has the shift +// amount (1 << x) for each corresponding enumerant. + +#ifndef spirv_HPP +#define spirv_HPP + +namespace spv { + +typedef unsigned int Id; + +#define SPV_VERSION 0x10600 +#define SPV_REVISION 1 + +static const unsigned int MagicNumber = 0x07230203; +static const unsigned int Version = 0x00010600; +static const unsigned int Revision = 1; +static const unsigned int OpCodeMask = 0xffff; +static const unsigned int WordCountShift = 16; + +enum SourceLanguage { + SourceLanguageUnknown = 0, + SourceLanguageESSL = 1, + SourceLanguageGLSL = 2, + SourceLanguageOpenCL_C = 3, + SourceLanguageOpenCL_CPP = 4, + SourceLanguageHLSL = 5, + SourceLanguageCPP_for_OpenCL = 6, + SourceLanguageSYCL = 7, + SourceLanguageHERO_C = 8, + SourceLanguageNZSL = 9, + SourceLanguageWGSL = 10, + SourceLanguageSlang = 11, + SourceLanguageZig = 12, + SourceLanguageRust = 13, + SourceLanguageMax = 0x7fffffff, +}; + +enum ExecutionModel { + ExecutionModelVertex = 0, + ExecutionModelTessellationControl = 1, + ExecutionModelTessellationEvaluation = 2, + ExecutionModelGeometry = 3, + ExecutionModelFragment = 4, + ExecutionModelGLCompute = 5, + ExecutionModelKernel = 6, + ExecutionModelTaskNV = 5267, + ExecutionModelMeshNV = 5268, + ExecutionModelRayGenerationKHR = 5313, + ExecutionModelRayGenerationNV = 5313, + ExecutionModelIntersectionKHR = 5314, + ExecutionModelIntersectionNV = 5314, + ExecutionModelAnyHitKHR = 5315, + ExecutionModelAnyHitNV = 5315, + ExecutionModelClosestHitKHR = 5316, + ExecutionModelClosestHitNV = 5316, + ExecutionModelMissKHR = 5317, + ExecutionModelMissNV = 5317, + ExecutionModelCallableKHR = 5318, + ExecutionModelCallableNV = 5318, + ExecutionModelTaskEXT = 5364, + ExecutionModelMeshEXT = 5365, + ExecutionModelMax = 0x7fffffff, +}; + +enum AddressingModel { + AddressingModelLogical = 0, + AddressingModelPhysical32 = 1, + AddressingModelPhysical64 = 2, + AddressingModelPhysicalStorageBuffer64 = 5348, + AddressingModelPhysicalStorageBuffer64EXT = 5348, + AddressingModelMax = 0x7fffffff, +}; + +enum MemoryModel { + MemoryModelSimple = 0, + MemoryModelGLSL450 = 1, + MemoryModelOpenCL = 2, + MemoryModelVulkan = 3, + MemoryModelVulkanKHR = 3, + MemoryModelMax = 0x7fffffff, +}; + +enum ExecutionMode { + ExecutionModeInvocations = 0, + ExecutionModeSpacingEqual = 1, + ExecutionModeSpacingFractionalEven = 2, + ExecutionModeSpacingFractionalOdd = 3, + ExecutionModeVertexOrderCw = 4, + ExecutionModeVertexOrderCcw = 5, + ExecutionModePixelCenterInteger = 6, + ExecutionModeOriginUpperLeft = 7, + ExecutionModeOriginLowerLeft = 8, + ExecutionModeEarlyFragmentTests = 9, + ExecutionModePointMode = 10, + ExecutionModeXfb = 11, + ExecutionModeDepthReplacing = 12, + ExecutionModeDepthGreater = 14, + ExecutionModeDepthLess = 15, + ExecutionModeDepthUnchanged = 16, + ExecutionModeLocalSize = 17, + ExecutionModeLocalSizeHint = 18, + ExecutionModeInputPoints = 19, + ExecutionModeInputLines = 20, + ExecutionModeInputLinesAdjacency = 21, + ExecutionModeTriangles = 22, + ExecutionModeInputTrianglesAdjacency = 23, + ExecutionModeQuads = 24, + ExecutionModeIsolines = 25, + ExecutionModeOutputVertices = 26, + ExecutionModeOutputPoints = 27, + ExecutionModeOutputLineStrip = 28, + ExecutionModeOutputTriangleStrip = 29, + ExecutionModeVecTypeHint = 30, + ExecutionModeContractionOff = 31, + ExecutionModeInitializer = 33, + ExecutionModeFinalizer = 34, + ExecutionModeSubgroupSize = 35, + ExecutionModeSubgroupsPerWorkgroup = 36, + ExecutionModeSubgroupsPerWorkgroupId = 37, + ExecutionModeLocalSizeId = 38, + ExecutionModeLocalSizeHintId = 39, + ExecutionModeNonCoherentColorAttachmentReadEXT = 4169, + ExecutionModeNonCoherentDepthAttachmentReadEXT = 4170, + ExecutionModeNonCoherentStencilAttachmentReadEXT = 4171, + ExecutionModeSubgroupUniformControlFlowKHR = 4421, + ExecutionModePostDepthCoverage = 4446, + ExecutionModeDenormPreserve = 4459, + ExecutionModeDenormFlushToZero = 4460, + ExecutionModeSignedZeroInfNanPreserve = 4461, + ExecutionModeRoundingModeRTE = 4462, + ExecutionModeRoundingModeRTZ = 4463, + ExecutionModeNonCoherentTileAttachmentReadQCOM = 4489, + ExecutionModeTileShadingRateQCOM = 4490, + ExecutionModeEarlyAndLateFragmentTestsAMD = 5017, + ExecutionModeStencilRefReplacingEXT = 5027, + ExecutionModeCoalescingAMDX = 5069, + ExecutionModeIsApiEntryAMDX = 5070, + ExecutionModeMaxNodeRecursionAMDX = 5071, + ExecutionModeStaticNumWorkgroupsAMDX = 5072, + ExecutionModeShaderIndexAMDX = 5073, + ExecutionModeMaxNumWorkgroupsAMDX = 5077, + ExecutionModeStencilRefUnchangedFrontAMD = 5079, + ExecutionModeStencilRefGreaterFrontAMD = 5080, + ExecutionModeStencilRefLessFrontAMD = 5081, + ExecutionModeStencilRefUnchangedBackAMD = 5082, + ExecutionModeStencilRefGreaterBackAMD = 5083, + ExecutionModeStencilRefLessBackAMD = 5084, + ExecutionModeQuadDerivativesKHR = 5088, + ExecutionModeRequireFullQuadsKHR = 5089, + ExecutionModeSharesInputWithAMDX = 5102, + ExecutionModeOutputLinesEXT = 5269, + ExecutionModeOutputLinesNV = 5269, + ExecutionModeOutputPrimitivesEXT = 5270, + ExecutionModeOutputPrimitivesNV = 5270, + ExecutionModeDerivativeGroupQuadsKHR = 5289, + ExecutionModeDerivativeGroupQuadsNV = 5289, + ExecutionModeDerivativeGroupLinearKHR = 5290, + ExecutionModeDerivativeGroupLinearNV = 5290, + ExecutionModeOutputTrianglesEXT = 5298, + ExecutionModeOutputTrianglesNV = 5298, + ExecutionModePixelInterlockOrderedEXT = 5366, + ExecutionModePixelInterlockUnorderedEXT = 5367, + ExecutionModeSampleInterlockOrderedEXT = 5368, + ExecutionModeSampleInterlockUnorderedEXT = 5369, + ExecutionModeShadingRateInterlockOrderedEXT = 5370, + ExecutionModeShadingRateInterlockUnorderedEXT = 5371, + ExecutionModeSharedLocalMemorySizeINTEL = 5618, + ExecutionModeRoundingModeRTPINTEL = 5620, + ExecutionModeRoundingModeRTNINTEL = 5621, + ExecutionModeFloatingPointModeALTINTEL = 5622, + ExecutionModeFloatingPointModeIEEEINTEL = 5623, + ExecutionModeMaxWorkgroupSizeINTEL = 5893, + ExecutionModeMaxWorkDimINTEL = 5894, + ExecutionModeNoGlobalOffsetINTEL = 5895, + ExecutionModeNumSIMDWorkitemsINTEL = 5896, + ExecutionModeSchedulerTargetFmaxMhzINTEL = 5903, + ExecutionModeMaximallyReconvergesKHR = 6023, + ExecutionModeFPFastMathDefault = 6028, + ExecutionModeStreamingInterfaceINTEL = 6154, + ExecutionModeRegisterMapInterfaceINTEL = 6160, + ExecutionModeNamedBarrierCountINTEL = 6417, + ExecutionModeMaximumRegistersINTEL = 6461, + ExecutionModeMaximumRegistersIdINTEL = 6462, + ExecutionModeNamedMaximumRegistersINTEL = 6463, + ExecutionModeMax = 0x7fffffff, +}; + +enum StorageClass { + StorageClassUniformConstant = 0, + StorageClassInput = 1, + StorageClassUniform = 2, + StorageClassOutput = 3, + StorageClassWorkgroup = 4, + StorageClassCrossWorkgroup = 5, + StorageClassPrivate = 6, + StorageClassFunction = 7, + StorageClassGeneric = 8, + StorageClassPushConstant = 9, + StorageClassAtomicCounter = 10, + StorageClassImage = 11, + StorageClassStorageBuffer = 12, + StorageClassTileImageEXT = 4172, + StorageClassTileAttachmentQCOM = 4491, + StorageClassNodePayloadAMDX = 5068, + StorageClassCallableDataKHR = 5328, + StorageClassCallableDataNV = 5328, + StorageClassIncomingCallableDataKHR = 5329, + StorageClassIncomingCallableDataNV = 5329, + StorageClassRayPayloadKHR = 5338, + StorageClassRayPayloadNV = 5338, + StorageClassHitAttributeKHR = 5339, + StorageClassHitAttributeNV = 5339, + StorageClassIncomingRayPayloadKHR = 5342, + StorageClassIncomingRayPayloadNV = 5342, + StorageClassShaderRecordBufferKHR = 5343, + StorageClassShaderRecordBufferNV = 5343, + StorageClassPhysicalStorageBuffer = 5349, + StorageClassPhysicalStorageBufferEXT = 5349, + StorageClassHitObjectAttributeNV = 5385, + StorageClassTaskPayloadWorkgroupEXT = 5402, + StorageClassCodeSectionINTEL = 5605, + StorageClassDeviceOnlyINTEL = 5936, + StorageClassHostOnlyINTEL = 5937, + StorageClassMax = 0x7fffffff, +}; + +enum Dim { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + DimCube = 3, + DimRect = 4, + DimBuffer = 5, + DimSubpassData = 6, + DimTileImageDataEXT = 4173, + DimMax = 0x7fffffff, +}; + +enum SamplerAddressingMode { + SamplerAddressingModeNone = 0, + SamplerAddressingModeClampToEdge = 1, + SamplerAddressingModeClamp = 2, + SamplerAddressingModeRepeat = 3, + SamplerAddressingModeRepeatMirrored = 4, + SamplerAddressingModeMax = 0x7fffffff, +}; + +enum SamplerFilterMode { + SamplerFilterModeNearest = 0, + SamplerFilterModeLinear = 1, + SamplerFilterModeMax = 0x7fffffff, +}; + +enum ImageFormat { + ImageFormatUnknown = 0, + ImageFormatRgba32f = 1, + ImageFormatRgba16f = 2, + ImageFormatR32f = 3, + ImageFormatRgba8 = 4, + ImageFormatRgba8Snorm = 5, + ImageFormatRg32f = 6, + ImageFormatRg16f = 7, + ImageFormatR11fG11fB10f = 8, + ImageFormatR16f = 9, + ImageFormatRgba16 = 10, + ImageFormatRgb10A2 = 11, + ImageFormatRg16 = 12, + ImageFormatRg8 = 13, + ImageFormatR16 = 14, + ImageFormatR8 = 15, + ImageFormatRgba16Snorm = 16, + ImageFormatRg16Snorm = 17, + ImageFormatRg8Snorm = 18, + ImageFormatR16Snorm = 19, + ImageFormatR8Snorm = 20, + ImageFormatRgba32i = 21, + ImageFormatRgba16i = 22, + ImageFormatRgba8i = 23, + ImageFormatR32i = 24, + ImageFormatRg32i = 25, + ImageFormatRg16i = 26, + ImageFormatRg8i = 27, + ImageFormatR16i = 28, + ImageFormatR8i = 29, + ImageFormatRgba32ui = 30, + ImageFormatRgba16ui = 31, + ImageFormatRgba8ui = 32, + ImageFormatR32ui = 33, + ImageFormatRgb10a2ui = 34, + ImageFormatRg32ui = 35, + ImageFormatRg16ui = 36, + ImageFormatRg8ui = 37, + ImageFormatR16ui = 38, + ImageFormatR8ui = 39, + ImageFormatR64ui = 40, + ImageFormatR64i = 41, + ImageFormatMax = 0x7fffffff, +}; + +enum ImageChannelOrder { + ImageChannelOrderR = 0, + ImageChannelOrderA = 1, + ImageChannelOrderRG = 2, + ImageChannelOrderRA = 3, + ImageChannelOrderRGB = 4, + ImageChannelOrderRGBA = 5, + ImageChannelOrderBGRA = 6, + ImageChannelOrderARGB = 7, + ImageChannelOrderIntensity = 8, + ImageChannelOrderLuminance = 9, + ImageChannelOrderRx = 10, + ImageChannelOrderRGx = 11, + ImageChannelOrderRGBx = 12, + ImageChannelOrderDepth = 13, + ImageChannelOrderDepthStencil = 14, + ImageChannelOrdersRGB = 15, + ImageChannelOrdersRGBx = 16, + ImageChannelOrdersRGBA = 17, + ImageChannelOrdersBGRA = 18, + ImageChannelOrderABGR = 19, + ImageChannelOrderMax = 0x7fffffff, +}; + +enum ImageChannelDataType { + ImageChannelDataTypeSnormInt8 = 0, + ImageChannelDataTypeSnormInt16 = 1, + ImageChannelDataTypeUnormInt8 = 2, + ImageChannelDataTypeUnormInt16 = 3, + ImageChannelDataTypeUnormShort565 = 4, + ImageChannelDataTypeUnormShort555 = 5, + ImageChannelDataTypeUnormInt101010 = 6, + ImageChannelDataTypeSignedInt8 = 7, + ImageChannelDataTypeSignedInt16 = 8, + ImageChannelDataTypeSignedInt32 = 9, + ImageChannelDataTypeUnsignedInt8 = 10, + ImageChannelDataTypeUnsignedInt16 = 11, + ImageChannelDataTypeUnsignedInt32 = 12, + ImageChannelDataTypeHalfFloat = 13, + ImageChannelDataTypeFloat = 14, + ImageChannelDataTypeUnormInt24 = 15, + ImageChannelDataTypeUnormInt101010_2 = 16, + ImageChannelDataTypeUnormInt10X6EXT = 17, + ImageChannelDataTypeUnsignedIntRaw10EXT = 19, + ImageChannelDataTypeUnsignedIntRaw12EXT = 20, + ImageChannelDataTypeUnormInt2_101010EXT = 21, + ImageChannelDataTypeUnsignedInt10X6EXT = 22, + ImageChannelDataTypeUnsignedInt12X4EXT = 23, + ImageChannelDataTypeUnsignedInt14X2EXT = 24, + ImageChannelDataTypeUnormInt12X4EXT = 25, + ImageChannelDataTypeUnormInt14X2EXT = 26, + ImageChannelDataTypeMax = 0x7fffffff, +}; + +enum ImageOperandsShift { + ImageOperandsBiasShift = 0, + ImageOperandsLodShift = 1, + ImageOperandsGradShift = 2, + ImageOperandsConstOffsetShift = 3, + ImageOperandsOffsetShift = 4, + ImageOperandsConstOffsetsShift = 5, + ImageOperandsSampleShift = 6, + ImageOperandsMinLodShift = 7, + ImageOperandsMakeTexelAvailableShift = 8, + ImageOperandsMakeTexelAvailableKHRShift = 8, + ImageOperandsMakeTexelVisibleShift = 9, + ImageOperandsMakeTexelVisibleKHRShift = 9, + ImageOperandsNonPrivateTexelShift = 10, + ImageOperandsNonPrivateTexelKHRShift = 10, + ImageOperandsVolatileTexelShift = 11, + ImageOperandsVolatileTexelKHRShift = 11, + ImageOperandsSignExtendShift = 12, + ImageOperandsZeroExtendShift = 13, + ImageOperandsNontemporalShift = 14, + ImageOperandsOffsetsShift = 16, + ImageOperandsMax = 0x7fffffff, +}; + +enum ImageOperandsMask { + ImageOperandsMaskNone = 0, + ImageOperandsBiasMask = 0x00000001, + ImageOperandsLodMask = 0x00000002, + ImageOperandsGradMask = 0x00000004, + ImageOperandsConstOffsetMask = 0x00000008, + ImageOperandsOffsetMask = 0x00000010, + ImageOperandsConstOffsetsMask = 0x00000020, + ImageOperandsSampleMask = 0x00000040, + ImageOperandsMinLodMask = 0x00000080, + ImageOperandsMakeTexelAvailableMask = 0x00000100, + ImageOperandsMakeTexelAvailableKHRMask = 0x00000100, + ImageOperandsMakeTexelVisibleMask = 0x00000200, + ImageOperandsMakeTexelVisibleKHRMask = 0x00000200, + ImageOperandsNonPrivateTexelMask = 0x00000400, + ImageOperandsNonPrivateTexelKHRMask = 0x00000400, + ImageOperandsVolatileTexelMask = 0x00000800, + ImageOperandsVolatileTexelKHRMask = 0x00000800, + ImageOperandsSignExtendMask = 0x00001000, + ImageOperandsZeroExtendMask = 0x00002000, + ImageOperandsNontemporalMask = 0x00004000, + ImageOperandsOffsetsMask = 0x00010000, +}; + +enum FPFastMathModeShift { + FPFastMathModeNotNaNShift = 0, + FPFastMathModeNotInfShift = 1, + FPFastMathModeNSZShift = 2, + FPFastMathModeAllowRecipShift = 3, + FPFastMathModeFastShift = 4, + FPFastMathModeAllowContractShift = 16, + FPFastMathModeAllowContractFastINTELShift = 16, + FPFastMathModeAllowReassocShift = 17, + FPFastMathModeAllowReassocINTELShift = 17, + FPFastMathModeAllowTransformShift = 18, + FPFastMathModeMax = 0x7fffffff, +}; + +enum FPFastMathModeMask { + FPFastMathModeMaskNone = 0, + FPFastMathModeNotNaNMask = 0x00000001, + FPFastMathModeNotInfMask = 0x00000002, + FPFastMathModeNSZMask = 0x00000004, + FPFastMathModeAllowRecipMask = 0x00000008, + FPFastMathModeFastMask = 0x00000010, + FPFastMathModeAllowContractMask = 0x00010000, + FPFastMathModeAllowContractFastINTELMask = 0x00010000, + FPFastMathModeAllowReassocMask = 0x00020000, + FPFastMathModeAllowReassocINTELMask = 0x00020000, + FPFastMathModeAllowTransformMask = 0x00040000, +}; + +enum FPRoundingMode { + FPRoundingModeRTE = 0, + FPRoundingModeRTZ = 1, + FPRoundingModeRTP = 2, + FPRoundingModeRTN = 3, + FPRoundingModeMax = 0x7fffffff, +}; + +enum LinkageType { + LinkageTypeExport = 0, + LinkageTypeImport = 1, + LinkageTypeLinkOnceODR = 2, + LinkageTypeMax = 0x7fffffff, +}; + +enum AccessQualifier { + AccessQualifierReadOnly = 0, + AccessQualifierWriteOnly = 1, + AccessQualifierReadWrite = 2, + AccessQualifierMax = 0x7fffffff, +}; + +enum FunctionParameterAttribute { + FunctionParameterAttributeZext = 0, + FunctionParameterAttributeSext = 1, + FunctionParameterAttributeByVal = 2, + FunctionParameterAttributeSret = 3, + FunctionParameterAttributeNoAlias = 4, + FunctionParameterAttributeNoCapture = 5, + FunctionParameterAttributeNoWrite = 6, + FunctionParameterAttributeNoReadWrite = 7, + FunctionParameterAttributeRuntimeAlignedINTEL = 5940, + FunctionParameterAttributeMax = 0x7fffffff, +}; + +enum Decoration { + DecorationRelaxedPrecision = 0, + DecorationSpecId = 1, + DecorationBlock = 2, + DecorationBufferBlock = 3, + DecorationRowMajor = 4, + DecorationColMajor = 5, + DecorationArrayStride = 6, + DecorationMatrixStride = 7, + DecorationGLSLShared = 8, + DecorationGLSLPacked = 9, + DecorationCPacked = 10, + DecorationBuiltIn = 11, + DecorationNoPerspective = 13, + DecorationFlat = 14, + DecorationPatch = 15, + DecorationCentroid = 16, + DecorationSample = 17, + DecorationInvariant = 18, + DecorationRestrict = 19, + DecorationAliased = 20, + DecorationVolatile = 21, + DecorationConstant = 22, + DecorationCoherent = 23, + DecorationNonWritable = 24, + DecorationNonReadable = 25, + DecorationUniform = 26, + DecorationUniformId = 27, + DecorationSaturatedConversion = 28, + DecorationStream = 29, + DecorationLocation = 30, + DecorationComponent = 31, + DecorationIndex = 32, + DecorationBinding = 33, + DecorationDescriptorSet = 34, + DecorationOffset = 35, + DecorationXfbBuffer = 36, + DecorationXfbStride = 37, + DecorationFuncParamAttr = 38, + DecorationFPRoundingMode = 39, + DecorationFPFastMathMode = 40, + DecorationLinkageAttributes = 41, + DecorationNoContraction = 42, + DecorationInputAttachmentIndex = 43, + DecorationAlignment = 44, + DecorationMaxByteOffset = 45, + DecorationAlignmentId = 46, + DecorationMaxByteOffsetId = 47, + DecorationSaturatedToLargestFloat8NormalConversionEXT = 4216, + DecorationNoSignedWrap = 4469, + DecorationNoUnsignedWrap = 4470, + DecorationWeightTextureQCOM = 4487, + DecorationBlockMatchTextureQCOM = 4488, + DecorationBlockMatchSamplerQCOM = 4499, + DecorationExplicitInterpAMD = 4999, + DecorationNodeSharesPayloadLimitsWithAMDX = 5019, + DecorationNodeMaxPayloadsAMDX = 5020, + DecorationTrackFinishWritingAMDX = 5078, + DecorationPayloadNodeNameAMDX = 5091, + DecorationPayloadNodeBaseIndexAMDX = 5098, + DecorationPayloadNodeSparseArrayAMDX = 5099, + DecorationPayloadNodeArraySizeAMDX = 5100, + DecorationPayloadDispatchIndirectAMDX = 5105, + DecorationOverrideCoverageNV = 5248, + DecorationPassthroughNV = 5250, + DecorationViewportRelativeNV = 5252, + DecorationSecondaryViewportRelativeNV = 5256, + DecorationPerPrimitiveEXT = 5271, + DecorationPerPrimitiveNV = 5271, + DecorationPerViewNV = 5272, + DecorationPerTaskNV = 5273, + DecorationPerVertexKHR = 5285, + DecorationPerVertexNV = 5285, + DecorationNonUniform = 5300, + DecorationNonUniformEXT = 5300, + DecorationRestrictPointer = 5355, + DecorationRestrictPointerEXT = 5355, + DecorationAliasedPointer = 5356, + DecorationAliasedPointerEXT = 5356, + DecorationHitObjectShaderRecordBufferNV = 5386, + DecorationBindlessSamplerNV = 5398, + DecorationBindlessImageNV = 5399, + DecorationBoundSamplerNV = 5400, + DecorationBoundImageNV = 5401, + DecorationSIMTCallINTEL = 5599, + DecorationReferencedIndirectlyINTEL = 5602, + DecorationClobberINTEL = 5607, + DecorationSideEffectsINTEL = 5608, + DecorationVectorComputeVariableINTEL = 5624, + DecorationFuncParamIOKindINTEL = 5625, + DecorationVectorComputeFunctionINTEL = 5626, + DecorationStackCallINTEL = 5627, + DecorationGlobalVariableOffsetINTEL = 5628, + DecorationCounterBuffer = 5634, + DecorationHlslCounterBufferGOOGLE = 5634, + DecorationHlslSemanticGOOGLE = 5635, + DecorationUserSemantic = 5635, + DecorationUserTypeGOOGLE = 5636, + DecorationFunctionRoundingModeINTEL = 5822, + DecorationFunctionDenormModeINTEL = 5823, + DecorationRegisterINTEL = 5825, + DecorationMemoryINTEL = 5826, + DecorationNumbanksINTEL = 5827, + DecorationBankwidthINTEL = 5828, + DecorationMaxPrivateCopiesINTEL = 5829, + DecorationSinglepumpINTEL = 5830, + DecorationDoublepumpINTEL = 5831, + DecorationMaxReplicatesINTEL = 5832, + DecorationSimpleDualPortINTEL = 5833, + DecorationMergeINTEL = 5834, + DecorationBankBitsINTEL = 5835, + DecorationForcePow2DepthINTEL = 5836, + DecorationStridesizeINTEL = 5883, + DecorationWordsizeINTEL = 5884, + DecorationTrueDualPortINTEL = 5885, + DecorationBurstCoalesceINTEL = 5899, + DecorationCacheSizeINTEL = 5900, + DecorationDontStaticallyCoalesceINTEL = 5901, + DecorationPrefetchINTEL = 5902, + DecorationStallEnableINTEL = 5905, + DecorationFuseLoopsInFunctionINTEL = 5907, + DecorationMathOpDSPModeINTEL = 5909, + DecorationAliasScopeINTEL = 5914, + DecorationNoAliasINTEL = 5915, + DecorationInitiationIntervalINTEL = 5917, + DecorationMaxConcurrencyINTEL = 5918, + DecorationPipelineEnableINTEL = 5919, + DecorationBufferLocationINTEL = 5921, + DecorationIOPipeStorageINTEL = 5944, + DecorationFunctionFloatingPointModeINTEL = 6080, + DecorationSingleElementVectorINTEL = 6085, + DecorationVectorComputeCallableFunctionINTEL = 6087, + DecorationMediaBlockIOINTEL = 6140, + DecorationStallFreeINTEL = 6151, + DecorationFPMaxErrorDecorationINTEL = 6170, + DecorationLatencyControlLabelINTEL = 6172, + DecorationLatencyControlConstraintINTEL = 6173, + DecorationConduitKernelArgumentINTEL = 6175, + DecorationRegisterMapKernelArgumentINTEL = 6176, + DecorationMMHostInterfaceAddressWidthINTEL = 6177, + DecorationMMHostInterfaceDataWidthINTEL = 6178, + DecorationMMHostInterfaceLatencyINTEL = 6179, + DecorationMMHostInterfaceReadWriteModeINTEL = 6180, + DecorationMMHostInterfaceMaxBurstINTEL = 6181, + DecorationMMHostInterfaceWaitRequestINTEL = 6182, + DecorationStableKernelArgumentINTEL = 6183, + DecorationHostAccessINTEL = 6188, + DecorationInitModeINTEL = 6190, + DecorationImplementInRegisterMapINTEL = 6191, + DecorationConditionalINTEL = 6247, + DecorationCacheControlLoadINTEL = 6442, + DecorationCacheControlStoreINTEL = 6443, + DecorationMax = 0x7fffffff, +}; + +enum BuiltIn { + BuiltInPosition = 0, + BuiltInPointSize = 1, + BuiltInClipDistance = 3, + BuiltInCullDistance = 4, + BuiltInVertexId = 5, + BuiltInInstanceId = 6, + BuiltInPrimitiveId = 7, + BuiltInInvocationId = 8, + BuiltInLayer = 9, + BuiltInViewportIndex = 10, + BuiltInTessLevelOuter = 11, + BuiltInTessLevelInner = 12, + BuiltInTessCoord = 13, + BuiltInPatchVertices = 14, + BuiltInFragCoord = 15, + BuiltInPointCoord = 16, + BuiltInFrontFacing = 17, + BuiltInSampleId = 18, + BuiltInSamplePosition = 19, + BuiltInSampleMask = 20, + BuiltInFragDepth = 22, + BuiltInHelperInvocation = 23, + BuiltInNumWorkgroups = 24, + BuiltInWorkgroupSize = 25, + BuiltInWorkgroupId = 26, + BuiltInLocalInvocationId = 27, + BuiltInGlobalInvocationId = 28, + BuiltInLocalInvocationIndex = 29, + BuiltInWorkDim = 30, + BuiltInGlobalSize = 31, + BuiltInEnqueuedWorkgroupSize = 32, + BuiltInGlobalOffset = 33, + BuiltInGlobalLinearId = 34, + BuiltInSubgroupSize = 36, + BuiltInSubgroupMaxSize = 37, + BuiltInNumSubgroups = 38, + BuiltInNumEnqueuedSubgroups = 39, + BuiltInSubgroupId = 40, + BuiltInSubgroupLocalInvocationId = 41, + BuiltInVertexIndex = 42, + BuiltInInstanceIndex = 43, + BuiltInCoreIDARM = 4160, + BuiltInCoreCountARM = 4161, + BuiltInCoreMaxIDARM = 4162, + BuiltInWarpIDARM = 4163, + BuiltInWarpMaxIDARM = 4164, + BuiltInSubgroupEqMask = 4416, + BuiltInSubgroupEqMaskKHR = 4416, + BuiltInSubgroupGeMask = 4417, + BuiltInSubgroupGeMaskKHR = 4417, + BuiltInSubgroupGtMask = 4418, + BuiltInSubgroupGtMaskKHR = 4418, + BuiltInSubgroupLeMask = 4419, + BuiltInSubgroupLeMaskKHR = 4419, + BuiltInSubgroupLtMask = 4420, + BuiltInSubgroupLtMaskKHR = 4420, + BuiltInBaseVertex = 4424, + BuiltInBaseInstance = 4425, + BuiltInDrawIndex = 4426, + BuiltInPrimitiveShadingRateKHR = 4432, + BuiltInDeviceIndex = 4438, + BuiltInViewIndex = 4440, + BuiltInShadingRateKHR = 4444, + BuiltInTileOffsetQCOM = 4492, + BuiltInTileDimensionQCOM = 4493, + BuiltInTileApronSizeQCOM = 4494, + BuiltInBaryCoordNoPerspAMD = 4992, + BuiltInBaryCoordNoPerspCentroidAMD = 4993, + BuiltInBaryCoordNoPerspSampleAMD = 4994, + BuiltInBaryCoordSmoothAMD = 4995, + BuiltInBaryCoordSmoothCentroidAMD = 4996, + BuiltInBaryCoordSmoothSampleAMD = 4997, + BuiltInBaryCoordPullModelAMD = 4998, + BuiltInFragStencilRefEXT = 5014, + BuiltInRemainingRecursionLevelsAMDX = 5021, + BuiltInShaderIndexAMDX = 5073, + BuiltInViewportMaskNV = 5253, + BuiltInSecondaryPositionNV = 5257, + BuiltInSecondaryViewportMaskNV = 5258, + BuiltInPositionPerViewNV = 5261, + BuiltInViewportMaskPerViewNV = 5262, + BuiltInFullyCoveredEXT = 5264, + BuiltInTaskCountNV = 5274, + BuiltInPrimitiveCountNV = 5275, + BuiltInPrimitiveIndicesNV = 5276, + BuiltInClipDistancePerViewNV = 5277, + BuiltInCullDistancePerViewNV = 5278, + BuiltInLayerPerViewNV = 5279, + BuiltInMeshViewCountNV = 5280, + BuiltInMeshViewIndicesNV = 5281, + BuiltInBaryCoordKHR = 5286, + BuiltInBaryCoordNV = 5286, + BuiltInBaryCoordNoPerspKHR = 5287, + BuiltInBaryCoordNoPerspNV = 5287, + BuiltInFragSizeEXT = 5292, + BuiltInFragmentSizeNV = 5292, + BuiltInFragInvocationCountEXT = 5293, + BuiltInInvocationsPerPixelNV = 5293, + BuiltInPrimitivePointIndicesEXT = 5294, + BuiltInPrimitiveLineIndicesEXT = 5295, + BuiltInPrimitiveTriangleIndicesEXT = 5296, + BuiltInCullPrimitiveEXT = 5299, + BuiltInLaunchIdKHR = 5319, + BuiltInLaunchIdNV = 5319, + BuiltInLaunchSizeKHR = 5320, + BuiltInLaunchSizeNV = 5320, + BuiltInWorldRayOriginKHR = 5321, + BuiltInWorldRayOriginNV = 5321, + BuiltInWorldRayDirectionKHR = 5322, + BuiltInWorldRayDirectionNV = 5322, + BuiltInObjectRayOriginKHR = 5323, + BuiltInObjectRayOriginNV = 5323, + BuiltInObjectRayDirectionKHR = 5324, + BuiltInObjectRayDirectionNV = 5324, + BuiltInRayTminKHR = 5325, + BuiltInRayTminNV = 5325, + BuiltInRayTmaxKHR = 5326, + BuiltInRayTmaxNV = 5326, + BuiltInInstanceCustomIndexKHR = 5327, + BuiltInInstanceCustomIndexNV = 5327, + BuiltInObjectToWorldKHR = 5330, + BuiltInObjectToWorldNV = 5330, + BuiltInWorldToObjectKHR = 5331, + BuiltInWorldToObjectNV = 5331, + BuiltInHitTNV = 5332, + BuiltInHitKindKHR = 5333, + BuiltInHitKindNV = 5333, + BuiltInCurrentRayTimeNV = 5334, + BuiltInHitTriangleVertexPositionsKHR = 5335, + BuiltInHitMicroTriangleVertexPositionsNV = 5337, + BuiltInHitMicroTriangleVertexBarycentricsNV = 5344, + BuiltInIncomingRayFlagsKHR = 5351, + BuiltInIncomingRayFlagsNV = 5351, + BuiltInRayGeometryIndexKHR = 5352, + BuiltInHitIsSphereNV = 5359, + BuiltInHitIsLSSNV = 5360, + BuiltInHitSpherePositionNV = 5361, + BuiltInWarpsPerSMNV = 5374, + BuiltInSMCountNV = 5375, + BuiltInWarpIDNV = 5376, + BuiltInSMIDNV = 5377, + BuiltInHitLSSPositionsNV = 5396, + BuiltInHitKindFrontFacingMicroTriangleNV = 5405, + BuiltInHitKindBackFacingMicroTriangleNV = 5406, + BuiltInHitSphereRadiusNV = 5420, + BuiltInHitLSSRadiiNV = 5421, + BuiltInClusterIDNV = 5436, + BuiltInCullMaskKHR = 6021, + BuiltInMax = 0x7fffffff, +}; + +enum SelectionControlShift { + SelectionControlFlattenShift = 0, + SelectionControlDontFlattenShift = 1, + SelectionControlMax = 0x7fffffff, +}; + +enum SelectionControlMask { + SelectionControlMaskNone = 0, + SelectionControlFlattenMask = 0x00000001, + SelectionControlDontFlattenMask = 0x00000002, +}; + +enum LoopControlShift { + LoopControlUnrollShift = 0, + LoopControlDontUnrollShift = 1, + LoopControlDependencyInfiniteShift = 2, + LoopControlDependencyLengthShift = 3, + LoopControlMinIterationsShift = 4, + LoopControlMaxIterationsShift = 5, + LoopControlIterationMultipleShift = 6, + LoopControlPeelCountShift = 7, + LoopControlPartialCountShift = 8, + LoopControlInitiationIntervalINTELShift = 16, + LoopControlMaxConcurrencyINTELShift = 17, + LoopControlDependencyArrayINTELShift = 18, + LoopControlPipelineEnableINTELShift = 19, + LoopControlLoopCoalesceINTELShift = 20, + LoopControlMaxInterleavingINTELShift = 21, + LoopControlSpeculatedIterationsINTELShift = 22, + LoopControlNoFusionINTELShift = 23, + LoopControlLoopCountINTELShift = 24, + LoopControlMaxReinvocationDelayINTELShift = 25, + LoopControlMax = 0x7fffffff, +}; + +enum LoopControlMask { + LoopControlMaskNone = 0, + LoopControlUnrollMask = 0x00000001, + LoopControlDontUnrollMask = 0x00000002, + LoopControlDependencyInfiniteMask = 0x00000004, + LoopControlDependencyLengthMask = 0x00000008, + LoopControlMinIterationsMask = 0x00000010, + LoopControlMaxIterationsMask = 0x00000020, + LoopControlIterationMultipleMask = 0x00000040, + LoopControlPeelCountMask = 0x00000080, + LoopControlPartialCountMask = 0x00000100, + LoopControlInitiationIntervalINTELMask = 0x00010000, + LoopControlMaxConcurrencyINTELMask = 0x00020000, + LoopControlDependencyArrayINTELMask = 0x00040000, + LoopControlPipelineEnableINTELMask = 0x00080000, + LoopControlLoopCoalesceINTELMask = 0x00100000, + LoopControlMaxInterleavingINTELMask = 0x00200000, + LoopControlSpeculatedIterationsINTELMask = 0x00400000, + LoopControlNoFusionINTELMask = 0x00800000, + LoopControlLoopCountINTELMask = 0x01000000, + LoopControlMaxReinvocationDelayINTELMask = 0x02000000, +}; + +enum FunctionControlShift { + FunctionControlInlineShift = 0, + FunctionControlDontInlineShift = 1, + FunctionControlPureShift = 2, + FunctionControlConstShift = 3, + FunctionControlOptNoneEXTShift = 16, + FunctionControlOptNoneINTELShift = 16, + FunctionControlMax = 0x7fffffff, +}; + +enum FunctionControlMask { + FunctionControlMaskNone = 0, + FunctionControlInlineMask = 0x00000001, + FunctionControlDontInlineMask = 0x00000002, + FunctionControlPureMask = 0x00000004, + FunctionControlConstMask = 0x00000008, + FunctionControlOptNoneEXTMask = 0x00010000, + FunctionControlOptNoneINTELMask = 0x00010000, +}; + +enum MemorySemanticsShift { + MemorySemanticsAcquireShift = 1, + MemorySemanticsReleaseShift = 2, + MemorySemanticsAcquireReleaseShift = 3, + MemorySemanticsSequentiallyConsistentShift = 4, + MemorySemanticsUniformMemoryShift = 6, + MemorySemanticsSubgroupMemoryShift = 7, + MemorySemanticsWorkgroupMemoryShift = 8, + MemorySemanticsCrossWorkgroupMemoryShift = 9, + MemorySemanticsAtomicCounterMemoryShift = 10, + MemorySemanticsImageMemoryShift = 11, + MemorySemanticsOutputMemoryShift = 12, + MemorySemanticsOutputMemoryKHRShift = 12, + MemorySemanticsMakeAvailableShift = 13, + MemorySemanticsMakeAvailableKHRShift = 13, + MemorySemanticsMakeVisibleShift = 14, + MemorySemanticsMakeVisibleKHRShift = 14, + MemorySemanticsVolatileShift = 15, + MemorySemanticsMax = 0x7fffffff, +}; + +enum MemorySemanticsMask { + MemorySemanticsMaskNone = 0, + MemorySemanticsAcquireMask = 0x00000002, + MemorySemanticsReleaseMask = 0x00000004, + MemorySemanticsAcquireReleaseMask = 0x00000008, + MemorySemanticsSequentiallyConsistentMask = 0x00000010, + MemorySemanticsUniformMemoryMask = 0x00000040, + MemorySemanticsSubgroupMemoryMask = 0x00000080, + MemorySemanticsWorkgroupMemoryMask = 0x00000100, + MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, + MemorySemanticsAtomicCounterMemoryMask = 0x00000400, + MemorySemanticsImageMemoryMask = 0x00000800, + MemorySemanticsOutputMemoryMask = 0x00001000, + MemorySemanticsOutputMemoryKHRMask = 0x00001000, + MemorySemanticsMakeAvailableMask = 0x00002000, + MemorySemanticsMakeAvailableKHRMask = 0x00002000, + MemorySemanticsMakeVisibleMask = 0x00004000, + MemorySemanticsMakeVisibleKHRMask = 0x00004000, + MemorySemanticsVolatileMask = 0x00008000, +}; + +enum MemoryAccessShift { + MemoryAccessVolatileShift = 0, + MemoryAccessAlignedShift = 1, + MemoryAccessNontemporalShift = 2, + MemoryAccessMakePointerAvailableShift = 3, + MemoryAccessMakePointerAvailableKHRShift = 3, + MemoryAccessMakePointerVisibleShift = 4, + MemoryAccessMakePointerVisibleKHRShift = 4, + MemoryAccessNonPrivatePointerShift = 5, + MemoryAccessNonPrivatePointerKHRShift = 5, + MemoryAccessAliasScopeINTELMaskShift = 16, + MemoryAccessNoAliasINTELMaskShift = 17, + MemoryAccessMax = 0x7fffffff, +}; + +enum MemoryAccessMask { + MemoryAccessMaskNone = 0, + MemoryAccessVolatileMask = 0x00000001, + MemoryAccessAlignedMask = 0x00000002, + MemoryAccessNontemporalMask = 0x00000004, + MemoryAccessMakePointerAvailableMask = 0x00000008, + MemoryAccessMakePointerAvailableKHRMask = 0x00000008, + MemoryAccessMakePointerVisibleMask = 0x00000010, + MemoryAccessMakePointerVisibleKHRMask = 0x00000010, + MemoryAccessNonPrivatePointerMask = 0x00000020, + MemoryAccessNonPrivatePointerKHRMask = 0x00000020, + MemoryAccessAliasScopeINTELMaskMask = 0x00010000, + MemoryAccessNoAliasINTELMaskMask = 0x00020000, +}; + +enum Scope { + ScopeCrossDevice = 0, + ScopeDevice = 1, + ScopeWorkgroup = 2, + ScopeSubgroup = 3, + ScopeInvocation = 4, + ScopeQueueFamily = 5, + ScopeQueueFamilyKHR = 5, + ScopeShaderCallKHR = 6, + ScopeMax = 0x7fffffff, +}; + +enum GroupOperation { + GroupOperationReduce = 0, + GroupOperationInclusiveScan = 1, + GroupOperationExclusiveScan = 2, + GroupOperationClusteredReduce = 3, + GroupOperationPartitionedReduceNV = 6, + GroupOperationPartitionedInclusiveScanNV = 7, + GroupOperationPartitionedExclusiveScanNV = 8, + GroupOperationMax = 0x7fffffff, +}; + +enum KernelEnqueueFlags { + KernelEnqueueFlagsNoWait = 0, + KernelEnqueueFlagsWaitKernel = 1, + KernelEnqueueFlagsWaitWorkGroup = 2, + KernelEnqueueFlagsMax = 0x7fffffff, +}; + +enum KernelProfilingInfoShift { + KernelProfilingInfoCmdExecTimeShift = 0, + KernelProfilingInfoMax = 0x7fffffff, +}; + +enum KernelProfilingInfoMask { + KernelProfilingInfoMaskNone = 0, + KernelProfilingInfoCmdExecTimeMask = 0x00000001, +}; + +enum Capability { + CapabilityMatrix = 0, + CapabilityShader = 1, + CapabilityGeometry = 2, + CapabilityTessellation = 3, + CapabilityAddresses = 4, + CapabilityLinkage = 5, + CapabilityKernel = 6, + CapabilityVector16 = 7, + CapabilityFloat16Buffer = 8, + CapabilityFloat16 = 9, + CapabilityFloat64 = 10, + CapabilityInt64 = 11, + CapabilityInt64Atomics = 12, + CapabilityImageBasic = 13, + CapabilityImageReadWrite = 14, + CapabilityImageMipmap = 15, + CapabilityPipes = 17, + CapabilityGroups = 18, + CapabilityDeviceEnqueue = 19, + CapabilityLiteralSampler = 20, + CapabilityAtomicStorage = 21, + CapabilityInt16 = 22, + CapabilityTessellationPointSize = 23, + CapabilityGeometryPointSize = 24, + CapabilityImageGatherExtended = 25, + CapabilityStorageImageMultisample = 27, + CapabilityUniformBufferArrayDynamicIndexing = 28, + CapabilitySampledImageArrayDynamicIndexing = 29, + CapabilityStorageBufferArrayDynamicIndexing = 30, + CapabilityStorageImageArrayDynamicIndexing = 31, + CapabilityClipDistance = 32, + CapabilityCullDistance = 33, + CapabilityImageCubeArray = 34, + CapabilitySampleRateShading = 35, + CapabilityImageRect = 36, + CapabilitySampledRect = 37, + CapabilityGenericPointer = 38, + CapabilityInt8 = 39, + CapabilityInputAttachment = 40, + CapabilitySparseResidency = 41, + CapabilityMinLod = 42, + CapabilitySampled1D = 43, + CapabilityImage1D = 44, + CapabilitySampledCubeArray = 45, + CapabilitySampledBuffer = 46, + CapabilityImageBuffer = 47, + CapabilityImageMSArray = 48, + CapabilityStorageImageExtendedFormats = 49, + CapabilityImageQuery = 50, + CapabilityDerivativeControl = 51, + CapabilityInterpolationFunction = 52, + CapabilityTransformFeedback = 53, + CapabilityGeometryStreams = 54, + CapabilityStorageImageReadWithoutFormat = 55, + CapabilityStorageImageWriteWithoutFormat = 56, + CapabilityMultiViewport = 57, + CapabilitySubgroupDispatch = 58, + CapabilityNamedBarrier = 59, + CapabilityPipeStorage = 60, + CapabilityGroupNonUniform = 61, + CapabilityGroupNonUniformVote = 62, + CapabilityGroupNonUniformArithmetic = 63, + CapabilityGroupNonUniformBallot = 64, + CapabilityGroupNonUniformShuffle = 65, + CapabilityGroupNonUniformShuffleRelative = 66, + CapabilityGroupNonUniformClustered = 67, + CapabilityGroupNonUniformQuad = 68, + CapabilityShaderLayer = 69, + CapabilityShaderViewportIndex = 70, + CapabilityUniformDecoration = 71, + CapabilityCoreBuiltinsARM = 4165, + CapabilityTileImageColorReadAccessEXT = 4166, + CapabilityTileImageDepthReadAccessEXT = 4167, + CapabilityTileImageStencilReadAccessEXT = 4168, + CapabilityTensorsARM = 4174, + CapabilityStorageTensorArrayDynamicIndexingARM = 4175, + CapabilityStorageTensorArrayNonUniformIndexingARM = 4176, + CapabilityGraphARM = 4191, + CapabilityCooperativeMatrixLayoutsARM = 4201, + CapabilityFloat8EXT = 4212, + CapabilityFloat8CooperativeMatrixEXT = 4213, + CapabilityFragmentShadingRateKHR = 4422, + CapabilitySubgroupBallotKHR = 4423, + CapabilityDrawParameters = 4427, + CapabilityWorkgroupMemoryExplicitLayoutKHR = 4428, + CapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR = 4429, + CapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR = 4430, + CapabilitySubgroupVoteKHR = 4431, + CapabilityStorageBuffer16BitAccess = 4433, + CapabilityStorageUniformBufferBlock16 = 4433, + CapabilityStorageUniform16 = 4434, + CapabilityUniformAndStorageBuffer16BitAccess = 4434, + CapabilityStoragePushConstant16 = 4435, + CapabilityStorageInputOutput16 = 4436, + CapabilityDeviceGroup = 4437, + CapabilityMultiView = 4439, + CapabilityVariablePointersStorageBuffer = 4441, + CapabilityVariablePointers = 4442, + CapabilityAtomicStorageOps = 4445, + CapabilitySampleMaskPostDepthCoverage = 4447, + CapabilityStorageBuffer8BitAccess = 4448, + CapabilityUniformAndStorageBuffer8BitAccess = 4449, + CapabilityStoragePushConstant8 = 4450, + CapabilityDenormPreserve = 4464, + CapabilityDenormFlushToZero = 4465, + CapabilitySignedZeroInfNanPreserve = 4466, + CapabilityRoundingModeRTE = 4467, + CapabilityRoundingModeRTZ = 4468, + CapabilityRayQueryProvisionalKHR = 4471, + CapabilityRayQueryKHR = 4472, + CapabilityUntypedPointersKHR = 4473, + CapabilityRayTraversalPrimitiveCullingKHR = 4478, + CapabilityRayTracingKHR = 4479, + CapabilityTextureSampleWeightedQCOM = 4484, + CapabilityTextureBoxFilterQCOM = 4485, + CapabilityTextureBlockMatchQCOM = 4486, + CapabilityTileShadingQCOM = 4495, + CapabilityCooperativeMatrixConversionQCOM = 4496, + CapabilityTextureBlockMatch2QCOM = 4498, + CapabilityFloat16ImageAMD = 5008, + CapabilityImageGatherBiasLodAMD = 5009, + CapabilityFragmentMaskAMD = 5010, + CapabilityStencilExportEXT = 5013, + CapabilityImageReadWriteLodAMD = 5015, + CapabilityInt64ImageEXT = 5016, + CapabilityShaderClockKHR = 5055, + CapabilityShaderEnqueueAMDX = 5067, + CapabilityQuadControlKHR = 5087, + CapabilityInt4TypeINTEL = 5112, + CapabilityInt4CooperativeMatrixINTEL = 5114, + CapabilityBFloat16TypeKHR = 5116, + CapabilityBFloat16DotProductKHR = 5117, + CapabilityBFloat16CooperativeMatrixKHR = 5118, + CapabilitySampleMaskOverrideCoverageNV = 5249, + CapabilityGeometryShaderPassthroughNV = 5251, + CapabilityShaderViewportIndexLayerEXT = 5254, + CapabilityShaderViewportIndexLayerNV = 5254, + CapabilityShaderViewportMaskNV = 5255, + CapabilityShaderStereoViewNV = 5259, + CapabilityPerViewAttributesNV = 5260, + CapabilityFragmentFullyCoveredEXT = 5265, + CapabilityMeshShadingNV = 5266, + CapabilityImageFootprintNV = 5282, + CapabilityMeshShadingEXT = 5283, + CapabilityFragmentBarycentricKHR = 5284, + CapabilityFragmentBarycentricNV = 5284, + CapabilityComputeDerivativeGroupQuadsKHR = 5288, + CapabilityComputeDerivativeGroupQuadsNV = 5288, + CapabilityFragmentDensityEXT = 5291, + CapabilityShadingRateNV = 5291, + CapabilityGroupNonUniformPartitionedNV = 5297, + CapabilityShaderNonUniform = 5301, + CapabilityShaderNonUniformEXT = 5301, + CapabilityRuntimeDescriptorArray = 5302, + CapabilityRuntimeDescriptorArrayEXT = 5302, + CapabilityInputAttachmentArrayDynamicIndexing = 5303, + CapabilityInputAttachmentArrayDynamicIndexingEXT = 5303, + CapabilityUniformTexelBufferArrayDynamicIndexing = 5304, + CapabilityUniformTexelBufferArrayDynamicIndexingEXT = 5304, + CapabilityStorageTexelBufferArrayDynamicIndexing = 5305, + CapabilityStorageTexelBufferArrayDynamicIndexingEXT = 5305, + CapabilityUniformBufferArrayNonUniformIndexing = 5306, + CapabilityUniformBufferArrayNonUniformIndexingEXT = 5306, + CapabilitySampledImageArrayNonUniformIndexing = 5307, + CapabilitySampledImageArrayNonUniformIndexingEXT = 5307, + CapabilityStorageBufferArrayNonUniformIndexing = 5308, + CapabilityStorageBufferArrayNonUniformIndexingEXT = 5308, + CapabilityStorageImageArrayNonUniformIndexing = 5309, + CapabilityStorageImageArrayNonUniformIndexingEXT = 5309, + CapabilityInputAttachmentArrayNonUniformIndexing = 5310, + CapabilityInputAttachmentArrayNonUniformIndexingEXT = 5310, + CapabilityUniformTexelBufferArrayNonUniformIndexing = 5311, + CapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311, + CapabilityStorageTexelBufferArrayNonUniformIndexing = 5312, + CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312, + CapabilityRayTracingPositionFetchKHR = 5336, + CapabilityRayTracingNV = 5340, + CapabilityRayTracingMotionBlurNV = 5341, + CapabilityVulkanMemoryModel = 5345, + CapabilityVulkanMemoryModelKHR = 5345, + CapabilityVulkanMemoryModelDeviceScope = 5346, + CapabilityVulkanMemoryModelDeviceScopeKHR = 5346, + CapabilityPhysicalStorageBufferAddresses = 5347, + CapabilityPhysicalStorageBufferAddressesEXT = 5347, + CapabilityComputeDerivativeGroupLinearKHR = 5350, + CapabilityComputeDerivativeGroupLinearNV = 5350, + CapabilityRayTracingProvisionalKHR = 5353, + CapabilityCooperativeMatrixNV = 5357, + CapabilityFragmentShaderSampleInterlockEXT = 5363, + CapabilityFragmentShaderShadingRateInterlockEXT = 5372, + CapabilityShaderSMBuiltinsNV = 5373, + CapabilityFragmentShaderPixelInterlockEXT = 5378, + CapabilityDemoteToHelperInvocation = 5379, + CapabilityDemoteToHelperInvocationEXT = 5379, + CapabilityDisplacementMicromapNV = 5380, + CapabilityRayTracingOpacityMicromapEXT = 5381, + CapabilityShaderInvocationReorderNV = 5383, + CapabilityBindlessTextureNV = 5390, + CapabilityRayQueryPositionFetchKHR = 5391, + CapabilityCooperativeVectorNV = 5394, + CapabilityAtomicFloat16VectorNV = 5404, + CapabilityRayTracingDisplacementMicromapNV = 5409, + CapabilityRawAccessChainsNV = 5414, + CapabilityRayTracingSpheresGeometryNV = 5418, + CapabilityRayTracingLinearSweptSpheresGeometryNV = 5419, + CapabilityCooperativeMatrixReductionsNV = 5430, + CapabilityCooperativeMatrixConversionsNV = 5431, + CapabilityCooperativeMatrixPerElementOperationsNV = 5432, + CapabilityCooperativeMatrixTensorAddressingNV = 5433, + CapabilityCooperativeMatrixBlockLoadsNV = 5434, + CapabilityCooperativeVectorTrainingNV = 5435, + CapabilityRayTracingClusterAccelerationStructureNV = 5437, + CapabilityTensorAddressingNV = 5439, + CapabilitySubgroupShuffleINTEL = 5568, + CapabilitySubgroupBufferBlockIOINTEL = 5569, + CapabilitySubgroupImageBlockIOINTEL = 5570, + CapabilitySubgroupImageMediaBlockIOINTEL = 5579, + CapabilityRoundToInfinityINTEL = 5582, + CapabilityFloatingPointModeINTEL = 5583, + CapabilityIntegerFunctions2INTEL = 5584, + CapabilityFunctionPointersINTEL = 5603, + CapabilityIndirectReferencesINTEL = 5604, + CapabilityAsmINTEL = 5606, + CapabilityAtomicFloat32MinMaxEXT = 5612, + CapabilityAtomicFloat64MinMaxEXT = 5613, + CapabilityAtomicFloat16MinMaxEXT = 5616, + CapabilityVectorComputeINTEL = 5617, + CapabilityVectorAnyINTEL = 5619, + CapabilityExpectAssumeKHR = 5629, + CapabilitySubgroupAvcMotionEstimationINTEL = 5696, + CapabilitySubgroupAvcMotionEstimationIntraINTEL = 5697, + CapabilitySubgroupAvcMotionEstimationChromaINTEL = 5698, + CapabilityVariableLengthArrayINTEL = 5817, + CapabilityFunctionFloatControlINTEL = 5821, + CapabilityFPGAMemoryAttributesINTEL = 5824, + CapabilityFPFastMathModeINTEL = 5837, + CapabilityArbitraryPrecisionIntegersINTEL = 5844, + CapabilityArbitraryPrecisionFloatingPointINTEL = 5845, + CapabilityUnstructuredLoopControlsINTEL = 5886, + CapabilityFPGALoopControlsINTEL = 5888, + CapabilityKernelAttributesINTEL = 5892, + CapabilityFPGAKernelAttributesINTEL = 5897, + CapabilityFPGAMemoryAccessesINTEL = 5898, + CapabilityFPGAClusterAttributesINTEL = 5904, + CapabilityLoopFuseINTEL = 5906, + CapabilityFPGADSPControlINTEL = 5908, + CapabilityMemoryAccessAliasingINTEL = 5910, + CapabilityFPGAInvocationPipeliningAttributesINTEL = 5916, + CapabilityFPGABufferLocationINTEL = 5920, + CapabilityArbitraryPrecisionFixedPointINTEL = 5922, + CapabilityUSMStorageClassesINTEL = 5935, + CapabilityRuntimeAlignedAttributeINTEL = 5939, + CapabilityIOPipesINTEL = 5943, + CapabilityBlockingPipesINTEL = 5945, + CapabilityFPGARegINTEL = 5948, + CapabilityDotProductInputAll = 6016, + CapabilityDotProductInputAllKHR = 6016, + CapabilityDotProductInput4x8Bit = 6017, + CapabilityDotProductInput4x8BitKHR = 6017, + CapabilityDotProductInput4x8BitPacked = 6018, + CapabilityDotProductInput4x8BitPackedKHR = 6018, + CapabilityDotProduct = 6019, + CapabilityDotProductKHR = 6019, + CapabilityRayCullMaskKHR = 6020, + CapabilityCooperativeMatrixKHR = 6022, + CapabilityReplicatedCompositesEXT = 6024, + CapabilityBitInstructions = 6025, + CapabilityGroupNonUniformRotateKHR = 6026, + CapabilityFloatControls2 = 6029, + CapabilityFMAKHR = 6030, + CapabilityAtomicFloat32AddEXT = 6033, + CapabilityAtomicFloat64AddEXT = 6034, + CapabilityLongCompositesINTEL = 6089, + CapabilityOptNoneEXT = 6094, + CapabilityOptNoneINTEL = 6094, + CapabilityAtomicFloat16AddEXT = 6095, + CapabilityDebugInfoModuleINTEL = 6114, + CapabilityBFloat16ConversionINTEL = 6115, + CapabilitySplitBarrierINTEL = 6141, + CapabilityArithmeticFenceEXT = 6144, + CapabilityFPGAClusterAttributesV2INTEL = 6150, + CapabilityFPGAKernelAttributesv2INTEL = 6161, + CapabilityTaskSequenceINTEL = 6162, + CapabilityFPMaxErrorINTEL = 6169, + CapabilityFPGALatencyControlINTEL = 6171, + CapabilityFPGAArgumentInterfacesINTEL = 6174, + CapabilityGlobalVariableHostAccessINTEL = 6187, + CapabilityGlobalVariableFPGADecorationsINTEL = 6189, + CapabilitySubgroupBufferPrefetchINTEL = 6220, + CapabilitySubgroup2DBlockIOINTEL = 6228, + CapabilitySubgroup2DBlockTransformINTEL = 6229, + CapabilitySubgroup2DBlockTransposeINTEL = 6230, + CapabilitySubgroupMatrixMultiplyAccumulateINTEL = 6236, + CapabilityTernaryBitwiseFunctionINTEL = 6241, + CapabilityUntypedVariableLengthArrayINTEL = 6243, + CapabilitySpecConditionalINTEL = 6245, + CapabilityFunctionVariantsINTEL = 6246, + CapabilityGroupUniformArithmeticKHR = 6400, + CapabilityTensorFloat32RoundingINTEL = 6425, + CapabilityMaskedGatherScatterINTEL = 6427, + CapabilityCacheControlsINTEL = 6441, + CapabilityRegisterLimitsINTEL = 6460, + CapabilityBindlessImagesINTEL = 6528, + CapabilityMax = 0x7fffffff, +}; + +enum RayFlagsShift { + RayFlagsOpaqueKHRShift = 0, + RayFlagsNoOpaqueKHRShift = 1, + RayFlagsTerminateOnFirstHitKHRShift = 2, + RayFlagsSkipClosestHitShaderKHRShift = 3, + RayFlagsCullBackFacingTrianglesKHRShift = 4, + RayFlagsCullFrontFacingTrianglesKHRShift = 5, + RayFlagsCullOpaqueKHRShift = 6, + RayFlagsCullNoOpaqueKHRShift = 7, + RayFlagsSkipBuiltinPrimitivesNVShift = 8, + RayFlagsSkipTrianglesKHRShift = 8, + RayFlagsSkipAABBsKHRShift = 9, + RayFlagsForceOpacityMicromap2StateEXTShift = 10, + RayFlagsMax = 0x7fffffff, +}; + +enum RayFlagsMask { + RayFlagsMaskNone = 0, + RayFlagsOpaqueKHRMask = 0x00000001, + RayFlagsNoOpaqueKHRMask = 0x00000002, + RayFlagsTerminateOnFirstHitKHRMask = 0x00000004, + RayFlagsSkipClosestHitShaderKHRMask = 0x00000008, + RayFlagsCullBackFacingTrianglesKHRMask = 0x00000010, + RayFlagsCullFrontFacingTrianglesKHRMask = 0x00000020, + RayFlagsCullOpaqueKHRMask = 0x00000040, + RayFlagsCullNoOpaqueKHRMask = 0x00000080, + RayFlagsSkipBuiltinPrimitivesNVMask = 0x00000100, + RayFlagsSkipTrianglesKHRMask = 0x00000100, + RayFlagsSkipAABBsKHRMask = 0x00000200, + RayFlagsForceOpacityMicromap2StateEXTMask = 0x00000400, +}; + +enum RayQueryIntersection { + RayQueryIntersectionRayQueryCandidateIntersectionKHR = 0, + RayQueryIntersectionRayQueryCommittedIntersectionKHR = 1, + RayQueryIntersectionMax = 0x7fffffff, +}; + +enum RayQueryCommittedIntersectionType { + RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionNoneKHR = 0, + RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionTriangleKHR = 1, + RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionGeneratedKHR = 2, + RayQueryCommittedIntersectionTypeMax = 0x7fffffff, +}; + +enum RayQueryCandidateIntersectionType { + RayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionTriangleKHR = 0, + RayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionAABBKHR = 1, + RayQueryCandidateIntersectionTypeMax = 0x7fffffff, +}; + +enum FragmentShadingRateShift { + FragmentShadingRateVertical2PixelsShift = 0, + FragmentShadingRateVertical4PixelsShift = 1, + FragmentShadingRateHorizontal2PixelsShift = 2, + FragmentShadingRateHorizontal4PixelsShift = 3, + FragmentShadingRateMax = 0x7fffffff, +}; + +enum FragmentShadingRateMask { + FragmentShadingRateMaskNone = 0, + FragmentShadingRateVertical2PixelsMask = 0x00000001, + FragmentShadingRateVertical4PixelsMask = 0x00000002, + FragmentShadingRateHorizontal2PixelsMask = 0x00000004, + FragmentShadingRateHorizontal4PixelsMask = 0x00000008, +}; + +enum FPDenormMode { + FPDenormModePreserve = 0, + FPDenormModeFlushToZero = 1, + FPDenormModeMax = 0x7fffffff, +}; + +enum FPOperationMode { + FPOperationModeIEEE = 0, + FPOperationModeALT = 1, + FPOperationModeMax = 0x7fffffff, +}; + +enum QuantizationModes { + QuantizationModesTRN = 0, + QuantizationModesTRN_ZERO = 1, + QuantizationModesRND = 2, + QuantizationModesRND_ZERO = 3, + QuantizationModesRND_INF = 4, + QuantizationModesRND_MIN_INF = 5, + QuantizationModesRND_CONV = 6, + QuantizationModesRND_CONV_ODD = 7, + QuantizationModesMax = 0x7fffffff, +}; + +enum OverflowModes { + OverflowModesWRAP = 0, + OverflowModesSAT = 1, + OverflowModesSAT_ZERO = 2, + OverflowModesSAT_SYM = 3, + OverflowModesMax = 0x7fffffff, +}; + +enum PackedVectorFormat { + PackedVectorFormatPackedVectorFormat4x8Bit = 0, + PackedVectorFormatPackedVectorFormat4x8BitKHR = 0, + PackedVectorFormatMax = 0x7fffffff, +}; + +enum CooperativeMatrixOperandsShift { + CooperativeMatrixOperandsMatrixASignedComponentsKHRShift = 0, + CooperativeMatrixOperandsMatrixBSignedComponentsKHRShift = 1, + CooperativeMatrixOperandsMatrixCSignedComponentsKHRShift = 2, + CooperativeMatrixOperandsMatrixResultSignedComponentsKHRShift = 3, + CooperativeMatrixOperandsSaturatingAccumulationKHRShift = 4, + CooperativeMatrixOperandsMax = 0x7fffffff, +}; + +enum CooperativeMatrixOperandsMask { + CooperativeMatrixOperandsMaskNone = 0, + CooperativeMatrixOperandsMatrixASignedComponentsKHRMask = 0x00000001, + CooperativeMatrixOperandsMatrixBSignedComponentsKHRMask = 0x00000002, + CooperativeMatrixOperandsMatrixCSignedComponentsKHRMask = 0x00000004, + CooperativeMatrixOperandsMatrixResultSignedComponentsKHRMask = 0x00000008, + CooperativeMatrixOperandsSaturatingAccumulationKHRMask = 0x00000010, +}; + +enum CooperativeMatrixLayout { + CooperativeMatrixLayoutRowMajorKHR = 0, + CooperativeMatrixLayoutColumnMajorKHR = 1, + CooperativeMatrixLayoutRowBlockedInterleavedARM = 4202, + CooperativeMatrixLayoutColumnBlockedInterleavedARM = 4203, + CooperativeMatrixLayoutMax = 0x7fffffff, +}; + +enum CooperativeMatrixUse { + CooperativeMatrixUseMatrixAKHR = 0, + CooperativeMatrixUseMatrixBKHR = 1, + CooperativeMatrixUseMatrixAccumulatorKHR = 2, + CooperativeMatrixUseMax = 0x7fffffff, +}; + +enum CooperativeMatrixReduceShift { + CooperativeMatrixReduceRowShift = 0, + CooperativeMatrixReduceColumnShift = 1, + CooperativeMatrixReduce2x2Shift = 2, + CooperativeMatrixReduceMax = 0x7fffffff, +}; + +enum CooperativeMatrixReduceMask { + CooperativeMatrixReduceMaskNone = 0, + CooperativeMatrixReduceRowMask = 0x00000001, + CooperativeMatrixReduceColumnMask = 0x00000002, + CooperativeMatrixReduce2x2Mask = 0x00000004, +}; + +enum TensorClampMode { + TensorClampModeUndefined = 0, + TensorClampModeConstant = 1, + TensorClampModeClampToEdge = 2, + TensorClampModeRepeat = 3, + TensorClampModeRepeatMirrored = 4, + TensorClampModeMax = 0x7fffffff, +}; + +enum TensorAddressingOperandsShift { + TensorAddressingOperandsTensorViewShift = 0, + TensorAddressingOperandsDecodeFuncShift = 1, + TensorAddressingOperandsMax = 0x7fffffff, +}; + +enum TensorAddressingOperandsMask { + TensorAddressingOperandsMaskNone = 0, + TensorAddressingOperandsTensorViewMask = 0x00000001, + TensorAddressingOperandsDecodeFuncMask = 0x00000002, +}; + +enum TensorOperandsShift { + TensorOperandsNontemporalARMShift = 0, + TensorOperandsOutOfBoundsValueARMShift = 1, + TensorOperandsMakeElementAvailableARMShift = 2, + TensorOperandsMakeElementVisibleARMShift = 3, + TensorOperandsNonPrivateElementARMShift = 4, + TensorOperandsMax = 0x7fffffff, +}; + +enum TensorOperandsMask { + TensorOperandsMaskNone = 0, + TensorOperandsNontemporalARMMask = 0x00000001, + TensorOperandsOutOfBoundsValueARMMask = 0x00000002, + TensorOperandsMakeElementAvailableARMMask = 0x00000004, + TensorOperandsMakeElementVisibleARMMask = 0x00000008, + TensorOperandsNonPrivateElementARMMask = 0x00000010, +}; + +enum InitializationModeQualifier { + InitializationModeQualifierInitOnDeviceReprogramINTEL = 0, + InitializationModeQualifierInitOnDeviceResetINTEL = 1, + InitializationModeQualifierMax = 0x7fffffff, +}; + +enum HostAccessQualifier { + HostAccessQualifierNoneINTEL = 0, + HostAccessQualifierReadINTEL = 1, + HostAccessQualifierWriteINTEL = 2, + HostAccessQualifierReadWriteINTEL = 3, + HostAccessQualifierMax = 0x7fffffff, +}; + +enum LoadCacheControl { + LoadCacheControlUncachedINTEL = 0, + LoadCacheControlCachedINTEL = 1, + LoadCacheControlStreamingINTEL = 2, + LoadCacheControlInvalidateAfterReadINTEL = 3, + LoadCacheControlConstCachedINTEL = 4, + LoadCacheControlMax = 0x7fffffff, +}; + +enum StoreCacheControl { + StoreCacheControlUncachedINTEL = 0, + StoreCacheControlWriteThroughINTEL = 1, + StoreCacheControlWriteBackINTEL = 2, + StoreCacheControlStreamingINTEL = 3, + StoreCacheControlMax = 0x7fffffff, +}; + +enum NamedMaximumNumberOfRegisters { + NamedMaximumNumberOfRegistersAutoINTEL = 0, + NamedMaximumNumberOfRegistersMax = 0x7fffffff, +}; + +enum MatrixMultiplyAccumulateOperandsShift { + MatrixMultiplyAccumulateOperandsMatrixASignedComponentsINTELShift = 0, + MatrixMultiplyAccumulateOperandsMatrixBSignedComponentsINTELShift = 1, + MatrixMultiplyAccumulateOperandsMatrixCBFloat16INTELShift = 2, + MatrixMultiplyAccumulateOperandsMatrixResultBFloat16INTELShift = 3, + MatrixMultiplyAccumulateOperandsMatrixAPackedInt8INTELShift = 4, + MatrixMultiplyAccumulateOperandsMatrixBPackedInt8INTELShift = 5, + MatrixMultiplyAccumulateOperandsMatrixAPackedInt4INTELShift = 6, + MatrixMultiplyAccumulateOperandsMatrixBPackedInt4INTELShift = 7, + MatrixMultiplyAccumulateOperandsMatrixATF32INTELShift = 8, + MatrixMultiplyAccumulateOperandsMatrixBTF32INTELShift = 9, + MatrixMultiplyAccumulateOperandsMatrixAPackedFloat16INTELShift = 10, + MatrixMultiplyAccumulateOperandsMatrixBPackedFloat16INTELShift = 11, + MatrixMultiplyAccumulateOperandsMatrixAPackedBFloat16INTELShift = 12, + MatrixMultiplyAccumulateOperandsMatrixBPackedBFloat16INTELShift = 13, + MatrixMultiplyAccumulateOperandsMax = 0x7fffffff, +}; + +enum MatrixMultiplyAccumulateOperandsMask { + MatrixMultiplyAccumulateOperandsMaskNone = 0, + MatrixMultiplyAccumulateOperandsMatrixASignedComponentsINTELMask = 0x00000001, + MatrixMultiplyAccumulateOperandsMatrixBSignedComponentsINTELMask = 0x00000002, + MatrixMultiplyAccumulateOperandsMatrixCBFloat16INTELMask = 0x00000004, + MatrixMultiplyAccumulateOperandsMatrixResultBFloat16INTELMask = 0x00000008, + MatrixMultiplyAccumulateOperandsMatrixAPackedInt8INTELMask = 0x00000010, + MatrixMultiplyAccumulateOperandsMatrixBPackedInt8INTELMask = 0x00000020, + MatrixMultiplyAccumulateOperandsMatrixAPackedInt4INTELMask = 0x00000040, + MatrixMultiplyAccumulateOperandsMatrixBPackedInt4INTELMask = 0x00000080, + MatrixMultiplyAccumulateOperandsMatrixATF32INTELMask = 0x00000100, + MatrixMultiplyAccumulateOperandsMatrixBTF32INTELMask = 0x00000200, + MatrixMultiplyAccumulateOperandsMatrixAPackedFloat16INTELMask = 0x00000400, + MatrixMultiplyAccumulateOperandsMatrixBPackedFloat16INTELMask = 0x00000800, + MatrixMultiplyAccumulateOperandsMatrixAPackedBFloat16INTELMask = 0x00001000, + MatrixMultiplyAccumulateOperandsMatrixBPackedBFloat16INTELMask = 0x00002000, +}; + +enum RawAccessChainOperandsShift { + RawAccessChainOperandsRobustnessPerComponentNVShift = 0, + RawAccessChainOperandsRobustnessPerElementNVShift = 1, + RawAccessChainOperandsMax = 0x7fffffff, +}; + +enum RawAccessChainOperandsMask { + RawAccessChainOperandsMaskNone = 0, + RawAccessChainOperandsRobustnessPerComponentNVMask = 0x00000001, + RawAccessChainOperandsRobustnessPerElementNVMask = 0x00000002, +}; + +enum FPEncoding { + FPEncodingBFloat16KHR = 0, + FPEncodingFloat8E4M3EXT = 4214, + FPEncodingFloat8E5M2EXT = 4215, + FPEncodingMax = 0x7fffffff, +}; + +enum CooperativeVectorMatrixLayout { + CooperativeVectorMatrixLayoutRowMajorNV = 0, + CooperativeVectorMatrixLayoutColumnMajorNV = 1, + CooperativeVectorMatrixLayoutInferencingOptimalNV = 2, + CooperativeVectorMatrixLayoutTrainingOptimalNV = 3, + CooperativeVectorMatrixLayoutMax = 0x7fffffff, +}; + +enum ComponentType { + ComponentTypeFloat16NV = 0, + ComponentTypeFloat32NV = 1, + ComponentTypeFloat64NV = 2, + ComponentTypeSignedInt8NV = 3, + ComponentTypeSignedInt16NV = 4, + ComponentTypeSignedInt32NV = 5, + ComponentTypeSignedInt64NV = 6, + ComponentTypeUnsignedInt8NV = 7, + ComponentTypeUnsignedInt16NV = 8, + ComponentTypeUnsignedInt32NV = 9, + ComponentTypeUnsignedInt64NV = 10, + ComponentTypeSignedInt8PackedNV = 1000491000, + ComponentTypeUnsignedInt8PackedNV = 1000491001, + ComponentTypeFloatE4M3NV = 1000491002, + ComponentTypeFloatE5M2NV = 1000491003, + ComponentTypeMax = 0x7fffffff, +}; + +enum Op { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpExecutionModeId = 331, + OpDecorateId = 332, + OpGroupNonUniformElect = 333, + OpGroupNonUniformAll = 334, + OpGroupNonUniformAny = 335, + OpGroupNonUniformAllEqual = 336, + OpGroupNonUniformBroadcast = 337, + OpGroupNonUniformBroadcastFirst = 338, + OpGroupNonUniformBallot = 339, + OpGroupNonUniformInverseBallot = 340, + OpGroupNonUniformBallotBitExtract = 341, + OpGroupNonUniformBallotBitCount = 342, + OpGroupNonUniformBallotFindLSB = 343, + OpGroupNonUniformBallotFindMSB = 344, + OpGroupNonUniformShuffle = 345, + OpGroupNonUniformShuffleXor = 346, + OpGroupNonUniformShuffleUp = 347, + OpGroupNonUniformShuffleDown = 348, + OpGroupNonUniformIAdd = 349, + OpGroupNonUniformFAdd = 350, + OpGroupNonUniformIMul = 351, + OpGroupNonUniformFMul = 352, + OpGroupNonUniformSMin = 353, + OpGroupNonUniformUMin = 354, + OpGroupNonUniformFMin = 355, + OpGroupNonUniformSMax = 356, + OpGroupNonUniformUMax = 357, + OpGroupNonUniformFMax = 358, + OpGroupNonUniformBitwiseAnd = 359, + OpGroupNonUniformBitwiseOr = 360, + OpGroupNonUniformBitwiseXor = 361, + OpGroupNonUniformLogicalAnd = 362, + OpGroupNonUniformLogicalOr = 363, + OpGroupNonUniformLogicalXor = 364, + OpGroupNonUniformQuadBroadcast = 365, + OpGroupNonUniformQuadSwap = 366, + OpCopyLogical = 400, + OpPtrEqual = 401, + OpPtrNotEqual = 402, + OpPtrDiff = 403, + OpColorAttachmentReadEXT = 4160, + OpDepthAttachmentReadEXT = 4161, + OpStencilAttachmentReadEXT = 4162, + OpTypeTensorARM = 4163, + OpTensorReadARM = 4164, + OpTensorWriteARM = 4165, + OpTensorQuerySizeARM = 4166, + OpGraphConstantARM = 4181, + OpGraphEntryPointARM = 4182, + OpGraphARM = 4183, + OpGraphInputARM = 4184, + OpGraphSetOutputARM = 4185, + OpGraphEndARM = 4186, + OpTypeGraphARM = 4190, + OpTerminateInvocation = 4416, + OpTypeUntypedPointerKHR = 4417, + OpUntypedVariableKHR = 4418, + OpUntypedAccessChainKHR = 4419, + OpUntypedInBoundsAccessChainKHR = 4420, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpUntypedPtrAccessChainKHR = 4423, + OpUntypedInBoundsPtrAccessChainKHR = 4424, + OpUntypedArrayLengthKHR = 4425, + OpUntypedPrefetchKHR = 4426, + OpFmaKHR = 4427, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpGroupNonUniformRotateKHR = 4431, + OpSubgroupReadInvocationKHR = 4432, + OpExtInstWithForwardRefsKHR = 4433, + OpUntypedGroupAsyncCopyKHR = 4434, + OpTraceRayKHR = 4445, + OpExecuteCallableKHR = 4446, + OpConvertUToAccelerationStructureKHR = 4447, + OpIgnoreIntersectionKHR = 4448, + OpTerminateRayKHR = 4449, + OpSDot = 4450, + OpSDotKHR = 4450, + OpUDot = 4451, + OpUDotKHR = 4451, + OpSUDot = 4452, + OpSUDotKHR = 4452, + OpSDotAccSat = 4453, + OpSDotAccSatKHR = 4453, + OpUDotAccSat = 4454, + OpUDotAccSatKHR = 4454, + OpSUDotAccSat = 4455, + OpSUDotAccSatKHR = 4455, + OpTypeCooperativeMatrixKHR = 4456, + OpCooperativeMatrixLoadKHR = 4457, + OpCooperativeMatrixStoreKHR = 4458, + OpCooperativeMatrixMulAddKHR = 4459, + OpCooperativeMatrixLengthKHR = 4460, + OpConstantCompositeReplicateEXT = 4461, + OpSpecConstantCompositeReplicateEXT = 4462, + OpCompositeConstructReplicateEXT = 4463, + OpTypeRayQueryKHR = 4472, + OpRayQueryInitializeKHR = 4473, + OpRayQueryTerminateKHR = 4474, + OpRayQueryGenerateIntersectionKHR = 4475, + OpRayQueryConfirmIntersectionKHR = 4476, + OpRayQueryProceedKHR = 4477, + OpRayQueryGetIntersectionTypeKHR = 4479, + OpImageSampleWeightedQCOM = 4480, + OpImageBoxFilterQCOM = 4481, + OpImageBlockMatchSSDQCOM = 4482, + OpImageBlockMatchSADQCOM = 4483, + OpBitCastArrayQCOM = 4497, + OpImageBlockMatchWindowSSDQCOM = 4500, + OpImageBlockMatchWindowSADQCOM = 4501, + OpImageBlockMatchGatherSSDQCOM = 4502, + OpImageBlockMatchGatherSADQCOM = 4503, + OpCompositeConstructCoopMatQCOM = 4540, + OpCompositeExtractCoopMatQCOM = 4541, + OpExtractSubArrayQCOM = 4542, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpReadClockKHR = 5056, + OpAllocateNodePayloadsAMDX = 5074, + OpEnqueueNodePayloadsAMDX = 5075, + OpTypeNodePayloadArrayAMDX = 5076, + OpFinishWritingNodePayloadAMDX = 5078, + OpNodePayloadArrayLengthAMDX = 5090, + OpIsNodePayloadValidAMDX = 5101, + OpConstantStringAMDX = 5103, + OpSpecConstantStringAMDX = 5104, + OpGroupNonUniformQuadAllKHR = 5110, + OpGroupNonUniformQuadAnyKHR = 5111, + OpHitObjectRecordHitMotionNV = 5249, + OpHitObjectRecordHitWithIndexMotionNV = 5250, + OpHitObjectRecordMissMotionNV = 5251, + OpHitObjectGetWorldToObjectNV = 5252, + OpHitObjectGetObjectToWorldNV = 5253, + OpHitObjectGetObjectRayDirectionNV = 5254, + OpHitObjectGetObjectRayOriginNV = 5255, + OpHitObjectTraceRayMotionNV = 5256, + OpHitObjectGetShaderRecordBufferHandleNV = 5257, + OpHitObjectGetShaderBindingTableRecordIndexNV = 5258, + OpHitObjectRecordEmptyNV = 5259, + OpHitObjectTraceRayNV = 5260, + OpHitObjectRecordHitNV = 5261, + OpHitObjectRecordHitWithIndexNV = 5262, + OpHitObjectRecordMissNV = 5263, + OpHitObjectExecuteShaderNV = 5264, + OpHitObjectGetCurrentTimeNV = 5265, + OpHitObjectGetAttributesNV = 5266, + OpHitObjectGetHitKindNV = 5267, + OpHitObjectGetPrimitiveIndexNV = 5268, + OpHitObjectGetGeometryIndexNV = 5269, + OpHitObjectGetInstanceIdNV = 5270, + OpHitObjectGetInstanceCustomIndexNV = 5271, + OpHitObjectGetWorldRayDirectionNV = 5272, + OpHitObjectGetWorldRayOriginNV = 5273, + OpHitObjectGetRayTMaxNV = 5274, + OpHitObjectGetRayTMinNV = 5275, + OpHitObjectIsEmptyNV = 5276, + OpHitObjectIsHitNV = 5277, + OpHitObjectIsMissNV = 5278, + OpReorderThreadWithHitObjectNV = 5279, + OpReorderThreadWithHintNV = 5280, + OpTypeHitObjectNV = 5281, + OpImageSampleFootprintNV = 5283, + OpTypeCooperativeVectorNV = 5288, + OpCooperativeVectorMatrixMulNV = 5289, + OpCooperativeVectorOuterProductAccumulateNV = 5290, + OpCooperativeVectorReduceSumAccumulateNV = 5291, + OpCooperativeVectorMatrixMulAddNV = 5292, + OpCooperativeMatrixConvertNV = 5293, + OpEmitMeshTasksEXT = 5294, + OpSetMeshOutputsEXT = 5295, + OpGroupNonUniformPartitionNV = 5296, + OpWritePackedPrimitiveIndices4x8NV = 5299, + OpFetchMicroTriangleVertexPositionNV = 5300, + OpFetchMicroTriangleVertexBarycentricNV = 5301, + OpCooperativeVectorLoadNV = 5302, + OpCooperativeVectorStoreNV = 5303, + OpReportIntersectionKHR = 5334, + OpReportIntersectionNV = 5334, + OpIgnoreIntersectionNV = 5335, + OpTerminateRayNV = 5336, + OpTraceNV = 5337, + OpTraceMotionNV = 5338, + OpTraceRayMotionNV = 5339, + OpRayQueryGetIntersectionTriangleVertexPositionsKHR = 5340, + OpTypeAccelerationStructureKHR = 5341, + OpTypeAccelerationStructureNV = 5341, + OpExecuteCallableNV = 5344, + OpRayQueryGetClusterIdNV = 5345, + OpRayQueryGetIntersectionClusterIdNV = 5345, + OpHitObjectGetClusterIdNV = 5346, + OpTypeCooperativeMatrixNV = 5358, + OpCooperativeMatrixLoadNV = 5359, + OpCooperativeMatrixStoreNV = 5360, + OpCooperativeMatrixMulAddNV = 5361, + OpCooperativeMatrixLengthNV = 5362, + OpBeginInvocationInterlockEXT = 5364, + OpEndInvocationInterlockEXT = 5365, + OpCooperativeMatrixReduceNV = 5366, + OpCooperativeMatrixLoadTensorNV = 5367, + OpCooperativeMatrixStoreTensorNV = 5368, + OpCooperativeMatrixPerElementOpNV = 5369, + OpTypeTensorLayoutNV = 5370, + OpTypeTensorViewNV = 5371, + OpCreateTensorLayoutNV = 5372, + OpTensorLayoutSetDimensionNV = 5373, + OpTensorLayoutSetStrideNV = 5374, + OpTensorLayoutSliceNV = 5375, + OpTensorLayoutSetClampValueNV = 5376, + OpCreateTensorViewNV = 5377, + OpTensorViewSetDimensionNV = 5378, + OpTensorViewSetStrideNV = 5379, + OpDemoteToHelperInvocation = 5380, + OpDemoteToHelperInvocationEXT = 5380, + OpIsHelperInvocationEXT = 5381, + OpTensorViewSetClipNV = 5382, + OpTensorLayoutSetBlockSizeNV = 5384, + OpCooperativeMatrixTransposeNV = 5390, + OpConvertUToImageNV = 5391, + OpConvertUToSamplerNV = 5392, + OpConvertImageToUNV = 5393, + OpConvertSamplerToUNV = 5394, + OpConvertUToSampledImageNV = 5395, + OpConvertSampledImageToUNV = 5396, + OpSamplerImageAddressingModeNV = 5397, + OpRawAccessChainNV = 5398, + OpRayQueryGetIntersectionSpherePositionNV = 5427, + OpRayQueryGetIntersectionSphereRadiusNV = 5428, + OpRayQueryGetIntersectionLSSPositionsNV = 5429, + OpRayQueryGetIntersectionLSSRadiiNV = 5430, + OpRayQueryGetIntersectionLSSHitValueNV = 5431, + OpHitObjectGetSpherePositionNV = 5432, + OpHitObjectGetSphereRadiusNV = 5433, + OpHitObjectGetLSSPositionsNV = 5434, + OpHitObjectGetLSSRadiiNV = 5435, + OpHitObjectIsSphereHitNV = 5436, + OpHitObjectIsLSSHitNV = 5437, + OpRayQueryIsSphereHitNV = 5438, + OpRayQueryIsLSSHitNV = 5439, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpSubgroupImageMediaBlockReadINTEL = 5580, + OpSubgroupImageMediaBlockWriteINTEL = 5581, + OpUCountLeadingZerosINTEL = 5585, + OpUCountTrailingZerosINTEL = 5586, + OpAbsISubINTEL = 5587, + OpAbsUSubINTEL = 5588, + OpIAddSatINTEL = 5589, + OpUAddSatINTEL = 5590, + OpIAverageINTEL = 5591, + OpUAverageINTEL = 5592, + OpIAverageRoundedINTEL = 5593, + OpUAverageRoundedINTEL = 5594, + OpISubSatINTEL = 5595, + OpUSubSatINTEL = 5596, + OpIMul32x16INTEL = 5597, + OpUMul32x16INTEL = 5598, + OpConstantFunctionPointerINTEL = 5600, + OpFunctionPointerCallINTEL = 5601, + OpAsmTargetINTEL = 5609, + OpAsmINTEL = 5610, + OpAsmCallINTEL = 5611, + OpAtomicFMinEXT = 5614, + OpAtomicFMaxEXT = 5615, + OpAssumeTrueKHR = 5630, + OpExpectKHR = 5631, + OpDecorateString = 5632, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateString = 5633, + OpMemberDecorateStringGOOGLE = 5633, + OpVmeImageINTEL = 5699, + OpTypeVmeImageINTEL = 5700, + OpTypeAvcImePayloadINTEL = 5701, + OpTypeAvcRefPayloadINTEL = 5702, + OpTypeAvcSicPayloadINTEL = 5703, + OpTypeAvcMcePayloadINTEL = 5704, + OpTypeAvcMceResultINTEL = 5705, + OpTypeAvcImeResultINTEL = 5706, + OpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707, + OpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708, + OpTypeAvcImeSingleReferenceStreaminINTEL = 5709, + OpTypeAvcImeDualReferenceStreaminINTEL = 5710, + OpTypeAvcRefResultINTEL = 5711, + OpTypeAvcSicResultINTEL = 5712, + OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713, + OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714, + OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715, + OpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716, + OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717, + OpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718, + OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719, + OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720, + OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721, + OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722, + OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723, + OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724, + OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725, + OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726, + OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727, + OpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728, + OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729, + OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730, + OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731, + OpSubgroupAvcMceConvertToImePayloadINTEL = 5732, + OpSubgroupAvcMceConvertToImeResultINTEL = 5733, + OpSubgroupAvcMceConvertToRefPayloadINTEL = 5734, + OpSubgroupAvcMceConvertToRefResultINTEL = 5735, + OpSubgroupAvcMceConvertToSicPayloadINTEL = 5736, + OpSubgroupAvcMceConvertToSicResultINTEL = 5737, + OpSubgroupAvcMceGetMotionVectorsINTEL = 5738, + OpSubgroupAvcMceGetInterDistortionsINTEL = 5739, + OpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740, + OpSubgroupAvcMceGetInterMajorShapeINTEL = 5741, + OpSubgroupAvcMceGetInterMinorShapeINTEL = 5742, + OpSubgroupAvcMceGetInterDirectionsINTEL = 5743, + OpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744, + OpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745, + OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746, + OpSubgroupAvcImeInitializeINTEL = 5747, + OpSubgroupAvcImeSetSingleReferenceINTEL = 5748, + OpSubgroupAvcImeSetDualReferenceINTEL = 5749, + OpSubgroupAvcImeRefWindowSizeINTEL = 5750, + OpSubgroupAvcImeAdjustRefOffsetINTEL = 5751, + OpSubgroupAvcImeConvertToMcePayloadINTEL = 5752, + OpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753, + OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754, + OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755, + OpSubgroupAvcImeSetWeightedSadINTEL = 5756, + OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757, + OpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758, + OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759, + OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760, + OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761, + OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762, + OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763, + OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764, + OpSubgroupAvcImeConvertToMceResultINTEL = 5765, + OpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766, + OpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767, + OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768, + OpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769, + OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770, + OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771, + OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772, + OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773, + OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774, + OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775, + OpSubgroupAvcImeGetBorderReachedINTEL = 5776, + OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777, + OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778, + OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779, + OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780, + OpSubgroupAvcFmeInitializeINTEL = 5781, + OpSubgroupAvcBmeInitializeINTEL = 5782, + OpSubgroupAvcRefConvertToMcePayloadINTEL = 5783, + OpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784, + OpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785, + OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786, + OpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787, + OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788, + OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789, + OpSubgroupAvcRefConvertToMceResultINTEL = 5790, + OpSubgroupAvcSicInitializeINTEL = 5791, + OpSubgroupAvcSicConfigureSkcINTEL = 5792, + OpSubgroupAvcSicConfigureIpeLumaINTEL = 5793, + OpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794, + OpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795, + OpSubgroupAvcSicConvertToMcePayloadINTEL = 5796, + OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797, + OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798, + OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799, + OpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800, + OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801, + OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802, + OpSubgroupAvcSicEvaluateIpeINTEL = 5803, + OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804, + OpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805, + OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806, + OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807, + OpSubgroupAvcSicConvertToMceResultINTEL = 5808, + OpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809, + OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810, + OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811, + OpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812, + OpSubgroupAvcSicGetIpeChromaModeINTEL = 5813, + OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814, + OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815, + OpSubgroupAvcSicGetInterRawSadsINTEL = 5816, + OpVariableLengthArrayINTEL = 5818, + OpSaveMemoryINTEL = 5819, + OpRestoreMemoryINTEL = 5820, + OpArbitraryFloatSinCosPiINTEL = 5840, + OpArbitraryFloatCastINTEL = 5841, + OpArbitraryFloatCastFromIntINTEL = 5842, + OpArbitraryFloatCastToIntINTEL = 5843, + OpArbitraryFloatAddINTEL = 5846, + OpArbitraryFloatSubINTEL = 5847, + OpArbitraryFloatMulINTEL = 5848, + OpArbitraryFloatDivINTEL = 5849, + OpArbitraryFloatGTINTEL = 5850, + OpArbitraryFloatGEINTEL = 5851, + OpArbitraryFloatLTINTEL = 5852, + OpArbitraryFloatLEINTEL = 5853, + OpArbitraryFloatEQINTEL = 5854, + OpArbitraryFloatRecipINTEL = 5855, + OpArbitraryFloatRSqrtINTEL = 5856, + OpArbitraryFloatCbrtINTEL = 5857, + OpArbitraryFloatHypotINTEL = 5858, + OpArbitraryFloatSqrtINTEL = 5859, + OpArbitraryFloatLogINTEL = 5860, + OpArbitraryFloatLog2INTEL = 5861, + OpArbitraryFloatLog10INTEL = 5862, + OpArbitraryFloatLog1pINTEL = 5863, + OpArbitraryFloatExpINTEL = 5864, + OpArbitraryFloatExp2INTEL = 5865, + OpArbitraryFloatExp10INTEL = 5866, + OpArbitraryFloatExpm1INTEL = 5867, + OpArbitraryFloatSinINTEL = 5868, + OpArbitraryFloatCosINTEL = 5869, + OpArbitraryFloatSinCosINTEL = 5870, + OpArbitraryFloatSinPiINTEL = 5871, + OpArbitraryFloatCosPiINTEL = 5872, + OpArbitraryFloatASinINTEL = 5873, + OpArbitraryFloatASinPiINTEL = 5874, + OpArbitraryFloatACosINTEL = 5875, + OpArbitraryFloatACosPiINTEL = 5876, + OpArbitraryFloatATanINTEL = 5877, + OpArbitraryFloatATanPiINTEL = 5878, + OpArbitraryFloatATan2INTEL = 5879, + OpArbitraryFloatPowINTEL = 5880, + OpArbitraryFloatPowRINTEL = 5881, + OpArbitraryFloatPowNINTEL = 5882, + OpLoopControlINTEL = 5887, + OpAliasDomainDeclINTEL = 5911, + OpAliasScopeDeclINTEL = 5912, + OpAliasScopeListDeclINTEL = 5913, + OpFixedSqrtINTEL = 5923, + OpFixedRecipINTEL = 5924, + OpFixedRsqrtINTEL = 5925, + OpFixedSinINTEL = 5926, + OpFixedCosINTEL = 5927, + OpFixedSinCosINTEL = 5928, + OpFixedSinPiINTEL = 5929, + OpFixedCosPiINTEL = 5930, + OpFixedSinCosPiINTEL = 5931, + OpFixedLogINTEL = 5932, + OpFixedExpINTEL = 5933, + OpPtrCastToCrossWorkgroupINTEL = 5934, + OpCrossWorkgroupCastToPtrINTEL = 5938, + OpReadPipeBlockingINTEL = 5946, + OpWritePipeBlockingINTEL = 5947, + OpFPGARegINTEL = 5949, + OpRayQueryGetRayTMinKHR = 6016, + OpRayQueryGetRayFlagsKHR = 6017, + OpRayQueryGetIntersectionTKHR = 6018, + OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019, + OpRayQueryGetIntersectionInstanceIdKHR = 6020, + OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021, + OpRayQueryGetIntersectionGeometryIndexKHR = 6022, + OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023, + OpRayQueryGetIntersectionBarycentricsKHR = 6024, + OpRayQueryGetIntersectionFrontFaceKHR = 6025, + OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026, + OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027, + OpRayQueryGetIntersectionObjectRayOriginKHR = 6028, + OpRayQueryGetWorldRayDirectionKHR = 6029, + OpRayQueryGetWorldRayOriginKHR = 6030, + OpRayQueryGetIntersectionObjectToWorldKHR = 6031, + OpRayQueryGetIntersectionWorldToObjectKHR = 6032, + OpAtomicFAddEXT = 6035, + OpTypeBufferSurfaceINTEL = 6086, + OpTypeStructContinuedINTEL = 6090, + OpConstantCompositeContinuedINTEL = 6091, + OpSpecConstantCompositeContinuedINTEL = 6092, + OpCompositeConstructContinuedINTEL = 6096, + OpConvertFToBF16INTEL = 6116, + OpConvertBF16ToFINTEL = 6117, + OpControlBarrierArriveINTEL = 6142, + OpControlBarrierWaitINTEL = 6143, + OpArithmeticFenceEXT = 6145, + OpTaskSequenceCreateINTEL = 6163, + OpTaskSequenceAsyncINTEL = 6164, + OpTaskSequenceGetINTEL = 6165, + OpTaskSequenceReleaseINTEL = 6166, + OpTypeTaskSequenceINTEL = 6199, + OpSubgroupBlockPrefetchINTEL = 6221, + OpSubgroup2DBlockLoadINTEL = 6231, + OpSubgroup2DBlockLoadTransformINTEL = 6232, + OpSubgroup2DBlockLoadTransposeINTEL = 6233, + OpSubgroup2DBlockPrefetchINTEL = 6234, + OpSubgroup2DBlockStoreINTEL = 6235, + OpSubgroupMatrixMultiplyAccumulateINTEL = 6237, + OpBitwiseFunctionINTEL = 6242, + OpUntypedVariableLengthArrayINTEL = 6244, + OpConditionalExtensionINTEL = 6248, + OpConditionalEntryPointINTEL = 6249, + OpConditionalCapabilityINTEL = 6250, + OpSpecConstantTargetINTEL = 6251, + OpSpecConstantArchitectureINTEL = 6252, + OpSpecConstantCapabilitiesINTEL = 6253, + OpConditionalCopyObjectINTEL = 6254, + OpGroupIMulKHR = 6401, + OpGroupFMulKHR = 6402, + OpGroupBitwiseAndKHR = 6403, + OpGroupBitwiseOrKHR = 6404, + OpGroupBitwiseXorKHR = 6405, + OpGroupLogicalAndKHR = 6406, + OpGroupLogicalOrKHR = 6407, + OpGroupLogicalXorKHR = 6408, + OpRoundFToTF32INTEL = 6426, + OpMaskedGatherINTEL = 6428, + OpMaskedScatterINTEL = 6429, + OpConvertHandleToImageINTEL = 6529, + OpConvertHandleToSamplerINTEL = 6530, + OpConvertHandleToSampledImageINTEL = 6531, + OpMax = 0x7fffffff, +}; + +#ifdef SPV_ENABLE_UTILITY_CODE +#ifndef __cplusplus +#include +#endif +inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { + *hasResult = *hasResultType = false; + switch (opcode) { + default: /* unknown opcode */ break; + case OpNop: *hasResult = false; *hasResultType = false; break; + case OpUndef: *hasResult = true; *hasResultType = true; break; + case OpSourceContinued: *hasResult = false; *hasResultType = false; break; + case OpSource: *hasResult = false; *hasResultType = false; break; + case OpSourceExtension: *hasResult = false; *hasResultType = false; break; + case OpName: *hasResult = false; *hasResultType = false; break; + case OpMemberName: *hasResult = false; *hasResultType = false; break; + case OpString: *hasResult = true; *hasResultType = false; break; + case OpLine: *hasResult = false; *hasResultType = false; break; + case OpExtension: *hasResult = false; *hasResultType = false; break; + case OpExtInstImport: *hasResult = true; *hasResultType = false; break; + case OpExtInst: *hasResult = true; *hasResultType = true; break; + case OpMemoryModel: *hasResult = false; *hasResultType = false; break; + case OpEntryPoint: *hasResult = false; *hasResultType = false; break; + case OpExecutionMode: *hasResult = false; *hasResultType = false; break; + case OpCapability: *hasResult = false; *hasResultType = false; break; + case OpTypeVoid: *hasResult = true; *hasResultType = false; break; + case OpTypeBool: *hasResult = true; *hasResultType = false; break; + case OpTypeInt: *hasResult = true; *hasResultType = false; break; + case OpTypeFloat: *hasResult = true; *hasResultType = false; break; + case OpTypeVector: *hasResult = true; *hasResultType = false; break; + case OpTypeMatrix: *hasResult = true; *hasResultType = false; break; + case OpTypeImage: *hasResult = true; *hasResultType = false; break; + case OpTypeSampler: *hasResult = true; *hasResultType = false; break; + case OpTypeSampledImage: *hasResult = true; *hasResultType = false; break; + case OpTypeArray: *hasResult = true; *hasResultType = false; break; + case OpTypeRuntimeArray: *hasResult = true; *hasResultType = false; break; + case OpTypeStruct: *hasResult = true; *hasResultType = false; break; + case OpTypeOpaque: *hasResult = true; *hasResultType = false; break; + case OpTypePointer: *hasResult = true; *hasResultType = false; break; + case OpTypeFunction: *hasResult = true; *hasResultType = false; break; + case OpTypeEvent: *hasResult = true; *hasResultType = false; break; + case OpTypeDeviceEvent: *hasResult = true; *hasResultType = false; break; + case OpTypeReserveId: *hasResult = true; *hasResultType = false; break; + case OpTypeQueue: *hasResult = true; *hasResultType = false; break; + case OpTypePipe: *hasResult = true; *hasResultType = false; break; + case OpTypeForwardPointer: *hasResult = false; *hasResultType = false; break; + case OpConstantTrue: *hasResult = true; *hasResultType = true; break; + case OpConstantFalse: *hasResult = true; *hasResultType = true; break; + case OpConstant: *hasResult = true; *hasResultType = true; break; + case OpConstantComposite: *hasResult = true; *hasResultType = true; break; + case OpConstantSampler: *hasResult = true; *hasResultType = true; break; + case OpConstantNull: *hasResult = true; *hasResultType = true; break; + case OpSpecConstantTrue: *hasResult = true; *hasResultType = true; break; + case OpSpecConstantFalse: *hasResult = true; *hasResultType = true; break; + case OpSpecConstant: *hasResult = true; *hasResultType = true; break; + case OpSpecConstantComposite: *hasResult = true; *hasResultType = true; break; + case OpSpecConstantOp: *hasResult = true; *hasResultType = true; break; + case OpFunction: *hasResult = true; *hasResultType = true; break; + case OpFunctionParameter: *hasResult = true; *hasResultType = true; break; + case OpFunctionEnd: *hasResult = false; *hasResultType = false; break; + case OpFunctionCall: *hasResult = true; *hasResultType = true; break; + case OpVariable: *hasResult = true; *hasResultType = true; break; + case OpImageTexelPointer: *hasResult = true; *hasResultType = true; break; + case OpLoad: *hasResult = true; *hasResultType = true; break; + case OpStore: *hasResult = false; *hasResultType = false; break; + case OpCopyMemory: *hasResult = false; *hasResultType = false; break; + case OpCopyMemorySized: *hasResult = false; *hasResultType = false; break; + case OpAccessChain: *hasResult = true; *hasResultType = true; break; + case OpInBoundsAccessChain: *hasResult = true; *hasResultType = true; break; + case OpPtrAccessChain: *hasResult = true; *hasResultType = true; break; + case OpArrayLength: *hasResult = true; *hasResultType = true; break; + case OpGenericPtrMemSemantics: *hasResult = true; *hasResultType = true; break; + case OpInBoundsPtrAccessChain: *hasResult = true; *hasResultType = true; break; + case OpDecorate: *hasResult = false; *hasResultType = false; break; + case OpMemberDecorate: *hasResult = false; *hasResultType = false; break; + case OpDecorationGroup: *hasResult = true; *hasResultType = false; break; + case OpGroupDecorate: *hasResult = false; *hasResultType = false; break; + case OpGroupMemberDecorate: *hasResult = false; *hasResultType = false; break; + case OpVectorExtractDynamic: *hasResult = true; *hasResultType = true; break; + case OpVectorInsertDynamic: *hasResult = true; *hasResultType = true; break; + case OpVectorShuffle: *hasResult = true; *hasResultType = true; break; + case OpCompositeConstruct: *hasResult = true; *hasResultType = true; break; + case OpCompositeExtract: *hasResult = true; *hasResultType = true; break; + case OpCompositeInsert: *hasResult = true; *hasResultType = true; break; + case OpCopyObject: *hasResult = true; *hasResultType = true; break; + case OpTranspose: *hasResult = true; *hasResultType = true; break; + case OpSampledImage: *hasResult = true; *hasResultType = true; break; + case OpImageSampleImplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSampleExplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageFetch: *hasResult = true; *hasResultType = true; break; + case OpImageGather: *hasResult = true; *hasResultType = true; break; + case OpImageDrefGather: *hasResult = true; *hasResultType = true; break; + case OpImageRead: *hasResult = true; *hasResultType = true; break; + case OpImageWrite: *hasResult = false; *hasResultType = false; break; + case OpImage: *hasResult = true; *hasResultType = true; break; + case OpImageQueryFormat: *hasResult = true; *hasResultType = true; break; + case OpImageQueryOrder: *hasResult = true; *hasResultType = true; break; + case OpImageQuerySizeLod: *hasResult = true; *hasResultType = true; break; + case OpImageQuerySize: *hasResult = true; *hasResultType = true; break; + case OpImageQueryLod: *hasResult = true; *hasResultType = true; break; + case OpImageQueryLevels: *hasResult = true; *hasResultType = true; break; + case OpImageQuerySamples: *hasResult = true; *hasResultType = true; break; + case OpConvertFToU: *hasResult = true; *hasResultType = true; break; + case OpConvertFToS: *hasResult = true; *hasResultType = true; break; + case OpConvertSToF: *hasResult = true; *hasResultType = true; break; + case OpConvertUToF: *hasResult = true; *hasResultType = true; break; + case OpUConvert: *hasResult = true; *hasResultType = true; break; + case OpSConvert: *hasResult = true; *hasResultType = true; break; + case OpFConvert: *hasResult = true; *hasResultType = true; break; + case OpQuantizeToF16: *hasResult = true; *hasResultType = true; break; + case OpConvertPtrToU: *hasResult = true; *hasResultType = true; break; + case OpSatConvertSToU: *hasResult = true; *hasResultType = true; break; + case OpSatConvertUToS: *hasResult = true; *hasResultType = true; break; + case OpConvertUToPtr: *hasResult = true; *hasResultType = true; break; + case OpPtrCastToGeneric: *hasResult = true; *hasResultType = true; break; + case OpGenericCastToPtr: *hasResult = true; *hasResultType = true; break; + case OpGenericCastToPtrExplicit: *hasResult = true; *hasResultType = true; break; + case OpBitcast: *hasResult = true; *hasResultType = true; break; + case OpSNegate: *hasResult = true; *hasResultType = true; break; + case OpFNegate: *hasResult = true; *hasResultType = true; break; + case OpIAdd: *hasResult = true; *hasResultType = true; break; + case OpFAdd: *hasResult = true; *hasResultType = true; break; + case OpISub: *hasResult = true; *hasResultType = true; break; + case OpFSub: *hasResult = true; *hasResultType = true; break; + case OpIMul: *hasResult = true; *hasResultType = true; break; + case OpFMul: *hasResult = true; *hasResultType = true; break; + case OpUDiv: *hasResult = true; *hasResultType = true; break; + case OpSDiv: *hasResult = true; *hasResultType = true; break; + case OpFDiv: *hasResult = true; *hasResultType = true; break; + case OpUMod: *hasResult = true; *hasResultType = true; break; + case OpSRem: *hasResult = true; *hasResultType = true; break; + case OpSMod: *hasResult = true; *hasResultType = true; break; + case OpFRem: *hasResult = true; *hasResultType = true; break; + case OpFMod: *hasResult = true; *hasResultType = true; break; + case OpVectorTimesScalar: *hasResult = true; *hasResultType = true; break; + case OpMatrixTimesScalar: *hasResult = true; *hasResultType = true; break; + case OpVectorTimesMatrix: *hasResult = true; *hasResultType = true; break; + case OpMatrixTimesVector: *hasResult = true; *hasResultType = true; break; + case OpMatrixTimesMatrix: *hasResult = true; *hasResultType = true; break; + case OpOuterProduct: *hasResult = true; *hasResultType = true; break; + case OpDot: *hasResult = true; *hasResultType = true; break; + case OpIAddCarry: *hasResult = true; *hasResultType = true; break; + case OpISubBorrow: *hasResult = true; *hasResultType = true; break; + case OpUMulExtended: *hasResult = true; *hasResultType = true; break; + case OpSMulExtended: *hasResult = true; *hasResultType = true; break; + case OpAny: *hasResult = true; *hasResultType = true; break; + case OpAll: *hasResult = true; *hasResultType = true; break; + case OpIsNan: *hasResult = true; *hasResultType = true; break; + case OpIsInf: *hasResult = true; *hasResultType = true; break; + case OpIsFinite: *hasResult = true; *hasResultType = true; break; + case OpIsNormal: *hasResult = true; *hasResultType = true; break; + case OpSignBitSet: *hasResult = true; *hasResultType = true; break; + case OpLessOrGreater: *hasResult = true; *hasResultType = true; break; + case OpOrdered: *hasResult = true; *hasResultType = true; break; + case OpUnordered: *hasResult = true; *hasResultType = true; break; + case OpLogicalEqual: *hasResult = true; *hasResultType = true; break; + case OpLogicalNotEqual: *hasResult = true; *hasResultType = true; break; + case OpLogicalOr: *hasResult = true; *hasResultType = true; break; + case OpLogicalAnd: *hasResult = true; *hasResultType = true; break; + case OpLogicalNot: *hasResult = true; *hasResultType = true; break; + case OpSelect: *hasResult = true; *hasResultType = true; break; + case OpIEqual: *hasResult = true; *hasResultType = true; break; + case OpINotEqual: *hasResult = true; *hasResultType = true; break; + case OpUGreaterThan: *hasResult = true; *hasResultType = true; break; + case OpSGreaterThan: *hasResult = true; *hasResultType = true; break; + case OpUGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case OpSGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case OpULessThan: *hasResult = true; *hasResultType = true; break; + case OpSLessThan: *hasResult = true; *hasResultType = true; break; + case OpULessThanEqual: *hasResult = true; *hasResultType = true; break; + case OpSLessThanEqual: *hasResult = true; *hasResultType = true; break; + case OpFOrdEqual: *hasResult = true; *hasResultType = true; break; + case OpFUnordEqual: *hasResult = true; *hasResultType = true; break; + case OpFOrdNotEqual: *hasResult = true; *hasResultType = true; break; + case OpFUnordNotEqual: *hasResult = true; *hasResultType = true; break; + case OpFOrdLessThan: *hasResult = true; *hasResultType = true; break; + case OpFUnordLessThan: *hasResult = true; *hasResultType = true; break; + case OpFOrdGreaterThan: *hasResult = true; *hasResultType = true; break; + case OpFUnordGreaterThan: *hasResult = true; *hasResultType = true; break; + case OpFOrdLessThanEqual: *hasResult = true; *hasResultType = true; break; + case OpFUnordLessThanEqual: *hasResult = true; *hasResultType = true; break; + case OpFOrdGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case OpFUnordGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case OpShiftRightLogical: *hasResult = true; *hasResultType = true; break; + case OpShiftRightArithmetic: *hasResult = true; *hasResultType = true; break; + case OpShiftLeftLogical: *hasResult = true; *hasResultType = true; break; + case OpBitwiseOr: *hasResult = true; *hasResultType = true; break; + case OpBitwiseXor: *hasResult = true; *hasResultType = true; break; + case OpBitwiseAnd: *hasResult = true; *hasResultType = true; break; + case OpNot: *hasResult = true; *hasResultType = true; break; + case OpBitFieldInsert: *hasResult = true; *hasResultType = true; break; + case OpBitFieldSExtract: *hasResult = true; *hasResultType = true; break; + case OpBitFieldUExtract: *hasResult = true; *hasResultType = true; break; + case OpBitReverse: *hasResult = true; *hasResultType = true; break; + case OpBitCount: *hasResult = true; *hasResultType = true; break; + case OpDPdx: *hasResult = true; *hasResultType = true; break; + case OpDPdy: *hasResult = true; *hasResultType = true; break; + case OpFwidth: *hasResult = true; *hasResultType = true; break; + case OpDPdxFine: *hasResult = true; *hasResultType = true; break; + case OpDPdyFine: *hasResult = true; *hasResultType = true; break; + case OpFwidthFine: *hasResult = true; *hasResultType = true; break; + case OpDPdxCoarse: *hasResult = true; *hasResultType = true; break; + case OpDPdyCoarse: *hasResult = true; *hasResultType = true; break; + case OpFwidthCoarse: *hasResult = true; *hasResultType = true; break; + case OpEmitVertex: *hasResult = false; *hasResultType = false; break; + case OpEndPrimitive: *hasResult = false; *hasResultType = false; break; + case OpEmitStreamVertex: *hasResult = false; *hasResultType = false; break; + case OpEndStreamPrimitive: *hasResult = false; *hasResultType = false; break; + case OpControlBarrier: *hasResult = false; *hasResultType = false; break; + case OpMemoryBarrier: *hasResult = false; *hasResultType = false; break; + case OpAtomicLoad: *hasResult = true; *hasResultType = true; break; + case OpAtomicStore: *hasResult = false; *hasResultType = false; break; + case OpAtomicExchange: *hasResult = true; *hasResultType = true; break; + case OpAtomicCompareExchange: *hasResult = true; *hasResultType = true; break; + case OpAtomicCompareExchangeWeak: *hasResult = true; *hasResultType = true; break; + case OpAtomicIIncrement: *hasResult = true; *hasResultType = true; break; + case OpAtomicIDecrement: *hasResult = true; *hasResultType = true; break; + case OpAtomicIAdd: *hasResult = true; *hasResultType = true; break; + case OpAtomicISub: *hasResult = true; *hasResultType = true; break; + case OpAtomicSMin: *hasResult = true; *hasResultType = true; break; + case OpAtomicUMin: *hasResult = true; *hasResultType = true; break; + case OpAtomicSMax: *hasResult = true; *hasResultType = true; break; + case OpAtomicUMax: *hasResult = true; *hasResultType = true; break; + case OpAtomicAnd: *hasResult = true; *hasResultType = true; break; + case OpAtomicOr: *hasResult = true; *hasResultType = true; break; + case OpAtomicXor: *hasResult = true; *hasResultType = true; break; + case OpPhi: *hasResult = true; *hasResultType = true; break; + case OpLoopMerge: *hasResult = false; *hasResultType = false; break; + case OpSelectionMerge: *hasResult = false; *hasResultType = false; break; + case OpLabel: *hasResult = true; *hasResultType = false; break; + case OpBranch: *hasResult = false; *hasResultType = false; break; + case OpBranchConditional: *hasResult = false; *hasResultType = false; break; + case OpSwitch: *hasResult = false; *hasResultType = false; break; + case OpKill: *hasResult = false; *hasResultType = false; break; + case OpReturn: *hasResult = false; *hasResultType = false; break; + case OpReturnValue: *hasResult = false; *hasResultType = false; break; + case OpUnreachable: *hasResult = false; *hasResultType = false; break; + case OpLifetimeStart: *hasResult = false; *hasResultType = false; break; + case OpLifetimeStop: *hasResult = false; *hasResultType = false; break; + case OpGroupAsyncCopy: *hasResult = true; *hasResultType = true; break; + case OpGroupWaitEvents: *hasResult = false; *hasResultType = false; break; + case OpGroupAll: *hasResult = true; *hasResultType = true; break; + case OpGroupAny: *hasResult = true; *hasResultType = true; break; + case OpGroupBroadcast: *hasResult = true; *hasResultType = true; break; + case OpGroupIAdd: *hasResult = true; *hasResultType = true; break; + case OpGroupFAdd: *hasResult = true; *hasResultType = true; break; + case OpGroupFMin: *hasResult = true; *hasResultType = true; break; + case OpGroupUMin: *hasResult = true; *hasResultType = true; break; + case OpGroupSMin: *hasResult = true; *hasResultType = true; break; + case OpGroupFMax: *hasResult = true; *hasResultType = true; break; + case OpGroupUMax: *hasResult = true; *hasResultType = true; break; + case OpGroupSMax: *hasResult = true; *hasResultType = true; break; + case OpReadPipe: *hasResult = true; *hasResultType = true; break; + case OpWritePipe: *hasResult = true; *hasResultType = true; break; + case OpReservedReadPipe: *hasResult = true; *hasResultType = true; break; + case OpReservedWritePipe: *hasResult = true; *hasResultType = true; break; + case OpReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; + case OpReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; + case OpCommitReadPipe: *hasResult = false; *hasResultType = false; break; + case OpCommitWritePipe: *hasResult = false; *hasResultType = false; break; + case OpIsValidReserveId: *hasResult = true; *hasResultType = true; break; + case OpGetNumPipePackets: *hasResult = true; *hasResultType = true; break; + case OpGetMaxPipePackets: *hasResult = true; *hasResultType = true; break; + case OpGroupReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; + case OpGroupReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; + case OpGroupCommitReadPipe: *hasResult = false; *hasResultType = false; break; + case OpGroupCommitWritePipe: *hasResult = false; *hasResultType = false; break; + case OpEnqueueMarker: *hasResult = true; *hasResultType = true; break; + case OpEnqueueKernel: *hasResult = true; *hasResultType = true; break; + case OpGetKernelNDrangeSubGroupCount: *hasResult = true; *hasResultType = true; break; + case OpGetKernelNDrangeMaxSubGroupSize: *hasResult = true; *hasResultType = true; break; + case OpGetKernelWorkGroupSize: *hasResult = true; *hasResultType = true; break; + case OpGetKernelPreferredWorkGroupSizeMultiple: *hasResult = true; *hasResultType = true; break; + case OpRetainEvent: *hasResult = false; *hasResultType = false; break; + case OpReleaseEvent: *hasResult = false; *hasResultType = false; break; + case OpCreateUserEvent: *hasResult = true; *hasResultType = true; break; + case OpIsValidEvent: *hasResult = true; *hasResultType = true; break; + case OpSetUserEventStatus: *hasResult = false; *hasResultType = false; break; + case OpCaptureEventProfilingInfo: *hasResult = false; *hasResultType = false; break; + case OpGetDefaultQueue: *hasResult = true; *hasResultType = true; break; + case OpBuildNDRange: *hasResult = true; *hasResultType = true; break; + case OpImageSparseSampleImplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSparseSampleExplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSparseSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSparseSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSparseSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSparseSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSparseSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSparseSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSparseFetch: *hasResult = true; *hasResultType = true; break; + case OpImageSparseGather: *hasResult = true; *hasResultType = true; break; + case OpImageSparseDrefGather: *hasResult = true; *hasResultType = true; break; + case OpImageSparseTexelsResident: *hasResult = true; *hasResultType = true; break; + case OpNoLine: *hasResult = false; *hasResultType = false; break; + case OpAtomicFlagTestAndSet: *hasResult = true; *hasResultType = true; break; + case OpAtomicFlagClear: *hasResult = false; *hasResultType = false; break; + case OpImageSparseRead: *hasResult = true; *hasResultType = true; break; + case OpSizeOf: *hasResult = true; *hasResultType = true; break; + case OpTypePipeStorage: *hasResult = true; *hasResultType = false; break; + case OpConstantPipeStorage: *hasResult = true; *hasResultType = true; break; + case OpCreatePipeFromPipeStorage: *hasResult = true; *hasResultType = true; break; + case OpGetKernelLocalSizeForSubgroupCount: *hasResult = true; *hasResultType = true; break; + case OpGetKernelMaxNumSubgroups: *hasResult = true; *hasResultType = true; break; + case OpTypeNamedBarrier: *hasResult = true; *hasResultType = false; break; + case OpNamedBarrierInitialize: *hasResult = true; *hasResultType = true; break; + case OpMemoryNamedBarrier: *hasResult = false; *hasResultType = false; break; + case OpModuleProcessed: *hasResult = false; *hasResultType = false; break; + case OpExecutionModeId: *hasResult = false; *hasResultType = false; break; + case OpDecorateId: *hasResult = false; *hasResultType = false; break; + case OpGroupNonUniformElect: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformAll: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformAny: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformAllEqual: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBroadcast: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBroadcastFirst: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBallot: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformInverseBallot: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBallotBitExtract: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBallotBitCount: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBallotFindLSB: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBallotFindMSB: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformShuffle: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformShuffleXor: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformShuffleUp: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformShuffleDown: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformIAdd: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformFAdd: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformIMul: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformFMul: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformSMin: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformUMin: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformFMin: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformSMax: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformUMax: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformFMax: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBitwiseAnd: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBitwiseOr: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBitwiseXor: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformLogicalAnd: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformLogicalOr: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformLogicalXor: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformQuadBroadcast: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformQuadSwap: *hasResult = true; *hasResultType = true; break; + case OpCopyLogical: *hasResult = true; *hasResultType = true; break; + case OpPtrEqual: *hasResult = true; *hasResultType = true; break; + case OpPtrNotEqual: *hasResult = true; *hasResultType = true; break; + case OpPtrDiff: *hasResult = true; *hasResultType = true; break; + case OpColorAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case OpDepthAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case OpStencilAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case OpTypeTensorARM: *hasResult = true; *hasResultType = false; break; + case OpTensorReadARM: *hasResult = true; *hasResultType = true; break; + case OpTensorWriteARM: *hasResult = false; *hasResultType = false; break; + case OpTensorQuerySizeARM: *hasResult = true; *hasResultType = true; break; + case OpGraphConstantARM: *hasResult = true; *hasResultType = true; break; + case OpGraphEntryPointARM: *hasResult = false; *hasResultType = false; break; + case OpGraphARM: *hasResult = true; *hasResultType = true; break; + case OpGraphInputARM: *hasResult = true; *hasResultType = true; break; + case OpGraphSetOutputARM: *hasResult = false; *hasResultType = false; break; + case OpGraphEndARM: *hasResult = false; *hasResultType = false; break; + case OpTypeGraphARM: *hasResult = true; *hasResultType = false; break; + case OpTerminateInvocation: *hasResult = false; *hasResultType = false; break; + case OpTypeUntypedPointerKHR: *hasResult = true; *hasResultType = false; break; + case OpUntypedVariableKHR: *hasResult = true; *hasResultType = true; break; + case OpUntypedAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case OpUntypedInBoundsAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case OpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break; + case OpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break; + case OpUntypedPtrAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case OpUntypedInBoundsPtrAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case OpUntypedArrayLengthKHR: *hasResult = true; *hasResultType = true; break; + case OpUntypedPrefetchKHR: *hasResult = false; *hasResultType = false; break; + case OpFmaKHR: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break; + case OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break; + case OpExtInstWithForwardRefsKHR: *hasResult = true; *hasResultType = true; break; + case OpUntypedGroupAsyncCopyKHR: *hasResult = true; *hasResultType = true; break; + case OpTraceRayKHR: *hasResult = false; *hasResultType = false; break; + case OpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break; + case OpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break; + case OpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case OpTerminateRayKHR: *hasResult = false; *hasResultType = false; break; + case OpSDot: *hasResult = true; *hasResultType = true; break; + case OpUDot: *hasResult = true; *hasResultType = true; break; + case OpSUDot: *hasResult = true; *hasResultType = true; break; + case OpSDotAccSat: *hasResult = true; *hasResultType = true; break; + case OpUDotAccSat: *hasResult = true; *hasResultType = true; break; + case OpSUDotAccSat: *hasResult = true; *hasResultType = true; break; + case OpTypeCooperativeMatrixKHR: *hasResult = true; *hasResultType = false; break; + case OpCooperativeMatrixLoadKHR: *hasResult = true; *hasResultType = true; break; + case OpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break; + case OpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break; + case OpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break; + case OpConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case OpSpecConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case OpCompositeConstructReplicateEXT: *hasResult = true; *hasResultType = true; break; + case OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break; + case OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break; + case OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break; + case OpRayQueryGenerateIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case OpRayQueryConfirmIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case OpRayQueryProceedKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionTypeKHR: *hasResult = true; *hasResultType = true; break; + case OpImageSampleWeightedQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBoxFilterQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBlockMatchSSDQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBlockMatchSADQCOM: *hasResult = true; *hasResultType = true; break; + case OpBitCastArrayQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBlockMatchWindowSSDQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBlockMatchWindowSADQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBlockMatchGatherSSDQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBlockMatchGatherSADQCOM: *hasResult = true; *hasResultType = true; break; + case OpCompositeConstructCoopMatQCOM: *hasResult = true; *hasResultType = true; break; + case OpCompositeExtractCoopMatQCOM: *hasResult = true; *hasResultType = true; break; + case OpExtractSubArrayQCOM: *hasResult = true; *hasResultType = true; break; + case OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case OpGroupUMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case OpGroupSMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case OpGroupFMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case OpGroupUMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case OpGroupSMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break; + case OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break; + case OpReadClockKHR: *hasResult = true; *hasResultType = true; break; + case OpAllocateNodePayloadsAMDX: *hasResult = true; *hasResultType = true; break; + case OpEnqueueNodePayloadsAMDX: *hasResult = false; *hasResultType = false; break; + case OpTypeNodePayloadArrayAMDX: *hasResult = true; *hasResultType = false; break; + case OpFinishWritingNodePayloadAMDX: *hasResult = true; *hasResultType = true; break; + case OpNodePayloadArrayLengthAMDX: *hasResult = true; *hasResultType = true; break; + case OpIsNodePayloadValidAMDX: *hasResult = true; *hasResultType = true; break; + case OpConstantStringAMDX: *hasResult = true; *hasResultType = false; break; + case OpSpecConstantStringAMDX: *hasResult = true; *hasResultType = false; break; + case OpGroupNonUniformQuadAllKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformQuadAnyKHR: *hasResult = true; *hasResultType = true; break; + case OpHitObjectRecordHitMotionNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectRecordHitWithIndexMotionNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectRecordMissMotionNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectGetWorldToObjectNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetObjectToWorldNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetObjectRayDirectionNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetObjectRayOriginNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectGetShaderRecordBufferHandleNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetShaderBindingTableRecordIndexNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectRecordEmptyNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectTraceRayNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectRecordHitNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectRecordHitWithIndexNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectRecordMissNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectExecuteShaderNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectGetCurrentTimeNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetAttributesNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectGetHitKindNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetPrimitiveIndexNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetGeometryIndexNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetInstanceIdNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetInstanceCustomIndexNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetWorldRayDirectionNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetWorldRayOriginNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetRayTMaxNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetRayTMinNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectIsEmptyNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectIsHitNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectIsMissNV: *hasResult = true; *hasResultType = true; break; + case OpReorderThreadWithHitObjectNV: *hasResult = false; *hasResultType = false; break; + case OpReorderThreadWithHintNV: *hasResult = false; *hasResultType = false; break; + case OpTypeHitObjectNV: *hasResult = true; *hasResultType = false; break; + case OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break; + case OpTypeCooperativeVectorNV: *hasResult = true; *hasResultType = false; break; + case OpCooperativeVectorMatrixMulNV: *hasResult = true; *hasResultType = true; break; + case OpCooperativeVectorOuterProductAccumulateNV: *hasResult = false; *hasResultType = false; break; + case OpCooperativeVectorReduceSumAccumulateNV: *hasResult = false; *hasResultType = false; break; + case OpCooperativeVectorMatrixMulAddNV: *hasResult = true; *hasResultType = true; break; + case OpCooperativeMatrixConvertNV: *hasResult = true; *hasResultType = true; break; + case OpEmitMeshTasksEXT: *hasResult = false; *hasResultType = false; break; + case OpSetMeshOutputsEXT: *hasResult = false; *hasResultType = false; break; + case OpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break; + case OpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break; + case OpFetchMicroTriangleVertexPositionNV: *hasResult = true; *hasResultType = true; break; + case OpFetchMicroTriangleVertexBarycentricNV: *hasResult = true; *hasResultType = true; break; + case OpCooperativeVectorLoadNV: *hasResult = true; *hasResultType = true; break; + case OpCooperativeVectorStoreNV: *hasResult = false; *hasResultType = false; break; + case OpReportIntersectionKHR: *hasResult = true; *hasResultType = true; break; + case OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break; + case OpTerminateRayNV: *hasResult = false; *hasResultType = false; break; + case OpTraceNV: *hasResult = false; *hasResultType = false; break; + case OpTraceMotionNV: *hasResult = false; *hasResultType = false; break; + case OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; + case OpRayQueryGetIntersectionTriangleVertexPositionsKHR: *hasResult = true; *hasResultType = true; break; + case OpTypeAccelerationStructureKHR: *hasResult = true; *hasResultType = false; break; + case OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break; + case OpRayQueryGetIntersectionClusterIdNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetClusterIdNV: *hasResult = true; *hasResultType = true; break; + case OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break; + case OpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break; + case OpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break; + case OpCooperativeMatrixMulAddNV: *hasResult = true; *hasResultType = true; break; + case OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break; + case OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; + case OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; + case OpCooperativeMatrixReduceNV: *hasResult = true; *hasResultType = true; break; + case OpCooperativeMatrixLoadTensorNV: *hasResult = true; *hasResultType = true; break; + case OpCooperativeMatrixStoreTensorNV: *hasResult = false; *hasResultType = false; break; + case OpCooperativeMatrixPerElementOpNV: *hasResult = true; *hasResultType = true; break; + case OpTypeTensorLayoutNV: *hasResult = true; *hasResultType = false; break; + case OpTypeTensorViewNV: *hasResult = true; *hasResultType = false; break; + case OpCreateTensorLayoutNV: *hasResult = true; *hasResultType = true; break; + case OpTensorLayoutSetDimensionNV: *hasResult = true; *hasResultType = true; break; + case OpTensorLayoutSetStrideNV: *hasResult = true; *hasResultType = true; break; + case OpTensorLayoutSliceNV: *hasResult = true; *hasResultType = true; break; + case OpTensorLayoutSetClampValueNV: *hasResult = true; *hasResultType = true; break; + case OpCreateTensorViewNV: *hasResult = true; *hasResultType = true; break; + case OpTensorViewSetDimensionNV: *hasResult = true; *hasResultType = true; break; + case OpTensorViewSetStrideNV: *hasResult = true; *hasResultType = true; break; + case OpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break; + case OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break; + case OpTensorViewSetClipNV: *hasResult = true; *hasResultType = true; break; + case OpTensorLayoutSetBlockSizeNV: *hasResult = true; *hasResultType = true; break; + case OpCooperativeMatrixTransposeNV: *hasResult = true; *hasResultType = true; break; + case OpConvertUToImageNV: *hasResult = true; *hasResultType = true; break; + case OpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break; + case OpConvertImageToUNV: *hasResult = true; *hasResultType = true; break; + case OpConvertSamplerToUNV: *hasResult = true; *hasResultType = true; break; + case OpConvertUToSampledImageNV: *hasResult = true; *hasResultType = true; break; + case OpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break; + case OpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break; + case OpRawAccessChainNV: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionSpherePositionNV: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionSphereRadiusNV: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionLSSPositionsNV: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionLSSRadiiNV: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionLSSHitValueNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetSpherePositionNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetSphereRadiusNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetLSSPositionsNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetLSSRadiiNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectIsSphereHitNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectIsLSSHitNV: *hasResult = true; *hasResultType = true; break; + case OpRayQueryIsSphereHitNV: *hasResult = true; *hasResultType = true; break; + case OpRayQueryIsLSSHitNV: *hasResult = true; *hasResultType = true; break; + case OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupShuffleXorINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case OpSubgroupImageBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupImageBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case OpSubgroupImageMediaBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupImageMediaBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case OpUCountLeadingZerosINTEL: *hasResult = true; *hasResultType = true; break; + case OpUCountTrailingZerosINTEL: *hasResult = true; *hasResultType = true; break; + case OpAbsISubINTEL: *hasResult = true; *hasResultType = true; break; + case OpAbsUSubINTEL: *hasResult = true; *hasResultType = true; break; + case OpIAddSatINTEL: *hasResult = true; *hasResultType = true; break; + case OpUAddSatINTEL: *hasResult = true; *hasResultType = true; break; + case OpIAverageINTEL: *hasResult = true; *hasResultType = true; break; + case OpUAverageINTEL: *hasResult = true; *hasResultType = true; break; + case OpIAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; + case OpUAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; + case OpISubSatINTEL: *hasResult = true; *hasResultType = true; break; + case OpUSubSatINTEL: *hasResult = true; *hasResultType = true; break; + case OpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break; + case OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break; + case OpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break; + case OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break; + case OpAsmTargetINTEL: *hasResult = true; *hasResultType = false; break; + case OpAsmINTEL: *hasResult = true; *hasResultType = true; break; + case OpAsmCallINTEL: *hasResult = true; *hasResultType = true; break; + case OpAtomicFMinEXT: *hasResult = true; *hasResultType = true; break; + case OpAtomicFMaxEXT: *hasResult = true; *hasResultType = true; break; + case OpAssumeTrueKHR: *hasResult = false; *hasResultType = false; break; + case OpExpectKHR: *hasResult = true; *hasResultType = true; break; + case OpDecorateString: *hasResult = false; *hasResultType = false; break; + case OpMemberDecorateString: *hasResult = false; *hasResultType = false; break; + case OpVmeImageINTEL: *hasResult = true; *hasResultType = true; break; + case OpTypeVmeImageINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcImePayloadINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcRefPayloadINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcSicPayloadINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcMcePayloadINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcMceResultINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcImeResultINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcImeResultSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcImeResultDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcImeSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcImeDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcRefResultINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcSicResultINTEL: *hasResult = true; *hasResultType = false; break; + case OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceSetInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceSetInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceSetAcOnlyHaarINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceConvertToImePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceConvertToImeResultINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceConvertToRefPayloadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceConvertToRefResultINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceConvertToSicPayloadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceConvertToSicResultINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetBestInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetInterMajorShapeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetInterMinorShapeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetInterDirectionsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetInterMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetInterReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeSetSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeSetDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeRefWindowSizeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeAdjustRefOffsetINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeSetMaxMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeSetWeightedSadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeStripDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetBorderReachedINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcFmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcBmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcRefConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcRefSetBidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcRefSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcRefEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcRefConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicConfigureSkcINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicConfigureIpeLumaINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicConfigureIpeLumaChromaINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicGetMotionVectorMaskINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicEvaluateIpeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicGetIpeLumaShapeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicGetPackedIpeLumaModesINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicGetIpeChromaModeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicGetInterRawSadsINTEL: *hasResult = true; *hasResultType = true; break; + case OpVariableLengthArrayINTEL: *hasResult = true; *hasResultType = true; break; + case OpSaveMemoryINTEL: *hasResult = true; *hasResultType = true; break; + case OpRestoreMemoryINTEL: *hasResult = false; *hasResultType = false; break; + case OpArbitraryFloatSinCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatCastINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatCastFromIntINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatCastToIntINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatAddINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatSubINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatMulINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatDivINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatGTINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatGEINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatLTINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatLEINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatEQINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatRecipINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatRSqrtINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatCbrtINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatHypotINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatSqrtINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatLogINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatLog2INTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatLog10INTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatLog1pINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatExpINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatExp2INTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatExp10INTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatExpm1INTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatSinINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatCosINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatSinCosINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatSinPiINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatASinINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatASinPiINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatACosINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatACosPiINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatATanINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatATanPiINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatATan2INTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatPowINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break; + case OpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break; + case OpLoopControlINTEL: *hasResult = false; *hasResultType = false; break; + case OpAliasDomainDeclINTEL: *hasResult = true; *hasResultType = false; break; + case OpAliasScopeDeclINTEL: *hasResult = true; *hasResultType = false; break; + case OpAliasScopeListDeclINTEL: *hasResult = true; *hasResultType = false; break; + case OpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break; + case OpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break; + case OpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break; + case OpFixedSinINTEL: *hasResult = true; *hasResultType = true; break; + case OpFixedCosINTEL: *hasResult = true; *hasResultType = true; break; + case OpFixedSinCosINTEL: *hasResult = true; *hasResultType = true; break; + case OpFixedSinPiINTEL: *hasResult = true; *hasResultType = true; break; + case OpFixedCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case OpFixedSinCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case OpFixedLogINTEL: *hasResult = true; *hasResultType = true; break; + case OpFixedExpINTEL: *hasResult = true; *hasResultType = true; break; + case OpPtrCastToCrossWorkgroupINTEL: *hasResult = true; *hasResultType = true; break; + case OpCrossWorkgroupCastToPtrINTEL: *hasResult = true; *hasResultType = true; break; + case OpReadPipeBlockingINTEL: *hasResult = true; *hasResultType = true; break; + case OpWritePipeBlockingINTEL: *hasResult = true; *hasResultType = true; break; + case OpFPGARegINTEL: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetRayTMinKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetRayFlagsKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionTKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionInstanceCustomIndexKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionInstanceIdKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionGeometryIndexKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionPrimitiveIndexKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionBarycentricsKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionFrontFaceKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionObjectRayDirectionKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionObjectRayOriginKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetWorldRayDirectionKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetWorldRayOriginKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionObjectToWorldKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionWorldToObjectKHR: *hasResult = true; *hasResultType = true; break; + case OpAtomicFAddEXT: *hasResult = true; *hasResultType = true; break; + case OpTypeBufferSurfaceINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case OpCompositeConstructContinuedINTEL: *hasResult = true; *hasResultType = true; break; + case OpConvertFToBF16INTEL: *hasResult = true; *hasResultType = true; break; + case OpConvertBF16ToFINTEL: *hasResult = true; *hasResultType = true; break; + case OpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break; + case OpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break; + case OpArithmeticFenceEXT: *hasResult = true; *hasResultType = true; break; + case OpTaskSequenceCreateINTEL: *hasResult = true; *hasResultType = true; break; + case OpTaskSequenceAsyncINTEL: *hasResult = false; *hasResultType = false; break; + case OpTaskSequenceGetINTEL: *hasResult = true; *hasResultType = true; break; + case OpTaskSequenceReleaseINTEL: *hasResult = false; *hasResultType = false; break; + case OpTypeTaskSequenceINTEL: *hasResult = true; *hasResultType = false; break; + case OpSubgroupBlockPrefetchINTEL: *hasResult = false; *hasResultType = false; break; + case OpSubgroup2DBlockLoadINTEL: *hasResult = false; *hasResultType = false; break; + case OpSubgroup2DBlockLoadTransformINTEL: *hasResult = false; *hasResultType = false; break; + case OpSubgroup2DBlockLoadTransposeINTEL: *hasResult = false; *hasResultType = false; break; + case OpSubgroup2DBlockPrefetchINTEL: *hasResult = false; *hasResultType = false; break; + case OpSubgroup2DBlockStoreINTEL: *hasResult = false; *hasResultType = false; break; + case OpSubgroupMatrixMultiplyAccumulateINTEL: *hasResult = true; *hasResultType = true; break; + case OpBitwiseFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case OpUntypedVariableLengthArrayINTEL: *hasResult = true; *hasResultType = true; break; + case OpConditionalExtensionINTEL: *hasResult = false; *hasResultType = false; break; + case OpConditionalEntryPointINTEL: *hasResult = false; *hasResultType = false; break; + case OpConditionalCapabilityINTEL: *hasResult = false; *hasResultType = false; break; + case OpSpecConstantTargetINTEL: *hasResult = true; *hasResultType = true; break; + case OpSpecConstantArchitectureINTEL: *hasResult = true; *hasResultType = true; break; + case OpSpecConstantCapabilitiesINTEL: *hasResult = true; *hasResultType = true; break; + case OpConditionalCopyObjectINTEL: *hasResult = true; *hasResultType = true; break; + case OpGroupIMulKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupFMulKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break; + case OpRoundFToTF32INTEL: *hasResult = true; *hasResultType = true; break; + case OpMaskedGatherINTEL: *hasResult = true; *hasResultType = true; break; + case OpMaskedScatterINTEL: *hasResult = false; *hasResultType = false; break; + case OpConvertHandleToImageINTEL: *hasResult = true; *hasResultType = true; break; + case OpConvertHandleToSamplerINTEL: *hasResult = true; *hasResultType = true; break; + case OpConvertHandleToSampledImageINTEL: *hasResult = true; *hasResultType = true; break; + } +} +inline const char* SourceLanguageToString(SourceLanguage value) { + switch (value) { + case SourceLanguageUnknown: return "Unknown"; + case SourceLanguageESSL: return "ESSL"; + case SourceLanguageGLSL: return "GLSL"; + case SourceLanguageOpenCL_C: return "OpenCL_C"; + case SourceLanguageOpenCL_CPP: return "OpenCL_CPP"; + case SourceLanguageHLSL: return "HLSL"; + case SourceLanguageCPP_for_OpenCL: return "CPP_for_OpenCL"; + case SourceLanguageSYCL: return "SYCL"; + case SourceLanguageHERO_C: return "HERO_C"; + case SourceLanguageNZSL: return "NZSL"; + case SourceLanguageWGSL: return "WGSL"; + case SourceLanguageSlang: return "Slang"; + case SourceLanguageZig: return "Zig"; + case SourceLanguageRust: return "Rust"; + default: return "Unknown"; + } +} + +inline const char* ExecutionModelToString(ExecutionModel value) { + switch (value) { + case ExecutionModelVertex: return "Vertex"; + case ExecutionModelTessellationControl: return "TessellationControl"; + case ExecutionModelTessellationEvaluation: return "TessellationEvaluation"; + case ExecutionModelGeometry: return "Geometry"; + case ExecutionModelFragment: return "Fragment"; + case ExecutionModelGLCompute: return "GLCompute"; + case ExecutionModelKernel: return "Kernel"; + case ExecutionModelTaskNV: return "TaskNV"; + case ExecutionModelMeshNV: return "MeshNV"; + case ExecutionModelRayGenerationKHR: return "RayGenerationKHR"; + case ExecutionModelIntersectionKHR: return "IntersectionKHR"; + case ExecutionModelAnyHitKHR: return "AnyHitKHR"; + case ExecutionModelClosestHitKHR: return "ClosestHitKHR"; + case ExecutionModelMissKHR: return "MissKHR"; + case ExecutionModelCallableKHR: return "CallableKHR"; + case ExecutionModelTaskEXT: return "TaskEXT"; + case ExecutionModelMeshEXT: return "MeshEXT"; + default: return "Unknown"; + } +} + +inline const char* AddressingModelToString(AddressingModel value) { + switch (value) { + case AddressingModelLogical: return "Logical"; + case AddressingModelPhysical32: return "Physical32"; + case AddressingModelPhysical64: return "Physical64"; + case AddressingModelPhysicalStorageBuffer64: return "PhysicalStorageBuffer64"; + default: return "Unknown"; + } +} + +inline const char* MemoryModelToString(MemoryModel value) { + switch (value) { + case MemoryModelSimple: return "Simple"; + case MemoryModelGLSL450: return "GLSL450"; + case MemoryModelOpenCL: return "OpenCL"; + case MemoryModelVulkan: return "Vulkan"; + default: return "Unknown"; + } +} + +inline const char* ExecutionModeToString(ExecutionMode value) { + switch (value) { + case ExecutionModeInvocations: return "Invocations"; + case ExecutionModeSpacingEqual: return "SpacingEqual"; + case ExecutionModeSpacingFractionalEven: return "SpacingFractionalEven"; + case ExecutionModeSpacingFractionalOdd: return "SpacingFractionalOdd"; + case ExecutionModeVertexOrderCw: return "VertexOrderCw"; + case ExecutionModeVertexOrderCcw: return "VertexOrderCcw"; + case ExecutionModePixelCenterInteger: return "PixelCenterInteger"; + case ExecutionModeOriginUpperLeft: return "OriginUpperLeft"; + case ExecutionModeOriginLowerLeft: return "OriginLowerLeft"; + case ExecutionModeEarlyFragmentTests: return "EarlyFragmentTests"; + case ExecutionModePointMode: return "PointMode"; + case ExecutionModeXfb: return "Xfb"; + case ExecutionModeDepthReplacing: return "DepthReplacing"; + case ExecutionModeDepthGreater: return "DepthGreater"; + case ExecutionModeDepthLess: return "DepthLess"; + case ExecutionModeDepthUnchanged: return "DepthUnchanged"; + case ExecutionModeLocalSize: return "LocalSize"; + case ExecutionModeLocalSizeHint: return "LocalSizeHint"; + case ExecutionModeInputPoints: return "InputPoints"; + case ExecutionModeInputLines: return "InputLines"; + case ExecutionModeInputLinesAdjacency: return "InputLinesAdjacency"; + case ExecutionModeTriangles: return "Triangles"; + case ExecutionModeInputTrianglesAdjacency: return "InputTrianglesAdjacency"; + case ExecutionModeQuads: return "Quads"; + case ExecutionModeIsolines: return "Isolines"; + case ExecutionModeOutputVertices: return "OutputVertices"; + case ExecutionModeOutputPoints: return "OutputPoints"; + case ExecutionModeOutputLineStrip: return "OutputLineStrip"; + case ExecutionModeOutputTriangleStrip: return "OutputTriangleStrip"; + case ExecutionModeVecTypeHint: return "VecTypeHint"; + case ExecutionModeContractionOff: return "ContractionOff"; + case ExecutionModeInitializer: return "Initializer"; + case ExecutionModeFinalizer: return "Finalizer"; + case ExecutionModeSubgroupSize: return "SubgroupSize"; + case ExecutionModeSubgroupsPerWorkgroup: return "SubgroupsPerWorkgroup"; + case ExecutionModeSubgroupsPerWorkgroupId: return "SubgroupsPerWorkgroupId"; + case ExecutionModeLocalSizeId: return "LocalSizeId"; + case ExecutionModeLocalSizeHintId: return "LocalSizeHintId"; + case ExecutionModeNonCoherentColorAttachmentReadEXT: return "NonCoherentColorAttachmentReadEXT"; + case ExecutionModeNonCoherentDepthAttachmentReadEXT: return "NonCoherentDepthAttachmentReadEXT"; + case ExecutionModeNonCoherentStencilAttachmentReadEXT: return "NonCoherentStencilAttachmentReadEXT"; + case ExecutionModeSubgroupUniformControlFlowKHR: return "SubgroupUniformControlFlowKHR"; + case ExecutionModePostDepthCoverage: return "PostDepthCoverage"; + case ExecutionModeDenormPreserve: return "DenormPreserve"; + case ExecutionModeDenormFlushToZero: return "DenormFlushToZero"; + case ExecutionModeSignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve"; + case ExecutionModeRoundingModeRTE: return "RoundingModeRTE"; + case ExecutionModeRoundingModeRTZ: return "RoundingModeRTZ"; + case ExecutionModeNonCoherentTileAttachmentReadQCOM: return "NonCoherentTileAttachmentReadQCOM"; + case ExecutionModeTileShadingRateQCOM: return "TileShadingRateQCOM"; + case ExecutionModeEarlyAndLateFragmentTestsAMD: return "EarlyAndLateFragmentTestsAMD"; + case ExecutionModeStencilRefReplacingEXT: return "StencilRefReplacingEXT"; + case ExecutionModeCoalescingAMDX: return "CoalescingAMDX"; + case ExecutionModeIsApiEntryAMDX: return "IsApiEntryAMDX"; + case ExecutionModeMaxNodeRecursionAMDX: return "MaxNodeRecursionAMDX"; + case ExecutionModeStaticNumWorkgroupsAMDX: return "StaticNumWorkgroupsAMDX"; + case ExecutionModeShaderIndexAMDX: return "ShaderIndexAMDX"; + case ExecutionModeMaxNumWorkgroupsAMDX: return "MaxNumWorkgroupsAMDX"; + case ExecutionModeStencilRefUnchangedFrontAMD: return "StencilRefUnchangedFrontAMD"; + case ExecutionModeStencilRefGreaterFrontAMD: return "StencilRefGreaterFrontAMD"; + case ExecutionModeStencilRefLessFrontAMD: return "StencilRefLessFrontAMD"; + case ExecutionModeStencilRefUnchangedBackAMD: return "StencilRefUnchangedBackAMD"; + case ExecutionModeStencilRefGreaterBackAMD: return "StencilRefGreaterBackAMD"; + case ExecutionModeStencilRefLessBackAMD: return "StencilRefLessBackAMD"; + case ExecutionModeQuadDerivativesKHR: return "QuadDerivativesKHR"; + case ExecutionModeRequireFullQuadsKHR: return "RequireFullQuadsKHR"; + case ExecutionModeSharesInputWithAMDX: return "SharesInputWithAMDX"; + case ExecutionModeOutputLinesEXT: return "OutputLinesEXT"; + case ExecutionModeOutputPrimitivesEXT: return "OutputPrimitivesEXT"; + case ExecutionModeDerivativeGroupQuadsKHR: return "DerivativeGroupQuadsKHR"; + case ExecutionModeDerivativeGroupLinearKHR: return "DerivativeGroupLinearKHR"; + case ExecutionModeOutputTrianglesEXT: return "OutputTrianglesEXT"; + case ExecutionModePixelInterlockOrderedEXT: return "PixelInterlockOrderedEXT"; + case ExecutionModePixelInterlockUnorderedEXT: return "PixelInterlockUnorderedEXT"; + case ExecutionModeSampleInterlockOrderedEXT: return "SampleInterlockOrderedEXT"; + case ExecutionModeSampleInterlockUnorderedEXT: return "SampleInterlockUnorderedEXT"; + case ExecutionModeShadingRateInterlockOrderedEXT: return "ShadingRateInterlockOrderedEXT"; + case ExecutionModeShadingRateInterlockUnorderedEXT: return "ShadingRateInterlockUnorderedEXT"; + case ExecutionModeSharedLocalMemorySizeINTEL: return "SharedLocalMemorySizeINTEL"; + case ExecutionModeRoundingModeRTPINTEL: return "RoundingModeRTPINTEL"; + case ExecutionModeRoundingModeRTNINTEL: return "RoundingModeRTNINTEL"; + case ExecutionModeFloatingPointModeALTINTEL: return "FloatingPointModeALTINTEL"; + case ExecutionModeFloatingPointModeIEEEINTEL: return "FloatingPointModeIEEEINTEL"; + case ExecutionModeMaxWorkgroupSizeINTEL: return "MaxWorkgroupSizeINTEL"; + case ExecutionModeMaxWorkDimINTEL: return "MaxWorkDimINTEL"; + case ExecutionModeNoGlobalOffsetINTEL: return "NoGlobalOffsetINTEL"; + case ExecutionModeNumSIMDWorkitemsINTEL: return "NumSIMDWorkitemsINTEL"; + case ExecutionModeSchedulerTargetFmaxMhzINTEL: return "SchedulerTargetFmaxMhzINTEL"; + case ExecutionModeMaximallyReconvergesKHR: return "MaximallyReconvergesKHR"; + case ExecutionModeFPFastMathDefault: return "FPFastMathDefault"; + case ExecutionModeStreamingInterfaceINTEL: return "StreamingInterfaceINTEL"; + case ExecutionModeRegisterMapInterfaceINTEL: return "RegisterMapInterfaceINTEL"; + case ExecutionModeNamedBarrierCountINTEL: return "NamedBarrierCountINTEL"; + case ExecutionModeMaximumRegistersINTEL: return "MaximumRegistersINTEL"; + case ExecutionModeMaximumRegistersIdINTEL: return "MaximumRegistersIdINTEL"; + case ExecutionModeNamedMaximumRegistersINTEL: return "NamedMaximumRegistersINTEL"; + default: return "Unknown"; + } +} + +inline const char* StorageClassToString(StorageClass value) { + switch (value) { + case StorageClassUniformConstant: return "UniformConstant"; + case StorageClassInput: return "Input"; + case StorageClassUniform: return "Uniform"; + case StorageClassOutput: return "Output"; + case StorageClassWorkgroup: return "Workgroup"; + case StorageClassCrossWorkgroup: return "CrossWorkgroup"; + case StorageClassPrivate: return "Private"; + case StorageClassFunction: return "Function"; + case StorageClassGeneric: return "Generic"; + case StorageClassPushConstant: return "PushConstant"; + case StorageClassAtomicCounter: return "AtomicCounter"; + case StorageClassImage: return "Image"; + case StorageClassStorageBuffer: return "StorageBuffer"; + case StorageClassTileImageEXT: return "TileImageEXT"; + case StorageClassTileAttachmentQCOM: return "TileAttachmentQCOM"; + case StorageClassNodePayloadAMDX: return "NodePayloadAMDX"; + case StorageClassCallableDataKHR: return "CallableDataKHR"; + case StorageClassIncomingCallableDataKHR: return "IncomingCallableDataKHR"; + case StorageClassRayPayloadKHR: return "RayPayloadKHR"; + case StorageClassHitAttributeKHR: return "HitAttributeKHR"; + case StorageClassIncomingRayPayloadKHR: return "IncomingRayPayloadKHR"; + case StorageClassShaderRecordBufferKHR: return "ShaderRecordBufferKHR"; + case StorageClassPhysicalStorageBuffer: return "PhysicalStorageBuffer"; + case StorageClassHitObjectAttributeNV: return "HitObjectAttributeNV"; + case StorageClassTaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT"; + case StorageClassCodeSectionINTEL: return "CodeSectionINTEL"; + case StorageClassDeviceOnlyINTEL: return "DeviceOnlyINTEL"; + case StorageClassHostOnlyINTEL: return "HostOnlyINTEL"; + default: return "Unknown"; + } +} + +inline const char* DimToString(Dim value) { + switch (value) { + case Dim1D: return "1D"; + case Dim2D: return "2D"; + case Dim3D: return "3D"; + case DimCube: return "Cube"; + case DimRect: return "Rect"; + case DimBuffer: return "Buffer"; + case DimSubpassData: return "SubpassData"; + case DimTileImageDataEXT: return "TileImageDataEXT"; + default: return "Unknown"; + } +} + +inline const char* SamplerAddressingModeToString(SamplerAddressingMode value) { + switch (value) { + case SamplerAddressingModeNone: return "None"; + case SamplerAddressingModeClampToEdge: return "ClampToEdge"; + case SamplerAddressingModeClamp: return "Clamp"; + case SamplerAddressingModeRepeat: return "Repeat"; + case SamplerAddressingModeRepeatMirrored: return "RepeatMirrored"; + default: return "Unknown"; + } +} + +inline const char* SamplerFilterModeToString(SamplerFilterMode value) { + switch (value) { + case SamplerFilterModeNearest: return "Nearest"; + case SamplerFilterModeLinear: return "Linear"; + default: return "Unknown"; + } +} + +inline const char* ImageFormatToString(ImageFormat value) { + switch (value) { + case ImageFormatUnknown: return "Unknown"; + case ImageFormatRgba32f: return "Rgba32f"; + case ImageFormatRgba16f: return "Rgba16f"; + case ImageFormatR32f: return "R32f"; + case ImageFormatRgba8: return "Rgba8"; + case ImageFormatRgba8Snorm: return "Rgba8Snorm"; + case ImageFormatRg32f: return "Rg32f"; + case ImageFormatRg16f: return "Rg16f"; + case ImageFormatR11fG11fB10f: return "R11fG11fB10f"; + case ImageFormatR16f: return "R16f"; + case ImageFormatRgba16: return "Rgba16"; + case ImageFormatRgb10A2: return "Rgb10A2"; + case ImageFormatRg16: return "Rg16"; + case ImageFormatRg8: return "Rg8"; + case ImageFormatR16: return "R16"; + case ImageFormatR8: return "R8"; + case ImageFormatRgba16Snorm: return "Rgba16Snorm"; + case ImageFormatRg16Snorm: return "Rg16Snorm"; + case ImageFormatRg8Snorm: return "Rg8Snorm"; + case ImageFormatR16Snorm: return "R16Snorm"; + case ImageFormatR8Snorm: return "R8Snorm"; + case ImageFormatRgba32i: return "Rgba32i"; + case ImageFormatRgba16i: return "Rgba16i"; + case ImageFormatRgba8i: return "Rgba8i"; + case ImageFormatR32i: return "R32i"; + case ImageFormatRg32i: return "Rg32i"; + case ImageFormatRg16i: return "Rg16i"; + case ImageFormatRg8i: return "Rg8i"; + case ImageFormatR16i: return "R16i"; + case ImageFormatR8i: return "R8i"; + case ImageFormatRgba32ui: return "Rgba32ui"; + case ImageFormatRgba16ui: return "Rgba16ui"; + case ImageFormatRgba8ui: return "Rgba8ui"; + case ImageFormatR32ui: return "R32ui"; + case ImageFormatRgb10a2ui: return "Rgb10a2ui"; + case ImageFormatRg32ui: return "Rg32ui"; + case ImageFormatRg16ui: return "Rg16ui"; + case ImageFormatRg8ui: return "Rg8ui"; + case ImageFormatR16ui: return "R16ui"; + case ImageFormatR8ui: return "R8ui"; + case ImageFormatR64ui: return "R64ui"; + case ImageFormatR64i: return "R64i"; + default: return "Unknown"; + } +} + +inline const char* ImageChannelOrderToString(ImageChannelOrder value) { + switch (value) { + case ImageChannelOrderR: return "R"; + case ImageChannelOrderA: return "A"; + case ImageChannelOrderRG: return "RG"; + case ImageChannelOrderRA: return "RA"; + case ImageChannelOrderRGB: return "RGB"; + case ImageChannelOrderRGBA: return "RGBA"; + case ImageChannelOrderBGRA: return "BGRA"; + case ImageChannelOrderARGB: return "ARGB"; + case ImageChannelOrderIntensity: return "Intensity"; + case ImageChannelOrderLuminance: return "Luminance"; + case ImageChannelOrderRx: return "Rx"; + case ImageChannelOrderRGx: return "RGx"; + case ImageChannelOrderRGBx: return "RGBx"; + case ImageChannelOrderDepth: return "Depth"; + case ImageChannelOrderDepthStencil: return "DepthStencil"; + case ImageChannelOrdersRGB: return "sRGB"; + case ImageChannelOrdersRGBx: return "sRGBx"; + case ImageChannelOrdersRGBA: return "sRGBA"; + case ImageChannelOrdersBGRA: return "sBGRA"; + case ImageChannelOrderABGR: return "ABGR"; + default: return "Unknown"; + } +} + +inline const char* ImageChannelDataTypeToString(ImageChannelDataType value) { + switch (value) { + case ImageChannelDataTypeSnormInt8: return "SnormInt8"; + case ImageChannelDataTypeSnormInt16: return "SnormInt16"; + case ImageChannelDataTypeUnormInt8: return "UnormInt8"; + case ImageChannelDataTypeUnormInt16: return "UnormInt16"; + case ImageChannelDataTypeUnormShort565: return "UnormShort565"; + case ImageChannelDataTypeUnormShort555: return "UnormShort555"; + case ImageChannelDataTypeUnormInt101010: return "UnormInt101010"; + case ImageChannelDataTypeSignedInt8: return "SignedInt8"; + case ImageChannelDataTypeSignedInt16: return "SignedInt16"; + case ImageChannelDataTypeSignedInt32: return "SignedInt32"; + case ImageChannelDataTypeUnsignedInt8: return "UnsignedInt8"; + case ImageChannelDataTypeUnsignedInt16: return "UnsignedInt16"; + case ImageChannelDataTypeUnsignedInt32: return "UnsignedInt32"; + case ImageChannelDataTypeHalfFloat: return "HalfFloat"; + case ImageChannelDataTypeFloat: return "Float"; + case ImageChannelDataTypeUnormInt24: return "UnormInt24"; + case ImageChannelDataTypeUnormInt101010_2: return "UnormInt101010_2"; + case ImageChannelDataTypeUnormInt10X6EXT: return "UnormInt10X6EXT"; + case ImageChannelDataTypeUnsignedIntRaw10EXT: return "UnsignedIntRaw10EXT"; + case ImageChannelDataTypeUnsignedIntRaw12EXT: return "UnsignedIntRaw12EXT"; + case ImageChannelDataTypeUnormInt2_101010EXT: return "UnormInt2_101010EXT"; + case ImageChannelDataTypeUnsignedInt10X6EXT: return "UnsignedInt10X6EXT"; + case ImageChannelDataTypeUnsignedInt12X4EXT: return "UnsignedInt12X4EXT"; + case ImageChannelDataTypeUnsignedInt14X2EXT: return "UnsignedInt14X2EXT"; + case ImageChannelDataTypeUnormInt12X4EXT: return "UnormInt12X4EXT"; + case ImageChannelDataTypeUnormInt14X2EXT: return "UnormInt14X2EXT"; + default: return "Unknown"; + } +} + +inline const char* FPRoundingModeToString(FPRoundingMode value) { + switch (value) { + case FPRoundingModeRTE: return "RTE"; + case FPRoundingModeRTZ: return "RTZ"; + case FPRoundingModeRTP: return "RTP"; + case FPRoundingModeRTN: return "RTN"; + default: return "Unknown"; + } +} + +inline const char* LinkageTypeToString(LinkageType value) { + switch (value) { + case LinkageTypeExport: return "Export"; + case LinkageTypeImport: return "Import"; + case LinkageTypeLinkOnceODR: return "LinkOnceODR"; + default: return "Unknown"; + } +} + +inline const char* AccessQualifierToString(AccessQualifier value) { + switch (value) { + case AccessQualifierReadOnly: return "ReadOnly"; + case AccessQualifierWriteOnly: return "WriteOnly"; + case AccessQualifierReadWrite: return "ReadWrite"; + default: return "Unknown"; + } +} + +inline const char* FunctionParameterAttributeToString(FunctionParameterAttribute value) { + switch (value) { + case FunctionParameterAttributeZext: return "Zext"; + case FunctionParameterAttributeSext: return "Sext"; + case FunctionParameterAttributeByVal: return "ByVal"; + case FunctionParameterAttributeSret: return "Sret"; + case FunctionParameterAttributeNoAlias: return "NoAlias"; + case FunctionParameterAttributeNoCapture: return "NoCapture"; + case FunctionParameterAttributeNoWrite: return "NoWrite"; + case FunctionParameterAttributeNoReadWrite: return "NoReadWrite"; + case FunctionParameterAttributeRuntimeAlignedINTEL: return "RuntimeAlignedINTEL"; + default: return "Unknown"; + } +} + +inline const char* DecorationToString(Decoration value) { + switch (value) { + case DecorationRelaxedPrecision: return "RelaxedPrecision"; + case DecorationSpecId: return "SpecId"; + case DecorationBlock: return "Block"; + case DecorationBufferBlock: return "BufferBlock"; + case DecorationRowMajor: return "RowMajor"; + case DecorationColMajor: return "ColMajor"; + case DecorationArrayStride: return "ArrayStride"; + case DecorationMatrixStride: return "MatrixStride"; + case DecorationGLSLShared: return "GLSLShared"; + case DecorationGLSLPacked: return "GLSLPacked"; + case DecorationCPacked: return "CPacked"; + case DecorationBuiltIn: return "BuiltIn"; + case DecorationNoPerspective: return "NoPerspective"; + case DecorationFlat: return "Flat"; + case DecorationPatch: return "Patch"; + case DecorationCentroid: return "Centroid"; + case DecorationSample: return "Sample"; + case DecorationInvariant: return "Invariant"; + case DecorationRestrict: return "Restrict"; + case DecorationAliased: return "Aliased"; + case DecorationVolatile: return "Volatile"; + case DecorationConstant: return "Constant"; + case DecorationCoherent: return "Coherent"; + case DecorationNonWritable: return "NonWritable"; + case DecorationNonReadable: return "NonReadable"; + case DecorationUniform: return "Uniform"; + case DecorationUniformId: return "UniformId"; + case DecorationSaturatedConversion: return "SaturatedConversion"; + case DecorationStream: return "Stream"; + case DecorationLocation: return "Location"; + case DecorationComponent: return "Component"; + case DecorationIndex: return "Index"; + case DecorationBinding: return "Binding"; + case DecorationDescriptorSet: return "DescriptorSet"; + case DecorationOffset: return "Offset"; + case DecorationXfbBuffer: return "XfbBuffer"; + case DecorationXfbStride: return "XfbStride"; + case DecorationFuncParamAttr: return "FuncParamAttr"; + case DecorationFPRoundingMode: return "FPRoundingMode"; + case DecorationFPFastMathMode: return "FPFastMathMode"; + case DecorationLinkageAttributes: return "LinkageAttributes"; + case DecorationNoContraction: return "NoContraction"; + case DecorationInputAttachmentIndex: return "InputAttachmentIndex"; + case DecorationAlignment: return "Alignment"; + case DecorationMaxByteOffset: return "MaxByteOffset"; + case DecorationAlignmentId: return "AlignmentId"; + case DecorationMaxByteOffsetId: return "MaxByteOffsetId"; + case DecorationSaturatedToLargestFloat8NormalConversionEXT: return "SaturatedToLargestFloat8NormalConversionEXT"; + case DecorationNoSignedWrap: return "NoSignedWrap"; + case DecorationNoUnsignedWrap: return "NoUnsignedWrap"; + case DecorationWeightTextureQCOM: return "WeightTextureQCOM"; + case DecorationBlockMatchTextureQCOM: return "BlockMatchTextureQCOM"; + case DecorationBlockMatchSamplerQCOM: return "BlockMatchSamplerQCOM"; + case DecorationExplicitInterpAMD: return "ExplicitInterpAMD"; + case DecorationNodeSharesPayloadLimitsWithAMDX: return "NodeSharesPayloadLimitsWithAMDX"; + case DecorationNodeMaxPayloadsAMDX: return "NodeMaxPayloadsAMDX"; + case DecorationTrackFinishWritingAMDX: return "TrackFinishWritingAMDX"; + case DecorationPayloadNodeNameAMDX: return "PayloadNodeNameAMDX"; + case DecorationPayloadNodeBaseIndexAMDX: return "PayloadNodeBaseIndexAMDX"; + case DecorationPayloadNodeSparseArrayAMDX: return "PayloadNodeSparseArrayAMDX"; + case DecorationPayloadNodeArraySizeAMDX: return "PayloadNodeArraySizeAMDX"; + case DecorationPayloadDispatchIndirectAMDX: return "PayloadDispatchIndirectAMDX"; + case DecorationOverrideCoverageNV: return "OverrideCoverageNV"; + case DecorationPassthroughNV: return "PassthroughNV"; + case DecorationViewportRelativeNV: return "ViewportRelativeNV"; + case DecorationSecondaryViewportRelativeNV: return "SecondaryViewportRelativeNV"; + case DecorationPerPrimitiveEXT: return "PerPrimitiveEXT"; + case DecorationPerViewNV: return "PerViewNV"; + case DecorationPerTaskNV: return "PerTaskNV"; + case DecorationPerVertexKHR: return "PerVertexKHR"; + case DecorationNonUniform: return "NonUniform"; + case DecorationRestrictPointer: return "RestrictPointer"; + case DecorationAliasedPointer: return "AliasedPointer"; + case DecorationHitObjectShaderRecordBufferNV: return "HitObjectShaderRecordBufferNV"; + case DecorationBindlessSamplerNV: return "BindlessSamplerNV"; + case DecorationBindlessImageNV: return "BindlessImageNV"; + case DecorationBoundSamplerNV: return "BoundSamplerNV"; + case DecorationBoundImageNV: return "BoundImageNV"; + case DecorationSIMTCallINTEL: return "SIMTCallINTEL"; + case DecorationReferencedIndirectlyINTEL: return "ReferencedIndirectlyINTEL"; + case DecorationClobberINTEL: return "ClobberINTEL"; + case DecorationSideEffectsINTEL: return "SideEffectsINTEL"; + case DecorationVectorComputeVariableINTEL: return "VectorComputeVariableINTEL"; + case DecorationFuncParamIOKindINTEL: return "FuncParamIOKindINTEL"; + case DecorationVectorComputeFunctionINTEL: return "VectorComputeFunctionINTEL"; + case DecorationStackCallINTEL: return "StackCallINTEL"; + case DecorationGlobalVariableOffsetINTEL: return "GlobalVariableOffsetINTEL"; + case DecorationCounterBuffer: return "CounterBuffer"; + case DecorationHlslSemanticGOOGLE: return "HlslSemanticGOOGLE"; + case DecorationUserTypeGOOGLE: return "UserTypeGOOGLE"; + case DecorationFunctionRoundingModeINTEL: return "FunctionRoundingModeINTEL"; + case DecorationFunctionDenormModeINTEL: return "FunctionDenormModeINTEL"; + case DecorationRegisterINTEL: return "RegisterINTEL"; + case DecorationMemoryINTEL: return "MemoryINTEL"; + case DecorationNumbanksINTEL: return "NumbanksINTEL"; + case DecorationBankwidthINTEL: return "BankwidthINTEL"; + case DecorationMaxPrivateCopiesINTEL: return "MaxPrivateCopiesINTEL"; + case DecorationSinglepumpINTEL: return "SinglepumpINTEL"; + case DecorationDoublepumpINTEL: return "DoublepumpINTEL"; + case DecorationMaxReplicatesINTEL: return "MaxReplicatesINTEL"; + case DecorationSimpleDualPortINTEL: return "SimpleDualPortINTEL"; + case DecorationMergeINTEL: return "MergeINTEL"; + case DecorationBankBitsINTEL: return "BankBitsINTEL"; + case DecorationForcePow2DepthINTEL: return "ForcePow2DepthINTEL"; + case DecorationStridesizeINTEL: return "StridesizeINTEL"; + case DecorationWordsizeINTEL: return "WordsizeINTEL"; + case DecorationTrueDualPortINTEL: return "TrueDualPortINTEL"; + case DecorationBurstCoalesceINTEL: return "BurstCoalesceINTEL"; + case DecorationCacheSizeINTEL: return "CacheSizeINTEL"; + case DecorationDontStaticallyCoalesceINTEL: return "DontStaticallyCoalesceINTEL"; + case DecorationPrefetchINTEL: return "PrefetchINTEL"; + case DecorationStallEnableINTEL: return "StallEnableINTEL"; + case DecorationFuseLoopsInFunctionINTEL: return "FuseLoopsInFunctionINTEL"; + case DecorationMathOpDSPModeINTEL: return "MathOpDSPModeINTEL"; + case DecorationAliasScopeINTEL: return "AliasScopeINTEL"; + case DecorationNoAliasINTEL: return "NoAliasINTEL"; + case DecorationInitiationIntervalINTEL: return "InitiationIntervalINTEL"; + case DecorationMaxConcurrencyINTEL: return "MaxConcurrencyINTEL"; + case DecorationPipelineEnableINTEL: return "PipelineEnableINTEL"; + case DecorationBufferLocationINTEL: return "BufferLocationINTEL"; + case DecorationIOPipeStorageINTEL: return "IOPipeStorageINTEL"; + case DecorationFunctionFloatingPointModeINTEL: return "FunctionFloatingPointModeINTEL"; + case DecorationSingleElementVectorINTEL: return "SingleElementVectorINTEL"; + case DecorationVectorComputeCallableFunctionINTEL: return "VectorComputeCallableFunctionINTEL"; + case DecorationMediaBlockIOINTEL: return "MediaBlockIOINTEL"; + case DecorationStallFreeINTEL: return "StallFreeINTEL"; + case DecorationFPMaxErrorDecorationINTEL: return "FPMaxErrorDecorationINTEL"; + case DecorationLatencyControlLabelINTEL: return "LatencyControlLabelINTEL"; + case DecorationLatencyControlConstraintINTEL: return "LatencyControlConstraintINTEL"; + case DecorationConduitKernelArgumentINTEL: return "ConduitKernelArgumentINTEL"; + case DecorationRegisterMapKernelArgumentINTEL: return "RegisterMapKernelArgumentINTEL"; + case DecorationMMHostInterfaceAddressWidthINTEL: return "MMHostInterfaceAddressWidthINTEL"; + case DecorationMMHostInterfaceDataWidthINTEL: return "MMHostInterfaceDataWidthINTEL"; + case DecorationMMHostInterfaceLatencyINTEL: return "MMHostInterfaceLatencyINTEL"; + case DecorationMMHostInterfaceReadWriteModeINTEL: return "MMHostInterfaceReadWriteModeINTEL"; + case DecorationMMHostInterfaceMaxBurstINTEL: return "MMHostInterfaceMaxBurstINTEL"; + case DecorationMMHostInterfaceWaitRequestINTEL: return "MMHostInterfaceWaitRequestINTEL"; + case DecorationStableKernelArgumentINTEL: return "StableKernelArgumentINTEL"; + case DecorationHostAccessINTEL: return "HostAccessINTEL"; + case DecorationInitModeINTEL: return "InitModeINTEL"; + case DecorationImplementInRegisterMapINTEL: return "ImplementInRegisterMapINTEL"; + case DecorationConditionalINTEL: return "ConditionalINTEL"; + case DecorationCacheControlLoadINTEL: return "CacheControlLoadINTEL"; + case DecorationCacheControlStoreINTEL: return "CacheControlStoreINTEL"; + default: return "Unknown"; + } +} + +inline const char* BuiltInToString(BuiltIn value) { + switch (value) { + case BuiltInPosition: return "Position"; + case BuiltInPointSize: return "PointSize"; + case BuiltInClipDistance: return "ClipDistance"; + case BuiltInCullDistance: return "CullDistance"; + case BuiltInVertexId: return "VertexId"; + case BuiltInInstanceId: return "InstanceId"; + case BuiltInPrimitiveId: return "PrimitiveId"; + case BuiltInInvocationId: return "InvocationId"; + case BuiltInLayer: return "Layer"; + case BuiltInViewportIndex: return "ViewportIndex"; + case BuiltInTessLevelOuter: return "TessLevelOuter"; + case BuiltInTessLevelInner: return "TessLevelInner"; + case BuiltInTessCoord: return "TessCoord"; + case BuiltInPatchVertices: return "PatchVertices"; + case BuiltInFragCoord: return "FragCoord"; + case BuiltInPointCoord: return "PointCoord"; + case BuiltInFrontFacing: return "FrontFacing"; + case BuiltInSampleId: return "SampleId"; + case BuiltInSamplePosition: return "SamplePosition"; + case BuiltInSampleMask: return "SampleMask"; + case BuiltInFragDepth: return "FragDepth"; + case BuiltInHelperInvocation: return "HelperInvocation"; + case BuiltInNumWorkgroups: return "NumWorkgroups"; + case BuiltInWorkgroupSize: return "WorkgroupSize"; + case BuiltInWorkgroupId: return "WorkgroupId"; + case BuiltInLocalInvocationId: return "LocalInvocationId"; + case BuiltInGlobalInvocationId: return "GlobalInvocationId"; + case BuiltInLocalInvocationIndex: return "LocalInvocationIndex"; + case BuiltInWorkDim: return "WorkDim"; + case BuiltInGlobalSize: return "GlobalSize"; + case BuiltInEnqueuedWorkgroupSize: return "EnqueuedWorkgroupSize"; + case BuiltInGlobalOffset: return "GlobalOffset"; + case BuiltInGlobalLinearId: return "GlobalLinearId"; + case BuiltInSubgroupSize: return "SubgroupSize"; + case BuiltInSubgroupMaxSize: return "SubgroupMaxSize"; + case BuiltInNumSubgroups: return "NumSubgroups"; + case BuiltInNumEnqueuedSubgroups: return "NumEnqueuedSubgroups"; + case BuiltInSubgroupId: return "SubgroupId"; + case BuiltInSubgroupLocalInvocationId: return "SubgroupLocalInvocationId"; + case BuiltInVertexIndex: return "VertexIndex"; + case BuiltInInstanceIndex: return "InstanceIndex"; + case BuiltInCoreIDARM: return "CoreIDARM"; + case BuiltInCoreCountARM: return "CoreCountARM"; + case BuiltInCoreMaxIDARM: return "CoreMaxIDARM"; + case BuiltInWarpIDARM: return "WarpIDARM"; + case BuiltInWarpMaxIDARM: return "WarpMaxIDARM"; + case BuiltInSubgroupEqMask: return "SubgroupEqMask"; + case BuiltInSubgroupGeMask: return "SubgroupGeMask"; + case BuiltInSubgroupGtMask: return "SubgroupGtMask"; + case BuiltInSubgroupLeMask: return "SubgroupLeMask"; + case BuiltInSubgroupLtMask: return "SubgroupLtMask"; + case BuiltInBaseVertex: return "BaseVertex"; + case BuiltInBaseInstance: return "BaseInstance"; + case BuiltInDrawIndex: return "DrawIndex"; + case BuiltInPrimitiveShadingRateKHR: return "PrimitiveShadingRateKHR"; + case BuiltInDeviceIndex: return "DeviceIndex"; + case BuiltInViewIndex: return "ViewIndex"; + case BuiltInShadingRateKHR: return "ShadingRateKHR"; + case BuiltInTileOffsetQCOM: return "TileOffsetQCOM"; + case BuiltInTileDimensionQCOM: return "TileDimensionQCOM"; + case BuiltInTileApronSizeQCOM: return "TileApronSizeQCOM"; + case BuiltInBaryCoordNoPerspAMD: return "BaryCoordNoPerspAMD"; + case BuiltInBaryCoordNoPerspCentroidAMD: return "BaryCoordNoPerspCentroidAMD"; + case BuiltInBaryCoordNoPerspSampleAMD: return "BaryCoordNoPerspSampleAMD"; + case BuiltInBaryCoordSmoothAMD: return "BaryCoordSmoothAMD"; + case BuiltInBaryCoordSmoothCentroidAMD: return "BaryCoordSmoothCentroidAMD"; + case BuiltInBaryCoordSmoothSampleAMD: return "BaryCoordSmoothSampleAMD"; + case BuiltInBaryCoordPullModelAMD: return "BaryCoordPullModelAMD"; + case BuiltInFragStencilRefEXT: return "FragStencilRefEXT"; + case BuiltInRemainingRecursionLevelsAMDX: return "RemainingRecursionLevelsAMDX"; + case BuiltInShaderIndexAMDX: return "ShaderIndexAMDX"; + case BuiltInViewportMaskNV: return "ViewportMaskNV"; + case BuiltInSecondaryPositionNV: return "SecondaryPositionNV"; + case BuiltInSecondaryViewportMaskNV: return "SecondaryViewportMaskNV"; + case BuiltInPositionPerViewNV: return "PositionPerViewNV"; + case BuiltInViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; + case BuiltInFullyCoveredEXT: return "FullyCoveredEXT"; + case BuiltInTaskCountNV: return "TaskCountNV"; + case BuiltInPrimitiveCountNV: return "PrimitiveCountNV"; + case BuiltInPrimitiveIndicesNV: return "PrimitiveIndicesNV"; + case BuiltInClipDistancePerViewNV: return "ClipDistancePerViewNV"; + case BuiltInCullDistancePerViewNV: return "CullDistancePerViewNV"; + case BuiltInLayerPerViewNV: return "LayerPerViewNV"; + case BuiltInMeshViewCountNV: return "MeshViewCountNV"; + case BuiltInMeshViewIndicesNV: return "MeshViewIndicesNV"; + case BuiltInBaryCoordKHR: return "BaryCoordKHR"; + case BuiltInBaryCoordNoPerspKHR: return "BaryCoordNoPerspKHR"; + case BuiltInFragSizeEXT: return "FragSizeEXT"; + case BuiltInFragInvocationCountEXT: return "FragInvocationCountEXT"; + case BuiltInPrimitivePointIndicesEXT: return "PrimitivePointIndicesEXT"; + case BuiltInPrimitiveLineIndicesEXT: return "PrimitiveLineIndicesEXT"; + case BuiltInPrimitiveTriangleIndicesEXT: return "PrimitiveTriangleIndicesEXT"; + case BuiltInCullPrimitiveEXT: return "CullPrimitiveEXT"; + case BuiltInLaunchIdKHR: return "LaunchIdKHR"; + case BuiltInLaunchSizeKHR: return "LaunchSizeKHR"; + case BuiltInWorldRayOriginKHR: return "WorldRayOriginKHR"; + case BuiltInWorldRayDirectionKHR: return "WorldRayDirectionKHR"; + case BuiltInObjectRayOriginKHR: return "ObjectRayOriginKHR"; + case BuiltInObjectRayDirectionKHR: return "ObjectRayDirectionKHR"; + case BuiltInRayTminKHR: return "RayTminKHR"; + case BuiltInRayTmaxKHR: return "RayTmaxKHR"; + case BuiltInInstanceCustomIndexKHR: return "InstanceCustomIndexKHR"; + case BuiltInObjectToWorldKHR: return "ObjectToWorldKHR"; + case BuiltInWorldToObjectKHR: return "WorldToObjectKHR"; + case BuiltInHitTNV: return "HitTNV"; + case BuiltInHitKindKHR: return "HitKindKHR"; + case BuiltInCurrentRayTimeNV: return "CurrentRayTimeNV"; + case BuiltInHitTriangleVertexPositionsKHR: return "HitTriangleVertexPositionsKHR"; + case BuiltInHitMicroTriangleVertexPositionsNV: return "HitMicroTriangleVertexPositionsNV"; + case BuiltInHitMicroTriangleVertexBarycentricsNV: return "HitMicroTriangleVertexBarycentricsNV"; + case BuiltInIncomingRayFlagsKHR: return "IncomingRayFlagsKHR"; + case BuiltInRayGeometryIndexKHR: return "RayGeometryIndexKHR"; + case BuiltInHitIsSphereNV: return "HitIsSphereNV"; + case BuiltInHitIsLSSNV: return "HitIsLSSNV"; + case BuiltInHitSpherePositionNV: return "HitSpherePositionNV"; + case BuiltInWarpsPerSMNV: return "WarpsPerSMNV"; + case BuiltInSMCountNV: return "SMCountNV"; + case BuiltInWarpIDNV: return "WarpIDNV"; + case BuiltInSMIDNV: return "SMIDNV"; + case BuiltInHitLSSPositionsNV: return "HitLSSPositionsNV"; + case BuiltInHitKindFrontFacingMicroTriangleNV: return "HitKindFrontFacingMicroTriangleNV"; + case BuiltInHitKindBackFacingMicroTriangleNV: return "HitKindBackFacingMicroTriangleNV"; + case BuiltInHitSphereRadiusNV: return "HitSphereRadiusNV"; + case BuiltInHitLSSRadiiNV: return "HitLSSRadiiNV"; + case BuiltInClusterIDNV: return "ClusterIDNV"; + case BuiltInCullMaskKHR: return "CullMaskKHR"; + default: return "Unknown"; + } +} + +inline const char* ScopeToString(Scope value) { + switch (value) { + case ScopeCrossDevice: return "CrossDevice"; + case ScopeDevice: return "Device"; + case ScopeWorkgroup: return "Workgroup"; + case ScopeSubgroup: return "Subgroup"; + case ScopeInvocation: return "Invocation"; + case ScopeQueueFamily: return "QueueFamily"; + case ScopeShaderCallKHR: return "ShaderCallKHR"; + default: return "Unknown"; + } +} + +inline const char* GroupOperationToString(GroupOperation value) { + switch (value) { + case GroupOperationReduce: return "Reduce"; + case GroupOperationInclusiveScan: return "InclusiveScan"; + case GroupOperationExclusiveScan: return "ExclusiveScan"; + case GroupOperationClusteredReduce: return "ClusteredReduce"; + case GroupOperationPartitionedReduceNV: return "PartitionedReduceNV"; + case GroupOperationPartitionedInclusiveScanNV: return "PartitionedInclusiveScanNV"; + case GroupOperationPartitionedExclusiveScanNV: return "PartitionedExclusiveScanNV"; + default: return "Unknown"; + } +} + +inline const char* KernelEnqueueFlagsToString(KernelEnqueueFlags value) { + switch (value) { + case KernelEnqueueFlagsNoWait: return "NoWait"; + case KernelEnqueueFlagsWaitKernel: return "WaitKernel"; + case KernelEnqueueFlagsWaitWorkGroup: return "WaitWorkGroup"; + default: return "Unknown"; + } +} + +inline const char* CapabilityToString(Capability value) { + switch (value) { + case CapabilityMatrix: return "Matrix"; + case CapabilityShader: return "Shader"; + case CapabilityGeometry: return "Geometry"; + case CapabilityTessellation: return "Tessellation"; + case CapabilityAddresses: return "Addresses"; + case CapabilityLinkage: return "Linkage"; + case CapabilityKernel: return "Kernel"; + case CapabilityVector16: return "Vector16"; + case CapabilityFloat16Buffer: return "Float16Buffer"; + case CapabilityFloat16: return "Float16"; + case CapabilityFloat64: return "Float64"; + case CapabilityInt64: return "Int64"; + case CapabilityInt64Atomics: return "Int64Atomics"; + case CapabilityImageBasic: return "ImageBasic"; + case CapabilityImageReadWrite: return "ImageReadWrite"; + case CapabilityImageMipmap: return "ImageMipmap"; + case CapabilityPipes: return "Pipes"; + case CapabilityGroups: return "Groups"; + case CapabilityDeviceEnqueue: return "DeviceEnqueue"; + case CapabilityLiteralSampler: return "LiteralSampler"; + case CapabilityAtomicStorage: return "AtomicStorage"; + case CapabilityInt16: return "Int16"; + case CapabilityTessellationPointSize: return "TessellationPointSize"; + case CapabilityGeometryPointSize: return "GeometryPointSize"; + case CapabilityImageGatherExtended: return "ImageGatherExtended"; + case CapabilityStorageImageMultisample: return "StorageImageMultisample"; + case CapabilityUniformBufferArrayDynamicIndexing: return "UniformBufferArrayDynamicIndexing"; + case CapabilitySampledImageArrayDynamicIndexing: return "SampledImageArrayDynamicIndexing"; + case CapabilityStorageBufferArrayDynamicIndexing: return "StorageBufferArrayDynamicIndexing"; + case CapabilityStorageImageArrayDynamicIndexing: return "StorageImageArrayDynamicIndexing"; + case CapabilityClipDistance: return "ClipDistance"; + case CapabilityCullDistance: return "CullDistance"; + case CapabilityImageCubeArray: return "ImageCubeArray"; + case CapabilitySampleRateShading: return "SampleRateShading"; + case CapabilityImageRect: return "ImageRect"; + case CapabilitySampledRect: return "SampledRect"; + case CapabilityGenericPointer: return "GenericPointer"; + case CapabilityInt8: return "Int8"; + case CapabilityInputAttachment: return "InputAttachment"; + case CapabilitySparseResidency: return "SparseResidency"; + case CapabilityMinLod: return "MinLod"; + case CapabilitySampled1D: return "Sampled1D"; + case CapabilityImage1D: return "Image1D"; + case CapabilitySampledCubeArray: return "SampledCubeArray"; + case CapabilitySampledBuffer: return "SampledBuffer"; + case CapabilityImageBuffer: return "ImageBuffer"; + case CapabilityImageMSArray: return "ImageMSArray"; + case CapabilityStorageImageExtendedFormats: return "StorageImageExtendedFormats"; + case CapabilityImageQuery: return "ImageQuery"; + case CapabilityDerivativeControl: return "DerivativeControl"; + case CapabilityInterpolationFunction: return "InterpolationFunction"; + case CapabilityTransformFeedback: return "TransformFeedback"; + case CapabilityGeometryStreams: return "GeometryStreams"; + case CapabilityStorageImageReadWithoutFormat: return "StorageImageReadWithoutFormat"; + case CapabilityStorageImageWriteWithoutFormat: return "StorageImageWriteWithoutFormat"; + case CapabilityMultiViewport: return "MultiViewport"; + case CapabilitySubgroupDispatch: return "SubgroupDispatch"; + case CapabilityNamedBarrier: return "NamedBarrier"; + case CapabilityPipeStorage: return "PipeStorage"; + case CapabilityGroupNonUniform: return "GroupNonUniform"; + case CapabilityGroupNonUniformVote: return "GroupNonUniformVote"; + case CapabilityGroupNonUniformArithmetic: return "GroupNonUniformArithmetic"; + case CapabilityGroupNonUniformBallot: return "GroupNonUniformBallot"; + case CapabilityGroupNonUniformShuffle: return "GroupNonUniformShuffle"; + case CapabilityGroupNonUniformShuffleRelative: return "GroupNonUniformShuffleRelative"; + case CapabilityGroupNonUniformClustered: return "GroupNonUniformClustered"; + case CapabilityGroupNonUniformQuad: return "GroupNonUniformQuad"; + case CapabilityShaderLayer: return "ShaderLayer"; + case CapabilityShaderViewportIndex: return "ShaderViewportIndex"; + case CapabilityUniformDecoration: return "UniformDecoration"; + case CapabilityCoreBuiltinsARM: return "CoreBuiltinsARM"; + case CapabilityTileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT"; + case CapabilityTileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT"; + case CapabilityTileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT"; + case CapabilityTensorsARM: return "TensorsARM"; + case CapabilityStorageTensorArrayDynamicIndexingARM: return "StorageTensorArrayDynamicIndexingARM"; + case CapabilityStorageTensorArrayNonUniformIndexingARM: return "StorageTensorArrayNonUniformIndexingARM"; + case CapabilityGraphARM: return "GraphARM"; + case CapabilityCooperativeMatrixLayoutsARM: return "CooperativeMatrixLayoutsARM"; + case CapabilityFloat8EXT: return "Float8EXT"; + case CapabilityFloat8CooperativeMatrixEXT: return "Float8CooperativeMatrixEXT"; + case CapabilityFragmentShadingRateKHR: return "FragmentShadingRateKHR"; + case CapabilitySubgroupBallotKHR: return "SubgroupBallotKHR"; + case CapabilityDrawParameters: return "DrawParameters"; + case CapabilityWorkgroupMemoryExplicitLayoutKHR: return "WorkgroupMemoryExplicitLayoutKHR"; + case CapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR: return "WorkgroupMemoryExplicitLayout8BitAccessKHR"; + case CapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR: return "WorkgroupMemoryExplicitLayout16BitAccessKHR"; + case CapabilitySubgroupVoteKHR: return "SubgroupVoteKHR"; + case CapabilityStorageBuffer16BitAccess: return "StorageBuffer16BitAccess"; + case CapabilityStorageUniform16: return "StorageUniform16"; + case CapabilityStoragePushConstant16: return "StoragePushConstant16"; + case CapabilityStorageInputOutput16: return "StorageInputOutput16"; + case CapabilityDeviceGroup: return "DeviceGroup"; + case CapabilityMultiView: return "MultiView"; + case CapabilityVariablePointersStorageBuffer: return "VariablePointersStorageBuffer"; + case CapabilityVariablePointers: return "VariablePointers"; + case CapabilityAtomicStorageOps: return "AtomicStorageOps"; + case CapabilitySampleMaskPostDepthCoverage: return "SampleMaskPostDepthCoverage"; + case CapabilityStorageBuffer8BitAccess: return "StorageBuffer8BitAccess"; + case CapabilityUniformAndStorageBuffer8BitAccess: return "UniformAndStorageBuffer8BitAccess"; + case CapabilityStoragePushConstant8: return "StoragePushConstant8"; + case CapabilityDenormPreserve: return "DenormPreserve"; + case CapabilityDenormFlushToZero: return "DenormFlushToZero"; + case CapabilitySignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve"; + case CapabilityRoundingModeRTE: return "RoundingModeRTE"; + case CapabilityRoundingModeRTZ: return "RoundingModeRTZ"; + case CapabilityRayQueryProvisionalKHR: return "RayQueryProvisionalKHR"; + case CapabilityRayQueryKHR: return "RayQueryKHR"; + case CapabilityUntypedPointersKHR: return "UntypedPointersKHR"; + case CapabilityRayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR"; + case CapabilityRayTracingKHR: return "RayTracingKHR"; + case CapabilityTextureSampleWeightedQCOM: return "TextureSampleWeightedQCOM"; + case CapabilityTextureBoxFilterQCOM: return "TextureBoxFilterQCOM"; + case CapabilityTextureBlockMatchQCOM: return "TextureBlockMatchQCOM"; + case CapabilityTileShadingQCOM: return "TileShadingQCOM"; + case CapabilityCooperativeMatrixConversionQCOM: return "CooperativeMatrixConversionQCOM"; + case CapabilityTextureBlockMatch2QCOM: return "TextureBlockMatch2QCOM"; + case CapabilityFloat16ImageAMD: return "Float16ImageAMD"; + case CapabilityImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD"; + case CapabilityFragmentMaskAMD: return "FragmentMaskAMD"; + case CapabilityStencilExportEXT: return "StencilExportEXT"; + case CapabilityImageReadWriteLodAMD: return "ImageReadWriteLodAMD"; + case CapabilityInt64ImageEXT: return "Int64ImageEXT"; + case CapabilityShaderClockKHR: return "ShaderClockKHR"; + case CapabilityShaderEnqueueAMDX: return "ShaderEnqueueAMDX"; + case CapabilityQuadControlKHR: return "QuadControlKHR"; + case CapabilityInt4TypeINTEL: return "Int4TypeINTEL"; + case CapabilityInt4CooperativeMatrixINTEL: return "Int4CooperativeMatrixINTEL"; + case CapabilityBFloat16TypeKHR: return "BFloat16TypeKHR"; + case CapabilityBFloat16DotProductKHR: return "BFloat16DotProductKHR"; + case CapabilityBFloat16CooperativeMatrixKHR: return "BFloat16CooperativeMatrixKHR"; + case CapabilitySampleMaskOverrideCoverageNV: return "SampleMaskOverrideCoverageNV"; + case CapabilityGeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV"; + case CapabilityShaderViewportIndexLayerEXT: return "ShaderViewportIndexLayerEXT"; + case CapabilityShaderViewportMaskNV: return "ShaderViewportMaskNV"; + case CapabilityShaderStereoViewNV: return "ShaderStereoViewNV"; + case CapabilityPerViewAttributesNV: return "PerViewAttributesNV"; + case CapabilityFragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT"; + case CapabilityMeshShadingNV: return "MeshShadingNV"; + case CapabilityImageFootprintNV: return "ImageFootprintNV"; + case CapabilityMeshShadingEXT: return "MeshShadingEXT"; + case CapabilityFragmentBarycentricKHR: return "FragmentBarycentricKHR"; + case CapabilityComputeDerivativeGroupQuadsKHR: return "ComputeDerivativeGroupQuadsKHR"; + case CapabilityFragmentDensityEXT: return "FragmentDensityEXT"; + case CapabilityGroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV"; + case CapabilityShaderNonUniform: return "ShaderNonUniform"; + case CapabilityRuntimeDescriptorArray: return "RuntimeDescriptorArray"; + case CapabilityInputAttachmentArrayDynamicIndexing: return "InputAttachmentArrayDynamicIndexing"; + case CapabilityUniformTexelBufferArrayDynamicIndexing: return "UniformTexelBufferArrayDynamicIndexing"; + case CapabilityStorageTexelBufferArrayDynamicIndexing: return "StorageTexelBufferArrayDynamicIndexing"; + case CapabilityUniformBufferArrayNonUniformIndexing: return "UniformBufferArrayNonUniformIndexing"; + case CapabilitySampledImageArrayNonUniformIndexing: return "SampledImageArrayNonUniformIndexing"; + case CapabilityStorageBufferArrayNonUniformIndexing: return "StorageBufferArrayNonUniformIndexing"; + case CapabilityStorageImageArrayNonUniformIndexing: return "StorageImageArrayNonUniformIndexing"; + case CapabilityInputAttachmentArrayNonUniformIndexing: return "InputAttachmentArrayNonUniformIndexing"; + case CapabilityUniformTexelBufferArrayNonUniformIndexing: return "UniformTexelBufferArrayNonUniformIndexing"; + case CapabilityStorageTexelBufferArrayNonUniformIndexing: return "StorageTexelBufferArrayNonUniformIndexing"; + case CapabilityRayTracingPositionFetchKHR: return "RayTracingPositionFetchKHR"; + case CapabilityRayTracingNV: return "RayTracingNV"; + case CapabilityRayTracingMotionBlurNV: return "RayTracingMotionBlurNV"; + case CapabilityVulkanMemoryModel: return "VulkanMemoryModel"; + case CapabilityVulkanMemoryModelDeviceScope: return "VulkanMemoryModelDeviceScope"; + case CapabilityPhysicalStorageBufferAddresses: return "PhysicalStorageBufferAddresses"; + case CapabilityComputeDerivativeGroupLinearKHR: return "ComputeDerivativeGroupLinearKHR"; + case CapabilityRayTracingProvisionalKHR: return "RayTracingProvisionalKHR"; + case CapabilityCooperativeMatrixNV: return "CooperativeMatrixNV"; + case CapabilityFragmentShaderSampleInterlockEXT: return "FragmentShaderSampleInterlockEXT"; + case CapabilityFragmentShaderShadingRateInterlockEXT: return "FragmentShaderShadingRateInterlockEXT"; + case CapabilityShaderSMBuiltinsNV: return "ShaderSMBuiltinsNV"; + case CapabilityFragmentShaderPixelInterlockEXT: return "FragmentShaderPixelInterlockEXT"; + case CapabilityDemoteToHelperInvocation: return "DemoteToHelperInvocation"; + case CapabilityDisplacementMicromapNV: return "DisplacementMicromapNV"; + case CapabilityRayTracingOpacityMicromapEXT: return "RayTracingOpacityMicromapEXT"; + case CapabilityShaderInvocationReorderNV: return "ShaderInvocationReorderNV"; + case CapabilityBindlessTextureNV: return "BindlessTextureNV"; + case CapabilityRayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR"; + case CapabilityCooperativeVectorNV: return "CooperativeVectorNV"; + case CapabilityAtomicFloat16VectorNV: return "AtomicFloat16VectorNV"; + case CapabilityRayTracingDisplacementMicromapNV: return "RayTracingDisplacementMicromapNV"; + case CapabilityRawAccessChainsNV: return "RawAccessChainsNV"; + case CapabilityRayTracingSpheresGeometryNV: return "RayTracingSpheresGeometryNV"; + case CapabilityRayTracingLinearSweptSpheresGeometryNV: return "RayTracingLinearSweptSpheresGeometryNV"; + case CapabilityCooperativeMatrixReductionsNV: return "CooperativeMatrixReductionsNV"; + case CapabilityCooperativeMatrixConversionsNV: return "CooperativeMatrixConversionsNV"; + case CapabilityCooperativeMatrixPerElementOperationsNV: return "CooperativeMatrixPerElementOperationsNV"; + case CapabilityCooperativeMatrixTensorAddressingNV: return "CooperativeMatrixTensorAddressingNV"; + case CapabilityCooperativeMatrixBlockLoadsNV: return "CooperativeMatrixBlockLoadsNV"; + case CapabilityCooperativeVectorTrainingNV: return "CooperativeVectorTrainingNV"; + case CapabilityRayTracingClusterAccelerationStructureNV: return "RayTracingClusterAccelerationStructureNV"; + case CapabilityTensorAddressingNV: return "TensorAddressingNV"; + case CapabilitySubgroupShuffleINTEL: return "SubgroupShuffleINTEL"; + case CapabilitySubgroupBufferBlockIOINTEL: return "SubgroupBufferBlockIOINTEL"; + case CapabilitySubgroupImageBlockIOINTEL: return "SubgroupImageBlockIOINTEL"; + case CapabilitySubgroupImageMediaBlockIOINTEL: return "SubgroupImageMediaBlockIOINTEL"; + case CapabilityRoundToInfinityINTEL: return "RoundToInfinityINTEL"; + case CapabilityFloatingPointModeINTEL: return "FloatingPointModeINTEL"; + case CapabilityIntegerFunctions2INTEL: return "IntegerFunctions2INTEL"; + case CapabilityFunctionPointersINTEL: return "FunctionPointersINTEL"; + case CapabilityIndirectReferencesINTEL: return "IndirectReferencesINTEL"; + case CapabilityAsmINTEL: return "AsmINTEL"; + case CapabilityAtomicFloat32MinMaxEXT: return "AtomicFloat32MinMaxEXT"; + case CapabilityAtomicFloat64MinMaxEXT: return "AtomicFloat64MinMaxEXT"; + case CapabilityAtomicFloat16MinMaxEXT: return "AtomicFloat16MinMaxEXT"; + case CapabilityVectorComputeINTEL: return "VectorComputeINTEL"; + case CapabilityVectorAnyINTEL: return "VectorAnyINTEL"; + case CapabilityExpectAssumeKHR: return "ExpectAssumeKHR"; + case CapabilitySubgroupAvcMotionEstimationINTEL: return "SubgroupAvcMotionEstimationINTEL"; + case CapabilitySubgroupAvcMotionEstimationIntraINTEL: return "SubgroupAvcMotionEstimationIntraINTEL"; + case CapabilitySubgroupAvcMotionEstimationChromaINTEL: return "SubgroupAvcMotionEstimationChromaINTEL"; + case CapabilityVariableLengthArrayINTEL: return "VariableLengthArrayINTEL"; + case CapabilityFunctionFloatControlINTEL: return "FunctionFloatControlINTEL"; + case CapabilityFPGAMemoryAttributesINTEL: return "FPGAMemoryAttributesINTEL"; + case CapabilityFPFastMathModeINTEL: return "FPFastMathModeINTEL"; + case CapabilityArbitraryPrecisionIntegersINTEL: return "ArbitraryPrecisionIntegersINTEL"; + case CapabilityArbitraryPrecisionFloatingPointINTEL: return "ArbitraryPrecisionFloatingPointINTEL"; + case CapabilityUnstructuredLoopControlsINTEL: return "UnstructuredLoopControlsINTEL"; + case CapabilityFPGALoopControlsINTEL: return "FPGALoopControlsINTEL"; + case CapabilityKernelAttributesINTEL: return "KernelAttributesINTEL"; + case CapabilityFPGAKernelAttributesINTEL: return "FPGAKernelAttributesINTEL"; + case CapabilityFPGAMemoryAccessesINTEL: return "FPGAMemoryAccessesINTEL"; + case CapabilityFPGAClusterAttributesINTEL: return "FPGAClusterAttributesINTEL"; + case CapabilityLoopFuseINTEL: return "LoopFuseINTEL"; + case CapabilityFPGADSPControlINTEL: return "FPGADSPControlINTEL"; + case CapabilityMemoryAccessAliasingINTEL: return "MemoryAccessAliasingINTEL"; + case CapabilityFPGAInvocationPipeliningAttributesINTEL: return "FPGAInvocationPipeliningAttributesINTEL"; + case CapabilityFPGABufferLocationINTEL: return "FPGABufferLocationINTEL"; + case CapabilityArbitraryPrecisionFixedPointINTEL: return "ArbitraryPrecisionFixedPointINTEL"; + case CapabilityUSMStorageClassesINTEL: return "USMStorageClassesINTEL"; + case CapabilityRuntimeAlignedAttributeINTEL: return "RuntimeAlignedAttributeINTEL"; + case CapabilityIOPipesINTEL: return "IOPipesINTEL"; + case CapabilityBlockingPipesINTEL: return "BlockingPipesINTEL"; + case CapabilityFPGARegINTEL: return "FPGARegINTEL"; + case CapabilityDotProductInputAll: return "DotProductInputAll"; + case CapabilityDotProductInput4x8Bit: return "DotProductInput4x8Bit"; + case CapabilityDotProductInput4x8BitPacked: return "DotProductInput4x8BitPacked"; + case CapabilityDotProduct: return "DotProduct"; + case CapabilityRayCullMaskKHR: return "RayCullMaskKHR"; + case CapabilityCooperativeMatrixKHR: return "CooperativeMatrixKHR"; + case CapabilityReplicatedCompositesEXT: return "ReplicatedCompositesEXT"; + case CapabilityBitInstructions: return "BitInstructions"; + case CapabilityGroupNonUniformRotateKHR: return "GroupNonUniformRotateKHR"; + case CapabilityFloatControls2: return "FloatControls2"; + case CapabilityFMAKHR: return "FMAKHR"; + case CapabilityAtomicFloat32AddEXT: return "AtomicFloat32AddEXT"; + case CapabilityAtomicFloat64AddEXT: return "AtomicFloat64AddEXT"; + case CapabilityLongCompositesINTEL: return "LongCompositesINTEL"; + case CapabilityOptNoneEXT: return "OptNoneEXT"; + case CapabilityAtomicFloat16AddEXT: return "AtomicFloat16AddEXT"; + case CapabilityDebugInfoModuleINTEL: return "DebugInfoModuleINTEL"; + case CapabilityBFloat16ConversionINTEL: return "BFloat16ConversionINTEL"; + case CapabilitySplitBarrierINTEL: return "SplitBarrierINTEL"; + case CapabilityArithmeticFenceEXT: return "ArithmeticFenceEXT"; + case CapabilityFPGAClusterAttributesV2INTEL: return "FPGAClusterAttributesV2INTEL"; + case CapabilityFPGAKernelAttributesv2INTEL: return "FPGAKernelAttributesv2INTEL"; + case CapabilityTaskSequenceINTEL: return "TaskSequenceINTEL"; + case CapabilityFPMaxErrorINTEL: return "FPMaxErrorINTEL"; + case CapabilityFPGALatencyControlINTEL: return "FPGALatencyControlINTEL"; + case CapabilityFPGAArgumentInterfacesINTEL: return "FPGAArgumentInterfacesINTEL"; + case CapabilityGlobalVariableHostAccessINTEL: return "GlobalVariableHostAccessINTEL"; + case CapabilityGlobalVariableFPGADecorationsINTEL: return "GlobalVariableFPGADecorationsINTEL"; + case CapabilitySubgroupBufferPrefetchINTEL: return "SubgroupBufferPrefetchINTEL"; + case CapabilitySubgroup2DBlockIOINTEL: return "Subgroup2DBlockIOINTEL"; + case CapabilitySubgroup2DBlockTransformINTEL: return "Subgroup2DBlockTransformINTEL"; + case CapabilitySubgroup2DBlockTransposeINTEL: return "Subgroup2DBlockTransposeINTEL"; + case CapabilitySubgroupMatrixMultiplyAccumulateINTEL: return "SubgroupMatrixMultiplyAccumulateINTEL"; + case CapabilityTernaryBitwiseFunctionINTEL: return "TernaryBitwiseFunctionINTEL"; + case CapabilityUntypedVariableLengthArrayINTEL: return "UntypedVariableLengthArrayINTEL"; + case CapabilitySpecConditionalINTEL: return "SpecConditionalINTEL"; + case CapabilityFunctionVariantsINTEL: return "FunctionVariantsINTEL"; + case CapabilityGroupUniformArithmeticKHR: return "GroupUniformArithmeticKHR"; + case CapabilityTensorFloat32RoundingINTEL: return "TensorFloat32RoundingINTEL"; + case CapabilityMaskedGatherScatterINTEL: return "MaskedGatherScatterINTEL"; + case CapabilityCacheControlsINTEL: return "CacheControlsINTEL"; + case CapabilityRegisterLimitsINTEL: return "RegisterLimitsINTEL"; + case CapabilityBindlessImagesINTEL: return "BindlessImagesINTEL"; + default: return "Unknown"; + } +} + +inline const char* RayQueryIntersectionToString(RayQueryIntersection value) { + switch (value) { + case RayQueryIntersectionRayQueryCandidateIntersectionKHR: return "RayQueryCandidateIntersectionKHR"; + case RayQueryIntersectionRayQueryCommittedIntersectionKHR: return "RayQueryCommittedIntersectionKHR"; + default: return "Unknown"; + } +} + +inline const char* RayQueryCommittedIntersectionTypeToString(RayQueryCommittedIntersectionType value) { + switch (value) { + case RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionNoneKHR: return "RayQueryCommittedIntersectionNoneKHR"; + case RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionTriangleKHR: return "RayQueryCommittedIntersectionTriangleKHR"; + case RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionGeneratedKHR: return "RayQueryCommittedIntersectionGeneratedKHR"; + default: return "Unknown"; + } +} + +inline const char* RayQueryCandidateIntersectionTypeToString(RayQueryCandidateIntersectionType value) { + switch (value) { + case RayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionTriangleKHR: return "RayQueryCandidateIntersectionTriangleKHR"; + case RayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionAABBKHR: return "RayQueryCandidateIntersectionAABBKHR"; + default: return "Unknown"; + } +} + +inline const char* FPDenormModeToString(FPDenormMode value) { + switch (value) { + case FPDenormModePreserve: return "Preserve"; + case FPDenormModeFlushToZero: return "FlushToZero"; + default: return "Unknown"; + } +} + +inline const char* FPOperationModeToString(FPOperationMode value) { + switch (value) { + case FPOperationModeIEEE: return "IEEE"; + case FPOperationModeALT: return "ALT"; + default: return "Unknown"; + } +} + +inline const char* QuantizationModesToString(QuantizationModes value) { + switch (value) { + case QuantizationModesTRN: return "TRN"; + case QuantizationModesTRN_ZERO: return "TRN_ZERO"; + case QuantizationModesRND: return "RND"; + case QuantizationModesRND_ZERO: return "RND_ZERO"; + case QuantizationModesRND_INF: return "RND_INF"; + case QuantizationModesRND_MIN_INF: return "RND_MIN_INF"; + case QuantizationModesRND_CONV: return "RND_CONV"; + case QuantizationModesRND_CONV_ODD: return "RND_CONV_ODD"; + default: return "Unknown"; + } +} + +inline const char* OverflowModesToString(OverflowModes value) { + switch (value) { + case OverflowModesWRAP: return "WRAP"; + case OverflowModesSAT: return "SAT"; + case OverflowModesSAT_ZERO: return "SAT_ZERO"; + case OverflowModesSAT_SYM: return "SAT_SYM"; + default: return "Unknown"; + } +} + +inline const char* PackedVectorFormatToString(PackedVectorFormat value) { + switch (value) { + case PackedVectorFormatPackedVectorFormat4x8Bit: return "PackedVectorFormat4x8Bit"; + default: return "Unknown"; + } +} + +inline const char* CooperativeMatrixLayoutToString(CooperativeMatrixLayout value) { + switch (value) { + case CooperativeMatrixLayoutRowMajorKHR: return "RowMajorKHR"; + case CooperativeMatrixLayoutColumnMajorKHR: return "ColumnMajorKHR"; + case CooperativeMatrixLayoutRowBlockedInterleavedARM: return "RowBlockedInterleavedARM"; + case CooperativeMatrixLayoutColumnBlockedInterleavedARM: return "ColumnBlockedInterleavedARM"; + default: return "Unknown"; + } +} + +inline const char* CooperativeMatrixUseToString(CooperativeMatrixUse value) { + switch (value) { + case CooperativeMatrixUseMatrixAKHR: return "MatrixAKHR"; + case CooperativeMatrixUseMatrixBKHR: return "MatrixBKHR"; + case CooperativeMatrixUseMatrixAccumulatorKHR: return "MatrixAccumulatorKHR"; + default: return "Unknown"; + } +} + +inline const char* TensorClampModeToString(TensorClampMode value) { + switch (value) { + case TensorClampModeUndefined: return "Undefined"; + case TensorClampModeConstant: return "Constant"; + case TensorClampModeClampToEdge: return "ClampToEdge"; + case TensorClampModeRepeat: return "Repeat"; + case TensorClampModeRepeatMirrored: return "RepeatMirrored"; + default: return "Unknown"; + } +} + +inline const char* InitializationModeQualifierToString(InitializationModeQualifier value) { + switch (value) { + case InitializationModeQualifierInitOnDeviceReprogramINTEL: return "InitOnDeviceReprogramINTEL"; + case InitializationModeQualifierInitOnDeviceResetINTEL: return "InitOnDeviceResetINTEL"; + default: return "Unknown"; + } +} + +inline const char* HostAccessQualifierToString(HostAccessQualifier value) { + switch (value) { + case HostAccessQualifierNoneINTEL: return "NoneINTEL"; + case HostAccessQualifierReadINTEL: return "ReadINTEL"; + case HostAccessQualifierWriteINTEL: return "WriteINTEL"; + case HostAccessQualifierReadWriteINTEL: return "ReadWriteINTEL"; + default: return "Unknown"; + } +} + +inline const char* LoadCacheControlToString(LoadCacheControl value) { + switch (value) { + case LoadCacheControlUncachedINTEL: return "UncachedINTEL"; + case LoadCacheControlCachedINTEL: return "CachedINTEL"; + case LoadCacheControlStreamingINTEL: return "StreamingINTEL"; + case LoadCacheControlInvalidateAfterReadINTEL: return "InvalidateAfterReadINTEL"; + case LoadCacheControlConstCachedINTEL: return "ConstCachedINTEL"; + default: return "Unknown"; + } +} + +inline const char* StoreCacheControlToString(StoreCacheControl value) { + switch (value) { + case StoreCacheControlUncachedINTEL: return "UncachedINTEL"; + case StoreCacheControlWriteThroughINTEL: return "WriteThroughINTEL"; + case StoreCacheControlWriteBackINTEL: return "WriteBackINTEL"; + case StoreCacheControlStreamingINTEL: return "StreamingINTEL"; + default: return "Unknown"; + } +} + +inline const char* NamedMaximumNumberOfRegistersToString(NamedMaximumNumberOfRegisters value) { + switch (value) { + case NamedMaximumNumberOfRegistersAutoINTEL: return "AutoINTEL"; + default: return "Unknown"; + } +} + +inline const char* FPEncodingToString(FPEncoding value) { + switch (value) { + case FPEncodingBFloat16KHR: return "BFloat16KHR"; + case FPEncodingFloat8E4M3EXT: return "Float8E4M3EXT"; + case FPEncodingFloat8E5M2EXT: return "Float8E5M2EXT"; + default: return "Unknown"; + } +} + +inline const char* CooperativeVectorMatrixLayoutToString(CooperativeVectorMatrixLayout value) { + switch (value) { + case CooperativeVectorMatrixLayoutRowMajorNV: return "RowMajorNV"; + case CooperativeVectorMatrixLayoutColumnMajorNV: return "ColumnMajorNV"; + case CooperativeVectorMatrixLayoutInferencingOptimalNV: return "InferencingOptimalNV"; + case CooperativeVectorMatrixLayoutTrainingOptimalNV: return "TrainingOptimalNV"; + default: return "Unknown"; + } +} + +inline const char* ComponentTypeToString(ComponentType value) { + switch (value) { + case ComponentTypeFloat16NV: return "Float16NV"; + case ComponentTypeFloat32NV: return "Float32NV"; + case ComponentTypeFloat64NV: return "Float64NV"; + case ComponentTypeSignedInt8NV: return "SignedInt8NV"; + case ComponentTypeSignedInt16NV: return "SignedInt16NV"; + case ComponentTypeSignedInt32NV: return "SignedInt32NV"; + case ComponentTypeSignedInt64NV: return "SignedInt64NV"; + case ComponentTypeUnsignedInt8NV: return "UnsignedInt8NV"; + case ComponentTypeUnsignedInt16NV: return "UnsignedInt16NV"; + case ComponentTypeUnsignedInt32NV: return "UnsignedInt32NV"; + case ComponentTypeUnsignedInt64NV: return "UnsignedInt64NV"; + case ComponentTypeSignedInt8PackedNV: return "SignedInt8PackedNV"; + case ComponentTypeUnsignedInt8PackedNV: return "UnsignedInt8PackedNV"; + case ComponentTypeFloatE4M3NV: return "FloatE4M3NV"; + case ComponentTypeFloatE5M2NV: return "FloatE5M2NV"; + default: return "Unknown"; + } +} + +inline const char* OpToString(Op value) { + switch (value) { + case OpNop: return "OpNop"; + case OpUndef: return "OpUndef"; + case OpSourceContinued: return "OpSourceContinued"; + case OpSource: return "OpSource"; + case OpSourceExtension: return "OpSourceExtension"; + case OpName: return "OpName"; + case OpMemberName: return "OpMemberName"; + case OpString: return "OpString"; + case OpLine: return "OpLine"; + case OpExtension: return "OpExtension"; + case OpExtInstImport: return "OpExtInstImport"; + case OpExtInst: return "OpExtInst"; + case OpMemoryModel: return "OpMemoryModel"; + case OpEntryPoint: return "OpEntryPoint"; + case OpExecutionMode: return "OpExecutionMode"; + case OpCapability: return "OpCapability"; + case OpTypeVoid: return "OpTypeVoid"; + case OpTypeBool: return "OpTypeBool"; + case OpTypeInt: return "OpTypeInt"; + case OpTypeFloat: return "OpTypeFloat"; + case OpTypeVector: return "OpTypeVector"; + case OpTypeMatrix: return "OpTypeMatrix"; + case OpTypeImage: return "OpTypeImage"; + case OpTypeSampler: return "OpTypeSampler"; + case OpTypeSampledImage: return "OpTypeSampledImage"; + case OpTypeArray: return "OpTypeArray"; + case OpTypeRuntimeArray: return "OpTypeRuntimeArray"; + case OpTypeStruct: return "OpTypeStruct"; + case OpTypeOpaque: return "OpTypeOpaque"; + case OpTypePointer: return "OpTypePointer"; + case OpTypeFunction: return "OpTypeFunction"; + case OpTypeEvent: return "OpTypeEvent"; + case OpTypeDeviceEvent: return "OpTypeDeviceEvent"; + case OpTypeReserveId: return "OpTypeReserveId"; + case OpTypeQueue: return "OpTypeQueue"; + case OpTypePipe: return "OpTypePipe"; + case OpTypeForwardPointer: return "OpTypeForwardPointer"; + case OpConstantTrue: return "OpConstantTrue"; + case OpConstantFalse: return "OpConstantFalse"; + case OpConstant: return "OpConstant"; + case OpConstantComposite: return "OpConstantComposite"; + case OpConstantSampler: return "OpConstantSampler"; + case OpConstantNull: return "OpConstantNull"; + case OpSpecConstantTrue: return "OpSpecConstantTrue"; + case OpSpecConstantFalse: return "OpSpecConstantFalse"; + case OpSpecConstant: return "OpSpecConstant"; + case OpSpecConstantComposite: return "OpSpecConstantComposite"; + case OpSpecConstantOp: return "OpSpecConstantOp"; + case OpFunction: return "OpFunction"; + case OpFunctionParameter: return "OpFunctionParameter"; + case OpFunctionEnd: return "OpFunctionEnd"; + case OpFunctionCall: return "OpFunctionCall"; + case OpVariable: return "OpVariable"; + case OpImageTexelPointer: return "OpImageTexelPointer"; + case OpLoad: return "OpLoad"; + case OpStore: return "OpStore"; + case OpCopyMemory: return "OpCopyMemory"; + case OpCopyMemorySized: return "OpCopyMemorySized"; + case OpAccessChain: return "OpAccessChain"; + case OpInBoundsAccessChain: return "OpInBoundsAccessChain"; + case OpPtrAccessChain: return "OpPtrAccessChain"; + case OpArrayLength: return "OpArrayLength"; + case OpGenericPtrMemSemantics: return "OpGenericPtrMemSemantics"; + case OpInBoundsPtrAccessChain: return "OpInBoundsPtrAccessChain"; + case OpDecorate: return "OpDecorate"; + case OpMemberDecorate: return "OpMemberDecorate"; + case OpDecorationGroup: return "OpDecorationGroup"; + case OpGroupDecorate: return "OpGroupDecorate"; + case OpGroupMemberDecorate: return "OpGroupMemberDecorate"; + case OpVectorExtractDynamic: return "OpVectorExtractDynamic"; + case OpVectorInsertDynamic: return "OpVectorInsertDynamic"; + case OpVectorShuffle: return "OpVectorShuffle"; + case OpCompositeConstruct: return "OpCompositeConstruct"; + case OpCompositeExtract: return "OpCompositeExtract"; + case OpCompositeInsert: return "OpCompositeInsert"; + case OpCopyObject: return "OpCopyObject"; + case OpTranspose: return "OpTranspose"; + case OpSampledImage: return "OpSampledImage"; + case OpImageSampleImplicitLod: return "OpImageSampleImplicitLod"; + case OpImageSampleExplicitLod: return "OpImageSampleExplicitLod"; + case OpImageSampleDrefImplicitLod: return "OpImageSampleDrefImplicitLod"; + case OpImageSampleDrefExplicitLod: return "OpImageSampleDrefExplicitLod"; + case OpImageSampleProjImplicitLod: return "OpImageSampleProjImplicitLod"; + case OpImageSampleProjExplicitLod: return "OpImageSampleProjExplicitLod"; + case OpImageSampleProjDrefImplicitLod: return "OpImageSampleProjDrefImplicitLod"; + case OpImageSampleProjDrefExplicitLod: return "OpImageSampleProjDrefExplicitLod"; + case OpImageFetch: return "OpImageFetch"; + case OpImageGather: return "OpImageGather"; + case OpImageDrefGather: return "OpImageDrefGather"; + case OpImageRead: return "OpImageRead"; + case OpImageWrite: return "OpImageWrite"; + case OpImage: return "OpImage"; + case OpImageQueryFormat: return "OpImageQueryFormat"; + case OpImageQueryOrder: return "OpImageQueryOrder"; + case OpImageQuerySizeLod: return "OpImageQuerySizeLod"; + case OpImageQuerySize: return "OpImageQuerySize"; + case OpImageQueryLod: return "OpImageQueryLod"; + case OpImageQueryLevels: return "OpImageQueryLevels"; + case OpImageQuerySamples: return "OpImageQuerySamples"; + case OpConvertFToU: return "OpConvertFToU"; + case OpConvertFToS: return "OpConvertFToS"; + case OpConvertSToF: return "OpConvertSToF"; + case OpConvertUToF: return "OpConvertUToF"; + case OpUConvert: return "OpUConvert"; + case OpSConvert: return "OpSConvert"; + case OpFConvert: return "OpFConvert"; + case OpQuantizeToF16: return "OpQuantizeToF16"; + case OpConvertPtrToU: return "OpConvertPtrToU"; + case OpSatConvertSToU: return "OpSatConvertSToU"; + case OpSatConvertUToS: return "OpSatConvertUToS"; + case OpConvertUToPtr: return "OpConvertUToPtr"; + case OpPtrCastToGeneric: return "OpPtrCastToGeneric"; + case OpGenericCastToPtr: return "OpGenericCastToPtr"; + case OpGenericCastToPtrExplicit: return "OpGenericCastToPtrExplicit"; + case OpBitcast: return "OpBitcast"; + case OpSNegate: return "OpSNegate"; + case OpFNegate: return "OpFNegate"; + case OpIAdd: return "OpIAdd"; + case OpFAdd: return "OpFAdd"; + case OpISub: return "OpISub"; + case OpFSub: return "OpFSub"; + case OpIMul: return "OpIMul"; + case OpFMul: return "OpFMul"; + case OpUDiv: return "OpUDiv"; + case OpSDiv: return "OpSDiv"; + case OpFDiv: return "OpFDiv"; + case OpUMod: return "OpUMod"; + case OpSRem: return "OpSRem"; + case OpSMod: return "OpSMod"; + case OpFRem: return "OpFRem"; + case OpFMod: return "OpFMod"; + case OpVectorTimesScalar: return "OpVectorTimesScalar"; + case OpMatrixTimesScalar: return "OpMatrixTimesScalar"; + case OpVectorTimesMatrix: return "OpVectorTimesMatrix"; + case OpMatrixTimesVector: return "OpMatrixTimesVector"; + case OpMatrixTimesMatrix: return "OpMatrixTimesMatrix"; + case OpOuterProduct: return "OpOuterProduct"; + case OpDot: return "OpDot"; + case OpIAddCarry: return "OpIAddCarry"; + case OpISubBorrow: return "OpISubBorrow"; + case OpUMulExtended: return "OpUMulExtended"; + case OpSMulExtended: return "OpSMulExtended"; + case OpAny: return "OpAny"; + case OpAll: return "OpAll"; + case OpIsNan: return "OpIsNan"; + case OpIsInf: return "OpIsInf"; + case OpIsFinite: return "OpIsFinite"; + case OpIsNormal: return "OpIsNormal"; + case OpSignBitSet: return "OpSignBitSet"; + case OpLessOrGreater: return "OpLessOrGreater"; + case OpOrdered: return "OpOrdered"; + case OpUnordered: return "OpUnordered"; + case OpLogicalEqual: return "OpLogicalEqual"; + case OpLogicalNotEqual: return "OpLogicalNotEqual"; + case OpLogicalOr: return "OpLogicalOr"; + case OpLogicalAnd: return "OpLogicalAnd"; + case OpLogicalNot: return "OpLogicalNot"; + case OpSelect: return "OpSelect"; + case OpIEqual: return "OpIEqual"; + case OpINotEqual: return "OpINotEqual"; + case OpUGreaterThan: return "OpUGreaterThan"; + case OpSGreaterThan: return "OpSGreaterThan"; + case OpUGreaterThanEqual: return "OpUGreaterThanEqual"; + case OpSGreaterThanEqual: return "OpSGreaterThanEqual"; + case OpULessThan: return "OpULessThan"; + case OpSLessThan: return "OpSLessThan"; + case OpULessThanEqual: return "OpULessThanEqual"; + case OpSLessThanEqual: return "OpSLessThanEqual"; + case OpFOrdEqual: return "OpFOrdEqual"; + case OpFUnordEqual: return "OpFUnordEqual"; + case OpFOrdNotEqual: return "OpFOrdNotEqual"; + case OpFUnordNotEqual: return "OpFUnordNotEqual"; + case OpFOrdLessThan: return "OpFOrdLessThan"; + case OpFUnordLessThan: return "OpFUnordLessThan"; + case OpFOrdGreaterThan: return "OpFOrdGreaterThan"; + case OpFUnordGreaterThan: return "OpFUnordGreaterThan"; + case OpFOrdLessThanEqual: return "OpFOrdLessThanEqual"; + case OpFUnordLessThanEqual: return "OpFUnordLessThanEqual"; + case OpFOrdGreaterThanEqual: return "OpFOrdGreaterThanEqual"; + case OpFUnordGreaterThanEqual: return "OpFUnordGreaterThanEqual"; + case OpShiftRightLogical: return "OpShiftRightLogical"; + case OpShiftRightArithmetic: return "OpShiftRightArithmetic"; + case OpShiftLeftLogical: return "OpShiftLeftLogical"; + case OpBitwiseOr: return "OpBitwiseOr"; + case OpBitwiseXor: return "OpBitwiseXor"; + case OpBitwiseAnd: return "OpBitwiseAnd"; + case OpNot: return "OpNot"; + case OpBitFieldInsert: return "OpBitFieldInsert"; + case OpBitFieldSExtract: return "OpBitFieldSExtract"; + case OpBitFieldUExtract: return "OpBitFieldUExtract"; + case OpBitReverse: return "OpBitReverse"; + case OpBitCount: return "OpBitCount"; + case OpDPdx: return "OpDPdx"; + case OpDPdy: return "OpDPdy"; + case OpFwidth: return "OpFwidth"; + case OpDPdxFine: return "OpDPdxFine"; + case OpDPdyFine: return "OpDPdyFine"; + case OpFwidthFine: return "OpFwidthFine"; + case OpDPdxCoarse: return "OpDPdxCoarse"; + case OpDPdyCoarse: return "OpDPdyCoarse"; + case OpFwidthCoarse: return "OpFwidthCoarse"; + case OpEmitVertex: return "OpEmitVertex"; + case OpEndPrimitive: return "OpEndPrimitive"; + case OpEmitStreamVertex: return "OpEmitStreamVertex"; + case OpEndStreamPrimitive: return "OpEndStreamPrimitive"; + case OpControlBarrier: return "OpControlBarrier"; + case OpMemoryBarrier: return "OpMemoryBarrier"; + case OpAtomicLoad: return "OpAtomicLoad"; + case OpAtomicStore: return "OpAtomicStore"; + case OpAtomicExchange: return "OpAtomicExchange"; + case OpAtomicCompareExchange: return "OpAtomicCompareExchange"; + case OpAtomicCompareExchangeWeak: return "OpAtomicCompareExchangeWeak"; + case OpAtomicIIncrement: return "OpAtomicIIncrement"; + case OpAtomicIDecrement: return "OpAtomicIDecrement"; + case OpAtomicIAdd: return "OpAtomicIAdd"; + case OpAtomicISub: return "OpAtomicISub"; + case OpAtomicSMin: return "OpAtomicSMin"; + case OpAtomicUMin: return "OpAtomicUMin"; + case OpAtomicSMax: return "OpAtomicSMax"; + case OpAtomicUMax: return "OpAtomicUMax"; + case OpAtomicAnd: return "OpAtomicAnd"; + case OpAtomicOr: return "OpAtomicOr"; + case OpAtomicXor: return "OpAtomicXor"; + case OpPhi: return "OpPhi"; + case OpLoopMerge: return "OpLoopMerge"; + case OpSelectionMerge: return "OpSelectionMerge"; + case OpLabel: return "OpLabel"; + case OpBranch: return "OpBranch"; + case OpBranchConditional: return "OpBranchConditional"; + case OpSwitch: return "OpSwitch"; + case OpKill: return "OpKill"; + case OpReturn: return "OpReturn"; + case OpReturnValue: return "OpReturnValue"; + case OpUnreachable: return "OpUnreachable"; + case OpLifetimeStart: return "OpLifetimeStart"; + case OpLifetimeStop: return "OpLifetimeStop"; + case OpGroupAsyncCopy: return "OpGroupAsyncCopy"; + case OpGroupWaitEvents: return "OpGroupWaitEvents"; + case OpGroupAll: return "OpGroupAll"; + case OpGroupAny: return "OpGroupAny"; + case OpGroupBroadcast: return "OpGroupBroadcast"; + case OpGroupIAdd: return "OpGroupIAdd"; + case OpGroupFAdd: return "OpGroupFAdd"; + case OpGroupFMin: return "OpGroupFMin"; + case OpGroupUMin: return "OpGroupUMin"; + case OpGroupSMin: return "OpGroupSMin"; + case OpGroupFMax: return "OpGroupFMax"; + case OpGroupUMax: return "OpGroupUMax"; + case OpGroupSMax: return "OpGroupSMax"; + case OpReadPipe: return "OpReadPipe"; + case OpWritePipe: return "OpWritePipe"; + case OpReservedReadPipe: return "OpReservedReadPipe"; + case OpReservedWritePipe: return "OpReservedWritePipe"; + case OpReserveReadPipePackets: return "OpReserveReadPipePackets"; + case OpReserveWritePipePackets: return "OpReserveWritePipePackets"; + case OpCommitReadPipe: return "OpCommitReadPipe"; + case OpCommitWritePipe: return "OpCommitWritePipe"; + case OpIsValidReserveId: return "OpIsValidReserveId"; + case OpGetNumPipePackets: return "OpGetNumPipePackets"; + case OpGetMaxPipePackets: return "OpGetMaxPipePackets"; + case OpGroupReserveReadPipePackets: return "OpGroupReserveReadPipePackets"; + case OpGroupReserveWritePipePackets: return "OpGroupReserveWritePipePackets"; + case OpGroupCommitReadPipe: return "OpGroupCommitReadPipe"; + case OpGroupCommitWritePipe: return "OpGroupCommitWritePipe"; + case OpEnqueueMarker: return "OpEnqueueMarker"; + case OpEnqueueKernel: return "OpEnqueueKernel"; + case OpGetKernelNDrangeSubGroupCount: return "OpGetKernelNDrangeSubGroupCount"; + case OpGetKernelNDrangeMaxSubGroupSize: return "OpGetKernelNDrangeMaxSubGroupSize"; + case OpGetKernelWorkGroupSize: return "OpGetKernelWorkGroupSize"; + case OpGetKernelPreferredWorkGroupSizeMultiple: return "OpGetKernelPreferredWorkGroupSizeMultiple"; + case OpRetainEvent: return "OpRetainEvent"; + case OpReleaseEvent: return "OpReleaseEvent"; + case OpCreateUserEvent: return "OpCreateUserEvent"; + case OpIsValidEvent: return "OpIsValidEvent"; + case OpSetUserEventStatus: return "OpSetUserEventStatus"; + case OpCaptureEventProfilingInfo: return "OpCaptureEventProfilingInfo"; + case OpGetDefaultQueue: return "OpGetDefaultQueue"; + case OpBuildNDRange: return "OpBuildNDRange"; + case OpImageSparseSampleImplicitLod: return "OpImageSparseSampleImplicitLod"; + case OpImageSparseSampleExplicitLod: return "OpImageSparseSampleExplicitLod"; + case OpImageSparseSampleDrefImplicitLod: return "OpImageSparseSampleDrefImplicitLod"; + case OpImageSparseSampleDrefExplicitLod: return "OpImageSparseSampleDrefExplicitLod"; + case OpImageSparseSampleProjImplicitLod: return "OpImageSparseSampleProjImplicitLod"; + case OpImageSparseSampleProjExplicitLod: return "OpImageSparseSampleProjExplicitLod"; + case OpImageSparseSampleProjDrefImplicitLod: return "OpImageSparseSampleProjDrefImplicitLod"; + case OpImageSparseSampleProjDrefExplicitLod: return "OpImageSparseSampleProjDrefExplicitLod"; + case OpImageSparseFetch: return "OpImageSparseFetch"; + case OpImageSparseGather: return "OpImageSparseGather"; + case OpImageSparseDrefGather: return "OpImageSparseDrefGather"; + case OpImageSparseTexelsResident: return "OpImageSparseTexelsResident"; + case OpNoLine: return "OpNoLine"; + case OpAtomicFlagTestAndSet: return "OpAtomicFlagTestAndSet"; + case OpAtomicFlagClear: return "OpAtomicFlagClear"; + case OpImageSparseRead: return "OpImageSparseRead"; + case OpSizeOf: return "OpSizeOf"; + case OpTypePipeStorage: return "OpTypePipeStorage"; + case OpConstantPipeStorage: return "OpConstantPipeStorage"; + case OpCreatePipeFromPipeStorage: return "OpCreatePipeFromPipeStorage"; + case OpGetKernelLocalSizeForSubgroupCount: return "OpGetKernelLocalSizeForSubgroupCount"; + case OpGetKernelMaxNumSubgroups: return "OpGetKernelMaxNumSubgroups"; + case OpTypeNamedBarrier: return "OpTypeNamedBarrier"; + case OpNamedBarrierInitialize: return "OpNamedBarrierInitialize"; + case OpMemoryNamedBarrier: return "OpMemoryNamedBarrier"; + case OpModuleProcessed: return "OpModuleProcessed"; + case OpExecutionModeId: return "OpExecutionModeId"; + case OpDecorateId: return "OpDecorateId"; + case OpGroupNonUniformElect: return "OpGroupNonUniformElect"; + case OpGroupNonUniformAll: return "OpGroupNonUniformAll"; + case OpGroupNonUniformAny: return "OpGroupNonUniformAny"; + case OpGroupNonUniformAllEqual: return "OpGroupNonUniformAllEqual"; + case OpGroupNonUniformBroadcast: return "OpGroupNonUniformBroadcast"; + case OpGroupNonUniformBroadcastFirst: return "OpGroupNonUniformBroadcastFirst"; + case OpGroupNonUniformBallot: return "OpGroupNonUniformBallot"; + case OpGroupNonUniformInverseBallot: return "OpGroupNonUniformInverseBallot"; + case OpGroupNonUniformBallotBitExtract: return "OpGroupNonUniformBallotBitExtract"; + case OpGroupNonUniformBallotBitCount: return "OpGroupNonUniformBallotBitCount"; + case OpGroupNonUniformBallotFindLSB: return "OpGroupNonUniformBallotFindLSB"; + case OpGroupNonUniformBallotFindMSB: return "OpGroupNonUniformBallotFindMSB"; + case OpGroupNonUniformShuffle: return "OpGroupNonUniformShuffle"; + case OpGroupNonUniformShuffleXor: return "OpGroupNonUniformShuffleXor"; + case OpGroupNonUniformShuffleUp: return "OpGroupNonUniformShuffleUp"; + case OpGroupNonUniformShuffleDown: return "OpGroupNonUniformShuffleDown"; + case OpGroupNonUniformIAdd: return "OpGroupNonUniformIAdd"; + case OpGroupNonUniformFAdd: return "OpGroupNonUniformFAdd"; + case OpGroupNonUniformIMul: return "OpGroupNonUniformIMul"; + case OpGroupNonUniformFMul: return "OpGroupNonUniformFMul"; + case OpGroupNonUniformSMin: return "OpGroupNonUniformSMin"; + case OpGroupNonUniformUMin: return "OpGroupNonUniformUMin"; + case OpGroupNonUniformFMin: return "OpGroupNonUniformFMin"; + case OpGroupNonUniformSMax: return "OpGroupNonUniformSMax"; + case OpGroupNonUniformUMax: return "OpGroupNonUniformUMax"; + case OpGroupNonUniformFMax: return "OpGroupNonUniformFMax"; + case OpGroupNonUniformBitwiseAnd: return "OpGroupNonUniformBitwiseAnd"; + case OpGroupNonUniformBitwiseOr: return "OpGroupNonUniformBitwiseOr"; + case OpGroupNonUniformBitwiseXor: return "OpGroupNonUniformBitwiseXor"; + case OpGroupNonUniformLogicalAnd: return "OpGroupNonUniformLogicalAnd"; + case OpGroupNonUniformLogicalOr: return "OpGroupNonUniformLogicalOr"; + case OpGroupNonUniformLogicalXor: return "OpGroupNonUniformLogicalXor"; + case OpGroupNonUniformQuadBroadcast: return "OpGroupNonUniformQuadBroadcast"; + case OpGroupNonUniformQuadSwap: return "OpGroupNonUniformQuadSwap"; + case OpCopyLogical: return "OpCopyLogical"; + case OpPtrEqual: return "OpPtrEqual"; + case OpPtrNotEqual: return "OpPtrNotEqual"; + case OpPtrDiff: return "OpPtrDiff"; + case OpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT"; + case OpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT"; + case OpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT"; + case OpTypeTensorARM: return "OpTypeTensorARM"; + case OpTensorReadARM: return "OpTensorReadARM"; + case OpTensorWriteARM: return "OpTensorWriteARM"; + case OpTensorQuerySizeARM: return "OpTensorQuerySizeARM"; + case OpGraphConstantARM: return "OpGraphConstantARM"; + case OpGraphEntryPointARM: return "OpGraphEntryPointARM"; + case OpGraphARM: return "OpGraphARM"; + case OpGraphInputARM: return "OpGraphInputARM"; + case OpGraphSetOutputARM: return "OpGraphSetOutputARM"; + case OpGraphEndARM: return "OpGraphEndARM"; + case OpTypeGraphARM: return "OpTypeGraphARM"; + case OpTerminateInvocation: return "OpTerminateInvocation"; + case OpTypeUntypedPointerKHR: return "OpTypeUntypedPointerKHR"; + case OpUntypedVariableKHR: return "OpUntypedVariableKHR"; + case OpUntypedAccessChainKHR: return "OpUntypedAccessChainKHR"; + case OpUntypedInBoundsAccessChainKHR: return "OpUntypedInBoundsAccessChainKHR"; + case OpSubgroupBallotKHR: return "OpSubgroupBallotKHR"; + case OpSubgroupFirstInvocationKHR: return "OpSubgroupFirstInvocationKHR"; + case OpUntypedPtrAccessChainKHR: return "OpUntypedPtrAccessChainKHR"; + case OpUntypedInBoundsPtrAccessChainKHR: return "OpUntypedInBoundsPtrAccessChainKHR"; + case OpUntypedArrayLengthKHR: return "OpUntypedArrayLengthKHR"; + case OpUntypedPrefetchKHR: return "OpUntypedPrefetchKHR"; + case OpFmaKHR: return "OpFmaKHR"; + case OpSubgroupAllKHR: return "OpSubgroupAllKHR"; + case OpSubgroupAnyKHR: return "OpSubgroupAnyKHR"; + case OpSubgroupAllEqualKHR: return "OpSubgroupAllEqualKHR"; + case OpGroupNonUniformRotateKHR: return "OpGroupNonUniformRotateKHR"; + case OpSubgroupReadInvocationKHR: return "OpSubgroupReadInvocationKHR"; + case OpExtInstWithForwardRefsKHR: return "OpExtInstWithForwardRefsKHR"; + case OpUntypedGroupAsyncCopyKHR: return "OpUntypedGroupAsyncCopyKHR"; + case OpTraceRayKHR: return "OpTraceRayKHR"; + case OpExecuteCallableKHR: return "OpExecuteCallableKHR"; + case OpConvertUToAccelerationStructureKHR: return "OpConvertUToAccelerationStructureKHR"; + case OpIgnoreIntersectionKHR: return "OpIgnoreIntersectionKHR"; + case OpTerminateRayKHR: return "OpTerminateRayKHR"; + case OpSDot: return "OpSDot"; + case OpUDot: return "OpUDot"; + case OpSUDot: return "OpSUDot"; + case OpSDotAccSat: return "OpSDotAccSat"; + case OpUDotAccSat: return "OpUDotAccSat"; + case OpSUDotAccSat: return "OpSUDotAccSat"; + case OpTypeCooperativeMatrixKHR: return "OpTypeCooperativeMatrixKHR"; + case OpCooperativeMatrixLoadKHR: return "OpCooperativeMatrixLoadKHR"; + case OpCooperativeMatrixStoreKHR: return "OpCooperativeMatrixStoreKHR"; + case OpCooperativeMatrixMulAddKHR: return "OpCooperativeMatrixMulAddKHR"; + case OpCooperativeMatrixLengthKHR: return "OpCooperativeMatrixLengthKHR"; + case OpConstantCompositeReplicateEXT: return "OpConstantCompositeReplicateEXT"; + case OpSpecConstantCompositeReplicateEXT: return "OpSpecConstantCompositeReplicateEXT"; + case OpCompositeConstructReplicateEXT: return "OpCompositeConstructReplicateEXT"; + case OpTypeRayQueryKHR: return "OpTypeRayQueryKHR"; + case OpRayQueryInitializeKHR: return "OpRayQueryInitializeKHR"; + case OpRayQueryTerminateKHR: return "OpRayQueryTerminateKHR"; + case OpRayQueryGenerateIntersectionKHR: return "OpRayQueryGenerateIntersectionKHR"; + case OpRayQueryConfirmIntersectionKHR: return "OpRayQueryConfirmIntersectionKHR"; + case OpRayQueryProceedKHR: return "OpRayQueryProceedKHR"; + case OpRayQueryGetIntersectionTypeKHR: return "OpRayQueryGetIntersectionTypeKHR"; + case OpImageSampleWeightedQCOM: return "OpImageSampleWeightedQCOM"; + case OpImageBoxFilterQCOM: return "OpImageBoxFilterQCOM"; + case OpImageBlockMatchSSDQCOM: return "OpImageBlockMatchSSDQCOM"; + case OpImageBlockMatchSADQCOM: return "OpImageBlockMatchSADQCOM"; + case OpBitCastArrayQCOM: return "OpBitCastArrayQCOM"; + case OpImageBlockMatchWindowSSDQCOM: return "OpImageBlockMatchWindowSSDQCOM"; + case OpImageBlockMatchWindowSADQCOM: return "OpImageBlockMatchWindowSADQCOM"; + case OpImageBlockMatchGatherSSDQCOM: return "OpImageBlockMatchGatherSSDQCOM"; + case OpImageBlockMatchGatherSADQCOM: return "OpImageBlockMatchGatherSADQCOM"; + case OpCompositeConstructCoopMatQCOM: return "OpCompositeConstructCoopMatQCOM"; + case OpCompositeExtractCoopMatQCOM: return "OpCompositeExtractCoopMatQCOM"; + case OpExtractSubArrayQCOM: return "OpExtractSubArrayQCOM"; + case OpGroupIAddNonUniformAMD: return "OpGroupIAddNonUniformAMD"; + case OpGroupFAddNonUniformAMD: return "OpGroupFAddNonUniformAMD"; + case OpGroupFMinNonUniformAMD: return "OpGroupFMinNonUniformAMD"; + case OpGroupUMinNonUniformAMD: return "OpGroupUMinNonUniformAMD"; + case OpGroupSMinNonUniformAMD: return "OpGroupSMinNonUniformAMD"; + case OpGroupFMaxNonUniformAMD: return "OpGroupFMaxNonUniformAMD"; + case OpGroupUMaxNonUniformAMD: return "OpGroupUMaxNonUniformAMD"; + case OpGroupSMaxNonUniformAMD: return "OpGroupSMaxNonUniformAMD"; + case OpFragmentMaskFetchAMD: return "OpFragmentMaskFetchAMD"; + case OpFragmentFetchAMD: return "OpFragmentFetchAMD"; + case OpReadClockKHR: return "OpReadClockKHR"; + case OpAllocateNodePayloadsAMDX: return "OpAllocateNodePayloadsAMDX"; + case OpEnqueueNodePayloadsAMDX: return "OpEnqueueNodePayloadsAMDX"; + case OpTypeNodePayloadArrayAMDX: return "OpTypeNodePayloadArrayAMDX"; + case OpFinishWritingNodePayloadAMDX: return "OpFinishWritingNodePayloadAMDX"; + case OpNodePayloadArrayLengthAMDX: return "OpNodePayloadArrayLengthAMDX"; + case OpIsNodePayloadValidAMDX: return "OpIsNodePayloadValidAMDX"; + case OpConstantStringAMDX: return "OpConstantStringAMDX"; + case OpSpecConstantStringAMDX: return "OpSpecConstantStringAMDX"; + case OpGroupNonUniformQuadAllKHR: return "OpGroupNonUniformQuadAllKHR"; + case OpGroupNonUniformQuadAnyKHR: return "OpGroupNonUniformQuadAnyKHR"; + case OpHitObjectRecordHitMotionNV: return "OpHitObjectRecordHitMotionNV"; + case OpHitObjectRecordHitWithIndexMotionNV: return "OpHitObjectRecordHitWithIndexMotionNV"; + case OpHitObjectRecordMissMotionNV: return "OpHitObjectRecordMissMotionNV"; + case OpHitObjectGetWorldToObjectNV: return "OpHitObjectGetWorldToObjectNV"; + case OpHitObjectGetObjectToWorldNV: return "OpHitObjectGetObjectToWorldNV"; + case OpHitObjectGetObjectRayDirectionNV: return "OpHitObjectGetObjectRayDirectionNV"; + case OpHitObjectGetObjectRayOriginNV: return "OpHitObjectGetObjectRayOriginNV"; + case OpHitObjectTraceRayMotionNV: return "OpHitObjectTraceRayMotionNV"; + case OpHitObjectGetShaderRecordBufferHandleNV: return "OpHitObjectGetShaderRecordBufferHandleNV"; + case OpHitObjectGetShaderBindingTableRecordIndexNV: return "OpHitObjectGetShaderBindingTableRecordIndexNV"; + case OpHitObjectRecordEmptyNV: return "OpHitObjectRecordEmptyNV"; + case OpHitObjectTraceRayNV: return "OpHitObjectTraceRayNV"; + case OpHitObjectRecordHitNV: return "OpHitObjectRecordHitNV"; + case OpHitObjectRecordHitWithIndexNV: return "OpHitObjectRecordHitWithIndexNV"; + case OpHitObjectRecordMissNV: return "OpHitObjectRecordMissNV"; + case OpHitObjectExecuteShaderNV: return "OpHitObjectExecuteShaderNV"; + case OpHitObjectGetCurrentTimeNV: return "OpHitObjectGetCurrentTimeNV"; + case OpHitObjectGetAttributesNV: return "OpHitObjectGetAttributesNV"; + case OpHitObjectGetHitKindNV: return "OpHitObjectGetHitKindNV"; + case OpHitObjectGetPrimitiveIndexNV: return "OpHitObjectGetPrimitiveIndexNV"; + case OpHitObjectGetGeometryIndexNV: return "OpHitObjectGetGeometryIndexNV"; + case OpHitObjectGetInstanceIdNV: return "OpHitObjectGetInstanceIdNV"; + case OpHitObjectGetInstanceCustomIndexNV: return "OpHitObjectGetInstanceCustomIndexNV"; + case OpHitObjectGetWorldRayDirectionNV: return "OpHitObjectGetWorldRayDirectionNV"; + case OpHitObjectGetWorldRayOriginNV: return "OpHitObjectGetWorldRayOriginNV"; + case OpHitObjectGetRayTMaxNV: return "OpHitObjectGetRayTMaxNV"; + case OpHitObjectGetRayTMinNV: return "OpHitObjectGetRayTMinNV"; + case OpHitObjectIsEmptyNV: return "OpHitObjectIsEmptyNV"; + case OpHitObjectIsHitNV: return "OpHitObjectIsHitNV"; + case OpHitObjectIsMissNV: return "OpHitObjectIsMissNV"; + case OpReorderThreadWithHitObjectNV: return "OpReorderThreadWithHitObjectNV"; + case OpReorderThreadWithHintNV: return "OpReorderThreadWithHintNV"; + case OpTypeHitObjectNV: return "OpTypeHitObjectNV"; + case OpImageSampleFootprintNV: return "OpImageSampleFootprintNV"; + case OpTypeCooperativeVectorNV: return "OpTypeCooperativeVectorNV"; + case OpCooperativeVectorMatrixMulNV: return "OpCooperativeVectorMatrixMulNV"; + case OpCooperativeVectorOuterProductAccumulateNV: return "OpCooperativeVectorOuterProductAccumulateNV"; + case OpCooperativeVectorReduceSumAccumulateNV: return "OpCooperativeVectorReduceSumAccumulateNV"; + case OpCooperativeVectorMatrixMulAddNV: return "OpCooperativeVectorMatrixMulAddNV"; + case OpCooperativeMatrixConvertNV: return "OpCooperativeMatrixConvertNV"; + case OpEmitMeshTasksEXT: return "OpEmitMeshTasksEXT"; + case OpSetMeshOutputsEXT: return "OpSetMeshOutputsEXT"; + case OpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV"; + case OpWritePackedPrimitiveIndices4x8NV: return "OpWritePackedPrimitiveIndices4x8NV"; + case OpFetchMicroTriangleVertexPositionNV: return "OpFetchMicroTriangleVertexPositionNV"; + case OpFetchMicroTriangleVertexBarycentricNV: return "OpFetchMicroTriangleVertexBarycentricNV"; + case OpCooperativeVectorLoadNV: return "OpCooperativeVectorLoadNV"; + case OpCooperativeVectorStoreNV: return "OpCooperativeVectorStoreNV"; + case OpReportIntersectionKHR: return "OpReportIntersectionKHR"; + case OpIgnoreIntersectionNV: return "OpIgnoreIntersectionNV"; + case OpTerminateRayNV: return "OpTerminateRayNV"; + case OpTraceNV: return "OpTraceNV"; + case OpTraceMotionNV: return "OpTraceMotionNV"; + case OpTraceRayMotionNV: return "OpTraceRayMotionNV"; + case OpRayQueryGetIntersectionTriangleVertexPositionsKHR: return "OpRayQueryGetIntersectionTriangleVertexPositionsKHR"; + case OpTypeAccelerationStructureKHR: return "OpTypeAccelerationStructureKHR"; + case OpExecuteCallableNV: return "OpExecuteCallableNV"; + case OpRayQueryGetClusterIdNV: return "OpRayQueryGetClusterIdNV"; + case OpHitObjectGetClusterIdNV: return "OpHitObjectGetClusterIdNV"; + case OpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV"; + case OpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV"; + case OpCooperativeMatrixStoreNV: return "OpCooperativeMatrixStoreNV"; + case OpCooperativeMatrixMulAddNV: return "OpCooperativeMatrixMulAddNV"; + case OpCooperativeMatrixLengthNV: return "OpCooperativeMatrixLengthNV"; + case OpBeginInvocationInterlockEXT: return "OpBeginInvocationInterlockEXT"; + case OpEndInvocationInterlockEXT: return "OpEndInvocationInterlockEXT"; + case OpCooperativeMatrixReduceNV: return "OpCooperativeMatrixReduceNV"; + case OpCooperativeMatrixLoadTensorNV: return "OpCooperativeMatrixLoadTensorNV"; + case OpCooperativeMatrixStoreTensorNV: return "OpCooperativeMatrixStoreTensorNV"; + case OpCooperativeMatrixPerElementOpNV: return "OpCooperativeMatrixPerElementOpNV"; + case OpTypeTensorLayoutNV: return "OpTypeTensorLayoutNV"; + case OpTypeTensorViewNV: return "OpTypeTensorViewNV"; + case OpCreateTensorLayoutNV: return "OpCreateTensorLayoutNV"; + case OpTensorLayoutSetDimensionNV: return "OpTensorLayoutSetDimensionNV"; + case OpTensorLayoutSetStrideNV: return "OpTensorLayoutSetStrideNV"; + case OpTensorLayoutSliceNV: return "OpTensorLayoutSliceNV"; + case OpTensorLayoutSetClampValueNV: return "OpTensorLayoutSetClampValueNV"; + case OpCreateTensorViewNV: return "OpCreateTensorViewNV"; + case OpTensorViewSetDimensionNV: return "OpTensorViewSetDimensionNV"; + case OpTensorViewSetStrideNV: return "OpTensorViewSetStrideNV"; + case OpDemoteToHelperInvocation: return "OpDemoteToHelperInvocation"; + case OpIsHelperInvocationEXT: return "OpIsHelperInvocationEXT"; + case OpTensorViewSetClipNV: return "OpTensorViewSetClipNV"; + case OpTensorLayoutSetBlockSizeNV: return "OpTensorLayoutSetBlockSizeNV"; + case OpCooperativeMatrixTransposeNV: return "OpCooperativeMatrixTransposeNV"; + case OpConvertUToImageNV: return "OpConvertUToImageNV"; + case OpConvertUToSamplerNV: return "OpConvertUToSamplerNV"; + case OpConvertImageToUNV: return "OpConvertImageToUNV"; + case OpConvertSamplerToUNV: return "OpConvertSamplerToUNV"; + case OpConvertUToSampledImageNV: return "OpConvertUToSampledImageNV"; + case OpConvertSampledImageToUNV: return "OpConvertSampledImageToUNV"; + case OpSamplerImageAddressingModeNV: return "OpSamplerImageAddressingModeNV"; + case OpRawAccessChainNV: return "OpRawAccessChainNV"; + case OpRayQueryGetIntersectionSpherePositionNV: return "OpRayQueryGetIntersectionSpherePositionNV"; + case OpRayQueryGetIntersectionSphereRadiusNV: return "OpRayQueryGetIntersectionSphereRadiusNV"; + case OpRayQueryGetIntersectionLSSPositionsNV: return "OpRayQueryGetIntersectionLSSPositionsNV"; + case OpRayQueryGetIntersectionLSSRadiiNV: return "OpRayQueryGetIntersectionLSSRadiiNV"; + case OpRayQueryGetIntersectionLSSHitValueNV: return "OpRayQueryGetIntersectionLSSHitValueNV"; + case OpHitObjectGetSpherePositionNV: return "OpHitObjectGetSpherePositionNV"; + case OpHitObjectGetSphereRadiusNV: return "OpHitObjectGetSphereRadiusNV"; + case OpHitObjectGetLSSPositionsNV: return "OpHitObjectGetLSSPositionsNV"; + case OpHitObjectGetLSSRadiiNV: return "OpHitObjectGetLSSRadiiNV"; + case OpHitObjectIsSphereHitNV: return "OpHitObjectIsSphereHitNV"; + case OpHitObjectIsLSSHitNV: return "OpHitObjectIsLSSHitNV"; + case OpRayQueryIsSphereHitNV: return "OpRayQueryIsSphereHitNV"; + case OpRayQueryIsLSSHitNV: return "OpRayQueryIsLSSHitNV"; + case OpSubgroupShuffleINTEL: return "OpSubgroupShuffleINTEL"; + case OpSubgroupShuffleDownINTEL: return "OpSubgroupShuffleDownINTEL"; + case OpSubgroupShuffleUpINTEL: return "OpSubgroupShuffleUpINTEL"; + case OpSubgroupShuffleXorINTEL: return "OpSubgroupShuffleXorINTEL"; + case OpSubgroupBlockReadINTEL: return "OpSubgroupBlockReadINTEL"; + case OpSubgroupBlockWriteINTEL: return "OpSubgroupBlockWriteINTEL"; + case OpSubgroupImageBlockReadINTEL: return "OpSubgroupImageBlockReadINTEL"; + case OpSubgroupImageBlockWriteINTEL: return "OpSubgroupImageBlockWriteINTEL"; + case OpSubgroupImageMediaBlockReadINTEL: return "OpSubgroupImageMediaBlockReadINTEL"; + case OpSubgroupImageMediaBlockWriteINTEL: return "OpSubgroupImageMediaBlockWriteINTEL"; + case OpUCountLeadingZerosINTEL: return "OpUCountLeadingZerosINTEL"; + case OpUCountTrailingZerosINTEL: return "OpUCountTrailingZerosINTEL"; + case OpAbsISubINTEL: return "OpAbsISubINTEL"; + case OpAbsUSubINTEL: return "OpAbsUSubINTEL"; + case OpIAddSatINTEL: return "OpIAddSatINTEL"; + case OpUAddSatINTEL: return "OpUAddSatINTEL"; + case OpIAverageINTEL: return "OpIAverageINTEL"; + case OpUAverageINTEL: return "OpUAverageINTEL"; + case OpIAverageRoundedINTEL: return "OpIAverageRoundedINTEL"; + case OpUAverageRoundedINTEL: return "OpUAverageRoundedINTEL"; + case OpISubSatINTEL: return "OpISubSatINTEL"; + case OpUSubSatINTEL: return "OpUSubSatINTEL"; + case OpIMul32x16INTEL: return "OpIMul32x16INTEL"; + case OpUMul32x16INTEL: return "OpUMul32x16INTEL"; + case OpConstantFunctionPointerINTEL: return "OpConstantFunctionPointerINTEL"; + case OpFunctionPointerCallINTEL: return "OpFunctionPointerCallINTEL"; + case OpAsmTargetINTEL: return "OpAsmTargetINTEL"; + case OpAsmINTEL: return "OpAsmINTEL"; + case OpAsmCallINTEL: return "OpAsmCallINTEL"; + case OpAtomicFMinEXT: return "OpAtomicFMinEXT"; + case OpAtomicFMaxEXT: return "OpAtomicFMaxEXT"; + case OpAssumeTrueKHR: return "OpAssumeTrueKHR"; + case OpExpectKHR: return "OpExpectKHR"; + case OpDecorateString: return "OpDecorateString"; + case OpMemberDecorateString: return "OpMemberDecorateString"; + case OpVmeImageINTEL: return "OpVmeImageINTEL"; + case OpTypeVmeImageINTEL: return "OpTypeVmeImageINTEL"; + case OpTypeAvcImePayloadINTEL: return "OpTypeAvcImePayloadINTEL"; + case OpTypeAvcRefPayloadINTEL: return "OpTypeAvcRefPayloadINTEL"; + case OpTypeAvcSicPayloadINTEL: return "OpTypeAvcSicPayloadINTEL"; + case OpTypeAvcMcePayloadINTEL: return "OpTypeAvcMcePayloadINTEL"; + case OpTypeAvcMceResultINTEL: return "OpTypeAvcMceResultINTEL"; + case OpTypeAvcImeResultINTEL: return "OpTypeAvcImeResultINTEL"; + case OpTypeAvcImeResultSingleReferenceStreamoutINTEL: return "OpTypeAvcImeResultSingleReferenceStreamoutINTEL"; + case OpTypeAvcImeResultDualReferenceStreamoutINTEL: return "OpTypeAvcImeResultDualReferenceStreamoutINTEL"; + case OpTypeAvcImeSingleReferenceStreaminINTEL: return "OpTypeAvcImeSingleReferenceStreaminINTEL"; + case OpTypeAvcImeDualReferenceStreaminINTEL: return "OpTypeAvcImeDualReferenceStreaminINTEL"; + case OpTypeAvcRefResultINTEL: return "OpTypeAvcRefResultINTEL"; + case OpTypeAvcSicResultINTEL: return "OpTypeAvcSicResultINTEL"; + case OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL"; + case OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL"; + case OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL"; + case OpSubgroupAvcMceSetInterShapePenaltyINTEL: return "OpSubgroupAvcMceSetInterShapePenaltyINTEL"; + case OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL"; + case OpSubgroupAvcMceSetInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceSetInterDirectionPenaltyINTEL"; + case OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL"; + case OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: return "OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL"; + case OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL"; + case OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL"; + case OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL"; + case OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: return "OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL"; + case OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL"; + case OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL"; + case OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL"; + case OpSubgroupAvcMceSetAcOnlyHaarINTEL: return "OpSubgroupAvcMceSetAcOnlyHaarINTEL"; + case OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL"; + case OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL"; + case OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL"; + case OpSubgroupAvcMceConvertToImePayloadINTEL: return "OpSubgroupAvcMceConvertToImePayloadINTEL"; + case OpSubgroupAvcMceConvertToImeResultINTEL: return "OpSubgroupAvcMceConvertToImeResultINTEL"; + case OpSubgroupAvcMceConvertToRefPayloadINTEL: return "OpSubgroupAvcMceConvertToRefPayloadINTEL"; + case OpSubgroupAvcMceConvertToRefResultINTEL: return "OpSubgroupAvcMceConvertToRefResultINTEL"; + case OpSubgroupAvcMceConvertToSicPayloadINTEL: return "OpSubgroupAvcMceConvertToSicPayloadINTEL"; + case OpSubgroupAvcMceConvertToSicResultINTEL: return "OpSubgroupAvcMceConvertToSicResultINTEL"; + case OpSubgroupAvcMceGetMotionVectorsINTEL: return "OpSubgroupAvcMceGetMotionVectorsINTEL"; + case OpSubgroupAvcMceGetInterDistortionsINTEL: return "OpSubgroupAvcMceGetInterDistortionsINTEL"; + case OpSubgroupAvcMceGetBestInterDistortionsINTEL: return "OpSubgroupAvcMceGetBestInterDistortionsINTEL"; + case OpSubgroupAvcMceGetInterMajorShapeINTEL: return "OpSubgroupAvcMceGetInterMajorShapeINTEL"; + case OpSubgroupAvcMceGetInterMinorShapeINTEL: return "OpSubgroupAvcMceGetInterMinorShapeINTEL"; + case OpSubgroupAvcMceGetInterDirectionsINTEL: return "OpSubgroupAvcMceGetInterDirectionsINTEL"; + case OpSubgroupAvcMceGetInterMotionVectorCountINTEL: return "OpSubgroupAvcMceGetInterMotionVectorCountINTEL"; + case OpSubgroupAvcMceGetInterReferenceIdsINTEL: return "OpSubgroupAvcMceGetInterReferenceIdsINTEL"; + case OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL"; + case OpSubgroupAvcImeInitializeINTEL: return "OpSubgroupAvcImeInitializeINTEL"; + case OpSubgroupAvcImeSetSingleReferenceINTEL: return "OpSubgroupAvcImeSetSingleReferenceINTEL"; + case OpSubgroupAvcImeSetDualReferenceINTEL: return "OpSubgroupAvcImeSetDualReferenceINTEL"; + case OpSubgroupAvcImeRefWindowSizeINTEL: return "OpSubgroupAvcImeRefWindowSizeINTEL"; + case OpSubgroupAvcImeAdjustRefOffsetINTEL: return "OpSubgroupAvcImeAdjustRefOffsetINTEL"; + case OpSubgroupAvcImeConvertToMcePayloadINTEL: return "OpSubgroupAvcImeConvertToMcePayloadINTEL"; + case OpSubgroupAvcImeSetMaxMotionVectorCountINTEL: return "OpSubgroupAvcImeSetMaxMotionVectorCountINTEL"; + case OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: return "OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL"; + case OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: return "OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL"; + case OpSubgroupAvcImeSetWeightedSadINTEL: return "OpSubgroupAvcImeSetWeightedSadINTEL"; + case OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL"; + case OpSubgroupAvcImeEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceINTEL"; + case OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL"; + case OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL"; + case OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL"; + case OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL"; + case OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL"; + case OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL"; + case OpSubgroupAvcImeConvertToMceResultINTEL: return "OpSubgroupAvcImeConvertToMceResultINTEL"; + case OpSubgroupAvcImeGetSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeGetSingleReferenceStreaminINTEL"; + case OpSubgroupAvcImeGetDualReferenceStreaminINTEL: return "OpSubgroupAvcImeGetDualReferenceStreaminINTEL"; + case OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL"; + case OpSubgroupAvcImeStripDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripDualReferenceStreamoutINTEL"; + case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL"; + case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL"; + case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL"; + case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL"; + case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL"; + case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL"; + case OpSubgroupAvcImeGetBorderReachedINTEL: return "OpSubgroupAvcImeGetBorderReachedINTEL"; + case OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: return "OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL"; + case OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: return "OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL"; + case OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL"; + case OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL"; + case OpSubgroupAvcFmeInitializeINTEL: return "OpSubgroupAvcFmeInitializeINTEL"; + case OpSubgroupAvcBmeInitializeINTEL: return "OpSubgroupAvcBmeInitializeINTEL"; + case OpSubgroupAvcRefConvertToMcePayloadINTEL: return "OpSubgroupAvcRefConvertToMcePayloadINTEL"; + case OpSubgroupAvcRefSetBidirectionalMixDisableINTEL: return "OpSubgroupAvcRefSetBidirectionalMixDisableINTEL"; + case OpSubgroupAvcRefSetBilinearFilterEnableINTEL: return "OpSubgroupAvcRefSetBilinearFilterEnableINTEL"; + case OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL"; + case OpSubgroupAvcRefEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithDualReferenceINTEL"; + case OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL"; + case OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL"; + case OpSubgroupAvcRefConvertToMceResultINTEL: return "OpSubgroupAvcRefConvertToMceResultINTEL"; + case OpSubgroupAvcSicInitializeINTEL: return "OpSubgroupAvcSicInitializeINTEL"; + case OpSubgroupAvcSicConfigureSkcINTEL: return "OpSubgroupAvcSicConfigureSkcINTEL"; + case OpSubgroupAvcSicConfigureIpeLumaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaINTEL"; + case OpSubgroupAvcSicConfigureIpeLumaChromaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaChromaINTEL"; + case OpSubgroupAvcSicGetMotionVectorMaskINTEL: return "OpSubgroupAvcSicGetMotionVectorMaskINTEL"; + case OpSubgroupAvcSicConvertToMcePayloadINTEL: return "OpSubgroupAvcSicConvertToMcePayloadINTEL"; + case OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL"; + case OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL"; + case OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL"; + case OpSubgroupAvcSicSetBilinearFilterEnableINTEL: return "OpSubgroupAvcSicSetBilinearFilterEnableINTEL"; + case OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: return "OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL"; + case OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: return "OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL"; + case OpSubgroupAvcSicEvaluateIpeINTEL: return "OpSubgroupAvcSicEvaluateIpeINTEL"; + case OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL"; + case OpSubgroupAvcSicEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithDualReferenceINTEL"; + case OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL"; + case OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL"; + case OpSubgroupAvcSicConvertToMceResultINTEL: return "OpSubgroupAvcSicConvertToMceResultINTEL"; + case OpSubgroupAvcSicGetIpeLumaShapeINTEL: return "OpSubgroupAvcSicGetIpeLumaShapeINTEL"; + case OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL"; + case OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL"; + case OpSubgroupAvcSicGetPackedIpeLumaModesINTEL: return "OpSubgroupAvcSicGetPackedIpeLumaModesINTEL"; + case OpSubgroupAvcSicGetIpeChromaModeINTEL: return "OpSubgroupAvcSicGetIpeChromaModeINTEL"; + case OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL"; + case OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL"; + case OpSubgroupAvcSicGetInterRawSadsINTEL: return "OpSubgroupAvcSicGetInterRawSadsINTEL"; + case OpVariableLengthArrayINTEL: return "OpVariableLengthArrayINTEL"; + case OpSaveMemoryINTEL: return "OpSaveMemoryINTEL"; + case OpRestoreMemoryINTEL: return "OpRestoreMemoryINTEL"; + case OpArbitraryFloatSinCosPiINTEL: return "OpArbitraryFloatSinCosPiINTEL"; + case OpArbitraryFloatCastINTEL: return "OpArbitraryFloatCastINTEL"; + case OpArbitraryFloatCastFromIntINTEL: return "OpArbitraryFloatCastFromIntINTEL"; + case OpArbitraryFloatCastToIntINTEL: return "OpArbitraryFloatCastToIntINTEL"; + case OpArbitraryFloatAddINTEL: return "OpArbitraryFloatAddINTEL"; + case OpArbitraryFloatSubINTEL: return "OpArbitraryFloatSubINTEL"; + case OpArbitraryFloatMulINTEL: return "OpArbitraryFloatMulINTEL"; + case OpArbitraryFloatDivINTEL: return "OpArbitraryFloatDivINTEL"; + case OpArbitraryFloatGTINTEL: return "OpArbitraryFloatGTINTEL"; + case OpArbitraryFloatGEINTEL: return "OpArbitraryFloatGEINTEL"; + case OpArbitraryFloatLTINTEL: return "OpArbitraryFloatLTINTEL"; + case OpArbitraryFloatLEINTEL: return "OpArbitraryFloatLEINTEL"; + case OpArbitraryFloatEQINTEL: return "OpArbitraryFloatEQINTEL"; + case OpArbitraryFloatRecipINTEL: return "OpArbitraryFloatRecipINTEL"; + case OpArbitraryFloatRSqrtINTEL: return "OpArbitraryFloatRSqrtINTEL"; + case OpArbitraryFloatCbrtINTEL: return "OpArbitraryFloatCbrtINTEL"; + case OpArbitraryFloatHypotINTEL: return "OpArbitraryFloatHypotINTEL"; + case OpArbitraryFloatSqrtINTEL: return "OpArbitraryFloatSqrtINTEL"; + case OpArbitraryFloatLogINTEL: return "OpArbitraryFloatLogINTEL"; + case OpArbitraryFloatLog2INTEL: return "OpArbitraryFloatLog2INTEL"; + case OpArbitraryFloatLog10INTEL: return "OpArbitraryFloatLog10INTEL"; + case OpArbitraryFloatLog1pINTEL: return "OpArbitraryFloatLog1pINTEL"; + case OpArbitraryFloatExpINTEL: return "OpArbitraryFloatExpINTEL"; + case OpArbitraryFloatExp2INTEL: return "OpArbitraryFloatExp2INTEL"; + case OpArbitraryFloatExp10INTEL: return "OpArbitraryFloatExp10INTEL"; + case OpArbitraryFloatExpm1INTEL: return "OpArbitraryFloatExpm1INTEL"; + case OpArbitraryFloatSinINTEL: return "OpArbitraryFloatSinINTEL"; + case OpArbitraryFloatCosINTEL: return "OpArbitraryFloatCosINTEL"; + case OpArbitraryFloatSinCosINTEL: return "OpArbitraryFloatSinCosINTEL"; + case OpArbitraryFloatSinPiINTEL: return "OpArbitraryFloatSinPiINTEL"; + case OpArbitraryFloatCosPiINTEL: return "OpArbitraryFloatCosPiINTEL"; + case OpArbitraryFloatASinINTEL: return "OpArbitraryFloatASinINTEL"; + case OpArbitraryFloatASinPiINTEL: return "OpArbitraryFloatASinPiINTEL"; + case OpArbitraryFloatACosINTEL: return "OpArbitraryFloatACosINTEL"; + case OpArbitraryFloatACosPiINTEL: return "OpArbitraryFloatACosPiINTEL"; + case OpArbitraryFloatATanINTEL: return "OpArbitraryFloatATanINTEL"; + case OpArbitraryFloatATanPiINTEL: return "OpArbitraryFloatATanPiINTEL"; + case OpArbitraryFloatATan2INTEL: return "OpArbitraryFloatATan2INTEL"; + case OpArbitraryFloatPowINTEL: return "OpArbitraryFloatPowINTEL"; + case OpArbitraryFloatPowRINTEL: return "OpArbitraryFloatPowRINTEL"; + case OpArbitraryFloatPowNINTEL: return "OpArbitraryFloatPowNINTEL"; + case OpLoopControlINTEL: return "OpLoopControlINTEL"; + case OpAliasDomainDeclINTEL: return "OpAliasDomainDeclINTEL"; + case OpAliasScopeDeclINTEL: return "OpAliasScopeDeclINTEL"; + case OpAliasScopeListDeclINTEL: return "OpAliasScopeListDeclINTEL"; + case OpFixedSqrtINTEL: return "OpFixedSqrtINTEL"; + case OpFixedRecipINTEL: return "OpFixedRecipINTEL"; + case OpFixedRsqrtINTEL: return "OpFixedRsqrtINTEL"; + case OpFixedSinINTEL: return "OpFixedSinINTEL"; + case OpFixedCosINTEL: return "OpFixedCosINTEL"; + case OpFixedSinCosINTEL: return "OpFixedSinCosINTEL"; + case OpFixedSinPiINTEL: return "OpFixedSinPiINTEL"; + case OpFixedCosPiINTEL: return "OpFixedCosPiINTEL"; + case OpFixedSinCosPiINTEL: return "OpFixedSinCosPiINTEL"; + case OpFixedLogINTEL: return "OpFixedLogINTEL"; + case OpFixedExpINTEL: return "OpFixedExpINTEL"; + case OpPtrCastToCrossWorkgroupINTEL: return "OpPtrCastToCrossWorkgroupINTEL"; + case OpCrossWorkgroupCastToPtrINTEL: return "OpCrossWorkgroupCastToPtrINTEL"; + case OpReadPipeBlockingINTEL: return "OpReadPipeBlockingINTEL"; + case OpWritePipeBlockingINTEL: return "OpWritePipeBlockingINTEL"; + case OpFPGARegINTEL: return "OpFPGARegINTEL"; + case OpRayQueryGetRayTMinKHR: return "OpRayQueryGetRayTMinKHR"; + case OpRayQueryGetRayFlagsKHR: return "OpRayQueryGetRayFlagsKHR"; + case OpRayQueryGetIntersectionTKHR: return "OpRayQueryGetIntersectionTKHR"; + case OpRayQueryGetIntersectionInstanceCustomIndexKHR: return "OpRayQueryGetIntersectionInstanceCustomIndexKHR"; + case OpRayQueryGetIntersectionInstanceIdKHR: return "OpRayQueryGetIntersectionInstanceIdKHR"; + case OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: return "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR"; + case OpRayQueryGetIntersectionGeometryIndexKHR: return "OpRayQueryGetIntersectionGeometryIndexKHR"; + case OpRayQueryGetIntersectionPrimitiveIndexKHR: return "OpRayQueryGetIntersectionPrimitiveIndexKHR"; + case OpRayQueryGetIntersectionBarycentricsKHR: return "OpRayQueryGetIntersectionBarycentricsKHR"; + case OpRayQueryGetIntersectionFrontFaceKHR: return "OpRayQueryGetIntersectionFrontFaceKHR"; + case OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: return "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR"; + case OpRayQueryGetIntersectionObjectRayDirectionKHR: return "OpRayQueryGetIntersectionObjectRayDirectionKHR"; + case OpRayQueryGetIntersectionObjectRayOriginKHR: return "OpRayQueryGetIntersectionObjectRayOriginKHR"; + case OpRayQueryGetWorldRayDirectionKHR: return "OpRayQueryGetWorldRayDirectionKHR"; + case OpRayQueryGetWorldRayOriginKHR: return "OpRayQueryGetWorldRayOriginKHR"; + case OpRayQueryGetIntersectionObjectToWorldKHR: return "OpRayQueryGetIntersectionObjectToWorldKHR"; + case OpRayQueryGetIntersectionWorldToObjectKHR: return "OpRayQueryGetIntersectionWorldToObjectKHR"; + case OpAtomicFAddEXT: return "OpAtomicFAddEXT"; + case OpTypeBufferSurfaceINTEL: return "OpTypeBufferSurfaceINTEL"; + case OpTypeStructContinuedINTEL: return "OpTypeStructContinuedINTEL"; + case OpConstantCompositeContinuedINTEL: return "OpConstantCompositeContinuedINTEL"; + case OpSpecConstantCompositeContinuedINTEL: return "OpSpecConstantCompositeContinuedINTEL"; + case OpCompositeConstructContinuedINTEL: return "OpCompositeConstructContinuedINTEL"; + case OpConvertFToBF16INTEL: return "OpConvertFToBF16INTEL"; + case OpConvertBF16ToFINTEL: return "OpConvertBF16ToFINTEL"; + case OpControlBarrierArriveINTEL: return "OpControlBarrierArriveINTEL"; + case OpControlBarrierWaitINTEL: return "OpControlBarrierWaitINTEL"; + case OpArithmeticFenceEXT: return "OpArithmeticFenceEXT"; + case OpTaskSequenceCreateINTEL: return "OpTaskSequenceCreateINTEL"; + case OpTaskSequenceAsyncINTEL: return "OpTaskSequenceAsyncINTEL"; + case OpTaskSequenceGetINTEL: return "OpTaskSequenceGetINTEL"; + case OpTaskSequenceReleaseINTEL: return "OpTaskSequenceReleaseINTEL"; + case OpTypeTaskSequenceINTEL: return "OpTypeTaskSequenceINTEL"; + case OpSubgroupBlockPrefetchINTEL: return "OpSubgroupBlockPrefetchINTEL"; + case OpSubgroup2DBlockLoadINTEL: return "OpSubgroup2DBlockLoadINTEL"; + case OpSubgroup2DBlockLoadTransformINTEL: return "OpSubgroup2DBlockLoadTransformINTEL"; + case OpSubgroup2DBlockLoadTransposeINTEL: return "OpSubgroup2DBlockLoadTransposeINTEL"; + case OpSubgroup2DBlockPrefetchINTEL: return "OpSubgroup2DBlockPrefetchINTEL"; + case OpSubgroup2DBlockStoreINTEL: return "OpSubgroup2DBlockStoreINTEL"; + case OpSubgroupMatrixMultiplyAccumulateINTEL: return "OpSubgroupMatrixMultiplyAccumulateINTEL"; + case OpBitwiseFunctionINTEL: return "OpBitwiseFunctionINTEL"; + case OpUntypedVariableLengthArrayINTEL: return "OpUntypedVariableLengthArrayINTEL"; + case OpConditionalExtensionINTEL: return "OpConditionalExtensionINTEL"; + case OpConditionalEntryPointINTEL: return "OpConditionalEntryPointINTEL"; + case OpConditionalCapabilityINTEL: return "OpConditionalCapabilityINTEL"; + case OpSpecConstantTargetINTEL: return "OpSpecConstantTargetINTEL"; + case OpSpecConstantArchitectureINTEL: return "OpSpecConstantArchitectureINTEL"; + case OpSpecConstantCapabilitiesINTEL: return "OpSpecConstantCapabilitiesINTEL"; + case OpConditionalCopyObjectINTEL: return "OpConditionalCopyObjectINTEL"; + case OpGroupIMulKHR: return "OpGroupIMulKHR"; + case OpGroupFMulKHR: return "OpGroupFMulKHR"; + case OpGroupBitwiseAndKHR: return "OpGroupBitwiseAndKHR"; + case OpGroupBitwiseOrKHR: return "OpGroupBitwiseOrKHR"; + case OpGroupBitwiseXorKHR: return "OpGroupBitwiseXorKHR"; + case OpGroupLogicalAndKHR: return "OpGroupLogicalAndKHR"; + case OpGroupLogicalOrKHR: return "OpGroupLogicalOrKHR"; + case OpGroupLogicalXorKHR: return "OpGroupLogicalXorKHR"; + case OpRoundFToTF32INTEL: return "OpRoundFToTF32INTEL"; + case OpMaskedGatherINTEL: return "OpMaskedGatherINTEL"; + case OpMaskedScatterINTEL: return "OpMaskedScatterINTEL"; + case OpConvertHandleToImageINTEL: return "OpConvertHandleToImageINTEL"; + case OpConvertHandleToSamplerINTEL: return "OpConvertHandleToSamplerINTEL"; + case OpConvertHandleToSampledImageINTEL: return "OpConvertHandleToSampledImageINTEL"; + default: return "Unknown"; + } +} + +#endif /* SPV_ENABLE_UTILITY_CODE */ + +// Overload bitwise operators for mask bit combining + +inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +inline ImageOperandsMask operator&(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) & unsigned(b)); } +inline ImageOperandsMask operator^(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) ^ unsigned(b)); } +inline ImageOperandsMask operator~(ImageOperandsMask a) { return ImageOperandsMask(~unsigned(a)); } +inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +inline FPFastMathModeMask operator&(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) & unsigned(b)); } +inline FPFastMathModeMask operator^(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) ^ unsigned(b)); } +inline FPFastMathModeMask operator~(FPFastMathModeMask a) { return FPFastMathModeMask(~unsigned(a)); } +inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +inline SelectionControlMask operator&(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) & unsigned(b)); } +inline SelectionControlMask operator^(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) ^ unsigned(b)); } +inline SelectionControlMask operator~(SelectionControlMask a) { return SelectionControlMask(~unsigned(a)); } +inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +inline LoopControlMask operator&(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) & unsigned(b)); } +inline LoopControlMask operator^(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) ^ unsigned(b)); } +inline LoopControlMask operator~(LoopControlMask a) { return LoopControlMask(~unsigned(a)); } +inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +inline FunctionControlMask operator&(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) & unsigned(b)); } +inline FunctionControlMask operator^(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) ^ unsigned(b)); } +inline FunctionControlMask operator~(FunctionControlMask a) { return FunctionControlMask(~unsigned(a)); } +inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +inline MemorySemanticsMask operator&(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) & unsigned(b)); } +inline MemorySemanticsMask operator^(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) ^ unsigned(b)); } +inline MemorySemanticsMask operator~(MemorySemanticsMask a) { return MemorySemanticsMask(~unsigned(a)); } +inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +inline MemoryAccessMask operator&(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) & unsigned(b)); } +inline MemoryAccessMask operator^(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) ^ unsigned(b)); } +inline MemoryAccessMask operator~(MemoryAccessMask a) { return MemoryAccessMask(~unsigned(a)); } +inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } +inline KernelProfilingInfoMask operator&(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) & unsigned(b)); } +inline KernelProfilingInfoMask operator^(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) ^ unsigned(b)); } +inline KernelProfilingInfoMask operator~(KernelProfilingInfoMask a) { return KernelProfilingInfoMask(~unsigned(a)); } +inline RayFlagsMask operator|(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) | unsigned(b)); } +inline RayFlagsMask operator&(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) & unsigned(b)); } +inline RayFlagsMask operator^(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) ^ unsigned(b)); } +inline RayFlagsMask operator~(RayFlagsMask a) { return RayFlagsMask(~unsigned(a)); } +inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) | unsigned(b)); } +inline FragmentShadingRateMask operator&(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) & unsigned(b)); } +inline FragmentShadingRateMask operator^(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) ^ unsigned(b)); } +inline FragmentShadingRateMask operator~(FragmentShadingRateMask a) { return FragmentShadingRateMask(~unsigned(a)); } +inline CooperativeMatrixOperandsMask operator|(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) | unsigned(b)); } +inline CooperativeMatrixOperandsMask operator&(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) & unsigned(b)); } +inline CooperativeMatrixOperandsMask operator^(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) ^ unsigned(b)); } +inline CooperativeMatrixOperandsMask operator~(CooperativeMatrixOperandsMask a) { return CooperativeMatrixOperandsMask(~unsigned(a)); } +inline CooperativeMatrixReduceMask operator|(CooperativeMatrixReduceMask a, CooperativeMatrixReduceMask b) { return CooperativeMatrixReduceMask(unsigned(a) | unsigned(b)); } +inline CooperativeMatrixReduceMask operator&(CooperativeMatrixReduceMask a, CooperativeMatrixReduceMask b) { return CooperativeMatrixReduceMask(unsigned(a) & unsigned(b)); } +inline CooperativeMatrixReduceMask operator^(CooperativeMatrixReduceMask a, CooperativeMatrixReduceMask b) { return CooperativeMatrixReduceMask(unsigned(a) ^ unsigned(b)); } +inline CooperativeMatrixReduceMask operator~(CooperativeMatrixReduceMask a) { return CooperativeMatrixReduceMask(~unsigned(a)); } +inline TensorAddressingOperandsMask operator|(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) | unsigned(b)); } +inline TensorAddressingOperandsMask operator&(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) & unsigned(b)); } +inline TensorAddressingOperandsMask operator^(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) ^ unsigned(b)); } +inline TensorAddressingOperandsMask operator~(TensorAddressingOperandsMask a) { return TensorAddressingOperandsMask(~unsigned(a)); } +inline TensorOperandsMask operator|(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) | unsigned(b)); } +inline TensorOperandsMask operator&(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) & unsigned(b)); } +inline TensorOperandsMask operator^(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) ^ unsigned(b)); } +inline TensorOperandsMask operator~(TensorOperandsMask a) { return TensorOperandsMask(~unsigned(a)); } +inline MatrixMultiplyAccumulateOperandsMask operator|(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) | unsigned(b)); } +inline MatrixMultiplyAccumulateOperandsMask operator&(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) & unsigned(b)); } +inline MatrixMultiplyAccumulateOperandsMask operator^(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) ^ unsigned(b)); } +inline MatrixMultiplyAccumulateOperandsMask operator~(MatrixMultiplyAccumulateOperandsMask a) { return MatrixMultiplyAccumulateOperandsMask(~unsigned(a)); } +inline RawAccessChainOperandsMask operator|(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) | unsigned(b)); } +inline RawAccessChainOperandsMask operator&(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) & unsigned(b)); } +inline RawAccessChainOperandsMask operator^(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) ^ unsigned(b)); } +inline RawAccessChainOperandsMask operator~(RawAccessChainOperandsMask a) { return RawAccessChainOperandsMask(~unsigned(a)); } + +} // end namespace spv + +#endif // #ifndef spirv_HPP + diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cfg.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cfg.cpp new file mode 100644 index 0000000000..c68886d989 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cfg.cpp @@ -0,0 +1,504 @@ +/* + * Copyright 2016-2021 Arm Limited + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#include "spirv_cfg.hpp" +#include "spirv_cross.hpp" +#include +#include + +using namespace std; + +namespace SPIRV_CROSS_NAMESPACE +{ +CFG::CFG(Compiler &compiler_, const SPIRFunction &func_) + : compiler(compiler_) + , func(func_) +{ + build_post_order_visit_order(); + build_immediate_dominators(); +} + +uint32_t CFG::find_common_dominator(uint32_t a, uint32_t b) const +{ + while (a != b) + { + if (get_visit_order(a) < get_visit_order(b)) + a = get_immediate_dominator(a); + else + b = get_immediate_dominator(b); + } + return a; +} + +void CFG::build_immediate_dominators() +{ + // Traverse the post-order in reverse and build up the immediate dominator tree. + immediate_dominators.clear(); + immediate_dominators[func.entry_block] = func.entry_block; + + for (auto i = post_order.size(); i; i--) + { + uint32_t block = post_order[i - 1]; + auto &pred = preceding_edges[block]; + if (pred.empty()) // This is for the entry block, but we've already set up the dominators. + continue; + + for (auto &edge : pred) + { + if (immediate_dominators[block]) + { + assert(immediate_dominators[edge]); + immediate_dominators[block] = find_common_dominator(immediate_dominators[block], edge); + } + else + immediate_dominators[block] = edge; + } + } +} + +bool CFG::is_back_edge(uint32_t to) const +{ + // We have a back edge if the visit order is set with the temporary magic value 0. + // Crossing edges will have already been recorded with a visit order. + auto itr = visit_order.find(to); + return itr != end(visit_order) && itr->second.visited_branches && !itr->second.visited_resolve; +} + +bool CFG::has_visited_branch(uint32_t to) const +{ + auto itr = visit_order.find(to); + return itr != end(visit_order) && itr->second.visited_branches; +} + +void CFG::post_order_visit_entry(uint32_t block) +{ + visit_stack.push_back(block); + + while (!visit_stack.empty()) + { + bool keep_iterating; + do + { + // Reverse the order to allow for stack-like behavior and preserves the visit order from recursive algorithm. + // Traverse depth first. + uint32_t to_visit = visit_stack.back(); + last_visited_size = visit_stack.size(); + post_order_visit_branches(to_visit); + keep_iterating = last_visited_size != visit_stack.size(); + if (keep_iterating) + std::reverse(visit_stack.begin() + last_visited_size, visit_stack.end()); + } while (keep_iterating); + + // We've reached the end of some tree leaf. Resolve the stack. + // Any node which has been visited for real can be popped now. + while (!visit_stack.empty() && visit_order[visit_stack.back()].visited_branches) + { + post_order_visit_resolve(visit_stack.back()); + visit_stack.pop_back(); + } + } +} + +void CFG::visit_branch(uint32_t block_id) +{ + // Prune obvious duplicates. + if (std::find(visit_stack.begin() + last_visited_size, visit_stack.end(), block_id) == visit_stack.end() && + !has_visited_branch(block_id)) + { + visit_stack.push_back(block_id); + } +} + +void CFG::post_order_visit_branches(uint32_t block_id) +{ + auto &block = compiler.get(block_id); + + auto &visit = visit_order[block_id]; + if (visit.visited_branches) + return; + visit.visited_branches = true; + + if (block.merge == SPIRBlock::MergeLoop) + visit_branch(block.merge_block); + else if (block.merge == SPIRBlock::MergeSelection) + visit_branch(block.next_block); + + // First visit our branch targets. + switch (block.terminator) + { + case SPIRBlock::Direct: + visit_branch(block.next_block); + break; + + case SPIRBlock::Select: + visit_branch(block.true_block); + visit_branch(block.false_block); + break; + + case SPIRBlock::MultiSelect: + { + const auto &cases = compiler.get_case_list(block); + for (const auto &target : cases) + visit_branch(target.block); + if (block.default_block) + visit_branch(block.default_block); + break; + } + + default: + break; + } +} + +void CFG::post_order_visit_resolve(uint32_t block_id) +{ + auto &block = compiler.get(block_id); + + auto &visit_block = visit_order[block_id]; + assert(visit_block.visited_branches); + auto &visited = visit_order[block_id].visited_resolve; + if (visited) + return; + + // If this is a loop header, add an implied branch to the merge target. + // This is needed to avoid annoying cases with do { ... } while(false) loops often generated by inliners. + // To the CFG, this is linear control flow, but we risk picking the do/while scope as our dominating block. + // This makes sure that if we are accessing a variable outside the do/while, we choose the loop header as dominator. + // We could use has_visited_forward_edge, but this break code-gen where the merge block is unreachable in the CFG. + + // Make a point out of visiting merge target first. This is to make sure that post visit order outside the loop + // is lower than inside the loop, which is going to be key for some traversal algorithms like post-dominance analysis. + // For selection constructs true/false blocks will end up visiting the merge block directly and it works out fine, + // but for loops, only the header might end up actually branching to merge block. + if (block.merge == SPIRBlock::MergeLoop && !is_back_edge(block.merge_block)) + add_branch(block_id, block.merge_block); + + // First visit our branch targets. + switch (block.terminator) + { + case SPIRBlock::Direct: + if (!is_back_edge(block.next_block)) + add_branch(block_id, block.next_block); + break; + + case SPIRBlock::Select: + if (!is_back_edge(block.true_block)) + add_branch(block_id, block.true_block); + if (!is_back_edge(block.false_block)) + add_branch(block_id, block.false_block); + break; + + case SPIRBlock::MultiSelect: + { + const auto &cases = compiler.get_case_list(block); + for (const auto &target : cases) + { + if (!is_back_edge(target.block)) + add_branch(block_id, target.block); + } + if (block.default_block && !is_back_edge(block.default_block)) + add_branch(block_id, block.default_block); + break; + } + default: + break; + } + + // If this is a selection merge, add an implied branch to the merge target. + // This is needed to avoid cases where an inner branch dominates the outer branch. + // This can happen if one of the branches exit early, e.g.: + // if (cond) { ...; break; } else { var = 100 } use_var(var); + // We can use the variable without a Phi since there is only one possible parent here. + // However, in this case, we need to hoist out the inner variable to outside the branch. + // Use same strategy as loops. + if (block.merge == SPIRBlock::MergeSelection && !is_back_edge(block.next_block)) + { + // If there is only one preceding edge to the merge block and it's not ourselves, we need a fixup. + // Add a fake branch so any dominator in either the if (), or else () block, or a lone case statement + // will be hoisted out to outside the selection merge. + // If size > 1, the variable will be automatically hoisted, so we should not mess with it. + // The exception here is switch blocks, where we can have multiple edges to merge block, + // all coming from same scope, so be more conservative in this case. + // Adding fake branches unconditionally breaks parameter preservation analysis, + // which looks at how variables are accessed through the CFG. + auto pred_itr = preceding_edges.find(block.next_block); + if (pred_itr != end(preceding_edges)) + { + auto &pred = pred_itr->second; + auto succ_itr = succeeding_edges.find(block_id); + size_t num_succeeding_edges = 0; + if (succ_itr != end(succeeding_edges)) + num_succeeding_edges = succ_itr->second.size(); + + if (block.terminator == SPIRBlock::MultiSelect && num_succeeding_edges == 1) + { + // Multiple branches can come from the same scope due to "break;", so we need to assume that all branches + // come from same case scope in worst case, even if there are multiple preceding edges. + // If we have more than one succeeding edge from the block header, it should be impossible + // to have a dominator be inside the block. + // Only case this can go wrong is if we have 2 or more edges from block header and + // 2 or more edges to merge block, and still have dominator be inside a case label. + if (!pred.empty()) + add_branch(block_id, block.next_block); + } + else + { + if (pred.size() == 1 && *pred.begin() != block_id) + add_branch(block_id, block.next_block); + } + } + else + { + // If the merge block does not have any preceding edges, i.e. unreachable, hallucinate it. + // We're going to do code-gen for it, and domination analysis requires that we have at least one preceding edge. + add_branch(block_id, block.next_block); + } + } + + visited = true; + visit_block.order = ++visit_count; + post_order.push_back(block_id); +} + +void CFG::build_post_order_visit_order() +{ + uint32_t block = func.entry_block; + visit_count = 0; + visit_order.clear(); + post_order.clear(); + post_order_visit_entry(block); +} + +void CFG::add_branch(uint32_t from, uint32_t to) +{ + assert(from && to); + const auto add_unique = [](SmallVector &l, uint32_t value) { + auto itr = find(begin(l), end(l), value); + if (itr == end(l)) + l.push_back(value); + }; + add_unique(preceding_edges[to], from); + add_unique(succeeding_edges[from], to); +} + +uint32_t CFG::find_loop_dominator(uint32_t block_id) const +{ + while (block_id != SPIRBlock::NoDominator) + { + auto itr = preceding_edges.find(block_id); + if (itr == end(preceding_edges)) + return SPIRBlock::NoDominator; + if (itr->second.empty()) + return SPIRBlock::NoDominator; + + uint32_t pred_block_id = SPIRBlock::NoDominator; + bool ignore_loop_header = false; + + // If we are a merge block, go directly to the header block. + // Only consider a loop dominator if we are branching from inside a block to a loop header. + // NOTE: In the CFG we forced an edge from header to merge block always to support variable scopes properly. + for (auto &pred : itr->second) + { + auto &pred_block = compiler.get(pred); + if (pred_block.merge == SPIRBlock::MergeLoop && pred_block.merge_block == ID(block_id)) + { + pred_block_id = pred; + ignore_loop_header = true; + break; + } + else if (pred_block.merge == SPIRBlock::MergeSelection && pred_block.next_block == ID(block_id)) + { + pred_block_id = pred; + break; + } + } + + // No merge block means we can just pick any edge. Loop headers dominate the inner loop, so any path we + // take will lead there. + if (pred_block_id == SPIRBlock::NoDominator) + pred_block_id = itr->second.front(); + + block_id = pred_block_id; + + if (!ignore_loop_header && block_id) + { + auto &block = compiler.get(block_id); + if (block.merge == SPIRBlock::MergeLoop) + return block_id; + } + } + + return block_id; +} + +bool CFG::node_terminates_control_flow_in_sub_graph(BlockID from, BlockID to) const +{ + // Walk backwards, starting from "to" block. + // Only follow pred edges if they have a 1:1 relationship, or a merge relationship. + // If we cannot find a path to "from", we must assume that to is inside control flow in some way. + + auto &from_block = compiler.get(from); + BlockID ignore_block_id = 0; + if (from_block.merge == SPIRBlock::MergeLoop) + ignore_block_id = from_block.merge_block; + + while (to != from) + { + auto pred_itr = preceding_edges.find(to); + if (pred_itr == end(preceding_edges)) + return false; + + DominatorBuilder builder(*this); + for (auto &edge : pred_itr->second) + builder.add_block(edge); + + uint32_t dominator = builder.get_dominator(); + if (dominator == 0) + return false; + + auto &dom = compiler.get(dominator); + + bool true_path_ignore = false; + bool false_path_ignore = false; + + bool merges_to_nothing = dom.merge == SPIRBlock::MergeNone || + (dom.merge == SPIRBlock::MergeSelection && dom.next_block && + compiler.get(dom.next_block).terminator == SPIRBlock::Unreachable) || + (dom.merge == SPIRBlock::MergeLoop && dom.merge_block && + compiler.get(dom.merge_block).terminator == SPIRBlock::Unreachable); + + if (dom.self == from || merges_to_nothing) + { + // We can only ignore inner branchy paths if there is no merge, + // i.e. no code is generated afterwards. E.g. this allows us to elide continue: + // for (;;) { if (cond) { continue; } else { break; } }. + // Codegen here in SPIR-V will be something like either no merge if one path directly breaks, or + // we merge to Unreachable. + if (ignore_block_id && dom.terminator == SPIRBlock::Select) + { + auto &true_block = compiler.get(dom.true_block); + auto &false_block = compiler.get(dom.false_block); + auto &ignore_block = compiler.get(ignore_block_id); + true_path_ignore = compiler.execution_is_branchless(true_block, ignore_block); + false_path_ignore = compiler.execution_is_branchless(false_block, ignore_block); + } + } + + // Cases where we allow traversal. This serves as a proxy for post-dominance in a loop body. + // TODO: Might want to do full post-dominance analysis, but it's a lot of churn for something like this ... + // - We're the merge block of a selection construct. Jump to header. + // - We're the merge block of a loop. Jump to header. + // - Direct branch. Trivial. + // - Allow cases inside a branch if the header cannot merge execution before loop exit. + if ((dom.merge == SPIRBlock::MergeSelection && dom.next_block == to) || + (dom.merge == SPIRBlock::MergeLoop && dom.merge_block == to) || + (dom.terminator == SPIRBlock::Direct && dom.next_block == to) || + (dom.terminator == SPIRBlock::Select && dom.true_block == to && false_path_ignore) || + (dom.terminator == SPIRBlock::Select && dom.false_block == to && true_path_ignore)) + { + // Allow walking selection constructs if the other branch reaches out of a loop construct. + // It cannot be in-scope anymore. + to = dominator; + } + else + return false; + } + + return true; +} + +DominatorBuilder::DominatorBuilder(const CFG &cfg_) + : cfg(cfg_) +{ +} + +void DominatorBuilder::add_block(uint32_t block) +{ + if (!cfg.get_immediate_dominator(block)) + { + // Unreachable block via the CFG, we will never emit this code anyways. + return; + } + + if (!dominator) + { + dominator = block; + return; + } + + if (block != dominator) + dominator = cfg.find_common_dominator(block, dominator); +} + +void DominatorBuilder::lift_continue_block_dominator() +{ + // It is possible for a continue block to be the dominator of a variable is only accessed inside the while block of a do-while loop. + // We cannot safely declare variables inside a continue block, so move any variable declared + // in a continue block to the entry block to simplify. + // It makes very little sense for a continue block to ever be a dominator, so fall back to the simplest + // solution. + + if (!dominator) + return; + + auto &block = cfg.get_compiler().get(dominator); + auto post_order = cfg.get_visit_order(dominator); + + // If we are branching to a block with a higher post-order traversal index (continue blocks), we have a problem + // since we cannot create sensible GLSL code for this, fallback to entry block. + bool back_edge_dominator = false; + switch (block.terminator) + { + case SPIRBlock::Direct: + if (cfg.get_visit_order(block.next_block) > post_order) + back_edge_dominator = true; + break; + + case SPIRBlock::Select: + if (cfg.get_visit_order(block.true_block) > post_order) + back_edge_dominator = true; + if (cfg.get_visit_order(block.false_block) > post_order) + back_edge_dominator = true; + break; + + case SPIRBlock::MultiSelect: + { + auto &cases = cfg.get_compiler().get_case_list(block); + for (auto &target : cases) + { + if (cfg.get_visit_order(target.block) > post_order) + back_edge_dominator = true; + } + if (block.default_block && cfg.get_visit_order(block.default_block) > post_order) + back_edge_dominator = true; + break; + } + + default: + break; + } + + if (back_edge_dominator) + dominator = cfg.get_function().entry_block; +} +} // namespace SPIRV_CROSS_NAMESPACE diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cfg.hpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cfg.hpp new file mode 100644 index 0000000000..1c21ea070b --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cfg.hpp @@ -0,0 +1,166 @@ +/* + * Copyright 2016-2021 Arm Limited + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#ifndef SPIRV_CROSS_CFG_HPP +#define SPIRV_CROSS_CFG_HPP + +#include "spirv_common.hpp" +#include + +namespace SPIRV_CROSS_NAMESPACE +{ +class Compiler; +class CFG +{ +public: + CFG(Compiler &compiler, const SPIRFunction &function); + + Compiler &get_compiler() + { + return compiler; + } + + const Compiler &get_compiler() const + { + return compiler; + } + + const SPIRFunction &get_function() const + { + return func; + } + + uint32_t get_immediate_dominator(uint32_t block) const + { + auto itr = immediate_dominators.find(block); + if (itr != std::end(immediate_dominators)) + return itr->second; + else + return 0; + } + + bool is_reachable(uint32_t block) const + { + return visit_order.count(block) != 0; + } + + uint32_t get_visit_order(uint32_t block) const + { + auto itr = visit_order.find(block); + assert(itr != std::end(visit_order)); + int v = itr->second.order; + assert(v > 0); + return uint32_t(v); + } + + uint32_t find_common_dominator(uint32_t a, uint32_t b) const; + + const SmallVector &get_preceding_edges(uint32_t block) const + { + auto itr = preceding_edges.find(block); + if (itr != std::end(preceding_edges)) + return itr->second; + else + return empty_vector; + } + + const SmallVector &get_succeeding_edges(uint32_t block) const + { + auto itr = succeeding_edges.find(block); + if (itr != std::end(succeeding_edges)) + return itr->second; + else + return empty_vector; + } + + template + void walk_from(std::unordered_set &seen_blocks, uint32_t block, const Op &op) const + { + if (seen_blocks.count(block)) + return; + seen_blocks.insert(block); + + if (op(block)) + { + for (auto b : get_succeeding_edges(block)) + walk_from(seen_blocks, b, op); + } + } + + uint32_t find_loop_dominator(uint32_t block) const; + + bool node_terminates_control_flow_in_sub_graph(BlockID from, BlockID to) const; + +private: + struct VisitOrder + { + int order = -1; + bool visited_resolve = false; + bool visited_branches = false; + }; + + Compiler &compiler; + const SPIRFunction &func; + std::unordered_map> preceding_edges; + std::unordered_map> succeeding_edges; + std::unordered_map immediate_dominators; + std::unordered_map visit_order; + SmallVector post_order; + SmallVector empty_vector; + + void add_branch(uint32_t from, uint32_t to); + void build_post_order_visit_order(); + void build_immediate_dominators(); + void post_order_visit_branches(uint32_t block); + void post_order_visit_resolve(uint32_t block); + void post_order_visit_entry(uint32_t block); + uint32_t visit_count = 0; + + bool is_back_edge(uint32_t to) const; + bool has_visited_branch(uint32_t to) const; + void visit_branch(uint32_t block_id); + + SmallVector visit_stack; + size_t last_visited_size = 0; +}; + +class DominatorBuilder +{ +public: + DominatorBuilder(const CFG &cfg); + + void add_block(uint32_t block); + uint32_t get_dominator() const + { + return dominator; + } + + void lift_continue_block_dominator(); + +private: + const CFG &cfg; + uint32_t dominator = 0; +}; +} // namespace SPIRV_CROSS_NAMESPACE + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_common.hpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_common.hpp new file mode 100644 index 0000000000..cd06f754ca --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_common.hpp @@ -0,0 +1,2072 @@ +/* + * Copyright 2015-2021 Arm Limited + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#ifndef SPIRV_CROSS_COMMON_HPP +#define SPIRV_CROSS_COMMON_HPP + +#ifndef SPV_ENABLE_UTILITY_CODE +#define SPV_ENABLE_UTILITY_CODE +#endif + +// Pragmatic hack to avoid symbol conflicts when including both hpp11 and hpp headers in same translation unit. +// This is an unfortunate SPIRV-Headers issue that we cannot easily deal with ourselves. +#ifdef SPIRV_CROSS_SPV_HEADER_NAMESPACE_OVERRIDE +#define spv SPIRV_CROSS_SPV_HEADER_NAMESPACE_OVERRIDE +#define SPIRV_CROSS_SPV_HEADER_NAMESPACE SPIRV_CROSS_SPV_HEADER_NAMESPACE_OVERRIDE +#else +#define SPIRV_CROSS_SPV_HEADER_NAMESPACE spv +#endif + +#include "spirv.hpp" +#include "spirv_cross_containers.hpp" +#include "spirv_cross_error_handling.hpp" +#include + +// A bit crude, but allows projects which embed SPIRV-Cross statically to +// effectively hide all the symbols from other projects. +// There is a case where we have: +// - Project A links against SPIRV-Cross statically. +// - Project A links against Project B statically. +// - Project B links against SPIRV-Cross statically (might be a different version). +// This leads to a conflict with extremely bizarre results. +// By overriding the namespace in one of the project builds, we can work around this. +// If SPIRV-Cross is embedded in dynamic libraries, +// prefer using -fvisibility=hidden on GCC/Clang instead. +#ifdef SPIRV_CROSS_NAMESPACE_OVERRIDE +#define SPIRV_CROSS_NAMESPACE SPIRV_CROSS_NAMESPACE_OVERRIDE +#else +#define SPIRV_CROSS_NAMESPACE spirv_cross +#endif + +namespace SPIRV_CROSS_NAMESPACE +{ +namespace inner +{ +template +void join_helper(StringStream<> &stream, T &&t) +{ + stream << std::forward(t); +} + +template +void join_helper(StringStream<> &stream, T &&t, Ts &&... ts) +{ + stream << std::forward(t); + join_helper(stream, std::forward(ts)...); +} +} // namespace inner + +class Bitset +{ +public: + Bitset() = default; + explicit inline Bitset(uint64_t lower_) + : lower(lower_) + { + } + + inline bool get(uint32_t bit) const + { + if (bit < 64) + return (lower & (1ull << bit)) != 0; + else + return higher.count(bit) != 0; + } + + inline void set(uint32_t bit) + { + if (bit < 64) + lower |= 1ull << bit; + else + higher.insert(bit); + } + + inline void clear(uint32_t bit) + { + if (bit < 64) + lower &= ~(1ull << bit); + else + higher.erase(bit); + } + + inline uint64_t get_lower() const + { + return lower; + } + + inline void reset() + { + lower = 0; + higher.clear(); + } + + inline void merge_and(const Bitset &other) + { + lower &= other.lower; + std::unordered_set tmp_set; + for (auto &v : higher) + if (other.higher.count(v) != 0) + tmp_set.insert(v); + higher = std::move(tmp_set); + } + + inline void merge_or(const Bitset &other) + { + lower |= other.lower; + for (auto &v : other.higher) + higher.insert(v); + } + + inline bool operator==(const Bitset &other) const + { + if (lower != other.lower) + return false; + + if (higher.size() != other.higher.size()) + return false; + + for (auto &v : higher) + if (other.higher.count(v) == 0) + return false; + + return true; + } + + inline bool operator!=(const Bitset &other) const + { + return !(*this == other); + } + + template + void for_each_bit(const Op &op) const + { + // TODO: Add ctz-based iteration. + for (uint32_t i = 0; i < 64; i++) + { + if (lower & (1ull << i)) + op(i); + } + + if (higher.empty()) + return; + + // Need to enforce an order here for reproducible results, + // but hitting this path should happen extremely rarely, so having this slow path is fine. + SmallVector bits; + bits.reserve(higher.size()); + for (auto &v : higher) + bits.push_back(v); + std::sort(std::begin(bits), std::end(bits)); + + for (auto &v : bits) + op(v); + } + + inline bool empty() const + { + return lower == 0 && higher.empty(); + } + +private: + // The most common bits to set are all lower than 64, + // so optimize for this case. Bits spilling outside 64 go into a slower data structure. + // In almost all cases, higher data structure will not be used. + uint64_t lower = 0; + std::unordered_set higher; +}; + +// Helper template to avoid lots of nasty string temporary munging. +template +std::string join(Ts &&... ts) +{ + StringStream<> stream; + inner::join_helper(stream, std::forward(ts)...); + return stream.str(); +} + +inline std::string merge(const SmallVector &list, const char *between = ", ") +{ + StringStream<> stream; + for (auto &elem : list) + { + stream << elem; + if (&elem != &list.back()) + stream << between; + } + return stream.str(); +} + +// Make sure we don't accidentally call this with float or doubles with SFINAE. +// Have to use the radix-aware overload. +template ::value, int>::type = 0> +inline std::string convert_to_string(const T &t) +{ + return std::to_string(t); +} + +static inline std::string convert_to_string(int32_t value) +{ + // INT_MIN is ... special on some backends. If we use a decimal literal, and negate it, we + // could accidentally promote the literal to long first, then negate. + // To workaround it, emit int(0x80000000) instead. + if (value == (std::numeric_limits::min)()) + return "int(0x80000000)"; + else + return std::to_string(value); +} + +static inline std::string convert_to_string(int64_t value, const std::string &int64_type, bool long_long_literal_suffix) +{ + // INT64_MIN is ... special on some backends. + // If we use a decimal literal, and negate it, we might overflow the representable numbers. + // To workaround it, emit int(0x80000000) instead. + if (value == (std::numeric_limits::min)()) + return join(int64_type, "(0x8000000000000000u", (long_long_literal_suffix ? "ll" : "l"), ")"); + else + return std::to_string(value) + (long_long_literal_suffix ? "ll" : "l"); +} + +// Allow implementations to set a convenient standard precision +#ifndef SPIRV_CROSS_FLT_FMT +#define SPIRV_CROSS_FLT_FMT "%.32g" +#endif + +// Disable sprintf and strcat warnings. +// We cannot rely on snprintf and family existing because, ..., MSVC. +#if defined(__clang__) || defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#elif defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 4996) +#endif + +static inline void fixup_radix_point(char *str, char radix_point) +{ + // Setting locales is a very risky business in multi-threaded program, + // so just fixup locales instead. We only need to care about the radix point. + if (radix_point != '.') + { + while (*str != '\0') + { + if (*str == radix_point) + *str = '.'; + str++; + } + } +} + +inline std::string convert_to_string(float t, char locale_radix_point) +{ + // std::to_string for floating point values is broken. + // Fallback to something more sane. + char buf[64]; + sprintf(buf, SPIRV_CROSS_FLT_FMT, t); + fixup_radix_point(buf, locale_radix_point); + + // Ensure that the literal is float. + if (!strchr(buf, '.') && !strchr(buf, 'e')) + strcat(buf, ".0"); + return buf; +} + +inline std::string convert_to_string(double t, char locale_radix_point) +{ + // std::to_string for floating point values is broken. + // Fallback to something more sane. + char buf[64]; + sprintf(buf, SPIRV_CROSS_FLT_FMT, t); + fixup_radix_point(buf, locale_radix_point); + + // Ensure that the literal is float. + if (!strchr(buf, '.') && !strchr(buf, 'e')) + strcat(buf, ".0"); + return buf; +} + +#if defined(__clang__) || defined(__GNUC__) +#pragma GCC diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) +#endif + +class FloatFormatter +{ +public: + virtual ~FloatFormatter() = default; + virtual std::string format_float(float value) = 0; + virtual std::string format_double(double value) = 0; +}; + +template +struct ValueSaver +{ + explicit ValueSaver(T ¤t_) + : current(current_) + , saved(current_) + { + } + + void release() + { + current = saved; + } + + ~ValueSaver() + { + release(); + } + + T ¤t; + T saved; +}; + +struct Instruction +{ + uint16_t op = 0; + uint16_t count = 0; + // If offset is 0 (not a valid offset into the instruction stream), + // we have an instruction stream which is embedded in the object. + uint32_t offset = 0; + uint32_t length = 0; + + inline bool is_embedded() const + { + return offset == 0; + } +}; + +struct EmbeddedInstruction : Instruction +{ + SmallVector ops; +}; + +enum Types +{ + TypeNone, + TypeType, + TypeVariable, + TypeConstant, + TypeFunction, + TypeFunctionPrototype, + TypeBlock, + TypeExtension, + TypeExpression, + TypeConstantOp, + TypeCombinedImageSampler, + TypeAccessChain, + TypeUndef, + TypeString, + TypeDebugLocalVariable, + TypeCount +}; + +template +class TypedID; + +template <> +class TypedID +{ +public: + TypedID() = default; + TypedID(uint32_t id_) + : id(id_) + { + } + + template + TypedID(const TypedID &other) + { + *this = other; + } + + template + TypedID &operator=(const TypedID &other) + { + id = uint32_t(other); + return *this; + } + + // Implicit conversion to u32 is desired here. + // As long as we block implicit conversion between TypedID and TypedID we're good. + operator uint32_t() const + { + return id; + } + + template + operator TypedID() const + { + return TypedID(*this); + } + +private: + uint32_t id = 0; +}; + +template +class TypedID +{ +public: + TypedID() = default; + TypedID(uint32_t id_) + : id(id_) + { + } + + explicit TypedID(const TypedID &other) + : id(uint32_t(other)) + { + } + + operator uint32_t() const + { + return id; + } + +private: + uint32_t id = 0; +}; + +using VariableID = TypedID; +using TypeID = TypedID; +using ConstantID = TypedID; +using FunctionID = TypedID; +using BlockID = TypedID; +using ID = TypedID; + +// Helper for Variant interface. +struct IVariant +{ + virtual ~IVariant() = default; + virtual IVariant *clone(ObjectPoolBase *pool) = 0; + ID self = 0; + +protected: + IVariant() = default; + IVariant(const IVariant&) = default; + IVariant &operator=(const IVariant&) = default; +}; + +#define SPIRV_CROSS_DECLARE_CLONE(T) \ + IVariant *clone(ObjectPoolBase *pool) override \ + { \ + return static_cast *>(pool)->allocate(*this); \ + } + +struct SPIRUndef : IVariant +{ + enum + { + type = TypeUndef + }; + + explicit SPIRUndef(TypeID basetype_) + : basetype(basetype_) + { + } + TypeID basetype; + + SPIRV_CROSS_DECLARE_CLONE(SPIRUndef) +}; + +struct SPIRString : IVariant +{ + enum + { + type = TypeString + }; + + explicit SPIRString(std::string str_) + : str(std::move(str_)) + { + } + + std::string str; + + SPIRV_CROSS_DECLARE_CLONE(SPIRString) +}; + +struct SPIRDebugLocalVariable : IVariant +{ + enum + { + type = TypeDebugLocalVariable + }; + + uint32_t name_id; + + SPIRV_CROSS_DECLARE_CLONE(SPIRDebugLocalVariable) +}; + +// This type is only used by backends which need to access the combined image and sampler IDs separately after +// the OpSampledImage opcode. +struct SPIRCombinedImageSampler : IVariant +{ + enum + { + type = TypeCombinedImageSampler + }; + SPIRCombinedImageSampler(TypeID type_, VariableID image_, VariableID sampler_) + : combined_type(type_) + , image(image_) + , sampler(sampler_) + { + } + TypeID combined_type; + VariableID image; + VariableID sampler; + + SPIRV_CROSS_DECLARE_CLONE(SPIRCombinedImageSampler) +}; + +struct SPIRConstantOp : IVariant +{ + enum + { + type = TypeConstantOp + }; + + SPIRConstantOp(TypeID result_type, spv::Op op, const uint32_t *args, uint32_t length) + : opcode(op) + , basetype(result_type) + { + arguments.reserve(length); + for (uint32_t i = 0; i < length; i++) + arguments.push_back(args[i]); + } + + spv::Op opcode; + SmallVector arguments; + TypeID basetype; + + SPIRV_CROSS_DECLARE_CLONE(SPIRConstantOp) +}; + +struct SPIRType : IVariant +{ + enum + { + type = TypeType + }; + + spv::Op op = spv::Op::OpNop; + explicit SPIRType(spv::Op op_) : op(op_) {} + + enum BaseType + { + Unknown, + Void, + Boolean, + SByte, + UByte, + Short, + UShort, + Int, + UInt, + Int64, + UInt64, + AtomicCounter, + Half, + Float, + Double, + Struct, + Image, + SampledImage, + Sampler, + AccelerationStructure, + RayQuery, + CoopVecNV, + + // Keep internal types at the end. + ControlPointArray, + Interpolant, + Char, + // MSL specific type, that is used by 'object'(analog of 'task' from glsl) shader. + MeshGridProperties, + BFloat16, + FloatE4M3, + FloatE5M2, + + Tensor + }; + + // Scalar/vector/matrix support. + BaseType basetype = Unknown; + uint32_t width = 0; + uint32_t vecsize = 1; + uint32_t columns = 1; + + // Arrays, support array of arrays by having a vector of array sizes. + SmallVector array; + + // Array elements can be either specialization constants or specialization ops. + // This array determines how to interpret the array size. + // If an element is true, the element is a literal, + // otherwise, it's an expression, which must be resolved on demand. + // The actual size is not really known until runtime. + SmallVector array_size_literal; + + // Pointers + // Keep track of how many pointer layers we have. + uint32_t pointer_depth = 0; + bool pointer = false; + bool forward_pointer = false; + + union + { + struct + { + uint32_t use_id; + uint32_t rows_id; + uint32_t columns_id; + uint32_t scope_id; + } cooperative; + + struct + { + uint32_t component_type_id; + uint32_t component_count_id; + } coopVecNV; + + struct + { + uint32_t type; + uint32_t rank; + uint32_t shape; + } tensor; + } ext; + + spv::StorageClass storage = spv::StorageClassGeneric; + + SmallVector member_types; + + // If member order has been rewritten to handle certain scenarios with Offset, + // allow codegen to rewrite the index. + SmallVector member_type_index_redirection; + + struct ImageType + { + TypeID type; + spv::Dim dim; + bool depth; + bool arrayed; + bool ms; + uint32_t sampled; + spv::ImageFormat format; + spv::AccessQualifier access; + } image = {}; + + // Structs can be declared multiple times if they are used as part of interface blocks. + // We want to detect this so that we only emit the struct definition once. + // Since we cannot rely on OpName to be equal, we need to figure out aliases. + TypeID type_alias = 0; + + // Denotes the type which this type is based on. + // Allows the backend to traverse how a complex type is built up during access chains. + TypeID parent_type = 0; + + // Used in backends to avoid emitting members with conflicting names. + std::unordered_set member_name_cache; + + SPIRV_CROSS_DECLARE_CLONE(SPIRType) +}; + +struct SPIRExtension : IVariant +{ + enum + { + type = TypeExtension + }; + + enum Extension + { + Unsupported, + GLSL, + SPV_debug_info, + SPV_AMD_shader_ballot, + SPV_AMD_shader_explicit_vertex_parameter, + SPV_AMD_shader_trinary_minmax, + SPV_AMD_gcn_shader, + NonSemanticDebugPrintf, + NonSemanticShaderDebugInfo, + NonSemanticGeneric + }; + + enum ShaderDebugInfoOps + { + DebugLine = 103, + DebugSource = 35 + }; + + explicit SPIRExtension(Extension ext_) + : ext(ext_) + { + } + + Extension ext; + SPIRV_CROSS_DECLARE_CLONE(SPIRExtension) +}; + +// SPIREntryPoint is not a variant since its IDs are used to decorate OpFunction, +// so in order to avoid conflicts, we can't stick them in the ids array. +struct SPIREntryPoint +{ + SPIREntryPoint(FunctionID self_, spv::ExecutionModel execution_model, const std::string &entry_name) + : self(self_) + , name(entry_name) + , orig_name(entry_name) + , model(execution_model) + { + } + SPIREntryPoint() = default; + + FunctionID self = 0; + std::string name; + std::string orig_name; + std::unordered_map fp_fast_math_defaults; + bool signed_zero_inf_nan_preserve_8 = false; + bool signed_zero_inf_nan_preserve_16 = false; + bool signed_zero_inf_nan_preserve_32 = false; + bool signed_zero_inf_nan_preserve_64 = false; + SmallVector interface_variables; + + Bitset flags; + struct WorkgroupSize + { + uint32_t x = 0, y = 0, z = 0; + uint32_t id_x = 0, id_y = 0, id_z = 0; + uint32_t constant = 0; // Workgroup size can be expressed as a constant/spec-constant instead. + } workgroup_size; + uint32_t invocations = 0; + uint32_t output_vertices = 0; + uint32_t output_primitives = 0; + spv::ExecutionModel model = spv::ExecutionModelMax; + bool geometry_passthrough = false; +}; + +struct SPIRExpression : IVariant +{ + enum + { + type = TypeExpression + }; + + // Only created by the backend target to avoid creating tons of temporaries. + SPIRExpression(std::string expr, TypeID expression_type_, bool immutable_) + : expression(std::move(expr)) + , expression_type(expression_type_) + , immutable(immutable_) + { + } + + // If non-zero, prepend expression with to_expression(base_expression). + // Used in amortizing multiple calls to to_expression() + // where in certain cases that would quickly force a temporary when not needed. + ID base_expression = 0; + + std::string expression; + TypeID expression_type = 0; + + // If this expression is a forwarded load, + // allow us to reference the original variable. + ID loaded_from = 0; + + // If this expression will never change, we can avoid lots of temporaries + // in high level source. + // An expression being immutable can be speculative, + // it is assumed that this is true almost always. + bool immutable = false; + + // Before use, this expression must be transposed. + // This is needed for targets which don't support row_major layouts. + bool need_transpose = false; + + // Whether or not this is an access chain expression. + bool access_chain = false; + + // Whether or not gl_MeshVerticesEXT[].gl_Position (as a whole or .y) is referenced + bool access_meshlet_position_y = false; + + // A list of expressions which this expression depends on. + SmallVector expression_dependencies; + + // Similar as expression dependencies, but does not stop the tracking for force-temporary variables. + // We need to know the full chain from store back to any SSA variable. + SmallVector invariance_dependencies; + + // By reading this expression, we implicitly read these expressions as well. + // Used by access chain Store and Load since we read multiple expressions in this case. + SmallVector implied_read_expressions; + + // The expression was emitted at a certain scope. Lets us track when an expression read means multiple reads. + uint32_t emitted_loop_level = 0; + + SPIRV_CROSS_DECLARE_CLONE(SPIRExpression) +}; + +struct SPIRFunctionPrototype : IVariant +{ + enum + { + type = TypeFunctionPrototype + }; + + explicit SPIRFunctionPrototype(TypeID return_type_) + : return_type(return_type_) + { + } + + TypeID return_type; + SmallVector parameter_types; + + SPIRV_CROSS_DECLARE_CLONE(SPIRFunctionPrototype) +}; + +struct SPIRBlock : IVariant +{ + enum + { + type = TypeBlock + }; + + enum Terminator + { + Unknown, + Direct, // Emit next block directly without a particular condition. + + Select, // Block ends with an if/else block. + MultiSelect, // Block ends with switch statement. + + Return, // Block ends with return. + Unreachable, // Noop + Kill, // Discard + IgnoreIntersection, // Ray Tracing + TerminateRay, // Ray Tracing + EmitMeshTasks // Mesh shaders + }; + + enum Merge + { + MergeNone, + MergeLoop, + MergeSelection + }; + + enum Hints + { + HintNone, + HintUnroll, + HintDontUnroll, + HintFlatten, + HintDontFlatten + }; + + enum Method + { + MergeToSelectForLoop, + MergeToDirectForLoop, + MergeToSelectContinueForLoop + }; + + enum ContinueBlockType + { + ContinueNone, + + // Continue block is branchless and has at least one instruction. + ForLoop, + + // Noop continue block. + WhileLoop, + + // Continue block is conditional. + DoWhileLoop, + + // Highly unlikely that anything will use this, + // since it is really awkward/impossible to express in GLSL. + ComplexLoop + }; + + enum : uint32_t + { + NoDominator = 0xffffffffu + }; + + Terminator terminator = Unknown; + Merge merge = MergeNone; + Hints hint = HintNone; + BlockID next_block = 0; + BlockID merge_block = 0; + BlockID continue_block = 0; + + ID return_value = 0; // If 0, return nothing (void). + ID condition = 0; + BlockID true_block = 0; + BlockID false_block = 0; + BlockID default_block = 0; + + // If terminator is EmitMeshTasksEXT. + struct + { + ID groups[3]; + ID payload; + } mesh = {}; + + SmallVector ops; + + struct Phi + { + ID local_variable; // flush local variable ... + BlockID parent; // If we're in from_block and want to branch into this block ... + VariableID function_variable; // to this function-global "phi" variable first. + }; + + // Before entering this block flush out local variables to magical "phi" variables. + SmallVector phi_variables; + + // Declare these temporaries before beginning the block. + // Used for handling complex continue blocks which have side effects. + SmallVector> declare_temporary; + + // Declare these temporaries, but only conditionally if this block turns out to be + // a complex loop header. + SmallVector> potential_declare_temporary; + + struct Case + { + uint64_t value; + BlockID block; + }; + SmallVector cases_32bit; + SmallVector cases_64bit; + + // If we have tried to optimize code for this block but failed, + // keep track of this. + bool disable_block_optimization = false; + + // If the continue block is complex, fallback to "dumb" for loops. + bool complex_continue = false; + + // Do we need a ladder variable to defer breaking out of a loop construct after a switch block? + bool need_ladder_break = false; + + // If marked, we have explicitly handled Phi from this block, so skip any flushes related to that on a branch. + // Used to handle an edge case with switch and case-label fallthrough where fall-through writes to Phi. + BlockID ignore_phi_from_block = 0; + + // The dominating block which this block might be within. + // Used in continue; blocks to determine if we really need to write continue. + BlockID loop_dominator = 0; + + // All access to these variables are dominated by this block, + // so before branching anywhere we need to make sure that we declare these variables. + SmallVector dominated_variables; + SmallVector rearm_dominated_variables; + + // These are variables which should be declared in a for loop header, if we + // fail to use a classic for-loop, + // we remove these variables, and fall back to regular variables outside the loop. + SmallVector loop_variables; + + // Some expressions are control-flow dependent, i.e. any instruction which relies on derivatives or + // sub-group-like operations. + // Make sure that we only use these expressions in the original block. + SmallVector invalidate_expressions; + + SPIRV_CROSS_DECLARE_CLONE(SPIRBlock) +}; + +struct SPIRFunction : IVariant +{ + enum + { + type = TypeFunction + }; + + SPIRFunction(TypeID return_type_, TypeID function_type_) + : return_type(return_type_) + , function_type(function_type_) + { + } + + struct Parameter + { + TypeID type; + ID id; + uint32_t read_count; + uint32_t write_count; + + // Set to true if this parameter aliases a global variable, + // used mostly in Metal where global variables + // have to be passed down to functions as regular arguments. + // However, for this kind of variable, we should not care about + // read and write counts as access to the function arguments + // is not local to the function in question. + bool alias_global_variable; + }; + + // When calling a function, and we're remapping separate image samplers, + // resolve these arguments into combined image samplers and pass them + // as additional arguments in this order. + // It gets more complicated as functions can pull in their own globals + // and combine them with parameters, + // so we need to distinguish if something is local parameter index + // or a global ID. + struct CombinedImageSamplerParameter + { + VariableID id; + VariableID image_id; + VariableID sampler_id; + bool global_image; + bool global_sampler; + bool depth; + }; + + TypeID return_type; + TypeID function_type; + SmallVector arguments; + + // Can be used by backends to add magic arguments. + // Currently used by combined image/sampler implementation. + + SmallVector shadow_arguments; + SmallVector local_variables; + BlockID entry_block = 0; + SmallVector blocks; + SmallVector combined_parameters; + + struct EntryLine + { + uint32_t file_id = 0; + uint32_t line_literal = 0; + }; + EntryLine entry_line; + + void add_local_variable(VariableID id) + { + local_variables.push_back(id); + } + + void add_parameter(TypeID parameter_type, ID id, bool alias_global_variable = false) + { + // Arguments are read-only until proven otherwise. + arguments.push_back({ parameter_type, id, 0u, 0u, alias_global_variable }); + } + + // Hooks to be run when the function returns. + // Mostly used for lowering internal data structures onto flattened structures. + // Need to defer this, because they might rely on things which change during compilation. + // Intentionally not a small vector, this one is rare, and std::function can be large. + Vector> fixup_hooks_out; + + // Hooks to be run when the function begins. + // Mostly used for populating internal data structures from flattened structures. + // Need to defer this, because they might rely on things which change during compilation. + // Intentionally not a small vector, this one is rare, and std::function can be large. + Vector> fixup_hooks_in; + + // On function entry, make sure to copy a constant array into thread addr space to work around + // the case where we are passing a constant array by value to a function on backends which do not + // consider arrays value types. + SmallVector constant_arrays_needed_on_stack; + + // Does this function (or any function called by it), emit geometry? + bool emits_geometry = false; + + bool active = false; + bool flush_undeclared = true; + bool do_combined_parameters = true; + + SPIRV_CROSS_DECLARE_CLONE(SPIRFunction) +}; + +struct SPIRAccessChain : IVariant +{ + enum + { + type = TypeAccessChain + }; + + SPIRAccessChain(TypeID basetype_, spv::StorageClass storage_, std::string base_, std::string dynamic_index_, + int32_t static_index_) + : basetype(basetype_) + , storage(storage_) + , base(std::move(base_)) + , dynamic_index(std::move(dynamic_index_)) + , static_index(static_index_) + { + } + + // The access chain represents an offset into a buffer. + // Some backends need more complicated handling of access chains to be able to use buffers, like HLSL + // which has no usable buffer type ala GLSL SSBOs. + // StructuredBuffer is too limited, so our only option is to deal with ByteAddressBuffer which works with raw addresses. + + TypeID basetype; + spv::StorageClass storage; + std::string base; + std::string dynamic_index; + int32_t static_index; + + VariableID loaded_from = 0; + uint32_t matrix_stride = 0; + uint32_t array_stride = 0; + bool row_major_matrix = false; + bool immutable = false; + + // By reading this expression, we implicitly read these expressions as well. + // Used by access chain Store and Load since we read multiple expressions in this case. + SmallVector implied_read_expressions; + + SPIRV_CROSS_DECLARE_CLONE(SPIRAccessChain) +}; + +struct SPIRVariable : IVariant +{ + enum + { + type = TypeVariable + }; + + SPIRVariable() = default; + SPIRVariable(TypeID basetype_, spv::StorageClass storage_, ID initializer_ = 0, VariableID basevariable_ = 0) + : basetype(basetype_) + , storage(storage_) + , initializer(initializer_) + , basevariable(basevariable_) + { + } + + TypeID basetype = 0; + spv::StorageClass storage = spv::StorageClassGeneric; + uint32_t decoration = 0; + ID initializer = 0; + VariableID basevariable = 0; + + SmallVector dereference_chain; + bool compat_builtin = false; + + // If a variable is shadowed, we only statically assign to it + // and never actually emit a statement for it. + // When we read the variable as an expression, just forward + // shadowed_id as the expression. + bool statically_assigned = false; + ID static_expression = 0; + + // Temporaries which can remain forwarded as long as this variable is not modified. + SmallVector dependees; + + // ShaderDebugInfo local variables attached to this variable via DebugDeclare + SmallVector debug_local_variables; + + bool deferred_declaration = false; + bool phi_variable = false; + + // Used to deal with Phi variable flushes. See flush_phi(). + bool allocate_temporary_copy = false; + + bool remapped_variable = false; + uint32_t remapped_components = 0; + + // The block which dominates all access to this variable. + BlockID dominator = 0; + // If true, this variable is a loop variable, when accessing the variable + // outside a loop, + // we should statically forward it. + bool loop_variable = false; + // Set to true while we're inside the for loop. + bool loop_variable_enable = false; + + // Used to find global LUTs + bool is_written_to = false; + + SPIRFunction::Parameter *parameter = nullptr; + + SPIRV_CROSS_DECLARE_CLONE(SPIRVariable) +}; + +struct SPIRConstant : IVariant +{ + enum + { + type = TypeConstant + }; + + union Constant + { + uint32_t u32; + int32_t i32; + float f32; + + uint64_t u64; + int64_t i64; + double f64; + }; + + struct ConstantVector + { + Constant r[4]; + // If != 0, this element is a specialization constant, and we should keep track of it as such. + ID id[4]; + uint32_t vecsize = 1; + + ConstantVector() + { + memset(r, 0, sizeof(r)); + } + }; + + struct ConstantMatrix + { + ConstantVector c[4]; + // If != 0, this column is a specialization constant, and we should keep track of it as such. + ID id[4]; + uint32_t columns = 1; + }; + + static inline float f16_to_f32(uint16_t u16_value) + { + // Based on the GLM implementation. + int s = (u16_value >> 15) & 0x1; + int e = (u16_value >> 10) & 0x1f; + int m = (u16_value >> 0) & 0x3ff; + + union + { + float f32; + uint32_t u32; + } u; + + if (e == 0) + { + if (m == 0) + { + u.u32 = uint32_t(s) << 31; + return u.f32; + } + else + { + while ((m & 0x400) == 0) + { + m <<= 1; + e--; + } + + e++; + m &= ~0x400; + } + } + else if (e == 31) + { + if (m == 0) + { + u.u32 = (uint32_t(s) << 31) | 0x7f800000u; + return u.f32; + } + else + { + u.u32 = (uint32_t(s) << 31) | 0x7f800000u | (m << 13); + return u.f32; + } + } + + e += 127 - 15; + m <<= 13; + u.u32 = (uint32_t(s) << 31) | (e << 23) | m; + return u.f32; + } + + static inline float fe4m3_to_f32(uint8_t v) + { + if ((v & 0x7f) == 0x7f) + { + union + { + float f32; + uint32_t u32; + } u; + + u.u32 = (v & 0x80) ? 0xffffffffu : 0x7fffffffu; + return u.f32; + } + else + { + // Reuse the FP16 to FP32 code. Cute bit-hackery. + return f16_to_f32((int16_t(int8_t(v)) << 7) & (0xffff ^ 0x4000)) * 256.0f; + } + } + + inline uint32_t specialization_constant_id(uint32_t col, uint32_t row) const + { + return m.c[col].id[row]; + } + + inline uint32_t specialization_constant_id(uint32_t col) const + { + return m.id[col]; + } + + inline uint32_t scalar(uint32_t col = 0, uint32_t row = 0) const + { + return m.c[col].r[row].u32; + } + + inline int16_t scalar_i16(uint32_t col = 0, uint32_t row = 0) const + { + return int16_t(m.c[col].r[row].u32 & 0xffffu); + } + + inline uint16_t scalar_u16(uint32_t col = 0, uint32_t row = 0) const + { + return uint16_t(m.c[col].r[row].u32 & 0xffffu); + } + + inline int8_t scalar_i8(uint32_t col = 0, uint32_t row = 0) const + { + return int8_t(m.c[col].r[row].u32 & 0xffu); + } + + inline uint8_t scalar_u8(uint32_t col = 0, uint32_t row = 0) const + { + return uint8_t(m.c[col].r[row].u32 & 0xffu); + } + + inline float scalar_f16(uint32_t col = 0, uint32_t row = 0) const + { + return f16_to_f32(scalar_u16(col, row)); + } + + inline float scalar_bf16(uint32_t col = 0, uint32_t row = 0) const + { + uint32_t v = scalar_u16(col, row) << 16; + float fp32; + memcpy(&fp32, &v, sizeof(float)); + return fp32; + } + + inline float scalar_floate4m3(uint32_t col = 0, uint32_t row = 0) const + { + return fe4m3_to_f32(scalar_u8(col, row)); + } + + inline float scalar_bf8(uint32_t col = 0, uint32_t row = 0) const + { + return f16_to_f32(uint16_t(scalar_u8(col, row) << 8)); + } + + inline float scalar_f32(uint32_t col = 0, uint32_t row = 0) const + { + return m.c[col].r[row].f32; + } + + inline int32_t scalar_i32(uint32_t col = 0, uint32_t row = 0) const + { + return m.c[col].r[row].i32; + } + + inline double scalar_f64(uint32_t col = 0, uint32_t row = 0) const + { + return m.c[col].r[row].f64; + } + + inline int64_t scalar_i64(uint32_t col = 0, uint32_t row = 0) const + { + return m.c[col].r[row].i64; + } + + inline uint64_t scalar_u64(uint32_t col = 0, uint32_t row = 0) const + { + return m.c[col].r[row].u64; + } + + inline const ConstantVector &vector() const + { + return m.c[0]; + } + + inline uint32_t vector_size() const + { + return m.c[0].vecsize; + } + + inline uint32_t columns() const + { + return m.columns; + } + + inline void make_null(const SPIRType &constant_type_) + { + m = {}; + m.columns = constant_type_.columns; + for (auto &c : m.c) + c.vecsize = constant_type_.vecsize; + } + + inline bool constant_is_null() const + { + if (specialization) + return false; + if (!subconstants.empty()) + return false; + + for (uint32_t col = 0; col < columns(); col++) + for (uint32_t row = 0; row < vector_size(); row++) + if (scalar_u64(col, row) != 0) + return false; + + return true; + } + + explicit SPIRConstant(uint32_t constant_type_) + : constant_type(constant_type_) + { + } + + SPIRConstant() = default; + + SPIRConstant(TypeID constant_type_, const uint32_t *elements, uint32_t num_elements, bool specialized, bool replicated_ = false) + : constant_type(constant_type_) + , specialization(specialized) + , replicated(replicated_) + { + subconstants.reserve(num_elements); + for (uint32_t i = 0; i < num_elements; i++) + subconstants.push_back(elements[i]); + specialization = specialized; + } + + // Construct scalar (32-bit). + SPIRConstant(TypeID constant_type_, uint32_t v0, bool specialized) + : constant_type(constant_type_) + , specialization(specialized) + { + m.c[0].r[0].u32 = v0; + m.c[0].vecsize = 1; + m.columns = 1; + } + + // Construct scalar (64-bit). + SPIRConstant(TypeID constant_type_, uint64_t v0, bool specialized) + : constant_type(constant_type_) + , specialization(specialized) + { + m.c[0].r[0].u64 = v0; + m.c[0].vecsize = 1; + m.columns = 1; + } + + // Construct vectors and matrices. + SPIRConstant(TypeID constant_type_, const SPIRConstant *const *vector_elements, uint32_t num_elements, + bool specialized) + : constant_type(constant_type_) + , specialization(specialized) + { + bool matrix = vector_elements[0]->m.c[0].vecsize > 1; + + if (matrix) + { + m.columns = num_elements; + + for (uint32_t i = 0; i < num_elements; i++) + { + m.c[i] = vector_elements[i]->m.c[0]; + if (vector_elements[i]->specialization) + m.id[i] = vector_elements[i]->self; + } + } + else + { + m.c[0].vecsize = num_elements; + m.columns = 1; + + for (uint32_t i = 0; i < num_elements; i++) + { + m.c[0].r[i] = vector_elements[i]->m.c[0].r[0]; + if (vector_elements[i]->specialization) + m.c[0].id[i] = vector_elements[i]->self; + } + } + } + + TypeID constant_type = 0; + ConstantMatrix m; + + // If this constant is a specialization constant (i.e. created with OpSpecConstant*). + bool specialization = false; + // If this constant is used as an array length which creates specialization restrictions on some backends. + bool is_used_as_array_length = false; + + // If true, this is a LUT, and should always be declared in the outer scope. + bool is_used_as_lut = false; + + // If this is a null constant of array type with specialized length. + // May require special handling in initializer + bool is_null_array_specialized_length = false; + + // For composites which are constant arrays, etc. + SmallVector subconstants; + + // Whether the subconstants are intended to be replicated (e.g. OpConstantCompositeReplicateEXT) + bool replicated = false; + + // Non-Vulkan GLSL, HLSL and sometimes MSL emits defines for each specialization constant, + // and uses them to initialize the constant. This allows the user + // to still be able to specialize the value by supplying corresponding + // preprocessor directives before compiling the shader. + std::string specialization_constant_macro_name; + + SPIRV_CROSS_DECLARE_CLONE(SPIRConstant) +}; + +// Variants have a very specific allocation scheme. +struct ObjectPoolGroup +{ + std::unique_ptr pools[TypeCount]; +}; + +class Variant +{ +public: + explicit Variant(ObjectPoolGroup *group_) + : group(group_) + { + } + + ~Variant() + { + if (holder) + group->pools[type]->deallocate_opaque(holder); + } + + // Marking custom move constructor as noexcept is important. + Variant(Variant &&other) SPIRV_CROSS_NOEXCEPT + { + *this = std::move(other); + } + + // We cannot copy from other variant without our own pool group. + // Have to explicitly copy. + Variant(const Variant &variant) = delete; + + // Marking custom move constructor as noexcept is important. + Variant &operator=(Variant &&other) SPIRV_CROSS_NOEXCEPT + { + if (this != &other) + { + if (holder) + group->pools[type]->deallocate_opaque(holder); + holder = other.holder; + group = other.group; + type = other.type; + allow_type_rewrite = other.allow_type_rewrite; + + other.holder = nullptr; + other.type = TypeNone; + } + return *this; + } + + // This copy/clone should only be called in the Compiler constructor. + // If this is called inside ::compile(), we invalidate any references we took higher in the stack. + // This should never happen. + Variant &operator=(const Variant &other) + { +//#define SPIRV_CROSS_COPY_CONSTRUCTOR_SANITIZE +#ifdef SPIRV_CROSS_COPY_CONSTRUCTOR_SANITIZE + abort(); +#endif + if (this != &other) + { + if (holder) + group->pools[type]->deallocate_opaque(holder); + + if (other.holder) + holder = other.holder->clone(group->pools[other.type].get()); + else + holder = nullptr; + + type = other.type; + allow_type_rewrite = other.allow_type_rewrite; + } + return *this; + } + + void set(IVariant *val, Types new_type) + { + if (holder) + group->pools[type]->deallocate_opaque(holder); + holder = nullptr; + + if (!allow_type_rewrite && type != TypeNone && type != new_type) + { + if (val) + group->pools[new_type]->deallocate_opaque(val); + SPIRV_CROSS_THROW("Overwriting a variant with new type."); + } + + holder = val; + type = new_type; + allow_type_rewrite = false; + } + + template + T *allocate_and_set(Types new_type, Ts &&... ts) + { + T *val = static_cast &>(*group->pools[new_type]).allocate(std::forward(ts)...); + set(val, new_type); + return val; + } + + template + T &get() + { + if (!holder) + SPIRV_CROSS_THROW("nullptr"); + if (static_cast(T::type) != type) + SPIRV_CROSS_THROW("Bad cast"); + return *static_cast(holder); + } + + template + const T &get() const + { + if (!holder) + SPIRV_CROSS_THROW("nullptr"); + if (static_cast(T::type) != type) + SPIRV_CROSS_THROW("Bad cast"); + return *static_cast(holder); + } + + Types get_type() const + { + return type; + } + + ID get_id() const + { + return holder ? holder->self : ID(0); + } + + bool empty() const + { + return !holder; + } + + void reset() + { + if (holder) + group->pools[type]->deallocate_opaque(holder); + holder = nullptr; + type = TypeNone; + } + + void set_allow_type_rewrite() + { + allow_type_rewrite = true; + } + +private: + ObjectPoolGroup *group = nullptr; + IVariant *holder = nullptr; + Types type = TypeNone; + bool allow_type_rewrite = false; +}; + +template +T &variant_get(Variant &var) +{ + return var.get(); +} + +template +const T &variant_get(const Variant &var) +{ + return var.get(); +} + +template +T &variant_set(Variant &var, P &&... args) +{ + auto *ptr = var.allocate_and_set(static_cast(T::type), std::forward

(args)...); + return *ptr; +} + +struct AccessChainMeta +{ + uint32_t storage_physical_type = 0; + bool need_transpose = false; + bool storage_is_packed = false; + bool storage_is_invariant = false; + bool flattened_struct = false; + bool relaxed_precision = false; + bool access_meshlet_position_y = false; + bool chain_is_builtin = false; + spv::BuiltIn builtin = {}; +}; + +enum ExtendedDecorations +{ + // Marks if a buffer block is re-packed, i.e. member declaration might be subject to PhysicalTypeID remapping and padding. + SPIRVCrossDecorationBufferBlockRepacked = 0, + + // A type in a buffer block might be declared with a different physical type than the logical type. + // If this is not set, PhysicalTypeID == the SPIR-V type as declared. + SPIRVCrossDecorationPhysicalTypeID, + + // Marks if the physical type is to be declared with tight packing rules, i.e. packed_floatN on MSL and friends. + // If this is set, PhysicalTypeID might also be set. It can be set to same as logical type if all we're doing + // is converting float3 to packed_float3 for example. + // If this is marked on a struct, it means the struct itself must use only Packed types for all its members. + SPIRVCrossDecorationPhysicalTypePacked, + + // The padding in bytes before declaring this struct member. + // If used on a struct type, marks the target size of a struct. + SPIRVCrossDecorationPaddingTarget, + + SPIRVCrossDecorationInterfaceMemberIndex, + SPIRVCrossDecorationInterfaceOrigID, + SPIRVCrossDecorationResourceIndexPrimary, + // Used for decorations like resource indices for samplers when part of combined image samplers. + // A variable might need to hold two resource indices in this case. + SPIRVCrossDecorationResourceIndexSecondary, + // Used for resource indices for multiplanar images when part of combined image samplers. + SPIRVCrossDecorationResourceIndexTertiary, + SPIRVCrossDecorationResourceIndexQuaternary, + + // Marks a buffer block for using explicit offsets (GLSL/HLSL). + SPIRVCrossDecorationExplicitOffset, + + // Apply to a variable in the Input storage class; marks it as holding the base group passed to vkCmdDispatchBase(), + // or the base vertex and instance indices passed to vkCmdDrawIndexed(). + // In MSL, this is used to adjust the WorkgroupId and GlobalInvocationId variables in compute shaders, + // and to hold the BaseVertex and BaseInstance variables in vertex shaders. + SPIRVCrossDecorationBuiltInDispatchBase, + + // Apply to a variable that is a function parameter; marks it as being a "dynamic" + // combined image-sampler. In MSL, this is used when a function parameter might hold + // either a regular combined image-sampler or one that has an attached sampler + // Y'CbCr conversion. + SPIRVCrossDecorationDynamicImageSampler, + + // Apply to a variable in the Input storage class; marks it as holding the size of the stage + // input grid. + // In MSL, this is used to hold the vertex and instance counts in a tessellation pipeline + // vertex shader. + SPIRVCrossDecorationBuiltInStageInputSize, + + // Apply to any access chain of a tessellation I/O variable; stores the type of the sub-object + // that was chained to, as recorded in the input variable itself. This is used in case the pointer + // is itself used as the base of an access chain, to calculate the original type of the sub-object + // chained to, in case a swizzle needs to be applied. This should not happen normally with valid + // SPIR-V, but the MSL backend can change the type of input variables, necessitating the + // addition of swizzles to keep the generated code compiling. + SPIRVCrossDecorationTessIOOriginalInputTypeID, + + // Apply to any access chain of an interface variable used with pull-model interpolation, where the variable is a + // vector but the resulting pointer is a scalar; stores the component index that is to be accessed by the chain. + // This is used when emitting calls to interpolation functions on the chain in MSL: in this case, the component + // must be applied to the result, since pull-model interpolants in MSL cannot be swizzled directly, but the + // results of interpolation can. + SPIRVCrossDecorationInterpolantComponentExpr, + + // Apply to any struct type that is used in the Workgroup storage class. + // This causes matrices in MSL prior to Metal 3.0 to be emitted using a special + // class that is convertible to the standard matrix type, to work around the + // lack of constructors in the 'threadgroup' address space. + SPIRVCrossDecorationWorkgroupStruct, + + SPIRVCrossDecorationOverlappingBinding, + + SPIRVCrossDecorationCount +}; + +struct Meta +{ + struct Decoration + { + std::string alias; + std::string qualified_alias; + std::string user_semantic; + std::string user_type; + Bitset decoration_flags; + spv::BuiltIn builtin_type = spv::BuiltInMax; + uint32_t location = 0; + uint32_t component = 0; + uint32_t set = 0; + uint32_t binding = 0; + uint32_t offset = 0; + uint32_t xfb_buffer = 0; + uint32_t xfb_stride = 0; + uint32_t stream = 0; + uint32_t array_stride = 0; + uint32_t matrix_stride = 0; + uint32_t input_attachment = 0; + uint32_t spec_id = 0; + uint32_t index = 0; + spv::FPRoundingMode fp_rounding_mode = spv::FPRoundingModeMax; + spv::FPFastMathModeMask fp_fast_math_mode = spv::FPFastMathModeMaskNone; + bool builtin = false; + bool qualified_alias_explicit_override = false; + + struct Extended + { + Extended() + { + // MSVC 2013 workaround to init like this. + for (auto &v : values) + v = 0; + } + + Bitset flags; + uint32_t values[SPIRVCrossDecorationCount]; + } extended; + }; + + Decoration decoration; + + // Intentionally not a SmallVector. Decoration is large and somewhat rare. + Vector members; + + std::unordered_map decoration_word_offset; + + // For SPV_GOOGLE_hlsl_functionality1. + bool hlsl_is_magic_counter_buffer = false; + // ID for the sibling counter buffer. + uint32_t hlsl_magic_counter_buffer = 0; +}; + +// A user callback that remaps the type of any variable. +// var_name is the declared name of the variable. +// name_of_type is the textual name of the type which will be used in the code unless written to by the callback. +using VariableTypeRemapCallback = + std::function; + +class Hasher +{ +public: + inline void u32(uint32_t value) + { + h = (h * 0x100000001b3ull) ^ value; + } + + inline uint64_t get() const + { + return h; + } + +private: + uint64_t h = 0xcbf29ce484222325ull; +}; + +static inline bool type_is_floating_point(const SPIRType &type) +{ + return type.basetype == SPIRType::Half || type.basetype == SPIRType::Float || type.basetype == SPIRType::Double || + type.basetype == SPIRType::BFloat16 || type.basetype == SPIRType::FloatE5M2 || type.basetype == SPIRType::FloatE4M3; +} + +static inline bool type_is_integral(const SPIRType &type) +{ + return type.basetype == SPIRType::SByte || type.basetype == SPIRType::UByte || type.basetype == SPIRType::Short || + type.basetype == SPIRType::UShort || type.basetype == SPIRType::Int || type.basetype == SPIRType::UInt || + type.basetype == SPIRType::Int64 || type.basetype == SPIRType::UInt64; +} + +static inline SPIRType::BaseType to_signed_basetype(uint32_t width) +{ + switch (width) + { + case 8: + return SPIRType::SByte; + case 16: + return SPIRType::Short; + case 32: + return SPIRType::Int; + case 64: + return SPIRType::Int64; + default: + SPIRV_CROSS_THROW("Invalid bit width."); + } +} + +static inline SPIRType::BaseType to_unsigned_basetype(uint32_t width) +{ + switch (width) + { + case 8: + return SPIRType::UByte; + case 16: + return SPIRType::UShort; + case 32: + return SPIRType::UInt; + case 64: + return SPIRType::UInt64; + default: + SPIRV_CROSS_THROW("Invalid bit width."); + } +} + +// Returns true if an arithmetic operation does not change behavior depending on signedness. +static inline bool opcode_is_sign_invariant(spv::Op opcode) +{ + switch (opcode) + { + case spv::OpIEqual: + case spv::OpINotEqual: + case spv::OpISub: + case spv::OpIAdd: + case spv::OpIMul: + case spv::OpShiftLeftLogical: + case spv::OpBitwiseOr: + case spv::OpBitwiseXor: + case spv::OpBitwiseAnd: + return true; + + default: + return false; + } +} + +static inline bool opcode_can_promote_integer_implicitly(spv::Op opcode) +{ + switch (opcode) + { + case spv::OpSNegate: + case spv::OpNot: + case spv::OpBitwiseAnd: + case spv::OpBitwiseOr: + case spv::OpBitwiseXor: + case spv::OpShiftLeftLogical: + case spv::OpShiftRightLogical: + case spv::OpShiftRightArithmetic: + case spv::OpIAdd: + case spv::OpISub: + case spv::OpIMul: + case spv::OpSDiv: + case spv::OpUDiv: + case spv::OpSRem: + case spv::OpUMod: + case spv::OpSMod: + return true; + + default: + return false; + } +} + +struct SetBindingPair +{ + uint32_t desc_set; + uint32_t binding; + + inline bool operator==(const SetBindingPair &other) const + { + return desc_set == other.desc_set && binding == other.binding; + } + + inline bool operator<(const SetBindingPair &other) const + { + return desc_set < other.desc_set || (desc_set == other.desc_set && binding < other.binding); + } +}; + +struct LocationComponentPair +{ + uint32_t location; + uint32_t component; + + inline bool operator==(const LocationComponentPair &other) const + { + return location == other.location && component == other.component; + } + + inline bool operator<(const LocationComponentPair &other) const + { + return location < other.location || (location == other.location && component < other.component); + } +}; + +struct StageSetBinding +{ + spv::ExecutionModel model; + uint32_t desc_set; + uint32_t binding; + + inline bool operator==(const StageSetBinding &other) const + { + return model == other.model && desc_set == other.desc_set && binding == other.binding; + } +}; + +struct InternalHasher +{ + inline size_t operator()(const SetBindingPair &value) const + { + // Quality of hash doesn't really matter here. + auto hash_set = std::hash()(value.desc_set); + auto hash_binding = std::hash()(value.binding); + return (hash_set * 0x10001b31) ^ hash_binding; + } + + inline size_t operator()(const LocationComponentPair &value) const + { + // Quality of hash doesn't really matter here. + auto hash_set = std::hash()(value.location); + auto hash_binding = std::hash()(value.component); + return (hash_set * 0x10001b31) ^ hash_binding; + } + + inline size_t operator()(const StageSetBinding &value) const + { + // Quality of hash doesn't really matter here. + auto hash_model = std::hash()(value.model); + auto hash_set = std::hash()(value.desc_set); + auto tmp_hash = (hash_model * 0x10001b31) ^ hash_set; + return (tmp_hash * 0x10001b31) ^ value.binding; + } +}; + +// Special constant used in a {MSL,HLSL}ResourceBinding desc_set +// element to indicate the bindings for the push constants. +static const uint32_t ResourceBindingPushConstantDescriptorSet = ~(0u); + +// Special constant used in a {MSL,HLSL}ResourceBinding binding +// element to indicate the bindings for the push constants. +static const uint32_t ResourceBindingPushConstantBinding = 0; +} // namespace SPIRV_CROSS_NAMESPACE + +namespace std +{ +template +struct hash> +{ + size_t operator()(const SPIRV_CROSS_NAMESPACE::TypedID &value) const + { + return std::hash()(value); + } +}; +} // namespace std + +#ifdef SPIRV_CROSS_SPV_HEADER_NAMESPACE_OVERRIDE +#undef spv +#endif +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cpp.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cpp.cpp new file mode 100644 index 0000000000..4bb6fc261f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cpp.cpp @@ -0,0 +1,553 @@ +/* + * Copyright 2015-2021 Arm Limited + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#include "spirv_cpp.hpp" + +using namespace SPIRV_CROSS_SPV_HEADER_NAMESPACE; +using namespace SPIRV_CROSS_NAMESPACE; +using namespace std; + +void CompilerCPP::emit_buffer_block(const SPIRVariable &var) +{ + add_resource_name(var.self); + + auto &type = get(var.basetype); + auto instance_name = to_name(var.self); + + uint32_t descriptor_set = ir.meta[var.self].decoration.set; + uint32_t binding = ir.meta[var.self].decoration.binding; + + emit_block_struct(type); + auto buffer_name = to_name(type.self); + + statement("internal::Resource<", buffer_name, type_to_array_glsl(type, var.self), "> ", instance_name, "__;"); + statement_no_indent("#define ", instance_name, " __res->", instance_name, "__.get()"); + resource_registrations.push_back( + join("s.register_resource(", instance_name, "__", ", ", descriptor_set, ", ", binding, ");")); + statement(""); +} + +void CompilerCPP::emit_interface_block(const SPIRVariable &var) +{ + add_resource_name(var.self); + + auto &type = get(var.basetype); + + const char *qual = var.storage == StorageClassInput ? "StageInput" : "StageOutput"; + const char *lowerqual = var.storage == StorageClassInput ? "stage_input" : "stage_output"; + auto instance_name = to_name(var.self); + uint32_t location = ir.meta[var.self].decoration.location; + + string buffer_name; + auto flags = ir.meta[type.self].decoration.decoration_flags; + if (flags.get(DecorationBlock)) + { + emit_block_struct(type); + buffer_name = to_name(type.self); + } + else + buffer_name = type_to_glsl(type); + + statement("internal::", qual, "<", buffer_name, type_to_array_glsl(type, var.self), "> ", instance_name, "__;"); + statement_no_indent("#define ", instance_name, " __res->", instance_name, "__.get()"); + resource_registrations.push_back(join("s.register_", lowerqual, "(", instance_name, "__", ", ", location, ");")); + statement(""); +} + +void CompilerCPP::emit_shared(const SPIRVariable &var) +{ + add_resource_name(var.self); + + auto instance_name = to_name(var.self); + statement(CompilerGLSL::variable_decl(var), ";"); + statement_no_indent("#define ", instance_name, " __res->", instance_name); +} + +void CompilerCPP::emit_uniform(const SPIRVariable &var) +{ + add_resource_name(var.self); + + auto &type = get(var.basetype); + auto instance_name = to_name(var.self); + + uint32_t descriptor_set = ir.meta[var.self].decoration.set; + uint32_t binding = ir.meta[var.self].decoration.binding; + uint32_t location = ir.meta[var.self].decoration.location; + + string type_name = type_to_glsl(type); + remap_variable_type_name(type, instance_name, type_name); + + if (type.basetype == SPIRType::Image || type.basetype == SPIRType::SampledImage || + type.basetype == SPIRType::AtomicCounter) + { + statement("internal::Resource<", type_name, type_to_array_glsl(type, var.self), "> ", instance_name, "__;"); + statement_no_indent("#define ", instance_name, " __res->", instance_name, "__.get()"); + resource_registrations.push_back( + join("s.register_resource(", instance_name, "__", ", ", descriptor_set, ", ", binding, ");")); + } + else + { + statement("internal::UniformConstant<", type_name, type_to_array_glsl(type, var.self), "> ", instance_name, "__;"); + statement_no_indent("#define ", instance_name, " __res->", instance_name, "__.get()"); + resource_registrations.push_back( + join("s.register_uniform_constant(", instance_name, "__", ", ", location, ");")); + } + + statement(""); +} + +void CompilerCPP::emit_push_constant_block(const SPIRVariable &var) +{ + add_resource_name(var.self); + + auto &type = get(var.basetype); + auto &flags = ir.meta[var.self].decoration.decoration_flags; + if (flags.get(DecorationBinding) || flags.get(DecorationDescriptorSet)) + SPIRV_CROSS_THROW("Push constant blocks cannot be compiled to GLSL with Binding or Set syntax. " + "Remap to location with reflection API first or disable these decorations."); + + emit_block_struct(type); + auto buffer_name = to_name(type.self); + auto instance_name = to_name(var.self); + + statement("internal::PushConstant<", buffer_name, type_to_array_glsl(type, var.self), "> ", instance_name, ";"); + statement_no_indent("#define ", instance_name, " __res->", instance_name, ".get()"); + resource_registrations.push_back(join("s.register_push_constant(", instance_name, "__", ");")); + statement(""); +} + +void CompilerCPP::emit_block_struct(SPIRType &type) +{ + // C++ can't do interface blocks, so we fake it by emitting a separate struct. + // However, these structs are not allowed to alias anything, so remove it before + // emitting the struct. + // + // The type we have here needs to be resolved to the non-pointer type so we can remove aliases. + auto &self = get(type.self); + self.type_alias = 0; + emit_struct(self); +} + +void CompilerCPP::emit_resources() +{ + for (auto &id : ir.ids) + { + if (id.get_type() == TypeConstant) + { + auto &c = id.get(); + + bool needs_declaration = c.specialization || c.is_used_as_lut; + + if (needs_declaration) + { + if (!options.vulkan_semantics && c.specialization) + { + c.specialization_constant_macro_name = + constant_value_macro_name(get_decoration(c.self, DecorationSpecId)); + } + emit_constant(c); + } + } + else if (id.get_type() == TypeConstantOp) + { + emit_specialization_constant_op(id.get()); + } + } + + // Output all basic struct types which are not Block or BufferBlock as these are declared inplace + // when such variables are instantiated. + for (auto &id : ir.ids) + { + if (id.get_type() == TypeType) + { + auto &type = id.get(); + if (type.basetype == SPIRType::Struct && type.array.empty() && !type.pointer && + (!ir.meta[type.self].decoration.decoration_flags.get(DecorationBlock) && + !ir.meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock))) + { + emit_struct(type); + } + } + } + + statement("struct Resources : ", resource_type); + begin_scope(); + + // Output UBOs and SSBOs + for (auto &id : ir.ids) + { + if (id.get_type() == TypeVariable) + { + auto &var = id.get(); + auto &type = get(var.basetype); + + if (var.storage != StorageClassFunction && type.pointer && type.storage == StorageClassUniform && + !is_hidden_variable(var) && + (ir.meta[type.self].decoration.decoration_flags.get(DecorationBlock) || + ir.meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock))) + { + emit_buffer_block(var); + } + } + } + + // Output push constant blocks + for (auto &id : ir.ids) + { + if (id.get_type() == TypeVariable) + { + auto &var = id.get(); + auto &type = get(var.basetype); + if (!is_hidden_variable(var) && var.storage != StorageClassFunction && type.pointer && + type.storage == StorageClassPushConstant) + { + emit_push_constant_block(var); + } + } + } + + // Output in/out interfaces. + for (auto &id : ir.ids) + { + if (id.get_type() == TypeVariable) + { + auto &var = id.get(); + auto &type = get(var.basetype); + + if (var.storage != StorageClassFunction && !is_hidden_variable(var) && type.pointer && + (var.storage == StorageClassInput || var.storage == StorageClassOutput) && + interface_variable_exists_in_entry_point(var.self)) + { + emit_interface_block(var); + } + } + } + + // Output Uniform Constants (values, samplers, images, etc). + for (auto &id : ir.ids) + { + if (id.get_type() == TypeVariable) + { + auto &var = id.get(); + auto &type = get(var.basetype); + + if (var.storage != StorageClassFunction && !is_hidden_variable(var) && type.pointer && + (type.storage == StorageClassUniformConstant || type.storage == StorageClassAtomicCounter)) + { + emit_uniform(var); + } + } + } + + // Global variables. + bool emitted = false; + for (auto global : global_variables) + { + auto &var = get(global); + if (var.storage == StorageClassWorkgroup) + { + emit_shared(var); + emitted = true; + } + } + + if (emitted) + statement(""); + + statement("inline void init(spirv_cross_shader& s)"); + begin_scope(); + statement(resource_type, "::init(s);"); + for (auto ® : resource_registrations) + statement(reg); + end_scope(); + resource_registrations.clear(); + + end_scope_decl(); + + statement(""); + statement("Resources* __res;"); + if (get_entry_point().model == ExecutionModelGLCompute) + statement("ComputePrivateResources __priv_res;"); + statement(""); + + // Emit regular globals which are allocated per invocation. + emitted = false; + for (auto global : global_variables) + { + auto &var = get(global); + if (var.storage == StorageClassPrivate) + { + if (var.storage == StorageClassWorkgroup) + emit_shared(var); + else + statement(CompilerGLSL::variable_decl(var), ";"); + emitted = true; + } + } + + if (emitted) + statement(""); +} + +string CompilerCPP::compile() +{ + ir.fixup_reserved_names(); + + // Do not deal with ES-isms like precision, older extensions and such. + options.es = false; + options.version = 450; + backend.float_literal_suffix = true; + backend.double_literal_suffix = false; + backend.long_long_literal_suffix = true; + backend.uint32_t_literal_suffix = true; + backend.basic_int_type = "int32_t"; + backend.basic_uint_type = "uint32_t"; + backend.swizzle_is_function = true; + backend.shared_is_implied = true; + backend.unsized_array_supported = false; + backend.explicit_struct_type = true; + backend.use_initializer_list = true; + + fixup_type_alias(); + reorder_type_alias(); + build_function_control_flow_graphs_and_analyze(); + update_active_builtins(); + + uint32_t pass_count = 0; + do + { + resource_registrations.clear(); + reset(pass_count); + + // Move constructor for this type is broken on GCC 4.9 ... + buffer.reset(); + + emit_header(); + emit_resources(); + + emit_function(get(ir.default_entry_point), Bitset()); + + pass_count++; + } while (is_forcing_recompilation()); + + // Match opening scope of emit_header(). + end_scope_decl(); + // namespace + end_scope(); + + // Emit C entry points + emit_c_linkage(); + + // Entry point in CPP is always main() for the time being. + get_entry_point().name = "main"; + + return buffer.str(); +} + +void CompilerCPP::emit_c_linkage() +{ + statement(""); + + statement("spirv_cross_shader_t *spirv_cross_construct(void)"); + begin_scope(); + statement("return new ", impl_type, "();"); + end_scope(); + + statement(""); + statement("void spirv_cross_destruct(spirv_cross_shader_t *shader)"); + begin_scope(); + statement("delete static_cast<", impl_type, "*>(shader);"); + end_scope(); + + statement(""); + statement("void spirv_cross_invoke(spirv_cross_shader_t *shader)"); + begin_scope(); + statement("static_cast<", impl_type, "*>(shader)->invoke();"); + end_scope(); + + statement(""); + statement("static const struct spirv_cross_interface vtable ="); + begin_scope(); + statement("spirv_cross_construct,"); + statement("spirv_cross_destruct,"); + statement("spirv_cross_invoke,"); + end_scope_decl(); + + statement(""); + statement("const struct spirv_cross_interface *", + interface_name.empty() ? string("spirv_cross_get_interface") : interface_name, "(void)"); + begin_scope(); + statement("return &vtable;"); + end_scope(); +} + +void CompilerCPP::emit_function_prototype(SPIRFunction &func, const Bitset &) +{ + if (func.self != ir.default_entry_point) + add_function_overload(func); + + local_variable_names = resource_names; + string decl; + + auto &type = get(func.return_type); + decl += "inline "; + decl += type_to_glsl(type); + decl += " "; + + if (func.self == ir.default_entry_point) + { + decl += "main"; + processing_entry_point = true; + } + else + decl += to_name(func.self); + + decl += "("; + for (auto &arg : func.arguments) + { + add_local_variable_name(arg.id); + + decl += argument_decl(arg); + if (&arg != &func.arguments.back()) + decl += ", "; + + // Hold a pointer to the parameter so we can invalidate the readonly field if needed. + auto *var = maybe_get(arg.id); + if (var) + var->parameter = &arg; + } + + decl += ")"; + statement(decl); +} + +string CompilerCPP::argument_decl(const SPIRFunction::Parameter &arg) +{ + auto &type = expression_type(arg.id); + bool constref = !type.pointer || arg.write_count == 0; + + auto &var = get(arg.id); + + string base = type_to_glsl(type); + string variable_name = to_name(var.self); + remap_variable_type_name(type, variable_name, base); + + for (uint32_t i = 0; i < type.array.size(); i++) + base = join("std::array<", base, ", ", to_array_size(type, i), ">"); + + return join(constref ? "const " : "", base, " &", variable_name); +} + +string CompilerCPP::variable_decl(const SPIRType &type, const string &name, uint32_t /* id */) +{ + string base = type_to_glsl(type); + remap_variable_type_name(type, name, base); + bool runtime = false; + + for (uint32_t i = 0; i < type.array.size(); i++) + { + auto &array = type.array[i]; + if (!array && type.array_size_literal[i]) + { + // Avoid using runtime arrays with std::array since this is undefined. + // Runtime arrays cannot be passed around as values, so this is fine. + runtime = true; + } + else + base = join("std::array<", base, ", ", to_array_size(type, i), ">"); + } + base += ' '; + return base + name + (runtime ? "[1]" : ""); +} + +void CompilerCPP::emit_header() +{ + auto &execution = get_entry_point(); + + statement("// This C++ shader is autogenerated by spirv-cross."); + statement("#include \"spirv_cross/internal_interface.hpp\""); + statement("#include \"spirv_cross/external_interface.h\""); + // Needed to properly implement GLSL-style arrays. + statement("#include "); + statement("#include "); + statement(""); + statement("using namespace spirv_cross;"); + statement("using namespace glm;"); + statement(""); + + statement("namespace Impl"); + begin_scope(); + + switch (execution.model) + { + case ExecutionModelGeometry: + case ExecutionModelTessellationControl: + case ExecutionModelTessellationEvaluation: + case ExecutionModelGLCompute: + case ExecutionModelFragment: + case ExecutionModelVertex: + statement("struct Shader"); + begin_scope(); + break; + + default: + SPIRV_CROSS_THROW("Unsupported execution model."); + } + + switch (execution.model) + { + case ExecutionModelGeometry: + impl_type = "GeometryShader"; + resource_type = "GeometryResources"; + break; + + case ExecutionModelVertex: + impl_type = "VertexShader"; + resource_type = "VertexResources"; + break; + + case ExecutionModelFragment: + impl_type = "FragmentShader"; + resource_type = "FragmentResources"; + break; + + case ExecutionModelGLCompute: + impl_type = join("ComputeShader"); + resource_type = "ComputeResources"; + break; + + case ExecutionModelTessellationControl: + impl_type = "TessControlShader"; + resource_type = "TessControlResources"; + break; + + case ExecutionModelTessellationEvaluation: + impl_type = "TessEvaluationShader"; + resource_type = "TessEvaluationResources"; + break; + + default: + SPIRV_CROSS_THROW("Unsupported execution model."); + } +} diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cpp.hpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cpp.hpp new file mode 100644 index 0000000000..c76629cdcb --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cpp.hpp @@ -0,0 +1,93 @@ +/* + * Copyright 2015-2021 Arm Limited + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#ifndef SPIRV_CROSS_CPP_HPP +#define SPIRV_CROSS_CPP_HPP + +#include "spirv_glsl.hpp" +#include + +namespace SPIRV_CROSS_NAMESPACE +{ +class CompilerCPP : public CompilerGLSL +{ +public: + explicit CompilerCPP(std::vector spirv_) + : CompilerGLSL(std::move(spirv_)) + { + } + + CompilerCPP(const uint32_t *ir_, size_t word_count) + : CompilerGLSL(ir_, word_count) + { + } + + explicit CompilerCPP(const ParsedIR &ir_) + : CompilerGLSL(ir_) + { + } + + explicit CompilerCPP(ParsedIR &&ir_) + : CompilerGLSL(std::move(ir_)) + { + } + + std::string compile() override; + + // Sets a custom symbol name that can override + // spirv_cross_get_interface. + // + // Useful when several shader interfaces are linked + // statically into the same binary. + void set_interface_name(std::string name) + { + interface_name = std::move(name); + } + +private: + void emit_header() override; + void emit_c_linkage(); + void emit_function_prototype(SPIRFunction &func, const Bitset &return_flags) override; + + void emit_resources(); + void emit_buffer_block(const SPIRVariable &type) override; + void emit_push_constant_block(const SPIRVariable &var) override; + void emit_interface_block(const SPIRVariable &type); + void emit_block_chain(SPIRBlock &block); + void emit_uniform(const SPIRVariable &var) override; + void emit_shared(const SPIRVariable &var); + void emit_block_struct(SPIRType &type); + std::string variable_decl(const SPIRType &type, const std::string &name, uint32_t id) override; + + std::string argument_decl(const SPIRFunction::Parameter &arg); + + SmallVector resource_registrations; + std::string impl_type; + std::string resource_type; + uint32_t shared_counter = 0; + + std::string interface_name; +}; +} // namespace SPIRV_CROSS_NAMESPACE + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross.cpp new file mode 100644 index 0000000000..1031d3ff65 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross.cpp @@ -0,0 +1,5807 @@ +/* + * Copyright 2015-2021 Arm Limited + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#include "spirv_cross.hpp" +#include "GLSL.std.450.h" +#include "spirv_cfg.hpp" +#include "spirv_common.hpp" +#include "spirv_parser.hpp" +#include +#include +#include + +using namespace std; +using namespace SPIRV_CROSS_SPV_HEADER_NAMESPACE; +using namespace SPIRV_CROSS_NAMESPACE; + +Compiler::Compiler(vector ir_) +{ + Parser parser(std::move(ir_)); + parser.parse(); + set_ir(std::move(parser.get_parsed_ir())); +} + +Compiler::Compiler(const uint32_t *ir_, size_t word_count) +{ + Parser parser(ir_, word_count); + parser.parse(); + set_ir(std::move(parser.get_parsed_ir())); +} + +Compiler::Compiler(const ParsedIR &ir_) +{ + set_ir(ir_); +} + +Compiler::Compiler(ParsedIR &&ir_) +{ + set_ir(std::move(ir_)); +} + +void Compiler::set_ir(ParsedIR &&ir_) +{ + ir = std::move(ir_); + parse_fixup(); +} + +void Compiler::set_ir(const ParsedIR &ir_) +{ + ir = ir_; + parse_fixup(); +} + +string Compiler::compile() +{ + return ""; +} + +bool Compiler::variable_storage_is_aliased(const SPIRVariable &v) +{ + auto &type = get(v.basetype); + bool ssbo = v.storage == StorageClassStorageBuffer || + ir.meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock); + bool image = type.basetype == SPIRType::Image; + bool counter = type.basetype == SPIRType::AtomicCounter; + bool buffer_reference = type.storage == StorageClassPhysicalStorageBuffer; + + bool is_restrict; + if (ssbo) + is_restrict = ir.get_buffer_block_flags(v).get(DecorationRestrict); + else + is_restrict = has_decoration(v.self, DecorationRestrict); + + return !is_restrict && (ssbo || image || counter || buffer_reference); +} + +bool Compiler::block_is_control_dependent(const SPIRBlock &block) +{ + for (auto &i : block.ops) + { + auto ops = stream(i); + auto op = static_cast(i.op); + + switch (op) + { + case OpFunctionCall: + { + uint32_t func = ops[2]; + if (function_is_control_dependent(get(func))) + return true; + break; + } + + // Derivatives + case OpDPdx: + case OpDPdxCoarse: + case OpDPdxFine: + case OpDPdy: + case OpDPdyCoarse: + case OpDPdyFine: + case OpFwidth: + case OpFwidthCoarse: + case OpFwidthFine: + + // Anything implicit LOD + case OpImageSampleImplicitLod: + case OpImageSampleDrefImplicitLod: + case OpImageSampleProjImplicitLod: + case OpImageSampleProjDrefImplicitLod: + case OpImageSparseSampleImplicitLod: + case OpImageSparseSampleDrefImplicitLod: + case OpImageSparseSampleProjImplicitLod: + case OpImageSparseSampleProjDrefImplicitLod: + case OpImageQueryLod: + case OpImageDrefGather: + case OpImageGather: + case OpImageSparseDrefGather: + case OpImageSparseGather: + + // Anything subgroups + case OpGroupNonUniformElect: + case OpGroupNonUniformAll: + case OpGroupNonUniformAny: + case OpGroupNonUniformAllEqual: + case OpGroupNonUniformBroadcast: + case OpGroupNonUniformBroadcastFirst: + case OpGroupNonUniformBallot: + case OpGroupNonUniformInverseBallot: + case OpGroupNonUniformBallotBitExtract: + case OpGroupNonUniformBallotBitCount: + case OpGroupNonUniformBallotFindLSB: + case OpGroupNonUniformBallotFindMSB: + case OpGroupNonUniformShuffle: + case OpGroupNonUniformShuffleXor: + case OpGroupNonUniformShuffleUp: + case OpGroupNonUniformShuffleDown: + case OpGroupNonUniformIAdd: + case OpGroupNonUniformFAdd: + case OpGroupNonUniformIMul: + case OpGroupNonUniformFMul: + case OpGroupNonUniformSMin: + case OpGroupNonUniformUMin: + case OpGroupNonUniformFMin: + case OpGroupNonUniformSMax: + case OpGroupNonUniformUMax: + case OpGroupNonUniformFMax: + case OpGroupNonUniformBitwiseAnd: + case OpGroupNonUniformBitwiseOr: + case OpGroupNonUniformBitwiseXor: + case OpGroupNonUniformLogicalAnd: + case OpGroupNonUniformLogicalOr: + case OpGroupNonUniformLogicalXor: + case OpGroupNonUniformQuadBroadcast: + case OpGroupNonUniformQuadSwap: + case OpGroupNonUniformRotateKHR: + + // Control barriers + case OpControlBarrier: + return true; + + default: + break; + } + } + + return false; +} + +bool Compiler::block_is_pure(const SPIRBlock &block) +{ + // This is a global side effect of the function. + if (block.terminator == SPIRBlock::Kill || + block.terminator == SPIRBlock::TerminateRay || + block.terminator == SPIRBlock::IgnoreIntersection || + block.terminator == SPIRBlock::EmitMeshTasks) + return false; + + for (auto &i : block.ops) + { + auto ops = stream(i); + auto op = static_cast(i.op); + + switch (op) + { + case OpFunctionCall: + { + uint32_t func = ops[2]; + if (!function_is_pure(get(func))) + return false; + break; + } + + case OpCopyMemory: + case OpStore: + case OpCooperativeMatrixStoreKHR: + { + auto &type = expression_type(ops[0]); + if (type.storage != StorageClassFunction) + return false; + break; + } + + case OpImageWrite: + return false; + + // Atomics are impure. + case OpAtomicLoad: + case OpAtomicStore: + case OpAtomicExchange: + case OpAtomicCompareExchange: + case OpAtomicCompareExchangeWeak: + case OpAtomicIIncrement: + case OpAtomicIDecrement: + case OpAtomicIAdd: + case OpAtomicISub: + case OpAtomicSMin: + case OpAtomicUMin: + case OpAtomicSMax: + case OpAtomicUMax: + case OpAtomicAnd: + case OpAtomicOr: + case OpAtomicXor: + return false; + + // Geometry shader builtins modify global state. + case OpEndPrimitive: + case OpEmitStreamVertex: + case OpEndStreamPrimitive: + case OpEmitVertex: + return false; + + // Mesh shader functions modify global state. + // (EmitMeshTasks is a terminator). + case OpSetMeshOutputsEXT: + return false; + + // Barriers disallow any reordering, so we should treat blocks with barrier as writing. + case OpControlBarrier: + case OpMemoryBarrier: + return false; + + // Ray tracing builtins are impure. + case OpReportIntersectionKHR: + case OpIgnoreIntersectionNV: + case OpTerminateRayNV: + case OpTraceNV: + case OpTraceRayKHR: + case OpExecuteCallableNV: + case OpExecuteCallableKHR: + case OpRayQueryInitializeKHR: + case OpRayQueryTerminateKHR: + case OpRayQueryGenerateIntersectionKHR: + case OpRayQueryConfirmIntersectionKHR: + case OpRayQueryProceedKHR: + // There are various getters in ray query, but they are considered pure. + return false; + + // OpExtInst is potentially impure depending on extension, but GLSL builtins are at least pure. + + case OpDemoteToHelperInvocationEXT: + // This is a global side effect of the function. + return false; + + case OpTensorReadARM: + return false; + + case OpExtInst: + { + uint32_t extension_set = ops[2]; + if (get(extension_set).ext == SPIRExtension::GLSL) + { + auto op_450 = static_cast(ops[3]); + switch (op_450) + { + case GLSLstd450Modf: + case GLSLstd450Frexp: + { + auto &type = expression_type(ops[5]); + if (type.storage != StorageClassFunction) + return false; + break; + } + + default: + break; + } + } + break; + } + + default: + break; + } + } + + return true; +} + +string Compiler::to_name(uint32_t id, bool allow_alias) const +{ + if (allow_alias && ir.ids[id].get_type() == TypeType) + { + // If this type is a simple alias, emit the + // name of the original type instead. + // We don't want to override the meta alias + // as that can be overridden by the reflection APIs after parse. + auto &type = get(id); + if (type.type_alias) + { + // If the alias master has been specially packed, we will have emitted a clean variant as well, + // so skip the name aliasing here. + if (!has_extended_decoration(type.type_alias, SPIRVCrossDecorationBufferBlockRepacked)) + return to_name(type.type_alias); + } + } + + auto &alias = ir.get_name(id); + if (alias.empty()) + return join("_", id); + else + return alias; +} + +bool Compiler::function_is_pure(const SPIRFunction &func) +{ + for (auto block : func.blocks) + if (!block_is_pure(get(block))) + return false; + + return true; +} + +bool Compiler::function_is_control_dependent(const SPIRFunction &func) +{ + for (auto block : func.blocks) + if (block_is_control_dependent(get(block))) + return true; + + return false; +} + +void Compiler::register_global_read_dependencies(const SPIRBlock &block, uint32_t id) +{ + for (auto &i : block.ops) + { + auto ops = stream(i); + auto op = static_cast(i.op); + + switch (op) + { + case OpFunctionCall: + { + uint32_t func = ops[2]; + register_global_read_dependencies(get(func), id); + break; + } + + case OpLoad: + case OpCooperativeMatrixLoadKHR: + case OpCooperativeVectorLoadNV: + case OpImageRead: + { + // If we're in a storage class which does not get invalidated, adding dependencies here is no big deal. + auto *var = maybe_get_backing_variable(ops[2]); + if (var && var->storage != StorageClassFunction) + { + auto &type = get(var->basetype); + + // InputTargets are immutable. + if (type.basetype != SPIRType::Image && type.image.dim != DimSubpassData) + var->dependees.push_back(id); + } + break; + } + + default: + break; + } + } +} + +void Compiler::register_global_read_dependencies(const SPIRFunction &func, uint32_t id) +{ + for (auto block : func.blocks) + register_global_read_dependencies(get(block), id); +} + +SPIRVariable *Compiler::maybe_get_backing_variable(uint32_t chain) +{ + auto *var = maybe_get(chain); + if (!var) + { + auto *cexpr = maybe_get(chain); + if (cexpr) + var = maybe_get(cexpr->loaded_from); + + auto *access_chain = maybe_get(chain); + if (access_chain) + var = maybe_get(access_chain->loaded_from); + } + + return var; +} + +void Compiler::register_read(uint32_t expr, uint32_t chain, bool forwarded) +{ + auto &e = get(expr); + auto *var = maybe_get_backing_variable(chain); + + if (var) + { + e.loaded_from = var->self; + + // If the backing variable is immutable, we do not need to depend on the variable. + if (forwarded && !is_immutable(var->self)) + var->dependees.push_back(e.self); + + // If we load from a parameter, make sure we create "inout" if we also write to the parameter. + // The default is "in" however, so we never invalidate our compilation by reading. + if (var && var->parameter) + var->parameter->read_count++; + } +} + +void Compiler::register_write(uint32_t chain) +{ + auto *var = maybe_get(chain); + if (!var) + { + // If we're storing through an access chain, invalidate the backing variable instead. + auto *expr = maybe_get(chain); + if (expr && expr->loaded_from) + var = maybe_get(expr->loaded_from); + + auto *access_chain = maybe_get(chain); + if (access_chain && access_chain->loaded_from) + var = maybe_get(access_chain->loaded_from); + } + + auto &chain_type = expression_type(chain); + + if (var) + { + bool check_argument_storage_qualifier = true; + auto &type = expression_type(chain); + + // If our variable is in a storage class which can alias with other buffers, + // invalidate all variables which depend on aliased variables. And if this is a + // variable pointer, then invalidate all variables regardless. + if (get_variable_data_type(*var).pointer) + { + flush_all_active_variables(); + + if (type.pointer_depth == 1) + { + // We have a backing variable which is a pointer-to-pointer type. + // We are storing some data through a pointer acquired through that variable, + // but we are not writing to the value of the variable itself, + // i.e., we are not modifying the pointer directly. + // If we are storing a non-pointer type (pointer_depth == 1), + // we know that we are storing some unrelated data. + // A case here would be + // void foo(Foo * const *arg) { + // Foo *bar = *arg; + // bar->unrelated = 42; + // } + // arg, the argument is constant. + check_argument_storage_qualifier = false; + } + } + + if (type.storage == StorageClassPhysicalStorageBuffer || variable_storage_is_aliased(*var)) + flush_all_aliased_variables(); + else if (var) + flush_dependees(*var); + + // We tried to write to a parameter which is not marked with out qualifier, force a recompile. + if (check_argument_storage_qualifier && var->parameter && var->parameter->write_count == 0) + { + var->parameter->write_count++; + force_recompile(); + } + } + else if (chain_type.pointer) + { + // If we stored through a variable pointer, then we don't know which + // variable we stored to. So *all* expressions after this point need to + // be invalidated. + // FIXME: If we can prove that the variable pointer will point to + // only certain variables, we can invalidate only those. + flush_all_active_variables(); + } + + // If chain_type.pointer is false, we're not writing to memory backed variables, but temporaries instead. + // This can happen in copy_logical_type where we unroll complex reads and writes to temporaries. +} + +void Compiler::flush_dependees(SPIRVariable &var) +{ + for (auto expr : var.dependees) + invalid_expressions.insert(expr); + var.dependees.clear(); +} + +void Compiler::flush_all_aliased_variables() +{ + for (auto aliased : aliased_variables) + flush_dependees(get(aliased)); +} + +void Compiler::flush_all_atomic_capable_variables() +{ + for (auto global : global_variables) + flush_dependees(get(global)); + flush_all_aliased_variables(); +} + +void Compiler::flush_control_dependent_expressions(uint32_t block_id) +{ + auto &block = get(block_id); + for (auto &expr : block.invalidate_expressions) + invalid_expressions.insert(expr); + block.invalidate_expressions.clear(); +} + +void Compiler::flush_all_active_variables() +{ + // Invalidate all temporaries we read from variables in this block since they were forwarded. + // Invalidate all temporaries we read from globals. + for (auto &v : current_function->local_variables) + flush_dependees(get(v)); + for (auto &arg : current_function->arguments) + flush_dependees(get(arg.id)); + for (auto global : global_variables) + flush_dependees(get(global)); + + flush_all_aliased_variables(); +} + +uint32_t Compiler::expression_type_id(uint32_t id) const +{ + switch (ir.ids[id].get_type()) + { + case TypeVariable: + return get(id).basetype; + + case TypeExpression: + return get(id).expression_type; + + case TypeConstant: + return get(id).constant_type; + + case TypeConstantOp: + return get(id).basetype; + + case TypeUndef: + return get(id).basetype; + + case TypeCombinedImageSampler: + return get(id).combined_type; + + case TypeAccessChain: + return get(id).basetype; + + default: + SPIRV_CROSS_THROW("Cannot resolve expression type."); + } +} + +const SPIRType &Compiler::expression_type(uint32_t id) const +{ + return get(expression_type_id(id)); +} + +bool Compiler::expression_is_lvalue(uint32_t id) const +{ + auto &type = expression_type(id); + + switch (type.basetype) + { + case SPIRType::SampledImage: + case SPIRType::Image: + case SPIRType::Sampler: + return false; + + default: + return true; + } +} + +bool Compiler::is_immutable(uint32_t id) const +{ + if (ir.ids[id].get_type() == TypeVariable) + { + auto &var = get(id); + + // Anything we load from the UniformConstant address space is guaranteed to be immutable. + bool pointer_to_const = var.storage == StorageClassUniformConstant; + return pointer_to_const || var.phi_variable || !expression_is_lvalue(id); + } + else if (ir.ids[id].get_type() == TypeAccessChain) + return get(id).immutable; + else if (ir.ids[id].get_type() == TypeExpression) + return get(id).immutable; + else if (ir.ids[id].get_type() == TypeConstant || ir.ids[id].get_type() == TypeConstantOp || + ir.ids[id].get_type() == TypeUndef) + return true; + else + return false; +} + +static inline bool storage_class_is_interface(StorageClass storage) +{ + switch (storage) + { + case StorageClassInput: + case StorageClassOutput: + case StorageClassUniform: + case StorageClassUniformConstant: + case StorageClassAtomicCounter: + case StorageClassPushConstant: + case StorageClassStorageBuffer: + return true; + + default: + return false; + } +} + +bool Compiler::is_hidden_variable(const SPIRVariable &var, bool include_builtins) const +{ + if ((is_builtin_variable(var) && !include_builtins) || var.remapped_variable) + return true; + + // Combined image samplers are always considered active as they are "magic" variables. + if (find_if(begin(combined_image_samplers), end(combined_image_samplers), [&var](const CombinedImageSampler &samp) { + return samp.combined_id == var.self; + }) != end(combined_image_samplers)) + { + return false; + } + + // In SPIR-V 1.4 and up we must also use the active variable interface to disable global variables + // which are not part of the entry point. + if (ir.get_spirv_version() >= 0x10400 && var.storage != StorageClassGeneric && + var.storage != StorageClassFunction && !interface_variable_exists_in_entry_point(var.self)) + { + return true; + } + + return check_active_interface_variables && storage_class_is_interface(var.storage) && + active_interface_variables.find(var.self) == end(active_interface_variables); +} + +bool Compiler::is_builtin_type(const SPIRType &type) const +{ + auto *type_meta = ir.find_meta(type.self); + + // We can have builtin structs as well. If one member of a struct is builtin, the struct must also be builtin. + if (type_meta) + for (auto &m : type_meta->members) + if (m.builtin) + return true; + + return false; +} + +bool Compiler::is_builtin_variable(const SPIRVariable &var) const +{ + auto *m = ir.find_meta(var.self); + + if (var.compat_builtin || (m && m->decoration.builtin)) + return true; + else + return is_builtin_type(get(var.basetype)); +} + +bool Compiler::is_member_builtin(const SPIRType &type, uint32_t index, BuiltIn *builtin) const +{ + auto *type_meta = ir.find_meta(type.self); + + if (type_meta) + { + auto &memb = type_meta->members; + if (index < memb.size() && memb[index].builtin) + { + if (builtin) + *builtin = memb[index].builtin_type; + return true; + } + } + + return false; +} + +bool Compiler::is_scalar(const SPIRType &type) const +{ + return type.basetype != SPIRType::Struct && type.vecsize == 1 && type.columns == 1; +} + +bool Compiler::is_vector(const SPIRType &type) const +{ + return type.vecsize > 1 && type.columns == 1; +} + +bool Compiler::is_matrix(const SPIRType &type) const +{ + return type.vecsize > 1 && type.columns > 1; +} + +bool Compiler::is_array(const SPIRType &type) const +{ + return type.op == OpTypeArray || type.op == OpTypeRuntimeArray; +} + +bool Compiler::is_pointer(const SPIRType &type) const +{ + return type.op == OpTypePointer && type.basetype != SPIRType::Unknown; // Ignore function pointers. +} + +bool Compiler::is_physical_pointer(const SPIRType &type) const +{ + return type.op == OpTypePointer && type.storage == StorageClassPhysicalStorageBuffer; +} + +bool Compiler::is_physical_or_buffer_pointer(const SPIRType &type) const +{ + return type.op == OpTypePointer && + (type.storage == StorageClassPhysicalStorageBuffer || type.storage == StorageClassUniform || + type.storage == StorageClassStorageBuffer || type.storage == StorageClassWorkgroup || + type.storage == StorageClassPushConstant); +} + +bool Compiler::is_physical_pointer_to_buffer_block(const SPIRType &type) const +{ + return is_physical_pointer(type) && get_pointee_type(type).self == type.parent_type && + (has_decoration(type.self, DecorationBlock) || + has_decoration(type.self, DecorationBufferBlock)); +} + +bool Compiler::is_runtime_size_array(const SPIRType &type) +{ + return type.op == OpTypeRuntimeArray; +} + +ShaderResources Compiler::get_shader_resources() const +{ + return get_shader_resources(nullptr); +} + +ShaderResources Compiler::get_shader_resources(const unordered_set &active_variables) const +{ + return get_shader_resources(&active_variables); +} + +bool Compiler::InterfaceVariableAccessHandler::handle(Op opcode, const uint32_t *args, uint32_t length) +{ + uint32_t variable = 0; + switch (opcode) + { + // Need this first, otherwise, GCC complains about unhandled switch statements. + default: + break; + + case OpFunctionCall: + { + // Invalid SPIR-V. + if (length < 3) + return false; + + uint32_t count = length - 3; + args += 3; + for (uint32_t i = 0; i < count; i++) + { + auto *var = compiler.maybe_get(args[i]); + if (var && storage_class_is_interface(var->storage)) + variables.insert(args[i]); + } + break; + } + + case OpSelect: + { + // Invalid SPIR-V. + if (length < 5) + return false; + + uint32_t count = length - 3; + args += 3; + for (uint32_t i = 0; i < count; i++) + { + auto *var = compiler.maybe_get(args[i]); + if (var && storage_class_is_interface(var->storage)) + variables.insert(args[i]); + } + break; + } + + case OpPhi: + { + // Invalid SPIR-V. + if (length < 2) + return false; + + uint32_t count = length - 2; + args += 2; + for (uint32_t i = 0; i < count; i += 2) + { + auto *var = compiler.maybe_get(args[i]); + if (var && storage_class_is_interface(var->storage)) + variables.insert(args[i]); + } + break; + } + + case OpAtomicStore: + case OpStore: + case OpCooperativeMatrixStoreKHR: + // Invalid SPIR-V. + if (length < 1) + return false; + variable = args[0]; + break; + + case OpCopyMemory: + { + if (length < 2) + return false; + + auto *var = compiler.maybe_get(args[0]); + if (var && storage_class_is_interface(var->storage)) + variables.insert(args[0]); + + var = compiler.maybe_get(args[1]); + if (var && storage_class_is_interface(var->storage)) + variables.insert(args[1]); + break; + } + + case OpExtInst: + { + if (length < 3) + return false; + auto &extension_set = compiler.get(args[2]); + switch (extension_set.ext) + { + case SPIRExtension::GLSL: + { + auto op = static_cast(args[3]); + + switch (op) + { + case GLSLstd450InterpolateAtCentroid: + case GLSLstd450InterpolateAtSample: + case GLSLstd450InterpolateAtOffset: + { + auto *var = compiler.maybe_get(args[4]); + if (var && storage_class_is_interface(var->storage)) + variables.insert(args[4]); + break; + } + + case GLSLstd450Modf: + case GLSLstd450Fract: + { + auto *var = compiler.maybe_get(args[5]); + if (var && storage_class_is_interface(var->storage)) + variables.insert(args[5]); + break; + } + + default: + break; + } + break; + } + case SPIRExtension::SPV_AMD_shader_explicit_vertex_parameter: + { + enum AMDShaderExplicitVertexParameter + { + InterpolateAtVertexAMD = 1 + }; + + auto op = static_cast(args[3]); + + switch (op) + { + case InterpolateAtVertexAMD: + { + auto *var = compiler.maybe_get(args[4]); + if (var && storage_class_is_interface(var->storage)) + variables.insert(args[4]); + break; + } + + default: + break; + } + break; + } + default: + break; + } + break; + } + + case OpAccessChain: + case OpInBoundsAccessChain: + case OpPtrAccessChain: + case OpLoad: + case OpCooperativeMatrixLoadKHR: + case OpCopyObject: + case OpImageTexelPointer: + case OpAtomicLoad: + case OpAtomicExchange: + case OpAtomicCompareExchange: + case OpAtomicCompareExchangeWeak: + case OpAtomicIIncrement: + case OpAtomicIDecrement: + case OpAtomicIAdd: + case OpAtomicISub: + case OpAtomicSMin: + case OpAtomicUMin: + case OpAtomicSMax: + case OpAtomicUMax: + case OpAtomicAnd: + case OpAtomicOr: + case OpAtomicXor: + case OpArrayLength: + // Invalid SPIR-V. + if (length < 3) + return false; + variable = args[2]; + break; + } + + if (variable) + { + auto *var = compiler.maybe_get(variable); + if (var && storage_class_is_interface(var->storage)) + variables.insert(variable); + } + return true; +} + +unordered_set Compiler::get_active_interface_variables() const +{ + // Traverse the call graph and find all interface variables which are in use. + unordered_set variables; + InterfaceVariableAccessHandler handler(*this, variables); + traverse_all_reachable_opcodes(get(ir.default_entry_point), handler); + + ir.for_each_typed_id([&](uint32_t, const SPIRVariable &var) { + if (var.storage != StorageClassOutput) + return; + if (!interface_variable_exists_in_entry_point(var.self)) + return; + + // An output variable which is just declared (but uninitialized) might be read by subsequent stages + // so we should force-enable these outputs, + // since compilation will fail if a subsequent stage attempts to read from the variable in question. + // Also, make sure we preserve output variables which are only initialized, but never accessed by any code. + if (var.initializer != ID(0) || get_execution_model() != ExecutionModelFragment) + variables.insert(var.self); + }); + + // If we needed to create one, we'll need it. + if (dummy_sampler_id) + variables.insert(dummy_sampler_id); + + return variables; +} + +void Compiler::set_enabled_interface_variables(std::unordered_set active_variables) +{ + active_interface_variables = std::move(active_variables); + check_active_interface_variables = true; +} + +ShaderResources Compiler::get_shader_resources(const unordered_set *active_variables) const +{ + ShaderResources res; + + bool ssbo_instance_name = reflection_ssbo_instance_name_is_significant(); + + ir.for_each_typed_id([&](uint32_t, const SPIRVariable &var) { + auto &type = this->get(var.basetype); + + // It is possible for uniform storage classes to be passed as function parameters, so detect + // that. To detect function parameters, check of StorageClass of variable is function scope. + if (var.storage == StorageClassFunction || !type.pointer) + return; + + if (active_variables && active_variables->find(var.self) == end(*active_variables)) + return; + + // In SPIR-V 1.4 and up, every global must be present in the entry point interface list, + // not just IO variables. + bool active_in_entry_point = true; + if (ir.get_spirv_version() < 0x10400) + { + if (var.storage == StorageClassInput || var.storage == StorageClassOutput) + active_in_entry_point = interface_variable_exists_in_entry_point(var.self); + } + else + active_in_entry_point = interface_variable_exists_in_entry_point(var.self); + + if (!active_in_entry_point) + return; + + bool is_builtin = is_builtin_variable(var); + + if (is_builtin) + { + if (var.storage != StorageClassInput && var.storage != StorageClassOutput) + return; + + auto &list = var.storage == StorageClassInput ? res.builtin_inputs : res.builtin_outputs; + BuiltInResource resource; + + if (has_decoration(type.self, DecorationBlock)) + { + resource.resource = { var.self, var.basetype, type.self, + get_remapped_declared_block_name(var.self, false) }; + + for (uint32_t i = 0; i < uint32_t(type.member_types.size()); i++) + { + resource.value_type_id = type.member_types[i]; + resource.builtin = BuiltIn(get_member_decoration(type.self, i, DecorationBuiltIn)); + list.push_back(resource); + } + } + else + { + bool strip_array = + !has_decoration(var.self, DecorationPatch) && ( + get_execution_model() == ExecutionModelTessellationControl || + (get_execution_model() == ExecutionModelTessellationEvaluation && + var.storage == StorageClassInput)); + + resource.resource = { var.self, var.basetype, type.self, get_name(var.self) }; + + if (strip_array && !type.array.empty()) + resource.value_type_id = get_variable_data_type(var).parent_type; + else + resource.value_type_id = get_variable_data_type_id(var); + + assert(resource.value_type_id); + + resource.builtin = BuiltIn(get_decoration(var.self, DecorationBuiltIn)); + list.push_back(std::move(resource)); + } + return; + } + + // Input + if (var.storage == StorageClassInput) + { + if (has_decoration(type.self, DecorationBlock)) + { + res.stage_inputs.push_back( + { var.self, var.basetype, type.self, + get_remapped_declared_block_name(var.self, false) }); + } + else + res.stage_inputs.push_back({ var.self, var.basetype, type.self, get_name(var.self) }); + } + // Subpass inputs + else if (var.storage == StorageClassUniformConstant && type.image.dim == DimSubpassData) + { + res.subpass_inputs.push_back({ var.self, var.basetype, type.self, get_name(var.self) }); + } + // Outputs + else if (var.storage == StorageClassOutput) + { + if (has_decoration(type.self, DecorationBlock)) + { + res.stage_outputs.push_back( + { var.self, var.basetype, type.self, get_remapped_declared_block_name(var.self, false) }); + } + else + res.stage_outputs.push_back({ var.self, var.basetype, type.self, get_name(var.self) }); + } + // UBOs + else if (type.storage == StorageClassUniform && has_decoration(type.self, DecorationBlock)) + { + res.uniform_buffers.push_back( + { var.self, var.basetype, type.self, get_remapped_declared_block_name(var.self, false) }); + } + // Old way to declare SSBOs. + else if (type.storage == StorageClassUniform && has_decoration(type.self, DecorationBufferBlock)) + { + res.storage_buffers.push_back( + { var.self, var.basetype, type.self, get_remapped_declared_block_name(var.self, ssbo_instance_name) }); + } + // Modern way to declare SSBOs. + else if (type.storage == StorageClassStorageBuffer) + { + res.storage_buffers.push_back( + { var.self, var.basetype, type.self, get_remapped_declared_block_name(var.self, ssbo_instance_name) }); + } + // Push constant blocks + else if (type.storage == StorageClassPushConstant) + { + // There can only be one push constant block, but keep the vector in case this restriction is lifted + // in the future. + res.push_constant_buffers.push_back({ var.self, var.basetype, type.self, get_name(var.self) }); + } + else if (type.storage == StorageClassShaderRecordBufferKHR) + { + res.shader_record_buffers.push_back({ var.self, var.basetype, type.self, get_remapped_declared_block_name(var.self, ssbo_instance_name) }); + } + // Atomic counters + else if (type.storage == StorageClassAtomicCounter) + { + res.atomic_counters.push_back({ var.self, var.basetype, type.self, get_name(var.self) }); + } + else if (type.storage == StorageClassUniformConstant) + { + if (type.basetype == SPIRType::Image) + { + // Images + if (type.image.sampled == 2) + { + res.storage_images.push_back({ var.self, var.basetype, type.self, get_name(var.self) }); + } + // Separate images + else if (type.image.sampled == 1) + { + res.separate_images.push_back({ var.self, var.basetype, type.self, get_name(var.self) }); + } + } + // Separate samplers + else if (type.basetype == SPIRType::Sampler) + { + res.separate_samplers.push_back({ var.self, var.basetype, type.self, get_name(var.self) }); + } + // Textures + else if (type.basetype == SPIRType::SampledImage) + { + res.sampled_images.push_back({ var.self, var.basetype, type.self, get_name(var.self) }); + } + // Acceleration structures + else if (type.basetype == SPIRType::AccelerationStructure) + { + res.acceleration_structures.push_back({ var.self, var.basetype, type.self, get_name(var.self) }); + } + // Tensors + else if (type.basetype == SPIRType::Tensor) + { + res.tensors.push_back({ var.self, var.basetype, type.self, get_name(var.self) }); + } + else + { + res.gl_plain_uniforms.push_back({ var.self, var.basetype, type.self, get_name(var.self) }); + } + } + }); + + return res; +} + +bool Compiler::type_is_top_level_block(const SPIRType &type) const +{ + if (type.basetype != SPIRType::Struct) + return false; + return has_decoration(type.self, DecorationBlock) || has_decoration(type.self, DecorationBufferBlock); +} + +bool Compiler::type_is_explicit_layout(const SPIRType &type) const +{ + if (type.basetype == SPIRType::Struct) + { + // Block-like types may have Offset decorations. + for (uint32_t i = 0; i < uint32_t(type.member_types.size()); i++) + if (has_member_decoration(type.self, i, DecorationOffset)) + return true; + } + + return false; +} + +bool Compiler::type_is_block_like(const SPIRType &type) const +{ + if (type_is_top_level_block(type)) + return true; + else + return type_is_explicit_layout(type); +} + +void Compiler::parse_fixup() +{ + // Figure out specialization constants for work group sizes. + for (auto id_ : ir.ids_for_constant_or_variable) + { + auto &id = ir.ids[id_]; + + if (id.get_type() == TypeConstant) + { + auto &c = id.get(); + if (has_decoration(c.self, DecorationBuiltIn) && + BuiltIn(get_decoration(c.self, DecorationBuiltIn)) == BuiltInWorkgroupSize) + { + // In current SPIR-V, there can be just one constant like this. + // All entry points will receive the constant value. + // WorkgroupSize take precedence over LocalSizeId. + for (auto &entry : ir.entry_points) + { + entry.second.workgroup_size.constant = c.self; + entry.second.workgroup_size.x = c.scalar(0, 0); + entry.second.workgroup_size.y = c.scalar(0, 1); + entry.second.workgroup_size.z = c.scalar(0, 2); + } + } + } + else if (id.get_type() == TypeVariable) + { + auto &var = id.get(); + if (var.storage == StorageClassPrivate || var.storage == StorageClassWorkgroup || + var.storage == StorageClassTaskPayloadWorkgroupEXT || + var.storage == StorageClassOutput) + { + global_variables.push_back(var.self); + } + if (variable_storage_is_aliased(var)) + aliased_variables.push_back(var.self); + } + } +} + +void Compiler::update_name_cache(unordered_set &cache_primary, const unordered_set &cache_secondary, + string &name) +{ + if (name.empty()) + return; + + const auto find_name = [&](const string &n) -> bool { + if (cache_primary.find(n) != end(cache_primary)) + return true; + + if (&cache_primary != &cache_secondary) + if (cache_secondary.find(n) != end(cache_secondary)) + return true; + + return false; + }; + + const auto insert_name = [&](const string &n) { cache_primary.insert(n); }; + + if (!find_name(name)) + { + insert_name(name); + return; + } + + uint32_t counter = 0; + auto tmpname = name; + + bool use_linked_underscore = true; + + if (tmpname == "_") + { + // We cannot just append numbers, as we will end up creating internally reserved names. + // Make it like _0_ instead. + tmpname += "0"; + } + else if (tmpname.back() == '_') + { + // The last_character is an underscore, so we don't need to link in underscore. + // This would violate double underscore rules. + use_linked_underscore = false; + } + + // If there is a collision (very rare), + // keep tacking on extra identifier until it's unique. + do + { + counter++; + name = tmpname + (use_linked_underscore ? "_" : "") + convert_to_string(counter); + } while (find_name(name)); + insert_name(name); +} + +void Compiler::update_name_cache(unordered_set &cache, string &name) +{ + update_name_cache(cache, cache, name); +} + +void Compiler::set_name(ID id, const std::string &name) +{ + ir.set_name(id, name); +} + +const SPIRType &Compiler::get_type(TypeID id) const +{ + return get(id); +} + +const SPIRType &Compiler::get_type_from_variable(VariableID id) const +{ + return get(get(id).basetype); +} + +uint32_t Compiler::get_pointee_type_id(uint32_t type_id) const +{ + auto *p_type = &get(type_id); + if (p_type->pointer) + { + assert(p_type->parent_type); + type_id = p_type->parent_type; + } + return type_id; +} + +const SPIRType &Compiler::get_pointee_type(const SPIRType &type) const +{ + auto *p_type = &type; + if (p_type->pointer) + { + assert(p_type->parent_type); + p_type = &get(p_type->parent_type); + } + return *p_type; +} + +const SPIRType &Compiler::get_pointee_type(uint32_t type_id) const +{ + return get_pointee_type(get(type_id)); +} + +uint32_t Compiler::get_variable_data_type_id(const SPIRVariable &var) const +{ + if (var.phi_variable || var.storage == StorageClassAtomicCounter) + return var.basetype; + return get_pointee_type_id(var.basetype); +} + +SPIRType &Compiler::get_variable_data_type(const SPIRVariable &var) +{ + return get(get_variable_data_type_id(var)); +} + +const SPIRType &Compiler::get_variable_data_type(const SPIRVariable &var) const +{ + return get(get_variable_data_type_id(var)); +} + +SPIRType &Compiler::get_variable_element_type(const SPIRVariable &var) +{ + SPIRType *type = &get_variable_data_type(var); + if (is_array(*type)) + type = &get(type->parent_type); + return *type; +} + +const SPIRType &Compiler::get_variable_element_type(const SPIRVariable &var) const +{ + const SPIRType *type = &get_variable_data_type(var); + if (is_array(*type)) + type = &get(type->parent_type); + return *type; +} + +bool Compiler::is_sampled_image_type(const SPIRType &type) +{ + return (type.basetype == SPIRType::Image || type.basetype == SPIRType::SampledImage) && type.image.sampled == 1 && + type.image.dim != DimBuffer; +} + +void Compiler::set_member_decoration_string(TypeID id, uint32_t index, Decoration decoration, + const std::string &argument) +{ + ir.set_member_decoration_string(id, index, decoration, argument); +} + +void Compiler::set_member_decoration(TypeID id, uint32_t index, Decoration decoration, uint32_t argument) +{ + ir.set_member_decoration(id, index, decoration, argument); +} + +void Compiler::set_member_name(TypeID id, uint32_t index, const std::string &name) +{ + ir.set_member_name(id, index, name); +} + +const std::string &Compiler::get_member_name(TypeID id, uint32_t index) const +{ + return ir.get_member_name(id, index); +} + +void Compiler::set_qualified_name(uint32_t id, const string &name) +{ + ir.meta[id].decoration.qualified_alias = name; +} + +void Compiler::set_member_qualified_name(uint32_t type_id, uint32_t index, const std::string &name) +{ + ir.meta[type_id].members.resize(max(ir.meta[type_id].members.size(), size_t(index) + 1)); + ir.meta[type_id].members[index].qualified_alias = name; +} + +const string &Compiler::get_member_qualified_name(TypeID type_id, uint32_t index) const +{ + auto *m = ir.find_meta(type_id); + if (m && index < m->members.size()) + return m->members[index].qualified_alias; + else + return ir.get_empty_string(); +} + +uint32_t Compiler::get_member_decoration(TypeID id, uint32_t index, Decoration decoration) const +{ + return ir.get_member_decoration(id, index, decoration); +} + +const Bitset &Compiler::get_member_decoration_bitset(TypeID id, uint32_t index) const +{ + return ir.get_member_decoration_bitset(id, index); +} + +bool Compiler::has_member_decoration(TypeID id, uint32_t index, Decoration decoration) const +{ + return ir.has_member_decoration(id, index, decoration); +} + +void Compiler::unset_member_decoration(TypeID id, uint32_t index, Decoration decoration) +{ + ir.unset_member_decoration(id, index, decoration); +} + +void Compiler::set_decoration_string(ID id, Decoration decoration, const std::string &argument) +{ + ir.set_decoration_string(id, decoration, argument); +} + +void Compiler::set_decoration(ID id, Decoration decoration, uint32_t argument) +{ + ir.set_decoration(id, decoration, argument); +} + +void Compiler::set_extended_decoration(uint32_t id, ExtendedDecorations decoration, uint32_t value) +{ + auto &dec = ir.meta[id].decoration; + dec.extended.flags.set(decoration); + dec.extended.values[decoration] = value; +} + +void Compiler::set_extended_member_decoration(uint32_t type, uint32_t index, ExtendedDecorations decoration, + uint32_t value) +{ + ir.meta[type].members.resize(max(ir.meta[type].members.size(), size_t(index) + 1)); + auto &dec = ir.meta[type].members[index]; + dec.extended.flags.set(decoration); + dec.extended.values[decoration] = value; +} + +static uint32_t get_default_extended_decoration(ExtendedDecorations decoration) +{ + switch (decoration) + { + case SPIRVCrossDecorationResourceIndexPrimary: + case SPIRVCrossDecorationResourceIndexSecondary: + case SPIRVCrossDecorationResourceIndexTertiary: + case SPIRVCrossDecorationResourceIndexQuaternary: + case SPIRVCrossDecorationInterfaceMemberIndex: + return ~(0u); + + default: + return 0; + } +} + +uint32_t Compiler::get_extended_decoration(uint32_t id, ExtendedDecorations decoration) const +{ + auto *m = ir.find_meta(id); + if (!m) + return 0; + + auto &dec = m->decoration; + + if (!dec.extended.flags.get(decoration)) + return get_default_extended_decoration(decoration); + + return dec.extended.values[decoration]; +} + +uint32_t Compiler::get_extended_member_decoration(uint32_t type, uint32_t index, ExtendedDecorations decoration) const +{ + auto *m = ir.find_meta(type); + if (!m) + return 0; + + if (index >= m->members.size()) + return 0; + + auto &dec = m->members[index]; + if (!dec.extended.flags.get(decoration)) + return get_default_extended_decoration(decoration); + return dec.extended.values[decoration]; +} + +bool Compiler::has_extended_decoration(uint32_t id, ExtendedDecorations decoration) const +{ + auto *m = ir.find_meta(id); + if (!m) + return false; + + auto &dec = m->decoration; + return dec.extended.flags.get(decoration); +} + +bool Compiler::has_extended_member_decoration(uint32_t type, uint32_t index, ExtendedDecorations decoration) const +{ + auto *m = ir.find_meta(type); + if (!m) + return false; + + if (index >= m->members.size()) + return false; + + auto &dec = m->members[index]; + return dec.extended.flags.get(decoration); +} + +void Compiler::unset_extended_decoration(uint32_t id, ExtendedDecorations decoration) +{ + auto &dec = ir.meta[id].decoration; + dec.extended.flags.clear(decoration); + dec.extended.values[decoration] = 0; +} + +void Compiler::unset_extended_member_decoration(uint32_t type, uint32_t index, ExtendedDecorations decoration) +{ + ir.meta[type].members.resize(max(ir.meta[type].members.size(), size_t(index) + 1)); + auto &dec = ir.meta[type].members[index]; + dec.extended.flags.clear(decoration); + dec.extended.values[decoration] = 0; +} + +StorageClass Compiler::get_storage_class(VariableID id) const +{ + return get(id).storage; +} + +const std::string &Compiler::get_name(ID id) const +{ + return ir.get_name(id); +} + +const std::string Compiler::get_fallback_name(ID id) const +{ + return join("_", id); +} + +const std::string Compiler::get_block_fallback_name(VariableID id) const +{ + auto &var = get(id); + if (get_name(id).empty()) + return join("_", get(var.basetype).self, "_", id); + else + return get_name(id); +} + +const Bitset &Compiler::get_decoration_bitset(ID id) const +{ + return ir.get_decoration_bitset(id); +} + +bool Compiler::has_decoration(ID id, Decoration decoration) const +{ + return ir.has_decoration(id, decoration); +} + +const string &Compiler::get_decoration_string(ID id, Decoration decoration) const +{ + return ir.get_decoration_string(id, decoration); +} + +const string &Compiler::get_member_decoration_string(TypeID id, uint32_t index, Decoration decoration) const +{ + return ir.get_member_decoration_string(id, index, decoration); +} + +uint32_t Compiler::get_decoration(ID id, Decoration decoration) const +{ + return ir.get_decoration(id, decoration); +} + +void Compiler::unset_decoration(ID id, Decoration decoration) +{ + ir.unset_decoration(id, decoration); +} + +bool Compiler::get_binary_offset_for_decoration(VariableID id, Decoration decoration, uint32_t &word_offset) const +{ + auto *m = ir.find_meta(id); + if (!m) + return false; + + auto &word_offsets = m->decoration_word_offset; + auto itr = word_offsets.find(decoration); + if (itr == end(word_offsets)) + return false; + + word_offset = itr->second; + return true; +} + +bool Compiler::block_is_noop(const SPIRBlock &block) const +{ + if (block.terminator != SPIRBlock::Direct) + return false; + + auto &child = get(block.next_block); + + // If this block participates in PHI, the block isn't really noop. + for (auto &phi : block.phi_variables) + if (phi.parent == block.self || phi.parent == child.self) + return false; + + for (auto &phi : child.phi_variables) + if (phi.parent == block.self) + return false; + + // Verify all instructions have no semantic impact. + for (auto &i : block.ops) + { + auto op = static_cast(i.op); + + switch (op) + { + // Non-Semantic instructions. + case OpLine: + case OpNoLine: + break; + + case OpExtInst: + { + auto *ops = stream(i); + auto ext = get(ops[2]).ext; + + bool ext_is_nonsemantic_only = + ext == SPIRExtension::NonSemanticShaderDebugInfo || + ext == SPIRExtension::SPV_debug_info || + ext == SPIRExtension::NonSemanticGeneric; + + if (!ext_is_nonsemantic_only) + return false; + + break; + } + + default: + return false; + } + } + + return true; +} + +bool Compiler::block_is_loop_candidate(const SPIRBlock &block, SPIRBlock::Method method) const +{ + // Tried and failed. + if (block.disable_block_optimization || block.complex_continue) + return false; + + if (method == SPIRBlock::MergeToSelectForLoop || method == SPIRBlock::MergeToSelectContinueForLoop) + { + // Try to detect common for loop pattern + // which the code backend can use to create cleaner code. + // for(;;) { if (cond) { some_body; } else { break; } } + // is the pattern we're looking for. + const auto *false_block = maybe_get(block.false_block); + const auto *true_block = maybe_get(block.true_block); + const auto *merge_block = maybe_get(block.merge_block); + + bool false_block_is_merge = block.false_block == block.merge_block || + (false_block && merge_block && execution_is_noop(*false_block, *merge_block)); + + bool true_block_is_merge = block.true_block == block.merge_block || + (true_block && merge_block && execution_is_noop(*true_block, *merge_block)); + + bool positive_candidate = + block.true_block != block.merge_block && block.true_block != block.self && false_block_is_merge; + + bool negative_candidate = + block.false_block != block.merge_block && block.false_block != block.self && true_block_is_merge; + + bool ret = block.terminator == SPIRBlock::Select && block.merge == SPIRBlock::MergeLoop && + (positive_candidate || negative_candidate); + + if (ret && positive_candidate && method == SPIRBlock::MergeToSelectContinueForLoop) + ret = block.true_block == block.continue_block; + else if (ret && negative_candidate && method == SPIRBlock::MergeToSelectContinueForLoop) + ret = block.false_block == block.continue_block; + + // If we have OpPhi which depends on branches which came from our own block, + // we need to flush phi variables in else block instead of a trivial break, + // so we cannot assume this is a for loop candidate. + if (ret) + { + for (auto &phi : block.phi_variables) + if (phi.parent == block.self) + return false; + + auto *merge = maybe_get(block.merge_block); + if (merge) + for (auto &phi : merge->phi_variables) + if (phi.parent == block.self) + return false; + } + return ret; + } + else if (method == SPIRBlock::MergeToDirectForLoop) + { + // Empty loop header that just sets up merge target + // and branches to loop body. + bool ret = block.terminator == SPIRBlock::Direct && block.merge == SPIRBlock::MergeLoop && block_is_noop(block); + + if (!ret) + return false; + + auto &child = get(block.next_block); + + const auto *false_block = maybe_get(child.false_block); + const auto *true_block = maybe_get(child.true_block); + const auto *merge_block = maybe_get(block.merge_block); + + bool false_block_is_merge = child.false_block == block.merge_block || + (false_block && merge_block && execution_is_noop(*false_block, *merge_block)); + + bool true_block_is_merge = child.true_block == block.merge_block || + (true_block && merge_block && execution_is_noop(*true_block, *merge_block)); + + bool positive_candidate = + child.true_block != block.merge_block && child.true_block != block.self && false_block_is_merge; + + bool negative_candidate = + child.false_block != block.merge_block && child.false_block != block.self && true_block_is_merge; + + ret = child.terminator == SPIRBlock::Select && child.merge == SPIRBlock::MergeNone && + (positive_candidate || negative_candidate); + + if (ret) + { + auto *merge = maybe_get(block.merge_block); + if (merge) + for (auto &phi : merge->phi_variables) + if (phi.parent == block.self || phi.parent == child.false_block) + return false; + } + + return ret; + } + else + return false; +} + +bool Compiler::execution_is_noop(const SPIRBlock &from, const SPIRBlock &to) const +{ + if (!execution_is_branchless(from, to)) + return false; + + auto *start = &from; + for (;;) + { + if (start->self == to.self) + return true; + + if (!block_is_noop(*start)) + return false; + + auto &next = get(start->next_block); + start = &next; + } +} + +bool Compiler::execution_is_branchless(const SPIRBlock &from, const SPIRBlock &to) const +{ + auto *start = &from; + for (;;) + { + if (start->self == to.self) + return true; + + if (start->terminator == SPIRBlock::Direct && start->merge == SPIRBlock::MergeNone) + start = &get(start->next_block); + else + return false; + } +} + +bool Compiler::execution_is_direct_branch(const SPIRBlock &from, const SPIRBlock &to) const +{ + return from.terminator == SPIRBlock::Direct && from.merge == SPIRBlock::MergeNone && from.next_block == to.self; +} + +SPIRBlock::ContinueBlockType Compiler::continue_block_type(const SPIRBlock &block) const +{ + // The block was deemed too complex during code emit, pick conservative fallback paths. + if (block.complex_continue) + return SPIRBlock::ComplexLoop; + + // In older glslang output continue block can be equal to the loop header. + // In this case, execution is clearly branchless, so just assume a while loop header here. + if (block.merge == SPIRBlock::MergeLoop) + return SPIRBlock::WhileLoop; + + if (block.loop_dominator == BlockID(SPIRBlock::NoDominator)) + { + // Continue block is never reached from CFG. + return SPIRBlock::ComplexLoop; + } + + auto &dominator = get(block.loop_dominator); + + if (execution_is_noop(block, dominator)) + return SPIRBlock::WhileLoop; + else if (execution_is_branchless(block, dominator)) + return SPIRBlock::ForLoop; + else + { + const auto *false_block = maybe_get(block.false_block); + const auto *true_block = maybe_get(block.true_block); + const auto *merge_block = maybe_get(dominator.merge_block); + + // If we need to flush Phi in this block, we cannot have a DoWhile loop. + bool flush_phi_to_false = false_block && flush_phi_required(block.self, block.false_block); + bool flush_phi_to_true = true_block && flush_phi_required(block.self, block.true_block); + if (flush_phi_to_false || flush_phi_to_true) + return SPIRBlock::ComplexLoop; + + bool positive_do_while = block.true_block == dominator.self && + (block.false_block == dominator.merge_block || + (false_block && merge_block && execution_is_noop(*false_block, *merge_block))); + + bool negative_do_while = block.false_block == dominator.self && + (block.true_block == dominator.merge_block || + (true_block && merge_block && execution_is_noop(*true_block, *merge_block))); + + if (block.merge == SPIRBlock::MergeNone && block.terminator == SPIRBlock::Select && + (positive_do_while || negative_do_while)) + { + return SPIRBlock::DoWhileLoop; + } + else + return SPIRBlock::ComplexLoop; + } +} + +const SmallVector &Compiler::get_case_list(const SPIRBlock &block) const +{ + uint32_t width = 0; + + // First we check if we can get the type directly from the block.condition + // since it can be a SPIRConstant or a SPIRVariable. + if (const auto *constant = maybe_get(block.condition)) + { + const auto &type = get(constant->constant_type); + width = type.width; + } + else if (const auto *op = maybe_get(block.condition)) + { + const auto &type = get(op->basetype); + width = type.width; + } + else if (const auto *var = maybe_get(block.condition)) + { + const auto &type = get(var->basetype); + width = type.width; + } + else if (const auto *undef = maybe_get(block.condition)) + { + const auto &type = get(undef->basetype); + width = type.width; + } + else + { + auto search = ir.load_type_width.find(block.condition); + if (search == ir.load_type_width.end()) + { + SPIRV_CROSS_THROW("Use of undeclared variable on a switch statement."); + } + + width = search->second; + } + + if (width > 32) + return block.cases_64bit; + + return block.cases_32bit; +} + +bool Compiler::traverse_all_reachable_opcodes(const SPIRBlock &block, OpcodeHandler &handler) const +{ + handler.set_current_block(block); + handler.rearm_current_block(block); + + if (handler.enable_result_types) + { + for (auto &phi: block.phi_variables) + { + auto &v = get(phi.function_variable); + handler.result_types[phi.function_variable] = v.basetype; + } + } + + // Ideally, perhaps traverse the CFG instead of all blocks in order to eliminate dead blocks, + // but this shouldn't be a problem in practice unless the SPIR-V is doing insane things like recursing + // inside dead blocks ... + for (auto &i : block.ops) + { + auto ops = stream(i); + auto op = static_cast(i.op); + + if (!handler.handle(op, ops, i.length)) + return false; + + if (handler.enable_result_types) + { + // If it has one, keep track of the instruction's result type, mapped by ID + uint32_t result_type, result_id; + if (instruction_to_result_type(result_type, result_id, op, ops, i.length)) + handler.result_types[result_id] = result_type; + } + + if (op == OpFunctionCall) + { + auto &func = get(ops[2]); + if (handler.follow_function_call(func)) + { + if (handler.enable_result_types) + for (auto &arg : func.arguments) + if (!arg.alias_global_variable) + handler.result_types[arg.id] = arg.type; + + if (!handler.begin_function_scope(ops, i.length)) + return false; + if (!traverse_all_reachable_opcodes(get(ops[2]), handler)) + return false; + if (!handler.end_function_scope(ops, i.length)) + return false; + + handler.rearm_current_block(block); + } + } + } + + if (!handler.handle_terminator(block)) + return false; + + return true; +} + +bool Compiler::traverse_all_reachable_opcodes(const SPIRFunction &func, OpcodeHandler &handler) const +{ + for (auto block : func.blocks) + if (!traverse_all_reachable_opcodes(get(block), handler)) + return false; + + return true; +} + +uint32_t Compiler::type_struct_member_offset(const SPIRType &type, uint32_t index) const +{ + auto *type_meta = ir.find_meta(type.self); + if (type_meta) + { + // Decoration must be set in valid SPIR-V, otherwise throw. + auto &dec = type_meta->members[index]; + if (dec.decoration_flags.get(DecorationOffset)) + return dec.offset; + else + SPIRV_CROSS_THROW("Struct member does not have Offset set."); + } + else + SPIRV_CROSS_THROW("Struct member does not have Offset set."); +} + +uint32_t Compiler::type_struct_member_array_stride(const SPIRType &type, uint32_t index) const +{ + auto *type_meta = ir.find_meta(type.member_types[index]); + if (type_meta) + { + // Decoration must be set in valid SPIR-V, otherwise throw. + // ArrayStride is part of the array type not OpMemberDecorate. + auto &dec = type_meta->decoration; + if (dec.decoration_flags.get(DecorationArrayStride)) + return dec.array_stride; + else + SPIRV_CROSS_THROW("Struct member does not have ArrayStride set."); + } + else + SPIRV_CROSS_THROW("Struct member does not have ArrayStride set."); +} + +uint32_t Compiler::type_struct_member_matrix_stride(const SPIRType &type, uint32_t index) const +{ + auto *type_meta = ir.find_meta(type.self); + if (type_meta) + { + // Decoration must be set in valid SPIR-V, otherwise throw. + // MatrixStride is part of OpMemberDecorate. + auto &dec = type_meta->members[index]; + if (dec.decoration_flags.get(DecorationMatrixStride)) + return dec.matrix_stride; + else + SPIRV_CROSS_THROW("Struct member does not have MatrixStride set."); + } + else + SPIRV_CROSS_THROW("Struct member does not have MatrixStride set."); +} + +size_t Compiler::get_declared_struct_size(const SPIRType &type) const +{ + if (type.member_types.empty()) + SPIRV_CROSS_THROW("Declared struct in block cannot be empty."); + + // Offsets can be declared out of order, so we need to deduce the actual size + // based on last member instead. + uint32_t member_index = 0; + size_t highest_offset = 0; + for (uint32_t i = 0; i < uint32_t(type.member_types.size()); i++) + { + size_t offset = type_struct_member_offset(type, i); + if (offset > highest_offset) + { + highest_offset = offset; + member_index = i; + } + } + + size_t size = get_declared_struct_member_size(type, member_index); + return highest_offset + size; +} + +size_t Compiler::get_declared_struct_size_runtime_array(const SPIRType &type, size_t array_size) const +{ + if (type.member_types.empty()) + SPIRV_CROSS_THROW("Declared struct in block cannot be empty."); + + size_t size = get_declared_struct_size(type); + auto &last_type = get(type.member_types.back()); + if (!last_type.array.empty() && last_type.array_size_literal[0] && last_type.array[0] == 0) // Runtime array + size += array_size * type_struct_member_array_stride(type, uint32_t(type.member_types.size() - 1)); + + return size; +} + +uint32_t Compiler::evaluate_spec_constant_u32(const SPIRConstantOp &spec) const +{ + auto &result_type = get(spec.basetype); + if (result_type.basetype != SPIRType::UInt && result_type.basetype != SPIRType::Int && + result_type.basetype != SPIRType::Boolean) + { + SPIRV_CROSS_THROW( + "Only 32-bit integers and booleans are currently supported when evaluating specialization constants.\n"); + } + + if (!is_scalar(result_type)) + SPIRV_CROSS_THROW("Spec constant evaluation must be a scalar.\n"); + + uint32_t value = 0; + + const auto eval_u32 = [&](uint32_t id) -> uint32_t { + auto &type = expression_type(id); + if (type.basetype != SPIRType::UInt && type.basetype != SPIRType::Int && type.basetype != SPIRType::Boolean) + { + SPIRV_CROSS_THROW("Only 32-bit integers and booleans are currently supported when evaluating " + "specialization constants.\n"); + } + + if (!is_scalar(type)) + SPIRV_CROSS_THROW("Spec constant evaluation must be a scalar.\n"); + if (const auto *c = this->maybe_get(id)) + return c->scalar(); + else + return evaluate_spec_constant_u32(this->get(id)); + }; + +#define binary_spec_op(op, binary_op) \ + case Op##op: \ + value = eval_u32(spec.arguments[0]) binary_op eval_u32(spec.arguments[1]); \ + break +#define binary_spec_op_cast(op, binary_op, type) \ + case Op##op: \ + value = uint32_t(type(eval_u32(spec.arguments[0])) binary_op type(eval_u32(spec.arguments[1]))); \ + break + + // Support the basic opcodes which are typically used when computing array sizes. + switch (spec.opcode) + { + binary_spec_op(IAdd, +); + binary_spec_op(ISub, -); + binary_spec_op(IMul, *); + binary_spec_op(BitwiseAnd, &); + binary_spec_op(BitwiseOr, |); + binary_spec_op(BitwiseXor, ^); + binary_spec_op(LogicalAnd, &); + binary_spec_op(LogicalOr, |); + binary_spec_op(ShiftLeftLogical, <<); + binary_spec_op(ShiftRightLogical, >>); + binary_spec_op_cast(ShiftRightArithmetic, >>, int32_t); + binary_spec_op(LogicalEqual, ==); + binary_spec_op(LogicalNotEqual, !=); + binary_spec_op(IEqual, ==); + binary_spec_op(INotEqual, !=); + binary_spec_op(ULessThan, <); + binary_spec_op(ULessThanEqual, <=); + binary_spec_op(UGreaterThan, >); + binary_spec_op(UGreaterThanEqual, >=); + binary_spec_op_cast(SLessThan, <, int32_t); + binary_spec_op_cast(SLessThanEqual, <=, int32_t); + binary_spec_op_cast(SGreaterThan, >, int32_t); + binary_spec_op_cast(SGreaterThanEqual, >=, int32_t); +#undef binary_spec_op +#undef binary_spec_op_cast + + case OpLogicalNot: + value = uint32_t(!eval_u32(spec.arguments[0])); + break; + + case OpNot: + value = ~eval_u32(spec.arguments[0]); + break; + + case OpSNegate: + value = uint32_t(-int32_t(eval_u32(spec.arguments[0]))); + break; + + case OpSelect: + value = eval_u32(spec.arguments[0]) ? eval_u32(spec.arguments[1]) : eval_u32(spec.arguments[2]); + break; + + case OpUMod: + { + uint32_t a = eval_u32(spec.arguments[0]); + uint32_t b = eval_u32(spec.arguments[1]); + if (b == 0) + SPIRV_CROSS_THROW("Undefined behavior in UMod, b == 0.\n"); + value = a % b; + break; + } + + case OpSRem: + { + auto a = int32_t(eval_u32(spec.arguments[0])); + auto b = int32_t(eval_u32(spec.arguments[1])); + if (b == 0) + SPIRV_CROSS_THROW("Undefined behavior in SRem, b == 0.\n"); + value = a % b; + break; + } + + case OpSMod: + { + auto a = int32_t(eval_u32(spec.arguments[0])); + auto b = int32_t(eval_u32(spec.arguments[1])); + if (b == 0) + SPIRV_CROSS_THROW("Undefined behavior in SMod, b == 0.\n"); + auto v = a % b; + + // Makes sure we match the sign of b, not a. + if ((b < 0 && v > 0) || (b > 0 && v < 0)) + v += b; + value = v; + break; + } + + case OpUDiv: + { + uint32_t a = eval_u32(spec.arguments[0]); + uint32_t b = eval_u32(spec.arguments[1]); + if (b == 0) + SPIRV_CROSS_THROW("Undefined behavior in UDiv, b == 0.\n"); + value = a / b; + break; + } + + case OpSDiv: + { + auto a = int32_t(eval_u32(spec.arguments[0])); + auto b = int32_t(eval_u32(spec.arguments[1])); + if (b == 0) + SPIRV_CROSS_THROW("Undefined behavior in SDiv, b == 0.\n"); + value = a / b; + break; + } + + default: + SPIRV_CROSS_THROW("Unsupported spec constant opcode for evaluation.\n"); + } + + return value; +} + +uint32_t Compiler::evaluate_constant_u32(uint32_t id) const +{ + if (const auto *c = maybe_get(id)) + return c->scalar(); + else + return evaluate_spec_constant_u32(get(id)); +} + +size_t Compiler::get_declared_struct_member_size(const SPIRType &struct_type, uint32_t index) const +{ + if (struct_type.member_types.empty()) + SPIRV_CROSS_THROW("Declared struct in block cannot be empty."); + + auto &flags = get_member_decoration_bitset(struct_type.self, index); + auto &type = get(struct_type.member_types[index]); + + switch (type.basetype) + { + case SPIRType::Unknown: + case SPIRType::Void: + case SPIRType::Boolean: // Bools are purely logical, and cannot be used for externally visible types. + case SPIRType::AtomicCounter: + case SPIRType::Image: + case SPIRType::SampledImage: + case SPIRType::Sampler: + SPIRV_CROSS_THROW("Querying size for object with opaque size."); + + default: + break; + } + + if (type.pointer && type.storage == StorageClassPhysicalStorageBuffer) + { + // Check if this is a top-level pointer type, and not an array of pointers. + if (type.pointer_depth > get(type.parent_type).pointer_depth) + return 8; + } + + if (!type.array.empty()) + { + // For arrays, we can use ArrayStride to get an easy check. + bool array_size_literal = type.array_size_literal.back(); + uint32_t array_size = array_size_literal ? type.array.back() : evaluate_constant_u32(type.array.back()); + return type_struct_member_array_stride(struct_type, index) * array_size; + } + else if (type.basetype == SPIRType::Struct) + { + return get_declared_struct_size(type); + } + else + { + unsigned vecsize = type.vecsize; + unsigned columns = type.columns; + + // Vectors. + if (columns == 1) + { + size_t component_size = type.width / 8; + return vecsize * component_size; + } + else + { + uint32_t matrix_stride = type_struct_member_matrix_stride(struct_type, index); + + // Per SPIR-V spec, matrices must be tightly packed and aligned up for vec3 accesses. + if (flags.get(DecorationRowMajor)) + return matrix_stride * vecsize; + else if (flags.get(DecorationColMajor)) + return matrix_stride * columns; + else + SPIRV_CROSS_THROW("Either row-major or column-major must be declared for matrices."); + } + } +} + +bool Compiler::BufferAccessHandler::handle(Op opcode, const uint32_t *args, uint32_t length) +{ + if (opcode != OpAccessChain && opcode != OpInBoundsAccessChain && opcode != OpPtrAccessChain) + return true; + + bool ptr_chain = (opcode == OpPtrAccessChain); + + // Invalid SPIR-V. + if (length < (ptr_chain ? 5u : 4u)) + return false; + + if (args[2] != id) + return true; + + // Don't bother traversing the entire access chain tree yet. + // If we access a struct member, assume we access the entire member. + uint32_t index = compiler.get(args[ptr_chain ? 4 : 3]).scalar(); + + // Seen this index already. + if (seen.find(index) != end(seen)) + return true; + seen.insert(index); + + auto &type = compiler.expression_type(id); + uint32_t offset = compiler.type_struct_member_offset(type, index); + + size_t range; + // If we have another member in the struct, deduce the range by looking at the next member. + // This is okay since structs in SPIR-V can have padding, but Offset decoration must be + // monotonically increasing. + // Of course, this doesn't take into account if the SPIR-V for some reason decided to add + // very large amounts of padding, but that's not really a big deal. + if (index + 1 < type.member_types.size()) + { + range = compiler.type_struct_member_offset(type, index + 1) - offset; + } + else + { + // No padding, so just deduce it from the size of the member directly. + range = compiler.get_declared_struct_member_size(type, index); + } + + ranges.push_back({ index, offset, range }); + return true; +} + +SmallVector Compiler::get_active_buffer_ranges(VariableID id) const +{ + SmallVector ranges; + BufferAccessHandler handler(*this, ranges, id); + traverse_all_reachable_opcodes(get(ir.default_entry_point), handler); + return ranges; +} + +bool Compiler::types_are_logically_equivalent(const SPIRType &a, const SPIRType &b) const +{ + if (a.basetype != b.basetype) + return false; + if (a.width != b.width) + return false; + if (a.vecsize != b.vecsize) + return false; + if (a.columns != b.columns) + return false; + if (a.array.size() != b.array.size()) + return false; + + size_t array_count = a.array.size(); + if (array_count && memcmp(a.array.data(), b.array.data(), array_count * sizeof(uint32_t)) != 0) + return false; + + if (a.basetype == SPIRType::Image || a.basetype == SPIRType::SampledImage) + { + if (memcmp(&a.image, &b.image, sizeof(SPIRType::Image)) != 0) + return false; + } + + if (a.member_types.size() != b.member_types.size()) + return false; + + size_t member_types = a.member_types.size(); + for (size_t i = 0; i < member_types; i++) + { + if (!types_are_logically_equivalent(get(a.member_types[i]), get(b.member_types[i]))) + return false; + } + + return true; +} + +const Bitset &Compiler::get_execution_mode_bitset() const +{ + return get_entry_point().flags; +} + +void Compiler::set_execution_mode(ExecutionMode mode, uint32_t arg0, uint32_t arg1, uint32_t arg2) +{ + auto &execution = get_entry_point(); + + execution.flags.set(mode); + switch (mode) + { + case ExecutionModeLocalSize: + execution.workgroup_size.x = arg0; + execution.workgroup_size.y = arg1; + execution.workgroup_size.z = arg2; + break; + + case ExecutionModeLocalSizeId: + execution.workgroup_size.id_x = arg0; + execution.workgroup_size.id_y = arg1; + execution.workgroup_size.id_z = arg2; + break; + + case ExecutionModeInvocations: + execution.invocations = arg0; + break; + + case ExecutionModeOutputVertices: + execution.output_vertices = arg0; + break; + + case ExecutionModeOutputPrimitivesEXT: + execution.output_primitives = arg0; + break; + + case ExecutionModeFPFastMathDefault: + execution.fp_fast_math_defaults[arg0] = arg1; + break; + + default: + break; + } +} + +void Compiler::unset_execution_mode(ExecutionMode mode) +{ + auto &execution = get_entry_point(); + execution.flags.clear(mode); +} + +uint32_t Compiler::get_work_group_size_specialization_constants(SpecializationConstant &x, SpecializationConstant &y, + SpecializationConstant &z) const +{ + auto &execution = get_entry_point(); + x = { 0, 0 }; + y = { 0, 0 }; + z = { 0, 0 }; + + // WorkgroupSize builtin takes precedence over LocalSize / LocalSizeId. + if (execution.workgroup_size.constant != 0) + { + auto &c = get(execution.workgroup_size.constant); + + if (c.m.c[0].id[0] != ID(0)) + { + x.id = c.m.c[0].id[0]; + x.constant_id = get_decoration(c.m.c[0].id[0], DecorationSpecId); + } + + if (c.m.c[0].id[1] != ID(0)) + { + y.id = c.m.c[0].id[1]; + y.constant_id = get_decoration(c.m.c[0].id[1], DecorationSpecId); + } + + if (c.m.c[0].id[2] != ID(0)) + { + z.id = c.m.c[0].id[2]; + z.constant_id = get_decoration(c.m.c[0].id[2], DecorationSpecId); + } + } + else if (execution.flags.get(ExecutionModeLocalSizeId)) + { + auto &cx = get(execution.workgroup_size.id_x); + if (cx.specialization) + { + x.id = execution.workgroup_size.id_x; + x.constant_id = get_decoration(execution.workgroup_size.id_x, DecorationSpecId); + } + + auto &cy = get(execution.workgroup_size.id_y); + if (cy.specialization) + { + y.id = execution.workgroup_size.id_y; + y.constant_id = get_decoration(execution.workgroup_size.id_y, DecorationSpecId); + } + + auto &cz = get(execution.workgroup_size.id_z); + if (cz.specialization) + { + z.id = execution.workgroup_size.id_z; + z.constant_id = get_decoration(execution.workgroup_size.id_z, DecorationSpecId); + } + } + + return execution.workgroup_size.constant; +} + +uint32_t Compiler::get_execution_mode_argument(ExecutionMode mode, uint32_t index) const +{ + auto &execution = get_entry_point(); + switch (mode) + { + case ExecutionModeLocalSizeId: + if (execution.flags.get(ExecutionModeLocalSizeId)) + { + switch (index) + { + case 0: + return execution.workgroup_size.id_x; + case 1: + return execution.workgroup_size.id_y; + case 2: + return execution.workgroup_size.id_z; + default: + return 0; + } + } + else + return 0; + + case ExecutionModeLocalSize: + switch (index) + { + case 0: + if (execution.flags.get(ExecutionModeLocalSizeId) && execution.workgroup_size.id_x != 0) + return get(execution.workgroup_size.id_x).scalar(); + else + return execution.workgroup_size.x; + case 1: + if (execution.flags.get(ExecutionModeLocalSizeId) && execution.workgroup_size.id_y != 0) + return get(execution.workgroup_size.id_y).scalar(); + else + return execution.workgroup_size.y; + case 2: + if (execution.flags.get(ExecutionModeLocalSizeId) && execution.workgroup_size.id_z != 0) + return get(execution.workgroup_size.id_z).scalar(); + else + return execution.workgroup_size.z; + default: + return 0; + } + + case ExecutionModeInvocations: + return execution.invocations; + + case ExecutionModeOutputVertices: + return execution.output_vertices; + + case ExecutionModeOutputPrimitivesEXT: + return execution.output_primitives; + + default: + return 0; + } +} + +ExecutionModel Compiler::get_execution_model() const +{ + auto &execution = get_entry_point(); + return execution.model; +} + +bool Compiler::is_tessellation_shader(ExecutionModel model) +{ + return model == ExecutionModelTessellationControl || model == ExecutionModelTessellationEvaluation; +} + +bool Compiler::is_vertex_like_shader() const +{ + auto model = get_execution_model(); + return model == ExecutionModelVertex || model == ExecutionModelGeometry || + model == ExecutionModelTessellationControl || model == ExecutionModelTessellationEvaluation; +} + +bool Compiler::is_tessellation_shader() const +{ + return is_tessellation_shader(get_execution_model()); +} + +bool Compiler::is_tessellating_triangles() const +{ + return get_execution_mode_bitset().get(ExecutionModeTriangles); +} + +void Compiler::set_remapped_variable_state(VariableID id, bool remap_enable) +{ + get(id).remapped_variable = remap_enable; +} + +bool Compiler::get_remapped_variable_state(VariableID id) const +{ + return get(id).remapped_variable; +} + +void Compiler::set_subpass_input_remapped_components(VariableID id, uint32_t components) +{ + get(id).remapped_components = components; +} + +uint32_t Compiler::get_subpass_input_remapped_components(VariableID id) const +{ + return get(id).remapped_components; +} + +void Compiler::add_implied_read_expression(SPIRExpression &e, uint32_t source) +{ + auto itr = find(begin(e.implied_read_expressions), end(e.implied_read_expressions), ID(source)); + if (itr == end(e.implied_read_expressions)) + e.implied_read_expressions.push_back(source); +} + +void Compiler::add_implied_read_expression(SPIRAccessChain &e, uint32_t source) +{ + auto itr = find(begin(e.implied_read_expressions), end(e.implied_read_expressions), ID(source)); + if (itr == end(e.implied_read_expressions)) + e.implied_read_expressions.push_back(source); +} + +void Compiler::add_active_interface_variable(uint32_t var_id) +{ + active_interface_variables.insert(var_id); + + // In SPIR-V 1.4 and up we must also track the interface variable in the entry point. + if (ir.get_spirv_version() >= 0x10400) + { + auto &vars = get_entry_point().interface_variables; + if (find(begin(vars), end(vars), VariableID(var_id)) == end(vars)) + vars.push_back(var_id); + } +} + +void Compiler::inherit_expression_dependencies(uint32_t dst, uint32_t source_expression) +{ + auto *ptr_e = maybe_get(dst); + + if (is_position_invariant() && ptr_e && maybe_get(source_expression)) + { + auto &deps = ptr_e->invariance_dependencies; + if (std::find(deps.begin(), deps.end(), source_expression) == deps.end()) + deps.push_back(source_expression); + } + + // Don't inherit any expression dependencies if the expression in dst + // is not a forwarded temporary. + if (forwarded_temporaries.find(dst) == end(forwarded_temporaries) || + forced_temporaries.find(dst) != end(forced_temporaries)) + { + return; + } + + auto &e = *ptr_e; + auto *phi = maybe_get(source_expression); + if (phi && phi->phi_variable) + { + // We have used a phi variable, which can change at the end of the block, + // so make sure we take a dependency on this phi variable. + phi->dependees.push_back(dst); + } + + auto *s = maybe_get(source_expression); + if (!s) + return; + + auto &e_deps = e.expression_dependencies; + auto &s_deps = s->expression_dependencies; + + // If we depend on a expression, we also depend on all sub-dependencies from source. + e_deps.push_back(source_expression); + e_deps.insert(end(e_deps), begin(s_deps), end(s_deps)); + + // Eliminate duplicated dependencies. + sort(begin(e_deps), end(e_deps)); + e_deps.erase(unique(begin(e_deps), end(e_deps)), end(e_deps)); +} + +SmallVector Compiler::get_entry_points_and_stages() const +{ + SmallVector entries; + for (auto &entry : ir.entry_points) + entries.push_back({ entry.second.orig_name, entry.second.model }); + return entries; +} + +void Compiler::rename_entry_point(const std::string &old_name, const std::string &new_name, ExecutionModel model) +{ + auto &entry = get_entry_point(old_name, model); + entry.orig_name = new_name; + entry.name = new_name; +} + +void Compiler::set_entry_point(const std::string &name, ExecutionModel model) +{ + auto &entry = get_entry_point(name, model); + ir.default_entry_point = entry.self; +} + +SPIREntryPoint &Compiler::get_first_entry_point(const std::string &name) +{ + auto itr = find_if( + begin(ir.entry_points), end(ir.entry_points), + [&](const std::pair &entry) -> bool { return entry.second.orig_name == name; }); + + if (itr == end(ir.entry_points)) + SPIRV_CROSS_THROW("Entry point does not exist."); + + return itr->second; +} + +const SPIREntryPoint &Compiler::get_first_entry_point(const std::string &name) const +{ + auto itr = find_if( + begin(ir.entry_points), end(ir.entry_points), + [&](const std::pair &entry) -> bool { return entry.second.orig_name == name; }); + + if (itr == end(ir.entry_points)) + SPIRV_CROSS_THROW("Entry point does not exist."); + + return itr->second; +} + +SPIREntryPoint &Compiler::get_entry_point(const std::string &name, ExecutionModel model) +{ + auto itr = find_if(begin(ir.entry_points), end(ir.entry_points), + [&](const std::pair &entry) -> bool { + return entry.second.orig_name == name && entry.second.model == model; + }); + + if (itr == end(ir.entry_points)) + SPIRV_CROSS_THROW("Entry point does not exist."); + + return itr->second; +} + +const SPIREntryPoint &Compiler::get_entry_point(const std::string &name, ExecutionModel model) const +{ + auto itr = find_if(begin(ir.entry_points), end(ir.entry_points), + [&](const std::pair &entry) -> bool { + return entry.second.orig_name == name && entry.second.model == model; + }); + + if (itr == end(ir.entry_points)) + SPIRV_CROSS_THROW("Entry point does not exist."); + + return itr->second; +} + +const string &Compiler::get_cleansed_entry_point_name(const std::string &name, ExecutionModel model) const +{ + return get_entry_point(name, model).name; +} + +const SPIREntryPoint &Compiler::get_entry_point() const +{ + return ir.entry_points.find(ir.default_entry_point)->second; +} + +SPIREntryPoint &Compiler::get_entry_point() +{ + return ir.entry_points.find(ir.default_entry_point)->second; +} + +bool Compiler::interface_variable_exists_in_entry_point(uint32_t id) const +{ + auto &var = get(id); + + if (ir.get_spirv_version() < 0x10400) + { + if (var.storage != StorageClassInput && var.storage != StorageClassOutput && + var.storage != StorageClassUniformConstant) + SPIRV_CROSS_THROW("Only Input, Output variables and Uniform constants are part of a shader linking interface."); + + // This is to avoid potential problems with very old glslang versions which did + // not emit input/output interfaces properly. + // We can assume they only had a single entry point, and single entry point + // shaders could easily be assumed to use every interface variable anyways. + if (ir.entry_points.size() <= 1) + return true; + } + + // In SPIR-V 1.4 and later, all global resource variables must be present. + + auto &execution = get_entry_point(); + return find(begin(execution.interface_variables), end(execution.interface_variables), VariableID(id)) != + end(execution.interface_variables); +} + +void Compiler::CombinedImageSamplerHandler::push_remap_parameters(const SPIRFunction &func, const uint32_t *args, + uint32_t length) +{ + // If possible, pipe through a remapping table so that parameters know + // which variables they actually bind to in this scope. + unordered_map remapping; + for (uint32_t i = 0; i < length; i++) + remapping[func.arguments[i].id] = remap_parameter(args[i]); + parameter_remapping.push(std::move(remapping)); +} + +void Compiler::CombinedImageSamplerHandler::pop_remap_parameters() +{ + parameter_remapping.pop(); +} + +uint32_t Compiler::CombinedImageSamplerHandler::remap_parameter(uint32_t id) +{ + auto *var = compiler.maybe_get_backing_variable(id); + if (var) + id = var->self; + + if (parameter_remapping.empty()) + return id; + + auto &remapping = parameter_remapping.top(); + auto itr = remapping.find(id); + if (itr != end(remapping)) + return itr->second; + else + return id; +} + +bool Compiler::CombinedImageSamplerHandler::begin_function_scope(const uint32_t *args, uint32_t length) +{ + if (length < 3) + return false; + + auto &callee = compiler.get(args[2]); + args += 3; + length -= 3; + push_remap_parameters(callee, args, length); + functions.push(&callee); + return true; +} + +bool Compiler::CombinedImageSamplerHandler::end_function_scope(const uint32_t *args, uint32_t length) +{ + if (length < 3) + return false; + + auto &callee = compiler.get(args[2]); + args += 3; + + // There are two types of cases we have to handle, + // a callee might call sampler2D(texture2D, sampler) directly where + // one or more parameters originate from parameters. + // Alternatively, we need to provide combined image samplers to our callees, + // and in this case we need to add those as well. + + pop_remap_parameters(); + + // Our callee has now been processed at least once. + // No point in doing it again. + callee.do_combined_parameters = false; + + auto ¶ms = functions.top()->combined_parameters; + functions.pop(); + if (functions.empty()) + return true; + + auto &caller = *functions.top(); + if (caller.do_combined_parameters) + { + for (auto ¶m : params) + { + VariableID image_id = param.global_image ? param.image_id : VariableID(args[param.image_id]); + VariableID sampler_id = param.global_sampler ? param.sampler_id : VariableID(args[param.sampler_id]); + + auto *i = compiler.maybe_get_backing_variable(image_id); + auto *s = compiler.maybe_get_backing_variable(sampler_id); + if (i) + image_id = i->self; + if (s) + sampler_id = s->self; + + register_combined_image_sampler(caller, 0, image_id, sampler_id, param.depth); + } + } + + return true; +} + +void Compiler::CombinedImageSamplerHandler::register_combined_image_sampler(SPIRFunction &caller, + VariableID combined_module_id, + VariableID image_id, VariableID sampler_id, + bool depth) +{ + // We now have a texture ID and a sampler ID which will either be found as a global + // or a parameter in our own function. If both are global, they will not need a parameter, + // otherwise, add it to our list. + SPIRFunction::CombinedImageSamplerParameter param = { + 0u, image_id, sampler_id, true, true, depth, + }; + + auto texture_itr = find_if(begin(caller.arguments), end(caller.arguments), + [image_id](const SPIRFunction::Parameter &p) { return p.id == image_id; }); + auto sampler_itr = find_if(begin(caller.arguments), end(caller.arguments), + [sampler_id](const SPIRFunction::Parameter &p) { return p.id == sampler_id; }); + + if (texture_itr != end(caller.arguments)) + { + param.global_image = false; + param.image_id = uint32_t(texture_itr - begin(caller.arguments)); + } + + if (sampler_itr != end(caller.arguments)) + { + param.global_sampler = false; + param.sampler_id = uint32_t(sampler_itr - begin(caller.arguments)); + } + + if (param.global_image && param.global_sampler) + return; + + auto itr = find_if(begin(caller.combined_parameters), end(caller.combined_parameters), + [¶m](const SPIRFunction::CombinedImageSamplerParameter &p) { + return param.image_id == p.image_id && param.sampler_id == p.sampler_id && + param.global_image == p.global_image && param.global_sampler == p.global_sampler; + }); + + if (itr == end(caller.combined_parameters)) + { + uint32_t id = compiler.ir.increase_bound_by(3); + auto type_id = id + 0; + auto ptr_type_id = id + 1; + auto combined_id = id + 2; + auto &base = compiler.expression_type(image_id); + auto &type = compiler.set(type_id, OpTypeSampledImage); + auto &ptr_type = compiler.set(ptr_type_id, OpTypePointer); + + type = base; + type.self = type_id; + type.basetype = SPIRType::SampledImage; + type.pointer = false; + type.storage = StorageClassGeneric; + type.image.depth = depth; + + ptr_type = type; + ptr_type.pointer = true; + ptr_type.storage = StorageClassUniformConstant; + ptr_type.parent_type = type_id; + + // Build new variable. + compiler.set(combined_id, ptr_type_id, StorageClassFunction, 0); + + // Inherit RelaxedPrecision. + // If any of OpSampledImage, underlying image or sampler are marked, inherit the decoration. + bool relaxed_precision = + compiler.has_decoration(sampler_id, DecorationRelaxedPrecision) || + compiler.has_decoration(image_id, DecorationRelaxedPrecision) || + (combined_module_id && compiler.has_decoration(combined_module_id, DecorationRelaxedPrecision)); + + if (relaxed_precision) + compiler.set_decoration(combined_id, DecorationRelaxedPrecision); + + param.id = combined_id; + + compiler.set_name(combined_id, + join("SPIRV_Cross_Combined", compiler.to_name(image_id), compiler.to_name(sampler_id))); + + caller.combined_parameters.push_back(param); + caller.shadow_arguments.push_back({ ptr_type_id, combined_id, 0u, 0u, true }); + } +} + +bool Compiler::DummySamplerForCombinedImageHandler::handle(Op opcode, const uint32_t *args, uint32_t length) +{ + if (need_dummy_sampler) + { + // No need to traverse further, we know the result. + return false; + } + + switch (opcode) + { + case OpLoad: + { + if (length < 3) + return false; + + uint32_t result_type = args[0]; + + auto &type = compiler.get(result_type); + bool separate_image = + type.basetype == SPIRType::Image && type.image.sampled == 1 && type.image.dim != DimBuffer; + + // If not separate image, don't bother. + if (!separate_image) + return true; + + uint32_t id = args[1]; + uint32_t ptr = args[2]; + compiler.set(id, "", result_type, true); + compiler.register_read(id, ptr, true); + break; + } + + case OpImageFetch: + case OpImageQuerySizeLod: + case OpImageQuerySize: + case OpImageQueryLevels: + case OpImageQuerySamples: + { + // If we are fetching or querying LOD from a plain OpTypeImage, we must pre-combine with our dummy sampler. + auto *var = compiler.maybe_get_backing_variable(args[2]); + if (var) + { + auto &type = compiler.get(var->basetype); + if (type.basetype == SPIRType::Image && type.image.sampled == 1 && type.image.dim != DimBuffer) + need_dummy_sampler = true; + } + + break; + } + + case OpInBoundsAccessChain: + case OpAccessChain: + case OpPtrAccessChain: + { + if (length < 3) + return false; + + uint32_t result_type = args[0]; + auto &type = compiler.get(result_type); + bool separate_image = + type.basetype == SPIRType::Image && type.image.sampled == 1 && type.image.dim != DimBuffer; + if (!separate_image) + return true; + + uint32_t id = args[1]; + uint32_t ptr = args[2]; + compiler.set(id, "", result_type, true); + compiler.register_read(id, ptr, true); + + // Other backends might use SPIRAccessChain for this later. + compiler.ir.ids[id].set_allow_type_rewrite(); + break; + } + + default: + break; + } + + return true; +} + +bool Compiler::CombinedImageSamplerHandler::handle(Op opcode, const uint32_t *args, uint32_t length) +{ + // We need to figure out where samplers and images are loaded from, so do only the bare bones compilation we need. + bool is_fetch = false; + + switch (opcode) + { + case OpLoad: + { + if (length < 3) + return false; + + uint32_t result_type = args[0]; + + auto &type = compiler.get(result_type); + bool separate_image = type.basetype == SPIRType::Image && type.image.sampled == 1; + bool separate_sampler = type.basetype == SPIRType::Sampler; + + // If not separate image or sampler, don't bother. + if (!separate_image && !separate_sampler) + return true; + + uint32_t id = args[1]; + uint32_t ptr = args[2]; + compiler.set(id, "", result_type, true); + compiler.register_read(id, ptr, true); + return true; + } + + case OpInBoundsAccessChain: + case OpAccessChain: + case OpPtrAccessChain: + { + if (length < 3) + return false; + + // Technically, it is possible to have arrays of textures and arrays of samplers and combine them, but this becomes essentially + // impossible to implement, since we don't know which concrete sampler we are accessing. + // One potential way is to create a combinatorial explosion where N textures and M samplers are combined into N * M sampler2Ds, + // but this seems ridiculously complicated for a problem which is easy to work around. + // Checking access chains like this assumes we don't have samplers or textures inside uniform structs, but this makes no sense. + + uint32_t result_type = args[0]; + + auto &type = compiler.get(result_type); + bool separate_image = type.basetype == SPIRType::Image && type.image.sampled == 1; + bool separate_sampler = type.basetype == SPIRType::Sampler; + if (separate_sampler) + SPIRV_CROSS_THROW( + "Attempting to use arrays or structs of separate samplers. This is not possible to statically " + "remap to plain GLSL."); + + if (separate_image) + { + uint32_t id = args[1]; + uint32_t ptr = args[2]; + compiler.set(id, "", result_type, true); + compiler.register_read(id, ptr, true); + } + return true; + } + + case OpImageFetch: + case OpImageQuerySizeLod: + case OpImageQuerySize: + case OpImageQueryLevels: + case OpImageQuerySamples: + { + // If we are fetching from a plain OpTypeImage or querying LOD, we must pre-combine with our dummy sampler. + auto *var = compiler.maybe_get_backing_variable(args[2]); + if (!var) + return true; + + auto &type = compiler.get(var->basetype); + if (type.basetype == SPIRType::Image && type.image.sampled == 1 && type.image.dim != DimBuffer) + { + if (compiler.dummy_sampler_id == 0) + SPIRV_CROSS_THROW("texelFetch without sampler was found, but no dummy sampler has been created with " + "build_dummy_sampler_for_combined_images()."); + + // Do it outside. + is_fetch = true; + break; + } + + return true; + } + + case OpSampledImage: + // Do it outside. + break; + + default: + return true; + } + + // Registers sampler2D calls used in case they are parameters so + // that their callees know which combined image samplers to propagate down the call stack. + if (!functions.empty()) + { + auto &callee = *functions.top(); + if (callee.do_combined_parameters) + { + uint32_t image_id = args[2]; + + auto *image = compiler.maybe_get_backing_variable(image_id); + if (image) + image_id = image->self; + + uint32_t sampler_id = is_fetch ? compiler.dummy_sampler_id : args[3]; + auto *sampler = compiler.maybe_get_backing_variable(sampler_id); + if (sampler) + sampler_id = sampler->self; + + uint32_t combined_id = args[1]; + + auto &combined_type = compiler.get(args[0]); + register_combined_image_sampler(callee, combined_id, image_id, sampler_id, combined_type.image.depth); + } + } + + // For function calls, we need to remap IDs which are function parameters into global variables. + // This information is statically known from the current place in the call stack. + // Function parameters are not necessarily pointers, so if we don't have a backing variable, remapping will know + // which backing variable the image/sample came from. + VariableID image_id = remap_parameter(args[2]); + VariableID sampler_id = is_fetch ? compiler.dummy_sampler_id : remap_parameter(args[3]); + + auto itr = find_if(begin(compiler.combined_image_samplers), end(compiler.combined_image_samplers), + [image_id, sampler_id](const CombinedImageSampler &combined) { + return combined.image_id == image_id && combined.sampler_id == sampler_id; + }); + + if (itr == end(compiler.combined_image_samplers)) + { + uint32_t sampled_type; + uint32_t combined_module_id; + if (is_fetch) + { + // Have to invent the sampled image type. + sampled_type = compiler.ir.increase_bound_by(1); + auto &type = compiler.set(sampled_type, OpTypeSampledImage); + type = compiler.expression_type(args[2]); + type.self = sampled_type; + type.basetype = SPIRType::SampledImage; + type.image.depth = false; + combined_module_id = 0; + } + else + { + sampled_type = args[0]; + combined_module_id = args[1]; + } + + auto id = compiler.ir.increase_bound_by(2); + auto type_id = id + 0; + auto combined_id = id + 1; + + // Make a new type, pointer to OpTypeSampledImage, so we can make a variable of this type. + // We will probably have this type lying around, but it doesn't hurt to make duplicates for internal purposes. + auto &type = compiler.set(type_id, OpTypePointer); + auto &base = compiler.get(sampled_type); + type = base; + type.pointer = true; + type.storage = StorageClassUniformConstant; + type.parent_type = type_id; + + // Build new variable. + compiler.set(combined_id, type_id, StorageClassUniformConstant, 0); + + // Inherit RelaxedPrecision (and potentially other useful flags if deemed relevant). + // If any of OpSampledImage, underlying image or sampler are marked, inherit the decoration. + bool relaxed_precision = + (sampler_id && compiler.has_decoration(sampler_id, DecorationRelaxedPrecision)) || + (image_id && compiler.has_decoration(image_id, DecorationRelaxedPrecision)) || + (combined_module_id && compiler.has_decoration(combined_module_id, DecorationRelaxedPrecision)); + + if (relaxed_precision) + compiler.set_decoration(combined_id, DecorationRelaxedPrecision); + + // Propagate the array type for the original image as well. + auto *var = compiler.maybe_get_backing_variable(image_id); + if (var) + { + auto &parent_type = compiler.get(var->basetype); + type.array = parent_type.array; + type.array_size_literal = parent_type.array_size_literal; + } + + compiler.combined_image_samplers.push_back({ combined_id, image_id, sampler_id }); + } + + return true; +} + +VariableID Compiler::build_dummy_sampler_for_combined_images() +{ + DummySamplerForCombinedImageHandler handler(*this); + traverse_all_reachable_opcodes(get(ir.default_entry_point), handler); + if (handler.need_dummy_sampler) + { + uint32_t offset = ir.increase_bound_by(3); + auto type_id = offset + 0; + auto ptr_type_id = offset + 1; + auto var_id = offset + 2; + + auto &sampler = set(type_id, OpTypeSampler); + sampler.basetype = SPIRType::Sampler; + + auto &ptr_sampler = set(ptr_type_id, OpTypePointer); + ptr_sampler = sampler; + ptr_sampler.self = type_id; + ptr_sampler.storage = StorageClassUniformConstant; + ptr_sampler.pointer = true; + ptr_sampler.parent_type = type_id; + + set(var_id, ptr_type_id, StorageClassUniformConstant, 0); + set_name(var_id, "SPIRV_Cross_DummySampler"); + dummy_sampler_id = var_id; + return var_id; + } + else + return 0; +} + +void Compiler::build_combined_image_samplers() +{ + ir.for_each_typed_id([&](uint32_t, SPIRFunction &func) { + func.combined_parameters.clear(); + func.shadow_arguments.clear(); + func.do_combined_parameters = true; + }); + + combined_image_samplers.clear(); + CombinedImageSamplerHandler handler(*this); + traverse_all_reachable_opcodes(get(ir.default_entry_point), handler); +} + +SmallVector Compiler::get_specialization_constants() const +{ + SmallVector spec_consts; + ir.for_each_typed_id([&](uint32_t, const SPIRConstant &c) { + if (c.specialization && has_decoration(c.self, DecorationSpecId)) + spec_consts.push_back({ c.self, get_decoration(c.self, DecorationSpecId) }); + }); + return spec_consts; +} + +SPIRConstant &Compiler::get_constant(ConstantID id) +{ + return get(id); +} + +const SPIRConstant &Compiler::get_constant(ConstantID id) const +{ + return get(id); +} + +static bool exists_unaccessed_path_to_return(const CFG &cfg, uint32_t block, const unordered_set &blocks, + unordered_set &visit_cache) +{ + // This block accesses the variable. + if (blocks.find(block) != end(blocks)) + return false; + + // We are at the end of the CFG. + if (cfg.get_succeeding_edges(block).empty()) + return true; + + // If any of our successors have a path to the end, there exists a path from block. + for (auto &succ : cfg.get_succeeding_edges(block)) + { + if (visit_cache.count(succ) == 0) + { + if (exists_unaccessed_path_to_return(cfg, succ, blocks, visit_cache)) + return true; + visit_cache.insert(succ); + } + } + + return false; +} + +void Compiler::analyze_parameter_preservation( + SPIRFunction &entry, const CFG &cfg, const unordered_map> &variable_to_blocks, + const unordered_map> &complete_write_blocks) +{ + for (auto &arg : entry.arguments) + { + // Non-pointers are always inputs. + auto &type = get(arg.type); + if (!type.pointer) + continue; + + // Opaque argument types are always in + bool potential_preserve; + switch (type.basetype) + { + case SPIRType::Sampler: + case SPIRType::Image: + case SPIRType::SampledImage: + case SPIRType::AtomicCounter: + potential_preserve = false; + break; + + default: + potential_preserve = true; + break; + } + + if (!potential_preserve) + continue; + + auto itr = variable_to_blocks.find(arg.id); + if (itr == end(variable_to_blocks)) + { + // Variable is never accessed. + continue; + } + + // We have accessed a variable, but there was no complete writes to that variable. + // We deduce that we must preserve the argument. + itr = complete_write_blocks.find(arg.id); + if (itr == end(complete_write_blocks)) + { + arg.read_count++; + continue; + } + + // If there is a path through the CFG where no block completely writes to the variable, the variable will be in an undefined state + // when the function returns. We therefore need to implicitly preserve the variable in case there are writers in the function. + // Major case here is if a function is + // void foo(int &var) { if (cond) var = 10; } + // Using read/write counts, we will think it's just an out variable, but it really needs to be inout, + // because if we don't write anything whatever we put into the function must return back to the caller. + unordered_set visit_cache; + if (exists_unaccessed_path_to_return(cfg, entry.entry_block, itr->second, visit_cache)) + arg.read_count++; + } +} + +Compiler::AnalyzeVariableScopeAccessHandler::AnalyzeVariableScopeAccessHandler(Compiler &compiler_, + SPIRFunction &entry_) + : OpcodeHandler(compiler_) + , entry(entry_) +{ +} + +bool Compiler::AnalyzeVariableScopeAccessHandler::follow_function_call(const SPIRFunction &) +{ + // Only analyze within this function. + return false; +} + +void Compiler::AnalyzeVariableScopeAccessHandler::set_current_block(const SPIRBlock &block) +{ + current_block = █ + + // If we're branching to a block which uses OpPhi, in GLSL + // this will be a variable write when we branch, + // so we need to track access to these variables as well to + // have a complete picture. + const auto test_phi = [this, &block](uint32_t to) { + auto &next = compiler.get(to); + for (auto &phi : next.phi_variables) + { + if (phi.parent == block.self) + { + accessed_variables_to_block[phi.function_variable].insert(block.self); + // Phi variables are also accessed in our target branch block. + accessed_variables_to_block[phi.function_variable].insert(next.self); + + notify_variable_access(phi.local_variable, block.self); + } + } + }; + + switch (block.terminator) + { + case SPIRBlock::Direct: + notify_variable_access(block.condition, block.self); + test_phi(block.next_block); + break; + + case SPIRBlock::Select: + notify_variable_access(block.condition, block.self); + test_phi(block.true_block); + test_phi(block.false_block); + break; + + case SPIRBlock::MultiSelect: + { + notify_variable_access(block.condition, block.self); + auto &cases = compiler.get_case_list(block); + for (auto &target : cases) + test_phi(target.block); + if (block.default_block) + test_phi(block.default_block); + break; + } + + default: + break; + } +} + +void Compiler::AnalyzeVariableScopeAccessHandler::notify_variable_access(uint32_t id, uint32_t block) +{ + if (id == 0) + return; + + // Access chains used in multiple blocks mean hoisting all the variables used to construct the access chain as not all backends can use pointers. + auto itr = rvalue_forward_children.find(id); + if (itr != end(rvalue_forward_children)) + for (auto child_id : itr->second) + notify_variable_access(child_id, block); + + if (id_is_phi_variable(id)) + accessed_variables_to_block[id].insert(block); + else if (id_is_potential_temporary(id)) + accessed_temporaries_to_block[id].insert(block); +} + +bool Compiler::AnalyzeVariableScopeAccessHandler::id_is_phi_variable(uint32_t id) const +{ + if (id >= compiler.get_current_id_bound()) + return false; + auto *var = compiler.maybe_get(id); + return var && var->phi_variable; +} + +bool Compiler::AnalyzeVariableScopeAccessHandler::id_is_potential_temporary(uint32_t id) const +{ + if (id >= compiler.get_current_id_bound()) + return false; + + // Temporaries are not created before we start emitting code. + return compiler.ir.ids[id].empty() || (compiler.ir.ids[id].get_type() == TypeExpression); +} + +bool Compiler::AnalyzeVariableScopeAccessHandler::handle_terminator(const SPIRBlock &block) +{ + switch (block.terminator) + { + case SPIRBlock::Return: + if (block.return_value) + notify_variable_access(block.return_value, block.self); + break; + + case SPIRBlock::Select: + case SPIRBlock::MultiSelect: + notify_variable_access(block.condition, block.self); + break; + + default: + break; + } + + return true; +} + +bool Compiler::AnalyzeVariableScopeAccessHandler::handle(Op op, const uint32_t *args, uint32_t length) +{ + // Keep track of the types of temporaries, so we can hoist them out as necessary. + uint32_t result_type = 0, result_id = 0; + if (instruction_to_result_type(result_type, result_id, op, args, length)) + { + // For some opcodes, we will need to override the result id. + // If we need to hoist the temporary, the temporary type is the input, not the result. + if (op == OpConvertUToAccelerationStructureKHR) + { + auto itr = result_id_to_type.find(args[2]); + if (itr != result_id_to_type.end()) + result_type = itr->second; + } + + result_id_to_type[result_id] = result_type; + } + + switch (op) + { + case OpStore: + case OpCooperativeMatrixStoreKHR: + { + if (length < 2) + return false; + + ID ptr = args[0]; + auto *var = compiler.maybe_get_backing_variable(ptr); + + // If we store through an access chain, we have a partial write. + if (var) + { + accessed_variables_to_block[var->self].insert(current_block->self); + if (var->self == ptr) + complete_write_variables_to_block[var->self].insert(current_block->self); + else + partial_write_variables_to_block[var->self].insert(current_block->self); + } + + // args[0] might be an access chain we have to track use of. + notify_variable_access(args[0], current_block->self); + // Might try to store a Phi variable here. + notify_variable_access(args[1], current_block->self); + break; + } + + case OpAccessChain: + case OpInBoundsAccessChain: + case OpPtrAccessChain: + { + if (length < 3) + return false; + + // Access chains used in multiple blocks mean hoisting all the variables used to construct the access chain as not all backends can use pointers. + uint32_t ptr = args[2]; + auto *var = compiler.maybe_get(ptr); + if (var) + { + accessed_variables_to_block[var->self].insert(current_block->self); + rvalue_forward_children[args[1]].insert(var->self); + } + + // args[2] might be another access chain we have to track use of. + for (uint32_t i = 2; i < length; i++) + { + notify_variable_access(args[i], current_block->self); + rvalue_forward_children[args[1]].insert(args[i]); + } + + // Also keep track of the access chain pointer itself. + // In exceptionally rare cases, we can end up with a case where + // the access chain is generated in the loop body, but is consumed in continue block. + // This means we need complex loop workarounds, and we must detect this via CFG analysis. + notify_variable_access(args[1], current_block->self); + + // The result of an access chain is a fixed expression and is not really considered a temporary. + auto &e = compiler.set(args[1], "", args[0], true); + auto *backing_variable = compiler.maybe_get_backing_variable(ptr); + e.loaded_from = backing_variable ? VariableID(backing_variable->self) : VariableID(0); + + // Other backends might use SPIRAccessChain for this later. + compiler.ir.ids[args[1]].set_allow_type_rewrite(); + access_chain_expressions.insert(args[1]); + break; + } + + case OpCopyMemory: + { + if (length < 2) + return false; + + ID lhs = args[0]; + ID rhs = args[1]; + auto *var = compiler.maybe_get_backing_variable(lhs); + + // If we store through an access chain, we have a partial write. + if (var) + { + accessed_variables_to_block[var->self].insert(current_block->self); + if (var->self == lhs) + complete_write_variables_to_block[var->self].insert(current_block->self); + else + partial_write_variables_to_block[var->self].insert(current_block->self); + } + + // args[0:1] might be access chains we have to track use of. + for (uint32_t i = 0; i < 2; i++) + notify_variable_access(args[i], current_block->self); + + var = compiler.maybe_get_backing_variable(rhs); + if (var) + accessed_variables_to_block[var->self].insert(current_block->self); + break; + } + + case OpCopyObject: + { + // OpCopyObject copies the underlying non-pointer type, + // so any temp variable should be declared using the underlying type. + // If the type is a pointer, get its base type and overwrite the result type mapping. + auto &type = compiler.get(result_type); + if (type.pointer) + result_id_to_type[result_id] = type.parent_type; + + if (length < 3) + return false; + + auto *var = compiler.maybe_get_backing_variable(args[2]); + if (var) + accessed_variables_to_block[var->self].insert(current_block->self); + + // Might be an access chain which we have to keep track of. + notify_variable_access(args[1], current_block->self); + if (access_chain_expressions.count(args[2])) + access_chain_expressions.insert(args[1]); + + // Might try to copy a Phi variable here. + notify_variable_access(args[2], current_block->self); + break; + } + + case OpLoad: + case OpCooperativeMatrixLoadKHR: + { + if (length < 3) + return false; + uint32_t ptr = args[2]; + auto *var = compiler.maybe_get_backing_variable(ptr); + if (var) + accessed_variables_to_block[var->self].insert(current_block->self); + + // Loaded value is a temporary. + notify_variable_access(args[1], current_block->self); + + // Might be an access chain we have to track use of. + notify_variable_access(args[2], current_block->self); + + // If we're loading an opaque type we cannot lower it to a temporary, + // we must defer access of args[2] until it's used. + auto &type = compiler.get(args[0]); + if (compiler.type_is_opaque_value(type)) + rvalue_forward_children[args[1]].insert(args[2]); + break; + } + + case OpFunctionCall: + { + if (length < 3) + return false; + + // Return value may be a temporary. + if (compiler.get_type(args[0]).basetype != SPIRType::Void) + notify_variable_access(args[1], current_block->self); + + length -= 3; + args += 3; + + for (uint32_t i = 0; i < length; i++) + { + auto *var = compiler.maybe_get_backing_variable(args[i]); + if (var) + { + accessed_variables_to_block[var->self].insert(current_block->self); + // Assume we can get partial writes to this variable. + partial_write_variables_to_block[var->self].insert(current_block->self); + } + + // Cannot easily prove if argument we pass to a function is completely written. + // Usually, functions write to a dummy variable, + // which is then copied to in full to the real argument. + + // Might try to copy a Phi variable here. + notify_variable_access(args[i], current_block->self); + } + break; + } + + case OpSelect: + { + // In case of variable pointers, we might access a variable here. + // We cannot prove anything about these accesses however. + for (uint32_t i = 1; i < length; i++) + { + if (i >= 3) + { + auto *var = compiler.maybe_get_backing_variable(args[i]); + if (var) + { + accessed_variables_to_block[var->self].insert(current_block->self); + // Assume we can get partial writes to this variable. + partial_write_variables_to_block[var->self].insert(current_block->self); + } + } + + // Might try to copy a Phi variable here. + notify_variable_access(args[i], current_block->self); + } + break; + } + + case OpExtInst: + { + for (uint32_t i = 4; i < length; i++) + notify_variable_access(args[i], current_block->self); + notify_variable_access(args[1], current_block->self); + + uint32_t extension_set = args[2]; + if (compiler.get(extension_set).ext == SPIRExtension::GLSL) + { + auto op_450 = static_cast(args[3]); + switch (op_450) + { + case GLSLstd450Modf: + case GLSLstd450Frexp: + { + uint32_t ptr = args[5]; + auto *var = compiler.maybe_get_backing_variable(ptr); + if (var) + { + accessed_variables_to_block[var->self].insert(current_block->self); + if (var->self == ptr) + complete_write_variables_to_block[var->self].insert(current_block->self); + else + partial_write_variables_to_block[var->self].insert(current_block->self); + } + break; + } + + default: + break; + } + } + break; + } + + case OpArrayLength: + // Only result is a temporary. + notify_variable_access(args[1], current_block->self); + break; + + case OpLine: + case OpNoLine: + // Uses literals, but cannot be a phi variable or temporary, so ignore. + break; + + // Atomics shouldn't be able to access function-local variables. + // Some GLSL builtins access a pointer. + + case OpCompositeInsert: + case OpVectorShuffle: + // Specialize for opcode which contains literals. + for (uint32_t i = 1; i < 4; i++) + notify_variable_access(args[i], current_block->self); + break; + + case OpCompositeExtract: + // Specialize for opcode which contains literals. + for (uint32_t i = 1; i < 3; i++) + notify_variable_access(args[i], current_block->self); + break; + + case OpImageWrite: + for (uint32_t i = 0; i < length; i++) + { + // Argument 3 is a literal. + if (i != 3) + notify_variable_access(args[i], current_block->self); + } + break; + + case OpImageSampleImplicitLod: + case OpImageSampleExplicitLod: + case OpImageSparseSampleImplicitLod: + case OpImageSparseSampleExplicitLod: + case OpImageSampleProjImplicitLod: + case OpImageSampleProjExplicitLod: + case OpImageSparseSampleProjImplicitLod: + case OpImageSparseSampleProjExplicitLod: + case OpImageFetch: + case OpImageSparseFetch: + case OpImageRead: + case OpImageSparseRead: + for (uint32_t i = 1; i < length; i++) + { + // Argument 4 is a literal. + if (i != 4) + notify_variable_access(args[i], current_block->self); + } + break; + + case OpImageSampleDrefImplicitLod: + case OpImageSampleDrefExplicitLod: + case OpImageSparseSampleDrefImplicitLod: + case OpImageSparseSampleDrefExplicitLod: + case OpImageSampleProjDrefImplicitLod: + case OpImageSampleProjDrefExplicitLod: + case OpImageSparseSampleProjDrefImplicitLod: + case OpImageSparseSampleProjDrefExplicitLod: + case OpImageGather: + case OpImageSparseGather: + case OpImageDrefGather: + case OpImageSparseDrefGather: + for (uint32_t i = 1; i < length; i++) + { + // Argument 5 is a literal. + if (i != 5) + notify_variable_access(args[i], current_block->self); + } + break; + + default: + { + // Rather dirty way of figuring out where Phi variables are used. + // As long as only IDs are used, we can scan through instructions and try to find any evidence that + // the ID of a variable has been used. + // There are potential false positives here where a literal is used in-place of an ID, + // but worst case, it does not affect the correctness of the compile. + // Exhaustive analysis would be better here, but it's not worth it for now. + for (uint32_t i = 0; i < length; i++) + notify_variable_access(args[i], current_block->self); + break; + } + } + return true; +} + +Compiler::StaticExpressionAccessHandler::StaticExpressionAccessHandler(Compiler &compiler_, uint32_t variable_id_) + : OpcodeHandler(compiler_) + , variable_id(variable_id_) +{ +} + +bool Compiler::StaticExpressionAccessHandler::follow_function_call(const SPIRFunction &) +{ + return false; +} + +bool Compiler::StaticExpressionAccessHandler::handle(Op op, const uint32_t *args, uint32_t length) +{ + switch (op) + { + case OpStore: + case OpCooperativeMatrixStoreKHR: + if (length < 2) + return false; + if (args[0] == variable_id) + { + static_expression = args[1]; + write_count++; + } + break; + + case OpLoad: + case OpCooperativeMatrixLoadKHR: + if (length < 3) + return false; + if (args[2] == variable_id && static_expression == 0) // Tried to read from variable before it was initialized. + return false; + break; + + case OpAccessChain: + case OpInBoundsAccessChain: + case OpPtrAccessChain: + if (length < 3) + return false; + if (args[2] == variable_id) // If we try to access chain our candidate variable before we store to it, bail. + return false; + break; + + default: + break; + } + + return true; +} + +void Compiler::find_function_local_luts(SPIRFunction &entry, const AnalyzeVariableScopeAccessHandler &handler, + bool single_function) +{ + auto &cfg = *function_cfgs.find(entry.self)->second; + + // For each variable which is statically accessed. + for (auto &accessed_var : handler.accessed_variables_to_block) + { + auto &blocks = accessed_var.second; + auto &var = get(accessed_var.first); + auto &type = expression_type(accessed_var.first); + + // First check if there are writes to the variable. Later, if there are none, we'll + // reconsider it as globally accessed LUT. + if (!var.is_written_to) + { + var.is_written_to = handler.complete_write_variables_to_block.count(var.self) != 0 || + handler.partial_write_variables_to_block.count(var.self) != 0; + } + + // Only consider function local variables here. + // If we only have a single function in our CFG, private storage is also fine, + // since it behaves like a function local variable. + bool allow_lut = var.storage == StorageClassFunction || (single_function && var.storage == StorageClassPrivate); + if (!allow_lut) + continue; + + // We cannot be a phi variable. + if (var.phi_variable) + continue; + + // Only consider arrays here. + if (type.array.empty()) + continue; + + // If the variable has an initializer, make sure it is a constant expression. + uint32_t static_constant_expression = 0; + if (var.initializer) + { + if (ir.ids[var.initializer].get_type() != TypeConstant) + continue; + static_constant_expression = var.initializer; + + // There can be no stores to this variable, we have now proved we have a LUT. + if (var.is_written_to) + continue; + } + else + { + // We can have one, and only one write to the variable, and that write needs to be a constant. + + // No partial writes allowed. + if (handler.partial_write_variables_to_block.count(var.self) != 0) + continue; + + auto itr = handler.complete_write_variables_to_block.find(var.self); + + // No writes? + if (itr == end(handler.complete_write_variables_to_block)) + continue; + + // We write to the variable in more than one block. + auto &write_blocks = itr->second; + if (write_blocks.size() != 1) + continue; + + // The write needs to happen in the dominating block. + DominatorBuilder builder(cfg); + for (auto &block : blocks) + builder.add_block(block); + uint32_t dominator = builder.get_dominator(); + + // The complete write happened in a branch or similar, cannot deduce static expression. + if (write_blocks.count(dominator) == 0) + continue; + + // Find the static expression for this variable. + StaticExpressionAccessHandler static_expression_handler(*this, var.self); + traverse_all_reachable_opcodes(get(dominator), static_expression_handler); + + // We want one, and exactly one write + if (static_expression_handler.write_count != 1 || static_expression_handler.static_expression == 0) + continue; + + // Is it a constant expression? + if (ir.ids[static_expression_handler.static_expression].get_type() != TypeConstant) + continue; + + // We found a LUT! + static_constant_expression = static_expression_handler.static_expression; + } + + get(static_constant_expression).is_used_as_lut = true; + var.static_expression = static_constant_expression; + var.statically_assigned = true; + var.remapped_variable = true; + } +} + +void Compiler::analyze_variable_scope(SPIRFunction &entry, AnalyzeVariableScopeAccessHandler &handler) +{ + // First, we map out all variable access within a function. + // Essentially a map of block -> { variables accessed in the basic block } + traverse_all_reachable_opcodes(entry, handler); + + auto &cfg = *function_cfgs.find(entry.self)->second; + + // Analyze if there are parameters which need to be implicitly preserved with an "in" qualifier. + analyze_parameter_preservation(entry, cfg, handler.accessed_variables_to_block, + handler.complete_write_variables_to_block); + + unordered_map potential_loop_variables; + + // Find the loop dominator block for each block. + for (auto &block_id : entry.blocks) + { + auto &block = get(block_id); + + auto itr = ir.continue_block_to_loop_header.find(block_id); + if (itr != end(ir.continue_block_to_loop_header) && itr->second != block_id) + { + // Continue block might be unreachable in the CFG, but we still like to know the loop dominator. + // Edge case is when continue block is also the loop header, don't set the dominator in this case. + block.loop_dominator = itr->second; + } + else + { + uint32_t loop_dominator = cfg.find_loop_dominator(block_id); + if (loop_dominator != block_id) + block.loop_dominator = loop_dominator; + else + block.loop_dominator = SPIRBlock::NoDominator; + } + } + + // For each variable which is statically accessed. + for (auto &var : handler.accessed_variables_to_block) + { + // Only deal with variables which are considered local variables in this function. + if (find(begin(entry.local_variables), end(entry.local_variables), VariableID(var.first)) == + end(entry.local_variables)) + continue; + + DominatorBuilder builder(cfg); + auto &blocks = var.second; + auto &type = expression_type(var.first); + BlockID potential_continue_block = 0; + + // Figure out which block is dominating all accesses of those variables. + for (auto &block : blocks) + { + // If we're accessing a variable inside a continue block, this variable might be a loop variable. + // We can only use loop variables with scalars, as we cannot track static expressions for vectors. + if (is_continue(block)) + { + // Potentially awkward case to check for. + // We might have a variable inside a loop, which is touched by the continue block, + // but is not actually a loop variable. + // The continue block is dominated by the inner part of the loop, which does not make sense in high-level + // language output because it will be declared before the body, + // so we will have to lift the dominator up to the relevant loop header instead. + builder.add_block(ir.continue_block_to_loop_header[block]); + + // Arrays or structs cannot be loop variables. + if (type.vecsize == 1 && type.columns == 1 && type.basetype != SPIRType::Struct && type.array.empty()) + { + // The variable is used in multiple continue blocks, this is not a loop + // candidate, signal that by setting block to -1u. + if (potential_continue_block == 0) + potential_continue_block = block; + else + potential_continue_block = ~(0u); + } + } + + builder.add_block(block); + } + + builder.lift_continue_block_dominator(); + + // Add it to a per-block list of variables. + BlockID dominating_block = builder.get_dominator(); + + if (dominating_block && potential_continue_block != 0 && potential_continue_block != ~0u) + { + auto &inner_block = get(dominating_block); + + BlockID merge_candidate = 0; + + // Analyze the dominator. If it lives in a different loop scope than the candidate continue + // block, reject the loop variable candidate. + if (inner_block.merge == SPIRBlock::MergeLoop) + merge_candidate = inner_block.merge_block; + else if (inner_block.loop_dominator != SPIRBlock::NoDominator) + merge_candidate = get(inner_block.loop_dominator).merge_block; + + if (merge_candidate != 0 && cfg.is_reachable(merge_candidate)) + { + // If the merge block has a higher post-visit order, we know that continue candidate + // cannot reach the merge block, and we have two separate scopes. + if (!cfg.is_reachable(potential_continue_block) || + cfg.get_visit_order(merge_candidate) > cfg.get_visit_order(potential_continue_block)) + { + potential_continue_block = 0; + } + } + } + + if (potential_continue_block != 0 && potential_continue_block != ~0u) + potential_loop_variables[var.first] = potential_continue_block; + + // For variables whose dominating block is inside a loop, there is a risk that these variables + // actually need to be preserved across loop iterations. We can express this by adding + // a "read" access to the loop header. + // In the dominating block, we must see an OpStore or equivalent as the first access of an OpVariable. + // Should that fail, we look for the outermost loop header and tack on an access there. + // Phi nodes cannot have this problem. + if (dominating_block) + { + auto &variable = get(var.first); + if (!variable.phi_variable) + { + auto *block = &get(dominating_block); + bool preserve = may_read_undefined_variable_in_block(*block, var.first); + if (preserve) + { + // Find the outermost loop scope. + while (block->loop_dominator != BlockID(SPIRBlock::NoDominator)) + block = &get(block->loop_dominator); + + if (block->self != dominating_block) + { + builder.add_block(block->self); + dominating_block = builder.get_dominator(); + } + } + } + } + + // If all blocks here are dead code, this will be 0, so the variable in question + // will be completely eliminated. + if (dominating_block) + { + auto &block = get(dominating_block); + block.dominated_variables.push_back(var.first); + get(var.first).dominator = dominating_block; + } + } + + for (auto &var : handler.accessed_temporaries_to_block) + { + auto itr = handler.result_id_to_type.find(var.first); + + if (itr == end(handler.result_id_to_type)) + { + // We found a false positive ID being used, ignore. + // This should probably be an assert. + continue; + } + + // There is no point in doing domination analysis for opaque types. + auto &type = get(itr->second); + if (type_is_opaque_value(type)) + continue; + + DominatorBuilder builder(cfg); + bool force_temporary = false; + bool used_in_header_hoisted_continue_block = false; + + // Figure out which block is dominating all accesses of those temporaries. + auto &blocks = var.second; + for (auto &block : blocks) + { + builder.add_block(block); + + if (blocks.size() != 1 && is_continue(block)) + { + // The risk here is that inner loop can dominate the continue block. + // Any temporary we access in the continue block must be declared before the loop. + // This is moot for complex loops however. + auto &loop_header_block = get(ir.continue_block_to_loop_header[block]); + assert(loop_header_block.merge == SPIRBlock::MergeLoop); + builder.add_block(loop_header_block.self); + used_in_header_hoisted_continue_block = true; + } + } + + uint32_t dominating_block = builder.get_dominator(); + + if (blocks.size() != 1 && is_single_block_loop(dominating_block)) + { + // Awkward case, because the loop header is also the continue block, + // so hoisting to loop header does not help. + force_temporary = true; + } + + if (dominating_block) + { + // If we touch a variable in the dominating block, this is the expected setup. + // SPIR-V normally mandates this, but we have extra cases for temporary use inside loops. + bool first_use_is_dominator = blocks.count(dominating_block) != 0; + + if (!first_use_is_dominator || force_temporary) + { + if (handler.access_chain_expressions.count(var.first)) + { + // Exceptionally rare case. + // We cannot declare temporaries of access chains (except on MSL perhaps with pointers). + // Rather than do that, we force the indexing expressions to be declared in the right scope by + // tracking their usage to that end. There is no temporary to hoist. + // However, we still need to observe declaration order of the access chain. + + if (used_in_header_hoisted_continue_block) + { + // For this scenario, we used an access chain inside a continue block where we also registered an access to header block. + // This is a problem as we need to declare an access chain properly first with full definition. + // We cannot use temporaries for these expressions, + // so we must make sure the access chain is declared ahead of time. + // Force a complex for loop to deal with this. + // TODO: Out-of-order declaring for loops where continue blocks are emitted last might be another option. + auto &loop_header_block = get(dominating_block); + assert(loop_header_block.merge == SPIRBlock::MergeLoop); + loop_header_block.complex_continue = true; + } + } + else + { + // This should be very rare, but if we try to declare a temporary inside a loop, + // and that temporary is used outside the loop as well (spirv-opt inliner likes this) + // we should actually emit the temporary outside the loop. + hoisted_temporaries.insert(var.first); + forced_temporaries.insert(var.first); + + auto &block_temporaries = get(dominating_block).declare_temporary; + block_temporaries.emplace_back(handler.result_id_to_type[var.first], var.first); + } + } + else if (blocks.size() > 1) + { + // Keep track of the temporary as we might have to declare this temporary. + // This can happen if the loop header dominates a temporary, but we have a complex fallback loop. + // In this case, the header is actually inside the for (;;) {} block, and we have problems. + // What we need to do is hoist the temporaries outside the for (;;) {} block in case the header block + // declares the temporary. + auto &block_temporaries = get(dominating_block).potential_declare_temporary; + block_temporaries.emplace_back(handler.result_id_to_type[var.first], var.first); + } + } + } + + unordered_set seen_blocks; + + // Now, try to analyze whether or not these variables are actually loop variables. + for (auto &loop_variable : potential_loop_variables) + { + auto &var = get(loop_variable.first); + auto dominator = var.dominator; + BlockID block = loop_variable.second; + + // The variable was accessed in multiple continue blocks, ignore. + if (block == BlockID(~(0u)) || block == BlockID(0)) + continue; + + // Dead code. + if (dominator == ID(0)) + continue; + + BlockID header = 0; + + // Find the loop header for this block if we are a continue block. + { + auto itr = ir.continue_block_to_loop_header.find(block); + if (itr != end(ir.continue_block_to_loop_header)) + { + header = itr->second; + } + else if (get(block).continue_block == block) + { + // Also check for self-referential continue block. + header = block; + } + } + + assert(header); + auto &header_block = get(header); + auto &blocks = handler.accessed_variables_to_block[loop_variable.first]; + + // If a loop variable is not used before the loop, it's probably not a loop variable. + bool has_accessed_variable = blocks.count(header) != 0; + + // Now, there are two conditions we need to meet for the variable to be a loop variable. + // 1. The dominating block must have a branch-free path to the loop header, + // this way we statically know which expression should be part of the loop variable initializer. + + // Walk from the dominator, if there is one straight edge connecting + // dominator and loop header, we statically know the loop initializer. + bool static_loop_init = true; + while (dominator != header) + { + if (blocks.count(dominator) != 0) + has_accessed_variable = true; + + auto &succ = cfg.get_succeeding_edges(dominator); + if (succ.size() != 1) + { + static_loop_init = false; + break; + } + + auto &pred = cfg.get_preceding_edges(succ.front()); + if (pred.size() != 1 || pred.front() != dominator) + { + static_loop_init = false; + break; + } + + dominator = succ.front(); + } + + if (!static_loop_init || !has_accessed_variable) + continue; + + // The second condition we need to meet is that no access after the loop + // merge can occur. Walk the CFG to see if we find anything. + + seen_blocks.clear(); + cfg.walk_from(seen_blocks, header_block.merge_block, [&](uint32_t walk_block) -> bool { + // We found a block which accesses the variable outside the loop. + if (blocks.find(walk_block) != end(blocks)) + static_loop_init = false; + return true; + }); + + if (!static_loop_init) + continue; + + // We have a loop variable. + header_block.loop_variables.push_back(loop_variable.first); + // Need to sort here as variables come from an unordered container, and pushing stuff in wrong order + // will break reproducability in regression runs. + sort(begin(header_block.loop_variables), end(header_block.loop_variables)); + get(loop_variable.first).loop_variable = true; + } +} + +bool Compiler::may_read_undefined_variable_in_block(const SPIRBlock &block, uint32_t var) +{ + for (auto &op : block.ops) + { + auto *ops = stream(op); + switch (op.op) + { + case OpStore: + case OpCooperativeMatrixStoreKHR: + case OpCopyMemory: + if (ops[0] == var) + return false; + break; + + case OpAccessChain: + case OpInBoundsAccessChain: + case OpPtrAccessChain: + // Access chains are generally used to partially read and write. It's too hard to analyze + // if all constituents are written fully before continuing, so just assume it's preserved. + // This is the same as the parameter preservation analysis. + if (ops[2] == var) + return true; + break; + + case OpSelect: + // Variable pointers. + // We might read before writing. + if (ops[3] == var || ops[4] == var) + return true; + break; + + case OpPhi: + { + // Variable pointers. + // We might read before writing. + if (op.length < 2) + break; + + uint32_t count = op.length - 2; + for (uint32_t i = 0; i < count; i += 2) + if (ops[i + 2] == var) + return true; + break; + } + + case OpCopyObject: + case OpLoad: + case OpCooperativeVectorLoadNV: + case OpCooperativeMatrixLoadKHR: + if (ops[2] == var) + return true; + break; + + case OpFunctionCall: + { + if (op.length < 3) + break; + + // May read before writing. + uint32_t count = op.length - 3; + for (uint32_t i = 0; i < count; i++) + if (ops[i + 3] == var) + return true; + break; + } + + default: + break; + } + } + + // Not accessed somehow, at least not in a usual fashion. + // It's likely accessed in a branch, so assume we must preserve. + return true; +} + +bool Compiler::GeometryEmitDisocveryHandler::handle(Op opcode, const uint32_t *, uint32_t) +{ + if (opcode == OpEmitVertex || opcode == OpEndPrimitive) + { + for (auto *func : function_stack) + func->emits_geometry = true; + } + + return true; +} + +bool Compiler::GeometryEmitDisocveryHandler::begin_function_scope(const uint32_t *stream, uint32_t) +{ + auto &callee = compiler.get(stream[2]); + function_stack.push_back(&callee); + return true; +} + +bool Compiler::GeometryEmitDisocveryHandler::end_function_scope(const uint32_t *stream, uint32_t) +{ + (void)stream; + assert(function_stack.back() == &compiler.get(stream[2])); + function_stack.pop_back(); + + return true; +} + +void Compiler::discover_geometry_emitters() +{ + GeometryEmitDisocveryHandler handler(*this); + + traverse_all_reachable_opcodes(get(ir.default_entry_point), handler); +} + +Bitset Compiler::get_buffer_block_flags(VariableID id) const +{ + return ir.get_buffer_block_flags(get(id)); +} + +bool Compiler::get_common_basic_type(const SPIRType &type, SPIRType::BaseType &base_type) +{ + if (type.basetype == SPIRType::Struct) + { + base_type = SPIRType::Unknown; + for (auto &member_type : type.member_types) + { + SPIRType::BaseType member_base; + if (!get_common_basic_type(get(member_type), member_base)) + return false; + + if (base_type == SPIRType::Unknown) + base_type = member_base; + else if (base_type != member_base) + return false; + } + return true; + } + else + { + base_type = type.basetype; + return true; + } +} + +void Compiler::ActiveBuiltinHandler::handle_builtin(const SPIRType &type, BuiltIn builtin, + const Bitset &decoration_flags) +{ + // If used, we will need to explicitly declare a new array size for these builtins. + + if (builtin == BuiltInClipDistance) + { + if (!type.array_size_literal[0]) + SPIRV_CROSS_THROW("Array size for ClipDistance must be a literal."); + uint32_t array_size = type.array[0]; + if (array_size == 0) + SPIRV_CROSS_THROW("Array size for ClipDistance must not be unsized."); + compiler.clip_distance_count = array_size; + } + else if (builtin == BuiltInCullDistance) + { + if (!type.array_size_literal[0]) + SPIRV_CROSS_THROW("Array size for CullDistance must be a literal."); + uint32_t array_size = type.array[0]; + if (array_size == 0) + SPIRV_CROSS_THROW("Array size for CullDistance must not be unsized."); + compiler.cull_distance_count = array_size; + } + else if (builtin == BuiltInPosition) + { + if (decoration_flags.get(DecorationInvariant)) + compiler.position_invariant = true; + } +} + +void Compiler::ActiveBuiltinHandler::add_if_builtin(uint32_t id, bool allow_blocks) +{ + // Only handle plain variables here. + // Builtins which are part of a block are handled in AccessChain. + // If allow_blocks is used however, this is to handle initializers of blocks, + // which implies that all members are written to. + + auto *var = compiler.maybe_get(id); + auto *m = compiler.ir.find_meta(id); + if (var && m) + { + auto &type = compiler.get(var->basetype); + auto &decorations = m->decoration; + auto &flags = type.storage == StorageClassInput ? + compiler.active_input_builtins : compiler.active_output_builtins; + if (decorations.builtin) + { + flags.set(decorations.builtin_type); + handle_builtin(type, decorations.builtin_type, decorations.decoration_flags); + } + else if (allow_blocks && compiler.has_decoration(type.self, DecorationBlock)) + { + uint32_t member_count = uint32_t(type.member_types.size()); + for (uint32_t i = 0; i < member_count; i++) + { + if (compiler.has_member_decoration(type.self, i, DecorationBuiltIn)) + { + auto &member_type = compiler.get(type.member_types[i]); + BuiltIn builtin = BuiltIn(compiler.get_member_decoration(type.self, i, DecorationBuiltIn)); + flags.set(builtin); + handle_builtin(member_type, builtin, compiler.get_member_decoration_bitset(type.self, i)); + } + } + } + } +} + +void Compiler::ActiveBuiltinHandler::add_if_builtin(uint32_t id) +{ + add_if_builtin(id, false); +} + +void Compiler::ActiveBuiltinHandler::add_if_builtin_or_block(uint32_t id) +{ + add_if_builtin(id, true); +} + +bool Compiler::ActiveBuiltinHandler::handle(Op opcode, const uint32_t *args, uint32_t length) +{ + switch (opcode) + { + case OpStore: + case OpCooperativeMatrixStoreKHR: + if (length < 1) + return false; + + add_if_builtin(args[0]); + break; + + case OpCopyMemory: + if (length < 2) + return false; + + add_if_builtin(args[0]); + add_if_builtin(args[1]); + break; + + case OpCopyObject: + case OpLoad: + case OpCooperativeMatrixLoadKHR: + if (length < 3) + return false; + + add_if_builtin(args[2]); + break; + + case OpSelect: + if (length < 5) + return false; + + add_if_builtin(args[3]); + add_if_builtin(args[4]); + break; + + case OpPhi: + { + if (length < 2) + return false; + + uint32_t count = length - 2; + args += 2; + for (uint32_t i = 0; i < count; i += 2) + add_if_builtin(args[i]); + break; + } + + case OpFunctionCall: + { + if (length < 3) + return false; + + uint32_t count = length - 3; + args += 3; + for (uint32_t i = 0; i < count; i++) + add_if_builtin(args[i]); + break; + } + + case OpAccessChain: + case OpInBoundsAccessChain: + case OpPtrAccessChain: + { + if (length < 4) + return false; + + // Only consider global variables, cannot consider variables in functions yet, or other + // access chains as they have not been created yet. + auto *var = compiler.maybe_get(args[2]); + if (!var) + break; + + // Required if we access chain into builtins like gl_GlobalInvocationID. + add_if_builtin(args[2]); + + // Start traversing type hierarchy at the proper non-pointer types. + auto *type = &compiler.get_variable_data_type(*var); + + auto &flags = + var->storage == StorageClassInput ? compiler.active_input_builtins : compiler.active_output_builtins; + + uint32_t count = length - 3; + args += 3; + for (uint32_t i = 0; i < count; i++) + { + // Pointers + // PtrAccessChain functions more like a pointer offset. Type remains the same. + if (opcode == OpPtrAccessChain && i == 0) + continue; + + // Arrays + if (!type->array.empty()) + { + type = &compiler.get(type->parent_type); + } + // Structs + else if (type->basetype == SPIRType::Struct) + { + uint32_t index = compiler.get(args[i]).scalar(); + + if (index < uint32_t(compiler.ir.meta[type->self].members.size())) + { + auto &decorations = compiler.ir.meta[type->self].members[index]; + if (decorations.builtin) + { + flags.set(decorations.builtin_type); + handle_builtin(compiler.get(type->member_types[index]), decorations.builtin_type, + decorations.decoration_flags); + } + } + + type = &compiler.get(type->member_types[index]); + } + else + { + // No point in traversing further. We won't find any extra builtins. + break; + } + } + break; + } + + default: + break; + } + + return true; +} + +void Compiler::update_active_builtins() +{ + active_input_builtins.reset(); + active_output_builtins.reset(); + cull_distance_count = 0; + clip_distance_count = 0; + ActiveBuiltinHandler handler(*this); + traverse_all_reachable_opcodes(get(ir.default_entry_point), handler); + + ir.for_each_typed_id([&](uint32_t, const SPIRVariable &var) { + if (var.storage != StorageClassOutput) + return; + if (!interface_variable_exists_in_entry_point(var.self)) + return; + + // Also, make sure we preserve output variables which are only initialized, but never accessed by any code. + if (var.initializer != ID(0)) + handler.add_if_builtin_or_block(var.self); + }); +} + +// Returns whether this shader uses a builtin of the storage class +bool Compiler::has_active_builtin(BuiltIn builtin, StorageClass storage) const +{ + const Bitset *flags; + switch (storage) + { + case StorageClassInput: + flags = &active_input_builtins; + break; + case StorageClassOutput: + flags = &active_output_builtins; + break; + + default: + return false; + } + return flags->get(builtin); +} + +void Compiler::analyze_image_and_sampler_usage() +{ + CombinedImageSamplerDrefHandler dref_handler(*this); + traverse_all_reachable_opcodes(get(ir.default_entry_point), dref_handler); + + CombinedImageSamplerUsageHandler handler(*this, dref_handler.dref_combined_samplers); + traverse_all_reachable_opcodes(get(ir.default_entry_point), handler); + + // Need to run this traversal twice. First time, we propagate any comparison sampler usage from leaf functions + // down to main(). + // In the second pass, we can propagate up forced depth state coming from main() up into leaf functions. + handler.dependency_hierarchy.clear(); + traverse_all_reachable_opcodes(get(ir.default_entry_point), handler); + + comparison_ids = std::move(handler.comparison_ids); + need_subpass_input = handler.need_subpass_input; + need_subpass_input_ms = handler.need_subpass_input_ms; + + // Forward information from separate images and samplers into combined image samplers. + for (auto &combined : combined_image_samplers) + if (comparison_ids.count(combined.sampler_id)) + comparison_ids.insert(combined.combined_id); +} + +bool Compiler::CombinedImageSamplerDrefHandler::handle(Op opcode, const uint32_t *args, uint32_t) +{ + // Mark all sampled images which are used with Dref. + switch (opcode) + { + case OpImageSampleDrefExplicitLod: + case OpImageSampleDrefImplicitLod: + case OpImageSampleProjDrefExplicitLod: + case OpImageSampleProjDrefImplicitLod: + case OpImageSparseSampleProjDrefImplicitLod: + case OpImageSparseSampleDrefImplicitLod: + case OpImageSparseSampleProjDrefExplicitLod: + case OpImageSparseSampleDrefExplicitLod: + case OpImageDrefGather: + case OpImageSparseDrefGather: + dref_combined_samplers.insert(args[2]); + return true; + + default: + break; + } + + return true; +} + +const CFG &Compiler::get_cfg_for_current_function() const +{ + assert(current_function); + return get_cfg_for_function(current_function->self); +} + +const CFG &Compiler::get_cfg_for_function(uint32_t id) const +{ + auto cfg_itr = function_cfgs.find(id); + assert(cfg_itr != end(function_cfgs)); + assert(cfg_itr->second); + return *cfg_itr->second; +} + +void Compiler::build_function_control_flow_graphs_and_analyze() +{ + CFGBuilder handler(*this); + handler.function_cfgs[ir.default_entry_point].reset(new CFG(*this, get(ir.default_entry_point))); + traverse_all_reachable_opcodes(get(ir.default_entry_point), handler); + function_cfgs = std::move(handler.function_cfgs); + bool single_function = function_cfgs.size() <= 1; + + for (auto &f : function_cfgs) + { + auto &func = get(f.first); + AnalyzeVariableScopeAccessHandler scope_handler(*this, func); + analyze_variable_scope(func, scope_handler); + find_function_local_luts(func, scope_handler, single_function); + + // Check if we can actually use the loop variables we found in analyze_variable_scope. + // To use multiple initializers, we need the same type and qualifiers. + for (auto block : func.blocks) + { + auto &b = get(block); + if (b.loop_variables.size() < 2) + continue; + + auto &flags = get_decoration_bitset(b.loop_variables.front()); + uint32_t type = get(b.loop_variables.front()).basetype; + bool invalid_initializers = false; + for (auto loop_variable : b.loop_variables) + { + if (flags != get_decoration_bitset(loop_variable) || + type != get(b.loop_variables.front()).basetype) + { + invalid_initializers = true; + break; + } + } + + if (invalid_initializers) + { + for (auto loop_variable : b.loop_variables) + get(loop_variable).loop_variable = false; + b.loop_variables.clear(); + } + } + } + + // Find LUTs which are not function local. Only consider this case if the CFG is multi-function, + // otherwise we treat Private as Function trivially. + // Needs to be analyzed from the outside since we have to block the LUT optimization if at least + // one function writes to it. + if (!single_function) + { + for (auto &id : global_variables) + { + auto &var = get(id); + auto &type = get_variable_data_type(var); + + if (is_array(type) && var.storage == StorageClassPrivate && + var.initializer && !var.is_written_to && + ir.ids[var.initializer].get_type() == TypeConstant) + { + get(var.initializer).is_used_as_lut = true; + var.static_expression = var.initializer; + var.statically_assigned = true; + var.remapped_variable = true; + } + } + } +} + +Compiler::CFGBuilder::CFGBuilder(Compiler &compiler_) + : OpcodeHandler(compiler_) +{ +} + +bool Compiler::CFGBuilder::handle(Op, const uint32_t *, uint32_t) +{ + return true; +} + +bool Compiler::CFGBuilder::follow_function_call(const SPIRFunction &func) +{ + if (function_cfgs.find(func.self) == end(function_cfgs)) + { + function_cfgs[func.self].reset(new CFG(compiler, func)); + return true; + } + else + return false; +} + +void Compiler::CombinedImageSamplerUsageHandler::add_dependency(uint32_t dst, uint32_t src) +{ + dependency_hierarchy[dst].insert(src); + // Propagate up any comparison state if we're loading from one such variable. + if (comparison_ids.count(src)) + comparison_ids.insert(dst); +} + +bool Compiler::CombinedImageSamplerUsageHandler::begin_function_scope(const uint32_t *args, uint32_t length) +{ + if (length < 3) + return false; + + auto &func = compiler.get(args[2]); + const auto *arg = &args[3]; + length -= 3; + + for (uint32_t i = 0; i < length; i++) + { + auto &argument = func.arguments[i]; + add_dependency(argument.id, arg[i]); + } + + return true; +} + +void Compiler::CombinedImageSamplerUsageHandler::add_hierarchy_to_comparison_ids(uint32_t id) +{ + // Traverse the variable dependency hierarchy and tag everything in its path with comparison ids. + comparison_ids.insert(id); + + for (auto &dep_id : dependency_hierarchy[id]) + add_hierarchy_to_comparison_ids(dep_id); +} + +bool Compiler::CombinedImageSamplerUsageHandler::handle(Op opcode, const uint32_t *args, uint32_t length) +{ + switch (opcode) + { + case OpAccessChain: + case OpInBoundsAccessChain: + case OpPtrAccessChain: + case OpLoad: + { + if (length < 3) + return false; + + add_dependency(args[1], args[2]); + + // Ideally defer this to OpImageRead, but then we'd need to track loaded IDs. + // If we load an image, we're going to use it and there is little harm in declaring an unused gl_FragCoord. + auto &type = compiler.get(args[0]); + if (type.image.dim == DimSubpassData) + { + need_subpass_input = true; + if (type.image.ms) + need_subpass_input_ms = true; + } + + // If we load a SampledImage and it will be used with Dref, propagate the state up. + if (dref_combined_samplers.count(args[1]) != 0) + add_hierarchy_to_comparison_ids(args[1]); + break; + } + + case OpSampledImage: + { + if (length < 4) + return false; + + // If the underlying resource has been used for comparison then duplicate loads of that resource must be too. + // This image must be a depth image. + uint32_t result_id = args[1]; + uint32_t image = args[2]; + uint32_t sampler = args[3]; + + if (dref_combined_samplers.count(result_id) != 0) + { + add_hierarchy_to_comparison_ids(image); + + // This sampler must be a SamplerComparisonState, and not a regular SamplerState. + add_hierarchy_to_comparison_ids(sampler); + + // Mark the OpSampledImage itself as being comparison state. + comparison_ids.insert(result_id); + } + return true; + } + + default: + break; + } + + return true; +} + +bool Compiler::buffer_is_hlsl_counter_buffer(VariableID id) const +{ + auto *m = ir.find_meta(id); + return m && m->hlsl_is_magic_counter_buffer; +} + +bool Compiler::buffer_get_hlsl_counter_buffer(VariableID id, uint32_t &counter_id) const +{ + auto *m = ir.find_meta(id); + + // First, check for the proper decoration. + if (m && m->hlsl_magic_counter_buffer != 0) + { + counter_id = m->hlsl_magic_counter_buffer; + return true; + } + else + return false; +} + +void Compiler::make_constant_null(uint32_t id, uint32_t type) +{ + auto &constant_type = get(type); + + if (constant_type.pointer) + { + auto &constant = set(id, type); + constant.make_null(constant_type); + } + else if (!constant_type.array.empty()) + { + assert(constant_type.parent_type); + uint32_t parent_id = ir.increase_bound_by(1); + make_constant_null(parent_id, constant_type.parent_type); + + // The array size of OpConstantNull can be either literal or specialization constant. + // In the latter case, we cannot take the value as-is, as it can be changed to anything. + // Rather, we assume it to be *one* for the sake of initializer. + bool is_literal_array_size = constant_type.array_size_literal.back(); + uint32_t count = is_literal_array_size ? constant_type.array.back() : 1; + SmallVector elements(count); + for (uint32_t i = 0; i < count; i++) + elements[i] = parent_id; + auto &constant = set(id, type, elements.data(), uint32_t(elements.size()), false); + constant.is_null_array_specialized_length = !is_literal_array_size; + } + else if (!constant_type.member_types.empty()) + { + uint32_t member_ids = ir.increase_bound_by(uint32_t(constant_type.member_types.size())); + SmallVector elements(constant_type.member_types.size()); + for (uint32_t i = 0; i < constant_type.member_types.size(); i++) + { + make_constant_null(member_ids + i, constant_type.member_types[i]); + elements[i] = member_ids + i; + } + set(id, type, elements.data(), uint32_t(elements.size()), false); + } + else + { + auto &constant = set(id, type); + constant.make_null(constant_type); + } +} + +const SmallVector &Compiler::get_declared_capabilities() const +{ + return ir.declared_capabilities; +} + +const SmallVector &Compiler::get_declared_extensions() const +{ + return ir.declared_extensions; +} + +std::string Compiler::get_remapped_declared_block_name(VariableID id) const +{ + return get_remapped_declared_block_name(id, false); +} + +std::string Compiler::get_remapped_declared_block_name(uint32_t id, bool fallback_prefer_instance_name) const +{ + auto itr = declared_block_names.find(id); + if (itr != end(declared_block_names)) + { + return itr->second; + } + else + { + auto &var = get(id); + + if (fallback_prefer_instance_name) + { + return to_name(var.self); + } + else + { + auto &type = get(var.basetype); + auto *type_meta = ir.find_meta(type.self); + auto *block_name = type_meta ? &type_meta->decoration.alias : nullptr; + return (!block_name || block_name->empty()) ? get_block_fallback_name(id) : *block_name; + } + } +} + +bool Compiler::reflection_ssbo_instance_name_is_significant() const +{ + if (!ir.sources.empty() && ir.sources[0].known) + { + // UAVs from HLSL source tend to be declared in a way where the type is reused + // but the instance name is significant, and that's the name we should report. + // For GLSL, SSBOs each have their own block type as that's how GLSL is written. + return ir.sources[0].hlsl; + } + + unordered_set ssbo_type_ids; + bool aliased_ssbo_types = false; + + // If we don't have any OpSource information, we need to perform some shaky heuristics. + ir.for_each_typed_id([&](uint32_t, const SPIRVariable &var) { + auto &type = this->get(var.basetype); + if (!type.pointer || var.storage == StorageClassFunction) + return; + + bool ssbo = var.storage == StorageClassStorageBuffer || + (var.storage == StorageClassUniform && has_decoration(type.self, DecorationBufferBlock)); + + if (ssbo) + { + if (ssbo_type_ids.count(type.self)) + aliased_ssbo_types = true; + else + ssbo_type_ids.insert(type.self); + } + }); + + // If the block name is aliased, assume we have HLSL-style UAV declarations. + return aliased_ssbo_types; +} + +bool Compiler::instruction_to_result_type(uint32_t &result_type, uint32_t &result_id, Op op, + const uint32_t *args, uint32_t length) +{ + if (length < 2) + return false; + + bool has_result_id = false, has_result_type = false; + HasResultAndType(op, &has_result_id, &has_result_type); + if (has_result_id && has_result_type) + { + result_type = args[0]; + result_id = args[1]; + return true; + } + else + return false; +} + +Bitset Compiler::combined_decoration_for_member(const SPIRType &type, uint32_t index) const +{ + Bitset flags; + auto *type_meta = ir.find_meta(type.self); + + if (type_meta) + { + auto &members = type_meta->members; + if (index >= members.size()) + return flags; + auto &dec = members[index]; + + flags.merge_or(dec.decoration_flags); + + auto &member_type = get(type.member_types[index]); + + // If our member type is a struct, traverse all the child members as well recursively. + auto &member_childs = member_type.member_types; + for (uint32_t i = 0; i < member_childs.size(); i++) + { + auto &child_member_type = get(member_childs[i]); + if (!child_member_type.pointer) + flags.merge_or(combined_decoration_for_member(member_type, i)); + } + } + + return flags; +} + +bool Compiler::is_desktop_only_format(ImageFormat format) +{ + switch (format) + { + // Desktop-only formats + case ImageFormatR11fG11fB10f: + case ImageFormatR16f: + case ImageFormatRgb10A2: + case ImageFormatR8: + case ImageFormatRg8: + case ImageFormatR16: + case ImageFormatRg16: + case ImageFormatRgba16: + case ImageFormatR16Snorm: + case ImageFormatRg16Snorm: + case ImageFormatRgba16Snorm: + case ImageFormatR8Snorm: + case ImageFormatRg8Snorm: + case ImageFormatR8ui: + case ImageFormatRg8ui: + case ImageFormatR16ui: + case ImageFormatRgb10a2ui: + case ImageFormatR8i: + case ImageFormatRg8i: + case ImageFormatR16i: + return true; + default: + break; + } + + return false; +} + +// An image is determined to be a depth image if it is marked as a depth image and is not also +// explicitly marked with a color format, or if there are any sample/gather compare operations on it. +bool Compiler::is_depth_image(const SPIRType &type, uint32_t id) const +{ + return (type.image.depth && type.image.format == ImageFormatUnknown) || comparison_ids.count(id); +} + +bool Compiler::type_is_opaque_value(const SPIRType &type) const +{ + return !type.pointer && (type.basetype == SPIRType::SampledImage || type.basetype == SPIRType::Image || + type.basetype == SPIRType::Sampler || type.basetype == SPIRType::Tensor); +} + +// Make these member functions so we can easily break on any force_recompile events. +void Compiler::force_recompile() +{ + is_force_recompile = true; +} + +void Compiler::force_recompile_guarantee_forward_progress() +{ + force_recompile(); + is_force_recompile_forward_progress = true; +} + +bool Compiler::is_forcing_recompilation() const +{ + return is_force_recompile; +} + +void Compiler::clear_force_recompile() +{ + is_force_recompile = false; + is_force_recompile_forward_progress = false; +} + +Compiler::PhysicalStorageBufferPointerHandler::PhysicalStorageBufferPointerHandler(Compiler &compiler_) + : OpcodeHandler(compiler_) +{ +} + +Compiler::PhysicalBlockMeta *Compiler::PhysicalStorageBufferPointerHandler::find_block_meta(uint32_t id) const +{ + auto chain_itr = access_chain_to_physical_block.find(id); + if (chain_itr != access_chain_to_physical_block.end()) + return chain_itr->second; + else + return nullptr; +} + +void Compiler::PhysicalStorageBufferPointerHandler::mark_aligned_access(uint32_t id, const uint32_t *args, uint32_t length) +{ + uint32_t mask = *args; + args++; + length--; + if (length && (mask & MemoryAccessVolatileMask) != 0) + { + args++; + length--; + } + + if (length && (mask & MemoryAccessAlignedMask) != 0) + { + uint32_t alignment = *args; + auto *meta = find_block_meta(id); + + // This makes the assumption that the application does not rely on insane edge cases like: + // Bind buffer with ADDR = 8, use block offset of 8 bytes, load/store with 16 byte alignment. + // If we emit the buffer with alignment = 16 here, the first element at offset = 0 should + // actually have alignment of 8 bytes, but this is too theoretical and awkward to support. + // We could potentially keep track of any offset in the access chain, but it's + // practically impossible for high level compilers to emit code like that, + // so deducing overall alignment requirement based on maximum observed Alignment value is probably fine. + if (meta && alignment > meta->alignment) + meta->alignment = alignment; + } +} + +bool Compiler::PhysicalStorageBufferPointerHandler::type_is_bda_block_entry(uint32_t type_id) const +{ + auto &type = compiler.get(type_id); + return compiler.is_physical_pointer(type); +} + +uint32_t Compiler::PhysicalStorageBufferPointerHandler::get_minimum_scalar_alignment(const SPIRType &type) const +{ + if (type.storage == StorageClassPhysicalStorageBuffer) + return 8; + else if (type.basetype == SPIRType::Struct) + { + uint32_t alignment = 0; + for (auto &member_type : type.member_types) + { + uint32_t member_align = get_minimum_scalar_alignment(compiler.get(member_type)); + if (member_align > alignment) + alignment = member_align; + } + return alignment; + } + else + return type.width / 8; +} + +void Compiler::PhysicalStorageBufferPointerHandler::setup_meta_chain(uint32_t type_id, uint32_t var_id) +{ + if (type_is_bda_block_entry(type_id)) + { + auto &meta = physical_block_type_meta[type_id]; + access_chain_to_physical_block[var_id] = &meta; + + auto &type = compiler.get(type_id); + + if (!compiler.is_physical_pointer_to_buffer_block(type)) + non_block_types.insert(type_id); + + if (meta.alignment == 0) + meta.alignment = get_minimum_scalar_alignment(compiler.get_pointee_type(type)); + } +} + +bool Compiler::PhysicalStorageBufferPointerHandler::handle(Op op, const uint32_t *args, uint32_t length) +{ + // When a BDA pointer comes to life, we need to keep a mapping of SSA ID -> type ID for the pointer type. + // For every load and store, we'll need to be able to look up the type ID being accessed and mark any alignment + // requirements. + switch (op) + { + case OpConvertUToPtr: + case OpBitcast: + case OpCompositeExtract: + // Extract can begin a new chain if we had a struct or array of pointers as input. + // We don't begin chains before we have a pure scalar pointer. + setup_meta_chain(args[0], args[1]); + break; + + case OpAccessChain: + case OpInBoundsAccessChain: + case OpPtrAccessChain: + case OpCopyObject: + { + auto itr = access_chain_to_physical_block.find(args[2]); + if (itr != access_chain_to_physical_block.end()) + access_chain_to_physical_block[args[1]] = itr->second; + break; + } + + case OpLoad: + { + setup_meta_chain(args[0], args[1]); + if (length >= 4) + mark_aligned_access(args[2], args + 3, length - 3); + break; + } + + case OpStore: + { + if (length >= 3) + mark_aligned_access(args[0], args + 2, length - 2); + break; + } + + case OpCooperativeMatrixLoadKHR: + case OpCooperativeMatrixStoreKHR: + { + // TODO: Can we meaningfully deal with this? + break; + } + + default: + break; + } + + return true; +} + +uint32_t Compiler::PhysicalStorageBufferPointerHandler::get_base_non_block_type_id(uint32_t type_id) const +{ + auto *type = &compiler.get(type_id); + while (compiler.is_physical_pointer(*type) && !type_is_bda_block_entry(type_id)) + { + type_id = type->parent_type; + type = &compiler.get(type_id); + } + + assert(type_is_bda_block_entry(type_id)); + return type_id; +} + +void Compiler::PhysicalStorageBufferPointerHandler::analyze_non_block_types_from_block(const SPIRType &type) +{ + if (analyzed_type_ids.count(type.self)) + return; + analyzed_type_ids.insert(type.self); + + for (auto &member : type.member_types) + { + auto &subtype = compiler.get(member); + + if (compiler.is_physical_pointer(subtype) && !compiler.is_physical_pointer_to_buffer_block(subtype)) + non_block_types.insert(get_base_non_block_type_id(member)); + else if (subtype.basetype == SPIRType::Struct && !compiler.is_pointer(subtype)) + analyze_non_block_types_from_block(subtype); + } +} + +void Compiler::analyze_non_block_pointer_types() +{ + PhysicalStorageBufferPointerHandler handler(*this); + traverse_all_reachable_opcodes(get(ir.default_entry_point), handler); + + // Analyze any block declaration we have to make. It might contain + // physical pointers to POD types which we never used, and thus never added to the list. + // We'll need to add those pointer types to the set of types we declare. + ir.for_each_typed_id([&](uint32_t id, SPIRType &type) { + // Only analyze the raw block struct, not any pointer-to-struct, since that's just redundant. + if (type.self == id && + (has_decoration(type.self, DecorationBlock) || + has_decoration(type.self, DecorationBufferBlock))) + { + handler.analyze_non_block_types_from_block(type); + } + }); + + physical_storage_non_block_pointer_types.reserve(handler.non_block_types.size()); + for (auto type : handler.non_block_types) + physical_storage_non_block_pointer_types.push_back(type); + sort(begin(physical_storage_non_block_pointer_types), end(physical_storage_non_block_pointer_types)); + physical_storage_type_to_alignment = std::move(handler.physical_block_type_meta); +} + +bool Compiler::InterlockedResourceAccessPrepassHandler::handle(Op op, const uint32_t *, uint32_t) +{ + if (op == OpBeginInvocationInterlockEXT || op == OpEndInvocationInterlockEXT) + { + if (interlock_function_id != 0 && interlock_function_id != call_stack.back()) + { + // Most complex case, we have no sensible way of dealing with this + // other than taking the 100% conservative approach, exit early. + split_function_case = true; + return false; + } + else + { + interlock_function_id = call_stack.back(); + // If this call is performed inside control flow we have a problem. + auto &cfg = compiler.get_cfg_for_function(interlock_function_id); + + uint32_t from_block_id = compiler.get(interlock_function_id).entry_block; + bool outside_control_flow = cfg.node_terminates_control_flow_in_sub_graph(from_block_id, current_block_id); + if (!outside_control_flow) + control_flow_interlock = true; + } + } + return true; +} + +void Compiler::InterlockedResourceAccessPrepassHandler::rearm_current_block(const SPIRBlock &block) +{ + current_block_id = block.self; +} + +bool Compiler::InterlockedResourceAccessPrepassHandler::begin_function_scope(const uint32_t *args, uint32_t length) +{ + if (length < 3) + return false; + call_stack.push_back(args[2]); + return true; +} + +bool Compiler::InterlockedResourceAccessPrepassHandler::end_function_scope(const uint32_t *, uint32_t) +{ + call_stack.pop_back(); + return true; +} + +bool Compiler::InterlockedResourceAccessHandler::begin_function_scope(const uint32_t *args, uint32_t length) +{ + if (length < 3) + return false; + + if (args[2] == interlock_function_id) + call_stack_is_interlocked = true; + + call_stack.push_back(args[2]); + return true; +} + +bool Compiler::InterlockedResourceAccessHandler::end_function_scope(const uint32_t *, uint32_t) +{ + if (call_stack.back() == interlock_function_id) + call_stack_is_interlocked = false; + + call_stack.pop_back(); + return true; +} + +void Compiler::InterlockedResourceAccessHandler::access_potential_resource(uint32_t id) +{ + if ((use_critical_section && in_crit_sec) || (control_flow_interlock && call_stack_is_interlocked) || + split_function_case) + { + compiler.interlocked_resources.insert(id); + } +} + +bool Compiler::InterlockedResourceAccessHandler::handle(Op opcode, const uint32_t *args, uint32_t length) +{ + // Only care about critical section analysis if we have simple case. + if (use_critical_section) + { + if (opcode == OpBeginInvocationInterlockEXT) + { + in_crit_sec = true; + return true; + } + + if (opcode == OpEndInvocationInterlockEXT) + { + // End critical section--nothing more to do. + return false; + } + } + + // We need to figure out where images and buffers are loaded from, so do only the bare bones compilation we need. + switch (opcode) + { + case OpLoad: + case OpCooperativeMatrixLoadKHR: + case OpCooperativeVectorLoadNV: + { + if (length < 3) + return false; + + uint32_t ptr = args[2]; + auto *var = compiler.maybe_get_backing_variable(ptr); + + // We're only concerned with buffer and image memory here. + if (!var) + break; + + switch (var->storage) + { + default: + break; + + case StorageClassUniformConstant: + { + uint32_t result_type = args[0]; + uint32_t id = args[1]; + compiler.set(id, "", result_type, true); + compiler.register_read(id, ptr, true); + break; + } + + case StorageClassUniform: + // Must have BufferBlock; we only care about SSBOs. + if (!compiler.has_decoration(compiler.get(var->basetype).self, DecorationBufferBlock)) + break; + // fallthrough + case StorageClassStorageBuffer: + access_potential_resource(var->self); + break; + } + break; + } + + case OpInBoundsAccessChain: + case OpAccessChain: + case OpPtrAccessChain: + { + if (length < 3) + return false; + + uint32_t result_type = args[0]; + + auto &type = compiler.get(result_type); + if (type.storage == StorageClassUniform || type.storage == StorageClassUniformConstant || + type.storage == StorageClassStorageBuffer) + { + uint32_t id = args[1]; + uint32_t ptr = args[2]; + compiler.set(id, "", result_type, true); + compiler.register_read(id, ptr, true); + compiler.ir.ids[id].set_allow_type_rewrite(); + } + break; + } + + case OpImageTexelPointer: + { + if (length < 3) + return false; + + uint32_t result_type = args[0]; + uint32_t id = args[1]; + uint32_t ptr = args[2]; + auto &e = compiler.set(id, "", result_type, true); + auto *var = compiler.maybe_get_backing_variable(ptr); + if (var) + e.loaded_from = var->self; + break; + } + + case OpStore: + case OpImageWrite: + case OpAtomicStore: + case OpCooperativeMatrixStoreKHR: + case OpCooperativeVectorStoreNV: + { + if (length < 1) + return false; + + uint32_t ptr = args[0]; + auto *var = compiler.maybe_get_backing_variable(ptr); + if (var && (var->storage == StorageClassUniform || var->storage == StorageClassUniformConstant || + var->storage == StorageClassStorageBuffer)) + { + access_potential_resource(var->self); + } + + break; + } + + case OpCopyMemory: + { + if (length < 2) + return false; + + uint32_t dst = args[0]; + uint32_t src = args[1]; + auto *dst_var = compiler.maybe_get_backing_variable(dst); + auto *src_var = compiler.maybe_get_backing_variable(src); + + if (dst_var && (dst_var->storage == StorageClassUniform || dst_var->storage == StorageClassStorageBuffer)) + access_potential_resource(dst_var->self); + + if (src_var) + { + if (src_var->storage != StorageClassUniform && src_var->storage != StorageClassStorageBuffer) + break; + + if (src_var->storage == StorageClassUniform && + !compiler.has_decoration(compiler.get(src_var->basetype).self, DecorationBufferBlock)) + { + break; + } + + access_potential_resource(src_var->self); + } + + break; + } + + case OpImageRead: + case OpAtomicLoad: + { + if (length < 3) + return false; + + uint32_t ptr = args[2]; + auto *var = compiler.maybe_get_backing_variable(ptr); + + // We're only concerned with buffer and image memory here. + if (!var) + break; + + switch (var->storage) + { + default: + break; + + case StorageClassUniform: + // Must have BufferBlock; we only care about SSBOs. + if (!compiler.has_decoration(compiler.get(var->basetype).self, DecorationBufferBlock)) + break; + // fallthrough + case StorageClassUniformConstant: + case StorageClassStorageBuffer: + access_potential_resource(var->self); + break; + } + break; + } + + case OpAtomicExchange: + case OpAtomicCompareExchange: + case OpAtomicIIncrement: + case OpAtomicIDecrement: + case OpAtomicIAdd: + case OpAtomicISub: + case OpAtomicSMin: + case OpAtomicUMin: + case OpAtomicSMax: + case OpAtomicUMax: + case OpAtomicAnd: + case OpAtomicOr: + case OpAtomicXor: + { + if (length < 3) + return false; + + uint32_t ptr = args[2]; + auto *var = compiler.maybe_get_backing_variable(ptr); + if (var && (var->storage == StorageClassUniform || var->storage == StorageClassUniformConstant || + var->storage == StorageClassStorageBuffer)) + { + access_potential_resource(var->self); + } + + break; + } + + default: + break; + } + + return true; +} + +void Compiler::analyze_interlocked_resource_usage() +{ + if (get_execution_model() == ExecutionModelFragment && + (get_entry_point().flags.get(ExecutionModePixelInterlockOrderedEXT) || + get_entry_point().flags.get(ExecutionModePixelInterlockUnorderedEXT) || + get_entry_point().flags.get(ExecutionModeSampleInterlockOrderedEXT) || + get_entry_point().flags.get(ExecutionModeSampleInterlockUnorderedEXT))) + { + InterlockedResourceAccessPrepassHandler prepass_handler(*this, ir.default_entry_point); + traverse_all_reachable_opcodes(get(ir.default_entry_point), prepass_handler); + + InterlockedResourceAccessHandler handler(*this, ir.default_entry_point); + handler.interlock_function_id = prepass_handler.interlock_function_id; + handler.split_function_case = prepass_handler.split_function_case; + handler.control_flow_interlock = prepass_handler.control_flow_interlock; + handler.use_critical_section = !handler.split_function_case && !handler.control_flow_interlock; + + traverse_all_reachable_opcodes(get(ir.default_entry_point), handler); + + // For GLSL. If we hit any of these cases, we have to fall back to conservative approach. + interlocked_is_complex = + !handler.use_critical_section || handler.interlock_function_id != ir.default_entry_point; + } +} + +// Helper function +bool Compiler::check_internal_recursion(const SPIRType &type, std::unordered_set &checked_ids) +{ + if (type.basetype != SPIRType::Struct) + return false; + + if (checked_ids.count(type.self)) + return true; + + // Recurse into struct members + bool is_recursive = false; + checked_ids.insert(type.self); + uint32_t mbr_cnt = uint32_t(type.member_types.size()); + for (uint32_t mbr_idx = 0; !is_recursive && mbr_idx < mbr_cnt; mbr_idx++) + { + uint32_t mbr_type_id = type.member_types[mbr_idx]; + auto &mbr_type = get(mbr_type_id); + is_recursive |= check_internal_recursion(mbr_type, checked_ids); + } + checked_ids.erase(type.self); + return is_recursive; +} + +// Return whether the struct type contains a structural recursion nested somewhere within its content. +bool Compiler::type_contains_recursion(const SPIRType &type) +{ + std::unordered_set checked_ids; + return check_internal_recursion(type, checked_ids); +} + +bool Compiler::type_is_array_of_pointers(const SPIRType &type) const +{ + if (!is_array(type)) + return false; + + // BDA types must have parent type hierarchy. + if (!type.parent_type) + return false; + + // Punch through all array layers. + auto *parent = &get(type.parent_type); + while (is_array(*parent)) + parent = &get(parent->parent_type); + + return is_pointer(*parent); +} + +bool Compiler::flush_phi_required(BlockID from, BlockID to) const +{ + auto &child = get(to); + for (auto &phi : child.phi_variables) + if (phi.parent == from) + return true; + return false; +} + +void Compiler::add_loop_level() +{ + current_loop_level++; +} + +const SPIRType *Compiler::OpcodeHandler::get_expression_result_type(uint32_t id) const +{ + auto itr = result_types.find(id); + if (itr == result_types.end()) + return nullptr; + + return &compiler.get(itr->second); +} + diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross.hpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross.hpp new file mode 100644 index 0000000000..f72d79979e --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross.hpp @@ -0,0 +1,1222 @@ +/* + * Copyright 2015-2021 Arm Limited + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#ifndef SPIRV_CROSS_HPP +#define SPIRV_CROSS_HPP + +#ifndef SPV_ENABLE_UTILITY_CODE +#define SPV_ENABLE_UTILITY_CODE +#endif + +// Pragmatic hack to avoid symbol conflicts when including both hpp11 and hpp headers in same translation unit. +// This is an unfortunate SPIRV-Headers issue that we cannot easily deal with ourselves. +#ifdef SPIRV_CROSS_SPV_HEADER_NAMESPACE_OVERRIDE +#define spv SPIRV_CROSS_SPV_HEADER_NAMESPACE_OVERRIDE +#endif + +#include "spirv.hpp" +#include "spirv_cfg.hpp" +#include "spirv_cross_parsed_ir.hpp" + +namespace SPIRV_CROSS_NAMESPACE +{ +using namespace SPIRV_CROSS_SPV_HEADER_NAMESPACE; +struct Resource +{ + // Resources are identified with their SPIR-V ID. + // This is the ID of the OpVariable. + ID id; + + // The type ID of the variable which includes arrays and all type modifications. + // This type ID is not suitable for parsing OpMemberDecoration of a struct and other decorations in general + // since these modifications typically happen on the base_type_id. + TypeID type_id; + + // The base type of the declared resource. + // This type is the base type which ignores pointers and arrays of the type_id. + // This is mostly useful to parse decorations of the underlying type. + // base_type_id can also be obtained with get_type(get_type(type_id).self). + TypeID base_type_id; + + // The declared name (OpName) of the resource. + // For Buffer blocks, the name actually reflects the externally + // visible Block name. + // + // This name can be retrieved again by using either + // get_name(id) or get_name(base_type_id) depending if it's a buffer block or not. + // + // This name can be an empty string in which case get_fallback_name(id) can be + // used which obtains a suitable fallback identifier for an ID. + std::string name; +}; + +struct BuiltInResource +{ + // This is mostly here to support reflection of builtins such as Position/PointSize/CullDistance/ClipDistance. + // This needs to be different from Resource since we can collect builtins from blocks. + // A builtin present here does not necessarily mean it's considered an active builtin, + // since variable ID "activeness" is only tracked on OpVariable level, not Block members. + // For that, update_active_builtins() -> has_active_builtin() can be used to further refine the reflection. + BuiltIn builtin; + + // This is the actual value type of the builtin. + // Typically float4, float, array for the gl_PerVertex builtins. + // If the builtin is a control point, the control point array type will be stripped away here as appropriate. + TypeID value_type_id; + + // This refers to the base resource which contains the builtin. + // If resource is a Block, it can hold multiple builtins, or it might not be a block. + // For advanced reflection scenarios, all information in builtin/value_type_id can be deduced, + // it's just more convenient this way. + Resource resource; +}; + +struct ShaderResources +{ + SmallVector uniform_buffers; + SmallVector storage_buffers; + SmallVector stage_inputs; + SmallVector stage_outputs; + SmallVector subpass_inputs; + SmallVector storage_images; + SmallVector sampled_images; + SmallVector atomic_counters; + SmallVector acceleration_structures; + SmallVector gl_plain_uniforms; + SmallVector tensors; + + // There can only be one push constant block, + // but keep the vector in case this restriction is lifted in the future. + SmallVector push_constant_buffers; + + SmallVector shader_record_buffers; + + // For Vulkan GLSL and HLSL source, + // these correspond to separate texture2D and samplers respectively. + SmallVector separate_images; + SmallVector separate_samplers; + + SmallVector builtin_inputs; + SmallVector builtin_outputs; +}; + +struct CombinedImageSampler +{ + // The ID of the sampler2D variable. + VariableID combined_id; + // The ID of the texture2D variable. + VariableID image_id; + // The ID of the sampler variable. + VariableID sampler_id; +}; + +struct SpecializationConstant +{ + // The ID of the specialization constant. + ConstantID id; + // The constant ID of the constant, used in Vulkan during pipeline creation. + uint32_t constant_id; +}; + +struct BufferRange +{ + unsigned index; + size_t offset; + size_t range; +}; + +enum BufferPackingStandard +{ + BufferPackingStd140, + BufferPackingStd430, + BufferPackingStd140EnhancedLayout, + BufferPackingStd430EnhancedLayout, + BufferPackingHLSLCbuffer, + BufferPackingHLSLCbufferPackOffset, + BufferPackingScalar, + BufferPackingScalarEnhancedLayout +}; + +struct EntryPoint +{ + std::string name; + ExecutionModel execution_model; +}; + +class Compiler +{ +public: + friend class CFG; + friend class DominatorBuilder; + + // The constructor takes a buffer of SPIR-V words and parses it. + // It will create its own parser, parse the SPIR-V and move the parsed IR + // as if you had called the constructors taking ParsedIR directly. + explicit Compiler(std::vector ir); + Compiler(const uint32_t *ir, size_t word_count); + + // This is more modular. We can also consume a ParsedIR structure directly, either as a move, or copy. + // With copy, we can reuse the same parsed IR for multiple Compiler instances. + explicit Compiler(const ParsedIR &ir); + explicit Compiler(ParsedIR &&ir); + + virtual ~Compiler() = default; + + // After parsing, API users can modify the SPIR-V via reflection and call this + // to disassemble the SPIR-V into the desired langauage. + // Sub-classes actually implement this. + virtual std::string compile(); + + // Gets the identifier (OpName) of an ID. If not defined, an empty string will be returned. + const std::string &get_name(ID id) const; + + // Applies a decoration to an ID. Effectively injects OpDecorate. + void set_decoration(ID id, Decoration decoration, uint32_t argument = 0); + void set_decoration_string(ID id, Decoration decoration, const std::string &argument); + + // Overrides the identifier OpName of an ID. + // Identifiers beginning with underscores or identifiers which contain double underscores + // are reserved by the implementation. + void set_name(ID id, const std::string &name); + + // Gets a bitmask for the decorations which are applied to ID. + // I.e. (1ull << DecorationFoo) | (1ull << DecorationBar) + const Bitset &get_decoration_bitset(ID id) const; + + // Returns whether the decoration has been applied to the ID. + bool has_decoration(ID id, Decoration decoration) const; + + // Gets the value for decorations which take arguments. + // If the decoration is a boolean (i.e. DecorationNonWritable), + // 1 will be returned. + // If decoration doesn't exist or decoration is not recognized, + // 0 will be returned. + uint32_t get_decoration(ID id, Decoration decoration) const; + const std::string &get_decoration_string(ID id, Decoration decoration) const; + + // Removes the decoration for an ID. + void unset_decoration(ID id, Decoration decoration); + + // Gets the SPIR-V type associated with ID. + // Mostly used with Resource::type_id and Resource::base_type_id to parse the underlying type of a resource. + const SPIRType &get_type(TypeID id) const; + + // Gets the SPIR-V type of a variable. + const SPIRType &get_type_from_variable(VariableID id) const; + + // Gets the underlying storage class for an OpVariable. + StorageClass get_storage_class(VariableID id) const; + + // If get_name() is an empty string, get the fallback name which will be used + // instead in the disassembled source. + virtual const std::string get_fallback_name(ID id) const; + + // If get_name() of a Block struct is an empty string, get the fallback name. + // This needs to be per-variable as multiple variables can use the same block type. + virtual const std::string get_block_fallback_name(VariableID id) const; + + // Given an OpTypeStruct in ID, obtain the identifier for member number "index". + // This may be an empty string. + const std::string &get_member_name(TypeID id, uint32_t index) const; + + // Given an OpTypeStruct in ID, obtain the OpMemberDecoration for member number "index". + uint32_t get_member_decoration(TypeID id, uint32_t index, Decoration decoration) const; + const std::string &get_member_decoration_string(TypeID id, uint32_t index, Decoration decoration) const; + + // Sets the member identifier for OpTypeStruct ID, member number "index". + void set_member_name(TypeID id, uint32_t index, const std::string &name); + + // Returns the qualified member identifier for OpTypeStruct ID, member number "index", + // or an empty string if no qualified alias exists + const std::string &get_member_qualified_name(TypeID type_id, uint32_t index) const; + + // Gets the decoration mask for a member of a struct, similar to get_decoration_mask. + const Bitset &get_member_decoration_bitset(TypeID id, uint32_t index) const; + + // Returns whether the decoration has been applied to a member of a struct. + bool has_member_decoration(TypeID id, uint32_t index, Decoration decoration) const; + + // Similar to set_decoration, but for struct members. + void set_member_decoration(TypeID id, uint32_t index, Decoration decoration, uint32_t argument = 0); + void set_member_decoration_string(TypeID id, uint32_t index, Decoration decoration, + const std::string &argument); + + // Unsets a member decoration, similar to unset_decoration. + void unset_member_decoration(TypeID id, uint32_t index, Decoration decoration); + + // Gets the fallback name for a member, similar to get_fallback_name. + virtual const std::string get_fallback_member_name(uint32_t index) const + { + return join("_", index); + } + + // Returns a vector of which members of a struct are potentially in use by a + // SPIR-V shader. The granularity of this analysis is per-member of a struct. + // This can be used for Buffer (UBO), BufferBlock/StorageBuffer (SSBO) and PushConstant blocks. + // ID is the Resource::id obtained from get_shader_resources(). + SmallVector get_active_buffer_ranges(VariableID id) const; + + // Returns the effective size of a buffer block. + size_t get_declared_struct_size(const SPIRType &struct_type) const; + + // Returns the effective size of a buffer block, with a given array size + // for a runtime array. + // SSBOs are typically declared as runtime arrays. get_declared_struct_size() will return 0 for the size. + // This is not very helpful for applications which might need to know the array stride of its last member. + // This can be done through the API, but it is not very intuitive how to accomplish this, so here we provide a helper function + // to query the size of the buffer, assuming that the last member has a certain size. + // If the buffer does not contain a runtime array, array_size is ignored, and the function will behave as + // get_declared_struct_size(). + // To get the array stride of the last member, something like: + // get_declared_struct_size_runtime_array(type, 1) - get_declared_struct_size_runtime_array(type, 0) will work. + size_t get_declared_struct_size_runtime_array(const SPIRType &struct_type, size_t array_size) const; + + // Returns the effective size of a buffer block struct member. + size_t get_declared_struct_member_size(const SPIRType &struct_type, uint32_t index) const; + + // Returns a set of all global variables which are statically accessed + // by the control flow graph from the current entry point. + // Only variables which change the interface for a shader are returned, that is, + // variables with storage class of Input, Output, Uniform, UniformConstant, PushConstant and AtomicCounter + // storage classes are returned. + // + // To use the returned set as the filter for which variables are used during compilation, + // this set can be moved to set_enabled_interface_variables(). + std::unordered_set get_active_interface_variables() const; + + // Sets the interface variables which are used during compilation. + // By default, all variables are used. + // Once set, compile() will only consider the set in active_variables. + void set_enabled_interface_variables(std::unordered_set active_variables); + + // Query shader resources, use ids with reflection interface to modify or query binding points, etc. + ShaderResources get_shader_resources() const; + + // Query shader resources, but only return the variables which are part of active_variables. + // E.g.: get_shader_resources(get_active_variables()) to only return the variables which are statically + // accessed. + ShaderResources get_shader_resources(const std::unordered_set &active_variables) const; + + // Remapped variables are considered built-in variables and a backend will + // not emit a declaration for this variable. + // This is mostly useful for making use of builtins which are dependent on extensions. + void set_remapped_variable_state(VariableID id, bool remap_enable); + bool get_remapped_variable_state(VariableID id) const; + + // For subpassInput variables which are remapped to plain variables, + // the number of components in the remapped + // variable must be specified as the backing type of subpass inputs are opaque. + void set_subpass_input_remapped_components(VariableID id, uint32_t components); + uint32_t get_subpass_input_remapped_components(VariableID id) const; + + // All operations work on the current entry point. + // Entry points can be swapped out with set_entry_point(). + // Entry points should be set right after the constructor completes as some reflection functions traverse the graph from the entry point. + // Resource reflection also depends on the entry point. + // By default, the current entry point is set to the first OpEntryPoint which appears in the SPIR-V module. + + // Some shader languages restrict the names that can be given to entry points, and the + // corresponding backend will automatically rename an entry point name, during the call + // to compile() if it is illegal. For example, the common entry point name main() is + // illegal in MSL, and is renamed to an alternate name by the MSL backend. + // Given the original entry point name contained in the SPIR-V, this function returns + // the name, as updated by the backend during the call to compile(). If the name is not + // illegal, and has not been renamed, or if this function is called before compile(), + // this function will simply return the same name. + + // New variants of entry point query and reflection. + // Names for entry points in the SPIR-V module may alias if they belong to different execution models. + // To disambiguate, we must pass along with the entry point names the execution model. + SmallVector get_entry_points_and_stages() const; + void set_entry_point(const std::string &entry, ExecutionModel execution_model); + + // Renames an entry point from old_name to new_name. + // If old_name is currently selected as the current entry point, it will continue to be the current entry point, + // albeit with a new name. + // get_entry_points() is essentially invalidated at this point. + void rename_entry_point(const std::string &old_name, const std::string &new_name, + ExecutionModel execution_model); + const SPIREntryPoint &get_entry_point(const std::string &name, ExecutionModel execution_model) const; + SPIREntryPoint &get_entry_point(const std::string &name, ExecutionModel execution_model); + const std::string &get_cleansed_entry_point_name(const std::string &name, + ExecutionModel execution_model) const; + + // Traverses all reachable opcodes and sets active_builtins to a bitmask of all builtin variables which are accessed in the shader. + void update_active_builtins(); + bool has_active_builtin(BuiltIn builtin, StorageClass storage) const; + + // Query and modify OpExecutionMode. + const Bitset &get_execution_mode_bitset() const; + + void unset_execution_mode(ExecutionMode mode); + void set_execution_mode(ExecutionMode mode, uint32_t arg0 = 0, uint32_t arg1 = 0, uint32_t arg2 = 0); + + // Gets argument for an execution mode (LocalSize, Invocations, OutputVertices). + // For LocalSize or LocalSizeId, the index argument is used to select the dimension (X = 0, Y = 1, Z = 2). + // For execution modes which do not have arguments, 0 is returned. + // LocalSizeId query returns an ID. If LocalSizeId execution mode is not used, it returns 0. + // LocalSize always returns a literal. If execution mode is LocalSizeId, + // the literal (spec constant or not) is still returned. + uint32_t get_execution_mode_argument(ExecutionMode mode, uint32_t index = 0) const; + ExecutionModel get_execution_model() const; + + bool is_tessellation_shader() const; + bool is_tessellating_triangles() const; + + // In SPIR-V, the compute work group size can be represented by a constant vector, in which case + // the LocalSize execution mode is ignored. + // + // This constant vector can be a constant vector, specialization constant vector, or partly specialized constant vector. + // To modify and query work group dimensions which are specialization constants, SPIRConstant values must be modified + // directly via get_constant() rather than using LocalSize directly. This function will return which constants should be modified. + // + // To modify dimensions which are *not* specialization constants, set_execution_mode should be used directly. + // Arguments to set_execution_mode which are specialization constants are effectively ignored during compilation. + // NOTE: This is somewhat different from how SPIR-V works. In SPIR-V, the constant vector will completely replace LocalSize, + // while in this interface, LocalSize is only ignored for specialization constants. + // + // The specialization constant will be written to x, y and z arguments. + // If the component is not a specialization constant, a zeroed out struct will be written. + // The return value is the constant ID of the builtin WorkGroupSize, but this is not expected to be useful + // for most use cases. + // If LocalSizeId is used, there is no uvec3 value representing the workgroup size, so the return value is 0, + // but x, y and z are written as normal if the components are specialization constants. + uint32_t get_work_group_size_specialization_constants(SpecializationConstant &x, SpecializationConstant &y, + SpecializationConstant &z) const; + + // Analyzes all OpImageFetch (texelFetch) opcodes and checks if there are instances where + // said instruction is used without a combined image sampler. + // GLSL targets do not support the use of texelFetch without a sampler. + // To workaround this, we must inject a dummy sampler which can be used to form a sampler2D at the call-site of + // texelFetch as necessary. + // + // This must be called before build_combined_image_samplers(). + // build_combined_image_samplers() may refer to the ID returned by this method if the returned ID is non-zero. + // The return value will be the ID of a sampler object if a dummy sampler is necessary, or 0 if no sampler object + // is required. + // + // If the returned ID is non-zero, it can be decorated with set/bindings as desired before calling compile(). + // Calling this function also invalidates get_active_interface_variables(), so this should be called + // before that function. + VariableID build_dummy_sampler_for_combined_images(); + + // Analyzes all separate image and samplers used from the currently selected entry point, + // and re-routes them all to a combined image sampler instead. + // This is required to "support" separate image samplers in targets which do not natively support + // this feature, like GLSL/ESSL. + // + // This must be called before compile() if such remapping is desired. + // This call will add new sampled images to the SPIR-V, + // so it will appear in reflection if get_shader_resources() is called after build_combined_image_samplers. + // + // If any image/sampler remapping was found, no separate image/samplers will appear in the decompiled output, + // but will still appear in reflection. + // + // The resulting samplers will be void of any decorations like name, descriptor sets and binding points, + // so this can be added before compile() if desired. + // + // Combined image samplers originating from this set are always considered active variables. + // Arrays of separate samplers are not supported, but arrays of separate images are supported. + // Array of images + sampler -> Array of combined image samplers. + void build_combined_image_samplers(); + + // Gets a remapping for the combined image samplers. + const SmallVector &get_combined_image_samplers() const + { + return combined_image_samplers; + } + + // Set a new variable type remap callback. + // The type remapping is designed to allow global interface variable to assume more special types. + // A typical example here is to remap sampler2D into samplerExternalOES, which currently isn't supported + // directly by SPIR-V. + // + // In compile() while emitting code, + // for every variable that is declared, including function parameters, the callback will be called + // and the API user has a chance to change the textual representation of the type used to declare the variable. + // The API user can detect special patterns in names to guide the remapping. + void set_variable_type_remap_callback(VariableTypeRemapCallback cb) + { + variable_remap_callback = std::move(cb); + } + + // API for querying which specialization constants exist. + // To modify a specialization constant before compile(), use get_constant(constant.id), + // then update constants directly in the SPIRConstant data structure. + // For composite types, the subconstants can be iterated over and modified. + // constant_type is the SPIRType for the specialization constant, + // which can be queried to determine which fields in the unions should be poked at. + SmallVector get_specialization_constants() const; + SPIRConstant &get_constant(ConstantID id); + const SPIRConstant &get_constant(ConstantID id) const; + + uint32_t get_current_id_bound() const + { + return uint32_t(ir.ids.size()); + } + + // API for querying buffer objects. + // The type passed in here should be the base type of a resource, i.e. + // get_type(resource.base_type_id) + // as decorations are set in the basic Block type. + // The type passed in here must have these decorations set, or an exception is raised. + // Only UBOs and SSBOs or sub-structs which are part of these buffer types will have these decorations set. + uint32_t type_struct_member_offset(const SPIRType &type, uint32_t index) const; + uint32_t type_struct_member_array_stride(const SPIRType &type, uint32_t index) const; + uint32_t type_struct_member_matrix_stride(const SPIRType &type, uint32_t index) const; + + // Gets the offset in SPIR-V words (uint32_t) for a decoration which was originally declared in the SPIR-V binary. + // The offset will point to one or more uint32_t literals which can be modified in-place before using the SPIR-V binary. + // Note that adding or removing decorations using the reflection API will not change the behavior of this function. + // If the decoration was declared, sets the word_offset to an offset into the provided SPIR-V binary buffer and returns true, + // otherwise, returns false. + // If the decoration does not have any value attached to it (e.g. DecorationRelaxedPrecision), this function will also return false. + bool get_binary_offset_for_decoration(VariableID id, Decoration decoration, uint32_t &word_offset) const; + + // HLSL counter buffer reflection interface. + // Append/Consume/Increment/Decrement in HLSL is implemented as two "neighbor" buffer objects where + // one buffer implements the storage, and a single buffer containing just a lone "int" implements the counter. + // To SPIR-V these will be exposed as two separate buffers, but glslang HLSL frontend emits a special indentifier + // which lets us link the two buffers together. + + // Queries if a variable ID is a counter buffer which "belongs" to a regular buffer object. + + // If SPV_GOOGLE_hlsl_functionality1 is used, this can be used even with a stripped SPIR-V module. + // Otherwise, this query is purely based on OpName identifiers as found in the SPIR-V module, and will + // only return true if OpSource was reported HLSL. + // To rely on this functionality, ensure that the SPIR-V module is not stripped. + + bool buffer_is_hlsl_counter_buffer(VariableID id) const; + + // Queries if a buffer object has a neighbor "counter" buffer. + // If so, the ID of that counter buffer will be returned in counter_id. + // If SPV_GOOGLE_hlsl_functionality1 is used, this can be used even with a stripped SPIR-V module. + // Otherwise, this query is purely based on OpName identifiers as found in the SPIR-V module, and will + // only return true if OpSource was reported HLSL. + // To rely on this functionality, ensure that the SPIR-V module is not stripped. + bool buffer_get_hlsl_counter_buffer(VariableID id, uint32_t &counter_id) const; + + // Gets the list of all SPIR-V Capabilities which were declared in the SPIR-V module. + const SmallVector &get_declared_capabilities() const; + + // Gets the list of all SPIR-V extensions which were declared in the SPIR-V module. + const SmallVector &get_declared_extensions() const; + + // When declaring buffer blocks in GLSL, the name declared in the GLSL source + // might not be the same as the name declared in the SPIR-V module due to naming conflicts. + // In this case, SPIRV-Cross needs to find a fallback-name, and it might only + // be possible to know this name after compiling to GLSL. + // This is particularly important for HLSL input and UAVs which tends to reuse the same block type + // for multiple distinct blocks. For these cases it is not possible to modify the name of the type itself + // because it might be unique. Instead, you can use this interface to check after compilation which + // name was actually used if your input SPIR-V tends to have this problem. + // For other names like remapped names for variables, etc, it's generally enough to query the name of the variables + // after compiling, block names are an exception to this rule. + // ID is the name of a variable as returned by Resource::id, and must be a variable with a Block-like type. + // + // This also applies to HLSL cbuffers. + std::string get_remapped_declared_block_name(VariableID id) const; + + // For buffer block variables, get the decorations for that variable. + // Sometimes, decorations for buffer blocks are found in member decorations instead + // of direct decorations on the variable itself. + // The most common use here is to check if a buffer is readonly or writeonly. + Bitset get_buffer_block_flags(VariableID id) const; + + // Returns whether the position output is invariant + bool is_position_invariant() const + { + return position_invariant; + } + + const ParsedIR &get_ir() const { return ir; } + uint32_t evaluate_constant_u32(uint32_t id) const; + +protected: + const uint32_t *stream(const Instruction &instr) const + { + // If we're not going to use any arguments, just return nullptr. + // We want to avoid case where we return an out of range pointer + // that trips debug assertions on some platforms. + if (!instr.length) + return nullptr; + + if (instr.is_embedded()) + { + auto &embedded = static_cast(instr); + assert(embedded.ops.size() == instr.length); + return embedded.ops.data(); + } + else + { + if (instr.offset + instr.length > ir.spirv.size()) + SPIRV_CROSS_THROW("Compiler::stream() out of range."); + return &ir.spirv[instr.offset]; + } + } + + uint32_t *stream_mutable(const Instruction &instr) const + { + return const_cast(stream(instr)); + } + + ParsedIR ir; + // Marks variables which have global scope and variables which can alias with other variables + // (SSBO, image load store, etc) + SmallVector global_variables; + SmallVector aliased_variables; + + SPIRFunction *current_function = nullptr; + SPIRBlock *current_block = nullptr; + uint32_t current_loop_level = 0; + std::unordered_set active_interface_variables; + bool check_active_interface_variables = false; + + void add_loop_level(); + + void set_initializers(SPIRExpression &e) + { + e.emitted_loop_level = current_loop_level; + } + + template + void set_initializers(const T &) + { + } + + // If our IDs are out of range here as part of opcodes, throw instead of + // undefined behavior. + template + T &set(uint32_t id, P &&... args) + { + ir.add_typed_id(static_cast(T::type), id); + auto &var = variant_set(ir.ids[id], std::forward

(args)...); + var.self = id; + set_initializers(var); + return var; + } + + template + T &get(uint32_t id) + { + return variant_get(ir.ids[id]); + } + + template + T *maybe_get(uint32_t id) + { + if (id >= ir.ids.size()) + return nullptr; + else if (ir.ids[id].get_type() == static_cast(T::type)) + return &get(id); + else + return nullptr; + } + + template + const T &get(uint32_t id) const + { + return variant_get(ir.ids[id]); + } + + template + const T *maybe_get(uint32_t id) const + { + if (id >= ir.ids.size()) + return nullptr; + else if (ir.ids[id].get_type() == static_cast(T::type)) + return &get(id); + else + return nullptr; + } + + // Gets the id of SPIR-V type underlying the given type_id, which might be a pointer. + uint32_t get_pointee_type_id(uint32_t type_id) const; + + // Gets the SPIR-V type underlying the given type, which might be a pointer. + const SPIRType &get_pointee_type(const SPIRType &type) const; + + // Gets the SPIR-V type underlying the given type_id, which might be a pointer. + const SPIRType &get_pointee_type(uint32_t type_id) const; + + // Gets the ID of the SPIR-V type underlying a variable. + uint32_t get_variable_data_type_id(const SPIRVariable &var) const; + + // Gets the SPIR-V type underlying a variable. + SPIRType &get_variable_data_type(const SPIRVariable &var); + + // Gets the SPIR-V type underlying a variable. + const SPIRType &get_variable_data_type(const SPIRVariable &var) const; + + // Gets the SPIR-V element type underlying an array variable. + SPIRType &get_variable_element_type(const SPIRVariable &var); + + // Gets the SPIR-V element type underlying an array variable. + const SPIRType &get_variable_element_type(const SPIRVariable &var) const; + + // Sets the qualified member identifier for OpTypeStruct ID, member number "index". + void set_member_qualified_name(uint32_t type_id, uint32_t index, const std::string &name); + void set_qualified_name(uint32_t id, const std::string &name); + + // Returns if the given type refers to a sampled image. + bool is_sampled_image_type(const SPIRType &type); + + const SPIREntryPoint &get_entry_point() const; + SPIREntryPoint &get_entry_point(); + static bool is_tessellation_shader(ExecutionModel model); + + virtual std::string to_name(uint32_t id, bool allow_alias = true) const; + bool is_builtin_variable(const SPIRVariable &var) const; + bool is_builtin_type(const SPIRType &type) const; + bool is_hidden_variable(const SPIRVariable &var, bool include_builtins = false) const; + bool is_immutable(uint32_t id) const; + bool is_member_builtin(const SPIRType &type, uint32_t index, BuiltIn *builtin) const; + bool is_scalar(const SPIRType &type) const; + bool is_vector(const SPIRType &type) const; + bool is_matrix(const SPIRType &type) const; + bool is_array(const SPIRType &type) const; + bool is_pointer(const SPIRType &type) const; + bool is_physical_pointer(const SPIRType &type) const; + bool is_physical_or_buffer_pointer(const SPIRType &type) const; + bool is_physical_pointer_to_buffer_block(const SPIRType &type) const; + static bool is_runtime_size_array(const SPIRType &type); + uint32_t expression_type_id(uint32_t id) const; + const SPIRType &expression_type(uint32_t id) const; + bool expression_is_lvalue(uint32_t id) const; + bool variable_storage_is_aliased(const SPIRVariable &var); + SPIRVariable *maybe_get_backing_variable(uint32_t chain); + + void register_read(uint32_t expr, uint32_t chain, bool forwarded); + void register_write(uint32_t chain); + + inline bool is_continue(uint32_t next) const + { + return (ir.block_meta[next] & ParsedIR::BLOCK_META_CONTINUE_BIT) != 0; + } + + inline bool is_single_block_loop(uint32_t next) const + { + auto &block = get(next); + return block.merge == SPIRBlock::MergeLoop && block.continue_block == ID(next); + } + + inline bool is_break(uint32_t next) const + { + return (ir.block_meta[next] & + (ParsedIR::BLOCK_META_LOOP_MERGE_BIT | ParsedIR::BLOCK_META_MULTISELECT_MERGE_BIT)) != 0; + } + + inline bool is_loop_break(uint32_t next) const + { + return (ir.block_meta[next] & ParsedIR::BLOCK_META_LOOP_MERGE_BIT) != 0; + } + + inline bool is_conditional(uint32_t next) const + { + return (ir.block_meta[next] & + (ParsedIR::BLOCK_META_SELECTION_MERGE_BIT | ParsedIR::BLOCK_META_MULTISELECT_MERGE_BIT)) != 0; + } + + // Dependency tracking for temporaries read from variables. + void flush_dependees(SPIRVariable &var); + void flush_all_active_variables(); + void flush_control_dependent_expressions(uint32_t block); + void flush_all_atomic_capable_variables(); + void flush_all_aliased_variables(); + void register_global_read_dependencies(const SPIRBlock &func, uint32_t id); + void register_global_read_dependencies(const SPIRFunction &func, uint32_t id); + std::unordered_set invalid_expressions; + + void update_name_cache(std::unordered_set &cache, std::string &name); + + // A variant which takes two sets of names. The secondary is only used to verify there are no collisions, + // but the set is not updated when we have found a new name. + // Used primarily when adding block interface names. + void update_name_cache(std::unordered_set &cache_primary, + const std::unordered_set &cache_secondary, std::string &name); + + bool function_is_pure(const SPIRFunction &func); + bool block_is_pure(const SPIRBlock &block); + bool function_is_control_dependent(const SPIRFunction &func); + bool block_is_control_dependent(const SPIRBlock &block); + + bool execution_is_branchless(const SPIRBlock &from, const SPIRBlock &to) const; + bool execution_is_direct_branch(const SPIRBlock &from, const SPIRBlock &to) const; + bool execution_is_noop(const SPIRBlock &from, const SPIRBlock &to) const; + SPIRBlock::ContinueBlockType continue_block_type(const SPIRBlock &continue_block) const; + + void force_recompile(); + void force_recompile_guarantee_forward_progress(); + void clear_force_recompile(); + bool is_forcing_recompilation() const; + bool is_force_recompile = false; + bool is_force_recompile_forward_progress = false; + + bool block_is_noop(const SPIRBlock &block) const; + bool block_is_loop_candidate(const SPIRBlock &block, SPIRBlock::Method method) const; + + bool types_are_logically_equivalent(const SPIRType &a, const SPIRType &b) const; + void inherit_expression_dependencies(uint32_t dst, uint32_t source); + void add_implied_read_expression(SPIRExpression &e, uint32_t source); + void add_implied_read_expression(SPIRAccessChain &e, uint32_t source); + void add_active_interface_variable(uint32_t var_id); + + // For proper multiple entry point support, allow querying if an Input or Output + // variable is part of that entry points interface. + bool interface_variable_exists_in_entry_point(uint32_t id) const; + + SmallVector combined_image_samplers; + + void remap_variable_type_name(const SPIRType &type, const std::string &var_name, std::string &type_name) const + { + if (variable_remap_callback) + variable_remap_callback(type, var_name, type_name); + } + + void set_ir(const ParsedIR &parsed); + void set_ir(ParsedIR &&parsed); + void parse_fixup(); + + // Used internally to implement various traversals for queries. + struct OpcodeHandler + { + explicit OpcodeHandler(Compiler &compiler_) : compiler(compiler_) {} + virtual ~OpcodeHandler() = default; + + // Return true if traversal should continue. + // If false, traversal will end immediately. + virtual bool handle(Op opcode, const uint32_t *args, uint32_t length) = 0; + virtual bool handle_terminator(const SPIRBlock &) + { + return true; + } + + virtual bool follow_function_call(const SPIRFunction &) + { + return true; + } + + virtual void set_current_block(const SPIRBlock &) + { + } + + // Called after returning from a function or when entering a block, + // can be called multiple times per block, + // while set_current_block is only called on block entry. + virtual void rearm_current_block(const SPIRBlock &) + { + } + + virtual bool begin_function_scope(const uint32_t *, uint32_t) + { + return true; + } + + virtual bool end_function_scope(const uint32_t *, uint32_t) + { + return true; + } + + Compiler &compiler; + std::unordered_map result_types; + const SPIRType *get_expression_result_type(uint32_t id) const; + bool enable_result_types = false; + + template T &get(uint32_t id) + { + return compiler.get(id); + } + + template const T &get(uint32_t id) const + { + return compiler.get(id); + } + + template + T &set(uint32_t id, P &&... args) + { + return compiler.set(id, std::forward

(args)...); + } + }; + + struct BufferAccessHandler : OpcodeHandler + { + BufferAccessHandler(const Compiler &compiler_, SmallVector &ranges_, uint32_t id_) + : OpcodeHandler(const_cast(compiler_)) + , ranges(ranges_) + , id(id_) + { + } + + bool handle(Op opcode, const uint32_t *args, uint32_t length) override; + + SmallVector &ranges; + uint32_t id; + + std::unordered_set seen; + }; + + struct InterfaceVariableAccessHandler : OpcodeHandler + { + InterfaceVariableAccessHandler(const Compiler &compiler_, std::unordered_set &variables_) + : OpcodeHandler(const_cast(compiler_)) + , variables(variables_) + { + } + + bool handle(Op opcode, const uint32_t *args, uint32_t length) override; + + std::unordered_set &variables; + }; + + struct CombinedImageSamplerHandler : OpcodeHandler + { + explicit CombinedImageSamplerHandler(Compiler &compiler_) + : OpcodeHandler(compiler_) + { + } + bool handle(Op opcode, const uint32_t *args, uint32_t length) override; + bool begin_function_scope(const uint32_t *args, uint32_t length) override; + bool end_function_scope(const uint32_t *args, uint32_t length) override; + + // Each function in the call stack needs its own remapping for parameters so we can deduce which global variable each texture/sampler the parameter is statically bound to. + std::stack> parameter_remapping; + std::stack functions; + + uint32_t remap_parameter(uint32_t id); + void push_remap_parameters(const SPIRFunction &func, const uint32_t *args, uint32_t length); + void pop_remap_parameters(); + void register_combined_image_sampler(SPIRFunction &caller, VariableID combined_id, VariableID texture_id, + VariableID sampler_id, bool depth); + }; + + struct DummySamplerForCombinedImageHandler : OpcodeHandler + { + explicit DummySamplerForCombinedImageHandler(Compiler &compiler_) + : OpcodeHandler(compiler_) + { + } + bool handle(Op opcode, const uint32_t *args, uint32_t length) override; + bool need_dummy_sampler = false; + }; + + struct ActiveBuiltinHandler : OpcodeHandler + { + explicit ActiveBuiltinHandler(Compiler &compiler_) + : OpcodeHandler(compiler_) + { + } + + bool handle(Op opcode, const uint32_t *args, uint32_t length) override; + + void handle_builtin(const SPIRType &type, BuiltIn builtin, const Bitset &decoration_flags); + void add_if_builtin(uint32_t id); + void add_if_builtin_or_block(uint32_t id); + void add_if_builtin(uint32_t id, bool allow_blocks); + }; + + bool traverse_all_reachable_opcodes(const SPIRBlock &block, OpcodeHandler &handler) const; + bool traverse_all_reachable_opcodes(const SPIRFunction &block, OpcodeHandler &handler) const; + // This must be an ordered data structure so we always pick the same type aliases. + SmallVector global_struct_cache; + + ShaderResources get_shader_resources(const std::unordered_set *active_variables) const; + + VariableTypeRemapCallback variable_remap_callback; + + bool get_common_basic_type(const SPIRType &type, SPIRType::BaseType &base_type); + + std::unordered_set forced_temporaries; + std::unordered_set forwarded_temporaries; + std::unordered_set suppressed_usage_tracking; + std::unordered_set hoisted_temporaries; + std::unordered_set forced_invariant_temporaries; + + Bitset active_input_builtins; + Bitset active_output_builtins; + uint32_t clip_distance_count = 0; + uint32_t cull_distance_count = 0; + bool position_invariant = false; + + void analyze_parameter_preservation( + SPIRFunction &entry, const CFG &cfg, + const std::unordered_map> &variable_to_blocks, + const std::unordered_map> &complete_write_blocks); + + // If a variable ID or parameter ID is found in this set, a sampler is actually a shadow/comparison sampler. + // SPIR-V does not support this distinction, so we must keep track of this information outside the type system. + // There might be unrelated IDs found in this set which do not correspond to actual variables. + // This set should only be queried for the existence of samplers which are already known to be variables or parameter IDs. + // Similar is implemented for images, as well as if subpass inputs are needed. + std::unordered_set comparison_ids; + bool need_subpass_input = false; + bool need_subpass_input_ms = false; + + // In certain backends, we will need to use a dummy sampler to be able to emit code. + // GLSL does not support texelFetch on texture2D objects, but SPIR-V does, + // so we need to workaround by having the application inject a dummy sampler. + uint32_t dummy_sampler_id = 0; + + void analyze_image_and_sampler_usage(); + + struct CombinedImageSamplerDrefHandler : OpcodeHandler + { + explicit CombinedImageSamplerDrefHandler(Compiler &compiler_) + : OpcodeHandler(compiler_) + { + } + bool handle(Op opcode, const uint32_t *args, uint32_t length) override; + + std::unordered_set dref_combined_samplers; + }; + + struct CombinedImageSamplerUsageHandler : OpcodeHandler + { + CombinedImageSamplerUsageHandler(Compiler &compiler_, + const std::unordered_set &dref_combined_samplers_) + : OpcodeHandler(compiler_) + , dref_combined_samplers(dref_combined_samplers_) + { + } + + bool begin_function_scope(const uint32_t *args, uint32_t length) override; + bool handle(Op opcode, const uint32_t *args, uint32_t length) override; + const std::unordered_set &dref_combined_samplers; + + std::unordered_map> dependency_hierarchy; + std::unordered_set comparison_ids; + + void add_hierarchy_to_comparison_ids(uint32_t ids); + bool need_subpass_input = false; + bool need_subpass_input_ms = false; + void add_dependency(uint32_t dst, uint32_t src); + }; + + void build_function_control_flow_graphs_and_analyze(); + std::unordered_map> function_cfgs; + const CFG &get_cfg_for_current_function() const; + const CFG &get_cfg_for_function(uint32_t id) const; + + struct CFGBuilder : OpcodeHandler + { + explicit CFGBuilder(Compiler &compiler_); + + bool follow_function_call(const SPIRFunction &func) override; + bool handle(Op op, const uint32_t *args, uint32_t length) override; + std::unordered_map> function_cfgs; + }; + + struct AnalyzeVariableScopeAccessHandler : OpcodeHandler + { + AnalyzeVariableScopeAccessHandler(Compiler &compiler_, SPIRFunction &entry_); + + bool follow_function_call(const SPIRFunction &) override; + void set_current_block(const SPIRBlock &block) override; + + void notify_variable_access(uint32_t id, uint32_t block); + bool id_is_phi_variable(uint32_t id) const; + bool id_is_potential_temporary(uint32_t id) const; + bool handle(Op op, const uint32_t *args, uint32_t length) override; + bool handle_terminator(const SPIRBlock &block) override; + + SPIRFunction &entry; + std::unordered_map> accessed_variables_to_block; + std::unordered_map> accessed_temporaries_to_block; + std::unordered_map result_id_to_type; + std::unordered_map> complete_write_variables_to_block; + std::unordered_map> partial_write_variables_to_block; + std::unordered_set access_chain_expressions; + // Access chains used in multiple blocks mean hoisting all the variables used to construct the access chain as not all backends can use pointers. + // This is also relevant when forwarding opaque objects since we cannot lower these to temporaries. + std::unordered_map> rvalue_forward_children; + const SPIRBlock *current_block = nullptr; + }; + + struct StaticExpressionAccessHandler : OpcodeHandler + { + StaticExpressionAccessHandler(Compiler &compiler_, uint32_t variable_id_); + bool follow_function_call(const SPIRFunction &) override; + bool handle(Op op, const uint32_t *args, uint32_t length) override; + + uint32_t variable_id; + uint32_t static_expression = 0; + uint32_t write_count = 0; + }; + + struct PhysicalBlockMeta + { + uint32_t alignment = 0; + }; + + struct PhysicalStorageBufferPointerHandler : OpcodeHandler + { + explicit PhysicalStorageBufferPointerHandler(Compiler &compiler_); + bool handle(Op op, const uint32_t *args, uint32_t length) override; + + std::unordered_set non_block_types; + std::unordered_map physical_block_type_meta; + std::unordered_map access_chain_to_physical_block; + std::unordered_set analyzed_type_ids; + + void mark_aligned_access(uint32_t id, const uint32_t *args, uint32_t length); + PhysicalBlockMeta *find_block_meta(uint32_t id) const; + bool type_is_bda_block_entry(uint32_t type_id) const; + void setup_meta_chain(uint32_t type_id, uint32_t var_id); + uint32_t get_minimum_scalar_alignment(const SPIRType &type) const; + void analyze_non_block_types_from_block(const SPIRType &type); + uint32_t get_base_non_block_type_id(uint32_t type_id) const; + }; + void analyze_non_block_pointer_types(); + SmallVector physical_storage_non_block_pointer_types; + std::unordered_map physical_storage_type_to_alignment; + + void analyze_variable_scope(SPIRFunction &function, AnalyzeVariableScopeAccessHandler &handler); + void find_function_local_luts(SPIRFunction &function, const AnalyzeVariableScopeAccessHandler &handler, + bool single_function); + bool may_read_undefined_variable_in_block(const SPIRBlock &block, uint32_t var); + + struct GeometryEmitDisocveryHandler : OpcodeHandler + { + explicit GeometryEmitDisocveryHandler(Compiler &compiler_) + : OpcodeHandler(compiler_) + { + } + + bool handle(Op opcode, const uint32_t *args, uint32_t length) override; + bool begin_function_scope(const uint32_t *, uint32_t) override; + bool end_function_scope(const uint32_t *, uint32_t) override; + SmallVector function_stack; + }; + + void discover_geometry_emitters(); + + // Finds all resources that are written to from inside the critical section, if present. + // The critical section is delimited by OpBeginInvocationInterlockEXT and + // OpEndInvocationInterlockEXT instructions. In MSL and HLSL, any resources written + // while inside the critical section must be placed in a raster order group. + struct InterlockedResourceAccessHandler : OpcodeHandler + { + InterlockedResourceAccessHandler(Compiler &compiler_, uint32_t entry_point_id) + : OpcodeHandler(compiler_) + { + call_stack.push_back(entry_point_id); + } + + bool handle(Op op, const uint32_t *args, uint32_t length) override; + bool begin_function_scope(const uint32_t *args, uint32_t length) override; + bool end_function_scope(const uint32_t *args, uint32_t length) override; + + bool in_crit_sec = false; + + uint32_t interlock_function_id = 0; + bool split_function_case = false; + bool control_flow_interlock = false; + bool use_critical_section = false; + bool call_stack_is_interlocked = false; + SmallVector call_stack; + + void access_potential_resource(uint32_t id); + }; + + struct InterlockedResourceAccessPrepassHandler : OpcodeHandler + { + InterlockedResourceAccessPrepassHandler(Compiler &compiler_, uint32_t entry_point_id) + : OpcodeHandler(compiler_) + { + call_stack.push_back(entry_point_id); + } + + void rearm_current_block(const SPIRBlock &block) override; + bool handle(Op op, const uint32_t *args, uint32_t length) override; + bool begin_function_scope(const uint32_t *args, uint32_t length) override; + bool end_function_scope(const uint32_t *args, uint32_t length) override; + + uint32_t interlock_function_id = 0; + uint32_t current_block_id = 0; + bool split_function_case = false; + bool control_flow_interlock = false; + SmallVector call_stack; + }; + + void analyze_interlocked_resource_usage(); + // The set of all resources written while inside the critical section, if present. + std::unordered_set interlocked_resources; + bool interlocked_is_complex = false; + + void make_constant_null(uint32_t id, uint32_t type); + + std::unordered_map declared_block_names; + + static bool instruction_to_result_type( + uint32_t &result_type, uint32_t &result_id, Op op, const uint32_t *args, uint32_t length); + + Bitset combined_decoration_for_member(const SPIRType &type, uint32_t index) const; + static bool is_desktop_only_format(ImageFormat format); + + bool is_depth_image(const SPIRType &type, uint32_t id) const; + + void set_extended_decoration(uint32_t id, ExtendedDecorations decoration, uint32_t value = 0); + uint32_t get_extended_decoration(uint32_t id, ExtendedDecorations decoration) const; + bool has_extended_decoration(uint32_t id, ExtendedDecorations decoration) const; + void unset_extended_decoration(uint32_t id, ExtendedDecorations decoration); + + void set_extended_member_decoration(uint32_t type, uint32_t index, ExtendedDecorations decoration, + uint32_t value = 0); + uint32_t get_extended_member_decoration(uint32_t type, uint32_t index, ExtendedDecorations decoration) const; + bool has_extended_member_decoration(uint32_t type, uint32_t index, ExtendedDecorations decoration) const; + void unset_extended_member_decoration(uint32_t type, uint32_t index, ExtendedDecorations decoration); + + bool check_internal_recursion(const SPIRType &type, std::unordered_set &checked_ids); + bool type_contains_recursion(const SPIRType &type); + bool type_is_array_of_pointers(const SPIRType &type) const; + bool type_is_block_like(const SPIRType &type) const; + bool type_is_explicit_layout(const SPIRType &type) const; + bool type_is_top_level_block(const SPIRType &type) const; + bool type_is_opaque_value(const SPIRType &type) const; + + bool reflection_ssbo_instance_name_is_significant() const; + std::string get_remapped_declared_block_name(uint32_t id, bool fallback_prefer_instance_name) const; + + bool flush_phi_required(BlockID from, BlockID to) const; + + uint32_t evaluate_spec_constant_u32(const SPIRConstantOp &spec) const; + + bool is_vertex_like_shader() const; + + // Get the correct case list for the OpSwitch, since it can be either a + // 32 bit wide condition or a 64 bit, but the type is not embedded in the + // instruction itself. + const SmallVector &get_case_list(const SPIRBlock &block) const; + +private: + // Used only to implement the old deprecated get_entry_point() interface. + const SPIREntryPoint &get_first_entry_point(const std::string &name) const; + SPIREntryPoint &get_first_entry_point(const std::string &name); +}; +} // namespace SPIRV_CROSS_NAMESPACE + +#ifdef SPIRV_CROSS_SPV_HEADER_NAMESPACE_OVERRIDE +#undef spv +#endif + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_c.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_c.cpp new file mode 100644 index 0000000000..1604385e50 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_c.cpp @@ -0,0 +1,2984 @@ +/* + * Copyright 2019-2021 Hans-Kristian Arntzen + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#include "spirv_cross_c.h" + +#if SPIRV_CROSS_C_API_CPP +#include "spirv_cpp.hpp" +#endif +#if SPIRV_CROSS_C_API_GLSL +#include "spirv_glsl.hpp" +#else +#include "spirv_cross.hpp" +#endif +#if SPIRV_CROSS_C_API_HLSL +#include "spirv_hlsl.hpp" +#endif +#if SPIRV_CROSS_C_API_MSL +#include "spirv_msl.hpp" +#endif +#if SPIRV_CROSS_C_API_REFLECT +#include "spirv_reflect.hpp" +#endif + +#ifdef HAVE_SPIRV_CROSS_GIT_VERSION +#include "gitversion.h" +#endif + +#include "spirv_parser.hpp" +#include +#include +#include + +// clang-format off + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) +#pragma warning(disable : 4065) // switch with 'default' but not 'case'. +#endif + +#ifndef SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS +#define SPVC_BEGIN_SAFE_SCOPE try +#else +#define SPVC_BEGIN_SAFE_SCOPE +#endif + +#ifndef SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS +#define SPVC_END_SAFE_SCOPE(context, error) \ + catch (const std::exception &e) \ + { \ + (context)->report_error(e.what()); \ + return (error); \ + } +#else +#define SPVC_END_SAFE_SCOPE(context, error) +#endif + +using namespace SPIRV_CROSS_SPV_HEADER_NAMESPACE; +using namespace std; +using namespace SPIRV_CROSS_NAMESPACE; + +struct ScratchMemoryAllocation +{ + virtual ~ScratchMemoryAllocation() = default; +}; + +struct StringAllocation : ScratchMemoryAllocation +{ + explicit StringAllocation(const char *name) + : str(name) + { + } + + explicit StringAllocation(std::string name) + : str(std::move(name)) + { + } + + std::string str; +}; + +template +struct TemporaryBuffer : ScratchMemoryAllocation +{ + SmallVector buffer; +}; + +template +static inline std::unique_ptr spvc_allocate(Ts &&... ts) +{ + return std::unique_ptr(new T(std::forward(ts)...)); +} + +struct spvc_context_s +{ + string last_error; + SmallVector> allocations; + const char *allocate_name(const std::string &name); + + spvc_error_callback callback = nullptr; + void *callback_userdata = nullptr; + void report_error(std::string msg); +}; + +void spvc_context_s::report_error(std::string msg) +{ + last_error = std::move(msg); + if (callback) + callback(callback_userdata, last_error.c_str()); +} + +const char *spvc_context_s::allocate_name(const std::string &name) +{ + SPVC_BEGIN_SAFE_SCOPE + { + auto alloc = spvc_allocate(name); + auto *ret = alloc->str.c_str(); + allocations.emplace_back(std::move(alloc)); + return ret; + } + SPVC_END_SAFE_SCOPE(this, nullptr) +} + +struct spvc_parsed_ir_s : ScratchMemoryAllocation +{ + spvc_context context = nullptr; + ParsedIR parsed; +}; + +struct spvc_compiler_s : ScratchMemoryAllocation +{ + spvc_context context = nullptr; + unique_ptr compiler; + spvc_backend backend = SPVC_BACKEND_NONE; +}; + +struct spvc_compiler_options_s : ScratchMemoryAllocation +{ + spvc_context context = nullptr; + uint32_t backend_flags = 0; +#if SPIRV_CROSS_C_API_GLSL + CompilerGLSL::Options glsl; +#endif +#if SPIRV_CROSS_C_API_MSL + CompilerMSL::Options msl; +#endif +#if SPIRV_CROSS_C_API_HLSL + CompilerHLSL::Options hlsl; +#endif +}; + +struct spvc_set_s : ScratchMemoryAllocation +{ + std::unordered_set set; +}; + +// Dummy-inherit to we can keep our opaque type handle type safe in C-land as well, +// and avoid just throwing void * around. +struct spvc_type_s : SPIRType +{ +}; + +struct spvc_constant_s : SPIRConstant +{ +}; + +struct spvc_resources_s : ScratchMemoryAllocation +{ + spvc_context context = nullptr; + SmallVector uniform_buffers; + SmallVector storage_buffers; + SmallVector stage_inputs; + SmallVector stage_outputs; + SmallVector subpass_inputs; + SmallVector storage_images; + SmallVector sampled_images; + SmallVector atomic_counters; + SmallVector push_constant_buffers; + SmallVector shader_record_buffers; + SmallVector separate_images; + SmallVector separate_samplers; + SmallVector acceleration_structures; + SmallVector gl_plain_uniforms; + SmallVector tensors; + + SmallVector builtin_inputs; + SmallVector builtin_outputs; + + bool copy_resources(SmallVector &outputs, const SmallVector &inputs); + bool copy_resources(SmallVector &outputs, const SmallVector &inputs); + bool copy_resources(const ShaderResources &resources); +}; + +spvc_result spvc_context_create(spvc_context *context) +{ + auto *ctx = new (std::nothrow) spvc_context_s; + if (!ctx) + return SPVC_ERROR_OUT_OF_MEMORY; + + *context = ctx; + return SPVC_SUCCESS; +} + +void spvc_context_destroy(spvc_context context) +{ + delete context; +} + +void spvc_context_release_allocations(spvc_context context) +{ + context->allocations.clear(); +} + +const char *spvc_context_get_last_error_string(spvc_context context) +{ + return context->last_error.c_str(); +} + +SPVC_PUBLIC_API void spvc_context_set_error_callback(spvc_context context, spvc_error_callback cb, void *userdata) +{ + context->callback = cb; + context->callback_userdata = userdata; +} + +spvc_result spvc_context_parse_spirv(spvc_context context, const SpvId *spirv, size_t word_count, + spvc_parsed_ir *parsed_ir) +{ + SPVC_BEGIN_SAFE_SCOPE + { + std::unique_ptr pir(new (std::nothrow) spvc_parsed_ir_s); + if (!pir) + { + context->report_error("Out of memory."); + return SPVC_ERROR_OUT_OF_MEMORY; + } + + pir->context = context; + Parser parser(spirv, word_count); + parser.parse(); + pir->parsed = std::move(parser.get_parsed_ir()); + *parsed_ir = pir.get(); + context->allocations.push_back(std::move(pir)); + } + SPVC_END_SAFE_SCOPE(context, SPVC_ERROR_INVALID_SPIRV) + return SPVC_SUCCESS; +} + +spvc_result spvc_context_create_compiler(spvc_context context, spvc_backend backend, spvc_parsed_ir parsed_ir, + spvc_capture_mode mode, spvc_compiler *compiler) +{ + SPVC_BEGIN_SAFE_SCOPE + { + std::unique_ptr comp(new (std::nothrow) spvc_compiler_s); + if (!comp) + { + context->report_error("Out of memory."); + return SPVC_ERROR_OUT_OF_MEMORY; + } + comp->backend = backend; + comp->context = context; + + if (mode != SPVC_CAPTURE_MODE_COPY && mode != SPVC_CAPTURE_MODE_TAKE_OWNERSHIP) + { + context->report_error("Invalid argument for capture mode."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + switch (backend) + { + case SPVC_BACKEND_NONE: + if (mode == SPVC_CAPTURE_MODE_TAKE_OWNERSHIP) + comp->compiler.reset(new Compiler(std::move(parsed_ir->parsed))); + else if (mode == SPVC_CAPTURE_MODE_COPY) + comp->compiler.reset(new Compiler(parsed_ir->parsed)); + break; + +#if SPIRV_CROSS_C_API_GLSL + case SPVC_BACKEND_GLSL: + if (mode == SPVC_CAPTURE_MODE_TAKE_OWNERSHIP) + comp->compiler.reset(new CompilerGLSL(std::move(parsed_ir->parsed))); + else if (mode == SPVC_CAPTURE_MODE_COPY) + comp->compiler.reset(new CompilerGLSL(parsed_ir->parsed)); + break; +#endif + +#if SPIRV_CROSS_C_API_HLSL + case SPVC_BACKEND_HLSL: + if (mode == SPVC_CAPTURE_MODE_TAKE_OWNERSHIP) + comp->compiler.reset(new CompilerHLSL(std::move(parsed_ir->parsed))); + else if (mode == SPVC_CAPTURE_MODE_COPY) + comp->compiler.reset(new CompilerHLSL(parsed_ir->parsed)); + break; +#endif + +#if SPIRV_CROSS_C_API_MSL + case SPVC_BACKEND_MSL: + if (mode == SPVC_CAPTURE_MODE_TAKE_OWNERSHIP) + comp->compiler.reset(new CompilerMSL(std::move(parsed_ir->parsed))); + else if (mode == SPVC_CAPTURE_MODE_COPY) + comp->compiler.reset(new CompilerMSL(parsed_ir->parsed)); + break; +#endif + +#if SPIRV_CROSS_C_API_CPP + case SPVC_BACKEND_CPP: + if (mode == SPVC_CAPTURE_MODE_TAKE_OWNERSHIP) + comp->compiler.reset(new CompilerCPP(std::move(parsed_ir->parsed))); + else if (mode == SPVC_CAPTURE_MODE_COPY) + comp->compiler.reset(new CompilerCPP(parsed_ir->parsed)); + break; +#endif + +#if SPIRV_CROSS_C_API_REFLECT + case SPVC_BACKEND_JSON: + if (mode == SPVC_CAPTURE_MODE_TAKE_OWNERSHIP) + comp->compiler.reset(new CompilerReflection(std::move(parsed_ir->parsed))); + else if (mode == SPVC_CAPTURE_MODE_COPY) + comp->compiler.reset(new CompilerReflection(parsed_ir->parsed)); + break; +#endif + + default: + context->report_error("Invalid backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + *compiler = comp.get(); + context->allocations.push_back(std::move(comp)); + } + SPVC_END_SAFE_SCOPE(context, SPVC_ERROR_OUT_OF_MEMORY) + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_create_compiler_options(spvc_compiler compiler, spvc_compiler_options *options) +{ + SPVC_BEGIN_SAFE_SCOPE + { + std::unique_ptr opt(new (std::nothrow) spvc_compiler_options_s); + if (!opt) + { + compiler->context->report_error("Out of memory."); + return SPVC_ERROR_OUT_OF_MEMORY; + } + + opt->context = compiler->context; + opt->backend_flags = 0; + switch (compiler->backend) + { +#if SPIRV_CROSS_C_API_MSL + case SPVC_BACKEND_MSL: + opt->backend_flags |= SPVC_COMPILER_OPTION_MSL_BIT | SPVC_COMPILER_OPTION_COMMON_BIT; + opt->glsl = static_cast(compiler->compiler.get())->get_common_options(); + opt->msl = static_cast(compiler->compiler.get())->get_msl_options(); + break; +#endif + +#if SPIRV_CROSS_C_API_HLSL + case SPVC_BACKEND_HLSL: + opt->backend_flags |= SPVC_COMPILER_OPTION_HLSL_BIT | SPVC_COMPILER_OPTION_COMMON_BIT; + opt->glsl = static_cast(compiler->compiler.get())->get_common_options(); + opt->hlsl = static_cast(compiler->compiler.get())->get_hlsl_options(); + break; +#endif + +#if SPIRV_CROSS_C_API_GLSL + case SPVC_BACKEND_GLSL: + opt->backend_flags |= SPVC_COMPILER_OPTION_GLSL_BIT | SPVC_COMPILER_OPTION_COMMON_BIT; + opt->glsl = static_cast(compiler->compiler.get())->get_common_options(); + break; +#endif + + default: + break; + } + + *options = opt.get(); + compiler->context->allocations.push_back(std::move(opt)); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_OUT_OF_MEMORY) + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_options_set_bool(spvc_compiler_options options, spvc_compiler_option option, + spvc_bool value) +{ + return spvc_compiler_options_set_uint(options, option, value ? 1 : 0); +} + +spvc_result spvc_compiler_options_set_uint(spvc_compiler_options options, spvc_compiler_option option, unsigned value) +{ + (void)value; + (void)option; + uint32_t supported_mask = options->backend_flags; + uint32_t required_mask = option & SPVC_COMPILER_OPTION_LANG_BITS; + if ((required_mask | supported_mask) != supported_mask) + { + options->context->report_error("Option is not supported by current backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + switch (option) + { +#if SPIRV_CROSS_C_API_GLSL + case SPVC_COMPILER_OPTION_FORCE_TEMPORARY: + options->glsl.force_temporary = value != 0; + break; + case SPVC_COMPILER_OPTION_FLATTEN_MULTIDIMENSIONAL_ARRAYS: + options->glsl.flatten_multidimensional_arrays = value != 0; + break; + case SPVC_COMPILER_OPTION_FIXUP_DEPTH_CONVENTION: + options->glsl.vertex.fixup_clipspace = value != 0; + break; + case SPVC_COMPILER_OPTION_FLIP_VERTEX_Y: + options->glsl.vertex.flip_vert_y = value != 0; + break; + case SPVC_COMPILER_OPTION_EMIT_LINE_DIRECTIVES: + options->glsl.emit_line_directives = value != 0; + break; + case SPVC_COMPILER_OPTION_ENABLE_STORAGE_IMAGE_QUALIFIER_DEDUCTION: + options->glsl.enable_storage_image_qualifier_deduction = value != 0; + break; + case SPVC_COMPILER_OPTION_FORCE_ZERO_INITIALIZED_VARIABLES: + options->glsl.force_zero_initialized_variables = value != 0; + break; + + case SPVC_COMPILER_OPTION_GLSL_SUPPORT_NONZERO_BASE_INSTANCE: + options->glsl.vertex.support_nonzero_base_instance = value != 0; + break; + case SPVC_COMPILER_OPTION_GLSL_SEPARATE_SHADER_OBJECTS: + options->glsl.separate_shader_objects = value != 0; + break; + case SPVC_COMPILER_OPTION_GLSL_ENABLE_420PACK_EXTENSION: + options->glsl.enable_420pack_extension = value != 0; + break; + case SPVC_COMPILER_OPTION_GLSL_VERSION: + options->glsl.version = value; + break; + case SPVC_COMPILER_OPTION_GLSL_ES: + options->glsl.es = value != 0; + break; + case SPVC_COMPILER_OPTION_GLSL_VULKAN_SEMANTICS: + options->glsl.vulkan_semantics = value != 0; + break; + case SPVC_COMPILER_OPTION_GLSL_ES_DEFAULT_FLOAT_PRECISION_HIGHP: + options->glsl.fragment.default_float_precision = + value != 0 ? CompilerGLSL::Options::Precision::Highp : CompilerGLSL::Options::Precision::Mediump; + break; + case SPVC_COMPILER_OPTION_GLSL_ES_DEFAULT_INT_PRECISION_HIGHP: + options->glsl.fragment.default_int_precision = + value != 0 ? CompilerGLSL::Options::Precision::Highp : CompilerGLSL::Options::Precision::Mediump; + break; + case SPVC_COMPILER_OPTION_GLSL_EMIT_PUSH_CONSTANT_AS_UNIFORM_BUFFER: + options->glsl.emit_push_constant_as_uniform_buffer = value != 0; + break; + case SPVC_COMPILER_OPTION_GLSL_EMIT_UNIFORM_BUFFER_AS_PLAIN_UNIFORMS: + options->glsl.emit_uniform_buffer_as_plain_uniforms = value != 0; + break; + case SPVC_COMPILER_OPTION_GLSL_FORCE_FLATTENED_IO_BLOCKS: + options->glsl.force_flattened_io_blocks = value != 0; + break; + case SPVC_COMPILER_OPTION_GLSL_OVR_MULTIVIEW_VIEW_COUNT: + options->glsl.ovr_multiview_view_count = value; + break; + case SPVC_COMPILER_OPTION_RELAX_NAN_CHECKS: + options->glsl.relax_nan_checks = value != 0; + break; + case SPVC_COMPILER_OPTION_GLSL_ENABLE_ROW_MAJOR_LOAD_WORKAROUND: + options->glsl.enable_row_major_load_workaround = value != 0; + break; +#endif + +#if SPIRV_CROSS_C_API_HLSL + case SPVC_COMPILER_OPTION_HLSL_SHADER_MODEL: + options->hlsl.shader_model = value; + break; + + case SPVC_COMPILER_OPTION_HLSL_POINT_SIZE_COMPAT: + options->hlsl.point_size_compat = value != 0; + break; + + case SPVC_COMPILER_OPTION_HLSL_POINT_COORD_COMPAT: + options->hlsl.point_coord_compat = value != 0; + break; + + case SPVC_COMPILER_OPTION_HLSL_SUPPORT_NONZERO_BASE_VERTEX_BASE_INSTANCE: + options->hlsl.support_nonzero_base_vertex_base_instance = value != 0; + break; + + case SPVC_COMPILER_OPTION_HLSL_FORCE_STORAGE_BUFFER_AS_UAV: + options->hlsl.force_storage_buffer_as_uav = value != 0; + break; + + case SPVC_COMPILER_OPTION_HLSL_NONWRITABLE_UAV_TEXTURE_AS_SRV: + options->hlsl.nonwritable_uav_texture_as_srv = value != 0; + break; + + case SPVC_COMPILER_OPTION_HLSL_ENABLE_16BIT_TYPES: + options->hlsl.enable_16bit_types = value != 0; + break; + + case SPVC_COMPILER_OPTION_HLSL_FLATTEN_MATRIX_VERTEX_INPUT_SEMANTICS: + options->hlsl.flatten_matrix_vertex_input_semantics = value != 0; + break; + + case SPVC_COMPILER_OPTION_HLSL_USE_ENTRY_POINT_NAME: + options->hlsl.use_entry_point_name = value != 0; + break; + + case SPVC_COMPILER_OPTION_HLSL_PRESERVE_STRUCTURED_BUFFERS: + options->hlsl.preserve_structured_buffers = value != 0; + break; + + case SPVC_COMPILER_OPTION_HLSL_USER_SEMANTIC: + options->hlsl.user_semantic = value != 0; + break; +#endif + +#if SPIRV_CROSS_C_API_MSL + case SPVC_COMPILER_OPTION_MSL_VERSION: + options->msl.msl_version = value; + break; + + case SPVC_COMPILER_OPTION_MSL_TEXEL_BUFFER_TEXTURE_WIDTH: + options->msl.texel_buffer_texture_width = value; + break; + + case SPVC_COMPILER_OPTION_MSL_SWIZZLE_BUFFER_INDEX: + options->msl.swizzle_buffer_index = value; + break; + + case SPVC_COMPILER_OPTION_MSL_INDIRECT_PARAMS_BUFFER_INDEX: + options->msl.indirect_params_buffer_index = value; + break; + + case SPVC_COMPILER_OPTION_MSL_SHADER_OUTPUT_BUFFER_INDEX: + options->msl.shader_output_buffer_index = value; + break; + + case SPVC_COMPILER_OPTION_MSL_SHADER_PATCH_OUTPUT_BUFFER_INDEX: + options->msl.shader_patch_output_buffer_index = value; + break; + + case SPVC_COMPILER_OPTION_MSL_SHADER_TESS_FACTOR_OUTPUT_BUFFER_INDEX: + options->msl.shader_tess_factor_buffer_index = value; + break; + + case SPVC_COMPILER_OPTION_MSL_SHADER_INPUT_WORKGROUP_INDEX: + options->msl.shader_input_wg_index = value; + break; + + case SPVC_COMPILER_OPTION_MSL_ENABLE_POINT_SIZE_BUILTIN: + options->msl.enable_point_size_builtin = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_ENABLE_POINT_SIZE_DEFAULT: + options->msl.enable_point_size_default = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_DISABLE_RASTERIZATION: + options->msl.disable_rasterization = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_AUTO_DISABLE_RASTERIZATION: + options->msl.auto_disable_rasterization = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_CAPTURE_OUTPUT_TO_BUFFER: + options->msl.capture_output_to_buffer = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_SWIZZLE_TEXTURE_SAMPLES: + options->msl.swizzle_texture_samples = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_PAD_FRAGMENT_OUTPUT_COMPONENTS: + options->msl.pad_fragment_output_components = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_TESS_DOMAIN_ORIGIN_LOWER_LEFT: + options->msl.tess_domain_origin_lower_left = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_PLATFORM: + options->msl.platform = static_cast(value); + break; + + case SPVC_COMPILER_OPTION_MSL_ARGUMENT_BUFFERS: + options->msl.argument_buffers = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_TEXTURE_BUFFER_NATIVE: + options->msl.texture_buffer_native = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_BUFFER_SIZE_BUFFER_INDEX: + options->msl.buffer_size_buffer_index = value; + break; + + case SPVC_COMPILER_OPTION_MSL_MULTIVIEW: + options->msl.multiview = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_VIEW_MASK_BUFFER_INDEX: + options->msl.view_mask_buffer_index = value; + break; + + case SPVC_COMPILER_OPTION_MSL_DEVICE_INDEX: + options->msl.device_index = value; + break; + + case SPVC_COMPILER_OPTION_MSL_VIEW_INDEX_FROM_DEVICE_INDEX: + options->msl.view_index_from_device_index = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_DISPATCH_BASE: + options->msl.dispatch_base = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_DYNAMIC_OFFSETS_BUFFER_INDEX: + options->msl.dynamic_offsets_buffer_index = value; + break; + + case SPVC_COMPILER_OPTION_MSL_TEXTURE_1D_AS_2D: + options->msl.texture_1D_as_2D = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_ENABLE_BASE_INDEX_ZERO: + options->msl.enable_base_index_zero = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_FRAMEBUFFER_FETCH_SUBPASS: + options->msl.use_framebuffer_fetch_subpasses = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_INVARIANT_FP_MATH: + options->msl.invariant_float_math = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_EMULATE_CUBEMAP_ARRAY: + options->msl.emulate_cube_array = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_ENABLE_DECORATION_BINDING: + options->msl.enable_decoration_binding = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_FORCE_ACTIVE_ARGUMENT_BUFFER_RESOURCES: + options->msl.force_active_argument_buffer_resources = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_FORCE_NATIVE_ARRAYS: + options->msl.force_native_arrays = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_ENABLE_FRAG_OUTPUT_MASK: + options->msl.enable_frag_output_mask = value; + break; + + case SPVC_COMPILER_OPTION_MSL_ENABLE_FRAG_DEPTH_BUILTIN: + options->msl.enable_frag_depth_builtin = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_ENABLE_FRAG_STENCIL_REF_BUILTIN: + options->msl.enable_frag_stencil_ref_builtin = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_ENABLE_CLIP_DISTANCE_USER_VARYING: + options->msl.enable_clip_distance_user_varying = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_MULTI_PATCH_WORKGROUP: + options->msl.multi_patch_workgroup = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_SHADER_INPUT_BUFFER_INDEX: + options->msl.shader_input_buffer_index = value; + break; + + case SPVC_COMPILER_OPTION_MSL_SHADER_INDEX_BUFFER_INDEX: + options->msl.shader_index_buffer_index = value; + break; + + case SPVC_COMPILER_OPTION_MSL_VERTEX_FOR_TESSELLATION: + options->msl.vertex_for_tessellation = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_VERTEX_INDEX_TYPE: + options->msl.vertex_index_type = static_cast(value); + break; + + case SPVC_COMPILER_OPTION_MSL_MULTIVIEW_LAYERED_RENDERING: + options->msl.multiview_layered_rendering = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_ARRAYED_SUBPASS_INPUT: + options->msl.arrayed_subpass_input = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_R32UI_LINEAR_TEXTURE_ALIGNMENT: + options->msl.r32ui_linear_texture_alignment = value; + break; + + case SPVC_COMPILER_OPTION_MSL_R32UI_ALIGNMENT_CONSTANT_ID: + options->msl.r32ui_alignment_constant_id = value; + break; + + case SPVC_COMPILER_OPTION_MSL_IOS_USE_SIMDGROUP_FUNCTIONS: + options->msl.ios_use_simdgroup_functions = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_EMULATE_SUBGROUPS: + options->msl.emulate_subgroups = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_FIXED_SUBGROUP_SIZE: + options->msl.fixed_subgroup_size = value; + break; + + case SPVC_COMPILER_OPTION_MSL_FORCE_SAMPLE_RATE_SHADING: + options->msl.force_sample_rate_shading = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_IOS_SUPPORT_BASE_VERTEX_INSTANCE: + options->msl.ios_support_base_vertex_instance = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_RAW_BUFFER_TESE_INPUT: + options->msl.raw_buffer_tese_input = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_SHADER_PATCH_INPUT_BUFFER_INDEX: + options->msl.shader_patch_input_buffer_index = value; + break; + + case SPVC_COMPILER_OPTION_MSL_MANUAL_HELPER_INVOCATION_UPDATES: + options->msl.manual_helper_invocation_updates = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_CHECK_DISCARDED_FRAG_STORES: + options->msl.check_discarded_frag_stores = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_ARGUMENT_BUFFERS_TIER: + options->msl.argument_buffers_tier = static_cast(value); + break; + + case SPVC_COMPILER_OPTION_MSL_SAMPLE_DREF_LOD_ARRAY_AS_GRAD: + options->msl.sample_dref_lod_array_as_grad = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_READWRITE_TEXTURE_FENCES: + options->msl.readwrite_texture_fences = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_REPLACE_RECURSIVE_INPUTS: + options->msl.replace_recursive_inputs = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_AGX_MANUAL_CUBE_GRAD_FIXUP: + options->msl.agx_manual_cube_grad_fixup = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_FORCE_FRAGMENT_WITH_SIDE_EFFECTS_EXECUTION: + options->msl.force_fragment_with_side_effects_execution = value != 0; + break; +#endif + + default: + options->context->report_error("Unknown option."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_install_compiler_options(spvc_compiler compiler, spvc_compiler_options options) +{ + (void)options; + switch (compiler->backend) + { +#if SPIRV_CROSS_C_API_GLSL + case SPVC_BACKEND_GLSL: + static_cast(*compiler->compiler).set_common_options(options->glsl); + break; +#endif + +#if SPIRV_CROSS_C_API_HLSL + case SPVC_BACKEND_HLSL: + static_cast(*compiler->compiler).set_common_options(options->glsl); + static_cast(*compiler->compiler).set_hlsl_options(options->hlsl); + break; +#endif + +#if SPIRV_CROSS_C_API_MSL + case SPVC_BACKEND_MSL: + static_cast(*compiler->compiler).set_common_options(options->glsl); + static_cast(*compiler->compiler).set_msl_options(options->msl); + break; +#endif + + default: + break; + } + + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_add_header_line(spvc_compiler compiler, const char *line) +{ +#if SPIRV_CROSS_C_API_GLSL + if (compiler->backend == SPVC_BACKEND_NONE) + { + compiler->context->report_error("Cross-compilation related option used on NONE backend which only supports reflection."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + static_cast(compiler->compiler.get())->add_header_line(line); + return SPVC_SUCCESS; +#else + (void)line; + compiler->context->report_error("Cross-compilation related option used on NONE backend which only supports reflection."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_require_extension(spvc_compiler compiler, const char *line) +{ +#if SPIRV_CROSS_C_API_GLSL + if (compiler->backend == SPVC_BACKEND_NONE) + { + compiler->context->report_error("Cross-compilation related option used on NONE backend which only supports reflection."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + static_cast(compiler->compiler.get())->require_extension(line); + return SPVC_SUCCESS; +#else + (void)line; + compiler->context->report_error("Cross-compilation related option used on NONE backend which only supports reflection."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +size_t spvc_compiler_get_num_required_extensions(spvc_compiler compiler) +{ +#if SPIRV_CROSS_C_API_GLSL + if (compiler->backend != SPVC_BACKEND_GLSL) + { + compiler->context->report_error("Enabled extensions can only be queried on GLSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + return static_cast(compiler->compiler.get())->get_required_extensions().size(); +#else + compiler->context->report_error("Enabled extensions can only be queried on GLSL backend."); + return 0; +#endif +} + +const char *spvc_compiler_get_required_extension(spvc_compiler compiler, size_t index) +{ +#if SPIRV_CROSS_C_API_GLSL + if (compiler->backend != SPVC_BACKEND_GLSL) + { + compiler->context->report_error("Enabled extensions can only be queried on GLSL backend."); + return nullptr; + } + + auto &exts = static_cast(compiler->compiler.get())->get_required_extensions(); + if (index < exts.size()) + return exts[index].c_str(); + else + return nullptr; +#else + (void)index; + compiler->context->report_error("Enabled extensions can only be queried on GLSL backend."); + return nullptr; +#endif +} + +spvc_result spvc_compiler_flatten_buffer_block(spvc_compiler compiler, spvc_variable_id id) +{ +#if SPIRV_CROSS_C_API_GLSL + if (compiler->backend == SPVC_BACKEND_NONE) + { + compiler->context->report_error("Cross-compilation related option used on NONE backend which only supports reflection."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + static_cast(compiler->compiler.get())->flatten_buffer_block(id); + return SPVC_SUCCESS; +#else + (void)id; + compiler->context->report_error("Cross-compilation related option used on NONE backend which only supports reflection."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_bool spvc_compiler_variable_is_depth_or_compare(spvc_compiler compiler, spvc_variable_id id) +{ +#if SPIRV_CROSS_C_API_GLSL + if (compiler->backend == SPVC_BACKEND_NONE) + { + compiler->context->report_error("Cross-compilation related option used on NONE backend which only supports reflection."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + return static_cast(compiler->compiler.get())->variable_is_depth_or_compare(id) ? SPVC_TRUE : SPVC_FALSE; +#else + (void)id; + compiler->context->report_error("Cross-compilation related option used on NONE backend which only supports reflection."); + return SPVC_FALSE; +#endif +} + +spvc_result spvc_compiler_mask_stage_output_by_location(spvc_compiler compiler, + unsigned location, unsigned component) +{ +#if SPIRV_CROSS_C_API_GLSL + if (compiler->backend == SPVC_BACKEND_NONE) + { + compiler->context->report_error("Cross-compilation related option used on NONE backend which only supports reflection."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + static_cast(compiler->compiler.get())->mask_stage_output_by_location(location, component); + return SPVC_SUCCESS; +#else + (void)location; + (void)component; + compiler->context->report_error("Cross-compilation related option used on NONE backend which only supports reflection."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_mask_stage_output_by_builtin(spvc_compiler compiler, SpvBuiltIn builtin) +{ +#if SPIRV_CROSS_C_API_GLSL + if (compiler->backend == SPVC_BACKEND_NONE) + { + compiler->context->report_error("Cross-compilation related option used on NONE backend which only supports reflection."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + static_cast(compiler->compiler.get())->mask_stage_output_by_builtin(BuiltIn(builtin)); + return SPVC_SUCCESS; +#else + (void)builtin; + compiler->context->report_error("Cross-compilation related option used on NONE backend which only supports reflection."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_hlsl_set_root_constants_layout(spvc_compiler compiler, + const spvc_hlsl_root_constants *constant_info, + size_t count) +{ +#if SPIRV_CROSS_C_API_HLSL + if (compiler->backend != SPVC_BACKEND_HLSL) + { + compiler->context->report_error("HLSL function used on a non-HLSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &hlsl = *static_cast(compiler->compiler.get()); + vector roots; + roots.reserve(count); + for (size_t i = 0; i < count; i++) + { + RootConstants root; + root.binding = constant_info[i].binding; + root.space = constant_info[i].space; + root.start = constant_info[i].start; + root.end = constant_info[i].end; + roots.push_back(root); + } + + hlsl.set_root_constant_layouts(std::move(roots)); + return SPVC_SUCCESS; +#else + (void)constant_info; + (void)count; + compiler->context->report_error("HLSL function used on a non-HLSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_hlsl_add_vertex_attribute_remap(spvc_compiler compiler, + const spvc_hlsl_vertex_attribute_remap *remap, + size_t count) +{ +#if SPIRV_CROSS_C_API_HLSL + if (compiler->backend != SPVC_BACKEND_HLSL) + { + compiler->context->report_error("HLSL function used on a non-HLSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + HLSLVertexAttributeRemap re; + auto &hlsl = *static_cast(compiler->compiler.get()); + for (size_t i = 0; i < count; i++) + { + re.location = remap[i].location; + re.semantic = remap[i].semantic; + hlsl.add_vertex_attribute_remap(re); + } + + return SPVC_SUCCESS; +#else + (void)remap; + (void)count; + compiler->context->report_error("HLSL function used on a non-HLSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_variable_id spvc_compiler_hlsl_remap_num_workgroups_builtin(spvc_compiler compiler) +{ +#if SPIRV_CROSS_C_API_HLSL + if (compiler->backend != SPVC_BACKEND_HLSL) + { + compiler->context->report_error("HLSL function used on a non-HLSL backend."); + return 0; + } + + auto &hlsl = *static_cast(compiler->compiler.get()); + return hlsl.remap_num_workgroups_builtin(); +#else + compiler->context->report_error("HLSL function used on a non-HLSL backend."); + return 0; +#endif +} + +spvc_result spvc_compiler_hlsl_set_resource_binding_flags(spvc_compiler compiler, + spvc_hlsl_binding_flags flags) +{ +#if SPIRV_CROSS_C_API_HLSL + if (compiler->backend != SPVC_BACKEND_HLSL) + { + compiler->context->report_error("HLSL function used on a non-HLSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &hlsl = *static_cast(compiler->compiler.get()); + hlsl.set_resource_binding_flags(flags); + return SPVC_SUCCESS; +#else + (void)flags; + compiler->context->report_error("HLSL function used on a non-HLSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_hlsl_add_resource_binding(spvc_compiler compiler, + const spvc_hlsl_resource_binding *binding) +{ +#if SPIRV_CROSS_C_API_HLSL + if (compiler->backend != SPVC_BACKEND_HLSL) + { + compiler->context->report_error("HLSL function used on a non-HLSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &hlsl = *static_cast(compiler->compiler.get()); + HLSLResourceBinding bind; + bind.binding = binding->binding; + bind.desc_set = binding->desc_set; + bind.stage = static_cast(binding->stage); + bind.cbv.register_binding = binding->cbv.register_binding; + bind.cbv.register_space = binding->cbv.register_space; + bind.uav.register_binding = binding->uav.register_binding; + bind.uav.register_space = binding->uav.register_space; + bind.srv.register_binding = binding->srv.register_binding; + bind.srv.register_space = binding->srv.register_space; + bind.sampler.register_binding = binding->sampler.register_binding; + bind.sampler.register_space = binding->sampler.register_space; + hlsl.add_hlsl_resource_binding(bind); + return SPVC_SUCCESS; +#else + (void)binding; + compiler->context->report_error("HLSL function used on a non-HLSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_bool spvc_compiler_hlsl_is_resource_used(spvc_compiler compiler, SpvExecutionModel model, unsigned set, + unsigned binding) +{ +#if SPIRV_CROSS_C_API_HLSL + if (compiler->backend != SPVC_BACKEND_HLSL) + { + compiler->context->report_error("HLSL function used on a non-HLSL backend."); + return SPVC_FALSE; + } + + auto &hlsl = *static_cast(compiler->compiler.get()); + return hlsl.is_hlsl_resource_binding_used(static_cast(model), set, binding) ? SPVC_TRUE : + SPVC_FALSE; +#else + (void)model; + (void)set; + (void)binding; + compiler->context->report_error("HLSL function used on a non-HLSL backend."); + return SPVC_FALSE; +#endif +} + +spvc_bool spvc_compiler_msl_is_rasterization_disabled(spvc_compiler compiler) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_FALSE; + } + + auto &msl = *static_cast(compiler->compiler.get()); + return msl.get_is_rasterization_disabled() ? SPVC_TRUE : SPVC_FALSE; +#else + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_FALSE; +#endif +} + +spvc_bool spvc_compiler_msl_needs_swizzle_buffer(spvc_compiler compiler) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_FALSE; + } + + auto &msl = *static_cast(compiler->compiler.get()); + return msl.needs_swizzle_buffer() ? SPVC_TRUE : SPVC_FALSE; +#else + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_FALSE; +#endif +} + +spvc_bool spvc_compiler_msl_needs_buffer_size_buffer(spvc_compiler compiler) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_FALSE; + } + + auto &msl = *static_cast(compiler->compiler.get()); + return msl.needs_buffer_size_buffer() ? SPVC_TRUE : SPVC_FALSE; +#else + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_FALSE; +#endif +} + +spvc_bool spvc_compiler_msl_needs_aux_buffer(spvc_compiler compiler) +{ + return spvc_compiler_msl_needs_swizzle_buffer(compiler); +} + +spvc_bool spvc_compiler_msl_needs_output_buffer(spvc_compiler compiler) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_FALSE; + } + + auto &msl = *static_cast(compiler->compiler.get()); + return msl.needs_output_buffer() ? SPVC_TRUE : SPVC_FALSE; +#else + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_FALSE; +#endif +} + +spvc_bool spvc_compiler_msl_needs_patch_output_buffer(spvc_compiler compiler) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_FALSE; + } + + auto &msl = *static_cast(compiler->compiler.get()); + return msl.needs_patch_output_buffer() ? SPVC_TRUE : SPVC_FALSE; +#else + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_FALSE; +#endif +} + +spvc_bool spvc_compiler_msl_needs_input_threadgroup_mem(spvc_compiler compiler) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_FALSE; + } + + auto &msl = *static_cast(compiler->compiler.get()); + return msl.needs_input_threadgroup_mem() ? SPVC_TRUE : SPVC_FALSE; +#else + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_FALSE; +#endif +} + +spvc_result spvc_compiler_msl_add_vertex_attribute(spvc_compiler compiler, const spvc_msl_vertex_attribute *va) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &msl = *static_cast(compiler->compiler.get()); + MSLShaderInterfaceVariable attr; + attr.location = va->location; + attr.format = static_cast(va->format); + attr.builtin = static_cast(va->builtin); + msl.add_msl_shader_input(attr); + return SPVC_SUCCESS; +#else + (void)va; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_msl_add_shader_input(spvc_compiler compiler, const spvc_msl_shader_interface_var *si) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &msl = *static_cast(compiler->compiler.get()); + MSLShaderInterfaceVariable input; + input.location = si->location; + input.format = static_cast(si->format); + input.builtin = static_cast(si->builtin); + input.vecsize = si->vecsize; + msl.add_msl_shader_input(input); + return SPVC_SUCCESS; +#else + (void)si; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_msl_add_shader_input_2(spvc_compiler compiler, const spvc_msl_shader_interface_var_2 *si) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &msl = *static_cast(compiler->compiler.get()); + MSLShaderInterfaceVariable input; + input.location = si->location; + input.format = static_cast(si->format); + input.builtin = static_cast(si->builtin); + input.vecsize = si->vecsize; + input.rate = static_cast(si->rate); + msl.add_msl_shader_input(input); + return SPVC_SUCCESS; +#else + (void)si; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_msl_add_shader_output(spvc_compiler compiler, const spvc_msl_shader_interface_var *so) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &msl = *static_cast(compiler->compiler.get()); + MSLShaderInterfaceVariable output; + output.location = so->location; + output.format = static_cast(so->format); + output.builtin = static_cast(so->builtin); + output.vecsize = so->vecsize; + msl.add_msl_shader_output(output); + return SPVC_SUCCESS; +#else + (void)so; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_msl_add_shader_output_2(spvc_compiler compiler, const spvc_msl_shader_interface_var_2 *so) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &msl = *static_cast(compiler->compiler.get()); + MSLShaderInterfaceVariable output; + output.location = so->location; + output.format = static_cast(so->format); + output.builtin = static_cast(so->builtin); + output.vecsize = so->vecsize; + output.rate = static_cast(so->rate); + msl.add_msl_shader_output(output); + return SPVC_SUCCESS; +#else + (void)so; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_msl_add_resource_binding(spvc_compiler compiler, + const spvc_msl_resource_binding *binding) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &msl = *static_cast(compiler->compiler.get()); + MSLResourceBinding bind; + bind.binding = binding->binding; + bind.desc_set = binding->desc_set; + bind.stage = static_cast(binding->stage); + bind.msl_buffer = binding->msl_buffer; + bind.msl_texture = binding->msl_texture; + bind.msl_sampler = binding->msl_sampler; + msl.add_msl_resource_binding(bind); + return SPVC_SUCCESS; +#else + (void)binding; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_msl_add_resource_binding_2(spvc_compiler compiler, + const spvc_msl_resource_binding_2 *binding) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &msl = *static_cast(compiler->compiler.get()); + MSLResourceBinding bind; + bind.binding = binding->binding; + bind.desc_set = binding->desc_set; + bind.stage = static_cast(binding->stage); + bind.msl_buffer = binding->msl_buffer; + bind.msl_texture = binding->msl_texture; + bind.msl_sampler = binding->msl_sampler; + bind.count = binding->count; + msl.add_msl_resource_binding(bind); + return SPVC_SUCCESS; +#else + (void)binding; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_msl_add_dynamic_buffer(spvc_compiler compiler, unsigned desc_set, unsigned binding, unsigned index) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &msl = *static_cast(compiler->compiler.get()); + msl.add_dynamic_buffer(desc_set, binding, index); + return SPVC_SUCCESS; +#else + (void)binding; + (void)desc_set; + (void)index; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_msl_add_inline_uniform_block(spvc_compiler compiler, unsigned desc_set, unsigned binding) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &msl = *static_cast(compiler->compiler.get()); + msl.add_inline_uniform_block(desc_set, binding); + return SPVC_SUCCESS; +#else + (void)binding; + (void)desc_set; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_msl_add_discrete_descriptor_set(spvc_compiler compiler, unsigned desc_set) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &msl = *static_cast(compiler->compiler.get()); + msl.add_discrete_descriptor_set(desc_set); + return SPVC_SUCCESS; +#else + (void)desc_set; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_msl_set_argument_buffer_device_address_space(spvc_compiler compiler, unsigned desc_set, spvc_bool device_address) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &msl = *static_cast(compiler->compiler.get()); + msl.set_argument_buffer_device_address_space(desc_set, bool(device_address)); + return SPVC_SUCCESS; +#else + (void)desc_set; + (void)device_address; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_bool spvc_compiler_msl_is_shader_input_used(spvc_compiler compiler, unsigned location) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_FALSE; + } + + auto &msl = *static_cast(compiler->compiler.get()); + return msl.is_msl_shader_input_used(location) ? SPVC_TRUE : SPVC_FALSE; +#else + (void)location; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_FALSE; +#endif +} + +spvc_bool spvc_compiler_msl_is_shader_output_used(spvc_compiler compiler, unsigned location) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_FALSE; + } + + auto &msl = *static_cast(compiler->compiler.get()); + return msl.is_msl_shader_output_used(location) ? SPVC_TRUE : SPVC_FALSE; +#else + (void)location; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_FALSE; +#endif +} + +spvc_bool spvc_compiler_msl_is_vertex_attribute_used(spvc_compiler compiler, unsigned location) +{ + return spvc_compiler_msl_is_shader_input_used(compiler, location); +} + +spvc_bool spvc_compiler_msl_is_resource_used(spvc_compiler compiler, SpvExecutionModel model, unsigned set, + unsigned binding) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_FALSE; + } + + auto &msl = *static_cast(compiler->compiler.get()); + return msl.is_msl_resource_binding_used(static_cast(model), set, binding) ? SPVC_TRUE : + SPVC_FALSE; +#else + (void)model; + (void)set; + (void)binding; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_FALSE; +#endif +} + +spvc_result spvc_compiler_msl_set_combined_sampler_suffix(spvc_compiler compiler, const char *suffix) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &msl = *static_cast(compiler->compiler.get()); + msl.set_combined_sampler_suffix(suffix); + return SPVC_SUCCESS; +#else + (void)suffix; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +const char *spvc_compiler_msl_get_combined_sampler_suffix(spvc_compiler compiler) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return ""; + } + + auto &msl = *static_cast(compiler->compiler.get()); + return msl.get_combined_sampler_suffix(); +#else + compiler->context->report_error("MSL function used on a non-MSL backend."); + return ""; +#endif +} + +#if SPIRV_CROSS_C_API_MSL +static void spvc_convert_msl_sampler(MSLConstexprSampler &samp, const spvc_msl_constexpr_sampler *sampler) +{ + samp.s_address = static_cast(sampler->s_address); + samp.t_address = static_cast(sampler->t_address); + samp.r_address = static_cast(sampler->r_address); + samp.lod_clamp_min = sampler->lod_clamp_min; + samp.lod_clamp_max = sampler->lod_clamp_max; + samp.lod_clamp_enable = sampler->lod_clamp_enable != 0; + samp.min_filter = static_cast(sampler->min_filter); + samp.mag_filter = static_cast(sampler->mag_filter); + samp.mip_filter = static_cast(sampler->mip_filter); + samp.compare_enable = sampler->compare_enable != 0; + samp.anisotropy_enable = sampler->anisotropy_enable != 0; + samp.max_anisotropy = sampler->max_anisotropy; + samp.compare_func = static_cast(sampler->compare_func); + samp.coord = static_cast(sampler->coord); + samp.border_color = static_cast(sampler->border_color); +} + +static void spvc_convert_msl_sampler_ycbcr_conversion(MSLConstexprSampler &samp, const spvc_msl_sampler_ycbcr_conversion *conv) +{ + samp.ycbcr_conversion_enable = conv != nullptr; + if (conv == nullptr) return; + samp.planes = conv->planes; + samp.resolution = static_cast(conv->resolution); + samp.chroma_filter = static_cast(conv->chroma_filter); + samp.x_chroma_offset = static_cast(conv->x_chroma_offset); + samp.y_chroma_offset = static_cast(conv->y_chroma_offset); + for (int i = 0; i < 4; i++) + samp.swizzle[i] = static_cast(conv->swizzle[i]); + samp.ycbcr_model = static_cast(conv->ycbcr_model); + samp.ycbcr_range = static_cast(conv->ycbcr_range); + samp.bpc = conv->bpc; +} +#endif + +spvc_result spvc_compiler_msl_remap_constexpr_sampler(spvc_compiler compiler, spvc_variable_id id, + const spvc_msl_constexpr_sampler *sampler) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &msl = *static_cast(compiler->compiler.get()); + MSLConstexprSampler samp; + spvc_convert_msl_sampler(samp, sampler); + msl.remap_constexpr_sampler(id, samp); + return SPVC_SUCCESS; +#else + (void)id; + (void)sampler; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_msl_remap_constexpr_sampler_by_binding(spvc_compiler compiler, + unsigned desc_set, unsigned binding, + const spvc_msl_constexpr_sampler *sampler) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &msl = *static_cast(compiler->compiler.get()); + MSLConstexprSampler samp; + spvc_convert_msl_sampler(samp, sampler); + msl.remap_constexpr_sampler_by_binding(desc_set, binding, samp); + return SPVC_SUCCESS; +#else + (void)desc_set; + (void)binding; + (void)sampler; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_msl_remap_constexpr_sampler_ycbcr(spvc_compiler compiler, spvc_variable_id id, + const spvc_msl_constexpr_sampler *sampler, + const spvc_msl_sampler_ycbcr_conversion *conv) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &msl = *static_cast(compiler->compiler.get()); + MSLConstexprSampler samp; + spvc_convert_msl_sampler(samp, sampler); + spvc_convert_msl_sampler_ycbcr_conversion(samp, conv); + msl.remap_constexpr_sampler(id, samp); + return SPVC_SUCCESS; +#else + (void)id; + (void)sampler; + (void)conv; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_msl_remap_constexpr_sampler_by_binding_ycbcr(spvc_compiler compiler, + unsigned desc_set, unsigned binding, + const spvc_msl_constexpr_sampler *sampler, + const spvc_msl_sampler_ycbcr_conversion *conv) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &msl = *static_cast(compiler->compiler.get()); + MSLConstexprSampler samp; + spvc_convert_msl_sampler(samp, sampler); + spvc_convert_msl_sampler_ycbcr_conversion(samp, conv); + msl.remap_constexpr_sampler_by_binding(desc_set, binding, samp); + return SPVC_SUCCESS; +#else + (void)desc_set; + (void)binding; + (void)sampler; + (void)conv; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +spvc_result spvc_compiler_msl_set_fragment_output_components(spvc_compiler compiler, unsigned location, + unsigned components) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &msl = *static_cast(compiler->compiler.get()); + msl.set_fragment_output_components(location, components); + return SPVC_SUCCESS; +#else + (void)location; + (void)components; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + +unsigned spvc_compiler_msl_get_automatic_resource_binding(spvc_compiler compiler, spvc_variable_id id) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return uint32_t(-1); + } + + auto &msl = *static_cast(compiler->compiler.get()); + return msl.get_automatic_msl_resource_binding(id); +#else + (void)id; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return uint32_t(-1); +#endif +} + +unsigned spvc_compiler_msl_get_automatic_resource_binding_secondary(spvc_compiler compiler, spvc_variable_id id) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return uint32_t(-1); + } + + auto &msl = *static_cast(compiler->compiler.get()); + return msl.get_automatic_msl_resource_binding_secondary(id); +#else + (void)id; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return uint32_t(-1); +#endif +} + +spvc_result spvc_compiler_compile(spvc_compiler compiler, const char **source) +{ + SPVC_BEGIN_SAFE_SCOPE + { + auto result = compiler->compiler->compile(); + if (result.empty()) + { + compiler->context->report_error("Unsupported SPIR-V."); + return SPVC_ERROR_UNSUPPORTED_SPIRV; + } + + *source = compiler->context->allocate_name(result); + if (!*source) + { + compiler->context->report_error("Out of memory."); + return SPVC_ERROR_OUT_OF_MEMORY; + } + return SPVC_SUCCESS; + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_UNSUPPORTED_SPIRV) +} + +bool spvc_resources_s::copy_resources(SmallVector &outputs, + const SmallVector &inputs) +{ + for (auto &i : inputs) + { + spvc_reflected_resource r; + r.base_type_id = i.base_type_id; + r.type_id = i.type_id; + r.id = i.id; + r.name = context->allocate_name(i.name); + if (!r.name) + return false; + + outputs.push_back(r); + } + + return true; +} + +bool spvc_resources_s::copy_resources(SmallVector &outputs, + const SmallVector &inputs) +{ + for (auto &i : inputs) + { + spvc_reflected_builtin_resource br; + + br.value_type_id = i.value_type_id; + br.builtin = SpvBuiltIn(i.builtin); + + auto &r = br.resource; + r.base_type_id = i.resource.base_type_id; + r.type_id = i.resource.type_id; + r.id = i.resource.id; + r.name = context->allocate_name(i.resource.name); + if (!r.name) + return false; + + outputs.push_back(br); + } + + return true; +} + +bool spvc_resources_s::copy_resources(const ShaderResources &resources) +{ + if (!copy_resources(uniform_buffers, resources.uniform_buffers)) + return false; + if (!copy_resources(storage_buffers, resources.storage_buffers)) + return false; + if (!copy_resources(stage_inputs, resources.stage_inputs)) + return false; + if (!copy_resources(stage_outputs, resources.stage_outputs)) + return false; + if (!copy_resources(subpass_inputs, resources.subpass_inputs)) + return false; + if (!copy_resources(storage_images, resources.storage_images)) + return false; + if (!copy_resources(sampled_images, resources.sampled_images)) + return false; + if (!copy_resources(atomic_counters, resources.atomic_counters)) + return false; + if (!copy_resources(push_constant_buffers, resources.push_constant_buffers)) + return false; + if (!copy_resources(shader_record_buffers, resources.shader_record_buffers)) + return false; + if (!copy_resources(separate_images, resources.separate_images)) + return false; + if (!copy_resources(separate_samplers, resources.separate_samplers)) + return false; + if (!copy_resources(acceleration_structures, resources.acceleration_structures)) + return false; + if (!copy_resources(gl_plain_uniforms, resources.gl_plain_uniforms)) + return false; + if (!copy_resources(tensors, resources.tensors)) + return false; + if (!copy_resources(builtin_inputs, resources.builtin_inputs)) + return false; + if (!copy_resources(builtin_outputs, resources.builtin_outputs)) + return false; + + return true; +} + +spvc_result spvc_compiler_get_active_interface_variables(spvc_compiler compiler, spvc_set *set) +{ + SPVC_BEGIN_SAFE_SCOPE + { + std::unique_ptr ptr(new (std::nothrow) spvc_set_s); + if (!ptr) + { + compiler->context->report_error("Out of memory."); + return SPVC_ERROR_OUT_OF_MEMORY; + } + + auto active = compiler->compiler->get_active_interface_variables(); + ptr->set = std::move(active); + *set = ptr.get(); + compiler->context->allocations.push_back(std::move(ptr)); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_INVALID_ARGUMENT) + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_set_enabled_interface_variables(spvc_compiler compiler, spvc_set set) +{ + SPVC_BEGIN_SAFE_SCOPE + { + compiler->compiler->set_enabled_interface_variables(set->set); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_INVALID_ARGUMENT) + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_create_shader_resources_for_active_variables(spvc_compiler compiler, spvc_resources *resources, + spvc_set set) +{ + SPVC_BEGIN_SAFE_SCOPE + { + std::unique_ptr res(new (std::nothrow) spvc_resources_s); + if (!res) + { + compiler->context->report_error("Out of memory."); + return SPVC_ERROR_OUT_OF_MEMORY; + } + + res->context = compiler->context; + auto accessed_resources = compiler->compiler->get_shader_resources(set->set); + + if (!res->copy_resources(accessed_resources)) + { + res->context->report_error("Out of memory."); + return SPVC_ERROR_OUT_OF_MEMORY; + } + *resources = res.get(); + compiler->context->allocations.push_back(std::move(res)); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_OUT_OF_MEMORY) + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_create_shader_resources(spvc_compiler compiler, spvc_resources *resources) +{ + SPVC_BEGIN_SAFE_SCOPE + { + std::unique_ptr res(new (std::nothrow) spvc_resources_s); + if (!res) + { + compiler->context->report_error("Out of memory."); + return SPVC_ERROR_OUT_OF_MEMORY; + } + + res->context = compiler->context; + auto accessed_resources = compiler->compiler->get_shader_resources(); + + if (!res->copy_resources(accessed_resources)) + { + res->context->report_error("Out of memory."); + return SPVC_ERROR_OUT_OF_MEMORY; + } + + *resources = res.get(); + compiler->context->allocations.push_back(std::move(res)); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_OUT_OF_MEMORY) + return SPVC_SUCCESS; +} + +spvc_result spvc_resources_get_resource_list_for_type(spvc_resources resources, spvc_resource_type type, + const spvc_reflected_resource **resource_list, + size_t *resource_size) +{ + const SmallVector *list = nullptr; + switch (type) + { + case SPVC_RESOURCE_TYPE_UNIFORM_BUFFER: + list = &resources->uniform_buffers; + break; + + case SPVC_RESOURCE_TYPE_STORAGE_BUFFER: + list = &resources->storage_buffers; + break; + + case SPVC_RESOURCE_TYPE_STAGE_INPUT: + list = &resources->stage_inputs; + break; + + case SPVC_RESOURCE_TYPE_STAGE_OUTPUT: + list = &resources->stage_outputs; + break; + + case SPVC_RESOURCE_TYPE_SUBPASS_INPUT: + list = &resources->subpass_inputs; + break; + + case SPVC_RESOURCE_TYPE_STORAGE_IMAGE: + list = &resources->storage_images; + break; + + case SPVC_RESOURCE_TYPE_SAMPLED_IMAGE: + list = &resources->sampled_images; + break; + + case SPVC_RESOURCE_TYPE_ATOMIC_COUNTER: + list = &resources->atomic_counters; + break; + + case SPVC_RESOURCE_TYPE_PUSH_CONSTANT: + list = &resources->push_constant_buffers; + break; + + case SPVC_RESOURCE_TYPE_SEPARATE_IMAGE: + list = &resources->separate_images; + break; + + case SPVC_RESOURCE_TYPE_SEPARATE_SAMPLERS: + list = &resources->separate_samplers; + break; + + case SPVC_RESOURCE_TYPE_ACCELERATION_STRUCTURE: + list = &resources->acceleration_structures; + break; + + case SPVC_RESOURCE_TYPE_SHADER_RECORD_BUFFER: + list = &resources->shader_record_buffers; + break; + + case SPVC_RESOURCE_TYPE_GL_PLAIN_UNIFORM: + list = &resources->gl_plain_uniforms; + break; + + case SPVC_RESOURCE_TYPE_TENSOR: + list = &resources->tensors; + break; + + default: + break; + } + + if (!list) + { + resources->context->report_error("Invalid argument."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + *resource_size = list->size(); + *resource_list = list->data(); + return SPVC_SUCCESS; +} + +spvc_result spvc_resources_get_builtin_resource_list_for_type( + spvc_resources resources, spvc_builtin_resource_type type, + const spvc_reflected_builtin_resource **resource_list, + size_t *resource_size) +{ + const SmallVector *list = nullptr; + switch (type) + { + case SPVC_BUILTIN_RESOURCE_TYPE_STAGE_INPUT: + list = &resources->builtin_inputs; + break; + + case SPVC_BUILTIN_RESOURCE_TYPE_STAGE_OUTPUT: + list = &resources->builtin_outputs; + break; + + default: + break; + } + + if (!list) + { + resources->context->report_error("Invalid argument."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + *resource_size = list->size(); + *resource_list = list->data(); + return SPVC_SUCCESS; +} + +void spvc_compiler_set_decoration(spvc_compiler compiler, SpvId id, SpvDecoration decoration, unsigned argument) +{ + compiler->compiler->set_decoration(id, static_cast(decoration), argument); +} + +void spvc_compiler_set_decoration_string(spvc_compiler compiler, SpvId id, SpvDecoration decoration, + const char *argument) +{ + compiler->compiler->set_decoration_string(id, static_cast(decoration), argument); +} + +void spvc_compiler_set_name(spvc_compiler compiler, SpvId id, const char *argument) +{ + compiler->compiler->set_name(id, argument); +} + +void spvc_compiler_set_member_decoration(spvc_compiler compiler, spvc_type_id id, unsigned member_index, + SpvDecoration decoration, unsigned argument) +{ + compiler->compiler->set_member_decoration(id, member_index, static_cast(decoration), argument); +} + +void spvc_compiler_set_member_decoration_string(spvc_compiler compiler, spvc_type_id id, unsigned member_index, + SpvDecoration decoration, const char *argument) +{ + compiler->compiler->set_member_decoration_string(id, member_index, static_cast(decoration), + argument); +} + +void spvc_compiler_set_member_name(spvc_compiler compiler, spvc_type_id id, unsigned member_index, const char *argument) +{ + compiler->compiler->set_member_name(id, member_index, argument); +} + +void spvc_compiler_unset_decoration(spvc_compiler compiler, SpvId id, SpvDecoration decoration) +{ + compiler->compiler->unset_decoration(id, static_cast(decoration)); +} + +void spvc_compiler_unset_member_decoration(spvc_compiler compiler, spvc_type_id id, unsigned member_index, + SpvDecoration decoration) +{ + compiler->compiler->unset_member_decoration(id, member_index, static_cast(decoration)); +} + +spvc_bool spvc_compiler_has_decoration(spvc_compiler compiler, SpvId id, SpvDecoration decoration) +{ + return compiler->compiler->has_decoration(id, static_cast(decoration)) ? SPVC_TRUE : SPVC_FALSE; +} + +spvc_bool spvc_compiler_has_member_decoration(spvc_compiler compiler, spvc_type_id id, unsigned member_index, + SpvDecoration decoration) +{ + return compiler->compiler->has_member_decoration(id, member_index, static_cast(decoration)) ? + SPVC_TRUE : + SPVC_FALSE; +} + +const char *spvc_compiler_get_name(spvc_compiler compiler, SpvId id) +{ + return compiler->compiler->get_name(id).c_str(); +} + +unsigned spvc_compiler_get_decoration(spvc_compiler compiler, SpvId id, SpvDecoration decoration) +{ + return compiler->compiler->get_decoration(id, static_cast(decoration)); +} + +const char *spvc_compiler_get_decoration_string(spvc_compiler compiler, SpvId id, SpvDecoration decoration) +{ + return compiler->compiler->get_decoration_string(id, static_cast(decoration)).c_str(); +} + +unsigned spvc_compiler_get_member_decoration(spvc_compiler compiler, spvc_type_id id, unsigned member_index, + SpvDecoration decoration) +{ + return compiler->compiler->get_member_decoration(id, member_index, static_cast(decoration)); +} + +const char *spvc_compiler_get_member_decoration_string(spvc_compiler compiler, spvc_type_id id, unsigned member_index, + SpvDecoration decoration) +{ + return compiler->compiler->get_member_decoration_string(id, member_index, static_cast(decoration)) + .c_str(); +} + +const char *spvc_compiler_get_member_name(spvc_compiler compiler, spvc_type_id id, unsigned member_index) +{ + return compiler->compiler->get_member_name(id, member_index).c_str(); +} + +spvc_result spvc_compiler_get_entry_points(spvc_compiler compiler, const spvc_entry_point **entry_points, + size_t *num_entry_points) +{ + SPVC_BEGIN_SAFE_SCOPE + { + auto entries = compiler->compiler->get_entry_points_and_stages(); + SmallVector translated; + translated.reserve(entries.size()); + + for (auto &entry : entries) + { + spvc_entry_point new_entry; + new_entry.execution_model = static_cast(entry.execution_model); + new_entry.name = compiler->context->allocate_name(entry.name); + if (!new_entry.name) + { + compiler->context->report_error("Out of memory."); + return SPVC_ERROR_OUT_OF_MEMORY; + } + translated.push_back(new_entry); + } + + auto ptr = spvc_allocate>(); + ptr->buffer = std::move(translated); + *entry_points = ptr->buffer.data(); + *num_entry_points = ptr->buffer.size(); + compiler->context->allocations.push_back(std::move(ptr)); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_OUT_OF_MEMORY) + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_set_entry_point(spvc_compiler compiler, const char *name, SpvExecutionModel model) +{ + SPVC_BEGIN_SAFE_SCOPE + { + compiler->compiler->set_entry_point(name, static_cast(model)); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_INVALID_ARGUMENT) + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_rename_entry_point(spvc_compiler compiler, const char *old_name, const char *new_name, + SpvExecutionModel model) +{ + SPVC_BEGIN_SAFE_SCOPE + { + compiler->compiler->rename_entry_point(old_name, new_name, static_cast(model)); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_INVALID_ARGUMENT) + return SPVC_SUCCESS; +} + +const char *spvc_compiler_get_cleansed_entry_point_name(spvc_compiler compiler, const char *name, + SpvExecutionModel model) +{ + SPVC_BEGIN_SAFE_SCOPE + { + auto cleansed_name = + compiler->compiler->get_cleansed_entry_point_name(name, static_cast(model)); + return compiler->context->allocate_name(cleansed_name); + } + SPVC_END_SAFE_SCOPE(compiler->context, nullptr) +} + +void spvc_compiler_set_execution_mode(spvc_compiler compiler, SpvExecutionMode mode) +{ + compiler->compiler->set_execution_mode(static_cast(mode)); +} + +void spvc_compiler_set_execution_mode_with_arguments(spvc_compiler compiler, SpvExecutionMode mode, unsigned arg0, + unsigned arg1, + unsigned arg2) +{ + compiler->compiler->set_execution_mode(static_cast(mode), arg0, arg1, arg2); +} + +void spvc_compiler_unset_execution_mode(spvc_compiler compiler, SpvExecutionMode mode) +{ + compiler->compiler->unset_execution_mode(static_cast(mode)); +} + +spvc_result spvc_compiler_get_execution_modes(spvc_compiler compiler, const SpvExecutionMode **modes, size_t *num_modes) +{ + SPVC_BEGIN_SAFE_SCOPE + { + auto ptr = spvc_allocate>(); + + compiler->compiler->get_execution_mode_bitset().for_each_bit( + [&](uint32_t bit) { ptr->buffer.push_back(static_cast(bit)); }); + + *modes = ptr->buffer.data(); + *num_modes = ptr->buffer.size(); + compiler->context->allocations.push_back(std::move(ptr)); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_OUT_OF_MEMORY) + return SPVC_SUCCESS; +} + +unsigned spvc_compiler_get_execution_mode_argument(spvc_compiler compiler, SpvExecutionMode mode) +{ + return compiler->compiler->get_execution_mode_argument(static_cast(mode)); +} + +unsigned spvc_compiler_get_execution_mode_argument_by_index(spvc_compiler compiler, SpvExecutionMode mode, + unsigned index) +{ + return compiler->compiler->get_execution_mode_argument(static_cast(mode), index); +} + +SpvExecutionModel spvc_compiler_get_execution_model(spvc_compiler compiler) +{ + return static_cast(compiler->compiler->get_execution_model()); +} + +void spvc_compiler_update_active_builtins(spvc_compiler compiler) +{ + compiler->compiler->update_active_builtins(); +} + +spvc_bool spvc_compiler_has_active_builtin(spvc_compiler compiler, SpvBuiltIn builtin, SpvStorageClass storage) +{ + return compiler->compiler->has_active_builtin(static_cast(builtin), static_cast(storage)) ? + SPVC_TRUE : + SPVC_FALSE; +} + +spvc_type spvc_compiler_get_type_handle(spvc_compiler compiler, spvc_type_id id) +{ + // Should only throw if an intentionally garbage ID is passed, but the IDs are not type-safe. + SPVC_BEGIN_SAFE_SCOPE + { + return static_cast(&compiler->compiler->get_type(id)); + } + SPVC_END_SAFE_SCOPE(compiler->context, nullptr) +} + +spvc_type_id spvc_type_get_base_type_id(spvc_type type) +{ + return type->self; +} + +static spvc_basetype convert_basetype(SPIRType::BaseType type) +{ + // For now the enums match up. + return static_cast(type); +} + +spvc_basetype spvc_type_get_basetype(spvc_type type) +{ + return convert_basetype(type->basetype); +} + +unsigned spvc_type_get_bit_width(spvc_type type) +{ + return type->width; +} + +unsigned spvc_type_get_vector_size(spvc_type type) +{ + return type->vecsize; +} + +unsigned spvc_type_get_columns(spvc_type type) +{ + return type->columns; +} + +unsigned spvc_type_get_num_array_dimensions(spvc_type type) +{ + return unsigned(type->array.size()); +} + +spvc_bool spvc_type_array_dimension_is_literal(spvc_type type, unsigned dimension) +{ + return type->array_size_literal[dimension] ? SPVC_TRUE : SPVC_FALSE; +} + +SpvId spvc_type_get_array_dimension(spvc_type type, unsigned dimension) +{ + return type->array[dimension]; +} + +unsigned spvc_type_get_num_member_types(spvc_type type) +{ + return unsigned(type->member_types.size()); +} + +spvc_type_id spvc_type_get_member_type(spvc_type type, unsigned index) +{ + return type->member_types[index]; +} + +SpvStorageClass spvc_type_get_storage_class(spvc_type type) +{ + return static_cast(type->storage); +} + +// Image type query. +spvc_type_id spvc_type_get_image_sampled_type(spvc_type type) +{ + return type->image.type; +} + +SpvDim spvc_type_get_image_dimension(spvc_type type) +{ + return static_cast(type->image.dim); +} + +spvc_bool spvc_type_get_image_is_depth(spvc_type type) +{ + return type->image.depth ? SPVC_TRUE : SPVC_FALSE; +} + +spvc_bool spvc_type_get_image_arrayed(spvc_type type) +{ + return type->image.arrayed ? SPVC_TRUE : SPVC_FALSE; +} + +spvc_bool spvc_type_get_image_multisampled(spvc_type type) +{ + return type->image.ms ? SPVC_TRUE : SPVC_FALSE; +} + +spvc_bool spvc_type_get_image_is_storage(spvc_type type) +{ + return type->image.sampled == 2 ? SPVC_TRUE : SPVC_FALSE; +} + +SpvImageFormat spvc_type_get_image_storage_format(spvc_type type) +{ + return static_cast(static_cast(type)->image.format); +} + +SpvAccessQualifier spvc_type_get_image_access_qualifier(spvc_type type) +{ + return static_cast(static_cast(type)->image.access); +} + +spvc_result spvc_compiler_get_declared_struct_size(spvc_compiler compiler, spvc_type struct_type, size_t *size) +{ + SPVC_BEGIN_SAFE_SCOPE + { + *size = compiler->compiler->get_declared_struct_size(*static_cast(struct_type)); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_INVALID_ARGUMENT) + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_get_declared_struct_size_runtime_array(spvc_compiler compiler, spvc_type struct_type, + size_t array_size, size_t *size) +{ + SPVC_BEGIN_SAFE_SCOPE + { + *size = compiler->compiler->get_declared_struct_size_runtime_array(*static_cast(struct_type), + array_size); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_INVALID_ARGUMENT) + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_get_declared_struct_member_size(spvc_compiler compiler, spvc_type struct_type, unsigned index, size_t *size) +{ + SPVC_BEGIN_SAFE_SCOPE + { + *size = compiler->compiler->get_declared_struct_member_size(*static_cast(struct_type), index); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_INVALID_ARGUMENT) + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_type_struct_member_offset(spvc_compiler compiler, spvc_type type, unsigned index, unsigned *offset) +{ + SPVC_BEGIN_SAFE_SCOPE + { + *offset = compiler->compiler->type_struct_member_offset(*static_cast(type), index); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_INVALID_ARGUMENT) + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_type_struct_member_array_stride(spvc_compiler compiler, spvc_type type, unsigned index, unsigned *stride) +{ + SPVC_BEGIN_SAFE_SCOPE + { + *stride = compiler->compiler->type_struct_member_array_stride(*static_cast(type), index); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_INVALID_ARGUMENT) + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_type_struct_member_matrix_stride(spvc_compiler compiler, spvc_type type, unsigned index, unsigned *stride) +{ + SPVC_BEGIN_SAFE_SCOPE + { + *stride = compiler->compiler->type_struct_member_matrix_stride(*static_cast(type), index); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_INVALID_ARGUMENT) + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_build_dummy_sampler_for_combined_images(spvc_compiler compiler, spvc_variable_id *id) +{ + SPVC_BEGIN_SAFE_SCOPE + { + *id = compiler->compiler->build_dummy_sampler_for_combined_images(); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_INVALID_ARGUMENT) + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_build_combined_image_samplers(spvc_compiler compiler) +{ + SPVC_BEGIN_SAFE_SCOPE + { + compiler->compiler->build_combined_image_samplers(); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_UNSUPPORTED_SPIRV) + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_get_combined_image_samplers(spvc_compiler compiler, + const spvc_combined_image_sampler **samplers, + size_t *num_samplers) +{ + SPVC_BEGIN_SAFE_SCOPE + { + auto combined = compiler->compiler->get_combined_image_samplers(); + SmallVector translated; + translated.reserve(combined.size()); + for (auto &c : combined) + { + spvc_combined_image_sampler trans = { c.combined_id, c.image_id, c.sampler_id }; + translated.push_back(trans); + } + + auto ptr = spvc_allocate>(); + ptr->buffer = std::move(translated); + *samplers = ptr->buffer.data(); + *num_samplers = ptr->buffer.size(); + compiler->context->allocations.push_back(std::move(ptr)); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_OUT_OF_MEMORY) + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_get_specialization_constants(spvc_compiler compiler, + const spvc_specialization_constant **constants, + size_t *num_constants) +{ + SPVC_BEGIN_SAFE_SCOPE + { + auto spec_constants = compiler->compiler->get_specialization_constants(); + SmallVector translated; + translated.reserve(spec_constants.size()); + for (auto &c : spec_constants) + { + spvc_specialization_constant trans = { c.id, c.constant_id }; + translated.push_back(trans); + } + + auto ptr = spvc_allocate>(); + ptr->buffer = std::move(translated); + *constants = ptr->buffer.data(); + *num_constants = ptr->buffer.size(); + compiler->context->allocations.push_back(std::move(ptr)); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_OUT_OF_MEMORY) + return SPVC_SUCCESS; +} + +spvc_constant spvc_compiler_get_constant_handle(spvc_compiler compiler, spvc_variable_id id) +{ + SPVC_BEGIN_SAFE_SCOPE + { + return static_cast(&compiler->compiler->get_constant(id)); + } + SPVC_END_SAFE_SCOPE(compiler->context, nullptr) +} + +spvc_constant_id spvc_compiler_get_work_group_size_specialization_constants(spvc_compiler compiler, + spvc_specialization_constant *x, + spvc_specialization_constant *y, + spvc_specialization_constant *z) +{ + SpecializationConstant tmpx; + SpecializationConstant tmpy; + SpecializationConstant tmpz; + spvc_constant_id ret = compiler->compiler->get_work_group_size_specialization_constants(tmpx, tmpy, tmpz); + x->id = tmpx.id; + x->constant_id = tmpx.constant_id; + y->id = tmpy.id; + y->constant_id = tmpy.constant_id; + z->id = tmpz.id; + z->constant_id = tmpz.constant_id; + return ret; +} + +spvc_result spvc_compiler_get_active_buffer_ranges(spvc_compiler compiler, + spvc_variable_id id, + const spvc_buffer_range **ranges, + size_t *num_ranges) +{ + SPVC_BEGIN_SAFE_SCOPE + { + auto active_ranges = compiler->compiler->get_active_buffer_ranges(id); + SmallVector translated; + translated.reserve(active_ranges.size()); + for (auto &r : active_ranges) + { + spvc_buffer_range trans = { r.index, r.offset, r.range }; + translated.push_back(trans); + } + + auto ptr = spvc_allocate>(); + ptr->buffer = std::move(translated); + *ranges = ptr->buffer.data(); + *num_ranges = ptr->buffer.size(); + compiler->context->allocations.push_back(std::move(ptr)); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_OUT_OF_MEMORY) + return SPVC_SUCCESS; +} + +float spvc_constant_get_scalar_fp16(spvc_constant constant, unsigned column, unsigned row) +{ + return constant->scalar_f16(column, row); +} + +float spvc_constant_get_scalar_fp32(spvc_constant constant, unsigned column, unsigned row) +{ + return constant->scalar_f32(column, row); +} + +double spvc_constant_get_scalar_fp64(spvc_constant constant, unsigned column, unsigned row) +{ + return constant->scalar_f64(column, row); +} + +unsigned spvc_constant_get_scalar_u32(spvc_constant constant, unsigned column, unsigned row) +{ + return constant->scalar(column, row); +} + +int spvc_constant_get_scalar_i32(spvc_constant constant, unsigned column, unsigned row) +{ + return constant->scalar_i32(column, row); +} + +unsigned long long spvc_constant_get_scalar_u64(spvc_constant constant, unsigned column, unsigned row) +{ + return constant->scalar_u64(column, row); +} + +long long spvc_constant_get_scalar_i64(spvc_constant constant, unsigned column, unsigned row) +{ + return constant->scalar_i64(column, row); +} + +unsigned spvc_constant_get_scalar_u16(spvc_constant constant, unsigned column, unsigned row) +{ + return constant->scalar_u16(column, row); +} + +int spvc_constant_get_scalar_i16(spvc_constant constant, unsigned column, unsigned row) +{ + return constant->scalar_i16(column, row); +} + +unsigned spvc_constant_get_scalar_u8(spvc_constant constant, unsigned column, unsigned row) +{ + return constant->scalar_u8(column, row); +} + +int spvc_constant_get_scalar_i8(spvc_constant constant, unsigned column, unsigned row) +{ + return constant->scalar_i8(column, row); +} + +void spvc_constant_get_subconstants(spvc_constant constant, const spvc_constant_id **constituents, size_t *count) +{ + static_assert(sizeof(spvc_constant_id) == sizeof(constant->subconstants.front()), "ID size is not consistent."); + *constituents = reinterpret_cast(constant->subconstants.data()); + *count = constant->subconstants.size(); +} + +spvc_type_id spvc_constant_get_type(spvc_constant constant) +{ + return constant->constant_type; +} + +void spvc_constant_set_scalar_fp16(spvc_constant constant, unsigned column, unsigned row, unsigned short value) +{ + constant->m.c[column].r[row].u32 = value; +} + +void spvc_constant_set_scalar_fp32(spvc_constant constant, unsigned column, unsigned row, float value) +{ + constant->m.c[column].r[row].f32 = value; +} + +void spvc_constant_set_scalar_fp64(spvc_constant constant, unsigned column, unsigned row, double value) +{ + constant->m.c[column].r[row].f64 = value; +} + +void spvc_constant_set_scalar_u32(spvc_constant constant, unsigned column, unsigned row, unsigned value) +{ + constant->m.c[column].r[row].u32 = value; +} + +void spvc_constant_set_scalar_i32(spvc_constant constant, unsigned column, unsigned row, int value) +{ + constant->m.c[column].r[row].i32 = value; +} + +void spvc_constant_set_scalar_u64(spvc_constant constant, unsigned column, unsigned row, unsigned long long value) +{ + constant->m.c[column].r[row].u64 = value; +} + +void spvc_constant_set_scalar_i64(spvc_constant constant, unsigned column, unsigned row, long long value) +{ + constant->m.c[column].r[row].i64 = value; +} + +void spvc_constant_set_scalar_u16(spvc_constant constant, unsigned column, unsigned row, unsigned short value) +{ + constant->m.c[column].r[row].u32 = uint32_t(value); +} + +void spvc_constant_set_scalar_i16(spvc_constant constant, unsigned column, unsigned row, signed short value) +{ + constant->m.c[column].r[row].u32 = uint32_t(value); +} + +void spvc_constant_set_scalar_u8(spvc_constant constant, unsigned column, unsigned row, unsigned char value) +{ + constant->m.c[column].r[row].u32 = uint32_t(value); +} + +void spvc_constant_set_scalar_i8(spvc_constant constant, unsigned column, unsigned row, signed char value) +{ + constant->m.c[column].r[row].u32 = uint32_t(value); +} + +spvc_bool spvc_compiler_get_binary_offset_for_decoration(spvc_compiler compiler, spvc_variable_id id, + SpvDecoration decoration, + unsigned *word_offset) +{ + uint32_t off = 0; + bool ret = compiler->compiler->get_binary_offset_for_decoration(id, static_cast(decoration), off); + if (ret) + { + *word_offset = off; + return SPVC_TRUE; + } + else + return SPVC_FALSE; +} + +spvc_bool spvc_compiler_buffer_is_hlsl_counter_buffer(spvc_compiler compiler, spvc_variable_id id) +{ + return compiler->compiler->buffer_is_hlsl_counter_buffer(id) ? SPVC_TRUE : SPVC_FALSE; +} + +spvc_bool spvc_compiler_buffer_get_hlsl_counter_buffer(spvc_compiler compiler, spvc_variable_id id, + spvc_variable_id *counter_id) +{ + uint32_t buffer; + bool ret = compiler->compiler->buffer_get_hlsl_counter_buffer(id, buffer); + if (ret) + { + *counter_id = buffer; + return SPVC_TRUE; + } + else + return SPVC_FALSE; +} + +spvc_result spvc_compiler_get_declared_capabilities(spvc_compiler compiler, const SpvCapability **capabilities, + size_t *num_capabilities) +{ + auto &caps = compiler->compiler->get_declared_capabilities(); + static_assert(sizeof(SpvCapability) == sizeof(Capability), "Enum size mismatch."); + *capabilities = reinterpret_cast(caps.data()); + *num_capabilities = caps.size(); + return SPVC_SUCCESS; +} + +spvc_result spvc_compiler_get_declared_extensions(spvc_compiler compiler, const char ***extensions, + size_t *num_extensions) +{ + SPVC_BEGIN_SAFE_SCOPE + { + auto &exts = compiler->compiler->get_declared_extensions(); + SmallVector duped; + duped.reserve(exts.size()); + for (auto &ext : exts) + duped.push_back(compiler->context->allocate_name(ext)); + + auto ptr = spvc_allocate>(); + ptr->buffer = std::move(duped); + *extensions = ptr->buffer.data(); + *num_extensions = ptr->buffer.size(); + compiler->context->allocations.push_back(std::move(ptr)); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_OUT_OF_MEMORY) + return SPVC_SUCCESS; +} + +const char *spvc_compiler_get_remapped_declared_block_name(spvc_compiler compiler, spvc_variable_id id) +{ + SPVC_BEGIN_SAFE_SCOPE + { + auto name = compiler->compiler->get_remapped_declared_block_name(id); + return compiler->context->allocate_name(name); + } + SPVC_END_SAFE_SCOPE(compiler->context, nullptr) +} + +spvc_result spvc_compiler_get_buffer_block_decorations(spvc_compiler compiler, spvc_variable_id id, + const SpvDecoration **decorations, size_t *num_decorations) +{ + SPVC_BEGIN_SAFE_SCOPE + { + auto flags = compiler->compiler->get_buffer_block_flags(id); + auto bitset = spvc_allocate>(); + + flags.for_each_bit([&](uint32_t bit) { bitset->buffer.push_back(static_cast(bit)); }); + + *decorations = bitset->buffer.data(); + *num_decorations = bitset->buffer.size(); + compiler->context->allocations.push_back(std::move(bitset)); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_INVALID_ARGUMENT) + return SPVC_SUCCESS; +} + +unsigned spvc_msl_get_aux_buffer_struct_version(void) +{ + return SPVC_MSL_AUX_BUFFER_STRUCT_VERSION; +} + +void spvc_msl_vertex_attribute_init(spvc_msl_vertex_attribute *attr) +{ +#if SPIRV_CROSS_C_API_MSL + // Crude, but works. + MSLShaderInterfaceVariable attr_default; + attr->location = attr_default.location; + attr->format = static_cast(attr_default.format); + attr->builtin = static_cast(attr_default.builtin); +#else + memset(attr, 0, sizeof(*attr)); +#endif +} + +void spvc_msl_shader_interface_var_init(spvc_msl_shader_interface_var *var) +{ +#if SPIRV_CROSS_C_API_MSL + MSLShaderInterfaceVariable var_default; + var->location = var_default.location; + var->format = static_cast(var_default.format); + var->builtin = static_cast(var_default.builtin); + var->vecsize = var_default.vecsize; +#else + memset(var, 0, sizeof(*var)); +#endif +} + +void spvc_msl_shader_input_init(spvc_msl_shader_input *input) +{ + spvc_msl_shader_interface_var_init(input); +} + +void spvc_msl_shader_interface_var_init_2(spvc_msl_shader_interface_var_2 *var) +{ +#if SPIRV_CROSS_C_API_MSL + MSLShaderInterfaceVariable var_default; + var->location = var_default.location; + var->format = static_cast(var_default.format); + var->builtin = static_cast(var_default.builtin); + var->vecsize = var_default.vecsize; + var->rate = static_cast(var_default.rate); +#else + memset(var, 0, sizeof(*var)); +#endif +} + +void spvc_msl_resource_binding_init(spvc_msl_resource_binding *binding) +{ +#if SPIRV_CROSS_C_API_MSL + MSLResourceBinding binding_default; + binding->desc_set = binding_default.desc_set; + binding->binding = binding_default.binding; + binding->msl_buffer = binding_default.msl_buffer; + binding->msl_texture = binding_default.msl_texture; + binding->msl_sampler = binding_default.msl_sampler; + binding->stage = static_cast(binding_default.stage); +#else + memset(binding, 0, sizeof(*binding)); +#endif +} + +void spvc_msl_resource_binding_init_2(spvc_msl_resource_binding_2 *binding) +{ +#if SPIRV_CROSS_C_API_MSL + MSLResourceBinding binding_default; + binding->desc_set = binding_default.desc_set; + binding->binding = binding_default.binding; + binding->msl_buffer = binding_default.msl_buffer; + binding->msl_texture = binding_default.msl_texture; + binding->msl_sampler = binding_default.msl_sampler; + binding->stage = static_cast(binding_default.stage); + binding->count = 0; +#else + memset(binding, 0, sizeof(*binding)); +#endif +} + +void spvc_hlsl_resource_binding_init(spvc_hlsl_resource_binding *binding) +{ +#if SPIRV_CROSS_C_API_HLSL + HLSLResourceBinding binding_default; + binding->desc_set = binding_default.desc_set; + binding->binding = binding_default.binding; + binding->cbv.register_binding = binding_default.cbv.register_binding; + binding->cbv.register_space = binding_default.cbv.register_space; + binding->srv.register_binding = binding_default.srv.register_binding; + binding->srv.register_space = binding_default.srv.register_space; + binding->uav.register_binding = binding_default.uav.register_binding; + binding->uav.register_space = binding_default.uav.register_space; + binding->sampler.register_binding = binding_default.sampler.register_binding; + binding->sampler.register_space = binding_default.sampler.register_space; + binding->stage = static_cast(binding_default.stage); +#else + memset(binding, 0, sizeof(*binding)); +#endif +} + +void spvc_msl_constexpr_sampler_init(spvc_msl_constexpr_sampler *sampler) +{ +#if SPIRV_CROSS_C_API_MSL + MSLConstexprSampler defaults; + sampler->anisotropy_enable = defaults.anisotropy_enable ? SPVC_TRUE : SPVC_FALSE; + sampler->border_color = static_cast(defaults.border_color); + sampler->compare_enable = defaults.compare_enable ? SPVC_TRUE : SPVC_FALSE; + sampler->coord = static_cast(defaults.coord); + sampler->compare_func = static_cast(defaults.compare_func); + sampler->lod_clamp_enable = defaults.lod_clamp_enable ? SPVC_TRUE : SPVC_FALSE; + sampler->lod_clamp_max = defaults.lod_clamp_max; + sampler->lod_clamp_min = defaults.lod_clamp_min; + sampler->mag_filter = static_cast(defaults.mag_filter); + sampler->min_filter = static_cast(defaults.min_filter); + sampler->mip_filter = static_cast(defaults.mip_filter); + sampler->max_anisotropy = defaults.max_anisotropy; + sampler->s_address = static_cast(defaults.s_address); + sampler->t_address = static_cast(defaults.t_address); + sampler->r_address = static_cast(defaults.r_address); +#else + memset(sampler, 0, sizeof(*sampler)); +#endif +} + +void spvc_msl_sampler_ycbcr_conversion_init(spvc_msl_sampler_ycbcr_conversion *conv) +{ +#if SPIRV_CROSS_C_API_MSL + MSLConstexprSampler defaults; + conv->planes = defaults.planes; + conv->resolution = static_cast(defaults.resolution); + conv->chroma_filter = static_cast(defaults.chroma_filter); + conv->x_chroma_offset = static_cast(defaults.x_chroma_offset); + conv->y_chroma_offset = static_cast(defaults.y_chroma_offset); + for (int i = 0; i < 4; i++) + conv->swizzle[i] = static_cast(defaults.swizzle[i]); + conv->ycbcr_model = static_cast(defaults.ycbcr_model); + conv->ycbcr_range = static_cast(defaults.ycbcr_range); +#else + memset(conv, 0, sizeof(*conv)); +#endif +} + +unsigned spvc_compiler_get_current_id_bound(spvc_compiler compiler) +{ + return compiler->compiler->get_current_id_bound(); +} + +void spvc_get_version(unsigned *major, unsigned *minor, unsigned *patch) +{ + *major = SPVC_C_API_VERSION_MAJOR; + *minor = SPVC_C_API_VERSION_MINOR; + *patch = SPVC_C_API_VERSION_PATCH; +} + +const char *spvc_get_commit_revision_and_timestamp(void) +{ +#ifdef HAVE_SPIRV_CROSS_GIT_VERSION + return SPIRV_CROSS_GIT_REVISION; +#else + return ""; +#endif +} + +#ifdef _MSC_VER +#pragma warning(pop) +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_c.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_c.h new file mode 100644 index 0000000000..30f1c459cc --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_c.h @@ -0,0 +1,1130 @@ +/* + * Copyright 2019-2021 Hans-Kristian Arntzen + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#ifndef SPIRV_CROSS_C_API_H +#define SPIRV_CROSS_C_API_H + +#include +#include "spirv.h" + +/* + * C89-compatible wrapper for SPIRV-Cross' API. + * Documentation here is sparse unless the behavior does not map 1:1 with C++ API. + * It is recommended to look at the canonical C++ API for more detailed information. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Bumped if ABI or API breaks backwards compatibility. */ +#define SPVC_C_API_VERSION_MAJOR 0 +/* Bumped if APIs or enumerations are added in a backwards compatible way. */ +#define SPVC_C_API_VERSION_MINOR 68 +/* Bumped if internal implementation details change. */ +#define SPVC_C_API_VERSION_PATCH 0 + +#if !defined(SPVC_PUBLIC_API) +#if defined(SPVC_EXPORT_SYMBOLS) +/* Exports symbols. Standard C calling convention is used. */ +#if defined(__GNUC__) +#define SPVC_PUBLIC_API __attribute__((visibility("default"))) +#elif defined(_MSC_VER) +#define SPVC_PUBLIC_API __declspec(dllexport) +#else +#define SPVC_PUBLIC_API +#endif +#else +#define SPVC_PUBLIC_API +#endif +#endif + +/* + * Gets the SPVC_C_API_VERSION_* used to build this library. + * Can be used to check for ABI mismatch if so-versioning did not catch it. + */ +SPVC_PUBLIC_API void spvc_get_version(unsigned *major, unsigned *minor, unsigned *patch); + +/* Gets a human readable version string to identify which commit a particular binary was created from. */ +SPVC_PUBLIC_API const char *spvc_get_commit_revision_and_timestamp(void); + +/* These types are opaque to the user. */ +typedef struct spvc_context_s *spvc_context; +typedef struct spvc_parsed_ir_s *spvc_parsed_ir; +typedef struct spvc_compiler_s *spvc_compiler; +typedef struct spvc_compiler_options_s *spvc_compiler_options; +typedef struct spvc_resources_s *spvc_resources; +struct spvc_type_s; +typedef const struct spvc_type_s *spvc_type; +typedef struct spvc_constant_s *spvc_constant; +struct spvc_set_s; +typedef const struct spvc_set_s *spvc_set; + +/* + * Shallow typedefs. All SPIR-V IDs are plain 32-bit numbers, but this helps communicate which data is used. + * Maps to a SPIRType. + */ +typedef SpvId spvc_type_id; +/* Maps to a SPIRVariable. */ +typedef SpvId spvc_variable_id; +/* Maps to a SPIRConstant. */ +typedef SpvId spvc_constant_id; + +/* See C++ API. */ +typedef struct spvc_reflected_resource +{ + spvc_variable_id id; + spvc_type_id base_type_id; + spvc_type_id type_id; + const char *name; +} spvc_reflected_resource; + +typedef struct spvc_reflected_builtin_resource +{ + SpvBuiltIn builtin; + spvc_type_id value_type_id; + spvc_reflected_resource resource; +} spvc_reflected_builtin_resource; + +/* See C++ API. */ +typedef struct spvc_entry_point +{ + SpvExecutionModel execution_model; + const char *name; +} spvc_entry_point; + +/* See C++ API. */ +typedef struct spvc_combined_image_sampler +{ + spvc_variable_id combined_id; + spvc_variable_id image_id; + spvc_variable_id sampler_id; +} spvc_combined_image_sampler; + +/* See C++ API. */ +typedef struct spvc_specialization_constant +{ + spvc_constant_id id; + unsigned constant_id; +} spvc_specialization_constant; + +/* See C++ API. */ +typedef struct spvc_buffer_range +{ + unsigned index; + size_t offset; + size_t range; +} spvc_buffer_range; + +/* See C++ API. */ +typedef struct spvc_hlsl_root_constants +{ + unsigned start; + unsigned end; + unsigned binding; + unsigned space; +} spvc_hlsl_root_constants; + +/* See C++ API. */ +typedef struct spvc_hlsl_vertex_attribute_remap +{ + unsigned location; + const char *semantic; +} spvc_hlsl_vertex_attribute_remap; + +/* + * Be compatible with non-C99 compilers, which do not have stdbool. + * Only recent MSVC compilers supports this for example, and ideally SPIRV-Cross should be linkable + * from a wide range of compilers in its C wrapper. + */ +typedef unsigned char spvc_bool; +#define SPVC_TRUE ((spvc_bool)1) +#define SPVC_FALSE ((spvc_bool)0) + +typedef enum spvc_result +{ + /* Success. */ + SPVC_SUCCESS = 0, + + /* The SPIR-V is invalid. Should have been caught by validation ideally. */ + SPVC_ERROR_INVALID_SPIRV = -1, + + /* The SPIR-V might be valid or invalid, but SPIRV-Cross currently cannot correctly translate this to your target language. */ + SPVC_ERROR_UNSUPPORTED_SPIRV = -2, + + /* If for some reason we hit this, new or malloc failed. */ + SPVC_ERROR_OUT_OF_MEMORY = -3, + + /* Invalid API argument. */ + SPVC_ERROR_INVALID_ARGUMENT = -4, + + SPVC_ERROR_INT_MAX = 0x7fffffff +} spvc_result; + +typedef enum spvc_capture_mode +{ + /* The Parsed IR payload will be copied, and the handle can be reused to create other compiler instances. */ + SPVC_CAPTURE_MODE_COPY = 0, + + /* + * The payload will now be owned by the compiler. + * parsed_ir should now be considered a dead blob and must not be used further. + * This is optimal for performance and should be the go-to option. + */ + SPVC_CAPTURE_MODE_TAKE_OWNERSHIP = 1, + + SPVC_CAPTURE_MODE_INT_MAX = 0x7fffffff +} spvc_capture_mode; + +typedef enum spvc_backend +{ + /* This backend can only perform reflection, no compiler options are supported. Maps to spirv_cross::Compiler. */ + SPVC_BACKEND_NONE = 0, + SPVC_BACKEND_GLSL = 1, /* spirv_cross::CompilerGLSL */ + SPVC_BACKEND_HLSL = 2, /* CompilerHLSL */ + SPVC_BACKEND_MSL = 3, /* CompilerMSL */ + SPVC_BACKEND_CPP = 4, /* CompilerCPP */ + SPVC_BACKEND_JSON = 5, /* CompilerReflection w/ JSON backend */ + SPVC_BACKEND_INT_MAX = 0x7fffffff +} spvc_backend; + +/* Maps to C++ API. */ +typedef enum spvc_resource_type +{ + SPVC_RESOURCE_TYPE_UNKNOWN = 0, + SPVC_RESOURCE_TYPE_UNIFORM_BUFFER = 1, + SPVC_RESOURCE_TYPE_STORAGE_BUFFER = 2, + SPVC_RESOURCE_TYPE_STAGE_INPUT = 3, + SPVC_RESOURCE_TYPE_STAGE_OUTPUT = 4, + SPVC_RESOURCE_TYPE_SUBPASS_INPUT = 5, + SPVC_RESOURCE_TYPE_STORAGE_IMAGE = 6, + SPVC_RESOURCE_TYPE_SAMPLED_IMAGE = 7, + SPVC_RESOURCE_TYPE_ATOMIC_COUNTER = 8, + SPVC_RESOURCE_TYPE_PUSH_CONSTANT = 9, + SPVC_RESOURCE_TYPE_SEPARATE_IMAGE = 10, + SPVC_RESOURCE_TYPE_SEPARATE_SAMPLERS = 11, + SPVC_RESOURCE_TYPE_ACCELERATION_STRUCTURE = 12, + SPVC_RESOURCE_TYPE_RAY_QUERY = 13, + SPVC_RESOURCE_TYPE_SHADER_RECORD_BUFFER = 14, + SPVC_RESOURCE_TYPE_GL_PLAIN_UNIFORM = 15, + SPVC_RESOURCE_TYPE_TENSOR = 16, + SPVC_RESOURCE_TYPE_INT_MAX = 0x7fffffff +} spvc_resource_type; + +typedef enum spvc_builtin_resource_type +{ + SPVC_BUILTIN_RESOURCE_TYPE_UNKNOWN = 0, + SPVC_BUILTIN_RESOURCE_TYPE_STAGE_INPUT = 1, + SPVC_BUILTIN_RESOURCE_TYPE_STAGE_OUTPUT = 2, + SPVC_BUILTIN_RESOURCE_TYPE_INT_MAX = 0x7fffffff +} spvc_builtin_resource_type; + +/* Maps to spirv_cross::SPIRType::BaseType. */ +typedef enum spvc_basetype +{ + SPVC_BASETYPE_UNKNOWN = 0, + SPVC_BASETYPE_VOID = 1, + SPVC_BASETYPE_BOOLEAN = 2, + SPVC_BASETYPE_INT8 = 3, + SPVC_BASETYPE_UINT8 = 4, + SPVC_BASETYPE_INT16 = 5, + SPVC_BASETYPE_UINT16 = 6, + SPVC_BASETYPE_INT32 = 7, + SPVC_BASETYPE_UINT32 = 8, + SPVC_BASETYPE_INT64 = 9, + SPVC_BASETYPE_UINT64 = 10, + SPVC_BASETYPE_ATOMIC_COUNTER = 11, + SPVC_BASETYPE_FP16 = 12, + SPVC_BASETYPE_FP32 = 13, + SPVC_BASETYPE_FP64 = 14, + SPVC_BASETYPE_STRUCT = 15, + SPVC_BASETYPE_IMAGE = 16, + SPVC_BASETYPE_SAMPLED_IMAGE = 17, + SPVC_BASETYPE_SAMPLER = 18, + SPVC_BASETYPE_ACCELERATION_STRUCTURE = 19, + + SPVC_BASETYPE_INT_MAX = 0x7fffffff +} spvc_basetype; + +#define SPVC_COMPILER_OPTION_COMMON_BIT 0x1000000 +#define SPVC_COMPILER_OPTION_GLSL_BIT 0x2000000 +#define SPVC_COMPILER_OPTION_HLSL_BIT 0x4000000 +#define SPVC_COMPILER_OPTION_MSL_BIT 0x8000000 +#define SPVC_COMPILER_OPTION_LANG_BITS 0x0f000000 +#define SPVC_COMPILER_OPTION_ENUM_BITS 0xffffff + +#define SPVC_MAKE_MSL_VERSION(major, minor, patch) ((major) * 10000 + (minor) * 100 + (patch)) + +/* Maps to C++ API. */ +typedef enum spvc_msl_platform +{ + SPVC_MSL_PLATFORM_IOS = 0, + SPVC_MSL_PLATFORM_MACOS = 1, + SPVC_MSL_PLATFORM_MAX_INT = 0x7fffffff +} spvc_msl_platform; + +/* Maps to C++ API. */ +typedef enum spvc_msl_index_type +{ + SPVC_MSL_INDEX_TYPE_NONE = 0, + SPVC_MSL_INDEX_TYPE_UINT16 = 1, + SPVC_MSL_INDEX_TYPE_UINT32 = 2, + SPVC_MSL_INDEX_TYPE_MAX_INT = 0x7fffffff +} spvc_msl_index_type; + +/* Maps to C++ API. */ +typedef enum spvc_msl_shader_variable_format +{ + SPVC_MSL_SHADER_VARIABLE_FORMAT_OTHER = 0, + SPVC_MSL_SHADER_VARIABLE_FORMAT_UINT8 = 1, + SPVC_MSL_SHADER_VARIABLE_FORMAT_UINT16 = 2, + SPVC_MSL_SHADER_VARIABLE_FORMAT_ANY16 = 3, + SPVC_MSL_SHADER_VARIABLE_FORMAT_ANY32 = 4, + + /* Deprecated names. */ + SPVC_MSL_VERTEX_FORMAT_OTHER = SPVC_MSL_SHADER_VARIABLE_FORMAT_OTHER, + SPVC_MSL_VERTEX_FORMAT_UINT8 = SPVC_MSL_SHADER_VARIABLE_FORMAT_UINT8, + SPVC_MSL_VERTEX_FORMAT_UINT16 = SPVC_MSL_SHADER_VARIABLE_FORMAT_UINT16, + SPVC_MSL_SHADER_INPUT_FORMAT_OTHER = SPVC_MSL_SHADER_VARIABLE_FORMAT_OTHER, + SPVC_MSL_SHADER_INPUT_FORMAT_UINT8 = SPVC_MSL_SHADER_VARIABLE_FORMAT_UINT8, + SPVC_MSL_SHADER_INPUT_FORMAT_UINT16 = SPVC_MSL_SHADER_VARIABLE_FORMAT_UINT16, + SPVC_MSL_SHADER_INPUT_FORMAT_ANY16 = SPVC_MSL_SHADER_VARIABLE_FORMAT_ANY16, + SPVC_MSL_SHADER_INPUT_FORMAT_ANY32 = SPVC_MSL_SHADER_VARIABLE_FORMAT_ANY32, + + + SPVC_MSL_SHADER_INPUT_FORMAT_INT_MAX = 0x7fffffff +} spvc_msl_shader_variable_format, spvc_msl_shader_input_format, spvc_msl_vertex_format; + +/* Maps to C++ API. Deprecated; use spvc_msl_shader_interface_var. */ +typedef struct spvc_msl_vertex_attribute +{ + unsigned location; + + /* Obsolete, do not use. Only lingers on for ABI compatibility. */ + unsigned msl_buffer; + /* Obsolete, do not use. Only lingers on for ABI compatibility. */ + unsigned msl_offset; + /* Obsolete, do not use. Only lingers on for ABI compatibility. */ + unsigned msl_stride; + /* Obsolete, do not use. Only lingers on for ABI compatibility. */ + spvc_bool per_instance; + + spvc_msl_vertex_format format; + SpvBuiltIn builtin; +} spvc_msl_vertex_attribute; + +/* + * Initializes the vertex attribute struct. + */ +SPVC_PUBLIC_API void spvc_msl_vertex_attribute_init(spvc_msl_vertex_attribute *attr); + +/* Maps to C++ API. Deprecated; use spvc_msl_shader_interface_var_2. */ +typedef struct spvc_msl_shader_interface_var +{ + unsigned location; + spvc_msl_vertex_format format; + SpvBuiltIn builtin; + unsigned vecsize; +} spvc_msl_shader_interface_var, spvc_msl_shader_input; + +/* + * Initializes the shader input struct. + * Deprecated. Use spvc_msl_shader_interface_var_init_2(). + */ +SPVC_PUBLIC_API void spvc_msl_shader_interface_var_init(spvc_msl_shader_interface_var *var); +/* + * Deprecated. Use spvc_msl_shader_interface_var_init_2(). + */ +SPVC_PUBLIC_API void spvc_msl_shader_input_init(spvc_msl_shader_input *input); + +/* Maps to C++ API. */ +typedef enum spvc_msl_shader_variable_rate +{ + SPVC_MSL_SHADER_VARIABLE_RATE_PER_VERTEX = 0, + SPVC_MSL_SHADER_VARIABLE_RATE_PER_PRIMITIVE = 1, + SPVC_MSL_SHADER_VARIABLE_RATE_PER_PATCH = 2, + + SPVC_MSL_SHADER_VARIABLE_RATE_INT_MAX = 0x7fffffff, +} spvc_msl_shader_variable_rate; + +/* Maps to C++ API. */ +typedef struct spvc_msl_shader_interface_var_2 +{ + unsigned location; + spvc_msl_shader_variable_format format; + SpvBuiltIn builtin; + unsigned vecsize; + spvc_msl_shader_variable_rate rate; +} spvc_msl_shader_interface_var_2; + +/* + * Initializes the shader interface variable struct. + */ +SPVC_PUBLIC_API void spvc_msl_shader_interface_var_init_2(spvc_msl_shader_interface_var_2 *var); + +/* Maps to C++ API. + * Deprecated. Use spvc_msl_resource_binding_2. */ +typedef struct spvc_msl_resource_binding +{ + SpvExecutionModel stage; + unsigned desc_set; + unsigned binding; + unsigned msl_buffer; + unsigned msl_texture; + unsigned msl_sampler; +} spvc_msl_resource_binding; + +typedef struct spvc_msl_resource_binding_2 +{ + SpvExecutionModel stage; + unsigned desc_set; + unsigned binding; + unsigned count; + unsigned msl_buffer; + unsigned msl_texture; + unsigned msl_sampler; +} spvc_msl_resource_binding_2; + +/* + * Initializes the resource binding struct. + * The defaults are non-zero. + * Deprecated: Use spvc_msl_resource_binding_init_2. + */ +SPVC_PUBLIC_API void spvc_msl_resource_binding_init(spvc_msl_resource_binding *binding); +SPVC_PUBLIC_API void spvc_msl_resource_binding_init_2(spvc_msl_resource_binding_2 *binding); + +#define SPVC_MSL_PUSH_CONSTANT_DESC_SET (~(0u)) +#define SPVC_MSL_PUSH_CONSTANT_BINDING (0) +#define SPVC_MSL_SWIZZLE_BUFFER_BINDING (~(1u)) +#define SPVC_MSL_BUFFER_SIZE_BUFFER_BINDING (~(2u)) +#define SPVC_MSL_ARGUMENT_BUFFER_BINDING (~(3u)) + +/* Obsolete. Sticks around for backwards compatibility. */ +#define SPVC_MSL_AUX_BUFFER_STRUCT_VERSION 1 + +/* Runtime check for incompatibility. Obsolete. */ +SPVC_PUBLIC_API unsigned spvc_msl_get_aux_buffer_struct_version(void); + +/* Maps to C++ API. */ +typedef enum spvc_msl_sampler_coord +{ + SPVC_MSL_SAMPLER_COORD_NORMALIZED = 0, + SPVC_MSL_SAMPLER_COORD_PIXEL = 1, + SPVC_MSL_SAMPLER_INT_MAX = 0x7fffffff +} spvc_msl_sampler_coord; + +/* Maps to C++ API. */ +typedef enum spvc_msl_sampler_filter +{ + SPVC_MSL_SAMPLER_FILTER_NEAREST = 0, + SPVC_MSL_SAMPLER_FILTER_LINEAR = 1, + SPVC_MSL_SAMPLER_FILTER_INT_MAX = 0x7fffffff +} spvc_msl_sampler_filter; + +/* Maps to C++ API. */ +typedef enum spvc_msl_sampler_mip_filter +{ + SPVC_MSL_SAMPLER_MIP_FILTER_NONE = 0, + SPVC_MSL_SAMPLER_MIP_FILTER_NEAREST = 1, + SPVC_MSL_SAMPLER_MIP_FILTER_LINEAR = 2, + SPVC_MSL_SAMPLER_MIP_FILTER_INT_MAX = 0x7fffffff +} spvc_msl_sampler_mip_filter; + +/* Maps to C++ API. */ +typedef enum spvc_msl_sampler_address +{ + SPVC_MSL_SAMPLER_ADDRESS_CLAMP_TO_ZERO = 0, + SPVC_MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE = 1, + SPVC_MSL_SAMPLER_ADDRESS_CLAMP_TO_BORDER = 2, + SPVC_MSL_SAMPLER_ADDRESS_REPEAT = 3, + SPVC_MSL_SAMPLER_ADDRESS_MIRRORED_REPEAT = 4, + SPVC_MSL_SAMPLER_ADDRESS_INT_MAX = 0x7fffffff +} spvc_msl_sampler_address; + +/* Maps to C++ API. */ +typedef enum spvc_msl_sampler_compare_func +{ + SPVC_MSL_SAMPLER_COMPARE_FUNC_NEVER = 0, + SPVC_MSL_SAMPLER_COMPARE_FUNC_LESS = 1, + SPVC_MSL_SAMPLER_COMPARE_FUNC_LESS_EQUAL = 2, + SPVC_MSL_SAMPLER_COMPARE_FUNC_GREATER = 3, + SPVC_MSL_SAMPLER_COMPARE_FUNC_GREATER_EQUAL = 4, + SPVC_MSL_SAMPLER_COMPARE_FUNC_EQUAL = 5, + SPVC_MSL_SAMPLER_COMPARE_FUNC_NOT_EQUAL = 6, + SPVC_MSL_SAMPLER_COMPARE_FUNC_ALWAYS = 7, + SPVC_MSL_SAMPLER_COMPARE_FUNC_INT_MAX = 0x7fffffff +} spvc_msl_sampler_compare_func; + +/* Maps to C++ API. */ +typedef enum spvc_msl_sampler_border_color +{ + SPVC_MSL_SAMPLER_BORDER_COLOR_TRANSPARENT_BLACK = 0, + SPVC_MSL_SAMPLER_BORDER_COLOR_OPAQUE_BLACK = 1, + SPVC_MSL_SAMPLER_BORDER_COLOR_OPAQUE_WHITE = 2, + SPVC_MSL_SAMPLER_BORDER_COLOR_INT_MAX = 0x7fffffff +} spvc_msl_sampler_border_color; + +/* Maps to C++ API. */ +typedef enum spvc_msl_format_resolution +{ + SPVC_MSL_FORMAT_RESOLUTION_444 = 0, + SPVC_MSL_FORMAT_RESOLUTION_422, + SPVC_MSL_FORMAT_RESOLUTION_420, + SPVC_MSL_FORMAT_RESOLUTION_INT_MAX = 0x7fffffff +} spvc_msl_format_resolution; + +/* Maps to C++ API. */ +typedef enum spvc_msl_chroma_location +{ + SPVC_MSL_CHROMA_LOCATION_COSITED_EVEN = 0, + SPVC_MSL_CHROMA_LOCATION_MIDPOINT, + SPVC_MSL_CHROMA_LOCATION_INT_MAX = 0x7fffffff +} spvc_msl_chroma_location; + +/* Maps to C++ API. */ +typedef enum spvc_msl_component_swizzle +{ + SPVC_MSL_COMPONENT_SWIZZLE_IDENTITY = 0, + SPVC_MSL_COMPONENT_SWIZZLE_ZERO, + SPVC_MSL_COMPONENT_SWIZZLE_ONE, + SPVC_MSL_COMPONENT_SWIZZLE_R, + SPVC_MSL_COMPONENT_SWIZZLE_G, + SPVC_MSL_COMPONENT_SWIZZLE_B, + SPVC_MSL_COMPONENT_SWIZZLE_A, + SPVC_MSL_COMPONENT_SWIZZLE_INT_MAX = 0x7fffffff +} spvc_msl_component_swizzle; + +/* Maps to C++ API. */ +typedef enum spvc_msl_sampler_ycbcr_model_conversion +{ + SPVC_MSL_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY = 0, + SPVC_MSL_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY, + SPVC_MSL_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_BT_709, + SPVC_MSL_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_BT_601, + SPVC_MSL_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_BT_2020, + SPVC_MSL_SAMPLER_YCBCR_MODEL_CONVERSION_INT_MAX = 0x7fffffff +} spvc_msl_sampler_ycbcr_model_conversion; + +/* Maps to C+ API. */ +typedef enum spvc_msl_sampler_ycbcr_range +{ + SPVC_MSL_SAMPLER_YCBCR_RANGE_ITU_FULL = 0, + SPVC_MSL_SAMPLER_YCBCR_RANGE_ITU_NARROW, + SPVC_MSL_SAMPLER_YCBCR_RANGE_INT_MAX = 0x7fffffff +} spvc_msl_sampler_ycbcr_range; + +/* Maps to C++ API. */ +typedef struct spvc_msl_constexpr_sampler +{ + spvc_msl_sampler_coord coord; + spvc_msl_sampler_filter min_filter; + spvc_msl_sampler_filter mag_filter; + spvc_msl_sampler_mip_filter mip_filter; + spvc_msl_sampler_address s_address; + spvc_msl_sampler_address t_address; + spvc_msl_sampler_address r_address; + spvc_msl_sampler_compare_func compare_func; + spvc_msl_sampler_border_color border_color; + float lod_clamp_min; + float lod_clamp_max; + int max_anisotropy; + + spvc_bool compare_enable; + spvc_bool lod_clamp_enable; + spvc_bool anisotropy_enable; +} spvc_msl_constexpr_sampler; + +/* + * Initializes the constexpr sampler struct. + * The defaults are non-zero. + */ +SPVC_PUBLIC_API void spvc_msl_constexpr_sampler_init(spvc_msl_constexpr_sampler *sampler); + +/* Maps to the sampler Y'CbCr conversion-related portions of MSLConstexprSampler. See C++ API for defaults and details. */ +typedef struct spvc_msl_sampler_ycbcr_conversion +{ + unsigned planes; + spvc_msl_format_resolution resolution; + spvc_msl_sampler_filter chroma_filter; + spvc_msl_chroma_location x_chroma_offset; + spvc_msl_chroma_location y_chroma_offset; + spvc_msl_component_swizzle swizzle[4]; + spvc_msl_sampler_ycbcr_model_conversion ycbcr_model; + spvc_msl_sampler_ycbcr_range ycbcr_range; + unsigned bpc; +} spvc_msl_sampler_ycbcr_conversion; + +/* + * Initializes the constexpr sampler struct. + * The defaults are non-zero. + */ +SPVC_PUBLIC_API void spvc_msl_sampler_ycbcr_conversion_init(spvc_msl_sampler_ycbcr_conversion *conv); + +/* Maps to C++ API. */ +typedef enum spvc_hlsl_binding_flag_bits +{ + SPVC_HLSL_BINDING_AUTO_NONE_BIT = 0, + SPVC_HLSL_BINDING_AUTO_PUSH_CONSTANT_BIT = 1 << 0, + SPVC_HLSL_BINDING_AUTO_CBV_BIT = 1 << 1, + SPVC_HLSL_BINDING_AUTO_SRV_BIT = 1 << 2, + SPVC_HLSL_BINDING_AUTO_UAV_BIT = 1 << 3, + SPVC_HLSL_BINDING_AUTO_SAMPLER_BIT = 1 << 4, + SPVC_HLSL_BINDING_AUTO_ALL = 0x7fffffff +} spvc_hlsl_binding_flag_bits; +typedef unsigned spvc_hlsl_binding_flags; + +#define SPVC_HLSL_PUSH_CONSTANT_DESC_SET (~(0u)) +#define SPVC_HLSL_PUSH_CONSTANT_BINDING (0) + +/* Maps to C++ API. */ +typedef struct spvc_hlsl_resource_binding_mapping +{ + unsigned register_space; + unsigned register_binding; +} spvc_hlsl_resource_binding_mapping; + +typedef struct spvc_hlsl_resource_binding +{ + SpvExecutionModel stage; + unsigned desc_set; + unsigned binding; + + spvc_hlsl_resource_binding_mapping cbv, uav, srv, sampler; +} spvc_hlsl_resource_binding; + +/* + * Initializes the resource binding struct. + * The defaults are non-zero. + */ +SPVC_PUBLIC_API void spvc_hlsl_resource_binding_init(spvc_hlsl_resource_binding *binding); + +/* Maps to the various spirv_cross::Compiler*::Option structures. See C++ API for defaults and details. */ +typedef enum spvc_compiler_option +{ + SPVC_COMPILER_OPTION_UNKNOWN = 0, + + SPVC_COMPILER_OPTION_FORCE_TEMPORARY = 1 | SPVC_COMPILER_OPTION_COMMON_BIT, + SPVC_COMPILER_OPTION_FLATTEN_MULTIDIMENSIONAL_ARRAYS = 2 | SPVC_COMPILER_OPTION_COMMON_BIT, + SPVC_COMPILER_OPTION_FIXUP_DEPTH_CONVENTION = 3 | SPVC_COMPILER_OPTION_COMMON_BIT, + SPVC_COMPILER_OPTION_FLIP_VERTEX_Y = 4 | SPVC_COMPILER_OPTION_COMMON_BIT, + + SPVC_COMPILER_OPTION_GLSL_SUPPORT_NONZERO_BASE_INSTANCE = 5 | SPVC_COMPILER_OPTION_GLSL_BIT, + SPVC_COMPILER_OPTION_GLSL_SEPARATE_SHADER_OBJECTS = 6 | SPVC_COMPILER_OPTION_GLSL_BIT, + SPVC_COMPILER_OPTION_GLSL_ENABLE_420PACK_EXTENSION = 7 | SPVC_COMPILER_OPTION_GLSL_BIT, + SPVC_COMPILER_OPTION_GLSL_VERSION = 8 | SPVC_COMPILER_OPTION_GLSL_BIT, + SPVC_COMPILER_OPTION_GLSL_ES = 9 | SPVC_COMPILER_OPTION_GLSL_BIT, + SPVC_COMPILER_OPTION_GLSL_VULKAN_SEMANTICS = 10 | SPVC_COMPILER_OPTION_GLSL_BIT, + SPVC_COMPILER_OPTION_GLSL_ES_DEFAULT_FLOAT_PRECISION_HIGHP = 11 | SPVC_COMPILER_OPTION_GLSL_BIT, + SPVC_COMPILER_OPTION_GLSL_ES_DEFAULT_INT_PRECISION_HIGHP = 12 | SPVC_COMPILER_OPTION_GLSL_BIT, + + SPVC_COMPILER_OPTION_HLSL_SHADER_MODEL = 13 | SPVC_COMPILER_OPTION_HLSL_BIT, + SPVC_COMPILER_OPTION_HLSL_POINT_SIZE_COMPAT = 14 | SPVC_COMPILER_OPTION_HLSL_BIT, + SPVC_COMPILER_OPTION_HLSL_POINT_COORD_COMPAT = 15 | SPVC_COMPILER_OPTION_HLSL_BIT, + SPVC_COMPILER_OPTION_HLSL_SUPPORT_NONZERO_BASE_VERTEX_BASE_INSTANCE = 16 | SPVC_COMPILER_OPTION_HLSL_BIT, + + SPVC_COMPILER_OPTION_MSL_VERSION = 17 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_TEXEL_BUFFER_TEXTURE_WIDTH = 18 | SPVC_COMPILER_OPTION_MSL_BIT, + + /* Obsolete, use SWIZZLE_BUFFER_INDEX instead. */ + SPVC_COMPILER_OPTION_MSL_AUX_BUFFER_INDEX = 19 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_SWIZZLE_BUFFER_INDEX = 19 | SPVC_COMPILER_OPTION_MSL_BIT, + + SPVC_COMPILER_OPTION_MSL_INDIRECT_PARAMS_BUFFER_INDEX = 20 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_SHADER_OUTPUT_BUFFER_INDEX = 21 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_SHADER_PATCH_OUTPUT_BUFFER_INDEX = 22 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_SHADER_TESS_FACTOR_OUTPUT_BUFFER_INDEX = 23 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_SHADER_INPUT_WORKGROUP_INDEX = 24 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_ENABLE_POINT_SIZE_BUILTIN = 25 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_DISABLE_RASTERIZATION = 26 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_CAPTURE_OUTPUT_TO_BUFFER = 27 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_SWIZZLE_TEXTURE_SAMPLES = 28 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_PAD_FRAGMENT_OUTPUT_COMPONENTS = 29 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_TESS_DOMAIN_ORIGIN_LOWER_LEFT = 30 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_PLATFORM = 31 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_ARGUMENT_BUFFERS = 32 | SPVC_COMPILER_OPTION_MSL_BIT, + + SPVC_COMPILER_OPTION_GLSL_EMIT_PUSH_CONSTANT_AS_UNIFORM_BUFFER = 33 | SPVC_COMPILER_OPTION_GLSL_BIT, + + SPVC_COMPILER_OPTION_MSL_TEXTURE_BUFFER_NATIVE = 34 | SPVC_COMPILER_OPTION_MSL_BIT, + + SPVC_COMPILER_OPTION_GLSL_EMIT_UNIFORM_BUFFER_AS_PLAIN_UNIFORMS = 35 | SPVC_COMPILER_OPTION_GLSL_BIT, + + SPVC_COMPILER_OPTION_MSL_BUFFER_SIZE_BUFFER_INDEX = 36 | SPVC_COMPILER_OPTION_MSL_BIT, + + SPVC_COMPILER_OPTION_EMIT_LINE_DIRECTIVES = 37 | SPVC_COMPILER_OPTION_COMMON_BIT, + + SPVC_COMPILER_OPTION_MSL_MULTIVIEW = 38 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_VIEW_MASK_BUFFER_INDEX = 39 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_DEVICE_INDEX = 40 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_VIEW_INDEX_FROM_DEVICE_INDEX = 41 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_DISPATCH_BASE = 42 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_DYNAMIC_OFFSETS_BUFFER_INDEX = 43 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_TEXTURE_1D_AS_2D = 44 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_ENABLE_BASE_INDEX_ZERO = 45 | SPVC_COMPILER_OPTION_MSL_BIT, + + /* Obsolete. Use MSL_FRAMEBUFFER_FETCH_SUBPASS instead. */ + SPVC_COMPILER_OPTION_MSL_IOS_FRAMEBUFFER_FETCH_SUBPASS = 46 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_FRAMEBUFFER_FETCH_SUBPASS = 46 | SPVC_COMPILER_OPTION_MSL_BIT, + + SPVC_COMPILER_OPTION_MSL_INVARIANT_FP_MATH = 47 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_EMULATE_CUBEMAP_ARRAY = 48 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_ENABLE_DECORATION_BINDING = 49 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_FORCE_ACTIVE_ARGUMENT_BUFFER_RESOURCES = 50 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_FORCE_NATIVE_ARRAYS = 51 | SPVC_COMPILER_OPTION_MSL_BIT, + + SPVC_COMPILER_OPTION_ENABLE_STORAGE_IMAGE_QUALIFIER_DEDUCTION = 52 | SPVC_COMPILER_OPTION_COMMON_BIT, + + SPVC_COMPILER_OPTION_HLSL_FORCE_STORAGE_BUFFER_AS_UAV = 53 | SPVC_COMPILER_OPTION_HLSL_BIT, + + SPVC_COMPILER_OPTION_FORCE_ZERO_INITIALIZED_VARIABLES = 54 | SPVC_COMPILER_OPTION_COMMON_BIT, + + SPVC_COMPILER_OPTION_HLSL_NONWRITABLE_UAV_TEXTURE_AS_SRV = 55 | SPVC_COMPILER_OPTION_HLSL_BIT, + + SPVC_COMPILER_OPTION_MSL_ENABLE_FRAG_OUTPUT_MASK = 56 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_ENABLE_FRAG_DEPTH_BUILTIN = 57 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_ENABLE_FRAG_STENCIL_REF_BUILTIN = 58 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_ENABLE_CLIP_DISTANCE_USER_VARYING = 59 | SPVC_COMPILER_OPTION_MSL_BIT, + + SPVC_COMPILER_OPTION_HLSL_ENABLE_16BIT_TYPES = 60 | SPVC_COMPILER_OPTION_HLSL_BIT, + + SPVC_COMPILER_OPTION_MSL_MULTI_PATCH_WORKGROUP = 61 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_SHADER_INPUT_BUFFER_INDEX = 62 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_SHADER_INDEX_BUFFER_INDEX = 63 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_VERTEX_FOR_TESSELLATION = 64 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_VERTEX_INDEX_TYPE = 65 | SPVC_COMPILER_OPTION_MSL_BIT, + + SPVC_COMPILER_OPTION_GLSL_FORCE_FLATTENED_IO_BLOCKS = 66 | SPVC_COMPILER_OPTION_GLSL_BIT, + + SPVC_COMPILER_OPTION_MSL_MULTIVIEW_LAYERED_RENDERING = 67 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_ARRAYED_SUBPASS_INPUT = 68 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_R32UI_LINEAR_TEXTURE_ALIGNMENT = 69 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_R32UI_ALIGNMENT_CONSTANT_ID = 70 | SPVC_COMPILER_OPTION_MSL_BIT, + + SPVC_COMPILER_OPTION_HLSL_FLATTEN_MATRIX_VERTEX_INPUT_SEMANTICS = 71 | SPVC_COMPILER_OPTION_HLSL_BIT, + + SPVC_COMPILER_OPTION_MSL_IOS_USE_SIMDGROUP_FUNCTIONS = 72 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_EMULATE_SUBGROUPS = 73 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_FIXED_SUBGROUP_SIZE = 74 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_FORCE_SAMPLE_RATE_SHADING = 75 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_IOS_SUPPORT_BASE_VERTEX_INSTANCE = 76 | SPVC_COMPILER_OPTION_MSL_BIT, + + SPVC_COMPILER_OPTION_GLSL_OVR_MULTIVIEW_VIEW_COUNT = 77 | SPVC_COMPILER_OPTION_GLSL_BIT, + + SPVC_COMPILER_OPTION_RELAX_NAN_CHECKS = 78 | SPVC_COMPILER_OPTION_COMMON_BIT, + + SPVC_COMPILER_OPTION_MSL_RAW_BUFFER_TESE_INPUT = 79 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_SHADER_PATCH_INPUT_BUFFER_INDEX = 80 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_MANUAL_HELPER_INVOCATION_UPDATES = 81 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_CHECK_DISCARDED_FRAG_STORES = 82 | SPVC_COMPILER_OPTION_MSL_BIT, + + SPVC_COMPILER_OPTION_GLSL_ENABLE_ROW_MAJOR_LOAD_WORKAROUND = 83 | SPVC_COMPILER_OPTION_GLSL_BIT, + + SPVC_COMPILER_OPTION_MSL_ARGUMENT_BUFFERS_TIER = 84 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_SAMPLE_DREF_LOD_ARRAY_AS_GRAD = 85 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_READWRITE_TEXTURE_FENCES = 86 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_REPLACE_RECURSIVE_INPUTS = 87 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_AGX_MANUAL_CUBE_GRAD_FIXUP = 88 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_FORCE_FRAGMENT_WITH_SIDE_EFFECTS_EXECUTION = 89 | SPVC_COMPILER_OPTION_MSL_BIT, + + SPVC_COMPILER_OPTION_HLSL_USE_ENTRY_POINT_NAME = 90 | SPVC_COMPILER_OPTION_HLSL_BIT, + SPVC_COMPILER_OPTION_HLSL_PRESERVE_STRUCTURED_BUFFERS = 91 | SPVC_COMPILER_OPTION_HLSL_BIT, + + SPVC_COMPILER_OPTION_MSL_AUTO_DISABLE_RASTERIZATION = 92 | SPVC_COMPILER_OPTION_MSL_BIT, + + SPVC_COMPILER_OPTION_MSL_ENABLE_POINT_SIZE_DEFAULT = 93 | SPVC_COMPILER_OPTION_MSL_BIT, + + SPVC_COMPILER_OPTION_HLSL_USER_SEMANTIC = 94 | SPVC_COMPILER_OPTION_HLSL_BIT, + + SPVC_COMPILER_OPTION_INT_MAX = 0x7fffffff +} spvc_compiler_option; + +/* + * Context is the highest-level API construct. + * The context owns all memory allocations made by its child object hierarchy, including various non-opaque structs and strings. + * This means that the API user only has to care about one "destroy" call ever when using the C API. + * All pointers handed out by the APIs are only valid as long as the context + * is alive and spvc_context_release_allocations has not been called. + */ +SPVC_PUBLIC_API spvc_result spvc_context_create(spvc_context *context); + +/* Frees all memory allocations and objects associated with the context and its child objects. */ +SPVC_PUBLIC_API void spvc_context_destroy(spvc_context context); + +/* Frees all memory allocations and objects associated with the context and its child objects, but keeps the context alive. */ +SPVC_PUBLIC_API void spvc_context_release_allocations(spvc_context context); + +/* Get the string for the last error which was logged. */ +SPVC_PUBLIC_API const char *spvc_context_get_last_error_string(spvc_context context); + +/* Get notified in a callback when an error triggers. Useful for debugging. */ +typedef void (*spvc_error_callback)(void *userdata, const char *error); +SPVC_PUBLIC_API void spvc_context_set_error_callback(spvc_context context, spvc_error_callback cb, void *userdata); + +/* SPIR-V parsing interface. Maps to Parser which then creates a ParsedIR, and that IR is extracted into the handle. */ +SPVC_PUBLIC_API spvc_result spvc_context_parse_spirv(spvc_context context, const SpvId *spirv, size_t word_count, + spvc_parsed_ir *parsed_ir); + +/* + * Create a compiler backend. Capture mode controls if we construct by copy or move semantics. + * It is always recommended to use SPVC_CAPTURE_MODE_TAKE_OWNERSHIP if you only intend to cross-compile the IR once. + */ +SPVC_PUBLIC_API spvc_result spvc_context_create_compiler(spvc_context context, spvc_backend backend, + spvc_parsed_ir parsed_ir, spvc_capture_mode mode, + spvc_compiler *compiler); + +/* Maps directly to C++ API. */ +SPVC_PUBLIC_API unsigned spvc_compiler_get_current_id_bound(spvc_compiler compiler); + +/* Create compiler options, which will initialize defaults. */ +SPVC_PUBLIC_API spvc_result spvc_compiler_create_compiler_options(spvc_compiler compiler, + spvc_compiler_options *options); +/* Override options. Will return error if e.g. MSL options are used for the HLSL backend, etc. */ +SPVC_PUBLIC_API spvc_result spvc_compiler_options_set_bool(spvc_compiler_options options, + spvc_compiler_option option, spvc_bool value); +SPVC_PUBLIC_API spvc_result spvc_compiler_options_set_uint(spvc_compiler_options options, + spvc_compiler_option option, unsigned value); +/* Set compiler options. */ +SPVC_PUBLIC_API spvc_result spvc_compiler_install_compiler_options(spvc_compiler compiler, + spvc_compiler_options options); + +/* Compile IR into a string. *source is owned by the context, and caller must not free it themselves. */ +SPVC_PUBLIC_API spvc_result spvc_compiler_compile(spvc_compiler compiler, const char **source); + +/* Maps to C++ API. */ +SPVC_PUBLIC_API spvc_result spvc_compiler_add_header_line(spvc_compiler compiler, const char *line); +SPVC_PUBLIC_API spvc_result spvc_compiler_require_extension(spvc_compiler compiler, const char *ext); +SPVC_PUBLIC_API size_t spvc_compiler_get_num_required_extensions(spvc_compiler compiler); +SPVC_PUBLIC_API const char *spvc_compiler_get_required_extension(spvc_compiler compiler, size_t index); +SPVC_PUBLIC_API spvc_result spvc_compiler_flatten_buffer_block(spvc_compiler compiler, spvc_variable_id id); + +SPVC_PUBLIC_API spvc_bool spvc_compiler_variable_is_depth_or_compare(spvc_compiler compiler, spvc_variable_id id); + +SPVC_PUBLIC_API spvc_result spvc_compiler_mask_stage_output_by_location(spvc_compiler compiler, + unsigned location, unsigned component); +SPVC_PUBLIC_API spvc_result spvc_compiler_mask_stage_output_by_builtin(spvc_compiler compiler, SpvBuiltIn builtin); + +/* + * HLSL specifics. + * Maps to C++ API. + */ +SPVC_PUBLIC_API spvc_result spvc_compiler_hlsl_set_root_constants_layout(spvc_compiler compiler, + const spvc_hlsl_root_constants *constant_info, + size_t count); +SPVC_PUBLIC_API spvc_result spvc_compiler_hlsl_add_vertex_attribute_remap(spvc_compiler compiler, + const spvc_hlsl_vertex_attribute_remap *remap, + size_t remaps); +SPVC_PUBLIC_API spvc_variable_id spvc_compiler_hlsl_remap_num_workgroups_builtin(spvc_compiler compiler); + +SPVC_PUBLIC_API spvc_result spvc_compiler_hlsl_set_resource_binding_flags(spvc_compiler compiler, + spvc_hlsl_binding_flags flags); + +SPVC_PUBLIC_API spvc_result spvc_compiler_hlsl_add_resource_binding(spvc_compiler compiler, + const spvc_hlsl_resource_binding *binding); +SPVC_PUBLIC_API spvc_bool spvc_compiler_hlsl_is_resource_used(spvc_compiler compiler, + SpvExecutionModel model, + unsigned set, + unsigned binding); + +/* + * MSL specifics. + * Maps to C++ API. + */ +SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_is_rasterization_disabled(spvc_compiler compiler); + +/* Obsolete. Renamed to needs_swizzle_buffer. */ +SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_needs_aux_buffer(spvc_compiler compiler); +SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_needs_swizzle_buffer(spvc_compiler compiler); +SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_needs_buffer_size_buffer(spvc_compiler compiler); + +SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_needs_output_buffer(spvc_compiler compiler); +SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_needs_patch_output_buffer(spvc_compiler compiler); +SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_needs_input_threadgroup_mem(spvc_compiler compiler); +SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_vertex_attribute(spvc_compiler compiler, + const spvc_msl_vertex_attribute *attrs); +/* Deprecated; use spvc_compiler_msl_add_resource_binding_2(). */ +SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_resource_binding(spvc_compiler compiler, + const spvc_msl_resource_binding *binding); +SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_resource_binding_2(spvc_compiler compiler, + const spvc_msl_resource_binding_2 *binding); +/* Deprecated; use spvc_compiler_msl_add_shader_input_2(). */ +SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_shader_input(spvc_compiler compiler, + const spvc_msl_shader_interface_var *input); +SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_shader_input_2(spvc_compiler compiler, + const spvc_msl_shader_interface_var_2 *input); +/* Deprecated; use spvc_compiler_msl_add_shader_output_2(). */ +SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_shader_output(spvc_compiler compiler, + const spvc_msl_shader_interface_var *output); +SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_shader_output_2(spvc_compiler compiler, + const spvc_msl_shader_interface_var_2 *output); +SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_discrete_descriptor_set(spvc_compiler compiler, unsigned desc_set); +SPVC_PUBLIC_API spvc_result spvc_compiler_msl_set_argument_buffer_device_address_space(spvc_compiler compiler, unsigned desc_set, spvc_bool device_address); + +/* Obsolete, use is_shader_input_used. */ +SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_is_vertex_attribute_used(spvc_compiler compiler, unsigned location); +SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_is_shader_input_used(spvc_compiler compiler, unsigned location); +SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_is_shader_output_used(spvc_compiler compiler, unsigned location); + +SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_is_resource_used(spvc_compiler compiler, + SpvExecutionModel model, + unsigned set, + unsigned binding); +SPVC_PUBLIC_API spvc_result spvc_compiler_msl_remap_constexpr_sampler(spvc_compiler compiler, spvc_variable_id id, const spvc_msl_constexpr_sampler *sampler); +SPVC_PUBLIC_API spvc_result spvc_compiler_msl_remap_constexpr_sampler_by_binding(spvc_compiler compiler, unsigned desc_set, unsigned binding, const spvc_msl_constexpr_sampler *sampler); +SPVC_PUBLIC_API spvc_result spvc_compiler_msl_remap_constexpr_sampler_ycbcr(spvc_compiler compiler, spvc_variable_id id, const spvc_msl_constexpr_sampler *sampler, const spvc_msl_sampler_ycbcr_conversion *conv); +SPVC_PUBLIC_API spvc_result spvc_compiler_msl_remap_constexpr_sampler_by_binding_ycbcr(spvc_compiler compiler, unsigned desc_set, unsigned binding, const spvc_msl_constexpr_sampler *sampler, const spvc_msl_sampler_ycbcr_conversion *conv); +SPVC_PUBLIC_API spvc_result spvc_compiler_msl_set_fragment_output_components(spvc_compiler compiler, unsigned location, unsigned components); + +SPVC_PUBLIC_API unsigned spvc_compiler_msl_get_automatic_resource_binding(spvc_compiler compiler, spvc_variable_id id); +SPVC_PUBLIC_API unsigned spvc_compiler_msl_get_automatic_resource_binding_secondary(spvc_compiler compiler, spvc_variable_id id); + +SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_dynamic_buffer(spvc_compiler compiler, unsigned desc_set, unsigned binding, unsigned index); + +SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_inline_uniform_block(spvc_compiler compiler, unsigned desc_set, unsigned binding); + +SPVC_PUBLIC_API spvc_result spvc_compiler_msl_set_combined_sampler_suffix(spvc_compiler compiler, const char *suffix); +SPVC_PUBLIC_API const char *spvc_compiler_msl_get_combined_sampler_suffix(spvc_compiler compiler); + +/* + * Reflect resources. + * Maps almost 1:1 to C++ API. + */ +SPVC_PUBLIC_API spvc_result spvc_compiler_get_active_interface_variables(spvc_compiler compiler, spvc_set *set); +SPVC_PUBLIC_API spvc_result spvc_compiler_set_enabled_interface_variables(spvc_compiler compiler, spvc_set set); +SPVC_PUBLIC_API spvc_result spvc_compiler_create_shader_resources(spvc_compiler compiler, spvc_resources *resources); +SPVC_PUBLIC_API spvc_result spvc_compiler_create_shader_resources_for_active_variables(spvc_compiler compiler, + spvc_resources *resources, + spvc_set active); +SPVC_PUBLIC_API spvc_result spvc_resources_get_resource_list_for_type(spvc_resources resources, spvc_resource_type type, + const spvc_reflected_resource **resource_list, + size_t *resource_size); + +SPVC_PUBLIC_API spvc_result spvc_resources_get_builtin_resource_list_for_type( + spvc_resources resources, spvc_builtin_resource_type type, + const spvc_reflected_builtin_resource **resource_list, + size_t *resource_size); + +/* + * Decorations. + * Maps to C++ API. + */ +SPVC_PUBLIC_API void spvc_compiler_set_decoration(spvc_compiler compiler, SpvId id, SpvDecoration decoration, + unsigned argument); +SPVC_PUBLIC_API void spvc_compiler_set_decoration_string(spvc_compiler compiler, SpvId id, SpvDecoration decoration, + const char *argument); +SPVC_PUBLIC_API void spvc_compiler_set_name(spvc_compiler compiler, SpvId id, const char *argument); +SPVC_PUBLIC_API void spvc_compiler_set_member_decoration(spvc_compiler compiler, spvc_type_id id, unsigned member_index, + SpvDecoration decoration, unsigned argument); +SPVC_PUBLIC_API void spvc_compiler_set_member_decoration_string(spvc_compiler compiler, spvc_type_id id, + unsigned member_index, SpvDecoration decoration, + const char *argument); +SPVC_PUBLIC_API void spvc_compiler_set_member_name(spvc_compiler compiler, spvc_type_id id, unsigned member_index, + const char *argument); +SPVC_PUBLIC_API void spvc_compiler_unset_decoration(spvc_compiler compiler, SpvId id, SpvDecoration decoration); +SPVC_PUBLIC_API void spvc_compiler_unset_member_decoration(spvc_compiler compiler, spvc_type_id id, + unsigned member_index, SpvDecoration decoration); + +SPVC_PUBLIC_API spvc_bool spvc_compiler_has_decoration(spvc_compiler compiler, SpvId id, SpvDecoration decoration); +SPVC_PUBLIC_API spvc_bool spvc_compiler_has_member_decoration(spvc_compiler compiler, spvc_type_id id, + unsigned member_index, SpvDecoration decoration); +SPVC_PUBLIC_API const char *spvc_compiler_get_name(spvc_compiler compiler, SpvId id); +SPVC_PUBLIC_API unsigned spvc_compiler_get_decoration(spvc_compiler compiler, SpvId id, SpvDecoration decoration); +SPVC_PUBLIC_API const char *spvc_compiler_get_decoration_string(spvc_compiler compiler, SpvId id, + SpvDecoration decoration); +SPVC_PUBLIC_API unsigned spvc_compiler_get_member_decoration(spvc_compiler compiler, spvc_type_id id, + unsigned member_index, SpvDecoration decoration); +SPVC_PUBLIC_API const char *spvc_compiler_get_member_decoration_string(spvc_compiler compiler, spvc_type_id id, + unsigned member_index, SpvDecoration decoration); +SPVC_PUBLIC_API const char *spvc_compiler_get_member_name(spvc_compiler compiler, spvc_type_id id, unsigned member_index); + +/* + * Entry points. + * Maps to C++ API. + */ +SPVC_PUBLIC_API spvc_result spvc_compiler_get_entry_points(spvc_compiler compiler, + const spvc_entry_point **entry_points, + size_t *num_entry_points); +SPVC_PUBLIC_API spvc_result spvc_compiler_set_entry_point(spvc_compiler compiler, const char *name, + SpvExecutionModel model); +SPVC_PUBLIC_API spvc_result spvc_compiler_rename_entry_point(spvc_compiler compiler, const char *old_name, + const char *new_name, SpvExecutionModel model); +SPVC_PUBLIC_API const char *spvc_compiler_get_cleansed_entry_point_name(spvc_compiler compiler, const char *name, + SpvExecutionModel model); +SPVC_PUBLIC_API void spvc_compiler_set_execution_mode(spvc_compiler compiler, SpvExecutionMode mode); +SPVC_PUBLIC_API void spvc_compiler_unset_execution_mode(spvc_compiler compiler, SpvExecutionMode mode); +SPVC_PUBLIC_API void spvc_compiler_set_execution_mode_with_arguments(spvc_compiler compiler, SpvExecutionMode mode, + unsigned arg0, unsigned arg1, unsigned arg2); +SPVC_PUBLIC_API spvc_result spvc_compiler_get_execution_modes(spvc_compiler compiler, const SpvExecutionMode **modes, + size_t *num_modes); +SPVC_PUBLIC_API unsigned spvc_compiler_get_execution_mode_argument(spvc_compiler compiler, SpvExecutionMode mode); +SPVC_PUBLIC_API unsigned spvc_compiler_get_execution_mode_argument_by_index(spvc_compiler compiler, + SpvExecutionMode mode, unsigned index); +SPVC_PUBLIC_API SpvExecutionModel spvc_compiler_get_execution_model(spvc_compiler compiler); +SPVC_PUBLIC_API void spvc_compiler_update_active_builtins(spvc_compiler compiler); +SPVC_PUBLIC_API spvc_bool spvc_compiler_has_active_builtin(spvc_compiler compiler, SpvBuiltIn builtin, SpvStorageClass storage); + +/* + * Type query interface. + * Maps to C++ API, except it's read-only. + */ +SPVC_PUBLIC_API spvc_type spvc_compiler_get_type_handle(spvc_compiler compiler, spvc_type_id id); + +/* Pulls out SPIRType::self. This effectively gives the type ID without array or pointer qualifiers. + * This is necessary when reflecting decoration/name information on members of a struct, + * which are placed in the base type, not the qualified type. + * This is similar to spvc_reflected_resource::base_type_id. */ +SPVC_PUBLIC_API spvc_type_id spvc_type_get_base_type_id(spvc_type type); + +SPVC_PUBLIC_API spvc_basetype spvc_type_get_basetype(spvc_type type); +SPVC_PUBLIC_API unsigned spvc_type_get_bit_width(spvc_type type); +SPVC_PUBLIC_API unsigned spvc_type_get_vector_size(spvc_type type); +SPVC_PUBLIC_API unsigned spvc_type_get_columns(spvc_type type); +SPVC_PUBLIC_API unsigned spvc_type_get_num_array_dimensions(spvc_type type); +SPVC_PUBLIC_API spvc_bool spvc_type_array_dimension_is_literal(spvc_type type, unsigned dimension); +SPVC_PUBLIC_API SpvId spvc_type_get_array_dimension(spvc_type type, unsigned dimension); +SPVC_PUBLIC_API unsigned spvc_type_get_num_member_types(spvc_type type); +SPVC_PUBLIC_API spvc_type_id spvc_type_get_member_type(spvc_type type, unsigned index); +SPVC_PUBLIC_API SpvStorageClass spvc_type_get_storage_class(spvc_type type); + +/* Image type query. */ +SPVC_PUBLIC_API spvc_type_id spvc_type_get_image_sampled_type(spvc_type type); +SPVC_PUBLIC_API SpvDim spvc_type_get_image_dimension(spvc_type type); +SPVC_PUBLIC_API spvc_bool spvc_type_get_image_is_depth(spvc_type type); +SPVC_PUBLIC_API spvc_bool spvc_type_get_image_arrayed(spvc_type type); +SPVC_PUBLIC_API spvc_bool spvc_type_get_image_multisampled(spvc_type type); +SPVC_PUBLIC_API spvc_bool spvc_type_get_image_is_storage(spvc_type type); +SPVC_PUBLIC_API SpvImageFormat spvc_type_get_image_storage_format(spvc_type type); +SPVC_PUBLIC_API SpvAccessQualifier spvc_type_get_image_access_qualifier(spvc_type type); + +/* + * Buffer layout query. + * Maps to C++ API. + */ +SPVC_PUBLIC_API spvc_result spvc_compiler_get_declared_struct_size(spvc_compiler compiler, spvc_type struct_type, size_t *size); +SPVC_PUBLIC_API spvc_result spvc_compiler_get_declared_struct_size_runtime_array(spvc_compiler compiler, + spvc_type struct_type, size_t array_size, size_t *size); +SPVC_PUBLIC_API spvc_result spvc_compiler_get_declared_struct_member_size(spvc_compiler compiler, spvc_type type, unsigned index, size_t *size); + +SPVC_PUBLIC_API spvc_result spvc_compiler_type_struct_member_offset(spvc_compiler compiler, + spvc_type type, unsigned index, unsigned *offset); +SPVC_PUBLIC_API spvc_result spvc_compiler_type_struct_member_array_stride(spvc_compiler compiler, + spvc_type type, unsigned index, unsigned *stride); +SPVC_PUBLIC_API spvc_result spvc_compiler_type_struct_member_matrix_stride(spvc_compiler compiler, + spvc_type type, unsigned index, unsigned *stride); + +/* + * Workaround helper functions. + * Maps to C++ API. + */ +SPVC_PUBLIC_API spvc_result spvc_compiler_build_dummy_sampler_for_combined_images(spvc_compiler compiler, spvc_variable_id *id); +SPVC_PUBLIC_API spvc_result spvc_compiler_build_combined_image_samplers(spvc_compiler compiler); +SPVC_PUBLIC_API spvc_result spvc_compiler_get_combined_image_samplers(spvc_compiler compiler, + const spvc_combined_image_sampler **samplers, + size_t *num_samplers); + +/* + * Constants + * Maps to C++ API. + */ +SPVC_PUBLIC_API spvc_result spvc_compiler_get_specialization_constants(spvc_compiler compiler, + const spvc_specialization_constant **constants, + size_t *num_constants); +SPVC_PUBLIC_API spvc_constant spvc_compiler_get_constant_handle(spvc_compiler compiler, + spvc_constant_id id); + +SPVC_PUBLIC_API spvc_constant_id spvc_compiler_get_work_group_size_specialization_constants(spvc_compiler compiler, + spvc_specialization_constant *x, + spvc_specialization_constant *y, + spvc_specialization_constant *z); + +/* + * Buffer ranges + * Maps to C++ API. + */ +SPVC_PUBLIC_API spvc_result spvc_compiler_get_active_buffer_ranges(spvc_compiler compiler, + spvc_variable_id id, + const spvc_buffer_range **ranges, + size_t *num_ranges); + +/* + * No stdint.h until C99, sigh :( + * For smaller types, the result is sign or zero-extended as appropriate. + * Maps to C++ API. + * TODO: The SPIRConstant query interface and modification interface is not quite complete. + */ +SPVC_PUBLIC_API float spvc_constant_get_scalar_fp16(spvc_constant constant, unsigned column, unsigned row); +SPVC_PUBLIC_API float spvc_constant_get_scalar_fp32(spvc_constant constant, unsigned column, unsigned row); +SPVC_PUBLIC_API double spvc_constant_get_scalar_fp64(spvc_constant constant, unsigned column, unsigned row); +SPVC_PUBLIC_API unsigned spvc_constant_get_scalar_u32(spvc_constant constant, unsigned column, unsigned row); +SPVC_PUBLIC_API int spvc_constant_get_scalar_i32(spvc_constant constant, unsigned column, unsigned row); +SPVC_PUBLIC_API unsigned spvc_constant_get_scalar_u16(spvc_constant constant, unsigned column, unsigned row); +SPVC_PUBLIC_API int spvc_constant_get_scalar_i16(spvc_constant constant, unsigned column, unsigned row); +SPVC_PUBLIC_API unsigned spvc_constant_get_scalar_u8(spvc_constant constant, unsigned column, unsigned row); +SPVC_PUBLIC_API int spvc_constant_get_scalar_i8(spvc_constant constant, unsigned column, unsigned row); +SPVC_PUBLIC_API void spvc_constant_get_subconstants(spvc_constant constant, const spvc_constant_id **constituents, size_t *count); +SPVC_PUBLIC_API unsigned long long spvc_constant_get_scalar_u64(spvc_constant constant, unsigned column, unsigned row); +SPVC_PUBLIC_API long long spvc_constant_get_scalar_i64(spvc_constant constant, unsigned column, unsigned row); +SPVC_PUBLIC_API spvc_type_id spvc_constant_get_type(spvc_constant constant); + +/* + * C implementation of the C++ api. + */ +SPVC_PUBLIC_API void spvc_constant_set_scalar_fp16(spvc_constant constant, unsigned column, unsigned row, unsigned short value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_fp32(spvc_constant constant, unsigned column, unsigned row, float value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_fp64(spvc_constant constant, unsigned column, unsigned row, double value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_u32(spvc_constant constant, unsigned column, unsigned row, unsigned value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_i32(spvc_constant constant, unsigned column, unsigned row, int value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_u64(spvc_constant constant, unsigned column, unsigned row, unsigned long long value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_i64(spvc_constant constant, unsigned column, unsigned row, long long value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_u16(spvc_constant constant, unsigned column, unsigned row, unsigned short value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_i16(spvc_constant constant, unsigned column, unsigned row, signed short value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_u8(spvc_constant constant, unsigned column, unsigned row, unsigned char value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_i8(spvc_constant constant, unsigned column, unsigned row, signed char value); + +/* + * Misc reflection + * Maps to C++ API. + */ +SPVC_PUBLIC_API spvc_bool spvc_compiler_get_binary_offset_for_decoration(spvc_compiler compiler, + spvc_variable_id id, + SpvDecoration decoration, + unsigned *word_offset); + +SPVC_PUBLIC_API spvc_bool spvc_compiler_buffer_is_hlsl_counter_buffer(spvc_compiler compiler, spvc_variable_id id); +SPVC_PUBLIC_API spvc_bool spvc_compiler_buffer_get_hlsl_counter_buffer(spvc_compiler compiler, spvc_variable_id id, + spvc_variable_id *counter_id); + +SPVC_PUBLIC_API spvc_result spvc_compiler_get_declared_capabilities(spvc_compiler compiler, + const SpvCapability **capabilities, + size_t *num_capabilities); +SPVC_PUBLIC_API spvc_result spvc_compiler_get_declared_extensions(spvc_compiler compiler, const char ***extensions, + size_t *num_extensions); + +SPVC_PUBLIC_API const char *spvc_compiler_get_remapped_declared_block_name(spvc_compiler compiler, spvc_variable_id id); +SPVC_PUBLIC_API spvc_result spvc_compiler_get_buffer_block_decorations(spvc_compiler compiler, spvc_variable_id id, + const SpvDecoration **decorations, + size_t *num_decorations); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_containers.hpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_containers.hpp new file mode 100644 index 0000000000..c496cb75be --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_containers.hpp @@ -0,0 +1,756 @@ +/* + * Copyright 2019-2021 Hans-Kristian Arntzen + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#ifndef SPIRV_CROSS_CONTAINERS_HPP +#define SPIRV_CROSS_CONTAINERS_HPP + +#include "spirv_cross_error_handling.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef SPIRV_CROSS_NAMESPACE_OVERRIDE +#define SPIRV_CROSS_NAMESPACE SPIRV_CROSS_NAMESPACE_OVERRIDE +#else +#define SPIRV_CROSS_NAMESPACE spirv_cross +#endif + +namespace SPIRV_CROSS_NAMESPACE +{ +#ifndef SPIRV_CROSS_FORCE_STL_TYPES +// std::aligned_storage does not support size == 0, so roll our own. +template +class AlignedBuffer +{ +public: + T *data() + { +#if defined(_MSC_VER) && _MSC_VER < 1900 + // MSVC 2013 workarounds, sigh ... + // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions. + // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want. + return reinterpret_cast(u.aligned_char); +#else + return reinterpret_cast(aligned_char); +#endif + } + +private: +#if defined(_MSC_VER) && _MSC_VER < 1900 + // MSVC 2013 workarounds, sigh ... + union + { + char aligned_char[sizeof(T) * N]; + double dummy_aligner; + } u; +#else + alignas(T) char aligned_char[sizeof(T) * N]; +#endif +}; + +template +class AlignedBuffer +{ +public: + T *data() + { + return nullptr; + } +}; + +// An immutable version of SmallVector which erases type information about storage. +template +class VectorView +{ +public: + T &operator[](size_t i) SPIRV_CROSS_NOEXCEPT + { + return ptr[i]; + } + + const T &operator[](size_t i) const SPIRV_CROSS_NOEXCEPT + { + return ptr[i]; + } + + bool empty() const SPIRV_CROSS_NOEXCEPT + { + return buffer_size == 0; + } + + size_t size() const SPIRV_CROSS_NOEXCEPT + { + return buffer_size; + } + + T *data() SPIRV_CROSS_NOEXCEPT + { + return ptr; + } + + const T *data() const SPIRV_CROSS_NOEXCEPT + { + return ptr; + } + + T *begin() SPIRV_CROSS_NOEXCEPT + { + return ptr; + } + + T *end() SPIRV_CROSS_NOEXCEPT + { + return ptr + buffer_size; + } + + const T *begin() const SPIRV_CROSS_NOEXCEPT + { + return ptr; + } + + const T *end() const SPIRV_CROSS_NOEXCEPT + { + return ptr + buffer_size; + } + + T &front() SPIRV_CROSS_NOEXCEPT + { + return ptr[0]; + } + + const T &front() const SPIRV_CROSS_NOEXCEPT + { + return ptr[0]; + } + + T &back() SPIRV_CROSS_NOEXCEPT + { + return ptr[buffer_size - 1]; + } + + const T &back() const SPIRV_CROSS_NOEXCEPT + { + return ptr[buffer_size - 1]; + } + + // Makes it easier to consume SmallVector. +#if defined(_MSC_VER) && _MSC_VER < 1900 + explicit operator std::vector() const + { + // Another MSVC 2013 workaround. It does not understand lvalue/rvalue qualified operations. + return std::vector(ptr, ptr + buffer_size); + } +#else + // Makes it easier to consume SmallVector. + explicit operator std::vector() const & + { + return std::vector(ptr, ptr + buffer_size); + } + + // If we are converting as an r-value, we can pilfer our elements. + explicit operator std::vector() && + { + return std::vector(std::make_move_iterator(ptr), std::make_move_iterator(ptr + buffer_size)); + } +#endif + + // Avoid sliced copies. Base class should only be read as a reference. + VectorView(const VectorView &) = delete; + void operator=(const VectorView &) = delete; + +protected: + VectorView() = default; + T *ptr = nullptr; + size_t buffer_size = 0; +}; + +// Simple vector which supports up to N elements inline, without malloc/free. +// We use a lot of throwaway vectors all over the place which triggers allocations. +// This class only implements the subset of std::vector we need in SPIRV-Cross. +// It is *NOT* a drop-in replacement in general projects. +template +class SmallVector : public VectorView +{ +public: + SmallVector() SPIRV_CROSS_NOEXCEPT + { + this->ptr = stack_storage.data(); + buffer_capacity = N; + } + + template + SmallVector(const U *arg_list_begin, const U *arg_list_end) SPIRV_CROSS_NOEXCEPT : SmallVector() + { + auto count = size_t(arg_list_end - arg_list_begin); + reserve(count); + for (size_t i = 0; i < count; i++, arg_list_begin++) + new (&this->ptr[i]) T(*arg_list_begin); + this->buffer_size = count; + } + + template + SmallVector(std::initializer_list init) SPIRV_CROSS_NOEXCEPT : SmallVector(init.begin(), init.end()) + { + } + + template + explicit SmallVector(const U (&init)[M]) SPIRV_CROSS_NOEXCEPT : SmallVector(init, init + M) + { + } + + SmallVector(SmallVector &&other) SPIRV_CROSS_NOEXCEPT : SmallVector() + { + *this = std::move(other); + } + + SmallVector &operator=(SmallVector &&other) SPIRV_CROSS_NOEXCEPT + { + clear(); + if (other.ptr != other.stack_storage.data()) + { + // Pilfer allocated pointer. + if (this->ptr != stack_storage.data()) + free(this->ptr); + this->ptr = other.ptr; + this->buffer_size = other.buffer_size; + buffer_capacity = other.buffer_capacity; + other.ptr = nullptr; + other.buffer_size = 0; + other.buffer_capacity = 0; + } + else + { + // Need to move the stack contents individually. + reserve(other.buffer_size); + for (size_t i = 0; i < other.buffer_size; i++) + { + new (&this->ptr[i]) T(std::move(other.ptr[i])); + other.ptr[i].~T(); + } + this->buffer_size = other.buffer_size; + other.buffer_size = 0; + } + return *this; + } + + SmallVector(const SmallVector &other) SPIRV_CROSS_NOEXCEPT : SmallVector() + { + *this = other; + } + + SmallVector &operator=(const SmallVector &other) SPIRV_CROSS_NOEXCEPT + { + if (this == &other) + return *this; + + clear(); + reserve(other.buffer_size); + for (size_t i = 0; i < other.buffer_size; i++) + new (&this->ptr[i]) T(other.ptr[i]); + this->buffer_size = other.buffer_size; + return *this; + } + + explicit SmallVector(size_t count) SPIRV_CROSS_NOEXCEPT : SmallVector() + { + resize(count); + } + + ~SmallVector() + { + clear(); + if (this->ptr != stack_storage.data()) + free(this->ptr); + } + + void clear() SPIRV_CROSS_NOEXCEPT + { + for (size_t i = 0; i < this->buffer_size; i++) + this->ptr[i].~T(); + this->buffer_size = 0; + } + + void push_back(const T &t) SPIRV_CROSS_NOEXCEPT + { + reserve(this->buffer_size + 1); + new (&this->ptr[this->buffer_size]) T(t); + this->buffer_size++; + } + + void push_back(T &&t) SPIRV_CROSS_NOEXCEPT + { + reserve(this->buffer_size + 1); + new (&this->ptr[this->buffer_size]) T(std::move(t)); + this->buffer_size++; + } + + void pop_back() SPIRV_CROSS_NOEXCEPT + { + // Work around false positive warning on GCC 8.3. + // Calling pop_back on empty vector is undefined. + if (!this->empty()) + resize(this->buffer_size - 1); + } + + template + void emplace_back(Ts &&... ts) SPIRV_CROSS_NOEXCEPT + { + reserve(this->buffer_size + 1); + new (&this->ptr[this->buffer_size]) T(std::forward(ts)...); + this->buffer_size++; + } + + void reserve(size_t count) SPIRV_CROSS_NOEXCEPT + { + if ((count > (std::numeric_limits::max)() / sizeof(T)) || + (count > (std::numeric_limits::max)() / 2)) + { + // Only way this should ever happen is with garbage input, terminate. + std::terminate(); + } + + if (count > buffer_capacity) + { + size_t target_capacity = buffer_capacity; + if (target_capacity == 0) + target_capacity = 1; + + // Weird parens works around macro issues on Windows if NOMINMAX is not used. + target_capacity = (std::max)(target_capacity, N); + + // Need to ensure there is a POT value of target capacity which is larger than count, + // otherwise this will overflow. + while (target_capacity < count) + target_capacity <<= 1u; + + T *new_buffer = + target_capacity > N ? static_cast(malloc(target_capacity * sizeof(T))) : stack_storage.data(); + + // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery. + if (!new_buffer) + std::terminate(); + + // In case for some reason two allocations both come from same stack. + if (new_buffer != this->ptr) + { + // We don't deal with types which can throw in move constructor. + for (size_t i = 0; i < this->buffer_size; i++) + { + new (&new_buffer[i]) T(std::move(this->ptr[i])); + this->ptr[i].~T(); + } + } + + if (this->ptr != stack_storage.data()) + free(this->ptr); + this->ptr = new_buffer; + buffer_capacity = target_capacity; + } + } + + void insert(T *itr, const T *insert_begin, const T *insert_end) SPIRV_CROSS_NOEXCEPT + { + auto count = size_t(insert_end - insert_begin); + if (itr == this->end()) + { + reserve(this->buffer_size + count); + for (size_t i = 0; i < count; i++, insert_begin++) + new (&this->ptr[this->buffer_size + i]) T(*insert_begin); + this->buffer_size += count; + } + else + { + if (this->buffer_size + count > buffer_capacity) + { + auto target_capacity = this->buffer_size + count; + if (target_capacity == 0) + target_capacity = 1; + if (target_capacity < N) + target_capacity = N; + + while (target_capacity < count) + target_capacity <<= 1u; + + // Need to allocate new buffer. Move everything to a new buffer. + T *new_buffer = + target_capacity > N ? static_cast(malloc(target_capacity * sizeof(T))) : stack_storage.data(); + + // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery. + if (!new_buffer) + std::terminate(); + + // First, move elements from source buffer to new buffer. + // We don't deal with types which can throw in move constructor. + auto *target_itr = new_buffer; + auto *original_source_itr = this->begin(); + + if (new_buffer != this->ptr) + { + while (original_source_itr != itr) + { + new (target_itr) T(std::move(*original_source_itr)); + original_source_itr->~T(); + ++original_source_itr; + ++target_itr; + } + } + + // Copy-construct new elements. + for (auto *source_itr = insert_begin; source_itr != insert_end; ++source_itr, ++target_itr) + new (target_itr) T(*source_itr); + + // Move over the other half. + if (new_buffer != this->ptr || insert_begin != insert_end) + { + while (original_source_itr != this->end()) + { + new (target_itr) T(std::move(*original_source_itr)); + original_source_itr->~T(); + ++original_source_itr; + ++target_itr; + } + } + + if (this->ptr != stack_storage.data()) + free(this->ptr); + this->ptr = new_buffer; + buffer_capacity = target_capacity; + } + else + { + // Move in place, need to be a bit careful about which elements are constructed and which are not. + // Move the end and construct the new elements. + auto *target_itr = this->end() + count; + auto *source_itr = this->end(); + while (target_itr != this->end() && source_itr != itr) + { + --target_itr; + --source_itr; + new (target_itr) T(std::move(*source_itr)); + } + + // For already constructed elements we can move-assign. + std::move_backward(itr, source_itr, target_itr); + + // For the inserts which go to already constructed elements, we can do a plain copy. + while (itr != this->end() && insert_begin != insert_end) + *itr++ = *insert_begin++; + + // For inserts into newly allocated memory, we must copy-construct instead. + while (insert_begin != insert_end) + { + new (itr) T(*insert_begin); + ++itr; + ++insert_begin; + } + } + + this->buffer_size += count; + } + } + + void insert(T *itr, const T &value) SPIRV_CROSS_NOEXCEPT + { + insert(itr, &value, &value + 1); + } + + T *erase(T *itr) SPIRV_CROSS_NOEXCEPT + { + std::move(itr + 1, this->end(), itr); + this->ptr[--this->buffer_size].~T(); + return itr; + } + + void erase(T *start_erase, T *end_erase) SPIRV_CROSS_NOEXCEPT + { + if (end_erase == this->end()) + { + resize(size_t(start_erase - this->begin())); + } + else + { + auto new_size = this->buffer_size - (end_erase - start_erase); + std::move(end_erase, this->end(), start_erase); + resize(new_size); + } + } + + void resize(size_t new_size) SPIRV_CROSS_NOEXCEPT + { + if (new_size < this->buffer_size) + { + for (size_t i = new_size; i < this->buffer_size; i++) + this->ptr[i].~T(); + } + else if (new_size > this->buffer_size) + { + reserve(new_size); + for (size_t i = this->buffer_size; i < new_size; i++) + new (&this->ptr[i]) T(); + } + + this->buffer_size = new_size; + } + +private: + size_t buffer_capacity = 0; + AlignedBuffer stack_storage; +}; + +// A vector without stack storage. +// Could also be a typedef-ed to std::vector, +// but might as well use the one we have. +template +using Vector = SmallVector; + +#else // SPIRV_CROSS_FORCE_STL_TYPES + +template +using SmallVector = std::vector; +template +using Vector = std::vector; +template +using VectorView = std::vector; + +#endif // SPIRV_CROSS_FORCE_STL_TYPES + +// An object pool which we use for allocating IVariant-derived objects. +// We know we are going to allocate a bunch of objects of each type, +// so amortize the mallocs. +class ObjectPoolBase +{ +public: + virtual ~ObjectPoolBase() = default; + virtual void deallocate_opaque(void *ptr) = 0; +}; + +template +class ObjectPool : public ObjectPoolBase +{ +public: + explicit ObjectPool(unsigned start_object_count_ = 16) + : start_object_count(start_object_count_) + { + } + + template + T *allocate(P &&... p) + { + if (vacants.empty()) + { + unsigned num_objects = start_object_count << memory.size(); + T *ptr = static_cast(malloc(num_objects * sizeof(T))); + if (!ptr) + return nullptr; + + vacants.reserve(num_objects); + for (unsigned i = 0; i < num_objects; i++) + vacants.push_back(&ptr[i]); + + memory.emplace_back(ptr); + } + + T *ptr = vacants.back(); + vacants.pop_back(); + new (ptr) T(std::forward

(p)...); + return ptr; + } + + void deallocate(T *ptr) + { + ptr->~T(); + vacants.push_back(ptr); + } + + void deallocate_opaque(void *ptr) override + { + deallocate(static_cast(ptr)); + } + + void clear() + { + vacants.clear(); + memory.clear(); + } + +protected: + Vector vacants; + + struct MallocDeleter + { + void operator()(T *ptr) + { + ::free(ptr); + } + }; + + SmallVector> memory; + unsigned start_object_count; +}; + +template +class StringStream +{ +public: + StringStream() + { + reset(); + } + + ~StringStream() + { + reset(); + } + + // Disable copies and moves. Makes it easier to implement, and we don't need it. + StringStream(const StringStream &) = delete; + void operator=(const StringStream &) = delete; + + template ::value, int>::type = 0> + StringStream &operator<<(const T &t) + { + auto s = std::to_string(t); + append(s.data(), s.size()); + return *this; + } + + // Only overload this to make float/double conversions ambiguous. + StringStream &operator<<(uint32_t v) + { + auto s = std::to_string(v); + append(s.data(), s.size()); + return *this; + } + + StringStream &operator<<(char c) + { + append(&c, 1); + return *this; + } + + StringStream &operator<<(const std::string &s) + { + append(s.data(), s.size()); + return *this; + } + + StringStream &operator<<(const char *s) + { + append(s, strlen(s)); + return *this; + } + + template + StringStream &operator<<(const char (&s)[N]) + { + append(s, strlen(s)); + return *this; + } + + std::string str() const + { + std::string ret; + size_t target_size = 0; + for (auto &saved : saved_buffers) + target_size += saved.offset; + target_size += current_buffer.offset; + ret.reserve(target_size); + + for (auto &saved : saved_buffers) + ret.insert(ret.end(), saved.buffer, saved.buffer + saved.offset); + ret.insert(ret.end(), current_buffer.buffer, current_buffer.buffer + current_buffer.offset); + return ret; + } + + void reset() + { + for (auto &saved : saved_buffers) + if (saved.buffer != stack_buffer) + free(saved.buffer); + if (current_buffer.buffer != stack_buffer) + free(current_buffer.buffer); + + saved_buffers.clear(); + current_buffer.buffer = stack_buffer; + current_buffer.offset = 0; + current_buffer.size = sizeof(stack_buffer); + } + +private: + struct Buffer + { + char *buffer = nullptr; + size_t offset = 0; + size_t size = 0; + }; + Buffer current_buffer; + char stack_buffer[StackSize]; + SmallVector saved_buffers; + + void append(const char *s, size_t len) + { + size_t avail = current_buffer.size - current_buffer.offset; + if (avail < len) + { + if (avail > 0) + { + memcpy(current_buffer.buffer + current_buffer.offset, s, avail); + s += avail; + len -= avail; + current_buffer.offset += avail; + } + + saved_buffers.push_back(current_buffer); + size_t target_size = len > BlockSize ? len : BlockSize; + current_buffer.buffer = static_cast(malloc(target_size)); + if (!current_buffer.buffer) + SPIRV_CROSS_THROW("Out of memory."); + + memcpy(current_buffer.buffer, s, len); + current_buffer.offset = len; + current_buffer.size = target_size; + } + else + { + memcpy(current_buffer.buffer + current_buffer.offset, s, len); + current_buffer.offset += len; + } + } +}; + +} // namespace SPIRV_CROSS_NAMESPACE + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_error_handling.hpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_error_handling.hpp new file mode 100644 index 0000000000..91e6cf4f86 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_error_handling.hpp @@ -0,0 +1,99 @@ +/* + * Copyright 2015-2021 Arm Limited + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#ifndef SPIRV_CROSS_ERROR_HANDLING +#define SPIRV_CROSS_ERROR_HANDLING + +#include +#include +#include +#ifndef SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS +#include +#endif + +#ifdef SPIRV_CROSS_NAMESPACE_OVERRIDE +#define SPIRV_CROSS_NAMESPACE SPIRV_CROSS_NAMESPACE_OVERRIDE +#else +#define SPIRV_CROSS_NAMESPACE spirv_cross +#endif + +namespace SPIRV_CROSS_NAMESPACE +{ +#ifdef SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS +#if !defined(_MSC_VER) || defined(__clang__) +[[noreturn]] +#elif defined(_MSC_VER) +__declspec(noreturn) +#endif +inline void +report_and_abort(const std::string &msg) +{ +#ifdef NDEBUG + (void)msg; +#else + fprintf(stderr, "There was a compiler error: %s\n", msg.c_str()); +#endif + fflush(stderr); + abort(); +} + +#define SPIRV_CROSS_THROW(x) report_and_abort(x) +#else +class CompilerError : public std::runtime_error +{ +public: + explicit CompilerError(const std::string &str) + : std::runtime_error(str) + { + } + + explicit CompilerError(const char *str) + : std::runtime_error(str) + { + } +}; + +#define SPIRV_CROSS_THROW(x) throw CompilerError(x) +#endif + +// MSVC 2013 does not have noexcept. We need this for Variant to get move constructor to work correctly +// instead of copy constructor. +// MSVC 2013 ignores that move constructors cannot throw in std::vector, so just don't define it. +#if defined(_MSC_VER) && _MSC_VER < 1900 +#define SPIRV_CROSS_NOEXCEPT +#else +#define SPIRV_CROSS_NOEXCEPT noexcept +#endif + +#if __cplusplus >= 201402l +#define SPIRV_CROSS_DEPRECATED(reason) [[deprecated(reason)]] +#elif defined(__GNUC__) +#define SPIRV_CROSS_DEPRECATED(reason) __attribute__((deprecated)) +#elif defined(_MSC_VER) +#define SPIRV_CROSS_DEPRECATED(reason) __declspec(deprecated(reason)) +#else +#define SPIRV_CROSS_DEPRECATED(reason) +#endif +} // namespace SPIRV_CROSS_NAMESPACE + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_parsed_ir.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_parsed_ir.cpp new file mode 100644 index 0000000000..bb9a5f58ed --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_parsed_ir.cpp @@ -0,0 +1,1123 @@ +/* + * Copyright 2018-2021 Arm Limited + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#include "spirv_cross_parsed_ir.hpp" +#include +#include + +using namespace std; +using namespace SPIRV_CROSS_SPV_HEADER_NAMESPACE; + +namespace SPIRV_CROSS_NAMESPACE +{ +ParsedIR::ParsedIR() +{ + // If we move ParsedIR, we need to make sure the pointer stays fixed since the child Variant objects consume a pointer to this group, + // so need an extra pointer here. + pool_group.reset(new ObjectPoolGroup); + + pool_group->pools[TypeType].reset(new ObjectPool); + pool_group->pools[TypeVariable].reset(new ObjectPool); + pool_group->pools[TypeConstant].reset(new ObjectPool); + pool_group->pools[TypeFunction].reset(new ObjectPool); + pool_group->pools[TypeFunctionPrototype].reset(new ObjectPool); + pool_group->pools[TypeBlock].reset(new ObjectPool); + pool_group->pools[TypeExtension].reset(new ObjectPool); + pool_group->pools[TypeExpression].reset(new ObjectPool); + pool_group->pools[TypeConstantOp].reset(new ObjectPool); + pool_group->pools[TypeCombinedImageSampler].reset(new ObjectPool); + pool_group->pools[TypeAccessChain].reset(new ObjectPool); + pool_group->pools[TypeUndef].reset(new ObjectPool); + pool_group->pools[TypeString].reset(new ObjectPool); + pool_group->pools[TypeDebugLocalVariable].reset(new ObjectPool); +} + +// Should have been default-implemented, but need this on MSVC 2013. +ParsedIR::ParsedIR(ParsedIR &&other) SPIRV_CROSS_NOEXCEPT +{ + *this = std::move(other); +} + +ParsedIR &ParsedIR::operator=(ParsedIR &&other) SPIRV_CROSS_NOEXCEPT +{ + if (this != &other) + { + pool_group = std::move(other.pool_group); + spirv = std::move(other.spirv); + meta = std::move(other.meta); + for (int i = 0; i < TypeCount; i++) + ids_for_type[i] = std::move(other.ids_for_type[i]); + ids_for_constant_undef_or_type = std::move(other.ids_for_constant_undef_or_type); + ids_for_constant_or_variable = std::move(other.ids_for_constant_or_variable); + declared_capabilities = std::move(other.declared_capabilities); + declared_extensions = std::move(other.declared_extensions); + block_meta = std::move(other.block_meta); + continue_block_to_loop_header = std::move(other.continue_block_to_loop_header); + entry_points = std::move(other.entry_points); + ids = std::move(other.ids); + addressing_model = other.addressing_model; + memory_model = other.memory_model; + + default_entry_point = other.default_entry_point; + sources = std::move(other.sources); + loop_iteration_depth_hard = other.loop_iteration_depth_hard; + loop_iteration_depth_soft = other.loop_iteration_depth_soft; + + meta_needing_name_fixup = std::move(other.meta_needing_name_fixup); + load_type_width = std::move(other.load_type_width); + } + return *this; +} + +ParsedIR::ParsedIR(const ParsedIR &other) + : ParsedIR() +{ + *this = other; +} + +ParsedIR &ParsedIR::operator=(const ParsedIR &other) +{ + if (this != &other) + { + spirv = other.spirv; + meta = other.meta; + for (int i = 0; i < TypeCount; i++) + ids_for_type[i] = other.ids_for_type[i]; + ids_for_constant_undef_or_type = other.ids_for_constant_undef_or_type; + ids_for_constant_or_variable = other.ids_for_constant_or_variable; + declared_capabilities = other.declared_capabilities; + declared_extensions = other.declared_extensions; + block_meta = other.block_meta; + continue_block_to_loop_header = other.continue_block_to_loop_header; + entry_points = other.entry_points; + default_entry_point = other.default_entry_point; + sources = other.sources; + loop_iteration_depth_hard = other.loop_iteration_depth_hard; + loop_iteration_depth_soft = other.loop_iteration_depth_soft; + addressing_model = other.addressing_model; + memory_model = other.memory_model; + + + meta_needing_name_fixup = other.meta_needing_name_fixup; + load_type_width = other.load_type_width; + + // Very deliberate copying of IDs. There is no default copy constructor, nor a simple default constructor. + // Construct object first so we have the correct allocator set-up, then we can copy object into our new pool group. + ids.clear(); + ids.reserve(other.ids.size()); + for (size_t i = 0; i < other.ids.size(); i++) + { + ids.emplace_back(pool_group.get()); + ids.back() = other.ids[i]; + } + } + return *this; +} + +void ParsedIR::set_id_bounds(uint32_t bounds) +{ + ids.reserve(bounds); + while (ids.size() < bounds) + ids.emplace_back(pool_group.get()); + + block_meta.resize(bounds); +} + +// Roll our own versions of these functions to avoid potential locale shenanigans. +static bool is_alpha(char c) +{ + return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); +} + +static bool is_numeric(char c) +{ + return c >= '0' && c <= '9'; +} + +static bool is_alphanumeric(char c) +{ + return is_alpha(c) || is_numeric(c); +} + +static bool is_valid_identifier(const string &name) +{ + if (name.empty()) + return true; + + if (is_numeric(name[0])) + return false; + + for (auto c : name) + if (!is_alphanumeric(c) && c != '_') + return false; + + bool saw_underscore = false; + // Two underscores in a row is not a valid identifier either. + // Technically reserved, but it's easier to treat it as invalid. + for (auto c : name) + { + bool is_underscore = c == '_'; + if (is_underscore && saw_underscore) + return false; + saw_underscore = is_underscore; + } + + return true; +} + +static bool is_reserved_prefix(const string &name) +{ + // Generic reserved identifiers used by the implementation. + return name.compare(0, 3, "gl_", 3) == 0 || + // Ignore this case for now, might rewrite internal code to always use spv prefix. + //name.compare(0, 11, "SPIRV_Cross", 11) == 0 || + name.compare(0, 3, "spv", 3) == 0; +} + +static bool is_reserved_identifier(const string &name, bool member, bool allow_reserved_prefixes) +{ + if (!allow_reserved_prefixes && is_reserved_prefix(name)) + return true; + + if (member) + { + // Reserved member identifiers come in one form: + // _m[0-9]+$. + if (name.size() < 3) + return false; + + if (name.compare(0, 2, "_m", 2) != 0) + return false; + + size_t index = 2; + while (index < name.size() && is_numeric(name[index])) + index++; + + return index == name.size(); + } + else + { + // Reserved non-member identifiers come in two forms: + // _[0-9]+$, used for temporaries which map directly to a SPIR-V ID. + // _[0-9]+_, used for auxillary temporaries which derived from a SPIR-V ID. + if (name.size() < 2) + return false; + + if (name[0] != '_' || !is_numeric(name[1])) + return false; + + size_t index = 2; + while (index < name.size() && is_numeric(name[index])) + index++; + + return index == name.size() || (index < name.size() && name[index] == '_'); + } +} + +bool ParsedIR::is_globally_reserved_identifier(std::string &str, bool allow_reserved_prefixes) +{ + return is_reserved_identifier(str, false, allow_reserved_prefixes); +} + +uint32_t ParsedIR::get_spirv_version() const +{ + return spirv[1]; +} + +static string make_unreserved_identifier(const string &name) +{ + if (is_reserved_prefix(name)) + return "_RESERVED_IDENTIFIER_FIXUP_" + name; + else + return "_RESERVED_IDENTIFIER_FIXUP" + name; +} + +void ParsedIR::sanitize_underscores(std::string &str) +{ + // Compact adjacent underscores to make it valid. + auto dst = str.begin(); + auto src = dst; + bool saw_underscore = false; + while (src != str.end()) + { + bool is_underscore = *src == '_'; + if (saw_underscore && is_underscore) + { + src++; + } + else + { + if (dst != src) + *dst = *src; + dst++; + src++; + saw_underscore = is_underscore; + } + } + str.erase(dst, str.end()); +} + +static string ensure_valid_identifier(const string &name) +{ + // Functions in glslangValidator are mangled with name( stuff. + // Normally, we would never see '(' in any legal identifiers, so just strip them out. + auto str = name.substr(0, name.find('(')); + + if (str.empty()) + return str; + + if (is_numeric(str[0])) + str[0] = '_'; + + for (auto &c : str) + if (!is_alphanumeric(c) && c != '_') + c = '_'; + + ParsedIR::sanitize_underscores(str); + return str; +} + +const string &ParsedIR::get_name(ID id) const +{ + auto *m = find_meta(id); + if (m) + return m->decoration.alias; + else + return empty_string; +} + +const string &ParsedIR::get_member_name(TypeID id, uint32_t index) const +{ + auto *m = find_meta(id); + if (m) + { + if (index >= m->members.size()) + return empty_string; + return m->members[index].alias; + } + else + return empty_string; +} + +void ParsedIR::sanitize_identifier(std::string &name, bool member, bool allow_reserved_prefixes) +{ + if (!is_valid_identifier(name)) + name = ensure_valid_identifier(name); + if (is_reserved_identifier(name, member, allow_reserved_prefixes)) + name = make_unreserved_identifier(name); +} + +void ParsedIR::fixup_reserved_names() +{ + for (uint32_t id : meta_needing_name_fixup) + { + // Don't rename remapped variables like 'gl_LastFragDepthARM'. + if (ids[id].get_type() == TypeVariable && get(id).remapped_variable) + continue; + + auto &m = meta[id]; + sanitize_identifier(m.decoration.alias, false, false); + for (auto &memb : m.members) + sanitize_identifier(memb.alias, true, false); + } + meta_needing_name_fixup.clear(); +} + +void ParsedIR::set_name(ID id, const string &name) +{ + auto &m = meta[id]; + m.decoration.alias = name; + if (!is_valid_identifier(name) || is_reserved_identifier(name, false, false)) + meta_needing_name_fixup.insert(id); +} + +void ParsedIR::set_member_name(TypeID id, uint32_t index, const string &name) +{ + auto &m = meta[id]; + m.members.resize(max(m.members.size(), size_t(index) + 1)); + m.members[index].alias = name; + if (!is_valid_identifier(name) || is_reserved_identifier(name, true, false)) + meta_needing_name_fixup.insert(id); +} + +void ParsedIR::set_decoration_string(ID id, Decoration decoration, const string &argument) +{ + auto &dec = meta[id].decoration; + dec.decoration_flags.set(decoration); + + switch (decoration) + { + case DecorationUserSemantic: + dec.user_semantic = argument; + break; + + case DecorationUserTypeGOOGLE: + dec.user_type = argument; + break; + + default: + break; + } +} + +void ParsedIR::set_decoration(ID id, Decoration decoration, uint32_t argument) +{ + auto &dec = meta[id].decoration; + dec.decoration_flags.set(decoration); + + switch (decoration) + { + case DecorationBuiltIn: + dec.builtin = true; + dec.builtin_type = static_cast(argument); + break; + + case DecorationLocation: + dec.location = argument; + break; + + case DecorationComponent: + dec.component = argument; + break; + + case DecorationOffset: + dec.offset = argument; + break; + + case DecorationXfbBuffer: + dec.xfb_buffer = argument; + break; + + case DecorationXfbStride: + dec.xfb_stride = argument; + break; + + case DecorationStream: + dec.stream = argument; + break; + + case DecorationArrayStride: + dec.array_stride = argument; + break; + + case DecorationMatrixStride: + dec.matrix_stride = argument; + break; + + case DecorationBinding: + dec.binding = argument; + break; + + case DecorationDescriptorSet: + dec.set = argument; + break; + + case DecorationInputAttachmentIndex: + dec.input_attachment = argument; + break; + + case DecorationSpecId: + dec.spec_id = argument; + break; + + case DecorationIndex: + dec.index = argument; + break; + + case DecorationHlslCounterBufferGOOGLE: + meta[id].hlsl_magic_counter_buffer = argument; + meta[argument].hlsl_is_magic_counter_buffer = true; + break; + + case DecorationFPRoundingMode: + dec.fp_rounding_mode = static_cast(argument); + break; + + case DecorationFPFastMathMode: + dec.fp_fast_math_mode = static_cast(argument); + break; + + default: + break; + } +} + +void ParsedIR::set_member_decoration(TypeID id, uint32_t index, Decoration decoration, uint32_t argument) +{ + auto &m = meta[id]; + m.members.resize(max(m.members.size(), size_t(index) + 1)); + auto &dec = m.members[index]; + dec.decoration_flags.set(decoration); + + switch (decoration) + { + case DecorationBuiltIn: + dec.builtin = true; + dec.builtin_type = static_cast(argument); + break; + + case DecorationLocation: + dec.location = argument; + break; + + case DecorationComponent: + dec.component = argument; + break; + + case DecorationBinding: + dec.binding = argument; + break; + + case DecorationOffset: + dec.offset = argument; + break; + + case DecorationXfbBuffer: + dec.xfb_buffer = argument; + break; + + case DecorationXfbStride: + dec.xfb_stride = argument; + break; + + case DecorationStream: + dec.stream = argument; + break; + + case DecorationSpecId: + dec.spec_id = argument; + break; + + case DecorationMatrixStride: + dec.matrix_stride = argument; + break; + + case DecorationIndex: + dec.index = argument; + break; + + default: + break; + } +} + +// Recursively marks any constants referenced by the specified constant instruction as being used +// as an array length. The id must be a constant instruction (SPIRConstant or SPIRConstantOp). +void ParsedIR::mark_used_as_array_length(ID id) +{ + switch (ids[id].get_type()) + { + case TypeConstant: + { + auto &c = get(id); + c.is_used_as_array_length = true; + + // Mark composite dependencies as well. + for (auto &sub_id: c.m.id) + if (sub_id) + mark_used_as_array_length(sub_id); + + for (uint32_t col = 0; col < c.m.columns; col++) + { + for (auto &sub_id : c.m.c[col].id) + if (sub_id) + mark_used_as_array_length(sub_id); + } + + for (auto &sub_id : c.subconstants) + if (sub_id) + mark_used_as_array_length(sub_id); + break; + } + + case TypeConstantOp: + { + auto &cop = get(id); + if (cop.opcode == OpCompositeExtract) + mark_used_as_array_length(cop.arguments[0]); + else if (cop.opcode == OpCompositeInsert) + { + mark_used_as_array_length(cop.arguments[0]); + mark_used_as_array_length(cop.arguments[1]); + } + else + for (uint32_t arg_id : cop.arguments) + mark_used_as_array_length(arg_id); + break; + } + + case TypeUndef: + break; + + default: + assert(0); + } +} + +Bitset ParsedIR::get_buffer_block_type_flags(const SPIRType &type) const +{ + if (type.member_types.empty()) + return {}; + + Bitset all_members_flags = get_member_decoration_bitset(type.self, 0); + for (uint32_t i = 1; i < uint32_t(type.member_types.size()); i++) + all_members_flags.merge_and(get_member_decoration_bitset(type.self, i)); + return all_members_flags; +} + +Bitset ParsedIR::get_buffer_block_flags(const SPIRVariable &var) const +{ + auto &type = get(var.basetype); + if (type.basetype != SPIRType::Struct) + SPIRV_CROSS_THROW("Cannot get buffer block flags for non-buffer variable."); + + // Some flags like non-writable, non-readable are actually found + // as member decorations. If all members have a decoration set, propagate + // the decoration up as a regular variable decoration. + Bitset base_flags; + auto *m = find_meta(var.self); + if (m) + base_flags = m->decoration.decoration_flags; + + if (type.member_types.empty()) + return base_flags; + + auto all_members_flags = get_buffer_block_type_flags(type); + base_flags.merge_or(all_members_flags); + return base_flags; +} + +const Bitset &ParsedIR::get_member_decoration_bitset(TypeID id, uint32_t index) const +{ + auto *m = find_meta(id); + if (m) + { + if (index >= m->members.size()) + return cleared_bitset; + return m->members[index].decoration_flags; + } + else + return cleared_bitset; +} + +bool ParsedIR::has_decoration(ID id, Decoration decoration) const +{ + return get_decoration_bitset(id).get(decoration); +} + +uint32_t ParsedIR::get_decoration(ID id, Decoration decoration) const +{ + auto *m = find_meta(id); + if (!m) + return 0; + + auto &dec = m->decoration; + if (!dec.decoration_flags.get(decoration)) + return 0; + + switch (decoration) + { + case DecorationBuiltIn: + return dec.builtin_type; + case DecorationLocation: + return dec.location; + case DecorationComponent: + return dec.component; + case DecorationOffset: + return dec.offset; + case DecorationXfbBuffer: + return dec.xfb_buffer; + case DecorationXfbStride: + return dec.xfb_stride; + case DecorationStream: + return dec.stream; + case DecorationBinding: + return dec.binding; + case DecorationDescriptorSet: + return dec.set; + case DecorationInputAttachmentIndex: + return dec.input_attachment; + case DecorationSpecId: + return dec.spec_id; + case DecorationArrayStride: + return dec.array_stride; + case DecorationMatrixStride: + return dec.matrix_stride; + case DecorationIndex: + return dec.index; + case DecorationFPRoundingMode: + return dec.fp_rounding_mode; + case DecorationFPFastMathMode: + return dec.fp_fast_math_mode; + default: + return 1; + } +} + +const string &ParsedIR::get_decoration_string(ID id, Decoration decoration) const +{ + auto *m = find_meta(id); + if (!m) + return empty_string; + + auto &dec = m->decoration; + + if (!dec.decoration_flags.get(decoration)) + return empty_string; + + switch (decoration) + { + case DecorationUserSemantic: + return dec.user_semantic; + + case DecorationUserTypeGOOGLE: + return dec.user_type; + + default: + return empty_string; + } +} + +void ParsedIR::unset_decoration(ID id, Decoration decoration) +{ + auto &dec = meta[id].decoration; + dec.decoration_flags.clear(decoration); + switch (decoration) + { + case DecorationBuiltIn: + dec.builtin = false; + break; + + case DecorationLocation: + dec.location = 0; + break; + + case DecorationComponent: + dec.component = 0; + break; + + case DecorationOffset: + dec.offset = 0; + break; + + case DecorationXfbBuffer: + dec.xfb_buffer = 0; + break; + + case DecorationXfbStride: + dec.xfb_stride = 0; + break; + + case DecorationStream: + dec.stream = 0; + break; + + case DecorationBinding: + dec.binding = 0; + break; + + case DecorationDescriptorSet: + dec.set = 0; + break; + + case DecorationInputAttachmentIndex: + dec.input_attachment = 0; + break; + + case DecorationSpecId: + dec.spec_id = 0; + break; + + case DecorationUserSemantic: + dec.user_semantic.clear(); + break; + + case DecorationFPRoundingMode: + dec.fp_rounding_mode = FPRoundingModeMax; + break; + + case DecorationFPFastMathMode: + dec.fp_fast_math_mode = FPFastMathModeMaskNone; + break; + + case DecorationHlslCounterBufferGOOGLE: + { + auto &counter = meta[id].hlsl_magic_counter_buffer; + if (counter) + { + meta[counter].hlsl_is_magic_counter_buffer = false; + counter = 0; + } + break; + } + + default: + break; + } +} + +bool ParsedIR::has_member_decoration(TypeID id, uint32_t index, Decoration decoration) const +{ + return get_member_decoration_bitset(id, index).get(decoration); +} + +uint32_t ParsedIR::get_member_decoration(TypeID id, uint32_t index, Decoration decoration) const +{ + auto *m = find_meta(id); + if (!m) + return 0; + + if (index >= m->members.size()) + return 0; + + auto &dec = m->members[index]; + if (!dec.decoration_flags.get(decoration)) + return 0; + + switch (decoration) + { + case DecorationBuiltIn: + return dec.builtin_type; + case DecorationLocation: + return dec.location; + case DecorationComponent: + return dec.component; + case DecorationBinding: + return dec.binding; + case DecorationOffset: + return dec.offset; + case DecorationXfbBuffer: + return dec.xfb_buffer; + case DecorationXfbStride: + return dec.xfb_stride; + case DecorationStream: + return dec.stream; + case DecorationSpecId: + return dec.spec_id; + case DecorationMatrixStride: + return dec.matrix_stride; + case DecorationIndex: + return dec.index; + default: + return 1; + } +} + +const Bitset &ParsedIR::get_decoration_bitset(ID id) const +{ + auto *m = find_meta(id); + if (m) + { + auto &dec = m->decoration; + return dec.decoration_flags; + } + else + return cleared_bitset; +} + +void ParsedIR::set_member_decoration_string(TypeID id, uint32_t index, Decoration decoration, const string &argument) +{ + auto &m = meta[id]; + m.members.resize(max(m.members.size(), size_t(index) + 1)); + auto &dec = meta[id].members[index]; + dec.decoration_flags.set(decoration); + + switch (decoration) + { + case DecorationUserSemantic: + dec.user_semantic = argument; + break; + + default: + break; + } +} + +const string &ParsedIR::get_member_decoration_string(TypeID id, uint32_t index, Decoration decoration) const +{ + auto *m = find_meta(id); + if (m) + { + if (!has_member_decoration(id, index, decoration)) + return empty_string; + + auto &dec = m->members[index]; + + switch (decoration) + { + case DecorationUserSemantic: + return dec.user_semantic; + + default: + return empty_string; + } + } + else + return empty_string; +} + +void ParsedIR::unset_member_decoration(TypeID id, uint32_t index, Decoration decoration) +{ + auto &m = meta[id]; + if (index >= m.members.size()) + return; + + auto &dec = m.members[index]; + + dec.decoration_flags.clear(decoration); + switch (decoration) + { + case DecorationBuiltIn: + dec.builtin = false; + break; + + case DecorationLocation: + dec.location = 0; + break; + + case DecorationComponent: + dec.component = 0; + break; + + case DecorationOffset: + dec.offset = 0; + break; + + case DecorationXfbBuffer: + dec.xfb_buffer = 0; + break; + + case DecorationXfbStride: + dec.xfb_stride = 0; + break; + + case DecorationStream: + dec.stream = 0; + break; + + case DecorationSpecId: + dec.spec_id = 0; + break; + + case DecorationUserSemantic: + dec.user_semantic.clear(); + break; + + default: + break; + } +} + +uint32_t ParsedIR::increase_bound_by(uint32_t incr_amount) +{ + auto curr_bound = ids.size(); + auto new_bound = curr_bound + incr_amount; + + ids.reserve(ids.size() + incr_amount); + for (uint32_t i = 0; i < incr_amount; i++) + ids.emplace_back(pool_group.get()); + + block_meta.resize(new_bound); + return uint32_t(curr_bound); +} + +void ParsedIR::remove_typed_id(Types type, ID id) +{ + auto &type_ids = ids_for_type[type]; + type_ids.erase(remove(begin(type_ids), end(type_ids), id), end(type_ids)); +} + +void ParsedIR::reset_all_of_type(Types type) +{ + for (auto &id : ids_for_type[type]) + if (ids[id].get_type() == type) + ids[id].reset(); + + ids_for_type[type].clear(); +} + +void ParsedIR::add_typed_id(Types type, ID id) +{ + assert(id < ids.size()); + + if (loop_iteration_depth_hard != 0) + SPIRV_CROSS_THROW("Cannot add typed ID while looping over it."); + + if (loop_iteration_depth_soft != 0) + { + if (!ids[id].empty()) + SPIRV_CROSS_THROW("Cannot override IDs when loop is soft locked."); + return; + } + + if (ids[id].empty() || ids[id].get_type() != type) + { + switch (type) + { + case TypeConstant: + ids_for_constant_or_variable.push_back(id); + ids_for_constant_undef_or_type.push_back(id); + break; + + case TypeVariable: + ids_for_constant_or_variable.push_back(id); + break; + + case TypeType: + case TypeConstantOp: + case TypeUndef: + ids_for_constant_undef_or_type.push_back(id); + break; + + default: + break; + } + } + + if (ids[id].empty()) + { + ids_for_type[type].push_back(id); + } + else if (ids[id].get_type() != type) + { + remove_typed_id(ids[id].get_type(), id); + ids_for_type[type].push_back(id); + } +} + +const Meta *ParsedIR::find_meta(ID id) const +{ + auto itr = meta.find(id); + if (itr != end(meta)) + return &itr->second; + else + return nullptr; +} + +Meta *ParsedIR::find_meta(ID id) +{ + auto itr = meta.find(id); + if (itr != end(meta)) + return &itr->second; + else + return nullptr; +} + +ParsedIR::LoopLock ParsedIR::create_loop_hard_lock() const +{ + return ParsedIR::LoopLock(&loop_iteration_depth_hard); +} + +ParsedIR::LoopLock ParsedIR::create_loop_soft_lock() const +{ + return ParsedIR::LoopLock(&loop_iteration_depth_soft); +} + +ParsedIR::LoopLock::~LoopLock() +{ + if (lock) + (*lock)--; +} + +ParsedIR::LoopLock::LoopLock(uint32_t *lock_) + : lock(lock_) +{ + if (lock) + (*lock)++; +} + +ParsedIR::LoopLock::LoopLock(LoopLock &&other) SPIRV_CROSS_NOEXCEPT +{ + *this = std::move(other); +} + +ParsedIR::LoopLock &ParsedIR::LoopLock::operator=(LoopLock &&other) SPIRV_CROSS_NOEXCEPT +{ + if (lock) + (*lock)--; + lock = other.lock; + other.lock = nullptr; + return *this; +} + +void ParsedIR::make_constant_null(uint32_t id, uint32_t type, bool add_to_typed_id_set) +{ + assert(id < ids.size()); + + auto &constant_type = get(type); + + if (constant_type.pointer) + { + if (add_to_typed_id_set) + add_typed_id(TypeConstant, id); + auto &constant = variant_set(ids[id], type); + constant.self = id; + constant.make_null(constant_type); + } + else if (!constant_type.array.empty()) + { + assert(constant_type.parent_type); + uint32_t parent_id = increase_bound_by(1); + make_constant_null(parent_id, constant_type.parent_type, add_to_typed_id_set); + + // The array size of OpConstantNull can be either literal or specialization constant. + // In the latter case, we cannot take the value as-is, as it can be changed to anything. + // Rather, we assume it to be *one* for the sake of initializer. + bool is_literal_array_size = constant_type.array_size_literal.back(); + uint32_t count = is_literal_array_size ? constant_type.array.back() : 1; + + SmallVector elements(count); + for (uint32_t i = 0; i < count; i++) + elements[i] = parent_id; + + if (add_to_typed_id_set) + add_typed_id(TypeConstant, id); + auto& constant = variant_set(ids[id], type, elements.data(), uint32_t(elements.size()), false); + constant.self = id; + constant.is_null_array_specialized_length = !is_literal_array_size; + } + else if (!constant_type.member_types.empty()) + { + uint32_t member_ids = increase_bound_by(uint32_t(constant_type.member_types.size())); + SmallVector elements(constant_type.member_types.size()); + for (uint32_t i = 0; i < constant_type.member_types.size(); i++) + { + make_constant_null(member_ids + i, constant_type.member_types[i], add_to_typed_id_set); + elements[i] = member_ids + i; + } + + if (add_to_typed_id_set) + add_typed_id(TypeConstant, id); + variant_set(ids[id], type, elements.data(), uint32_t(elements.size()), false).self = id; + } + else + { + if (add_to_typed_id_set) + add_typed_id(TypeConstant, id); + auto &constant = variant_set(ids[id], type); + constant.self = id; + constant.make_null(constant_type); + } +} + +} // namespace SPIRV_CROSS_NAMESPACE diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_parsed_ir.hpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_parsed_ir.hpp new file mode 100644 index 0000000000..b1e76f2053 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_parsed_ir.hpp @@ -0,0 +1,273 @@ +/* + * Copyright 2018-2021 Arm Limited + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#ifndef SPIRV_CROSS_PARSED_IR_HPP +#define SPIRV_CROSS_PARSED_IR_HPP + +#include "spirv_common.hpp" +#include +#include + +namespace SPIRV_CROSS_NAMESPACE +{ +using namespace SPIRV_CROSS_SPV_HEADER_NAMESPACE; + +// This data structure holds all information needed to perform cross-compilation and reflection. +// It is the output of the Parser, but any implementation could create this structure. +// It is intentionally very "open" and struct-like with some helper functions to deal with decorations. +// Parser is the reference implementation of how this data structure should be filled in. + +class ParsedIR +{ +private: + // This must be destroyed after the "ids" vector. + std::unique_ptr pool_group; + +public: + ParsedIR(); + + // Due to custom allocations from object pools, we cannot use a default copy constructor. + ParsedIR(const ParsedIR &other); + ParsedIR &operator=(const ParsedIR &other); + + // Moves are unproblematic, but we need to implement it anyways, since MSVC 2013 does not understand + // how to default-implement these. + ParsedIR(ParsedIR &&other) SPIRV_CROSS_NOEXCEPT; + ParsedIR &operator=(ParsedIR &&other) SPIRV_CROSS_NOEXCEPT; + + // Resizes ids, meta and block_meta. + void set_id_bounds(uint32_t bounds); + + // The raw SPIR-V, instructions and opcodes refer to this by offset + count. + std::vector spirv; + + // Holds various data structures which inherit from IVariant. + SmallVector ids; + + // Various meta data for IDs, decorations, names, etc. + std::unordered_map meta; + + // Holds all IDs which have a certain type. + // This is needed so we can iterate through a specific kind of resource quickly, + // and in-order of module declaration. + SmallVector ids_for_type[TypeCount]; + + // Special purpose lists which contain a union of types. + // This is needed so we can declare specialization constants and structs in an interleaved fashion, + // among other things. + // Constants can be undef or of struct type, and struct array sizes can use specialization constants. + SmallVector ids_for_constant_undef_or_type; + SmallVector ids_for_constant_or_variable; + + // We need to keep track of the width the Ops that contains a type for the + // OpSwitch instruction, since this one doesn't contains the type in the + // instruction itself. And in some case we need to cast the condition to + // wider types. We only need the width to do the branch fixup since the + // type check itself can be done at runtime + std::unordered_map load_type_width; + + // Declared capabilities and extensions in the SPIR-V module. + // Not really used except for reflection at the moment. + SmallVector declared_capabilities; + SmallVector declared_extensions; + + // Meta data about blocks. The cross-compiler needs to query if a block is either of these types. + // It is a bitset as there can be more than one tag per block. + enum BlockMetaFlagBits + { + BLOCK_META_LOOP_HEADER_BIT = 1 << 0, + BLOCK_META_CONTINUE_BIT = 1 << 1, + BLOCK_META_LOOP_MERGE_BIT = 1 << 2, + BLOCK_META_SELECTION_MERGE_BIT = 1 << 3, + BLOCK_META_MULTISELECT_MERGE_BIT = 1 << 4 + }; + using BlockMetaFlags = uint8_t; + SmallVector block_meta; + std::unordered_map continue_block_to_loop_header; + + // Normally, we'd stick SPIREntryPoint in ids array, but it conflicts with SPIRFunction. + // Entry points can therefore be seen as some sort of meta structure. + std::unordered_map entry_points; + FunctionID default_entry_point = 0; + + struct Source + { + SourceLanguage lang = SourceLanguageUnknown; + uint32_t version = 0; + bool es = false; + bool known = false; + bool hlsl = false; + + ID file_id = 0; // string + ID define_id = 0; // only non-zero for DebugSource + std::string source; + + struct Marker + { + ID line; // in source + ID col; // in source + ID offset; // in spirv stream + ID function_id; + ID block_id; + }; + + SmallVector line_markers; // sorted by line + + Source() = default; + }; + + std::vector sources; + + AddressingModel addressing_model = AddressingModelMax; + MemoryModel memory_model = MemoryModelMax; + + // Decoration handling methods. + // Can be useful for simple "raw" reflection. + // However, most members are here because the Parser needs most of these, + // and might as well just have the whole suite of decoration/name handling in one place. + void set_name(ID id, const std::string &name); + const std::string &get_name(ID id) const; + void set_decoration(ID id, Decoration decoration, uint32_t argument = 0); + void set_decoration_string(ID id, Decoration decoration, const std::string &argument); + bool has_decoration(ID id, Decoration decoration) const; + uint32_t get_decoration(ID id, Decoration decoration) const; + const std::string &get_decoration_string(ID id, Decoration decoration) const; + const Bitset &get_decoration_bitset(ID id) const; + void unset_decoration(ID id, Decoration decoration); + + // Decoration handling methods (for members of a struct). + void set_member_name(TypeID id, uint32_t index, const std::string &name); + const std::string &get_member_name(TypeID id, uint32_t index) const; + void set_member_decoration(TypeID id, uint32_t index, Decoration decoration, uint32_t argument = 0); + void set_member_decoration_string(TypeID id, uint32_t index, Decoration decoration, + const std::string &argument); + uint32_t get_member_decoration(TypeID id, uint32_t index, Decoration decoration) const; + const std::string &get_member_decoration_string(TypeID id, uint32_t index, Decoration decoration) const; + bool has_member_decoration(TypeID id, uint32_t index, Decoration decoration) const; + const Bitset &get_member_decoration_bitset(TypeID id, uint32_t index) const; + void unset_member_decoration(TypeID id, uint32_t index, Decoration decoration); + + void mark_used_as_array_length(ID id); + uint32_t increase_bound_by(uint32_t count); + Bitset get_buffer_block_flags(const SPIRVariable &var) const; + Bitset get_buffer_block_type_flags(const SPIRType &type) const; + + void add_typed_id(Types type, ID id); + void remove_typed_id(Types type, ID id); + + class LoopLock + { + public: + explicit LoopLock(uint32_t *counter); + LoopLock(const LoopLock &) = delete; + void operator=(const LoopLock &) = delete; + LoopLock(LoopLock &&other) SPIRV_CROSS_NOEXCEPT; + LoopLock &operator=(LoopLock &&other) SPIRV_CROSS_NOEXCEPT; + ~LoopLock(); + + private: + uint32_t *lock = nullptr; + }; + + // This must be held while iterating over a type ID array. + // It is undefined if someone calls set<>() while we're iterating over a data structure, so we must + // make sure that this case is avoided. + + // If we have a hard lock, it is an error to call set<>(), and an exception is thrown. + // If we have a soft lock, we silently ignore any additions to the typed arrays. + // This should only be used for physical ID remapping where we need to create an ID, but we will never + // care about iterating over them. + LoopLock create_loop_hard_lock() const; + LoopLock create_loop_soft_lock() const; + + template + void for_each_typed_id(const Op &op) + { + auto loop_lock = create_loop_hard_lock(); + for (auto &id : ids_for_type[T::type]) + { + if (ids[id].get_type() == static_cast(T::type)) + op(id, get(id)); + } + } + + template + void for_each_typed_id(const Op &op) const + { + auto loop_lock = create_loop_hard_lock(); + for (auto &id : ids_for_type[T::type]) + { + if (ids[id].get_type() == static_cast(T::type)) + op(id, get(id)); + } + } + + template + void reset_all_of_type() + { + reset_all_of_type(static_cast(T::type)); + } + + void reset_all_of_type(Types type); + + Meta *find_meta(ID id); + const Meta *find_meta(ID id) const; + + const std::string &get_empty_string() const + { + return empty_string; + } + + void make_constant_null(uint32_t id, uint32_t type, bool add_to_typed_id_set); + + void fixup_reserved_names(); + + static void sanitize_underscores(std::string &str); + static void sanitize_identifier(std::string &str, bool member, bool allow_reserved_prefixes); + static bool is_globally_reserved_identifier(std::string &str, bool allow_reserved_prefixes); + + uint32_t get_spirv_version() const; + + template + T &get(uint32_t id) + { + return variant_get(ids[id]); + } + + template + const T &get(uint32_t id) const + { + return variant_get(ids[id]); + } + +private: + mutable uint32_t loop_iteration_depth_hard = 0; + mutable uint32_t loop_iteration_depth_soft = 0; + std::string empty_string; + Bitset cleared_bitset; + + std::unordered_set meta_needing_name_fixup; +}; +} // namespace SPIRV_CROSS_NAMESPACE + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_util.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_util.cpp new file mode 100644 index 0000000000..f30706f592 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_util.cpp @@ -0,0 +1,77 @@ +/* + * Copyright 2015-2021 Arm Limited + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#include "spirv_cross_util.hpp" +#include "spirv_common.hpp" + +using namespace SPIRV_CROSS_SPV_HEADER_NAMESPACE; +using namespace SPIRV_CROSS_NAMESPACE; + +namespace spirv_cross_util +{ +void rename_interface_variable(Compiler &compiler, const SmallVector &resources, uint32_t location, + const std::string &name) +{ + for (auto &v : resources) + { + if (!compiler.has_decoration(v.id, DecorationLocation)) + continue; + + auto loc = compiler.get_decoration(v.id, DecorationLocation); + if (loc != location) + continue; + + auto &type = compiler.get_type(v.base_type_id); + + // This is more of a friendly variant. If we need to rename interface variables, we might have to rename + // structs as well and make sure all the names match up. + if (type.basetype == SPIRType::Struct) + { + compiler.set_name(v.base_type_id, join("SPIRV_Cross_Interface_Location", location)); + for (uint32_t i = 0; i < uint32_t(type.member_types.size()); i++) + compiler.set_member_name(v.base_type_id, i, join("InterfaceMember", i)); + } + + compiler.set_name(v.id, name); + } +} + +void inherit_combined_sampler_bindings(Compiler &compiler) +{ + auto &samplers = compiler.get_combined_image_samplers(); + for (auto &s : samplers) + { + if (compiler.has_decoration(s.image_id, DecorationDescriptorSet)) + { + uint32_t set = compiler.get_decoration(s.image_id, DecorationDescriptorSet); + compiler.set_decoration(s.combined_id, DecorationDescriptorSet, set); + } + + if (compiler.has_decoration(s.image_id, DecorationBinding)) + { + uint32_t binding = compiler.get_decoration(s.image_id, DecorationBinding); + compiler.set_decoration(s.combined_id, DecorationBinding, binding); + } + } +} +} // namespace spirv_cross_util diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_util.hpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_util.hpp new file mode 100644 index 0000000000..e6e3fcdb63 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_cross_util.hpp @@ -0,0 +1,37 @@ +/* + * Copyright 2015-2021 Arm Limited + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#ifndef SPIRV_CROSS_UTIL_HPP +#define SPIRV_CROSS_UTIL_HPP + +#include "spirv_cross.hpp" + +namespace spirv_cross_util +{ +void rename_interface_variable(SPIRV_CROSS_NAMESPACE::Compiler &compiler, + const SPIRV_CROSS_NAMESPACE::SmallVector &resources, + uint32_t location, const std::string &name); +void inherit_combined_sampler_bindings(SPIRV_CROSS_NAMESPACE::Compiler &compiler); +} // namespace spirv_cross_util + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_glsl.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_glsl.cpp new file mode 100644 index 0000000000..08e2c8d5c4 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_glsl.cpp @@ -0,0 +1,20332 @@ +/* + * Copyright 2015-2021 Arm Limited + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#include "spirv_glsl.hpp" +#include "GLSL.std.450.h" +#include "spirv_common.hpp" +#include +#include +#include +#include +#include +#include +#include + +#ifndef _WIN32 +#ifndef __ghs__ +#include +#endif +#endif +#include + +using namespace SPIRV_CROSS_SPV_HEADER_NAMESPACE; +using namespace SPIRV_CROSS_NAMESPACE; +using namespace std; + +namespace SPIRV_CROSS_NAMESPACE +{ + +enum ExtraSubExpressionType +{ + // Create masks above any legal ID range to allow multiple address spaces into the extra_sub_expressions map. + EXTRA_SUB_EXPRESSION_TYPE_STREAM_OFFSET = 0x10000000, + EXTRA_SUB_EXPRESSION_TYPE_AUX = 0x20000000 +}; + +struct GlslConstantNameMapping +{ + uint32_t value; + const char *alias; +}; + +#define DEF_GLSL_MAPPING(x) { x, "gl_" #x } +#define DEF_GLSL_MAPPING_EXT(x) { x##KHR, "gl_" #x } +static const GlslConstantNameMapping CoopVecComponentTypeNames[] = { + DEF_GLSL_MAPPING(ComponentTypeFloat16NV), + DEF_GLSL_MAPPING(ComponentTypeFloat32NV), + DEF_GLSL_MAPPING(ComponentTypeFloat64NV), + DEF_GLSL_MAPPING(ComponentTypeSignedInt8NV), + DEF_GLSL_MAPPING(ComponentTypeSignedInt16NV), + DEF_GLSL_MAPPING(ComponentTypeSignedInt32NV), + DEF_GLSL_MAPPING(ComponentTypeSignedInt64NV), + DEF_GLSL_MAPPING(ComponentTypeUnsignedInt8NV), + DEF_GLSL_MAPPING(ComponentTypeUnsignedInt16NV), + DEF_GLSL_MAPPING(ComponentTypeUnsignedInt32NV), + DEF_GLSL_MAPPING(ComponentTypeUnsignedInt64NV), + DEF_GLSL_MAPPING(ComponentTypeSignedInt8PackedNV), + DEF_GLSL_MAPPING(ComponentTypeUnsignedInt8PackedNV), + DEF_GLSL_MAPPING(ComponentTypeFloatE4M3NV), + DEF_GLSL_MAPPING(ComponentTypeFloatE5M2NV), +}; + +static const GlslConstantNameMapping CoopVecMatrixLayoutNames[] = { + DEF_GLSL_MAPPING(CooperativeVectorMatrixLayoutRowMajorNV), + DEF_GLSL_MAPPING(CooperativeVectorMatrixLayoutColumnMajorNV), + DEF_GLSL_MAPPING(CooperativeVectorMatrixLayoutInferencingOptimalNV), + DEF_GLSL_MAPPING(CooperativeVectorMatrixLayoutTrainingOptimalNV), +}; + +static const GlslConstantNameMapping CoopMatMatrixLayoutNames[] = { + DEF_GLSL_MAPPING_EXT(CooperativeMatrixLayoutRowMajor), + DEF_GLSL_MAPPING_EXT(CooperativeMatrixLayoutColumnMajor), +}; +#undef DEF_GLSL_MAPPING +#undef DEF_GLSL_MAPPING_EXT + +static bool is_unsigned_opcode(Op op) +{ + // Don't have to be exhaustive, only relevant for legacy target checking ... + switch (op) + { + case OpShiftRightLogical: + case OpUGreaterThan: + case OpUGreaterThanEqual: + case OpULessThan: + case OpULessThanEqual: + case OpUConvert: + case OpUDiv: + case OpUMod: + case OpUMulExtended: + case OpConvertUToF: + case OpConvertFToU: + return true; + + default: + return false; + } +} + +static bool is_unsigned_glsl_opcode(GLSLstd450 op) +{ + // Don't have to be exhaustive, only relevant for legacy target checking ... + switch (op) + { + case GLSLstd450UClamp: + case GLSLstd450UMin: + case GLSLstd450UMax: + case GLSLstd450FindUMsb: + return true; + + default: + return false; + } +} + +static bool packing_is_vec4_padded(BufferPackingStandard packing) +{ + switch (packing) + { + case BufferPackingHLSLCbuffer: + case BufferPackingHLSLCbufferPackOffset: + case BufferPackingStd140: + case BufferPackingStd140EnhancedLayout: + return true; + + default: + return false; + } +} + +static bool packing_is_hlsl(BufferPackingStandard packing) +{ + switch (packing) + { + case BufferPackingHLSLCbuffer: + case BufferPackingHLSLCbufferPackOffset: + return true; + + default: + return false; + } +} + +static bool packing_has_flexible_offset(BufferPackingStandard packing) +{ + switch (packing) + { + case BufferPackingStd140: + case BufferPackingStd430: + case BufferPackingScalar: + case BufferPackingHLSLCbuffer: + return false; + + default: + return true; + } +} + +static bool packing_is_scalar(BufferPackingStandard packing) +{ + switch (packing) + { + case BufferPackingScalar: + case BufferPackingScalarEnhancedLayout: + return true; + + default: + return false; + } +} + +static BufferPackingStandard packing_to_substruct_packing(BufferPackingStandard packing) +{ + switch (packing) + { + case BufferPackingStd140EnhancedLayout: + return BufferPackingStd140; + case BufferPackingStd430EnhancedLayout: + return BufferPackingStd430; + case BufferPackingHLSLCbufferPackOffset: + return BufferPackingHLSLCbuffer; + case BufferPackingScalarEnhancedLayout: + return BufferPackingScalar; + default: + return packing; + } +} +} + +void CompilerGLSL::init() +{ + if (!ir.sources.empty() && ir.sources.front().known) + { + options.es = ir.sources.front().es; + options.version = ir.sources.front().version; + } + + // Query the locale to see what the decimal point is. + // We'll rely on fixing it up ourselves in the rare case we have a comma-as-decimal locale + // rather than setting locales ourselves. Settings locales in a safe and isolated way is rather + // tricky. +#ifdef _WIN32 + // On Windows, localeconv uses thread-local storage, so it should be fine. + const struct lconv *conv = localeconv(); + if (conv && conv->decimal_point) + current_locale_radix_character = *conv->decimal_point; +#elif defined(__ANDROID__) && __ANDROID_API__ < 26 || defined(__ghs__) || defined(__QNXNTO__) || defined(__VXWORKS__) + // nl_langinfo is not supported on this platform, fall back to the worse alternative. + const struct lconv *conv = localeconv(); + if (conv && conv->decimal_point) + current_locale_radix_character = *conv->decimal_point; +#else + // localeconv, the portable function is not MT safe ... + const char *decimal_point = nl_langinfo(RADIXCHAR); + if (decimal_point && *decimal_point != '\0') + current_locale_radix_character = *decimal_point; +#endif +} + +static const char *to_pls_layout(PlsFormat format) +{ + switch (format) + { + case PlsR11FG11FB10F: + return "layout(r11f_g11f_b10f) "; + case PlsR32F: + return "layout(r32f) "; + case PlsRG16F: + return "layout(rg16f) "; + case PlsRGB10A2: + return "layout(rgb10_a2) "; + case PlsRGBA8: + return "layout(rgba8) "; + case PlsRG16: + return "layout(rg16) "; + case PlsRGBA8I: + return "layout(rgba8i)"; + case PlsRG16I: + return "layout(rg16i) "; + case PlsRGB10A2UI: + return "layout(rgb10_a2ui) "; + case PlsRGBA8UI: + return "layout(rgba8ui) "; + case PlsRG16UI: + return "layout(rg16ui) "; + case PlsR32UI: + return "layout(r32ui) "; + default: + return ""; + } +} + +static std::pair pls_format_to_basetype(PlsFormat format) +{ + switch (format) + { + default: + case PlsR11FG11FB10F: + case PlsR32F: + case PlsRG16F: + case PlsRGB10A2: + case PlsRGBA8: + case PlsRG16: + return std::make_pair(OpTypeFloat, SPIRType::Float); + + case PlsRGBA8I: + case PlsRG16I: + return std::make_pair(OpTypeInt, SPIRType::Int); + + case PlsRGB10A2UI: + case PlsRGBA8UI: + case PlsRG16UI: + case PlsR32UI: + return std::make_pair(OpTypeInt, SPIRType::UInt); + } +} + +static uint32_t pls_format_to_components(PlsFormat format) +{ + switch (format) + { + default: + case PlsR32F: + case PlsR32UI: + return 1; + + case PlsRG16F: + case PlsRG16: + case PlsRG16UI: + case PlsRG16I: + return 2; + + case PlsR11FG11FB10F: + return 3; + + case PlsRGB10A2: + case PlsRGBA8: + case PlsRGBA8I: + case PlsRGB10A2UI: + case PlsRGBA8UI: + return 4; + } +} + +const char *CompilerGLSL::vector_swizzle(int vecsize, int index) +{ + static const char *const swizzle[4][4] = { + { ".x", ".y", ".z", ".w" }, + { ".xy", ".yz", ".zw", nullptr }, + { ".xyz", ".yzw", nullptr, nullptr }, +#if defined(__GNUC__) && (__GNUC__ == 9) + // This works around a GCC 9 bug, see details in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90947. + // This array ends up being compiled as all nullptrs, tripping the assertions below. + { "", nullptr, nullptr, "$" }, +#else + { "", nullptr, nullptr, nullptr }, +#endif + }; + + assert(vecsize >= 1 && vecsize <= 4); + assert(index >= 0 && index < 4); + assert(swizzle[vecsize - 1][index]); + + return swizzle[vecsize - 1][index]; +} + +void CompilerGLSL::reset(uint32_t iteration_count) +{ + // Sanity check the iteration count to be robust against a certain class of bugs where + // we keep forcing recompilations without making clear forward progress. + // In buggy situations we will loop forever, or loop for an unbounded number of iterations. + // Certain types of recompilations are considered to make forward progress, + // but in almost all situations, we'll never see more than 3 iterations. + // It is highly context-sensitive when we need to force recompilation, + // and it is not practical with the current architecture + // to resolve everything up front. + if (iteration_count >= options.force_recompile_max_debug_iterations && !is_force_recompile_forward_progress) + SPIRV_CROSS_THROW("Maximum compilation loops detected and no forward progress was made. Must be a SPIRV-Cross bug!"); + + // We do some speculative optimizations which should pretty much always work out, + // but just in case the SPIR-V is rather weird, recompile until it's happy. + // This typically only means one extra pass. + clear_force_recompile(); + + // Clear invalid expression tracking. + invalid_expressions.clear(); + composite_insert_overwritten.clear(); + current_function = nullptr; + + // Clear temporary usage tracking. + expression_usage_counts.clear(); + forwarded_temporaries.clear(); + suppressed_usage_tracking.clear(); + + // Ensure that we declare phi-variable copies even if the original declaration isn't deferred + flushed_phi_variables.clear(); + + current_emitting_switch_stack.clear(); + + reset_name_caches(); + + ir.for_each_typed_id([&](uint32_t, SPIRFunction &func) { + func.active = false; + func.flush_undeclared = true; + }); + + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { var.dependees.clear(); }); + + ir.reset_all_of_type(); + ir.reset_all_of_type(); + + statement_count = 0; + indent = 0; + current_loop_level = 0; +} + +void CompilerGLSL::remap_pls_variables() +{ + for (auto &input : pls_inputs) + { + auto &var = get(input.id); + + bool input_is_target = false; + if (var.storage == StorageClassUniformConstant) + { + auto &type = get(var.basetype); + input_is_target = type.image.dim == DimSubpassData; + } + + if (var.storage != StorageClassInput && !input_is_target) + SPIRV_CROSS_THROW("Can only use in and target variables for PLS inputs."); + var.remapped_variable = true; + } + + for (auto &output : pls_outputs) + { + auto &var = get(output.id); + if (var.storage != StorageClassOutput) + SPIRV_CROSS_THROW("Can only use out variables for PLS outputs."); + var.remapped_variable = true; + } +} + +void CompilerGLSL::remap_ext_framebuffer_fetch(uint32_t input_attachment_index, uint32_t color_location, bool coherent) +{ + subpass_to_framebuffer_fetch_attachment.push_back({ input_attachment_index, color_location }); + inout_color_attachments.push_back({ color_location, coherent }); +} + +bool CompilerGLSL::location_is_framebuffer_fetch(uint32_t location) const +{ + return std::find_if(begin(inout_color_attachments), end(inout_color_attachments), + [&](const std::pair &elem) { + return elem.first == location; + }) != end(inout_color_attachments); +} + +bool CompilerGLSL::location_is_non_coherent_framebuffer_fetch(uint32_t location) const +{ + return std::find_if(begin(inout_color_attachments), end(inout_color_attachments), + [&](const std::pair &elem) { + return elem.first == location && !elem.second; + }) != end(inout_color_attachments); +} + +void CompilerGLSL::find_static_extensions() +{ + ir.for_each_typed_id([&](uint32_t, const SPIRType &type) { + if (type.basetype == SPIRType::Double) + { + if (options.es) + SPIRV_CROSS_THROW("FP64 not supported in ES profile."); + if (!options.es && options.version < 400) + require_extension_internal("GL_ARB_gpu_shader_fp64"); + } + else if (type.basetype == SPIRType::Int64 || type.basetype == SPIRType::UInt64) + { + if (options.es && options.version < 310) // GL_NV_gpu_shader5 fallback requires 310. + SPIRV_CROSS_THROW("64-bit integers not supported in ES profile before version 310."); + require_extension_internal("GL_ARB_gpu_shader_int64"); + } + else if (type.basetype == SPIRType::Half) + { + require_extension_internal("GL_EXT_shader_explicit_arithmetic_types_float16"); + if (options.vulkan_semantics) + require_extension_internal("GL_EXT_shader_16bit_storage"); + } + else if (type.basetype == SPIRType::SByte || type.basetype == SPIRType::UByte) + { + require_extension_internal("GL_EXT_shader_explicit_arithmetic_types_int8"); + if (options.vulkan_semantics) + require_extension_internal("GL_EXT_shader_8bit_storage"); + } + else if (type.basetype == SPIRType::Short || type.basetype == SPIRType::UShort) + { + require_extension_internal("GL_EXT_shader_explicit_arithmetic_types_int16"); + if (options.vulkan_semantics) + require_extension_internal("GL_EXT_shader_16bit_storage"); + } + }); + + auto &execution = get_entry_point(); + switch (execution.model) + { + case ExecutionModelGLCompute: + if (!options.es && options.version < 430) + require_extension_internal("GL_ARB_compute_shader"); + if (options.es && options.version < 310) + SPIRV_CROSS_THROW("At least ESSL 3.10 required for compute shaders."); + break; + + case ExecutionModelGeometry: + if (options.es && options.version < 320) + require_extension_internal("GL_EXT_geometry_shader"); + if (!options.es && options.version < 150) + require_extension_internal("GL_ARB_geometry_shader4"); + + if (execution.flags.get(ExecutionModeInvocations) && execution.invocations != 1) + { + // Instanced GS is part of 400 core or this extension. + if (!options.es && options.version < 400) + require_extension_internal("GL_ARB_gpu_shader5"); + } + break; + + case ExecutionModelTessellationEvaluation: + case ExecutionModelTessellationControl: + if (options.es && options.version < 320) + require_extension_internal("GL_EXT_tessellation_shader"); + if (!options.es && options.version < 400) + require_extension_internal("GL_ARB_tessellation_shader"); + break; + + case ExecutionModelRayGenerationKHR: + case ExecutionModelIntersectionKHR: + case ExecutionModelAnyHitKHR: + case ExecutionModelClosestHitKHR: + case ExecutionModelMissKHR: + case ExecutionModelCallableKHR: + // NV enums are aliases. + if (options.es || options.version < 460) + SPIRV_CROSS_THROW("Ray tracing shaders require non-es profile with version 460 or above."); + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Ray tracing requires Vulkan semantics."); + + // Need to figure out if we should target KHR or NV extension based on capabilities. + for (auto &cap : ir.declared_capabilities) + { + if (cap == CapabilityRayTracingKHR || cap == CapabilityRayQueryKHR || + cap == CapabilityRayTraversalPrimitiveCullingKHR) + { + ray_tracing_is_khr = true; + break; + } + } + + if (ray_tracing_is_khr) + { + // In KHR ray tracing we pass payloads by pointer instead of location, + // so make sure we assign locations properly. + ray_tracing_khr_fixup_locations(); + require_extension_internal("GL_EXT_ray_tracing"); + } + else + require_extension_internal("GL_NV_ray_tracing"); + break; + + case ExecutionModelMeshEXT: + case ExecutionModelTaskEXT: + if (options.es || options.version < 450) + SPIRV_CROSS_THROW("Mesh shaders require GLSL 450 or above."); + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Mesh shaders require Vulkan semantics."); + require_extension_internal("GL_EXT_mesh_shader"); + break; + + default: + break; + } + + if (!pls_inputs.empty() || !pls_outputs.empty()) + { + if (execution.model != ExecutionModelFragment) + SPIRV_CROSS_THROW("Can only use GL_EXT_shader_pixel_local_storage in fragment shaders."); + require_extension_internal("GL_EXT_shader_pixel_local_storage"); + } + + if (!inout_color_attachments.empty()) + { + if (execution.model != ExecutionModelFragment) + SPIRV_CROSS_THROW("Can only use GL_EXT_shader_framebuffer_fetch in fragment shaders."); + if (options.vulkan_semantics) + SPIRV_CROSS_THROW("Cannot use EXT_shader_framebuffer_fetch in Vulkan GLSL."); + + bool has_coherent = false; + bool has_incoherent = false; + + for (auto &att : inout_color_attachments) + { + if (att.second) + has_coherent = true; + else + has_incoherent = true; + } + + if (has_coherent) + require_extension_internal("GL_EXT_shader_framebuffer_fetch"); + if (has_incoherent) + require_extension_internal("GL_EXT_shader_framebuffer_fetch_non_coherent"); + } + + if (options.separate_shader_objects && !options.es && options.version < 410) + require_extension_internal("GL_ARB_separate_shader_objects"); + + if (ir.addressing_model == AddressingModelPhysicalStorageBuffer64) + { + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("GL_EXT_buffer_reference is only supported in Vulkan GLSL."); + if (options.es && options.version < 320) + SPIRV_CROSS_THROW("GL_EXT_buffer_reference requires ESSL 320."); + else if (!options.es && options.version < 450) + SPIRV_CROSS_THROW("GL_EXT_buffer_reference requires GLSL 450."); + require_extension_internal("GL_EXT_buffer_reference2"); + } + else if (ir.addressing_model != AddressingModelLogical) + { + SPIRV_CROSS_THROW("Only Logical and PhysicalStorageBuffer64 addressing models are supported."); + } + + // Check for nonuniform qualifier and passthrough. + // Instead of looping over all decorations to find this, just look at capabilities. + for (auto &cap : ir.declared_capabilities) + { + switch (cap) + { + case CapabilityShaderNonUniformEXT: + if (!options.vulkan_semantics) + require_extension_internal("GL_NV_gpu_shader5"); + else + require_extension_internal("GL_EXT_nonuniform_qualifier"); + break; + case CapabilityRuntimeDescriptorArrayEXT: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("GL_EXT_nonuniform_qualifier is only supported in Vulkan GLSL."); + require_extension_internal("GL_EXT_nonuniform_qualifier"); + break; + + case CapabilityGeometryShaderPassthroughNV: + if (execution.model == ExecutionModelGeometry) + { + require_extension_internal("GL_NV_geometry_shader_passthrough"); + execution.geometry_passthrough = true; + } + break; + + case CapabilityVariablePointers: + case CapabilityVariablePointersStorageBuffer: + SPIRV_CROSS_THROW("VariablePointers capability is not supported in GLSL."); + + case CapabilityMultiView: + if (options.vulkan_semantics) + require_extension_internal("GL_EXT_multiview"); + else + { + require_extension_internal("GL_OVR_multiview2"); + if (options.ovr_multiview_view_count == 0) + SPIRV_CROSS_THROW("ovr_multiview_view_count must be non-zero when using GL_OVR_multiview2."); + if (get_execution_model() != ExecutionModelVertex) + SPIRV_CROSS_THROW("OVR_multiview2 can only be used with Vertex shaders."); + } + break; + + case CapabilityRayQueryKHR: + if (options.es || options.version < 460 || !options.vulkan_semantics) + SPIRV_CROSS_THROW("RayQuery requires Vulkan GLSL 460."); + require_extension_internal("GL_EXT_ray_query"); + ray_tracing_is_khr = true; + break; + + case CapabilityRayQueryPositionFetchKHR: + if (options.es || options.version < 460 || !options.vulkan_semantics) + SPIRV_CROSS_THROW("RayQuery Position Fetch requires Vulkan GLSL 460."); + require_extension_internal("GL_EXT_ray_tracing_position_fetch"); + ray_tracing_is_khr = true; + break; + + case CapabilityRayTracingPositionFetchKHR: + if (options.es || options.version < 460 || !options.vulkan_semantics) + SPIRV_CROSS_THROW("Ray Tracing Position Fetch requires Vulkan GLSL 460."); + require_extension_internal("GL_EXT_ray_tracing_position_fetch"); + ray_tracing_is_khr = true; + break; + + case CapabilityRayTraversalPrimitiveCullingKHR: + if (options.es || options.version < 460 || !options.vulkan_semantics) + SPIRV_CROSS_THROW("RayQuery requires Vulkan GLSL 460."); + require_extension_internal("GL_EXT_ray_flags_primitive_culling"); + ray_tracing_is_khr = true; + break; + + case CapabilityRayTracingClusterAccelerationStructureNV: + if (options.es || options.version < 460 || !options.vulkan_semantics) + SPIRV_CROSS_THROW("Cluster AS requires Vulkan GLSL 460."); + require_extension_internal("GL_NV_cluster_acceleration_structure"); + ray_tracing_is_khr = true; + break; + + case CapabilityTensorsARM: + if (options.es || options.version < 460 || !options.vulkan_semantics) + SPIRV_CROSS_THROW("Tensor requires Vulkan GLSL 460."); + require_extension_internal("GL_ARM_tensors"); + break; + + default: + break; + } + } + + if (options.ovr_multiview_view_count) + { + if (options.vulkan_semantics) + SPIRV_CROSS_THROW("OVR_multiview2 cannot be used with Vulkan semantics."); + if (get_execution_model() != ExecutionModelVertex) + SPIRV_CROSS_THROW("OVR_multiview2 can only be used with Vertex shaders."); + require_extension_internal("GL_OVR_multiview2"); + } + + if (execution.flags.get(ExecutionModeQuadDerivativesKHR) || + (execution.flags.get(ExecutionModeRequireFullQuadsKHR) && get_execution_model() == ExecutionModelFragment)) + { + require_extension_internal("GL_EXT_shader_quad_control"); + } + + // KHR one is likely to get promoted at some point, so if we don't see an explicit SPIR-V extension, assume KHR. + for (auto &ext : ir.declared_extensions) + if (ext == "SPV_NV_fragment_shader_barycentric") + barycentric_is_nv = true; +} + +void CompilerGLSL::require_polyfill(Polyfill polyfill, bool relaxed) +{ + uint32_t &polyfills = (relaxed && (options.es || options.vulkan_semantics)) ? + required_polyfills_relaxed : required_polyfills; + + if ((polyfills & polyfill) == 0) + { + polyfills |= polyfill; + force_recompile(); + } +} + +void CompilerGLSL::ray_tracing_khr_fixup_locations() +{ + uint32_t location = 0; + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + // Incoming payload storage can also be used for tracing. + if (var.storage != StorageClassRayPayloadKHR && var.storage != StorageClassCallableDataKHR && + var.storage != StorageClassIncomingRayPayloadKHR && var.storage != StorageClassIncomingCallableDataKHR) + return; + if (is_hidden_variable(var)) + return; + set_decoration(var.self, DecorationLocation, location++); + }); +} + +string CompilerGLSL::compile() +{ + ir.fixup_reserved_names(); + + if (!options.vulkan_semantics) + { + // only NV_gpu_shader5 supports divergent indexing on OpenGL, and it does so without extra qualifiers + backend.nonuniform_qualifier = ""; + backend.needs_row_major_load_workaround = options.enable_row_major_load_workaround; + } + backend.allow_precision_qualifiers = options.vulkan_semantics || options.es; + backend.force_gl_in_out_block = true; + backend.supports_extensions = true; + backend.use_array_constructor = true; + backend.workgroup_size_is_hidden = true; + backend.requires_relaxed_precision_analysis = options.es || options.vulkan_semantics; + backend.support_precise_qualifier = + (!options.es && options.version >= 400) || (options.es && options.version >= 320); + backend.constant_null_initializer = "{ }"; + backend.requires_matching_array_initializer = true; + + if (is_legacy_es()) + backend.support_case_fallthrough = false; + + // Scan the SPIR-V to find trivial uses of extensions. + fixup_anonymous_struct_names(); + fixup_type_alias(); + reorder_type_alias(); + build_function_control_flow_graphs_and_analyze(); + find_static_extensions(); + fixup_image_load_store_access(); + update_active_builtins(); + analyze_image_and_sampler_usage(); + analyze_interlocked_resource_usage(); + if (!inout_color_attachments.empty()) + emit_inout_fragment_outputs_copy_to_subpass_inputs(); + + // Shaders might cast unrelated data to pointers of non-block types. + // Find all such instances and make sure we can cast the pointers to a synthesized block type. + if (ir.addressing_model == AddressingModelPhysicalStorageBuffer64) + analyze_non_block_pointer_types(); + + uint32_t pass_count = 0; + do + { + reset(pass_count); + + buffer.reset(); + + emit_header(); + emit_resources(); + emit_extension_workarounds(get_execution_model()); + + if (required_polyfills != 0) + emit_polyfills(required_polyfills, false); + if ((options.es || options.vulkan_semantics) && required_polyfills_relaxed != 0) + emit_polyfills(required_polyfills_relaxed, true); + + emit_function(get(ir.default_entry_point), Bitset()); + + pass_count++; + } while (is_forcing_recompilation()); + + // Implement the interlocked wrapper function at the end. + // The body was implemented in lieu of main(). + if (interlocked_is_complex) + { + statement("void main()"); + begin_scope(); + statement("// Interlocks were used in a way not compatible with GLSL, this is very slow."); + statement("SPIRV_Cross_beginInvocationInterlock();"); + statement("spvMainInterlockedBody();"); + statement("SPIRV_Cross_endInvocationInterlock();"); + end_scope(); + } + + // Entry point in GLSL is always main(). + get_entry_point().name = "main"; + + return buffer.str(); +} + +std::string CompilerGLSL::get_partial_source() +{ + return buffer.str(); +} + +void CompilerGLSL::build_workgroup_size(SmallVector &arguments, const SpecializationConstant &wg_x, + const SpecializationConstant &wg_y, const SpecializationConstant &wg_z) +{ + auto &execution = get_entry_point(); + bool builtin_workgroup = execution.workgroup_size.constant != 0; + bool use_local_size_id = !builtin_workgroup && execution.flags.get(ExecutionModeLocalSizeId); + + if (wg_x.id) + { + if (options.vulkan_semantics) + arguments.push_back(join("local_size_x_id = ", wg_x.constant_id)); + else + arguments.push_back(join("local_size_x = ", get(wg_x.id).specialization_constant_macro_name)); + } + else if (use_local_size_id && execution.workgroup_size.id_x) + arguments.push_back(join("local_size_x = ", get(execution.workgroup_size.id_x).scalar())); + else + arguments.push_back(join("local_size_x = ", execution.workgroup_size.x)); + + if (wg_y.id) + { + if (options.vulkan_semantics) + arguments.push_back(join("local_size_y_id = ", wg_y.constant_id)); + else + arguments.push_back(join("local_size_y = ", get(wg_y.id).specialization_constant_macro_name)); + } + else if (use_local_size_id && execution.workgroup_size.id_y) + arguments.push_back(join("local_size_y = ", get(execution.workgroup_size.id_y).scalar())); + else + arguments.push_back(join("local_size_y = ", execution.workgroup_size.y)); + + if (wg_z.id) + { + if (options.vulkan_semantics) + arguments.push_back(join("local_size_z_id = ", wg_z.constant_id)); + else + arguments.push_back(join("local_size_z = ", get(wg_z.id).specialization_constant_macro_name)); + } + else if (use_local_size_id && execution.workgroup_size.id_z) + arguments.push_back(join("local_size_z = ", get(execution.workgroup_size.id_z).scalar())); + else + arguments.push_back(join("local_size_z = ", execution.workgroup_size.z)); +} + +void CompilerGLSL::request_subgroup_feature(ShaderSubgroupSupportHelper::Feature feature) +{ + if (options.vulkan_semantics) + { + auto khr_extension = ShaderSubgroupSupportHelper::get_KHR_extension_for_feature(feature); + require_extension_internal(ShaderSubgroupSupportHelper::get_extension_name(khr_extension)); + } + else + { + if (!shader_subgroup_supporter.is_feature_requested(feature)) + force_recompile(); + shader_subgroup_supporter.request_feature(feature); + } +} + +void CompilerGLSL::emit_header() +{ + auto &execution = get_entry_point(); + statement("#version ", options.version, options.es && options.version > 100 ? " es" : ""); + + if (!options.es && options.version < 420) + { + // Needed for binding = # on UBOs, etc. + if (options.enable_420pack_extension) + { + statement("#ifdef GL_ARB_shading_language_420pack"); + statement("#extension GL_ARB_shading_language_420pack : require"); + statement("#endif"); + } + // Needed for: layout(early_fragment_tests) in; + if (execution.flags.get(ExecutionModeEarlyFragmentTests)) + require_extension_internal("GL_ARB_shader_image_load_store"); + } + + // Needed for: layout(post_depth_coverage) in; + if (execution.flags.get(ExecutionModePostDepthCoverage)) + require_extension_internal("GL_ARB_post_depth_coverage"); + + // Needed for: layout({pixel,sample}_interlock_[un]ordered) in; + bool interlock_used = execution.flags.get(ExecutionModePixelInterlockOrderedEXT) || + execution.flags.get(ExecutionModePixelInterlockUnorderedEXT) || + execution.flags.get(ExecutionModeSampleInterlockOrderedEXT) || + execution.flags.get(ExecutionModeSampleInterlockUnorderedEXT); + + if (interlock_used) + { + if (options.es) + { + if (options.version < 310) + SPIRV_CROSS_THROW("At least ESSL 3.10 required for fragment shader interlock."); + require_extension_internal("GL_NV_fragment_shader_interlock"); + } + else + { + if (options.version < 420) + require_extension_internal("GL_ARB_shader_image_load_store"); + require_extension_internal("GL_ARB_fragment_shader_interlock"); + } + } + + for (auto &ext : forced_extensions) + { + if (ext == "GL_ARB_gpu_shader_int64") + { + statement("#if defined(GL_ARB_gpu_shader_int64)"); + statement("#extension GL_ARB_gpu_shader_int64 : require"); + if (!options.vulkan_semantics || options.es) + { + statement("#elif defined(GL_NV_gpu_shader5)"); + statement("#extension GL_NV_gpu_shader5 : require"); + } + statement("#else"); + statement("#error No extension available for 64-bit integers."); + statement("#endif"); + } + else if (ext == "GL_EXT_shader_explicit_arithmetic_types_float16") + { + // Special case, this extension has a potential fallback to another vendor extension in normal GLSL. + // GL_AMD_gpu_shader_half_float is a superset, so try that first. + statement("#if defined(GL_AMD_gpu_shader_half_float)"); + statement("#extension GL_AMD_gpu_shader_half_float : require"); + if (!options.vulkan_semantics) + { + statement("#elif defined(GL_NV_gpu_shader5)"); + statement("#extension GL_NV_gpu_shader5 : require"); + } + else + { + statement("#elif defined(GL_EXT_shader_explicit_arithmetic_types_float16)"); + statement("#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require"); + } + statement("#else"); + statement("#error No extension available for FP16."); + statement("#endif"); + } + else if (ext == "GL_EXT_shader_explicit_arithmetic_types_int8") + { + if (options.vulkan_semantics) + statement("#extension GL_EXT_shader_explicit_arithmetic_types_int8 : require"); + else + { + statement("#if defined(GL_EXT_shader_explicit_arithmetic_types_int8)"); + statement("#extension GL_EXT_shader_explicit_arithmetic_types_int8 : require"); + statement("#elif defined(GL_NV_gpu_shader5)"); + statement("#extension GL_NV_gpu_shader5 : require"); + statement("#else"); + statement("#error No extension available for Int8."); + statement("#endif"); + } + } + else if (ext == "GL_EXT_shader_explicit_arithmetic_types_int16") + { + if (options.vulkan_semantics) + statement("#extension GL_EXT_shader_explicit_arithmetic_types_int16 : require"); + else + { + statement("#if defined(GL_EXT_shader_explicit_arithmetic_types_int16)"); + statement("#extension GL_EXT_shader_explicit_arithmetic_types_int16 : require"); + statement("#elif defined(GL_AMD_gpu_shader_int16)"); + statement("#extension GL_AMD_gpu_shader_int16 : require"); + statement("#elif defined(GL_NV_gpu_shader5)"); + statement("#extension GL_NV_gpu_shader5 : require"); + statement("#else"); + statement("#error No extension available for Int16."); + statement("#endif"); + } + } + else if (ext == "GL_ARB_post_depth_coverage") + { + if (options.es) + statement("#extension GL_EXT_post_depth_coverage : require"); + else + { + statement("#if defined(GL_ARB_post_depth_coverge)"); + statement("#extension GL_ARB_post_depth_coverage : require"); + statement("#else"); + statement("#extension GL_EXT_post_depth_coverage : require"); + statement("#endif"); + } + } + else if (!options.vulkan_semantics && ext == "GL_ARB_shader_draw_parameters") + { + // Soft-enable this extension on plain GLSL. + statement("#ifdef ", ext); + statement("#extension ", ext, " : enable"); + statement("#endif"); + } + else if (ext == "GL_EXT_control_flow_attributes") + { + // These are just hints so we can conditionally enable and fallback in the shader. + statement("#if defined(GL_EXT_control_flow_attributes)"); + statement("#extension GL_EXT_control_flow_attributes : require"); + statement("#define SPIRV_CROSS_FLATTEN [[flatten]]"); + statement("#define SPIRV_CROSS_BRANCH [[dont_flatten]]"); + statement("#define SPIRV_CROSS_UNROLL [[unroll]]"); + statement("#define SPIRV_CROSS_LOOP [[dont_unroll]]"); + statement("#else"); + statement("#define SPIRV_CROSS_FLATTEN"); + statement("#define SPIRV_CROSS_BRANCH"); + statement("#define SPIRV_CROSS_UNROLL"); + statement("#define SPIRV_CROSS_LOOP"); + statement("#endif"); + } + else if (ext == "GL_NV_fragment_shader_interlock") + { + statement("#extension GL_NV_fragment_shader_interlock : require"); + statement("#define SPIRV_Cross_beginInvocationInterlock() beginInvocationInterlockNV()"); + statement("#define SPIRV_Cross_endInvocationInterlock() endInvocationInterlockNV()"); + } + else if (ext == "GL_ARB_fragment_shader_interlock") + { + statement("#ifdef GL_ARB_fragment_shader_interlock"); + statement("#extension GL_ARB_fragment_shader_interlock : enable"); + statement("#define SPIRV_Cross_beginInvocationInterlock() beginInvocationInterlockARB()"); + statement("#define SPIRV_Cross_endInvocationInterlock() endInvocationInterlockARB()"); + statement("#elif defined(GL_INTEL_fragment_shader_ordering)"); + statement("#extension GL_INTEL_fragment_shader_ordering : enable"); + statement("#define SPIRV_Cross_beginInvocationInterlock() beginFragmentShaderOrderingINTEL()"); + statement("#define SPIRV_Cross_endInvocationInterlock()"); + statement("#endif"); + } + else + statement("#extension ", ext, " : require"); + } + + if (!options.vulkan_semantics) + { + using Supp = ShaderSubgroupSupportHelper; + auto result = shader_subgroup_supporter.resolve(); + + for (uint32_t feature_index = 0; feature_index < Supp::FeatureCount; feature_index++) + { + auto feature = static_cast(feature_index); + if (!shader_subgroup_supporter.is_feature_requested(feature)) + continue; + + auto exts = Supp::get_candidates_for_feature(feature, result); + if (exts.empty()) + continue; + + statement(""); + + for (auto &ext : exts) + { + const char *name = Supp::get_extension_name(ext); + const char *extra_predicate = Supp::get_extra_required_extension_predicate(ext); + auto extra_names = Supp::get_extra_required_extension_names(ext); + statement(&ext != &exts.front() ? "#elif" : "#if", " defined(", name, ")", + (*extra_predicate != '\0' ? " && " : ""), extra_predicate); + for (const auto &e : extra_names) + statement("#extension ", e, " : enable"); + statement("#extension ", name, " : require"); + } + + if (!Supp::can_feature_be_implemented_without_extensions(feature)) + { + statement("#else"); + statement("#error No extensions available to emulate requested subgroup feature."); + } + + statement("#endif"); + } + } + + for (auto &header : header_lines) + statement(header); + + SmallVector inputs; + SmallVector outputs; + + switch (execution.model) + { + case ExecutionModelVertex: + if (options.ovr_multiview_view_count) + inputs.push_back(join("num_views = ", options.ovr_multiview_view_count)); + break; + case ExecutionModelGeometry: + if ((execution.flags.get(ExecutionModeInvocations)) && execution.invocations != 1) + inputs.push_back(join("invocations = ", execution.invocations)); + if (execution.flags.get(ExecutionModeInputPoints)) + inputs.push_back("points"); + if (execution.flags.get(ExecutionModeInputLines)) + inputs.push_back("lines"); + if (execution.flags.get(ExecutionModeInputLinesAdjacency)) + inputs.push_back("lines_adjacency"); + if (execution.flags.get(ExecutionModeTriangles)) + inputs.push_back("triangles"); + if (execution.flags.get(ExecutionModeInputTrianglesAdjacency)) + inputs.push_back("triangles_adjacency"); + + if (!execution.geometry_passthrough) + { + // For passthrough, these are implies and cannot be declared in shader. + outputs.push_back(join("max_vertices = ", execution.output_vertices)); + if (execution.flags.get(ExecutionModeOutputTriangleStrip)) + outputs.push_back("triangle_strip"); + if (execution.flags.get(ExecutionModeOutputPoints)) + outputs.push_back("points"); + if (execution.flags.get(ExecutionModeOutputLineStrip)) + outputs.push_back("line_strip"); + } + break; + + case ExecutionModelTessellationControl: + if (execution.flags.get(ExecutionModeOutputVertices)) + outputs.push_back(join("vertices = ", execution.output_vertices)); + break; + + case ExecutionModelTessellationEvaluation: + if (execution.flags.get(ExecutionModeQuads)) + inputs.push_back("quads"); + if (execution.flags.get(ExecutionModeTriangles)) + inputs.push_back("triangles"); + if (execution.flags.get(ExecutionModeIsolines)) + inputs.push_back("isolines"); + if (execution.flags.get(ExecutionModePointMode)) + inputs.push_back("point_mode"); + + if (!execution.flags.get(ExecutionModeIsolines)) + { + if (execution.flags.get(ExecutionModeVertexOrderCw)) + inputs.push_back("cw"); + if (execution.flags.get(ExecutionModeVertexOrderCcw)) + inputs.push_back("ccw"); + } + + if (execution.flags.get(ExecutionModeSpacingFractionalEven)) + inputs.push_back("fractional_even_spacing"); + if (execution.flags.get(ExecutionModeSpacingFractionalOdd)) + inputs.push_back("fractional_odd_spacing"); + if (execution.flags.get(ExecutionModeSpacingEqual)) + inputs.push_back("equal_spacing"); + break; + + case ExecutionModelGLCompute: + case ExecutionModelTaskEXT: + case ExecutionModelMeshEXT: + { + if (execution.workgroup_size.constant != 0 || execution.flags.get(ExecutionModeLocalSizeId)) + { + SpecializationConstant wg_x, wg_y, wg_z; + get_work_group_size_specialization_constants(wg_x, wg_y, wg_z); + + // If there are any spec constants on legacy GLSL, defer declaration, we need to set up macro + // declarations before we can emit the work group size. + if (options.vulkan_semantics || + ((wg_x.id == ConstantID(0)) && (wg_y.id == ConstantID(0)) && (wg_z.id == ConstantID(0)))) + build_workgroup_size(inputs, wg_x, wg_y, wg_z); + } + else + { + inputs.push_back(join("local_size_x = ", execution.workgroup_size.x)); + inputs.push_back(join("local_size_y = ", execution.workgroup_size.y)); + inputs.push_back(join("local_size_z = ", execution.workgroup_size.z)); + } + + if (execution.model == ExecutionModelMeshEXT) + { + outputs.push_back(join("max_vertices = ", execution.output_vertices)); + outputs.push_back(join("max_primitives = ", execution.output_primitives)); + if (execution.flags.get(ExecutionModeOutputTrianglesEXT)) + outputs.push_back("triangles"); + else if (execution.flags.get(ExecutionModeOutputLinesEXT)) + outputs.push_back("lines"); + else if (execution.flags.get(ExecutionModeOutputPoints)) + outputs.push_back("points"); + } + break; + } + + case ExecutionModelFragment: + if (options.es) + { + switch (options.fragment.default_float_precision) + { + case Options::Lowp: + statement("precision lowp float;"); + break; + + case Options::Mediump: + statement("precision mediump float;"); + break; + + case Options::Highp: + statement("precision highp float;"); + break; + + default: + break; + } + + switch (options.fragment.default_int_precision) + { + case Options::Lowp: + statement("precision lowp int;"); + break; + + case Options::Mediump: + statement("precision mediump int;"); + break; + + case Options::Highp: + statement("precision highp int;"); + break; + + default: + break; + } + } + + if (execution.flags.get(ExecutionModeEarlyFragmentTests)) + inputs.push_back("early_fragment_tests"); + if (execution.flags.get(ExecutionModePostDepthCoverage)) + inputs.push_back("post_depth_coverage"); + + if (interlock_used) + statement("#if defined(GL_ARB_fragment_shader_interlock)"); + + if (execution.flags.get(ExecutionModePixelInterlockOrderedEXT)) + statement("layout(pixel_interlock_ordered) in;"); + else if (execution.flags.get(ExecutionModePixelInterlockUnorderedEXT)) + statement("layout(pixel_interlock_unordered) in;"); + else if (execution.flags.get(ExecutionModeSampleInterlockOrderedEXT)) + statement("layout(sample_interlock_ordered) in;"); + else if (execution.flags.get(ExecutionModeSampleInterlockUnorderedEXT)) + statement("layout(sample_interlock_unordered) in;"); + + if (interlock_used) + { + statement("#elif !defined(GL_INTEL_fragment_shader_ordering)"); + statement("#error Fragment Shader Interlock/Ordering extension missing!"); + statement("#endif"); + } + + if (!options.es && execution.flags.get(ExecutionModeDepthGreater)) + statement("layout(depth_greater) out float gl_FragDepth;"); + else if (!options.es && execution.flags.get(ExecutionModeDepthLess)) + statement("layout(depth_less) out float gl_FragDepth;"); + + if (execution.flags.get(ExecutionModeRequireFullQuadsKHR)) + statement("layout(full_quads) in;"); + + break; + + default: + break; + } + + for (auto &cap : ir.declared_capabilities) + if (cap == CapabilityRayTraversalPrimitiveCullingKHR) + statement("layout(primitive_culling);"); + + if (execution.flags.get(ExecutionModeQuadDerivativesKHR)) + statement("layout(quad_derivatives) in;"); + + if (!inputs.empty()) + statement("layout(", merge(inputs), ") in;"); + if (!outputs.empty()) + statement("layout(", merge(outputs), ") out;"); + + statement(""); +} + +bool CompilerGLSL::type_is_empty(const SPIRType &type) +{ + return type.basetype == SPIRType::Struct && type.member_types.empty(); +} + +void CompilerGLSL::emit_struct(SPIRType &type) +{ + // Struct types can be stamped out multiple times + // with just different offsets, matrix layouts, etc ... + // Type-punning with these types is legal, which complicates things + // when we are storing struct and array types in an SSBO for example. + // If the type master is packed however, we can no longer assume that the struct declaration will be redundant. + if (type.type_alias != TypeID(0) && + !has_extended_decoration(type.type_alias, SPIRVCrossDecorationBufferBlockRepacked)) + return; + + add_resource_name(type.self); + auto name = type_to_glsl(type); + + statement(!backend.explicit_struct_type ? "struct " : "", name); + begin_scope(); + + type.member_name_cache.clear(); + + uint32_t i = 0; + bool emitted = false; + for (auto &member : type.member_types) + { + add_member_name(type, i); + emit_struct_member(type, member, i); + i++; + emitted = true; + } + + // Don't declare empty structs in GLSL, this is not allowed. + if (type_is_empty(type) && !backend.supports_empty_struct) + { + statement("int empty_struct_member;"); + emitted = true; + } + + if (has_extended_decoration(type.self, SPIRVCrossDecorationPaddingTarget)) + emit_struct_padding_target(type); + + end_scope_decl(); + + if (emitted) + statement(""); +} + +string CompilerGLSL::to_interpolation_qualifiers(const Bitset &flags) +{ + string res; + //if (flags & (1ull << DecorationSmooth)) + // res += "smooth "; + if (flags.get(DecorationFlat)) + res += "flat "; + if (flags.get(DecorationNoPerspective)) + { + if (options.es) + { + if (options.version < 300) + SPIRV_CROSS_THROW("noperspective requires ESSL 300."); + require_extension_internal("GL_NV_shader_noperspective_interpolation"); + } + else if (is_legacy_desktop()) + require_extension_internal("GL_EXT_gpu_shader4"); + res += "noperspective "; + } + if (flags.get(DecorationCentroid)) + res += "centroid "; + if (flags.get(DecorationPatch)) + res += "patch "; + if (flags.get(DecorationSample)) + { + if (options.es) + { + if (options.version < 300) + SPIRV_CROSS_THROW("sample requires ESSL 300."); + else if (options.version < 320) + require_extension_internal("GL_OES_shader_multisample_interpolation"); + } + res += "sample "; + } + if (flags.get(DecorationInvariant) && (options.es || options.version >= 120)) + res += "invariant "; + if (flags.get(DecorationPerPrimitiveEXT)) + { + res += "perprimitiveEXT "; + require_extension_internal("GL_EXT_mesh_shader"); + } + + if (flags.get(DecorationExplicitInterpAMD)) + { + require_extension_internal("GL_AMD_shader_explicit_vertex_parameter"); + res += "__explicitInterpAMD "; + } + + if (flags.get(DecorationPerVertexKHR)) + { + if (options.es && options.version < 320) + SPIRV_CROSS_THROW("pervertexEXT requires ESSL 320."); + else if (!options.es && options.version < 450) + SPIRV_CROSS_THROW("pervertexEXT requires GLSL 450."); + + if (barycentric_is_nv) + { + require_extension_internal("GL_NV_fragment_shader_barycentric"); + res += "pervertexNV "; + } + else + { + require_extension_internal("GL_EXT_fragment_shader_barycentric"); + res += "pervertexEXT "; + } + } + + return res; +} + +string CompilerGLSL::layout_for_member(const SPIRType &type, uint32_t index) +{ + if (is_legacy()) + return ""; + + bool is_block = has_decoration(type.self, DecorationBlock) || has_decoration(type.self, DecorationBufferBlock); + if (!is_block) + return ""; + + auto &memb = ir.meta[type.self].members; + if (index >= memb.size()) + return ""; + auto &dec = memb[index]; + + SmallVector attr; + + if (has_member_decoration(type.self, index, DecorationPassthroughNV)) + attr.push_back("passthrough"); + + // We can only apply layouts on members in block interfaces. + // This is a bit problematic because in SPIR-V decorations are applied on the struct types directly. + // This is not supported on GLSL, so we have to make the assumption that if a struct within our buffer block struct + // has a decoration, it was originally caused by a top-level layout() qualifier in GLSL. + // + // We would like to go from (SPIR-V style): + // + // struct Foo { layout(row_major) mat4 matrix; }; + // buffer UBO { Foo foo; }; + // + // to + // + // struct Foo { mat4 matrix; }; // GLSL doesn't support any layout shenanigans in raw struct declarations. + // buffer UBO { layout(row_major) Foo foo; }; // Apply the layout on top-level. + auto flags = combined_decoration_for_member(type, index); + + if (flags.get(DecorationRowMajor)) + attr.push_back("row_major"); + // We don't emit any global layouts, so column_major is default. + //if (flags & (1ull << DecorationColMajor)) + // attr.push_back("column_major"); + + if (dec.decoration_flags.get(DecorationLocation) && can_use_io_location(type.storage, true)) + attr.push_back(join("location = ", dec.location)); + + // Can only declare component if we can declare location. + if (dec.decoration_flags.get(DecorationComponent) && can_use_io_location(type.storage, true)) + { + if (!options.es) + { + if (options.version < 440 && options.version >= 140) + require_extension_internal("GL_ARB_enhanced_layouts"); + else if (options.version < 140) + SPIRV_CROSS_THROW("Component decoration is not supported in targets below GLSL 1.40."); + attr.push_back(join("component = ", dec.component)); + } + else + SPIRV_CROSS_THROW("Component decoration is not supported in ES targets."); + } + + // SPIRVCrossDecorationPacked is set by layout_for_variable earlier to mark that we need to emit offset qualifiers. + // This is only done selectively in GLSL as needed. + if (has_extended_decoration(type.self, SPIRVCrossDecorationExplicitOffset) && + dec.decoration_flags.get(DecorationOffset)) + attr.push_back(join("offset = ", dec.offset)); + else if (type.storage == StorageClassOutput && dec.decoration_flags.get(DecorationOffset)) + attr.push_back(join("xfb_offset = ", dec.offset)); + + if (attr.empty()) + return ""; + + string res = "layout("; + res += merge(attr); + res += ") "; + return res; +} + +const char *CompilerGLSL::format_to_glsl(ImageFormat format) +{ + if (options.es && is_desktop_only_format(format)) + SPIRV_CROSS_THROW("Attempting to use image format not supported in ES profile."); + + switch (format) + { + case ImageFormatRgba32f: + return "rgba32f"; + case ImageFormatRgba16f: + return "rgba16f"; + case ImageFormatR32f: + return "r32f"; + case ImageFormatRgba8: + return "rgba8"; + case ImageFormatRgba8Snorm: + return "rgba8_snorm"; + case ImageFormatRg32f: + return "rg32f"; + case ImageFormatRg16f: + return "rg16f"; + case ImageFormatRgba32i: + return "rgba32i"; + case ImageFormatRgba16i: + return "rgba16i"; + case ImageFormatR32i: + return "r32i"; + case ImageFormatRgba8i: + return "rgba8i"; + case ImageFormatRg32i: + return "rg32i"; + case ImageFormatRg16i: + return "rg16i"; + case ImageFormatRgba32ui: + return "rgba32ui"; + case ImageFormatRgba16ui: + return "rgba16ui"; + case ImageFormatR32ui: + return "r32ui"; + case ImageFormatRgba8ui: + return "rgba8ui"; + case ImageFormatRg32ui: + return "rg32ui"; + case ImageFormatRg16ui: + return "rg16ui"; + case ImageFormatR11fG11fB10f: + return "r11f_g11f_b10f"; + case ImageFormatR16f: + return "r16f"; + case ImageFormatRgb10A2: + return "rgb10_a2"; + case ImageFormatR8: + return "r8"; + case ImageFormatRg8: + return "rg8"; + case ImageFormatR16: + return "r16"; + case ImageFormatRg16: + return "rg16"; + case ImageFormatRgba16: + return "rgba16"; + case ImageFormatR16Snorm: + return "r16_snorm"; + case ImageFormatRg16Snorm: + return "rg16_snorm"; + case ImageFormatRgba16Snorm: + return "rgba16_snorm"; + case ImageFormatR8Snorm: + return "r8_snorm"; + case ImageFormatRg8Snorm: + return "rg8_snorm"; + case ImageFormatR8ui: + return "r8ui"; + case ImageFormatRg8ui: + return "rg8ui"; + case ImageFormatR16ui: + return "r16ui"; + case ImageFormatRgb10a2ui: + return "rgb10_a2ui"; + case ImageFormatR8i: + return "r8i"; + case ImageFormatRg8i: + return "rg8i"; + case ImageFormatR16i: + return "r16i"; + case ImageFormatR64i: + return "r64i"; + case ImageFormatR64ui: + return "r64ui"; + default: + case ImageFormatUnknown: + return nullptr; + } +} + +uint32_t CompilerGLSL::type_to_packed_base_size(const SPIRType &type, BufferPackingStandard) +{ + switch (type.basetype) + { + case SPIRType::Double: + case SPIRType::Int64: + case SPIRType::UInt64: + return 8; + case SPIRType::Float: + case SPIRType::Int: + case SPIRType::UInt: + return 4; + case SPIRType::Half: + case SPIRType::Short: + case SPIRType::UShort: + case SPIRType::BFloat16: + return 2; + case SPIRType::SByte: + case SPIRType::UByte: + case SPIRType::FloatE4M3: + case SPIRType::FloatE5M2: + return 1; + + default: + SPIRV_CROSS_THROW("Unrecognized type in type_to_packed_base_size."); + } +} + +uint32_t CompilerGLSL::type_to_packed_alignment(const SPIRType &type, const Bitset &flags, + BufferPackingStandard packing) +{ + // If using PhysicalStorageBuffer storage class, this is a pointer, + // and is 64-bit. + if (is_physical_pointer(type)) + { + if (!type.pointer) + SPIRV_CROSS_THROW("Types in PhysicalStorageBuffer must be pointers."); + + if (ir.addressing_model == AddressingModelPhysicalStorageBuffer64) + { + if (packing_is_vec4_padded(packing) && type_is_array_of_pointers(type)) + return 16; + else + return 8; + } + else + SPIRV_CROSS_THROW("AddressingModelPhysicalStorageBuffer64 must be used for PhysicalStorageBuffer."); + } + else if (is_array(type)) + { + uint32_t minimum_alignment = 1; + if (packing_is_vec4_padded(packing)) + minimum_alignment = 16; + + auto *tmp = &get(type.parent_type); + while (!tmp->array.empty()) + tmp = &get(tmp->parent_type); + + // Get the alignment of the base type, then maybe round up. + return max(minimum_alignment, type_to_packed_alignment(*tmp, flags, packing)); + } + + if (type.basetype == SPIRType::Struct) + { + // Rule 9. Structs alignments are maximum alignment of its members. + uint32_t alignment = 1; + for (uint32_t i = 0; i < type.member_types.size(); i++) + { + auto member_flags = ir.meta[type.self].members[i].decoration_flags; + alignment = + max(alignment, type_to_packed_alignment(get(type.member_types[i]), member_flags, packing)); + } + + // In std140, struct alignment is rounded up to 16. + if (packing_is_vec4_padded(packing)) + alignment = max(alignment, 16u); + + return alignment; + } + else + { + const uint32_t base_alignment = type_to_packed_base_size(type, packing); + + // Alignment requirement for scalar block layout is always the alignment for the most basic component. + if (packing_is_scalar(packing)) + return base_alignment; + + // Vectors are *not* aligned in HLSL, but there's an extra rule where vectors cannot straddle + // a vec4, this is handled outside since that part knows our current offset. + if (type.columns == 1 && packing_is_hlsl(packing)) + return base_alignment; + + // From 7.6.2.2 in GL 4.5 core spec. + // Rule 1 + if (type.vecsize == 1 && type.columns == 1) + return base_alignment; + + // Rule 2 + if ((type.vecsize == 2 || type.vecsize == 4) && type.columns == 1) + return type.vecsize * base_alignment; + + // Rule 3 + if (type.vecsize == 3 && type.columns == 1) + return 4 * base_alignment; + + // Rule 4 implied. Alignment does not change in std430. + + // Rule 5. Column-major matrices are stored as arrays of + // vectors. + if (flags.get(DecorationColMajor) && type.columns > 1) + { + if (packing_is_vec4_padded(packing)) + return 4 * base_alignment; + else if (type.vecsize == 3) + return 4 * base_alignment; + else + return type.vecsize * base_alignment; + } + + // Rule 6 implied. + + // Rule 7. + if (flags.get(DecorationRowMajor) && type.vecsize > 1) + { + if (packing_is_vec4_padded(packing)) + return 4 * base_alignment; + else if (type.columns == 3) + return 4 * base_alignment; + else + return type.columns * base_alignment; + } + + // Rule 8 implied. + } + + SPIRV_CROSS_THROW("Did not find suitable rule for type. Bogus decorations?"); +} + +uint32_t CompilerGLSL::type_to_packed_array_stride(const SPIRType &type, const Bitset &flags, + BufferPackingStandard packing) +{ + // Array stride is equal to aligned size of the underlying type. + uint32_t parent = type.parent_type; + assert(parent); + + auto &tmp = get(parent); + + uint32_t size = type_to_packed_size(tmp, flags, packing); + uint32_t alignment = type_to_packed_alignment(type, flags, packing); + return (size + alignment - 1) & ~(alignment - 1); +} + +uint32_t CompilerGLSL::type_to_packed_size(const SPIRType &type, const Bitset &flags, BufferPackingStandard packing) +{ + // If using PhysicalStorageBuffer storage class, this is a pointer, + // and is 64-bit. + if (is_physical_pointer(type)) + { + if (!type.pointer) + SPIRV_CROSS_THROW("Types in PhysicalStorageBuffer must be pointers."); + + if (ir.addressing_model == AddressingModelPhysicalStorageBuffer64) + return 8; + else + SPIRV_CROSS_THROW("AddressingModelPhysicalStorageBuffer64 must be used for PhysicalStorageBuffer."); + } + else if (is_array(type)) + { + uint32_t packed_size = to_array_size_literal(type) * type_to_packed_array_stride(type, flags, packing); + + if (packing_is_hlsl(packing)) + { + // For arrays of vectors and matrices in HLSL, the last element has a size which depends on its vector size, + // so that it is possible to pack other vectors into the last element. + if (type.basetype != SPIRType::Struct) + { + if (flags.get(DecorationRowMajor) && type.columns > 1) + packed_size -= (4 - type.columns) * (type.width / 8); + else + packed_size -= (4 - type.vecsize) * (type.width / 8); + } + else + { + const auto *base_type = &type; + while (is_array(*base_type)) + { + auto &new_type = get(base_type->parent_type); + if (!is_array(new_type)) + break; + base_type = &new_type; + } + + packed_size -= type_to_packed_array_stride(*base_type, flags, packing); + packed_size += type_to_packed_size(get(base_type->parent_type), flags, packing); + } + } + + return packed_size; + } + + uint32_t size = 0; + + if (type.basetype == SPIRType::Struct) + { + uint32_t pad_alignment = 1; + + for (uint32_t i = 0; i < type.member_types.size(); i++) + { + auto member_flags = ir.meta[type.self].members[i].decoration_flags; + auto &member_type = get(type.member_types[i]); + + uint32_t packed_alignment = type_to_packed_alignment(member_type, member_flags, packing); + uint32_t alignment = max(packed_alignment, pad_alignment); + + uint32_t element_size = type_to_packed_size(member_type, member_flags, packing); + pad_alignment = 1; + + if (packing_is_hlsl(packing)) + { + // HLSL is primarily a "cannot-straddle-vec4" language. + uint32_t begin_word = size / 16; + uint32_t end_word = (size + element_size - 1) / 16; + if (begin_word != end_word) + alignment = max(alignment, 16u); + } + else + { + // The next member following a struct member is aligned to the base alignment of the struct that came before. + // GL 4.5 spec, 7.6.2.2. + if (member_type.basetype == SPIRType::Struct) + pad_alignment = packed_alignment; + } + + size = (size + alignment - 1) & ~(alignment - 1); + size += element_size; + } + } + else + { + const uint32_t base_alignment = type_to_packed_base_size(type, packing); + + if (packing_is_scalar(packing)) + { + size = type.vecsize * type.columns * base_alignment; + } + else + { + if (type.columns == 1) + size = type.vecsize * base_alignment; + + if (flags.get(DecorationColMajor) && type.columns > 1) + { + if (packing_is_vec4_padded(packing) || type.vecsize == 3) + size = type.columns * 4 * base_alignment; + else + size = type.columns * type.vecsize * base_alignment; + } + + if (flags.get(DecorationRowMajor) && type.vecsize > 1) + { + if (packing_is_vec4_padded(packing) || type.columns == 3) + size = type.vecsize * 4 * base_alignment; + else + size = type.vecsize * type.columns * base_alignment; + } + + // For matrices in HLSL, the last element has a size which depends on its vector size, + // so that it is possible to pack other vectors into the last element. + if (packing_is_hlsl(packing) && type.columns > 1) + { + if (flags.get(DecorationRowMajor)) + size -= (4 - type.columns) * (type.width / 8); + else + size -= (4 - type.vecsize) * (type.width / 8); + } + } + } + + return size; +} + +bool CompilerGLSL::buffer_is_packing_standard(const SPIRType &type, BufferPackingStandard packing, + uint32_t *failed_validation_index, uint32_t start_offset, + uint32_t end_offset) +{ + // This is very tricky and error prone, but try to be exhaustive and correct here. + // SPIR-V doesn't directly say if we're using std430 or std140. + // SPIR-V communicates this using Offset and ArrayStride decorations (which is what really matters), + // so we have to try to infer whether or not the original GLSL source was std140 or std430 based on this information. + // We do not have to consider shared or packed since these layouts are not allowed in Vulkan SPIR-V (they are useless anyways, and custom offsets would do the same thing). + // + // It is almost certain that we're using std430, but it gets tricky with arrays in particular. + // We will assume std430, but infer std140 if we can prove the struct is not compliant with std430. + // + // The only two differences between std140 and std430 are related to padding alignment/array stride + // in arrays and structs. In std140 they take minimum vec4 alignment. + // std430 only removes the vec4 requirement. + + uint32_t offset = 0; + uint32_t pad_alignment = 1; + + bool is_top_level_block = + has_decoration(type.self, DecorationBlock) || has_decoration(type.self, DecorationBufferBlock); + + for (uint32_t i = 0; i < type.member_types.size(); i++) + { + auto &memb_type = get(type.member_types[i]); + + auto *type_meta = ir.find_meta(type.self); + auto member_flags = type_meta ? type_meta->members[i].decoration_flags : Bitset{}; + + // Verify alignment rules. + uint32_t packed_alignment = type_to_packed_alignment(memb_type, member_flags, packing); + + // This is a rather dirty workaround to deal with some cases of OpSpecConstantOp used as array size, e.g: + // layout(constant_id = 0) const int s = 10; + // const int S = s + 5; // SpecConstantOp + // buffer Foo { int data[S]; }; // <-- Very hard for us to deduce a fixed value here, + // we would need full implementation of compile-time constant folding. :( + // If we are the last member of a struct, there might be cases where the actual size of that member is irrelevant + // for our analysis (e.g. unsized arrays). + // This lets us simply ignore that there are spec constant op sized arrays in our buffers. + // Querying size of this member will fail, so just don't call it unless we have to. + // + // This is likely "best effort" we can support without going into unacceptably complicated workarounds. + bool member_can_be_unsized = + is_top_level_block && size_t(i + 1) == type.member_types.size() && !memb_type.array.empty(); + + uint32_t packed_size = 0; + if (!member_can_be_unsized || packing_is_hlsl(packing)) + packed_size = type_to_packed_size(memb_type, member_flags, packing); + + // We only need to care about this if we have non-array types which can straddle the vec4 boundary. + uint32_t actual_offset = type_struct_member_offset(type, i); + + if (packing_is_hlsl(packing)) + { + // If a member straddles across a vec4 boundary, alignment is actually vec4. + uint32_t target_offset; + + // If we intend to use explicit packing, we must check for improper straddle with that offset. + // In implicit packing, we must check with implicit offset, since the explicit offset + // might have already accounted for the straddle, and we'd miss the alignment promotion to vec4. + // This is important when packing sub-structs that don't support packoffset(). + if (packing_has_flexible_offset(packing)) + target_offset = actual_offset; + else + target_offset = offset; + + uint32_t begin_word = target_offset / 16; + uint32_t end_word = (target_offset + packed_size - 1) / 16; + + if (begin_word != end_word) + packed_alignment = max(packed_alignment, 16u); + } + + // Field is not in the specified range anymore and we can ignore any further fields. + if (actual_offset >= end_offset) + break; + + uint32_t alignment = max(packed_alignment, pad_alignment); + offset = (offset + alignment - 1) & ~(alignment - 1); + + // The next member following a struct member is aligned to the base alignment of the struct that came before. + // GL 4.5 spec, 7.6.2.2. + if (!packing_is_hlsl(packing) && memb_type.basetype == SPIRType::Struct && !memb_type.pointer) + pad_alignment = packed_alignment; + else + pad_alignment = 1; + + // Only care about packing if we are in the given range + if (actual_offset >= start_offset) + { + // We only care about offsets in std140, std430, etc ... + // For EnhancedLayout variants, we have the flexibility to choose our own offsets. + if (!packing_has_flexible_offset(packing)) + { + if (actual_offset != offset) // This cannot be the packing we're looking for. + { + if (failed_validation_index) + *failed_validation_index = i; + return false; + } + } + else if ((actual_offset & (alignment - 1)) != 0) + { + // We still need to verify that alignment rules are observed, even if we have explicit offset. + if (failed_validation_index) + *failed_validation_index = i; + return false; + } + + // Verify array stride rules. + if (is_array(memb_type)) + { + auto packed_array_stride = type_to_packed_array_stride(memb_type, member_flags, packing); + auto member_array_stride = type_struct_member_array_stride(type, i); + if (packed_array_stride != member_array_stride) + { + if (failed_validation_index) + *failed_validation_index = i; + return false; + } + } + + // Verify that sub-structs also follow packing rules. + // We cannot use enhanced layouts on substructs, so they better be up to spec. + auto substruct_packing = packing_to_substruct_packing(packing); + + if (!memb_type.pointer && !memb_type.member_types.empty() && + !buffer_is_packing_standard(memb_type, substruct_packing)) + { + if (failed_validation_index) + *failed_validation_index = i; + return false; + } + } + + // Bump size. + offset = actual_offset + packed_size; + } + + return true; +} + +bool CompilerGLSL::can_use_io_location(StorageClass storage, bool block) +{ + // Location specifiers are must have in SPIR-V, but they aren't really supported in earlier versions of GLSL. + // Be very explicit here about how to solve the issue. + if ((get_execution_model() != ExecutionModelVertex && storage == StorageClassInput) || + (get_execution_model() != ExecutionModelFragment && storage == StorageClassOutput)) + { + uint32_t minimum_desktop_version = block ? 440 : 410; + // ARB_enhanced_layouts vs ARB_separate_shader_objects ... + + if (!options.es && options.version < minimum_desktop_version && !options.separate_shader_objects) + return false; + else if (options.es && options.version < 310) + return false; + } + + if ((get_execution_model() == ExecutionModelVertex && storage == StorageClassInput) || + (get_execution_model() == ExecutionModelFragment && storage == StorageClassOutput)) + { + if (options.es && options.version < 300) + return false; + else if (!options.es && options.version < 330) + return false; + } + + if (storage == StorageClassUniform || storage == StorageClassUniformConstant || storage == StorageClassPushConstant) + { + if (options.es && options.version < 310) + return false; + else if (!options.es && options.version < 430) + return false; + } + + return true; +} + +string CompilerGLSL::layout_for_variable(const SPIRVariable &var) +{ + // FIXME: Come up with a better solution for when to disable layouts. + // Having layouts depend on extensions as well as which types + // of layouts are used. For now, the simple solution is to just disable + // layouts for legacy versions. + if (is_legacy()) + return ""; + + if (subpass_input_is_framebuffer_fetch(var.self)) + return ""; + + SmallVector attr; + + auto &type = get(var.basetype); + auto &flags = get_decoration_bitset(var.self); + auto &typeflags = get_decoration_bitset(type.self); + + if (flags.get(DecorationPassthroughNV)) + attr.push_back("passthrough"); + + if (options.vulkan_semantics && var.storage == StorageClassPushConstant) + attr.push_back("push_constant"); + else if (var.storage == StorageClassShaderRecordBufferKHR) + attr.push_back(ray_tracing_is_khr ? "shaderRecordEXT" : "shaderRecordNV"); + + if (flags.get(DecorationRowMajor)) + attr.push_back("row_major"); + if (flags.get(DecorationColMajor)) + attr.push_back("column_major"); + + if (options.vulkan_semantics) + { + if (flags.get(DecorationInputAttachmentIndex)) + attr.push_back(join("input_attachment_index = ", get_decoration(var.self, DecorationInputAttachmentIndex))); + } + + bool is_block = has_decoration(type.self, DecorationBlock); + if (flags.get(DecorationLocation) && can_use_io_location(var.storage, is_block)) + { + Bitset combined_decoration; + for (uint32_t i = 0; i < ir.meta[type.self].members.size(); i++) + combined_decoration.merge_or(combined_decoration_for_member(type, i)); + + // If our members have location decorations, we don't need to + // emit location decorations at the top as well (looks weird). + if (!combined_decoration.get(DecorationLocation)) + attr.push_back(join("location = ", get_decoration(var.self, DecorationLocation))); + } + + if (get_execution_model() == ExecutionModelFragment && var.storage == StorageClassOutput && + location_is_non_coherent_framebuffer_fetch(get_decoration(var.self, DecorationLocation))) + { + attr.push_back("noncoherent"); + } + + // Transform feedback + bool uses_enhanced_layouts = false; + if (is_block && var.storage == StorageClassOutput) + { + // For blocks, there is a restriction where xfb_stride/xfb_buffer must only be declared on the block itself, + // since all members must match the same xfb_buffer. The only thing we will declare for members of the block + // is the xfb_offset. + uint32_t member_count = uint32_t(type.member_types.size()); + bool have_xfb_buffer_stride = false; + bool have_any_xfb_offset = false; + bool have_geom_stream = false; + uint32_t xfb_stride = 0, xfb_buffer = 0, geom_stream = 0; + + if (flags.get(DecorationXfbBuffer) && flags.get(DecorationXfbStride)) + { + have_xfb_buffer_stride = true; + xfb_buffer = get_decoration(var.self, DecorationXfbBuffer); + xfb_stride = get_decoration(var.self, DecorationXfbStride); + } + + if (flags.get(DecorationStream)) + { + have_geom_stream = true; + geom_stream = get_decoration(var.self, DecorationStream); + } + + // Verify that none of the members violate our assumption. + for (uint32_t i = 0; i < member_count; i++) + { + if (has_member_decoration(type.self, i, DecorationStream)) + { + uint32_t member_geom_stream = get_member_decoration(type.self, i, DecorationStream); + if (have_geom_stream && member_geom_stream != geom_stream) + SPIRV_CROSS_THROW("IO block member Stream mismatch."); + have_geom_stream = true; + geom_stream = member_geom_stream; + } + + // Only members with an Offset decoration participate in XFB. + if (!has_member_decoration(type.self, i, DecorationOffset)) + continue; + have_any_xfb_offset = true; + + if (has_member_decoration(type.self, i, DecorationXfbBuffer)) + { + uint32_t buffer_index = get_member_decoration(type.self, i, DecorationXfbBuffer); + if (have_xfb_buffer_stride && buffer_index != xfb_buffer) + SPIRV_CROSS_THROW("IO block member XfbBuffer mismatch."); + have_xfb_buffer_stride = true; + xfb_buffer = buffer_index; + } + + if (has_member_decoration(type.self, i, DecorationXfbStride)) + { + uint32_t stride = get_member_decoration(type.self, i, DecorationXfbStride); + if (have_xfb_buffer_stride && stride != xfb_stride) + SPIRV_CROSS_THROW("IO block member XfbStride mismatch."); + have_xfb_buffer_stride = true; + xfb_stride = stride; + } + } + + if (have_xfb_buffer_stride && have_any_xfb_offset) + { + attr.push_back(join("xfb_buffer = ", xfb_buffer)); + attr.push_back(join("xfb_stride = ", xfb_stride)); + uses_enhanced_layouts = true; + } + + if (have_geom_stream) + { + if (get_execution_model() != ExecutionModelGeometry) + SPIRV_CROSS_THROW("Geometry streams can only be used in geometry shaders."); + if (options.es) + SPIRV_CROSS_THROW("Multiple geometry streams not supported in ESSL."); + if (options.version < 400) + require_extension_internal("GL_ARB_transform_feedback3"); + attr.push_back(join("stream = ", get_decoration(var.self, DecorationStream))); + } + } + else if (var.storage == StorageClassOutput) + { + if (flags.get(DecorationXfbBuffer) && flags.get(DecorationXfbStride) && flags.get(DecorationOffset)) + { + // XFB for standalone variables, we can emit all decorations. + attr.push_back(join("xfb_buffer = ", get_decoration(var.self, DecorationXfbBuffer))); + attr.push_back(join("xfb_stride = ", get_decoration(var.self, DecorationXfbStride))); + attr.push_back(join("xfb_offset = ", get_decoration(var.self, DecorationOffset))); + uses_enhanced_layouts = true; + } + + if (flags.get(DecorationStream)) + { + if (get_execution_model() != ExecutionModelGeometry) + SPIRV_CROSS_THROW("Geometry streams can only be used in geometry shaders."); + if (options.es) + SPIRV_CROSS_THROW("Multiple geometry streams not supported in ESSL."); + if (options.version < 400) + require_extension_internal("GL_ARB_transform_feedback3"); + attr.push_back(join("stream = ", get_decoration(var.self, DecorationStream))); + } + } + + // Can only declare Component if we can declare location. + if (flags.get(DecorationComponent) && can_use_io_location(var.storage, is_block)) + { + uses_enhanced_layouts = true; + attr.push_back(join("component = ", get_decoration(var.self, DecorationComponent))); + } + + if (uses_enhanced_layouts) + { + if (!options.es) + { + if (options.version < 440 && options.version >= 140) + require_extension_internal("GL_ARB_enhanced_layouts"); + else if (options.version < 140) + SPIRV_CROSS_THROW("GL_ARB_enhanced_layouts is not supported in targets below GLSL 1.40."); + if (!options.es && options.version < 440) + require_extension_internal("GL_ARB_enhanced_layouts"); + } + else if (options.es) + SPIRV_CROSS_THROW("GL_ARB_enhanced_layouts is not supported in ESSL."); + } + + if (flags.get(DecorationIndex)) + attr.push_back(join("index = ", get_decoration(var.self, DecorationIndex))); + + // Do not emit set = decoration in regular GLSL output, but + // we need to preserve it in Vulkan GLSL mode. + if (var.storage != StorageClassPushConstant && var.storage != StorageClassShaderRecordBufferKHR) + { + if (flags.get(DecorationDescriptorSet) && options.vulkan_semantics) + attr.push_back(join("set = ", get_decoration(var.self, DecorationDescriptorSet))); + } + + bool push_constant_block = options.vulkan_semantics && var.storage == StorageClassPushConstant; + bool ssbo_block = var.storage == StorageClassStorageBuffer || var.storage == StorageClassShaderRecordBufferKHR || + (var.storage == StorageClassUniform && typeflags.get(DecorationBufferBlock)); + bool emulated_ubo = var.storage == StorageClassPushConstant && options.emit_push_constant_as_uniform_buffer; + bool ubo_block = var.storage == StorageClassUniform && typeflags.get(DecorationBlock); + + // GL 3.0/GLSL 1.30 is not considered legacy, but it doesn't have UBOs ... + bool can_use_buffer_blocks = (options.es && options.version >= 300) || (!options.es && options.version >= 140); + + // pretend no UBOs when options say so + if (ubo_block && options.emit_uniform_buffer_as_plain_uniforms) + can_use_buffer_blocks = false; + + bool can_use_binding; + if (options.es) + can_use_binding = options.version >= 310; + else + can_use_binding = options.enable_420pack_extension || (options.version >= 420); + + // Make sure we don't emit binding layout for a classic uniform on GLSL 1.30. + if (!can_use_buffer_blocks && var.storage == StorageClassUniform) + can_use_binding = false; + + if (var.storage == StorageClassShaderRecordBufferKHR) + can_use_binding = false; + + if (can_use_binding && flags.get(DecorationBinding)) + attr.push_back(join("binding = ", get_decoration(var.self, DecorationBinding))); + + if (var.storage != StorageClassOutput && flags.get(DecorationOffset)) + attr.push_back(join("offset = ", get_decoration(var.self, DecorationOffset))); + + // Instead of adding explicit offsets for every element here, just assume we're using std140 or std430. + // If SPIR-V does not comply with either layout, we cannot really work around it. + if (can_use_buffer_blocks && (ubo_block || emulated_ubo)) + { + attr.push_back(buffer_to_packing_standard(type, false, true)); + } + else if (can_use_buffer_blocks && (push_constant_block || ssbo_block)) + { + attr.push_back(buffer_to_packing_standard(type, true, true)); + } + + // For images, the type itself adds a layout qualifer. + // Only emit the format for storage images. + if (type.basetype == SPIRType::Image && type.image.sampled == 2) + { + const char *fmt = format_to_glsl(type.image.format); + if (fmt) + attr.push_back(fmt); + } + + if (attr.empty()) + return ""; + + string res = "layout("; + res += merge(attr); + res += ") "; + return res; +} + +string CompilerGLSL::buffer_to_packing_standard(const SPIRType &type, + bool support_std430_without_scalar_layout, + bool support_enhanced_layouts) +{ + if (support_std430_without_scalar_layout && buffer_is_packing_standard(type, BufferPackingStd430)) + return "std430"; + else if (buffer_is_packing_standard(type, BufferPackingStd140)) + return "std140"; + else if (options.vulkan_semantics && buffer_is_packing_standard(type, BufferPackingScalar)) + { + require_extension_internal("GL_EXT_scalar_block_layout"); + return "scalar"; + } + else if (support_std430_without_scalar_layout && + support_enhanced_layouts && + buffer_is_packing_standard(type, BufferPackingStd430EnhancedLayout)) + { + if (options.es && !options.vulkan_semantics) + SPIRV_CROSS_THROW("Push constant block cannot be expressed as neither std430 nor std140. ES-targets do " + "not support GL_ARB_enhanced_layouts."); + if (!options.es && !options.vulkan_semantics && options.version < 440) + require_extension_internal("GL_ARB_enhanced_layouts"); + + set_extended_decoration(type.self, SPIRVCrossDecorationExplicitOffset); + return "std430"; + } + else if (support_enhanced_layouts && + buffer_is_packing_standard(type, BufferPackingStd140EnhancedLayout)) + { + // Fallback time. We might be able to use the ARB_enhanced_layouts to deal with this difference, + // however, we can only use layout(offset) on the block itself, not any substructs, so the substructs better be the appropriate layout. + // Enhanced layouts seem to always work in Vulkan GLSL, so no need for extensions there. + if (options.es && !options.vulkan_semantics) + SPIRV_CROSS_THROW("Push constant block cannot be expressed as neither std430 nor std140. ES-targets do " + "not support GL_ARB_enhanced_layouts."); + if (!options.es && !options.vulkan_semantics && options.version < 440) + require_extension_internal("GL_ARB_enhanced_layouts"); + + set_extended_decoration(type.self, SPIRVCrossDecorationExplicitOffset); + return "std140"; + } + else if (options.vulkan_semantics && + support_enhanced_layouts && + buffer_is_packing_standard(type, BufferPackingScalarEnhancedLayout)) + { + set_extended_decoration(type.self, SPIRVCrossDecorationExplicitOffset); + require_extension_internal("GL_EXT_scalar_block_layout"); + return "scalar"; + } + else if (!support_std430_without_scalar_layout && options.vulkan_semantics && + buffer_is_packing_standard(type, BufferPackingStd430)) + { + // UBOs can support std430 with GL_EXT_scalar_block_layout. + require_extension_internal("GL_EXT_scalar_block_layout"); + return "std430"; + } + else if (!support_std430_without_scalar_layout && options.vulkan_semantics && + support_enhanced_layouts && + buffer_is_packing_standard(type, BufferPackingStd430EnhancedLayout)) + { + // UBOs can support std430 with GL_EXT_scalar_block_layout. + set_extended_decoration(type.self, SPIRVCrossDecorationExplicitOffset); + require_extension_internal("GL_EXT_scalar_block_layout"); + return "std430"; + } + else + { + SPIRV_CROSS_THROW("Buffer block cannot be expressed as any of std430, std140, scalar, even with enhanced " + "layouts. You can try flattening this block to support a more flexible layout."); + } +} + +void CompilerGLSL::emit_push_constant_block(const SPIRVariable &var) +{ + if (flattened_buffer_blocks.count(var.self)) + emit_buffer_block_flattened(var); + else if (options.vulkan_semantics) + emit_push_constant_block_vulkan(var); + else if (options.emit_push_constant_as_uniform_buffer) + emit_buffer_block_native(var); + else + emit_push_constant_block_glsl(var); +} + +void CompilerGLSL::emit_push_constant_block_vulkan(const SPIRVariable &var) +{ + emit_buffer_block(var); +} + +void CompilerGLSL::emit_push_constant_block_glsl(const SPIRVariable &var) +{ + // OpenGL has no concept of push constant blocks, implement it as a uniform struct. + auto &type = get(var.basetype); + + unset_decoration(var.self, DecorationBinding); + unset_decoration(var.self, DecorationDescriptorSet); + +#if 0 + if (flags & ((1ull << DecorationBinding) | (1ull << DecorationDescriptorSet))) + SPIRV_CROSS_THROW("Push constant blocks cannot be compiled to GLSL with Binding or Set syntax. " + "Remap to location with reflection API first or disable these decorations."); +#endif + + // We're emitting the push constant block as a regular struct, so disable the block qualifier temporarily. + // Otherwise, we will end up emitting layout() qualifiers on naked structs which is not allowed. + bool block_flag = has_decoration(type.self, DecorationBlock); + unset_decoration(type.self, DecorationBlock); + + emit_struct(type); + + if (block_flag) + set_decoration(type.self, DecorationBlock); + + emit_uniform(var); + statement(""); +} + +void CompilerGLSL::emit_buffer_block(const SPIRVariable &var) +{ + auto &type = get(var.basetype); + bool ubo_block = var.storage == StorageClassUniform && has_decoration(type.self, DecorationBlock); + + if (flattened_buffer_blocks.count(var.self)) + emit_buffer_block_flattened(var); + else if (is_legacy() || (!options.es && options.version == 130) || + (ubo_block && options.emit_uniform_buffer_as_plain_uniforms)) + emit_buffer_block_legacy(var); + else + emit_buffer_block_native(var); +} + +void CompilerGLSL::emit_buffer_block_legacy(const SPIRVariable &var) +{ + auto &type = get(var.basetype); + bool ssbo = var.storage == StorageClassStorageBuffer || + ir.meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock); + if (ssbo) + SPIRV_CROSS_THROW("SSBOs not supported in legacy targets."); + + // We're emitting the push constant block as a regular struct, so disable the block qualifier temporarily. + // Otherwise, we will end up emitting layout() qualifiers on naked structs which is not allowed. + auto &block_flags = ir.meta[type.self].decoration.decoration_flags; + bool block_flag = block_flags.get(DecorationBlock); + block_flags.clear(DecorationBlock); + emit_struct(type); + if (block_flag) + block_flags.set(DecorationBlock); + emit_uniform(var); + statement(""); +} + +void CompilerGLSL::emit_buffer_reference_block(uint32_t type_id, bool forward_declaration) +{ + auto &type = get(type_id); + string buffer_name; + + if (forward_declaration && is_physical_pointer_to_buffer_block(type)) + { + // Block names should never alias, but from HLSL input they kind of can because block types are reused for UAVs ... + // Allow aliased name since we might be declaring the block twice. Once with buffer reference (forward declared) and one proper declaration. + // The names must match up. + buffer_name = to_name(type.self, false); + + // Shaders never use the block by interface name, so we don't + // have to track this other than updating name caches. + // If we have a collision for any reason, just fallback immediately. + if (ir.meta[type.self].decoration.alias.empty() || + block_ssbo_names.find(buffer_name) != end(block_ssbo_names) || + resource_names.find(buffer_name) != end(resource_names)) + { + buffer_name = join("_", type.self); + } + + // Make sure we get something unique for both global name scope and block name scope. + // See GLSL 4.5 spec: section 4.3.9 for details. + add_variable(block_ssbo_names, resource_names, buffer_name); + + // If for some reason buffer_name is an illegal name, make a final fallback to a workaround name. + // This cannot conflict with anything else, so we're safe now. + // We cannot reuse this fallback name in neither global scope (blocked by block_names) nor block name scope. + if (buffer_name.empty()) + buffer_name = join("_", type.self); + + block_names.insert(buffer_name); + block_ssbo_names.insert(buffer_name); + + // Ensure we emit the correct name when emitting non-forward pointer type. + ir.meta[type.self].decoration.alias = buffer_name; + } + else + { + buffer_name = type_to_glsl(type); + } + + if (!forward_declaration) + { + auto itr = physical_storage_type_to_alignment.find(type_id); + uint32_t alignment = 0; + if (itr != physical_storage_type_to_alignment.end()) + alignment = itr->second.alignment; + + if (is_physical_pointer_to_buffer_block(type)) + { + SmallVector attributes; + attributes.push_back("buffer_reference"); + if (alignment) + attributes.push_back(join("buffer_reference_align = ", alignment)); + attributes.push_back(buffer_to_packing_standard(type, true, true)); + + auto flags = ir.get_buffer_block_type_flags(type); + string decorations; + if (flags.get(DecorationRestrict)) + decorations += " restrict"; + if (flags.get(DecorationCoherent)) + decorations += " coherent"; + if (flags.get(DecorationNonReadable)) + decorations += " writeonly"; + if (flags.get(DecorationNonWritable)) + decorations += " readonly"; + + statement("layout(", merge(attributes), ")", decorations, " buffer ", buffer_name); + } + else + { + string packing_standard; + if (type.basetype == SPIRType::Struct) + { + // The non-block type is embedded in a block, so we cannot use enhanced layouts :( + packing_standard = buffer_to_packing_standard(type, true, false) + ", "; + } + else if (is_array(get_pointee_type(type))) + { + SPIRType wrap_type{OpTypeStruct}; + wrap_type.self = ir.increase_bound_by(1); + wrap_type.member_types.push_back(get_pointee_type_id(type_id)); + ir.set_member_decoration(wrap_type.self, 0, DecorationOffset, 0); + packing_standard = buffer_to_packing_standard(wrap_type, true, false) + ", "; + } + + if (alignment) + statement("layout(", packing_standard, "buffer_reference, buffer_reference_align = ", alignment, ") buffer ", buffer_name); + else + statement("layout(", packing_standard, "buffer_reference) buffer ", buffer_name); + } + + begin_scope(); + + if (is_physical_pointer_to_buffer_block(type)) + { + type.member_name_cache.clear(); + + uint32_t i = 0; + for (auto &member : type.member_types) + { + add_member_name(type, i); + emit_struct_member(type, member, i); + i++; + } + } + else + { + auto &pointee_type = get_pointee_type(type); + statement(type_to_glsl(pointee_type), " value", type_to_array_glsl(pointee_type, 0), ";"); + } + + end_scope_decl(); + statement(""); + } + else + { + statement("layout(buffer_reference) buffer ", buffer_name, ";"); + } +} + +void CompilerGLSL::emit_buffer_block_native(const SPIRVariable &var) +{ + auto &type = get(var.basetype); + + Bitset flags = ir.get_buffer_block_flags(var); + bool ssbo = var.storage == StorageClassStorageBuffer || var.storage == StorageClassShaderRecordBufferKHR || + ir.meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock); + bool is_restrict = ssbo && flags.get(DecorationRestrict); + bool is_writeonly = ssbo && flags.get(DecorationNonReadable); + bool is_readonly = ssbo && flags.get(DecorationNonWritable); + bool is_coherent = ssbo && flags.get(DecorationCoherent); + + // Block names should never alias, but from HLSL input they kind of can because block types are reused for UAVs ... + auto buffer_name = to_name(type.self, false); + + auto &block_namespace = ssbo ? block_ssbo_names : block_ubo_names; + + // Shaders never use the block by interface name, so we don't + // have to track this other than updating name caches. + // If we have a collision for any reason, just fallback immediately. + if (ir.meta[type.self].decoration.alias.empty() || block_namespace.find(buffer_name) != end(block_namespace) || + resource_names.find(buffer_name) != end(resource_names)) + { + buffer_name = get_block_fallback_name(var.self); + } + + // Make sure we get something unique for both global name scope and block name scope. + // See GLSL 4.5 spec: section 4.3.9 for details. + add_variable(block_namespace, resource_names, buffer_name); + + // If for some reason buffer_name is an illegal name, make a final fallback to a workaround name. + // This cannot conflict with anything else, so we're safe now. + // We cannot reuse this fallback name in neither global scope (blocked by block_names) nor block name scope. + if (buffer_name.empty()) + buffer_name = join("_", get(var.basetype).self, "_", var.self); + + block_names.insert(buffer_name); + block_namespace.insert(buffer_name); + + // Save for post-reflection later. + declared_block_names[var.self] = buffer_name; + + statement(layout_for_variable(var), is_coherent ? "coherent " : "", is_restrict ? "restrict " : "", + is_writeonly ? "writeonly " : "", is_readonly ? "readonly " : "", ssbo ? "buffer " : "uniform ", + buffer_name); + + begin_scope(); + + type.member_name_cache.clear(); + + uint32_t i = 0; + for (auto &member : type.member_types) + { + add_member_name(type, i); + emit_struct_member(type, member, i); + i++; + } + + // Don't declare empty blocks in GLSL, this is not allowed. + if (type_is_empty(type) && !backend.supports_empty_struct) + statement("int empty_struct_member;"); + + // var.self can be used as a backup name for the block name, + // so we need to make sure we don't disturb the name here on a recompile. + // It will need to be reset if we have to recompile. + preserve_alias_on_reset(var.self); + add_resource_name(var.self); + end_scope_decl(to_name(var.self) + type_to_array_glsl(type, var.self)); + statement(""); +} + +void CompilerGLSL::emit_buffer_block_flattened(const SPIRVariable &var) +{ + auto &type = get(var.basetype); + + // Block names should never alias. + auto buffer_name = to_name(type.self, false); + size_t buffer_size = (get_declared_struct_size(type) + 15) / 16; + + SPIRType::BaseType basic_type; + if (get_common_basic_type(type, basic_type)) + { + SPIRType tmp { OpTypeVector }; + tmp.basetype = basic_type; + tmp.vecsize = 4; + if (basic_type != SPIRType::Float && basic_type != SPIRType::Int && basic_type != SPIRType::UInt) + SPIRV_CROSS_THROW("Basic types in a flattened UBO must be float, int or uint."); + + auto flags = ir.get_buffer_block_flags(var); + statement("uniform ", flags_to_qualifiers_glsl(tmp, 0, flags), type_to_glsl(tmp), " ", buffer_name, "[", + buffer_size, "];"); + } + else + SPIRV_CROSS_THROW("All basic types in a flattened block must be the same."); +} + +const char *CompilerGLSL::to_storage_qualifiers_glsl(const SPIRVariable &var) +{ + auto &execution = get_entry_point(); + + if (subpass_input_is_framebuffer_fetch(var.self)) + return ""; + + if (var.storage == StorageClassInput || var.storage == StorageClassOutput) + { + if (is_legacy() && execution.model == ExecutionModelVertex) + return var.storage == StorageClassInput ? "attribute " : "varying "; + else if (is_legacy() && execution.model == ExecutionModelFragment) + return "varying "; // Fragment outputs are renamed so they never hit this case. + else if (execution.model == ExecutionModelFragment && var.storage == StorageClassOutput) + { + uint32_t loc = get_decoration(var.self, DecorationLocation); + bool is_inout = location_is_framebuffer_fetch(loc); + if (is_inout) + return "inout "; + else + return "out "; + } + else + return var.storage == StorageClassInput ? "in " : "out "; + } + else if (var.storage == StorageClassUniformConstant || var.storage == StorageClassUniform || + var.storage == StorageClassPushConstant || var.storage == StorageClassAtomicCounter) + { + return "uniform "; + } + else if (var.storage == StorageClassRayPayloadKHR) + { + return ray_tracing_is_khr ? "rayPayloadEXT " : "rayPayloadNV "; + } + else if (var.storage == StorageClassIncomingRayPayloadKHR) + { + return ray_tracing_is_khr ? "rayPayloadInEXT " : "rayPayloadInNV "; + } + else if (var.storage == StorageClassHitAttributeKHR) + { + return ray_tracing_is_khr ? "hitAttributeEXT " : "hitAttributeNV "; + } + else if (var.storage == StorageClassCallableDataKHR) + { + return ray_tracing_is_khr ? "callableDataEXT " : "callableDataNV "; + } + else if (var.storage == StorageClassIncomingCallableDataKHR) + { + return ray_tracing_is_khr ? "callableDataInEXT " : "callableDataInNV "; + } + + return ""; +} + +void CompilerGLSL::emit_flattened_io_block_member(const std::string &basename, const SPIRType &type, const char *qual, + const SmallVector &indices) +{ + uint32_t member_type_id = type.self; + const SPIRType *member_type = &type; + const SPIRType *parent_type = nullptr; + auto flattened_name = basename; + for (auto &index : indices) + { + flattened_name += "_"; + flattened_name += to_member_name(*member_type, index); + parent_type = member_type; + member_type_id = member_type->member_types[index]; + member_type = &get(member_type_id); + } + + assert(member_type->basetype != SPIRType::Struct); + + // We're overriding struct member names, so ensure we do so on the primary type. + if (parent_type->type_alias) + parent_type = &get(parent_type->type_alias); + + // Sanitize underscores because joining the two identifiers might create more than 1 underscore in a row, + // which is not allowed. + ParsedIR::sanitize_underscores(flattened_name); + + uint32_t last_index = indices.back(); + + // Pass in the varying qualifier here so it will appear in the correct declaration order. + // Replace member name while emitting it so it encodes both struct name and member name. + auto backup_name = get_member_name(parent_type->self, last_index); + auto member_name = to_member_name(*parent_type, last_index); + set_member_name(parent_type->self, last_index, flattened_name); + emit_struct_member(*parent_type, member_type_id, last_index, qual); + // Restore member name. + set_member_name(parent_type->self, last_index, member_name); +} + +void CompilerGLSL::emit_flattened_io_block_struct(const std::string &basename, const SPIRType &type, const char *qual, + const SmallVector &indices) +{ + auto sub_indices = indices; + sub_indices.push_back(0); + + const SPIRType *member_type = &type; + for (auto &index : indices) + member_type = &get(member_type->member_types[index]); + + assert(member_type->basetype == SPIRType::Struct); + + if (!member_type->array.empty()) + SPIRV_CROSS_THROW("Cannot flatten array of structs in I/O blocks."); + + for (uint32_t i = 0; i < uint32_t(member_type->member_types.size()); i++) + { + sub_indices.back() = i; + if (get(member_type->member_types[i]).basetype == SPIRType::Struct) + emit_flattened_io_block_struct(basename, type, qual, sub_indices); + else + emit_flattened_io_block_member(basename, type, qual, sub_indices); + } +} + +void CompilerGLSL::emit_flattened_io_block(const SPIRVariable &var, const char *qual) +{ + auto &var_type = get(var.basetype); + if (!var_type.array.empty()) + SPIRV_CROSS_THROW("Array of varying structs cannot be flattened to legacy-compatible varyings."); + + // Emit flattened types based on the type alias. Normally, we are never supposed to emit + // struct declarations for aliased types. + auto &type = var_type.type_alias ? get(var_type.type_alias) : var_type; + + auto old_flags = ir.meta[type.self].decoration.decoration_flags; + // Emit the members as if they are part of a block to get all qualifiers. + ir.meta[type.self].decoration.decoration_flags.set(DecorationBlock); + + type.member_name_cache.clear(); + + SmallVector member_indices; + member_indices.push_back(0); + auto basename = to_name(var.self); + + uint32_t i = 0; + for (auto &member : type.member_types) + { + add_member_name(type, i); + auto &membertype = get(member); + + member_indices.back() = i; + if (membertype.basetype == SPIRType::Struct) + emit_flattened_io_block_struct(basename, type, qual, member_indices); + else + emit_flattened_io_block_member(basename, type, qual, member_indices); + i++; + } + + ir.meta[type.self].decoration.decoration_flags = old_flags; + + // Treat this variable as fully flattened from now on. + flattened_structs[var.self] = true; +} + +void CompilerGLSL::emit_interface_block(const SPIRVariable &var) +{ + auto &type = get(var.basetype); + + if (var.storage == StorageClassInput && type.basetype == SPIRType::Double && + !options.es && options.version < 410) + { + require_extension_internal("GL_ARB_vertex_attrib_64bit"); + } + + // Either make it plain in/out or in/out blocks depending on what shader is doing ... + bool block = ir.meta[type.self].decoration.decoration_flags.get(DecorationBlock); + const char *qual = to_storage_qualifiers_glsl(var); + + if (block) + { + // ESSL earlier than 310 and GLSL earlier than 150 did not support + // I/O variables which are struct types. + // To support this, flatten the struct into separate varyings instead. + if (options.force_flattened_io_blocks || (options.es && options.version < 310) || + (!options.es && options.version < 150)) + { + // I/O blocks on ES require version 310 with Android Extension Pack extensions, or core version 320. + // On desktop, I/O blocks were introduced with geometry shaders in GL 3.2 (GLSL 150). + emit_flattened_io_block(var, qual); + } + else + { + if (options.es && options.version < 320) + { + // Geometry and tessellation extensions imply this extension. + if (!has_extension("GL_EXT_geometry_shader") && !has_extension("GL_EXT_tessellation_shader")) + require_extension_internal("GL_EXT_shader_io_blocks"); + } + + // Workaround to make sure we can emit "patch in/out" correctly. + fixup_io_block_patch_primitive_qualifiers(var); + + // Block names should never alias. + auto block_name = to_name(type.self, false); + + // The namespace for I/O blocks is separate from other variables in GLSL. + auto &block_namespace = type.storage == StorageClassInput ? block_input_names : block_output_names; + + // Shaders never use the block by interface name, so we don't + // have to track this other than updating name caches. + if (block_name.empty() || block_namespace.find(block_name) != end(block_namespace)) + block_name = get_fallback_name(type.self); + else + block_namespace.insert(block_name); + + // If for some reason buffer_name is an illegal name, make a final fallback to a workaround name. + // This cannot conflict with anything else, so we're safe now. + if (block_name.empty()) + block_name = join("_", get(var.basetype).self, "_", var.self); + + // Instance names cannot alias block names. + resource_names.insert(block_name); + + const char *block_qualifier; + if (has_decoration(var.self, DecorationPatch)) + block_qualifier = "patch "; + else if (has_decoration(var.self, DecorationPerPrimitiveEXT)) + block_qualifier = "perprimitiveEXT "; + else if (has_decoration(var.self, DecorationPerVertexKHR)) + block_qualifier = "pervertexEXT "; + else + block_qualifier = ""; + + statement(layout_for_variable(var), block_qualifier, qual, block_name); + begin_scope(); + + type.member_name_cache.clear(); + + uint32_t i = 0; + for (auto &member : type.member_types) + { + add_member_name(type, i); + emit_struct_member(type, member, i); + i++; + } + + add_resource_name(var.self); + end_scope_decl(join(to_name(var.self), type_to_array_glsl(type, var.self))); + statement(""); + } + } + else + { + // ESSL earlier than 310 and GLSL earlier than 150 did not support + // I/O variables which are struct types. + // To support this, flatten the struct into separate varyings instead. + if (type.basetype == SPIRType::Struct && + (options.force_flattened_io_blocks || (options.es && options.version < 310) || + (!options.es && options.version < 150))) + { + emit_flattened_io_block(var, qual); + } + else + { + add_resource_name(var.self); + + // Legacy GLSL did not support int attributes, we automatically + // declare them as float and cast them on load/store + SPIRType newtype = type; + if (is_legacy() && var.storage == StorageClassInput && type.basetype == SPIRType::Int) + newtype.basetype = SPIRType::Float; + + // Tessellation control and evaluation shaders must have either + // gl_MaxPatchVertices or unsized arrays for input arrays. + // Opt for unsized as it's the more "correct" variant to use. + if (type.storage == StorageClassInput && !type.array.empty() && + !has_decoration(var.self, DecorationPatch) && + (get_entry_point().model == ExecutionModelTessellationControl || + get_entry_point().model == ExecutionModelTessellationEvaluation)) + { + newtype.array.back() = 0; + newtype.array_size_literal.back() = true; + } + + statement(layout_for_variable(var), to_qualifiers_glsl(var.self), + variable_decl(newtype, to_name(var.self), var.self), ";"); + } + } +} + +void CompilerGLSL::emit_uniform(const SPIRVariable &var) +{ + auto &type = get(var.basetype); + if (type.basetype == SPIRType::Image && type.image.sampled == 2 && type.image.dim != DimSubpassData) + { + if (!options.es && options.version < 420) + require_extension_internal("GL_ARB_shader_image_load_store"); + else if (options.es && options.version < 310) + SPIRV_CROSS_THROW("At least ESSL 3.10 required for shader image load store."); + } + + add_resource_name(var.self); + statement(layout_for_variable(var), variable_decl(var), ";"); +} + +string CompilerGLSL::constant_value_macro_name(uint32_t id) const +{ + return join("SPIRV_CROSS_CONSTANT_ID_", id); +} + +void CompilerGLSL::emit_specialization_constant_op(const SPIRConstantOp &constant) +{ + auto &type = get(constant.basetype); + // This will break. It is bogus and should not be legal. + if (type_is_top_level_block(type)) + return; + add_resource_name(constant.self); + auto name = to_name(constant.self); + statement("const ", variable_decl(type, name), " = ", constant_op_expression(constant), ";"); +} + +int CompilerGLSL::get_constant_mapping_to_workgroup_component(const SPIRConstant &c) const +{ + auto &entry_point = get_entry_point(); + int index = -1; + + // Need to redirect specialization constants which are used as WorkGroupSize to the builtin, + // since the spec constant declarations are never explicitly declared. + if (entry_point.workgroup_size.constant == 0 && entry_point.flags.get(ExecutionModeLocalSizeId)) + { + if (c.self == entry_point.workgroup_size.id_x) + index = 0; + else if (c.self == entry_point.workgroup_size.id_y) + index = 1; + else if (c.self == entry_point.workgroup_size.id_z) + index = 2; + } + + return index; +} + +void CompilerGLSL::emit_constant(const SPIRConstant &constant) +{ + auto &type = get(constant.constant_type); + + // This will break. It is bogus and should not be legal. + if (type_is_top_level_block(type)) + return; + + SpecializationConstant wg_x, wg_y, wg_z; + ID workgroup_size_id = get_work_group_size_specialization_constants(wg_x, wg_y, wg_z); + + // This specialization constant is implicitly declared by emitting layout() in; + if (constant.self == workgroup_size_id) + return; + + // These specialization constants are implicitly declared by emitting layout() in; + // In legacy GLSL, we will still need to emit macros for these, so a layout() in; declaration + // later can use macro overrides for work group size. + bool is_workgroup_size_constant = ConstantID(constant.self) == wg_x.id || ConstantID(constant.self) == wg_y.id || + ConstantID(constant.self) == wg_z.id; + + if (options.vulkan_semantics && is_workgroup_size_constant) + { + // Vulkan GLSL does not need to declare workgroup spec constants explicitly, it is handled in layout(). + return; + } + else if (!options.vulkan_semantics && is_workgroup_size_constant && + !has_decoration(constant.self, DecorationSpecId)) + { + // Only bother declaring a workgroup size if it is actually a specialization constant, because we need macros. + return; + } + + add_resource_name(constant.self); + auto name = to_name(constant.self); + + // Only scalars have constant IDs. + if (has_decoration(constant.self, DecorationSpecId)) + { + if (options.vulkan_semantics) + { + statement("layout(constant_id = ", get_decoration(constant.self, DecorationSpecId), ") const ", + variable_decl(type, name), " = ", constant_expression(constant), ";"); + } + else + { + const string ¯o_name = constant.specialization_constant_macro_name; + statement("#ifndef ", macro_name); + statement("#define ", macro_name, " ", constant_expression(constant)); + statement("#endif"); + + // For workgroup size constants, only emit the macros. + if (!is_workgroup_size_constant) + statement("const ", variable_decl(type, name), " = ", macro_name, ";"); + } + } + else + { + statement("const ", variable_decl(type, name), " = ", constant_expression(constant), ";"); + } +} + +void CompilerGLSL::emit_entry_point_declarations() +{ +} + +void CompilerGLSL::replace_illegal_names(const unordered_set &keywords) +{ + ir.for_each_typed_id([&](uint32_t, const SPIRVariable &var) { + if (is_hidden_variable(var)) + return; + + auto *meta = ir.find_meta(var.self); + if (!meta) + return; + + auto &m = meta->decoration; + if (keywords.find(m.alias) != end(keywords)) + m.alias = join("_", m.alias); + }); + + ir.for_each_typed_id([&](uint32_t, const SPIRFunction &func) { + auto *meta = ir.find_meta(func.self); + if (!meta) + return; + + auto &m = meta->decoration; + if (keywords.find(m.alias) != end(keywords)) + m.alias = join("_", m.alias); + }); + + ir.for_each_typed_id([&](uint32_t, const SPIRType &type) { + auto *meta = ir.find_meta(type.self); + if (!meta) + return; + + auto &m = meta->decoration; + if (keywords.find(m.alias) != end(keywords)) + m.alias = join("_", m.alias); + + for (auto &memb : meta->members) + if (keywords.find(memb.alias) != end(keywords)) + memb.alias = join("_", memb.alias); + }); +} + +void CompilerGLSL::replace_illegal_names() +{ + // clang-format off + static const unordered_set keywords = { + "abs", "acos", "acosh", "all", "any", "asin", "asinh", "atan", "atanh", + "atomicAdd", "atomicCompSwap", "atomicCounter", "atomicCounterDecrement", "atomicCounterIncrement", + "atomicExchange", "atomicMax", "atomicMin", "atomicOr", "atomicXor", + "bitCount", "bitfieldExtract", "bitfieldInsert", "bitfieldReverse", + "ceil", "cos", "cosh", "cross", "degrees", + "dFdx", "dFdxCoarse", "dFdxFine", + "dFdy", "dFdyCoarse", "dFdyFine", + "distance", "dot", "EmitStreamVertex", "EmitVertex", "EndPrimitive", "EndStreamPrimitive", "equal", "exp", "exp2", + "faceforward", "findLSB", "findMSB", "float16BitsToInt16", "float16BitsToUint16", "floatBitsToInt", "floatBitsToUint", "floor", "fma", "fract", + "frexp", "fwidth", "fwidthCoarse", "fwidthFine", + "greaterThan", "greaterThanEqual", "groupMemoryBarrier", + "imageAtomicAdd", "imageAtomicAnd", "imageAtomicCompSwap", "imageAtomicExchange", "imageAtomicMax", "imageAtomicMin", "imageAtomicOr", "imageAtomicXor", + "imageLoad", "imageSamples", "imageSize", "imageStore", "imulExtended", "int16BitsToFloat16", "intBitsToFloat", "interpolateAtOffset", "interpolateAtCentroid", "interpolateAtSample", + "inverse", "inversesqrt", "isinf", "isnan", "ldexp", "length", "lessThan", "lessThanEqual", "log", "log2", + "matrixCompMult", "max", "memoryBarrier", "memoryBarrierAtomicCounter", "memoryBarrierBuffer", "memoryBarrierImage", "memoryBarrierShared", + "min", "mix", "mod", "modf", "noise", "noise1", "noise2", "noise3", "noise4", "normalize", "not", "notEqual", + "outerProduct", "packDouble2x32", "packHalf2x16", "packInt2x16", "packInt4x16", "packSnorm2x16", "packSnorm4x8", + "packUint2x16", "packUint4x16", "packUnorm2x16", "packUnorm4x8", "pow", + "radians", "reflect", "refract", "round", "roundEven", "sign", "sin", "sinh", "smoothstep", "sqrt", "step", + "tan", "tanh", "texelFetch", "texelFetchOffset", "texture", "textureGather", "textureGatherOffset", "textureGatherOffsets", + "textureGrad", "textureGradOffset", "textureLod", "textureLodOffset", "textureOffset", "textureProj", "textureProjGrad", + "textureProjGradOffset", "textureProjLod", "textureProjLodOffset", "textureProjOffset", "textureQueryLevels", "textureQueryLod", "textureSamples", "textureSize", + "transpose", "trunc", "uaddCarry", "uint16BitsToFloat16", "uintBitsToFloat", "umulExtended", "unpackDouble2x32", "unpackHalf2x16", "unpackInt2x16", "unpackInt4x16", + "unpackSnorm2x16", "unpackSnorm4x8", "unpackUint2x16", "unpackUint4x16", "unpackUnorm2x16", "unpackUnorm4x8", "usubBorrow", + + "active", "asm", "atomic_uint", "attribute", "bool", "break", "buffer", + "bvec2", "bvec3", "bvec4", "case", "cast", "centroid", "class", "coherent", "common", "const", "continue", "default", "discard", + "dmat2", "dmat2x2", "dmat2x3", "dmat2x4", "dmat3", "dmat3x2", "dmat3x3", "dmat3x4", "dmat4", "dmat4x2", "dmat4x3", "dmat4x4", + "do", "double", "dvec2", "dvec3", "dvec4", "else", "enum", "extern", "external", "false", "filter", "fixed", "flat", "float", + "for", "fvec2", "fvec3", "fvec4", "goto", "half", "highp", "hvec2", "hvec3", "hvec4", "if", "iimage1D", "iimage1DArray", + "iimage2D", "iimage2DArray", "iimage2DMS", "iimage2DMSArray", "iimage2DRect", "iimage3D", "iimageBuffer", "iimageCube", + "iimageCubeArray", "image1D", "image1DArray", "image2D", "image2DArray", "image2DMS", "image2DMSArray", "image2DRect", + "image3D", "imageBuffer", "imageCube", "imageCubeArray", "in", "inline", "inout", "input", "int", "interface", "invariant", + "isampler1D", "isampler1DArray", "isampler2D", "isampler2DArray", "isampler2DMS", "isampler2DMSArray", "isampler2DRect", + "isampler3D", "isamplerBuffer", "isamplerCube", "isamplerCubeArray", "ivec2", "ivec3", "ivec4", "layout", "long", "lowp", + "mat2", "mat2x2", "mat2x3", "mat2x4", "mat3", "mat3x2", "mat3x3", "mat3x4", "mat4", "mat4x2", "mat4x3", "mat4x4", "mediump", + "namespace", "noinline", "noperspective", "out", "output", "packed", "partition", "patch", "precise", "precision", "public", "readonly", + "resource", "restrict", "return", "sample", "sampler1D", "sampler1DArray", "sampler1DArrayShadow", + "sampler1DShadow", "sampler2D", "sampler2DArray", "sampler2DArrayShadow", "sampler2DMS", "sampler2DMSArray", + "sampler2DRect", "sampler2DRectShadow", "sampler2DShadow", "sampler3D", "sampler3DRect", "samplerBuffer", + "samplerCube", "samplerCubeArray", "samplerCubeArrayShadow", "samplerCubeShadow", "shared", "short", "sizeof", "smooth", "static", + "struct", "subroutine", "superp", "switch", "template", "this", "true", "typedef", "uimage1D", "uimage1DArray", "uimage2D", + "uimage2DArray", "uimage2DMS", "uimage2DMSArray", "uimage2DRect", "uimage3D", "uimageBuffer", "uimageCube", + "uimageCubeArray", "uint", "uniform", "union", "unsigned", "usampler1D", "usampler1DArray", "usampler2D", "usampler2DArray", + "usampler2DMS", "usampler2DMSArray", "usampler2DRect", "usampler3D", "usamplerBuffer", "usamplerCube", + "usamplerCubeArray", "using", "uvec2", "uvec3", "uvec4", "varying", "vec2", "vec3", "vec4", "void", "volatile", + "while", "writeonly", + }; + // clang-format on + + replace_illegal_names(keywords); +} + +void CompilerGLSL::replace_fragment_output(SPIRVariable &var) +{ + auto &m = ir.meta[var.self].decoration; + uint32_t location = 0; + if (m.decoration_flags.get(DecorationLocation)) + location = m.location; + + // If our variable is arrayed, we must not emit the array part of this as the SPIR-V will + // do the access chain part of this for us. + auto &type = get(var.basetype); + + if (type.array.empty()) + { + // Redirect the write to a specific render target in legacy GLSL. + m.alias = join("gl_FragData[", location, "]"); + + if (is_legacy_es() && location != 0) + require_extension_internal("GL_EXT_draw_buffers"); + } + else if (type.array.size() == 1) + { + // If location is non-zero, we probably have to add an offset. + // This gets really tricky since we'd have to inject an offset in the access chain. + // FIXME: This seems like an extremely odd-ball case, so it's probably fine to leave it like this for now. + m.alias = "gl_FragData"; + if (location != 0) + SPIRV_CROSS_THROW("Arrayed output variable used, but location is not 0. " + "This is unimplemented in SPIRV-Cross."); + + if (is_legacy_es()) + require_extension_internal("GL_EXT_draw_buffers"); + } + else + SPIRV_CROSS_THROW("Array-of-array output variable used. This cannot be implemented in legacy GLSL."); + + var.compat_builtin = true; // We don't want to declare this variable, but use the name as-is. +} + +void CompilerGLSL::replace_fragment_outputs() +{ + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + auto &type = this->get(var.basetype); + + if (!is_builtin_variable(var) && !var.remapped_variable && type.pointer && var.storage == StorageClassOutput) + replace_fragment_output(var); + }); +} + +string CompilerGLSL::remap_swizzle(const SPIRType &out_type, uint32_t input_components, const string &expr) +{ + if (out_type.vecsize == input_components) + return expr; + else if (input_components == 1 && !backend.can_swizzle_scalar) + return join(type_to_glsl(out_type), "(", expr, ")"); + else + { + // FIXME: This will not work with packed expressions. + auto e = enclose_expression(expr) + "."; + // Just clamp the swizzle index if we have more outputs than inputs. + for (uint32_t c = 0; c < out_type.vecsize; c++) + e += index_to_swizzle(min(c, input_components - 1)); + if (backend.swizzle_is_function && out_type.vecsize > 1) + e += "()"; + + remove_duplicate_swizzle(e); + return e; + } +} + +void CompilerGLSL::emit_pls() +{ + auto &execution = get_entry_point(); + if (execution.model != ExecutionModelFragment) + SPIRV_CROSS_THROW("Pixel local storage only supported in fragment shaders."); + + if (!options.es) + SPIRV_CROSS_THROW("Pixel local storage only supported in OpenGL ES."); + + if (options.version < 300) + SPIRV_CROSS_THROW("Pixel local storage only supported in ESSL 3.0 and above."); + + if (!pls_inputs.empty()) + { + statement("__pixel_local_inEXT _PLSIn"); + begin_scope(); + for (auto &input : pls_inputs) + statement(pls_decl(input), ";"); + end_scope_decl(); + statement(""); + } + + if (!pls_outputs.empty()) + { + statement("__pixel_local_outEXT _PLSOut"); + begin_scope(); + for (auto &output : pls_outputs) + statement(pls_decl(output), ";"); + end_scope_decl(); + statement(""); + } +} + +void CompilerGLSL::fixup_image_load_store_access() +{ + if (!options.enable_storage_image_qualifier_deduction) + return; + + ir.for_each_typed_id([&](uint32_t var, const SPIRVariable &) { + auto &vartype = expression_type(var); + if (vartype.basetype == SPIRType::Image && vartype.image.sampled == 2) + { + // Very old glslangValidator and HLSL compilers do not emit required qualifiers here. + // Solve this by making the image access as restricted as possible and loosen up if we need to. + // If any no-read/no-write flags are actually set, assume that the compiler knows what it's doing. + + if (!has_decoration(var, DecorationNonWritable) && !has_decoration(var, DecorationNonReadable)) + { + set_decoration(var, DecorationNonWritable); + set_decoration(var, DecorationNonReadable); + } + } + }); +} + +static bool is_block_builtin(BuiltIn builtin) +{ + return builtin == BuiltInPosition || builtin == BuiltInPointSize || builtin == BuiltInClipDistance || + builtin == BuiltInCullDistance; +} + +bool CompilerGLSL::should_force_emit_builtin_block(StorageClass storage) +{ + // If the builtin block uses XFB, we need to force explicit redeclaration of the builtin block. + + if (storage != StorageClassOutput) + return false; + bool should_force = false; + + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + if (should_force) + return; + + auto &type = this->get(var.basetype); + bool block = has_decoration(type.self, DecorationBlock); + if (var.storage == storage && block && is_builtin_variable(var)) + { + uint32_t member_count = uint32_t(type.member_types.size()); + for (uint32_t i = 0; i < member_count; i++) + { + if (has_member_decoration(type.self, i, DecorationBuiltIn) && + is_block_builtin(BuiltIn(get_member_decoration(type.self, i, DecorationBuiltIn))) && + has_member_decoration(type.self, i, DecorationOffset)) + { + should_force = true; + } + } + } + else if (var.storage == storage && !block && is_builtin_variable(var)) + { + if (is_block_builtin(BuiltIn(get_decoration(type.self, DecorationBuiltIn))) && + has_decoration(var.self, DecorationOffset)) + { + should_force = true; + } + } + }); + + // If we're declaring clip/cull planes with control points we need to force block declaration. + if ((get_execution_model() == ExecutionModelTessellationControl || + get_execution_model() == ExecutionModelMeshEXT) && + (clip_distance_count || cull_distance_count)) + { + should_force = true; + } + + // Either glslang bug or oversight, but global invariant position does not work in mesh shaders. + if (get_execution_model() == ExecutionModelMeshEXT && position_invariant) + should_force = true; + + return should_force; +} + +void CompilerGLSL::fixup_implicit_builtin_block_names(ExecutionModel model) +{ + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + auto &type = this->get(var.basetype); + bool block = has_decoration(type.self, DecorationBlock); + if ((var.storage == StorageClassOutput || var.storage == StorageClassInput) && block && + is_builtin_variable(var)) + { + if (model != ExecutionModelMeshEXT) + { + // Make sure the array has a supported name in the code. + if (var.storage == StorageClassOutput) + set_name(var.self, "gl_out"); + else if (var.storage == StorageClassInput) + set_name(var.self, "gl_in"); + } + else + { + auto flags = get_buffer_block_flags(var.self); + if (flags.get(DecorationPerPrimitiveEXT)) + { + set_name(var.self, "gl_MeshPrimitivesEXT"); + set_name(type.self, "gl_MeshPerPrimitiveEXT"); + } + else + { + set_name(var.self, "gl_MeshVerticesEXT"); + set_name(type.self, "gl_MeshPerVertexEXT"); + } + } + } + + if (model == ExecutionModelMeshEXT && var.storage == StorageClassOutput && !block) + { + auto *m = ir.find_meta(var.self); + if (m && m->decoration.builtin) + { + auto builtin_type = m->decoration.builtin_type; + if (builtin_type == BuiltInPrimitivePointIndicesEXT) + set_name(var.self, "gl_PrimitivePointIndicesEXT"); + else if (builtin_type == BuiltInPrimitiveLineIndicesEXT) + set_name(var.self, "gl_PrimitiveLineIndicesEXT"); + else if (builtin_type == BuiltInPrimitiveTriangleIndicesEXT) + set_name(var.self, "gl_PrimitiveTriangleIndicesEXT"); + } + } + }); +} + +void CompilerGLSL::emit_declared_builtin_block(StorageClass storage, ExecutionModel model) +{ + Bitset emitted_builtins; + Bitset global_builtins; + const SPIRVariable *block_var = nullptr; + bool emitted_block = false; + + // Need to use declared size in the type. + // These variables might have been declared, but not statically used, so we haven't deduced their size yet. + uint32_t cull_distance_size = 0; + uint32_t clip_distance_size = 0; + + bool have_xfb_buffer_stride = false; + bool have_geom_stream = false; + bool have_any_xfb_offset = false; + uint32_t xfb_stride = 0, xfb_buffer = 0, geom_stream = 0; + std::unordered_map builtin_xfb_offsets; + + const auto builtin_is_per_vertex_set = [](BuiltIn builtin) -> bool { + return builtin == BuiltInPosition || builtin == BuiltInPointSize || + builtin == BuiltInClipDistance || builtin == BuiltInCullDistance; + }; + + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + auto &type = this->get(var.basetype); + bool block = has_decoration(type.self, DecorationBlock); + Bitset builtins; + + if (var.storage == storage && block && is_builtin_variable(var)) + { + uint32_t index = 0; + for (auto &m : ir.meta[type.self].members) + { + if (m.builtin && builtin_is_per_vertex_set(m.builtin_type)) + { + builtins.set(m.builtin_type); + if (m.builtin_type == BuiltInCullDistance) + cull_distance_size = to_array_size_literal(this->get(type.member_types[index])); + else if (m.builtin_type == BuiltInClipDistance) + clip_distance_size = to_array_size_literal(this->get(type.member_types[index])); + + if (is_block_builtin(m.builtin_type) && m.decoration_flags.get(DecorationOffset)) + { + have_any_xfb_offset = true; + builtin_xfb_offsets[m.builtin_type] = m.offset; + } + + if (is_block_builtin(m.builtin_type) && m.decoration_flags.get(DecorationStream)) + { + uint32_t stream = m.stream; + if (have_geom_stream && geom_stream != stream) + SPIRV_CROSS_THROW("IO block member Stream mismatch."); + have_geom_stream = true; + geom_stream = stream; + } + } + index++; + } + + if (storage == StorageClassOutput && has_decoration(var.self, DecorationXfbBuffer) && + has_decoration(var.self, DecorationXfbStride)) + { + uint32_t buffer_index = get_decoration(var.self, DecorationXfbBuffer); + uint32_t stride = get_decoration(var.self, DecorationXfbStride); + if (have_xfb_buffer_stride && buffer_index != xfb_buffer) + SPIRV_CROSS_THROW("IO block member XfbBuffer mismatch."); + if (have_xfb_buffer_stride && stride != xfb_stride) + SPIRV_CROSS_THROW("IO block member XfbBuffer mismatch."); + have_xfb_buffer_stride = true; + xfb_buffer = buffer_index; + xfb_stride = stride; + } + + if (storage == StorageClassOutput && has_decoration(var.self, DecorationStream)) + { + uint32_t stream = get_decoration(var.self, DecorationStream); + if (have_geom_stream && geom_stream != stream) + SPIRV_CROSS_THROW("IO block member Stream mismatch."); + have_geom_stream = true; + geom_stream = stream; + } + } + else if (var.storage == storage && !block && is_builtin_variable(var)) + { + // While we're at it, collect all declared global builtins (HLSL mostly ...). + auto &m = ir.meta[var.self].decoration; + if (m.builtin && builtin_is_per_vertex_set(m.builtin_type)) + { + // For mesh/tesc output, Clip/Cull is an array-of-array. Look at innermost array type + // for correct result. + global_builtins.set(m.builtin_type); + if (m.builtin_type == BuiltInCullDistance) + cull_distance_size = to_array_size_literal(type, 0); + else if (m.builtin_type == BuiltInClipDistance) + clip_distance_size = to_array_size_literal(type, 0); + + if (is_block_builtin(m.builtin_type) && m.decoration_flags.get(DecorationXfbStride) && + m.decoration_flags.get(DecorationXfbBuffer) && m.decoration_flags.get(DecorationOffset)) + { + have_any_xfb_offset = true; + builtin_xfb_offsets[m.builtin_type] = m.offset; + uint32_t buffer_index = m.xfb_buffer; + uint32_t stride = m.xfb_stride; + if (have_xfb_buffer_stride && buffer_index != xfb_buffer) + SPIRV_CROSS_THROW("IO block member XfbBuffer mismatch."); + if (have_xfb_buffer_stride && stride != xfb_stride) + SPIRV_CROSS_THROW("IO block member XfbBuffer mismatch."); + have_xfb_buffer_stride = true; + xfb_buffer = buffer_index; + xfb_stride = stride; + } + + if (is_block_builtin(m.builtin_type) && m.decoration_flags.get(DecorationStream)) + { + uint32_t stream = get_decoration(var.self, DecorationStream); + if (have_geom_stream && geom_stream != stream) + SPIRV_CROSS_THROW("IO block member Stream mismatch."); + have_geom_stream = true; + geom_stream = stream; + } + } + } + + if (builtins.empty()) + return; + + if (emitted_block) + SPIRV_CROSS_THROW("Cannot use more than one builtin I/O block."); + + emitted_builtins = builtins; + emitted_block = true; + block_var = &var; + }); + + global_builtins = + Bitset(global_builtins.get_lower() & ((1ull << BuiltInPosition) | (1ull << BuiltInPointSize) | + (1ull << BuiltInClipDistance) | (1ull << BuiltInCullDistance))); + + // Try to collect all other declared builtins. + if (!emitted_block) + emitted_builtins = global_builtins; + + // Can't declare an empty interface block. + if (emitted_builtins.empty()) + return; + + if (storage == StorageClassOutput) + { + SmallVector attr; + if (have_xfb_buffer_stride && have_any_xfb_offset) + { + if (!options.es) + { + if (options.version < 440 && options.version >= 140) + require_extension_internal("GL_ARB_enhanced_layouts"); + else if (options.version < 140) + SPIRV_CROSS_THROW("Component decoration is not supported in targets below GLSL 1.40."); + if (!options.es && options.version < 440) + require_extension_internal("GL_ARB_enhanced_layouts"); + } + else if (options.es) + SPIRV_CROSS_THROW("Need GL_ARB_enhanced_layouts for xfb_stride or xfb_buffer."); + attr.push_back(join("xfb_buffer = ", xfb_buffer, ", xfb_stride = ", xfb_stride)); + } + + if (have_geom_stream) + { + if (get_execution_model() != ExecutionModelGeometry) + SPIRV_CROSS_THROW("Geometry streams can only be used in geometry shaders."); + if (options.es) + SPIRV_CROSS_THROW("Multiple geometry streams not supported in ESSL."); + if (options.version < 400) + require_extension_internal("GL_ARB_transform_feedback3"); + attr.push_back(join("stream = ", geom_stream)); + } + + if (model == ExecutionModelMeshEXT) + statement("out gl_MeshPerVertexEXT"); + else if (!attr.empty()) + statement("layout(", merge(attr), ") out gl_PerVertex"); + else + statement("out gl_PerVertex"); + } + else + { + // If we have passthrough, there is no way PerVertex cannot be passthrough. + if (get_entry_point().geometry_passthrough) + statement("layout(passthrough) in gl_PerVertex"); + else + statement("in gl_PerVertex"); + } + + begin_scope(); + if (emitted_builtins.get(BuiltInPosition)) + { + auto itr = builtin_xfb_offsets.find(BuiltInPosition); + if (itr != end(builtin_xfb_offsets)) + statement("layout(xfb_offset = ", itr->second, ") vec4 gl_Position;"); + else if (position_invariant) + statement("invariant vec4 gl_Position;"); + else + statement("vec4 gl_Position;"); + } + + if (emitted_builtins.get(BuiltInPointSize)) + { + auto itr = builtin_xfb_offsets.find(BuiltInPointSize); + if (itr != end(builtin_xfb_offsets)) + statement("layout(xfb_offset = ", itr->second, ") float gl_PointSize;"); + else + statement("float gl_PointSize;"); + } + + if (emitted_builtins.get(BuiltInClipDistance)) + { + auto itr = builtin_xfb_offsets.find(BuiltInClipDistance); + if (itr != end(builtin_xfb_offsets)) + statement("layout(xfb_offset = ", itr->second, ") float gl_ClipDistance[", clip_distance_size, "];"); + else + statement("float gl_ClipDistance[", clip_distance_size, "];"); + } + + if (emitted_builtins.get(BuiltInCullDistance)) + { + auto itr = builtin_xfb_offsets.find(BuiltInCullDistance); + if (itr != end(builtin_xfb_offsets)) + statement("layout(xfb_offset = ", itr->second, ") float gl_CullDistance[", cull_distance_size, "];"); + else + statement("float gl_CullDistance[", cull_distance_size, "];"); + } + + bool builtin_array = model == ExecutionModelTessellationControl || + (model == ExecutionModelMeshEXT && storage == StorageClassOutput) || + (model == ExecutionModelGeometry && storage == StorageClassInput) || + (model == ExecutionModelTessellationEvaluation && storage == StorageClassInput); + + if (builtin_array) + { + const char *instance_name; + if (model == ExecutionModelMeshEXT) + instance_name = "gl_MeshVerticesEXT"; // Per primitive is never synthesized. + else + instance_name = storage == StorageClassInput ? "gl_in" : "gl_out"; + + if (model == ExecutionModelTessellationControl && storage == StorageClassOutput) + end_scope_decl(join(instance_name, "[", get_entry_point().output_vertices, "]")); + else + end_scope_decl(join(instance_name, "[]")); + } + else + end_scope_decl(); + statement(""); +} + +bool CompilerGLSL::variable_is_lut(const SPIRVariable &var) const +{ + bool statically_assigned = var.statically_assigned && var.static_expression != ID(0) && var.remapped_variable; + + if (statically_assigned) + { + auto *constant = maybe_get(var.static_expression); + if (constant && constant->is_used_as_lut) + return true; + } + + return false; +} + +void CompilerGLSL::emit_resources() +{ + auto &execution = get_entry_point(); + + replace_illegal_names(); + + // Legacy GL uses gl_FragData[], redeclare all fragment outputs + // with builtins. + if (execution.model == ExecutionModelFragment && is_legacy()) + replace_fragment_outputs(); + + // Emit PLS blocks if we have such variables. + if (!pls_inputs.empty() || !pls_outputs.empty()) + emit_pls(); + + switch (execution.model) + { + case ExecutionModelGeometry: + case ExecutionModelTessellationControl: + case ExecutionModelTessellationEvaluation: + case ExecutionModelMeshEXT: + fixup_implicit_builtin_block_names(execution.model); + break; + + default: + break; + } + + bool global_invariant_position = position_invariant && (options.es || options.version >= 120); + + // Emit custom gl_PerVertex for SSO compatibility. + if (options.separate_shader_objects && !options.es && execution.model != ExecutionModelFragment) + { + switch (execution.model) + { + case ExecutionModelGeometry: + case ExecutionModelTessellationControl: + case ExecutionModelTessellationEvaluation: + emit_declared_builtin_block(StorageClassInput, execution.model); + emit_declared_builtin_block(StorageClassOutput, execution.model); + global_invariant_position = false; + break; + + case ExecutionModelVertex: + case ExecutionModelMeshEXT: + emit_declared_builtin_block(StorageClassOutput, execution.model); + global_invariant_position = false; + break; + + default: + break; + } + } + else if (should_force_emit_builtin_block(StorageClassOutput)) + { + emit_declared_builtin_block(StorageClassOutput, execution.model); + global_invariant_position = false; + } + else if (execution.geometry_passthrough) + { + // Need to declare gl_in with Passthrough. + // If we're doing passthrough, we cannot emit an output block, so the output block test above will never pass. + emit_declared_builtin_block(StorageClassInput, execution.model); + } + else + { + // Need to redeclare clip/cull distance with explicit size to use them. + // SPIR-V mandates these builtins have a size declared. + const char *storage = execution.model == ExecutionModelFragment ? "in" : "out"; + if (clip_distance_count != 0) + statement(storage, " float gl_ClipDistance[", clip_distance_count, "];"); + if (cull_distance_count != 0) + statement(storage, " float gl_CullDistance[", cull_distance_count, "];"); + if (clip_distance_count != 0 || cull_distance_count != 0) + statement(""); + } + + if (global_invariant_position) + { + statement("invariant gl_Position;"); + statement(""); + } + + bool emitted = false; + + if (ir.addressing_model == AddressingModelPhysicalStorageBuffer64) + { + // Output buffer reference block forward declarations. + ir.for_each_typed_id([&](uint32_t id, SPIRType &type) + { + if (is_physical_pointer(type)) + { + bool emit_type = true; + if (!is_physical_pointer_to_buffer_block(type)) + { + // Only forward-declare if we intend to emit it in the non_block_pointer types. + // Otherwise, these are just "benign" pointer types that exist as a result of access chains. + emit_type = std::find(physical_storage_non_block_pointer_types.begin(), + physical_storage_non_block_pointer_types.end(), + id) != physical_storage_non_block_pointer_types.end(); + } + + if (emit_type) + { + emit_buffer_reference_block(id, true); + emitted = true; + } + } + }); + } + + if (emitted) + statement(""); + emitted = false; + + // If emitted Vulkan GLSL, + // emit specialization constants as actual floats, + // spec op expressions will redirect to the constant name. + // + { + auto loop_lock = ir.create_loop_hard_lock(); + for (auto &id_ : ir.ids_for_constant_undef_or_type) + { + auto &id = ir.ids[id_]; + + // Skip declaring any bogus constants or undefs which use block types. + // We don't declare block types directly, so this will never work. + // Should not be legal SPIR-V, so this is considered a workaround. + + if (id.get_type() == TypeConstant) + { + auto &c = id.get(); + + bool needs_declaration = c.specialization || c.is_used_as_lut; + + if (needs_declaration) + { + if (!options.vulkan_semantics && c.specialization) + { + c.specialization_constant_macro_name = + constant_value_macro_name(get_decoration(c.self, DecorationSpecId)); + } + emit_constant(c); + emitted = true; + } + } + else if (id.get_type() == TypeConstantOp) + { + emit_specialization_constant_op(id.get()); + emitted = true; + } + else if (id.get_type() == TypeType) + { + auto *type = &id.get(); + + bool is_natural_struct = type->basetype == SPIRType::Struct && type->array.empty() && !type->pointer && + (!has_decoration(type->self, DecorationBlock) && + !has_decoration(type->self, DecorationBufferBlock)); + + // Special case, ray payload and hit attribute blocks are not really blocks, just regular structs. + if (type->basetype == SPIRType::Struct && type->pointer && + has_decoration(type->self, DecorationBlock) && + (type->storage == StorageClassRayPayloadKHR || type->storage == StorageClassIncomingRayPayloadKHR || + type->storage == StorageClassHitAttributeKHR)) + { + type = &get(type->parent_type); + is_natural_struct = true; + } + + if (is_natural_struct) + { + if (emitted) + statement(""); + emitted = false; + + emit_struct(*type); + } + } + else if (id.get_type() == TypeUndef) + { + auto &undef = id.get(); + auto &type = this->get(undef.basetype); + // OpUndef can be void for some reason ... + if (type.basetype == SPIRType::Void) + continue; + + // This will break. It is bogus and should not be legal. + if (type_is_top_level_block(type)) + continue; + + string initializer; + if (options.force_zero_initialized_variables && type_can_zero_initialize(type)) + initializer = join(" = ", to_zero_initialized_expression(undef.basetype)); + + // FIXME: If used in a constant, we must declare it as one. + statement(variable_decl(type, to_name(undef.self), undef.self), initializer, ";"); + emitted = true; + } + } + } + + if (emitted) + statement(""); + + // If we needed to declare work group size late, check here. + // If the work group size depends on a specialization constant, we need to declare the layout() block + // after constants (and their macros) have been declared. + if (execution.model == ExecutionModelGLCompute && !options.vulkan_semantics && + (execution.workgroup_size.constant != 0 || execution.flags.get(ExecutionModeLocalSizeId))) + { + SpecializationConstant wg_x, wg_y, wg_z; + get_work_group_size_specialization_constants(wg_x, wg_y, wg_z); + + if ((wg_x.id != ConstantID(0)) || (wg_y.id != ConstantID(0)) || (wg_z.id != ConstantID(0))) + { + SmallVector inputs; + build_workgroup_size(inputs, wg_x, wg_y, wg_z); + statement("layout(", merge(inputs), ") in;"); + statement(""); + } + } + + emitted = false; + + if (ir.addressing_model == AddressingModelPhysicalStorageBuffer64) + { + // Output buffer reference blocks. + // Buffer reference blocks can reference themselves to support things like linked lists. + for (auto type : physical_storage_non_block_pointer_types) + emit_buffer_reference_block(type, false); + + ir.for_each_typed_id([&](uint32_t id, SPIRType &type) { + if (is_physical_pointer_to_buffer_block(type)) + emit_buffer_reference_block(id, false); + }); + } + + // Output UBOs and SSBOs + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + auto &type = this->get(var.basetype); + + bool is_block_storage = type.storage == StorageClassStorageBuffer || type.storage == StorageClassUniform || + type.storage == StorageClassShaderRecordBufferKHR; + bool has_block_flags = ir.meta[type.self].decoration.decoration_flags.get(DecorationBlock) || + ir.meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock); + + if (var.storage != StorageClassFunction && type.pointer && is_block_storage && !is_hidden_variable(var) && + has_block_flags) + { + emit_buffer_block(var); + } + }); + + // Output push constant blocks + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + auto &type = this->get(var.basetype); + if (var.storage != StorageClassFunction && type.pointer && type.storage == StorageClassPushConstant && + !is_hidden_variable(var)) + { + emit_push_constant_block(var); + } + }); + + bool skip_separate_image_sampler = !combined_image_samplers.empty() || !options.vulkan_semantics; + + // Output Uniform Constants (values, samplers, images, etc). + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + auto &type = this->get(var.basetype); + + // If we're remapping separate samplers and images, only emit the combined samplers. + if (skip_separate_image_sampler) + { + // Sampler buffers are always used without a sampler, and they will also work in regular GL. + bool sampler_buffer = type.basetype == SPIRType::Image && type.image.dim == DimBuffer; + bool separate_image = type.basetype == SPIRType::Image && type.image.sampled == 1; + bool separate_sampler = type.basetype == SPIRType::Sampler; + if (!sampler_buffer && (separate_image || separate_sampler)) + return; + } + + if (var.storage != StorageClassFunction && type.pointer && + (type.storage == StorageClassUniformConstant || type.storage == StorageClassAtomicCounter || + type.storage == StorageClassRayPayloadKHR || type.storage == StorageClassIncomingRayPayloadKHR || + type.storage == StorageClassCallableDataKHR || type.storage == StorageClassIncomingCallableDataKHR || + type.storage == StorageClassHitAttributeKHR) && + !is_hidden_variable(var)) + { + emit_uniform(var); + emitted = true; + } + }); + + if (emitted) + statement(""); + emitted = false; + + bool emitted_base_instance = false; + + // Output in/out interfaces. + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + auto &type = this->get(var.basetype); + + bool is_hidden = is_hidden_variable(var); + + // Unused output I/O variables might still be required to implement framebuffer fetch. + if (var.storage == StorageClassOutput && !is_legacy() && + location_is_framebuffer_fetch(get_decoration(var.self, DecorationLocation)) != 0) + { + is_hidden = false; + } + + if (var.storage != StorageClassFunction && type.pointer && + (var.storage == StorageClassInput || var.storage == StorageClassOutput) && + interface_variable_exists_in_entry_point(var.self) && !is_hidden) + { + if (options.es && get_execution_model() == ExecutionModelVertex && var.storage == StorageClassInput && + type.array.size() == 1) + { + SPIRV_CROSS_THROW("OpenGL ES doesn't support array input variables in vertex shader."); + } + emit_interface_block(var); + emitted = true; + } + else if (is_builtin_variable(var)) + { + auto builtin = BuiltIn(get_decoration(var.self, DecorationBuiltIn)); + // For gl_InstanceIndex emulation on GLES, the API user needs to + // supply this uniform. + + // The draw parameter extension is soft-enabled on GL with some fallbacks. + if (!options.vulkan_semantics) + { + if (!emitted_base_instance && + ((options.vertex.support_nonzero_base_instance && builtin == BuiltInInstanceIndex) || + (builtin == BuiltInBaseInstance))) + { + statement("#ifdef GL_ARB_shader_draw_parameters"); + statement("#define SPIRV_Cross_BaseInstance gl_BaseInstanceARB"); + statement("#else"); + // A crude, but simple workaround which should be good enough for non-indirect draws. + statement("uniform int SPIRV_Cross_BaseInstance;"); + statement("#endif"); + emitted = true; + emitted_base_instance = true; + } + else if (builtin == BuiltInBaseVertex) + { + statement("#ifdef GL_ARB_shader_draw_parameters"); + statement("#define SPIRV_Cross_BaseVertex gl_BaseVertexARB"); + statement("#else"); + // A crude, but simple workaround which should be good enough for non-indirect draws. + statement("uniform int SPIRV_Cross_BaseVertex;"); + statement("#endif"); + } + else if (builtin == BuiltInDrawIndex) + { + statement("#ifndef GL_ARB_shader_draw_parameters"); + // Cannot really be worked around. + statement("#error GL_ARB_shader_draw_parameters is not supported."); + statement("#endif"); + } + } + } + }); + + // Global variables. + for (auto global : global_variables) + { + auto &var = get(global); + if (is_hidden_variable(var, true)) + continue; + + if (var.storage != StorageClassOutput) + { + if (!variable_is_lut(var)) + { + add_resource_name(var.self); + + string initializer; + if (options.force_zero_initialized_variables && var.storage == StorageClassPrivate && + !var.initializer && !var.static_expression && type_can_zero_initialize(get_variable_data_type(var))) + { + initializer = join(" = ", to_zero_initialized_expression(get_variable_data_type_id(var))); + } + + statement(variable_decl(var), initializer, ";"); + emitted = true; + } + } + else if (var.initializer && maybe_get(var.initializer) != nullptr) + { + emit_output_variable_initializer(var); + } + } + + if (emitted) + statement(""); +} + +void CompilerGLSL::emit_output_variable_initializer(const SPIRVariable &var) +{ + // If a StorageClassOutput variable has an initializer, we need to initialize it in main(). + auto &entry_func = this->get(ir.default_entry_point); + auto &type = get(var.basetype); + bool is_patch = has_decoration(var.self, DecorationPatch); + bool is_block = has_decoration(type.self, DecorationBlock); + bool is_control_point = get_execution_model() == ExecutionModelTessellationControl && !is_patch; + + if (is_block) + { + uint32_t member_count = uint32_t(type.member_types.size()); + bool type_is_array = type.array.size() == 1; + uint32_t array_size = 1; + if (type_is_array) + array_size = to_array_size_literal(type); + uint32_t iteration_count = is_control_point ? 1 : array_size; + + // If the initializer is a block, we must initialize each block member one at a time. + for (uint32_t i = 0; i < member_count; i++) + { + // These outputs might not have been properly declared, so don't initialize them in that case. + if (has_member_decoration(type.self, i, DecorationBuiltIn)) + { + if (get_member_decoration(type.self, i, DecorationBuiltIn) == BuiltInCullDistance && + !cull_distance_count) + continue; + + if (get_member_decoration(type.self, i, DecorationBuiltIn) == BuiltInClipDistance && + !clip_distance_count) + continue; + } + + // We need to build a per-member array first, essentially transposing from AoS to SoA. + // This code path hits when we have an array of blocks. + string lut_name; + if (type_is_array) + { + lut_name = join("_", var.self, "_", i, "_init"); + uint32_t member_type_id = get(var.basetype).member_types[i]; + auto &member_type = get(member_type_id); + auto array_type = member_type; + array_type.parent_type = member_type_id; + array_type.op = OpTypeArray; + array_type.array.push_back(array_size); + array_type.array_size_literal.push_back(true); + + SmallVector exprs; + exprs.reserve(array_size); + auto &c = get(var.initializer); + for (uint32_t j = 0; j < array_size; j++) + exprs.push_back(to_expression(get(c.subconstants[j]).subconstants[i])); + statement("const ", type_to_glsl(array_type), " ", lut_name, type_to_array_glsl(array_type, 0), " = ", + type_to_glsl_constructor(array_type), "(", merge(exprs, ", "), ");"); + } + + for (uint32_t j = 0; j < iteration_count; j++) + { + entry_func.fixup_hooks_in.push_back([=, &var]() { + AccessChainMeta meta; + auto &c = this->get(var.initializer); + + uint32_t invocation_id = 0; + uint32_t member_index_id = 0; + if (is_control_point) + { + uint32_t ids = ir.increase_bound_by(3); + auto &uint_type = set(ids, OpTypeInt); + uint_type.basetype = SPIRType::UInt; + uint_type.width = 32; + set(ids + 1, builtin_to_glsl(BuiltInInvocationId, StorageClassInput), ids, true); + set(ids + 2, ids, i, false); + invocation_id = ids + 1; + member_index_id = ids + 2; + } + + if (is_patch) + { + statement("if (gl_InvocationID == 0)"); + begin_scope(); + } + + if (type_is_array && !is_control_point) + { + uint32_t indices[2] = { j, i }; + auto chain = access_chain_internal(var.self, indices, 2, ACCESS_CHAIN_INDEX_IS_LITERAL_BIT, &meta); + statement(chain, " = ", lut_name, "[", j, "];"); + } + else if (is_control_point) + { + uint32_t indices[2] = { invocation_id, member_index_id }; + auto chain = access_chain_internal(var.self, indices, 2, 0, &meta); + statement(chain, " = ", lut_name, "[", builtin_to_glsl(BuiltInInvocationId, StorageClassInput), "];"); + } + else + { + auto chain = + access_chain_internal(var.self, &i, 1, ACCESS_CHAIN_INDEX_IS_LITERAL_BIT, &meta); + statement(chain, " = ", to_expression(c.subconstants[i]), ";"); + } + + if (is_patch) + end_scope(); + }); + } + } + } + else if (is_control_point) + { + auto lut_name = join("_", var.self, "_init"); + statement("const ", type_to_glsl(type), " ", lut_name, type_to_array_glsl(type, 0), + " = ", to_expression(var.initializer), ";"); + entry_func.fixup_hooks_in.push_back([&, lut_name]() { + statement(to_expression(var.self), "[gl_InvocationID] = ", lut_name, "[gl_InvocationID];"); + }); + } + else if (has_decoration(var.self, DecorationBuiltIn) && + BuiltIn(get_decoration(var.self, DecorationBuiltIn)) == BuiltInSampleMask) + { + // We cannot copy the array since gl_SampleMask is unsized in GLSL. Unroll time! <_< + entry_func.fixup_hooks_in.push_back([&] { + auto &c = this->get(var.initializer); + uint32_t num_constants = uint32_t(c.subconstants.size()); + for (uint32_t i = 0; i < num_constants; i++) + { + // Don't use to_expression on constant since it might be uint, just fish out the raw int. + statement(to_expression(var.self), "[", i, "] = ", + convert_to_string(this->get(c.subconstants[i]).scalar_i32()), ";"); + } + }); + } + else + { + auto lut_name = join("_", var.self, "_init"); + statement("const ", type_to_glsl(type), " ", lut_name, + type_to_array_glsl(type, var.self), " = ", to_expression(var.initializer), ";"); + entry_func.fixup_hooks_in.push_back([&, lut_name, is_patch]() { + if (is_patch) + { + statement("if (gl_InvocationID == 0)"); + begin_scope(); + } + statement(to_expression(var.self), " = ", lut_name, ";"); + if (is_patch) + end_scope(); + }); + } +} + +void CompilerGLSL::emit_subgroup_arithmetic_workaround(const std::string &func, Op op, GroupOperation group_op) +{ + std::string result; + switch (group_op) + { + case GroupOperationReduce: + result = "reduction"; + break; + + case GroupOperationExclusiveScan: + result = "excl_scan"; + break; + + case GroupOperationInclusiveScan: + result = "incl_scan"; + break; + + default: + SPIRV_CROSS_THROW("Unsupported workaround for arithmetic group operation"); + } + + struct TypeInfo + { + std::string type; + std::string identity; + }; + + std::vector type_infos; + switch (op) + { + case OpGroupNonUniformIAdd: + { + type_infos.emplace_back(TypeInfo{ "uint", "0u" }); + type_infos.emplace_back(TypeInfo{ "uvec2", "uvec2(0u)" }); + type_infos.emplace_back(TypeInfo{ "uvec3", "uvec3(0u)" }); + type_infos.emplace_back(TypeInfo{ "uvec4", "uvec4(0u)" }); + type_infos.emplace_back(TypeInfo{ "int", "0" }); + type_infos.emplace_back(TypeInfo{ "ivec2", "ivec2(0)" }); + type_infos.emplace_back(TypeInfo{ "ivec3", "ivec3(0)" }); + type_infos.emplace_back(TypeInfo{ "ivec4", "ivec4(0)" }); + break; + } + + case OpGroupNonUniformFAdd: + { + type_infos.emplace_back(TypeInfo{ "float", "0.0f" }); + type_infos.emplace_back(TypeInfo{ "vec2", "vec2(0.0f)" }); + type_infos.emplace_back(TypeInfo{ "vec3", "vec3(0.0f)" }); + type_infos.emplace_back(TypeInfo{ "vec4", "vec4(0.0f)" }); + // ARB_gpu_shader_fp64 is required in GL4.0 which in turn is required by NV_thread_shuffle + type_infos.emplace_back(TypeInfo{ "double", "0.0LF" }); + type_infos.emplace_back(TypeInfo{ "dvec2", "dvec2(0.0LF)" }); + type_infos.emplace_back(TypeInfo{ "dvec3", "dvec3(0.0LF)" }); + type_infos.emplace_back(TypeInfo{ "dvec4", "dvec4(0.0LF)" }); + break; + } + + case OpGroupNonUniformIMul: + { + type_infos.emplace_back(TypeInfo{ "uint", "1u" }); + type_infos.emplace_back(TypeInfo{ "uvec2", "uvec2(1u)" }); + type_infos.emplace_back(TypeInfo{ "uvec3", "uvec3(1u)" }); + type_infos.emplace_back(TypeInfo{ "uvec4", "uvec4(1u)" }); + type_infos.emplace_back(TypeInfo{ "int", "1" }); + type_infos.emplace_back(TypeInfo{ "ivec2", "ivec2(1)" }); + type_infos.emplace_back(TypeInfo{ "ivec3", "ivec3(1)" }); + type_infos.emplace_back(TypeInfo{ "ivec4", "ivec4(1)" }); + break; + } + + case OpGroupNonUniformFMul: + { + type_infos.emplace_back(TypeInfo{ "float", "1.0f" }); + type_infos.emplace_back(TypeInfo{ "vec2", "vec2(1.0f)" }); + type_infos.emplace_back(TypeInfo{ "vec3", "vec3(1.0f)" }); + type_infos.emplace_back(TypeInfo{ "vec4", "vec4(1.0f)" }); + type_infos.emplace_back(TypeInfo{ "double", "0.0LF" }); + type_infos.emplace_back(TypeInfo{ "dvec2", "dvec2(1.0LF)" }); + type_infos.emplace_back(TypeInfo{ "dvec3", "dvec3(1.0LF)" }); + type_infos.emplace_back(TypeInfo{ "dvec4", "dvec4(1.0LF)" }); + break; + } + + default: + SPIRV_CROSS_THROW("Unsupported workaround for arithmetic group operation"); + } + + const bool op_is_addition = op == OpGroupNonUniformIAdd || op == OpGroupNonUniformFAdd; + const bool op_is_multiplication = op == OpGroupNonUniformIMul || op == OpGroupNonUniformFMul; + std::string op_symbol; + if (op_is_addition) + { + op_symbol = "+="; + } + else if (op_is_multiplication) + { + op_symbol = "*="; + } + + for (const TypeInfo &t : type_infos) + { + statement(t.type, " ", func, "(", t.type, " v)"); + begin_scope(); + statement(t.type, " ", result, " = ", t.identity, ";"); + statement("uvec4 active_threads = subgroupBallot(true);"); + statement("if (subgroupBallotBitCount(active_threads) == gl_SubgroupSize)"); + begin_scope(); + statement("uint total = gl_SubgroupSize / 2u;"); + statement(result, " = v;"); + statement("for (uint i = 1u; i <= total; i <<= 1u)"); + begin_scope(); + statement("bool valid;"); + if (group_op == GroupOperationReduce) + { + statement(t.type, " s = shuffleXorNV(", result, ", i, gl_SubgroupSize, valid);"); + } + else if (group_op == GroupOperationExclusiveScan || group_op == GroupOperationInclusiveScan) + { + statement(t.type, " s = shuffleUpNV(", result, ", i, gl_SubgroupSize, valid);"); + } + if (op_is_addition || op_is_multiplication) + { + statement(result, " ", op_symbol, " valid ? s : ", t.identity, ";"); + } + end_scope(); + if (group_op == GroupOperationExclusiveScan) + { + statement(result, " = shuffleUpNV(", result, ", 1u, gl_SubgroupSize);"); + statement("if (subgroupElect())"); + begin_scope(); + statement(result, " = ", t.identity, ";"); + end_scope(); + } + end_scope(); + statement("else"); + begin_scope(); + if (group_op == GroupOperationExclusiveScan) + { + statement("uint total = subgroupBallotBitCount(gl_SubgroupLtMask);"); + } + else if (group_op == GroupOperationInclusiveScan) + { + statement("uint total = subgroupBallotBitCount(gl_SubgroupLeMask);"); + } + statement("for (uint i = 0u; i < gl_SubgroupSize; ++i)"); + begin_scope(); + statement("bool valid = subgroupBallotBitExtract(active_threads, i);"); + statement(t.type, " s = shuffleNV(v, i, gl_SubgroupSize);"); + if (group_op == GroupOperationExclusiveScan || group_op == GroupOperationInclusiveScan) + { + statement("valid = valid && (i < total);"); + } + if (op_is_addition || op_is_multiplication) + { + statement(result, " ", op_symbol, " valid ? s : ", t.identity, ";"); + } + end_scope(); + end_scope(); + statement("return ", result, ";"); + end_scope(); + } +} + +void CompilerGLSL::emit_extension_workarounds(ExecutionModel model) +{ + static const char *workaround_types[] = { "int", "ivec2", "ivec3", "ivec4", "uint", "uvec2", "uvec3", "uvec4", + "float", "vec2", "vec3", "vec4", "double", "dvec2", "dvec3", "dvec4" }; + + if (!options.vulkan_semantics) + { + using Supp = ShaderSubgroupSupportHelper; + auto result = shader_subgroup_supporter.resolve(); + + if (shader_subgroup_supporter.is_feature_requested(Supp::SubgroupMask)) + { + auto exts = Supp::get_candidates_for_feature(Supp::SubgroupMask, result); + + for (auto &e : exts) + { + const char *name = Supp::get_extension_name(e); + statement(&e == &exts.front() ? "#if" : "#elif", " defined(", name, ")"); + + switch (e) + { + case Supp::NV_shader_thread_group: + statement("#define gl_SubgroupEqMask uvec4(gl_ThreadEqMaskNV, 0u, 0u, 0u)"); + statement("#define gl_SubgroupGeMask uvec4(gl_ThreadGeMaskNV, 0u, 0u, 0u)"); + statement("#define gl_SubgroupGtMask uvec4(gl_ThreadGtMaskNV, 0u, 0u, 0u)"); + statement("#define gl_SubgroupLeMask uvec4(gl_ThreadLeMaskNV, 0u, 0u, 0u)"); + statement("#define gl_SubgroupLtMask uvec4(gl_ThreadLtMaskNV, 0u, 0u, 0u)"); + break; + case Supp::ARB_shader_ballot: + statement("#define gl_SubgroupEqMask uvec4(unpackUint2x32(gl_SubGroupEqMaskARB), 0u, 0u)"); + statement("#define gl_SubgroupGeMask uvec4(unpackUint2x32(gl_SubGroupGeMaskARB), 0u, 0u)"); + statement("#define gl_SubgroupGtMask uvec4(unpackUint2x32(gl_SubGroupGtMaskARB), 0u, 0u)"); + statement("#define gl_SubgroupLeMask uvec4(unpackUint2x32(gl_SubGroupLeMaskARB), 0u, 0u)"); + statement("#define gl_SubgroupLtMask uvec4(unpackUint2x32(gl_SubGroupLtMaskARB), 0u, 0u)"); + break; + default: + break; + } + } + statement("#endif"); + statement(""); + } + + if (shader_subgroup_supporter.is_feature_requested(Supp::SubgroupSize)) + { + auto exts = Supp::get_candidates_for_feature(Supp::SubgroupSize, result); + + for (auto &e : exts) + { + const char *name = Supp::get_extension_name(e); + statement(&e == &exts.front() ? "#if" : "#elif", " defined(", name, ")"); + + switch (e) + { + case Supp::NV_shader_thread_group: + statement("#define gl_SubgroupSize gl_WarpSizeNV"); + break; + case Supp::ARB_shader_ballot: + statement("#define gl_SubgroupSize gl_SubGroupSizeARB"); + break; + case Supp::AMD_gcn_shader: + statement("#define gl_SubgroupSize uint(gl_SIMDGroupSizeAMD)"); + break; + default: + break; + } + } + statement("#endif"); + statement(""); + } + + if (shader_subgroup_supporter.is_feature_requested(Supp::SubgroupInvocationID)) + { + auto exts = Supp::get_candidates_for_feature(Supp::SubgroupInvocationID, result); + + for (auto &e : exts) + { + const char *name = Supp::get_extension_name(e); + statement(&e == &exts.front() ? "#if" : "#elif", " defined(", name, ")"); + + switch (e) + { + case Supp::NV_shader_thread_group: + statement("#define gl_SubgroupInvocationID gl_ThreadInWarpNV"); + break; + case Supp::ARB_shader_ballot: + statement("#define gl_SubgroupInvocationID gl_SubGroupInvocationARB"); + break; + default: + break; + } + } + statement("#endif"); + statement(""); + } + + if (shader_subgroup_supporter.is_feature_requested(Supp::SubgroupID)) + { + auto exts = Supp::get_candidates_for_feature(Supp::SubgroupID, result); + + for (auto &e : exts) + { + const char *name = Supp::get_extension_name(e); + statement(&e == &exts.front() ? "#if" : "#elif", " defined(", name, ")"); + + switch (e) + { + case Supp::NV_shader_thread_group: + statement("#define gl_SubgroupID gl_WarpIDNV"); + break; + default: + break; + } + } + statement("#endif"); + statement(""); + } + + if (shader_subgroup_supporter.is_feature_requested(Supp::NumSubgroups)) + { + auto exts = Supp::get_candidates_for_feature(Supp::NumSubgroups, result); + + for (auto &e : exts) + { + const char *name = Supp::get_extension_name(e); + statement(&e == &exts.front() ? "#if" : "#elif", " defined(", name, ")"); + + switch (e) + { + case Supp::NV_shader_thread_group: + statement("#define gl_NumSubgroups gl_WarpsPerSMNV"); + break; + default: + break; + } + } + statement("#endif"); + statement(""); + } + + if (shader_subgroup_supporter.is_feature_requested(Supp::SubgroupBroadcast_First)) + { + auto exts = Supp::get_candidates_for_feature(Supp::SubgroupBroadcast_First, result); + + for (auto &e : exts) + { + const char *name = Supp::get_extension_name(e); + statement(&e == &exts.front() ? "#if" : "#elif", " defined(", name, ")"); + + switch (e) + { + case Supp::NV_shader_thread_shuffle: + for (const char *t : workaround_types) + { + statement(t, " subgroupBroadcastFirst(", t, + " value) { return shuffleNV(value, findLSB(ballotThreadNV(true)), gl_WarpSizeNV); }"); + } + for (const char *t : workaround_types) + { + statement(t, " subgroupBroadcast(", t, + " value, uint id) { return shuffleNV(value, id, gl_WarpSizeNV); }"); + } + break; + case Supp::ARB_shader_ballot: + for (const char *t : workaround_types) + { + statement(t, " subgroupBroadcastFirst(", t, + " value) { return readFirstInvocationARB(value); }"); + } + for (const char *t : workaround_types) + { + statement(t, " subgroupBroadcast(", t, + " value, uint id) { return readInvocationARB(value, id); }"); + } + break; + default: + break; + } + } + statement("#endif"); + statement(""); + } + + if (shader_subgroup_supporter.is_feature_requested(Supp::SubgroupBallotFindLSB_MSB)) + { + auto exts = Supp::get_candidates_for_feature(Supp::SubgroupBallotFindLSB_MSB, result); + + for (auto &e : exts) + { + const char *name = Supp::get_extension_name(e); + statement(&e == &exts.front() ? "#if" : "#elif", " defined(", name, ")"); + + switch (e) + { + case Supp::NV_shader_thread_group: + statement("uint subgroupBallotFindLSB(uvec4 value) { return findLSB(value.x); }"); + statement("uint subgroupBallotFindMSB(uvec4 value) { return findMSB(value.x); }"); + break; + default: + break; + } + } + statement("#else"); + statement("uint subgroupBallotFindLSB(uvec4 value)"); + begin_scope(); + statement("int firstLive = findLSB(value.x);"); + statement("return uint(firstLive != -1 ? firstLive : (findLSB(value.y) + 32));"); + end_scope(); + statement("uint subgroupBallotFindMSB(uvec4 value)"); + begin_scope(); + statement("int firstLive = findMSB(value.y);"); + statement("return uint(firstLive != -1 ? (firstLive + 32) : findMSB(value.x));"); + end_scope(); + statement("#endif"); + statement(""); + } + + if (shader_subgroup_supporter.is_feature_requested(Supp::SubgroupAll_Any_AllEqualBool)) + { + auto exts = Supp::get_candidates_for_feature(Supp::SubgroupAll_Any_AllEqualBool, result); + + for (auto &e : exts) + { + const char *name = Supp::get_extension_name(e); + statement(&e == &exts.front() ? "#if" : "#elif", " defined(", name, ")"); + + switch (e) + { + case Supp::NV_gpu_shader_5: + statement("bool subgroupAll(bool value) { return allThreadsNV(value); }"); + statement("bool subgroupAny(bool value) { return anyThreadNV(value); }"); + statement("bool subgroupAllEqual(bool value) { return allThreadsEqualNV(value); }"); + break; + case Supp::ARB_shader_group_vote: + statement("bool subgroupAll(bool v) { return allInvocationsARB(v); }"); + statement("bool subgroupAny(bool v) { return anyInvocationARB(v); }"); + statement("bool subgroupAllEqual(bool v) { return allInvocationsEqualARB(v); }"); + break; + case Supp::AMD_gcn_shader: + statement("bool subgroupAll(bool value) { return ballotAMD(value) == ballotAMD(true); }"); + statement("bool subgroupAny(bool value) { return ballotAMD(value) != 0ull; }"); + statement("bool subgroupAllEqual(bool value) { uint64_t b = ballotAMD(value); return b == 0ull || " + "b == ballotAMD(true); }"); + break; + default: + break; + } + } + statement("#endif"); + statement(""); + } + + if (shader_subgroup_supporter.is_feature_requested(Supp::SubgroupAllEqualT)) + { + statement("#ifndef GL_KHR_shader_subgroup_vote"); + statement( + "#define _SPIRV_CROSS_SUBGROUP_ALL_EQUAL_WORKAROUND(type) bool subgroupAllEqual(type value) { return " + "subgroupAllEqual(subgroupBroadcastFirst(value) == value); }"); + for (const char *t : workaround_types) + statement("_SPIRV_CROSS_SUBGROUP_ALL_EQUAL_WORKAROUND(", t, ")"); + statement("#undef _SPIRV_CROSS_SUBGROUP_ALL_EQUAL_WORKAROUND"); + statement("#endif"); + statement(""); + } + + if (shader_subgroup_supporter.is_feature_requested(Supp::SubgroupBallot)) + { + auto exts = Supp::get_candidates_for_feature(Supp::SubgroupBallot, result); + + for (auto &e : exts) + { + const char *name = Supp::get_extension_name(e); + statement(&e == &exts.front() ? "#if" : "#elif", " defined(", name, ")"); + + switch (e) + { + case Supp::NV_shader_thread_group: + statement("uvec4 subgroupBallot(bool v) { return uvec4(ballotThreadNV(v), 0u, 0u, 0u); }"); + break; + case Supp::ARB_shader_ballot: + statement("uvec4 subgroupBallot(bool v) { return uvec4(unpackUint2x32(ballotARB(v)), 0u, 0u); }"); + break; + default: + break; + } + } + statement("#endif"); + statement(""); + } + + if (shader_subgroup_supporter.is_feature_requested(Supp::SubgroupElect)) + { + statement("#ifndef GL_KHR_shader_subgroup_basic"); + statement("bool subgroupElect()"); + begin_scope(); + statement("uvec4 activeMask = subgroupBallot(true);"); + statement("uint firstLive = subgroupBallotFindLSB(activeMask);"); + statement("return gl_SubgroupInvocationID == firstLive;"); + end_scope(); + statement("#endif"); + statement(""); + } + + if (shader_subgroup_supporter.is_feature_requested(Supp::SubgroupBarrier)) + { + // Extensions we're using in place of GL_KHR_shader_subgroup_basic state + // that subgroup execute in lockstep so this barrier is implicit. + // However the GL 4.6 spec also states that `barrier` implies a shared memory barrier, + // and a specific test of optimizing scans by leveraging lock-step invocation execution, + // has shown that a `memoryBarrierShared` is needed in place of a `subgroupBarrier`. + // https://github.com/buildaworldnet/IrrlichtBAW/commit/d8536857991b89a30a6b65d29441e51b64c2c7ad#diff-9f898d27be1ea6fc79b03d9b361e299334c1a347b6e4dc344ee66110c6aa596aR19 + statement("#ifndef GL_KHR_shader_subgroup_basic"); + statement("void subgroupBarrier() { memoryBarrierShared(); }"); + statement("#endif"); + statement(""); + } + + if (shader_subgroup_supporter.is_feature_requested(Supp::SubgroupMemBarrier)) + { + if (model == ExecutionModelGLCompute) + { + statement("#ifndef GL_KHR_shader_subgroup_basic"); + statement("void subgroupMemoryBarrier() { groupMemoryBarrier(); }"); + statement("void subgroupMemoryBarrierBuffer() { groupMemoryBarrier(); }"); + statement("void subgroupMemoryBarrierShared() { memoryBarrierShared(); }"); + statement("void subgroupMemoryBarrierImage() { groupMemoryBarrier(); }"); + statement("#endif"); + } + else + { + statement("#ifndef GL_KHR_shader_subgroup_basic"); + statement("void subgroupMemoryBarrier() { memoryBarrier(); }"); + statement("void subgroupMemoryBarrierBuffer() { memoryBarrierBuffer(); }"); + statement("void subgroupMemoryBarrierImage() { memoryBarrierImage(); }"); + statement("#endif"); + } + statement(""); + } + + if (shader_subgroup_supporter.is_feature_requested(Supp::SubgroupInverseBallot_InclBitCount_ExclBitCout)) + { + statement("#ifndef GL_KHR_shader_subgroup_ballot"); + statement("bool subgroupInverseBallot(uvec4 value)"); + begin_scope(); + statement("return any(notEqual(value.xy & gl_SubgroupEqMask.xy, uvec2(0u)));"); + end_scope(); + + statement("uint subgroupBallotInclusiveBitCount(uvec4 value)"); + begin_scope(); + statement("uvec2 v = value.xy & gl_SubgroupLeMask.xy;"); + statement("ivec2 c = bitCount(v);"); + statement_no_indent("#ifdef GL_NV_shader_thread_group"); + statement("return uint(c.x);"); + statement_no_indent("#else"); + statement("return uint(c.x + c.y);"); + statement_no_indent("#endif"); + end_scope(); + + statement("uint subgroupBallotExclusiveBitCount(uvec4 value)"); + begin_scope(); + statement("uvec2 v = value.xy & gl_SubgroupLtMask.xy;"); + statement("ivec2 c = bitCount(v);"); + statement_no_indent("#ifdef GL_NV_shader_thread_group"); + statement("return uint(c.x);"); + statement_no_indent("#else"); + statement("return uint(c.x + c.y);"); + statement_no_indent("#endif"); + end_scope(); + statement("#endif"); + statement(""); + } + + if (shader_subgroup_supporter.is_feature_requested(Supp::SubgroupBallotBitCount)) + { + statement("#ifndef GL_KHR_shader_subgroup_ballot"); + statement("uint subgroupBallotBitCount(uvec4 value)"); + begin_scope(); + statement("ivec2 c = bitCount(value.xy);"); + statement_no_indent("#ifdef GL_NV_shader_thread_group"); + statement("return uint(c.x);"); + statement_no_indent("#else"); + statement("return uint(c.x + c.y);"); + statement_no_indent("#endif"); + end_scope(); + statement("#endif"); + statement(""); + } + + if (shader_subgroup_supporter.is_feature_requested(Supp::SubgroupBallotBitExtract)) + { + statement("#ifndef GL_KHR_shader_subgroup_ballot"); + statement("bool subgroupBallotBitExtract(uvec4 value, uint index)"); + begin_scope(); + statement_no_indent("#ifdef GL_NV_shader_thread_group"); + statement("uint shifted = value.x >> index;"); + statement_no_indent("#else"); + statement("uint shifted = value[index >> 5u] >> (index & 0x1fu);"); + statement_no_indent("#endif"); + statement("return (shifted & 1u) != 0u;"); + end_scope(); + statement("#endif"); + statement(""); + } + + auto arithmetic_feature_helper = + [&](Supp::Feature feat, std::string func_name, Op op, GroupOperation group_op) + { + if (shader_subgroup_supporter.is_feature_requested(feat)) + { + auto exts = Supp::get_candidates_for_feature(feat, result); + for (auto &e : exts) + { + const char *name = Supp::get_extension_name(e); + statement(&e == &exts.front() ? "#if" : "#elif", " defined(", name, ")"); + + switch (e) + { + case Supp::NV_shader_thread_shuffle: + emit_subgroup_arithmetic_workaround(func_name, op, group_op); + break; + default: + break; + } + } + statement("#endif"); + statement(""); + } + }; + + arithmetic_feature_helper(Supp::SubgroupArithmeticIAddReduce, "subgroupAdd", OpGroupNonUniformIAdd, + GroupOperationReduce); + arithmetic_feature_helper(Supp::SubgroupArithmeticIAddExclusiveScan, "subgroupExclusiveAdd", + OpGroupNonUniformIAdd, GroupOperationExclusiveScan); + arithmetic_feature_helper(Supp::SubgroupArithmeticIAddInclusiveScan, "subgroupInclusiveAdd", + OpGroupNonUniformIAdd, GroupOperationInclusiveScan); + arithmetic_feature_helper(Supp::SubgroupArithmeticFAddReduce, "subgroupAdd", OpGroupNonUniformFAdd, + GroupOperationReduce); + arithmetic_feature_helper(Supp::SubgroupArithmeticFAddExclusiveScan, "subgroupExclusiveAdd", + OpGroupNonUniformFAdd, GroupOperationExclusiveScan); + arithmetic_feature_helper(Supp::SubgroupArithmeticFAddInclusiveScan, "subgroupInclusiveAdd", + OpGroupNonUniformFAdd, GroupOperationInclusiveScan); + + arithmetic_feature_helper(Supp::SubgroupArithmeticIMulReduce, "subgroupMul", OpGroupNonUniformIMul, + GroupOperationReduce); + arithmetic_feature_helper(Supp::SubgroupArithmeticIMulExclusiveScan, "subgroupExclusiveMul", + OpGroupNonUniformIMul, GroupOperationExclusiveScan); + arithmetic_feature_helper(Supp::SubgroupArithmeticIMulInclusiveScan, "subgroupInclusiveMul", + OpGroupNonUniformIMul, GroupOperationInclusiveScan); + arithmetic_feature_helper(Supp::SubgroupArithmeticFMulReduce, "subgroupMul", OpGroupNonUniformFMul, + GroupOperationReduce); + arithmetic_feature_helper(Supp::SubgroupArithmeticFMulExclusiveScan, "subgroupExclusiveMul", + OpGroupNonUniformFMul, GroupOperationExclusiveScan); + arithmetic_feature_helper(Supp::SubgroupArithmeticFMulInclusiveScan, "subgroupInclusiveMul", + OpGroupNonUniformFMul, GroupOperationInclusiveScan); + } + + if (!workaround_ubo_load_overload_types.empty()) + { + for (auto &type_id : workaround_ubo_load_overload_types) + { + auto &type = get(type_id); + + if (options.es && is_matrix(type)) + { + // Need both variants. + // GLSL cannot overload on precision, so need to dispatch appropriately. + statement("highp ", type_to_glsl(type), " spvWorkaroundRowMajor(highp ", type_to_glsl(type), " wrap) { return wrap; }"); + statement("mediump ", type_to_glsl(type), " spvWorkaroundRowMajorMP(mediump ", type_to_glsl(type), " wrap) { return wrap; }"); + } + else + { + statement(type_to_glsl(type), " spvWorkaroundRowMajor(", type_to_glsl(type), " wrap) { return wrap; }"); + } + } + statement(""); + } +} + +void CompilerGLSL::emit_polyfills(uint32_t polyfills, bool relaxed) +{ + const char *qual = ""; + const char *suffix = (options.es && relaxed) ? "MP" : ""; + if (options.es) + qual = relaxed ? "mediump " : "highp "; + + if (polyfills & PolyfillTranspose2x2) + { + statement(qual, "mat2 spvTranspose", suffix, "(", qual, "mat2 m)"); + begin_scope(); + statement("return mat2(m[0][0], m[1][0], m[0][1], m[1][1]);"); + end_scope(); + statement(""); + } + + if (polyfills & PolyfillTranspose3x3) + { + statement(qual, "mat3 spvTranspose", suffix, "(", qual, "mat3 m)"); + begin_scope(); + statement("return mat3(m[0][0], m[1][0], m[2][0], m[0][1], m[1][1], m[2][1], m[0][2], m[1][2], m[2][2]);"); + end_scope(); + statement(""); + } + + if (polyfills & PolyfillTranspose4x4) + { + statement(qual, "mat4 spvTranspose", suffix, "(", qual, "mat4 m)"); + begin_scope(); + statement("return mat4(m[0][0], m[1][0], m[2][0], m[3][0], m[0][1], m[1][1], m[2][1], m[3][1], m[0][2], " + "m[1][2], m[2][2], m[3][2], m[0][3], m[1][3], m[2][3], m[3][3]);"); + end_scope(); + statement(""); + } + + if (polyfills & PolyfillDeterminant2x2) + { + statement(qual, "float spvDeterminant", suffix, "(", qual, "mat2 m)"); + begin_scope(); + statement("return m[0][0] * m[1][1] - m[0][1] * m[1][0];"); + end_scope(); + statement(""); + } + + if (polyfills & PolyfillDeterminant3x3) + { + statement(qual, "float spvDeterminant", suffix, "(", qual, "mat3 m)"); + begin_scope(); + statement("return dot(m[0], vec3(m[1][1] * m[2][2] - m[1][2] * m[2][1], " + "m[1][2] * m[2][0] - m[1][0] * m[2][2], " + "m[1][0] * m[2][1] - m[1][1] * m[2][0]));"); + end_scope(); + statement(""); + } + + if (polyfills & PolyfillDeterminant4x4) + { + statement(qual, "float spvDeterminant", suffix, "(", qual, "mat4 m)"); + begin_scope(); + statement("return dot(m[0], vec4(" + "m[2][1] * m[3][2] * m[1][3] - m[3][1] * m[2][2] * m[1][3] + m[3][1] * m[1][2] * m[2][3] - m[1][1] * m[3][2] * m[2][3] - m[2][1] * m[1][2] * m[3][3] + m[1][1] * m[2][2] * m[3][3], " + "m[3][0] * m[2][2] * m[1][3] - m[2][0] * m[3][2] * m[1][3] - m[3][0] * m[1][2] * m[2][3] + m[1][0] * m[3][2] * m[2][3] + m[2][0] * m[1][2] * m[3][3] - m[1][0] * m[2][2] * m[3][3], " + "m[2][0] * m[3][1] * m[1][3] - m[3][0] * m[2][1] * m[1][3] + m[3][0] * m[1][1] * m[2][3] - m[1][0] * m[3][1] * m[2][3] - m[2][0] * m[1][1] * m[3][3] + m[1][0] * m[2][1] * m[3][3], " + "m[3][0] * m[2][1] * m[1][2] - m[2][0] * m[3][1] * m[1][2] - m[3][0] * m[1][1] * m[2][2] + m[1][0] * m[3][1] * m[2][2] + m[2][0] * m[1][1] * m[3][2] - m[1][0] * m[2][1] * m[3][2]));"); + end_scope(); + statement(""); + } + + if (polyfills & PolyfillMatrixInverse2x2) + { + statement(qual, "mat2 spvInverse", suffix, "(", qual, "mat2 m)"); + begin_scope(); + statement("return mat2(m[1][1], -m[0][1], -m[1][0], m[0][0]) " + "* (1.0 / (m[0][0] * m[1][1] - m[1][0] * m[0][1]));"); + end_scope(); + statement(""); + } + + if (polyfills & PolyfillMatrixInverse3x3) + { + statement(qual, "mat3 spvInverse", suffix, "(", qual, "mat3 m)"); + begin_scope(); + statement(qual, "vec3 t = vec3(m[1][1] * m[2][2] - m[1][2] * m[2][1], m[1][2] * m[2][0] - m[1][0] * m[2][2], m[1][0] * m[2][1] - m[1][1] * m[2][0]);"); + statement("return mat3(t[0], " + "m[0][2] * m[2][1] - m[0][1] * m[2][2], " + "m[0][1] * m[1][2] - m[0][2] * m[1][1], " + "t[1], " + "m[0][0] * m[2][2] - m[0][2] * m[2][0], " + "m[0][2] * m[1][0] - m[0][0] * m[1][2], " + "t[2], " + "m[0][1] * m[2][0] - m[0][0] * m[2][1], " + "m[0][0] * m[1][1] - m[0][1] * m[1][0]) " + "* (1.0 / dot(m[0], t));"); + end_scope(); + statement(""); + } + + if (polyfills & PolyfillMatrixInverse4x4) + { + statement(qual, "mat4 spvInverse", suffix, "(", qual, "mat4 m)"); + begin_scope(); + statement(qual, "vec4 t = vec4(" + "m[2][1] * m[3][2] * m[1][3] - m[3][1] * m[2][2] * m[1][3] + m[3][1] * m[1][2] * m[2][3] - m[1][1] * m[3][2] * m[2][3] - m[2][1] * m[1][2] * m[3][3] + m[1][1] * m[2][2] * m[3][3], " + "m[3][0] * m[2][2] * m[1][3] - m[2][0] * m[3][2] * m[1][3] - m[3][0] * m[1][2] * m[2][3] + m[1][0] * m[3][2] * m[2][3] + m[2][0] * m[1][2] * m[3][3] - m[1][0] * m[2][2] * m[3][3], " + "m[2][0] * m[3][1] * m[1][3] - m[3][0] * m[2][1] * m[1][3] + m[3][0] * m[1][1] * m[2][3] - m[1][0] * m[3][1] * m[2][3] - m[2][0] * m[1][1] * m[3][3] + m[1][0] * m[2][1] * m[3][3], " + "m[3][0] * m[2][1] * m[1][2] - m[2][0] * m[3][1] * m[1][2] - m[3][0] * m[1][1] * m[2][2] + m[1][0] * m[3][1] * m[2][2] + m[2][0] * m[1][1] * m[3][2] - m[1][0] * m[2][1] * m[3][2]);"); + statement("return mat4(" + "t[0], " + "m[3][1] * m[2][2] * m[0][3] - m[2][1] * m[3][2] * m[0][3] - m[3][1] * m[0][2] * m[2][3] + m[0][1] * m[3][2] * m[2][3] + m[2][1] * m[0][2] * m[3][3] - m[0][1] * m[2][2] * m[3][3], " + "m[1][1] * m[3][2] * m[0][3] - m[3][1] * m[1][2] * m[0][3] + m[3][1] * m[0][2] * m[1][3] - m[0][1] * m[3][2] * m[1][3] - m[1][1] * m[0][2] * m[3][3] + m[0][1] * m[1][2] * m[3][3], " + "m[2][1] * m[1][2] * m[0][3] - m[1][1] * m[2][2] * m[0][3] - m[2][1] * m[0][2] * m[1][3] + m[0][1] * m[2][2] * m[1][3] + m[1][1] * m[0][2] * m[2][3] - m[0][1] * m[1][2] * m[2][3], " + "t[1], " + "m[2][0] * m[3][2] * m[0][3] - m[3][0] * m[2][2] * m[0][3] + m[3][0] * m[0][2] * m[2][3] - m[0][0] * m[3][2] * m[2][3] - m[2][0] * m[0][2] * m[3][3] + m[0][0] * m[2][2] * m[3][3], " + "m[3][0] * m[1][2] * m[0][3] - m[1][0] * m[3][2] * m[0][3] - m[3][0] * m[0][2] * m[1][3] + m[0][0] * m[3][2] * m[1][3] + m[1][0] * m[0][2] * m[3][3] - m[0][0] * m[1][2] * m[3][3], " + "m[1][0] * m[2][2] * m[0][3] - m[2][0] * m[1][2] * m[0][3] + m[2][0] * m[0][2] * m[1][3] - m[0][0] * m[2][2] * m[1][3] - m[1][0] * m[0][2] * m[2][3] + m[0][0] * m[1][2] * m[2][3], " + "t[2], " + "m[3][0] * m[2][1] * m[0][3] - m[2][0] * m[3][1] * m[0][3] - m[3][0] * m[0][1] * m[2][3] + m[0][0] * m[3][1] * m[2][3] + m[2][0] * m[0][1] * m[3][3] - m[0][0] * m[2][1] * m[3][3], " + "m[1][0] * m[3][1] * m[0][3] - m[3][0] * m[1][1] * m[0][3] + m[3][0] * m[0][1] * m[1][3] - m[0][0] * m[3][1] * m[1][3] - m[1][0] * m[0][1] * m[3][3] + m[0][0] * m[1][1] * m[3][3], " + "m[2][0] * m[1][1] * m[0][3] - m[1][0] * m[2][1] * m[0][3] - m[2][0] * m[0][1] * m[1][3] + m[0][0] * m[2][1] * m[1][3] + m[1][0] * m[0][1] * m[2][3] - m[0][0] * m[1][1] * m[2][3], " + "t[3], " + "m[2][0] * m[3][1] * m[0][2] - m[3][0] * m[2][1] * m[0][2] + m[3][0] * m[0][1] * m[2][2] - m[0][0] * m[3][1] * m[2][2] - m[2][0] * m[0][1] * m[3][2] + m[0][0] * m[2][1] * m[3][2], " + "m[3][0] * m[1][1] * m[0][2] - m[1][0] * m[3][1] * m[0][2] - m[3][0] * m[0][1] * m[1][2] + m[0][0] * m[3][1] * m[1][2] + m[1][0] * m[0][1] * m[3][2] - m[0][0] * m[1][1] * m[3][2], " + "m[1][0] * m[2][1] * m[0][2] - m[2][0] * m[1][1] * m[0][2] + m[2][0] * m[0][1] * m[1][2] - m[0][0] * m[2][1] * m[1][2] - m[1][0] * m[0][1] * m[2][2] + m[0][0] * m[1][1] * m[2][2]) " + "* (1.0 / dot(m[0], t));"); + end_scope(); + statement(""); + } + + if (!relaxed) + { + static const Polyfill polys[3][3] = { + { PolyfillNMin16, PolyfillNMin32, PolyfillNMin64 }, + { PolyfillNMax16, PolyfillNMax32, PolyfillNMax64 }, + { PolyfillNClamp16, PolyfillNClamp32, PolyfillNClamp64 }, + }; + + static const GLSLstd450 glsl_ops[] = { GLSLstd450NMin, GLSLstd450NMax, GLSLstd450NClamp }; + static const char *spv_ops[] = { "spvNMin", "spvNMax", "spvNClamp" }; + bool has_poly = false; + + for (uint32_t i = 0; i < 3; i++) + { + for (uint32_t j = 0; j < 3; j++) + { + if ((polyfills & polys[i][j]) == 0) + continue; + + const char *types[3][4] = { + { "float16_t", "f16vec2", "f16vec3", "f16vec4" }, + { "float", "vec2", "vec3", "vec4" }, + { "double", "dvec2", "dvec3", "dvec4" }, + }; + + for (uint32_t k = 0; k < 4; k++) + { + auto *type = types[j][k]; + + if (i < 2) + { + statement("spirv_instruction(set = \"GLSL.std.450\", id = ", glsl_ops[i], ") ", + type, " ", spv_ops[i], "(", type, ", ", type, ");"); + } + else + { + statement("spirv_instruction(set = \"GLSL.std.450\", id = ", glsl_ops[i], ") ", + type, " ", spv_ops[i], "(", type, ", ", type, ", ", type, ");"); + } + + has_poly = true; + } + } + } + + if (has_poly) + statement(""); + } + else + { + // Mediump intrinsics don't work correctly, so wrap the intrinsic in an outer shell that ensures mediump + // propagation. + + static const Polyfill polys[3][3] = { + { PolyfillNMin16, PolyfillNMin32, PolyfillNMin64 }, + { PolyfillNMax16, PolyfillNMax32, PolyfillNMax64 }, + { PolyfillNClamp16, PolyfillNClamp32, PolyfillNClamp64 }, + }; + + static const char *spv_ops[] = { "spvNMin", "spvNMax", "spvNClamp" }; + + for (uint32_t i = 0; i < 3; i++) + { + for (uint32_t j = 0; j < 3; j++) + { + if ((polyfills & polys[i][j]) == 0) + continue; + + const char *types[3][4] = { + { "float16_t", "f16vec2", "f16vec3", "f16vec4" }, + { "float", "vec2", "vec3", "vec4" }, + { "double", "dvec2", "dvec3", "dvec4" }, + }; + + for (uint32_t k = 0; k < 4; k++) + { + auto *type = types[j][k]; + + if (i < 2) + { + statement("mediump ", type, " ", spv_ops[i], "Relaxed(", + "mediump ", type, " a, mediump ", type, " b)"); + begin_scope(); + statement("mediump ", type, " res = ", spv_ops[i], "(a, b);"); + statement("return res;"); + end_scope(); + statement(""); + } + else + { + statement("mediump ", type, " ", spv_ops[i], "Relaxed(", + "mediump ", type, " a, mediump ", type, " b, mediump ", type, " c)"); + begin_scope(); + statement("mediump ", type, " res = ", spv_ops[i], "(a, b, c);"); + statement("return res;"); + end_scope(); + statement(""); + } + } + } + } + } +} + +// Returns a string representation of the ID, usable as a function arg. +// Default is to simply return the expression representation fo the arg ID. +// Subclasses may override to modify the return value. +string CompilerGLSL::to_func_call_arg(const SPIRFunction::Parameter &arg, uint32_t id) +{ + // BDA expects pointers through function interface. + if (!arg.alias_global_variable && is_physical_or_buffer_pointer(expression_type(id))) + return to_pointer_expression(id); + + // Make sure that we use the name of the original variable, and not the parameter alias. + uint32_t name_id = id; + auto *var = maybe_get(id); + if (var && var->basevariable) + name_id = var->basevariable; + return to_unpacked_expression(name_id); +} + +void CompilerGLSL::force_temporary_and_recompile(uint32_t id) +{ + auto res = forced_temporaries.insert(id); + + // Forcing new temporaries guarantees forward progress. + if (res.second) + force_recompile_guarantee_forward_progress(); + else + force_recompile(); +} + +uint32_t CompilerGLSL::consume_temporary_in_precision_context(uint32_t type_id, uint32_t id, Options::Precision precision) +{ + // Constants do not have innate precision. + auto handle_type = ir.ids[id].get_type(); + if (handle_type == TypeConstant || handle_type == TypeConstantOp || handle_type == TypeUndef) + return id; + + // Ignore anything that isn't 32-bit values. + auto &type = get(type_id); + if (type.pointer) + return id; + if (type.basetype != SPIRType::Float && type.basetype != SPIRType::UInt && type.basetype != SPIRType::Int) + return id; + + if (precision == Options::DontCare) + { + // If precision is consumed as don't care (operations only consisting of constants), + // we need to bind the expression to a temporary, + // otherwise we have no way of controlling the precision later. + auto itr = forced_temporaries.insert(id); + if (itr.second) + force_recompile_guarantee_forward_progress(); + return id; + } + + auto current_precision = has_decoration(id, DecorationRelaxedPrecision) ? Options::Mediump : Options::Highp; + if (current_precision == precision) + return id; + + auto itr = temporary_to_mirror_precision_alias.find(id); + if (itr == temporary_to_mirror_precision_alias.end()) + { + uint32_t alias_id = ir.increase_bound_by(1); + auto &m = ir.meta[alias_id]; + if (auto *input_m = ir.find_meta(id)) + m = *input_m; + + const char *prefix; + if (precision == Options::Mediump) + { + set_decoration(alias_id, DecorationRelaxedPrecision); + prefix = "mp_copy_"; + } + else + { + unset_decoration(alias_id, DecorationRelaxedPrecision); + prefix = "hp_copy_"; + } + + auto alias_name = join(prefix, to_name(id)); + ParsedIR::sanitize_underscores(alias_name); + set_name(alias_id, alias_name); + + emit_op(type_id, alias_id, to_expression(id), true); + temporary_to_mirror_precision_alias[id] = alias_id; + forced_temporaries.insert(id); + forced_temporaries.insert(alias_id); + force_recompile_guarantee_forward_progress(); + id = alias_id; + } + else + { + id = itr->second; + } + + return id; +} + +void CompilerGLSL::handle_invalid_expression(uint32_t id) +{ + // We tried to read an invalidated expression. + // This means we need another pass at compilation, but next time, + // force temporary variables so that they cannot be invalidated. + force_temporary_and_recompile(id); + + // If the invalid expression happened as a result of a CompositeInsert + // overwrite, we must block this from happening next iteration. + if (composite_insert_overwritten.count(id)) + block_composite_insert_overwrite.insert(id); +} + +// Converts the format of the current expression from packed to unpacked, +// by wrapping the expression in a constructor of the appropriate type. +// GLSL does not support packed formats, so simply return the expression. +// Subclasses that do will override. +string CompilerGLSL::unpack_expression_type(string expr_str, const SPIRType &, uint32_t, bool, bool) +{ + return expr_str; +} + +// Sometimes we proactively enclosed an expression where it turns out we might have not needed it after all. +void CompilerGLSL::strip_enclosed_expression(string &expr) +{ + if (expr.size() < 2 || expr.front() != '(' || expr.back() != ')') + return; + + // Have to make sure that our first and last parens actually enclose everything inside it. + uint32_t paren_count = 0; + for (auto &c : expr) + { + if (c == '(') + paren_count++; + else if (c == ')') + { + paren_count--; + + // If we hit 0 and this is not the final char, our first and final parens actually don't + // enclose the expression, and we cannot strip, e.g.: (a + b) * (c + d). + if (paren_count == 0 && &c != &expr.back()) + return; + } + } + expr.erase(expr.size() - 1, 1); + expr.erase(begin(expr)); +} + +bool CompilerGLSL::needs_enclose_expression(const std::string &expr) +{ + bool need_parens = false; + + // If the expression starts with a unary we need to enclose to deal with cases where we have back-to-back + // unary expressions. + if (!expr.empty()) + { + auto c = expr.front(); + if (c == '-' || c == '+' || c == '!' || c == '~' || c == '&' || c == '*') + need_parens = true; + } + + if (!need_parens) + { + uint32_t paren_count = 0; + for (auto c : expr) + { + if (c == '(' || c == '[') + paren_count++; + else if (c == ')' || c == ']') + { + assert(paren_count); + paren_count--; + } + else if (c == ' ' && paren_count == 0) + { + need_parens = true; + break; + } + } + assert(paren_count == 0); + } + + return need_parens; +} + +string CompilerGLSL::enclose_expression(const string &expr) +{ + // If this expression contains any spaces which are not enclosed by parentheses, + // we need to enclose it so we can treat the whole string as an expression. + // This happens when two expressions have been part of a binary op earlier. + if (needs_enclose_expression(expr)) + return join('(', expr, ')'); + else + return expr; +} + +string CompilerGLSL::dereference_expression(const SPIRType &expr_type, const std::string &expr) +{ + // If this expression starts with an address-of operator ('&'), then + // just return the part after the operator. + // TODO: Strip parens if unnecessary? + if (expr.front() == '&') + return expr.substr(1); + else if (backend.native_pointers) + return join('*', expr); + else if (is_physical_pointer(expr_type) && !is_physical_pointer_to_buffer_block(expr_type)) + return join(enclose_expression(expr), ".value"); + else + return expr; +} + +string CompilerGLSL::address_of_expression(const std::string &expr) +{ + if (expr.size() > 3 && expr[0] == '(' && expr[1] == '*' && expr.back() == ')') + { + // If we have an expression which looks like (*foo), taking the address of it is the same as stripping + // the first two and last characters. We might have to enclose the expression. + // This doesn't work for cases like (*foo + 10), + // but this is an r-value expression which we cannot take the address of anyways. + return enclose_expression(expr.substr(2, expr.size() - 3)); + } + else if (expr.front() == '*') + { + // If this expression starts with a dereference operator ('*'), then + // just return the part after the operator. + return expr.substr(1); + } + else + return join('&', enclose_expression(expr)); +} + +// Just like to_expression except that we enclose the expression inside parentheses if needed. +string CompilerGLSL::to_enclosed_expression(uint32_t id, bool register_expression_read) +{ + return enclose_expression(to_expression(id, register_expression_read)); +} + +// Used explicitly when we want to read a row-major expression, but without any transpose shenanigans. +// need_transpose must be forced to false. +string CompilerGLSL::to_unpacked_row_major_matrix_expression(uint32_t id) +{ + return unpack_expression_type(to_expression(id), expression_type(id), + get_extended_decoration(id, SPIRVCrossDecorationPhysicalTypeID), + has_extended_decoration(id, SPIRVCrossDecorationPhysicalTypePacked), true); +} + +string CompilerGLSL::to_unpacked_expression(uint32_t id, bool register_expression_read) +{ + // If we need to transpose, it will also take care of unpacking rules. + auto *e = maybe_get(id); + bool need_transpose = e && e->need_transpose; + bool is_remapped = has_extended_decoration(id, SPIRVCrossDecorationPhysicalTypeID); + bool is_packed = has_extended_decoration(id, SPIRVCrossDecorationPhysicalTypePacked); + + if (!need_transpose && (is_remapped || is_packed)) + { + return unpack_expression_type(to_expression(id, register_expression_read), + get_pointee_type(expression_type_id(id)), + get_extended_decoration(id, SPIRVCrossDecorationPhysicalTypeID), + has_extended_decoration(id, SPIRVCrossDecorationPhysicalTypePacked), false); + } + else + return to_expression(id, register_expression_read); +} + +string CompilerGLSL::to_enclosed_unpacked_expression(uint32_t id, bool register_expression_read) +{ + return enclose_expression(to_unpacked_expression(id, register_expression_read)); +} + +string CompilerGLSL::to_dereferenced_expression(uint32_t id, bool register_expression_read) +{ + auto &type = expression_type(id); + + if (is_pointer(type) && should_dereference(id)) + return dereference_expression(type, to_enclosed_expression(id, register_expression_read)); + else + return to_expression(id, register_expression_read); +} + +string CompilerGLSL::to_pointer_expression(uint32_t id, bool register_expression_read) +{ + auto &type = expression_type(id); + if (is_pointer(type) && expression_is_lvalue(id) && !should_dereference(id)) + return address_of_expression(to_enclosed_expression(id, register_expression_read)); + else + return to_unpacked_expression(id, register_expression_read); +} + +string CompilerGLSL::to_enclosed_pointer_expression(uint32_t id, bool register_expression_read) +{ + auto &type = expression_type(id); + if (is_pointer(type) && expression_is_lvalue(id) && !should_dereference(id)) + return address_of_expression(to_enclosed_expression(id, register_expression_read)); + else + return to_enclosed_unpacked_expression(id, register_expression_read); +} + +string CompilerGLSL::to_extract_component_expression(uint32_t id, uint32_t index) +{ + auto expr = to_enclosed_expression(id); + if (has_extended_decoration(id, SPIRVCrossDecorationPhysicalTypePacked)) + return join(expr, "[", index, "]"); + else + return join(expr, ".", index_to_swizzle(index)); +} + +string CompilerGLSL::to_extract_constant_composite_expression(uint32_t result_type, const SPIRConstant &c, + const uint32_t *chain, uint32_t length) +{ + // It is kinda silly if application actually enter this path since they know the constant up front. + // It is useful here to extract the plain constant directly. + SPIRConstant tmp; + tmp.constant_type = result_type; + auto &composite_type = get(c.constant_type); + assert(composite_type.basetype != SPIRType::Struct && composite_type.array.empty()); + assert(!c.specialization); + + if (is_matrix(composite_type)) + { + if (length == 2) + { + tmp.m.c[0].vecsize = 1; + tmp.m.columns = 1; + tmp.m.c[0].r[0] = c.m.c[chain[0]].r[chain[1]]; + } + else + { + assert(length == 1); + tmp.m.c[0].vecsize = composite_type.vecsize; + tmp.m.columns = 1; + tmp.m.c[0] = c.m.c[chain[0]]; + } + } + else + { + assert(length == 1); + tmp.m.c[0].vecsize = 1; + tmp.m.columns = 1; + tmp.m.c[0].r[0] = c.m.c[0].r[chain[0]]; + } + + return constant_expression(tmp); +} + +string CompilerGLSL::to_rerolled_array_expression(const SPIRType &parent_type, + const string &base_expr, const SPIRType &type) +{ + bool remapped_boolean = parent_type.basetype == SPIRType::Struct && + type.basetype == SPIRType::Boolean && + backend.boolean_in_struct_remapped_type != SPIRType::Boolean; + + SPIRType tmp_type { OpNop }; + if (remapped_boolean) + { + tmp_type = get(type.parent_type); + tmp_type.basetype = backend.boolean_in_struct_remapped_type; + } + else if (type.basetype == SPIRType::Boolean && backend.boolean_in_struct_remapped_type != SPIRType::Boolean) + { + // It's possible that we have an r-value expression that was OpLoaded from a struct. + // We have to reroll this and explicitly cast the input to bool, because the r-value is short. + tmp_type = get(type.parent_type); + remapped_boolean = true; + } + + uint32_t size = to_array_size_literal(type); + auto &parent = get(type.parent_type); + string expr = "{ "; + + for (uint32_t i = 0; i < size; i++) + { + auto subexpr = join(base_expr, "[", convert_to_string(i), "]"); + if (!is_array(parent)) + { + if (remapped_boolean) + subexpr = join(type_to_glsl(tmp_type), "(", subexpr, ")"); + expr += subexpr; + } + else + expr += to_rerolled_array_expression(parent_type, subexpr, parent); + + if (i + 1 < size) + expr += ", "; + } + + expr += " }"; + return expr; +} + +string CompilerGLSL::to_composite_constructor_expression(const SPIRType &parent_type, uint32_t id, bool block_like_type) +{ + auto &type = expression_type(id); + + bool reroll_array = false; + bool remapped_boolean = parent_type.basetype == SPIRType::Struct && + type.basetype == SPIRType::Boolean && + backend.boolean_in_struct_remapped_type != SPIRType::Boolean; + + if (is_array(type)) + { + reroll_array = !backend.array_is_value_type || + (block_like_type && !backend.array_is_value_type_in_buffer_blocks); + + if (remapped_boolean) + { + // Forced to reroll if we have to change bool[] to short[]. + reroll_array = true; + } + } + + if (reroll_array) + { + // For this case, we need to "re-roll" an array initializer from a temporary. + // We cannot simply pass the array directly, since it decays to a pointer and it cannot + // participate in a struct initializer. E.g. + // float arr[2] = { 1.0, 2.0 }; + // Foo foo = { arr }; must be transformed to + // Foo foo = { { arr[0], arr[1] } }; + // The array sizes cannot be deduced from specialization constants since we cannot use any loops. + + // We're only triggering one read of the array expression, but this is fine since arrays have to be declared + // as temporaries anyways. + return to_rerolled_array_expression(parent_type, to_enclosed_expression(id), type); + } + else + { + auto expr = to_unpacked_expression(id); + if (remapped_boolean) + { + auto tmp_type = type; + tmp_type.basetype = backend.boolean_in_struct_remapped_type; + expr = join(type_to_glsl(tmp_type), "(", expr, ")"); + } + + return expr; + } +} + +string CompilerGLSL::to_non_uniform_aware_expression(uint32_t id) +{ + string expr = to_expression(id); + + if (has_decoration(id, DecorationNonUniform)) + convert_non_uniform_expression(expr, id); + + return expr; +} + +string CompilerGLSL::to_atomic_ptr_expression(uint32_t id) +{ + string expr = to_non_uniform_aware_expression(id); + // If we have naked pointer to POD, we need to dereference to get the proper ".value" resolve. + if (should_dereference(id)) + expr = dereference_expression(expression_type(id), expr); + return expr; +} + +string CompilerGLSL::to_expression(uint32_t id, bool register_expression_read) +{ + auto itr = invalid_expressions.find(id); + if (itr != end(invalid_expressions)) + handle_invalid_expression(id); + + if (ir.ids[id].get_type() == TypeExpression) + { + // We might have a more complex chain of dependencies. + // A possible scenario is that we + // + // %1 = OpLoad + // %2 = OpDoSomething %1 %1. here %2 will have a dependency on %1. + // %3 = OpDoSomethingAgain %2 %2. Here %3 will lose the link to %1 since we don't propagate the dependencies like that. + // OpStore %1 %foo // Here we can invalidate %1, and hence all expressions which depend on %1. Only %2 will know since it's part of invalid_expressions. + // %4 = OpDoSomethingAnotherTime %3 %3 // If we forward all expressions we will see %1 expression after store, not before. + // + // However, we can propagate up a list of depended expressions when we used %2, so we can check if %2 is invalid when reading %3 after the store, + // and see that we should not forward reads of the original variable. + auto &expr = get(id); + for (uint32_t dep : expr.expression_dependencies) + if (invalid_expressions.find(dep) != end(invalid_expressions)) + handle_invalid_expression(dep); + } + + if (register_expression_read) + track_expression_read(id); + + switch (ir.ids[id].get_type()) + { + case TypeExpression: + { + auto &e = get(id); + if (e.base_expression) + return to_enclosed_expression(e.base_expression) + e.expression; + else if (e.need_transpose) + { + // This should not be reached for access chains, since we always deal explicitly with transpose state + // when consuming an access chain expression. + uint32_t physical_type_id = get_extended_decoration(id, SPIRVCrossDecorationPhysicalTypeID); + bool is_packed = has_extended_decoration(id, SPIRVCrossDecorationPhysicalTypePacked); + bool relaxed = has_decoration(id, DecorationRelaxedPrecision); + return convert_row_major_matrix(e.expression, get(e.expression_type), physical_type_id, + is_packed, relaxed); + } + else if (flattened_structs.count(id)) + { + return load_flattened_struct(e.expression, get(e.expression_type)); + } + else + { + if (is_forcing_recompilation()) + { + // During first compilation phase, certain expression patterns can trigger exponential growth of memory. + // Avoid this by returning dummy expressions during this phase. + // Do not use empty expressions here, because those are sentinels for other cases. + return "_"; + } + else + return e.expression; + } + } + + case TypeConstant: + { + auto &c = get(id); + auto &type = get(c.constant_type); + + // WorkGroupSize may be a constant. + if (has_decoration(c.self, DecorationBuiltIn)) + return builtin_to_glsl(BuiltIn(get_decoration(c.self, DecorationBuiltIn)), StorageClassGeneric); + else if (c.specialization) + { + if (backend.workgroup_size_is_hidden) + { + int wg_index = get_constant_mapping_to_workgroup_component(c); + if (wg_index >= 0) + { + auto wg_size = join(builtin_to_glsl(BuiltInWorkgroupSize, StorageClassInput), vector_swizzle(1, wg_index)); + if (type.basetype != SPIRType::UInt) + wg_size = bitcast_expression(type, SPIRType::UInt, wg_size); + return wg_size; + } + } + + if (expression_is_forwarded(id)) + return constant_expression(c); + + return to_name(id); + } + else if (c.is_used_as_lut) + return to_name(id); + else if (type.basetype == SPIRType::Struct && !backend.can_declare_struct_inline) + return to_name(id); + else if (!type.array.empty() && !backend.can_declare_arrays_inline) + return to_name(id); + else + return constant_expression(c); + } + + case TypeConstantOp: + return to_name(id); + + case TypeVariable: + { + auto &var = get(id); + // If we try to use a loop variable before the loop header, we have to redirect it to the static expression, + // the variable has not been declared yet. + if (var.statically_assigned || (var.loop_variable && !var.loop_variable_enable)) + { + // We might try to load from a loop variable before it has been initialized. + // Prefer static expression and fallback to initializer. + if (var.static_expression) + return to_expression(var.static_expression); + else if (var.initializer) + return to_expression(var.initializer); + else + { + // We cannot declare the variable yet, so have to fake it. + uint32_t undef_id = ir.increase_bound_by(1); + return emit_uninitialized_temporary_expression(get_variable_data_type_id(var), undef_id).expression; + } + } + else if (var.deferred_declaration) + { + var.deferred_declaration = false; + return variable_decl(var); + } + else if (flattened_structs.count(id)) + { + return load_flattened_struct(to_name(id), get(var.basetype)); + } + else + { + auto &dec = ir.meta[var.self].decoration; + if (dec.builtin) + return builtin_to_glsl(dec.builtin_type, var.storage); + else + return to_name(id); + } + } + + case TypeCombinedImageSampler: + // This type should never be taken the expression of directly. + // The intention is that texture sampling functions will extract the image and samplers + // separately and take their expressions as needed. + // GLSL does not use this type because OpSampledImage immediately creates a combined image sampler + // expression ala sampler2D(texture, sampler). + SPIRV_CROSS_THROW("Combined image samplers have no default expression representation."); + + case TypeAccessChain: + // We cannot express this type. They only have meaning in other OpAccessChains, OpStore or OpLoad. + SPIRV_CROSS_THROW("Access chains have no default expression representation."); + + default: + return to_name(id); + } +} + +SmallVector CompilerGLSL::get_composite_constant_ids(ConstantID const_id) +{ + if (auto *constant = maybe_get(const_id)) + { + const auto &type = get(constant->constant_type); + if (is_array(type) || type.basetype == SPIRType::Struct) + return constant->subconstants; + if (is_matrix(type)) + return SmallVector(constant->m.id); + if (is_vector(type)) + return SmallVector(constant->m.c[0].id); + SPIRV_CROSS_THROW("Unexpected scalar constant!"); + } + if (!const_composite_insert_ids.count(const_id)) + SPIRV_CROSS_THROW("Unimplemented for this OpSpecConstantOp!"); + return const_composite_insert_ids[const_id]; +} + +void CompilerGLSL::fill_composite_constant(SPIRConstant &constant, TypeID type_id, + const SmallVector &initializers) +{ + auto &type = get(type_id); + constant.specialization = true; + if (is_array(type) || type.basetype == SPIRType::Struct) + { + constant.subconstants = initializers; + } + else if (is_matrix(type)) + { + constant.m.columns = type.columns; + for (uint32_t i = 0; i < type.columns; ++i) + { + constant.m.id[i] = initializers[i]; + constant.m.c[i].vecsize = type.vecsize; + } + } + else if (is_vector(type)) + { + constant.m.c[0].vecsize = type.vecsize; + for (uint32_t i = 0; i < type.vecsize; ++i) + constant.m.c[0].id[i] = initializers[i]; + } + else + SPIRV_CROSS_THROW("Unexpected scalar in SpecConstantOp CompositeInsert!"); +} + +void CompilerGLSL::set_composite_constant(ConstantID const_id, TypeID type_id, + const SmallVector &initializers) +{ + if (maybe_get(const_id)) + { + const_composite_insert_ids[const_id] = initializers; + return; + } + + auto &constant = set(const_id, type_id); + fill_composite_constant(constant, type_id, initializers); + forwarded_temporaries.insert(const_id); +} + +TypeID CompilerGLSL::get_composite_member_type(TypeID type_id, uint32_t member_idx) +{ + auto &type = get(type_id); + if (is_array(type)) + return type.parent_type; + if (type.basetype == SPIRType::Struct) + return type.member_types[member_idx]; + if (is_matrix(type)) + return type.parent_type; + if (is_vector(type)) + return type.parent_type; + SPIRV_CROSS_THROW("Shouldn't reach lower than vector handling OpSpecConstantOp CompositeInsert!"); +} + +string CompilerGLSL::constant_op_expression(const SPIRConstantOp &cop) +{ + auto &type = get(cop.basetype); + bool binary = false; + bool unary = false; + string op; + + if (is_legacy() && is_unsigned_opcode(cop.opcode)) + SPIRV_CROSS_THROW("Unsigned integers are not supported on legacy targets."); + + // TODO: Find a clean way to reuse emit_instruction. + switch (cop.opcode) + { + case OpSConvert: + case OpUConvert: + case OpFConvert: + op = type_to_glsl_constructor(type); + break; + +#define GLSL_BOP(opname, x) \ + case Op##opname: \ + binary = true; \ + op = x; \ + break + +#define GLSL_UOP(opname, x) \ + case Op##opname: \ + unary = true; \ + op = x; \ + break + + GLSL_UOP(SNegate, "-"); + GLSL_UOP(Not, "~"); + GLSL_BOP(IAdd, "+"); + GLSL_BOP(ISub, "-"); + GLSL_BOP(IMul, "*"); + GLSL_BOP(SDiv, "/"); + GLSL_BOP(UDiv, "/"); + GLSL_BOP(UMod, "%"); + GLSL_BOP(SMod, "%"); + GLSL_BOP(ShiftRightLogical, ">>"); + GLSL_BOP(ShiftRightArithmetic, ">>"); + GLSL_BOP(ShiftLeftLogical, "<<"); + GLSL_BOP(BitwiseOr, "|"); + GLSL_BOP(BitwiseXor, "^"); + GLSL_BOP(BitwiseAnd, "&"); + GLSL_BOP(LogicalOr, "||"); + GLSL_BOP(LogicalAnd, "&&"); + GLSL_UOP(LogicalNot, "!"); + GLSL_BOP(LogicalEqual, "=="); + GLSL_BOP(LogicalNotEqual, "!="); + GLSL_BOP(IEqual, "=="); + GLSL_BOP(INotEqual, "!="); + GLSL_BOP(ULessThan, "<"); + GLSL_BOP(SLessThan, "<"); + GLSL_BOP(ULessThanEqual, "<="); + GLSL_BOP(SLessThanEqual, "<="); + GLSL_BOP(UGreaterThan, ">"); + GLSL_BOP(SGreaterThan, ">"); + GLSL_BOP(UGreaterThanEqual, ">="); + GLSL_BOP(SGreaterThanEqual, ">="); + + case OpSRem: + { + uint32_t op0 = cop.arguments[0]; + uint32_t op1 = cop.arguments[1]; + return join(to_enclosed_expression(op0), " - ", to_enclosed_expression(op1), " * ", "(", + to_enclosed_expression(op0), " / ", to_enclosed_expression(op1), ")"); + } + + case OpSelect: + { + if (cop.arguments.size() < 3) + SPIRV_CROSS_THROW("Not enough arguments to OpSpecConstantOp."); + + // This one is pretty annoying. It's triggered from + // uint(bool), int(bool) from spec constants. + // In order to preserve its compile-time constness in Vulkan GLSL, + // we need to reduce the OpSelect expression back to this simplified model. + // If we cannot, fail. + if (to_trivial_mix_op(type, op, cop.arguments[2], cop.arguments[1], cop.arguments[0])) + { + // Implement as a simple cast down below. + } + else + { + // Implement a ternary and pray the compiler understands it :) + return to_ternary_expression(type, cop.arguments[0], cop.arguments[1], cop.arguments[2]); + } + break; + } + + case OpVectorShuffle: + { + string expr = type_to_glsl_constructor(type); + expr += "("; + + uint32_t left_components = expression_type(cop.arguments[0]).vecsize; + string left_arg = to_enclosed_expression(cop.arguments[0]); + string right_arg = to_enclosed_expression(cop.arguments[1]); + + for (uint32_t i = 2; i < uint32_t(cop.arguments.size()); i++) + { + uint32_t index = cop.arguments[i]; + if (index == 0xFFFFFFFF) + { + SPIRConstant c; + c.constant_type = type.parent_type; + assert(type.parent_type != ID(0)); + expr += constant_expression(c); + } + else if (index >= left_components) + { + expr += right_arg + "." + "xyzw"[index - left_components]; + } + else + { + expr += left_arg + "." + "xyzw"[index]; + } + + if (i + 1 < uint32_t(cop.arguments.size())) + expr += ", "; + } + + expr += ")"; + return expr; + } + + case OpCompositeExtract: + { + // Trivial vector extracts (of WorkGroupSize typically), + // punch through to the input spec constant if the composite is used as array size. + const auto *c = maybe_get(cop.arguments[0]); + + string expr; + if (c && cop.arguments.size() == 2 && c->is_used_as_array_length && + !backend.supports_spec_constant_array_size && + is_vector(get(c->constant_type))) + { + expr = to_expression(c->specialization_constant_id(0, cop.arguments[1])); + } + else + { + expr = access_chain_internal(cop.arguments[0], &cop.arguments[1], uint32_t(cop.arguments.size() - 1), + ACCESS_CHAIN_INDEX_IS_LITERAL_BIT, nullptr); + } + return expr; + } + + case OpCompositeInsert: + { + SmallVector new_init = get_composite_constant_ids(cop.arguments[1]); + uint32_t idx; + uint32_t target_id = cop.self; + uint32_t target_type_id = cop.basetype; + // We have to drill down to the part we want to modify, and create new + // constants for each containing part. + for (idx = 2; idx < cop.arguments.size() - 1; ++idx) + { + uint32_t new_const = ir.increase_bound_by(1); + uint32_t old_const = new_init[cop.arguments[idx]]; + new_init[cop.arguments[idx]] = new_const; + set_composite_constant(target_id, target_type_id, new_init); + new_init = get_composite_constant_ids(old_const); + target_id = new_const; + target_type_id = get_composite_member_type(target_type_id, cop.arguments[idx]); + } + // Now replace the initializer with the one from this instruction. + new_init[cop.arguments[idx]] = cop.arguments[0]; + set_composite_constant(target_id, target_type_id, new_init); + SPIRConstant tmp_const(cop.basetype); + fill_composite_constant(tmp_const, cop.basetype, const_composite_insert_ids[cop.self]); + return constant_expression(tmp_const); + } + + default: + // Some opcodes are unimplemented here, these are currently not possible to test from glslang. + SPIRV_CROSS_THROW("Unimplemented spec constant op."); + } + + uint32_t bit_width = 0; + if (unary || binary || cop.opcode == OpSConvert || cop.opcode == OpUConvert) + bit_width = expression_type(cop.arguments[0]).width; + + SPIRType::BaseType input_type; + bool skip_cast_if_equal_type = opcode_is_sign_invariant(cop.opcode); + + switch (cop.opcode) + { + case OpIEqual: + case OpINotEqual: + input_type = to_signed_basetype(bit_width); + break; + + case OpSLessThan: + case OpSLessThanEqual: + case OpSGreaterThan: + case OpSGreaterThanEqual: + case OpSMod: + case OpSDiv: + case OpShiftRightArithmetic: + case OpSConvert: + case OpSNegate: + input_type = to_signed_basetype(bit_width); + break; + + case OpULessThan: + case OpULessThanEqual: + case OpUGreaterThan: + case OpUGreaterThanEqual: + case OpUMod: + case OpUDiv: + case OpShiftRightLogical: + case OpUConvert: + input_type = to_unsigned_basetype(bit_width); + break; + + default: + input_type = type.basetype; + break; + } + +#undef GLSL_BOP +#undef GLSL_UOP + if (binary) + { + if (cop.arguments.size() < 2) + SPIRV_CROSS_THROW("Not enough arguments to OpSpecConstantOp."); + + string cast_op0; + string cast_op1; + auto expected_type = binary_op_bitcast_helper(cast_op0, cast_op1, input_type, cop.arguments[0], + cop.arguments[1], skip_cast_if_equal_type); + + if (type.basetype != input_type && type.basetype != SPIRType::Boolean) + { + expected_type.basetype = input_type; + auto expr = bitcast_glsl_op(type, expected_type); + expr += '('; + expr += join(cast_op0, " ", op, " ", cast_op1); + expr += ')'; + return expr; + } + else + return join("(", cast_op0, " ", op, " ", cast_op1, ")"); + } + else if (unary) + { + if (cop.arguments.size() < 1) + SPIRV_CROSS_THROW("Not enough arguments to OpSpecConstantOp."); + + // Auto-bitcast to result type as needed. + // Works around various casting scenarios in glslang as there is no OpBitcast for specialization constants. + return join("(", op, bitcast_glsl(type, cop.arguments[0]), ")"); + } + else if (cop.opcode == OpSConvert || cop.opcode == OpUConvert) + { + if (cop.arguments.size() < 1) + SPIRV_CROSS_THROW("Not enough arguments to OpSpecConstantOp."); + + auto &arg_type = expression_type(cop.arguments[0]); + if (arg_type.width < type.width && input_type != arg_type.basetype) + { + auto expected = arg_type; + expected.basetype = input_type; + return join(op, "(", bitcast_glsl(expected, cop.arguments[0]), ")"); + } + else + return join(op, "(", to_expression(cop.arguments[0]), ")"); + } + else + { + if (cop.arguments.size() < 1) + SPIRV_CROSS_THROW("Not enough arguments to OpSpecConstantOp."); + return join(op, "(", to_expression(cop.arguments[0]), ")"); + } +} + +string CompilerGLSL::constant_expression(const SPIRConstant &c, + bool inside_block_like_struct_scope, + bool inside_struct_scope) +{ + auto &type = get(c.constant_type); + + if (is_pointer(type)) + { + return backend.null_pointer_literal; + } + else if (c.is_null_array_specialized_length && backend.requires_matching_array_initializer) + { + require_extension_internal("GL_EXT_null_initializer"); + return backend.constant_null_initializer; + } + else if (c.replicated && type.op != OpTypeArray) + { + if (type.op == OpTypeMatrix) + { + uint32_t num_elements = type.columns; + // GLSL does not allow the replication constructor for matrices + // mat4(vec4(0.0)) needs to be manually expanded to mat4(vec4(0.0), vec4(0.0), vec4(0.0), vec4(0.0)); + std::string res; + res += type_to_glsl(type); + res += "("; + for (uint32_t i = 0; i < num_elements; i++) + { + res += to_expression(c.subconstants[0]); + if (i < num_elements - 1) + res += ", "; + } + res += ")"; + return res; + } + else + { + return join(type_to_glsl(type), "(", to_expression(c.subconstants[0]), ")"); + } + } + else if (!c.subconstants.empty()) + { + // Handles Arrays and structures. + string res; + + // Only consider the decay if we are inside a struct scope where we are emitting a member with Offset decoration. + // Outside a block-like struct declaration, we can always bind to a constant array with templated type. + // Should look at ArrayStride here as well, but it's possible to declare a constant struct + // with Offset = 0, using no ArrayStride on the enclosed array type. + // A particular CTS test hits this scenario. + bool array_type_decays = inside_block_like_struct_scope && + is_array(type) && + !backend.array_is_value_type_in_buffer_blocks; + + // Allow Metal to use the array template to make arrays a value type + bool needs_trailing_tracket = false; + if (backend.use_initializer_list && backend.use_typed_initializer_list && type.basetype == SPIRType::Struct && + !is_array(type)) + { + res = type_to_glsl_constructor(type) + "{ "; + } + else if (backend.use_initializer_list && backend.use_typed_initializer_list && backend.array_is_value_type && + is_array(type) && !array_type_decays) + { + const auto *p_type = &type; + SPIRType tmp_type { OpNop }; + + if (inside_struct_scope && + backend.boolean_in_struct_remapped_type != SPIRType::Boolean && + type.basetype == SPIRType::Boolean) + { + tmp_type = type; + tmp_type.basetype = backend.boolean_in_struct_remapped_type; + p_type = &tmp_type; + } + + res = type_to_glsl_constructor(*p_type) + "({ "; + needs_trailing_tracket = true; + } + else if (backend.use_initializer_list) + { + res = "{ "; + } + else + { + res = type_to_glsl_constructor(type) + "("; + } + + uint32_t subconstant_index = 0; + size_t num_elements = c.subconstants.size(); + if (c.replicated) + { + if (type.array.size() != 1) + SPIRV_CROSS_THROW("Multidimensional arrays not yet supported as replicated constans"); + num_elements = type.array[0]; + } + for (size_t i = 0; i < num_elements; i++) + { + auto &elem = c.subconstants[c.replicated ? 0 : i]; + if (auto *op = maybe_get(elem)) + { + res += constant_op_expression(*op); + } + else if (maybe_get(elem) != nullptr) + { + res += to_name(elem); + } + else + { + auto &subc = get(elem); + if (subc.specialization && !expression_is_forwarded(elem)) + res += to_name(elem); + else + { + if (!is_array(type) && type.basetype == SPIRType::Struct) + { + // When we get down to emitting struct members, override the block-like information. + // For constants, we can freely mix and match block-like state. + inside_block_like_struct_scope = + has_member_decoration(type.self, subconstant_index, DecorationOffset); + } + + if (type.basetype == SPIRType::Struct) + inside_struct_scope = true; + + res += constant_expression(subc, inside_block_like_struct_scope, inside_struct_scope); + } + } + + if (i != num_elements - 1) + res += ", "; + + subconstant_index++; + } + + res += backend.use_initializer_list ? " }" : ")"; + if (needs_trailing_tracket) + res += ")"; + + return res; + } + else if (type.basetype == SPIRType::Struct && type.member_types.size() == 0) + { + // Metal tessellation likes empty structs which are then constant expressions. + if (backend.supports_empty_struct) + return "{ }"; + else if (backend.use_typed_initializer_list) + return join(type_to_glsl(type), "{ 0 }"); + else if (backend.use_initializer_list) + return "{ 0 }"; + else + return join(type_to_glsl(type), "(0)"); + } + else if (c.columns() == 1 && type.op != OpTypeCooperativeMatrixKHR) + { + auto res = constant_expression_vector(c, 0); + + if (inside_struct_scope && + backend.boolean_in_struct_remapped_type != SPIRType::Boolean && + type.basetype == SPIRType::Boolean) + { + SPIRType tmp_type = type; + tmp_type.basetype = backend.boolean_in_struct_remapped_type; + res = join(type_to_glsl(tmp_type), "(", res, ")"); + } + + return res; + } + else + { + string res = type_to_glsl(type) + "("; + for (uint32_t col = 0; col < c.columns(); col++) + { + if (c.specialization_constant_id(col) != 0) + res += to_name(c.specialization_constant_id(col)); + else + res += constant_expression_vector(c, col); + + if (col + 1 < c.columns()) + res += ", "; + } + res += ")"; + + if (inside_struct_scope && + backend.boolean_in_struct_remapped_type != SPIRType::Boolean && + type.basetype == SPIRType::Boolean) + { + SPIRType tmp_type = type; + tmp_type.basetype = backend.boolean_in_struct_remapped_type; + res = join(type_to_glsl(tmp_type), "(", res, ")"); + } + + return res; + } +} + +#ifdef _MSC_VER +// snprintf does not exist or is buggy on older MSVC versions, some of them +// being used by MinGW. Use sprintf instead and disable corresponding warning. +#pragma warning(push) +#pragma warning(disable : 4996) +#endif + +string CompilerGLSL::convert_floate4m3_to_string(const SPIRConstant &c, uint32_t col, uint32_t row) +{ + string res; + float float_value = c.scalar_floate4m3(col, row); + + // There is no infinity in e4m3. + if (std::isnan(float_value)) + { + SPIRType type { OpTypeFloat }; + type.basetype = SPIRType::Half; + type.vecsize = 1; + type.columns = 1; + res = join(type_to_glsl(type), "(0.0 / 0.0)"); + } + else + { + SPIRType type { OpTypeFloat }; + type.basetype = SPIRType::FloatE4M3; + type.vecsize = 1; + type.columns = 1; + res = join(type_to_glsl(type), "(", format_float(float_value), ")"); + } + + return res; +} + +string CompilerGLSL::convert_half_to_string(const SPIRConstant &c, uint32_t col, uint32_t row) +{ + string res; + bool is_bfloat8 = get(c.constant_type).basetype == SPIRType::FloatE5M2; + float float_value = is_bfloat8 ? c.scalar_bf8(col, row) : c.scalar_f16(col, row); + + // There is no literal "hf" in GL_NV_gpu_shader5, so to avoid lots + // of complicated workarounds, just value-cast to the half type always. + if (std::isnan(float_value) || std::isinf(float_value)) + { + SPIRType type { OpTypeFloat }; + type.basetype = is_bfloat8 ? SPIRType::FloatE5M2 : SPIRType::Half; + type.vecsize = 1; + type.columns = 1; + + if (float_value == numeric_limits::infinity()) + res = join(type_to_glsl(type), "(1.0 / 0.0)"); + else if (float_value == -numeric_limits::infinity()) + res = join(type_to_glsl(type), "(-1.0 / 0.0)"); + else if (std::isnan(float_value)) + res = join(type_to_glsl(type), "(0.0 / 0.0)"); + else + SPIRV_CROSS_THROW("Cannot represent non-finite floating point constant."); + } + else + { + SPIRType type { OpTypeFloat }; + type.basetype = is_bfloat8 ? SPIRType::FloatE5M2 : SPIRType::Half; + type.vecsize = 1; + type.columns = 1; + res = join(type_to_glsl(type), "(", format_float(float_value), ")"); + } + + return res; +} + +string CompilerGLSL::convert_float_to_string(const SPIRConstant &c, uint32_t col, uint32_t row) +{ + string res; + + bool is_bfloat16 = get(c.constant_type).basetype == SPIRType::BFloat16; + float float_value = is_bfloat16 ? c.scalar_bf16(col, row) : c.scalar_f32(col, row); + + if (std::isnan(float_value) || std::isinf(float_value)) + { + // Use special representation. + if (!is_legacy()) + { + SPIRType out_type { OpTypeFloat }; + SPIRType in_type { OpTypeInt }; + out_type.basetype = SPIRType::Float; + in_type.basetype = SPIRType::UInt; + out_type.vecsize = 1; + in_type.vecsize = 1; + out_type.width = 32; + in_type.width = 32; + + char print_buffer[32]; +#ifdef _WIN32 + sprintf(print_buffer, "0x%xu", c.scalar(col, row)); +#else + snprintf(print_buffer, sizeof(print_buffer), "0x%xu", c.scalar(col, row)); +#endif + + const char *comment = "inf"; + if (float_value == -numeric_limits::infinity()) + comment = "-inf"; + else if (std::isnan(float_value)) + comment = "nan"; + res = join(bitcast_glsl_op(out_type, in_type), "(", print_buffer, " /* ", comment, " */)"); + } + else + { + if (float_value == numeric_limits::infinity()) + { + if (backend.float_literal_suffix) + res = "(1.0f / 0.0f)"; + else + res = "(1.0 / 0.0)"; + } + else if (float_value == -numeric_limits::infinity()) + { + if (backend.float_literal_suffix) + res = "(-1.0f / 0.0f)"; + else + res = "(-1.0 / 0.0)"; + } + else if (std::isnan(float_value)) + { + if (backend.float_literal_suffix) + res = "(0.0f / 0.0f)"; + else + res = "(0.0 / 0.0)"; + } + else + SPIRV_CROSS_THROW("Cannot represent non-finite floating point constant."); + } + } + else + { + res = format_float(float_value); + if (backend.float_literal_suffix) + res += "f"; + } + + if (is_bfloat16) + res = join("bfloat16_t(", res, ")"); + + return res; +} + +std::string CompilerGLSL::convert_double_to_string(const SPIRConstant &c, uint32_t col, uint32_t row) +{ + string res; + double double_value = c.scalar_f64(col, row); + + if (std::isnan(double_value) || std::isinf(double_value)) + { + // Use special representation. + if (!is_legacy()) + { + SPIRType out_type { OpTypeFloat }; + SPIRType in_type { OpTypeInt }; + out_type.basetype = SPIRType::Double; + in_type.basetype = SPIRType::UInt64; + out_type.vecsize = 1; + in_type.vecsize = 1; + out_type.width = 64; + in_type.width = 64; + + uint64_t u64_value = c.scalar_u64(col, row); + + if (options.es && options.version < 310) // GL_NV_gpu_shader5 fallback requires 310. + SPIRV_CROSS_THROW("64-bit integers not supported in ES profile before version 310."); + require_extension_internal("GL_ARB_gpu_shader_int64"); + + char print_buffer[64]; +#ifdef _WIN32 + sprintf(print_buffer, "0x%llx%s", static_cast(u64_value), + backend.long_long_literal_suffix ? "ull" : "ul"); +#else + snprintf(print_buffer, sizeof(print_buffer), "0x%llx%s", static_cast(u64_value), + backend.long_long_literal_suffix ? "ull" : "ul"); +#endif + + const char *comment = "inf"; + if (double_value == -numeric_limits::infinity()) + comment = "-inf"; + else if (std::isnan(double_value)) + comment = "nan"; + res = join(bitcast_glsl_op(out_type, in_type), "(", print_buffer, " /* ", comment, " */)"); + } + else + { + if (options.es) + SPIRV_CROSS_THROW("FP64 not supported in ES profile."); + if (options.version < 400) + require_extension_internal("GL_ARB_gpu_shader_fp64"); + + if (double_value == numeric_limits::infinity()) + { + if (backend.double_literal_suffix) + res = "(1.0lf / 0.0lf)"; + else + res = "(1.0 / 0.0)"; + } + else if (double_value == -numeric_limits::infinity()) + { + if (backend.double_literal_suffix) + res = "(-1.0lf / 0.0lf)"; + else + res = "(-1.0 / 0.0)"; + } + else if (std::isnan(double_value)) + { + if (backend.double_literal_suffix) + res = "(0.0lf / 0.0lf)"; + else + res = "(0.0 / 0.0)"; + } + else + SPIRV_CROSS_THROW("Cannot represent non-finite floating point constant."); + } + } + else + { + res = format_double(double_value); + if (backend.double_literal_suffix) + res += "lf"; + } + + return res; +} + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t vector) +{ + auto type = get(c.constant_type); + type.columns = 1; + + auto scalar_type = type; + scalar_type.vecsize = 1; + + string res; + bool splat = backend.use_constructor_splatting && c.vector_size() > 1; + bool swizzle_splat = backend.can_swizzle_scalar && c.vector_size() > 1; + + if (!type_is_floating_point(type)) + { + // Cannot swizzle literal integers as a special case. + swizzle_splat = false; + } + + if (splat || swizzle_splat) + { + // Cannot use constant splatting if we have specialization constants somewhere in the vector. + for (uint32_t i = 0; i < c.vector_size(); i++) + { + if (c.specialization_constant_id(vector, i) != 0) + { + splat = false; + swizzle_splat = false; + break; + } + } + } + + if (splat || swizzle_splat) + { + if (type.width == 64) + { + uint64_t ident = c.scalar_u64(vector, 0); + for (uint32_t i = 1; i < c.vector_size(); i++) + { + if (ident != c.scalar_u64(vector, i)) + { + splat = false; + swizzle_splat = false; + break; + } + } + } + else + { + uint32_t ident = c.scalar(vector, 0); + for (uint32_t i = 1; i < c.vector_size(); i++) + { + if (ident != c.scalar(vector, i)) + { + splat = false; + swizzle_splat = false; + } + } + } + } + + if (c.vector_size() > 1 && !swizzle_splat) + res += type_to_glsl(type) + "("; + + switch (type.basetype) + { + case SPIRType::FloatE4M3: + if (splat || swizzle_splat) + { + res += convert_floate4m3_to_string(c, vector, 0); + if (swizzle_splat) + res = remap_swizzle(get(c.constant_type), 1, res); + } + else + { + for (uint32_t i = 0; i < c.vector_size(); i++) + { + if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0) + res += to_expression(c.specialization_constant_id(vector, i)); + else + res += convert_floate4m3_to_string(c, vector, i); + + if (i + 1 < c.vector_size()) + res += ", "; + } + } + break; + + case SPIRType::FloatE5M2: + case SPIRType::Half: + if (splat || swizzle_splat) + { + res += convert_half_to_string(c, vector, 0); + if (swizzle_splat) + res = remap_swizzle(get(c.constant_type), 1, res); + } + else + { + for (uint32_t i = 0; i < c.vector_size(); i++) + { + if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0) + res += to_expression(c.specialization_constant_id(vector, i)); + else + res += convert_half_to_string(c, vector, i); + + if (i + 1 < c.vector_size()) + res += ", "; + } + } + break; + + case SPIRType::BFloat16: + case SPIRType::Float: + if (splat || swizzle_splat) + { + res += convert_float_to_string(c, vector, 0); + if (swizzle_splat) + res = remap_swizzle(get(c.constant_type), 1, res); + } + else + { + for (uint32_t i = 0; i < c.vector_size(); i++) + { + if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0) + res += to_expression(c.specialization_constant_id(vector, i)); + else + res += convert_float_to_string(c, vector, i); + + if (i + 1 < c.vector_size()) + res += ", "; + } + } + break; + + case SPIRType::Double: + if (splat || swizzle_splat) + { + res += convert_double_to_string(c, vector, 0); + if (swizzle_splat) + res = remap_swizzle(get(c.constant_type), 1, res); + } + else + { + for (uint32_t i = 0; i < c.vector_size(); i++) + { + if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0) + res += to_expression(c.specialization_constant_id(vector, i)); + else + res += convert_double_to_string(c, vector, i); + + if (i + 1 < c.vector_size()) + res += ", "; + } + } + break; + + case SPIRType::Int64: + { + auto tmp = type; + tmp.vecsize = 1; + tmp.columns = 1; + auto int64_type = type_to_glsl(tmp); + + if (splat) + { + res += convert_to_string(c.scalar_i64(vector, 0), int64_type, backend.long_long_literal_suffix); + } + else + { + for (uint32_t i = 0; i < c.vector_size(); i++) + { + if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0) + res += to_expression(c.specialization_constant_id(vector, i)); + else + res += convert_to_string(c.scalar_i64(vector, i), int64_type, backend.long_long_literal_suffix); + + if (i + 1 < c.vector_size()) + res += ", "; + } + } + break; + } + + case SPIRType::UInt64: + if (splat) + { + res += convert_to_string(c.scalar_u64(vector, 0)); + if (backend.long_long_literal_suffix) + res += "ull"; + else + res += "ul"; + } + else + { + for (uint32_t i = 0; i < c.vector_size(); i++) + { + if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0) + res += to_expression(c.specialization_constant_id(vector, i)); + else + { + res += convert_to_string(c.scalar_u64(vector, i)); + if (backend.long_long_literal_suffix) + res += "ull"; + else + res += "ul"; + } + + if (i + 1 < c.vector_size()) + res += ", "; + } + } + break; + + case SPIRType::UInt: + if (splat) + { + res += convert_to_string(c.scalar(vector, 0)); + if (is_legacy() && !has_extension("GL_EXT_gpu_shader4")) + { + // Fake unsigned constant literals with signed ones if possible. + // Things like array sizes, etc, tend to be unsigned even though they could just as easily be signed. + if (c.scalar_i32(vector, 0) < 0) + SPIRV_CROSS_THROW("Tried to convert uint literal into int, but this made the literal negative."); + } + else if (backend.uint32_t_literal_suffix) + res += "u"; + } + else + { + for (uint32_t i = 0; i < c.vector_size(); i++) + { + if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0) + res += to_expression(c.specialization_constant_id(vector, i)); + else + { + res += convert_to_string(c.scalar(vector, i)); + if (is_legacy() && !has_extension("GL_EXT_gpu_shader4")) + { + // Fake unsigned constant literals with signed ones if possible. + // Things like array sizes, etc, tend to be unsigned even though they could just as easily be signed. + if (c.scalar_i32(vector, i) < 0) + SPIRV_CROSS_THROW("Tried to convert uint literal into int, but this made " + "the literal negative."); + } + else if (backend.uint32_t_literal_suffix) + res += "u"; + } + + if (i + 1 < c.vector_size()) + res += ", "; + } + } + break; + + case SPIRType::Int: + if (splat) + res += convert_to_string(c.scalar_i32(vector, 0)); + else + { + for (uint32_t i = 0; i < c.vector_size(); i++) + { + if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0) + res += to_expression(c.specialization_constant_id(vector, i)); + else + res += convert_to_string(c.scalar_i32(vector, i)); + if (i + 1 < c.vector_size()) + res += ", "; + } + } + break; + + case SPIRType::UShort: + if (splat) + { + res += convert_to_string(c.scalar(vector, 0)); + } + else + { + for (uint32_t i = 0; i < c.vector_size(); i++) + { + if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0) + res += to_expression(c.specialization_constant_id(vector, i)); + else + { + if (*backend.uint16_t_literal_suffix) + { + res += convert_to_string(c.scalar_u16(vector, i)); + res += backend.uint16_t_literal_suffix; + } + else + { + // If backend doesn't have a literal suffix, we need to value cast. + res += type_to_glsl(scalar_type); + res += "("; + res += convert_to_string(c.scalar_u16(vector, i)); + res += ")"; + } + } + + if (i + 1 < c.vector_size()) + res += ", "; + } + } + break; + + case SPIRType::Short: + if (splat) + { + res += convert_to_string(c.scalar_i16(vector, 0)); + } + else + { + for (uint32_t i = 0; i < c.vector_size(); i++) + { + if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0) + res += to_expression(c.specialization_constant_id(vector, i)); + else + { + if (*backend.int16_t_literal_suffix) + { + res += convert_to_string(c.scalar_i16(vector, i)); + res += backend.int16_t_literal_suffix; + } + else + { + // If backend doesn't have a literal suffix, we need to value cast. + res += type_to_glsl(scalar_type); + res += "("; + res += convert_to_string(c.scalar_i16(vector, i)); + res += ")"; + } + } + + if (i + 1 < c.vector_size()) + res += ", "; + } + } + break; + + case SPIRType::UByte: + if (splat) + { + res += convert_to_string(c.scalar_u8(vector, 0)); + } + else + { + for (uint32_t i = 0; i < c.vector_size(); i++) + { + if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0) + res += to_expression(c.specialization_constant_id(vector, i)); + else + { + res += type_to_glsl(scalar_type); + res += "("; + res += convert_to_string(c.scalar_u8(vector, i)); + res += ")"; + } + + if (i + 1 < c.vector_size()) + res += ", "; + } + } + break; + + case SPIRType::SByte: + if (splat) + { + res += convert_to_string(c.scalar_i8(vector, 0)); + } + else + { + for (uint32_t i = 0; i < c.vector_size(); i++) + { + if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0) + res += to_expression(c.specialization_constant_id(vector, i)); + else + { + res += type_to_glsl(scalar_type); + res += "("; + res += convert_to_string(c.scalar_i8(vector, i)); + res += ")"; + } + + if (i + 1 < c.vector_size()) + res += ", "; + } + } + break; + + case SPIRType::Boolean: + if (splat) + res += c.scalar(vector, 0) ? "true" : "false"; + else + { + for (uint32_t i = 0; i < c.vector_size(); i++) + { + if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0) + res += to_expression(c.specialization_constant_id(vector, i)); + else + res += c.scalar(vector, i) ? "true" : "false"; + + if (i + 1 < c.vector_size()) + res += ", "; + } + } + break; + + default: + SPIRV_CROSS_THROW("Invalid constant expression basetype."); + } + + if (c.vector_size() > 1 && !swizzle_splat) + res += ")"; + + return res; +} + +SPIRExpression &CompilerGLSL::emit_uninitialized_temporary_expression(uint32_t type, uint32_t id) +{ + forced_temporaries.insert(id); + emit_uninitialized_temporary(type, id); + return set(id, to_name(id), type, true); +} + +void CompilerGLSL::emit_uninitialized_temporary(uint32_t result_type, uint32_t result_id) +{ + // If we're declaring temporaries inside continue blocks, + // we must declare the temporary in the loop header so that the continue block can avoid declaring new variables. + if (!block_temporary_hoisting && current_continue_block && !hoisted_temporaries.count(result_id)) + { + auto &header = get(current_continue_block->loop_dominator); + if (find_if(begin(header.declare_temporary), end(header.declare_temporary), + [result_type, result_id](const pair &tmp) { + return tmp.first == result_type && tmp.second == result_id; + }) == end(header.declare_temporary)) + { + header.declare_temporary.emplace_back(result_type, result_id); + hoisted_temporaries.insert(result_id); + force_recompile(); + } + } + else if (hoisted_temporaries.count(result_id) == 0) + { + auto &type = get(result_type); + auto &flags = get_decoration_bitset(result_id); + + // The result_id has not been made into an expression yet, so use flags interface. + add_local_variable_name(result_id); + + string initializer; + if (options.force_zero_initialized_variables && type_can_zero_initialize(type)) + initializer = join(" = ", to_zero_initialized_expression(result_type)); + + statement(flags_to_qualifiers_glsl(type, result_id, flags), variable_decl(type, to_name(result_id)), initializer, ";"); + } +} + +bool CompilerGLSL::can_declare_inline_temporary(uint32_t id) const +{ + if (!block_temporary_hoisting && current_continue_block && !hoisted_temporaries.count(id)) + return false; + if (hoisted_temporaries.count(id)) + return false; + + return true; +} + +string CompilerGLSL::declare_temporary(uint32_t result_type, uint32_t result_id) +{ + auto &type = get(result_type); + + // If we're declaring temporaries inside continue blocks, + // we must declare the temporary in the loop header so that the continue block can avoid declaring new variables. + if (!block_temporary_hoisting && current_continue_block && !hoisted_temporaries.count(result_id)) + { + auto &header = get(current_continue_block->loop_dominator); + if (find_if(begin(header.declare_temporary), end(header.declare_temporary), + [result_type, result_id](const pair &tmp) { + return tmp.first == result_type && tmp.second == result_id; + }) == end(header.declare_temporary)) + { + header.declare_temporary.emplace_back(result_type, result_id); + hoisted_temporaries.insert(result_id); + force_recompile_guarantee_forward_progress(); + } + + return join(to_name(result_id), " = "); + } + else if (hoisted_temporaries.count(result_id)) + { + // The temporary has already been declared earlier, so just "declare" the temporary by writing to it. + return join(to_name(result_id), " = "); + } + else + { + // The result_id has not been made into an expression yet, so use flags interface. + add_local_variable_name(result_id); + auto &flags = get_decoration_bitset(result_id); + return join(flags_to_qualifiers_glsl(type, result_id, flags), variable_decl(type, to_name(result_id)), " = "); + } +} + +bool CompilerGLSL::expression_is_forwarded(uint32_t id) const +{ + return forwarded_temporaries.count(id) != 0; +} + +bool CompilerGLSL::expression_suppresses_usage_tracking(uint32_t id) const +{ + return suppressed_usage_tracking.count(id) != 0; +} + +bool CompilerGLSL::expression_read_implies_multiple_reads(uint32_t id) const +{ + auto *expr = maybe_get(id); + if (!expr) + return false; + + // If we're emitting code at a deeper loop level than when we emitted the expression, + // we're probably reading the same expression over and over. + return current_loop_level > expr->emitted_loop_level; +} + +SPIRExpression &CompilerGLSL::emit_op(uint32_t result_type, uint32_t result_id, const string &rhs, bool forwarding, + bool suppress_usage_tracking) +{ + if (forwarding && (forced_temporaries.find(result_id) == end(forced_temporaries))) + { + // Just forward it without temporary. + // If the forward is trivial, we do not force flushing to temporary for this expression. + forwarded_temporaries.insert(result_id); + if (suppress_usage_tracking) + suppressed_usage_tracking.insert(result_id); + + return set(result_id, rhs, result_type, true); + } + else + { + // If expression isn't immutable, bind it to a temporary and make the new temporary immutable (they always are). + statement(declare_temporary(result_type, result_id), rhs, ";"); + return set(result_id, to_name(result_id), result_type, true); + } +} + +void CompilerGLSL::emit_transposed_op(uint32_t result_type, uint32_t result_id, const string &rhs, bool forwarding) +{ + if (forwarding && (forced_temporaries.find(result_id) == end(forced_temporaries))) + { + // Just forward it without temporary. + // If the forward is trivial, we do not force flushing to temporary for this expression. + forwarded_temporaries.insert(result_id); + auto &e = set(result_id, rhs, result_type, true); + e.need_transpose = true; + } + else if (can_declare_inline_temporary(result_id)) + { + // If expression isn't immutable, bind it to a temporary and make the new temporary immutable (they always are). + // Since the expression is transposed, we have to ensure the temporary is the transposed type. + + auto &transposed_type_id = extra_sub_expressions[result_id]; + if (!transposed_type_id) + { + auto dummy_type = get(result_type); + std::swap(dummy_type.columns, dummy_type.vecsize); + transposed_type_id = ir.increase_bound_by(1); + set(transposed_type_id, dummy_type); + } + + statement(declare_temporary(transposed_type_id, result_id), rhs, ";"); + auto &e = set(result_id, to_name(result_id), result_type, true); + e.need_transpose = true; + } + else + { + // If we cannot declare the temporary because it's already been hoisted, we don't have the + // chance to override the temporary type ourselves. Just transpose() the expression. + emit_op(result_type, result_id, join("transpose(", rhs, ")"), forwarding); + } +} + +void CompilerGLSL::emit_unary_op(uint32_t result_type, uint32_t result_id, uint32_t op0, const char *op) +{ + bool forward = should_forward(op0); + emit_op(result_type, result_id, join(op, to_enclosed_unpacked_expression(op0)), forward); + inherit_expression_dependencies(result_id, op0); +} + +void CompilerGLSL::emit_unary_op_cast(uint32_t result_type, uint32_t result_id, uint32_t op0, const char *op) +{ + auto &type = get(result_type); + bool forward = should_forward(op0); + emit_op(result_type, result_id, join(type_to_glsl(type), "(", op, to_enclosed_unpacked_expression(op0), ")"), forward); + inherit_expression_dependencies(result_id, op0); +} + +void CompilerGLSL::emit_mesh_tasks(SPIRBlock &block) +{ + statement("EmitMeshTasksEXT(", + to_unpacked_expression(block.mesh.groups[0]), ", ", + to_unpacked_expression(block.mesh.groups[1]), ", ", + to_unpacked_expression(block.mesh.groups[2]), ");"); +} + +void CompilerGLSL::emit_binary_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op) +{ + // Various FP arithmetic opcodes such as add, sub, mul will hit this. + bool force_temporary_precise = backend.support_precise_qualifier && + has_legacy_nocontract(result_type, result_id) && + type_is_floating_point(get(result_type)); + bool forward = should_forward(op0) && should_forward(op1) && !force_temporary_precise; + + emit_op(result_type, result_id, + join(to_enclosed_unpacked_expression(op0), " ", op, " ", to_enclosed_unpacked_expression(op1)), forward); + + inherit_expression_dependencies(result_id, op0); + inherit_expression_dependencies(result_id, op1); +} + +void CompilerGLSL::emit_unrolled_unary_op(uint32_t result_type, uint32_t result_id, uint32_t operand, const char *op) +{ + auto &type = get(result_type); + auto expr = type_to_glsl_constructor(type); + expr += '('; + for (uint32_t i = 0; i < type.vecsize; i++) + { + // Make sure to call to_expression multiple times to ensure + // that these expressions are properly flushed to temporaries if needed. + expr += op; + expr += to_extract_component_expression(operand, i); + + if (i + 1 < type.vecsize) + expr += ", "; + } + expr += ')'; + emit_op(result_type, result_id, expr, should_forward(operand)); + + inherit_expression_dependencies(result_id, operand); +} + +void CompilerGLSL::emit_unrolled_binary_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, + const char *op, bool negate, SPIRType::BaseType expected_type) +{ + auto &type0 = expression_type(op0); + auto &type1 = expression_type(op1); + + SPIRType target_type0 = type0; + SPIRType target_type1 = type1; + target_type0.basetype = expected_type; + target_type1.basetype = expected_type; + target_type0.vecsize = 1; + target_type1.vecsize = 1; + + auto &type = get(result_type); + auto expr = type_to_glsl_constructor(type); + expr += '('; + for (uint32_t i = 0; i < type.vecsize; i++) + { + // Make sure to call to_expression multiple times to ensure + // that these expressions are properly flushed to temporaries if needed. + if (negate) + expr += "!("; + + if (expected_type != SPIRType::Unknown && type0.basetype != expected_type) + expr += bitcast_expression(target_type0, type0.basetype, to_extract_component_expression(op0, i)); + else + expr += to_extract_component_expression(op0, i); + + expr += ' '; + expr += op; + expr += ' '; + + if (expected_type != SPIRType::Unknown && type1.basetype != expected_type) + expr += bitcast_expression(target_type1, type1.basetype, to_extract_component_expression(op1, i)); + else + expr += to_extract_component_expression(op1, i); + + if (negate) + expr += ")"; + + if (i + 1 < type.vecsize) + expr += ", "; + } + expr += ')'; + emit_op(result_type, result_id, expr, should_forward(op0) && should_forward(op1)); + + inherit_expression_dependencies(result_id, op0); + inherit_expression_dependencies(result_id, op1); +} + +SPIRType CompilerGLSL::binary_op_bitcast_helper(string &cast_op0, string &cast_op1, SPIRType::BaseType &input_type, + uint32_t op0, uint32_t op1, bool skip_cast_if_equal_type) +{ + auto &type0 = expression_type(op0); + auto &type1 = expression_type(op1); + + // We have to bitcast if our inputs are of different type, or if our types are not equal to expected inputs. + // For some functions like OpIEqual and INotEqual, we don't care if inputs are of different types than expected + // since equality test is exactly the same. + bool cast = (type0.basetype != type1.basetype) || (!skip_cast_if_equal_type && type0.basetype != input_type); + + // Create a fake type so we can bitcast to it. + // We only deal with regular arithmetic types here like int, uints and so on. + SPIRType expected_type{type0.op}; + expected_type.basetype = input_type; + expected_type.vecsize = type0.vecsize; + expected_type.columns = type0.columns; + expected_type.width = type0.width; + + if (cast) + { + cast_op0 = bitcast_glsl(expected_type, op0); + cast_op1 = bitcast_glsl(expected_type, op1); + } + else + { + // If we don't cast, our actual input type is that of the first (or second) argument. + cast_op0 = to_enclosed_unpacked_expression(op0); + cast_op1 = to_enclosed_unpacked_expression(op1); + input_type = type0.basetype; + } + + return expected_type; +} + +bool CompilerGLSL::emit_complex_bitcast(uint32_t result_type, uint32_t id, uint32_t op0) +{ + // Some bitcasts may require complex casting sequences, and are implemented here. + // Otherwise a simply unary function will do with bitcast_glsl_op. + + auto &output_type = get(result_type); + auto &input_type = expression_type(op0); + string expr; + + if (output_type.basetype == SPIRType::Half && input_type.basetype == SPIRType::Float && input_type.vecsize == 1) + expr = join("unpackFloat2x16(floatBitsToUint(", to_unpacked_expression(op0), "))"); + else if (output_type.basetype == SPIRType::Float && input_type.basetype == SPIRType::Half && + input_type.vecsize == 2) + expr = join("uintBitsToFloat(packFloat2x16(", to_unpacked_expression(op0), "))"); + else + return false; + + emit_op(result_type, id, expr, should_forward(op0)); + return true; +} + +void CompilerGLSL::emit_binary_op_cast(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, + const char *op, SPIRType::BaseType input_type, + bool skip_cast_if_equal_type, + bool implicit_integer_promotion) +{ + string cast_op0, cast_op1; + auto expected_type = binary_op_bitcast_helper(cast_op0, cast_op1, input_type, op0, op1, skip_cast_if_equal_type); + auto &out_type = get(result_type); + + // We might have casted away from the result type, so bitcast again. + // For example, arithmetic right shift with uint inputs. + // Special case boolean outputs since relational opcodes output booleans instead of int/uint. + auto bitop = join(cast_op0, " ", op, " ", cast_op1); + string expr; + + if (implicit_integer_promotion) + { + // Simple value cast. + expr = join(type_to_glsl(out_type), '(', bitop, ')'); + } + else if (out_type.basetype != input_type && out_type.basetype != SPIRType::Boolean) + { + expected_type.basetype = input_type; + expr = join(bitcast_glsl_op(out_type, expected_type), '(', bitop, ')'); + } + else + { + expr = std::move(bitop); + } + + emit_op(result_type, result_id, expr, should_forward(op0) && should_forward(op1)); + inherit_expression_dependencies(result_id, op0); + inherit_expression_dependencies(result_id, op1); +} + +void CompilerGLSL::emit_unary_func_op(uint32_t result_type, uint32_t result_id, uint32_t op0, const char *op) +{ + bool forward = should_forward(op0); + emit_op(result_type, result_id, join(op, "(", to_unpacked_expression(op0), ")"), forward); + inherit_expression_dependencies(result_id, op0); +} + +void CompilerGLSL::emit_binary_func_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, + const char *op) +{ + // Opaque types (e.g. OpTypeSampledImage) must always be forwarded in GLSL + const auto &type = get_type(result_type); + bool must_forward = type_is_opaque_value(type); + bool forward = must_forward || (should_forward(op0) && should_forward(op1)); + emit_op(result_type, result_id, join(op, "(", to_unpacked_expression(op0), ", ", to_unpacked_expression(op1), ")"), + forward); + inherit_expression_dependencies(result_id, op0); + inherit_expression_dependencies(result_id, op1); +} + +void CompilerGLSL::emit_atomic_func_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, + const char *op) +{ + auto &type = get(result_type); + if (type_is_floating_point(type)) + { + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Floating point atomics requires Vulkan semantics."); + if (options.es) + SPIRV_CROSS_THROW("Floating point atomics requires desktop GLSL."); + require_extension_internal("GL_EXT_shader_atomic_float"); + } + + if (type.basetype == SPIRType::UInt64 || type.basetype == SPIRType::Int64) + require_extension_internal("GL_EXT_shader_atomic_int64"); + + forced_temporaries.insert(result_id); + emit_op(result_type, result_id, + join(op, "(", to_atomic_ptr_expression(op0), ", ", + to_unpacked_expression(op1), ")"), false); + flush_all_atomic_capable_variables(); +} + +void CompilerGLSL::emit_atomic_func_op(uint32_t result_type, uint32_t result_id, + uint32_t op0, uint32_t op1, uint32_t op2, + const char *op) +{ + forced_temporaries.insert(result_id); + emit_op(result_type, result_id, + join(op, "(", to_non_uniform_aware_expression(op0), ", ", + to_unpacked_expression(op1), ", ", to_unpacked_expression(op2), ")"), false); + flush_all_atomic_capable_variables(); +} + +void CompilerGLSL::emit_unary_func_op_cast(uint32_t result_type, uint32_t result_id, uint32_t op0, const char *op, + SPIRType::BaseType input_type, SPIRType::BaseType expected_result_type) +{ + auto &out_type = get(result_type); + auto &expr_type = expression_type(op0); + auto expected_type = out_type; + + // Bit-widths might be different in unary cases because we use it for SConvert/UConvert and friends. + expected_type.basetype = input_type; + expected_type.width = expr_type.width; + + string cast_op; + if (expr_type.basetype != input_type) + { + if (expr_type.basetype == SPIRType::Boolean) + cast_op = join(type_to_glsl(expected_type), "(", to_unpacked_expression(op0), ")"); + else + cast_op = bitcast_glsl(expected_type, op0); + } + else + cast_op = to_unpacked_expression(op0); + + string expr; + if (out_type.basetype != expected_result_type) + { + expected_type.basetype = expected_result_type; + expected_type.width = out_type.width; + if (out_type.basetype == SPIRType::Boolean) + expr = type_to_glsl(out_type); + else + expr = bitcast_glsl_op(out_type, expected_type); + expr += '('; + expr += join(op, "(", cast_op, ")"); + expr += ')'; + } + else + { + expr += join(op, "(", cast_op, ")"); + } + + emit_op(result_type, result_id, expr, should_forward(op0)); + inherit_expression_dependencies(result_id, op0); +} + +// Very special case. Handling bitfieldExtract requires us to deal with different bitcasts of different signs +// and different vector sizes all at once. Need a special purpose method here. +void CompilerGLSL::emit_trinary_func_op_bitextract(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, + uint32_t op2, const char *op, + SPIRType::BaseType expected_result_type, + SPIRType::BaseType input_type0, SPIRType::BaseType input_type1, + SPIRType::BaseType input_type2) +{ + auto &out_type = get(result_type); + auto expected_type = out_type; + expected_type.basetype = input_type0; + + string cast_op0 = + expression_type(op0).basetype != input_type0 ? bitcast_glsl(expected_type, op0) : to_unpacked_expression(op0); + + auto op1_expr = to_unpacked_expression(op1); + auto op2_expr = to_unpacked_expression(op2); + + // Use value casts here instead. Input must be exactly int or uint, but SPIR-V might be 16-bit. + expected_type.basetype = input_type1; + expected_type.vecsize = 1; + string cast_op1 = expression_type(op1).basetype != input_type1 ? + join(type_to_glsl_constructor(expected_type), "(", op1_expr, ")") : + op1_expr; + + expected_type.basetype = input_type2; + expected_type.vecsize = 1; + string cast_op2 = expression_type(op2).basetype != input_type2 ? + join(type_to_glsl_constructor(expected_type), "(", op2_expr, ")") : + op2_expr; + + string expr; + if (out_type.basetype != expected_result_type) + { + expected_type.vecsize = out_type.vecsize; + expected_type.basetype = expected_result_type; + expr = bitcast_glsl_op(out_type, expected_type); + expr += '('; + expr += join(op, "(", cast_op0, ", ", cast_op1, ", ", cast_op2, ")"); + expr += ')'; + } + else + { + expr += join(op, "(", cast_op0, ", ", cast_op1, ", ", cast_op2, ")"); + } + + emit_op(result_type, result_id, expr, should_forward(op0) && should_forward(op1) && should_forward(op2)); + inherit_expression_dependencies(result_id, op0); + inherit_expression_dependencies(result_id, op1); + inherit_expression_dependencies(result_id, op2); +} + +void CompilerGLSL::emit_trinary_func_op_cast(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, + uint32_t op2, const char *op, SPIRType::BaseType input_type) +{ + auto &out_type = get(result_type); + auto expected_type = out_type; + expected_type.basetype = input_type; + string cast_op0 = + expression_type(op0).basetype != input_type ? bitcast_glsl(expected_type, op0) : to_unpacked_expression(op0); + string cast_op1 = + expression_type(op1).basetype != input_type ? bitcast_glsl(expected_type, op1) : to_unpacked_expression(op1); + string cast_op2 = + expression_type(op2).basetype != input_type ? bitcast_glsl(expected_type, op2) : to_unpacked_expression(op2); + + string expr; + if (out_type.basetype != input_type) + { + expr = bitcast_glsl_op(out_type, expected_type); + expr += '('; + expr += join(op, "(", cast_op0, ", ", cast_op1, ", ", cast_op2, ")"); + expr += ')'; + } + else + { + expr += join(op, "(", cast_op0, ", ", cast_op1, ", ", cast_op2, ")"); + } + + emit_op(result_type, result_id, expr, should_forward(op0) && should_forward(op1) && should_forward(op2)); + inherit_expression_dependencies(result_id, op0); + inherit_expression_dependencies(result_id, op1); + inherit_expression_dependencies(result_id, op2); +} + +void CompilerGLSL::emit_binary_func_op_cast_clustered(uint32_t result_type, uint32_t result_id, uint32_t op0, + uint32_t op1, const char *op, SPIRType::BaseType input_type) +{ + // Special purpose method for implementing clustered subgroup opcodes. + // Main difference is that op1 does not participate in any casting, it needs to be a literal. + auto &out_type = get(result_type); + auto expected_type = out_type; + expected_type.basetype = input_type; + string cast_op0 = + expression_type(op0).basetype != input_type ? bitcast_glsl(expected_type, op0) : to_unpacked_expression(op0); + + string expr; + if (out_type.basetype != input_type) + { + expr = bitcast_glsl_op(out_type, expected_type); + expr += '('; + expr += join(op, "(", cast_op0, ", ", to_expression(op1), ")"); + expr += ')'; + } + else + { + expr += join(op, "(", cast_op0, ", ", to_expression(op1), ")"); + } + + emit_op(result_type, result_id, expr, should_forward(op0)); + inherit_expression_dependencies(result_id, op0); +} + +void CompilerGLSL::emit_binary_func_op_cast(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, + const char *op, SPIRType::BaseType input_type, bool skip_cast_if_equal_type) +{ + string cast_op0, cast_op1; + auto expected_type = binary_op_bitcast_helper(cast_op0, cast_op1, input_type, op0, op1, skip_cast_if_equal_type); + auto &out_type = get(result_type); + + // Special case boolean outputs since relational opcodes output booleans instead of int/uint. + string expr; + if (out_type.basetype != input_type && out_type.basetype != SPIRType::Boolean) + { + expected_type.basetype = input_type; + expr = bitcast_glsl_op(out_type, expected_type); + expr += '('; + expr += join(op, "(", cast_op0, ", ", cast_op1, ")"); + expr += ')'; + } + else + { + expr += join(op, "(", cast_op0, ", ", cast_op1, ")"); + } + + emit_op(result_type, result_id, expr, should_forward(op0) && should_forward(op1)); + inherit_expression_dependencies(result_id, op0); + inherit_expression_dependencies(result_id, op1); +} + +void CompilerGLSL::emit_trinary_func_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, + uint32_t op2, const char *op) +{ + bool forward = should_forward(op0) && should_forward(op1) && should_forward(op2); + emit_op(result_type, result_id, + join(op, "(", to_unpacked_expression(op0), ", ", to_unpacked_expression(op1), ", ", + to_unpacked_expression(op2), ")"), + forward); + + inherit_expression_dependencies(result_id, op0); + inherit_expression_dependencies(result_id, op1); + inherit_expression_dependencies(result_id, op2); +} + +void CompilerGLSL::emit_quaternary_func_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, + uint32_t op2, uint32_t op3, const char *op) +{ + bool forward = should_forward(op0) && should_forward(op1) && should_forward(op2) && should_forward(op3); + emit_op(result_type, result_id, + join(op, "(", to_unpacked_expression(op0), ", ", to_unpacked_expression(op1), ", ", + to_unpacked_expression(op2), ", ", to_unpacked_expression(op3), ")"), + forward); + + inherit_expression_dependencies(result_id, op0); + inherit_expression_dependencies(result_id, op1); + inherit_expression_dependencies(result_id, op2); + inherit_expression_dependencies(result_id, op3); +} + +void CompilerGLSL::emit_bitfield_insert_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, + uint32_t op2, uint32_t op3, const char *op, + SPIRType::BaseType offset_count_type) +{ + // Only need to cast offset/count arguments. Types of base/insert must be same as result type, + // and bitfieldInsert is sign invariant. + bool forward = should_forward(op0) && should_forward(op1) && should_forward(op2) && should_forward(op3); + + auto op0_expr = to_unpacked_expression(op0); + auto op1_expr = to_unpacked_expression(op1); + auto op2_expr = to_unpacked_expression(op2); + auto op3_expr = to_unpacked_expression(op3); + + assert(offset_count_type == SPIRType::UInt || offset_count_type == SPIRType::Int); + SPIRType target_type { OpTypeInt }; + target_type.width = 32; + target_type.vecsize = 1; + target_type.basetype = offset_count_type; + + if (expression_type(op2).basetype != offset_count_type) + { + // Value-cast here. Input might be 16-bit. GLSL requires int. + op2_expr = join(type_to_glsl_constructor(target_type), "(", op2_expr, ")"); + } + + if (expression_type(op3).basetype != offset_count_type) + { + // Value-cast here. Input might be 16-bit. GLSL requires int. + op3_expr = join(type_to_glsl_constructor(target_type), "(", op3_expr, ")"); + } + + emit_op(result_type, result_id, join(op, "(", op0_expr, ", ", op1_expr, ", ", op2_expr, ", ", op3_expr, ")"), + forward); + + inherit_expression_dependencies(result_id, op0); + inherit_expression_dependencies(result_id, op1); + inherit_expression_dependencies(result_id, op2); + inherit_expression_dependencies(result_id, op3); +} + +string CompilerGLSL::legacy_tex_op(const std::string &op, const SPIRType &imgtype, uint32_t tex) +{ + const char *type; + switch (imgtype.image.dim) + { + case Dim1D: + // Force 2D path for ES. + if (options.es) + type = (imgtype.image.arrayed && !options.es) ? "2DArray" : "2D"; + else + type = (imgtype.image.arrayed && !options.es) ? "1DArray" : "1D"; + break; + case Dim2D: + type = (imgtype.image.arrayed && !options.es) ? "2DArray" : "2D"; + break; + case Dim3D: + type = "3D"; + break; + case DimCube: + type = "Cube"; + break; + case DimRect: + type = "2DRect"; + break; + case DimBuffer: + type = "Buffer"; + break; + case DimSubpassData: + type = "2D"; + break; + default: + type = ""; + break; + } + + // In legacy GLSL, an extension is required for textureLod in the fragment + // shader or textureGrad anywhere. + bool legacy_lod_ext = false; + auto &execution = get_entry_point(); + if (op == "textureGrad" || op == "textureProjGrad" || + ((op == "textureLod" || op == "textureProjLod") && execution.model != ExecutionModelVertex)) + { + if (is_legacy_es()) + { + legacy_lod_ext = true; + require_extension_internal("GL_EXT_shader_texture_lod"); + } + else if (is_legacy_desktop()) + require_extension_internal("GL_ARB_shader_texture_lod"); + } + + if (op == "textureLodOffset" || op == "textureProjLodOffset") + { + if (is_legacy_es()) + SPIRV_CROSS_THROW(join(op, " not allowed in legacy ES")); + + require_extension_internal("GL_EXT_gpu_shader4"); + } + + // GLES has very limited support for shadow samplers. + // Basically shadow2D and shadow2DProj work through EXT_shadow_samplers, + // everything else can just throw + bool is_comparison = is_depth_image(imgtype, tex); + if (is_comparison && is_legacy_es()) + { + if (op == "texture" || op == "textureProj") + require_extension_internal("GL_EXT_shadow_samplers"); + else + SPIRV_CROSS_THROW(join(op, " not allowed on depth samplers in legacy ES")); + + if (imgtype.image.dim == DimCube) + return "shadowCubeNV"; + } + + if (op == "textureSize") + { + if (is_legacy_es()) + SPIRV_CROSS_THROW("textureSize not supported in legacy ES"); + if (is_comparison) + SPIRV_CROSS_THROW("textureSize not supported on shadow sampler in legacy GLSL"); + require_extension_internal("GL_EXT_gpu_shader4"); + } + + if (op == "texelFetch" && is_legacy_es()) + SPIRV_CROSS_THROW("texelFetch not supported in legacy ES"); + + bool is_es_and_depth = is_legacy_es() && is_comparison; + std::string type_prefix = is_comparison ? "shadow" : "texture"; + + if (op == "texture") + return is_es_and_depth ? join(type_prefix, type, "EXT") : join(type_prefix, type); + else if (op == "textureLod") + return join(type_prefix, type, legacy_lod_ext ? "LodEXT" : "Lod"); + else if (op == "textureProj") + return join(type_prefix, type, is_es_and_depth ? "ProjEXT" : "Proj"); + else if (op == "textureGrad") + return join(type_prefix, type, is_legacy_es() ? "GradEXT" : is_legacy_desktop() ? "GradARB" : "Grad"); + else if (op == "textureProjLod") + return join(type_prefix, type, legacy_lod_ext ? "ProjLodEXT" : "ProjLod"); + else if (op == "textureLodOffset") + return join(type_prefix, type, "LodOffset"); + else if (op == "textureProjGrad") + return join(type_prefix, type, + is_legacy_es() ? "ProjGradEXT" : is_legacy_desktop() ? "ProjGradARB" : "ProjGrad"); + else if (op == "textureProjLodOffset") + return join(type_prefix, type, "ProjLodOffset"); + else if (op == "textureSize") + return join("textureSize", type); + else if (op == "texelFetch") + return join("texelFetch", type); + else + { + SPIRV_CROSS_THROW(join("Unsupported legacy texture op: ", op)); + } +} + +bool CompilerGLSL::to_trivial_mix_op(const SPIRType &type, string &op, uint32_t left, uint32_t right, uint32_t lerp) +{ + auto *cleft = maybe_get(left); + auto *cright = maybe_get(right); + auto &lerptype = expression_type(lerp); + + // If our targets aren't constants, we cannot use construction. + if (!cleft || !cright) + return false; + + // If our targets are spec constants, we cannot use construction. + if (cleft->specialization || cright->specialization) + return false; + + auto &value_type = get(cleft->constant_type); + + if (lerptype.basetype != SPIRType::Boolean) + return false; + if (value_type.basetype == SPIRType::Struct || is_array(value_type)) + return false; + if (!backend.use_constructor_splatting && value_type.vecsize != lerptype.vecsize) + return false; + + // Only valid way in SPIR-V 1.4 to use matrices in select is a scalar select. + // matrix(scalar) constructor fills in diagnonals, so gets messy very quickly. + // Just avoid this case. + if (value_type.columns > 1) + return false; + + // If our bool selects between 0 and 1, we can cast from bool instead, making our trivial constructor. + bool ret = true; + for (uint32_t row = 0; ret && row < value_type.vecsize; row++) + { + switch (type.basetype) + { + case SPIRType::Short: + case SPIRType::UShort: + ret = cleft->scalar_u16(0, row) == 0 && cright->scalar_u16(0, row) == 1; + break; + + case SPIRType::Int: + case SPIRType::UInt: + ret = cleft->scalar(0, row) == 0 && cright->scalar(0, row) == 1; + break; + + case SPIRType::Half: + ret = cleft->scalar_f16(0, row) == 0.0f && cright->scalar_f16(0, row) == 1.0f; + break; + + case SPIRType::Float: + ret = cleft->scalar_f32(0, row) == 0.0f && cright->scalar_f32(0, row) == 1.0f; + break; + + case SPIRType::Double: + ret = cleft->scalar_f64(0, row) == 0.0 && cright->scalar_f64(0, row) == 1.0; + break; + + case SPIRType::Int64: + case SPIRType::UInt64: + ret = cleft->scalar_u64(0, row) == 0 && cright->scalar_u64(0, row) == 1; + break; + + default: + ret = false; + break; + } + } + + if (ret) + op = type_to_glsl_constructor(type); + return ret; +} + +string CompilerGLSL::to_ternary_expression(const SPIRType &restype, uint32_t select, uint32_t true_value, + uint32_t false_value) +{ + string expr; + auto &lerptype = expression_type(select); + + if (lerptype.vecsize == 1) + expr = join(to_enclosed_expression(select), " ? ", to_enclosed_pointer_expression(true_value), " : ", + to_enclosed_pointer_expression(false_value)); + else + { + auto swiz = [this](uint32_t expression, uint32_t i) { return to_extract_component_expression(expression, i); }; + + expr = type_to_glsl_constructor(restype); + expr += "("; + for (uint32_t i = 0; i < restype.vecsize; i++) + { + expr += swiz(select, i); + expr += " ? "; + expr += swiz(true_value, i); + expr += " : "; + expr += swiz(false_value, i); + if (i + 1 < restype.vecsize) + expr += ", "; + } + expr += ")"; + } + + return expr; +} + +void CompilerGLSL::emit_mix_op(uint32_t result_type, uint32_t id, uint32_t left, uint32_t right, uint32_t lerp) +{ + auto &lerptype = expression_type(lerp); + auto &restype = get(result_type); + + // If this results in a variable pointer, assume it may be written through. + if (restype.pointer) + { + register_write(left); + register_write(right); + } + + string mix_op; + bool has_boolean_mix = *backend.boolean_mix_function && + ((options.es && options.version >= 310) || (!options.es && options.version >= 450)); + bool trivial_mix = to_trivial_mix_op(restype, mix_op, left, right, lerp); + + // Cannot use boolean mix when the lerp argument is just one boolean, + // fall back to regular trinary statements. + if (lerptype.vecsize == 1) + has_boolean_mix = false; + + // If we can reduce the mix to a simple cast, do so. + // This helps for cases like int(bool), uint(bool) which is implemented with + // OpSelect bool 1 0. + if (trivial_mix) + { + emit_unary_func_op(result_type, id, lerp, mix_op.c_str()); + } + else if (!has_boolean_mix && lerptype.basetype == SPIRType::Boolean) + { + // Boolean mix not supported on desktop without extension. + // Was added in OpenGL 4.5 with ES 3.1 compat. + // + // Could use GL_EXT_shader_integer_mix on desktop at least, + // but Apple doesn't support it. :( + // Just implement it as ternary expressions. + auto expr = to_ternary_expression(get(result_type), lerp, right, left); + emit_op(result_type, id, expr, should_forward(left) && should_forward(right) && should_forward(lerp)); + inherit_expression_dependencies(id, left); + inherit_expression_dependencies(id, right); + inherit_expression_dependencies(id, lerp); + } + else if (lerptype.basetype == SPIRType::Boolean) + emit_trinary_func_op(result_type, id, left, right, lerp, backend.boolean_mix_function); + else + emit_trinary_func_op(result_type, id, left, right, lerp, "mix"); +} + +string CompilerGLSL::to_combined_image_sampler(VariableID image_id, VariableID samp_id) +{ + // Keep track of the array indices we have used to load the image. + // We'll need to use the same array index into the combined image sampler array. + auto image_expr = to_non_uniform_aware_expression(image_id); + string array_expr; + auto array_index = image_expr.find_first_of('['); + if (array_index != string::npos) + array_expr = image_expr.substr(array_index, string::npos); + + auto &args = current_function->arguments; + + // For GLSL and ESSL targets, we must enumerate all possible combinations for sampler2D(texture2D, sampler) and redirect + // all possible combinations into new sampler2D uniforms. + auto *image = maybe_get_backing_variable(image_id); + auto *samp = maybe_get_backing_variable(samp_id); + if (image) + image_id = image->self; + if (samp) + samp_id = samp->self; + + auto image_itr = find_if(begin(args), end(args), + [image_id](const SPIRFunction::Parameter ¶m) { return image_id == param.id; }); + + auto sampler_itr = find_if(begin(args), end(args), + [samp_id](const SPIRFunction::Parameter ¶m) { return samp_id == param.id; }); + + if (image_itr != end(args) || sampler_itr != end(args)) + { + // If any parameter originates from a parameter, we will find it in our argument list. + bool global_image = image_itr == end(args); + bool global_sampler = sampler_itr == end(args); + VariableID iid = global_image ? image_id : VariableID(uint32_t(image_itr - begin(args))); + VariableID sid = global_sampler ? samp_id : VariableID(uint32_t(sampler_itr - begin(args))); + + auto &combined = current_function->combined_parameters; + auto itr = find_if(begin(combined), end(combined), [=](const SPIRFunction::CombinedImageSamplerParameter &p) { + return p.global_image == global_image && p.global_sampler == global_sampler && p.image_id == iid && + p.sampler_id == sid; + }); + + if (itr != end(combined)) + return to_expression(itr->id) + array_expr; + else + { + SPIRV_CROSS_THROW("Cannot find mapping for combined sampler parameter, was " + "build_combined_image_samplers() used " + "before compile() was called?"); + } + } + else + { + // For global sampler2D, look directly at the global remapping table. + auto &mapping = combined_image_samplers; + auto itr = find_if(begin(mapping), end(mapping), [image_id, samp_id](const CombinedImageSampler &combined) { + return combined.image_id == image_id && combined.sampler_id == samp_id; + }); + + if (itr != end(combined_image_samplers)) + return to_expression(itr->combined_id) + array_expr; + else + { + SPIRV_CROSS_THROW("Cannot find mapping for combined sampler, was build_combined_image_samplers() used " + "before compile() was called?"); + } + } +} + +bool CompilerGLSL::is_supported_subgroup_op_in_opengl(Op op, const uint32_t *ops) +{ + switch (op) + { + case OpGroupNonUniformElect: + case OpGroupNonUniformBallot: + case OpGroupNonUniformBallotFindLSB: + case OpGroupNonUniformBallotFindMSB: + case OpGroupNonUniformBroadcast: + case OpGroupNonUniformBroadcastFirst: + case OpGroupNonUniformAll: + case OpGroupNonUniformAny: + case OpGroupNonUniformAllEqual: + case OpControlBarrier: + case OpMemoryBarrier: + case OpGroupNonUniformBallotBitCount: + case OpGroupNonUniformBallotBitExtract: + case OpGroupNonUniformInverseBallot: + return true; + case OpGroupNonUniformIAdd: + case OpGroupNonUniformFAdd: + case OpGroupNonUniformIMul: + case OpGroupNonUniformFMul: + { + const GroupOperation operation = static_cast(ops[3]); + if (operation == GroupOperationReduce || operation == GroupOperationInclusiveScan || + operation == GroupOperationExclusiveScan) + { + return true; + } + else + { + return false; + } + } + default: + return false; + } +} + +void CompilerGLSL::emit_sampled_image_op(uint32_t result_type, uint32_t result_id, uint32_t image_id, uint32_t samp_id) +{ + if (options.vulkan_semantics && combined_image_samplers.empty()) + { + emit_binary_func_op(result_type, result_id, image_id, samp_id, + type_to_glsl(get(result_type), result_id).c_str()); + } + else + { + // Make sure to suppress usage tracking. It is illegal to create temporaries of opaque types. + emit_op(result_type, result_id, to_combined_image_sampler(image_id, samp_id), true, true); + } + + // Make sure to suppress usage tracking and any expression invalidation. + // It is illegal to create temporaries of opaque types. + forwarded_temporaries.erase(result_id); +} + +static inline bool image_opcode_is_sample_no_dref(Op op) +{ + switch (op) + { + case OpImageSampleExplicitLod: + case OpImageSampleImplicitLod: + case OpImageSampleProjExplicitLod: + case OpImageSampleProjImplicitLod: + case OpImageFetch: + case OpImageRead: + case OpImageSparseSampleExplicitLod: + case OpImageSparseSampleImplicitLod: + case OpImageSparseSampleProjExplicitLod: + case OpImageSparseSampleProjImplicitLod: + case OpImageSparseFetch: + case OpImageSparseRead: + return true; + + default: + return false; + } +} + +void CompilerGLSL::emit_sparse_feedback_temporaries(uint32_t result_type_id, uint32_t id, uint32_t &feedback_id, + uint32_t &texel_id) +{ + // Need to allocate two temporaries. + if (options.es) + SPIRV_CROSS_THROW("Sparse texture feedback is not supported on ESSL."); + require_extension_internal("GL_ARB_sparse_texture2"); + + auto &temps = extra_sub_expressions[id]; + if (temps == 0) + temps = ir.increase_bound_by(2); + + feedback_id = temps + 0; + texel_id = temps + 1; + + auto &return_type = get(result_type_id); + if (return_type.basetype != SPIRType::Struct || return_type.member_types.size() != 2) + SPIRV_CROSS_THROW("Invalid return type for sparse feedback."); + emit_uninitialized_temporary(return_type.member_types[0], feedback_id); + emit_uninitialized_temporary(return_type.member_types[1], texel_id); +} + +uint32_t CompilerGLSL::get_sparse_feedback_texel_id(uint32_t id) const +{ + auto itr = extra_sub_expressions.find(id); + if (itr == extra_sub_expressions.end()) + return 0; + else + return itr->second + 1; +} + +void CompilerGLSL::emit_texture_op(const Instruction &i, bool sparse) +{ + auto *ops = stream(i); + auto op = static_cast(i.op); + + SmallVector inherited_expressions; + + uint32_t result_type_id = ops[0]; + uint32_t id = ops[1]; + auto &return_type = get(result_type_id); + + uint32_t sparse_code_id = 0; + uint32_t sparse_texel_id = 0; + if (sparse) + emit_sparse_feedback_temporaries(result_type_id, id, sparse_code_id, sparse_texel_id); + + bool forward = false; + string expr = to_texture_op(i, sparse, &forward, inherited_expressions); + + if (sparse) + { + statement(to_expression(sparse_code_id), " = ", expr, ";"); + expr = join(type_to_glsl(return_type), "(", to_expression(sparse_code_id), ", ", to_expression(sparse_texel_id), + ")"); + forward = true; + inherited_expressions.clear(); + } + + emit_op(result_type_id, id, expr, forward); + for (auto &inherit : inherited_expressions) + inherit_expression_dependencies(id, inherit); + + // Do not register sparse ops as control dependent as they are always lowered to a temporary. + switch (op) + { + case OpImageSampleDrefImplicitLod: + case OpImageSampleImplicitLod: + case OpImageSampleProjImplicitLod: + case OpImageSampleProjDrefImplicitLod: + register_control_dependent_expression(id); + break; + + default: + break; + } +} + +std::string CompilerGLSL::to_texture_op(const Instruction &i, bool sparse, bool *forward, + SmallVector &inherited_expressions) +{ + auto *ops = stream(i); + auto op = static_cast(i.op); + uint32_t length = i.length; + + uint32_t result_type_id = ops[0]; + VariableID img = ops[2]; + uint32_t coord = ops[3]; + uint32_t dref = 0; + uint32_t comp = 0; + bool gather = false; + bool proj = false; + bool fetch = false; + bool nonuniform_expression = false; + const uint32_t *opt = nullptr; + + auto &result_type = get(result_type_id); + + inherited_expressions.push_back(coord); + if (has_decoration(img, DecorationNonUniform) && !maybe_get_backing_variable(img)) + nonuniform_expression = true; + + switch (op) + { + case OpImageSampleDrefImplicitLod: + case OpImageSampleDrefExplicitLod: + case OpImageSparseSampleDrefImplicitLod: + case OpImageSparseSampleDrefExplicitLod: + dref = ops[4]; + opt = &ops[5]; + length -= 5; + break; + + case OpImageSampleProjDrefImplicitLod: + case OpImageSampleProjDrefExplicitLod: + case OpImageSparseSampleProjDrefImplicitLod: + case OpImageSparseSampleProjDrefExplicitLod: + dref = ops[4]; + opt = &ops[5]; + length -= 5; + proj = true; + break; + + case OpImageDrefGather: + case OpImageSparseDrefGather: + dref = ops[4]; + opt = &ops[5]; + length -= 5; + gather = true; + if (options.es && options.version < 310) + SPIRV_CROSS_THROW("textureGather requires ESSL 310."); + else if (!options.es && options.version < 400) + SPIRV_CROSS_THROW("textureGather with depth compare requires GLSL 400."); + break; + + case OpImageGather: + case OpImageSparseGather: + comp = ops[4]; + opt = &ops[5]; + length -= 5; + gather = true; + if (options.es && options.version < 310) + SPIRV_CROSS_THROW("textureGather requires ESSL 310."); + else if (!options.es && options.version < 400) + { + if (!expression_is_constant_null(comp)) + SPIRV_CROSS_THROW("textureGather with component requires GLSL 400."); + require_extension_internal("GL_ARB_texture_gather"); + } + break; + + case OpImageFetch: + case OpImageSparseFetch: + case OpImageRead: // Reads == fetches in Metal (other langs will not get here) + opt = &ops[4]; + length -= 4; + fetch = true; + break; + + case OpImageSampleProjImplicitLod: + case OpImageSampleProjExplicitLod: + case OpImageSparseSampleProjImplicitLod: + case OpImageSparseSampleProjExplicitLod: + opt = &ops[4]; + length -= 4; + proj = true; + break; + + default: + opt = &ops[4]; + length -= 4; + break; + } + + // Bypass pointers because we need the real image struct + auto &type = expression_type(img); + auto &imgtype = get(type.self); + + uint32_t coord_components = 0; + switch (imgtype.image.dim) + { + case Dim1D: + coord_components = 1; + break; + case Dim2D: + coord_components = 2; + break; + case Dim3D: + coord_components = 3; + break; + case DimCube: + coord_components = 3; + break; + case DimBuffer: + coord_components = 1; + break; + default: + coord_components = 2; + break; + } + + if (dref) + inherited_expressions.push_back(dref); + + if (proj) + coord_components++; + if (imgtype.image.arrayed) + coord_components++; + + uint32_t bias = 0; + uint32_t lod = 0; + uint32_t grad_x = 0; + uint32_t grad_y = 0; + uint32_t coffset = 0; + uint32_t offset = 0; + uint32_t coffsets = 0; + uint32_t sample = 0; + uint32_t minlod = 0; + uint32_t flags = 0; + + if (length) + { + flags = *opt++; + length--; + } + + auto test = [&](uint32_t &v, uint32_t flag) { + if (length && (flags & flag)) + { + v = *opt++; + inherited_expressions.push_back(v); + length--; + } + }; + + test(bias, ImageOperandsBiasMask); + test(lod, ImageOperandsLodMask); + test(grad_x, ImageOperandsGradMask); + test(grad_y, ImageOperandsGradMask); + test(coffset, ImageOperandsConstOffsetMask); + test(offset, ImageOperandsOffsetMask); + test(coffsets, ImageOperandsConstOffsetsMask); + test(sample, ImageOperandsSampleMask); + test(minlod, ImageOperandsMinLodMask); + + TextureFunctionBaseArguments base_args = {}; + base_args.img = img; + base_args.imgtype = &imgtype; + base_args.is_fetch = fetch != 0; + base_args.is_gather = gather != 0; + base_args.is_proj = proj != 0; + + string expr; + TextureFunctionNameArguments name_args = {}; + + name_args.base = base_args; + name_args.has_array_offsets = coffsets != 0; + name_args.has_offset = coffset != 0 || offset != 0; + name_args.has_grad = grad_x != 0 || grad_y != 0; + name_args.has_dref = dref != 0; + name_args.is_sparse_feedback = sparse; + name_args.has_min_lod = minlod != 0; + name_args.lod = lod; + expr += to_function_name(name_args); + expr += "("; + + uint32_t sparse_texel_id = 0; + if (sparse) + sparse_texel_id = get_sparse_feedback_texel_id(ops[1]); + + TextureFunctionArguments args = {}; + args.base = base_args; + args.coord = coord; + args.coord_components = coord_components; + args.dref = dref; + args.grad_x = grad_x; + args.grad_y = grad_y; + args.lod = lod; + args.has_array_offsets = coffsets != 0; + + if (coffsets) + args.offset = coffsets; + else if (coffset) + args.offset = coffset; + else + args.offset = offset; + + args.bias = bias; + args.component = comp; + args.sample = sample; + args.sparse_texel = sparse_texel_id; + args.min_lod = minlod; + args.nonuniform_expression = nonuniform_expression; + expr += to_function_args(args, forward); + expr += ")"; + + // texture(samplerXShadow) returns float. shadowX() returns vec4, but only in desktop GLSL. Swizzle here. + if (is_legacy() && !options.es && is_depth_image(imgtype, img)) + expr += ".r"; + + // Sampling from a texture which was deduced to be a depth image, might actually return 1 component here. + // Remap back to 4 components as sampling opcodes expect. + if (backend.comparison_image_samples_scalar && image_opcode_is_sample_no_dref(op)) + { + bool image_is_depth = false; + const auto *combined = maybe_get(img); + VariableID image_id = combined ? combined->image : img; + + if (combined && is_depth_image(imgtype, combined->image)) + image_is_depth = true; + else if (is_depth_image(imgtype, img)) + image_is_depth = true; + + // We must also check the backing variable for the image. + // We might have loaded an OpImage, and used that handle for two different purposes. + // Once with comparison, once without. + auto *image_variable = maybe_get_backing_variable(image_id); + if (image_variable && is_depth_image(get(image_variable->basetype), image_variable->self)) + image_is_depth = true; + + if (image_is_depth) + expr = remap_swizzle(result_type, 1, expr); + } + + if (!sparse && !backend.support_small_type_sampling_result && result_type.width < 32) + { + // Just value cast (narrowing) to expected type since we cannot rely on narrowing to work automatically. + // Hopefully compiler picks this up and converts the texturing instruction to the appropriate precision. + expr = join(type_to_glsl_constructor(result_type), "(", expr, ")"); + } + + // Deals with reads from MSL. We might need to downconvert to fewer components. + if (op == OpImageRead) + expr = remap_swizzle(result_type, 4, expr); + + return expr; +} + +bool CompilerGLSL::expression_is_constant_null(uint32_t id) const +{ + auto *c = maybe_get(id); + if (!c) + return false; + return c->constant_is_null(); +} + +bool CompilerGLSL::expression_is_non_value_type_array(uint32_t ptr) +{ + auto &type = expression_type(ptr); + if (!is_array(get_pointee_type(type))) + return false; + + if (!backend.array_is_value_type) + return true; + + auto *var = maybe_get_backing_variable(ptr); + if (!var) + return false; + + auto &backed_type = get(var->basetype); + return !backend.array_is_value_type_in_buffer_blocks && backed_type.basetype == SPIRType::Struct && + has_member_decoration(backed_type.self, 0, DecorationOffset); +} + +// Returns the function name for a texture sampling function for the specified image and sampling characteristics. +// For some subclasses, the function is a method on the specified image. +string CompilerGLSL::to_function_name(const TextureFunctionNameArguments &args) +{ + if (args.has_min_lod) + { + if (options.es) + SPIRV_CROSS_THROW("Sparse residency is not supported in ESSL."); + require_extension_internal("GL_ARB_sparse_texture_clamp"); + } + + string fname; + auto &imgtype = *args.base.imgtype; + VariableID tex = args.base.img; + + // textureLod on sampler2DArrayShadow and samplerCubeShadow does not exist in GLSL for some reason. + // To emulate this, we will have to use textureGrad with a constant gradient of 0. + // The workaround will assert that the LOD is in fact constant 0, or we cannot emit correct code. + // This happens for HLSL SampleCmpLevelZero on Texture2DArray and TextureCube. + bool workaround_lod_array_shadow_as_grad = false; + if (((imgtype.image.arrayed && imgtype.image.dim == Dim2D) || imgtype.image.dim == DimCube) && + is_depth_image(imgtype, tex) && args.lod && !args.base.is_fetch) + { + if (!expression_is_constant_null(args.lod)) + { + SPIRV_CROSS_THROW("textureLod on sampler2DArrayShadow is not constant 0.0. This cannot be " + "expressed in GLSL."); + } + workaround_lod_array_shadow_as_grad = true; + } + + if (args.is_sparse_feedback) + fname += "sparse"; + + if (args.base.is_fetch) + fname += args.is_sparse_feedback ? "TexelFetch" : "texelFetch"; + else + { + fname += args.is_sparse_feedback ? "Texture" : "texture"; + + if (args.base.is_gather) + fname += "Gather"; + if (args.has_array_offsets) + fname += "Offsets"; + if (args.base.is_proj) + fname += "Proj"; + if (args.has_grad || workaround_lod_array_shadow_as_grad) + fname += "Grad"; + if (args.lod != 0 && !workaround_lod_array_shadow_as_grad) + fname += "Lod"; + } + + if (args.has_offset) + fname += "Offset"; + + if (args.has_min_lod) + fname += "Clamp"; + + if (args.is_sparse_feedback || args.has_min_lod) + fname += "ARB"; + + return (is_legacy() && !args.base.is_gather) ? legacy_tex_op(fname, imgtype, tex) : fname; +} + +std::string CompilerGLSL::convert_separate_image_to_expression(uint32_t id) +{ + auto *var = maybe_get_backing_variable(id); + + // If we are fetching from a plain OpTypeImage, we must combine with a dummy sampler in GLSL. + // In Vulkan GLSL, we can make use of the newer GL_EXT_samplerless_texture_functions. + if (var) + { + auto &type = get(var->basetype); + if (type.basetype == SPIRType::Image && type.image.sampled == 1 && type.image.dim != DimBuffer) + { + if (options.vulkan_semantics) + { + if (dummy_sampler_id) + { + // Don't need to consider Shadow state since the dummy sampler is always non-shadow. + auto sampled_type = type; + sampled_type.basetype = SPIRType::SampledImage; + return join(type_to_glsl(sampled_type), "(", to_non_uniform_aware_expression(id), ", ", + to_expression(dummy_sampler_id), ")"); + } + else + { + // Newer glslang supports this extension to deal with texture2D as argument to texture functions. + require_extension_internal("GL_EXT_samplerless_texture_functions"); + } + } + else + { + if (!dummy_sampler_id) + SPIRV_CROSS_THROW("Cannot find dummy sampler ID. Was " + "build_dummy_sampler_for_combined_images() called?"); + + return to_combined_image_sampler(id, dummy_sampler_id); + } + } + } + + return to_non_uniform_aware_expression(id); +} + +// Returns the function args for a texture sampling function for the specified image and sampling characteristics. +string CompilerGLSL::to_function_args(const TextureFunctionArguments &args, bool *p_forward) +{ + VariableID img = args.base.img; + auto &imgtype = *args.base.imgtype; + + string farg_str; + if (args.base.is_fetch) + farg_str = convert_separate_image_to_expression(img); + else + farg_str = to_non_uniform_aware_expression(img); + + if (args.nonuniform_expression && farg_str.find_first_of('[') != string::npos) + { + // Only emit nonuniformEXT() wrapper if the underlying expression is arrayed in some way. + farg_str = join(backend.nonuniform_qualifier, "(", farg_str, ")"); + } + + bool swizz_func = backend.swizzle_is_function; + auto swizzle = [swizz_func](uint32_t comps, uint32_t in_comps) -> const char * { + if (comps == in_comps) + return ""; + + switch (comps) + { + case 1: + return ".x"; + case 2: + return swizz_func ? ".xy()" : ".xy"; + case 3: + return swizz_func ? ".xyz()" : ".xyz"; + default: + return ""; + } + }; + + bool forward = should_forward(args.coord); + + // The IR can give us more components than we need, so chop them off as needed. + auto swizzle_expr = swizzle(args.coord_components, expression_type(args.coord).vecsize); + // Only enclose the UV expression if needed. + auto coord_expr = + (*swizzle_expr == '\0') ? to_expression(args.coord) : (to_enclosed_expression(args.coord) + swizzle_expr); + + // texelFetch only takes int, not uint. + auto &coord_type = expression_type(args.coord); + if (coord_type.basetype == SPIRType::UInt) + { + auto expected_type = coord_type; + expected_type.vecsize = args.coord_components; + expected_type.basetype = SPIRType::Int; + coord_expr = bitcast_expression(expected_type, coord_type.basetype, coord_expr); + } + + // textureLod on sampler2DArrayShadow and samplerCubeShadow does not exist in GLSL for some reason. + // To emulate this, we will have to use textureGrad with a constant gradient of 0. + // The workaround will assert that the LOD is in fact constant 0, or we cannot emit correct code. + // This happens for HLSL SampleCmpLevelZero on Texture2DArray and TextureCube. + bool workaround_lod_array_shadow_as_grad = + ((imgtype.image.arrayed && imgtype.image.dim == Dim2D) || imgtype.image.dim == DimCube) && + is_depth_image(imgtype, img) && args.lod != 0 && !args.base.is_fetch; + + if (args.dref) + { + forward = forward && should_forward(args.dref); + + // SPIR-V splits dref and coordinate. + if (args.base.is_gather || + args.coord_components == 4) // GLSL also splits the arguments in two. Same for textureGather. + { + farg_str += ", "; + farg_str += to_expression(args.coord); + farg_str += ", "; + farg_str += to_expression(args.dref); + } + else if (args.base.is_proj) + { + // Have to reshuffle so we get vec4(coord, dref, proj), special case. + // Other shading languages splits up the arguments for coord and compare value like SPIR-V. + // The coordinate type for textureProj shadow is always vec4 even for sampler1DShadow. + farg_str += ", vec4("; + + if (imgtype.image.dim == Dim1D) + { + // Could reuse coord_expr, but we will mess up the temporary usage checking. + farg_str += to_enclosed_expression(args.coord) + ".x"; + farg_str += ", "; + farg_str += "0.0, "; + farg_str += to_expression(args.dref); + farg_str += ", "; + farg_str += to_enclosed_expression(args.coord) + ".y)"; + } + else if (imgtype.image.dim == Dim2D) + { + // Could reuse coord_expr, but we will mess up the temporary usage checking. + farg_str += to_enclosed_expression(args.coord) + (swizz_func ? ".xy()" : ".xy"); + farg_str += ", "; + farg_str += to_expression(args.dref); + farg_str += ", "; + farg_str += to_enclosed_expression(args.coord) + ".z)"; + } + else + SPIRV_CROSS_THROW("Invalid type for textureProj with shadow."); + } + else + { + // Create a composite which merges coord/dref into a single vector. + auto type = expression_type(args.coord); + type.vecsize = args.coord_components + 1; + if (imgtype.image.dim == Dim1D && options.es) + type.vecsize++; + farg_str += ", "; + farg_str += type_to_glsl_constructor(type); + farg_str += "("; + + if (imgtype.image.dim == Dim1D && options.es) + { + if (imgtype.image.arrayed) + { + farg_str += enclose_expression(coord_expr) + ".x"; + farg_str += ", 0.0, "; + farg_str += enclose_expression(coord_expr) + ".y"; + } + else + { + farg_str += coord_expr; + farg_str += ", 0.0"; + } + } + else + farg_str += coord_expr; + + farg_str += ", "; + farg_str += to_expression(args.dref); + farg_str += ")"; + } + } + else + { + if (imgtype.image.dim == Dim1D && options.es) + { + // Have to fake a second coordinate. + if (type_is_floating_point(coord_type)) + { + // Cannot mix proj and array. + if (imgtype.image.arrayed || args.base.is_proj) + { + coord_expr = join("vec3(", enclose_expression(coord_expr), ".x, 0.0, ", + enclose_expression(coord_expr), ".y)"); + } + else + coord_expr = join("vec2(", coord_expr, ", 0.0)"); + } + else + { + if (imgtype.image.arrayed) + { + coord_expr = join("ivec3(", enclose_expression(coord_expr), + ".x, 0, ", + enclose_expression(coord_expr), ".y)"); + } + else + coord_expr = join("ivec2(", coord_expr, ", 0)"); + } + } + + farg_str += ", "; + farg_str += coord_expr; + } + + if (args.grad_x || args.grad_y) + { + forward = forward && should_forward(args.grad_x); + forward = forward && should_forward(args.grad_y); + farg_str += ", "; + farg_str += to_expression(args.grad_x); + farg_str += ", "; + farg_str += to_expression(args.grad_y); + } + + if (args.lod) + { + if (workaround_lod_array_shadow_as_grad) + { + // Implement textureGrad() instead. LOD == 0.0 is implemented as gradient of 0.0. + // Implementing this as plain texture() is not safe on some implementations. + if (imgtype.image.dim == Dim2D) + farg_str += ", vec2(0.0), vec2(0.0)"; + else if (imgtype.image.dim == DimCube) + farg_str += ", vec3(0.0), vec3(0.0)"; + } + else + { + forward = forward && should_forward(args.lod); + farg_str += ", "; + + // Lod expression for TexelFetch in GLSL must be int, and only int. + if (args.base.is_fetch && imgtype.image.dim != DimBuffer && !imgtype.image.ms) + farg_str += bitcast_expression(SPIRType::Int, args.lod); + else + farg_str += to_expression(args.lod); + } + } + else if (args.base.is_fetch && imgtype.image.dim != DimBuffer && !imgtype.image.ms) + { + // Lod argument is optional in OpImageFetch, but we require a LOD value, pick 0 as the default. + farg_str += ", 0"; + } + + if (args.offset) + { + forward = forward && should_forward(args.offset); + farg_str += ", "; + farg_str += bitcast_expression(SPIRType::Int, args.offset); + } + + if (args.sample) + { + farg_str += ", "; + farg_str += bitcast_expression(SPIRType::Int, args.sample); + } + + if (args.min_lod) + { + farg_str += ", "; + farg_str += to_expression(args.min_lod); + } + + if (args.sparse_texel) + { + // Sparse texel output parameter comes after everything else, except it's before the optional, component/bias arguments. + farg_str += ", "; + farg_str += to_expression(args.sparse_texel); + } + + if (args.bias) + { + forward = forward && should_forward(args.bias); + farg_str += ", "; + farg_str += to_expression(args.bias); + } + + if (args.component && !expression_is_constant_null(args.component)) + { + forward = forward && should_forward(args.component); + farg_str += ", "; + farg_str += bitcast_expression(SPIRType::Int, args.component); + } + + *p_forward = forward; + + return farg_str; +} + +Op CompilerGLSL::get_remapped_spirv_op(Op op) const +{ + if (options.relax_nan_checks) + { + switch (op) + { + case OpFUnordLessThan: + op = OpFOrdLessThan; + break; + case OpFUnordLessThanEqual: + op = OpFOrdLessThanEqual; + break; + case OpFUnordGreaterThan: + op = OpFOrdGreaterThan; + break; + case OpFUnordGreaterThanEqual: + op = OpFOrdGreaterThanEqual; + break; + case OpFUnordEqual: + op = OpFOrdEqual; + break; + case OpFOrdNotEqual: + op = OpFUnordNotEqual; + break; + + default: + break; + } + } + + return op; +} + +GLSLstd450 CompilerGLSL::get_remapped_glsl_op(GLSLstd450 std450_op) const +{ + // Relax to non-NaN aware opcodes. + if (options.relax_nan_checks) + { + switch (std450_op) + { + case GLSLstd450NClamp: + std450_op = GLSLstd450FClamp; + break; + case GLSLstd450NMin: + std450_op = GLSLstd450FMin; + break; + case GLSLstd450NMax: + std450_op = GLSLstd450FMax; + break; + default: + break; + } + } + + return std450_op; +} + +void CompilerGLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, const uint32_t *args, uint32_t length) +{ + auto op = static_cast(eop); + + if (is_legacy() && is_unsigned_glsl_opcode(op)) + SPIRV_CROSS_THROW("Unsigned integers are not supported on legacy GLSL targets."); + + // If we need to do implicit bitcasts, make sure we do it with the correct type. + uint32_t integer_width = get_integer_width_for_glsl_instruction(op, args, length); + auto int_type = to_signed_basetype(integer_width); + auto uint_type = to_unsigned_basetype(integer_width); + + op = get_remapped_glsl_op(op); + + switch (op) + { + // FP fiddling + case GLSLstd450Round: + if (!is_legacy()) + emit_unary_func_op(result_type, id, args[0], "round"); + else + { + auto op0 = to_enclosed_expression(args[0]); + auto &op0_type = expression_type(args[0]); + auto expr = join("floor(", op0, " + ", type_to_glsl_constructor(op0_type), "(0.5))"); + bool forward = should_forward(args[0]); + emit_op(result_type, id, expr, forward); + inherit_expression_dependencies(id, args[0]); + } + break; + + case GLSLstd450RoundEven: + if (!is_legacy()) + emit_unary_func_op(result_type, id, args[0], "roundEven"); + else if (!options.es) + { + // This extension provides round() with round-to-even semantics. + require_extension_internal("GL_EXT_gpu_shader4"); + emit_unary_func_op(result_type, id, args[0], "round"); + } + else + SPIRV_CROSS_THROW("roundEven supported only in ESSL 300."); + break; + + case GLSLstd450Trunc: + if (!is_legacy()) + emit_unary_func_op(result_type, id, args[0], "trunc"); + else + { + // Implement by value-casting to int and back. + bool forward = should_forward(args[0]); + auto op0 = to_unpacked_expression(args[0]); + auto &op0_type = expression_type(args[0]); + auto via_type = op0_type; + via_type.basetype = SPIRType::Int; + auto expr = join(type_to_glsl(op0_type), "(", type_to_glsl(via_type), "(", op0, "))"); + emit_op(result_type, id, expr, forward); + inherit_expression_dependencies(id, args[0]); + } + break; + + case GLSLstd450SAbs: + emit_unary_func_op_cast(result_type, id, args[0], "abs", int_type, int_type); + break; + case GLSLstd450FAbs: + emit_unary_func_op(result_type, id, args[0], "abs"); + break; + case GLSLstd450SSign: + emit_unary_func_op_cast(result_type, id, args[0], "sign", int_type, int_type); + break; + case GLSLstd450FSign: + emit_unary_func_op(result_type, id, args[0], "sign"); + break; + case GLSLstd450Floor: + emit_unary_func_op(result_type, id, args[0], "floor"); + break; + case GLSLstd450Ceil: + emit_unary_func_op(result_type, id, args[0], "ceil"); + break; + case GLSLstd450Fract: + emit_unary_func_op(result_type, id, args[0], "fract"); + break; + case GLSLstd450Radians: + emit_unary_func_op(result_type, id, args[0], "radians"); + break; + case GLSLstd450Degrees: + emit_unary_func_op(result_type, id, args[0], "degrees"); + break; + case GLSLstd450Fma: + if ((!options.es && options.version < 400) || (options.es && options.version < 320)) + { + auto expr = join(to_enclosed_expression(args[0]), " * ", to_enclosed_expression(args[1]), " + ", + to_enclosed_expression(args[2])); + + emit_op(result_type, id, expr, + should_forward(args[0]) && should_forward(args[1]) && should_forward(args[2])); + for (uint32_t i = 0; i < 3; i++) + inherit_expression_dependencies(id, args[i]); + } + else + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "fma"); + break; + + case GLSLstd450Modf: + register_call_out_argument(args[1]); + if (!is_legacy()) + { + forced_temporaries.insert(id); + emit_binary_func_op(result_type, id, args[0], args[1], "modf"); + } + else + { + //NB. legacy GLSL doesn't have trunc() either, so we do a value cast + auto &op1_type = expression_type(args[1]); + auto via_type = op1_type; + via_type.basetype = SPIRType::Int; + statement(to_expression(args[1]), " = ", + type_to_glsl(op1_type), "(", type_to_glsl(via_type), + "(", to_expression(args[0]), "));"); + emit_binary_op(result_type, id, args[0], args[1], "-"); + } + break; + + case GLSLstd450ModfStruct: + { + auto &type = get(result_type); + emit_uninitialized_temporary_expression(result_type, id); + if (!is_legacy()) + { + statement(to_expression(id), ".", to_member_name(type, 0), " = ", "modf(", to_expression(args[0]), ", ", + to_expression(id), ".", to_member_name(type, 1), ");"); + } + else + { + //NB. legacy GLSL doesn't have trunc() either, so we do a value cast + auto &op0_type = expression_type(args[0]); + auto via_type = op0_type; + via_type.basetype = SPIRType::Int; + statement(to_expression(id), ".", to_member_name(type, 1), " = ", type_to_glsl(op0_type), + "(", type_to_glsl(via_type), "(", to_expression(args[0]), "));"); + statement(to_expression(id), ".", to_member_name(type, 0), " = ", to_enclosed_expression(args[0]), " - ", + to_expression(id), ".", to_member_name(type, 1), ";"); + } + break; + } + + // Minmax + case GLSLstd450UMin: + emit_binary_func_op_cast(result_type, id, args[0], args[1], "min", uint_type, false); + break; + + case GLSLstd450SMin: + emit_binary_func_op_cast(result_type, id, args[0], args[1], "min", int_type, false); + break; + + case GLSLstd450FMin: + emit_binary_func_op(result_type, id, args[0], args[1], "min"); + break; + + case GLSLstd450FMax: + emit_binary_func_op(result_type, id, args[0], args[1], "max"); + break; + + case GLSLstd450UMax: + emit_binary_func_op_cast(result_type, id, args[0], args[1], "max", uint_type, false); + break; + + case GLSLstd450SMax: + emit_binary_func_op_cast(result_type, id, args[0], args[1], "max", int_type, false); + break; + + case GLSLstd450FClamp: + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "clamp"); + break; + + case GLSLstd450UClamp: + emit_trinary_func_op_cast(result_type, id, args[0], args[1], args[2], "clamp", uint_type); + break; + + case GLSLstd450SClamp: + emit_trinary_func_op_cast(result_type, id, args[0], args[1], args[2], "clamp", int_type); + break; + + // Trig + case GLSLstd450Sin: + emit_unary_func_op(result_type, id, args[0], "sin"); + break; + case GLSLstd450Cos: + emit_unary_func_op(result_type, id, args[0], "cos"); + break; + case GLSLstd450Tan: + emit_unary_func_op(result_type, id, args[0], "tan"); + break; + case GLSLstd450Asin: + emit_unary_func_op(result_type, id, args[0], "asin"); + break; + case GLSLstd450Acos: + emit_unary_func_op(result_type, id, args[0], "acos"); + break; + case GLSLstd450Atan: + emit_unary_func_op(result_type, id, args[0], "atan"); + break; + case GLSLstd450Sinh: + if (!is_legacy()) + emit_unary_func_op(result_type, id, args[0], "sinh"); + else + { + bool forward = should_forward(args[0]); + auto expr = join("(exp(", to_expression(args[0]), ") - exp(-", to_enclosed_expression(args[0]), ")) * 0.5"); + emit_op(result_type, id, expr, forward); + inherit_expression_dependencies(id, args[0]); + } + break; + case GLSLstd450Cosh: + if (!is_legacy()) + emit_unary_func_op(result_type, id, args[0], "cosh"); + else + { + bool forward = should_forward(args[0]); + auto expr = join("(exp(", to_expression(args[0]), ") + exp(-", to_enclosed_expression(args[0]), ")) * 0.5"); + emit_op(result_type, id, expr, forward); + inherit_expression_dependencies(id, args[0]); + } + break; + case GLSLstd450Tanh: + if (!is_legacy()) + emit_unary_func_op(result_type, id, args[0], "tanh"); + else + { + // Create temporaries to store the result of exp(arg) and exp(-arg). + uint32_t &ids = extra_sub_expressions[id]; + if (!ids) + { + ids = ir.increase_bound_by(2); + + // Inherit precision qualifier (legacy has no NoContraction). + if (has_decoration(id, DecorationRelaxedPrecision)) + { + set_decoration(ids, DecorationRelaxedPrecision); + set_decoration(ids + 1, DecorationRelaxedPrecision); + } + } + uint32_t epos_id = ids; + uint32_t eneg_id = ids + 1; + + emit_op(result_type, epos_id, join("exp(", to_expression(args[0]), ")"), false); + emit_op(result_type, eneg_id, join("exp(-", to_enclosed_expression(args[0]), ")"), false); + inherit_expression_dependencies(epos_id, args[0]); + inherit_expression_dependencies(eneg_id, args[0]); + + auto expr = join("(", to_enclosed_expression(epos_id), " - ", to_enclosed_expression(eneg_id), ") / " + "(", to_enclosed_expression(epos_id), " + ", to_enclosed_expression(eneg_id), ")"); + emit_op(result_type, id, expr, true); + inherit_expression_dependencies(id, epos_id); + inherit_expression_dependencies(id, eneg_id); + } + break; + case GLSLstd450Asinh: + if (!is_legacy()) + emit_unary_func_op(result_type, id, args[0], "asinh"); + else + emit_emulated_ahyper_op(result_type, id, args[0], GLSLstd450Asinh); + break; + case GLSLstd450Acosh: + if (!is_legacy()) + emit_unary_func_op(result_type, id, args[0], "acosh"); + else + emit_emulated_ahyper_op(result_type, id, args[0], GLSLstd450Acosh); + break; + case GLSLstd450Atanh: + if (!is_legacy()) + emit_unary_func_op(result_type, id, args[0], "atanh"); + else + emit_emulated_ahyper_op(result_type, id, args[0], GLSLstd450Atanh); + break; + case GLSLstd450Atan2: + emit_binary_func_op(result_type, id, args[0], args[1], "atan"); + break; + + // Exponentials + case GLSLstd450Pow: + emit_binary_func_op(result_type, id, args[0], args[1], "pow"); + break; + case GLSLstd450Exp: + emit_unary_func_op(result_type, id, args[0], "exp"); + break; + case GLSLstd450Log: + emit_unary_func_op(result_type, id, args[0], "log"); + break; + case GLSLstd450Exp2: + emit_unary_func_op(result_type, id, args[0], "exp2"); + break; + case GLSLstd450Log2: + emit_unary_func_op(result_type, id, args[0], "log2"); + break; + case GLSLstd450Sqrt: + emit_unary_func_op(result_type, id, args[0], "sqrt"); + break; + case GLSLstd450InverseSqrt: + emit_unary_func_op(result_type, id, args[0], "inversesqrt"); + break; + + // Matrix math + case GLSLstd450Determinant: + { + // No need to transpose - it doesn't affect the determinant + auto *e = maybe_get(args[0]); + bool old_transpose = e && e->need_transpose; + if (old_transpose) + e->need_transpose = false; + + if (options.version < 150) // also matches ES 100 + { + auto &type = expression_type(args[0]); + assert(type.vecsize >= 2 && type.vecsize <= 4); + assert(type.vecsize == type.columns); + + // ARB_gpu_shader_fp64 needs GLSL 150, other types are not valid + if (type.basetype != SPIRType::Float) + SPIRV_CROSS_THROW("Unsupported type for matrix determinant"); + + bool relaxed = has_decoration(id, DecorationRelaxedPrecision); + require_polyfill(static_cast(PolyfillDeterminant2x2 << (type.vecsize - 2)), + relaxed); + emit_unary_func_op(result_type, id, args[0], + (options.es && relaxed) ? "spvDeterminantMP" : "spvDeterminant"); + } + else + emit_unary_func_op(result_type, id, args[0], "determinant"); + + if (old_transpose) + e->need_transpose = true; + break; + } + + case GLSLstd450MatrixInverse: + { + // The inverse of the transpose is the same as the transpose of + // the inverse, so we can just flip need_transpose of the result. + auto *a = maybe_get(args[0]); + bool old_transpose = a && a->need_transpose; + if (old_transpose) + a->need_transpose = false; + + const char *func = "inverse"; + if (options.version < 140) // also matches ES 100 + { + auto &type = get(result_type); + assert(type.vecsize >= 2 && type.vecsize <= 4); + assert(type.vecsize == type.columns); + + // ARB_gpu_shader_fp64 needs GLSL 150, other types are invalid + if (type.basetype != SPIRType::Float) + SPIRV_CROSS_THROW("Unsupported type for matrix inverse"); + + bool relaxed = has_decoration(id, DecorationRelaxedPrecision); + require_polyfill(static_cast(PolyfillMatrixInverse2x2 << (type.vecsize - 2)), + relaxed); + func = (options.es && relaxed) ? "spvInverseMP" : "spvInverse"; + } + + bool forward = should_forward(args[0]); + auto &e = emit_op(result_type, id, join(func, "(", to_unpacked_expression(args[0]), ")"), forward); + inherit_expression_dependencies(id, args[0]); + + if (old_transpose) + { + e.need_transpose = true; + a->need_transpose = true; + } + break; + } + + // Lerping + case GLSLstd450FMix: + case GLSLstd450IMix: + { + emit_mix_op(result_type, id, args[0], args[1], args[2]); + break; + } + case GLSLstd450Step: + emit_binary_func_op(result_type, id, args[0], args[1], "step"); + break; + case GLSLstd450SmoothStep: + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "smoothstep"); + break; + + // Packing + case GLSLstd450Frexp: + register_call_out_argument(args[1]); + forced_temporaries.insert(id); + emit_binary_func_op(result_type, id, args[0], args[1], "frexp"); + break; + + case GLSLstd450FrexpStruct: + { + auto &type = get(result_type); + emit_uninitialized_temporary_expression(result_type, id); + statement(to_expression(id), ".", to_member_name(type, 0), " = ", "frexp(", to_expression(args[0]), ", ", + to_expression(id), ".", to_member_name(type, 1), ");"); + break; + } + + case GLSLstd450Ldexp: + { + bool forward = should_forward(args[0]) && should_forward(args[1]); + + auto op0 = to_unpacked_expression(args[0]); + auto op1 = to_unpacked_expression(args[1]); + auto &op1_type = expression_type(args[1]); + if (op1_type.basetype != SPIRType::Int) + { + // Need a value cast here. + auto target_type = op1_type; + target_type.basetype = SPIRType::Int; + op1 = join(type_to_glsl_constructor(target_type), "(", op1, ")"); + } + + auto expr = join("ldexp(", op0, ", ", op1, ")"); + + emit_op(result_type, id, expr, forward); + inherit_expression_dependencies(id, args[0]); + inherit_expression_dependencies(id, args[1]); + break; + } + + case GLSLstd450PackSnorm4x8: + emit_unary_func_op(result_type, id, args[0], "packSnorm4x8"); + break; + case GLSLstd450PackUnorm4x8: + emit_unary_func_op(result_type, id, args[0], "packUnorm4x8"); + break; + case GLSLstd450PackSnorm2x16: + emit_unary_func_op(result_type, id, args[0], "packSnorm2x16"); + break; + case GLSLstd450PackUnorm2x16: + emit_unary_func_op(result_type, id, args[0], "packUnorm2x16"); + break; + case GLSLstd450PackHalf2x16: + emit_unary_func_op(result_type, id, args[0], "packHalf2x16"); + break; + case GLSLstd450UnpackSnorm4x8: + emit_unary_func_op(result_type, id, args[0], "unpackSnorm4x8"); + break; + case GLSLstd450UnpackUnorm4x8: + emit_unary_func_op(result_type, id, args[0], "unpackUnorm4x8"); + break; + case GLSLstd450UnpackSnorm2x16: + emit_unary_func_op(result_type, id, args[0], "unpackSnorm2x16"); + break; + case GLSLstd450UnpackUnorm2x16: + emit_unary_func_op(result_type, id, args[0], "unpackUnorm2x16"); + break; + case GLSLstd450UnpackHalf2x16: + emit_unary_func_op(result_type, id, args[0], "unpackHalf2x16"); + break; + + case GLSLstd450PackDouble2x32: + emit_unary_func_op(result_type, id, args[0], "packDouble2x32"); + break; + case GLSLstd450UnpackDouble2x32: + emit_unary_func_op(result_type, id, args[0], "unpackDouble2x32"); + break; + + // Vector math + case GLSLstd450Length: + emit_unary_func_op(result_type, id, args[0], "length"); + break; + case GLSLstd450Distance: + emit_binary_func_op(result_type, id, args[0], args[1], "distance"); + break; + case GLSLstd450Cross: + emit_binary_func_op(result_type, id, args[0], args[1], "cross"); + break; + case GLSLstd450Normalize: + emit_unary_func_op(result_type, id, args[0], "normalize"); + break; + case GLSLstd450FaceForward: + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "faceforward"); + break; + case GLSLstd450Reflect: + emit_binary_func_op(result_type, id, args[0], args[1], "reflect"); + break; + case GLSLstd450Refract: + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "refract"); + break; + + // Bit-fiddling + case GLSLstd450FindILsb: + // findLSB always returns int. + emit_unary_func_op_cast(result_type, id, args[0], "findLSB", expression_type(args[0]).basetype, int_type); + break; + + case GLSLstd450FindSMsb: + emit_unary_func_op_cast(result_type, id, args[0], "findMSB", int_type, int_type); + break; + + case GLSLstd450FindUMsb: + emit_unary_func_op_cast(result_type, id, args[0], "findMSB", uint_type, + int_type); // findMSB always returns int. + break; + + // Multisampled varying + case GLSLstd450InterpolateAtCentroid: + emit_unary_func_op(result_type, id, args[0], "interpolateAtCentroid"); + break; + case GLSLstd450InterpolateAtSample: + emit_binary_func_op(result_type, id, args[0], args[1], "interpolateAtSample"); + break; + case GLSLstd450InterpolateAtOffset: + emit_binary_func_op(result_type, id, args[0], args[1], "interpolateAtOffset"); + break; + + case GLSLstd450NMin: + case GLSLstd450NMax: + { + if (options.vulkan_semantics) + { + require_extension_internal("GL_EXT_spirv_intrinsics"); + bool relaxed = has_decoration(id, DecorationRelaxedPrecision); + Polyfill poly = {}; + switch (get(result_type).width) + { + case 16: + poly = op == GLSLstd450NMin ? PolyfillNMin16 : PolyfillNMax16; + break; + + case 32: + poly = op == GLSLstd450NMin ? PolyfillNMin32 : PolyfillNMax32; + break; + + case 64: + poly = op == GLSLstd450NMin ? PolyfillNMin64 : PolyfillNMax64; + break; + + default: + SPIRV_CROSS_THROW("Invalid bit width for NMin/NMax."); + } + + require_polyfill(poly, relaxed); + + // Function return decorations are broken, so need to do double polyfill. + if (relaxed) + require_polyfill(poly, false); + + const char *op_str; + if (relaxed) + op_str = op == GLSLstd450NMin ? "spvNMinRelaxed" : "spvNMaxRelaxed"; + else + op_str = op == GLSLstd450NMin ? "spvNMin" : "spvNMax"; + + emit_binary_func_op(result_type, id, args[0], args[1], op_str); + } + else + { + emit_nminmax_op(result_type, id, args[0], args[1], op); + } + break; + } + + case GLSLstd450NClamp: + { + if (options.vulkan_semantics) + { + require_extension_internal("GL_EXT_spirv_intrinsics"); + bool relaxed = has_decoration(id, DecorationRelaxedPrecision); + Polyfill poly = {}; + switch (get(result_type).width) + { + case 16: + poly = PolyfillNClamp16; + break; + + case 32: + poly = PolyfillNClamp32; + break; + + case 64: + poly = PolyfillNClamp64; + break; + + default: + SPIRV_CROSS_THROW("Invalid bit width for NMin/NMax."); + } + + require_polyfill(poly, relaxed); + + // Function return decorations are broken, so need to do double polyfill. + if (relaxed) + require_polyfill(poly, false); + + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], relaxed ? "spvNClampRelaxed" : "spvNClamp"); + } + else + { + // Make sure we have a unique ID here to avoid aliasing the extra sub-expressions between clamp and NMin sub-op. + // IDs cannot exceed 24 bits, so we can make use of the higher bits for some unique flags. + uint32_t &max_id = extra_sub_expressions[id | EXTRA_SUB_EXPRESSION_TYPE_AUX]; + if (!max_id) + max_id = ir.increase_bound_by(1); + + // Inherit precision qualifiers. + ir.meta[max_id] = ir.meta[id]; + + emit_nminmax_op(result_type, max_id, args[0], args[1], GLSLstd450NMax); + emit_nminmax_op(result_type, id, max_id, args[2], GLSLstd450NMin); + } + break; + } + + default: + statement("// unimplemented GLSL op ", eop); + break; + } +} + +void CompilerGLSL::emit_nminmax_op(uint32_t result_type, uint32_t id, uint32_t op0, uint32_t op1, GLSLstd450 op) +{ + // Need to emulate this call. + uint32_t &ids = extra_sub_expressions[id]; + if (!ids) + { + ids = ir.increase_bound_by(5); + auto btype = get(result_type); + btype.basetype = SPIRType::Boolean; + set(ids, btype); + } + + uint32_t btype_id = ids + 0; + uint32_t left_nan_id = ids + 1; + uint32_t right_nan_id = ids + 2; + uint32_t tmp_id = ids + 3; + uint32_t mixed_first_id = ids + 4; + + // Inherit precision qualifiers. + ir.meta[tmp_id] = ir.meta[id]; + ir.meta[mixed_first_id] = ir.meta[id]; + + if (!is_legacy()) + { + emit_unary_func_op(btype_id, left_nan_id, op0, "isnan"); + emit_unary_func_op(btype_id, right_nan_id, op1, "isnan"); + } + else if (expression_type(op0).vecsize > 1) + { + // If the number doesn't equal itself, it must be NaN + emit_binary_func_op(btype_id, left_nan_id, op0, op0, "notEqual"); + emit_binary_func_op(btype_id, right_nan_id, op1, op1, "notEqual"); + } + else + { + emit_binary_op(btype_id, left_nan_id, op0, op0, "!="); + emit_binary_op(btype_id, right_nan_id, op1, op1, "!="); + } + emit_binary_func_op(result_type, tmp_id, op0, op1, op == GLSLstd450NMin ? "min" : "max"); + emit_mix_op(result_type, mixed_first_id, tmp_id, op1, left_nan_id); + emit_mix_op(result_type, id, mixed_first_id, op0, right_nan_id); +} + +void CompilerGLSL::emit_emulated_ahyper_op(uint32_t result_type, uint32_t id, uint32_t op0, GLSLstd450 op) +{ + const char *one = backend.float_literal_suffix ? "1.0f" : "1.0"; + std::string expr; + bool forward = should_forward(op0); + + switch (op) + { + case GLSLstd450Asinh: + expr = join("log(", to_enclosed_expression(op0), " + sqrt(", + to_enclosed_expression(op0), " * ", to_enclosed_expression(op0), " + ", one, "))"); + emit_op(result_type, id, expr, forward); + break; + + case GLSLstd450Acosh: + expr = join("log(", to_enclosed_expression(op0), " + sqrt(", + to_enclosed_expression(op0), " * ", to_enclosed_expression(op0), " - ", one, "))"); + break; + + case GLSLstd450Atanh: + expr = join("log((", one, " + ", to_enclosed_expression(op0), ") / " + "(", one, " - ", to_enclosed_expression(op0), ")) * 0.5", + backend.float_literal_suffix ? "f" : ""); + break; + + default: + SPIRV_CROSS_THROW("Invalid op."); + } + + emit_op(result_type, id, expr, forward); + inherit_expression_dependencies(id, op0); +} + +void CompilerGLSL::emit_spv_amd_shader_ballot_op(uint32_t result_type, uint32_t id, uint32_t eop, const uint32_t *args, + uint32_t) +{ + require_extension_internal("GL_AMD_shader_ballot"); + + enum AMDShaderBallot + { + SwizzleInvocationsAMD = 1, + SwizzleInvocationsMaskedAMD = 2, + WriteInvocationAMD = 3, + MbcntAMD = 4 + }; + + auto op = static_cast(eop); + + switch (op) + { + case SwizzleInvocationsAMD: + emit_binary_func_op(result_type, id, args[0], args[1], "swizzleInvocationsAMD"); + register_control_dependent_expression(id); + break; + + case SwizzleInvocationsMaskedAMD: + emit_binary_func_op(result_type, id, args[0], args[1], "swizzleInvocationsMaskedAMD"); + register_control_dependent_expression(id); + break; + + case WriteInvocationAMD: + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "writeInvocationAMD"); + register_control_dependent_expression(id); + break; + + case MbcntAMD: + emit_unary_func_op(result_type, id, args[0], "mbcntAMD"); + register_control_dependent_expression(id); + break; + + default: + statement("// unimplemented SPV AMD shader ballot op ", eop); + break; + } +} + +void CompilerGLSL::emit_spv_amd_shader_explicit_vertex_parameter_op(uint32_t result_type, uint32_t id, uint32_t eop, + const uint32_t *args, uint32_t) +{ + require_extension_internal("GL_AMD_shader_explicit_vertex_parameter"); + + enum AMDShaderExplicitVertexParameter + { + InterpolateAtVertexAMD = 1 + }; + + auto op = static_cast(eop); + + switch (op) + { + case InterpolateAtVertexAMD: + emit_binary_func_op(result_type, id, args[0], args[1], "interpolateAtVertexAMD"); + break; + + default: + statement("// unimplemented SPV AMD shader explicit vertex parameter op ", eop); + break; + } +} + +void CompilerGLSL::emit_spv_amd_shader_trinary_minmax_op(uint32_t result_type, uint32_t id, uint32_t eop, + const uint32_t *args, uint32_t) +{ + require_extension_internal("GL_AMD_shader_trinary_minmax"); + + enum AMDShaderTrinaryMinMax + { + FMin3AMD = 1, + UMin3AMD = 2, + SMin3AMD = 3, + FMax3AMD = 4, + UMax3AMD = 5, + SMax3AMD = 6, + FMid3AMD = 7, + UMid3AMD = 8, + SMid3AMD = 9 + }; + + auto op = static_cast(eop); + + switch (op) + { + case FMin3AMD: + case UMin3AMD: + case SMin3AMD: + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "min3"); + break; + + case FMax3AMD: + case UMax3AMD: + case SMax3AMD: + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "max3"); + break; + + case FMid3AMD: + case UMid3AMD: + case SMid3AMD: + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "mid3"); + break; + + default: + statement("// unimplemented SPV AMD shader trinary minmax op ", eop); + break; + } +} + +void CompilerGLSL::emit_spv_amd_gcn_shader_op(uint32_t result_type, uint32_t id, uint32_t eop, const uint32_t *args, + uint32_t) +{ + require_extension_internal("GL_AMD_gcn_shader"); + + enum AMDGCNShader + { + CubeFaceIndexAMD = 1, + CubeFaceCoordAMD = 2, + TimeAMD = 3 + }; + + auto op = static_cast(eop); + + switch (op) + { + case CubeFaceIndexAMD: + emit_unary_func_op(result_type, id, args[0], "cubeFaceIndexAMD"); + break; + case CubeFaceCoordAMD: + emit_unary_func_op(result_type, id, args[0], "cubeFaceCoordAMD"); + break; + case TimeAMD: + { + string expr = "timeAMD()"; + emit_op(result_type, id, expr, true); + register_control_dependent_expression(id); + break; + } + + default: + statement("// unimplemented SPV AMD gcn shader op ", eop); + break; + } +} + +void CompilerGLSL::emit_subgroup_op(const Instruction &i) +{ + const uint32_t *ops = stream(i); + auto op = static_cast(i.op); + + if (!options.vulkan_semantics && !is_supported_subgroup_op_in_opengl(op, ops)) + SPIRV_CROSS_THROW("This subgroup operation is only supported in Vulkan semantics."); + + // If we need to do implicit bitcasts, make sure we do it with the correct type. + uint32_t integer_width = get_integer_width_for_instruction(i); + auto int_type = to_signed_basetype(integer_width); + auto uint_type = to_unsigned_basetype(integer_width); + + if (options.vulkan_semantics) + { + auto &return_type = get(ops[0]); + switch (return_type.basetype) + { + case SPIRType::SByte: + case SPIRType::UByte: + require_extension_internal("GL_EXT_shader_subgroup_extended_types_int8"); + break; + + case SPIRType::Short: + case SPIRType::UShort: + require_extension_internal("GL_EXT_shader_subgroup_extended_types_int16"); + break; + + case SPIRType::Half: + require_extension_internal("GL_EXT_shader_subgroup_extended_types_float16"); + break; + + case SPIRType::Int64: + case SPIRType::UInt64: + require_extension_internal("GL_EXT_shader_subgroup_extended_types_int64"); + break; + + default: + break; + } + } + + switch (op) + { + case OpGroupNonUniformElect: + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupElect); + break; + + case OpGroupNonUniformBallotBitCount: + { + const GroupOperation operation = static_cast(ops[3]); + if (operation == GroupOperationReduce) + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupBallotBitCount); + else if (operation == GroupOperationInclusiveScan || operation == GroupOperationExclusiveScan) + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupInverseBallot_InclBitCount_ExclBitCout); + } + break; + + case OpGroupNonUniformBallotBitExtract: + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupBallotBitExtract); + break; + + case OpGroupNonUniformInverseBallot: + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupInverseBallot_InclBitCount_ExclBitCout); + break; + + case OpGroupNonUniformBallot: + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupBallot); + break; + + case OpGroupNonUniformBallotFindLSB: + case OpGroupNonUniformBallotFindMSB: + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupBallotFindLSB_MSB); + break; + + case OpGroupNonUniformBroadcast: + case OpGroupNonUniformBroadcastFirst: + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupBroadcast_First); + break; + + case OpGroupNonUniformShuffle: + case OpGroupNonUniformShuffleXor: + require_extension_internal("GL_KHR_shader_subgroup_shuffle"); + break; + + case OpGroupNonUniformShuffleUp: + case OpGroupNonUniformShuffleDown: + require_extension_internal("GL_KHR_shader_subgroup_shuffle_relative"); + break; + + case OpGroupNonUniformRotateKHR: + require_extension_internal("GL_KHR_shader_subgroup_rotate"); + break; + + case OpGroupNonUniformAll: + case OpGroupNonUniformAny: + case OpGroupNonUniformAllEqual: + { + const SPIRType &type = expression_type(ops[3]); + if (type.basetype == SPIRType::BaseType::Boolean && type.vecsize == 1u) + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupAll_Any_AllEqualBool); + else + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupAllEqualT); + } + break; + + // clang-format off +#define GLSL_GROUP_OP(OP)\ + case OpGroupNonUniform##OP:\ + {\ + auto operation = static_cast(ops[3]);\ + if (operation == GroupOperationClusteredReduce)\ + require_extension_internal("GL_KHR_shader_subgroup_clustered");\ + else if (operation == GroupOperationReduce)\ + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupArithmetic##OP##Reduce);\ + else if (operation == GroupOperationExclusiveScan)\ + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupArithmetic##OP##ExclusiveScan);\ + else if (operation == GroupOperationInclusiveScan)\ + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupArithmetic##OP##InclusiveScan);\ + else\ + SPIRV_CROSS_THROW("Invalid group operation.");\ + break;\ + } + + GLSL_GROUP_OP(IAdd) + GLSL_GROUP_OP(FAdd) + GLSL_GROUP_OP(IMul) + GLSL_GROUP_OP(FMul) + +#undef GLSL_GROUP_OP + // clang-format on + + case OpGroupNonUniformFMin: + case OpGroupNonUniformFMax: + case OpGroupNonUniformSMin: + case OpGroupNonUniformSMax: + case OpGroupNonUniformUMin: + case OpGroupNonUniformUMax: + case OpGroupNonUniformBitwiseAnd: + case OpGroupNonUniformBitwiseOr: + case OpGroupNonUniformBitwiseXor: + case OpGroupNonUniformLogicalAnd: + case OpGroupNonUniformLogicalOr: + case OpGroupNonUniformLogicalXor: + { + auto operation = static_cast(ops[3]); + if (operation == GroupOperationClusteredReduce) + { + require_extension_internal("GL_KHR_shader_subgroup_clustered"); + } + else if (operation == GroupOperationExclusiveScan || operation == GroupOperationInclusiveScan || + operation == GroupOperationReduce) + { + require_extension_internal("GL_KHR_shader_subgroup_arithmetic"); + } + else + SPIRV_CROSS_THROW("Invalid group operation."); + break; + } + + case OpGroupNonUniformQuadSwap: + case OpGroupNonUniformQuadBroadcast: + require_extension_internal("GL_KHR_shader_subgroup_quad"); + break; + + case OpGroupNonUniformQuadAllKHR: + case OpGroupNonUniformQuadAnyKHR: + // Require both extensions to be enabled. + require_extension_internal("GL_KHR_shader_subgroup_vote"); + require_extension_internal("GL_EXT_shader_quad_control"); + break; + + default: + SPIRV_CROSS_THROW("Invalid opcode for subgroup."); + } + + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + // These quad ops do not have a scope parameter. + if (op != OpGroupNonUniformQuadAllKHR && op != OpGroupNonUniformQuadAnyKHR) + { + auto scope = static_cast(evaluate_constant_u32(ops[2])); + if (scope != ScopeSubgroup) + SPIRV_CROSS_THROW("Only subgroup scope is supported."); + } + + switch (op) + { + case OpGroupNonUniformElect: + emit_op(result_type, id, "subgroupElect()", true); + break; + + case OpGroupNonUniformBroadcast: + emit_binary_func_op(result_type, id, ops[3], ops[4], "subgroupBroadcast"); + break; + + case OpGroupNonUniformBroadcastFirst: + emit_unary_func_op(result_type, id, ops[3], "subgroupBroadcastFirst"); + break; + + case OpGroupNonUniformBallot: + emit_unary_func_op(result_type, id, ops[3], "subgroupBallot"); + break; + + case OpGroupNonUniformInverseBallot: + emit_unary_func_op(result_type, id, ops[3], "subgroupInverseBallot"); + break; + + case OpGroupNonUniformBallotBitExtract: + emit_binary_func_op(result_type, id, ops[3], ops[4], "subgroupBallotBitExtract"); + break; + + case OpGroupNonUniformBallotFindLSB: + emit_unary_func_op(result_type, id, ops[3], "subgroupBallotFindLSB"); + break; + + case OpGroupNonUniformBallotFindMSB: + emit_unary_func_op(result_type, id, ops[3], "subgroupBallotFindMSB"); + break; + + case OpGroupNonUniformBallotBitCount: + { + auto operation = static_cast(ops[3]); + if (operation == GroupOperationReduce) + emit_unary_func_op(result_type, id, ops[4], "subgroupBallotBitCount"); + else if (operation == GroupOperationInclusiveScan) + emit_unary_func_op(result_type, id, ops[4], "subgroupBallotInclusiveBitCount"); + else if (operation == GroupOperationExclusiveScan) + emit_unary_func_op(result_type, id, ops[4], "subgroupBallotExclusiveBitCount"); + else + SPIRV_CROSS_THROW("Invalid BitCount operation."); + break; + } + + case OpGroupNonUniformShuffle: + emit_binary_func_op(result_type, id, ops[3], ops[4], "subgroupShuffle"); + break; + + case OpGroupNonUniformShuffleXor: + emit_binary_func_op(result_type, id, ops[3], ops[4], "subgroupShuffleXor"); + break; + + case OpGroupNonUniformShuffleUp: + emit_binary_func_op(result_type, id, ops[3], ops[4], "subgroupShuffleUp"); + break; + + case OpGroupNonUniformShuffleDown: + emit_binary_func_op(result_type, id, ops[3], ops[4], "subgroupShuffleDown"); + break; + + case OpGroupNonUniformRotateKHR: + if (i.length > 5) + emit_trinary_func_op(result_type, id, ops[3], ops[4], ops[5], "subgroupClusteredRotate"); + else + emit_binary_func_op(result_type, id, ops[3], ops[4], "subgroupRotate"); + break; + + case OpGroupNonUniformAll: + emit_unary_func_op(result_type, id, ops[3], "subgroupAll"); + break; + + case OpGroupNonUniformAny: + emit_unary_func_op(result_type, id, ops[3], "subgroupAny"); + break; + + case OpGroupNonUniformAllEqual: + emit_unary_func_op(result_type, id, ops[3], "subgroupAllEqual"); + break; + + // clang-format off +#define GLSL_GROUP_OP(op, glsl_op) \ +case OpGroupNonUniform##op: \ + { \ + auto operation = static_cast(ops[3]); \ + if (operation == GroupOperationReduce) \ + emit_unary_func_op(result_type, id, ops[4], "subgroup" #glsl_op); \ + else if (operation == GroupOperationInclusiveScan) \ + emit_unary_func_op(result_type, id, ops[4], "subgroupInclusive" #glsl_op); \ + else if (operation == GroupOperationExclusiveScan) \ + emit_unary_func_op(result_type, id, ops[4], "subgroupExclusive" #glsl_op); \ + else if (operation == GroupOperationClusteredReduce) \ + emit_binary_func_op(result_type, id, ops[4], ops[5], "subgroupClustered" #glsl_op); \ + else \ + SPIRV_CROSS_THROW("Invalid group operation."); \ + break; \ + } + +#define GLSL_GROUP_OP_CAST(op, glsl_op, type) \ +case OpGroupNonUniform##op: \ + { \ + auto operation = static_cast(ops[3]); \ + if (operation == GroupOperationReduce) \ + emit_unary_func_op_cast(result_type, id, ops[4], "subgroup" #glsl_op, type, type); \ + else if (operation == GroupOperationInclusiveScan) \ + emit_unary_func_op_cast(result_type, id, ops[4], "subgroupInclusive" #glsl_op, type, type); \ + else if (operation == GroupOperationExclusiveScan) \ + emit_unary_func_op_cast(result_type, id, ops[4], "subgroupExclusive" #glsl_op, type, type); \ + else if (operation == GroupOperationClusteredReduce) \ + emit_binary_func_op_cast_clustered(result_type, id, ops[4], ops[5], "subgroupClustered" #glsl_op, type); \ + else \ + SPIRV_CROSS_THROW("Invalid group operation."); \ + break; \ + } + + GLSL_GROUP_OP(FAdd, Add) + GLSL_GROUP_OP(FMul, Mul) + GLSL_GROUP_OP(FMin, Min) + GLSL_GROUP_OP(FMax, Max) + GLSL_GROUP_OP(IAdd, Add) + GLSL_GROUP_OP(IMul, Mul) + GLSL_GROUP_OP_CAST(SMin, Min, int_type) + GLSL_GROUP_OP_CAST(SMax, Max, int_type) + GLSL_GROUP_OP_CAST(UMin, Min, uint_type) + GLSL_GROUP_OP_CAST(UMax, Max, uint_type) + GLSL_GROUP_OP(BitwiseAnd, And) + GLSL_GROUP_OP(BitwiseOr, Or) + GLSL_GROUP_OP(BitwiseXor, Xor) + GLSL_GROUP_OP(LogicalAnd, And) + GLSL_GROUP_OP(LogicalOr, Or) + GLSL_GROUP_OP(LogicalXor, Xor) +#undef GLSL_GROUP_OP +#undef GLSL_GROUP_OP_CAST + // clang-format on + + case OpGroupNonUniformQuadSwap: + { + uint32_t direction = evaluate_constant_u32(ops[4]); + if (direction == 0) + emit_unary_func_op(result_type, id, ops[3], "subgroupQuadSwapHorizontal"); + else if (direction == 1) + emit_unary_func_op(result_type, id, ops[3], "subgroupQuadSwapVertical"); + else if (direction == 2) + emit_unary_func_op(result_type, id, ops[3], "subgroupQuadSwapDiagonal"); + else + SPIRV_CROSS_THROW("Invalid quad swap direction."); + break; + } + + case OpGroupNonUniformQuadBroadcast: + { + emit_binary_func_op(result_type, id, ops[3], ops[4], "subgroupQuadBroadcast"); + break; + } + + case OpGroupNonUniformQuadAllKHR: + emit_unary_func_op(result_type, id, ops[2], "subgroupQuadAll"); + break; + + case OpGroupNonUniformQuadAnyKHR: + emit_unary_func_op(result_type, id, ops[2], "subgroupQuadAny"); + break; + + default: + SPIRV_CROSS_THROW("Invalid opcode for subgroup."); + } + + register_control_dependent_expression(id); +} + +string CompilerGLSL::bitcast_glsl_op(const SPIRType &out_type, const SPIRType &in_type) +{ + // OpBitcast can deal with pointers. + if (out_type.pointer || in_type.pointer) + { + if (out_type.vecsize == 2 || in_type.vecsize == 2) + require_extension_internal("GL_EXT_buffer_reference_uvec2"); + return type_to_glsl(out_type); + } + + if (out_type.basetype == in_type.basetype) + return ""; + + assert(out_type.basetype != SPIRType::Boolean); + assert(in_type.basetype != SPIRType::Boolean); + + bool integral_cast = type_is_integral(out_type) && type_is_integral(in_type); + bool same_size_cast = out_type.width == in_type.width; + + // Trivial bitcast case, casts between integers. + if (integral_cast && same_size_cast) + return type_to_glsl(out_type); + + // Catch-all 8-bit arithmetic casts (GL_EXT_shader_explicit_arithmetic_types). + if (out_type.width == 8 && in_type.width >= 16 && integral_cast && in_type.vecsize == 1) + return "unpack8"; + else if (in_type.width == 8 && out_type.width == 16 && integral_cast && out_type.vecsize == 1) + return "pack16"; + else if (in_type.width == 8 && out_type.width == 32 && integral_cast && out_type.vecsize == 1) + return "pack32"; + + // Floating <-> Integer special casts. Just have to enumerate all cases. :( + // 16-bit, 32-bit and 64-bit floats. + if (out_type.basetype == SPIRType::UInt && in_type.basetype == SPIRType::Float) + { + if (is_legacy_es()) + SPIRV_CROSS_THROW("Float -> Uint bitcast not supported on legacy ESSL."); + else if (!options.es && options.version < 330) + require_extension_internal("GL_ARB_shader_bit_encoding"); + return "floatBitsToUint"; + } + else if (out_type.basetype == SPIRType::Int && in_type.basetype == SPIRType::Float) + { + if (is_legacy_es()) + SPIRV_CROSS_THROW("Float -> Int bitcast not supported on legacy ESSL."); + else if (!options.es && options.version < 330) + require_extension_internal("GL_ARB_shader_bit_encoding"); + return "floatBitsToInt"; + } + else if (out_type.basetype == SPIRType::Float && in_type.basetype == SPIRType::UInt) + { + if (is_legacy_es()) + SPIRV_CROSS_THROW("Uint -> Float bitcast not supported on legacy ESSL."); + else if (!options.es && options.version < 330) + require_extension_internal("GL_ARB_shader_bit_encoding"); + return "uintBitsToFloat"; + } + else if (out_type.basetype == SPIRType::Float && in_type.basetype == SPIRType::Int) + { + if (is_legacy_es()) + SPIRV_CROSS_THROW("Int -> Float bitcast not supported on legacy ESSL."); + else if (!options.es && options.version < 330) + require_extension_internal("GL_ARB_shader_bit_encoding"); + return "intBitsToFloat"; + } + + else if (out_type.basetype == SPIRType::Int64 && in_type.basetype == SPIRType::Double) + return "doubleBitsToInt64"; + else if (out_type.basetype == SPIRType::UInt64 && in_type.basetype == SPIRType::Double) + return "doubleBitsToUint64"; + else if (out_type.basetype == SPIRType::Double && in_type.basetype == SPIRType::Int64) + return "int64BitsToDouble"; + else if (out_type.basetype == SPIRType::Double && in_type.basetype == SPIRType::UInt64) + return "uint64BitsToDouble"; + else if (out_type.basetype == SPIRType::Short && in_type.basetype == SPIRType::Half) + return "float16BitsToInt16"; + else if (out_type.basetype == SPIRType::UShort && in_type.basetype == SPIRType::Half) + return "float16BitsToUint16"; + else if (out_type.basetype == SPIRType::Half && in_type.basetype == SPIRType::Short) + return "int16BitsToFloat16"; + else if (out_type.basetype == SPIRType::Half && in_type.basetype == SPIRType::UShort) + return "uint16BitsToFloat16"; + + // And finally, some even more special purpose casts. + if (out_type.basetype == SPIRType::UInt64 && in_type.basetype == SPIRType::UInt && in_type.vecsize == 2) + return "packUint2x32"; + else if (out_type.basetype == SPIRType::UInt && in_type.basetype == SPIRType::UInt64 && out_type.vecsize == 2) + return "unpackUint2x32"; + else if (out_type.basetype == SPIRType::Half && in_type.basetype == SPIRType::UInt && in_type.vecsize == 1) + return "unpackFloat2x16"; + else if (out_type.basetype == SPIRType::UInt && in_type.basetype == SPIRType::Half && in_type.vecsize == 2) + return "packFloat2x16"; + else if (out_type.basetype == SPIRType::Int && in_type.basetype == SPIRType::Short && in_type.vecsize == 2) + return "packInt2x16"; + else if (out_type.basetype == SPIRType::Short && in_type.basetype == SPIRType::Int && in_type.vecsize == 1) + return "unpackInt2x16"; + else if (out_type.basetype == SPIRType::UInt && in_type.basetype == SPIRType::UShort && in_type.vecsize == 2) + return "packUint2x16"; + else if (out_type.basetype == SPIRType::UShort && in_type.basetype == SPIRType::UInt && in_type.vecsize == 1) + return "unpackUint2x16"; + else if (out_type.basetype == SPIRType::Int64 && in_type.basetype == SPIRType::Short && in_type.vecsize == 4) + return "packInt4x16"; + else if (out_type.basetype == SPIRType::Short && in_type.basetype == SPIRType::Int64 && in_type.vecsize == 1) + return "unpackInt4x16"; + else if (out_type.basetype == SPIRType::UInt64 && in_type.basetype == SPIRType::UShort && in_type.vecsize == 4) + return "packUint4x16"; + else if (out_type.basetype == SPIRType::UShort && in_type.basetype == SPIRType::UInt64 && in_type.vecsize == 1) + return "unpackUint4x16"; + else if (out_type.basetype == SPIRType::BFloat16 && in_type.basetype == SPIRType::UShort) + return "uintBitsToBFloat16EXT"; + else if (out_type.basetype == SPIRType::BFloat16 && in_type.basetype == SPIRType::Short) + return "intBitsToBFloat16EXT"; + else if (out_type.basetype == SPIRType::UShort && in_type.basetype == SPIRType::BFloat16) + return "bfloat16BitsToUintEXT"; + else if (out_type.basetype == SPIRType::Short && in_type.basetype == SPIRType::BFloat16) + return "bfloat16BitsToIntEXT"; + else if (out_type.basetype == SPIRType::FloatE4M3 && in_type.basetype == SPIRType::UByte) + return "uintBitsToFloate4m3EXT"; + else if (out_type.basetype == SPIRType::FloatE4M3 && in_type.basetype == SPIRType::SByte) + return "intBitsToFloate4m3EXT"; + else if (out_type.basetype == SPIRType::UByte && in_type.basetype == SPIRType::FloatE4M3) + return "floate4m3BitsToUintEXT"; + else if (out_type.basetype == SPIRType::SByte && in_type.basetype == SPIRType::FloatE4M3) + return "floate4m3BitsToIntEXT"; + else if (out_type.basetype == SPIRType::FloatE5M2 && in_type.basetype == SPIRType::UByte) + return "uintBitsToFloate5m2EXT"; + else if (out_type.basetype == SPIRType::FloatE5M2 && in_type.basetype == SPIRType::SByte) + return "intBitsToFloate5m2EXT"; + else if (out_type.basetype == SPIRType::UByte && in_type.basetype == SPIRType::FloatE5M2) + return "floate5m2BitsToUintEXT"; + else if (out_type.basetype == SPIRType::SByte && in_type.basetype == SPIRType::FloatE5M2) + return "floate5m2BitsToIntEXT"; + + return ""; +} + +string CompilerGLSL::bitcast_glsl(const SPIRType &result_type, uint32_t argument) +{ + auto op = bitcast_glsl_op(result_type, expression_type(argument)); + if (op.empty()) + return to_enclosed_unpacked_expression(argument); + else + return join(op, "(", to_unpacked_expression(argument), ")"); +} + +std::string CompilerGLSL::bitcast_expression(SPIRType::BaseType target_type, uint32_t arg) +{ + auto expr = to_expression(arg); + auto &src_type = expression_type(arg); + if (src_type.basetype != target_type) + { + auto target = src_type; + target.basetype = target_type; + expr = join(bitcast_glsl_op(target, src_type), "(", expr, ")"); + } + + return expr; +} + +std::string CompilerGLSL::bitcast_expression(const SPIRType &target_type, SPIRType::BaseType expr_type, + const std::string &expr) +{ + if (target_type.basetype == expr_type) + return expr; + + auto src_type = target_type; + src_type.basetype = expr_type; + return join(bitcast_glsl_op(target_type, src_type), "(", expr, ")"); +} + +string CompilerGLSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage) +{ + switch (builtin) + { + case BuiltInPosition: + return "gl_Position"; + case BuiltInPointSize: + return "gl_PointSize"; + case BuiltInClipDistance: + { + if (options.es) + require_extension_internal("GL_EXT_clip_cull_distance"); + return "gl_ClipDistance"; + } + case BuiltInCullDistance: + { + if (options.es) + require_extension_internal("GL_EXT_clip_cull_distance"); + return "gl_CullDistance"; + } + case BuiltInVertexId: + if (options.vulkan_semantics) + SPIRV_CROSS_THROW("Cannot implement gl_VertexID in Vulkan GLSL. This shader was created " + "with GL semantics."); + return "gl_VertexID"; + case BuiltInInstanceId: + if (options.vulkan_semantics) + { + auto model = get_entry_point().model; + switch (model) + { + case ExecutionModelIntersectionKHR: + case ExecutionModelAnyHitKHR: + case ExecutionModelClosestHitKHR: + // gl_InstanceID is allowed in these shaders. + break; + + default: + SPIRV_CROSS_THROW("Cannot implement gl_InstanceID in Vulkan GLSL. This shader was " + "created with GL semantics."); + } + } + if (!options.es && options.version < 140) + { + require_extension_internal("GL_ARB_draw_instanced"); + } + return "gl_InstanceID"; + case BuiltInVertexIndex: + if (options.vulkan_semantics) + return "gl_VertexIndex"; + else + return "gl_VertexID"; // gl_VertexID already has the base offset applied. + case BuiltInInstanceIndex: + if (options.vulkan_semantics) + return "gl_InstanceIndex"; + + if (!options.es && options.version < 140) + { + require_extension_internal("GL_ARB_draw_instanced"); + } + + if (options.vertex.support_nonzero_base_instance) + { + if (!options.vulkan_semantics) + { + // This is a soft-enable. We will opt-in to using gl_BaseInstanceARB if supported. + require_extension_internal("GL_ARB_shader_draw_parameters"); + } + return "(gl_InstanceID + SPIRV_Cross_BaseInstance)"; // ... but not gl_InstanceID. + } + else + return "gl_InstanceID"; + case BuiltInPrimitiveId: + if (storage == StorageClassInput && get_entry_point().model == ExecutionModelGeometry) + return "gl_PrimitiveIDIn"; + else + return "gl_PrimitiveID"; + case BuiltInInvocationId: + return "gl_InvocationID"; + case BuiltInLayer: + { + auto model = get_execution_model(); + if (model == ExecutionModelVertex || model == ExecutionModelTessellationEvaluation) + { + if (options.es) + require_extension_internal("GL_NV_viewport_array2"); + else + require_extension_internal("GL_ARB_shader_viewport_layer_array"); + } + return "gl_Layer"; + } + case BuiltInViewportIndex: + return "gl_ViewportIndex"; + case BuiltInTessLevelOuter: + return "gl_TessLevelOuter"; + case BuiltInTessLevelInner: + return "gl_TessLevelInner"; + case BuiltInTessCoord: + return "gl_TessCoord"; + case BuiltInPatchVertices: + return "gl_PatchVerticesIn"; + case BuiltInFragCoord: + return "gl_FragCoord"; + case BuiltInPointCoord: + return "gl_PointCoord"; + case BuiltInFrontFacing: + return "gl_FrontFacing"; + case BuiltInFragDepth: + return "gl_FragDepth"; + case BuiltInNumWorkgroups: + return "gl_NumWorkGroups"; + case BuiltInWorkgroupSize: + return "gl_WorkGroupSize"; + case BuiltInWorkgroupId: + return "gl_WorkGroupID"; + case BuiltInLocalInvocationId: + return "gl_LocalInvocationID"; + case BuiltInGlobalInvocationId: + return "gl_GlobalInvocationID"; + case BuiltInLocalInvocationIndex: + return "gl_LocalInvocationIndex"; + case BuiltInHelperInvocation: + return "gl_HelperInvocation"; + + case BuiltInBaseVertex: + if (options.es) + SPIRV_CROSS_THROW("BaseVertex not supported in ES profile."); + + if (options.vulkan_semantics) + { + if (options.version < 460) + { + require_extension_internal("GL_ARB_shader_draw_parameters"); + return "gl_BaseVertexARB"; + } + return "gl_BaseVertex"; + } + // On regular GL, this is soft-enabled and we emit ifdefs in code. + require_extension_internal("GL_ARB_shader_draw_parameters"); + return "SPIRV_Cross_BaseVertex"; + + case BuiltInBaseInstance: + if (options.es) + SPIRV_CROSS_THROW("BaseInstance not supported in ES profile."); + + if (options.vulkan_semantics) + { + if (options.version < 460) + { + require_extension_internal("GL_ARB_shader_draw_parameters"); + return "gl_BaseInstanceARB"; + } + return "gl_BaseInstance"; + } + // On regular GL, this is soft-enabled and we emit ifdefs in code. + require_extension_internal("GL_ARB_shader_draw_parameters"); + return "SPIRV_Cross_BaseInstance"; + + case BuiltInDrawIndex: + if (options.es) + SPIRV_CROSS_THROW("DrawIndex not supported in ES profile."); + + if (options.vulkan_semantics) + { + if (options.version < 460) + { + require_extension_internal("GL_ARB_shader_draw_parameters"); + return "gl_DrawIDARB"; + } + return "gl_DrawID"; + } + // On regular GL, this is soft-enabled and we emit ifdefs in code. + require_extension_internal("GL_ARB_shader_draw_parameters"); + return "gl_DrawIDARB"; + + case BuiltInSampleId: + if (is_legacy()) + SPIRV_CROSS_THROW("Sample variables not supported in legacy GLSL."); + else if (options.es && options.version < 320) + require_extension_internal("GL_OES_sample_variables"); + else if (!options.es && options.version < 400) + require_extension_internal("GL_ARB_sample_shading"); + return "gl_SampleID"; + + case BuiltInSampleMask: + if (is_legacy()) + SPIRV_CROSS_THROW("Sample variables not supported in legacy GLSL."); + else if (options.es && options.version < 320) + require_extension_internal("GL_OES_sample_variables"); + else if (!options.es && options.version < 400) + require_extension_internal("GL_ARB_sample_shading"); + + if (storage == StorageClassInput) + return "gl_SampleMaskIn"; + else + return "gl_SampleMask"; + + case BuiltInSamplePosition: + if (is_legacy()) + SPIRV_CROSS_THROW("Sample variables not supported in legacy GLSL."); + else if (options.es && options.version < 320) + require_extension_internal("GL_OES_sample_variables"); + else if (!options.es && options.version < 400) + require_extension_internal("GL_ARB_sample_shading"); + return "gl_SamplePosition"; + + case BuiltInViewIndex: + if (options.vulkan_semantics) + return "gl_ViewIndex"; + else + return "gl_ViewID_OVR"; + + case BuiltInNumSubgroups: + request_subgroup_feature(ShaderSubgroupSupportHelper::NumSubgroups); + return "gl_NumSubgroups"; + + case BuiltInSubgroupId: + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupID); + return "gl_SubgroupID"; + + case BuiltInSubgroupSize: + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupSize); + return "gl_SubgroupSize"; + + case BuiltInSubgroupLocalInvocationId: + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupInvocationID); + return "gl_SubgroupInvocationID"; + + case BuiltInSubgroupEqMask: + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupMask); + return "gl_SubgroupEqMask"; + + case BuiltInSubgroupGeMask: + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupMask); + return "gl_SubgroupGeMask"; + + case BuiltInSubgroupGtMask: + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupMask); + return "gl_SubgroupGtMask"; + + case BuiltInSubgroupLeMask: + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupMask); + return "gl_SubgroupLeMask"; + + case BuiltInSubgroupLtMask: + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupMask); + return "gl_SubgroupLtMask"; + + case BuiltInLaunchIdKHR: + return ray_tracing_is_khr ? "gl_LaunchIDEXT" : "gl_LaunchIDNV"; + case BuiltInLaunchSizeKHR: + return ray_tracing_is_khr ? "gl_LaunchSizeEXT" : "gl_LaunchSizeNV"; + case BuiltInWorldRayOriginKHR: + return ray_tracing_is_khr ? "gl_WorldRayOriginEXT" : "gl_WorldRayOriginNV"; + case BuiltInWorldRayDirectionKHR: + return ray_tracing_is_khr ? "gl_WorldRayDirectionEXT" : "gl_WorldRayDirectionNV"; + case BuiltInObjectRayOriginKHR: + return ray_tracing_is_khr ? "gl_ObjectRayOriginEXT" : "gl_ObjectRayOriginNV"; + case BuiltInObjectRayDirectionKHR: + return ray_tracing_is_khr ? "gl_ObjectRayDirectionEXT" : "gl_ObjectRayDirectionNV"; + case BuiltInRayTminKHR: + return ray_tracing_is_khr ? "gl_RayTminEXT" : "gl_RayTminNV"; + case BuiltInRayTmaxKHR: + return ray_tracing_is_khr ? "gl_RayTmaxEXT" : "gl_RayTmaxNV"; + case BuiltInInstanceCustomIndexKHR: + return ray_tracing_is_khr ? "gl_InstanceCustomIndexEXT" : "gl_InstanceCustomIndexNV"; + case BuiltInObjectToWorldKHR: + return ray_tracing_is_khr ? "gl_ObjectToWorldEXT" : "gl_ObjectToWorldNV"; + case BuiltInWorldToObjectKHR: + return ray_tracing_is_khr ? "gl_WorldToObjectEXT" : "gl_WorldToObjectNV"; + case BuiltInHitTNV: + // gl_HitTEXT is an alias of RayTMax in KHR. + return "gl_HitTNV"; + case BuiltInHitKindKHR: + return ray_tracing_is_khr ? "gl_HitKindEXT" : "gl_HitKindNV"; + case BuiltInIncomingRayFlagsKHR: + return ray_tracing_is_khr ? "gl_IncomingRayFlagsEXT" : "gl_IncomingRayFlagsNV"; + + case BuiltInBaryCoordKHR: + { + if (options.es && options.version < 320) + SPIRV_CROSS_THROW("gl_BaryCoordEXT requires ESSL 320."); + else if (!options.es && options.version < 450) + SPIRV_CROSS_THROW("gl_BaryCoordEXT requires GLSL 450."); + + if (barycentric_is_nv) + { + require_extension_internal("GL_NV_fragment_shader_barycentric"); + return "gl_BaryCoordNV"; + } + else + { + require_extension_internal("GL_EXT_fragment_shader_barycentric"); + return "gl_BaryCoordEXT"; + } + } + + case BuiltInBaryCoordNoPerspNV: + { + if (options.es && options.version < 320) + SPIRV_CROSS_THROW("gl_BaryCoordNoPerspEXT requires ESSL 320."); + else if (!options.es && options.version < 450) + SPIRV_CROSS_THROW("gl_BaryCoordNoPerspEXT requires GLSL 450."); + + if (barycentric_is_nv) + { + require_extension_internal("GL_NV_fragment_shader_barycentric"); + return "gl_BaryCoordNoPerspNV"; + } + else + { + require_extension_internal("GL_EXT_fragment_shader_barycentric"); + return "gl_BaryCoordNoPerspEXT"; + } + } + + case BuiltInFragStencilRefEXT: + { + if (!options.es) + { + require_extension_internal("GL_ARB_shader_stencil_export"); + return "gl_FragStencilRefARB"; + } + else + SPIRV_CROSS_THROW("Stencil export not supported in GLES."); + } + + case BuiltInPrimitiveShadingRateKHR: + { + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Can only use PrimitiveShadingRateKHR in Vulkan GLSL."); + require_extension_internal("GL_EXT_fragment_shading_rate"); + return "gl_PrimitiveShadingRateEXT"; + } + + case BuiltInShadingRateKHR: + { + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Can only use ShadingRateKHR in Vulkan GLSL."); + require_extension_internal("GL_EXT_fragment_shading_rate"); + return "gl_ShadingRateEXT"; + } + + case BuiltInDeviceIndex: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Need Vulkan semantics for device group support."); + require_extension_internal("GL_EXT_device_group"); + return "gl_DeviceIndex"; + + case BuiltInFullyCoveredEXT: + if (!options.es) + require_extension_internal("GL_NV_conservative_raster_underestimation"); + else + SPIRV_CROSS_THROW("Need desktop GL to use GL_NV_conservative_raster_underestimation."); + return "gl_FragFullyCoveredNV"; + + case BuiltInPrimitiveTriangleIndicesEXT: + return "gl_PrimitiveTriangleIndicesEXT"; + case BuiltInPrimitiveLineIndicesEXT: + return "gl_PrimitiveLineIndicesEXT"; + case BuiltInPrimitivePointIndicesEXT: + return "gl_PrimitivePointIndicesEXT"; + case BuiltInCullPrimitiveEXT: + return "gl_CullPrimitiveEXT"; + + case BuiltInHitTriangleVertexPositionsKHR: + { + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Need Vulkan semantics for EXT_ray_tracing_position_fetch."); + require_extension_internal("GL_EXT_ray_tracing_position_fetch"); + return "gl_HitTriangleVertexPositionsEXT"; + } + + case BuiltInClusterIDNV: + { + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Can only use ClusterIDNV in Vulkan GLSL."); + require_extension_internal("GL_NV_cluster_acceleration_structure"); + return "gl_ClusterIDNV"; + } + + default: + return join("gl_BuiltIn_", convert_to_string(builtin)); + } +} + +const char *CompilerGLSL::index_to_swizzle(uint32_t index) +{ + switch (index) + { + case 0: + return "x"; + case 1: + return "y"; + case 2: + return "z"; + case 3: + return "w"; + default: + return "x"; // Don't crash, but engage the "undefined behavior" described for out-of-bounds logical addressing in spec. + } +} + +void CompilerGLSL::access_chain_internal_append_index(std::string &expr, uint32_t /*base*/, const SPIRType * /*type*/, + AccessChainFlags flags, bool &access_chain_is_arrayed, + uint32_t index) +{ + bool index_is_literal = (flags & ACCESS_CHAIN_INDEX_IS_LITERAL_BIT) != 0; + bool ptr_chain = (flags & ACCESS_CHAIN_PTR_CHAIN_BIT) != 0; + bool register_expression_read = (flags & ACCESS_CHAIN_SKIP_REGISTER_EXPRESSION_READ_BIT) == 0; + + string idx_expr = index_is_literal ? convert_to_string(index) : to_unpacked_expression(index, register_expression_read); + + // For the case where the base of an OpPtrAccessChain already ends in [n], + // we need to use the index as an offset to the existing index, otherwise, + // we can just use the index directly. + if (ptr_chain && access_chain_is_arrayed) + { + size_t split_pos = expr.find_last_of(']'); + size_t enclose_split = expr.find_last_of(')'); + + // If we have already enclosed the expression, don't try to be clever, it will break. + if (split_pos > enclose_split || enclose_split == string::npos) + { + string expr_front = expr.substr(0, split_pos); + string expr_back = expr.substr(split_pos); + expr = expr_front + " + " + enclose_expression(idx_expr) + expr_back; + return; + } + } + + expr += "["; + expr += idx_expr; + expr += "]"; +} + +bool CompilerGLSL::access_chain_needs_stage_io_builtin_translation(uint32_t) +{ + return true; +} + +string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indices, uint32_t count, + AccessChainFlags flags, AccessChainMeta *meta) +{ + string expr; + + bool index_is_literal = (flags & ACCESS_CHAIN_INDEX_IS_LITERAL_BIT) != 0; + bool msb_is_id = (flags & ACCESS_CHAIN_LITERAL_MSB_FORCE_ID) != 0; + bool chain_only = (flags & ACCESS_CHAIN_CHAIN_ONLY_BIT) != 0; + bool ptr_chain = (flags & ACCESS_CHAIN_PTR_CHAIN_BIT) != 0; + bool register_expression_read = (flags & ACCESS_CHAIN_SKIP_REGISTER_EXPRESSION_READ_BIT) == 0; + bool flatten_member_reference = (flags & ACCESS_CHAIN_FLATTEN_ALL_MEMBERS_BIT) != 0; + + if (!chain_only) + { + // We handle transpose explicitly, so don't resolve that here. + auto *e = maybe_get(base); + bool old_transpose = e && e->need_transpose; + if (e) + e->need_transpose = false; + expr = to_enclosed_expression(base, register_expression_read); + if (e) + e->need_transpose = old_transpose; + } + + // Start traversing type hierarchy at the proper non-pointer types, + // but keep type_id referencing the original pointer for use below. + uint32_t type_id = expression_type_id(base); + const auto *type = &get_pointee_type(type_id); + + if (!backend.native_pointers) + { + if (ptr_chain) + SPIRV_CROSS_THROW("Backend does not support native pointers and does not support OpPtrAccessChain."); + + // Wrapped buffer reference pointer types will need to poke into the internal "value" member before + // continuing the access chain. + if (should_dereference(base)) + expr = dereference_expression(get(type_id), expr); + } + else if (should_dereference(base) && type->basetype != SPIRType::Struct && !ptr_chain) + expr = join("(", dereference_expression(*type, expr), ")"); + + bool access_chain_is_arrayed = expr.find_first_of('[') != string::npos; + bool row_major_matrix_needs_conversion = is_non_native_row_major_matrix(base); + bool is_packed = has_extended_decoration(base, SPIRVCrossDecorationPhysicalTypePacked); + uint32_t physical_type = get_extended_decoration(base, SPIRVCrossDecorationPhysicalTypeID); + bool is_invariant = has_decoration(base, DecorationInvariant); + bool relaxed_precision = has_decoration(base, DecorationRelaxedPrecision); + bool pending_array_enclose = false; + bool dimension_flatten = false; + bool access_meshlet_position_y = false; + bool chain_is_builtin = false; + BuiltIn chained_builtin = {}; + + if (auto *base_expr = maybe_get(base)) + { + access_meshlet_position_y = base_expr->access_meshlet_position_y; + } + + // If we are translating access to a structured buffer, the first subscript '._m0' must be hidden + bool hide_first_subscript = count > 1 && is_user_type_structured(base); + + const auto append_index = [&](uint32_t index, bool is_literal, bool is_ptr_chain = false) { + AccessChainFlags mod_flags = flags; + if (!is_literal) + mod_flags &= ~ACCESS_CHAIN_INDEX_IS_LITERAL_BIT; + if (!is_ptr_chain) + mod_flags &= ~ACCESS_CHAIN_PTR_CHAIN_BIT; + access_chain_internal_append_index(expr, base, type, mod_flags, access_chain_is_arrayed, index); + if (check_physical_type_cast(expr, type, physical_type)) + physical_type = 0; + }; + + for (uint32_t i = 0; i < count; i++) + { + uint32_t index = indices[i]; + + bool is_literal = index_is_literal; + if (is_literal && msb_is_id && (index >> 31u) != 0u) + { + is_literal = false; + index &= 0x7fffffffu; + } + + bool ptr_chain_array_entry = ptr_chain && i == 0 && is_array(*type); + + if (ptr_chain_array_entry) + { + // This is highly unusual code, since normally we'd use plain AccessChain, but it's still allowed. + // We are considered to have a pointer to array and one element shifts by one array at a time. + // If we use normal array indexing, we'll first decay to pointer, and lose the array-ness, + // so we have to take pointer to array explicitly. + if (!should_dereference(base)) + expr = enclose_expression(address_of_expression(expr)); + } + + if (ptr_chain && i == 0) + { + // Pointer chains + // If we are flattening multidimensional arrays, only create opening bracket on first + // array index. + if (options.flatten_multidimensional_arrays) + { + dimension_flatten = type->array.size() >= 1; + pending_array_enclose = dimension_flatten; + if (pending_array_enclose) + expr += "["; + } + + if (options.flatten_multidimensional_arrays && dimension_flatten) + { + // If we are flattening multidimensional arrays, do manual stride computation. + if (is_literal) + expr += convert_to_string(index); + else + expr += to_enclosed_expression(index, register_expression_read); + + for (auto j = uint32_t(type->array.size()); j; j--) + { + expr += " * "; + expr += enclose_expression(to_array_size(*type, j - 1)); + } + + if (type->array.empty()) + pending_array_enclose = false; + else + expr += " + "; + + if (!pending_array_enclose) + expr += "]"; + } + else + { + if (flags & ACCESS_CHAIN_PTR_CHAIN_POINTER_ARITH_BIT) + { + SPIRType tmp_type(OpTypeInt); + tmp_type.basetype = SPIRType::UInt64; + tmp_type.width = 64; + tmp_type.vecsize = 1; + tmp_type.columns = 1; + + TypeID ptr_type_id = expression_type_id(base); + const SPIRType &ptr_type = get(ptr_type_id); + const SPIRType &pointee_type = get_pointee_type(ptr_type); + + // This only runs in native pointer backends. + // Can replace reinterpret_cast with a backend string if ever needed. + // We expect this to count as a de-reference. + // This leaks some MSL details, but feels slightly overkill to + // add yet another virtual interface just for this. + auto intptr_expr = join("reinterpret_cast<", type_to_glsl(tmp_type), ">(", expr, ")"); + intptr_expr += join(" + ", to_enclosed_unpacked_expression(index), " * ", + get_decoration(ptr_type_id, DecorationArrayStride)); + + if (flags & ACCESS_CHAIN_PTR_CHAIN_CAST_TO_SCALAR_BIT) + { + is_packed = true; + expr = join("*reinterpret_cast(", intptr_expr, ")"); + } + else + { + expr = join("*reinterpret_cast<", type_to_glsl(ptr_type), ">(", intptr_expr, ")"); + } + } + else + append_index(index, is_literal, true); + } + + if (type->basetype == SPIRType::ControlPointArray) + { + type_id = type->parent_type; + type = &get(type_id); + } + + access_chain_is_arrayed = true; + + // Explicitly enclose the expression if this is one of the weird pointer-to-array cases. + // We don't want any future indexing to add to this array dereference. + // Enclosing the expression blocks that and avoids any shenanigans with operand priority. + if (ptr_chain_array_entry) + expr = join("(", expr, ")"); + } + // Arrays and OpTypeCooperativeVectorNV (aka fancy arrays) + else if (!type->array.empty() || type->op == OpTypeCooperativeVectorNV) + { + // If we are flattening multidimensional arrays, only create opening bracket on first + // array index. + if (options.flatten_multidimensional_arrays && !pending_array_enclose) + { + dimension_flatten = type->array.size() > 1; + pending_array_enclose = dimension_flatten; + if (pending_array_enclose) + expr += "["; + } + + assert(type->parent_type); + + auto *var = maybe_get(base); + if (backend.force_gl_in_out_block && i == 0 && var && is_builtin_variable(*var) && + !has_decoration(type->self, DecorationBlock)) + { + // This deals with scenarios for tesc/geom where arrays of gl_Position[] are declared. + // Normally, these variables live in blocks when compiled from GLSL, + // but HLSL seems to just emit straight arrays here. + // We must pretend this access goes through gl_in/gl_out arrays + // to be able to access certain builtins as arrays. + // Similar concerns apply for mesh shaders where we have to redirect to gl_MeshVerticesEXT or MeshPrimitivesEXT. + auto builtin = ir.meta[base].decoration.builtin_type; + bool mesh_shader = get_execution_model() == ExecutionModelMeshEXT; + + chain_is_builtin = true; + chained_builtin = builtin; + + switch (builtin) + { + case BuiltInCullDistance: + case BuiltInClipDistance: + if (type->array.size() == 1) // Red herring. Only consider block IO for two-dimensional arrays here. + { + append_index(index, is_literal); + break; + } + // fallthrough + case BuiltInPosition: + case BuiltInPointSize: + if (mesh_shader) + expr = join("gl_MeshVerticesEXT[", to_expression(index, register_expression_read), "].", expr); + else if (var->storage == StorageClassInput) + expr = join("gl_in[", to_expression(index, register_expression_read), "].", expr); + else if (var->storage == StorageClassOutput) + expr = join("gl_out[", to_expression(index, register_expression_read), "].", expr); + else + append_index(index, is_literal); + break; + + case BuiltInPrimitiveId: + case BuiltInLayer: + case BuiltInViewportIndex: + case BuiltInCullPrimitiveEXT: + case BuiltInPrimitiveShadingRateKHR: + if (mesh_shader) + expr = join("gl_MeshPrimitivesEXT[", to_expression(index, register_expression_read), "].", expr); + else + append_index(index, is_literal); + break; + + default: + append_index(index, is_literal); + break; + } + } + else if (backend.force_merged_mesh_block && i == 0 && var && + !is_builtin_variable(*var) && var->storage == StorageClassOutput) + { + if (is_per_primitive_variable(*var)) + expr = join("gl_MeshPrimitivesEXT[", to_expression(index, register_expression_read), "].", expr); + else + expr = join("gl_MeshVerticesEXT[", to_expression(index, register_expression_read), "].", expr); + } + else if (options.flatten_multidimensional_arrays && dimension_flatten) + { + // If we are flattening multidimensional arrays, do manual stride computation. + auto &parent_type = get(type->parent_type); + + if (is_literal) + expr += convert_to_string(index); + else + expr += to_enclosed_expression(index, register_expression_read); + + for (auto j = uint32_t(parent_type.array.size()); j; j--) + { + expr += " * "; + expr += enclose_expression(to_array_size(parent_type, j - 1)); + } + + if (parent_type.array.empty()) + pending_array_enclose = false; + else + expr += " + "; + + if (!pending_array_enclose) + expr += "]"; + } + else if (index_is_literal || !builtin_translates_to_nonarray(BuiltIn(get_decoration(base, DecorationBuiltIn)))) + { + // Some builtins are arrays in SPIR-V but not in other languages, e.g. gl_SampleMask[] is an array in SPIR-V but not in Metal. + // By throwing away the index, we imply the index was 0, which it must be for gl_SampleMask. + // For literal indices we are working on composites, so we ignore this since we have already converted to proper array. + append_index(index, is_literal); + } + + if (var && has_decoration(var->self, DecorationBuiltIn) && + get_decoration(var->self, DecorationBuiltIn) == BuiltInPosition && + get_execution_model() == ExecutionModelMeshEXT) + { + access_meshlet_position_y = true; + } + + type_id = type->parent_type; + type = &get(type_id); + + // If the physical type has an unnatural vecsize, + // we must assume it's a faked struct where the .data member + // is used for the real payload. + if (physical_type && (is_vector(*type) || is_scalar(*type))) + { + auto &phys = get(physical_type); + if (phys.vecsize > 4) + expr += ".data"; + } + + access_chain_is_arrayed = true; + } + // For structs, the index refers to a constant, which indexes into the members, possibly through a redirection mapping. + // We also check if this member is a builtin, since we then replace the entire expression with the builtin one. + else if (type->basetype == SPIRType::Struct) + { + if (!is_literal) + index = evaluate_constant_u32(index); + + if (index < uint32_t(type->member_type_index_redirection.size())) + index = type->member_type_index_redirection[index]; + + if (index >= type->member_types.size()) + SPIRV_CROSS_THROW("Member index is out of bounds!"); + + if (hide_first_subscript) + { + // First "._m0" subscript has been hidden, subsequent fields must be emitted even for structured buffers + hide_first_subscript = false; + } + else + { + BuiltIn builtin = BuiltInMax; + if (is_member_builtin(*type, index, &builtin) && access_chain_needs_stage_io_builtin_translation(base)) + { + if (access_chain_is_arrayed) + { + expr += "."; + expr += builtin_to_glsl(builtin, type->storage); + } + else + expr = builtin_to_glsl(builtin, type->storage); + + if (builtin == BuiltInPosition && get_execution_model() == ExecutionModelMeshEXT) + { + access_meshlet_position_y = true; + } + + chain_is_builtin = true; + chained_builtin = builtin; + } + else + { + // If the member has a qualified name, use it as the entire chain + string qual_mbr_name = get_member_qualified_name(type_id, index); + if (!qual_mbr_name.empty()) + expr = qual_mbr_name; + else if (flatten_member_reference) + expr += join("_", to_member_name(*type, index)); + else + { + // Any pointer de-refences for values are handled in the first access chain. + // For pointer chains, the pointer-ness is resolved through an array access. + // The only time this is not true is when accessing array of SSBO/UBO. + // This case is explicitly handled. + expr += to_member_reference(base, *type, index, ptr_chain || i != 0); + } + } + } + + if (has_member_decoration(type->self, index, DecorationInvariant)) + is_invariant = true; + if (has_member_decoration(type->self, index, DecorationRelaxedPrecision)) + relaxed_precision = true; + + is_packed = member_is_packed_physical_type(*type, index); + if (member_is_remapped_physical_type(*type, index)) + physical_type = get_extended_member_decoration(type->self, index, SPIRVCrossDecorationPhysicalTypeID); + else + physical_type = 0; + + row_major_matrix_needs_conversion = member_is_non_native_row_major_matrix(*type, index); + type = &get(type->member_types[index]); + } + // Matrix -> Vector + else if (type->columns > 1) + { + // If we have a row-major matrix here, we need to defer any transpose in case this access chain + // is used to store a column. We can resolve it right here and now if we access a scalar directly, + // by flipping indexing order of the matrix. + + expr += "["; + if (is_literal) + expr += convert_to_string(index); + else + expr += to_unpacked_expression(index, register_expression_read); + expr += "]"; + + // If the physical type has an unnatural vecsize, + // we must assume it's a faked struct where the .data member + // is used for the real payload. + if (physical_type) + { + auto &phys = get(physical_type); + if (phys.vecsize > 4 || phys.columns > 4) + expr += ".data"; + } + + type_id = type->parent_type; + type = &get(type_id); + } + // Vector -> Scalar + else if (type->op == OpTypeCooperativeMatrixKHR || type->vecsize > 1) + { + string deferred_index; + if (row_major_matrix_needs_conversion) + { + // Flip indexing order. + auto column_index = expr.find_last_of('['); + if (column_index != string::npos) + { + deferred_index = expr.substr(column_index); + + auto end_deferred_index = deferred_index.find_last_of(']'); + if (end_deferred_index != string::npos && end_deferred_index + 1 != deferred_index.size()) + { + // If we have any data member fixups, it must be transposed so that it refers to this index. + // E.g. [0].data followed by [1] would be shuffled to [1][0].data which is wrong, + // and needs to be [1].data[0] instead. + end_deferred_index++; + deferred_index = deferred_index.substr(end_deferred_index) + + deferred_index.substr(0, end_deferred_index); + } + + expr.resize(column_index); + } + } + + // Internally, access chain implementation can also be used on composites, + // ignore scalar access workarounds in this case. + StorageClass effective_storage = StorageClassGeneric; + bool ignore_potential_sliced_writes = false; + if ((flags & ACCESS_CHAIN_FORCE_COMPOSITE_BIT) == 0) + { + if (expression_type(base).pointer) + effective_storage = get_expression_effective_storage_class(base); + + // Special consideration for control points. + // Control points can only be written by InvocationID, so there is no need + // to consider scalar access chains here. + // Cleans up some cases where it's very painful to determine the accurate storage class + // since blocks can be partially masked ... + auto *var = maybe_get_backing_variable(base); + if (var && var->storage == StorageClassOutput && + get_execution_model() == ExecutionModelTessellationControl && + !has_decoration(var->self, DecorationPatch)) + { + ignore_potential_sliced_writes = true; + } + } + else + ignore_potential_sliced_writes = true; + + if (!row_major_matrix_needs_conversion && !ignore_potential_sliced_writes) + { + // On some backends, we might not be able to safely access individual scalars in a vector. + // To work around this, we might have to cast the access chain reference to something which can, + // like a pointer to scalar, which we can then index into. + prepare_access_chain_for_scalar_access(expr, get(type->parent_type), effective_storage, + is_packed); + } + + if (is_literal) + { + bool out_of_bounds = index >= type->vecsize && type->op != OpTypeCooperativeMatrixKHR; + + if (!is_packed && !row_major_matrix_needs_conversion && type->op != OpTypeCooperativeMatrixKHR) + { + expr += "."; + expr += index_to_swizzle(out_of_bounds ? 0 : index); + } + else + { + // For packed vectors, we can only access them as an array, not by swizzle. + expr += join("[", out_of_bounds ? 0 : index, "]"); + } + } + else if (ir.ids[index].get_type() == TypeConstant && !is_packed && !row_major_matrix_needs_conversion) + { + auto &c = get(index); + bool out_of_bounds = (c.scalar() >= type->vecsize); + + if (c.specialization) + { + // If the index is a spec constant, we cannot turn extract into a swizzle. + expr += join("[", out_of_bounds ? "0" : to_expression(index), "]"); + } + else + { + expr += "."; + expr += index_to_swizzle(out_of_bounds ? 0 : c.scalar()); + } + } + else + { + expr += "["; + expr += to_unpacked_expression(index, register_expression_read); + expr += "]"; + } + + if (row_major_matrix_needs_conversion && !ignore_potential_sliced_writes) + { + if (prepare_access_chain_for_scalar_access(expr, get(type->parent_type), effective_storage, + is_packed)) + { + // We're in a pointer context now, so just remove any member dereference. + auto first_index = deferred_index.find_first_of('['); + if (first_index != string::npos && first_index != 0) + deferred_index = deferred_index.substr(first_index); + } + } + + if (access_meshlet_position_y) + { + if (is_literal) + { + access_meshlet_position_y = index == 1; + } + else + { + const auto *c = maybe_get(index); + if (c) + access_meshlet_position_y = c->scalar() == 1; + else + { + // We don't know, but we have to assume no. + // Flip Y in mesh shaders is an opt-in horrible hack, so we'll have to assume shaders try to behave. + access_meshlet_position_y = false; + } + } + } + + expr += deferred_index; + row_major_matrix_needs_conversion = false; + + is_packed = false; + physical_type = 0; + type_id = type->parent_type; + type = &get(type_id); + } + else if (!backend.allow_truncated_access_chain) + SPIRV_CROSS_THROW("Cannot subdivide a scalar value!"); + } + + if (pending_array_enclose) + { + SPIRV_CROSS_THROW("Flattening of multidimensional arrays were enabled, " + "but the access chain was terminated in the middle of a multidimensional array. " + "This is not supported."); + } + + if (meta) + { + meta->need_transpose = row_major_matrix_needs_conversion; + meta->storage_is_packed = is_packed; + meta->storage_is_invariant = is_invariant; + meta->storage_physical_type = physical_type; + meta->relaxed_precision = relaxed_precision; + meta->access_meshlet_position_y = access_meshlet_position_y; + meta->chain_is_builtin = chain_is_builtin; + meta->builtin = chained_builtin; + } + + return expr; +} + +bool CompilerGLSL::check_physical_type_cast(std::string &, const SPIRType *, uint32_t) +{ + return false; +} + +bool CompilerGLSL::prepare_access_chain_for_scalar_access(std::string &, const SPIRType &, StorageClass, bool &) +{ + return false; +} + +string CompilerGLSL::to_flattened_struct_member(const string &basename, const SPIRType &type, uint32_t index) +{ + auto ret = join(basename, "_", to_member_name(type, index)); + ParsedIR::sanitize_underscores(ret); + return ret; +} + +uint32_t CompilerGLSL::get_physical_type_stride(const SPIRType &) const +{ + SPIRV_CROSS_THROW("Invalid to call get_physical_type_stride on a backend without native pointer support."); +} + +string CompilerGLSL::access_chain(uint32_t base, const uint32_t *indices, uint32_t count, const SPIRType &target_type, + AccessChainMeta *meta, bool ptr_chain) +{ + if (flattened_buffer_blocks.count(base)) + { + uint32_t matrix_stride = 0; + uint32_t array_stride = 0; + bool need_transpose = false; + flattened_access_chain_offset(expression_type(base), indices, count, 0, 16, &need_transpose, &matrix_stride, + &array_stride, ptr_chain); + + if (meta) + { + meta->need_transpose = target_type.columns > 1 && need_transpose; + meta->storage_is_packed = false; + } + + return flattened_access_chain(base, indices, count, target_type, 0, matrix_stride, array_stride, + need_transpose); + } + else if (flattened_structs.count(base) && count > 0) + { + AccessChainFlags flags = ACCESS_CHAIN_CHAIN_ONLY_BIT | ACCESS_CHAIN_SKIP_REGISTER_EXPRESSION_READ_BIT; + if (ptr_chain) + flags |= ACCESS_CHAIN_PTR_CHAIN_BIT; + + if (flattened_structs[base]) + { + flags |= ACCESS_CHAIN_FLATTEN_ALL_MEMBERS_BIT; + if (meta) + meta->flattened_struct = target_type.basetype == SPIRType::Struct; + } + + auto chain = access_chain_internal(base, indices, count, flags, nullptr).substr(1); + if (meta) + { + meta->need_transpose = false; + meta->storage_is_packed = false; + } + + auto basename = to_flattened_access_chain_expression(base); + auto ret = join(basename, "_", chain); + ParsedIR::sanitize_underscores(ret); + return ret; + } + else + { + AccessChainFlags flags = ACCESS_CHAIN_SKIP_REGISTER_EXPRESSION_READ_BIT; + if (ptr_chain) + { + flags |= ACCESS_CHAIN_PTR_CHAIN_BIT; + // PtrAccessChain could get complicated. + TypeID type_id = expression_type_id(base); + if (backend.native_pointers && has_decoration(type_id, DecorationArrayStride)) + { + // If there is a mismatch we have to go via 64-bit pointer arithmetic :'( + // Using packed hacks only gets us so far, and is not designed to deal with pointer to + // random values. It works for structs though. + auto &pointee_type = get_pointee_type(get(type_id)); + uint32_t physical_stride = get_physical_type_stride(pointee_type); + uint32_t requested_stride = get_decoration(type_id, DecorationArrayStride); + if (physical_stride != requested_stride) + { + flags |= ACCESS_CHAIN_PTR_CHAIN_POINTER_ARITH_BIT; + if (is_vector(pointee_type)) + flags |= ACCESS_CHAIN_PTR_CHAIN_CAST_TO_SCALAR_BIT; + } + } + } + + return access_chain_internal(base, indices, count, flags, meta); + } +} + +string CompilerGLSL::load_flattened_struct(const string &basename, const SPIRType &type) +{ + auto expr = type_to_glsl_constructor(type); + expr += '('; + + for (uint32_t i = 0; i < uint32_t(type.member_types.size()); i++) + { + if (i) + expr += ", "; + + auto &member_type = get(type.member_types[i]); + if (member_type.basetype == SPIRType::Struct) + expr += load_flattened_struct(to_flattened_struct_member(basename, type, i), member_type); + else + expr += to_flattened_struct_member(basename, type, i); + } + expr += ')'; + return expr; +} + +std::string CompilerGLSL::to_flattened_access_chain_expression(uint32_t id) +{ + // Do not use to_expression as that will unflatten access chains. + string basename; + if (const auto *var = maybe_get(id)) + basename = to_name(var->self); + else if (const auto *expr = maybe_get(id)) + basename = expr->expression; + else + basename = to_expression(id); + + return basename; +} + +void CompilerGLSL::store_flattened_struct(const string &basename, uint32_t rhs_id, const SPIRType &type, + const SmallVector &indices) +{ + SmallVector sub_indices = indices; + sub_indices.push_back(0); + + auto *member_type = &type; + for (auto &index : indices) + member_type = &get(member_type->member_types[index]); + + for (uint32_t i = 0; i < uint32_t(member_type->member_types.size()); i++) + { + sub_indices.back() = i; + auto lhs = join(basename, "_", to_member_name(*member_type, i)); + ParsedIR::sanitize_underscores(lhs); + + if (get(member_type->member_types[i]).basetype == SPIRType::Struct) + { + store_flattened_struct(lhs, rhs_id, type, sub_indices); + } + else + { + auto rhs = to_expression(rhs_id) + to_multi_member_reference(type, sub_indices); + statement(lhs, " = ", rhs, ";"); + } + } +} + +void CompilerGLSL::store_flattened_struct(uint32_t lhs_id, uint32_t value) +{ + auto &type = expression_type(lhs_id); + auto basename = to_flattened_access_chain_expression(lhs_id); + store_flattened_struct(basename, value, type, {}); +} + +std::string CompilerGLSL::flattened_access_chain(uint32_t base, const uint32_t *indices, uint32_t count, + const SPIRType &target_type, uint32_t offset, uint32_t matrix_stride, + uint32_t /* array_stride */, bool need_transpose) +{ + if (!target_type.array.empty()) + SPIRV_CROSS_THROW("Access chains that result in an array can not be flattened"); + else if (target_type.basetype == SPIRType::Struct) + return flattened_access_chain_struct(base, indices, count, target_type, offset); + else if (target_type.columns > 1) + return flattened_access_chain_matrix(base, indices, count, target_type, offset, matrix_stride, need_transpose); + else + return flattened_access_chain_vector(base, indices, count, target_type, offset, matrix_stride, need_transpose); +} + +std::string CompilerGLSL::flattened_access_chain_struct(uint32_t base, const uint32_t *indices, uint32_t count, + const SPIRType &target_type, uint32_t offset) +{ + std::string expr; + + if (backend.can_declare_struct_inline) + { + expr += type_to_glsl_constructor(target_type); + expr += "("; + } + else + expr += "{"; + + for (uint32_t i = 0; i < uint32_t(target_type.member_types.size()); ++i) + { + if (i != 0) + expr += ", "; + + const SPIRType &member_type = get(target_type.member_types[i]); + uint32_t member_offset = type_struct_member_offset(target_type, i); + + // The access chain terminates at the struct, so we need to find matrix strides and row-major information + // ahead of time. + bool need_transpose = false; + bool relaxed = false; + uint32_t matrix_stride = 0; + if (member_type.columns > 1) + { + auto decorations = combined_decoration_for_member(target_type, i); + need_transpose = decorations.get(DecorationRowMajor); + relaxed = decorations.get(DecorationRelaxedPrecision); + matrix_stride = type_struct_member_matrix_stride(target_type, i); + } + + auto tmp = flattened_access_chain(base, indices, count, member_type, offset + member_offset, matrix_stride, + 0 /* array_stride */, need_transpose); + + // Cannot forward transpositions, so resolve them here. + if (need_transpose) + expr += convert_row_major_matrix(tmp, member_type, 0, false, relaxed); + else + expr += tmp; + } + + expr += backend.can_declare_struct_inline ? ")" : "}"; + + return expr; +} + +std::string CompilerGLSL::flattened_access_chain_matrix(uint32_t base, const uint32_t *indices, uint32_t count, + const SPIRType &target_type, uint32_t offset, + uint32_t matrix_stride, bool need_transpose) +{ + assert(matrix_stride); + SPIRType tmp_type = target_type; + if (need_transpose) + swap(tmp_type.vecsize, tmp_type.columns); + + std::string expr; + + expr += type_to_glsl_constructor(tmp_type); + expr += "("; + + for (uint32_t i = 0; i < tmp_type.columns; i++) + { + if (i != 0) + expr += ", "; + + expr += flattened_access_chain_vector(base, indices, count, tmp_type, offset + i * matrix_stride, matrix_stride, + /* need_transpose= */ false); + } + + expr += ")"; + + return expr; +} + +std::string CompilerGLSL::flattened_access_chain_vector(uint32_t base, const uint32_t *indices, uint32_t count, + const SPIRType &target_type, uint32_t offset, + uint32_t matrix_stride, bool need_transpose) +{ + auto result = flattened_access_chain_offset(expression_type(base), indices, count, offset, 16); + + auto buffer_name = to_name(expression_type(base).self); + + if (need_transpose) + { + std::string expr; + + if (target_type.vecsize > 1) + { + expr += type_to_glsl_constructor(target_type); + expr += "("; + } + + for (uint32_t i = 0; i < target_type.vecsize; ++i) + { + if (i != 0) + expr += ", "; + + uint32_t component_offset = result.second + i * matrix_stride; + + assert(component_offset % (target_type.width / 8) == 0); + uint32_t index = component_offset / (target_type.width / 8); + + expr += buffer_name; + expr += "["; + expr += result.first; // this is a series of N1 * k1 + N2 * k2 + ... that is either empty or ends with a + + expr += convert_to_string(index / 4); + expr += "]"; + + expr += vector_swizzle(1, index % 4); + } + + if (target_type.vecsize > 1) + { + expr += ")"; + } + + return expr; + } + else + { + assert(result.second % (target_type.width / 8) == 0); + uint32_t index = result.second / (target_type.width / 8); + + std::string expr; + + expr += buffer_name; + expr += "["; + expr += result.first; // this is a series of N1 * k1 + N2 * k2 + ... that is either empty or ends with a + + expr += convert_to_string(index / 4); + expr += "]"; + + expr += vector_swizzle(target_type.vecsize, index % 4); + + return expr; + } +} + +std::pair CompilerGLSL::flattened_access_chain_offset( + const SPIRType &basetype, const uint32_t *indices, uint32_t count, uint32_t offset, uint32_t word_stride, + bool *need_transpose, uint32_t *out_matrix_stride, uint32_t *out_array_stride, bool ptr_chain) +{ + // Start traversing type hierarchy at the proper non-pointer types. + const auto *type = &get_pointee_type(basetype); + + std::string expr; + + // Inherit matrix information in case we are access chaining a vector which might have come from a row major layout. + bool row_major_matrix_needs_conversion = need_transpose ? *need_transpose : false; + uint32_t matrix_stride = out_matrix_stride ? *out_matrix_stride : 0; + uint32_t array_stride = out_array_stride ? *out_array_stride : 0; + + for (uint32_t i = 0; i < count; i++) + { + uint32_t index = indices[i]; + + // Pointers + if (ptr_chain && i == 0) + { + // Here, the pointer type will be decorated with an array stride. + array_stride = get_decoration(basetype.self, DecorationArrayStride); + if (!array_stride) + SPIRV_CROSS_THROW("SPIR-V does not define ArrayStride for buffer block."); + + auto *constant = maybe_get(index); + if (constant) + { + // Constant array access. + offset += constant->scalar() * array_stride; + } + else + { + // Dynamic array access. + if (array_stride % word_stride) + { + SPIRV_CROSS_THROW("Array stride for dynamic indexing must be divisible by the size " + "of a 4-component vector. " + "Likely culprit here is a float or vec2 array inside a push " + "constant block which is std430. " + "This cannot be flattened. Try using std140 layout instead."); + } + + expr += to_enclosed_expression(index); + expr += " * "; + expr += convert_to_string(array_stride / word_stride); + expr += " + "; + } + } + // Arrays + else if (!type->array.empty()) + { + auto *constant = maybe_get(index); + if (constant) + { + // Constant array access. + offset += constant->scalar() * array_stride; + } + else + { + // Dynamic array access. + if (array_stride % word_stride) + { + SPIRV_CROSS_THROW("Array stride for dynamic indexing must be divisible by the size " + "of a 4-component vector. " + "Likely culprit here is a float or vec2 array inside a push " + "constant block which is std430. " + "This cannot be flattened. Try using std140 layout instead."); + } + + expr += to_enclosed_expression(index, false); + expr += " * "; + expr += convert_to_string(array_stride / word_stride); + expr += " + "; + } + + uint32_t parent_type = type->parent_type; + type = &get(parent_type); + + if (!type->array.empty()) + array_stride = get_decoration(parent_type, DecorationArrayStride); + } + // For structs, the index refers to a constant, which indexes into the members. + // We also check if this member is a builtin, since we then replace the entire expression with the builtin one. + else if (type->basetype == SPIRType::Struct) + { + index = evaluate_constant_u32(index); + + if (index >= type->member_types.size()) + SPIRV_CROSS_THROW("Member index is out of bounds!"); + + offset += type_struct_member_offset(*type, index); + + auto &struct_type = *type; + type = &get(type->member_types[index]); + + if (type->columns > 1) + { + matrix_stride = type_struct_member_matrix_stride(struct_type, index); + row_major_matrix_needs_conversion = + combined_decoration_for_member(struct_type, index).get(DecorationRowMajor); + } + else + row_major_matrix_needs_conversion = false; + + if (!type->array.empty()) + array_stride = type_struct_member_array_stride(struct_type, index); + } + // Matrix -> Vector + else if (type->columns > 1) + { + auto *constant = maybe_get(index); + if (constant) + { + index = evaluate_constant_u32(index); + offset += index * (row_major_matrix_needs_conversion ? (type->width / 8) : matrix_stride); + } + else + { + uint32_t indexing_stride = row_major_matrix_needs_conversion ? (type->width / 8) : matrix_stride; + // Dynamic array access. + if (indexing_stride % word_stride) + { + SPIRV_CROSS_THROW("Matrix stride for dynamic indexing must be divisible by the size of a " + "4-component vector. " + "Likely culprit here is a row-major matrix being accessed dynamically. " + "This cannot be flattened. Try using std140 layout instead."); + } + + expr += to_enclosed_expression(index, false); + expr += " * "; + expr += convert_to_string(indexing_stride / word_stride); + expr += " + "; + } + + type = &get(type->parent_type); + } + // Vector -> Scalar + else if (type->vecsize > 1) + { + auto *constant = maybe_get(index); + if (constant) + { + index = evaluate_constant_u32(index); + offset += index * (row_major_matrix_needs_conversion ? matrix_stride : (type->width / 8)); + } + else + { + uint32_t indexing_stride = row_major_matrix_needs_conversion ? matrix_stride : (type->width / 8); + + // Dynamic array access. + if (indexing_stride % word_stride) + { + SPIRV_CROSS_THROW("Stride for dynamic vector indexing must be divisible by the " + "size of a 4-component vector. " + "This cannot be flattened in legacy targets."); + } + + expr += to_enclosed_expression(index, false); + expr += " * "; + expr += convert_to_string(indexing_stride / word_stride); + expr += " + "; + } + + type = &get(type->parent_type); + } + else + SPIRV_CROSS_THROW("Cannot subdivide a scalar value!"); + } + + if (need_transpose) + *need_transpose = row_major_matrix_needs_conversion; + if (out_matrix_stride) + *out_matrix_stride = matrix_stride; + if (out_array_stride) + *out_array_stride = array_stride; + + return std::make_pair(expr, offset); +} + +bool CompilerGLSL::should_dereference(uint32_t id) +{ + const auto &type = expression_type(id); + // Non-pointer expressions don't need to be dereferenced. + if (!is_pointer(type)) + return false; + + // Handles shouldn't be dereferenced either. + if (!expression_is_lvalue(id)) + return false; + + // If id is a variable but not a phi variable, we should not dereference it. + // BDA passed around as parameters are always pointers. + if (auto *var = maybe_get(id)) + return (var->parameter && is_physical_or_buffer_pointer(type)) || var->phi_variable; + + if (auto *expr = maybe_get(id)) + { + // If id is an access chain, we should not dereference it. + if (expr->access_chain) + return false; + + // If id is a forwarded copy of a variable pointer, we should not dereference it. + SPIRVariable *var = nullptr; + while (expr->loaded_from && expression_is_forwarded(expr->self)) + { + auto &src_type = expression_type(expr->loaded_from); + // To be a copy, the pointer and its source expression must be the + // same type. Can't check type.self, because for some reason that's + // usually the base type with pointers stripped off. This check is + // complex enough that I've hoisted it out of the while condition. + if (src_type.pointer != type.pointer || src_type.pointer_depth != type.pointer_depth || + src_type.parent_type != type.parent_type) + break; + if ((var = maybe_get(expr->loaded_from))) + break; + if (!(expr = maybe_get(expr->loaded_from))) + break; + } + + return !var || var->phi_variable; + } + + // Otherwise, we should dereference this pointer expression. + return true; +} + +bool CompilerGLSL::should_dereference_caller_param(uint32_t id) +{ + const auto &type = expression_type(id); + // BDA is always passed around as pointers. Similarly, we need to pass variable buffer pointers as pointers. + if (is_physical_or_buffer_pointer(type)) + return false; + + return should_dereference(id); +} + +bool CompilerGLSL::should_forward(uint32_t id) const +{ + // If id is a variable we will try to forward it regardless of force_temporary check below + // This is important because otherwise we'll get local sampler copies (highp sampler2D foo = bar) that are invalid in OpenGL GLSL + + auto *var = maybe_get(id); + if (var) + { + // Never forward volatile builtin variables, e.g. SPIR-V 1.6 HelperInvocation. + return !(has_decoration(id, DecorationBuiltIn) && has_decoration(id, DecorationVolatile)); + } + + // For debugging emit temporary variables for all expressions + if (options.force_temporary) + return false; + + // If an expression carries enough dependencies we need to stop forwarding at some point, + // or we explode compilers. There are usually limits to how much we can nest expressions. + auto *expr = maybe_get(id); + const uint32_t max_expression_dependencies = 64; + if (expr && expr->expression_dependencies.size() >= max_expression_dependencies) + return false; + + if (expr && expr->loaded_from + && has_decoration(expr->loaded_from, DecorationBuiltIn) + && has_decoration(expr->loaded_from, DecorationVolatile)) + { + // Never forward volatile builtin variables, e.g. SPIR-V 1.6 HelperInvocation. + return false; + } + + // Immutable expression can always be forwarded. + if (is_immutable(id)) + return true; + + return false; +} + +bool CompilerGLSL::should_suppress_usage_tracking(uint32_t id) const +{ + // Used only by opcodes which don't do any real "work", they just swizzle data in some fashion. + return !expression_is_forwarded(id) || expression_suppresses_usage_tracking(id); +} + +void CompilerGLSL::track_expression_read(uint32_t id) +{ + switch (ir.ids[id].get_type()) + { + case TypeExpression: + { + auto &e = get(id); + for (auto implied_read : e.implied_read_expressions) + track_expression_read(implied_read); + break; + } + + case TypeAccessChain: + { + auto &e = get(id); + for (auto implied_read : e.implied_read_expressions) + track_expression_read(implied_read); + break; + } + + default: + break; + } + + // If we try to read a forwarded temporary more than once we will stamp out possibly complex code twice. + // In this case, it's better to just bind the complex expression to the temporary and read that temporary twice. + if (expression_is_forwarded(id) && !expression_suppresses_usage_tracking(id)) + { + auto &v = expression_usage_counts[id]; + v++; + + // If we create an expression outside a loop, + // but access it inside a loop, we're implicitly reading it multiple times. + // If the expression in question is expensive, we should hoist it out to avoid relying on loop-invariant code motion + // working inside the backend compiler. + if (expression_read_implies_multiple_reads(id)) + v++; + + if (v >= 2) + { + //if (v == 2) + // fprintf(stderr, "ID %u was forced to temporary due to more than 1 expression use!\n", id); + + // Force a recompile after this pass to avoid forwarding this variable. + force_temporary_and_recompile(id); + } + } +} + +bool CompilerGLSL::args_will_forward(uint32_t id, const uint32_t *args, uint32_t num_args, bool pure) +{ + if (forced_temporaries.find(id) != end(forced_temporaries)) + return false; + + for (uint32_t i = 0; i < num_args; i++) + if (!should_forward(args[i])) + return false; + + // We need to forward globals as well. + if (!pure) + { + for (auto global : global_variables) + if (!should_forward(global)) + return false; + for (auto aliased : aliased_variables) + if (!should_forward(aliased)) + return false; + } + + return true; +} + +void CompilerGLSL::register_impure_function_call() +{ + // Impure functions can modify globals and aliased variables, so invalidate them as well. + for (auto global : global_variables) + flush_dependees(get(global)); + for (auto aliased : aliased_variables) + flush_dependees(get(aliased)); +} + +void CompilerGLSL::register_call_out_argument(uint32_t id) +{ + register_write(id); + + auto *var = maybe_get(id); + if (var) + flush_variable_declaration(var->self); +} + +string CompilerGLSL::variable_decl_function_local(SPIRVariable &var) +{ + // These variables are always function local, + // so make sure we emit the variable without storage qualifiers. + // Some backends will inject custom variables locally in a function + // with a storage qualifier which is not function-local. + auto old_storage = var.storage; + var.storage = StorageClassFunction; + auto expr = variable_decl(var); + var.storage = old_storage; + return expr; +} + +void CompilerGLSL::emit_variable_temporary_copies(const SPIRVariable &var) +{ + // Ensure that we declare phi-variable copies even if the original declaration isn't deferred + if (var.allocate_temporary_copy && !flushed_phi_variables.count(var.self)) + { + auto &type = get(var.basetype); + auto &flags = get_decoration_bitset(var.self); + statement(flags_to_qualifiers_glsl(type, var.self, flags), variable_decl(type, join("_", var.self, "_copy")), ";"); + flushed_phi_variables.insert(var.self); + } +} + +void CompilerGLSL::flush_variable_declaration(uint32_t id) +{ + // Ensure that we declare phi-variable copies even if the original declaration isn't deferred + auto *var = maybe_get(id); + if (var && var->deferred_declaration) + { + string initializer; + if (options.force_zero_initialized_variables && + (var->storage == StorageClassFunction || var->storage == StorageClassGeneric || + var->storage == StorageClassPrivate) && + !var->initializer && type_can_zero_initialize(get_variable_data_type(*var))) + { + initializer = join(" = ", to_zero_initialized_expression(get_variable_data_type_id(*var))); + } + + statement(variable_decl_function_local(*var), initializer, ";"); + var->deferred_declaration = false; + } + if (var) + { + emit_variable_temporary_copies(*var); + } +} + +bool CompilerGLSL::remove_duplicate_swizzle(string &op) +{ + auto pos = op.find_last_of('.'); + if (pos == string::npos || pos == 0) + return false; + + string final_swiz = op.substr(pos + 1, string::npos); + + if (backend.swizzle_is_function) + { + if (final_swiz.size() < 2) + return false; + + if (final_swiz.substr(final_swiz.size() - 2, string::npos) == "()") + final_swiz.erase(final_swiz.size() - 2, string::npos); + else + return false; + } + + // Check if final swizzle is of form .x, .xy, .xyz, .xyzw or similar. + // If so, and previous swizzle is of same length, + // we can drop the final swizzle altogether. + for (uint32_t i = 0; i < final_swiz.size(); i++) + { + static const char expected[] = { 'x', 'y', 'z', 'w' }; + if (i >= 4 || final_swiz[i] != expected[i]) + return false; + } + + auto prevpos = op.find_last_of('.', pos - 1); + if (prevpos == string::npos) + return false; + + prevpos++; + + // Make sure there are only swizzles here ... + for (auto i = prevpos; i < pos; i++) + { + if (op[i] < 'w' || op[i] > 'z') + { + // If swizzles are foo.xyz() like in C++ backend for example, check for that. + if (backend.swizzle_is_function && i + 2 == pos && op[i] == '(' && op[i + 1] == ')') + break; + return false; + } + } + + // If original swizzle is large enough, just carve out the components we need. + // E.g. foobar.wyx.xy will turn into foobar.wy. + if (pos - prevpos >= final_swiz.size()) + { + op.erase(prevpos + final_swiz.size(), string::npos); + + // Add back the function call ... + if (backend.swizzle_is_function) + op += "()"; + } + return true; +} + +// Optimizes away vector swizzles where we have something like +// vec3 foo; +// foo.xyz <-- swizzle expression does nothing. +// This is a very common pattern after OpCompositeCombine. +bool CompilerGLSL::remove_unity_swizzle(uint32_t base, string &op) +{ + auto pos = op.find_last_of('.'); + if (pos == string::npos || pos == 0) + return false; + + string final_swiz = op.substr(pos + 1, string::npos); + + if (backend.swizzle_is_function) + { + if (final_swiz.size() < 2) + return false; + + if (final_swiz.substr(final_swiz.size() - 2, string::npos) == "()") + final_swiz.erase(final_swiz.size() - 2, string::npos); + else + return false; + } + + // Check if final swizzle is of form .x, .xy, .xyz, .xyzw or similar. + // If so, and previous swizzle is of same length, + // we can drop the final swizzle altogether. + for (uint32_t i = 0; i < final_swiz.size(); i++) + { + static const char expected[] = { 'x', 'y', 'z', 'w' }; + if (i >= 4 || final_swiz[i] != expected[i]) + return false; + } + + auto &type = expression_type(base); + + // Sanity checking ... + assert(type.columns == 1 && type.array.empty()); + + if (type.vecsize == final_swiz.size()) + op.erase(pos, string::npos); + return true; +} + +string CompilerGLSL::build_composite_combiner(uint32_t return_type, const uint32_t *elems, uint32_t length) +{ + ID base = 0; + string op; + string subop; + + // Can only merge swizzles for vectors. + auto &type = get(return_type); + bool can_apply_swizzle_opt = type.basetype != SPIRType::Struct && type.array.empty() && type.columns == 1 && + type.op != OpTypeCooperativeMatrixKHR; + bool swizzle_optimization = false; + + for (uint32_t i = 0; i < length; i++) + { + auto *e = maybe_get(elems[i]); + + // If we're merging another scalar which belongs to the same base + // object, just merge the swizzles to avoid triggering more than 1 expression read as much as possible! + if (can_apply_swizzle_opt && e && e->base_expression && e->base_expression == base) + { + // Only supposed to be used for vector swizzle -> scalar. + assert(!e->expression.empty() && e->expression.front() == '.'); + subop += e->expression.substr(1, string::npos); + swizzle_optimization = true; + } + else + { + // We'll likely end up with duplicated swizzles, e.g. + // foobar.xyz.xyz from patterns like + // OpVectorShuffle + // OpCompositeExtract x 3 + // OpCompositeConstruct 3x + other scalar. + // Just modify op in-place. + if (swizzle_optimization) + { + if (backend.swizzle_is_function) + subop += "()"; + + // Don't attempt to remove unity swizzling if we managed to remove duplicate swizzles. + // The base "foo" might be vec4, while foo.xyz is vec3 (OpVectorShuffle) and looks like a vec3 due to the .xyz tacked on. + // We only want to remove the swizzles if we're certain that the resulting base will be the same vecsize. + // Essentially, we can only remove one set of swizzles, since that's what we have control over ... + // Case 1: + // foo.yxz.xyz: Duplicate swizzle kicks in, giving foo.yxz, we are done. + // foo.yxz was the result of OpVectorShuffle and we don't know the type of foo. + // Case 2: + // foo.xyz: Duplicate swizzle won't kick in. + // If foo is vec3, we can remove xyz, giving just foo. + if (!remove_duplicate_swizzle(subop)) + remove_unity_swizzle(base, subop); + + // Strips away redundant parens if we created them during component extraction. + strip_enclosed_expression(subop); + swizzle_optimization = false; + op += subop; + } + else + op += subop; + + if (i) + op += ", "; + + bool uses_buffer_offset = + type.basetype == SPIRType::Struct && has_member_decoration(type.self, i, DecorationOffset); + subop = to_composite_constructor_expression(type, elems[i], uses_buffer_offset); + } + + base = e ? e->base_expression : ID(0); + } + + if (swizzle_optimization) + { + if (backend.swizzle_is_function) + subop += "()"; + + if (!remove_duplicate_swizzle(subop)) + remove_unity_swizzle(base, subop); + // Strips away redundant parens if we created them during component extraction. + strip_enclosed_expression(subop); + } + + op += subop; + return op; +} + +bool CompilerGLSL::skip_argument(uint32_t id) const +{ + if (!combined_image_samplers.empty() || !options.vulkan_semantics) + { + auto &type = expression_type(id); + if (type.basetype == SPIRType::Sampler || (type.basetype == SPIRType::Image && type.image.sampled == 1)) + return true; + } + return false; +} + +bool CompilerGLSL::optimize_read_modify_write(const SPIRType &type, const string &lhs, const string &rhs) +{ + // Do this with strings because we have a very clear pattern we can check for and it avoids + // adding lots of special cases to the code emission. + if (rhs.size() < lhs.size() + 3) + return false; + + // Do not optimize matrices. They are a bit awkward to reason about in general + // (in which order does operation happen?), and it does not work on MSL anyways. + if (type.vecsize > 1 && type.columns > 1) + return false; + + auto index = rhs.find(lhs); + if (index != 0) + return false; + + // TODO: Shift operators, but it's not important for now. + auto op = rhs.find_first_of("+-/*%|&^", lhs.size() + 1); + if (op != lhs.size() + 1) + return false; + + // Check that the op is followed by space. This excludes && and ||. + if (rhs[op + 1] != ' ') + return false; + + char bop = rhs[op]; + auto expr = rhs.substr(lhs.size() + 3); + + // Avoids false positives where we get a = a * b + c. + // Normally, these expressions are always enclosed, but unexpected code paths may end up hitting this. + if (needs_enclose_expression(expr)) + return false; + + // Try to find increments and decrements. Makes it look neater as += 1, -= 1 is fairly rare to see in real code. + // Find some common patterns which are equivalent. + if ((bop == '+' || bop == '-') && (expr == "1" || expr == "uint(1)" || expr == "1u" || expr == "int(1u)")) + statement(lhs, bop, bop, ";"); + else + statement(lhs, " ", bop, "= ", expr, ";"); + return true; +} + +void CompilerGLSL::register_control_dependent_expression(uint32_t expr) +{ + if (forwarded_temporaries.find(expr) == end(forwarded_temporaries)) + return; + + assert(current_emitting_block); + current_emitting_block->invalidate_expressions.push_back(expr); +} + +void CompilerGLSL::emit_block_instructions(SPIRBlock &block) +{ + current_emitting_block = █ + + if (backend.requires_relaxed_precision_analysis) + { + // If PHI variables are consumed in unexpected precision contexts, copy them here. + for (size_t i = 0, n = block.phi_variables.size(); i < n; i++) + { + auto &phi = block.phi_variables[i]; + + // Ensure we only copy once. We know a-priori that this array will lay out + // the same function variables together. + if (i && block.phi_variables[i - 1].function_variable == phi.function_variable) + continue; + + auto itr = temporary_to_mirror_precision_alias.find(phi.function_variable); + if (itr != temporary_to_mirror_precision_alias.end()) + { + // Explicitly, we don't want to inherit RelaxedPrecision state in this CopyObject, + // so it helps to have handle_instruction_precision() on the outside of emit_instruction(). + EmbeddedInstruction inst; + inst.op = OpCopyObject; + inst.length = 3; + inst.ops.push_back(expression_type_id(itr->first)); + inst.ops.push_back(itr->second); + inst.ops.push_back(itr->first); + emit_instruction(inst); + } + } + } + + for (auto &op : block.ops) + { + auto temporary_copy = handle_instruction_precision(op); + emit_instruction(op); + if (temporary_copy.dst_id) + { + // Explicitly, we don't want to inherit RelaxedPrecision state in this CopyObject, + // so it helps to have handle_instruction_precision() on the outside of emit_instruction(). + EmbeddedInstruction inst; + inst.op = OpCopyObject; + inst.length = 3; + inst.ops.push_back(expression_type_id(temporary_copy.src_id)); + inst.ops.push_back(temporary_copy.dst_id); + inst.ops.push_back(temporary_copy.src_id); + + // Never attempt to hoist mirrored temporaries. + // They are hoisted in lock-step with their parents. + block_temporary_hoisting = true; + emit_instruction(inst); + block_temporary_hoisting = false; + } + } + + current_emitting_block = nullptr; +} + +void CompilerGLSL::disallow_forwarding_in_expression_chain(const SPIRExpression &expr) +{ + // Allow trivially forwarded expressions like OpLoad or trivial shuffles, + // these will be marked as having suppressed usage tracking. + // Our only concern is to make sure arithmetic operations are done in similar ways. + if (forced_invariant_temporaries.count(expr.self) == 0) + { + if (!expression_suppresses_usage_tracking(expr.self)) + force_temporary_and_recompile(expr.self); + forced_invariant_temporaries.insert(expr.self); + + for (auto &dependent : expr.invariance_dependencies) + disallow_forwarding_in_expression_chain(get(dependent)); + } +} + +void CompilerGLSL::handle_store_to_invariant_variable(uint32_t store_id, uint32_t value_id) +{ + // Variables or access chains marked invariant are complicated. We will need to make sure the code-gen leading up to + // this variable is consistent. The failure case for SPIRV-Cross is when an expression is forced to a temporary + // in one translation unit, but not another, e.g. due to multiple use of an expression. + // This causes variance despite the output variable being marked invariant, so the solution here is to force all dependent + // expressions to be temporaries. + // It is uncertain if this is enough to support invariant in all possible cases, but it should be good enough + // for all reasonable uses of invariant. + if (!has_decoration(store_id, DecorationInvariant)) + return; + + auto *expr = maybe_get(value_id); + if (!expr) + return; + + disallow_forwarding_in_expression_chain(*expr); +} + +void CompilerGLSL::emit_store_statement(uint32_t lhs_expression, uint32_t rhs_expression) +{ + auto rhs = to_pointer_expression(rhs_expression); + + // Statements to OpStore may be empty if it is a struct with zero members. Just forward the store to /dev/null. + if (!rhs.empty()) + { + handle_store_to_invariant_variable(lhs_expression, rhs_expression); + + if (!unroll_array_to_complex_store(lhs_expression, rhs_expression)) + { + auto lhs = to_dereferenced_expression(lhs_expression); + if (has_decoration(lhs_expression, DecorationNonUniform)) + convert_non_uniform_expression(lhs, lhs_expression); + + // We might need to cast in order to store to a builtin. + cast_to_variable_store(lhs_expression, rhs, expression_type(rhs_expression)); + + // Tries to optimize assignments like " = op expr". + // While this is purely cosmetic, this is important for legacy ESSL where loop + // variable increments must be in either i++ or i += const-expr. + // Without this, we end up with i = i + 1, which is correct GLSL, but not correct GLES 2.0. + if (!optimize_read_modify_write(expression_type(rhs_expression), lhs, rhs)) + statement(lhs, " = ", rhs, ";"); + } + register_write(lhs_expression); + } +} + +uint32_t CompilerGLSL::get_integer_width_for_instruction(const Instruction &instr) const +{ + if (instr.length < 3) + return 32; + + auto *ops = stream(instr); + + switch (instr.op) + { + case OpSConvert: + case OpConvertSToF: + case OpUConvert: + case OpConvertUToF: + case OpIEqual: + case OpINotEqual: + case OpSLessThan: + case OpSLessThanEqual: + case OpSGreaterThan: + case OpSGreaterThanEqual: + case OpULessThan: + case OpULessThanEqual: + case OpUGreaterThan: + case OpUGreaterThanEqual: + return expression_type(ops[2]).width; + + case OpSMulExtended: + case OpUMulExtended: + return get(get(ops[0]).member_types[0]).width; + + default: + { + // We can look at result type which is more robust. + auto *type = maybe_get(ops[0]); + if (type && type_is_integral(*type)) + return type->width; + else + return 32; + } + } +} + +uint32_t CompilerGLSL::get_integer_width_for_glsl_instruction(GLSLstd450 op, const uint32_t *ops, uint32_t length) const +{ + if (length < 1) + return 32; + + switch (op) + { + case GLSLstd450SAbs: + case GLSLstd450SSign: + case GLSLstd450UMin: + case GLSLstd450SMin: + case GLSLstd450UMax: + case GLSLstd450SMax: + case GLSLstd450UClamp: + case GLSLstd450SClamp: + case GLSLstd450FindSMsb: + case GLSLstd450FindUMsb: + return expression_type(ops[0]).width; + + default: + { + // We don't need to care about other opcodes, just return 32. + return 32; + } + } +} + +void CompilerGLSL::forward_relaxed_precision(uint32_t dst_id, const uint32_t *args, uint32_t length) +{ + // Only GLSL supports RelaxedPrecision directly. + // We cannot implement this in HLSL or MSL because it is tied to the type system. + // In SPIR-V, everything must masquerade as 32-bit. + if (!backend.requires_relaxed_precision_analysis) + return; + + auto input_precision = analyze_expression_precision(args, length); + + // For expressions which are loaded or directly forwarded, we inherit mediump implicitly. + // For dst_id to be analyzed properly, it must inherit any relaxed precision decoration from src_id. + if (input_precision == Options::Mediump) + set_decoration(dst_id, DecorationRelaxedPrecision); +} + +CompilerGLSL::Options::Precision CompilerGLSL::analyze_expression_precision(const uint32_t *args, uint32_t length) const +{ + // Now, analyze the precision at which the arguments would run. + // GLSL rules are such that the precision used to evaluate an expression is equal to the highest precision + // for the inputs. Constants do not have inherent precision and do not contribute to this decision. + // If all inputs are constants, they inherit precision from outer expressions, including an l-value. + // In this case, we'll have to force a temporary for dst_id so that we can bind the constant expression with + // correct precision. + bool expression_has_highp = false; + bool expression_has_mediump = false; + + for (uint32_t i = 0; i < length; i++) + { + uint32_t arg = args[i]; + + auto handle_type = ir.ids[arg].get_type(); + if (handle_type == TypeConstant || handle_type == TypeConstantOp || handle_type == TypeUndef) + continue; + + if (has_decoration(arg, DecorationRelaxedPrecision)) + expression_has_mediump = true; + else + expression_has_highp = true; + } + + if (expression_has_highp) + return Options::Highp; + else if (expression_has_mediump) + return Options::Mediump; + else + return Options::DontCare; +} + +void CompilerGLSL::analyze_precision_requirements(uint32_t type_id, uint32_t dst_id, uint32_t *args, uint32_t length) +{ + if (!backend.requires_relaxed_precision_analysis) + return; + + auto &type = get(type_id); + + // RelaxedPrecision only applies to 32-bit values. + if (type.basetype != SPIRType::Float && type.basetype != SPIRType::Int && type.basetype != SPIRType::UInt) + return; + + bool operation_is_highp = !has_decoration(dst_id, DecorationRelaxedPrecision); + + auto input_precision = analyze_expression_precision(args, length); + if (input_precision == Options::DontCare) + { + consume_temporary_in_precision_context(type_id, dst_id, input_precision); + return; + } + + // In SPIR-V and GLSL, the semantics are flipped for how relaxed precision is determined. + // In SPIR-V, the operation itself marks RelaxedPrecision, meaning that inputs can be truncated to 16-bit. + // However, if the expression is not, inputs must be expanded to 32-bit first, + // since the operation must run at high precision. + // This is the awkward part, because if we have mediump inputs, or expressions which derived from mediump, + // we might have to forcefully bind the source IDs to highp temporaries. This is done by clearing decorations + // and forcing temporaries. Similarly for mediump operations. We bind highp expressions to mediump variables. + if ((operation_is_highp && input_precision == Options::Mediump) || + (!operation_is_highp && input_precision == Options::Highp)) + { + auto precision = operation_is_highp ? Options::Highp : Options::Mediump; + for (uint32_t i = 0; i < length; i++) + { + // Rewrites the opcode so that we consume an ID in correct precision context. + // This is pretty hacky, but it's the most straight forward way of implementing this without adding + // lots of extra passes to rewrite all code blocks. + args[i] = consume_temporary_in_precision_context(expression_type_id(args[i]), args[i], precision); + } + } +} + +// This is probably not exhaustive ... +static bool opcode_is_precision_sensitive_operation(Op op) +{ + switch (op) + { + case OpFAdd: + case OpFSub: + case OpFMul: + case OpFNegate: + case OpIAdd: + case OpISub: + case OpIMul: + case OpSNegate: + case OpFMod: + case OpFDiv: + case OpFRem: + case OpSMod: + case OpSDiv: + case OpSRem: + case OpUMod: + case OpUDiv: + case OpVectorTimesMatrix: + case OpMatrixTimesVector: + case OpMatrixTimesMatrix: + case OpDPdx: + case OpDPdy: + case OpDPdxCoarse: + case OpDPdyCoarse: + case OpDPdxFine: + case OpDPdyFine: + case OpFwidth: + case OpFwidthCoarse: + case OpFwidthFine: + case OpVectorTimesScalar: + case OpMatrixTimesScalar: + case OpOuterProduct: + case OpFConvert: + case OpSConvert: + case OpUConvert: + case OpConvertSToF: + case OpConvertUToF: + case OpConvertFToU: + case OpConvertFToS: + return true; + + default: + return false; + } +} + +// Instructions which just load data but don't do any arithmetic operation should just inherit the decoration. +// SPIR-V doesn't require this, but it's somewhat implied it has to work this way, relaxed precision is only +// relevant when operating on the IDs, not when shuffling things around. +static bool opcode_is_precision_forwarding_instruction(Op op, uint32_t &arg_count) +{ + switch (op) + { + case OpLoad: + case OpAccessChain: + case OpInBoundsAccessChain: + case OpCompositeExtract: + case OpVectorExtractDynamic: + case OpSampledImage: + case OpImage: + case OpCopyObject: + + case OpImageRead: + case OpImageFetch: + case OpImageSampleImplicitLod: + case OpImageSampleProjImplicitLod: + case OpImageSampleDrefImplicitLod: + case OpImageSampleProjDrefImplicitLod: + case OpImageSampleExplicitLod: + case OpImageSampleProjExplicitLod: + case OpImageSampleDrefExplicitLod: + case OpImageSampleProjDrefExplicitLod: + case OpImageGather: + case OpImageDrefGather: + case OpImageSparseRead: + case OpImageSparseFetch: + case OpImageSparseSampleImplicitLod: + case OpImageSparseSampleProjImplicitLod: + case OpImageSparseSampleDrefImplicitLod: + case OpImageSparseSampleProjDrefImplicitLod: + case OpImageSparseSampleExplicitLod: + case OpImageSparseSampleProjExplicitLod: + case OpImageSparseSampleDrefExplicitLod: + case OpImageSparseSampleProjDrefExplicitLod: + case OpImageSparseGather: + case OpImageSparseDrefGather: + arg_count = 1; + return true; + + case OpVectorShuffle: + arg_count = 2; + return true; + + case OpCompositeConstruct: + return true; + + default: + break; + } + + return false; +} + +CompilerGLSL::TemporaryCopy CompilerGLSL::handle_instruction_precision(const Instruction &instruction) +{ + auto ops = stream_mutable(instruction); + auto opcode = static_cast(instruction.op); + uint32_t length = instruction.length; + + if (backend.requires_relaxed_precision_analysis) + { + if (length > 2) + { + uint32_t forwarding_length = length - 2; + + if (opcode_is_precision_sensitive_operation(opcode)) + analyze_precision_requirements(ops[0], ops[1], &ops[2], forwarding_length); + else if (opcode == OpExtInst && length >= 5 && get(ops[2]).ext == SPIRExtension::GLSL) + analyze_precision_requirements(ops[0], ops[1], &ops[4], forwarding_length - 2); + else if (opcode_is_precision_forwarding_instruction(opcode, forwarding_length)) + forward_relaxed_precision(ops[1], &ops[2], forwarding_length); + } + + uint32_t result_type = 0, result_id = 0; + if (instruction_to_result_type(result_type, result_id, opcode, ops, length)) + { + auto itr = temporary_to_mirror_precision_alias.find(ops[1]); + if (itr != temporary_to_mirror_precision_alias.end()) + return { itr->second, itr->first }; + } + } + + return {}; +} + +static pair split_coopmat_pointer(const string &expr) +{ + auto ptr_expr = expr; + string index_expr; + + if (ptr_expr.back() != ']') + SPIRV_CROSS_THROW("Access chain for coopmat must be indexed into an array."); + + // Strip the access chain. + ptr_expr.pop_back(); + uint32_t counter = 1; + while (counter && !ptr_expr.empty()) + { + if (ptr_expr.back() == ']') + counter++; + else if (ptr_expr.back() == '[') + counter--; + ptr_expr.pop_back(); + } + + if (ptr_expr.empty()) + SPIRV_CROSS_THROW("Invalid pointer expression for coopmat."); + + index_expr = expr.substr(ptr_expr.size() + 1, expr.size() - (ptr_expr.size() + 1) - 1); + return { std::move(ptr_expr), std::move(index_expr) }; +} + +void CompilerGLSL::emit_instruction(const Instruction &instruction) +{ + auto ops = stream(instruction); + auto opcode = static_cast(instruction.op); + uint32_t length = instruction.length; + +#define GLSL_BOP(op) emit_binary_op(ops[0], ops[1], ops[2], ops[3], #op) +#define GLSL_BOP_CAST(op, type) \ + emit_binary_op_cast(ops[0], ops[1], ops[2], ops[3], #op, type, \ + opcode_is_sign_invariant(opcode), implicit_integer_promotion) +#define GLSL_UOP(op) emit_unary_op(ops[0], ops[1], ops[2], #op) +#define GLSL_UOP_CAST(op) emit_unary_op_cast(ops[0], ops[1], ops[2], #op) +#define GLSL_QFOP(op) emit_quaternary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], ops[5], #op) +#define GLSL_TFOP(op) emit_trinary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], #op) +#define GLSL_BFOP(op) emit_binary_func_op(ops[0], ops[1], ops[2], ops[3], #op) +#define GLSL_BFOP_CAST(op, type) \ + emit_binary_func_op_cast(ops[0], ops[1], ops[2], ops[3], #op, type, opcode_is_sign_invariant(opcode)) +#define GLSL_BFOP(op) emit_binary_func_op(ops[0], ops[1], ops[2], ops[3], #op) +#define GLSL_UFOP(op) emit_unary_func_op(ops[0], ops[1], ops[2], #op) + + // If we need to do implicit bitcasts, make sure we do it with the correct type. + uint32_t integer_width = get_integer_width_for_instruction(instruction); + auto int_type = to_signed_basetype(integer_width); + auto uint_type = to_unsigned_basetype(integer_width); + + // Handle C implicit integer promotion rules. + // If we get implicit promotion to int, need to make sure we cast by value to intended return type, + // otherwise, future sign-dependent operations and bitcasts will break. + bool implicit_integer_promotion = integer_width < 32 && backend.implicit_c_integer_promotion_rules && + opcode_can_promote_integer_implicitly(opcode) && + get(ops[0]).vecsize == 1; + + opcode = get_remapped_spirv_op(opcode); + + switch (opcode) + { + // Dealing with memory + case OpLoad: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t ptr = ops[2]; + + flush_variable_declaration(ptr); + + // If we're loading from memory that cannot be changed by the shader, + // just forward the expression directly to avoid needless temporaries. + // If an expression is mutable and forwardable, we speculate that it is immutable. + bool forward = should_forward(ptr) && forced_temporaries.find(id) == end(forced_temporaries); + + // If loading a non-native row-major matrix, mark the expression as need_transpose. + bool need_transpose = false; + bool old_need_transpose = false; + + auto *ptr_expression = maybe_get(ptr); + + if (forward) + { + // If we're forwarding the load, we're also going to forward transpose state, so don't transpose while + // taking the expression. + if (ptr_expression && ptr_expression->need_transpose) + { + old_need_transpose = true; + ptr_expression->need_transpose = false; + need_transpose = true; + } + else if (is_non_native_row_major_matrix(ptr)) + need_transpose = true; + } + + // If we are forwarding this load, + // don't register the read to access chain here, defer that to when we actually use the expression, + // using the add_implied_read_expression mechanism. + string expr; + + bool is_packed = has_extended_decoration(ptr, SPIRVCrossDecorationPhysicalTypePacked); + bool is_remapped = has_extended_decoration(ptr, SPIRVCrossDecorationPhysicalTypeID); + if (forward || (!is_packed && !is_remapped)) + { + // For the simple case, we do not need to deal with repacking. + expr = to_dereferenced_expression(ptr, false); + } + else + { + // If we are not forwarding the expression, we need to unpack and resolve any physical type remapping here before + // storing the expression to a temporary. + expr = to_unpacked_expression(ptr); + } + + auto &type = get(result_type); + auto &expr_type = expression_type(ptr); + + // If the expression has more vector components than the result type, insert + // a swizzle. This shouldn't happen normally on valid SPIR-V, but it might + // happen with e.g. the MSL backend replacing the type of an input variable. + if (expr_type.vecsize > type.vecsize) + expr = enclose_expression(expr + vector_swizzle(type.vecsize, 0)); + + if (forward && ptr_expression) + ptr_expression->need_transpose = old_need_transpose; + + // We might need to cast in order to load from a builtin. + cast_from_variable_load(ptr, expr, type); + + if (forward && ptr_expression) + ptr_expression->need_transpose = false; + + // We might be trying to load a gl_Position[N], where we should be + // doing float4[](gl_in[i].gl_Position, ...) instead. + // Similar workarounds are required for input arrays in tessellation. + // Also, loading from gl_SampleMask array needs special unroll. + unroll_array_from_complex_load(id, ptr, expr); + + if (!type_is_opaque_value(type) && has_decoration(ptr, DecorationNonUniform)) + { + // If we're loading something non-opaque, we need to handle non-uniform descriptor access. + convert_non_uniform_expression(expr, ptr); + } + + if (forward && ptr_expression) + ptr_expression->need_transpose = old_need_transpose; + + bool flattened = ptr_expression && flattened_buffer_blocks.count(ptr_expression->loaded_from) != 0; + + if (backend.needs_row_major_load_workaround && !is_non_native_row_major_matrix(ptr) && !flattened) + rewrite_load_for_wrapped_row_major(expr, result_type, ptr); + + // By default, suppress usage tracking since using same expression multiple times does not imply any extra work. + // However, if we try to load a complex, composite object from a flattened buffer, + // we should avoid emitting the same code over and over and lower the result to a temporary. + bool usage_tracking = flattened && (type.basetype == SPIRType::Struct || (type.columns > 1)); + + SPIRExpression *e = nullptr; + if (!forward && expression_is_non_value_type_array(ptr)) + { + // Complicated load case where we need to make a copy of ptr, but we cannot, because + // it is an array, and our backend does not support arrays as value types. + // Emit the temporary, and copy it explicitly. + e = &emit_uninitialized_temporary_expression(result_type, id); + emit_array_copy(nullptr, id, ptr, StorageClassFunction, get_expression_effective_storage_class(ptr)); + } + else + e = &emit_op(result_type, id, expr, forward, !usage_tracking); + + e->need_transpose = need_transpose; + register_read(id, ptr, forward); + + if (forward) + { + // Pass through whether the result is of a packed type and the physical type ID. + if (has_extended_decoration(ptr, SPIRVCrossDecorationPhysicalTypePacked)) + set_extended_decoration(id, SPIRVCrossDecorationPhysicalTypePacked); + if (has_extended_decoration(ptr, SPIRVCrossDecorationPhysicalTypeID)) + { + set_extended_decoration(id, SPIRVCrossDecorationPhysicalTypeID, + get_extended_decoration(ptr, SPIRVCrossDecorationPhysicalTypeID)); + } + } + else + { + // This might have been set on an earlier compilation iteration, force it to be unset. + unset_extended_decoration(id, SPIRVCrossDecorationPhysicalTypePacked); + unset_extended_decoration(id, SPIRVCrossDecorationPhysicalTypeID); + } + + inherit_expression_dependencies(id, ptr); + if (forward) + add_implied_read_expression(*e, ptr); + break; + } + + case OpInBoundsAccessChain: + case OpAccessChain: + case OpPtrAccessChain: + { + auto *var = maybe_get(ops[2]); + if (var) + flush_variable_declaration(var->self); + + // If the base is immutable, the access chain pointer must also be. + // If an expression is mutable and forwardable, we speculate that it is immutable. + AccessChainMeta meta; + bool ptr_chain = opcode == OpPtrAccessChain; + auto &target_type = get(ops[0]); + auto e = access_chain(ops[2], &ops[3], length - 3, target_type, &meta, ptr_chain); + + // If the base is flattened UBO of struct type, the expression has to be a composite. + // In that case, backends which do not support inline syntax need it to be bound to a temporary. + // Otherwise, invalid expressions like ({UBO[0].xyz, UBO[0].w, UBO[1]}).member are emitted. + bool requires_temporary = false; + if (flattened_buffer_blocks.count(ops[2]) && target_type.basetype == SPIRType::Struct) + requires_temporary = !backend.can_declare_struct_inline; + + auto &expr = requires_temporary ? + emit_op(ops[0], ops[1], std::move(e), false) : + set(ops[1], std::move(e), ops[0], should_forward(ops[2])); + + auto *backing_variable = maybe_get_backing_variable(ops[2]); + expr.loaded_from = backing_variable ? backing_variable->self : ID(ops[2]); + expr.need_transpose = meta.need_transpose; + expr.access_chain = true; + expr.access_meshlet_position_y = meta.access_meshlet_position_y; + + // Mark the result as being packed. Some platforms handled packed vectors differently than non-packed. + if (meta.storage_is_packed) + set_extended_decoration(ops[1], SPIRVCrossDecorationPhysicalTypePacked); + if (meta.storage_physical_type != 0) + set_extended_decoration(ops[1], SPIRVCrossDecorationPhysicalTypeID, meta.storage_physical_type); + if (meta.storage_is_invariant) + set_decoration(ops[1], DecorationInvariant); + if (meta.flattened_struct) + flattened_structs[ops[1]] = true; + if (meta.relaxed_precision && backend.requires_relaxed_precision_analysis) + set_decoration(ops[1], DecorationRelaxedPrecision); + if (meta.chain_is_builtin) + set_decoration(ops[1], DecorationBuiltIn, meta.builtin); + + // If we have some expression dependencies in our access chain, this access chain is technically a forwarded + // temporary which could be subject to invalidation. + // Need to assume we're forwarded while calling inherit_expression_depdendencies. + forwarded_temporaries.insert(ops[1]); + // The access chain itself is never forced to a temporary, but its dependencies might. + suppressed_usage_tracking.insert(ops[1]); + + for (uint32_t i = 2; i < length; i++) + { + inherit_expression_dependencies(ops[1], ops[i]); + add_implied_read_expression(expr, ops[i]); + } + + // If we have no dependencies after all, i.e., all indices in the access chain are immutable temporaries, + // we're not forwarded after all. + if (expr.expression_dependencies.empty()) + forwarded_temporaries.erase(ops[1]); + + break; + } + + case OpStore: + { + auto *var = maybe_get(ops[0]); + + if (var && var->statically_assigned) + var->static_expression = ops[1]; + else if (var && var->loop_variable && !var->loop_variable_enable) + var->static_expression = ops[1]; + else if (var && var->remapped_variable && var->static_expression) + { + // Skip the write. + } + else if (flattened_structs.count(ops[0])) + { + store_flattened_struct(ops[0], ops[1]); + register_write(ops[0]); + } + else + { + emit_store_statement(ops[0], ops[1]); + } + + // Storing a pointer results in a variable pointer, so we must conservatively assume + // we can write through it. + if (expression_type(ops[1]).pointer) + register_write(ops[1]); + break; + } + + case OpArrayLength: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + auto e = access_chain_internal(ops[2], &ops[3], length - 3, ACCESS_CHAIN_INDEX_IS_LITERAL_BIT, nullptr); + if (has_decoration(ops[2], DecorationNonUniform)) + convert_non_uniform_expression(e, ops[2]); + set(id, join(type_to_glsl(get(result_type)), "(", e, ".length())"), result_type, + true); + break; + } + + // Function calls + case OpFunctionCall: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t func = ops[2]; + const auto *arg = &ops[3]; + length -= 3; + + auto &callee = get(func); + auto &return_type = get(callee.return_type); + bool pure = function_is_pure(callee); + bool control_dependent = function_is_control_dependent(callee); + + bool callee_has_out_variables = false; + bool emit_return_value_as_argument = false; + + // Invalidate out variables passed to functions since they can be OpStore'd to. + for (uint32_t i = 0; i < length; i++) + { + if (callee.arguments[i].write_count) + { + register_call_out_argument(arg[i]); + callee_has_out_variables = true; + } + + flush_variable_declaration(arg[i]); + } + + if (!return_type.array.empty() && !backend.can_return_array) + { + callee_has_out_variables = true; + emit_return_value_as_argument = true; + } + + if (!pure) + register_impure_function_call(); + + string funexpr; + SmallVector arglist; + funexpr += to_name(func) + "("; + + if (emit_return_value_as_argument) + { + statement(type_to_glsl(return_type), " ", to_name(id), type_to_array_glsl(return_type, 0), ";"); + arglist.push_back(to_name(id)); + } + + for (uint32_t i = 0; i < length; i++) + { + // Do not pass in separate images or samplers if we're remapping + // to combined image samplers. + if (skip_argument(arg[i])) + continue; + + arglist.push_back(to_func_call_arg(callee.arguments[i], arg[i])); + } + + for (auto &combined : callee.combined_parameters) + { + auto image_id = combined.global_image ? combined.image_id : VariableID(arg[combined.image_id]); + auto sampler_id = combined.global_sampler ? combined.sampler_id : VariableID(arg[combined.sampler_id]); + arglist.push_back(to_combined_image_sampler(image_id, sampler_id)); + } + + append_global_func_args(callee, length, arglist); + + funexpr += merge(arglist); + funexpr += ")"; + + // Check for function call constraints. + check_function_call_constraints(arg, length); + + if (return_type.basetype != SPIRType::Void) + { + // If the function actually writes to an out variable, + // take the conservative route and do not forward. + // The problem is that we might not read the function + // result (and emit the function) before an out variable + // is read (common case when return value is ignored! + // In order to avoid start tracking invalid variables, + // just avoid the forwarding problem altogether. + bool forward = args_will_forward(id, arg, length, pure) && !callee_has_out_variables && pure && + (forced_temporaries.find(id) == end(forced_temporaries)); + + if (emit_return_value_as_argument) + { + statement(funexpr, ";"); + set(id, to_name(id), result_type, true); + } + else + emit_op(result_type, id, funexpr, forward); + + // Function calls are implicit loads from all variables in question. + // Set dependencies for them. + for (uint32_t i = 0; i < length; i++) + register_read(id, arg[i], forward); + + // If we're going to forward the temporary result, + // put dependencies on every variable that must not change. + if (forward) + register_global_read_dependencies(callee, id); + } + else + statement(funexpr, ";"); + + if (control_dependent) + register_control_dependent_expression(id); + + break; + } + + // Composite munging + case OpCompositeConstruct: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + const auto *const elems = &ops[2]; + length -= 2; + + bool forward = true; + for (uint32_t i = 0; i < length; i++) + forward = forward && should_forward(elems[i]); + + auto &out_type = get(result_type); + auto *in_type = length > 0 ? &expression_type(elems[0]) : nullptr; + + // Only splat if we have vector constructors. + // Arrays and structs must be initialized properly in full. + bool composite = !out_type.array.empty() || out_type.basetype == SPIRType::Struct; + + bool splat = false; + bool swizzle_splat = false; + + if (in_type) + { + splat = in_type->vecsize == 1 && in_type->columns == 1 && !composite && backend.use_constructor_splatting; + swizzle_splat = in_type->vecsize == 1 && in_type->columns == 1 && backend.can_swizzle_scalar; + + if (ir.ids[elems[0]].get_type() == TypeConstant && !type_is_floating_point(*in_type)) + { + // Cannot swizzle literal integers as a special case. + swizzle_splat = false; + } + } + + if (splat || swizzle_splat) + { + uint32_t input = elems[0]; + for (uint32_t i = 0; i < length; i++) + { + if (input != elems[i]) + { + splat = false; + swizzle_splat = false; + } + } + } + + if (out_type.basetype == SPIRType::Struct && !backend.can_declare_struct_inline) + forward = false; + if (!out_type.array.empty() && !backend.can_declare_arrays_inline) + forward = false; + if (type_is_empty(out_type) && !backend.supports_empty_struct) + forward = false; + + string constructor_op; + if (backend.use_initializer_list && composite) + { + bool needs_trailing_tracket = false; + // Only use this path if we are building composites. + // This path cannot be used for arithmetic. + if (backend.use_typed_initializer_list && out_type.basetype == SPIRType::Struct && out_type.array.empty()) + constructor_op += type_to_glsl_constructor(get(result_type)); + else if (backend.use_typed_initializer_list && backend.array_is_value_type && !out_type.array.empty()) + { + // MSL path. Array constructor is baked into type here, do not use _constructor variant. + constructor_op += type_to_glsl_constructor(get(result_type)) + "("; + needs_trailing_tracket = true; + } + constructor_op += "{ "; + + if (type_is_empty(out_type) && !backend.supports_empty_struct) + constructor_op += "0"; + else if (splat) + constructor_op += to_unpacked_expression(elems[0]); + else + constructor_op += build_composite_combiner(result_type, elems, length); + constructor_op += " }"; + if (needs_trailing_tracket) + constructor_op += ")"; + } + else if (swizzle_splat && !composite) + { + constructor_op = remap_swizzle(get(result_type), 1, to_unpacked_expression(elems[0])); + } + else + { + constructor_op = type_to_glsl_constructor(get(result_type)) + "("; + if (type_is_empty(out_type) && !backend.supports_empty_struct) + constructor_op += "0"; + else if (splat) + constructor_op += to_unpacked_expression(elems[0]); + else + constructor_op += build_composite_combiner(result_type, elems, length); + constructor_op += ")"; + } + + if (!constructor_op.empty()) + { + emit_op(result_type, id, constructor_op, forward); + for (uint32_t i = 0; i < length; i++) + inherit_expression_dependencies(id, elems[i]); + } + break; + } + + case OpVectorInsertDynamic: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t vec = ops[2]; + uint32_t comp = ops[3]; + uint32_t index = ops[4]; + + flush_variable_declaration(vec); + + // Make a copy, then use access chain to store the variable. + statement(declare_temporary(result_type, id), to_expression(vec), ";"); + set(id, to_name(id), result_type, true); + auto chain = access_chain_internal(id, &index, 1, 0, nullptr); + statement(chain, " = ", to_unpacked_expression(comp), ";"); + break; + } + + case OpVectorExtractDynamic: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + auto expr = access_chain_internal(ops[2], &ops[3], 1, 0, nullptr); + emit_op(result_type, id, expr, should_forward(ops[2])); + inherit_expression_dependencies(id, ops[2]); + inherit_expression_dependencies(id, ops[3]); + break; + } + + case OpCompositeExtract: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + length -= 3; + + auto &type = get(result_type); + + // We can only split the expression here if our expression is forwarded as a temporary. + bool allow_base_expression = forced_temporaries.find(id) == end(forced_temporaries); + + // Do not allow base expression for struct members. We risk doing "swizzle" optimizations in this case. + auto &composite_type = expression_type(ops[2]); + bool composite_type_is_complex = composite_type.basetype == SPIRType::Struct || !composite_type.array.empty(); + if (composite_type_is_complex) + allow_base_expression = false; + + if (composite_type.op == OpTypeCooperativeMatrixKHR) + allow_base_expression = false; + + // Packed expressions or physical ID mapped expressions cannot be split up. + if (has_extended_decoration(ops[2], SPIRVCrossDecorationPhysicalTypePacked) || + has_extended_decoration(ops[2], SPIRVCrossDecorationPhysicalTypeID)) + allow_base_expression = false; + + // Cannot use base expression for row-major matrix row-extraction since we need to interleave access pattern + // into the base expression. + if (is_non_native_row_major_matrix(ops[2])) + allow_base_expression = false; + + AccessChainMeta meta; + SPIRExpression *e = nullptr; + auto *c = maybe_get(ops[2]); + + if (c && !c->specialization && !composite_type_is_complex) + { + auto expr = to_extract_constant_composite_expression(result_type, *c, ops + 3, length); + e = &emit_op(result_type, id, expr, true, true); + } + else if (allow_base_expression && should_forward(ops[2]) && type.vecsize == 1 && type.columns == 1 && length == 1) + { + // Only apply this optimization if result is scalar. + + // We want to split the access chain from the base. + // This is so we can later combine different CompositeExtract results + // with CompositeConstruct without emitting code like + // + // vec3 temp = texture(...).xyz + // vec4(temp.x, temp.y, temp.z, 1.0). + // + // when we actually wanted to emit this + // vec4(texture(...).xyz, 1.0). + // + // Including the base will prevent this and would trigger multiple reads + // from expression causing it to be forced to an actual temporary in GLSL. + auto expr = access_chain_internal(ops[2], &ops[3], length, + ACCESS_CHAIN_INDEX_IS_LITERAL_BIT | ACCESS_CHAIN_CHAIN_ONLY_BIT | + ACCESS_CHAIN_FORCE_COMPOSITE_BIT, &meta); + e = &emit_op(result_type, id, expr, true, should_suppress_usage_tracking(ops[2])); + inherit_expression_dependencies(id, ops[2]); + e->base_expression = ops[2]; + + if (meta.relaxed_precision && backend.requires_relaxed_precision_analysis) + set_decoration(ops[1], DecorationRelaxedPrecision); + } + else + { + auto expr = access_chain_internal(ops[2], &ops[3], length, + ACCESS_CHAIN_INDEX_IS_LITERAL_BIT | ACCESS_CHAIN_FORCE_COMPOSITE_BIT, &meta); + e = &emit_op(result_type, id, expr, should_forward(ops[2]), should_suppress_usage_tracking(ops[2])); + inherit_expression_dependencies(id, ops[2]); + } + + // Pass through some meta information to the loaded expression. + // We can still end up loading a buffer type to a variable, then CompositeExtract from it + // instead of loading everything through an access chain. + e->need_transpose = meta.need_transpose; + if (meta.storage_is_packed) + set_extended_decoration(id, SPIRVCrossDecorationPhysicalTypePacked); + if (meta.storage_physical_type != 0) + set_extended_decoration(id, SPIRVCrossDecorationPhysicalTypeID, meta.storage_physical_type); + if (meta.storage_is_invariant) + set_decoration(id, DecorationInvariant); + + break; + } + + case OpCompositeInsert: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t obj = ops[2]; + uint32_t composite = ops[3]; + const auto *elems = &ops[4]; + length -= 4; + + flush_variable_declaration(composite); + + // CompositeInsert requires a copy + modification, but this is very awkward code in HLL. + // Speculate that the input composite is no longer used, and we can modify it in-place. + // There are various scenarios where this is not possible to satisfy. + bool can_modify_in_place = true; + forced_temporaries.insert(id); + + // Cannot safely RMW PHI variables since they have no way to be invalidated, + // forcing temporaries is not going to help. + // This is similar for Constant and Undef inputs. + // The only safe thing to RMW is SPIRExpression. + // If the expression has already been used (i.e. used in a continue block), we have to keep using + // that loop variable, since we won't be able to override the expression after the fact. + // If the composite is hoisted, we might never be able to properly invalidate any usage + // of that composite in a subsequent loop iteration. + if (invalid_expressions.count(composite) || + block_composite_insert_overwrite.count(composite) || + hoisted_temporaries.count(id) || hoisted_temporaries.count(composite) || + maybe_get(composite) == nullptr) + { + can_modify_in_place = false; + } + else if (backend.requires_relaxed_precision_analysis && + has_decoration(composite, DecorationRelaxedPrecision) != + has_decoration(id, DecorationRelaxedPrecision) && + get(result_type).basetype != SPIRType::Struct) + { + // Similarly, if precision does not match for input and output, + // we cannot alias them. If we write a composite into a relaxed precision + // ID, we might get a false truncation. + can_modify_in_place = false; + } + + if (can_modify_in_place) + { + // Have to make sure the modified SSA value is bound to a temporary so we can modify it in-place. + if (!forced_temporaries.count(composite)) + force_temporary_and_recompile(composite); + + auto chain = access_chain_internal(composite, elems, length, ACCESS_CHAIN_INDEX_IS_LITERAL_BIT, nullptr); + statement(chain, " = ", to_unpacked_expression(obj), ";"); + set(id, to_expression(composite), result_type, true); + invalid_expressions.insert(composite); + composite_insert_overwritten.insert(composite); + } + else + { + if (maybe_get(composite) != nullptr) + { + emit_uninitialized_temporary_expression(result_type, id); + } + else + { + // Make a copy, then use access chain to store the variable. + statement(declare_temporary(result_type, id), to_expression(composite), ";"); + set(id, to_name(id), result_type, true); + } + + auto chain = access_chain_internal(id, elems, length, ACCESS_CHAIN_INDEX_IS_LITERAL_BIT, nullptr); + statement(chain, " = ", to_unpacked_expression(obj), ";"); + } + + break; + } + + case OpCopyMemory: + { + uint32_t lhs = ops[0]; + uint32_t rhs = ops[1]; + if (lhs != rhs) + { + uint32_t &tmp_id = extra_sub_expressions[instruction.offset | EXTRA_SUB_EXPRESSION_TYPE_STREAM_OFFSET]; + if (!tmp_id) + tmp_id = ir.increase_bound_by(1); + uint32_t tmp_type_id = expression_type(rhs).parent_type; + + EmbeddedInstruction fake_load, fake_store; + fake_load.op = OpLoad; + fake_load.length = 3; + fake_load.ops.push_back(tmp_type_id); + fake_load.ops.push_back(tmp_id); + fake_load.ops.push_back(rhs); + + fake_store.op = OpStore; + fake_store.length = 2; + fake_store.ops.push_back(lhs); + fake_store.ops.push_back(tmp_id); + + // Load and Store do a *lot* of workarounds, and we'd like to reuse them as much as possible. + // Synthesize a fake Load and Store pair for CopyMemory. + emit_instruction(fake_load); + emit_instruction(fake_store); + } + break; + } + + case OpCopyLogical: + { + // This is used for copying object of different types, arrays and structs. + // We need to unroll the copy, element-by-element. + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t rhs = ops[2]; + + emit_uninitialized_temporary_expression(result_type, id); + emit_copy_logical_type(id, result_type, rhs, expression_type_id(rhs), {}); + break; + } + + case OpCopyObject: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t rhs = ops[2]; + bool pointer = get(result_type).pointer; + + auto *chain = maybe_get(rhs); + auto *imgsamp = maybe_get(rhs); + if (chain) + { + // Cannot lower to a SPIRExpression, just copy the object. + auto &e = set(id, *chain); + e.self = id; + } + else if (imgsamp) + { + // Cannot lower to a SPIRExpression, just copy the object. + // GLSL does not currently use this type and will never get here, but MSL does. + // Handled here instead of CompilerMSL for better integration and general handling, + // and in case GLSL or other subclasses require it in the future. + auto &e = set(id, *imgsamp); + e.self = id; + } + else if (expression_is_lvalue(rhs) && !pointer) + { + // Need a copy. + // For pointer types, we copy the pointer itself. + emit_op(result_type, id, to_unpacked_expression(rhs), false); + } + else + { + // RHS expression is immutable, so just forward it. + // Copying these things really make no sense, but + // seems to be allowed anyways. + auto &e = emit_op(result_type, id, to_expression(rhs), true, true); + if (pointer) + { + auto *var = maybe_get_backing_variable(rhs); + e.loaded_from = var ? var->self : ID(0); + } + + // If we're copying an access chain, need to inherit the read expressions. + auto *rhs_expr = maybe_get(rhs); + if (rhs_expr) + { + e.implied_read_expressions = rhs_expr->implied_read_expressions; + e.expression_dependencies = rhs_expr->expression_dependencies; + } + } + break; + } + + case OpVectorShuffle: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t vec0 = ops[2]; + uint32_t vec1 = ops[3]; + const auto *elems = &ops[4]; + length -= 4; + + auto &type0 = expression_type(vec0); + + // If we have the undefined swizzle index -1, we need to swizzle in undefined data, + // or in our case, T(0). + bool shuffle = false; + for (uint32_t i = 0; i < length; i++) + if (elems[i] >= type0.vecsize || elems[i] == 0xffffffffu) + shuffle = true; + + // Cannot use swizzles with packed expressions, force shuffle path. + if (!shuffle && has_extended_decoration(vec0, SPIRVCrossDecorationPhysicalTypePacked)) + shuffle = true; + + string expr; + bool should_fwd, trivial_forward; + + if (shuffle) + { + should_fwd = should_forward(vec0) && should_forward(vec1); + trivial_forward = should_suppress_usage_tracking(vec0) && should_suppress_usage_tracking(vec1); + + // Constructor style and shuffling from two different vectors. + SmallVector args; + for (uint32_t i = 0; i < length; i++) + { + if (elems[i] == 0xffffffffu) + { + // Use a constant 0 here. + // We could use the first component or similar, but then we risk propagating + // a value we might not need, and bog down codegen. + SPIRConstant c; + c.constant_type = type0.parent_type; + assert(type0.parent_type != ID(0)); + args.push_back(constant_expression(c)); + } + else if (elems[i] >= type0.vecsize) + args.push_back(to_extract_component_expression(vec1, elems[i] - type0.vecsize)); + else + args.push_back(to_extract_component_expression(vec0, elems[i])); + } + expr += join(type_to_glsl_constructor(get(result_type)), "(", merge(args), ")"); + } + else + { + should_fwd = should_forward(vec0); + trivial_forward = should_suppress_usage_tracking(vec0); + + // We only source from first vector, so can use swizzle. + // If the vector is packed, unpack it before applying a swizzle (needed for MSL) + expr += to_enclosed_unpacked_expression(vec0); + expr += "."; + for (uint32_t i = 0; i < length; i++) + { + assert(elems[i] != 0xffffffffu); + expr += index_to_swizzle(elems[i]); + } + + if (backend.swizzle_is_function && length > 1) + expr += "()"; + } + + // A shuffle is trivial in that it doesn't actually *do* anything. + // We inherit the forwardedness from our arguments to avoid flushing out to temporaries when it's not really needed. + + emit_op(result_type, id, expr, should_fwd, trivial_forward); + + inherit_expression_dependencies(id, vec0); + if (vec0 != vec1) + inherit_expression_dependencies(id, vec1); + break; + } + + // ALU + case OpIsNan: + if (!is_legacy()) + GLSL_UFOP(isnan); + else + { + // Check if the number doesn't equal itself + auto &type = get(ops[0]); + if (type.vecsize > 1) + emit_binary_func_op(ops[0], ops[1], ops[2], ops[2], "notEqual"); + else + emit_binary_op(ops[0], ops[1], ops[2], ops[2], "!="); + } + break; + + case OpIsInf: + if (!is_legacy()) + GLSL_UFOP(isinf); + else + { + // inf * 2 == inf by IEEE 754 rules, note this also applies to 0.0 + // This is more reliable than checking if product with zero is NaN + uint32_t result_type = ops[0]; + uint32_t result_id = ops[1]; + uint32_t operand = ops[2]; + + auto &type = get(result_type); + std::string expr; + if (type.vecsize > 1) + { + expr = type_to_glsl_constructor(type); + expr += '('; + for (uint32_t i = 0; i < type.vecsize; i++) + { + auto comp = to_extract_component_expression(operand, i); + expr += join(comp, " != 0.0 && 2.0 * ", comp, " == ", comp); + + if (i + 1 < type.vecsize) + expr += ", "; + } + expr += ')'; + } + else + { + // Register an extra read to force writing out a temporary + auto oper = to_enclosed_expression(operand); + track_expression_read(operand); + expr += join(oper, " != 0.0 && 2.0 * ", oper, " == ", oper); + } + emit_op(result_type, result_id, expr, should_forward(operand)); + + inherit_expression_dependencies(result_id, operand); + } + break; + + case OpSNegate: + if (implicit_integer_promotion || expression_type_id(ops[2]) != ops[0]) + GLSL_UOP_CAST(-); + else + GLSL_UOP(-); + break; + + case OpFNegate: + GLSL_UOP(-); + break; + + case OpIAdd: + { + // For simple arith ops, prefer the output type if there's a mismatch to avoid extra bitcasts. + auto type = get(ops[0]).basetype; + GLSL_BOP_CAST(+, type); + break; + } + + case OpFAdd: + GLSL_BOP(+); + break; + + case OpISub: + { + auto type = get(ops[0]).basetype; + GLSL_BOP_CAST(-, type); + break; + } + + case OpFSub: + GLSL_BOP(-); + break; + + case OpIMul: + { + auto type = get(ops[0]).basetype; + GLSL_BOP_CAST(*, type); + break; + } + + case OpVectorTimesMatrix: + case OpMatrixTimesVector: + { + // If the matrix needs transpose, just flip the multiply order. + auto *e = maybe_get(ops[opcode == OpMatrixTimesVector ? 2 : 3]); + if (e && e->need_transpose) + { + e->need_transpose = false; + string expr; + + if (opcode == OpMatrixTimesVector) + expr = join(to_enclosed_unpacked_expression(ops[3]), " * ", + enclose_expression(to_unpacked_row_major_matrix_expression(ops[2]))); + else + expr = join(enclose_expression(to_unpacked_row_major_matrix_expression(ops[3])), " * ", + to_enclosed_unpacked_expression(ops[2])); + + bool forward = should_forward(ops[2]) && should_forward(ops[3]); + emit_op(ops[0], ops[1], expr, forward); + e->need_transpose = true; + inherit_expression_dependencies(ops[1], ops[2]); + inherit_expression_dependencies(ops[1], ops[3]); + } + else + GLSL_BOP(*); + break; + } + + case OpMatrixTimesMatrix: + { + auto *a = maybe_get(ops[2]); + auto *b = maybe_get(ops[3]); + + // If both matrices need transpose, we can multiply in flipped order and tag the expression as transposed. + // a^T * b^T = (b * a)^T. + if (a && b && a->need_transpose && b->need_transpose) + { + a->need_transpose = false; + b->need_transpose = false; + auto expr = join(enclose_expression(to_unpacked_row_major_matrix_expression(ops[3])), " * ", + enclose_expression(to_unpacked_row_major_matrix_expression(ops[2]))); + bool forward = should_forward(ops[2]) && should_forward(ops[3]); + emit_transposed_op(ops[0], ops[1], expr, forward); + a->need_transpose = true; + b->need_transpose = true; + inherit_expression_dependencies(ops[1], ops[2]); + inherit_expression_dependencies(ops[1], ops[3]); + } + else + GLSL_BOP(*); + + break; + } + + case OpMatrixTimesScalar: + { + auto *a = maybe_get(ops[2]); + + // If the matrix need transpose, just mark the result as needing so. + if (a && a->need_transpose) + { + a->need_transpose = false; + auto expr = join(enclose_expression(to_unpacked_row_major_matrix_expression(ops[2])), " * ", + to_enclosed_unpacked_expression(ops[3])); + bool forward = should_forward(ops[2]) && should_forward(ops[3]); + emit_transposed_op(ops[0], ops[1], expr, forward); + a->need_transpose = true; + inherit_expression_dependencies(ops[1], ops[2]); + inherit_expression_dependencies(ops[1], ops[3]); + } + else + GLSL_BOP(*); + break; + } + + case OpFMul: + case OpVectorTimesScalar: + GLSL_BOP(*); + break; + + case OpOuterProduct: + if (options.version < 120) // Matches GLSL 1.10 / ESSL 1.00 + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t a = ops[2]; + uint32_t b = ops[3]; + + auto &type = get(result_type); + string expr = type_to_glsl_constructor(type); + expr += "("; + for (uint32_t col = 0; col < type.columns; col++) + { + expr += to_enclosed_expression(a); + expr += " * "; + expr += to_extract_component_expression(b, col); + if (col + 1 < type.columns) + expr += ", "; + } + expr += ")"; + emit_op(result_type, id, expr, should_forward(a) && should_forward(b)); + inherit_expression_dependencies(id, a); + inherit_expression_dependencies(id, b); + } + else + GLSL_BFOP(outerProduct); + break; + + case OpDot: + GLSL_BFOP(dot); + break; + + case OpTranspose: + if (options.version < 120) // Matches GLSL 1.10 / ESSL 1.00 + { + // transpose() is not available, so instead, flip need_transpose, + // which can later be turned into an emulated transpose op by + // convert_row_major_matrix(), if necessary. + uint32_t result_type = ops[0]; + uint32_t result_id = ops[1]; + uint32_t input = ops[2]; + + // Force need_transpose to false temporarily to prevent + // to_expression() from doing the transpose. + bool need_transpose = false; + auto *input_e = maybe_get(input); + if (input_e) + swap(need_transpose, input_e->need_transpose); + + bool forward = should_forward(input); + auto &e = emit_op(result_type, result_id, to_expression(input), forward); + e.need_transpose = !need_transpose; + + // Restore the old need_transpose flag. + if (input_e) + input_e->need_transpose = need_transpose; + } + else + GLSL_UFOP(transpose); + break; + + case OpSRem: + { + uint32_t result_type = ops[0]; + uint32_t result_id = ops[1]; + uint32_t op0 = ops[2]; + uint32_t op1 = ops[3]; + + auto &out_type = get(result_type); + + bool forward = should_forward(op0) && should_forward(op1); + string cast_op0, cast_op1; + auto expected_type = binary_op_bitcast_helper(cast_op0, cast_op1, int_type, op0, op1, false); + + // Needs special handling. + auto expr = join(cast_op0, " - ", cast_op1, " * ", "(", cast_op0, " / ", cast_op1, ")"); + + if (implicit_integer_promotion) + { + expr = join(type_to_glsl(get(result_type)), '(', expr, ')'); + } + else if (out_type.basetype != int_type) + { + expected_type.basetype = int_type; + expr = join(bitcast_glsl_op(out_type, expected_type), '(', expr, ')'); + } + + emit_op(result_type, result_id, expr, forward); + inherit_expression_dependencies(result_id, op0); + inherit_expression_dependencies(result_id, op1); + break; + } + + case OpSDiv: + GLSL_BOP_CAST(/, int_type); + break; + + case OpUDiv: + GLSL_BOP_CAST(/, uint_type); + break; + + case OpIAddCarry: + case OpISubBorrow: + { + if (options.es && options.version < 310) + SPIRV_CROSS_THROW("Extended arithmetic is only available from ESSL 310."); + else if (!options.es && options.version < 400) + SPIRV_CROSS_THROW("Extended arithmetic is only available from GLSL 400."); + + uint32_t result_type = ops[0]; + uint32_t result_id = ops[1]; + uint32_t op0 = ops[2]; + uint32_t op1 = ops[3]; + auto &type = get(result_type); + emit_uninitialized_temporary_expression(result_type, result_id); + const char *op = opcode == OpIAddCarry ? "uaddCarry" : "usubBorrow"; + + statement(to_expression(result_id), ".", to_member_name(type, 0), " = ", op, "(", to_expression(op0), ", ", + to_expression(op1), ", ", to_expression(result_id), ".", to_member_name(type, 1), ");"); + break; + } + + case OpUMulExtended: + case OpSMulExtended: + { + if (options.es && options.version < 310) + SPIRV_CROSS_THROW("Extended arithmetic is only available from ESSL 310."); + else if (!options.es && options.version < 400) + SPIRV_CROSS_THROW("Extended arithmetic is only available from GLSL 4000."); + + uint32_t result_type = ops[0]; + uint32_t result_id = ops[1]; + uint32_t op0 = ops[2]; + uint32_t op1 = ops[3]; + auto &type = get(result_type); + emit_uninitialized_temporary_expression(result_type, result_id); + const char *op = opcode == OpUMulExtended ? "umulExtended" : "imulExtended"; + + statement(op, "(", to_expression(op0), ", ", to_expression(op1), ", ", to_expression(result_id), ".", + to_member_name(type, 1), ", ", to_expression(result_id), ".", to_member_name(type, 0), ");"); + break; + } + + case OpFDiv: + GLSL_BOP(/); + break; + + case OpShiftRightLogical: + GLSL_BOP_CAST(>>, uint_type); + break; + + case OpShiftRightArithmetic: + GLSL_BOP_CAST(>>, int_type); + break; + + case OpShiftLeftLogical: + { + auto type = get(ops[0]).basetype; + GLSL_BOP_CAST(<<, type); + break; + } + + case OpBitwiseOr: + { + auto type = get(ops[0]).basetype; + GLSL_BOP_CAST(|, type); + break; + } + + case OpBitwiseXor: + { + auto type = get(ops[0]).basetype; + GLSL_BOP_CAST(^, type); + break; + } + + case OpBitwiseAnd: + { + auto type = get(ops[0]).basetype; + GLSL_BOP_CAST(&, type); + break; + } + + case OpNot: + if (implicit_integer_promotion || expression_type_id(ops[2]) != ops[0]) + GLSL_UOP_CAST(~); + else + GLSL_UOP(~); + break; + + case OpUMod: + GLSL_BOP_CAST(%, uint_type); + break; + + case OpSMod: + GLSL_BOP_CAST(%, int_type); + break; + + case OpFMod: + GLSL_BFOP(mod); + break; + + case OpFRem: + { + uint32_t result_type = ops[0]; + uint32_t result_id = ops[1]; + uint32_t op0 = ops[2]; + uint32_t op1 = ops[3]; + + // Needs special handling. + bool forward = should_forward(op0) && should_forward(op1); + std::string expr; + if (!is_legacy()) + { + expr = join(to_enclosed_expression(op0), " - ", to_enclosed_expression(op1), " * ", "trunc(", + to_enclosed_expression(op0), " / ", to_enclosed_expression(op1), ")"); + } + else + { + // Legacy GLSL has no trunc, emulate by casting to int and back + auto &op0_type = expression_type(op0); + auto via_type = op0_type; + via_type.basetype = SPIRType::Int; + expr = join(to_enclosed_expression(op0), " - ", to_enclosed_expression(op1), " * ", + type_to_glsl(op0_type), "(", type_to_glsl(via_type), "(", + to_enclosed_expression(op0), " / ", to_enclosed_expression(op1), "))"); + } + + emit_op(result_type, result_id, expr, forward); + inherit_expression_dependencies(result_id, op0); + inherit_expression_dependencies(result_id, op1); + break; + } + + // Relational + case OpAny: + GLSL_UFOP(any); + break; + + case OpAll: + GLSL_UFOP(all); + break; + + case OpSelect: + emit_mix_op(ops[0], ops[1], ops[4], ops[3], ops[2]); + break; + + case OpLogicalOr: + { + // No vector variant in GLSL for logical OR. + auto result_type = ops[0]; + auto id = ops[1]; + auto &type = get(result_type); + + if (type.vecsize > 1) + emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "||", false, SPIRType::Unknown); + else + GLSL_BOP(||); + break; + } + + case OpLogicalAnd: + { + // No vector variant in GLSL for logical AND. + auto result_type = ops[0]; + auto id = ops[1]; + auto &type = get(result_type); + + if (type.vecsize > 1) + emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "&&", false, SPIRType::Unknown); + else + GLSL_BOP(&&); + break; + } + + case OpLogicalNot: + { + auto &type = get(ops[0]); + if (type.vecsize > 1) + GLSL_UFOP(not ); + else + GLSL_UOP(!); + break; + } + + case OpIEqual: + { + if (expression_type(ops[2]).vecsize > 1) + GLSL_BFOP_CAST(equal, int_type); + else + GLSL_BOP_CAST(==, int_type); + break; + } + + case OpLogicalEqual: + case OpFOrdEqual: + { + if (expression_type(ops[2]).vecsize > 1) + GLSL_BFOP(equal); + else + GLSL_BOP(==); + break; + } + + case OpINotEqual: + { + if (expression_type(ops[2]).vecsize > 1) + GLSL_BFOP_CAST(notEqual, int_type); + else + GLSL_BOP_CAST(!=, int_type); + break; + } + + case OpLogicalNotEqual: + case OpFOrdNotEqual: + case OpFUnordNotEqual: + { + // GLSL is fuzzy on what to do with ordered vs unordered not equal. + // glslang started emitting UnorderedNotEqual some time ago to harmonize with IEEE, + // but this means we have no easy way of implementing ordered not equal. + if (expression_type(ops[2]).vecsize > 1) + GLSL_BFOP(notEqual); + else + GLSL_BOP(!=); + break; + } + + case OpUGreaterThan: + case OpSGreaterThan: + { + auto type = opcode == OpUGreaterThan ? uint_type : int_type; + if (expression_type(ops[2]).vecsize > 1) + GLSL_BFOP_CAST(greaterThan, type); + else + GLSL_BOP_CAST(>, type); + break; + } + + case OpFOrdGreaterThan: + { + if (expression_type(ops[2]).vecsize > 1) + GLSL_BFOP(greaterThan); + else + GLSL_BOP(>); + break; + } + + case OpUGreaterThanEqual: + case OpSGreaterThanEqual: + { + auto type = opcode == OpUGreaterThanEqual ? uint_type : int_type; + if (expression_type(ops[2]).vecsize > 1) + GLSL_BFOP_CAST(greaterThanEqual, type); + else + GLSL_BOP_CAST(>=, type); + break; + } + + case OpFOrdGreaterThanEqual: + { + if (expression_type(ops[2]).vecsize > 1) + GLSL_BFOP(greaterThanEqual); + else + GLSL_BOP(>=); + break; + } + + case OpULessThan: + case OpSLessThan: + { + auto type = opcode == OpULessThan ? uint_type : int_type; + if (expression_type(ops[2]).vecsize > 1) + GLSL_BFOP_CAST(lessThan, type); + else + GLSL_BOP_CAST(<, type); + break; + } + + case OpFOrdLessThan: + { + if (expression_type(ops[2]).vecsize > 1) + GLSL_BFOP(lessThan); + else + GLSL_BOP(<); + break; + } + + case OpULessThanEqual: + case OpSLessThanEqual: + { + auto type = opcode == OpULessThanEqual ? uint_type : int_type; + if (expression_type(ops[2]).vecsize > 1) + GLSL_BFOP_CAST(lessThanEqual, type); + else + GLSL_BOP_CAST(<=, type); + break; + } + + case OpFOrdLessThanEqual: + { + if (expression_type(ops[2]).vecsize > 1) + GLSL_BFOP(lessThanEqual); + else + GLSL_BOP(<=); + break; + } + + // Conversion + case OpSConvert: + case OpConvertSToF: + case OpUConvert: + case OpConvertUToF: + { + auto input_type = opcode == OpSConvert || opcode == OpConvertSToF ? int_type : uint_type; + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + auto &type = get(result_type); + auto &arg_type = expression_type(ops[2]); + auto func = type_to_glsl_constructor(type); + + if (arg_type.width < type.width || type_is_floating_point(type)) + emit_unary_func_op_cast(result_type, id, ops[2], func.c_str(), input_type, type.basetype); + else + emit_unary_func_op(result_type, id, ops[2], func.c_str()); + break; + } + + case OpConvertFToU: + case OpConvertFToS: + { + // Cast to expected arithmetic type, then potentially bitcast away to desired signedness. + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + auto &type = get(result_type); + auto expected_type = type; + auto &float_type = expression_type(ops[2]); + expected_type.basetype = + opcode == OpConvertFToS ? to_signed_basetype(type.width) : to_unsigned_basetype(type.width); + + auto func = type_to_glsl_constructor(expected_type); + emit_unary_func_op_cast(result_type, id, ops[2], func.c_str(), float_type.basetype, expected_type.basetype); + break; + } + + case OpCooperativeMatrixConvertNV: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("CooperativeMatrixConvertNV requires vulkan semantics."); + require_extension_internal("GL_NV_cooperative_matrix2"); + // fallthrough + case OpFConvert: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + auto &type = get(result_type); + + if (type.op == OpTypeCooperativeMatrixKHR && opcode == OpFConvert) + { + auto &expr_type = expression_type(ops[2]); + if (get(type.ext.cooperative.use_id).scalar() != + get(expr_type.ext.cooperative.use_id).scalar()) + { + // Somewhat questionable with spec constant uses. + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("NV_cooperative_matrix2 requires vulkan semantics."); + require_extension_internal("GL_NV_cooperative_matrix2"); + } + } + + if ((type.basetype == SPIRType::FloatE4M3 || type.basetype == SPIRType::FloatE5M2) && + has_decoration(id, DecorationSaturatedToLargestFloat8NormalConversionEXT)) + { + emit_uninitialized_temporary_expression(result_type, id); + statement("saturatedConvertEXT(", to_expression(id), ", ", to_unpacked_expression(ops[2]), ");"); + } + else + { + auto func = type_to_glsl_constructor(type); + emit_unary_func_op(result_type, id, ops[2], func.c_str()); + } + break; + } + + case OpBitcast: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t arg = ops[2]; + + if (!emit_complex_bitcast(result_type, id, arg)) + { + auto op = bitcast_glsl_op(get(result_type), expression_type(arg)); + emit_unary_func_op(result_type, id, arg, op.c_str()); + } + break; + } + + case OpQuantizeToF16: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t arg = ops[2]; + + string op; + auto &type = get(result_type); + + switch (type.vecsize) + { + case 1: + op = join("unpackHalf2x16(packHalf2x16(vec2(", to_expression(arg), "))).x"); + break; + case 2: + op = join("unpackHalf2x16(packHalf2x16(", to_expression(arg), "))"); + break; + case 3: + { + auto op0 = join("unpackHalf2x16(packHalf2x16(", to_expression(arg), ".xy))"); + auto op1 = join("unpackHalf2x16(packHalf2x16(", to_expression(arg), ".zz)).x"); + op = join("vec3(", op0, ", ", op1, ")"); + break; + } + case 4: + { + auto op0 = join("unpackHalf2x16(packHalf2x16(", to_expression(arg), ".xy))"); + auto op1 = join("unpackHalf2x16(packHalf2x16(", to_expression(arg), ".zw))"); + op = join("vec4(", op0, ", ", op1, ")"); + break; + } + default: + SPIRV_CROSS_THROW("Illegal argument to OpQuantizeToF16."); + } + + emit_op(result_type, id, op, should_forward(arg)); + inherit_expression_dependencies(id, arg); + break; + } + + // Derivatives + case OpDPdx: + GLSL_UFOP(dFdx); + if (is_legacy_es()) + require_extension_internal("GL_OES_standard_derivatives"); + register_control_dependent_expression(ops[1]); + break; + + case OpDPdy: + GLSL_UFOP(dFdy); + if (is_legacy_es()) + require_extension_internal("GL_OES_standard_derivatives"); + register_control_dependent_expression(ops[1]); + break; + + case OpDPdxFine: + GLSL_UFOP(dFdxFine); + if (options.es) + { + SPIRV_CROSS_THROW("GL_ARB_derivative_control is unavailable in OpenGL ES."); + } + if (options.version < 450) + require_extension_internal("GL_ARB_derivative_control"); + register_control_dependent_expression(ops[1]); + break; + + case OpDPdyFine: + GLSL_UFOP(dFdyFine); + if (options.es) + { + SPIRV_CROSS_THROW("GL_ARB_derivative_control is unavailable in OpenGL ES."); + } + if (options.version < 450) + require_extension_internal("GL_ARB_derivative_control"); + register_control_dependent_expression(ops[1]); + break; + + case OpDPdxCoarse: + if (options.es) + { + SPIRV_CROSS_THROW("GL_ARB_derivative_control is unavailable in OpenGL ES."); + } + GLSL_UFOP(dFdxCoarse); + if (options.version < 450) + require_extension_internal("GL_ARB_derivative_control"); + register_control_dependent_expression(ops[1]); + break; + + case OpDPdyCoarse: + GLSL_UFOP(dFdyCoarse); + if (options.es) + { + SPIRV_CROSS_THROW("GL_ARB_derivative_control is unavailable in OpenGL ES."); + } + if (options.version < 450) + require_extension_internal("GL_ARB_derivative_control"); + register_control_dependent_expression(ops[1]); + break; + + case OpFwidth: + GLSL_UFOP(fwidth); + if (is_legacy_es()) + require_extension_internal("GL_OES_standard_derivatives"); + register_control_dependent_expression(ops[1]); + break; + + case OpFwidthCoarse: + GLSL_UFOP(fwidthCoarse); + if (options.es) + { + SPIRV_CROSS_THROW("GL_ARB_derivative_control is unavailable in OpenGL ES."); + } + if (options.version < 450) + require_extension_internal("GL_ARB_derivative_control"); + register_control_dependent_expression(ops[1]); + break; + + case OpFwidthFine: + GLSL_UFOP(fwidthFine); + if (options.es) + { + SPIRV_CROSS_THROW("GL_ARB_derivative_control is unavailable in OpenGL ES."); + } + if (options.version < 450) + require_extension_internal("GL_ARB_derivative_control"); + register_control_dependent_expression(ops[1]); + break; + + // Bitfield + case OpBitFieldInsert: + { + emit_bitfield_insert_op(ops[0], ops[1], ops[2], ops[3], ops[4], ops[5], "bitfieldInsert", SPIRType::Int); + break; + } + + case OpBitFieldSExtract: + { + emit_trinary_func_op_bitextract(ops[0], ops[1], ops[2], ops[3], ops[4], "bitfieldExtract", int_type, int_type, + SPIRType::Int, SPIRType::Int); + break; + } + + case OpBitFieldUExtract: + { + emit_trinary_func_op_bitextract(ops[0], ops[1], ops[2], ops[3], ops[4], "bitfieldExtract", uint_type, uint_type, + SPIRType::Int, SPIRType::Int); + break; + } + + case OpBitReverse: + // BitReverse does not have issues with sign since result type must match input type. + GLSL_UFOP(bitfieldReverse); + break; + + case OpBitCount: + { + auto basetype = expression_type(ops[2]).basetype; + emit_unary_func_op_cast(ops[0], ops[1], ops[2], "bitCount", basetype, int_type); + break; + } + + // Atomics + case OpAtomicExchange: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t ptr = ops[2]; + // Ignore semantics for now, probably only relevant to CL. + uint32_t val = ops[5]; + const char *op = check_atomic_image(ptr) ? "imageAtomicExchange" : "atomicExchange"; + + emit_atomic_func_op(result_type, id, ptr, val, op); + break; + } + + case OpAtomicCompareExchange: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t ptr = ops[2]; + uint32_t val = ops[6]; + uint32_t comp = ops[7]; + const char *op = check_atomic_image(ptr) ? "imageAtomicCompSwap" : "atomicCompSwap"; + + emit_atomic_func_op(result_type, id, ptr, comp, val, op); + break; + } + + case OpAtomicLoad: + { + // In plain GLSL, we have no atomic loads, so emulate this by fetch adding by 0 and hope compiler figures it out. + // Alternatively, we could rely on KHR_memory_model, but that's not very helpful for GL. + auto &type = expression_type(ops[2]); + forced_temporaries.insert(ops[1]); + bool atomic_image = check_atomic_image(ops[2]); + bool unsigned_type = (type.basetype == SPIRType::UInt) || + (atomic_image && get(type.image.type).basetype == SPIRType::UInt); + const char *op = atomic_image ? "imageAtomicAdd" : "atomicAdd"; + const char *increment = unsigned_type ? "0u" : "0"; + emit_op(ops[0], ops[1], + join(op, "(", + to_atomic_ptr_expression(ops[2]), ", ", increment, ")"), false); + flush_all_atomic_capable_variables(); + + if (type.basetype == SPIRType::UInt64 || type.basetype == SPIRType::Int64) + require_extension_internal("GL_EXT_shader_atomic_int64"); + break; + } + + case OpAtomicStore: + { + // In plain GLSL, we have no atomic stores, so emulate this with an atomic exchange where we don't consume the result. + // Alternatively, we could rely on KHR_memory_model, but that's not very helpful for GL. + uint32_t ptr = ops[0]; + // Ignore semantics for now, probably only relevant to CL. + uint32_t val = ops[3]; + const char *op = check_atomic_image(ptr) ? "imageAtomicExchange" : "atomicExchange"; + statement(op, "(", to_atomic_ptr_expression(ptr), ", ", to_expression(val), ");"); + flush_all_atomic_capable_variables(); + + auto &type = expression_type(ptr); + if (type.basetype == SPIRType::UInt64 || type.basetype == SPIRType::Int64) + require_extension_internal("GL_EXT_shader_atomic_int64"); + break; + } + + case OpAtomicIIncrement: + case OpAtomicIDecrement: + { + forced_temporaries.insert(ops[1]); + auto &type = expression_type(ops[2]); + if (type.storage == StorageClassAtomicCounter) + { + // Legacy GLSL stuff, not sure if this is relevant to support. + if (opcode == OpAtomicIIncrement) + GLSL_UFOP(atomicCounterIncrement); + else + GLSL_UFOP(atomicCounterDecrement); + } + else + { + bool atomic_image = check_atomic_image(ops[2]); + bool unsigned_type = (type.basetype == SPIRType::UInt) || + (atomic_image && get(type.image.type).basetype == SPIRType::UInt); + const char *op = atomic_image ? "imageAtomicAdd" : "atomicAdd"; + + const char *increment = nullptr; + if (opcode == OpAtomicIIncrement && unsigned_type) + increment = "1u"; + else if (opcode == OpAtomicIIncrement) + increment = "1"; + else if (unsigned_type) + increment = "uint(-1)"; + else + increment = "-1"; + + emit_op(ops[0], ops[1], + join(op, "(", to_atomic_ptr_expression(ops[2]), ", ", increment, ")"), false); + + if (type.basetype == SPIRType::UInt64 || type.basetype == SPIRType::Int64) + require_extension_internal("GL_EXT_shader_atomic_int64"); + } + + flush_all_atomic_capable_variables(); + break; + } + + case OpAtomicIAdd: + case OpAtomicFAddEXT: + { + const char *op = check_atomic_image(ops[2]) ? "imageAtomicAdd" : "atomicAdd"; + emit_atomic_func_op(ops[0], ops[1], ops[2], ops[5], op); + break; + } + + case OpAtomicISub: + { + const char *op = check_atomic_image(ops[2]) ? "imageAtomicAdd" : "atomicAdd"; + forced_temporaries.insert(ops[1]); + auto expr = join(op, "(", to_atomic_ptr_expression(ops[2]), ", -", to_enclosed_expression(ops[5]), ")"); + emit_op(ops[0], ops[1], expr, should_forward(ops[2]) && should_forward(ops[5])); + flush_all_atomic_capable_variables(); + + auto &type = get(ops[0]); + if (type.basetype == SPIRType::UInt64 || type.basetype == SPIRType::Int64) + require_extension_internal("GL_EXT_shader_atomic_int64"); + break; + } + + case OpAtomicSMin: + case OpAtomicUMin: + { + const char *op = check_atomic_image(ops[2]) ? "imageAtomicMin" : "atomicMin"; + emit_atomic_func_op(ops[0], ops[1], ops[2], ops[5], op); + break; + } + + case OpAtomicSMax: + case OpAtomicUMax: + { + const char *op = check_atomic_image(ops[2]) ? "imageAtomicMax" : "atomicMax"; + emit_atomic_func_op(ops[0], ops[1], ops[2], ops[5], op); + break; + } + + case OpAtomicAnd: + { + const char *op = check_atomic_image(ops[2]) ? "imageAtomicAnd" : "atomicAnd"; + emit_atomic_func_op(ops[0], ops[1], ops[2], ops[5], op); + break; + } + + case OpAtomicOr: + { + const char *op = check_atomic_image(ops[2]) ? "imageAtomicOr" : "atomicOr"; + emit_atomic_func_op(ops[0], ops[1], ops[2], ops[5], op); + break; + } + + case OpAtomicXor: + { + const char *op = check_atomic_image(ops[2]) ? "imageAtomicXor" : "atomicXor"; + emit_atomic_func_op(ops[0], ops[1], ops[2], ops[5], op); + break; + } + + // Geometry shaders + case OpEmitVertex: + statement("EmitVertex();"); + break; + + case OpEndPrimitive: + statement("EndPrimitive();"); + break; + + case OpEmitStreamVertex: + { + if (options.es) + SPIRV_CROSS_THROW("Multi-stream geometry shaders not supported in ES."); + else if (!options.es && options.version < 400) + SPIRV_CROSS_THROW("Multi-stream geometry shaders only supported in GLSL 400."); + + auto stream_expr = to_expression(ops[0]); + if (expression_type(ops[0]).basetype != SPIRType::Int) + stream_expr = join("int(", stream_expr, ")"); + statement("EmitStreamVertex(", stream_expr, ");"); + break; + } + + case OpEndStreamPrimitive: + { + if (options.es) + SPIRV_CROSS_THROW("Multi-stream geometry shaders not supported in ES."); + else if (!options.es && options.version < 400) + SPIRV_CROSS_THROW("Multi-stream geometry shaders only supported in GLSL 400."); + + auto stream_expr = to_expression(ops[0]); + if (expression_type(ops[0]).basetype != SPIRType::Int) + stream_expr = join("int(", stream_expr, ")"); + statement("EndStreamPrimitive(", stream_expr, ");"); + break; + } + + // Textures + case OpImageSampleExplicitLod: + case OpImageSampleProjExplicitLod: + case OpImageSampleDrefExplicitLod: + case OpImageSampleProjDrefExplicitLod: + case OpImageSampleImplicitLod: + case OpImageSampleProjImplicitLod: + case OpImageSampleDrefImplicitLod: + case OpImageSampleProjDrefImplicitLod: + case OpImageFetch: + case OpImageGather: + case OpImageDrefGather: + // Gets a bit hairy, so move this to a separate instruction. + emit_texture_op(instruction, false); + break; + + case OpImageSparseSampleExplicitLod: + case OpImageSparseSampleProjExplicitLod: + case OpImageSparseSampleDrefExplicitLod: + case OpImageSparseSampleProjDrefExplicitLod: + case OpImageSparseSampleImplicitLod: + case OpImageSparseSampleProjImplicitLod: + case OpImageSparseSampleDrefImplicitLod: + case OpImageSparseSampleProjDrefImplicitLod: + case OpImageSparseFetch: + case OpImageSparseGather: + case OpImageSparseDrefGather: + // Gets a bit hairy, so move this to a separate instruction. + emit_texture_op(instruction, true); + break; + + case OpImageSparseTexelsResident: + if (options.es) + SPIRV_CROSS_THROW("Sparse feedback is not supported in GLSL."); + require_extension_internal("GL_ARB_sparse_texture2"); + emit_unary_func_op_cast(ops[0], ops[1], ops[2], "sparseTexelsResidentARB", int_type, SPIRType::Boolean); + break; + + case OpImage: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + // Suppress usage tracking. + auto &e = emit_op(result_type, id, to_expression(ops[2]), true, true); + + // When using the image, we need to know which variable it is actually loaded from. + auto *var = maybe_get_backing_variable(ops[2]); + e.loaded_from = var ? var->self : ID(0); + break; + } + + case OpImageQueryLod: + { + const char *op = nullptr; + if (!options.es && options.version < 400) + { + require_extension_internal("GL_ARB_texture_query_lod"); + // For some reason, the ARB spec is all-caps. + op = "textureQueryLOD"; + } + else if (options.es) + { + if (options.version < 300) + SPIRV_CROSS_THROW("textureQueryLod not supported in legacy ES"); + require_extension_internal("GL_EXT_texture_query_lod"); + op = "textureQueryLOD"; + } + else + op = "textureQueryLod"; + + auto sampler_expr = to_expression(ops[2]); + if (has_decoration(ops[2], DecorationNonUniform)) + { + if (maybe_get_backing_variable(ops[2])) + convert_non_uniform_expression(sampler_expr, ops[2]); + else if (*backend.nonuniform_qualifier != '\0') + sampler_expr = join(backend.nonuniform_qualifier, "(", sampler_expr, ")"); + } + + bool forward = should_forward(ops[3]); + emit_op(ops[0], ops[1], + join(op, "(", sampler_expr, ", ", to_unpacked_expression(ops[3]), ")"), + forward); + inherit_expression_dependencies(ops[1], ops[2]); + inherit_expression_dependencies(ops[1], ops[3]); + register_control_dependent_expression(ops[1]); + break; + } + + case OpImageQueryLevels: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + if (!options.es && options.version < 430) + require_extension_internal("GL_ARB_texture_query_levels"); + if (options.es) + SPIRV_CROSS_THROW("textureQueryLevels not supported in ES profile."); + + auto expr = join("textureQueryLevels(", convert_separate_image_to_expression(ops[2]), ")"); + auto &restype = get(ops[0]); + expr = bitcast_expression(restype, SPIRType::Int, expr); + emit_op(result_type, id, expr, true); + break; + } + + case OpImageQuerySamples: + { + auto &type = expression_type(ops[2]); + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + if (options.es) + SPIRV_CROSS_THROW("textureSamples and imageSamples not supported in ES profile."); + else if (options.version < 450) + require_extension_internal("GL_ARB_texture_query_samples"); + + string expr; + if (type.image.sampled == 2) + expr = join("imageSamples(", to_non_uniform_aware_expression(ops[2]), ")"); + else + expr = join("textureSamples(", convert_separate_image_to_expression(ops[2]), ")"); + + auto &restype = get(ops[0]); + expr = bitcast_expression(restype, SPIRType::Int, expr); + emit_op(result_type, id, expr, true); + break; + } + + case OpSampledImage: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + emit_sampled_image_op(result_type, id, ops[2], ops[3]); + inherit_expression_dependencies(id, ops[2]); + inherit_expression_dependencies(id, ops[3]); + break; + } + + case OpImageQuerySizeLod: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t img = ops[2]; + auto &type = expression_type(img); + auto &imgtype = get(type.self); + + std::string fname = "textureSize"; + if (is_legacy_desktop()) + { + fname = legacy_tex_op(fname, imgtype, img); + } + else if (is_legacy_es()) + SPIRV_CROSS_THROW("textureSize is not supported in ESSL 100."); + + auto expr = join(fname, "(", convert_separate_image_to_expression(img), ", ", + bitcast_expression(SPIRType::Int, ops[3]), ")"); + + // ES needs to emulate 1D images as 2D. + if (type.image.dim == Dim1D && options.es) + expr = join(expr, ".x"); + + auto &restype = get(ops[0]); + expr = bitcast_expression(restype, SPIRType::Int, expr); + emit_op(result_type, id, expr, true); + break; + } + + // Image load/store + case OpImageRead: + case OpImageSparseRead: + { + // We added Nonreadable speculatively to the OpImage variable due to glslangValidator + // not adding the proper qualifiers. + // If it turns out we need to read the image after all, remove the qualifier and recompile. + auto *var = maybe_get_backing_variable(ops[2]); + if (var) + { + auto &flags = get_decoration_bitset(var->self); + if (flags.get(DecorationNonReadable)) + { + unset_decoration(var->self, DecorationNonReadable); + force_recompile(); + } + } + + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + bool pure; + string imgexpr; + auto &type = expression_type(ops[2]); + + if (var && var->remapped_variable) // Remapped input, just read as-is without any op-code + { + if (type.image.ms) + SPIRV_CROSS_THROW("Trying to remap multisampled image to variable, this is not possible."); + + auto itr = + find_if(begin(pls_inputs), end(pls_inputs), [var](const PlsRemap &pls) { return pls.id == var->self; }); + + if (itr == end(pls_inputs)) + { + // For non-PLS inputs, we rely on subpass type remapping information to get it right + // since ImageRead always returns 4-component vectors and the backing type is opaque. + if (!var->remapped_components) + SPIRV_CROSS_THROW("subpassInput was remapped, but remap_components is not set correctly."); + imgexpr = remap_swizzle(get(result_type), var->remapped_components, to_expression(ops[2])); + } + else + { + // PLS input could have different number of components than what the SPIR expects, swizzle to + // the appropriate vector size. + uint32_t components = pls_format_to_components(itr->format); + imgexpr = remap_swizzle(get(result_type), components, to_expression(ops[2])); + } + pure = true; + } + else if (type.image.dim == DimSubpassData) + { + if (var && subpass_input_is_framebuffer_fetch(var->self)) + { + imgexpr = to_expression(var->self); + } + else if (options.vulkan_semantics) + { + // With Vulkan semantics, use the proper Vulkan GLSL construct. + if (type.image.ms) + { + uint32_t operands = ops[4]; + if (operands != ImageOperandsSampleMask || length != 6) + SPIRV_CROSS_THROW("Multisampled image used in OpImageRead, but unexpected " + "operand mask was used."); + + uint32_t samples = ops[5]; + imgexpr = join("subpassLoad(", to_non_uniform_aware_expression(ops[2]), ", ", to_expression(samples), ")"); + } + else + imgexpr = join("subpassLoad(", to_non_uniform_aware_expression(ops[2]), ")"); + } + else + { + if (type.image.ms) + { + uint32_t operands = ops[4]; + if (operands != ImageOperandsSampleMask || length != 6) + SPIRV_CROSS_THROW("Multisampled image used in OpImageRead, but unexpected " + "operand mask was used."); + + uint32_t samples = ops[5]; + imgexpr = join("texelFetch(", to_non_uniform_aware_expression(ops[2]), ", ivec2(gl_FragCoord.xy), ", + to_expression(samples), ")"); + } + else + { + // Implement subpass loads via texture barrier style sampling. + imgexpr = join("texelFetch(", to_non_uniform_aware_expression(ops[2]), ", ivec2(gl_FragCoord.xy), 0)"); + } + } + imgexpr = remap_swizzle(get(result_type), 4, imgexpr); + pure = true; + } + else + { + bool sparse = opcode == OpImageSparseRead; + uint32_t sparse_code_id = 0; + uint32_t sparse_texel_id = 0; + if (sparse) + emit_sparse_feedback_temporaries(ops[0], ops[1], sparse_code_id, sparse_texel_id); + + // imageLoad only accepts int coords, not uint. + auto coord_expr = to_expression(ops[3]); + auto target_coord_type = expression_type(ops[3]); + target_coord_type.basetype = SPIRType::Int; + coord_expr = bitcast_expression(target_coord_type, expression_type(ops[3]).basetype, coord_expr); + + // ES needs to emulate 1D images as 2D. + if (type.image.dim == Dim1D && options.es) + coord_expr = join("ivec2(", coord_expr, ", 0)"); + + // Plain image load/store. + if (sparse) + { + if (type.image.ms) + { + uint32_t operands = ops[4]; + if (operands != ImageOperandsSampleMask || length != 6) + SPIRV_CROSS_THROW("Multisampled image used in OpImageRead, but unexpected " + "operand mask was used."); + + uint32_t samples = ops[5]; + statement(to_expression(sparse_code_id), " = sparseImageLoadARB(", to_non_uniform_aware_expression(ops[2]), ", ", + coord_expr, ", ", to_expression(samples), ", ", to_expression(sparse_texel_id), ");"); + } + else + { + statement(to_expression(sparse_code_id), " = sparseImageLoadARB(", to_non_uniform_aware_expression(ops[2]), ", ", + coord_expr, ", ", to_expression(sparse_texel_id), ");"); + } + imgexpr = join(type_to_glsl(get(result_type)), "(", to_expression(sparse_code_id), ", ", + to_expression(sparse_texel_id), ")"); + } + else + { + if (type.image.ms) + { + uint32_t operands = ops[4]; + if (operands != ImageOperandsSampleMask || length != 6) + SPIRV_CROSS_THROW("Multisampled image used in OpImageRead, but unexpected " + "operand mask was used."); + + uint32_t samples = ops[5]; + imgexpr = + join("imageLoad(", to_non_uniform_aware_expression(ops[2]), ", ", coord_expr, ", ", to_expression(samples), ")"); + } + else + imgexpr = join("imageLoad(", to_non_uniform_aware_expression(ops[2]), ", ", coord_expr, ")"); + } + + if (!sparse) + imgexpr = remap_swizzle(get(result_type), 4, imgexpr); + pure = false; + } + + if (var) + { + bool forward = forced_temporaries.find(id) == end(forced_temporaries); + auto &e = emit_op(result_type, id, imgexpr, forward); + + // We only need to track dependencies if we're reading from image load/store. + if (!pure) + { + e.loaded_from = var->self; + if (forward) + var->dependees.push_back(id); + } + } + else + emit_op(result_type, id, imgexpr, false); + + inherit_expression_dependencies(id, ops[2]); + if (type.image.ms) + inherit_expression_dependencies(id, ops[5]); + break; + } + + case OpImageTexelPointer: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + auto coord_expr = to_expression(ops[3]); + auto target_coord_type = expression_type(ops[3]); + target_coord_type.basetype = SPIRType::Int; + coord_expr = bitcast_expression(target_coord_type, expression_type(ops[3]).basetype, coord_expr); + + auto expr = join(to_expression(ops[2]), ", ", coord_expr); + auto &e = set(id, expr, result_type, true); + + // When using the pointer, we need to know which variable it is actually loaded from. + auto *var = maybe_get_backing_variable(ops[2]); + e.loaded_from = var ? var->self : ID(0); + inherit_expression_dependencies(id, ops[3]); + break; + } + + case OpImageWrite: + { + // We added Nonwritable speculatively to the OpImage variable due to glslangValidator + // not adding the proper qualifiers. + // If it turns out we need to write to the image after all, remove the qualifier and recompile. + auto *var = maybe_get_backing_variable(ops[0]); + if (var) + { + if (has_decoration(var->self, DecorationNonWritable)) + { + unset_decoration(var->self, DecorationNonWritable); + force_recompile(); + } + } + + auto &type = expression_type(ops[0]); + auto &value_type = expression_type(ops[2]); + auto store_type = value_type; + store_type.vecsize = 4; + + // imageStore only accepts int coords, not uint. + auto coord_expr = to_expression(ops[1]); + auto target_coord_type = expression_type(ops[1]); + target_coord_type.basetype = SPIRType::Int; + coord_expr = bitcast_expression(target_coord_type, expression_type(ops[1]).basetype, coord_expr); + + // ES needs to emulate 1D images as 2D. + if (type.image.dim == Dim1D && options.es) + coord_expr = join("ivec2(", coord_expr, ", 0)"); + + if (type.image.ms) + { + uint32_t operands = ops[3]; + if (operands != ImageOperandsSampleMask || length != 5) + SPIRV_CROSS_THROW("Multisampled image used in OpImageWrite, but unexpected operand mask was used."); + uint32_t samples = ops[4]; + statement("imageStore(", to_non_uniform_aware_expression(ops[0]), ", ", coord_expr, ", ", to_expression(samples), ", ", + remap_swizzle(store_type, value_type.vecsize, to_expression(ops[2])), ");"); + } + else + statement("imageStore(", to_non_uniform_aware_expression(ops[0]), ", ", coord_expr, ", ", + remap_swizzle(store_type, value_type.vecsize, to_expression(ops[2])), ");"); + + if (var && variable_storage_is_aliased(*var)) + flush_all_aliased_variables(); + break; + } + + case OpImageQuerySize: + { + auto &type = expression_type(ops[2]); + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + if (type.basetype == SPIRType::Image) + { + string expr; + if (type.image.sampled == 2) + { + if (!options.es && options.version < 430) + require_extension_internal("GL_ARB_shader_image_size"); + else if (options.es && options.version < 310) + SPIRV_CROSS_THROW("At least ESSL 3.10 required for imageSize."); + + // The size of an image is always constant. + expr = join("imageSize(", to_non_uniform_aware_expression(ops[2]), ")"); + } + else + { + // This path is hit for samplerBuffers and multisampled images which do not have LOD. + std::string fname = "textureSize"; + if (is_legacy()) + { + auto &imgtype = get(type.self); + fname = legacy_tex_op(fname, imgtype, ops[2]); + } + expr = join(fname, "(", convert_separate_image_to_expression(ops[2]), ")"); + } + + auto &restype = get(ops[0]); + expr = bitcast_expression(restype, SPIRType::Int, expr); + emit_op(result_type, id, expr, true); + } + else + SPIRV_CROSS_THROW("Invalid type for OpImageQuerySize."); + break; + } + + case OpImageSampleWeightedQCOM: + case OpImageBoxFilterQCOM: + case OpImageBlockMatchSSDQCOM: + case OpImageBlockMatchSADQCOM: + { + require_extension_internal("GL_QCOM_image_processing"); + uint32_t result_type_id = ops[0]; + uint32_t id = ops[1]; + string expr; + switch (opcode) + { + case OpImageSampleWeightedQCOM: + expr = "textureWeightedQCOM"; + break; + case OpImageBoxFilterQCOM: + expr = "textureBoxFilterQCOM"; + break; + case OpImageBlockMatchSSDQCOM: + expr = "textureBlockMatchSSDQCOM"; + break; + case OpImageBlockMatchSADQCOM: + expr = "textureBlockMatchSADQCOM"; + break; + default: + SPIRV_CROSS_THROW("Invalid opcode for QCOM_image_processing."); + } + expr += "("; + + bool forward = false; + expr += to_expression(ops[2]); + expr += ", " + to_expression(ops[3]); + + switch (opcode) + { + case OpImageSampleWeightedQCOM: + expr += ", " + to_non_uniform_aware_expression(ops[4]); + break; + case OpImageBoxFilterQCOM: + expr += ", " + to_expression(ops[4]); + break; + case OpImageBlockMatchSSDQCOM: + case OpImageBlockMatchSADQCOM: + expr += ", " + to_non_uniform_aware_expression(ops[4]); + expr += ", " + to_expression(ops[5]); + expr += ", " + to_expression(ops[6]); + break; + default: + SPIRV_CROSS_THROW("Invalid opcode for QCOM_image_processing."); + } + + expr += ")"; + emit_op(result_type_id, id, expr, forward); + + inherit_expression_dependencies(id, ops[3]); + if (opcode == OpImageBlockMatchSSDQCOM || opcode == OpImageBlockMatchSADQCOM) + inherit_expression_dependencies(id, ops[5]); + + break; + } + + case OpImageBlockMatchWindowSSDQCOM: + case OpImageBlockMatchWindowSADQCOM: + case OpImageBlockMatchGatherSSDQCOM: + case OpImageBlockMatchGatherSADQCOM: + { + require_extension_internal("GL_QCOM_image_processing2"); + uint32_t result_type_id = ops[0]; + uint32_t id = ops[1]; + string expr; + switch (opcode) + { + case OpImageBlockMatchWindowSSDQCOM: + expr = "textureBlockMatchWindowSSDQCOM"; + break; + case OpImageBlockMatchWindowSADQCOM: + expr = "textureBlockMatchWindowSADQCOM"; + break; + case OpImageBlockMatchGatherSSDQCOM: + expr = "textureBlockMatchGatherSSDQCOM"; + break; + case OpImageBlockMatchGatherSADQCOM: + expr = "textureBlockMatchGatherSADQCOM"; + break; + default: + SPIRV_CROSS_THROW("Invalid opcode for QCOM_image_processing2."); + } + expr += "("; + + bool forward = false; + expr += to_expression(ops[2]); + expr += ", " + to_expression(ops[3]); + + expr += ", " + to_non_uniform_aware_expression(ops[4]); + expr += ", " + to_expression(ops[5]); + expr += ", " + to_expression(ops[6]); + + expr += ")"; + emit_op(result_type_id, id, expr, forward); + + inherit_expression_dependencies(id, ops[3]); + inherit_expression_dependencies(id, ops[5]); + break; + } + + // Compute + case OpControlBarrier: + case OpMemoryBarrier: + { + uint32_t execution_scope = 0; + uint32_t memory; + uint32_t semantics; + + if (opcode == OpMemoryBarrier) + { + memory = evaluate_constant_u32(ops[0]); + semantics = evaluate_constant_u32(ops[1]); + } + else + { + execution_scope = evaluate_constant_u32(ops[0]); + memory = evaluate_constant_u32(ops[1]); + semantics = evaluate_constant_u32(ops[2]); + } + + if (execution_scope == ScopeSubgroup || memory == ScopeSubgroup) + { + // OpControlBarrier with ScopeSubgroup is subgroupBarrier() + if (opcode != OpControlBarrier) + { + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupMemBarrier); + } + else + { + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupBarrier); + } + } + + if (execution_scope != ScopeSubgroup && get_entry_point().model == ExecutionModelTessellationControl) + { + // Control shaders only have barriers, and it implies memory barriers. + if (opcode == OpControlBarrier) + statement("barrier();"); + break; + } + + // We only care about these flags, acquire/release and friends are not relevant to GLSL. + semantics = mask_relevant_memory_semantics(semantics); + + if (opcode == OpMemoryBarrier) + { + // If we are a memory barrier, and the next instruction is a control barrier, check if that memory barrier + // does what we need, so we avoid redundant barriers. + const Instruction *next = get_next_instruction_in_block(instruction); + if (next && next->op == OpControlBarrier) + { + auto *next_ops = stream(*next); + uint32_t next_memory = evaluate_constant_u32(next_ops[1]); + uint32_t next_semantics = evaluate_constant_u32(next_ops[2]); + next_semantics = mask_relevant_memory_semantics(next_semantics); + + bool memory_scope_covered = false; + if (next_memory == memory) + memory_scope_covered = true; + else if (next_semantics == MemorySemanticsWorkgroupMemoryMask) + { + // If we only care about workgroup memory, either Device or Workgroup scope is fine, + // scope does not have to match. + if ((next_memory == ScopeDevice || next_memory == ScopeWorkgroup) && + (memory == ScopeDevice || memory == ScopeWorkgroup)) + { + memory_scope_covered = true; + } + } + else if (memory == ScopeWorkgroup && next_memory == ScopeDevice) + { + // The control barrier has device scope, but the memory barrier just has workgroup scope. + memory_scope_covered = true; + } + + // If we have the same memory scope, and all memory types are covered, we're good. + if (memory_scope_covered && (semantics & next_semantics) == semantics) + break; + } + } + + // We are synchronizing some memory or syncing execution, + // so we cannot forward any loads beyond the memory barrier. + if (semantics || opcode == OpControlBarrier) + { + assert(current_emitting_block); + flush_control_dependent_expressions(current_emitting_block->self); + flush_all_active_variables(); + } + + if (memory == ScopeWorkgroup) // Only need to consider memory within a group + { + if (semantics == MemorySemanticsWorkgroupMemoryMask) + { + // OpControlBarrier implies a memory barrier for shared memory as well. + bool implies_shared_barrier = opcode == OpControlBarrier && execution_scope == ScopeWorkgroup; + if (!implies_shared_barrier) + statement("memoryBarrierShared();"); + } + else if (semantics != 0) + statement("groupMemoryBarrier();"); + } + else if (memory == ScopeSubgroup) + { + const uint32_t all_barriers = + MemorySemanticsWorkgroupMemoryMask | MemorySemanticsUniformMemoryMask | MemorySemanticsImageMemoryMask; + + if (semantics & (MemorySemanticsCrossWorkgroupMemoryMask | MemorySemanticsSubgroupMemoryMask)) + { + // These are not relevant for GLSL, but assume it means memoryBarrier(). + // memoryBarrier() does everything, so no need to test anything else. + statement("subgroupMemoryBarrier();"); + } + else if ((semantics & all_barriers) == all_barriers) + { + // Short-hand instead of emitting 3 barriers. + statement("subgroupMemoryBarrier();"); + } + else + { + // Pick out individual barriers. + if (semantics & MemorySemanticsWorkgroupMemoryMask) + statement("subgroupMemoryBarrierShared();"); + if (semantics & MemorySemanticsUniformMemoryMask) + statement("subgroupMemoryBarrierBuffer();"); + if (semantics & MemorySemanticsImageMemoryMask) + statement("subgroupMemoryBarrierImage();"); + } + } + else + { + const uint32_t all_barriers = + MemorySemanticsWorkgroupMemoryMask | MemorySemanticsUniformMemoryMask | MemorySemanticsImageMemoryMask; + + if (semantics & (MemorySemanticsCrossWorkgroupMemoryMask | MemorySemanticsSubgroupMemoryMask)) + { + // These are not relevant for GLSL, but assume it means memoryBarrier(). + // memoryBarrier() does everything, so no need to test anything else. + statement("memoryBarrier();"); + } + else if ((semantics & all_barriers) == all_barriers) + { + // Short-hand instead of emitting 4 barriers. + statement("memoryBarrier();"); + } + else + { + // Pick out individual barriers. + if (semantics & MemorySemanticsWorkgroupMemoryMask) + statement("memoryBarrierShared();"); + if (semantics & MemorySemanticsUniformMemoryMask) + statement("memoryBarrierBuffer();"); + if (semantics & MemorySemanticsImageMemoryMask) + statement("memoryBarrierImage();"); + } + } + + if (opcode == OpControlBarrier) + { + if (execution_scope == ScopeSubgroup) + statement("subgroupBarrier();"); + else + statement("barrier();"); + } + break; + } + + case OpExtInstWithForwardRefsKHR: + { + uint32_t extension_set = ops[2]; + auto ext = get(extension_set).ext; + if (ext != SPIRExtension::SPV_debug_info && + ext != SPIRExtension::NonSemanticShaderDebugInfo && + ext != SPIRExtension::NonSemanticGeneric) + { + SPIRV_CROSS_THROW("Unexpected use of ExtInstWithForwardRefsKHR."); + } + + break; + } + + case OpExtInst: + { + uint32_t extension_set = ops[2]; + auto ext = get(extension_set).ext; + + if (ext == SPIRExtension::GLSL) + { + emit_glsl_op(ops[0], ops[1], ops[3], &ops[4], length - 4); + } + else if (ext == SPIRExtension::SPV_AMD_shader_ballot) + { + emit_spv_amd_shader_ballot_op(ops[0], ops[1], ops[3], &ops[4], length - 4); + } + else if (ext == SPIRExtension::SPV_AMD_shader_explicit_vertex_parameter) + { + emit_spv_amd_shader_explicit_vertex_parameter_op(ops[0], ops[1], ops[3], &ops[4], length - 4); + } + else if (ext == SPIRExtension::SPV_AMD_shader_trinary_minmax) + { + emit_spv_amd_shader_trinary_minmax_op(ops[0], ops[1], ops[3], &ops[4], length - 4); + } + else if (ext == SPIRExtension::SPV_AMD_gcn_shader) + { + emit_spv_amd_gcn_shader_op(ops[0], ops[1], ops[3], &ops[4], length - 4); + } + else if (ext == SPIRExtension::NonSemanticShaderDebugInfo) + { + emit_non_semantic_shader_debug_info(ops[0], ops[1], ops[3], &ops[4], length - 4); + } + else if (ext == SPIRExtension::SPV_debug_info || + ext == SPIRExtension::NonSemanticGeneric) + { + break; // Ignore SPIR-V debug information extended instructions. + } + else if (ext == SPIRExtension::NonSemanticDebugPrintf) + { + // Operation 1 is printf. + if (ops[3] == 1) + { + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Debug printf is only supported in Vulkan GLSL.\n"); + require_extension_internal("GL_EXT_debug_printf"); + auto &format_string = get(ops[4]).str; + string expr = join(backend.printf_function, "(\"", format_string, "\""); + for (uint32_t i = 5; i < length; i++) + { + expr += ", "; + expr += to_expression(ops[i]); + } + statement(expr, ");"); + } + } + else + { + statement("// unimplemented ext op ", instruction.op); + break; + } + + break; + } + + // Legacy sub-group stuff ... + case OpSubgroupBallotKHR: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + string expr; + expr = join("uvec4(unpackUint2x32(ballotARB(" + to_expression(ops[2]) + ")), 0u, 0u)"); + emit_op(result_type, id, expr, should_forward(ops[2])); + + require_extension_internal("GL_ARB_shader_ballot"); + inherit_expression_dependencies(id, ops[2]); + register_control_dependent_expression(ops[1]); + break; + } + + case OpSubgroupFirstInvocationKHR: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + emit_unary_func_op(result_type, id, ops[2], "readFirstInvocationARB"); + + require_extension_internal("GL_ARB_shader_ballot"); + register_control_dependent_expression(ops[1]); + break; + } + + case OpSubgroupReadInvocationKHR: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + emit_binary_func_op(result_type, id, ops[2], ops[3], "readInvocationARB"); + + require_extension_internal("GL_ARB_shader_ballot"); + register_control_dependent_expression(ops[1]); + break; + } + + case OpSubgroupAllKHR: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + emit_unary_func_op(result_type, id, ops[2], "allInvocationsARB"); + + require_extension_internal("GL_ARB_shader_group_vote"); + register_control_dependent_expression(ops[1]); + break; + } + + case OpSubgroupAnyKHR: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + emit_unary_func_op(result_type, id, ops[2], "anyInvocationARB"); + + require_extension_internal("GL_ARB_shader_group_vote"); + register_control_dependent_expression(ops[1]); + break; + } + + case OpSubgroupAllEqualKHR: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + emit_unary_func_op(result_type, id, ops[2], "allInvocationsEqualARB"); + + require_extension_internal("GL_ARB_shader_group_vote"); + register_control_dependent_expression(ops[1]); + break; + } + + case OpGroupIAddNonUniformAMD: + case OpGroupFAddNonUniformAMD: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + emit_unary_func_op(result_type, id, ops[4], "addInvocationsNonUniformAMD"); + + require_extension_internal("GL_AMD_shader_ballot"); + register_control_dependent_expression(ops[1]); + break; + } + + case OpGroupFMinNonUniformAMD: + case OpGroupUMinNonUniformAMD: + case OpGroupSMinNonUniformAMD: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + emit_unary_func_op(result_type, id, ops[4], "minInvocationsNonUniformAMD"); + + require_extension_internal("GL_AMD_shader_ballot"); + register_control_dependent_expression(ops[1]); + break; + } + + case OpGroupFMaxNonUniformAMD: + case OpGroupUMaxNonUniformAMD: + case OpGroupSMaxNonUniformAMD: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + emit_unary_func_op(result_type, id, ops[4], "maxInvocationsNonUniformAMD"); + + require_extension_internal("GL_AMD_shader_ballot"); + register_control_dependent_expression(ops[1]); + break; + } + + case OpFragmentMaskFetchAMD: + { + auto &type = expression_type(ops[2]); + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + if (type.image.dim == DimSubpassData) + { + emit_unary_func_op(result_type, id, ops[2], "fragmentMaskFetchAMD"); + } + else + { + emit_binary_func_op(result_type, id, ops[2], ops[3], "fragmentMaskFetchAMD"); + } + + require_extension_internal("GL_AMD_shader_fragment_mask"); + break; + } + + case OpFragmentFetchAMD: + { + auto &type = expression_type(ops[2]); + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + if (type.image.dim == DimSubpassData) + { + emit_binary_func_op(result_type, id, ops[2], ops[4], "fragmentFetchAMD"); + } + else + { + emit_trinary_func_op(result_type, id, ops[2], ops[3], ops[4], "fragmentFetchAMD"); + } + + require_extension_internal("GL_AMD_shader_fragment_mask"); + break; + } + + // Vulkan 1.1 sub-group stuff ... + case OpGroupNonUniformElect: + case OpGroupNonUniformBroadcast: + case OpGroupNonUniformBroadcastFirst: + case OpGroupNonUniformBallot: + case OpGroupNonUniformInverseBallot: + case OpGroupNonUniformBallotBitExtract: + case OpGroupNonUniformBallotBitCount: + case OpGroupNonUniformBallotFindLSB: + case OpGroupNonUniformBallotFindMSB: + case OpGroupNonUniformShuffle: + case OpGroupNonUniformShuffleXor: + case OpGroupNonUniformShuffleUp: + case OpGroupNonUniformShuffleDown: + case OpGroupNonUniformAll: + case OpGroupNonUniformAny: + case OpGroupNonUniformAllEqual: + case OpGroupNonUniformFAdd: + case OpGroupNonUniformIAdd: + case OpGroupNonUniformFMul: + case OpGroupNonUniformIMul: + case OpGroupNonUniformFMin: + case OpGroupNonUniformFMax: + case OpGroupNonUniformSMin: + case OpGroupNonUniformSMax: + case OpGroupNonUniformUMin: + case OpGroupNonUniformUMax: + case OpGroupNonUniformBitwiseAnd: + case OpGroupNonUniformBitwiseOr: + case OpGroupNonUniformBitwiseXor: + case OpGroupNonUniformLogicalAnd: + case OpGroupNonUniformLogicalOr: + case OpGroupNonUniformLogicalXor: + case OpGroupNonUniformQuadSwap: + case OpGroupNonUniformQuadBroadcast: + case OpGroupNonUniformQuadAllKHR: + case OpGroupNonUniformQuadAnyKHR: + case OpGroupNonUniformRotateKHR: + emit_subgroup_op(instruction); + break; + + case OpFUnordEqual: + case OpFUnordLessThan: + case OpFUnordGreaterThan: + case OpFUnordLessThanEqual: + case OpFUnordGreaterThanEqual: + { + // GLSL doesn't specify if floating point comparisons are ordered or unordered, + // but glslang always emits ordered floating point compares for GLSL. + // To get unordered compares, we can test the opposite thing and invert the result. + // This way, we force true when there is any NaN present. + uint32_t op0 = ops[2]; + uint32_t op1 = ops[3]; + + string expr; + if (expression_type(op0).vecsize > 1) + { + const char *comp_op = nullptr; + switch (opcode) + { + case OpFUnordEqual: + comp_op = "notEqual"; + break; + + case OpFUnordLessThan: + comp_op = "greaterThanEqual"; + break; + + case OpFUnordLessThanEqual: + comp_op = "greaterThan"; + break; + + case OpFUnordGreaterThan: + comp_op = "lessThanEqual"; + break; + + case OpFUnordGreaterThanEqual: + comp_op = "lessThan"; + break; + + default: + assert(0); + break; + } + + expr = join("not(", comp_op, "(", to_unpacked_expression(op0), ", ", to_unpacked_expression(op1), "))"); + } + else + { + const char *comp_op = nullptr; + switch (opcode) + { + case OpFUnordEqual: + comp_op = " != "; + break; + + case OpFUnordLessThan: + comp_op = " >= "; + break; + + case OpFUnordLessThanEqual: + comp_op = " > "; + break; + + case OpFUnordGreaterThan: + comp_op = " <= "; + break; + + case OpFUnordGreaterThanEqual: + comp_op = " < "; + break; + + default: + assert(0); + break; + } + + expr = join("!(", to_enclosed_unpacked_expression(op0), comp_op, to_enclosed_unpacked_expression(op1), ")"); + } + + emit_op(ops[0], ops[1], expr, should_forward(op0) && should_forward(op1)); + inherit_expression_dependencies(ops[1], op0); + inherit_expression_dependencies(ops[1], op1); + break; + } + + case OpReportIntersectionKHR: + // NV is same opcode. + forced_temporaries.insert(ops[1]); + if (ray_tracing_is_khr) + GLSL_BFOP(reportIntersectionEXT); + else + GLSL_BFOP(reportIntersectionNV); + flush_control_dependent_expressions(current_emitting_block->self); + break; + case OpIgnoreIntersectionNV: + // KHR variant is a terminator. + statement("ignoreIntersectionNV();"); + flush_control_dependent_expressions(current_emitting_block->self); + break; + case OpTerminateRayNV: + // KHR variant is a terminator. + statement("terminateRayNV();"); + flush_control_dependent_expressions(current_emitting_block->self); + break; + case OpTraceNV: + statement("traceNV(", to_non_uniform_aware_expression(ops[0]), ", ", to_expression(ops[1]), ", ", to_expression(ops[2]), ", ", + to_expression(ops[3]), ", ", to_expression(ops[4]), ", ", to_expression(ops[5]), ", ", + to_expression(ops[6]), ", ", to_expression(ops[7]), ", ", to_expression(ops[8]), ", ", + to_expression(ops[9]), ", ", to_expression(ops[10]), ");"); + flush_control_dependent_expressions(current_emitting_block->self); + break; + case OpTraceRayKHR: + if (!has_decoration(ops[10], DecorationLocation)) + SPIRV_CROSS_THROW("A memory declaration object must be used in TraceRayKHR."); + statement("traceRayEXT(", to_non_uniform_aware_expression(ops[0]), ", ", to_expression(ops[1]), ", ", to_expression(ops[2]), ", ", + to_expression(ops[3]), ", ", to_expression(ops[4]), ", ", to_expression(ops[5]), ", ", + to_expression(ops[6]), ", ", to_expression(ops[7]), ", ", to_expression(ops[8]), ", ", + to_expression(ops[9]), ", ", get_decoration(ops[10], DecorationLocation), ");"); + flush_control_dependent_expressions(current_emitting_block->self); + break; + case OpExecuteCallableNV: + statement("executeCallableNV(", to_expression(ops[0]), ", ", to_expression(ops[1]), ");"); + flush_control_dependent_expressions(current_emitting_block->self); + break; + case OpExecuteCallableKHR: + if (!has_decoration(ops[1], DecorationLocation)) + SPIRV_CROSS_THROW("A memory declaration object must be used in ExecuteCallableKHR."); + statement("executeCallableEXT(", to_expression(ops[0]), ", ", get_decoration(ops[1], DecorationLocation), ");"); + flush_control_dependent_expressions(current_emitting_block->self); + break; + + // Don't bother forwarding temporaries. Avoids having to test expression invalidation with ray query objects. + case OpRayQueryInitializeKHR: + flush_variable_declaration(ops[0]); + statement("rayQueryInitializeEXT(", + to_expression(ops[0]), ", ", to_expression(ops[1]), ", ", + to_expression(ops[2]), ", ", to_expression(ops[3]), ", ", + to_expression(ops[4]), ", ", to_expression(ops[5]), ", ", + to_expression(ops[6]), ", ", to_expression(ops[7]), ");"); + break; + case OpRayQueryProceedKHR: + flush_variable_declaration(ops[0]); + emit_op(ops[0], ops[1], join("rayQueryProceedEXT(", to_expression(ops[2]), ")"), false); + break; + case OpRayQueryTerminateKHR: + flush_variable_declaration(ops[0]); + statement("rayQueryTerminateEXT(", to_expression(ops[0]), ");"); + break; + case OpRayQueryGenerateIntersectionKHR: + flush_variable_declaration(ops[0]); + statement("rayQueryGenerateIntersectionEXT(", to_expression(ops[0]), ", ", to_expression(ops[1]), ");"); + break; + case OpRayQueryConfirmIntersectionKHR: + flush_variable_declaration(ops[0]); + statement("rayQueryConfirmIntersectionEXT(", to_expression(ops[0]), ");"); + break; + case OpRayQueryGetIntersectionTriangleVertexPositionsKHR: + flush_variable_declaration(ops[1]); + emit_uninitialized_temporary_expression(ops[0], ops[1]); + statement("rayQueryGetIntersectionTriangleVertexPositionsEXT(", to_expression(ops[2]), ", bool(", to_expression(ops[3]), "), ", to_expression(ops[1]), ");"); + break; +#define GLSL_RAY_QUERY_GET_OP(op) \ + case OpRayQueryGet##op##KHR: \ + flush_variable_declaration(ops[2]); \ + emit_op(ops[0], ops[1], join("rayQueryGet" #op "EXT(", to_expression(ops[2]), ")"), false); \ + break +#define GLSL_RAY_QUERY_GET_OP2(op) \ + case OpRayQueryGet##op##KHR: \ + flush_variable_declaration(ops[2]); \ + emit_op(ops[0], ops[1], join("rayQueryGet" #op "EXT(", to_expression(ops[2]), ", ", "bool(", to_expression(ops[3]), "))"), false); \ + break + GLSL_RAY_QUERY_GET_OP(RayTMin); + GLSL_RAY_QUERY_GET_OP(RayFlags); + GLSL_RAY_QUERY_GET_OP(WorldRayOrigin); + GLSL_RAY_QUERY_GET_OP(WorldRayDirection); + GLSL_RAY_QUERY_GET_OP(IntersectionCandidateAABBOpaque); + GLSL_RAY_QUERY_GET_OP2(IntersectionType); + GLSL_RAY_QUERY_GET_OP2(IntersectionT); + GLSL_RAY_QUERY_GET_OP2(IntersectionInstanceCustomIndex); + GLSL_RAY_QUERY_GET_OP2(IntersectionInstanceId); + GLSL_RAY_QUERY_GET_OP2(IntersectionInstanceShaderBindingTableRecordOffset); + GLSL_RAY_QUERY_GET_OP2(IntersectionGeometryIndex); + GLSL_RAY_QUERY_GET_OP2(IntersectionPrimitiveIndex); + GLSL_RAY_QUERY_GET_OP2(IntersectionBarycentrics); + GLSL_RAY_QUERY_GET_OP2(IntersectionFrontFace); + GLSL_RAY_QUERY_GET_OP2(IntersectionObjectRayDirection); + GLSL_RAY_QUERY_GET_OP2(IntersectionObjectRayOrigin); + GLSL_RAY_QUERY_GET_OP2(IntersectionObjectToWorld); + GLSL_RAY_QUERY_GET_OP2(IntersectionWorldToObject); +#undef GLSL_RAY_QUERY_GET_OP +#undef GLSL_RAY_QUERY_GET_OP2 + case OpRayQueryGetClusterIdNV: + flush_variable_declaration(ops[2]); + emit_op(ops[0], ops[1], join("rayQueryGetIntersectionClusterIdNV(", to_expression(ops[2]), ", ", "bool(", to_expression(ops[3]), "))"), false); + break; + case OpTensorQuerySizeARM: + flush_variable_declaration(ops[1]); + // tensorSizeARM(tensor, dimension) + emit_binary_func_op(ops[0], ops[1], ops[2], ops[3], "tensorSizeARM"); + break; + case OpTensorReadARM: + { + flush_variable_declaration(ops[1]); + emit_uninitialized_temporary_expression(ops[0], ops[1]); + + SmallVector args { + to_expression(ops[2]), // tensor + to_expression(ops[3]), // coordinates + to_expression(ops[1]), // out value + }; + if (length > 4) + { + std::string tensor_operands; + if (ops[4] == 0) + tensor_operands = "0x0u"; + else if (ops[4] == TensorOperandsNontemporalARMMask) + tensor_operands = "gl_TensorOperandsNonTemporalARM"; + else if (ops[4] == TensorOperandsOutOfBoundsValueARMMask) + tensor_operands = "gl_TensorOperandsOutOfBoundsValueARM"; + else if (ops[4] == (TensorOperandsNontemporalARMMask | TensorOperandsOutOfBoundsValueARMMask)) + tensor_operands = "gl_TensorOperandsNonTemporalARM | gl_TensorOperandsOutOfBoundsValueARM"; + else + SPIRV_CROSS_THROW("Invalid tensorOperands for tensorReadARM."); + if ((ops[4] & TensorOperandsOutOfBoundsValueARMMask) && length != 6) + SPIRV_CROSS_THROW("gl_TensorOperandsOutOfBoundsValueARM requires an outOfBoundsValue argument."); + args.push_back(tensor_operands); // tensorOperands + } + if (length >= 6) + { + if ((length > 6) || (ops[4] & TensorOperandsOutOfBoundsValueARMMask) == 0) + SPIRV_CROSS_THROW("Too many arguments to tensorReadARM."); + args.push_back(to_expression(ops[5])); // outOfBoundsValue + } + + // tensorRead(tensor, sizeof(type), coordinates, value, operand, ...) + statement("tensorReadARM(", merge(args), ");"); + break; + } + case OpTensorWriteARM: + { + flush_variable_declaration(ops[0]); + + SmallVector args { + to_expression(ops[0]), // tensor + to_expression(ops[1]), // coordinates + to_expression(ops[2]), // out value + }; + + if (length > 3) + { + std::string tensor_operands; + if (ops[3] == 0) + tensor_operands = "0x0u"; + else if (ops[3] == TensorOperandsNontemporalARMMask) + tensor_operands = "gl_TensorOperandsNonTemporalARM"; + else + SPIRV_CROSS_THROW("Invalid tensorOperands for tensorWriteARM."); + args.push_back(tensor_operands); // tensorOperands + } + if (length > 4) + SPIRV_CROSS_THROW("Too many arguments to tensorWriteARM."); + + // tensorWrite(tensor, sizeof(type), coordinates, value) + statement("tensorWriteARM(", merge(args), ");"); + break; + } + case OpConvertUToAccelerationStructureKHR: + { + require_extension_internal("GL_EXT_ray_tracing"); + + bool elide_temporary = should_forward(ops[2]) && forced_temporaries.count(ops[1]) == 0 && + !hoisted_temporaries.count(ops[1]); + + if (elide_temporary) + { + GLSL_UFOP(accelerationStructureEXT); + } + else + { + // Force this path in subsequent iterations. + forced_temporaries.insert(ops[1]); + + // We cannot declare a temporary acceleration structure in GLSL. + // If we get to this point, we'll have to emit a temporary uvec2, + // and cast to RTAS on demand. + statement(declare_temporary(expression_type_id(ops[2]), ops[1]), to_unpacked_expression(ops[2]), ";"); + // Use raw SPIRExpression interface to block all usage tracking. + set(ops[1], join("accelerationStructureEXT(", to_name(ops[1]), ")"), ops[0], true); + } + break; + } + + case OpConvertUToPtr: + { + auto &type = get(ops[0]); + if (type.storage != StorageClassPhysicalStorageBuffer) + SPIRV_CROSS_THROW("Only StorageClassPhysicalStorageBuffer is supported by OpConvertUToPtr."); + + auto &in_type = expression_type(ops[2]); + if (in_type.vecsize == 2) + require_extension_internal("GL_EXT_buffer_reference_uvec2"); + + auto op = type_to_glsl(type); + emit_unary_func_op(ops[0], ops[1], ops[2], op.c_str()); + break; + } + + case OpConvertPtrToU: + { + auto &type = get(ops[0]); + auto &ptr_type = expression_type(ops[2]); + if (ptr_type.storage != StorageClassPhysicalStorageBuffer) + SPIRV_CROSS_THROW("Only StorageClassPhysicalStorageBuffer is supported by OpConvertPtrToU."); + + if (type.vecsize == 2) + require_extension_internal("GL_EXT_buffer_reference_uvec2"); + + auto op = type_to_glsl(type); + emit_unary_func_op(ops[0], ops[1], ops[2], op.c_str()); + break; + } + + case OpUndef: + // Undefined value has been declared. + break; + + case OpLine: + { + emit_line_directive(ops[0], ops[1]); + break; + } + + case OpNoLine: + break; + + case OpDemoteToHelperInvocationEXT: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("GL_EXT_demote_to_helper_invocation is only supported in Vulkan GLSL."); + require_extension_internal("GL_EXT_demote_to_helper_invocation"); + statement(backend.demote_literal, ";"); + break; + + case OpIsHelperInvocationEXT: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("GL_EXT_demote_to_helper_invocation is only supported in Vulkan GLSL."); + require_extension_internal("GL_EXT_demote_to_helper_invocation"); + // Helper lane state with demote is volatile by nature. + // Do not forward this. + emit_op(ops[0], ops[1], "helperInvocationEXT()", false); + break; + + case OpBeginInvocationInterlockEXT: + // If the interlock is complex, we emit this elsewhere. + if (!interlocked_is_complex) + { + statement("SPIRV_Cross_beginInvocationInterlock();"); + flush_all_active_variables(); + // Make sure forwarding doesn't propagate outside interlock region. + } + break; + + case OpEndInvocationInterlockEXT: + // If the interlock is complex, we emit this elsewhere. + if (!interlocked_is_complex) + { + statement("SPIRV_Cross_endInvocationInterlock();"); + flush_all_active_variables(); + // Make sure forwarding doesn't propagate outside interlock region. + } + break; + + case OpSetMeshOutputsEXT: + statement("SetMeshOutputsEXT(", to_unpacked_expression(ops[0]), ", ", to_unpacked_expression(ops[1]), ");"); + break; + + case OpReadClockKHR: + { + auto &type = get(ops[0]); + auto scope = static_cast(evaluate_constant_u32(ops[2])); + const char *op = nullptr; + // Forwarding clock statements leads to a scenario where an SSA value can take on different + // values every time it's evaluated. Block any forwarding attempt. + // We also might want to invalidate all expressions to function as a sort of optimization + // barrier, but might be overkill for now. + if (scope == ScopeDevice) + { + require_extension_internal("GL_EXT_shader_realtime_clock"); + if (type.basetype == SPIRType::BaseType::UInt64) + op = "clockRealtimeEXT()"; + else if (type.basetype == SPIRType::BaseType::UInt && type.vecsize == 2) + op = "clockRealtime2x32EXT()"; + else + SPIRV_CROSS_THROW("Unsupported result type for OpReadClockKHR opcode."); + } + else if (scope == ScopeSubgroup) + { + require_extension_internal("GL_ARB_shader_clock"); + if (type.basetype == SPIRType::BaseType::UInt64) + op = "clockARB()"; + else if (type.basetype == SPIRType::BaseType::UInt && type.vecsize == 2) + op = "clock2x32ARB()"; + else + SPIRV_CROSS_THROW("Unsupported result type for OpReadClockKHR opcode."); + } + else + SPIRV_CROSS_THROW("Unsupported scope for OpReadClockKHR opcode."); + + emit_op(ops[0], ops[1], op, false); + break; + } + + case OpCooperativeVectorLoadNV: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + emit_uninitialized_temporary_expression(result_type, id); + + statement("coopVecLoadNV(", to_expression(id), ", ", to_expression(ops[2]), ", ", to_expression(ops[3]), ");"); + register_read(id, ops[2], false); + break; + } + + case OpCooperativeVectorStoreNV: + { + uint32_t id = ops[0]; + + statement("coopVecStoreNV(", to_expression(ops[2]), ", ", to_expression(id), ", ", to_expression(ops[1]), ");"); + register_write(ops[2]); + break; + } + + case OpCooperativeVectorOuterProductAccumulateNV: + { + auto buf = ops[0]; + auto offset = ops[1]; + auto v1 = ops[2]; + auto v2 = ops[3]; + auto matrix_layout_id = ops[4]; + auto matrix_iterpretation_id = ops[5]; + auto matrix_stride_id = length >= 6 ? ops[6] : 0; + statement(join("coopVecOuterProductAccumulateNV(", to_expression(v1), ", ", to_expression(v2), ", ", + to_expression(buf), ", ", to_expression(offset), ", ", + matrix_stride_id ? to_expression(matrix_stride_id) : "0", + ", ", to_pretty_expression_if_int_constant( + matrix_layout_id, std::begin(CoopVecMatrixLayoutNames), std::end(CoopVecMatrixLayoutNames)), + ", ", to_pretty_expression_if_int_constant( + matrix_iterpretation_id, std::begin(CoopVecComponentTypeNames), std::end(CoopVecComponentTypeNames)), + ");")); + register_write(ops[0]); + break; + } + + case OpCooperativeVectorReduceSumAccumulateNV: + { + auto buf = ops[0]; + auto offset = ops[1]; + auto v1 = ops[2]; + statement(join("coopVecReduceSumAccumulateNV(", to_expression(v1), ", ", to_expression(buf), ", ", + to_expression(offset), ");")); + register_write(ops[0]); + break; + } + + case OpCooperativeVectorMatrixMulNV: + case OpCooperativeVectorMatrixMulAddNV: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + emit_uninitialized_temporary_expression(result_type, id); + + std::string stmt; + switch (opcode) + { + case OpCooperativeVectorMatrixMulAddNV: + stmt += "coopVecMatMulAddNV("; + break; + case OpCooperativeVectorMatrixMulNV: + stmt += "coopVecMatMulNV("; + break; + default: + SPIRV_CROSS_THROW("Invalid op code for coopvec instruction."); + } + for (uint32_t i = 1; i < length; i++) + { + // arguments 3, 6 and in case of MulAddNv also 9 use component type int constants + if (i == 3 || i == 6 || (i == 9 && opcode == OpCooperativeVectorMatrixMulAddNV)) + { + stmt += to_pretty_expression_if_int_constant( + ops[i], std::begin(CoopVecComponentTypeNames), std::end(CoopVecComponentTypeNames)); + } + else if ((i == 12 && opcode == OpCooperativeVectorMatrixMulAddNV) || + (i == 9 && opcode == OpCooperativeVectorMatrixMulNV)) + { + stmt += to_pretty_expression_if_int_constant( + ops[i], std::begin(CoopVecMatrixLayoutNames), std::end(CoopVecMatrixLayoutNames)); + } + else + stmt += to_expression(ops[i]); + + if (i < length - 1) + stmt += ", "; + } + stmt += ");"; + statement(stmt); + break; + } + + case OpCooperativeMatrixLengthKHR: + { + // Need to synthesize a dummy temporary, since the SPIR-V opcode is based on the type. + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + set( + id, join(type_to_glsl(get(result_type)), + "(", type_to_glsl(get(ops[2])), "(0).length())"), + result_type, true); + break; + } + + case OpCooperativeMatrixLoadKHR: + { + // Spec contradicts itself if stride is optional or not. + if (length < 5) + SPIRV_CROSS_THROW("Stride is not provided."); + + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + emit_uninitialized_temporary_expression(result_type, id); + + auto expr = to_expression(ops[2]); + pair split_expr; + if (!is_forcing_recompilation()) + split_expr = split_coopmat_pointer(expr); + + string layout_expr = to_pretty_expression_if_int_constant( + ops[3], std::begin(CoopMatMatrixLayoutNames), std::end(CoopMatMatrixLayoutNames)); + statement("coopMatLoad(", to_expression(id), ", ", split_expr.first, ", ", split_expr.second, ", ", + to_expression(ops[4]), ", ", layout_expr, ");"); + + register_read(id, ops[2], false); + break; + } + + case OpCooperativeMatrixStoreKHR: + { + // Spec contradicts itself if stride is optional or not. + if (length < 4) + SPIRV_CROSS_THROW("Stride is not provided."); + + // SPIR-V and GLSL don't agree how to pass the expression. + // In SPIR-V it's a pointer, but in GLSL it's reference to array + index. + + auto expr = to_expression(ops[0]); + pair split_expr; + if (!is_forcing_recompilation()) + split_expr = split_coopmat_pointer(expr); + + string layout_expr = to_pretty_expression_if_int_constant( + ops[2], std::begin(CoopMatMatrixLayoutNames), std::end(CoopMatMatrixLayoutNames)); + + statement("coopMatStore(", to_expression(ops[1]), ", ", split_expr.first, ", ", split_expr.second, ", ", + to_expression(ops[3]), ", ", layout_expr, ");"); + + // TODO: Do we care about memory operands? + + register_write(ops[0]); + break; + } + + case OpCooperativeMatrixMulAddKHR: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t A = ops[2]; + uint32_t B = ops[3]; + uint32_t C = ops[4]; + bool forward = should_forward(A) && should_forward(B) && should_forward(C); + emit_op(result_type, id, + join("coopMatMulAdd(", + to_unpacked_expression(A), ", ", + to_unpacked_expression(B), ", ", + to_unpacked_expression(C), ", ", + (length >= 6 ? ops[5] : 0), + ")"), + forward); + + inherit_expression_dependencies(id, A); + inherit_expression_dependencies(id, B); + inherit_expression_dependencies(id, C); + break; + } + + case OpCompositeConstructReplicateEXT: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + auto &type = get(result_type); + auto value_to_replicate = to_expression(ops[2]); + std::string rhs; + // Matrices don't have a replicating constructor for vectors. Need to manually replicate + if (type.op == OpTypeMatrix || type.op == OpTypeArray) + { + if (type.op == OpTypeArray && type.array.size() != 1) + { + SPIRV_CROSS_THROW( + "Multi-dimensional arrays currently not supported for OpCompositeConstructReplicateEXT"); + } + uint32_t num_elements = type.op == OpTypeMatrix ? type.columns : type.array[0]; + if (backend.use_initializer_list && type.op == OpTypeArray) + { + rhs += "{"; + } + else + { + rhs += type_to_glsl_constructor(type); + rhs += "("; + } + for (uint32_t i = 0; i < num_elements; i++) + { + rhs += value_to_replicate; + if (i < num_elements - 1) + rhs += ", "; + } + if (backend.use_initializer_list && type.op == OpTypeArray) + rhs += "}"; + else + rhs += ")"; + } + else + { + rhs = join(type_to_glsl(type), "(", to_expression(ops[2]), ")"); + } + emit_op(result_type, id, rhs, true); + break; + } + + default: + statement("// unimplemented op ", instruction.op); + break; + } +} + +// Appends function arguments, mapped from global variables, beyond the specified arg index. +// This is used when a function call uses fewer arguments than the function defines. +// This situation may occur if the function signature has been dynamically modified to +// extract global variables referenced from within the function, and convert them to +// function arguments. This is necessary for shader languages that do not support global +// access to shader input content from within a function (eg. Metal). Each additional +// function args uses the name of the global variable. Function nesting will modify the +// functions and function calls all the way up the nesting chain. +void CompilerGLSL::append_global_func_args(const SPIRFunction &func, uint32_t index, SmallVector &arglist) +{ + auto &args = func.arguments; + uint32_t arg_cnt = uint32_t(args.size()); + for (uint32_t arg_idx = index; arg_idx < arg_cnt; arg_idx++) + { + auto &arg = args[arg_idx]; + assert(arg.alias_global_variable); + + // If the underlying variable needs to be declared + // (ie. a local variable with deferred declaration), do so now. + uint32_t var_id = get(arg.id).basevariable; + if (var_id) + flush_variable_declaration(var_id); + + arglist.push_back(to_func_call_arg(arg, arg.id)); + } +} + +string CompilerGLSL::to_member_name(const SPIRType &type, uint32_t index) +{ + if (type.type_alias != TypeID(0) && + !has_extended_decoration(type.type_alias, SPIRVCrossDecorationBufferBlockRepacked)) + { + return to_member_name(get(type.type_alias), index); + } + + auto &memb = ir.meta[type.self].members; + if (index < memb.size() && !memb[index].alias.empty()) + return memb[index].alias; + else + return join("_m", index); +} + +string CompilerGLSL::to_member_reference(uint32_t, const SPIRType &type, uint32_t index, bool) +{ + return join(".", to_member_name(type, index)); +} + +string CompilerGLSL::to_multi_member_reference(const SPIRType &type, const SmallVector &indices) +{ + string ret; + auto *member_type = &type; + for (auto &index : indices) + { + ret += join(".", to_member_name(*member_type, index)); + member_type = &get(member_type->member_types[index]); + } + return ret; +} + +void CompilerGLSL::add_member_name(SPIRType &type, uint32_t index) +{ + auto &memb = ir.meta[type.self].members; + if (index < memb.size() && !memb[index].alias.empty()) + { + auto &name = memb[index].alias; + if (name.empty()) + return; + + ParsedIR::sanitize_identifier(name, true, true); + update_name_cache(type.member_name_cache, name); + } +} + +// Checks whether the ID is a row_major matrix that requires conversion before use +bool CompilerGLSL::is_non_native_row_major_matrix(uint32_t id) +{ + // Natively supported row-major matrices do not need to be converted. + // Legacy targets do not support row major. + if (backend.native_row_major_matrix && !is_legacy()) + return false; + + auto *e = maybe_get(id); + if (e) + return e->need_transpose; + else + return has_decoration(id, DecorationRowMajor); +} + +// Checks whether the member is a row_major matrix that requires conversion before use +bool CompilerGLSL::member_is_non_native_row_major_matrix(const SPIRType &type, uint32_t index) +{ + // Natively supported row-major matrices do not need to be converted. + if (backend.native_row_major_matrix && !is_legacy()) + return false; + + // Non-matrix or column-major matrix types do not need to be converted. + if (!has_member_decoration(type.self, index, DecorationRowMajor)) + return false; + + // Only square row-major matrices can be converted at this time. + // Converting non-square matrices will require defining custom GLSL function that + // swaps matrix elements while retaining the original dimensional form of the matrix. + const auto mbr_type = get(type.member_types[index]); + if (mbr_type.columns != mbr_type.vecsize) + SPIRV_CROSS_THROW("Row-major matrices must be square on this platform."); + + return true; +} + +// Checks if we need to remap physical type IDs when declaring the type in a buffer. +bool CompilerGLSL::member_is_remapped_physical_type(const SPIRType &type, uint32_t index) const +{ + return has_extended_member_decoration(type.self, index, SPIRVCrossDecorationPhysicalTypeID); +} + +// Checks whether the member is in packed data type, that might need to be unpacked. +bool CompilerGLSL::member_is_packed_physical_type(const SPIRType &type, uint32_t index) const +{ + return has_extended_member_decoration(type.self, index, SPIRVCrossDecorationPhysicalTypePacked); +} + +// Wraps the expression string in a function call that converts the +// row_major matrix result of the expression to a column_major matrix. +// Base implementation uses the standard library transpose() function. +// Subclasses may override to use a different function. +string CompilerGLSL::convert_row_major_matrix(string exp_str, const SPIRType &exp_type, uint32_t /* physical_type_id */, + bool /*is_packed*/, bool relaxed) +{ + strip_enclosed_expression(exp_str); + if (!is_matrix(exp_type)) + { + auto column_index = exp_str.find_last_of('['); + if (column_index == string::npos) + return exp_str; + + auto column_expr = exp_str.substr(column_index); + exp_str.resize(column_index); + + auto end_deferred_index = column_expr.find_last_of(']'); + if (end_deferred_index != string::npos && end_deferred_index + 1 != column_expr.size()) + { + // If we have any data member fixups, it must be transposed so that it refers to this index. + // E.g. [0].data followed by [1] would be shuffled to [1][0].data which is wrong, + // and needs to be [1].data[0] instead. + end_deferred_index++; + column_expr = column_expr.substr(end_deferred_index) + + column_expr.substr(0, end_deferred_index); + } + + auto transposed_expr = type_to_glsl_constructor(exp_type) + "("; + + // Loading a column from a row-major matrix. Unroll the load. + for (uint32_t c = 0; c < exp_type.vecsize; c++) + { + transposed_expr += join(exp_str, '[', c, ']', column_expr); + if (c + 1 < exp_type.vecsize) + transposed_expr += ", "; + } + + transposed_expr += ")"; + return transposed_expr; + } + else if (options.version < 120) + { + // GLSL 110, ES 100 do not have transpose(), so emulate it. Note that + // these GLSL versions do not support non-square matrices. + if (exp_type.vecsize == 2 && exp_type.columns == 2) + require_polyfill(PolyfillTranspose2x2, relaxed); + else if (exp_type.vecsize == 3 && exp_type.columns == 3) + require_polyfill(PolyfillTranspose3x3, relaxed); + else if (exp_type.vecsize == 4 && exp_type.columns == 4) + require_polyfill(PolyfillTranspose4x4, relaxed); + else + SPIRV_CROSS_THROW("Non-square matrices are not supported in legacy GLSL, cannot transpose."); + return join("spvTranspose", (options.es && relaxed) ? "MP" : "", "(", exp_str, ")"); + } + else + return join("transpose(", exp_str, ")"); +} + +string CompilerGLSL::variable_decl(const SPIRType &type, const string &name, uint32_t id) +{ + string type_name = type_to_glsl(type, id); + remap_variable_type_name(type, name, type_name); + return join(type_name, " ", name, type_to_array_glsl(type, id)); +} + +bool CompilerGLSL::variable_decl_is_remapped_storage(const SPIRVariable &var, StorageClass storage) const +{ + return var.storage == storage; +} + +// Emit a structure member. Subclasses may override to modify output, +// or to dynamically add a padding member if needed. +void CompilerGLSL::emit_struct_member(const SPIRType &type, uint32_t member_type_id, uint32_t index, + const string &qualifier, uint32_t) +{ + auto &membertype = get(member_type_id); + + Bitset memberflags; + auto &memb = ir.meta[type.self].members; + if (index < memb.size()) + memberflags = memb[index].decoration_flags; + + string qualifiers; + bool is_block = ir.meta[type.self].decoration.decoration_flags.get(DecorationBlock) || + ir.meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock); + + if (is_block) + qualifiers = to_interpolation_qualifiers(memberflags); + + statement(layout_for_member(type, index), qualifiers, qualifier, flags_to_qualifiers_glsl(membertype, 0, memberflags), + variable_decl(membertype, to_member_name(type, index)), ";"); +} + +void CompilerGLSL::emit_struct_padding_target(const SPIRType &) +{ +} + +string CompilerGLSL::flags_to_qualifiers_glsl(const SPIRType &type, uint32_t id, const Bitset &flags) +{ + // GL_EXT_buffer_reference variables can be marked as restrict. + if (flags.get(DecorationRestrictPointerEXT)) + return "restrict "; + + string qual; + + if (type_is_floating_point(type) && + (flags.get(DecorationNoContraction) || (type.self && has_legacy_nocontract(type.self, id))) && + backend.support_precise_qualifier) + { + qual = "precise "; + } + + // Structs do not have precision qualifiers, neither do doubles (desktop only anyways, so no mediump/highp). + bool type_supports_precision = + type.basetype == SPIRType::Float || type.basetype == SPIRType::Int || type.basetype == SPIRType::UInt || + type.basetype == SPIRType::Image || type.basetype == SPIRType::SampledImage || + type.basetype == SPIRType::Sampler; + + if (!type_supports_precision) + return qual; + + if (options.es) + { + auto &execution = get_entry_point(); + + if (type.basetype == SPIRType::UInt && is_legacy_es()) + { + // HACK: This is a bool. See comment in type_to_glsl(). + qual += "lowp "; + } + else if (flags.get(DecorationRelaxedPrecision)) + { + bool implied_fmediump = type.basetype == SPIRType::Float && + options.fragment.default_float_precision == Options::Mediump && + execution.model == ExecutionModelFragment; + + bool implied_imediump = (type.basetype == SPIRType::Int || type.basetype == SPIRType::UInt) && + options.fragment.default_int_precision == Options::Mediump && + execution.model == ExecutionModelFragment; + + qual += (implied_fmediump || implied_imediump) ? "" : "mediump "; + } + else + { + bool implied_fhighp = + type.basetype == SPIRType::Float && ((options.fragment.default_float_precision == Options::Highp && + execution.model == ExecutionModelFragment) || + (execution.model != ExecutionModelFragment)); + + bool implied_ihighp = (type.basetype == SPIRType::Int || type.basetype == SPIRType::UInt) && + ((options.fragment.default_int_precision == Options::Highp && + execution.model == ExecutionModelFragment) || + (execution.model != ExecutionModelFragment)); + + qual += (implied_fhighp || implied_ihighp) ? "" : "highp "; + } + } + else if (backend.allow_precision_qualifiers) + { + // Vulkan GLSL supports precision qualifiers, even in desktop profiles, which is convenient. + // The default is highp however, so only emit mediump in the rare case that a shader has these. + if (flags.get(DecorationRelaxedPrecision)) + qual += "mediump "; + } + + return qual; +} + +string CompilerGLSL::to_precision_qualifiers_glsl(uint32_t id) +{ + auto &type = expression_type(id); + bool use_precision_qualifiers = backend.allow_precision_qualifiers; + if (use_precision_qualifiers && (type.basetype == SPIRType::Image || type.basetype == SPIRType::SampledImage)) + { + // Force mediump for the sampler type. We cannot declare 16-bit or smaller image types. + auto &result_type = get(type.image.type); + if (result_type.width < 32) + return "mediump "; + } + return flags_to_qualifiers_glsl(type, id, ir.meta[id].decoration.decoration_flags); +} + +void CompilerGLSL::fixup_io_block_patch_primitive_qualifiers(const SPIRVariable &var) +{ + // Works around weird behavior in glslangValidator where + // a patch out block is translated to just block members getting the decoration. + // To make glslang not complain when we compile again, we have to transform this back to a case where + // the variable itself has Patch decoration, and not members. + // Same for perprimitiveEXT. + auto &type = get(var.basetype); + if (has_decoration(type.self, DecorationBlock)) + { + uint32_t member_count = uint32_t(type.member_types.size()); + Decoration promoted_decoration = {}; + bool do_promote_decoration = false; + for (uint32_t i = 0; i < member_count; i++) + { + if (has_member_decoration(type.self, i, DecorationPatch)) + { + promoted_decoration = DecorationPatch; + do_promote_decoration = true; + break; + } + else if (has_member_decoration(type.self, i, DecorationPerPrimitiveEXT)) + { + promoted_decoration = DecorationPerPrimitiveEXT; + do_promote_decoration = true; + break; + } + } + + if (do_promote_decoration) + { + set_decoration(var.self, promoted_decoration); + for (uint32_t i = 0; i < member_count; i++) + unset_member_decoration(type.self, i, promoted_decoration); + } + } +} + +string CompilerGLSL::to_qualifiers_glsl(uint32_t id) +{ + auto &flags = get_decoration_bitset(id); + string res; + + auto *var = maybe_get(id); + + if (var && var->storage == StorageClassWorkgroup && !backend.shared_is_implied) + res += "shared "; + else if (var && var->storage == StorageClassTaskPayloadWorkgroupEXT && !backend.shared_is_implied) + res += "taskPayloadSharedEXT "; + + res += to_interpolation_qualifiers(flags); + if (var) + res += to_storage_qualifiers_glsl(*var); + + auto &type = expression_type(id); + if (type.image.dim != DimSubpassData && type.image.sampled == 2) + { + if (flags.get(DecorationCoherent)) + res += "coherent "; + if (flags.get(DecorationRestrict)) + res += "restrict "; + + if (flags.get(DecorationNonWritable)) + res += "readonly "; + + bool formatted_load = type.image.format == ImageFormatUnknown; + if (flags.get(DecorationNonReadable)) + { + res += "writeonly "; + formatted_load = false; + } + + if (formatted_load) + { + if (!options.es) + require_extension_internal("GL_EXT_shader_image_load_formatted"); + else + SPIRV_CROSS_THROW("Cannot use GL_EXT_shader_image_load_formatted in ESSL."); + } + } + else if (type.basetype == SPIRType::Tensor) + { + if (flags.get(DecorationNonWritable)) + res += "readonly "; + if (flags.get(DecorationNonReadable)) + res += "writeonly "; + } + + res += to_precision_qualifiers_glsl(id); + + return res; +} + +string CompilerGLSL::argument_decl(const SPIRFunction::Parameter &arg) +{ + // glslangValidator seems to make all arguments pointer no matter what which is rather bizarre ... + auto &type = expression_type(arg.id); + const char *direction = ""; + + if (is_pointer(type) && + (type.storage == StorageClassFunction || + type.storage == StorageClassPrivate || + type.storage == StorageClassOutput)) + { + // If we're passing around block types to function, we really mean reference in a pointer sense, + // but DXC does not like inout for mesh blocks, so workaround that. out is technically not correct, + // but it works in practice due to legalization. It's ... not great, but you gotta do what you gotta do. + // GLSL will never hit this case since it's not valid. + if (type.storage == StorageClassOutput && get_execution_model() == ExecutionModelMeshEXT && + has_decoration(type.self, DecorationBlock) && is_builtin_type(type) && arg.write_count) + { + direction = "out "; + } + else if (arg.write_count && arg.read_count) + direction = "inout "; + else if (arg.write_count) + direction = "out "; + } + + return join(direction, to_qualifiers_glsl(arg.id), variable_decl(type, to_name(arg.id), arg.id)); +} + +string CompilerGLSL::to_initializer_expression(const SPIRVariable &var) +{ + return to_unpacked_expression(var.initializer); +} + +string CompilerGLSL::to_zero_initialized_expression(uint32_t type_id) +{ +#ifndef NDEBUG + auto &type = get(type_id); + assert(type.storage == StorageClassPrivate || type.storage == StorageClassFunction || + type.storage == StorageClassGeneric); +#endif + uint32_t id = ir.increase_bound_by(1); + ir.make_constant_null(id, type_id, false); + return constant_expression(get(id)); +} + +bool CompilerGLSL::type_can_zero_initialize(const SPIRType &type) const +{ + if (type.pointer) + return false; + + if (!type.array.empty() && options.flatten_multidimensional_arrays) + return false; + + for (auto &literal : type.array_size_literal) + if (!literal) + return false; + + for (auto &memb : type.member_types) + if (!type_can_zero_initialize(get(memb))) + return false; + + return true; +} + +string CompilerGLSL::variable_decl(const SPIRVariable &variable) +{ + // Ignore the pointer type since GLSL doesn't have pointers. + auto &type = get_variable_data_type(variable); + + if (type.pointer_depth > 1 && !backend.support_pointer_to_pointer) + SPIRV_CROSS_THROW("Cannot declare pointer-to-pointer types."); + + auto res = join(to_qualifiers_glsl(variable.self), variable_decl(type, to_name(variable.self), variable.self)); + + if (variable.loop_variable && variable.static_expression) + { + uint32_t expr = variable.static_expression; + if (ir.ids[expr].get_type() != TypeUndef) + res += join(" = ", to_unpacked_expression(variable.static_expression)); + else if (options.force_zero_initialized_variables && type_can_zero_initialize(type)) + res += join(" = ", to_zero_initialized_expression(get_variable_data_type_id(variable))); + } + else if (variable.initializer) + { + if (!variable_decl_is_remapped_storage(variable, StorageClassWorkgroup)) + { + uint32_t expr = variable.initializer; + if (ir.ids[expr].get_type() != TypeUndef) + res += join(" = ", to_initializer_expression(variable)); + else if (options.force_zero_initialized_variables && type_can_zero_initialize(type)) + res += join(" = ", to_zero_initialized_expression(get_variable_data_type_id(variable))); + } + else + { + // Workgroup memory requires special handling. First, it can only be Null-Initialized. + // GLSL will handle this with null initializer, while others require more work after the decl + require_extension_internal("GL_EXT_null_initializer"); + if (!backend.constant_null_initializer.empty()) + res += join(" = ", backend.constant_null_initializer); + } + } + + return res; +} + +const char *CompilerGLSL::to_pls_qualifiers_glsl(const SPIRVariable &variable) +{ + auto &flags = get_decoration_bitset(variable.self); + if (flags.get(DecorationRelaxedPrecision)) + return "mediump "; + else + return "highp "; +} + +string CompilerGLSL::pls_decl(const PlsRemap &var) +{ + auto &variable = get(var.id); + + auto op_and_basetype = pls_format_to_basetype(var.format); + + SPIRType type { op_and_basetype.first }; + type.basetype = op_and_basetype.second; + auto vecsize = pls_format_to_components(var.format); + if (vecsize > 1) + { + type.op = OpTypeVector; + type.vecsize = vecsize; + } + + return join(to_pls_layout(var.format), to_pls_qualifiers_glsl(variable), type_to_glsl(type), " ", + to_name(variable.self)); +} + +uint32_t CompilerGLSL::to_array_size_literal(const SPIRType &type) const +{ + return to_array_size_literal(type, uint32_t(type.array.size() - 1)); +} + +uint32_t CompilerGLSL::to_array_size_literal(const SPIRType &type, uint32_t index) const +{ + assert(type.array.size() == type.array_size_literal.size()); + + if (type.array_size_literal[index]) + { + return type.array[index]; + } + else + { + // Use the default spec constant value. + // This is the best we can do. + return evaluate_constant_u32(type.array[index]); + } +} + +string CompilerGLSL::to_array_size(const SPIRType &type, uint32_t index) +{ + assert(type.array.size() == type.array_size_literal.size()); + + auto &size = type.array[index]; + if (!type.array_size_literal[index]) + return to_expression(size); + else if (size) + return convert_to_string(size); + else if (!backend.unsized_array_supported) + { + // For runtime-sized arrays, we can work around + // lack of standard support for this by simply having + // a single element array. + // + // Runtime length arrays must always be the last element + // in an interface block. + return "1"; + } + else + return ""; +} + +string CompilerGLSL::type_to_array_glsl(const SPIRType &type, uint32_t) +{ + if (type.pointer && type.storage == StorageClassPhysicalStorageBuffer && type.basetype != SPIRType::Struct) + { + // We are using a wrapped pointer type, and we should not emit any array declarations here. + return ""; + } + + if (type.array.empty()) + return ""; + + if (options.flatten_multidimensional_arrays) + { + string res; + res += "["; + for (auto i = uint32_t(type.array.size()); i; i--) + { + res += enclose_expression(to_array_size(type, i - 1)); + if (i > 1) + res += " * "; + } + res += "]"; + return res; + } + else + { + if (type.array.size() > 1) + { + if (!options.es && options.version < 430) + require_extension_internal("GL_ARB_arrays_of_arrays"); + else if (options.es && options.version < 310) + SPIRV_CROSS_THROW("Arrays of arrays not supported before ESSL version 310. " + "Try using --flatten-multidimensional-arrays or set " + "options.flatten_multidimensional_arrays to true."); + } + + string res; + for (auto i = uint32_t(type.array.size()); i; i--) + { + res += "["; + res += to_array_size(type, i - 1); + res += "]"; + } + return res; + } +} + +string CompilerGLSL::image_type_glsl(const SPIRType &type, uint32_t id, bool /*member*/) +{ + auto &imagetype = get(type.image.type); + string res; + + switch (imagetype.basetype) + { + case SPIRType::Int64: + res = "i64"; + require_extension_internal("GL_EXT_shader_image_int64"); + break; + case SPIRType::UInt64: + res = "u64"; + require_extension_internal("GL_EXT_shader_image_int64"); + break; + case SPIRType::Int: + case SPIRType::Short: + case SPIRType::SByte: + res = "i"; + break; + case SPIRType::UInt: + case SPIRType::UShort: + case SPIRType::UByte: + res = "u"; + break; + default: + break; + } + + // For half image types, we will force mediump for the sampler, and cast to f16 after any sampling operation. + // We cannot express a true half texture type in GLSL. Neither for short integer formats for that matter. + + if (type.basetype == SPIRType::Image && type.image.dim == DimSubpassData && options.vulkan_semantics) + return res + "subpassInput" + (type.image.ms ? "MS" : ""); + else if (type.basetype == SPIRType::Image && type.image.dim == DimSubpassData && + subpass_input_is_framebuffer_fetch(id)) + { + SPIRType sampled_type = get(type.image.type); + sampled_type.vecsize = 4; + return type_to_glsl(sampled_type); + } + + // If we're emulating subpassInput with samplers, force sampler2D + // so we don't have to specify format. + if (type.basetype == SPIRType::Image && type.image.dim != DimSubpassData) + { + // Sampler buffers are always declared as samplerBuffer even though they might be separate images in the SPIR-V. + if (type.image.dim == DimBuffer && type.image.sampled == 1) + res += "sampler"; + else + res += type.image.sampled == 2 ? "image" : "texture"; + } + else + res += "sampler"; + + switch (type.image.dim) + { + case Dim1D: + // ES doesn't support 1D. Fake it with 2D. + res += options.es ? "2D" : "1D"; + break; + case Dim2D: + res += "2D"; + break; + case Dim3D: + res += "3D"; + break; + case DimCube: + res += "Cube"; + break; + case DimRect: + if (options.es) + SPIRV_CROSS_THROW("Rectangle textures are not supported on OpenGL ES."); + + if (is_legacy_desktop()) + require_extension_internal("GL_ARB_texture_rectangle"); + + res += "2DRect"; + break; + + case DimBuffer: + if (options.es && options.version < 320) + require_extension_internal("GL_EXT_texture_buffer"); + else if (!options.es && options.version < 140) + require_extension_internal("GL_EXT_texture_buffer_object"); + res += "Buffer"; + break; + + case DimSubpassData: + res += "2D"; + break; + default: + SPIRV_CROSS_THROW("Only 1D, 2D, 2DRect, 3D, Buffer, InputTarget and Cube textures supported."); + } + + if (type.image.ms) + res += "MS"; + if (type.image.arrayed) + { + if (is_legacy_desktop()) + require_extension_internal("GL_EXT_texture_array"); + res += "Array"; + } + + // "Shadow" state in GLSL only exists for samplers and combined image samplers. + if (((type.basetype == SPIRType::SampledImage) || (type.basetype == SPIRType::Sampler)) && + is_depth_image(type, id)) + { + res += "Shadow"; + + if (type.image.dim == DimCube && is_legacy()) + { + if (!options.es) + require_extension_internal("GL_EXT_gpu_shader4"); + else + { + require_extension_internal("GL_NV_shadow_samplers_cube"); + res += "NV"; + } + } + } + + return res; +} + +string CompilerGLSL::type_to_glsl_constructor(const SPIRType &type) +{ + if (backend.use_array_constructor && type.array.size() > 1) + { + if (options.flatten_multidimensional_arrays) + SPIRV_CROSS_THROW("Cannot flatten constructors of multidimensional array constructors, " + "e.g. float[][]()."); + else if (!options.es && options.version < 430) + require_extension_internal("GL_ARB_arrays_of_arrays"); + else if (options.es && options.version < 310) + SPIRV_CROSS_THROW("Arrays of arrays not supported before ESSL version 310."); + } + + auto e = type_to_glsl(type); + if (backend.use_array_constructor) + { + for (uint32_t i = 0; i < type.array.size(); i++) + e += "[]"; + } + return e; +} + +// The optional id parameter indicates the object whose type we are trying +// to find the description for. It is optional. Most type descriptions do not +// depend on a specific object's use of that type. +string CompilerGLSL::type_to_glsl(const SPIRType &type, uint32_t id) +{ + if (is_physical_pointer(type) && !is_physical_pointer_to_buffer_block(type)) + { + // Need to create a magic type name which compacts the entire type information. + auto *parent = &get_pointee_type(type); + string name = type_to_glsl(*parent); + + uint32_t array_stride = get_decoration(type.parent_type, DecorationArrayStride); + + // Resolve all array dimensions in one go since once we lose the pointer type, + // array information is left to to_array_type_glsl. The base type loses array information. + while (is_array(*parent)) + { + if (parent->array_size_literal.back()) + name += join(type.array.back(), "_"); + else + name += join("id", type.array.back(), "_"); + + name += "stride_" + std::to_string(array_stride); + + array_stride = get_decoration(parent->parent_type, DecorationArrayStride); + parent = &get(parent->parent_type); + } + + name += "Pointer"; + return name; + } + + switch (type.basetype) + { + case SPIRType::Struct: + // Need OpName lookup here to get a "sensible" name for a struct. + if (backend.explicit_struct_type) + return join("struct ", to_name(type.self)); + else + return to_name(type.self); + + case SPIRType::Image: + case SPIRType::SampledImage: + return image_type_glsl(type, id); + + case SPIRType::Sampler: + // The depth field is set by calling code based on the variable ID of the sampler, effectively reintroducing + // this distinction into the type system. + return comparison_ids.count(id) ? "samplerShadow" : "sampler"; + + case SPIRType::AccelerationStructure: + return ray_tracing_is_khr ? "accelerationStructureEXT" : "accelerationStructureNV"; + + case SPIRType::RayQuery: + return "rayQueryEXT"; + + case SPIRType::Tensor: + if (type.ext.tensor.rank == 0) + SPIRV_CROSS_THROW("GLSL tensors must have a Rank."); + if (type.ext.tensor.shape != 0) + SPIRV_CROSS_THROW("GLSL tensors cannot have a Shape."); + return join("tensorARM<", type_to_glsl(get(type.ext.tensor.type)), ", ", + to_expression(type.ext.tensor.rank), ">"); + + case SPIRType::Void: + return "void"; + + default: + break; + } + + if (type.basetype == SPIRType::UInt && is_legacy()) + { + if (options.es) + // HACK: spirv-cross changes bools into uints and generates code which compares them to + // zero. Input code will have already been validated as not to have contained any uints, + // so any remaining uints must in fact be bools. However, simply returning "bool" here + // will result in invalid code. Instead, return an int. + return backend.basic_int_type; + else + require_extension_internal("GL_EXT_gpu_shader4"); + } + + if (type.basetype == SPIRType::AtomicCounter) + { + if (options.es && options.version < 310) + SPIRV_CROSS_THROW("At least ESSL 3.10 required for atomic counters."); + else if (!options.es && options.version < 420) + require_extension_internal("GL_ARB_shader_atomic_counters"); + } + + if (type.op == OpTypeCooperativeVectorNV) + { + require_extension_internal("GL_NV_cooperative_vector"); + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Cooperative vector NV only available in Vulkan."); + + std::string component_type_str = type_to_glsl(get(type.ext.coopVecNV.component_type_id)); + + return join("coopvecNV<", component_type_str, ", ", to_expression(type.ext.coopVecNV.component_count_id), ">"); + } + + const SPIRType *coop_type = &type; + while (is_pointer(*coop_type) || is_array(*coop_type)) + coop_type = &get(coop_type->parent_type); + + if (coop_type->op == OpTypeCooperativeMatrixKHR) + { + require_extension_internal("GL_KHR_cooperative_matrix"); + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Cooperative matrix only available in Vulkan."); + // GLSL doesn't support this as spec constant, which makes sense ... + uint32_t use_type = get(coop_type->ext.cooperative.use_id).scalar(); + + const char *use = nullptr; + switch (use_type) + { + case CooperativeMatrixUseMatrixAKHR: + use = "gl_MatrixUseA"; + break; + + case CooperativeMatrixUseMatrixBKHR: + use = "gl_MatrixUseB"; + break; + + case CooperativeMatrixUseMatrixAccumulatorKHR: + use = "gl_MatrixUseAccumulator"; + break; + + default: + SPIRV_CROSS_THROW("Invalid matrix use."); + } + + string scope_expr; + if (const auto *scope = maybe_get(coop_type->ext.cooperative.scope_id)) + { + if (!scope->specialization) + { + require_extension_internal("GL_KHR_memory_scope_semantics"); + if (scope->scalar() == ScopeSubgroup) + scope_expr = "gl_ScopeSubgroup"; + else if (scope->scalar() == ScopeWorkgroup) + scope_expr = "gl_ScopeWorkgroup"; + else + SPIRV_CROSS_THROW("Invalid scope for cooperative matrix."); + } + } + + if (scope_expr.empty()) + scope_expr = to_expression(coop_type->ext.cooperative.scope_id); + + return join("coopmat<", type_to_glsl(get(coop_type->parent_type)), ", ", + scope_expr, ", ", + to_expression(coop_type->ext.cooperative.rows_id), ", ", + to_expression(coop_type->ext.cooperative.columns_id), ", ", use, ">"); + } + + if (type.vecsize == 1 && type.columns == 1) // Scalar builtin + { + switch (type.basetype) + { + case SPIRType::Boolean: + return "bool"; + case SPIRType::SByte: + return backend.basic_int8_type; + case SPIRType::UByte: + return backend.basic_uint8_type; + case SPIRType::Short: + return backend.basic_int16_type; + case SPIRType::UShort: + return backend.basic_uint16_type; + case SPIRType::Int: + return backend.basic_int_type; + case SPIRType::UInt: + return backend.basic_uint_type; + case SPIRType::AtomicCounter: + return "atomic_uint"; + case SPIRType::Half: + return "float16_t"; + case SPIRType::BFloat16: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("bfloat16 requires Vulkan semantics."); + require_extension_internal("GL_EXT_bfloat16"); + return "bfloat16_t"; + case SPIRType::FloatE4M3: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("floate4m3_t requires Vulkan semantics."); + require_extension_internal("GL_EXT_float_e4m3"); + return "floate4m3_t"; + case SPIRType::FloatE5M2: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("floate5m2_t requires Vulkan semantics."); + require_extension_internal("GL_EXT_float_e5m2"); + return "floate5m2_t"; + case SPIRType::Float: + return "float"; + case SPIRType::Double: + return "double"; + case SPIRType::Int64: + return "int64_t"; + case SPIRType::UInt64: + return "uint64_t"; + default: + return "???"; + } + } + else if (type.vecsize > 1 && type.columns == 1) // Vector builtin + { + switch (type.basetype) + { + case SPIRType::Boolean: + return join("bvec", type.vecsize); + case SPIRType::SByte: + return join("i8vec", type.vecsize); + case SPIRType::UByte: + return join("u8vec", type.vecsize); + case SPIRType::Short: + return join("i16vec", type.vecsize); + case SPIRType::UShort: + return join("u16vec", type.vecsize); + case SPIRType::Int: + return join("ivec", type.vecsize); + case SPIRType::UInt: + return join("uvec", type.vecsize); + case SPIRType::Half: + return join("f16vec", type.vecsize); + case SPIRType::BFloat16: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("bfloat16 requires Vulkan semantics."); + require_extension_internal("GL_EXT_bfloat16"); + return join("bf16vec", type.vecsize); + case SPIRType::FloatE4M3: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("floate4m3_t requires Vulkan semantics."); + require_extension_internal("GL_EXT_float_e4m3"); + return join("fe4m3vec", type.vecsize); + case SPIRType::FloatE5M2: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("floate5m2_t requires Vulkan semantics."); + require_extension_internal("GL_EXT_float_e5m2"); + return join("fe5m2vec", type.vecsize); + case SPIRType::Float: + return join("vec", type.vecsize); + case SPIRType::Double: + return join("dvec", type.vecsize); + case SPIRType::Int64: + return join("i64vec", type.vecsize); + case SPIRType::UInt64: + return join("u64vec", type.vecsize); + default: + return "???"; + } + } + else if (type.vecsize == type.columns) // Simple Matrix builtin + { + switch (type.basetype) + { + case SPIRType::Boolean: + return join("bmat", type.vecsize); + case SPIRType::Int: + return join("imat", type.vecsize); + case SPIRType::UInt: + return join("umat", type.vecsize); + case SPIRType::Half: + return join("f16mat", type.vecsize); + case SPIRType::Float: + return join("mat", type.vecsize); + case SPIRType::Double: + return join("dmat", type.vecsize); + // Matrix types not supported for int64/uint64. + default: + return "???"; + } + } + else + { + switch (type.basetype) + { + case SPIRType::Boolean: + return join("bmat", type.columns, "x", type.vecsize); + case SPIRType::Int: + return join("imat", type.columns, "x", type.vecsize); + case SPIRType::UInt: + return join("umat", type.columns, "x", type.vecsize); + case SPIRType::Half: + return join("f16mat", type.columns, "x", type.vecsize); + case SPIRType::Float: + return join("mat", type.columns, "x", type.vecsize); + case SPIRType::Double: + return join("dmat", type.columns, "x", type.vecsize); + // Matrix types not supported for int64/uint64. + default: + return "???"; + } + } +} + +void CompilerGLSL::add_variable(unordered_set &variables_primary, + const unordered_set &variables_secondary, string &name) +{ + if (name.empty()) + return; + + ParsedIR::sanitize_underscores(name); + if (ParsedIR::is_globally_reserved_identifier(name, true)) + { + name.clear(); + return; + } + + update_name_cache(variables_primary, variables_secondary, name); +} + +void CompilerGLSL::add_local_variable_name(uint32_t id) +{ + add_variable(local_variable_names, block_names, ir.meta[id].decoration.alias); +} + +void CompilerGLSL::add_resource_name(uint32_t id) +{ + add_variable(resource_names, block_names, ir.meta[id].decoration.alias); +} + +void CompilerGLSL::add_header_line(const std::string &line) +{ + header_lines.push_back(line); +} + +bool CompilerGLSL::has_extension(const std::string &ext) const +{ + auto itr = find(begin(forced_extensions), end(forced_extensions), ext); + return itr != end(forced_extensions); +} + +void CompilerGLSL::require_extension(const std::string &ext) +{ + if (!has_extension(ext)) + forced_extensions.push_back(ext); +} + +const SmallVector &CompilerGLSL::get_required_extensions() const +{ + return forced_extensions; +} + +void CompilerGLSL::require_extension_internal(const string &ext) +{ + if (backend.supports_extensions && !has_extension(ext)) + { + forced_extensions.push_back(ext); + force_recompile(); + } +} + +void CompilerGLSL::flatten_buffer_block(VariableID id) +{ + auto &var = get(id); + auto &type = get(var.basetype); + auto name = to_name(type.self, false); + auto &flags = get_decoration_bitset(type.self); + + if (!type.array.empty()) + SPIRV_CROSS_THROW(name + " is an array of UBOs."); + if (type.basetype != SPIRType::Struct) + SPIRV_CROSS_THROW(name + " is not a struct."); + if (!flags.get(DecorationBlock)) + SPIRV_CROSS_THROW(name + " is not a block."); + if (type.member_types.empty()) + SPIRV_CROSS_THROW(name + " is an empty struct."); + + flattened_buffer_blocks.insert(id); +} + +bool CompilerGLSL::builtin_translates_to_nonarray(BuiltIn /*builtin*/) const +{ + return false; // GLSL itself does not need to translate array builtin types to non-array builtin types +} + +bool CompilerGLSL::is_user_type_structured(uint32_t /*id*/) const +{ + return false; // GLSL itself does not have structured user type, but HLSL does with StructuredBuffer and RWStructuredBuffer resources. +} + +bool CompilerGLSL::check_atomic_image(uint32_t id) +{ + auto &type = expression_type(id); + if (type.storage == StorageClassImage) + { + if (options.es && options.version < 320) + require_extension_internal("GL_OES_shader_image_atomic"); + + auto *var = maybe_get_backing_variable(id); + if (var) + { + if (has_decoration(var->self, DecorationNonWritable) || has_decoration(var->self, DecorationNonReadable)) + { + unset_decoration(var->self, DecorationNonWritable); + unset_decoration(var->self, DecorationNonReadable); + force_recompile(); + } + } + return true; + } + else + return false; +} + +void CompilerGLSL::add_function_overload(const SPIRFunction &func) +{ + Hasher hasher; + for (auto &arg : func.arguments) + { + // Parameters can vary with pointer type or not, + // but that will not change the signature in GLSL/HLSL, + // so strip the pointer type before hashing. + uint32_t type_id = get_pointee_type_id(arg.type); + + // Workaround glslang bug. It seems to only consider the base type when resolving overloads. + if (get(type_id).op == OpTypeCooperativeMatrixKHR) + type_id = get(type_id).parent_type; + + auto &type = get(type_id); + + if (!combined_image_samplers.empty()) + { + // If we have combined image samplers, we cannot really trust the image and sampler arguments + // we pass down to callees, because they may be shuffled around. + // Ignore these arguments, to make sure that functions need to differ in some other way + // to be considered different overloads. + if (type.basetype == SPIRType::SampledImage || + (type.basetype == SPIRType::Image && type.image.sampled == 1) || type.basetype == SPIRType::Sampler) + { + continue; + } + } + + hasher.u32(type_id); + } + uint64_t types_hash = hasher.get(); + + auto function_name = to_name(func.self); + auto itr = function_overloads.find(function_name); + if (itr != end(function_overloads)) + { + // There exists a function with this name already. + auto &overloads = itr->second; + if (overloads.count(types_hash) != 0) + { + // Overload conflict, assign a new name. + add_resource_name(func.self); + function_overloads[to_name(func.self)].insert(types_hash); + } + else + { + // Can reuse the name. + overloads.insert(types_hash); + } + } + else + { + // First time we see this function name. + add_resource_name(func.self); + function_overloads[to_name(func.self)].insert(types_hash); + } +} + +void CompilerGLSL::emit_function_prototype(SPIRFunction &func, const Bitset &return_flags) +{ + if (func.self != ir.default_entry_point) + add_function_overload(func); + + // Avoid shadow declarations. + local_variable_names = resource_names; + + string decl; + + auto &type = get(func.return_type); + decl += flags_to_qualifiers_glsl(type, 0, return_flags); + decl += type_to_glsl(type); + decl += type_to_array_glsl(type, 0); + decl += " "; + + if (func.self == ir.default_entry_point) + { + // If we need complex fallback in GLSL, we just wrap main() in a function + // and interlock the entire shader ... + if (interlocked_is_complex) + decl += "spvMainInterlockedBody"; + else + decl += "main"; + + processing_entry_point = true; + } + else + decl += to_name(func.self); + + decl += "("; + SmallVector arglist; + for (auto &arg : func.arguments) + { + // Do not pass in separate images or samplers if we're remapping + // to combined image samplers. + if (skip_argument(arg.id)) + continue; + + // Might change the variable name if it already exists in this function. + // SPIRV OpName doesn't have any semantic effect, so it's valid for an implementation + // to use same name for variables. + // Since we want to make the GLSL debuggable and somewhat sane, use fallback names for variables which are duplicates. + add_local_variable_name(arg.id); + + arglist.push_back(argument_decl(arg)); + + // Hold a pointer to the parameter so we can invalidate the readonly field if needed. + auto *var = maybe_get(arg.id); + if (var) + var->parameter = &arg; + } + + for (auto &arg : func.shadow_arguments) + { + // Might change the variable name if it already exists in this function. + // SPIRV OpName doesn't have any semantic effect, so it's valid for an implementation + // to use same name for variables. + // Since we want to make the GLSL debuggable and somewhat sane, use fallback names for variables which are duplicates. + add_local_variable_name(arg.id); + + arglist.push_back(argument_decl(arg)); + + // Hold a pointer to the parameter so we can invalidate the readonly field if needed. + auto *var = maybe_get(arg.id); + if (var) + var->parameter = &arg; + } + + decl += merge(arglist); + decl += ")"; + statement(decl); +} + +void CompilerGLSL::emit_function(SPIRFunction &func, const Bitset &return_flags) +{ + // Avoid potential cycles. + if (func.active) + return; + func.active = true; + + // If we depend on a function, emit that function before we emit our own function. + for (auto block : func.blocks) + { + auto &b = get(block); + for (auto &i : b.ops) + { + auto ops = stream(i); + auto op = static_cast(i.op); + + if (op == OpFunctionCall) + { + // Recursively emit functions which are called. + uint32_t id = ops[2]; + + emit_function(get(id), ir.meta[ops[1]].decoration.decoration_flags); + } + } + } + + if (func.entry_line.file_id != 0) + emit_line_directive(func.entry_line.file_id, func.entry_line.line_literal); + emit_function_prototype(func, return_flags); + begin_scope(); + + if (func.self == ir.default_entry_point) + emit_entry_point_declarations(); + + current_function = &func; + auto &entry_block = get(func.entry_block); + + sort(begin(func.constant_arrays_needed_on_stack), end(func.constant_arrays_needed_on_stack)); + for (auto &array : func.constant_arrays_needed_on_stack) + { + auto &c = get(array); + auto &type = get(c.constant_type); + statement(variable_decl(type, join("_", array, "_array_copy")), " = ", constant_expression(c), ";"); + } + + for (auto &v : func.local_variables) + { + auto &var = get(v); + var.deferred_declaration = false; + if (var.storage == StorageClassTaskPayloadWorkgroupEXT) + continue; + + if (variable_decl_is_remapped_storage(var, StorageClassWorkgroup)) + { + // Special variable type which cannot have initializer, + // need to be declared as standalone variables. + // Comes from MSL which can push global variables as local variables in main function. + add_local_variable_name(var.self); + statement(variable_decl(var), ";"); + + // "Real" workgroup variables in compute shaders needs extra caretaking. + // They need to be initialized with an extra routine as they come in arbitrary form. + if (var.storage == StorageClassWorkgroup && var.initializer) + emit_workgroup_initialization(var); + + var.deferred_declaration = false; + } + else if (var.storage == StorageClassPrivate) + { + // These variables will not have had their CFG usage analyzed, so move it to the entry block. + // Comes from MSL which can push global variables as local variables in main function. + // We could just declare them right now, but we would miss out on an important initialization case which is + // LUT declaration in MSL. + // If we don't declare the variable when it is assigned we're forced to go through a helper function + // which copies elements one by one. + add_local_variable_name(var.self); + + if (var.initializer) + { + statement(variable_decl(var), ";"); + var.deferred_declaration = false; + } + else + { + auto &dominated = entry_block.dominated_variables; + if (find(begin(dominated), end(dominated), var.self) == end(dominated)) + entry_block.dominated_variables.push_back(var.self); + var.deferred_declaration = true; + } + } + else if (var.storage == StorageClassFunction && var.remapped_variable && var.static_expression) + { + // No need to declare this variable, it has a static expression. + var.deferred_declaration = false; + } + else if (expression_is_lvalue(v)) + { + add_local_variable_name(var.self); + + // Loop variables should never be declared early, they are explicitly emitted in a loop. + if (var.initializer && !var.loop_variable) + statement(variable_decl_function_local(var), ";"); + else + { + // Don't declare variable until first use to declutter the GLSL output quite a lot. + // If we don't touch the variable before first branch, + // declare it then since we need variable declaration to be in top scope. + var.deferred_declaration = true; + } + } + else + { + // HACK: SPIR-V in older glslang output likes to use samplers and images as local variables, but GLSL does not allow this. + // For these types (non-lvalue), we enforce forwarding through a shadowed variable. + // This means that when we OpStore to these variables, we just write in the expression ID directly. + // This breaks any kind of branching, since the variable must be statically assigned. + // Branching on samplers and images would be pretty much impossible to fake in GLSL. + var.statically_assigned = true; + } + + var.loop_variable_enable = false; + + // Loop variables are never declared outside their for-loop, so block any implicit declaration. + if (var.loop_variable) + { + var.deferred_declaration = false; + // Need to reset the static expression so we can fallback to initializer if need be. + var.static_expression = 0; + } + } + + // Enforce declaration order for regression testing purposes. + for (auto &block_id : func.blocks) + { + auto &block = get(block_id); + sort(begin(block.dominated_variables), end(block.dominated_variables)); + } + + for (auto &line : current_function->fixup_hooks_in) + line(); + + emit_block_chain(entry_block); + + end_scope(); + processing_entry_point = false; + statement(""); + + // Make sure deferred declaration state for local variables is cleared when we are done with function. + // We risk declaring Private/Workgroup variables in places we are not supposed to otherwise. + for (auto &v : func.local_variables) + { + auto &var = get(v); + var.deferred_declaration = false; + } +} + +void CompilerGLSL::emit_fixup() +{ + if (is_vertex_like_shader()) + { + if (options.vertex.fixup_clipspace) + { + const char *suffix = backend.float_literal_suffix ? "f" : ""; + statement("gl_Position.z = 2.0", suffix, " * gl_Position.z - gl_Position.w;"); + } + + if (options.vertex.flip_vert_y) + statement("gl_Position.y = -gl_Position.y;"); + } +} + +void CompilerGLSL::emit_workgroup_initialization(const SPIRVariable &) +{ +} + +void CompilerGLSL::flush_phi(BlockID from, BlockID to) +{ + auto &child = get(to); + if (child.ignore_phi_from_block == from) + return; + + unordered_set temporary_phi_variables; + + for (auto itr = begin(child.phi_variables); itr != end(child.phi_variables); ++itr) + { + auto &phi = *itr; + + if (phi.parent == from) + { + auto &var = get(phi.function_variable); + + // A Phi variable might be a loop variable, so flush to static expression. + if (var.loop_variable && !var.loop_variable_enable) + var.static_expression = phi.local_variable; + else + { + flush_variable_declaration(phi.function_variable); + + // Check if we are going to write to a Phi variable that another statement will read from + // as part of another Phi node in our target block. + // For this case, we will need to copy phi.function_variable to a temporary, and use that for future reads. + // This is judged to be extremely rare, so deal with it here using a simple, but suboptimal algorithm. + bool need_saved_temporary = + find_if(itr + 1, end(child.phi_variables), [&](const SPIRBlock::Phi &future_phi) -> bool { + return future_phi.local_variable == ID(phi.function_variable) && future_phi.parent == from; + }) != end(child.phi_variables); + + if (need_saved_temporary) + { + // Need to make sure we declare the phi variable with a copy at the right scope. + // We cannot safely declare a temporary here since we might be inside a continue block. + if (!var.allocate_temporary_copy) + { + var.allocate_temporary_copy = true; + force_recompile(); + } + statement("_", phi.function_variable, "_copy", " = ", to_name(phi.function_variable), ";"); + temporary_phi_variables.insert(phi.function_variable); + } + + // This might be called in continue block, so make sure we + // use this to emit ESSL 1.0 compliant increments/decrements. + auto lhs = to_expression(phi.function_variable); + + string rhs; + if (temporary_phi_variables.count(phi.local_variable)) + rhs = join("_", phi.local_variable, "_copy"); + else + rhs = to_pointer_expression(phi.local_variable); + + if (!optimize_read_modify_write(get(var.basetype), lhs, rhs)) + statement(lhs, " = ", rhs, ";"); + } + + register_write(phi.function_variable); + } + } +} + +void CompilerGLSL::branch_to_continue(BlockID from, BlockID to) +{ + auto &to_block = get(to); + if (from == to) + return; + + assert(is_continue(to)); + if (to_block.complex_continue) + { + // Just emit the whole block chain as is. + auto usage_counts = expression_usage_counts; + + emit_block_chain(to_block); + + // Expression usage counts are moot after returning from the continue block. + expression_usage_counts = usage_counts; + } + else + { + auto &from_block = get(from); + bool outside_control_flow = false; + uint32_t loop_dominator = 0; + + // FIXME: Refactor this to not use the old loop_dominator tracking. + if (from_block.merge_block) + { + // If we are a loop header, we don't set the loop dominator, + // so just use "self" here. + loop_dominator = from; + } + else if (from_block.loop_dominator != BlockID(SPIRBlock::NoDominator)) + { + loop_dominator = from_block.loop_dominator; + } + + if (loop_dominator != 0) + { + auto &cfg = get_cfg_for_current_function(); + + // For non-complex continue blocks, we implicitly branch to the continue block + // by having the continue block be part of the loop header in for (; ; continue-block). + outside_control_flow = cfg.node_terminates_control_flow_in_sub_graph(loop_dominator, from); + } + + // Some simplification for for-loops. We always end up with a useless continue; + // statement since we branch to a loop block. + // Walk the CFG, if we unconditionally execute the block calling continue assuming we're in the loop block, + // we can avoid writing out an explicit continue statement. + // Similar optimization to return statements if we know we're outside flow control. + if (!outside_control_flow) + statement("continue;"); + } +} + +void CompilerGLSL::branch(BlockID from, BlockID to) +{ + flush_phi(from, to); + flush_control_dependent_expressions(from); + + bool to_is_continue = is_continue(to); + + // This is only a continue if we branch to our loop dominator. + if ((ir.block_meta[to] & ParsedIR::BLOCK_META_LOOP_HEADER_BIT) != 0 && get(from).loop_dominator == to) + { + // This can happen if we had a complex continue block which was emitted. + // Once the continue block tries to branch to the loop header, just emit continue; + // and end the chain here. + statement("continue;"); + } + else if (from != to && is_break(to)) + { + // We cannot break to ourselves, so check explicitly for from != to. + // This case can trigger if a loop header is all three of these things: + // - Continue block + // - Loop header + // - Break merge target all at once ... + + // Very dirty workaround. + // Switch constructs are able to break, but they cannot break out of a loop at the same time, + // yet SPIR-V allows it. + // Only sensible solution is to make a ladder variable, which we declare at the top of the switch block, + // write to the ladder here, and defer the break. + // The loop we're breaking out of must dominate the switch block, or there is no ladder breaking case. + if (is_loop_break(to)) + { + for (size_t n = current_emitting_switch_stack.size(); n; n--) + { + auto *current_emitting_switch = current_emitting_switch_stack[n - 1]; + + if (current_emitting_switch && + current_emitting_switch->loop_dominator != BlockID(SPIRBlock::NoDominator) && + get(current_emitting_switch->loop_dominator).merge_block == to) + { + if (!current_emitting_switch->need_ladder_break) + { + force_recompile(); + current_emitting_switch->need_ladder_break = true; + } + + statement("_", current_emitting_switch->self, "_ladder_break = true;"); + } + else + break; + } + } + statement("break;"); + } + else if (to_is_continue || from == to) + { + // For from == to case can happen for a do-while loop which branches into itself. + // We don't mark these cases as continue blocks, but the only possible way to branch into + // ourselves is through means of continue blocks. + + // If we are merging to a continue block, there is no need to emit the block chain for continue here. + // We can branch to the continue block after we merge execution. + + // Here we make use of structured control flow rules from spec: + // 2.11: - the merge block declared by a header block cannot be a merge block declared by any other header block + // - each header block must strictly dominate its merge block, unless the merge block is unreachable in the CFG + // If we are branching to a merge block, we must be inside a construct which dominates the merge block. + auto &block_meta = ir.block_meta[to]; + bool branching_to_merge = + (block_meta & (ParsedIR::BLOCK_META_SELECTION_MERGE_BIT | ParsedIR::BLOCK_META_MULTISELECT_MERGE_BIT | + ParsedIR::BLOCK_META_LOOP_MERGE_BIT)) != 0; + if (!to_is_continue || !branching_to_merge) + branch_to_continue(from, to); + } + else if (!is_conditional(to)) + emit_block_chain(get(to)); + + // It is important that we check for break before continue. + // A block might serve two purposes, a break block for the inner scope, and + // a continue block in the outer scope. + // Inner scope always takes precedence. +} + +void CompilerGLSL::branch(BlockID from, uint32_t cond, BlockID true_block, BlockID false_block) +{ + auto &from_block = get(from); + BlockID merge_block = from_block.merge == SPIRBlock::MergeSelection ? from_block.next_block : BlockID(0); + + // If we branch directly to our selection merge target, we don't need a code path. + bool true_block_needs_code = true_block != merge_block || flush_phi_required(from, true_block); + bool false_block_needs_code = false_block != merge_block || flush_phi_required(from, false_block); + + if (!true_block_needs_code && !false_block_needs_code) + return; + + // We might have a loop merge here. Only consider selection flattening constructs. + // Loop hints are handled explicitly elsewhere. + if (from_block.hint == SPIRBlock::HintFlatten || from_block.hint == SPIRBlock::HintDontFlatten) + emit_block_hints(from_block); + + if (true_block_needs_code) + { + statement("if (", to_expression(cond), ")"); + begin_scope(); + branch(from, true_block); + end_scope(); + + if (false_block_needs_code) + { + statement("else"); + begin_scope(); + branch(from, false_block); + end_scope(); + } + } + else if (false_block_needs_code) + { + // Only need false path, use negative conditional. + statement("if (!", to_enclosed_expression(cond), ")"); + begin_scope(); + branch(from, false_block); + end_scope(); + } +} + +// FIXME: This currently cannot handle complex continue blocks +// as in do-while. +// This should be seen as a "trivial" continue block. +string CompilerGLSL::emit_continue_block(uint32_t continue_block, bool follow_true_block, bool follow_false_block) +{ + auto *block = &get(continue_block); + + // While emitting the continue block, declare_temporary will check this + // if we have to emit temporaries. + current_continue_block = block; + + SmallVector statements; + + // Capture all statements into our list. + auto *old = redirect_statement; + redirect_statement = &statements; + + // Stamp out all blocks one after each other. + while ((ir.block_meta[block->self] & ParsedIR::BLOCK_META_LOOP_HEADER_BIT) == 0) + { + // Write out all instructions we have in this block. + emit_block_instructions(*block); + + // For plain branchless for/while continue blocks. + if (block->next_block) + { + flush_phi(continue_block, block->next_block); + block = &get(block->next_block); + } + // For do while blocks. The last block will be a select block. + else if (block->true_block && follow_true_block) + { + flush_phi(continue_block, block->true_block); + block = &get(block->true_block); + } + else if (block->false_block && follow_false_block) + { + flush_phi(continue_block, block->false_block); + block = &get(block->false_block); + } + else + { + SPIRV_CROSS_THROW("Invalid continue block detected!"); + } + } + + // Restore old pointer. + redirect_statement = old; + + // Somewhat ugly, strip off the last ';' since we use ',' instead. + // Ideally, we should select this behavior in statement(). + for (auto &s : statements) + { + if (!s.empty() && s.back() == ';') + s.erase(s.size() - 1, 1); + } + + current_continue_block = nullptr; + return merge(statements); +} + +void CompilerGLSL::emit_while_loop_initializers(const SPIRBlock &block) +{ + // While loops do not take initializers, so declare all of them outside. + for (auto &loop_var : block.loop_variables) + { + auto &var = get(loop_var); + statement(variable_decl(var), ";"); + } +} + +string CompilerGLSL::emit_for_loop_initializers(const SPIRBlock &block) +{ + if (block.loop_variables.empty()) + return ""; + + bool same_types = for_loop_initializers_are_same_type(block); + // We can only declare for loop initializers if all variables are of same type. + // If we cannot do this, declare individual variables before the loop header. + + // We might have a loop variable candidate which was not assigned to for some reason. + uint32_t missing_initializers = 0; + for (auto &variable : block.loop_variables) + { + uint32_t expr = get(variable).static_expression; + + // Sometimes loop variables are initialized with OpUndef, but we can just declare + // a plain variable without initializer in this case. + if (expr == 0 || ir.ids[expr].get_type() == TypeUndef) + missing_initializers++; + } + + if (block.loop_variables.size() == 1 && missing_initializers == 0) + { + return variable_decl(get(block.loop_variables.front())); + } + else if (!same_types || missing_initializers == uint32_t(block.loop_variables.size())) + { + for (auto &loop_var : block.loop_variables) + statement(variable_decl(get(loop_var)), ";"); + return ""; + } + else + { + // We have a mix of loop variables, either ones with a clear initializer, or ones without. + // Separate the two streams. + string expr; + + for (auto &loop_var : block.loop_variables) + { + uint32_t static_expr = get(loop_var).static_expression; + if (static_expr == 0 || ir.ids[static_expr].get_type() == TypeUndef) + { + statement(variable_decl(get(loop_var)), ";"); + } + else + { + auto &var = get(loop_var); + auto &type = get_variable_data_type(var); + if (expr.empty()) + { + // For loop initializers are of the form (block.true_block), get(block.merge_block))) + condition = join("!", enclose_expression(condition)); + + statement("while (", condition, ")"); + break; + } + + default: + block.disable_block_optimization = true; + force_recompile(); + begin_scope(); // We'll see an end_scope() later. + return false; + } + + begin_scope(); + return true; + } + else + { + block.disable_block_optimization = true; + force_recompile(); + begin_scope(); // We'll see an end_scope() later. + return false; + } + } + else if (method == SPIRBlock::MergeToDirectForLoop) + { + auto &child = get(block.next_block); + + // This block may be a dominating block, so make sure we flush undeclared variables before building the for loop header. + flush_undeclared_variables(child); + + uint32_t current_count = statement_count; + + // If we're trying to create a true for loop, + // we need to make sure that all opcodes before branch statement do not actually emit any code. + // We can then take the condition expression and create a for (; cond ; ) { body; } structure instead. + emit_block_instructions_with_masked_debug(child); + + bool condition_is_temporary = forced_temporaries.find(child.condition) == end(forced_temporaries); + + bool flushes_phi = flush_phi_required(child.self, child.true_block) || + flush_phi_required(child.self, child.false_block); + + if (!flushes_phi && current_count == statement_count && condition_is_temporary) + { + uint32_t target_block = child.true_block; + + switch (continue_type) + { + case SPIRBlock::ForLoop: + { + // Important that we do this in this order because + // emitting the continue block can invalidate the condition expression. + auto initializer = emit_for_loop_initializers(block); + auto condition = to_expression(child.condition); + + // Condition might have to be inverted. + if (execution_is_noop(get(child.true_block), get(block.merge_block))) + { + condition = join("!", enclose_expression(condition)); + target_block = child.false_block; + } + + auto continue_block = emit_continue_block(block.continue_block, false, false); + emit_block_hints(block); + statement("for (", initializer, "; ", condition, "; ", continue_block, ")"); + break; + } + + case SPIRBlock::WhileLoop: + { + emit_while_loop_initializers(block); + emit_block_hints(block); + + auto condition = to_expression(child.condition); + // Condition might have to be inverted. + if (execution_is_noop(get(child.true_block), get(block.merge_block))) + { + condition = join("!", enclose_expression(condition)); + target_block = child.false_block; + } + + statement("while (", condition, ")"); + break; + } + + default: + block.disable_block_optimization = true; + force_recompile(); + begin_scope(); // We'll see an end_scope() later. + return false; + } + + begin_scope(); + branch(child.self, target_block); + return true; + } + else + { + block.disable_block_optimization = true; + force_recompile(); + begin_scope(); // We'll see an end_scope() later. + return false; + } + } + else + return false; +} + +void CompilerGLSL::flush_undeclared_variables(SPIRBlock &block) +{ + for (auto &v : block.dominated_variables) + flush_variable_declaration(v); +} + +void CompilerGLSL::emit_hoisted_temporaries(SmallVector> &temporaries) +{ + // If we need to force temporaries for certain IDs due to continue blocks, do it before starting loop header. + // Need to sort these to ensure that reference output is stable. + sort(begin(temporaries), end(temporaries), + [](const pair &a, const pair &b) { return a.second < b.second; }); + + for (auto &tmp : temporaries) + { + auto &type = get(tmp.first); + + // There are some rare scenarios where we are asked to declare pointer types as hoisted temporaries. + // This should be ignored unless we're doing actual variable pointers and backend supports it. + // Access chains cannot normally be lowered to temporaries in GLSL and HLSL. + if (type.pointer && !backend.native_pointers) + continue; + + add_local_variable_name(tmp.second); + auto &flags = get_decoration_bitset(tmp.second); + + // Not all targets support pointer literals, so don't bother with that case. + string initializer; + if (options.force_zero_initialized_variables && type_can_zero_initialize(type)) + initializer = join(" = ", to_zero_initialized_expression(tmp.first)); + + statement(flags_to_qualifiers_glsl(type, tmp.second, flags), variable_decl(type, to_name(tmp.second)), initializer, ";"); + + hoisted_temporaries.insert(tmp.second); + forced_temporaries.insert(tmp.second); + + // The temporary might be read from before it's assigned, set up the expression now. + set(tmp.second, to_name(tmp.second), tmp.first, true); + + // If we have hoisted temporaries in multi-precision contexts, emit that here too ... + // We will not be able to analyze hoisted-ness for dependent temporaries that we hallucinate here. + auto mirrored_precision_itr = temporary_to_mirror_precision_alias.find(tmp.second); + if (mirrored_precision_itr != temporary_to_mirror_precision_alias.end()) + { + uint32_t mirror_id = mirrored_precision_itr->second; + auto &mirror_flags = get_decoration_bitset(mirror_id); + statement(flags_to_qualifiers_glsl(type, mirror_id, mirror_flags), + variable_decl(type, to_name(mirror_id)), + initializer, ";"); + // The temporary might be read from before it's assigned, set up the expression now. + set(mirror_id, to_name(mirror_id), tmp.first, true); + hoisted_temporaries.insert(mirror_id); + } + } +} + +void CompilerGLSL::emit_block_chain(SPIRBlock &block) +{ + SmallVector cleanup_stack; + BlockID next_block = emit_block_chain_inner(block); + + while (next_block != 0) + { + cleanup_stack.push_back(next_block); + next_block = emit_block_chain_inner(get(next_block)); + } + + while (!cleanup_stack.empty()) + { + emit_block_chain_cleanup(get(cleanup_stack.back())); + cleanup_stack.pop_back(); + } + + emit_block_chain_cleanup(block); +} + +BlockID CompilerGLSL::emit_block_chain_inner(SPIRBlock &block) +{ + bool select_branch_to_true_block = false; + bool select_branch_to_false_block = false; + bool skip_direct_branch = false; + bool emitted_loop_header_variables = false; + bool force_complex_continue_block = false; + ValueSaver loop_level_saver(current_loop_level); + + if (block.merge == SPIRBlock::MergeLoop) + add_loop_level(); + + // If we're emitting PHI variables with precision aliases, we have to emit them as hoisted temporaries. + for (auto var_id : block.dominated_variables) + { + auto &var = get(var_id); + if (var.phi_variable) + { + auto mirrored_precision_itr = temporary_to_mirror_precision_alias.find(var_id); + if (mirrored_precision_itr != temporary_to_mirror_precision_alias.end() && + find_if(block.declare_temporary.begin(), block.declare_temporary.end(), + [mirrored_precision_itr](const std::pair &p) { + return p.second == mirrored_precision_itr->second; + }) == block.declare_temporary.end()) + { + block.declare_temporary.push_back({ var.basetype, mirrored_precision_itr->second }); + } + } + } + + emit_hoisted_temporaries(block.declare_temporary); + + SPIRBlock::ContinueBlockType continue_type = SPIRBlock::ContinueNone; + if (block.continue_block) + { + continue_type = continue_block_type(get(block.continue_block)); + // If we know we cannot emit a loop, mark the block early as a complex loop so we don't force unnecessary recompiles. + if (continue_type == SPIRBlock::ComplexLoop) + block.complex_continue = true; + } + + // If we have loop variables, stop masking out access to the variable now. + for (auto var_id : block.loop_variables) + { + auto &var = get(var_id); + var.loop_variable_enable = true; + // We're not going to declare the variable directly, so emit a copy here. + emit_variable_temporary_copies(var); + } + + // Remember deferred declaration state. We will restore it before returning. + assert(block.rearm_dominated_variables.empty()); + block.rearm_dominated_variables.resize(block.dominated_variables.size()); + for (size_t i = 0; i < block.dominated_variables.size(); i++) + { + uint32_t var_id = block.dominated_variables[i]; + auto &var = get(var_id); + block.rearm_dominated_variables[i] = var.deferred_declaration; + } + + // This is the method often used by spirv-opt to implement loops. + // The loop header goes straight into the continue block. + // However, don't attempt this on ESSL 1.0, because if a loop variable is used in a continue block, + // it *MUST* be used in the continue block. This loop method will not work. + if (!is_legacy_es() && block_is_loop_candidate(block, SPIRBlock::MergeToSelectContinueForLoop)) + { + flush_undeclared_variables(block); + if (attempt_emit_loop_header(block, SPIRBlock::MergeToSelectContinueForLoop)) + { + if (execution_is_noop(get(block.true_block), get(block.merge_block))) + select_branch_to_false_block = true; + else + select_branch_to_true_block = true; + + emitted_loop_header_variables = true; + force_complex_continue_block = true; + } + } + // This is the older loop behavior in glslang which branches to loop body directly from the loop header. + else if (block_is_loop_candidate(block, SPIRBlock::MergeToSelectForLoop)) + { + flush_undeclared_variables(block); + if (attempt_emit_loop_header(block, SPIRBlock::MergeToSelectForLoop)) + { + // The body of while, is actually just the true (or false) block, so always branch there unconditionally. + if (execution_is_noop(get(block.true_block), get(block.merge_block))) + select_branch_to_false_block = true; + else + select_branch_to_true_block = true; + + emitted_loop_header_variables = true; + } + } + // This is the newer loop behavior in glslang which branches from Loop header directly to + // a new block, which in turn has a OpBranchSelection without a selection merge. + else if (block_is_loop_candidate(block, SPIRBlock::MergeToDirectForLoop)) + { + flush_undeclared_variables(block); + if (attempt_emit_loop_header(block, SPIRBlock::MergeToDirectForLoop)) + { + skip_direct_branch = true; + emitted_loop_header_variables = true; + } + } + else if (continue_type == SPIRBlock::DoWhileLoop) + { + flush_undeclared_variables(block); + emit_while_loop_initializers(block); + emitted_loop_header_variables = true; + // We have some temporaries where the loop header is the dominator. + // We risk a case where we have code like: + // for (;;) { create-temporary; break; } consume-temporary; + // so force-declare temporaries here. + emit_hoisted_temporaries(block.potential_declare_temporary); + statement("do"); + begin_scope(); + + emit_block_instructions(block); + } + else if (block.merge == SPIRBlock::MergeLoop) + { + flush_undeclared_variables(block); + emit_while_loop_initializers(block); + emitted_loop_header_variables = true; + + // We have a generic loop without any distinguishable pattern like for, while or do while. + get(block.continue_block).complex_continue = true; + continue_type = SPIRBlock::ComplexLoop; + + // We have some temporaries where the loop header is the dominator. + // We risk a case where we have code like: + // for (;;) { create-temporary; break; } consume-temporary; + // so force-declare temporaries here. + emit_hoisted_temporaries(block.potential_declare_temporary); + emit_block_hints(block); + statement("for (;;)"); + begin_scope(); + + emit_block_instructions(block); + } + else + { + emit_block_instructions(block); + } + + // If we didn't successfully emit a loop header and we had loop variable candidates, we have a problem + // as writes to said loop variables might have been masked out, we need a recompile. + if (!emitted_loop_header_variables && !block.loop_variables.empty()) + { + force_recompile_guarantee_forward_progress(); + for (auto var : block.loop_variables) + get(var).loop_variable = false; + block.loop_variables.clear(); + } + + flush_undeclared_variables(block); + bool emit_next_block = true; + + // Handle end of block. + switch (block.terminator) + { + case SPIRBlock::Direct: + // True when emitting complex continue block. + if (block.loop_dominator == block.next_block) + { + branch(block.self, block.next_block); + emit_next_block = false; + } + // True if MergeToDirectForLoop succeeded. + else if (skip_direct_branch) + emit_next_block = false; + else if (is_continue(block.next_block) || is_break(block.next_block) || is_conditional(block.next_block)) + { + branch(block.self, block.next_block); + emit_next_block = false; + } + break; + + case SPIRBlock::Select: + // True if MergeToSelectForLoop or MergeToSelectContinueForLoop succeeded. + if (select_branch_to_true_block) + { + if (force_complex_continue_block) + { + assert(block.true_block == block.continue_block); + + // We're going to emit a continue block directly here, so make sure it's marked as complex. + auto &complex_continue = get(block.continue_block).complex_continue; + bool old_complex = complex_continue; + complex_continue = true; + branch(block.self, block.true_block); + complex_continue = old_complex; + } + else + branch(block.self, block.true_block); + } + else if (select_branch_to_false_block) + { + if (force_complex_continue_block) + { + assert(block.false_block == block.continue_block); + + // We're going to emit a continue block directly here, so make sure it's marked as complex. + auto &complex_continue = get(block.continue_block).complex_continue; + bool old_complex = complex_continue; + complex_continue = true; + branch(block.self, block.false_block); + complex_continue = old_complex; + } + else + branch(block.self, block.false_block); + } + else + branch(block.self, block.condition, block.true_block, block.false_block); + break; + + case SPIRBlock::MultiSelect: + { + auto &type = expression_type(block.condition); + bool unsigned_case = type.basetype == SPIRType::UInt || type.basetype == SPIRType::UShort || + type.basetype == SPIRType::UByte || type.basetype == SPIRType::UInt64; + + if (block.merge == SPIRBlock::MergeNone) + SPIRV_CROSS_THROW("Switch statement is not structured"); + + if (!backend.support_64bit_switch && (type.basetype == SPIRType::UInt64 || type.basetype == SPIRType::Int64)) + { + // SPIR-V spec suggests this is allowed, but we cannot support it in higher level languages. + SPIRV_CROSS_THROW("Cannot use 64-bit switch selectors."); + } + + const char *label_suffix = ""; + if (type.basetype == SPIRType::UInt && backend.uint32_t_literal_suffix) + label_suffix = "u"; + else if (type.basetype == SPIRType::Int64 && backend.support_64bit_switch) + label_suffix = "l"; + else if (type.basetype == SPIRType::UInt64 && backend.support_64bit_switch) + label_suffix = "ul"; + else if (type.basetype == SPIRType::UShort) + label_suffix = backend.uint16_t_literal_suffix; + else if (type.basetype == SPIRType::Short) + label_suffix = backend.int16_t_literal_suffix; + + current_emitting_switch_stack.push_back(&block); + + if (block.need_ladder_break) + statement("bool _", block.self, "_ladder_break = false;"); + + // Find all unique case constructs. + unordered_map> case_constructs; + SmallVector block_declaration_order; + SmallVector literals_to_merge; + + // If a switch case branches to the default block for some reason, we can just remove that literal from consideration + // and let the default: block handle it. + // 2.11 in SPIR-V spec states that for fall-through cases, there is a very strict declaration order which we can take advantage of here. + // We only need to consider possible fallthrough if order[i] branches to order[i + 1]. + auto &cases = get_case_list(block); + for (auto &c : cases) + { + if (c.block != block.next_block && c.block != block.default_block) + { + if (!case_constructs.count(c.block)) + block_declaration_order.push_back(c.block); + case_constructs[c.block].push_back(c.value); + } + else if (c.block == block.next_block && block.default_block != block.next_block) + { + // We might have to flush phi inside specific case labels. + // If we can piggyback on default:, do so instead. + literals_to_merge.push_back(c.value); + } + } + + // Empty literal array -> default. + if (block.default_block != block.next_block) + { + auto &default_block = get(block.default_block); + + // We need to slide in the default block somewhere in this chain + // if there are fall-through scenarios since the default is declared separately in OpSwitch. + // Only consider trivial fall-through cases here. + size_t num_blocks = block_declaration_order.size(); + bool injected_block = false; + + for (size_t i = 0; i < num_blocks; i++) + { + auto &case_block = get(block_declaration_order[i]); + if (execution_is_direct_branch(case_block, default_block)) + { + // Fallthrough to default block, we must inject the default block here. + block_declaration_order.insert(begin(block_declaration_order) + i + 1, block.default_block); + injected_block = true; + break; + } + else if (execution_is_direct_branch(default_block, case_block)) + { + // Default case is falling through to another case label, we must inject the default block here. + block_declaration_order.insert(begin(block_declaration_order) + i, block.default_block); + injected_block = true; + break; + } + } + + // Order does not matter. + if (!injected_block) + block_declaration_order.push_back(block.default_block); + else if (is_legacy_es()) + SPIRV_CROSS_THROW("Default case label fallthrough to other case label is not supported in ESSL 1.0."); + + case_constructs[block.default_block] = {}; + } + + size_t num_blocks = block_declaration_order.size(); + + const auto to_case_label = [](uint64_t literal, uint32_t width, bool is_unsigned_case) -> string + { + if (is_unsigned_case) + return convert_to_string(literal); + + // For smaller cases, the literals are compiled as 32 bit wide + // literals so we don't need to care for all sizes specifically. + if (width <= 32) + { + return convert_to_string(int64_t(int32_t(literal))); + } + + return convert_to_string(int64_t(literal)); + }; + + const auto to_legacy_case_label = [&](uint32_t condition, const SmallVector &labels, + const char *suffix) -> string { + string ret; + size_t count = labels.size(); + for (size_t i = 0; i < count; i++) + { + if (i) + ret += " || "; + ret += join(count > 1 ? "(" : "", to_enclosed_expression(condition), " == ", labels[i], suffix, + count > 1 ? ")" : ""); + } + return ret; + }; + + // We need to deal with a complex scenario for OpPhi. If we have case-fallthrough and Phi in the picture, + // we need to flush phi nodes outside the switch block in a branch, + // and skip any Phi handling inside the case label to make fall-through work as expected. + // This kind of code-gen is super awkward and it's a last resort. Normally we would want to handle this + // inside the case label if at all possible. + for (size_t i = 1; backend.support_case_fallthrough && i < num_blocks; i++) + { + if (flush_phi_required(block.self, block_declaration_order[i]) && + flush_phi_required(block_declaration_order[i - 1], block_declaration_order[i])) + { + uint32_t target_block = block_declaration_order[i]; + + // Make sure we flush Phi, it might have been marked to be ignored earlier. + get(target_block).ignore_phi_from_block = 0; + + auto &literals = case_constructs[target_block]; + + if (literals.empty()) + { + // Oh boy, gotta make a complete negative test instead! o.o + // Find all possible literals that would *not* make us enter the default block. + // If none of those literals match, we flush Phi ... + SmallVector conditions; + for (size_t j = 0; j < num_blocks; j++) + { + auto &negative_literals = case_constructs[block_declaration_order[j]]; + for (auto &case_label : negative_literals) + conditions.push_back(join(to_enclosed_expression(block.condition), + " != ", to_case_label(case_label, type.width, unsigned_case))); + } + + statement("if (", merge(conditions, " && "), ")"); + begin_scope(); + flush_phi(block.self, target_block); + end_scope(); + } + else + { + SmallVector conditions; + conditions.reserve(literals.size()); + for (auto &case_label : literals) + conditions.push_back(join(to_enclosed_expression(block.condition), + " == ", to_case_label(case_label, type.width, unsigned_case))); + statement("if (", merge(conditions, " || "), ")"); + begin_scope(); + flush_phi(block.self, target_block); + end_scope(); + } + + // Mark the block so that we don't flush Phi from header to case label. + get(target_block).ignore_phi_from_block = block.self; + } + } + + // If there is only one default block, and no cases, this is a case where SPIRV-opt decided to emulate + // non-structured exits with the help of a switch block. + // This is buggy on FXC, so just emit the logical equivalent of a do { } while(false), which is more idiomatic. + bool block_like_switch = cases.empty(); + + // If this is true, the switch is completely meaningless, and we should just avoid it. + bool collapsed_switch = block_like_switch && block.default_block == block.next_block; + + if (!collapsed_switch) + { + if (block_like_switch || is_legacy()) + { + // ESSL 1.0 is not guaranteed to support do/while. + if (is_legacy_es()) + { + uint32_t counter = statement_count; + statement("for (int spvDummy", counter, " = 0; spvDummy", counter, " < 1; spvDummy", counter, + "++)"); + } + else + statement("do"); + } + else + { + emit_block_hints(block); + statement("switch (", to_unpacked_expression(block.condition), ")"); + } + begin_scope(); + } + + for (size_t i = 0; i < num_blocks; i++) + { + uint32_t target_block = block_declaration_order[i]; + auto &literals = case_constructs[target_block]; + + if (literals.empty()) + { + // Default case. + if (!block_like_switch) + { + if (is_legacy()) + statement("else"); + else + statement("default:"); + } + } + else + { + if (is_legacy()) + { + statement((i ? "else " : ""), "if (", to_legacy_case_label(block.condition, literals, label_suffix), + ")"); + } + else + { + for (auto &case_literal : literals) + { + // The case label value must be sign-extended properly in SPIR-V, so we can assume 32-bit values here. + statement("case ", to_case_label(case_literal, type.width, unsigned_case), label_suffix, ":"); + } + } + } + + auto &case_block = get(target_block); + if (backend.support_case_fallthrough && i + 1 < num_blocks && + execution_is_direct_branch(case_block, get(block_declaration_order[i + 1]))) + { + // We will fall through here, so just terminate the block chain early. + // We still need to deal with Phi potentially. + // No need for a stack-like thing here since we only do fall-through when there is a + // single trivial branch to fall-through target.. + current_emitting_switch_fallthrough = true; + } + else + current_emitting_switch_fallthrough = false; + + if (!block_like_switch) + begin_scope(); + branch(block.self, target_block); + if (!block_like_switch) + end_scope(); + + current_emitting_switch_fallthrough = false; + } + + // Might still have to flush phi variables if we branch from loop header directly to merge target. + // This is supposed to emit all cases where we branch from header to merge block directly. + // There are two main scenarios where cannot rely on default fallthrough. + // - There is an explicit default: label already. + // In this case, literals_to_merge need to form their own "default" case, so that we avoid executing that block. + // - Header -> Merge requires flushing PHI. In this case, we need to collect all cases and flush PHI there. + bool header_merge_requires_phi = flush_phi_required(block.self, block.next_block); + bool need_fallthrough_block = block.default_block == block.next_block || !literals_to_merge.empty(); + if (!collapsed_switch && ((header_merge_requires_phi && need_fallthrough_block) || !literals_to_merge.empty())) + { + for (auto &case_literal : literals_to_merge) + statement("case ", to_case_label(case_literal, type.width, unsigned_case), label_suffix, ":"); + + if (block.default_block == block.next_block) + { + if (is_legacy()) + statement("else"); + else + statement("default:"); + } + + begin_scope(); + flush_phi(block.self, block.next_block); + statement("break;"); + end_scope(); + } + + if (!collapsed_switch) + { + if ((block_like_switch || is_legacy()) && !is_legacy_es()) + end_scope_decl("while(false)"); + else + end_scope(); + } + else + flush_phi(block.self, block.next_block); + + if (block.need_ladder_break) + { + statement("if (_", block.self, "_ladder_break)"); + begin_scope(); + statement("break;"); + end_scope(); + } + + current_emitting_switch_stack.pop_back(); + break; + } + + case SPIRBlock::Return: + { + for (auto &line : current_function->fixup_hooks_out) + line(); + + if (processing_entry_point) + emit_fixup(); + + auto &cfg = get_cfg_for_current_function(); + + if (block.return_value) + { + auto &type = expression_type(block.return_value); + if (!type.array.empty() && !backend.can_return_array) + { + // If we cannot return arrays, we will have a special out argument we can write to instead. + // The backend is responsible for setting this up, and redirection the return values as appropriate. + if (ir.ids[block.return_value].get_type() != TypeUndef) + { + emit_array_copy("spvReturnValue", 0, block.return_value, StorageClassFunction, + get_expression_effective_storage_class(block.return_value)); + } + + if (!cfg.node_terminates_control_flow_in_sub_graph(current_function->entry_block, block.self) || + block.loop_dominator != BlockID(SPIRBlock::NoDominator)) + { + statement("return;"); + } + } + else + { + // OpReturnValue can return Undef, so don't emit anything for this case. + if (ir.ids[block.return_value].get_type() != TypeUndef) + statement("return ", to_unpacked_expression(block.return_value), ";"); + } + } + else if (!cfg.node_terminates_control_flow_in_sub_graph(current_function->entry_block, block.self) || + block.loop_dominator != BlockID(SPIRBlock::NoDominator)) + { + // If this block is the very final block and not called from control flow, + // we do not need an explicit return which looks out of place. Just end the function here. + // In the very weird case of for(;;) { return; } executing return is unconditional, + // but we actually need a return here ... + statement("return;"); + } + break; + } + + // If the Kill is terminating a block with a (probably synthetic) return value, emit a return value statement. + case SPIRBlock::Kill: + statement(backend.discard_literal, ";"); + if (block.return_value) + statement("return ", to_unpacked_expression(block.return_value), ";"); + break; + + case SPIRBlock::Unreachable: + { + // If the entry point ends with unreachable and has a return value, insert a return + // statement to avoid potential compiler errors from non-void functions without a return value. + if (block.return_value) + { + statement("return ", to_unpacked_expression(block.return_value), ";"); + break; + } + + // Avoid emitting false fallthrough, which can happen for + // if (cond) break; else discard; inside a case label. + // Discard is not always implementable as a terminator. + + auto &cfg = get_cfg_for_current_function(); + bool inner_dominator_is_switch = false; + ID id = block.self; + + while (id) + { + auto &iter_block = get(id); + if (iter_block.terminator == SPIRBlock::MultiSelect || + iter_block.merge == SPIRBlock::MergeLoop) + { + ID next_block = iter_block.merge == SPIRBlock::MergeLoop ? + iter_block.merge_block : iter_block.next_block; + bool outside_construct = next_block && cfg.find_common_dominator(next_block, block.self) == next_block; + if (!outside_construct) + { + inner_dominator_is_switch = iter_block.terminator == SPIRBlock::MultiSelect; + break; + } + } + + if (cfg.get_preceding_edges(id).empty()) + break; + + id = cfg.get_immediate_dominator(id); + } + + if (inner_dominator_is_switch) + statement("break; // unreachable workaround"); + + emit_next_block = false; + break; + } + + case SPIRBlock::IgnoreIntersection: + statement("ignoreIntersectionEXT;"); + break; + + case SPIRBlock::TerminateRay: + statement("terminateRayEXT;"); + break; + + case SPIRBlock::EmitMeshTasks: + emit_mesh_tasks(block); + break; + + default: + SPIRV_CROSS_THROW("Unimplemented block terminator."); + } + + BlockID trailing_block_id = 0; + + if (block.next_block && emit_next_block) + { + // If we hit this case, we're dealing with an unconditional branch, which means we will output + // that block after this. If we had selection merge, we already flushed phi variables. + if (block.merge != SPIRBlock::MergeSelection) + { + flush_phi(block.self, block.next_block); + + // For a direct branch, need to remember to invalidate expressions in the next linear block instead. + get(block.next_block).invalidate_expressions.clear(); + std::swap(get(block.next_block).invalidate_expressions, block.invalidate_expressions); + } + + // For switch fallthrough cases, we terminate the chain here, but we still need to handle Phi. + if (!current_emitting_switch_fallthrough) + { + // For merge selects we might have ignored the fact that a merge target + // could have been a break; or continue; + // We will need to deal with it here. + if (is_loop_break(block.next_block)) + { + // Cannot check for just break, because switch statements will also use break. + assert(block.merge == SPIRBlock::MergeSelection); + statement("break;"); + } + else if (is_continue(block.next_block)) + { + assert(block.merge == SPIRBlock::MergeSelection); + branch_to_continue(block.self, block.next_block); + } + else if (BlockID(block.self) != block.next_block) + { + // Recursing here is quite scary since it's quite easy to stack overflow if + // the SPIR-V is constructed a particular way. + // We have to simulate the tail call ourselves. + if (block.merge != SPIRBlock::MergeLoop) + trailing_block_id = block.next_block; + else + emit_block_chain(get(block.next_block)); + } + } + } + + if (block.merge == SPIRBlock::MergeLoop) + { + if (continue_type == SPIRBlock::DoWhileLoop) + { + // Make sure that we run the continue block to get the expressions set, but this + // should become an empty string. + // We have no fallbacks if we cannot forward everything to temporaries ... + const auto &continue_block = get(block.continue_block); + bool positive_test = execution_is_noop(get(continue_block.true_block), + get(continue_block.loop_dominator)); + + uint32_t current_count = statement_count; + auto statements = emit_continue_block(block.continue_block, positive_test, !positive_test); + if (statement_count != current_count) + { + // The DoWhile block has side effects, force ComplexLoop pattern next pass. + get(block.continue_block).complex_continue = true; + force_recompile(); + } + + // Might have to invert the do-while test here. + auto condition = to_expression(continue_block.condition); + if (!positive_test) + condition = join("!", enclose_expression(condition)); + + end_scope_decl(join("while (", condition, ")")); + } + else + end_scope(); + + loop_level_saver.release(); + + // We cannot break out of two loops at once, so don't check for break; here. + // Using block.self as the "from" block isn't quite right, but it has the same scope + // and dominance structure, so it's fine. + if (is_continue(block.merge_block)) + branch_to_continue(block.self, block.merge_block); + else + trailing_block_id = block.merge_block; + } + + return trailing_block_id; +} + +void CompilerGLSL::emit_block_chain_cleanup(SPIRBlock &block) +{ + // Forget about control dependent expressions now. + block.invalidate_expressions.clear(); + + // After we return, we must be out of scope, so if we somehow have to re-emit this block, + // re-declare variables if necessary. + // We only need one array here for rearm_dominated_variables, + // since it should be impossible for the same block to be remitted in the same chain twice. + assert(block.rearm_dominated_variables.size() == block.dominated_variables.size()); + for (size_t i = 0; i < block.dominated_variables.size(); i++) + { + uint32_t var = block.dominated_variables[i]; + get(var).deferred_declaration = block.rearm_dominated_variables[i]; + } + block.rearm_dominated_variables.clear(); + + // Just like for deferred declaration, we need to forget about loop variable enable + // if our block chain is reinstantiated later. + for (auto &var_id : block.loop_variables) + get(var_id).loop_variable_enable = false; +} + +void CompilerGLSL::begin_scope() +{ + statement("{"); + indent++; +} + +void CompilerGLSL::end_scope() +{ + if (!indent) + SPIRV_CROSS_THROW("Popping empty indent stack."); + indent--; + statement("}"); +} + +void CompilerGLSL::end_scope(const string &trailer) +{ + if (!indent) + SPIRV_CROSS_THROW("Popping empty indent stack."); + indent--; + statement("}", trailer); +} + +void CompilerGLSL::end_scope_decl() +{ + if (!indent) + SPIRV_CROSS_THROW("Popping empty indent stack."); + indent--; + statement("};"); +} + +void CompilerGLSL::end_scope_decl(const string &decl) +{ + if (!indent) + SPIRV_CROSS_THROW("Popping empty indent stack."); + indent--; + statement("} ", decl, ";"); +} + +void CompilerGLSL::check_function_call_constraints(const uint32_t *args, uint32_t length) +{ + // If our variable is remapped, and we rely on type-remapping information as + // well, then we cannot pass the variable as a function parameter. + // Fixing this is non-trivial without stamping out variants of the same function, + // so for now warn about this and suggest workarounds instead. + for (uint32_t i = 0; i < length; i++) + { + auto *var = maybe_get(args[i]); + if (!var || !var->remapped_variable) + continue; + + auto &type = get(var->basetype); + if (type.basetype == SPIRType::Image && type.image.dim == DimSubpassData) + { + SPIRV_CROSS_THROW("Tried passing a remapped subpassInput variable to a function. " + "This will not work correctly because type-remapping information is lost. " + "To workaround, please consider not passing the subpass input as a function parameter, " + "or use in/out variables instead which do not need type remapping information."); + } + } +} + +const Instruction *CompilerGLSL::get_next_instruction_in_block(const Instruction &instr) +{ + // FIXME: This is kind of hacky. There should be a cleaner way. + auto offset = uint32_t(&instr - current_emitting_block->ops.data()); + if ((offset + 1) < current_emitting_block->ops.size()) + return ¤t_emitting_block->ops[offset + 1]; + else + return nullptr; +} + +uint32_t CompilerGLSL::mask_relevant_memory_semantics(uint32_t semantics) +{ + return semantics & (MemorySemanticsAtomicCounterMemoryMask | MemorySemanticsImageMemoryMask | + MemorySemanticsWorkgroupMemoryMask | MemorySemanticsUniformMemoryMask | + MemorySemanticsCrossWorkgroupMemoryMask | MemorySemanticsSubgroupMemoryMask); +} + +bool CompilerGLSL::emit_array_copy(const char *expr, uint32_t lhs_id, uint32_t rhs_id, StorageClass, StorageClass) +{ + string lhs; + if (expr) + lhs = expr; + else + lhs = to_expression(lhs_id); + + statement(lhs, " = ", to_expression(rhs_id), ";"); + return true; +} + +bool CompilerGLSL::unroll_array_to_complex_store(uint32_t target_id, uint32_t source_id) +{ + if (!backend.force_gl_in_out_block) + return false; + // This path is only relevant for GL backends. + + auto *var = maybe_get(target_id); + if (!var || var->storage != StorageClassOutput) + return false; + + if (!is_builtin_variable(*var) || BuiltIn(get_decoration(var->self, DecorationBuiltIn)) != BuiltInSampleMask) + return false; + + auto &type = expression_type(source_id); + string array_expr; + if (type.array_size_literal.back()) + { + array_expr = convert_to_string(type.array.back()); + if (type.array.back() == 0) + SPIRV_CROSS_THROW("Cannot unroll an array copy from unsized array."); + } + else + array_expr = to_expression(type.array.back()); + + SPIRType target_type { OpTypeInt }; + target_type.basetype = SPIRType::Int; + + statement("for (int i = 0; i < int(", array_expr, "); i++)"); + begin_scope(); + statement(to_expression(target_id), "[i] = ", + bitcast_expression(target_type, type.basetype, join(to_expression(source_id), "[i]")), + ";"); + end_scope(); + + return true; +} + +void CompilerGLSL::unroll_array_from_complex_load(uint32_t target_id, uint32_t source_id, std::string &expr) +{ + if (!backend.force_gl_in_out_block) + return; + // This path is only relevant for GL backends. + + auto *var = maybe_get(source_id); + if (!var) + return; + + if (var->storage != StorageClassInput && var->storage != StorageClassOutput) + return; + + auto &type = get_variable_data_type(*var); + if (type.array.empty()) + return; + + auto builtin = BuiltIn(get_decoration(var->self, DecorationBuiltIn)); + bool is_builtin = is_builtin_variable(*var) && + (builtin == BuiltInPointSize || + builtin == BuiltInPosition || + builtin == BuiltInSampleMask); + bool is_tess = is_tessellation_shader(); + bool is_patch = has_decoration(var->self, DecorationPatch); + bool is_sample_mask = is_builtin && builtin == BuiltInSampleMask; + + // Tessellation input arrays are special in that they are unsized, so we cannot directly copy from it. + // We must unroll the array load. + // For builtins, we couldn't catch this case normally, + // because this is resolved in the OpAccessChain in most cases. + // If we load the entire array, we have no choice but to unroll here. + if (!is_patch && (is_builtin || is_tess)) + { + auto new_expr = join("_", target_id, "_unrolled"); + statement(variable_decl(type, new_expr, target_id), ";"); + string array_expr; + if (type.array_size_literal.back()) + { + array_expr = convert_to_string(type.array.back()); + if (type.array.back() == 0) + SPIRV_CROSS_THROW("Cannot unroll an array copy from unsized array."); + } + else + array_expr = to_expression(type.array.back()); + + // The array size might be a specialization constant, so use a for-loop instead. + statement("for (int i = 0; i < int(", array_expr, "); i++)"); + begin_scope(); + if (is_builtin && !is_sample_mask) + statement(new_expr, "[i] = gl_in[i].", expr, ";"); + else if (is_sample_mask) + { + SPIRType target_type { OpTypeInt }; + target_type.basetype = SPIRType::Int; + statement(new_expr, "[i] = ", bitcast_expression(target_type, type.basetype, join(expr, "[i]")), ";"); + } + else + statement(new_expr, "[i] = ", expr, "[i];"); + end_scope(); + + expr = std::move(new_expr); + } +} + +void CompilerGLSL::cast_from_variable_load(uint32_t source_id, std::string &expr, const SPIRType &expr_type) +{ + // We will handle array cases elsewhere. + if (!expr_type.array.empty()) + return; + + auto *var = maybe_get_backing_variable(source_id); + if (var) + source_id = var->self; + + // Only interested in standalone builtin variables. + if (!has_decoration(source_id, DecorationBuiltIn)) + { + // Except for int attributes in legacy GLSL, which are cast from float. + if (is_legacy() && expr_type.basetype == SPIRType::Int && var && var->storage == StorageClassInput) + expr = join(type_to_glsl(expr_type), "(", expr, ")"); + return; + } + + auto builtin = static_cast(get_decoration(source_id, DecorationBuiltIn)); + auto expected_type = expr_type.basetype; + + // TODO: Fill in for more builtins. + switch (builtin) + { + case BuiltInLayer: + case BuiltInPrimitiveId: + case BuiltInViewportIndex: + case BuiltInInstanceId: + case BuiltInInstanceIndex: + case BuiltInVertexId: + case BuiltInVertexIndex: + case BuiltInSampleId: + case BuiltInBaseVertex: + case BuiltInBaseInstance: + case BuiltInDrawIndex: + case BuiltInFragStencilRefEXT: + case BuiltInInstanceCustomIndexNV: + case BuiltInSampleMask: + case BuiltInPrimitiveShadingRateKHR: + case BuiltInShadingRateKHR: + expected_type = SPIRType::Int; + break; + + case BuiltInGlobalInvocationId: + case BuiltInLocalInvocationId: + case BuiltInWorkgroupId: + case BuiltInLocalInvocationIndex: + case BuiltInWorkgroupSize: + case BuiltInNumWorkgroups: + case BuiltInIncomingRayFlagsNV: + case BuiltInLaunchIdNV: + case BuiltInLaunchSizeNV: + case BuiltInPrimitiveTriangleIndicesEXT: + case BuiltInPrimitiveLineIndicesEXT: + case BuiltInPrimitivePointIndicesEXT: + expected_type = SPIRType::UInt; + break; + + default: + break; + } + + if (expected_type != expr_type.basetype) + expr = bitcast_expression(expr_type, expected_type, expr); +} + +SPIRType::BaseType CompilerGLSL::get_builtin_basetype(BuiltIn builtin, SPIRType::BaseType default_type) +{ + // TODO: Fill in for more builtins. + switch (builtin) + { + case BuiltInLayer: + case BuiltInPrimitiveId: + case BuiltInViewportIndex: + case BuiltInFragStencilRefEXT: + case BuiltInSampleMask: + case BuiltInPrimitiveShadingRateKHR: + case BuiltInShadingRateKHR: + return SPIRType::Int; + + default: + return default_type; + } +} + +void CompilerGLSL::cast_to_variable_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type) +{ + auto *var = maybe_get_backing_variable(target_id); + if (var) + target_id = var->self; + + // Only interested in standalone builtin variables. + if (!has_decoration(target_id, DecorationBuiltIn)) + return; + + auto builtin = static_cast(get_decoration(target_id, DecorationBuiltIn)); + auto expected_type = get_builtin_basetype(builtin, expr_type.basetype); + + if (expected_type != expr_type.basetype) + { + auto type = expr_type; + type.basetype = expected_type; + expr = bitcast_expression(type, expr_type.basetype, expr); + } +} + +void CompilerGLSL::convert_non_uniform_expression(string &expr, uint32_t ptr_id) +{ + if (*backend.nonuniform_qualifier == '\0') + return; + + auto *var = maybe_get_backing_variable(ptr_id); + if (!var) + return; + + if (var->storage != StorageClassUniformConstant && + var->storage != StorageClassStorageBuffer && + var->storage != StorageClassUniform) + return; + + auto &backing_type = get(var->basetype); + if (backing_type.array.empty()) + return; + + // If we get here, we know we're accessing an arrayed resource which + // might require nonuniform qualifier. + + auto start_array_index = expr.find_first_of('['); + + if (start_array_index == string::npos) + return; + + // We've opened a bracket, track expressions until we can close the bracket. + // This must be our resource index. + size_t end_array_index = string::npos; + unsigned bracket_count = 1; + for (size_t index = start_array_index + 1; index < expr.size(); index++) + { + if (expr[index] == ']') + { + if (--bracket_count == 0) + { + end_array_index = index; + break; + } + } + else if (expr[index] == '[') + bracket_count++; + } + + assert(bracket_count == 0); + + // Doesn't really make sense to declare a non-arrayed image with nonuniformEXT, but there's + // nothing we can do here to express that. + if (start_array_index == string::npos || end_array_index == string::npos || end_array_index < start_array_index) + return; + + start_array_index++; + + expr = join(expr.substr(0, start_array_index), backend.nonuniform_qualifier, "(", + expr.substr(start_array_index, end_array_index - start_array_index), ")", + expr.substr(end_array_index, string::npos)); +} + +void CompilerGLSL::emit_block_hints(const SPIRBlock &block) +{ + if ((options.es && options.version < 310) || (!options.es && options.version < 140)) + return; + + switch (block.hint) + { + case SPIRBlock::HintFlatten: + require_extension_internal("GL_EXT_control_flow_attributes"); + statement("SPIRV_CROSS_FLATTEN"); + break; + case SPIRBlock::HintDontFlatten: + require_extension_internal("GL_EXT_control_flow_attributes"); + statement("SPIRV_CROSS_BRANCH"); + break; + case SPIRBlock::HintUnroll: + require_extension_internal("GL_EXT_control_flow_attributes"); + statement("SPIRV_CROSS_UNROLL"); + break; + case SPIRBlock::HintDontUnroll: + require_extension_internal("GL_EXT_control_flow_attributes"); + statement("SPIRV_CROSS_LOOP"); + break; + default: + break; + } +} + +void CompilerGLSL::preserve_alias_on_reset(uint32_t id) +{ + preserved_aliases[id] = get_name(id); +} + +void CompilerGLSL::reset_name_caches() +{ + for (auto &preserved : preserved_aliases) + set_name(preserved.first, preserved.second); + + preserved_aliases.clear(); + resource_names.clear(); + block_input_names.clear(); + block_output_names.clear(); + block_ubo_names.clear(); + block_ssbo_names.clear(); + block_names.clear(); + function_overloads.clear(); +} + +void CompilerGLSL::fixup_anonymous_struct_names(std::unordered_set &visited, const SPIRType &type) +{ + if (visited.count(type.self)) + return; + visited.insert(type.self); + + for (uint32_t i = 0; i < uint32_t(type.member_types.size()); i++) + { + auto &mbr_type = get(type.member_types[i]); + + if (mbr_type.basetype == SPIRType::Struct) + { + // If there are multiple aliases, the output might be somewhat unpredictable, + // but the only real alternative in that case is to do nothing, which isn't any better. + // This check should be fine in practice. + if (get_name(mbr_type.self).empty() && !get_member_name(type.self, i).empty()) + { + auto anon_name = join("anon_", get_member_name(type.self, i)); + ParsedIR::sanitize_underscores(anon_name); + set_name(mbr_type.self, anon_name); + } + + fixup_anonymous_struct_names(visited, mbr_type); + } + } +} + +void CompilerGLSL::fixup_anonymous_struct_names() +{ + // HLSL codegen can often end up emitting anonymous structs inside blocks, which + // breaks GL linking since all names must match ... + // Try to emit sensible code, so attempt to find such structs and emit anon_$member. + + // Breaks exponential explosion with weird type trees. + std::unordered_set visited; + + ir.for_each_typed_id([&](uint32_t, SPIRType &type) { + if (type.basetype == SPIRType::Struct && + (has_decoration(type.self, DecorationBlock) || + has_decoration(type.self, DecorationBufferBlock))) + { + fixup_anonymous_struct_names(visited, type); + } + }); +} + +void CompilerGLSL::fixup_type_alias() +{ + // Due to how some backends work, the "master" type of type_alias must be a block-like type if it exists. + ir.for_each_typed_id([&](uint32_t self, SPIRType &type) { + if (!type.type_alias) + return; + + if (has_decoration(type.self, DecorationBlock) || has_decoration(type.self, DecorationBufferBlock)) + { + // Top-level block types should never alias anything else. + type.type_alias = 0; + } + else if (type_is_block_like(type) && type.self == ID(self)) + { + // A block-like type is any type which contains Offset decoration, but not top-level blocks, + // i.e. blocks which are placed inside buffers. + // Become the master. + ir.for_each_typed_id([&](uint32_t other_id, SPIRType &other_type) { + if (other_id == self) + return; + + if (other_type.type_alias == type.type_alias) + other_type.type_alias = self; + }); + + this->get(type.type_alias).type_alias = self; + type.type_alias = 0; + } + }); +} + +void CompilerGLSL::reorder_type_alias() +{ + // Reorder declaration of types so that the master of the type alias is always emitted first. + // We need this in case a type B depends on type A (A must come before in the vector), but A is an alias of a type Abuffer, which + // means declaration of A doesn't happen (yet), and order would be B, ABuffer and not ABuffer, B. Fix this up here. + auto loop_lock = ir.create_loop_hard_lock(); + + auto &type_ids = ir.ids_for_type[TypeType]; + for (auto alias_itr = begin(type_ids); alias_itr != end(type_ids); ++alias_itr) + { + auto &type = get(*alias_itr); + if (type.type_alias != TypeID(0) && + !has_extended_decoration(type.type_alias, SPIRVCrossDecorationBufferBlockRepacked)) + { + // We will skip declaring this type, so make sure the type_alias type comes before. + auto master_itr = find(begin(type_ids), end(type_ids), ID(type.type_alias)); + assert(master_itr != end(type_ids)); + + if (alias_itr < master_itr) + { + // Must also swap the type order for the constant-type joined array. + auto &joined_types = ir.ids_for_constant_undef_or_type; + auto alt_alias_itr = find(begin(joined_types), end(joined_types), *alias_itr); + auto alt_master_itr = find(begin(joined_types), end(joined_types), *master_itr); + assert(alt_alias_itr != end(joined_types)); + assert(alt_master_itr != end(joined_types)); + + swap(*alias_itr, *master_itr); + swap(*alt_alias_itr, *alt_master_itr); + } + } + } +} + +void CompilerGLSL::emit_line_directive(uint32_t file_id, uint32_t line_literal) +{ + // If we are redirecting statements, ignore the line directive. + // Common case here is continue blocks. + if (redirect_statement) + return; + + // If we're emitting code in a sensitive context such as condition blocks in for loops, don't emit + // any line directives, because it's not possible. + if (block_debug_directives) + return; + + if (options.emit_line_directives) + { + require_extension_internal("GL_GOOGLE_cpp_style_line_directive"); + statement_no_indent("#line ", line_literal, " \"", get(file_id).str, "\""); + } +} + +void CompilerGLSL::emit_non_semantic_shader_debug_info(uint32_t, uint32_t result_id, uint32_t eop, + const uint32_t *args, uint32_t) +{ + if (!options.emit_line_directives) + return; + + switch (eop) + { + case SPIRExtension::DebugLine: + { + // We're missing line end and columns here, but I don't think we can emit those in any meaningful way. + emit_line_directive(args[0], get(args[1]).scalar()); + break; + } + + case SPIRExtension::DebugSource: + { + // Forward the string declaration here. We ignore the optional text operand. + auto &str = get(args[0]).str; + set(result_id, str); + break; + } + + default: + break; + } +} + +void CompilerGLSL::emit_copy_logical_type(uint32_t lhs_id, uint32_t lhs_type_id, uint32_t rhs_id, uint32_t rhs_type_id, + SmallVector chain) +{ + // Fully unroll all member/array indices one by one. + + auto &lhs_type = get(lhs_type_id); + auto &rhs_type = get(rhs_type_id); + + if (!lhs_type.array.empty()) + { + // Could use a loop here to support specialization constants, but it gets rather complicated with nested array types, + // and this is a rather obscure opcode anyways, keep it simple unless we are forced to. + uint32_t array_size = to_array_size_literal(lhs_type); + chain.push_back(0); + + for (uint32_t i = 0; i < array_size; i++) + { + chain.back() = i; + emit_copy_logical_type(lhs_id, lhs_type.parent_type, rhs_id, rhs_type.parent_type, chain); + } + } + else if (lhs_type.basetype == SPIRType::Struct) + { + chain.push_back(0); + uint32_t member_count = uint32_t(lhs_type.member_types.size()); + for (uint32_t i = 0; i < member_count; i++) + { + chain.back() = i; + emit_copy_logical_type(lhs_id, lhs_type.member_types[i], rhs_id, rhs_type.member_types[i], chain); + } + } + else + { + // Need to handle unpack/packing fixups since this can differ wildly between the logical types, + // particularly in MSL. + // To deal with this, we emit access chains and go through emit_store_statement + // to deal with all the special cases we can encounter. + + AccessChainMeta lhs_meta, rhs_meta; + auto lhs = access_chain_internal(lhs_id, chain.data(), uint32_t(chain.size()), + ACCESS_CHAIN_INDEX_IS_LITERAL_BIT, &lhs_meta); + auto rhs = access_chain_internal(rhs_id, chain.data(), uint32_t(chain.size()), + ACCESS_CHAIN_INDEX_IS_LITERAL_BIT, &rhs_meta); + + uint32_t id = ir.increase_bound_by(2); + lhs_id = id; + rhs_id = id + 1; + + { + auto &lhs_expr = set(lhs_id, std::move(lhs), lhs_type_id, true); + lhs_expr.need_transpose = lhs_meta.need_transpose; + + if (lhs_meta.storage_is_packed) + set_extended_decoration(lhs_id, SPIRVCrossDecorationPhysicalTypePacked); + if (lhs_meta.storage_physical_type != 0) + set_extended_decoration(lhs_id, SPIRVCrossDecorationPhysicalTypeID, lhs_meta.storage_physical_type); + + forwarded_temporaries.insert(lhs_id); + suppressed_usage_tracking.insert(lhs_id); + } + + { + auto &rhs_expr = set(rhs_id, std::move(rhs), rhs_type_id, true); + rhs_expr.need_transpose = rhs_meta.need_transpose; + + if (rhs_meta.storage_is_packed) + set_extended_decoration(rhs_id, SPIRVCrossDecorationPhysicalTypePacked); + if (rhs_meta.storage_physical_type != 0) + set_extended_decoration(rhs_id, SPIRVCrossDecorationPhysicalTypeID, rhs_meta.storage_physical_type); + + forwarded_temporaries.insert(rhs_id); + suppressed_usage_tracking.insert(rhs_id); + } + + emit_store_statement(lhs_id, rhs_id); + } +} + +bool CompilerGLSL::subpass_input_is_framebuffer_fetch(uint32_t id) const +{ + if (!has_decoration(id, DecorationInputAttachmentIndex)) + return false; + + uint32_t input_attachment_index = get_decoration(id, DecorationInputAttachmentIndex); + for (auto &remap : subpass_to_framebuffer_fetch_attachment) + if (remap.first == input_attachment_index) + return true; + + return false; +} + +const SPIRVariable *CompilerGLSL::find_subpass_input_by_attachment_index(uint32_t index) const +{ + const SPIRVariable *ret = nullptr; + ir.for_each_typed_id([&](uint32_t, const SPIRVariable &var) { + if (has_decoration(var.self, DecorationInputAttachmentIndex) && + get_decoration(var.self, DecorationInputAttachmentIndex) == index) + { + ret = &var; + } + }); + return ret; +} + +const SPIRVariable *CompilerGLSL::find_color_output_by_location(uint32_t location) const +{ + const SPIRVariable *ret = nullptr; + ir.for_each_typed_id([&](uint32_t, const SPIRVariable &var) { + if (var.storage == StorageClassOutput && get_decoration(var.self, DecorationLocation) == location) + ret = &var; + }); + return ret; +} + +void CompilerGLSL::emit_inout_fragment_outputs_copy_to_subpass_inputs() +{ + for (auto &remap : subpass_to_framebuffer_fetch_attachment) + { + auto *subpass_var = find_subpass_input_by_attachment_index(remap.first); + auto *output_var = find_color_output_by_location(remap.second); + if (!subpass_var) + continue; + if (!output_var) + SPIRV_CROSS_THROW("Need to declare the corresponding fragment output variable to be able " + "to read from it."); + if (is_array(get(output_var->basetype))) + SPIRV_CROSS_THROW("Cannot use GL_EXT_shader_framebuffer_fetch with arrays of color outputs."); + + auto &func = get(get_entry_point().self); + func.fixup_hooks_in.push_back([=]() { + if (is_legacy()) + { + statement(to_expression(subpass_var->self), " = ", "gl_LastFragData[", + get_decoration(output_var->self, DecorationLocation), "];"); + } + else + { + uint32_t num_rt_components = this->get(output_var->basetype).vecsize; + statement(to_expression(subpass_var->self), vector_swizzle(num_rt_components, 0), " = ", + to_expression(output_var->self), ";"); + } + }); + } +} + +bool CompilerGLSL::variable_is_depth_or_compare(VariableID id) const +{ + return is_depth_image(get(get(id).basetype), id); +} + +const char *CompilerGLSL::ShaderSubgroupSupportHelper::get_extension_name(Candidate c) +{ + static const char *const retval[CandidateCount] = { "GL_KHR_shader_subgroup_ballot", + "GL_KHR_shader_subgroup_basic", + "GL_KHR_shader_subgroup_vote", + "GL_KHR_shader_subgroup_arithmetic", + "GL_NV_gpu_shader_5", + "GL_NV_shader_thread_group", + "GL_NV_shader_thread_shuffle", + "GL_ARB_shader_ballot", + "GL_ARB_shader_group_vote", + "GL_AMD_gcn_shader" }; + return retval[c]; +} + +SmallVector CompilerGLSL::ShaderSubgroupSupportHelper::get_extra_required_extension_names(Candidate c) +{ + switch (c) + { + case ARB_shader_ballot: + return { "GL_ARB_shader_int64" }; + case AMD_gcn_shader: + return { "GL_AMD_gpu_shader_int64", "GL_NV_gpu_shader5" }; + default: + return {}; + } +} + +const char *CompilerGLSL::ShaderSubgroupSupportHelper::get_extra_required_extension_predicate(Candidate c) +{ + switch (c) + { + case ARB_shader_ballot: + return "defined(GL_ARB_shader_int64)"; + case AMD_gcn_shader: + return "(defined(GL_AMD_gpu_shader_int64) || defined(GL_NV_gpu_shader5))"; + default: + return ""; + } +} + +CompilerGLSL::ShaderSubgroupSupportHelper::FeatureVector CompilerGLSL::ShaderSubgroupSupportHelper:: + get_feature_dependencies(Feature feature) +{ + switch (feature) + { + case SubgroupAllEqualT: + return { SubgroupBroadcast_First, SubgroupAll_Any_AllEqualBool }; + case SubgroupElect: + return { SubgroupBallotFindLSB_MSB, SubgroupBallot, SubgroupInvocationID }; + case SubgroupInverseBallot_InclBitCount_ExclBitCout: + return { SubgroupMask }; + case SubgroupBallotBitCount: + return { SubgroupBallot }; + case SubgroupArithmeticIAddReduce: + case SubgroupArithmeticIAddInclusiveScan: + case SubgroupArithmeticFAddReduce: + case SubgroupArithmeticFAddInclusiveScan: + case SubgroupArithmeticIMulReduce: + case SubgroupArithmeticIMulInclusiveScan: + case SubgroupArithmeticFMulReduce: + case SubgroupArithmeticFMulInclusiveScan: + return { SubgroupSize, SubgroupBallot, SubgroupBallotBitCount, SubgroupMask, SubgroupBallotBitExtract }; + case SubgroupArithmeticIAddExclusiveScan: + case SubgroupArithmeticFAddExclusiveScan: + case SubgroupArithmeticIMulExclusiveScan: + case SubgroupArithmeticFMulExclusiveScan: + return { SubgroupSize, SubgroupBallot, SubgroupBallotBitCount, + SubgroupMask, SubgroupElect, SubgroupBallotBitExtract }; + default: + return {}; + } +} + +CompilerGLSL::ShaderSubgroupSupportHelper::FeatureMask CompilerGLSL::ShaderSubgroupSupportHelper:: + get_feature_dependency_mask(Feature feature) +{ + return build_mask(get_feature_dependencies(feature)); +} + +bool CompilerGLSL::ShaderSubgroupSupportHelper::can_feature_be_implemented_without_extensions(Feature feature) +{ + static const bool retval[FeatureCount] = { + false, false, false, false, false, false, + true, // SubgroupBalloFindLSB_MSB + false, false, false, false, + true, // SubgroupMemBarrier - replaced with workgroup memory barriers + false, false, true, false, + false, false, false, false, false, false, // iadd, fadd + false, false, false, false, false, false, // imul , fmul + }; + + return retval[feature]; +} + +CompilerGLSL::ShaderSubgroupSupportHelper::Candidate CompilerGLSL::ShaderSubgroupSupportHelper:: + get_KHR_extension_for_feature(Feature feature) +{ + static const Candidate extensions[FeatureCount] = { + KHR_shader_subgroup_ballot, KHR_shader_subgroup_basic, KHR_shader_subgroup_basic, KHR_shader_subgroup_basic, + KHR_shader_subgroup_basic, KHR_shader_subgroup_ballot, KHR_shader_subgroup_ballot, KHR_shader_subgroup_vote, + KHR_shader_subgroup_vote, KHR_shader_subgroup_basic, KHR_shader_subgroup_basic, KHR_shader_subgroup_basic, + KHR_shader_subgroup_ballot, KHR_shader_subgroup_ballot, KHR_shader_subgroup_ballot, KHR_shader_subgroup_ballot, + KHR_shader_subgroup_arithmetic, KHR_shader_subgroup_arithmetic, KHR_shader_subgroup_arithmetic, + KHR_shader_subgroup_arithmetic, KHR_shader_subgroup_arithmetic, KHR_shader_subgroup_arithmetic, + KHR_shader_subgroup_arithmetic, KHR_shader_subgroup_arithmetic, KHR_shader_subgroup_arithmetic, + KHR_shader_subgroup_arithmetic, KHR_shader_subgroup_arithmetic, KHR_shader_subgroup_arithmetic, + }; + + return extensions[feature]; +} + +void CompilerGLSL::ShaderSubgroupSupportHelper::request_feature(Feature feature) +{ + feature_mask |= (FeatureMask(1) << feature) | get_feature_dependency_mask(feature); +} + +bool CompilerGLSL::ShaderSubgroupSupportHelper::is_feature_requested(Feature feature) const +{ + return (feature_mask & (1u << feature)) != 0; +} + +CompilerGLSL::ShaderSubgroupSupportHelper::Result CompilerGLSL::ShaderSubgroupSupportHelper::resolve() const +{ + Result res; + + for (uint32_t i = 0u; i < FeatureCount; ++i) + { + if (feature_mask & (1u << i)) + { + auto feature = static_cast(i); + std::unordered_set unique_candidates; + + auto candidates = get_candidates_for_feature(feature); + unique_candidates.insert(candidates.begin(), candidates.end()); + + auto deps = get_feature_dependencies(feature); + for (Feature d : deps) + { + candidates = get_candidates_for_feature(d); + if (!candidates.empty()) + unique_candidates.insert(candidates.begin(), candidates.end()); + } + + for (uint32_t c : unique_candidates) + ++res.weights[static_cast(c)]; + } + } + + return res; +} + +CompilerGLSL::ShaderSubgroupSupportHelper::CandidateVector CompilerGLSL::ShaderSubgroupSupportHelper:: + get_candidates_for_feature(Feature ft, const Result &r) +{ + auto c = get_candidates_for_feature(ft); + auto cmp = [&r](Candidate a, Candidate b) { + if (r.weights[a] == r.weights[b]) + return a < b; // Prefer candidates with lower enum value + return r.weights[a] > r.weights[b]; + }; + std::sort(c.begin(), c.end(), cmp); + return c; +} + +CompilerGLSL::ShaderSubgroupSupportHelper::CandidateVector CompilerGLSL::ShaderSubgroupSupportHelper:: + get_candidates_for_feature(Feature feature) +{ + switch (feature) + { + case SubgroupMask: + return { KHR_shader_subgroup_ballot, NV_shader_thread_group, ARB_shader_ballot }; + case SubgroupSize: + return { KHR_shader_subgroup_basic, NV_shader_thread_group, AMD_gcn_shader, ARB_shader_ballot }; + case SubgroupInvocationID: + return { KHR_shader_subgroup_basic, NV_shader_thread_group, ARB_shader_ballot }; + case SubgroupID: + return { KHR_shader_subgroup_basic, NV_shader_thread_group }; + case NumSubgroups: + return { KHR_shader_subgroup_basic, NV_shader_thread_group }; + case SubgroupBroadcast_First: + return { KHR_shader_subgroup_ballot, NV_shader_thread_shuffle, ARB_shader_ballot }; + case SubgroupBallotFindLSB_MSB: + return { KHR_shader_subgroup_ballot, NV_shader_thread_group }; + case SubgroupAll_Any_AllEqualBool: + return { KHR_shader_subgroup_vote, NV_gpu_shader_5, ARB_shader_group_vote, AMD_gcn_shader }; + case SubgroupAllEqualT: + return {}; // depends on other features only + case SubgroupElect: + return {}; // depends on other features only + case SubgroupBallot: + return { KHR_shader_subgroup_ballot, NV_shader_thread_group, ARB_shader_ballot }; + case SubgroupBarrier: + return { KHR_shader_subgroup_basic, NV_shader_thread_group, ARB_shader_ballot, AMD_gcn_shader }; + case SubgroupMemBarrier: + return { KHR_shader_subgroup_basic }; + case SubgroupInverseBallot_InclBitCount_ExclBitCout: + return {}; + case SubgroupBallotBitExtract: + return { NV_shader_thread_group }; + case SubgroupBallotBitCount: + return {}; + case SubgroupArithmeticIAddReduce: + case SubgroupArithmeticIAddExclusiveScan: + case SubgroupArithmeticIAddInclusiveScan: + case SubgroupArithmeticFAddReduce: + case SubgroupArithmeticFAddExclusiveScan: + case SubgroupArithmeticFAddInclusiveScan: + case SubgroupArithmeticIMulReduce: + case SubgroupArithmeticIMulExclusiveScan: + case SubgroupArithmeticIMulInclusiveScan: + case SubgroupArithmeticFMulReduce: + case SubgroupArithmeticFMulExclusiveScan: + case SubgroupArithmeticFMulInclusiveScan: + return { KHR_shader_subgroup_arithmetic, NV_shader_thread_shuffle }; + default: + return {}; + } +} + +CompilerGLSL::ShaderSubgroupSupportHelper::FeatureMask CompilerGLSL::ShaderSubgroupSupportHelper::build_mask( + const SmallVector &features) +{ + FeatureMask mask = 0; + for (Feature f : features) + mask |= FeatureMask(1) << f; + return mask; +} + +CompilerGLSL::ShaderSubgroupSupportHelper::Result::Result() +{ + for (auto &weight : weights) + weight = 0; + + // Make sure KHR_shader_subgroup extensions are always prefered. + const uint32_t big_num = FeatureCount; + weights[KHR_shader_subgroup_ballot] = big_num; + weights[KHR_shader_subgroup_basic] = big_num; + weights[KHR_shader_subgroup_vote] = big_num; + weights[KHR_shader_subgroup_arithmetic] = big_num; +} + +void CompilerGLSL::request_workaround_wrapper_overload(TypeID id) +{ + // Must be ordered to maintain deterministic output, so vector is appropriate. + if (find(begin(workaround_ubo_load_overload_types), end(workaround_ubo_load_overload_types), id) == + end(workaround_ubo_load_overload_types)) + { + force_recompile(); + workaround_ubo_load_overload_types.push_back(id); + } +} + +void CompilerGLSL::rewrite_load_for_wrapped_row_major(std::string &expr, TypeID loaded_type, ID ptr) +{ + // Loading row-major matrices from UBOs on older AMD Windows OpenGL drivers is problematic. + // To load these types correctly, we must first wrap them in a dummy function which only purpose is to + // ensure row_major decoration is actually respected. + auto *var = maybe_get_backing_variable(ptr); + if (!var) + return; + + auto &backing_type = get(var->basetype); + bool is_ubo = backing_type.basetype == SPIRType::Struct && backing_type.storage == StorageClassUniform && + has_decoration(backing_type.self, DecorationBlock); + if (!is_ubo) + return; + + auto *type = &get(loaded_type); + bool rewrite = false; + bool relaxed = options.es; + + if (is_matrix(*type)) + { + // To avoid adding a lot of unnecessary meta tracking to forward the row_major state, + // we will simply look at the base struct itself. It is exceptionally rare to mix and match row-major/col-major state. + // If there is any row-major action going on, we apply the workaround. + // It is harmless to apply the workaround to column-major matrices, so this is still a valid solution. + // If an access chain occurred, the workaround is not required, so loading vectors or scalars don't need workaround. + type = &backing_type; + } + else + { + // If we're loading a composite, we don't have overloads like these. + relaxed = false; + } + + if (type->basetype == SPIRType::Struct) + { + // If we're loading a struct where any member is a row-major matrix, apply the workaround. + for (uint32_t i = 0; i < uint32_t(type->member_types.size()); i++) + { + auto decorations = combined_decoration_for_member(*type, i); + if (decorations.get(DecorationRowMajor)) + rewrite = true; + + // Since we decide on a per-struct basis, only use mediump wrapper if all candidates are mediump. + if (!decorations.get(DecorationRelaxedPrecision)) + relaxed = false; + } + } + + if (rewrite) + { + request_workaround_wrapper_overload(loaded_type); + expr = join("spvWorkaroundRowMajor", (relaxed ? "MP" : ""), "(", expr, ")"); + } +} + +void CompilerGLSL::mask_stage_output_by_location(uint32_t location, uint32_t component) +{ + masked_output_locations.insert({ location, component }); +} + +void CompilerGLSL::mask_stage_output_by_builtin(BuiltIn builtin) +{ + masked_output_builtins.insert(builtin); +} + +bool CompilerGLSL::is_stage_output_variable_masked(const SPIRVariable &var) const +{ + auto &type = get(var.basetype); + bool is_block = has_decoration(type.self, DecorationBlock); + // Blocks by themselves are never masked. Must be masked per-member. + if (is_block) + return false; + + bool is_builtin = has_decoration(var.self, DecorationBuiltIn); + + if (is_builtin) + { + return is_stage_output_builtin_masked(BuiltIn(get_decoration(var.self, DecorationBuiltIn))); + } + else + { + if (!has_decoration(var.self, DecorationLocation)) + return false; + + return is_stage_output_location_masked( + get_decoration(var.self, DecorationLocation), + get_decoration(var.self, DecorationComponent)); + } +} + +bool CompilerGLSL::is_stage_output_block_member_masked(const SPIRVariable &var, uint32_t index, bool strip_array) const +{ + auto &type = get(var.basetype); + bool is_block = has_decoration(type.self, DecorationBlock); + if (!is_block) + return false; + + BuiltIn builtin = BuiltInMax; + if (is_member_builtin(type, index, &builtin)) + { + return is_stage_output_builtin_masked(builtin); + } + else + { + uint32_t location = get_declared_member_location(var, index, strip_array); + uint32_t component = get_member_decoration(type.self, index, DecorationComponent); + return is_stage_output_location_masked(location, component); + } +} + +bool CompilerGLSL::is_per_primitive_variable(const SPIRVariable &var) const +{ + if (has_decoration(var.self, DecorationPerPrimitiveEXT)) + return true; + + auto &type = get(var.basetype); + if (!has_decoration(type.self, DecorationBlock)) + return false; + + for (uint32_t i = 0, n = uint32_t(type.member_types.size()); i < n; i++) + if (!has_member_decoration(type.self, i, DecorationPerPrimitiveEXT)) + return false; + + return true; +} + +bool CompilerGLSL::is_stage_output_location_masked(uint32_t location, uint32_t component) const +{ + return masked_output_locations.count({ location, component }) != 0; +} + +bool CompilerGLSL::is_stage_output_builtin_masked(BuiltIn builtin) const +{ + return masked_output_builtins.count(builtin) != 0; +} + +uint32_t CompilerGLSL::get_declared_member_location(const SPIRVariable &var, uint32_t mbr_idx, bool strip_array) const +{ + auto &block_type = get(var.basetype); + if (has_member_decoration(block_type.self, mbr_idx, DecorationLocation)) + return get_member_decoration(block_type.self, mbr_idx, DecorationLocation); + else + return get_accumulated_member_location(var, mbr_idx, strip_array); +} + +uint32_t CompilerGLSL::get_accumulated_member_location(const SPIRVariable &var, uint32_t mbr_idx, bool strip_array) const +{ + auto &type = strip_array ? get_variable_element_type(var) : get_variable_data_type(var); + uint32_t location = get_decoration(var.self, DecorationLocation); + + for (uint32_t i = 0; i < mbr_idx; i++) + { + auto &mbr_type = get(type.member_types[i]); + + // Start counting from any place we have a new location decoration. + if (has_member_decoration(type.self, mbr_idx, DecorationLocation)) + location = get_member_decoration(type.self, mbr_idx, DecorationLocation); + + uint32_t location_count = type_to_location_count(mbr_type); + location += location_count; + } + + return location; +} + +StorageClass CompilerGLSL::get_expression_effective_storage_class(uint32_t ptr) +{ + auto *var = maybe_get_backing_variable(ptr); + + // If the expression has been lowered to a temporary, we need to use the Generic storage class. + // We're looking for the effective storage class of a given expression. + // An access chain or forwarded OpLoads from such access chains + // will generally have the storage class of the underlying variable, but if the load was not forwarded + // we have lost any address space qualifiers. + bool forced_temporary = ir.ids[ptr].get_type() == TypeExpression && !get(ptr).access_chain && + (forced_temporaries.count(ptr) != 0 || forwarded_temporaries.count(ptr) == 0); + + if (var && !forced_temporary) + { + if (variable_decl_is_remapped_storage(*var, StorageClassWorkgroup)) + return StorageClassWorkgroup; + if (variable_decl_is_remapped_storage(*var, StorageClassStorageBuffer)) + return StorageClassStorageBuffer; + + // Normalize SSBOs to StorageBuffer here. + if (var->storage == StorageClassUniform && + has_decoration(get(var->basetype).self, DecorationBufferBlock)) + return StorageClassStorageBuffer; + else + return var->storage; + } + else + return expression_type(ptr).storage; +} + +uint32_t CompilerGLSL::type_to_location_count(const SPIRType &type) const +{ + uint32_t count; + if (type.basetype == SPIRType::Struct) + { + uint32_t mbr_count = uint32_t(type.member_types.size()); + count = 0; + for (uint32_t i = 0; i < mbr_count; i++) + count += type_to_location_count(get(type.member_types[i])); + } + else + { + count = type.columns > 1 ? type.columns : 1; + } + + uint32_t dim_count = uint32_t(type.array.size()); + for (uint32_t i = 0; i < dim_count; i++) + count *= to_array_size_literal(type, i); + + return count; +} + +std::string CompilerGLSL::format_float(float value) const +{ + if (float_formatter) + return float_formatter->format_float(value); + + // default behavior + return convert_to_string(value, current_locale_radix_character); +} + +std::string CompilerGLSL::format_double(double value) const +{ + if (float_formatter) + return float_formatter->format_double(value); + + // default behavior + return convert_to_string(value, current_locale_radix_character); +} + +std::string CompilerGLSL::to_pretty_expression_if_int_constant( + uint32_t id, + const GlslConstantNameMapping *mapping_start, const GlslConstantNameMapping *mapping_end, + bool register_expression_read) +{ + auto *c = maybe_get(id); + if (c && !c->specialization) + { + auto value = c->scalar(); + auto pretty_name = std::find_if(mapping_start, mapping_end, + [value](const GlslConstantNameMapping &mapping) { return mapping.value == value; }); + if (pretty_name != mapping_end) + return pretty_name->alias; + } + return join("int(", to_expression(id, register_expression_read), ")"); +} + +uint32_t CompilerGLSL::get_fp_fast_math_flags_for_op(uint32_t result_type, uint32_t id) const +{ + uint32_t fp_flags = ~0; + + if (!type_is_floating_point(get(result_type))) + return fp_flags; + + auto &ep = get_entry_point(); + + // Per-operation flag supersedes all defaults. + if (id != 0 && has_decoration(id, DecorationFPFastMathMode)) + return get_decoration(id, DecorationFPFastMathMode); + + // Handle float_controls1 execution modes. + uint32_t width = get(result_type).width; + + bool szinp = false; + + switch (width) + { + case 8: + szinp = ep.signed_zero_inf_nan_preserve_8; + break; + + case 16: + szinp = ep.signed_zero_inf_nan_preserve_16; + break; + + case 32: + szinp = ep.signed_zero_inf_nan_preserve_32; + break; + + case 64: + szinp = ep.signed_zero_inf_nan_preserve_64; + break; + + default: + break; + } + + if (szinp) + fp_flags &= ~(FPFastMathModeNSZMask | FPFastMathModeNotInfMask | FPFastMathModeNotNaNMask); + + // Legacy NoContraction deals with any kind of transform to the expression. + if (id != 0 && has_decoration(id, DecorationNoContraction)) + fp_flags &= ~(FPFastMathModeAllowContractMask | FPFastMathModeAllowTransformMask | FPFastMathModeAllowReassocMask); + + // Handle float_controls2 execution modes. + bool found_default = false; + for (auto &fp_pair : ep.fp_fast_math_defaults) + { + if (get(fp_pair.first).width == width && fp_pair.second) + { + fp_flags &= get(fp_pair.second).scalar(); + found_default = true; + } + } + + // From SPV_KHR_float_controls2: + // "This definition implies that, if the entry point set any FPFastMathDefault execution mode + // then any type for which a default is not set uses no fast math flags + // (although this can still be overridden on a per-operation basis). + // Modules must not mix setting fast math modes explicitly using this extension and relying on older API defaults." + if (!found_default && !ep.fp_fast_math_defaults.empty()) + fp_flags = 0; + + return fp_flags; +} + +bool CompilerGLSL::has_legacy_nocontract(uint32_t result_type, uint32_t id) const +{ + const auto fp_flags = FPFastMathModeAllowContractMask | + FPFastMathModeAllowTransformMask | + FPFastMathModeAllowReassocMask; + return (get_fp_fast_math_flags_for_op(result_type, id) & fp_flags) != fp_flags; +} diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_glsl.hpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_glsl.hpp new file mode 100644 index 0000000000..98e93ee99d --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_glsl.hpp @@ -0,0 +1,1101 @@ +/* + * Copyright 2015-2021 Arm Limited + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#ifndef SPIRV_CROSS_GLSL_HPP +#define SPIRV_CROSS_GLSL_HPP + +#include "GLSL.std.450.h" +#include "spirv_cross.hpp" +#include +#include +#include + +namespace SPIRV_CROSS_NAMESPACE +{ +using namespace SPIRV_CROSS_SPV_HEADER_NAMESPACE; +struct GlslConstantNameMapping; + +enum PlsFormat +{ + PlsNone = 0, + + PlsR11FG11FB10F, + PlsR32F, + PlsRG16F, + PlsRGB10A2, + PlsRGBA8, + PlsRG16, + + PlsRGBA8I, + PlsRG16I, + + PlsRGB10A2UI, + PlsRGBA8UI, + PlsRG16UI, + PlsR32UI +}; + +struct PlsRemap +{ + uint32_t id; + PlsFormat format; +}; + +enum AccessChainFlagBits +{ + ACCESS_CHAIN_INDEX_IS_LITERAL_BIT = 1 << 0, + ACCESS_CHAIN_CHAIN_ONLY_BIT = 1 << 1, + ACCESS_CHAIN_PTR_CHAIN_BIT = 1 << 2, + ACCESS_CHAIN_SKIP_REGISTER_EXPRESSION_READ_BIT = 1 << 3, + ACCESS_CHAIN_LITERAL_MSB_FORCE_ID = 1 << 4, + ACCESS_CHAIN_FLATTEN_ALL_MEMBERS_BIT = 1 << 5, + ACCESS_CHAIN_FORCE_COMPOSITE_BIT = 1 << 6, + ACCESS_CHAIN_PTR_CHAIN_POINTER_ARITH_BIT = 1 << 7, + ACCESS_CHAIN_PTR_CHAIN_CAST_TO_SCALAR_BIT = 1 << 8 +}; +typedef uint32_t AccessChainFlags; + +class CompilerGLSL : public Compiler +{ +public: + struct Options + { + // The shading language version. Corresponds to #version $VALUE. + uint32_t version = 450; + + // Emit the OpenGL ES shading language instead of desktop OpenGL. + bool es = false; + + // Debug option to always emit temporary variables for all expressions. + bool force_temporary = false; + // Debug option, can be increased in an attempt to workaround SPIRV-Cross bugs temporarily. + // If this limit has to be increased, it points to an implementation bug. + // In certain scenarios, the maximum number of debug iterations may increase beyond this limit + // as long as we can prove we're making certain kinds of forward progress. + uint32_t force_recompile_max_debug_iterations = 3; + + // If true, Vulkan GLSL features are used instead of GL-compatible features. + // Mostly useful for debugging SPIR-V files. + bool vulkan_semantics = false; + + // If true, gl_PerVertex is explicitly redeclared in vertex, geometry and tessellation shaders. + // The members of gl_PerVertex is determined by which built-ins are declared by the shader. + // This option is ignored in ES versions, as redeclaration in ES is not required, and it depends on a different extension + // (EXT_shader_io_blocks) which makes things a bit more fuzzy. + bool separate_shader_objects = false; + + // Flattens multidimensional arrays, e.g. float foo[a][b][c] into single-dimensional arrays, + // e.g. float foo[a * b * c]. + // This function does not change the actual SPIRType of any object. + // Only the generated code, including declarations of interface variables are changed to be single array dimension. + bool flatten_multidimensional_arrays = false; + + // For older desktop GLSL targets than version 420, the + // GL_ARB_shading_language_420pack extensions is used to be able to support + // layout(binding) on UBOs and samplers. + // If disabled on older targets, binding decorations will be stripped. + bool enable_420pack_extension = true; + + // In non-Vulkan GLSL, emit push constant blocks as UBOs rather than plain uniforms. + bool emit_push_constant_as_uniform_buffer = false; + + // Always emit uniform blocks as plain uniforms, regardless of the GLSL version, even when UBOs are supported. + // Does not apply to shader storage or push constant blocks. + bool emit_uniform_buffer_as_plain_uniforms = false; + + // Emit OpLine directives if present in the module. + // May not correspond exactly to original source, but should be a good approximation. + bool emit_line_directives = false; + + // In cases where readonly/writeonly decoration are not used at all, + // we try to deduce which qualifier(s) we should actually used, since actually emitting + // read-write decoration is very rare, and older glslang/HLSL compilers tend to just emit readwrite as a matter of fact. + // The default (true) is to enable automatic deduction for these cases, but if you trust the decorations set + // by the SPIR-V, it's recommended to set this to false. + bool enable_storage_image_qualifier_deduction = true; + + // On some targets (WebGPU), uninitialized variables are banned. + // If this is enabled, all variables (temporaries, Private, Function) + // which would otherwise be uninitialized will now be initialized to 0 instead. + bool force_zero_initialized_variables = false; + + // In GLSL, force use of I/O block flattening, similar to + // what happens on legacy GLSL targets for blocks and structs. + bool force_flattened_io_blocks = false; + + // For opcodes where we have to perform explicit additional nan checks, very ugly code is generated. + // If we opt-in, ignore these requirements. + // In opcodes like NClamp/NMin/NMax and FP compare, ignore NaN behavior. + // Use FClamp/FMin/FMax semantics for clamps and lets implementation choose ordered or unordered + // compares. + bool relax_nan_checks = false; + + // Loading row-major matrices from UBOs on older AMD Windows OpenGL drivers is problematic. + // To load these types correctly, we must generate a wrapper. them in a dummy function which only purpose is to + // ensure row_major decoration is actually respected. + // This workaround may cause significant performance degeneration on some Android devices. + bool enable_row_major_load_workaround = true; + + // If non-zero, controls layout(num_views = N) in; in GL_OVR_multiview2. + uint32_t ovr_multiview_view_count = 0; + + enum Precision + { + DontCare, + Lowp, + Mediump, + Highp + }; + + struct VertexOptions + { + // "Vertex-like shader" here is any shader stage that can write BuiltInPosition. + + // GLSL: In vertex-like shaders, rewrite [0, w] depth (Vulkan/D3D style) to [-w, w] depth (GL style). + // MSL: In vertex-like shaders, rewrite [-w, w] depth (GL style) to [0, w] depth. + // HLSL: In vertex-like shaders, rewrite [-w, w] depth (GL style) to [0, w] depth. + bool fixup_clipspace = false; + + // In vertex-like shaders, inverts gl_Position.y or equivalent. + bool flip_vert_y = false; + + // GLSL only, for HLSL version of this option, see CompilerHLSL. + // If true, the backend will assume that InstanceIndex will need to apply + // a base instance offset. Set to false if you know you will never use base instance + // functionality as it might remove some internal uniforms. + bool support_nonzero_base_instance = true; + } vertex; + + struct FragmentOptions + { + // Add precision mediump float in ES targets when emitting GLES source. + // Add precision highp int in ES targets when emitting GLES source. + Precision default_float_precision = Mediump; + Precision default_int_precision = Highp; + } fragment; + }; + + void remap_pixel_local_storage(std::vector inputs, std::vector outputs) + { + pls_inputs = std::move(inputs); + pls_outputs = std::move(outputs); + remap_pls_variables(); + } + + // Redirect a subpassInput reading from input_attachment_index to instead load its value from + // the color attachment at location = color_location. Requires ESSL. + // If coherent, uses GL_EXT_shader_framebuffer_fetch, if not, uses noncoherent variant. + void remap_ext_framebuffer_fetch(uint32_t input_attachment_index, uint32_t color_location, bool coherent); + + explicit CompilerGLSL(std::vector spirv_) + : Compiler(std::move(spirv_)) + { + init(); + } + + CompilerGLSL(const uint32_t *ir_, size_t word_count) + : Compiler(ir_, word_count) + { + init(); + } + + explicit CompilerGLSL(const ParsedIR &ir_) + : Compiler(ir_) + { + init(); + } + + explicit CompilerGLSL(ParsedIR &&ir_) + : Compiler(std::move(ir_)) + { + init(); + } + + const Options &get_common_options() const + { + return options; + } + + void set_common_options(const Options &opts) + { + options = opts; + } + + std::string compile() override; + + // Returns the current string held in the conversion buffer. Useful for + // capturing what has been converted so far when compile() throws an error. + std::string get_partial_source(); + + // Adds a line to be added right after #version in GLSL backend. + // This is useful for enabling custom extensions which are outside the scope of SPIRV-Cross. + // This can be combined with variable remapping. + // A new-line will be added. + // + // While add_header_line() is a more generic way of adding arbitrary text to the header + // of a GLSL file, require_extension() should be used when adding extensions since it will + // avoid creating collisions with SPIRV-Cross generated extensions. + // + // Code added via add_header_line() is typically backend-specific. + void add_header_line(const std::string &str); + + // Adds an extension which is required to run this shader, e.g. + // require_extension("GL_KHR_my_extension"); + void require_extension(const std::string &ext); + + // Returns the list of required extensions. After compilation this will contains any other + // extensions that the compiler used automatically, in addition to the user specified ones. + const SmallVector &get_required_extensions() const; + + // Legacy GLSL compatibility method. + // Takes a uniform or push constant variable and flattens it into a (i|u)vec4 array[N]; array instead. + // For this to work, all types in the block must be the same basic type, e.g. mixing vec2 and vec4 is fine, but + // mixing int and float is not. + // The name of the uniform array will be the same as the interface block name. + void flatten_buffer_block(VariableID id); + + // After compilation, query if a variable ID was used as a depth resource. + // This is meaningful for MSL since descriptor types depend on this knowledge. + // Cases which return true: + // - Images which are declared with depth = 1 image type. + // - Samplers which are statically used at least once with Dref opcodes. + // - Images which are statically used at least once with Dref opcodes. + bool variable_is_depth_or_compare(VariableID id) const; + + // If a shader output is active in this stage, but inactive in a subsequent stage, + // this can be signalled here. This can be used to work around certain cross-stage matching problems + // which plagues MSL and HLSL in certain scenarios. + // An output which matches one of these will not be emitted in stage output interfaces, but rather treated as a private + // variable. + // This option is only meaningful for MSL and HLSL, since GLSL matches by location directly. + // Masking builtins only takes effect if the builtin in question is part of the stage output interface. + void mask_stage_output_by_location(uint32_t location, uint32_t component); + void mask_stage_output_by_builtin(BuiltIn builtin); + + // Allow to control how to format float literals in the output. + // Set to "nullptr" to use the default "convert_to_string" function. + // This handle is not owned by SPIRV-Cross and must remain valid until compile() has been called. + void set_float_formatter(FloatFormatter *formatter) + { + float_formatter = formatter; + } + + // Returns the macro name corresponding to constant id + std::string constant_value_macro_name(uint32_t id) const; + +protected: + struct ShaderSubgroupSupportHelper + { + // lower enum value = greater priority + enum Candidate + { + KHR_shader_subgroup_ballot, + KHR_shader_subgroup_basic, + KHR_shader_subgroup_vote, + KHR_shader_subgroup_arithmetic, + NV_gpu_shader_5, + NV_shader_thread_group, + NV_shader_thread_shuffle, + ARB_shader_ballot, + ARB_shader_group_vote, + AMD_gcn_shader, + + CandidateCount + }; + + static const char *get_extension_name(Candidate c); + static SmallVector get_extra_required_extension_names(Candidate c); + static const char *get_extra_required_extension_predicate(Candidate c); + + enum Feature + { + SubgroupMask = 0, + SubgroupSize = 1, + SubgroupInvocationID = 2, + SubgroupID = 3, + NumSubgroups = 4, + SubgroupBroadcast_First = 5, + SubgroupBallotFindLSB_MSB = 6, + SubgroupAll_Any_AllEqualBool = 7, + SubgroupAllEqualT = 8, + SubgroupElect = 9, + SubgroupBarrier = 10, + SubgroupMemBarrier = 11, + SubgroupBallot = 12, + SubgroupInverseBallot_InclBitCount_ExclBitCout = 13, + SubgroupBallotBitExtract = 14, + SubgroupBallotBitCount = 15, + SubgroupArithmeticIAddReduce = 16, + SubgroupArithmeticIAddExclusiveScan = 17, + SubgroupArithmeticIAddInclusiveScan = 18, + SubgroupArithmeticFAddReduce = 19, + SubgroupArithmeticFAddExclusiveScan = 20, + SubgroupArithmeticFAddInclusiveScan = 21, + SubgroupArithmeticIMulReduce = 22, + SubgroupArithmeticIMulExclusiveScan = 23, + SubgroupArithmeticIMulInclusiveScan = 24, + SubgroupArithmeticFMulReduce = 25, + SubgroupArithmeticFMulExclusiveScan = 26, + SubgroupArithmeticFMulInclusiveScan = 27, + FeatureCount + }; + + using FeatureMask = uint32_t; + static_assert(sizeof(FeatureMask) * 8u >= FeatureCount, "Mask type needs more bits."); + + using CandidateVector = SmallVector; + using FeatureVector = SmallVector; + + static FeatureVector get_feature_dependencies(Feature feature); + static FeatureMask get_feature_dependency_mask(Feature feature); + static bool can_feature_be_implemented_without_extensions(Feature feature); + static Candidate get_KHR_extension_for_feature(Feature feature); + + struct Result + { + Result(); + uint32_t weights[CandidateCount]; + }; + + void request_feature(Feature feature); + bool is_feature_requested(Feature feature) const; + Result resolve() const; + + static CandidateVector get_candidates_for_feature(Feature ft, const Result &r); + + private: + static CandidateVector get_candidates_for_feature(Feature ft); + static FeatureMask build_mask(const SmallVector &features); + FeatureMask feature_mask = 0; + }; + + // TODO remove this function when all subgroup ops are supported (or make it always return true) + static bool is_supported_subgroup_op_in_opengl(Op op, const uint32_t *ops); + + void reset(uint32_t iteration_count); + void emit_function(SPIRFunction &func, const Bitset &return_flags); + + bool has_extension(const std::string &ext) const; + void require_extension_internal(const std::string &ext); + + // Virtualize methods which need to be overridden by subclass targets like C++ and such. + virtual void emit_function_prototype(SPIRFunction &func, const Bitset &return_flags); + + SPIRBlock *current_emitting_block = nullptr; + SmallVector current_emitting_switch_stack; + bool current_emitting_switch_fallthrough = false; + + virtual void emit_instruction(const Instruction &instr); + struct TemporaryCopy + { + uint32_t dst_id; + uint32_t src_id; + }; + TemporaryCopy handle_instruction_precision(const Instruction &instr); + void emit_block_instructions(SPIRBlock &block); + void emit_block_instructions_with_masked_debug(SPIRBlock &block); + + // For relax_nan_checks. + GLSLstd450 get_remapped_glsl_op(GLSLstd450 std450_op) const; + Op get_remapped_spirv_op(Op op) const; + + virtual void emit_glsl_op(uint32_t result_type, uint32_t result_id, uint32_t op, const uint32_t *args, + uint32_t count); + virtual void emit_spv_amd_shader_ballot_op(uint32_t result_type, uint32_t result_id, uint32_t op, + const uint32_t *args, uint32_t count); + virtual void emit_spv_amd_shader_explicit_vertex_parameter_op(uint32_t result_type, uint32_t result_id, uint32_t op, + const uint32_t *args, uint32_t count); + virtual void emit_spv_amd_shader_trinary_minmax_op(uint32_t result_type, uint32_t result_id, uint32_t op, + const uint32_t *args, uint32_t count); + virtual void emit_spv_amd_gcn_shader_op(uint32_t result_type, uint32_t result_id, uint32_t op, const uint32_t *args, + uint32_t count); + void emit_non_semantic_shader_debug_info(uint32_t result_type, uint32_t result_id, uint32_t op, + const uint32_t *args, uint32_t count); + virtual void emit_header(); + void emit_line_directive(uint32_t file_id, uint32_t line_literal); + void build_workgroup_size(SmallVector &arguments, const SpecializationConstant &x, + const SpecializationConstant &y, const SpecializationConstant &z); + + void request_subgroup_feature(ShaderSubgroupSupportHelper::Feature feature); + + virtual void emit_sampled_image_op(uint32_t result_type, uint32_t result_id, uint32_t image_id, uint32_t samp_id); + virtual void emit_texture_op(const Instruction &i, bool sparse); + virtual std::string to_texture_op(const Instruction &i, bool sparse, bool *forward, + SmallVector &inherited_expressions); + virtual void emit_subgroup_op(const Instruction &i); + virtual std::string type_to_glsl(const SPIRType &type, uint32_t id = 0); + virtual std::string builtin_to_glsl(BuiltIn builtin, StorageClass storage); + virtual void emit_struct_member(const SPIRType &type, uint32_t member_type_id, uint32_t index, + const std::string &qualifier = "", uint32_t base_offset = 0); + virtual void emit_struct_padding_target(const SPIRType &type); + virtual std::string image_type_glsl(const SPIRType &type, uint32_t id = 0, bool member = false); + std::string constant_expression(const SPIRConstant &c, + bool inside_block_like_struct_scope = false, + bool inside_struct_scope = false); + virtual std::string constant_op_expression(const SPIRConstantOp &cop); + virtual std::string constant_expression_vector(const SPIRConstant &c, uint32_t vector); + virtual void emit_fixup(); + virtual std::string variable_decl(const SPIRType &type, const std::string &name, uint32_t id = 0); + virtual bool variable_decl_is_remapped_storage(const SPIRVariable &var, StorageClass storage) const; + virtual std::string to_func_call_arg(const SPIRFunction::Parameter &arg, uint32_t id); + virtual void emit_workgroup_initialization(const SPIRVariable &var); + + struct TextureFunctionBaseArguments + { + // GCC 4.8 workarounds, it doesn't understand '{}' constructor here, use explicit default constructor. + TextureFunctionBaseArguments() = default; + VariableID img = 0; + const SPIRType *imgtype = nullptr; + bool is_fetch = false, is_gather = false, is_proj = false; + }; + + struct TextureFunctionNameArguments + { + // GCC 4.8 workarounds, it doesn't understand '{}' constructor here, use explicit default constructor. + TextureFunctionNameArguments() = default; + TextureFunctionBaseArguments base; + bool has_array_offsets = false, has_offset = false, has_grad = false; + bool has_dref = false, is_sparse_feedback = false, has_min_lod = false; + uint32_t lod = 0; + }; + virtual std::string to_function_name(const TextureFunctionNameArguments &args); + + struct TextureFunctionArguments + { + // GCC 4.8 workarounds, it doesn't understand '{}' constructor here, use explicit default constructor. + TextureFunctionArguments() = default; + TextureFunctionBaseArguments base; + uint32_t coord = 0, coord_components = 0, dref = 0; + uint32_t grad_x = 0, grad_y = 0, lod = 0, offset = 0; + uint32_t bias = 0, component = 0, sample = 0, sparse_texel = 0, min_lod = 0; + bool nonuniform_expression = false, has_array_offsets = false; + }; + virtual std::string to_function_args(const TextureFunctionArguments &args, bool *p_forward); + + void emit_sparse_feedback_temporaries(uint32_t result_type_id, uint32_t id, uint32_t &feedback_id, + uint32_t &texel_id); + uint32_t get_sparse_feedback_texel_id(uint32_t id) const; + virtual void emit_buffer_block(const SPIRVariable &type); + virtual void emit_push_constant_block(const SPIRVariable &var); + virtual void emit_uniform(const SPIRVariable &var); + virtual std::string unpack_expression_type(std::string expr_str, const SPIRType &type, uint32_t physical_type_id, + bool packed_type, bool row_major); + + virtual bool builtin_translates_to_nonarray(BuiltIn builtin) const; + + virtual bool is_user_type_structured(uint32_t id) const; + + void emit_copy_logical_type(uint32_t lhs_id, uint32_t lhs_type_id, uint32_t rhs_id, uint32_t rhs_type_id, + SmallVector chain); + + StringStream<> buffer; + + template + inline void statement_inner(T &&t) + { + buffer << std::forward(t); + statement_count++; + } + + template + inline void statement_inner(T &&t, Ts &&... ts) + { + buffer << std::forward(t); + statement_count++; + statement_inner(std::forward(ts)...); + } + + template + inline void statement(Ts &&... ts) + { + if (is_forcing_recompilation()) + { + // Do not bother emitting code while force_recompile is active. + // We will compile again. + statement_count++; + return; + } + + if (redirect_statement) + { + redirect_statement->push_back(join(std::forward(ts)...)); + statement_count++; + } + else + { + for (uint32_t i = 0; i < indent; i++) + buffer << " "; + statement_inner(std::forward(ts)...); + buffer << '\n'; + } + } + + template + inline void statement_no_indent(Ts &&... ts) + { + auto old_indent = indent; + indent = 0; + statement(std::forward(ts)...); + indent = old_indent; + } + + // Used for implementing continue blocks where + // we want to obtain a list of statements we can merge + // on a single line separated by comma. + SmallVector *redirect_statement = nullptr; + const SPIRBlock *current_continue_block = nullptr; + bool block_temporary_hoisting = false; + bool block_debug_directives = false; + + void begin_scope(); + void end_scope(); + void end_scope(const std::string &trailer); + void end_scope_decl(); + void end_scope_decl(const std::string &decl); + + Options options; + + // Allow Metal to use the array template to make arrays a value type + virtual std::string type_to_array_glsl(const SPIRType &type, uint32_t variable_id); + std::string to_array_size(const SPIRType &type, uint32_t index); + uint32_t to_array_size_literal(const SPIRType &type, uint32_t index) const; + uint32_t to_array_size_literal(const SPIRType &type) const; + virtual std::string variable_decl(const SPIRVariable &variable); // Threadgroup arrays can't have a wrapper type + std::string variable_decl_function_local(SPIRVariable &variable); + + void add_local_variable_name(uint32_t id); + void add_resource_name(uint32_t id); + void add_member_name(SPIRType &type, uint32_t name); + void add_function_overload(const SPIRFunction &func); + + virtual bool is_non_native_row_major_matrix(uint32_t id); + virtual bool member_is_non_native_row_major_matrix(const SPIRType &type, uint32_t index); + bool member_is_remapped_physical_type(const SPIRType &type, uint32_t index) const; + bool member_is_packed_physical_type(const SPIRType &type, uint32_t index) const; + virtual std::string convert_row_major_matrix(std::string exp_str, const SPIRType &exp_type, + uint32_t physical_type_id, bool is_packed, + bool relaxed = false); + + std::unordered_set local_variable_names; + std::unordered_set resource_names; + std::unordered_set block_input_names; + std::unordered_set block_output_names; + std::unordered_set block_ubo_names; + std::unordered_set block_ssbo_names; + std::unordered_set block_names; // A union of all block_*_names. + std::unordered_map> function_overloads; + std::unordered_map preserved_aliases; + void preserve_alias_on_reset(uint32_t id); + void reset_name_caches(); + + bool processing_entry_point = false; + + // Can be overriden by subclass backends for trivial things which + // shouldn't need polymorphism. + struct BackendVariations + { + std::string discard_literal = "discard"; + std::string demote_literal = "demote"; + std::string null_pointer_literal = ""; + bool float_literal_suffix = false; + bool double_literal_suffix = true; + bool uint32_t_literal_suffix = true; + bool long_long_literal_suffix = false; + const char *basic_int_type = "int"; + const char *basic_uint_type = "uint"; + const char *basic_int8_type = "int8_t"; + const char *basic_uint8_type = "uint8_t"; + const char *basic_int16_type = "int16_t"; + const char *basic_uint16_type = "uint16_t"; + const char *int16_t_literal_suffix = "s"; + const char *uint16_t_literal_suffix = "us"; + const char *nonuniform_qualifier = "nonuniformEXT"; + const char *boolean_mix_function = "mix"; + const char *printf_function = "debugPrintfEXT"; + std::string constant_null_initializer = ""; + SPIRType::BaseType boolean_in_struct_remapped_type = SPIRType::Boolean; + bool swizzle_is_function = false; + bool shared_is_implied = false; + bool unsized_array_supported = true; + bool explicit_struct_type = false; + bool use_initializer_list = false; + bool use_typed_initializer_list = false; + bool requires_matching_array_initializer = false; + bool can_declare_struct_inline = true; + bool can_declare_arrays_inline = true; + bool native_row_major_matrix = true; + bool use_constructor_splatting = true; + bool allow_precision_qualifiers = false; + bool can_swizzle_scalar = false; + bool force_gl_in_out_block = false; + bool force_merged_mesh_block = false; + bool can_return_array = true; + bool allow_truncated_access_chain = false; + bool supports_extensions = false; + bool supports_empty_struct = false; + bool array_is_value_type = true; + bool array_is_value_type_in_buffer_blocks = true; + bool comparison_image_samples_scalar = false; + bool native_pointers = false; + bool support_small_type_sampling_result = false; + bool support_case_fallthrough = true; + bool use_array_constructor = false; + bool needs_row_major_load_workaround = false; + bool support_pointer_to_pointer = false; + bool support_precise_qualifier = false; + bool support_64bit_switch = false; + bool workgroup_size_is_hidden = false; + bool requires_relaxed_precision_analysis = false; + bool implicit_c_integer_promotion_rules = false; + bool supports_spec_constant_array_size = true; + } backend; + + void emit_struct(SPIRType &type); + void emit_resources(); + void emit_extension_workarounds(ExecutionModel model); + void emit_subgroup_arithmetic_workaround(const std::string &func, Op op, GroupOperation group_op); + void emit_polyfills(uint32_t polyfills, bool relaxed); + void emit_buffer_block_native(const SPIRVariable &var); + void emit_buffer_reference_block(uint32_t type_id, bool forward_declaration); + void emit_buffer_block_legacy(const SPIRVariable &var); + void emit_buffer_block_flattened(const SPIRVariable &type); + void fixup_implicit_builtin_block_names(ExecutionModel model); + void emit_declared_builtin_block(StorageClass storage, ExecutionModel model); + bool should_force_emit_builtin_block(StorageClass storage); + void emit_push_constant_block_vulkan(const SPIRVariable &var); + void emit_push_constant_block_glsl(const SPIRVariable &var); + void emit_interface_block(const SPIRVariable &type); + void emit_flattened_io_block(const SPIRVariable &var, const char *qual); + void emit_flattened_io_block_struct(const std::string &basename, const SPIRType &type, const char *qual, + const SmallVector &indices); + void emit_flattened_io_block_member(const std::string &basename, const SPIRType &type, const char *qual, + const SmallVector &indices); + void emit_block_chain(SPIRBlock &block); + BlockID emit_block_chain_inner(SPIRBlock &block); + void emit_block_chain_cleanup(SPIRBlock &block); + void emit_hoisted_temporaries(SmallVector> &temporaries); + int get_constant_mapping_to_workgroup_component(const SPIRConstant &constant) const; + void emit_constant(const SPIRConstant &constant); + void emit_specialization_constant_op(const SPIRConstantOp &constant); + std::string emit_continue_block(uint32_t continue_block, bool follow_true_block, bool follow_false_block); + bool attempt_emit_loop_header(SPIRBlock &block, SPIRBlock::Method method); + + void branch(BlockID from, BlockID to); + void branch_to_continue(BlockID from, BlockID to); + void branch(BlockID from, uint32_t cond, BlockID true_block, BlockID false_block); + void flush_phi(BlockID from, BlockID to); + void flush_variable_declaration(uint32_t id); + void flush_undeclared_variables(SPIRBlock &block); + void emit_variable_temporary_copies(const SPIRVariable &var); + + bool should_dereference(uint32_t id); + bool should_dereference_caller_param(uint32_t id); + bool should_forward(uint32_t id) const; + bool should_suppress_usage_tracking(uint32_t id) const; + void emit_mix_op(uint32_t result_type, uint32_t id, uint32_t left, uint32_t right, uint32_t lerp); + void emit_nminmax_op(uint32_t result_type, uint32_t id, uint32_t op0, uint32_t op1, GLSLstd450 op); + void emit_emulated_ahyper_op(uint32_t result_type, uint32_t result_id, uint32_t op0, GLSLstd450 op); + bool to_trivial_mix_op(const SPIRType &type, std::string &op, uint32_t left, uint32_t right, uint32_t lerp); + void emit_quaternary_func_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, uint32_t op2, + uint32_t op3, const char *op); + void emit_trinary_func_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, uint32_t op2, + const char *op); + void emit_binary_func_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op); + void emit_atomic_func_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op); + void emit_atomic_func_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, uint32_t op2, const char *op); + + void emit_unary_func_op_cast(uint32_t result_type, uint32_t result_id, uint32_t op0, const char *op, + SPIRType::BaseType input_type, SPIRType::BaseType expected_result_type); + void emit_binary_func_op_cast(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op, + SPIRType::BaseType input_type, bool skip_cast_if_equal_type); + void emit_binary_func_op_cast_clustered(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, + const char *op, SPIRType::BaseType input_type); + void emit_trinary_func_op_cast(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, uint32_t op2, + const char *op, SPIRType::BaseType input_type); + void emit_trinary_func_op_bitextract(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, + uint32_t op2, const char *op, SPIRType::BaseType expected_result_type, + SPIRType::BaseType input_type0, SPIRType::BaseType input_type1, + SPIRType::BaseType input_type2); + void emit_bitfield_insert_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, uint32_t op2, + uint32_t op3, const char *op, SPIRType::BaseType offset_count_type); + + void emit_unary_func_op(uint32_t result_type, uint32_t result_id, uint32_t op0, const char *op); + void emit_unrolled_unary_op(uint32_t result_type, uint32_t result_id, uint32_t operand, const char *op); + void emit_binary_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op); + void emit_unrolled_binary_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op, + bool negate, SPIRType::BaseType expected_type); + void emit_binary_op_cast(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op, + SPIRType::BaseType input_type, bool skip_cast_if_equal_type, bool implicit_integer_promotion); + + SPIRType binary_op_bitcast_helper(std::string &cast_op0, std::string &cast_op1, SPIRType::BaseType &input_type, + uint32_t op0, uint32_t op1, bool skip_cast_if_equal_type); + + virtual bool emit_complex_bitcast(uint32_t result_type, uint32_t id, uint32_t op0); + + std::string to_ternary_expression(const SPIRType &result_type, uint32_t select, uint32_t true_value, + uint32_t false_value); + + void emit_unary_op(uint32_t result_type, uint32_t result_id, uint32_t op0, const char *op); + void emit_unary_op_cast(uint32_t result_type, uint32_t result_id, uint32_t op0, const char *op); + virtual void emit_mesh_tasks(SPIRBlock &block); + bool expression_is_forwarded(uint32_t id) const; + bool expression_suppresses_usage_tracking(uint32_t id) const; + bool expression_read_implies_multiple_reads(uint32_t id) const; + SPIRExpression &emit_op(uint32_t result_type, uint32_t result_id, const std::string &rhs, bool forward_rhs, + bool suppress_usage_tracking = false); + void emit_transposed_op(uint32_t result_type, uint32_t result_id, const std::string &rhs, bool forward_rhs); + + void access_chain_internal_append_index(std::string &expr, uint32_t base, const SPIRType *type, + AccessChainFlags flags, bool &access_chain_is_arrayed, uint32_t index); + + std::string access_chain_internal(uint32_t base, const uint32_t *indices, uint32_t count, AccessChainFlags flags, + AccessChainMeta *meta); + + // Only meaningful on backends with physical pointer support ala MSL. + // Relevant for PtrAccessChain / BDA. + virtual uint32_t get_physical_type_stride(const SPIRType &type) const; + + StorageClass get_expression_effective_storage_class(uint32_t ptr); + virtual bool access_chain_needs_stage_io_builtin_translation(uint32_t base); + + virtual bool check_physical_type_cast(std::string &expr, const SPIRType *type, uint32_t physical_type); + virtual bool prepare_access_chain_for_scalar_access(std::string &expr, const SPIRType &type, + StorageClass storage, bool &is_packed); + + std::string access_chain(uint32_t base, const uint32_t *indices, uint32_t count, const SPIRType &target_type, + AccessChainMeta *meta = nullptr, bool ptr_chain = false); + + std::string flattened_access_chain(uint32_t base, const uint32_t *indices, uint32_t count, + const SPIRType &target_type, uint32_t offset, uint32_t matrix_stride, + uint32_t array_stride, bool need_transpose); + std::string flattened_access_chain_struct(uint32_t base, const uint32_t *indices, uint32_t count, + const SPIRType &target_type, uint32_t offset); + std::string flattened_access_chain_matrix(uint32_t base, const uint32_t *indices, uint32_t count, + const SPIRType &target_type, uint32_t offset, uint32_t matrix_stride, + bool need_transpose); + std::string flattened_access_chain_vector(uint32_t base, const uint32_t *indices, uint32_t count, + const SPIRType &target_type, uint32_t offset, uint32_t matrix_stride, + bool need_transpose); + std::pair flattened_access_chain_offset(const SPIRType &basetype, const uint32_t *indices, + uint32_t count, uint32_t offset, + uint32_t word_stride, bool *need_transpose = nullptr, + uint32_t *matrix_stride = nullptr, + uint32_t *array_stride = nullptr, + bool ptr_chain = false); + + const char *index_to_swizzle(uint32_t index); + std::string remap_swizzle(const SPIRType &result_type, uint32_t input_components, const std::string &expr); + std::string declare_temporary(uint32_t type, uint32_t id); + bool can_declare_inline_temporary(uint32_t id) const; + void emit_uninitialized_temporary(uint32_t type, uint32_t id); + SPIRExpression &emit_uninitialized_temporary_expression(uint32_t type, uint32_t id); + virtual void append_global_func_args(const SPIRFunction &func, uint32_t index, SmallVector &arglist); + std::string to_non_uniform_aware_expression(uint32_t id); + std::string to_atomic_ptr_expression(uint32_t id); + std::string to_pretty_expression_if_int_constant( + uint32_t id, + const GlslConstantNameMapping *mapping_start, const GlslConstantNameMapping *mapping_end, + bool register_expression_read = true); + std::string to_expression(uint32_t id, bool register_expression_read = true); + std::string to_composite_constructor_expression(const SPIRType &parent_type, uint32_t id, bool block_like_type); + std::string to_rerolled_array_expression(const SPIRType &parent_type, const std::string &expr, const SPIRType &type); + std::string to_enclosed_expression(uint32_t id, bool register_expression_read = true); + std::string to_unpacked_expression(uint32_t id, bool register_expression_read = true); + std::string to_unpacked_row_major_matrix_expression(uint32_t id); + std::string to_enclosed_unpacked_expression(uint32_t id, bool register_expression_read = true); + std::string to_dereferenced_expression(uint32_t id, bool register_expression_read = true); + std::string to_pointer_expression(uint32_t id, bool register_expression_read = true); + std::string to_enclosed_pointer_expression(uint32_t id, bool register_expression_read = true); + std::string to_extract_component_expression(uint32_t id, uint32_t index); + std::string to_extract_constant_composite_expression(uint32_t result_type, const SPIRConstant &c, + const uint32_t *chain, uint32_t length); + static bool needs_enclose_expression(const std::string &expr); + std::string enclose_expression(const std::string &expr); + std::string dereference_expression(const SPIRType &expression_type, const std::string &expr); + std::string address_of_expression(const std::string &expr); + void strip_enclosed_expression(std::string &expr); + std::string to_member_name(const SPIRType &type, uint32_t index); + virtual std::string to_member_reference(uint32_t base, const SPIRType &type, uint32_t index, bool ptr_chain_is_resolved); + std::string to_multi_member_reference(const SPIRType &type, const SmallVector &indices); + std::string type_to_glsl_constructor(const SPIRType &type); + std::string argument_decl(const SPIRFunction::Parameter &arg); + virtual std::string to_qualifiers_glsl(uint32_t id); + void fixup_io_block_patch_primitive_qualifiers(const SPIRVariable &var); + void emit_output_variable_initializer(const SPIRVariable &var); + std::string to_precision_qualifiers_glsl(uint32_t id); + virtual const char *to_storage_qualifiers_glsl(const SPIRVariable &var); + std::string flags_to_qualifiers_glsl(const SPIRType &type, uint32_t id, const Bitset &flags); + const char *format_to_glsl(ImageFormat format); + virtual std::string layout_for_member(const SPIRType &type, uint32_t index); + virtual std::string to_interpolation_qualifiers(const Bitset &flags); + std::string layout_for_variable(const SPIRVariable &variable); + std::string to_combined_image_sampler(VariableID image_id, VariableID samp_id); + virtual bool skip_argument(uint32_t id) const; + virtual bool emit_array_copy(const char *expr, uint32_t lhs_id, uint32_t rhs_id, + StorageClass lhs_storage, StorageClass rhs_storage); + virtual void emit_block_hints(const SPIRBlock &block); + virtual std::string to_initializer_expression(const SPIRVariable &var); + virtual std::string to_zero_initialized_expression(uint32_t type_id); + bool type_can_zero_initialize(const SPIRType &type) const; + + bool buffer_is_packing_standard(const SPIRType &type, BufferPackingStandard packing, + uint32_t *failed_index = nullptr, uint32_t start_offset = 0, + uint32_t end_offset = ~(0u)); + std::string buffer_to_packing_standard(const SPIRType &type, + bool support_std430_without_scalar_layout, + bool support_enhanced_layouts); + + uint32_t type_to_packed_base_size(const SPIRType &type, BufferPackingStandard packing); + uint32_t type_to_packed_alignment(const SPIRType &type, const Bitset &flags, BufferPackingStandard packing); + uint32_t type_to_packed_array_stride(const SPIRType &type, const Bitset &flags, BufferPackingStandard packing); + uint32_t type_to_packed_size(const SPIRType &type, const Bitset &flags, BufferPackingStandard packing); + uint32_t type_to_location_count(const SPIRType &type) const; + + std::string bitcast_glsl(const SPIRType &result_type, uint32_t arg); + virtual std::string bitcast_glsl_op(const SPIRType &result_type, const SPIRType &argument_type); + + std::string bitcast_expression(SPIRType::BaseType target_type, uint32_t arg); + std::string bitcast_expression(const SPIRType &target_type, SPIRType::BaseType expr_type, const std::string &expr); + + std::string build_composite_combiner(uint32_t result_type, const uint32_t *elems, uint32_t length); + bool remove_duplicate_swizzle(std::string &op); + bool remove_unity_swizzle(uint32_t base, std::string &op); + + // Can modify flags to remote readonly/writeonly if image type + // and force recompile. + bool check_atomic_image(uint32_t id); + + virtual void replace_illegal_names(); + void replace_illegal_names(const std::unordered_set &keywords); + virtual void emit_entry_point_declarations(); + + void replace_fragment_output(SPIRVariable &var); + void replace_fragment_outputs(); + std::string legacy_tex_op(const std::string &op, const SPIRType &imgtype, uint32_t id); + + void forward_relaxed_precision(uint32_t dst_id, const uint32_t *args, uint32_t length); + void analyze_precision_requirements(uint32_t type_id, uint32_t dst_id, uint32_t *args, uint32_t length); + Options::Precision analyze_expression_precision(const uint32_t *args, uint32_t length) const; + + uint32_t indent = 0; + + std::unordered_set emitted_functions; + + // Ensure that we declare phi-variable copies even if the original declaration isn't deferred + std::unordered_set flushed_phi_variables; + + std::unordered_set flattened_buffer_blocks; + std::unordered_map flattened_structs; + + ShaderSubgroupSupportHelper shader_subgroup_supporter; + + std::string load_flattened_struct(const std::string &basename, const SPIRType &type); + std::string to_flattened_struct_member(const std::string &basename, const SPIRType &type, uint32_t index); + void store_flattened_struct(uint32_t lhs_id, uint32_t value); + void store_flattened_struct(const std::string &basename, uint32_t rhs, const SPIRType &type, + const SmallVector &indices); + std::string to_flattened_access_chain_expression(uint32_t id); + + // Usage tracking. If a temporary is used more than once, use the temporary instead to + // avoid AST explosion when SPIRV is generated with pure SSA and doesn't write stuff to variables. + std::unordered_map expression_usage_counts; + void track_expression_read(uint32_t id); + + SmallVector forced_extensions; + SmallVector header_lines; + + // Used when expressions emit extra opcodes with their own unique IDs, + // and we need to reuse the IDs across recompilation loops. + // Currently used by NMin/Max/Clamp implementations. + std::unordered_map extra_sub_expressions; + + SmallVector workaround_ubo_load_overload_types; + void request_workaround_wrapper_overload(TypeID id); + void rewrite_load_for_wrapped_row_major(std::string &expr, TypeID loaded_type, ID ptr); + + uint32_t statement_count = 0; + + inline bool is_legacy() const + { + return (options.es && options.version < 300) || (!options.es && options.version < 130); + } + + inline bool is_legacy_es() const + { + return options.es && options.version < 300; + } + + inline bool is_legacy_desktop() const + { + return !options.es && options.version < 130; + } + + enum Polyfill : uint32_t + { + PolyfillTranspose2x2 = 1 << 0, + PolyfillTranspose3x3 = 1 << 1, + PolyfillTranspose4x4 = 1 << 2, + PolyfillDeterminant2x2 = 1 << 3, + PolyfillDeterminant3x3 = 1 << 4, + PolyfillDeterminant4x4 = 1 << 5, + PolyfillMatrixInverse2x2 = 1 << 6, + PolyfillMatrixInverse3x3 = 1 << 7, + PolyfillMatrixInverse4x4 = 1 << 8, + PolyfillNMin16 = 1 << 9, + PolyfillNMin32 = 1 << 10, + PolyfillNMin64 = 1 << 11, + PolyfillNMax16 = 1 << 12, + PolyfillNMax32 = 1 << 13, + PolyfillNMax64 = 1 << 14, + PolyfillNClamp16 = 1 << 15, + PolyfillNClamp32 = 1 << 16, + PolyfillNClamp64 = 1 << 17, + }; + + uint32_t required_polyfills = 0; + uint32_t required_polyfills_relaxed = 0; + void require_polyfill(Polyfill polyfill, bool relaxed); + + bool ray_tracing_is_khr = false; + bool barycentric_is_nv = false; + void ray_tracing_khr_fixup_locations(); + + bool args_will_forward(uint32_t id, const uint32_t *args, uint32_t num_args, bool pure); + void register_call_out_argument(uint32_t id); + void register_impure_function_call(); + void register_control_dependent_expression(uint32_t expr); + + // GL_EXT_shader_pixel_local_storage support. + std::vector pls_inputs; + std::vector pls_outputs; + std::string pls_decl(const PlsRemap &variable); + const char *to_pls_qualifiers_glsl(const SPIRVariable &variable); + void emit_pls(); + void remap_pls_variables(); + + // GL_EXT_shader_framebuffer_fetch support. + std::vector> subpass_to_framebuffer_fetch_attachment; + std::vector> inout_color_attachments; + bool location_is_framebuffer_fetch(uint32_t location) const; + bool location_is_non_coherent_framebuffer_fetch(uint32_t location) const; + bool subpass_input_is_framebuffer_fetch(uint32_t id) const; + void emit_inout_fragment_outputs_copy_to_subpass_inputs(); + const SPIRVariable *find_subpass_input_by_attachment_index(uint32_t index) const; + const SPIRVariable *find_color_output_by_location(uint32_t location) const; + + // A variant which takes two sets of name. The secondary is only used to verify there are no collisions, + // but the set is not updated when we have found a new name. + // Used primarily when adding block interface names. + void add_variable(std::unordered_set &variables_primary, + const std::unordered_set &variables_secondary, std::string &name); + + void check_function_call_constraints(const uint32_t *args, uint32_t length); + void handle_invalid_expression(uint32_t id); + void force_temporary_and_recompile(uint32_t id); + void find_static_extensions(); + + uint32_t consume_temporary_in_precision_context(uint32_t type_id, uint32_t id, Options::Precision precision); + std::unordered_map temporary_to_mirror_precision_alias; + std::unordered_set composite_insert_overwritten; + std::unordered_set block_composite_insert_overwrite; + + std::string emit_for_loop_initializers(const SPIRBlock &block); + void emit_while_loop_initializers(const SPIRBlock &block); + bool for_loop_initializers_are_same_type(const SPIRBlock &block); + bool optimize_read_modify_write(const SPIRType &type, const std::string &lhs, const std::string &rhs); + void fixup_image_load_store_access(); + + bool type_is_empty(const SPIRType &type); + + bool can_use_io_location(StorageClass storage, bool block); + const Instruction *get_next_instruction_in_block(const Instruction &instr); + static uint32_t mask_relevant_memory_semantics(uint32_t semantics); + + std::string convert_floate4m3_to_string(const SPIRConstant &value, uint32_t col, uint32_t row); + std::string convert_floate5m2_to_string(const SPIRConstant &value, uint32_t col, uint32_t row); + std::string convert_half_to_string(const SPIRConstant &value, uint32_t col, uint32_t row); + std::string convert_float_to_string(const SPIRConstant &value, uint32_t col, uint32_t row); + std::string convert_double_to_string(const SPIRConstant &value, uint32_t col, uint32_t row); + + std::string convert_separate_image_to_expression(uint32_t id); + + // Builtins in GLSL are always specific signedness, but the SPIR-V can declare them + // as either unsigned or signed. + // Sometimes we will need to automatically perform casts on load and store to make this work. + virtual SPIRType::BaseType get_builtin_basetype(BuiltIn builtin, SPIRType::BaseType default_type); + virtual void cast_to_variable_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type); + virtual void cast_from_variable_load(uint32_t source_id, std::string &expr, const SPIRType &expr_type); + void unroll_array_from_complex_load(uint32_t target_id, uint32_t source_id, std::string &expr); + bool unroll_array_to_complex_store(uint32_t target_id, uint32_t source_id); + void convert_non_uniform_expression(std::string &expr, uint32_t ptr_id); + + void handle_store_to_invariant_variable(uint32_t store_id, uint32_t value_id); + void disallow_forwarding_in_expression_chain(const SPIRExpression &expr); + + bool expression_is_constant_null(uint32_t id) const; + bool expression_is_non_value_type_array(uint32_t ptr); + virtual void emit_store_statement(uint32_t lhs_expression, uint32_t rhs_expression); + + uint32_t get_integer_width_for_instruction(const Instruction &instr) const; + uint32_t get_integer_width_for_glsl_instruction(GLSLstd450 op, const uint32_t *arguments, uint32_t length) const; + + bool variable_is_lut(const SPIRVariable &var) const; + + char current_locale_radix_character = '.'; + + void fixup_type_alias(); + void reorder_type_alias(); + void fixup_anonymous_struct_names(); + void fixup_anonymous_struct_names(std::unordered_set &visited, const SPIRType &type); + + static const char *vector_swizzle(int vecsize, int index); + + bool is_stage_output_location_masked(uint32_t location, uint32_t component) const; + bool is_stage_output_builtin_masked(BuiltIn builtin) const; + bool is_stage_output_variable_masked(const SPIRVariable &var) const; + bool is_stage_output_block_member_masked(const SPIRVariable &var, uint32_t index, bool strip_array) const; + bool is_per_primitive_variable(const SPIRVariable &var) const; + uint32_t get_accumulated_member_location(const SPIRVariable &var, uint32_t mbr_idx, bool strip_array) const; + uint32_t get_declared_member_location(const SPIRVariable &var, uint32_t mbr_idx, bool strip_array) const; + std::unordered_set masked_output_locations; + std::unordered_set masked_output_builtins; + + FloatFormatter *float_formatter = nullptr; + std::string format_float(float value) const; + std::string format_double(double value) const; + + uint32_t get_fp_fast_math_flags_for_op(uint32_t result_type, uint32_t id) const; + bool has_legacy_nocontract(uint32_t result_type, uint32_t id) const; + +private: + void init(); + + SmallVector get_composite_constant_ids(ConstantID const_id); + void fill_composite_constant(SPIRConstant &constant, TypeID type_id, const SmallVector &initializers); + void set_composite_constant(ConstantID const_id, TypeID type_id, const SmallVector &initializers); + TypeID get_composite_member_type(TypeID type_id, uint32_t member_idx); + std::unordered_map> const_composite_insert_ids; +}; +} // namespace SPIRV_CROSS_NAMESPACE + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_hlsl.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_hlsl.cpp new file mode 100644 index 0000000000..a18fa3c602 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_hlsl.cpp @@ -0,0 +1,7240 @@ +/* + * Copyright 2016-2021 Robert Konrad + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#include "spirv_hlsl.hpp" +#include "GLSL.std.450.h" +#include +#include + +using namespace SPIRV_CROSS_SPV_HEADER_NAMESPACE; +using namespace SPIRV_CROSS_NAMESPACE; +using namespace std; + +enum class ImageFormatNormalizedState +{ + None = 0, + Unorm = 1, + Snorm = 2 +}; + +static ImageFormatNormalizedState image_format_to_normalized_state(ImageFormat fmt) +{ + switch (fmt) + { + case ImageFormatR8: + case ImageFormatR16: + case ImageFormatRg8: + case ImageFormatRg16: + case ImageFormatRgba8: + case ImageFormatRgba16: + case ImageFormatRgb10A2: + return ImageFormatNormalizedState::Unorm; + + case ImageFormatR8Snorm: + case ImageFormatR16Snorm: + case ImageFormatRg8Snorm: + case ImageFormatRg16Snorm: + case ImageFormatRgba8Snorm: + case ImageFormatRgba16Snorm: + return ImageFormatNormalizedState::Snorm; + + default: + break; + } + + return ImageFormatNormalizedState::None; +} + +static unsigned image_format_to_components(ImageFormat fmt) +{ + switch (fmt) + { + case ImageFormatR8: + case ImageFormatR16: + case ImageFormatR8Snorm: + case ImageFormatR16Snorm: + case ImageFormatR16f: + case ImageFormatR32f: + case ImageFormatR8i: + case ImageFormatR16i: + case ImageFormatR32i: + case ImageFormatR8ui: + case ImageFormatR16ui: + case ImageFormatR32ui: + return 1; + + case ImageFormatRg8: + case ImageFormatRg16: + case ImageFormatRg8Snorm: + case ImageFormatRg16Snorm: + case ImageFormatRg16f: + case ImageFormatRg32f: + case ImageFormatRg8i: + case ImageFormatRg16i: + case ImageFormatRg32i: + case ImageFormatRg8ui: + case ImageFormatRg16ui: + case ImageFormatRg32ui: + return 2; + + case ImageFormatR11fG11fB10f: + return 3; + + case ImageFormatRgba8: + case ImageFormatRgba16: + case ImageFormatRgb10A2: + case ImageFormatRgba8Snorm: + case ImageFormatRgba16Snorm: + case ImageFormatRgba16f: + case ImageFormatRgba32f: + case ImageFormatRgba8i: + case ImageFormatRgba16i: + case ImageFormatRgba32i: + case ImageFormatRgba8ui: + case ImageFormatRgba16ui: + case ImageFormatRgba32ui: + case ImageFormatRgb10a2ui: + return 4; + + case ImageFormatUnknown: + return 4; // Assume 4. + + default: + SPIRV_CROSS_THROW("Unrecognized typed image format."); + } +} + +static string image_format_to_type(ImageFormat fmt, SPIRType::BaseType basetype) +{ + switch (fmt) + { + case ImageFormatR8: + case ImageFormatR16: + if (basetype != SPIRType::Float) + SPIRV_CROSS_THROW("Mismatch in image type and base type of image."); + return "unorm float"; + case ImageFormatRg8: + case ImageFormatRg16: + if (basetype != SPIRType::Float) + SPIRV_CROSS_THROW("Mismatch in image type and base type of image."); + return "unorm float2"; + case ImageFormatRgba8: + case ImageFormatRgba16: + if (basetype != SPIRType::Float) + SPIRV_CROSS_THROW("Mismatch in image type and base type of image."); + return "unorm float4"; + case ImageFormatRgb10A2: + if (basetype != SPIRType::Float) + SPIRV_CROSS_THROW("Mismatch in image type and base type of image."); + return "unorm float4"; + + case ImageFormatR8Snorm: + case ImageFormatR16Snorm: + if (basetype != SPIRType::Float) + SPIRV_CROSS_THROW("Mismatch in image type and base type of image."); + return "snorm float"; + case ImageFormatRg8Snorm: + case ImageFormatRg16Snorm: + if (basetype != SPIRType::Float) + SPIRV_CROSS_THROW("Mismatch in image type and base type of image."); + return "snorm float2"; + case ImageFormatRgba8Snorm: + case ImageFormatRgba16Snorm: + if (basetype != SPIRType::Float) + SPIRV_CROSS_THROW("Mismatch in image type and base type of image."); + return "snorm float4"; + + case ImageFormatR16f: + case ImageFormatR32f: + if (basetype != SPIRType::Float) + SPIRV_CROSS_THROW("Mismatch in image type and base type of image."); + return "float"; + case ImageFormatRg16f: + case ImageFormatRg32f: + if (basetype != SPIRType::Float) + SPIRV_CROSS_THROW("Mismatch in image type and base type of image."); + return "float2"; + case ImageFormatRgba16f: + case ImageFormatRgba32f: + if (basetype != SPIRType::Float) + SPIRV_CROSS_THROW("Mismatch in image type and base type of image."); + return "float4"; + + case ImageFormatR11fG11fB10f: + if (basetype != SPIRType::Float) + SPIRV_CROSS_THROW("Mismatch in image type and base type of image."); + return "float3"; + + case ImageFormatR8i: + case ImageFormatR16i: + case ImageFormatR32i: + if (basetype != SPIRType::Int) + SPIRV_CROSS_THROW("Mismatch in image type and base type of image."); + return "int"; + case ImageFormatRg8i: + case ImageFormatRg16i: + case ImageFormatRg32i: + if (basetype != SPIRType::Int) + SPIRV_CROSS_THROW("Mismatch in image type and base type of image."); + return "int2"; + case ImageFormatRgba8i: + case ImageFormatRgba16i: + case ImageFormatRgba32i: + if (basetype != SPIRType::Int) + SPIRV_CROSS_THROW("Mismatch in image type and base type of image."); + return "int4"; + + case ImageFormatR8ui: + case ImageFormatR16ui: + case ImageFormatR32ui: + if (basetype != SPIRType::UInt) + SPIRV_CROSS_THROW("Mismatch in image type and base type of image."); + return "uint"; + case ImageFormatRg8ui: + case ImageFormatRg16ui: + case ImageFormatRg32ui: + if (basetype != SPIRType::UInt) + SPIRV_CROSS_THROW("Mismatch in image type and base type of image."); + return "uint2"; + case ImageFormatRgba8ui: + case ImageFormatRgba16ui: + case ImageFormatRgba32ui: + if (basetype != SPIRType::UInt) + SPIRV_CROSS_THROW("Mismatch in image type and base type of image."); + return "uint4"; + case ImageFormatRgb10a2ui: + if (basetype != SPIRType::UInt) + SPIRV_CROSS_THROW("Mismatch in image type and base type of image."); + return "uint4"; + + case ImageFormatUnknown: + switch (basetype) + { + case SPIRType::Float: + return "float4"; + case SPIRType::Int: + return "int4"; + case SPIRType::UInt: + return "uint4"; + default: + SPIRV_CROSS_THROW("Unsupported base type for image."); + } + + default: + SPIRV_CROSS_THROW("Unrecognized typed image format."); + } +} + +string CompilerHLSL::image_type_hlsl_modern(const SPIRType &type, uint32_t id) +{ + auto &imagetype = get(type.image.type); + const char *dim = nullptr; + bool typed_load = false; + uint32_t components = 4; + + bool force_image_srv = hlsl_options.nonwritable_uav_texture_as_srv && has_decoration(id, DecorationNonWritable); + + switch (type.image.dim) + { + case Dim1D: + typed_load = type.image.sampled == 2; + dim = "1D"; + break; + case Dim2D: + typed_load = type.image.sampled == 2; + dim = "2D"; + break; + case Dim3D: + typed_load = type.image.sampled == 2; + dim = "3D"; + break; + case DimCube: + if (type.image.sampled == 2) + SPIRV_CROSS_THROW("RWTextureCube does not exist in HLSL."); + dim = "Cube"; + break; + case DimRect: + SPIRV_CROSS_THROW("Rectangle texture support is not yet implemented for HLSL."); // TODO + case DimBuffer: + if (type.image.sampled == 1) + return join("Buffer<", type_to_glsl(imagetype), components, ">"); + else if (type.image.sampled == 2) + { + if (interlocked_resources.count(id)) + return join("RasterizerOrderedBuffer<", image_format_to_type(type.image.format, imagetype.basetype), + ">"); + + typed_load = !force_image_srv && type.image.sampled == 2; + + const char *rw = force_image_srv ? "" : "RW"; + return join(rw, "Buffer<", + typed_load ? image_format_to_type(type.image.format, imagetype.basetype) : + join(type_to_glsl(imagetype), components), + ">"); + } + else + SPIRV_CROSS_THROW("Sampler buffers must be either sampled or unsampled. Cannot deduce in runtime."); + case DimSubpassData: + dim = "2D"; + typed_load = false; + break; + default: + SPIRV_CROSS_THROW("Invalid dimension."); + } + const char *arrayed = type.image.arrayed ? "Array" : ""; + const char *ms = type.image.ms ? "MS" : ""; + const char *rw = typed_load && !force_image_srv ? "RW" : ""; + + if (force_image_srv) + typed_load = false; + + if (typed_load && interlocked_resources.count(id)) + rw = "RasterizerOrdered"; + + return join(rw, "Texture", dim, ms, arrayed, "<", + typed_load ? image_format_to_type(type.image.format, imagetype.basetype) : + join(type_to_glsl(imagetype), components), + ">"); +} + +string CompilerHLSL::image_type_hlsl_legacy(const SPIRType &type, uint32_t /*id*/) +{ + auto &imagetype = get(type.image.type); + string res; + + switch (imagetype.basetype) + { + case SPIRType::Int: + res = "i"; + break; + case SPIRType::UInt: + res = "u"; + break; + default: + break; + } + + if (type.basetype == SPIRType::Image && type.image.dim == DimSubpassData) + return res + "subpassInput" + (type.image.ms ? "MS" : ""); + + // If we're emulating subpassInput with samplers, force sampler2D + // so we don't have to specify format. + if (type.basetype == SPIRType::Image && type.image.dim != DimSubpassData) + { + // Sampler buffers are always declared as samplerBuffer even though they might be separate images in the SPIR-V. + if (type.image.dim == DimBuffer && type.image.sampled == 1) + res += "sampler"; + else + res += type.image.sampled == 2 ? "image" : "texture"; + } + else + res += "sampler"; + + switch (type.image.dim) + { + case Dim1D: + res += "1D"; + break; + case Dim2D: + res += "2D"; + break; + case Dim3D: + res += "3D"; + break; + case DimCube: + res += "CUBE"; + break; + + case DimBuffer: + res += "Buffer"; + break; + + case DimSubpassData: + res += "2D"; + break; + default: + SPIRV_CROSS_THROW("Only 1D, 2D, 3D, Buffer, InputTarget and Cube textures supported."); + } + + if (type.image.ms) + res += "MS"; + if (type.image.arrayed) + res += "Array"; + + return res; +} + +string CompilerHLSL::image_type_hlsl(const SPIRType &type, uint32_t id) +{ + if (hlsl_options.shader_model <= 30) + return image_type_hlsl_legacy(type, id); + else + return image_type_hlsl_modern(type, id); +} + +// The optional id parameter indicates the object whose type we are trying +// to find the description for. It is optional. Most type descriptions do not +// depend on a specific object's use of that type. +string CompilerHLSL::type_to_glsl(const SPIRType &type, uint32_t id) +{ + // Ignore the pointer type since GLSL doesn't have pointers. + + switch (type.basetype) + { + case SPIRType::Struct: + // Need OpName lookup here to get a "sensible" name for a struct. + if (backend.explicit_struct_type) + return join("struct ", to_name(type.self)); + else + return to_name(type.self); + + case SPIRType::Image: + case SPIRType::SampledImage: + return image_type_hlsl(type, id); + + case SPIRType::Sampler: + return comparison_ids.count(id) ? "SamplerComparisonState" : "SamplerState"; + + case SPIRType::Void: + return "void"; + + default: + break; + } + + if (type.vecsize == 1 && type.columns == 1) // Scalar builtin + { + switch (type.basetype) + { + case SPIRType::Boolean: + return "bool"; + case SPIRType::Int: + return backend.basic_int_type; + case SPIRType::UInt: + return backend.basic_uint_type; + case SPIRType::AtomicCounter: + return "atomic_uint"; + case SPIRType::Half: + if (hlsl_options.enable_16bit_types) + return "half"; + else + return "min16float"; + case SPIRType::Short: + if (hlsl_options.enable_16bit_types) + return "int16_t"; + else + return "min16int"; + case SPIRType::UShort: + if (hlsl_options.enable_16bit_types) + return "uint16_t"; + else + return "min16uint"; + case SPIRType::Float: + return "float"; + case SPIRType::Double: + return "double"; + case SPIRType::Int64: + if (hlsl_options.shader_model < 60) + SPIRV_CROSS_THROW("64-bit integers only supported in SM 6.0."); + return "int64_t"; + case SPIRType::UInt64: + if (hlsl_options.shader_model < 60) + SPIRV_CROSS_THROW("64-bit integers only supported in SM 6.0."); + return "uint64_t"; + case SPIRType::AccelerationStructure: + return "RaytracingAccelerationStructure"; + case SPIRType::RayQuery: + return "RayQuery"; + default: + return "???"; + } + } + else if (type.vecsize > 1 && type.columns == 1) // Vector builtin + { + switch (type.basetype) + { + case SPIRType::Boolean: + return join("bool", type.vecsize); + case SPIRType::Int: + return join("int", type.vecsize); + case SPIRType::UInt: + return join("uint", type.vecsize); + case SPIRType::Half: + return join(hlsl_options.enable_16bit_types ? "half" : "min16float", type.vecsize); + case SPIRType::Short: + return join(hlsl_options.enable_16bit_types ? "int16_t" : "min16int", type.vecsize); + case SPIRType::UShort: + return join(hlsl_options.enable_16bit_types ? "uint16_t" : "min16uint", type.vecsize); + case SPIRType::Float: + return join("float", type.vecsize); + case SPIRType::Double: + return join("double", type.vecsize); + case SPIRType::Int64: + return join("int64_t", type.vecsize); + case SPIRType::UInt64: + return join("uint64_t", type.vecsize); + default: + return "???"; + } + } + else + { + switch (type.basetype) + { + case SPIRType::Boolean: + return join("bool", type.columns, "x", type.vecsize); + case SPIRType::Int: + return join("int", type.columns, "x", type.vecsize); + case SPIRType::UInt: + return join("uint", type.columns, "x", type.vecsize); + case SPIRType::Half: + return join(hlsl_options.enable_16bit_types ? "half" : "min16float", type.columns, "x", type.vecsize); + case SPIRType::Short: + return join(hlsl_options.enable_16bit_types ? "int16_t" : "min16int", type.columns, "x", type.vecsize); + case SPIRType::UShort: + return join(hlsl_options.enable_16bit_types ? "uint16_t" : "min16uint", type.columns, "x", type.vecsize); + case SPIRType::Float: + return join("float", type.columns, "x", type.vecsize); + case SPIRType::Double: + return join("double", type.columns, "x", type.vecsize); + // Matrix types not supported for int64/uint64. + default: + return "???"; + } + } +} + +void CompilerHLSL::emit_header() +{ + for (auto &header : header_lines) + statement(header); + + if (header_lines.size() > 0) + { + statement(""); + } +} + +void CompilerHLSL::emit_interface_block_globally(const SPIRVariable &var) +{ + add_resource_name(var.self); + + // The global copies of I/O variables should not contain interpolation qualifiers. + // These are emitted inside the interface structs. + auto &flags = ir.meta[var.self].decoration.decoration_flags; + auto old_flags = flags; + flags.reset(); + statement("static ", variable_decl(var), ";"); + flags = old_flags; +} + +const char *CompilerHLSL::to_storage_qualifiers_glsl(const SPIRVariable &var) +{ + // Input and output variables are handled specially in HLSL backend. + // The variables are declared as global, private variables, and do not need any qualifiers. + if (var.storage == StorageClassUniformConstant || var.storage == StorageClassUniform || + var.storage == StorageClassPushConstant) + { + return "uniform "; + } + + return ""; +} + +void CompilerHLSL::emit_builtin_outputs_in_struct() +{ + auto &execution = get_entry_point(); + + bool legacy = hlsl_options.shader_model <= 30; + active_output_builtins.for_each_bit([&](uint32_t i) { + const char *type = nullptr; + const char *semantic = nullptr; + auto builtin = static_cast(i); + switch (builtin) + { + case BuiltInPosition: + type = is_position_invariant() && backend.support_precise_qualifier ? "precise float4" : "float4"; + semantic = legacy ? "POSITION" : "SV_Position"; + break; + + case BuiltInSampleMask: + if (hlsl_options.shader_model < 41 || execution.model != ExecutionModelFragment) + SPIRV_CROSS_THROW("Sample Mask output is only supported in PS 4.1 or higher."); + type = "uint"; + semantic = "SV_Coverage"; + break; + + case BuiltInFragDepth: + type = "float"; + if (legacy) + { + semantic = "DEPTH"; + } + else + { + if (hlsl_options.shader_model >= 50 && execution.flags.get(ExecutionModeDepthGreater)) + semantic = "SV_DepthGreaterEqual"; + else if (hlsl_options.shader_model >= 50 && execution.flags.get(ExecutionModeDepthLess)) + semantic = "SV_DepthLessEqual"; + else + semantic = "SV_Depth"; + } + break; + + case BuiltInClipDistance: + { + static const char *types[] = { "float", "float2", "float3", "float4" }; + + // HLSL is a bit weird here, use SV_ClipDistance0, SV_ClipDistance1 and so on with vectors. + if (execution.model == ExecutionModelMeshEXT) + { + if (clip_distance_count > 4) + SPIRV_CROSS_THROW("Clip distance count > 4 not supported for mesh shaders."); + + if (clip_distance_count == 1) + { + // Avoids having to hack up access_chain code. Makes it trivially indexable. + statement("float gl_ClipDistance[1] : SV_ClipDistance;"); + } + else + { + // Replace array with vector directly, avoids any weird fixup path. + statement(types[clip_distance_count - 1], " gl_ClipDistance : SV_ClipDistance;"); + } + } + else + { + for (uint32_t clip = 0; clip < clip_distance_count; clip += 4) + { + uint32_t to_declare = clip_distance_count - clip; + if (to_declare > 4) + to_declare = 4; + + uint32_t semantic_index = clip / 4; + + statement(types[to_declare - 1], " ", builtin_to_glsl(builtin, StorageClassOutput), semantic_index, + " : SV_ClipDistance", semantic_index, ";"); + } + } + break; + } + + case BuiltInCullDistance: + { + static const char *types[] = { "float", "float2", "float3", "float4" }; + + // HLSL is a bit weird here, use SV_CullDistance0, SV_CullDistance1 and so on with vectors. + if (execution.model == ExecutionModelMeshEXT) + { + if (cull_distance_count > 4) + SPIRV_CROSS_THROW("Cull distance count > 4 not supported for mesh shaders."); + + if (cull_distance_count == 1) + { + // Avoids having to hack up access_chain code. Makes it trivially indexable. + statement("float gl_CullDistance[1] : SV_CullDistance;"); + } + else + { + // Replace array with vector directly, avoids any weird fixup path. + statement(types[cull_distance_count - 1], " gl_CullDistance : SV_CullDistance;"); + } + } + else + { + for (uint32_t cull = 0; cull < cull_distance_count; cull += 4) + { + uint32_t to_declare = cull_distance_count - cull; + if (to_declare > 4) + to_declare = 4; + + uint32_t semantic_index = cull / 4; + + statement(types[to_declare - 1], " ", builtin_to_glsl(builtin, StorageClassOutput), semantic_index, + " : SV_CullDistance", semantic_index, ";"); + } + } + break; + } + + case BuiltInPointSize: + // If point_size_compat is enabled, just ignore PointSize. + // PointSize does not exist in HLSL, but some code bases might want to be able to use these shaders, + // even if it means working around the missing feature. + if (legacy) + { + type = "float"; + semantic = "PSIZE"; + } + else if (!hlsl_options.point_size_compat) + SPIRV_CROSS_THROW("Unsupported builtin in HLSL."); + break; + + case BuiltInLayer: + case BuiltInPrimitiveId: + case BuiltInViewportIndex: + case BuiltInPrimitiveShadingRateKHR: + case BuiltInCullPrimitiveEXT: + // per-primitive attributes handled separatly + break; + + case BuiltInPrimitivePointIndicesEXT: + case BuiltInPrimitiveLineIndicesEXT: + case BuiltInPrimitiveTriangleIndicesEXT: + // meshlet local-index buffer handled separatly + break; + + default: + SPIRV_CROSS_THROW("Unsupported builtin in HLSL."); + } + + if (type && semantic) + statement(type, " ", builtin_to_glsl(builtin, StorageClassOutput), " : ", semantic, ";"); + }); +} + +void CompilerHLSL::emit_builtin_primitive_outputs_in_struct() +{ + active_output_builtins.for_each_bit([&](uint32_t i) { + const char *type = nullptr; + const char *semantic = nullptr; + auto builtin = static_cast(i); + switch (builtin) + { + case BuiltInLayer: + { + if (hlsl_options.shader_model < 50) + SPIRV_CROSS_THROW("Render target array index output is only supported in SM 5.0 or higher."); + type = "uint"; + semantic = "SV_RenderTargetArrayIndex"; + break; + } + + case BuiltInPrimitiveId: + type = "uint"; + semantic = "SV_PrimitiveID"; + break; + + case BuiltInViewportIndex: + type = "uint"; + semantic = "SV_ViewportArrayIndex"; + break; + + case BuiltInPrimitiveShadingRateKHR: + type = "uint"; + semantic = "SV_ShadingRate"; + break; + + case BuiltInCullPrimitiveEXT: + type = "bool"; + semantic = "SV_CullPrimitive"; + break; + + default: + break; + } + + if (type && semantic) + statement(type, " ", builtin_to_glsl(builtin, StorageClassOutput), " : ", semantic, ";"); + }); +} + +void CompilerHLSL::emit_builtin_inputs_in_struct() +{ + bool legacy = hlsl_options.shader_model <= 30; + active_input_builtins.for_each_bit([&](uint32_t i) { + const char *type = nullptr; + const char *semantic = nullptr; + auto builtin = static_cast(i); + switch (builtin) + { + case BuiltInFragCoord: + type = "float4"; + semantic = legacy ? "VPOS" : "SV_Position"; + break; + + case BuiltInVertexId: + case BuiltInVertexIndex: + if (legacy) + SPIRV_CROSS_THROW("Vertex index not supported in SM 3.0 or lower."); + type = "uint"; + semantic = "SV_VertexID"; + break; + + case BuiltInPrimitiveId: + type = "uint"; + semantic = "SV_PrimitiveID"; + break; + + case BuiltInInstanceId: + case BuiltInInstanceIndex: + if (legacy) + SPIRV_CROSS_THROW("Instance index not supported in SM 3.0 or lower."); + type = "uint"; + semantic = "SV_InstanceID"; + break; + + case BuiltInSampleId: + if (legacy) + SPIRV_CROSS_THROW("Sample ID not supported in SM 3.0 or lower."); + type = "uint"; + semantic = "SV_SampleIndex"; + break; + + case BuiltInSampleMask: + if (hlsl_options.shader_model < 50 || get_entry_point().model != ExecutionModelFragment) + SPIRV_CROSS_THROW("Sample Mask input is only supported in PS 5.0 or higher."); + type = "uint"; + semantic = "SV_Coverage"; + break; + + case BuiltInGlobalInvocationId: + type = "uint3"; + semantic = "SV_DispatchThreadID"; + break; + + case BuiltInLocalInvocationId: + type = "uint3"; + semantic = "SV_GroupThreadID"; + break; + + case BuiltInLocalInvocationIndex: + type = "uint"; + semantic = "SV_GroupIndex"; + break; + + case BuiltInWorkgroupId: + type = "uint3"; + semantic = "SV_GroupID"; + break; + + case BuiltInFrontFacing: + type = "bool"; + semantic = "SV_IsFrontFace"; + break; + + case BuiltInViewIndex: + if (hlsl_options.shader_model < 61 || (get_entry_point().model != ExecutionModelVertex && get_entry_point().model != ExecutionModelFragment)) + SPIRV_CROSS_THROW("View Index input is only supported in VS and PS 6.1 or higher."); + type = "uint"; + semantic = "SV_ViewID"; + break; + + case BuiltInNumWorkgroups: + case BuiltInSubgroupSize: + case BuiltInSubgroupLocalInvocationId: + case BuiltInSubgroupEqMask: + case BuiltInSubgroupLtMask: + case BuiltInSubgroupLeMask: + case BuiltInSubgroupGtMask: + case BuiltInSubgroupGeMask: + // Handled specially. + break; + + case BuiltInBaseVertex: + if (hlsl_options.shader_model >= 68) + { + type = "uint"; + semantic = "SV_StartVertexLocation"; + } + break; + + case BuiltInBaseInstance: + if (hlsl_options.shader_model >= 68) + { + type = "uint"; + semantic = "SV_StartInstanceLocation"; + } + break; + + case BuiltInHelperInvocation: + if (hlsl_options.shader_model < 50 || get_entry_point().model != ExecutionModelFragment) + SPIRV_CROSS_THROW("Helper Invocation input is only supported in PS 5.0 or higher."); + break; + + case BuiltInClipDistance: + // HLSL is a bit weird here, use SV_ClipDistance0, SV_ClipDistance1 and so on with vectors. + for (uint32_t clip = 0; clip < clip_distance_count; clip += 4) + { + uint32_t to_declare = clip_distance_count - clip; + if (to_declare > 4) + to_declare = 4; + + uint32_t semantic_index = clip / 4; + + static const char *types[] = { "float", "float2", "float3", "float4" }; + statement(types[to_declare - 1], " ", builtin_to_glsl(builtin, StorageClassInput), semantic_index, + " : SV_ClipDistance", semantic_index, ";"); + } + break; + + case BuiltInCullDistance: + // HLSL is a bit weird here, use SV_CullDistance0, SV_CullDistance1 and so on with vectors. + for (uint32_t cull = 0; cull < cull_distance_count; cull += 4) + { + uint32_t to_declare = cull_distance_count - cull; + if (to_declare > 4) + to_declare = 4; + + uint32_t semantic_index = cull / 4; + + static const char *types[] = { "float", "float2", "float3", "float4" }; + statement(types[to_declare - 1], " ", builtin_to_glsl(builtin, StorageClassInput), semantic_index, + " : SV_CullDistance", semantic_index, ";"); + } + break; + + case BuiltInPointCoord: + // PointCoord is not supported, but provide a way to just ignore that, similar to PointSize. + if (hlsl_options.point_coord_compat) + break; + else + SPIRV_CROSS_THROW("Unsupported builtin in HLSL."); + + case BuiltInLayer: + if (hlsl_options.shader_model < 50 || get_entry_point().model != ExecutionModelFragment) + SPIRV_CROSS_THROW("Render target array index input is only supported in PS 5.0 or higher."); + type = "uint"; + semantic = "SV_RenderTargetArrayIndex"; + break; + + case BuiltInBaryCoordKHR: + case BuiltInBaryCoordNoPerspKHR: + if (hlsl_options.shader_model < 61) + SPIRV_CROSS_THROW("SM 6.1 is required for barycentrics."); + type = builtin == BuiltInBaryCoordNoPerspKHR ? "noperspective float3" : "float3"; + if (active_input_builtins.get(BuiltInBaryCoordKHR) && active_input_builtins.get(BuiltInBaryCoordNoPerspKHR)) + semantic = builtin == BuiltInBaryCoordKHR ? "SV_Barycentrics0" : "SV_Barycentrics1"; + else + semantic = "SV_Barycentrics"; + break; + + default: + SPIRV_CROSS_THROW("Unsupported builtin in HLSL."); + } + + if (type && semantic) + statement(type, " ", builtin_to_glsl(builtin, StorageClassInput), " : ", semantic, ";"); + }); +} + +uint32_t CompilerHLSL::type_to_consumed_locations(const SPIRType &type) const +{ + // TODO: Need to verify correctness. + uint32_t elements = 0; + + if (type.basetype == SPIRType::Struct) + { + for (uint32_t i = 0; i < uint32_t(type.member_types.size()); i++) + elements += type_to_consumed_locations(get(type.member_types[i])); + } + else + { + uint32_t array_multiplier = 1; + for (uint32_t i = 0; i < uint32_t(type.array.size()); i++) + { + if (type.array_size_literal[i]) + array_multiplier *= type.array[i]; + else + array_multiplier *= evaluate_constant_u32(type.array[i]); + } + elements += array_multiplier * type.columns; + } + return elements; +} + +string CompilerHLSL::to_interpolation_qualifiers(const Bitset &flags) +{ + string res; + //if (flags & (1ull << DecorationSmooth)) + // res += "linear "; + if (flags.get(DecorationFlat) || flags.get(DecorationPerVertexKHR)) + res += "nointerpolation "; + if (flags.get(DecorationNoPerspective)) + res += "noperspective "; + if (flags.get(DecorationCentroid)) + res += "centroid "; + if (flags.get(DecorationPatch)) + res += "patch "; // Seems to be different in actual HLSL. + if (flags.get(DecorationSample)) + res += "sample "; + if (flags.get(DecorationInvariant) && backend.support_precise_qualifier) + res += "precise "; // Not supported? + + return res; +} + +std::string CompilerHLSL::to_semantic(uint32_t location, ExecutionModel em, StorageClass sc) +{ + if (em == ExecutionModelVertex && sc == StorageClassInput) + { + // We have a vertex attribute - we should look at remapping it if the user provided + // vertex attribute hints. + for (auto &attribute : remap_vertex_attributes) + if (attribute.location == location) + return attribute.semantic; + } + + // Not a vertex attribute, or no remap_vertex_attributes entry. + return join("TEXCOORD", location); +} + +std::string CompilerHLSL::to_initializer_expression(const SPIRVariable &var) +{ + // We cannot emit static const initializer for block constants for practical reasons, + // so just inline the initializer. + // FIXME: There is a theoretical problem here if someone tries to composite extract + // into this initializer since we don't declare it properly, but that is somewhat non-sensical. + auto &type = get(var.basetype); + bool is_block = has_decoration(type.self, DecorationBlock); + auto *c = maybe_get(var.initializer); + if (is_block && c) + return constant_expression(*c); + else + return CompilerGLSL::to_initializer_expression(var); +} + +void CompilerHLSL::emit_interface_block_member_in_struct(const SPIRVariable &var, uint32_t member_index, + uint32_t location, + std::unordered_set &active_locations) +{ + auto &execution = get_entry_point(); + auto type = get(var.basetype); + + std::string semantic; + if (hlsl_options.user_semantic && has_member_decoration(var.self, member_index, DecorationUserSemantic)) + semantic = get_member_decoration_string(var.self, member_index, DecorationUserSemantic); + else + semantic = to_semantic(location, execution.model, var.storage); + + auto mbr_name = join(to_name(type.self), "_", to_member_name(type, member_index)); + auto &mbr_type = get(type.member_types[member_index]); + + Bitset member_decorations = get_member_decoration_bitset(type.self, member_index); + if (has_decoration(var.self, DecorationPerVertexKHR)) + member_decorations.set(DecorationPerVertexKHR); + + statement(to_interpolation_qualifiers(member_decorations), + type_to_glsl(mbr_type), + " ", mbr_name, type_to_array_glsl(mbr_type, var.self), + " : ", semantic, ";"); + + // Structs and arrays should consume more locations. + uint32_t consumed_locations = type_to_consumed_locations(mbr_type); + for (uint32_t i = 0; i < consumed_locations; i++) + active_locations.insert(location + i); +} + +void CompilerHLSL::emit_interface_block_in_struct(const SPIRVariable &var, unordered_set &active_locations) +{ + auto &execution = get_entry_point(); + auto type = get(var.basetype); + + string binding; + bool use_location_number = true; + bool need_matrix_unroll = false; + bool legacy = hlsl_options.shader_model <= 30; + if (execution.model == ExecutionModelFragment && var.storage == StorageClassOutput) + { + // Dual-source blending is achieved in HLSL by emitting to SV_Target0 and 1. + uint32_t index = get_decoration(var.self, DecorationIndex); + uint32_t location = get_decoration(var.self, DecorationLocation); + + if (index != 0 && location != 0) + SPIRV_CROSS_THROW("Dual-source blending is only supported on MRT #0 in HLSL."); + + binding = join(legacy ? "COLOR" : "SV_Target", location + index); + use_location_number = false; + if (legacy) // COLOR must be a four-component vector on legacy shader model targets (HLSL ERR_COLOR_4COMP) + type.vecsize = 4; + } + else if (var.storage == StorageClassInput && execution.model == ExecutionModelVertex) + { + need_matrix_unroll = true; + if (legacy) // Inputs must be floating-point in legacy targets. + type.basetype = SPIRType::Float; + } + + const auto get_vacant_location = [&]() -> uint32_t { + for (uint32_t i = 0; i < 64; i++) + if (!active_locations.count(i)) + return i; + SPIRV_CROSS_THROW("All locations from 0 to 63 are exhausted."); + }; + + auto name = to_name(var.self); + if (use_location_number) + { + uint32_t location_number = UINT32_MAX; + + std::string semantic; + bool has_user_semantic = false; + + if (hlsl_options.user_semantic && has_decoration(var.self, DecorationUserSemantic)) + { + semantic = get_decoration_string(var.self, DecorationUserSemantic); + has_user_semantic = true; + } + else + { + // If an explicit location exists, use it with TEXCOORD[N] semantic. + // Otherwise, pick a vacant location. + if (has_decoration(var.self, DecorationLocation)) + location_number = get_decoration(var.self, DecorationLocation); + else + location_number = get_vacant_location(); + + // Allow semantic remap if specified. + semantic = to_semantic(location_number, execution.model, var.storage); + } + + if (need_matrix_unroll && type.columns > 1) + { + if (!type.array.empty()) + SPIRV_CROSS_THROW("Arrays of matrices used as input/output. This is not supported."); + + // Unroll matrices. + for (uint32_t i = 0; i < type.columns; i++) + { + SPIRType newtype = type; + newtype.columns = 1; + + string effective_semantic; + if (hlsl_options.flatten_matrix_vertex_input_semantics && !has_user_semantic) + effective_semantic = to_semantic(location_number, execution.model, var.storage); + else + effective_semantic = join(semantic, "_", i); + + statement(to_interpolation_qualifiers(get_decoration_bitset(var.self)), + variable_decl(newtype, join(name, "_", i)), " : ", effective_semantic, ";"); + if (location_number != UINT32_MAX) + active_locations.insert(location_number++); + } + } + else + { + auto decl_type = type; + if (execution.model == ExecutionModelMeshEXT || + (execution.model == ExecutionModelGeometry && var.storage == StorageClassInput) || + has_decoration(var.self, DecorationPerVertexKHR)) + { + decl_type.array.erase(decl_type.array.begin()); + decl_type.array_size_literal.erase(decl_type.array_size_literal.begin()); + } + statement(to_interpolation_qualifiers(get_decoration_bitset(var.self)), variable_decl(decl_type, name), " : ", + semantic, ";"); + + if (location_number != UINT32_MAX) + { + // Structs and arrays should consume more locations. + uint32_t consumed_locations = type_to_consumed_locations(decl_type); + for (uint32_t i = 0; i < consumed_locations; i++) + active_locations.insert(location_number + i); + } + } + } + else + { + statement(variable_decl(type, name), " : ", binding, ";"); + } +} + +std::string CompilerHLSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage) +{ + switch (builtin) + { + case BuiltInVertexId: + return "gl_VertexID"; + case BuiltInInstanceId: + return "gl_InstanceID"; + case BuiltInNumWorkgroups: + { + if (!num_workgroups_builtin) + SPIRV_CROSS_THROW("NumWorkgroups builtin is used, but remap_num_workgroups_builtin() was not called. " + "Cannot emit code for this builtin."); + + auto &var = get(num_workgroups_builtin); + auto &type = get(var.basetype); + auto ret = join(to_name(num_workgroups_builtin), "_", get_member_name(type.self, 0)); + ParsedIR::sanitize_underscores(ret); + return ret; + } + case BuiltInPointCoord: + // Crude hack, but there is no real alternative. This path is only enabled if point_coord_compat is set. + return "float2(0.5f, 0.5f)"; + case BuiltInSubgroupLocalInvocationId: + return "WaveGetLaneIndex()"; + case BuiltInSubgroupSize: + return "WaveGetLaneCount()"; + case BuiltInHelperInvocation: + return "IsHelperLane()"; + + default: + return CompilerGLSL::builtin_to_glsl(builtin, storage); + } +} + +void CompilerHLSL::emit_builtin_variables() +{ + Bitset builtins = active_input_builtins; + builtins.merge_or(active_output_builtins); + + std::unordered_map builtin_to_initializer; + + // We need to declare sample mask with the same type that module declares it. + // Sample mask is somewhat special in that SPIR-V has an array, and we can copy that array, so we need to + // match sign. + SPIRType::BaseType sample_mask_in_basetype = SPIRType::Void; + SPIRType::BaseType sample_mask_out_basetype = SPIRType::Void; + + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + if (!is_builtin_variable(var)) + return; + + auto &type = this->get(var.basetype); + auto builtin = BuiltIn(get_decoration(var.self, DecorationBuiltIn)); + + if (var.storage == StorageClassInput && builtin == BuiltInSampleMask) + sample_mask_in_basetype = type.basetype; + else if (var.storage == StorageClassOutput && builtin == BuiltInSampleMask) + sample_mask_out_basetype = type.basetype; + + if (var.initializer && var.storage == StorageClassOutput) + { + auto *c = this->maybe_get(var.initializer); + if (!c) + return; + + if (type.basetype == SPIRType::Struct) + { + uint32_t member_count = uint32_t(type.member_types.size()); + for (uint32_t i = 0; i < member_count; i++) + { + if (has_member_decoration(type.self, i, DecorationBuiltIn)) + { + builtin_to_initializer[get_member_decoration(type.self, i, DecorationBuiltIn)] = + c->subconstants[i]; + } + } + } + else if (has_decoration(var.self, DecorationBuiltIn)) + { + builtin_to_initializer[builtin] = var.initializer; + } + } + }); + + // Emit global variables for the interface variables which are statically used by the shader. + builtins.for_each_bit([&](uint32_t i) { + const char *type = nullptr; + auto builtin = static_cast(i); + uint32_t array_size = 0; + + string init_expr; + auto init_itr = builtin_to_initializer.find(builtin); + if (init_itr != builtin_to_initializer.end()) + init_expr = join(" = ", to_expression(init_itr->second)); + + if (get_execution_model() == ExecutionModelMeshEXT) + { + if (builtin == BuiltInPosition || builtin == BuiltInPointSize || builtin == BuiltInClipDistance || + builtin == BuiltInCullDistance || builtin == BuiltInLayer || builtin == BuiltInPrimitiveId || + builtin == BuiltInViewportIndex || builtin == BuiltInCullPrimitiveEXT || + builtin == BuiltInPrimitiveShadingRateKHR || builtin == BuiltInPrimitivePointIndicesEXT || + builtin == BuiltInPrimitiveLineIndicesEXT || builtin == BuiltInPrimitiveTriangleIndicesEXT) + { + return; + } + } + + switch (builtin) + { + case BuiltInFragCoord: + case BuiltInPosition: + type = "float4"; + break; + + case BuiltInFragDepth: + type = "float"; + break; + + case BuiltInVertexId: + case BuiltInVertexIndex: + case BuiltInInstanceIndex: + type = "int"; + if (hlsl_options.support_nonzero_base_vertex_base_instance || hlsl_options.shader_model >= 68) + base_vertex_info.used = true; + break; + + case BuiltInBaseVertex: + case BuiltInBaseInstance: + type = "int"; + base_vertex_info.used = true; + break; + + case BuiltInInstanceId: + case BuiltInSampleId: + type = "int"; + break; + + case BuiltInPointSize: + if (hlsl_options.point_size_compat || hlsl_options.shader_model <= 30) + { + // Just emit the global variable, it will be ignored. + type = "float"; + break; + } + else + SPIRV_CROSS_THROW(join("Unsupported builtin in HLSL: ", unsigned(builtin))); + + case BuiltInGlobalInvocationId: + case BuiltInLocalInvocationId: + case BuiltInWorkgroupId: + type = "uint3"; + break; + + case BuiltInLocalInvocationIndex: + type = "uint"; + break; + + case BuiltInFrontFacing: + type = "bool"; + break; + + case BuiltInNumWorkgroups: + case BuiltInPointCoord: + // Handled specially. + break; + + case BuiltInSubgroupLocalInvocationId: + case BuiltInSubgroupSize: + if (hlsl_options.shader_model < 60) + SPIRV_CROSS_THROW("Need SM 6.0 for Wave ops."); + break; + + case BuiltInSubgroupEqMask: + case BuiltInSubgroupLtMask: + case BuiltInSubgroupLeMask: + case BuiltInSubgroupGtMask: + case BuiltInSubgroupGeMask: + if (hlsl_options.shader_model < 60) + SPIRV_CROSS_THROW("Need SM 6.0 for Wave ops."); + type = "uint4"; + break; + + case BuiltInHelperInvocation: + if (hlsl_options.shader_model < 50) + SPIRV_CROSS_THROW("Need SM 5.0 for Helper Invocation."); + break; + + case BuiltInClipDistance: + array_size = clip_distance_count; + type = "float"; + break; + + case BuiltInCullDistance: + array_size = cull_distance_count; + type = "float"; + break; + + case BuiltInSampleMask: + if (active_input_builtins.get(BuiltInSampleMask)) + type = sample_mask_in_basetype == SPIRType::UInt ? "uint" : "int"; + else + type = sample_mask_out_basetype == SPIRType::UInt ? "uint" : "int"; + array_size = 1; + break; + + case BuiltInPrimitiveId: + case BuiltInViewIndex: + case BuiltInLayer: + type = "uint"; + break; + + case BuiltInViewportIndex: + case BuiltInPrimitiveShadingRateKHR: + case BuiltInPrimitiveLineIndicesEXT: + case BuiltInCullPrimitiveEXT: + type = "uint"; + break; + + case BuiltInBaryCoordKHR: + case BuiltInBaryCoordNoPerspKHR: + if (hlsl_options.shader_model < 61) + SPIRV_CROSS_THROW("Need SM 6.1 for barycentrics."); + type = "float3"; + break; + + default: + SPIRV_CROSS_THROW(join("Unsupported builtin in HLSL: ", unsigned(builtin))); + } + + StorageClass storage = active_input_builtins.get(i) ? StorageClassInput : StorageClassOutput; + + if (type) + { + if (array_size) + statement("static ", type, " ", builtin_to_glsl(builtin, storage), "[", array_size, "]", init_expr, ";"); + else + statement("static ", type, " ", builtin_to_glsl(builtin, storage), init_expr, ";"); + } + + // SampleMask can be both in and out with sample builtin, in this case we have already + // declared the input variable and we need to add the output one now. + if (builtin == BuiltInSampleMask && storage == StorageClassInput && this->active_output_builtins.get(i)) + { + type = sample_mask_out_basetype == SPIRType::UInt ? "uint" : "int"; + if (array_size) + statement("static ", type, " ", this->builtin_to_glsl(builtin, StorageClassOutput), "[", array_size, "]", init_expr, ";"); + else + statement("static ", type, " ", this->builtin_to_glsl(builtin, StorageClassOutput), init_expr, ";"); + } + }); + + if (base_vertex_info.used && hlsl_options.shader_model < 68) + { + string binding_info; + if (base_vertex_info.explicit_binding) + { + binding_info = join(" : register(b", base_vertex_info.register_index); + if (base_vertex_info.register_space) + binding_info += join(", space", base_vertex_info.register_space); + binding_info += ")"; + } + statement("cbuffer SPIRV_Cross_VertexInfo", binding_info); + begin_scope(); + statement("int SPIRV_Cross_BaseVertex;"); + statement("int SPIRV_Cross_BaseInstance;"); + end_scope_decl(); + statement(""); + } +} + +void CompilerHLSL::set_hlsl_aux_buffer_binding(HLSLAuxBinding binding, uint32_t register_index, uint32_t register_space) +{ + if (binding == HLSL_AUX_BINDING_BASE_VERTEX_INSTANCE) + { + base_vertex_info.explicit_binding = true; + base_vertex_info.register_space = register_space; + base_vertex_info.register_index = register_index; + } +} + +void CompilerHLSL::unset_hlsl_aux_buffer_binding(HLSLAuxBinding binding) +{ + if (binding == HLSL_AUX_BINDING_BASE_VERTEX_INSTANCE) + base_vertex_info.explicit_binding = false; +} + +bool CompilerHLSL::is_hlsl_aux_buffer_binding_used(HLSLAuxBinding binding) const +{ + if (binding == HLSL_AUX_BINDING_BASE_VERTEX_INSTANCE) + return base_vertex_info.used; + else + return false; +} + +void CompilerHLSL::emit_composite_constants() +{ + // HLSL cannot declare structs or arrays inline, so we must move them out to + // global constants directly. + bool emitted = false; + + ir.for_each_typed_id([&](uint32_t, SPIRConstant &c) { + if (c.specialization) + return; + + auto &type = this->get(c.constant_type); + + if (type.basetype == SPIRType::Struct && is_builtin_type(type)) + return; + + if (type.basetype == SPIRType::Struct || !type.array.empty()) + { + add_resource_name(c.self); + auto name = to_name(c.self); + statement("static const ", variable_decl(type, name), " = ", constant_expression(c), ";"); + emitted = true; + } + }); + + if (emitted) + statement(""); +} + +void CompilerHLSL::emit_specialization_constants_and_structs() +{ + bool emitted = false; + SpecializationConstant wg_x, wg_y, wg_z; + ID workgroup_size_id = get_work_group_size_specialization_constants(wg_x, wg_y, wg_z); + + std::unordered_set io_block_types; + ir.for_each_typed_id([&](uint32_t, const SPIRVariable &var) { + auto &type = this->get(var.basetype); + if ((var.storage == StorageClassInput || var.storage == StorageClassOutput) && + !var.remapped_variable && type.pointer && !is_builtin_variable(var) && + interface_variable_exists_in_entry_point(var.self) && + has_decoration(type.self, DecorationBlock)) + { + io_block_types.insert(type.self); + } + }); + + auto loop_lock = ir.create_loop_hard_lock(); + for (auto &id_ : ir.ids_for_constant_undef_or_type) + { + auto &id = ir.ids[id_]; + + if (id.get_type() == TypeConstant) + { + auto &c = id.get(); + + if (c.self == workgroup_size_id) + { + statement("static const uint3 gl_WorkGroupSize = ", + constant_expression(get(workgroup_size_id)), ";"); + emitted = true; + } + else if (c.specialization) + { + auto &type = get(c.constant_type); + add_resource_name(c.self); + auto name = to_name(c.self); + + if (has_decoration(c.self, DecorationSpecId)) + { + // HLSL does not support specialization constants, so fallback to macros. + c.specialization_constant_macro_name = + constant_value_macro_name(get_decoration(c.self, DecorationSpecId)); + + statement("#ifndef ", c.specialization_constant_macro_name); + statement("#define ", c.specialization_constant_macro_name, " ", constant_expression(c)); + statement("#endif"); + statement("static const ", variable_decl(type, name), " = ", c.specialization_constant_macro_name, ";"); + } + else + statement("static const ", variable_decl(type, name), " = ", constant_expression(c), ";"); + + emitted = true; + } + } + else if (id.get_type() == TypeConstantOp) + { + auto &c = id.get(); + auto &type = get(c.basetype); + add_resource_name(c.self); + auto name = to_name(c.self); + statement("static const ", variable_decl(type, name), " = ", constant_op_expression(c), ";"); + emitted = true; + } + else if (id.get_type() == TypeType) + { + auto &type = id.get(); + bool is_non_io_block = has_decoration(type.self, DecorationBlock) && + io_block_types.count(type.self) == 0; + bool is_buffer_block = has_decoration(type.self, DecorationBufferBlock); + if (type.basetype == SPIRType::Struct && type.array.empty() && + !type.pointer && !is_non_io_block && !is_buffer_block) + { + if (emitted) + statement(""); + emitted = false; + + emit_struct(type); + } + } + else if (id.get_type() == TypeUndef) + { + auto &undef = id.get(); + auto &type = this->get(undef.basetype); + // OpUndef can be void for some reason ... + if (type.basetype == SPIRType::Void) + return; + + string initializer; + if (options.force_zero_initialized_variables && type_can_zero_initialize(type)) + initializer = join(" = ", to_zero_initialized_expression(undef.basetype)); + + statement("static ", variable_decl(type, to_name(undef.self), undef.self), initializer, ";"); + emitted = true; + } + } + + if (emitted) + statement(""); +} + +void CompilerHLSL::replace_illegal_names() +{ + static const unordered_set keywords = { + // Additional HLSL specific keywords. + // From https://docs.microsoft.com/en-US/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-keywords + "AppendStructuredBuffer", "asm", "asm_fragment", + "BlendState", "bool", "break", "Buffer", "ByteAddressBuffer", + "case", "cbuffer", "centroid", "class", "column_major", "compile", + "compile_fragment", "CompileShader", "const", "continue", "ComputeShader", + "ConsumeStructuredBuffer", + "default", "DepthStencilState", "DepthStencilView", "discard", "do", + "double", "DomainShader", "dword", + "else", "export", "false", "float", "for", "fxgroup", + "GeometryShader", "groupshared", "half", "HullShader", + "indices", "if", "in", "inline", "inout", "InputPatch", "int", "interface", + "line", "lineadj", "linear", "LineStream", + "matrix", "min16float", "min10float", "min16int", "min16uint", + "namespace", "nointerpolation", "noperspective", "NULL", + "out", "OutputPatch", + "payload", "packoffset", "pass", "pixelfragment", "PixelShader", "point", + "PointStream", "precise", "RasterizerState", "RenderTargetView", + "return", "register", "row_major", "RWBuffer", "RWByteAddressBuffer", + "RWStructuredBuffer", "RWTexture1D", "RWTexture1DArray", "RWTexture2D", + "RWTexture2DArray", "RWTexture3D", "sample", "sampler", "SamplerState", + "SamplerComparisonState", "shared", "snorm", "stateblock", "stateblock_state", + "static", "string", "struct", "switch", "StructuredBuffer", "tbuffer", + "technique", "technique10", "technique11", "texture", "Texture1D", + "Texture1DArray", "Texture2D", "Texture2DArray", "Texture2DMS", "Texture2DMSArray", + "Texture3D", "TextureCube", "TextureCubeArray", "true", "typedef", "triangle", + "triangleadj", "TriangleStream", "uint", "uniform", "unorm", "unsigned", + "vector", "vertexfragment", "VertexShader", "vertices", "void", "volatile", "while", + "signed", + }; + + CompilerGLSL::replace_illegal_names(keywords); + CompilerGLSL::replace_illegal_names(); +} + +SPIRType::BaseType CompilerHLSL::get_builtin_basetype(BuiltIn builtin, SPIRType::BaseType default_type) +{ + switch (builtin) + { + case BuiltInSampleMask: + // We declare sample mask array with module type, so always use default_type here. + return default_type; + default: + return CompilerGLSL::get_builtin_basetype(builtin, default_type); + } +} + +void CompilerHLSL::emit_resources() +{ + auto &execution = get_entry_point(); + + replace_illegal_names(); + + switch (execution.model) + { + case ExecutionModelGeometry: + case ExecutionModelTessellationControl: + case ExecutionModelTessellationEvaluation: + case ExecutionModelMeshEXT: + fixup_implicit_builtin_block_names(execution.model); + break; + + default: + break; + } + + emit_specialization_constants_and_structs(); + emit_composite_constants(); + + bool emitted = false; + + // Output UBOs and SSBOs + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + auto &type = this->get(var.basetype); + + bool is_block_storage = type.storage == StorageClassStorageBuffer || type.storage == StorageClassUniform; + bool has_block_flags = ir.meta[type.self].decoration.decoration_flags.get(DecorationBlock) || + ir.meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock); + + if (var.storage != StorageClassFunction && type.pointer && is_block_storage && !is_hidden_variable(var) && + has_block_flags) + { + emit_buffer_block(var); + emitted = true; + } + }); + + // Output push constant blocks + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + auto &type = this->get(var.basetype); + if (var.storage != StorageClassFunction && type.pointer && type.storage == StorageClassPushConstant && + !is_hidden_variable(var)) + { + emit_push_constant_block(var); + emitted = true; + } + }); + + if (execution.model == ExecutionModelVertex && hlsl_options.shader_model <= 30 && + active_output_builtins.get(BuiltInPosition)) + { + statement("uniform float4 gl_HalfPixel;"); + emitted = true; + } + + bool skip_separate_image_sampler = !combined_image_samplers.empty() || hlsl_options.shader_model <= 30; + + // Output Uniform Constants (values, samplers, images, etc). + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + auto &type = this->get(var.basetype); + + // If we're remapping separate samplers and images, only emit the combined samplers. + if (skip_separate_image_sampler) + { + // Sampler buffers are always used without a sampler, and they will also work in regular D3D. + bool sampler_buffer = type.basetype == SPIRType::Image && type.image.dim == DimBuffer; + bool separate_image = type.basetype == SPIRType::Image && type.image.sampled == 1; + bool separate_sampler = type.basetype == SPIRType::Sampler; + if (!sampler_buffer && (separate_image || separate_sampler)) + return; + } + + if (var.storage != StorageClassFunction && !is_builtin_variable(var) && !var.remapped_variable && + type.pointer && (type.storage == StorageClassUniformConstant || type.storage == StorageClassAtomicCounter) && + !is_hidden_variable(var)) + { + emit_uniform(var); + emitted = true; + } + }); + + if (emitted) + statement(""); + emitted = false; + + // Emit builtin input and output variables here. + emit_builtin_variables(); + + if (execution.model != ExecutionModelMeshEXT) + { + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + auto &type = this->get(var.basetype); + + bool is_hidden = is_hidden_io_variable(var); + + if (var.storage != StorageClassFunction && !var.remapped_variable && type.pointer && + (var.storage == StorageClassInput || var.storage == StorageClassOutput) && !is_builtin_variable(var) && + interface_variable_exists_in_entry_point(var.self) && !is_hidden) + { + // Builtin variables are handled separately. + emit_interface_block_globally(var); + emitted = true; + } + }); + } + + if (emitted) + statement(""); + emitted = false; + + require_input = false; + require_output = false; + unordered_set active_inputs; + unordered_set active_outputs; + + struct IOVariable + { + const SPIRVariable *var; + uint32_t location; + uint32_t block_member_index; + bool block; + }; + + SmallVector input_variables; + SmallVector output_variables; + + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + auto &type = this->get(var.basetype); + bool block = has_decoration(type.self, DecorationBlock); + + if (var.storage != StorageClassInput && var.storage != StorageClassOutput) + return; + + bool is_hidden = is_hidden_io_variable(var); + + if (!var.remapped_variable && type.pointer && !is_builtin_variable(var) && + interface_variable_exists_in_entry_point(var.self) && !is_hidden) + { + if (block) + { + for (uint32_t i = 0; i < uint32_t(type.member_types.size()); i++) + { + uint32_t location = get_declared_member_location(var, i, false); + if (var.storage == StorageClassInput) + input_variables.push_back({ &var, location, i, true }); + else + output_variables.push_back({ &var, location, i, true }); + } + } + else + { + uint32_t location = get_decoration(var.self, DecorationLocation); + if (var.storage == StorageClassInput) + input_variables.push_back({ &var, location, 0, false }); + else + output_variables.push_back({ &var, location, 0, false }); + } + } + }); + + const auto variable_compare = [&](const IOVariable &a, const IOVariable &b) -> bool { + // Sort input and output variables based on, from more robust to less robust: + // - Location + // - Variable has a location + // - Name comparison + // - Variable has a name + // - Fallback: ID + bool has_location_a = a.block || has_decoration(a.var->self, DecorationLocation); + bool has_location_b = b.block || has_decoration(b.var->self, DecorationLocation); + + if (has_location_a && has_location_b) + return a.location < b.location; + else if (has_location_a && !has_location_b) + return true; + else if (!has_location_a && has_location_b) + return false; + + const auto &name1 = to_name(a.var->self); + const auto &name2 = to_name(b.var->self); + + if (name1.empty() && name2.empty()) + return a.var->self < b.var->self; + else if (name1.empty()) + return true; + else if (name2.empty()) + return false; + + return name1.compare(name2) < 0; + }; + + auto input_builtins = active_input_builtins; + input_builtins.clear(BuiltInNumWorkgroups); + input_builtins.clear(BuiltInPointCoord); + input_builtins.clear(BuiltInSubgroupSize); + input_builtins.clear(BuiltInSubgroupLocalInvocationId); + input_builtins.clear(BuiltInSubgroupEqMask); + input_builtins.clear(BuiltInSubgroupLtMask); + input_builtins.clear(BuiltInSubgroupLeMask); + input_builtins.clear(BuiltInSubgroupGtMask); + input_builtins.clear(BuiltInSubgroupGeMask); + + if (!input_variables.empty() || !input_builtins.empty()) + { + require_input = true; + statement("struct SPIRV_Cross_Input"); + + begin_scope(); + sort(input_variables.begin(), input_variables.end(), variable_compare); + for (auto &var : input_variables) + { + if (var.block) + emit_interface_block_member_in_struct(*var.var, var.block_member_index, var.location, active_inputs); + else + emit_interface_block_in_struct(*var.var, active_inputs); + } + emit_builtin_inputs_in_struct(); + end_scope_decl(); + statement(""); + } + + const bool is_mesh_shader = execution.model == ExecutionModelMeshEXT; + if (!output_variables.empty() || !active_output_builtins.empty()) + { + sort(output_variables.begin(), output_variables.end(), variable_compare); + require_output = !(is_mesh_shader || execution.model == ExecutionModelGeometry); + + statement(is_mesh_shader ? "struct gl_MeshPerVertexEXT" : "struct SPIRV_Cross_Output"); + begin_scope(); + for (auto &var : output_variables) + { + if (is_per_primitive_variable(*var.var)) + continue; + if (var.block && is_mesh_shader && var.block_member_index != 0) + continue; + if (var.block && !is_mesh_shader) + emit_interface_block_member_in_struct(*var.var, var.block_member_index, var.location, active_outputs); + else + emit_interface_block_in_struct(*var.var, active_outputs); + } + emit_builtin_outputs_in_struct(); + if (!is_mesh_shader) + emit_builtin_primitive_outputs_in_struct(); + end_scope_decl(); + statement(""); + + if (is_mesh_shader) + { + statement("struct gl_MeshPerPrimitiveEXT"); + begin_scope(); + for (auto &var : output_variables) + { + if (!is_per_primitive_variable(*var.var)) + continue; + if (var.block && var.block_member_index != 0) + continue; + + emit_interface_block_in_struct(*var.var, active_outputs); + } + emit_builtin_primitive_outputs_in_struct(); + end_scope_decl(); + statement(""); + } + } + + // Global variables. + for (auto global : global_variables) + { + auto &var = get(global); + if (is_hidden_variable(var, true)) + continue; + + if (var.storage == StorageClassTaskPayloadWorkgroupEXT && is_mesh_shader) + continue; + + if (var.storage != StorageClassOutput) + { + if (!variable_is_lut(var)) + { + add_resource_name(var.self); + + const char *storage = nullptr; + switch (var.storage) + { + case StorageClassWorkgroup: + case StorageClassTaskPayloadWorkgroupEXT: + storage = "groupshared"; + break; + + default: + storage = "static"; + break; + } + + string initializer; + if (options.force_zero_initialized_variables && var.storage == StorageClassPrivate && + !var.initializer && !var.static_expression && type_can_zero_initialize(get_variable_data_type(var))) + { + initializer = join(" = ", to_zero_initialized_expression(get_variable_data_type_id(var))); + } + statement(storage, " ", variable_decl(var), initializer, ";"); + + emitted = true; + } + } + } + + if (emitted) + statement(""); + + if (requires_op_fmod) + { + static const char *types[] = { + "float", + "float2", + "float3", + "float4", + }; + + for (auto &type : types) + { + statement(type, " mod(", type, " x, ", type, " y)"); + begin_scope(); + statement("return x - y * floor(x / y);"); + end_scope(); + statement(""); + } + } + + emit_texture_size_variants(required_texture_size_variants.srv, "4", false, ""); + for (uint32_t norm = 0; norm < 3; norm++) + { + for (uint32_t comp = 0; comp < 4; comp++) + { + static const char *qualifiers[] = { "", "unorm ", "snorm " }; + static const char *vecsizes[] = { "", "2", "3", "4" }; + emit_texture_size_variants(required_texture_size_variants.uav[norm][comp], vecsizes[comp], true, + qualifiers[norm]); + } + } + + if (requires_fp16_packing) + { + // HLSL does not pack into a single word sadly :( + statement("uint spvPackHalf2x16(float2 value)"); + begin_scope(); + statement("uint2 Packed = f32tof16(value);"); + statement("return Packed.x | (Packed.y << 16);"); + end_scope(); + statement(""); + + statement("float2 spvUnpackHalf2x16(uint value)"); + begin_scope(); + statement("return f16tof32(uint2(value & 0xffff, value >> 16));"); + end_scope(); + statement(""); + } + + if (requires_uint2_packing) + { + statement("uint64_t spvPackUint2x32(uint2 value)"); + begin_scope(); + statement("return (uint64_t(value.y) << 32) | uint64_t(value.x);"); + end_scope(); + statement(""); + + statement("uint2 spvUnpackUint2x32(uint64_t value)"); + begin_scope(); + statement("uint2 Unpacked;"); + statement("Unpacked.x = uint(value & 0xffffffff);"); + statement("Unpacked.y = uint(value >> 32);"); + statement("return Unpacked;"); + end_scope(); + statement(""); + } + + if (requires_explicit_fp16_packing) + { + // HLSL does not pack into a single word sadly :( + statement("uint spvPackFloat2x16(min16float2 value)"); + begin_scope(); + statement("uint2 Packed = f32tof16(value);"); + statement("return Packed.x | (Packed.y << 16);"); + end_scope(); + statement(""); + + statement("min16float2 spvUnpackFloat2x16(uint value)"); + begin_scope(); + statement("return min16float2(f16tof32(uint2(value & 0xffff, value >> 16)));"); + end_scope(); + statement(""); + } + + // HLSL does not seem to have builtins for these operation, so roll them by hand ... + if (requires_unorm8_packing) + { + statement("uint spvPackUnorm4x8(float4 value)"); + begin_scope(); + statement("uint4 Packed = uint4(round(saturate(value) * 255.0));"); + statement("return Packed.x | (Packed.y << 8) | (Packed.z << 16) | (Packed.w << 24);"); + end_scope(); + statement(""); + + statement("float4 spvUnpackUnorm4x8(uint value)"); + begin_scope(); + statement("uint4 Packed = uint4(value & 0xff, (value >> 8) & 0xff, (value >> 16) & 0xff, value >> 24);"); + statement("return float4(Packed) / 255.0;"); + end_scope(); + statement(""); + } + + if (requires_snorm8_packing) + { + statement("uint spvPackSnorm4x8(float4 value)"); + begin_scope(); + statement("int4 Packed = int4(round(clamp(value, -1.0, 1.0) * 127.0)) & 0xff;"); + statement("return uint(Packed.x | (Packed.y << 8) | (Packed.z << 16) | (Packed.w << 24));"); + end_scope(); + statement(""); + + statement("float4 spvUnpackSnorm4x8(uint value)"); + begin_scope(); + statement("int SignedValue = int(value);"); + statement("int4 Packed = int4(SignedValue << 24, SignedValue << 16, SignedValue << 8, SignedValue) >> 24;"); + statement("return clamp(float4(Packed) / 127.0, -1.0, 1.0);"); + end_scope(); + statement(""); + } + + if (requires_unorm16_packing) + { + statement("uint spvPackUnorm2x16(float2 value)"); + begin_scope(); + statement("uint2 Packed = uint2(round(saturate(value) * 65535.0));"); + statement("return Packed.x | (Packed.y << 16);"); + end_scope(); + statement(""); + + statement("float2 spvUnpackUnorm2x16(uint value)"); + begin_scope(); + statement("uint2 Packed = uint2(value & 0xffff, value >> 16);"); + statement("return float2(Packed) / 65535.0;"); + end_scope(); + statement(""); + } + + if (requires_snorm16_packing) + { + statement("uint spvPackSnorm2x16(float2 value)"); + begin_scope(); + statement("int2 Packed = int2(round(clamp(value, -1.0, 1.0) * 32767.0)) & 0xffff;"); + statement("return uint(Packed.x | (Packed.y << 16));"); + end_scope(); + statement(""); + + statement("float2 spvUnpackSnorm2x16(uint value)"); + begin_scope(); + statement("int SignedValue = int(value);"); + statement("int2 Packed = int2(SignedValue << 16, SignedValue) >> 16;"); + statement("return clamp(float2(Packed) / 32767.0, -1.0, 1.0);"); + end_scope(); + statement(""); + } + + if (requires_bitfield_insert) + { + static const char *types[] = { "uint", "uint2", "uint3", "uint4" }; + for (auto &type : types) + { + statement(type, " spvBitfieldInsert(", type, " Base, ", type, " Insert, uint Offset, uint Count)"); + begin_scope(); + statement("uint Mask = Count == 32 ? 0xffffffff : (((1u << Count) - 1) << (Offset & 31));"); + statement("return (Base & ~Mask) | ((Insert << Offset) & Mask);"); + end_scope(); + statement(""); + } + } + + if (requires_bitfield_extract) + { + static const char *unsigned_types[] = { "uint", "uint2", "uint3", "uint4" }; + for (auto &type : unsigned_types) + { + statement(type, " spvBitfieldUExtract(", type, " Base, uint Offset, uint Count)"); + begin_scope(); + statement("uint Mask = Count == 32 ? 0xffffffff : ((1 << Count) - 1);"); + statement("return (Base >> Offset) & Mask;"); + end_scope(); + statement(""); + } + + // In this overload, we will have to do sign-extension, which we will emulate by shifting up and down. + static const char *signed_types[] = { "int", "int2", "int3", "int4" }; + for (auto &type : signed_types) + { + statement(type, " spvBitfieldSExtract(", type, " Base, int Offset, int Count)"); + begin_scope(); + statement("int Mask = Count == 32 ? -1 : ((1 << Count) - 1);"); + statement(type, " Masked = (Base >> Offset) & Mask;"); + statement("int ExtendShift = (32 - Count) & 31;"); + statement("return (Masked << ExtendShift) >> ExtendShift;"); + end_scope(); + statement(""); + } + } + + if (requires_inverse_2x2) + { + statement("// Returns the inverse of a matrix, by using the algorithm of calculating the classical"); + statement("// adjoint and dividing by the determinant. The contents of the matrix are changed."); + statement("float2x2 spvInverse(float2x2 m)"); + begin_scope(); + statement("float2x2 adj; // The adjoint matrix (inverse after dividing by determinant)"); + statement_no_indent(""); + statement("// Create the transpose of the cofactors, as the classical adjoint of the matrix."); + statement("adj[0][0] = m[1][1];"); + statement("adj[0][1] = -m[0][1];"); + statement_no_indent(""); + statement("adj[1][0] = -m[1][0];"); + statement("adj[1][1] = m[0][0];"); + statement_no_indent(""); + statement("// Calculate the determinant as a combination of the cofactors of the first row."); + statement("float det = (adj[0][0] * m[0][0]) + (adj[0][1] * m[1][0]);"); + statement_no_indent(""); + statement("// Divide the classical adjoint matrix by the determinant."); + statement("// If determinant is zero, matrix is not invertable, so leave it unchanged."); + statement("return (det != 0.0f) ? (adj * (1.0f / det)) : m;"); + end_scope(); + statement(""); + } + + if (requires_inverse_3x3) + { + statement("// Returns the determinant of a 2x2 matrix."); + statement("float spvDet2x2(float a1, float a2, float b1, float b2)"); + begin_scope(); + statement("return a1 * b2 - b1 * a2;"); + end_scope(); + statement_no_indent(""); + statement("// Returns the inverse of a matrix, by using the algorithm of calculating the classical"); + statement("// adjoint and dividing by the determinant. The contents of the matrix are changed."); + statement("float3x3 spvInverse(float3x3 m)"); + begin_scope(); + statement("float3x3 adj; // The adjoint matrix (inverse after dividing by determinant)"); + statement_no_indent(""); + statement("// Create the transpose of the cofactors, as the classical adjoint of the matrix."); + statement("adj[0][0] = spvDet2x2(m[1][1], m[1][2], m[2][1], m[2][2]);"); + statement("adj[0][1] = -spvDet2x2(m[0][1], m[0][2], m[2][1], m[2][2]);"); + statement("adj[0][2] = spvDet2x2(m[0][1], m[0][2], m[1][1], m[1][2]);"); + statement_no_indent(""); + statement("adj[1][0] = -spvDet2x2(m[1][0], m[1][2], m[2][0], m[2][2]);"); + statement("adj[1][1] = spvDet2x2(m[0][0], m[0][2], m[2][0], m[2][2]);"); + statement("adj[1][2] = -spvDet2x2(m[0][0], m[0][2], m[1][0], m[1][2]);"); + statement_no_indent(""); + statement("adj[2][0] = spvDet2x2(m[1][0], m[1][1], m[2][0], m[2][1]);"); + statement("adj[2][1] = -spvDet2x2(m[0][0], m[0][1], m[2][0], m[2][1]);"); + statement("adj[2][2] = spvDet2x2(m[0][0], m[0][1], m[1][0], m[1][1]);"); + statement_no_indent(""); + statement("// Calculate the determinant as a combination of the cofactors of the first row."); + statement("float det = (adj[0][0] * m[0][0]) + (adj[0][1] * m[1][0]) + (adj[0][2] * m[2][0]);"); + statement_no_indent(""); + statement("// Divide the classical adjoint matrix by the determinant."); + statement("// If determinant is zero, matrix is not invertable, so leave it unchanged."); + statement("return (det != 0.0f) ? (adj * (1.0f / det)) : m;"); + end_scope(); + statement(""); + } + + if (requires_inverse_4x4) + { + if (!requires_inverse_3x3) + { + statement("// Returns the determinant of a 2x2 matrix."); + statement("float spvDet2x2(float a1, float a2, float b1, float b2)"); + begin_scope(); + statement("return a1 * b2 - b1 * a2;"); + end_scope(); + statement(""); + } + + statement("// Returns the determinant of a 3x3 matrix."); + statement("float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, " + "float c2, float c3)"); + begin_scope(); + statement("return a1 * spvDet2x2(b2, b3, c2, c3) - b1 * spvDet2x2(a2, a3, c2, c3) + c1 * " + "spvDet2x2(a2, a3, " + "b2, b3);"); + end_scope(); + statement_no_indent(""); + statement("// Returns the inverse of a matrix, by using the algorithm of calculating the classical"); + statement("// adjoint and dividing by the determinant. The contents of the matrix are changed."); + statement("float4x4 spvInverse(float4x4 m)"); + begin_scope(); + statement("float4x4 adj; // The adjoint matrix (inverse after dividing by determinant)"); + statement_no_indent(""); + statement("// Create the transpose of the cofactors, as the classical adjoint of the matrix."); + statement( + "adj[0][0] = spvDet3x3(m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], " + "m[3][3]);"); + statement( + "adj[0][1] = -spvDet3x3(m[0][1], m[0][2], m[0][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], " + "m[3][3]);"); + statement( + "adj[0][2] = spvDet3x3(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[3][1], m[3][2], " + "m[3][3]);"); + statement( + "adj[0][3] = -spvDet3x3(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], " + "m[2][3]);"); + statement_no_indent(""); + statement( + "adj[1][0] = -spvDet3x3(m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], " + "m[3][3]);"); + statement( + "adj[1][1] = spvDet3x3(m[0][0], m[0][2], m[0][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], " + "m[3][3]);"); + statement( + "adj[1][2] = -spvDet3x3(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[3][0], m[3][2], " + "m[3][3]);"); + statement( + "adj[1][3] = spvDet3x3(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], " + "m[2][3]);"); + statement_no_indent(""); + statement( + "adj[2][0] = spvDet3x3(m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], " + "m[3][3]);"); + statement( + "adj[2][1] = -spvDet3x3(m[0][0], m[0][1], m[0][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], " + "m[3][3]);"); + statement( + "adj[2][2] = spvDet3x3(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[3][0], m[3][1], " + "m[3][3]);"); + statement( + "adj[2][3] = -spvDet3x3(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], " + "m[2][3]);"); + statement_no_indent(""); + statement( + "adj[3][0] = -spvDet3x3(m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], " + "m[3][2]);"); + statement( + "adj[3][1] = spvDet3x3(m[0][0], m[0][1], m[0][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], " + "m[3][2]);"); + statement( + "adj[3][2] = -spvDet3x3(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[3][0], m[3][1], " + "m[3][2]);"); + statement( + "adj[3][3] = spvDet3x3(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], " + "m[2][2]);"); + statement_no_indent(""); + statement("// Calculate the determinant as a combination of the cofactors of the first row."); + statement("float det = (adj[0][0] * m[0][0]) + (adj[0][1] * m[1][0]) + (adj[0][2] * m[2][0]) + (adj[0][3] " + "* m[3][0]);"); + statement_no_indent(""); + statement("// Divide the classical adjoint matrix by the determinant."); + statement("// If determinant is zero, matrix is not invertable, so leave it unchanged."); + statement("return (det != 0.0f) ? (adj * (1.0f / det)) : m;"); + end_scope(); + statement(""); + } + + if (requires_scalar_reflect) + { + // FP16/FP64? No templates in HLSL. + statement("float spvReflect(float i, float n)"); + begin_scope(); + statement("return i - 2.0 * dot(n, i) * n;"); + end_scope(); + statement(""); + } + + if (requires_scalar_refract) + { + // FP16/FP64? No templates in HLSL. + statement("float spvRefract(float i, float n, float eta)"); + begin_scope(); + statement("float NoI = n * i;"); + statement("float NoI2 = NoI * NoI;"); + statement("float k = 1.0 - eta * eta * (1.0 - NoI2);"); + statement("if (k < 0.0)"); + begin_scope(); + statement("return 0.0;"); + end_scope(); + statement("else"); + begin_scope(); + statement("return eta * i - (eta * NoI + sqrt(k)) * n;"); + end_scope(); + end_scope(); + statement(""); + } + + if (requires_scalar_faceforward) + { + // FP16/FP64? No templates in HLSL. + statement("float spvFaceForward(float n, float i, float nref)"); + begin_scope(); + statement("return i * nref < 0.0 ? n : -n;"); + end_scope(); + statement(""); + } + + for (TypeID type_id : composite_selection_workaround_types) + { + // Need out variable since HLSL does not support returning arrays. + auto &type = get(type_id); + auto type_str = type_to_glsl(type); + auto type_arr_str = type_to_array_glsl(type, 0); + statement("void spvSelectComposite(out ", type_str, " out_value", type_arr_str, ", bool cond, ", + type_str, " true_val", type_arr_str, ", ", + type_str, " false_val", type_arr_str, ")"); + begin_scope(); + statement("if (cond)"); + begin_scope(); + statement("out_value = true_val;"); + end_scope(); + statement("else"); + begin_scope(); + statement("out_value = false_val;"); + end_scope(); + end_scope(); + statement(""); + } + + if (is_mesh_shader && options.vertex.flip_vert_y) + { + statement("float4 spvFlipVertY(float4 v)"); + begin_scope(); + statement("return float4(v.x, -v.y, v.z, v.w);"); + end_scope(); + statement(""); + statement("float spvFlipVertY(float v)"); + begin_scope(); + statement("return -v;"); + end_scope(); + statement(""); + } +} + +void CompilerHLSL::emit_texture_size_variants(uint64_t variant_mask, const char *vecsize_qualifier, bool uav, + const char *type_qualifier) +{ + if (variant_mask == 0) + return; + + static const char *types[QueryTypeCount] = { "float", "int", "uint" }; + static const char *dims[QueryDimCount] = { "Texture1D", "Texture1DArray", "Texture2D", "Texture2DArray", + "Texture3D", "Buffer", "TextureCube", "TextureCubeArray", + "Texture2DMS", "Texture2DMSArray" }; + + static const bool has_lod[QueryDimCount] = { true, true, true, true, true, false, true, true, false, false }; + + static const char *ret_types[QueryDimCount] = { + "uint", "uint2", "uint2", "uint3", "uint3", "uint", "uint2", "uint3", "uint2", "uint3", + }; + + static const uint32_t return_arguments[QueryDimCount] = { + 1, 2, 2, 3, 3, 1, 2, 3, 2, 3, + }; + + for (uint32_t index = 0; index < QueryDimCount; index++) + { + for (uint32_t type_index = 0; type_index < QueryTypeCount; type_index++) + { + uint32_t bit = 16 * type_index + index; + uint64_t mask = 1ull << bit; + + if ((variant_mask & mask) == 0) + continue; + + statement(ret_types[index], " spv", (uav ? "Image" : "Texture"), "Size(", (uav ? "RW" : ""), + dims[index], "<", type_qualifier, types[type_index], vecsize_qualifier, "> Tex, ", + (uav ? "" : "uint Level, "), "out uint Param)"); + begin_scope(); + statement(ret_types[index], " ret;"); + switch (return_arguments[index]) + { + case 1: + if (has_lod[index] && !uav) + statement("Tex.GetDimensions(Level, ret.x, Param);"); + else + { + statement("Tex.GetDimensions(ret.x);"); + statement("Param = 0u;"); + } + break; + case 2: + if (has_lod[index] && !uav) + statement("Tex.GetDimensions(Level, ret.x, ret.y, Param);"); + else if (!uav) + statement("Tex.GetDimensions(ret.x, ret.y, Param);"); + else + { + statement("Tex.GetDimensions(ret.x, ret.y);"); + statement("Param = 0u;"); + } + break; + case 3: + if (has_lod[index] && !uav) + statement("Tex.GetDimensions(Level, ret.x, ret.y, ret.z, Param);"); + else if (!uav) + statement("Tex.GetDimensions(ret.x, ret.y, ret.z, Param);"); + else + { + statement("Tex.GetDimensions(ret.x, ret.y, ret.z);"); + statement("Param = 0u;"); + } + break; + } + + statement("return ret;"); + end_scope(); + statement(""); + } + } +} + +void CompilerHLSL::analyze_meshlet_writes() +{ + uint32_t id_per_vertex = 0; + uint32_t id_per_primitive = 0; + bool need_per_primitive = false; + bool need_per_vertex = false; + + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + auto &type = this->get(var.basetype); + bool block = has_decoration(type.self, DecorationBlock); + if (var.storage == StorageClassOutput && block && is_builtin_variable(var)) + { + auto flags = get_buffer_block_flags(var.self); + if (flags.get(DecorationPerPrimitiveEXT)) + id_per_primitive = var.self; + else + id_per_vertex = var.self; + } + else if (var.storage == StorageClassOutput) + { + Bitset flags; + if (block) + flags = get_buffer_block_flags(var.self); + else + flags = get_decoration_bitset(var.self); + + if (flags.get(DecorationPerPrimitiveEXT)) + need_per_primitive = true; + else + need_per_vertex = true; + } + }); + + // If we have per-primitive outputs, and no per-primitive builtins, + // empty version of gl_MeshPerPrimitiveEXT will be emitted. + // If we don't use block IO for vertex output, we'll also need to synthesize the PerVertex block. + + const auto generate_block = [&](const char *block_name, const char *instance_name, bool per_primitive) -> uint32_t { + auto &execution = get_entry_point(); + + uint32_t op_type = ir.increase_bound_by(4); + uint32_t op_arr = op_type + 1; + uint32_t op_ptr = op_type + 2; + uint32_t op_var = op_type + 3; + + auto &type = set(op_type, OpTypeStruct); + type.basetype = SPIRType::Struct; + set_name(op_type, block_name); + set_decoration(op_type, DecorationBlock); + if (per_primitive) + set_decoration(op_type, DecorationPerPrimitiveEXT); + + auto &arr = set(op_arr, type); + arr.op = OpTypeArray; + arr.parent_type = type.self; + arr.array.push_back(per_primitive ? execution.output_primitives : execution.output_vertices); + arr.array_size_literal.push_back(true); + + auto &ptr = set(op_ptr, arr); + ptr.parent_type = arr.self; + ptr.op = OpTypePointer; + ptr.pointer = true; + ptr.pointer_depth++; + ptr.storage = StorageClassOutput; + set_decoration(op_ptr, DecorationBlock); + set_name(op_ptr, block_name); + + auto &var = set(op_var, op_ptr, StorageClassOutput); + if (per_primitive) + set_decoration(op_var, DecorationPerPrimitiveEXT); + set_name(op_var, instance_name); + execution.interface_variables.push_back(var.self); + + return op_var; + }; + + if (id_per_vertex == 0 && need_per_vertex) + id_per_vertex = generate_block("gl_MeshPerVertexEXT", "gl_MeshVerticesEXT", false); + if (id_per_primitive == 0 && need_per_primitive) + id_per_primitive = generate_block("gl_MeshPerPrimitiveEXT", "gl_MeshPrimitivesEXT", true); + + unordered_set processed_func_ids; + analyze_meshlet_writes(ir.default_entry_point, id_per_vertex, id_per_primitive, processed_func_ids); +} + +void CompilerHLSL::analyze_meshlet_writes(uint32_t func_id, uint32_t id_per_vertex, uint32_t id_per_primitive, + std::unordered_set &processed_func_ids) +{ + // Avoid processing a function more than once + if (processed_func_ids.find(func_id) != processed_func_ids.end()) + return; + processed_func_ids.insert(func_id); + + auto &func = get(func_id); + // Recursively establish global args added to functions on which we depend. + for (auto& block : func.blocks) + { + auto &b = get(block); + for (auto &i : b.ops) + { + auto ops = stream(i); + auto op = static_cast(i.op); + + switch (op) + { + case OpFunctionCall: + { + // Then recurse into the function itself to extract globals used internally in the function + uint32_t inner_func_id = ops[2]; + analyze_meshlet_writes(inner_func_id, id_per_vertex, id_per_primitive, processed_func_ids); + auto &inner_func = get(inner_func_id); + for (auto &iarg : inner_func.arguments) + { + if (!iarg.alias_global_variable) + continue; + + bool already_declared = false; + for (auto &arg : func.arguments) + { + if (arg.id == iarg.id) + { + already_declared = true; + break; + } + } + + if (!already_declared) + { + // basetype is effectively ignored here since we declare the argument + // with explicit types. Just pass down a valid type. + func.arguments.push_back({ expression_type_id(iarg.id), iarg.id, + iarg.read_count, iarg.write_count, true }); + } + } + break; + } + + case OpStore: + case OpLoad: + case OpInBoundsAccessChain: + case OpAccessChain: + case OpPtrAccessChain: + case OpInBoundsPtrAccessChain: + case OpArrayLength: + { + auto *var = maybe_get(ops[op == OpStore ? 0 : 2]); + if (var && (var->storage == StorageClassOutput || var->storage == StorageClassTaskPayloadWorkgroupEXT)) + { + bool already_declared = false; + auto builtin_type = BuiltIn(get_decoration(var->self, DecorationBuiltIn)); + + uint32_t var_id = var->self; + if (var->storage != StorageClassTaskPayloadWorkgroupEXT && + builtin_type != BuiltInPrimitivePointIndicesEXT && + builtin_type != BuiltInPrimitiveLineIndicesEXT && + builtin_type != BuiltInPrimitiveTriangleIndicesEXT) + { + var_id = is_per_primitive_variable(*var) ? id_per_primitive : id_per_vertex; + } + + for (auto &arg : func.arguments) + { + if (arg.id == var_id) + { + already_declared = true; + break; + } + } + + if (!already_declared) + { + // basetype is effectively ignored here since we declare the argument + // with explicit types. Just pass down a valid type. + uint32_t type_id = expression_type_id(var_id); + if (var->storage == StorageClassTaskPayloadWorkgroupEXT) + func.arguments.push_back({ type_id, var_id, 1u, 0u, true }); + else + func.arguments.push_back({ type_id, var_id, 1u, 1u, true }); + } + } + break; + } + + default: + break; + } + } + } +} + +string CompilerHLSL::layout_for_member(const SPIRType &type, uint32_t index) +{ + auto &flags = get_member_decoration_bitset(type.self, index); + + // HLSL can emit row_major or column_major decoration in any struct. + // Do not try to merge combined decorations for children like in GLSL. + + // Flip the convention. HLSL is a bit odd in that the memory layout is column major ... but the language API is "row-major". + // The way to deal with this is to multiply everything in inverse order, and reverse the memory layout. + if (flags.get(DecorationColMajor)) + return "row_major "; + else if (flags.get(DecorationRowMajor)) + return "column_major "; + + return ""; +} + +void CompilerHLSL::emit_struct_member(const SPIRType &type, uint32_t member_type_id, uint32_t index, + const string &qualifier, uint32_t base_offset) +{ + auto &membertype = get(member_type_id); + + Bitset memberflags; + auto &memb = ir.meta[type.self].members; + if (index < memb.size()) + memberflags = memb[index].decoration_flags; + + string packing_offset; + bool is_push_constant = type.storage == StorageClassPushConstant; + + if ((has_extended_decoration(type.self, SPIRVCrossDecorationExplicitOffset) || is_push_constant) && + has_member_decoration(type.self, index, DecorationOffset)) + { + uint32_t offset = memb[index].offset - base_offset; + if (offset & 3) + SPIRV_CROSS_THROW("Cannot pack on tighter bounds than 4 bytes in HLSL."); + + static const char *packing_swizzle[] = { "", ".y", ".z", ".w" }; + packing_offset = join(" : packoffset(c", offset / 16, packing_swizzle[(offset & 15) >> 2], ")"); + } + + statement(layout_for_member(type, index), qualifier, + variable_decl(membertype, to_member_name(type, index)), packing_offset, ";"); +} + +void CompilerHLSL::emit_rayquery_function(const char *commited, const char *candidate, const uint32_t *ops) +{ + flush_variable_declaration(ops[0]); + uint32_t is_commited = evaluate_constant_u32(ops[3]); + emit_op(ops[0], ops[1], join(to_expression(ops[2]), is_commited ? commited : candidate), false); +} + +void CompilerHLSL::emit_mesh_tasks(SPIRBlock &block) +{ + if (block.mesh.payload != 0) + { + statement("DispatchMesh(", to_unpacked_expression(block.mesh.groups[0]), ", ", to_unpacked_expression(block.mesh.groups[1]), ", ", + to_unpacked_expression(block.mesh.groups[2]), ", ", to_unpacked_expression(block.mesh.payload), ");"); + } + else + { + SPIRV_CROSS_THROW("Amplification shader in HLSL must have payload"); + } +} + +void CompilerHLSL::emit_geometry_stream_append() +{ + begin_scope(); + statement("SPIRV_Cross_Output stage_output;"); + + active_output_builtins.for_each_bit( + [&](uint32_t i) + { + if (i == BuiltInPointSize && hlsl_options.shader_model > 30) + return; + switch (static_cast(i)) + { + case BuiltInClipDistance: + for (uint32_t clip = 0; clip < clip_distance_count; clip++) + statement("stage_output.gl_ClipDistance", clip / 4, ".", "xyzw"[clip & 3], " = gl_ClipDistance[", + clip, "];"); + break; + case BuiltInCullDistance: + for (uint32_t cull = 0; cull < cull_distance_count; cull++) + statement("stage_output.gl_CullDistance", cull / 4, ".", "xyzw"[cull & 3], " = gl_CullDistance[", + cull, "];"); + break; + case BuiltInSampleMask: + statement("stage_output.gl_SampleMask = gl_SampleMask[0];"); + break; + default: + { + auto builtin_expr = builtin_to_glsl(static_cast(i), StorageClassOutput); + statement("stage_output.", builtin_expr, " = ", builtin_expr, ";"); + } + break; + } + }); + + ir.for_each_typed_id( + [&](uint32_t, SPIRVariable &var) + { + auto &type = this->get(var.basetype); + bool block = has_decoration(type.self, DecorationBlock); + + if (var.storage != StorageClassOutput) + return; + + if (!var.remapped_variable && type.pointer && !is_builtin_variable(var) && + interface_variable_exists_in_entry_point(var.self)) + { + if (block) + { + auto type_name = to_name(type.self); + auto var_name = to_name(var.self); + for (uint32_t mbr_idx = 0; mbr_idx < uint32_t(type.member_types.size()); mbr_idx++) + { + auto mbr_name = to_member_name(type, mbr_idx); + auto flat_name = join(type_name, "_", mbr_name); + statement("stage_output.", flat_name, " = ", var_name, ".", mbr_name, ";"); + } + } + else + { + auto name = to_name(var.self); + if (hlsl_options.shader_model <= 30 && get_entry_point().model == ExecutionModelFragment) + { + string output_filler; + for (uint32_t size = type.vecsize; size < 4; ++size) + output_filler += ", 0.0"; + statement("stage_output.", name, " = float4(", name, output_filler, ");"); + } + else + statement("stage_output.", name, " = ", name, ";"); + } + } + }); + + statement("geometry_stream.Append(stage_output);"); + end_scope(); +} + +void CompilerHLSL::emit_buffer_block(const SPIRVariable &var) +{ + auto &type = get(var.basetype); + + bool is_uav = var.storage == StorageClassStorageBuffer || has_decoration(type.self, DecorationBufferBlock); + + if (flattened_buffer_blocks.count(var.self)) + { + emit_buffer_block_flattened(var); + } + else if (is_uav) + { + Bitset flags = ir.get_buffer_block_flags(var); + bool is_readonly = flags.get(DecorationNonWritable) && !is_hlsl_force_storage_buffer_as_uav(var.self); + bool is_coherent = flags.get(DecorationCoherent) && !is_readonly; + bool is_interlocked = interlocked_resources.count(var.self) > 0; + + auto to_structuredbuffer_subtype_name = [this](const SPIRType &parent_type) -> std::string + { + if (parent_type.basetype == SPIRType::Struct && parent_type.member_types.size() == 1) + { + // Use type of first struct member as a StructuredBuffer will have only one '._m0' field in SPIR-V + const auto &member0_type = this->get(parent_type.member_types.front()); + return this->type_to_glsl(member0_type); + } + else + { + // Otherwise, this StructuredBuffer only has a basic subtype, e.g. StructuredBuffer + return this->type_to_glsl(parent_type); + } + }; + + std::string type_name; + if (is_user_type_structured(var.self)) + type_name = join(is_readonly ? "" : is_interlocked ? "RasterizerOrdered" : "RW", "StructuredBuffer<", to_structuredbuffer_subtype_name(type), ">"); + else + type_name = is_readonly ? "ByteAddressBuffer" : is_interlocked ? "RasterizerOrderedByteAddressBuffer" : "RWByteAddressBuffer"; + + add_resource_name(var.self); + statement(is_coherent ? "globallycoherent " : "", type_name, " ", to_name(var.self), type_to_array_glsl(type, var.self), + to_resource_binding(var), ";"); + } + else + { + if (type.array.empty()) + { + // Flatten the top-level struct so we can use packoffset, + // this restriction is similar to GLSL where layout(offset) is not possible on sub-structs. + flattened_structs[var.self] = false; + + // Prefer the block name if possible. + auto buffer_name = to_name(type.self, false); + if (ir.meta[type.self].decoration.alias.empty() || + resource_names.find(buffer_name) != end(resource_names) || + block_names.find(buffer_name) != end(block_names)) + { + buffer_name = get_block_fallback_name(var.self); + } + + add_variable(block_names, resource_names, buffer_name); + + // If for some reason buffer_name is an illegal name, make a final fallback to a workaround name. + // This cannot conflict with anything else, so we're safe now. + if (buffer_name.empty()) + buffer_name = join("_", get(var.basetype).self, "_", var.self); + + uint32_t failed_index = 0; + if (buffer_is_packing_standard(type, BufferPackingHLSLCbufferPackOffset, &failed_index)) + set_extended_decoration(type.self, SPIRVCrossDecorationExplicitOffset); + else + { + SPIRV_CROSS_THROW(join("cbuffer ID ", var.self, " (name: ", buffer_name, "), member index ", + failed_index, " (name: ", to_member_name(type, failed_index), + ") cannot be expressed with either HLSL packing layout or packoffset.")); + } + + block_names.insert(buffer_name); + + // Save for post-reflection later. + declared_block_names[var.self] = buffer_name; + + type.member_name_cache.clear(); + // var.self can be used as a backup name for the block name, + // so we need to make sure we don't disturb the name here on a recompile. + // It will need to be reset if we have to recompile. + preserve_alias_on_reset(var.self); + add_resource_name(var.self); + statement("cbuffer ", buffer_name, to_resource_binding(var)); + begin_scope(); + + uint32_t i = 0; + for (auto &member : type.member_types) + { + add_member_name(type, i); + auto backup_name = get_member_name(type.self, i); + auto member_name = to_member_name(type, i); + member_name = join(to_name(var.self), "_", member_name); + ParsedIR::sanitize_underscores(member_name); + set_member_name(type.self, i, member_name); + emit_struct_member(type, member, i, ""); + set_member_name(type.self, i, backup_name); + i++; + } + + end_scope_decl(); + statement(""); + } + else + { + if (hlsl_options.shader_model < 51) + SPIRV_CROSS_THROW( + "Need ConstantBuffer to use arrays of UBOs, but this is only supported in SM 5.1."); + + add_resource_name(type.self); + add_resource_name(var.self); + + // ConstantBuffer does not support packoffset, so it is unuseable unless everything aligns as we expect. + uint32_t failed_index = 0; + if (!buffer_is_packing_standard(type, BufferPackingHLSLCbuffer, &failed_index)) + { + SPIRV_CROSS_THROW(join("HLSL ConstantBuffer ID ", var.self, " (name: ", to_name(type.self), + "), member index ", failed_index, " (name: ", to_member_name(type, failed_index), + ") cannot be expressed with normal HLSL packing rules.")); + } + + emit_struct(get(type.self)); + statement("ConstantBuffer<", to_name(type.self), "> ", to_name(var.self), type_to_array_glsl(type, var.self), + to_resource_binding(var), ";"); + } + } +} + +void CompilerHLSL::emit_push_constant_block(const SPIRVariable &var) +{ + if (flattened_buffer_blocks.count(var.self)) + { + emit_buffer_block_flattened(var); + } + else if (root_constants_layout.empty()) + { + emit_buffer_block(var); + } + else + { + for (const auto &layout : root_constants_layout) + { + auto &type = get(var.basetype); + + uint32_t failed_index = 0; + if (buffer_is_packing_standard(type, BufferPackingHLSLCbufferPackOffset, &failed_index, layout.start, + layout.end)) + set_extended_decoration(type.self, SPIRVCrossDecorationExplicitOffset); + else + { + SPIRV_CROSS_THROW(join("Root constant cbuffer ID ", var.self, " (name: ", to_name(type.self), ")", + ", member index ", failed_index, " (name: ", to_member_name(type, failed_index), + ") cannot be expressed with either HLSL packing layout or packoffset.")); + } + + flattened_structs[var.self] = false; + type.member_name_cache.clear(); + add_resource_name(var.self); + auto &memb = ir.meta[type.self].members; + + statement("cbuffer SPIRV_CROSS_RootConstant_", to_name(var.self), + to_resource_register(HLSL_BINDING_AUTO_PUSH_CONSTANT_BIT, 'b', layout.binding, layout.space)); + begin_scope(); + + // Index of the next field in the generated root constant constant buffer + auto constant_index = 0u; + + // Iterate over all member of the push constant and check which of the fields + // fit into the given root constant layout. + for (auto i = 0u; i < memb.size(); i++) + { + const auto offset = memb[i].offset; + if (layout.start <= offset && offset < layout.end) + { + const auto &member = type.member_types[i]; + + add_member_name(type, constant_index); + auto backup_name = get_member_name(type.self, i); + auto member_name = to_member_name(type, i); + member_name = join(to_name(var.self), "_", member_name); + ParsedIR::sanitize_underscores(member_name); + set_member_name(type.self, constant_index, member_name); + emit_struct_member(type, member, i, "", layout.start); + set_member_name(type.self, constant_index, backup_name); + + constant_index++; + } + } + + end_scope_decl(); + } + } +} + +string CompilerHLSL::to_sampler_expression(uint32_t id) +{ + auto expr = join("_", to_non_uniform_aware_expression(id)); + auto index = expr.find_first_of('['); + if (index == string::npos) + { + return expr + "_sampler"; + } + else + { + // We have an expression like _ident[array], so we cannot tack on _sampler, insert it inside the string instead. + return expr.insert(index, "_sampler"); + } +} + +void CompilerHLSL::emit_sampled_image_op(uint32_t result_type, uint32_t result_id, uint32_t image_id, uint32_t samp_id) +{ + if (hlsl_options.shader_model >= 40 && combined_image_samplers.empty()) + { + set(result_id, result_type, image_id, samp_id); + } + else + { + // Make sure to suppress usage tracking. It is illegal to create temporaries of opaque types. + emit_op(result_type, result_id, to_combined_image_sampler(image_id, samp_id), true, true); + } +} + +string CompilerHLSL::to_func_call_arg(const SPIRFunction::Parameter &arg, uint32_t id) +{ + string arg_str = CompilerGLSL::to_func_call_arg(arg, id); + + if (hlsl_options.shader_model <= 30) + return arg_str; + + // Manufacture automatic sampler arg if the arg is a SampledImage texture and we're in modern HLSL. + auto &type = expression_type(id); + + // We don't have to consider combined image samplers here via OpSampledImage because + // those variables cannot be passed as arguments to functions. + // Only global SampledImage variables may be used as arguments. + if (type.basetype == SPIRType::SampledImage && type.image.dim != DimBuffer) + arg_str += ", " + to_sampler_expression(id); + + return arg_str; +} + +string CompilerHLSL::get_inner_entry_point_name() const +{ + auto &execution = get_entry_point(); + + if (hlsl_options.use_entry_point_name) + { + auto name = join(execution.name, "_inner"); + ParsedIR::sanitize_underscores(name); + return name; + } + + if (execution.model == ExecutionModelVertex) + return "vert_main"; + else if (execution.model == ExecutionModelFragment) + return "frag_main"; + else if (execution.model == ExecutionModelGLCompute) + return "comp_main"; + else if (execution.model == ExecutionModelGeometry) + return "geom_main"; + else if (execution.model == ExecutionModelMeshEXT) + return "mesh_main"; + else if (execution.model == ExecutionModelTaskEXT) + return "task_main"; + else + SPIRV_CROSS_THROW("Unsupported execution model."); +} + +uint32_t CompilerHLSL::input_vertices_from_execution_mode(SPIREntryPoint &execution) const +{ + uint32_t input_vertices = 1; + + if (execution.flags.get(ExecutionModeInputLines)) + input_vertices = 2; + else if (execution.flags.get(ExecutionModeInputLinesAdjacency)) + input_vertices = 4; + else if (execution.flags.get(ExecutionModeInputTrianglesAdjacency)) + input_vertices = 6; + else if (execution.flags.get(ExecutionModeTriangles)) + input_vertices = 3; + else if (execution.flags.get(ExecutionModeInputPoints)) + input_vertices = 1; + else + SPIRV_CROSS_THROW("Unsupported execution model."); + return input_vertices; +} + +void CompilerHLSL::emit_function_prototype(SPIRFunction &func, const Bitset &return_flags) +{ + if (func.self != ir.default_entry_point) + add_function_overload(func); + + // Avoid shadow declarations. + local_variable_names = resource_names; + + string decl; + + auto &type = get(func.return_type); + if (type.array.empty()) + { + decl += flags_to_qualifiers_glsl(type, 0, return_flags); + decl += type_to_glsl(type); + decl += " "; + } + else + { + // We cannot return arrays in HLSL, so "return" through an out variable. + decl = "void "; + } + + if (func.self == ir.default_entry_point) + { + decl += get_inner_entry_point_name(); + processing_entry_point = true; + } + else + decl += to_name(func.self); + + decl += "("; + SmallVector arglist; + + if (!type.array.empty()) + { + // Fake array returns by writing to an out array instead. + string out_argument; + out_argument += "out "; + out_argument += type_to_glsl(type); + out_argument += " "; + out_argument += "spvReturnValue"; + out_argument += type_to_array_glsl(type, 0); + arglist.push_back(std::move(out_argument)); + } + + for (auto &arg : func.arguments) + { + // Do not pass in separate images or samplers if we're remapping + // to combined image samplers. + if (skip_argument(arg.id)) + continue; + + // Might change the variable name if it already exists in this function. + // SPIRV OpName doesn't have any semantic effect, so it's valid for an implementation + // to use same name for variables. + // Since we want to make the GLSL debuggable and somewhat sane, use fallback names for variables which are duplicates. + add_local_variable_name(arg.id); + + arglist.push_back(argument_decl(arg)); + + // Flatten a combined sampler to two separate arguments in modern HLSL. + auto &arg_type = get(arg.type); + if (hlsl_options.shader_model > 30 && arg_type.basetype == SPIRType::SampledImage && + arg_type.image.dim != DimBuffer) + { + // Manufacture automatic sampler arg for SampledImage texture + arglist.push_back(join(is_depth_image(arg_type, arg.id) ? "SamplerComparisonState " : "SamplerState ", + to_sampler_expression(arg.id), type_to_array_glsl(arg_type, arg.id))); + } + + // Hold a pointer to the parameter so we can invalidate the readonly field if needed. + auto *var = maybe_get(arg.id); + if (var) + var->parameter = &arg; + } + + for (auto &arg : func.shadow_arguments) + { + // Might change the variable name if it already exists in this function. + // SPIRV OpName doesn't have any semantic effect, so it's valid for an implementation + // to use same name for variables. + // Since we want to make the GLSL debuggable and somewhat sane, use fallback names for variables which are duplicates. + add_local_variable_name(arg.id); + + arglist.push_back(argument_decl(arg)); + + // Hold a pointer to the parameter so we can invalidate the readonly field if needed. + auto *var = maybe_get(arg.id); + if (var) + var->parameter = &arg; + } + + if ((func.self == ir.default_entry_point || func.emits_geometry) && + get_entry_point().model == ExecutionModelGeometry) + { + auto &execution = get_entry_point(); + + uint32_t input_vertices = input_vertices_from_execution_mode(execution); + + const char *prim; + if (execution.flags.get(ExecutionModeInputLinesAdjacency)) + prim = "lineadj"; + else if (execution.flags.get(ExecutionModeInputLines)) + prim = "line"; + else if (execution.flags.get(ExecutionModeInputTrianglesAdjacency)) + prim = "triangleadj"; + else if (execution.flags.get(ExecutionModeTriangles)) + prim = "triangle"; + else + prim = "point"; + + const char *stream_type; + if (execution.flags.get(ExecutionModeOutputPoints)) + stream_type = "PointStream"; + else if (execution.flags.get(ExecutionModeOutputLineStrip)) + stream_type = "LineStream"; + else + stream_type = "TriangleStream"; + + if (func.self == ir.default_entry_point) + arglist.push_back(join(prim, " SPIRV_Cross_Input stage_input[", input_vertices, "]")); + arglist.push_back(join("inout ", stream_type, " ", "geometry_stream")); + } + + decl += merge(arglist); + decl += ")"; + statement(decl); +} + +void CompilerHLSL::emit_hlsl_entry_point() +{ + SmallVector arguments; + + if (require_input && get_entry_point().model != ExecutionModelGeometry) + arguments.push_back("SPIRV_Cross_Input stage_input"); + + auto &execution = get_entry_point(); + + uint32_t input_vertices = 1; + + switch (execution.model) + { + case ExecutionModelGeometry: + { + input_vertices = input_vertices_from_execution_mode(execution); + + string prim; + if (execution.flags.get(ExecutionModeInputLinesAdjacency)) + prim = "lineadj"; + else if (execution.flags.get(ExecutionModeInputLines)) + prim = "line"; + else if (execution.flags.get(ExecutionModeInputTrianglesAdjacency)) + prim = "triangleadj"; + else if (execution.flags.get(ExecutionModeTriangles)) + prim = "triangle"; + else + prim = "point"; + + string stream_type; + if (execution.flags.get(ExecutionModeOutputPoints)) + { + stream_type = "PointStream"; + } + else if (execution.flags.get(ExecutionModeOutputLineStrip)) + { + stream_type = "LineStream"; + } + else + { + stream_type = "TriangleStream"; + } + + statement("[maxvertexcount(", execution.output_vertices, ")]"); + arguments.push_back(join(prim, " SPIRV_Cross_Input stage_input[", input_vertices, "]")); + arguments.push_back(join("inout ", stream_type, " ", "geometry_stream")); + break; + } + case ExecutionModelTaskEXT: + case ExecutionModelMeshEXT: + case ExecutionModelGLCompute: + { + if (execution.model == ExecutionModelMeshEXT) + { + if (execution.flags.get(ExecutionModeOutputTrianglesEXT)) + statement("[outputtopology(\"triangle\")]"); + else if (execution.flags.get(ExecutionModeOutputLinesEXT)) + statement("[outputtopology(\"line\")]"); + else if (execution.flags.get(ExecutionModeOutputPoints)) + SPIRV_CROSS_THROW("Topology mode \"points\" is not supported in DirectX"); + + auto &func = get(ir.default_entry_point); + for (auto &arg : func.arguments) + { + auto &var = get(arg.id); + auto &base_type = get(var.basetype); + bool block = has_decoration(base_type.self, DecorationBlock); + if (var.storage == StorageClassTaskPayloadWorkgroupEXT) + { + arguments.push_back("in payload " + variable_decl(var)); + } + else if (block) + { + auto flags = get_buffer_block_flags(var.self); + if (flags.get(DecorationPerPrimitiveEXT) || has_decoration(arg.id, DecorationPerPrimitiveEXT)) + { + arguments.push_back("out primitives gl_MeshPerPrimitiveEXT gl_MeshPrimitivesEXT[" + + std::to_string(execution.output_primitives) + "]"); + } + else + { + arguments.push_back("out vertices gl_MeshPerVertexEXT gl_MeshVerticesEXT[" + + std::to_string(execution.output_vertices) + "]"); + } + } + else + { + if (execution.flags.get(ExecutionModeOutputTrianglesEXT)) + { + arguments.push_back("out indices uint3 gl_PrimitiveTriangleIndicesEXT[" + + std::to_string(execution.output_primitives) + "]"); + } + else + { + arguments.push_back("out indices uint2 gl_PrimitiveLineIndicesEXT[" + + std::to_string(execution.output_primitives) + "]"); + } + } + } + } + SpecializationConstant wg_x, wg_y, wg_z; + get_work_group_size_specialization_constants(wg_x, wg_y, wg_z); + + uint32_t x = execution.workgroup_size.x; + uint32_t y = execution.workgroup_size.y; + uint32_t z = execution.workgroup_size.z; + + if (!execution.workgroup_size.constant && execution.flags.get(ExecutionModeLocalSizeId)) + { + if (execution.workgroup_size.id_x) + x = get(execution.workgroup_size.id_x).scalar(); + if (execution.workgroup_size.id_y) + y = get(execution.workgroup_size.id_y).scalar(); + if (execution.workgroup_size.id_z) + z = get(execution.workgroup_size.id_z).scalar(); + } + + auto x_expr = wg_x.id ? get(wg_x.id).specialization_constant_macro_name : to_string(x); + auto y_expr = wg_y.id ? get(wg_y.id).specialization_constant_macro_name : to_string(y); + auto z_expr = wg_z.id ? get(wg_z.id).specialization_constant_macro_name : to_string(z); + + statement("[numthreads(", x_expr, ", ", y_expr, ", ", z_expr, ")]"); + break; + } + case ExecutionModelFragment: + if (execution.flags.get(ExecutionModeEarlyFragmentTests)) + statement("[earlydepthstencil]"); + break; + default: + break; + } + + const char *entry_point_name; + if (hlsl_options.use_entry_point_name) + entry_point_name = get_entry_point().name.c_str(); + else + entry_point_name = "main"; + + statement(require_output ? "SPIRV_Cross_Output " : "void ", entry_point_name, "(", merge(arguments), ")"); + begin_scope(); + bool legacy = hlsl_options.shader_model <= 30; + + // Copy builtins from entry point arguments to globals. + active_input_builtins.for_each_bit([&](uint32_t i) { + auto builtin = builtin_to_glsl(static_cast(i), StorageClassInput); + switch (static_cast(i)) + { + case BuiltInFragCoord: + // VPOS in D3D9 is sampled at integer locations, apply half-pixel offset to be consistent. + // TODO: Do we need an option here? Any reason why a D3D9 shader would be used + // on a D3D10+ system with a different rasterization config? + if (legacy) + statement(builtin, " = stage_input.", builtin, " + float4(0.5f, 0.5f, 0.0f, 0.0f);"); + else + { + statement(builtin, " = stage_input.", builtin, ";"); + // ZW are undefined in D3D9, only do this fixup here. + statement(builtin, ".w = 1.0 / ", builtin, ".w;"); + } + break; + + case BuiltInVertexId: + case BuiltInVertexIndex: + case BuiltInInstanceIndex: + // D3D semantics are uint, but shader wants int. + if (hlsl_options.support_nonzero_base_vertex_base_instance || hlsl_options.shader_model >= 68) + { + if (hlsl_options.shader_model >= 68) + { + if (static_cast(i) == BuiltInInstanceIndex) + statement(builtin, " = int(stage_input.", builtin, " + stage_input.gl_BaseInstanceARB);"); + else + statement(builtin, " = int(stage_input.", builtin, " + stage_input.gl_BaseVertexARB);"); + } + else + { + if (static_cast(i) == BuiltInInstanceIndex) + statement(builtin, " = int(stage_input.", builtin, ") + SPIRV_Cross_BaseInstance;"); + else + statement(builtin, " = int(stage_input.", builtin, ") + SPIRV_Cross_BaseVertex;"); + } + } + else + statement(builtin, " = int(stage_input.", builtin, ");"); + break; + + case BuiltInBaseVertex: + if (hlsl_options.shader_model >= 68) + statement(builtin, " = stage_input.gl_BaseVertexARB;"); + else + statement(builtin, " = SPIRV_Cross_BaseVertex;"); + break; + + case BuiltInBaseInstance: + if (hlsl_options.shader_model >= 68) + statement(builtin, " = stage_input.gl_BaseInstanceARB;"); + else + statement(builtin, " = SPIRV_Cross_BaseInstance;"); + break; + + case BuiltInInstanceId: + // D3D semantics are uint, but shader wants int. + statement(builtin, " = int(stage_input.", builtin, ");"); + break; + + case BuiltInSampleMask: + statement(builtin, "[0] = stage_input.", builtin, ";"); + break; + + case BuiltInNumWorkgroups: + case BuiltInPointCoord: + case BuiltInSubgroupSize: + case BuiltInSubgroupLocalInvocationId: + case BuiltInHelperInvocation: + break; + + case BuiltInSubgroupEqMask: + // Emulate these ... + // No 64-bit in HLSL, so have to do it in 32-bit and unroll. + statement("gl_SubgroupEqMask = 1u << (WaveGetLaneIndex() - uint4(0, 32, 64, 96));"); + statement("if (WaveGetLaneIndex() >= 32) gl_SubgroupEqMask.x = 0;"); + statement("if (WaveGetLaneIndex() >= 64 || WaveGetLaneIndex() < 32) gl_SubgroupEqMask.y = 0;"); + statement("if (WaveGetLaneIndex() >= 96 || WaveGetLaneIndex() < 64) gl_SubgroupEqMask.z = 0;"); + statement("if (WaveGetLaneIndex() < 96) gl_SubgroupEqMask.w = 0;"); + break; + + case BuiltInSubgroupGeMask: + // Emulate these ... + // No 64-bit in HLSL, so have to do it in 32-bit and unroll. + statement("gl_SubgroupGeMask = ~((1u << (WaveGetLaneIndex() - uint4(0, 32, 64, 96))) - 1u);"); + statement("if (WaveGetLaneIndex() >= 32) gl_SubgroupGeMask.x = 0u;"); + statement("if (WaveGetLaneIndex() >= 64) gl_SubgroupGeMask.y = 0u;"); + statement("if (WaveGetLaneIndex() >= 96) gl_SubgroupGeMask.z = 0u;"); + statement("if (WaveGetLaneIndex() < 32) gl_SubgroupGeMask.y = ~0u;"); + statement("if (WaveGetLaneIndex() < 64) gl_SubgroupGeMask.z = ~0u;"); + statement("if (WaveGetLaneIndex() < 96) gl_SubgroupGeMask.w = ~0u;"); + break; + + case BuiltInSubgroupGtMask: + // Emulate these ... + // No 64-bit in HLSL, so have to do it in 32-bit and unroll. + statement("uint gt_lane_index = WaveGetLaneIndex() + 1;"); + statement("gl_SubgroupGtMask = ~((1u << (gt_lane_index - uint4(0, 32, 64, 96))) - 1u);"); + statement("if (gt_lane_index >= 32) gl_SubgroupGtMask.x = 0u;"); + statement("if (gt_lane_index >= 64) gl_SubgroupGtMask.y = 0u;"); + statement("if (gt_lane_index >= 96) gl_SubgroupGtMask.z = 0u;"); + statement("if (gt_lane_index >= 128) gl_SubgroupGtMask.w = 0u;"); + statement("if (gt_lane_index < 32) gl_SubgroupGtMask.y = ~0u;"); + statement("if (gt_lane_index < 64) gl_SubgroupGtMask.z = ~0u;"); + statement("if (gt_lane_index < 96) gl_SubgroupGtMask.w = ~0u;"); + break; + + case BuiltInSubgroupLeMask: + // Emulate these ... + // No 64-bit in HLSL, so have to do it in 32-bit and unroll. + statement("uint le_lane_index = WaveGetLaneIndex() + 1;"); + statement("gl_SubgroupLeMask = (1u << (le_lane_index - uint4(0, 32, 64, 96))) - 1u;"); + statement("if (le_lane_index >= 32) gl_SubgroupLeMask.x = ~0u;"); + statement("if (le_lane_index >= 64) gl_SubgroupLeMask.y = ~0u;"); + statement("if (le_lane_index >= 96) gl_SubgroupLeMask.z = ~0u;"); + statement("if (le_lane_index >= 128) gl_SubgroupLeMask.w = ~0u;"); + statement("if (le_lane_index < 32) gl_SubgroupLeMask.y = 0u;"); + statement("if (le_lane_index < 64) gl_SubgroupLeMask.z = 0u;"); + statement("if (le_lane_index < 96) gl_SubgroupLeMask.w = 0u;"); + break; + + case BuiltInSubgroupLtMask: + // Emulate these ... + // No 64-bit in HLSL, so have to do it in 32-bit and unroll. + statement("gl_SubgroupLtMask = (1u << (WaveGetLaneIndex() - uint4(0, 32, 64, 96))) - 1u;"); + statement("if (WaveGetLaneIndex() >= 32) gl_SubgroupLtMask.x = ~0u;"); + statement("if (WaveGetLaneIndex() >= 64) gl_SubgroupLtMask.y = ~0u;"); + statement("if (WaveGetLaneIndex() >= 96) gl_SubgroupLtMask.z = ~0u;"); + statement("if (WaveGetLaneIndex() < 32) gl_SubgroupLtMask.y = 0u;"); + statement("if (WaveGetLaneIndex() < 64) gl_SubgroupLtMask.z = 0u;"); + statement("if (WaveGetLaneIndex() < 96) gl_SubgroupLtMask.w = 0u;"); + break; + + case BuiltInClipDistance: + for (uint32_t clip = 0; clip < clip_distance_count; clip++) + statement("gl_ClipDistance[", clip, "] = stage_input.gl_ClipDistance", clip / 4, ".", "xyzw"[clip & 3], + ";"); + break; + + case BuiltInCullDistance: + for (uint32_t cull = 0; cull < cull_distance_count; cull++) + statement("gl_CullDistance[", cull, "] = stage_input.gl_CullDistance", cull / 4, ".", "xyzw"[cull & 3], + ";"); + break; + + default: + statement(builtin, " = stage_input.", builtin, ";"); + break; + } + }); + + // Copy from stage input struct to globals. + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + auto &type = this->get(var.basetype); + bool block = has_decoration(type.self, DecorationBlock); + + if (var.storage != StorageClassInput) + return; + + bool is_hidden = is_hidden_io_variable(var); + + bool need_matrix_unroll = var.storage == StorageClassInput && execution.model == ExecutionModelVertex; + + if (!var.remapped_variable && type.pointer && !is_builtin_variable(var) && + interface_variable_exists_in_entry_point(var.self) && !is_hidden) + { + if (block) + { + auto type_name = to_name(type.self); + auto var_name = to_name(var.self); + bool is_per_vertex = has_decoration(var.self, DecorationPerVertexKHR); + uint32_t array_size = is_per_vertex ? to_array_size_literal(type) : 0; + + for (uint32_t mbr_idx = 0; mbr_idx < uint32_t(type.member_types.size()); mbr_idx++) + { + auto mbr_name = to_member_name(type, mbr_idx); + auto flat_name = join(type_name, "_", mbr_name); + + if (is_per_vertex) + { + for (uint32_t i = 0; i < array_size; i++) + statement(var_name, "[", i, "].", mbr_name, " = GetAttributeAtVertex(stage_input.", flat_name, ", ", i, ");"); + } + else + { + statement(var_name, ".", mbr_name, " = stage_input.", flat_name, ";"); + } + } + } + else + { + auto name = to_name(var.self); + auto &mtype = this->get(var.basetype); + if (need_matrix_unroll && mtype.columns > 1) + { + // Unroll matrices. + for (uint32_t col = 0; col < mtype.columns; col++) + statement(name, "[", col, "] = stage_input.", name, "_", col, ";"); + } + else if (has_decoration(var.self, DecorationPerVertexKHR)) + { + uint32_t array_size = to_array_size_literal(type); + for (uint32_t i = 0; i < array_size; i++) + statement(name, "[", i, "]", " = GetAttributeAtVertex(stage_input.", name, ", ", i, ");"); + } + else + { + if (execution.model == ExecutionModelGeometry) + { + statement("for (int i = 0; i < ", input_vertices, "; i++)"); + begin_scope(); + statement(name, "[i] = stage_input[i].", name, ";"); + end_scope(); + } + else + statement(name, " = stage_input.", name, ";"); + } + } + } + }); + + // Run the shader. + if (execution.model == ExecutionModelVertex || execution.model == ExecutionModelFragment || + execution.model == ExecutionModelGLCompute || execution.model == ExecutionModelMeshEXT || + execution.model == ExecutionModelGeometry || execution.model == ExecutionModelTaskEXT) + { + // For mesh shaders, we receive special arguments that we must pass down as function arguments. + // HLSL does not support proper reference types for passing these IO blocks, + // but DXC post-inlining seems to magically fix it up anyways *shrug*. + SmallVector arglist; + auto &func = get(ir.default_entry_point); + // The arguments are marked out, avoid detecting reads and emitting inout. + + for (auto &arg : func.arguments) + arglist.push_back(to_expression(arg.id, false)); + + if (execution.model == ExecutionModelGeometry) + { + arglist.push_back("stage_input"); + arglist.push_back("geometry_stream"); + } + + statement(get_inner_entry_point_name(), "(", merge(arglist), ");"); + } + else + SPIRV_CROSS_THROW("Unsupported shader stage."); + + // Copy stage outputs. + if (require_output) + { + statement("SPIRV_Cross_Output stage_output;"); + + // Copy builtins from globals to return struct. + active_output_builtins.for_each_bit([&](uint32_t i) { + // PointSize doesn't exist in HLSL SM 4+. + if (i == BuiltInPointSize && !legacy) + return; + + switch (static_cast(i)) + { + case BuiltInClipDistance: + for (uint32_t clip = 0; clip < clip_distance_count; clip++) + statement("stage_output.gl_ClipDistance", clip / 4, ".", "xyzw"[clip & 3], " = gl_ClipDistance[", + clip, "];"); + break; + + case BuiltInCullDistance: + for (uint32_t cull = 0; cull < cull_distance_count; cull++) + statement("stage_output.gl_CullDistance", cull / 4, ".", "xyzw"[cull & 3], " = gl_CullDistance[", + cull, "];"); + break; + + case BuiltInSampleMask: + statement("stage_output.gl_SampleMask = gl_SampleMask[0];"); + break; + + default: + { + auto builtin_expr = builtin_to_glsl(static_cast(i), StorageClassOutput); + statement("stage_output.", builtin_expr, " = ", builtin_expr, ";"); + break; + } + } + }); + + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + auto &type = this->get(var.basetype); + bool block = has_decoration(type.self, DecorationBlock); + + if (var.storage != StorageClassOutput) + return; + + if (!var.remapped_variable && type.pointer && + !is_builtin_variable(var) && + interface_variable_exists_in_entry_point(var.self)) + { + if (block) + { + // I/O blocks need to flatten output. + auto type_name = to_name(type.self); + auto var_name = to_name(var.self); + for (uint32_t mbr_idx = 0; mbr_idx < uint32_t(type.member_types.size()); mbr_idx++) + { + auto mbr_name = to_member_name(type, mbr_idx); + auto flat_name = join(type_name, "_", mbr_name); + statement("stage_output.", flat_name, " = ", var_name, ".", mbr_name, ";"); + } + } + else + { + auto name = to_name(var.self); + + if (legacy && execution.model == ExecutionModelFragment) + { + string output_filler; + for (uint32_t size = type.vecsize; size < 4; ++size) + output_filler += ", 0.0"; + + statement("stage_output.", name, " = float4(", name, output_filler, ");"); + } + else + { + statement("stage_output.", name, " = ", name, ";"); + } + } + } + }); + + statement("return stage_output;"); + } + + end_scope(); +} + +void CompilerHLSL::emit_fixup() +{ + if (is_vertex_like_shader() && active_output_builtins.get(BuiltInPosition)) + { + // Do various mangling on the gl_Position. + if (hlsl_options.shader_model <= 30) + { + statement("gl_Position.x = gl_Position.x - gl_HalfPixel.x * " + "gl_Position.w;"); + statement("gl_Position.y = gl_Position.y + gl_HalfPixel.y * " + "gl_Position.w;"); + } + + if (options.vertex.flip_vert_y) + statement("gl_Position.y = -gl_Position.y;"); + if (options.vertex.fixup_clipspace) + statement("gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;"); + } +} + +void CompilerHLSL::emit_texture_op(const Instruction &i, bool sparse) +{ + if (sparse) + SPIRV_CROSS_THROW("Sparse feedback not yet supported in HLSL."); + + auto *ops = stream(i); + auto op = static_cast(i.op); + uint32_t length = i.length; + + SmallVector inherited_expressions; + + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + VariableID img = ops[2]; + uint32_t coord = ops[3]; + uint32_t dref = 0; + uint32_t comp = 0; + bool gather = false; + bool proj = false; + const uint32_t *opt = nullptr; + auto *combined_image = maybe_get(img); + + if (combined_image && has_decoration(img, DecorationNonUniform)) + { + set_decoration(combined_image->image, DecorationNonUniform); + set_decoration(combined_image->sampler, DecorationNonUniform); + } + + auto img_expr = to_non_uniform_aware_expression(combined_image ? combined_image->image : img); + + inherited_expressions.push_back(coord); + + switch (op) + { + case OpImageSampleDrefImplicitLod: + case OpImageSampleDrefExplicitLod: + dref = ops[4]; + opt = &ops[5]; + length -= 5; + break; + + case OpImageSampleProjDrefImplicitLod: + case OpImageSampleProjDrefExplicitLod: + dref = ops[4]; + proj = true; + opt = &ops[5]; + length -= 5; + break; + + case OpImageDrefGather: + dref = ops[4]; + opt = &ops[5]; + gather = true; + length -= 5; + break; + + case OpImageGather: + comp = ops[4]; + opt = &ops[5]; + gather = true; + length -= 5; + break; + + case OpImageSampleProjImplicitLod: + case OpImageSampleProjExplicitLod: + opt = &ops[4]; + length -= 4; + proj = true; + break; + + case OpImageQueryLod: + opt = &ops[4]; + length -= 4; + break; + + default: + opt = &ops[4]; + length -= 4; + break; + } + + auto &imgtype = expression_type(img); + uint32_t coord_components = 0; + switch (imgtype.image.dim) + { + case Dim1D: + coord_components = 1; + break; + case Dim2D: + coord_components = 2; + break; + case Dim3D: + coord_components = 3; + break; + case DimCube: + coord_components = 3; + break; + case DimBuffer: + coord_components = 1; + break; + default: + coord_components = 2; + break; + } + + if (dref) + inherited_expressions.push_back(dref); + + if (imgtype.image.arrayed && op != OpImageQueryLod) + coord_components++; + + uint32_t bias = 0; + uint32_t lod = 0; + uint32_t grad_x = 0; + uint32_t grad_y = 0; + uint32_t coffset = 0; + uint32_t offset = 0; + uint32_t coffsets = 0; + uint32_t sample = 0; + uint32_t minlod = 0; + uint32_t flags = 0; + + if (length) + { + flags = opt[0]; + opt++; + length--; + } + + auto test = [&](uint32_t &v, uint32_t flag) { + if (length && (flags & flag)) + { + v = *opt++; + inherited_expressions.push_back(v); + length--; + } + }; + + test(bias, ImageOperandsBiasMask); + test(lod, ImageOperandsLodMask); + test(grad_x, ImageOperandsGradMask); + test(grad_y, ImageOperandsGradMask); + test(coffset, ImageOperandsConstOffsetMask); + test(offset, ImageOperandsOffsetMask); + test(coffsets, ImageOperandsConstOffsetsMask); + test(sample, ImageOperandsSampleMask); + test(minlod, ImageOperandsMinLodMask); + + string expr; + string texop; + + if (minlod != 0) + SPIRV_CROSS_THROW("MinLod texture operand not supported in HLSL."); + + if (op == OpImageFetch) + { + if (hlsl_options.shader_model < 40) + { + SPIRV_CROSS_THROW("texelFetch is not supported in HLSL shader model 2/3."); + } + texop += img_expr; + texop += ".Load"; + } + else if (op == OpImageQueryLod) + { + texop += img_expr; + texop += ".CalculateLevelOfDetail"; + } + else + { + auto &imgformat = get(imgtype.image.type); + if (hlsl_options.shader_model < 67 && imgformat.basetype != SPIRType::Float) + { + SPIRV_CROSS_THROW("Sampling non-float textures is not supported in HLSL SM < 6.7."); + } + + if (hlsl_options.shader_model >= 40) + { + texop += img_expr; + + if (is_depth_image(imgtype, img)) + { + if (gather) + { + texop += ".GatherCmp"; + } + else if (lod || grad_x || grad_y) + { + // Assume we want a fixed level, and the only thing we can get in HLSL is SampleCmpLevelZero. + texop += ".SampleCmpLevelZero"; + } + else + texop += ".SampleCmp"; + } + else if (gather) + { + uint32_t comp_num = evaluate_constant_u32(comp); + if (hlsl_options.shader_model >= 50) + { + switch (comp_num) + { + case 0: + texop += ".GatherRed"; + break; + case 1: + texop += ".GatherGreen"; + break; + case 2: + texop += ".GatherBlue"; + break; + case 3: + texop += ".GatherAlpha"; + break; + default: + SPIRV_CROSS_THROW("Invalid component."); + } + } + else + { + if (comp_num == 0) + texop += ".Gather"; + else + SPIRV_CROSS_THROW("HLSL shader model 4 can only gather from the red component."); + } + } + else if (bias) + texop += ".SampleBias"; + else if (grad_x || grad_y) + texop += ".SampleGrad"; + else if (lod) + texop += ".SampleLevel"; + else + texop += ".Sample"; + } + else + { + switch (imgtype.image.dim) + { + case Dim1D: + texop += "tex1D"; + break; + case Dim2D: + texop += "tex2D"; + break; + case Dim3D: + texop += "tex3D"; + break; + case DimCube: + texop += "texCUBE"; + break; + case DimRect: + case DimBuffer: + case DimSubpassData: + SPIRV_CROSS_THROW("Buffer texture support is not yet implemented for HLSL"); // TODO + default: + SPIRV_CROSS_THROW("Invalid dimension."); + } + + if (gather) + SPIRV_CROSS_THROW("textureGather is not supported in HLSL shader model 2/3."); + if (offset || coffset) + SPIRV_CROSS_THROW("textureOffset is not supported in HLSL shader model 2/3."); + + if (grad_x || grad_y) + texop += "grad"; + else if (lod) + texop += "lod"; + else if (bias) + texop += "bias"; + else if (proj || dref) + texop += "proj"; + } + } + + expr += texop; + expr += "("; + if (hlsl_options.shader_model < 40) + { + if (combined_image) + SPIRV_CROSS_THROW("Separate images/samplers are not supported in HLSL shader model 2/3."); + expr += to_expression(img); + } + else if (op != OpImageFetch) + { + string sampler_expr; + if (combined_image) + sampler_expr = to_non_uniform_aware_expression(combined_image->sampler); + else + sampler_expr = to_sampler_expression(img); + expr += sampler_expr; + } + + auto swizzle = [](uint32_t comps, uint32_t in_comps) -> const char * { + if (comps == in_comps) + return ""; + + switch (comps) + { + case 1: + return ".x"; + case 2: + return ".xy"; + case 3: + return ".xyz"; + default: + return ""; + } + }; + + bool forward = should_forward(coord); + + // The IR can give us more components than we need, so chop them off as needed. + string coord_expr; + auto &coord_type = expression_type(coord); + if (coord_components != coord_type.vecsize) + coord_expr = to_enclosed_expression(coord) + swizzle(coord_components, expression_type(coord).vecsize); + else + coord_expr = to_expression(coord); + + if (proj && hlsl_options.shader_model >= 40) // Legacy HLSL has "proj" operations which do this for us. + coord_expr = coord_expr + " / " + to_extract_component_expression(coord, coord_components); + + if (hlsl_options.shader_model < 40) + { + if (dref) + { + if (imgtype.image.dim != Dim1D && imgtype.image.dim != Dim2D) + { + SPIRV_CROSS_THROW( + "Depth comparison is only supported for 1D and 2D textures in HLSL shader model 2/3."); + } + + if (grad_x || grad_y) + SPIRV_CROSS_THROW("Depth comparison is not supported for grad sampling in HLSL shader model 2/3."); + + for (uint32_t size = coord_components; size < 2; ++size) + coord_expr += ", 0.0"; + + forward = forward && should_forward(dref); + coord_expr += ", " + to_expression(dref); + } + else if (lod || bias || proj) + { + for (uint32_t size = coord_components; size < 3; ++size) + coord_expr += ", 0.0"; + } + + if (lod) + { + coord_expr = "float4(" + coord_expr + ", " + to_expression(lod) + ")"; + } + else if (bias) + { + coord_expr = "float4(" + coord_expr + ", " + to_expression(bias) + ")"; + } + else if (proj) + { + coord_expr = "float4(" + coord_expr + ", " + to_extract_component_expression(coord, coord_components) + ")"; + } + else if (dref) + { + // A "normal" sample gets fed into tex2Dproj as well, because the + // regular tex2D accepts only two coordinates. + coord_expr = "float4(" + coord_expr + ", 1.0)"; + } + + if (!!lod + !!bias + !!proj > 1) + SPIRV_CROSS_THROW("Legacy HLSL can only use one of lod/bias/proj modifiers."); + } + + if (op == OpImageFetch) + { + if (imgtype.image.dim != DimBuffer && !imgtype.image.ms) + coord_expr = + join("int", coord_components + 1, "(", coord_expr, ", ", lod ? to_expression(lod) : string("0"), ")"); + } + else + expr += ", "; + expr += coord_expr; + + if (dref && hlsl_options.shader_model >= 40) + { + forward = forward && should_forward(dref); + expr += ", "; + + if (proj) + expr += to_enclosed_expression(dref) + " / " + to_extract_component_expression(coord, coord_components); + else + expr += to_expression(dref); + } + + if (!dref && (grad_x || grad_y)) + { + forward = forward && should_forward(grad_x); + forward = forward && should_forward(grad_y); + expr += ", "; + expr += to_expression(grad_x); + expr += ", "; + expr += to_expression(grad_y); + } + + if (!dref && lod && hlsl_options.shader_model >= 40 && op != OpImageFetch) + { + forward = forward && should_forward(lod); + expr += ", "; + expr += to_expression(lod); + } + + if (!dref && bias && hlsl_options.shader_model >= 40) + { + forward = forward && should_forward(bias); + expr += ", "; + expr += to_expression(bias); + } + + if (coffset) + { + forward = forward && should_forward(coffset); + expr += ", "; + expr += to_expression(coffset); + } + else if (offset) + { + forward = forward && should_forward(offset); + expr += ", "; + expr += to_expression(offset); + } + + if (sample) + { + expr += ", "; + expr += to_expression(sample); + } + + expr += ")"; + + if (dref && hlsl_options.shader_model < 40) + expr += ".x"; + + if (op == OpImageQueryLod) + { + // This is rather awkward. + // textureQueryLod returns two values, the "accessed level", + // as well as the actual LOD lambda. + // As far as I can tell, there is no way to get the .x component + // according to GLSL spec, and it depends on the sampler itself. + // Just assume X == Y, so we will need to splat the result to a float2. + statement("float _", id, "_tmp = ", expr, ";"); + statement("float2 _", id, " = _", id, "_tmp.xx;"); + set(id, join("_", id), result_type, true); + } + else + { + emit_op(result_type, id, expr, forward, false); + } + + for (auto &inherit : inherited_expressions) + inherit_expression_dependencies(id, inherit); + + switch (op) + { + case OpImageSampleDrefImplicitLod: + case OpImageSampleImplicitLod: + case OpImageSampleProjImplicitLod: + case OpImageSampleProjDrefImplicitLod: + register_control_dependent_expression(id); + break; + + default: + break; + } +} + +string CompilerHLSL::to_resource_binding(const SPIRVariable &var) +{ + const auto &type = get(var.basetype); + + // We can remap push constant blocks, even if they don't have any binding decoration. + if (type.storage != StorageClassPushConstant && !has_decoration(var.self, DecorationBinding)) + return ""; + + char space = '\0'; + + HLSLBindingFlagBits resource_flags = HLSL_BINDING_AUTO_NONE_BIT; + + switch (type.basetype) + { + case SPIRType::SampledImage: + space = 't'; // SRV + resource_flags = HLSL_BINDING_AUTO_SRV_BIT; + break; + + case SPIRType::Image: + if (type.image.sampled == 2 && type.image.dim != DimSubpassData) + { + if (has_decoration(var.self, DecorationNonWritable) && hlsl_options.nonwritable_uav_texture_as_srv) + { + space = 't'; // SRV + resource_flags = HLSL_BINDING_AUTO_SRV_BIT; + } + else + { + space = 'u'; // UAV + resource_flags = HLSL_BINDING_AUTO_UAV_BIT; + } + } + else + { + space = 't'; // SRV + resource_flags = HLSL_BINDING_AUTO_SRV_BIT; + } + break; + + case SPIRType::Sampler: + space = 's'; + resource_flags = HLSL_BINDING_AUTO_SAMPLER_BIT; + break; + + case SPIRType::AccelerationStructure: + space = 't'; // SRV + resource_flags = HLSL_BINDING_AUTO_SRV_BIT; + break; + + case SPIRType::Struct: + { + auto storage = type.storage; + if (storage == StorageClassUniform) + { + if (has_decoration(type.self, DecorationBufferBlock)) + { + Bitset flags = ir.get_buffer_block_flags(var); + bool is_readonly = flags.get(DecorationNonWritable) && !is_hlsl_force_storage_buffer_as_uav(var.self); + space = is_readonly ? 't' : 'u'; // UAV + resource_flags = is_readonly ? HLSL_BINDING_AUTO_SRV_BIT : HLSL_BINDING_AUTO_UAV_BIT; + } + else if (has_decoration(type.self, DecorationBlock)) + { + space = 'b'; // Constant buffers + resource_flags = HLSL_BINDING_AUTO_CBV_BIT; + } + } + else if (storage == StorageClassPushConstant) + { + space = 'b'; // Constant buffers + resource_flags = HLSL_BINDING_AUTO_PUSH_CONSTANT_BIT; + } + else if (storage == StorageClassStorageBuffer) + { + // UAV or SRV depending on readonly flag. + Bitset flags = ir.get_buffer_block_flags(var); + bool is_readonly = flags.get(DecorationNonWritable) && !is_hlsl_force_storage_buffer_as_uav(var.self); + space = is_readonly ? 't' : 'u'; + resource_flags = is_readonly ? HLSL_BINDING_AUTO_SRV_BIT : HLSL_BINDING_AUTO_UAV_BIT; + } + + break; + } + default: + break; + } + + if (!space) + return ""; + + uint32_t desc_set = + resource_flags == HLSL_BINDING_AUTO_PUSH_CONSTANT_BIT ? ResourceBindingPushConstantDescriptorSet : 0u; + uint32_t binding = resource_flags == HLSL_BINDING_AUTO_PUSH_CONSTANT_BIT ? ResourceBindingPushConstantBinding : 0u; + + if (has_decoration(var.self, DecorationBinding)) + binding = get_decoration(var.self, DecorationBinding); + if (has_decoration(var.self, DecorationDescriptorSet)) + desc_set = get_decoration(var.self, DecorationDescriptorSet); + + return to_resource_register(resource_flags, space, binding, desc_set); +} + +string CompilerHLSL::to_resource_binding_sampler(const SPIRVariable &var) +{ + // For combined image samplers. + if (!has_decoration(var.self, DecorationBinding)) + return ""; + + return to_resource_register(HLSL_BINDING_AUTO_SAMPLER_BIT, 's', get_decoration(var.self, DecorationBinding), + get_decoration(var.self, DecorationDescriptorSet)); +} + +void CompilerHLSL::remap_hlsl_resource_binding(HLSLBindingFlagBits type, uint32_t &desc_set, uint32_t &binding) +{ + auto itr = resource_bindings.find({ get_execution_model(), desc_set, binding }); + if (itr != end(resource_bindings)) + { + auto &remap = itr->second; + remap.second = true; + + switch (type) + { + case HLSL_BINDING_AUTO_PUSH_CONSTANT_BIT: + case HLSL_BINDING_AUTO_CBV_BIT: + desc_set = remap.first.cbv.register_space; + binding = remap.first.cbv.register_binding; + break; + + case HLSL_BINDING_AUTO_SRV_BIT: + desc_set = remap.first.srv.register_space; + binding = remap.first.srv.register_binding; + break; + + case HLSL_BINDING_AUTO_SAMPLER_BIT: + desc_set = remap.first.sampler.register_space; + binding = remap.first.sampler.register_binding; + break; + + case HLSL_BINDING_AUTO_UAV_BIT: + desc_set = remap.first.uav.register_space; + binding = remap.first.uav.register_binding; + break; + + default: + break; + } + } +} + +string CompilerHLSL::to_resource_register(HLSLBindingFlagBits flag, char space, uint32_t binding, uint32_t space_set) +{ + if ((flag & resource_binding_flags) == 0) + { + remap_hlsl_resource_binding(flag, space_set, binding); + + // The push constant block did not have a binding, and there were no remap for it, + // so, declare without register binding. + if (flag == HLSL_BINDING_AUTO_PUSH_CONSTANT_BIT && space_set == ResourceBindingPushConstantDescriptorSet) + return ""; + + if (hlsl_options.shader_model >= 51) + return join(" : register(", space, binding, ", space", space_set, ")"); + else + return join(" : register(", space, binding, ")"); + } + else + return ""; +} + +void CompilerHLSL::emit_modern_uniform(const SPIRVariable &var) +{ + auto &type = get(var.basetype); + switch (type.basetype) + { + case SPIRType::SampledImage: + case SPIRType::Image: + { + bool is_coherent = false; + if (type.basetype == SPIRType::Image && type.image.sampled == 2) + is_coherent = has_decoration(var.self, DecorationCoherent); + + statement(is_coherent ? "globallycoherent " : "", image_type_hlsl_modern(type, var.self), " ", + to_name(var.self), type_to_array_glsl(type, var.self), to_resource_binding(var), ";"); + + if (type.basetype == SPIRType::SampledImage && type.image.dim != DimBuffer) + { + // For combined image samplers, also emit a combined image sampler. + if (is_depth_image(type, var.self)) + statement("SamplerComparisonState ", to_sampler_expression(var.self), type_to_array_glsl(type, var.self), + to_resource_binding_sampler(var), ";"); + else + statement("SamplerState ", to_sampler_expression(var.self), type_to_array_glsl(type, var.self), + to_resource_binding_sampler(var), ";"); + } + break; + } + + case SPIRType::Sampler: + if (comparison_ids.count(var.self)) + statement("SamplerComparisonState ", to_name(var.self), type_to_array_glsl(type, var.self), to_resource_binding(var), + ";"); + else + statement("SamplerState ", to_name(var.self), type_to_array_glsl(type, var.self), to_resource_binding(var), ";"); + break; + + default: + statement(variable_decl(var), to_resource_binding(var), ";"); + break; + } +} + +void CompilerHLSL::emit_legacy_uniform(const SPIRVariable &var) +{ + auto &type = get(var.basetype); + switch (type.basetype) + { + case SPIRType::Sampler: + case SPIRType::Image: + SPIRV_CROSS_THROW("Separate image and samplers not supported in legacy HLSL."); + + default: + statement(variable_decl(var), ";"); + break; + } +} + +void CompilerHLSL::emit_uniform(const SPIRVariable &var) +{ + add_resource_name(var.self); + if (hlsl_options.shader_model >= 40) + emit_modern_uniform(var); + else + emit_legacy_uniform(var); +} + +bool CompilerHLSL::emit_complex_bitcast(uint32_t, uint32_t, uint32_t) +{ + return false; +} + +void CompilerHLSL::append_global_func_args(const SPIRFunction &func, uint32_t index, SmallVector &arglist) +{ + CompilerGLSL::append_global_func_args(func, index, arglist); + + if (func.emits_geometry) + arglist.push_back("geometry_stream"); +} + +string CompilerHLSL::bitcast_glsl_op(const SPIRType &out_type, const SPIRType &in_type) +{ + if (out_type.basetype == SPIRType::UInt && in_type.basetype == SPIRType::Int) + return type_to_glsl(out_type); + else if (out_type.basetype == SPIRType::UInt64 && in_type.basetype == SPIRType::Int64) + return type_to_glsl(out_type); + else if (out_type.basetype == SPIRType::UInt && in_type.basetype == SPIRType::Float) + return "asuint"; + else if (out_type.basetype == SPIRType::Int && in_type.basetype == SPIRType::UInt) + return type_to_glsl(out_type); + else if (out_type.basetype == SPIRType::Int64 && in_type.basetype == SPIRType::UInt64) + return type_to_glsl(out_type); + else if (out_type.basetype == SPIRType::Int && in_type.basetype == SPIRType::Float) + return "asint"; + else if (out_type.basetype == SPIRType::Float && in_type.basetype == SPIRType::UInt) + return "asfloat"; + else if (out_type.basetype == SPIRType::Float && in_type.basetype == SPIRType::Int) + return "asfloat"; + else if (out_type.basetype == SPIRType::Int64 && in_type.basetype == SPIRType::Double) + SPIRV_CROSS_THROW("Double to Int64 is not supported in HLSL."); + else if (out_type.basetype == SPIRType::UInt64 && in_type.basetype == SPIRType::Double) + SPIRV_CROSS_THROW("Double to UInt64 is not supported in HLSL."); + else if (out_type.basetype == SPIRType::Double && in_type.basetype == SPIRType::Int64) + return "asdouble"; + else if (out_type.basetype == SPIRType::Double && in_type.basetype == SPIRType::UInt64) + return "asdouble"; + else if (out_type.basetype == SPIRType::Half && in_type.basetype == SPIRType::UInt && in_type.vecsize == 1) + { + if (!requires_explicit_fp16_packing) + { + requires_explicit_fp16_packing = true; + force_recompile(); + } + return "spvUnpackFloat2x16"; + } + else if (out_type.basetype == SPIRType::UInt && in_type.basetype == SPIRType::Half && in_type.vecsize == 2) + { + if (!requires_explicit_fp16_packing) + { + requires_explicit_fp16_packing = true; + force_recompile(); + } + return "spvPackFloat2x16"; + } + else if (out_type.basetype == SPIRType::UShort && in_type.basetype == SPIRType::Half) + { + if (hlsl_options.shader_model < 40) + SPIRV_CROSS_THROW("Half to UShort requires Shader Model 4."); + return "(" + type_to_glsl(out_type) + ")f32tof16"; + } + else if (out_type.basetype == SPIRType::Half && in_type.basetype == SPIRType::UShort) + { + if (hlsl_options.shader_model < 40) + SPIRV_CROSS_THROW("UShort to Half requires Shader Model 4."); + return "(" + type_to_glsl(out_type) + ")f16tof32"; + } + else + return ""; +} + +void CompilerHLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, const uint32_t *args, uint32_t count) +{ + auto op = static_cast(eop); + + // If we need to do implicit bitcasts, make sure we do it with the correct type. + uint32_t integer_width = get_integer_width_for_glsl_instruction(op, args, count); + auto int_type = to_signed_basetype(integer_width); + auto uint_type = to_unsigned_basetype(integer_width); + + op = get_remapped_glsl_op(op); + + switch (op) + { + case GLSLstd450InverseSqrt: + emit_unary_func_op(result_type, id, args[0], "rsqrt"); + break; + + case GLSLstd450Fract: + emit_unary_func_op(result_type, id, args[0], "frac"); + break; + + case GLSLstd450RoundEven: + if (hlsl_options.shader_model < 40) + SPIRV_CROSS_THROW("roundEven is not supported in HLSL shader model 2/3."); + emit_unary_func_op(result_type, id, args[0], "round"); + break; + + case GLSLstd450Trunc: + emit_unary_func_op(result_type, id, args[0], "trunc"); + break; + + case GLSLstd450Acosh: + case GLSLstd450Asinh: + case GLSLstd450Atanh: + // These are not supported in HLSL, always emulate them. + emit_emulated_ahyper_op(result_type, id, args[0], op); + break; + + case GLSLstd450FMix: + case GLSLstd450IMix: + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "lerp"); + break; + + case GLSLstd450Atan2: + emit_binary_func_op(result_type, id, args[0], args[1], "atan2"); + break; + + case GLSLstd450Fma: + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "mad"); + break; + + case GLSLstd450InterpolateAtCentroid: + emit_unary_func_op(result_type, id, args[0], "EvaluateAttributeAtCentroid"); + break; + case GLSLstd450InterpolateAtSample: + emit_binary_func_op(result_type, id, args[0], args[1], "EvaluateAttributeAtSample"); + break; + case GLSLstd450InterpolateAtOffset: + emit_binary_func_op(result_type, id, args[0], args[1], "EvaluateAttributeSnapped"); + break; + + case GLSLstd450PackHalf2x16: + if (!requires_fp16_packing) + { + requires_fp16_packing = true; + force_recompile(); + } + emit_unary_func_op(result_type, id, args[0], "spvPackHalf2x16"); + break; + + case GLSLstd450UnpackHalf2x16: + if (!requires_fp16_packing) + { + requires_fp16_packing = true; + force_recompile(); + } + emit_unary_func_op(result_type, id, args[0], "spvUnpackHalf2x16"); + break; + + case GLSLstd450PackSnorm4x8: + if (!requires_snorm8_packing) + { + requires_snorm8_packing = true; + force_recompile(); + } + emit_unary_func_op(result_type, id, args[0], "spvPackSnorm4x8"); + break; + + case GLSLstd450UnpackSnorm4x8: + if (!requires_snorm8_packing) + { + requires_snorm8_packing = true; + force_recompile(); + } + emit_unary_func_op(result_type, id, args[0], "spvUnpackSnorm4x8"); + break; + + case GLSLstd450PackUnorm4x8: + if (!requires_unorm8_packing) + { + requires_unorm8_packing = true; + force_recompile(); + } + emit_unary_func_op(result_type, id, args[0], "spvPackUnorm4x8"); + break; + + case GLSLstd450UnpackUnorm4x8: + if (!requires_unorm8_packing) + { + requires_unorm8_packing = true; + force_recompile(); + } + emit_unary_func_op(result_type, id, args[0], "spvUnpackUnorm4x8"); + break; + + case GLSLstd450PackSnorm2x16: + if (!requires_snorm16_packing) + { + requires_snorm16_packing = true; + force_recompile(); + } + emit_unary_func_op(result_type, id, args[0], "spvPackSnorm2x16"); + break; + + case GLSLstd450UnpackSnorm2x16: + if (!requires_snorm16_packing) + { + requires_snorm16_packing = true; + force_recompile(); + } + emit_unary_func_op(result_type, id, args[0], "spvUnpackSnorm2x16"); + break; + + case GLSLstd450PackUnorm2x16: + if (!requires_unorm16_packing) + { + requires_unorm16_packing = true; + force_recompile(); + } + emit_unary_func_op(result_type, id, args[0], "spvPackUnorm2x16"); + break; + + case GLSLstd450UnpackUnorm2x16: + if (!requires_unorm16_packing) + { + requires_unorm16_packing = true; + force_recompile(); + } + emit_unary_func_op(result_type, id, args[0], "spvUnpackUnorm2x16"); + break; + + case GLSLstd450PackDouble2x32: + case GLSLstd450UnpackDouble2x32: + SPIRV_CROSS_THROW("packDouble2x32/unpackDouble2x32 not supported in HLSL."); + + case GLSLstd450FindILsb: + { + auto basetype = expression_type(args[0]).basetype; + emit_unary_func_op_cast(result_type, id, args[0], "firstbitlow", basetype, basetype); + break; + } + + case GLSLstd450FindSMsb: + emit_unary_func_op_cast(result_type, id, args[0], "firstbithigh", int_type, int_type); + break; + + case GLSLstd450FindUMsb: + emit_unary_func_op_cast(result_type, id, args[0], "firstbithigh", uint_type, uint_type); + break; + + case GLSLstd450MatrixInverse: + { + auto &type = get(result_type); + if (type.vecsize == 2 && type.columns == 2) + { + if (!requires_inverse_2x2) + { + requires_inverse_2x2 = true; + force_recompile(); + } + } + else if (type.vecsize == 3 && type.columns == 3) + { + if (!requires_inverse_3x3) + { + requires_inverse_3x3 = true; + force_recompile(); + } + } + else if (type.vecsize == 4 && type.columns == 4) + { + if (!requires_inverse_4x4) + { + requires_inverse_4x4 = true; + force_recompile(); + } + } + emit_unary_func_op(result_type, id, args[0], "spvInverse"); + break; + } + + case GLSLstd450Normalize: + // HLSL does not support scalar versions here. + if (expression_type(args[0]).vecsize == 1) + { + // Returns -1 or 1 for valid input, sign() does the job. + emit_unary_func_op(result_type, id, args[0], "sign"); + } + else + CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); + break; + + case GLSLstd450Reflect: + if (get(result_type).vecsize == 1) + { + if (!requires_scalar_reflect) + { + requires_scalar_reflect = true; + force_recompile(); + } + emit_binary_func_op(result_type, id, args[0], args[1], "spvReflect"); + } + else + CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); + break; + + case GLSLstd450Refract: + if (get(result_type).vecsize == 1) + { + if (!requires_scalar_refract) + { + requires_scalar_refract = true; + force_recompile(); + } + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "spvRefract"); + } + else + CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); + break; + + case GLSLstd450FaceForward: + if (get(result_type).vecsize == 1) + { + if (!requires_scalar_faceforward) + { + requires_scalar_faceforward = true; + force_recompile(); + } + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "spvFaceForward"); + } + else + CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); + break; + + case GLSLstd450NMin: + CompilerGLSL::emit_glsl_op(result_type, id, GLSLstd450FMin, args, count); + break; + + case GLSLstd450NMax: + CompilerGLSL::emit_glsl_op(result_type, id, GLSLstd450FMax, args, count); + break; + + case GLSLstd450NClamp: + CompilerGLSL::emit_glsl_op(result_type, id, GLSLstd450FClamp, args, count); + break; + + default: + CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); + break; + } +} + +void CompilerHLSL::read_access_chain_array(const string &lhs, const SPIRAccessChain &chain) +{ + auto &type = get(chain.basetype); + + // Need to use a reserved identifier here since it might shadow an identifier in the access chain input or other loops. + auto ident = get_unique_identifier(); + + statement("[unroll]"); + statement("for (int ", ident, " = 0; ", ident, " < ", to_array_size(type, uint32_t(type.array.size() - 1)), "; ", + ident, "++)"); + begin_scope(); + auto subchain = chain; + subchain.dynamic_index = join(ident, " * ", chain.array_stride, " + ", chain.dynamic_index); + subchain.basetype = type.parent_type; + if (!get(subchain.basetype).array.empty()) + subchain.array_stride = get_decoration(subchain.basetype, DecorationArrayStride); + read_access_chain(nullptr, join(lhs, "[", ident, "]"), subchain); + end_scope(); +} + +void CompilerHLSL::read_access_chain_struct(const string &lhs, const SPIRAccessChain &chain) +{ + auto &type = get(chain.basetype); + auto subchain = chain; + uint32_t member_count = uint32_t(type.member_types.size()); + + for (uint32_t i = 0; i < member_count; i++) + { + uint32_t offset = type_struct_member_offset(type, i); + subchain.static_index = chain.static_index + offset; + subchain.basetype = type.member_types[i]; + + subchain.matrix_stride = 0; + subchain.array_stride = 0; + subchain.row_major_matrix = false; + + auto &member_type = get(subchain.basetype); + if (member_type.columns > 1) + { + subchain.matrix_stride = type_struct_member_matrix_stride(type, i); + subchain.row_major_matrix = has_member_decoration(type.self, i, DecorationRowMajor); + } + + if (!member_type.array.empty()) + subchain.array_stride = type_struct_member_array_stride(type, i); + + read_access_chain(nullptr, join(lhs, ".", to_member_name(type, i)), subchain); + } +} + +void CompilerHLSL::read_access_chain(string *expr, const string &lhs, const SPIRAccessChain &chain) +{ + auto &type = get(chain.basetype); + + SPIRType target_type { is_scalar(type) ? OpTypeInt : type.op }; + target_type.basetype = SPIRType::UInt; + target_type.vecsize = type.vecsize; + target_type.columns = type.columns; + + if (!type.array.empty()) + { + read_access_chain_array(lhs, chain); + return; + } + else if (type.basetype == SPIRType::Struct) + { + read_access_chain_struct(lhs, chain); + return; + } + else if (type.width != 32 && !hlsl_options.enable_16bit_types) + SPIRV_CROSS_THROW("Reading types other than 32-bit from ByteAddressBuffer not yet supported, unless SM 6.2 and " + "native 16-bit types are enabled."); + + string base = chain.base; + if (has_decoration(chain.self, DecorationNonUniform)) + convert_non_uniform_expression(base, chain.self); + + bool templated_load = hlsl_options.shader_model >= 62; + string load_expr; + + string template_expr; + if (templated_load) + template_expr = join("<", type_to_glsl(type), ">"); + + // Load a vector or scalar. + if (type.columns == 1 && !chain.row_major_matrix) + { + const char *load_op = nullptr; + switch (type.vecsize) + { + case 1: + load_op = "Load"; + break; + case 2: + load_op = "Load2"; + break; + case 3: + load_op = "Load3"; + break; + case 4: + load_op = "Load4"; + break; + default: + SPIRV_CROSS_THROW("Unknown vector size."); + } + + if (templated_load) + load_op = "Load"; + + load_expr = join(base, ".", load_op, template_expr, "(", chain.dynamic_index, chain.static_index, ")"); + } + else if (type.columns == 1) + { + // Strided load since we are loading a column from a row-major matrix. + if (templated_load) + { + auto scalar_type = type; + scalar_type.vecsize = 1; + scalar_type.columns = 1; + template_expr = join("<", type_to_glsl(scalar_type), ">"); + if (type.vecsize > 1) + load_expr += type_to_glsl(type) + "("; + } + else if (type.vecsize > 1) + { + load_expr = type_to_glsl(target_type); + load_expr += "("; + } + + for (uint32_t r = 0; r < type.vecsize; r++) + { + load_expr += join(base, ".Load", template_expr, "(", chain.dynamic_index, + chain.static_index + r * chain.matrix_stride, ")"); + if (r + 1 < type.vecsize) + load_expr += ", "; + } + + if (type.vecsize > 1) + load_expr += ")"; + } + else if (!chain.row_major_matrix) + { + // Load a matrix, column-major, the easy case. + const char *load_op = nullptr; + switch (type.vecsize) + { + case 1: + load_op = "Load"; + break; + case 2: + load_op = "Load2"; + break; + case 3: + load_op = "Load3"; + break; + case 4: + load_op = "Load4"; + break; + default: + SPIRV_CROSS_THROW("Unknown vector size."); + } + + if (templated_load) + { + auto vector_type = type; + vector_type.columns = 1; + template_expr = join("<", type_to_glsl(vector_type), ">"); + load_expr = type_to_glsl(type); + load_op = "Load"; + } + else + { + // Note, this loading style in HLSL is *actually* row-major, but we always treat matrices as transposed in this backend, + // so row-major is technically column-major ... + load_expr = type_to_glsl(target_type); + } + load_expr += "("; + + for (uint32_t c = 0; c < type.columns; c++) + { + load_expr += join(base, ".", load_op, template_expr, "(", chain.dynamic_index, + chain.static_index + c * chain.matrix_stride, ")"); + if (c + 1 < type.columns) + load_expr += ", "; + } + load_expr += ")"; + } + else + { + // Pick out elements one by one ... Hopefully compilers are smart enough to recognize this pattern + // considering HLSL is "row-major decl", but "column-major" memory layout (basically implicit transpose model, ugh) ... + + if (templated_load) + { + load_expr = type_to_glsl(type); + auto scalar_type = type; + scalar_type.vecsize = 1; + scalar_type.columns = 1; + template_expr = join("<", type_to_glsl(scalar_type), ">"); + } + else + load_expr = type_to_glsl(target_type); + + load_expr += "("; + + for (uint32_t c = 0; c < type.columns; c++) + { + for (uint32_t r = 0; r < type.vecsize; r++) + { + load_expr += join(base, ".Load", template_expr, "(", chain.dynamic_index, + chain.static_index + c * (type.width / 8) + r * chain.matrix_stride, ")"); + + if ((r + 1 < type.vecsize) || (c + 1 < type.columns)) + load_expr += ", "; + } + } + load_expr += ")"; + } + + if (!templated_load) + { + auto bitcast_op = bitcast_glsl_op(type, target_type); + if (!bitcast_op.empty()) + load_expr = join(bitcast_op, "(", load_expr, ")"); + } + + if (lhs.empty()) + { + assert(expr); + *expr = std::move(load_expr); + } + else + statement(lhs, " = ", load_expr, ";"); +} + +void CompilerHLSL::emit_load(const Instruction &instruction) +{ + auto ops = stream(instruction); + + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t ptr = ops[2]; + + auto *chain = maybe_get(ptr); + if (chain) + { + auto &type = get(result_type); + bool composite_load = !type.array.empty() || type.basetype == SPIRType::Struct; + + if (composite_load) + { + // We cannot make this work in one single expression as we might have nested structures and arrays, + // so unroll the load to an uninitialized temporary. + emit_uninitialized_temporary_expression(result_type, id); + read_access_chain(nullptr, to_expression(id), *chain); + track_expression_read(chain->self); + } + else + { + string load_expr; + read_access_chain(&load_expr, "", *chain); + + bool forward = should_forward(ptr) && forced_temporaries.find(id) == end(forced_temporaries); + + // If we are forwarding this load, + // don't register the read to access chain here, defer that to when we actually use the expression, + // using the add_implied_read_expression mechanism. + if (!forward) + track_expression_read(chain->self); + + // Do not forward complex load sequences like matrices, structs and arrays. + if (type.columns > 1) + forward = false; + + auto &e = emit_op(result_type, id, load_expr, forward, true); + e.need_transpose = false; + register_read(id, ptr, forward); + inherit_expression_dependencies(id, ptr); + if (forward) + add_implied_read_expression(e, chain->self); + } + } + else + { + // Very special case where we cannot rely on IO lowering. + // Mesh shader clip/cull arrays ... Cursed. + auto &res_type = get(result_type); + if (get_execution_model() == ExecutionModelMeshEXT && + has_decoration(ptr, DecorationBuiltIn) && + (get_decoration(ptr, DecorationBuiltIn) == BuiltInClipDistance || + get_decoration(ptr, DecorationBuiltIn) == BuiltInCullDistance) && + is_array(res_type) && !is_array(get(res_type.parent_type)) && + to_array_size_literal(res_type) > 1) + { + track_expression_read(ptr); + string load_expr = "{ "; + uint32_t num_elements = to_array_size_literal(res_type); + for (uint32_t i = 0; i < num_elements; i++) + { + load_expr += join(to_expression(ptr), ".", index_to_swizzle(i)); + if (i + 1 < num_elements) + load_expr += ", "; + } + load_expr += " }"; + emit_op(result_type, id, load_expr, false); + register_read(id, ptr, false); + inherit_expression_dependencies(id, ptr); + } + else + { + CompilerGLSL::emit_instruction(instruction); + } + } +} + +void CompilerHLSL::write_access_chain_array(const SPIRAccessChain &chain, uint32_t value, + const SmallVector &composite_chain) +{ + auto *ptype = &get(chain.basetype); + while (ptype->pointer) + { + ptype = &get(ptype->basetype); + } + auto &type = *ptype; + + // Need to use a reserved identifier here since it might shadow an identifier in the access chain input or other loops. + auto ident = get_unique_identifier(); + + uint32_t id = ir.increase_bound_by(2); + uint32_t int_type_id = id + 1; + SPIRType int_type { OpTypeInt }; + int_type.basetype = SPIRType::Int; + int_type.width = 32; + set(int_type_id, int_type); + set(id, ident, int_type_id, true); + set_name(id, ident); + suppressed_usage_tracking.insert(id); + + statement("[unroll]"); + statement("for (int ", ident, " = 0; ", ident, " < ", to_array_size(type, uint32_t(type.array.size() - 1)), "; ", + ident, "++)"); + begin_scope(); + auto subchain = chain; + subchain.dynamic_index = join(ident, " * ", chain.array_stride, " + ", chain.dynamic_index); + subchain.basetype = type.parent_type; + + // Forcefully allow us to use an ID here by setting MSB. + auto subcomposite_chain = composite_chain; + subcomposite_chain.push_back(0x80000000u | id); + + if (!get(subchain.basetype).array.empty()) + subchain.array_stride = get_decoration(subchain.basetype, DecorationArrayStride); + + write_access_chain(subchain, value, subcomposite_chain); + end_scope(); +} + +void CompilerHLSL::write_access_chain_struct(const SPIRAccessChain &chain, uint32_t value, + const SmallVector &composite_chain) +{ + auto &type = get(chain.basetype); + uint32_t member_count = uint32_t(type.member_types.size()); + auto subchain = chain; + + auto subcomposite_chain = composite_chain; + subcomposite_chain.push_back(0); + + for (uint32_t i = 0; i < member_count; i++) + { + uint32_t offset = type_struct_member_offset(type, i); + subchain.static_index = chain.static_index + offset; + subchain.basetype = type.member_types[i]; + + subchain.matrix_stride = 0; + subchain.array_stride = 0; + subchain.row_major_matrix = false; + + auto &member_type = get(subchain.basetype); + if (member_type.columns > 1) + { + subchain.matrix_stride = type_struct_member_matrix_stride(type, i); + subchain.row_major_matrix = has_member_decoration(type.self, i, DecorationRowMajor); + } + + if (!member_type.array.empty()) + subchain.array_stride = type_struct_member_array_stride(type, i); + + subcomposite_chain.back() = i; + write_access_chain(subchain, value, subcomposite_chain); + } +} + +string CompilerHLSL::write_access_chain_value(uint32_t value, const SmallVector &composite_chain, + bool enclose) +{ + string ret; + if (composite_chain.empty()) + ret = to_expression(value); + else + { + AccessChainMeta meta; + ret = access_chain_internal(value, composite_chain.data(), uint32_t(composite_chain.size()), + ACCESS_CHAIN_INDEX_IS_LITERAL_BIT | ACCESS_CHAIN_LITERAL_MSB_FORCE_ID, &meta); + } + + if (enclose) + ret = enclose_expression(ret); + return ret; +} + +void CompilerHLSL::write_access_chain(const SPIRAccessChain &chain, uint32_t value, + const SmallVector &composite_chain) +{ + auto &type = get(chain.basetype); + + // Make sure we trigger a read of the constituents in the access chain. + track_expression_read(chain.self); + + SPIRType target_type { is_scalar(type) ? OpTypeInt : type.op }; + target_type.basetype = SPIRType::UInt; + target_type.vecsize = type.vecsize; + target_type.columns = type.columns; + + if (!type.array.empty()) + { + write_access_chain_array(chain, value, composite_chain); + register_write(chain.self); + return; + } + else if (type.basetype == SPIRType::Struct) + { + write_access_chain_struct(chain, value, composite_chain); + register_write(chain.self); + return; + } + else if (type.width != 32 && !hlsl_options.enable_16bit_types) + SPIRV_CROSS_THROW("Writing types other than 32-bit to RWByteAddressBuffer not yet supported, unless SM 6.2 and " + "native 16-bit types are enabled."); + + bool templated_store = hlsl_options.shader_model >= 62; + + auto base = chain.base; + if (has_decoration(chain.self, DecorationNonUniform)) + convert_non_uniform_expression(base, chain.self); + + string template_expr; + if (templated_store) + template_expr = join("<", type_to_glsl(type), ">"); + + if (type.columns == 1 && !chain.row_major_matrix) + { + const char *store_op = nullptr; + switch (type.vecsize) + { + case 1: + store_op = "Store"; + break; + case 2: + store_op = "Store2"; + break; + case 3: + store_op = "Store3"; + break; + case 4: + store_op = "Store4"; + break; + default: + SPIRV_CROSS_THROW("Unknown vector size."); + } + + auto store_expr = write_access_chain_value(value, composite_chain, false); + + if (!templated_store) + { + auto bitcast_op = bitcast_glsl_op(target_type, type); + if (!bitcast_op.empty()) + store_expr = join(bitcast_op, "(", store_expr, ")"); + } + else + store_op = "Store"; + statement(base, ".", store_op, template_expr, "(", chain.dynamic_index, chain.static_index, ", ", + store_expr, ");"); + } + else if (type.columns == 1) + { + if (templated_store) + { + auto scalar_type = type; + scalar_type.vecsize = 1; + scalar_type.columns = 1; + template_expr = join("<", type_to_glsl(scalar_type), ">"); + } + + // Strided store. + for (uint32_t r = 0; r < type.vecsize; r++) + { + auto store_expr = write_access_chain_value(value, composite_chain, true); + if (type.vecsize > 1) + { + store_expr += "."; + store_expr += index_to_swizzle(r); + } + remove_duplicate_swizzle(store_expr); + + if (!templated_store) + { + auto bitcast_op = bitcast_glsl_op(target_type, type); + if (!bitcast_op.empty()) + store_expr = join(bitcast_op, "(", store_expr, ")"); + } + + statement(base, ".Store", template_expr, "(", chain.dynamic_index, + chain.static_index + chain.matrix_stride * r, ", ", store_expr, ");"); + } + } + else if (!chain.row_major_matrix) + { + const char *store_op = nullptr; + switch (type.vecsize) + { + case 1: + store_op = "Store"; + break; + case 2: + store_op = "Store2"; + break; + case 3: + store_op = "Store3"; + break; + case 4: + store_op = "Store4"; + break; + default: + SPIRV_CROSS_THROW("Unknown vector size."); + } + + if (templated_store) + { + store_op = "Store"; + auto vector_type = type; + vector_type.columns = 1; + template_expr = join("<", type_to_glsl(vector_type), ">"); + } + + for (uint32_t c = 0; c < type.columns; c++) + { + auto store_expr = join(write_access_chain_value(value, composite_chain, true), "[", c, "]"); + + if (!templated_store) + { + auto bitcast_op = bitcast_glsl_op(target_type, type); + if (!bitcast_op.empty()) + store_expr = join(bitcast_op, "(", store_expr, ")"); + } + + statement(base, ".", store_op, template_expr, "(", chain.dynamic_index, + chain.static_index + c * chain.matrix_stride, ", ", store_expr, ");"); + } + } + else + { + if (templated_store) + { + auto scalar_type = type; + scalar_type.vecsize = 1; + scalar_type.columns = 1; + template_expr = join("<", type_to_glsl(scalar_type), ">"); + } + + for (uint32_t r = 0; r < type.vecsize; r++) + { + for (uint32_t c = 0; c < type.columns; c++) + { + auto store_expr = + join(write_access_chain_value(value, composite_chain, true), "[", c, "].", index_to_swizzle(r)); + remove_duplicate_swizzle(store_expr); + auto bitcast_op = bitcast_glsl_op(target_type, type); + if (!bitcast_op.empty()) + store_expr = join(bitcast_op, "(", store_expr, ")"); + statement(base, ".Store", template_expr, "(", chain.dynamic_index, + chain.static_index + c * (type.width / 8) + r * chain.matrix_stride, ", ", store_expr, ");"); + } + } + } + + register_write(chain.self); +} + +void CompilerHLSL::emit_store(const Instruction &instruction) +{ + auto ops = stream(instruction); + if (options.vertex.flip_vert_y) + { + auto *expr = maybe_get(ops[0]); + if (expr != nullptr && expr->access_meshlet_position_y) + { + auto lhs = to_dereferenced_expression(ops[0]); + auto rhs = to_unpacked_expression(ops[1]); + statement(lhs, " = spvFlipVertY(", rhs, ");"); + register_write(ops[0]); + return; + } + } + + auto *chain = maybe_get(ops[0]); + if (chain) + write_access_chain(*chain, ops[1], {}); + else + CompilerGLSL::emit_instruction(instruction); +} + +void CompilerHLSL::emit_access_chain(const Instruction &instruction) +{ + auto ops = stream(instruction); + uint32_t length = instruction.length; + + bool need_byte_access_chain = false; + auto &type = expression_type(ops[2]); + const auto *chain = maybe_get(ops[2]); + + if (chain) + { + // Keep tacking on an existing access chain. + need_byte_access_chain = true; + } + else if (type.storage == StorageClassStorageBuffer || has_decoration(type.self, DecorationBufferBlock)) + { + // If we are starting to poke into an SSBO, we are dealing with ByteAddressBuffers, and we need + // to emit SPIRAccessChain rather than a plain SPIRExpression. + uint32_t chain_arguments = length - 3; + if (chain_arguments > type.array.size()) + need_byte_access_chain = true; + } + + if (need_byte_access_chain) + { + // If we have a chain variable, we are already inside the SSBO, and any array type will refer to arrays within a block, + // and not array of SSBO. + uint32_t to_plain_buffer_length = chain ? 0u : static_cast(type.array.size()); + + auto *backing_variable = maybe_get_backing_variable(ops[2]); + + if (backing_variable != nullptr && is_user_type_structured(backing_variable->self)) + { + CompilerGLSL::emit_instruction(instruction); + return; + } + + string base; + if (to_plain_buffer_length != 0) + base = access_chain(ops[2], &ops[3], to_plain_buffer_length, get(ops[0])); + else if (chain) + base = chain->base; + else + base = to_expression(ops[2]); + + // Start traversing type hierarchy at the proper non-pointer types. + auto *basetype = &get_pointee_type(type); + + // Traverse the type hierarchy down to the actual buffer types. + for (uint32_t i = 0; i < to_plain_buffer_length; i++) + { + assert(basetype->parent_type); + basetype = &get(basetype->parent_type); + } + + uint32_t matrix_stride = 0; + uint32_t array_stride = 0; + bool row_major_matrix = false; + + // Inherit matrix information. + if (chain) + { + matrix_stride = chain->matrix_stride; + row_major_matrix = chain->row_major_matrix; + array_stride = chain->array_stride; + } + + auto offsets = flattened_access_chain_offset(*basetype, &ops[3 + to_plain_buffer_length], + length - 3 - to_plain_buffer_length, 0, 1, &row_major_matrix, + &matrix_stride, &array_stride); + + auto &e = set(ops[1], ops[0], type.storage, base, offsets.first, offsets.second); + e.row_major_matrix = row_major_matrix; + e.matrix_stride = matrix_stride; + e.array_stride = array_stride; + e.immutable = should_forward(ops[2]); + e.loaded_from = backing_variable ? backing_variable->self : ID(0); + + if (chain) + { + e.dynamic_index += chain->dynamic_index; + e.static_index += chain->static_index; + } + + for (uint32_t i = 2; i < length; i++) + { + inherit_expression_dependencies(ops[1], ops[i]); + add_implied_read_expression(e, ops[i]); + } + } + else + { + CompilerGLSL::emit_instruction(instruction); + } +} + +void CompilerHLSL::emit_atomic(const uint32_t *ops, uint32_t length, Op op) +{ + const char *atomic_op = nullptr; + + string value_expr; + if (op != OpAtomicIDecrement && op != OpAtomicIIncrement && op != OpAtomicLoad && op != OpAtomicStore) + value_expr = to_expression(ops[op == OpAtomicCompareExchange ? 6 : 5]); + + bool is_atomic_store = false; + + switch (op) + { + case OpAtomicIIncrement: + atomic_op = "InterlockedAdd"; + value_expr = "1"; + break; + + case OpAtomicIDecrement: + atomic_op = "InterlockedAdd"; + value_expr = "-1"; + break; + + case OpAtomicLoad: + atomic_op = "InterlockedAdd"; + value_expr = "0"; + break; + + case OpAtomicISub: + atomic_op = "InterlockedAdd"; + value_expr = join("-", enclose_expression(value_expr)); + break; + + case OpAtomicSMin: + case OpAtomicUMin: + atomic_op = "InterlockedMin"; + break; + + case OpAtomicSMax: + case OpAtomicUMax: + atomic_op = "InterlockedMax"; + break; + + case OpAtomicAnd: + atomic_op = "InterlockedAnd"; + break; + + case OpAtomicOr: + atomic_op = "InterlockedOr"; + break; + + case OpAtomicXor: + atomic_op = "InterlockedXor"; + break; + + case OpAtomicIAdd: + atomic_op = "InterlockedAdd"; + break; + + case OpAtomicExchange: + atomic_op = "InterlockedExchange"; + break; + + case OpAtomicStore: + atomic_op = "InterlockedExchange"; + is_atomic_store = true; + break; + + case OpAtomicCompareExchange: + if (length < 8) + SPIRV_CROSS_THROW("Not enough data for opcode."); + atomic_op = "InterlockedCompareExchange"; + value_expr = join(to_expression(ops[7]), ", ", value_expr); + break; + + default: + SPIRV_CROSS_THROW("Unknown atomic opcode."); + } + + if (is_atomic_store) + { + auto &data_type = expression_type(ops[0]); + auto *chain = maybe_get(ops[0]); + + auto &tmp_id = extra_sub_expressions[ops[0]]; + if (!tmp_id) + { + tmp_id = ir.increase_bound_by(1); + emit_uninitialized_temporary_expression(get_pointee_type(data_type).self, tmp_id); + } + + if (data_type.storage == StorageClassImage || !chain) + { + statement(atomic_op, "(", to_non_uniform_aware_expression(ops[0]), ", ", + to_expression(ops[3]), ", ", to_expression(tmp_id), ");"); + } + else + { + string base = chain->base; + if (has_decoration(chain->self, DecorationNonUniform)) + convert_non_uniform_expression(base, chain->self); + // RWByteAddress buffer is always uint in its underlying type. + statement(base, ".", atomic_op, "(", chain->dynamic_index, chain->static_index, ", ", + to_expression(ops[3]), ", ", to_expression(tmp_id), ");"); + } + } + else + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + forced_temporaries.insert(ops[1]); + + auto &type = get(result_type); + statement(variable_decl(type, to_name(id)), ";"); + + auto &data_type = expression_type(ops[2]); + auto *chain = maybe_get(ops[2]); + SPIRType::BaseType expr_type; + if (data_type.storage == StorageClassImage || !chain) + { + statement(atomic_op, "(", to_non_uniform_aware_expression(ops[2]), ", ", value_expr, ", ", to_name(id), ");"); + expr_type = data_type.basetype; + } + else + { + // RWByteAddress buffer is always uint in its underlying type. + string base = chain->base; + if (has_decoration(chain->self, DecorationNonUniform)) + convert_non_uniform_expression(base, chain->self); + expr_type = SPIRType::UInt; + statement(base, ".", atomic_op, "(", chain->dynamic_index, chain->static_index, ", ", value_expr, + ", ", to_name(id), ");"); + } + + auto expr = bitcast_expression(type, expr_type, to_name(id)); + set(id, expr, result_type, true); + } + flush_all_atomic_capable_variables(); +} + +void CompilerHLSL::emit_subgroup_op(const Instruction &i) +{ + if (hlsl_options.shader_model < 60) + SPIRV_CROSS_THROW("Wave ops requires SM 6.0 or higher."); + + const uint32_t *ops = stream(i); + auto op = static_cast(i.op); + + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + auto scope = static_cast(evaluate_constant_u32(ops[2])); + if (scope != ScopeSubgroup) + SPIRV_CROSS_THROW("Only subgroup scope is supported."); + + const auto make_inclusive_Sum = [&](const string &expr) -> string { + return join(expr, " + ", to_expression(ops[4])); + }; + + const auto make_inclusive_Product = [&](const string &expr) -> string { + return join(expr, " * ", to_expression(ops[4])); + }; + + // If we need to do implicit bitcasts, make sure we do it with the correct type. + uint32_t integer_width = get_integer_width_for_instruction(i); + auto int_type = to_signed_basetype(integer_width); + auto uint_type = to_unsigned_basetype(integer_width); + +#define make_inclusive_BitAnd(expr) "" +#define make_inclusive_BitOr(expr) "" +#define make_inclusive_BitXor(expr) "" +#define make_inclusive_Min(expr) "" +#define make_inclusive_Max(expr) "" + + switch (op) + { + case OpGroupNonUniformElect: + emit_op(result_type, id, "WaveIsFirstLane()", true); + break; + + case OpGroupNonUniformBroadcast: + emit_binary_func_op(result_type, id, ops[3], ops[4], "WaveReadLaneAt"); + break; + + case OpGroupNonUniformBroadcastFirst: + emit_unary_func_op(result_type, id, ops[3], "WaveReadLaneFirst"); + break; + + case OpGroupNonUniformBallot: + emit_unary_func_op(result_type, id, ops[3], "WaveActiveBallot"); + break; + + case OpGroupNonUniformInverseBallot: + SPIRV_CROSS_THROW("Cannot trivially implement InverseBallot in HLSL."); + + case OpGroupNonUniformBallotBitExtract: + SPIRV_CROSS_THROW("Cannot trivially implement BallotBitExtract in HLSL."); + + case OpGroupNonUniformBallotFindLSB: + SPIRV_CROSS_THROW("Cannot trivially implement BallotFindLSB in HLSL."); + + case OpGroupNonUniformBallotFindMSB: + SPIRV_CROSS_THROW("Cannot trivially implement BallotFindMSB in HLSL."); + + case OpGroupNonUniformBallotBitCount: + { + auto operation = static_cast(ops[3]); + bool forward = should_forward(ops[4]); + if (operation == GroupOperationReduce) + { + auto left = join("countbits(", to_enclosed_expression(ops[4]), ".x) + countbits(", + to_enclosed_expression(ops[4]), ".y)"); + auto right = join("countbits(", to_enclosed_expression(ops[4]), ".z) + countbits(", + to_enclosed_expression(ops[4]), ".w)"); + emit_op(result_type, id, join(left, " + ", right), forward); + inherit_expression_dependencies(id, ops[4]); + } + else if (operation == GroupOperationInclusiveScan) + { + auto left = join("countbits(", to_enclosed_expression(ops[4]), ".x & gl_SubgroupLeMask.x) + countbits(", + to_enclosed_expression(ops[4]), ".y & gl_SubgroupLeMask.y)"); + auto right = join("countbits(", to_enclosed_expression(ops[4]), ".z & gl_SubgroupLeMask.z) + countbits(", + to_enclosed_expression(ops[4]), ".w & gl_SubgroupLeMask.w)"); + emit_op(result_type, id, join(left, " + ", right), forward); + if (!active_input_builtins.get(BuiltInSubgroupLeMask)) + { + active_input_builtins.set(BuiltInSubgroupLeMask); + force_recompile_guarantee_forward_progress(); + } + } + else if (operation == GroupOperationExclusiveScan) + { + auto left = join("countbits(", to_enclosed_expression(ops[4]), ".x & gl_SubgroupLtMask.x) + countbits(", + to_enclosed_expression(ops[4]), ".y & gl_SubgroupLtMask.y)"); + auto right = join("countbits(", to_enclosed_expression(ops[4]), ".z & gl_SubgroupLtMask.z) + countbits(", + to_enclosed_expression(ops[4]), ".w & gl_SubgroupLtMask.w)"); + emit_op(result_type, id, join(left, " + ", right), forward); + if (!active_input_builtins.get(BuiltInSubgroupLtMask)) + { + active_input_builtins.set(BuiltInSubgroupLtMask); + force_recompile_guarantee_forward_progress(); + } + } + else + SPIRV_CROSS_THROW("Invalid BitCount operation."); + break; + } + + case OpGroupNonUniformShuffle: + emit_binary_func_op(result_type, id, ops[3], ops[4], "WaveReadLaneAt"); + break; + case OpGroupNonUniformShuffleXor: + { + bool forward = should_forward(ops[3]); + emit_op(ops[0], ops[1], + join("WaveReadLaneAt(", to_unpacked_expression(ops[3]), ", ", + "WaveGetLaneIndex() ^ ", to_enclosed_expression(ops[4]), ")"), forward); + inherit_expression_dependencies(ops[1], ops[3]); + break; + } + case OpGroupNonUniformShuffleUp: + { + bool forward = should_forward(ops[3]); + emit_op(ops[0], ops[1], + join("WaveReadLaneAt(", to_unpacked_expression(ops[3]), ", ", + "WaveGetLaneIndex() - ", to_enclosed_expression(ops[4]), ")"), forward); + inherit_expression_dependencies(ops[1], ops[3]); + break; + } + case OpGroupNonUniformShuffleDown: + { + bool forward = should_forward(ops[3]); + emit_op(ops[0], ops[1], + join("WaveReadLaneAt(", to_unpacked_expression(ops[3]), ", ", + "WaveGetLaneIndex() + ", to_enclosed_expression(ops[4]), ")"), forward); + inherit_expression_dependencies(ops[1], ops[3]); + break; + } + + case OpGroupNonUniformAll: + emit_unary_func_op(result_type, id, ops[3], "WaveActiveAllTrue"); + break; + + case OpGroupNonUniformAny: + emit_unary_func_op(result_type, id, ops[3], "WaveActiveAnyTrue"); + break; + + case OpGroupNonUniformAllEqual: + emit_unary_func_op(result_type, id, ops[3], "WaveActiveAllEqual"); + break; + + // clang-format off +#define HLSL_GROUP_OP(op, hlsl_op, supports_scan) \ +case OpGroupNonUniform##op: \ + { \ + auto operation = static_cast(ops[3]); \ + if (operation == GroupOperationReduce) \ + emit_unary_func_op(result_type, id, ops[4], "WaveActive" #hlsl_op); \ + else if (operation == GroupOperationInclusiveScan && supports_scan) \ + { \ + bool forward = should_forward(ops[4]); \ + emit_op(result_type, id, make_inclusive_##hlsl_op (join("WavePrefix" #hlsl_op, "(", to_expression(ops[4]), ")")), forward); \ + inherit_expression_dependencies(id, ops[4]); \ + } \ + else if (operation == GroupOperationExclusiveScan && supports_scan) \ + emit_unary_func_op(result_type, id, ops[4], "WavePrefix" #hlsl_op); \ + else if (operation == GroupOperationClusteredReduce) \ + SPIRV_CROSS_THROW("Cannot trivially implement ClusteredReduce in HLSL."); \ + else \ + SPIRV_CROSS_THROW("Invalid group operation."); \ + break; \ + } + +#define HLSL_GROUP_OP_CAST(op, hlsl_op, type) \ +case OpGroupNonUniform##op: \ + { \ + auto operation = static_cast(ops[3]); \ + if (operation == GroupOperationReduce) \ + emit_unary_func_op_cast(result_type, id, ops[4], "WaveActive" #hlsl_op, type, type); \ + else \ + SPIRV_CROSS_THROW("Invalid group operation."); \ + break; \ + } + + HLSL_GROUP_OP(FAdd, Sum, true) + HLSL_GROUP_OP(FMul, Product, true) + HLSL_GROUP_OP(FMin, Min, false) + HLSL_GROUP_OP(FMax, Max, false) + HLSL_GROUP_OP(IAdd, Sum, true) + HLSL_GROUP_OP(IMul, Product, true) + HLSL_GROUP_OP_CAST(SMin, Min, int_type) + HLSL_GROUP_OP_CAST(SMax, Max, int_type) + HLSL_GROUP_OP_CAST(UMin, Min, uint_type) + HLSL_GROUP_OP_CAST(UMax, Max, uint_type) + HLSL_GROUP_OP(BitwiseAnd, BitAnd, false) + HLSL_GROUP_OP(BitwiseOr, BitOr, false) + HLSL_GROUP_OP(BitwiseXor, BitXor, false) + HLSL_GROUP_OP_CAST(LogicalAnd, BitAnd, uint_type) + HLSL_GROUP_OP_CAST(LogicalOr, BitOr, uint_type) + HLSL_GROUP_OP_CAST(LogicalXor, BitXor, uint_type) + +#undef HLSL_GROUP_OP +#undef HLSL_GROUP_OP_CAST + // clang-format on + + case OpGroupNonUniformQuadSwap: + { + uint32_t direction = evaluate_constant_u32(ops[4]); + if (direction == 0) + emit_unary_func_op(result_type, id, ops[3], "QuadReadAcrossX"); + else if (direction == 1) + emit_unary_func_op(result_type, id, ops[3], "QuadReadAcrossY"); + else if (direction == 2) + emit_unary_func_op(result_type, id, ops[3], "QuadReadAcrossDiagonal"); + else + SPIRV_CROSS_THROW("Invalid quad swap direction."); + break; + } + + case OpGroupNonUniformQuadBroadcast: + { + emit_binary_func_op(result_type, id, ops[3], ops[4], "QuadReadLaneAt"); + break; + } + + default: + SPIRV_CROSS_THROW("Invalid opcode for subgroup."); + } + + register_control_dependent_expression(id); +} + +void CompilerHLSL::emit_instruction(const Instruction &instruction) +{ + auto ops = stream(instruction); + auto opcode = static_cast(instruction.op); + +#define HLSL_BOP(op) emit_binary_op(ops[0], ops[1], ops[2], ops[3], #op) +#define HLSL_BOP_CAST(op, type) \ + emit_binary_op_cast(ops[0], ops[1], ops[2], ops[3], #op, type, opcode_is_sign_invariant(opcode), false) +#define HLSL_UOP(op) emit_unary_op(ops[0], ops[1], ops[2], #op) +#define HLSL_QFOP(op) emit_quaternary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], ops[5], #op) +#define HLSL_TFOP(op) emit_trinary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], #op) +#define HLSL_BFOP(op) emit_binary_func_op(ops[0], ops[1], ops[2], ops[3], #op) +#define HLSL_BFOP_CAST(op, type) \ + emit_binary_func_op_cast(ops[0], ops[1], ops[2], ops[3], #op, type, opcode_is_sign_invariant(opcode)) +#define HLSL_BFOP(op) emit_binary_func_op(ops[0], ops[1], ops[2], ops[3], #op) +#define HLSL_UFOP(op) emit_unary_func_op(ops[0], ops[1], ops[2], #op) + + // If we need to do implicit bitcasts, make sure we do it with the correct type. + uint32_t integer_width = get_integer_width_for_instruction(instruction); + auto int_type = to_signed_basetype(integer_width); + auto uint_type = to_unsigned_basetype(integer_width); + + opcode = get_remapped_spirv_op(opcode); + + switch (opcode) + { + case OpAccessChain: + case OpInBoundsAccessChain: + { + emit_access_chain(instruction); + break; + } + case OpBitcast: + { + auto bitcast_type = get_bitcast_type(ops[0], ops[2]); + if (bitcast_type == CompilerHLSL::TypeNormal) + CompilerGLSL::emit_instruction(instruction); + else + { + if (!requires_uint2_packing) + { + requires_uint2_packing = true; + force_recompile(); + } + + if (bitcast_type == CompilerHLSL::TypePackUint2x32) + emit_unary_func_op(ops[0], ops[1], ops[2], "spvPackUint2x32"); + else + emit_unary_func_op(ops[0], ops[1], ops[2], "spvUnpackUint2x32"); + } + + break; + } + + case OpSelect: + { + auto &value_type = expression_type(ops[3]); + if (value_type.basetype == SPIRType::Struct || is_array(value_type)) + { + // HLSL does not support ternary expressions on composites. + // Cannot use branches, since we might be in a continue block + // where explicit control flow is prohibited. + // Emit a helper function where we can use control flow. + TypeID value_type_id = expression_type_id(ops[3]); + auto itr = std::find(composite_selection_workaround_types.begin(), + composite_selection_workaround_types.end(), + value_type_id); + if (itr == composite_selection_workaround_types.end()) + { + composite_selection_workaround_types.push_back(value_type_id); + force_recompile(); + } + emit_uninitialized_temporary_expression(ops[0], ops[1]); + statement("spvSelectComposite(", + to_expression(ops[1]), ", ", to_expression(ops[2]), ", ", + to_expression(ops[3]), ", ", to_expression(ops[4]), ");"); + } + else + CompilerGLSL::emit_instruction(instruction); + break; + } + + case OpStore: + { + emit_store(instruction); + break; + } + + case OpLoad: + { + emit_load(instruction); + break; + } + + case OpMatrixTimesVector: + { + // Matrices are kept in a transposed state all the time, flip multiplication order always. + emit_binary_func_op(ops[0], ops[1], ops[3], ops[2], "mul"); + break; + } + + case OpVectorTimesMatrix: + { + // Matrices are kept in a transposed state all the time, flip multiplication order always. + emit_binary_func_op(ops[0], ops[1], ops[3], ops[2], "mul"); + break; + } + + case OpMatrixTimesMatrix: + { + // Matrices are kept in a transposed state all the time, flip multiplication order always. + emit_binary_func_op(ops[0], ops[1], ops[3], ops[2], "mul"); + break; + } + + case OpOuterProduct: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t a = ops[2]; + uint32_t b = ops[3]; + + auto &type = get(result_type); + string expr = type_to_glsl_constructor(type); + expr += "("; + for (uint32_t col = 0; col < type.columns; col++) + { + expr += to_enclosed_expression(a); + expr += " * "; + expr += to_extract_component_expression(b, col); + if (col + 1 < type.columns) + expr += ", "; + } + expr += ")"; + emit_op(result_type, id, expr, should_forward(a) && should_forward(b)); + inherit_expression_dependencies(id, a); + inherit_expression_dependencies(id, b); + break; + } + + case OpFMod: + { + if (!requires_op_fmod) + { + requires_op_fmod = true; + force_recompile(); + } + CompilerGLSL::emit_instruction(instruction); + break; + } + + case OpFRem: + emit_binary_func_op(ops[0], ops[1], ops[2], ops[3], "fmod"); + break; + + case OpImage: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + auto *combined = maybe_get(ops[2]); + + if (combined) + { + auto &e = emit_op(result_type, id, to_expression(combined->image), true, true); + auto *var = maybe_get_backing_variable(combined->image); + if (var) + e.loaded_from = var->self; + } + else + { + auto &e = emit_op(result_type, id, to_expression(ops[2]), true, true); + auto *var = maybe_get_backing_variable(ops[2]); + if (var) + e.loaded_from = var->self; + } + break; + } + + case OpDPdx: + HLSL_UFOP(ddx); + register_control_dependent_expression(ops[1]); + break; + + case OpDPdy: + HLSL_UFOP(ddy); + register_control_dependent_expression(ops[1]); + break; + + case OpDPdxFine: + HLSL_UFOP(ddx_fine); + register_control_dependent_expression(ops[1]); + break; + + case OpDPdyFine: + HLSL_UFOP(ddy_fine); + register_control_dependent_expression(ops[1]); + break; + + case OpDPdxCoarse: + HLSL_UFOP(ddx_coarse); + register_control_dependent_expression(ops[1]); + break; + + case OpDPdyCoarse: + HLSL_UFOP(ddy_coarse); + register_control_dependent_expression(ops[1]); + break; + + case OpFwidth: + case OpFwidthCoarse: + case OpFwidthFine: + HLSL_UFOP(fwidth); + register_control_dependent_expression(ops[1]); + break; + + case OpLogicalNot: + { + auto result_type = ops[0]; + auto id = ops[1]; + auto &type = get(result_type); + + if (type.vecsize > 1) + emit_unrolled_unary_op(result_type, id, ops[2], "!"); + else + HLSL_UOP(!); + break; + } + + case OpIEqual: + { + auto result_type = ops[0]; + auto id = ops[1]; + + if (expression_type(ops[2]).vecsize > 1) + emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "==", false, SPIRType::Unknown); + else + HLSL_BOP_CAST(==, int_type); + break; + } + + case OpLogicalEqual: + case OpFOrdEqual: + case OpFUnordEqual: + { + // HLSL != operator is unordered. + // https://docs.microsoft.com/en-us/windows/win32/direct3d10/d3d10-graphics-programming-guide-resources-float-rules. + // isnan() is apparently implemented as x != x as well. + // We cannot implement UnordEqual as !(OrdNotEqual), as HLSL cannot express OrdNotEqual. + // HACK: FUnordEqual will be implemented as FOrdEqual. + + auto result_type = ops[0]; + auto id = ops[1]; + + if (expression_type(ops[2]).vecsize > 1) + emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "==", false, SPIRType::Unknown); + else + HLSL_BOP(==); + break; + } + + case OpINotEqual: + { + auto result_type = ops[0]; + auto id = ops[1]; + + if (expression_type(ops[2]).vecsize > 1) + emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "!=", false, SPIRType::Unknown); + else + HLSL_BOP_CAST(!=, int_type); + break; + } + + case OpLogicalNotEqual: + case OpFOrdNotEqual: + case OpFUnordNotEqual: + { + // HLSL != operator is unordered. + // https://docs.microsoft.com/en-us/windows/win32/direct3d10/d3d10-graphics-programming-guide-resources-float-rules. + // isnan() is apparently implemented as x != x as well. + + // FIXME: FOrdNotEqual cannot be implemented in a crisp and simple way here. + // We would need to do something like not(UnordEqual), but that cannot be expressed either. + // Adding a lot of NaN checks would be a breaking change from perspective of performance. + // SPIR-V will generally use isnan() checks when this even matters. + // HACK: FOrdNotEqual will be implemented as FUnordEqual. + + auto result_type = ops[0]; + auto id = ops[1]; + + if (expression_type(ops[2]).vecsize > 1) + emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "!=", false, SPIRType::Unknown); + else + HLSL_BOP(!=); + break; + } + + case OpUGreaterThan: + case OpSGreaterThan: + { + auto result_type = ops[0]; + auto id = ops[1]; + auto type = opcode == OpUGreaterThan ? uint_type : int_type; + + if (expression_type(ops[2]).vecsize > 1) + emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">", false, type); + else + HLSL_BOP_CAST(>, type); + break; + } + + case OpFOrdGreaterThan: + { + auto result_type = ops[0]; + auto id = ops[1]; + + if (expression_type(ops[2]).vecsize > 1) + emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">", false, SPIRType::Unknown); + else + HLSL_BOP(>); + break; + } + + case OpFUnordGreaterThan: + { + auto result_type = ops[0]; + auto id = ops[1]; + + if (expression_type(ops[2]).vecsize > 1) + emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<=", true, SPIRType::Unknown); + else + CompilerGLSL::emit_instruction(instruction); + break; + } + + case OpUGreaterThanEqual: + case OpSGreaterThanEqual: + { + auto result_type = ops[0]; + auto id = ops[1]; + + auto type = opcode == OpUGreaterThanEqual ? uint_type : int_type; + if (expression_type(ops[2]).vecsize > 1) + emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">=", false, type); + else + HLSL_BOP_CAST(>=, type); + break; + } + + case OpFOrdGreaterThanEqual: + { + auto result_type = ops[0]; + auto id = ops[1]; + + if (expression_type(ops[2]).vecsize > 1) + emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">=", false, SPIRType::Unknown); + else + HLSL_BOP(>=); + break; + } + + case OpFUnordGreaterThanEqual: + { + auto result_type = ops[0]; + auto id = ops[1]; + + if (expression_type(ops[2]).vecsize > 1) + emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<", true, SPIRType::Unknown); + else + CompilerGLSL::emit_instruction(instruction); + break; + } + + case OpULessThan: + case OpSLessThan: + { + auto result_type = ops[0]; + auto id = ops[1]; + + auto type = opcode == OpULessThan ? uint_type : int_type; + if (expression_type(ops[2]).vecsize > 1) + emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<", false, type); + else + HLSL_BOP_CAST(<, type); + break; + } + + case OpFOrdLessThan: + { + auto result_type = ops[0]; + auto id = ops[1]; + + if (expression_type(ops[2]).vecsize > 1) + emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<", false, SPIRType::Unknown); + else + HLSL_BOP(<); + break; + } + + case OpFUnordLessThan: + { + auto result_type = ops[0]; + auto id = ops[1]; + + if (expression_type(ops[2]).vecsize > 1) + emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">=", true, SPIRType::Unknown); + else + CompilerGLSL::emit_instruction(instruction); + break; + } + + case OpULessThanEqual: + case OpSLessThanEqual: + { + auto result_type = ops[0]; + auto id = ops[1]; + + auto type = opcode == OpULessThanEqual ? uint_type : int_type; + if (expression_type(ops[2]).vecsize > 1) + emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<=", false, type); + else + HLSL_BOP_CAST(<=, type); + break; + } + + case OpFOrdLessThanEqual: + { + auto result_type = ops[0]; + auto id = ops[1]; + + if (expression_type(ops[2]).vecsize > 1) + emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<=", false, SPIRType::Unknown); + else + HLSL_BOP(<=); + break; + } + + case OpFUnordLessThanEqual: + { + auto result_type = ops[0]; + auto id = ops[1]; + + if (expression_type(ops[2]).vecsize > 1) + emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">", true, SPIRType::Unknown); + else + CompilerGLSL::emit_instruction(instruction); + break; + } + + case OpImageQueryLod: + emit_texture_op(instruction, false); + break; + + case OpImageQuerySizeLod: + { + auto result_type = ops[0]; + auto id = ops[1]; + + require_texture_query_variant(ops[2]); + auto dummy_samples_levels = join(get_fallback_name(id), "_dummy_parameter"); + statement("uint ", dummy_samples_levels, ";"); + + auto expr = join("spvTextureSize(", to_non_uniform_aware_expression(ops[2]), ", ", + bitcast_expression(SPIRType::UInt, ops[3]), ", ", dummy_samples_levels, ")"); + + auto &restype = get(ops[0]); + expr = bitcast_expression(restype, SPIRType::UInt, expr); + emit_op(result_type, id, expr, true); + break; + } + + case OpImageQuerySize: + { + auto result_type = ops[0]; + auto id = ops[1]; + + require_texture_query_variant(ops[2]); + bool uav = expression_type(ops[2]).image.sampled == 2; + + if (const auto *var = maybe_get_backing_variable(ops[2])) + if (hlsl_options.nonwritable_uav_texture_as_srv && has_decoration(var->self, DecorationNonWritable)) + uav = false; + + auto dummy_samples_levels = join(get_fallback_name(id), "_dummy_parameter"); + statement("uint ", dummy_samples_levels, ";"); + + string expr; + if (uav) + expr = join("spvImageSize(", to_non_uniform_aware_expression(ops[2]), ", ", dummy_samples_levels, ")"); + else + expr = join("spvTextureSize(", to_non_uniform_aware_expression(ops[2]), ", 0u, ", dummy_samples_levels, ")"); + + auto &restype = get(ops[0]); + expr = bitcast_expression(restype, SPIRType::UInt, expr); + emit_op(result_type, id, expr, true); + break; + } + + case OpImageQuerySamples: + case OpImageQueryLevels: + { + auto result_type = ops[0]; + auto id = ops[1]; + + require_texture_query_variant(ops[2]); + bool uav = expression_type(ops[2]).image.sampled == 2; + if (opcode == OpImageQueryLevels && uav) + SPIRV_CROSS_THROW("Cannot query levels for UAV images."); + + if (const auto *var = maybe_get_backing_variable(ops[2])) + if (hlsl_options.nonwritable_uav_texture_as_srv && has_decoration(var->self, DecorationNonWritable)) + uav = false; + + // Keep it simple and do not emit special variants to make this look nicer ... + // This stuff is barely, if ever, used. + forced_temporaries.insert(id); + auto &type = get(result_type); + statement(variable_decl(type, to_name(id)), ";"); + + if (uav) + statement("spvImageSize(", to_non_uniform_aware_expression(ops[2]), ", ", to_name(id), ");"); + else + statement("spvTextureSize(", to_non_uniform_aware_expression(ops[2]), ", 0u, ", to_name(id), ");"); + + auto &restype = get(ops[0]); + auto expr = bitcast_expression(restype, SPIRType::UInt, to_name(id)); + set(id, expr, result_type, true); + break; + } + + case OpImageRead: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + auto *var = maybe_get_backing_variable(ops[2]); + auto &type = expression_type(ops[2]); + bool subpass_data = type.image.dim == DimSubpassData; + bool pure = false; + + string imgexpr; + + if (subpass_data) + { + if (hlsl_options.shader_model < 40) + SPIRV_CROSS_THROW("Subpass loads are not supported in HLSL shader model 2/3."); + + // Similar to GLSL, implement subpass loads using texelFetch. + if (type.image.ms) + { + uint32_t operands = ops[4]; + if (operands != ImageOperandsSampleMask || instruction.length != 6) + SPIRV_CROSS_THROW("Multisampled image used in OpImageRead, but unexpected operand mask was used."); + uint32_t sample = ops[5]; + imgexpr = join(to_non_uniform_aware_expression(ops[2]), ".Load(int2(gl_FragCoord.xy), ", to_expression(sample), ")"); + } + else + imgexpr = join(to_non_uniform_aware_expression(ops[2]), ".Load(int3(int2(gl_FragCoord.xy), 0))"); + + pure = true; + } + else + { + imgexpr = join(to_non_uniform_aware_expression(ops[2]), "[", to_expression(ops[3]), "]"); + // The underlying image type in HLSL depends on the image format, unlike GLSL, where all images are "vec4", + // except that the underlying type changes how the data is interpreted. + + bool force_srv = + hlsl_options.nonwritable_uav_texture_as_srv && var && has_decoration(var->self, DecorationNonWritable); + pure = force_srv; + + if (var && !subpass_data && !force_srv) + imgexpr = remap_swizzle(get(result_type), + image_format_to_components(get(var->basetype).image.format), imgexpr); + } + + if (var) + { + bool forward = forced_temporaries.find(id) == end(forced_temporaries); + auto &e = emit_op(result_type, id, imgexpr, forward); + + if (!pure) + { + e.loaded_from = var->self; + if (forward) + var->dependees.push_back(id); + } + } + else + emit_op(result_type, id, imgexpr, false); + + inherit_expression_dependencies(id, ops[2]); + if (type.image.ms) + inherit_expression_dependencies(id, ops[5]); + break; + } + + case OpImageWrite: + { + auto *var = maybe_get_backing_variable(ops[0]); + + // The underlying image type in HLSL depends on the image format, unlike GLSL, where all images are "vec4", + // except that the underlying type changes how the data is interpreted. + auto value_expr = to_expression(ops[2]); + if (var) + { + auto &type = get(var->basetype); + auto narrowed_type = get(type.image.type); + narrowed_type.vecsize = image_format_to_components(type.image.format); + value_expr = remap_swizzle(narrowed_type, expression_type(ops[2]).vecsize, value_expr); + } + + statement(to_non_uniform_aware_expression(ops[0]), "[", to_expression(ops[1]), "] = ", value_expr, ";"); + if (var && variable_storage_is_aliased(*var)) + flush_all_aliased_variables(); + break; + } + + case OpImageTexelPointer: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + auto expr = to_expression(ops[2]); + expr += join("[", to_expression(ops[3]), "]"); + auto &e = set(id, expr, result_type, true); + + // When using the pointer, we need to know which variable it is actually loaded from. + auto *var = maybe_get_backing_variable(ops[2]); + e.loaded_from = var ? var->self : ID(0); + inherit_expression_dependencies(id, ops[3]); + break; + } + + case OpAtomicFAddEXT: + case OpAtomicFMinEXT: + case OpAtomicFMaxEXT: + SPIRV_CROSS_THROW("Floating-point atomics are not supported in HLSL."); + + case OpAtomicCompareExchange: + case OpAtomicExchange: + case OpAtomicISub: + case OpAtomicSMin: + case OpAtomicUMin: + case OpAtomicSMax: + case OpAtomicUMax: + case OpAtomicAnd: + case OpAtomicOr: + case OpAtomicXor: + case OpAtomicIAdd: + case OpAtomicIIncrement: + case OpAtomicIDecrement: + case OpAtomicLoad: + case OpAtomicStore: + { + emit_atomic(ops, instruction.length, opcode); + break; + } + + case OpControlBarrier: + case OpMemoryBarrier: + { + uint32_t memory; + uint32_t semantics; + + if (opcode == OpMemoryBarrier) + { + memory = evaluate_constant_u32(ops[0]); + semantics = evaluate_constant_u32(ops[1]); + } + else + { + memory = evaluate_constant_u32(ops[1]); + semantics = evaluate_constant_u32(ops[2]); + } + + if (memory == ScopeSubgroup) + { + // No Wave-barriers in HLSL. + break; + } + + // We only care about these flags, acquire/release and friends are not relevant to GLSL. + semantics = mask_relevant_memory_semantics(semantics); + + if (opcode == OpMemoryBarrier) + { + // If we are a memory barrier, and the next instruction is a control barrier, check if that memory barrier + // does what we need, so we avoid redundant barriers. + const Instruction *next = get_next_instruction_in_block(instruction); + if (next && next->op == OpControlBarrier) + { + auto *next_ops = stream(*next); + uint32_t next_memory = evaluate_constant_u32(next_ops[1]); + uint32_t next_semantics = evaluate_constant_u32(next_ops[2]); + next_semantics = mask_relevant_memory_semantics(next_semantics); + + // There is no "just execution barrier" in HLSL. + // If there are no memory semantics for next instruction, we will imply group shared memory is synced. + if (next_semantics == 0) + next_semantics = MemorySemanticsWorkgroupMemoryMask; + + bool memory_scope_covered = false; + if (next_memory == memory) + memory_scope_covered = true; + else if (next_semantics == MemorySemanticsWorkgroupMemoryMask) + { + // If we only care about workgroup memory, either Device or Workgroup scope is fine, + // scope does not have to match. + if ((next_memory == ScopeDevice || next_memory == ScopeWorkgroup) && + (memory == ScopeDevice || memory == ScopeWorkgroup)) + { + memory_scope_covered = true; + } + } + else if (memory == ScopeWorkgroup && next_memory == ScopeDevice) + { + // The control barrier has device scope, but the memory barrier just has workgroup scope. + memory_scope_covered = true; + } + + // If we have the same memory scope, and all memory types are covered, we're good. + if (memory_scope_covered && (semantics & next_semantics) == semantics) + break; + } + } + + // We are synchronizing some memory or syncing execution, + // so we cannot forward any loads beyond the memory barrier. + if (semantics || opcode == OpControlBarrier) + { + assert(current_emitting_block); + flush_control_dependent_expressions(current_emitting_block->self); + flush_all_active_variables(); + } + + if (opcode == OpControlBarrier) + { + // We cannot emit just execution barrier, for no memory semantics pick the cheapest option. + if (semantics == MemorySemanticsWorkgroupMemoryMask || semantics == 0) + statement("GroupMemoryBarrierWithGroupSync();"); + else if (semantics != 0 && (semantics & MemorySemanticsWorkgroupMemoryMask) == 0) + statement("DeviceMemoryBarrierWithGroupSync();"); + else + statement("AllMemoryBarrierWithGroupSync();"); + } + else + { + if (semantics == MemorySemanticsWorkgroupMemoryMask) + statement("GroupMemoryBarrier();"); + else if (semantics != 0 && (semantics & MemorySemanticsWorkgroupMemoryMask) == 0) + statement("DeviceMemoryBarrier();"); + else + statement("AllMemoryBarrier();"); + } + break; + } + + case OpBitFieldInsert: + { + if (!requires_bitfield_insert) + { + requires_bitfield_insert = true; + force_recompile(); + } + + auto expr = join("spvBitfieldInsert(", to_expression(ops[2]), ", ", to_expression(ops[3]), ", ", + to_expression(ops[4]), ", ", to_expression(ops[5]), ")"); + + bool forward = + should_forward(ops[2]) && should_forward(ops[3]) && should_forward(ops[4]) && should_forward(ops[5]); + + auto &restype = get(ops[0]); + expr = bitcast_expression(restype, SPIRType::UInt, expr); + emit_op(ops[0], ops[1], expr, forward); + break; + } + + case OpBitFieldSExtract: + case OpBitFieldUExtract: + { + if (!requires_bitfield_extract) + { + requires_bitfield_extract = true; + force_recompile(); + } + + if (opcode == OpBitFieldSExtract) + HLSL_TFOP(spvBitfieldSExtract); + else + HLSL_TFOP(spvBitfieldUExtract); + break; + } + + case OpBitCount: + { + auto basetype = expression_type(ops[2]).basetype; + emit_unary_func_op_cast(ops[0], ops[1], ops[2], "countbits", basetype, basetype); + break; + } + + case OpBitReverse: + HLSL_UFOP(reversebits); + break; + + case OpArrayLength: + { + auto *var = maybe_get_backing_variable(ops[2]); + if (!var) + SPIRV_CROSS_THROW("Array length must point directly to an SSBO block."); + + auto &type = get(var->basetype); + if (!has_decoration(type.self, DecorationBlock) && !has_decoration(type.self, DecorationBufferBlock)) + SPIRV_CROSS_THROW("Array length expression must point to a block type."); + + // This must be 32-bit uint, so we're good to go. + emit_uninitialized_temporary_expression(ops[0], ops[1]); + statement(to_non_uniform_aware_expression(ops[2]), ".GetDimensions(", to_expression(ops[1]), ");"); + uint32_t offset = type_struct_member_offset(type, ops[3]); + uint32_t stride = type_struct_member_array_stride(type, ops[3]); + statement(to_expression(ops[1]), " = (", to_expression(ops[1]), " - ", offset, ") / ", stride, ";"); + break; + } + + case OpIsHelperInvocationEXT: + if (hlsl_options.shader_model < 50 || get_entry_point().model != ExecutionModelFragment) + SPIRV_CROSS_THROW("Helper Invocation input is only supported in PS 5.0 or higher."); + // Helper lane state with demote is volatile by nature. + // Do not forward this. + emit_op(ops[0], ops[1], "IsHelperLane()", false); + break; + + case OpBeginInvocationInterlockEXT: + case OpEndInvocationInterlockEXT: + if (hlsl_options.shader_model < 51) + SPIRV_CROSS_THROW("Rasterizer order views require Shader Model 5.1."); + break; // Nothing to do in the body + + case OpRayQueryInitializeKHR: + { + flush_variable_declaration(ops[0]); + + std::string ray_desc_name = get_unique_identifier(); + statement("RayDesc ", ray_desc_name, " = {", to_expression(ops[4]), ", ", to_expression(ops[5]), ", ", + to_expression(ops[6]), ", ", to_expression(ops[7]), "};"); + + statement(to_expression(ops[0]), ".TraceRayInline(", + to_expression(ops[1]), ", ", // acc structure + to_expression(ops[2]), ", ", // ray flags + to_expression(ops[3]), ", ", // mask + ray_desc_name, ");"); // ray + break; + } + case OpRayQueryProceedKHR: + { + flush_variable_declaration(ops[0]); + emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".Proceed()"), false); + break; + } + case OpRayQueryTerminateKHR: + { + flush_variable_declaration(ops[0]); + statement(to_expression(ops[0]), ".Abort();"); + break; + } + case OpRayQueryGenerateIntersectionKHR: + { + flush_variable_declaration(ops[0]); + statement(to_expression(ops[0]), ".CommitProceduralPrimitiveHit(", to_expression(ops[1]), ");"); + break; + } + case OpRayQueryConfirmIntersectionKHR: + { + flush_variable_declaration(ops[0]); + statement(to_expression(ops[0]), ".CommitNonOpaqueTriangleHit();"); + break; + } + case OpRayQueryGetIntersectionTypeKHR: + { + emit_rayquery_function(".CommittedStatus()", ".CandidateType()", ops); + break; + } + case OpRayQueryGetIntersectionTKHR: + { + emit_rayquery_function(".CommittedRayT()", ".CandidateTriangleRayT()", ops); + break; + } + case OpRayQueryGetIntersectionInstanceCustomIndexKHR: + { + emit_rayquery_function(".CommittedInstanceID()", ".CandidateInstanceID()", ops); + break; + } + case OpRayQueryGetIntersectionInstanceIdKHR: + { + emit_rayquery_function(".CommittedInstanceIndex()", ".CandidateInstanceIndex()", ops); + break; + } + case OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: + { + emit_rayquery_function(".CommittedInstanceContributionToHitGroupIndex()", + ".CandidateInstanceContributionToHitGroupIndex()", ops); + break; + } + case OpRayQueryGetIntersectionGeometryIndexKHR: + { + emit_rayquery_function(".CommittedGeometryIndex()", + ".CandidateGeometryIndex()", ops); + break; + } + case OpRayQueryGetIntersectionPrimitiveIndexKHR: + { + emit_rayquery_function(".CommittedPrimitiveIndex()", ".CandidatePrimitiveIndex()", ops); + break; + } + case OpRayQueryGetIntersectionBarycentricsKHR: + { + emit_rayquery_function(".CommittedTriangleBarycentrics()", ".CandidateTriangleBarycentrics()", ops); + break; + } + case OpRayQueryGetIntersectionFrontFaceKHR: + { + emit_rayquery_function(".CommittedTriangleFrontFace()", ".CandidateTriangleFrontFace()", ops); + break; + } + case OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: + { + flush_variable_declaration(ops[0]); + emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".CandidateProceduralPrimitiveNonOpaque()"), false); + break; + } + case OpRayQueryGetIntersectionObjectRayDirectionKHR: + { + emit_rayquery_function(".CommittedObjectRayDirection()", ".CandidateObjectRayDirection()", ops); + break; + } + case OpRayQueryGetIntersectionObjectRayOriginKHR: + { + flush_variable_declaration(ops[0]); + emit_rayquery_function(".CommittedObjectRayOrigin()", ".CandidateObjectRayOrigin()", ops); + break; + } + case OpRayQueryGetIntersectionObjectToWorldKHR: + { + emit_rayquery_function(".CommittedObjectToWorld4x3()", ".CandidateObjectToWorld4x3()", ops); + break; + } + case OpRayQueryGetIntersectionWorldToObjectKHR: + { + emit_rayquery_function(".CommittedWorldToObject4x3()", ".CandidateWorldToObject4x3()", ops); + break; + } + case OpRayQueryGetRayFlagsKHR: + { + flush_variable_declaration(ops[0]); + emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".RayFlags()"), false); + break; + } + case OpRayQueryGetRayTMinKHR: + { + flush_variable_declaration(ops[0]); + emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".RayTMin()"), false); + break; + } + case OpRayQueryGetWorldRayOriginKHR: + { + flush_variable_declaration(ops[0]); + emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".WorldRayOrigin()"), false); + break; + } + case OpRayQueryGetWorldRayDirectionKHR: + { + flush_variable_declaration(ops[0]); + emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".WorldRayDirection()"), false); + break; + } + case OpSetMeshOutputsEXT: + { + statement("SetMeshOutputCounts(", to_unpacked_expression(ops[0]), ", ", to_unpacked_expression(ops[1]), ");"); + break; + } + case OpEmitVertex: + { + emit_geometry_stream_append(); + break; + } + case OpEndPrimitive: + { + statement("geometry_stream.RestartStrip();"); + break; + } + default: + CompilerGLSL::emit_instruction(instruction); + break; + } +} + +void CompilerHLSL::require_texture_query_variant(uint32_t var_id) +{ + if (const auto *var = maybe_get_backing_variable(var_id)) + var_id = var->self; + + auto &type = expression_type(var_id); + bool uav = type.image.sampled == 2; + if (hlsl_options.nonwritable_uav_texture_as_srv && has_decoration(var_id, DecorationNonWritable)) + uav = false; + + uint32_t bit = 0; + switch (type.image.dim) + { + case Dim1D: + bit = type.image.arrayed ? Query1DArray : Query1D; + break; + + case Dim2D: + if (type.image.ms) + bit = type.image.arrayed ? Query2DMSArray : Query2DMS; + else + bit = type.image.arrayed ? Query2DArray : Query2D; + break; + + case Dim3D: + bit = Query3D; + break; + + case DimCube: + bit = type.image.arrayed ? QueryCubeArray : QueryCube; + break; + + case DimBuffer: + bit = QueryBuffer; + break; + + default: + SPIRV_CROSS_THROW("Unsupported query type."); + } + + switch (get(type.image.type).basetype) + { + case SPIRType::Float: + bit += QueryTypeFloat; + break; + + case SPIRType::Int: + bit += QueryTypeInt; + break; + + case SPIRType::UInt: + bit += QueryTypeUInt; + break; + + default: + SPIRV_CROSS_THROW("Unsupported query type."); + } + + auto norm_state = image_format_to_normalized_state(type.image.format); + auto &variant = uav ? required_texture_size_variants + .uav[uint32_t(norm_state)][image_format_to_components(type.image.format) - 1] : + required_texture_size_variants.srv; + + uint64_t mask = 1ull << bit; + if ((variant & mask) == 0) + { + force_recompile(); + variant |= mask; + } +} + +void CompilerHLSL::set_root_constant_layouts(std::vector layout) +{ + root_constants_layout = std::move(layout); +} + +void CompilerHLSL::add_vertex_attribute_remap(const HLSLVertexAttributeRemap &vertex_attributes) +{ + remap_vertex_attributes.push_back(vertex_attributes); +} + +VariableID CompilerHLSL::remap_num_workgroups_builtin() +{ + update_active_builtins(); + + if (!active_input_builtins.get(BuiltInNumWorkgroups)) + return 0; + + // Create a new, fake UBO. + uint32_t offset = ir.increase_bound_by(4); + + uint32_t uint_type_id = offset; + uint32_t block_type_id = offset + 1; + uint32_t block_pointer_type_id = offset + 2; + uint32_t variable_id = offset + 3; + + SPIRType uint_type { OpTypeVector }; + uint_type.basetype = SPIRType::UInt; + uint_type.width = 32; + uint_type.vecsize = 3; + uint_type.columns = 1; + set(uint_type_id, uint_type); + + SPIRType block_type { OpTypeStruct }; + block_type.basetype = SPIRType::Struct; + block_type.member_types.push_back(uint_type_id); + set(block_type_id, block_type); + set_decoration(block_type_id, DecorationBlock); + set_member_name(block_type_id, 0, "count"); + set_member_decoration(block_type_id, 0, DecorationOffset, 0); + + SPIRType block_pointer_type = block_type; + block_pointer_type.pointer = true; + block_pointer_type.storage = StorageClassUniform; + block_pointer_type.parent_type = block_type_id; + auto &ptr_type = set(block_pointer_type_id, block_pointer_type); + + // Preserve self. + ptr_type.self = block_type_id; + + set(variable_id, block_pointer_type_id, StorageClassUniform); + ir.meta[variable_id].decoration.alias = "SPIRV_Cross_NumWorkgroups"; + + num_workgroups_builtin = variable_id; + get_entry_point().interface_variables.push_back(num_workgroups_builtin); + return variable_id; +} + +void CompilerHLSL::set_resource_binding_flags(HLSLBindingFlags flags) +{ + resource_binding_flags = flags; +} + +void CompilerHLSL::validate_shader_model() +{ + // Check for nonuniform qualifier. + // Instead of looping over all decorations to find this, just look at capabilities. + for (auto &cap : ir.declared_capabilities) + { + switch (cap) + { + case CapabilityShaderNonUniformEXT: + case CapabilityRuntimeDescriptorArrayEXT: + if (hlsl_options.shader_model < 51) + SPIRV_CROSS_THROW( + "Shader model 5.1 or higher is required to use bindless resources or NonUniformResourceIndex."); + break; + + case CapabilityVariablePointers: + case CapabilityVariablePointersStorageBuffer: + SPIRV_CROSS_THROW("VariablePointers capability is not supported in HLSL."); + + default: + break; + } + } + + if (ir.addressing_model != AddressingModelLogical) + SPIRV_CROSS_THROW("Only Logical addressing model can be used with HLSL."); + + if (hlsl_options.enable_16bit_types && hlsl_options.shader_model < 62) + SPIRV_CROSS_THROW("Need at least shader model 6.2 when enabling native 16-bit type support."); +} + +string CompilerHLSL::compile() +{ + ir.fixup_reserved_names(); + + // Do not deal with ES-isms like precision, older extensions and such. + options.es = false; + options.version = 450; + options.vulkan_semantics = true; + backend.float_literal_suffix = true; + backend.double_literal_suffix = false; + backend.long_long_literal_suffix = true; + backend.uint32_t_literal_suffix = true; + backend.int16_t_literal_suffix = ""; + backend.uint16_t_literal_suffix = "u"; + backend.basic_int_type = "int"; + backend.basic_uint_type = "uint"; + backend.demote_literal = "discard"; + backend.boolean_mix_function = ""; + backend.swizzle_is_function = false; + backend.shared_is_implied = true; + backend.unsized_array_supported = true; + backend.explicit_struct_type = false; + backend.use_initializer_list = true; + backend.use_constructor_splatting = false; + backend.can_swizzle_scalar = true; + backend.can_declare_struct_inline = false; + backend.can_declare_arrays_inline = false; + backend.can_return_array = false; + backend.nonuniform_qualifier = "NonUniformResourceIndex"; + backend.support_case_fallthrough = false; + backend.force_merged_mesh_block = get_execution_model() == ExecutionModelMeshEXT; + backend.force_gl_in_out_block = backend.force_merged_mesh_block; + backend.supports_empty_struct = hlsl_options.shader_model <= 30; + + // SM 4.1 does not support precise for some reason. + backend.support_precise_qualifier = hlsl_options.shader_model >= 50 || hlsl_options.shader_model == 40; + + fixup_anonymous_struct_names(); + fixup_type_alias(); + reorder_type_alias(); + build_function_control_flow_graphs_and_analyze(); + validate_shader_model(); + update_active_builtins(); + analyze_image_and_sampler_usage(); + analyze_interlocked_resource_usage(); + if (get_execution_model() == ExecutionModelMeshEXT) + analyze_meshlet_writes(); + + if (get_execution_model() == ExecutionModelGeometry) + discover_geometry_emitters(); + + // Subpass input needs SV_Position. + if (need_subpass_input) + active_input_builtins.set(BuiltInFragCoord); + + // Need to offset by BaseVertex/BaseInstance in SM 6.8+. + if (hlsl_options.shader_model >= 68) + { + if (active_input_builtins.get(BuiltInVertexIndex)) + active_input_builtins.set(BuiltInBaseVertex); + if (active_input_builtins.get(BuiltInInstanceIndex)) + active_input_builtins.set(BuiltInBaseInstance); + } + + uint32_t pass_count = 0; + do + { + reset(pass_count); + + // Move constructor for this type is broken on GCC 4.9 ... + buffer.reset(); + + emit_header(); + emit_resources(); + + emit_function(get(ir.default_entry_point), Bitset()); + emit_hlsl_entry_point(); + + pass_count++; + } while (is_forcing_recompilation()); + + // Entry point in HLSL is always main() for the time being. + get_entry_point().name = "main"; + + return buffer.str(); +} + +void CompilerHLSL::emit_block_hints(const SPIRBlock &block) +{ + switch (block.hint) + { + case SPIRBlock::HintFlatten: + statement("[flatten]"); + break; + case SPIRBlock::HintDontFlatten: + statement("[branch]"); + break; + case SPIRBlock::HintUnroll: + statement("[unroll]"); + break; + case SPIRBlock::HintDontUnroll: + statement("[loop]"); + break; + default: + break; + } +} + +string CompilerHLSL::get_unique_identifier() +{ + return join("_", unique_identifier_count++, "ident"); +} + +void CompilerHLSL::add_hlsl_resource_binding(const HLSLResourceBinding &binding) +{ + StageSetBinding tuple = { binding.stage, binding.desc_set, binding.binding }; + resource_bindings[tuple] = { binding, false }; +} + +bool CompilerHLSL::is_hlsl_resource_binding_used(ExecutionModel model, uint32_t desc_set, uint32_t binding) const +{ + StageSetBinding tuple = { model, desc_set, binding }; + auto itr = resource_bindings.find(tuple); + return itr != end(resource_bindings) && itr->second.second; +} + +CompilerHLSL::BitcastType CompilerHLSL::get_bitcast_type(uint32_t result_type, uint32_t op0) +{ + auto &rslt_type = get(result_type); + auto &expr_type = expression_type(op0); + + if (rslt_type.basetype == SPIRType::BaseType::UInt64 && expr_type.basetype == SPIRType::BaseType::UInt && + expr_type.vecsize == 2) + return BitcastType::TypePackUint2x32; + else if (rslt_type.basetype == SPIRType::BaseType::UInt && rslt_type.vecsize == 2 && + expr_type.basetype == SPIRType::BaseType::UInt64) + return BitcastType::TypeUnpackUint64; + + return BitcastType::TypeNormal; +} + +bool CompilerHLSL::is_hlsl_force_storage_buffer_as_uav(ID id) const +{ + if (hlsl_options.force_storage_buffer_as_uav) + { + return true; + } + + const uint32_t desc_set = get_decoration(id, DecorationDescriptorSet); + const uint32_t binding = get_decoration(id, DecorationBinding); + + return (force_uav_buffer_bindings.find({ desc_set, binding }) != force_uav_buffer_bindings.end()); +} + +bool CompilerHLSL::is_hidden_io_variable(const SPIRVariable &var) const +{ + if (!is_hidden_variable(var)) + return false; + + // It is too risky to remove stage IO variables that are linkable since it affects link compatibility. + // For vertex inputs and fragment outputs, it's less of a concern and we want reflection data + // to match reality. + + bool is_external_linkage = + (get_execution_model() == ExecutionModelVertex && var.storage == StorageClassInput) || + (get_execution_model() == ExecutionModelFragment && var.storage == StorageClassOutput); + + if (!is_external_linkage) + return false; + + // Unused output I/O variables might still be required to implement framebuffer fetch. + if (var.storage == StorageClassOutput && !is_legacy() && + location_is_framebuffer_fetch(get_decoration(var.self, DecorationLocation)) != 0) + return false; + + return true; +} + +void CompilerHLSL::set_hlsl_force_storage_buffer_as_uav(uint32_t desc_set, uint32_t binding) +{ + SetBindingPair pair = { desc_set, binding }; + force_uav_buffer_bindings.insert(pair); +} + +bool CompilerHLSL::is_user_type_structured(uint32_t id) const +{ + if (hlsl_options.preserve_structured_buffers) + { + // Compare left hand side of string only as these user types can contain more meta data such as their subtypes, + // e.g. "structuredbuffer:int" + const std::string &user_type = get_decoration_string(id, DecorationUserTypeGOOGLE); + return user_type.compare(0, 16, "structuredbuffer") == 0 || + user_type.compare(0, 18, "rwstructuredbuffer") == 0 || + user_type.compare(0, 35, "globallycoherent rwstructuredbuffer") == 0 || + user_type.compare(0, 33, "rasterizerorderedstructuredbuffer") == 0; + } + return false; +} + +void CompilerHLSL::cast_to_variable_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type) +{ + // Loading a full array of ClipDistance needs special consideration in mesh shaders + // since we cannot lower them by wrapping the variables in global statics. + // Fortunately, clip/cull is a proper vector in HLSL so we can lower with simple rvalue casts. + if (get_execution_model() != ExecutionModelMeshEXT || + !has_decoration(target_id, DecorationBuiltIn) || + !is_array(expr_type)) + { + CompilerGLSL::cast_to_variable_store(target_id, expr, expr_type); + return; + } + + auto builtin = BuiltIn(get_decoration(target_id, DecorationBuiltIn)); + if (builtin != BuiltInClipDistance && builtin != BuiltInCullDistance) + { + CompilerGLSL::cast_to_variable_store(target_id, expr, expr_type); + return; + } + + // Array of array means one thread is storing clip distance for all vertices. Nonsensical? + if (is_array(get(expr_type.parent_type))) + SPIRV_CROSS_THROW("Attempting to store all mesh vertices in one go. This is not supported."); + + uint32_t num_clip = to_array_size_literal(expr_type); + if (num_clip > 4) + SPIRV_CROSS_THROW("Number of clip or cull distances exceeds 4, this will not work with mesh shaders."); + + if (num_clip == 1) + { + // We already emit array here. + CompilerGLSL::cast_to_variable_store(target_id, expr, expr_type); + return; + } + + auto unrolled_expr = join("float", num_clip, "("); + for (uint32_t i = 0; i < num_clip; i++) + { + unrolled_expr += join(expr, "[", i, "]"); + if (i + 1 < num_clip) + unrolled_expr += ", "; + } + + unrolled_expr += ")"; + expr = std::move(unrolled_expr); +} diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_hlsl.hpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_hlsl.hpp new file mode 100644 index 0000000000..0d5181b9d9 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_hlsl.hpp @@ -0,0 +1,425 @@ +/* + * Copyright 2016-2021 Robert Konrad + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#ifndef SPIRV_HLSL_HPP +#define SPIRV_HLSL_HPP + +#include "spirv_glsl.hpp" +#include + +namespace SPIRV_CROSS_NAMESPACE +{ +using namespace SPIRV_CROSS_SPV_HEADER_NAMESPACE; +// Interface which remaps vertex inputs to a fixed semantic name to make linking easier. +struct HLSLVertexAttributeRemap +{ + uint32_t location; + std::string semantic; +}; +// Specifying a root constant (d3d12) or push constant range (vulkan). +// +// `start` and `end` denotes the range of the root constant in bytes. +// Both values need to be multiple of 4. +struct RootConstants +{ + uint32_t start; + uint32_t end; + + uint32_t binding; + uint32_t space; +}; + +// For finer control, decorations may be removed from specific resources instead with unset_decoration(). +enum HLSLBindingFlagBits +{ + HLSL_BINDING_AUTO_NONE_BIT = 0, + + // Push constant (root constant) resources will be declared as CBVs (b-space) without a register() declaration. + // A register will be automatically assigned by the D3D compiler, but must therefore be reflected in D3D-land. + // Push constants do not normally have a DecorationBinding set, but if they do, this can be used to ignore it. + HLSL_BINDING_AUTO_PUSH_CONSTANT_BIT = 1 << 0, + + // cbuffer resources will be declared as CBVs (b-space) without a register() declaration. + // A register will be automatically assigned, but must be reflected in D3D-land. + HLSL_BINDING_AUTO_CBV_BIT = 1 << 1, + + // All SRVs (t-space) will be declared without a register() declaration. + HLSL_BINDING_AUTO_SRV_BIT = 1 << 2, + + // All UAVs (u-space) will be declared without a register() declaration. + HLSL_BINDING_AUTO_UAV_BIT = 1 << 3, + + // All samplers (s-space) will be declared without a register() declaration. + HLSL_BINDING_AUTO_SAMPLER_BIT = 1 << 4, + + // No resources will be declared with register(). + HLSL_BINDING_AUTO_ALL = 0x7fffffff +}; +using HLSLBindingFlags = uint32_t; + +// By matching stage, desc_set and binding for a SPIR-V resource, +// register bindings are set based on whether the HLSL resource is a +// CBV, UAV, SRV or Sampler. A single binding in SPIR-V might contain multiple +// resource types, e.g. COMBINED_IMAGE_SAMPLER, and SRV/Sampler bindings will be used respectively. +// On SM 5.0 and lower, register_space is ignored. +// +// To remap a push constant block which does not have any desc_set/binding associated with it, +// use ResourceBindingPushConstant{DescriptorSet,Binding} as values for desc_set/binding. +// For deeper control of push constants, set_root_constant_layouts() can be used instead. +struct HLSLResourceBinding +{ + ExecutionModel stage = ExecutionModelMax; + uint32_t desc_set = 0; + uint32_t binding = 0; + + struct Binding + { + uint32_t register_space = 0; + uint32_t register_binding = 0; + } cbv, uav, srv, sampler; +}; + +enum HLSLAuxBinding +{ + HLSL_AUX_BINDING_BASE_VERTEX_INSTANCE = 0 +}; + +class CompilerHLSL : public CompilerGLSL +{ +public: + struct Options + { + uint32_t shader_model = 30; // TODO: map ps_4_0_level_9_0,... somehow + + // Allows the PointSize builtin in SM 4.0+, and ignores it, as PointSize is not supported in SM 4+. + bool point_size_compat = false; + + // Allows the PointCoord builtin, returns float2(0.5, 0.5), as PointCoord is not supported in HLSL. + bool point_coord_compat = false; + + // If true, the backend will assume that VertexIndex and InstanceIndex will need to apply + // a base offset, and you will need to fill in a cbuffer with offsets. + // Set to false if you know you will never use base instance or base vertex + // functionality as it might remove an internal cbuffer. + bool support_nonzero_base_vertex_base_instance = false; + + // Forces a storage buffer to always be declared as UAV, even if the readonly decoration is used. + // By default, a readonly storage buffer will be declared as ByteAddressBuffer (SRV) instead. + // Alternatively, use set_hlsl_force_storage_buffer_as_uav to specify individually. + bool force_storage_buffer_as_uav = false; + + // Forces any storage image type marked as NonWritable to be considered an SRV instead. + // For this to work with function call parameters, NonWritable must be considered to be part of the type system + // so that NonWritable image arguments are also translated to Texture rather than RWTexture. + bool nonwritable_uav_texture_as_srv = false; + + // Enables native 16-bit types. Needs SM 6.2. + // Uses half/int16_t/uint16_t instead of min16* types. + // Also adds support for 16-bit load-store from (RW)ByteAddressBuffer. + bool enable_16bit_types = false; + + // If matrices are used as IO variables, flatten the attribute declaration to use + // TEXCOORD{N,N+1,N+2,...} rather than TEXCOORDN_{0,1,2,3}. + // If add_vertex_attribute_remap is used and this feature is used, + // the semantic name will be queried once per active location. + bool flatten_matrix_vertex_input_semantics = false; + + // Rather than emitting main() for the entry point, use the name in SPIR-V. + bool use_entry_point_name = false; + + // Preserve (RW)StructuredBuffer types if the input source was HLSL. + // This relies on UserTypeGOOGLE to encode the buffer type either as "structuredbuffer" or "rwstructuredbuffer" + // whereas the type can be extended with an optional subtype, e.g. "structuredbuffer:int". + bool preserve_structured_buffers = false; + + // Use UserSemantic decoration info (if specified), otherwise use default mechanism (such as add_vertex_attribute_remap or TEXCOORD#). + bool user_semantic = false; + }; + + explicit CompilerHLSL(std::vector spirv_) + : CompilerGLSL(std::move(spirv_)) + { + } + + CompilerHLSL(const uint32_t *ir_, size_t size) + : CompilerGLSL(ir_, size) + { + } + + explicit CompilerHLSL(const ParsedIR &ir_) + : CompilerGLSL(ir_) + { + } + + explicit CompilerHLSL(ParsedIR &&ir_) + : CompilerGLSL(std::move(ir_)) + { + } + + const Options &get_hlsl_options() const + { + return hlsl_options; + } + + void set_hlsl_options(const Options &opts) + { + hlsl_options = opts; + } + + // Optionally specify a custom root constant layout. + // + // Push constants ranges will be split up according to the + // layout specified. + void set_root_constant_layouts(std::vector layout); + + // Compiles and remaps vertex attributes at specific locations to a fixed semantic. + // The default is TEXCOORD# where # denotes location. + // Matrices are unrolled to vectors with notation ${SEMANTIC}_#, where # denotes row. + // $SEMANTIC is either TEXCOORD# or a semantic name specified here. + void add_vertex_attribute_remap(const HLSLVertexAttributeRemap &vertex_attributes); + std::string compile() override; + + // This is a special HLSL workaround for the NumWorkGroups builtin. + // This does not exist in HLSL, so the calling application must create a dummy cbuffer in + // which the application will store this builtin. + // The cbuffer layout will be: + // cbuffer SPIRV_Cross_NumWorkgroups : register(b#, space#) { uint3 SPIRV_Cross_NumWorkgroups_count; }; + // This must be called before compile(). + // The function returns 0 if NumWorkGroups builtin is not statically used in the shader from the current entry point. + // If non-zero, this returns the variable ID of a cbuffer which corresponds to + // the cbuffer declared above. By default, no binding or descriptor set decoration is set, + // so the calling application should declare explicit bindings on this ID before calling compile(). + VariableID remap_num_workgroups_builtin(); + + // Controls how resource bindings are declared in the output HLSL. + void set_resource_binding_flags(HLSLBindingFlags flags); + + // resource is a resource binding to indicate the HLSL CBV, SRV, UAV or sampler binding + // to use for a particular SPIR-V description set + // and binding. If resource bindings are provided, + // is_hlsl_resource_binding_used() will return true after calling ::compile() if + // the set/binding combination was used by the HLSL code. + void add_hlsl_resource_binding(const HLSLResourceBinding &resource); + bool is_hlsl_resource_binding_used(ExecutionModel model, uint32_t set, uint32_t binding) const; + + // Controls which storage buffer bindings will be forced to be declared as UAVs. + void set_hlsl_force_storage_buffer_as_uav(uint32_t desc_set, uint32_t binding); + + // By default, these magic buffers are not assigned a specific binding. + void set_hlsl_aux_buffer_binding(HLSLAuxBinding binding, uint32_t register_index, uint32_t register_space); + void unset_hlsl_aux_buffer_binding(HLSLAuxBinding binding); + bool is_hlsl_aux_buffer_binding_used(HLSLAuxBinding binding) const; + +private: + std::string type_to_glsl(const SPIRType &type, uint32_t id = 0) override; + std::string image_type_hlsl(const SPIRType &type, uint32_t id); + std::string image_type_hlsl_modern(const SPIRType &type, uint32_t id); + std::string image_type_hlsl_legacy(const SPIRType &type, uint32_t id); + uint32_t input_vertices_from_execution_mode(SPIREntryPoint &execution) const; + void emit_function_prototype(SPIRFunction &func, const Bitset &return_flags) override; + void emit_hlsl_entry_point(); + void emit_header() override; + void emit_resources(); + void emit_interface_block_globally(const SPIRVariable &type); + void emit_interface_block_in_struct(const SPIRVariable &var, std::unordered_set &active_locations); + void emit_interface_block_member_in_struct(const SPIRVariable &var, uint32_t member_index, uint32_t location, + std::unordered_set &active_locations); + void emit_builtin_inputs_in_struct(); + void emit_builtin_outputs_in_struct(); + void emit_builtin_primitive_outputs_in_struct(); + void emit_texture_op(const Instruction &i, bool sparse) override; + void emit_instruction(const Instruction &instruction) override; + void emit_glsl_op(uint32_t result_type, uint32_t result_id, uint32_t op, const uint32_t *args, + uint32_t count) override; + void emit_buffer_block(const SPIRVariable &type) override; + void emit_push_constant_block(const SPIRVariable &var) override; + void emit_uniform(const SPIRVariable &var) override; + void emit_modern_uniform(const SPIRVariable &var); + void emit_legacy_uniform(const SPIRVariable &var); + void emit_specialization_constants_and_structs(); + void emit_composite_constants(); + void emit_fixup() override; + std::string builtin_to_glsl(BuiltIn builtin, StorageClass storage) override; + std::string layout_for_member(const SPIRType &type, uint32_t index) override; + std::string to_interpolation_qualifiers(const Bitset &flags) override; + std::string bitcast_glsl_op(const SPIRType &result_type, const SPIRType &argument_type) override; + bool emit_complex_bitcast(uint32_t result_type, uint32_t id, uint32_t op0) override; + void append_global_func_args(const SPIRFunction &func, uint32_t index, SmallVector &arglist) override; + + std::string to_func_call_arg(const SPIRFunction::Parameter &arg, uint32_t id) override; + std::string to_sampler_expression(uint32_t id); + std::string to_resource_binding(const SPIRVariable &var); + std::string to_resource_binding_sampler(const SPIRVariable &var); + std::string to_resource_register(HLSLBindingFlagBits flag, char space, uint32_t binding, uint32_t set); + std::string to_initializer_expression(const SPIRVariable &var) override; + void emit_sampled_image_op(uint32_t result_type, uint32_t result_id, uint32_t image_id, uint32_t samp_id) override; + void emit_access_chain(const Instruction &instruction); + void emit_load(const Instruction &instruction); + void read_access_chain(std::string *expr, const std::string &lhs, const SPIRAccessChain &chain); + void read_access_chain_struct(const std::string &lhs, const SPIRAccessChain &chain); + void read_access_chain_array(const std::string &lhs, const SPIRAccessChain &chain); + void write_access_chain(const SPIRAccessChain &chain, uint32_t value, const SmallVector &composite_chain); + void write_access_chain_struct(const SPIRAccessChain &chain, uint32_t value, + const SmallVector &composite_chain); + void write_access_chain_array(const SPIRAccessChain &chain, uint32_t value, + const SmallVector &composite_chain); + std::string write_access_chain_value(uint32_t value, const SmallVector &composite_chain, bool enclose); + void emit_store(const Instruction &instruction); + void emit_atomic(const uint32_t *ops, uint32_t length, Op op); + void emit_subgroup_op(const Instruction &i) override; + void emit_block_hints(const SPIRBlock &block) override; + + void emit_struct_member(const SPIRType &type, uint32_t member_type_id, uint32_t index, const std::string &qualifier, + uint32_t base_offset = 0) override; + void emit_rayquery_function(const char *commited, const char *candidate, const uint32_t *ops); + void emit_mesh_tasks(SPIRBlock &block) override; + void emit_geometry_stream_append(); + + const char *to_storage_qualifiers_glsl(const SPIRVariable &var) override; + void replace_illegal_names() override; + + SPIRType::BaseType get_builtin_basetype(BuiltIn builtin, SPIRType::BaseType default_type) override; + + bool is_hlsl_force_storage_buffer_as_uav(ID id) const; + bool is_hidden_io_variable(const SPIRVariable &var) const; + + Options hlsl_options; + + // TODO: Refactor this to be more similar to MSL, maybe have some common system in place? + bool requires_op_fmod = false; + bool requires_fp16_packing = false; + bool requires_uint2_packing = false; + bool requires_explicit_fp16_packing = false; + bool requires_unorm8_packing = false; + bool requires_snorm8_packing = false; + bool requires_unorm16_packing = false; + bool requires_snorm16_packing = false; + bool requires_bitfield_insert = false; + bool requires_bitfield_extract = false; + bool requires_inverse_2x2 = false; + bool requires_inverse_3x3 = false; + bool requires_inverse_4x4 = false; + bool requires_scalar_reflect = false; + bool requires_scalar_refract = false; + bool requires_scalar_faceforward = false; + + struct TextureSizeVariants + { + // MSVC 2013 workaround. + TextureSizeVariants() + { + srv = 0; + for (auto &unorm : uav) + for (auto &u : unorm) + u = 0; + } + uint64_t srv; + uint64_t uav[3][4]; + } required_texture_size_variants; + + void require_texture_query_variant(uint32_t var_id); + void emit_texture_size_variants(uint64_t variant_mask, const char *vecsize_qualifier, bool uav, + const char *type_qualifier); + + enum TextureQueryVariantDim + { + Query1D = 0, + Query1DArray, + Query2D, + Query2DArray, + Query3D, + QueryBuffer, + QueryCube, + QueryCubeArray, + Query2DMS, + Query2DMSArray, + QueryDimCount + }; + + enum TextureQueryVariantType + { + QueryTypeFloat = 0, + QueryTypeInt = 16, + QueryTypeUInt = 32, + QueryTypeCount = 3 + }; + + enum BitcastType + { + TypeNormal, + TypePackUint2x32, + TypeUnpackUint64 + }; + + void analyze_meshlet_writes(); + void analyze_meshlet_writes(uint32_t func_id, uint32_t id_per_vertex, uint32_t id_per_primitive, + std::unordered_set &processed_func_ids); + + BitcastType get_bitcast_type(uint32_t result_type, uint32_t op0); + + void emit_builtin_variables(); + bool require_output = false; + bool require_input = false; + SmallVector remap_vertex_attributes; + + uint32_t type_to_consumed_locations(const SPIRType &type) const; + + std::string to_semantic(uint32_t location, ExecutionModel em, StorageClass sc); + + uint32_t num_workgroups_builtin = 0; + HLSLBindingFlags resource_binding_flags = 0; + + // Custom root constant layout, which should be emitted + // when translating push constant ranges. + std::vector root_constants_layout; + + void validate_shader_model(); + + std::string get_unique_identifier(); + uint32_t unique_identifier_count = 0; + + std::unordered_map, InternalHasher> resource_bindings; + void remap_hlsl_resource_binding(HLSLBindingFlagBits type, uint32_t &desc_set, uint32_t &binding); + + std::unordered_set force_uav_buffer_bindings; + + struct + { + uint32_t register_index = 0; + uint32_t register_space = 0; + bool explicit_binding = false; + bool used = false; + } base_vertex_info; + + // Returns true if the specified ID has a UserTypeGOOGLE decoration for StructuredBuffer or RWStructuredBuffer resources. + bool is_user_type_structured(uint32_t id) const override; + + std::vector composite_selection_workaround_types; + + std::string get_inner_entry_point_name() const; + + void cast_to_variable_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type) override; +}; +} // namespace SPIRV_CROSS_NAMESPACE + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_msl.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_msl.cpp new file mode 100644 index 0000000000..38398b327f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_msl.cpp @@ -0,0 +1,20523 @@ +/* + * Copyright 2016-2021 The Brenwill Workshop Ltd. + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#include "spirv_msl.hpp" +#include "GLSL.std.450.h" + +#include +#include +#include + +using namespace SPIRV_CROSS_SPV_HEADER_NAMESPACE; +using namespace SPIRV_CROSS_NAMESPACE; +using namespace std; + +static const uint32_t k_unknown_location = ~0u; +static const uint32_t k_unknown_component = ~0u; +static const char *force_inline = "static inline __attribute__((always_inline))"; + +CompilerMSL::CompilerMSL(std::vector spirv_) + : CompilerGLSL(std::move(spirv_)) +{ +} + +CompilerMSL::CompilerMSL(const uint32_t *ir_, size_t word_count) + : CompilerGLSL(ir_, word_count) +{ +} + +CompilerMSL::CompilerMSL(const ParsedIR &ir_) + : CompilerGLSL(ir_) +{ +} + +CompilerMSL::CompilerMSL(ParsedIR &&ir_) + : CompilerGLSL(std::move(ir_)) +{ +} + +void CompilerMSL::add_msl_shader_input(const MSLShaderInterfaceVariable &si) +{ + inputs_by_location[{si.location, si.component}] = si; + if (si.builtin != BuiltInMax && !inputs_by_builtin.count(si.builtin)) + inputs_by_builtin[si.builtin] = si; +} + +void CompilerMSL::add_msl_shader_output(const MSLShaderInterfaceVariable &so) +{ + outputs_by_location[{so.location, so.component}] = so; + if (so.builtin != BuiltInMax && !outputs_by_builtin.count(so.builtin)) + outputs_by_builtin[so.builtin] = so; +} + +void CompilerMSL::add_msl_resource_binding(const MSLResourceBinding &binding) +{ + StageSetBinding tuple = { binding.stage, binding.desc_set, binding.binding }; + resource_bindings[tuple] = { binding, false }; + + // If we might need to pad argument buffer members to positionally align + // arg buffer indexes, also maintain a lookup by argument buffer index. + if (msl_options.pad_argument_buffer_resources) + { + StageSetBinding arg_idx_tuple = { binding.stage, binding.desc_set, k_unknown_component }; + +#define ADD_ARG_IDX_TO_BINDING_NUM_LOOKUP(rez) \ + arg_idx_tuple.binding = binding.msl_##rez; \ + resource_arg_buff_idx_to_binding_number[arg_idx_tuple] = binding.binding + + switch (binding.basetype) + { + case SPIRType::Void: + case SPIRType::Boolean: + case SPIRType::SByte: + case SPIRType::UByte: + case SPIRType::Short: + case SPIRType::UShort: + case SPIRType::Int: + case SPIRType::UInt: + case SPIRType::Int64: + case SPIRType::UInt64: + case SPIRType::AtomicCounter: + case SPIRType::Half: + case SPIRType::Float: + case SPIRType::Double: + ADD_ARG_IDX_TO_BINDING_NUM_LOOKUP(buffer); + break; + case SPIRType::Image: + ADD_ARG_IDX_TO_BINDING_NUM_LOOKUP(texture); + break; + case SPIRType::Sampler: + ADD_ARG_IDX_TO_BINDING_NUM_LOOKUP(sampler); + break; + case SPIRType::SampledImage: + ADD_ARG_IDX_TO_BINDING_NUM_LOOKUP(texture); + ADD_ARG_IDX_TO_BINDING_NUM_LOOKUP(sampler); + break; + default: + SPIRV_CROSS_THROW("Unexpected argument buffer resource base type. When padding argument buffer elements, " + "all descriptor set resources must be supplied with a base type by the app."); + } +#undef ADD_ARG_IDX_TO_BINDING_NUM_LOOKUP + } +} + +void CompilerMSL::add_dynamic_buffer(uint32_t desc_set, uint32_t binding, uint32_t index) +{ + SetBindingPair pair = { desc_set, binding }; + buffers_requiring_dynamic_offset[pair] = { index, 0, "" }; +} + +void CompilerMSL::add_inline_uniform_block(uint32_t desc_set, uint32_t binding) +{ + SetBindingPair pair = { desc_set, binding }; + inline_uniform_blocks.insert(pair); +} + +void CompilerMSL::add_discrete_descriptor_set(uint32_t desc_set) +{ + if (desc_set < kMaxArgumentBuffers) + argument_buffer_discrete_mask |= 1u << desc_set; +} + +void CompilerMSL::set_argument_buffer_device_address_space(uint32_t desc_set, bool device_storage) +{ + if (desc_set < kMaxArgumentBuffers) + { + if (device_storage) + argument_buffer_device_storage_mask |= 1u << desc_set; + else + argument_buffer_device_storage_mask &= ~(1u << desc_set); + } +} + +bool CompilerMSL::is_msl_shader_input_used(uint32_t location) +{ + // Don't report internal location allocations to app. + return location_inputs_in_use.count(location) != 0 && + location_inputs_in_use_fallback.count(location) == 0; +} + +bool CompilerMSL::is_msl_shader_output_used(uint32_t location) +{ + // Don't report internal location allocations to app. + return location_outputs_in_use.count(location) != 0 && + location_outputs_in_use_fallback.count(location) == 0; +} + +uint32_t CompilerMSL::get_automatic_builtin_input_location(BuiltIn builtin) const +{ + auto itr = builtin_to_automatic_input_location.find(builtin); + if (itr == builtin_to_automatic_input_location.end()) + return k_unknown_location; + else + return itr->second; +} + +uint32_t CompilerMSL::get_automatic_builtin_output_location(BuiltIn builtin) const +{ + auto itr = builtin_to_automatic_output_location.find(builtin); + if (itr == builtin_to_automatic_output_location.end()) + return k_unknown_location; + else + return itr->second; +} + +bool CompilerMSL::is_msl_resource_binding_used(ExecutionModel model, uint32_t desc_set, uint32_t binding) const +{ + StageSetBinding tuple = { model, desc_set, binding }; + auto itr = resource_bindings.find(tuple); + return itr != end(resource_bindings) && itr->second.second; +} + +bool CompilerMSL::is_var_runtime_size_array(const SPIRVariable &var) const +{ + auto& type = get_variable_data_type(var); + return is_runtime_size_array(type) && get_resource_array_size(type, var.self) == 0; +} + +// Returns the size of the array of resources used by the variable with the specified type and id. +// The size is first retrieved from the type, but in the case of runtime array sizing, +// the size is retrieved from the resource binding added using add_msl_resource_binding(). +uint32_t CompilerMSL::get_resource_array_size(const SPIRType &type, uint32_t id) const +{ + uint32_t array_size = to_array_size_literal(type); + + if (id == 0) + return array_size; + + // If we have argument buffers, we need to honor the ABI by using the correct array size + // from the layout. Only use shader declared size if we're not using argument buffers. + uint32_t desc_set = get_decoration(id, DecorationDescriptorSet); + if (!descriptor_set_is_argument_buffer(desc_set) && array_size) + return array_size; + + StageSetBinding tuple = { get_entry_point().model, desc_set, + get_decoration(id, DecorationBinding) }; + auto itr = resource_bindings.find(tuple); + return itr != end(resource_bindings) ? itr->second.first.count : array_size; +} + +uint32_t CompilerMSL::get_automatic_msl_resource_binding(uint32_t id) const +{ + return get_extended_decoration(id, SPIRVCrossDecorationResourceIndexPrimary); +} + +uint32_t CompilerMSL::get_automatic_msl_resource_binding_secondary(uint32_t id) const +{ + return get_extended_decoration(id, SPIRVCrossDecorationResourceIndexSecondary); +} + +uint32_t CompilerMSL::get_automatic_msl_resource_binding_tertiary(uint32_t id) const +{ + return get_extended_decoration(id, SPIRVCrossDecorationResourceIndexTertiary); +} + +uint32_t CompilerMSL::get_automatic_msl_resource_binding_quaternary(uint32_t id) const +{ + return get_extended_decoration(id, SPIRVCrossDecorationResourceIndexQuaternary); +} + +void CompilerMSL::set_fragment_output_components(uint32_t location, uint32_t components) +{ + fragment_output_components[location] = components; +} + +bool CompilerMSL::builtin_translates_to_nonarray(BuiltIn builtin) const +{ + return (builtin == BuiltInSampleMask); +} + +void CompilerMSL::build_implicit_builtins() +{ + bool need_sample_pos = active_input_builtins.get(BuiltInSamplePosition); + bool need_vertex_params = capture_output_to_buffer && get_execution_model() == ExecutionModelVertex && + !msl_options.vertex_for_tessellation; + bool need_tesc_params = is_tesc_shader(); + bool need_tese_params = is_tese_shader() && msl_options.raw_buffer_tese_input; + bool need_subgroup_mask = + active_input_builtins.get(BuiltInSubgroupEqMask) || active_input_builtins.get(BuiltInSubgroupGeMask) || + active_input_builtins.get(BuiltInSubgroupGtMask) || active_input_builtins.get(BuiltInSubgroupLeMask) || + active_input_builtins.get(BuiltInSubgroupLtMask); + bool need_subgroup_ge_mask = !msl_options.is_ios() && (active_input_builtins.get(BuiltInSubgroupGeMask) || + active_input_builtins.get(BuiltInSubgroupGtMask)); + bool need_multiview = get_execution_model() == ExecutionModelVertex && !msl_options.view_index_from_device_index && + msl_options.multiview_layered_rendering && + (msl_options.multiview || active_input_builtins.get(BuiltInViewIndex)); + bool need_dispatch_base = + msl_options.dispatch_base && get_execution_model() == ExecutionModelGLCompute && + (active_input_builtins.get(BuiltInWorkgroupId) || active_input_builtins.get(BuiltInGlobalInvocationId)); + bool need_grid_params = get_execution_model() == ExecutionModelVertex && msl_options.vertex_for_tessellation; + bool need_vertex_base_params = + need_grid_params && + (active_input_builtins.get(BuiltInVertexId) || active_input_builtins.get(BuiltInVertexIndex) || + active_input_builtins.get(BuiltInBaseVertex) || active_input_builtins.get(BuiltInInstanceId) || + active_input_builtins.get(BuiltInInstanceIndex) || active_input_builtins.get(BuiltInBaseInstance)); + bool need_local_invocation_index = + (msl_options.emulate_subgroups && active_input_builtins.get(BuiltInSubgroupId)) || is_mesh_shader() || + needs_workgroup_zero_init || needs_local_invocation_index; + bool need_workgroup_size = msl_options.emulate_subgroups && active_input_builtins.get(BuiltInNumSubgroups); + bool force_frag_depth_passthrough = + get_execution_model() == ExecutionModelFragment && !uses_explicit_early_fragment_test() && need_subpass_input && + msl_options.enable_frag_depth_builtin && msl_options.input_attachment_is_ds_attachment; + needs_point_size_output = + msl_options.enable_point_size_builtin && msl_options.enable_point_size_default && + entry_point_is_vertex(); + + if (need_subpass_input || need_sample_pos || need_subgroup_mask || need_vertex_params || need_tesc_params || + need_tese_params || need_multiview || need_dispatch_base || need_vertex_base_params || need_grid_params || + needs_sample_id || needs_subgroup_invocation_id || needs_subgroup_size || needs_helper_invocation || + has_additional_fixed_sample_mask() || need_local_invocation_index || need_workgroup_size || + force_frag_depth_passthrough || needs_point_size_output || is_mesh_shader()) + { + bool has_frag_coord = false; + bool has_sample_id = false; + bool has_vertex_idx = false; + bool has_base_vertex = false; + bool has_instance_idx = false; + bool has_base_instance = false; + bool has_invocation_id = false; + bool has_primitive_id = false; + bool has_subgroup_invocation_id = false; + bool has_subgroup_size = false; + bool has_view_idx = false; + bool has_layer = false; + bool has_helper_invocation = false; + bool has_local_invocation_index = false; + bool has_workgroup_size = false; + bool has_frag_depth = false; + bool has_point_size = false; + uint32_t workgroup_id_type = 0; + + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + if (var.storage != StorageClassInput && var.storage != StorageClassOutput) + return; + if (!interface_variable_exists_in_entry_point(var.self)) + return; + + auto &type = this->get(var.basetype); + if (needs_point_size_output && has_decoration(type.self, DecorationBlock)) + { + const auto member_count = static_cast(type.member_types.size()); + for (uint32_t i = 0; i < member_count; i++) + { + if (get_member_decoration(type.self, i, DecorationBuiltIn) == BuiltInPointSize) + { + has_point_size = true; + active_output_builtins.set(BuiltInPointSize); + break; + } + } + } + + if (!has_decoration(var.self, DecorationBuiltIn)) + return; + + BuiltIn builtin = ir.meta[var.self].decoration.builtin_type; + + if (var.storage == StorageClassOutput) + { + if (has_additional_fixed_sample_mask() && builtin == BuiltInSampleMask) + { + builtin_sample_mask_id = var.self; + mark_implicit_builtin(StorageClassOutput, BuiltInSampleMask, var.self); + does_shader_write_sample_mask = true; + } + + if (force_frag_depth_passthrough && builtin == BuiltInFragDepth) + { + builtin_frag_depth_id = var.self; + mark_implicit_builtin(StorageClassOutput, BuiltInFragDepth, var.self); + has_frag_depth = true; + } + } + + if (builtin == BuiltInPointSize) + { + has_point_size = true; + active_output_builtins.set(BuiltInPointSize); + } + + if (builtin == BuiltInPrimitivePointIndicesEXT || + builtin == BuiltInPrimitiveLineIndicesEXT || + builtin == BuiltInPrimitiveTriangleIndicesEXT) + { + builtin_mesh_primitive_indices_id = var.self; + } + + if (var.storage != StorageClassInput) + return; + + // Use Metal's native frame-buffer fetch API for subpass inputs. + if (need_subpass_input && (!msl_options.use_framebuffer_fetch_subpasses)) + { + switch (builtin) + { + case BuiltInFragCoord: + mark_implicit_builtin(StorageClassInput, BuiltInFragCoord, var.self); + builtin_frag_coord_id = var.self; + has_frag_coord = true; + break; + case BuiltInLayer: + if (!msl_options.arrayed_subpass_input || msl_options.multiview) + break; + mark_implicit_builtin(StorageClassInput, BuiltInLayer, var.self); + builtin_layer_id = var.self; + has_layer = true; + break; + case BuiltInViewIndex: + if (!msl_options.multiview) + break; + mark_implicit_builtin(StorageClassInput, BuiltInViewIndex, var.self); + builtin_view_idx_id = var.self; + has_view_idx = true; + break; + default: + break; + } + } + + if ((need_sample_pos || needs_sample_id) && builtin == BuiltInSampleId) + { + builtin_sample_id_id = var.self; + mark_implicit_builtin(StorageClassInput, BuiltInSampleId, var.self); + has_sample_id = true; + } + + if (need_vertex_params) + { + switch (builtin) + { + case BuiltInVertexIndex: + builtin_vertex_idx_id = var.self; + mark_implicit_builtin(StorageClassInput, BuiltInVertexIndex, var.self); + has_vertex_idx = true; + break; + case BuiltInBaseVertex: + builtin_base_vertex_id = var.self; + mark_implicit_builtin(StorageClassInput, BuiltInBaseVertex, var.self); + has_base_vertex = true; + break; + case BuiltInInstanceIndex: + builtin_instance_idx_id = var.self; + mark_implicit_builtin(StorageClassInput, BuiltInInstanceIndex, var.self); + has_instance_idx = true; + break; + case BuiltInBaseInstance: + builtin_base_instance_id = var.self; + mark_implicit_builtin(StorageClassInput, BuiltInBaseInstance, var.self); + has_base_instance = true; + break; + default: + break; + } + } + + if (need_tesc_params && builtin == BuiltInInvocationId) + { + builtin_invocation_id_id = var.self; + mark_implicit_builtin(StorageClassInput, BuiltInInvocationId, var.self); + has_invocation_id = true; + } + + if ((need_tesc_params || need_tese_params) && builtin == BuiltInPrimitiveId) + { + builtin_primitive_id_id = var.self; + mark_implicit_builtin(StorageClassInput, BuiltInPrimitiveId, var.self); + has_primitive_id = true; + } + + if (need_tese_params && builtin == BuiltInTessLevelOuter) + { + tess_level_outer_var_id = var.self; + } + + if (need_tese_params && builtin == BuiltInTessLevelInner) + { + tess_level_inner_var_id = var.self; + } + + if ((need_subgroup_mask || needs_subgroup_invocation_id) && builtin == BuiltInSubgroupLocalInvocationId) + { + builtin_subgroup_invocation_id_id = var.self; + mark_implicit_builtin(StorageClassInput, BuiltInSubgroupLocalInvocationId, var.self); + has_subgroup_invocation_id = true; + } + + if ((need_subgroup_ge_mask || needs_subgroup_size) && builtin == BuiltInSubgroupSize) + { + builtin_subgroup_size_id = var.self; + mark_implicit_builtin(StorageClassInput, BuiltInSubgroupSize, var.self); + has_subgroup_size = true; + } + + if (need_multiview) + { + switch (builtin) + { + case BuiltInInstanceIndex: + // The view index here is derived from the instance index. + builtin_instance_idx_id = var.self; + mark_implicit_builtin(StorageClassInput, BuiltInInstanceIndex, var.self); + has_instance_idx = true; + break; + case BuiltInBaseInstance: + // If a non-zero base instance is used, we need to adjust for it when calculating the view index. + builtin_base_instance_id = var.self; + mark_implicit_builtin(StorageClassInput, BuiltInBaseInstance, var.self); + has_base_instance = true; + break; + case BuiltInViewIndex: + builtin_view_idx_id = var.self; + mark_implicit_builtin(StorageClassInput, BuiltInViewIndex, var.self); + has_view_idx = true; + break; + default: + break; + } + } + + if (needs_helper_invocation && builtin == BuiltInHelperInvocation) + { + builtin_helper_invocation_id = var.self; + mark_implicit_builtin(StorageClassInput, BuiltInHelperInvocation, var.self); + has_helper_invocation = true; + } + + if (need_local_invocation_index && builtin == BuiltInLocalInvocationIndex) + { + builtin_local_invocation_index_id = var.self; + mark_implicit_builtin(StorageClassInput, BuiltInLocalInvocationIndex, var.self); + has_local_invocation_index = true; + } + + if (need_workgroup_size && builtin == BuiltInWorkgroupSize) + { + builtin_workgroup_size_id = var.self; + mark_implicit_builtin(StorageClassInput, BuiltInWorkgroupSize, var.self); + has_workgroup_size = true; + } + + // The base workgroup needs to have the same type and vector size + // as the workgroup or invocation ID, so keep track of the type that + // was used. + if (need_dispatch_base && workgroup_id_type == 0 && + (builtin == BuiltInWorkgroupId || builtin == BuiltInGlobalInvocationId)) + workgroup_id_type = var.basetype; + }); + + // Use Metal's native frame-buffer fetch API for subpass inputs. + if ((!has_frag_coord || (msl_options.multiview && !has_view_idx) || + (msl_options.arrayed_subpass_input && !msl_options.multiview && !has_layer)) && + (!msl_options.use_framebuffer_fetch_subpasses) && need_subpass_input) + { + if (!has_frag_coord) + { + uint32_t offset = ir.increase_bound_by(3); + uint32_t type_id = offset; + uint32_t type_ptr_id = offset + 1; + uint32_t var_id = offset + 2; + + // Create gl_FragCoord. + SPIRType vec4_type { OpTypeVector }; + vec4_type.basetype = SPIRType::Float; + vec4_type.width = 32; + vec4_type.vecsize = 4; + set(type_id, vec4_type); + + SPIRType vec4_type_ptr = vec4_type; + vec4_type_ptr.op = OpTypePointer; + vec4_type_ptr.pointer = true; + vec4_type_ptr.pointer_depth++; + vec4_type_ptr.parent_type = type_id; + vec4_type_ptr.storage = StorageClassInput; + auto &ptr_type = set(type_ptr_id, vec4_type_ptr); + ptr_type.self = type_id; + + set(var_id, type_ptr_id, StorageClassInput); + set_decoration(var_id, DecorationBuiltIn, BuiltInFragCoord); + builtin_frag_coord_id = var_id; + mark_implicit_builtin(StorageClassInput, BuiltInFragCoord, var_id); + } + + if (!has_layer && msl_options.arrayed_subpass_input && !msl_options.multiview) + { + uint32_t offset = ir.increase_bound_by(2); + uint32_t type_ptr_id = offset; + uint32_t var_id = offset + 1; + + // Create gl_Layer. + SPIRType uint_type_ptr = get_uint_type(); + uint_type_ptr.op = OpTypePointer; + uint_type_ptr.pointer = true; + uint_type_ptr.pointer_depth++; + uint_type_ptr.parent_type = get_uint_type_id(); + uint_type_ptr.storage = StorageClassInput; + auto &ptr_type = set(type_ptr_id, uint_type_ptr); + ptr_type.self = get_uint_type_id(); + + set(var_id, type_ptr_id, StorageClassInput); + set_decoration(var_id, DecorationBuiltIn, BuiltInLayer); + builtin_layer_id = var_id; + mark_implicit_builtin(StorageClassInput, BuiltInLayer, var_id); + } + + if (!has_view_idx && msl_options.multiview) + { + uint32_t offset = ir.increase_bound_by(2); + uint32_t type_ptr_id = offset; + uint32_t var_id = offset + 1; + + // Create gl_ViewIndex. + SPIRType uint_type_ptr = get_uint_type(); + uint_type_ptr.op = OpTypePointer; + uint_type_ptr.pointer = true; + uint_type_ptr.pointer_depth++; + uint_type_ptr.parent_type = get_uint_type_id(); + uint_type_ptr.storage = StorageClassInput; + auto &ptr_type = set(type_ptr_id, uint_type_ptr); + ptr_type.self = get_uint_type_id(); + + set(var_id, type_ptr_id, StorageClassInput); + set_decoration(var_id, DecorationBuiltIn, BuiltInViewIndex); + builtin_view_idx_id = var_id; + mark_implicit_builtin(StorageClassInput, BuiltInViewIndex, var_id); + } + } + + if (!has_sample_id && (need_sample_pos || needs_sample_id)) + { + uint32_t offset = ir.increase_bound_by(2); + uint32_t type_ptr_id = offset; + uint32_t var_id = offset + 1; + + // Create gl_SampleID. + SPIRType uint_type_ptr = get_uint_type(); + uint_type_ptr.op = OpTypePointer; + uint_type_ptr.pointer = true; + uint_type_ptr.pointer_depth++; + uint_type_ptr.parent_type = get_uint_type_id(); + uint_type_ptr.storage = StorageClassInput; + auto &ptr_type = set(type_ptr_id, uint_type_ptr); + ptr_type.self = get_uint_type_id(); + + set(var_id, type_ptr_id, StorageClassInput); + set_decoration(var_id, DecorationBuiltIn, BuiltInSampleId); + builtin_sample_id_id = var_id; + mark_implicit_builtin(StorageClassInput, BuiltInSampleId, var_id); + } + + if ((need_vertex_params && (!has_vertex_idx || !has_base_vertex || !has_instance_idx || !has_base_instance)) || + (need_multiview && (!has_instance_idx || !has_base_instance || !has_view_idx))) + { + uint32_t type_ptr_id = ir.increase_bound_by(1); + + SPIRType uint_type_ptr = get_uint_type(); + uint_type_ptr.op = OpTypePointer; + uint_type_ptr.pointer = true; + uint_type_ptr.pointer_depth++; + uint_type_ptr.parent_type = get_uint_type_id(); + uint_type_ptr.storage = StorageClassInput; + auto &ptr_type = set(type_ptr_id, uint_type_ptr); + ptr_type.self = get_uint_type_id(); + + if (need_vertex_params && !has_vertex_idx) + { + uint32_t var_id = ir.increase_bound_by(1); + + // Create gl_VertexIndex. + set(var_id, type_ptr_id, StorageClassInput); + set_decoration(var_id, DecorationBuiltIn, BuiltInVertexIndex); + builtin_vertex_idx_id = var_id; + mark_implicit_builtin(StorageClassInput, BuiltInVertexIndex, var_id); + } + + if (need_vertex_params && !has_base_vertex) + { + uint32_t var_id = ir.increase_bound_by(1); + + // Create gl_BaseVertex. + set(var_id, type_ptr_id, StorageClassInput); + set_decoration(var_id, DecorationBuiltIn, BuiltInBaseVertex); + builtin_base_vertex_id = var_id; + mark_implicit_builtin(StorageClassInput, BuiltInBaseVertex, var_id); + } + + if (!has_instance_idx) // Needed by both multiview and tessellation + { + uint32_t var_id = ir.increase_bound_by(1); + + // Create gl_InstanceIndex. + set(var_id, type_ptr_id, StorageClassInput); + set_decoration(var_id, DecorationBuiltIn, BuiltInInstanceIndex); + builtin_instance_idx_id = var_id; + mark_implicit_builtin(StorageClassInput, BuiltInInstanceIndex, var_id); + } + + if (!has_base_instance) // Needed by both multiview and tessellation + { + uint32_t var_id = ir.increase_bound_by(1); + + // Create gl_BaseInstance. + set(var_id, type_ptr_id, StorageClassInput); + set_decoration(var_id, DecorationBuiltIn, BuiltInBaseInstance); + builtin_base_instance_id = var_id; + mark_implicit_builtin(StorageClassInput, BuiltInBaseInstance, var_id); + } + + if (need_multiview && !has_view_idx) + { + uint32_t var_id = ir.increase_bound_by(1); + + // Create gl_ViewIndex. + set(var_id, type_ptr_id, StorageClassInput); + set_decoration(var_id, DecorationBuiltIn, BuiltInViewIndex); + builtin_view_idx_id = var_id; + mark_implicit_builtin(StorageClassInput, BuiltInViewIndex, var_id); + } + } + + if (need_multiview) + { + // Multiview shaders are not allowed to write to gl_Layer, ostensibly because + // it is implicitly written from gl_ViewIndex, but we have to do that explicitly. + // Note that we can't just abuse gl_ViewIndex for this purpose: it's an input, but + // gl_Layer is an output in vertex-pipeline shaders. + uint32_t type_ptr_out_id = ir.increase_bound_by(2); + SPIRType uint_type_ptr_out = get_uint_type(); + uint_type_ptr_out.op = OpTypePointer; + uint_type_ptr_out.pointer = true; + uint_type_ptr_out.pointer_depth++; + uint_type_ptr_out.parent_type = get_uint_type_id(); + uint_type_ptr_out.storage = StorageClassOutput; + auto &ptr_out_type = set(type_ptr_out_id, uint_type_ptr_out); + ptr_out_type.self = get_uint_type_id(); + uint32_t var_id = type_ptr_out_id + 1; + set(var_id, type_ptr_out_id, StorageClassOutput); + set_decoration(var_id, DecorationBuiltIn, BuiltInLayer); + builtin_layer_id = var_id; + mark_implicit_builtin(StorageClassOutput, BuiltInLayer, var_id); + } + + if ((need_tesc_params && (msl_options.multi_patch_workgroup || !has_invocation_id || !has_primitive_id)) || + (need_tese_params && !has_primitive_id) || need_grid_params) + { + uint32_t type_ptr_id = ir.increase_bound_by(1); + + SPIRType uint_type_ptr = get_uint_type(); + uint_type_ptr.op = OpTypePointer; + uint_type_ptr.pointer = true; + uint_type_ptr.pointer_depth++; + uint_type_ptr.parent_type = get_uint_type_id(); + uint_type_ptr.storage = StorageClassInput; + auto &ptr_type = set(type_ptr_id, uint_type_ptr); + ptr_type.self = get_uint_type_id(); + + if ((need_tesc_params && msl_options.multi_patch_workgroup) || need_grid_params) + { + uint32_t var_id = ir.increase_bound_by(1); + + // Create gl_GlobalInvocationID. + set(var_id, type_ptr_id, StorageClassInput); + set_decoration(var_id, DecorationBuiltIn, BuiltInGlobalInvocationId); + builtin_invocation_id_id = var_id; + mark_implicit_builtin(StorageClassInput, BuiltInGlobalInvocationId, var_id); + } + else if (need_tesc_params && !has_invocation_id) + { + uint32_t var_id = ir.increase_bound_by(1); + + // Create gl_InvocationID. + set(var_id, type_ptr_id, StorageClassInput); + set_decoration(var_id, DecorationBuiltIn, BuiltInInvocationId); + builtin_invocation_id_id = var_id; + mark_implicit_builtin(StorageClassInput, BuiltInInvocationId, var_id); + } + + if ((need_tesc_params || need_tese_params) && !has_primitive_id) + { + uint32_t var_id = ir.increase_bound_by(1); + + // Create gl_PrimitiveID. + set(var_id, type_ptr_id, StorageClassInput); + set_decoration(var_id, DecorationBuiltIn, BuiltInPrimitiveId); + builtin_primitive_id_id = var_id; + mark_implicit_builtin(StorageClassInput, BuiltInPrimitiveId, var_id); + } + + if (need_grid_params) + { + uint32_t var_id = ir.increase_bound_by(1); + + set(var_id, build_extended_vector_type(get_uint_type_id(), 3), StorageClassInput); + set_extended_decoration(var_id, SPIRVCrossDecorationBuiltInStageInputSize); + get_entry_point().interface_variables.push_back(var_id); + set_name(var_id, "spvStageInputSize"); + builtin_stage_input_size_id = var_id; + } + } + + if (!has_subgroup_invocation_id && (need_subgroup_mask || needs_subgroup_invocation_id)) + { + uint32_t offset = ir.increase_bound_by(2); + uint32_t type_ptr_id = offset; + uint32_t var_id = offset + 1; + + // Create gl_SubgroupInvocationID. + SPIRType uint_type_ptr = get_uint_type(); + uint_type_ptr.op = OpTypePointer; + uint_type_ptr.pointer = true; + uint_type_ptr.pointer_depth++; + uint_type_ptr.parent_type = get_uint_type_id(); + uint_type_ptr.storage = StorageClassInput; + auto &ptr_type = set(type_ptr_id, uint_type_ptr); + ptr_type.self = get_uint_type_id(); + + set(var_id, type_ptr_id, StorageClassInput); + set_decoration(var_id, DecorationBuiltIn, BuiltInSubgroupLocalInvocationId); + builtin_subgroup_invocation_id_id = var_id; + mark_implicit_builtin(StorageClassInput, BuiltInSubgroupLocalInvocationId, var_id); + } + + if (!has_subgroup_size && (need_subgroup_ge_mask || needs_subgroup_size)) + { + uint32_t offset = ir.increase_bound_by(2); + uint32_t type_ptr_id = offset; + uint32_t var_id = offset + 1; + + // Create gl_SubgroupSize. + SPIRType uint_type_ptr = get_uint_type(); + uint_type_ptr.op = OpTypePointer; + uint_type_ptr.pointer = true; + uint_type_ptr.pointer_depth++; + uint_type_ptr.parent_type = get_uint_type_id(); + uint_type_ptr.storage = StorageClassInput; + auto &ptr_type = set(type_ptr_id, uint_type_ptr); + ptr_type.self = get_uint_type_id(); + + set(var_id, type_ptr_id, StorageClassInput); + set_decoration(var_id, DecorationBuiltIn, BuiltInSubgroupSize); + builtin_subgroup_size_id = var_id; + mark_implicit_builtin(StorageClassInput, BuiltInSubgroupSize, var_id); + } + + if (need_dispatch_base || need_vertex_base_params) + { + if (workgroup_id_type == 0) + workgroup_id_type = build_extended_vector_type(get_uint_type_id(), 3); + uint32_t var_id; + if (msl_options.supports_msl_version(1, 2)) + { + // If we have MSL 1.2, we can (ab)use the [[grid_origin]] builtin + // to convey this information and save a buffer slot. + uint32_t offset = ir.increase_bound_by(1); + var_id = offset; + + set(var_id, workgroup_id_type, StorageClassInput); + set_extended_decoration(var_id, SPIRVCrossDecorationBuiltInDispatchBase); + get_entry_point().interface_variables.push_back(var_id); + } + else + { + // Otherwise, we need to fall back to a good ol' fashioned buffer. + uint32_t offset = ir.increase_bound_by(2); + var_id = offset; + uint32_t type_id = offset + 1; + + SPIRType var_type = get(workgroup_id_type); + var_type.storage = StorageClassUniform; + set(type_id, var_type); + + set(var_id, type_id, StorageClassUniform); + // This should never match anything. + set_decoration(var_id, DecorationDescriptorSet, ~(5u)); + set_decoration(var_id, DecorationBinding, msl_options.indirect_params_buffer_index); + set_extended_decoration(var_id, SPIRVCrossDecorationResourceIndexPrimary, + msl_options.indirect_params_buffer_index); + } + set_name(var_id, "spvDispatchBase"); + builtin_dispatch_base_id = var_id; + } + + if (has_additional_fixed_sample_mask() && !does_shader_write_sample_mask) + { + uint32_t offset = ir.increase_bound_by(2); + uint32_t var_id = offset + 1; + + // Create gl_SampleMask. + SPIRType uint_type_ptr_out = get_uint_type(); + uint_type_ptr_out.op = OpTypePointer; + uint_type_ptr_out.pointer = true; + uint_type_ptr_out.pointer_depth++; + uint_type_ptr_out.parent_type = get_uint_type_id(); + uint_type_ptr_out.storage = StorageClassOutput; + + auto &ptr_out_type = set(offset, uint_type_ptr_out); + ptr_out_type.self = get_uint_type_id(); + set(var_id, offset, StorageClassOutput); + set_decoration(var_id, DecorationBuiltIn, BuiltInSampleMask); + builtin_sample_mask_id = var_id; + mark_implicit_builtin(StorageClassOutput, BuiltInSampleMask, var_id); + } + + if (!has_helper_invocation && needs_helper_invocation) + { + uint32_t offset = ir.increase_bound_by(3); + uint32_t type_id = offset; + uint32_t type_ptr_id = offset + 1; + uint32_t var_id = offset + 2; + + // Create gl_HelperInvocation. + SPIRType bool_type { OpTypeBool }; + bool_type.basetype = SPIRType::Boolean; + bool_type.width = 8; + bool_type.vecsize = 1; + set(type_id, bool_type); + + SPIRType bool_type_ptr_in = bool_type; + bool_type_ptr_in.op = OpTypePointer; + bool_type_ptr_in.pointer = true; + bool_type_ptr_in.pointer_depth++; + bool_type_ptr_in.parent_type = type_id; + bool_type_ptr_in.storage = StorageClassInput; + + auto &ptr_in_type = set(type_ptr_id, bool_type_ptr_in); + ptr_in_type.self = type_id; + set(var_id, type_ptr_id, StorageClassInput); + set_decoration(var_id, DecorationBuiltIn, BuiltInHelperInvocation); + builtin_helper_invocation_id = var_id; + mark_implicit_builtin(StorageClassInput, BuiltInHelperInvocation, var_id); + } + + if (need_local_invocation_index && !has_local_invocation_index) + { + uint32_t offset = ir.increase_bound_by(2); + uint32_t type_ptr_id = offset; + uint32_t var_id = offset + 1; + + // Create gl_LocalInvocationIndex. + SPIRType uint_type_ptr = get_uint_type(); + uint_type_ptr.op = OpTypePointer; + uint_type_ptr.pointer = true; + uint_type_ptr.pointer_depth++; + uint_type_ptr.parent_type = get_uint_type_id(); + uint_type_ptr.storage = StorageClassInput; + + auto &ptr_type = set(type_ptr_id, uint_type_ptr); + ptr_type.self = get_uint_type_id(); + set(var_id, type_ptr_id, StorageClassInput); + set_decoration(var_id, DecorationBuiltIn, BuiltInLocalInvocationIndex); + builtin_local_invocation_index_id = var_id; + mark_implicit_builtin(StorageClassInput, BuiltInLocalInvocationIndex, var_id); + } + + if (need_workgroup_size && !has_workgroup_size) + { + auto &execution = get_entry_point(); + // First, check if the workgroup size _constant_ were defined. + // If it were, we don't need to do--in fact, shouldn't do--anything. + builtin_workgroup_size_id = execution.workgroup_size.constant; + if (builtin_workgroup_size_id == 0) + { + uint32_t var_id = ir.increase_bound_by(1); + + // Create gl_WorkgroupSize. + uint32_t type_id = build_extended_vector_type(get_uint_type_id(), 3); + // If we have LocalSize or LocalSizeId, use those to define the workgroup size. + if (execution.flags.get(ExecutionModeLocalSizeId)) + { + const SPIRConstant *init[] = { &get(execution.workgroup_size.id_x), + &get(execution.workgroup_size.id_y), + &get(execution.workgroup_size.id_z) }; + bool specialized = init[0]->specialization || init[1]->specialization || init[2]->specialization; + set(var_id, type_id, init, 3, specialized); + execution.workgroup_size.constant = var_id; + } + else if (execution.flags.get(ExecutionModeLocalSize)) + { + uint32_t offset = ir.increase_bound_by(3); + const SPIRConstant *init[] = { + &set(offset, get_uint_type_id(), execution.workgroup_size.x, false), + &set(offset + 1, get_uint_type_id(), execution.workgroup_size.y, false), + &set(offset + 2, get_uint_type_id(), execution.workgroup_size.z, false) + }; + set(var_id, type_id, init, 3, false); + execution.workgroup_size.constant = var_id; + } + else + { + uint32_t type_ptr_id = ir.increase_bound_by(1); + SPIRType uint_type_ptr = get(type_id); + uint_type_ptr.op = OpTypePointer; + uint_type_ptr.pointer = true; + uint_type_ptr.pointer_depth++; + uint_type_ptr.parent_type = type_id; + uint_type_ptr.storage = StorageClassInput; + + auto &ptr_type = set(type_ptr_id, uint_type_ptr); + ptr_type.self = type_id; + set(var_id, type_ptr_id, StorageClassInput); + mark_implicit_builtin(StorageClassInput, BuiltInWorkgroupSize, var_id); + } + set_decoration(var_id, DecorationBuiltIn, BuiltInWorkgroupSize); + builtin_workgroup_size_id = var_id; + } + } + + if (!has_frag_depth && force_frag_depth_passthrough) + { + uint32_t offset = ir.increase_bound_by(3); + uint32_t type_id = offset; + uint32_t type_ptr_id = offset + 1; + uint32_t var_id = offset + 2; + + // Create gl_FragDepth + SPIRType float_type { OpTypeFloat }; + float_type.basetype = SPIRType::Float; + float_type.width = 32; + float_type.vecsize = 1; + set(type_id, float_type); + + SPIRType float_type_ptr_in = float_type; + float_type_ptr_in.op = OpTypePointer; + float_type_ptr_in.pointer = true; + float_type_ptr_in.pointer_depth++; + float_type_ptr_in.parent_type = type_id; + float_type_ptr_in.storage = StorageClassOutput; + + auto &ptr_in_type = set(type_ptr_id, float_type_ptr_in); + ptr_in_type.self = type_id; + set(var_id, type_ptr_id, StorageClassOutput); + set_decoration(var_id, DecorationBuiltIn, BuiltInFragDepth); + builtin_frag_depth_id = var_id; + mark_implicit_builtin(StorageClassOutput, BuiltInFragDepth, var_id); + active_output_builtins.set(BuiltInFragDepth); + } + + if (!has_point_size && needs_point_size_output) + { + uint32_t offset = ir.increase_bound_by(3); + uint32_t type_id = offset; + uint32_t type_ptr_id = offset + 1; + uint32_t var_id = offset + 2; + + // Create gl_PointSize + SPIRType float_type { OpTypeFloat }; + float_type.basetype = SPIRType::Float; + float_type.width = 32; + float_type.vecsize = 1; + set(type_id, float_type); + + SPIRType float_type_ptr_in = float_type; + float_type_ptr_in.op = OpTypePointer; + float_type_ptr_in.pointer = true; + float_type_ptr_in.pointer_depth++; + float_type_ptr_in.parent_type = type_id; + float_type_ptr_in.storage = StorageClassOutput; + + auto &ptr_in_type = set(type_ptr_id, float_type_ptr_in); + ptr_in_type.self = type_id; + set(var_id, type_ptr_id, StorageClassOutput); + set_decoration(var_id, DecorationBuiltIn, BuiltInPointSize); + mark_implicit_builtin(StorageClassOutput, BuiltInPointSize, var_id); + } + } + + if (needs_swizzle_buffer_def) + { + uint32_t var_id = build_constant_uint_array_pointer(); + set_name(var_id, "spvSwizzleConstants"); + // This should never match anything. + set_decoration(var_id, DecorationDescriptorSet, kSwizzleBufferBinding); + set_decoration(var_id, DecorationBinding, msl_options.swizzle_buffer_index); + set_extended_decoration(var_id, SPIRVCrossDecorationResourceIndexPrimary, msl_options.swizzle_buffer_index); + swizzle_buffer_id = var_id; + } + + if (needs_buffer_size_buffer()) + { + uint32_t var_id = build_constant_uint_array_pointer(); + set_name(var_id, "spvBufferSizeConstants"); + // This should never match anything. + set_decoration(var_id, DecorationDescriptorSet, kBufferSizeBufferBinding); + set_decoration(var_id, DecorationBinding, msl_options.buffer_size_buffer_index); + set_extended_decoration(var_id, SPIRVCrossDecorationResourceIndexPrimary, msl_options.buffer_size_buffer_index); + buffer_size_buffer_id = var_id; + } + + if (needs_view_mask_buffer()) + { + uint32_t var_id = build_constant_uint_array_pointer(); + set_name(var_id, "spvViewMask"); + // This should never match anything. + set_decoration(var_id, DecorationDescriptorSet, ~(4u)); + set_decoration(var_id, DecorationBinding, msl_options.view_mask_buffer_index); + set_extended_decoration(var_id, SPIRVCrossDecorationResourceIndexPrimary, msl_options.view_mask_buffer_index); + view_mask_buffer_id = var_id; + } + + if (!buffers_requiring_dynamic_offset.empty()) + { + uint32_t var_id = build_constant_uint_array_pointer(); + set_name(var_id, "spvDynamicOffsets"); + // This should never match anything. + set_decoration(var_id, DecorationDescriptorSet, ~(5u)); + set_decoration(var_id, DecorationBinding, msl_options.dynamic_offsets_buffer_index); + set_extended_decoration(var_id, SPIRVCrossDecorationResourceIndexPrimary, + msl_options.dynamic_offsets_buffer_index); + dynamic_offsets_buffer_id = var_id; + } + + // If we're returning a struct from a vertex-like entry point, we must return a position attribute. + bool need_position = (get_execution_model() == ExecutionModelVertex || is_tese_shader()) && + !capture_output_to_buffer && !get_is_rasterization_disabled() && + !msl_options.auto_disable_rasterization && + !active_output_builtins.get(BuiltInPosition); + + if (need_position) + { + // If we can get away with returning void from entry point, we don't need to care. + // If there is at least one other stage output, we need to return [[position]], + // so we need to create one if it doesn't appear in the SPIR-V. Before adding the + // implicit variable, check if it actually exists already, but just has not been used + // or initialized, and if so, mark it as active, and do not create the implicit variable. + bool has_output = false; + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + if (var.storage == StorageClassOutput && interface_variable_exists_in_entry_point(var.self)) + { + has_output = true; + + // Check if the var is the Position builtin + if (has_decoration(var.self, DecorationBuiltIn) && get_decoration(var.self, DecorationBuiltIn) == BuiltInPosition) + active_output_builtins.set(BuiltInPosition); + + // If the var is a struct, check if any members is the Position builtin + auto &var_type = get_variable_element_type(var); + if (var_type.basetype == SPIRType::Struct) + { + auto mbr_cnt = var_type.member_types.size(); + for (uint32_t mbr_idx = 0; mbr_idx < mbr_cnt; mbr_idx++) + { + auto builtin = BuiltInMax; + bool is_builtin = is_member_builtin(var_type, mbr_idx, &builtin); + if (is_builtin && builtin == BuiltInPosition) + active_output_builtins.set(BuiltInPosition); + } + } + } + }); + need_position = has_output && !active_output_builtins.get(BuiltInPosition); + } + else if (!active_output_builtins.get(BuiltInPosition) && msl_options.auto_disable_rasterization) + { + is_rasterization_disabled = true; + } + + if (need_position) + { + uint32_t offset = ir.increase_bound_by(3); + uint32_t type_id = offset; + uint32_t type_ptr_id = offset + 1; + uint32_t var_id = offset + 2; + + // Create gl_Position. + SPIRType vec4_type { OpTypeVector }; + vec4_type.basetype = SPIRType::Float; + vec4_type.width = 32; + vec4_type.vecsize = 4; + set(type_id, vec4_type); + + SPIRType vec4_type_ptr = vec4_type; + vec4_type_ptr.op = OpTypePointer; + vec4_type_ptr.pointer = true; + vec4_type_ptr.pointer_depth++; + vec4_type_ptr.parent_type = type_id; + vec4_type_ptr.storage = StorageClassOutput; + auto &ptr_type = set(type_ptr_id, vec4_type_ptr); + ptr_type.self = type_id; + + set(var_id, type_ptr_id, StorageClassOutput); + set_decoration(var_id, DecorationBuiltIn, BuiltInPosition); + mark_implicit_builtin(StorageClassOutput, BuiltInPosition, var_id); + } + + if (is_mesh_shader()) + { + uint32_t offset = ir.increase_bound_by(2); + uint32_t type_ptr_id = offset; + uint32_t var_id = offset + 1; + + // Create variable to store meshlet size. + uint32_t type_id = build_extended_vector_type(get_uint_type_id(), 2); + SPIRType uint_type_ptr = get(type_id); + uint_type_ptr.op = OpTypePointer; + uint_type_ptr.pointer = true; + uint_type_ptr.pointer_depth++; + uint_type_ptr.parent_type = type_id; + uint_type_ptr.storage = StorageClassWorkgroup; + + auto &ptr_type = set(type_ptr_id, uint_type_ptr); + ptr_type.self = type_id; + set(var_id, type_ptr_id, StorageClassWorkgroup); + set_name(var_id, "spvMeshSizes"); + builtin_mesh_sizes_id = var_id; + } + + if (get_execution_model() == ExecutionModelTaskEXT) + { + uint32_t offset = ir.increase_bound_by(3); + uint32_t type_id = offset; + uint32_t type_ptr_id = offset + 1; + uint32_t var_id = offset + 2; + + SPIRType mesh_grid_type { OpTypeStruct }; + mesh_grid_type.basetype = SPIRType::MeshGridProperties; + set(type_id, mesh_grid_type); + + SPIRType mesh_grid_type_ptr = mesh_grid_type; + mesh_grid_type_ptr.op = OpTypePointer; + mesh_grid_type_ptr.pointer = true; + mesh_grid_type_ptr.pointer_depth++; + mesh_grid_type_ptr.parent_type = type_id; + mesh_grid_type_ptr.storage = StorageClassOutput; + + auto &ptr_in_type = set(type_ptr_id, mesh_grid_type_ptr); + ptr_in_type.self = type_id; + set(var_id, type_ptr_id, StorageClassOutput); + set_name(var_id, "spvMgp"); + builtin_task_grid_id = var_id; + } +} + +// Checks if the specified builtin variable (e.g. gl_InstanceIndex) is marked as active. +// If not, it marks it as active and forces a recompilation. +// This might be used when the optimization of inactive builtins was too optimistic (e.g. when "spvOut" is emitted). +void CompilerMSL::ensure_builtin(StorageClass storage, BuiltIn builtin) +{ + Bitset *active_builtins = nullptr; + switch (storage) + { + case StorageClassInput: + active_builtins = &active_input_builtins; + break; + + case StorageClassOutput: + active_builtins = &active_output_builtins; + break; + + default: + break; + } + + // At this point, the specified builtin variable must have already been declared in the entry point. + // If not, mark as active and force recompile. + if (active_builtins != nullptr && !active_builtins->get(builtin)) + { + active_builtins->set(builtin); + force_recompile(); + } +} + +void CompilerMSL::mark_implicit_builtin(StorageClass storage, BuiltIn builtin, uint32_t id) +{ + Bitset *active_builtins = nullptr; + switch (storage) + { + case StorageClassInput: + active_builtins = &active_input_builtins; + break; + + case StorageClassOutput: + active_builtins = &active_output_builtins; + break; + + default: + break; + } + + assert(active_builtins != nullptr); + active_builtins->set(builtin); + + auto &var = get_entry_point().interface_variables; + if (find(begin(var), end(var), VariableID(id)) == end(var)) + var.push_back(id); +} + +uint32_t CompilerMSL::build_constant_uint_array_pointer() +{ + uint32_t offset = ir.increase_bound_by(3); + uint32_t type_ptr_id = offset; + uint32_t type_ptr_ptr_id = offset + 1; + uint32_t var_id = offset + 2; + + // Create a buffer to hold extra data, including the swizzle constants. + SPIRType uint_type_pointer = get_uint_type(); + uint_type_pointer.op = OpTypePointer; + uint_type_pointer.pointer = true; + uint_type_pointer.pointer_depth++; + uint_type_pointer.parent_type = get_uint_type_id(); + uint_type_pointer.storage = StorageClassUniform; + set(type_ptr_id, uint_type_pointer); + set_decoration(type_ptr_id, DecorationArrayStride, 4); + + SPIRType uint_type_pointer2 = uint_type_pointer; + uint_type_pointer2.pointer_depth++; + uint_type_pointer2.parent_type = type_ptr_id; + set(type_ptr_ptr_id, uint_type_pointer2); + + set(var_id, type_ptr_ptr_id, StorageClassUniformConstant); + return var_id; +} + +static string create_sampler_address(const char *prefix, MSLSamplerAddress addr) +{ + switch (addr) + { + case MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE: + return join(prefix, "address::clamp_to_edge"); + case MSL_SAMPLER_ADDRESS_CLAMP_TO_ZERO: + return join(prefix, "address::clamp_to_zero"); + case MSL_SAMPLER_ADDRESS_CLAMP_TO_BORDER: + return join(prefix, "address::clamp_to_border"); + case MSL_SAMPLER_ADDRESS_REPEAT: + return join(prefix, "address::repeat"); + case MSL_SAMPLER_ADDRESS_MIRRORED_REPEAT: + return join(prefix, "address::mirrored_repeat"); + default: + SPIRV_CROSS_THROW("Invalid sampler addressing mode."); + } +} + +SPIRType &CompilerMSL::get_stage_in_struct_type() +{ + auto &si_var = get(stage_in_var_id); + return get_variable_data_type(si_var); +} + +SPIRType &CompilerMSL::get_stage_out_struct_type() +{ + auto &so_var = get(stage_out_var_id); + return get_variable_data_type(so_var); +} + +SPIRType &CompilerMSL::get_patch_stage_in_struct_type() +{ + auto &si_var = get(patch_stage_in_var_id); + return get_variable_data_type(si_var); +} + +SPIRType &CompilerMSL::get_patch_stage_out_struct_type() +{ + auto &so_var = get(patch_stage_out_var_id); + return get_variable_data_type(so_var); +} + +std::string CompilerMSL::get_tess_factor_struct_name() +{ + if (is_tessellating_triangles()) + return "MTLTriangleTessellationFactorsHalf"; + return "MTLQuadTessellationFactorsHalf"; +} + +SPIRType &CompilerMSL::get_uint_type() +{ + return get(get_uint_type_id()); +} + +uint32_t CompilerMSL::get_uint_type_id() +{ + if (uint_type_id != 0) + return uint_type_id; + + uint_type_id = ir.increase_bound_by(1); + + SPIRType type { OpTypeInt }; + type.basetype = SPIRType::UInt; + type.width = 32; + set(uint_type_id, type); + return uint_type_id; +} + +void CompilerMSL::emit_entry_point_declarations() +{ + // FIXME: Get test coverage here ... + // Constant arrays of non-primitive types (i.e. matrices) won't link properly into Metal libraries + declare_complex_constant_arrays(); + + // Emit constexpr samplers here. + for (auto &samp : constexpr_samplers_by_id) + { + auto &var = get(samp.first); + auto &type = get(var.basetype); + if (type.basetype == SPIRType::Sampler) + add_resource_name(samp.first); + + SmallVector args; + auto &s = samp.second; + + if (s.coord != MSL_SAMPLER_COORD_NORMALIZED) + args.push_back("coord::pixel"); + + if (s.min_filter == s.mag_filter) + { + if (s.min_filter != MSL_SAMPLER_FILTER_NEAREST) + args.push_back("filter::linear"); + } + else + { + if (s.min_filter != MSL_SAMPLER_FILTER_NEAREST) + args.push_back("min_filter::linear"); + if (s.mag_filter != MSL_SAMPLER_FILTER_NEAREST) + args.push_back("mag_filter::linear"); + } + + switch (s.mip_filter) + { + case MSL_SAMPLER_MIP_FILTER_NONE: + // Default + break; + case MSL_SAMPLER_MIP_FILTER_NEAREST: + args.push_back("mip_filter::nearest"); + break; + case MSL_SAMPLER_MIP_FILTER_LINEAR: + args.push_back("mip_filter::linear"); + break; + default: + SPIRV_CROSS_THROW("Invalid mip filter."); + } + + if (s.s_address == s.t_address && s.s_address == s.r_address) + { + if (s.s_address != MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE) + args.push_back(create_sampler_address("", s.s_address)); + } + else + { + if (s.s_address != MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE) + args.push_back(create_sampler_address("s_", s.s_address)); + if (s.t_address != MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE) + args.push_back(create_sampler_address("t_", s.t_address)); + if (s.r_address != MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE) + args.push_back(create_sampler_address("r_", s.r_address)); + } + + if (s.compare_enable) + { + switch (s.compare_func) + { + case MSL_SAMPLER_COMPARE_FUNC_ALWAYS: + args.push_back("compare_func::always"); + break; + case MSL_SAMPLER_COMPARE_FUNC_NEVER: + args.push_back("compare_func::never"); + break; + case MSL_SAMPLER_COMPARE_FUNC_EQUAL: + args.push_back("compare_func::equal"); + break; + case MSL_SAMPLER_COMPARE_FUNC_NOT_EQUAL: + args.push_back("compare_func::not_equal"); + break; + case MSL_SAMPLER_COMPARE_FUNC_LESS: + args.push_back("compare_func::less"); + break; + case MSL_SAMPLER_COMPARE_FUNC_LESS_EQUAL: + args.push_back("compare_func::less_equal"); + break; + case MSL_SAMPLER_COMPARE_FUNC_GREATER: + args.push_back("compare_func::greater"); + break; + case MSL_SAMPLER_COMPARE_FUNC_GREATER_EQUAL: + args.push_back("compare_func::greater_equal"); + break; + default: + SPIRV_CROSS_THROW("Invalid sampler compare function."); + } + } + + if (s.s_address == MSL_SAMPLER_ADDRESS_CLAMP_TO_BORDER || s.t_address == MSL_SAMPLER_ADDRESS_CLAMP_TO_BORDER || + s.r_address == MSL_SAMPLER_ADDRESS_CLAMP_TO_BORDER) + { + switch (s.border_color) + { + case MSL_SAMPLER_BORDER_COLOR_OPAQUE_BLACK: + args.push_back("border_color::opaque_black"); + break; + case MSL_SAMPLER_BORDER_COLOR_OPAQUE_WHITE: + args.push_back("border_color::opaque_white"); + break; + case MSL_SAMPLER_BORDER_COLOR_TRANSPARENT_BLACK: + args.push_back("border_color::transparent_black"); + break; + default: + SPIRV_CROSS_THROW("Invalid sampler border color."); + } + } + + if (s.anisotropy_enable) + args.push_back(join("max_anisotropy(", s.max_anisotropy, ")")); + if (s.lod_clamp_enable) + { + args.push_back(join("lod_clamp(", format_float(s.lod_clamp_min), ", ", format_float(s.lod_clamp_max), ")")); + } + + // If we would emit no arguments, then omit the parentheses entirely. Otherwise, + // we'll wind up with a "most vexing parse" situation. + if (args.empty()) + statement("constexpr sampler ", + type.basetype == SPIRType::SampledImage ? to_sampler_expression(samp.first) : to_name(samp.first), + ";"); + else + statement("constexpr sampler ", + type.basetype == SPIRType::SampledImage ? to_sampler_expression(samp.first) : to_name(samp.first), + "(", merge(args), ");"); + } + + // Emit dynamic buffers here. + for (auto &dynamic_buffer : buffers_requiring_dynamic_offset) + { + if (!dynamic_buffer.second.var_id) + { + // Could happen if no buffer was used at requested binding point. + continue; + } + + const auto &var = get(dynamic_buffer.second.var_id); + uint32_t var_id = var.self; + const auto &type = get_variable_data_type(var); + + add_local_variable_name(var.self); + string name = to_name(var.self); + + uint32_t desc_set = get_decoration(var.self, DecorationDescriptorSet); + uint32_t arg_id = argument_buffer_ids[desc_set]; + uint32_t base_index = dynamic_buffer.second.base_index; + + if (is_array(type)) + { + is_using_builtin_array = true; + statement(get_variable_address_space(var), " ", type_to_glsl(type), "* ", to_restrict(var_id, true), name, + type_to_array_glsl(type, var_id), " ="); + + uint32_t array_size = get_resource_array_size(type, var_id); + if (array_size == 0) + SPIRV_CROSS_THROW("Size of runtime array with dynamic offset could not be determined from resource bindings."); + + begin_scope(); + + for (uint32_t i = 0; i < array_size; i++) + { + statement("(", get_variable_address_space(var), " ", type_to_glsl(type), "* ", + to_restrict(var_id, false), ")((", get_variable_address_space(var), " char* ", + to_restrict(var_id, false), ")", to_name(arg_id), ".", dynamic_buffer.second.mbr_name, + "[", i, "]", " + ", to_name(dynamic_offsets_buffer_id), "[", base_index + i, "]),"); + } + + end_scope_decl(); + statement_no_indent(""); + is_using_builtin_array = false; + } + else + { + statement(get_variable_address_space(var), " auto& ", to_restrict(var_id, true), name, " = *(", + get_variable_address_space(var), " ", type_to_glsl(type), "* ", to_restrict(var_id, false), ")((", + get_variable_address_space(var), " char* ", to_restrict(var_id, false), ")", to_name(arg_id), ".", + dynamic_buffer.second.mbr_name, " + ", to_name(dynamic_offsets_buffer_id), "[", base_index, "]);"); + } + } + + bool has_runtime_array_declaration = false; + for (SPIRVariable *arg : entry_point_bindings) + { + const auto &var = *arg; + const auto &type = get_variable_data_type(var); + const auto &buffer_type = get_variable_element_type(var); + + // This has already been added as a resource name. + const string name = to_name(var.self); + + if (is_var_runtime_size_array(var)) + { + if (msl_options.argument_buffers_tier < Options::ArgumentBuffersTier::Tier2) + { + SPIRV_CROSS_THROW("Unsized array of descriptors requires argument buffer tier 2"); + } + + string resource_name; + + if (descriptor_set_is_argument_buffer(get_decoration(var.self, DecorationDescriptorSet))) + { + resource_name = ir.meta[var.self].decoration.qualified_alias; + } + else + { + bool is_aliased = std::find_if(buffer_aliases_discrete.begin(), buffer_aliases_discrete.end(), + [&](uint32_t id) { return var.self == id; }) != buffer_aliases_discrete.end(); + + uint32_t desc_set = get_decoration(var.self, DecorationDescriptorSet); + uint32_t desc_binding = get_decoration(var.self, DecorationBinding); + + if (is_aliased) + resource_name = join("spvBufferAliasSet", desc_set, "Binding", desc_binding); + else + resource_name = join("spvDescriptorSet", desc_set, "Binding", desc_binding); + } + + switch (type.basetype) + { + case SPIRType::Image: + case SPIRType::Sampler: + case SPIRType::AccelerationStructure: + statement("spvDescriptorArray<", type_to_glsl(buffer_type, var.self), "> ", name, " {", resource_name, "};"); + break; + case SPIRType::SampledImage: + statement("spvDescriptorArray<", type_to_glsl(buffer_type, var.self), "> ", name, " {", resource_name, "};"); + // Unsupported with argument buffer for now. + statement("spvDescriptorArray ", name, "Smplr {", resource_name, "Smplr};"); + break; + case SPIRType::Struct: + statement("spvDescriptorArray<", get_variable_address_space(var), " ", type_to_glsl(buffer_type), "*> ", + name, " {", resource_name, "};"); + break; + default: + break; + } + has_runtime_array_declaration = true; + } + else if (!type.array.empty() && type.basetype == SPIRType::Struct) + { + // Emit only buffer arrays here. + statement(get_variable_address_space(var), " ", type_to_glsl(buffer_type), "* ", + to_restrict(var.self, true), name, "[] ="); + begin_scope(); + uint32_t array_size = get_resource_array_size(type, var.self); + for (uint32_t i = 0; i < array_size; ++i) + statement(name, "_", i, ","); + end_scope_decl(); + statement_no_indent(""); + } + } + + if (has_runtime_array_declaration) + statement_no_indent(""); + + // Emit buffer aliases here. + for (auto &var_id : buffer_aliases_discrete) + { + const auto &var = get(var_id); + + // We already declare this alias in a different way. + if (is_var_runtime_size_array(var)) + continue; + + const auto &type = get_variable_data_type(var); + auto addr_space = get_variable_address_space(var); + // This resource name has already been added. + auto name = to_name(var_id); + + uint32_t desc_set = get_decoration(var_id, DecorationDescriptorSet); + uint32_t desc_binding = get_decoration(var_id, DecorationBinding); + auto alias_name = join("spvBufferAliasSet", desc_set, "Binding", desc_binding); + + statement(addr_space, " auto& ", to_restrict(var_id, true), + name, + " = *(", addr_space, " ", type_to_glsl(type), "*)", alias_name, ";"); + } + // Discrete descriptors are processed in entry point emission every compiler iteration. + buffer_aliases_discrete.clear(); + + // Emit disabled fragment outputs. + std::sort(disabled_frag_outputs.begin(), disabled_frag_outputs.end()); + for (uint32_t var_id : disabled_frag_outputs) + { + auto &var = get(var_id); + add_local_variable_name(var_id); + statement(CompilerGLSL::variable_decl(var), ";"); + var.deferred_declaration = false; + } + + // Holds SetMeshOutputsEXT information. Threadgroup since first thread wins. + if (processing_entry_point && is_mesh_shader()) + statement("threadgroup uint2 spvMeshSizes;"); +} + +string CompilerMSL::compile() +{ + replace_illegal_entry_point_names(); + ir.fixup_reserved_names(); + + // Do not deal with GLES-isms like precision, older extensions and such. + options.vulkan_semantics = true; + options.es = false; + options.version = 450; + backend.null_pointer_literal = "nullptr"; + backend.float_literal_suffix = false; + backend.uint32_t_literal_suffix = true; + backend.int16_t_literal_suffix = ""; + backend.uint16_t_literal_suffix = ""; + backend.basic_int_type = "int"; + backend.basic_uint_type = "uint"; + backend.basic_int8_type = "char"; + backend.basic_uint8_type = "uchar"; + backend.basic_int16_type = "short"; + backend.basic_uint16_type = "ushort"; + backend.boolean_mix_function = "select"; + backend.printf_function = "os_log_default.log"; + backend.swizzle_is_function = false; + backend.shared_is_implied = false; + backend.use_initializer_list = true; + backend.use_typed_initializer_list = true; + backend.native_row_major_matrix = false; + backend.unsized_array_supported = false; + backend.can_declare_arrays_inline = false; + backend.allow_truncated_access_chain = true; + backend.comparison_image_samples_scalar = true; + backend.native_pointers = true; + backend.nonuniform_qualifier = ""; + backend.support_small_type_sampling_result = true; + backend.force_merged_mesh_block = false; + backend.force_gl_in_out_block = false; + backend.supports_empty_struct = true; + backend.support_64bit_switch = true; + backend.boolean_in_struct_remapped_type = SPIRType::Short; + + // Allow Metal to use the array template unless we force it off. + backend.can_return_array = !msl_options.force_native_arrays; + backend.array_is_value_type = !msl_options.force_native_arrays; + // Arrays which are part of buffer objects are never considered to be value types (just plain C-style). + backend.array_is_value_type_in_buffer_blocks = false; + backend.support_pointer_to_pointer = true; + backend.implicit_c_integer_promotion_rules = true; + backend.supports_spec_constant_array_size = false; + + capture_output_to_buffer = msl_options.capture_output_to_buffer; + is_rasterization_disabled = msl_options.disable_rasterization || capture_output_to_buffer; + + if (is_mesh_shader() && !get_entry_point().flags.get(ExecutionModeOutputPoints)) + msl_options.enable_point_size_builtin = false; + + // Initialize array here rather than constructor, MSVC 2013 workaround. + for (auto &id : next_metal_resource_ids) + id = 0; + + fixup_anonymous_struct_names(); + fixup_type_alias(); + replace_illegal_names(); + if (get_execution_model() == ExecutionModelMeshEXT) + { + // Emit proxy entry-point for the sake of copy-pass + emit_mesh_entry_point(); + } + sync_entry_point_aliases_and_names(); + + build_function_control_flow_graphs_and_analyze(); + update_active_builtins(); + analyze_image_and_sampler_usage(); + analyze_sampled_image_usage(); + analyze_interlocked_resource_usage(); + analyze_workgroup_variables(); + preprocess_op_codes(); + build_implicit_builtins(); + + if (needs_manual_helper_invocation_updates() && needs_helper_invocation) + { + string builtin_helper_invocation = builtin_to_glsl(BuiltInHelperInvocation, StorageClassInput); + string discard_expr = join(builtin_helper_invocation, " = true, discard_fragment()"); + if (msl_options.force_fragment_with_side_effects_execution) + discard_expr = join("!", builtin_helper_invocation, " ? (", discard_expr, ") : (void)0"); + backend.discard_literal = discard_expr; + backend.demote_literal = discard_expr; + } + else + { + backend.discard_literal = "discard_fragment()"; + backend.demote_literal = "discard_fragment()"; + } + + fixup_image_load_store_access(); + + set_enabled_interface_variables(get_active_interface_variables()); + if (msl_options.force_active_argument_buffer_resources) + activate_argument_buffer_resources(); + + if (swizzle_buffer_id) + add_active_interface_variable(swizzle_buffer_id); + if (buffer_size_buffer_id) + add_active_interface_variable(buffer_size_buffer_id); + if (view_mask_buffer_id) + add_active_interface_variable(view_mask_buffer_id); + if (dynamic_offsets_buffer_id) + add_active_interface_variable(dynamic_offsets_buffer_id); + if (builtin_layer_id) + add_active_interface_variable(builtin_layer_id); + if (builtin_dispatch_base_id && !msl_options.supports_msl_version(1, 2)) + add_active_interface_variable(builtin_dispatch_base_id); + if (builtin_sample_mask_id) + add_active_interface_variable(builtin_sample_mask_id); + if (builtin_frag_depth_id) + add_active_interface_variable(builtin_frag_depth_id); + + // Create structs to hold input, output and uniform variables. + // Do output first to ensure out. is declared at top of entry function. + qual_pos_var_name = ""; + if (is_mesh_shader()) + { + fixup_implicit_builtin_block_names(get_execution_model()); + } + else + { + stage_out_var_id = add_interface_block(StorageClassOutput); + patch_stage_out_var_id = add_interface_block(StorageClassOutput, true); + stage_in_var_id = add_interface_block(StorageClassInput); + } + + if (is_tese_shader()) + patch_stage_in_var_id = add_interface_block(StorageClassInput, true); + + if (is_tesc_shader()) + stage_out_ptr_var_id = add_interface_block_pointer(stage_out_var_id, StorageClassOutput); + if (is_tessellation_shader()) + stage_in_ptr_var_id = add_interface_block_pointer(stage_in_var_id, StorageClassInput); + + if (is_mesh_shader()) + { + mesh_out_per_vertex = add_meshlet_block(false); + mesh_out_per_primitive = add_meshlet_block(true); + } + + // Metal vertex functions that define no output must disable rasterization and return void. + if (!stage_out_var_id) + is_rasterization_disabled = true; + + // Convert the use of global variables to recursively-passed function parameters + localize_global_variables(); + extract_global_variables_from_functions(); + + // Mark any non-stage-in structs to be tightly packed. + mark_packable_structs(); + reorder_type_alias(); + + // Add fixup hooks required by shader inputs and outputs. This needs to happen before + // the loop, so the hooks aren't added multiple times. + fix_up_shader_inputs_outputs(); + + // If we are using argument buffers, we create argument buffer structures for them here. + // These buffers will be used in the entry point, not the individual resources. + if (msl_options.argument_buffers) + { + if (!msl_options.supports_msl_version(2, 0)) + SPIRV_CROSS_THROW("Argument buffers can only be used with MSL 2.0 and up."); + analyze_argument_buffers(); + } + + uint32_t pass_count = 0; + do + { + reset(pass_count); + + // Start bindings at zero. + next_metal_resource_index_buffer = 0; + next_metal_resource_index_texture = 0; + next_metal_resource_index_sampler = 0; + for (auto &id : next_metal_resource_ids) + id = 0; + + // Move constructor for this type is broken on GCC 4.9 ... + buffer.reset(); + + emit_header(); + emit_custom_templates(); + emit_custom_functions(); + emit_specialization_constants_and_structs(); + emit_resources(); + emit_function(get(ir.default_entry_point), Bitset()); + + pass_count++; + } while (is_forcing_recompilation()); + + return buffer.str(); +} + +// Register the need to output any custom functions. +void CompilerMSL::preprocess_op_codes() +{ + OpCodePreprocessor preproc(*this); + traverse_all_reachable_opcodes(get(ir.default_entry_point), preproc); + + suppress_missing_prototypes = preproc.suppress_missing_prototypes; + + if (preproc.uses_atomics) + { + add_header_line("#include "); + add_pragma_line("#pragma clang diagnostic ignored \"-Wunused-variable\"", false); + } + + // Before MSL 2.1 (2.2 for textures), Metal vertex functions that write to + // resources must disable rasterization and return void. + if ((preproc.uses_buffer_write && !msl_options.supports_msl_version(2, 1)) || + (preproc.uses_image_write && !msl_options.supports_msl_version(2, 2))) + is_rasterization_disabled = true; + + // FIXME: This currently does not consider BDA side effects, so we cannot deduce const device for BDA. + has_descriptor_side_effects_buffer = preproc.uses_buffer_write; + + // Tessellation control shaders are run as compute functions in Metal, and so + // must capture their output to a buffer. + if (is_tesc_shader() || (get_execution_model() == ExecutionModelVertex && msl_options.vertex_for_tessellation)) + { + is_rasterization_disabled = true; + capture_output_to_buffer = true; + } + + if (preproc.needs_local_invocation_index) + needs_local_invocation_index = true; + if (preproc.needs_subgroup_invocation_id) + needs_subgroup_invocation_id = true; + if (preproc.needs_subgroup_size) + needs_subgroup_size = true; + // build_implicit_builtins() hasn't run yet, and in fact, this needs to execute + // before then so that gl_SampleID will get added; so we also need to check if + // that function would add gl_FragCoord. + if (preproc.needs_sample_id || msl_options.force_sample_rate_shading || + (is_sample_rate() && (active_input_builtins.get(BuiltInFragCoord) || + (need_subpass_input_ms && !msl_options.use_framebuffer_fetch_subpasses)))) + needs_sample_id = true; + if (preproc.needs_helper_invocation || active_input_builtins.get(BuiltInHelperInvocation)) + needs_helper_invocation = true; + + // OpKill is removed by the parser, so we need to identify those by inspecting + // blocks. + ir.for_each_typed_id([&preproc](uint32_t, SPIRBlock &block) { + if (block.terminator == SPIRBlock::Kill) + preproc.uses_discard = true; + }); + + // Fragment shaders that both write to storage resources and discard fragments + // need checks on the writes, to work around Metal allowing these writes despite + // the fragment being dead. We also require to force Metal to execute fragment + // shaders instead of being prematurely discarded. + if (preproc.uses_discard && (preproc.uses_buffer_write || preproc.uses_image_write)) + { + bool should_enable = (msl_options.check_discarded_frag_stores || msl_options.force_fragment_with_side_effects_execution); + frag_shader_needs_discard_checks |= msl_options.check_discarded_frag_stores; + needs_helper_invocation |= should_enable; + // Fragment discard store checks imply manual HelperInvocation updates. + msl_options.manual_helper_invocation_updates |= should_enable; + } + + if (is_intersection_query()) + { + add_header_line("#if __METAL_VERSION__ >= 230"); + add_header_line("#include "); + add_header_line("using namespace metal::raytracing;"); + add_header_line("#endif"); + } +} + +// Move the Private and Workgroup global variables to the entry function. +// Non-constant variables cannot have global scope in Metal. +void CompilerMSL::localize_global_variables() +{ + auto &entry_func = get(ir.default_entry_point); + auto iter = global_variables.begin(); + while (iter != global_variables.end()) + { + uint32_t v_id = *iter; + auto &var = get(v_id); + if (var.storage == StorageClassPrivate || var.storage == StorageClassWorkgroup || + var.storage == StorageClassTaskPayloadWorkgroupEXT) + { + if (!variable_is_lut(var)) + entry_func.add_local_variable(v_id); + iter = global_variables.erase(iter); + } + else if (var.storage == StorageClassOutput && is_mesh_shader()) + { + entry_func.add_local_variable(v_id); + iter = global_variables.erase(iter); + } + else + iter++; + } +} + +// For any global variable accessed directly by a function, +// extract that variable and add it as an argument to that function. +void CompilerMSL::extract_global_variables_from_functions() +{ + // Uniforms + unordered_set global_var_ids; + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + // Some builtins resolve directly to a function call which does not need any declared variables. + // Skip these. + if (var.storage == StorageClassInput && has_decoration(var.self, DecorationBuiltIn)) + { + auto bi_type = BuiltIn(get_decoration(var.self, DecorationBuiltIn)); + if (bi_type == BuiltInHelperInvocation && !needs_manual_helper_invocation_updates()) + return; + if (bi_type == BuiltInHelperInvocation && needs_manual_helper_invocation_updates()) + { + if (msl_options.is_ios() && !msl_options.supports_msl_version(2, 3)) + SPIRV_CROSS_THROW("simd_is_helper_thread() requires version 2.3 on iOS."); + else if (msl_options.is_macos() && !msl_options.supports_msl_version(2, 1)) + SPIRV_CROSS_THROW("simd_is_helper_thread() requires version 2.1 on macOS."); + // Make sure this is declared and initialized. + // Force this to have the proper name. + set_name(var.self, builtin_to_glsl(BuiltInHelperInvocation, StorageClassInput)); + auto &entry_func = this->get(ir.default_entry_point); + entry_func.add_local_variable(var.self); + vars_needing_early_declaration.push_back(var.self); + entry_func.fixup_hooks_in.push_back([this, &var]() + { statement(to_name(var.self), " = simd_is_helper_thread();"); }); + } + } + + if (var.storage == StorageClassInput || var.storage == StorageClassOutput || + var.storage == StorageClassUniform || var.storage == StorageClassUniformConstant || + var.storage == StorageClassPushConstant || var.storage == StorageClassStorageBuffer) + { + global_var_ids.insert(var.self); + } + }); + + // Local vars that are declared in the main function and accessed directly by a function + auto &entry_func = get(ir.default_entry_point); + for (auto &var : entry_func.local_variables) + if (get(var).storage != StorageClassFunction) + global_var_ids.insert(var); + + std::set added_arg_ids; + unordered_set processed_func_ids; + extract_global_variables_from_function(ir.default_entry_point, added_arg_ids, global_var_ids, processed_func_ids); +} + +// MSL does not support the use of global variables for shader input content. +// For any global variable accessed directly by the specified function, extract that variable, +// add it as an argument to that function, and the arg to the added_arg_ids collection. +void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std::set &added_arg_ids, + unordered_set &global_var_ids, + unordered_set &processed_func_ids) +{ + // Avoid processing a function more than once + if (processed_func_ids.find(func_id) != processed_func_ids.end()) + { + // Return function global variables + added_arg_ids = function_global_vars[func_id]; + return; + } + + processed_func_ids.insert(func_id); + + auto &func = get(func_id); + + // Recursively establish global args added to functions on which we depend. + for (auto block : func.blocks) + { + auto &b = get(block); + for (auto &i : b.ops) + { + auto ops = stream(i); + auto op = static_cast(i.op); + + switch (op) + { + case OpLoad: + case OpInBoundsAccessChain: + case OpAccessChain: + case OpPtrAccessChain: + case OpArrayLength: + { + uint32_t base_id = ops[2]; + if (global_var_ids.find(base_id) != global_var_ids.end()) + added_arg_ids.insert(base_id); + + // Use Metal's native frame-buffer fetch API for subpass inputs. + auto &type = get(ops[0]); + if (type.basetype == SPIRType::Image && type.image.dim == DimSubpassData && + (!msl_options.use_framebuffer_fetch_subpasses)) + { + // Implicitly reads gl_FragCoord. + assert(builtin_frag_coord_id != 0); + added_arg_ids.insert(builtin_frag_coord_id); + if (msl_options.multiview) + { + // Implicitly reads gl_ViewIndex. + assert(builtin_view_idx_id != 0); + added_arg_ids.insert(builtin_view_idx_id); + } + else if (msl_options.arrayed_subpass_input) + { + // Implicitly reads gl_Layer. + assert(builtin_layer_id != 0); + added_arg_ids.insert(builtin_layer_id); + } + } + + break; + } + + case OpFunctionCall: + { + // First see if any of the function call args are globals + for (uint32_t arg_idx = 3; arg_idx < i.length; arg_idx++) + { + uint32_t arg_id = ops[arg_idx]; + if (global_var_ids.find(arg_id) != global_var_ids.end()) + added_arg_ids.insert(arg_id); + } + + // Then recurse into the function itself to extract globals used internally in the function + uint32_t inner_func_id = ops[2]; + std::set inner_func_args; + extract_global_variables_from_function(inner_func_id, inner_func_args, global_var_ids, + processed_func_ids); + added_arg_ids.insert(inner_func_args.begin(), inner_func_args.end()); + break; + } + + case OpStore: + { + uint32_t base_id = ops[0]; + if (global_var_ids.find(base_id) != global_var_ids.end()) + { + added_arg_ids.insert(base_id); + + if (msl_options.input_attachment_is_ds_attachment && base_id == builtin_frag_depth_id) + writes_to_depth = true; + } + + uint32_t rvalue_id = ops[1]; + if (global_var_ids.find(rvalue_id) != global_var_ids.end()) + added_arg_ids.insert(rvalue_id); + + if (needs_frag_discard_checks()) + added_arg_ids.insert(builtin_helper_invocation_id); + + break; + } + + case OpSelect: + { + uint32_t base_id = ops[3]; + if (global_var_ids.find(base_id) != global_var_ids.end()) + added_arg_ids.insert(base_id); + base_id = ops[4]; + if (global_var_ids.find(base_id) != global_var_ids.end()) + added_arg_ids.insert(base_id); + break; + } + + case OpAtomicExchange: + case OpAtomicCompareExchange: + case OpAtomicStore: + case OpAtomicIIncrement: + case OpAtomicIDecrement: + case OpAtomicIAdd: + case OpAtomicFAddEXT: + case OpAtomicISub: + case OpAtomicSMin: + case OpAtomicUMin: + case OpAtomicSMax: + case OpAtomicUMax: + case OpAtomicAnd: + case OpAtomicOr: + case OpAtomicXor: + case OpImageWrite: + { + if (needs_frag_discard_checks()) + added_arg_ids.insert(builtin_helper_invocation_id); + uint32_t ptr = 0; + if (op == OpAtomicStore || op == OpImageWrite) + ptr = ops[0]; + else + ptr = ops[2]; + if (global_var_ids.find(ptr) != global_var_ids.end()) + added_arg_ids.insert(ptr); + break; + } + + // Emulate texture2D atomic operations + case OpImageTexelPointer: + { + // When using the pointer, we need to know which variable it is actually loaded from. + uint32_t base_id = ops[2]; + auto *var = maybe_get_backing_variable(base_id); + if (var) + { + if (atomic_image_vars_emulated.count(var->self) && + !get(var->basetype).array.empty()) + { + SPIRV_CROSS_THROW( + "Cannot emulate array of storage images with atomics. Use MSL 3.1 for native support."); + } + + if (global_var_ids.find(base_id) != global_var_ids.end()) + added_arg_ids.insert(base_id); + } + break; + } + + case OpExtInst: + { + uint32_t extension_set = ops[2]; + if (get(extension_set).ext == SPIRExtension::GLSL) + { + auto op_450 = static_cast(ops[3]); + switch (op_450) + { + case GLSLstd450InterpolateAtCentroid: + case GLSLstd450InterpolateAtSample: + case GLSLstd450InterpolateAtOffset: + { + // For these, we really need the stage-in block. It is theoretically possible to pass the + // interpolant object, but a) doing so would require us to create an entirely new variable + // with Interpolant type, and b) if we have a struct or array, handling all the members and + // elements could get unwieldy fast. + added_arg_ids.insert(stage_in_var_id); + break; + } + + case GLSLstd450Modf: + case GLSLstd450Frexp: + { + uint32_t base_id = ops[5]; + if (global_var_ids.find(base_id) != global_var_ids.end()) + added_arg_ids.insert(base_id); + break; + } + + default: + break; + } + } + break; + } + + case OpGroupNonUniformInverseBallot: + { + added_arg_ids.insert(builtin_subgroup_invocation_id_id); + break; + } + + case OpGroupNonUniformBallotFindLSB: + case OpGroupNonUniformBallotFindMSB: + { + added_arg_ids.insert(builtin_subgroup_size_id); + break; + } + + case OpGroupNonUniformBallotBitCount: + { + auto operation = static_cast(ops[3]); + switch (operation) + { + case GroupOperationReduce: + added_arg_ids.insert(builtin_subgroup_size_id); + break; + case GroupOperationInclusiveScan: + case GroupOperationExclusiveScan: + added_arg_ids.insert(builtin_subgroup_invocation_id_id); + break; + default: + break; + } + break; + } + + case OpGroupNonUniformRotateKHR: + { + // Add the correct invocation ID for calculating clustered rotate case. + if (i.length > 5) + added_arg_ids.insert(static_cast(evaluate_constant_u32(ops[2])) == ScopeSubgroup + ? builtin_subgroup_invocation_id_id : builtin_local_invocation_index_id); + break; + } + + case OpGroupNonUniformFAdd: + case OpGroupNonUniformFMul: + case OpGroupNonUniformFMin: + case OpGroupNonUniformFMax: + case OpGroupNonUniformIAdd: + case OpGroupNonUniformIMul: + case OpGroupNonUniformSMin: + case OpGroupNonUniformSMax: + case OpGroupNonUniformUMin: + case OpGroupNonUniformUMax: + case OpGroupNonUniformBitwiseAnd: + case OpGroupNonUniformBitwiseOr: + case OpGroupNonUniformBitwiseXor: + case OpGroupNonUniformLogicalAnd: + case OpGroupNonUniformLogicalOr: + case OpGroupNonUniformLogicalXor: + if ((get_execution_model() != ExecutionModelFragment || msl_options.supports_msl_version(2, 2)) && + ops[3] == GroupOperationClusteredReduce) + added_arg_ids.insert(builtin_subgroup_invocation_id_id); + break; + + case OpDemoteToHelperInvocation: + if (needs_manual_helper_invocation_updates() && needs_helper_invocation) + added_arg_ids.insert(builtin_helper_invocation_id); + break; + + case OpIsHelperInvocationEXT: + if (needs_manual_helper_invocation_updates()) + added_arg_ids.insert(builtin_helper_invocation_id); + break; + + case OpRayQueryInitializeKHR: + case OpRayQueryProceedKHR: + case OpRayQueryTerminateKHR: + case OpRayQueryGenerateIntersectionKHR: + case OpRayQueryConfirmIntersectionKHR: + { + // Ray query accesses memory directly, need check pass down object if using Private storage class. + uint32_t base_id = ops[0]; + if (global_var_ids.find(base_id) != global_var_ids.end()) + added_arg_ids.insert(base_id); + break; + } + + case OpRayQueryGetRayTMinKHR: + case OpRayQueryGetRayFlagsKHR: + case OpRayQueryGetWorldRayOriginKHR: + case OpRayQueryGetWorldRayDirectionKHR: + case OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: + case OpRayQueryGetIntersectionTypeKHR: + case OpRayQueryGetIntersectionTKHR: + case OpRayQueryGetIntersectionInstanceCustomIndexKHR: + case OpRayQueryGetIntersectionInstanceIdKHR: + case OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: + case OpRayQueryGetIntersectionGeometryIndexKHR: + case OpRayQueryGetIntersectionPrimitiveIndexKHR: + case OpRayQueryGetIntersectionBarycentricsKHR: + case OpRayQueryGetIntersectionFrontFaceKHR: + case OpRayQueryGetIntersectionObjectRayDirectionKHR: + case OpRayQueryGetIntersectionObjectRayOriginKHR: + case OpRayQueryGetIntersectionObjectToWorldKHR: + case OpRayQueryGetIntersectionWorldToObjectKHR: + { + // Ray query accesses memory directly, need check pass down object if using Private storage class. + uint32_t base_id = ops[2]; + if (global_var_ids.find(base_id) != global_var_ids.end()) + added_arg_ids.insert(base_id); + break; + } + + case OpSetMeshOutputsEXT: + { + if (builtin_local_invocation_index_id != 0) + added_arg_ids.insert(builtin_local_invocation_index_id); + if (builtin_mesh_sizes_id != 0) + added_arg_ids.insert(builtin_mesh_sizes_id); + break; + } + + default: + break; + } + + if (needs_manual_helper_invocation_updates() && b.terminator == SPIRBlock::Kill && + needs_helper_invocation) + added_arg_ids.insert(builtin_helper_invocation_id); + + // TODO: Add all other operations which can affect memory. + // We should consider a more unified system here to reduce boiler-plate. + // This kind of analysis is done in several places ... + } + + if (b.terminator == SPIRBlock::EmitMeshTasks && builtin_task_grid_id != 0) + added_arg_ids.insert(builtin_task_grid_id); + } + + function_global_vars[func_id] = added_arg_ids; + + // Add the global variables as arguments to the function + if (func_id != ir.default_entry_point) + { + bool control_point_added_in = false; + bool control_point_added_out = false; + bool patch_added_in = false; + bool patch_added_out = false; + + for (uint32_t arg_id : added_arg_ids) + { + auto &var = get(arg_id); + uint32_t type_id = var.basetype; + auto *p_type = &get(type_id); + BuiltIn bi_type = BuiltIn(get_decoration(arg_id, DecorationBuiltIn)); + + bool is_patch = has_decoration(arg_id, DecorationPatch) || is_patch_block(*p_type); + bool is_block = has_decoration(p_type->self, DecorationBlock); + bool is_control_point_storage = + !is_patch && ((is_tessellation_shader() && var.storage == StorageClassInput) || + (is_tesc_shader() && var.storage == StorageClassOutput)); + bool is_patch_block_storage = is_patch && is_block && var.storage == StorageClassOutput; + bool is_builtin = is_builtin_variable(var); + bool variable_is_stage_io = + !is_builtin || bi_type == BuiltInPosition || bi_type == BuiltInPointSize || + bi_type == BuiltInClipDistance || bi_type == BuiltInCullDistance || + p_type->basetype == SPIRType::Struct; + bool is_redirected_to_global_stage_io = (is_control_point_storage || is_patch_block_storage) && + variable_is_stage_io; + + // If output is masked it is not considered part of the global stage IO interface. + if (is_redirected_to_global_stage_io && var.storage == StorageClassOutput) + is_redirected_to_global_stage_io = !is_stage_output_variable_masked(var); + + if (is_redirected_to_global_stage_io) + { + // Tessellation control shaders see inputs and per-point outputs as arrays. + // Similarly, tessellation evaluation shaders see per-point inputs as arrays. + // We collected them into a structure; we must pass the array of this + // structure to the function. + std::string name; + if (is_patch) + name = var.storage == StorageClassInput ? patch_stage_in_var_name : patch_stage_out_var_name; + else + name = var.storage == StorageClassInput ? "gl_in" : "gl_out"; + + if (var.storage == StorageClassOutput && has_decoration(p_type->self, DecorationBlock)) + { + // If we're redirecting a block, we might still need to access the original block + // variable if we're masking some members. + for (uint32_t mbr_idx = 0; mbr_idx < uint32_t(p_type->member_types.size()); mbr_idx++) + { + if (is_stage_output_block_member_masked(var, mbr_idx, true)) + { + func.add_parameter(var.basetype, var.self, true); + break; + } + } + } + + if (var.storage == StorageClassInput) + { + auto &added_in = is_patch ? patch_added_in : control_point_added_in; + if (added_in) + continue; + arg_id = is_patch ? patch_stage_in_var_id : stage_in_ptr_var_id; + added_in = true; + } + else if (var.storage == StorageClassOutput) + { + auto &added_out = is_patch ? patch_added_out : control_point_added_out; + if (added_out) + continue; + arg_id = is_patch ? patch_stage_out_var_id : stage_out_ptr_var_id; + added_out = true; + } + + type_id = get(arg_id).basetype; + uint32_t next_id = ir.increase_bound_by(1); + func.add_parameter(type_id, next_id, true); + set(next_id, type_id, StorageClassFunction, 0, arg_id); + + set_name(next_id, name); + if (is_tese_shader() && msl_options.raw_buffer_tese_input && var.storage == StorageClassInput) + set_decoration(next_id, DecorationNonWritable); + } + else if (is_builtin && is_mesh_shader()) + { + uint32_t next_id = ir.increase_bound_by(1); + func.add_parameter(type_id, next_id, true); + auto &v = set(next_id, type_id, StorageClassFunction, 0, arg_id); + v.storage = StorageClassWorkgroup; + + // Ensure the existing variable has a valid name and the new variable has all the same meta info + if (ir.meta[arg_id].decoration.builtin) + { + set_name(arg_id, builtin_to_glsl(bi_type, var.storage)); + } + else + { + set_name(arg_id, ensure_valid_name(to_name(arg_id), "v")); + } + ir.meta[next_id] = ir.meta[arg_id]; + } + else if (is_builtin && has_decoration(p_type->self, DecorationBlock)) + { + // Get the pointee type + type_id = get_pointee_type_id(type_id); + p_type = &get(type_id); + + uint32_t mbr_idx = 0; + for (auto &mbr_type_id : p_type->member_types) + { + BuiltIn builtin = BuiltInMax; + is_builtin = is_member_builtin(*p_type, mbr_idx, &builtin); + if (is_builtin && has_active_builtin(builtin, var.storage)) + { + // Add a arg variable with the same type and decorations as the member + uint32_t next_ids = ir.increase_bound_by(2); + uint32_t ptr_type_id = next_ids + 0; + uint32_t var_id = next_ids + 1; + + // Make sure we have an actual pointer type, + // so that we will get the appropriate address space when declaring these builtins. + auto &ptr = set(ptr_type_id, get(mbr_type_id)); + ptr.self = mbr_type_id; + ptr.storage = var.storage; + ptr.pointer = true; + ptr.pointer_depth++; + ptr.parent_type = mbr_type_id; + + func.add_parameter(mbr_type_id, var_id, true); + set(var_id, ptr_type_id, StorageClassFunction); + ir.meta[var_id].decoration = ir.meta[type_id].members[mbr_idx]; + } + mbr_idx++; + } + } + else + { + uint32_t next_id = ir.increase_bound_by(1); + func.add_parameter(type_id, next_id, true); + set(next_id, type_id, StorageClassFunction, 0, arg_id); + + // Ensure the new variable has all the same meta info + ir.meta[next_id] = ir.meta[arg_id]; + } + } + } +} + +// For all variables that are some form of non-input-output interface block, mark that all the structs +// that are recursively contained within the type referenced by that variable should be packed tightly. +void CompilerMSL::mark_packable_structs() +{ + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + if (var.storage != StorageClassFunction && !is_hidden_variable(var)) + { + auto &type = this->get(var.basetype); + if (type.pointer && + (type.storage == StorageClassUniform || type.storage == StorageClassUniformConstant || + type.storage == StorageClassPushConstant || type.storage == StorageClassStorageBuffer) && + (has_decoration(type.self, DecorationBlock) || has_decoration(type.self, DecorationBufferBlock))) + mark_as_packable(type); + } + + if (var.storage == StorageClassWorkgroup) + { + auto *type = &this->get(var.basetype); + if (type->basetype == SPIRType::Struct) + mark_as_workgroup_struct(*type); + } + }); + + // Physical storage buffer pointers can appear outside of the context of a variable, if the address + // is calculated from a ulong or uvec2 and cast to a pointer, so check if they need to be packed too. + ir.for_each_typed_id([&](uint32_t, SPIRType &type) { + if (type.basetype == SPIRType::Struct && type.pointer && type.storage == StorageClassPhysicalStorageBuffer) + mark_as_packable(type); + }); +} + +// If the specified type is a struct, it and any nested structs +// are marked as packable with the SPIRVCrossDecorationBufferBlockRepacked decoration, +void CompilerMSL::mark_as_packable(SPIRType &type) +{ + // If this is not the base type (eg. it's a pointer or array), tunnel down + if (type.parent_type) + { + mark_as_packable(get(type.parent_type)); + return; + } + + // Handle possible recursion when a struct contains a pointer to its own type nested somewhere. + if (type.basetype == SPIRType::Struct && !has_extended_decoration(type.self, SPIRVCrossDecorationBufferBlockRepacked)) + { + set_extended_decoration(type.self, SPIRVCrossDecorationBufferBlockRepacked); + + // Recurse + uint32_t mbr_cnt = uint32_t(type.member_types.size()); + for (uint32_t mbr_idx = 0; mbr_idx < mbr_cnt; mbr_idx++) + { + uint32_t mbr_type_id = type.member_types[mbr_idx]; + auto &mbr_type = get(mbr_type_id); + mark_as_packable(mbr_type); + if (mbr_type.type_alias) + { + auto &mbr_type_alias = get(mbr_type.type_alias); + mark_as_packable(mbr_type_alias); + } + } + } +} + +// If the specified type is a struct, it and any nested structs +// are marked as used with workgroup storage using the SPIRVCrossDecorationWorkgroupStruct decoration. +void CompilerMSL::mark_as_workgroup_struct(SPIRType &type) +{ + // If this is not the base type (eg. it's a pointer or array), tunnel down + if (type.parent_type) + { + mark_as_workgroup_struct(get(type.parent_type)); + return; + } + + // Handle possible recursion when a struct contains a pointer to its own type nested somewhere. + if (type.basetype == SPIRType::Struct && !has_extended_decoration(type.self, SPIRVCrossDecorationWorkgroupStruct)) + { + set_extended_decoration(type.self, SPIRVCrossDecorationWorkgroupStruct); + + // Recurse + uint32_t mbr_cnt = uint32_t(type.member_types.size()); + for (uint32_t mbr_idx = 0; mbr_idx < mbr_cnt; mbr_idx++) + { + uint32_t mbr_type_id = type.member_types[mbr_idx]; + auto &mbr_type = get(mbr_type_id); + mark_as_workgroup_struct(mbr_type); + if (mbr_type.type_alias) + { + auto &mbr_type_alias = get(mbr_type.type_alias); + mark_as_workgroup_struct(mbr_type_alias); + } + } + } +} + +// If a shader input exists at the location, it is marked as being used by this shader +void CompilerMSL::mark_location_as_used_by_shader(uint32_t location, const SPIRType &type, + StorageClass storage, bool fallback) +{ + uint32_t count = type_to_location_count(type); + switch (storage) + { + case StorageClassInput: + for (uint32_t i = 0; i < count; i++) + { + location_inputs_in_use.insert(location + i); + if (fallback) + location_inputs_in_use_fallback.insert(location + i); + } + break; + case StorageClassOutput: + for (uint32_t i = 0; i < count; i++) + { + location_outputs_in_use.insert(location + i); + if (fallback) + location_outputs_in_use_fallback.insert(location + i); + } + break; + default: + return; + } +} + +uint32_t CompilerMSL::get_target_components_for_fragment_location(uint32_t location) const +{ + auto itr = fragment_output_components.find(location); + if (itr == end(fragment_output_components)) + return 4; + else + return itr->second; +} + +uint32_t CompilerMSL::build_extended_vector_type(uint32_t type_id, uint32_t components, SPIRType::BaseType basetype) +{ + assert(components > 1); + uint32_t new_type_id = ir.increase_bound_by(1); + const auto *p_old_type = &get(type_id); + const SPIRType *old_ptr_t = nullptr; + const SPIRType *old_array_t = nullptr; + + if (is_pointer(*p_old_type)) + { + old_ptr_t = p_old_type; + p_old_type = &get_pointee_type(*old_ptr_t); + } + + if (is_array(*p_old_type)) + { + old_array_t = p_old_type; + p_old_type = &get_type(old_array_t->parent_type); + } + + auto *type = &set(new_type_id, *p_old_type); + assert(is_scalar(*type) || is_vector(*type)); + type->op = OpTypeVector; + type->vecsize = components; + if (basetype != SPIRType::Unknown) + type->basetype = basetype; + type->self = new_type_id; + // We want parent type to point to the scalar type. + type->parent_type = is_scalar(*p_old_type) ? TypeID(p_old_type->self) : p_old_type->parent_type; + assert(is_scalar(get(type->parent_type))); + type->array.clear(); + type->array_size_literal.clear(); + type->pointer = false; + + if (old_array_t) + { + uint32_t array_type_id = ir.increase_bound_by(1); + type = &set(array_type_id, *type); + type->op = OpTypeArray; + type->parent_type = new_type_id; + type->array = old_array_t->array; + type->array_size_literal = old_array_t->array_size_literal; + new_type_id = array_type_id; + } + + if (old_ptr_t) + { + uint32_t ptr_type_id = ir.increase_bound_by(1); + type = &set(ptr_type_id, *type); + type->op = OpTypePointer; + type->parent_type = new_type_id; + type->storage = old_ptr_t->storage; + type->pointer = true; + type->pointer_depth++; + new_type_id = ptr_type_id; + } + + return new_type_id; +} + +uint32_t CompilerMSL::build_msl_interpolant_type(uint32_t type_id, bool is_noperspective) +{ + uint32_t new_type_id = ir.increase_bound_by(1); + SPIRType &type = set(new_type_id, get(type_id)); + type.basetype = SPIRType::Interpolant; + type.parent_type = type_id; + // In Metal, the pull-model interpolant type encodes perspective-vs-no-perspective in the type itself. + // Add this decoration so we know which argument to pass to the template. + if (is_noperspective) + set_decoration(new_type_id, DecorationNoPerspective); + return new_type_id; +} + +bool CompilerMSL::add_component_variable_to_interface_block(StorageClass storage, const std::string &ib_var_ref, + SPIRVariable &var, + const SPIRType &type, + InterfaceBlockMeta &meta) +{ + // Deal with Component decorations. + const InterfaceBlockMeta::LocationMeta *location_meta = nullptr; + uint32_t location = ~0u; + if (has_decoration(var.self, DecorationLocation)) + { + location = get_decoration(var.self, DecorationLocation); + auto location_meta_itr = meta.location_meta.find(location); + if (location_meta_itr != end(meta.location_meta)) + location_meta = &location_meta_itr->second; + } + + // Check if we need to pad fragment output to match a certain number of components. + if (location_meta) + { + bool pad_fragment_output = has_decoration(var.self, DecorationLocation) && + msl_options.pad_fragment_output_components && + get_entry_point().model == ExecutionModelFragment && storage == StorageClassOutput; + + auto &entry_func = get(ir.default_entry_point); + uint32_t start_component = get_decoration(var.self, DecorationComponent); + uint32_t type_components = type.vecsize; + uint32_t num_components = location_meta->num_components; + + if (pad_fragment_output) + { + uint32_t locn = get_decoration(var.self, DecorationLocation); + num_components = max(num_components, get_target_components_for_fragment_location(locn)); + } + + // We have already declared an IO block member as m_location_N. + // Just emit an early-declared variable and fixup as needed. + // Arrays need to be unrolled here since each location might need a different number of components. + entry_func.add_local_variable(var.self); + vars_needing_early_declaration.push_back(var.self); + + if (var.storage == StorageClassInput) + { + entry_func.fixup_hooks_in.push_back([=, &type, &var]() { + if (!type.array.empty()) + { + uint32_t array_size = to_array_size_literal(type); + for (uint32_t loc_off = 0; loc_off < array_size; loc_off++) + { + statement(to_name(var.self), "[", loc_off, "]", " = ", ib_var_ref, + ".m_location_", location + loc_off, + vector_swizzle(type_components, start_component), ";"); + } + } + else + { + statement(to_name(var.self), " = ", ib_var_ref, ".m_location_", location, + vector_swizzle(type_components, start_component), ";"); + } + }); + } + else + { + entry_func.fixup_hooks_out.push_back([=, &type, &var]() { + if (!type.array.empty()) + { + uint32_t array_size = to_array_size_literal(type); + for (uint32_t loc_off = 0; loc_off < array_size; loc_off++) + { + statement(ib_var_ref, ".m_location_", location + loc_off, + vector_swizzle(type_components, start_component), " = ", + to_name(var.self), "[", loc_off, "];"); + } + } + else + { + statement(ib_var_ref, ".m_location_", location, + vector_swizzle(type_components, start_component), " = ", to_name(var.self), ";"); + } + }); + } + return true; + } + else + return false; +} + +void CompilerMSL::add_plain_variable_to_interface_block(StorageClass storage, const string &ib_var_ref, + SPIRType &ib_type, SPIRVariable &var, InterfaceBlockMeta &meta) +{ + bool is_builtin = is_builtin_variable(var); + BuiltIn builtin = BuiltIn(get_decoration(var.self, DecorationBuiltIn)); + bool is_flat = has_decoration(var.self, DecorationFlat); + bool is_noperspective = has_decoration(var.self, DecorationNoPerspective); + bool is_centroid = has_decoration(var.self, DecorationCentroid); + bool is_sample = has_decoration(var.self, DecorationSample); + + // Add a reference to the variable type to the interface struct. + uint32_t ib_mbr_idx = uint32_t(ib_type.member_types.size()); + uint32_t type_id = ensure_correct_builtin_type(var.basetype, builtin); + var.basetype = type_id; + + type_id = get_pointee_type_id(var.basetype); + if (meta.strip_array && is_array(get(type_id))) + type_id = get(type_id).parent_type; + auto &type = get(type_id); + uint32_t target_components = 0; + uint32_t type_components = type.vecsize; + + bool padded_output = false; + bool padded_input = false; + uint32_t start_component = 0; + + auto &entry_func = get(ir.default_entry_point); + + if (add_component_variable_to_interface_block(storage, ib_var_ref, var, type, meta)) + return; + + bool pad_fragment_output = has_decoration(var.self, DecorationLocation) && + msl_options.pad_fragment_output_components && + get_entry_point().model == ExecutionModelFragment && storage == StorageClassOutput; + + if (pad_fragment_output) + { + uint32_t locn = get_decoration(var.self, DecorationLocation); + target_components = get_target_components_for_fragment_location(locn); + if (type_components < target_components) + { + // Make a new type here. + type_id = build_extended_vector_type(type_id, target_components); + padded_output = true; + } + } + + if (storage == StorageClassInput && pull_model_inputs.count(var.self)) + ib_type.member_types.push_back(build_msl_interpolant_type(type_id, is_noperspective)); + else + ib_type.member_types.push_back(type_id); + + // Give the member a name + string mbr_name = ensure_valid_name(to_expression(var.self), "m"); + set_member_name(ib_type.self, ib_mbr_idx, mbr_name); + + // Update the original variable reference to include the structure reference + string qual_var_name = ib_var_ref + "." + mbr_name; + // If using pull-model interpolation, need to add a call to the correct interpolation method. + if (storage == StorageClassInput && pull_model_inputs.count(var.self)) + { + if (is_centroid) + qual_var_name += ".interpolate_at_centroid()"; + else if (is_sample) + qual_var_name += join(".interpolate_at_sample(", to_expression(builtin_sample_id_id), ")"); + else + qual_var_name += ".interpolate_at_center()"; + } + + if (padded_output || padded_input) + { + entry_func.add_local_variable(var.self); + vars_needing_early_declaration.push_back(var.self); + + if (padded_output) + { + entry_func.fixup_hooks_out.push_back([=, &var]() { + statement(qual_var_name, vector_swizzle(type_components, start_component), " = ", to_name(var.self), + ";"); + }); + } + else + { + entry_func.fixup_hooks_in.push_back([=, &var]() { + statement(to_name(var.self), " = ", qual_var_name, vector_swizzle(type_components, start_component), + ";"); + }); + } + } + else if (!meta.strip_array) + ir.meta[var.self].decoration.qualified_alias = qual_var_name; + + if (var.storage == StorageClassOutput && var.initializer != ID(0)) + { + if (padded_output || padded_input) + { + entry_func.fixup_hooks_in.push_back( + [=, &var]() { statement(to_name(var.self), " = ", to_expression(var.initializer), ";"); }); + } + else + { + if (meta.strip_array) + { + entry_func.fixup_hooks_in.push_back([=, &var]() { + uint32_t index = get_extended_decoration(var.self, SPIRVCrossDecorationInterfaceMemberIndex); + auto invocation = to_tesc_invocation_id(); + statement(to_expression(stage_out_ptr_var_id), "[", + invocation, "].", + to_member_name(ib_type, index), " = ", to_expression(var.initializer), "[", + invocation, "];"); + }); + } + else + { + entry_func.fixup_hooks_in.push_back([=, &var]() { + statement(qual_var_name, " = ", to_expression(var.initializer), ";"); + }); + } + } + } + + // Copy the variable location from the original variable to the member + if (get_decoration_bitset(var.self).get(DecorationLocation)) + { + uint32_t locn = get_decoration(var.self, DecorationLocation); + uint32_t comp = get_decoration(var.self, DecorationComponent); + if (storage == StorageClassInput) + { + type_id = ensure_correct_input_type(var.basetype, locn, comp, 0, meta.strip_array); + var.basetype = type_id; + + type_id = get_pointee_type_id(type_id); + if (meta.strip_array && is_array(get(type_id))) + type_id = get(type_id).parent_type; + if (pull_model_inputs.count(var.self)) + ib_type.member_types[ib_mbr_idx] = build_msl_interpolant_type(type_id, is_noperspective); + else + ib_type.member_types[ib_mbr_idx] = type_id; + } + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn); + if (comp) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationComponent, comp); + mark_location_as_used_by_shader(locn, get(type_id), storage); + } + else if (is_builtin && is_tessellation_shader() && storage == StorageClassInput && inputs_by_builtin.count(builtin)) + { + uint32_t locn = inputs_by_builtin[builtin].location; + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn); + mark_location_as_used_by_shader(locn, type, storage); + } + else if (is_builtin && capture_output_to_buffer && storage == StorageClassOutput && outputs_by_builtin.count(builtin)) + { + uint32_t locn = outputs_by_builtin[builtin].location; + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn); + mark_location_as_used_by_shader(locn, type, storage); + } + + if (get_decoration_bitset(var.self).get(DecorationComponent)) + { + uint32_t component = get_decoration(var.self, DecorationComponent); + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationComponent, component); + } + + if (get_decoration_bitset(var.self).get(DecorationIndex)) + { + uint32_t index = get_decoration(var.self, DecorationIndex); + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationIndex, index); + } + + // Mark the member as builtin if needed + if (is_builtin) + { + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationBuiltIn, builtin); + if (builtin == BuiltInPosition && storage == StorageClassOutput) + qual_pos_var_name = qual_var_name; + } + + // Copy interpolation decorations if needed + if (storage != StorageClassInput || !pull_model_inputs.count(var.self)) + { + if (is_flat) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationFlat); + if (is_noperspective) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationNoPerspective); + if (is_centroid) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationCentroid); + if (is_sample) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationSample); + } + + set_extended_member_decoration(ib_type.self, ib_mbr_idx, SPIRVCrossDecorationInterfaceOrigID, var.self); +} + +void CompilerMSL::add_composite_variable_to_interface_block(StorageClass storage, const string &ib_var_ref, + SPIRType &ib_type, SPIRVariable &var, + InterfaceBlockMeta &meta) +{ + auto &entry_func = get(ir.default_entry_point); + auto &var_type = meta.strip_array ? get_variable_element_type(var) : get_variable_data_type(var); + uint32_t elem_cnt = 0; + + if (add_component_variable_to_interface_block(storage, ib_var_ref, var, var_type, meta)) + return; + + if (is_matrix(var_type)) + { + if (is_array(var_type)) + SPIRV_CROSS_THROW("MSL cannot emit arrays-of-matrices in input and output variables."); + + elem_cnt = var_type.columns; + } + else if (is_array(var_type)) + { + if (var_type.array.size() != 1) + SPIRV_CROSS_THROW("MSL cannot emit arrays-of-arrays in input and output variables."); + + elem_cnt = to_array_size_literal(var_type); + } + + bool is_builtin = is_builtin_variable(var); + BuiltIn builtin = BuiltIn(get_decoration(var.self, DecorationBuiltIn)); + bool is_flat = has_decoration(var.self, DecorationFlat); + bool is_noperspective = has_decoration(var.self, DecorationNoPerspective); + bool is_centroid = has_decoration(var.self, DecorationCentroid); + bool is_sample = has_decoration(var.self, DecorationSample); + + auto *usable_type = &var_type; + if (usable_type->pointer) + usable_type = &get(usable_type->parent_type); + while (is_array(*usable_type) || is_matrix(*usable_type)) + usable_type = &get(usable_type->parent_type); + + // If a builtin, force it to have the proper name. + if (is_builtin) + set_name(var.self, builtin_to_glsl(builtin, StorageClassFunction)); + + bool flatten_from_ib_var = false; + string flatten_from_ib_mbr_name; + + if (storage == StorageClassOutput && is_builtin && builtin == BuiltInClipDistance) + { + // Also declare [[clip_distance]] attribute here. + uint32_t clip_array_mbr_idx = uint32_t(ib_type.member_types.size()); + ib_type.member_types.push_back(get_variable_data_type_id(var)); + set_member_decoration(ib_type.self, clip_array_mbr_idx, DecorationBuiltIn, BuiltInClipDistance); + + flatten_from_ib_mbr_name = builtin_to_glsl(BuiltInClipDistance, StorageClassOutput); + set_member_name(ib_type.self, clip_array_mbr_idx, flatten_from_ib_mbr_name); + + // When we flatten, we flatten directly from the "out" struct, + // not from a function variable. + flatten_from_ib_var = true; + + if (!msl_options.enable_clip_distance_user_varying) + return; + } + else if (!meta.strip_array) + { + // Only flatten/unflatten IO composites for non-tessellation cases where arrays are not stripped. + entry_func.add_local_variable(var.self); + // We need to declare the variable early and at entry-point scope. + vars_needing_early_declaration.push_back(var.self); + } + + for (uint32_t i = 0; i < elem_cnt; i++) + { + // Add a reference to the variable type to the interface struct. + uint32_t ib_mbr_idx = uint32_t(ib_type.member_types.size()); + + uint32_t target_components = 0; + bool padded_output = false; + uint32_t type_id = usable_type->self; + + // Check if we need to pad fragment output to match a certain number of components. + if (get_decoration_bitset(var.self).get(DecorationLocation) && msl_options.pad_fragment_output_components && + get_entry_point().model == ExecutionModelFragment && storage == StorageClassOutput) + { + uint32_t locn = get_decoration(var.self, DecorationLocation) + i; + target_components = get_target_components_for_fragment_location(locn); + if (usable_type->vecsize < target_components) + { + // Make a new type here. + type_id = build_extended_vector_type(usable_type->self, target_components); + padded_output = true; + } + } + + if (storage == StorageClassInput && pull_model_inputs.count(var.self)) + ib_type.member_types.push_back(build_msl_interpolant_type(get_pointee_type_id(type_id), is_noperspective)); + else + ib_type.member_types.push_back(get_pointee_type_id(type_id)); + + // Give the member a name + string mbr_name = ensure_valid_name(join(to_expression(var.self), "_", i), "m"); + set_member_name(ib_type.self, ib_mbr_idx, mbr_name); + + // There is no qualified alias since we need to flatten the internal array on return. + if (get_decoration_bitset(var.self).get(DecorationLocation)) + { + uint32_t locn = get_decoration(var.self, DecorationLocation) + i; + uint32_t comp = get_decoration(var.self, DecorationComponent); + if (storage == StorageClassInput) + { + var.basetype = ensure_correct_input_type(var.basetype, locn, comp, 0, meta.strip_array); + uint32_t mbr_type_id = ensure_correct_input_type(usable_type->self, locn, comp, 0, meta.strip_array); + if (storage == StorageClassInput && pull_model_inputs.count(var.self)) + ib_type.member_types[ib_mbr_idx] = build_msl_interpolant_type(mbr_type_id, is_noperspective); + else + ib_type.member_types[ib_mbr_idx] = mbr_type_id; + } + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn); + if (comp) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationComponent, comp); + mark_location_as_used_by_shader(locn, *usable_type, storage); + } + else if (is_builtin && is_tessellation_shader() && storage == StorageClassInput && inputs_by_builtin.count(builtin)) + { + uint32_t locn = inputs_by_builtin[builtin].location + i; + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn); + mark_location_as_used_by_shader(locn, *usable_type, storage); + } + else if (is_builtin && capture_output_to_buffer && storage == StorageClassOutput && outputs_by_builtin.count(builtin)) + { + uint32_t locn = outputs_by_builtin[builtin].location + i; + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn); + mark_location_as_used_by_shader(locn, *usable_type, storage); + } + else if (is_builtin && (builtin == BuiltInClipDistance || builtin == BuiltInCullDistance)) + { + // Declare the Clip/CullDistance as [[user(clip/cullN)]]. + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationBuiltIn, builtin); + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationIndex, i); + } + + if (get_decoration_bitset(var.self).get(DecorationIndex)) + { + uint32_t index = get_decoration(var.self, DecorationIndex); + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationIndex, index); + } + + if (storage != StorageClassInput || !pull_model_inputs.count(var.self)) + { + // Copy interpolation decorations if needed + if (is_flat) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationFlat); + if (is_noperspective) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationNoPerspective); + if (is_centroid) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationCentroid); + if (is_sample) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationSample); + } + + set_extended_member_decoration(ib_type.self, ib_mbr_idx, SPIRVCrossDecorationInterfaceOrigID, var.self); + + // Only flatten/unflatten IO composites for non-tessellation cases where arrays are not stripped. + if (!meta.strip_array) + { + switch (storage) + { + case StorageClassInput: + entry_func.fixup_hooks_in.push_back([=, &var]() { + if (pull_model_inputs.count(var.self)) + { + string lerp_call; + if (is_centroid) + lerp_call = ".interpolate_at_centroid()"; + else if (is_sample) + lerp_call = join(".interpolate_at_sample(", to_expression(builtin_sample_id_id), ")"); + else + lerp_call = ".interpolate_at_center()"; + statement(to_name(var.self), "[", i, "] = ", ib_var_ref, ".", mbr_name, lerp_call, ";"); + } + else + { + statement(to_name(var.self), "[", i, "] = ", ib_var_ref, ".", mbr_name, ";"); + } + }); + break; + + case StorageClassOutput: + entry_func.fixup_hooks_out.push_back([=, &var]() { + if (padded_output) + { + auto &padded_type = this->get(type_id); + statement( + ib_var_ref, ".", mbr_name, " = ", + remap_swizzle(padded_type, usable_type->vecsize, join(to_name(var.self), "[", i, "]")), + ";"); + } + else if (flatten_from_ib_var) + statement(ib_var_ref, ".", mbr_name, " = ", ib_var_ref, ".", flatten_from_ib_mbr_name, "[", i, + "];"); + else + statement(ib_var_ref, ".", mbr_name, " = ", to_name(var.self), "[", i, "];"); + }); + break; + + default: + break; + } + } + } +} + +void CompilerMSL::add_composite_member_variable_to_interface_block(StorageClass storage, + const string &ib_var_ref, SPIRType &ib_type, + SPIRVariable &var, SPIRType &var_type, + uint32_t mbr_idx, InterfaceBlockMeta &meta, + const string &mbr_name_qual, + const string &var_chain_qual, + uint32_t &location, uint32_t &var_mbr_idx, + const Bitset &interpolation_qual) +{ + auto &entry_func = get(ir.default_entry_point); + + BuiltIn builtin = BuiltInMax; + bool is_builtin = is_member_builtin(var_type, mbr_idx, &builtin); + bool is_flat = interpolation_qual.get(DecorationFlat) || + has_member_decoration(var_type.self, mbr_idx, DecorationFlat) || + has_decoration(var.self, DecorationFlat); + bool is_noperspective = interpolation_qual.get(DecorationNoPerspective) || + has_member_decoration(var_type.self, mbr_idx, DecorationNoPerspective) || + has_decoration(var.self, DecorationNoPerspective); + bool is_centroid = interpolation_qual.get(DecorationCentroid) || + has_member_decoration(var_type.self, mbr_idx, DecorationCentroid) || + has_decoration(var.self, DecorationCentroid); + bool is_sample = interpolation_qual.get(DecorationSample) || + has_member_decoration(var_type.self, mbr_idx, DecorationSample) || + has_decoration(var.self, DecorationSample); + + Bitset inherited_qual; + if (is_flat) + inherited_qual.set(DecorationFlat); + if (is_noperspective) + inherited_qual.set(DecorationNoPerspective); + if (is_centroid) + inherited_qual.set(DecorationCentroid); + if (is_sample) + inherited_qual.set(DecorationSample); + + uint32_t mbr_type_id = var_type.member_types[mbr_idx]; + auto &mbr_type = get(mbr_type_id); + + bool mbr_is_indexable = false; + uint32_t elem_cnt = 1; + if (is_matrix(mbr_type)) + { + if (is_array(mbr_type)) + SPIRV_CROSS_THROW("MSL cannot emit arrays-of-matrices in input and output variables."); + + mbr_is_indexable = true; + elem_cnt = mbr_type.columns; + } + else if (is_array(mbr_type)) + { + if (mbr_type.array.size() != 1) + SPIRV_CROSS_THROW("MSL cannot emit arrays-of-arrays in input and output variables."); + + mbr_is_indexable = true; + elem_cnt = to_array_size_literal(mbr_type); + } + + auto *usable_type = &mbr_type; + if (usable_type->pointer) + usable_type = &get(usable_type->parent_type); + while (is_array(*usable_type) || is_matrix(*usable_type)) + usable_type = &get(usable_type->parent_type); + + bool flatten_from_ib_var = false; + string flatten_from_ib_mbr_name; + + if (storage == StorageClassOutput && is_builtin && builtin == BuiltInClipDistance) + { + // Also declare [[clip_distance]] attribute here. + uint32_t clip_array_mbr_idx = uint32_t(ib_type.member_types.size()); + ib_type.member_types.push_back(mbr_type_id); + set_member_decoration(ib_type.self, clip_array_mbr_idx, DecorationBuiltIn, BuiltInClipDistance); + + flatten_from_ib_mbr_name = builtin_to_glsl(BuiltInClipDistance, StorageClassOutput); + set_member_name(ib_type.self, clip_array_mbr_idx, flatten_from_ib_mbr_name); + + // When we flatten, we flatten directly from the "out" struct, + // not from a function variable. + flatten_from_ib_var = true; + + if (!msl_options.enable_clip_distance_user_varying) + return; + } + + // Recursively handle nested structures. + if (mbr_type.basetype == SPIRType::Struct) + { + for (uint32_t i = 0; i < elem_cnt; i++) + { + string mbr_name = append_member_name(mbr_name_qual, var_type, mbr_idx) + (mbr_is_indexable ? join("_", i) : ""); + string var_chain = join(var_chain_qual, ".", to_member_name(var_type, mbr_idx), (mbr_is_indexable ? join("[", i, "]") : "")); + uint32_t sub_mbr_cnt = uint32_t(mbr_type.member_types.size()); + for (uint32_t sub_mbr_idx = 0; sub_mbr_idx < sub_mbr_cnt; sub_mbr_idx++) + { + add_composite_member_variable_to_interface_block(storage, ib_var_ref, ib_type, + var, mbr_type, sub_mbr_idx, + meta, mbr_name, var_chain, + location, var_mbr_idx, inherited_qual); + // FIXME: Recursive structs and tessellation breaks here. + var_mbr_idx++; + } + } + return; + } + + for (uint32_t i = 0; i < elem_cnt; i++) + { + // Add a reference to the variable type to the interface struct. + uint32_t ib_mbr_idx = uint32_t(ib_type.member_types.size()); + if (storage == StorageClassInput && pull_model_inputs.count(var.self)) + ib_type.member_types.push_back(build_msl_interpolant_type(usable_type->self, is_noperspective)); + else + ib_type.member_types.push_back(usable_type->self); + + // Give the member a name + string mbr_name = ensure_valid_name(append_member_name(mbr_name_qual, var_type, mbr_idx) + (mbr_is_indexable ? join("_", i) : ""), "m"); + set_member_name(ib_type.self, ib_mbr_idx, mbr_name); + + // The SPIRV location of interface variable, used to obtain the initial + // MSL location (the location variable) and interface matching + uint32_t ir_location = UINT32_MAX; + bool has_member_loc_decor = has_member_decoration(var_type.self, mbr_idx, DecorationLocation); + bool has_var_loc_decor = has_decoration(var.self, DecorationLocation); + uint32_t orig_vecsize = UINT32_MAX; + + // If we haven't established a location base yet, do so here. + if (location == UINT32_MAX) + { + if (has_member_loc_decor) + ir_location = get_member_decoration(var_type.self, mbr_idx, DecorationLocation); + else if (has_var_loc_decor) + ir_location = get_accumulated_member_location(var, mbr_idx, meta.strip_array); + else if (is_builtin) + { + if (is_tessellation_shader() && storage == StorageClassInput && inputs_by_builtin.count(builtin)) + ir_location = inputs_by_builtin[builtin].location; + else if (capture_output_to_buffer && storage == StorageClassOutput && outputs_by_builtin.count(builtin)) + ir_location = outputs_by_builtin[builtin].location; + } + } + + // Once we determine the location of the first member within nested structures, + // from a var of the topmost structure, the remaining flattened members of + // the nested structures will have consecutive location values. At this point, + // we've recursively tunnelled into structs, arrays, and matrices, and are + // down to a single location for each member now. + if (location == UINT32_MAX && ir_location != UINT32_MAX) + location = ir_location + i; + + if (storage == StorageClassInput && (has_member_loc_decor || has_var_loc_decor)) + { + uint32_t component = 0; + uint32_t orig_mbr_type_id = usable_type->self; + + if (has_member_loc_decor) + component = get_member_decoration(var_type.self, mbr_idx, DecorationComponent); + + var.basetype = ensure_correct_input_type(var.basetype, location, component, 0, meta.strip_array); + mbr_type_id = ensure_correct_input_type(usable_type->self, location, component, 0, meta.strip_array); + + // For members of the composite interface block, we only change the interface block type + // when interface matching happens. In the meantime, we store the original vector size + // and insert a swizzle when loading from metal interface block (see fixup below) + if (mbr_type_id != orig_mbr_type_id) + orig_vecsize = get(orig_mbr_type_id).vecsize; + + if (storage == StorageClassInput && pull_model_inputs.count(var.self)) + ib_type.member_types[ib_mbr_idx] = build_msl_interpolant_type(mbr_type_id, is_noperspective); + else + ib_type.member_types[ib_mbr_idx] = mbr_type_id; + } + + if ((!is_builtin && location != UINT32_MAX) || (is_builtin && ir_location != UINT32_MAX)) + { + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, location); + mark_location_as_used_by_shader(location, *usable_type, storage); + location++; + } + else if (is_builtin && (builtin == BuiltInClipDistance || builtin == BuiltInCullDistance)) + { + // Declare the Clip/CullDistance as [[user(clip/cullN)]]. + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationBuiltIn, builtin); + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationIndex, i); + } + + if (has_member_decoration(var_type.self, mbr_idx, DecorationComponent)) + SPIRV_CROSS_THROW("DecorationComponent on matrices and arrays is not supported."); + + if (storage != StorageClassInput || !pull_model_inputs.count(var.self)) + { + // Copy interpolation decorations if needed + if (is_flat) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationFlat); + if (is_noperspective) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationNoPerspective); + if (is_centroid) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationCentroid); + if (is_sample) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationSample); + } + + set_extended_member_decoration(ib_type.self, ib_mbr_idx, SPIRVCrossDecorationInterfaceOrigID, var.self); + set_extended_member_decoration(ib_type.self, ib_mbr_idx, SPIRVCrossDecorationInterfaceMemberIndex, var_mbr_idx); + + // Unflatten or flatten from [[stage_in]] or [[stage_out]] as appropriate. + if (!meta.strip_array && meta.allow_local_declaration) + { + string var_chain = join(var_chain_qual, ".", to_member_name(var_type, mbr_idx), (mbr_is_indexable ? join("[", i, "]") : "")); + switch (storage) + { + case StorageClassInput: + entry_func.fixup_hooks_in.push_back([=, &var]() { + string lerp_call; + string swizzle; + if (pull_model_inputs.count(var.self)) + { + if (is_centroid) + lerp_call = ".interpolate_at_centroid()"; + else if (is_sample) + lerp_call = join(".interpolate_at_sample(", to_expression(builtin_sample_id_id), ")"); + else + lerp_call = ".interpolate_at_center()"; + } + if (orig_vecsize != UINT32_MAX) + swizzle = vector_swizzle(orig_vecsize, 0); + statement(var_chain, " = ", ib_var_ref, ".", mbr_name, lerp_call, swizzle, ";"); + }); + break; + + case StorageClassOutput: + entry_func.fixup_hooks_out.push_back([=]() { + if (flatten_from_ib_var) + statement(ib_var_ref, ".", mbr_name, " = ", ib_var_ref, ".", flatten_from_ib_mbr_name, "[", i, "];"); + else + statement(ib_var_ref, ".", mbr_name, " = ", var_chain, ";"); + }); + break; + + default: + break; + } + } + } +} + +void CompilerMSL::add_plain_member_variable_to_interface_block(StorageClass storage, + const string &ib_var_ref, SPIRType &ib_type, + SPIRVariable &var, SPIRType &var_type, + uint32_t mbr_idx, InterfaceBlockMeta &meta, + const string &mbr_name_qual, + const string &var_chain_qual, + uint32_t &location, uint32_t &var_mbr_idx) +{ + auto &entry_func = get(ir.default_entry_point); + + BuiltIn builtin = BuiltInMax; + bool is_builtin = is_member_builtin(var_type, mbr_idx, &builtin); + bool is_flat = + has_member_decoration(var_type.self, mbr_idx, DecorationFlat) || has_decoration(var.self, DecorationFlat); + bool is_noperspective = has_member_decoration(var_type.self, mbr_idx, DecorationNoPerspective) || + has_decoration(var.self, DecorationNoPerspective); + bool is_centroid = has_member_decoration(var_type.self, mbr_idx, DecorationCentroid) || + has_decoration(var.self, DecorationCentroid); + bool is_sample = + has_member_decoration(var_type.self, mbr_idx, DecorationSample) || has_decoration(var.self, DecorationSample); + + // Add a reference to the member to the interface struct. + uint32_t mbr_type_id = var_type.member_types[mbr_idx]; + uint32_t ib_mbr_idx = uint32_t(ib_type.member_types.size()); + mbr_type_id = ensure_correct_builtin_type(mbr_type_id, builtin); + var_type.member_types[mbr_idx] = mbr_type_id; + if (storage == StorageClassInput && pull_model_inputs.count(var.self)) + ib_type.member_types.push_back(build_msl_interpolant_type(mbr_type_id, is_noperspective)); + else + ib_type.member_types.push_back(mbr_type_id); + + // Give the member a name + string mbr_name = ensure_valid_name(append_member_name(mbr_name_qual, var_type, mbr_idx), "m"); + set_member_name(ib_type.self, ib_mbr_idx, mbr_name); + + // Update the original variable reference to include the structure reference + string qual_var_name = ib_var_ref + "." + mbr_name; + // If using pull-model interpolation, need to add a call to the correct interpolation method. + if (storage == StorageClassInput && pull_model_inputs.count(var.self)) + { + if (is_centroid) + qual_var_name += ".interpolate_at_centroid()"; + else if (is_sample) + qual_var_name += join(".interpolate_at_sample(", to_expression(builtin_sample_id_id), ")"); + else + qual_var_name += ".interpolate_at_center()"; + } + + // The SPIRV location of interface variable, used to obtain the initial + // MSL location (the location variable) and interface matching + uint32_t ir_location = UINT32_MAX; + bool has_member_loc_decor = has_member_decoration(var_type.self, mbr_idx, DecorationLocation); + bool has_var_loc_decor = has_decoration(var.self, DecorationLocation); + uint32_t orig_vecsize = UINT32_MAX; + + if (has_member_loc_decor) + ir_location = get_member_decoration(var_type.self, mbr_idx, DecorationLocation); + else if (has_var_loc_decor) + ir_location = get_accumulated_member_location(var, mbr_idx, meta.strip_array); + else if (is_builtin) + { + if (is_tessellation_shader() && storage == StorageClassInput && inputs_by_builtin.count(builtin)) + ir_location = inputs_by_builtin[builtin].location; + else if (capture_output_to_buffer && storage == StorageClassOutput && outputs_by_builtin.count(builtin)) + ir_location = outputs_by_builtin[builtin].location; + } + + // Once we determine the location of the first member within nested structures, + // from a var of the topmost structure, the remaining flattened members of + // the nested structures will have consecutive location values. At this point, + // we've recursively tunnelled into structs, arrays, and matrices, and are + // down to a single location for each member now. + if (location == UINT32_MAX && ir_location != UINT32_MAX) + location = ir_location; + + if (storage == StorageClassInput && (has_member_loc_decor || has_var_loc_decor)) + { + uint32_t component = 0; + uint32_t orig_mbr_type_id = mbr_type_id; + + if (has_member_loc_decor) + component = get_member_decoration(var_type.self, mbr_idx, DecorationComponent); + + mbr_type_id = ensure_correct_input_type(mbr_type_id, location, component, 0, meta.strip_array); + + // For members of the composite interface block, we only change the interface block type + // when interface matching happens. In the meantime, we store the original vector size + // and insert a swizzle when loading from metal interface block (see fixup below) + if (mbr_type_id != orig_mbr_type_id) + orig_vecsize = get(orig_mbr_type_id).vecsize; + + if (storage == StorageClassInput && pull_model_inputs.count(var.self)) + ib_type.member_types[ib_mbr_idx] = build_msl_interpolant_type(mbr_type_id, is_noperspective); + else + ib_type.member_types[ib_mbr_idx] = mbr_type_id; + } + + bool flatten_stage_out = false; + string var_chain = var_chain_qual + "." + to_member_name(var_type, mbr_idx); + if (is_builtin && !meta.strip_array) + { + // For the builtin gl_PerVertex, we cannot treat it as a block anyways, + // so redirect to qualified name. + set_member_qualified_name(var_type.self, mbr_idx, qual_var_name); + } + else if (!meta.strip_array && meta.allow_local_declaration) + { + // Unflatten or flatten from [[stage_in]] or [[stage_out]] as appropriate. + switch (storage) + { + case StorageClassInput: + entry_func.fixup_hooks_in.push_back([=]() { + string swizzle; + // Insert swizzle for widened interface block vector from interface matching + if (orig_vecsize != UINT32_MAX) + swizzle = vector_swizzle(orig_vecsize, 0); + statement(var_chain, " = ", qual_var_name, swizzle, ";"); + }); + break; + + case StorageClassOutput: + flatten_stage_out = true; + entry_func.fixup_hooks_out.push_back([=]() { + statement(qual_var_name, " = ", var_chain, ";"); + }); + break; + + default: + break; + } + } + + if ((!is_builtin && location != UINT32_MAX) || (is_builtin && ir_location != UINT32_MAX)) + { + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, location); + mark_location_as_used_by_shader(location, get(mbr_type_id), storage); + location += type_to_location_count(get(mbr_type_id)); + } + + // Copy the component location, if present. + if (has_member_decoration(var_type.self, mbr_idx, DecorationComponent)) + { + uint32_t comp = get_member_decoration(var_type.self, mbr_idx, DecorationComponent); + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationComponent, comp); + } + + // Mark the member as builtin if needed + if (is_builtin) + { + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationBuiltIn, builtin); + if (builtin == BuiltInPosition && storage == StorageClassOutput) + qual_pos_var_name = qual_var_name; + } + + const SPIRConstant *c = nullptr; + if (!flatten_stage_out && var.storage == StorageClassOutput && + var.initializer != ID(0) && (c = maybe_get(var.initializer))) + { + if (meta.strip_array) + { + entry_func.fixup_hooks_in.push_back([=, &var]() { + auto &type = this->get(var.basetype); + uint32_t index = get_extended_member_decoration(var.self, mbr_idx, SPIRVCrossDecorationInterfaceMemberIndex); + + auto invocation = to_tesc_invocation_id(); + auto constant_chain = join(to_expression(var.initializer), "[", invocation, "]"); + statement(to_expression(stage_out_ptr_var_id), "[", + invocation, "].", + to_member_name(ib_type, index), " = ", + constant_chain, ".", to_member_name(type, mbr_idx), ";"); + }); + } + else + { + entry_func.fixup_hooks_in.push_back([=]() { + statement(qual_var_name, " = ", constant_expression( + this->get(c->subconstants[mbr_idx])), ";"); + }); + } + } + + if (storage != StorageClassInput || !pull_model_inputs.count(var.self)) + { + // Copy interpolation decorations if needed + if (is_flat) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationFlat); + if (is_noperspective) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationNoPerspective); + if (is_centroid) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationCentroid); + if (is_sample) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationSample); + } + + set_extended_member_decoration(ib_type.self, ib_mbr_idx, SPIRVCrossDecorationInterfaceOrigID, var.self); + set_extended_member_decoration(ib_type.self, ib_mbr_idx, SPIRVCrossDecorationInterfaceMemberIndex, var_mbr_idx); +} + +// In Metal, the tessellation levels are stored as tightly packed half-precision floating point values. +// But, stage-in attribute offsets and strides must be multiples of four, so we can't pass the levels +// individually. Therefore, we must pass them as vectors. Triangles get a single float4, with the outer +// levels in 'xyz' and the inner level in 'w'. Quads get a float4 containing the outer levels and a +// float2 containing the inner levels. +void CompilerMSL::add_tess_level_input_to_interface_block(const std::string &ib_var_ref, SPIRType &ib_type, + SPIRVariable &var) +{ + auto &var_type = get_variable_element_type(var); + + BuiltIn builtin = BuiltIn(get_decoration(var.self, DecorationBuiltIn)); + bool triangles = is_tessellating_triangles(); + string mbr_name; + + // Add a reference to the variable type to the interface struct. + uint32_t ib_mbr_idx = uint32_t(ib_type.member_types.size()); + + const auto mark_locations = [&](const SPIRType &new_var_type) { + if (get_decoration_bitset(var.self).get(DecorationLocation)) + { + uint32_t locn = get_decoration(var.self, DecorationLocation); + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn); + mark_location_as_used_by_shader(locn, new_var_type, StorageClassInput); + } + else if (inputs_by_builtin.count(builtin)) + { + uint32_t locn = inputs_by_builtin[builtin].location; + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn); + mark_location_as_used_by_shader(locn, new_var_type, StorageClassInput); + } + }; + + if (triangles) + { + // Triangles are tricky, because we want only one member in the struct. + mbr_name = "gl_TessLevel"; + + // If we already added the other one, we can skip this step. + if (!added_builtin_tess_level) + { + uint32_t type_id = build_extended_vector_type(var_type.self, 4); + + ib_type.member_types.push_back(type_id); + + // Give the member a name + set_member_name(ib_type.self, ib_mbr_idx, mbr_name); + + // We cannot decorate both, but the important part is that + // it's marked as builtin so we can get automatic attribute assignment if needed. + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationBuiltIn, builtin); + + mark_locations(var_type); + added_builtin_tess_level = true; + } + } + else + { + mbr_name = builtin_to_glsl(builtin, StorageClassFunction); + + uint32_t type_id = build_extended_vector_type(var_type.self, builtin == BuiltInTessLevelOuter ? 4 : 2); + + uint32_t ptr_type_id = ir.increase_bound_by(1); + auto &new_var_type = set(ptr_type_id, get(type_id)); + new_var_type.pointer = true; + new_var_type.pointer_depth++; + new_var_type.storage = StorageClassInput; + new_var_type.parent_type = type_id; + + ib_type.member_types.push_back(type_id); + + // Give the member a name + set_member_name(ib_type.self, ib_mbr_idx, mbr_name); + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationBuiltIn, builtin); + + mark_locations(new_var_type); + } + + add_tess_level_input(ib_var_ref, mbr_name, var); +} + +void CompilerMSL::add_tess_level_input(const std::string &base_ref, const std::string &mbr_name, SPIRVariable &var) +{ + auto &entry_func = get(ir.default_entry_point); + BuiltIn builtin = BuiltIn(get_decoration(var.self, DecorationBuiltIn)); + + // Force the variable to have the proper name. + string var_name = builtin_to_glsl(builtin, StorageClassFunction); + set_name(var.self, var_name); + + // We need to declare the variable early and at entry-point scope. + entry_func.add_local_variable(var.self); + vars_needing_early_declaration.push_back(var.self); + bool triangles = is_tessellating_triangles(); + + if (builtin == BuiltInTessLevelOuter) + { + entry_func.fixup_hooks_in.push_back( + [=]() + { + statement(var_name, "[0] = ", base_ref, ".", mbr_name, "[0];"); + statement(var_name, "[1] = ", base_ref, ".", mbr_name, "[1];"); + statement(var_name, "[2] = ", base_ref, ".", mbr_name, "[2];"); + if (!triangles) + statement(var_name, "[3] = ", base_ref, ".", mbr_name, "[3];"); + }); + } + else + { + entry_func.fixup_hooks_in.push_back([=]() { + if (triangles) + { + if (msl_options.raw_buffer_tese_input) + statement(var_name, "[0] = ", base_ref, ".", mbr_name, ";"); + else + statement(var_name, "[0] = ", base_ref, ".", mbr_name, "[3];"); + } + else + { + statement(var_name, "[0] = ", base_ref, ".", mbr_name, "[0];"); + statement(var_name, "[1] = ", base_ref, ".", mbr_name, "[1];"); + } + }); + } +} + +bool CompilerMSL::variable_storage_requires_stage_io(StorageClass storage) const +{ + if (storage == StorageClassOutput) + return !capture_output_to_buffer; + else if (storage == StorageClassInput) + return !(is_tesc_shader() && msl_options.multi_patch_workgroup) && + !(is_tese_shader() && msl_options.raw_buffer_tese_input); + else + return false; +} + +string CompilerMSL::to_tesc_invocation_id() +{ + if (msl_options.multi_patch_workgroup) + { + // n.b. builtin_invocation_id_id here is the dispatch global invocation ID, + // not the TC invocation ID. + return join(to_expression(builtin_invocation_id_id), ".x % ", get_entry_point().output_vertices); + } + else + return builtin_to_glsl(BuiltInInvocationId, StorageClassInput); +} + +void CompilerMSL::emit_local_masked_variable(const SPIRVariable &masked_var, bool strip_array) +{ + auto &entry_func = get(ir.default_entry_point); + bool threadgroup_storage = variable_decl_is_remapped_storage(masked_var, StorageClassWorkgroup); + + if (threadgroup_storage && msl_options.multi_patch_workgroup) + { + // We need one threadgroup block per patch, so fake this. + entry_func.fixup_hooks_in.push_back([this, &masked_var]() { + auto &type = get_variable_data_type(masked_var); + add_local_variable_name(masked_var.self); + + const uint32_t max_control_points_per_patch = 32u; + uint32_t max_num_instances = + (max_control_points_per_patch + get_entry_point().output_vertices - 1u) / + get_entry_point().output_vertices; + statement("threadgroup ", type_to_glsl(type), " ", + "spvStorage", to_name(masked_var.self), "[", max_num_instances, "]", + type_to_array_glsl(type, 0), ";"); + + // Assign a threadgroup slice to each PrimitiveID. + // We assume here that workgroup size is rounded to 32, + // since that's the maximum number of control points per patch. + // We cannot size the array based on fixed dispatch parameters, + // since Metal does not allow that. :( + // FIXME: We will likely need an option to support passing down target workgroup size, + // so we can emit appropriate size here. + statement("threadgroup auto ", + "&", to_name(masked_var.self), + " = spvStorage", to_name(masked_var.self), "[", + "(", to_expression(builtin_invocation_id_id), ".x / ", + get_entry_point().output_vertices, ") % ", + max_num_instances, "];"); + }); + } + else + { + entry_func.add_local_variable(masked_var.self); + } + + if (!threadgroup_storage) + { + vars_needing_early_declaration.push_back(masked_var.self); + } + else if (masked_var.initializer) + { + // Cannot directly initialize threadgroup variables. Need fixup hooks. + ID initializer = masked_var.initializer; + if (strip_array) + { + entry_func.fixup_hooks_in.push_back([this, &masked_var, initializer]() { + auto invocation = to_tesc_invocation_id(); + statement(to_expression(masked_var.self), "[", + invocation, "] = ", + to_expression(initializer), "[", + invocation, "];"); + }); + } + else + { + entry_func.fixup_hooks_in.push_back([this, &masked_var, initializer]() { + statement(to_expression(masked_var.self), " = ", to_expression(initializer), ";"); + }); + } + } +} + +void CompilerMSL::add_variable_to_interface_block(StorageClass storage, const string &ib_var_ref, SPIRType &ib_type, + SPIRVariable &var, InterfaceBlockMeta &meta) +{ + auto &entry_func = get(ir.default_entry_point); + // Tessellation control I/O variables and tessellation evaluation per-point inputs are + // usually declared as arrays. In these cases, we want to add the element type to the + // interface block, since in Metal it's the interface block itself which is arrayed. + auto &var_type = meta.strip_array ? get_variable_element_type(var) : get_variable_data_type(var); + bool is_builtin = is_builtin_variable(var); + auto builtin = BuiltIn(get_decoration(var.self, DecorationBuiltIn)); + bool is_block = has_decoration(var_type.self, DecorationBlock); + + // If stage variables are masked out, emit them as plain variables instead. + // For builtins, we query them one by one later. + // IO blocks are not masked here, we need to mask them per-member instead. + if (storage == StorageClassOutput && is_stage_output_variable_masked(var)) + { + // If we ignore an output, we must still emit it, since it might be used by app. + // Instead, just emit it as early declaration. + emit_local_masked_variable(var, meta.strip_array); + return; + } + + // Tesselation stages pass I/O via buffer content which may contain nested structs. + // Ensure the vector sizes of any nested struct members within these input variables match + // the vector sizes of the corresponding output variables from the previous pipeline stage. + // This adjustment is handled here instead of ensure_correct_input_type() in order to + // perform the necessary recursive processing. + if (storage == StorageClassInput && var_type.basetype == SPIRType::Struct && + ((is_tesc_shader() && msl_options.multi_patch_workgroup) || + (is_tese_shader() && msl_options.raw_buffer_tese_input)) && + has_decoration(var.self, DecorationLocation)) + { + uint32_t locn = get_decoration(var.self, DecorationLocation); + ensure_struct_members_valid_vecsizes(get_variable_data_type(var), locn); + } + + if (storage == StorageClassInput && has_decoration(var.self, DecorationPerVertexKHR)) + SPIRV_CROSS_THROW("PerVertexKHR decoration is not supported in MSL."); + + // If variable names alias, they will end up with wrong names in the interface struct, because + // there might be aliases in the member name cache and there would be a mismatch in fixup_in code. + // Make sure to register the variables as unique resource names ahead of time. + // This would normally conflict with the name cache when emitting local variables, + // but this happens in the setup stage, before we hit compilation loops. + // The name cache is cleared before we actually emit code, so this is safe. + add_resource_name(var.self); + + if (var_type.basetype == SPIRType::Struct) + { + bool block_requires_flattening = + variable_storage_requires_stage_io(storage) || (is_block && var_type.array.empty()); + bool needs_local_declaration = !is_builtin && block_requires_flattening && meta.allow_local_declaration; + + if (needs_local_declaration) + { + // For I/O blocks or structs, we will need to pass the block itself around + // to functions if they are used globally in leaf functions. + // Rather than passing down member by member, + // we unflatten I/O blocks while running the shader, + // and pass the actual struct type down to leaf functions. + // We then unflatten inputs, and flatten outputs in the "fixup" stages. + emit_local_masked_variable(var, meta.strip_array); + } + + if (!block_requires_flattening) + { + // In Metal tessellation shaders, the interface block itself is arrayed. This makes things + // very complicated, since stage-in structures in MSL don't support nested structures. + // Luckily, for stage-out when capturing output, we can avoid this and just add + // composite members directly, because the stage-out structure is stored to a buffer, + // not returned. + add_plain_variable_to_interface_block(storage, ib_var_ref, ib_type, var, meta); + } + else + { + bool masked_block = false; + uint32_t location = UINT32_MAX; + uint32_t var_mbr_idx = 0; + uint32_t elem_cnt = 1; + if (is_matrix(var_type)) + { + if (is_array(var_type)) + SPIRV_CROSS_THROW("MSL cannot emit arrays-of-matrices in input and output variables."); + + elem_cnt = var_type.columns; + } + else if (is_array(var_type)) + { + if (var_type.array.size() != 1) + SPIRV_CROSS_THROW("MSL cannot emit arrays-of-arrays in input and output variables."); + + elem_cnt = to_array_size_literal(var_type); + } + + for (uint32_t elem_idx = 0; elem_idx < elem_cnt; elem_idx++) + { + // Flatten the struct members into the interface struct + for (uint32_t mbr_idx = 0; mbr_idx < uint32_t(var_type.member_types.size()); mbr_idx++) + { + builtin = BuiltInMax; + is_builtin = is_member_builtin(var_type, mbr_idx, &builtin); + auto &mbr_type = get(var_type.member_types[mbr_idx]); + + if (storage == StorageClassOutput && is_stage_output_block_member_masked(var, mbr_idx, meta.strip_array)) + { + location = UINT32_MAX; // Skip this member and resolve location again on next var member + + if (is_block) + masked_block = true; + + // Non-builtin block output variables are just ignored, since they will still access + // the block variable as-is. They're just not flattened. + if (is_builtin && !meta.strip_array) + { + // Emit a fake variable instead. + uint32_t ids = ir.increase_bound_by(2); + uint32_t ptr_type_id = ids + 0; + uint32_t var_id = ids + 1; + + auto ptr_type = mbr_type; + ptr_type.pointer = true; + ptr_type.pointer_depth++; + ptr_type.parent_type = var_type.member_types[mbr_idx]; + ptr_type.storage = StorageClassOutput; + + uint32_t initializer = 0; + if (var.initializer) + if (auto *c = maybe_get(var.initializer)) + initializer = c->subconstants[mbr_idx]; + + set(ptr_type_id, ptr_type); + set(var_id, ptr_type_id, StorageClassOutput, initializer); + entry_func.add_local_variable(var_id); + vars_needing_early_declaration.push_back(var_id); + set_name(var_id, builtin_to_glsl(builtin, StorageClassOutput)); + set_decoration(var_id, DecorationBuiltIn, builtin); + } + } + else if (!is_builtin || has_active_builtin(builtin, storage)) + { + bool is_composite_type = is_matrix(mbr_type) || is_array(mbr_type) || mbr_type.basetype == SPIRType::Struct; + bool attribute_load_store = + storage == StorageClassInput && get_execution_model() != ExecutionModelFragment; + bool storage_is_stage_io = variable_storage_requires_stage_io(storage); + + // Clip/CullDistance always need to be declared as user attributes. + if (builtin == BuiltInClipDistance || builtin == BuiltInCullDistance) + is_builtin = false; + + const string var_name = to_name(var.self); + string mbr_name_qual = var_name; + string var_chain_qual = var_name; + if (elem_cnt > 1) + { + mbr_name_qual += join("_", elem_idx); + var_chain_qual += join("[", elem_idx, "]"); + } + + if ((!is_builtin || attribute_load_store) && storage_is_stage_io && is_composite_type) + { + add_composite_member_variable_to_interface_block(storage, ib_var_ref, ib_type, + var, var_type, mbr_idx, meta, + mbr_name_qual, var_chain_qual, + location, var_mbr_idx, {}); + } + else + { + add_plain_member_variable_to_interface_block(storage, ib_var_ref, ib_type, + var, var_type, mbr_idx, meta, + mbr_name_qual, var_chain_qual, + location, var_mbr_idx); + } + } + var_mbr_idx++; + } + } + + // If we're redirecting a block, we might still need to access the original block + // variable if we're masking some members. + if (masked_block && !needs_local_declaration && (!is_builtin_variable(var) || is_tesc_shader())) + { + if (is_builtin_variable(var)) + { + // Ensure correct names for the block members if we're actually going to + // declare gl_PerVertex. + for (uint32_t mbr_idx = 0; mbr_idx < uint32_t(var_type.member_types.size()); mbr_idx++) + { + set_member_name(var_type.self, mbr_idx, builtin_to_glsl( + BuiltIn(get_member_decoration(var_type.self, mbr_idx, DecorationBuiltIn)), + StorageClassOutput)); + } + + set_name(var_type.self, "gl_PerVertex"); + set_name(var.self, "gl_out_masked"); + stage_out_masked_builtin_type_id = var_type.self; + } + emit_local_masked_variable(var, meta.strip_array); + } + } + } + else if (is_tese_shader() && storage == StorageClassInput && !meta.strip_array && is_builtin && + (builtin == BuiltInTessLevelOuter || builtin == BuiltInTessLevelInner)) + { + add_tess_level_input_to_interface_block(ib_var_ref, ib_type, var); + } + else if (var_type.basetype == SPIRType::Boolean || var_type.basetype == SPIRType::Char || + type_is_integral(var_type) || type_is_floating_point(var_type)) + { + if (!is_builtin || has_active_builtin(builtin, storage)) + { + bool is_composite_type = is_matrix(var_type) || is_array(var_type); + bool storage_is_stage_io = variable_storage_requires_stage_io(storage); + bool attribute_load_store = storage == StorageClassInput && get_execution_model() != ExecutionModelFragment; + + // Clip/CullDistance always needs to be declared as user attributes. + if (builtin == BuiltInClipDistance || builtin == BuiltInCullDistance) + is_builtin = false; + + // MSL does not allow matrices or arrays in input or output variables, so need to handle it specially. + if ((!is_builtin || attribute_load_store) && storage_is_stage_io && is_composite_type) + { + add_composite_variable_to_interface_block(storage, ib_var_ref, ib_type, var, meta); + } + else + { + add_plain_variable_to_interface_block(storage, ib_var_ref, ib_type, var, meta); + } + } + } +} + +// Recursively iterate into the input struct type, and adjust the vecsize +// of any nested members, based on location info provided through the API. +// The location parameter is modified recursively. +void CompilerMSL::ensure_struct_members_valid_vecsizes(SPIRType &struct_type, uint32_t &location) +{ + assert(struct_type.basetype == SPIRType::Struct); + + auto mbr_cnt = struct_type.member_types.size(); + for (size_t mbr_idx = 0; mbr_idx < mbr_cnt; mbr_idx++) + { + auto mbr_type_id = struct_type.member_types[mbr_idx]; + auto &mbr_type = get(mbr_type_id); + + if (mbr_type.basetype == SPIRType::Struct) + ensure_struct_members_valid_vecsizes(mbr_type, location); + else + { + auto p_va = inputs_by_location.find({location, 0}); + if (p_va != end(inputs_by_location) && p_va->second.vecsize > mbr_type.vecsize) + { + // Set a new member type into the struct type, and all its parent types. + auto new_mbr_type_id = build_extended_vector_type(mbr_type_id, p_va->second.vecsize); + for (auto *p_type = &struct_type; p_type; p_type = maybe_get(p_type->parent_type)) + p_type->member_types[mbr_idx] = new_mbr_type_id; + } + + // Calc location of next member + uint32_t loc_cnt = mbr_type.columns; + auto dim_cnt = mbr_type.array.size(); + for (uint32_t i = 0; i < dim_cnt; i++) + loc_cnt *= to_array_size_literal(mbr_type, i); + + location += loc_cnt; + } + } +} + +// Fix up the mapping of variables to interface member indices, which is used to compile access chains +// for per-vertex variables in a tessellation control shader. +void CompilerMSL::fix_up_interface_member_indices(StorageClass storage, uint32_t ib_type_id) +{ + // Only needed for tessellation shaders and pull-model interpolants. + // Need to redirect interface indices back to variables themselves. + // For structs, each member of the struct need a separate instance. + if (!is_tesc_shader() && !(is_tese_shader() && storage == StorageClassInput) && + !(get_execution_model() == ExecutionModelFragment && storage == StorageClassInput && + !pull_model_inputs.empty())) + return; + + auto mbr_cnt = uint32_t(ir.meta[ib_type_id].members.size()); + for (uint32_t i = 0; i < mbr_cnt; i++) + { + uint32_t var_id = get_extended_member_decoration(ib_type_id, i, SPIRVCrossDecorationInterfaceOrigID); + if (!var_id) + continue; + auto &var = get(var_id); + + auto &type = get_variable_element_type(var); + + bool flatten_composites = variable_storage_requires_stage_io(var.storage); + bool is_block = has_decoration(type.self, DecorationBlock); + + uint32_t mbr_idx = uint32_t(-1); + if (type.basetype == SPIRType::Struct && (flatten_composites || is_block)) + mbr_idx = get_extended_member_decoration(ib_type_id, i, SPIRVCrossDecorationInterfaceMemberIndex); + + if (mbr_idx != uint32_t(-1)) + { + // Only set the lowest InterfaceMemberIndex for each variable member. + // IB struct members will be emitted in-order w.r.t. interface member index. + if (!has_extended_member_decoration(var_id, mbr_idx, SPIRVCrossDecorationInterfaceMemberIndex)) + set_extended_member_decoration(var_id, mbr_idx, SPIRVCrossDecorationInterfaceMemberIndex, i); + } + else + { + // Only set the lowest InterfaceMemberIndex for each variable. + // IB struct members will be emitted in-order w.r.t. interface member index. + if (!has_extended_decoration(var_id, SPIRVCrossDecorationInterfaceMemberIndex)) + set_extended_decoration(var_id, SPIRVCrossDecorationInterfaceMemberIndex, i); + } + } +} + +// Add an interface structure for the type of storage, which is either StorageClassInput or StorageClassOutput. +// Returns the ID of the newly added variable, or zero if no variable was added. +uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch) +{ + // Accumulate the variables that should appear in the interface struct. + SmallVector vars; + bool incl_builtins = storage == StorageClassOutput || is_tessellation_shader(); + bool has_seen_barycentric = false; + + InterfaceBlockMeta meta; + + // Varying interfaces between stages which use "user()" attribute can be dealt with + // without explicit packing and unpacking of components. For any variables which link against the runtime + // in some way (vertex attributes, fragment output, etc), we'll need to deal with it somehow. + bool pack_components = + (storage == StorageClassInput && get_execution_model() == ExecutionModelVertex) || + (storage == StorageClassOutput && get_execution_model() == ExecutionModelFragment) || + (storage == StorageClassOutput && get_execution_model() == ExecutionModelVertex && capture_output_to_buffer); + + ir.for_each_typed_id([&](uint32_t var_id, SPIRVariable &var) { + if (var.storage != storage) + return; + + auto &type = this->get(var.basetype); + + bool is_builtin = is_builtin_variable(var); + bool is_block = has_decoration(type.self, DecorationBlock); + + auto bi_type = BuiltInMax; + bool builtin_is_gl_in_out = false; + if (is_builtin && !is_block) + { + bi_type = BuiltIn(get_decoration(var_id, DecorationBuiltIn)); + builtin_is_gl_in_out = bi_type == BuiltInPosition || bi_type == BuiltInPointSize || + bi_type == BuiltInClipDistance || bi_type == BuiltInCullDistance; + } + + if (is_builtin && is_block) + builtin_is_gl_in_out = true; + + uint32_t location = get_decoration(var_id, DecorationLocation); + + bool builtin_is_stage_in_out = builtin_is_gl_in_out || + bi_type == BuiltInLayer || bi_type == BuiltInViewportIndex || + bi_type == BuiltInBaryCoordKHR || bi_type == BuiltInBaryCoordNoPerspKHR || + bi_type == BuiltInFragDepth || + bi_type == BuiltInFragStencilRefEXT || bi_type == BuiltInSampleMask; + + // These builtins are part of the stage in/out structs. + bool is_interface_block_builtin = + builtin_is_stage_in_out || (is_tese_shader() && !msl_options.raw_buffer_tese_input && + (bi_type == BuiltInTessLevelOuter || bi_type == BuiltInTessLevelInner)); + + bool is_active = interface_variable_exists_in_entry_point(var.self); + if (is_builtin && is_active) + { + // Only emit the builtin if it's active in this entry point. Interface variable list might lie. + if (is_block) + { + // If any builtin is active, the block is active. + uint32_t mbr_cnt = uint32_t(type.member_types.size()); + for (uint32_t i = 0; !is_active && i < mbr_cnt; i++) + is_active = has_active_builtin(BuiltIn(get_member_decoration(type.self, i, DecorationBuiltIn)), storage); + } + else + { + is_active = has_active_builtin(bi_type, storage); + } + } + + bool filter_patch_decoration = (has_decoration(var_id, DecorationPatch) || is_patch_block(type)) == patch; + + bool hidden = is_hidden_variable(var, incl_builtins); + + // ClipDistance is never hidden, we need to emulate it when used as an input. + if (bi_type == BuiltInClipDistance || bi_type == BuiltInCullDistance) + hidden = false; + + // It's not enough to simply avoid marking fragment outputs if the pipeline won't + // accept them. We can't put them in the struct at all, or otherwise the compiler + // complains that the outputs weren't explicitly marked. + // Frag depth and stencil outputs are incompatible with explicit early fragment tests. + // In GLSL, depth and stencil outputs are just ignored when explicit early fragment tests are required. + // In Metal, it's a compilation error, so we need to exclude them from the output struct. + if (get_execution_model() == ExecutionModelFragment && storage == StorageClassOutput && !patch && + ((is_builtin && ((bi_type == BuiltInFragDepth && (!msl_options.enable_frag_depth_builtin || uses_explicit_early_fragment_test())) || + (bi_type == BuiltInFragStencilRefEXT && (!msl_options.enable_frag_stencil_ref_builtin || uses_explicit_early_fragment_test())))) || + (!is_builtin && !(msl_options.enable_frag_output_mask & (1 << location))))) + { + hidden = true; + disabled_frag_outputs.push_back(var_id); + // If a builtin, force it to have the proper name, and mark it as not part of the output struct. + if (is_builtin) + { + set_name(var_id, builtin_to_glsl(bi_type, StorageClassFunction)); + mask_stage_output_by_builtin(bi_type); + } + } + + // Barycentric inputs must be emitted in stage-in, because they can have interpolation arguments. + if (is_active && (bi_type == BuiltInBaryCoordKHR || bi_type == BuiltInBaryCoordNoPerspKHR)) + { + if (has_seen_barycentric) + SPIRV_CROSS_THROW("Cannot declare both BaryCoordNV and BaryCoordNoPerspNV in same shader in MSL."); + has_seen_barycentric = true; + hidden = false; + } + + if (is_active && !hidden && type.pointer && filter_patch_decoration && + (!is_builtin || is_interface_block_builtin)) + { + vars.push_back(&var); + + if (!is_builtin) + { + // Need to deal specially with DecorationComponent. + // Multiple variables can alias the same Location, and try to make sure each location is declared only once. + // We will swizzle data in and out to make this work. + // This is only relevant for vertex inputs and fragment outputs. + // Technically tessellation as well, but it is too complicated to support. + uint32_t component = get_decoration(var_id, DecorationComponent); + if (component != 0) + { + if (is_tessellation_shader()) + SPIRV_CROSS_THROW("Component decoration is not supported in tessellation shaders."); + else if (pack_components) + { + uint32_t array_size = 1; + if (!type.array.empty()) + array_size = to_array_size_literal(type); + + for (uint32_t location_offset = 0; location_offset < array_size; location_offset++) + { + auto &location_meta = meta.location_meta[location + location_offset]; + location_meta.num_components = max(location_meta.num_components, component + type.vecsize); + + // For variables sharing location, decorations and base type must match. + location_meta.base_type_id = type.self; + location_meta.flat = has_decoration(var.self, DecorationFlat); + location_meta.noperspective = has_decoration(var.self, DecorationNoPerspective); + location_meta.centroid = has_decoration(var.self, DecorationCentroid); + location_meta.sample = has_decoration(var.self, DecorationSample); + } + } + } + } + } + + if (is_tese_shader() && msl_options.raw_buffer_tese_input && patch && storage == StorageClassInput && + (bi_type == BuiltInTessLevelOuter || bi_type == BuiltInTessLevelInner)) + { + // In this case, we won't add the builtin to the interface struct, + // but we still need the hook to run to populate the arrays. + string base_ref = join(tess_factor_buffer_var_name, "[", to_expression(builtin_primitive_id_id), "]"); + const char *mbr_name = + bi_type == BuiltInTessLevelOuter ? "edgeTessellationFactor" : "insideTessellationFactor"; + add_tess_level_input(base_ref, mbr_name, var); + if (inputs_by_builtin.count(bi_type)) + { + uint32_t locn = inputs_by_builtin[bi_type].location; + mark_location_as_used_by_shader(locn, type, StorageClassInput); + } + } + }); + + // If no variables qualify, leave. + // For patch input in a tessellation evaluation shader, the per-vertex stage inputs + // are included in a special patch control point array. + if (vars.empty() && + !(!msl_options.raw_buffer_tese_input && storage == StorageClassInput && patch && stage_in_var_id)) + return 0; + + // Add a new typed variable for this interface structure. + // The initializer expression is allocated here, but populated when the function + // declaraion is emitted, because it is cleared after each compilation pass. + uint32_t next_id = ir.increase_bound_by(3); + uint32_t ib_type_id = next_id++; + auto &ib_type = set(ib_type_id, OpTypeStruct); + ib_type.basetype = SPIRType::Struct; + ib_type.storage = storage; + set_decoration(ib_type_id, DecorationBlock); + + uint32_t ib_var_id = next_id++; + auto &var = set(ib_var_id, ib_type_id, storage, 0); + var.initializer = next_id++; + + string ib_var_ref; + auto &entry_func = get(ir.default_entry_point); + switch (storage) + { + case StorageClassInput: + ib_var_ref = patch ? patch_stage_in_var_name : stage_in_var_name; + switch (get_execution_model()) + { + case ExecutionModelTessellationControl: + // Add a hook to populate the shared workgroup memory containing the gl_in array. + entry_func.fixup_hooks_in.push_back([=]() { + // Can't use PatchVertices, PrimitiveId, or InvocationId yet; the hooks for those may not have run yet. + if (msl_options.multi_patch_workgroup) + { + // n.b. builtin_invocation_id_id here is the dispatch global invocation ID, + // not the TC invocation ID. + statement("device ", to_name(ir.default_entry_point), "_", ib_var_ref, "* gl_in = &", + input_buffer_var_name, "[min(", to_expression(builtin_invocation_id_id), ".x / ", + get_entry_point().output_vertices, + ", spvIndirectParams[1] - 1) * spvIndirectParams[0]];"); + } + else + { + // It's safe to use InvocationId here because it's directly mapped to a + // Metal builtin, and therefore doesn't need a hook. + statement("if (", to_expression(builtin_invocation_id_id), " < spvIndirectParams[0])"); + statement(" ", input_wg_var_name, "[", to_expression(builtin_invocation_id_id), + "] = ", ib_var_ref, ";"); + statement("threadgroup_barrier(mem_flags::mem_threadgroup);"); + statement("if (", to_expression(builtin_invocation_id_id), + " >= ", get_entry_point().output_vertices, ")"); + statement(" return;"); + } + }); + break; + case ExecutionModelTessellationEvaluation: + if (!msl_options.raw_buffer_tese_input) + break; + if (patch) + { + entry_func.fixup_hooks_in.push_back( + [=]() + { + statement("const device ", to_name(ir.default_entry_point), "_", ib_var_ref, "& ", ib_var_ref, + " = ", patch_input_buffer_var_name, "[", to_expression(builtin_primitive_id_id), + "];"); + }); + } + else + { + entry_func.fixup_hooks_in.push_back( + [=]() + { + statement("const device ", to_name(ir.default_entry_point), "_", ib_var_ref, "* gl_in = &", + input_buffer_var_name, "[", to_expression(builtin_primitive_id_id), " * ", + get_entry_point().output_vertices, "];"); + }); + } + break; + default: + break; + } + break; + + case StorageClassOutput: + { + ib_var_ref = patch ? patch_stage_out_var_name : stage_out_var_name; + + // Add the output interface struct as a local variable to the entry function. + // If the entry point should return the output struct, set the entry function + // to return the output interface struct, otherwise to return nothing. + // Watch out for the rare case where the terminator of the last entry point block is a + // Kill or Unreachable, instead of a Return. Based on SPIR-V's block-domination rules, + // we assume that any block that has a Kill will also have a terminating Return, except + // the last block. + // Indicate the output var requires early initialization. + bool ep_should_return_output = !get_is_rasterization_disabled(); + uint32_t rtn_id = ep_should_return_output ? ib_var_id : 0; + if (!capture_output_to_buffer) + { + entry_func.add_local_variable(ib_var_id); + for (auto &blk_id : entry_func.blocks) + { + auto &blk = get(blk_id); + auto last_blk_return = blk.terminator == SPIRBlock::Kill || blk.terminator == SPIRBlock::Unreachable; + if (blk.terminator == SPIRBlock::Return || (last_blk_return && blk_id == entry_func.blocks.back())) + blk.return_value = rtn_id; + } + vars_needing_early_declaration.push_back(ib_var_id); + } + else + { + switch (get_execution_model()) + { + case ExecutionModelVertex: + case ExecutionModelTessellationEvaluation: + // Instead of declaring a struct variable to hold the output and then + // copying that to the output buffer, we'll declare the output variable + // as a reference to the final output element in the buffer. Then we can + // avoid the extra copy. + entry_func.fixup_hooks_in.push_back([=]() { + if (stage_out_var_id) + { + // The first member of the indirect buffer is always the number of vertices + // to draw. + // We zero-base the InstanceID & VertexID variables for HLSL emulation elsewhere, so don't do it twice + if (get_execution_model() == ExecutionModelVertex && msl_options.vertex_for_tessellation) + { + statement("device ", to_name(ir.default_entry_point), "_", ib_var_ref, "& ", ib_var_ref, + " = ", output_buffer_var_name, "[", to_expression(builtin_invocation_id_id), + ".y * ", to_expression(builtin_stage_input_size_id), ".x + ", + to_expression(builtin_invocation_id_id), ".x];"); + } + else if (msl_options.enable_base_index_zero) + { + statement("device ", to_name(ir.default_entry_point), "_", ib_var_ref, "& ", ib_var_ref, + " = ", output_buffer_var_name, "[", to_expression(builtin_instance_idx_id), + " * spvIndirectParams[0] + ", to_expression(builtin_vertex_idx_id), "];"); + } + else + { + statement("device ", to_name(ir.default_entry_point), "_", ib_var_ref, "& ", ib_var_ref, + " = ", output_buffer_var_name, "[(", to_expression(builtin_instance_idx_id), + " - ", to_expression(builtin_base_instance_id), ") * spvIndirectParams[0] + ", + to_expression(builtin_vertex_idx_id), " - ", + to_expression(builtin_base_vertex_id), "];"); + } + } + }); + break; + case ExecutionModelTessellationControl: + if (msl_options.multi_patch_workgroup) + { + // We cannot use PrimitiveId here, because the hook may not have run yet. + if (patch) + { + entry_func.fixup_hooks_in.push_back([=]() { + statement("device ", to_name(ir.default_entry_point), "_", ib_var_ref, "& ", ib_var_ref, + " = ", patch_output_buffer_var_name, "[", to_expression(builtin_invocation_id_id), + ".x / ", get_entry_point().output_vertices, "];"); + }); + } + else + { + entry_func.fixup_hooks_in.push_back([=]() { + statement("device ", to_name(ir.default_entry_point), "_", ib_var_ref, "* gl_out = &", + output_buffer_var_name, "[", to_expression(builtin_invocation_id_id), ".x - ", + to_expression(builtin_invocation_id_id), ".x % ", + get_entry_point().output_vertices, "];"); + }); + } + } + else + { + if (patch) + { + entry_func.fixup_hooks_in.push_back([=]() { + statement("device ", to_name(ir.default_entry_point), "_", ib_var_ref, "& ", ib_var_ref, + " = ", patch_output_buffer_var_name, "[", to_expression(builtin_primitive_id_id), + "];"); + }); + } + else + { + entry_func.fixup_hooks_in.push_back([=]() { + statement("device ", to_name(ir.default_entry_point), "_", ib_var_ref, "* gl_out = &", + output_buffer_var_name, "[", to_expression(builtin_primitive_id_id), " * ", + get_entry_point().output_vertices, "];"); + }); + } + } + break; + default: + break; + } + } + break; + } + + default: + break; + } + + set_name(ib_type_id, to_name(ir.default_entry_point) + "_" + ib_var_ref); + set_name(ib_var_id, ib_var_ref); + + for (auto *p_var : vars) + { + bool strip_array = (is_tesc_shader() || (is_tese_shader() && storage == StorageClassInput)) && !patch; + + // Fixing up flattened stores in TESC is impossible since the memory is group shared either via + // device (not masked) or threadgroup (masked) storage classes and it's race condition city. + meta.strip_array = strip_array; + meta.allow_local_declaration = !strip_array && !(is_tesc_shader() && storage == StorageClassOutput); + add_variable_to_interface_block(storage, ib_var_ref, ib_type, *p_var, meta); + } + + if (((is_tesc_shader() && msl_options.multi_patch_workgroup) || + (is_tese_shader() && msl_options.raw_buffer_tese_input)) && + storage == StorageClassInput) + { + // For tessellation inputs, add all outputs from the previous stage to ensure + // the struct containing them is the correct size and layout. + for (auto &input : inputs_by_location) + { + if (location_inputs_in_use.count(input.first.location) != 0) + continue; + + if (patch != (input.second.rate == MSL_SHADER_VARIABLE_RATE_PER_PATCH)) + continue; + + // Tessellation levels have their own struct, so there's no need to add them here. + if (input.second.builtin == BuiltInTessLevelOuter || input.second.builtin == BuiltInTessLevelInner) + continue; + + // Create a fake variable to put at the location. + uint32_t offset = ir.increase_bound_by(5); + uint32_t type_id = offset; + uint32_t vec_type_id = offset + 1; + uint32_t array_type_id = offset + 2; + uint32_t ptr_type_id = offset + 3; + uint32_t var_id = offset + 4; + + SPIRType type { OpTypeInt }; + switch (input.second.format) + { + case MSL_SHADER_VARIABLE_FORMAT_UINT16: + case MSL_SHADER_VARIABLE_FORMAT_ANY16: + type.basetype = SPIRType::UShort; + type.width = 16; + break; + case MSL_SHADER_VARIABLE_FORMAT_ANY32: + default: + type.basetype = SPIRType::UInt; + type.width = 32; + break; + } + set(type_id, type); + if (input.second.vecsize > 1) + { + type.op = OpTypeVector; + type.vecsize = input.second.vecsize; + set(vec_type_id, type); + type_id = vec_type_id; + } + + type.op = OpTypeArray; + type.array.push_back(0); + type.array_size_literal.push_back(true); + type.parent_type = type_id; + set(array_type_id, type); + type.self = type_id; + + type.op = OpTypePointer; + type.pointer = true; + type.pointer_depth++; + type.parent_type = array_type_id; + type.storage = storage; + auto &ptr_type = set(ptr_type_id, type); + ptr_type.self = array_type_id; + + auto &fake_var = set(var_id, ptr_type_id, storage); + set_decoration(var_id, DecorationLocation, input.first.location); + if (input.first.component) + set_decoration(var_id, DecorationComponent, input.first.component); + + meta.strip_array = true; + meta.allow_local_declaration = false; + add_variable_to_interface_block(storage, ib_var_ref, ib_type, fake_var, meta); + } + } + + if (capture_output_to_buffer && storage == StorageClassOutput) + { + // For captured output, add all inputs from the next stage to ensure + // the struct containing them is the correct size and layout. This is + // necessary for certain implicit builtins that may nonetheless be read, + // even when they aren't written. + for (auto &output : outputs_by_location) + { + if (location_outputs_in_use.count(output.first.location) != 0) + continue; + + // Create a fake variable to put at the location. + uint32_t offset = ir.increase_bound_by(5); + uint32_t type_id = offset; + uint32_t vec_type_id = offset + 1; + uint32_t array_type_id = offset + 2; + uint32_t ptr_type_id = offset + 3; + uint32_t var_id = offset + 4; + + SPIRType type { OpTypeInt }; + switch (output.second.format) + { + case MSL_SHADER_VARIABLE_FORMAT_UINT16: + case MSL_SHADER_VARIABLE_FORMAT_ANY16: + type.basetype = SPIRType::UShort; + type.width = 16; + break; + case MSL_SHADER_VARIABLE_FORMAT_ANY32: + default: + type.basetype = SPIRType::UInt; + type.width = 32; + break; + } + set(type_id, type); + if (output.second.vecsize > 1) + { + type.op = OpTypeVector; + type.vecsize = output.second.vecsize; + set(vec_type_id, type); + type_id = vec_type_id; + } + + if (is_tesc_shader()) + { + type.op = OpTypeArray; + type.array.push_back(0); + type.array_size_literal.push_back(true); + type.parent_type = type_id; + set(array_type_id, type); + } + + type.op = OpTypePointer; + type.pointer = true; + type.pointer_depth++; + type.parent_type = is_tesc_shader() ? array_type_id : type_id; + type.storage = storage; + auto &ptr_type = set(ptr_type_id, type); + ptr_type.self = type.parent_type; + + auto &fake_var = set(var_id, ptr_type_id, storage); + set_decoration(var_id, DecorationLocation, output.first.location); + if (output.first.component) + set_decoration(var_id, DecorationComponent, output.first.component); + + meta.strip_array = true; + meta.allow_local_declaration = false; + add_variable_to_interface_block(storage, ib_var_ref, ib_type, fake_var, meta); + } + } + + // When multiple variables need to access same location, + // unroll locations one by one and we will flatten output or input as necessary. + for (auto &loc : meta.location_meta) + { + uint32_t location = loc.first; + auto &location_meta = loc.second; + + uint32_t ib_mbr_idx = uint32_t(ib_type.member_types.size()); + uint32_t type_id = build_extended_vector_type(location_meta.base_type_id, location_meta.num_components); + ib_type.member_types.push_back(type_id); + + set_member_name(ib_type.self, ib_mbr_idx, join("m_location_", location)); + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, location); + mark_location_as_used_by_shader(location, get(type_id), storage); + + if (location_meta.flat) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationFlat); + if (location_meta.noperspective) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationNoPerspective); + if (location_meta.centroid) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationCentroid); + if (location_meta.sample) + set_member_decoration(ib_type.self, ib_mbr_idx, DecorationSample); + } + + // Sort the members of the structure by their locations. + MemberSorter member_sorter(ib_type, ir.meta[ib_type_id], MemberSorter::LocationThenBuiltInType); + member_sorter.sort(); + + // The member indices were saved to the original variables, but after the members + // were sorted, those indices are now likely incorrect. Fix those up now. + fix_up_interface_member_indices(storage, ib_type_id); + + // For patch inputs, add one more member, holding the array of control point data. + if (is_tese_shader() && !msl_options.raw_buffer_tese_input && storage == StorageClassInput && patch && + stage_in_var_id) + { + uint32_t pcp_type_id = ir.increase_bound_by(1); + auto &pcp_type = set(pcp_type_id, ib_type); + pcp_type.basetype = SPIRType::ControlPointArray; + pcp_type.parent_type = pcp_type.type_alias = get_stage_in_struct_type().self; + pcp_type.storage = storage; + ir.meta[pcp_type_id] = ir.meta[ib_type.self]; + uint32_t mbr_idx = uint32_t(ib_type.member_types.size()); + ib_type.member_types.push_back(pcp_type_id); + set_member_name(ib_type.self, mbr_idx, "gl_in"); + } + + if (storage == StorageClassInput) + set_decoration(ib_var_id, DecorationNonWritable); + + return ib_var_id; +} + +uint32_t CompilerMSL::add_interface_block_pointer(uint32_t ib_var_id, StorageClass storage) +{ + if (!ib_var_id) + return 0; + + uint32_t ib_ptr_var_id; + uint32_t next_id = ir.increase_bound_by(3); + auto &ib_type = expression_type(ib_var_id); + if (is_tesc_shader() || (is_tese_shader() && msl_options.raw_buffer_tese_input)) + { + // Tessellation control per-vertex I/O is presented as an array, so we must + // do the same with our struct here. + uint32_t ib_ptr_type_id = next_id++; + auto &ib_ptr_type = set(ib_ptr_type_id, ib_type); + ib_ptr_type.op = OpTypePointer; + ib_ptr_type.parent_type = ib_ptr_type.type_alias = ib_type.self; + ib_ptr_type.pointer = true; + ib_ptr_type.pointer_depth++; + ib_ptr_type.storage = storage == StorageClassInput ? + ((is_tesc_shader() && msl_options.multi_patch_workgroup) || + (is_tese_shader() && msl_options.raw_buffer_tese_input) ? + StorageClassStorageBuffer : + StorageClassWorkgroup) : + StorageClassStorageBuffer; + ir.meta[ib_ptr_type_id] = ir.meta[ib_type.self]; + // To ensure that get_variable_data_type() doesn't strip off the pointer, + // which we need, use another pointer. + uint32_t ib_ptr_ptr_type_id = next_id++; + auto &ib_ptr_ptr_type = set(ib_ptr_ptr_type_id, ib_ptr_type); + ib_ptr_ptr_type.parent_type = ib_ptr_type_id; + ib_ptr_ptr_type.type_alias = ib_type.self; + ib_ptr_ptr_type.storage = StorageClassFunction; + ir.meta[ib_ptr_ptr_type_id] = ir.meta[ib_type.self]; + + ib_ptr_var_id = next_id; + set(ib_ptr_var_id, ib_ptr_ptr_type_id, StorageClassFunction, 0); + set_name(ib_ptr_var_id, storage == StorageClassInput ? "gl_in" : "gl_out"); + if (storage == StorageClassInput) + set_decoration(ib_ptr_var_id, DecorationNonWritable); + } + else + { + // Tessellation evaluation per-vertex inputs are also presented as arrays. + // But, in Metal, this array uses a very special type, 'patch_control_point', + // which is a container that can be used to access the control point data. + // To represent this, a special 'ControlPointArray' type has been added to the + // SPIRV-Cross type system. It should only be generated by and seen in the MSL + // backend (i.e. this one). + uint32_t pcp_type_id = next_id++; + auto &pcp_type = set(pcp_type_id, ib_type); + pcp_type.basetype = SPIRType::ControlPointArray; + pcp_type.parent_type = pcp_type.type_alias = ib_type.self; + pcp_type.storage = storage; + ir.meta[pcp_type_id] = ir.meta[ib_type.self]; + + ib_ptr_var_id = next_id; + set(ib_ptr_var_id, pcp_type_id, storage, 0); + set_name(ib_ptr_var_id, "gl_in"); + ir.meta[ib_ptr_var_id].decoration.qualified_alias = join(patch_stage_in_var_name, ".gl_in"); + } + return ib_ptr_var_id; +} + +uint32_t CompilerMSL::add_meshlet_block(bool per_primitive) +{ + // Accumulate the variables that should appear in the interface struct. + SmallVector vars; + + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + if (var.storage != StorageClassOutput || var.self == builtin_mesh_primitive_indices_id) + return; + if (is_per_primitive_variable(var) != per_primitive) + return; + vars.push_back(&var); + }); + + if (vars.empty()) + return 0; + + uint32_t next_id = ir.increase_bound_by(1); + auto &type = set(next_id, SPIRType(OpTypeStruct)); + type.basetype = SPIRType::Struct; + + InterfaceBlockMeta meta; + for (auto *p_var : vars) + { + meta.strip_array = true; + meta.allow_local_declaration = false; + add_variable_to_interface_block(StorageClassOutput, "", type, *p_var, meta); + } + + if (per_primitive) + set_name(type.self, "spvPerPrimitive"); + else + set_name(type.self, "spvPerVertex"); + + return next_id; +} + +// Ensure that the type is compatible with the builtin. +// If it is, simply return the given type ID. +// Otherwise, create a new type, and return it's ID. +uint32_t CompilerMSL::ensure_correct_builtin_type(uint32_t type_id, BuiltIn builtin) +{ + auto &type = get(type_id); + auto &pointee_type = get_pointee_type(type); + + if ((builtin == BuiltInSampleMask && is_array(pointee_type)) || + ((builtin == BuiltInLayer || builtin == BuiltInViewportIndex || builtin == BuiltInFragStencilRefEXT) && + pointee_type.basetype != SPIRType::UInt)) + { + uint32_t next_id = ir.increase_bound_by(is_pointer(type) ? 2 : 1); + uint32_t base_type_id = next_id++; + auto &base_type = set(base_type_id, OpTypeInt); + base_type.basetype = SPIRType::UInt; + base_type.width = 32; + + if (!is_pointer(type)) + return base_type_id; + + uint32_t ptr_type_id = next_id++; + auto &ptr_type = set(ptr_type_id, base_type); + ptr_type.op = OpTypePointer; + ptr_type.pointer = true; + ptr_type.pointer_depth++; + ptr_type.storage = type.storage; + ptr_type.parent_type = base_type_id; + return ptr_type_id; + } + + return type_id; +} + +// Ensure that the type is compatible with the shader input. +// If it is, simply return the given type ID. +// Otherwise, create a new type, and return its ID. +uint32_t CompilerMSL::ensure_correct_input_type(uint32_t type_id, uint32_t location, uint32_t component, uint32_t num_components, bool strip_array) +{ + auto &type = get(type_id); + + uint32_t max_array_dimensions = strip_array ? 1 : 0; + + // Struct and array types must match exactly. + if (type.basetype == SPIRType::Struct || type.array.size() > max_array_dimensions) + return type_id; + + auto p_va = inputs_by_location.find({location, component}); + if (p_va == end(inputs_by_location)) + { + if (num_components > type.vecsize) + return build_extended_vector_type(type_id, num_components); + else + return type_id; + } + + if (num_components == 0) + num_components = p_va->second.vecsize; + + switch (p_va->second.format) + { + case MSL_SHADER_VARIABLE_FORMAT_UINT8: + { + switch (type.basetype) + { + case SPIRType::UByte: + case SPIRType::UShort: + case SPIRType::UInt: + if (num_components > type.vecsize) + return build_extended_vector_type(type_id, num_components); + else + return type_id; + + case SPIRType::Short: + return build_extended_vector_type(type_id, num_components > type.vecsize ? num_components : type.vecsize, + SPIRType::UShort); + case SPIRType::Int: + return build_extended_vector_type(type_id, num_components > type.vecsize ? num_components : type.vecsize, + SPIRType::UInt); + + default: + SPIRV_CROSS_THROW("Vertex attribute type mismatch between host and shader"); + } + } + + case MSL_SHADER_VARIABLE_FORMAT_UINT16: + { + switch (type.basetype) + { + case SPIRType::UShort: + case SPIRType::UInt: + if (num_components > type.vecsize) + return build_extended_vector_type(type_id, num_components); + else + return type_id; + + case SPIRType::Int: + return build_extended_vector_type(type_id, num_components > type.vecsize ? num_components : type.vecsize, + SPIRType::UInt); + + default: + SPIRV_CROSS_THROW("Vertex attribute type mismatch between host and shader"); + } + } + + default: + if (num_components > type.vecsize) + type_id = build_extended_vector_type(type_id, num_components); + break; + } + + return type_id; +} + +void CompilerMSL::mark_struct_members_packed(const SPIRType &type) +{ + // Handle possible recursion when a struct contains a pointer to its own type nested somewhere. + if (has_extended_decoration(type.self, SPIRVCrossDecorationPhysicalTypePacked)) + return; + + set_extended_decoration(type.self, SPIRVCrossDecorationPhysicalTypePacked); + + // Problem case! Struct needs to be placed at an awkward alignment. + // Mark every member of the child struct as packed. + uint32_t mbr_cnt = uint32_t(type.member_types.size()); + for (uint32_t i = 0; i < mbr_cnt; i++) + { + auto &mbr_type = get(type.member_types[i]); + if (mbr_type.basetype == SPIRType::Struct) + { + // Recursively mark structs as packed. + auto *struct_type = &mbr_type; + while (!struct_type->array.empty()) + struct_type = &get(struct_type->parent_type); + mark_struct_members_packed(*struct_type); + } + else if (!is_scalar(mbr_type)) + set_extended_member_decoration(type.self, i, SPIRVCrossDecorationPhysicalTypePacked); + } +} + +void CompilerMSL::mark_scalar_layout_structs(const SPIRType &type) +{ + uint32_t mbr_cnt = uint32_t(type.member_types.size()); + for (uint32_t i = 0; i < mbr_cnt; i++) + { + // Handle possible recursion when a struct contains a pointer to its own type nested somewhere. + auto &mbr_type = get(type.member_types[i]); + if (mbr_type.basetype == SPIRType::Struct && !(mbr_type.pointer && mbr_type.storage == StorageClassPhysicalStorageBuffer)) + { + auto *struct_type = &mbr_type; + while (!struct_type->array.empty()) + struct_type = &get(struct_type->parent_type); + + if (has_extended_decoration(struct_type->self, SPIRVCrossDecorationPhysicalTypePacked)) + continue; + + uint32_t msl_alignment = get_declared_struct_member_alignment_msl(type, i); + uint32_t msl_size = get_declared_struct_member_size_msl(type, i); + uint32_t spirv_offset = type_struct_member_offset(type, i); + uint32_t spirv_offset_next; + if (i + 1 < mbr_cnt) + spirv_offset_next = type_struct_member_offset(type, i + 1); + else + spirv_offset_next = spirv_offset + msl_size; + + // Both are complicated cases. In scalar layout, a struct of float3 might just consume 12 bytes, + // and the next member will be placed at offset 12. + bool struct_is_misaligned = (spirv_offset % msl_alignment) != 0; + bool struct_is_too_large = spirv_offset + msl_size > spirv_offset_next; + uint32_t array_stride = 0; + bool struct_needs_explicit_padding = false; + + // Verify that if a struct is used as an array that ArrayStride matches the effective size of the struct. + if (!mbr_type.array.empty()) + { + array_stride = type_struct_member_array_stride(type, i); + uint32_t dimensions = uint32_t(mbr_type.array.size() - 1); + for (uint32_t dim = 0; dim < dimensions; dim++) + { + uint32_t array_size = to_array_size_literal(mbr_type, dim); + array_stride /= max(array_size, 1u); + } + + // Set expected struct size based on ArrayStride. + struct_needs_explicit_padding = true; + + // If struct size is larger than array stride, we might be able to fit, if we tightly pack. + if (get_declared_struct_size_msl(*struct_type) > array_stride) + struct_is_too_large = true; + } + + if (struct_is_misaligned || struct_is_too_large) + mark_struct_members_packed(*struct_type); + mark_scalar_layout_structs(*struct_type); + + if (struct_needs_explicit_padding) + { + msl_size = get_declared_struct_size_msl(*struct_type, true, true); + if (array_stride < msl_size) + { + SPIRV_CROSS_THROW("Cannot express an array stride smaller than size of struct type."); + } + else + { + if (has_extended_decoration(struct_type->self, SPIRVCrossDecorationPaddingTarget)) + { + if (array_stride != + get_extended_decoration(struct_type->self, SPIRVCrossDecorationPaddingTarget)) + SPIRV_CROSS_THROW( + "A struct is used with different array strides. Cannot express this in MSL."); + } + else + set_extended_decoration(struct_type->self, SPIRVCrossDecorationPaddingTarget, array_stride); + } + } + } + } +} + +// Sort the members of the struct type by offset, and pack and then pad members where needed +// to align MSL members with SPIR-V offsets. The struct members are iterated twice. Packing +// occurs first, followed by padding, because packing a member reduces both its size and its +// natural alignment, possibly requiring a padding member to be added ahead of it. +void CompilerMSL::align_struct(SPIRType &ib_type, unordered_set &aligned_structs) +{ + // We align structs recursively, so stop any redundant work. + ID &ib_type_id = ib_type.self; + if (aligned_structs.count(ib_type_id)) + return; + aligned_structs.insert(ib_type_id); + + // Sort the members of the interface structure by their offset. + // They should already be sorted per SPIR-V spec anyway. + MemberSorter member_sorter(ib_type, ir.meta[ib_type_id], MemberSorter::Offset); + member_sorter.sort(); + + auto mbr_cnt = uint32_t(ib_type.member_types.size()); + + for (uint32_t mbr_idx = 0; mbr_idx < mbr_cnt; mbr_idx++) + { + // Pack any dependent struct types before we pack a parent struct. + auto &mbr_type = get(ib_type.member_types[mbr_idx]); + if (mbr_type.basetype == SPIRType::Struct) + align_struct(mbr_type, aligned_structs); + } + + // Test the alignment of each member, and if a member should be closer to the previous + // member than the default spacing expects, it is likely that the previous member is in + // a packed format. If so, and the previous member is packable, pack it. + // For example ... this applies to any 3-element vector that is followed by a scalar. + uint32_t msl_offset = 0; + for (uint32_t mbr_idx = 0; mbr_idx < mbr_cnt; mbr_idx++) + { + // This checks the member in isolation, if the member needs some kind of type remapping to conform to SPIR-V + // offsets, array strides and matrix strides. + ensure_member_packing_rules_msl(ib_type, mbr_idx); + + // Align current offset to the current member's default alignment. If the member was packed, it will observe + // the updated alignment here. + uint32_t msl_align_mask = get_declared_struct_member_alignment_msl(ib_type, mbr_idx) - 1; + uint32_t aligned_msl_offset = (msl_offset + msl_align_mask) & ~msl_align_mask; + + // Fetch the member offset as declared in the SPIRV. + uint32_t spirv_mbr_offset = get_member_decoration(ib_type_id, mbr_idx, DecorationOffset); + if (spirv_mbr_offset > aligned_msl_offset) + { + // Since MSL and SPIR-V have slightly different struct member alignment and + // size rules, we'll pad to standard C-packing rules with a char[] array. If the member is farther + // away than C-packing, expects, add an inert padding member before the the member. + uint32_t padding_bytes = spirv_mbr_offset - aligned_msl_offset; + set_extended_member_decoration(ib_type_id, mbr_idx, SPIRVCrossDecorationPaddingTarget, padding_bytes); + + // Re-align as a sanity check that aligning post-padding matches up. + msl_offset += padding_bytes; + aligned_msl_offset = (msl_offset + msl_align_mask) & ~msl_align_mask; + } + else if (spirv_mbr_offset < aligned_msl_offset) + { + // This should not happen, but deal with unexpected scenarios. + // It *might* happen if a sub-struct has a larger alignment requirement in MSL than SPIR-V. + SPIRV_CROSS_THROW("Cannot represent buffer block correctly in MSL."); + } + + assert(aligned_msl_offset == spirv_mbr_offset); + + // Increment the current offset to be positioned immediately after the current member. + // Don't do this for the last member since it can be unsized, and it is not relevant for padding purposes here. + if (mbr_idx + 1 < mbr_cnt) + msl_offset = aligned_msl_offset + get_declared_struct_member_size_msl(ib_type, mbr_idx); + } +} + +bool CompilerMSL::validate_member_packing_rules_msl(const SPIRType &type, uint32_t index) const +{ + auto &mbr_type = get(type.member_types[index]); + uint32_t spirv_offset = get_member_decoration(type.self, index, DecorationOffset); + + if (index + 1 < type.member_types.size()) + { + // First, we will check offsets. If SPIR-V offset + MSL size > SPIR-V offset of next member, + // we *must* perform some kind of remapping, no way getting around it. + // We can always pad after this member if necessary, so that case is fine. + uint32_t spirv_offset_next = get_member_decoration(type.self, index + 1, DecorationOffset); + assert(spirv_offset_next >= spirv_offset); + uint32_t maximum_size = spirv_offset_next - spirv_offset; + uint32_t msl_mbr_size = get_declared_struct_member_size_msl(type, index); + if (msl_mbr_size > maximum_size) + return false; + } + + if (is_array(mbr_type)) + { + // If we have an array type, array stride must match exactly with SPIR-V. + + // An exception to this requirement is if we have one array element. + // This comes from DX scalar layout workaround. + // If app tries to be cheeky and access the member out of bounds, this will not work, but this is the best we can do. + // In OpAccessChain with logical memory models, access chains must be in-bounds in SPIR-V specification. + bool relax_array_stride = mbr_type.array.back() == 1 && mbr_type.array_size_literal.back(); + + if (!relax_array_stride) + { + uint32_t spirv_array_stride = type_struct_member_array_stride(type, index); + uint32_t msl_array_stride = get_declared_struct_member_array_stride_msl(type, index); + if (spirv_array_stride != msl_array_stride) + return false; + } + } + + if (is_matrix(mbr_type)) + { + // Need to check MatrixStride as well. + uint32_t spirv_matrix_stride = type_struct_member_matrix_stride(type, index); + uint32_t msl_matrix_stride = get_declared_struct_member_matrix_stride_msl(type, index); + if (spirv_matrix_stride != msl_matrix_stride) + return false; + } + + // Now, we check alignment. + uint32_t msl_alignment = get_declared_struct_member_alignment_msl(type, index); + if ((spirv_offset % msl_alignment) != 0) + return false; + + // We're in the clear. + return true; +} + +// Here we need to verify that the member type we declare conforms to Offset, ArrayStride or MatrixStride restrictions. +// If there is a mismatch, we need to emit remapped types, either normal types, or "packed_X" types. +// In odd cases we need to emit packed and remapped types, for e.g. weird matrices or arrays with weird array strides. +void CompilerMSL::ensure_member_packing_rules_msl(SPIRType &ib_type, uint32_t index) +{ + if (validate_member_packing_rules_msl(ib_type, index)) + return; + + // We failed validation. + // This case will be nightmare-ish to deal with. This could possibly happen if struct alignment does not quite + // match up with what we want. Scalar block layout comes to mind here where we might have to work around the rule + // that struct alignment == max alignment of all members and struct size depends on this alignment. + // Can't repack structs, but can repack pointers to structs. + auto &mbr_type = get(ib_type.member_types[index]); + bool is_buff_ptr = mbr_type.pointer && mbr_type.storage == StorageClassPhysicalStorageBuffer; + if (mbr_type.basetype == SPIRType::Struct && !is_buff_ptr) + SPIRV_CROSS_THROW("Cannot perform any repacking for structs when it is used as a member of another struct."); + + // Perform remapping here. + // There is nothing to be gained by using packed scalars, so don't attempt it. + if (!is_scalar(ib_type)) + set_extended_member_decoration(ib_type.self, index, SPIRVCrossDecorationPhysicalTypePacked); + + // Try validating again, now with packed. + if (validate_member_packing_rules_msl(ib_type, index)) + return; + + // We're in deep trouble, and we need to create a new PhysicalType which matches up with what we expect. + // A lot of work goes here ... + // We will need remapping on Load and Store to translate the types between Logical and Physical. + + // First, we check if we have small vector std140 array. + // We detect this if we have an array of vectors, and array stride is greater than number of elements. + if (!mbr_type.array.empty() && !is_matrix(mbr_type)) + { + uint32_t array_stride = type_struct_member_array_stride(ib_type, index); + + // Hack off array-of-arrays until we find the array stride per element we must have to make it work. + uint32_t dimensions = uint32_t(mbr_type.array.size() - 1); + for (uint32_t dim = 0; dim < dimensions; dim++) + array_stride /= max(to_array_size_literal(mbr_type, dim), 1u); + + // Pointers are 8 bytes + uint32_t mbr_width_in_bytes = is_buff_ptr ? 8 : (mbr_type.width / 8); + uint32_t elems_per_stride = array_stride / mbr_width_in_bytes; + + if (elems_per_stride == 3) + SPIRV_CROSS_THROW("Cannot use ArrayStride of 3 elements in remapping scenarios."); + else if (elems_per_stride > 4 && elems_per_stride != 8) + SPIRV_CROSS_THROW("Cannot represent vectors with more than 4 elements in MSL."); + + if (elems_per_stride == 8) + { + if (mbr_type.width == 16) + add_spv_func_and_recompile(SPVFuncImplPaddedStd140); + else + SPIRV_CROSS_THROW("Unexpected type in std140 wide array resolve."); + } + + auto physical_type = mbr_type; + physical_type.vecsize = elems_per_stride; + physical_type.parent_type = 0; + + // If this is a physical buffer pointer, replace type with a ulongn vector. + if (is_buff_ptr) + { + physical_type.width = 64; + physical_type.basetype = to_unsigned_basetype(physical_type.width); + physical_type.pointer = false; + physical_type.pointer_depth = false; + physical_type.forward_pointer = false; + } + + uint32_t type_id = ir.increase_bound_by(1); + set(type_id, physical_type); + set_extended_member_decoration(ib_type.self, index, SPIRVCrossDecorationPhysicalTypeID, type_id); + set_decoration(type_id, DecorationArrayStride, array_stride); + + // Remove packed_ for vectors of size 1, 2 and 4. + unset_extended_member_decoration(ib_type.self, index, SPIRVCrossDecorationPhysicalTypePacked); + } + else if (is_matrix(mbr_type)) + { + // MatrixStride might be std140-esque. + uint32_t matrix_stride = type_struct_member_matrix_stride(ib_type, index); + + uint32_t elems_per_stride = matrix_stride / (mbr_type.width / 8); + + if (elems_per_stride == 3) + SPIRV_CROSS_THROW("Cannot use ArrayStride of 3 elements in remapping scenarios."); + else if (elems_per_stride > 4 && elems_per_stride != 8) + SPIRV_CROSS_THROW("Cannot represent vectors with more than 4 elements in MSL."); + + if (elems_per_stride == 8) + { + if (mbr_type.basetype != SPIRType::Half) + SPIRV_CROSS_THROW("Unexpected type in std140 wide matrix stride resolve."); + add_spv_func_and_recompile(SPVFuncImplPaddedStd140); + } + + bool row_major = has_member_decoration(ib_type.self, index, DecorationRowMajor); + auto physical_type = mbr_type; + physical_type.parent_type = 0; + + if (row_major) + physical_type.columns = elems_per_stride; + else + physical_type.vecsize = elems_per_stride; + uint32_t type_id = ir.increase_bound_by(1); + set(type_id, physical_type); + set_extended_member_decoration(ib_type.self, index, SPIRVCrossDecorationPhysicalTypeID, type_id); + + // Remove packed_ for vectors of size 1, 2 and 4. + unset_extended_member_decoration(ib_type.self, index, SPIRVCrossDecorationPhysicalTypePacked); + } + else + SPIRV_CROSS_THROW("Found a buffer packing case which we cannot represent in MSL."); + + // Try validating again, now with physical type remapping. + if (validate_member_packing_rules_msl(ib_type, index)) + return; + + // We might have a particular odd scalar layout case where the last element of an array + // does not take up as much space as the ArrayStride or MatrixStride. This can happen with DX cbuffers. + // The "proper" workaround for this is extremely painful and essentially impossible in the edge case of float3[], + // so we hack around it by declaring the offending array or matrix with one less array size/col/row, + // and rely on padding to get the correct value. We will technically access arrays out of bounds into the padding region, + // but it should spill over gracefully without too much trouble. We rely on behavior like this for unsized arrays anyways. + + // E.g. we might observe a physical layout of: + // { float2 a[2]; float b; } in cbuffer layout where ArrayStride of a is 16, but offset of b is 24, packed right after a[1] ... + uint32_t type_id = get_extended_member_decoration(ib_type.self, index, SPIRVCrossDecorationPhysicalTypeID); + auto &type = get(type_id); + + // Modify the physical type in-place. This is safe since each physical type workaround is a copy. + if (is_array(type)) + { + if (type.array.back() > 1) + { + if (!type.array_size_literal.back()) + SPIRV_CROSS_THROW("Cannot apply scalar layout workaround with spec constant array size."); + type.array.back() -= 1; + } + else + { + // We have an array of size 1, so we cannot decrement that. Our only option now is to + // force a packed layout instead, and drop the physical type remap since ArrayStride is meaningless now. + unset_extended_member_decoration(ib_type.self, index, SPIRVCrossDecorationPhysicalTypeID); + set_extended_member_decoration(ib_type.self, index, SPIRVCrossDecorationPhysicalTypePacked); + } + } + else if (is_matrix(type)) + { + bool row_major = has_member_decoration(ib_type.self, index, DecorationRowMajor); + if (!row_major) + { + // Slice off one column. If we only have 2 columns, this might turn the matrix into a vector with one array element instead. + if (type.columns > 2) + { + type.columns--; + } + else if (type.columns == 2) + { + type.columns = 1; + assert(type.array.empty()); + type.op = OpTypeArray; + type.array.push_back(1); + type.array_size_literal.push_back(true); + } + } + else + { + // Slice off one row. If we only have 2 rows, this might turn the matrix into a vector with one array element instead. + if (type.vecsize > 2) + { + type.vecsize--; + } + else if (type.vecsize == 2) + { + type.vecsize = type.columns; + type.columns = 1; + assert(type.array.empty()); + type.op = OpTypeArray; + type.array.push_back(1); + type.array_size_literal.push_back(true); + } + } + } + + // This better validate now, or we must fail gracefully. + if (!validate_member_packing_rules_msl(ib_type, index)) + SPIRV_CROSS_THROW("Found a buffer packing case which we cannot represent in MSL."); +} + +void CompilerMSL::emit_store_statement(uint32_t lhs_expression, uint32_t rhs_expression) +{ + auto &type = expression_type(rhs_expression); + + bool lhs_remapped_type = has_extended_decoration(lhs_expression, SPIRVCrossDecorationPhysicalTypeID); + bool lhs_packed_type = has_extended_decoration(lhs_expression, SPIRVCrossDecorationPhysicalTypePacked); + auto *lhs_e = maybe_get(lhs_expression); + auto *rhs_e = maybe_get(rhs_expression); + + bool transpose = lhs_e && lhs_e->need_transpose; + + if (has_decoration(lhs_expression, DecorationBuiltIn) && + BuiltIn(get_decoration(lhs_expression, DecorationBuiltIn)) == BuiltInSampleMask && + is_array(type)) + { + // Storing an array to SampleMask, have to remove the array-ness before storing. + statement(to_expression(lhs_expression), " = ", to_enclosed_unpacked_expression(rhs_expression), "[0];"); + register_write(lhs_expression); + } + else if (!lhs_remapped_type && !lhs_packed_type) + { + // No physical type remapping, and no packed type, so can just emit a store directly. + + // We might not be dealing with remapped physical types or packed types, + // but we might be doing a clean store to a row-major matrix. + // In this case, we just flip transpose states, and emit the store, a transpose must be in the RHS expression, if any. + if (is_matrix(type) && lhs_e && lhs_e->need_transpose) + { + lhs_e->need_transpose = false; + + if (rhs_e && rhs_e->need_transpose) + { + // Direct copy, but might need to unpack RHS. + // Skip the transpose, as we will transpose when writing to LHS and transpose(transpose(T)) == T. + rhs_e->need_transpose = false; + statement(to_expression(lhs_expression), " = ", to_unpacked_row_major_matrix_expression(rhs_expression), + ";"); + rhs_e->need_transpose = true; + } + else + statement(to_expression(lhs_expression), " = transpose(", to_unpacked_expression(rhs_expression), ");"); + + lhs_e->need_transpose = true; + register_write(lhs_expression); + } + else if (lhs_e && lhs_e->need_transpose) + { + lhs_e->need_transpose = false; + + // Storing a column to a row-major matrix. Unroll the write. + for (uint32_t c = 0; c < type.vecsize; c++) + { + auto lhs_expr = to_dereferenced_expression(lhs_expression); + auto column_index = lhs_expr.find_last_of('['); + if (column_index != string::npos) + { + statement(lhs_expr.insert(column_index, join('[', c, ']')), " = ", + to_extract_component_expression(rhs_expression, c), ";"); + } + } + lhs_e->need_transpose = true; + register_write(lhs_expression); + } + else + CompilerGLSL::emit_store_statement(lhs_expression, rhs_expression); + } + else if (!lhs_remapped_type && !is_matrix(type) && !transpose) + { + // Even if the target type is packed, we can directly store to it. We cannot store to packed matrices directly, + // since they are declared as array of vectors instead, and we need the fallback path below. + CompilerGLSL::emit_store_statement(lhs_expression, rhs_expression); + } + else + { + // Special handling when storing to a remapped physical type. + // This is mostly to deal with std140 padded matrices or vectors. + + TypeID physical_type_id = lhs_remapped_type ? + ID(get_extended_decoration(lhs_expression, SPIRVCrossDecorationPhysicalTypeID)) : + type.self; + + auto &physical_type = get(physical_type_id); + + string cast_addr_space = "thread"; + auto *p_var_lhs = maybe_get_backing_variable(lhs_expression); + if (p_var_lhs) + cast_addr_space = get_type_address_space(get(p_var_lhs->basetype), lhs_expression); + + if (is_matrix(type)) + { + const char *packed_pfx = lhs_packed_type ? "packed_" : ""; + + // Packed matrices are stored as arrays of packed vectors, so we need + // to assign the vectors one at a time. + // For row-major matrices, we need to transpose the *right-hand* side, + // not the left-hand side. + + // Lots of cases to cover here ... + + bool rhs_transpose = rhs_e && rhs_e->need_transpose; + SPIRType write_type = type; + string cast_expr; + + // We're dealing with transpose manually. + if (rhs_transpose) + rhs_e->need_transpose = false; + + if (transpose) + { + // We're dealing with transpose manually. + lhs_e->need_transpose = false; + write_type.vecsize = type.columns; + write_type.columns = 1; + + if (physical_type.columns != type.columns) + cast_expr = join("(", cast_addr_space, " ", packed_pfx, type_to_glsl(write_type), "&)"); + + if (rhs_transpose) + { + // If RHS is also transposed, we can just copy row by row. + for (uint32_t i = 0; i < type.vecsize; i++) + { + statement(cast_expr, to_enclosed_expression(lhs_expression), "[", i, "]", " = ", + to_unpacked_row_major_matrix_expression(rhs_expression), "[", i, "];"); + } + } + else + { + auto vector_type = expression_type(rhs_expression); + vector_type.vecsize = vector_type.columns; + vector_type.columns = 1; + + // Transpose on the fly. Emitting a lot of full transpose() ops and extracting lanes seems very bad, + // so pick out individual components instead. + for (uint32_t i = 0; i < type.vecsize; i++) + { + string rhs_row = type_to_glsl_constructor(vector_type) + "("; + for (uint32_t j = 0; j < vector_type.vecsize; j++) + { + rhs_row += join(to_enclosed_unpacked_expression(rhs_expression), "[", j, "][", i, "]"); + if (j + 1 < vector_type.vecsize) + rhs_row += ", "; + } + rhs_row += ")"; + + statement(cast_expr, to_enclosed_expression(lhs_expression), "[", i, "]", " = ", rhs_row, ";"); + } + } + + // We're dealing with transpose manually. + lhs_e->need_transpose = true; + } + else + { + write_type.columns = 1; + + if (physical_type.vecsize != type.vecsize) + cast_expr = join("(", cast_addr_space, " ", packed_pfx, type_to_glsl(write_type), "&)"); + + if (rhs_transpose) + { + auto vector_type = expression_type(rhs_expression); + vector_type.columns = 1; + + // Transpose on the fly. Emitting a lot of full transpose() ops and extracting lanes seems very bad, + // so pick out individual components instead. + for (uint32_t i = 0; i < type.columns; i++) + { + string rhs_row = type_to_glsl_constructor(vector_type) + "("; + for (uint32_t j = 0; j < vector_type.vecsize; j++) + { + // Need to explicitly unpack expression since we've mucked with transpose state. + auto unpacked_expr = to_unpacked_row_major_matrix_expression(rhs_expression); + rhs_row += join(unpacked_expr, "[", j, "][", i, "]"); + if (j + 1 < vector_type.vecsize) + rhs_row += ", "; + } + rhs_row += ")"; + + statement(cast_expr, to_enclosed_expression(lhs_expression), "[", i, "]", " = ", rhs_row, ";"); + } + } + else + { + // Copy column-by-column. + for (uint32_t i = 0; i < type.columns; i++) + { + statement(cast_expr, to_enclosed_expression(lhs_expression), "[", i, "]", " = ", + to_enclosed_unpacked_expression(rhs_expression), "[", i, "];"); + } + } + } + + // We're dealing with transpose manually. + if (rhs_transpose) + rhs_e->need_transpose = true; + } + else if (transpose) + { + lhs_e->need_transpose = false; + + SPIRType write_type = type; + write_type.vecsize = 1; + write_type.columns = 1; + + // Storing a column to a row-major matrix. Unroll the write. + for (uint32_t c = 0; c < type.vecsize; c++) + { + auto lhs_expr = to_enclosed_expression(lhs_expression); + auto column_index = lhs_expr.find_last_of('['); + + // Get rid of any ".data" half8 handling here, we're casting to scalar anyway. + auto end_column_index = lhs_expr.find_last_of(']'); + auto end_dot_index = lhs_expr.find_last_of('.'); + if (end_dot_index != string::npos && end_dot_index > end_column_index) + lhs_expr.resize(end_dot_index); + + if (column_index != string::npos) + { + statement("((", cast_addr_space, " ", type_to_glsl(write_type), "*)&", + lhs_expr.insert(column_index, join('[', c, ']', ")")), " = ", + to_extract_component_expression(rhs_expression, c), ";"); + } + } + + lhs_e->need_transpose = true; + } + else if ((is_matrix(physical_type) || is_array(physical_type)) && + physical_type.vecsize <= 4 && + physical_type.vecsize > type.vecsize) + { + assert(type.vecsize >= 1 && type.vecsize <= 3); + + // If we have packed types, we cannot use swizzled stores. + // We could technically unroll the store for each element if needed. + // When remapping to a std140 physical type, we always get float4, + // and the packed decoration should always be removed. + assert(!lhs_packed_type); + + string lhs = to_dereferenced_expression(lhs_expression); + string rhs = to_pointer_expression(rhs_expression); + + // Unpack the expression so we can store to it with a float or float2. + // It's still an l-value, so it's fine. Most other unpacking of expressions turn them into r-values instead. + lhs = join("(", cast_addr_space, " ", type_to_glsl(type), "&)", enclose_expression(lhs)); + if (!optimize_read_modify_write(expression_type(rhs_expression), lhs, rhs)) + statement(lhs, " = ", rhs, ";"); + } + else if (!is_matrix(type)) + { + string lhs = to_dereferenced_expression(lhs_expression); + string rhs = to_pointer_expression(rhs_expression); + if (!optimize_read_modify_write(expression_type(rhs_expression), lhs, rhs)) + statement(lhs, " = ", rhs, ";"); + } + + register_write(lhs_expression); + } +} + +static bool expression_ends_with(const string &expr_str, const std::string &ending) +{ + if (expr_str.length() >= ending.length()) + return (expr_str.compare(expr_str.length() - ending.length(), ending.length(), ending) == 0); + else + return false; +} + +// Converts the format of the current expression from packed to unpacked, +// by wrapping the expression in a constructor of the appropriate type. +// Also, handle special physical ID remapping scenarios, similar to emit_store_statement(). +string CompilerMSL::unpack_expression_type(string expr_str, const SPIRType &type, uint32_t physical_type_id, + bool packed, bool row_major) +{ + // Trivial case, nothing to do. + if (physical_type_id == 0 && !packed) + return expr_str; + + const SPIRType *physical_type = nullptr; + if (physical_type_id) + physical_type = &get(physical_type_id); + + static const char *swizzle_lut[] = { + ".x", + ".xy", + ".xyz", + "", + }; + + // TODO: Move everything to the template wrapper? + bool uses_std140_wrapper = physical_type && physical_type->vecsize > 4; + + if (physical_type && is_vector(*physical_type) && is_array(*physical_type) && + !uses_std140_wrapper && + physical_type->vecsize > type.vecsize && !expression_ends_with(expr_str, swizzle_lut[type.vecsize - 1])) + { + // std140 array cases for vectors. + assert(type.vecsize >= 1 && type.vecsize <= 3); + return enclose_expression(expr_str) + swizzle_lut[type.vecsize - 1]; + } + else if (physical_type && is_matrix(*physical_type) && is_vector(type) && + !uses_std140_wrapper && + physical_type->vecsize > type.vecsize) + { + // Extract column from padded matrix. + assert(type.vecsize >= 1 && type.vecsize <= 4); + return enclose_expression(expr_str) + swizzle_lut[type.vecsize - 1]; + } + else if (is_matrix(type)) + { + // Packed matrices are stored as arrays of packed vectors. Unfortunately, + // we can't just pass the array straight to the matrix constructor. We have to + // pass each vector individually, so that they can be unpacked to normal vectors. + if (!physical_type) + physical_type = &type; + + uint32_t vecsize = type.vecsize; + uint32_t columns = type.columns; + if (row_major) + swap(vecsize, columns); + + uint32_t physical_vecsize = row_major ? physical_type->columns : physical_type->vecsize; + + const char *base_type = type.width == 16 ? "half" : "float"; + string unpack_expr = join(base_type, columns, "x", vecsize, "("); + + const char *load_swiz = ""; + const char *data_swiz = physical_vecsize > 4 ? ".data" : ""; + + if (physical_vecsize != vecsize) + load_swiz = swizzle_lut[vecsize - 1]; + + for (uint32_t i = 0; i < columns; i++) + { + if (i > 0) + unpack_expr += ", "; + + if (packed) + unpack_expr += join(base_type, physical_vecsize, "(", expr_str, "[", i, "]", ")", load_swiz); + else + unpack_expr += join(expr_str, "[", i, "]", data_swiz, load_swiz); + } + + unpack_expr += ")"; + return unpack_expr; + } + else + { + return join(type_to_glsl(type), "(", expr_str, ")"); + } +} + +// Emits the file header info +void CompilerMSL::emit_header() +{ + // This particular line can be overridden during compilation, so make it a flag and not a pragma line. + if (suppress_missing_prototypes) + add_pragma_line("#pragma clang diagnostic ignored \"-Wmissing-prototypes\"", false); + if (suppress_incompatible_pointer_types_discard_qualifiers) + add_pragma_line("#pragma clang diagnostic ignored \"-Wincompatible-pointer-types-discards-qualifiers\"", false); + + // Disable warning about "sometimes unitialized" when zero-initializing simple threadgroup variables + if (suppress_sometimes_unitialized) + add_pragma_line("#pragma clang diagnostic ignored \"-Wsometimes-uninitialized\"", false); + + // Disable warning about missing braces for array template to make arrays a value type + if (spv_function_implementations.count(SPVFuncImplUnsafeArray) != 0) + add_pragma_line("#pragma clang diagnostic ignored \"-Wmissing-braces\"", false); + + // Floating point fast math compile declarations + if (msl_options.use_fast_math_pragmas && msl_options.supports_msl_version(3, 2)) + { + uint32_t contract_mask = FPFastMathModeAllowContractMask; + uint32_t relax_mask = (FPFastMathModeNSZMask | FPFastMathModeAllowRecipMask | FPFastMathModeAllowReassocMask); + uint32_t fast_mask = (relax_mask | FPFastMathModeNotNaNMask | FPFastMathModeNotInfMask); + + // FP math mode + uint32_t fp_flags = get_fp_fast_math_flags(true); + const char *math_mode = "safe"; + if ((fp_flags & fast_mask) == fast_mask) // Must have all flags + math_mode = "fast"; + else if ((fp_flags & relax_mask) == relax_mask) // Must have all flags + math_mode = "relaxed"; + + add_pragma_line(join("#pragma metal fp math_mode(", math_mode, ")"), false); + + // FP contraction + const char *contract_mode = ((fp_flags & contract_mask) == contract_mask) ? "fast" : "off"; + add_pragma_line(join("#pragma metal fp contract(", contract_mode, ")"), false); + } + + for (auto &pragma : pragma_lines) + statement(pragma); + + if (!pragma_lines.empty()) + statement(""); + + statement("#include "); + statement("#include "); + + for (auto &header : header_lines) + statement(header); + + statement(""); + statement("using namespace metal;"); + statement(""); + + for (auto &td : typedef_lines) + statement(td); + + if (!typedef_lines.empty()) + statement(""); +} + +void CompilerMSL::add_pragma_line(const string &line, bool recompile_on_unique) +{ + if (std::find(pragma_lines.begin(), pragma_lines.end(), line) == pragma_lines.end()) + { + pragma_lines.push_back(line); + if (recompile_on_unique) + force_recompile(); + } +} + +void CompilerMSL::add_typedef_line(const string &line) +{ + if (std::find(typedef_lines.begin(), typedef_lines.end(), line) == typedef_lines.end()) + { + typedef_lines.push_back(line); + force_recompile(); + } +} + +// Template struct like spvUnsafeArray<> need to be declared *before* any resources are declared +void CompilerMSL::emit_custom_templates() +{ + static const char * const address_spaces[] = { + "thread", "constant", "device", "threadgroup", "threadgroup_imageblock", "ray_data", "object_data" + }; + + for (const auto &spv_func : spv_function_implementations) + { + switch (spv_func) + { + case SPVFuncImplUnsafeArray: + statement("template"); + statement("struct spvUnsafeArray"); + begin_scope(); + statement("T elements[Num ? Num : 1];"); + statement(""); + statement("thread T& operator [] (size_t pos) thread"); + begin_scope(); + statement("return elements[pos];"); + end_scope(); + statement("constexpr const thread T& operator [] (size_t pos) const thread"); + begin_scope(); + statement("return elements[pos];"); + end_scope(); + statement(""); + statement("device T& operator [] (size_t pos) device"); + begin_scope(); + statement("return elements[pos];"); + end_scope(); + statement("constexpr const device T& operator [] (size_t pos) const device"); + begin_scope(); + statement("return elements[pos];"); + end_scope(); + statement(""); + statement("constexpr const constant T& operator [] (size_t pos) const constant"); + begin_scope(); + statement("return elements[pos];"); + end_scope(); + statement(""); + statement("threadgroup T& operator [] (size_t pos) threadgroup"); + begin_scope(); + statement("return elements[pos];"); + end_scope(); + statement("constexpr const threadgroup T& operator [] (size_t pos) const threadgroup"); + begin_scope(); + statement("return elements[pos];"); + end_scope(); + if (get_execution_model() == ExecutionModelMeshEXT || + get_execution_model() == ExecutionModelTaskEXT) + { + statement(""); + statement("object_data T& operator [] (size_t pos) object_data"); + begin_scope(); + statement("return elements[pos];"); + end_scope(); + statement("constexpr const object_data T& operator [] (size_t pos) const object_data"); + begin_scope(); + statement("return elements[pos];"); + end_scope(); + } + end_scope_decl(); + statement(""); + break; + + case SPVFuncImplStorageMatrix: + statement("template"); + statement("struct spvStorageMatrix"); + begin_scope(); + statement("vec columns[Cols];"); + statement(""); + for (size_t method_idx = 0; method_idx < sizeof(address_spaces) / sizeof(address_spaces[0]); ++method_idx) + { + // Some address spaces require particular features. + if (method_idx == 4) // threadgroup_imageblock + statement("#ifdef __HAVE_IMAGEBLOCKS__"); + else if (method_idx == 5) // ray_data + statement("#ifdef __HAVE_RAYTRACING__"); + else if (method_idx == 6) // object_data + statement("#ifdef __HAVE_MESH__"); + const string &method_as = address_spaces[method_idx]; + statement("spvStorageMatrix() ", method_as, " = default;"); + if (method_idx != 1) // constant + { + statement(method_as, " spvStorageMatrix& operator=(initializer_list> cols) ", + method_as); + begin_scope(); + statement("size_t i;"); + statement("thread vec* col;"); + statement("for (i = 0, col = cols.begin(); i < Cols; ++i, ++col)"); + statement(" columns[i] = *col;"); + statement("return *this;"); + end_scope(); + } + statement(""); + for (size_t param_idx = 0; param_idx < sizeof(address_spaces) / sizeof(address_spaces[0]); ++param_idx) + { + if (param_idx != method_idx) + { + if (param_idx == 4) // threadgroup_imageblock + statement("#ifdef __HAVE_IMAGEBLOCKS__"); + else if (param_idx == 5) // ray_data + statement("#ifdef __HAVE_RAYTRACING__"); + else if (param_idx == 6) // object_data + statement("#ifdef __HAVE_MESH__"); + } + const string ¶m_as = address_spaces[param_idx]; + statement("spvStorageMatrix(const ", param_as, " matrix& m) ", method_as); + begin_scope(); + statement("for (size_t i = 0; i < Cols; ++i)"); + statement(" columns[i] = m.columns[i];"); + end_scope(); + statement("spvStorageMatrix(const ", param_as, " spvStorageMatrix& m) ", method_as, " = default;"); + if (method_idx != 1) // constant + { + statement(method_as, " spvStorageMatrix& operator=(const ", param_as, + " matrix& m) ", method_as); + begin_scope(); + statement("for (size_t i = 0; i < Cols; ++i)"); + statement(" columns[i] = m.columns[i];"); + statement("return *this;"); + end_scope(); + statement(method_as, " spvStorageMatrix& operator=(const ", param_as, " spvStorageMatrix& m) ", + method_as, " = default;"); + } + if (param_idx != method_idx && param_idx >= 4) + statement("#endif"); + statement(""); + } + statement("operator matrix() const ", method_as); + begin_scope(); + statement("matrix m;"); + statement("for (int i = 0; i < Cols; ++i)"); + statement(" m.columns[i] = columns[i];"); + statement("return m;"); + end_scope(); + statement(""); + statement("vec operator[](size_t idx) const ", method_as); + begin_scope(); + statement("return columns[idx];"); + end_scope(); + if (method_idx != 1) // constant + { + statement(method_as, " vec& operator[](size_t idx) ", method_as); + begin_scope(); + statement("return columns[idx];"); + end_scope(); + } + if (method_idx >= 4) + statement("#endif"); + statement(""); + } + end_scope_decl(); + statement(""); + statement("template"); + statement("matrix transpose(spvStorageMatrix m)"); + begin_scope(); + statement("return transpose(matrix(m));"); + end_scope(); + statement(""); + statement("typedef spvStorageMatrix spvStorage_half2x2;"); + statement("typedef spvStorageMatrix spvStorage_half2x3;"); + statement("typedef spvStorageMatrix spvStorage_half2x4;"); + statement("typedef spvStorageMatrix spvStorage_half3x2;"); + statement("typedef spvStorageMatrix spvStorage_half3x3;"); + statement("typedef spvStorageMatrix spvStorage_half3x4;"); + statement("typedef spvStorageMatrix spvStorage_half4x2;"); + statement("typedef spvStorageMatrix spvStorage_half4x3;"); + statement("typedef spvStorageMatrix spvStorage_half4x4;"); + statement("typedef spvStorageMatrix spvStorage_float2x2;"); + statement("typedef spvStorageMatrix spvStorage_float2x3;"); + statement("typedef spvStorageMatrix spvStorage_float2x4;"); + statement("typedef spvStorageMatrix spvStorage_float3x2;"); + statement("typedef spvStorageMatrix spvStorage_float3x3;"); + statement("typedef spvStorageMatrix spvStorage_float3x4;"); + statement("typedef spvStorageMatrix spvStorage_float4x2;"); + statement("typedef spvStorageMatrix spvStorage_float4x3;"); + statement("typedef spvStorageMatrix spvStorage_float4x4;"); + statement(""); + break; + + default: + break; + } + } +} + +// Emits any needed custom function bodies. +// Metal helper functions must be static force-inline, i.e. static inline __attribute__((always_inline)) +// otherwise they will cause problems when linked together in a single Metallib. +void CompilerMSL::emit_custom_functions() +{ + // Use when outputting overloaded functions to cover different address spaces. + static const char *texture_addr_spaces[] = { "device", "constant", "thread" }; + static uint32_t texture_addr_space_count = sizeof(texture_addr_spaces) / sizeof(char*); + + if (spv_function_implementations.count(SPVFuncImplArrayCopyMultidim)) + spv_function_implementations.insert(SPVFuncImplArrayCopy); + + if (spv_function_implementations.count(SPVFuncImplDynamicImageSampler)) + { + // Unfortunately, this one needs a lot of the other functions to compile OK. + if (!msl_options.supports_msl_version(2)) + SPIRV_CROSS_THROW( + "spvDynamicImageSampler requires default-constructible texture objects, which require MSL 2.0."); + spv_function_implementations.insert(SPVFuncImplTextureSwizzle); + if (msl_options.swizzle_texture_samples) + spv_function_implementations.insert(SPVFuncImplGatherSwizzle); + for (uint32_t i = SPVFuncImplChromaReconstructNearest2Plane; + i <= SPVFuncImplChromaReconstructLinear420XMidpointYMidpoint3Plane; i++) + spv_function_implementations.insert(static_cast(i)); + spv_function_implementations.insert(SPVFuncImplExpandITUFullRange); + spv_function_implementations.insert(SPVFuncImplExpandITUNarrowRange); + spv_function_implementations.insert(SPVFuncImplConvertYCbCrBT709); + spv_function_implementations.insert(SPVFuncImplConvertYCbCrBT601); + spv_function_implementations.insert(SPVFuncImplConvertYCbCrBT2020); + } + + if (spv_function_implementations.count(SPVFuncImplGatherSwizzle) || + spv_function_implementations.count(SPVFuncImplGatherConstOffsets)) + { + spv_function_implementations.insert(SPVFuncImplGatherReturn); + } + + if (spv_function_implementations.count(SPVFuncImplGatherCompareSwizzle) || + spv_function_implementations.count(SPVFuncImplGatherCompareConstOffsets)) + { + spv_function_implementations.insert(SPVFuncImplGatherCompareReturn); + } + + if (spv_function_implementations.count(SPVFuncImplTextureSwizzle) || + spv_function_implementations.count(SPVFuncImplGatherSwizzle) || + spv_function_implementations.count(SPVFuncImplGatherCompareSwizzle)) + { + spv_function_implementations.insert(SPVFuncImplGetSwizzle); + } + + for (const auto &spv_func : spv_function_implementations) + { + switch (spv_func) + { + case SPVFuncImplSMod: + statement("// Implementation of signed integer mod accurate to SPIR-V specification"); + statement("template"); + statement("inline Tx spvSMod(Tx x, Ty y)"); + begin_scope(); + statement("Tx remainder = x - y * (x / y);"); + statement("return select(Tx(remainder + y), remainder, remainder == 0 || (x >= 0) == (y >= 0));"); + end_scope(); + statement(""); + break; + + case SPVFuncImplMod: + statement("// Implementation of the GLSL mod() function, which is slightly different than Metal fmod()"); + statement("template"); + statement("inline Tx mod(Tx x, Ty y)"); + begin_scope(); + statement("return x - y * floor(x / y);"); + end_scope(); + statement(""); + break; + + case SPVFuncImplRadians: + statement("// Implementation of the GLSL radians() function"); + statement("template"); + statement("inline T radians(T d)"); + begin_scope(); + statement("return d * T(0.01745329251);"); + end_scope(); + statement(""); + break; + + case SPVFuncImplDegrees: + statement("// Implementation of the GLSL degrees() function"); + statement("template"); + statement("inline T degrees(T r)"); + begin_scope(); + statement("return r * T(57.2957795131);"); + end_scope(); + statement(""); + break; + + case SPVFuncImplFindILsb: + statement("// Implementation of the GLSL findLSB() function"); + statement("template"); + statement("inline T spvFindLSB(T x)"); + begin_scope(); + statement("return select(ctz(x), T(-1), x == T(0));"); + end_scope(); + statement(""); + break; + + case SPVFuncImplFindUMsb: + statement("// Implementation of the unsigned GLSL findMSB() function"); + statement("template"); + statement("inline T spvFindUMSB(T x)"); + begin_scope(); + statement("return select(clz(T(0)) - (clz(x) + T(1)), T(-1), x == T(0));"); + end_scope(); + statement(""); + break; + + case SPVFuncImplFindSMsb: + statement("// Implementation of the signed GLSL findMSB() function"); + statement("template"); + statement("inline T spvFindSMSB(T x)"); + begin_scope(); + statement("T v = select(x, T(-1) - x, x < T(0));"); + statement("return select(clz(T(0)) - (clz(v) + T(1)), T(-1), v == T(0));"); + end_scope(); + statement(""); + break; + + case SPVFuncImplSSign: + statement("// Implementation of the GLSL sign() function for integer types"); + statement("template::value>::type>"); + statement("inline T sign(T x)"); + begin_scope(); + statement("return select(select(select(x, T(0), x == T(0)), T(1), x > T(0)), T(-1), x < T(0));"); + end_scope(); + statement(""); + break; + + case SPVFuncImplArrayCopy: + case SPVFuncImplArrayCopyMultidim: + { + // Unfortunately we cannot template on the address space, so combinatorial explosion it is. + static const char *function_name_tags[] = { + "FromConstantToStack", "FromConstantToThreadGroup", "FromStackToStack", + "FromStackToThreadGroup", "FromThreadGroupToStack", "FromThreadGroupToThreadGroup", + "FromDeviceToDevice", "FromConstantToDevice", "FromStackToDevice", + "FromThreadGroupToDevice", "FromDeviceToStack", "FromDeviceToThreadGroup", + }; + + static const char *src_address_space[] = { + "constant", "constant", "thread const", "thread const", + "threadgroup const", "threadgroup const", "device const", "constant", + "thread const", "threadgroup const", "device const", "device const", + }; + + static const char *dst_address_space[] = { + "thread", "threadgroup", "thread", "threadgroup", "thread", "threadgroup", + "device", "device", "device", "device", "thread", "threadgroup", + }; + + static const bool src_is_physical_with_mismatch[] = { + true, true, false, + false, false, false, + false, false, false, + false, true, true, + }; + + static const bool dst_is_physical_with_mismatch[] = { + false, false, false, + false, false, false, + false, false, true, + true, false, false, + }; + + for (uint32_t variant = 0; variant < 12; variant++) + { + assert(!src_is_physical_with_mismatch[variant] || !dst_is_physical_with_mismatch[variant]); + bool is_multidim = spv_func == SPVFuncImplArrayCopyMultidim; + const char *dim = is_multidim ? "[N][M]" : "[N]"; + + // Simple base case. + statement("template" : ">"); + statement("inline void spvArrayCopy", function_name_tags[variant], "(", + dst_address_space[variant], " T (&dst)", dim, ", ", + src_address_space[variant], " T (&src)", dim, ")"); + begin_scope(); + statement("for (uint i = 0; i < N; i++)"); + begin_scope(); + if (is_multidim) + statement("spvArrayCopy", function_name_tags[variant], "(dst[i], src[i]);"); + else + statement("dst[i] = src[i];"); + end_scope(); + end_scope(); + + if (spv_function_implementations.count(SPVFuncImplArrayCopyExtendedSrc) && + src_is_physical_with_mismatch[variant]) + { + // 1st overload, src can be magic vector where dst is a scalar. + // Need reinterpret casts to be memory model correct. LLVM vectors are broken otherwise. + statement("template" : ">"); + statement("inline void spvArrayCopy", function_name_tags[variant], "(", + dst_address_space[variant], " T (&dst)", dim, ", ", + src_address_space[variant], " vec (&src)", dim, ")"); + begin_scope(); + statement("for (uint i = 0; i < N; i++)"); + begin_scope(); + if (is_multidim) + statement("spvArrayCopy", function_name_tags[variant], "(dst[i], src[i]);"); + else + statement("dst[i] = reinterpret_cast<", src_address_space[variant], " T &>(src[i]);"); + end_scope(); + end_scope(); + + statement(""); + + // 2nd overload, both are vectors, but need SFINAE magic to avoid ambiguous case. + statement("template" : ">"); + statement("inline enable_if_t spvArrayCopy", function_name_tags[variant], "(", + dst_address_space[variant], " vec (&dst)", dim, ", ", + src_address_space[variant], " vec (&src)", dim, ")"); + begin_scope(); + statement("for (uint i = 0; i < N; i++)"); + begin_scope(); + if (is_multidim) + statement("spvArrayCopy", function_name_tags[variant], "(dst[i], src[i]);"); + else + statement("dst[i] = reinterpret_cast<", src_address_space[variant], " vec &>(src[i]);"); + end_scope(); + end_scope(); + } + + if (spv_function_implementations.count(SPVFuncImplArrayCopyExtendedDst) && + dst_is_physical_with_mismatch[variant]) + { + // 1st overload, src can be magic vector where dst is a scalar. + // Need reinterpret casts to be memory model correct. LLVM vectors are broken otherwise. + statement("template" : ">"); + statement("inline void spvArrayCopy", function_name_tags[variant], "(", + dst_address_space[variant], " vec (&dst)", dim, ", ", + src_address_space[variant], " T (&src)", dim, ")"); + begin_scope(); + statement("for (uint i = 0; i < N; i++)"); + begin_scope(); + if (is_multidim) + statement("spvArrayCopy", function_name_tags[variant], "(dst[i], src[i]);"); + else + statement("reinterpret_cast<", dst_address_space[variant], " T &>(dst[i]) = src[i];"); + end_scope(); + end_scope(); + + statement(""); + + // 2nd overload, both are vectors, but need SFINAE magic to avoid ambiguous case. + statement("template" : ">"); + statement("inline enable_if_t spvArrayCopy", function_name_tags[variant], "(", + dst_address_space[variant], " vec (&dst)", dim, ", ", + src_address_space[variant], " vec (&src)", dim, ")"); + begin_scope(); + statement("for (uint i = 0; i < N; i++)"); + begin_scope(); + if (is_multidim) + statement("spvArrayCopy", function_name_tags[variant], "(dst[i], src[i]);"); + else + statement("reinterpret_cast<", dst_address_space[variant], " vec &>(dst[i]) = src[i];"); + end_scope(); + end_scope(); + } + + statement(""); + } + break; + } + + // Support for Metal 2.1's new texture_buffer type. + case SPVFuncImplTexelBufferCoords: + { + if (msl_options.texel_buffer_texture_width > 0) + { + string tex_width_str = convert_to_string(msl_options.texel_buffer_texture_width); + statement("// Returns 2D texture coords corresponding to 1D texel buffer coords"); + statement(force_inline); + statement("uint2 spvTexelBufferCoord(uint tc)"); + begin_scope(); + statement(join("return uint2(tc % ", tex_width_str, ", tc / ", tex_width_str, ");")); + end_scope(); + statement(""); + } + else + { + statement("// Returns 2D texture coords corresponding to 1D texel buffer coords"); + statement( + "#define spvTexelBufferCoord(tc, tex) uint2((tc) % (tex).get_width(), (tc) / (tex).get_width())"); + statement(""); + } + break; + } + + // Emulate texture2D atomic operations + case SPVFuncImplImage2DAtomicCoords: + { + if (msl_options.supports_msl_version(1, 2)) + { + statement("// The required alignment of a linear texture of R32Uint format."); + statement("constant uint spvLinearTextureAlignmentOverride [[function_constant(", + msl_options.r32ui_alignment_constant_id, ")]];"); + statement("constant uint spvLinearTextureAlignment = ", + "is_function_constant_defined(spvLinearTextureAlignmentOverride) ? ", + "spvLinearTextureAlignmentOverride : ", msl_options.r32ui_linear_texture_alignment, ";"); + } + else + { + statement("// The required alignment of a linear texture of R32Uint format."); + statement("constant uint spvLinearTextureAlignment = ", msl_options.r32ui_linear_texture_alignment, + ";"); + } + statement("// Returns buffer coords corresponding to 2D texture coords for emulating 2D texture atomics"); + statement("#define spvImage2DAtomicCoord(tc, tex) (((((tex).get_width() + ", + " spvLinearTextureAlignment / 4 - 1) & ~(", + " spvLinearTextureAlignment / 4 - 1)) * (tc).y) + (tc).x)"); + statement(""); + break; + } + + // Fix up gradient vectors when sampling a cube texture for Apple Silicon. + // h/t Alexey Knyazev (https://github.com/KhronosGroup/MoltenVK/issues/2068#issuecomment-1817799067) for the code. + case SPVFuncImplGradientCube: + statement("static inline gradientcube spvGradientCube(float3 P, float3 dPdx, float3 dPdy)"); + begin_scope(); + statement("// Major axis selection"); + statement("float3 absP = abs(P);"); + statement("bool xMajor = absP.x >= max(absP.y, absP.z);"); + statement("bool yMajor = absP.y >= absP.z;"); + statement("float3 Q = xMajor ? P.yzx : (yMajor ? P.xzy : P);"); + statement("float3 dQdx = xMajor ? dPdx.yzx : (yMajor ? dPdx.xzy : dPdx);"); + statement("float3 dQdy = xMajor ? dPdy.yzx : (yMajor ? dPdy.xzy : dPdy);"); + statement_no_indent(""); + statement("// Skip a couple of operations compared to usual projection"); + statement("float4 d = float4(dQdx.xy, dQdy.xy) - (Q.xy / Q.z).xyxy * float4(dQdx.zz, dQdy.zz);"); + statement_no_indent(""); + statement("// Final swizzle to put the intermediate values into non-ignored components"); + statement("// X major: X and Z"); + statement("// Y major: X and Y"); + statement("// Z major: Y and Z"); + statement("return gradientcube(xMajor ? d.xxy : d.xyx, xMajor ? d.zzw : d.zwz);"); + end_scope(); + statement(""); + break; + + // "fadd" intrinsic support + case SPVFuncImplFAdd: + statement("template"); + statement("[[clang::optnone]] T spvFAdd(T l, T r)"); + begin_scope(); + statement("return fma(T(1), l, r);"); + end_scope(); + statement(""); + break; + + // "fsub" intrinsic support + case SPVFuncImplFSub: + statement("template"); + statement("[[clang::optnone]] T spvFSub(T l, T r)"); + begin_scope(); + statement("return fma(T(-1), r, l);"); + end_scope(); + statement(""); + break; + + // "fmul' intrinsic support + case SPVFuncImplFMul: + statement("template"); + statement("[[clang::optnone]] T spvFMul(T l, T r)"); + begin_scope(); + statement("return fma(l, r, T(0));"); + end_scope(); + statement(""); + + statement("template"); + statement("[[clang::optnone]] vec spvFMulVectorMatrix(vec v, matrix m)"); + begin_scope(); + statement("vec res = vec(0);"); + statement("for (uint i = Rows; i > 0; --i)"); + begin_scope(); + statement("vec tmp(0);"); + statement("for (uint j = 0; j < Cols; ++j)"); + begin_scope(); + statement("tmp[j] = m[j][i - 1];"); + end_scope(); + statement("res = fma(tmp, vec(v[i - 1]), res);"); + end_scope(); + statement("return res;"); + end_scope(); + statement(""); + + statement("template"); + statement("[[clang::optnone]] vec spvFMulMatrixVector(matrix m, vec v)"); + begin_scope(); + statement("vec res = vec(0);"); + statement("for (uint i = Cols; i > 0; --i)"); + begin_scope(); + statement("res = fma(m[i - 1], vec(v[i - 1]), res);"); + end_scope(); + statement("return res;"); + end_scope(); + statement(""); + + statement("template"); + statement("[[clang::optnone]] matrix spvFMulMatrixMatrix(matrix l, matrix r)"); + begin_scope(); + statement("matrix res;"); + statement("for (uint i = 0; i < RCols; i++)"); + begin_scope(); + statement("vec tmp(0);"); + statement("for (uint j = 0; j < LCols; j++)"); + begin_scope(); + statement("tmp = fma(vec(r[i][j]), l[j], tmp);"); + end_scope(); + statement("res[i] = tmp;"); + end_scope(); + statement("return res;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplQuantizeToF16: + // Ensure fast-math is disabled to match Vulkan results. + // SpvHalfTypeSelector is used to match the half* template type to the float* template type. + // Depending on GPU, MSL does not always flush converted subnormal halfs to zero, + // as required by OpQuantizeToF16, so check for subnormals and flush them to zero. + statement("template struct SpvHalfTypeSelector;"); + statement("template <> struct SpvHalfTypeSelector { public: using H = half; };"); + statement("template struct SpvHalfTypeSelector> { using H = vec; };"); + statement("template::H>"); + statement("[[clang::optnone]] F spvQuantizeToF16(F fval)"); + begin_scope(); + statement("H hval = H(fval);"); + statement("hval = select(copysign(H(0), hval), hval, isnormal(hval) || isinf(hval) || isnan(hval));"); + statement("return F(hval);"); + end_scope(); + statement(""); + break; + + // Emulate texturecube_array with texture2d_array for iOS where this type is not available + case SPVFuncImplCubemapTo2DArrayFace: + statement(force_inline); + statement("float3 spvCubemapTo2DArrayFace(float3 P)"); + begin_scope(); + statement("float3 Coords = abs(P.xyz);"); + statement("float CubeFace = 0;"); + statement("float ProjectionAxis = 0;"); + statement("float u = 0;"); + statement("float v = 0;"); + statement("if (Coords.x >= Coords.y && Coords.x >= Coords.z)"); + begin_scope(); + statement("CubeFace = P.x >= 0 ? 0 : 1;"); + statement("ProjectionAxis = Coords.x;"); + statement("u = P.x >= 0 ? -P.z : P.z;"); + statement("v = -P.y;"); + end_scope(); + statement("else if (Coords.y >= Coords.x && Coords.y >= Coords.z)"); + begin_scope(); + statement("CubeFace = P.y >= 0 ? 2 : 3;"); + statement("ProjectionAxis = Coords.y;"); + statement("u = P.x;"); + statement("v = P.y >= 0 ? P.z : -P.z;"); + end_scope(); + statement("else"); + begin_scope(); + statement("CubeFace = P.z >= 0 ? 4 : 5;"); + statement("ProjectionAxis = Coords.z;"); + statement("u = P.z >= 0 ? P.x : -P.x;"); + statement("v = -P.y;"); + end_scope(); + statement("u = 0.5 * (u/ProjectionAxis + 1);"); + statement("v = 0.5 * (v/ProjectionAxis + 1);"); + statement("return float3(u, v, CubeFace);"); + end_scope(); + statement(""); + break; + + case SPVFuncImplInverse4x4: + statement("// Returns the determinant of a 2x2 matrix."); + statement(force_inline); + statement("float spvDet2x2(float a1, float a2, float b1, float b2)"); + begin_scope(); + statement("return a1 * b2 - b1 * a2;"); + end_scope(); + statement(""); + + statement("// Returns the determinant of a 3x3 matrix."); + statement(force_inline); + statement("float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, " + "float c2, float c3)"); + begin_scope(); + statement("return a1 * spvDet2x2(b2, b3, c2, c3) - b1 * spvDet2x2(a2, a3, c2, c3) + c1 * spvDet2x2(a2, a3, " + "b2, b3);"); + end_scope(); + statement(""); + statement("// Returns the inverse of a matrix, by using the algorithm of calculating the classical"); + statement("// adjoint and dividing by the determinant. The contents of the matrix are changed."); + statement(force_inline); + statement("float4x4 spvInverse4x4(float4x4 m)"); + begin_scope(); + statement("float4x4 adj; // The adjoint matrix (inverse after dividing by determinant)"); + statement_no_indent(""); + statement("// Create the transpose of the cofactors, as the classical adjoint of the matrix."); + statement("adj[0][0] = spvDet3x3(m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], " + "m[3][3]);"); + statement("adj[0][1] = -spvDet3x3(m[0][1], m[0][2], m[0][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], " + "m[3][3]);"); + statement("adj[0][2] = spvDet3x3(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[3][1], m[3][2], " + "m[3][3]);"); + statement("adj[0][3] = -spvDet3x3(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], " + "m[2][3]);"); + statement_no_indent(""); + statement("adj[1][0] = -spvDet3x3(m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], " + "m[3][3]);"); + statement("adj[1][1] = spvDet3x3(m[0][0], m[0][2], m[0][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], " + "m[3][3]);"); + statement("adj[1][2] = -spvDet3x3(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[3][0], m[3][2], " + "m[3][3]);"); + statement("adj[1][3] = spvDet3x3(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], " + "m[2][3]);"); + statement_no_indent(""); + statement("adj[2][0] = spvDet3x3(m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], " + "m[3][3]);"); + statement("adj[2][1] = -spvDet3x3(m[0][0], m[0][1], m[0][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], " + "m[3][3]);"); + statement("adj[2][2] = spvDet3x3(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[3][0], m[3][1], " + "m[3][3]);"); + statement("adj[2][3] = -spvDet3x3(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], " + "m[2][3]);"); + statement_no_indent(""); + statement("adj[3][0] = -spvDet3x3(m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], " + "m[3][2]);"); + statement("adj[3][1] = spvDet3x3(m[0][0], m[0][1], m[0][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], " + "m[3][2]);"); + statement("adj[3][2] = -spvDet3x3(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[3][0], m[3][1], " + "m[3][2]);"); + statement("adj[3][3] = spvDet3x3(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], " + "m[2][2]);"); + statement_no_indent(""); + statement("// Calculate the determinant as a combination of the cofactors of the first row."); + statement("float det = (adj[0][0] * m[0][0]) + (adj[0][1] * m[1][0]) + (adj[0][2] * m[2][0]) + (adj[0][3] " + "* m[3][0]);"); + statement_no_indent(""); + statement("// Divide the classical adjoint matrix by the determinant."); + statement("// If determinant is zero, matrix is not invertable, so leave it unchanged."); + statement("return (det != 0.0f) ? (adj * (1.0f / det)) : m;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplInverse3x3: + if (spv_function_implementations.count(SPVFuncImplInverse4x4) == 0) + { + statement("// Returns the determinant of a 2x2 matrix."); + statement(force_inline); + statement("float spvDet2x2(float a1, float a2, float b1, float b2)"); + begin_scope(); + statement("return a1 * b2 - b1 * a2;"); + end_scope(); + statement(""); + } + + statement("// Returns the inverse of a matrix, by using the algorithm of calculating the classical"); + statement("// adjoint and dividing by the determinant. The contents of the matrix are changed."); + statement(force_inline); + statement("float3x3 spvInverse3x3(float3x3 m)"); + begin_scope(); + statement("float3x3 adj; // The adjoint matrix (inverse after dividing by determinant)"); + statement_no_indent(""); + statement("// Create the transpose of the cofactors, as the classical adjoint of the matrix."); + statement("adj[0][0] = spvDet2x2(m[1][1], m[1][2], m[2][1], m[2][2]);"); + statement("adj[0][1] = -spvDet2x2(m[0][1], m[0][2], m[2][1], m[2][2]);"); + statement("adj[0][2] = spvDet2x2(m[0][1], m[0][2], m[1][1], m[1][2]);"); + statement_no_indent(""); + statement("adj[1][0] = -spvDet2x2(m[1][0], m[1][2], m[2][0], m[2][2]);"); + statement("adj[1][1] = spvDet2x2(m[0][0], m[0][2], m[2][0], m[2][2]);"); + statement("adj[1][2] = -spvDet2x2(m[0][0], m[0][2], m[1][0], m[1][2]);"); + statement_no_indent(""); + statement("adj[2][0] = spvDet2x2(m[1][0], m[1][1], m[2][0], m[2][1]);"); + statement("adj[2][1] = -spvDet2x2(m[0][0], m[0][1], m[2][0], m[2][1]);"); + statement("adj[2][2] = spvDet2x2(m[0][0], m[0][1], m[1][0], m[1][1]);"); + statement_no_indent(""); + statement("// Calculate the determinant as a combination of the cofactors of the first row."); + statement("float det = (adj[0][0] * m[0][0]) + (adj[0][1] * m[1][0]) + (adj[0][2] * m[2][0]);"); + statement_no_indent(""); + statement("// Divide the classical adjoint matrix by the determinant."); + statement("// If determinant is zero, matrix is not invertable, so leave it unchanged."); + statement("return (det != 0.0f) ? (adj * (1.0f / det)) : m;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplInverse2x2: + statement("// Returns the inverse of a matrix, by using the algorithm of calculating the classical"); + statement("// adjoint and dividing by the determinant. The contents of the matrix are changed."); + statement(force_inline); + statement("float2x2 spvInverse2x2(float2x2 m)"); + begin_scope(); + statement("float2x2 adj; // The adjoint matrix (inverse after dividing by determinant)"); + statement_no_indent(""); + statement("// Create the transpose of the cofactors, as the classical adjoint of the matrix."); + statement("adj[0][0] = m[1][1];"); + statement("adj[0][1] = -m[0][1];"); + statement_no_indent(""); + statement("adj[1][0] = -m[1][0];"); + statement("adj[1][1] = m[0][0];"); + statement_no_indent(""); + statement("// Calculate the determinant as a combination of the cofactors of the first row."); + statement("float det = (adj[0][0] * m[0][0]) + (adj[0][1] * m[1][0]);"); + statement_no_indent(""); + statement("// Divide the classical adjoint matrix by the determinant."); + statement("// If determinant is zero, matrix is not invertable, so leave it unchanged."); + statement("return (det != 0.0f) ? (adj * (1.0f / det)) : m;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplGetSwizzle: + statement("enum class spvSwizzle : uint"); + begin_scope(); + statement("none = 0,"); + statement("zero,"); + statement("one,"); + statement("red,"); + statement("green,"); + statement("blue,"); + statement("alpha"); + end_scope_decl(); + statement(""); + statement("template"); + statement("inline T spvGetSwizzle(vec x, T c, spvSwizzle s)"); + begin_scope(); + statement("switch (s)"); + begin_scope(); + statement("case spvSwizzle::none:"); + statement(" return c;"); + statement("case spvSwizzle::zero:"); + statement(" return 0;"); + statement("case spvSwizzle::one:"); + statement(" return 1;"); + statement("case spvSwizzle::red:"); + statement(" return x.r;"); + statement("case spvSwizzle::green:"); + statement(" return x.g;"); + statement("case spvSwizzle::blue:"); + statement(" return x.b;"); + statement("case spvSwizzle::alpha:"); + statement(" return x.a;"); + end_scope(); + end_scope(); + statement(""); + break; + + case SPVFuncImplTextureSwizzle: + statement("// Wrapper function that swizzles texture samples and fetches."); + statement("template"); + statement("inline vec spvTextureSwizzle(vec x, uint s)"); + begin_scope(); + statement("if (!s)"); + statement(" return x;"); + statement("return vec(spvGetSwizzle(x, x.r, spvSwizzle((s >> 0) & 0xFF)), " + "spvGetSwizzle(x, x.g, spvSwizzle((s >> 8) & 0xFF)), spvGetSwizzle(x, x.b, spvSwizzle((s >> 16) " + "& 0xFF)), " + "spvGetSwizzle(x, x.a, spvSwizzle((s >> 24) & 0xFF)));"); + end_scope(); + statement(""); + statement("template"); + statement("inline T spvTextureSwizzle(T x, uint s)"); + begin_scope(); + statement("return spvTextureSwizzle(vec(x, 0, 0, 1), s).x;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplGatherReturn: + statement("template"); + statement("using spvGatherReturn = decltype(declval().gather(declval(), declval()...));"); + statement(""); + break; + + case SPVFuncImplGatherCompareReturn: + statement("template"); + statement("using spvGatherCompareReturn = decltype(declval().gather_compare(declval(), declval()...));"); + statement(""); + break; + + case SPVFuncImplGatherSwizzle: + statement("// Wrapper function that swizzles texture gathers."); + statement("template"); + statement("inline spvGatherReturn spvGatherSwizzle(const thread Tex& t, sampler s, " + "uint sw, component c, Ts... params) METAL_CONST_ARG(c)"); + begin_scope(); + statement("if (sw)"); + begin_scope(); + statement("switch (spvSwizzle((sw >> (uint(c) * 8)) & 0xFF))"); + begin_scope(); + statement("case spvSwizzle::none:"); + statement(" break;"); + statement("case spvSwizzle::zero:"); + statement(" return spvGatherReturn(0, 0, 0, 0);"); + statement("case spvSwizzle::one:"); + statement(" return spvGatherReturn(1, 1, 1, 1);"); + statement("case spvSwizzle::red:"); + statement(" return t.gather(s, params..., component::x);"); + statement("case spvSwizzle::green:"); + statement(" return t.gather(s, params..., component::y);"); + statement("case spvSwizzle::blue:"); + statement(" return t.gather(s, params..., component::z);"); + statement("case spvSwizzle::alpha:"); + statement(" return t.gather(s, params..., component::w);"); + end_scope(); + end_scope(); + // texture::gather insists on its component parameter being a constant + // expression, so we need this silly workaround just to compile the shader. + statement("switch (c)"); + begin_scope(); + statement("case component::x:"); + statement(" return t.gather(s, params..., component::x);"); + statement("case component::y:"); + statement(" return t.gather(s, params..., component::y);"); + statement("case component::z:"); + statement(" return t.gather(s, params..., component::z);"); + statement("case component::w:"); + statement(" return t.gather(s, params..., component::w);"); + end_scope(); + end_scope(); + statement(""); + break; + + case SPVFuncImplGatherCompareSwizzle: + statement("// Wrapper function that swizzles depth texture gathers."); + statement("template"); + statement("inline spvGatherCompareReturn spvGatherCompareSwizzle(const thread Tex& t, sampler s, uint sw, Ts... params)"); + begin_scope(); + statement("if (sw)"); + begin_scope(); + statement("switch (spvSwizzle(sw & 0xFF))"); + begin_scope(); + statement("case spvSwizzle::none:"); + statement("case spvSwizzle::red:"); + statement(" break;"); + statement("case spvSwizzle::zero:"); + statement("case spvSwizzle::green:"); + statement("case spvSwizzle::blue:"); + statement("case spvSwizzle::alpha:"); + statement(" return spvGatherCompareReturn(0, 0, 0, 0);"); + statement("case spvSwizzle::one:"); + statement(" return spvGatherCompareReturn(1, 1, 1, 1);"); + end_scope(); + end_scope(); + statement("return t.gather_compare(s, params...);"); + end_scope(); + statement(""); + break; + + case SPVFuncImplGatherConstOffsets: + // Because we are passing a texture reference, we have to output an overloaded version of this function for each address space. + for (uint32_t i = 0; i < texture_addr_space_count; i++) + { + statement("// Wrapper function that processes a ", texture_addr_spaces[i], " texture gather with a constant offset array."); + statement("template"); + statement("inline spvGatherReturn spvGatherConstOffsets(const ", texture_addr_spaces[i], " Tex& t, sampler s, " + "Toff coffsets, component c, Tp... params) METAL_CONST_ARG(c)"); + begin_scope(); + statement("spvGatherReturn rslts[4];"); + statement("for (uint i = 0; i < 4; i++)"); + begin_scope(); + statement("switch (c)"); + begin_scope(); + // Work around texture::gather() requiring its component parameter to be a constant expression + statement("case component::x:"); + statement(" rslts[i] = t.gather(s, params..., coffsets[i], component::x);"); + statement(" break;"); + statement("case component::y:"); + statement(" rslts[i] = t.gather(s, params..., coffsets[i], component::y);"); + statement(" break;"); + statement("case component::z:"); + statement(" rslts[i] = t.gather(s, params..., coffsets[i], component::z);"); + statement(" break;"); + statement("case component::w:"); + statement(" rslts[i] = t.gather(s, params..., coffsets[i], component::w);"); + statement(" break;"); + end_scope(); + end_scope(); + // Pull all values from the i0j0 component of each gather footprint + statement("return spvGatherReturn(rslts[0].w, rslts[1].w, rslts[2].w, rslts[3].w);"); + end_scope(); + statement(""); + } + break; + + case SPVFuncImplGatherCompareConstOffsets: + // Because we are passing a texture reference, we have to output an overloaded version of this function for each address space. + for (uint32_t i = 0; i < texture_addr_space_count; i++) + { + statement("// Wrapper function that processes a ", texture_addr_spaces[i], " texture gather with a constant offset array."); + statement("template"); + statement("inline spvGatherCompareReturn spvGatherCompareConstOffsets(const ", texture_addr_spaces[i], " Tex& t, sampler s, " + "Toff coffsets, Tp... params)"); + begin_scope(); + statement("spvGatherCompareReturn rslts[4];"); + statement("for (uint i = 0; i < 4; i++)"); + begin_scope(); + statement(" rslts[i] = t.gather_compare(s, params..., coffsets[i]);"); + end_scope(); + // Pull all values from the i0j0 component of each gather footprint + statement("return spvGatherCompareReturn(rslts[0].w, rslts[1].w, rslts[2].w, rslts[3].w);"); + end_scope(); + statement(""); + } + break; + + case SPVFuncImplSubgroupBroadcast: + // Metal doesn't allow broadcasting boolean values directly, but we can work around that by broadcasting + // them as integers. + statement("template"); + statement("inline T spvSubgroupBroadcast(T value, ushort lane)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return quad_broadcast(value, lane);"); + else + statement("return simd_broadcast(value, lane);"); + end_scope(); + statement(""); + statement("template<>"); + statement("inline bool spvSubgroupBroadcast(bool value, ushort lane)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return !!quad_broadcast((ushort)value, lane);"); + else + statement("return !!simd_broadcast((ushort)value, lane);"); + end_scope(); + statement(""); + statement("template"); + statement("inline vec spvSubgroupBroadcast(vec value, ushort lane)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return (vec)quad_broadcast((vec)value, lane);"); + else + statement("return (vec)simd_broadcast((vec)value, lane);"); + end_scope(); + statement(""); + break; + + case SPVFuncImplSubgroupBroadcastFirst: + statement("template"); + statement("inline T spvSubgroupBroadcastFirst(T value)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return quad_broadcast_first(value);"); + else + statement("return simd_broadcast_first(value);"); + end_scope(); + statement(""); + statement("template<>"); + statement("inline bool spvSubgroupBroadcastFirst(bool value)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return !!quad_broadcast_first((ushort)value);"); + else + statement("return !!simd_broadcast_first((ushort)value);"); + end_scope(); + statement(""); + statement("template"); + statement("inline vec spvSubgroupBroadcastFirst(vec value)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return (vec)quad_broadcast_first((vec)value);"); + else + statement("return (vec)simd_broadcast_first((vec)value);"); + end_scope(); + statement(""); + break; + + case SPVFuncImplSubgroupBallot: + statement("inline uint4 spvSubgroupBallot(bool value)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + { + statement("return uint4((quad_vote::vote_t)quad_ballot(value), 0, 0, 0);"); + } + else if (msl_options.is_ios()) + { + // The current simd_vote on iOS uses a 32-bit integer-like object. + statement("return uint4((simd_vote::vote_t)simd_ballot(value), 0, 0, 0);"); + } + else + { + statement("simd_vote vote = simd_ballot(value);"); + statement("// simd_ballot() returns a 64-bit integer-like object, but"); + statement("// SPIR-V callers expect a uint4. We must convert."); + statement("// FIXME: This won't include higher bits if Apple ever supports"); + statement("// 128 lanes in an SIMD-group."); + statement("return uint4(as_type((simd_vote::vote_t)vote), 0, 0);"); + } + end_scope(); + statement(""); + break; + + case SPVFuncImplSubgroupBallotBitExtract: + statement("inline bool spvSubgroupBallotBitExtract(uint4 ballot, uint bit)"); + begin_scope(); + statement("return !!extract_bits(ballot[bit / 32], bit % 32, 1);"); + end_scope(); + statement(""); + break; + + case SPVFuncImplSubgroupBallotFindLSB: + statement("inline uint spvSubgroupBallotFindLSB(uint4 ballot, uint gl_SubgroupSize)"); + begin_scope(); + if (msl_options.is_ios()) + { + statement("uint4 mask = uint4(extract_bits(0xFFFFFFFF, 0, gl_SubgroupSize), uint3(0));"); + } + else + { + statement("uint4 mask = uint4(extract_bits(0xFFFFFFFF, 0, min(gl_SubgroupSize, 32u)), " + "extract_bits(0xFFFFFFFF, 0, (uint)max((int)gl_SubgroupSize - 32, 0)), uint2(0));"); + } + statement("ballot &= mask;"); + statement("return select(ctz(ballot.x), select(32 + ctz(ballot.y), select(64 + ctz(ballot.z), select(96 + " + "ctz(ballot.w), uint(-1), ballot.w == 0), ballot.z == 0), ballot.y == 0), ballot.x == 0);"); + end_scope(); + statement(""); + break; + + case SPVFuncImplSubgroupBallotFindMSB: + statement("inline uint spvSubgroupBallotFindMSB(uint4 ballot, uint gl_SubgroupSize)"); + begin_scope(); + if (msl_options.is_ios()) + { + statement("uint4 mask = uint4(extract_bits(0xFFFFFFFF, 0, gl_SubgroupSize), uint3(0));"); + } + else + { + statement("uint4 mask = uint4(extract_bits(0xFFFFFFFF, 0, min(gl_SubgroupSize, 32u)), " + "extract_bits(0xFFFFFFFF, 0, (uint)max((int)gl_SubgroupSize - 32, 0)), uint2(0));"); + } + statement("ballot &= mask;"); + statement("return select(128 - (clz(ballot.w) + 1), select(96 - (clz(ballot.z) + 1), select(64 - " + "(clz(ballot.y) + 1), select(32 - (clz(ballot.x) + 1), uint(-1), ballot.x == 0), ballot.y == 0), " + "ballot.z == 0), ballot.w == 0);"); + end_scope(); + statement(""); + break; + + case SPVFuncImplSubgroupBallotBitCount: + statement("inline uint spvPopCount4(uint4 ballot)"); + begin_scope(); + statement("return popcount(ballot.x) + popcount(ballot.y) + popcount(ballot.z) + popcount(ballot.w);"); + end_scope(); + statement(""); + statement("inline uint spvSubgroupBallotBitCount(uint4 ballot, uint gl_SubgroupSize)"); + begin_scope(); + if (msl_options.is_ios()) + { + statement("uint4 mask = uint4(extract_bits(0xFFFFFFFF, 0, gl_SubgroupSize), uint3(0));"); + } + else + { + statement("uint4 mask = uint4(extract_bits(0xFFFFFFFF, 0, min(gl_SubgroupSize, 32u)), " + "extract_bits(0xFFFFFFFF, 0, (uint)max((int)gl_SubgroupSize - 32, 0)), uint2(0));"); + } + statement("return spvPopCount4(ballot & mask);"); + end_scope(); + statement(""); + statement("inline uint spvSubgroupBallotInclusiveBitCount(uint4 ballot, uint gl_SubgroupInvocationID)"); + begin_scope(); + if (msl_options.is_ios()) + { + statement("uint4 mask = uint4(extract_bits(0xFFFFFFFF, 0, gl_SubgroupInvocationID + 1), uint3(0));"); + } + else + { + statement("uint4 mask = uint4(extract_bits(0xFFFFFFFF, 0, min(gl_SubgroupInvocationID + 1, 32u)), " + "extract_bits(0xFFFFFFFF, 0, (uint)max((int)gl_SubgroupInvocationID + 1 - 32, 0)), " + "uint2(0));"); + } + statement("return spvPopCount4(ballot & mask);"); + end_scope(); + statement(""); + statement("inline uint spvSubgroupBallotExclusiveBitCount(uint4 ballot, uint gl_SubgroupInvocationID)"); + begin_scope(); + if (msl_options.is_ios()) + { + statement("uint4 mask = uint4(extract_bits(0xFFFFFFFF, 0, gl_SubgroupInvocationID), uint2(0));"); + } + else + { + statement("uint4 mask = uint4(extract_bits(0xFFFFFFFF, 0, min(gl_SubgroupInvocationID, 32u)), " + "extract_bits(0xFFFFFFFF, 0, (uint)max((int)gl_SubgroupInvocationID - 32, 0)), uint2(0));"); + } + statement("return spvPopCount4(ballot & mask);"); + end_scope(); + statement(""); + break; + + case SPVFuncImplSubgroupAllEqual: + // Metal doesn't provide a function to evaluate this directly. But, we can + // implement this by comparing every thread's value to one thread's value + // (in this case, the value of the first active thread). Then, by the transitive + // property of equality, if all comparisons return true, then they are all equal. + statement("template"); + statement("inline bool spvSubgroupAllEqual(T value)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return quad_all(all(value == quad_broadcast_first(value)));"); + else + statement("return simd_all(all(value == simd_broadcast_first(value)));"); + end_scope(); + statement(""); + statement("template<>"); + statement("inline bool spvSubgroupAllEqual(bool value)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return quad_all(value) || !quad_any(value);"); + else + statement("return simd_all(value) || !simd_any(value);"); + end_scope(); + statement(""); + statement("template"); + statement("inline bool spvSubgroupAllEqual(vec value)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return quad_all(all(value == (vec)quad_broadcast_first((vec)value)));"); + else + statement("return simd_all(all(value == (vec)simd_broadcast_first((vec)value)));"); + end_scope(); + statement(""); + break; + + case SPVFuncImplSubgroupShuffle: + statement("template"); + statement("inline T spvSubgroupShuffle(T value, ushort lane)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return quad_shuffle(value, lane);"); + else + statement("return simd_shuffle(value, lane);"); + end_scope(); + statement(""); + statement("template<>"); + statement("inline bool spvSubgroupShuffle(bool value, ushort lane)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return !!quad_shuffle((ushort)value, lane);"); + else + statement("return !!simd_shuffle((ushort)value, lane);"); + end_scope(); + statement(""); + statement("template"); + statement("inline vec spvSubgroupShuffle(vec value, ushort lane)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return (vec)quad_shuffle((vec)value, lane);"); + else + statement("return (vec)simd_shuffle((vec)value, lane);"); + end_scope(); + statement(""); + + if (msl_options.supports_msl_version(2, 2)) + { + // Despite being a template in MSL, it does not support 64-bit shuffles. + // Unsure if there's a cleaner way to statically unroll based on vec<> template, but this will do. + statement("template<>"); + statement("inline ulong spvSubgroupShuffle(ulong value, ushort lane)"); + begin_scope(); + statement("return as_type(spvSubgroupShuffle(as_type(value), lane));"); + end_scope(); + statement(""); + statement("template<>"); + statement("inline ulong2 spvSubgroupShuffle(ulong2 value, ushort lane)"); + begin_scope(); + statement("return ulong2(spvSubgroupShuffle(value.x, lane), spvSubgroupShuffle(value.y, lane));"); + end_scope(); + statement(""); + statement("inline ulong3 spvSubgroupShuffle(ulong3 value, ushort lane)"); + begin_scope(); + statement("return ulong3(spvSubgroupShuffle(value.xy, lane), spvSubgroupShuffle(value.z, lane));"); + end_scope(); + statement(""); + statement("inline ulong4 spvSubgroupShuffle(ulong4 value, ushort lane)"); + begin_scope(); + statement("return ulong4(spvSubgroupShuffle(value.xy, lane), spvSubgroupShuffle(value.zw, lane));"); + end_scope(); + statement(""); + statement("template"); + statement("inline vec spvSubgroupShuffle(vec value, ushort lane)"); + begin_scope(); + statement("return vec(spvSubgroupShuffle(vec(value), lane));"); + end_scope(); + statement(""); + } + break; + + case SPVFuncImplSubgroupShuffleXor: + statement("template"); + statement("inline T spvSubgroupShuffleXor(T value, ushort mask)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return quad_shuffle_xor(value, mask);"); + else + statement("return simd_shuffle_xor(value, mask);"); + end_scope(); + statement(""); + statement("template<>"); + statement("inline bool spvSubgroupShuffleXor(bool value, ushort mask)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return !!quad_shuffle_xor((ushort)value, mask);"); + else + statement("return !!simd_shuffle_xor((ushort)value, mask);"); + end_scope(); + statement(""); + statement("template"); + statement("inline vec spvSubgroupShuffleXor(vec value, ushort mask)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return (vec)quad_shuffle_xor((vec)value, mask);"); + else + statement("return (vec)simd_shuffle_xor((vec)value, mask);"); + end_scope(); + statement(""); + break; + + case SPVFuncImplSubgroupShuffleUp: + statement("template"); + statement("inline T spvSubgroupShuffleUp(T value, ushort delta)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return quad_shuffle_up(value, delta);"); + else + statement("return simd_shuffle_up(value, delta);"); + end_scope(); + statement(""); + statement("template<>"); + statement("inline bool spvSubgroupShuffleUp(bool value, ushort delta)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return !!quad_shuffle_up((ushort)value, delta);"); + else + statement("return !!simd_shuffle_up((ushort)value, delta);"); + end_scope(); + statement(""); + statement("template"); + statement("inline vec spvSubgroupShuffleUp(vec value, ushort delta)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return (vec)quad_shuffle_up((vec)value, delta);"); + else + statement("return (vec)simd_shuffle_up((vec)value, delta);"); + end_scope(); + statement(""); + break; + + case SPVFuncImplSubgroupShuffleDown: + statement("template"); + statement("inline T spvSubgroupShuffleDown(T value, ushort delta)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return quad_shuffle_down(value, delta);"); + else + statement("return simd_shuffle_down(value, delta);"); + end_scope(); + statement(""); + statement("template<>"); + statement("inline bool spvSubgroupShuffleDown(bool value, ushort delta)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return !!quad_shuffle_down((ushort)value, delta);"); + else + statement("return !!simd_shuffle_down((ushort)value, delta);"); + end_scope(); + statement(""); + statement("template"); + statement("inline vec spvSubgroupShuffleDown(vec value, ushort delta)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return (vec)quad_shuffle_down((vec)value, delta);"); + else + statement("return (vec)simd_shuffle_down((vec)value, delta);"); + end_scope(); + statement(""); + break; + + case SPVFuncImplSubgroupRotate: + statement("template"); + statement("inline T spvSubgroupRotate(T value, ushort delta)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return quad_shuffle_rotate_down(value, delta);"); + else + statement("return simd_shuffle_rotate_down(value, delta);"); + end_scope(); + statement(""); + statement("template<>"); + statement("inline bool spvSubgroupRotate(bool value, ushort delta)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return !!quad_shuffle_rotate_down((ushort)value, delta);"); + else + statement("return !!simd_shuffle_rotate_down((ushort)value, delta);"); + end_scope(); + statement(""); + statement("template"); + statement("inline vec spvSubgroupRotate(vec value, ushort delta)"); + begin_scope(); + if (msl_options.use_quadgroup_operation()) + statement("return (vec)quad_shuffle_rotate_down((vec)value, delta);"); + else + statement("return (vec)simd_shuffle_rotate_down((vec)value, delta);"); + end_scope(); + statement(""); + break; + + // C++ disallows partial specializations of function templates, + // hence the use of a struct. + // clang-format off +#define FUNC_SUBGROUP_CLUSTERED(spv, msl, combine, op, ident) \ + case SPVFuncImplSubgroupClustered##spv: \ + statement("template"); \ + statement("struct spvClustered" #spv "Detail;"); \ + statement(""); \ + statement("// Base cases"); \ + statement("template<>"); \ + statement("struct spvClustered" #spv "Detail<1, 0>"); \ + begin_scope(); \ + statement("template"); \ + statement("static T op(T value, uint)"); \ + begin_scope(); \ + statement("return value;"); \ + end_scope(); \ + end_scope_decl(); \ + statement(""); \ + statement("template"); \ + statement("struct spvClustered" #spv "Detail<1, offset>"); \ + begin_scope(); \ + statement("template"); \ + statement("static T op(T value, uint lid)"); \ + begin_scope(); \ + statement("// If the target lane is inactive, then return identity."); \ + if (msl_options.use_quadgroup_operation()) \ + statement("if (!extract_bits((quad_vote::vote_t)quad_active_threads_mask(), (lid ^ offset), 1))"); \ + else \ + statement("if (!extract_bits(as_type((simd_vote::vote_t)simd_active_threads_mask())[(lid ^ offset) / 32], (lid ^ offset) % 32, 1))"); \ + statement(" return " #ident ";"); \ + if (msl_options.use_quadgroup_operation()) \ + statement("return quad_shuffle_xor(value, offset);"); \ + else \ + statement("return simd_shuffle_xor(value, offset);"); \ + end_scope(); \ + end_scope_decl(); \ + statement(""); \ + statement("template<>"); \ + statement("struct spvClustered" #spv "Detail<4, 0>"); \ + begin_scope(); \ + statement("template"); \ + statement("static T op(T value, uint)"); \ + begin_scope(); \ + statement("return quad_" #msl "(value);"); \ + end_scope(); \ + end_scope_decl(); \ + statement(""); \ + statement("template"); \ + statement("struct spvClustered" #spv "Detail<4, offset>"); \ + begin_scope(); \ + statement("template"); \ + statement("static T op(T value, uint lid)"); \ + begin_scope(); \ + statement("// Here, we care if any of the lanes in the quad are active."); \ + statement("uint quad_mask = extract_bits(as_type((simd_vote::vote_t)simd_active_threads_mask())[(lid ^ offset) / 32], ((lid ^ offset) % 32) & ~3, 4);"); \ + statement("if (!quad_mask)"); \ + statement(" return " #ident ";"); \ + statement("// But we need to make sure we shuffle from an active lane."); \ + if (msl_options.use_quadgroup_operation()) \ + SPIRV_CROSS_THROW("Subgroup size with quadgroup operation cannot exceed 4."); \ + else \ + statement("return simd_shuffle(quad_" #msl "(value), ((lid ^ offset) & ~3) | ctz(quad_mask));"); \ + end_scope(); \ + end_scope_decl(); \ + statement(""); \ + statement("// General case"); \ + statement("template"); \ + statement("struct spvClustered" #spv "Detail"); \ + begin_scope(); \ + statement("template"); \ + statement("static T op(T value, uint lid)"); \ + begin_scope(); \ + statement("return " combine(msl, op, "spvClustered" #spv "Detail::op(value, lid)", "spvClustered" #spv "Detail::op(value, lid)") ";"); \ + end_scope(); \ + end_scope_decl(); \ + statement(""); \ + statement("template"); \ + statement("T spvClustered_" #msl "(T value, uint lid)"); \ + begin_scope(); \ + statement("return spvClustered" #spv "Detail::op(value, lid);"); \ + end_scope(); \ + statement(""); \ + break +#define BINOP(msl, op, l, r) l " " #op " " r +#define BINFUNC(msl, op, l, r) #msl "(" l ", " r ")" + + FUNC_SUBGROUP_CLUSTERED(Add, sum, BINOP, +, 0); + FUNC_SUBGROUP_CLUSTERED(Mul, product, BINOP, *, 1); + FUNC_SUBGROUP_CLUSTERED(Min, min, BINFUNC, , numeric_limits::max()); + FUNC_SUBGROUP_CLUSTERED(Max, max, BINFUNC, , numeric_limits::min()); + FUNC_SUBGROUP_CLUSTERED(And, and, BINOP, &, ~T(0)); + FUNC_SUBGROUP_CLUSTERED(Or, or, BINOP, |, 0); + FUNC_SUBGROUP_CLUSTERED(Xor, xor, BINOP, ^, 0); + // clang-format on +#undef FUNC_SUBGROUP_CLUSTERED +#undef BINOP +#undef BINFUNC + + case SPVFuncImplQuadBroadcast: + statement("template"); + statement("inline T spvQuadBroadcast(T value, uint lane)"); + begin_scope(); + statement("return quad_broadcast(value, lane);"); + end_scope(); + statement(""); + statement("template<>"); + statement("inline bool spvQuadBroadcast(bool value, uint lane)"); + begin_scope(); + statement("return !!quad_broadcast((ushort)value, lane);"); + end_scope(); + statement(""); + statement("template"); + statement("inline vec spvQuadBroadcast(vec value, uint lane)"); + begin_scope(); + statement("return (vec)quad_broadcast((vec)value, lane);"); + end_scope(); + statement(""); + break; + + case SPVFuncImplQuadSwap: + // We can implement this easily based on the following table giving + // the target lane ID from the direction and current lane ID: + // Direction + // | 0 | 1 | 2 | + // ---+---+---+---+ + // L 0 | 1 2 3 + // a 1 | 0 3 2 + // n 2 | 3 0 1 + // e 3 | 2 1 0 + // Notice that target = source ^ (direction + 1). + statement("template"); + statement("inline T spvQuadSwap(T value, uint dir)"); + begin_scope(); + statement("return quad_shuffle_xor(value, dir + 1);"); + end_scope(); + statement(""); + statement("template<>"); + statement("inline bool spvQuadSwap(bool value, uint dir)"); + begin_scope(); + statement("return !!quad_shuffle_xor((ushort)value, dir + 1);"); + end_scope(); + statement(""); + statement("template"); + statement("inline vec spvQuadSwap(vec value, uint dir)"); + begin_scope(); + statement("return (vec)quad_shuffle_xor((vec)value, dir + 1);"); + end_scope(); + statement(""); + break; + + case SPVFuncImplReflectScalar: + // Metal does not support scalar versions of these functions. + // Ensure fast-math is disabled to match Vulkan results. + statement("template"); + statement("[[clang::optnone]] T spvReflect(T i, T n)"); + begin_scope(); + statement("return i - T(2) * i * n * n;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplRefractScalar: + // Metal does not support scalar versions of these functions. + statement("template"); + statement("inline T spvRefract(T i, T n, T eta)"); + begin_scope(); + statement("T NoI = n * i;"); + statement("T NoI2 = NoI * NoI;"); + statement("T k = T(1) - eta * eta * (T(1) - NoI2);"); + statement("if (k < T(0))"); + begin_scope(); + statement("return T(0);"); + end_scope(); + statement("else"); + begin_scope(); + statement("return eta * i - (eta * NoI + sqrt(k)) * n;"); + end_scope(); + end_scope(); + statement(""); + break; + + case SPVFuncImplFaceForwardScalar: + // Metal does not support scalar versions of these functions. + statement("template"); + statement("inline T spvFaceForward(T n, T i, T nref)"); + begin_scope(); + statement("return i * nref < T(0) ? n : -n;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplChromaReconstructNearest2Plane: + statement("template"); + statement("inline vec spvChromaReconstructNearest(texture2d plane0, texture2d plane1, sampler " + "samp, float2 coord, LodOptions... options)"); + begin_scope(); + statement("vec ycbcr = vec(0, 0, 0, 1);"); + statement("ycbcr.g = plane0.sample(samp, coord, options...).r;"); + statement("ycbcr.br = plane1.sample(samp, coord, options...).rg;"); + statement("return ycbcr;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplChromaReconstructNearest3Plane: + statement("template"); + statement("inline vec spvChromaReconstructNearest(texture2d plane0, texture2d plane1, " + "texture2d plane2, sampler samp, float2 coord, LodOptions... options)"); + begin_scope(); + statement("vec ycbcr = vec(0, 0, 0, 1);"); + statement("ycbcr.g = plane0.sample(samp, coord, options...).r;"); + statement("ycbcr.b = plane1.sample(samp, coord, options...).r;"); + statement("ycbcr.r = plane2.sample(samp, coord, options...).r;"); + statement("return ycbcr;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplChromaReconstructLinear422CositedEven2Plane: + statement("template"); + statement("inline vec spvChromaReconstructLinear422CositedEven(texture2d plane0, texture2d " + "plane1, sampler samp, float2 coord, LodOptions... options)"); + begin_scope(); + statement("vec ycbcr = vec(0, 0, 0, 1);"); + statement("ycbcr.g = plane0.sample(samp, coord, options...).r;"); + statement("if (fract(coord.x * plane1.get_width()) != 0.0)"); + begin_scope(); + statement("ycbcr.br = vec(mix(plane1.sample(samp, coord, options...), " + "plane1.sample(samp, coord, options..., int2(1, 0)), 0.5).rg);"); + end_scope(); + statement("else"); + begin_scope(); + statement("ycbcr.br = plane1.sample(samp, coord, options...).rg;"); + end_scope(); + statement("return ycbcr;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplChromaReconstructLinear422CositedEven3Plane: + statement("template"); + statement("inline vec spvChromaReconstructLinear422CositedEven(texture2d plane0, texture2d " + "plane1, texture2d plane2, sampler samp, float2 coord, LodOptions... options)"); + begin_scope(); + statement("vec ycbcr = vec(0, 0, 0, 1);"); + statement("ycbcr.g = plane0.sample(samp, coord, options...).r;"); + statement("if (fract(coord.x * plane1.get_width()) != 0.0)"); + begin_scope(); + statement("ycbcr.b = T(mix(plane1.sample(samp, coord, options...), " + "plane1.sample(samp, coord, options..., int2(1, 0)), 0.5).r);"); + statement("ycbcr.r = T(mix(plane2.sample(samp, coord, options...), " + "plane2.sample(samp, coord, options..., int2(1, 0)), 0.5).r);"); + end_scope(); + statement("else"); + begin_scope(); + statement("ycbcr.b = plane1.sample(samp, coord, options...).r;"); + statement("ycbcr.r = plane2.sample(samp, coord, options...).r;"); + end_scope(); + statement("return ycbcr;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplChromaReconstructLinear422Midpoint2Plane: + statement("template"); + statement("inline vec spvChromaReconstructLinear422Midpoint(texture2d plane0, texture2d " + "plane1, sampler samp, float2 coord, LodOptions... options)"); + begin_scope(); + statement("vec ycbcr = vec(0, 0, 0, 1);"); + statement("ycbcr.g = plane0.sample(samp, coord, options...).r;"); + statement("int2 offs = int2(fract(coord.x * plane1.get_width()) != 0.0 ? 1 : -1, 0);"); + statement("ycbcr.br = vec(mix(plane1.sample(samp, coord, options...), " + "plane1.sample(samp, coord, options..., offs), 0.25).rg);"); + statement("return ycbcr;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplChromaReconstructLinear422Midpoint3Plane: + statement("template"); + statement("inline vec spvChromaReconstructLinear422Midpoint(texture2d plane0, texture2d " + "plane1, texture2d plane2, sampler samp, float2 coord, LodOptions... options)"); + begin_scope(); + statement("vec ycbcr = vec(0, 0, 0, 1);"); + statement("ycbcr.g = plane0.sample(samp, coord, options...).r;"); + statement("int2 offs = int2(fract(coord.x * plane1.get_width()) != 0.0 ? 1 : -1, 0);"); + statement("ycbcr.b = T(mix(plane1.sample(samp, coord, options...), " + "plane1.sample(samp, coord, options..., offs), 0.25).r);"); + statement("ycbcr.r = T(mix(plane2.sample(samp, coord, options...), " + "plane2.sample(samp, coord, options..., offs), 0.25).r);"); + statement("return ycbcr;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplChromaReconstructLinear420XCositedEvenYCositedEven2Plane: + statement("template"); + statement("inline vec spvChromaReconstructLinear420XCositedEvenYCositedEven(texture2d plane0, " + "texture2d plane1, sampler samp, float2 coord, LodOptions... options)"); + begin_scope(); + statement("vec ycbcr = vec(0, 0, 0, 1);"); + statement("ycbcr.g = plane0.sample(samp, coord, options...).r;"); + statement("float2 ab = fract(round(coord * float2(plane0.get_width(), plane0.get_height())) * 0.5);"); + statement("ycbcr.br = vec(mix(mix(plane1.sample(samp, coord, options...), " + "plane1.sample(samp, coord, options..., int2(1, 0)), ab.x), " + "mix(plane1.sample(samp, coord, options..., int2(0, 1)), " + "plane1.sample(samp, coord, options..., int2(1, 1)), ab.x), ab.y).rg);"); + statement("return ycbcr;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplChromaReconstructLinear420XCositedEvenYCositedEven3Plane: + statement("template"); + statement("inline vec spvChromaReconstructLinear420XCositedEvenYCositedEven(texture2d plane0, " + "texture2d plane1, texture2d plane2, sampler samp, float2 coord, LodOptions... options)"); + begin_scope(); + statement("vec ycbcr = vec(0, 0, 0, 1);"); + statement("ycbcr.g = plane0.sample(samp, coord, options...).r;"); + statement("float2 ab = fract(round(coord * float2(plane0.get_width(), plane0.get_height())) * 0.5);"); + statement("ycbcr.b = T(mix(mix(plane1.sample(samp, coord, options...), " + "plane1.sample(samp, coord, options..., int2(1, 0)), ab.x), " + "mix(plane1.sample(samp, coord, options..., int2(0, 1)), " + "plane1.sample(samp, coord, options..., int2(1, 1)), ab.x), ab.y).r);"); + statement("ycbcr.r = T(mix(mix(plane2.sample(samp, coord, options...), " + "plane2.sample(samp, coord, options..., int2(1, 0)), ab.x), " + "mix(plane2.sample(samp, coord, options..., int2(0, 1)), " + "plane2.sample(samp, coord, options..., int2(1, 1)), ab.x), ab.y).r);"); + statement("return ycbcr;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplChromaReconstructLinear420XMidpointYCositedEven2Plane: + statement("template"); + statement("inline vec spvChromaReconstructLinear420XMidpointYCositedEven(texture2d plane0, " + "texture2d plane1, sampler samp, float2 coord, LodOptions... options)"); + begin_scope(); + statement("vec ycbcr = vec(0, 0, 0, 1);"); + statement("ycbcr.g = plane0.sample(samp, coord, options...).r;"); + statement("float2 ab = fract((round(coord * float2(plane0.get_width(), plane0.get_height())) - float2(0.5, " + "0)) * 0.5);"); + statement("ycbcr.br = vec(mix(mix(plane1.sample(samp, coord, options...), " + "plane1.sample(samp, coord, options..., int2(1, 0)), ab.x), " + "mix(plane1.sample(samp, coord, options..., int2(0, 1)), " + "plane1.sample(samp, coord, options..., int2(1, 1)), ab.x), ab.y).rg);"); + statement("return ycbcr;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplChromaReconstructLinear420XMidpointYCositedEven3Plane: + statement("template"); + statement("inline vec spvChromaReconstructLinear420XMidpointYCositedEven(texture2d plane0, " + "texture2d plane1, texture2d plane2, sampler samp, float2 coord, LodOptions... options)"); + begin_scope(); + statement("vec ycbcr = vec(0, 0, 0, 1);"); + statement("ycbcr.g = plane0.sample(samp, coord, options...).r;"); + statement("float2 ab = fract((round(coord * float2(plane0.get_width(), plane0.get_height())) - float2(0.5, " + "0)) * 0.5);"); + statement("ycbcr.b = T(mix(mix(plane1.sample(samp, coord, options...), " + "plane1.sample(samp, coord, options..., int2(1, 0)), ab.x), " + "mix(plane1.sample(samp, coord, options..., int2(0, 1)), " + "plane1.sample(samp, coord, options..., int2(1, 1)), ab.x), ab.y).r);"); + statement("ycbcr.r = T(mix(mix(plane2.sample(samp, coord, options...), " + "plane2.sample(samp, coord, options..., int2(1, 0)), ab.x), " + "mix(plane2.sample(samp, coord, options..., int2(0, 1)), " + "plane2.sample(samp, coord, options..., int2(1, 1)), ab.x), ab.y).r);"); + statement("return ycbcr;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplChromaReconstructLinear420XCositedEvenYMidpoint2Plane: + statement("template"); + statement("inline vec spvChromaReconstructLinear420XCositedEvenYMidpoint(texture2d plane0, " + "texture2d plane1, sampler samp, float2 coord, LodOptions... options)"); + begin_scope(); + statement("vec ycbcr = vec(0, 0, 0, 1);"); + statement("ycbcr.g = plane0.sample(samp, coord, options...).r;"); + statement("float2 ab = fract((round(coord * float2(plane0.get_width(), plane0.get_height())) - float2(0, " + "0.5)) * 0.5);"); + statement("ycbcr.br = vec(mix(mix(plane1.sample(samp, coord, options...), " + "plane1.sample(samp, coord, options..., int2(1, 0)), ab.x), " + "mix(plane1.sample(samp, coord, options..., int2(0, 1)), " + "plane1.sample(samp, coord, options..., int2(1, 1)), ab.x), ab.y).rg);"); + statement("return ycbcr;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplChromaReconstructLinear420XCositedEvenYMidpoint3Plane: + statement("template"); + statement("inline vec spvChromaReconstructLinear420XCositedEvenYMidpoint(texture2d plane0, " + "texture2d plane1, texture2d plane2, sampler samp, float2 coord, LodOptions... options)"); + begin_scope(); + statement("vec ycbcr = vec(0, 0, 0, 1);"); + statement("ycbcr.g = plane0.sample(samp, coord, options...).r;"); + statement("float2 ab = fract((round(coord * float2(plane0.get_width(), plane0.get_height())) - float2(0, " + "0.5)) * 0.5);"); + statement("ycbcr.b = T(mix(mix(plane1.sample(samp, coord, options...), " + "plane1.sample(samp, coord, options..., int2(1, 0)), ab.x), " + "mix(plane1.sample(samp, coord, options..., int2(0, 1)), " + "plane1.sample(samp, coord, options..., int2(1, 1)), ab.x), ab.y).r);"); + statement("ycbcr.r = T(mix(mix(plane2.sample(samp, coord, options...), " + "plane2.sample(samp, coord, options..., int2(1, 0)), ab.x), " + "mix(plane2.sample(samp, coord, options..., int2(0, 1)), " + "plane2.sample(samp, coord, options..., int2(1, 1)), ab.x), ab.y).r);"); + statement("return ycbcr;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplChromaReconstructLinear420XMidpointYMidpoint2Plane: + statement("template"); + statement("inline vec spvChromaReconstructLinear420XMidpointYMidpoint(texture2d plane0, " + "texture2d plane1, sampler samp, float2 coord, LodOptions... options)"); + begin_scope(); + statement("vec ycbcr = vec(0, 0, 0, 1);"); + statement("ycbcr.g = plane0.sample(samp, coord, options...).r;"); + statement("float2 ab = fract((round(coord * float2(plane0.get_width(), plane0.get_height())) - float2(0.5, " + "0.5)) * 0.5);"); + statement("ycbcr.br = vec(mix(mix(plane1.sample(samp, coord, options...), " + "plane1.sample(samp, coord, options..., int2(1, 0)), ab.x), " + "mix(plane1.sample(samp, coord, options..., int2(0, 1)), " + "plane1.sample(samp, coord, options..., int2(1, 1)), ab.x), ab.y).rg);"); + statement("return ycbcr;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplChromaReconstructLinear420XMidpointYMidpoint3Plane: + statement("template"); + statement("inline vec spvChromaReconstructLinear420XMidpointYMidpoint(texture2d plane0, " + "texture2d plane1, texture2d plane2, sampler samp, float2 coord, LodOptions... options)"); + begin_scope(); + statement("vec ycbcr = vec(0, 0, 0, 1);"); + statement("ycbcr.g = plane0.sample(samp, coord, options...).r;"); + statement("float2 ab = fract((round(coord * float2(plane0.get_width(), plane0.get_height())) - float2(0.5, " + "0.5)) * 0.5);"); + statement("ycbcr.b = T(mix(mix(plane1.sample(samp, coord, options...), " + "plane1.sample(samp, coord, options..., int2(1, 0)), ab.x), " + "mix(plane1.sample(samp, coord, options..., int2(0, 1)), " + "plane1.sample(samp, coord, options..., int2(1, 1)), ab.x), ab.y).r);"); + statement("ycbcr.r = T(mix(mix(plane2.sample(samp, coord, options...), " + "plane2.sample(samp, coord, options..., int2(1, 0)), ab.x), " + "mix(plane2.sample(samp, coord, options..., int2(0, 1)), " + "plane2.sample(samp, coord, options..., int2(1, 1)), ab.x), ab.y).r);"); + statement("return ycbcr;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplExpandITUFullRange: + statement("template"); + statement("inline vec spvExpandITUFullRange(vec ycbcr, int n)"); + begin_scope(); + statement("ycbcr.br -= exp2(T(n-1))/(exp2(T(n))-1);"); + statement("return ycbcr;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplExpandITUNarrowRange: + statement("template"); + statement("inline vec spvExpandITUNarrowRange(vec ycbcr, int n)"); + begin_scope(); + statement("ycbcr.g = (ycbcr.g * (exp2(T(n)) - 1) - ldexp(T(16), n - 8))/ldexp(T(219), n - 8);"); + statement("ycbcr.br = (ycbcr.br * (exp2(T(n)) - 1) - ldexp(T(128), n - 8))/ldexp(T(224), n - 8);"); + statement("return ycbcr;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplConvertYCbCrBT709: + statement("// cf. Khronos Data Format Specification, section 15.1.1"); + statement("constant float3x3 spvBT709Factors = {{1, 1, 1}, {0, -0.13397432/0.7152, 1.8556}, {1.5748, " + "-0.33480248/0.7152, 0}};"); + statement(""); + statement("template"); + statement("inline vec spvConvertYCbCrBT709(vec ycbcr)"); + begin_scope(); + statement("vec rgba;"); + statement("rgba.rgb = vec(spvBT709Factors * ycbcr.gbr);"); + statement("rgba.a = ycbcr.a;"); + statement("return rgba;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplConvertYCbCrBT601: + statement("// cf. Khronos Data Format Specification, section 15.1.2"); + statement("constant float3x3 spvBT601Factors = {{1, 1, 1}, {0, -0.202008/0.587, 1.772}, {1.402, " + "-0.419198/0.587, 0}};"); + statement(""); + statement("template"); + statement("inline vec spvConvertYCbCrBT601(vec ycbcr)"); + begin_scope(); + statement("vec rgba;"); + statement("rgba.rgb = vec(spvBT601Factors * ycbcr.gbr);"); + statement("rgba.a = ycbcr.a;"); + statement("return rgba;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplConvertYCbCrBT2020: + statement("// cf. Khronos Data Format Specification, section 15.1.3"); + statement("constant float3x3 spvBT2020Factors = {{1, 1, 1}, {0, -0.11156702/0.6780, 1.8814}, {1.4746, " + "-0.38737742/0.6780, 0}};"); + statement(""); + statement("template"); + statement("inline vec spvConvertYCbCrBT2020(vec ycbcr)"); + begin_scope(); + statement("vec rgba;"); + statement("rgba.rgb = vec(spvBT2020Factors * ycbcr.gbr);"); + statement("rgba.a = ycbcr.a;"); + statement("return rgba;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplDynamicImageSampler: + statement("enum class spvFormatResolution"); + begin_scope(); + statement("_444 = 0,"); + statement("_422,"); + statement("_420"); + end_scope_decl(); + statement(""); + statement("enum class spvChromaFilter"); + begin_scope(); + statement("nearest = 0,"); + statement("linear"); + end_scope_decl(); + statement(""); + statement("enum class spvXChromaLocation"); + begin_scope(); + statement("cosited_even = 0,"); + statement("midpoint"); + end_scope_decl(); + statement(""); + statement("enum class spvYChromaLocation"); + begin_scope(); + statement("cosited_even = 0,"); + statement("midpoint"); + end_scope_decl(); + statement(""); + statement("enum class spvYCbCrModelConversion"); + begin_scope(); + statement("rgb_identity = 0,"); + statement("ycbcr_identity,"); + statement("ycbcr_bt_709,"); + statement("ycbcr_bt_601,"); + statement("ycbcr_bt_2020"); + end_scope_decl(); + statement(""); + statement("enum class spvYCbCrRange"); + begin_scope(); + statement("itu_full = 0,"); + statement("itu_narrow"); + end_scope_decl(); + statement(""); + statement("struct spvComponentBits"); + begin_scope(); + statement("constexpr explicit spvComponentBits(int v) thread : value(v) {}"); + statement("uchar value : 6;"); + end_scope_decl(); + statement("// A class corresponding to metal::sampler which holds sampler"); + statement("// Y'CbCr conversion info."); + statement("struct spvYCbCrSampler"); + begin_scope(); + statement("constexpr spvYCbCrSampler() thread : val(build()) {}"); + statement("template"); + statement("constexpr spvYCbCrSampler(Ts... t) thread : val(build(t...)) {}"); + statement("constexpr spvYCbCrSampler(const thread spvYCbCrSampler& s) thread = default;"); + statement(""); + statement("spvFormatResolution get_resolution() const thread"); + begin_scope(); + statement("return spvFormatResolution((val & resolution_mask) >> resolution_base);"); + end_scope(); + statement("spvChromaFilter get_chroma_filter() const thread"); + begin_scope(); + statement("return spvChromaFilter((val & chroma_filter_mask) >> chroma_filter_base);"); + end_scope(); + statement("spvXChromaLocation get_x_chroma_offset() const thread"); + begin_scope(); + statement("return spvXChromaLocation((val & x_chroma_off_mask) >> x_chroma_off_base);"); + end_scope(); + statement("spvYChromaLocation get_y_chroma_offset() const thread"); + begin_scope(); + statement("return spvYChromaLocation((val & y_chroma_off_mask) >> y_chroma_off_base);"); + end_scope(); + statement("spvYCbCrModelConversion get_ycbcr_model() const thread"); + begin_scope(); + statement("return spvYCbCrModelConversion((val & ycbcr_model_mask) >> ycbcr_model_base);"); + end_scope(); + statement("spvYCbCrRange get_ycbcr_range() const thread"); + begin_scope(); + statement("return spvYCbCrRange((val & ycbcr_range_mask) >> ycbcr_range_base);"); + end_scope(); + statement("int get_bpc() const thread { return (val & bpc_mask) >> bpc_base; }"); + statement(""); + statement("private:"); + statement("ushort val;"); + statement(""); + statement("constexpr static constant ushort resolution_bits = 2;"); + statement("constexpr static constant ushort chroma_filter_bits = 2;"); + statement("constexpr static constant ushort x_chroma_off_bit = 1;"); + statement("constexpr static constant ushort y_chroma_off_bit = 1;"); + statement("constexpr static constant ushort ycbcr_model_bits = 3;"); + statement("constexpr static constant ushort ycbcr_range_bit = 1;"); + statement("constexpr static constant ushort bpc_bits = 6;"); + statement(""); + statement("constexpr static constant ushort resolution_base = 0;"); + statement("constexpr static constant ushort chroma_filter_base = 2;"); + statement("constexpr static constant ushort x_chroma_off_base = 4;"); + statement("constexpr static constant ushort y_chroma_off_base = 5;"); + statement("constexpr static constant ushort ycbcr_model_base = 6;"); + statement("constexpr static constant ushort ycbcr_range_base = 9;"); + statement("constexpr static constant ushort bpc_base = 10;"); + statement(""); + statement( + "constexpr static constant ushort resolution_mask = ((1 << resolution_bits) - 1) << resolution_base;"); + statement("constexpr static constant ushort chroma_filter_mask = ((1 << chroma_filter_bits) - 1) << " + "chroma_filter_base;"); + statement("constexpr static constant ushort x_chroma_off_mask = ((1 << x_chroma_off_bit) - 1) << " + "x_chroma_off_base;"); + statement("constexpr static constant ushort y_chroma_off_mask = ((1 << y_chroma_off_bit) - 1) << " + "y_chroma_off_base;"); + statement("constexpr static constant ushort ycbcr_model_mask = ((1 << ycbcr_model_bits) - 1) << " + "ycbcr_model_base;"); + statement("constexpr static constant ushort ycbcr_range_mask = ((1 << ycbcr_range_bit) - 1) << " + "ycbcr_range_base;"); + statement("constexpr static constant ushort bpc_mask = ((1 << bpc_bits) - 1) << bpc_base;"); + statement(""); + statement("static constexpr ushort build()"); + begin_scope(); + statement("return 0;"); + end_scope(); + statement(""); + statement("template"); + statement("static constexpr ushort build(spvFormatResolution res, Ts... t)"); + begin_scope(); + statement("return (ushort(res) << resolution_base) | (build(t...) & ~resolution_mask);"); + end_scope(); + statement(""); + statement("template"); + statement("static constexpr ushort build(spvChromaFilter filt, Ts... t)"); + begin_scope(); + statement("return (ushort(filt) << chroma_filter_base) | (build(t...) & ~chroma_filter_mask);"); + end_scope(); + statement(""); + statement("template"); + statement("static constexpr ushort build(spvXChromaLocation loc, Ts... t)"); + begin_scope(); + statement("return (ushort(loc) << x_chroma_off_base) | (build(t...) & ~x_chroma_off_mask);"); + end_scope(); + statement(""); + statement("template"); + statement("static constexpr ushort build(spvYChromaLocation loc, Ts... t)"); + begin_scope(); + statement("return (ushort(loc) << y_chroma_off_base) | (build(t...) & ~y_chroma_off_mask);"); + end_scope(); + statement(""); + statement("template"); + statement("static constexpr ushort build(spvYCbCrModelConversion model, Ts... t)"); + begin_scope(); + statement("return (ushort(model) << ycbcr_model_base) | (build(t...) & ~ycbcr_model_mask);"); + end_scope(); + statement(""); + statement("template"); + statement("static constexpr ushort build(spvYCbCrRange range, Ts... t)"); + begin_scope(); + statement("return (ushort(range) << ycbcr_range_base) | (build(t...) & ~ycbcr_range_mask);"); + end_scope(); + statement(""); + statement("template"); + statement("static constexpr ushort build(spvComponentBits bpc, Ts... t)"); + begin_scope(); + statement("return (ushort(bpc.value) << bpc_base) | (build(t...) & ~bpc_mask);"); + end_scope(); + end_scope_decl(); + statement(""); + statement("// A class which can hold up to three textures and a sampler, including"); + statement("// Y'CbCr conversion info, used to pass combined image-samplers"); + statement("// dynamically to functions."); + statement("template"); + statement("struct spvDynamicImageSampler"); + begin_scope(); + statement("texture2d plane0;"); + statement("texture2d plane1;"); + statement("texture2d plane2;"); + statement("sampler samp;"); + statement("spvYCbCrSampler ycbcr_samp;"); + statement("uint swizzle = 0;"); + statement(""); + if (msl_options.swizzle_texture_samples) + { + statement("constexpr spvDynamicImageSampler(texture2d tex, sampler samp, uint sw) thread :"); + statement(" plane0(tex), samp(samp), swizzle(sw) {}"); + } + else + { + statement("constexpr spvDynamicImageSampler(texture2d tex, sampler samp) thread :"); + statement(" plane0(tex), samp(samp) {}"); + } + statement("constexpr spvDynamicImageSampler(texture2d tex, sampler samp, spvYCbCrSampler ycbcr_samp, " + "uint sw) thread :"); + statement(" plane0(tex), samp(samp), ycbcr_samp(ycbcr_samp), swizzle(sw) {}"); + statement("constexpr spvDynamicImageSampler(texture2d plane0, texture2d plane1,"); + statement(" sampler samp, spvYCbCrSampler ycbcr_samp, uint sw) thread :"); + statement(" plane0(plane0), plane1(plane1), samp(samp), ycbcr_samp(ycbcr_samp), swizzle(sw) {}"); + statement( + "constexpr spvDynamicImageSampler(texture2d plane0, texture2d plane1, texture2d plane2,"); + statement(" sampler samp, spvYCbCrSampler ycbcr_samp, uint sw) thread :"); + statement(" plane0(plane0), plane1(plane1), plane2(plane2), samp(samp), ycbcr_samp(ycbcr_samp), " + "swizzle(sw) {}"); + statement(""); + // XXX This is really hard to follow... I've left comments to make it a bit easier. + statement("template"); + statement("vec do_sample(float2 coord, LodOptions... options) const thread"); + begin_scope(); + statement("if (!is_null_texture(plane1))"); + begin_scope(); + statement("if (ycbcr_samp.get_resolution() == spvFormatResolution::_444 ||"); + statement(" ycbcr_samp.get_chroma_filter() == spvChromaFilter::nearest)"); + begin_scope(); + statement("if (!is_null_texture(plane2))"); + statement(" return spvChromaReconstructNearest(plane0, plane1, plane2, samp, coord, options...);"); + statement("return spvChromaReconstructNearest(plane0, plane1, samp, coord, options...);"); + end_scope(); // if (resolution == 422 || chroma_filter == nearest) + statement("switch (ycbcr_samp.get_resolution())"); + begin_scope(); + statement("case spvFormatResolution::_444: break;"); + statement("case spvFormatResolution::_422:"); + begin_scope(); + statement("switch (ycbcr_samp.get_x_chroma_offset())"); + begin_scope(); + statement("case spvXChromaLocation::cosited_even:"); + statement(" if (!is_null_texture(plane2))"); + statement(" return spvChromaReconstructLinear422CositedEven("); + statement(" plane0, plane1, plane2, samp,"); + statement(" coord, options...);"); + statement(" return spvChromaReconstructLinear422CositedEven("); + statement(" plane0, plane1, samp, coord,"); + statement(" options...);"); + statement("case spvXChromaLocation::midpoint:"); + statement(" if (!is_null_texture(plane2))"); + statement(" return spvChromaReconstructLinear422Midpoint("); + statement(" plane0, plane1, plane2, samp,"); + statement(" coord, options...);"); + statement(" return spvChromaReconstructLinear422Midpoint("); + statement(" plane0, plane1, samp, coord,"); + statement(" options...);"); + end_scope(); // switch (x_chroma_offset) + end_scope(); // case 422: + statement("case spvFormatResolution::_420:"); + begin_scope(); + statement("switch (ycbcr_samp.get_x_chroma_offset())"); + begin_scope(); + statement("case spvXChromaLocation::cosited_even:"); + begin_scope(); + statement("switch (ycbcr_samp.get_y_chroma_offset())"); + begin_scope(); + statement("case spvYChromaLocation::cosited_even:"); + statement(" if (!is_null_texture(plane2))"); + statement(" return spvChromaReconstructLinear420XCositedEvenYCositedEven("); + statement(" plane0, plane1, plane2, samp,"); + statement(" coord, options...);"); + statement(" return spvChromaReconstructLinear420XCositedEvenYCositedEven("); + statement(" plane0, plane1, samp, coord,"); + statement(" options...);"); + statement("case spvYChromaLocation::midpoint:"); + statement(" if (!is_null_texture(plane2))"); + statement(" return spvChromaReconstructLinear420XCositedEvenYMidpoint("); + statement(" plane0, plane1, plane2, samp,"); + statement(" coord, options...);"); + statement(" return spvChromaReconstructLinear420XCositedEvenYMidpoint("); + statement(" plane0, plane1, samp, coord,"); + statement(" options...);"); + end_scope(); // switch (y_chroma_offset) + end_scope(); // case x::cosited_even: + statement("case spvXChromaLocation::midpoint:"); + begin_scope(); + statement("switch (ycbcr_samp.get_y_chroma_offset())"); + begin_scope(); + statement("case spvYChromaLocation::cosited_even:"); + statement(" if (!is_null_texture(plane2))"); + statement(" return spvChromaReconstructLinear420XMidpointYCositedEven("); + statement(" plane0, plane1, plane2, samp,"); + statement(" coord, options...);"); + statement(" return spvChromaReconstructLinear420XMidpointYCositedEven("); + statement(" plane0, plane1, samp, coord,"); + statement(" options...);"); + statement("case spvYChromaLocation::midpoint:"); + statement(" if (!is_null_texture(plane2))"); + statement(" return spvChromaReconstructLinear420XMidpointYMidpoint("); + statement(" plane0, plane1, plane2, samp,"); + statement(" coord, options...);"); + statement(" return spvChromaReconstructLinear420XMidpointYMidpoint("); + statement(" plane0, plane1, samp, coord,"); + statement(" options...);"); + end_scope(); // switch (y_chroma_offset) + end_scope(); // case x::midpoint + end_scope(); // switch (x_chroma_offset) + end_scope(); // case 420: + end_scope(); // switch (resolution) + end_scope(); // if (multiplanar) + statement("return plane0.sample(samp, coord, options...);"); + end_scope(); // do_sample() + statement("template "); + statement("vec sample(float2 coord, LodOptions... options) const thread"); + begin_scope(); + statement("vec s = spvTextureSwizzle(do_sample(coord, options...), swizzle);"); + statement("if (ycbcr_samp.get_ycbcr_model() == spvYCbCrModelConversion::rgb_identity)"); + statement(" return s;"); + statement(""); + statement("switch (ycbcr_samp.get_ycbcr_range())"); + begin_scope(); + statement("case spvYCbCrRange::itu_full:"); + statement(" s = spvExpandITUFullRange(s, ycbcr_samp.get_bpc());"); + statement(" break;"); + statement("case spvYCbCrRange::itu_narrow:"); + statement(" s = spvExpandITUNarrowRange(s, ycbcr_samp.get_bpc());"); + statement(" break;"); + end_scope(); + statement(""); + statement("switch (ycbcr_samp.get_ycbcr_model())"); + begin_scope(); + statement("case spvYCbCrModelConversion::rgb_identity:"); // Silence Clang warning + statement("case spvYCbCrModelConversion::ycbcr_identity:"); + statement(" return s;"); + statement("case spvYCbCrModelConversion::ycbcr_bt_709:"); + statement(" return spvConvertYCbCrBT709(s);"); + statement("case spvYCbCrModelConversion::ycbcr_bt_601:"); + statement(" return spvConvertYCbCrBT601(s);"); + statement("case spvYCbCrModelConversion::ycbcr_bt_2020:"); + statement(" return spvConvertYCbCrBT2020(s);"); + end_scope(); + end_scope(); + statement(""); + // Sampler Y'CbCr conversion forbids offsets. + statement("vec sample(float2 coord, int2 offset) const thread"); + begin_scope(); + if (msl_options.swizzle_texture_samples) + statement("return spvTextureSwizzle(plane0.sample(samp, coord, offset), swizzle);"); + else + statement("return plane0.sample(samp, coord, offset);"); + end_scope(); + statement("template"); + statement("vec sample(float2 coord, lod_options options, int2 offset) const thread"); + begin_scope(); + if (msl_options.swizzle_texture_samples) + statement("return spvTextureSwizzle(plane0.sample(samp, coord, options, offset), swizzle);"); + else + statement("return plane0.sample(samp, coord, options, offset);"); + end_scope(); + statement("#if __HAVE_MIN_LOD_CLAMP__"); + statement("vec sample(float2 coord, bias b, min_lod_clamp min_lod, int2 offset) const thread"); + begin_scope(); + statement("return plane0.sample(samp, coord, b, min_lod, offset);"); + end_scope(); + statement( + "vec sample(float2 coord, gradient2d grad, min_lod_clamp min_lod, int2 offset) const thread"); + begin_scope(); + statement("return plane0.sample(samp, coord, grad, min_lod, offset);"); + end_scope(); + statement("#endif"); + statement(""); + // Y'CbCr conversion forbids all operations but sampling. + statement("vec read(uint2 coord, uint lod = 0) const thread"); + begin_scope(); + statement("return plane0.read(coord, lod);"); + end_scope(); + statement(""); + statement("vec gather(float2 coord, int2 offset = int2(0), component c = component::x) const thread"); + begin_scope(); + if (msl_options.swizzle_texture_samples) + statement("return spvGatherSwizzle(plane0, samp, swizzle, c, coord, offset);"); + else + statement("return plane0.gather(samp, coord, offset, c);"); + end_scope(); + end_scope_decl(); + statement(""); + break; + + case SPVFuncImplRayQueryIntersectionParams: + statement("intersection_params spvMakeIntersectionParams(uint flags)"); + begin_scope(); + statement("intersection_params ip;"); + statement("if ((flags & ", RayFlagsOpaqueKHRMask, ") != 0)"); + statement(" ip.force_opacity(forced_opacity::opaque);"); + statement("if ((flags & ", RayFlagsNoOpaqueKHRMask, ") != 0)"); + statement(" ip.force_opacity(forced_opacity::non_opaque);"); + statement("if ((flags & ", RayFlagsTerminateOnFirstHitKHRMask, ") != 0)"); + statement(" ip.accept_any_intersection(true);"); + // RayFlagsSkipClosestHitShaderKHRMask is not available in MSL + statement("if ((flags & ", RayFlagsCullBackFacingTrianglesKHRMask, ") != 0)"); + statement(" ip.set_triangle_cull_mode(triangle_cull_mode::back);"); + statement("if ((flags & ", RayFlagsCullFrontFacingTrianglesKHRMask, ") != 0)"); + statement(" ip.set_triangle_cull_mode(triangle_cull_mode::front);"); + statement("if ((flags & ", RayFlagsCullOpaqueKHRMask, ") != 0)"); + statement(" ip.set_opacity_cull_mode(opacity_cull_mode::opaque);"); + statement("if ((flags & ", RayFlagsCullNoOpaqueKHRMask, ") != 0)"); + statement(" ip.set_opacity_cull_mode(opacity_cull_mode::non_opaque);"); + statement("if ((flags & ", RayFlagsSkipTrianglesKHRMask, ") != 0)"); + statement(" ip.set_geometry_cull_mode(geometry_cull_mode::triangle);"); + statement("if ((flags & ", RayFlagsSkipAABBsKHRMask, ") != 0)"); + statement(" ip.set_geometry_cull_mode(geometry_cull_mode::bounding_box);"); + statement("return ip;"); + end_scope(); + statement(""); + break; + + case SPVFuncImplVariableDescriptor: + statement("template"); + statement("struct spvDescriptor"); + begin_scope(); + statement("T value;"); + end_scope_decl(); + statement(""); + break; + + case SPVFuncImplVariableSizedDescriptor: + statement("template"); + statement("struct spvBufferDescriptor;"); + statement(""); + statement("template"); + statement("struct spvBufferDescriptor"); + begin_scope(); + statement("device T* value;"); + statement("int length;"); + statement("int padding;"); + end_scope_decl(); + statement(""); + break; + + case SPVFuncImplVariableDescriptorArray: + if (spv_function_implementations.count(SPVFuncImplVariableDescriptor) != 0) + { + statement("template"); + statement("struct spvDescriptorArray"); + begin_scope(); + statement("spvDescriptorArray(const device spvDescriptor* ptr_) : ptr(&ptr_->value) {}"); + statement("spvDescriptorArray(const device void *ptr_) : spvDescriptorArray(static_cast*>(ptr_)) {}"); + statement("const device T& operator [] (size_t i) const { return ptr[i]; }"); + statement("const device T* ptr;"); + end_scope_decl(); + statement(""); + } + else + { + statement("template"); + statement("struct spvDescriptorArray;"); + statement(""); + } + + if (msl_options.runtime_array_rich_descriptor && + spv_function_implementations.count(SPVFuncImplVariableSizedDescriptor) != 0) + { + statement("template"); + statement("struct spvDescriptorArray"); + begin_scope(); + statement("spvDescriptorArray(const device spvBufferDescriptor* ptr_) : ptr(ptr_) {}"); + statement("spvDescriptorArray(const device void *ptr_) : spvDescriptorArray(static_cast*>(ptr_)) {}"); + statement("device T* operator [] (size_t i) const { return ptr[i].value; }"); + statement("int length(int i) const { return ptr[i].length; }"); + statement("const device spvBufferDescriptor* ptr;"); + end_scope_decl(); + statement(""); + } + break; + + case SPVFuncImplPaddedStd140: + // .data is used in access chain. + statement("template "); + statement("struct spvPaddedStd140 { alignas(16) T data; };"); + statement("template "); + statement("using spvPaddedStd140Matrix = spvPaddedStd140[n];"); + statement(""); + break; + + case SPVFuncImplReduceAdd: + // Metal doesn't support __builtin_reduce_add or simd_reduce_add, so we need this. + // Metal also doesn't support the other vector builtins, which would have been useful to make this a single template. + + statement("template "); + statement("T reduce_add(vec v) { return v.x + v.y; }"); + + statement("template "); + statement("T reduce_add(vec v) { return v.x + v.y + v.z; }"); + + statement("template "); + statement("T reduce_add(vec v) { return v.x + v.y + v.z + v.w; }"); + + statement(""); + break; + + case SPVFuncImplImageFence: + statement("template "); + statement("void spvImageFence(ImageT img) { img.fence(); }"); + statement(""); + break; + + case SPVFuncImplTextureCast: + statement("template "); + statement("T spvTextureCast(U img)"); + begin_scope(); + // MSL complains if you try to cast the texture itself, but casting the reference type is ... ok? *shrug* + // Gotta go what you gotta do I suppose. + statement("return reinterpret_cast(img);"); + end_scope(); + statement(""); + break; + + case SPVFuncImplMulExtended: + // Compiler may hit an internal error with mulhi, but doesn't when encapsulated for some reason. + statement("template"); + statement("[[clang::optnone]] T spvMulExtended(V l, V r)"); + begin_scope(); + statement("return T{U(l * r), U(mulhi(l, r))};"); + end_scope(); + statement(""); + break; + + case SPVFuncImplSetMeshOutputsEXT: + statement("void spvSetMeshOutputsEXT(uint gl_LocalInvocationIndex, threadgroup uint2& spvMeshSizes, uint vertexCount, uint primitiveCount)"); + begin_scope(); + statement("if (gl_LocalInvocationIndex == 0)"); + begin_scope(); + statement("spvMeshSizes.x = vertexCount;"); + statement("spvMeshSizes.y = primitiveCount;"); + end_scope(); + end_scope(); + statement(""); + break; + + case SPVFuncImplAssume: + statement_no_indent("#if defined(__has_builtin)"); + statement_no_indent("#if !defined(SPV_ASSUME) && __has_builtin(__builtin_assume)"); + statement_no_indent("#define SPV_ASSUME(x) __builtin_assume(x);"); + statement_no_indent("#endif"); + statement_no_indent("#if !defined(SPV_EXPECT) && __has_builtin(__builtin_expect)"); + statement_no_indent("#define SPV_EXPECT(x, y) __builtin_expect(x, y);"); + statement_no_indent("#endif"); + statement_no_indent("#endif"); + + statement_no_indent("#ifndef SPV_ASSUME"); + statement_no_indent("#define SPV_ASSUME(x)"); + statement_no_indent("#endif"); + + statement_no_indent("#ifndef SPV_EXPECT"); + statement_no_indent("#define SPV_EXPECT(x, y) x"); + statement_no_indent("#endif"); + + break; + + default: + break; + } + } +} + +static string inject_top_level_storage_qualifier(const string &expr, const string &qualifier) +{ + // Easier to do this through text munging since the qualifier does not exist in the type system at all, + // and plumbing in all that information is not very helpful. + size_t last_reference = expr.find_last_of('&'); + size_t last_pointer = expr.find_last_of('*'); + size_t last_significant = string::npos; + + if (last_reference == string::npos) + last_significant = last_pointer; + else if (last_pointer == string::npos) + last_significant = last_reference; + else + last_significant = max(last_reference, last_pointer); + + if (last_significant == string::npos) + return join(qualifier, " ", expr); + else + { + return join(expr.substr(0, last_significant + 1), " ", + qualifier, expr.substr(last_significant + 1, string::npos)); + } +} + +void CompilerMSL::declare_constant_arrays() +{ + bool fully_inlined = ir.ids_for_type[TypeFunction].size() == 1; + + // MSL cannot declare arrays inline (except when declaring a variable), so we must move them out to + // global constants directly, so we are able to use constants as variable expressions. + bool emitted = false; + + ir.for_each_typed_id([&](uint32_t, SPIRConstant &c) { + if (c.specialization) + return; + + auto &type = this->get(c.constant_type); + // Constant arrays of non-primitive types (i.e. matrices) won't link properly into Metal libraries. + // FIXME: However, hoisting constants to main() means we need to pass down constant arrays to leaf functions if they are used there. + // If there are multiple functions in the module, drop this case to avoid breaking use cases which do not need to + // link into Metal libraries. This is hacky. + if (is_array(type) && (!fully_inlined || is_scalar(type) || is_vector(type))) + { + add_resource_name(c.self); + auto name = to_name(c.self); + statement(inject_top_level_storage_qualifier(variable_decl(type, name), "constant"), + " = ", constant_expression(c), ";"); + emitted = true; + } + }); + + if (emitted) + statement(""); +} + +// Constant arrays of non-primitive types (i.e. matrices) won't link properly into Metal libraries +void CompilerMSL::declare_complex_constant_arrays() +{ + // If we do not have a fully inlined module, we did not opt in to + // declaring constant arrays of complex types. See CompilerMSL::declare_constant_arrays(). + bool fully_inlined = ir.ids_for_type[TypeFunction].size() == 1; + if (!fully_inlined) + return; + + // MSL cannot declare arrays inline (except when declaring a variable), so we must move them out to + // global constants directly, so we are able to use constants as variable expressions. + bool emitted = false; + + ir.for_each_typed_id([&](uint32_t, SPIRConstant &c) { + if (c.specialization) + return; + + auto &type = this->get(c.constant_type); + if (is_array(type) && !(is_scalar(type) || is_vector(type))) + { + add_resource_name(c.self); + auto name = to_name(c.self); + statement("", variable_decl(type, name), " = ", constant_expression(c), ";"); + emitted = true; + } + }); + + if (emitted) + statement(""); +} + +void CompilerMSL::emit_resources() +{ + declare_constant_arrays(); + + // Emit the special [[stage_in]] and [[stage_out]] interface blocks which we created. + emit_interface_block(stage_out_var_id); + emit_interface_block(patch_stage_out_var_id); + emit_interface_block(stage_in_var_id); + emit_interface_block(patch_stage_in_var_id); + + if (get_execution_model() == ExecutionModelMeshEXT) + { + auto &execution = get_entry_point(); + const char *topology = ""; + if (execution.flags.get(ExecutionModeOutputTrianglesEXT)) + topology = "topology::triangle"; + else if (execution.flags.get(ExecutionModeOutputLinesEXT)) + topology = "topology::line"; + else if (execution.flags.get(ExecutionModeOutputPoints)) + topology = "topology::point"; + + const char *per_vertex = mesh_out_per_vertex ? "spvPerVertex" : "float4"; + const char *per_primitive = mesh_out_per_primitive ? "spvPerPrimitive" : "void"; + statement("using spvMesh_t = mesh<", per_vertex, ", ", per_primitive, ", ", execution.output_vertices, ", ", + execution.output_primitives, ", ", topology, ">;"); + statement(""); + } +} + +// Emit declarations for the specialization Metal function constants +void CompilerMSL::emit_specialization_constants_and_structs() +{ + SpecializationConstant wg_x, wg_y, wg_z; + ID workgroup_size_id = get_work_group_size_specialization_constants(wg_x, wg_y, wg_z); + if (workgroup_size_id == 0 && is_mesh_shader()) + { + auto &execution = get_entry_point(); + statement("constant uint3 ", builtin_to_glsl(BuiltInWorkgroupSize, StorageClassWorkgroup), + " [[maybe_unused]] = ", "uint3(", execution.workgroup_size.x, ", ", execution.workgroup_size.y, ", ", + execution.workgroup_size.z, ");"); + statement(""); + } + + bool emitted = false; + unordered_set declared_structs; + unordered_set aligned_structs; + + // First, we need to deal with scalar block layout. + // It is possible that a struct may have to be placed at an alignment which does not match the innate alignment of the struct itself. + // In that case, if such a case exists for a struct, we must force that all elements of the struct become packed_ types. + // This makes the struct alignment as small as physically possible. + // When we actually align the struct later, we can insert padding as necessary to make the packed members behave like normally aligned types. + ir.for_each_typed_id([&](uint32_t type_id, const SPIRType &type) { + if (type.basetype == SPIRType::Struct && + has_extended_decoration(type_id, SPIRVCrossDecorationBufferBlockRepacked)) + mark_scalar_layout_structs(type); + }); + + bool builtin_block_type_is_required = is_mesh_shader(); + // Very special case. If gl_PerVertex is initialized as an array (tessellation) + // we have to potentially emit the gl_PerVertex struct type so that we can emit a constant LUT. + ir.for_each_typed_id([&](uint32_t, SPIRConstant &c) { + auto &type = this->get(c.constant_type); + if (is_array(type) && has_decoration(type.self, DecorationBlock) && is_builtin_type(type)) + builtin_block_type_is_required = true; + }); + + // Very particular use of the soft loop lock. + // align_struct may need to create custom types on the fly, but we don't care about + // these types for purpose of iterating over them in ir.ids_for_type and friends. + auto loop_lock = ir.create_loop_soft_lock(); + + // Physical storage buffer pointers can have cyclical references, + // so emit forward declarations of them before other structs. + // Ignore type_id because we want the underlying struct type from the pointer. + ir.for_each_typed_id([&](uint32_t /* type_id */, const SPIRType &type) { + if (type.basetype == SPIRType::Struct && + type.pointer && type.storage == StorageClassPhysicalStorageBuffer && + declared_structs.count(type.self) == 0) + { + statement("struct ", to_name(type.self), ";"); + declared_structs.insert(type.self); + emitted = true; + } + }); + if (emitted) + statement(""); + + emitted = false; + declared_structs.clear(); + + // It is possible to have multiple spec constants that use the same spec constant ID. + // The most common cause of this is defining spec constants in GLSL while also declaring + // the workgroup size to use those spec constants. But, Metal forbids declaring more than + // one variable with the same function constant ID. + // In this case, we must only declare one variable with the [[function_constant(id)]] + // attribute, and use its initializer to initialize all the spec constants with + // that ID. + std::unordered_map unique_func_constants; + + for (auto &id_ : ir.ids_for_constant_undef_or_type) + { + auto &id = ir.ids[id_]; + + if (id.get_type() == TypeConstant) + { + auto &c = id.get(); + + if (c.self == workgroup_size_id) + { + // TODO: This can be expressed as a [[threads_per_threadgroup]] input semantic, but we need to know + // the work group size at compile time in SPIR-V, and [[threads_per_threadgroup]] would need to be passed around as a global. + // The work group size may be a specialization constant. + statement("constant uint3 ", builtin_to_glsl(BuiltInWorkgroupSize, StorageClassWorkgroup), + " [[maybe_unused]] = ", constant_expression(get(workgroup_size_id)), ";"); + emitted = true; + } + else if (c.specialization) + { + auto &type = get(c.constant_type); + string sc_type_name = type_to_glsl(type); + add_resource_name(c.self); + string sc_name = to_name(c.self); + + // Function constants are only supported in MSL 1.2 and later. + // If we don't support it just declare the "default" directly. + // This "default" value can be overridden to the true specialization constant by the API user. + // Specialization constants which are used as array length expressions cannot be function constants in MSL, + // so just fall back to macros. + if (msl_options.supports_msl_version(1, 2) && has_decoration(c.self, DecorationSpecId) && + !c.is_used_as_array_length) + { + // Only scalar, non-composite values can be function constants. + uint32_t constant_id = get_decoration(c.self, DecorationSpecId); + if (!unique_func_constants.count(constant_id)) + unique_func_constants.insert(make_pair(constant_id, c.self)); + SPIRType::BaseType sc_tmp_type = expression_type(unique_func_constants[constant_id]).basetype; + string sc_tmp_name = to_name(unique_func_constants[constant_id]) + "_tmp"; + if (unique_func_constants[constant_id] == c.self) + statement("constant ", sc_type_name, " ", sc_tmp_name, " [[function_constant(", constant_id, + ")]];"); + // RenderDoc and other instrumentation may reuse the same SpecId with different base types. + // We deduplicate to one [[function_constant(id)]] temp and then initialize all variants from it. + // Metal forbids as_type to/from 'bool', so if either side is Boolean, avoid bitcasting here and + // prefer a value cast via a constructor instead (e.g. uint(tmp) / float(tmp) / bool(tmp)). + // This preserves expected toggle semantics and prevents illegal MSL like as_type(bool_tmp). + { + string sc_true_expr; + if (sc_tmp_type == type.basetype) + sc_true_expr = sc_tmp_name; + else if (sc_tmp_type == SPIRType::Boolean || type.basetype == SPIRType::Boolean) + sc_true_expr = join(sc_type_name, "(", sc_tmp_name, ")"); + else + sc_true_expr = bitcast_expression(type, sc_tmp_type, sc_tmp_name); + statement("constant ", sc_type_name, " ", sc_name, " = is_function_constant_defined(", sc_tmp_name, + ") ? ", sc_true_expr, " : ", constant_expression(c), ";"); + } + } + else if (has_decoration(c.self, DecorationSpecId)) + { + // Fallback to macro overrides. + uint32_t constant_id = get_decoration(c.self, DecorationSpecId); + c.specialization_constant_macro_name = + constant_value_macro_name(constant_id); + + statement("#ifndef ", c.specialization_constant_macro_name); + statement("#define ", c.specialization_constant_macro_name, " ", constant_expression(c)); + statement("#endif"); + statement("constant ", sc_type_name, " ", sc_name, " = ", c.specialization_constant_macro_name, + ";"); + + // Record the usage of macro + constant_macro_ids.insert(constant_id); + } + else + { + // Composite specialization constants must be built from other specialization constants. + statement("constant ", sc_type_name, " ", sc_name, " = ", constant_expression(c), ";"); + } + emitted = true; + } + } + else if (id.get_type() == TypeConstantOp) + { + auto &c = id.get(); + auto &type = get(c.basetype); + add_resource_name(c.self); + auto name = to_name(c.self); + statement("constant ", variable_decl(type, name), " = ", constant_op_expression(c), ";"); + emitted = true; + } + else if (id.get_type() == TypeType) + { + // Output non-builtin interface structs. These include local function structs + // and structs nested within uniform and read-write buffers. + auto &type = id.get(); + TypeID type_id = type.self; + + bool is_struct = (type.basetype == SPIRType::Struct) && type.array.empty() && !type.pointer; + bool is_block = + has_decoration(type.self, DecorationBlock) || has_decoration(type.self, DecorationBufferBlock); + + bool is_builtin_block = is_block && is_builtin_type(type); + bool is_declarable_struct = is_struct && (!is_builtin_block || builtin_block_type_is_required); + + // We'll declare this later. + if (stage_out_var_id && get_stage_out_struct_type().self == type_id) + is_declarable_struct = false; + if (patch_stage_out_var_id && get_patch_stage_out_struct_type().self == type_id) + is_declarable_struct = false; + if (stage_in_var_id && get_stage_in_struct_type().self == type_id) + is_declarable_struct = false; + if (patch_stage_in_var_id && get_patch_stage_in_struct_type().self == type_id) + is_declarable_struct = false; + + // Special case. Declare builtin struct anyways if we need to emit a threadgroup version of it. + if (stage_out_masked_builtin_type_id == type_id) + is_declarable_struct = true; + + // Align and emit declarable structs...but avoid declaring each more than once. + if (is_declarable_struct && declared_structs.count(type_id) == 0) + { + if (emitted) + statement(""); + emitted = false; + + declared_structs.insert(type_id); + + if (has_extended_decoration(type_id, SPIRVCrossDecorationBufferBlockRepacked)) + align_struct(type, aligned_structs); + + // Make sure we declare the underlying struct type, and not the "decorated" type with pointers, etc. + emit_struct(get(type_id)); + } + } + else if (id.get_type() == TypeUndef) + { + auto &undef = id.get(); + auto &type = get(undef.basetype); + // OpUndef can be void for some reason ... + if (type.basetype == SPIRType::Void) + return; + + // Undefined global memory is not allowed in MSL. + // Declare constant and init to zeros. Use {}, as global constructors can break Metal. + statement( + inject_top_level_storage_qualifier(variable_decl(type, to_name(undef.self), undef.self), "constant"), + " = {};"); + emitted = true; + } + } + + if (emitted) + statement(""); +} + +void CompilerMSL::emit_binary_ptr_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op) +{ + bool forward = should_forward(op0) && should_forward(op1); + emit_op(result_type, result_id, join(to_ptr_expression(op0), " ", op, " ", to_ptr_expression(op1)), forward); + inherit_expression_dependencies(result_id, op0); + inherit_expression_dependencies(result_id, op1); +} + +string CompilerMSL::to_ptr_expression(uint32_t id, bool register_expression_read) +{ + auto *e = maybe_get(id); + auto expr = enclose_expression(e && e->need_transpose ? e->expression : to_expression(id, register_expression_read)); + if (!should_dereference(id)) + expr = address_of_expression(expr); + return expr; +} + +void CompilerMSL::emit_binary_unord_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, + const char *op) +{ + bool forward = should_forward(op0) && should_forward(op1); + emit_op(result_type, result_id, + join("(isunordered(", to_enclosed_unpacked_expression(op0), ", ", to_enclosed_unpacked_expression(op1), + ") || ", to_enclosed_unpacked_expression(op0), " ", op, " ", to_enclosed_unpacked_expression(op1), + ")"), + forward); + + inherit_expression_dependencies(result_id, op0); + inherit_expression_dependencies(result_id, op1); +} + +bool CompilerMSL::emit_tessellation_io_load(uint32_t result_type_id, uint32_t id, uint32_t ptr) +{ + auto &ptr_type = expression_type(ptr); + auto &result_type = get(result_type_id); + if (ptr_type.storage != StorageClassInput && ptr_type.storage != StorageClassOutput) + return false; + if (ptr_type.storage == StorageClassOutput && is_tese_shader()) + return false; + + if (has_decoration(ptr, DecorationPatch)) + return false; + bool ptr_is_io_variable = ir.ids[ptr].get_type() == TypeVariable; + + bool flattened_io = variable_storage_requires_stage_io(ptr_type.storage); + + bool flat_data_type = flattened_io && + (is_matrix(result_type) || is_array(result_type) || result_type.basetype == SPIRType::Struct); + + // Edge case, even with multi-patch workgroups, we still need to unroll load + // if we're loading control points directly. + if (ptr_is_io_variable && is_array(result_type)) + flat_data_type = true; + + if (!flat_data_type) + return false; + + // Now, we must unflatten a composite type and take care of interleaving array access with gl_in/gl_out. + // Lots of painful code duplication since we *really* should not unroll these kinds of loads in entry point fixup + // unless we're forced to do this when the code is emitting inoptimal OpLoads. + string expr; + + uint32_t interface_index = get_extended_decoration(ptr, SPIRVCrossDecorationInterfaceMemberIndex); + auto *var = maybe_get_backing_variable(ptr); + auto &expr_type = get_pointee_type(ptr_type.self); + + const auto &iface_type = expression_type(stage_in_ptr_var_id); + + if (!flattened_io) + { + // Simplest case for multi-patch workgroups, just unroll array as-is. + if (interface_index == uint32_t(-1)) + return false; + + expr += type_to_glsl(result_type) + "({ "; + uint32_t num_control_points = to_array_size_literal(result_type, uint32_t(result_type.array.size()) - 1); + + for (uint32_t i = 0; i < num_control_points; i++) + { + const uint32_t indices[2] = { i, interface_index }; + AccessChainMeta meta; + expr += access_chain_internal(stage_in_ptr_var_id, indices, 2, + ACCESS_CHAIN_INDEX_IS_LITERAL_BIT | ACCESS_CHAIN_PTR_CHAIN_BIT, &meta); + if (i + 1 < num_control_points) + expr += ", "; + } + expr += " })"; + } + else if (result_type.array.size() > 2) + { + SPIRV_CROSS_THROW("Cannot load tessellation IO variables with more than 2 dimensions."); + } + else if (result_type.array.size() == 2) + { + if (!ptr_is_io_variable) + SPIRV_CROSS_THROW("Loading an array-of-array must be loaded directly from an IO variable."); + if (interface_index == uint32_t(-1)) + SPIRV_CROSS_THROW("Interface index is unknown. Cannot continue."); + if (result_type.basetype == SPIRType::Struct || is_matrix(result_type)) + SPIRV_CROSS_THROW("Cannot load array-of-array of composite type in tessellation IO."); + + expr += type_to_glsl(result_type) + "({ "; + uint32_t num_control_points = to_array_size_literal(result_type, 1); + uint32_t base_interface_index = interface_index; + + auto &sub_type = get(result_type.parent_type); + + for (uint32_t i = 0; i < num_control_points; i++) + { + expr += type_to_glsl(sub_type) + "({ "; + interface_index = base_interface_index; + uint32_t array_size = to_array_size_literal(result_type, 0); + for (uint32_t j = 0; j < array_size; j++, interface_index++) + { + const uint32_t indices[2] = { i, interface_index }; + + AccessChainMeta meta; + expr += access_chain_internal(stage_in_ptr_var_id, indices, 2, + ACCESS_CHAIN_INDEX_IS_LITERAL_BIT | ACCESS_CHAIN_PTR_CHAIN_BIT, &meta); + if (!is_matrix(sub_type) && sub_type.basetype != SPIRType::Struct && + expr_type.vecsize > sub_type.vecsize) + expr += vector_swizzle(sub_type.vecsize, 0); + + if (j + 1 < array_size) + expr += ", "; + } + expr += " })"; + if (i + 1 < num_control_points) + expr += ", "; + } + expr += " })"; + } + else if (result_type.basetype == SPIRType::Struct) + { + bool is_array_of_struct = is_array(result_type); + if (is_array_of_struct && !ptr_is_io_variable) + SPIRV_CROSS_THROW("Loading array of struct from IO variable must come directly from IO variable."); + + uint32_t num_control_points = 1; + if (is_array_of_struct) + { + num_control_points = to_array_size_literal(result_type, 0); + expr += type_to_glsl(result_type) + "({ "; + } + + auto &struct_type = is_array_of_struct ? get(result_type.parent_type) : result_type; + assert(struct_type.array.empty()); + + for (uint32_t i = 0; i < num_control_points; i++) + { + expr += type_to_glsl(struct_type) + "{ "; + for (uint32_t j = 0; j < uint32_t(struct_type.member_types.size()); j++) + { + // The base interface index is stored per variable for structs. + if (var) + { + interface_index = + get_extended_member_decoration(var->self, j, SPIRVCrossDecorationInterfaceMemberIndex); + } + + if (interface_index == uint32_t(-1)) + SPIRV_CROSS_THROW("Interface index is unknown. Cannot continue."); + + const auto &mbr_type = get(struct_type.member_types[j]); + const auto &expr_mbr_type = get(expr_type.member_types[j]); + if (is_matrix(mbr_type) && ptr_type.storage == StorageClassInput) + { + expr += type_to_glsl(mbr_type) + "("; + for (uint32_t k = 0; k < mbr_type.columns; k++, interface_index++) + { + if (is_array_of_struct) + { + const uint32_t indices[2] = { i, interface_index }; + AccessChainMeta meta; + expr += access_chain_internal( + stage_in_ptr_var_id, indices, 2, + ACCESS_CHAIN_INDEX_IS_LITERAL_BIT | ACCESS_CHAIN_PTR_CHAIN_BIT, &meta); + } + else + expr += to_expression(ptr) + "." + to_member_name(iface_type, interface_index); + if (expr_mbr_type.vecsize > mbr_type.vecsize) + expr += vector_swizzle(mbr_type.vecsize, 0); + + if (k + 1 < mbr_type.columns) + expr += ", "; + } + expr += ")"; + } + else if (is_array(mbr_type)) + { + expr += type_to_glsl(mbr_type) + "({ "; + uint32_t array_size = to_array_size_literal(mbr_type, 0); + for (uint32_t k = 0; k < array_size; k++, interface_index++) + { + if (is_array_of_struct) + { + const uint32_t indices[2] = { i, interface_index }; + AccessChainMeta meta; + expr += access_chain_internal( + stage_in_ptr_var_id, indices, 2, + ACCESS_CHAIN_INDEX_IS_LITERAL_BIT | ACCESS_CHAIN_PTR_CHAIN_BIT, &meta); + } + else + expr += to_expression(ptr) + "." + to_member_name(iface_type, interface_index); + if (expr_mbr_type.vecsize > mbr_type.vecsize) + expr += vector_swizzle(mbr_type.vecsize, 0); + + if (k + 1 < array_size) + expr += ", "; + } + expr += " })"; + } + else + { + if (is_array_of_struct) + { + const uint32_t indices[2] = { i, interface_index }; + AccessChainMeta meta; + expr += access_chain_internal(stage_in_ptr_var_id, indices, 2, + ACCESS_CHAIN_INDEX_IS_LITERAL_BIT | ACCESS_CHAIN_PTR_CHAIN_BIT, + &meta); + } + else + expr += to_expression(ptr) + "." + to_member_name(iface_type, interface_index); + if (expr_mbr_type.vecsize > mbr_type.vecsize) + expr += vector_swizzle(mbr_type.vecsize, 0); + } + + if (j + 1 < struct_type.member_types.size()) + expr += ", "; + } + expr += " }"; + if (i + 1 < num_control_points) + expr += ", "; + } + if (is_array_of_struct) + expr += " })"; + } + else if (is_matrix(result_type)) + { + bool is_array_of_matrix = is_array(result_type); + if (is_array_of_matrix && !ptr_is_io_variable) + SPIRV_CROSS_THROW("Loading array of matrix from IO variable must come directly from IO variable."); + if (interface_index == uint32_t(-1)) + SPIRV_CROSS_THROW("Interface index is unknown. Cannot continue."); + + if (is_array_of_matrix) + { + // Loading a matrix from each control point. + uint32_t base_interface_index = interface_index; + uint32_t num_control_points = to_array_size_literal(result_type, 0); + expr += type_to_glsl(result_type) + "({ "; + + auto &matrix_type = get_variable_element_type(get(ptr)); + + for (uint32_t i = 0; i < num_control_points; i++) + { + interface_index = base_interface_index; + expr += type_to_glsl(matrix_type) + "("; + for (uint32_t j = 0; j < result_type.columns; j++, interface_index++) + { + const uint32_t indices[2] = { i, interface_index }; + + AccessChainMeta meta; + expr += access_chain_internal(stage_in_ptr_var_id, indices, 2, + ACCESS_CHAIN_INDEX_IS_LITERAL_BIT | ACCESS_CHAIN_PTR_CHAIN_BIT, &meta); + if (expr_type.vecsize > result_type.vecsize) + expr += vector_swizzle(result_type.vecsize, 0); + if (j + 1 < result_type.columns) + expr += ", "; + } + expr += ")"; + if (i + 1 < num_control_points) + expr += ", "; + } + + expr += " })"; + } + else + { + expr += type_to_glsl(result_type) + "("; + for (uint32_t i = 0; i < result_type.columns; i++, interface_index++) + { + expr += to_expression(ptr) + "." + to_member_name(iface_type, interface_index); + if (expr_type.vecsize > result_type.vecsize) + expr += vector_swizzle(result_type.vecsize, 0); + if (i + 1 < result_type.columns) + expr += ", "; + } + expr += ")"; + } + } + else if (ptr_is_io_variable) + { + assert(is_array(result_type)); + assert(result_type.array.size() == 1); + if (interface_index == uint32_t(-1)) + SPIRV_CROSS_THROW("Interface index is unknown. Cannot continue."); + + // We're loading an array directly from a global variable. + // This means we're loading one member from each control point. + expr += type_to_glsl(result_type) + "({ "; + uint32_t num_control_points = to_array_size_literal(result_type, 0); + + for (uint32_t i = 0; i < num_control_points; i++) + { + const uint32_t indices[2] = { i, interface_index }; + + AccessChainMeta meta; + expr += access_chain_internal(stage_in_ptr_var_id, indices, 2, + ACCESS_CHAIN_INDEX_IS_LITERAL_BIT | ACCESS_CHAIN_PTR_CHAIN_BIT, &meta); + if (expr_type.vecsize > result_type.vecsize) + expr += vector_swizzle(result_type.vecsize, 0); + + if (i + 1 < num_control_points) + expr += ", "; + } + expr += " })"; + } + else + { + // We're loading an array from a concrete control point. + assert(is_array(result_type)); + assert(result_type.array.size() == 1); + if (interface_index == uint32_t(-1)) + SPIRV_CROSS_THROW("Interface index is unknown. Cannot continue."); + + expr += type_to_glsl(result_type) + "({ "; + uint32_t array_size = to_array_size_literal(result_type, 0); + for (uint32_t i = 0; i < array_size; i++, interface_index++) + { + expr += to_expression(ptr) + "." + to_member_name(iface_type, interface_index); + if (expr_type.vecsize > result_type.vecsize) + expr += vector_swizzle(result_type.vecsize, 0); + if (i + 1 < array_size) + expr += ", "; + } + expr += " })"; + } + + emit_op(result_type_id, id, expr, false); + register_read(id, ptr, false); + return true; +} + +bool CompilerMSL::emit_tessellation_access_chain(const uint32_t *ops, uint32_t length) +{ + // If this is a per-vertex output, remap it to the I/O array buffer. + + // Any object which did not go through IO flattening shenanigans will go there instead. + // We will unflatten on-demand instead as needed, but not all possible cases can be supported, especially with arrays. + + auto *var = maybe_get_backing_variable(ops[2]); + bool patch = false; + bool flat_data = false; + bool ptr_is_chain = false; + bool flatten_composites = false; + + bool is_block = false; + bool is_arrayed = false; + + if (var) + { + auto &type = get_variable_data_type(*var); + is_block = has_decoration(type.self, DecorationBlock); + is_arrayed = !type.array.empty(); + + flatten_composites = variable_storage_requires_stage_io(var->storage); + patch = has_decoration(ops[2], DecorationPatch) || is_patch_block(type); + + // Should match strip_array in add_interface_block. + flat_data = var->storage == StorageClassInput || (var->storage == StorageClassOutput && is_tesc_shader()); + + // Patch inputs are treated as normal block IO variables, so they don't deal with this path at all. + if (patch && (!is_block || is_arrayed || var->storage == StorageClassInput)) + flat_data = false; + + // We might have a chained access chain, where + // we first take the access chain to the control point, and then we chain into a member or something similar. + // In this case, we need to skip gl_in/gl_out remapping. + // Also, skip ptr chain for patches. + ptr_is_chain = var->self != ID(ops[2]); + } + + bool builtin_variable = false; + bool variable_is_flat = false; + + if (var && flat_data) + { + builtin_variable = is_builtin_variable(*var); + + BuiltIn bi_type = BuiltInMax; + if (builtin_variable && !is_block) + bi_type = BuiltIn(get_decoration(var->self, DecorationBuiltIn)); + + variable_is_flat = !builtin_variable || is_block || + bi_type == BuiltInPosition || bi_type == BuiltInPointSize || + bi_type == BuiltInClipDistance || bi_type == BuiltInCullDistance; + } + + if (variable_is_flat) + { + // If output is masked, it is emitted as a "normal" variable, just go through normal code paths. + // Only check this for the first level of access chain. + // Dealing with this for partial access chains should be possible, but awkward. + if (var->storage == StorageClassOutput && !ptr_is_chain) + { + bool masked = false; + if (is_block) + { + uint32_t relevant_member_index = patch ? 3 : 4; + // FIXME: This won't work properly if the application first access chains into gl_out element, + // then access chains into the member. Super weird, but theoretically possible ... + if (length > relevant_member_index) + { + uint32_t mbr_idx = get(ops[relevant_member_index]).scalar(); + masked = is_stage_output_block_member_masked(*var, mbr_idx, true); + } + } + else if (var) + masked = is_stage_output_variable_masked(*var); + + if (masked) + return false; + } + + AccessChainMeta meta; + SmallVector indices; + uint32_t next_id = ir.increase_bound_by(1); + + indices.reserve(length - 3 + 1); + + uint32_t first_non_array_index = (ptr_is_chain ? 3 : 4) - (patch ? 1 : 0); + + VariableID stage_var_id; + if (patch) + stage_var_id = var->storage == StorageClassInput ? patch_stage_in_var_id : patch_stage_out_var_id; + else + stage_var_id = var->storage == StorageClassInput ? stage_in_ptr_var_id : stage_out_ptr_var_id; + + VariableID ptr = ptr_is_chain ? VariableID(ops[2]) : stage_var_id; + if (!ptr_is_chain && !patch) + { + // Index into gl_in/gl_out with first array index. + indices.push_back(ops[first_non_array_index - 1]); + } + + auto &result_ptr_type = get(ops[0]); + + uint32_t const_mbr_id = next_id++; + uint32_t index = get_extended_decoration(ops[2], SPIRVCrossDecorationInterfaceMemberIndex); + + // If we have a pointer chain expression, and we are no longer pointing to a composite + // object, we are in the clear. There is no longer a need to flatten anything. + bool further_access_chain_is_trivial = false; + if (ptr_is_chain && flatten_composites) + { + auto &ptr_type = expression_type(ptr); + if (!is_array(ptr_type) && !is_matrix(ptr_type) && ptr_type.basetype != SPIRType::Struct) + further_access_chain_is_trivial = true; + } + + if (!further_access_chain_is_trivial && (flatten_composites || is_block)) + { + uint32_t i = first_non_array_index; + auto *type = &get_variable_element_type(*var); + if (index == uint32_t(-1) && length >= (first_non_array_index + 1)) + { + // Maybe this is a struct type in the input class, in which case + // we put it as a decoration on the corresponding member. + uint32_t mbr_idx = get_constant(ops[first_non_array_index]).scalar(); + index = get_extended_member_decoration(var->self, mbr_idx, + SPIRVCrossDecorationInterfaceMemberIndex); + assert(index != uint32_t(-1)); + i++; + type = &get(type->member_types[mbr_idx]); + } + + // In this case, we're poking into flattened structures and arrays, so now we have to + // combine the following indices. If we encounter a non-constant index, + // we're hosed. + for (; flatten_composites && i < length; ++i) + { + if (!is_array(*type) && !is_matrix(*type) && type->basetype != SPIRType::Struct) + break; + + auto *c = maybe_get(ops[i]); + if (!c || c->specialization) + SPIRV_CROSS_THROW("Trying to dynamically index into an array interface variable in tessellation. " + "This is currently unsupported."); + + // We're in flattened space, so just increment the member index into IO block. + // We can only do this once in the current implementation, so either: + // Struct, Matrix or 1-dimensional array for a control point. + if (type->basetype == SPIRType::Struct && var->storage == StorageClassOutput) + { + // Need to consider holes, since individual block members might be masked away. + uint32_t mbr_idx = c->scalar(); + for (uint32_t j = 0; j < mbr_idx; j++) + if (!is_stage_output_block_member_masked(*var, j, true)) + index++; + } + else + index += c->scalar(); + + if (type->parent_type) + type = &get(type->parent_type); + else if (type->basetype == SPIRType::Struct) + type = &get(type->member_types[c->scalar()]); + } + + // We're not going to emit the actual member name, we let any further OpLoad take care of that. + // Tag the access chain with the member index we're referencing. + auto &result_pointee_type = get_pointee_type(result_ptr_type); + bool defer_access_chain = flatten_composites && (is_matrix(result_pointee_type) || is_array(result_pointee_type) || + result_pointee_type.basetype == SPIRType::Struct); + + if (!defer_access_chain) + { + // Access the appropriate member of gl_in/gl_out. + set(const_mbr_id, get_uint_type_id(), index, false); + indices.push_back(const_mbr_id); + + // Member index is now irrelevant. + index = uint32_t(-1); + + // Append any straggling access chain indices. + if (i < length) + indices.insert(indices.end(), ops + i, ops + length); + } + else + { + // We must have consumed the entire access chain if we're deferring it. + assert(i == length); + } + + if (index != uint32_t(-1)) + set_extended_decoration(ops[1], SPIRVCrossDecorationInterfaceMemberIndex, index); + else + unset_extended_decoration(ops[1], SPIRVCrossDecorationInterfaceMemberIndex); + } + else + { + if (index != uint32_t(-1)) + { + set(const_mbr_id, get_uint_type_id(), index, false); + indices.push_back(const_mbr_id); + } + + // Member index is now irrelevant. + index = uint32_t(-1); + unset_extended_decoration(ops[1], SPIRVCrossDecorationInterfaceMemberIndex); + + indices.insert(indices.end(), ops + first_non_array_index, ops + length); + } + + // We use the pointer to the base of the input/output array here, + // so this is always a pointer chain. + string e; + + if (!ptr_is_chain) + { + // This is the start of an access chain, use ptr_chain to index into control point array. + e = access_chain(ptr, indices.data(), uint32_t(indices.size()), result_ptr_type, &meta, !patch); + } + else + { + // If we're accessing a struct, we need to use member indices which are based on the IO block, + // not actual struct type, so we have to use a split access chain here where + // first path resolves the control point index, i.e. gl_in[index], and second half deals with + // looking up flattened member name. + + // However, it is possible that we partially accessed a struct, + // by taking pointer to member inside the control-point array. + // For this case, we fall back to a natural access chain since we have already dealt with remapping struct members. + // One way to check this here is if we have 2 implied read expressions. + // First one is the gl_in/gl_out struct itself, then an index into that array. + // If we have traversed further, we use a normal access chain formulation. + auto *ptr_expr = maybe_get(ptr); + bool split_access_chain_formulation = flatten_composites && ptr_expr && + ptr_expr->implied_read_expressions.size() == 2 && + !further_access_chain_is_trivial; + + if (split_access_chain_formulation) + { + e = join(to_expression(ptr), + access_chain_internal(stage_var_id, indices.data(), uint32_t(indices.size()), + ACCESS_CHAIN_CHAIN_ONLY_BIT, &meta)); + } + else + { + e = access_chain_internal(ptr, indices.data(), uint32_t(indices.size()), 0, &meta); + } + } + + // Get the actual type of the object that was accessed. If it's a vector type and we changed it, + // then we'll need to add a swizzle. + // For this, we can't necessarily rely on the type of the base expression, because it might be + // another access chain, and it will therefore already have the "correct" type. + auto *expr_type = &get_variable_data_type(*var); + if (has_extended_decoration(ops[2], SPIRVCrossDecorationTessIOOriginalInputTypeID)) + expr_type = &get(get_extended_decoration(ops[2], SPIRVCrossDecorationTessIOOriginalInputTypeID)); + for (uint32_t i = 3; i < length; i++) + { + if (!is_array(*expr_type) && expr_type->basetype == SPIRType::Struct) + expr_type = &get(expr_type->member_types[get(ops[i]).scalar()]); + else + expr_type = &get(expr_type->parent_type); + } + if (!is_array(*expr_type) && !is_matrix(*expr_type) && expr_type->basetype != SPIRType::Struct && + expr_type->vecsize > result_ptr_type.vecsize) + e += vector_swizzle(result_ptr_type.vecsize, 0); + + auto &expr = set(ops[1], std::move(e), ops[0], should_forward(ops[2])); + expr.loaded_from = var->self; + expr.need_transpose = meta.need_transpose; + expr.access_chain = true; + + // Mark the result as being packed if necessary. + if (meta.storage_is_packed) + set_extended_decoration(ops[1], SPIRVCrossDecorationPhysicalTypePacked); + if (meta.storage_physical_type != 0) + set_extended_decoration(ops[1], SPIRVCrossDecorationPhysicalTypeID, meta.storage_physical_type); + if (meta.storage_is_invariant) + set_decoration(ops[1], DecorationInvariant); + // Save the type we found in case the result is used in another access chain. + set_extended_decoration(ops[1], SPIRVCrossDecorationTessIOOriginalInputTypeID, expr_type->self); + + // If we have some expression dependencies in our access chain, this access chain is technically a forwarded + // temporary which could be subject to invalidation. + // Need to assume we're forwarded while calling inherit_expression_depdendencies. + forwarded_temporaries.insert(ops[1]); + // The access chain itself is never forced to a temporary, but its dependencies might. + suppressed_usage_tracking.insert(ops[1]); + + for (uint32_t i = 2; i < length; i++) + { + inherit_expression_dependencies(ops[1], ops[i]); + add_implied_read_expression(expr, ops[i]); + } + + // If we have no dependencies after all, i.e., all indices in the access chain are immutable temporaries, + // we're not forwarded after all. + if (expr.expression_dependencies.empty()) + forwarded_temporaries.erase(ops[1]); + + return true; + } + + // If this is the inner tessellation level, and we're tessellating triangles, + // drop the last index. It isn't an array in this case, so we can't have an + // array reference here. We need to make this ID a variable instead of an + // expression so we don't try to dereference it as a variable pointer. + // Don't do this if the index is a constant 1, though. We need to drop stores + // to that one. + auto *m = ir.find_meta(var ? var->self : ID(0)); + if (is_tesc_shader() && var && m && m->decoration.builtin_type == BuiltInTessLevelInner && + is_tessellating_triangles()) + { + auto *c = maybe_get(ops[3]); + if (c && c->scalar() == 1) + return false; + auto &dest_var = set(ops[1], *var); + dest_var.basetype = ops[0]; + ir.meta[ops[1]] = ir.meta[ops[2]]; + inherit_expression_dependencies(ops[1], ops[2]); + return true; + } + + return false; +} + +bool CompilerMSL::is_out_of_bounds_tessellation_level(uint32_t id_lhs) +{ + if (!is_tessellating_triangles()) + return false; + + // In SPIR-V, TessLevelInner always has two elements and TessLevelOuter always has + // four. This is true even if we are tessellating triangles. This allows clients + // to use a single tessellation control shader with multiple tessellation evaluation + // shaders. + // In Metal, however, only the first element of TessLevelInner and the first three + // of TessLevelOuter are accessible. This stems from how in Metal, the tessellation + // levels must be stored to a dedicated buffer in a particular format that depends + // on the patch type. Therefore, in Triangles mode, any store to the second + // inner level or the fourth outer level must be dropped. + const auto *e = maybe_get(id_lhs); + if (!e || !e->access_chain) + return false; + BuiltIn builtin = BuiltIn(get_decoration(e->loaded_from, DecorationBuiltIn)); + if (builtin != BuiltInTessLevelInner && builtin != BuiltInTessLevelOuter) + return false; + auto *c = maybe_get(e->implied_read_expressions[1]); + if (!c) + return false; + return (builtin == BuiltInTessLevelInner && c->scalar() == 1) || + (builtin == BuiltInTessLevelOuter && c->scalar() == 3); +} + +bool CompilerMSL::prepare_access_chain_for_scalar_access(std::string &expr, const SPIRType &type, + StorageClass storage, bool &is_packed) +{ + // If there is any risk of writes happening with the access chain in question, + // and there is a risk of concurrent write access to other components, + // we must cast the access chain to a plain pointer to ensure we only access the exact scalars we expect. + // The MSL compiler refuses to allow component-level access for any non-packed vector types. + // MSL refuses to take address or reference to vector component, even for packed types, so just force + // through the pointer cast. No much we can do sadly. + // For packed types, we could technically omit this if we know the reference does not have to turn into a pointer + // of some kind, but that requires external analysis passes to figure out, and + // this case is likely rare enough that we don't need to bother. + if (storage == StorageClassStorageBuffer || storage == StorageClassWorkgroup) + { + const char *addr_space = storage == StorageClassWorkgroup ? "threadgroup" : "device"; + expr = join("((", addr_space, " ", type_to_glsl(type), "*)&", enclose_expression(expr), ")"); + + // Further indexing should happen with packed rules (array index, not swizzle). + is_packed = true; + return true; + } + else + return false; +} + +bool CompilerMSL::access_chain_needs_stage_io_builtin_translation(uint32_t base) +{ + auto *var = maybe_get_backing_variable(base); + if (!var || !is_tessellation_shader()) + return true; + + // We only need to rewrite builtin access chains when accessing flattened builtins like gl_ClipDistance_N. + // Avoid overriding it back to just gl_ClipDistance. + // This can only happen in scenarios where we cannot flatten/unflatten access chains, so, the only case + // where this triggers is evaluation shader inputs. + bool redirect_builtin = is_tese_shader() ? var->storage == StorageClassOutput : false; + return redirect_builtin; +} + +// Sets the interface member index for an access chain to a pull-model interpolant. +void CompilerMSL::fix_up_interpolant_access_chain(const uint32_t *ops, uint32_t length) +{ + auto *var = maybe_get_backing_variable(ops[2]); + if (!var || !pull_model_inputs.count(var->self)) + return; + // Get the base index. + uint32_t interface_index; + auto &var_type = get_variable_data_type(*var); + auto &result_type = get(ops[0]); + auto *type = &var_type; + if (has_extended_decoration(ops[2], SPIRVCrossDecorationInterfaceMemberIndex)) + { + interface_index = get_extended_decoration(ops[2], SPIRVCrossDecorationInterfaceMemberIndex); + } + else + { + // Assume an access chain into a struct variable. + assert(var_type.basetype == SPIRType::Struct); + auto &c = get(ops[3 + var_type.array.size()]); + interface_index = + get_extended_member_decoration(var->self, c.scalar(), SPIRVCrossDecorationInterfaceMemberIndex); + } + // Accumulate indices. We'll have to skip over the one for the struct, if present, because we already accounted + // for that getting the base index. + for (uint32_t i = 3; i < length; ++i) + { + if (is_vector(*type) && !is_array(*type) && is_scalar(result_type)) + { + // We don't want to combine the next index. Actually, we need to save it + // so we know to apply a swizzle to the result of the interpolation. + set_extended_decoration(ops[1], SPIRVCrossDecorationInterpolantComponentExpr, ops[i]); + break; + } + + auto *c = maybe_get(ops[i]); + if (!c || c->specialization) + SPIRV_CROSS_THROW("Trying to dynamically index into an array interface variable using pull-model " + "interpolation. This is currently unsupported."); + + if (type->parent_type) + type = &get(type->parent_type); + else if (type->basetype == SPIRType::Struct) + type = &get(type->member_types[c->scalar()]); + + if (!has_extended_decoration(ops[2], SPIRVCrossDecorationInterfaceMemberIndex) && + i - 3 == var_type.array.size()) + continue; + + interface_index += c->scalar(); + } + // Save this to the access chain itself so we can recover it later when calling an interpolation function. + set_extended_decoration(ops[1], SPIRVCrossDecorationInterfaceMemberIndex, interface_index); +} + + +// If the physical type of a physical buffer pointer has been changed +// to a ulong or ulongn vector, add a cast back to the pointer type. +bool CompilerMSL::check_physical_type_cast(std::string &expr, const SPIRType *type, uint32_t physical_type) +{ + auto *p_physical_type = maybe_get(physical_type); + if (p_physical_type && + p_physical_type->storage == StorageClassPhysicalStorageBuffer && + p_physical_type->basetype == to_unsigned_basetype(64)) + { + if (p_physical_type->vecsize > 1) + expr += ".x"; + + expr = join("((", type_to_glsl(*type), ")", expr, ")"); + return true; + } + + return false; +} + +// Override for MSL-specific syntax instructions +void CompilerMSL::emit_instruction(const Instruction &instruction) +{ +#define MSL_BOP(op) emit_binary_op(ops[0], ops[1], ops[2], ops[3], #op) +#define MSL_PTR_BOP(op) emit_binary_ptr_op(ops[0], ops[1], ops[2], ops[3], #op) + // MSL does care about implicit integer promotion, but those cases are all handled in common code. +#define MSL_BOP_CAST(op, type) \ + emit_binary_op_cast(ops[0], ops[1], ops[2], ops[3], #op, type, opcode_is_sign_invariant(opcode), false) +#define MSL_UOP(op) emit_unary_op(ops[0], ops[1], ops[2], #op) +#define MSL_QFOP(op) emit_quaternary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], ops[5], #op) +#define MSL_TFOP(op) emit_trinary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], #op) +#define MSL_BFOP(op) emit_binary_func_op(ops[0], ops[1], ops[2], ops[3], #op) +#define MSL_BFOP_CAST(op, type) \ + emit_binary_func_op_cast(ops[0], ops[1], ops[2], ops[3], #op, type, opcode_is_sign_invariant(opcode)) +#define MSL_UFOP(op) emit_unary_func_op(ops[0], ops[1], ops[2], #op) +#define MSL_UNORD_BOP(op) emit_binary_unord_op(ops[0], ops[1], ops[2], ops[3], #op) + + auto ops = stream(instruction); + auto opcode = static_cast(instruction.op); + + opcode = get_remapped_spirv_op(opcode); + + // If we need to do implicit bitcasts, make sure we do it with the correct type. + uint32_t integer_width = get_integer_width_for_instruction(instruction); + auto int_type = to_signed_basetype(integer_width); + auto uint_type = to_unsigned_basetype(integer_width); + + switch (opcode) + { + case OpLoad: + { + uint32_t id = ops[1]; + uint32_t ptr = ops[2]; + if (is_tessellation_shader()) + { + if (!emit_tessellation_io_load(ops[0], id, ptr)) + CompilerGLSL::emit_instruction(instruction); + } + else + { + // Sample mask input for Metal is not an array + if (BuiltIn(get_decoration(ptr, DecorationBuiltIn)) == BuiltInSampleMask) + set_decoration(id, DecorationBuiltIn, BuiltInSampleMask); + CompilerGLSL::emit_instruction(instruction); + } + break; + } + + // Comparisons + case OpIEqual: + MSL_BOP_CAST(==, int_type); + break; + + case OpLogicalEqual: + case OpFOrdEqual: + MSL_BOP(==); + break; + + case OpINotEqual: + MSL_BOP_CAST(!=, int_type); + break; + + case OpLogicalNotEqual: + case OpFOrdNotEqual: + // TODO: Should probably negate the == result here. + // Typically OrdNotEqual comes from GLSL which itself does not really specify what + // happens with NaN. + // Consider fixing this if we run into real issues. + MSL_BOP(!=); + break; + + case OpUGreaterThan: + MSL_BOP_CAST(>, uint_type); + break; + + case OpSGreaterThan: + MSL_BOP_CAST(>, int_type); + break; + + case OpFOrdGreaterThan: + MSL_BOP(>); + break; + + case OpUGreaterThanEqual: + MSL_BOP_CAST(>=, uint_type); + break; + + case OpSGreaterThanEqual: + MSL_BOP_CAST(>=, int_type); + break; + + case OpFOrdGreaterThanEqual: + MSL_BOP(>=); + break; + + case OpULessThan: + MSL_BOP_CAST(<, uint_type); + break; + + case OpSLessThan: + MSL_BOP_CAST(<, int_type); + break; + + case OpFOrdLessThan: + MSL_BOP(<); + break; + + case OpULessThanEqual: + MSL_BOP_CAST(<=, uint_type); + break; + + case OpSLessThanEqual: + MSL_BOP_CAST(<=, int_type); + break; + + case OpFOrdLessThanEqual: + MSL_BOP(<=); + break; + + case OpFUnordEqual: + MSL_UNORD_BOP(==); + break; + + case OpFUnordNotEqual: + // not equal in MSL generates une opcodes to begin with. + // Since unordered not equal is how it works in C, just inherit that behavior. + MSL_BOP(!=); + break; + + case OpFUnordGreaterThan: + MSL_UNORD_BOP(>); + break; + + case OpFUnordGreaterThanEqual: + MSL_UNORD_BOP(>=); + break; + + case OpFUnordLessThan: + MSL_UNORD_BOP(<); + break; + + case OpFUnordLessThanEqual: + MSL_UNORD_BOP(<=); + break; + + // Pointer math + case OpPtrEqual: + MSL_PTR_BOP(==); + break; + + case OpPtrNotEqual: + MSL_PTR_BOP(!=); + break; + + case OpPtrDiff: + MSL_PTR_BOP(-); + break; + + // Derivatives + case OpDPdx: + case OpDPdxFine: + case OpDPdxCoarse: + MSL_UFOP(dfdx); + register_control_dependent_expression(ops[1]); + break; + + case OpDPdy: + case OpDPdyFine: + case OpDPdyCoarse: + MSL_UFOP(dfdy); + register_control_dependent_expression(ops[1]); + break; + + case OpFwidth: + case OpFwidthCoarse: + case OpFwidthFine: + MSL_UFOP(fwidth); + register_control_dependent_expression(ops[1]); + break; + + // Bitfield + case OpBitFieldInsert: + { + emit_bitfield_insert_op(ops[0], ops[1], ops[2], ops[3], ops[4], ops[5], "insert_bits", SPIRType::UInt); + break; + } + + case OpBitFieldSExtract: + { + emit_trinary_func_op_bitextract(ops[0], ops[1], ops[2], ops[3], ops[4], "extract_bits", int_type, int_type, + SPIRType::UInt, SPIRType::UInt); + break; + } + + case OpBitFieldUExtract: + { + emit_trinary_func_op_bitextract(ops[0], ops[1], ops[2], ops[3], ops[4], "extract_bits", uint_type, uint_type, + SPIRType::UInt, SPIRType::UInt); + break; + } + + case OpBitReverse: + // BitReverse does not have issues with sign since result type must match input type. + MSL_UFOP(reverse_bits); + break; + + case OpBitCount: + { + auto basetype = expression_type(ops[2]).basetype; + emit_unary_func_op_cast(ops[0], ops[1], ops[2], "popcount", basetype, basetype); + break; + } + + case OpSMod: + MSL_BFOP(spvSMod); + break; + + case OpFRem: + MSL_BFOP(fmod); + break; + + case OpFMul: + if (msl_options.invariant_float_math || has_legacy_nocontract(ops[0], ops[1])) + MSL_BFOP(spvFMul); + else + MSL_BOP(*); + break; + + case OpFAdd: + if (msl_options.invariant_float_math || has_legacy_nocontract(ops[0], ops[1])) + MSL_BFOP(spvFAdd); + else + MSL_BOP(+); + break; + + case OpFSub: + if (msl_options.invariant_float_math || has_legacy_nocontract(ops[0], ops[1])) + MSL_BFOP(spvFSub); + else + MSL_BOP(-); + break; + + case OpFmaKHR: + MSL_TFOP(fma); + break; + + // Atomics + case OpAtomicExchange: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t ptr = ops[2]; + uint32_t mem_sem = ops[4]; + uint32_t val = ops[5]; + emit_atomic_func_op(result_type, id, "atomic_exchange", opcode, mem_sem, mem_sem, false, ptr, val); + break; + } + + case OpAtomicCompareExchange: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t ptr = ops[2]; + uint32_t mem_sem_pass = ops[4]; + uint32_t mem_sem_fail = ops[5]; + uint32_t val = ops[6]; + uint32_t comp = ops[7]; + emit_atomic_func_op(result_type, id, "atomic_compare_exchange_weak", opcode, + mem_sem_pass, mem_sem_fail, true, + ptr, comp, true, false, val); + break; + } + + case OpAtomicCompareExchangeWeak: + SPIRV_CROSS_THROW("OpAtomicCompareExchangeWeak is only supported in kernel profile."); + + case OpAtomicLoad: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t ptr = ops[2]; + uint32_t mem_sem = ops[4]; + check_atomic_image(ptr); + emit_atomic_func_op(result_type, id, "atomic_load", opcode, mem_sem, mem_sem, false, ptr, 0); + break; + } + + case OpAtomicStore: + { + uint32_t result_type = expression_type(ops[0]).self; + uint32_t id = ops[0]; + uint32_t ptr = ops[0]; + uint32_t mem_sem = ops[2]; + uint32_t val = ops[3]; + check_atomic_image(ptr); + emit_atomic_func_op(result_type, id, "atomic_store", opcode, mem_sem, mem_sem, false, ptr, val); + break; + } + +#define MSL_AFMO_IMPL(op, valsrc, valconst) \ + do \ + { \ + uint32_t result_type = ops[0]; \ + uint32_t id = ops[1]; \ + uint32_t ptr = ops[2]; \ + uint32_t mem_sem = ops[4]; \ + uint32_t val = valsrc; \ + emit_atomic_func_op(result_type, id, "atomic_fetch_" #op, opcode, \ + mem_sem, mem_sem, false, ptr, val, \ + false, valconst); \ + } while (false) + +#define MSL_AFMO(op) MSL_AFMO_IMPL(op, ops[5], false) +#define MSL_AFMIO(op) MSL_AFMO_IMPL(op, 1, true) + + case OpAtomicIIncrement: + MSL_AFMIO(add); + break; + + case OpAtomicIDecrement: + MSL_AFMIO(sub); + break; + + case OpAtomicIAdd: + case OpAtomicFAddEXT: + MSL_AFMO(add); + break; + + case OpAtomicISub: + MSL_AFMO(sub); + break; + + case OpAtomicSMin: + case OpAtomicUMin: + MSL_AFMO(min); + break; + + case OpAtomicSMax: + case OpAtomicUMax: + MSL_AFMO(max); + break; + + case OpAtomicAnd: + MSL_AFMO(and); + break; + + case OpAtomicOr: + MSL_AFMO(or); + break; + + case OpAtomicXor: + MSL_AFMO(xor); + break; + + // Images + + // Reads == Fetches in Metal + case OpImageRead: + { + // Mark that this shader reads from this image + uint32_t img_id = ops[2]; + auto &type = expression_type(img_id); + auto *p_var = maybe_get_backing_variable(img_id); + if (type.image.dim != DimSubpassData) + { + if (p_var && has_decoration(p_var->self, DecorationNonReadable)) + { + unset_decoration(p_var->self, DecorationNonReadable); + force_recompile(); + } + } + + // Metal requires explicit fences to break up RAW hazards, even within the same shader invocation + if (msl_options.readwrite_texture_fences && p_var && !has_decoration(p_var->self, DecorationNonWritable)) + { + add_spv_func_and_recompile(SPVFuncImplImageFence); + // Need to wrap this with a value type, + // since the Metal headers are broken and do not consider case when the image is a reference. + statement("spvImageFence(", to_expression(img_id), ");"); + } + + emit_texture_op(instruction, false); + break; + } + + // Emulate texture2D atomic operations + case OpImageTexelPointer: + { + // When using the pointer, we need to know which variable it is actually loaded from. + auto *var = maybe_get_backing_variable(ops[2]); + if (var && atomic_image_vars_emulated.count(var->self)) + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + std::string coord = to_expression(ops[3]); + auto &type = expression_type(ops[2]); + if (type.image.dim == Dim2D) + { + coord = join("spvImage2DAtomicCoord(", coord, ", ", to_expression(ops[2]), ")"); + } + + auto &e = set(id, join(to_expression(ops[2]), "_atomic[", coord, "]"), result_type, true); + e.loaded_from = var ? var->self : ID(0); + inherit_expression_dependencies(id, ops[3]); + } + else + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + // Virtual expression. Split this up in the actual image atomic. + // In GLSL and HLSL we are able to resolve the dereference inline, but MSL has + // image.op(coord, ...) syntax. + auto &e = + set(id, join(to_expression(ops[2]), "@", + bitcast_expression(SPIRType::UInt, ops[3])), + result_type, true); + + // When using the pointer, we need to know which variable it is actually loaded from. + e.loaded_from = var ? var->self : ID(0); + inherit_expression_dependencies(id, ops[3]); + } + break; + } + + case OpImageWrite: + { + uint32_t img_id = ops[0]; + uint32_t coord_id = ops[1]; + uint32_t texel_id = ops[2]; + const uint32_t *opt = &ops[3]; + uint32_t length = instruction.length - 3; + + // Bypass pointers because we need the real image struct + auto &type = expression_type(img_id); + auto &img_type = get(type.self); + + // Ensure this image has been marked as being written to and force a + // recommpile so that the image type output will include write access + auto *p_var = maybe_get_backing_variable(img_id); + if (p_var && has_decoration(p_var->self, DecorationNonWritable)) + { + unset_decoration(p_var->self, DecorationNonWritable); + force_recompile(); + } + + bool forward = false; + uint32_t bias = 0; + uint32_t lod = 0; + uint32_t flags = 0; + + if (length) + { + flags = *opt++; + length--; + } + + auto test = [&](uint32_t &v, uint32_t flag) { + if (length && (flags & flag)) + { + v = *opt++; + length--; + } + }; + + test(bias, ImageOperandsBiasMask); + test(lod, ImageOperandsLodMask); + + auto &texel_type = expression_type(texel_id); + auto store_type = texel_type; + store_type.vecsize = 4; + + TextureFunctionArguments args = {}; + args.base.img = img_id; + args.base.imgtype = &img_type; + args.base.is_fetch = true; + args.coord = coord_id; + args.lod = lod; + + string expr; + if (needs_frag_discard_checks()) + expr = join("(", builtin_to_glsl(BuiltInHelperInvocation, StorageClassInput), " ? ((void)0) : "); + expr += join(to_expression(img_id), ".write(", + remap_swizzle(store_type, texel_type.vecsize, to_expression(texel_id)), ", ", + CompilerMSL::to_function_args(args, &forward), ")"); + if (needs_frag_discard_checks()) + expr += ")"; + statement(expr, ";"); + + if (p_var && variable_storage_is_aliased(*p_var)) + flush_all_aliased_variables(); + + break; + } + + case OpImageQuerySize: + case OpImageQuerySizeLod: + { + uint32_t rslt_type_id = ops[0]; + auto &rslt_type = get(rslt_type_id); + + uint32_t id = ops[1]; + + uint32_t img_id = ops[2]; + string img_exp = to_expression(img_id); + auto &img_type = expression_type(img_id); + Dim img_dim = img_type.image.dim; + bool img_is_array = img_type.image.arrayed; + + if (img_type.basetype != SPIRType::Image) + SPIRV_CROSS_THROW("Invalid type for OpImageQuerySize."); + + string lod; + if (opcode == OpImageQuerySizeLod) + { + // LOD index defaults to zero, so don't bother outputing level zero index + string decl_lod = to_expression(ops[3]); + if (decl_lod != "0") + lod = decl_lod; + } + + string expr = type_to_glsl(rslt_type) + "("; + expr += img_exp + ".get_width(" + lod + ")"; + + if (img_dim == Dim2D || img_dim == DimCube || img_dim == Dim3D) + expr += ", " + img_exp + ".get_height(" + lod + ")"; + + if (img_dim == Dim3D) + expr += ", " + img_exp + ".get_depth(" + lod + ")"; + + if (img_is_array) + { + expr += ", " + img_exp + ".get_array_size()"; + if (img_dim == DimCube && msl_options.emulate_cube_array) + expr += " / 6"; + } + + expr += ")"; + + emit_op(rslt_type_id, id, expr, should_forward(img_id)); + + break; + } + + case OpImageQueryLod: + { + if (!msl_options.supports_msl_version(2, 2)) + SPIRV_CROSS_THROW("ImageQueryLod is only supported on MSL 2.2 and up."); + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t image_id = ops[2]; + uint32_t coord_id = ops[3]; + emit_uninitialized_temporary_expression(result_type, id); + + std::string coord_expr = to_expression(coord_id); + auto sampler_expr = to_sampler_expression(image_id); + auto *combined = maybe_get(image_id); + auto image_expr = combined ? to_expression(combined->image) : to_expression(image_id); + const SPIRType &image_type = expression_type(image_id); + const SPIRType &coord_type = expression_type(coord_id); + + switch (image_type.image.dim) + { + case Dim1D: + if (!msl_options.texture_1D_as_2D) + SPIRV_CROSS_THROW("ImageQueryLod is not supported on 1D textures."); + [[fallthrough]]; + case Dim2D: + if (coord_type.vecsize > 2) + coord_expr = enclose_expression(coord_expr) + ".xy"; + break; + case DimCube: + case Dim3D: + if (coord_type.vecsize > 3) + coord_expr = enclose_expression(coord_expr) + ".xyz"; + break; + default: + SPIRV_CROSS_THROW("Bad image type given to OpImageQueryLod"); + } + + // TODO: It is unclear if calculcate_clamped_lod also conditionally rounds + // the reported LOD based on the sampler. NEAREST miplevel should + // round the LOD, but LINEAR miplevel should not round. + // Let's hope this does not become an issue ... + statement(to_expression(id), ".x = ", image_expr, ".calculate_clamped_lod(", sampler_expr, ", ", + coord_expr, ");"); + statement(to_expression(id), ".y = ", image_expr, ".calculate_unclamped_lod(", sampler_expr, ", ", + coord_expr, ");"); + register_control_dependent_expression(id); + break; + } + +#define MSL_ImgQry(qrytype) \ + do \ + { \ + uint32_t rslt_type_id = ops[0]; \ + auto &rslt_type = get(rslt_type_id); \ + uint32_t id = ops[1]; \ + uint32_t img_id = ops[2]; \ + string img_exp = to_expression(img_id); \ + string expr = type_to_glsl(rslt_type) + "(" + img_exp + ".get_num_" #qrytype "())"; \ + emit_op(rslt_type_id, id, expr, should_forward(img_id)); \ + } while (false) + + case OpImageQueryLevels: + MSL_ImgQry(mip_levels); + break; + + case OpImageQuerySamples: + MSL_ImgQry(samples); + break; + + case OpImage: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + auto *combined = maybe_get(ops[2]); + + if (combined) + { + auto &e = emit_op(result_type, id, to_expression(combined->image), true, true); + auto *var = maybe_get_backing_variable(combined->image); + if (var) + e.loaded_from = var->self; + } + else + { + auto *var = maybe_get_backing_variable(ops[2]); + SPIRExpression *e; + if (var && has_extended_decoration(var->self, SPIRVCrossDecorationDynamicImageSampler)) + e = &emit_op(result_type, id, join(to_expression(ops[2]), ".plane0"), true, true); + else + e = &emit_op(result_type, id, to_expression(ops[2]), true, true); + if (var) + e->loaded_from = var->self; + } + break; + } + + // Casting + case OpQuantizeToF16: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t arg = ops[2]; + string exp = join("spvQuantizeToF16(", to_expression(arg), ")"); + emit_op(result_type, id, exp, should_forward(arg)); + break; + } + + case OpInBoundsAccessChain: + case OpAccessChain: + case OpPtrAccessChain: + if (is_tessellation_shader()) + { + if (!emit_tessellation_access_chain(ops, instruction.length)) + CompilerGLSL::emit_instruction(instruction); + } + else + CompilerGLSL::emit_instruction(instruction); + fix_up_interpolant_access_chain(ops, instruction.length); + break; + + case OpStore: + { + const auto &type = expression_type(ops[0]); + + if (is_out_of_bounds_tessellation_level(ops[0])) + break; + + if (needs_frag_discard_checks() && + (type.storage == StorageClassStorageBuffer || type.storage == StorageClassUniform)) + { + // If we're in a continue block, this kludge will make the block too complex + // to emit normally. + assert(current_emitting_block); + auto cont_type = continue_block_type(*current_emitting_block); + if (cont_type != SPIRBlock::ContinueNone && cont_type != SPIRBlock::ComplexLoop) + { + current_emitting_block->complex_continue = true; + force_recompile(); + } + statement("if (!", builtin_to_glsl(BuiltInHelperInvocation, StorageClassInput), ")"); + begin_scope(); + } + if (!maybe_emit_array_assignment(ops[0], ops[1])) + CompilerGLSL::emit_instruction(instruction); + if (needs_frag_discard_checks() && + (type.storage == StorageClassStorageBuffer || type.storage == StorageClassUniform)) + end_scope(); + if (has_decoration(ops[0], DecorationBuiltIn) && get_decoration(ops[0], DecorationBuiltIn) == BuiltInPointSize) + writes_to_point_size = true; + + break; + } + + // Compute barriers + case OpMemoryBarrier: + emit_barrier(0, ops[0], ops[1]); + break; + + case OpControlBarrier: + // In GLSL a memory barrier is often followed by a control barrier. + // But in MSL, memory barriers are also control barriers (before MSL 3.2), so don't + // emit a simple control barrier if a memory barrier has just been emitted. + if (previous_instruction_opcode != OpMemoryBarrier || msl_options.supports_msl_version(3, 2)) + emit_barrier(ops[0], ops[1], ops[2]); + break; + + case OpOuterProduct: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t a = ops[2]; + uint32_t b = ops[3]; + + auto &type = get(result_type); + string expr = type_to_glsl_constructor(type); + expr += "("; + for (uint32_t col = 0; col < type.columns; col++) + { + expr += to_enclosed_unpacked_expression(a); + expr += " * "; + expr += to_extract_component_expression(b, col); + if (col + 1 < type.columns) + expr += ", "; + } + expr += ")"; + emit_op(result_type, id, expr, should_forward(a) && should_forward(b)); + inherit_expression_dependencies(id, a); + inherit_expression_dependencies(id, b); + break; + } + + case OpVectorTimesMatrix: + case OpMatrixTimesVector: + { + if (!msl_options.invariant_float_math && !has_legacy_nocontract(ops[0], ops[1])) + { + CompilerGLSL::emit_instruction(instruction); + break; + } + + // If the matrix needs transpose, just flip the multiply order. + auto *e = maybe_get(ops[opcode == OpMatrixTimesVector ? 2 : 3]); + if (e && e->need_transpose) + { + e->need_transpose = false; + string expr; + + if (opcode == OpMatrixTimesVector) + { + expr = join("spvFMulVectorMatrix(", to_enclosed_unpacked_expression(ops[3]), ", ", + to_unpacked_row_major_matrix_expression(ops[2]), ")"); + } + else + { + expr = join("spvFMulMatrixVector(", to_unpacked_row_major_matrix_expression(ops[3]), ", ", + to_enclosed_unpacked_expression(ops[2]), ")"); + } + + bool forward = should_forward(ops[2]) && should_forward(ops[3]); + emit_op(ops[0], ops[1], expr, forward); + e->need_transpose = true; + inherit_expression_dependencies(ops[1], ops[2]); + inherit_expression_dependencies(ops[1], ops[3]); + } + else + { + if (opcode == OpMatrixTimesVector) + MSL_BFOP(spvFMulMatrixVector); + else + MSL_BFOP(spvFMulVectorMatrix); + } + break; + } + + case OpMatrixTimesMatrix: + { + if (!msl_options.invariant_float_math && !has_legacy_nocontract(ops[0], ops[1])) + { + CompilerGLSL::emit_instruction(instruction); + break; + } + + auto *a = maybe_get(ops[2]); + auto *b = maybe_get(ops[3]); + + // If both matrices need transpose, we can multiply in flipped order and tag the expression as transposed. + // a^T * b^T = (b * a)^T. + if (a && b && a->need_transpose && b->need_transpose) + { + a->need_transpose = false; + b->need_transpose = false; + + auto expr = + join("spvFMulMatrixMatrix(", enclose_expression(to_unpacked_row_major_matrix_expression(ops[3])), ", ", + enclose_expression(to_unpacked_row_major_matrix_expression(ops[2])), ")"); + + bool forward = should_forward(ops[2]) && should_forward(ops[3]); + emit_transposed_op(ops[0], ops[1], expr, forward); + a->need_transpose = true; + b->need_transpose = true; + inherit_expression_dependencies(ops[1], ops[2]); + inherit_expression_dependencies(ops[1], ops[3]); + } + else + MSL_BFOP(spvFMulMatrixMatrix); + + break; + } + + case OpIAddCarry: + case OpISubBorrow: + { + uint32_t result_type = ops[0]; + uint32_t result_id = ops[1]; + uint32_t op0 = ops[2]; + uint32_t op1 = ops[3]; + auto &type = get(result_type); + emit_uninitialized_temporary_expression(result_type, result_id); + + auto &res_type = get(type.member_types[1]); + if (opcode == OpIAddCarry) + { + statement(to_expression(result_id), ".", to_member_name(type, 0), " = ", + to_enclosed_unpacked_expression(op0), " + ", to_enclosed_unpacked_expression(op1), ";"); + statement(to_expression(result_id), ".", to_member_name(type, 1), " = select(", type_to_glsl(res_type), + "(1), ", type_to_glsl(res_type), "(0), ", to_unpacked_expression(result_id), ".", to_member_name(type, 0), + " >= max(", to_unpacked_expression(op0), ", ", to_unpacked_expression(op1), "));"); + } + else + { + statement(to_expression(result_id), ".", to_member_name(type, 0), " = ", to_enclosed_unpacked_expression(op0), " - ", + to_enclosed_unpacked_expression(op1), ";"); + statement(to_expression(result_id), ".", to_member_name(type, 1), " = select(", type_to_glsl(res_type), + "(1), ", type_to_glsl(res_type), "(0), ", to_enclosed_unpacked_expression(op0), + " >= ", to_enclosed_unpacked_expression(op1), ");"); + } + break; + } + + case OpUMulExtended: + case OpSMulExtended: + { + uint32_t result_type = ops[0]; + uint32_t result_id = ops[1]; + uint32_t op0 = ops[2]; + uint32_t op1 = ops[3]; + auto &type = get(result_type); + auto &op_type = get(type.member_types[0]); + auto input_type = opcode == OpSMulExtended ? int_type : uint_type; + string cast_op0, cast_op1; + + binary_op_bitcast_helper(cast_op0, cast_op1, input_type, op0, op1, false); + auto expr = join("spvMulExtended<", type_to_glsl(type), ", ", type_to_glsl(op_type), ">(", cast_op0, ", ", cast_op1, ")"); + emit_op(result_type, result_id, expr, true); + break; + } + + case OpArrayLength: + { + auto &type = expression_type(ops[2]); + uint32_t offset = type_struct_member_offset(type, ops[3]); + uint32_t stride = type_struct_member_array_stride(type, ops[3]); + + auto expr = join("(", to_buffer_size_expression(ops[2]), " - ", offset, ") / ", stride); + emit_op(ops[0], ops[1], expr, true); + break; + } + + // Legacy sub-group stuff ... + case OpSubgroupBallotKHR: + case OpSubgroupFirstInvocationKHR: + case OpSubgroupReadInvocationKHR: + case OpSubgroupAllKHR: + case OpSubgroupAnyKHR: + case OpSubgroupAllEqualKHR: + emit_subgroup_op(instruction); + break; + + // SPV_INTEL_shader_integer_functions2 + case OpUCountLeadingZerosINTEL: + MSL_UFOP(clz); + break; + + case OpUCountTrailingZerosINTEL: + MSL_UFOP(ctz); + break; + + case OpAbsISubINTEL: + case OpAbsUSubINTEL: + MSL_BFOP(absdiff); + break; + + case OpIAddSatINTEL: + case OpUAddSatINTEL: + MSL_BFOP(addsat); + break; + + case OpIAverageINTEL: + case OpUAverageINTEL: + MSL_BFOP(hadd); + break; + + case OpIAverageRoundedINTEL: + case OpUAverageRoundedINTEL: + MSL_BFOP(rhadd); + break; + + case OpISubSatINTEL: + case OpUSubSatINTEL: + MSL_BFOP(subsat); + break; + + case OpIMul32x16INTEL: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t a = ops[2], b = ops[3]; + bool forward = should_forward(a) && should_forward(b); + emit_op(result_type, id, join("int(short(", to_unpacked_expression(a), ")) * int(short(", to_unpacked_expression(b), "))"), forward); + inherit_expression_dependencies(id, a); + inherit_expression_dependencies(id, b); + break; + } + + case OpUMul32x16INTEL: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t a = ops[2], b = ops[3]; + bool forward = should_forward(a) && should_forward(b); + emit_op(result_type, id, join("uint(ushort(", to_unpacked_expression(a), ")) * uint(ushort(", to_unpacked_expression(b), "))"), forward); + inherit_expression_dependencies(id, a); + inherit_expression_dependencies(id, b); + break; + } + + // SPV_EXT_demote_to_helper_invocation + case OpDemoteToHelperInvocationEXT: + if (!msl_options.supports_msl_version(2, 3)) + SPIRV_CROSS_THROW("discard_fragment() does not formally have demote semantics until MSL 2.3."); + CompilerGLSL::emit_instruction(instruction); + break; + + case OpIsHelperInvocationEXT: + if (msl_options.is_ios() && !msl_options.supports_msl_version(2, 3)) + SPIRV_CROSS_THROW("simd_is_helper_thread() requires MSL 2.3 on iOS."); + else if (msl_options.is_macos() && !msl_options.supports_msl_version(2, 1)) + SPIRV_CROSS_THROW("simd_is_helper_thread() requires MSL 2.1 on macOS."); + emit_op(ops[0], ops[1], + needs_manual_helper_invocation_updates() ? builtin_to_glsl(BuiltInHelperInvocation, StorageClassInput) : + "simd_is_helper_thread()", + false); + break; + + case OpBeginInvocationInterlockEXT: + case OpEndInvocationInterlockEXT: + if (!msl_options.supports_msl_version(2, 0)) + SPIRV_CROSS_THROW("Raster order groups require MSL 2.0."); + break; // Nothing to do in the body + + case OpConvertUToAccelerationStructureKHR: + SPIRV_CROSS_THROW("ConvertUToAccelerationStructure is not supported in MSL."); + case OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: + SPIRV_CROSS_THROW("BindingTableRecordOffset is not supported in MSL."); + + case OpRayQueryInitializeKHR: + { + flush_variable_declaration(ops[0]); + register_write(ops[0]); + add_spv_func_and_recompile(SPVFuncImplRayQueryIntersectionParams); + + statement(to_expression(ops[0]), ".reset(", "ray(", to_expression(ops[4]), ", ", to_expression(ops[6]), ", ", + to_expression(ops[5]), ", ", to_expression(ops[7]), "), ", to_expression(ops[1]), ", ", to_expression(ops[3]), + ", spvMakeIntersectionParams(", to_expression(ops[2]), "));"); + break; + } + case OpRayQueryProceedKHR: + { + flush_variable_declaration(ops[0]); + register_write(ops[2]); + emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".next()"), false); + break; + } +#define MSL_RAY_QUERY_IS_CANDIDATE get(ops[3]).scalar_i32() == 0 + +#define MSL_RAY_QUERY_GET_OP(op, msl_op) \ + case OpRayQueryGet##op##KHR: \ + flush_variable_declaration(ops[2]); \ + emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".get_" #msl_op "()"), false); \ + break + +#define MSL_RAY_QUERY_OP_INNER2(op, msl_prefix, msl_op) \ + case OpRayQueryGet##op##KHR: \ + flush_variable_declaration(ops[2]); \ + if (MSL_RAY_QUERY_IS_CANDIDATE) \ + emit_op(ops[0], ops[1], join(to_expression(ops[2]), #msl_prefix "_candidate_" #msl_op "()"), false); \ + else \ + emit_op(ops[0], ops[1], join(to_expression(ops[2]), #msl_prefix "_committed_" #msl_op "()"), false); \ + break + +#define MSL_RAY_QUERY_GET_OP2(op, msl_op) MSL_RAY_QUERY_OP_INNER2(op, .get, msl_op) +#define MSL_RAY_QUERY_IS_OP2(op, msl_op) MSL_RAY_QUERY_OP_INNER2(op, .is, msl_op) + + MSL_RAY_QUERY_GET_OP(RayTMin, ray_min_distance); + MSL_RAY_QUERY_GET_OP(WorldRayOrigin, world_space_ray_origin); + MSL_RAY_QUERY_GET_OP(WorldRayDirection, world_space_ray_direction); + MSL_RAY_QUERY_GET_OP2(IntersectionInstanceId, instance_id); + MSL_RAY_QUERY_GET_OP2(IntersectionInstanceCustomIndex, user_instance_id); + MSL_RAY_QUERY_GET_OP2(IntersectionBarycentrics, triangle_barycentric_coord); + MSL_RAY_QUERY_GET_OP2(IntersectionPrimitiveIndex, primitive_id); + MSL_RAY_QUERY_GET_OP2(IntersectionGeometryIndex, geometry_id); + MSL_RAY_QUERY_GET_OP2(IntersectionObjectRayOrigin, ray_origin); + MSL_RAY_QUERY_GET_OP2(IntersectionObjectRayDirection, ray_direction); + MSL_RAY_QUERY_GET_OP2(IntersectionObjectToWorld, object_to_world_transform); + MSL_RAY_QUERY_GET_OP2(IntersectionWorldToObject, world_to_object_transform); + MSL_RAY_QUERY_IS_OP2(IntersectionFrontFace, triangle_front_facing); + + case OpRayQueryGetIntersectionTypeKHR: + flush_variable_declaration(ops[2]); + if (MSL_RAY_QUERY_IS_CANDIDATE) + emit_op(ops[0], ops[1], join("uint(", to_expression(ops[2]), ".get_candidate_intersection_type()) - 1"), + false); + else + emit_op(ops[0], ops[1], join("uint(", to_expression(ops[2]), ".get_committed_intersection_type())"), false); + break; + case OpRayQueryGetIntersectionTKHR: + flush_variable_declaration(ops[2]); + if (MSL_RAY_QUERY_IS_CANDIDATE) + emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".get_candidate_triangle_distance()"), false); + else + emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".get_committed_distance()"), false); + break; + case OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: + { + flush_variable_declaration(ops[0]); + emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".is_candidate_non_opaque_bounding_box()"), false); + break; + } + case OpRayQueryConfirmIntersectionKHR: + flush_variable_declaration(ops[0]); + register_write(ops[0]); + statement(to_expression(ops[0]), ".commit_triangle_intersection();"); + break; + case OpRayQueryGenerateIntersectionKHR: + flush_variable_declaration(ops[0]); + register_write(ops[0]); + statement(to_expression(ops[0]), ".commit_bounding_box_intersection(", to_expression(ops[1]), ");"); + break; + case OpRayQueryTerminateKHR: + flush_variable_declaration(ops[0]); + register_write(ops[0]); + statement(to_expression(ops[0]), ".abort();"); + break; +#undef MSL_RAY_QUERY_GET_OP +#undef MSL_RAY_QUERY_IS_CANDIDATE +#undef MSL_RAY_QUERY_IS_OP2 +#undef MSL_RAY_QUERY_GET_OP2 +#undef MSL_RAY_QUERY_OP_INNER2 + + case OpConvertPtrToU: + case OpConvertUToPtr: + case OpBitcast: + { + auto &type = get(ops[0]); + auto &input_type = expression_type(ops[2]); + + if (opcode != OpBitcast || is_pointer(type) || is_pointer(input_type)) + { + string op; + + if ((type.vecsize == 1 || is_pointer(type)) && (input_type.vecsize == 1 || is_pointer(input_type))) + op = join("reinterpret_cast<", type_to_glsl(type), ">(", to_unpacked_expression(ops[2]), ")"); + else if (input_type.vecsize == 2) + op = join("reinterpret_cast<", type_to_glsl(type), ">(as_type(", to_unpacked_expression(ops[2]), "))"); + else + op = join("as_type<", type_to_glsl(type), ">(reinterpret_cast(", to_unpacked_expression(ops[2]), "))"); + + emit_op(ops[0], ops[1], op, should_forward(ops[2])); + inherit_expression_dependencies(ops[1], ops[2]); + } + else + CompilerGLSL::emit_instruction(instruction); + + break; + } + + case OpSDot: + case OpUDot: + case OpSUDot: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t vec1 = ops[2]; + uint32_t vec2 = ops[3]; + + auto &input_type1 = expression_type(vec1); + auto &input_type2 = expression_type(vec2); + + string vec1input, vec2input; + auto input_size = input_type1.vecsize; + if (instruction.length == 5) + { + if (ops[4] == PackedVectorFormatPackedVectorFormat4x8Bit) + { + string type = opcode == OpSDot || opcode == OpSUDot ? "char4" : "uchar4"; + vec1input = join("as_type<", type, ">(", to_expression(vec1), ")"); + type = opcode == OpSDot ? "char4" : "uchar4"; + vec2input = join("as_type<", type, ">(", to_expression(vec2), ")"); + input_size = 4; + } + else + SPIRV_CROSS_THROW("Packed vector formats other than 4x8Bit for integer dot product is not supported."); + } + else + { + // Inputs are sign or zero-extended to their target width. + SPIRType::BaseType vec1_expected_type = + opcode != OpUDot ? + to_signed_basetype(input_type1.width) : + to_unsigned_basetype(input_type1.width); + + SPIRType::BaseType vec2_expected_type = + opcode != OpSDot ? + to_unsigned_basetype(input_type2.width) : + to_signed_basetype(input_type2.width); + + vec1input = bitcast_expression(vec1_expected_type, vec1); + vec2input = bitcast_expression(vec2_expected_type, vec2); + } + + auto &type = get(result_type); + + // We'll get the appropriate sign-extend or zero-extend, no matter which type we cast to here. + // The addition in reduce_add is sign-invariant. + auto result_type_cast = join(type_to_glsl(type), input_size); + + string exp = join("reduce_add(", + result_type_cast, "(", vec1input, ") * ", + result_type_cast, "(", vec2input, "))"); + + emit_op(result_type, id, exp, should_forward(vec1) && should_forward(vec2)); + inherit_expression_dependencies(id, vec1); + inherit_expression_dependencies(id, vec2); + break; + } + + case OpSDotAccSat: + case OpUDotAccSat: + case OpSUDotAccSat: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t vec1 = ops[2]; + uint32_t vec2 = ops[3]; + uint32_t acc = ops[4]; + + auto input_type1 = expression_type(vec1); + auto input_type2 = expression_type(vec2); + + string vec1input, vec2input; + if (instruction.length == 6) + { + if (ops[5] == PackedVectorFormatPackedVectorFormat4x8Bit) + { + string type = opcode == OpSDotAccSat || opcode == OpSUDotAccSat ? "char4" : "uchar4"; + vec1input = join("as_type<", type, ">(", to_expression(vec1), ")"); + type = opcode == OpSDotAccSat ? "char4" : "uchar4"; + vec2input = join("as_type<", type, ">(", to_expression(vec2), ")"); + input_type1.vecsize = 4; + input_type2.vecsize = 4; + } + else + SPIRV_CROSS_THROW("Packed vector formats other than 4x8Bit for integer dot product is not supported."); + } + else + { + // Inputs are sign or zero-extended to their target width. + SPIRType::BaseType vec1_expected_type = + opcode != OpUDotAccSat ? + to_signed_basetype(input_type1.width) : + to_unsigned_basetype(input_type1.width); + + SPIRType::BaseType vec2_expected_type = + opcode != OpSDotAccSat ? + to_unsigned_basetype(input_type2.width) : + to_signed_basetype(input_type2.width); + + vec1input = bitcast_expression(vec1_expected_type, vec1); + vec2input = bitcast_expression(vec2_expected_type, vec2); + } + + auto &type = get(result_type); + + SPIRType::BaseType pre_saturate_type = + opcode != OpUDotAccSat ? + to_signed_basetype(type.width) : + to_unsigned_basetype(type.width); + + input_type1.basetype = pre_saturate_type; + input_type2.basetype = pre_saturate_type; + + string exp = join(type_to_glsl(type), "(addsat(reduce_add(", + type_to_glsl(input_type1), "(", vec1input, ") * ", + type_to_glsl(input_type2), "(", vec2input, ")), ", + bitcast_expression(pre_saturate_type, acc), "))"); + + emit_op(result_type, id, exp, should_forward(vec1) && should_forward(vec2)); + inherit_expression_dependencies(id, vec1); + inherit_expression_dependencies(id, vec2); + break; + } + + case OpSetMeshOutputsEXT: + { + flush_variable_declaration(builtin_mesh_primitive_indices_id); + add_spv_func_and_recompile(SPVFuncImplSetMeshOutputsEXT); + statement("spvSetMeshOutputsEXT(gl_LocalInvocationIndex, spvMeshSizes, ", to_unpacked_expression(ops[0]), ", ", to_unpacked_expression(ops[1]), ");"); + break; + } + + case OpAssumeTrueKHR: + { + auto condition = ops[0]; + statement(join("SPV_ASSUME(", to_unpacked_expression(condition), ")")); + break; + } + + case OpExpectKHR: + { + auto result_type = ops[0]; + auto ret = ops[1]; + auto value = ops[2]; + auto exp_value = ops[3]; + + auto exp = join("SPV_EXPECT(", to_unpacked_expression(value), ", ", to_unpacked_expression(exp_value), ")"); + emit_op(result_type, ret, exp, should_forward(value), should_forward(exp_value)); + inherit_expression_dependencies(ret, value); + inherit_expression_dependencies(ret, exp_value); + break; + } + + default: + CompilerGLSL::emit_instruction(instruction); + break; + } + + previous_instruction_opcode = opcode; +} + +void CompilerMSL::emit_texture_op(const Instruction &i, bool sparse) +{ + if (sparse) + SPIRV_CROSS_THROW("Sparse feedback not yet supported in MSL."); + + if (msl_options.use_framebuffer_fetch_subpasses) + { + auto *ops = stream(i); + + uint32_t result_type_id = ops[0]; + uint32_t id = ops[1]; + uint32_t img = ops[2]; + + auto &type = expression_type(img); + auto &imgtype = get(type.self); + + // Use Metal's native frame-buffer fetch API for subpass inputs. + if (imgtype.image.dim == DimSubpassData) + { + // Subpass inputs cannot be invalidated, + // so just forward the expression directly. + string expr = to_expression(img); + emit_op(result_type_id, id, expr, true); + return; + } + } + + // Fallback to default implementation + CompilerGLSL::emit_texture_op(i, sparse); +} + +void CompilerMSL::emit_barrier(uint32_t id_exe_scope, uint32_t id_mem_scope, uint32_t id_mem_sem) +{ + auto model = get_execution_model(); + + if (model != ExecutionModelGLCompute && model != ExecutionModelTaskEXT && + model != ExecutionModelMeshEXT && !is_tesc_shader()) + { + return; + } + + uint32_t exe_scope = id_exe_scope ? evaluate_constant_u32(id_exe_scope) : uint32_t(ScopeInvocation); + uint32_t mem_scope = id_mem_scope ? evaluate_constant_u32(id_mem_scope) : uint32_t(ScopeInvocation); + // Use the wider of the two scopes (smaller value) + exe_scope = min(exe_scope, mem_scope); + + if (msl_options.emulate_subgroups && exe_scope >= ScopeSubgroup && !id_mem_sem) + // In this case, we assume a "subgroup" size of 1. The barrier, then, is a noop. + return; + + string bar_stmt; + + if (!id_exe_scope && msl_options.supports_msl_version(3, 2)) + { + // Just took 10 years to get a proper barrier, but hey! + bar_stmt = "atomic_thread_fence"; + } + else + { + if ((msl_options.is_ios() && msl_options.supports_msl_version(1, 2)) || msl_options.supports_msl_version(2)) + bar_stmt = exe_scope < ScopeSubgroup ? "threadgroup_barrier" : "simdgroup_barrier"; + else + bar_stmt = "threadgroup_barrier"; + } + + bar_stmt += "("; + + uint32_t mem_sem = id_mem_sem ? evaluate_constant_u32(id_mem_sem) : uint32_t(MemorySemanticsMaskNone); + + // Use the | operator to combine flags if we can. + if (msl_options.supports_msl_version(1, 2)) + { + string mem_flags; + + // For tesc shaders, this also affects objects in the Output storage class. + // Since in Metal, these are placed in a device buffer, we have to sync device memory here. + if (is_tesc_shader() || + (mem_sem & (MemorySemanticsUniformMemoryMask | MemorySemanticsCrossWorkgroupMemoryMask))) + mem_flags += "mem_flags::mem_device"; + + // Fix tessellation patch function processing + if (is_tesc_shader() || (mem_sem & (MemorySemanticsSubgroupMemoryMask | MemorySemanticsWorkgroupMemoryMask))) + { + if (!mem_flags.empty()) + mem_flags += " | "; + mem_flags += "mem_flags::mem_threadgroup"; + } + if (mem_sem & MemorySemanticsImageMemoryMask) + { + if (!mem_flags.empty()) + mem_flags += " | "; + mem_flags += "mem_flags::mem_texture"; + } + + if (mem_flags.empty()) + mem_flags = "mem_flags::mem_none"; + + bar_stmt += mem_flags; + } + else + { + if ((mem_sem & (MemorySemanticsUniformMemoryMask | MemorySemanticsCrossWorkgroupMemoryMask)) && + (mem_sem & (MemorySemanticsSubgroupMemoryMask | MemorySemanticsWorkgroupMemoryMask))) + bar_stmt += "mem_flags::mem_device_and_threadgroup"; + else if (mem_sem & (MemorySemanticsUniformMemoryMask | MemorySemanticsCrossWorkgroupMemoryMask)) + bar_stmt += "mem_flags::mem_device"; + else if (mem_sem & (MemorySemanticsSubgroupMemoryMask | MemorySemanticsWorkgroupMemoryMask)) + bar_stmt += "mem_flags::mem_threadgroup"; + else if (mem_sem & MemorySemanticsImageMemoryMask) + bar_stmt += "mem_flags::mem_texture"; + else + bar_stmt += "mem_flags::mem_none"; + } + + if (!id_exe_scope && msl_options.supports_msl_version(3, 2)) + { + // If there's no device-related memory in the barrier, demote to workgroup scope. + // glslang seems to emit device scope even for memoryBarrierShared(). + if (mem_scope == ScopeDevice && + (mem_sem & (MemorySemanticsUniformMemoryMask | + MemorySemanticsImageMemoryMask | + MemorySemanticsCrossWorkgroupMemoryMask)) == 0) + { + mem_scope = ScopeWorkgroup; + } + + // MSL 3.2 only supports seq_cst or relaxed. + if (mem_sem & (MemorySemanticsAcquireReleaseMask | + MemorySemanticsAcquireMask | + MemorySemanticsReleaseMask | + MemorySemanticsSequentiallyConsistentMask)) + { + bar_stmt += ", memory_order_seq_cst"; + } + else + { + bar_stmt += ", memory_order_relaxed"; + } + + switch (mem_scope) + { + case ScopeDevice: + bar_stmt += ", thread_scope_device"; + break; + + case ScopeWorkgroup: + bar_stmt += ", thread_scope_threadgroup"; + break; + + case ScopeSubgroup: + bar_stmt += ", thread_scope_subgroup"; + break; + + case ScopeInvocation: + bar_stmt += ", thread_scope_thread"; + break; + + default: + // The default argument is device, which is conservative. + break; + } + } + + bar_stmt += ");"; + + statement(bar_stmt); + + assert(current_emitting_block); + flush_control_dependent_expressions(current_emitting_block->self); + flush_all_active_variables(); +} + +static bool storage_class_array_is_thread(StorageClass storage) +{ + switch (storage) + { + case StorageClassInput: + case StorageClassOutput: + case StorageClassGeneric: + case StorageClassFunction: + case StorageClassPrivate: + return true; + + default: + return false; + } +} + +bool CompilerMSL::emit_array_copy(const char *expr, uint32_t lhs_id, uint32_t rhs_id, + StorageClass lhs_storage, StorageClass rhs_storage) +{ + // Allow Metal to use the array template to make arrays a value type. + // This, however, cannot be used for threadgroup address specifiers, so consider the custom array copy as fallback. + bool lhs_is_thread_storage = storage_class_array_is_thread(lhs_storage); + bool rhs_is_thread_storage = storage_class_array_is_thread(rhs_storage); + + bool lhs_is_array_template = lhs_is_thread_storage || lhs_storage == StorageClassWorkgroup; + bool rhs_is_array_template = rhs_is_thread_storage || rhs_storage == StorageClassWorkgroup; + + // Special considerations for stage IO variables. + // If the variable is actually backed by non-user visible device storage, we use array templates for those. + // + // Another special consideration is given to thread local variables which happen to have Offset decorations + // applied to them. Block-like types do not use array templates, so we need to force POD path if we detect + // these scenarios. This check isn't perfect since it would be technically possible to mix and match these things, + // and for a fully correct solution we might have to track array template state through access chains as well, + // but for all reasonable use cases, this should suffice. + // This special case should also only apply to Function/Private storage classes. + // We should not check backing variable for temporaries. + auto *lhs_var = maybe_get_backing_variable(lhs_id); + if (lhs_var && lhs_storage == StorageClassStorageBuffer && storage_class_array_is_thread(lhs_var->storage)) + lhs_is_array_template = true; + else if (lhs_var && lhs_storage != StorageClassGeneric && type_is_explicit_layout(get(lhs_var->basetype))) + lhs_is_array_template = false; + + auto *rhs_var = maybe_get_backing_variable(rhs_id); + if (rhs_var && rhs_storage == StorageClassStorageBuffer && storage_class_array_is_thread(rhs_var->storage)) + rhs_is_array_template = true; + else if (rhs_var && rhs_storage != StorageClassGeneric && type_is_explicit_layout(get(rhs_var->basetype))) + rhs_is_array_template = false; + + // If threadgroup storage qualifiers are *not* used: + // Avoid spvCopy* wrapper functions; Otherwise, spvUnsafeArray<> template cannot be used with that storage qualifier. + if (lhs_is_array_template && rhs_is_array_template && !using_builtin_array()) + { + // Fall back to normal copy path. + return false; + } + else + { + // Ensure the LHS variable has been declared + if (lhs_var) + flush_variable_declaration(lhs_var->self); + + string lhs; + if (expr) + lhs = expr; + else + lhs = to_expression(lhs_id); + + // Assignment from an array initializer is fine. + auto &type = expression_type(rhs_id); + auto *var = maybe_get_backing_variable(rhs_id); + + // Unfortunately, we cannot template on address space in MSL, + // so explicit address space redirection it is ... + bool is_constant = false; + if (ir.ids[rhs_id].get_type() == TypeConstant) + { + is_constant = true; + } + else if (var && var->remapped_variable && var->statically_assigned && + ir.ids[var->static_expression].get_type() == TypeConstant) + { + is_constant = true; + } + else if (rhs_storage == StorageClassUniform || rhs_storage == StorageClassUniformConstant) + { + is_constant = true; + } + + // For the case where we have OpLoad triggering an array copy, + // we cannot easily detect this case ahead of time since it's + // context dependent. We might have to force a recompile here + // if this is the only use of array copies in our shader. + add_spv_func_and_recompile(type.array.size() > 1 ? SPVFuncImplArrayCopyMultidim : SPVFuncImplArrayCopy); + + const char *tag = nullptr; + if (lhs_is_thread_storage && is_constant) + tag = "FromConstantToStack"; + else if (lhs_storage == StorageClassWorkgroup && is_constant) + tag = "FromConstantToThreadGroup"; + else if (lhs_is_thread_storage && rhs_is_thread_storage) + tag = "FromStackToStack"; + else if (lhs_storage == StorageClassWorkgroup && rhs_is_thread_storage) + tag = "FromStackToThreadGroup"; + else if (lhs_is_thread_storage && rhs_storage == StorageClassWorkgroup) + tag = "FromThreadGroupToStack"; + else if (lhs_storage == StorageClassWorkgroup && rhs_storage == StorageClassWorkgroup) + tag = "FromThreadGroupToThreadGroup"; + else if (lhs_storage == StorageClassStorageBuffer && rhs_storage == StorageClassStorageBuffer) + tag = "FromDeviceToDevice"; + else if (lhs_storage == StorageClassStorageBuffer && is_constant) + tag = "FromConstantToDevice"; + else if (lhs_storage == StorageClassStorageBuffer && rhs_storage == StorageClassWorkgroup) + tag = "FromThreadGroupToDevice"; + else if (lhs_storage == StorageClassStorageBuffer && rhs_is_thread_storage) + tag = "FromStackToDevice"; + else if (lhs_storage == StorageClassWorkgroup && rhs_storage == StorageClassStorageBuffer) + tag = "FromDeviceToThreadGroup"; + else if (lhs_is_thread_storage && rhs_storage == StorageClassStorageBuffer) + tag = "FromDeviceToStack"; + else + SPIRV_CROSS_THROW("Unknown storage class used for copying arrays."); + + // Should be very rare, but mark if we need extra magic template overloads. + if (has_extended_decoration(lhs_id, SPIRVCrossDecorationPhysicalTypeID)) + add_spv_func_and_recompile(SPVFuncImplArrayCopyExtendedDst); + if (has_extended_decoration(rhs_id, SPIRVCrossDecorationPhysicalTypeID)) + add_spv_func_and_recompile(SPVFuncImplArrayCopyExtendedSrc); + + // Pass internal array of spvUnsafeArray<> into wrapper functions + if (lhs_is_array_template && rhs_is_array_template && !msl_options.force_native_arrays) + statement("spvArrayCopy", tag, "(", lhs, ".elements, ", to_expression(rhs_id), ".elements);"); + if (lhs_is_array_template && !msl_options.force_native_arrays) + statement("spvArrayCopy", tag, "(", lhs, ".elements, ", to_expression(rhs_id), ");"); + else if (rhs_is_array_template && !msl_options.force_native_arrays) + statement("spvArrayCopy", tag, "(", lhs, ", ", to_expression(rhs_id), ".elements);"); + else + statement("spvArrayCopy", tag, "(", lhs, ", ", to_expression(rhs_id), ");"); + } + + return true; +} + +uint32_t CompilerMSL::get_physical_tess_level_array_size(BuiltIn builtin) const +{ + if (is_tessellating_triangles()) + return builtin == BuiltInTessLevelInner ? 1 : 3; + else + return builtin == BuiltInTessLevelInner ? 2 : 4; +} + +// Since MSL does not allow arrays to be copied via simple variable assignment, +// if the LHS and RHS represent an assignment of an entire array, it must be +// implemented by calling an array copy function. +// Returns whether the struct assignment was emitted. +bool CompilerMSL::maybe_emit_array_assignment(uint32_t id_lhs, uint32_t id_rhs) +{ + // We only care about assignments of an entire array + auto &type = expression_type(id_lhs); + if (!is_array(get_pointee_type(type))) + return false; + + auto *var = maybe_get(id_lhs); + + // Is this a remapped, static constant? Don't do anything. + if (var && var->remapped_variable && var->statically_assigned) + return true; + + if (ir.ids[id_rhs].get_type() == TypeConstant && var && var->deferred_declaration) + { + // Special case, if we end up declaring a variable when assigning the constant array, + // we can avoid the copy by directly assigning the constant expression. + // This is likely necessary to be able to use a variable as a true look-up table, as it is unlikely + // the compiler will be able to optimize the spvArrayCopy() into a constant LUT. + // After a variable has been declared, we can no longer assign constant arrays in MSL unfortunately. + statement(to_expression(id_lhs), " = ", constant_expression(get(id_rhs)), ";"); + return true; + } + + if (is_tesc_shader() && has_decoration(id_lhs, DecorationBuiltIn)) + { + auto builtin = BuiltIn(get_decoration(id_lhs, DecorationBuiltIn)); + // Need to manually unroll the array store. + if (builtin == BuiltInTessLevelInner || builtin == BuiltInTessLevelOuter) + { + uint32_t array_size = get_physical_tess_level_array_size(builtin); + if (array_size == 1) + statement(to_expression(id_lhs), " = half(", to_expression(id_rhs), "[0]);"); + else + { + for (uint32_t i = 0; i < array_size; i++) + statement(to_expression(id_lhs), "[", i, "] = half(", to_expression(id_rhs), "[", i, "]);"); + } + return true; + } + } + + auto lhs_storage = get_expression_effective_storage_class(id_lhs); + auto rhs_storage = get_expression_effective_storage_class(id_rhs); + if (!emit_array_copy(nullptr, id_lhs, id_rhs, lhs_storage, rhs_storage)) + return false; + + register_write(id_lhs); + + return true; +} + +// Emits one of the atomic functions. In MSL, the atomic functions operate on pointers +void CompilerMSL::emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, Op opcode, + uint32_t mem_order_1, uint32_t mem_order_2, bool has_mem_order_2, uint32_t obj, uint32_t op1, + bool op1_is_pointer, bool op1_is_literal, uint32_t op2) +{ + string exp; + + auto &ptr_type = expression_type(obj); + auto &type = get_pointee_type(ptr_type); + auto expected_type = type.basetype; + if (opcode == OpAtomicUMax || opcode == OpAtomicUMin) + expected_type = to_unsigned_basetype(type.width); + else if (opcode == OpAtomicSMax || opcode == OpAtomicSMin) + expected_type = to_signed_basetype(type.width); + + bool use_native_image_atomic; + if (msl_options.supports_msl_version(3, 1)) + use_native_image_atomic = check_atomic_image(obj); + else + use_native_image_atomic = false; + + if (type.width == 64) + SPIRV_CROSS_THROW("MSL currently does not support 64-bit atomics."); + + auto remapped_type = type; + remapped_type.basetype = expected_type; + + auto *var = maybe_get_backing_variable(obj); + const auto *res_type = var ? &get(var->basetype) : nullptr; + assert(type.storage != StorageClassImage || res_type); + + bool is_atomic_compare_exchange_strong = op1_is_pointer && op1; + + bool check_discard = opcode != OpAtomicLoad && needs_frag_discard_checks() && + ptr_type.storage != StorageClassWorkgroup; + + // Even compare exchange atomics are vec4 on metal for ... reasons :v + uint32_t vec4_temporary_id = 0; + if (use_native_image_atomic && is_atomic_compare_exchange_strong) + { + uint32_t &tmp_id = extra_sub_expressions[result_id]; + if (!tmp_id) + { + tmp_id = ir.increase_bound_by(2); + + auto vec4_type = get(result_type); + vec4_type.vecsize = 4; + set(tmp_id + 1, vec4_type); + } + + vec4_temporary_id = tmp_id; + } + + if (check_discard) + { + if (is_atomic_compare_exchange_strong) + { + // We're already emitting a CAS loop here; a conditional won't hurt. + emit_uninitialized_temporary_expression(result_type, result_id); + if (vec4_temporary_id) + emit_uninitialized_temporary_expression(vec4_temporary_id + 1, vec4_temporary_id); + statement("if (!", builtin_to_glsl(BuiltInHelperInvocation, StorageClassInput), ")"); + begin_scope(); + } + else + exp = join("(!", builtin_to_glsl(BuiltInHelperInvocation, StorageClassInput), " ? "); + } + + if (use_native_image_atomic) + { + auto obj_expression = to_expression(obj); + auto split_index = obj_expression.find_first_of('@'); + bool needs_reinterpret = opcode == OpAtomicUMax || opcode == OpAtomicUMin || opcode == OpAtomicSMax || opcode == OpAtomicSMin; + needs_reinterpret &= type.basetype != expected_type; + SPIRVariable *backing_var = nullptr; + + // Try to avoid waiting until not force recompile later mode to enable force recompile later + if (needs_reinterpret && (backing_var = maybe_get_backing_variable(obj))) + add_spv_func_and_recompile(SPVFuncImplTextureCast); + + // Will only be false if we're in "force recompile later" mode. + if (split_index != string::npos) + { + auto coord = obj_expression.substr(split_index + 1); + auto image_expr = obj_expression.substr(0, split_index); + + // Handle problem cases with sign where we need signed min/max on a uint image for example. + // It seems to work to cast the texture type itself, even if it is probably wildly outside of spec, + // but SPIR-V requires this to work. + if (needs_reinterpret && backing_var) + { + assert(spv_function_implementations.count(SPVFuncImplTextureCast) && "Should have been added above"); + + const auto *backing_type = &get(backing_var->basetype); + while (backing_type->op != OpTypeImage) + backing_type = &get(backing_type->parent_type); + + auto img_type = *backing_type; + auto tmp_type = type; + tmp_type.basetype = expected_type; + img_type.image.type = ir.increase_bound_by(1); + set(img_type.image.type, tmp_type); + + image_expr = join("spvTextureCast<", type_to_glsl(img_type, obj), ">(", image_expr, ")"); + } + + exp += join(image_expr, ".", op, "("); + if (ptr_type.storage == StorageClassImage && (res_type->image.arrayed || res_type->image.dim == DimCube)) + { + switch (res_type->image.dim) + { + case Dim1D: + if (msl_options.texture_1D_as_2D) + exp += join("uint2(", coord, ".x, 0), ", coord, ".y"); + else + exp += join(coord, ".x, ", coord, ".y"); + break; + case Dim2D: + exp += join(coord, ".xy, ", coord, ".z"); + break; + case DimCube: + if (!msl_options.supports_msl_version(4, 0)) + SPIRV_CROSS_THROW("Cannot do atomics on Cube textures before 4.0."); + + if (res_type->image.arrayed) + exp += join(coord, ".xy, ", coord, ".z % 6u, ", coord, ".z / 6u"); + else + exp += join(coord, ".xy, ", coord, ".z"); + break; + default: + SPIRV_CROSS_THROW("Cannot do atomics on unknown dimension."); + } + } + else if (ptr_type.storage == StorageClassImage && res_type->image.dim == Dim1D && msl_options.texture_1D_as_2D) + exp += join("uint2(", coord, ", 0)"); + else + exp += coord; + } + else + { + exp += obj_expression; + } + } + else + { + exp += string(op) + "_explicit("; + exp += "("; + // Emulate texture2D atomic operations + if (ptr_type.storage == StorageClassImage) + { + auto &flags = ir.get_decoration_bitset(var->self); + if (decoration_flags_signal_volatile(flags)) + exp += "volatile "; + exp += "device"; + } + else if (var && ptr_type.storage != StorageClassPhysicalStorageBuffer) + { + exp += get_variable_address_space(*var); + } + else + { + // Fallback scenario, could happen for raw pointers. + exp += ptr_type.storage == StorageClassWorkgroup ? "threadgroup" : "device"; + } + + exp += " atomic_"; + // For signed and unsigned min/max, we can signal this through the pointer type. + // There is no other way, since C++ does not have explicit signage for atomics. + exp += type_to_glsl(remapped_type); + exp += "*)"; + + exp += "&"; + exp += to_enclosed_expression(obj); + } + + if (is_atomic_compare_exchange_strong) + { + assert(strcmp(op, "atomic_compare_exchange_weak") == 0); + assert(op2); + assert(has_mem_order_2); + exp += ", &"; + exp += to_name(vec4_temporary_id ? vec4_temporary_id : result_id); + exp += ", "; + exp += to_expression(op2); + + if (!use_native_image_atomic) + { + exp += ", "; + exp += get_memory_order(mem_order_1); + exp += ", "; + exp += get_memory_order(mem_order_2); + } + exp += ")"; + + // MSL only supports the weak atomic compare exchange, so emit a CAS loop here. + // The MSL function returns false if the atomic write fails OR the comparison test fails, + // so we must validate that it wasn't the comparison test that failed before continuing + // the CAS loop, otherwise it will loop infinitely, with the comparison test always failing. + // The function updates the comparator value from the memory value, so the additional + // comparison test evaluates the memory value against the expected value. + if (!check_discard) + { + emit_uninitialized_temporary_expression(result_type, result_id); + if (vec4_temporary_id) + emit_uninitialized_temporary_expression(vec4_temporary_id + 1, vec4_temporary_id); + } + + statement("do"); + begin_scope(); + + string scalar_expression; + if (vec4_temporary_id) + scalar_expression = join(to_expression(vec4_temporary_id), ".x"); + else + scalar_expression = to_expression(result_id); + + statement(scalar_expression, " = ", to_expression(op1), ";"); + end_scope_decl(join("while (!", exp, " && ", scalar_expression, " == ", to_enclosed_expression(op1), ")")); + if (vec4_temporary_id) + statement(to_expression(result_id), " = ", scalar_expression, ";"); + + // Vulkan: (section 9.29: ... and values returned by atomic instructions in helper invocations are undefined) + if (check_discard) + { + end_scope(); + statement("else"); + begin_scope(); + statement(to_expression(result_id), " = {};"); + end_scope(); + } + } + else + { + assert(strcmp(op, "atomic_compare_exchange_weak") != 0); + + if (op1) + { + exp += ", "; + if (op1_is_literal) + exp += to_string(op1); + else + exp += bitcast_expression(expected_type, op1); + } + + if (op2) + exp += ", " + to_expression(op2); + + if (!use_native_image_atomic) + { + exp += string(", ") + get_memory_order(mem_order_1); + if (has_mem_order_2) + exp += string(", ") + get_memory_order(mem_order_2); + } + + exp += ")"; + + // For some particular reason, atomics return vec4 in Metal ... + if (use_native_image_atomic) + exp += ".x"; + + // Vulkan: (section 9.29: ... and values returned by atomic instructions in helper invocations are undefined) + if (check_discard) + { + exp += " : "; + if (strcmp(op, "atomic_store") != 0) + exp += join(type_to_glsl(get(result_type)), "{}"); + else + exp += "((void)0)"; + exp += ")"; + } + + if (expected_type != type.basetype) + exp = bitcast_expression(type, expected_type, exp); + + if (strcmp(op, "atomic_store") != 0) + emit_op(result_type, result_id, exp, false); + else + statement(exp, ";"); + } + + flush_all_atomic_capable_variables(); +} + +// Metal only supports relaxed memory order for now +const char *CompilerMSL::get_memory_order(uint32_t) +{ + return "memory_order_relaxed"; +} + +// Override for MSL-specific extension syntax instructions. +// In some cases, deliberately select either the fast or precise versions of the MSL functions to match Vulkan math precision results. +void CompilerMSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, const uint32_t *args, uint32_t count) +{ + auto op = static_cast(eop); + + // If we need to do implicit bitcasts, make sure we do it with the correct type. + uint32_t integer_width = get_integer_width_for_glsl_instruction(op, args, count); + auto int_type = to_signed_basetype(integer_width); + auto uint_type = to_unsigned_basetype(integer_width); + + op = get_remapped_glsl_op(op); + + auto &restype = get(result_type); + + // Only precise:: preserves NaN in trancendentals (supposedly, cannot find documentation for this). + const auto drop_nan_inf = FPFastMathModeNotInfMask | FPFastMathModeNotNaNMask; + bool preserve_nan = (get_fp_fast_math_flags_for_op(result_type, id) & drop_nan_inf) != drop_nan_inf; + const char *preserve_str = preserve_nan ? "precise" : "fast"; + + // TODO: Emit the default behavior to match existing code. Might need to be revisited. + // Only fp32 has the precise:: override. +#define EMIT_PRECISE_OVERRIDE(glsl_op, op) \ + case GLSLstd450##glsl_op: \ + if (restype.basetype == SPIRType::Float && preserve_nan) \ + emit_unary_func_op(result_type, id, args[0], "precise::" op); \ + else \ + CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); \ + break + + switch (op) + { + EMIT_PRECISE_OVERRIDE(Cos, "cos"); + EMIT_PRECISE_OVERRIDE(Sin, "sin"); + EMIT_PRECISE_OVERRIDE(Tan, "tan"); + EMIT_PRECISE_OVERRIDE(Acos, "acos"); + EMIT_PRECISE_OVERRIDE(Asin, "asin"); + EMIT_PRECISE_OVERRIDE(Atan, "atan"); + EMIT_PRECISE_OVERRIDE(Exp, "exp"); + EMIT_PRECISE_OVERRIDE(Exp2, "exp2"); + EMIT_PRECISE_OVERRIDE(Log, "log"); + EMIT_PRECISE_OVERRIDE(Log2, "log2"); + EMIT_PRECISE_OVERRIDE(Sqrt, "sqrt"); +#undef EMIT_PRECISE_OVERRIDE + + case GLSLstd450Sinh: + if (restype.basetype == SPIRType::Half) + { + auto ftype = restype; + ftype.basetype = SPIRType::Float; + + // MSL does not have overload for half. Force-cast back to half. + auto expr = join(type_to_glsl(restype), "(", preserve_str, "::sinh(", type_to_glsl(ftype), "(", to_unpacked_expression(args[0]), ")))"); + emit_op(result_type, id, expr, should_forward(args[0])); + inherit_expression_dependencies(id, args[0]); + } + else if (preserve_nan) + emit_unary_func_op(result_type, id, args[0], "precise::sinh"); + else + emit_unary_func_op(result_type, id, args[0], "fast::sinh"); + break; + case GLSLstd450Cosh: + if (restype.basetype == SPIRType::Half) + { + auto ftype = restype; + ftype.basetype = SPIRType::Float; + + // MSL does not have overload for half. Force-cast back to half. + auto expr = join(type_to_glsl(restype), "(", preserve_str, "::cosh(", type_to_glsl(ftype), "(", to_unpacked_expression(args[0]), ")))"); + emit_op(result_type, id, expr, should_forward(args[0])); + inherit_expression_dependencies(id, args[0]); + } + else if (preserve_nan) + emit_unary_func_op(result_type, id, args[0], "precise::cosh"); + else + emit_unary_func_op(result_type, id, args[0], "fast::cosh"); + break; + case GLSLstd450Tanh: + if (restype.basetype == SPIRType::Half) + { + auto ftype = restype; + ftype.basetype = SPIRType::Float; + + // MSL does not have overload for half. Force-cast back to half. + auto expr = join(type_to_glsl(restype), "(", preserve_str, "::tanh(", type_to_glsl(ftype), "(", to_unpacked_expression(args[0]), ")))"); + emit_op(result_type, id, expr, should_forward(args[0])); + inherit_expression_dependencies(id, args[0]); + } + else + emit_unary_func_op(result_type, id, args[0], "precise::tanh"); + break; + case GLSLstd450Atan2: + if (restype.basetype == SPIRType::Half) + { + // MSL does not have overload for half. Force-cast back to half. + auto ftype = restype; + ftype.basetype = SPIRType::Float; + + auto expr = join(type_to_glsl(restype), + "(", preserve_str, "::atan2(", + type_to_glsl(ftype), "(", to_unpacked_expression(args[0]), "), ", + type_to_glsl(ftype), "(", to_unpacked_expression(args[1]), ")))"); + emit_op(result_type, id, expr, should_forward(args[0]) && should_forward(args[1])); + inherit_expression_dependencies(id, args[0]); + inherit_expression_dependencies(id, args[1]); + } + else + emit_binary_func_op(result_type, id, args[0], args[1], "precise::atan2"); + break; + case GLSLstd450InverseSqrt: + if (restype.basetype == SPIRType::Float && preserve_nan) + emit_unary_func_op(result_type, id, args[0], "precise::rsqrt"); + else + emit_unary_func_op(result_type, id, args[0], "rsqrt"); + break; + case GLSLstd450RoundEven: + emit_unary_func_op(result_type, id, args[0], "rint"); + break; + + case GLSLstd450FindILsb: + { + // In this template version of findLSB, we return T. + auto basetype = expression_type(args[0]).basetype; + emit_unary_func_op_cast(result_type, id, args[0], "spvFindLSB", basetype, basetype); + break; + } + + case GLSLstd450FindSMsb: + emit_unary_func_op_cast(result_type, id, args[0], "spvFindSMSB", int_type, int_type); + break; + + case GLSLstd450FindUMsb: + emit_unary_func_op_cast(result_type, id, args[0], "spvFindUMSB", uint_type, uint_type); + break; + + case GLSLstd450PackSnorm4x8: + emit_unary_func_op(result_type, id, args[0], "pack_float_to_snorm4x8"); + break; + case GLSLstd450PackUnorm4x8: + emit_unary_func_op(result_type, id, args[0], "pack_float_to_unorm4x8"); + break; + case GLSLstd450PackSnorm2x16: + emit_unary_func_op(result_type, id, args[0], "pack_float_to_snorm2x16"); + break; + case GLSLstd450PackUnorm2x16: + emit_unary_func_op(result_type, id, args[0], "pack_float_to_unorm2x16"); + break; + + case GLSLstd450PackHalf2x16: + { + auto expr = join("as_type(half2(", to_expression(args[0]), "))"); + emit_op(result_type, id, expr, should_forward(args[0])); + inherit_expression_dependencies(id, args[0]); + break; + } + + case GLSLstd450UnpackSnorm4x8: + emit_unary_func_op(result_type, id, args[0], "unpack_snorm4x8_to_float"); + break; + case GLSLstd450UnpackUnorm4x8: + emit_unary_func_op(result_type, id, args[0], "unpack_unorm4x8_to_float"); + break; + case GLSLstd450UnpackSnorm2x16: + emit_unary_func_op(result_type, id, args[0], "unpack_snorm2x16_to_float"); + break; + case GLSLstd450UnpackUnorm2x16: + emit_unary_func_op(result_type, id, args[0], "unpack_unorm2x16_to_float"); + break; + + case GLSLstd450UnpackHalf2x16: + { + auto expr = join("float2(as_type(", to_expression(args[0]), "))"); + emit_op(result_type, id, expr, should_forward(args[0])); + inherit_expression_dependencies(id, args[0]); + break; + } + + case GLSLstd450PackDouble2x32: + emit_unary_func_op(result_type, id, args[0], "unsupported_GLSLstd450PackDouble2x32"); // Currently unsupported + break; + case GLSLstd450UnpackDouble2x32: + emit_unary_func_op(result_type, id, args[0], "unsupported_GLSLstd450UnpackDouble2x32"); // Currently unsupported + break; + + case GLSLstd450MatrixInverse: + { + auto &mat_type = get(result_type); + switch (mat_type.columns) + { + case 2: + emit_unary_func_op(result_type, id, args[0], "spvInverse2x2"); + break; + case 3: + emit_unary_func_op(result_type, id, args[0], "spvInverse3x3"); + break; + case 4: + emit_unary_func_op(result_type, id, args[0], "spvInverse4x4"); + break; + default: + break; + } + break; + } + + case GLSLstd450FMin: + // If the result type isn't float, don't bother calling the specific + // precise::/fast:: version. Metal doesn't have those for half and + // double types. + if (get(result_type).basetype != SPIRType::Float) + emit_binary_func_op(result_type, id, args[0], args[1], "min"); + else + emit_binary_func_op(result_type, id, args[0], args[1], "fast::min"); + break; + + case GLSLstd450FMax: + if (get(result_type).basetype != SPIRType::Float) + emit_binary_func_op(result_type, id, args[0], args[1], "max"); + else + emit_binary_func_op(result_type, id, args[0], args[1], "fast::max"); + break; + + case GLSLstd450FClamp: + // TODO: If args[1] is 0 and args[2] is 1, emit a saturate() call. + if (get(result_type).basetype != SPIRType::Float) + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "clamp"); + else + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "fast::clamp"); + break; + + case GLSLstd450NMin: + if (get(result_type).basetype != SPIRType::Float) + emit_binary_func_op(result_type, id, args[0], args[1], "min"); + else + emit_binary_func_op(result_type, id, args[0], args[1], "precise::min"); + break; + + case GLSLstd450NMax: + if (get(result_type).basetype != SPIRType::Float) + emit_binary_func_op(result_type, id, args[0], args[1], "max"); + else + emit_binary_func_op(result_type, id, args[0], args[1], "precise::max"); + break; + + case GLSLstd450NClamp: + // TODO: If args[1] is 0 and args[2] is 1, emit a saturate() call. + if (get(result_type).basetype != SPIRType::Float) + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "clamp"); + else + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "precise::clamp"); + break; + + case GLSLstd450InterpolateAtCentroid: + { + // We can't just emit the expression normally, because the qualified name contains a call to the default + // interpolate method, or refers to a local variable. We saved the interface index we need; use it to construct + // the base for the method call. + uint32_t interface_index = get_extended_decoration(args[0], SPIRVCrossDecorationInterfaceMemberIndex); + string component; + if (has_extended_decoration(args[0], SPIRVCrossDecorationInterpolantComponentExpr)) + { + uint32_t index_expr = get_extended_decoration(args[0], SPIRVCrossDecorationInterpolantComponentExpr); + auto *c = maybe_get(index_expr); + if (!c || c->specialization) + component = join("[", to_expression(index_expr), "]"); + else + component = join(".", index_to_swizzle(c->scalar())); + } + emit_op(result_type, id, + join(to_name(stage_in_var_id), ".", to_member_name(get_stage_in_struct_type(), interface_index), + ".interpolate_at_centroid()", component), + should_forward(args[0])); + break; + } + + case GLSLstd450InterpolateAtSample: + { + uint32_t interface_index = get_extended_decoration(args[0], SPIRVCrossDecorationInterfaceMemberIndex); + string component; + if (has_extended_decoration(args[0], SPIRVCrossDecorationInterpolantComponentExpr)) + { + uint32_t index_expr = get_extended_decoration(args[0], SPIRVCrossDecorationInterpolantComponentExpr); + auto *c = maybe_get(index_expr); + if (!c || c->specialization) + component = join("[", to_expression(index_expr), "]"); + else + component = join(".", index_to_swizzle(c->scalar())); + } + emit_op(result_type, id, + join(to_name(stage_in_var_id), ".", to_member_name(get_stage_in_struct_type(), interface_index), + ".interpolate_at_sample(", to_expression(args[1]), ")", component), + should_forward(args[0]) && should_forward(args[1])); + break; + } + + case GLSLstd450InterpolateAtOffset: + { + uint32_t interface_index = get_extended_decoration(args[0], SPIRVCrossDecorationInterfaceMemberIndex); + string component; + if (has_extended_decoration(args[0], SPIRVCrossDecorationInterpolantComponentExpr)) + { + uint32_t index_expr = get_extended_decoration(args[0], SPIRVCrossDecorationInterpolantComponentExpr); + auto *c = maybe_get(index_expr); + if (!c || c->specialization) + component = join("[", to_expression(index_expr), "]"); + else + component = join(".", index_to_swizzle(c->scalar())); + } + // Like Direct3D, Metal puts the (0, 0) at the upper-left corner, not the center as SPIR-V and GLSL do. + // Offset the offset by (1/2 - 1/16), or 0.4375, to compensate for this. + // It has to be (1/2 - 1/16) and not 1/2, or several CTS tests subtly break on Intel. + emit_op(result_type, id, + join(to_name(stage_in_var_id), ".", to_member_name(get_stage_in_struct_type(), interface_index), + ".interpolate_at_offset(", to_expression(args[1]), " + 0.4375)", component), + should_forward(args[0]) && should_forward(args[1])); + break; + } + + case GLSLstd450Distance: + // MSL does not support scalar versions here. + if (expression_type(args[0]).vecsize == 1) + { + // Equivalent to length(a - b) -> abs(a - b). + emit_op(result_type, id, + join("abs(", to_enclosed_unpacked_expression(args[0]), " - ", + to_enclosed_unpacked_expression(args[1]), ")"), + should_forward(args[0]) && should_forward(args[1])); + inherit_expression_dependencies(id, args[0]); + inherit_expression_dependencies(id, args[1]); + } + else + CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); + break; + + case GLSLstd450Length: + // MSL does not support scalar versions, so use abs(). + if (expression_type(args[0]).vecsize == 1) + emit_unary_func_op(result_type, id, args[0], "abs"); + else + CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); + break; + + case GLSLstd450Normalize: + { + auto &exp_type = expression_type(args[0]); + // MSL does not support scalar versions here. + // MSL has no implementation for normalize in the fast:: namespace for half + // Returns -1 or 1 for valid input, sign() does the job. + + // precise::normalize asm looks ridiculous. + // Don't think this actually matters unless proven otherwise. + if (exp_type.vecsize == 1) + emit_unary_func_op(result_type, id, args[0], "sign"); + else if (exp_type.basetype == SPIRType::Half) + emit_unary_func_op(result_type, id, args[0], "normalize"); + else + emit_unary_func_op(result_type, id, args[0], "fast::normalize"); + break; + } + case GLSLstd450Reflect: + if (get(result_type).vecsize == 1) + emit_binary_func_op(result_type, id, args[0], args[1], "spvReflect"); + else + CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); + break; + + case GLSLstd450Refract: + if (get(result_type).vecsize == 1) + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "spvRefract"); + else + CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); + break; + + case GLSLstd450FaceForward: + if (get(result_type).vecsize == 1) + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "spvFaceForward"); + else + CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); + break; + + case GLSLstd450Modf: + case GLSLstd450Frexp: + { + // Special case. If the variable is a scalar access chain, we cannot use it directly. We have to emit a temporary. + // Another special case is if the variable is in a storage class which is not thread. + auto *ptr = maybe_get(args[1]); + auto &type = expression_type(args[1]); + + bool is_thread_storage = storage_class_array_is_thread(type.storage); + if (type.storage == StorageClassOutput && capture_output_to_buffer) + is_thread_storage = false; + + if (!is_thread_storage || + (ptr && ptr->access_chain && is_scalar(expression_type(args[1])))) + { + register_call_out_argument(args[1]); + forced_temporaries.insert(id); + + // Need to create temporaries and copy over to access chain after. + // We cannot directly take the reference of a vector swizzle in MSL, even if it's scalar ... + uint32_t &tmp_id = extra_sub_expressions[id]; + if (!tmp_id) + tmp_id = ir.increase_bound_by(1); + + uint32_t tmp_type_id = get_pointee_type_id(expression_type_id(args[1])); + emit_uninitialized_temporary_expression(tmp_type_id, tmp_id); + emit_binary_func_op(result_type, id, args[0], tmp_id, eop == GLSLstd450Modf ? "modf" : "frexp"); + statement(to_expression(args[1]), " = ", to_expression(tmp_id), ";"); + } + else + CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); + break; + } + + case GLSLstd450Pow: + // powr makes x < 0.0 undefined, just like SPIR-V. + if (restype.basetype == SPIRType::Float && preserve_nan) + emit_binary_func_op(result_type, id, args[0], args[1], "precise::powr"); + else + emit_binary_func_op(result_type, id, args[0], args[1], "powr"); + break; + + default: + CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); + break; + } +} + +void CompilerMSL::emit_spv_amd_shader_trinary_minmax_op(uint32_t result_type, uint32_t id, uint32_t eop, + const uint32_t *args, uint32_t count) +{ + enum AMDShaderTrinaryMinMax + { + FMin3AMD = 1, + UMin3AMD = 2, + SMin3AMD = 3, + FMax3AMD = 4, + UMax3AMD = 5, + SMax3AMD = 6, + FMid3AMD = 7, + UMid3AMD = 8, + SMid3AMD = 9 + }; + + if (!msl_options.supports_msl_version(2, 1)) + SPIRV_CROSS_THROW("Trinary min/max functions require MSL 2.1."); + + auto op = static_cast(eop); + + switch (op) + { + case FMid3AMD: + case UMid3AMD: + case SMid3AMD: + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "median3"); + break; + default: + CompilerGLSL::emit_spv_amd_shader_trinary_minmax_op(result_type, id, eop, args, count); + break; + } +} + +// Emit a structure declaration for the specified interface variable. +void CompilerMSL::emit_interface_block(uint32_t ib_var_id) +{ + if (ib_var_id) + { + auto &ib_var = get(ib_var_id); + auto &ib_type = get_variable_data_type(ib_var); + //assert(ib_type.basetype == SPIRType::Struct && !ib_type.member_types.empty()); + assert(ib_type.basetype == SPIRType::Struct); + emit_struct(ib_type); + } +} + +// Emits the declaration signature of the specified function. +// If this is the entry point function, Metal-specific return value and function arguments are added. +void CompilerMSL::emit_function_prototype(SPIRFunction &func, const Bitset &) +{ + if (func.self != ir.default_entry_point) + add_function_overload(func); + + local_variable_names = resource_names; + string decl; + + processing_entry_point = func.self == ir.default_entry_point; + + // Metal helper functions must be static force-inline otherwise they will cause problems when linked together in a single Metallib. + if (!processing_entry_point) + statement(force_inline); + + auto &type = get(func.return_type); + + if (!type.array.empty() && msl_options.force_native_arrays) + { + // We cannot return native arrays in MSL, so "return" through an out variable. + decl += "void"; + } + else + { + decl += func_type_decl(type); + } + + decl += " "; + decl += to_name(func.self); + decl += "("; + + if (!type.array.empty() && msl_options.force_native_arrays) + { + // Fake arrays returns by writing to an out array instead. + decl += "thread "; + decl += type_to_glsl(type); + decl += " (&spvReturnValue)"; + decl += type_to_array_glsl(type, 0); + if (!func.arguments.empty()) + decl += ", "; + } + + if (processing_entry_point) + { + if (msl_options.argument_buffers) + decl += entry_point_args_argument_buffer(!func.arguments.empty()); + else + decl += entry_point_args_classic(!func.arguments.empty()); + + // append entry point args to avoid conflicts in local variable names. + local_variable_names.insert(resource_names.begin(), resource_names.end()); + + // If entry point function has variables that require early declaration, + // ensure they each have an empty initializer, creating one if needed. + // This is done at this late stage because the initialization expression + // is cleared after each compilation pass. + for (auto var_id : vars_needing_early_declaration) + { + auto &ed_var = get(var_id); + ID &initializer = ed_var.initializer; + if (!initializer) + initializer = ir.increase_bound_by(1); + + // Do not override proper initializers. + if (ir.ids[initializer].get_type() == TypeNone || ir.ids[initializer].get_type() == TypeExpression) + set(ed_var.initializer, "{}", ed_var.basetype, true); + } + + // add `taskPayloadSharedEXT` variable to entry-point arguments + for (auto &v : func.local_variables) + { + auto &var = get(v); + if (var.storage != StorageClassTaskPayloadWorkgroupEXT) + continue; + + add_local_variable_name(v); + SPIRFunction::Parameter arg = {}; + arg.id = v; + arg.type = var.basetype; + arg.alias_global_variable = true; + decl += join(", ", argument_decl(arg), " [[payload]]"); + } + } + + for (auto &arg : func.arguments) + { + uint32_t name_id = arg.id; + + auto *var = maybe_get(arg.id); + if (var) + { + // If we need to modify the name of the variable, make sure we modify the original variable. + // Our alias is just a shadow variable. + if (arg.alias_global_variable && var->basevariable) + name_id = var->basevariable; + + var->parameter = &arg; // Hold a pointer to the parameter so we can invalidate the readonly field if needed. + } + + add_local_variable_name(name_id); + + decl += argument_decl(arg); + + bool is_dynamic_img_sampler = has_extended_decoration(arg.id, SPIRVCrossDecorationDynamicImageSampler); + + auto &arg_type = get(arg.type); + if (arg_type.basetype == SPIRType::SampledImage && !is_dynamic_img_sampler) + { + // Manufacture automatic plane args for multiplanar texture + uint32_t planes = 1; + if (auto *constexpr_sampler = find_constexpr_sampler(name_id)) + if (constexpr_sampler->ycbcr_conversion_enable) + planes = constexpr_sampler->planes; + for (uint32_t i = 1; i < planes; i++) + decl += join(", ", argument_decl(arg), plane_name_suffix, i); + + // Manufacture automatic sampler arg for SampledImage texture + if (arg_type.image.dim != DimBuffer) + { + if (arg_type.array.empty() || (var ? is_var_runtime_size_array(*var) : is_runtime_size_array(arg_type))) + { + decl += join(", ", sampler_type(arg_type, arg.id, false), " ", to_sampler_expression(name_id)); + } + else + { + const char *sampler_address_space = + descriptor_address_space(name_id, + StorageClassUniformConstant, + "thread const"); + decl += join(", ", sampler_address_space, " ", sampler_type(arg_type, name_id, false), "& ", + to_sampler_expression(name_id)); + } + } + } + + // Manufacture automatic swizzle arg. + if (msl_options.swizzle_texture_samples && has_sampled_images && is_sampled_image_type(arg_type) && + !is_dynamic_img_sampler) + { + bool arg_is_array = !arg_type.array.empty(); + decl += join(", constant uint", arg_is_array ? "* " : "& ", to_swizzle_expression(name_id)); + } + + if (buffer_requires_array_length(name_id)) + { + bool arg_is_array = !arg_type.array.empty(); + decl += join(", constant uint", arg_is_array ? "* " : "& ", to_buffer_size_expression(name_id)); + } + + if (&arg != &func.arguments.back()) + decl += ", "; + } + + decl += ")"; + statement(decl); +} + +static bool needs_chroma_reconstruction(const MSLConstexprSampler *constexpr_sampler) +{ + // For now, only multiplanar images need explicit reconstruction. GBGR and BGRG images + // use implicit reconstruction. + return constexpr_sampler && constexpr_sampler->ycbcr_conversion_enable && constexpr_sampler->planes > 1; +} + +// Returns the texture sampling function string for the specified image and sampling characteristics. +string CompilerMSL::to_function_name(const TextureFunctionNameArguments &args) +{ + VariableID img = args.base.img; + const MSLConstexprSampler *constexpr_sampler = nullptr; + bool is_dynamic_img_sampler = false; + if (auto *var = maybe_get_backing_variable(img)) + { + constexpr_sampler = find_constexpr_sampler(var->basevariable ? var->basevariable : VariableID(var->self)); + is_dynamic_img_sampler = has_extended_decoration(var->self, SPIRVCrossDecorationDynamicImageSampler); + } + + // Special-case gather. We have to alter the component being looked up in the swizzle case. + if (msl_options.swizzle_texture_samples && args.base.is_gather && !is_dynamic_img_sampler && + (!constexpr_sampler || !constexpr_sampler->ycbcr_conversion_enable)) + { + bool is_compare = comparison_ids.count(img); + add_spv_func_and_recompile(is_compare ? SPVFuncImplGatherCompareSwizzle : SPVFuncImplGatherSwizzle); + return is_compare ? "spvGatherCompareSwizzle" : "spvGatherSwizzle"; + } + + // Special-case gather with an array of offsets. We have to lower into 4 separate gathers. + if (args.has_array_offsets && !is_dynamic_img_sampler && + (!constexpr_sampler || !constexpr_sampler->ycbcr_conversion_enable)) + { + bool is_compare = comparison_ids.count(img); + add_spv_func_and_recompile(is_compare ? SPVFuncImplGatherCompareConstOffsets : SPVFuncImplGatherConstOffsets); + return is_compare ? "spvGatherCompareConstOffsets" : "spvGatherConstOffsets"; + } + + auto *combined = maybe_get(img); + + // Texture reference + string fname; + if (needs_chroma_reconstruction(constexpr_sampler) && !is_dynamic_img_sampler) + { + if (constexpr_sampler->planes != 2 && constexpr_sampler->planes != 3) + SPIRV_CROSS_THROW("Unhandled number of color image planes!"); + // 444 images aren't downsampled, so we don't need to do linear filtering. + if (constexpr_sampler->resolution == MSL_FORMAT_RESOLUTION_444 || + constexpr_sampler->chroma_filter == MSL_SAMPLER_FILTER_NEAREST) + { + if (constexpr_sampler->planes == 2) + add_spv_func_and_recompile(SPVFuncImplChromaReconstructNearest2Plane); + else + add_spv_func_and_recompile(SPVFuncImplChromaReconstructNearest3Plane); + fname = "spvChromaReconstructNearest"; + } + else // Linear with a downsampled format + { + fname = "spvChromaReconstructLinear"; + switch (constexpr_sampler->resolution) + { + case MSL_FORMAT_RESOLUTION_444: + assert(false); + break; // not reached + case MSL_FORMAT_RESOLUTION_422: + switch (constexpr_sampler->x_chroma_offset) + { + case MSL_CHROMA_LOCATION_COSITED_EVEN: + if (constexpr_sampler->planes == 2) + add_spv_func_and_recompile(SPVFuncImplChromaReconstructLinear422CositedEven2Plane); + else + add_spv_func_and_recompile(SPVFuncImplChromaReconstructLinear422CositedEven3Plane); + fname += "422CositedEven"; + break; + case MSL_CHROMA_LOCATION_MIDPOINT: + if (constexpr_sampler->planes == 2) + add_spv_func_and_recompile(SPVFuncImplChromaReconstructLinear422Midpoint2Plane); + else + add_spv_func_and_recompile(SPVFuncImplChromaReconstructLinear422Midpoint3Plane); + fname += "422Midpoint"; + break; + default: + SPIRV_CROSS_THROW("Invalid chroma location."); + } + break; + case MSL_FORMAT_RESOLUTION_420: + fname += "420"; + switch (constexpr_sampler->x_chroma_offset) + { + case MSL_CHROMA_LOCATION_COSITED_EVEN: + switch (constexpr_sampler->y_chroma_offset) + { + case MSL_CHROMA_LOCATION_COSITED_EVEN: + if (constexpr_sampler->planes == 2) + add_spv_func_and_recompile( + SPVFuncImplChromaReconstructLinear420XCositedEvenYCositedEven2Plane); + else + add_spv_func_and_recompile( + SPVFuncImplChromaReconstructLinear420XCositedEvenYCositedEven3Plane); + fname += "XCositedEvenYCositedEven"; + break; + case MSL_CHROMA_LOCATION_MIDPOINT: + if (constexpr_sampler->planes == 2) + add_spv_func_and_recompile( + SPVFuncImplChromaReconstructLinear420XCositedEvenYMidpoint2Plane); + else + add_spv_func_and_recompile( + SPVFuncImplChromaReconstructLinear420XCositedEvenYMidpoint3Plane); + fname += "XCositedEvenYMidpoint"; + break; + default: + SPIRV_CROSS_THROW("Invalid Y chroma location."); + } + break; + case MSL_CHROMA_LOCATION_MIDPOINT: + switch (constexpr_sampler->y_chroma_offset) + { + case MSL_CHROMA_LOCATION_COSITED_EVEN: + if (constexpr_sampler->planes == 2) + add_spv_func_and_recompile( + SPVFuncImplChromaReconstructLinear420XMidpointYCositedEven2Plane); + else + add_spv_func_and_recompile( + SPVFuncImplChromaReconstructLinear420XMidpointYCositedEven3Plane); + fname += "XMidpointYCositedEven"; + break; + case MSL_CHROMA_LOCATION_MIDPOINT: + if (constexpr_sampler->planes == 2) + add_spv_func_and_recompile(SPVFuncImplChromaReconstructLinear420XMidpointYMidpoint2Plane); + else + add_spv_func_and_recompile(SPVFuncImplChromaReconstructLinear420XMidpointYMidpoint3Plane); + fname += "XMidpointYMidpoint"; + break; + default: + SPIRV_CROSS_THROW("Invalid Y chroma location."); + } + break; + default: + SPIRV_CROSS_THROW("Invalid X chroma location."); + } + break; + default: + SPIRV_CROSS_THROW("Invalid format resolution."); + } + } + } + else + { + fname = to_expression(combined ? combined->image : img) + "."; + + // Texture function and sampler + if (args.base.is_fetch) + fname += "read"; + else if (args.base.is_gather) + fname += "gather"; + else + fname += "sample"; + + if (args.has_dref) + fname += "_compare"; + } + + return fname; +} + +string CompilerMSL::convert_to_f32(const string &expr, uint32_t components) +{ + SPIRType t { components > 1 ? OpTypeVector : OpTypeFloat }; + t.basetype = SPIRType::Float; + t.vecsize = components; + t.columns = 1; + return join(type_to_glsl_constructor(t), "(", expr, ")"); +} + +static inline bool sampling_type_needs_f32_conversion(const SPIRType &type) +{ + // Double is not supported to begin with, but doesn't hurt to check for completion. + return type.basetype == SPIRType::Half || type.basetype == SPIRType::Double; +} + +// Returns the function args for a texture sampling function for the specified image and sampling characteristics. +string CompilerMSL::to_function_args(const TextureFunctionArguments &args, bool *p_forward) +{ + VariableID img = args.base.img; + auto &imgtype = *args.base.imgtype; + uint32_t lod = args.lod; + uint32_t grad_x = args.grad_x; + uint32_t grad_y = args.grad_y; + uint32_t bias = args.bias; + + const MSLConstexprSampler *constexpr_sampler = nullptr; + bool is_dynamic_img_sampler = false; + if (auto *var = maybe_get_backing_variable(img)) + { + constexpr_sampler = find_constexpr_sampler(var->basevariable ? var->basevariable : VariableID(var->self)); + is_dynamic_img_sampler = has_extended_decoration(var->self, SPIRVCrossDecorationDynamicImageSampler); + } + + string farg_str; + bool forward = true; + + if (!is_dynamic_img_sampler) + { + // Texture reference (for some cases) + if (needs_chroma_reconstruction(constexpr_sampler)) + { + // Multiplanar images need two or three textures. + farg_str += to_expression(img); + for (uint32_t i = 1; i < constexpr_sampler->planes; i++) + farg_str += join(", ", to_expression(img), plane_name_suffix, i); + } + else if ((!constexpr_sampler || !constexpr_sampler->ycbcr_conversion_enable) && + msl_options.swizzle_texture_samples && args.base.is_gather) + { + auto *combined = maybe_get(img); + farg_str += to_expression(combined ? combined->image : img); + } + + // Gathers with constant offsets call a special function, so include the texture. + if (args.has_array_offsets) + farg_str += to_expression(img); + + // Sampler reference + if (!args.base.is_fetch) + { + if (!farg_str.empty()) + farg_str += ", "; + farg_str += to_sampler_expression(img); + } + + if ((!constexpr_sampler || !constexpr_sampler->ycbcr_conversion_enable) && + msl_options.swizzle_texture_samples && args.base.is_gather) + { + // Add the swizzle constant from the swizzle buffer. + farg_str += ", " + to_swizzle_expression(img); + used_swizzle_buffer = true; + } + + // Const offsets gather puts the const offsets before the other args. + if (args.has_array_offsets) + { + forward = forward && should_forward(args.offset); + farg_str += ", " + to_unpacked_expression(args.offset); + } + + // Const offsets gather or swizzled gather puts the component before the other args. + if (args.component && (args.has_array_offsets || msl_options.swizzle_texture_samples)) + { + forward = forward && should_forward(args.component); + farg_str += ", " + to_component_argument(args.component); + } + } + + // Texture coordinates + forward = forward && should_forward(args.coord); + auto coord_expr = to_enclosed_unpacked_expression(args.coord); + auto &coord_type = expression_type(args.coord); + bool coord_is_fp = type_is_floating_point(coord_type); + bool is_cube_fetch = false; + + string tex_coords = coord_expr; + uint32_t alt_coord_component = 0; + + switch (imgtype.image.dim) + { + + case Dim1D: + if (coord_type.vecsize > 1) + tex_coords = enclose_expression(tex_coords) + ".x"; + + if (args.base.is_fetch) + tex_coords = "uint(" + round_fp_tex_coords(tex_coords, coord_is_fp) + ")"; + else if (sampling_type_needs_f32_conversion(coord_type)) + tex_coords = convert_to_f32(tex_coords, 1); + + if (msl_options.texture_1D_as_2D) + { + if (args.base.is_fetch) + tex_coords = "uint2(" + tex_coords + ", 0)"; + else + tex_coords = "float2(" + tex_coords + ", 0.5)"; + } + + alt_coord_component = 1; + break; + + case DimBuffer: + if (coord_type.vecsize > 1) + tex_coords = enclose_expression(tex_coords) + ".x"; + + if (msl_options.texture_buffer_native) + { + tex_coords = "uint(" + round_fp_tex_coords(tex_coords, coord_is_fp) + ")"; + } + else + { + // Metal texel buffer textures are 2D, so convert 1D coord to 2D. + // Support for Metal 2.1's new texture_buffer type. + if (args.base.is_fetch) + { + if (msl_options.texel_buffer_texture_width > 0) + { + tex_coords = "spvTexelBufferCoord(" + round_fp_tex_coords(tex_coords, coord_is_fp) + ")"; + } + else + { + tex_coords = "spvTexelBufferCoord(" + round_fp_tex_coords(tex_coords, coord_is_fp) + ", " + + to_expression(img) + ")"; + } + } + } + + alt_coord_component = 1; + break; + + case DimSubpassData: + // If we're using Metal's native frame-buffer fetch API for subpass inputs, + // this path will not be hit. + tex_coords = "uint2(gl_FragCoord.xy)"; + alt_coord_component = 2; + break; + + case Dim2D: + if (coord_type.vecsize > 2) + tex_coords = enclose_expression(tex_coords) + ".xy"; + + if (args.base.is_fetch) + tex_coords = "uint2(" + round_fp_tex_coords(tex_coords, coord_is_fp) + ")"; + else if (sampling_type_needs_f32_conversion(coord_type)) + tex_coords = convert_to_f32(tex_coords, 2); + + alt_coord_component = 2; + break; + + case Dim3D: + if (coord_type.vecsize > 3) + tex_coords = enclose_expression(tex_coords) + ".xyz"; + + if (args.base.is_fetch) + tex_coords = "uint3(" + round_fp_tex_coords(tex_coords, coord_is_fp) + ")"; + else if (sampling_type_needs_f32_conversion(coord_type)) + tex_coords = convert_to_f32(tex_coords, 3); + + alt_coord_component = 3; + break; + + case DimCube: + if (args.base.is_fetch) + { + is_cube_fetch = true; + tex_coords += ".xy"; + tex_coords = "uint2(" + round_fp_tex_coords(tex_coords, coord_is_fp) + ")"; + } + else + { + if (coord_type.vecsize > 3) + tex_coords = enclose_expression(tex_coords) + ".xyz"; + } + + if (sampling_type_needs_f32_conversion(coord_type)) + tex_coords = convert_to_f32(tex_coords, 3); + + alt_coord_component = 3; + break; + + default: + break; + } + + if (args.base.is_fetch && args.offset) + { + // Fetch offsets must be applied directly to the coordinate. + forward = forward && should_forward(args.offset); + auto &type = expression_type(args.offset); + if (imgtype.image.dim == Dim1D && msl_options.texture_1D_as_2D) + { + if (type.basetype != SPIRType::UInt) + tex_coords += join(" + uint2(", bitcast_expression(SPIRType::UInt, args.offset), ", 0)"); + else + tex_coords += join(" + uint2(", to_enclosed_unpacked_expression(args.offset), ", 0)"); + } + else + { + if (type.basetype != SPIRType::UInt) + tex_coords += " + " + bitcast_expression(SPIRType::UInt, args.offset); + else + tex_coords += " + " + to_enclosed_unpacked_expression(args.offset); + } + } + + // If projection, use alt coord as divisor + if (args.base.is_proj) + { + if (sampling_type_needs_f32_conversion(coord_type)) + tex_coords += " / " + convert_to_f32(to_extract_component_expression(args.coord, alt_coord_component), 1); + else + tex_coords += " / " + to_extract_component_expression(args.coord, alt_coord_component); + } + + if (!farg_str.empty()) + farg_str += ", "; + + if (imgtype.image.dim == DimCube && imgtype.image.arrayed && msl_options.emulate_cube_array) + { + farg_str += "spvCubemapTo2DArrayFace(" + tex_coords + ").xy"; + + if (is_cube_fetch) + farg_str += ", uint(" + to_extract_component_expression(args.coord, 2) + ")"; + else + farg_str += + ", uint(spvCubemapTo2DArrayFace(" + tex_coords + ").z) + (uint(" + + round_fp_tex_coords(to_extract_component_expression(args.coord, alt_coord_component), coord_is_fp) + + ") * 6u)"; + + add_spv_func_and_recompile(SPVFuncImplCubemapTo2DArrayFace); + } + else + { + farg_str += tex_coords; + + // If fetch from cube, add face explicitly + if (is_cube_fetch) + { + // Special case for cube arrays, face and layer are packed in one dimension. + if (imgtype.image.arrayed) + farg_str += ", uint(" + to_extract_component_expression(args.coord, 2) + ") % 6u"; + else + farg_str += + ", uint(" + round_fp_tex_coords(to_extract_component_expression(args.coord, 2), coord_is_fp) + ")"; + } + + // If array, use alt coord + if (imgtype.image.arrayed) + { + // Special case for cube arrays, face and layer are packed in one dimension. + if (imgtype.image.dim == DimCube && args.base.is_fetch) + { + farg_str += ", uint(" + to_extract_component_expression(args.coord, 2) + ") / 6u"; + } + else + { + farg_str += + ", uint(" + + round_fp_tex_coords(to_extract_component_expression(args.coord, alt_coord_component), coord_is_fp) + + ")"; + if (imgtype.image.dim == DimSubpassData) + { + if (msl_options.multiview) + farg_str += " + gl_ViewIndex"; + else if (msl_options.arrayed_subpass_input) + farg_str += " + gl_Layer"; + } + } + } + else if (imgtype.image.dim == DimSubpassData) + { + if (msl_options.multiview) + farg_str += ", gl_ViewIndex"; + else if (msl_options.arrayed_subpass_input) + farg_str += ", gl_Layer"; + } + } + + // Depth compare reference value + if (args.dref) + { + forward = forward && should_forward(args.dref); + farg_str += ", "; + + auto &dref_type = expression_type(args.dref); + + string dref_expr; + if (args.base.is_proj) + dref_expr = join(to_enclosed_unpacked_expression(args.dref), " / ", + to_extract_component_expression(args.coord, alt_coord_component)); + else + dref_expr = to_unpacked_expression(args.dref); + + if (sampling_type_needs_f32_conversion(dref_type)) + dref_expr = convert_to_f32(dref_expr, 1); + + farg_str += dref_expr; + + if (msl_options.is_macos() && (grad_x || grad_y)) + { + // For sample compare, MSL does not support gradient2d for all targets (only iOS apparently according to docs). + // However, the most common case here is to have a constant gradient of 0, as that is the only way to express + // LOD == 0 in GLSL with sampler2DArrayShadow (cascaded shadow mapping). + // We will detect a compile-time constant 0 value for gradient and promote that to level(0) on MSL. + bool constant_zero_x = !grad_x || expression_is_constant_null(grad_x); + bool constant_zero_y = !grad_y || expression_is_constant_null(grad_y); + if (constant_zero_x && constant_zero_y && + (!imgtype.image.arrayed || !msl_options.sample_dref_lod_array_as_grad)) + { + lod = 0; + grad_x = 0; + grad_y = 0; + farg_str += ", level(0)"; + } + else if (!msl_options.supports_msl_version(2, 3)) + { + SPIRV_CROSS_THROW("Using non-constant 0.0 gradient() qualifier for sample_compare. This is not " + "supported on macOS prior to MSL 2.3."); + } + } + + if (msl_options.is_macos() && bias) + { + // Bias is not supported either on macOS with sample_compare. + // Verify it is compile-time zero, and drop the argument. + if (expression_is_constant_null(bias)) + { + bias = 0; + } + else if (!msl_options.supports_msl_version(2, 3)) + { + SPIRV_CROSS_THROW("Using non-constant 0.0 bias() qualifier for sample_compare. This is not supported " + "on macOS prior to MSL 2.3."); + } + } + } + + // LOD Options + // Metal does not support LOD for 1D textures. + if (bias && (imgtype.image.dim != Dim1D || msl_options.texture_1D_as_2D)) + { + forward = forward && should_forward(bias); + farg_str += ", bias(" + to_unpacked_expression(bias) + ")"; + } + + // Metal does not support LOD for 1D textures. + if (lod && (imgtype.image.dim != Dim1D || msl_options.texture_1D_as_2D)) + { + forward = forward && should_forward(lod); + if (args.base.is_fetch) + { + farg_str += ", " + to_unpacked_expression(lod); + } + else if (msl_options.sample_dref_lod_array_as_grad && args.dref && imgtype.image.arrayed) + { + if (msl_options.is_macos() && !msl_options.supports_msl_version(2, 3)) + SPIRV_CROSS_THROW("Using non-constant 0.0 gradient() qualifier for sample_compare. This is not " + "supported on macOS prior to MSL 2.3."); + // Some Metal devices have a bug where the LoD is erroneously biased upward + // when using a level() argument. Since this doesn't happen as much with gradient2d(), + // if we perform the LoD calculation in reverse, we can pass a gradient + // instead. + // lod = log2(rhoMax/eta) -> exp2(lod) = rhoMax/eta + // If we make all of the scale factors the same, eta will be 1 and + // exp2(lod) = rho. + // rhoX = dP/dx * extent; rhoY = dP/dy * extent + // Therefore, dP/dx = dP/dy = exp2(lod)/extent. + // (Subtracting 0.5 before exponentiation gives better results.) + string grad_opt, extent, grad_coord; + VariableID base_img = img; + if (auto *combined = maybe_get(img)) + base_img = combined->image; + switch (imgtype.image.dim) + { + case Dim1D: + grad_opt = "gradient2d"; + extent = join("float2(", to_expression(base_img), ".get_width(), 1.0)"); + break; + case Dim2D: + grad_opt = "gradient2d"; + extent = join("float2(", to_expression(base_img), ".get_width(), ", to_expression(base_img), ".get_height())"); + break; + case DimCube: + if (imgtype.image.arrayed && msl_options.emulate_cube_array) + { + grad_opt = "gradient2d"; + extent = join("float2(", to_expression(base_img), ".get_width())"); + } + else + { + if (msl_options.agx_manual_cube_grad_fixup) + { + add_spv_func_and_recompile(SPVFuncImplGradientCube); + grad_opt = "spvGradientCube"; + grad_coord = tex_coords + ", "; + } + else + { + grad_opt = "gradientcube"; + } + extent = join("float3(", to_expression(base_img), ".get_width())"); + } + break; + default: + grad_opt = "unsupported_gradient_dimension"; + extent = "float3(1.0)"; + break; + } + farg_str += join(", ", grad_opt, "(", grad_coord, "exp2(", to_unpacked_expression(lod), " - 0.5) / ", extent, + ", exp2(", to_unpacked_expression(lod), " - 0.5) / ", extent, ")"); + } + else + { + farg_str += ", level(" + to_unpacked_expression(lod) + ")"; + } + } + else if (args.base.is_fetch && !lod && (imgtype.image.dim != Dim1D || msl_options.texture_1D_as_2D) && + imgtype.image.dim != DimBuffer && !imgtype.image.ms && imgtype.image.sampled != 2) + { + // Lod argument is optional in OpImageFetch, but we require a LOD value, pick 0 as the default. + // Check for sampled type as well, because is_fetch is also used for OpImageRead in MSL. + farg_str += ", 0"; + } + + // Metal does not support LOD for 1D textures. + if ((grad_x || grad_y) && (imgtype.image.dim != Dim1D || msl_options.texture_1D_as_2D)) + { + forward = forward && should_forward(grad_x); + forward = forward && should_forward(grad_y); + string grad_opt, grad_coord; + switch (imgtype.image.dim) + { + case Dim1D: + case Dim2D: + grad_opt = "gradient2d"; + break; + case Dim3D: + grad_opt = "gradient3d"; + break; + case DimCube: + if (imgtype.image.arrayed && msl_options.emulate_cube_array) + { + grad_opt = "gradient2d"; + } + else if (msl_options.agx_manual_cube_grad_fixup) + { + add_spv_func_and_recompile(SPVFuncImplGradientCube); + grad_opt = "spvGradientCube"; + grad_coord = tex_coords + ", "; + } + else + { + grad_opt = "gradientcube"; + } + break; + default: + grad_opt = "unsupported_gradient_dimension"; + break; + } + farg_str += join(", ", grad_opt, "(", grad_coord, to_unpacked_expression(grad_x), ", ", to_unpacked_expression(grad_y), ")"); + } + + if (args.min_lod) + { + if (!msl_options.supports_msl_version(2, 2)) + SPIRV_CROSS_THROW("min_lod_clamp() is only supported in MSL 2.2+ and up."); + + forward = forward && should_forward(args.min_lod); + farg_str += ", min_lod_clamp(" + to_unpacked_expression(args.min_lod) + ")"; + } + + // Add offsets + string offset_expr; + const SPIRType *offset_type = nullptr; + if (args.offset && !args.base.is_fetch && !args.has_array_offsets) + { + forward = forward && should_forward(args.offset); + offset_expr = to_unpacked_expression(args.offset); + offset_type = &expression_type(args.offset); + } + + if (!offset_expr.empty()) + { + switch (imgtype.image.dim) + { + case Dim1D: + if (!msl_options.texture_1D_as_2D) + break; + if (offset_type->vecsize > 1) + offset_expr = enclose_expression(offset_expr) + ".x"; + + farg_str += join(", int2(", offset_expr, ", 0)"); + break; + + case Dim2D: + if (offset_type->vecsize > 2) + offset_expr = enclose_expression(offset_expr) + ".xy"; + + farg_str += ", " + offset_expr; + break; + + case Dim3D: + if (offset_type->vecsize > 3) + offset_expr = enclose_expression(offset_expr) + ".xyz"; + + farg_str += ", " + offset_expr; + break; + + default: + break; + } + } + + if (args.component && !args.has_array_offsets) + { + // If 2D has gather component, ensure it also has an offset arg + if (imgtype.image.dim == Dim2D && offset_expr.empty()) + farg_str += ", int2(0)"; + + if (!msl_options.swizzle_texture_samples || is_dynamic_img_sampler) + { + forward = forward && should_forward(args.component); + + uint32_t image_var = 0; + if (const auto *combined = maybe_get(img)) + { + if (const auto *img_var = maybe_get_backing_variable(combined->image)) + image_var = img_var->self; + } + else if (const auto *var = maybe_get_backing_variable(img)) + { + image_var = var->self; + } + + if (image_var == 0 || !is_depth_image(expression_type(image_var), image_var)) + farg_str += ", " + to_component_argument(args.component); + } + } + + if (args.sample) + { + forward = forward && should_forward(args.sample); + farg_str += ", "; + farg_str += to_unpacked_expression(args.sample); + } + + *p_forward = forward; + + return farg_str; +} + +// If the texture coordinates are floating point, invokes MSL round() function to round them. +string CompilerMSL::round_fp_tex_coords(string tex_coords, bool coord_is_fp) +{ + return coord_is_fp ? ("rint(" + tex_coords + ")") : tex_coords; +} + +// Returns a string to use in an image sampling function argument. +// The ID must be a scalar constant. +string CompilerMSL::to_component_argument(uint32_t id) +{ + uint32_t component_index = evaluate_constant_u32(id); + switch (component_index) + { + case 0: + return "component::x"; + case 1: + return "component::y"; + case 2: + return "component::z"; + case 3: + return "component::w"; + + default: + SPIRV_CROSS_THROW("The value (" + to_string(component_index) + ") of OpConstant ID " + to_string(id) + + " is not a valid Component index, which must be one of 0, 1, 2, or 3."); + } +} + +// Establish sampled image as expression object and assign the sampler to it. +void CompilerMSL::emit_sampled_image_op(uint32_t result_type, uint32_t result_id, uint32_t image_id, uint32_t samp_id) +{ + set(result_id, result_type, image_id, samp_id); +} + +string CompilerMSL::to_texture_op(const Instruction &i, bool sparse, bool *forward, + SmallVector &inherited_expressions) +{ + auto *ops = stream(i); + uint32_t result_type_id = ops[0]; + uint32_t img = ops[2]; + auto &result_type = get(result_type_id); + auto op = static_cast(i.op); + bool is_gather = (op == OpImageGather || op == OpImageDrefGather); + + // Bypass pointers because we need the real image struct + auto &type = expression_type(img); + auto &imgtype = get(type.self); + + const MSLConstexprSampler *constexpr_sampler = nullptr; + bool is_dynamic_img_sampler = false; + if (auto *var = maybe_get_backing_variable(img)) + { + constexpr_sampler = find_constexpr_sampler(var->basevariable ? var->basevariable : VariableID(var->self)); + is_dynamic_img_sampler = has_extended_decoration(var->self, SPIRVCrossDecorationDynamicImageSampler); + } + + string expr; + if (constexpr_sampler && constexpr_sampler->ycbcr_conversion_enable && !is_dynamic_img_sampler) + { + // If this needs sampler Y'CbCr conversion, we need to do some additional + // processing. + switch (constexpr_sampler->ycbcr_model) + { + case MSL_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY: + case MSL_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY: + // Default + break; + case MSL_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_BT_709: + add_spv_func_and_recompile(SPVFuncImplConvertYCbCrBT709); + expr += "spvConvertYCbCrBT709("; + break; + case MSL_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_BT_601: + add_spv_func_and_recompile(SPVFuncImplConvertYCbCrBT601); + expr += "spvConvertYCbCrBT601("; + break; + case MSL_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_BT_2020: + add_spv_func_and_recompile(SPVFuncImplConvertYCbCrBT2020); + expr += "spvConvertYCbCrBT2020("; + break; + default: + SPIRV_CROSS_THROW("Invalid Y'CbCr model conversion."); + } + + if (constexpr_sampler->ycbcr_model != MSL_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY) + { + switch (constexpr_sampler->ycbcr_range) + { + case MSL_SAMPLER_YCBCR_RANGE_ITU_FULL: + add_spv_func_and_recompile(SPVFuncImplExpandITUFullRange); + expr += "spvExpandITUFullRange("; + break; + case MSL_SAMPLER_YCBCR_RANGE_ITU_NARROW: + add_spv_func_and_recompile(SPVFuncImplExpandITUNarrowRange); + expr += "spvExpandITUNarrowRange("; + break; + default: + SPIRV_CROSS_THROW("Invalid Y'CbCr range."); + } + } + } + else if (msl_options.swizzle_texture_samples && !is_gather && is_sampled_image_type(imgtype) && + !is_dynamic_img_sampler) + { + add_spv_func_and_recompile(SPVFuncImplTextureSwizzle); + expr += "spvTextureSwizzle("; + } + + string inner_expr = CompilerGLSL::to_texture_op(i, sparse, forward, inherited_expressions); + + if (constexpr_sampler && constexpr_sampler->ycbcr_conversion_enable && !is_dynamic_img_sampler) + { + if (!constexpr_sampler->swizzle_is_identity()) + { + static const char swizzle_names[] = "rgba"; + if (!constexpr_sampler->swizzle_has_one_or_zero()) + { + // If we can, do it inline. + expr += inner_expr + "."; + for (uint32_t c = 0; c < 4; c++) + { + switch (constexpr_sampler->swizzle[c]) + { + case MSL_COMPONENT_SWIZZLE_IDENTITY: + expr += swizzle_names[c]; + break; + case MSL_COMPONENT_SWIZZLE_R: + case MSL_COMPONENT_SWIZZLE_G: + case MSL_COMPONENT_SWIZZLE_B: + case MSL_COMPONENT_SWIZZLE_A: + expr += swizzle_names[constexpr_sampler->swizzle[c] - MSL_COMPONENT_SWIZZLE_R]; + break; + default: + SPIRV_CROSS_THROW("Invalid component swizzle."); + } + } + } + else + { + // Otherwise, we need to emit a temporary and swizzle that. + uint32_t temp_id = ir.increase_bound_by(1); + emit_op(result_type_id, temp_id, inner_expr, false); + for (auto &inherit : inherited_expressions) + inherit_expression_dependencies(temp_id, inherit); + inherited_expressions.clear(); + inherited_expressions.push_back(temp_id); + + switch (op) + { + case OpImageSampleDrefImplicitLod: + case OpImageSampleImplicitLod: + case OpImageSampleProjImplicitLod: + case OpImageSampleProjDrefImplicitLod: + register_control_dependent_expression(temp_id); + break; + + default: + break; + } + expr += type_to_glsl(result_type) + "("; + for (uint32_t c = 0; c < 4; c++) + { + switch (constexpr_sampler->swizzle[c]) + { + case MSL_COMPONENT_SWIZZLE_IDENTITY: + expr += to_expression(temp_id) + "." + swizzle_names[c]; + break; + case MSL_COMPONENT_SWIZZLE_ZERO: + expr += "0"; + break; + case MSL_COMPONENT_SWIZZLE_ONE: + expr += "1"; + break; + case MSL_COMPONENT_SWIZZLE_R: + case MSL_COMPONENT_SWIZZLE_G: + case MSL_COMPONENT_SWIZZLE_B: + case MSL_COMPONENT_SWIZZLE_A: + expr += to_expression(temp_id) + "." + + swizzle_names[constexpr_sampler->swizzle[c] - MSL_COMPONENT_SWIZZLE_R]; + break; + default: + SPIRV_CROSS_THROW("Invalid component swizzle."); + } + if (c < 3) + expr += ", "; + } + expr += ")"; + } + } + else + expr += inner_expr; + if (constexpr_sampler->ycbcr_model != MSL_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY) + { + expr += join(", ", constexpr_sampler->bpc, ")"); + if (constexpr_sampler->ycbcr_model != MSL_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY) + expr += ")"; + } + } + else + { + expr += inner_expr; + if (msl_options.swizzle_texture_samples && !is_gather && is_sampled_image_type(imgtype) && + !is_dynamic_img_sampler) + { + // Add the swizzle constant from the swizzle buffer. + expr += ", " + to_swizzle_expression(img) + ")"; + used_swizzle_buffer = true; + } + } + + return expr; +} + +static string create_swizzle(MSLComponentSwizzle swizzle) +{ + switch (swizzle) + { + case MSL_COMPONENT_SWIZZLE_IDENTITY: + return "spvSwizzle::none"; + case MSL_COMPONENT_SWIZZLE_ZERO: + return "spvSwizzle::zero"; + case MSL_COMPONENT_SWIZZLE_ONE: + return "spvSwizzle::one"; + case MSL_COMPONENT_SWIZZLE_R: + return "spvSwizzle::red"; + case MSL_COMPONENT_SWIZZLE_G: + return "spvSwizzle::green"; + case MSL_COMPONENT_SWIZZLE_B: + return "spvSwizzle::blue"; + case MSL_COMPONENT_SWIZZLE_A: + return "spvSwizzle::alpha"; + default: + SPIRV_CROSS_THROW("Invalid component swizzle."); + } +} + +// Returns a string representation of the ID, usable as a function arg. +// Manufacture automatic sampler arg for SampledImage texture. +string CompilerMSL::to_func_call_arg(const SPIRFunction::Parameter &arg, uint32_t id) +{ + string arg_str; + + auto &type = expression_type(id); + bool is_dynamic_img_sampler = has_extended_decoration(arg.id, SPIRVCrossDecorationDynamicImageSampler); + // If the argument *itself* is a "dynamic" combined-image sampler, then we can just pass that around. + bool arg_is_dynamic_img_sampler = has_extended_decoration(id, SPIRVCrossDecorationDynamicImageSampler); + if (is_dynamic_img_sampler && !arg_is_dynamic_img_sampler) + arg_str = join("spvDynamicImageSampler<", type_to_glsl(get(type.image.type)), ">("); + + auto *c = maybe_get(id); + if (msl_options.force_native_arrays && c && !get(c->constant_type).array.empty()) + { + // If we are passing a constant array directly to a function for some reason, + // the callee will expect an argument in thread const address space + // (since we can only bind to arrays with references in MSL). + // To resolve this, we must emit a copy in this address space. + // This kind of code gen should be rare enough that performance is not a real concern. + // Inline the SPIR-V to avoid this kind of suboptimal codegen. + // + // We risk calling this inside a continue block (invalid code), + // so just create a thread local copy in the current function. + arg_str = join("_", id, "_array_copy"); + auto &constants = current_function->constant_arrays_needed_on_stack; + auto itr = find(begin(constants), end(constants), ID(id)); + if (itr == end(constants)) + { + force_recompile(); + constants.push_back(id); + } + } + // Dereference pointer variables where needed. + // FIXME: This dereference is actually backwards. We should really just support passing pointer variables between functions. + else if (should_dereference_caller_param(id)) + arg_str += dereference_expression(type, CompilerGLSL::to_func_call_arg(arg, id)); + else + arg_str += CompilerGLSL::to_func_call_arg(arg, id); + + // Need to check the base variable in case we need to apply a qualified alias. + uint32_t var_id = 0; + auto *var = maybe_get(id); + if (var) + var_id = var->basevariable; + + if (!arg_is_dynamic_img_sampler) + { + auto *constexpr_sampler = find_constexpr_sampler(var_id ? var_id : id); + if (type.basetype == SPIRType::SampledImage) + { + // Manufacture automatic plane args for multiplanar texture + uint32_t planes = 1; + if (constexpr_sampler && constexpr_sampler->ycbcr_conversion_enable) + { + planes = constexpr_sampler->planes; + // If this parameter isn't aliasing a global, then we need to use + // the special "dynamic image-sampler" class to pass it--and we need + // to use it for *every* non-alias parameter, in case a combined + // image-sampler with a Y'CbCr conversion is passed. Hopefully, this + // pathological case is so rare that it should never be hit in practice. + if (!arg.alias_global_variable) + add_spv_func_and_recompile(SPVFuncImplDynamicImageSampler); + } + for (uint32_t i = 1; i < planes; i++) + arg_str += join(", ", CompilerGLSL::to_func_call_arg(arg, id), plane_name_suffix, i); + // Manufacture automatic sampler arg if the arg is a SampledImage texture. + if (type.image.dim != DimBuffer) + arg_str += ", " + to_sampler_expression(var_id ? var_id : id); + + // Add sampler Y'CbCr conversion info if we have it + if (is_dynamic_img_sampler && constexpr_sampler && constexpr_sampler->ycbcr_conversion_enable) + { + SmallVector samp_args; + + switch (constexpr_sampler->resolution) + { + case MSL_FORMAT_RESOLUTION_444: + // Default + break; + case MSL_FORMAT_RESOLUTION_422: + samp_args.push_back("spvFormatResolution::_422"); + break; + case MSL_FORMAT_RESOLUTION_420: + samp_args.push_back("spvFormatResolution::_420"); + break; + default: + SPIRV_CROSS_THROW("Invalid format resolution."); + } + + if (constexpr_sampler->chroma_filter != MSL_SAMPLER_FILTER_NEAREST) + samp_args.push_back("spvChromaFilter::linear"); + + if (constexpr_sampler->x_chroma_offset != MSL_CHROMA_LOCATION_COSITED_EVEN) + samp_args.push_back("spvXChromaLocation::midpoint"); + if (constexpr_sampler->y_chroma_offset != MSL_CHROMA_LOCATION_COSITED_EVEN) + samp_args.push_back("spvYChromaLocation::midpoint"); + switch (constexpr_sampler->ycbcr_model) + { + case MSL_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY: + // Default + break; + case MSL_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY: + samp_args.push_back("spvYCbCrModelConversion::ycbcr_identity"); + break; + case MSL_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_BT_709: + samp_args.push_back("spvYCbCrModelConversion::ycbcr_bt_709"); + break; + case MSL_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_BT_601: + samp_args.push_back("spvYCbCrModelConversion::ycbcr_bt_601"); + break; + case MSL_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_BT_2020: + samp_args.push_back("spvYCbCrModelConversion::ycbcr_bt_2020"); + break; + default: + SPIRV_CROSS_THROW("Invalid Y'CbCr model conversion."); + } + if (constexpr_sampler->ycbcr_range != MSL_SAMPLER_YCBCR_RANGE_ITU_FULL) + samp_args.push_back("spvYCbCrRange::itu_narrow"); + samp_args.push_back(join("spvComponentBits(", constexpr_sampler->bpc, ")")); + arg_str += join(", spvYCbCrSampler(", merge(samp_args), ")"); + } + } + + if (is_dynamic_img_sampler && constexpr_sampler && constexpr_sampler->ycbcr_conversion_enable) + arg_str += join(", (uint(", create_swizzle(constexpr_sampler->swizzle[3]), ") << 24) | (uint(", + create_swizzle(constexpr_sampler->swizzle[2]), ") << 16) | (uint(", + create_swizzle(constexpr_sampler->swizzle[1]), ") << 8) | uint(", + create_swizzle(constexpr_sampler->swizzle[0]), ")"); + else if (msl_options.swizzle_texture_samples && has_sampled_images && is_sampled_image_type(type)) + arg_str += ", " + to_swizzle_expression(var_id ? var_id : id); + + if (buffer_requires_array_length(var_id)) + arg_str += ", " + to_buffer_size_expression(var_id ? var_id : id); + + if (is_dynamic_img_sampler) + arg_str += ")"; + } + + // Emulate texture2D atomic operations + auto *backing_var = maybe_get_backing_variable(var_id); + if (backing_var && atomic_image_vars_emulated.count(backing_var->self)) + { + arg_str += ", " + to_expression(var_id) + "_atomic"; + } + + return arg_str; +} + +// If the ID represents a sampled image that has been assigned a sampler already, +// generate an expression for the sampler, otherwise generate a fake sampler name +// by appending a suffix to the expression constructed from the ID. +string CompilerMSL::to_sampler_expression(uint32_t id) +{ + auto *combined = maybe_get(id); + if (combined && combined->sampler) + return to_expression(combined->sampler); + + uint32_t expr_id = combined ? uint32_t(combined->image) : id; + + // Constexpr samplers are declared as local variables, + // so exclude any qualifier names on the image expression. + if (auto *var = maybe_get_backing_variable(expr_id)) + { + uint32_t img_id = var->basevariable ? var->basevariable : VariableID(var->self); + if (find_constexpr_sampler(img_id)) + return Compiler::to_name(img_id) + sampler_name_suffix; + } + + auto img_expr = to_expression(expr_id); + auto index = img_expr.find_first_of('['); + if (index == string::npos) + return img_expr + sampler_name_suffix; + else + return img_expr.substr(0, index) + sampler_name_suffix + img_expr.substr(index); +} + +string CompilerMSL::to_swizzle_expression(uint32_t id) +{ + auto *combined = maybe_get(id); + + auto expr = to_expression(combined ? combined->image : VariableID(id)); + auto index = expr.find_first_of('['); + + // If an image is part of an argument buffer translate this to a legal identifier. + string::size_type period = 0; + while ((period = expr.find_first_of('.', period)) != string::npos && period < index) + expr[period] = '_'; + + if (index == string::npos) + return expr + swizzle_name_suffix; + else + { + auto image_expr = expr.substr(0, index); + auto array_expr = expr.substr(index); + return image_expr + swizzle_name_suffix + array_expr; + } +} + +string CompilerMSL::to_buffer_size_expression(uint32_t id) +{ + auto expr = to_expression(id); + + // This is quite crude, but we need to translate the reference name (*spvDescriptorSetN.name) to + // the pointer expression spvDescriptorSetN.name to make a reasonable expression here. + // This only happens if we have argument buffers and we are using OpArrayLength on a lone SSBO in that set. + if (expr.size() >= 3 && expr[0] == '(' && expr[1] == '*') + expr = address_of_expression(expr); + + auto index = expr.find_first_of('['); + string buffer_expr, array_expr; + + if (index != string::npos) + { + buffer_expr = expr.substr(0, index); + array_expr = expr.substr(index); + } + + // If a buffer is part of an argument buffer translate this to a legal identifier. + for (auto &c : expr) + if (c == '.') + c = '_'; + + if (index == string::npos) + { + return expr + buffer_size_name_suffix; + } + else + { + if (auto var = maybe_get_backing_variable(id)) + { + if (is_var_runtime_size_array(*var)) + { + if (!msl_options.runtime_array_rich_descriptor) + SPIRV_CROSS_THROW("OpArrayLength requires rich descriptor format"); + + auto last_pos = array_expr.find_last_of(']'); + if (last_pos != std::string::npos) + return buffer_expr + ".length(" + array_expr.substr(1, last_pos - 1) + ")"; + } + } + + for (auto &c : buffer_expr) + if (c == '.') + c = '_'; + + return buffer_expr + buffer_size_name_suffix + array_expr; + } +} + +// Checks whether the type is a Block all of whose members have DecorationPatch. +bool CompilerMSL::is_patch_block(const SPIRType &type) +{ + if (!has_decoration(type.self, DecorationBlock)) + return false; + + for (uint32_t i = 0; i < type.member_types.size(); i++) + { + if (!has_member_decoration(type.self, i, DecorationPatch)) + return false; + } + + return true; +} + +// Checks whether the ID is a row_major matrix that requires conversion before use +bool CompilerMSL::is_non_native_row_major_matrix(uint32_t id) +{ + auto *e = maybe_get(id); + if (e) + return e->need_transpose; + else + return has_decoration(id, DecorationRowMajor); +} + +// Checks whether the member is a row_major matrix that requires conversion before use +bool CompilerMSL::member_is_non_native_row_major_matrix(const SPIRType &type, uint32_t index) +{ + return has_member_decoration(type.self, index, DecorationRowMajor); +} + +string CompilerMSL::convert_row_major_matrix(string exp_str, const SPIRType &exp_type, uint32_t physical_type_id, + bool is_packed, bool relaxed) +{ + if (!is_matrix(exp_type)) + { + return CompilerGLSL::convert_row_major_matrix(std::move(exp_str), exp_type, physical_type_id, is_packed, relaxed); + } + else + { + strip_enclosed_expression(exp_str); + if (physical_type_id != 0 || is_packed) + exp_str = unpack_expression_type(exp_str, exp_type, physical_type_id, is_packed, true); + return join("transpose(", exp_str, ")"); + } +} + +// Called automatically at the end of the entry point function +void CompilerMSL::emit_fixup() +{ + if (stage_out_var_id && !capture_output_to_buffer) + { + if (needs_point_size_output && !writes_to_point_size) + statement(builtin_to_glsl(BuiltInPointSize, StorageClassOutput), " = ", format_float(msl_options.default_point_size), ";"); + + if (is_vertex_like_shader() && !qual_pos_var_name.empty()) + { + if (options.vertex.fixup_clipspace) + statement(qual_pos_var_name, ".z = (", qual_pos_var_name, ".z + ", qual_pos_var_name, + ".w) * 0.5; // Adjust clip-space for Metal"); + + if (options.vertex.flip_vert_y) + statement(qual_pos_var_name, ".y = -(", qual_pos_var_name, ".y);", " // Invert Y-axis for Metal"); + } + } +} + +// Return a string defining a structure member, with padding and packing. +string CompilerMSL::to_struct_member(const SPIRType &type, uint32_t member_type_id, uint32_t index, + const string &qualifier) +{ + uint32_t orig_member_type_id = member_type_id; + if (member_is_remapped_physical_type(type, index)) + member_type_id = get_extended_member_decoration(type.self, index, SPIRVCrossDecorationPhysicalTypeID); + auto &physical_type = get(member_type_id); + + // If this member is packed, mark it as so. + string pack_pfx; + + // Allow Metal to use the array template to make arrays a value type + uint32_t orig_id = 0; + if (has_extended_member_decoration(type.self, index, SPIRVCrossDecorationInterfaceOrigID)) + orig_id = get_extended_member_decoration(type.self, index, SPIRVCrossDecorationInterfaceOrigID); + + bool row_major = false; + if (is_matrix(physical_type)) + row_major = has_member_decoration(type.self, index, DecorationRowMajor); + + SPIRType row_major_physical_type { OpTypeMatrix }; + const SPIRType *declared_type = &physical_type; + + // If a struct is being declared with physical layout, + // do not use array wrappers. + // This avoids a lot of complicated cases with packed vectors and matrices, + // and generally we cannot copy full arrays in and out of buffers into Function + // address space. + // Array of resources should also be declared as builtin arrays. + if (has_member_decoration(type.self, index, DecorationOffset)) + is_using_builtin_array = true; + else if (has_extended_member_decoration(type.self, index, SPIRVCrossDecorationResourceIndexPrimary)) + is_using_builtin_array = true; + + if (member_is_packed_physical_type(type, index)) + { + // If we're packing a matrix, output an appropriate typedef + if (physical_type.basetype == SPIRType::Struct) + { + SPIRV_CROSS_THROW("Cannot emit a packed struct currently."); + } + else if (is_matrix(physical_type)) + { + uint32_t rows = physical_type.vecsize; + uint32_t cols = physical_type.columns; + pack_pfx = "packed_"; + if (row_major) + { + // These are stored transposed. + rows = physical_type.columns; + cols = physical_type.vecsize; + pack_pfx = "packed_rm_"; + } + string base_type = physical_type.width == 16 ? "half" : "float"; + string td_line = "typedef "; + td_line += "packed_" + base_type + to_string(rows); + td_line += " " + pack_pfx; + // Use the actual matrix size here. + td_line += base_type + to_string(physical_type.columns) + "x" + to_string(physical_type.vecsize); + td_line += "[" + to_string(cols) + "]"; + td_line += ";"; + add_typedef_line(td_line); + } + else if (!is_scalar(physical_type)) // scalar type is already packed. + pack_pfx = "packed_"; + } + else if (is_matrix(physical_type)) + { + if (!msl_options.supports_msl_version(3, 0) && + has_extended_decoration(type.self, SPIRVCrossDecorationWorkgroupStruct)) + { + pack_pfx = "spvStorage_"; + add_spv_func_and_recompile(SPVFuncImplStorageMatrix); + // The pack prefix causes problems with array wrappers. + is_using_builtin_array = true; + } + if (row_major) + { + // Need to declare type with flipped vecsize/columns. + row_major_physical_type = physical_type; + swap(row_major_physical_type.vecsize, row_major_physical_type.columns); + declared_type = &row_major_physical_type; + } + } + + // iOS Tier 1 argument buffers do not support writable images. + if (physical_type.basetype == SPIRType::Image && + physical_type.image.sampled == 2 && + msl_options.is_ios() && + msl_options.argument_buffers_tier <= Options::ArgumentBuffersTier::Tier1 && + !has_decoration(orig_id, DecorationNonWritable)) + { + SPIRV_CROSS_THROW("Writable images are not allowed on Tier1 argument buffers on iOS."); + } + + // Array information is baked into these types. + string array_type; + if (physical_type.basetype != SPIRType::Image && physical_type.basetype != SPIRType::Sampler && + physical_type.basetype != SPIRType::SampledImage) + { + BuiltIn builtin = BuiltInMax; + + // Special handling. In [[stage_out]] or [[stage_in]] blocks, + // we need flat arrays, but if we're somehow declaring gl_PerVertex for constant array reasons, we want + // template array types to be declared. + bool is_ib_in_out = + ((stage_out_var_id && get_stage_out_struct_type().self == type.self && + variable_storage_requires_stage_io(StorageClassOutput)) || + (stage_in_var_id && get_stage_in_struct_type().self == type.self && + variable_storage_requires_stage_io(StorageClassInput))) || + is_mesh_shader(); + if (is_ib_in_out && is_member_builtin(type, index, &builtin)) + is_using_builtin_array = true; + array_type = type_to_array_glsl(physical_type, orig_id); + } + + if (is_mesh_shader()) + { + BuiltIn builtin = BuiltInMax; + if (is_member_builtin(type, index, &builtin)) + { + if (builtin == BuiltInPrimitiveShadingRateKHR) + { + // not supported in metal 3.0 + is_using_builtin_array = false; + return ""; + } + + SPIRType metallic_type = *declared_type; + if (builtin == BuiltInCullPrimitiveEXT) + metallic_type.basetype = SPIRType::Boolean; + else if (builtin == BuiltInPrimitiveId || builtin == BuiltInLayer || builtin == BuiltInViewportIndex) + metallic_type.basetype = SPIRType::UInt; + + is_using_builtin_array = true; + std::string result; + if (has_member_decoration(type.self, orig_id, DecorationBuiltIn)) + { + // avoid '_RESERVED_IDENTIFIER_FIXUP_' in variable name + result = join(type_to_glsl(metallic_type, orig_id, false), " ", qualifier, + builtin_to_glsl(builtin, StorageClassOutput), member_attribute_qualifier(type, index), + array_type, ";"); + } + else + { + result = join(type_to_glsl(metallic_type, orig_id, false), " ", qualifier, + to_member_name(type, index), member_attribute_qualifier(type, index), array_type, ";"); + } + is_using_builtin_array = false; + return result; + } + } + + if (orig_id) + { + auto *data_type = declared_type; + if (is_pointer(*data_type)) + data_type = &get_pointee_type(*data_type); + + if (is_array(*data_type) && get_resource_array_size(*data_type, orig_id) == 0) + { + // Hack for declaring unsized array of resources. Need to declare dummy sized array by value inline. + // This can then be wrapped in spvDescriptorArray as usual. + array_type = "[1] /* unsized array hack */"; + } + } + + string decl_type; + if (declared_type->vecsize > 4) + { + auto orig_type = get(orig_member_type_id); + if (is_matrix(orig_type) && row_major) + swap(orig_type.vecsize, orig_type.columns); + orig_type.columns = 1; + decl_type = type_to_glsl(orig_type, orig_id, true); + + if (declared_type->columns > 1) + decl_type = join("spvPaddedStd140Matrix<", decl_type, ", ", declared_type->columns, ">"); + else + decl_type = join("spvPaddedStd140<", decl_type, ">"); + } + else + decl_type = type_to_glsl(*declared_type, orig_id, true); + + const char *overlapping_binding_tag = + has_extended_member_decoration(type.self, index, SPIRVCrossDecorationOverlappingBinding) ? + "// Overlapping binding: " : ""; + + auto result = join(overlapping_binding_tag, pack_pfx, decl_type, " ", qualifier, + to_member_name(type, index), member_attribute_qualifier(type, index), array_type, ";"); + + is_using_builtin_array = false; + return result; +} + +// Emit a structure member, padding and packing to maintain the correct memeber alignments. +void CompilerMSL::emit_struct_member(const SPIRType &type, uint32_t member_type_id, uint32_t index, + const string &qualifier, uint32_t) +{ + // If this member requires padding to maintain its declared offset, emit a dummy padding member before it. + if (has_extended_member_decoration(type.self, index, SPIRVCrossDecorationPaddingTarget)) + { + uint32_t pad_len = get_extended_member_decoration(type.self, index, SPIRVCrossDecorationPaddingTarget); + statement("char _m", index, "_pad", "[", pad_len, "];"); + } + + BuiltIn builtin = BuiltInMax; + if (is_mesh_shader() && is_member_builtin(type, index, &builtin)) + { + if (!has_active_builtin(builtin, StorageClassOutput) && !has_active_builtin(builtin, StorageClassInput)) + { + // Do not emit unused builtins in mesh-output blocks + return; + } + } + + // Handle HLSL-style 0-based vertex/instance index. + builtin_declaration = true; + statement(to_struct_member(type, member_type_id, index, qualifier)); + builtin_declaration = false; +} + +void CompilerMSL::emit_struct_padding_target(const SPIRType &type) +{ + uint32_t struct_size = get_declared_struct_size_msl(type, true, true); + uint32_t target_size = get_extended_decoration(type.self, SPIRVCrossDecorationPaddingTarget); + if (target_size < struct_size) + SPIRV_CROSS_THROW("Cannot pad with negative bytes."); + else if (target_size > struct_size) + statement("char _m0_final_padding[", target_size - struct_size, "];"); +} + +// Return a MSL qualifier for the specified function attribute member +string CompilerMSL::member_attribute_qualifier(const SPIRType &type, uint32_t index) +{ + auto &execution = get_entry_point(); + + uint32_t mbr_type_id = type.member_types[index]; + auto &mbr_type = get(mbr_type_id); + + BuiltIn builtin = BuiltInMax; + bool is_builtin = is_member_builtin(type, index, &builtin); + + if (has_extended_member_decoration(type.self, index, SPIRVCrossDecorationResourceIndexPrimary)) + { + string quals = join( + " [[id(", get_extended_member_decoration(type.self, index, SPIRVCrossDecorationResourceIndexPrimary), ")"); + if (interlocked_resources.count( + get_extended_member_decoration(type.self, index, SPIRVCrossDecorationInterfaceOrigID))) + quals += ", raster_order_group(0)"; + quals += "]]"; + return quals; + } + + // Vertex function inputs + if (execution.model == ExecutionModelVertex && type.storage == StorageClassInput) + { + if (is_builtin) + { + switch (builtin) + { + case BuiltInVertexId: + case BuiltInVertexIndex: + case BuiltInBaseVertex: + case BuiltInInstanceId: + case BuiltInInstanceIndex: + case BuiltInBaseInstance: + if (msl_options.vertex_for_tessellation) + return ""; + return string(" [[") + builtin_qualifier(builtin) + "]]"; + + case BuiltInDrawIndex: + SPIRV_CROSS_THROW("DrawIndex is not supported in MSL."); + + default: + return ""; + } + } + + uint32_t locn; + if (is_builtin) + locn = get_or_allocate_builtin_input_member_location(builtin, type.self, index); + else + locn = get_member_location(type.self, index); + + if (locn != k_unknown_location) + return string(" [[attribute(") + convert_to_string(locn) + ")]]"; + } + + bool use_semantic_stage_output = is_mesh_shader() || is_tese_shader() || + (execution.model == ExecutionModelVertex && !msl_options.vertex_for_tessellation); + + // Vertex, mesh and tessellation evaluation function outputs + if ((type.storage == StorageClassOutput || is_mesh_shader()) && use_semantic_stage_output) + { + if (is_builtin) + { + switch (builtin) + { + case BuiltInPointSize: + // Only mark the PointSize builtin if really rendering points. + // Some shaders may include a PointSize builtin even when used to render + // non-point topologies, and Metal will reject this builtin when compiling + // the shader into a render pipeline that uses a non-point topology. + return msl_options.enable_point_size_builtin ? (string(" [[") + builtin_qualifier(builtin) + "]]") : ""; + + case BuiltInViewportIndex: + if (!msl_options.supports_msl_version(2, 0)) + SPIRV_CROSS_THROW("ViewportIndex requires Metal 2.0."); + /* fallthrough */ + case BuiltInPosition: + case BuiltInLayer: + case BuiltInCullPrimitiveEXT: + case BuiltInPrimitiveShadingRateKHR: + case BuiltInPrimitiveId: + return string(" [[") + builtin_qualifier(builtin) + "]]" + (mbr_type.array.empty() ? "" : " "); + + case BuiltInClipDistance: + if (has_member_decoration(type.self, index, DecorationIndex)) + return join(" [[user(clip", get_member_decoration(type.self, index, DecorationIndex), ")]]"); + else + return string(" [[") + builtin_qualifier(builtin) + "]]" + (mbr_type.array.empty() ? "" : " "); + + case BuiltInCullDistance: + if (has_member_decoration(type.self, index, DecorationIndex)) + return join(" [[user(cull", get_member_decoration(type.self, index, DecorationIndex), ")]]"); + else + return string(" [[") + builtin_qualifier(builtin) + "]]" + (mbr_type.array.empty() ? "" : " "); + + default: + return ""; + } + } + string loc_qual = member_location_attribute_qualifier(type, index); + if (!loc_qual.empty()) + return join(" [[", loc_qual, "]]"); + } + + if (execution.model == ExecutionModelVertex && msl_options.vertex_for_tessellation && type.storage == StorageClassOutput) + { + // For this type of shader, we always arrange for it to capture its + // output to a buffer. For this reason, qualifiers are irrelevant here. + if (is_builtin) + // We still have to assign a location so the output struct will sort correctly. + get_or_allocate_builtin_output_member_location(builtin, type.self, index); + return ""; + } + + // Tessellation control function inputs + if (is_tesc_shader() && type.storage == StorageClassInput) + { + if (is_builtin) + { + switch (builtin) + { + case BuiltInInvocationId: + case BuiltInPrimitiveId: + if (msl_options.multi_patch_workgroup) + return ""; + return string(" [[") + builtin_qualifier(builtin) + "]]" + (mbr_type.array.empty() ? "" : " "); + case BuiltInSubgroupLocalInvocationId: // FIXME: Should work in any stage + case BuiltInSubgroupSize: // FIXME: Should work in any stage + if (msl_options.emulate_subgroups) + return ""; + return string(" [[") + builtin_qualifier(builtin) + "]]" + (mbr_type.array.empty() ? "" : " "); + case BuiltInPatchVertices: + return ""; + // Others come from stage input. + default: + break; + } + } + if (msl_options.multi_patch_workgroup) + return ""; + + uint32_t locn; + if (is_builtin) + locn = get_or_allocate_builtin_input_member_location(builtin, type.self, index); + else + locn = get_member_location(type.self, index); + + if (locn != k_unknown_location) + return string(" [[attribute(") + convert_to_string(locn) + ")]]"; + } + + // Tessellation control function outputs + if (is_tesc_shader() && type.storage == StorageClassOutput) + { + // For this type of shader, we always arrange for it to capture its + // output to a buffer. For this reason, qualifiers are irrelevant here. + if (is_builtin) + // We still have to assign a location so the output struct will sort correctly. + get_or_allocate_builtin_output_member_location(builtin, type.self, index); + return ""; + } + + // Tessellation evaluation function inputs + if (is_tese_shader() && type.storage == StorageClassInput) + { + if (is_builtin) + { + switch (builtin) + { + case BuiltInPrimitiveId: + case BuiltInTessCoord: + return string(" [[") + builtin_qualifier(builtin) + "]]"; + case BuiltInPatchVertices: + return ""; + // Others come from stage input. + default: + break; + } + } + + if (msl_options.raw_buffer_tese_input) + return ""; + + // The special control point array must not be marked with an attribute. + if (get_type(type.member_types[index]).basetype == SPIRType::ControlPointArray) + return ""; + + uint32_t locn; + if (is_builtin) + locn = get_or_allocate_builtin_input_member_location(builtin, type.self, index); + else + locn = get_member_location(type.self, index); + + if (locn != k_unknown_location) + return string(" [[attribute(") + convert_to_string(locn) + ")]]"; + } + + // Tessellation evaluation function outputs were handled above. + + // Fragment function inputs + if (execution.model == ExecutionModelFragment && type.storage == StorageClassInput) + { + string quals; + if (is_builtin) + { + switch (builtin) + { + case BuiltInViewIndex: + if (!msl_options.multiview || !msl_options.multiview_layered_rendering) + break; + /* fallthrough */ + case BuiltInFrontFacing: + case BuiltInPointCoord: + case BuiltInFragCoord: + case BuiltInSampleId: + case BuiltInSampleMask: + case BuiltInLayer: + case BuiltInBaryCoordKHR: + case BuiltInBaryCoordNoPerspKHR: + quals = builtin_qualifier(builtin); + break; + + case BuiltInClipDistance: + return join(" [[user(clip", get_member_decoration(type.self, index, DecorationIndex), ")]]"); + case BuiltInCullDistance: + return join(" [[user(cull", get_member_decoration(type.self, index, DecorationIndex), ")]]"); + + default: + break; + } + } + else + quals = member_location_attribute_qualifier(type, index); + + if (builtin == BuiltInBaryCoordKHR && has_member_decoration(type.self, index, DecorationNoPerspective)) + { + // NoPerspective is baked into the builtin type. + SPIRV_CROSS_THROW("NoPerspective decorations are not supported for BaryCoord inputs."); + } + + // Don't bother decorating integers with the 'flat' attribute; it's + // the default (in fact, the only option). Also don't bother with the + // FragCoord builtin; it's always noperspective on Metal. + if (!type_is_integral(mbr_type) && (!is_builtin || builtin != BuiltInFragCoord)) + { + if (has_member_decoration(type.self, index, DecorationFlat)) + { + if (!quals.empty()) + quals += ", "; + quals += "flat"; + } + else if (has_member_decoration(type.self, index, DecorationCentroid)) + { + if (!quals.empty()) + quals += ", "; + + if (builtin == BuiltInBaryCoordNoPerspKHR || builtin == BuiltInBaryCoordKHR) + SPIRV_CROSS_THROW("Centroid interpolation not supported for barycentrics in MSL."); + + if (has_member_decoration(type.self, index, DecorationNoPerspective)) + quals += "centroid_no_perspective"; + else + quals += "centroid_perspective"; + } + else if (has_member_decoration(type.self, index, DecorationSample)) + { + if (!quals.empty()) + quals += ", "; + + if (builtin == BuiltInBaryCoordNoPerspKHR || builtin == BuiltInBaryCoordKHR) + SPIRV_CROSS_THROW("Sample interpolation not supported for barycentrics in MSL."); + + if (has_member_decoration(type.self, index, DecorationNoPerspective)) + quals += "sample_no_perspective"; + else + quals += "sample_perspective"; + } + else if (has_member_decoration(type.self, index, DecorationNoPerspective) || builtin == BuiltInBaryCoordNoPerspKHR) + { + if (!quals.empty()) + quals += ", "; + quals += "center_no_perspective"; + } + else if (builtin == BuiltInBaryCoordKHR) + { + if (!quals.empty()) + quals += ", "; + quals += "center_perspective"; + } + } + + if (!quals.empty()) + return " [[" + quals + "]]"; + } + + // Fragment function outputs + if (execution.model == ExecutionModelFragment && type.storage == StorageClassOutput) + { + if (is_builtin) + { + switch (builtin) + { + case BuiltInFragStencilRefEXT: + // Similar to PointSize, only mark FragStencilRef if there's a stencil buffer. + // Some shaders may include a FragStencilRef builtin even when used to render + // without a stencil attachment, and Metal will reject this builtin + // when compiling the shader into a render pipeline that does not set + // stencilAttachmentPixelFormat. + if (!msl_options.enable_frag_stencil_ref_builtin) + return ""; + if (!msl_options.supports_msl_version(2, 1)) + SPIRV_CROSS_THROW("Stencil export only supported in MSL 2.1 and up."); + return string(" [[") + builtin_qualifier(builtin) + "]]"; + + case BuiltInFragDepth: + // Ditto FragDepth. + if (!msl_options.enable_frag_depth_builtin) + return ""; + /* fallthrough */ + case BuiltInSampleMask: + return string(" [[") + builtin_qualifier(builtin) + "]]"; + + default: + return ""; + } + } + uint32_t locn = get_member_location(type.self, index); + // Metal will likely complain about missing color attachments, too. + if (locn != k_unknown_location && !(msl_options.enable_frag_output_mask & (1 << locn))) + return ""; + if (locn != k_unknown_location && has_member_decoration(type.self, index, DecorationIndex)) + return join(" [[color(", locn, "), index(", get_member_decoration(type.self, index, DecorationIndex), + ")]]"); + else if (locn != k_unknown_location) + return join(" [[color(", locn, ")]]"); + else if (has_member_decoration(type.self, index, DecorationIndex)) + return join(" [[index(", get_member_decoration(type.self, index, DecorationIndex), ")]]"); + else + return ""; + } + + // Compute function inputs + if (execution.model == ExecutionModelGLCompute && type.storage == StorageClassInput) + { + if (is_builtin) + { + switch (builtin) + { + case BuiltInNumSubgroups: + case BuiltInSubgroupId: + case BuiltInSubgroupLocalInvocationId: // FIXME: Should work in any stage + case BuiltInSubgroupSize: // FIXME: Should work in any stage + if (msl_options.emulate_subgroups) + break; + /* fallthrough */ + case BuiltInGlobalInvocationId: + case BuiltInWorkgroupId: + case BuiltInNumWorkgroups: + case BuiltInLocalInvocationId: + case BuiltInLocalInvocationIndex: + return string(" [[") + builtin_qualifier(builtin) + "]]"; + + default: + return ""; + } + } + } + + return ""; +} + +// A user-defined output variable is considered to match an input variable in the subsequent +// stage if the two variables are declared with the same Location and Component decoration and +// match in type and decoration, except that interpolation decorations are not required to match. +// For the purposes of interface matching, variables declared without a Component decoration are +// considered to have a Component decoration of zero. +string CompilerMSL::member_location_attribute_qualifier(const SPIRType &type, uint32_t index) +{ + string quals; + uint32_t comp; + uint32_t locn = get_member_location(type.self, index, &comp); + if (locn != k_unknown_location) + { + quals += "user(locn"; + quals += convert_to_string(locn); + if (comp != k_unknown_component && comp != 0) + { + quals += "_"; + quals += convert_to_string(comp); + } + quals += ")"; + } + return quals; +} + +// Returns the location decoration of the member with the specified index in the specified type. +// If the location of the member has been explicitly set, that location is used. If not, this +// function assumes the members are ordered in their location order, and simply returns the +// index as the location. +uint32_t CompilerMSL::get_member_location(uint32_t type_id, uint32_t index, uint32_t *comp) const +{ + if (comp) + { + if (has_member_decoration(type_id, index, DecorationComponent)) + *comp = get_member_decoration(type_id, index, DecorationComponent); + else + *comp = k_unknown_component; + } + + if (has_member_decoration(type_id, index, DecorationLocation)) + return get_member_decoration(type_id, index, DecorationLocation); + else + return k_unknown_location; +} + +uint32_t CompilerMSL::get_or_allocate_builtin_input_member_location(BuiltIn builtin, + uint32_t type_id, uint32_t index, + uint32_t *comp) +{ + uint32_t loc = get_member_location(type_id, index, comp); + if (loc != k_unknown_location) + return loc; + + if (comp) + *comp = k_unknown_component; + + // Late allocation. Find a location which is unused by the application. + // This can happen for built-in inputs in tessellation which are mixed and matched with user inputs. + auto &mbr_type = get(get(type_id).member_types[index]); + uint32_t count = type_to_location_count(mbr_type); + + loc = 0; + + const auto location_range_in_use = [this](uint32_t location, uint32_t location_count) -> bool { + for (uint32_t i = 0; i < location_count; i++) + if (location_inputs_in_use.count(location + i) != 0) + return true; + return false; + }; + + while (location_range_in_use(loc, count)) + loc++; + + set_member_decoration(type_id, index, DecorationLocation, loc); + + // Triangle tess level inputs are shared in one packed float4, + // mark both builtins as sharing one location. + if (!msl_options.raw_buffer_tese_input && is_tessellating_triangles() && + (builtin == BuiltInTessLevelInner || builtin == BuiltInTessLevelOuter)) + { + builtin_to_automatic_input_location[BuiltInTessLevelInner] = loc; + builtin_to_automatic_input_location[BuiltInTessLevelOuter] = loc; + } + else + builtin_to_automatic_input_location[builtin] = loc; + + mark_location_as_used_by_shader(loc, mbr_type, StorageClassInput, true); + return loc; +} + +uint32_t CompilerMSL::get_or_allocate_builtin_output_member_location(BuiltIn builtin, + uint32_t type_id, uint32_t index, + uint32_t *comp) +{ + uint32_t loc = get_member_location(type_id, index, comp); + if (loc != k_unknown_location) + return loc; + loc = 0; + + if (comp) + *comp = k_unknown_component; + + // Late allocation. Find a location which is unused by the application. + // This can happen for built-in outputs in tessellation which are mixed and matched with user inputs. + auto &mbr_type = get(get(type_id).member_types[index]); + uint32_t count = type_to_location_count(mbr_type); + + const auto location_range_in_use = [this](uint32_t location, uint32_t location_count) -> bool { + for (uint32_t i = 0; i < location_count; i++) + if (location_outputs_in_use.count(location + i) != 0) + return true; + return false; + }; + + while (location_range_in_use(loc, count)) + loc++; + + set_member_decoration(type_id, index, DecorationLocation, loc); + + // Triangle tess level inputs are shared in one packed float4; + // mark both builtins as sharing one location. + if (is_tessellating_triangles() && (builtin == BuiltInTessLevelInner || builtin == BuiltInTessLevelOuter)) + { + builtin_to_automatic_output_location[BuiltInTessLevelInner] = loc; + builtin_to_automatic_output_location[BuiltInTessLevelOuter] = loc; + } + else + builtin_to_automatic_output_location[builtin] = loc; + + mark_location_as_used_by_shader(loc, mbr_type, StorageClassOutput, true); + return loc; +} + +bool CompilerMSL::entry_point_is_vertex() const +{ + // MSL vertex entrypoint is used for non-tessellation vertex stage or tessellation evaluation stage. + return (get_execution_model() == ExecutionModelVertex && !msl_options.vertex_for_tessellation) || + get_execution_model() == ExecutionModelTessellationEvaluation; +} + +bool CompilerMSL::entry_point_returns_stage_output() const +{ + if (get_execution_model() == ExecutionModelVertex && msl_options.vertex_for_tessellation) + return false; + bool ep_should_return_output = !get_is_rasterization_disabled(); + return stage_out_var_id && ep_should_return_output; +} + +bool CompilerMSL::entry_point_requires_const_device_buffers() const +{ + return !has_descriptor_side_effects_buffer && !capture_output_to_buffer; +} + +// Returns the type declaration for a function, including the +// entry type if the current function is the entry point function +string CompilerMSL::func_type_decl(SPIRType &type) +{ + // The regular function return type. If not processing the entry point function, that's all we need + string return_type = type_to_glsl(type) + type_to_array_glsl(type, 0); + if (!processing_entry_point) + return return_type; + + // If an outgoing interface block has been defined, and it should be returned, override the entry point return type + if (entry_point_returns_stage_output()) + return_type = type_to_glsl(get_stage_out_struct_type()) + type_to_array_glsl(type, 0); + + // Prepend a entry type, based on the execution model + string entry_type; + auto &execution = get_entry_point(); + switch (execution.model) + { + case ExecutionModelVertex: + if (msl_options.vertex_for_tessellation && !msl_options.supports_msl_version(1, 2)) + SPIRV_CROSS_THROW("Tessellation requires Metal 1.2."); + entry_type = msl_options.vertex_for_tessellation ? "kernel" : "vertex"; + break; + case ExecutionModelTessellationEvaluation: + if (!msl_options.supports_msl_version(1, 2)) + SPIRV_CROSS_THROW("Tessellation requires Metal 1.2."); + if (execution.flags.get(ExecutionModeIsolines)) + SPIRV_CROSS_THROW("Metal does not support isoline tessellation."); + if (msl_options.is_ios()) + entry_type = join("[[ patch(", is_tessellating_triangles() ? "triangle" : "quad", ") ]] vertex"); + else + entry_type = join("[[ patch(", is_tessellating_triangles() ? "triangle" : "quad", ", ", + execution.output_vertices, ") ]] vertex"); + break; + case ExecutionModelFragment: + entry_type = uses_explicit_early_fragment_test() ? "[[ early_fragment_tests ]] fragment" : "fragment"; + break; + case ExecutionModelTessellationControl: + if (!msl_options.supports_msl_version(1, 2)) + SPIRV_CROSS_THROW("Tessellation requires Metal 1.2."); + if (execution.flags.get(ExecutionModeIsolines)) + SPIRV_CROSS_THROW("Metal does not support isoline tessellation."); + /* fallthrough */ + case ExecutionModelGLCompute: + case ExecutionModelKernel: + entry_type = "kernel"; + break; + case ExecutionModelMeshEXT: + entry_type = "[[mesh]]"; + break; + case ExecutionModelTaskEXT: + entry_type = "[[object]]"; + break; + default: + entry_type = "unknown"; + break; + } + + return entry_type + " " + return_type; +} + +bool CompilerMSL::is_tesc_shader() const +{ + return get_execution_model() == ExecutionModelTessellationControl; +} + +bool CompilerMSL::is_tese_shader() const +{ + return get_execution_model() == ExecutionModelTessellationEvaluation; +} + +bool CompilerMSL::is_mesh_shader() const +{ + return get_execution_model() == ExecutionModelMeshEXT; +} + +bool CompilerMSL::uses_explicit_early_fragment_test() +{ + auto &ep_flags = get_entry_point().flags; + return ep_flags.get(ExecutionModeEarlyFragmentTests) || ep_flags.get(ExecutionModePostDepthCoverage); +} + +// In MSL, address space qualifiers are required for all pointer or reference variables +string CompilerMSL::get_variable_address_space(const SPIRVariable &argument) +{ + const auto &type = get(argument.basetype); + return get_type_address_space(type, argument.self, true); +} + +string CompilerMSL::get_leaf_argument_address_space(const SPIRVariable &argument) +{ + const auto &type = get(argument.basetype); + // BDA and variable buffer pointer is always passed around by (pointer) value. There is no storage class for the argument itself. + if (is_physical_or_buffer_pointer(type)) + return ""; + return get_type_address_space(type, argument.self, true); +} + +bool CompilerMSL::decoration_flags_signal_volatile(const Bitset &flags) const +{ + // Using volatile for coherent pre-3.2 is definitely not correct, but it's something. + // MSL 3.2 adds actual coherent qualifiers. + return flags.get(DecorationVolatile) || + (flags.get(DecorationCoherent) && !msl_options.supports_msl_version(3, 2)); +} + +bool CompilerMSL::decoration_flags_signal_coherent(const Bitset &flags) const +{ + return flags.get(DecorationCoherent) && msl_options.supports_msl_version(3, 2); +} + +string CompilerMSL::get_type_address_space(const SPIRType &type, uint32_t id, bool argument) +{ + // This can be called for variable pointer contexts as well, so be very careful about which method we choose. + Bitset flags; + auto *var = maybe_get(id); + if (var && type.basetype == SPIRType::Struct && + (has_decoration(type.self, DecorationBlock) || has_decoration(type.self, DecorationBufferBlock))) + flags = get_buffer_block_flags(id); + else + { + flags = get_decoration_bitset(id); + + if (type.basetype == SPIRType::Struct && + (has_decoration(type.self, DecorationBlock) || + has_decoration(type.self, DecorationBufferBlock))) + { + flags.merge_or(ir.get_buffer_block_type_flags(type)); + } + } + + const char *addr_space = nullptr; + switch (type.storage) + { + case StorageClassWorkgroup: + addr_space = "threadgroup"; + break; + + case StorageClassStorageBuffer: + case StorageClassPhysicalStorageBuffer: + { + // When dealing with descriptor aliasing, it becomes very problematic to make use of + // readonly qualifiers. + // If rasterization is not disabled in vertex/tese, Metal does not allow side effects and refuses to compile "device", + // even if there are no writes. Just force const device. + if (entry_point_requires_const_device_buffers() && type.basetype != SPIRType::AtomicCounter) + addr_space = "const device"; + else + addr_space = "device"; + break; + } + + case StorageClassUniform: + case StorageClassUniformConstant: + case StorageClassPushConstant: + if (type.basetype == SPIRType::Struct) + { + bool ssbo = has_decoration(type.self, DecorationBufferBlock); + if (ssbo) + { + if (entry_point_requires_const_device_buffers() && type.basetype != SPIRType::AtomicCounter) + addr_space = "const device"; + else + addr_space = "device"; + } + else + addr_space = "constant"; + } + else if (!argument) + { + // This is used for helper UBOs we insert ourselves. + addr_space = "constant"; + } + else if (type_is_msl_framebuffer_fetch(type)) + { + // Subpass inputs are passed around by value. + addr_space = ""; + } + + break; + + case StorageClassFunction: + case StorageClassGeneric: + break; + + case StorageClassInput: + if (is_tesc_shader() && var && var->basevariable == stage_in_ptr_var_id) + addr_space = msl_options.multi_patch_workgroup ? "const device" : "threadgroup"; + // Don't pass tessellation levels in the device AS; we load and convert them + // to float manually. + if (is_tese_shader() && msl_options.raw_buffer_tese_input && var) + { + bool is_stage_in = var->basevariable == stage_in_ptr_var_id; + bool is_patch_stage_in = has_decoration(var->self, DecorationPatch); + bool is_builtin = has_decoration(var->self, DecorationBuiltIn); + BuiltIn builtin = (BuiltIn)get_decoration(var->self, DecorationBuiltIn); + bool is_tess_level = is_builtin && (builtin == BuiltInTessLevelOuter || builtin == BuiltInTessLevelInner); + if (is_stage_in || (is_patch_stage_in && !is_tess_level)) + addr_space = "const device"; + } + if (get_execution_model() == ExecutionModelFragment && var && var->basevariable == stage_in_var_id) + addr_space = "thread"; + break; + + case StorageClassOutput: + if (capture_output_to_buffer) + { + if (var && type.storage == StorageClassOutput) + { + bool is_masked = is_stage_output_variable_masked(*var); + + if (is_masked) + { + if (is_tessellation_shader()) + addr_space = "threadgroup"; + else + addr_space = "thread"; + } + else if (variable_decl_is_remapped_storage(*var, StorageClassWorkgroup)) + addr_space = "threadgroup"; + } + + if (!addr_space) + addr_space = "device"; + } + + if (is_mesh_shader()) + addr_space = "threadgroup"; + break; + + case StorageClassTaskPayloadWorkgroupEXT: + if (is_mesh_shader()) + addr_space = "const object_data"; + else + addr_space = "object_data"; + break; + + default: + break; + } + + if (!addr_space && var && is_var_runtime_size_array(*var)) + addr_space = "device"; + + if (!addr_space) + { + // No address space for plain values. + addr_space = type.pointer || (argument && type.basetype == SPIRType::ControlPointArray) ? "thread" : ""; + } + + if (decoration_flags_signal_coherent(flags) && strcmp(addr_space, "device") == 0) + return join("coherent device"); + else if (decoration_flags_signal_volatile(flags) && strcmp(addr_space, "thread") != 0) + return join("volatile ", addr_space); + else + return addr_space; +} + +const char *CompilerMSL::to_restrict(uint32_t id, bool space) +{ + // This can be called for variable pointer contexts as well, so be very careful about which method we choose. + Bitset flags; + if (ir.ids[id].get_type() == TypeVariable) + { + uint32_t type_id = expression_type_id(id); + auto &type = expression_type(id); + if (type.basetype == SPIRType::Struct && + (has_decoration(type_id, DecorationBlock) || has_decoration(type_id, DecorationBufferBlock))) + flags = get_buffer_block_flags(id); + else + flags = get_decoration_bitset(id); + } + else + flags = get_decoration_bitset(id); + + return flags.get(DecorationRestrict) || flags.get(DecorationRestrictPointerEXT) ? + (space ? "__restrict " : "__restrict") : ""; +} + +string CompilerMSL::entry_point_arg_stage_in() +{ + string decl; + + if ((is_tesc_shader() && msl_options.multi_patch_workgroup) || + (is_tese_shader() && msl_options.raw_buffer_tese_input)) + return decl; + + // Stage-in structure + uint32_t stage_in_id; + if (is_tese_shader()) + stage_in_id = patch_stage_in_var_id; + else + stage_in_id = stage_in_var_id; + + if (stage_in_id) + { + auto &var = get(stage_in_id); + auto &type = get_variable_data_type(var); + + add_resource_name(var.self); + decl = join(type_to_glsl(type), " ", to_name(var.self), " [[stage_in]]"); + } + + return decl; +} + +// Returns true if this input builtin should be a direct parameter on a shader function parameter list, +// and false for builtins that should be passed or calculated some other way. +bool CompilerMSL::is_direct_input_builtin(BuiltIn bi_type) +{ + switch (bi_type) + { + // Vertex function in + case BuiltInVertexId: + case BuiltInVertexIndex: + case BuiltInBaseVertex: + case BuiltInInstanceId: + case BuiltInInstanceIndex: + case BuiltInBaseInstance: + return get_execution_model() != ExecutionModelVertex || !msl_options.vertex_for_tessellation; + // Tess. control function in + case BuiltInPosition: + case BuiltInPointSize: + case BuiltInClipDistance: + case BuiltInCullDistance: + case BuiltInPatchVertices: + return false; + case BuiltInInvocationId: + case BuiltInPrimitiveId: + return !is_tesc_shader() || !msl_options.multi_patch_workgroup; + // Tess. evaluation function in + case BuiltInTessLevelInner: + case BuiltInTessLevelOuter: + return false; + // Fragment function in + case BuiltInSamplePosition: + case BuiltInHelperInvocation: + case BuiltInBaryCoordKHR: + case BuiltInBaryCoordNoPerspKHR: + return false; + case BuiltInViewIndex: + return get_execution_model() == ExecutionModelFragment && msl_options.multiview && + msl_options.multiview_layered_rendering; + // Compute function in + case BuiltInSubgroupId: + case BuiltInNumSubgroups: + return !msl_options.emulate_subgroups; + // Any stage function in + case BuiltInDeviceIndex: + case BuiltInSubgroupEqMask: + case BuiltInSubgroupGeMask: + case BuiltInSubgroupGtMask: + case BuiltInSubgroupLeMask: + case BuiltInSubgroupLtMask: + return false; + case BuiltInSubgroupSize: + if (msl_options.fixed_subgroup_size != 0) + return false; + /* fallthrough */ + case BuiltInSubgroupLocalInvocationId: + return !msl_options.emulate_subgroups; + default: + return true; + } +} + +// Returns true if this is a fragment shader that runs per sample, and false otherwise. +bool CompilerMSL::is_sample_rate() const +{ + auto &caps = get_declared_capabilities(); + return get_execution_model() == ExecutionModelFragment && + (msl_options.force_sample_rate_shading || + std::find(caps.begin(), caps.end(), CapabilitySampleRateShading) != caps.end() || + (msl_options.use_framebuffer_fetch_subpasses && need_subpass_input_ms)); +} + +bool CompilerMSL::is_intersection_query() const +{ + auto &caps = get_declared_capabilities(); + return std::find(caps.begin(), caps.end(), CapabilityRayQueryKHR) != caps.end(); +} + +void CompilerMSL::entry_point_args_builtin(string &ep_args) +{ + // Builtin variables + SmallVector, 8> active_builtins; + ir.for_each_typed_id([&](uint32_t var_id, SPIRVariable &var) { + if (var.storage != StorageClassInput) + return; + + auto bi_type = BuiltIn(get_decoration(var_id, DecorationBuiltIn)); + + // Don't emit SamplePosition as a separate parameter. In the entry + // point, we get that by calling get_sample_position() on the sample ID. + if (is_builtin_variable(var) && + get_variable_data_type(var).basetype != SPIRType::Struct && + get_variable_data_type(var).basetype != SPIRType::ControlPointArray) + { + // If the builtin is not part of the active input builtin set, don't emit it. + // Relevant for multiple entry-point modules which might declare unused builtins. + if (!active_input_builtins.get(bi_type) || !interface_variable_exists_in_entry_point(var_id)) + return; + + // Remember this variable. We may need to correct its type. + active_builtins.push_back(make_pair(&var, bi_type)); + + if (is_direct_input_builtin(bi_type)) + { + if (!ep_args.empty()) + ep_args += ", "; + + // Handle HLSL-style 0-based vertex/instance index. + builtin_declaration = true; + + // Handle different MSL gl_TessCoord types. (float2, float3) + if (bi_type == BuiltInTessCoord && get_entry_point().flags.get(ExecutionModeQuads)) + ep_args += "float2 " + to_expression(var_id) + "In"; + else + ep_args += builtin_type_decl(bi_type, var_id) + " " + to_expression(var_id); + + ep_args += string(" [[") + builtin_qualifier(bi_type); + if (bi_type == BuiltInSampleMask && get_entry_point().flags.get(ExecutionModePostDepthCoverage)) + { + if (!msl_options.supports_msl_version(2)) + SPIRV_CROSS_THROW("Post-depth coverage requires MSL 2.0."); + if (msl_options.is_macos() && !msl_options.supports_msl_version(2, 3)) + SPIRV_CROSS_THROW("Post-depth coverage on Mac requires MSL 2.3."); + ep_args += ", post_depth_coverage"; + } + ep_args += "]]"; + builtin_declaration = false; + } + } + + if (has_extended_decoration(var_id, SPIRVCrossDecorationBuiltInDispatchBase)) + { + // This is a special implicit builtin, not corresponding to any SPIR-V builtin, + // which holds the base that was passed to vkCmdDispatchBase() or vkCmdDrawIndexed(). If it's present, + // assume we emitted it for a good reason. + assert(msl_options.supports_msl_version(1, 2)); + if (!ep_args.empty()) + ep_args += ", "; + + ep_args += type_to_glsl(get_variable_data_type(var)) + " " + to_expression(var_id) + " [[grid_origin]]"; + } + + if (has_extended_decoration(var_id, SPIRVCrossDecorationBuiltInStageInputSize)) + { + // This is another special implicit builtin, not corresponding to any SPIR-V builtin, + // which holds the number of vertices and instances to draw. If it's present, + // assume we emitted it for a good reason. + assert(msl_options.supports_msl_version(1, 2)); + if (!ep_args.empty()) + ep_args += ", "; + + ep_args += type_to_glsl(get_variable_data_type(var)) + " " + to_expression(var_id) + " [[grid_size]]"; + } + }); + + // Correct the types of all encountered active builtins. We couldn't do this before + // because ensure_correct_builtin_type() may increase the bound, which isn't allowed + // while iterating over IDs. + for (auto &var : active_builtins) + var.first->basetype = ensure_correct_builtin_type(var.first->basetype, var.second); + + // Handle HLSL-style 0-based vertex/instance index. + if (needs_base_vertex_arg == TriState::Yes) + ep_args += built_in_func_arg(BuiltInBaseVertex, !ep_args.empty()); + + if (needs_base_instance_arg == TriState::Yes) + ep_args += built_in_func_arg(BuiltInBaseInstance, !ep_args.empty()); + + if (capture_output_to_buffer) + { + // Add parameters to hold the indirect draw parameters and the shader output. This has to be handled + // specially because it needs to be a pointer, not a reference. + if (stage_out_var_id) + { + if (!ep_args.empty()) + ep_args += ", "; + ep_args += join("device ", type_to_glsl(get_stage_out_struct_type()), "* ", output_buffer_var_name, + " [[buffer(", msl_options.shader_output_buffer_index, ")]]"); + } + + if (is_tesc_shader()) + { + if (!ep_args.empty()) + ep_args += ", "; + ep_args += + join("constant uint* spvIndirectParams [[buffer(", msl_options.indirect_params_buffer_index, ")]]"); + } + else if (stage_out_var_id && + !(get_execution_model() == ExecutionModelVertex && msl_options.vertex_for_tessellation)) + { + if (!ep_args.empty()) + ep_args += ", "; + ep_args += + join("device uint* spvIndirectParams [[buffer(", msl_options.indirect_params_buffer_index, ")]]"); + } + + if (get_execution_model() == ExecutionModelVertex && msl_options.vertex_for_tessellation && + (active_input_builtins.get(BuiltInVertexIndex) || active_input_builtins.get(BuiltInVertexId)) && + msl_options.vertex_index_type != Options::IndexType::None) + { + // Add the index buffer so we can set gl_VertexIndex correctly. + if (!ep_args.empty()) + ep_args += ", "; + switch (msl_options.vertex_index_type) + { + case Options::IndexType::None: + break; + case Options::IndexType::UInt16: + ep_args += join("const device ushort* ", index_buffer_var_name, " [[buffer(", + msl_options.shader_index_buffer_index, ")]]"); + break; + case Options::IndexType::UInt32: + ep_args += join("const device uint* ", index_buffer_var_name, " [[buffer(", + msl_options.shader_index_buffer_index, ")]]"); + break; + } + } + + // Tessellation control shaders get three additional parameters: + // a buffer to hold the per-patch data, a buffer to hold the per-patch + // tessellation levels, and a block of workgroup memory to hold the + // input control point data. + if (is_tesc_shader()) + { + if (patch_stage_out_var_id) + { + if (!ep_args.empty()) + ep_args += ", "; + ep_args += + join("device ", type_to_glsl(get_patch_stage_out_struct_type()), "* ", patch_output_buffer_var_name, + " [[buffer(", convert_to_string(msl_options.shader_patch_output_buffer_index), ")]]"); + } + if (!ep_args.empty()) + ep_args += ", "; + ep_args += join("device ", get_tess_factor_struct_name(), "* ", tess_factor_buffer_var_name, " [[buffer(", + convert_to_string(msl_options.shader_tess_factor_buffer_index), ")]]"); + + // Initializer for tess factors must be handled specially since it's never declared as a normal variable. + uint32_t outer_factor_initializer_id = 0; + uint32_t inner_factor_initializer_id = 0; + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + if (!has_decoration(var.self, DecorationBuiltIn) || var.storage != StorageClassOutput || !var.initializer) + return; + + BuiltIn builtin = BuiltIn(get_decoration(var.self, DecorationBuiltIn)); + if (builtin == BuiltInTessLevelInner) + inner_factor_initializer_id = var.initializer; + else if (builtin == BuiltInTessLevelOuter) + outer_factor_initializer_id = var.initializer; + }); + + const SPIRConstant *c = nullptr; + + if (outer_factor_initializer_id && (c = maybe_get(outer_factor_initializer_id))) + { + auto &entry_func = get(ir.default_entry_point); + entry_func.fixup_hooks_in.push_back( + [=]() + { + uint32_t components = is_tessellating_triangles() ? 3 : 4; + for (uint32_t i = 0; i < components; i++) + { + statement(builtin_to_glsl(BuiltInTessLevelOuter, StorageClassOutput), "[", i, + "] = ", "half(", to_expression(c->subconstants[i]), ");"); + } + }); + } + + if (inner_factor_initializer_id && (c = maybe_get(inner_factor_initializer_id))) + { + auto &entry_func = get(ir.default_entry_point); + if (is_tessellating_triangles()) + { + entry_func.fixup_hooks_in.push_back([=]() { + statement(builtin_to_glsl(BuiltInTessLevelInner, StorageClassOutput), " = ", "half(", + to_expression(c->subconstants[0]), ");"); + }); + } + else + { + entry_func.fixup_hooks_in.push_back([=]() { + for (uint32_t i = 0; i < 2; i++) + { + statement(builtin_to_glsl(BuiltInTessLevelInner, StorageClassOutput), "[", i, "] = ", + "half(", to_expression(c->subconstants[i]), ");"); + } + }); + } + } + + if (stage_in_var_id) + { + if (!ep_args.empty()) + ep_args += ", "; + if (msl_options.multi_patch_workgroup) + { + ep_args += join("device ", type_to_glsl(get_stage_in_struct_type()), "* ", input_buffer_var_name, + " [[buffer(", convert_to_string(msl_options.shader_input_buffer_index), ")]]"); + } + else + { + ep_args += join("threadgroup ", type_to_glsl(get_stage_in_struct_type()), "* ", input_wg_var_name, + " [[threadgroup(", convert_to_string(msl_options.shader_input_wg_index), ")]]"); + } + } + } + } + // Tessellation evaluation shaders get three additional parameters: + // a buffer for the per-patch data, a buffer for the per-patch + // tessellation levels, and a buffer for the control point data. + if (is_tese_shader() && msl_options.raw_buffer_tese_input) + { + if (patch_stage_in_var_id) + { + if (!ep_args.empty()) + ep_args += ", "; + ep_args += + join("const device ", type_to_glsl(get_patch_stage_in_struct_type()), "* ", patch_input_buffer_var_name, + " [[buffer(", convert_to_string(msl_options.shader_patch_input_buffer_index), ")]]"); + } + + if (tess_level_inner_var_id || tess_level_outer_var_id) + { + if (!ep_args.empty()) + ep_args += ", "; + ep_args += join("const device ", get_tess_factor_struct_name(), "* ", tess_factor_buffer_var_name, + " [[buffer(", convert_to_string(msl_options.shader_tess_factor_buffer_index), ")]]"); + } + + if (stage_in_var_id) + { + if (!ep_args.empty()) + ep_args += ", "; + ep_args += join("const device ", type_to_glsl(get_stage_in_struct_type()), "* ", input_buffer_var_name, + " [[buffer(", convert_to_string(msl_options.shader_input_buffer_index), ")]]"); + } + } + + if (is_mesh_shader()) + { + if (!ep_args.empty()) + ep_args += ", "; + ep_args += join("spvMesh_t spvMesh"); + } + + if (get_execution_model() == ExecutionModelTaskEXT) + { + if (!ep_args.empty()) + ep_args += ", "; + ep_args += join("mesh_grid_properties spvMgp"); + } +} + +string CompilerMSL::entry_point_args_argument_buffer(bool append_comma) +{ + string ep_args = entry_point_arg_stage_in(); + Bitset claimed_bindings; + + for (uint32_t i = 0; i < kMaxArgumentBuffers; i++) + { + uint32_t id = argument_buffer_ids[i]; + if (id == 0) + continue; + + add_resource_name(id); + auto &var = get(id); + auto &type = get_variable_data_type(var); + + if (!ep_args.empty()) + ep_args += ", "; + + // Check if the argument buffer binding itself has been remapped. + uint32_t buffer_binding; + auto itr = resource_bindings.find({ get_entry_point().model, i, kArgumentBufferBinding }); + if (itr != end(resource_bindings)) + { + buffer_binding = itr->second.first.msl_buffer; + itr->second.second = true; + } + else + { + // As a fallback, directly map desc set <-> binding. + // If that was taken, take the next buffer binding. + if (claimed_bindings.get(i)) + buffer_binding = next_metal_resource_index_buffer; + else + buffer_binding = i; + } + + claimed_bindings.set(buffer_binding); + + ep_args += get_variable_address_space(var) + " "; + + if (recursive_inputs.count(type.self)) + ep_args += string("void* ") + to_restrict(id, true) + to_name(id) + "_vp"; + else + ep_args += type_to_glsl(type) + "& " + to_restrict(id, true) + to_name(id); + + ep_args += " [[buffer(" + convert_to_string(buffer_binding) + ")]]"; + + next_metal_resource_index_buffer = max(next_metal_resource_index_buffer, buffer_binding + 1); + } + + entry_point_args_discrete_descriptors(ep_args); + entry_point_args_builtin(ep_args); + + if (!ep_args.empty() && append_comma) + ep_args += ", "; + + return ep_args; +} + +const MSLConstexprSampler *CompilerMSL::find_constexpr_sampler(uint32_t id) const +{ + // Try by ID. + { + auto itr = constexpr_samplers_by_id.find(id); + if (itr != end(constexpr_samplers_by_id)) + return &itr->second; + } + + // Try by binding. + { + uint32_t desc_set = get_decoration(id, DecorationDescriptorSet); + uint32_t binding = get_decoration(id, DecorationBinding); + + auto itr = constexpr_samplers_by_binding.find({ desc_set, binding }); + if (itr != end(constexpr_samplers_by_binding)) + return &itr->second; + } + + return nullptr; +} + +void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args) +{ + // Output resources, sorted by resource index & type + // We need to sort to work around a bug on macOS 10.13 with NVidia drivers where switching between shaders + // with different order of buffers can result in issues with buffer assignments inside the driver. + struct Resource + { + SPIRVariable *var; + SPIRVariable *discrete_descriptor_alias; + string name; + SPIRType::BaseType basetype; + uint32_t index; + uint32_t plane; + uint32_t secondary_index; + }; + + SmallVector resources; + + entry_point_bindings.clear(); + ir.for_each_typed_id([&](uint32_t var_id, SPIRVariable &var) { + if ((var.storage == StorageClassUniform || var.storage == StorageClassUniformConstant || + var.storage == StorageClassPushConstant || var.storage == StorageClassStorageBuffer) && + !is_hidden_variable(var)) + { + auto &type = get_variable_data_type(var); + uint32_t desc_set = get_decoration(var_id, DecorationDescriptorSet); + + if (is_supported_argument_buffer_type(type) && var.storage != StorageClassPushConstant) + { + if (descriptor_set_is_argument_buffer(desc_set)) + { + if (is_var_runtime_size_array(var)) + { + // Runtime arrays need to be wrapped in spvDescriptorArray from argument buffer payload. + entry_point_bindings.push_back(&var); + // We'll wrap this, so to_name() will always use non-qualified name. + // We'll need the qualified name to create temporary variable instead. + ir.meta[var_id].decoration.qualified_alias_explicit_override = true; + } + return; + } + } + + // Handle descriptor aliasing of simple discrete cases. + // We can handle aliasing of buffers by casting pointers. + // The amount of aliasing we can perform for discrete descriptors is very limited. + // For fully mutable-style aliasing, we need argument buffers where we can exploit the fact + // that descriptors are all 8 bytes. + SPIRVariable *discrete_descriptor_alias = nullptr; + + const auto resource_is_aliasing_candidate = [this](const SPIRVariable &var_) { + return is_var_runtime_size_array(var_) || var_.storage == StorageClassUniform || + var_.storage == StorageClassStorageBuffer; + }; + + if (resource_is_aliasing_candidate(var)) + { + for (auto &resource : resources) + { + if (resource_is_aliasing_candidate(*resource.var) && + get_decoration(resource.var->self, DecorationDescriptorSet) == + get_decoration(var_id, DecorationDescriptorSet) && + get_decoration(resource.var->self, DecorationBinding) == + get_decoration(var_id, DecorationBinding)) + { + discrete_descriptor_alias = resource.var; + // Self-reference marks that we should declare the resource, + // and it's being used as an alias (so we can emit void* instead). + resource.discrete_descriptor_alias = resource.var; + // Need to promote interlocked usage so that the primary declaration is correct. + if (interlocked_resources.count(var_id)) + interlocked_resources.insert(resource.var->self); + + // Aliasing with unroll just gets too messy to deal with. I sure hope this never comes up ... + if ((is_array(get_variable_data_type(*resource.var)) && !is_var_runtime_size_array(*resource.var)) || + (is_array(get_variable_data_type(var)) && !is_var_runtime_size_array(var))) + { + SPIRV_CROSS_THROW("Attempting to alias same binding with a descriptor array which is not implemented through argument buffers. This is unsupported."); + } + break; + } + } + } + + const MSLConstexprSampler *constexpr_sampler = nullptr; + if (type.basetype == SPIRType::SampledImage || type.basetype == SPIRType::Sampler) + { + constexpr_sampler = find_constexpr_sampler(var_id); + if (constexpr_sampler) + { + // Mark this ID as a constexpr sampler for later in case it came from set/bindings. + constexpr_samplers_by_id[var_id] = *constexpr_sampler; + } + } + + // Emulate texture2D atomic operations + uint32_t secondary_index = 0; + if (atomic_image_vars_emulated.count(var.self)) + { + secondary_index = get_metal_resource_index(var, SPIRType::AtomicCounter, 0); + } + + if (type.basetype == SPIRType::SampledImage) + { + add_resource_name(var_id); + + uint32_t plane_count = 1; + if (constexpr_sampler && constexpr_sampler->ycbcr_conversion_enable) + plane_count = constexpr_sampler->planes; + + entry_point_bindings.push_back(&var); + for (uint32_t i = 0; i < plane_count; i++) + resources.push_back({&var, discrete_descriptor_alias, to_name(var_id), SPIRType::Image, + get_metal_resource_index(var, SPIRType::Image, i), i, secondary_index }); + + if (type.image.dim != DimBuffer && !constexpr_sampler) + { + resources.push_back({&var, discrete_descriptor_alias, to_sampler_expression(var_id), SPIRType::Sampler, + get_metal_resource_index(var, SPIRType::Sampler), 0, 0 }); + } + } + else if (!constexpr_sampler) + { + // constexpr samplers are not declared as resources. + add_resource_name(var_id); + + // Don't allocate resource indices for aliases. + uint32_t resource_index = ~0u; + if (!discrete_descriptor_alias) + resource_index = get_metal_resource_index(var, type.basetype); + + entry_point_bindings.push_back(&var); + resources.push_back({&var, discrete_descriptor_alias, to_name(var_id), type.basetype, + resource_index, 0, secondary_index }); + } + } + }); + + stable_sort(resources.begin(), resources.end(), + [](const Resource &lhs, const Resource &rhs) + { return tie(lhs.basetype, lhs.index) < tie(rhs.basetype, rhs.index); }); + + for (auto &r : resources) + { + auto &var = *r.var; + auto &type = get_variable_data_type(var); + + uint32_t var_id = var.self; + + if (is_var_runtime_size_array(var)) + { + add_spv_func_and_recompile(SPVFuncImplVariableDescriptorArray); + const bool ssbo = has_decoration(type.self, DecorationBufferBlock); + if ((var.storage == StorageClassStorageBuffer || ssbo) && msl_options.runtime_array_rich_descriptor) + add_spv_func_and_recompile(SPVFuncImplVariableSizedDescriptor); + else + add_spv_func_and_recompile(SPVFuncImplVariableDescriptor); + } + + if (r.discrete_descriptor_alias) + { + if (r.var == r.discrete_descriptor_alias) + { + auto primary_name = join("spvBufferAliasSet", + get_decoration(var_id, DecorationDescriptorSet), + "Binding", + get_decoration(var_id, DecorationBinding)); + + // Declare the primary alias as void* + if (!ep_args.empty()) + ep_args += ", "; + ep_args += get_variable_address_space(var) + " void* " + primary_name; + ep_args += " [[buffer(" + convert_to_string(r.index) + ")"; + if (interlocked_resources.count(var_id)) + ep_args += ", raster_order_group(0)"; + ep_args += "]]"; + } + + buffer_aliases_discrete.push_back(r.var->self); + continue; + } + + uint32_t desc_set = get_decoration(var_id, DecorationDescriptorSet); + uint32_t desc_binding = get_decoration(var_id, DecorationBinding); + + if (is_var_runtime_size_array(var)) + { + // This must be implemented as an argument buffer. Cast to intended descriptor array type on-demand. + if (!ep_args.empty()) + ep_args += ", "; + ep_args += join("device const void* spvDescriptorSet", desc_set, "Binding", desc_binding); + if (type.basetype == SPIRType::SampledImage && r.basetype == SPIRType::Sampler) + ep_args += "Smplr"; + ep_args += " [[buffer(" + convert_to_string(r.index) + ")"; + if (interlocked_resources.count(var_id)) + ep_args += ", raster_order_group(0)"; + ep_args += "]]"; + continue; + } + + switch (r.basetype) + { + case SPIRType::Struct: + { + auto &m = ir.meta[type.self]; + if (m.members.size() == 0) + break; + + if (!type.array.empty()) + { + if (type.array.size() > 1) + SPIRV_CROSS_THROW("Arrays of arrays of buffers are not supported."); + + is_using_builtin_array = true; + uint32_t array_size = get_resource_array_size(type, var_id); + for (uint32_t i = 0; i < array_size; ++i) + { + if (!ep_args.empty()) + ep_args += ", "; + ep_args += get_variable_address_space(var) + " " + type_to_glsl(type) + "* " + + to_restrict(var_id, true) + r.name + "_" + convert_to_string(i); + ep_args += " [[buffer(" + convert_to_string(r.index + i) + ")"; + if (interlocked_resources.count(var_id)) + ep_args += ", raster_order_group(0)"; + ep_args += "]]"; + } + is_using_builtin_array = false; + } + else + { + if (!ep_args.empty()) + ep_args += ", "; + ep_args += get_variable_address_space(var) + " "; + + if (recursive_inputs.count(type.self)) + ep_args += string("void* ") + to_restrict(var_id, true) + r.name + "_vp"; + else + ep_args += type_to_glsl(type) + "& " + to_restrict(var_id, true) + r.name; + + ep_args += " [[buffer(" + convert_to_string(r.index) + ")"; + if (interlocked_resources.count(var_id)) + ep_args += ", raster_order_group(0)"; + ep_args += "]]"; + } + break; + } + case SPIRType::Sampler: + if (!ep_args.empty()) + ep_args += ", "; + ep_args += sampler_type(type, var_id, false) + " " + r.name; + ep_args += " [[sampler(" + convert_to_string(r.index) + ")]]"; + break; + case SPIRType::Image: + { + if (!ep_args.empty()) + ep_args += ", "; + + // Use Metal's native frame-buffer fetch API for subpass inputs. + const auto &basetype = get(var.basetype); + if (!type_is_msl_framebuffer_fetch(basetype)) + { + ep_args += image_type_glsl(type, var_id, false) + " " + r.name; + if (r.plane > 0) + ep_args += join(plane_name_suffix, r.plane); + + ep_args += " [[texture(" + convert_to_string(r.index) + ")"; + + if (interlocked_resources.count(var_id)) + ep_args += ", raster_order_group(0)"; + ep_args += "]]"; + } + else + { + if (msl_options.is_macos() && !msl_options.supports_msl_version(2, 3)) + SPIRV_CROSS_THROW("Framebuffer fetch on Mac is not supported before MSL 2.3."); + ep_args += image_type_glsl(type, var_id, false) + " " + r.name; + ep_args += " [[color(" + convert_to_string(r.index) + ")]]"; + } + + // Emulate texture2D atomic operations + if (atomic_image_vars_emulated.count(var.self)) + { + auto &flags = ir.get_decoration_bitset(var.self); + const char *cv_flags = decoration_flags_signal_volatile(flags) ? "volatile " : ""; + ep_args += join(", ", cv_flags, "device atomic_", type_to_glsl(get(basetype.image.type), 0)); + ep_args += "* " + r.name + "_atomic"; + ep_args += " [[buffer(" + convert_to_string(r.secondary_index) + ")"; + if (interlocked_resources.count(var_id)) + ep_args += ", raster_order_group(0)"; + ep_args += "]]"; + } + break; + } + case SPIRType::AccelerationStructure: + { + if (!ep_args.empty()) + ep_args += ", "; + ep_args += type_to_glsl(type, var_id) + " " + r.name; + ep_args += " [[buffer(" + convert_to_string(r.index) + ")]]"; + break; + } + default: + if (!ep_args.empty()) + ep_args += ", "; + if (!type.pointer) + ep_args += get_type_address_space(get(var.basetype), var_id) + " " + + type_to_glsl(type, var_id) + "& " + r.name; + else + ep_args += type_to_glsl(type, var_id) + " " + r.name; + ep_args += " [[buffer(" + convert_to_string(r.index) + ")"; + if (interlocked_resources.count(var_id)) + ep_args += ", raster_order_group(0)"; + ep_args += "]]"; + break; + } + } +} + +// Returns a string containing a comma-delimited list of args for the entry point function +// This is the "classic" method of MSL 1 when we don't have argument buffer support. +string CompilerMSL::entry_point_args_classic(bool append_comma) +{ + string ep_args = entry_point_arg_stage_in(); + entry_point_args_discrete_descriptors(ep_args); + entry_point_args_builtin(ep_args); + + if (!ep_args.empty() && append_comma) + ep_args += ", "; + + return ep_args; +} + +void CompilerMSL::fix_up_shader_inputs_outputs() +{ + auto &entry_func = this->get(ir.default_entry_point); + + // Emit a guard to ensure we don't execute beyond the last vertex. + // Vertex shaders shouldn't have the problems with barriers in non-uniform control flow that + // tessellation control shaders do, so early returns should be OK. We may need to revisit this + // if it ever becomes possible to use barriers from a vertex shader. + if (get_execution_model() == ExecutionModelVertex && msl_options.vertex_for_tessellation) + { + entry_func.fixup_hooks_in.push_back([this]() { + statement("if (any(", to_expression(builtin_invocation_id_id), + " >= ", to_expression(builtin_stage_input_size_id), "))"); + statement(" return;"); + }); + } + + if (is_mesh_shader()) + { + // If shader doesn't call SetMeshOutputsEXT, nothing should be rendered. + // No need to barrier after this, because only thread 0 writes to this later. + entry_func.fixup_hooks_in.push_back([this]() { statement("if (gl_LocalInvocationIndex == 0) spvMeshSizes.y = 0u;"); }); + entry_func.fixup_hooks_out.push_back([this]() { emit_mesh_outputs(); }); + } + + // Look for sampled images and buffer. Add hooks to set up the swizzle constants or array lengths. + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + auto &type = get_variable_data_type(var); + uint32_t var_id = var.self; + bool ssbo = has_decoration(type.self, DecorationBufferBlock); + + if (var.storage == StorageClassUniformConstant && !is_hidden_variable(var)) + { + if (msl_options.swizzle_texture_samples && has_sampled_images && is_sampled_image_type(type)) + { + entry_func.fixup_hooks_in.push_back([this, &type, &var, var_id]() { + bool is_array_type = !type.array.empty(); + + uint32_t desc_set = get_decoration(var_id, DecorationDescriptorSet); + if (descriptor_set_is_argument_buffer(desc_set)) + { + statement("constant uint", is_array_type ? "* " : "& ", to_swizzle_expression(var_id), + is_array_type ? " = &" : " = ", to_name(argument_buffer_ids[desc_set]), + ".spvSwizzleConstants", "[", + convert_to_string(get_metal_resource_index(var, SPIRType::Image)), "];"); + } + else + { + // If we have an array of images, we need to be able to index into it, so take a pointer instead. + statement("constant uint", is_array_type ? "* " : "& ", to_swizzle_expression(var_id), + is_array_type ? " = &" : " = ", to_name(swizzle_buffer_id), "[", + convert_to_string(get_metal_resource_index(var, SPIRType::Image)), "];"); + } + }); + } + } + else if ((var.storage == StorageClassStorageBuffer || (var.storage == StorageClassUniform && ssbo)) && + !is_hidden_variable(var)) + { + if (buffer_requires_array_length(var.self)) + { + entry_func.fixup_hooks_in.push_back( + [this, &type, &var, var_id]() + { + bool is_array_type = !type.array.empty() && !is_var_runtime_size_array(var); + + uint32_t desc_set = get_decoration(var_id, DecorationDescriptorSet); + if (descriptor_set_is_argument_buffer(desc_set)) + { + statement("constant uint", is_array_type ? "* " : "& ", to_buffer_size_expression(var_id), + is_array_type ? " = &" : " = ", to_name(argument_buffer_ids[desc_set]), + ".spvBufferSizeConstants", "[", + convert_to_string(get_metal_resource_index(var, SPIRType::UInt)), "];"); + } + else + { + // If we have an array of images, we need to be able to index into it, so take a pointer instead. + statement("constant uint", is_array_type ? "* " : "& ", to_buffer_size_expression(var_id), + is_array_type ? " = &" : " = ", to_name(buffer_size_buffer_id), "[", + convert_to_string(get_metal_resource_index(var, type.basetype)), "];"); + } + }); + } + } + + if (!msl_options.argument_buffers && + msl_options.replace_recursive_inputs && type_contains_recursion(type) && + (var.storage == StorageClassUniform || var.storage == StorageClassUniformConstant || + var.storage == StorageClassPushConstant || var.storage == StorageClassStorageBuffer)) + { + recursive_inputs.insert(type.self); + entry_func.fixup_hooks_in.push_back([this, &type, &var, var_id]() { + auto addr_space = get_variable_address_space(var); + auto var_name = to_name(var_id); + statement(addr_space, " auto& ", to_restrict(var_id, true), var_name, + " = *(", addr_space, " ", type_to_glsl(type), "*)", var_name, "_vp;"); + }); + } + }); + + // Builtin variables + ir.for_each_typed_id([this, &entry_func](uint32_t, SPIRVariable &var) { + uint32_t var_id = var.self; + BuiltIn bi_type = ir.meta[var_id].decoration.builtin_type; + + if (var.storage != StorageClassInput && var.storage != StorageClassOutput) + return; + if (!interface_variable_exists_in_entry_point(var.self)) + return; + + if (var.storage == StorageClassInput && is_builtin_variable(var) && active_input_builtins.get(bi_type)) + { + switch (bi_type) + { + case BuiltInSamplePosition: + entry_func.fixup_hooks_in.push_back([=]() { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = get_sample_position(", + to_expression(builtin_sample_id_id), ");"); + }); + break; + case BuiltInFragCoord: + if (is_sample_rate()) + { + entry_func.fixup_hooks_in.push_back([=]() { + statement(to_expression(var_id), ".xy += get_sample_position(", + to_expression(builtin_sample_id_id), ") - 0.5;"); + }); + } + break; + case BuiltInInvocationId: + // This is direct-mapped without multi-patch workgroups. + if (!is_tesc_shader() || !msl_options.multi_patch_workgroup) + break; + + entry_func.fixup_hooks_in.push_back([=]() { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", + to_expression(builtin_invocation_id_id), ".x % ", this->get_entry_point().output_vertices, + ";"); + }); + break; + case BuiltInPrimitiveId: + // This is natively supported by fragment and tessellation evaluation shaders. + // In tessellation control shaders, this is direct-mapped without multi-patch workgroups. + if (!is_tesc_shader() || !msl_options.multi_patch_workgroup) + break; + + entry_func.fixup_hooks_in.push_back([=]() { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = min(", + to_expression(builtin_invocation_id_id), ".x / ", this->get_entry_point().output_vertices, + ", spvIndirectParams[1] - 1);"); + }); + break; + case BuiltInPatchVertices: + if (is_tese_shader()) + { + if (msl_options.raw_buffer_tese_input) + { + entry_func.fixup_hooks_in.push_back( + [=]() { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", + get_entry_point().output_vertices, ";"); + }); + } + else + { + entry_func.fixup_hooks_in.push_back( + [=]() + { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", + to_expression(patch_stage_in_var_id), ".gl_in.size();"); + }); + } + } + else + { + entry_func.fixup_hooks_in.push_back([=]() { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = spvIndirectParams[0];"); + }); + } + break; + case BuiltInTessCoord: + if (get_entry_point().flags.get(ExecutionModeQuads)) + { + // The entry point will only have a float2 TessCoord variable. + // Pad to float3. + entry_func.fixup_hooks_in.push_back([=]() { + auto name = builtin_to_glsl(BuiltInTessCoord, StorageClassInput); + statement("float3 " + name + " = float3(" + name + "In.x, " + name + "In.y, 0.0);"); + }); + } + + // Emit a fixup to account for the shifted domain. Don't do this for triangles; + // MoltenVK will just reverse the winding order instead. + if (msl_options.tess_domain_origin_lower_left && !is_tessellating_triangles()) + { + string tc = to_expression(var_id); + entry_func.fixup_hooks_in.push_back([=]() { statement(tc, ".y = 1.0 - ", tc, ".y;"); }); + } + break; + case BuiltInSubgroupId: + if (!msl_options.emulate_subgroups) + break; + // For subgroup emulation, this is the same as the local invocation index. + entry_func.fixup_hooks_in.push_back([=]() { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", + to_expression(builtin_local_invocation_index_id), ";"); + }); + break; + case BuiltInNumSubgroups: + if (!msl_options.emulate_subgroups) + break; + // For subgroup emulation, this is the same as the workgroup size. + entry_func.fixup_hooks_in.push_back([=]() { + auto &type = expression_type(builtin_workgroup_size_id); + string size_expr = to_expression(builtin_workgroup_size_id); + if (type.vecsize >= 3) + size_expr = join(size_expr, ".x * ", size_expr, ".y * ", size_expr, ".z"); + else if (type.vecsize == 2) + size_expr = join(size_expr, ".x * ", size_expr, ".y"); + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", size_expr, ";"); + }); + break; + case BuiltInSubgroupLocalInvocationId: + if (!msl_options.emulate_subgroups) + break; + // For subgroup emulation, assume subgroups of size 1. + entry_func.fixup_hooks_in.push_back( + [=]() { statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = 0;"); }); + break; + case BuiltInSubgroupSize: + if (msl_options.emulate_subgroups) + { + // For subgroup emulation, assume subgroups of size 1. + entry_func.fixup_hooks_in.push_back( + [=]() { statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = 1;"); }); + } + else if (msl_options.fixed_subgroup_size != 0) + { + entry_func.fixup_hooks_in.push_back([=]() { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", + msl_options.fixed_subgroup_size, ";"); + }); + } + break; + case BuiltInSubgroupEqMask: + if (msl_options.is_ios() && !msl_options.supports_msl_version(2, 2)) + SPIRV_CROSS_THROW("Subgroup ballot functionality requires Metal 2.2 on iOS."); + if (!msl_options.supports_msl_version(2, 1)) + SPIRV_CROSS_THROW("Subgroup ballot functionality requires Metal 2.1."); + entry_func.fixup_hooks_in.push_back([=]() { + if (msl_options.is_ios()) + { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", "uint4(1 << ", + to_expression(builtin_subgroup_invocation_id_id), ", uint3(0));"); + } + else + { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", + to_expression(builtin_subgroup_invocation_id_id), " >= 32 ? uint4(0, (1 << (", + to_expression(builtin_subgroup_invocation_id_id), " - 32)), uint2(0)) : uint4(1 << ", + to_expression(builtin_subgroup_invocation_id_id), ", uint3(0));"); + } + }); + break; + case BuiltInSubgroupGeMask: + if (msl_options.is_ios() && !msl_options.supports_msl_version(2, 2)) + SPIRV_CROSS_THROW("Subgroup ballot functionality requires Metal 2.2 on iOS."); + if (!msl_options.supports_msl_version(2, 1)) + SPIRV_CROSS_THROW("Subgroup ballot functionality requires Metal 2.1."); + if (msl_options.fixed_subgroup_size != 0) + add_spv_func_and_recompile(SPVFuncImplSubgroupBallot); + entry_func.fixup_hooks_in.push_back([=]() { + // Case where index < 32, size < 32: + // mask0 = bfi(0, 0xFFFFFFFF, index, size - index); + // mask1 = bfi(0, 0xFFFFFFFF, 0, 0); // Gives 0 + // Case where index < 32 but size >= 32: + // mask0 = bfi(0, 0xFFFFFFFF, index, 32 - index); + // mask1 = bfi(0, 0xFFFFFFFF, 0, size - 32); + // Case where index >= 32: + // mask0 = bfi(0, 0xFFFFFFFF, 32, 0); // Gives 0 + // mask1 = bfi(0, 0xFFFFFFFF, index - 32, size - index); + // This is expressed without branches to avoid divergent + // control flow--hence the complicated min/max expressions. + // This is further complicated by the fact that if you attempt + // to bfi/bfe out-of-bounds on Metal, undefined behavior is the + // result. + if (msl_options.fixed_subgroup_size > 32) + { + // Don't use the subgroup size variable with fixed subgroup sizes, + // since the variables could be defined in the wrong order. + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), + " = uint4(insert_bits(0u, 0xFFFFFFFF, min(", + to_expression(builtin_subgroup_invocation_id_id), ", 32u), (uint)max(32 - (int)", + to_expression(builtin_subgroup_invocation_id_id), + ", 0)), insert_bits(0u, 0xFFFFFFFF," + " (uint)max((int)", + to_expression(builtin_subgroup_invocation_id_id), " - 32, 0), ", + msl_options.fixed_subgroup_size, " - max(", + to_expression(builtin_subgroup_invocation_id_id), + ", 32u)), uint2(0));"); + } + else if (msl_options.fixed_subgroup_size != 0) + { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), + " = uint4(insert_bits(0u, 0xFFFFFFFF, ", + to_expression(builtin_subgroup_invocation_id_id), ", ", + msl_options.fixed_subgroup_size, " - ", + to_expression(builtin_subgroup_invocation_id_id), + "), uint3(0));"); + } + else if (msl_options.is_ios()) + { + // On iOS, the SIMD-group size will currently never exceed 32. + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), + " = uint4(insert_bits(0u, 0xFFFFFFFF, ", + to_expression(builtin_subgroup_invocation_id_id), ", ", + to_expression(builtin_subgroup_size_id), " - ", + to_expression(builtin_subgroup_invocation_id_id), "), uint3(0));"); + } + else + { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), + " = uint4(insert_bits(0u, 0xFFFFFFFF, min(", + to_expression(builtin_subgroup_invocation_id_id), ", 32u), (uint)max(min((int)", + to_expression(builtin_subgroup_size_id), ", 32) - (int)", + to_expression(builtin_subgroup_invocation_id_id), + ", 0)), insert_bits(0u, 0xFFFFFFFF, (uint)max((int)", + to_expression(builtin_subgroup_invocation_id_id), " - 32, 0), (uint)max((int)", + to_expression(builtin_subgroup_size_id), " - (int)max(", + to_expression(builtin_subgroup_invocation_id_id), ", 32u), 0)), uint2(0));"); + } + }); + break; + case BuiltInSubgroupGtMask: + if (msl_options.is_ios() && !msl_options.supports_msl_version(2, 2)) + SPIRV_CROSS_THROW("Subgroup ballot functionality requires Metal 2.2 on iOS."); + if (!msl_options.supports_msl_version(2, 1)) + SPIRV_CROSS_THROW("Subgroup ballot functionality requires Metal 2.1."); + add_spv_func_and_recompile(SPVFuncImplSubgroupBallot); + entry_func.fixup_hooks_in.push_back([=]() { + // The same logic applies here, except now the index is one + // more than the subgroup invocation ID. + if (msl_options.fixed_subgroup_size > 32) + { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), + " = uint4(insert_bits(0u, 0xFFFFFFFF, min(", + to_expression(builtin_subgroup_invocation_id_id), " + 1, 32u), (uint)max(32 - (int)", + to_expression(builtin_subgroup_invocation_id_id), + " - 1, 0)), insert_bits(0u, 0xFFFFFFFF, (uint)max((int)", + to_expression(builtin_subgroup_invocation_id_id), " + 1 - 32, 0), ", + msl_options.fixed_subgroup_size, " - max(", + to_expression(builtin_subgroup_invocation_id_id), + " + 1, 32u)), uint2(0));"); + } + else if (msl_options.fixed_subgroup_size != 0) + { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), + " = uint4(insert_bits(0u, 0xFFFFFFFF, ", + to_expression(builtin_subgroup_invocation_id_id), " + 1, ", + msl_options.fixed_subgroup_size, " - ", + to_expression(builtin_subgroup_invocation_id_id), + " - 1), uint3(0));"); + } + else if (msl_options.is_ios()) + { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), + " = uint4(insert_bits(0u, 0xFFFFFFFF, ", + to_expression(builtin_subgroup_invocation_id_id), " + 1, ", + to_expression(builtin_subgroup_size_id), " - ", + to_expression(builtin_subgroup_invocation_id_id), " - 1), uint3(0));"); + } + else + { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), + " = uint4(insert_bits(0u, 0xFFFFFFFF, min(", + to_expression(builtin_subgroup_invocation_id_id), " + 1, 32u), (uint)max(min((int)", + to_expression(builtin_subgroup_size_id), ", 32) - (int)", + to_expression(builtin_subgroup_invocation_id_id), + " - 1, 0)), insert_bits(0u, 0xFFFFFFFF, (uint)max((int)", + to_expression(builtin_subgroup_invocation_id_id), " + 1 - 32, 0), (uint)max((int)", + to_expression(builtin_subgroup_size_id), " - (int)max(", + to_expression(builtin_subgroup_invocation_id_id), " + 1, 32u), 0)), uint2(0));"); + } + }); + break; + case BuiltInSubgroupLeMask: + if (msl_options.is_ios() && !msl_options.supports_msl_version(2, 2)) + SPIRV_CROSS_THROW("Subgroup ballot functionality requires Metal 2.2 on iOS."); + if (!msl_options.supports_msl_version(2, 1)) + SPIRV_CROSS_THROW("Subgroup ballot functionality requires Metal 2.1."); + add_spv_func_and_recompile(SPVFuncImplSubgroupBallot); + entry_func.fixup_hooks_in.push_back([=]() { + if (msl_options.is_ios()) + { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), + " = uint4(extract_bits(0xFFFFFFFF, 0, ", + to_expression(builtin_subgroup_invocation_id_id), " + 1), uint3(0));"); + } + else + { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), + " = uint4(extract_bits(0xFFFFFFFF, 0, min(", + to_expression(builtin_subgroup_invocation_id_id), + " + 1, 32u)), extract_bits(0xFFFFFFFF, 0, (uint)max((int)", + to_expression(builtin_subgroup_invocation_id_id), " + 1 - 32, 0)), uint2(0));"); + } + }); + break; + case BuiltInSubgroupLtMask: + if (msl_options.is_ios() && !msl_options.supports_msl_version(2, 2)) + SPIRV_CROSS_THROW("Subgroup ballot functionality requires Metal 2.2 on iOS."); + if (!msl_options.supports_msl_version(2, 1)) + SPIRV_CROSS_THROW("Subgroup ballot functionality requires Metal 2.1."); + add_spv_func_and_recompile(SPVFuncImplSubgroupBallot); + entry_func.fixup_hooks_in.push_back([=]() { + if (msl_options.is_ios()) + { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), + " = uint4(extract_bits(0xFFFFFFFF, 0, ", + to_expression(builtin_subgroup_invocation_id_id), "), uint3(0));"); + } + else + { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), + " = uint4(extract_bits(0xFFFFFFFF, 0, min(", + to_expression(builtin_subgroup_invocation_id_id), + ", 32u)), extract_bits(0xFFFFFFFF, 0, (uint)max((int)", + to_expression(builtin_subgroup_invocation_id_id), " - 32, 0)), uint2(0));"); + } + }); + break; + case BuiltInViewIndex: + if (!msl_options.multiview) + { + // According to the Vulkan spec, when not running under a multiview + // render pass, ViewIndex is 0. + entry_func.fixup_hooks_in.push_back([=]() { + statement("const ", builtin_type_decl(bi_type), " ", to_expression(var_id), " = 0;"); + }); + } + else if (msl_options.view_index_from_device_index) + { + // In this case, we take the view index from that of the device we're running on. + entry_func.fixup_hooks_in.push_back([=]() { + statement("const ", builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", + msl_options.device_index, ";"); + }); + // We actually don't want to set the render_target_array_index here. + // Since every physical device is rendering a different view, + // there's no need for layered rendering here. + } + else if (!msl_options.multiview_layered_rendering) + { + // In this case, the views are rendered one at a time. The view index, then, + // is just the first part of the "view mask". + entry_func.fixup_hooks_in.push_back([=]() { + statement("const ", builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", + to_expression(view_mask_buffer_id), "[0];"); + }); + } + else if (get_execution_model() == ExecutionModelFragment) + { + // Because we adjusted the view index in the vertex shader, we have to + // adjust it back here. + entry_func.fixup_hooks_in.push_back([=]() { + statement(to_expression(var_id), " += ", to_expression(view_mask_buffer_id), "[0];"); + }); + } + else if (get_execution_model() == ExecutionModelVertex) + { + // Metal provides no special support for multiview, so we smuggle + // the view index in the instance index. + entry_func.fixup_hooks_in.push_back([=]() { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", + to_expression(view_mask_buffer_id), "[0] + (", to_expression(builtin_instance_idx_id), + " - ", to_expression(builtin_base_instance_id), ") % ", + to_expression(view_mask_buffer_id), "[1];"); + statement(to_expression(builtin_instance_idx_id), " = (", + to_expression(builtin_instance_idx_id), " - ", + to_expression(builtin_base_instance_id), ") / ", to_expression(view_mask_buffer_id), + "[1] + ", to_expression(builtin_base_instance_id), ";"); + }); + // In addition to setting the variable itself, we also need to + // set the render_target_array_index with it on output. We have to + // offset this by the base view index, because Metal isn't in on + // our little game here. + entry_func.fixup_hooks_out.push_back([=]() { + statement(to_expression(builtin_layer_id), " = ", to_expression(var_id), " - ", + to_expression(view_mask_buffer_id), "[0];"); + }); + } + break; + case BuiltInDeviceIndex: + // Metal pipelines belong to the devices which create them, so we'll + // need to create a MTLPipelineState for every MTLDevice in a grouped + // VkDevice. We can assume, then, that the device index is constant. + entry_func.fixup_hooks_in.push_back([=]() { + statement("const ", builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", + msl_options.device_index, ";"); + }); + break; + case BuiltInWorkgroupId: + if (!msl_options.dispatch_base || !active_input_builtins.get(BuiltInWorkgroupId)) + break; + + // The vkCmdDispatchBase() command lets the client set the base value + // of WorkgroupId. Metal has no direct equivalent; we must make this + // adjustment ourselves. + entry_func.fixup_hooks_in.push_back([=]() { + statement(to_expression(var_id), " += ", to_dereferenced_expression(builtin_dispatch_base_id), ";"); + }); + break; + case BuiltInGlobalInvocationId: + if (!msl_options.dispatch_base || !active_input_builtins.get(BuiltInGlobalInvocationId)) + break; + + // GlobalInvocationId is defined as LocalInvocationId + WorkgroupId * WorkgroupSize. + // This needs to be adjusted too. + entry_func.fixup_hooks_in.push_back([=]() { + auto &execution = this->get_entry_point(); + uint32_t workgroup_size_id = execution.workgroup_size.constant; + if (workgroup_size_id) + statement(to_expression(var_id), " += ", to_dereferenced_expression(builtin_dispatch_base_id), + " * ", to_expression(workgroup_size_id), ";"); + else + statement(to_expression(var_id), " += ", to_dereferenced_expression(builtin_dispatch_base_id), + " * uint3(", execution.workgroup_size.x, ", ", execution.workgroup_size.y, ", ", + execution.workgroup_size.z, ");"); + }); + break; + case BuiltInVertexId: + case BuiltInVertexIndex: + // This is direct-mapped normally. + if (!msl_options.vertex_for_tessellation) + break; + + entry_func.fixup_hooks_in.push_back([=]() { + builtin_declaration = true; + switch (msl_options.vertex_index_type) + { + case Options::IndexType::None: + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", + to_expression(builtin_invocation_id_id), ".x + ", + to_expression(builtin_dispatch_base_id), ".x;"); + break; + case Options::IndexType::UInt16: + case Options::IndexType::UInt32: + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", index_buffer_var_name, + "[", to_expression(builtin_invocation_id_id), ".x] + ", + to_expression(builtin_dispatch_base_id), ".x;"); + break; + } + builtin_declaration = false; + }); + break; + case BuiltInBaseVertex: + // This is direct-mapped normally. + if (!msl_options.vertex_for_tessellation) + break; + + entry_func.fixup_hooks_in.push_back([=]() { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", + to_expression(builtin_dispatch_base_id), ".x;"); + }); + break; + case BuiltInInstanceId: + case BuiltInInstanceIndex: + // This is direct-mapped normally. + if (!msl_options.vertex_for_tessellation) + break; + + entry_func.fixup_hooks_in.push_back([=]() { + builtin_declaration = true; + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", + to_expression(builtin_invocation_id_id), ".y + ", to_expression(builtin_dispatch_base_id), + ".y;"); + builtin_declaration = false; + }); + break; + case BuiltInBaseInstance: + // This is direct-mapped normally. + if (!msl_options.vertex_for_tessellation) + break; + + entry_func.fixup_hooks_in.push_back([=]() { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", + to_expression(builtin_dispatch_base_id), ".y;"); + }); + break; + default: + break; + } + } + else if (var.storage == StorageClassOutput && get_execution_model() == ExecutionModelFragment && + is_builtin_variable(var) && active_output_builtins.get(bi_type)) + { + switch (bi_type) + { + case BuiltInSampleMask: + if (has_additional_fixed_sample_mask()) + { + // If the additional fixed sample mask was set, we need to adjust the sample_mask + // output to reflect that. If the shader outputs the sample_mask itself too, we need + // to AND the two masks to get the final one. + string op_str = does_shader_write_sample_mask ? " &= " : " = "; + entry_func.fixup_hooks_out.push_back([=]() { + statement(to_expression(builtin_sample_mask_id), op_str, additional_fixed_sample_mask_str(), ";"); + }); + } + break; + case BuiltInFragDepth: + if (msl_options.input_attachment_is_ds_attachment && !writes_to_depth) + { + entry_func.fixup_hooks_out.push_back([=]() { + statement(to_expression(builtin_frag_depth_id), " = ", to_expression(builtin_frag_coord_id), ".z;"); + }); + } + break; + default: + break; + } + } + }); +} + +// Returns the Metal index of the resource of the specified type as used by the specified variable. +uint32_t CompilerMSL::get_metal_resource_index(SPIRVariable &var, SPIRType::BaseType basetype, uint32_t plane) +{ + auto &execution = get_entry_point(); + auto &var_dec = ir.meta[var.self].decoration; + auto &var_type = get(var.basetype); + uint32_t var_desc_set = (var.storage == StorageClassPushConstant) ? kPushConstDescSet : var_dec.set; + uint32_t var_binding = (var.storage == StorageClassPushConstant) ? kPushConstBinding : var_dec.binding; + + // If a matching binding has been specified, find and use it. + auto itr = resource_bindings.find({ execution.model, var_desc_set, var_binding }); + + // Atomic helper buffers for image atomics need to use secondary bindings as well. + bool use_secondary_binding = (var_type.basetype == SPIRType::SampledImage && basetype == SPIRType::Sampler) || + basetype == SPIRType::AtomicCounter; + + auto resource_decoration = + use_secondary_binding ? SPIRVCrossDecorationResourceIndexSecondary : SPIRVCrossDecorationResourceIndexPrimary; + + if (plane == 1) + resource_decoration = SPIRVCrossDecorationResourceIndexTertiary; + if (plane == 2) + resource_decoration = SPIRVCrossDecorationResourceIndexQuaternary; + + if (itr != end(resource_bindings)) + { + auto &remap = itr->second; + remap.second = true; + switch (basetype) + { + case SPIRType::Image: + set_extended_decoration(var.self, resource_decoration, remap.first.msl_texture + plane); + return remap.first.msl_texture + plane; + case SPIRType::Sampler: + set_extended_decoration(var.self, resource_decoration, remap.first.msl_sampler); + return remap.first.msl_sampler; + default: + set_extended_decoration(var.self, resource_decoration, remap.first.msl_buffer); + return remap.first.msl_buffer; + } + } + + // If we have already allocated an index, keep using it. + if (has_extended_decoration(var.self, resource_decoration)) + return get_extended_decoration(var.self, resource_decoration); + + auto &type = get(var.basetype); + + if (type_is_msl_framebuffer_fetch(type)) + { + // Frame-buffer fetch gets its fallback resource index from the input attachment index, + // which is then treated as color index. + return get_decoration(var.self, DecorationInputAttachmentIndex); + } + else if (msl_options.enable_decoration_binding) + { + // Allow user to enable decoration binding. + // If there is no explicit mapping of bindings to MSL, use the declared binding as a fallback. + if (has_decoration(var.self, DecorationBinding)) + { + var_binding = get_decoration(var.self, DecorationBinding); + // Avoid emitting sentinel bindings. + if (var_binding < 0x80000000u) + return var_binding; + } + } + + // If we did not explicitly remap, allocate bindings on demand. + // We cannot reliably use Binding decorations since SPIR-V and MSL's binding models are very different. + + bool allocate_argument_buffer_ids = false; + + if (var.storage != StorageClassPushConstant) + allocate_argument_buffer_ids = descriptor_set_is_argument_buffer(var_desc_set); + + uint32_t binding_stride = 1; + for (uint32_t i = 0; i < uint32_t(type.array.size()); i++) + binding_stride *= to_array_size_literal(type, i); + + // If a binding has not been specified, revert to incrementing resource indices. + uint32_t resource_index; + + if (allocate_argument_buffer_ids) + { + // Allocate from a flat ID binding space. + resource_index = next_metal_resource_ids[var_desc_set]; + next_metal_resource_ids[var_desc_set] += binding_stride; + } + else + { + if (is_var_runtime_size_array(var)) + { + basetype = SPIRType::Struct; + binding_stride = 1; + } + // Allocate from plain bindings which are allocated per resource type. + switch (basetype) + { + case SPIRType::Image: + resource_index = next_metal_resource_index_texture; + next_metal_resource_index_texture += binding_stride; + break; + case SPIRType::Sampler: + resource_index = next_metal_resource_index_sampler; + next_metal_resource_index_sampler += binding_stride; + break; + default: + resource_index = next_metal_resource_index_buffer; + next_metal_resource_index_buffer += binding_stride; + break; + } + } + + set_extended_decoration(var.self, resource_decoration, resource_index); + return resource_index; +} + +bool CompilerMSL::type_is_msl_framebuffer_fetch(const SPIRType &type) const +{ + return type.basetype == SPIRType::Image && type.image.dim == DimSubpassData && + msl_options.use_framebuffer_fetch_subpasses; +} + +const char *CompilerMSL::descriptor_address_space(uint32_t id, StorageClass storage, const char *plain_address_space) const +{ + if (msl_options.argument_buffers) + { + bool storage_class_is_descriptor = storage == StorageClassUniform || + storage == StorageClassStorageBuffer || + storage == StorageClassUniformConstant; + + uint32_t desc_set = get_decoration(id, DecorationDescriptorSet); + if (storage_class_is_descriptor && descriptor_set_is_argument_buffer(desc_set)) + { + // An awkward case where we need to emit *more* address space declarations (yay!). + // An example is where we pass down an array of buffer pointers to leaf functions. + // It's a constant array containing pointers to constants. + // The pointer array is always constant however. E.g. + // device SSBO * constant (&array)[N]. + // const device SSBO * constant (&array)[N]. + // constant SSBO * constant (&array)[N]. + // However, this only matters for argument buffers, since for MSL 1.0 style codegen, + // we emit the buffer array on stack instead, and that seems to work just fine apparently. + + // If the argument was marked as being in device address space, any pointer to member would + // be const device, not constant. + if (argument_buffer_device_storage_mask & (1u << desc_set)) + return "const device"; + else + return "constant"; + } + } + + return plain_address_space; +} + +string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) +{ + auto &var = get(arg.id); + auto &var_type = get(arg.type); + StorageClass type_storage = var_type.storage; + + // Physical pointer types are passed by pointer, not reference. + auto &data_type = get_variable_data_type(var); + bool passed_by_value = arg.alias_global_variable ? false : is_physical_or_buffer_pointer(var_type); + auto &type = passed_by_value ? var_type : data_type; + + // If we need to modify the name of the variable, make sure we use the original variable. + // Our alias is just a shadow variable. + uint32_t name_id = var.self; + if (arg.alias_global_variable && var.basevariable) + name_id = var.basevariable; + + bool constref = !arg.alias_global_variable && !passed_by_value && is_pointer(var_type) && arg.write_count == 0; + // Framebuffer fetch is plain value, const looks out of place, but it is not wrong. + // readonly coming from glslang is not reliable in all cases. + // For UBOs, readonly is implied, and for SSBOs we use global check. + if (type_is_msl_framebuffer_fetch(type) || + type_storage == StorageClassStorageBuffer || + type_storage == StorageClassUniform || + type_storage == StorageClassPhysicalStorageBuffer) + { + constref = false; + } + else if (type_storage == StorageClassUniformConstant) + { + constref = true; + } + + bool type_is_image = type.basetype == SPIRType::Image || type.basetype == SPIRType::SampledImage || + type.basetype == SPIRType::Sampler; + bool type_is_tlas = type.basetype == SPIRType::AccelerationStructure; + + // For opaque types we handle const later due to descriptor address spaces. + const char *cv_qualifier = (constref && !type_is_image) ? "const " : ""; + string decl; + + // If this is a combined image-sampler for a 2D image with floating-point type, + // we emitted the 'spvDynamicImageSampler' type, and this is *not* an alias parameter + // for a global, then we need to emit a "dynamic" combined image-sampler. + // Unfortunately, this is necessary to properly support passing around + // combined image-samplers with Y'CbCr conversions on them. + bool is_dynamic_img_sampler = !arg.alias_global_variable && type.basetype == SPIRType::SampledImage && + type.image.dim == Dim2D && type_is_floating_point(get(type.image.type)) && + spv_function_implementations.count(SPVFuncImplDynamicImageSampler); + + // Allow Metal to use the array template to make arrays a value type + string address_space = arg.alias_global_variable ? get_variable_address_space(var) : get_leaf_argument_address_space(var); + bool builtin = has_decoration(var.self, DecorationBuiltIn); + auto builtin_type = BuiltIn(get_decoration(arg.id, DecorationBuiltIn)); + + if (var.basevariable && (var.basevariable == stage_in_ptr_var_id || var.basevariable == stage_out_ptr_var_id)) + decl = join(cv_qualifier, type_to_glsl(type, arg.id)); + else if (builtin && !is_mesh_shader()) + { + // Only use templated array for Clip/Cull distance when feasible. + // In other scenarios, we need need to override array length for tess levels (if used as outputs), + // or we need to emit the expected type for builtins (uint vs int). + auto storage = get(var.basetype).storage; + + if (storage == StorageClassInput && + (builtin_type == BuiltInTessLevelInner || builtin_type == BuiltInTessLevelOuter)) + { + is_using_builtin_array = false; + } + else if (builtin_type != BuiltInClipDistance && builtin_type != BuiltInCullDistance) + { + is_using_builtin_array = true; + } + + if (storage == StorageClassOutput && variable_storage_requires_stage_io(storage) && + !is_stage_output_builtin_masked(builtin_type)) + is_using_builtin_array = true; + + if (is_using_builtin_array) + decl = join(cv_qualifier, builtin_type_decl(builtin_type, arg.id)); + else + decl = join(cv_qualifier, type_to_glsl(type, arg.id)); + } + else if (is_var_runtime_size_array(var)) + { + const auto *parent_type = &get(type.parent_type); + auto type_name = type_to_glsl(*parent_type, arg.id); + if (type.basetype == SPIRType::AccelerationStructure) + decl = join("spvDescriptorArray<", type_name, ">"); + else if (type_is_image) + decl = join("spvDescriptorArray<", cv_qualifier, type_name, ">"); + else + decl = join("spvDescriptorArray<", address_space, " ", type_name, "*>"); + address_space = "const"; + } + else if ((type_storage == StorageClassUniform || type_storage == StorageClassStorageBuffer) && is_array(type)) + { + is_using_builtin_array = true; + decl += join(cv_qualifier, type_to_glsl(type, arg.id), "*"); + } + else if (is_dynamic_img_sampler) + { + decl = join(cv_qualifier, "spvDynamicImageSampler<", type_to_glsl(get(type.image.type)), ">"); + // Mark the variable so that we can handle passing it to another function. + set_extended_decoration(arg.id, SPIRVCrossDecorationDynamicImageSampler); + } + else + { + // The type is a pointer type we need to emit cv_qualifier late. + if (is_pointer(data_type)) + { + decl = type_to_glsl(type, arg.id); + if (*cv_qualifier != '\0') + decl += join(" ", cv_qualifier); + } + else + { + decl = join(cv_qualifier, type_to_glsl(type, arg.id)); + } + } + + if (passed_by_value || (!builtin && !is_pointer(var_type) && + (type_storage == StorageClassFunction || type_storage == StorageClassGeneric))) + { + // If the argument is a pure value and not an opaque type, we will pass by value. + if (msl_options.force_native_arrays && is_array(type)) + { + // We are receiving an array by value. This is problematic. + // We cannot be sure of the target address space since we are supposed to receive a copy, + // but this is not possible with MSL without some extra work. + // We will have to assume we're getting a reference in thread address space. + // If we happen to get a reference in constant address space, the caller must emit a copy and pass that. + // Thread const therefore becomes the only logical choice, since we cannot "create" a constant array from + // non-constant arrays, but we can create thread const from constant. + decl = string("thread const ") + decl; + decl += " (&"; + const char *restrict_kw = to_restrict(name_id, true); + if (*restrict_kw) + { + decl += " "; + decl += restrict_kw; + } + decl += to_expression(name_id); + decl += ")"; + decl += type_to_array_glsl(type, name_id); + } + else + { + // Variable pointer to array is kinda awkward ... + bool pointer_to_logical_buffer_array = + !is_physical_pointer(type) && is_pointer(type) && + has_decoration(type.parent_type, DecorationArrayStride); + + if (pointer_to_logical_buffer_array) + { + decl.pop_back(); + decl += " (*"; + decl += to_expression(name_id); + decl += ")"; + bool old_is_using_builtin_array = is_using_builtin_array; + is_using_builtin_array = true; + decl += type_to_array_glsl(type, name_id); + is_using_builtin_array = old_is_using_builtin_array; + } + else + { + if (!address_space.empty()) + decl = join(address_space, " ", decl); + decl += " "; + decl += to_expression(name_id); + } + } + } + else if (is_array(type) && !type_is_image) + { + // Arrays of opaque types are special cased. + if (!address_space.empty()) + decl = join(address_space, " ", decl); + + // spvDescriptorArray absorbs the address space inside the template. + if (!is_var_runtime_size_array(var)) + { + const char *argument_buffer_space = descriptor_address_space(name_id, type_storage, nullptr); + if (argument_buffer_space) + { + decl += " "; + decl += argument_buffer_space; + } + } + + // Special case, need to override the array size here if we're using tess level as an argument. + if (is_tesc_shader() && builtin && + (builtin_type == BuiltInTessLevelInner || builtin_type == BuiltInTessLevelOuter)) + { + uint32_t array_size = get_physical_tess_level_array_size(builtin_type); + if (array_size == 1) + { + decl += " &"; + decl += to_expression(name_id); + } + else + { + decl += " (&"; + decl += to_expression(name_id); + decl += ")"; + decl += join("[", array_size, "]"); + } + } + else if (is_var_runtime_size_array(var)) + { + decl += " " + to_expression(name_id); + } + else + { + auto array_size_decl = type_to_array_glsl(type, name_id); + if (array_size_decl.empty()) + decl += "& "; + else + decl += " (&"; + + const char *restrict_kw = to_restrict(name_id, true); + if (*restrict_kw) + { + decl += " "; + decl += restrict_kw; + } + decl += to_expression(name_id); + + if (!array_size_decl.empty()) + { + decl += ")"; + decl += array_size_decl; + } + } + } + else if (!type_is_image && !type_is_tlas && + (!pull_model_inputs.count(var.basevariable) || type.basetype == SPIRType::Struct)) + { + // If this is going to be a reference to a variable pointer, the address space + // for the reference has to go before the '&', but after the '*'. + if (!address_space.empty()) + { + if (is_pointer(data_type)) + { + if (*cv_qualifier == '\0') + decl += ' '; + decl += join(address_space, " "); + } + else + decl = join(address_space, " ", decl); + } + + decl += "&"; + decl += " "; + decl += to_restrict(name_id, true); + decl += to_expression(name_id); + } + else if (type_is_image || type_is_tlas) + { + if (is_var_runtime_size_array(var)) + { + decl = address_space + " " + decl + " " + to_expression(name_id); + } + else if (type.array.empty()) + { + // For non-arrayed types we can just pass opaque descriptors by value. + // This fixes problems if descriptors are passed by value from argument buffers and plain descriptors + // in same shader. + // There is no address space we can actually use, but value will work. + // This will break if applications attempt to pass down descriptor arrays as arguments, but + // fortunately that is extremely unlikely ... + decl += " "; + decl += to_expression(name_id); + } + else + { + const char *img_address_space = descriptor_address_space(name_id, type_storage, "thread const"); + decl = join(img_address_space, " ", decl); + decl += "& "; + decl += to_expression(name_id); + } + } + else + { + if (!address_space.empty()) + decl = join(address_space, " ", decl); + decl += " "; + decl += to_expression(name_id); + } + + // Emulate texture2D atomic operations + auto *backing_var = maybe_get_backing_variable(name_id); + if (backing_var && atomic_image_vars_emulated.count(backing_var->self)) + { + auto &flags = ir.get_decoration_bitset(backing_var->self); + const char *cv_flags = decoration_flags_signal_volatile(flags) ? "volatile " : ""; + decl += join(", ", cv_flags, "device atomic_", type_to_glsl(get(var_type.image.type), 0)); + decl += "* " + to_expression(name_id) + "_atomic"; + } + + is_using_builtin_array = false; + + return decl; +} + +// If we're currently in the entry point function, and the object +// has a qualified name, use it, otherwise use the standard name. +string CompilerMSL::to_name(uint32_t id, bool allow_alias) const +{ + if (current_function && (current_function->self == ir.default_entry_point)) + { + auto *m = ir.find_meta(id); + if (m && !m->decoration.qualified_alias_explicit_override && !m->decoration.qualified_alias.empty()) + return m->decoration.qualified_alias; + } + return Compiler::to_name(id, allow_alias); +} + +// Appends the name of the member to the variable qualifier string, except for Builtins. +string CompilerMSL::append_member_name(const string &qualifier, const SPIRType &type, uint32_t index) +{ + // Don't qualify Builtin names because they are unique and are treated as such when building expressions + BuiltIn builtin = BuiltInMax; + if (is_member_builtin(type, index, &builtin)) + return builtin_to_glsl(builtin, type.storage); + + // Strip any underscore prefix from member name + string mbr_name = to_member_name(type, index); + size_t startPos = mbr_name.find_first_not_of("_"); + mbr_name = (startPos != string::npos) ? mbr_name.substr(startPos) : ""; + return join(qualifier, "_", mbr_name); +} + +// Ensures that the specified name is permanently usable by prepending a prefix +// if the first chars are _ and a digit, which indicate a transient name. +string CompilerMSL::ensure_valid_name(string name, string pfx) +{ + return (name.size() >= 2 && name[0] == '_' && isdigit(name[1])) ? (pfx + name) : name; +} + +const std::unordered_set &CompilerMSL::get_reserved_keyword_set() +{ + static const unordered_set keywords = { + "kernel", + "vertex", + "fragment", + "compute", + "constant", + "device", + "bias", + "level", + "gradient2d", + "gradientcube", + "gradient3d", + "min_lod_clamp", + "assert", + "VARIABLE_TRACEPOINT", + "STATIC_DATA_TRACEPOINT", + "STATIC_DATA_TRACEPOINT_V", + "METAL_ALIGN", + "METAL_ASM", + "METAL_CONST", + "METAL_DEPRECATED", + "METAL_ENABLE_IF", + "METAL_FUNC", + "METAL_INTERNAL", + "METAL_NON_NULL_RETURN", + "METAL_NORETURN", + "METAL_NOTHROW", + "METAL_PURE", + "METAL_UNAVAILABLE", + "METAL_IMPLICIT", + "METAL_EXPLICIT", + "METAL_CONST_ARG", + "METAL_ARG_UNIFORM", + "METAL_ZERO_ARG", + "METAL_VALID_LOD_ARG", + "METAL_VALID_LEVEL_ARG", + "METAL_VALID_STORE_ORDER", + "METAL_VALID_LOAD_ORDER", + "METAL_VALID_COMPARE_EXCHANGE_FAILURE_ORDER", + "METAL_COMPATIBLE_COMPARE_EXCHANGE_ORDERS", + "METAL_VALID_RENDER_TARGET", + "is_function_constant_defined", + "CHAR_BIT", + "SCHAR_MAX", + "SCHAR_MIN", + "UCHAR_MAX", + "CHAR_MAX", + "CHAR_MIN", + "USHRT_MAX", + "SHRT_MAX", + "SHRT_MIN", + "UINT_MAX", + "INT_MAX", + "INT_MIN", + "FLT_DIG", + "FLT_MANT_DIG", + "FLT_MAX_10_EXP", + "FLT_MAX_EXP", + "FLT_MIN_10_EXP", + "FLT_MIN_EXP", + "FLT_RADIX", + "FLT_MAX", + "FLT_MIN", + "FLT_EPSILON", + "FP_ILOGB0", + "FP_ILOGBNAN", + "MAXFLOAT", + "HUGE_VALF", + "INFINITY", + "NAN", + "M_E_F", + "M_LOG2E_F", + "M_LOG10E_F", + "M_LN2_F", + "M_LN10_F", + "M_PI_F", + "M_PI_2_F", + "M_PI_4_F", + "M_1_PI_F", + "M_2_PI_F", + "M_2_SQRTPI_F", + "M_SQRT2_F", + "M_SQRT1_2_F", + "HALF_DIG", + "HALF_MANT_DIG", + "HALF_MAX_10_EXP", + "HALF_MAX_EXP", + "HALF_MIN_10_EXP", + "HALF_MIN_EXP", + "HALF_RADIX", + "HALF_MAX", + "HALF_MIN", + "HALF_EPSILON", + "MAXHALF", + "HUGE_VALH", + "M_E_H", + "M_LOG2E_H", + "M_LOG10E_H", + "M_LN2_H", + "M_LN10_H", + "M_PI_H", + "M_PI_2_H", + "M_PI_4_H", + "M_1_PI_H", + "M_2_PI_H", + "M_2_SQRTPI_H", + "M_SQRT2_H", + "M_SQRT1_2_H", + "DBL_DIG", + "DBL_MANT_DIG", + "DBL_MAX_10_EXP", + "DBL_MAX_EXP", + "DBL_MIN_10_EXP", + "DBL_MIN_EXP", + "DBL_RADIX", + "DBL_MAX", + "DBL_MIN", + "DBL_EPSILON", + "HUGE_VAL", + "M_E", + "M_LOG2E", + "M_LOG10E", + "M_LN2", + "M_LN10", + "M_PI", + "M_PI_2", + "M_PI_4", + "M_1_PI", + "M_2_PI", + "M_2_SQRTPI", + "M_SQRT2", + "M_SQRT1_2", + "quad_broadcast", + "thread", + "threadgroup", + "signed", + }; + + return keywords; +} + +const std::unordered_set &CompilerMSL::get_illegal_func_names() +{ + static const unordered_set illegal_func_names = { + "main", + "fragment", + "vertex", + "kernel", + "saturate", + "assert", + "fmin3", + "fmax3", + "divide", + "fmod", + "median3", + "VARIABLE_TRACEPOINT", + "STATIC_DATA_TRACEPOINT", + "STATIC_DATA_TRACEPOINT_V", + "METAL_ALIGN", + "METAL_ASM", + "METAL_CONST", + "METAL_DEPRECATED", + "METAL_ENABLE_IF", + "METAL_FUNC", + "METAL_INTERNAL", + "METAL_NON_NULL_RETURN", + "METAL_NORETURN", + "METAL_NOTHROW", + "METAL_PURE", + "METAL_UNAVAILABLE", + "METAL_IMPLICIT", + "METAL_EXPLICIT", + "METAL_CONST_ARG", + "METAL_ARG_UNIFORM", + "METAL_ZERO_ARG", + "METAL_VALID_LOD_ARG", + "METAL_VALID_LEVEL_ARG", + "METAL_VALID_STORE_ORDER", + "METAL_VALID_LOAD_ORDER", + "METAL_VALID_COMPARE_EXCHANGE_FAILURE_ORDER", + "METAL_COMPATIBLE_COMPARE_EXCHANGE_ORDERS", + "METAL_VALID_RENDER_TARGET", + "is_function_constant_defined", + "CHAR_BIT", + "SCHAR_MAX", + "SCHAR_MIN", + "UCHAR_MAX", + "CHAR_MAX", + "CHAR_MIN", + "USHRT_MAX", + "SHRT_MAX", + "SHRT_MIN", + "UINT_MAX", + "INT_MAX", + "INT_MIN", + "FLT_DIG", + "FLT_MANT_DIG", + "FLT_MAX_10_EXP", + "FLT_MAX_EXP", + "FLT_MIN_10_EXP", + "FLT_MIN_EXP", + "FLT_RADIX", + "FLT_MAX", + "FLT_MIN", + "FLT_EPSILON", + "FP_ILOGB0", + "FP_ILOGBNAN", + "MAXFLOAT", + "HUGE_VALF", + "INFINITY", + "NAN", + "M_E_F", + "M_LOG2E_F", + "M_LOG10E_F", + "M_LN2_F", + "M_LN10_F", + "M_PI_F", + "M_PI_2_F", + "M_PI_4_F", + "M_1_PI_F", + "M_2_PI_F", + "M_2_SQRTPI_F", + "M_SQRT2_F", + "M_SQRT1_2_F", + "HALF_DIG", + "HALF_MANT_DIG", + "HALF_MAX_10_EXP", + "HALF_MAX_EXP", + "HALF_MIN_10_EXP", + "HALF_MIN_EXP", + "HALF_RADIX", + "HALF_MAX", + "HALF_MIN", + "HALF_EPSILON", + "MAXHALF", + "HUGE_VALH", + "M_E_H", + "M_LOG2E_H", + "M_LOG10E_H", + "M_LN2_H", + "M_LN10_H", + "M_PI_H", + "M_PI_2_H", + "M_PI_4_H", + "M_1_PI_H", + "M_2_PI_H", + "M_2_SQRTPI_H", + "M_SQRT2_H", + "M_SQRT1_2_H", + "DBL_DIG", + "DBL_MANT_DIG", + "DBL_MAX_10_EXP", + "DBL_MAX_EXP", + "DBL_MIN_10_EXP", + "DBL_MIN_EXP", + "DBL_RADIX", + "DBL_MAX", + "DBL_MIN", + "DBL_EPSILON", + "HUGE_VAL", + "M_E", + "M_LOG2E", + "M_LOG10E", + "M_LN2", + "M_LN10", + "M_PI", + "M_PI_2", + "M_PI_4", + "M_1_PI", + "M_2_PI", + "M_2_SQRTPI", + "M_SQRT2", + "M_SQRT1_2", + "int8", + "uint8", + "int16", + "uint16", + "float8", + "float16", + "signed", + }; + + return illegal_func_names; +} + +// Replace all names that match MSL keywords or Metal Standard Library functions. +void CompilerMSL::replace_illegal_names() +{ + // FIXME: MSL and GLSL are doing two different things here. + // Agree on convention and remove this override. + auto &keywords = get_reserved_keyword_set(); + auto &illegal_func_names = get_illegal_func_names(); + + ir.for_each_typed_id([&](uint32_t self, SPIRVariable &) { + auto *meta = ir.find_meta(self); + if (!meta) + return; + + auto &dec = meta->decoration; + if (keywords.find(dec.alias) != end(keywords)) + dec.alias += "0"; + }); + + ir.for_each_typed_id([&](uint32_t self, SPIRFunction &) { + auto *meta = ir.find_meta(self); + if (!meta) + return; + + auto &dec = meta->decoration; + if (illegal_func_names.find(dec.alias) != end(illegal_func_names)) + dec.alias += "0"; + }); + + ir.for_each_typed_id([&](uint32_t self, SPIRType &) { + auto *meta = ir.find_meta(self); + if (!meta) + return; + + for (auto &mbr_dec : meta->members) + if (keywords.find(mbr_dec.alias) != end(keywords)) + mbr_dec.alias += "0"; + }); + + CompilerGLSL::replace_illegal_names(); +} + +void CompilerMSL::replace_illegal_entry_point_names() +{ + auto &illegal_func_names = get_illegal_func_names(); + + // It is important to this before we fixup identifiers, + // since if ep_name is reserved, we will need to fix that up, + // and then copy alias back into entry.name after the fixup. + for (auto &entry : ir.entry_points) + { + // Change both the entry point name and the alias, to keep them synced. + string &ep_name = entry.second.name; + if (illegal_func_names.find(ep_name) != end(illegal_func_names)) + ep_name += "0"; + + ir.meta[entry.first].decoration.alias = ep_name; + } +} + +void CompilerMSL::sync_entry_point_aliases_and_names() +{ + for (auto &entry : ir.entry_points) + entry.second.name = ir.meta[entry.first].decoration.alias; +} + +string CompilerMSL::to_member_reference(uint32_t base, const SPIRType &type, uint32_t index, bool ptr_chain_is_resolved) +{ + auto *var = maybe_get_backing_variable(base); + // If this is a buffer array, we have to dereference the buffer pointers. + // Otherwise, if this is a pointer expression, dereference it. + + bool declared_as_pointer = false; + + if (var) + { + // Only allow -> dereference for block types. This is so we get expressions like + // buffer[i]->first_member.second_member, rather than buffer[i]->first->second. + const bool is_block = + has_decoration(type.self, DecorationBlock) || has_decoration(type.self, DecorationBufferBlock); + + bool is_buffer_variable = + is_block && (var->storage == StorageClassUniform || var->storage == StorageClassStorageBuffer); + declared_as_pointer = is_buffer_variable && is_array(get_pointee_type(var->basetype)); + } + + if (declared_as_pointer || (!ptr_chain_is_resolved && should_dereference(base))) + return join("->", to_member_name(type, index)); + else + return join(".", to_member_name(type, index)); +} + +string CompilerMSL::to_qualifiers_glsl(uint32_t id) +{ + string quals; + + auto *var = maybe_get(id); + auto &type = expression_type(id); + + if (type.storage == StorageClassTaskPayloadWorkgroupEXT) + quals += "object_data "; + + if (type.storage == StorageClassWorkgroup || (var && variable_decl_is_remapped_storage(*var, StorageClassWorkgroup))) + quals += "threadgroup "; + + return quals; +} + +// The optional id parameter indicates the object whose type we are trying +// to find the description for. It is optional. Most type descriptions do not +// depend on a specific object's use of that type. +string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id, bool member) +{ + string type_name; + + // Pointer? + if (is_pointer(type) || type_is_array_of_pointers(type)) + { + assert(type.pointer_depth > 0); + + const char *restrict_kw; + + auto type_address_space = get_type_address_space(type, id); + const auto *p_parent_type = &get(type.parent_type); + + // If we're wrapping buffer descriptors in a spvDescriptorArray, we'll have to handle it as a special case. + if (member && id) + { + auto &var = get(id); + if (is_var_runtime_size_array(var) && is_runtime_size_array(*p_parent_type)) + { + const bool ssbo = has_decoration(p_parent_type->self, DecorationBufferBlock); + bool buffer_desc = + (var.storage == StorageClassStorageBuffer || ssbo) && + msl_options.runtime_array_rich_descriptor; + + const char *wrapper_type = buffer_desc ? "spvBufferDescriptor" : "spvDescriptor"; + add_spv_func_and_recompile(SPVFuncImplVariableDescriptorArray); + add_spv_func_and_recompile(buffer_desc ? SPVFuncImplVariableSizedDescriptor : SPVFuncImplVariableDescriptor); + + type_name = join(wrapper_type, "<", type_address_space, " ", type_to_glsl(*p_parent_type, id), " *>"); + return type_name; + } + } + + // Work around C pointer qualifier rules. If glsl_type is a pointer type as well + // we'll need to emit the address space to the right. + // We could always go this route, but it makes the code unnatural. + // Prefer emitting thread T *foo over T thread* foo since it's more readable, + // but we'll have to emit thread T * thread * T constant bar; for example. + if (is_pointer(type) && is_pointer(*p_parent_type)) + type_name = join(type_to_glsl(*p_parent_type, id), " ", type_address_space, " "); + else + { + // Since this is not a pointer-to-pointer, ensure we've dug down to the base type. + // Some situations chain pointers even though they are not formally pointers-of-pointers. + while (is_pointer(*p_parent_type)) + p_parent_type = &get(p_parent_type->parent_type); + + // If we're emitting BDA, just use the templated type. + // Emitting builtin arrays need a lot of cooperation with other code to ensure + // the C-style nesting works right. + // FIXME: This is somewhat of a hack. + bool old_is_using_builtin_array = is_using_builtin_array; + bool pointer_to_buffer_array = is_pointer(type) && has_decoration(type.parent_type, DecorationArrayStride); + if (is_physical_pointer(type)) + is_using_builtin_array = false; + else if (pointer_to_buffer_array) + is_using_builtin_array = true; + + type_name = join(type_address_space, " ", type_to_glsl(*p_parent_type, id)); + + is_using_builtin_array = old_is_using_builtin_array; + } + + switch (type.basetype) + { + case SPIRType::Image: + case SPIRType::SampledImage: + case SPIRType::Sampler: + // These are handles. + break; + default: + // Anything else can be a raw pointer. + type_name += "*"; + restrict_kw = to_restrict(id, false); + if (*restrict_kw) + { + type_name += " "; + type_name += restrict_kw; + } + break; + } + return type_name; + } + + switch (type.basetype) + { + case SPIRType::Struct: + // Need OpName lookup here to get a "sensible" name for a struct. + // Allow Metal to use the array template to make arrays a value type + type_name = to_name(type.self); + break; + + case SPIRType::Image: + case SPIRType::SampledImage: + return image_type_glsl(type, id, member); + + case SPIRType::Sampler: + return sampler_type(type, id, member); + + case SPIRType::Void: + return "void"; + + case SPIRType::AtomicCounter: + return "atomic_uint"; + + case SPIRType::ControlPointArray: + return join("patch_control_point<", type_to_glsl(get(type.parent_type), id), ">"); + + case SPIRType::Interpolant: + return join("interpolant<", type_to_glsl(get(type.parent_type), id), ", interpolation::", + has_decoration(type.self, DecorationNoPerspective) ? "no_perspective" : "perspective", ">"); + + // Scalars + case SPIRType::Boolean: + { + auto *var = maybe_get_backing_variable(id); + if (var && var->basevariable) + var = &get(var->basevariable); + + // Need to special-case threadgroup booleans. They are supposed to be logical + // storage, but MSL compilers will sometimes crash if you use threadgroup bool. + // Workaround this by using 16-bit types instead and fixup on load-store to this data. + if ((var && var->storage == StorageClassWorkgroup) || type.storage == StorageClassWorkgroup || member) + type_name = "short"; + else + type_name = "bool"; + break; + } + + case SPIRType::Char: + case SPIRType::SByte: + type_name = "char"; + break; + case SPIRType::UByte: + type_name = "uchar"; + break; + case SPIRType::Short: + type_name = "short"; + break; + case SPIRType::UShort: + type_name = "ushort"; + break; + case SPIRType::Int: + type_name = "int"; + break; + case SPIRType::UInt: + type_name = "uint"; + break; + case SPIRType::Int64: + if (!msl_options.supports_msl_version(2, 2)) + SPIRV_CROSS_THROW("64-bit integers are only supported in MSL 2.2 and above."); + type_name = "long"; + break; + case SPIRType::UInt64: + if (!msl_options.supports_msl_version(2, 2)) + SPIRV_CROSS_THROW("64-bit integers are only supported in MSL 2.2 and above."); + type_name = "ulong"; + break; + case SPIRType::Half: + type_name = "half"; + break; + case SPIRType::Float: + type_name = "float"; + break; + case SPIRType::Double: + type_name = "double"; // Currently unsupported + break; + case SPIRType::AccelerationStructure: + if (msl_options.supports_msl_version(2, 4)) + type_name = "raytracing::acceleration_structure"; + else if (msl_options.supports_msl_version(2, 3)) + type_name = "raytracing::instance_acceleration_structure"; + else + SPIRV_CROSS_THROW("Acceleration Structure Type is supported in MSL 2.3 and above."); + break; + case SPIRType::RayQuery: + return "raytracing::intersection_query"; + case SPIRType::MeshGridProperties: + return "mesh_grid_properties"; + + default: + return "unknown_type"; + } + + // Matrix? + if (type.columns > 1) + { + auto *var = maybe_get_backing_variable(id); + if (var && var->basevariable) + var = &get(var->basevariable); + + // Need to special-case threadgroup matrices. Due to an oversight, Metal's + // matrix struct prior to Metal 3 lacks constructors in the threadgroup AS, + // preventing us from default-constructing or initializing matrices in threadgroup storage. + // Work around this by using our own type as storage. + if (((var && var->storage == StorageClassWorkgroup) || type.storage == StorageClassWorkgroup) && + !msl_options.supports_msl_version(3, 0)) + { + add_spv_func_and_recompile(SPVFuncImplStorageMatrix); + type_name = "spvStorage_" + type_name; + } + + type_name += to_string(type.columns) + "x"; + } + + // Vector or Matrix? + if (type.vecsize > 1) + type_name += to_string(type.vecsize); + + if (type.array.empty() || using_builtin_array()) + { + return type_name; + } + else + { + // Allow Metal to use the array template to make arrays a value type + add_spv_func_and_recompile(SPVFuncImplUnsafeArray); + string res; + string sizes; + + for (uint32_t i = 0; i < uint32_t(type.array.size()); i++) + { + res += "spvUnsafeArray<"; + sizes += ", "; + sizes += to_array_size(type, i); + sizes += ">"; + } + + res += type_name + sizes; + return res; + } +} + +string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id) +{ + return type_to_glsl(type, id, false); +} + +string CompilerMSL::type_to_array_glsl(const SPIRType &type, uint32_t variable_id) +{ + // Allow Metal to use the array template to make arrays a value type + switch (type.basetype) + { + case SPIRType::AtomicCounter: + case SPIRType::ControlPointArray: + case SPIRType::RayQuery: + return CompilerGLSL::type_to_array_glsl(type, variable_id); + + default: + if (type_is_array_of_pointers(type) || using_builtin_array()) + { + const SPIRVariable *var = variable_id ? maybe_get(variable_id) : nullptr; + if (var && (var->storage == StorageClassUniform || var->storage == StorageClassStorageBuffer) && + is_array(get_variable_data_type(*var))) + { + return join("[", get_resource_array_size(type, variable_id), "]"); + } + else + return CompilerGLSL::type_to_array_glsl(type, variable_id); + } + else + return ""; + } +} + +string CompilerMSL::constant_op_expression(const SPIRConstantOp &cop) +{ + switch (cop.opcode) + { + case OpSMod: + add_spv_func_and_recompile(SPVFuncImplSMod); + return join("spvSMod(", to_expression(cop.arguments[0]), ", ", to_expression(cop.arguments[1]), ")"); + case OpQuantizeToF16: + add_spv_func_and_recompile(SPVFuncImplQuantizeToF16); + return join("spvQuantizeToF16(", to_expression(cop.arguments[0]), ")"); + default: + return CompilerGLSL::constant_op_expression(cop); + } +} + +bool CompilerMSL::variable_decl_is_remapped_storage(const SPIRVariable &variable, StorageClass storage) const +{ + if (variable.storage == storage) + return true; + + if (storage == StorageClassWorkgroup) + { + // Specially masked IO block variable. + // Normally, we will never access IO blocks directly here. + // The only scenario which that should occur is with a masked IO block. + if (is_tesc_shader() && variable.storage == StorageClassOutput && + has_decoration(get(variable.basetype).self, DecorationBlock)) + { + return true; + } + + if (is_mesh_shader()) + return variable.storage == StorageClassOutput; + + return variable.storage == StorageClassOutput && is_tesc_shader() && is_stage_output_variable_masked(variable); + } + else if (storage == StorageClassStorageBuffer) + { + // These builtins are passed directly; we don't want to use remapping + // for them. + auto builtin = (BuiltIn)get_decoration(variable.self, DecorationBuiltIn); + if (is_tese_shader() && is_builtin_variable(variable) && (builtin == BuiltInTessCoord || builtin == BuiltInPrimitiveId)) + return false; + + // We won't be able to catch writes to control point outputs here since variable + // refers to a function local pointer. + // This is fine, as there cannot be concurrent writers to that memory anyways, + // so we just ignore that case. + + return (variable.storage == StorageClassOutput || variable.storage == StorageClassInput) && + !variable_storage_requires_stage_io(variable.storage) && + (variable.storage != StorageClassOutput || !is_stage_output_variable_masked(variable)); + } + else + { + return false; + } +} + +// GCC workaround of lambdas calling protected funcs +std::string CompilerMSL::variable_decl(const SPIRType &type, const std::string &name, uint32_t id) +{ + return CompilerGLSL::variable_decl(type, name, id); +} + +std::string CompilerMSL::sampler_type(const SPIRType &type, uint32_t id, bool member) +{ + auto *var = maybe_get(id); + if (var && var->basevariable) + { + // Check against the base variable, and not a fake ID which might have been generated for this variable. + id = var->basevariable; + } + + if (!type.array.empty()) + { + if (!msl_options.supports_msl_version(2)) + SPIRV_CROSS_THROW("MSL 2.0 or greater is required for arrays of samplers."); + + if (type.array.size() > 1) + SPIRV_CROSS_THROW("Arrays of arrays of samplers are not supported in MSL."); + + // Arrays of samplers in MSL must be declared with a special array syntax ala C++11 std::array. + // If we have a runtime array, it could be a variable-count descriptor set binding. + auto &parent = get(get_pointee_type(type).parent_type); + uint32_t array_size = get_resource_array_size(type, id); + + if (array_size == 0) + { + add_spv_func_and_recompile(SPVFuncImplVariableDescriptor); + add_spv_func_and_recompile(SPVFuncImplVariableDescriptorArray); + + const char *descriptor_wrapper = processing_entry_point ? "const device spvDescriptor" : "const spvDescriptorArray"; + if (member) + descriptor_wrapper = "spvDescriptor"; + return join(descriptor_wrapper, "<", sampler_type(parent, id, false), ">", + processing_entry_point ? "*" : ""); + } + else + { + return join("array<", sampler_type(parent, id, false), ", ", array_size, ">"); + } + } + else + return "sampler"; +} + +// Returns an MSL string describing the SPIR-V image type +string CompilerMSL::image_type_glsl(const SPIRType &type, uint32_t id, bool member) +{ + auto *var = maybe_get(id); + if (var && var->basevariable) + { + // For comparison images, check against the base variable, + // and not the fake ID which might have been generated for this variable. + id = var->basevariable; + } + + if (!type.array.empty()) + { + uint32_t major = 2, minor = 0; + if (msl_options.is_ios()) + { + major = 1; + minor = 2; + } + if (!msl_options.supports_msl_version(major, minor)) + { + if (msl_options.is_ios()) + SPIRV_CROSS_THROW("MSL 1.2 or greater is required for arrays of textures."); + else + SPIRV_CROSS_THROW("MSL 2.0 or greater is required for arrays of textures."); + } + + if (type.array.size() > 1) + SPIRV_CROSS_THROW("Arrays of arrays of textures are not supported in MSL."); + + // Arrays of images in MSL must be declared with a special array syntax ala C++11 std::array. + // If we have a runtime array, it could be a variable-count descriptor set binding. + auto &parent = get(get_pointee_type(type).parent_type); + uint32_t array_size = get_resource_array_size(type, id); + + if (array_size == 0) + { + add_spv_func_and_recompile(SPVFuncImplVariableDescriptor); + add_spv_func_and_recompile(SPVFuncImplVariableDescriptorArray); + const char *descriptor_wrapper = processing_entry_point ? "const device spvDescriptor" : "const spvDescriptorArray"; + if (member) + { + descriptor_wrapper = "spvDescriptor"; + // This requires a specialized wrapper type that packs image and sampler side by side. + // It is possible in theory. + if (type.basetype == SPIRType::SampledImage) + SPIRV_CROSS_THROW("Argument buffer runtime array currently not supported for combined image sampler."); + } + return join(descriptor_wrapper, "<", image_type_glsl(parent, id, false), ">", + processing_entry_point ? "*" : ""); + } + else + { + return join("array<", image_type_glsl(parent, id, false), ", ", array_size, ">"); + } + } + + string img_type_name; + + auto &img_type = type.image; + + if (is_depth_image(type, id)) + { + switch (img_type.dim) + { + case Dim1D: + case Dim2D: + if (img_type.dim == Dim1D && !msl_options.texture_1D_as_2D) + { + // Use a native Metal 1D texture + img_type_name += "depth1d_unsupported_by_metal"; + break; + } + + if (img_type.ms && img_type.arrayed) + { + if (!msl_options.supports_msl_version(2, 1)) + SPIRV_CROSS_THROW("Multisampled array textures are supported from 2.1."); + img_type_name += "depth2d_ms_array"; + } + else if (img_type.ms) + img_type_name += "depth2d_ms"; + else if (img_type.arrayed) + img_type_name += "depth2d_array"; + else + img_type_name += "depth2d"; + break; + case Dim3D: + img_type_name += "depth3d_unsupported_by_metal"; + break; + case DimCube: + if (!msl_options.emulate_cube_array) + img_type_name += (img_type.arrayed ? "depthcube_array" : "depthcube"); + else + img_type_name += (img_type.arrayed ? "depth2d_array" : "depthcube"); + break; + default: + img_type_name += "unknown_depth_texture_type"; + break; + } + } + else + { + switch (img_type.dim) + { + case DimBuffer: + if (img_type.ms || img_type.arrayed) + SPIRV_CROSS_THROW("Cannot use texel buffers with multisampling or array layers."); + + if (msl_options.texture_buffer_native) + { + if (!msl_options.supports_msl_version(2, 1)) + SPIRV_CROSS_THROW("Native texture_buffer type is only supported in MSL 2.1."); + img_type_name = "texture_buffer"; + } + else + img_type_name += "texture2d"; + break; + case Dim1D: + case Dim2D: + case DimSubpassData: + { + bool subpass_array = + img_type.dim == DimSubpassData && (msl_options.multiview || msl_options.arrayed_subpass_input); + if (img_type.dim == Dim1D && !msl_options.texture_1D_as_2D) + { + // Use a native Metal 1D texture + img_type_name += (img_type.arrayed ? "texture1d_array" : "texture1d"); + break; + } + + // Use Metal's native frame-buffer fetch API for subpass inputs. + if (type_is_msl_framebuffer_fetch(type)) + { + auto img_type_4 = get(img_type.type); + img_type_4.vecsize = 4; + return type_to_glsl(img_type_4); + } + if (img_type.ms && (img_type.arrayed || subpass_array)) + { + if (!msl_options.supports_msl_version(2, 1)) + SPIRV_CROSS_THROW("Multisampled array textures are supported from 2.1."); + img_type_name += "texture2d_ms_array"; + } + else if (img_type.ms) + img_type_name += "texture2d_ms"; + else if (img_type.arrayed || subpass_array) + img_type_name += "texture2d_array"; + else + img_type_name += "texture2d"; + break; + } + case Dim3D: + img_type_name += "texture3d"; + break; + case DimCube: + if (!msl_options.emulate_cube_array) + img_type_name += (img_type.arrayed ? "texturecube_array" : "texturecube"); + else + img_type_name += (img_type.arrayed ? "texture2d_array" : "texturecube"); + break; + default: + img_type_name += "unknown_texture_type"; + break; + } + } + + // Append the pixel type + img_type_name += "<"; + img_type_name += type_to_glsl(get(img_type.type)); + + // For unsampled images, append the sample/read/write access qualifier. + // For kernel images, the access qualifier my be supplied directly by SPIR-V. + // Otherwise it may be set based on whether the image is read from or written to within the shader. + if (type.basetype == SPIRType::Image && type.image.sampled == 2 && type.image.dim != DimSubpassData) + { + auto *p_var = maybe_get_backing_variable(id); + if (p_var && p_var->basevariable) + p_var = maybe_get(p_var->basevariable); + + bool has_access_qualifier = true; + + switch (img_type.access) + { + case AccessQualifierReadOnly: + img_type_name += ", access::read"; + break; + + case AccessQualifierWriteOnly: + img_type_name += ", access::write"; + break; + + case AccessQualifierReadWrite: + img_type_name += ", access::read_write"; + break; + + default: + { + if (p_var && !has_decoration(p_var->self, DecorationNonWritable)) + { + img_type_name += ", access::"; + + if (!has_decoration(p_var->self, DecorationNonReadable)) + img_type_name += "read_"; + + img_type_name += "write"; + } + else + { + has_access_qualifier = false; + } + break; + } + } + + if (p_var && has_decoration(p_var->self, DecorationCoherent) && msl_options.supports_msl_version(3, 2)) + { + // Cannot declare memory_coherence_device without access qualifier. + if (!has_access_qualifier) + img_type_name += ", access::read"; + img_type_name += ", memory_coherence_device"; + } + } + + img_type_name += ">"; + + return img_type_name; +} + +void CompilerMSL::emit_subgroup_op(const Instruction &i) +{ + const uint32_t *ops = stream(i); + auto op = static_cast(i.op); + + if (msl_options.emulate_subgroups) + { + // In this mode, only the GroupNonUniform cap is supported. The only op + // we need to handle, then, is OpGroupNonUniformElect. + if (op != OpGroupNonUniformElect) + SPIRV_CROSS_THROW("Subgroup emulation does not support operations other than Elect."); + // In this mode, the subgroup size is assumed to be one, so every invocation + // is elected. + emit_op(ops[0], ops[1], "true", true); + return; + } + + // Metal 2.0 is required. iOS only supports quad ops on 11.0 (2.0), with + // full support in 13.0 (2.2). macOS only supports broadcast and shuffle on + // 10.13 (2.0), with full support in 10.14 (2.1). + // Note that Apple GPUs before A13 make no distinction between a quad-group + // and a SIMD-group; all SIMD-groups are quad-groups on those. + if (!msl_options.supports_msl_version(2)) + SPIRV_CROSS_THROW("Subgroups are only supported in Metal 2.0 and up."); + + // If we need to do implicit bitcasts, make sure we do it with the correct type. + uint32_t integer_width = get_integer_width_for_instruction(i); + auto int_type = to_signed_basetype(integer_width); + auto uint_type = to_unsigned_basetype(integer_width); + + if (msl_options.is_ios() && (!msl_options.supports_msl_version(2, 3) || !msl_options.ios_use_simdgroup_functions)) + { + switch (op) + { + default: + SPIRV_CROSS_THROW("Subgroup ops beyond broadcast, ballot, and shuffle on iOS require Metal 2.3 and up."); + case OpGroupNonUniformBroadcastFirst: + if (!msl_options.supports_msl_version(2, 2)) + SPIRV_CROSS_THROW("BroadcastFirst on iOS requires Metal 2.2 and up."); + break; + case OpGroupNonUniformElect: + if (!msl_options.supports_msl_version(2, 2)) + SPIRV_CROSS_THROW("Elect on iOS requires Metal 2.2 and up."); + break; + case OpGroupNonUniformAny: + case OpGroupNonUniformAll: + case OpGroupNonUniformAllEqual: + case OpGroupNonUniformBallot: + case OpGroupNonUniformInverseBallot: + case OpGroupNonUniformBallotBitExtract: + case OpGroupNonUniformBallotFindLSB: + case OpGroupNonUniformBallotFindMSB: + case OpGroupNonUniformBallotBitCount: + case OpSubgroupBallotKHR: + case OpSubgroupAllKHR: + case OpSubgroupAnyKHR: + case OpSubgroupAllEqualKHR: + if (!msl_options.supports_msl_version(2, 2)) + SPIRV_CROSS_THROW("Ballot ops on iOS requires Metal 2.2 and up."); + break; + case OpGroupNonUniformRotateKHR: + if (!msl_options.supports_msl_version(2, 2)) + SPIRV_CROSS_THROW("Rotate on iOS requires Metal 2.2 and up."); + break; + case OpGroupNonUniformBroadcast: + case OpGroupNonUniformShuffle: + case OpGroupNonUniformShuffleXor: + case OpGroupNonUniformShuffleUp: + case OpGroupNonUniformShuffleDown: + case OpGroupNonUniformQuadSwap: + case OpGroupNonUniformQuadBroadcast: + case OpSubgroupReadInvocationKHR: + break; + } + } + + if (msl_options.is_macos() && !msl_options.supports_msl_version(2, 1)) + { + switch (op) + { + default: + SPIRV_CROSS_THROW("Subgroup ops beyond broadcast and shuffle on macOS require Metal 2.1 and up."); + case OpGroupNonUniformBroadcast: + case OpGroupNonUniformShuffle: + case OpGroupNonUniformShuffleXor: + case OpGroupNonUniformShuffleUp: + case OpGroupNonUniformShuffleDown: + case OpSubgroupReadInvocationKHR: + break; + } + } + + uint32_t op_idx = 0; + uint32_t result_type = ops[op_idx++]; + uint32_t id = ops[op_idx++]; + + Scope scope; + switch (op) + { + // These earlier instructions don't have the scope operand. + case OpSubgroupBallotKHR: + case OpSubgroupFirstInvocationKHR: + case OpSubgroupReadInvocationKHR: + case OpSubgroupAllKHR: + case OpSubgroupAnyKHR: + case OpSubgroupAllEqualKHR: + // These instructions are always quad-scoped and thus do not have a scope operand. + case OpGroupNonUniformQuadAllKHR: + case OpGroupNonUniformQuadAnyKHR: + scope = ScopeSubgroup; + break; + default: + scope = static_cast(evaluate_constant_u32(ops[op_idx++])); + break; + } + if (scope != ScopeSubgroup) + SPIRV_CROSS_THROW("Only subgroup scope is supported."); + + switch (op) + { + case OpGroupNonUniformElect: + if (msl_options.use_quadgroup_operation()) + emit_op(result_type, id, "quad_is_first()", false); + else + emit_op(result_type, id, "simd_is_first()", false); + break; + + case OpGroupNonUniformBroadcast: + case OpSubgroupReadInvocationKHR: + emit_binary_func_op(result_type, id, ops[op_idx], ops[op_idx + 1], "spvSubgroupBroadcast"); + break; + + case OpGroupNonUniformBroadcastFirst: + case OpSubgroupFirstInvocationKHR: + emit_unary_func_op(result_type, id, ops[op_idx], "spvSubgroupBroadcastFirst"); + break; + + case OpGroupNonUniformBallot: + case OpSubgroupBallotKHR: + emit_unary_func_op(result_type, id, ops[op_idx], "spvSubgroupBallot"); + break; + + case OpGroupNonUniformInverseBallot: + emit_binary_func_op(result_type, id, ops[op_idx], builtin_subgroup_invocation_id_id, "spvSubgroupBallotBitExtract"); + break; + + case OpGroupNonUniformBallotBitExtract: + emit_binary_func_op(result_type, id, ops[op_idx], ops[op_idx + 1], "spvSubgroupBallotBitExtract"); + break; + + case OpGroupNonUniformBallotFindLSB: + emit_binary_func_op(result_type, id, ops[op_idx], builtin_subgroup_size_id, "spvSubgroupBallotFindLSB"); + break; + + case OpGroupNonUniformBallotFindMSB: + emit_binary_func_op(result_type, id, ops[op_idx], builtin_subgroup_size_id, "spvSubgroupBallotFindMSB"); + break; + + case OpGroupNonUniformBallotBitCount: + { + auto operation = static_cast(ops[op_idx++]); + switch (operation) + { + case GroupOperationReduce: + emit_binary_func_op(result_type, id, ops[op_idx], builtin_subgroup_size_id, "spvSubgroupBallotBitCount"); + break; + case GroupOperationInclusiveScan: + emit_binary_func_op(result_type, id, ops[op_idx], builtin_subgroup_invocation_id_id, + "spvSubgroupBallotInclusiveBitCount"); + break; + case GroupOperationExclusiveScan: + emit_binary_func_op(result_type, id, ops[op_idx], builtin_subgroup_invocation_id_id, + "spvSubgroupBallotExclusiveBitCount"); + break; + default: + SPIRV_CROSS_THROW("Invalid BitCount operation."); + } + break; + } + + case OpGroupNonUniformShuffle: + emit_binary_func_op(result_type, id, ops[op_idx], ops[op_idx + 1], "spvSubgroupShuffle"); + break; + + case OpGroupNonUniformShuffleXor: + emit_binary_func_op(result_type, id, ops[op_idx], ops[op_idx + 1], "spvSubgroupShuffleXor"); + break; + + case OpGroupNonUniformShuffleUp: + emit_binary_func_op(result_type, id, ops[op_idx], ops[op_idx + 1], "spvSubgroupShuffleUp"); + break; + + case OpGroupNonUniformShuffleDown: + emit_binary_func_op(result_type, id, ops[op_idx], ops[op_idx + 1], "spvSubgroupShuffleDown"); + break; + + case OpGroupNonUniformRotateKHR: + { + if (i.length > 5) + { + // MSL does not have a cluster size parameter, so calculate the invocation ID manually and using a shuffle. + auto delta_expr = enclose_expression(to_unpacked_expression(ops[op_idx + 1])); + auto cluster_size_minus_one = evaluate_constant_u32(ops[op_idx + 2]) - 1; + auto local_id_expr = to_unpacked_expression(scope == ScopeSubgroup + ? builtin_subgroup_invocation_id_id : builtin_local_invocation_index_id); + auto shuffle_idx = join("((", local_id_expr, " + ", delta_expr, ")", " & ", std::to_string(cluster_size_minus_one), + ") + (", local_id_expr, " & ", std::to_string(~cluster_size_minus_one), ")"); + emit_op(result_type, id, join("spvSubgroupShuffle(", to_unpacked_expression(ops[op_idx]), ", ", shuffle_idx, ")"), false); + } else + emit_binary_func_op(result_type, id, ops[op_idx], ops[op_idx + 1], "spvSubgroupRotate"); + break; + } + + case OpGroupNonUniformAll: + case OpSubgroupAllKHR: + if (msl_options.use_quadgroup_operation()) + emit_unary_func_op(result_type, id, ops[op_idx], "quad_all"); + else + emit_unary_func_op(result_type, id, ops[op_idx], "simd_all"); + break; + + case OpGroupNonUniformAny: + case OpSubgroupAnyKHR: + if (msl_options.use_quadgroup_operation()) + emit_unary_func_op(result_type, id, ops[op_idx], "quad_any"); + else + emit_unary_func_op(result_type, id, ops[op_idx], "simd_any"); + break; + + case OpGroupNonUniformAllEqual: + case OpSubgroupAllEqualKHR: + emit_unary_func_op(result_type, id, ops[op_idx], "spvSubgroupAllEqual"); + break; + + // clang-format off +#define MSL_GROUP_OP(op, msl_op) \ +case OpGroupNonUniform##op: \ + { \ + auto operation = static_cast(ops[op_idx++]); \ + if (operation == GroupOperationReduce) \ + emit_unary_func_op(result_type, id, ops[op_idx], "simd_" #msl_op); \ + else if (operation == GroupOperationInclusiveScan) \ + emit_unary_func_op(result_type, id, ops[op_idx], "simd_prefix_inclusive_" #msl_op); \ + else if (operation == GroupOperationExclusiveScan) \ + emit_unary_func_op(result_type, id, ops[op_idx], "simd_prefix_exclusive_" #msl_op); \ + else if (operation == GroupOperationClusteredReduce) \ + { \ + uint32_t cluster_size = evaluate_constant_u32(ops[op_idx + 1]); \ + if (get_execution_model() != ExecutionModelFragment || msl_options.supports_msl_version(2, 2)) \ + add_spv_func_and_recompile(SPVFuncImplSubgroupClustered##op); \ + emit_subgroup_cluster_op(result_type, id, cluster_size, ops[op_idx], #msl_op); \ + } \ + else \ + SPIRV_CROSS_THROW("Invalid group operation."); \ + break; \ + } + MSL_GROUP_OP(FAdd, sum) + MSL_GROUP_OP(FMul, product) + MSL_GROUP_OP(IAdd, sum) + MSL_GROUP_OP(IMul, product) +#undef MSL_GROUP_OP + // The others, unfortunately, don't support InclusiveScan or ExclusiveScan. + +#define MSL_GROUP_OP(op, msl_op) \ +case OpGroupNonUniform##op: \ + { \ + auto operation = static_cast(ops[op_idx++]); \ + if (operation == GroupOperationReduce) \ + emit_unary_func_op(result_type, id, ops[op_idx], "simd_" #msl_op); \ + else if (operation == GroupOperationInclusiveScan) \ + SPIRV_CROSS_THROW("Metal doesn't support InclusiveScan for OpGroupNonUniform" #op "."); \ + else if (operation == GroupOperationExclusiveScan) \ + SPIRV_CROSS_THROW("Metal doesn't support ExclusiveScan for OpGroupNonUniform" #op "."); \ + else if (operation == GroupOperationClusteredReduce) \ + { \ + uint32_t cluster_size = evaluate_constant_u32(ops[op_idx + 1]); \ + if (get_execution_model() != ExecutionModelFragment || msl_options.supports_msl_version(2, 2)) \ + add_spv_func_and_recompile(SPVFuncImplSubgroupClustered##op); \ + emit_subgroup_cluster_op(result_type, id, cluster_size, ops[op_idx], #msl_op); \ + } \ + else \ + SPIRV_CROSS_THROW("Invalid group operation."); \ + break; \ + } + +#define MSL_GROUP_OP_CAST(op, msl_op, type) \ +case OpGroupNonUniform##op: \ + { \ + auto operation = static_cast(ops[op_idx++]); \ + if (operation == GroupOperationReduce) \ + emit_unary_func_op_cast(result_type, id, ops[op_idx], "simd_" #msl_op, type, type); \ + else if (operation == GroupOperationInclusiveScan) \ + SPIRV_CROSS_THROW("Metal doesn't support InclusiveScan for OpGroupNonUniform" #op "."); \ + else if (operation == GroupOperationExclusiveScan) \ + SPIRV_CROSS_THROW("Metal doesn't support ExclusiveScan for OpGroupNonUniform" #op "."); \ + else if (operation == GroupOperationClusteredReduce) \ + { \ + uint32_t cluster_size = evaluate_constant_u32(ops[op_idx + 1]); \ + if (get_execution_model() != ExecutionModelFragment || msl_options.supports_msl_version(2, 2)) \ + add_spv_func_and_recompile(SPVFuncImplSubgroupClustered##op); \ + emit_subgroup_cluster_op_cast(result_type, id, cluster_size, ops[op_idx], #msl_op, type, type); \ + } \ + else \ + SPIRV_CROSS_THROW("Invalid group operation."); \ + break; \ + } + + MSL_GROUP_OP(FMin, min) + MSL_GROUP_OP(FMax, max) + MSL_GROUP_OP_CAST(SMin, min, int_type) + MSL_GROUP_OP_CAST(SMax, max, int_type) + MSL_GROUP_OP_CAST(UMin, min, uint_type) + MSL_GROUP_OP_CAST(UMax, max, uint_type) + MSL_GROUP_OP(BitwiseAnd, and) + MSL_GROUP_OP(BitwiseOr, or) + MSL_GROUP_OP(BitwiseXor, xor) + // Metal doesn't support boolean types in SIMD-group operations, so we + // have to emit some casts. + MSL_GROUP_OP_CAST(LogicalAnd, and, SPIRType::UShort) + MSL_GROUP_OP_CAST(LogicalOr, or, SPIRType::UShort) + MSL_GROUP_OP_CAST(LogicalXor, xor, SPIRType::UShort) + // clang-format on +#undef MSL_GROUP_OP +#undef MSL_GROUP_OP_CAST + + case OpGroupNonUniformQuadSwap: + emit_binary_func_op(result_type, id, ops[op_idx], ops[op_idx + 1], "spvQuadSwap"); + break; + + case OpGroupNonUniformQuadBroadcast: + emit_binary_func_op(result_type, id, ops[op_idx], ops[op_idx + 1], "spvQuadBroadcast"); + break; + + case OpGroupNonUniformQuadAllKHR: + emit_unary_func_op(result_type, id, ops[op_idx], "quad_all"); + break; + + case OpGroupNonUniformQuadAnyKHR: + emit_unary_func_op(result_type, id, ops[op_idx], "quad_any"); + break; + + default: + SPIRV_CROSS_THROW("Invalid opcode for subgroup."); + } + + register_control_dependent_expression(id); +} + +void CompilerMSL::emit_subgroup_cluster_op(uint32_t result_type, uint32_t result_id, uint32_t cluster_size, + uint32_t op0, const char *op) +{ + if (get_execution_model() == ExecutionModelFragment && !msl_options.supports_msl_version(2, 2)) + { + if (cluster_size == 4) + { + emit_unary_func_op(result_type, result_id, op0, join("quad_", op).c_str()); + return; + } + SPIRV_CROSS_THROW("Cluster sizes other than 4 in fragment shaders require MSL 2.2."); + } + bool forward = should_forward(op0); + emit_op(result_type, result_id, + join("spvClustered_", op, "<", cluster_size, ">(", to_unpacked_expression(op0), ", ", + to_expression(builtin_subgroup_invocation_id_id), ")"), + forward); + inherit_expression_dependencies(result_id, op0); +} + +void CompilerMSL::emit_subgroup_cluster_op_cast(uint32_t result_type, uint32_t result_id, uint32_t cluster_size, + uint32_t op0, const char *op, SPIRType::BaseType input_type, + SPIRType::BaseType expected_result_type) +{ + if (get_execution_model() == ExecutionModelFragment && !msl_options.supports_msl_version(2, 2)) + { + if (cluster_size == 4) + { + emit_unary_func_op_cast(result_type, result_id, op0, join("quad_", op).c_str(), input_type, + expected_result_type); + return; + } + SPIRV_CROSS_THROW("Cluster sizes other than 4 in fragment shaders require MSL 2.2."); + } + + auto &out_type = get(result_type); + auto &expr_type = expression_type(op0); + auto expected_type = out_type; + + // Bit-widths might be different in unary cases because we use it for SConvert/UConvert and friends. + expected_type.basetype = input_type; + expected_type.width = expr_type.width; + + string cast_op; + if (expr_type.basetype != input_type) + { + if (expr_type.basetype == SPIRType::Boolean) + cast_op = join(type_to_glsl(expected_type), "(", to_unpacked_expression(op0), ")"); + else + cast_op = bitcast_glsl(expected_type, op0); + } + else + cast_op = to_unpacked_expression(op0); + + string sg_op = join("spvClustered_", op, "<", cluster_size, ">"); + string expr; + if (out_type.basetype != expected_result_type) + { + expected_type.basetype = expected_result_type; + expected_type.width = out_type.width; + if (out_type.basetype == SPIRType::Boolean) + expr = type_to_glsl(out_type); + else + expr = bitcast_glsl_op(out_type, expected_type); + expr += '('; + expr += join(sg_op, "(", cast_op, ", ", to_expression(builtin_subgroup_invocation_id_id), ")"); + expr += ')'; + } + else + { + expr += join(sg_op, "(", cast_op, ", ", to_expression(builtin_subgroup_invocation_id_id), ")"); + } + + emit_op(result_type, result_id, expr, should_forward(op0)); + inherit_expression_dependencies(result_id, op0); +} + +// Note: Metal forbids bitcasting to/from 'bool' using as_type. This function is used widely +// for generating casts in the backend. To avoid generating illegal MSL when the canonical +// function constant type (from deduplicated SpecId) is Boolean, fall back to value-cast in +// that case by returning type_to_glsl(out_type) instead of as_type<...>. +string CompilerMSL::bitcast_glsl_op(const SPIRType &out_type, const SPIRType &in_type) +{ + if (out_type.basetype == in_type.basetype) + return ""; + + // Avoid bitcasting to/from booleans in MSL; use value cast instead. + if (out_type.basetype == SPIRType::Boolean || in_type.basetype == SPIRType::Boolean) + return type_to_glsl(out_type); + + bool integral_cast = type_is_integral(out_type) && type_is_integral(in_type) && (out_type.vecsize == in_type.vecsize); + bool same_size_cast = (out_type.width * out_type.vecsize) == (in_type.width * in_type.vecsize); + + // Bitcasting can only be used between types of the same overall size. + // And always formally cast between integers, because it's trivial, and also + // because Metal can internally cast the results of some integer ops to a larger + // size (eg. short shift right becomes int), which means chaining integer ops + // together may introduce size variations that SPIR-V doesn't know about. + if (same_size_cast && !integral_cast) + return "as_type<" + type_to_glsl(out_type) + ">"; + else + return type_to_glsl(out_type); +} + +bool CompilerMSL::emit_complex_bitcast(uint32_t, uint32_t, uint32_t) +{ + // This is handled from the outside where we deal with PtrToU/UToPtr and friends. + return false; +} + +// Returns an MSL string identifying the name of a SPIR-V builtin. +// Output builtins are qualified with the name of the stage out structure. +string CompilerMSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage) +{ + switch (builtin) + { + // Handle HLSL-style 0-based vertex/instance index. + // Override GLSL compiler strictness + case BuiltInVertexId: + ensure_builtin(StorageClassInput, BuiltInVertexId); + if (msl_options.enable_base_index_zero && msl_options.supports_msl_version(1, 1) && + (msl_options.ios_support_base_vertex_instance || msl_options.is_macos())) + { + if (builtin_declaration) + { + if (needs_base_vertex_arg != TriState::No) + needs_base_vertex_arg = TriState::Yes; + return "gl_VertexID"; + } + else + { + ensure_builtin(StorageClassInput, BuiltInBaseVertex); + return "(gl_VertexID - gl_BaseVertex)"; + } + } + else + { + return "gl_VertexID"; + } + case BuiltInInstanceId: + ensure_builtin(StorageClassInput, BuiltInInstanceId); + if (msl_options.enable_base_index_zero && msl_options.supports_msl_version(1, 1) && + (msl_options.ios_support_base_vertex_instance || msl_options.is_macos())) + { + if (builtin_declaration) + { + if (needs_base_instance_arg != TriState::No) + needs_base_instance_arg = TriState::Yes; + return "gl_InstanceID"; + } + else + { + ensure_builtin(StorageClassInput, BuiltInBaseInstance); + return "(gl_InstanceID - gl_BaseInstance)"; + } + } + else + { + return "gl_InstanceID"; + } + case BuiltInVertexIndex: + ensure_builtin(StorageClassInput, BuiltInVertexIndex); + if (msl_options.enable_base_index_zero && msl_options.supports_msl_version(1, 1) && + (msl_options.ios_support_base_vertex_instance || msl_options.is_macos())) + { + if (builtin_declaration) + { + if (needs_base_vertex_arg != TriState::No) + needs_base_vertex_arg = TriState::Yes; + return "gl_VertexIndex"; + } + else + { + ensure_builtin(StorageClassInput, BuiltInBaseVertex); + return "(gl_VertexIndex - gl_BaseVertex)"; + } + } + else + { + return "gl_VertexIndex"; + } + case BuiltInInstanceIndex: + ensure_builtin(StorageClassInput, BuiltInInstanceIndex); + if (msl_options.enable_base_index_zero && msl_options.supports_msl_version(1, 1) && + (msl_options.ios_support_base_vertex_instance || msl_options.is_macos())) + { + if (builtin_declaration) + { + if (needs_base_instance_arg != TriState::No) + needs_base_instance_arg = TriState::Yes; + return "gl_InstanceIndex"; + } + else + { + ensure_builtin(StorageClassInput, BuiltInBaseInstance); + return "(gl_InstanceIndex - gl_BaseInstance)"; + } + } + else + { + return "gl_InstanceIndex"; + } + case BuiltInBaseVertex: + if (msl_options.supports_msl_version(1, 1) && + (msl_options.ios_support_base_vertex_instance || msl_options.is_macos())) + { + needs_base_vertex_arg = TriState::No; + return "gl_BaseVertex"; + } + else + { + SPIRV_CROSS_THROW("BaseVertex requires Metal 1.1 and Mac or Apple A9+ hardware."); + } + case BuiltInBaseInstance: + if (msl_options.supports_msl_version(1, 1) && + (msl_options.ios_support_base_vertex_instance || msl_options.is_macos())) + { + needs_base_instance_arg = TriState::No; + return "gl_BaseInstance"; + } + else + { + SPIRV_CROSS_THROW("BaseInstance requires Metal 1.1 and Mac or Apple A9+ hardware."); + } + case BuiltInDrawIndex: + SPIRV_CROSS_THROW("DrawIndex is not supported in MSL."); + + // When used in the entry function, output builtins are qualified with output struct name. + // Test storage class as NOT Input, as output builtins might be part of generic type. + // Also don't do this for tessellation control shaders. + case BuiltInViewportIndex: + if (!msl_options.supports_msl_version(2, 0)) + SPIRV_CROSS_THROW("ViewportIndex requires Metal 2.0."); + /* fallthrough */ + case BuiltInFragDepth: + case BuiltInFragStencilRefEXT: + if ((builtin == BuiltInFragDepth && !msl_options.enable_frag_depth_builtin) || + (builtin == BuiltInFragStencilRefEXT && !msl_options.enable_frag_stencil_ref_builtin)) + break; + /* fallthrough */ + case BuiltInPosition: + case BuiltInPointSize: + case BuiltInClipDistance: + case BuiltInCullDistance: + case BuiltInLayer: + if (is_tesc_shader()) + break; + if (is_mesh_shader()) + break; + if (storage != StorageClassInput && current_function && (current_function->self == ir.default_entry_point) && + !is_stage_output_builtin_masked(builtin)) + return stage_out_var_name + "." + CompilerGLSL::builtin_to_glsl(builtin, storage); + break; + + case BuiltInSampleMask: + if (storage == StorageClassInput && current_function && (current_function->self == ir.default_entry_point) && + (has_additional_fixed_sample_mask() || needs_sample_id)) + { + string samp_mask_in; + samp_mask_in += "(" + CompilerGLSL::builtin_to_glsl(builtin, storage); + if (has_additional_fixed_sample_mask()) + samp_mask_in += " & " + additional_fixed_sample_mask_str(); + if (needs_sample_id) + samp_mask_in += " & (1 << gl_SampleID)"; + samp_mask_in += ")"; + return samp_mask_in; + } + if (storage != StorageClassInput && current_function && (current_function->self == ir.default_entry_point) && + !is_stage_output_builtin_masked(builtin)) + return stage_out_var_name + "." + CompilerGLSL::builtin_to_glsl(builtin, storage); + break; + + case BuiltInBaryCoordKHR: + case BuiltInBaryCoordNoPerspKHR: + if (storage == StorageClassInput && current_function && (current_function->self == ir.default_entry_point)) + return stage_in_var_name + "." + CompilerGLSL::builtin_to_glsl(builtin, storage); + break; + + case BuiltInTessLevelOuter: + if (is_tesc_shader() && storage != StorageClassInput && current_function && + (current_function->self == ir.default_entry_point)) + { + return join(tess_factor_buffer_var_name, "[", to_expression(builtin_primitive_id_id), + "].edgeTessellationFactor"); + } + break; + + case BuiltInTessLevelInner: + if (is_tesc_shader() && storage != StorageClassInput && current_function && + (current_function->self == ir.default_entry_point)) + { + return join(tess_factor_buffer_var_name, "[", to_expression(builtin_primitive_id_id), + "].insideTessellationFactor"); + } + break; + + case BuiltInHelperInvocation: + if (needs_manual_helper_invocation_updates()) + break; + if (msl_options.is_ios() && !msl_options.supports_msl_version(2, 3)) + SPIRV_CROSS_THROW("simd_is_helper_thread() requires version 2.3 on iOS."); + else if (msl_options.is_macos() && !msl_options.supports_msl_version(2, 1)) + SPIRV_CROSS_THROW("simd_is_helper_thread() requires version 2.1 on macOS."); + // In SPIR-V 1.6 with Volatile HelperInvocation, we cannot emit a fixup early. + return "simd_is_helper_thread()"; + + case BuiltInPrimitiveId: + return "gl_PrimitiveID"; + + default: + break; + } + + return CompilerGLSL::builtin_to_glsl(builtin, storage); +} + +// Returns an MSL string attribute qualifer for a SPIR-V builtin +string CompilerMSL::builtin_qualifier(BuiltIn builtin) +{ + auto &execution = get_entry_point(); + + switch (builtin) + { + // Vertex function in + case BuiltInVertexId: + return "vertex_id"; + case BuiltInVertexIndex: + return "vertex_id"; + case BuiltInBaseVertex: + return "base_vertex"; + case BuiltInInstanceId: + return "instance_id"; + case BuiltInInstanceIndex: + return "instance_id"; + case BuiltInBaseInstance: + return "base_instance"; + case BuiltInDrawIndex: + SPIRV_CROSS_THROW("DrawIndex is not supported in MSL."); + + // Vertex function out + case BuiltInClipDistance: + return "clip_distance"; + case BuiltInCullDistance: + return "cull_distance"; + case BuiltInPointSize: + return "point_size"; + case BuiltInPosition: + if (position_invariant) + { + if (!msl_options.supports_msl_version(2, 1)) + SPIRV_CROSS_THROW("Invariant position is only supported on MSL 2.1 and up."); + return "position, invariant"; + } + else + return "position"; + case BuiltInLayer: + return "render_target_array_index"; + case BuiltInViewportIndex: + if (!msl_options.supports_msl_version(2, 0)) + SPIRV_CROSS_THROW("ViewportIndex requires Metal 2.0."); + return "viewport_array_index"; + + // Tess. control function in + case BuiltInInvocationId: + if (msl_options.multi_patch_workgroup) + { + // Shouldn't be reached. + SPIRV_CROSS_THROW("InvocationId is computed manually with multi-patch workgroups in MSL."); + } + return "thread_index_in_threadgroup"; + case BuiltInPatchVertices: + // Shouldn't be reached. + SPIRV_CROSS_THROW("PatchVertices is derived from the auxiliary buffer in MSL."); + case BuiltInPrimitiveId: + switch (execution.model) + { + case ExecutionModelTessellationControl: + if (msl_options.multi_patch_workgroup) + { + // Shouldn't be reached. + SPIRV_CROSS_THROW("PrimitiveId is computed manually with multi-patch workgroups in MSL."); + } + return "threadgroup_position_in_grid"; + case ExecutionModelTessellationEvaluation: + return "patch_id"; + case ExecutionModelFragment: + if (msl_options.is_ios() && !msl_options.supports_msl_version(2, 3)) + SPIRV_CROSS_THROW("PrimitiveId on iOS requires MSL 2.3."); + else if (msl_options.is_macos() && !msl_options.supports_msl_version(2, 2)) + SPIRV_CROSS_THROW("PrimitiveId on macOS requires MSL 2.2."); + return "primitive_id"; + case ExecutionModelMeshEXT: + return "primitive_id"; + default: + SPIRV_CROSS_THROW("PrimitiveId is not supported in this execution model."); + } + + // Tess. control function out + case BuiltInTessLevelOuter: + case BuiltInTessLevelInner: + // Shouldn't be reached. + SPIRV_CROSS_THROW("Tessellation levels are handled specially in MSL."); + + // Tess. evaluation function in + case BuiltInTessCoord: + return "position_in_patch"; + + // Fragment function in + case BuiltInFrontFacing: + return "front_facing"; + case BuiltInPointCoord: + return "point_coord"; + case BuiltInFragCoord: + return "position"; + case BuiltInSampleId: + return "sample_id"; + case BuiltInSampleMask: + return "sample_mask"; + case BuiltInSamplePosition: + // Shouldn't be reached. + SPIRV_CROSS_THROW("Sample position is retrieved by a function in MSL."); + case BuiltInViewIndex: + if (execution.model != ExecutionModelFragment && execution.model != ExecutionModelMeshEXT) + SPIRV_CROSS_THROW("ViewIndex is handled specially outside fragment shaders."); + // The ViewIndex was implicitly used in the prior stages to set the render_target_array_index, + // so we can get it from there. + return "render_target_array_index"; + + // Fragment function out + case BuiltInFragDepth: + if (execution.flags.get(ExecutionModeDepthGreater)) + return "depth(greater)"; + else if (execution.flags.get(ExecutionModeDepthLess)) + return "depth(less)"; + else + return "depth(any)"; + + case BuiltInFragStencilRefEXT: + return "stencil"; + + // Compute function in + case BuiltInGlobalInvocationId: + return "thread_position_in_grid"; + + case BuiltInWorkgroupSize: + return "threads_per_threadgroup"; + + case BuiltInWorkgroupId: + return "threadgroup_position_in_grid"; + + case BuiltInNumWorkgroups: + return "threadgroups_per_grid"; + + case BuiltInLocalInvocationId: + return "thread_position_in_threadgroup"; + + case BuiltInLocalInvocationIndex: + return "thread_index_in_threadgroup"; + + case BuiltInSubgroupSize: + if (msl_options.emulate_subgroups || msl_options.fixed_subgroup_size != 0) + // Shouldn't be reached. + SPIRV_CROSS_THROW("Emitting threads_per_simdgroup attribute with fixed subgroup size??"); + if (execution.model == ExecutionModelFragment) + { + if (!msl_options.supports_msl_version(2, 2)) + SPIRV_CROSS_THROW("threads_per_simdgroup requires Metal 2.2 in fragment shaders."); + return "threads_per_simdgroup"; + } + else + { + // thread_execution_width is an alias for threads_per_simdgroup, and it's only available since 1.0, + // but not in fragment. + if (msl_options.supports_msl_version(3, 0)) + return "threads_per_simdgroup"; + else + return "thread_execution_width"; + } + + case BuiltInNumSubgroups: + if (msl_options.emulate_subgroups) + // Shouldn't be reached. + SPIRV_CROSS_THROW("NumSubgroups is handled specially with emulation."); + if (!msl_options.supports_msl_version(2)) + SPIRV_CROSS_THROW("Subgroup builtins require Metal 2.0."); + return msl_options.use_quadgroup_operation() ? "quadgroups_per_threadgroup" : "simdgroups_per_threadgroup"; + + case BuiltInSubgroupId: + if (msl_options.emulate_subgroups) + // Shouldn't be reached. + SPIRV_CROSS_THROW("SubgroupId is handled specially with emulation."); + if (!msl_options.supports_msl_version(2)) + SPIRV_CROSS_THROW("Subgroup builtins require Metal 2.0."); + return msl_options.use_quadgroup_operation() ? "quadgroup_index_in_threadgroup" : "simdgroup_index_in_threadgroup"; + + case BuiltInSubgroupLocalInvocationId: + if (msl_options.emulate_subgroups) + // Shouldn't be reached. + SPIRV_CROSS_THROW("SubgroupLocalInvocationId is handled specially with emulation."); + if (execution.model == ExecutionModelFragment) + { + if (!msl_options.supports_msl_version(2, 2)) + SPIRV_CROSS_THROW("thread_index_in_simdgroup requires Metal 2.2 in fragment shaders."); + return "thread_index_in_simdgroup"; + } + else if (execution.model == ExecutionModelKernel || execution.model == ExecutionModelGLCompute || + execution.model == ExecutionModelTaskEXT || execution.model == ExecutionModelMeshEXT || + execution.model == ExecutionModelTessellationControl || + (execution.model == ExecutionModelVertex && msl_options.vertex_for_tessellation)) + { + // We are generating a Metal kernel function. + if (!msl_options.supports_msl_version(2)) + SPIRV_CROSS_THROW("Subgroup builtins in kernel functions require Metal 2.0."); + return msl_options.use_quadgroup_operation() ? "thread_index_in_quadgroup" : "thread_index_in_simdgroup"; + } + else + SPIRV_CROSS_THROW("Subgroup builtins are not available in this type of function."); + + case BuiltInSubgroupEqMask: + case BuiltInSubgroupGeMask: + case BuiltInSubgroupGtMask: + case BuiltInSubgroupLeMask: + case BuiltInSubgroupLtMask: + // Shouldn't be reached. + SPIRV_CROSS_THROW("Subgroup ballot masks are handled specially in MSL."); + + case BuiltInBaryCoordKHR: + case BuiltInBaryCoordNoPerspKHR: + if (msl_options.is_ios() && !msl_options.supports_msl_version(2, 3)) + SPIRV_CROSS_THROW("Barycentrics are only supported in MSL 2.3 and above on iOS."); + else if (!msl_options.supports_msl_version(2, 2)) + SPIRV_CROSS_THROW("Barycentrics are only supported in MSL 2.2 and above on macOS."); + return "barycentric_coord"; + + case BuiltInCullPrimitiveEXT: + return "primitive_culled"; + + default: + return "unsupported-built-in"; + } +} + +// Returns an MSL string type declaration for a SPIR-V builtin +string CompilerMSL::builtin_type_decl(BuiltIn builtin, uint32_t id) +{ + switch (builtin) + { + // Vertex function in + case BuiltInVertexId: + return "uint"; + case BuiltInVertexIndex: + return "uint"; + case BuiltInBaseVertex: + return "uint"; + case BuiltInInstanceId: + return "uint"; + case BuiltInInstanceIndex: + return "uint"; + case BuiltInBaseInstance: + return "uint"; + case BuiltInDrawIndex: + SPIRV_CROSS_THROW("DrawIndex is not supported in MSL."); + + // Vertex function out + case BuiltInClipDistance: + case BuiltInCullDistance: + return "float"; + case BuiltInPointSize: + return "float"; + case BuiltInPosition: + return "float4"; + case BuiltInLayer: + return "uint"; + case BuiltInViewportIndex: + if (!msl_options.supports_msl_version(2, 0)) + SPIRV_CROSS_THROW("ViewportIndex requires Metal 2.0."); + return "uint"; + + // Tess. control function in + case BuiltInInvocationId: + return "uint"; + case BuiltInPatchVertices: + return "uint"; + case BuiltInPrimitiveId: + return "uint"; + + // Tess. control function out + case BuiltInTessLevelInner: + if (is_tese_shader()) + return (msl_options.raw_buffer_tese_input || is_tessellating_triangles()) ? "float" : "float2"; + return "half"; + case BuiltInTessLevelOuter: + if (is_tese_shader()) + return (msl_options.raw_buffer_tese_input || is_tessellating_triangles()) ? "float" : "float4"; + return "half"; + + // Tess. evaluation function in + case BuiltInTessCoord: + return "float3"; + + // Fragment function in + case BuiltInFrontFacing: + return "bool"; + case BuiltInPointCoord: + return "float2"; + case BuiltInFragCoord: + return "float4"; + case BuiltInSampleId: + return "uint"; + case BuiltInSampleMask: + return "uint"; + case BuiltInSamplePosition: + return "float2"; + case BuiltInViewIndex: + return "uint"; + + case BuiltInHelperInvocation: + return "bool"; + + case BuiltInBaryCoordKHR: + case BuiltInBaryCoordNoPerspKHR: + // Use the type as declared, can be 1, 2 or 3 components. + return type_to_glsl(get_variable_data_type(get(id))); + + // Fragment function out + case BuiltInFragDepth: + return "float"; + + case BuiltInFragStencilRefEXT: + return "uint"; + + // Compute function in + case BuiltInGlobalInvocationId: + case BuiltInLocalInvocationId: + case BuiltInNumWorkgroups: + case BuiltInWorkgroupId: + case BuiltInWorkgroupSize: + return "uint3"; + case BuiltInLocalInvocationIndex: + case BuiltInNumSubgroups: + case BuiltInSubgroupId: + case BuiltInSubgroupSize: + case BuiltInSubgroupLocalInvocationId: + return "uint"; + case BuiltInSubgroupEqMask: + case BuiltInSubgroupGeMask: + case BuiltInSubgroupGtMask: + case BuiltInSubgroupLeMask: + case BuiltInSubgroupLtMask: + return "uint4"; + + case BuiltInDeviceIndex: + return "int"; + + case BuiltInPrimitivePointIndicesEXT: + return "uint"; + case BuiltInPrimitiveLineIndicesEXT: + return "uint2"; + case BuiltInPrimitiveTriangleIndicesEXT: + return "uint3"; + + default: + return "unsupported-built-in-type"; + } +} + +// Returns the declaration of a built-in argument to a function +string CompilerMSL::built_in_func_arg(BuiltIn builtin, bool prefix_comma) +{ + string bi_arg; + if (prefix_comma) + bi_arg += ", "; + + // Handle HLSL-style 0-based vertex/instance index. + builtin_declaration = true; + bi_arg += builtin_type_decl(builtin); + bi_arg += string(" ") + builtin_to_glsl(builtin, StorageClassInput); + bi_arg += string(" [[") + builtin_qualifier(builtin) + string("]]"); + builtin_declaration = false; + + return bi_arg; +} + +const SPIRType &CompilerMSL::get_physical_member_type(const SPIRType &type, uint32_t index) const +{ + if (member_is_remapped_physical_type(type, index)) + return get(get_extended_member_decoration(type.self, index, SPIRVCrossDecorationPhysicalTypeID)); + else + return get(type.member_types[index]); +} + +SPIRType CompilerMSL::get_presumed_input_type(const SPIRType &ib_type, uint32_t index) const +{ + SPIRType type = get_physical_member_type(ib_type, index); + uint32_t loc = get_member_decoration(ib_type.self, index, DecorationLocation); + uint32_t cmp = get_member_decoration(ib_type.self, index, DecorationComponent); + auto p_va = inputs_by_location.find({loc, cmp}); + if (p_va != end(inputs_by_location) && p_va->second.vecsize > type.vecsize) + type.vecsize = p_va->second.vecsize; + + return type; +} + +uint32_t CompilerMSL::get_declared_type_array_stride_msl(const SPIRType &type, bool is_packed, bool row_major) const +{ + // Array stride in MSL is always size * array_size. sizeof(float3) == 16, + // unlike GLSL and HLSL where array stride would be 16 and size 12. + + // We could use parent type here and recurse, but that makes creating physical type remappings + // far more complicated. We'd rather just create the final type, and ignore having to create the entire type + // hierarchy in order to compute this value, so make a temporary type on the stack. + + auto basic_type = type; + basic_type.array.clear(); + basic_type.array_size_literal.clear(); + uint32_t value_size = get_declared_type_size_msl(basic_type, is_packed, row_major); + + uint32_t dimensions = uint32_t(type.array.size()); + assert(dimensions > 0); + dimensions--; + + // Multiply together every dimension, except the last one. + for (uint32_t dim = 0; dim < dimensions; dim++) + { + uint32_t array_size = to_array_size_literal(type, dim); + value_size *= max(array_size, 1u); + } + + return value_size; +} + +uint32_t CompilerMSL::get_declared_struct_member_array_stride_msl(const SPIRType &type, uint32_t index) const +{ + return get_declared_type_array_stride_msl(get_physical_member_type(type, index), + member_is_packed_physical_type(type, index), + has_member_decoration(type.self, index, DecorationRowMajor)); +} + +uint32_t CompilerMSL::get_declared_input_array_stride_msl(const SPIRType &type, uint32_t index) const +{ + return get_declared_type_array_stride_msl(get_presumed_input_type(type, index), false, + has_member_decoration(type.self, index, DecorationRowMajor)); +} + +uint32_t CompilerMSL::get_declared_type_matrix_stride_msl(const SPIRType &type, bool packed, bool row_major) const +{ + // For packed matrices, we just use the size of the vector type. + // Otherwise, MatrixStride == alignment, which is the size of the underlying vector type. + if (packed) + return (type.width / 8) * ((row_major && type.columns > 1) ? type.columns : type.vecsize); + else + return get_declared_type_alignment_msl(type, false, row_major); +} + +uint32_t CompilerMSL::get_declared_struct_member_matrix_stride_msl(const SPIRType &type, uint32_t index) const +{ + return get_declared_type_matrix_stride_msl(get_physical_member_type(type, index), + member_is_packed_physical_type(type, index), + has_member_decoration(type.self, index, DecorationRowMajor)); +} + +uint32_t CompilerMSL::get_declared_input_matrix_stride_msl(const SPIRType &type, uint32_t index) const +{ + return get_declared_type_matrix_stride_msl(get_presumed_input_type(type, index), false, + has_member_decoration(type.self, index, DecorationRowMajor)); +} + +uint32_t CompilerMSL::get_declared_struct_size_msl(const SPIRType &struct_type, bool ignore_alignment, + bool ignore_padding) const +{ + // If we have a target size, that is the declared size as well. + if (!ignore_padding && has_extended_decoration(struct_type.self, SPIRVCrossDecorationPaddingTarget)) + return get_extended_decoration(struct_type.self, SPIRVCrossDecorationPaddingTarget); + + if (struct_type.member_types.empty()) + return 0; + + uint32_t mbr_cnt = uint32_t(struct_type.member_types.size()); + + // In MSL, a struct's alignment is equal to the maximum alignment of any of its members. + uint32_t alignment = 1; + + if (!ignore_alignment) + { + for (uint32_t i = 0; i < mbr_cnt; i++) + { + uint32_t mbr_alignment = get_declared_struct_member_alignment_msl(struct_type, i); + alignment = max(alignment, mbr_alignment); + } + } + + // Last member will always be matched to the final Offset decoration, but size of struct in MSL now depends + // on physical size in MSL, and the size of the struct itself is then aligned to struct alignment. + uint32_t spirv_offset = type_struct_member_offset(struct_type, mbr_cnt - 1); + uint32_t msl_size = spirv_offset + get_declared_struct_member_size_msl(struct_type, mbr_cnt - 1); + msl_size = (msl_size + alignment - 1) & ~(alignment - 1); + return msl_size; +} + +uint32_t CompilerMSL::get_physical_type_stride(const SPIRType &type) const +{ + // This should only be relevant for plain types such as scalars and vectors? + // If we're pointing to a struct, it will recursively pick up packed/row-major state. + return get_declared_type_size_msl(type, false, false); +} + +// Returns the byte size of a struct member. +uint32_t CompilerMSL::get_declared_type_size_msl(const SPIRType &type, bool is_packed, bool row_major) const +{ + // Pointers take 8 bytes each + // Match both pointer and array-of-pointer here. + if (type.pointer && type.storage == StorageClassPhysicalStorageBuffer) + { + uint32_t type_size = 8; + + // Work our way through potentially layered arrays, + // stopping when we hit a pointer that is not also an array. + int32_t dim_idx = (int32_t)type.array.size() - 1; + auto *p_type = &type; + while (!is_pointer(*p_type) && dim_idx >= 0) + { + type_size *= to_array_size_literal(*p_type, dim_idx); + p_type = &get(p_type->parent_type); + dim_idx--; + } + + return type_size; + } + + switch (type.basetype) + { + case SPIRType::Unknown: + case SPIRType::Void: + case SPIRType::AtomicCounter: + case SPIRType::Image: + case SPIRType::SampledImage: + case SPIRType::Sampler: + SPIRV_CROSS_THROW("Querying size of opaque object."); + + default: + { + if (!type.array.empty()) + { + uint32_t array_size = to_array_size_literal(type); + return get_declared_type_array_stride_msl(type, is_packed, row_major) * max(array_size, 1u); + } + + if (type.basetype == SPIRType::Struct) + return get_declared_struct_size_msl(type); + + if (is_packed) + { + return type.vecsize * type.columns * (type.width / 8); + } + else + { + // An unpacked 3-element vector or matrix column is the same memory size as a 4-element. + uint32_t vecsize = type.vecsize; + uint32_t columns = type.columns; + + if (row_major && columns > 1) + swap(vecsize, columns); + + if (vecsize == 3) + vecsize = 4; + + return vecsize * columns * (type.width / 8); + } + } + } +} + +uint32_t CompilerMSL::get_declared_struct_member_size_msl(const SPIRType &type, uint32_t index) const +{ + return get_declared_type_size_msl(get_physical_member_type(type, index), + member_is_packed_physical_type(type, index), + has_member_decoration(type.self, index, DecorationRowMajor)); +} + +uint32_t CompilerMSL::get_declared_input_size_msl(const SPIRType &type, uint32_t index) const +{ + return get_declared_type_size_msl(get_presumed_input_type(type, index), false, + has_member_decoration(type.self, index, DecorationRowMajor)); +} + +// Returns the byte alignment of a type. +uint32_t CompilerMSL::get_declared_type_alignment_msl(const SPIRType &type, bool is_packed, bool row_major) const +{ + // Pointers align on multiples of 8 bytes. + // Deliberately ignore array-ness here. It's not relevant for alignment. + if (type.pointer && type.storage == StorageClassPhysicalStorageBuffer) + return 8; + + switch (type.basetype) + { + case SPIRType::Unknown: + case SPIRType::Void: + case SPIRType::AtomicCounter: + case SPIRType::Image: + case SPIRType::SampledImage: + case SPIRType::Sampler: + SPIRV_CROSS_THROW("Querying alignment of opaque object."); + + case SPIRType::Double: + SPIRV_CROSS_THROW("double types are not supported in buffers in MSL."); + + case SPIRType::Struct: + { + // In MSL, a struct's alignment is equal to the maximum alignment of any of its members. + uint32_t alignment = 1; + for (uint32_t i = 0; i < type.member_types.size(); i++) + alignment = max(alignment, uint32_t(get_declared_struct_member_alignment_msl(type, i))); + return alignment; + } + + default: + { + if (type.basetype == SPIRType::Int64 && !msl_options.supports_msl_version(2, 3)) + SPIRV_CROSS_THROW("long types in buffers are only supported in MSL 2.3 and above."); + if (type.basetype == SPIRType::UInt64 && !msl_options.supports_msl_version(2, 3)) + SPIRV_CROSS_THROW("ulong types in buffers are only supported in MSL 2.3 and above."); + // Alignment of packed type is the same as the underlying component or column size. + // Alignment of unpacked type is the same as the vector size. + // Alignment of 3-elements vector is the same as 4-elements (including packed using column). + if (is_packed) + { + // If we have packed_T and friends, the alignment is always scalar. + return type.width / 8; + } + else + { + // This is the general rule for MSL. Size == alignment. + uint32_t vecsize = (row_major && type.columns > 1) ? type.columns : type.vecsize; + return (type.width / 8) * (vecsize == 3 ? 4 : vecsize); + } + } + } +} + +uint32_t CompilerMSL::get_declared_struct_member_alignment_msl(const SPIRType &type, uint32_t index) const +{ + return get_declared_type_alignment_msl(get_physical_member_type(type, index), + member_is_packed_physical_type(type, index), + has_member_decoration(type.self, index, DecorationRowMajor)); +} + +uint32_t CompilerMSL::get_declared_input_alignment_msl(const SPIRType &type, uint32_t index) const +{ + return get_declared_type_alignment_msl(get_presumed_input_type(type, index), false, + has_member_decoration(type.self, index, DecorationRowMajor)); +} + +bool CompilerMSL::skip_argument(uint32_t) const +{ + return false; +} + +void CompilerMSL::analyze_sampled_image_usage() +{ + if (msl_options.swizzle_texture_samples) + { + SampledImageScanner scanner(*this); + traverse_all_reachable_opcodes(get(ir.default_entry_point), scanner); + } +} + +void CompilerMSL::analyze_workgroup_variables() +{ + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + // If workgroup variables have initializer, it can only be ConstantNull (zero init) + if (var.storage == StorageClassWorkgroup && var.initializer) + { + needs_workgroup_zero_init = true; + + // MSL compiler does not like the routine to initialize simple threadgroup variables, + // falsely claiming it is "sometimes uninitialized". Suppress it. + auto &type = get_variable_data_type(var); + if (type.array.empty() && type.member_types.empty()) + suppress_sometimes_unitialized = true; + } + }); +} + +bool CompilerMSL::SampledImageScanner::handle(Op opcode, const uint32_t *args, uint32_t length) +{ + switch (opcode) + { + case OpLoad: + case OpImage: + case OpSampledImage: + { + if (length < 3) + return false; + + uint32_t result_type = args[0]; + auto &type = get(result_type); + if ((type.basetype != SPIRType::Image && type.basetype != SPIRType::SampledImage) || type.image.sampled != 1) + return true; + + uint32_t id = args[1]; + set(id, "", result_type, true); + break; + } + case OpImageSampleExplicitLod: + case OpImageSampleProjExplicitLod: + case OpImageSampleDrefExplicitLod: + case OpImageSampleProjDrefExplicitLod: + case OpImageSampleImplicitLod: + case OpImageSampleProjImplicitLod: + case OpImageSampleDrefImplicitLod: + case OpImageSampleProjDrefImplicitLod: + case OpImageFetch: + case OpImageGather: + case OpImageDrefGather: + self.has_sampled_images = + self.has_sampled_images || self.is_sampled_image_type(self.expression_type(args[2])); + self.needs_swizzle_buffer_def = self.needs_swizzle_buffer_def || self.has_sampled_images; + break; + default: + break; + } + return true; +} + +// If a needed custom function wasn't added before, add it and force a recompile. +void CompilerMSL::add_spv_func_and_recompile(SPVFuncImpl spv_func) +{ + if (spv_function_implementations.count(spv_func) == 0) + { + spv_function_implementations.insert(spv_func); + suppress_missing_prototypes = true; + force_recompile(); + } +} + +bool CompilerMSL::OpCodePreprocessor::handle(Op opcode, const uint32_t *args, uint32_t length) +{ + // Since MSL exists in a single execution scope, function prototype declarations are not + // needed, and clutter the output. If secondary functions are output (either as a SPIR-V + // function implementation or as indicated by the presence of OpFunctionCall), then set + // suppress_missing_prototypes to suppress compiler warnings of missing function prototypes. + + // Mark if the input requires the implementation of an SPIR-V function that does not exist in Metal. + SPVFuncImpl spv_func = get_spv_func_impl(opcode, args, length); + if (spv_func != SPVFuncImplNone) + { + self.spv_function_implementations.insert(spv_func); + suppress_missing_prototypes = true; + } + + switch (opcode) + { + + case OpFunctionCall: + suppress_missing_prototypes = true; + break; + + case OpDemoteToHelperInvocationEXT: + uses_discard = true; + break; + + // Emulate texture2D atomic operations + case OpImageTexelPointer: + { + if (!self.msl_options.supports_msl_version(3, 1)) + { + auto *var = self.maybe_get_backing_variable(args[2]); + image_pointers_emulated[args[1]] = var ? var->self : ID(0); + } + break; + } + + case OpImageWrite: + uses_image_write = true; + break; + + case OpStore: + check_resource_write(args[0]); + break; + + // Emulate texture2D atomic operations + case OpAtomicExchange: + case OpAtomicCompareExchange: + case OpAtomicCompareExchangeWeak: + case OpAtomicIIncrement: + case OpAtomicIDecrement: + case OpAtomicIAdd: + case OpAtomicFAddEXT: + case OpAtomicISub: + case OpAtomicSMin: + case OpAtomicUMin: + case OpAtomicSMax: + case OpAtomicUMax: + case OpAtomicAnd: + case OpAtomicOr: + case OpAtomicXor: + { + uses_atomics = true; + auto it = image_pointers_emulated.find(args[2]); + if (it != image_pointers_emulated.end()) + { + uses_image_write = true; + self.atomic_image_vars_emulated.insert(it->second); + } + else + check_resource_write(args[2]); + break; + } + + case OpAtomicStore: + { + uses_atomics = true; + auto it = image_pointers_emulated.find(args[0]); + if (it != image_pointers_emulated.end()) + { + self.atomic_image_vars_emulated.insert(it->second); + uses_image_write = true; + } + else + check_resource_write(args[0]); + break; + } + + case OpAtomicLoad: + { + uses_atomics = true; + auto it = image_pointers_emulated.find(args[2]); + if (it != image_pointers_emulated.end()) + { + self.atomic_image_vars_emulated.insert(it->second); + } + break; + } + + case OpGroupNonUniformInverseBallot: + needs_subgroup_invocation_id = true; + break; + + case OpGroupNonUniformBallotFindLSB: + case OpGroupNonUniformBallotFindMSB: + needs_subgroup_size = true; + break; + + case OpGroupNonUniformBallotBitCount: + if (args[3] == GroupOperationReduce) + needs_subgroup_size = true; + else + needs_subgroup_invocation_id = true; + break; + + case OpGroupNonUniformRotateKHR: + // Add the correct invocation ID for calculating clustered rotate case. + if (length > 5) + { + if (static_cast(self.evaluate_constant_u32(args[2])) == ScopeSubgroup) + needs_subgroup_invocation_id = true; + else + needs_local_invocation_index = true; + } + break; + + case OpGroupNonUniformFAdd: + case OpGroupNonUniformFMul: + case OpGroupNonUniformFMin: + case OpGroupNonUniformFMax: + case OpGroupNonUniformIAdd: + case OpGroupNonUniformIMul: + case OpGroupNonUniformSMin: + case OpGroupNonUniformSMax: + case OpGroupNonUniformUMin: + case OpGroupNonUniformUMax: + case OpGroupNonUniformBitwiseAnd: + case OpGroupNonUniformBitwiseOr: + case OpGroupNonUniformBitwiseXor: + case OpGroupNonUniformLogicalAnd: + case OpGroupNonUniformLogicalOr: + case OpGroupNonUniformLogicalXor: + if ((compiler.get_execution_model() != ExecutionModelFragment || + self.msl_options.supports_msl_version(2, 2)) && + args[3] == GroupOperationClusteredReduce) + needs_subgroup_invocation_id = true; + break; + + case OpArrayLength: + { + auto *var = self.maybe_get_backing_variable(args[2]); + if (var != nullptr) + { + if (!self.is_var_runtime_size_array(*var)) + self.buffers_requiring_array_length.insert(var->self); + } + break; + } + + case OpInBoundsAccessChain: + case OpAccessChain: + case OpPtrAccessChain: + { + // OpArrayLength might want to know if taking ArrayLength of an array of SSBOs. + uint32_t result_type = args[0]; + uint32_t id = args[1]; + uint32_t ptr = args[2]; + + set(id, "", result_type, true); + self.register_read(id, ptr, true); + self.ir.ids[id].set_allow_type_rewrite(); + break; + } + + case OpExtInst: + { + uint32_t extension_set = args[2]; + SPIRExtension::Extension ext = get(extension_set).ext; + if (ext == SPIRExtension::GLSL) + { + auto op_450 = static_cast(args[3]); + switch (op_450) + { + case GLSLstd450InterpolateAtCentroid: + case GLSLstd450InterpolateAtSample: + case GLSLstd450InterpolateAtOffset: + { + if (!self.msl_options.supports_msl_version(2, 3)) + SPIRV_CROSS_THROW("Pull-model interpolation requires MSL 2.3."); + // Fragment varyings used with pull-model interpolation need special handling, + // due to the way pull-model interpolation works in Metal. + auto *var = self.maybe_get_backing_variable(args[4]); + if (var) + { + self.pull_model_inputs.insert(var->self); + auto &var_type = self.get_variable_element_type(*var); + // In addition, if this variable has a 'Sample' decoration, we need the sample ID + // in order to do default interpolation. + if (compiler.has_decoration(var->self, DecorationSample)) + { + needs_sample_id = true; + } + else if (var_type.basetype == SPIRType::Struct) + { + // Now we need to check each member and see if it has this decoration. + for (uint32_t i = 0; i < var_type.member_types.size(); ++i) + { + if (compiler.has_member_decoration(var_type.self, i, DecorationSample)) + { + needs_sample_id = true; + break; + } + } + } + } + break; + } + default: + break; + } + } + else if (ext == SPIRExtension::NonSemanticDebugPrintf) + { + // Operation 1 is printf. + if (args[3] == 1 && !self.msl_options.supports_msl_version(3, 2)) + SPIRV_CROSS_THROW("Debug printf requires MSL 3.2."); + } + break; + } + + case OpIsHelperInvocationEXT: + if (self.needs_manual_helper_invocation_updates()) + needs_helper_invocation = true; + break; + + default: + break; + } + + return true; +} + +// If the variable is a Uniform or StorageBuffer, mark that a resource has been written to. +void CompilerMSL::OpCodePreprocessor::check_resource_write(uint32_t var_id) +{ + auto *type = get_expression_result_type(var_id); + auto sc = StorageClassMax; + + if (type) + { + sc = type->storage; + } + else + { + auto *var = self.maybe_get_backing_variable(var_id); + if (var) + sc = var->storage; + } + + if (sc == StorageClassUniform || sc == StorageClassStorageBuffer || sc == StorageClassPhysicalStorageBuffer) + uses_buffer_write = true; +} + +// Returns an enumeration of a SPIR-V function that needs to be output for certain Op codes. +CompilerMSL::SPVFuncImpl CompilerMSL::OpCodePreprocessor::get_spv_func_impl(Op opcode, const uint32_t *args, uint32_t length) +{ + switch (opcode) + { + case OpSMod: + return SPVFuncImplSMod; + + case OpFMod: + return SPVFuncImplMod; + + case OpFAdd: + case OpFSub: + if (self.msl_options.invariant_float_math || self.has_legacy_nocontract(args[0], args[1])) + return opcode == OpFAdd ? SPVFuncImplFAdd : SPVFuncImplFSub; + break; + + case OpFMul: + case OpOuterProduct: + case OpMatrixTimesVector: + case OpVectorTimesMatrix: + case OpMatrixTimesMatrix: + if (self.msl_options.invariant_float_math || self.has_legacy_nocontract(args[0], args[1])) + return SPVFuncImplFMul; + break; + + case OpQuantizeToF16: + return SPVFuncImplQuantizeToF16; + + case OpTypeArray: + { + // Allow Metal to use the array template to make arrays a value type + return SPVFuncImplUnsafeArray; + } + + // Emulate texture2D atomic operations + case OpAtomicExchange: + case OpAtomicCompareExchange: + case OpAtomicCompareExchangeWeak: + case OpAtomicIIncrement: + case OpAtomicIDecrement: + case OpAtomicIAdd: + case OpAtomicFAddEXT: + case OpAtomicISub: + case OpAtomicSMin: + case OpAtomicUMin: + case OpAtomicSMax: + case OpAtomicUMax: + case OpAtomicAnd: + case OpAtomicOr: + case OpAtomicXor: + case OpAtomicLoad: + case OpAtomicStore: + { + auto it = image_pointers_emulated.find(args[opcode == OpAtomicStore ? 0 : 2]); + if (it != image_pointers_emulated.end()) + { + uint32_t tid = get(it->second).basetype; + if (tid && get(tid).image.dim == Dim2D) + return SPVFuncImplImage2DAtomicCoords; + } + break; + } + + case OpImageFetch: + case OpImageRead: + case OpImageWrite: + { + // Retrieve the image type, and if it's a Buffer, emit a texel coordinate function + uint32_t tid = result_types[args[opcode == OpImageWrite ? 0 : 2]]; + if (tid && get(tid).image.dim == DimBuffer && !self.msl_options.texture_buffer_native) + return SPVFuncImplTexelBufferCoords; + break; + } + + case OpExtInst: + { + uint32_t extension_set = args[2]; + if (get(extension_set).ext == SPIRExtension::GLSL) + { + auto op_450 = static_cast(args[3]); + switch (op_450) + { + case GLSLstd450Radians: + return SPVFuncImplRadians; + case GLSLstd450Degrees: + return SPVFuncImplDegrees; + case GLSLstd450FindILsb: + return SPVFuncImplFindILsb; + case GLSLstd450FindSMsb: + return SPVFuncImplFindSMsb; + case GLSLstd450FindUMsb: + return SPVFuncImplFindUMsb; + case GLSLstd450SSign: + return SPVFuncImplSSign; + case GLSLstd450Reflect: + { + auto &type = get(args[0]); + if (type.vecsize == 1) + return SPVFuncImplReflectScalar; + break; + } + case GLSLstd450Refract: + { + auto &type = get(args[0]); + if (type.vecsize == 1) + return SPVFuncImplRefractScalar; + break; + } + case GLSLstd450FaceForward: + { + auto &type = get(args[0]); + if (type.vecsize == 1) + return SPVFuncImplFaceForwardScalar; + break; + } + case GLSLstd450MatrixInverse: + { + auto &mat_type = get(args[0]); + switch (mat_type.columns) + { + case 2: + return SPVFuncImplInverse2x2; + case 3: + return SPVFuncImplInverse3x3; + case 4: + return SPVFuncImplInverse4x4; + default: + break; + } + break; + } + default: + break; + } + } + break; + } + + case OpGroupNonUniformBroadcast: + case OpSubgroupReadInvocationKHR: + return SPVFuncImplSubgroupBroadcast; + + case OpGroupNonUniformBroadcastFirst: + case OpSubgroupFirstInvocationKHR: + return SPVFuncImplSubgroupBroadcastFirst; + + case OpGroupNonUniformBallot: + case OpSubgroupBallotKHR: + return SPVFuncImplSubgroupBallot; + + case OpGroupNonUniformInverseBallot: + case OpGroupNonUniformBallotBitExtract: + return SPVFuncImplSubgroupBallotBitExtract; + + case OpGroupNonUniformBallotFindLSB: + return SPVFuncImplSubgroupBallotFindLSB; + + case OpGroupNonUniformBallotFindMSB: + return SPVFuncImplSubgroupBallotFindMSB; + + case OpGroupNonUniformBallotBitCount: + return SPVFuncImplSubgroupBallotBitCount; + + case OpGroupNonUniformAllEqual: + case OpSubgroupAllEqualKHR: + return SPVFuncImplSubgroupAllEqual; + + case OpGroupNonUniformShuffle: + return SPVFuncImplSubgroupShuffle; + + case OpGroupNonUniformShuffleXor: + return SPVFuncImplSubgroupShuffleXor; + + case OpGroupNonUniformShuffleUp: + return SPVFuncImplSubgroupShuffleUp; + + case OpGroupNonUniformShuffleDown: + return SPVFuncImplSubgroupShuffleDown; + + case OpGroupNonUniformRotateKHR: + // Clustered rotate is performed using shuffle. + if (length > 5) + return SPVFuncImplSubgroupShuffle; + return SPVFuncImplSubgroupRotate; + + case OpGroupNonUniformQuadBroadcast: + return SPVFuncImplQuadBroadcast; + + case OpGroupNonUniformQuadSwap: + return SPVFuncImplQuadSwap; + + case OpSDot: + case OpUDot: + case OpSUDot: + case OpSDotAccSat: + case OpUDotAccSat: + case OpSUDotAccSat: + return SPVFuncImplReduceAdd; + + case OpSMulExtended: + case OpUMulExtended: + return SPVFuncImplMulExtended; + + case OpAssumeTrueKHR: + case OpExpectKHR: + return SPVFuncImplAssume; + + default: + break; + } + return SPVFuncImplNone; +} + +// Sort both type and meta member content based on builtin status (put builtins at end), +// then by the required sorting aspect. +void CompilerMSL::MemberSorter::sort() +{ + // Create a temporary array of consecutive member indices and sort it based on how + // the members should be reordered, based on builtin and sorting aspect meta info. + size_t mbr_cnt = type.member_types.size(); + SmallVector mbr_idxs(mbr_cnt); + std::iota(mbr_idxs.begin(), mbr_idxs.end(), 0); // Fill with consecutive indices + std::stable_sort(mbr_idxs.begin(), mbr_idxs.end(), *this); // Sort member indices based on sorting aspect + + bool sort_is_identity = true; + for (uint32_t mbr_idx = 0; mbr_idx < mbr_cnt; mbr_idx++) + { + if (mbr_idx != mbr_idxs[mbr_idx]) + { + sort_is_identity = false; + break; + } + } + + if (sort_is_identity) + return; + + if (meta.members.size() < type.member_types.size()) + { + // This should never trigger in normal circumstances, but to be safe. + meta.members.resize(type.member_types.size()); + } + + // Move type and meta member info to the order defined by the sorted member indices. + // This is done by creating temporary copies of both member types and meta, and then + // copying back to the original content at the sorted indices. + auto mbr_types_cpy = type.member_types; + auto mbr_meta_cpy = meta.members; + for (uint32_t mbr_idx = 0; mbr_idx < mbr_cnt; mbr_idx++) + { + type.member_types[mbr_idx] = mbr_types_cpy[mbr_idxs[mbr_idx]]; + meta.members[mbr_idx] = mbr_meta_cpy[mbr_idxs[mbr_idx]]; + } + + // If we're sorting by Offset, this might affect user code which accesses a buffer block. + // We will need to redirect member indices from defined index to sorted index using reverse lookup. + if (sort_aspect == SortAspect::Offset) + { + type.member_type_index_redirection.resize(mbr_cnt); + for (uint32_t map_idx = 0; map_idx < mbr_cnt; map_idx++) + type.member_type_index_redirection[mbr_idxs[map_idx]] = map_idx; + } +} + +bool CompilerMSL::MemberSorter::operator()(uint32_t mbr_idx1, uint32_t mbr_idx2) +{ + auto &mbr_meta1 = meta.members[mbr_idx1]; + auto &mbr_meta2 = meta.members[mbr_idx2]; + + if (sort_aspect == LocationThenBuiltInType) + { + // Sort first by builtin status (put builtins at end), then by the sorting aspect. + if (mbr_meta1.builtin != mbr_meta2.builtin) + return mbr_meta2.builtin; + else if (mbr_meta1.builtin) + return mbr_meta1.builtin_type < mbr_meta2.builtin_type; + else if (mbr_meta1.location == mbr_meta2.location) + return mbr_meta1.component < mbr_meta2.component; + else + return mbr_meta1.location < mbr_meta2.location; + } + else + return mbr_meta1.offset < mbr_meta2.offset; +} + +CompilerMSL::MemberSorter::MemberSorter(SPIRType &t, Meta &m, SortAspect sa) + : type(t) + , meta(m) + , sort_aspect(sa) +{ + // Ensure enough meta info is available + meta.members.resize(max(type.member_types.size(), meta.members.size())); +} + +void CompilerMSL::remap_constexpr_sampler(VariableID id, const MSLConstexprSampler &sampler) +{ + auto &type = get(get(id).basetype); + if (type.basetype != SPIRType::SampledImage && type.basetype != SPIRType::Sampler) + SPIRV_CROSS_THROW("Can only remap SampledImage and Sampler type."); + if (!type.array.empty()) + SPIRV_CROSS_THROW("Can not remap array of samplers."); + constexpr_samplers_by_id[id] = sampler; +} + +void CompilerMSL::remap_constexpr_sampler_by_binding(uint32_t desc_set, uint32_t binding, + const MSLConstexprSampler &sampler) +{ + constexpr_samplers_by_binding[{ desc_set, binding }] = sampler; +} + +void CompilerMSL::cast_from_variable_load(uint32_t source_id, std::string &expr, const SPIRType &expr_type) +{ + bool is_packed = has_extended_decoration(source_id, SPIRVCrossDecorationPhysicalTypePacked); + auto *source_expr = maybe_get(source_id); + auto *var = maybe_get_backing_variable(source_id); + const SPIRType *var_type = nullptr, *phys_type = nullptr; + + if (uint32_t phys_id = get_extended_decoration(source_id, SPIRVCrossDecorationPhysicalTypeID)) + phys_type = &get(phys_id); + else + phys_type = &expr_type; + + if (var) + { + source_id = var->self; + var_type = &get_variable_data_type(*var); + } + + bool rewrite_boolean_load = + expr_type.basetype == SPIRType::Boolean && + (var && (var->storage == StorageClassWorkgroup || var_type->basetype == SPIRType::Struct)); + + // Type fixups for workgroup variables if they are booleans. + if (rewrite_boolean_load) + { + if (is_array(expr_type)) + expr = to_rerolled_array_expression(expr_type, expr, expr_type); + else + expr = join(type_to_glsl(expr_type), "(", expr, ")"); + } + + // Type fixups for workgroup variables if they are matrices. + // Don't do fixup for packed types; those are handled specially. + // FIXME: Maybe use a type like spvStorageMatrix for packed matrices? + if (!msl_options.supports_msl_version(3, 0) && var && + (var->storage == StorageClassWorkgroup || + (var_type->basetype == SPIRType::Struct && + has_extended_decoration(var_type->self, SPIRVCrossDecorationWorkgroupStruct) && !is_packed)) && + expr_type.columns > 1) + { + SPIRType matrix_type = *phys_type; + if (source_expr && source_expr->need_transpose) + swap(matrix_type.vecsize, matrix_type.columns); + matrix_type.array.clear(); + matrix_type.array_size_literal.clear(); + expr = join(type_to_glsl(matrix_type), "(", expr, ")"); + } + + // Only interested in standalone builtin variables in the switch below. + if (!has_decoration(source_id, DecorationBuiltIn)) + { + // If the backing variable does not match our expected sign, we can fix it up here. + // See ensure_correct_input_type(). + if (var && var->storage == StorageClassInput) + { + auto &base_type = get(var->basetype); + if (base_type.basetype != SPIRType::Struct && expr_type.basetype != base_type.basetype) + expr = join(type_to_glsl(expr_type), "(", expr, ")"); + } + return; + } + + auto builtin = static_cast(get_decoration(source_id, DecorationBuiltIn)); + auto expected_type = expr_type.basetype; + auto expected_width = expr_type.width; + switch (builtin) + { + case BuiltInGlobalInvocationId: + case BuiltInLocalInvocationId: + case BuiltInWorkgroupId: + case BuiltInLocalInvocationIndex: + case BuiltInWorkgroupSize: + case BuiltInNumWorkgroups: + case BuiltInLayer: + case BuiltInViewportIndex: + case BuiltInFragStencilRefEXT: + case BuiltInPrimitiveId: + case BuiltInSubgroupSize: + case BuiltInSubgroupLocalInvocationId: + case BuiltInViewIndex: + case BuiltInVertexIndex: + case BuiltInInstanceIndex: + case BuiltInBaseInstance: + case BuiltInBaseVertex: + case BuiltInSampleMask: + expected_type = SPIRType::UInt; + expected_width = 32; + break; + + case BuiltInTessLevelInner: + case BuiltInTessLevelOuter: + if (is_tesc_shader()) + { + expected_type = SPIRType::Half; + expected_width = 16; + } + break; + + default: + break; + } + + if (is_array(expr_type) && builtin == BuiltInSampleMask) + { + // Needs special handling. + auto wrap_expr = join(type_to_glsl(expr_type), "({ "); + wrap_expr += join(type_to_glsl(get(expr_type.parent_type)), "(", expr, ")"); + wrap_expr += " })"; + expr = std::move(wrap_expr); + } + else if (expected_type != expr_type.basetype) + { + if (is_array(expr_type) && (builtin == BuiltInTessLevelInner || builtin == BuiltInTessLevelOuter)) + { + // Triggers when loading TessLevel directly as an array. + // Need explicit padding + cast. + auto wrap_expr = join(type_to_glsl(expr_type), "({ "); + + uint32_t array_size = get_physical_tess_level_array_size(builtin); + for (uint32_t i = 0; i < array_size; i++) + { + if (array_size > 1) + wrap_expr += join("float(", expr, "[", i, "])"); + else + wrap_expr += join("float(", expr, ")"); + if (i + 1 < array_size) + wrap_expr += ", "; + } + + if (is_tessellating_triangles()) + wrap_expr += ", 0.0"; + + wrap_expr += " })"; + expr = std::move(wrap_expr); + } + else + { + // These are of different widths, so we cannot do a straight bitcast. + if (expected_width != expr_type.width) + expr = join(type_to_glsl(expr_type), "(", expr, ")"); + else + expr = bitcast_expression(expr_type, expected_type, expr); + } + } +} + +void CompilerMSL::cast_to_variable_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type) +{ + bool is_packed = has_extended_decoration(target_id, SPIRVCrossDecorationPhysicalTypePacked); + auto *target_expr = maybe_get(target_id); + auto *var = maybe_get_backing_variable(target_id); + const SPIRType *var_type = nullptr, *phys_type = nullptr; + + if (uint32_t phys_id = get_extended_decoration(target_id, SPIRVCrossDecorationPhysicalTypeID)) + phys_type = &get(phys_id); + else + phys_type = &expr_type; + + if (var) + { + target_id = var->self; + var_type = &get_variable_data_type(*var); + } + + bool rewrite_boolean_store = + expr_type.basetype == SPIRType::Boolean && + (var && (var->storage == StorageClassWorkgroup || var_type->basetype == SPIRType::Struct)); + + // Type fixups for workgroup variables or struct members if they are booleans. + if (rewrite_boolean_store) + { + if (is_array(expr_type)) + { + expr = to_rerolled_array_expression(*var_type, expr, expr_type); + } + else + { + auto short_type = expr_type; + short_type.basetype = SPIRType::Short; + expr = join(type_to_glsl(short_type), "(", expr, ")"); + } + } + + // Type fixups for workgroup variables if they are matrices. + // Don't do fixup for packed types; those are handled specially. + // FIXME: Maybe use a type like spvStorageMatrix for packed matrices? + if (!msl_options.supports_msl_version(3, 0) && var && + (var->storage == StorageClassWorkgroup || + (var_type->basetype == SPIRType::Struct && + has_extended_decoration(var_type->self, SPIRVCrossDecorationWorkgroupStruct) && !is_packed)) && + expr_type.columns > 1) + { + SPIRType matrix_type = *phys_type; + if (target_expr && target_expr->need_transpose) + swap(matrix_type.vecsize, matrix_type.columns); + expr = join("spvStorage_", type_to_glsl(matrix_type), "(", expr, ")"); + } + + // Only interested in standalone builtin variables. + if (!has_decoration(target_id, DecorationBuiltIn)) + return; + + auto builtin = static_cast(get_decoration(target_id, DecorationBuiltIn)); + auto expected_type = expr_type.basetype; + auto expected_width = expr_type.width; + switch (builtin) + { + case BuiltInLayer: + case BuiltInViewportIndex: + case BuiltInFragStencilRefEXT: + case BuiltInPrimitiveId: + case BuiltInViewIndex: + expected_type = SPIRType::UInt; + expected_width = 32; + break; + + case BuiltInTessLevelInner: + case BuiltInTessLevelOuter: + expected_type = SPIRType::Half; + expected_width = 16; + break; + + default: + break; + } + + if (expected_type != expr_type.basetype) + { + if (expected_width != expr_type.width) + { + // These are of different widths, so we cannot do a straight bitcast. + auto type = expr_type; + type.basetype = expected_type; + type.width = expected_width; + expr = join(type_to_glsl(type), "(", expr, ")"); + } + else + { + auto type = expr_type; + type.basetype = expected_type; + expr = bitcast_expression(type, expr_type.basetype, expr); + } + } +} + +string CompilerMSL::to_initializer_expression(const SPIRVariable &var) +{ + // We risk getting an array initializer here with MSL. If we have an array. + // FIXME: We cannot handle non-constant arrays being initialized. + // We will need to inject spvArrayCopy here somehow ... + auto &type = get(var.basetype); + string expr; + if (ir.ids[var.initializer].get_type() == TypeConstant && + (!type.array.empty() || type.basetype == SPIRType::Struct)) + expr = constant_expression(get(var.initializer)); + else + expr = CompilerGLSL::to_initializer_expression(var); + // If the initializer has more vector components than the variable, add a swizzle. + // FIXME: This can't handle arrays or structs. + auto &init_type = expression_type(var.initializer); + if (type.array.empty() && type.basetype != SPIRType::Struct && init_type.vecsize > type.vecsize) + expr = enclose_expression(expr + vector_swizzle(type.vecsize, 0)); + return expr; +} + +string CompilerMSL::to_zero_initialized_expression(uint32_t) +{ + return "{}"; +} + +bool CompilerMSL::descriptor_set_is_argument_buffer(uint32_t desc_set) const +{ + if (!msl_options.argument_buffers) + return false; + if (desc_set >= kMaxArgumentBuffers) + return false; + + return (argument_buffer_discrete_mask & (1u << desc_set)) == 0; +} + +bool CompilerMSL::is_supported_argument_buffer_type(const SPIRType &type) const +{ + // iOS Tier 1 argument buffers do not support writable images. + // When the argument buffer is encoded, we don't know whether this image will have a + // NonWritable decoration, so just use discrete arguments for all storage images on iOS. + bool is_supported_type = !(type.basetype == SPIRType::Image && + type.image.sampled == 2 && + msl_options.is_ios() && + msl_options.argument_buffers_tier <= Options::ArgumentBuffersTier::Tier1); + return is_supported_type && !type_is_msl_framebuffer_fetch(type); +} + +void CompilerMSL::emit_argument_buffer_aliased_descriptor(const SPIRVariable &aliased_var, + const SPIRVariable &base_var) +{ + // To deal with buffer <-> image aliasing, we need to perform an unholy UB ritual. + // A texture type in Metal 3.0 is a pointer. However, we cannot simply cast a pointer to texture. + // What we *can* do is to cast pointer-to-pointer to pointer-to-texture. + + // We need to explicitly reach into the descriptor buffer lvalue, not any spvDescriptorArray wrapper. + auto *var_meta = ir.find_meta(base_var.self); + bool old_explicit_qualifier = var_meta && var_meta->decoration.qualified_alias_explicit_override; + if (var_meta) + var_meta->decoration.qualified_alias_explicit_override = false; + auto unqualified_name = to_name(base_var.self, false); + if (var_meta) + var_meta->decoration.qualified_alias_explicit_override = old_explicit_qualifier; + + // For non-arrayed buffers, we have already performed a de-reference. + // We need a proper lvalue to cast, so strip away the de-reference. + if (unqualified_name.size() > 2 && unqualified_name[0] == '(' && unqualified_name[1] == '*') + { + unqualified_name.erase(unqualified_name.begin(), unqualified_name.begin() + 2); + unqualified_name.pop_back(); + } + + string name; + + auto &var_type = get(aliased_var.basetype); + auto &data_type = get_variable_data_type(aliased_var); + string descriptor_storage = descriptor_address_space(aliased_var.self, aliased_var.storage, ""); + + if (aliased_var.storage == StorageClassUniformConstant) + { + if (is_var_runtime_size_array(aliased_var)) + { + // This becomes a plain pointer to spvDescriptor. + name = join("reinterpret_cast<", descriptor_storage, " ", + type_to_glsl(get_variable_data_type(aliased_var), aliased_var.self, true), ">(&", + unqualified_name, ")"); + } + else + { + name = join("reinterpret_cast<", descriptor_storage, " ", + type_to_glsl(get_variable_data_type(aliased_var), aliased_var.self, true), " &>(", + unqualified_name, ");"); + } + } + else + { + // Buffer types. + bool old_is_using_builtin_array = is_using_builtin_array; + is_using_builtin_array = true; + + bool needs_post_cast_deref = !is_array(data_type); + string ref_type = needs_post_cast_deref ? "&" : join("(&)", type_to_array_glsl(var_type, aliased_var.self)); + + if (is_var_runtime_size_array(aliased_var)) + { + name = join("reinterpret_cast<", + type_to_glsl(var_type, aliased_var.self, true), " ", descriptor_storage, " *>(&", + unqualified_name, ")"); + } + else + { + name = join(needs_post_cast_deref ? "*" : "", "reinterpret_cast<", + type_to_glsl(var_type, aliased_var.self, true), " ", descriptor_storage, " ", + ref_type, + ">(", unqualified_name, ");"); + } + + if (needs_post_cast_deref) + descriptor_storage = get_type_address_space(var_type, aliased_var.self, false); + + // These kinds of ridiculous casts trigger warnings in compiler. Just ignore them. + if (!suppress_incompatible_pointer_types_discard_qualifiers) + { + suppress_incompatible_pointer_types_discard_qualifiers = true; + force_recompile_guarantee_forward_progress(); + } + + is_using_builtin_array = old_is_using_builtin_array; + } + + if (!is_var_runtime_size_array(aliased_var)) + { + // Lower to temporary, so drop the qualification. + set_qualified_name(aliased_var.self, ""); + statement(descriptor_storage, " auto &", to_name(aliased_var.self), " = ", name); + } + else + { + // This alias may have already been used to emit an entry point declaration. If there is a mismatch, we need a recompile. + // Moving this code to be run earlier will also conflict, + // because we need the qualified alias for the base resource, + // so forcing recompile until things sync up is the least invasive method for now. + if (ir.meta[aliased_var.self].decoration.qualified_alias != name) + force_recompile(); + + // This will get wrapped in a separate temporary when a spvDescriptorArray wrapper is emitted. + set_qualified_name(aliased_var.self, name); + } +} + +void CompilerMSL::analyze_argument_buffers() +{ + // Gather all used resources and sort them out into argument buffers. + // Each argument buffer corresponds to a descriptor set in SPIR-V. + // The [[id(N)]] values used correspond to the resource mapping we have for MSL. + // Otherwise, the binding number is used, but this is generally not safe some types like + // combined image samplers and arrays of resources. Metal needs different indices here, + // while SPIR-V can have one descriptor set binding. To use argument buffers in practice, + // you will need to use the remapping from the API. + for (auto &id : argument_buffer_ids) + id = 0; + + // Output resources, sorted by resource index & type. + struct Resource + { + SPIRVariable *var; + string name; + SPIRType::BaseType basetype; + uint32_t index; + uint32_t plane_count; + uint32_t plane; + uint32_t overlapping_var_id; + }; + SmallVector resources_in_set[kMaxArgumentBuffers]; + SmallVector inline_block_vars; + + bool set_needs_swizzle_buffer[kMaxArgumentBuffers] = {}; + bool set_needs_buffer_sizes[kMaxArgumentBuffers] = {}; + bool needs_buffer_sizes = false; + + ir.for_each_typed_id([&](uint32_t self, SPIRVariable &var) { + if ((var.storage == StorageClassUniform || var.storage == StorageClassUniformConstant || + var.storage == StorageClassStorageBuffer) && + !is_hidden_variable(var)) + { + uint32_t desc_set = get_decoration(self, DecorationDescriptorSet); + // Ignore if it's part of a push descriptor set. + if (!descriptor_set_is_argument_buffer(desc_set)) + return; + + uint32_t var_id = var.self; + auto &type = get_variable_data_type(var); + + if (desc_set >= kMaxArgumentBuffers) + SPIRV_CROSS_THROW("Descriptor set index is out of range."); + + const MSLConstexprSampler *constexpr_sampler = nullptr; + if (type.basetype == SPIRType::SampledImage || type.basetype == SPIRType::Sampler) + { + constexpr_sampler = find_constexpr_sampler(var_id); + if (constexpr_sampler) + { + // Mark this ID as a constexpr sampler for later in case it came from set/bindings. + constexpr_samplers_by_id[var_id] = *constexpr_sampler; + } + } + + uint32_t binding = get_decoration(var_id, DecorationBinding); + if (type.basetype == SPIRType::SampledImage) + { + add_resource_name(var_id); + + uint32_t plane_count = 1; + if (constexpr_sampler && constexpr_sampler->ycbcr_conversion_enable) + plane_count = constexpr_sampler->planes; + + for (uint32_t i = 0; i < plane_count; i++) + { + uint32_t image_resource_index = get_metal_resource_index(var, SPIRType::Image, i); + resources_in_set[desc_set].push_back( + { &var, to_name(var_id), SPIRType::Image, image_resource_index, plane_count, i, 0 }); + } + + if (type.image.dim != DimBuffer && !constexpr_sampler) + { + uint32_t sampler_resource_index = get_metal_resource_index(var, SPIRType::Sampler); + resources_in_set[desc_set].push_back( + { &var, to_sampler_expression(var_id), SPIRType::Sampler, sampler_resource_index, 1, 0, 0 }); + } + } + else if (inline_uniform_blocks.count(SetBindingPair{ desc_set, binding })) + { + inline_block_vars.push_back(var_id); + } + else if (!constexpr_sampler && is_supported_argument_buffer_type(type)) + { + // constexpr samplers are not declared as resources. + // Inline uniform blocks are always emitted at the end. + add_resource_name(var_id); + + uint32_t resource_index = get_metal_resource_index(var, type.basetype); + + resources_in_set[desc_set].push_back( + { &var, to_name(var_id), type.basetype, resource_index, 1, 0, 0 }); + + // Emulate texture2D atomic operations + if (atomic_image_vars_emulated.count(var.self)) + { + uint32_t buffer_resource_index = get_metal_resource_index(var, SPIRType::AtomicCounter, 0); + resources_in_set[desc_set].push_back( + { &var, to_name(var_id) + "_atomic", SPIRType::Struct, buffer_resource_index, 1, 0, 0 }); + } + } + + // Check if this descriptor set needs a swizzle buffer. + if (needs_swizzle_buffer_def && is_sampled_image_type(type)) + set_needs_swizzle_buffer[desc_set] = true; + else if (buffer_requires_array_length(var_id)) + { + set_needs_buffer_sizes[desc_set] = true; + needs_buffer_sizes = true; + } + } + }); + + if (needs_swizzle_buffer_def || needs_buffer_sizes) + { + uint32_t uint_ptr_type_id = 0; + + // We might have to add a swizzle buffer resource to the set. + for (uint32_t desc_set = 0; desc_set < kMaxArgumentBuffers; desc_set++) + { + if (!set_needs_swizzle_buffer[desc_set] && !set_needs_buffer_sizes[desc_set]) + continue; + + if (uint_ptr_type_id == 0) + { + uint_ptr_type_id = ir.increase_bound_by(1); + + // Create a buffer to hold extra data, including the swizzle constants. + SPIRType uint_type_pointer = get_uint_type(); + uint_type_pointer.op = OpTypePointer; + uint_type_pointer.pointer = true; + uint_type_pointer.pointer_depth++; + uint_type_pointer.parent_type = get_uint_type_id(); + uint_type_pointer.storage = StorageClassUniform; + set(uint_ptr_type_id, uint_type_pointer); + set_decoration(uint_ptr_type_id, DecorationArrayStride, 4); + } + + if (set_needs_swizzle_buffer[desc_set]) + { + uint32_t var_id = ir.increase_bound_by(1); + auto &var = set(var_id, uint_ptr_type_id, StorageClassUniformConstant); + set_name(var_id, "spvSwizzleConstants"); + set_decoration(var_id, DecorationDescriptorSet, desc_set); + set_decoration(var_id, DecorationBinding, kSwizzleBufferBinding); + resources_in_set[desc_set].push_back( + { &var, to_name(var_id), SPIRType::UInt, get_metal_resource_index(var, SPIRType::UInt), 1, 0, 0 }); + } + + if (set_needs_buffer_sizes[desc_set]) + { + uint32_t var_id = ir.increase_bound_by(1); + auto &var = set(var_id, uint_ptr_type_id, StorageClassUniformConstant); + set_name(var_id, "spvBufferSizeConstants"); + set_decoration(var_id, DecorationDescriptorSet, desc_set); + set_decoration(var_id, DecorationBinding, kBufferSizeBufferBinding); + resources_in_set[desc_set].push_back( + { &var, to_name(var_id), SPIRType::UInt, get_metal_resource_index(var, SPIRType::UInt), 1, 0, 0 }); + } + } + } + + // Now add inline uniform blocks. + for (uint32_t var_id : inline_block_vars) + { + auto &var = get(var_id); + uint32_t desc_set = get_decoration(var_id, DecorationDescriptorSet); + add_resource_name(var_id); + resources_in_set[desc_set].push_back( + { &var, to_name(var_id), SPIRType::Struct, get_metal_resource_index(var, SPIRType::Struct), 1, 0, 0 }); + } + + for (uint32_t desc_set = 0; desc_set < kMaxArgumentBuffers; desc_set++) + { + auto &resources = resources_in_set[desc_set]; + if (resources.empty()) + continue; + + assert(descriptor_set_is_argument_buffer(desc_set)); + + uint32_t next_id = ir.increase_bound_by(3); + uint32_t type_id = next_id + 1; + uint32_t ptr_type_id = next_id + 2; + argument_buffer_ids[desc_set] = next_id; + + auto &buffer_type = set(type_id, OpTypeStruct); + + buffer_type.basetype = SPIRType::Struct; + + if ((argument_buffer_device_storage_mask & (1u << desc_set)) != 0) + { + buffer_type.storage = StorageClassStorageBuffer; + // Make sure the argument buffer gets marked as const device. + set_decoration(next_id, DecorationNonWritable); + // Need to mark the type as a Block to enable this. + set_decoration(type_id, DecorationBlock); + } + else + buffer_type.storage = StorageClassUniform; + + auto buffer_type_name = join("spvDescriptorSetBuffer", desc_set); + set_name(type_id, buffer_type_name); + + auto &ptr_type = set(ptr_type_id, OpTypePointer); + ptr_type = buffer_type; + ptr_type.op = OpTypePointer; + ptr_type.pointer = true; + ptr_type.pointer_depth++; + ptr_type.parent_type = type_id; + + uint32_t buffer_variable_id = next_id; + auto &buffer_var = set(buffer_variable_id, ptr_type_id, StorageClassUniform); + auto buffer_name = join("spvDescriptorSet", desc_set); + set_name(buffer_variable_id, buffer_name); + + // Ids must be emitted in ID order. + stable_sort(begin(resources), end(resources), [&](const Resource &lhs, const Resource &rhs) -> bool { + return tie(lhs.index, lhs.basetype) < tie(rhs.index, rhs.basetype); + }); + + for (size_t i = 0; i < resources.size() - 1; i++) + { + auto &r1 = resources[i]; + auto &r2 = resources[i + 1]; + + if (r1.index == r2.index) + { + if (r1.overlapping_var_id) + r2.overlapping_var_id = r1.overlapping_var_id; + else + r2.overlapping_var_id = r1.var->self; + + set_extended_decoration(r2.var->self, SPIRVCrossDecorationOverlappingBinding, r2.overlapping_var_id); + } + } + + uint32_t member_index = 0; + uint32_t next_arg_buff_index = 0; + uint32_t prev_was_scalar_on_array_offset = 0; + for (auto &resource : resources) + { + auto &var = *resource.var; + auto &type = get_variable_data_type(var); + + if (is_var_runtime_size_array(var) && (argument_buffer_device_storage_mask & (1u << desc_set)) == 0) + SPIRV_CROSS_THROW("Runtime sized variables must be in device storage argument buffers."); + + // If needed, synthesize and add padding members. + // member_index and next_arg_buff_index are incremented when padding members are added. + if (msl_options.pad_argument_buffer_resources && resource.plane == 0 && resource.overlapping_var_id == 0) + { + auto rez_bind = get_argument_buffer_resource(desc_set, next_arg_buff_index - prev_was_scalar_on_array_offset); + rez_bind.count -= prev_was_scalar_on_array_offset; + + while (resource.index > next_arg_buff_index) + { + switch (rez_bind.basetype) + { + case SPIRType::Void: + case SPIRType::Boolean: + case SPIRType::SByte: + case SPIRType::UByte: + case SPIRType::Short: + case SPIRType::UShort: + case SPIRType::Int: + case SPIRType::UInt: + case SPIRType::Int64: + case SPIRType::UInt64: + case SPIRType::AtomicCounter: + case SPIRType::Half: + case SPIRType::Float: + case SPIRType::Double: + add_argument_buffer_padding_buffer_type(buffer_type, member_index, next_arg_buff_index, rez_bind); + break; + case SPIRType::Image: + add_argument_buffer_padding_image_type(buffer_type, member_index, next_arg_buff_index, rez_bind); + break; + case SPIRType::Sampler: + add_argument_buffer_padding_sampler_type(buffer_type, member_index, next_arg_buff_index, rez_bind); + break; + case SPIRType::SampledImage: + if (next_arg_buff_index == rez_bind.msl_sampler) + add_argument_buffer_padding_sampler_type(buffer_type, member_index, next_arg_buff_index, rez_bind); + else + add_argument_buffer_padding_image_type(buffer_type, member_index, next_arg_buff_index, rez_bind); + break; + default: + break; + } + + // After padding, retrieve the resource again. It will either be more padding, or the actual resource. + rez_bind = get_argument_buffer_resource(desc_set, next_arg_buff_index); + prev_was_scalar_on_array_offset = 0; + } + + uint32_t count = rez_bind.count; + + // If the current resource is an array in the descriptor, but is a scalar + // in the shader, only the first element will be consumed. The next pass + // will add a padding member to consume the remaining array elements. + if (count > 1 && type.array.empty()) + count = prev_was_scalar_on_array_offset = 1; + + // Adjust the number of slots consumed by current member itself. + next_arg_buff_index += resource.plane_count * count; + } + + // Here we're locking down the member name early before compilation loops, so ensure that + // the resource name is not reused, even through a reset(). + string mbr_name = ensure_valid_name(resource.name, "m"); + if (resource.plane > 0) + mbr_name += join(plane_name_suffix, resource.plane); + set_member_name(buffer_type.self, member_index, mbr_name); + + if (resource.basetype == SPIRType::Sampler && type.basetype != SPIRType::Sampler) + { + // Have to synthesize a sampler type here. + + bool type_is_array = !type.array.empty(); + uint32_t sampler_type_id = ir.increase_bound_by(type_is_array ? 2 : 1); + auto &new_sampler_type = set(sampler_type_id, OpTypeSampler); + new_sampler_type.basetype = SPIRType::Sampler; + new_sampler_type.storage = StorageClassUniformConstant; + + if (type_is_array) + { + uint32_t sampler_type_array_id = sampler_type_id + 1; + auto &sampler_type_array = set(sampler_type_array_id, OpTypeArray); + sampler_type_array = new_sampler_type; + sampler_type_array.array = type.array; + sampler_type_array.array_size_literal = type.array_size_literal; + sampler_type_array.parent_type = sampler_type_id; + buffer_type.member_types.push_back(sampler_type_array_id); + } + else + buffer_type.member_types.push_back(sampler_type_id); + } + else + { + uint32_t binding = get_decoration(var.self, DecorationBinding); + SetBindingPair pair = { desc_set, binding }; + + if (resource.basetype == SPIRType::Image || resource.basetype == SPIRType::Sampler || + resource.basetype == SPIRType::SampledImage || resource.basetype == SPIRType::AccelerationStructure) + { + // Drop pointer information when we emit the resources into a struct. + buffer_type.member_types.push_back(get_variable_data_type_id(var)); + if (has_extended_decoration(var.self, SPIRVCrossDecorationOverlappingBinding)) + { + if (!msl_options.supports_msl_version(3, 0)) + SPIRV_CROSS_THROW("Full mutable aliasing of argument buffer descriptors only works on Metal 3+."); + + auto &entry_func = get(ir.default_entry_point); + entry_func.fixup_hooks_in.push_back([this, resource]() { + emit_argument_buffer_aliased_descriptor(*resource.var, this->get(resource.overlapping_var_id)); + }); + } + else if (resource.plane == 0) + { + set_qualified_name(var.self, join(to_name(buffer_variable_id), ".", mbr_name)); + } + } + else if (buffers_requiring_dynamic_offset.count(pair)) + { + // Don't set the qualified name here; we'll define a variable holding the corrected buffer address later. + buffer_type.member_types.push_back(var.basetype); + auto &dynamic_buffer = buffers_requiring_dynamic_offset[pair]; + dynamic_buffer.var_id = var.self; + dynamic_buffer.mbr_name = mbr_name; + } + else if (inline_uniform_blocks.count(pair)) + { + // Put the buffer block itself into the argument buffer. + buffer_type.member_types.push_back(get_variable_data_type_id(var)); + set_qualified_name(var.self, join(to_name(buffer_variable_id), ".", mbr_name)); + } + else if (atomic_image_vars_emulated.count(var.self)) + { + // Emulate texture2D atomic operations. + // Don't set the qualified name: it's already set for this variable, + // and the code that references the buffer manually appends "_atomic" + // to the name. + uint32_t offset = ir.increase_bound_by(2); + uint32_t atomic_type_id = offset; + uint32_t type_ptr_id = offset + 1; + + SPIRType atomic_type { OpTypeInt }; + atomic_type.basetype = SPIRType::AtomicCounter; + atomic_type.width = 32; + atomic_type.vecsize = 1; + set(atomic_type_id, atomic_type); + + atomic_type.op = OpTypePointer; + atomic_type.pointer = true; + atomic_type.pointer_depth++; + atomic_type.parent_type = atomic_type_id; + atomic_type.storage = StorageClassStorageBuffer; + auto &atomic_ptr_type = set(type_ptr_id, atomic_type); + atomic_ptr_type.self = atomic_type_id; + + buffer_type.member_types.push_back(type_ptr_id); + } + else + { + buffer_type.member_types.push_back(var.basetype); + if (has_extended_decoration(var.self, SPIRVCrossDecorationOverlappingBinding)) + { + // Casting raw pointers is fine since their ABI is fixed, but anything opaque is deeply questionable on Metal 2. + if (get(resource.overlapping_var_id).storage == StorageClassUniformConstant && + !msl_options.supports_msl_version(3, 0)) + { + SPIRV_CROSS_THROW("Full mutable aliasing of argument buffer descriptors only works on Metal 3+."); + } + + auto &entry_func = get(ir.default_entry_point); + + entry_func.fixup_hooks_in.push_back([this, resource]() { + emit_argument_buffer_aliased_descriptor(*resource.var, this->get(resource.overlapping_var_id)); + }); + } + else if (type.array.empty()) + set_qualified_name(var.self, join("(*", to_name(buffer_variable_id), ".", mbr_name, ")")); + else + set_qualified_name(var.self, join(to_name(buffer_variable_id), ".", mbr_name)); + } + } + + set_extended_member_decoration(buffer_type.self, member_index, SPIRVCrossDecorationResourceIndexPrimary, + resource.index); + set_extended_member_decoration(buffer_type.self, member_index, SPIRVCrossDecorationInterfaceOrigID, + var.self); + if (has_extended_decoration(var.self, SPIRVCrossDecorationOverlappingBinding)) + set_extended_member_decoration(buffer_type.self, member_index, SPIRVCrossDecorationOverlappingBinding); + member_index++; + } + + if (msl_options.replace_recursive_inputs && type_contains_recursion(buffer_type)) + { + recursive_inputs.insert(type_id); + auto &entry_func = this->get(ir.default_entry_point); + auto addr_space = get_variable_address_space(buffer_var); + entry_func.fixup_hooks_in.push_back([this, addr_space, buffer_name, buffer_type_name]() { + statement(addr_space, " auto& ", buffer_name, " = *(", addr_space, " ", buffer_type_name, "*)", buffer_name, "_vp;"); + }); + } + } +} + +// Return the resource type of the app-provided resources for the descriptor set, +// that matches the resource index of the argument buffer index. +// This is a two-step lookup, first lookup the resource binding number from the argument buffer index, +// then lookup the resource binding using the binding number. +const MSLResourceBinding &CompilerMSL::get_argument_buffer_resource(uint32_t desc_set, uint32_t arg_idx) const +{ + auto stage = get_entry_point().model; + StageSetBinding arg_idx_tuple = { stage, desc_set, arg_idx }; + auto arg_itr = resource_arg_buff_idx_to_binding_number.find(arg_idx_tuple); + if (arg_itr != end(resource_arg_buff_idx_to_binding_number)) + { + StageSetBinding bind_tuple = { stage, desc_set, arg_itr->second }; + auto bind_itr = resource_bindings.find(bind_tuple); + if (bind_itr != end(resource_bindings)) + return bind_itr->second.first; + } + SPIRV_CROSS_THROW("Argument buffer resource base type could not be determined. When padding argument buffer " + "elements, all descriptor set resources must be supplied with a base type by the app."); +} + +// Adds an argument buffer padding argument buffer type as one or more members of the struct type at the member index. +// Metal does not support arrays of buffers, so these are emitted as multiple struct members. +void CompilerMSL::add_argument_buffer_padding_buffer_type(SPIRType &struct_type, uint32_t &mbr_idx, + uint32_t &arg_buff_index, MSLResourceBinding &rez_bind) +{ + if (!argument_buffer_padding_buffer_type_id) + { + uint32_t buff_type_id = ir.increase_bound_by(2); + auto &buff_type = set(buff_type_id, OpNop); + buff_type.basetype = rez_bind.basetype; + buff_type.storage = StorageClassUniformConstant; + + uint32_t ptr_type_id = buff_type_id + 1; + auto &ptr_type = set(ptr_type_id, OpTypePointer); + ptr_type = buff_type; + ptr_type.op = OpTypePointer; + ptr_type.pointer = true; + ptr_type.pointer_depth++; + ptr_type.parent_type = buff_type_id; + + argument_buffer_padding_buffer_type_id = ptr_type_id; + } + + add_argument_buffer_padding_type(argument_buffer_padding_buffer_type_id, struct_type, mbr_idx, arg_buff_index, rez_bind.count); +} + +// Adds an argument buffer padding argument image type as a member of the struct type at the member index. +void CompilerMSL::add_argument_buffer_padding_image_type(SPIRType &struct_type, uint32_t &mbr_idx, + uint32_t &arg_buff_index, MSLResourceBinding &rez_bind) +{ + if (!argument_buffer_padding_image_type_id) + { + uint32_t base_type_id = ir.increase_bound_by(2); + auto &base_type = set(base_type_id, OpTypeFloat); + base_type.basetype = SPIRType::Float; + base_type.width = 32; + + uint32_t img_type_id = base_type_id + 1; + auto &img_type = set(img_type_id, OpTypeImage); + img_type.basetype = SPIRType::Image; + img_type.storage = StorageClassUniformConstant; + + img_type.image.type = base_type_id; + img_type.image.dim = Dim2D; + img_type.image.depth = false; + img_type.image.arrayed = false; + img_type.image.ms = false; + img_type.image.sampled = 1; + img_type.image.format = ImageFormatUnknown; + img_type.image.access = AccessQualifierMax; + + argument_buffer_padding_image_type_id = img_type_id; + } + + add_argument_buffer_padding_type(argument_buffer_padding_image_type_id, struct_type, mbr_idx, arg_buff_index, rez_bind.count); +} + +// Adds an argument buffer padding argument sampler type as a member of the struct type at the member index. +void CompilerMSL::add_argument_buffer_padding_sampler_type(SPIRType &struct_type, uint32_t &mbr_idx, + uint32_t &arg_buff_index, MSLResourceBinding &rez_bind) +{ + if (!argument_buffer_padding_sampler_type_id) + { + uint32_t samp_type_id = ir.increase_bound_by(1); + auto &samp_type = set(samp_type_id, OpTypeSampler); + samp_type.basetype = SPIRType::Sampler; + samp_type.storage = StorageClassUniformConstant; + + argument_buffer_padding_sampler_type_id = samp_type_id; + } + + add_argument_buffer_padding_type(argument_buffer_padding_sampler_type_id, struct_type, mbr_idx, arg_buff_index, rez_bind.count); +} + +// Adds the argument buffer padding argument type as a member of the struct type at the member index. +// Advances both arg_buff_index and mbr_idx to next argument slots. +void CompilerMSL::add_argument_buffer_padding_type(uint32_t mbr_type_id, SPIRType &struct_type, uint32_t &mbr_idx, + uint32_t &arg_buff_index, uint32_t count) +{ + uint32_t type_id = mbr_type_id; + if (count > 1) + { + uint32_t ary_type_id = ir.increase_bound_by(1); + auto &ary_type = set(ary_type_id, get(type_id)); + ary_type.op = OpTypeArray; + ary_type.array.push_back(count); + ary_type.array_size_literal.push_back(true); + ary_type.parent_type = type_id; + type_id = ary_type_id; + } + + set_member_name(struct_type.self, mbr_idx, join("_m", arg_buff_index, "_pad")); + set_extended_member_decoration(struct_type.self, mbr_idx, SPIRVCrossDecorationResourceIndexPrimary, arg_buff_index); + struct_type.member_types.push_back(type_id); + + arg_buff_index += count; + mbr_idx++; +} + +void CompilerMSL::activate_argument_buffer_resources() +{ + // For ABI compatibility, force-enable all resources which are part of argument buffers. + ir.for_each_typed_id([&](uint32_t self, const SPIRVariable &) { + if (!has_decoration(self, DecorationDescriptorSet)) + return; + + uint32_t desc_set = get_decoration(self, DecorationDescriptorSet); + if (descriptor_set_is_argument_buffer(desc_set)) + add_active_interface_variable(self); + }); +} + +bool CompilerMSL::using_builtin_array() const +{ + return msl_options.force_native_arrays || is_using_builtin_array; +} + +void CompilerMSL::set_combined_sampler_suffix(const char *suffix) +{ + sampler_name_suffix = suffix; +} + +const char *CompilerMSL::get_combined_sampler_suffix() const +{ + return sampler_name_suffix.c_str(); +} + +bool CompilerMSL::specialization_constant_is_macro(uint32_t const_id) const +{ + return constant_macro_ids.find(const_id) != constant_macro_ids.end(); +} + +// Start with all fast math flags enabled, and selectively disable based execution modes and float controls +uint32_t CompilerMSL::get_fp_fast_math_flags(bool incl_ops) const +{ + uint32_t fp_flags = ~0; + auto &ep = get_entry_point(); + + if (ep.flags.get(ExecutionModeSignedZeroInfNanPreserve)) + fp_flags &= ~(FPFastMathModeNSZMask | FPFastMathModeNotInfMask | FPFastMathModeNotNaNMask); + + if (ep.flags.get(ExecutionModeContractionOff)) + fp_flags &= ~(FPFastMathModeAllowContractMask); + + for (auto &fp_pair : ep.fp_fast_math_defaults) + if (fp_pair.second) + fp_flags &= get(fp_pair.second).scalar(); + + if (incl_ops) + for (auto &p_m : ir.meta) + if (p_m.second.decoration.decoration_flags.get(DecorationFPFastMathMode)) + fp_flags &= p_m.second.decoration.fp_fast_math_mode; + + return fp_flags; +} + +void CompilerMSL::emit_block_hints(const SPIRBlock &) +{ +} + +void CompilerMSL::emit_mesh_entry_point() +{ + auto &ep = get_entry_point(); + auto &f = get(ir.default_entry_point); + + const uint32_t func_id = ir.increase_bound_by(3); + const uint32_t block_id = func_id + 1; + const uint32_t ret_id = func_id + 2; + auto &wrapped_main = set(func_id, f.return_type, f.function_type); + + wrapped_main.blocks.push_back(block_id); + wrapped_main.entry_block = block_id; + + auto &wrapped_entry = set(block_id); + wrapped_entry.terminator = SPIRBlock::Return; + + // Push call to original 'main' + Instruction ix = {}; + ix.op = OpFunctionCall; + ix.offset = uint32_t(ir.spirv.size()); + ix.length = 3; + + ir.spirv.push_back(f.return_type); + ir.spirv.push_back(ret_id); + ir.spirv.push_back(ep.self); + + wrapped_entry.ops.push_back(ix); + + // relace entry-point for new one + SPIREntryPoint proxy_ep = ep; + proxy_ep.self = func_id; + ir.entry_points.insert(std::make_pair(func_id, proxy_ep)); + ir.meta[func_id] = ir.meta[ir.default_entry_point]; + ir.meta[ir.default_entry_point].decoration.alias.clear(); + + ir.default_entry_point = func_id; +} + +void CompilerMSL::emit_mesh_outputs() +{ + auto &mode = get_entry_point(); + + // predefined thread count or zero, if specialization constant is in use + uint32_t num_invocations = 0; + if (mode.workgroup_size.id_x == 0 && mode.workgroup_size.id_y == 0 && mode.workgroup_size.id_z == 0) + num_invocations = mode.workgroup_size.x * mode.workgroup_size.y * mode.workgroup_size.z; + + statement("threadgroup_barrier(mem_flags::mem_threadgroup);"); + statement("if (spvMeshSizes.y == 0)"); + begin_scope(); + statement("return;"); + end_scope(); + statement("spvMesh.set_primitive_count(spvMeshSizes.y);"); + + statement("const uint spvThreadCount [[maybe_unused]] = (gl_WorkGroupSize.x * gl_WorkGroupSize.y * gl_WorkGroupSize.z);"); + + if (mesh_out_per_vertex != 0) + { + auto &type_vert = get(mesh_out_per_vertex); + + if (num_invocations < mode.output_vertices) + { + statement("for (uint spvVI = gl_LocalInvocationIndex; spvVI < spvMeshSizes.x; spvVI += spvThreadCount)"); + } + else + { + statement("const uint spvVI = gl_LocalInvocationIndex;"); + statement("if (gl_LocalInvocationIndex < spvMeshSizes.x)"); + } + + begin_scope(); + + statement("spvPerVertex spvV = {};"); + for (uint32_t index = 0; index < uint32_t(type_vert.member_types.size()); ++index) + { + uint32_t orig_var = get_extended_member_decoration(type_vert.self, index, SPIRVCrossDecorationInterfaceOrigID); + uint32_t orig_id = get_extended_member_decoration(type_vert.self, index, SPIRVCrossDecorationInterfaceMemberIndex); + + // Clip/cull distances are special-case + if (orig_var == 0 && orig_id == (~0u)) + continue; + + auto &orig = get(orig_var); + auto &orig_type = get(orig.basetype); + + // FIXME: Need to deal with complex composite IO types. These may need extra unroll, etc. + + BuiltIn builtin = BuiltInMax; + std::string access; + if (orig_type.basetype == SPIRType::Struct) + { + if (has_member_decoration(orig_type.self, orig_id, DecorationBuiltIn)) + builtin = BuiltIn(get_member_decoration(orig_type.self, orig_id, DecorationBuiltIn)); + + switch (builtin) + { + case BuiltInPosition: + case BuiltInPointSize: + case BuiltInClipDistance: + case BuiltInCullDistance: + access = "." + builtin_to_glsl(builtin, StorageClassOutput); + break; + default: + access = "." + to_member_name(orig_type, orig_id); + break; + } + + if (has_member_decoration(type_vert.self, index, DecorationIndex)) + { + // Declare the Clip/CullDistance as [[user(clip/cullN)]]. + const uint32_t orig_index = get_member_decoration(type_vert.self, index, DecorationIndex); + access += "[" + to_string(orig_index) + "]"; + statement("spvV.", builtin_to_glsl(builtin, StorageClassOutput), "[", orig_index, "] = ", to_name(orig_var), "[spvVI]", access, ";"); + } + } + + statement("spvV.", to_member_name(type_vert, index), " = ", to_name(orig_var), "[spvVI]", access, ";"); + if (options.vertex.flip_vert_y && builtin == BuiltInPosition) + { + statement("spvV.", to_member_name(type_vert, index), ".y = -(", "spvV.", + to_member_name(type_vert, index), ".y);", " // Invert Y-axis for Metal"); + } + } + statement("spvMesh.set_vertex(spvVI, spvV);"); + end_scope(); + } + + if (mesh_out_per_primitive != 0 || builtin_mesh_primitive_indices_id != 0) + { + if (num_invocations < mode.output_primitives) + { + statement("for (uint spvPI = gl_LocalInvocationIndex; spvPI < spvMeshSizes.y; spvPI += spvThreadCount)"); + } + else + { + statement("const uint spvPI = gl_LocalInvocationIndex;"); + statement("if (gl_LocalInvocationIndex < spvMeshSizes.y)"); + } + + // FIXME: Need to deal with complex composite IO types. These may need extra unroll, etc. + + begin_scope(); + + if (builtin_mesh_primitive_indices_id != 0) + { + if (mode.flags.get(ExecutionModeOutputTrianglesEXT)) + { + statement("spvMesh.set_index(spvPI * 3u + 0u, gl_PrimitiveTriangleIndicesEXT[spvPI].x);"); + statement("spvMesh.set_index(spvPI * 3u + 1u, gl_PrimitiveTriangleIndicesEXT[spvPI].y);"); + statement("spvMesh.set_index(spvPI * 3u + 2u, gl_PrimitiveTriangleIndicesEXT[spvPI].z);"); + } + else if (mode.flags.get(ExecutionModeOutputLinesEXT)) + { + statement("spvMesh.set_index(spvPI * 2u + 0u, gl_PrimitiveLineIndicesEXT[spvPI].x);"); + statement("spvMesh.set_index(spvPI * 2u + 1u, gl_PrimitiveLineIndicesEXT[spvPI].y);"); + } + else + { + statement("spvMesh.set_index(spvPI, gl_PrimitivePointIndicesEXT[spvPI]);"); + } + } + + if (mesh_out_per_primitive != 0) + { + auto &type_prim = get(mesh_out_per_primitive); + statement("spvPerPrimitive spvP = {};"); + for (uint32_t index = 0; index < uint32_t(type_prim.member_types.size()); ++index) + { + uint32_t orig_var = + get_extended_member_decoration(type_prim.self, index, SPIRVCrossDecorationInterfaceOrigID); + uint32_t orig_id = + get_extended_member_decoration(type_prim.self, index, SPIRVCrossDecorationInterfaceMemberIndex); + auto &orig = get(orig_var); + auto &orig_type = get(orig.basetype); + + BuiltIn builtin = BuiltInMax; + std::string access; + if (orig_type.basetype == SPIRType::Struct) + { + if (has_member_decoration(orig_type.self, orig_id, DecorationBuiltIn)) + builtin = BuiltIn(get_member_decoration(orig_type.self, orig_id, DecorationBuiltIn)); + + switch (builtin) + { + case BuiltInPrimitiveId: + case BuiltInLayer: + case BuiltInViewportIndex: + case BuiltInCullPrimitiveEXT: + case BuiltInPrimitiveShadingRateKHR: + access = "." + builtin_to_glsl(builtin, StorageClassOutput); + break; + default: + access = "." + to_member_name(orig_type, orig_id); + } + } + statement("spvP.", to_member_name(type_prim, index), " = ", to_name(orig_var), "[spvPI]", access, ";"); + } + statement("spvMesh.set_primitive(spvPI, spvP);"); + } + + end_scope(); + } +} + +void CompilerMSL::emit_mesh_tasks(SPIRBlock &block) +{ + // GLSL: Once this instruction is called, the workgroup must be terminated immediately, and the mesh shaders are launched. + // TODO: find relieble and clean of terminating shader. + flush_variable_declaration(builtin_task_grid_id); + statement("spvMgp.set_threadgroups_per_grid(uint3(", to_unpacked_expression(block.mesh.groups[0]), ", ", + to_unpacked_expression(block.mesh.groups[1]), ", ", to_unpacked_expression(block.mesh.groups[2]), "));"); + // This is correct if EmitMeshTasks is called in the entry function for shader. + // Only viable solutions would be: + // - Caller ensures the SPIR-V is inlined, then this always holds true. + // - Pass down a "should terminate" bool to leaf functions and chain return (horrible and disgusting, let's not). + statement("return;"); +} + +void CompilerMSL::emit_workgroup_initialization(const SPIRVariable &var) +{ + auto &type = get_variable_data_type(var); + + begin_scope(); + + if (type.array.empty() && type.member_types.empty()) + { + // For simple shared variables, we just initialize it in thread 0 of the block + // We use short to represent bool for threadgroup variable to workaround compiler bug, + // so we do a temporary fixup here. Alas. (see the type_to_glsl method) + bool is_boolean = type.basetype == SPIRType::Boolean; + if (is_boolean) + type.basetype = SPIRType::Short; + + statement("if (gl_LocalInvocationIndex == 0)"); + begin_scope(); + statement(to_name(var.self), " = ", to_initializer_expression(var), ";"); + end_scope(); + + if (is_boolean) + type.basetype = SPIRType::Boolean; + } + else + { + // Otherwise, we use a loop to cooperatively initialize the memory within the group + + // First, we define a few variable names; + string var_name = to_name(var.self); + string var_ptr_name = join(var_name, "_ptr"); + string var_size_name = join(var_name, "_sz"); + string var_pos_name = join(var_name, "_pos"); + string var_stride_name = join(var_name, "_stride"); + string var_ptr2_name = join(var_name, "_ptr2"); + + statement("threadgroup uint *", var_ptr_name, " = (threadgroup uint *)&", var_name, ";"); + statement("uint ", var_size_name, " = ", "sizeof(", var_name, ");"); + statement("uint ", var_pos_name, " = gl_LocalInvocationIndex;"); + statement("uint ", var_stride_name, " = gl_WorkGroupSize.x * gl_WorkGroupSize.y * gl_WorkGroupSize.z;"); + + statement("while (sizeof(uint) * ", var_pos_name, " < ", var_size_name, ")"); + begin_scope(); + statement(var_ptr_name, "[", var_pos_name, "] = 0u;"); + statement(var_pos_name, " += ", var_stride_name, ";"); + end_scope(); + + statement("if (gl_LocalInvocationIndex == 0)"); + begin_scope(); + statement(var_pos_name, " = (", var_size_name, " / sizeof(uint)) * sizeof(uint);"); + statement("threadgroup uchar *", var_ptr2_name, " = (threadgroup uchar *)&", var_name, ";"); + + statement("while (", var_pos_name, " < ", var_size_name, ")"); + begin_scope(); + statement(var_ptr2_name, "[", var_pos_name, "] = '\\0';"); + statement(var_pos_name, "++;"); + end_scope(); + end_scope(); + } + + statement("threadgroup_barrier(mem_flags::mem_threadgroup);"); + + end_scope(); +} + +string CompilerMSL::additional_fixed_sample_mask_str() const +{ + char print_buffer[32]; +#ifdef _MSC_VER + // snprintf does not exist or is buggy on older MSVC versions, some of + // them being used by MinGW. Use sprintf instead and disable + // corresponding warning. +#pragma warning(push) +#pragma warning(disable : 4996) +#endif +#if _WIN32 + sprintf(print_buffer, "0x%x", msl_options.additional_fixed_sample_mask); +#else + snprintf(print_buffer, sizeof(print_buffer), "0x%x", msl_options.additional_fixed_sample_mask); +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + return print_buffer; +} diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_msl.hpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_msl.hpp new file mode 100644 index 0000000000..033cb903bf --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_msl.hpp @@ -0,0 +1,1440 @@ +/* + * Copyright 2016-2021 The Brenwill Workshop Ltd. + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#ifndef SPIRV_CROSS_MSL_HPP +#define SPIRV_CROSS_MSL_HPP + +#include "spirv_glsl.hpp" +#include +#include +#include +#include +#include + +namespace SPIRV_CROSS_NAMESPACE +{ +using namespace SPIRV_CROSS_SPV_HEADER_NAMESPACE; + +// Indicates the format of a shader interface variable. Currently limited to specifying +// if the input is an 8-bit unsigned integer, 16-bit unsigned integer, or +// some other format. +enum MSLShaderVariableFormat +{ + MSL_SHADER_VARIABLE_FORMAT_OTHER = 0, + MSL_SHADER_VARIABLE_FORMAT_UINT8 = 1, + MSL_SHADER_VARIABLE_FORMAT_UINT16 = 2, + MSL_SHADER_VARIABLE_FORMAT_ANY16 = 3, + MSL_SHADER_VARIABLE_FORMAT_ANY32 = 4, + + // Deprecated aliases. + MSL_VERTEX_FORMAT_OTHER = MSL_SHADER_VARIABLE_FORMAT_OTHER, + MSL_VERTEX_FORMAT_UINT8 = MSL_SHADER_VARIABLE_FORMAT_UINT8, + MSL_VERTEX_FORMAT_UINT16 = MSL_SHADER_VARIABLE_FORMAT_UINT16, + MSL_SHADER_INPUT_FORMAT_OTHER = MSL_SHADER_VARIABLE_FORMAT_OTHER, + MSL_SHADER_INPUT_FORMAT_UINT8 = MSL_SHADER_VARIABLE_FORMAT_UINT8, + MSL_SHADER_INPUT_FORMAT_UINT16 = MSL_SHADER_VARIABLE_FORMAT_UINT16, + MSL_SHADER_INPUT_FORMAT_ANY16 = MSL_SHADER_VARIABLE_FORMAT_ANY16, + MSL_SHADER_INPUT_FORMAT_ANY32 = MSL_SHADER_VARIABLE_FORMAT_ANY32, + + MSL_SHADER_VARIABLE_FORMAT_INT_MAX = 0x7fffffff +}; + +// Indicates the rate at which a variable changes value, one of: per-vertex, +// per-primitive, or per-patch. +enum MSLShaderVariableRate +{ + MSL_SHADER_VARIABLE_RATE_PER_VERTEX = 0, + MSL_SHADER_VARIABLE_RATE_PER_PRIMITIVE = 1, + MSL_SHADER_VARIABLE_RATE_PER_PATCH = 2, + + MSL_SHADER_VARIABLE_RATE_INT_MAX = 0x7fffffff, +}; + +// Defines MSL characteristics of a shader interface variable at a particular location. +// After compilation, it is possible to query whether or not this location was used. +// If vecsize is nonzero, it must be greater than or equal to the vecsize declared in the shader, +// or behavior is undefined. +struct MSLShaderInterfaceVariable +{ + uint32_t location = 0; + uint32_t component = 0; + MSLShaderVariableFormat format = MSL_SHADER_VARIABLE_FORMAT_OTHER; + BuiltIn builtin = BuiltInMax; + uint32_t vecsize = 0; + MSLShaderVariableRate rate = MSL_SHADER_VARIABLE_RATE_PER_VERTEX; +}; + +// Matches the binding index of a MSL resource for a binding within a descriptor set. +// Taken together, the stage, desc_set and binding combine to form a reference to a resource +// descriptor used in a particular shading stage. The count field indicates the number of +// resources consumed by this binding, if the binding represents an array of resources. +// If the resource array is a run-time-sized array, which are legal in GLSL or SPIR-V, this value +// will be used to declare the array size in MSL, which does not support run-time-sized arrays. +// If pad_argument_buffer_resources is enabled, the base_type and count values are used to +// specify the base type and array size of the resource in the argument buffer, if that resource +// is not defined and used by the shader. With pad_argument_buffer_resources enabled, this +// information will be used to pad the argument buffer structure, in order to align that +// structure consistently for all uses, across all shaders, of the descriptor set represented +// by the arugment buffer. If pad_argument_buffer_resources is disabled, base_type does not +// need to be populated, and if the resource is also not a run-time sized array, the count +// field does not need to be populated. +// If using MSL 2.0 argument buffers, the descriptor set is not marked as a discrete descriptor set, +// and (for iOS only) the resource is not a storage image (sampled != 2), the binding reference we +// remap to will become an [[id(N)]] attribute within the "descriptor set" argument buffer structure. +// For resources which are bound in the "classic" MSL 1.0 way or discrete descriptors, the remap will +// become a [[buffer(N)]], [[texture(N)]] or [[sampler(N)]] depending on the resource types used. +struct MSLResourceBinding +{ + ExecutionModel stage = ExecutionModelMax; + SPIRType::BaseType basetype = SPIRType::Unknown; + uint32_t desc_set = 0; + uint32_t binding = 0; + uint32_t count = 0; + uint32_t msl_buffer = 0; + uint32_t msl_texture = 0; + uint32_t msl_sampler = 0; +}; + +enum MSLSamplerCoord +{ + MSL_SAMPLER_COORD_NORMALIZED = 0, + MSL_SAMPLER_COORD_PIXEL = 1, + MSL_SAMPLER_INT_MAX = 0x7fffffff +}; + +enum MSLSamplerFilter +{ + MSL_SAMPLER_FILTER_NEAREST = 0, + MSL_SAMPLER_FILTER_LINEAR = 1, + MSL_SAMPLER_FILTER_INT_MAX = 0x7fffffff +}; + +enum MSLSamplerMipFilter +{ + MSL_SAMPLER_MIP_FILTER_NONE = 0, + MSL_SAMPLER_MIP_FILTER_NEAREST = 1, + MSL_SAMPLER_MIP_FILTER_LINEAR = 2, + MSL_SAMPLER_MIP_FILTER_INT_MAX = 0x7fffffff +}; + +enum MSLSamplerAddress +{ + MSL_SAMPLER_ADDRESS_CLAMP_TO_ZERO = 0, + MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE = 1, + MSL_SAMPLER_ADDRESS_CLAMP_TO_BORDER = 2, + MSL_SAMPLER_ADDRESS_REPEAT = 3, + MSL_SAMPLER_ADDRESS_MIRRORED_REPEAT = 4, + MSL_SAMPLER_ADDRESS_INT_MAX = 0x7fffffff +}; + +enum MSLSamplerCompareFunc +{ + MSL_SAMPLER_COMPARE_FUNC_NEVER = 0, + MSL_SAMPLER_COMPARE_FUNC_LESS = 1, + MSL_SAMPLER_COMPARE_FUNC_LESS_EQUAL = 2, + MSL_SAMPLER_COMPARE_FUNC_GREATER = 3, + MSL_SAMPLER_COMPARE_FUNC_GREATER_EQUAL = 4, + MSL_SAMPLER_COMPARE_FUNC_EQUAL = 5, + MSL_SAMPLER_COMPARE_FUNC_NOT_EQUAL = 6, + MSL_SAMPLER_COMPARE_FUNC_ALWAYS = 7, + MSL_SAMPLER_COMPARE_FUNC_INT_MAX = 0x7fffffff +}; + +enum MSLSamplerBorderColor +{ + MSL_SAMPLER_BORDER_COLOR_TRANSPARENT_BLACK = 0, + MSL_SAMPLER_BORDER_COLOR_OPAQUE_BLACK = 1, + MSL_SAMPLER_BORDER_COLOR_OPAQUE_WHITE = 2, + MSL_SAMPLER_BORDER_COLOR_INT_MAX = 0x7fffffff +}; + +enum MSLFormatResolution +{ + MSL_FORMAT_RESOLUTION_444 = 0, + MSL_FORMAT_RESOLUTION_422, + MSL_FORMAT_RESOLUTION_420, + MSL_FORMAT_RESOLUTION_INT_MAX = 0x7fffffff +}; + +enum MSLChromaLocation +{ + MSL_CHROMA_LOCATION_COSITED_EVEN = 0, + MSL_CHROMA_LOCATION_MIDPOINT, + MSL_CHROMA_LOCATION_INT_MAX = 0x7fffffff +}; + +enum MSLComponentSwizzle +{ + MSL_COMPONENT_SWIZZLE_IDENTITY = 0, + MSL_COMPONENT_SWIZZLE_ZERO, + MSL_COMPONENT_SWIZZLE_ONE, + MSL_COMPONENT_SWIZZLE_R, + MSL_COMPONENT_SWIZZLE_G, + MSL_COMPONENT_SWIZZLE_B, + MSL_COMPONENT_SWIZZLE_A, + MSL_COMPONENT_SWIZZLE_INT_MAX = 0x7fffffff +}; + +enum MSLSamplerYCbCrModelConversion +{ + MSL_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY = 0, + MSL_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY, + MSL_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_BT_709, + MSL_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_BT_601, + MSL_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_BT_2020, + MSL_SAMPLER_YCBCR_MODEL_CONVERSION_INT_MAX = 0x7fffffff +}; + +enum MSLSamplerYCbCrRange +{ + MSL_SAMPLER_YCBCR_RANGE_ITU_FULL = 0, + MSL_SAMPLER_YCBCR_RANGE_ITU_NARROW, + MSL_SAMPLER_YCBCR_RANGE_INT_MAX = 0x7fffffff +}; + +struct MSLConstexprSampler +{ + MSLSamplerCoord coord = MSL_SAMPLER_COORD_NORMALIZED; + MSLSamplerFilter min_filter = MSL_SAMPLER_FILTER_NEAREST; + MSLSamplerFilter mag_filter = MSL_SAMPLER_FILTER_NEAREST; + MSLSamplerMipFilter mip_filter = MSL_SAMPLER_MIP_FILTER_NONE; + MSLSamplerAddress s_address = MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE; + MSLSamplerAddress t_address = MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE; + MSLSamplerAddress r_address = MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE; + MSLSamplerCompareFunc compare_func = MSL_SAMPLER_COMPARE_FUNC_NEVER; + MSLSamplerBorderColor border_color = MSL_SAMPLER_BORDER_COLOR_TRANSPARENT_BLACK; + float lod_clamp_min = 0.0f; + float lod_clamp_max = 1000.0f; + int max_anisotropy = 1; + + // Sampler Y'CbCr conversion parameters + uint32_t planes = 0; + MSLFormatResolution resolution = MSL_FORMAT_RESOLUTION_444; + MSLSamplerFilter chroma_filter = MSL_SAMPLER_FILTER_NEAREST; + MSLChromaLocation x_chroma_offset = MSL_CHROMA_LOCATION_COSITED_EVEN; + MSLChromaLocation y_chroma_offset = MSL_CHROMA_LOCATION_COSITED_EVEN; + MSLComponentSwizzle swizzle[4]; // IDENTITY, IDENTITY, IDENTITY, IDENTITY + MSLSamplerYCbCrModelConversion ycbcr_model = MSL_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY; + MSLSamplerYCbCrRange ycbcr_range = MSL_SAMPLER_YCBCR_RANGE_ITU_FULL; + uint32_t bpc = 8; + + bool compare_enable = false; + bool lod_clamp_enable = false; + bool anisotropy_enable = false; + bool ycbcr_conversion_enable = false; + + MSLConstexprSampler() + { + for (uint32_t i = 0; i < 4; i++) + swizzle[i] = MSL_COMPONENT_SWIZZLE_IDENTITY; + } + bool swizzle_is_identity() const + { + return (swizzle[0] == MSL_COMPONENT_SWIZZLE_IDENTITY && swizzle[1] == MSL_COMPONENT_SWIZZLE_IDENTITY && + swizzle[2] == MSL_COMPONENT_SWIZZLE_IDENTITY && swizzle[3] == MSL_COMPONENT_SWIZZLE_IDENTITY); + } + bool swizzle_has_one_or_zero() const + { + return (swizzle[0] == MSL_COMPONENT_SWIZZLE_ZERO || swizzle[0] == MSL_COMPONENT_SWIZZLE_ONE || + swizzle[1] == MSL_COMPONENT_SWIZZLE_ZERO || swizzle[1] == MSL_COMPONENT_SWIZZLE_ONE || + swizzle[2] == MSL_COMPONENT_SWIZZLE_ZERO || swizzle[2] == MSL_COMPONENT_SWIZZLE_ONE || + swizzle[3] == MSL_COMPONENT_SWIZZLE_ZERO || swizzle[3] == MSL_COMPONENT_SWIZZLE_ONE); + } +}; + +// Special constant used in a MSLResourceBinding desc_set +// element to indicate the bindings for the push constants. +// Kinda deprecated. Just use ResourceBindingPushConstant{DescriptorSet,Binding} directly. +static const uint32_t kPushConstDescSet = ResourceBindingPushConstantDescriptorSet; + +// Special constant used in a MSLResourceBinding binding +// element to indicate the bindings for the push constants. +// Kinda deprecated. Just use ResourceBindingPushConstant{DescriptorSet,Binding} directly. +static const uint32_t kPushConstBinding = ResourceBindingPushConstantBinding; + +// Special constant used in a MSLResourceBinding binding +// element to indicate the buffer binding for swizzle buffers. +static const uint32_t kSwizzleBufferBinding = ~(1u); + +// Special constant used in a MSLResourceBinding binding +// element to indicate the buffer binding for buffer size buffers to support OpArrayLength. +static const uint32_t kBufferSizeBufferBinding = ~(2u); + +// Special constant used in a MSLResourceBinding binding +// element to indicate the buffer binding used for the argument buffer itself. +// This buffer binding should be kept as small as possible as all automatic bindings for buffers +// will start at max(kArgumentBufferBinding) + 1. +static const uint32_t kArgumentBufferBinding = ~(3u); + +static const uint32_t kMaxArgumentBuffers = 8; + +// Decompiles SPIR-V to Metal Shading Language +class CompilerMSL : public CompilerGLSL +{ +public: + // Options for compiling to Metal Shading Language + struct Options + { + typedef enum + { + iOS = 0, + macOS = 1 + } Platform; + + Platform platform = macOS; + uint32_t msl_version = make_msl_version(1, 2); + uint32_t texel_buffer_texture_width = 4096; // Width of 2D Metal textures used as 1D texel buffers + uint32_t r32ui_linear_texture_alignment = 4; + uint32_t r32ui_alignment_constant_id = 65535; + uint32_t swizzle_buffer_index = 30; + uint32_t indirect_params_buffer_index = 29; + uint32_t shader_output_buffer_index = 28; + uint32_t shader_patch_output_buffer_index = 27; + uint32_t shader_tess_factor_buffer_index = 26; + uint32_t buffer_size_buffer_index = 25; + uint32_t view_mask_buffer_index = 24; + uint32_t dynamic_offsets_buffer_index = 23; + uint32_t shader_input_buffer_index = 22; + uint32_t shader_index_buffer_index = 21; + uint32_t shader_patch_input_buffer_index = 20; + uint32_t shader_input_wg_index = 0; + uint32_t device_index = 0; + uint32_t enable_frag_output_mask = 0xffffffff; + // Metal doesn't allow setting a fixed sample mask directly in the pipeline. + // We can evade this restriction by ANDing the internal sample_mask output + // of the shader with the additional fixed sample mask. + uint32_t additional_fixed_sample_mask = 0xffffffff; + bool enable_point_size_builtin = true; + bool enable_point_size_default = false; + float default_point_size = 1.0f; + bool enable_frag_depth_builtin = true; + bool enable_frag_stencil_ref_builtin = true; + bool disable_rasterization = false; + bool capture_output_to_buffer = false; + bool swizzle_texture_samples = false; + bool tess_domain_origin_lower_left = false; + bool multiview = false; + bool multiview_layered_rendering = true; + bool view_index_from_device_index = false; + bool dispatch_base = false; + bool texture_1D_as_2D = false; + + // Enable use of Metal argument buffers. + // MSL 2.0 must also be enabled. + bool argument_buffers = false; + + // Defines Metal argument buffer tier levels. + // Uses same values as Metal MTLArgumentBuffersTier enumeration. + enum class ArgumentBuffersTier + { + Tier1 = 0, + Tier2 = 1, + }; + + // When using Metal argument buffers, indicates the Metal argument buffer tier level supported by the Metal platform. + // Ignored when Options::argument_buffers is disabled. + // - Tier1 supports writable images on macOS, but not on iOS. + // - Tier2 supports writable images on macOS and iOS, and higher resource count limits. + // Tier capabilities based on recommendations from Apple engineering. + ArgumentBuffersTier argument_buffers_tier = ArgumentBuffersTier::Tier1; + + // Enables specifick argument buffer format with extra information to track SSBO-length + bool runtime_array_rich_descriptor = false; + + // Ensures vertex and instance indices start at zero. This reflects the behavior of HLSL with SV_VertexID and SV_InstanceID. + bool enable_base_index_zero = false; + + // Fragment output in MSL must have at least as many components as the render pass. + // Add support to explicit pad out components. + bool pad_fragment_output_components = false; + + // Specifies whether the iOS target version supports the [[base_vertex]] and [[base_instance]] attributes. + bool ios_support_base_vertex_instance = false; + + // Use Metal's native frame-buffer fetch API for subpass inputs. + bool use_framebuffer_fetch_subpasses = false; + + // Enables use of "fma" intrinsic for invariant float math + bool invariant_float_math = false; + + // Emulate texturecube_array with texture2d_array for iOS where this type is not available + bool emulate_cube_array = false; + + // Allow user to enable decoration binding + bool enable_decoration_binding = false; + + // Requires MSL 2.1, use the native support for texel buffers. + bool texture_buffer_native = false; + + // Forces all resources which are part of an argument buffer to be considered active. + // This ensures ABI compatibility between shaders where some resources might be unused, + // and would otherwise declare a different IAB. + bool force_active_argument_buffer_resources = false; + + // Aligns each resource in an argument buffer to its assigned index value, id(N), + // by adding synthetic padding members in the argument buffer struct for any resources + // in the argument buffer that are not defined and used by the shader. This allows + // the shader to index into the correct argument in a descriptor set argument buffer + // that is shared across shaders, where not all resources in the argument buffer are + // defined in each shader. For this to work, an MSLResourceBinding must be provided for + // all descriptors in any descriptor set held in an argument buffer in the shader, and + // that MSLResourceBinding must have the basetype and count members populated correctly. + // The implementation here assumes any inline blocks in the argument buffer is provided + // in a Metal buffer, and doesn't take into consideration inline blocks that are + // optionally embedded directly into the argument buffer via add_inline_uniform_block(). + bool pad_argument_buffer_resources = false; + + // Forces the use of plain arrays, which works around certain driver bugs on certain versions + // of Intel Macbooks. See https://github.com/KhronosGroup/SPIRV-Cross/issues/1210. + // May reduce performance in scenarios where arrays are copied around as value-types. + bool force_native_arrays = false; + + // If a shader writes clip distance, also emit user varyings which + // can be read in subsequent stages. + bool enable_clip_distance_user_varying = true; + + // In a tessellation control shader, assume that more than one patch can be processed in a + // single workgroup. This requires changes to the way the InvocationId and PrimitiveId + // builtins are processed, but should result in more efficient usage of the GPU. + bool multi_patch_workgroup = false; + + // Use storage buffers instead of vertex-style attributes for tessellation evaluation + // input. This may require conversion of inputs in the generated post-tessellation + // vertex shader, but allows the use of nested arrays. + bool raw_buffer_tese_input = false; + + // If set, a vertex shader will be compiled as part of a tessellation pipeline. + // It will be translated as a compute kernel, so it can use the global invocation ID + // to index the output buffer. + bool vertex_for_tessellation = false; + + // Assume that SubpassData images have multiple layers. Layered input attachments + // are addressed relative to the Layer output from the vertex pipeline. This option + // has no effect with multiview, since all input attachments are assumed to be layered + // and will be addressed using the current ViewIndex. + bool arrayed_subpass_input = false; + + // Whether to use SIMD-group or quadgroup functions to implement group non-uniform + // operations. Some GPUs on iOS do not support the SIMD-group functions, only the + // quadgroup functions. + bool ios_use_simdgroup_functions = false; + + // If set, the subgroup size will be assumed to be one, and subgroup-related + // builtins and operations will be emitted accordingly. This mode is intended to + // be used by MoltenVK on hardware/software configurations which do not provide + // sufficient support for subgroups. + bool emulate_subgroups = false; + + // If nonzero, a fixed subgroup size to assume. Metal, similarly to VK_EXT_subgroup_size_control, + // allows the SIMD-group size (aka thread execution width) to vary depending on + // register usage and requirements. In certain circumstances--for example, a pipeline + // in MoltenVK without VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT-- + // this is undesirable. This fixes the value of the SubgroupSize builtin, instead of + // mapping it to the Metal builtin [[thread_execution_width]]. If the thread + // execution width is reduced, the extra invocations will appear to be inactive. + // If zero, the SubgroupSize will be allowed to vary, and the builtin will be mapped + // to the Metal [[thread_execution_width]] builtin. + uint32_t fixed_subgroup_size = 0; + + enum class IndexType + { + None = 0, + UInt16 = 1, + UInt32 = 2 + }; + + // The type of index in the index buffer, if present. For a compute shader, Metal + // requires specifying the indexing at pipeline creation, rather than at draw time + // as with graphics pipelines. This means we must create three different pipelines, + // for no indexing, 16-bit indices, and 32-bit indices. Each requires different + // handling for the gl_VertexIndex builtin. We may as well, then, create three + // different shaders for these three scenarios. + IndexType vertex_index_type = IndexType::None; + + // If set, a dummy [[sample_id]] input is added to a fragment shader if none is present. + // This will force the shader to run at sample rate, assuming Metal does not optimize + // the extra threads away. + bool force_sample_rate_shading = false; + + // If set, gl_HelperInvocation will be set manually whenever a fragment is discarded. + // Some Metal devices have a bug where simd_is_helper_thread() does not return true + // after a fragment has been discarded. This is a workaround that is only expected to be needed + // until the bug is fixed in Metal; it is provided as an option to allow disabling it when that occurs. + bool manual_helper_invocation_updates = true; + + // If set, extra checks will be emitted in fragment shaders to prevent writes + // from discarded fragments. Some Metal devices have a bug where writes to storage resources + // from discarded fragment threads continue to occur, despite the fragment being + // discarded. This is a workaround that is only expected to be needed until the + // bug is fixed in Metal; it is provided as an option so it can be enabled + // only when the bug is present. + bool check_discarded_frag_stores = false; + + // If set, Lod operands to OpImageSample*DrefExplicitLod for 1D and 2D array images + // will be implemented using a gradient instead of passing the level operand directly. + // Some Metal devices have a bug where the level() argument to depth2d_array::sample_compare() + // in a fragment shader is biased by some unknown amount, possibly dependent on the + // partial derivatives of the texture coordinates. This is a workaround that is only + // expected to be needed until the bug is fixed in Metal; it is provided as an option + // so it can be enabled only when the bug is present. + bool sample_dref_lod_array_as_grad = false; + + // MSL doesn't guarantee coherence between writes and subsequent reads of read_write textures. + // This inserts fences before each read of a read_write texture to ensure coherency. + // If you're sure you never rely on this, you can set this to false for a possible performance improvement. + // Note: Only Apple's GPU compiler takes advantage of the lack of coherency, so make sure to test on Apple GPUs if you disable this. + bool readwrite_texture_fences = true; + + // Metal 3.1 introduced a Metal regression bug which causes infinite recursion during + // Metal's analysis of an entry point input structure that is itself recursive. Enabling + // this option will replace the recursive input declaration with a alternate variable of + // type void*, and then cast to the correct type at the top of the entry point function. + // The bug has been reported to Apple, and will hopefully be fixed in future releases. + bool replace_recursive_inputs = false; + + // If set, manual fixups of gradient vectors for cube texture lookups will be performed. + // All released Apple Silicon GPUs to date behave incorrectly when sampling a cube texture + // with explicit gradients. They will ignore one of the three partial derivatives based + // on the selected major axis, and expect the remaining derivatives to be partially + // transformed. + bool agx_manual_cube_grad_fixup = false; + + // Metal will discard fragments with side effects under certain circumstances prematurely. + // Example: CTS test dEQP-VK.fragment_operations.early_fragment.discard_no_early_fragment_tests_depth + // Test will render a full screen quad with varying depth [0,1] for each fragment. + // Each fragment will do an operation with side effects, modify the depth value and + // discard the fragment. The test expects the fragment to be run due to: + // https://registry.khronos.org/vulkan/specs/1.0-extensions/html/vkspec.html#fragops-shader-depthreplacement + // which states that the fragment shader must be run due to replacing the depth in shader. + // However, Metal may prematurely discards fragments without executing them + // (I believe this to be due to a greedy optimization on their end) making the test fail. + // This option enforces fragment execution for such cases where the fragment has operations + // with side effects. Provided as an option hoping Metal will fix this issue in the future. + bool force_fragment_with_side_effects_execution = false; + + // If set, adds a depth pass through statement to circumvent the following issue: + // When the same depth/stencil is used as input and depth/stencil attachment, we need to + // force Metal to perform the depth/stencil write after fragment execution. Otherwise, + // Metal will write to the depth attachment before fragment execution. This happens + // if the fragment does not modify the depth value. + bool input_attachment_is_ds_attachment = false; + + // If BuiltInPosition is not written, automatically disable rasterization. + // The result can be queried with get_is_rasterization_disabled. + bool auto_disable_rasterization = false; + + // Use Fast Math pragmas in MSL code, based on SPIR-V float controls and FP ExecutionModes. + // Requires MSL 3.2 or above, and has no effect with earlier MSL versions. + bool use_fast_math_pragmas = false; + + bool is_ios() const + { + return platform == iOS; + } + + bool is_macos() const + { + return platform == macOS; + } + + bool use_quadgroup_operation() const + { + return is_ios() && !ios_use_simdgroup_functions; + } + + void set_msl_version(uint32_t major, uint32_t minor = 0, uint32_t patch = 0) + { + msl_version = make_msl_version(major, minor, patch); + } + + bool supports_msl_version(uint32_t major, uint32_t minor = 0, uint32_t patch = 0) const + { + return msl_version >= make_msl_version(major, minor, patch); + } + + static uint32_t make_msl_version(uint32_t major, uint32_t minor = 0, uint32_t patch = 0) + { + return (major * 10000) + (minor * 100) + patch; + } + }; + + const Options &get_msl_options() const + { + return msl_options; + } + + void set_msl_options(const Options &opts) + { + msl_options = opts; + } + + // Provide feedback to calling API to allow runtime to disable pipeline + // rasterization if vertex shader requires rasterization to be disabled. + bool get_is_rasterization_disabled() const + { + return is_rasterization_disabled && (get_entry_point().model == ExecutionModelVertex || + get_entry_point().model == ExecutionModelTessellationControl || + get_entry_point().model == ExecutionModelTessellationEvaluation); + } + + // Provide feedback to calling API to allow it to pass an auxiliary + // swizzle buffer if the shader needs it. + bool needs_swizzle_buffer() const + { + return used_swizzle_buffer; + } + + // Provide feedback to calling API to allow it to pass a buffer + // containing STORAGE_BUFFER buffer sizes to support OpArrayLength. + bool needs_buffer_size_buffer() const + { + return !buffers_requiring_array_length.empty(); + } + + bool buffer_requires_array_length(VariableID id) const + { + return buffers_requiring_array_length.count(id) != 0; + } + + // Provide feedback to calling API to allow it to pass a buffer + // containing the view mask for the current multiview subpass. + bool needs_view_mask_buffer() const + { + return msl_options.multiview && !msl_options.view_index_from_device_index; + } + + // Provide feedback to calling API to allow it to pass a buffer + // containing the dispatch base workgroup ID. + bool needs_dispatch_base_buffer() const + { + return msl_options.dispatch_base && !msl_options.supports_msl_version(1, 2); + } + + // Provide feedback to calling API to allow it to pass an output + // buffer if the shader needs it. + bool needs_output_buffer() const + { + return capture_output_to_buffer && stage_out_var_id != ID(0); + } + + // Provide feedback to calling API to allow it to pass a patch output + // buffer if the shader needs it. + bool needs_patch_output_buffer() const + { + return capture_output_to_buffer && patch_stage_out_var_id != ID(0); + } + + // Provide feedback to calling API to allow it to pass an input threadgroup + // buffer if the shader needs it. + bool needs_input_threadgroup_mem() const + { + return capture_output_to_buffer && stage_in_var_id != ID(0); + } + + explicit CompilerMSL(std::vector spirv); + CompilerMSL(const uint32_t *ir, size_t word_count); + explicit CompilerMSL(const ParsedIR &ir); + explicit CompilerMSL(ParsedIR &&ir); + + // input is a shader interface variable description used to fix up shader input variables. + // If shader inputs are provided, is_msl_shader_input_used() will return true after + // calling ::compile() if the location were used by the MSL code. + void add_msl_shader_input(const MSLShaderInterfaceVariable &input); + + // output is a shader interface variable description used to fix up shader output variables. + // If shader outputs are provided, is_msl_shader_output_used() will return true after + // calling ::compile() if the location were used by the MSL code. + void add_msl_shader_output(const MSLShaderInterfaceVariable &output); + + // resource is a resource binding to indicate the MSL buffer, + // texture or sampler index to use for a particular SPIR-V description set + // and binding. If resource bindings are provided, + // is_msl_resource_binding_used() will return true after calling ::compile() if + // the set/binding combination was used by the MSL code. + void add_msl_resource_binding(const MSLResourceBinding &resource); + + // desc_set and binding are the SPIR-V descriptor set and binding of a buffer resource + // in this shader. index is the index within the dynamic offset buffer to use. This + // function marks that resource as using a dynamic offset (VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC + // or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC). This function only has any effect if argument buffers + // are enabled. If so, the buffer will have its address adjusted at the beginning of the shader with + // an offset taken from the dynamic offset buffer. + void add_dynamic_buffer(uint32_t desc_set, uint32_t binding, uint32_t index); + + // desc_set and binding are the SPIR-V descriptor set and binding of a buffer resource + // in this shader. This function marks that resource as an inline uniform block + // (VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT). This function only has any effect if argument buffers + // are enabled. If so, the buffer block will be directly embedded into the argument + // buffer, instead of being referenced indirectly via pointer. + void add_inline_uniform_block(uint32_t desc_set, uint32_t binding); + + // When using MSL argument buffers, we can force "classic" MSL 1.0 binding schemes for certain descriptor sets. + // This corresponds to VK_KHR_push_descriptor in Vulkan. + void add_discrete_descriptor_set(uint32_t desc_set); + + // If an argument buffer is large enough, it may need to be in the device storage space rather than + // constant. Opt-in to this behavior here on a per set basis. + void set_argument_buffer_device_address_space(uint32_t desc_set, bool device_storage); + + // Query after compilation is done. This allows you to check if an input location was used by the shader. + bool is_msl_shader_input_used(uint32_t location); + + // Query after compilation is done. This allows you to check if an output location were used by the shader. + bool is_msl_shader_output_used(uint32_t location); + + // If not using add_msl_shader_input, it's possible + // that certain builtin attributes need to be automatically assigned locations. + // This is typical for tessellation builtin inputs such as tess levels, gl_Position, etc. + // This returns k_unknown_location if the location was explicitly assigned with + // add_msl_shader_input or the builtin is not used, otherwise returns N in [[attribute(N)]]. + uint32_t get_automatic_builtin_input_location(BuiltIn builtin) const; + + // If not using add_msl_shader_output, it's possible + // that certain builtin attributes need to be automatically assigned locations. + // This is typical for tessellation builtin outputs such as tess levels, gl_Position, etc. + // This returns k_unknown_location if the location were explicitly assigned with + // add_msl_shader_output or the builtin were not used, otherwise returns N in [[attribute(N)]]. + uint32_t get_automatic_builtin_output_location(BuiltIn builtin) const; + + // NOTE: Only resources which are remapped using add_msl_resource_binding will be reported here. + // Constexpr samplers are always assumed to be emitted. + // No specific MSLResourceBinding remapping is required for constexpr samplers as long as they are remapped + // by remap_constexpr_sampler(_by_binding). + bool is_msl_resource_binding_used(ExecutionModel model, uint32_t set, uint32_t binding) const; + + // This must only be called after a successful call to CompilerMSL::compile(). + // For a variable resource ID obtained through reflection API, report the automatically assigned resource index. + // If the descriptor set was part of an argument buffer, report the [[id(N)]], + // or [[buffer/texture/sampler]] binding for other resources. + // If the resource was a combined image sampler, report the image binding here, + // use the _secondary version of this call to query the sampler half of the resource. + // If no binding exists, uint32_t(-1) is returned. + uint32_t get_automatic_msl_resource_binding(uint32_t id) const; + + // Same as get_automatic_msl_resource_binding, but should only be used for combined image samplers, in which case the + // sampler's binding is returned instead. For any other resource type, -1 is returned. + // Secondary bindings are also used for the auxillary image atomic buffer. + uint32_t get_automatic_msl_resource_binding_secondary(uint32_t id) const; + + // Same as get_automatic_msl_resource_binding, but should only be used for combined image samplers for multiplanar images, + // in which case the second plane's binding is returned instead. For any other resource type, -1 is returned. + uint32_t get_automatic_msl_resource_binding_tertiary(uint32_t id) const; + + // Same as get_automatic_msl_resource_binding, but should only be used for combined image samplers for triplanar images, + // in which case the third plane's binding is returned instead. For any other resource type, -1 is returned. + uint32_t get_automatic_msl_resource_binding_quaternary(uint32_t id) const; + + // Compiles the SPIR-V code into Metal Shading Language. + std::string compile() override; + + // Remap a sampler with ID to a constexpr sampler. + // Older iOS targets must use constexpr samplers in certain cases (PCF), + // so a static sampler must be used. + // The sampler will not consume a binding, but be declared in the entry point as a constexpr sampler. + // This can be used on both combined image/samplers (sampler2D) or standalone samplers. + // The remapped sampler must not be an array of samplers. + // Prefer remap_constexpr_sampler_by_binding unless you're also doing reflection anyways. + void remap_constexpr_sampler(VariableID id, const MSLConstexprSampler &sampler); + + // Same as remap_constexpr_sampler, except you provide set/binding, rather than variable ID. + // Remaps based on ID take priority over set/binding remaps. + void remap_constexpr_sampler_by_binding(uint32_t desc_set, uint32_t binding, const MSLConstexprSampler &sampler); + + // If using CompilerMSL::Options::pad_fragment_output_components, override the number of components we expect + // to use for a particular location. The default is 4 if number of components is not overridden. + void set_fragment_output_components(uint32_t location, uint32_t components); + + void set_combined_sampler_suffix(const char *suffix); + const char *get_combined_sampler_suffix() const; + + // Information about specialization constants that are translated into MSL macros + // instead of using function constant + // These must only be called after a successful call to CompilerMSL::compile(). + bool specialization_constant_is_macro(uint32_t constant_id) const; + + // Returns a mask of SPIR-V FP Fast Math Mode flags, that represents the set of flags that can be applied + // across all floating-point types. Each FPFastMathDefault execution mode operation identifies the flags + // for one floating-point type, and the value returned here is a bitwise-AND combination across all types. + // If incl_ops is enabled, the FPFastMathMode of any SPIR-V operations are also included in the bitwise-AND + // to determine the minimal fast-math that applies to all default execution modes and all operations. + // The returned value is also affected by execution modes SignedZeroInfNanPreserve and ContractionOff. + uint32_t get_fp_fast_math_flags(bool incl_ops) const; + +protected: + // An enum of SPIR-V functions that are implemented in additional + // source code that is added to the shader if necessary. + enum SPVFuncImpl : uint8_t + { + SPVFuncImplNone, + SPVFuncImplMod, + SPVFuncImplSMod, + SPVFuncImplRadians, + SPVFuncImplDegrees, + SPVFuncImplFindILsb, + SPVFuncImplFindSMsb, + SPVFuncImplFindUMsb, + SPVFuncImplSSign, + SPVFuncImplArrayCopy, + SPVFuncImplArrayCopyMultidim, + SPVFuncImplArrayCopyExtendedSrc, + SPVFuncImplArrayCopyExtendedDst, + SPVFuncImplTexelBufferCoords, + SPVFuncImplImage2DAtomicCoords, // Emulate texture2D atomic operations + SPVFuncImplGradientCube, + SPVFuncImplFMul, + SPVFuncImplFAdd, + SPVFuncImplFSub, + SPVFuncImplQuantizeToF16, + SPVFuncImplCubemapTo2DArrayFace, + SPVFuncImplUnsafeArray, // Allow Metal to use the array template to make arrays a value type + SPVFuncImplStorageMatrix, // Allow threadgroup construction of matrices + SPVFuncImplInverse4x4, + SPVFuncImplInverse3x3, + SPVFuncImplInverse2x2, + // It is very important that this come before *Swizzle, to ensure it's emitted before them. + SPVFuncImplGetSwizzle, + SPVFuncImplTextureSwizzle, + SPVFuncImplGatherReturn, + SPVFuncImplGatherCompareReturn, + SPVFuncImplGatherSwizzle, + SPVFuncImplGatherCompareSwizzle, + SPVFuncImplGatherConstOffsets, + SPVFuncImplGatherCompareConstOffsets, + SPVFuncImplSubgroupBroadcast, + SPVFuncImplSubgroupBroadcastFirst, + SPVFuncImplSubgroupBallot, + SPVFuncImplSubgroupBallotBitExtract, + SPVFuncImplSubgroupBallotFindLSB, + SPVFuncImplSubgroupBallotFindMSB, + SPVFuncImplSubgroupBallotBitCount, + SPVFuncImplSubgroupAllEqual, + SPVFuncImplSubgroupShuffle, + SPVFuncImplSubgroupShuffleXor, + SPVFuncImplSubgroupShuffleUp, + SPVFuncImplSubgroupShuffleDown, + SPVFuncImplSubgroupRotate, + SPVFuncImplSubgroupClusteredAdd, + SPVFuncImplSubgroupClusteredFAdd = SPVFuncImplSubgroupClusteredAdd, + SPVFuncImplSubgroupClusteredIAdd = SPVFuncImplSubgroupClusteredAdd, + SPVFuncImplSubgroupClusteredMul, + SPVFuncImplSubgroupClusteredFMul = SPVFuncImplSubgroupClusteredMul, + SPVFuncImplSubgroupClusteredIMul = SPVFuncImplSubgroupClusteredMul, + SPVFuncImplSubgroupClusteredMin, + SPVFuncImplSubgroupClusteredFMin = SPVFuncImplSubgroupClusteredMin, + SPVFuncImplSubgroupClusteredSMin = SPVFuncImplSubgroupClusteredMin, + SPVFuncImplSubgroupClusteredUMin = SPVFuncImplSubgroupClusteredMin, + SPVFuncImplSubgroupClusteredMax, + SPVFuncImplSubgroupClusteredFMax = SPVFuncImplSubgroupClusteredMax, + SPVFuncImplSubgroupClusteredSMax = SPVFuncImplSubgroupClusteredMax, + SPVFuncImplSubgroupClusteredUMax = SPVFuncImplSubgroupClusteredMax, + SPVFuncImplSubgroupClusteredAnd, + SPVFuncImplSubgroupClusteredBitwiseAnd = SPVFuncImplSubgroupClusteredAnd, + SPVFuncImplSubgroupClusteredLogicalAnd = SPVFuncImplSubgroupClusteredAnd, + SPVFuncImplSubgroupClusteredOr, + SPVFuncImplSubgroupClusteredBitwiseOr = SPVFuncImplSubgroupClusteredOr, + SPVFuncImplSubgroupClusteredLogicalOr = SPVFuncImplSubgroupClusteredOr, + SPVFuncImplSubgroupClusteredXor, + SPVFuncImplSubgroupClusteredBitwiseXor = SPVFuncImplSubgroupClusteredXor, + SPVFuncImplSubgroupClusteredLogicalXor = SPVFuncImplSubgroupClusteredXor, + SPVFuncImplQuadBroadcast, + SPVFuncImplQuadSwap, + SPVFuncImplReflectScalar, + SPVFuncImplRefractScalar, + SPVFuncImplFaceForwardScalar, + SPVFuncImplChromaReconstructNearest2Plane, + SPVFuncImplChromaReconstructNearest3Plane, + SPVFuncImplChromaReconstructLinear422CositedEven2Plane, + SPVFuncImplChromaReconstructLinear422CositedEven3Plane, + SPVFuncImplChromaReconstructLinear422Midpoint2Plane, + SPVFuncImplChromaReconstructLinear422Midpoint3Plane, + SPVFuncImplChromaReconstructLinear420XCositedEvenYCositedEven2Plane, + SPVFuncImplChromaReconstructLinear420XCositedEvenYCositedEven3Plane, + SPVFuncImplChromaReconstructLinear420XMidpointYCositedEven2Plane, + SPVFuncImplChromaReconstructLinear420XMidpointYCositedEven3Plane, + SPVFuncImplChromaReconstructLinear420XCositedEvenYMidpoint2Plane, + SPVFuncImplChromaReconstructLinear420XCositedEvenYMidpoint3Plane, + SPVFuncImplChromaReconstructLinear420XMidpointYMidpoint2Plane, + SPVFuncImplChromaReconstructLinear420XMidpointYMidpoint3Plane, + SPVFuncImplExpandITUFullRange, + SPVFuncImplExpandITUNarrowRange, + SPVFuncImplConvertYCbCrBT709, + SPVFuncImplConvertYCbCrBT601, + SPVFuncImplConvertYCbCrBT2020, + SPVFuncImplDynamicImageSampler, + SPVFuncImplRayQueryIntersectionParams, + SPVFuncImplVariableDescriptor, + SPVFuncImplVariableSizedDescriptor, + SPVFuncImplVariableDescriptorArray, + SPVFuncImplPaddedStd140, + SPVFuncImplReduceAdd, + SPVFuncImplImageFence, + SPVFuncImplTextureCast, + SPVFuncImplMulExtended, + SPVFuncImplSetMeshOutputsEXT, + SPVFuncImplAssume, + }; + + // If the underlying resource has been used for comparison then duplicate loads of that resource must be too + // Use Metal's native frame-buffer fetch API for subpass inputs. + void emit_texture_op(const Instruction &i, bool sparse) override; + void emit_binary_ptr_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op); + std::string to_ptr_expression(uint32_t id, bool register_expression_read = true); + void emit_binary_unord_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op); + void emit_instruction(const Instruction &instr) override; + void emit_glsl_op(uint32_t result_type, uint32_t result_id, uint32_t op, const uint32_t *args, + uint32_t count) override; + void emit_spv_amd_shader_trinary_minmax_op(uint32_t result_type, uint32_t result_id, uint32_t op, + const uint32_t *args, uint32_t count) override; + void emit_header() override; + void emit_function_prototype(SPIRFunction &func, const Bitset &return_flags) override; + void emit_sampled_image_op(uint32_t result_type, uint32_t result_id, uint32_t image_id, uint32_t samp_id) override; + void emit_subgroup_op(const Instruction &i) override; + void emit_subgroup_cluster_op(uint32_t result_type, uint32_t result_id, uint32_t cluster_size, uint32_t op0, + const char *op); + void emit_subgroup_cluster_op_cast(uint32_t result_type, uint32_t result_id, uint32_t cluster_size, uint32_t op0, + const char *op, SPIRType::BaseType input_type, + SPIRType::BaseType expected_result_type); + std::string to_texture_op(const Instruction &i, bool sparse, bool *forward, + SmallVector &inherited_expressions) override; + void emit_fixup() override; + std::string to_struct_member(const SPIRType &type, uint32_t member_type_id, uint32_t index, + const std::string &qualifier = ""); + void emit_struct_member(const SPIRType &type, uint32_t member_type_id, uint32_t index, + const std::string &qualifier = "", uint32_t base_offset = 0) override; + void emit_struct_padding_target(const SPIRType &type) override; + std::string type_to_glsl(const SPIRType &type, uint32_t id, bool member); + std::string type_to_glsl(const SPIRType &type, uint32_t id = 0) override; + void emit_block_hints(const SPIRBlock &block) override; + void emit_mesh_entry_point(); + void emit_mesh_outputs(); + void emit_mesh_tasks(SPIRBlock &block) override; + void emit_workgroup_initialization(const SPIRVariable &var) override; + + // Allow Metal to use the array template to make arrays a value type + std::string type_to_array_glsl(const SPIRType &type, uint32_t variable_id) override; + std::string constant_op_expression(const SPIRConstantOp &cop) override; + + bool variable_decl_is_remapped_storage(const SPIRVariable &variable, StorageClass storage) const override; + + // GCC workaround of lambdas calling protected functions (for older GCC versions) + std::string variable_decl(const SPIRType &type, const std::string &name, uint32_t id = 0) override; + + std::string image_type_glsl(const SPIRType &type, uint32_t id, bool member) override; + std::string sampler_type(const SPIRType &type, uint32_t id, bool member); + std::string builtin_to_glsl(BuiltIn builtin, StorageClass storage) override; + std::string to_func_call_arg(const SPIRFunction::Parameter &arg, uint32_t id) override; + std::string to_name(uint32_t id, bool allow_alias = true) const override; + std::string to_function_name(const TextureFunctionNameArguments &args) override; + std::string to_function_args(const TextureFunctionArguments &args, bool *p_forward) override; + std::string to_initializer_expression(const SPIRVariable &var) override; + std::string to_zero_initialized_expression(uint32_t type_id) override; + + std::string unpack_expression_type(std::string expr_str, const SPIRType &type, uint32_t physical_type_id, + bool is_packed, bool row_major) override; + + // Returns true for BuiltInSampleMask because gl_SampleMask[] is an array in SPIR-V, but [[sample_mask]] is a scalar in Metal. + bool builtin_translates_to_nonarray(BuiltIn builtin) const override; + + std::string bitcast_glsl_op(const SPIRType &result_type, const SPIRType &argument_type) override; + bool emit_complex_bitcast(uint32_t result_id, uint32_t id, uint32_t op0) override; + bool skip_argument(uint32_t id) const override; + std::string to_member_reference(uint32_t base, const SPIRType &type, uint32_t index, bool ptr_chain_is_resolved) override; + std::string to_qualifiers_glsl(uint32_t id) override; + void replace_illegal_names() override; + void declare_constant_arrays(); + + void replace_illegal_entry_point_names(); + void sync_entry_point_aliases_and_names(); + + static const std::unordered_set &get_reserved_keyword_set(); + static const std::unordered_set &get_illegal_func_names(); + + // Constant arrays of non-primitive types (i.e. matrices) won't link properly into Metal libraries + void declare_complex_constant_arrays(); + + bool is_patch_block(const SPIRType &type); + bool is_non_native_row_major_matrix(uint32_t id) override; + bool member_is_non_native_row_major_matrix(const SPIRType &type, uint32_t index) override; + std::string convert_row_major_matrix(std::string exp_str, const SPIRType &exp_type, uint32_t physical_type_id, + bool is_packed, bool relaxed) override; + + bool is_tesc_shader() const; + bool is_tese_shader() const; + bool is_mesh_shader() const; + + void preprocess_op_codes(); + void localize_global_variables(); + void extract_global_variables_from_functions(); + void mark_packable_structs(); + void mark_as_packable(SPIRType &type); + void mark_as_workgroup_struct(SPIRType &type); + + std::unordered_map> function_global_vars; + void extract_global_variables_from_function(uint32_t func_id, std::set &added_arg_ids, + std::unordered_set &global_var_ids, + std::unordered_set &processed_func_ids); + uint32_t add_interface_block(StorageClass storage, bool patch = false); + uint32_t add_interface_block_pointer(uint32_t ib_var_id, StorageClass storage); + uint32_t add_meshlet_block(bool per_primitive); + + struct InterfaceBlockMeta + { + struct LocationMeta + { + uint32_t base_type_id = 0; + uint32_t num_components = 0; + bool flat = false; + bool noperspective = false; + bool centroid = false; + bool sample = false; + }; + std::unordered_map location_meta; + bool strip_array = false; + bool allow_local_declaration = false; + }; + + std::string to_tesc_invocation_id(); + void emit_local_masked_variable(const SPIRVariable &masked_var, bool strip_array); + void add_variable_to_interface_block(StorageClass storage, const std::string &ib_var_ref, SPIRType &ib_type, + SPIRVariable &var, InterfaceBlockMeta &meta); + void add_composite_variable_to_interface_block(StorageClass storage, const std::string &ib_var_ref, + SPIRType &ib_type, SPIRVariable &var, InterfaceBlockMeta &meta); + void add_plain_variable_to_interface_block(StorageClass storage, const std::string &ib_var_ref, + SPIRType &ib_type, SPIRVariable &var, InterfaceBlockMeta &meta); + bool add_component_variable_to_interface_block(StorageClass storage, const std::string &ib_var_ref, + SPIRVariable &var, const SPIRType &type, + InterfaceBlockMeta &meta); + void add_plain_member_variable_to_interface_block(StorageClass storage, + const std::string &ib_var_ref, SPIRType &ib_type, + SPIRVariable &var, SPIRType &var_type, + uint32_t mbr_idx, InterfaceBlockMeta &meta, + const std::string &mbr_name_qual, + const std::string &var_chain_qual, + uint32_t &location, uint32_t &var_mbr_idx); + void add_composite_member_variable_to_interface_block(StorageClass storage, + const std::string &ib_var_ref, SPIRType &ib_type, + SPIRVariable &var, SPIRType &var_type, + uint32_t mbr_idx, InterfaceBlockMeta &meta, + const std::string &mbr_name_qual, + const std::string &var_chain_qual, + uint32_t &location, uint32_t &var_mbr_idx, + const Bitset &interpolation_qual); + void add_tess_level_input_to_interface_block(const std::string &ib_var_ref, SPIRType &ib_type, SPIRVariable &var); + void add_tess_level_input(const std::string &base_ref, const std::string &mbr_name, SPIRVariable &var); + + void ensure_struct_members_valid_vecsizes(SPIRType &struct_type, uint32_t &location); + void fix_up_interface_member_indices(StorageClass storage, uint32_t ib_type_id); + + void mark_location_as_used_by_shader(uint32_t location, const SPIRType &type, + StorageClass storage, bool fallback = false); + uint32_t ensure_correct_builtin_type(uint32_t type_id, BuiltIn builtin); + uint32_t ensure_correct_input_type(uint32_t type_id, uint32_t location, uint32_t component, + uint32_t num_components, bool strip_array); + + void emit_custom_templates(); + void emit_custom_functions(); + void emit_resources(); + void emit_specialization_constants_and_structs(); + void emit_interface_block(uint32_t ib_var_id); + bool maybe_emit_array_assignment(uint32_t id_lhs, uint32_t id_rhs); + bool is_var_runtime_size_array(const SPIRVariable &var) const; + uint32_t get_resource_array_size(const SPIRType &type, uint32_t id) const; + + void fix_up_shader_inputs_outputs(); + + bool entry_point_is_vertex() const; + bool entry_point_returns_stage_output() const; + bool entry_point_requires_const_device_buffers() const; + std::string func_type_decl(SPIRType &type); + std::string entry_point_args_classic(bool append_comma); + std::string entry_point_args_argument_buffer(bool append_comma); + std::string entry_point_arg_stage_in(); + void entry_point_args_builtin(std::string &args); + void entry_point_args_discrete_descriptors(std::string &args); + std::string append_member_name(const std::string &qualifier, const SPIRType &type, uint32_t index); + std::string ensure_valid_name(std::string name, std::string pfx); + std::string to_sampler_expression(uint32_t id); + std::string to_swizzle_expression(uint32_t id); + std::string to_buffer_size_expression(uint32_t id); + bool is_sample_rate() const; + bool is_intersection_query() const; + bool is_direct_input_builtin(BuiltIn builtin); + std::string builtin_qualifier(BuiltIn builtin); + std::string builtin_type_decl(BuiltIn builtin, uint32_t id = 0); + std::string built_in_func_arg(BuiltIn builtin, bool prefix_comma); + std::string member_attribute_qualifier(const SPIRType &type, uint32_t index); + std::string member_location_attribute_qualifier(const SPIRType &type, uint32_t index); + std::string argument_decl(const SPIRFunction::Parameter &arg); + const char *descriptor_address_space(uint32_t id, StorageClass storage, const char *plain_address_space) const; + std::string round_fp_tex_coords(std::string tex_coords, bool coord_is_fp); + uint32_t get_metal_resource_index(SPIRVariable &var, SPIRType::BaseType basetype, uint32_t plane = 0); + uint32_t get_member_location(uint32_t type_id, uint32_t index, uint32_t *comp = nullptr) const; + uint32_t get_or_allocate_builtin_input_member_location(BuiltIn builtin, + uint32_t type_id, uint32_t index, uint32_t *comp = nullptr); + uint32_t get_or_allocate_builtin_output_member_location(BuiltIn builtin, + uint32_t type_id, uint32_t index, uint32_t *comp = nullptr); + + uint32_t get_physical_tess_level_array_size(BuiltIn builtin) const; + + uint32_t get_physical_type_stride(const SPIRType &type) const override; + + // MSL packing rules. These compute the effective packing rules as observed by the MSL compiler in the MSL output. + // These values can change depending on various extended decorations which control packing rules. + // We need to make these rules match up with SPIR-V declared rules. + uint32_t get_declared_type_size_msl(const SPIRType &type, bool packed, bool row_major) const; + uint32_t get_declared_type_array_stride_msl(const SPIRType &type, bool packed, bool row_major) const; + uint32_t get_declared_type_matrix_stride_msl(const SPIRType &type, bool packed, bool row_major) const; + uint32_t get_declared_type_alignment_msl(const SPIRType &type, bool packed, bool row_major) const; + + uint32_t get_declared_struct_member_size_msl(const SPIRType &struct_type, uint32_t index) const; + uint32_t get_declared_struct_member_array_stride_msl(const SPIRType &struct_type, uint32_t index) const; + uint32_t get_declared_struct_member_matrix_stride_msl(const SPIRType &struct_type, uint32_t index) const; + uint32_t get_declared_struct_member_alignment_msl(const SPIRType &struct_type, uint32_t index) const; + + uint32_t get_declared_input_size_msl(const SPIRType &struct_type, uint32_t index) const; + uint32_t get_declared_input_array_stride_msl(const SPIRType &struct_type, uint32_t index) const; + uint32_t get_declared_input_matrix_stride_msl(const SPIRType &struct_type, uint32_t index) const; + uint32_t get_declared_input_alignment_msl(const SPIRType &struct_type, uint32_t index) const; + + const SPIRType &get_physical_member_type(const SPIRType &struct_type, uint32_t index) const; + SPIRType get_presumed_input_type(const SPIRType &struct_type, uint32_t index) const; + + uint32_t get_declared_struct_size_msl(const SPIRType &struct_type, bool ignore_alignment = false, + bool ignore_padding = false) const; + + std::string to_component_argument(uint32_t id); + void align_struct(SPIRType &ib_type, std::unordered_set &aligned_structs); + void mark_scalar_layout_structs(const SPIRType &ib_type); + void mark_struct_members_packed(const SPIRType &type); + void ensure_member_packing_rules_msl(SPIRType &ib_type, uint32_t index); + bool validate_member_packing_rules_msl(const SPIRType &type, uint32_t index) const; + std::string get_variable_address_space(const SPIRVariable &argument); + // Special case of get_variable_address_space which is only used for leaf functions. + std::string get_leaf_argument_address_space(const SPIRVariable &argument); + std::string get_type_address_space(const SPIRType &type, uint32_t id, bool argument = false); + bool decoration_flags_signal_volatile(const Bitset &flags) const; + bool decoration_flags_signal_coherent(const Bitset &flags) const; + const char *to_restrict(uint32_t id, bool space); + SPIRType &get_stage_in_struct_type(); + SPIRType &get_stage_out_struct_type(); + SPIRType &get_patch_stage_in_struct_type(); + SPIRType &get_patch_stage_out_struct_type(); + std::string get_tess_factor_struct_name(); + SPIRType &get_uint_type(); + uint32_t get_uint_type_id(); + void emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, Op opcode, + uint32_t mem_order_1, uint32_t mem_order_2, bool has_mem_order_2, uint32_t op0, uint32_t op1 = 0, + bool op1_is_pointer = false, bool op1_is_literal = false, uint32_t op2 = 0); + const char *get_memory_order(uint32_t spv_mem_sem); + void add_pragma_line(const std::string &line, bool recompile_on_unique); + void add_typedef_line(const std::string &line); + void emit_barrier(uint32_t id_exe_scope, uint32_t id_mem_scope, uint32_t id_mem_sem); + bool emit_array_copy(const char *expr, uint32_t lhs_id, uint32_t rhs_id, + StorageClass lhs_storage, StorageClass rhs_storage) override; + void build_implicit_builtins(); + uint32_t build_constant_uint_array_pointer(); + void emit_entry_point_declarations() override; + bool uses_explicit_early_fragment_test(); + + uint32_t builtin_frag_coord_id = 0; + uint32_t builtin_sample_id_id = 0; + uint32_t builtin_sample_mask_id = 0; + uint32_t builtin_helper_invocation_id = 0; + uint32_t builtin_vertex_idx_id = 0; + uint32_t builtin_base_vertex_id = 0; + uint32_t builtin_instance_idx_id = 0; + uint32_t builtin_base_instance_id = 0; + uint32_t builtin_view_idx_id = 0; + uint32_t builtin_layer_id = 0; + uint32_t builtin_invocation_id_id = 0; + uint32_t builtin_primitive_id_id = 0; + uint32_t builtin_subgroup_invocation_id_id = 0; + uint32_t builtin_subgroup_size_id = 0; + uint32_t builtin_dispatch_base_id = 0; + uint32_t builtin_stage_input_size_id = 0; + uint32_t builtin_local_invocation_index_id = 0; + uint32_t builtin_workgroup_size_id = 0; + uint32_t builtin_mesh_primitive_indices_id = 0; + uint32_t builtin_mesh_sizes_id = 0; + uint32_t builtin_task_grid_id = 0; + uint32_t builtin_frag_depth_id = 0; + uint32_t swizzle_buffer_id = 0; + uint32_t buffer_size_buffer_id = 0; + uint32_t view_mask_buffer_id = 0; + uint32_t dynamic_offsets_buffer_id = 0; + uint32_t uint_type_id = 0; + uint32_t shared_uint_type_id = 0; + uint32_t meshlet_type_id = 0; + uint32_t argument_buffer_padding_buffer_type_id = 0; + uint32_t argument_buffer_padding_image_type_id = 0; + uint32_t argument_buffer_padding_sampler_type_id = 0; + + bool does_shader_write_sample_mask = false; + bool frag_shader_needs_discard_checks = false; + + void cast_to_variable_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type) override; + void cast_from_variable_load(uint32_t source_id, std::string &expr, const SPIRType &expr_type) override; + void emit_store_statement(uint32_t lhs_expression, uint32_t rhs_expression) override; + + void analyze_sampled_image_usage(); + void analyze_workgroup_variables(); + + bool access_chain_needs_stage_io_builtin_translation(uint32_t base) override; + bool prepare_access_chain_for_scalar_access(std::string &expr, const SPIRType &type, StorageClass storage, + bool &is_packed) override; + void fix_up_interpolant_access_chain(const uint32_t *ops, uint32_t length); + bool check_physical_type_cast(std::string &expr, const SPIRType *type, uint32_t physical_type) override; + + bool emit_tessellation_access_chain(const uint32_t *ops, uint32_t length); + bool emit_tessellation_io_load(uint32_t result_type, uint32_t id, uint32_t ptr); + bool is_out_of_bounds_tessellation_level(uint32_t id_lhs); + + void ensure_builtin(StorageClass storage, BuiltIn builtin); + + void mark_implicit_builtin(StorageClass storage, BuiltIn builtin, uint32_t id); + + std::string convert_to_f32(const std::string &expr, uint32_t components); + + Options msl_options; + std::set spv_function_implementations; + // Must be ordered to ensure declarations are in a specific order. + std::map inputs_by_location; + std::unordered_map inputs_by_builtin; + std::map outputs_by_location; + std::unordered_map outputs_by_builtin; + std::unordered_set location_inputs_in_use; + std::unordered_set location_inputs_in_use_fallback; + std::unordered_set location_outputs_in_use; + std::unordered_set location_outputs_in_use_fallback; + std::unordered_map fragment_output_components; + std::unordered_map builtin_to_automatic_input_location; + std::unordered_map builtin_to_automatic_output_location; + std::vector pragma_lines; + std::vector typedef_lines; + SmallVector vars_needing_early_declaration; + std::unordered_set constant_macro_ids; + + std::unordered_map, InternalHasher> resource_bindings; + std::unordered_map resource_arg_buff_idx_to_binding_number; + + uint32_t next_metal_resource_index_buffer = 0; + uint32_t next_metal_resource_index_texture = 0; + uint32_t next_metal_resource_index_sampler = 0; + // Intentionally uninitialized, works around MSVC 2013 bug. + uint32_t next_metal_resource_ids[kMaxArgumentBuffers]; + + VariableID stage_in_var_id = 0; + VariableID stage_out_var_id = 0; + VariableID patch_stage_in_var_id = 0; + VariableID patch_stage_out_var_id = 0; + VariableID stage_in_ptr_var_id = 0; + VariableID stage_out_ptr_var_id = 0; + VariableID tess_level_inner_var_id = 0; + VariableID tess_level_outer_var_id = 0; + VariableID mesh_out_per_vertex = 0; + VariableID mesh_out_per_primitive = 0; + VariableID stage_out_masked_builtin_type_id = 0; + + // Handle HLSL-style 0-based vertex/instance index. + enum class TriState + { + Neutral, + No, + Yes + }; + TriState needs_base_vertex_arg = TriState::Neutral; + TriState needs_base_instance_arg = TriState::Neutral; + + bool has_sampled_images = false; + bool builtin_declaration = false; // Handle HLSL-style 0-based vertex/instance index. + + bool is_using_builtin_array = false; // Force the use of C style array declaration. + bool using_builtin_array() const; + + bool is_rasterization_disabled = false; + bool has_descriptor_side_effects_buffer = false; + bool capture_output_to_buffer = false; + bool needs_swizzle_buffer_def = false; + bool used_swizzle_buffer = false; + bool added_builtin_tess_level = false; + bool needs_local_invocation_index = false; + bool needs_subgroup_invocation_id = false; + bool needs_subgroup_size = false; + bool needs_sample_id = false; + bool needs_helper_invocation = false; + bool needs_workgroup_zero_init = false; + bool needs_point_size_output = false; + bool writes_to_depth = false; + bool writes_to_point_size = false; + std::string qual_pos_var_name; + std::string stage_in_var_name = "in"; + std::string stage_out_var_name = "out"; + std::string patch_stage_in_var_name = "patchIn"; + std::string patch_stage_out_var_name = "patchOut"; + std::string sampler_name_suffix = "Smplr"; + std::string swizzle_name_suffix = "Swzl"; + std::string buffer_size_name_suffix = "BufferSize"; + std::string plane_name_suffix = "Plane"; + std::string input_wg_var_name = "gl_in"; + std::string input_buffer_var_name = "spvIn"; + std::string output_buffer_var_name = "spvOut"; + std::string patch_input_buffer_var_name = "spvPatchIn"; + std::string patch_output_buffer_var_name = "spvPatchOut"; + std::string tess_factor_buffer_var_name = "spvTessLevel"; + std::string index_buffer_var_name = "spvIndices"; + Op previous_instruction_opcode = OpNop; + + // Must be ordered since declaration is in a specific order. + std::map constexpr_samplers_by_id; + std::unordered_map constexpr_samplers_by_binding; + const MSLConstexprSampler *find_constexpr_sampler(uint32_t id) const; + + std::unordered_set buffers_requiring_array_length; + SmallVector buffer_aliases_discrete; + std::unordered_set atomic_image_vars_emulated; // Emulate texture2D atomic operations + std::unordered_set pull_model_inputs; + std::unordered_set recursive_inputs; + + SmallVector entry_point_bindings; + + // Must be ordered since array is in a specific order. + struct DynamicBuffer + { + uint32_t base_index; + uint32_t var_id; + std::string mbr_name; + }; + std::map buffers_requiring_dynamic_offset; + + SmallVector disabled_frag_outputs; + + std::unordered_set inline_uniform_blocks; + + uint32_t argument_buffer_ids[kMaxArgumentBuffers]; + uint32_t argument_buffer_discrete_mask = 0; + uint32_t argument_buffer_device_storage_mask = 0; + + void emit_argument_buffer_aliased_descriptor(const SPIRVariable &aliased_var, + const SPIRVariable &base_var); + + void analyze_argument_buffers(); + bool descriptor_set_is_argument_buffer(uint32_t desc_set) const; + const MSLResourceBinding &get_argument_buffer_resource(uint32_t desc_set, uint32_t arg_idx) const; + void add_argument_buffer_padding_buffer_type(SPIRType &struct_type, uint32_t &mbr_idx, uint32_t &arg_buff_index, MSLResourceBinding &rez_bind); + void add_argument_buffer_padding_image_type(SPIRType &struct_type, uint32_t &mbr_idx, uint32_t &arg_buff_index, MSLResourceBinding &rez_bind); + void add_argument_buffer_padding_sampler_type(SPIRType &struct_type, uint32_t &mbr_idx, uint32_t &arg_buff_index, MSLResourceBinding &rez_bind); + void add_argument_buffer_padding_type(uint32_t mbr_type_id, SPIRType &struct_type, uint32_t &mbr_idx, uint32_t &arg_buff_index, uint32_t count); + + uint32_t get_target_components_for_fragment_location(uint32_t location) const; + uint32_t build_extended_vector_type(uint32_t type_id, uint32_t components, + SPIRType::BaseType basetype = SPIRType::Unknown); + uint32_t build_msl_interpolant_type(uint32_t type_id, bool is_noperspective); + + bool suppress_missing_prototypes = false; + bool suppress_incompatible_pointer_types_discard_qualifiers = false; + bool suppress_sometimes_unitialized = false; + + void add_spv_func_and_recompile(SPVFuncImpl spv_func); + + void activate_argument_buffer_resources(); + + bool type_is_msl_framebuffer_fetch(const SPIRType &type) const; + bool is_supported_argument_buffer_type(const SPIRType &type) const; + + bool variable_storage_requires_stage_io(StorageClass storage) const; + + bool needs_manual_helper_invocation_updates() const + { + return msl_options.manual_helper_invocation_updates && msl_options.supports_msl_version(2, 3); + } + bool needs_frag_discard_checks() const + { + return get_execution_model() == ExecutionModelFragment && msl_options.supports_msl_version(2, 3) && + msl_options.check_discarded_frag_stores && frag_shader_needs_discard_checks; + } + + bool has_additional_fixed_sample_mask() const { return msl_options.additional_fixed_sample_mask != 0xffffffff; } + std::string additional_fixed_sample_mask_str() const; + + // OpcodeHandler that handles several MSL preprocessing operations. + struct OpCodePreprocessor : OpcodeHandler + { + explicit OpCodePreprocessor(CompilerMSL &compiler_) + : OpcodeHandler(compiler_), self(compiler_) + { + enable_result_types = true; + } + + bool handle(Op opcode, const uint32_t *args, uint32_t length) override; + CompilerMSL::SPVFuncImpl get_spv_func_impl(Op opcode, const uint32_t *args, uint32_t length); + void check_resource_write(uint32_t var_id); + + CompilerMSL &self; + std::unordered_map image_pointers_emulated; // Emulate texture2D atomic operations + bool suppress_missing_prototypes = false; + bool uses_atomics = false; + bool uses_image_write = false; + bool uses_buffer_write = false; + bool uses_discard = false; + bool needs_local_invocation_index = false; + bool needs_subgroup_invocation_id = false; + bool needs_subgroup_size = false; + bool needs_sample_id = false; + bool needs_helper_invocation = false; + }; + + // OpcodeHandler that scans for uses of sampled images + struct SampledImageScanner : OpcodeHandler + { + explicit SampledImageScanner(CompilerMSL &compiler_) + : OpcodeHandler(compiler_), self(compiler_) + { + } + + CompilerMSL &self; + bool handle(Op opcode, const uint32_t *args, uint32_t) override; + }; + + // Sorts the members of a SPIRType and associated Meta info based on a settable sorting + // aspect, which defines which aspect of the struct members will be used to sort them. + // Regardless of the sorting aspect, built-in members always appear at the end of the struct. + struct MemberSorter + { + enum SortAspect + { + LocationThenBuiltInType, + Offset + }; + + void sort(); + bool operator()(uint32_t mbr_idx1, uint32_t mbr_idx2); + MemberSorter(SPIRType &t, Meta &m, SortAspect sa); + + SPIRType &type; + Meta &meta; + SortAspect sort_aspect; + }; +}; +} // namespace SPIRV_CROSS_NAMESPACE + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_parser.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_parser.cpp new file mode 100644 index 0000000000..457ba4db7f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_parser.cpp @@ -0,0 +1,1550 @@ +/* + * Copyright 2018-2021 Arm Limited + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#include "spirv_parser.hpp" +#include "NonSemanticShaderDebugInfo100.h" +#include + +using namespace std; +using namespace SPIRV_CROSS_SPV_HEADER_NAMESPACE; + +namespace SPIRV_CROSS_NAMESPACE +{ +Parser::Parser(vector spirv) +{ + ir.spirv = std::move(spirv); +} + +Parser::Parser(const uint32_t *spirv_data, size_t word_count) +{ + ir.spirv = vector(spirv_data, spirv_data + word_count); +} + +static bool decoration_is_string(Decoration decoration) +{ + switch (decoration) + { + case DecorationUserSemantic: + return true; + + default: + return false; + } +} + +static inline uint32_t swap_endian(uint32_t v) +{ + return ((v >> 24) & 0x000000ffu) | ((v >> 8) & 0x0000ff00u) | ((v << 8) & 0x00ff0000u) | ((v << 24) & 0xff000000u); +} + +static bool is_valid_spirv_version(uint32_t version) +{ + switch (version) + { + // Allow v99 since it tends to just work. + case 99: + case 0x10000: // SPIR-V 1.0 + case 0x10100: // SPIR-V 1.1 + case 0x10200: // SPIR-V 1.2 + case 0x10300: // SPIR-V 1.3 + case 0x10400: // SPIR-V 1.4 + case 0x10500: // SPIR-V 1.5 + case 0x10600: // SPIR-V 1.6 + return true; + + default: + return false; + } +} + +void Parser::parse() +{ + auto &spirv = ir.spirv; + + auto len = spirv.size(); + if (len < 5) + SPIRV_CROSS_THROW("SPIRV file too small."); + + auto s = spirv.data(); + + // Endian-swap if we need to. + if (s[0] == swap_endian(MagicNumber)) + transform(begin(spirv), end(spirv), begin(spirv), [](uint32_t c) { return swap_endian(c); }); + + if (s[0] != MagicNumber || !is_valid_spirv_version(s[1])) + SPIRV_CROSS_THROW("Invalid SPIRV format."); + + uint32_t bound = s[3]; + + const uint32_t MaximumNumberOfIDs = 0x3fffff; + if (bound > MaximumNumberOfIDs) + SPIRV_CROSS_THROW("ID bound exceeds limit of 0x3fffff.\n"); + + ir.set_id_bounds(bound); + + uint32_t offset = 5; + + SmallVector instructions; + while (offset < len) + { + Instruction instr = {}; + instr.op = spirv[offset] & 0xffff; + instr.count = (spirv[offset] >> 16) & 0xffff; + + if (instr.count == 0) + SPIRV_CROSS_THROW("SPIR-V instructions cannot consume 0 words. Invalid SPIR-V file."); + + instr.offset = offset + 1; + instr.length = instr.count - 1; + + offset += instr.count; + + if (offset > spirv.size()) + SPIRV_CROSS_THROW("SPIR-V instruction goes out of bounds."); + + instructions.push_back(instr); + } + + for (auto &i : instructions) + parse(i); + + for (auto &fixup : forward_pointer_fixups) + { + auto &target = get(fixup.first); + auto &source = get(fixup.second); + target.member_types = source.member_types; + target.basetype = source.basetype; + target.self = source.self; + } + forward_pointer_fixups.clear(); + + for (auto &source : ir.sources) + { + auto cmp = [](const ParsedIR::Source::Marker &a, const ParsedIR::Source::Marker &b) { + return a.line < b.line; + }; + + std::sort(source.line_markers.begin(), source.line_markers.end(), cmp); + } + + if (current_function) + SPIRV_CROSS_THROW("Function was not terminated."); + if (current_block) + SPIRV_CROSS_THROW("Block was not terminated."); + if (ir.default_entry_point == 0) + SPIRV_CROSS_THROW("There is no entry point in the SPIR-V module."); +} + +const uint32_t *Parser::stream(const Instruction &instr) const +{ + // If we're not going to use any arguments, just return nullptr. + // We want to avoid case where we return an out of range pointer + // that trips debug assertions on some platforms. + if (!instr.length) + return nullptr; + + if (instr.offset + instr.length > ir.spirv.size()) + SPIRV_CROSS_THROW("Compiler::stream() out of range."); + return &ir.spirv[instr.offset]; +} + +static string extract_string(const vector &spirv, uint32_t offset) +{ + string ret; + for (uint32_t i = offset; i < spirv.size(); i++) + { + uint32_t w = spirv[i]; + + for (uint32_t j = 0; j < 4; j++, w >>= 8) + { + char c = w & 0xff; + if (c == '\0') + return ret; + ret += c; + } + } + + SPIRV_CROSS_THROW("String was not terminated before EOF"); +} + +void Parser::parse(const Instruction &instruction) +{ + auto *ops = stream(instruction); + auto op = static_cast(instruction.op); + uint32_t length = instruction.length; + + // HACK for glslang that might emit OpEmitMeshTasksEXT followed by return / branch. + // Instead of failing hard, just ignore it. + if (ignore_trailing_block_opcodes) + { + ignore_trailing_block_opcodes = false; + if (op == OpReturn || op == OpBranch || op == OpUnreachable) + return; + } + + switch (op) + { + case OpSourceContinued: + case OpSourceExtension: + case OpNop: + case OpModuleProcessed: + break; + + case OpString: + { + set(ops[0], extract_string(ir.spirv, instruction.offset + 1)); + break; + } + + case OpMemoryModel: + ir.addressing_model = static_cast(ops[0]); + ir.memory_model = static_cast(ops[1]); + break; + + case OpSource: + { + ir.sources.emplace_back(); + auto &source = ir.sources.back(); + source.lang = static_cast(ops[0]); + + switch (source.lang) + { + case SourceLanguageESSL: + source.es = true; + source.version = ops[1]; + source.known = true; + source.hlsl = false; + break; + + case SourceLanguageGLSL: + source.es = false; + source.version = ops[1]; + source.known = true; + source.hlsl = false; + break; + + case SourceLanguageHLSL: + // For purposes of cross-compiling, this is GLSL 450. + source.es = false; + source.version = 450; + source.known = true; + source.hlsl = true; + break; + + default: + source.known = false; + break; + } + + if (length >= 3) + source.file_id = ops[2]; + + if (length >= 4) + source.source = extract_string(ir.spirv, instruction.offset + 3); + + break; + } + + case OpUndef: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + set(id, result_type); + if (current_block) + current_block->ops.push_back(instruction); + break; + } + + case OpCapability: + { + uint32_t cap = ops[0]; + if (cap == CapabilityKernel) + SPIRV_CROSS_THROW("Kernel capability not supported."); + + ir.declared_capabilities.push_back(static_cast(ops[0])); + break; + } + + case OpExtension: + { + auto ext = extract_string(ir.spirv, instruction.offset); + ir.declared_extensions.push_back(std::move(ext)); + break; + } + + case OpExtInstImport: + { + uint32_t id = ops[0]; + + SPIRExtension::Extension spirv_ext = SPIRExtension::Unsupported; + + auto ext = extract_string(ir.spirv, instruction.offset + 1); + if (ext == "GLSL.std.450") + spirv_ext = SPIRExtension::GLSL; + else if (ext == "DebugInfo") + spirv_ext = SPIRExtension::SPV_debug_info; + else if (ext == "SPV_AMD_shader_ballot") + spirv_ext = SPIRExtension::SPV_AMD_shader_ballot; + else if (ext == "SPV_AMD_shader_explicit_vertex_parameter") + spirv_ext = SPIRExtension::SPV_AMD_shader_explicit_vertex_parameter; + else if (ext == "SPV_AMD_shader_trinary_minmax") + spirv_ext = SPIRExtension::SPV_AMD_shader_trinary_minmax; + else if (ext == "SPV_AMD_gcn_shader") + spirv_ext = SPIRExtension::SPV_AMD_gcn_shader; + else if (ext == "NonSemantic.DebugPrintf") + spirv_ext = SPIRExtension::NonSemanticDebugPrintf; + else if (ext == "NonSemantic.Shader.DebugInfo.100") + spirv_ext = SPIRExtension::NonSemanticShaderDebugInfo; + else if (ext.find("NonSemantic.") == 0) + spirv_ext = SPIRExtension::NonSemanticGeneric; + + set(id, spirv_ext); + // Other SPIR-V extensions which have ExtInstrs are currently not supported. + + break; + } + + case OpExtInst: + case OpExtInstWithForwardRefsKHR: + { + // The SPIR-V debug information extended instructions might come at global scope. + if (current_block) + { + current_block->ops.push_back(instruction); + if (length >= 2) + { + const auto *type = maybe_get(ops[0]); + if (type) + ir.load_type_width.insert({ ops[1], type->width }); + } + } + + if (op == OpExtInst && length > 4) + { + // Don't want to deal with ForwardRefs here. + auto &ext = get(ops[2]); + if (ext.ext == SPIRExtension::NonSemanticShaderDebugInfo) + { + const auto instr = ops[3]; + if (instr == NonSemanticShaderDebugInfo100DebugSource) + { + set(ops[1], get(ops[4]).str); + + ir.sources.emplace_back(); + auto &source = ir.sources.back(); + source.file_id = ops[4]; + source.define_id = ops[1]; + if (length >= 6) + source.source = ir.get(ops[5]).str; + } + else if (instr == NonSemanticShaderDebugInfo100DebugLine) + { + if (length < 9) + SPIRV_CROSS_THROW("Invalid arguments for ShaderDebugInfo100DebugLine"); + auto source_id = ops[4]; + auto line_start = ir.get(ops[5]).scalar_i32(); + auto col_start = ir.get(ops[7]).scalar_i32(); + + for (auto &source : ir.sources) + { + if (source.define_id != source_id) + continue; + + source.line_markers.emplace_back(); + auto &marker = source.line_markers.back(); + marker.line = line_start; + marker.col = col_start; + marker.offset = instruction.offset - 1; + marker.function_id = current_function ? current_function->self : ID(0); + marker.block_id = current_block ? current_block->self : ID(0); + break; + } + } + else if (instr == NonSemanticShaderDebugInfo100DebugLocalVariable) + { + if (length < 11) + SPIRV_CROSS_THROW("Invalid arguments for ShaderDebugInfo100DebugLocalVariable"); + auto &lvar = set(ops[1]); + lvar.name_id = ops[4]; + } + else if (instr == NonSemanticShaderDebugInfo100DebugDeclare) + { + if (length < 7) + SPIRV_CROSS_THROW("Invalid arguments for ShaderDebugInfo100DebugDeclare"); + auto &lvar = get(ops[4]); + auto &var = get(ops[5]); + var.debug_local_variables.push_back(lvar.self); + } + } + } + break; + } + + case OpEntryPoint: + { + auto itr = + ir.entry_points.insert(make_pair(ops[1], SPIREntryPoint(ops[1], static_cast(ops[0]), + extract_string(ir.spirv, instruction.offset + 2)))); + auto &e = itr.first->second; + + // Strings need nul-terminator and consume the whole word. + uint32_t strlen_words = uint32_t((e.name.size() + 1 + 3) >> 2); + + for (uint32_t i = strlen_words + 2; i < instruction.length; i++) + e.interface_variables.push_back(ops[i]); + + // Set the name of the entry point in case OpName is not provided later. + ir.set_name(ops[1], e.name); + + // If we don't have an entry, make the first one our "default". + if (!ir.default_entry_point) + ir.default_entry_point = ops[1]; + break; + } + + case OpExecutionMode: + { + auto &execution = ir.entry_points[ops[0]]; + auto mode = static_cast(ops[1]); + execution.flags.set(mode); + + switch (mode) + { + case ExecutionModeInvocations: + execution.invocations = ops[2]; + break; + + case ExecutionModeLocalSize: + execution.workgroup_size.x = ops[2]; + execution.workgroup_size.y = ops[3]; + execution.workgroup_size.z = ops[4]; + break; + + case ExecutionModeOutputVertices: + execution.output_vertices = ops[2]; + break; + + case ExecutionModeOutputPrimitivesEXT: + execution.output_primitives = ops[2]; + break; + + case ExecutionModeSignedZeroInfNanPreserve: + switch (ops[2]) + { + case 8: + execution.signed_zero_inf_nan_preserve_8 = true; + break; + + case 16: + execution.signed_zero_inf_nan_preserve_16 = true; + break; + + case 32: + execution.signed_zero_inf_nan_preserve_32 = true; + break; + + case 64: + execution.signed_zero_inf_nan_preserve_64 = true; + break; + + default: + SPIRV_CROSS_THROW("Invalid bit-width for SignedZeroInfNanPreserve."); + } + break; + + default: + break; + } + break; + } + + case OpExecutionModeId: + { + auto &execution = ir.entry_points[ops[0]]; + auto mode = static_cast(ops[1]); + execution.flags.set(mode); + + switch (mode) + { + case ExecutionModeLocalSizeId: + execution.workgroup_size.id_x = ops[2]; + execution.workgroup_size.id_y = ops[3]; + execution.workgroup_size.id_z = ops[4]; + break; + + case ExecutionModeFPFastMathDefault: + execution.fp_fast_math_defaults[ops[2]] = ops[3]; + break; + + default: + break; + } + break; + } + + case OpName: + { + uint32_t id = ops[0]; + ir.set_name(id, extract_string(ir.spirv, instruction.offset + 1)); + break; + } + + case OpMemberName: + { + uint32_t id = ops[0]; + uint32_t member = ops[1]; + ir.set_member_name(id, member, extract_string(ir.spirv, instruction.offset + 2)); + break; + } + + case OpDecorationGroup: + { + // Noop, this simply means an ID should be a collector of decorations. + // The meta array is already a flat array of decorations which will contain the relevant decorations. + break; + } + + case OpGroupDecorate: + { + uint32_t group_id = ops[0]; + auto &decorations = ir.meta[group_id].decoration; + auto &flags = decorations.decoration_flags; + + // Copies decorations from one ID to another. Only copy decorations which are set in the group, + // i.e., we cannot just copy the meta structure directly. + for (uint32_t i = 1; i < length; i++) + { + uint32_t target = ops[i]; + flags.for_each_bit([&](uint32_t bit) { + auto decoration = static_cast(bit); + + if (decoration_is_string(decoration)) + { + ir.set_decoration_string(target, decoration, ir.get_decoration_string(group_id, decoration)); + } + else + { + ir.meta[target].decoration_word_offset[decoration] = + ir.meta[group_id].decoration_word_offset[decoration]; + ir.set_decoration(target, decoration, ir.get_decoration(group_id, decoration)); + } + }); + } + break; + } + + case OpGroupMemberDecorate: + { + uint32_t group_id = ops[0]; + auto &flags = ir.meta[group_id].decoration.decoration_flags; + + // Copies decorations from one ID to another. Only copy decorations which are set in the group, + // i.e., we cannot just copy the meta structure directly. + for (uint32_t i = 1; i + 1 < length; i += 2) + { + uint32_t target = ops[i + 0]; + uint32_t index = ops[i + 1]; + flags.for_each_bit([&](uint32_t bit) { + auto decoration = static_cast(bit); + + if (decoration_is_string(decoration)) + ir.set_member_decoration_string(target, index, decoration, + ir.get_decoration_string(group_id, decoration)); + else + ir.set_member_decoration(target, index, decoration, ir.get_decoration(group_id, decoration)); + }); + } + break; + } + + case OpDecorate: + case OpDecorateId: + { + // OpDecorateId technically supports an array of arguments, but our only supported decorations are single uint, + // so merge decorate and decorate-id here. + uint32_t id = ops[0]; + + auto decoration = static_cast(ops[1]); + if (length >= 3) + { + ir.meta[id].decoration_word_offset[decoration] = uint32_t(&ops[2] - ir.spirv.data()); + ir.set_decoration(id, decoration, ops[2]); + } + else + ir.set_decoration(id, decoration); + + break; + } + + case OpDecorateStringGOOGLE: + { + uint32_t id = ops[0]; + auto decoration = static_cast(ops[1]); + ir.set_decoration_string(id, decoration, extract_string(ir.spirv, instruction.offset + 2)); + break; + } + + case OpMemberDecorate: + { + uint32_t id = ops[0]; + uint32_t member = ops[1]; + auto decoration = static_cast(ops[2]); + if (length >= 4) + ir.set_member_decoration(id, member, decoration, ops[3]); + else + ir.set_member_decoration(id, member, decoration); + break; + } + + case OpMemberDecorateStringGOOGLE: + { + uint32_t id = ops[0]; + uint32_t member = ops[1]; + auto decoration = static_cast(ops[2]); + ir.set_member_decoration_string(id, member, decoration, extract_string(ir.spirv, instruction.offset + 3)); + break; + } + + // Build up basic types. + case OpTypeVoid: + { + uint32_t id = ops[0]; + auto &type = set(id, op); + type.basetype = SPIRType::Void; + break; + } + + case OpTypeBool: + { + uint32_t id = ops[0]; + auto &type = set(id, op); + type.basetype = SPIRType::Boolean; + type.width = 1; + break; + } + + case OpTypeFloat: + { + uint32_t id = ops[0]; + uint32_t width = ops[1]; + auto &type = set(id, op); + + if (width != 16 && width != 8 && length > 2) + SPIRV_CROSS_THROW("Unrecognized FP encoding mode for OpTypeFloat."); + + if (width == 64) + type.basetype = SPIRType::Double; + else if (width == 32) + type.basetype = SPIRType::Float; + else if (width == 16) + { + if (length > 2) + { + if (ops[2] == FPEncodingBFloat16KHR) + type.basetype = SPIRType::BFloat16; + else + SPIRV_CROSS_THROW("Unrecognized encoding for OpTypeFloat 16."); + } + else + type.basetype = SPIRType::Half; + } + else if (width == 8) + { + if (length < 2) + SPIRV_CROSS_THROW("Missing encoding for OpTypeFloat 8."); + else if (ops[2] == FPEncodingFloat8E4M3EXT) + type.basetype = SPIRType::FloatE4M3; + else if (ops[2] == FPEncodingFloat8E5M2EXT) + type.basetype = SPIRType::FloatE5M2; + else + SPIRV_CROSS_THROW("Invalid encoding for OpTypeFloat 8."); + } + else + SPIRV_CROSS_THROW("Unrecognized bit-width of floating point type."); + type.width = width; + break; + } + + case OpTypeInt: + { + uint32_t id = ops[0]; + uint32_t width = ops[1]; + bool signedness = ops[2] != 0; + auto &type = set(id, op); + type.basetype = signedness ? to_signed_basetype(width) : to_unsigned_basetype(width); + type.width = width; + break; + } + + // Build composite types by "inheriting". + // NOTE: The self member is also copied! For pointers and array modifiers this is a good thing + // since we can refer to decorations on pointee classes which is needed for UBO/SSBO, I/O blocks in geometry/tess etc. + case OpTypeVector: + { + uint32_t id = ops[0]; + uint32_t vecsize = ops[2]; + + auto &base = get(ops[1]); + auto &vecbase = set(id, base); + + vecbase.op = op; + vecbase.vecsize = vecsize; + vecbase.self = id; + vecbase.parent_type = ops[1]; + break; + } + + case OpTypeMatrix: + { + uint32_t id = ops[0]; + uint32_t colcount = ops[2]; + + auto &base = get(ops[1]); + auto &matrixbase = set(id, base); + + matrixbase.op = op; + matrixbase.columns = colcount; + matrixbase.self = id; + matrixbase.parent_type = ops[1]; + break; + } + + case OpTypeCooperativeMatrixKHR: + { + uint32_t id = ops[0]; + auto &base = get(ops[1]); + auto &matrixbase = set(id, base); + + matrixbase.op = op; + matrixbase.ext.cooperative.scope_id = ops[2]; + matrixbase.ext.cooperative.rows_id = ops[3]; + matrixbase.ext.cooperative.columns_id = ops[4]; + matrixbase.ext.cooperative.use_id = ops[5]; + matrixbase.self = id; + matrixbase.parent_type = ops[1]; + break; + } + + case OpTypeCooperativeVectorNV: + { + uint32_t id = ops[0]; + auto &type = set(id, op); + + type.basetype = SPIRType::CoopVecNV; + type.op = op; + type.ext.coopVecNV.component_type_id = ops[1]; + type.ext.coopVecNV.component_count_id = ops[2]; + type.parent_type = ops[1]; + + // CoopVec-Nv can be used with integer operations like SMax where + // where spirv-opt does explicit checks on integer bitwidth + auto component_type = get(type.ext.coopVecNV.component_type_id); + type.width = component_type.width; + break; + } + + case OpTypeArray: + { + uint32_t id = ops[0]; + uint32_t tid = ops[1]; + auto &base = get(tid); + auto &arraybase = set(id, base); + + arraybase.op = op; + arraybase.parent_type = tid; + + uint32_t cid = ops[2]; + ir.mark_used_as_array_length(cid); + auto *c = maybe_get(cid); + bool literal = c && !c->specialization; + + // We're copying type information into Array types, so we'll need a fixup for any physical pointer + // references. + if (base.forward_pointer) + forward_pointer_fixups.push_back({ id, tid }); + + arraybase.array_size_literal.push_back(literal); + arraybase.array.push_back(literal ? c->scalar() : cid); + + // .self resolves down to non-array/non-pointer type. + arraybase.self = base.self; + break; + } + + case OpTypeRuntimeArray: + { + uint32_t id = ops[0]; + + auto &base = get(ops[1]); + auto &arraybase = set(id, base); + + // We're copying type information into Array types, so we'll need a fixup for any physical pointer + // references. + if (base.forward_pointer) + forward_pointer_fixups.push_back({ id, ops[1] }); + + arraybase.op = op; + arraybase.array.push_back(0); + arraybase.array_size_literal.push_back(true); + arraybase.parent_type = ops[1]; + + // .self resolves down to non-array/non-pointer type. + arraybase.self = base.self; + break; + } + + case OpTypeImage: + { + uint32_t id = ops[0]; + auto &type = set(id, op); + type.basetype = SPIRType::Image; + type.image.type = ops[1]; + type.image.dim = static_cast(ops[2]); + type.image.depth = ops[3] == 1; + type.image.arrayed = ops[4] != 0; + type.image.ms = ops[5] != 0; + type.image.sampled = ops[6]; + type.image.format = static_cast(ops[7]); + type.image.access = (length >= 9) ? static_cast(ops[8]) : AccessQualifierMax; + break; + } + + case OpTypeSampledImage: + { + uint32_t id = ops[0]; + uint32_t imagetype = ops[1]; + auto &type = set(id, op); + type = get(imagetype); + type.basetype = SPIRType::SampledImage; + type.self = id; + break; + } + + case OpTypeSampler: + { + uint32_t id = ops[0]; + auto &type = set(id, op); + type.basetype = SPIRType::Sampler; + break; + } + + case OpTypePointer: + { + uint32_t id = ops[0]; + + // Very rarely, we might receive a FunctionPrototype here. + // We won't be able to compile it, but we shouldn't crash when parsing. + // We should be able to reflect. + auto *base = maybe_get(ops[2]); + auto &ptrbase = set(id, op); + + if (base) + { + ptrbase = *base; + ptrbase.op = op; + } + + ptrbase.pointer = true; + ptrbase.pointer_depth++; + ptrbase.storage = static_cast(ops[1]); + + if (ptrbase.storage == StorageClassAtomicCounter) + ptrbase.basetype = SPIRType::AtomicCounter; + + if (base && base->forward_pointer) + forward_pointer_fixups.push_back({ id, ops[2] }); + + ptrbase.parent_type = ops[2]; + + // Do NOT set ptrbase.self! + break; + } + + case OpTypeForwardPointer: + { + uint32_t id = ops[0]; + auto &ptrbase = set(id, op); + ptrbase.pointer = true; + ptrbase.pointer_depth++; + ptrbase.storage = static_cast(ops[1]); + ptrbase.forward_pointer = true; + + if (ptrbase.storage == StorageClassAtomicCounter) + ptrbase.basetype = SPIRType::AtomicCounter; + + break; + } + + case OpTypeStruct: + { + uint32_t id = ops[0]; + auto &type = set(id, op); + type.basetype = SPIRType::Struct; + for (uint32_t i = 1; i < length; i++) + type.member_types.push_back(ops[i]); + + // Check if we have seen this struct type before, with just different + // decorations. + // + // Add workaround for issue #17 as well by looking at OpName for the struct + // types, which we shouldn't normally do. + // We should not normally have to consider type aliases like this to begin with + // however ... glslang issues #304, #307 cover this. + + // For stripped names, never consider struct type aliasing. + // We risk declaring the same struct multiple times, but type-punning is not allowed + // so this is safe. + bool consider_aliasing = !ir.get_name(type.self).empty(); + if (consider_aliasing) + { + for (auto &other : global_struct_cache) + { + if (ir.get_name(type.self) == ir.get_name(other) && + types_are_logically_equivalent(type, get(other))) + { + type.type_alias = other; + break; + } + } + + if (type.type_alias == TypeID(0)) + global_struct_cache.push_back(id); + } + break; + } + + case OpTypeFunction: + { + uint32_t id = ops[0]; + uint32_t ret = ops[1]; + + auto &func = set(id, ret); + for (uint32_t i = 2; i < length; i++) + func.parameter_types.push_back(ops[i]); + break; + } + + case OpTypeAccelerationStructureKHR: + { + uint32_t id = ops[0]; + auto &type = set(id, op); + type.basetype = SPIRType::AccelerationStructure; + break; + } + + case OpTypeRayQueryKHR: + { + uint32_t id = ops[0]; + auto &type = set(id, op); + type.basetype = SPIRType::RayQuery; + break; + } + + case OpTypeTensorARM: + { + uint32_t id = ops[0]; + auto &type = set(id, op); + type.basetype = SPIRType::Tensor; + type.ext.tensor = {}; + type.ext.tensor.type = ops[1]; + if (length >= 3) + type.ext.tensor.rank = ops[2]; + if (length >= 4) + type.ext.tensor.shape = ops[3]; + break; + } + + // Variable declaration + // All variables are essentially pointers with a storage qualifier. + case OpVariable: + { + uint32_t type = ops[0]; + uint32_t id = ops[1]; + auto storage = static_cast(ops[2]); + uint32_t initializer = length == 4 ? ops[3] : 0; + + if (storage == StorageClassFunction) + { + if (!current_function) + SPIRV_CROSS_THROW("No function currently in scope"); + current_function->add_local_variable(id); + } + + set(id, type, storage, initializer); + break; + } + + // OpPhi + // OpPhi is a fairly magical opcode. + // It selects temporary variables based on which parent block we *came from*. + // In high-level languages we can "de-SSA" by creating a function local, and flush out temporaries to this function-local + // variable to emulate SSA Phi. + case OpPhi: + { + if (!current_function) + SPIRV_CROSS_THROW("No function currently in scope"); + if (!current_block) + SPIRV_CROSS_THROW("No block currently in scope"); + + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + // Instead of a temporary, create a new function-wide temporary with this ID instead. + auto &var = set(id, result_type, StorageClassFunction); + var.phi_variable = true; + + current_function->add_local_variable(id); + + for (uint32_t i = 2; i + 2 <= length; i += 2) + current_block->phi_variables.push_back({ ops[i], ops[i + 1], id }); + break; + } + + // Constants + case OpSpecConstant: + case OpConstant: + case OpConstantCompositeReplicateEXT: + case OpSpecConstantCompositeReplicateEXT: + { + uint32_t id = ops[1]; + auto &type = get(ops[0]); + if (op == OpConstantCompositeReplicateEXT || op == OpSpecConstantCompositeReplicateEXT) + { + auto subconstant = uint32_t(ops[2]); + set(id, ops[0], &subconstant, 1, op == OpSpecConstantCompositeReplicateEXT, true); + } + else + { + + if (type.width > 32) + set(id, ops[0], ops[2] | (uint64_t(ops[3]) << 32), op == OpSpecConstant); + else + set(id, ops[0], ops[2], op == OpSpecConstant); + } + break; + } + + case OpSpecConstantFalse: + case OpConstantFalse: + { + uint32_t id = ops[1]; + set(id, ops[0], uint32_t(0), op == OpSpecConstantFalse); + break; + } + + case OpSpecConstantTrue: + case OpConstantTrue: + { + uint32_t id = ops[1]; + set(id, ops[0], uint32_t(1), op == OpSpecConstantTrue); + break; + } + + case OpConstantNull: + { + uint32_t id = ops[1]; + uint32_t type = ops[0]; + ir.make_constant_null(id, type, true); + break; + } + + case OpSpecConstantComposite: + case OpConstantComposite: + { + uint32_t id = ops[1]; + uint32_t type = ops[0]; + + auto &ctype = get(type); + + // We can have constants which are structs and arrays. + // In this case, our SPIRConstant will be a list of other SPIRConstant ids which we + // can refer to. + if (ctype.basetype == SPIRType::Struct || !ctype.array.empty()) + { + set(id, type, ops + 2, length - 2, op == OpSpecConstantComposite); + } + else + { + uint32_t elements = length - 2; + if (elements > 4) + SPIRV_CROSS_THROW("OpConstantComposite only supports 1, 2, 3 and 4 elements."); + + SPIRConstant remapped_constant_ops[4]; + const SPIRConstant *c[4]; + for (uint32_t i = 0; i < elements; i++) + { + // Specialization constants operations can also be part of this. + // We do not know their value, so any attempt to query SPIRConstant later + // will fail. We can only propagate the ID of the expression and use to_expression on it. + auto *constant_op = maybe_get(ops[2 + i]); + auto *undef_op = maybe_get(ops[2 + i]); + if (constant_op) + { + if (op == OpConstantComposite) + SPIRV_CROSS_THROW("Specialization constant operation used in OpConstantComposite."); + + remapped_constant_ops[i].make_null(get(constant_op->basetype)); + remapped_constant_ops[i].self = constant_op->self; + remapped_constant_ops[i].constant_type = constant_op->basetype; + remapped_constant_ops[i].specialization = true; + c[i] = &remapped_constant_ops[i]; + } + else if (undef_op) + { + // Undefined, just pick 0. + remapped_constant_ops[i].make_null(get(undef_op->basetype)); + remapped_constant_ops[i].constant_type = undef_op->basetype; + c[i] = &remapped_constant_ops[i]; + } + else + c[i] = &get(ops[2 + i]); + } + set(id, type, c, elements, op == OpSpecConstantComposite); + } + break; + } + + // Functions + case OpFunction: + { + uint32_t res = ops[0]; + uint32_t id = ops[1]; + // Control + uint32_t type = ops[3]; + + if (current_function) + SPIRV_CROSS_THROW("Must end a function before starting a new one!"); + + current_function = &set(id, res, type); + break; + } + + case OpFunctionParameter: + { + uint32_t type = ops[0]; + uint32_t id = ops[1]; + + if (!current_function) + SPIRV_CROSS_THROW("Must be in a function!"); + + current_function->add_parameter(type, id); + set(id, type, StorageClassFunction); + break; + } + + case OpFunctionEnd: + { + if (current_block) + { + // Very specific error message, but seems to come up quite often. + SPIRV_CROSS_THROW( + "Cannot end a function before ending the current block.\n" + "Likely cause: If this SPIR-V was created from glslang HLSL, make sure the entry point is valid."); + } + current_function = nullptr; + break; + } + + // Blocks + case OpLabel: + { + // OpLabel always starts a block. + if (!current_function) + SPIRV_CROSS_THROW("Blocks cannot exist outside functions!"); + + uint32_t id = ops[0]; + + current_function->blocks.push_back(id); + if (!current_function->entry_block) + current_function->entry_block = id; + + if (current_block) + SPIRV_CROSS_THROW("Cannot start a block before ending the current block."); + + current_block = &set(id); + break; + } + + // Branch instructions end blocks. + case OpBranch: + { + if (!current_block) + SPIRV_CROSS_THROW("Trying to end a non-existing block."); + + uint32_t target = ops[0]; + current_block->terminator = SPIRBlock::Direct; + current_block->next_block = target; + current_block = nullptr; + break; + } + + case OpBranchConditional: + { + if (!current_block) + SPIRV_CROSS_THROW("Trying to end a non-existing block."); + + current_block->condition = ops[0]; + current_block->true_block = ops[1]; + current_block->false_block = ops[2]; + + current_block->terminator = SPIRBlock::Select; + + if (current_block->true_block == current_block->false_block) + { + // Bogus conditional, translate to a direct branch. + // Avoids some ugly edge cases later when analyzing CFGs. + + // There are some super jank cases where the merge block is different from the true/false, + // and later branches can "break" out of the selection construct this way. + // This is complete nonsense, but CTS hits this case. + // In this scenario, we should see the selection construct as more of a Switch with one default case. + // The problem here is that this breaks any attempt to break out of outer switch statements, + // but it's theoretically solvable if this ever comes up using the ladder breaking system ... + + if (current_block->true_block != current_block->next_block && + current_block->merge == SPIRBlock::MergeSelection) + { + uint32_t ids = ir.increase_bound_by(2); + + auto &type = set(ids, OpTypeInt); + type.basetype = SPIRType::Int; + type.width = 32; + auto &c = set(ids + 1, ids); + + current_block->condition = c.self; + current_block->default_block = current_block->true_block; + current_block->terminator = SPIRBlock::MultiSelect; + ir.block_meta[current_block->next_block] &= ~ParsedIR::BLOCK_META_SELECTION_MERGE_BIT; + ir.block_meta[current_block->next_block] |= ParsedIR::BLOCK_META_MULTISELECT_MERGE_BIT; + } + else + { + // Collapse loops if we have to. + bool collapsed_loop = current_block->true_block == current_block->merge_block && + current_block->merge == SPIRBlock::MergeLoop; + + if (collapsed_loop) + { + ir.block_meta[current_block->merge_block] &= ~ParsedIR::BLOCK_META_LOOP_MERGE_BIT; + ir.block_meta[current_block->continue_block] &= ~ParsedIR::BLOCK_META_CONTINUE_BIT; + } + + current_block->next_block = current_block->true_block; + current_block->condition = 0; + current_block->true_block = 0; + current_block->false_block = 0; + current_block->merge_block = 0; + current_block->merge = SPIRBlock::MergeNone; + current_block->terminator = SPIRBlock::Direct; + } + } + + current_block = nullptr; + break; + } + + case OpSwitch: + { + if (!current_block) + SPIRV_CROSS_THROW("Trying to end a non-existing block."); + + current_block->terminator = SPIRBlock::MultiSelect; + + current_block->condition = ops[0]; + current_block->default_block = ops[1]; + + uint32_t remaining_ops = length - 2; + if ((remaining_ops % 2) == 0) + { + for (uint32_t i = 2; i + 2 <= length; i += 2) + current_block->cases_32bit.push_back({ ops[i], ops[i + 1] }); + } + + if ((remaining_ops % 3) == 0) + { + for (uint32_t i = 2; i + 3 <= length; i += 3) + { + uint64_t value = (static_cast(ops[i + 1]) << 32) | ops[i]; + current_block->cases_64bit.push_back({ value, ops[i + 2] }); + } + } + + // If we jump to next block, make it break instead since we're inside a switch case block at that point. + ir.block_meta[current_block->next_block] |= ParsedIR::BLOCK_META_MULTISELECT_MERGE_BIT; + + current_block = nullptr; + break; + } + + case OpKill: + case OpTerminateInvocation: + { + if (!current_block) + SPIRV_CROSS_THROW("Trying to end a non-existing block."); + current_block->terminator = SPIRBlock::Kill; + current_block = nullptr; + break; + } + + case OpTerminateRayKHR: + // NV variant is not a terminator. + if (!current_block) + SPIRV_CROSS_THROW("Trying to end a non-existing block."); + current_block->terminator = SPIRBlock::TerminateRay; + current_block = nullptr; + break; + + case OpIgnoreIntersectionKHR: + // NV variant is not a terminator. + if (!current_block) + SPIRV_CROSS_THROW("Trying to end a non-existing block."); + current_block->terminator = SPIRBlock::IgnoreIntersection; + current_block = nullptr; + break; + + case OpEmitMeshTasksEXT: + if (!current_block) + SPIRV_CROSS_THROW("Trying to end a non-existing block."); + current_block->terminator = SPIRBlock::EmitMeshTasks; + for (uint32_t i = 0; i < 3; i++) + current_block->mesh.groups[i] = ops[i]; + current_block->mesh.payload = length >= 4 ? ops[3] : 0; + current_block = nullptr; + // Currently glslang is bugged and does not treat EmitMeshTasksEXT as a terminator. + ignore_trailing_block_opcodes = true; + break; + + case OpReturn: + { + if (!current_block) + SPIRV_CROSS_THROW("Trying to end a non-existing block."); + current_block->terminator = SPIRBlock::Return; + current_block = nullptr; + break; + } + + case OpReturnValue: + { + if (!current_block) + SPIRV_CROSS_THROW("Trying to end a non-existing block."); + current_block->terminator = SPIRBlock::Return; + current_block->return_value = ops[0]; + current_block = nullptr; + break; + } + + case OpUnreachable: + { + if (!current_block) + SPIRV_CROSS_THROW("Trying to end a non-existing block."); + current_block->terminator = SPIRBlock::Unreachable; + current_block = nullptr; + break; + } + + case OpSelectionMerge: + { + if (!current_block) + SPIRV_CROSS_THROW("Trying to modify a non-existing block."); + + current_block->next_block = ops[0]; + current_block->merge = SPIRBlock::MergeSelection; + ir.block_meta[current_block->next_block] |= ParsedIR::BLOCK_META_SELECTION_MERGE_BIT; + + if (length >= 2) + { + if (ops[1] & SelectionControlFlattenMask) + current_block->hint = SPIRBlock::HintFlatten; + else if (ops[1] & SelectionControlDontFlattenMask) + current_block->hint = SPIRBlock::HintDontFlatten; + } + break; + } + + case OpLoopMerge: + { + if (!current_block) + SPIRV_CROSS_THROW("Trying to modify a non-existing block."); + + current_block->merge_block = ops[0]; + current_block->continue_block = ops[1]; + current_block->merge = SPIRBlock::MergeLoop; + + ir.block_meta[current_block->self] |= ParsedIR::BLOCK_META_LOOP_HEADER_BIT; + ir.block_meta[current_block->merge_block] |= ParsedIR::BLOCK_META_LOOP_MERGE_BIT; + + ir.continue_block_to_loop_header[current_block->continue_block] = BlockID(current_block->self); + + // Don't add loop headers to continue blocks, + // which would make it impossible branch into the loop header since + // they are treated as continues. + if (current_block->continue_block != BlockID(current_block->self)) + ir.block_meta[current_block->continue_block] |= ParsedIR::BLOCK_META_CONTINUE_BIT; + + if (length >= 3) + { + if (ops[2] & LoopControlUnrollMask) + current_block->hint = SPIRBlock::HintUnroll; + else if (ops[2] & LoopControlDontUnrollMask) + current_block->hint = SPIRBlock::HintDontUnroll; + } + break; + } + + case OpSpecConstantOp: + { + if (length < 3) + SPIRV_CROSS_THROW("OpSpecConstantOp not enough arguments."); + + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + auto spec_op = static_cast(ops[2]); + + set(id, result_type, spec_op, ops + 3, length - 3); + break; + } + + case OpLine: + { + // OpLine might come at global scope, but we don't care about those since they will not be declared in any + // meaningful correct order. + // Ignore all OpLine directives which live outside a function. + if (current_block) + current_block->ops.push_back(instruction); + + // Line directives may arrive before first OpLabel. + // Treat this as the line of the function declaration, + // so warnings for arguments can propagate properly. + if (current_function) + { + // Store the first one we find and emit it before creating the function prototype. + if (current_function->entry_line.file_id == 0) + { + current_function->entry_line.file_id = ops[0]; + current_function->entry_line.line_literal = ops[1]; + } + } + + uint32_t file = ops[0]; + uint32_t line = ops[1]; + + for (auto &source : ir.sources) + { + if (source.file_id == file) + { + source.line_markers.emplace_back(); + auto &marker = source.line_markers.back(); + marker.line = line; + marker.offset = instruction.offset - 1; + marker.function_id = current_function ? current_function->self : ID(0); + marker.block_id = current_block ? current_block->self : ID(0); + break; + } + } + + break; + } + + case OpNoLine: + { + // OpNoLine might come at global scope. + if (current_block) + current_block->ops.push_back(instruction); + break; + } + + // Actual opcodes. + default: + { + if (length >= 2) + { + const auto *type = maybe_get(ops[0]); + if (type) + ir.load_type_width.insert({ ops[1], type->width }); + } + + if (!current_block) + SPIRV_CROSS_THROW("Currently no block to insert opcode."); + + current_block->ops.push_back(instruction); + break; + } + } +} + +bool Parser::types_are_logically_equivalent(const SPIRType &a, const SPIRType &b) const +{ + if (a.basetype != b.basetype) + return false; + if (a.width != b.width) + return false; + if (a.vecsize != b.vecsize) + return false; + if (a.columns != b.columns) + return false; + if (a.array.size() != b.array.size()) + return false; + + size_t array_count = a.array.size(); + if (array_count && memcmp(a.array.data(), b.array.data(), array_count * sizeof(uint32_t)) != 0) + return false; + + if (a.basetype == SPIRType::Image || a.basetype == SPIRType::SampledImage) + { + if (memcmp(&a.image, &b.image, sizeof(SPIRType::Image)) != 0) + return false; + } + + if (a.member_types.size() != b.member_types.size()) + return false; + + size_t member_types = a.member_types.size(); + for (size_t i = 0; i < member_types; i++) + { + if (!types_are_logically_equivalent(get(a.member_types[i]), get(b.member_types[i]))) + return false; + } + + return true; +} + +bool Parser::variable_storage_is_aliased(const SPIRVariable &v) const +{ + auto &type = get(v.basetype); + + auto *type_meta = ir.find_meta(type.self); + + bool ssbo = v.storage == StorageClassStorageBuffer || + (type_meta && type_meta->decoration.decoration_flags.get(DecorationBufferBlock)); + bool image = type.basetype == SPIRType::Image; + bool counter = type.basetype == SPIRType::AtomicCounter; + + bool is_restrict; + if (ssbo) + is_restrict = ir.get_buffer_block_flags(v).get(DecorationRestrict); + else + is_restrict = ir.has_decoration(v.self, DecorationRestrict); + + return !is_restrict && (ssbo || image || counter); +} +} // namespace SPIRV_CROSS_NAMESPACE diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_parser.hpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_parser.hpp new file mode 100644 index 0000000000..dabc0e2244 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_parser.hpp @@ -0,0 +1,103 @@ +/* + * Copyright 2018-2021 Arm Limited + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#ifndef SPIRV_CROSS_PARSER_HPP +#define SPIRV_CROSS_PARSER_HPP + +#include "spirv_cross_parsed_ir.hpp" +#include + +namespace SPIRV_CROSS_NAMESPACE +{ +class Parser +{ +public: + Parser(const uint32_t *spirv_data, size_t word_count); + Parser(std::vector spirv); + + void parse(); + + ParsedIR &get_parsed_ir() + { + return ir; + } + +private: + ParsedIR ir; + SPIRFunction *current_function = nullptr; + SPIRBlock *current_block = nullptr; + // For workarounds. + bool ignore_trailing_block_opcodes = false; + + void parse(const Instruction &instr); + const uint32_t *stream(const Instruction &instr) const; + + template + T &set(uint32_t id, P &&... args) + { + ir.add_typed_id(static_cast(T::type), id); + auto &var = variant_set(ir.ids[id], std::forward

(args)...); + var.self = id; + return var; + } + + template + T &get(uint32_t id) + { + return variant_get(ir.ids[id]); + } + + template + T *maybe_get(uint32_t id) + { + if (ir.ids[id].get_type() == static_cast(T::type)) + return &get(id); + else + return nullptr; + } + + template + const T &get(uint32_t id) const + { + return variant_get(ir.ids[id]); + } + + template + const T *maybe_get(uint32_t id) const + { + if (ir.ids[id].get_type() == T::type) + return &get(id); + else + return nullptr; + } + + // This must be an ordered data structure so we always pick the same type aliases. + SmallVector global_struct_cache; + SmallVector> forward_pointer_fixups; + + bool types_are_logically_equivalent(const SPIRType &a, const SPIRType &b) const; + bool variable_storage_is_aliased(const SPIRVariable &v) const; +}; +} // namespace SPIRV_CROSS_NAMESPACE + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_reflect.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_reflect.cpp new file mode 100644 index 0000000000..3807613041 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_reflect.cpp @@ -0,0 +1,721 @@ +/* + * Copyright 2018-2021 Bradley Austin Davis + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#include "spirv_reflect.hpp" +#include "spirv_glsl.hpp" +#include + +using namespace SPIRV_CROSS_SPV_HEADER_NAMESPACE; +using namespace SPIRV_CROSS_NAMESPACE; +using namespace std; + +namespace simple_json +{ +enum class Type +{ + Object, + Array, +}; + +using State = std::pair; +using Stack = std::stack; + +class Stream +{ + Stack stack; + StringStream<> buffer; + uint32_t indent{ 0 }; + char current_locale_radix_character = '.'; + +public: + void set_current_locale_radix_character(char c) + { + current_locale_radix_character = c; + } + + void begin_json_object(); + void end_json_object(); + void emit_json_key(const std::string &key); + void emit_json_key_value(const std::string &key, const std::string &value); + void emit_json_key_value(const std::string &key, bool value); + void emit_json_key_value(const std::string &key, uint32_t value); + void emit_json_key_value(const std::string &key, int32_t value); + void emit_json_key_value(const std::string &key, float value); + void emit_json_key_object(const std::string &key); + void emit_json_key_array(const std::string &key); + + void begin_json_array(); + void end_json_array(); + void emit_json_array_value(const std::string &value); + void emit_json_array_value(uint32_t value); + void emit_json_array_value(bool value); + + std::string str() const + { + return buffer.str(); + } + +private: + inline void statement_indent() + { + for (uint32_t i = 0; i < indent; i++) + buffer << " "; + } + + template + inline void statement_inner(T &&t) + { + buffer << std::forward(t); + } + + template + inline void statement_inner(T &&t, Ts &&... ts) + { + buffer << std::forward(t); + statement_inner(std::forward(ts)...); + } + + template + inline void statement(Ts &&... ts) + { + statement_indent(); + statement_inner(std::forward(ts)...); + buffer << '\n'; + } + + template + void statement_no_return(Ts &&... ts) + { + statement_indent(); + statement_inner(std::forward(ts)...); + } +}; +} // namespace simple_json + +using namespace simple_json; + +// Hackery to emit JSON without using nlohmann/json C++ library (which requires a +// higher level of compiler compliance than is required by SPIRV-Cross +void Stream::begin_json_array() +{ + if (!stack.empty() && stack.top().second) + { + statement_inner(",\n"); + } + statement("["); + ++indent; + stack.emplace(Type::Array, false); +} + +void Stream::end_json_array() +{ + if (stack.empty() || stack.top().first != Type::Array) + SPIRV_CROSS_THROW("Invalid JSON state"); + if (stack.top().second) + { + statement_inner("\n"); + } + --indent; + statement_no_return("]"); + stack.pop(); + if (!stack.empty()) + { + stack.top().second = true; + } +} + +void Stream::emit_json_array_value(const std::string &value) +{ + if (stack.empty() || stack.top().first != Type::Array) + SPIRV_CROSS_THROW("Invalid JSON state"); + + if (stack.top().second) + statement_inner(",\n"); + + statement_no_return("\"", value, "\""); + stack.top().second = true; +} + +void Stream::emit_json_array_value(uint32_t value) +{ + if (stack.empty() || stack.top().first != Type::Array) + SPIRV_CROSS_THROW("Invalid JSON state"); + if (stack.top().second) + statement_inner(",\n"); + statement_no_return(std::to_string(value)); + stack.top().second = true; +} + +void Stream::emit_json_array_value(bool value) +{ + if (stack.empty() || stack.top().first != Type::Array) + SPIRV_CROSS_THROW("Invalid JSON state"); + if (stack.top().second) + statement_inner(",\n"); + statement_no_return(value ? "true" : "false"); + stack.top().second = true; +} + +void Stream::begin_json_object() +{ + if (!stack.empty() && stack.top().second) + { + statement_inner(",\n"); + } + statement("{"); + ++indent; + stack.emplace(Type::Object, false); +} + +void Stream::end_json_object() +{ + if (stack.empty() || stack.top().first != Type::Object) + SPIRV_CROSS_THROW("Invalid JSON state"); + if (stack.top().second) + { + statement_inner("\n"); + } + --indent; + statement_no_return("}"); + stack.pop(); + if (!stack.empty()) + { + stack.top().second = true; + } +} + +void Stream::emit_json_key(const std::string &key) +{ + if (stack.empty() || stack.top().first != Type::Object) + SPIRV_CROSS_THROW("Invalid JSON state"); + + if (stack.top().second) + statement_inner(",\n"); + statement_no_return("\"", key, "\" : "); + stack.top().second = true; +} + +void Stream::emit_json_key_value(const std::string &key, const std::string &value) +{ + emit_json_key(key); + statement_inner("\"", value, "\""); +} + +void Stream::emit_json_key_value(const std::string &key, uint32_t value) +{ + emit_json_key(key); + statement_inner(value); +} + +void Stream::emit_json_key_value(const std::string &key, int32_t value) +{ + emit_json_key(key); + statement_inner(value); +} + +void Stream::emit_json_key_value(const std::string &key, float value) +{ + emit_json_key(key); + statement_inner(convert_to_string(value, current_locale_radix_character)); +} + +void Stream::emit_json_key_value(const std::string &key, bool value) +{ + emit_json_key(key); + statement_inner(value ? "true" : "false"); +} + +void Stream::emit_json_key_object(const std::string &key) +{ + emit_json_key(key); + statement_inner("{\n"); + ++indent; + stack.emplace(Type::Object, false); +} + +void Stream::emit_json_key_array(const std::string &key) +{ + emit_json_key(key); + statement_inner("[\n"); + ++indent; + stack.emplace(Type::Array, false); +} + +void CompilerReflection::set_format(const std::string &format) +{ + if (format != "json") + { + SPIRV_CROSS_THROW("Unsupported format"); + } +} + +string CompilerReflection::compile() +{ + json_stream = std::make_shared(); + json_stream->set_current_locale_radix_character(current_locale_radix_character); + json_stream->begin_json_object(); + reorder_type_alias(); + emit_entry_points(); + emit_types(); + emit_resources(); + emit_specialization_constants(); + json_stream->end_json_object(); + return json_stream->str(); +} + +static bool naturally_emit_type(const SPIRType &type) +{ + return type.basetype == SPIRType::Struct && !type.pointer && type.array.empty(); +} + +bool CompilerReflection::type_is_reference(const SPIRType &type) const +{ + // Physical pointers and arrays of physical pointers need to refer to the pointee's type. + return is_physical_pointer(type) || + (type_is_array_of_pointers(type) && type.storage == StorageClassPhysicalStorageBuffer); +} + +void CompilerReflection::emit_types() +{ + bool emitted_open_tag = false; + + SmallVector physical_pointee_types; + + // If we have physical pointers or arrays of physical pointers, it's also helpful to emit the pointee type + // and chain the type hierarchy. For POD, arrays can emit the entire type in-place. + ir.for_each_typed_id([&](uint32_t self, SPIRType &type) { + if (naturally_emit_type(type)) + { + emit_type(self, emitted_open_tag); + } + else if (type_is_reference(type)) + { + if (!naturally_emit_type(this->get(type.parent_type)) && + find(physical_pointee_types.begin(), physical_pointee_types.end(), type.parent_type) == + physical_pointee_types.end()) + { + physical_pointee_types.push_back(type.parent_type); + } + } + }); + + for (uint32_t pointee_type : physical_pointee_types) + emit_type(pointee_type, emitted_open_tag); + + if (emitted_open_tag) + { + json_stream->end_json_object(); + } +} + +void CompilerReflection::emit_type(uint32_t type_id, bool &emitted_open_tag) +{ + auto &type = get(type_id); + auto name = type_to_glsl(type); + + if (!emitted_open_tag) + { + json_stream->emit_json_key_object("types"); + emitted_open_tag = true; + } + json_stream->emit_json_key_object("_" + std::to_string(type_id)); + json_stream->emit_json_key_value("name", name); + + if (is_physical_pointer(type)) + { + json_stream->emit_json_key_value("type", "_" + std::to_string(type.parent_type)); + json_stream->emit_json_key_value("physical_pointer", true); + } + else if (!type.array.empty()) + { + emit_type_array(type); + json_stream->emit_json_key_value("type", "_" + std::to_string(type.parent_type)); + json_stream->emit_json_key_value("array_stride", get_decoration(type_id, DecorationArrayStride)); + } + else + { + json_stream->emit_json_key_array("members"); + // FIXME ideally we'd like to emit the size of a structure as a + // convenience to people parsing the reflected JSON. The problem + // is that there's no implicit size for a type. It's final size + // will be determined by the top level declaration in which it's + // included. So there might be one size for the struct if it's + // included in a std140 uniform block and another if it's included + // in a std430 uniform block. + // The solution is to include *all* potential sizes as a map of + // layout type name to integer, but that will probably require + // some additional logic being written in this class, or in the + // parent CompilerGLSL class. + auto size = type.member_types.size(); + for (uint32_t i = 0; i < size; ++i) + { + emit_type_member(type, i); + } + json_stream->end_json_array(); + } + + json_stream->end_json_object(); +} + +void CompilerReflection::emit_type_member(const SPIRType &type, uint32_t index) +{ + auto &membertype = get(type.member_types[index]); + json_stream->begin_json_object(); + auto name = to_member_name(type, index); + // FIXME we'd like to emit the offset of each member, but such offsets are + // context dependent. See the comment above regarding structure sizes + json_stream->emit_json_key_value("name", name); + + if (type_is_reference(membertype)) + { + json_stream->emit_json_key_value("type", "_" + std::to_string(membertype.parent_type)); + } + else if (membertype.basetype == SPIRType::Struct) + { + json_stream->emit_json_key_value("type", "_" + std::to_string(membertype.self)); + } + else + { + json_stream->emit_json_key_value("type", type_to_glsl(membertype)); + } + emit_type_member_qualifiers(type, index); + json_stream->end_json_object(); +} + +void CompilerReflection::emit_type_array(const SPIRType &type) +{ + if (!is_physical_pointer(type) && !type.array.empty()) + { + json_stream->emit_json_key_array("array"); + // Note that we emit the zeros here as a means of identifying + // unbounded arrays. This is necessary as otherwise there would + // be no way of differentiating between float[4] and float[4][] + for (const auto &value : type.array) + json_stream->emit_json_array_value(value); + json_stream->end_json_array(); + + json_stream->emit_json_key_array("array_size_is_literal"); + for (const auto &value : type.array_size_literal) + json_stream->emit_json_array_value(value); + json_stream->end_json_array(); + } +} + +void CompilerReflection::emit_type_member_qualifiers(const SPIRType &type, uint32_t index) +{ + auto &membertype = get(type.member_types[index]); + emit_type_array(membertype); + auto &memb = ir.meta[type.self].members; + if (index < memb.size()) + { + auto &dec = memb[index]; + if (dec.decoration_flags.get(DecorationLocation)) + json_stream->emit_json_key_value("location", dec.location); + if (dec.decoration_flags.get(DecorationOffset)) + json_stream->emit_json_key_value("offset", dec.offset); + + // Array stride is a property of the array type, not the struct. + if (has_decoration(type.member_types[index], DecorationArrayStride)) + json_stream->emit_json_key_value("array_stride", + get_decoration(type.member_types[index], DecorationArrayStride)); + + if (dec.decoration_flags.get(DecorationMatrixStride)) + json_stream->emit_json_key_value("matrix_stride", dec.matrix_stride); + if (dec.decoration_flags.get(DecorationRowMajor)) + json_stream->emit_json_key_value("row_major", true); + + if (is_physical_pointer(membertype)) + json_stream->emit_json_key_value("physical_pointer", true); + } +} + +string CompilerReflection::execution_model_to_str(ExecutionModel model) +{ + switch (model) + { + case ExecutionModelVertex: + return "vert"; + case ExecutionModelTessellationControl: + return "tesc"; + case ExecutionModelTessellationEvaluation: + return "tese"; + case ExecutionModelGeometry: + return "geom"; + case ExecutionModelFragment: + return "frag"; + case ExecutionModelGLCompute: + return "comp"; + case ExecutionModelRayGenerationNV: + return "rgen"; + case ExecutionModelIntersectionNV: + return "rint"; + case ExecutionModelAnyHitNV: + return "rahit"; + case ExecutionModelClosestHitNV: + return "rchit"; + case ExecutionModelMissNV: + return "rmiss"; + case ExecutionModelCallableNV: + return "rcall"; + case ExecutionModelMeshNV: + case ExecutionModelMeshEXT: + return "mesh"; + case ExecutionModelTaskNV: + case ExecutionModelTaskEXT: + return "task"; + default: + return "???"; + } +} + +// FIXME include things like the local_size dimensions, geometry output vertex count, etc +void CompilerReflection::emit_entry_points() +{ + auto entries = get_entry_points_and_stages(); + if (!entries.empty()) + { + // Needed to make output deterministic. + sort(begin(entries), end(entries), [](const EntryPoint &a, const EntryPoint &b) -> bool { + if (a.execution_model < b.execution_model) + return true; + else if (a.execution_model > b.execution_model) + return false; + else + return a.name < b.name; + }); + + json_stream->emit_json_key_array("entryPoints"); + for (auto &e : entries) + { + json_stream->begin_json_object(); + json_stream->emit_json_key_value("name", e.name); + json_stream->emit_json_key_value("mode", execution_model_to_str(e.execution_model)); + if (e.execution_model == ExecutionModelGLCompute || e.execution_model == ExecutionModelMeshEXT || + e.execution_model == ExecutionModelMeshNV || e.execution_model == ExecutionModelTaskEXT || + e.execution_model == ExecutionModelTaskNV) + { + const auto &spv_entry = get_entry_point(e.name, e.execution_model); + + SpecializationConstant spec_x, spec_y, spec_z; + get_work_group_size_specialization_constants(spec_x, spec_y, spec_z); + + json_stream->emit_json_key_array("workgroup_size"); + json_stream->emit_json_array_value(spec_x.id != ID(0) ? spec_x.constant_id : + spv_entry.workgroup_size.x); + json_stream->emit_json_array_value(spec_y.id != ID(0) ? spec_y.constant_id : + spv_entry.workgroup_size.y); + json_stream->emit_json_array_value(spec_z.id != ID(0) ? spec_z.constant_id : + spv_entry.workgroup_size.z); + json_stream->end_json_array(); + + json_stream->emit_json_key_array("workgroup_size_is_spec_constant_id"); + json_stream->emit_json_array_value(spec_x.id != ID(0)); + json_stream->emit_json_array_value(spec_y.id != ID(0)); + json_stream->emit_json_array_value(spec_z.id != ID(0)); + json_stream->end_json_array(); + } + json_stream->end_json_object(); + } + json_stream->end_json_array(); + } +} + +void CompilerReflection::emit_resources() +{ + auto res = get_shader_resources(); + emit_resources("subpass_inputs", res.subpass_inputs); + emit_resources("inputs", res.stage_inputs); + emit_resources("outputs", res.stage_outputs); + emit_resources("textures", res.sampled_images); + emit_resources("separate_images", res.separate_images); + emit_resources("separate_samplers", res.separate_samplers); + emit_resources("images", res.storage_images); + emit_resources("ssbos", res.storage_buffers); + emit_resources("ubos", res.uniform_buffers); + emit_resources("push_constants", res.push_constant_buffers); + emit_resources("counters", res.atomic_counters); + emit_resources("acceleration_structures", res.acceleration_structures); + emit_resources("tensors", res.tensors); +} + +void CompilerReflection::emit_resources(const char *tag, const SmallVector &resources) +{ + if (resources.empty()) + { + return; + } + + json_stream->emit_json_key_array(tag); + for (auto &res : resources) + { + auto &type = get_type(res.type_id); + auto typeflags = ir.meta[type.self].decoration.decoration_flags; + auto &mask = get_decoration_bitset(res.id); + + // If we don't have a name, use the fallback for the type instead of the variable + // for SSBOs and UBOs since those are the only meaningful names to use externally. + // Push constant blocks are still accessed by name and not block name, even though they are technically Blocks. + bool is_push_constant = get_storage_class(res.id) == StorageClassPushConstant; + bool is_block = get_decoration_bitset(type.self).get(DecorationBlock) || + get_decoration_bitset(type.self).get(DecorationBufferBlock); + + ID fallback_id = !is_push_constant && is_block ? ID(res.base_type_id) : ID(res.id); + + json_stream->begin_json_object(); + + if (type.basetype == SPIRType::Struct) + { + json_stream->emit_json_key_value("type", "_" + std::to_string(res.base_type_id)); + } + else + { + json_stream->emit_json_key_value("type", type_to_glsl(type)); + } + + json_stream->emit_json_key_value("name", !res.name.empty() ? res.name : get_fallback_name(fallback_id)); + { + bool ssbo_block = type.storage == StorageClassStorageBuffer || + (type.storage == StorageClassUniform && typeflags.get(DecorationBufferBlock)); + Bitset qualifier_mask = ssbo_block ? get_buffer_block_flags(res.id) : mask; + + if (qualifier_mask.get(DecorationNonReadable)) + json_stream->emit_json_key_value("writeonly", true); + if (qualifier_mask.get(DecorationNonWritable)) + json_stream->emit_json_key_value("readonly", true); + if (qualifier_mask.get(DecorationRestrict)) + json_stream->emit_json_key_value("restrict", true); + if (qualifier_mask.get(DecorationCoherent)) + json_stream->emit_json_key_value("coherent", true); + if (qualifier_mask.get(DecorationVolatile)) + json_stream->emit_json_key_value("volatile", true); + } + + emit_type_array(type); + + { + bool is_sized_block = is_block && (get_storage_class(res.id) == StorageClassUniform || + get_storage_class(res.id) == StorageClassUniformConstant || + get_storage_class(res.id) == StorageClassStorageBuffer); + if (is_sized_block) + { + uint32_t block_size = uint32_t(get_declared_struct_size(get_type(res.base_type_id))); + json_stream->emit_json_key_value("block_size", block_size); + } + } + + if (type.storage == StorageClassPushConstant) + json_stream->emit_json_key_value("push_constant", true); + if (mask.get(DecorationLocation)) + json_stream->emit_json_key_value("location", get_decoration(res.id, DecorationLocation)); + if (mask.get(DecorationRowMajor)) + json_stream->emit_json_key_value("row_major", true); + if (mask.get(DecorationColMajor)) + json_stream->emit_json_key_value("column_major", true); + if (mask.get(DecorationIndex)) + json_stream->emit_json_key_value("index", get_decoration(res.id, DecorationIndex)); + if (type.storage != StorageClassPushConstant && mask.get(DecorationDescriptorSet)) + json_stream->emit_json_key_value("set", get_decoration(res.id, DecorationDescriptorSet)); + if (mask.get(DecorationBinding)) + json_stream->emit_json_key_value("binding", get_decoration(res.id, DecorationBinding)); + if (mask.get(DecorationInputAttachmentIndex)) + json_stream->emit_json_key_value("input_attachment_index", + get_decoration(res.id, DecorationInputAttachmentIndex)); + if (mask.get(DecorationOffset)) + json_stream->emit_json_key_value("offset", get_decoration(res.id, DecorationOffset)); + if (mask.get(DecorationWeightTextureQCOM)) + json_stream->emit_json_key_value("WeightTextureQCOM", get_decoration(res.id, DecorationWeightTextureQCOM)); + if (mask.get(DecorationBlockMatchTextureQCOM)) + json_stream->emit_json_key_value("BlockMatchTextureQCOM", get_decoration(res.id, DecorationBlockMatchTextureQCOM)); + if (mask.get(DecorationBlockMatchSamplerQCOM)) + json_stream->emit_json_key_value("BlockMatchSamplerQCOM", get_decoration(res.id, DecorationBlockMatchSamplerQCOM)); + + // For images, the type itself adds a layout qualifer. + // Only emit the format for storage images. + if (type.basetype == SPIRType::Image && type.image.sampled == 2) + { + const char *fmt = format_to_glsl(type.image.format); + if (fmt != nullptr) + json_stream->emit_json_key_value("format", std::string(fmt)); + } + json_stream->end_json_object(); + } + json_stream->end_json_array(); +} + +void CompilerReflection::emit_specialization_constants() +{ + auto specialization_constants = get_specialization_constants(); + if (specialization_constants.empty()) + return; + + json_stream->emit_json_key_array("specialization_constants"); + for (const auto &spec_const : specialization_constants) + { + auto &c = get(spec_const.id); + auto type = get(c.constant_type); + json_stream->begin_json_object(); + json_stream->emit_json_key_value("name", get_name(spec_const.id)); + json_stream->emit_json_key_value("id", spec_const.constant_id); + json_stream->emit_json_key_value("type", type_to_glsl(type)); + json_stream->emit_json_key_value("variable_id", spec_const.id); + switch (type.basetype) + { + case SPIRType::UInt: + json_stream->emit_json_key_value("default_value", c.scalar()); + break; + + case SPIRType::Int: + json_stream->emit_json_key_value("default_value", c.scalar_i32()); + break; + + case SPIRType::Float: + json_stream->emit_json_key_value("default_value", c.scalar_f32()); + break; + + case SPIRType::Boolean: + json_stream->emit_json_key_value("default_value", c.scalar() != 0); + break; + + default: + break; + } + json_stream->end_json_object(); + } + json_stream->end_json_array(); +} + +string CompilerReflection::to_member_name(const SPIRType &type, uint32_t index) const +{ + auto *type_meta = ir.find_meta(type.self); + + if (type_meta) + { + auto &memb = type_meta->members; + if (index < memb.size() && !memb[index].alias.empty()) + return memb[index].alias; + else + return join("_m", index); + } + else + return join("_m", index); +} diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_reflect.hpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_reflect.hpp new file mode 100644 index 0000000000..492a951f99 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/SPIRV-Cross/spirv_reflect.hpp @@ -0,0 +1,92 @@ +/* + * Copyright 2018-2021 Bradley Austin Davis + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + */ + +#ifndef SPIRV_CROSS_REFLECT_HPP +#define SPIRV_CROSS_REFLECT_HPP + +#include "spirv_glsl.hpp" +#include + +namespace simple_json +{ +class Stream; +} + +namespace SPIRV_CROSS_NAMESPACE +{ +using namespace SPIRV_CROSS_SPV_HEADER_NAMESPACE; +class CompilerReflection : public CompilerGLSL +{ + using Parent = CompilerGLSL; + +public: + explicit CompilerReflection(std::vector spirv_) + : Parent(std::move(spirv_)) + { + options.vulkan_semantics = true; + } + + CompilerReflection(const uint32_t *ir_, size_t word_count) + : Parent(ir_, word_count) + { + options.vulkan_semantics = true; + } + + explicit CompilerReflection(const ParsedIR &ir_) + : CompilerGLSL(ir_) + { + options.vulkan_semantics = true; + } + + explicit CompilerReflection(ParsedIR &&ir_) + : CompilerGLSL(std::move(ir_)) + { + options.vulkan_semantics = true; + } + + void set_format(const std::string &format); + std::string compile() override; + +private: + static std::string execution_model_to_str(ExecutionModel model); + + void emit_entry_points(); + void emit_types(); + void emit_resources(); + void emit_specialization_constants(); + + void emit_type(uint32_t type_id, bool &emitted_open_tag); + void emit_type_member(const SPIRType &type, uint32_t index); + void emit_type_member_qualifiers(const SPIRType &type, uint32_t index); + void emit_type_array(const SPIRType &type); + void emit_resources(const char *tag, const SmallVector &resources); + bool type_is_reference(const SPIRType &type) const; + + std::string to_member_name(const SPIRType &type, uint32_t index) const; + + std::shared_ptr json_stream; +}; + +} // namespace SPIRV_CROSS_NAMESPACE + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/COPYRIGHT.txt b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/COPYRIGHT.txt new file mode 100644 index 0000000000..b0891ead18 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/COPYRIGHT.txt @@ -0,0 +1,7 @@ +Copyright (c) 2017, 2019 ARM Limited +Copyright (c) 2002-2005 3 Dlabs Inc. Ltd. +Copyright (c) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. +Copyright (c) 2014-2018 Google, Inc. +Copyright (c) 2002 NVIDIA Corporation +Copyright (c) 2002-2010 The ANGLE Project +Copyright (c) 2014-2019 The Khronos Group Inc. \ No newline at end of file diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/LICENSE.txt b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/LICENSE.txt new file mode 100644 index 0000000000..054e68a461 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/LICENSE.txt @@ -0,0 +1,1016 @@ +Here, glslang proper means core GLSL parsing, HLSL parsing, and SPIR-V code +generation. Glslang proper requires use of a number of licenses, one that covers +preprocessing and others that covers non-preprocessing. + +Bison was removed long ago. You can build glslang from the source grammar, +using tools of your choice, without using bison or any bison files. + +Other parts, outside of glslang proper, include: + +- gl_types.h, only needed for OpenGL-like reflection, and can be left out of + a parse and codegen project. See it for its license. + +- update_glslang_sources.py, which is not part of the project proper and does + not need to be used. + +- the SPIR-V "remapper", which is optional, but has the same license as + glslang proper + +- Google tests and SPIR-V tools, and anything in the external subdirectory + are external and optional; see them for their respective licenses. + +-------------------------------------------------------------------------------- + +The core of glslang-proper, minus the preprocessor is licenced as follows: + +-------------------------------------------------------------------------------- +3-Clause BSD License +-------------------------------------------------------------------------------- + +// +// Copyright (C) 2015-2018 Google, Inc. +// Copyright (C) +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + + +-------------------------------------------------------------------------------- +2-Clause BSD License +-------------------------------------------------------------------------------- + +Copyright 2020 The Khronos Group Inc + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +The MIT License +-------------------------------------------------------------------------------- + +Copyright 2020 The Khronos Group Inc + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +-------------------------------------------------------------------------------- +APACHE LICENSE, VERSION 2.0 +-------------------------------------------------------------------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +-------------------------------------------------------------------------------- +GPL 3 with special bison exception +-------------------------------------------------------------------------------- + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + +Bison Exception + +As a special exception, you may create a larger work that contains part or all +of the Bison parser skeleton and distribute that work under terms of your +choice, so long as that work isn't itself a parser generator using the skeleton +or a modified version thereof as a parser skeleton. Alternatively, if you +modify or redistribute the parser skeleton itself, you may (at your option) +remove this special exception, which will cause the skeleton and the resulting +Bison output files to be licensed under the GNU General Public License without +this special exception. + +This special exception was added by the Free Software Foundation in version +2.2 of Bison. + + END OF TERMS AND CONDITIONS + +-------------------------------------------------------------------------------- +================================================================================ +-------------------------------------------------------------------------------- + +The preprocessor has the core licenses stated above, plus additional licences: + +/****************************************************************************\ +Copyright (c) 2002, NVIDIA Corporation. + +NVIDIA Corporation("NVIDIA") supplies this software to you in +consideration of your agreement to the following terms, and your use, +installation, modification or redistribution of this NVIDIA software +constitutes acceptance of these terms. If you do not agree with these +terms, please do not use, install, modify or redistribute this NVIDIA +software. + +In consideration of your agreement to abide by the following terms, and +subject to these terms, NVIDIA grants you a personal, non-exclusive +license, under NVIDIA's copyrights in this original NVIDIA software (the +"NVIDIA Software"), to use, reproduce, modify and redistribute the +NVIDIA Software, with or without modifications, in source and/or binary +forms; provided that if you redistribute the NVIDIA Software, you must +retain the copyright notice of NVIDIA, this notice and the following +text and disclaimers in all such redistributions of the NVIDIA Software. +Neither the name, trademarks, service marks nor logos of NVIDIA +Corporation may be used to endorse or promote products derived from the +NVIDIA Software without specific prior written permission from NVIDIA. +Except as expressly stated in this notice, no other rights or licenses +express or implied, are granted by NVIDIA herein, including but not +limited to any patent rights that may be infringed by your derivative +works or by other works in which the NVIDIA Software may be +incorporated. No hardware is licensed hereunder. + +THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, +INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER +PRODUCTS. + +IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, +INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY +OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE +NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, +TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF +NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\****************************************************************************/ + +/* +** Copyright (c) 2014-2016 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/README.md b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/README.md new file mode 100755 index 0000000000..e712cc3d4e --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/README.md @@ -0,0 +1,540 @@ +![Continuous Integration](https://github.com/KhronosGroup/glslang/actions/workflows/continuous_integration.yml/badge.svg) +![Continuous Deployment](https://github.com/KhronosGroup/glslang/actions/workflows/continuous_deployment.yml/badge.svg) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/KhronosGroup/glslang/badge)](https://securityscorecards.dev/viewer/?uri=github.com/KhronosGroup/glslang) + +# News + +1. Building glslang as a DLL or shared library is now possible and supported. + +2. The `GenericCodeGen`, `MachineIndependent`, `OSDependent`, and `SPIRV` libraries have been integrated into the main `glslang` library. The old separate libraries have replaced with empty stubs for a temporary compatibility period, and they will be removed entirely in the future. + +3. A new CMake `ENABLE_SPIRV` option has been added to control whether glslang is built with SPIR-V support. Its default value is `ON`. + +4. `OGLCompiler` and `HLSL` stub libraries have been fully removed from the build. + +# Glslang Components and Status + +There are several components: + +### Reference Validator and GLSL/ESSL -> AST Front End + +An OpenGL GLSL and OpenGL|ES GLSL (ESSL) front-end for reference validation and translation of GLSL/ESSL into an internal abstract syntax tree (AST). + +**Status**: Virtually complete, with results carrying similar weight as the specifications. + +### HLSL -> AST Front End + +An HLSL front-end for translation of an approximation of HLSL to glslang's AST form. + +**Status**: Partially complete. Semantics are not reference quality and input is not validated. +This is in contrast to the [DXC project](https://github.com/Microsoft/DirectXShaderCompiler), which receives a much larger investment and attempts to have definitive/reference-level semantics. + +See [issue 362](https://github.com/KhronosGroup/glslang/issues/362) and [issue 701](https://github.com/KhronosGroup/glslang/issues/701) for current status. + +### AST -> SPIR-V Back End + +Translates glslang's AST to the Khronos-specified SPIR-V intermediate language. + +**Status**: Virtually complete. + +### Reflector + +An API for getting reflection information from the AST, reflection types/variables/etc. from the HLL source (not the SPIR-V). + +**Status**: There is a large amount of functionality present, but no specification/goal to measure completeness against. It is accurate for the input HLL and AST, but only approximate for what would later be emitted for SPIR-V. + +### Standalone Wrapper + +`glslang` is command-line tool for accessing the functionality above. + +Status: Complete. + +Tasks waiting to be done are documented as GitHub issues. + +## Other References + +Also see the Khronos landing page for glslang as a reference front end: + +https://www.khronos.org/opengles/sdk/tools/Reference-Compiler/ + +The above page, while not kept up to date, includes additional information regarding glslang as a reference validator. + +# How to Use Glslang + +## Execution of Standalone Wrapper + +To use the standalone binary form, execute `glslang`, and it will print +a usage statement. Basic operation is to give it a file containing a shader, +and it will print out warnings/errors and optionally an AST. + +The applied stage-specific rules are based on the file extension: +* `.vert` for a vertex shader +* `.tesc` for a tessellation control shader +* `.tese` for a tessellation evaluation shader +* `.geom` for a geometry shader +* `.frag` for a fragment shader +* `.comp` for a compute shader + +For ray tracing pipeline shaders: +* `.rgen` for a ray generation shader +* `.rint` for a ray intersection shader +* `.rahit` for a ray any-hit shader +* `.rchit` for a ray closest-hit shader +* `.rmiss` for a ray miss shader +* `.rcall` for a callable shader + +There is also a non-shader extension: +* `.conf` for a configuration file of limits, see usage statement for example + +## Building (CMake) + +Instead of building manually, you can also download the binaries for your +platform directly from the [main-tot release][main-tot-release] on GitHub. +Those binaries are automatically uploaded by the buildbots after successful +testing and they always reflect the current top of the tree of the main +branch. + +### Dependencies + +* A C++17 compiler. + (For MSVS: use 2019 or later.) +* [CMake][cmake]: for generating compilation targets. +* make: _Linux_, ninja is an alternative, if configured. +* [Python 3.x][python]: for executing SPIRV-Tools scripts. (Optional if not using SPIRV-Tools and the 'External' subdirectory does not exist.) +* [bison][bison]: _optional_, but needed when changing the grammar (glslang.y). +* [googletest][googletest]: _optional_, but should use if making any changes to glslang. + +### Build steps + +The following steps assume a Bash shell. On Windows, that could be the Git Bash +shell or some other shell of your choosing. + +#### 1) Check-Out this project + +```bash +cd +git clone https://github.com/KhronosGroup/glslang.git +``` + +#### 2) Check-Out External Projects + +```bash +./update_glslang_sources.py +``` + +#### 3) Configure + +Assume the source directory is `$SOURCE_DIR` and the build directory is `$BUILD_DIR`. +CMake will create the `$BUILD_DIR` for the user if it doesn't exist. + +First change your working directory: +```bash +cd $SOURCE_DIR +``` + +For building on Linux: + +```bash +cmake -B $BUILD_DIR -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$(pwd)/install" +# "Release" (for CMAKE_BUILD_TYPE) could also be "Debug" or "RelWithDebInfo" +``` + +For building on Android: +```bash +cmake -B $BUILD_DIR -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DANDROID_ABI=arm64-v8a -DCMAKE_BUILD_TYPE=Release -DANDROID_STL=c++_static -DANDROID_PLATFORM=android-24 -DCMAKE_SYSTEM_NAME=Android -DANDROID_TOOLCHAIN=clang -DANDROID_ARM_MODE=arm -DCMAKE_MAKE_PROGRAM=$ANDROID_NDK_HOME/prebuilt/linux-x86_64/bin/make -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake +# If on Windows will be -DCMAKE_MAKE_PROGRAM=%ANDROID_NDK_HOME%\prebuilt\windows-x86_64\bin\make.exe +# -G is needed for building on Windows +# -DANDROID_ABI can also be armeabi-v7a for 32 bit +``` + +For building on Windows: + +```bash +cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX="$(pwd)/install" +# The CMAKE_INSTALL_PREFIX part is for testing (explained later). +``` + +Also, consider using `git config --global core.fileMode false` (or with `--local`) on Windows +to prevent the addition of execution permission on files. + +#### 4) Build and Install + +```bash +# for Linux: +make -j4 install + +# for Windows: +cmake --build . --config Release --target install +# "Release" (for --config) could also be "Debug", "MinSizeRel", or "RelWithDebInfo" +``` + +If using MSVC, after running CMake to configure, use the +Configuration Manager to check the `INSTALL` project. + +### Building (GN) + +glslang can also be built with the [GN build system](https://gn.googlesource.com/gn/). + +#### 1) Install `depot_tools` + +Download [depot_tools.zip](https://storage.googleapis.com/chrome-infra/depot_tools.zip), +extract to a directory, and add this directory to your `PATH`. + +#### 2) Synchronize dependencies and generate build files + +This only needs to be done once after updating `glslang`. + +With the current directory set to your `glslang` checkout, type: + +```bash +./update_glslang_sources.py +gclient sync --gclientfile=standalone.gclient +gn gen out/Default +``` + +#### 3) Build + +With the current directory set to your `glslang` checkout, type: + +```bash +cd out/Default +ninja +``` + +### If you need to change the GLSL grammar + +The grammar in `glslang/MachineIndependent/glslang.y` has to be recompiled with +bison if it changes, the output files are committed to the repo to avoid every +developer needing to have bison configured to compile the project when grammar +changes are quite infrequent. For windows you can get binaries from +[GnuWin32][bison-gnu-win32]. + +The command to rebuild is: + +```bash +bison --defines=MachineIndependent/glslang_tab.cpp.h + -t MachineIndependent/glslang.y + -o MachineIndependent/glslang_tab.cpp +``` + +The above command is also available in the bash script in `updateGrammar`, +when executed from the glslang subdirectory of the glslang repository. + +### Building to WASM for the Web and Node +### Building a standalone JS/WASM library for the Web and Node + +Use the steps in [Build Steps](#build-steps), with the following notes/exceptions: +* `emsdk` needs to be present in your executable search path, *PATH* for + Bash-like environments: + + [Instructions located here](https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install) +* Wrap cmake call: `emcmake cmake` +* Set `-DENABLE_OPT=OFF`. +* Set `-DENABLE_HLSL=OFF` if HLSL is not needed. +* For a standalone JS/WASM library, turn on `-DENABLE_GLSLANG_JS=ON`. +* To get a fully minimized build, make sure to use `brotli` to compress the .js + and .wasm files +* Note that by default, Emscripten allocates a very small stack size, which may + cause stack overflows when compiling large shaders. Use the + [STACK_SIZE](https://emscripten.org/docs/tools_reference/settings_reference.html?highlight=environment#stack-size) + compiler setting to increase the stack size. + +Example: + +```sh +emcmake cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GLSLANG_JS=ON \ + -DENABLE_HLSL=OFF -DENABLE_OPT=OFF .. +``` + +## Building glslang - Using vcpkg + +You can download and install glslang using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager: + + git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg + ./bootstrap-vcpkg.sh + ./vcpkg integrate install + ./vcpkg install glslang + +The glslang port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. + +## Testing + +Right now, there are two test harnesses existing in glslang: one is [Google +Test](gtests/), one is the [`runtests` script](Test/runtests). The former +runs unit tests and single-shader single-threaded integration tests, while +the latter runs multiple-shader linking tests and multi-threaded tests. + +Tests may erroneously fail or pass if using `ALLOW_EXTERNAL_SPIRV_TOOLS` with +any commit other than the one specified in `known_good.json`. + +### Running tests + +The [`runtests` script](Test/runtests) requires compiled binaries to be +installed into `$BUILD_DIR/install`. Please make sure you have supplied the +correct configuration to CMake (using `-DCMAKE_INSTALL_PREFIX`) when building; +otherwise, you may want to modify the path in the `runtests` script. + +Running Google Test-backed tests: + +```bash +cd $BUILD_DIR + +# for Linux: +ctest + +# for Windows: +ctest -C {Debug|Release|RelWithDebInfo|MinSizeRel} + +# or, run the test binary directly +# (which gives more fine-grained control like filtering): +/glslangtests +``` + +Running `runtests` script-backed tests: + +```bash +cd $SOURCE_DIR/Test && ./runtests +``` + +If some tests fail with validation errors, there may be a mismatch between the +version of `spirv-val` on the system and the version of glslang. In this +case, it is necessary to run `update_glslang_sources.py`. See "Check-Out +External Projects" above for more details. + +### Contributing tests + +Test results should always be included with a pull request that modifies +functionality. + +If you are writing unit tests, please use the Google Test framework and +place the tests under the `gtests/` directory. + +Integration tests are placed in the `Test/` directory. It contains test input +and a subdirectory `baseResults/` that contains the expected results of the +tests. Both the tests and `baseResults/` are under source-code control. + +Google Test runs those integration tests by reading the test input, compiling +them, and then compare against the expected results in `baseResults/`. The +integration tests to run via Google Test is registered in various +`gtests/*.FromFile.cpp` source files. `glslangtests` provides a command-line +option `--update-mode`, which, if supplied, will overwrite the golden files +under the `baseResults/` directory with real output from that invocation. +For more information, please check `gtests/` directory's +[README](gtests/README.md). + +For the `runtests` script, it will generate current results in the +`localResults/` directory and `diff` them against the `baseResults/`. +When you want to update the tracked test results, they need to be +copied from `localResults/` to `baseResults/`. This can be done by +the `bump` shell script. + +You can add your own private list of tests, not tracked publicly, by using +`localtestlist` to list non-tracked tests. This is automatically read +by `runtests` and included in the `diff` and `bump` process. + +## Programmatic Interfaces + +Another piece of software can programmatically translate shaders to an AST +using one of two different interfaces: +* A new C++ class-oriented interface, or +* The original C functional interface + +The `main()` in `StandAlone/StandAlone.cpp` shows examples using both styles. + +### C++ Class Interface (new, preferred) + +This interface is in roughly the last 1/3 of `ShaderLang.h`. It is in the +glslang namespace and contains the following, here with suggested calls +for generating SPIR-V: + +```cxx +const char* GetEsslVersionString(); +const char* GetGlslVersionString(); +bool InitializeProcess(); +void FinalizeProcess(); + +class TShader + setStrings(...); + setEnvInput(EShSourceHlsl or EShSourceGlsl, stage, EShClientVulkan or EShClientOpenGL, 100); + setEnvClient(EShClientVulkan or EShClientOpenGL, EShTargetVulkan_1_0 or EShTargetVulkan_1_1 or EShTargetOpenGL_450); + setEnvTarget(EShTargetSpv, EShTargetSpv_1_0 or EShTargetSpv_1_3); + bool parse(...); + const char* getInfoLog(); + +class TProgram + void addShader(...); + bool link(...); + const char* getInfoLog(); + Reflection queries +``` + +For just validating (not generating code), substitute these calls: + +```cxx + setEnvInput(EShSourceHlsl or EShSourceGlsl, stage, EShClientNone, 0); + setEnvClient(EShClientNone, 0); + setEnvTarget(EShTargetNone, 0); +``` + +See `ShaderLang.h` and the usage of it in `StandAlone/StandAlone.cpp` for more +details. There is a block comment giving more detail above the calls for +`setEnvInput, setEnvClient, and setEnvTarget`. + +### C Functional Interface (original) + +This interface is in roughly the first 2/3 of `ShaderLang.h`, and referred to +as the `Sh*()` interface, as all the entry points start `Sh`. + +The `Sh*()` interface takes a "compiler" call-back object, which it calls after +building call back that is passed the AST and can then execute a back end on it. + +The following is a simplified resulting run-time call stack: + +```c +ShCompile(shader, compiler) -> compiler(AST) -> +``` + +In practice, `ShCompile()` takes shader strings, default version, and +warning/error and other options for controlling compilation. + +### C Functional Interface (new) + +This interface is located `glslang_c_interface.h` and exposes functionality similar to the C++ interface. The following snippet is a complete example showing how to compile GLSL into SPIR-V 1.5 for Vulkan 1.2. + +```c +#include + +// Required for use of glslang_default_resource +#include + +typedef struct SpirVBinary { + uint32_t *words; // SPIR-V words + int size; // number of words in SPIR-V binary +} SpirVBinary; + +SpirVBinary compileShaderToSPIRV_Vulkan(glslang_stage_t stage, const char* shaderSource, const char* fileName) { + const glslang_input_t input = { + .language = GLSLANG_SOURCE_GLSL, + .stage = stage, + .client = GLSLANG_CLIENT_VULKAN, + .client_version = GLSLANG_TARGET_VULKAN_1_2, + .target_language = GLSLANG_TARGET_SPV, + .target_language_version = GLSLANG_TARGET_SPV_1_5, + .code = shaderSource, + .default_version = 100, + .default_profile = GLSLANG_NO_PROFILE, + .force_default_version_and_profile = false, + .forward_compatible = false, + .messages = GLSLANG_MSG_DEFAULT_BIT, + .resource = glslang_default_resource(), + }; + + glslang_shader_t* shader = glslang_shader_create(&input); + + SpirVBinary bin = { + .words = NULL, + .size = 0, + }; + if (!glslang_shader_preprocess(shader, &input)) { + printf("GLSL preprocessing failed %s\n", fileName); + printf("%s\n", glslang_shader_get_info_log(shader)); + printf("%s\n", glslang_shader_get_info_debug_log(shader)); + printf("%s\n", input.code); + glslang_shader_delete(shader); + return bin; + } + + if (!glslang_shader_parse(shader, &input)) { + printf("GLSL parsing failed %s\n", fileName); + printf("%s\n", glslang_shader_get_info_log(shader)); + printf("%s\n", glslang_shader_get_info_debug_log(shader)); + printf("%s\n", glslang_shader_get_preprocessed_code(shader)); + glslang_shader_delete(shader); + return bin; + } + + glslang_program_t* program = glslang_program_create(); + glslang_program_add_shader(program, shader); + + if (!glslang_program_link(program, GLSLANG_MSG_SPV_RULES_BIT | GLSLANG_MSG_VULKAN_RULES_BIT)) { + printf("GLSL linking failed %s\n", fileName); + printf("%s\n", glslang_program_get_info_log(program)); + printf("%s\n", glslang_program_get_info_debug_log(program)); + glslang_program_delete(program); + glslang_shader_delete(shader); + return bin; + } + + glslang_program_SPIRV_generate(program, stage); + + bin.size = glslang_program_SPIRV_get_size(program); + bin.words = malloc(bin.size * sizeof(uint32_t)); + glslang_program_SPIRV_get(program, bin.words); + + const char* spirv_messages = glslang_program_SPIRV_get_messages(program); + if (spirv_messages) + printf("(%s) %s\b", fileName, spirv_messages); + + glslang_program_delete(program); + glslang_shader_delete(shader); + + return bin; +} +``` + +## Basic Internal Operation + +* Initial lexical analysis is done by the preprocessor in + `MachineIndependent/Preprocessor`, and then refined by a GLSL scanner + in `MachineIndependent/Scan.cpp`. There is currently no use of flex. + +* Code is parsed using bison on `MachineIndependent/glslang.y` with the + aid of a symbol table and an AST. The symbol table is not passed on to + the back-end; the intermediate representation stands on its own. + The tree is built by the grammar productions, many of which are + offloaded into `ParseHelper.cpp`, and by `Intermediate.cpp`. + +* The intermediate representation is very high-level, and represented + as an in-memory tree. This serves to lose no information from the + original program, and to have efficient transfer of the result from + parsing to the back-end. In the AST, constants are propagated and + folded, and a very small amount of dead code is eliminated. + + To aid linking and reflection, the last top-level branch in the AST + lists all global symbols. + +* The primary algorithm of the back-end compiler is to traverse the + tree (high-level intermediate representation), and create an internal + object code representation. There is an example of how to do this + in `MachineIndependent/intermOut.cpp`. + +* Reduction of the tree to a linear byte-code style low-level intermediate + representation is likely a good way to generate fully optimized code. + +* There is currently some dead old-style linker-type code still lying around. + +* Memory pool: parsing uses types derived from C++ `std` types, using a + custom allocator that puts them in a memory pool. This makes allocation + of individual container/contents just few cycles and deallocation free. + This pool is popped after the AST is made and processed. + + The use is simple: if you are going to call `new`, there are three cases: + + - the object comes from the pool (its base class has the macro + `POOL_ALLOCATOR_NEW_DELETE` in it) and you do not have to call `delete` + + - it is a `TString`, in which case call `NewPoolTString()`, which gets + it from the pool, and there is no corresponding `delete` + + - the object does not come from the pool, and you have to do normal + C++ memory management of what you `new` + +* Features can be protected by version/extension/stage/profile: + See the comment in `glslang/MachineIndependent/Versions.cpp`. + +[cmake]: https://cmake.org/ +[python]: https://www.python.org/ +[bison]: https://www.gnu.org/software/bison/ +[googletest]: https://github.com/google/googletest +[bison-gnu-win32]: http://gnuwin32.sourceforge.net/packages/bison.htm +[main-tot-release]: https://github.com/KhronosGroup/glslang/releases/tag/main-tot diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/REUSE.toml b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/REUSE.toml new file mode 100644 index 0000000000..de224cfd71 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/REUSE.toml @@ -0,0 +1,13 @@ +version = 1 + +[[annotations]] +path = ["**"] +precedence = "closest" +SPDX-FileCopyrightText = ["Copyright (c) 2017, 2019 ARM Limited", + "Copyright (c) 2002-2005 3 Dlabs Inc. Ltd.", + "Copyright (c) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.", + "Copyright (c) 2014-2018 Google, Inc.", + "Copyright (c) 2002 NVIDIA Corporation", + "Copyright (c) 2002-2010 The ANGLE Project", + "Copyright (c) 2014-2019 The Khronos Group Inc."] +SPDX-License-Identifier = "BSD-3-Clause AND LicenseRef-MIT-Khronos-old AND Apache-2.0 AND GPL-3.0-or-later WITH Bison-exception-2.2 AND AML-glslang" diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/CInterface/spirv_c_interface.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/CInterface/spirv_c_interface.cpp new file mode 100644 index 0000000000..631d19d799 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/CInterface/spirv_c_interface.cpp @@ -0,0 +1,122 @@ +/** + This code is based on the glslang_c_interface implementation by Viktor Latypov +**/ + +/** +BSD 2-Clause License + +Copyright (c) 2019, Viktor Latypov +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +#include "glslang/Include/glslang_c_interface.h" + +#include +#include "glslang/Public/ShaderLang.h" +#include "SPIRV/GlslangToSpv.h" +#include "SPIRV/Logger.h" +#include "SPIRV/SpvTools.h" + +static_assert(sizeof(glslang_spv_options_t) == sizeof(glslang::SpvOptions), ""); + +typedef struct glslang_program_s { + glslang::TProgram* program; + std::vector spirv; + std::string loggerMessages; +} glslang_program_t; + +static EShLanguage c_shader_stage(glslang_stage_t stage) +{ + switch (stage) { + case GLSLANG_STAGE_VERTEX: + return EShLangVertex; + case GLSLANG_STAGE_TESSCONTROL: + return EShLangTessControl; + case GLSLANG_STAGE_TESSEVALUATION: + return EShLangTessEvaluation; + case GLSLANG_STAGE_GEOMETRY: + return EShLangGeometry; + case GLSLANG_STAGE_FRAGMENT: + return EShLangFragment; + case GLSLANG_STAGE_COMPUTE: + return EShLangCompute; + case GLSLANG_STAGE_RAYGEN: + return EShLangRayGen; + case GLSLANG_STAGE_INTERSECT: + return EShLangIntersect; + case GLSLANG_STAGE_ANYHIT: + return EShLangAnyHit; + case GLSLANG_STAGE_CLOSESTHIT: + return EShLangClosestHit; + case GLSLANG_STAGE_MISS: + return EShLangMiss; + case GLSLANG_STAGE_CALLABLE: + return EShLangCallable; + case GLSLANG_STAGE_TASK: + return EShLangTask; + case GLSLANG_STAGE_MESH: + return EShLangMesh; + default: + break; + } + return EShLangCount; +} + +GLSLANG_EXPORT void glslang_program_SPIRV_generate(glslang_program_t* program, glslang_stage_t stage) +{ + glslang_spv_options_t spv_options {}; + spv_options.disable_optimizer = true; + spv_options.validate = true; + + glslang_program_SPIRV_generate_with_options(program, stage, &spv_options); +} + +GLSLANG_EXPORT void glslang_program_SPIRV_generate_with_options(glslang_program_t* program, glslang_stage_t stage, glslang_spv_options_t* spv_options) { + spv::SpvBuildLogger logger; + + const glslang::TIntermediate* intermediate = program->program->getIntermediate(c_shader_stage(stage)); + + program->spirv.clear(); + + glslang::GlslangToSpv(*intermediate, program->spirv, &logger, reinterpret_cast(spv_options)); + + program->loggerMessages = logger.getAllMessages(); +} + +GLSLANG_EXPORT size_t glslang_program_SPIRV_get_size(glslang_program_t* program) { return program->spirv.size(); } + +GLSLANG_EXPORT void glslang_program_SPIRV_get(glslang_program_t* program, unsigned int* out) +{ + memcpy(out, program->spirv.data(), program->spirv.size() * sizeof(unsigned int)); +} + +GLSLANG_EXPORT unsigned int* glslang_program_SPIRV_get_ptr(glslang_program_t* program) +{ + return program->spirv.data(); +} + +GLSLANG_EXPORT const char* glslang_program_SPIRV_get_messages(glslang_program_t* program) +{ + return program->loggerMessages.empty() ? nullptr : program->loggerMessages.c_str(); +} diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.ext.AMD.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.ext.AMD.h new file mode 100644 index 0000000000..009d2f1cf0 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.ext.AMD.h @@ -0,0 +1,108 @@ +/* +** Copyright (c) 2014-2016 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +#ifndef GLSLextAMD_H +#define GLSLextAMD_H + +static const int GLSLextAMDVersion = 100; +static const int GLSLextAMDRevision = 7; + +// SPV_AMD_shader_ballot +static const char* const E_SPV_AMD_shader_ballot = "SPV_AMD_shader_ballot"; + +enum ShaderBallotAMD { + ShaderBallotBadAMD = 0, // Don't use + + SwizzleInvocationsAMD = 1, + SwizzleInvocationsMaskedAMD = 2, + WriteInvocationAMD = 3, + MbcntAMD = 4, + + ShaderBallotCountAMD +}; + +// SPV_AMD_shader_trinary_minmax +static const char* const E_SPV_AMD_shader_trinary_minmax = "SPV_AMD_shader_trinary_minmax"; + +enum ShaderTrinaryMinMaxAMD { + ShaderTrinaryMinMaxBadAMD = 0, // Don't use + + FMin3AMD = 1, + UMin3AMD = 2, + SMin3AMD = 3, + FMax3AMD = 4, + UMax3AMD = 5, + SMax3AMD = 6, + FMid3AMD = 7, + UMid3AMD = 8, + SMid3AMD = 9, + + ShaderTrinaryMinMaxCountAMD +}; + +// SPV_AMD_shader_explicit_vertex_parameter +static const char* const E_SPV_AMD_shader_explicit_vertex_parameter = "SPV_AMD_shader_explicit_vertex_parameter"; + +enum ShaderExplicitVertexParameterAMD { + ShaderExplicitVertexParameterBadAMD = 0, // Don't use + + InterpolateAtVertexAMD = 1, + + ShaderExplicitVertexParameterCountAMD +}; + +// SPV_AMD_gcn_shader +static const char* const E_SPV_AMD_gcn_shader = "SPV_AMD_gcn_shader"; + +enum GcnShaderAMD { + GcnShaderBadAMD = 0, // Don't use + + CubeFaceIndexAMD = 1, + CubeFaceCoordAMD = 2, + TimeAMD = 3, + + GcnShaderCountAMD +}; + +// SPV_AMD_gpu_shader_half_float +static const char* const E_SPV_AMD_gpu_shader_half_float = "SPV_AMD_gpu_shader_half_float"; + +// SPV_AMD_texture_gather_bias_lod +static const char* const E_SPV_AMD_texture_gather_bias_lod = "SPV_AMD_texture_gather_bias_lod"; + +// SPV_AMD_gpu_shader_int16 +static const char* const E_SPV_AMD_gpu_shader_int16 = "SPV_AMD_gpu_shader_int16"; + +// SPV_AMD_shader_image_load_store_lod +static const char* const E_SPV_AMD_shader_image_load_store_lod = "SPV_AMD_shader_image_load_store_lod"; + +// SPV_AMD_shader_fragment_mask +static const char* const E_SPV_AMD_shader_fragment_mask = "SPV_AMD_shader_fragment_mask"; + +// SPV_AMD_gpu_shader_half_float_fetch +static const char* const E_SPV_AMD_gpu_shader_half_float_fetch = "SPV_AMD_gpu_shader_half_float_fetch"; + +#endif // #ifndef GLSLextAMD_H diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.ext.ARM.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.ext.ARM.h new file mode 100644 index 0000000000..eef5b03e10 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.ext.ARM.h @@ -0,0 +1,37 @@ +/* +** Copyright (c) 2022, 2025 ARM Limited +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +#ifndef GLSLextARM_H +#define GLSLextARM_H + +static const int GLSLextARMVersion = 100; +static const int GLSLextARMRevision = 2; + +static const char* const E_SPV_ARM_core_builtins = "SPV_ARM_core_builtins"; +static const char* const E_SPV_ARM_cooperative_matrix_layouts = "SPV_ARM_cooperative_matrix_layouts"; +static const char* const E_SPV_ARM_tensors = "SPV_ARM_tensors"; + +#endif // #ifndef GLSLextARM_H diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.ext.EXT.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.ext.EXT.h new file mode 100644 index 0000000000..a5c242526d --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.ext.EXT.h @@ -0,0 +1,48 @@ +/* +** Copyright (c) 2014-2016 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +#ifndef GLSLextEXT_H +#define GLSLextEXT_H + +static const int GLSLextEXTVersion = 100; +static const int GLSLextEXTRevision = 2; + +static const char* const E_SPV_EXT_shader_stencil_export = "SPV_EXT_shader_stencil_export"; +static const char* const E_SPV_EXT_shader_viewport_index_layer = "SPV_EXT_shader_viewport_index_layer"; +static const char* const E_SPV_EXT_fragment_fully_covered = "SPV_EXT_fragment_fully_covered"; +static const char* const E_SPV_EXT_fragment_invocation_density = "SPV_EXT_fragment_invocation_density"; +static const char* const E_SPV_EXT_demote_to_helper_invocation = "SPV_EXT_demote_to_helper_invocation"; +static const char* const E_SPV_EXT_shader_atomic_float_add = "SPV_EXT_shader_atomic_float_add"; +static const char* const E_SPV_EXT_shader_atomic_float16_add = "SPV_EXT_shader_atomic_float16_add"; +static const char* const E_SPV_EXT_shader_atomic_float_min_max = "SPV_EXT_shader_atomic_float_min_max"; +static const char* const E_SPV_EXT_shader_image_int64 = "SPV_EXT_shader_image_int64"; +static const char* const E_SPV_EXT_shader_tile_image = "SPV_EXT_shader_tile_image"; +static const char* const E_SPV_EXT_mesh_shader = "SPV_EXT_mesh_shader"; +static const char* const E_SPV_EXT_float8 = "SPV_EXT_float8"; +static const char* const E_SPV_EXT_shader_64bit_indexing = "SPV_EXT_shader_64bit_indexing"; +static const char* const E_SPV_EXT_shader_invocation_reorder = "SPV_EXT_shader_invocation_reorder"; + +#endif // #ifndef GLSLextEXT_H diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h new file mode 100644 index 0000000000..25dd88ff27 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h @@ -0,0 +1,70 @@ +/* +** Copyright (c) 2014-2020 The Khronos Group Inc. +** Copyright (C) 2022-2024 Arm Limited. +** Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +#ifndef GLSLextKHR_H +#define GLSLextKHR_H + +static const int GLSLextKHRVersion = 100; +static const int GLSLextKHRRevision = 3; + +static const char* const E_SPV_KHR_shader_ballot = "SPV_KHR_shader_ballot"; +static const char* const E_SPV_KHR_subgroup_vote = "SPV_KHR_subgroup_vote"; +static const char* const E_SPV_KHR_device_group = "SPV_KHR_device_group"; +static const char* const E_SPV_KHR_multiview = "SPV_KHR_multiview"; +static const char* const E_SPV_KHR_shader_draw_parameters = "SPV_KHR_shader_draw_parameters"; +static const char* const E_SPV_KHR_16bit_storage = "SPV_KHR_16bit_storage"; +static const char* const E_SPV_KHR_8bit_storage = "SPV_KHR_8bit_storage"; +static const char* const E_SPV_KHR_storage_buffer_storage_class = "SPV_KHR_storage_buffer_storage_class"; +static const char* const E_SPV_KHR_post_depth_coverage = "SPV_KHR_post_depth_coverage"; +static const char* const E_SPV_KHR_vulkan_memory_model = "SPV_KHR_vulkan_memory_model"; +static const char* const E_SPV_EXT_physical_storage_buffer = "SPV_EXT_physical_storage_buffer"; +static const char* const E_SPV_KHR_physical_storage_buffer = "SPV_KHR_physical_storage_buffer"; +static const char* const E_SPV_EXT_fragment_shader_interlock = "SPV_EXT_fragment_shader_interlock"; +static const char* const E_SPV_KHR_shader_clock = "SPV_KHR_shader_clock"; +static const char* const E_SPV_KHR_non_semantic_info = "SPV_KHR_non_semantic_info"; +static const char* const E_SPV_KHR_ray_tracing = "SPV_KHR_ray_tracing"; +static const char* const E_SPV_KHR_ray_query = "SPV_KHR_ray_query"; +static const char* const E_SPV_KHR_fragment_shading_rate = "SPV_KHR_fragment_shading_rate"; +static const char* const E_SPV_KHR_terminate_invocation = "SPV_KHR_terminate_invocation"; +static const char* const E_SPV_KHR_workgroup_memory_explicit_layout = "SPV_KHR_workgroup_memory_explicit_layout"; +static const char* const E_SPV_KHR_subgroup_uniform_control_flow = "SPV_KHR_subgroup_uniform_control_flow"; +static const char* const E_SPV_KHR_fragment_shader_barycentric = "SPV_KHR_fragment_shader_barycentric"; +static const char* const E_SPV_KHR_quad_control = "SPV_KHR_quad_control"; +static const char* const E_SPV_AMD_shader_early_and_late_fragment_tests = "SPV_AMD_shader_early_and_late_fragment_tests"; +static const char* const E_SPV_KHR_ray_tracing_position_fetch = "SPV_KHR_ray_tracing_position_fetch"; +static const char* const E_SPV_KHR_cooperative_matrix = "SPV_KHR_cooperative_matrix"; +static const char* const E_SPV_KHR_maximal_reconvergence = "SPV_KHR_maximal_reconvergence"; +static const char* const E_SPV_KHR_subgroup_rotate = "SPV_KHR_subgroup_rotate"; +static const char* const E_SPV_KHR_expect_assume = "SPV_KHR_expect_assume"; +static const char* const E_SPV_EXT_replicated_composites = "SPV_EXT_replicated_composites"; +static const char* const E_SPV_KHR_relaxed_extended_instruction = "SPV_KHR_relaxed_extended_instruction"; +static const char* const E_SPV_KHR_integer_dot_product = "SPV_KHR_integer_dot_product"; +static const char* const E_SPV_NV_cooperative_vector = "SPV_NV_cooperative_vector"; +static const char* const E_SPV_KHR_bfloat16 = "SPV_KHR_bfloat16"; + +#endif // #ifndef GLSLextKHR_H diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.ext.NV.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.ext.NV.h new file mode 100644 index 0000000000..4516d2d546 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.ext.NV.h @@ -0,0 +1,104 @@ +/* +** Copyright (c) 2014-2017 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +#ifndef GLSLextNV_H +#define GLSLextNV_H + +enum class BuiltIn : unsigned; +enum class Decoration : unsigned; +enum class Op : unsigned; +enum class Capability : unsigned; + +static const int GLSLextNVVersion = 100; +static const int GLSLextNVRevision = 11; + +//SPV_NV_sample_mask_override_coverage +const char* const E_SPV_NV_sample_mask_override_coverage = "SPV_NV_sample_mask_override_coverage"; + +//SPV_NV_geometry_shader_passthrough +const char* const E_SPV_NV_geometry_shader_passthrough = "SPV_NV_geometry_shader_passthrough"; + +//SPV_NV_viewport_array2 +const char* const E_SPV_NV_viewport_array2 = "SPV_NV_viewport_array2"; +const char* const E_ARB_shader_viewport_layer_array = "SPV_ARB_shader_viewport_layer_array"; + +//SPV_NV_stereo_view_rendering +const char* const E_SPV_NV_stereo_view_rendering = "SPV_NV_stereo_view_rendering"; + +//SPV_NVX_multiview_per_view_attributes +const char* const E_SPV_NVX_multiview_per_view_attributes = "SPV_NVX_multiview_per_view_attributes"; + +//SPV_NV_shader_subgroup_partitioned +const char* const E_SPV_NV_shader_subgroup_partitioned = "SPV_NV_shader_subgroup_partitioned"; + +//SPV_NV_fragment_shader_barycentric +const char* const E_SPV_NV_fragment_shader_barycentric = "SPV_NV_fragment_shader_barycentric"; + +//SPV_NV_compute_shader_derivatives +const char* const E_SPV_NV_compute_shader_derivatives = "SPV_NV_compute_shader_derivatives"; + +//SPV_NV_shader_image_footprint +const char* const E_SPV_NV_shader_image_footprint = "SPV_NV_shader_image_footprint"; + +//SPV_NV_mesh_shader +const char* const E_SPV_NV_mesh_shader = "SPV_NV_mesh_shader"; + +//SPV_NV_raytracing +const char* const E_SPV_NV_ray_tracing = "SPV_NV_ray_tracing"; + +//SPV_NV_ray_tracing_motion_blur +const char* const E_SPV_NV_ray_tracing_motion_blur = "SPV_NV_ray_tracing_motion_blur"; + +//SPV_NV_shading_rate +const char* const E_SPV_NV_shading_rate = "SPV_NV_shading_rate"; + +//SPV_NV_cooperative_matrix +const char* const E_SPV_NV_cooperative_matrix = "SPV_NV_cooperative_matrix"; + +//SPV_NV_shader_sm_builtins +const char* const E_SPV_NV_shader_sm_builtins = "SPV_NV_shader_sm_builtins"; + +//SPV_NV_shader_execution_reorder +const char* const E_SPV_NV_shader_invocation_reorder = "SPV_NV_shader_invocation_reorder"; + +//SPV_NV_displacement_micromap +const char* const E_SPV_NV_displacement_micromap = "SPV_NV_displacement_micromap"; + +//SPV_NV_shader_atomic_fp16_vector +const char* const E_SPV_NV_shader_atomic_fp16_vector = "SPV_NV_shader_atomic_fp16_vector"; + +//SPV_NV_tensor_addressing +const char* const E_SPV_NV_tensor_addressing = "SPV_NV_tensor_addressing"; + +//SPV_NV_cooperative_matrix2 +const char* const E_SPV_NV_cooperative_matrix2 = "SPV_NV_cooperative_matrix2"; + +//SPV_NV_cluster_acceleration_structure +const char* const E_SPV_NV_cluster_acceleration_structure = "SPV_NV_cluster_acceleration_structure"; + +//SPV_NV_linear_swept_spheres +const char* const E_SPV_NV_linear_swept_spheres = "SPV_NV_linear_swept_spheres"; +#endif // #ifndef GLSLextNV_H diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.ext.QCOM.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.ext.QCOM.h new file mode 100644 index 0000000000..7633d4079f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.ext.QCOM.h @@ -0,0 +1,48 @@ +/* +** Copyright (c) 2021 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +#ifndef GLSLextQCOM_H +#define GLSLextQCOM_H + +enum class BuiltIn : unsigned; +enum class Decoration : unsigned; +enum class Op : unsigned; +enum class Capability : unsigned; + +static const int GLSLextQCOMVersion = 100; +static const int GLSLextQCOMRevision = 1; + +//SPV_QCOM_image_processing +const char* const E_SPV_QCOM_image_processing = "SPV_QCOM_image_processing"; +//SPV_QCOM_image_processing2 +const char* const E_SPV_QCOM_image_processing2 = "SPV_QCOM_image_processing2"; +//SPV_QCOM_cooperative_matrix_conversion +const char* const E_SPV_QCOM_cooperative_matrix_conversion = "SPV_QCOM_cooperative_matrix_conversion"; + +//SPV_QCOM_tile_shading +const char* const E_SPV_QCOM_tile_shading = "SPV_QCOM_tile_shading"; + +#endif // #ifndef GLSLextQCOM_H diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.std.450.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.std.450.h new file mode 100644 index 0000000000..86d3da8065 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GLSL.std.450.h @@ -0,0 +1,131 @@ +/* +** Copyright (c) 2014-2016 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +#ifndef GLSLstd450_H +#define GLSLstd450_H + +static const int GLSLstd450Version = 100; +static const int GLSLstd450Revision = 1; + +enum GLSLstd450 { + GLSLstd450Bad = 0, // Don't use + + GLSLstd450Round = 1, + GLSLstd450RoundEven = 2, + GLSLstd450Trunc = 3, + GLSLstd450FAbs = 4, + GLSLstd450SAbs = 5, + GLSLstd450FSign = 6, + GLSLstd450SSign = 7, + GLSLstd450Floor = 8, + GLSLstd450Ceil = 9, + GLSLstd450Fract = 10, + + GLSLstd450Radians = 11, + GLSLstd450Degrees = 12, + GLSLstd450Sin = 13, + GLSLstd450Cos = 14, + GLSLstd450Tan = 15, + GLSLstd450Asin = 16, + GLSLstd450Acos = 17, + GLSLstd450Atan = 18, + GLSLstd450Sinh = 19, + GLSLstd450Cosh = 20, + GLSLstd450Tanh = 21, + GLSLstd450Asinh = 22, + GLSLstd450Acosh = 23, + GLSLstd450Atanh = 24, + GLSLstd450Atan2 = 25, + + GLSLstd450Pow = 26, + GLSLstd450Exp = 27, + GLSLstd450Log = 28, + GLSLstd450Exp2 = 29, + GLSLstd450Log2 = 30, + GLSLstd450Sqrt = 31, + GLSLstd450InverseSqrt = 32, + + GLSLstd450Determinant = 33, + GLSLstd450MatrixInverse = 34, + + GLSLstd450Modf = 35, // second operand needs an OpVariable to write to + GLSLstd450ModfStruct = 36, // no OpVariable operand + GLSLstd450FMin = 37, + GLSLstd450UMin = 38, + GLSLstd450SMin = 39, + GLSLstd450FMax = 40, + GLSLstd450UMax = 41, + GLSLstd450SMax = 42, + GLSLstd450FClamp = 43, + GLSLstd450UClamp = 44, + GLSLstd450SClamp = 45, + GLSLstd450FMix = 46, + GLSLstd450IMix = 47, // Reserved + GLSLstd450Step = 48, + GLSLstd450SmoothStep = 49, + + GLSLstd450Fma = 50, + GLSLstd450Frexp = 51, // second operand needs an OpVariable to write to + GLSLstd450FrexpStruct = 52, // no OpVariable operand + GLSLstd450Ldexp = 53, + + GLSLstd450PackSnorm4x8 = 54, + GLSLstd450PackUnorm4x8 = 55, + GLSLstd450PackSnorm2x16 = 56, + GLSLstd450PackUnorm2x16 = 57, + GLSLstd450PackHalf2x16 = 58, + GLSLstd450PackDouble2x32 = 59, + GLSLstd450UnpackSnorm2x16 = 60, + GLSLstd450UnpackUnorm2x16 = 61, + GLSLstd450UnpackHalf2x16 = 62, + GLSLstd450UnpackSnorm4x8 = 63, + GLSLstd450UnpackUnorm4x8 = 64, + GLSLstd450UnpackDouble2x32 = 65, + + GLSLstd450Length = 66, + GLSLstd450Distance = 67, + GLSLstd450Cross = 68, + GLSLstd450Normalize = 69, + GLSLstd450FaceForward = 70, + GLSLstd450Reflect = 71, + GLSLstd450Refract = 72, + + GLSLstd450FindILsb = 73, + GLSLstd450FindSMsb = 74, + GLSLstd450FindUMsb = 75, + + GLSLstd450InterpolateAtCentroid = 76, + GLSLstd450InterpolateAtSample = 77, + GLSLstd450InterpolateAtOffset = 78, + + GLSLstd450NMin = 79, + GLSLstd450NMax = 80, + GLSLstd450NClamp = 81, + + GLSLstd450Count +}; + +#endif // #ifndef GLSLstd450_H diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GlslangToSpv.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GlslangToSpv.cpp new file mode 100644 index 0000000000..12c5484aec --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GlslangToSpv.cpp @@ -0,0 +1,11575 @@ +// +// Copyright (C) 2014-2016 LunarG, Inc. +// Copyright (C) 2015-2020 Google, Inc. +// Copyright (C) 2017, 2022-2025 Arm Limited. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// +// Visit the nodes in the glslang intermediate tree representation to +// translate them to SPIR-V. +// + +#include "spirv.hpp11" +#include "GlslangToSpv.h" +#include "SpvBuilder.h" +#include "SpvTools.h" +#include "spvUtil.h" + +namespace spv { + #include "GLSL.std.450.h" + #include "GLSL.ext.KHR.h" + #include "GLSL.ext.EXT.h" + #include "GLSL.ext.AMD.h" + #include "GLSL.ext.NV.h" + #include "GLSL.ext.ARM.h" + #include "GLSL.ext.QCOM.h" + #include "NonSemanticDebugPrintf.h" +} + +// Glslang includes +#include "../glslang/MachineIndependent/localintermediate.h" +#include "../glslang/MachineIndependent/SymbolTable.h" +#include "../glslang/Include/Common.h" + +// Build-time generated includes +#include "glslang/build_info.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace { + +namespace { +class SpecConstantOpModeGuard { +public: + SpecConstantOpModeGuard(spv::Builder* builder) + : builder_(builder) { + previous_flag_ = builder->isInSpecConstCodeGenMode(); + } + ~SpecConstantOpModeGuard() { + previous_flag_ ? builder_->setToSpecConstCodeGenMode() + : builder_->setToNormalCodeGenMode(); + } + void turnOnSpecConstantOpMode() { + builder_->setToSpecConstCodeGenMode(); + } + +private: + spv::Builder* builder_; + bool previous_flag_; +}; + +struct OpDecorations { + public: + OpDecorations(spv::Decoration precision, spv::Decoration noContraction, spv::Decoration nonUniform) : + precision(precision) + , + noContraction(noContraction), + nonUniform(nonUniform) + { } + + spv::Decoration precision; + + void addNoContraction(spv::Builder& builder, spv::Id t) { builder.addDecoration(t, noContraction); } + void addNonUniform(spv::Builder& builder, spv::Id t) { builder.addDecoration(t, nonUniform); } + protected: + spv::Decoration noContraction; + spv::Decoration nonUniform; +}; + +} // namespace + +using namespace QtShaderTools; + +// +// The main holder of information for translating glslang to SPIR-V. +// +// Derives from the AST walking base class. +// +class TGlslangToSpvTraverser : public glslang::TIntermTraverser { +public: + TGlslangToSpvTraverser(unsigned int spvVersion, const glslang::TIntermediate*, spv::SpvBuildLogger* logger, + glslang::SpvOptions& options); + virtual ~TGlslangToSpvTraverser() { } + + bool visitAggregate(glslang::TVisit, glslang::TIntermAggregate*) override; + bool visitBinary(glslang::TVisit, glslang::TIntermBinary*) override; + void visitConstantUnion(glslang::TIntermConstantUnion*) override; + bool visitSelection(glslang::TVisit, glslang::TIntermSelection*) override; + bool visitSwitch(glslang::TVisit, glslang::TIntermSwitch*) override; + void visitSymbol(glslang::TIntermSymbol* symbol) override; + bool visitUnary(glslang::TVisit, glslang::TIntermUnary*) override; + bool visitLoop(glslang::TVisit, glslang::TIntermLoop*) override; + bool visitBranch(glslang::TVisit visit, glslang::TIntermBranch*) override; + bool visitVariableDecl(glslang::TVisit, glslang::TIntermVariableDecl*) override; + + void finishSpv(bool compileOnly); + void dumpSpv(std::vector& out); + +protected: + TGlslangToSpvTraverser(TGlslangToSpvTraverser&); + TGlslangToSpvTraverser& operator=(TGlslangToSpvTraverser&); + + spv::Decoration TranslateInterpolationDecoration(const glslang::TQualifier& qualifier); + spv::Decoration TranslateAuxiliaryStorageDecoration(const glslang::TQualifier& qualifier); + spv::Decoration TranslateNonUniformDecoration(const glslang::TQualifier& qualifier); + spv::Decoration TranslateNonUniformDecoration(const spv::Builder::AccessChain::CoherentFlags& coherentFlags); + spv::Builder::AccessChain::CoherentFlags TranslateCoherent(const glslang::TType& type); + spv::MemoryAccessMask TranslateMemoryAccess(const spv::Builder::AccessChain::CoherentFlags &coherentFlags); + spv::ImageOperandsMask TranslateImageOperands(const spv::Builder::AccessChain::CoherentFlags &coherentFlags); + spv::Scope TranslateMemoryScope(const spv::Builder::AccessChain::CoherentFlags &coherentFlags); + spv::BuiltIn TranslateBuiltInDecoration(glslang::TBuiltInVariable, bool memberDeclaration); + spv::ImageFormat TranslateImageFormat(const glslang::TType& type); + spv::SelectionControlMask TranslateSelectionControl(const glslang::TIntermSelection&) const; + spv::SelectionControlMask TranslateSwitchControl(const glslang::TIntermSwitch&) const; + spv::LoopControlMask TranslateLoopControl(const glslang::TIntermLoop&, std::vector& operands) const; + spv::StorageClass TranslateStorageClass(const glslang::TType&); + void TranslateLiterals(const glslang::TVector&, std::vector&) const; + void addIndirectionIndexCapabilities(const glslang::TType& baseType, const glslang::TType& indexType); + spv::Id createSpvVariable(const glslang::TIntermSymbol*, spv::Id forcedType); + spv::Id getSampledType(const glslang::TSampler&); + spv::Id getInvertedSwizzleType(const glslang::TIntermTyped&); + spv::Id createInvertedSwizzle(spv::Decoration precision, const glslang::TIntermTyped&, spv::Id parentResult); + void convertSwizzle(const glslang::TIntermAggregate&, std::vector& swizzle); + spv::Id convertGlslangToSpvType(const glslang::TType& type, bool forwardReferenceOnly = false); + spv::Id convertGlslangToSpvType(const glslang::TType& type, glslang::TLayoutPacking, const glslang::TQualifier&, + bool lastBufferBlockMember, bool forwardReferenceOnly = false); + void applySpirvDecorate(const glslang::TType& type, spv::Id id, std::optional member); + bool filterMember(const glslang::TType& member); + spv::Id convertGlslangStructToSpvType(const glslang::TType&, const glslang::TTypeList* glslangStruct, + glslang::TLayoutPacking, const glslang::TQualifier&); + spv::LinkageType convertGlslangLinkageToSpv(glslang::TLinkType glslangLinkType); + void decorateStructType(const glslang::TType&, const glslang::TTypeList* glslangStruct, glslang::TLayoutPacking, + const glslang::TQualifier&, spv::Id, const std::vector& spvMembers); + spv::Id makeArraySizeId(const glslang::TArraySizes&, int dim, bool allowZero = false, bool boolType = false); + spv::Id accessChainLoad(const glslang::TType& type); + void accessChainStore(const glslang::TType& type, spv::Id rvalue); + void multiTypeStore(const glslang::TType&, spv::Id rValue); + spv::Id convertLoadedBoolInUniformToUint(const glslang::TType& type, spv::Id nominalTypeId, spv::Id loadedId); + glslang::TLayoutPacking getExplicitLayout(const glslang::TType& type) const; + int getArrayStride(const glslang::TType& arrayType, glslang::TLayoutPacking, glslang::TLayoutMatrix); + int getMatrixStride(const glslang::TType& matrixType, glslang::TLayoutPacking, glslang::TLayoutMatrix); + void updateMemberOffset(const glslang::TType& structType, const glslang::TType& memberType, int& currentOffset, + int& nextOffset, glslang::TLayoutPacking, glslang::TLayoutMatrix); + void declareUseOfStructMember(const glslang::TTypeList& members, int glslangMember); + + bool isShaderEntryPoint(const glslang::TIntermAggregate* node); + bool writableParam(glslang::TStorageQualifier) const; + bool originalParam(glslang::TStorageQualifier, const glslang::TType&, bool implicitThisParam); + void makeFunctions(const glslang::TIntermSequence&); + void makeGlobalInitializers(const glslang::TIntermSequence&); + void collectRayTracingLinkerObjects(); + void visitFunctions(const glslang::TIntermSequence&); + void translateArguments(const glslang::TIntermAggregate& node, std::vector& arguments, + spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags); + void translateArguments(glslang::TIntermUnary& node, std::vector& arguments); + spv::Id createImageTextureFunctionCall(glslang::TIntermOperator* node); + spv::Id handleUserFunctionCall(const glslang::TIntermAggregate*); + + spv::Id createBinaryOperation(glslang::TOperator op, OpDecorations&, spv::Id typeId, spv::Id left, spv::Id right, + glslang::TBasicType typeProxy, bool reduceComparison = true); + spv::Id createBinaryMatrixOperation(spv::Op, OpDecorations&, spv::Id typeId, spv::Id left, spv::Id right); + spv::Id createUnaryOperation(glslang::TOperator op, OpDecorations&, spv::Id typeId, spv::Id operand, + glslang::TBasicType typeProxy, + const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags, + const glslang::TType &opType); + spv::Id createUnaryMatrixOperation(spv::Op op, OpDecorations&, spv::Id typeId, spv::Id operand, + glslang::TBasicType typeProxy); + spv::Id createConversion(glslang::TOperator op, OpDecorations&, spv::Id destTypeId, spv::Id operand, + glslang::TBasicType resultBasicType, glslang::TBasicType operandBasicType); + spv::Id createIntWidthConversion(spv::Id operand, int vectorSize, spv::Id destType, + glslang::TBasicType resultBasicType, glslang::TBasicType operandBasicType); + spv::Id makeSmearedConstant(spv::Id constant, int vectorSize); + spv::Id createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, + std::vector& operands, glslang::TBasicType typeProxy, + const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags, + const glslang::TType &opType); + spv::Id createInvocationsOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, + glslang::TBasicType typeProxy); + spv::Id CreateInvocationsVectorOperation(spv::Op op, spv::GroupOperation groupOperation, + spv::Id typeId, std::vector& operands); + spv::Id createSubgroupOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, + glslang::TBasicType typeProxy); + spv::Id createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, + std::vector& operands, glslang::TBasicType typeProxy); + spv::Id createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId); + spv::Id getSymbolId(const glslang::TIntermSymbol* node); + void addMeshNVDecoration(spv::Id id, int member, const glslang::TQualifier & qualifier); + bool hasQCOMImageProceessingDecoration(spv::Id id, spv::Decoration decor); + void addImageProcessingQCOMDecoration(spv::Id id, spv::Decoration decor); + void addImageProcessing2QCOMDecoration(spv::Id id, bool isForGather); + spv::Id createSpvConstant(const glslang::TIntermTyped&); + spv::Id createSpvConstantFromConstUnionArray(const glslang::TType& type, const glslang::TConstUnionArray&, + int& nextConst, bool specConstant); + bool isTrivialLeaf(const glslang::TIntermTyped* node); + bool isTrivial(const glslang::TIntermTyped* node); + spv::Id createShortCircuit(glslang::TOperator, glslang::TIntermTyped& left, glslang::TIntermTyped& right); + spv::Id getExtBuiltins(const char* name); + std::pair getForcedType(glslang::TBuiltInVariable builtIn, const glslang::TType&); + spv::Id translateForcedType(spv::Id object); + spv::Id createCompositeConstruct(spv::Id typeId, std::vector constituents); + + glslang::SpvOptions& options; + spv::Function* shaderEntry; + spv::Function* currentFunction; + spv::Instruction* entryPoint; + int sequenceDepth; + + spv::SpvBuildLogger* logger; + + // There is a 1:1 mapping between a spv builder and a module; this is thread safe + spv::Builder builder; + bool inEntryPoint; + bool entryPointTerminated; + bool linkageOnly; // true when visiting the set of objects in the AST present only for + // establishing interface, whether or not they were statically used + std::set iOSet; // all input/output variables from either static use or declaration of interface + const glslang::TIntermediate* glslangIntermediate; + bool nanMinMaxClamp; // true if use NMin/NMax/NClamp instead of FMin/FMax/FClamp + spv::Id stdBuiltins; + spv::Id nonSemanticDebugPrintf; + std::unordered_map extBuiltinMap; + + std::unordered_map symbolValues; + std::unordered_map builtInVariableIds; + std::unordered_set rValueParameters; // set of formal function parameters passed as rValues, + // rather than a pointer + std::unordered_map functionMap; + std::unordered_map structMap[glslang::ElpCount][glslang::ElmCount]; + // for mapping glslang block indices to spv indices (e.g., due to hidden members): + std::unordered_map> memberRemapper; + // for mapping glslang symbol struct to symbol Id + std::unordered_map glslangTypeToIdMap; + std::stack breakForLoop; // false means break for switch + std::unordered_map counterOriginator; + // Map pointee types for EbtReference to their forward pointers + std::map forwardPointers; + // Type forcing, for when SPIR-V wants a different type than the AST, + // requiring local translation to and from SPIR-V type on every access. + // Maps AST-required-type-id> + std::unordered_map forceType; + // Used by Task shader while generating opearnds for OpEmitMeshTasksEXT + spv::Id taskPayloadID; + // Used later for generating OpTraceKHR/OpExecuteCallableKHR/OpHitObjectRecordHit*/OpHitObjectGetShaderBindingTableData + std::unordered_map locationToSymbol[4]; + std::unordered_map > idToQCOMDecorations; +}; + +// +// Helper functions for translating glslang representations to SPIR-V enumerants. +// + +// Translate glslang profile to SPIR-V source language. +spv::SourceLanguage TranslateSourceLanguage(glslang::EShSource source, EProfile profile) +{ + switch (source) { + case glslang::EShSourceGlsl: + switch (profile) { + case ENoProfile: + case ECoreProfile: + case ECompatibilityProfile: + return spv::SourceLanguage::GLSL; + case EEsProfile: + return spv::SourceLanguage::ESSL; + default: + return spv::SourceLanguage::Unknown; + } + case glslang::EShSourceHlsl: + return spv::SourceLanguage::HLSL; + default: + return spv::SourceLanguage::Unknown; + } +} + +// Translate glslang language (stage) to SPIR-V execution model. +spv::ExecutionModel TranslateExecutionModel(EShLanguage stage, bool isMeshShaderEXT = false) +{ + switch (stage) { + case EShLangVertex: return spv::ExecutionModel::Vertex; + case EShLangFragment: return spv::ExecutionModel::Fragment; + case EShLangCompute: return spv::ExecutionModel::GLCompute; + case EShLangTessControl: return spv::ExecutionModel::TessellationControl; + case EShLangTessEvaluation: return spv::ExecutionModel::TessellationEvaluation; + case EShLangGeometry: return spv::ExecutionModel::Geometry; + case EShLangRayGen: return spv::ExecutionModel::RayGenerationKHR; + case EShLangIntersect: return spv::ExecutionModel::IntersectionKHR; + case EShLangAnyHit: return spv::ExecutionModel::AnyHitKHR; + case EShLangClosestHit: return spv::ExecutionModel::ClosestHitKHR; + case EShLangMiss: return spv::ExecutionModel::MissKHR; + case EShLangCallable: return spv::ExecutionModel::CallableKHR; + case EShLangTask: return (isMeshShaderEXT)? spv::ExecutionModel::TaskEXT : spv::ExecutionModel::TaskNV; + case EShLangMesh: return (isMeshShaderEXT)? spv::ExecutionModel::MeshEXT : spv::ExecutionModel::MeshNV; + default: + assert(0); + return spv::ExecutionModel::Fragment; + } +} + +// Translate glslang sampler type to SPIR-V dimensionality. +spv::Dim TranslateDimensionality(const glslang::TSampler& sampler) +{ + switch (sampler.dim) { + case glslang::Esd1D: return spv::Dim::Dim1D; + case glslang::Esd2D: return spv::Dim::Dim2D; + case glslang::Esd3D: return spv::Dim::Dim3D; + case glslang::EsdCube: return spv::Dim::Cube; + case glslang::EsdRect: return spv::Dim::Rect; + case glslang::EsdBuffer: return spv::Dim::Buffer; + case glslang::EsdSubpass: return spv::Dim::SubpassData; + case glslang::EsdAttachmentEXT: return spv::Dim::TileImageDataEXT; + default: + assert(0); + return spv::Dim::Dim2D; + } +} + +// Translate glslang precision to SPIR-V precision decorations. +spv::Decoration TranslatePrecisionDecoration(glslang::TPrecisionQualifier glslangPrecision) +{ + switch (glslangPrecision) { + case glslang::EpqLow: return spv::Decoration::RelaxedPrecision; + case glslang::EpqMedium: return spv::Decoration::RelaxedPrecision; + default: + return spv::NoPrecision; + } +} + +// Translate glslang type to SPIR-V precision decorations. +spv::Decoration TranslatePrecisionDecoration(const glslang::TType& type) +{ + return TranslatePrecisionDecoration(type.getQualifier().precision); +} + +// Translate glslang type to SPIR-V block decorations. +spv::Decoration TranslateBlockDecoration(const glslang::TStorageQualifier storage, bool useStorageBuffer) +{ + switch (storage) { + case glslang::EvqUniform: return spv::Decoration::Block; + case glslang::EvqBuffer: return useStorageBuffer ? spv::Decoration::Block : spv::Decoration::BufferBlock; + case glslang::EvqVaryingIn: return spv::Decoration::Block; + case glslang::EvqVaryingOut: return spv::Decoration::Block; + case glslang::EvqShared: return spv::Decoration::Block; + case glslang::EvqPayload: return spv::Decoration::Block; + case glslang::EvqPayloadIn: return spv::Decoration::Block; + case glslang::EvqHitAttr: return spv::Decoration::Block; + case glslang::EvqCallableData: return spv::Decoration::Block; + case glslang::EvqCallableDataIn: return spv::Decoration::Block; + case glslang::EvqHitObjectAttrNV: return spv::Decoration::Block; + case glslang::EvqHitObjectAttrEXT: return spv::Decoration::Block; + default: + assert(0); + break; + } + + return spv::Decoration::Max; +} + +// Translate glslang type to SPIR-V memory decorations. +void TranslateMemoryDecoration(const glslang::TQualifier& qualifier, std::vector& memory, + bool useVulkanMemoryModel) +{ + if (!useVulkanMemoryModel) { + if (qualifier.isVolatile()) { + memory.push_back(spv::Decoration::Volatile); + memory.push_back(spv::Decoration::Coherent); + } else if (qualifier.isCoherent()) { + memory.push_back(spv::Decoration::Coherent); + } + } + if (qualifier.isRestrict()) + memory.push_back(spv::Decoration::Restrict); + if (qualifier.isReadOnly()) + memory.push_back(spv::Decoration::NonWritable); + if (qualifier.isWriteOnly()) + memory.push_back(spv::Decoration::NonReadable); +} + +// Translate glslang type to SPIR-V layout decorations. +spv::Decoration TranslateLayoutDecoration(const glslang::TType& type, glslang::TLayoutMatrix matrixLayout) +{ + if (type.isMatrix()) { + switch (matrixLayout) { + case glslang::ElmRowMajor: + return spv::Decoration::RowMajor; + case glslang::ElmColumnMajor: + return spv::Decoration::ColMajor; + default: + // opaque layouts don't need a majorness + return spv::Decoration::Max; + } + } else { + switch (type.getBasicType()) { + default: + return spv::Decoration::Max; + break; + case glslang::EbtBlock: + switch (type.getQualifier().storage) { + case glslang::EvqShared: + case glslang::EvqUniform: + case glslang::EvqBuffer: + switch (type.getQualifier().layoutPacking) { + case glslang::ElpShared: return spv::Decoration::GLSLShared; + case glslang::ElpPacked: return spv::Decoration::GLSLPacked; + default: + return spv::Decoration::Max; + } + case glslang::EvqVaryingIn: + case glslang::EvqVaryingOut: + if (type.getQualifier().isTaskMemory()) { + switch (type.getQualifier().layoutPacking) { + case glslang::ElpShared: return spv::Decoration::GLSLShared; + case glslang::ElpPacked: return spv::Decoration::GLSLPacked; + default: break; + } + } else { + assert(type.getQualifier().layoutPacking == glslang::ElpNone); + } + return spv::Decoration::Max; + case glslang::EvqPayload: + case glslang::EvqPayloadIn: + case glslang::EvqHitAttr: + case glslang::EvqCallableData: + case glslang::EvqCallableDataIn: + case glslang::EvqHitObjectAttrNV: + case glslang::EvqHitObjectAttrEXT: + return spv::Decoration::Max; + default: + assert(0); + return spv::Decoration::Max; + } + } + } +} + +// Translate glslang type to SPIR-V interpolation decorations. +// Returns spv::Decoration::Max when no decoration +// should be applied. +spv::Decoration TGlslangToSpvTraverser::TranslateInterpolationDecoration(const glslang::TQualifier& qualifier) +{ + if (qualifier.smooth) + // Smooth decoration doesn't exist in SPIR-V 1.0 + return spv::Decoration::Max; + else if (qualifier.isNonPerspective()) + return spv::Decoration::NoPerspective; + else if (qualifier.flat) + return spv::Decoration::Flat; + else if (qualifier.isExplicitInterpolation()) { + builder.addExtension(spv::E_SPV_AMD_shader_explicit_vertex_parameter); + return spv::Decoration::ExplicitInterpAMD; + } + else + return spv::Decoration::Max; +} + +// Translate glslang type to SPIR-V auxiliary storage decorations. +// Returns spv::Decoration::Max when no decoration +// should be applied. +spv::Decoration TGlslangToSpvTraverser::TranslateAuxiliaryStorageDecoration(const glslang::TQualifier& qualifier) +{ + if (qualifier.centroid) + return spv::Decoration::Centroid; + else if (qualifier.patch) + return spv::Decoration::Patch; + else if (qualifier.sample) { + builder.addCapability(spv::Capability::SampleRateShading); + return spv::Decoration::Sample; + } + + return spv::Decoration::Max; +} + +// If glslang type is invariant, return SPIR-V invariant decoration. +spv::Decoration TranslateInvariantDecoration(const glslang::TQualifier& qualifier) +{ + if (qualifier.invariant) + return spv::Decoration::Invariant; + else + return spv::Decoration::Max; +} + +// If glslang type is noContraction, return SPIR-V NoContraction decoration. +spv::Decoration TranslateNoContractionDecoration(const glslang::TQualifier& qualifier) +{ + if (qualifier.isNoContraction()) + return spv::Decoration::NoContraction; + else + return spv::Decoration::Max; +} + +// If glslang type is nonUniform, return SPIR-V NonUniform decoration. +spv::Decoration TGlslangToSpvTraverser::TranslateNonUniformDecoration(const glslang::TQualifier& qualifier) +{ + if (qualifier.isNonUniform()) { + builder.addIncorporatedExtension("SPV_EXT_descriptor_indexing", spv::Spv_1_5); + builder.addCapability(spv::Capability::ShaderNonUniformEXT); + return spv::Decoration::NonUniformEXT; + } else + return spv::Decoration::Max; +} + +// If lvalue flags contains nonUniform, return SPIR-V NonUniform decoration. +spv::Decoration TGlslangToSpvTraverser::TranslateNonUniformDecoration( + const spv::Builder::AccessChain::CoherentFlags& coherentFlags) +{ + if (coherentFlags.isNonUniform()) { + builder.addIncorporatedExtension("SPV_EXT_descriptor_indexing", spv::Spv_1_5); + builder.addCapability(spv::Capability::ShaderNonUniformEXT); + return spv::Decoration::NonUniformEXT; + } else + return spv::Decoration::Max; +} + +spv::MemoryAccessMask TGlslangToSpvTraverser::TranslateMemoryAccess( + const spv::Builder::AccessChain::CoherentFlags &coherentFlags) +{ + spv::MemoryAccessMask mask = spv::MemoryAccessMask::MaskNone; + + if (!glslangIntermediate->usingVulkanMemoryModel() || coherentFlags.isImage) + return mask; + + if (coherentFlags.isVolatile() || coherentFlags.anyCoherent()) { + mask = mask | spv::MemoryAccessMask::MakePointerAvailableKHR | + spv::MemoryAccessMask::MakePointerVisibleKHR; + } + + if (coherentFlags.nonprivate) { + mask = mask | spv::MemoryAccessMask::NonPrivatePointerKHR; + } + if (coherentFlags.volatil) { + mask = mask | spv::MemoryAccessMask::Volatile; + } + if (coherentFlags.nontemporal) { + mask = mask | spv::MemoryAccessMask::Nontemporal; + } + if (mask != spv::MemoryAccessMask::MaskNone) { + builder.addCapability(spv::Capability::VulkanMemoryModelKHR); + } + + return mask; +} + +spv::ImageOperandsMask TGlslangToSpvTraverser::TranslateImageOperands( + const spv::Builder::AccessChain::CoherentFlags &coherentFlags) +{ + spv::ImageOperandsMask mask = spv::ImageOperandsMask::MaskNone; + + if (!glslangIntermediate->usingVulkanMemoryModel()) + return mask; + + if (coherentFlags.volatil || + coherentFlags.anyCoherent()) { + mask = mask | spv::ImageOperandsMask::MakeTexelAvailableKHR | + spv::ImageOperandsMask::MakeTexelVisibleKHR; + } + if (coherentFlags.nonprivate) { + mask = mask | spv::ImageOperandsMask::NonPrivateTexelKHR; + } + if (coherentFlags.volatil) { + mask = mask | spv::ImageOperandsMask::VolatileTexelKHR; + } + if (coherentFlags.nontemporal && builder.getSpvVersion() >= spv::Spv_1_6) { + mask = mask | spv::ImageOperandsMask::Nontemporal; + } + if (mask != spv::ImageOperandsMask::MaskNone) { + builder.addCapability(spv::Capability::VulkanMemoryModelKHR); + } + + return mask; +} + +spv::Builder::AccessChain::CoherentFlags TGlslangToSpvTraverser::TranslateCoherent(const glslang::TType& type) +{ + spv::Builder::AccessChain::CoherentFlags flags = {}; + flags.coherent = type.getQualifier().coherent; + flags.devicecoherent = type.getQualifier().devicecoherent; + flags.queuefamilycoherent = type.getQualifier().queuefamilycoherent; + // shared variables are implicitly workgroupcoherent in GLSL. + flags.workgroupcoherent = type.getQualifier().workgroupcoherent || + type.getQualifier().storage == glslang::EvqShared; + flags.subgroupcoherent = type.getQualifier().subgroupcoherent; + flags.shadercallcoherent = type.getQualifier().shadercallcoherent; + flags.volatil = type.getQualifier().volatil; + flags.nontemporal = type.getQualifier().nontemporal; + // *coherent variables are implicitly nonprivate in GLSL + flags.nonprivate = type.getQualifier().nonprivate || + flags.anyCoherent() || + flags.volatil; + flags.isImage = type.getBasicType() == glslang::EbtSampler; + flags.nonUniform = type.getQualifier().nonUniform; + return flags; +} + +spv::Scope TGlslangToSpvTraverser::TranslateMemoryScope( + const spv::Builder::AccessChain::CoherentFlags &coherentFlags) +{ + spv::Scope scope = spv::Scope::Max; + + if (coherentFlags.volatil || coherentFlags.coherent) { + // coherent defaults to Device scope in the old model, QueueFamilyKHR scope in the new model + scope = glslangIntermediate->usingVulkanMemoryModel() ? spv::Scope::QueueFamilyKHR : spv::Scope::Device; + } else if (coherentFlags.devicecoherent) { + scope = spv::Scope::Device; + } else if (coherentFlags.queuefamilycoherent) { + scope = spv::Scope::QueueFamilyKHR; + } else if (coherentFlags.workgroupcoherent) { + scope = spv::Scope::Workgroup; + } else if (coherentFlags.subgroupcoherent) { + scope = spv::Scope::Subgroup; + } else if (coherentFlags.shadercallcoherent) { + scope = spv::Scope::ShaderCallKHR; + } + if (glslangIntermediate->usingVulkanMemoryModel() && scope == spv::Scope::Device) { + builder.addCapability(spv::Capability::VulkanMemoryModelDeviceScopeKHR); + } + + return scope; +} + +// Translate a glslang built-in variable to a SPIR-V built in decoration. Also generate +// associated capabilities when required. For some built-in variables, a capability +// is generated only when using the variable in an executable instruction, but not when +// just declaring a struct member variable with it. This is true for PointSize, +// ClipDistance, and CullDistance. +spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltInVariable builtIn, + bool memberDeclaration) +{ + switch (builtIn) { + case glslang::EbvPointSize: + // Defer adding the capability until the built-in is actually used. + if (! memberDeclaration) { + switch (glslangIntermediate->getStage()) { + case EShLangGeometry: + builder.addCapability(spv::Capability::GeometryPointSize); + break; + case EShLangTessControl: + case EShLangTessEvaluation: + builder.addCapability(spv::Capability::TessellationPointSize); + break; + default: + break; + } + } + return spv::BuiltIn::PointSize; + + case glslang::EbvPosition: return spv::BuiltIn::Position; + case glslang::EbvVertexId: return spv::BuiltIn::VertexId; + case glslang::EbvInstanceId: return spv::BuiltIn::InstanceId; + case glslang::EbvVertexIndex: return spv::BuiltIn::VertexIndex; + case glslang::EbvInstanceIndex: return spv::BuiltIn::InstanceIndex; + + case glslang::EbvFragCoord: return spv::BuiltIn::FragCoord; + case glslang::EbvPointCoord: return spv::BuiltIn::PointCoord; + case glslang::EbvFace: return spv::BuiltIn::FrontFacing; + case glslang::EbvFragDepth: return spv::BuiltIn::FragDepth; + + case glslang::EbvNumWorkGroups: return spv::BuiltIn::NumWorkgroups; + case glslang::EbvWorkGroupSize: return spv::BuiltIn::WorkgroupSize; + case glslang::EbvWorkGroupId: return spv::BuiltIn::WorkgroupId; + case glslang::EbvLocalInvocationId: return spv::BuiltIn::LocalInvocationId; + case glslang::EbvLocalInvocationIndex: return spv::BuiltIn::LocalInvocationIndex; + case glslang::EbvGlobalInvocationId: return spv::BuiltIn::GlobalInvocationId; + + // These *Distance capabilities logically belong here, but if the member is declared and + // then never used, consumers of SPIR-V prefer the capability not be declared. + // They are now generated when used, rather than here when declared. + // Potentially, the specification should be more clear what the minimum + // use needed is to trigger the capability. + // + case glslang::EbvClipDistance: + if (!memberDeclaration) + builder.addCapability(spv::Capability::ClipDistance); + return spv::BuiltIn::ClipDistance; + + case glslang::EbvCullDistance: + if (!memberDeclaration) + builder.addCapability(spv::Capability::CullDistance); + return spv::BuiltIn::CullDistance; + + case glslang::EbvViewportIndex: + if (glslangIntermediate->getStage() == EShLangGeometry || + glslangIntermediate->getStage() == EShLangFragment) { + builder.addCapability(spv::Capability::MultiViewport); + } + if (glslangIntermediate->getStage() == EShLangVertex || + glslangIntermediate->getStage() == EShLangTessControl || + glslangIntermediate->getStage() == EShLangTessEvaluation) { + + if (builder.getSpvVersion() < spv::Spv_1_5) { + builder.addIncorporatedExtension(spv::E_SPV_EXT_shader_viewport_index_layer, spv::Spv_1_5); + builder.addCapability(spv::Capability::ShaderViewportIndexLayerEXT); + } + else + builder.addCapability(spv::Capability::ShaderViewportIndex); + } + return spv::BuiltIn::ViewportIndex; + + case glslang::EbvSampleId: + builder.addCapability(spv::Capability::SampleRateShading); + return spv::BuiltIn::SampleId; + + case glslang::EbvSamplePosition: + builder.addCapability(spv::Capability::SampleRateShading); + return spv::BuiltIn::SamplePosition; + + case glslang::EbvSampleMask: + return spv::BuiltIn::SampleMask; + + case glslang::EbvLayer: + if (glslangIntermediate->getStage() == EShLangMesh) { + return spv::BuiltIn::Layer; + } + if (glslangIntermediate->getStage() == EShLangGeometry || + glslangIntermediate->getStage() == EShLangFragment) { + builder.addCapability(spv::Capability::Geometry); + } + if (glslangIntermediate->getStage() == EShLangVertex || + glslangIntermediate->getStage() == EShLangTessControl || + glslangIntermediate->getStage() == EShLangTessEvaluation) { + + if (builder.getSpvVersion() < spv::Spv_1_5) { + builder.addIncorporatedExtension(spv::E_SPV_EXT_shader_viewport_index_layer, spv::Spv_1_5); + builder.addCapability(spv::Capability::ShaderViewportIndexLayerEXT); + } else + builder.addCapability(spv::Capability::ShaderLayer); + } + return spv::BuiltIn::Layer; + + case glslang::EbvBaseVertex: + builder.addIncorporatedExtension(spv::E_SPV_KHR_shader_draw_parameters, spv::Spv_1_3); + builder.addCapability(spv::Capability::DrawParameters); + return spv::BuiltIn::BaseVertex; + + case glslang::EbvBaseInstance: + builder.addIncorporatedExtension(spv::E_SPV_KHR_shader_draw_parameters, spv::Spv_1_3); + builder.addCapability(spv::Capability::DrawParameters); + return spv::BuiltIn::BaseInstance; + + case glslang::EbvDrawId: + builder.addIncorporatedExtension(spv::E_SPV_KHR_shader_draw_parameters, spv::Spv_1_3); + builder.addCapability(spv::Capability::DrawParameters); + return spv::BuiltIn::DrawIndex; + + case glslang::EbvPrimitiveId: + if (glslangIntermediate->getStage() == EShLangFragment) + builder.addCapability(spv::Capability::Geometry); + return spv::BuiltIn::PrimitiveId; + + case glslang::EbvFragStencilRef: + builder.addExtension(spv::E_SPV_EXT_shader_stencil_export); + builder.addCapability(spv::Capability::StencilExportEXT); + return spv::BuiltIn::FragStencilRefEXT; + + case glslang::EbvShadingRateKHR: + builder.addExtension(spv::E_SPV_KHR_fragment_shading_rate); + builder.addCapability(spv::Capability::FragmentShadingRateKHR); + return spv::BuiltIn::ShadingRateKHR; + + case glslang::EbvPrimitiveShadingRateKHR: + builder.addExtension(spv::E_SPV_KHR_fragment_shading_rate); + builder.addCapability(spv::Capability::FragmentShadingRateKHR); + return spv::BuiltIn::PrimitiveShadingRateKHR; + + case glslang::EbvInvocationId: return spv::BuiltIn::InvocationId; + case glslang::EbvTessLevelInner: return spv::BuiltIn::TessLevelInner; + case glslang::EbvTessLevelOuter: return spv::BuiltIn::TessLevelOuter; + case glslang::EbvTessCoord: return spv::BuiltIn::TessCoord; + case glslang::EbvPatchVertices: return spv::BuiltIn::PatchVertices; + case glslang::EbvHelperInvocation: return spv::BuiltIn::HelperInvocation; + + case glslang::EbvSubGroupSize: + builder.addExtension(spv::E_SPV_KHR_shader_ballot); + builder.addCapability(spv::Capability::SubgroupBallotKHR); + return spv::BuiltIn::SubgroupSize; + + case glslang::EbvSubGroupInvocation: + builder.addExtension(spv::E_SPV_KHR_shader_ballot); + builder.addCapability(spv::Capability::SubgroupBallotKHR); + return spv::BuiltIn::SubgroupLocalInvocationId; + + case glslang::EbvSubGroupEqMask: + builder.addExtension(spv::E_SPV_KHR_shader_ballot); + builder.addCapability(spv::Capability::SubgroupBallotKHR); + return spv::BuiltIn::SubgroupEqMask; + + case glslang::EbvSubGroupGeMask: + builder.addExtension(spv::E_SPV_KHR_shader_ballot); + builder.addCapability(spv::Capability::SubgroupBallotKHR); + return spv::BuiltIn::SubgroupGeMask; + + case glslang::EbvSubGroupGtMask: + builder.addExtension(spv::E_SPV_KHR_shader_ballot); + builder.addCapability(spv::Capability::SubgroupBallotKHR); + return spv::BuiltIn::SubgroupGtMask; + + case glslang::EbvSubGroupLeMask: + builder.addExtension(spv::E_SPV_KHR_shader_ballot); + builder.addCapability(spv::Capability::SubgroupBallotKHR); + return spv::BuiltIn::SubgroupLeMask; + + case glslang::EbvSubGroupLtMask: + builder.addExtension(spv::E_SPV_KHR_shader_ballot); + builder.addCapability(spv::Capability::SubgroupBallotKHR); + return spv::BuiltIn::SubgroupLtMask; + + case glslang::EbvNumSubgroups: + builder.addCapability(spv::Capability::GroupNonUniform); + return spv::BuiltIn::NumSubgroups; + + case glslang::EbvSubgroupID: + builder.addCapability(spv::Capability::GroupNonUniform); + return spv::BuiltIn::SubgroupId; + + case glslang::EbvSubgroupSize2: + builder.addCapability(spv::Capability::GroupNonUniform); + return spv::BuiltIn::SubgroupSize; + + case glslang::EbvSubgroupInvocation2: + builder.addCapability(spv::Capability::GroupNonUniform); + return spv::BuiltIn::SubgroupLocalInvocationId; + + case glslang::EbvSubgroupEqMask2: + builder.addCapability(spv::Capability::GroupNonUniform); + builder.addCapability(spv::Capability::GroupNonUniformBallot); + return spv::BuiltIn::SubgroupEqMask; + + case glslang::EbvSubgroupGeMask2: + builder.addCapability(spv::Capability::GroupNonUniform); + builder.addCapability(spv::Capability::GroupNonUniformBallot); + return spv::BuiltIn::SubgroupGeMask; + + case glslang::EbvSubgroupGtMask2: + builder.addCapability(spv::Capability::GroupNonUniform); + builder.addCapability(spv::Capability::GroupNonUniformBallot); + return spv::BuiltIn::SubgroupGtMask; + + case glslang::EbvSubgroupLeMask2: + builder.addCapability(spv::Capability::GroupNonUniform); + builder.addCapability(spv::Capability::GroupNonUniformBallot); + return spv::BuiltIn::SubgroupLeMask; + + case glslang::EbvSubgroupLtMask2: + builder.addCapability(spv::Capability::GroupNonUniform); + builder.addCapability(spv::Capability::GroupNonUniformBallot); + return spv::BuiltIn::SubgroupLtMask; + + case glslang::EbvBaryCoordNoPersp: + builder.addExtension(spv::E_SPV_AMD_shader_explicit_vertex_parameter); + return spv::BuiltIn::BaryCoordNoPerspAMD; + + case glslang::EbvBaryCoordNoPerspCentroid: + builder.addExtension(spv::E_SPV_AMD_shader_explicit_vertex_parameter); + return spv::BuiltIn::BaryCoordNoPerspCentroidAMD; + + case glslang::EbvBaryCoordNoPerspSample: + builder.addExtension(spv::E_SPV_AMD_shader_explicit_vertex_parameter); + return spv::BuiltIn::BaryCoordNoPerspSampleAMD; + + case glslang::EbvBaryCoordSmooth: + builder.addExtension(spv::E_SPV_AMD_shader_explicit_vertex_parameter); + return spv::BuiltIn::BaryCoordSmoothAMD; + + case glslang::EbvBaryCoordSmoothCentroid: + builder.addExtension(spv::E_SPV_AMD_shader_explicit_vertex_parameter); + return spv::BuiltIn::BaryCoordSmoothCentroidAMD; + + case glslang::EbvBaryCoordSmoothSample: + builder.addExtension(spv::E_SPV_AMD_shader_explicit_vertex_parameter); + return spv::BuiltIn::BaryCoordSmoothSampleAMD; + + case glslang::EbvBaryCoordPullModel: + builder.addExtension(spv::E_SPV_AMD_shader_explicit_vertex_parameter); + return spv::BuiltIn::BaryCoordPullModelAMD; + + case glslang::EbvDeviceIndex: + builder.addIncorporatedExtension(spv::E_SPV_KHR_device_group, spv::Spv_1_3); + builder.addCapability(spv::Capability::DeviceGroup); + return spv::BuiltIn::DeviceIndex; + + case glslang::EbvViewIndex: + builder.addIncorporatedExtension(spv::E_SPV_KHR_multiview, spv::Spv_1_3); + builder.addCapability(spv::Capability::MultiView); + return spv::BuiltIn::ViewIndex; + + case glslang::EbvFragSizeEXT: + builder.addExtension(spv::E_SPV_EXT_fragment_invocation_density); + builder.addCapability(spv::Capability::FragmentDensityEXT); + return spv::BuiltIn::FragSizeEXT; + + case glslang::EbvFragInvocationCountEXT: + builder.addExtension(spv::E_SPV_EXT_fragment_invocation_density); + builder.addCapability(spv::Capability::FragmentDensityEXT); + return spv::BuiltIn::FragInvocationCountEXT; + + case glslang::EbvViewportMaskNV: + if (!memberDeclaration) { + builder.addExtension(spv::E_SPV_NV_viewport_array2); + builder.addCapability(spv::Capability::ShaderViewportMaskNV); + } + return spv::BuiltIn::ViewportMaskNV; + case glslang::EbvSecondaryPositionNV: + if (!memberDeclaration) { + builder.addExtension(spv::E_SPV_NV_stereo_view_rendering); + builder.addCapability(spv::Capability::ShaderStereoViewNV); + } + return spv::BuiltIn::SecondaryPositionNV; + case glslang::EbvSecondaryViewportMaskNV: + if (!memberDeclaration) { + builder.addExtension(spv::E_SPV_NV_stereo_view_rendering); + builder.addCapability(spv::Capability::ShaderStereoViewNV); + } + return spv::BuiltIn::SecondaryViewportMaskNV; + case glslang::EbvPositionPerViewNV: + if (!memberDeclaration) { + builder.addExtension(spv::E_SPV_NVX_multiview_per_view_attributes); + builder.addCapability(spv::Capability::PerViewAttributesNV); + } + return spv::BuiltIn::PositionPerViewNV; + case glslang::EbvViewportMaskPerViewNV: + if (!memberDeclaration) { + builder.addExtension(spv::E_SPV_NVX_multiview_per_view_attributes); + builder.addCapability(spv::Capability::PerViewAttributesNV); + } + return spv::BuiltIn::ViewportMaskPerViewNV; + case glslang::EbvFragFullyCoveredNV: + builder.addExtension(spv::E_SPV_EXT_fragment_fully_covered); + builder.addCapability(spv::Capability::FragmentFullyCoveredEXT); + return spv::BuiltIn::FullyCoveredEXT; + case glslang::EbvFragmentSizeNV: + builder.addExtension(spv::E_SPV_NV_shading_rate); + builder.addCapability(spv::Capability::ShadingRateNV); + return spv::BuiltIn::FragmentSizeNV; + case glslang::EbvInvocationsPerPixelNV: + builder.addExtension(spv::E_SPV_NV_shading_rate); + builder.addCapability(spv::Capability::ShadingRateNV); + return spv::BuiltIn::InvocationsPerPixelNV; + + // ray tracing + case glslang::EbvLaunchId: + return spv::BuiltIn::LaunchIdKHR; + case glslang::EbvLaunchSize: + return spv::BuiltIn::LaunchSizeKHR; + case glslang::EbvWorldRayOrigin: + return spv::BuiltIn::WorldRayOriginKHR; + case glslang::EbvWorldRayDirection: + return spv::BuiltIn::WorldRayDirectionKHR; + case glslang::EbvObjectRayOrigin: + return spv::BuiltIn::ObjectRayOriginKHR; + case glslang::EbvObjectRayDirection: + return spv::BuiltIn::ObjectRayDirectionKHR; + case glslang::EbvRayTmin: + return spv::BuiltIn::RayTminKHR; + case glslang::EbvRayTmax: + return spv::BuiltIn::RayTmaxKHR; + case glslang::EbvCullMask: + return spv::BuiltIn::CullMaskKHR; + case glslang::EbvPositionFetch: + return spv::BuiltIn::HitTriangleVertexPositionsKHR; + case glslang::EbvInstanceCustomIndex: + return spv::BuiltIn::InstanceCustomIndexKHR; + case glslang::EbvHitKind: + return spv::BuiltIn::HitKindKHR; + case glslang::EbvObjectToWorld: + case glslang::EbvObjectToWorld3x4: + return spv::BuiltIn::ObjectToWorldKHR; + case glslang::EbvWorldToObject: + case glslang::EbvWorldToObject3x4: + return spv::BuiltIn::WorldToObjectKHR; + case glslang::EbvIncomingRayFlags: + return spv::BuiltIn::IncomingRayFlagsKHR; + case glslang::EbvGeometryIndex: + return spv::BuiltIn::RayGeometryIndexKHR; + case glslang::EbvCurrentRayTimeNV: + builder.addExtension(spv::E_SPV_NV_ray_tracing_motion_blur); + builder.addCapability(spv::Capability::RayTracingMotionBlurNV); + return spv::BuiltIn::CurrentRayTimeNV; + case glslang::EbvMicroTrianglePositionNV: + builder.addCapability(spv::Capability::RayTracingDisplacementMicromapNV); + builder.addExtension("SPV_NV_displacement_micromap"); + return spv::BuiltIn::HitMicroTriangleVertexPositionsNV; + case glslang::EbvMicroTriangleBaryNV: + builder.addCapability(spv::Capability::RayTracingDisplacementMicromapNV); + builder.addExtension("SPV_NV_displacement_micromap"); + return spv::BuiltIn::HitMicroTriangleVertexBarycentricsNV; + case glslang::EbvHitKindFrontFacingMicroTriangleNV: + builder.addCapability(spv::Capability::RayTracingDisplacementMicromapNV); + builder.addExtension("SPV_NV_displacement_micromap"); + return spv::BuiltIn::HitKindFrontFacingMicroTriangleNV; + case glslang::EbvHitKindBackFacingMicroTriangleNV: + builder.addCapability(spv::Capability::RayTracingDisplacementMicromapNV); + builder.addExtension("SPV_NV_displacement_micromap"); + return spv::BuiltIn::HitKindBackFacingMicroTriangleNV; + case glslang::EbvClusterIDNV: + builder.addCapability(spv::Capability::RayTracingClusterAccelerationStructureNV); + builder.addExtension("SPV_NV_cluster_acceleration_structure"); + return spv::BuiltIn::ClusterIDNV; + case glslang::EbvHitIsSphereNV: + builder.addCapability(spv::Capability::RayTracingSpheresGeometryNV); + builder.addExtension("SPV_NV_linear_swept_spheres"); + return spv::BuiltIn::HitIsSphereNV; + case glslang::EbvHitIsLSSNV: + builder.addCapability(spv::Capability::RayTracingLinearSweptSpheresGeometryNV); + builder.addExtension("SPV_NV_linear_swept_spheres"); + return spv::BuiltIn::HitIsLSSNV; + case glslang::EbvHitSpherePositionNV: + builder.addCapability(spv::Capability::RayTracingSpheresGeometryNV); + builder.addExtension("SPV_NV_linear_swept_spheres"); + return spv::BuiltIn::HitSpherePositionNV; + case glslang::EbvHitSphereRadiusNV: + builder.addCapability(spv::Capability::RayTracingSpheresGeometryNV); + builder.addExtension("SPV_NV_linear_swept_spheres"); + return spv::BuiltIn::HitSphereRadiusNV; + case glslang::EbvHitLSSPositionsNV: + builder.addCapability(spv::Capability::RayTracingLinearSweptSpheresGeometryNV); + builder.addExtension("SPV_NV_linear_swept_spheres"); + return spv::BuiltIn::HitLSSPositionsNV; + case glslang::EbvHitLSSRadiiNV: + builder.addCapability(spv::Capability::RayTracingLinearSweptSpheresGeometryNV); + builder.addExtension("SPV_NV_linear_swept_spheres"); + return spv::BuiltIn::HitLSSRadiiNV; + + // barycentrics + case glslang::EbvBaryCoordNV: + builder.addExtension(spv::E_SPV_NV_fragment_shader_barycentric); + builder.addCapability(spv::Capability::FragmentBarycentricNV); + return spv::BuiltIn::BaryCoordNV; + case glslang::EbvBaryCoordNoPerspNV: + builder.addExtension(spv::E_SPV_NV_fragment_shader_barycentric); + builder.addCapability(spv::Capability::FragmentBarycentricNV); + return spv::BuiltIn::BaryCoordNoPerspNV; + + case glslang::EbvBaryCoordEXT: + builder.addExtension(spv::E_SPV_KHR_fragment_shader_barycentric); + builder.addCapability(spv::Capability::FragmentBarycentricKHR); + return spv::BuiltIn::BaryCoordKHR; + case glslang::EbvBaryCoordNoPerspEXT: + builder.addExtension(spv::E_SPV_KHR_fragment_shader_barycentric); + builder.addCapability(spv::Capability::FragmentBarycentricKHR); + return spv::BuiltIn::BaryCoordNoPerspKHR; + + // mesh shaders + case glslang::EbvTaskCountNV: + return spv::BuiltIn::TaskCountNV; + case glslang::EbvPrimitiveCountNV: + return spv::BuiltIn::PrimitiveCountNV; + case glslang::EbvPrimitiveIndicesNV: + return spv::BuiltIn::PrimitiveIndicesNV; + case glslang::EbvClipDistancePerViewNV: + return spv::BuiltIn::ClipDistancePerViewNV; + case glslang::EbvCullDistancePerViewNV: + return spv::BuiltIn::CullDistancePerViewNV; + case glslang::EbvLayerPerViewNV: + return spv::BuiltIn::LayerPerViewNV; + case glslang::EbvMeshViewCountNV: + return spv::BuiltIn::MeshViewCountNV; + case glslang::EbvMeshViewIndicesNV: + return spv::BuiltIn::MeshViewIndicesNV; + + // SPV_EXT_mesh_shader + case glslang::EbvPrimitivePointIndicesEXT: + return spv::BuiltIn::PrimitivePointIndicesEXT; + case glslang::EbvPrimitiveLineIndicesEXT: + return spv::BuiltIn::PrimitiveLineIndicesEXT; + case glslang::EbvPrimitiveTriangleIndicesEXT: + return spv::BuiltIn::PrimitiveTriangleIndicesEXT; + case glslang::EbvCullPrimitiveEXT: + return spv::BuiltIn::CullPrimitiveEXT; + + // sm builtins + case glslang::EbvWarpsPerSM: + builder.addExtension(spv::E_SPV_NV_shader_sm_builtins); + builder.addCapability(spv::Capability::ShaderSMBuiltinsNV); + return spv::BuiltIn::WarpsPerSMNV; + case glslang::EbvSMCount: + builder.addExtension(spv::E_SPV_NV_shader_sm_builtins); + builder.addCapability(spv::Capability::ShaderSMBuiltinsNV); + return spv::BuiltIn::SMCountNV; + case glslang::EbvWarpID: + builder.addExtension(spv::E_SPV_NV_shader_sm_builtins); + builder.addCapability(spv::Capability::ShaderSMBuiltinsNV); + return spv::BuiltIn::WarpIDNV; + case glslang::EbvSMID: + builder.addExtension(spv::E_SPV_NV_shader_sm_builtins); + builder.addCapability(spv::Capability::ShaderSMBuiltinsNV); + return spv::BuiltIn::SMIDNV; + + // ARM builtins + case glslang::EbvCoreCountARM: + builder.addExtension(spv::E_SPV_ARM_core_builtins); + builder.addCapability(spv::Capability::CoreBuiltinsARM); + return spv::BuiltIn::CoreCountARM; + case glslang::EbvCoreIDARM: + builder.addExtension(spv::E_SPV_ARM_core_builtins); + builder.addCapability(spv::Capability::CoreBuiltinsARM); + return spv::BuiltIn::CoreIDARM; + case glslang::EbvCoreMaxIDARM: + builder.addExtension(spv::E_SPV_ARM_core_builtins); + builder.addCapability(spv::Capability::CoreBuiltinsARM); + return spv::BuiltIn::CoreMaxIDARM; + case glslang::EbvWarpIDARM: + builder.addExtension(spv::E_SPV_ARM_core_builtins); + builder.addCapability(spv::Capability::CoreBuiltinsARM); + return spv::BuiltIn::WarpIDARM; + case glslang::EbvWarpMaxIDARM: + builder.addExtension(spv::E_SPV_ARM_core_builtins); + builder.addCapability(spv::Capability::CoreBuiltinsARM); + return spv::BuiltIn::WarpMaxIDARM; + + // QCOM builtins + case glslang::EbvTileOffsetQCOM: + builder.addExtension(spv::E_SPV_QCOM_tile_shading); + return spv::BuiltIn::TileOffsetQCOM; + case glslang::EbvTileDimensionQCOM: + builder.addExtension(spv::E_SPV_QCOM_tile_shading); + return spv::BuiltIn::TileDimensionQCOM; + case glslang::EbvTileApronSizeQCOM: + builder.addExtension(spv::E_SPV_QCOM_tile_shading); + return spv::BuiltIn::TileApronSizeQCOM; + + default: + return spv::BuiltIn::Max; + } +} + +// Translate glslang image layout format to SPIR-V image format. +spv::ImageFormat TGlslangToSpvTraverser::TranslateImageFormat(const glslang::TType& type) +{ + assert(type.getBasicType() == glslang::EbtSampler); + + // Check for capabilities + switch (type.getQualifier().getFormat()) { + case glslang::ElfRg32f: + case glslang::ElfRg16f: + case glslang::ElfR11fG11fB10f: + case glslang::ElfR16f: + case glslang::ElfRgba16: + case glslang::ElfRgb10A2: + case glslang::ElfRg16: + case glslang::ElfRg8: + case glslang::ElfR16: + case glslang::ElfR8: + case glslang::ElfRgba16Snorm: + case glslang::ElfRg16Snorm: + case glslang::ElfRg8Snorm: + case glslang::ElfR16Snorm: + case glslang::ElfR8Snorm: + + case glslang::ElfRg32i: + case glslang::ElfRg16i: + case glslang::ElfRg8i: + case glslang::ElfR16i: + case glslang::ElfR8i: + + case glslang::ElfRgb10a2ui: + case glslang::ElfRg32ui: + case glslang::ElfRg16ui: + case glslang::ElfRg8ui: + case glslang::ElfR16ui: + case glslang::ElfR8ui: + builder.addCapability(spv::Capability::StorageImageExtendedFormats); + break; + + case glslang::ElfR64ui: + case glslang::ElfR64i: + builder.addExtension(spv::E_SPV_EXT_shader_image_int64); + builder.addCapability(spv::Capability::Int64ImageEXT); + break; + default: + break; + } + + // do the translation + switch (type.getQualifier().getFormat()) { + case glslang::ElfNone: return spv::ImageFormat::Unknown; + case glslang::ElfRgba32f: return spv::ImageFormat::Rgba32f; + case glslang::ElfRgba16f: return spv::ImageFormat::Rgba16f; + case glslang::ElfR32f: return spv::ImageFormat::R32f; + case glslang::ElfRgba8: return spv::ImageFormat::Rgba8; + case glslang::ElfRgba8Snorm: return spv::ImageFormat::Rgba8Snorm; + case glslang::ElfRg32f: return spv::ImageFormat::Rg32f; + case glslang::ElfRg16f: return spv::ImageFormat::Rg16f; + case glslang::ElfR11fG11fB10f: return spv::ImageFormat::R11fG11fB10f; + case glslang::ElfR16f: return spv::ImageFormat::R16f; + case glslang::ElfRgba16: return spv::ImageFormat::Rgba16; + case glslang::ElfRgb10A2: return spv::ImageFormat::Rgb10A2; + case glslang::ElfRg16: return spv::ImageFormat::Rg16; + case glslang::ElfRg8: return spv::ImageFormat::Rg8; + case glslang::ElfR16: return spv::ImageFormat::R16; + case glslang::ElfR8: return spv::ImageFormat::R8; + case glslang::ElfRgba16Snorm: return spv::ImageFormat::Rgba16Snorm; + case glslang::ElfRg16Snorm: return spv::ImageFormat::Rg16Snorm; + case glslang::ElfRg8Snorm: return spv::ImageFormat::Rg8Snorm; + case glslang::ElfR16Snorm: return spv::ImageFormat::R16Snorm; + case glslang::ElfR8Snorm: return spv::ImageFormat::R8Snorm; + case glslang::ElfRgba32i: return spv::ImageFormat::Rgba32i; + case glslang::ElfRgba16i: return spv::ImageFormat::Rgba16i; + case glslang::ElfRgba8i: return spv::ImageFormat::Rgba8i; + case glslang::ElfR32i: return spv::ImageFormat::R32i; + case glslang::ElfRg32i: return spv::ImageFormat::Rg32i; + case glslang::ElfRg16i: return spv::ImageFormat::Rg16i; + case glslang::ElfRg8i: return spv::ImageFormat::Rg8i; + case glslang::ElfR16i: return spv::ImageFormat::R16i; + case glslang::ElfR8i: return spv::ImageFormat::R8i; + case glslang::ElfRgba32ui: return spv::ImageFormat::Rgba32ui; + case glslang::ElfRgba16ui: return spv::ImageFormat::Rgba16ui; + case glslang::ElfRgba8ui: return spv::ImageFormat::Rgba8ui; + case glslang::ElfR32ui: return spv::ImageFormat::R32ui; + case glslang::ElfRg32ui: return spv::ImageFormat::Rg32ui; + case glslang::ElfRg16ui: return spv::ImageFormat::Rg16ui; + case glslang::ElfRgb10a2ui: return spv::ImageFormat::Rgb10a2ui; + case glslang::ElfRg8ui: return spv::ImageFormat::Rg8ui; + case glslang::ElfR16ui: return spv::ImageFormat::R16ui; + case glslang::ElfR8ui: return spv::ImageFormat::R8ui; + case glslang::ElfR64ui: return spv::ImageFormat::R64ui; + case glslang::ElfR64i: return spv::ImageFormat::R64i; + default: return spv::ImageFormat::Max; + } +} + +spv::SelectionControlMask TGlslangToSpvTraverser::TranslateSelectionControl( + const glslang::TIntermSelection& selectionNode) const +{ + if (selectionNode.getFlatten()) + return spv::SelectionControlMask::Flatten; + if (selectionNode.getDontFlatten()) + return spv::SelectionControlMask::DontFlatten; + return spv::SelectionControlMask::MaskNone; +} + +spv::SelectionControlMask TGlslangToSpvTraverser::TranslateSwitchControl(const glslang::TIntermSwitch& switchNode) + const +{ + if (switchNode.getFlatten()) + return spv::SelectionControlMask::Flatten; + if (switchNode.getDontFlatten()) + return spv::SelectionControlMask::DontFlatten; + return spv::SelectionControlMask::MaskNone; +} + +// return a non-0 dependency if the dependency argument must be set +spv::LoopControlMask TGlslangToSpvTraverser::TranslateLoopControl(const glslang::TIntermLoop& loopNode, + std::vector& operands) const +{ + spv::LoopControlMask control = spv::LoopControlMask::MaskNone; + + if (loopNode.getDontUnroll()) + control = control | spv::LoopControlMask::DontUnroll; + if (loopNode.getUnroll()) + control = control | spv::LoopControlMask::Unroll; + if (unsigned(loopNode.getLoopDependency()) == glslang::TIntermLoop::dependencyInfinite) + control = control | spv::LoopControlMask::DependencyInfinite; + else if (loopNode.getLoopDependency() > 0) { + control = control | spv::LoopControlMask::DependencyLength; + operands.push_back((unsigned int)loopNode.getLoopDependency()); + } + if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_4) { + if (loopNode.getMinIterations() > 0) { + control = control | spv::LoopControlMask::MinIterations; + operands.push_back(loopNode.getMinIterations()); + } + if (loopNode.getMaxIterations() < glslang::TIntermLoop::iterationsInfinite) { + control = control | spv::LoopControlMask::MaxIterations; + operands.push_back(loopNode.getMaxIterations()); + } + if (loopNode.getIterationMultiple() > 1) { + control = control | spv::LoopControlMask::IterationMultiple; + operands.push_back(loopNode.getIterationMultiple()); + } + if (loopNode.getPeelCount() > 0) { + control = control | spv::LoopControlMask::PeelCount; + operands.push_back(loopNode.getPeelCount()); + } + if (loopNode.getPartialCount() > 0) { + control = control | spv::LoopControlMask::PartialCount; + operands.push_back(loopNode.getPartialCount()); + } + } + + return control; +} + +// Translate glslang type to SPIR-V storage class. +spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::TType& type) +{ + if (type.getBasicType() == glslang::EbtRayQuery || type.getBasicType() == glslang::EbtHitObjectNV + || type.getBasicType() == glslang::EbtHitObjectEXT) + return spv::StorageClass::Private; + if (type.getQualifier().isSpirvByReference()) { + if (type.getQualifier().isParamInput() || type.getQualifier().isParamOutput()) + return spv::StorageClass::Function; + } + if (type.getQualifier().isPipeInput()) + return spv::StorageClass::Input; + if (type.getQualifier().isPipeOutput()) + return spv::StorageClass::Output; + if (type.getQualifier().storage == glslang::EvqTileImageEXT || type.isAttachmentEXT()) { + builder.addExtension(spv::E_SPV_EXT_shader_tile_image); + builder.addCapability(spv::Capability::TileImageColorReadAccessEXT); + return spv::StorageClass::TileImageEXT; + } + + if (type.getQualifier().isTileAttachmentQCOM()) { + builder.addExtension(spv::E_SPV_QCOM_tile_shading); + builder.addCapability(spv::Capability::TileShadingQCOM); + return spv::StorageClass::TileAttachmentQCOM; + } + + if (glslangIntermediate->getSource() != glslang::EShSourceHlsl || + type.getQualifier().storage == glslang::EvqUniform) { + if (type.isAtomic()) + return spv::StorageClass::AtomicCounter; + if (type.containsOpaque() && !glslangIntermediate->getBindlessMode()) + return spv::StorageClass::UniformConstant; + } + + if (type.getQualifier().isUniformOrBuffer() && + type.getQualifier().isShaderRecord()) { + return spv::StorageClass::ShaderRecordBufferKHR; + } + + if (glslangIntermediate->usingStorageBuffer() && type.getQualifier().storage == glslang::EvqBuffer) { + builder.addIncorporatedExtension(spv::E_SPV_KHR_storage_buffer_storage_class, spv::Spv_1_3); + return spv::StorageClass::StorageBuffer; + } + + if (type.getQualifier().isUniformOrBuffer()) { + if (type.getQualifier().isPushConstant()) + return spv::StorageClass::PushConstant; + if (type.getBasicType() == glslang::EbtBlock) + return spv::StorageClass::Uniform; + return spv::StorageClass::UniformConstant; + } + + if (type.getQualifier().storage == glslang::EvqShared && type.getBasicType() == glslang::EbtBlock) { + builder.addExtension(spv::E_SPV_KHR_workgroup_memory_explicit_layout); + builder.addCapability(spv::Capability::WorkgroupMemoryExplicitLayoutKHR); + return spv::StorageClass::Workgroup; + } + + switch (type.getQualifier().storage) { + case glslang::EvqGlobal: return spv::StorageClass::Private; + case glslang::EvqConstReadOnly: return spv::StorageClass::Function; + case glslang::EvqTemporary: return spv::StorageClass::Function; + case glslang::EvqShared: return spv::StorageClass::Workgroup; + case glslang::EvqPayload: return spv::StorageClass::RayPayloadKHR; + case glslang::EvqPayloadIn: return spv::StorageClass::IncomingRayPayloadKHR; + case glslang::EvqHitAttr: return spv::StorageClass::HitAttributeKHR; + case glslang::EvqCallableData: return spv::StorageClass::CallableDataKHR; + case glslang::EvqCallableDataIn: return spv::StorageClass::IncomingCallableDataKHR; + case glslang::EvqtaskPayloadSharedEXT : return spv::StorageClass::TaskPayloadWorkgroupEXT; + case glslang::EvqHitObjectAttrNV: return spv::StorageClass::HitObjectAttributeNV; + case glslang::EvqHitObjectAttrEXT: return spv::StorageClass::HitObjectAttributeEXT; + case glslang::EvqSpirvStorageClass: return static_cast(type.getQualifier().spirvStorageClass); + default: + assert(0); + break; + } + + return spv::StorageClass::Function; +} + +// Translate glslang constants to SPIR-V literals +void TGlslangToSpvTraverser::TranslateLiterals(const glslang::TVector& constants, + std::vector& literals) const +{ + for (auto constant : constants) { + if (constant->getBasicType() == glslang::EbtFloat) { + float floatValue = static_cast(constant->getConstArray()[0].getDConst()); + unsigned literal; + static_assert(sizeof(literal) == sizeof(floatValue), "sizeof(unsigned) != sizeof(float)"); + memcpy(&literal, &floatValue, sizeof(literal)); + literals.push_back(literal); + } else if (constant->getBasicType() == glslang::EbtInt) { + unsigned literal = constant->getConstArray()[0].getIConst(); + literals.push_back(literal); + } else if (constant->getBasicType() == glslang::EbtUint) { + unsigned literal = constant->getConstArray()[0].getUConst(); + literals.push_back(literal); + } else if (constant->getBasicType() == glslang::EbtBool) { + unsigned literal = constant->getConstArray()[0].getBConst(); + literals.push_back(literal); + } else if (constant->getBasicType() == glslang::EbtString) { + auto str = constant->getConstArray()[0].getSConst()->c_str(); + unsigned literal = 0; + char* literalPtr = reinterpret_cast(&literal); + unsigned charCount = 0; + char ch = 0; + do { + ch = *(str++); + *(literalPtr++) = ch; + ++charCount; + if (charCount == 4) { + literals.push_back(literal); + literalPtr = reinterpret_cast(&literal); + charCount = 0; + } + } while (ch != 0); + + // Partial literal is padded with 0 + if (charCount > 0) { + for (; charCount < 4; ++charCount) + *(literalPtr++) = 0; + literals.push_back(literal); + } + } else + assert(0); // Unexpected type + } +} + +// Add capabilities pertaining to how an array is indexed. +void TGlslangToSpvTraverser::addIndirectionIndexCapabilities(const glslang::TType& baseType, + const glslang::TType& indexType) +{ + if (indexType.getQualifier().isNonUniform()) { + // deal with an asserted non-uniform index + // SPV_EXT_descriptor_indexing already added in TranslateNonUniformDecoration + if (baseType.getBasicType() == glslang::EbtSampler) { + if (baseType.getQualifier().hasAttachment()) + builder.addCapability(spv::Capability::InputAttachmentArrayNonUniformIndexingEXT); + else if (baseType.isImage() && baseType.getSampler().isBuffer()) + builder.addCapability(spv::Capability::StorageTexelBufferArrayNonUniformIndexingEXT); + else if (baseType.isTexture() && baseType.getSampler().isBuffer()) + builder.addCapability(spv::Capability::UniformTexelBufferArrayNonUniformIndexingEXT); + else if (baseType.isImage()) + builder.addCapability(spv::Capability::StorageImageArrayNonUniformIndexingEXT); + else if (baseType.isTexture()) + builder.addCapability(spv::Capability::SampledImageArrayNonUniformIndexingEXT); + } else if (baseType.getBasicType() == glslang::EbtBlock) { + if (baseType.getQualifier().storage == glslang::EvqBuffer) + builder.addCapability(spv::Capability::StorageBufferArrayNonUniformIndexingEXT); + else if (baseType.getQualifier().storage == glslang::EvqUniform) + builder.addCapability(spv::Capability::UniformBufferArrayNonUniformIndexingEXT); + } + } else { + // assume a dynamically uniform index + if (baseType.getBasicType() == glslang::EbtSampler) { + if (baseType.getQualifier().hasAttachment()) { + builder.addIncorporatedExtension("SPV_EXT_descriptor_indexing", spv::Spv_1_5); + builder.addCapability(spv::Capability::InputAttachmentArrayDynamicIndexingEXT); + } else if (baseType.isImage() && baseType.getSampler().isBuffer()) { + builder.addIncorporatedExtension("SPV_EXT_descriptor_indexing", spv::Spv_1_5); + builder.addCapability(spv::Capability::StorageTexelBufferArrayDynamicIndexingEXT); + } else if (baseType.isTexture() && baseType.getSampler().isBuffer()) { + builder.addIncorporatedExtension("SPV_EXT_descriptor_indexing", spv::Spv_1_5); + builder.addCapability(spv::Capability::UniformTexelBufferArrayDynamicIndexingEXT); + } + } + } +} + +// Return whether or not the given type is something that should be tied to a +// descriptor set. +bool IsDescriptorResource(const glslang::TType& type) +{ + // uniform and buffer blocks are included, unless it is a push_constant + if (type.getBasicType() == glslang::EbtBlock) + return type.getQualifier().isUniformOrBuffer() && + ! type.getQualifier().isShaderRecord() && + ! type.getQualifier().isPushConstant(); + + // non block... + // basically samplerXXX/subpass/sampler/texture are all included + // if they are the global-scope-class, not the function parameter + // (or local, if they ever exist) class. + if (type.getBasicType() == glslang::EbtSampler || + type.getBasicType() == glslang::EbtAccStruct) + return type.getQualifier().isUniformOrBuffer(); + + // Tensors are tied to a descriptor. + if (type.isTensorARM()) + return true; + + // None of the above. + return false; +} + +void InheritQualifiers(glslang::TQualifier& child, const glslang::TQualifier& parent) +{ + if (child.layoutMatrix == glslang::ElmNone) + child.layoutMatrix = parent.layoutMatrix; + + if (parent.invariant) + child.invariant = true; + if (parent.flat) + child.flat = true; + if (parent.centroid) + child.centroid = true; + if (parent.nopersp) + child.nopersp = true; + if (parent.explicitInterp) + child.explicitInterp = true; + if (parent.perPrimitiveNV) + child.perPrimitiveNV = true; + if (parent.perViewNV) + child.perViewNV = true; + if (parent.perTaskNV) + child.perTaskNV = true; + if (parent.storage == glslang::EvqtaskPayloadSharedEXT) + child.storage = glslang::EvqtaskPayloadSharedEXT; + if (parent.patch) + child.patch = true; + if (parent.sample) + child.sample = true; + if (parent.coherent) + child.coherent = true; + if (parent.devicecoherent) + child.devicecoherent = true; + if (parent.queuefamilycoherent) + child.queuefamilycoherent = true; + if (parent.workgroupcoherent) + child.workgroupcoherent = true; + if (parent.subgroupcoherent) + child.subgroupcoherent = true; + if (parent.shadercallcoherent) + child.shadercallcoherent = true; + if (parent.nonprivate) + child.nonprivate = true; + if (parent.volatil) + child.volatil = true; + if (parent.nontemporal) + child.nontemporal = true; + if (parent.restrict) + child.restrict = true; + if (parent.readonly) + child.readonly = true; + if (parent.writeonly) + child.writeonly = true; + if (parent.nonUniform) + child.nonUniform = true; +} + +bool HasNonLayoutQualifiers(const glslang::TType& type, const glslang::TQualifier& qualifier) +{ + // This should list qualifiers that simultaneous satisfy: + // - struct members might inherit from a struct declaration + // (note that non-block structs don't explicitly inherit, + // only implicitly, meaning no decoration involved) + // - affect decorations on the struct members + // (note smooth does not, and expecting something like volatile + // to effect the whole object) + // - are not part of the offset/st430/etc or row/column-major layout + return qualifier.invariant || (qualifier.hasLocation() && type.getBasicType() == glslang::EbtBlock); +} + +// +// Implement the TGlslangToSpvTraverser class. +// + +TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, + const glslang::TIntermediate* glslangIntermediate, + spv::SpvBuildLogger* buildLogger, glslang::SpvOptions& options) : + TIntermTraverser(true, false, true), + options(options), + shaderEntry(nullptr), currentFunction(nullptr), + sequenceDepth(0), logger(buildLogger), + builder(spvVersion, (glslang::GetKhronosToolId() << 16) | glslang::GetSpirvGeneratorVersion(), logger), + inEntryPoint(false), entryPointTerminated(false), linkageOnly(false), + glslangIntermediate(glslangIntermediate), + nanMinMaxClamp(glslangIntermediate->getNanMinMaxClamp()), + nonSemanticDebugPrintf(0), + taskPayloadID(0) +{ + bool isMeshShaderExt = (glslangIntermediate->getRequestedExtensions().find(glslang::E_GL_EXT_mesh_shader) != + glslangIntermediate->getRequestedExtensions().end()); + spv::ExecutionModel executionModel = TranslateExecutionModel(glslangIntermediate->getStage(), isMeshShaderExt); + + builder.clearAccessChain(); + builder.setSource(TranslateSourceLanguage(glslangIntermediate->getSource(), glslangIntermediate->getProfile()), + glslangIntermediate->getVersion()); + + if (options.emitNonSemanticShaderDebugSource) + this->options.emitNonSemanticShaderDebugInfo = true; + if (options.emitNonSemanticShaderDebugInfo) + this->options.generateDebugInfo = true; + + if (this->options.generateDebugInfo) { + if (this->options.emitNonSemanticShaderDebugInfo) { + builder.setEmitNonSemanticShaderDebugInfo(this->options.emitNonSemanticShaderDebugSource); + } + else { + builder.setEmitSpirvDebugInfo(); + } + builder.setDebugMainSourceFile(glslangIntermediate->getSourceFile()); + + // Set the source shader's text. If for SPV version 1.0, include + // a preamble in comments stating the OpModuleProcessed instructions. + // Otherwise, emit those as actual instructions. + std::string text; + const std::vector& processes = glslangIntermediate->getProcesses(); + for (int p = 0; p < (int)processes.size(); ++p) { + if (glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_1) { + text.append("// OpModuleProcessed "); + text.append(processes[p]); + text.append("\n"); + } else + builder.addModuleProcessed(processes[p]); + } + if (glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_1 && (int)processes.size() > 0) + text.append("#line 1\n"); + text.append(glslangIntermediate->getSourceText()); + builder.setSourceText(text); + // Pass name and text for all included files + const std::map& include_txt = glslangIntermediate->getIncludeText(); + for (auto iItr = include_txt.begin(); iItr != include_txt.end(); ++iItr) + builder.addInclude(iItr->first, iItr->second); + } + + builder.setUseReplicatedComposites(glslangIntermediate->usingReplicatedComposites()); + + stdBuiltins = builder.import("GLSL.std.450"); + + spv::AddressingModel addressingModel = spv::AddressingModel::Logical; + spv::MemoryModel memoryModel = spv::MemoryModel::GLSL450; + + if (glslangIntermediate->usingPhysicalStorageBuffer()) { + addressingModel = spv::AddressingModel::PhysicalStorageBuffer64EXT; + builder.addIncorporatedExtension(spv::E_SPV_KHR_physical_storage_buffer, spv::Spv_1_5); + builder.addCapability(spv::Capability::PhysicalStorageBufferAddressesEXT); + } + if (glslangIntermediate->usingVulkanMemoryModel()) { + memoryModel = spv::MemoryModel::VulkanKHR; + builder.addCapability(spv::Capability::VulkanMemoryModelKHR); + builder.addIncorporatedExtension(spv::E_SPV_KHR_vulkan_memory_model, spv::Spv_1_5); + } + builder.setMemoryModel(addressingModel, memoryModel); + + if (glslangIntermediate->usingVariablePointers()) { + builder.addCapability(spv::Capability::VariablePointers); + } + + // If not linking, there is no entry point + if (!options.compileOnly) { + shaderEntry = builder.makeEntryPoint(glslangIntermediate->getEntryPointName().c_str()); + entryPoint = + builder.addEntryPoint(executionModel, shaderEntry, glslangIntermediate->getEntryPointName().c_str()); + } + + // Add the source extensions + const auto& sourceExtensions = glslangIntermediate->getRequestedExtensions(); + for (auto it = sourceExtensions.begin(); it != sourceExtensions.end(); ++it) + builder.addSourceExtension(it->c_str()); + + // Add the top-level modes for this shader. + + if (glslangIntermediate->getXfbMode()) { + builder.addCapability(spv::Capability::TransformFeedback); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::Xfb); + } + + if (glslangIntermediate->getLayoutPrimitiveCulling()) { + builder.addCapability(spv::Capability::RayTraversalPrimitiveCullingKHR); + } + + if (glslangIntermediate->getSubgroupUniformControlFlow()) { + builder.addExtension(spv::E_SPV_KHR_subgroup_uniform_control_flow); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::SubgroupUniformControlFlowKHR); + } + if (glslangIntermediate->getMaximallyReconverges()) { + builder.addExtension(spv::E_SPV_KHR_maximal_reconvergence); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::MaximallyReconvergesKHR); + } + + if (glslangIntermediate->getQuadDerivMode()) + { + builder.addCapability(spv::Capability::QuadControlKHR); + builder.addExtension(spv::E_SPV_KHR_quad_control); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::QuadDerivativesKHR); + } + + if (glslangIntermediate->getReqFullQuadsMode()) + { + builder.addCapability(spv::Capability::QuadControlKHR); + builder.addExtension(spv::E_SPV_KHR_quad_control); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::RequireFullQuadsKHR); + } + + if (glslangIntermediate->usingShader64BitIndexing()) + { + builder.addCapability(spv::Capability::Shader64BitIndexingEXT); + builder.addExtension(spv::E_SPV_EXT_shader_64bit_indexing); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::Shader64BitIndexingEXT); + } + + spv::ExecutionMode mode; + switch (glslangIntermediate->getStage()) { + case EShLangVertex: + builder.addCapability(spv::Capability::Shader); + break; + + case EShLangFragment: + builder.addCapability(spv::Capability::Shader); + if (glslangIntermediate->getPixelCenterInteger()) + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::PixelCenterInteger); + + if (glslangIntermediate->getOriginUpperLeft()) + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::OriginUpperLeft); + else + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::OriginLowerLeft); + + if (glslangIntermediate->getEarlyFragmentTests()) + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::EarlyFragmentTests); + + if (glslangIntermediate->getEarlyAndLateFragmentTestsAMD()) + { + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::EarlyAndLateFragmentTestsAMD); + builder.addExtension(spv::E_SPV_AMD_shader_early_and_late_fragment_tests); + } + + if (glslangIntermediate->getPostDepthCoverage()) { + builder.addCapability(spv::Capability::SampleMaskPostDepthCoverage); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::PostDepthCoverage); + builder.addExtension(spv::E_SPV_KHR_post_depth_coverage); + } + + if (glslangIntermediate->getNonCoherentColorAttachmentReadEXT()) { + builder.addCapability(spv::Capability::TileImageColorReadAccessEXT); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::NonCoherentColorAttachmentReadEXT); + builder.addExtension(spv::E_SPV_EXT_shader_tile_image); + } + + if (glslangIntermediate->getNonCoherentDepthAttachmentReadEXT()) { + builder.addCapability(spv::Capability::TileImageDepthReadAccessEXT); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::NonCoherentDepthAttachmentReadEXT); + builder.addExtension(spv::E_SPV_EXT_shader_tile_image); + } + + if (glslangIntermediate->getNonCoherentStencilAttachmentReadEXT()) { + builder.addCapability(spv::Capability::TileImageStencilReadAccessEXT); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::NonCoherentStencilAttachmentReadEXT); + builder.addExtension(spv::E_SPV_EXT_shader_tile_image); + } + + if (glslangIntermediate->getNonCoherentTileAttachmentReadQCOM()) { + builder.addCapability(spv::Capability::TileShadingQCOM); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::NonCoherentTileAttachmentReadQCOM); + builder.addExtension(spv::E_SPV_QCOM_tile_shading); + } + + if (glslangIntermediate->isDepthReplacing()) + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::DepthReplacing); + + if (glslangIntermediate->isStencilReplacing()) + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::StencilRefReplacingEXT); + + switch(glslangIntermediate->getDepth()) { + case glslang::EldGreater: mode = spv::ExecutionMode::DepthGreater; break; + case glslang::EldLess: mode = spv::ExecutionMode::DepthLess; break; + case glslang::EldUnchanged: mode = spv::ExecutionMode::DepthUnchanged; break; + default: mode = spv::ExecutionMode::Max; break; + } + + if (mode != spv::ExecutionMode::Max) + builder.addExecutionMode(shaderEntry, mode); + + switch (glslangIntermediate->getStencil()) { + case glslang::ElsRefUnchangedFrontAMD: mode = spv::ExecutionMode::StencilRefUnchangedFrontAMD; break; + case glslang::ElsRefGreaterFrontAMD: mode = spv::ExecutionMode::StencilRefGreaterFrontAMD; break; + case glslang::ElsRefLessFrontAMD: mode = spv::ExecutionMode::StencilRefLessFrontAMD; break; + case glslang::ElsRefUnchangedBackAMD: mode = spv::ExecutionMode::StencilRefUnchangedBackAMD; break; + case glslang::ElsRefGreaterBackAMD: mode = spv::ExecutionMode::StencilRefGreaterBackAMD; break; + case glslang::ElsRefLessBackAMD: mode = spv::ExecutionMode::StencilRefLessBackAMD; break; + default: mode = spv::ExecutionMode::Max; break; + } + + if (mode != spv::ExecutionMode::Max) + builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode); + switch (glslangIntermediate->getInterlockOrdering()) { + case glslang::EioPixelInterlockOrdered: mode = spv::ExecutionMode::PixelInterlockOrderedEXT; + break; + case glslang::EioPixelInterlockUnordered: mode = spv::ExecutionMode::PixelInterlockUnorderedEXT; + break; + case glslang::EioSampleInterlockOrdered: mode = spv::ExecutionMode::SampleInterlockOrderedEXT; + break; + case glslang::EioSampleInterlockUnordered: mode = spv::ExecutionMode::SampleInterlockUnorderedEXT; + break; + case glslang::EioShadingRateInterlockOrdered: mode = spv::ExecutionMode::ShadingRateInterlockOrderedEXT; + break; + case glslang::EioShadingRateInterlockUnordered: mode = spv::ExecutionMode::ShadingRateInterlockUnorderedEXT; + break; + default: mode = spv::ExecutionMode::Max; + break; + } + if (mode != spv::ExecutionMode::Max) { + builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode); + if (mode == spv::ExecutionMode::ShadingRateInterlockOrderedEXT || + mode == spv::ExecutionMode::ShadingRateInterlockUnorderedEXT) { + builder.addCapability(spv::Capability::FragmentShaderShadingRateInterlockEXT); + } else if (mode == spv::ExecutionMode::PixelInterlockOrderedEXT || + mode == spv::ExecutionMode::PixelInterlockUnorderedEXT) { + builder.addCapability(spv::Capability::FragmentShaderPixelInterlockEXT); + } else { + builder.addCapability(spv::Capability::FragmentShaderSampleInterlockEXT); + } + builder.addExtension(spv::E_SPV_EXT_fragment_shader_interlock); + } + break; + + case EShLangCompute: { + builder.addCapability(spv::Capability::Shader); + bool needSizeId = false; + for (int dim = 0; dim < 3; ++dim) { + if ((glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet)) { + needSizeId = true; + break; + } + } + if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6 && needSizeId) { + std::vector dimConstId; + for (int dim = 0; dim < 3; ++dim) { + bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet); + dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst)); + if (specConst) { + builder.addDecoration(dimConstId.back(), spv::Decoration::SpecId, + glslangIntermediate->getLocalSizeSpecId(dim)); + needSizeId = true; + } + } + builder.addExecutionModeId(shaderEntry, spv::ExecutionMode::LocalSizeId, dimConstId); + } else { + if (glslangIntermediate->getTileShadingRateQCOM(0) >= 1 || glslangIntermediate->getTileShadingRateQCOM(1) >= 1 || glslangIntermediate->getTileShadingRateQCOM(2) >= 1) { + auto rate_x = glslangIntermediate->getTileShadingRateQCOM(0); + auto rate_y = glslangIntermediate->getTileShadingRateQCOM(1); + auto rate_z = glslangIntermediate->getTileShadingRateQCOM(2); + rate_x = ( rate_x == 0 ? 1 : rate_x ); + rate_y = ( rate_y == 0 ? 1 : rate_y ); + rate_z = ( rate_z == 0 ? 1 : rate_z ); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::TileShadingRateQCOM, rate_x, rate_y, rate_z); + } else { + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::LocalSize, glslangIntermediate->getLocalSize(0), + glslangIntermediate->getLocalSize(1), + glslangIntermediate->getLocalSize(2)); + } + } + if (glslangIntermediate->getLayoutDerivativeModeNone() == glslang::LayoutDerivativeGroupQuads) { + builder.addCapability(spv::Capability::ComputeDerivativeGroupQuadsNV); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::DerivativeGroupQuadsNV); + builder.addExtension(spv::E_SPV_NV_compute_shader_derivatives); + } else if (glslangIntermediate->getLayoutDerivativeModeNone() == glslang::LayoutDerivativeGroupLinear) { + builder.addCapability(spv::Capability::ComputeDerivativeGroupLinearNV); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::DerivativeGroupLinearNV); + builder.addExtension(spv::E_SPV_NV_compute_shader_derivatives); + } + + if (glslangIntermediate->getNonCoherentTileAttachmentReadQCOM()) { + builder.addCapability(spv::Capability::TileShadingQCOM); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::NonCoherentTileAttachmentReadQCOM); + builder.addExtension(spv::E_SPV_QCOM_tile_shading); + } + + break; + } + case EShLangTessEvaluation: + case EShLangTessControl: + builder.addCapability(spv::Capability::Tessellation); + + glslang::TLayoutGeometry primitive; + + if (glslangIntermediate->getStage() == EShLangTessControl) { + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::OutputVertices, + glslangIntermediate->getVertices()); + primitive = glslangIntermediate->getOutputPrimitive(); + } else { + primitive = glslangIntermediate->getInputPrimitive(); + } + + switch (primitive) { + case glslang::ElgTriangles: mode = spv::ExecutionMode::Triangles; break; + case glslang::ElgQuads: mode = spv::ExecutionMode::Quads; break; + case glslang::ElgIsolines: mode = spv::ExecutionMode::Isolines; break; + default: mode = spv::ExecutionMode::Max; break; + } + if (mode != spv::ExecutionMode::Max) + builder.addExecutionMode(shaderEntry, mode); + + switch (glslangIntermediate->getVertexSpacing()) { + case glslang::EvsEqual: mode = spv::ExecutionMode::SpacingEqual; break; + case glslang::EvsFractionalEven: mode = spv::ExecutionMode::SpacingFractionalEven; break; + case glslang::EvsFractionalOdd: mode = spv::ExecutionMode::SpacingFractionalOdd; break; + default: mode = spv::ExecutionMode::Max; break; + } + if (mode != spv::ExecutionMode::Max) + builder.addExecutionMode(shaderEntry, mode); + + switch (glslangIntermediate->getVertexOrder()) { + case glslang::EvoCw: mode = spv::ExecutionMode::VertexOrderCw; break; + case glslang::EvoCcw: mode = spv::ExecutionMode::VertexOrderCcw; break; + default: mode = spv::ExecutionMode::Max; break; + } + if (mode != spv::ExecutionMode::Max) + builder.addExecutionMode(shaderEntry, mode); + + if (glslangIntermediate->getPointMode()) + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::PointMode); + break; + + case EShLangGeometry: + builder.addCapability(spv::Capability::Geometry); + switch (glslangIntermediate->getInputPrimitive()) { + case glslang::ElgPoints: mode = spv::ExecutionMode::InputPoints; break; + case glslang::ElgLines: mode = spv::ExecutionMode::InputLines; break; + case glslang::ElgLinesAdjacency: mode = spv::ExecutionMode::InputLinesAdjacency; break; + case glslang::ElgTriangles: mode = spv::ExecutionMode::Triangles; break; + case glslang::ElgTrianglesAdjacency: mode = spv::ExecutionMode::InputTrianglesAdjacency; break; + default: mode = spv::ExecutionMode::Max; break; + } + if (mode != spv::ExecutionMode::Max) + builder.addExecutionMode(shaderEntry, mode); + + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::Invocations, glslangIntermediate->getInvocations()); + + switch (glslangIntermediate->getOutputPrimitive()) { + case glslang::ElgPoints: mode = spv::ExecutionMode::OutputPoints; break; + case glslang::ElgLineStrip: mode = spv::ExecutionMode::OutputLineStrip; break; + case glslang::ElgTriangleStrip: mode = spv::ExecutionMode::OutputTriangleStrip; break; + default: mode = spv::ExecutionMode::Max; break; + } + if (mode != spv::ExecutionMode::Max) + builder.addExecutionMode(shaderEntry, mode); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::OutputVertices, glslangIntermediate->getVertices()); + break; + + case EShLangRayGen: + case EShLangIntersect: + case EShLangAnyHit: + case EShLangClosestHit: + case EShLangMiss: + case EShLangCallable: + { + auto& extensions = glslangIntermediate->getRequestedExtensions(); + if (extensions.find("GL_EXT_opacity_micromap") != extensions.end()) { + builder.addCapability(spv::Capability::RayTracingOpacityMicromapEXT); + builder.addExtension("SPV_EXT_opacity_micromap"); + } + if (extensions.find("GL_NV_ray_tracing") == extensions.end()) { + builder.addCapability(spv::Capability::RayTracingKHR); + builder.addExtension("SPV_KHR_ray_tracing"); + } + else { + builder.addCapability(spv::Capability::RayTracingNV); + builder.addExtension("SPV_NV_ray_tracing"); + } + if (glslangIntermediate->getStage() != EShLangRayGen && glslangIntermediate->getStage() != EShLangCallable) { + if (extensions.find("GL_EXT_ray_cull_mask") != extensions.end()) { + builder.addCapability(spv::Capability::RayCullMaskKHR); + builder.addExtension("SPV_KHR_ray_cull_mask"); + } + if (extensions.find("GL_EXT_ray_tracing_position_fetch") != extensions.end()) { + builder.addCapability(spv::Capability::RayTracingPositionFetchKHR); + builder.addExtension("SPV_KHR_ray_tracing_position_fetch"); + } + } + break; + } + case EShLangTask: + case EShLangMesh: + if(isMeshShaderExt) { + builder.addCapability(spv::Capability::MeshShadingEXT); + builder.addExtension(spv::E_SPV_EXT_mesh_shader); + } else { + builder.addCapability(spv::Capability::MeshShadingNV); + builder.addExtension(spv::E_SPV_NV_mesh_shader); + } + if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6) { + std::vector dimConstId; + for (int dim = 0; dim < 3; ++dim) { + bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet); + dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst)); + if (specConst) { + builder.addDecoration(dimConstId.back(), spv::Decoration::SpecId, + glslangIntermediate->getLocalSizeSpecId(dim)); + } + } + builder.addExecutionModeId(shaderEntry, spv::ExecutionMode::LocalSizeId, dimConstId); + } else { + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::LocalSize, glslangIntermediate->getLocalSize(0), + glslangIntermediate->getLocalSize(1), + glslangIntermediate->getLocalSize(2)); + } + if (glslangIntermediate->getStage() == EShLangMesh) { + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::OutputVertices, + glslangIntermediate->getVertices()); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::OutputPrimitivesNV, + glslangIntermediate->getPrimitives()); + + switch (glslangIntermediate->getOutputPrimitive()) { + case glslang::ElgPoints: mode = spv::ExecutionMode::OutputPoints; break; + case glslang::ElgLines: mode = spv::ExecutionMode::OutputLinesNV; break; + case glslang::ElgTriangles: mode = spv::ExecutionMode::OutputTrianglesNV; break; + default: mode = spv::ExecutionMode::Max; break; + } + if (mode != spv::ExecutionMode::Max) + builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode); + } + break; + + default: + break; + } + + // + // Add SPIR-V requirements (GL_EXT_spirv_intrinsics) + // + if (glslangIntermediate->hasSpirvRequirement()) { + const glslang::TSpirvRequirement& spirvRequirement = glslangIntermediate->getSpirvRequirement(); + + // Add SPIR-V extension requirement + for (auto& extension : spirvRequirement.extensions) + builder.addExtension(extension.c_str()); + + // Add SPIR-V capability requirement + for (auto capability : spirvRequirement.capabilities) + builder.addCapability(static_cast(capability)); + } + + // + // Add SPIR-V execution mode qualifiers (GL_EXT_spirv_intrinsics) + // + if (glslangIntermediate->hasSpirvExecutionMode()) { + const glslang::TSpirvExecutionMode spirvExecutionMode = glslangIntermediate->getSpirvExecutionMode(); + + // Add spirv_execution_mode + for (auto& mode : spirvExecutionMode.modes) { + if (!mode.second.empty()) { + std::vector literals; + TranslateLiterals(mode.second, literals); + builder.addExecutionMode(shaderEntry, static_cast(mode.first), literals); + } else + builder.addExecutionMode(shaderEntry, static_cast(mode.first)); + } + + // Add spirv_execution_mode_id + for (auto& modeId : spirvExecutionMode.modeIds) { + std::vector operandIds; + assert(!modeId.second.empty()); + for (auto extraOperand : modeId.second) { + if (extraOperand->getType().getQualifier().isSpecConstant()) + operandIds.push_back(getSymbolId(extraOperand->getAsSymbolNode())); + else + operandIds.push_back(createSpvConstant(*extraOperand)); + } + builder.addExecutionModeId(shaderEntry, static_cast(modeId.first), operandIds); + } + } +} + +// Finish creating SPV, after the traversal is complete. +void TGlslangToSpvTraverser::finishSpv(bool compileOnly) +{ + // If not linking, an entry point is not expected + if (!compileOnly) { + // Finish the entry point function + if (!entryPointTerminated) { + builder.setBuildPoint(shaderEntry->getLastBlock()); + builder.leaveFunction(); + } + + // finish off the entry-point SPV instruction by adding the Input/Output + entryPoint->reserveOperands(iOSet.size()); + for (auto id : iOSet) + entryPoint->addIdOperand(id); + } + + // Add capabilities, extensions, remove unneeded decorations, etc., + // based on the resulting SPIR-V. + // Note: WebGPU code generation must have the opportunity to aggressively + // prune unreachable merge blocks and continue targets. + builder.postProcess(compileOnly); +} + +// Write the SPV into 'out'. +void TGlslangToSpvTraverser::dumpSpv(std::vector& out) +{ + builder.dump(out); +} + +// +// Implement the traversal functions. +// +// Return true from interior nodes to have the external traversal +// continue on to children. Return false if children were +// already processed. +// + +// +// Symbols can turn into +// - uniform/input reads +// - output writes +// - complex lvalue base setups: foo.bar[3].... , where we see foo and start up an access chain +// - something simple that degenerates into the last bullet +// +void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) +{ + // We update the line information even though no code might be generated here + // This is helpful to yield correct lines for control flow instructions + if (!linkageOnly) { + builder.setDebugSourceLocation(symbol->getLoc().line, symbol->getLoc().getFilename()); + } + + if (symbol->getBasicType() == glslang::EbtFunction) { + return; + } + + SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); + if (symbol->getType().isStruct()) + glslangTypeToIdMap[symbol->getType().getStruct()] = symbol->getId(); + + if (symbol->getType().getQualifier().isSpecConstant()) + spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); +#ifdef ENABLE_HLSL + // Skip symbol handling if it is string-typed + if (symbol->getBasicType() == glslang::EbtString) + return; +#endif + + // getSymbolId() will set up all the IO decorations on the first call. + // Formal function parameters were mapped during makeFunctions(). + spv::Id id = getSymbolId(symbol); + + if (symbol->getType().getQualifier().isTaskPayload()) + taskPayloadID = id; // cache the taskPayloadID to be used it as operand for OpEmitMeshTasksEXT + + if (builder.isPointer(id)) { + if (!symbol->getType().getQualifier().isParamInput() && + !symbol->getType().getQualifier().isParamOutput()) { + // Include all "static use" and "linkage only" interface variables on the OpEntryPoint instruction + // Consider adding to the OpEntryPoint interface list. + // Only looking at structures if they have at least one member. + if (!symbol->getType().isStruct() || symbol->getType().getStruct()->size() > 0) { + spv::StorageClass sc = builder.getStorageClass(id); + // Before SPIR-V 1.4, we only want to include Input and Output. + // Starting with SPIR-V 1.4, we want all globals. + if ((glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_4 && builder.isGlobalVariable(id)) || + (sc == spv::StorageClass::Input || sc == spv::StorageClass::Output)) { + iOSet.insert(id); + } + } + } + + // If the SPIR-V type is required to be different than the AST type + // (for ex SubgroupMasks or 3x4 ObjectToWorld/WorldToObject matrices), + // translate now from the SPIR-V type to the AST type, for the consuming + // operation. + // Note this turns it from an l-value to an r-value. + // Currently, all symbols needing this are inputs; avoid the map lookup when non-input. + if (symbol->getType().getQualifier().storage == glslang::EvqVaryingIn) + id = translateForcedType(id); + } + + // Only process non-linkage-only nodes for generating actual static uses + if (! linkageOnly || symbol->getQualifier().isSpecConstant()) { + // Prepare to generate code for the access + + // L-value chains will be computed left to right. We're on the symbol now, + // which is the left-most part of the access chain, so now is "clear" time, + // followed by setting the base. + builder.clearAccessChain(); + + // For now, we consider all user variables as being in memory, so they are pointers, + // except for + // A) R-Value arguments to a function, which are an intermediate object. + // See comments in handleUserFunctionCall(). + // B) Specialization constants (normal constants don't even come in as a variable), + // These are also pure R-values. + // C) R-Values from type translation, see above call to translateForcedType() + glslang::TQualifier qualifier = symbol->getQualifier(); + if (qualifier.isSpecConstant() || rValueParameters.find(symbol->getId()) != rValueParameters.end() || + !builder.isPointerType(builder.getTypeId(id))) + builder.setAccessChainRValue(id); + else + builder.setAccessChainLValue(id); + } + +#ifdef ENABLE_HLSL + // Process linkage-only nodes for any special additional interface work. + if (linkageOnly) { + if (glslangIntermediate->getHlslFunctionality1()) { + // Map implicit counter buffers to their originating buffers, which should have been + // seen by now, given earlier pruning of unused counters, and preservation of order + // of declaration. + if (symbol->getType().getQualifier().isUniformOrBuffer()) { + if (!glslangIntermediate->hasCounterBufferName(symbol->getName())) { + // Save possible originating buffers for counter buffers, keyed by + // making the potential counter-buffer name. + std::string keyName = symbol->getName().c_str(); + keyName = glslangIntermediate->addCounterBufferName(keyName); + counterOriginator[keyName] = symbol; + } else { + // Handle a counter buffer, by finding the saved originating buffer. + std::string keyName = symbol->getName().c_str(); + auto it = counterOriginator.find(keyName); + if (it != counterOriginator.end()) { + id = getSymbolId(it->second); + if (id != spv::NoResult) { + spv::Id counterId = getSymbolId(symbol); + if (counterId != spv::NoResult) { + builder.addExtension("SPV_GOOGLE_hlsl_functionality1"); + builder.addDecorationId(id, spv::Decoration::HlslCounterBufferGOOGLE, counterId); + } + } + } + } + } + } + } +#endif +} + +bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::TIntermBinary* node) +{ + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + if (node->getLeft()->getAsSymbolNode() != nullptr && node->getLeft()->getType().isStruct()) { + glslangTypeToIdMap[node->getLeft()->getType().getStruct()] = node->getLeft()->getAsSymbolNode()->getId(); + } + if (node->getRight()->getAsSymbolNode() != nullptr && node->getRight()->getType().isStruct()) { + glslangTypeToIdMap[node->getRight()->getType().getStruct()] = node->getRight()->getAsSymbolNode()->getId(); + } + + SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); + if (node->getType().getQualifier().isSpecConstant()) + spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); + + // First, handle special cases + switch (node->getOp()) { + case glslang::EOpAssign: + case glslang::EOpAddAssign: + case glslang::EOpSubAssign: + case glslang::EOpMulAssign: + case glslang::EOpVectorTimesMatrixAssign: + case glslang::EOpVectorTimesScalarAssign: + case glslang::EOpMatrixTimesScalarAssign: + case glslang::EOpMatrixTimesMatrixAssign: + case glslang::EOpDivAssign: + case glslang::EOpModAssign: + case glslang::EOpAndAssign: + case glslang::EOpInclusiveOrAssign: + case glslang::EOpExclusiveOrAssign: + case glslang::EOpLeftShiftAssign: + case glslang::EOpRightShiftAssign: + // A bin-op assign "a += b" means the same thing as "a = a + b" + // where a is evaluated before b. For a simple assignment, GLSL + // says to evaluate the left before the right. So, always, left + // node then right node. + { + // get the left l-value, save it away + builder.clearAccessChain(); + node->getLeft()->traverse(this); + spv::Builder::AccessChain lValue = builder.getAccessChain(); + + // evaluate the right + builder.clearAccessChain(); + node->getRight()->traverse(this); + spv::Id rValue = accessChainLoad(node->getRight()->getType()); + + // reset line number for assignment + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + + if (node->getOp() != glslang::EOpAssign) { + // the left is also an r-value + builder.setAccessChain(lValue); + spv::Id leftRValue = accessChainLoad(node->getLeft()->getType()); + + // do the operation + spv::Builder::AccessChain::CoherentFlags coherentFlags = TranslateCoherent(node->getLeft()->getType()); + coherentFlags |= TranslateCoherent(node->getRight()->getType()); + OpDecorations decorations = { TranslatePrecisionDecoration(node->getOperationPrecision()), + TranslateNoContractionDecoration(node->getType().getQualifier()), + TranslateNonUniformDecoration(coherentFlags) }; + rValue = createBinaryOperation(node->getOp(), decorations, + convertGlslangToSpvType(node->getType()), leftRValue, rValue, + node->getType().getBasicType()); + + // these all need their counterparts in createBinaryOperation() + assert(rValue != spv::NoResult); + } + + // store the result + builder.setAccessChain(lValue); + multiTypeStore(node->getLeft()->getType(), rValue); + + // assignments are expressions having an rValue after they are evaluated... + builder.clearAccessChain(); + builder.setAccessChainRValue(rValue); + } + return false; + case glslang::EOpIndexDirect: + case glslang::EOpIndexDirectStruct: + { + // Structure, array, matrix, or vector indirection with statically known index. + // Get the left part of the access chain. + node->getLeft()->traverse(this); + + // Add the next element in the chain + + const int glslangIndex = node->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); + if (! node->getLeft()->getType().isArray() && + node->getLeft()->getType().isVector() && + node->getOp() == glslang::EOpIndexDirect) { + // Swizzle is uniform so propagate uniform into access chain + spv::Builder::AccessChain::CoherentFlags coherentFlags = TranslateCoherent(node->getLeft()->getType()); + coherentFlags.nonUniform = 0; + // This is essentially a hard-coded vector swizzle of size 1, + // so short circuit the access-chain stuff with a swizzle. + std::vector swizzle; + swizzle.push_back(glslangIndex); + int dummySize; + builder.accessChainPushSwizzle(swizzle, convertGlslangToSpvType(node->getLeft()->getType()), + coherentFlags, + glslangIntermediate->getBaseAlignmentScalar( + node->getLeft()->getType(), dummySize)); + } else { + + // Load through a block reference is performed with a dot operator that + // is mapped to EOpIndexDirectStruct. When we get to the actual reference, + // do a load and reset the access chain. + if (node->getLeft()->isReference() && + !node->getLeft()->getType().isArray() && + node->getOp() == glslang::EOpIndexDirectStruct) + { + spv::Id left = accessChainLoad(node->getLeft()->getType()); + builder.clearAccessChain(); + builder.setAccessChainLValue(left); + } + + int spvIndex = glslangIndex; + if (node->getLeft()->getBasicType() == glslang::EbtBlock && + node->getOp() == glslang::EOpIndexDirectStruct) + { + // This may be, e.g., an anonymous block-member selection, which generally need + // index remapping due to hidden members in anonymous blocks. + long long glslangId = glslangTypeToIdMap[node->getLeft()->getType().getStruct()]; + if (memberRemapper.find(glslangId) != memberRemapper.end()) { + std::vector& remapper = memberRemapper[glslangId]; + assert(remapper.size() > 0); + spvIndex = remapper[glslangIndex]; + } + } + + // Struct reference propagates uniform lvalue + spv::Builder::AccessChain::CoherentFlags coherentFlags = + TranslateCoherent(node->getLeft()->getType()); + coherentFlags.nonUniform = 0; + + // normal case for indexing array or structure or block + if ((node->getRight()->getType().getBasicType() == glslang::EbtUint && glslangIntermediate->usingPromoteUint32Indices()) || + node->getRight()->getType().contains64BitInt()) { + int64_t idx = node->getRight()->getType().contains64BitInt() ? + node->getRight()->getAsConstantUnion()->getConstArray()[0].getI64Const() : + node->getRight()->getAsConstantUnion()->getConstArray()[0].getUConst(); + builder.accessChainPush(builder.makeInt64Constant(idx), + coherentFlags, + node->getLeft()->getType().getBufferReferenceAlignment()); + + } else { + builder.accessChainPush(builder.makeIntConstant(spvIndex), + coherentFlags, + node->getLeft()->getType().getBufferReferenceAlignment()); + } + // Add capabilities here for accessing PointSize and clip/cull distance. + // We have deferred generation of associated capabilities until now. + if (node->getLeft()->getType().isStruct() && ! node->getLeft()->getType().isArray()) + declareUseOfStructMember(*(node->getLeft()->getType().getStruct()), glslangIndex); + } + } + return false; + case glslang::EOpIndexIndirect: + { + // Array, matrix, or vector indirection with variable index. + // Will use native SPIR-V access-chain for and array indirection; + // matrices are arrays of vectors, so will also work for a matrix. + // Will use the access chain's 'component' for variable index into a vector. + + // This adapter is building access chains left to right. + // Set up the access chain to the left. + node->getLeft()->traverse(this); + + // save it so that computing the right side doesn't trash it + spv::Builder::AccessChain partial = builder.getAccessChain(); + + // compute the next index in the chain + builder.clearAccessChain(); + node->getRight()->traverse(this); + spv::Id index = accessChainLoad(node->getRight()->getType()); + + // Zero-extend smaller unsigned integer types for array indexing. + // SPIR-V OpAccessChain treats indices as signed, so we need to zero-extend + // unsigned types to preserve their values (signed types are fine as-is). + spv::Id indexType = builder.getTypeId(index); + if (builder.isUintType(indexType) && builder.getScalarTypeWidth(indexType) < 32) { + // Zero-extend unsigned types to preserve their values + spv::Id uintType = builder.makeUintType(32); + index = builder.createUnaryOp(spv::Op::OpUConvert, uintType, index); + } + + addIndirectionIndexCapabilities(node->getLeft()->getType(), node->getRight()->getType()); + + // restore the saved access chain + builder.setAccessChain(partial); + + // Only if index is nonUniform should we propagate nonUniform into access chain + spv::Builder::AccessChain::CoherentFlags index_flags = TranslateCoherent(node->getRight()->getType()); + spv::Builder::AccessChain::CoherentFlags coherent_flags = TranslateCoherent(node->getLeft()->getType()); + coherent_flags.nonUniform = index_flags.nonUniform; + + if (! node->getLeft()->getType().isArray() && node->getLeft()->getType().isVector()) { + int dummySize; + builder.accessChainPushComponent( + index, convertGlslangToSpvType(node->getLeft()->getType()), coherent_flags, + glslangIntermediate->getBaseAlignmentScalar(node->getLeft()->getType(), + dummySize)); + } else { + if (glslangIntermediate->usingPromoteUint32Indices() && + node->getRight()->getType().getBasicType() == glslang::EbtUint) { + index = createIntWidthConversion(index, 0, builder.makeIntegerType(64, true), glslang::EbtInt64, node->getRight()->getType().getBasicType()); + } + + builder.accessChainPush(index, coherent_flags, + node->getLeft()->getType().getBufferReferenceAlignment()); + } + } + return false; + case glslang::EOpVectorSwizzle: + { + node->getLeft()->traverse(this); + std::vector swizzle; + convertSwizzle(*node->getRight()->getAsAggregate(), swizzle); + int dummySize; + builder.accessChainPushSwizzle(swizzle, convertGlslangToSpvType(node->getLeft()->getType()), + TranslateCoherent(node->getLeft()->getType()), + glslangIntermediate->getBaseAlignmentScalar(node->getLeft()->getType(), + dummySize)); + } + return false; + case glslang::EOpMatrixSwizzle: + logger->missingFunctionality("matrix swizzle"); + return true; + case glslang::EOpLogicalOr: + case glslang::EOpLogicalAnd: + { + + // These may require short circuiting, but can sometimes be done as straight + // binary operations. The right operand must be short circuited if it has + // side effects, and should probably be if it is complex. + if (isTrivial(node->getRight()->getAsTyped())) + break; // handle below as a normal binary operation + // otherwise, we need to do dynamic short circuiting on the right operand + spv::Id result = createShortCircuit(node->getOp(), *node->getLeft()->getAsTyped(), + *node->getRight()->getAsTyped()); + builder.clearAccessChain(); + builder.setAccessChainRValue(result); + } + return false; + default: + break; + } + + // Assume generic binary op... + + // get right operand + builder.clearAccessChain(); + node->getLeft()->traverse(this); + spv::Id left = accessChainLoad(node->getLeft()->getType()); + + // get left operand + builder.clearAccessChain(); + node->getRight()->traverse(this); + spv::Id right = accessChainLoad(node->getRight()->getType()); + + // get result + OpDecorations decorations = { TranslatePrecisionDecoration(node->getOperationPrecision()), + TranslateNoContractionDecoration(node->getType().getQualifier()), + TranslateNonUniformDecoration(node->getType().getQualifier()) }; + spv::Id result = createBinaryOperation(node->getOp(), decorations, + convertGlslangToSpvType(node->getType()), left, right, + node->getLeft()->getType().getBasicType()); + + builder.clearAccessChain(); + if (! result) { + logger->missingFunctionality("unknown glslang binary operation"); + return true; // pick up a child as the place-holder result + } else { + builder.setAccessChainRValue(result); + return false; + } +} + +spv::Id TGlslangToSpvTraverser::convertLoadedBoolInUniformToUint(const glslang::TType& type, + spv::Id nominalTypeId, + spv::Id loadedId) +{ + if (builder.isScalarType(nominalTypeId)) { + // Conversion for bool + spv::Id boolType = builder.makeBoolType(); + if (nominalTypeId != boolType) + return builder.createBinOp(spv::Op::OpINotEqual, boolType, loadedId, builder.makeUintConstant(0)); + } else if (builder.isVectorType(nominalTypeId)) { + // Conversion for bvec + int vecSize = builder.getNumTypeComponents(nominalTypeId); + spv::Id bvecType = builder.makeVectorType(builder.makeBoolType(), vecSize); + if (nominalTypeId != bvecType) + loadedId = builder.createBinOp(spv::Op::OpINotEqual, bvecType, loadedId, + makeSmearedConstant(builder.makeUintConstant(0), vecSize)); + } else if (builder.isArrayType(nominalTypeId)) { + // Conversion for bool array + spv::Id boolArrayTypeId = convertGlslangToSpvType(type); + if (nominalTypeId != boolArrayTypeId) + { + // Use OpCopyLogical from SPIR-V 1.4 if available. + if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_4) + return builder.createUnaryOp(spv::Op::OpCopyLogical, boolArrayTypeId, loadedId); + + glslang::TType glslangElementType(type, 0); + spv::Id elementNominalTypeId = builder.getContainedTypeId(nominalTypeId); + std::vector constituents; + for (int index = 0; index < type.getOuterArraySize(); ++index) { + // get the element + spv::Id elementValue = builder.createCompositeExtract(loadedId, elementNominalTypeId, index); + + // recursively convert it + spv::Id elementConvertedValue = convertLoadedBoolInUniformToUint(glslangElementType, elementNominalTypeId, elementValue); + constituents.push_back(elementConvertedValue); + } + return builder.createCompositeConstruct(boolArrayTypeId, constituents); + } + } + + return loadedId; +} + +// Figure out what, if any, type changes are needed when accessing a specific built-in. +// Returns . +// Also see comment for 'forceType', regarding tracking SPIR-V-required types. +std::pair TGlslangToSpvTraverser::getForcedType(glslang::TBuiltInVariable glslangBuiltIn, + const glslang::TType& glslangType) +{ + switch(glslangBuiltIn) + { + case glslang::EbvSubGroupEqMask: + case glslang::EbvSubGroupGeMask: + case glslang::EbvSubGroupGtMask: + case glslang::EbvSubGroupLeMask: + case glslang::EbvSubGroupLtMask: { + // these require changing a 64-bit scaler -> a vector of 32-bit components + if (glslangType.isVector()) + break; + spv::Id ivec4_type = builder.makeVectorType(builder.makeUintType(32), 4); + spv::Id uint64_type = builder.makeUintType(64); + std::pair ret(ivec4_type, uint64_type); + return ret; + } + // There are no SPIR-V builtins defined for these and map onto original non-transposed + // builtins. During visitBinary we insert a transpose + case glslang::EbvWorldToObject3x4: + case glslang::EbvObjectToWorld3x4: { + spv::Id mat43 = builder.makeMatrixType(builder.makeFloatType(32), 4, 3); + spv::Id mat34 = builder.makeMatrixType(builder.makeFloatType(32), 3, 4); + std::pair ret(mat43, mat34); + return ret; + } + default: + break; + } + + std::pair ret(spv::NoType, spv::NoType); + return ret; +} + +// For an object previously identified (see getForcedType() and forceType) +// as needing type translations, do the translation needed for a load, turning +// an L-value into in R-value. +spv::Id TGlslangToSpvTraverser::translateForcedType(spv::Id object) +{ + const auto forceIt = forceType.find(object); + if (forceIt == forceType.end()) + return object; + + spv::Id desiredTypeId = forceIt->second; + spv::Id objectTypeId = builder.getTypeId(object); + assert(builder.isPointerType(objectTypeId)); + objectTypeId = builder.getContainedTypeId(objectTypeId); + if (builder.isVectorType(objectTypeId) && + builder.getScalarTypeWidth(builder.getContainedTypeId(objectTypeId)) == 32) { + if (builder.getScalarTypeWidth(desiredTypeId) == 64) { + // handle 32-bit v.xy* -> 64-bit + builder.clearAccessChain(); + builder.setAccessChainLValue(object); + object = builder.accessChainLoad(spv::NoPrecision, spv::Decoration::Max, spv::Decoration::Max, objectTypeId); + std::vector components; + components.push_back(builder.createCompositeExtract(object, builder.getContainedTypeId(objectTypeId), 0)); + components.push_back(builder.createCompositeExtract(object, builder.getContainedTypeId(objectTypeId), 1)); + + spv::Id vecType = builder.makeVectorType(builder.getContainedTypeId(objectTypeId), 2); + return builder.createUnaryOp(spv::Op::OpBitcast, desiredTypeId, + builder.createCompositeConstruct(vecType, components)); + } else { + logger->missingFunctionality("forcing 32-bit vector type to non 64-bit scalar"); + } + } else if (builder.isMatrixType(objectTypeId)) { + // There are no SPIR-V builtins defined for 3x4 variants of ObjectToWorld/WorldToObject + // and we insert a transpose after loading the original non-transposed builtins + builder.clearAccessChain(); + builder.setAccessChainLValue(object); + object = builder.accessChainLoad(spv::NoPrecision, spv::Decoration::Max, spv::Decoration::Max, objectTypeId); + return builder.createUnaryOp(spv::Op::OpTranspose, desiredTypeId, object); + + } else { + logger->missingFunctionality("forcing non 32-bit vector type"); + } + + return object; +} + +bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TIntermUnary* node) +{ + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + + SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); + if (node->getType().getQualifier().isSpecConstant()) + spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); + + spv::Id result = spv::NoResult; + + // try texturing first + result = createImageTextureFunctionCall(node); + if (result != spv::NoResult) { + builder.clearAccessChain(); + builder.setAccessChainRValue(result); + + return false; // done with this node + } + + // Non-texturing. + + if (node->getOp() == glslang::EOpArrayLength) { + // Quite special; won't want to evaluate the operand. + + // Currently, the front-end does not allow .length() on an array until it is sized, + // except for the last block membeor of an SSBO. + // TODO: If this changes, link-time sized arrays might show up here, and need their + // size extracted. + + // Normal .length() would have been constant folded by the front-end. + // So, this has to be block.lastMember.length(). + // SPV wants "block" and member number as the operands, go get them. + + uint32_t bits = node->getType().contains64BitInt() ? 64 : 32; + + spv::Id length; + if (node->getOperand()->getType().isCoopMat()) { + spv::Id typeId = convertGlslangToSpvType(node->getOperand()->getType()); + assert(builder.isCooperativeMatrixType(typeId)); + + if (node->getOperand()->getType().isCoopMatKHR()) { + length = builder.createCooperativeMatrixLengthKHR(typeId); + } else { + spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); + length = builder.createCooperativeMatrixLengthNV(typeId); + } + } else if (node->getOperand()->getType().isCoopVecNV()) { + spv::Id typeId = convertGlslangToSpvType(node->getOperand()->getType()); + length = builder.getCooperativeVectorNumComponents(typeId); + } else { + glslang::TIntermTyped* block = node->getOperand()->getAsBinaryNode()->getLeft(); + block->traverse(this); + unsigned int member = node->getOperand()->getAsBinaryNode()->getRight()->getAsConstantUnion() + ->getConstArray()[0].getUConst(); + length = builder.createArrayLength(builder.accessChainGetLValue(), member, bits); + } + + // GLSL semantics say the result of .length() is an int, while SPIR-V says + // signedness must be 0. So, convert from SPIR-V unsigned back to GLSL's + // AST expectation of a signed result. + if (glslangIntermediate->getSource() == glslang::EShSourceGlsl) { + if (builder.isInSpecConstCodeGenMode()) { + length = builder.createBinOp(spv::Op::OpIAdd, builder.makeIntType(bits), length, builder.makeIntConstant(0)); + } else { + length = builder.createUnaryOp(spv::Op::OpBitcast, builder.makeIntType(bits), length); + } + } + + builder.clearAccessChain(); + builder.setAccessChainRValue(length); + + return false; + } + + // Force variable declaration - Debug Mode Only + if (node->getOp() == glslang::EOpDeclare) { + builder.clearAccessChain(); + node->getOperand()->traverse(this); + builder.clearAccessChain(); + return false; + } + + // Start by evaluating the operand + + // Does it need a swizzle inversion? If so, evaluation is inverted; + // operate first on the swizzle base, then apply the swizzle. + spv::Id invertedType = spv::NoType; + auto resultType = [&invertedType, &node, this](){ return invertedType != spv::NoType ? + invertedType : convertGlslangToSpvType(node->getType()); }; + if (node->getOp() == glslang::EOpInterpolateAtCentroid) + invertedType = getInvertedSwizzleType(*node->getOperand()); + + builder.clearAccessChain(); + TIntermNode *operandNode; + if (invertedType != spv::NoType) + operandNode = node->getOperand()->getAsBinaryNode()->getLeft(); + else + operandNode = node->getOperand(); + + operandNode->traverse(this); + + spv::Id operand = spv::NoResult; + + spv::Builder::AccessChain::CoherentFlags lvalueCoherentFlags; + + const auto hitObjectOpsWithLvalue = [](glslang::TOperator op) { + switch(op) { + case glslang::EOpReorderThreadNV: + case glslang::EOpHitObjectGetCurrentTimeNV: + case glslang::EOpHitObjectGetHitKindNV: + case glslang::EOpHitObjectGetPrimitiveIndexNV: + case glslang::EOpHitObjectGetGeometryIndexNV: + case glslang::EOpHitObjectGetInstanceIdNV: + case glslang::EOpHitObjectGetInstanceCustomIndexNV: + case glslang::EOpHitObjectGetObjectRayDirectionNV: + case glslang::EOpHitObjectGetObjectRayOriginNV: + case glslang::EOpHitObjectGetWorldRayDirectionNV: + case glslang::EOpHitObjectGetWorldRayOriginNV: + case glslang::EOpHitObjectGetWorldToObjectNV: + case glslang::EOpHitObjectGetObjectToWorldNV: + case glslang::EOpHitObjectGetRayTMaxNV: + case glslang::EOpHitObjectGetRayTMinNV: + case glslang::EOpHitObjectIsEmptyNV: + case glslang::EOpHitObjectIsHitNV: + case glslang::EOpHitObjectIsMissNV: + case glslang::EOpHitObjectRecordEmptyNV: + case glslang::EOpHitObjectGetShaderBindingTableRecordIndexNV: + case glslang::EOpHitObjectGetShaderRecordBufferHandleNV: + case glslang::EOpHitObjectGetClusterIdNV: + case glslang::EOpHitObjectGetSpherePositionNV: + case glslang::EOpHitObjectGetSphereRadiusNV: + case glslang::EOpHitObjectIsSphereHitNV: + case glslang::EOpHitObjectIsLSSHitNV: + case glslang::EOpReorderThreadEXT: + case glslang::EOpHitObjectGetCurrentTimeEXT: + case glslang::EOpHitObjectGetHitKindEXT: + case glslang::EOpHitObjectGetPrimitiveIndexEXT: + case glslang::EOpHitObjectGetGeometryIndexEXT: + case glslang::EOpHitObjectGetInstanceIdEXT: + case glslang::EOpHitObjectGetInstanceCustomIndexEXT: + case glslang::EOpHitObjectGetObjectRayDirectionEXT: + case glslang::EOpHitObjectGetObjectRayOriginEXT: + case glslang::EOpHitObjectGetWorldRayDirectionEXT: + case glslang::EOpHitObjectGetWorldRayOriginEXT: + case glslang::EOpHitObjectGetWorldToObjectEXT: + case glslang::EOpHitObjectGetObjectToWorldEXT: + case glslang::EOpHitObjectGetRayTMaxEXT: + case glslang::EOpHitObjectGetRayTMinEXT: + case glslang::EOpHitObjectGetRayFlagsEXT: + case glslang::EOpHitObjectIsEmptyEXT: + case glslang::EOpHitObjectIsHitEXT: + case glslang::EOpHitObjectIsMissEXT: + case glslang::EOpHitObjectRecordEmptyEXT: + case glslang::EOpHitObjectGetShaderBindingTableRecordIndexEXT: + case glslang::EOpHitObjectGetShaderRecordBufferHandleEXT: + return true; + default: + return false; + } + }; + + if (node->getOp() == glslang::EOpAtomicCounterIncrement || + node->getOp() == glslang::EOpAtomicCounterDecrement || + node->getOp() == glslang::EOpAtomicCounter || + (node->getOp() == glslang::EOpInterpolateAtCentroid && + glslangIntermediate->getSource() != glslang::EShSourceHlsl) || + node->getOp() == glslang::EOpRayQueryProceed || + node->getOp() == glslang::EOpRayQueryGetRayTMin || + node->getOp() == glslang::EOpRayQueryGetRayFlags || + node->getOp() == glslang::EOpRayQueryGetWorldRayOrigin || + node->getOp() == glslang::EOpRayQueryGetWorldRayDirection || + node->getOp() == glslang::EOpRayQueryGetIntersectionCandidateAABBOpaque || + node->getOp() == glslang::EOpRayQueryTerminate || + node->getOp() == glslang::EOpRayQueryConfirmIntersection || + (node->getOp() == glslang::EOpSpirvInst && operandNode->getAsTyped()->getQualifier().isSpirvByReference()) || + hitObjectOpsWithLvalue(node->getOp())) { + operand = builder.accessChainGetLValue(); // Special case l-value operands + lvalueCoherentFlags = builder.getAccessChain().coherentFlags; + lvalueCoherentFlags |= TranslateCoherent(operandNode->getAsTyped()->getType()); + } else if (operandNode->getAsTyped()->getQualifier().isSpirvLiteral()) { + // Will be translated to a literal value, make a placeholder here + operand = spv::NoResult; + } else { + operand = accessChainLoad(node->getOperand()->getType()); + } + + OpDecorations decorations = { TranslatePrecisionDecoration(node->getOperationPrecision()), + TranslateNoContractionDecoration(node->getType().getQualifier()), + TranslateNonUniformDecoration(node->getType().getQualifier()) }; + + // it could be a conversion + if (! result) { + result = createConversion(node->getOp(), decorations, resultType(), operand, + node->getType().getBasicType(), node->getOperand()->getBasicType()); + if (result) { + if (node->getType().isCoopMatKHR() && node->getOperand()->getAsTyped()->getType().isCoopMatKHR() && + !node->getAsTyped()->getType().sameCoopMatUse(node->getOperand()->getAsTyped()->getType())) { + // Conversions that change use need CapabilityCooperativeMatrixConversionsNV + builder.addCapability(spv::Capability::CooperativeMatrixConversionsNV); + builder.addExtension(spv::E_SPV_NV_cooperative_matrix2); + } + } + } + + // if not, then possibly an operation + if (! result) + result = createUnaryOperation(node->getOp(), decorations, resultType(), operand, + node->getOperand()->getBasicType(), lvalueCoherentFlags, node->getType()); + + // it could be attached to a SPIR-V intruction + if (!result) { + if (node->getOp() == glslang::EOpSpirvInst) { + const auto& spirvInst = node->getSpirvInstruction(); + if (spirvInst.set == "") { + spv::IdImmediate idImmOp = {true, operand}; + if (operandNode->getAsTyped()->getQualifier().isSpirvLiteral()) { + // Translate the constant to a literal value + std::vector literals; + glslang::TVector constants; + constants.push_back(operandNode->getAsConstantUnion()); + TranslateLiterals(constants, literals); + idImmOp = {false, literals[0]}; + } + + if (node->getBasicType() == glslang::EbtVoid) + builder.createNoResultOp(static_cast(spirvInst.id), {idImmOp}); + else + result = builder.createOp(static_cast(spirvInst.id), resultType(), {idImmOp}); + } else { + result = builder.createBuiltinCall( + resultType(), spirvInst.set == "GLSL.std.450" ? stdBuiltins : getExtBuiltins(spirvInst.set.c_str()), + spirvInst.id, {operand}); + } + + if (node->getBasicType() == glslang::EbtVoid) + return false; // done with this node + } + } + + if (result) { + if (invertedType) { + result = createInvertedSwizzle(decorations.precision, *node->getOperand(), result); + decorations.addNonUniform(builder, result); + } + + builder.clearAccessChain(); + builder.setAccessChainRValue(result); + + return false; // done with this node + } + + // it must be a special case, check... + switch (node->getOp()) { + case glslang::EOpPostIncrement: + case glslang::EOpPostDecrement: + case glslang::EOpPreIncrement: + case glslang::EOpPreDecrement: + { + // we need the integer value "1" or the floating point "1.0" to add/subtract + spv::Id one = 0; + if (node->getBasicType() == glslang::EbtFloat) + one = builder.makeFloatConstant(1.0F); + else if (node->getBasicType() == glslang::EbtDouble) + one = builder.makeDoubleConstant(1.0); + else if (node->getBasicType() == glslang::EbtFloat16) + one = builder.makeFloat16Constant(1.0F); + else if (node->getBasicType() == glslang::EbtBFloat16) + one = builder.makeBFloat16Constant(1.0F); + else if (node->getBasicType() == glslang::EbtFloatE5M2) + one = builder.makeFloatE5M2Constant(1.0F); + else if (node->getBasicType() == glslang::EbtFloatE4M3) + one = builder.makeFloatE4M3Constant(1.0F); + else if (node->getBasicType() == glslang::EbtInt8 || node->getBasicType() == glslang::EbtUint8) + one = builder.makeInt8Constant(1); + else if (node->getBasicType() == glslang::EbtInt16 || node->getBasicType() == glslang::EbtUint16) + one = builder.makeInt16Constant(1); + else if (node->getBasicType() == glslang::EbtInt64 || node->getBasicType() == glslang::EbtUint64) + one = builder.makeInt64Constant(1); + else + one = builder.makeIntConstant(1); + glslang::TOperator op; + if (node->getOp() == glslang::EOpPreIncrement || + node->getOp() == glslang::EOpPostIncrement) + op = glslang::EOpAdd; + else + op = glslang::EOpSub; + + spv::Id result = createBinaryOperation(op, decorations, + convertGlslangToSpvType(node->getType()), operand, one, + node->getType().getBasicType()); + assert(result != spv::NoResult); + + // The result of operation is always stored, but conditionally the + // consumed result. The consumed result is always an r-value. + builder.accessChainStore(result, + TranslateNonUniformDecoration(builder.getAccessChain().coherentFlags)); + builder.clearAccessChain(); + if (node->getOp() == glslang::EOpPreIncrement || + node->getOp() == glslang::EOpPreDecrement) + builder.setAccessChainRValue(result); + else + builder.setAccessChainRValue(operand); + } + + return false; + + case glslang::EOpAssumeEXT: + builder.addCapability(spv::Capability::ExpectAssumeKHR); + builder.addExtension(spv::E_SPV_KHR_expect_assume); + builder.createNoResultOp(spv::Op::OpAssumeTrueKHR, operand); + return false; + case glslang::EOpEmitStreamVertex: + builder.createNoResultOp(spv::Op::OpEmitStreamVertex, operand); + return false; + case glslang::EOpEndStreamPrimitive: + builder.createNoResultOp(spv::Op::OpEndStreamPrimitive, operand); + return false; + case glslang::EOpRayQueryTerminate: + builder.createNoResultOp(spv::Op::OpRayQueryTerminateKHR, operand); + return false; + case glslang::EOpRayQueryConfirmIntersection: + builder.createNoResultOp(spv::Op::OpRayQueryConfirmIntersectionKHR, operand); + return false; + case glslang::EOpReorderThreadNV: + builder.createNoResultOp(spv::Op::OpReorderThreadWithHitObjectNV, operand); + return false; + case glslang::EOpReorderThreadEXT: + builder.createNoResultOp(spv::Op::OpReorderThreadWithHitObjectEXT, operand); + return false; + case glslang::EOpHitObjectRecordEmptyNV: + builder.createNoResultOp(spv::Op::OpHitObjectRecordEmptyNV, operand); + return false; + case glslang::EOpHitObjectRecordEmptyEXT: + builder.createNoResultOp(spv::Op::OpHitObjectRecordEmptyEXT, operand); + return false; + + case glslang::EOpCreateTensorLayoutNV: + result = builder.createOp(spv::Op::OpCreateTensorLayoutNV, resultType(), std::vector{}); + builder.clearAccessChain(); + builder.setAccessChainRValue(result); + return false; + + case glslang::EOpCreateTensorViewNV: + result = builder.createOp(spv::Op::OpCreateTensorViewNV, resultType(), std::vector{}); + builder.clearAccessChain(); + builder.setAccessChainRValue(result); + return false; + + default: + logger->missingFunctionality("unknown glslang unary"); + return true; // pick up operand as placeholder result + } +} + +// Construct a composite object, recursively copying members if their types don't match +spv::Id TGlslangToSpvTraverser::createCompositeConstruct(spv::Id resultTypeId, std::vector constituents) +{ + for (int c = 0; c < (int)constituents.size(); ++c) { + spv::Id& constituent = constituents[c]; + spv::Id lType = builder.getContainedTypeId(resultTypeId, c); + spv::Id rType = builder.getTypeId(constituent); + if (lType != rType) { + if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_4) { + constituent = builder.createUnaryOp(spv::Op::OpCopyLogical, lType, constituent); + } else if (builder.isStructType(rType)) { + std::vector rTypeConstituents; + int numrTypeConstituents = builder.getNumTypeConstituents(rType); + for (int i = 0; i < numrTypeConstituents; ++i) { + rTypeConstituents.push_back(builder.createCompositeExtract(constituent, + builder.getContainedTypeId(rType, i), i)); + } + constituents[c] = createCompositeConstruct(lType, rTypeConstituents); + } else { + assert(builder.isArrayType(rType)); + std::vector rTypeConstituents; + int numrTypeConstituents = builder.getNumTypeConstituents(rType); + + spv::Id elementRType = builder.getContainedTypeId(rType); + for (int i = 0; i < numrTypeConstituents; ++i) { + rTypeConstituents.push_back(builder.createCompositeExtract(constituent, elementRType, i)); + } + constituents[c] = createCompositeConstruct(lType, rTypeConstituents); + } + } + } + return builder.createCompositeConstruct(resultTypeId, constituents); +} + +bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TIntermAggregate* node) +{ + SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); + if (node->getType().getQualifier().isSpecConstant()) + spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); + + spv::Id result = spv::NoResult; + spv::Id invertedType = spv::NoType; // to use to override the natural type of the node + std::vector complexLvalues; // for holding swizzling l-values too complex for + // SPIR-V, for an out parameter + std::vector temporaryLvalues; // temporaries to pass, as proxies for complexLValues + + auto resultType = [&invertedType, &node, this](){ + if (invertedType != spv::NoType) { + return invertedType; + } else { + auto ret = convertGlslangToSpvType(node->getType()); + // convertGlslangToSpvType may clobber the debug location, reset it + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + return ret; + } + }; + + // try texturing + result = createImageTextureFunctionCall(node); + if (result != spv::NoResult) { + builder.clearAccessChain(); + builder.setAccessChainRValue(result); + + return false; + } else if (node->getOp() == glslang::EOpImageStore || + node->getOp() == glslang::EOpImageStoreLod || + node->getOp() == glslang::EOpImageAtomicStore) { + // "imageStore" is a special case, which has no result + return false; + } + + glslang::TOperator binOp = glslang::EOpNull; + bool reduceComparison = true; + bool isMatrix = false; + bool noReturnValue = false; + bool atomic = false; + + spv::Builder::AccessChain::CoherentFlags lvalueCoherentFlags; + + assert(node->getOp()); + + spv::Decoration precision = TranslatePrecisionDecoration(node->getOperationPrecision()); + + switch (node->getOp()) { + case glslang::EOpScope: + case glslang::EOpSequence: + { + if (visit == glslang::EvPreVisit) { + ++sequenceDepth; + if (sequenceDepth == 1) { + // If this is the parent node of all the functions, we want to see them + // early, so all call points have actual SPIR-V functions to reference. + // In all cases, still let the traverser visit the children for us. + makeFunctions(node->getAsAggregate()->getSequence()); + + // Global initializers is specific to the shader entry point, which does not exist in compile-only mode + if (!options.compileOnly) { + // Also, we want all globals initializers to go into the beginning of the entry point, before + // anything else gets there, so visit out of order, doing them all now. + makeGlobalInitializers(node->getAsAggregate()->getSequence()); + } + + //Pre process linker objects for ray tracing stages + if (glslangIntermediate->isRayTracingStage()) + collectRayTracingLinkerObjects(); + + // Initializers are done, don't want to visit again, but functions and link objects need to be processed, + // so do them manually. + visitFunctions(node->getAsAggregate()->getSequence()); + + return false; + } else { + if (node->getOp() == glslang::EOpScope) { + auto loc = node->getLoc(); + builder.enterLexicalBlock(loc.line, loc.column); + } + } + } else { + if (sequenceDepth > 1 && node->getOp() == glslang::EOpScope) + builder.leaveLexicalBlock(); + --sequenceDepth; + } + + return true; + } + case glslang::EOpLinkerObjects: + { + if (visit == glslang::EvPreVisit) + linkageOnly = true; + else + linkageOnly = false; + + return true; + } + case glslang::EOpComma: + { + // processing from left to right naturally leaves the right-most + // lying around in the access chain + glslang::TIntermSequence& glslangOperands = node->getSequence(); + for (int i = 0; i < (int)glslangOperands.size(); ++i) + glslangOperands[i]->traverse(this); + + return false; + } + case glslang::EOpFunction: + if (visit == glslang::EvPreVisit) { + if (options.generateDebugInfo) { + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + } + if (isShaderEntryPoint(node)) { + inEntryPoint = true; + builder.setBuildPoint(shaderEntry->getLastBlock()); + builder.enterFunction(shaderEntry); + currentFunction = shaderEntry; + } else { + // SPIR-V functions should already be in the functionMap from the prepass + // that called makeFunctions(). + currentFunction = functionMap[node->getName().c_str()]; + spv::Block* functionBlock = currentFunction->getEntryBlock(); + builder.setBuildPoint(functionBlock); + builder.enterFunction(currentFunction); + } + if (options.generateDebugInfo && !options.emitNonSemanticShaderDebugInfo) { + const auto& loc = node->getLoc(); + const char* sourceFileName = loc.getFilename(); + spv::Id sourceFileId = sourceFileName ? builder.getStringId(sourceFileName) : builder.getMainFileId(); + currentFunction->setDebugLineInfo(sourceFileId, loc.line, loc.column); + } + } else { + // Here we have finished visiting the function (post-visit). Finalize it. + if (options.generateDebugInfo) { + if (glslangIntermediate->getSource() == glslang::EShSourceGlsl && node->getSequence().size() > 1) { + auto endLoc = node->getSequence()[1]->getAsAggregate()->getEndLoc(); + builder.setDebugSourceLocation(endLoc.line, endLoc.getFilename()); + } + } + if (inEntryPoint) + entryPointTerminated = true; + builder.leaveFunction(); + inEntryPoint = false; + currentFunction = nullptr; + } + + return true; + case glslang::EOpParameters: + // Parameters will have been consumed by EOpFunction processing, but not + // the body, so we still visited the function node's children, making this + // child redundant. + return false; + case glslang::EOpFunctionCall: + { + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + if (node->isUserDefined()) + result = handleUserFunctionCall(node); + if (result) { + builder.clearAccessChain(); + builder.setAccessChainRValue(result); + } else + logger->missingFunctionality("missing user function; linker needs to catch that"); + + return false; + } + case glslang::EOpConstructMat2x2: + case glslang::EOpConstructMat2x3: + case glslang::EOpConstructMat2x4: + case glslang::EOpConstructMat3x2: + case glslang::EOpConstructMat3x3: + case glslang::EOpConstructMat3x4: + case glslang::EOpConstructMat4x2: + case glslang::EOpConstructMat4x3: + case glslang::EOpConstructMat4x4: + case glslang::EOpConstructDMat2x2: + case glslang::EOpConstructDMat2x3: + case glslang::EOpConstructDMat2x4: + case glslang::EOpConstructDMat3x2: + case glslang::EOpConstructDMat3x3: + case glslang::EOpConstructDMat3x4: + case glslang::EOpConstructDMat4x2: + case glslang::EOpConstructDMat4x3: + case glslang::EOpConstructDMat4x4: + case glslang::EOpConstructIMat2x2: + case glslang::EOpConstructIMat2x3: + case glslang::EOpConstructIMat2x4: + case glslang::EOpConstructIMat3x2: + case glslang::EOpConstructIMat3x3: + case glslang::EOpConstructIMat3x4: + case glslang::EOpConstructIMat4x2: + case glslang::EOpConstructIMat4x3: + case glslang::EOpConstructIMat4x4: + case glslang::EOpConstructUMat2x2: + case glslang::EOpConstructUMat2x3: + case glslang::EOpConstructUMat2x4: + case glslang::EOpConstructUMat3x2: + case glslang::EOpConstructUMat3x3: + case glslang::EOpConstructUMat3x4: + case glslang::EOpConstructUMat4x2: + case glslang::EOpConstructUMat4x3: + case glslang::EOpConstructUMat4x4: + case glslang::EOpConstructBMat2x2: + case glslang::EOpConstructBMat2x3: + case glslang::EOpConstructBMat2x4: + case glslang::EOpConstructBMat3x2: + case glslang::EOpConstructBMat3x3: + case glslang::EOpConstructBMat3x4: + case glslang::EOpConstructBMat4x2: + case glslang::EOpConstructBMat4x3: + case glslang::EOpConstructBMat4x4: + case glslang::EOpConstructF16Mat2x2: + case glslang::EOpConstructF16Mat2x3: + case glslang::EOpConstructF16Mat2x4: + case glslang::EOpConstructF16Mat3x2: + case glslang::EOpConstructF16Mat3x3: + case glslang::EOpConstructF16Mat3x4: + case glslang::EOpConstructF16Mat4x2: + case glslang::EOpConstructF16Mat4x3: + case glslang::EOpConstructF16Mat4x4: + isMatrix = true; + [[fallthrough]]; + case glslang::EOpConstructFloat: + case glslang::EOpConstructVec2: + case glslang::EOpConstructVec3: + case glslang::EOpConstructVec4: + case glslang::EOpConstructDouble: + case glslang::EOpConstructDVec2: + case glslang::EOpConstructDVec3: + case glslang::EOpConstructDVec4: + case glslang::EOpConstructFloat16: + case glslang::EOpConstructF16Vec2: + case glslang::EOpConstructF16Vec3: + case glslang::EOpConstructF16Vec4: + case glslang::EOpConstructBFloat16: + case glslang::EOpConstructBF16Vec2: + case glslang::EOpConstructBF16Vec3: + case glslang::EOpConstructBF16Vec4: + case glslang::EOpConstructFloatE5M2: + case glslang::EOpConstructFloatE5M2Vec2: + case glslang::EOpConstructFloatE5M2Vec3: + case glslang::EOpConstructFloatE5M2Vec4: + case glslang::EOpConstructFloatE4M3: + case glslang::EOpConstructFloatE4M3Vec2: + case glslang::EOpConstructFloatE4M3Vec3: + case glslang::EOpConstructFloatE4M3Vec4: + case glslang::EOpConstructBool: + case glslang::EOpConstructBVec2: + case glslang::EOpConstructBVec3: + case glslang::EOpConstructBVec4: + case glslang::EOpConstructInt8: + case glslang::EOpConstructI8Vec2: + case glslang::EOpConstructI8Vec3: + case glslang::EOpConstructI8Vec4: + case glslang::EOpConstructUint8: + case glslang::EOpConstructU8Vec2: + case glslang::EOpConstructU8Vec3: + case glslang::EOpConstructU8Vec4: + case glslang::EOpConstructInt16: + case glslang::EOpConstructI16Vec2: + case glslang::EOpConstructI16Vec3: + case glslang::EOpConstructI16Vec4: + case glslang::EOpConstructUint16: + case glslang::EOpConstructU16Vec2: + case glslang::EOpConstructU16Vec3: + case glslang::EOpConstructU16Vec4: + case glslang::EOpConstructInt: + case glslang::EOpConstructIVec2: + case glslang::EOpConstructIVec3: + case glslang::EOpConstructIVec4: + case glslang::EOpConstructUint: + case glslang::EOpConstructUVec2: + case glslang::EOpConstructUVec3: + case glslang::EOpConstructUVec4: + case glslang::EOpConstructInt64: + case glslang::EOpConstructI64Vec2: + case glslang::EOpConstructI64Vec3: + case glslang::EOpConstructI64Vec4: + case glslang::EOpConstructUint64: + case glslang::EOpConstructU64Vec2: + case glslang::EOpConstructU64Vec3: + case glslang::EOpConstructU64Vec4: + case glslang::EOpConstructStruct: + case glslang::EOpConstructTextureSampler: + case glslang::EOpConstructReference: + case glslang::EOpConstructCooperativeMatrixNV: + case glslang::EOpConstructCooperativeMatrixKHR: + case glslang::EOpConstructCooperativeVectorNV: + case glslang::EOpConstructSaturated: + { + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + std::vector arguments; + translateArguments(*node, arguments, lvalueCoherentFlags); + spv::Id constructed; + if (node->getOp() == glslang::EOpConstructTextureSampler) { + const glslang::TType& texType = node->getSequence()[0]->getAsTyped()->getType(); + if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6 && + texType.getSampler().isBuffer()) { + // SamplerBuffer is not supported in spirv1.6 so + // `samplerBuffer(textureBuffer, sampler)` is a no-op + // and textureBuffer is the result going forward + constructed = arguments[0]; + } else + constructed = builder.createOp(spv::Op::OpSampledImage, resultType(), arguments); + } else if (node->getOp() == glslang::EOpConstructCooperativeMatrixKHR && + node->getType().isCoopMatKHR() && node->getSequence()[0]->getAsTyped()->getType().isCoopMatKHR()) { + builder.addCapability(spv::Capability::CooperativeMatrixConversionsNV); + builder.addExtension(spv::E_SPV_NV_cooperative_matrix2); + constructed = builder.createCooperativeMatrixConversion(resultType(), arguments[0]); + } else if (node->getOp() == glslang::EOpConstructCooperativeVectorNV && + arguments.size() == 1 && + builder.getTypeId(arguments[0]) == resultType()) { + constructed = arguments[0]; + } else if (node->getOp() == glslang::EOpConstructStruct || + node->getOp() == glslang::EOpConstructCooperativeMatrixNV || + node->getOp() == glslang::EOpConstructCooperativeMatrixKHR || + node->getType().isArray() || + // Handle constructing coopvec from one component here, to avoid the component + // getting smeared + (node->getOp() == glslang::EOpConstructCooperativeVectorNV && arguments.size() == 1 && builder.isScalar(arguments[0]))) { + std::vector constituents; + for (int c = 0; c < (int)arguments.size(); ++c) + constituents.push_back(arguments[c]); + constructed = createCompositeConstruct(resultType(), constituents); + } else if (isMatrix) + constructed = builder.createMatrixConstructor(precision, arguments, resultType()); + else if (node->getOp() == glslang::EOpConstructSaturated) { + OpDecorations decorations = { TranslatePrecisionDecoration(node->getOperationPrecision()), + TranslateNoContractionDecoration(node->getType().getQualifier()), + TranslateNonUniformDecoration(lvalueCoherentFlags) }; + + constructed = createConversion(node->getOp(), decorations, resultType(), arguments[1], + node->getType().getBasicType(), node->getSequence()[1]->getAsTyped()->getBasicType()); + builder.addDecoration(constructed, spv::Decoration::SaturatedToLargestFloat8NormalConversionEXT); + builder.createStore(constructed, arguments[0]); + } + else + constructed = builder.createConstructor(precision, arguments, resultType()); + + if (node->getType().getQualifier().isNonUniform()) { + builder.addDecoration(constructed, spv::Decoration::NonUniformEXT); + } + + builder.clearAccessChain(); + builder.setAccessChainRValue(constructed); + + return false; + } + + // These six are component-wise compares with component-wise results. + // Forward on to createBinaryOperation(), requesting a vector result. + case glslang::EOpLessThan: + case glslang::EOpGreaterThan: + case glslang::EOpLessThanEqual: + case glslang::EOpGreaterThanEqual: + case glslang::EOpVectorEqual: + case glslang::EOpVectorNotEqual: + { + // Map the operation to a binary + binOp = node->getOp(); + reduceComparison = false; + switch (node->getOp()) { + case glslang::EOpVectorEqual: binOp = glslang::EOpVectorEqual; break; + case glslang::EOpVectorNotEqual: binOp = glslang::EOpVectorNotEqual; break; + default: binOp = node->getOp(); break; + } + + break; + } + case glslang::EOpMul: + // component-wise matrix multiply + binOp = glslang::EOpMul; + break; + case glslang::EOpOuterProduct: + // two vectors multiplied to make a matrix + binOp = glslang::EOpOuterProduct; + break; + case glslang::EOpDot: + { + // for scalar dot product, use multiply + glslang::TIntermSequence& glslangOperands = node->getSequence(); + if (glslangOperands[0]->getAsTyped()->getVectorSize() == 1) + binOp = glslang::EOpMul; + break; + } + case glslang::EOpMod: + // when an aggregate, this is the floating-point mod built-in function, + // which can be emitted by the one in createBinaryOperation() + binOp = glslang::EOpMod; + break; + + case glslang::EOpEmitVertex: + case glslang::EOpEndPrimitive: + case glslang::EOpBarrier: + case glslang::EOpMemoryBarrier: + case glslang::EOpMemoryBarrierAtomicCounter: + case glslang::EOpMemoryBarrierBuffer: + case glslang::EOpMemoryBarrierImage: + case glslang::EOpMemoryBarrierShared: + case glslang::EOpGroupMemoryBarrier: + case glslang::EOpDeviceMemoryBarrier: + case glslang::EOpAllMemoryBarrierWithGroupSync: + case glslang::EOpDeviceMemoryBarrierWithGroupSync: + case glslang::EOpWorkgroupMemoryBarrier: + case glslang::EOpWorkgroupMemoryBarrierWithGroupSync: + case glslang::EOpSubgroupBarrier: + case glslang::EOpSubgroupMemoryBarrier: + case glslang::EOpSubgroupMemoryBarrierBuffer: + case glslang::EOpSubgroupMemoryBarrierImage: + case glslang::EOpSubgroupMemoryBarrierShared: + noReturnValue = true; + // These all have 0 operands and will naturally finish up in the code below for 0 operands + break; + + case glslang::EOpAtomicAdd: + case glslang::EOpAtomicSubtract: + case glslang::EOpAtomicMin: + case glslang::EOpAtomicMax: + case glslang::EOpAtomicAnd: + case glslang::EOpAtomicOr: + case glslang::EOpAtomicXor: + case glslang::EOpAtomicExchange: + case glslang::EOpAtomicCompSwap: + atomic = true; + break; + + case glslang::EOpAtomicStore: + noReturnValue = true; + [[fallthrough]]; + case glslang::EOpAtomicLoad: + atomic = true; + break; + + case glslang::EOpAtomicCounterAdd: + case glslang::EOpAtomicCounterSubtract: + case glslang::EOpAtomicCounterMin: + case glslang::EOpAtomicCounterMax: + case glslang::EOpAtomicCounterAnd: + case glslang::EOpAtomicCounterOr: + case glslang::EOpAtomicCounterXor: + case glslang::EOpAtomicCounterExchange: + case glslang::EOpAtomicCounterCompSwap: + builder.addExtension("SPV_KHR_shader_atomic_counter_ops"); + builder.addCapability(spv::Capability::AtomicStorageOps); + atomic = true; + break; + + case glslang::EOpAbsDifference: + case glslang::EOpAddSaturate: + case glslang::EOpSubSaturate: + case glslang::EOpAverage: + case glslang::EOpAverageRounded: + case glslang::EOpMul32x16: + builder.addCapability(spv::Capability::IntegerFunctions2INTEL); + builder.addExtension("SPV_INTEL_shader_integer_functions2"); + binOp = node->getOp(); + break; + + case glslang::EOpExpectEXT: + builder.addCapability(spv::Capability::ExpectAssumeKHR); + builder.addExtension(spv::E_SPV_KHR_expect_assume); + binOp = node->getOp(); + break; + + case glslang::EOpIgnoreIntersectionNV: + case glslang::EOpTerminateRayNV: + case glslang::EOpTraceNV: + case glslang::EOpTraceRayMotionNV: + case glslang::EOpTraceKHR: + case glslang::EOpExecuteCallableNV: + case glslang::EOpExecuteCallableKHR: + case glslang::EOpWritePackedPrimitiveIndices4x8NV: + case glslang::EOpEmitMeshTasksEXT: + case glslang::EOpSetMeshOutputsEXT: + noReturnValue = true; + break; + case glslang::EOpRayQueryInitialize: + case glslang::EOpRayQueryTerminate: + case glslang::EOpRayQueryGenerateIntersection: + case glslang::EOpRayQueryConfirmIntersection: + builder.addExtension("SPV_KHR_ray_query"); + builder.addCapability(spv::Capability::RayQueryKHR); + noReturnValue = true; + break; + case glslang::EOpRayQueryProceed: + case glslang::EOpRayQueryGetIntersectionType: + case glslang::EOpRayQueryGetRayTMin: + case glslang::EOpRayQueryGetRayFlags: + case glslang::EOpRayQueryGetIntersectionT: + case glslang::EOpRayQueryGetIntersectionInstanceCustomIndex: + case glslang::EOpRayQueryGetIntersectionInstanceId: + case glslang::EOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffset: + case glslang::EOpRayQueryGetIntersectionGeometryIndex: + case glslang::EOpRayQueryGetIntersectionPrimitiveIndex: + case glslang::EOpRayQueryGetIntersectionBarycentrics: + case glslang::EOpRayQueryGetIntersectionFrontFace: + case glslang::EOpRayQueryGetIntersectionCandidateAABBOpaque: + case glslang::EOpRayQueryGetIntersectionObjectRayDirection: + case glslang::EOpRayQueryGetIntersectionObjectRayOrigin: + case glslang::EOpRayQueryGetWorldRayDirection: + case glslang::EOpRayQueryGetWorldRayOrigin: + case glslang::EOpRayQueryGetIntersectionObjectToWorld: + case glslang::EOpRayQueryGetIntersectionWorldToObject: + builder.addExtension("SPV_KHR_ray_query"); + builder.addCapability(spv::Capability::RayQueryKHR); + break; + case glslang::EOpCooperativeMatrixLoad: + case glslang::EOpCooperativeMatrixStore: + case glslang::EOpCooperativeMatrixLoadNV: + case glslang::EOpCooperativeMatrixStoreNV: + case glslang::EOpCooperativeMatrixLoadTensorNV: + case glslang::EOpCooperativeMatrixStoreTensorNV: + case glslang::EOpCooperativeMatrixReduceNV: + case glslang::EOpCooperativeMatrixPerElementOpNV: + case glslang::EOpCooperativeMatrixTransposeNV: + case glslang::EOpCooperativeVectorMatMulNV: + case glslang::EOpCooperativeVectorMatMulAddNV: + case glslang::EOpCooperativeVectorLoadNV: + case glslang::EOpCooperativeVectorStoreNV: + case glslang::EOpCooperativeVectorOuterProductAccumulateNV: + case glslang::EOpCooperativeVectorReduceSumAccumulateNV: + noReturnValue = true; + break; + case glslang::EOpBeginInvocationInterlock: + case glslang::EOpEndInvocationInterlock: + builder.addExtension(spv::E_SPV_EXT_fragment_shader_interlock); + noReturnValue = true; + break; + + case glslang::EOpHitObjectTraceRayNV: + case glslang::EOpHitObjectTraceRayMotionNV: + case glslang::EOpHitObjectGetAttributesNV: + case glslang::EOpHitObjectExecuteShaderNV: + case glslang::EOpHitObjectRecordEmptyNV: + case glslang::EOpHitObjectRecordMissNV: + case glslang::EOpHitObjectRecordMissMotionNV: + case glslang::EOpHitObjectRecordHitNV: + case glslang::EOpHitObjectRecordHitMotionNV: + case glslang::EOpHitObjectRecordHitWithIndexNV: + case glslang::EOpHitObjectRecordHitWithIndexMotionNV: + case glslang::EOpReorderThreadNV: + noReturnValue = true; + [[fallthrough]]; + case glslang::EOpHitObjectIsEmptyNV: + case glslang::EOpHitObjectIsMissNV: + case glslang::EOpHitObjectIsHitNV: + case glslang::EOpHitObjectGetRayTMinNV: + case glslang::EOpHitObjectGetRayTMaxNV: + case glslang::EOpHitObjectGetObjectRayOriginNV: + case glslang::EOpHitObjectGetObjectRayDirectionNV: + case glslang::EOpHitObjectGetWorldRayOriginNV: + case glslang::EOpHitObjectGetWorldRayDirectionNV: + case glslang::EOpHitObjectGetObjectToWorldNV: + case glslang::EOpHitObjectGetWorldToObjectNV: + case glslang::EOpHitObjectGetInstanceCustomIndexNV: + case glslang::EOpHitObjectGetInstanceIdNV: + case glslang::EOpHitObjectGetGeometryIndexNV: + case glslang::EOpHitObjectGetPrimitiveIndexNV: + case glslang::EOpHitObjectGetHitKindNV: + case glslang::EOpHitObjectGetCurrentTimeNV: + case glslang::EOpHitObjectGetShaderBindingTableRecordIndexNV: + case glslang::EOpHitObjectGetShaderRecordBufferHandleNV: + builder.addExtension(spv::E_SPV_NV_shader_invocation_reorder); + builder.addCapability(spv::Capability::ShaderInvocationReorderNV); + break; + + case glslang::EOpHitObjectGetLSSPositionsNV: + case glslang::EOpHitObjectGetLSSRadiiNV: + builder.addExtension(spv::E_SPV_NV_linear_swept_spheres); + builder.addCapability(spv::Capability::ShaderInvocationReorderNV); + builder.addCapability(spv::Capability::RayTracingLinearSweptSpheresGeometryNV); + noReturnValue = true; + break; + + case glslang::EOpRayQueryGetIntersectionLSSPositionsNV: + case glslang::EOpRayQueryGetIntersectionLSSRadiiNV: + builder.addExtension(spv::E_SPV_NV_linear_swept_spheres); + builder.addCapability(spv::Capability::RayQueryKHR); + builder.addCapability(spv::Capability::RayTracingLinearSweptSpheresGeometryNV); + noReturnValue = true; + break; + + case glslang::EOpRayQueryGetIntersectionSpherePositionNV: + case glslang::EOpRayQueryGetIntersectionSphereRadiusNV: + case glslang::EOpRayQueryIsSphereHitNV: + builder.addExtension(spv::E_SPV_NV_linear_swept_spheres); + builder.addCapability(spv::Capability::RayQueryKHR); + builder.addCapability(spv::Capability::RayTracingSpheresGeometryNV); + builder.addCapability(spv::Capability::RayTracingLinearSweptSpheresGeometryNV); + break; + + case glslang::EOpRayQueryGetIntersectionLSSHitValueNV: + case glslang::EOpRayQueryIsLSSHitNV: + builder.addExtension(spv::E_SPV_NV_linear_swept_spheres); + builder.addCapability(spv::Capability::RayQueryKHR); + builder.addCapability(spv::Capability::RayTracingLinearSweptSpheresGeometryNV); + break; + + case glslang::EOpHitObjectTraceRayEXT: + case glslang::EOpHitObjectTraceRayMotionEXT: + case glslang::EOpHitObjectGetAttributesEXT: + case glslang::EOpHitObjectExecuteShaderEXT: + case glslang::EOpHitObjectRecordEmptyEXT: + case glslang::EOpHitObjectRecordMissEXT: + case glslang::EOpHitObjectRecordMissMotionEXT: + case glslang::EOpReorderThreadEXT: + case glslang::EOpHitObjectSetShaderBindingTableRecordIndexEXT: + case glslang::EOpHitObjectReorderExecuteEXT: + case glslang::EOpHitObjectTraceReorderExecuteEXT: + case glslang::EOpHitObjectTraceMotionReorderExecuteEXT: + case glslang::EOpHitObjectRecordFromQueryEXT: + case glslang::EOpHitObjectGetIntersectionTriangleVertexPositionsEXT: + noReturnValue = true; + [[fallthrough]]; + case glslang::EOpHitObjectIsEmptyEXT: + case glslang::EOpHitObjectIsMissEXT: + case glslang::EOpHitObjectIsHitEXT: + case glslang::EOpHitObjectGetRayTMinEXT: + case glslang::EOpHitObjectGetRayTMaxEXT: + case glslang::EOpHitObjectGetRayFlagsEXT: + case glslang::EOpHitObjectGetObjectRayOriginEXT: + case glslang::EOpHitObjectGetObjectRayDirectionEXT: + case glslang::EOpHitObjectGetWorldRayOriginEXT: + case glslang::EOpHitObjectGetWorldRayDirectionEXT: + case glslang::EOpHitObjectGetObjectToWorldEXT: + case glslang::EOpHitObjectGetWorldToObjectEXT: + case glslang::EOpHitObjectGetInstanceCustomIndexEXT: + case glslang::EOpHitObjectGetInstanceIdEXT: + case glslang::EOpHitObjectGetGeometryIndexEXT: + case glslang::EOpHitObjectGetPrimitiveIndexEXT: + case glslang::EOpHitObjectGetHitKindEXT: + case glslang::EOpHitObjectGetCurrentTimeEXT: + case glslang::EOpHitObjectGetShaderBindingTableRecordIndexEXT: + case glslang::EOpHitObjectGetShaderRecordBufferHandleEXT: + builder.addExtension(spv::E_SPV_EXT_shader_invocation_reorder); + builder.addCapability(spv::Capability::ShaderInvocationReorderEXT); + break; + + case glslang::EOpRayQueryGetIntersectionTriangleVertexPositionsEXT: + builder.addExtension(spv::E_SPV_KHR_ray_tracing_position_fetch); + builder.addCapability(spv::Capability::RayQueryPositionFetchKHR); + noReturnValue = true; + break; + case glslang::EOpImageSampleWeightedQCOM: + builder.addCapability(spv::Capability::TextureSampleWeightedQCOM); + builder.addExtension(spv::E_SPV_QCOM_image_processing); + break; + case glslang::EOpImageBoxFilterQCOM: + builder.addCapability(spv::Capability::TextureBoxFilterQCOM); + builder.addExtension(spv::E_SPV_QCOM_image_processing); + break; + case glslang::EOpImageBlockMatchSADQCOM: + case glslang::EOpImageBlockMatchSSDQCOM: + builder.addCapability(spv::Capability::TextureBlockMatchQCOM); + builder.addExtension(spv::E_SPV_QCOM_image_processing); + break; + case glslang::EOpTensorWriteARM: + noReturnValue = true; + break; + + case glslang::EOpImageBlockMatchWindowSSDQCOM: + case glslang::EOpImageBlockMatchWindowSADQCOM: + builder.addCapability(spv::Capability::TextureBlockMatchQCOM); + builder.addExtension(spv::E_SPV_QCOM_image_processing); + builder.addCapability(spv::Capability::TextureBlockMatch2QCOM); + builder.addExtension(spv::E_SPV_QCOM_image_processing2); + break; + + case glslang::EOpImageBlockMatchGatherSSDQCOM: + case glslang::EOpImageBlockMatchGatherSADQCOM: + builder.addCapability(spv::Capability::TextureBlockMatchQCOM); + builder.addExtension(spv::E_SPV_QCOM_image_processing); + builder.addCapability(spv::Capability::TextureBlockMatch2QCOM); + builder.addExtension(spv::E_SPV_QCOM_image_processing2); + break; + + case glslang::EOpFetchMicroTriangleVertexPositionNV: + case glslang::EOpFetchMicroTriangleVertexBarycentricNV: + builder.addExtension(spv::E_SPV_NV_displacement_micromap); + builder.addCapability(spv::Capability::DisplacementMicromapNV); + break; + + case glslang::EOpRayQueryGetIntersectionClusterIdNV: + builder.addExtension(spv::E_SPV_NV_cluster_acceleration_structure); + builder.addCapability(spv::Capability::RayQueryKHR); + builder.addCapability(spv::Capability::RayTracingClusterAccelerationStructureNV); + break; + + case glslang::EOpDebugPrintf: + noReturnValue = true; + break; + + default: + break; + } + + // + // See if it maps to a regular operation. + // + if (binOp != glslang::EOpNull) { + glslang::TIntermTyped* left = node->getSequence()[0]->getAsTyped(); + glslang::TIntermTyped* right = node->getSequence()[1]->getAsTyped(); + assert(left && right); + + builder.clearAccessChain(); + left->traverse(this); + spv::Id leftId = accessChainLoad(left->getType()); + + builder.clearAccessChain(); + right->traverse(this); + spv::Id rightId = accessChainLoad(right->getType()); + + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + OpDecorations decorations = { precision, + TranslateNoContractionDecoration(node->getType().getQualifier()), + TranslateNonUniformDecoration(node->getType().getQualifier()) }; + result = createBinaryOperation(binOp, decorations, + resultType(), leftId, rightId, + left->getType().getBasicType(), reduceComparison); + + // code above should only make binOp that exists in createBinaryOperation + assert(result != spv::NoResult); + builder.clearAccessChain(); + builder.setAccessChainRValue(result); + + return false; + } + + // + // Create the list of operands. + // + glslang::TIntermSequence& glslangOperands = node->getSequence(); + std::vector operands; + std::vector memoryAccessOperands; + for (int arg = 0; arg < (int)glslangOperands.size(); ++arg) { + // special case l-value operands; there are just a few + bool lvalue = false; + switch (node->getOp()) { + case glslang::EOpModf: + if (arg == 1) + lvalue = true; + break; + + + + case glslang::EOpHitObjectRecordFromQueryEXT: + case glslang::EOpHitObjectGetIntersectionTriangleVertexPositionsEXT: + if (arg == 0 || arg == 1) + lvalue = true; + break; + + case glslang::EOpHitObjectRecordHitNV: + case glslang::EOpHitObjectRecordHitMotionNV: + case glslang::EOpHitObjectRecordHitWithIndexNV: + case glslang::EOpHitObjectRecordHitWithIndexMotionNV: + case glslang::EOpHitObjectTraceRayNV: + case glslang::EOpHitObjectTraceRayMotionNV: + case glslang::EOpHitObjectExecuteShaderNV: + case glslang::EOpHitObjectRecordMissNV: + case glslang::EOpHitObjectRecordMissMotionNV: + case glslang::EOpHitObjectGetAttributesNV: + case glslang::EOpHitObjectGetClusterIdNV: + case glslang::EOpHitObjectTraceRayEXT: + case glslang::EOpHitObjectTraceRayMotionEXT: + case glslang::EOpHitObjectExecuteShaderEXT: + case glslang::EOpHitObjectRecordMissEXT: + case glslang::EOpHitObjectRecordMissMotionEXT: + case glslang::EOpHitObjectGetAttributesEXT: + case glslang::EOpHitObjectSetShaderBindingTableRecordIndexEXT: + case glslang::EOpHitObjectReorderExecuteEXT: + case glslang::EOpHitObjectTraceReorderExecuteEXT: + case glslang::EOpHitObjectTraceMotionReorderExecuteEXT: + if (arg == 0) + lvalue = true; + break; + + case glslang::EOpHitObjectGetLSSPositionsNV: + case glslang::EOpHitObjectGetLSSRadiiNV: + lvalue = true; + break; + + case glslang::EOpRayQueryInitialize: + case glslang::EOpRayQueryTerminate: + case glslang::EOpRayQueryConfirmIntersection: + case glslang::EOpRayQueryProceed: + case glslang::EOpRayQueryGenerateIntersection: + case glslang::EOpRayQueryGetIntersectionType: + case glslang::EOpRayQueryGetIntersectionT: + case glslang::EOpRayQueryGetIntersectionInstanceCustomIndex: + case glslang::EOpRayQueryGetIntersectionInstanceId: + case glslang::EOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffset: + case glslang::EOpRayQueryGetIntersectionGeometryIndex: + case glslang::EOpRayQueryGetIntersectionPrimitiveIndex: + case glslang::EOpRayQueryGetIntersectionBarycentrics: + case glslang::EOpRayQueryGetIntersectionFrontFace: + case glslang::EOpRayQueryGetIntersectionObjectRayDirection: + case glslang::EOpRayQueryGetIntersectionObjectRayOrigin: + case glslang::EOpRayQueryGetIntersectionObjectToWorld: + case glslang::EOpRayQueryGetIntersectionWorldToObject: + case glslang::EOpRayQueryGetIntersectionClusterIdNV: + case glslang::EOpRayQueryGetIntersectionSpherePositionNV: + case glslang::EOpRayQueryGetIntersectionSphereRadiusNV: + case glslang::EOpRayQueryGetIntersectionLSSHitValueNV: + case glslang::EOpRayQueryIsSphereHitNV: + case glslang::EOpRayQueryIsLSSHitNV: + if (arg == 0) + lvalue = true; + break; + + case glslang::EOpAtomicAdd: + case glslang::EOpAtomicSubtract: + case glslang::EOpAtomicMin: + case glslang::EOpAtomicMax: + case glslang::EOpAtomicAnd: + case glslang::EOpAtomicOr: + case glslang::EOpAtomicXor: + case glslang::EOpAtomicExchange: + case glslang::EOpAtomicCompSwap: + if (arg == 0) + lvalue = true; + break; + + case glslang::EOpFrexp: + if (arg == 1) + lvalue = true; + break; + case glslang::EOpInterpolateAtSample: + case glslang::EOpInterpolateAtOffset: + case glslang::EOpInterpolateAtVertex: + if (arg == 0) { + // If GLSL, use the address of the interpolant argument. + // If HLSL, use an internal version of OpInterolates that takes + // the rvalue of the interpolant. A fixup pass in spirv-opt + // legalization will remove the OpLoad and convert to an lvalue. + // Had to do this because legalization will only propagate a + // builtin into an rvalue. + lvalue = glslangIntermediate->getSource() != glslang::EShSourceHlsl; + + // Does it need a swizzle inversion? If so, evaluation is inverted; + // operate first on the swizzle base, then apply the swizzle. + // That is, we transform + // + // interpolate(v.zy) -> interpolate(v).zy + // + if (glslangOperands[0]->getAsOperator() && + glslangOperands[0]->getAsOperator()->getOp() == glslang::EOpVectorSwizzle) + invertedType = convertGlslangToSpvType( + glslangOperands[0]->getAsBinaryNode()->getLeft()->getType()); + } + break; + case glslang::EOpAtomicLoad: + case glslang::EOpAtomicStore: + case glslang::EOpAtomicCounterAdd: + case glslang::EOpAtomicCounterSubtract: + case glslang::EOpAtomicCounterMin: + case glslang::EOpAtomicCounterMax: + case glslang::EOpAtomicCounterAnd: + case glslang::EOpAtomicCounterOr: + case glslang::EOpAtomicCounterXor: + case glslang::EOpAtomicCounterExchange: + case glslang::EOpAtomicCounterCompSwap: + if (arg == 0) + lvalue = true; + break; + case glslang::EOpAddCarry: + case glslang::EOpSubBorrow: + if (arg == 2) + lvalue = true; + break; + case glslang::EOpUMulExtended: + case glslang::EOpIMulExtended: + if (arg >= 2) + lvalue = true; + break; + case glslang::EOpCooperativeMatrixLoad: + case glslang::EOpCooperativeMatrixLoadNV: + case glslang::EOpCooperativeMatrixLoadTensorNV: + case glslang::EOpCooperativeVectorLoadNV: + if (arg == 0 || arg == 1) + lvalue = true; + break; + case glslang::EOpCooperativeMatrixStore: + case glslang::EOpCooperativeMatrixStoreNV: + case glslang::EOpCooperativeMatrixStoreTensorNV: + case glslang::EOpCooperativeVectorStoreNV: + if (arg == 1) + lvalue = true; + break; + case glslang::EOpCooperativeVectorMatMulNV: + if (arg == 0 || arg == 3) + lvalue = true; + break; + case glslang::EOpCooperativeVectorMatMulAddNV: + if (arg == 0 || arg == 3 || arg == 6) + lvalue = true; + break; + case glslang::EOpCooperativeVectorOuterProductAccumulateNV: + if (arg == 2) + lvalue = true; + break; + case glslang::EOpCooperativeVectorReduceSumAccumulateNV: + if (arg == 1) + lvalue = true; + break; + case glslang::EOpCooperativeMatrixReduceNV: + case glslang::EOpCooperativeMatrixPerElementOpNV: + case glslang::EOpCooperativeMatrixTransposeNV: + if (arg == 0) + lvalue = true; + break; + case glslang::EOpSpirvInst: + if (glslangOperands[arg]->getAsTyped()->getQualifier().isSpirvByReference()) + lvalue = true; + break; + case glslang::EOpReorderThreadNV: + case glslang::EOpReorderThreadEXT: + //Three variants of reorderThreadNV, two of them use hitObjectNV + if (arg == 0 && glslangOperands.size() != 2) + lvalue = true; + break; + case glslang::EOpRayQueryGetIntersectionTriangleVertexPositionsEXT: + case glslang::EOpRayQueryGetIntersectionLSSPositionsNV: + case glslang::EOpRayQueryGetIntersectionLSSRadiiNV: + if (arg == 0 || arg == 2) + lvalue = true; + break; + case glslang::EOpTensorReadARM: + if (arg == 2) + lvalue = true; + break; + default: + break; + } + builder.clearAccessChain(); + if (invertedType != spv::NoType && arg == 0) + glslangOperands[0]->getAsBinaryNode()->getLeft()->traverse(this); + else + glslangOperands[arg]->traverse(this); + + bool isCoopMat = node->getOp() == glslang::EOpCooperativeMatrixLoad || + node->getOp() == glslang::EOpCooperativeMatrixStore || + node->getOp() == glslang::EOpCooperativeMatrixLoadNV || + node->getOp() == glslang::EOpCooperativeMatrixStoreNV || + node->getOp() == glslang::EOpCooperativeMatrixLoadTensorNV || + node->getOp() == glslang::EOpCooperativeMatrixStoreTensorNV; + bool isCoopVec = node->getOp() == glslang::EOpCooperativeVectorLoadNV || + node->getOp() == glslang::EOpCooperativeVectorStoreNV; + if (isCoopMat || isCoopVec) { + + if (arg == 1) { + spv::Builder::AccessChain::CoherentFlags coherentFlags {}; + unsigned int alignment {}; + if (isCoopMat) { + // fold "element" parameter into the access chain + spv::Builder::AccessChain save = builder.getAccessChain(); + builder.clearAccessChain(); + glslangOperands[2]->traverse(this); + + spv::Id elementId = accessChainLoad(glslangOperands[2]->getAsTyped()->getType()); + + builder.setAccessChain(save); + + // Point to the first element of the array. + builder.accessChainPush(elementId, + TranslateCoherent(glslangOperands[arg]->getAsTyped()->getType()), + glslangOperands[arg]->getAsTyped()->getType().getBufferReferenceAlignment()); + coherentFlags = builder.getAccessChain().coherentFlags; + alignment = builder.getAccessChain().alignment; + } else { + coherentFlags = builder.getAccessChain().coherentFlags; + coherentFlags |= TranslateCoherent(glslangOperands[arg]->getAsTyped()->getType()); + alignment = 16; + } + + spv::MemoryAccessMask memoryAccess = TranslateMemoryAccess(coherentFlags); + if (node->getOp() == glslang::EOpCooperativeMatrixLoad || + node->getOp() == glslang::EOpCooperativeMatrixLoadNV || + node->getOp() == glslang::EOpCooperativeMatrixLoadTensorNV || + node->getOp() == glslang::EOpCooperativeVectorLoadNV) + memoryAccess = (memoryAccess & ~spv::MemoryAccessMask::MakePointerAvailableKHR); + if (node->getOp() == glslang::EOpCooperativeMatrixStore || + node->getOp() == glslang::EOpCooperativeMatrixStoreNV || + node->getOp() == glslang::EOpCooperativeMatrixStoreTensorNV || + node->getOp() == glslang::EOpCooperativeVectorStoreNV) + memoryAccess = (memoryAccess & ~spv::MemoryAccessMask::MakePointerVisibleKHR); + if (builder.getStorageClass(builder.getAccessChain().base) == + spv::StorageClass::PhysicalStorageBufferEXT) { + memoryAccess = (spv::MemoryAccessMask)(memoryAccess | spv::MemoryAccessMask::Aligned); + } + + memoryAccessOperands.push_back(spv::IdImmediate(false, memoryAccess)); + + if (anySet(memoryAccess, spv::MemoryAccessMask::Aligned)) { + memoryAccessOperands.push_back(spv::IdImmediate(false, alignment)); + } + + if (anySet(memoryAccess, + spv::MemoryAccessMask::MakePointerAvailableKHR | spv::MemoryAccessMask::MakePointerVisibleKHR)) { + memoryAccessOperands.push_back(spv::IdImmediate(true, + builder.makeUintConstant(TranslateMemoryScope(coherentFlags)))); + } + } else if (isCoopMat && arg == 2) { + continue; + } + } + + // for l-values, pass the address, for r-values, pass the value + if (lvalue) { + if (invertedType == spv::NoType && !builder.isSpvLvalue()) { + // SPIR-V cannot represent an l-value containing a swizzle that doesn't + // reduce to a simple access chain. So, we need a temporary vector to + // receive the result, and must later swizzle that into the original + // l-value. + complexLvalues.push_back(builder.getAccessChain()); + temporaryLvalues.push_back(builder.createVariable( + spv::NoPrecision, spv::StorageClass::Function, + builder.accessChainGetInferredType(), "swizzleTemp")); + operands.push_back(temporaryLvalues.back()); + } else { + operands.push_back(builder.accessChainGetLValue()); + } + lvalueCoherentFlags = builder.getAccessChain().coherentFlags; + lvalueCoherentFlags |= TranslateCoherent(glslangOperands[arg]->getAsTyped()->getType()); + } else { + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + glslang::TOperator glslangOp = node->getOp(); + if (arg == 1 && + (glslangOp == glslang::EOpRayQueryGetIntersectionType || + glslangOp == glslang::EOpRayQueryGetIntersectionT || + glslangOp == glslang::EOpRayQueryGetIntersectionInstanceCustomIndex || + glslangOp == glslang::EOpRayQueryGetIntersectionInstanceId || + glslangOp == glslang::EOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffset || + glslangOp == glslang::EOpRayQueryGetIntersectionGeometryIndex || + glslangOp == glslang::EOpRayQueryGetIntersectionPrimitiveIndex || + glslangOp == glslang::EOpRayQueryGetIntersectionBarycentrics || + glslangOp == glslang::EOpRayQueryGetIntersectionFrontFace || + glslangOp == glslang::EOpRayQueryGetIntersectionObjectRayDirection || + glslangOp == glslang::EOpRayQueryGetIntersectionObjectRayOrigin || + glslangOp == glslang::EOpRayQueryGetIntersectionObjectToWorld || + glslangOp == glslang::EOpRayQueryGetIntersectionWorldToObject || + glslangOp == glslang::EOpRayQueryGetIntersectionTriangleVertexPositionsEXT || + glslangOp == glslang::EOpRayQueryGetIntersectionClusterIdNV || + glslangOp == glslang::EOpRayQueryGetIntersectionSpherePositionNV || + glslangOp == glslang::EOpRayQueryGetIntersectionSphereRadiusNV || + glslangOp == glslang::EOpRayQueryGetIntersectionLSSHitValueNV || + glslangOp == glslang::EOpRayQueryGetIntersectionLSSPositionsNV || + glslangOp == glslang::EOpRayQueryGetIntersectionLSSRadiiNV || + glslangOp == glslang::EOpRayQueryIsLSSHitNV || + glslangOp == glslang::EOpRayQueryIsSphereHitNV + )) { + bool cond = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getBConst(); + operands.push_back(builder.makeIntConstant(cond ? 1 : 0)); + } else if ((arg == 10 && glslangOp == glslang::EOpTraceKHR) || + (arg == 11 && glslangOp == glslang::EOpTraceRayMotionNV) || + (arg == 1 && glslangOp == glslang::EOpExecuteCallableKHR) || + (arg == 1 && glslangOp == glslang::EOpHitObjectExecuteShaderNV) || + (arg == 1 && glslangOp == glslang::EOpHitObjectExecuteShaderEXT) || + (arg == 11 && glslangOp == glslang::EOpHitObjectTraceRayNV) || + (arg == 11 && glslangOp == glslang::EOpHitObjectTraceRayEXT) || + (arg == 12 && glslangOp == glslang::EOpHitObjectTraceRayMotionNV) || + (arg == 12 && glslangOp == glslang::EOpHitObjectTraceRayMotionEXT) || + (arg == 12 && glslangOp == glslang::EOpHitObjectTraceMotionReorderExecuteEXT && glslangOperands.size() == 13) || + (arg == 14 && glslangOp == glslang::EOpHitObjectTraceMotionReorderExecuteEXT && glslangOperands.size() == 15) || + (arg == 11 && glslangOp == glslang::EOpHitObjectTraceReorderExecuteEXT && glslangOperands.size() == 12) || + (arg == 13 && glslangOp == glslang::EOpHitObjectTraceReorderExecuteEXT && glslangOperands.size() == 14) || + (arg == 1 && glslangOp == glslang::EOpHitObjectReorderExecuteEXT && glslangOperands.size() == 2) || + (arg == 3 && glslangOp == glslang::EOpHitObjectReorderExecuteEXT && glslangOperands.size() == 4)) { + const int set = glslangOp == glslang::EOpExecuteCallableKHR ? 1 : 0; + const int location = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getUConst(); + auto itNode = locationToSymbol[set].find(location); + visitSymbol(itNode->second); + spv::Id symId = getSymbolId(itNode->second); + operands.push_back(symId); + } else if ((arg == 12 && glslangOp == glslang::EOpHitObjectRecordHitNV) || + (arg == 13 && glslangOp == glslang::EOpHitObjectRecordHitMotionNV) || + (arg == 11 && glslangOp == glslang::EOpHitObjectRecordHitWithIndexNV) || + (arg == 12 && glslangOp == glslang::EOpHitObjectRecordHitWithIndexMotionNV) || + (arg == 3 && glslangOp == glslang::EOpHitObjectRecordFromQueryEXT) || + (arg == 1 && glslangOp == glslang::EOpHitObjectGetAttributesEXT) || + (arg == 1 && glslangOp == glslang::EOpHitObjectGetAttributesNV)) { + const int location = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getUConst(); + const int set = 2; + auto itNode = locationToSymbol[set].find(location); + visitSymbol(itNode->second); + spv::Id symId = getSymbolId(itNode->second); + operands.push_back(symId); + } else if (glslangOperands[arg]->getAsTyped()->getQualifier().isSpirvLiteral()) { + // Will be translated to a literal value, make a placeholder here + operands.push_back(spv::NoResult); + } else if (glslangOperands[arg]->getAsTyped()->getBasicType() == glslang::EbtFunction) { + spv::Function* function = functionMap[glslangOperands[arg]->getAsSymbolNode()->getMangledName().c_str()]; + assert(function); + operands.push_back(function->getId()); + } else { + operands.push_back(accessChainLoad(glslangOperands[arg]->getAsTyped()->getType())); + } + } + } + + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + if (node->getOp() == glslang::EOpCooperativeMatrixLoadTensorNV) { + std::vector idImmOps; + + builder.addCapability(spv::Capability::CooperativeMatrixTensorAddressingNV); + builder.addExtension(spv::E_SPV_NV_cooperative_matrix2); + + spv::Id object = builder.createLoad(operands[0], spv::NoPrecision); + + idImmOps.push_back(spv::IdImmediate(true, operands[1])); // Pointer + idImmOps.push_back(spv::IdImmediate(true, object)); // Object + idImmOps.push_back(spv::IdImmediate(true, operands[2])); // tensorLayout + + idImmOps.insert(idImmOps.end(), memoryAccessOperands.begin(), memoryAccessOperands.end()); // memoryaccess + + // initialize tensor operands to zero, then OR in flags based on the operands + size_t tensorOpIdx = idImmOps.size(); + idImmOps.push_back(spv::IdImmediate(false, 0)); + + for (uint32_t i = 3; i < operands.size(); ++i) { + if (builder.isTensorView(operands[i])) { + addMask(idImmOps[tensorOpIdx].word, spv::TensorAddressingOperandsMask::TensorView); + } else { + // must be the decode func + addMask(idImmOps[tensorOpIdx].word, spv::TensorAddressingOperandsMask::DecodeFunc); + builder.addCapability(spv::Capability::CooperativeMatrixBlockLoadsNV); + } + idImmOps.push_back(spv::IdImmediate(true, operands[i])); // tensorView or decodeFunc + } + + // get the pointee type + spv::Id typeId = builder.getContainedTypeId(builder.getTypeId(operands[0])); + assert(builder.isCooperativeMatrixType(typeId)); + // do the op + spv::Id result = builder.createOp(spv::Op::OpCooperativeMatrixLoadTensorNV, typeId, idImmOps); + // store the result to the pointer (out param 'm') + builder.createStore(result, operands[0]); + result = 0; + } else if (node->getOp() == glslang::EOpCooperativeMatrixLoad || + node->getOp() == glslang::EOpCooperativeMatrixLoadNV) { + std::vector idImmOps; + + idImmOps.push_back(spv::IdImmediate(true, operands[1])); // buf + if (node->getOp() == glslang::EOpCooperativeMatrixLoad) { + idImmOps.push_back(spv::IdImmediate(true, operands[3])); // matrixLayout + auto layout = (spv::CooperativeMatrixLayout)builder.getConstantScalar(operands[3]); + if (layout == spv::CooperativeMatrixLayout::RowBlockedInterleavedARM || + layout == spv::CooperativeMatrixLayout::ColumnBlockedInterleavedARM) { + builder.addExtension(spv::E_SPV_ARM_cooperative_matrix_layouts); + builder.addCapability(spv::Capability::CooperativeMatrixLayoutsARM); + } + idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride + } else { + idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride + idImmOps.push_back(spv::IdImmediate(true, operands[3])); // colMajor + } + idImmOps.insert(idImmOps.end(), memoryAccessOperands.begin(), memoryAccessOperands.end()); + // get the pointee type + spv::Id typeId = builder.getContainedTypeId(builder.getTypeId(operands[0])); + assert(builder.isCooperativeMatrixType(typeId)); + // do the op + spv::Id result = node->getOp() == glslang::EOpCooperativeMatrixLoad + ? builder.createOp(spv::Op::OpCooperativeMatrixLoadKHR, typeId, idImmOps) + : builder.createOp(spv::Op::OpCooperativeMatrixLoadNV, typeId, idImmOps); + // store the result to the pointer (out param 'm') + builder.createStore(result, operands[0]); + result = 0; + } else if (node->getOp() == glslang::EOpCooperativeMatrixStoreTensorNV) { + std::vector idImmOps; + + idImmOps.push_back(spv::IdImmediate(true, operands[1])); // buf + idImmOps.push_back(spv::IdImmediate(true, operands[0])); // object + + builder.addCapability(spv::Capability::CooperativeMatrixTensorAddressingNV); + builder.addExtension(spv::E_SPV_NV_cooperative_matrix2); + + idImmOps.push_back(spv::IdImmediate(true, operands[2])); // tensorLayout + + idImmOps.insert(idImmOps.end(), memoryAccessOperands.begin(), memoryAccessOperands.end()); // memoryaccess + + if (operands.size() > 3) { + idImmOps.push_back(spv::IdImmediate(false, spv::TensorAddressingOperandsMask::TensorView)); + idImmOps.push_back(spv::IdImmediate(true, operands[3])); // tensorView + } else { + idImmOps.push_back(spv::IdImmediate(false, 0)); + } + + builder.createNoResultOp(spv::Op::OpCooperativeMatrixStoreTensorNV, idImmOps); + result = 0; + } else if (node->getOp() == glslang::EOpCooperativeMatrixStore || + node->getOp() == glslang::EOpCooperativeMatrixStoreNV) { + std::vector idImmOps; + + idImmOps.push_back(spv::IdImmediate(true, operands[1])); // buf + idImmOps.push_back(spv::IdImmediate(true, operands[0])); // object + if (node->getOp() == glslang::EOpCooperativeMatrixStore) { + idImmOps.push_back(spv::IdImmediate(true, operands[3])); // matrixLayout + auto layout = (spv::CooperativeMatrixLayout)builder.getConstantScalar(operands[3]); + if (layout == spv::CooperativeMatrixLayout::RowBlockedInterleavedARM || + layout == spv::CooperativeMatrixLayout::ColumnBlockedInterleavedARM) { + builder.addExtension(spv::E_SPV_ARM_cooperative_matrix_layouts); + builder.addCapability(spv::Capability::CooperativeMatrixLayoutsARM); + } + idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride + } else { + idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride + idImmOps.push_back(spv::IdImmediate(true, operands[3])); // colMajor + } + idImmOps.insert(idImmOps.end(), memoryAccessOperands.begin(), memoryAccessOperands.end()); + + if (node->getOp() == glslang::EOpCooperativeMatrixStore) + builder.createNoResultOp(spv::Op::OpCooperativeMatrixStoreKHR, idImmOps); + else + builder.createNoResultOp(spv::Op::OpCooperativeMatrixStoreNV, idImmOps); + result = 0; + } else if (node->getOp() == glslang::EOpRayQueryGetIntersectionTriangleVertexPositionsEXT) { + std::vector idImmOps; + + idImmOps.push_back(spv::IdImmediate(true, operands[0])); // q + idImmOps.push_back(spv::IdImmediate(true, operands[1])); // committed + + spv::Id typeId = builder.makeArrayType(builder.makeVectorType(builder.makeFloatType(32), 3), + builder.makeUintConstant(3), 0); + // do the op + + spv::Op spvOp = spv::Op::OpRayQueryGetIntersectionTriangleVertexPositionsKHR; + + spv::Id result = builder.createOp(spvOp, typeId, idImmOps); + // store the result to the pointer (out param 'm') + builder.createStore(result, operands[2]); + result = 0; + } else if (node->getOp() == glslang::EOpRayQueryGetIntersectionLSSPositionsNV) { + std::vector idImmOps; + + idImmOps.push_back(spv::IdImmediate(true, operands[0])); // q + idImmOps.push_back(spv::IdImmediate(true, operands[1])); // committed + + spv::Id typeId = builder.makeArrayType(builder.makeVectorType(builder.makeFloatType(32), 3), + builder.makeUintConstant(2), 0); + // do the op + + spv::Op spvOp = spv::Op::OpRayQueryGetIntersectionLSSPositionsNV; + + spv::Id result = builder.createOp(spvOp, typeId, idImmOps); + // store the result to the pointer (out param 'm') + builder.createStore(result, operands[2]); + result = 0; + } else if (node->getOp() == glslang::EOpRayQueryGetIntersectionLSSRadiiNV) { + std::vector idImmOps; + + idImmOps.push_back(spv::IdImmediate(true, operands[0])); // q + idImmOps.push_back(spv::IdImmediate(true, operands[1])); // committed + + spv::Id typeId = builder.makeArrayType(builder.makeFloatType(32), + builder.makeUintConstant(2), 0); + // do the op + + spv::Op spvOp = spv::Op::OpRayQueryGetIntersectionLSSRadiiNV; + + spv::Id result = builder.createOp(spvOp, typeId, idImmOps); + // store the result to the pointer (out param 'm') + builder.createStore(result, operands[2]); + result = 0; + } else if (node->getOp() == glslang::EOpHitObjectGetLSSPositionsNV) { + std::vector idImmOps; + + idImmOps.push_back(spv::IdImmediate(true, operands[0])); // hitObject + + spv::Op spvOp = spv::Op::OpHitObjectGetLSSPositionsNV; + spv::Id typeId = builder.makeArrayType(builder.makeVectorType(builder.makeFloatType(32), 3), + builder.makeUintConstant(2), 0); + + spv::Id result = builder.createOp(spvOp, typeId, idImmOps); + // store the result to the pointer (out param 'm') + builder.createStore(result, operands[1]); + result = 0; + } else if (node->getOp() == glslang::EOpHitObjectGetLSSRadiiNV) { + std::vector idImmOps; + + idImmOps.push_back(spv::IdImmediate(true, operands[0])); // hitObject + + spv::Op spvOp = spv::Op::OpHitObjectGetLSSRadiiNV; + spv::Id typeId = builder.makeArrayType(builder.makeFloatType(32), + builder.makeUintConstant(2), 0); + + spv::Id result = builder.createOp(spvOp, typeId, idImmOps); + // store the result to the pointer (out param 'm') + builder.createStore(result, operands[1]); + result = 0; + } else if (node->getOp() == glslang::EOpHitObjectGetIntersectionTriangleVertexPositionsEXT) { + std::vector idImmOps; + + idImmOps.push_back(spv::IdImmediate(true, operands[0])); // hitObject + + spv::Op spvOp = spv::Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT; + spv::Id typeId = builder.makeArrayType(builder.makeVectorType(builder.makeFloatType(32), 3), + builder.makeUintConstant(3), 0); + + spv::Id result = builder.createOp(spvOp, typeId, idImmOps); + // store the result to the pointer (out param 'm') + builder.createStore(result, operands[1]); + result = 0; + } else if (node->getOp() == glslang::EOpCooperativeMatrixMulAdd) { + auto matrixOperands = spv::CooperativeMatrixOperandsMask::MaskNone; + + // If the optional operand is present, initialize matrixOperands to that value. + if (glslangOperands.size() == 4 && glslangOperands[3]->getAsConstantUnion()) { + matrixOperands = (spv::CooperativeMatrixOperandsMask)glslangOperands[3]->getAsConstantUnion()->getConstArray()[0].getIConst(); + } + + // Determine Cooperative Matrix Operands bits from the signedness of the types. + if (isTypeSignedInt(glslangOperands[0]->getAsTyped()->getBasicType())) + addMask(matrixOperands, spv::CooperativeMatrixOperandsMask::MatrixASignedComponentsKHR); + if (isTypeSignedInt(glslangOperands[1]->getAsTyped()->getBasicType())) + addMask(matrixOperands, spv::CooperativeMatrixOperandsMask::MatrixBSignedComponentsKHR); + if (isTypeSignedInt(glslangOperands[2]->getAsTyped()->getBasicType())) + addMask(matrixOperands, spv::CooperativeMatrixOperandsMask::MatrixCSignedComponentsKHR); + if (isTypeSignedInt(node->getBasicType())) + addMask(matrixOperands, spv::CooperativeMatrixOperandsMask::MatrixResultSignedComponentsKHR); + + std::vector idImmOps; + idImmOps.push_back(spv::IdImmediate(true, operands[0])); + idImmOps.push_back(spv::IdImmediate(true, operands[1])); + idImmOps.push_back(spv::IdImmediate(true, operands[2])); + if (matrixOperands != spv::CooperativeMatrixOperandsMask::MaskNone) + idImmOps.push_back(spv::IdImmediate(false, matrixOperands)); + + result = builder.createOp(spv::Op::OpCooperativeMatrixMulAddKHR, resultType(), idImmOps); + } else if (node->getOp() == glslang::EOpCooperativeMatrixReduceNV) { + builder.addCapability(spv::Capability::CooperativeMatrixReductionsNV); + builder.addExtension(spv::E_SPV_NV_cooperative_matrix2); + + spv::Op opcode = spv::Op::OpCooperativeMatrixReduceNV; + unsigned mask = glslangOperands[2]->getAsConstantUnion()->getConstArray()[0].getUConst(); + + spv::Id typeId = builder.getContainedTypeId(builder.getTypeId(operands[0])); + assert(builder.isCooperativeMatrixType(typeId)); + + result = builder.createCooperativeMatrixReduce(opcode, typeId, operands[1], mask, operands[3]); + // store the result to the pointer (out param 'm') + builder.createStore(result, operands[0]); + result = 0; + } else if (node->getOp() == glslang::EOpCooperativeMatrixPerElementOpNV) { + builder.addCapability(spv::Capability::CooperativeMatrixPerElementOperationsNV); + builder.addExtension(spv::E_SPV_NV_cooperative_matrix2); + + spv::Id typeId = builder.getContainedTypeId(builder.getTypeId(operands[0])); + assert(builder.isCooperativeMatrixType(typeId)); + + result = builder.createCooperativeMatrixPerElementOp(typeId, operands); + // store the result to the pointer + builder.createStore(result, operands[0]); + result = 0; + } else if (node->getOp() == glslang::EOpCooperativeMatrixTransposeNV) { + + builder.addCapability(spv::Capability::CooperativeMatrixConversionsNV); + builder.addExtension(spv::E_SPV_NV_cooperative_matrix2); + + spv::Id typeId = builder.getContainedTypeId(builder.getTypeId(operands[0])); + assert(builder.isCooperativeMatrixType(typeId)); + + result = builder.createUnaryOp(spv::Op::OpCooperativeMatrixTransposeNV, typeId, operands[1]); + // store the result to the pointer + builder.createStore(result, operands[0]); + result = 0; + } else if (node->getOp() == glslang::EOpBitCastArrayQCOM) { + builder.addCapability(spv::Capability::CooperativeMatrixConversionQCOM); + builder.addExtension(spv::E_SPV_QCOM_cooperative_matrix_conversion); + result = builder.createUnaryOp(spv::Op::OpBitCastArrayQCOM, resultType(), operands[0]); + } else if (node->getOp() == glslang::EOpCompositeConstructCoopMatQCOM) { + builder.addCapability(spv::Capability::CooperativeMatrixConversionQCOM); + builder.addExtension(spv::E_SPV_QCOM_cooperative_matrix_conversion); + result = builder.createUnaryOp(spv::Op::OpCompositeConstructCoopMatQCOM, resultType(), operands[0]); + } else if (node->getOp() == glslang::EOpCompositeExtractCoopMatQCOM) { + builder.addCapability(spv::Capability::CooperativeMatrixConversionQCOM); + builder.addExtension(spv::E_SPV_QCOM_cooperative_matrix_conversion); + result = builder.createUnaryOp(spv::Op::OpCompositeExtractCoopMatQCOM, resultType(), operands[0]); + } else if (node->getOp() == glslang::EOpExtractSubArrayQCOM) { + builder.addCapability(spv::Capability::CooperativeMatrixConversionQCOM); + builder.addExtension(spv::E_SPV_QCOM_cooperative_matrix_conversion); + + std::vector arguments { operands[0], operands[1] };; + result = builder.createOp(spv::Op::OpExtractSubArrayQCOM, resultType(), arguments); + } else if (node->getOp() == glslang::EOpCooperativeVectorMatMulNV || + node->getOp() == glslang::EOpCooperativeVectorMatMulAddNV) { + auto matrixOperands = spv::CooperativeMatrixOperandsMask::MaskNone; + + bool isMulAdd = node->getOp() == glslang::EOpCooperativeVectorMatMulAddNV; + + // Determine Cooperative Matrix Operands bits from the signedness of the types. + + if (isTypeSignedInt(glslangOperands[1]->getAsTyped()->getBasicType())) + addMask(matrixOperands, spv::CooperativeMatrixOperandsMask::MatrixBSignedComponentsKHR); + if (isTypeSignedInt(glslangOperands[0]->getAsTyped()->getBasicType())) + addMask(matrixOperands, spv::CooperativeMatrixOperandsMask::MatrixResultSignedComponentsKHR); + + uint32_t opIdx = 1; + std::vector idImmOps; + idImmOps.push_back(spv::IdImmediate(true, operands[opIdx++])); // Input + idImmOps.push_back(spv::IdImmediate(true, operands[opIdx++])); // InputInterpretation + idImmOps.push_back(spv::IdImmediate(true, operands[opIdx++])); // Matrix + idImmOps.push_back(spv::IdImmediate(true, operands[opIdx++])); // MatrixOffset + idImmOps.push_back(spv::IdImmediate(true, operands[opIdx++])); // MatrixInterpretation + if (isMulAdd) { + idImmOps.push_back(spv::IdImmediate(true, operands[opIdx++])); // Bias + idImmOps.push_back(spv::IdImmediate(true, operands[opIdx++])); // BiasOffset + idImmOps.push_back(spv::IdImmediate(true, operands[opIdx++])); // BiasInterpretation + } + idImmOps.push_back(spv::IdImmediate(true, operands[opIdx++])); // M + idImmOps.push_back(spv::IdImmediate(true, operands[opIdx++])); // K + idImmOps.push_back(spv::IdImmediate(true, operands[opIdx++])); // MemoryLayout + idImmOps.push_back(spv::IdImmediate(true, operands[opIdx++])); // Transpose + idImmOps.push_back(spv::IdImmediate(true, operands[opIdx++])); // MatrixStride + if (matrixOperands != spv::CooperativeMatrixOperandsMask::MaskNone) + idImmOps.push_back(spv::IdImmediate(false, matrixOperands)); // Cooperative Matrix Operands + + // get the pointee type + spv::Id typeId = builder.getContainedTypeId(builder.getTypeId(operands[0])); + assert(builder.isCooperativeVectorType(typeId)); + // do the op + spv::Id result = builder.createOp(isMulAdd ? spv::Op::OpCooperativeVectorMatrixMulAddNV : spv::Op::OpCooperativeVectorMatrixMulNV, typeId, idImmOps); + // store the result to the pointer (out param 'res') + builder.createStore(result, operands[0]); + result = 0; + } else if (node->getOp() == glslang::EOpCooperativeVectorLoadNV) { + std::vector idImmOps; + + idImmOps.push_back(spv::IdImmediate(true, operands[1])); // buf + idImmOps.push_back(spv::IdImmediate(true, operands[2])); // offset + idImmOps.insert(idImmOps.end(), memoryAccessOperands.begin(), memoryAccessOperands.end()); + // get the pointee type + spv::Id typeId = builder.getContainedTypeId(builder.getTypeId(operands[0])); + assert(builder.isCooperativeVectorType(typeId)); + // do the op + spv::Id result = builder.createOp(spv::Op::OpCooperativeVectorLoadNV, typeId, idImmOps); + // store the result to the pointer (out param 'v') + builder.createStore(result, operands[0]); + result = 0; + } else if (node->getOp() == glslang::EOpCooperativeVectorStoreNV) { + std::vector idImmOps; + + idImmOps.push_back(spv::IdImmediate(true, operands[1])); // buf + idImmOps.push_back(spv::IdImmediate(true, operands[2])); // offset + idImmOps.push_back(spv::IdImmediate(true, operands[0])); // object + idImmOps.insert(idImmOps.end(), memoryAccessOperands.begin(), memoryAccessOperands.end()); + builder.createNoResultOp(spv::Op::OpCooperativeVectorStoreNV, idImmOps); + result = 0; + } else if (node->getOp() == glslang::EOpCooperativeVectorOuterProductAccumulateNV) { + builder.addCapability(spv::Capability::CooperativeVectorTrainingNV); + builder.addExtension(spv::E_SPV_NV_cooperative_vector); + + std::vector idImmOps; + + idImmOps.push_back(spv::IdImmediate(true, operands[2])); // Matrix + idImmOps.push_back(spv::IdImmediate(true, operands[3])); // Offset + idImmOps.push_back(spv::IdImmediate(true, operands[0])); // A + idImmOps.push_back(spv::IdImmediate(true, operands[1])); // B + idImmOps.push_back(spv::IdImmediate(true, operands[5])); // MemoryLayout + idImmOps.push_back(spv::IdImmediate(true, operands[6])); // MatrixInterpretation + idImmOps.push_back(spv::IdImmediate(true, operands[4])); // Stride + builder.createNoResultOp(spv::Op::OpCooperativeVectorOuterProductAccumulateNV, idImmOps); + result = 0; + } else if (node->getOp() == glslang::EOpCooperativeVectorReduceSumAccumulateNV) { + builder.addCapability(spv::Capability::CooperativeVectorTrainingNV); + builder.addExtension(spv::E_SPV_NV_cooperative_vector); + + std::vector idImmOps; + + idImmOps.push_back(spv::IdImmediate(true, operands[1])); // Buf + idImmOps.push_back(spv::IdImmediate(true, operands[2])); // Offset + idImmOps.push_back(spv::IdImmediate(true, operands[0])); // A + builder.createNoResultOp(spv::Op::OpCooperativeVectorReduceSumAccumulateNV, idImmOps); + result = 0; + } else if (node->getOp() == glslang::EOpTensorReadARM || + node->getOp() == glslang::EOpTensorWriteARM) { + const bool isWrite = node->getOp() == glslang::EOpTensorWriteARM; + const unsigned int tensorMinOperandCount = 3; + assert(operands.size() >= tensorMinOperandCount); + std::vector idImmOps; + + idImmOps.push_back(spv::IdImmediate(true, operands[0])); // tensor + idImmOps.push_back(spv::IdImmediate(true, operands[1])); // coords + if (isWrite) { + idImmOps.push_back(spv::IdImmediate(true, operands[2])); // value + } + + // Analyze the tensor operands + spv::IdImmediate tensorOperands = { false, uint32_t(spv::TensorOperandsMask::MaskNone) }; + bool pushExtraArg = false; + if (operands.size() > tensorMinOperandCount) { + auto enumVal = builder.getConstantScalar(operands[tensorMinOperandCount]); + + if (enumVal & uint32_t(spv::TensorOperandsMask::NontemporalARM)) { + tensorOperands.word |= uint32_t(spv::TensorOperandsMask::NontemporalARM); + } + if (enumVal & uint32_t(spv::TensorOperandsMask::OutOfBoundsValueARM)) { + tensorOperands.word |= uint32_t(spv::TensorOperandsMask::OutOfBoundsValueARM); + assert(operands.size() >= tensorMinOperandCount + 2 && + "TensorOperandsOutOfBoundsValueMask requires an additional value"); + pushExtraArg = true; + } + } + + // Append optional tensor operands if the mask was non-zero. + if (tensorOperands.word) { + idImmOps.push_back(tensorOperands); + if (pushExtraArg) + idImmOps.push_back(spv::IdImmediate(true, operands[tensorMinOperandCount + 1])); + } + + if (isWrite) { + builder.createNoResultOp(spv::Op::OpTensorWriteARM, idImmOps); + result = 0; + } else { + // Use the result argument type as the OpTensorReadARM result type. + const glslang::TType &resArgType = glslangOperands[2]->getAsTyped()->getType(); + spv::Id retType = convertGlslangToSpvType(resArgType); + result = builder.createOp(spv::Op::OpTensorReadARM, retType, idImmOps); + // Store the result to the result argument. + builder.createStore(result, operands[2]); + } + } else if (node->getOp() == glslang::EOpTensorSizeARM) { + // Expected operands are (tensor, dimension) + assert(operands.size() == 2); + + spv::Id tensorOp = operands[0]; + spv::Id dimOp = operands[1]; + assert(builder.isTensorTypeARM(builder.getTypeId(tensorOp)) && "operand #0 must be a tensor"); + + std::vector idImmOps; + idImmOps.push_back(spv::IdImmediate(true, tensorOp)); + idImmOps.push_back(spv::IdImmediate(true, dimOp)); + result = builder.createOp(spv::Op::OpTensorQuerySizeARM, resultType(), idImmOps); + } else if (atomic) { + // Handle all atomics + glslang::TBasicType typeProxy = (node->getOp() == glslang::EOpAtomicStore) + ? node->getSequence()[0]->getAsTyped()->getBasicType() : node->getBasicType(); + result = createAtomicOperation(node->getOp(), precision, resultType(), operands, typeProxy, + lvalueCoherentFlags, node->getType()); + } else if (node->getOp() == glslang::EOpSpirvInst) { + const auto& spirvInst = node->getSpirvInstruction(); + if (spirvInst.set == "") { + std::vector idImmOps; + for (unsigned int i = 0; i < glslangOperands.size(); ++i) { + if (glslangOperands[i]->getAsTyped()->getQualifier().isSpirvLiteral()) { + // Translate the constant to a literal value + std::vector literals; + glslang::TVector constants; + constants.push_back(glslangOperands[i]->getAsConstantUnion()); + TranslateLiterals(constants, literals); + idImmOps.push_back({false, literals[0]}); + } else + idImmOps.push_back({true, operands[i]}); + } + + if (node->getBasicType() == glslang::EbtVoid) + builder.createNoResultOp(static_cast(spirvInst.id), idImmOps); + else + result = builder.createOp(static_cast(spirvInst.id), resultType(), idImmOps); + } else { + result = builder.createBuiltinCall( + resultType(), spirvInst.set == "GLSL.std.450" ? stdBuiltins : getExtBuiltins(spirvInst.set.c_str()), + spirvInst.id, operands); + } + noReturnValue = node->getBasicType() == glslang::EbtVoid; + } else if (node->getOp() == glslang::EOpDebugPrintf) { + if (!nonSemanticDebugPrintf) { + nonSemanticDebugPrintf = builder.import("NonSemantic.DebugPrintf"); + } + result = builder.createBuiltinCall(builder.makeVoidType(), nonSemanticDebugPrintf, spv::NonSemanticDebugPrintfDebugPrintf, operands); + builder.addExtension(spv::E_SPV_KHR_non_semantic_info); + } else { + // Pass through to generic operations. + switch (glslangOperands.size()) { + case 0: + result = createNoArgOperation(node->getOp(), precision, resultType()); + break; + case 1: + { + OpDecorations decorations = { precision, + TranslateNoContractionDecoration(node->getType().getQualifier()), + TranslateNonUniformDecoration(node->getType().getQualifier()) }; + result = createUnaryOperation( + node->getOp(), decorations, + resultType(), operands.front(), + glslangOperands[0]->getAsTyped()->getBasicType(), lvalueCoherentFlags, node->getType()); + } + break; + default: + result = createMiscOperation(node->getOp(), precision, resultType(), operands, node->getBasicType()); + break; + } + + if (invertedType != spv::NoResult) + result = createInvertedSwizzle(precision, *glslangOperands[0]->getAsBinaryNode(), result); + + for (unsigned int i = 0; i < temporaryLvalues.size(); ++i) { + builder.setAccessChain(complexLvalues[i]); + builder.accessChainStore(builder.createLoad(temporaryLvalues[i], spv::NoPrecision), + TranslateNonUniformDecoration(complexLvalues[i].coherentFlags)); + } + } + + if (noReturnValue) + return false; + + if (! result) { + logger->missingFunctionality("unknown glslang aggregate"); + return true; // pick up a child as a placeholder operand + } else { + builder.clearAccessChain(); + builder.setAccessChainRValue(result); + return false; + } +} + +// This path handles both if-then-else and ?: +// The if-then-else has a node type of void, while +// ?: has either a void or a non-void node type +// +// Leaving the result, when not void: +// GLSL only has r-values as the result of a :?, but +// if we have an l-value, that can be more efficient if it will +// become the base of a complex r-value expression, because the +// next layer copies r-values into memory to use the access-chain mechanism +bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang::TIntermSelection* node) +{ + // see if OpSelect can handle it + const auto isOpSelectable = [&]() { + if (node->getBasicType() == glslang::EbtVoid) + return false; + // OpSelect can do all other types starting with SPV 1.4 + if (glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_4) { + // pre-1.4, only scalars and vectors can be handled + if ((!node->getType().isScalar() && !node->getType().isVector())) + return false; + } + return true; + }; + + // See if it simple and safe, or required, to execute both sides. + // Crucially, side effects must be either semantically required or avoided, + // and there are performance trade-offs. + // Return true if required or a good idea (and safe) to execute both sides, + // false otherwise. + const auto bothSidesPolicy = [&]() -> bool { + // do we have both sides? + if (node->getTrueBlock() == nullptr || + node->getFalseBlock() == nullptr) + return false; + + // required? (unless we write additional code to look for side effects + // and make performance trade-offs if none are present) + if (!node->getShortCircuit()) + return true; + + // if not required to execute both, decide based on performance/practicality... + + if (!isOpSelectable()) + return false; + + assert(node->getType() == node->getTrueBlock() ->getAsTyped()->getType() && + node->getType() == node->getFalseBlock()->getAsTyped()->getType()); + + // return true if a single operand to ? : is okay for OpSelect + const auto operandOkay = [](glslang::TIntermTyped* node) { + return node->getAsSymbolNode() || node->getType().getQualifier().isConstant(); + }; + + return operandOkay(node->getTrueBlock() ->getAsTyped()) && + operandOkay(node->getFalseBlock()->getAsTyped()); + }; + + spv::Id result = spv::NoResult; // upcoming result selecting between trueValue and falseValue + // emit the condition before doing anything with selection + node->getCondition()->traverse(this); + spv::Id condition = accessChainLoad(node->getCondition()->getType()); + + // Find a way of executing both sides and selecting the right result. + const auto executeBothSides = [&]() -> void { + // execute both sides + spv::Id resultType = convertGlslangToSpvType(node->getType()); + node->getTrueBlock()->traverse(this); + spv::Id trueValue = accessChainLoad(node->getTrueBlock()->getAsTyped()->getType()); + node->getFalseBlock()->traverse(this); + spv::Id falseValue = accessChainLoad(node->getFalseBlock()->getAsTyped()->getType()); + + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + + // done if void + if (node->getBasicType() == glslang::EbtVoid) + return; + + // emit code to select between trueValue and falseValue + // see if OpSelect can handle the result type, and that the SPIR-V types + // of the inputs match the result type. + if (isOpSelectable()) { + // Emit OpSelect for this selection. + + // smear condition to vector, if necessary (AST is always scalar) + // Before 1.4, smear like for mix(), starting with 1.4, keep it scalar + if (glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_4 && builder.isVector(trueValue)) { + condition = builder.smearScalar(spv::NoPrecision, condition, + builder.makeVectorType(builder.makeBoolType(), + builder.getNumComponents(trueValue))); + } + + // If the types do not match, it is because of mismatched decorations on aggregates. + // Since isOpSelectable only lets us get here for SPIR-V >= 1.4, we can use OpCopyObject + // to get matching types. + if (builder.getTypeId(trueValue) != resultType) { + trueValue = builder.createUnaryOp(spv::Op::OpCopyLogical, resultType, trueValue); + } + if (builder.getTypeId(falseValue) != resultType) { + falseValue = builder.createUnaryOp(spv::Op::OpCopyLogical, resultType, falseValue); + } + + // OpSelect + result = builder.createTriOp(spv::Op::OpSelect, resultType, condition, trueValue, falseValue); + + builder.clearAccessChain(); + builder.setAccessChainRValue(result); + } else { + // We need control flow to select the result. + // TODO: Once SPIR-V OpSelect allows arbitrary types, eliminate this path. + result = builder.createVariable(TranslatePrecisionDecoration(node->getType()), + spv::StorageClass::Function, resultType); + + // Selection control: + const spv::SelectionControlMask control = TranslateSelectionControl(*node); + + // make an "if" based on the value created by the condition + spv::Builder::If ifBuilder(condition, control, builder); + + // emit the "then" statement + builder.clearAccessChain(); + builder.setAccessChainLValue(result); + multiTypeStore(node->getType(), trueValue); + + ifBuilder.makeBeginElse(); + // emit the "else" statement + builder.clearAccessChain(); + builder.setAccessChainLValue(result); + multiTypeStore(node->getType(), falseValue); + + // finish off the control flow + ifBuilder.makeEndIf(); + + builder.clearAccessChain(); + builder.setAccessChainLValue(result); + } + }; + + // Execute the one side needed, as per the condition + const auto executeOneSide = [&]() { + // Always emit control flow. + if (node->getBasicType() != glslang::EbtVoid) { + result = builder.createVariable(TranslatePrecisionDecoration(node->getType()), spv::StorageClass::Function, + convertGlslangToSpvType(node->getType())); + } + + // Selection control: + const spv::SelectionControlMask control = TranslateSelectionControl(*node); + + // make an "if" based on the value created by the condition + spv::Builder::If ifBuilder(condition, control, builder); + + // emit the "then" statement + if (node->getTrueBlock() != nullptr) { + node->getTrueBlock()->traverse(this); + if (result != spv::NoResult) { + spv::Id load = accessChainLoad(node->getTrueBlock()->getAsTyped()->getType()); + + builder.clearAccessChain(); + builder.setAccessChainLValue(result); + multiTypeStore(node->getType(), load); + } + } + + if (node->getFalseBlock() != nullptr) { + ifBuilder.makeBeginElse(); + // emit the "else" statement + node->getFalseBlock()->traverse(this); + if (result != spv::NoResult) { + spv::Id load = accessChainLoad(node->getFalseBlock()->getAsTyped()->getType()); + + builder.clearAccessChain(); + builder.setAccessChainLValue(result); + multiTypeStore(node->getType(), load); + } + } + + // finish off the control flow + ifBuilder.makeEndIf(); + + if (result != spv::NoResult) { + builder.clearAccessChain(); + builder.setAccessChainLValue(result); + } + }; + + // Try for OpSelect (or a requirement to execute both sides) + if (bothSidesPolicy()) { + SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); + if (node->getType().getQualifier().isSpecConstant()) + spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); + executeBothSides(); + } else + executeOneSide(); + + return false; +} + +bool TGlslangToSpvTraverser::visitSwitch(glslang::TVisit /* visit */, glslang::TIntermSwitch* node) +{ + // emit and get the condition before doing anything with switch + node->getCondition()->traverse(this); + spv::Id selector = accessChainLoad(node->getCondition()->getAsTyped()->getType()); + + // Selection control: + const spv::SelectionControlMask control = TranslateSwitchControl(*node); + + // browse the children to sort out code segments + int defaultSegment = -1; + std::vector codeSegments; + glslang::TIntermSequence& sequence = node->getBody()->getSequence(); + std::vector caseValues; + std::vector valueIndexToSegment(sequence.size()); // note: probably not all are used, it is an overestimate + for (glslang::TIntermSequence::iterator c = sequence.begin(); c != sequence.end(); ++c) { + TIntermNode* child = *c; + if (child->getAsBranchNode() && child->getAsBranchNode()->getFlowOp() == glslang::EOpDefault) + defaultSegment = (int)codeSegments.size(); + else if (child->getAsBranchNode() && child->getAsBranchNode()->getFlowOp() == glslang::EOpCase) { + valueIndexToSegment[caseValues.size()] = (int)codeSegments.size(); + caseValues.push_back(child->getAsBranchNode()->getExpression()->getAsConstantUnion() + ->getConstArray()[0].getIConst()); + } else + codeSegments.push_back(child); + } + + // handle the case where the last code segment is missing, due to no code + // statements between the last case and the end of the switch statement + if ((caseValues.size() && (int)codeSegments.size() == valueIndexToSegment[caseValues.size() - 1]) || + (int)codeSegments.size() == defaultSegment) + codeSegments.push_back(nullptr); + + // make the switch statement + std::vector segmentBlocks; // returned, as the blocks allocated in the call + builder.makeSwitch(selector, control, (int)codeSegments.size(), caseValues, valueIndexToSegment, defaultSegment, + segmentBlocks); + + // emit all the code in the segments + breakForLoop.push(false); + for (unsigned int s = 0; s < codeSegments.size(); ++s) { + builder.nextSwitchSegment(segmentBlocks, s); + if (codeSegments[s]) + codeSegments[s]->traverse(this); + else + builder.addSwitchBreak(true); + } + breakForLoop.pop(); + + builder.endSwitch(segmentBlocks); + + return false; +} + +void TGlslangToSpvTraverser::visitConstantUnion(glslang::TIntermConstantUnion* node) +{ + if (node->getQualifier().isSpirvLiteral()) + return; // Translated to a literal value, skip further processing + + int nextConst = 0; + spv::Id constant = createSpvConstantFromConstUnionArray(node->getType(), node->getConstArray(), nextConst, false); + + builder.clearAccessChain(); + builder.setAccessChainRValue(constant); +} + +bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIntermLoop* node) +{ + auto blocks = builder.makeNewLoop(); + builder.createBranch(true, &blocks.head); + + // Loop control: + std::vector operands; + const spv::LoopControlMask control = TranslateLoopControl(*node, operands); + + // Spec requires back edges to target header blocks, and every header block + // must dominate its merge block. Make a header block first to ensure these + // conditions are met. By definition, it will contain OpLoopMerge, followed + // by a block-ending branch. But we don't want to put any other body/test + // instructions in it, since the body/test may have arbitrary instructions, + // including merges of its own. + builder.setBuildPoint(&blocks.head); + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + builder.createLoopMerge(&blocks.merge, &blocks.continue_target, control, operands); + if (node->testFirst() && node->getTest()) { + spv::Block& test = builder.makeNewBlock(); + builder.createBranch(true, &test); + + builder.setBuildPoint(&test); + node->getTest()->traverse(this); + spv::Id condition = accessChainLoad(node->getTestExpr()->getType()); + builder.createConditionalBranch(condition, &blocks.body, &blocks.merge); + + builder.setBuildPoint(&blocks.body); + breakForLoop.push(true); + if (node->getBody()) + node->getBody()->traverse(this); + builder.createBranch(true, &blocks.continue_target); + breakForLoop.pop(); + + builder.setBuildPoint(&blocks.continue_target); + if (node->getTerminal()) + node->getTerminal()->traverse(this); + builder.createBranch(true, &blocks.head); + } else { + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + builder.createBranch(true, &blocks.body); + + breakForLoop.push(true); + builder.setBuildPoint(&blocks.body); + if (node->getBody()) + node->getBody()->traverse(this); + builder.createBranch(true, &blocks.continue_target); + breakForLoop.pop(); + + builder.setBuildPoint(&blocks.continue_target); + if (node->getTerminal()) + node->getTerminal()->traverse(this); + if (node->getTest()) { + node->getTest()->traverse(this); + spv::Id condition = + accessChainLoad(node->getTestExpr()->getType()); + builder.createConditionalBranch(condition, &blocks.head, &blocks.merge); + } else { + // TODO: unless there was a break/return/discard instruction + // somewhere in the body, this is an infinite loop, so we should + // issue a warning. + builder.createBranch(true, &blocks.head); + } + } + builder.setBuildPoint(&blocks.merge); + builder.closeLoop(); + return false; +} + +bool TGlslangToSpvTraverser::visitBranch(glslang::TVisit /* visit */, glslang::TIntermBranch* node) +{ + if (node->getExpression()) + node->getExpression()->traverse(this); + + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + + switch (node->getFlowOp()) { + case glslang::EOpKill: + if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6) { + builder.addCapability(spv::Capability::DemoteToHelperInvocation); + builder.createNoResultOp(spv::Op::OpDemoteToHelperInvocationEXT); + } else { + builder.makeStatementTerminator(spv::Op::OpKill, "post-discard"); + } + break; + case glslang::EOpTerminateInvocation: + builder.addExtension(spv::E_SPV_KHR_terminate_invocation); + builder.makeStatementTerminator(spv::Op::OpTerminateInvocation, "post-terminate-invocation"); + break; + case glslang::EOpBreak: + if (breakForLoop.top()) + builder.createLoopExit(); + else + builder.addSwitchBreak(false); + break; + case glslang::EOpContinue: + builder.createLoopContinue(); + break; + case glslang::EOpReturn: + if (node->getExpression() != nullptr) { + const glslang::TType& glslangReturnType = node->getExpression()->getType(); + spv::Id returnId = accessChainLoad(glslangReturnType); + if (builder.getTypeId(returnId) != currentFunction->getReturnType() || + TranslatePrecisionDecoration(glslangReturnType) != currentFunction->getReturnPrecision()) { + builder.clearAccessChain(); + spv::Id copyId = builder.createVariable(currentFunction->getReturnPrecision(), + spv::StorageClass::Function, currentFunction->getReturnType()); + builder.setAccessChainLValue(copyId); + multiTypeStore(glslangReturnType, returnId); + returnId = builder.createLoad(copyId, currentFunction->getReturnPrecision()); + } + builder.makeReturn(false, returnId); + } else + builder.makeReturn(false); + + builder.clearAccessChain(); + break; + + case glslang::EOpDemote: + builder.createNoResultOp(spv::Op::OpDemoteToHelperInvocationEXT); + builder.addExtension(spv::E_SPV_EXT_demote_to_helper_invocation); + builder.addCapability(spv::Capability::DemoteToHelperInvocationEXT); + break; + case glslang::EOpTerminateRayKHR: + builder.makeStatementTerminator(spv::Op::OpTerminateRayKHR, "post-terminateRayKHR"); + break; + case glslang::EOpIgnoreIntersectionKHR: + builder.makeStatementTerminator(spv::Op::OpIgnoreIntersectionKHR, "post-ignoreIntersectionKHR"); + break; + + default: + assert(0); + break; + } + + return false; +} + +bool TGlslangToSpvTraverser::visitVariableDecl(glslang::TVisit visit, glslang::TIntermVariableDecl* node) +{ + if (visit == glslang::EvPreVisit) { + builder.setDebugSourceLocation(node->getDeclSymbol()->getLoc().line, node->getDeclSymbol()->getLoc().getFilename()); + // We touch the symbol once here to create the debug info. + getSymbolId(node->getDeclSymbol()); + } + + return true; +} + + +spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol* node, spv::Id forcedType) +{ + // First, steer off constants, which are not SPIR-V variables, but + // can still have a mapping to a SPIR-V Id. + // This includes specialization constants. + if (node->getQualifier().isConstant()) { + spv::Id result = createSpvConstant(*node); + if (result != spv::NoResult) { + auto name = node->getAsSymbolNode()->getAccessName().c_str(); + auto typeId = convertGlslangToSpvType(node->getType()); + builder.createConstVariable(typeId, name, result, currentFunction == nullptr); + return result; + } + } + + // Now, handle actual variables + spv::StorageClass storageClass = TranslateStorageClass(node->getType()); + spv::Id spvType = forcedType == spv::NoType ? convertGlslangToSpvType(node->getType()) + : forcedType; + + const bool contains16BitType = node->getType().contains16BitFloat() || + node->getType().contains16BitInt(); + if (contains16BitType) { + switch (storageClass) { + case spv::StorageClass::Input: + case spv::StorageClass::Output: + builder.addIncorporatedExtension(spv::E_SPV_KHR_16bit_storage, spv::Spv_1_3); + builder.addCapability(spv::Capability::StorageInputOutput16); + break; + case spv::StorageClass::Uniform: + builder.addIncorporatedExtension(spv::E_SPV_KHR_16bit_storage, spv::Spv_1_3); + if (node->getType().getQualifier().storage == glslang::EvqBuffer) + builder.addCapability(spv::Capability::StorageUniformBufferBlock16); + else + builder.addCapability(spv::Capability::StorageUniform16); + break; + case spv::StorageClass::PushConstant: + builder.addIncorporatedExtension(spv::E_SPV_KHR_16bit_storage, spv::Spv_1_3); + builder.addCapability(spv::Capability::StoragePushConstant16); + break; + case spv::StorageClass::StorageBuffer: + case spv::StorageClass::PhysicalStorageBufferEXT: + builder.addIncorporatedExtension(spv::E_SPV_KHR_16bit_storage, spv::Spv_1_3); + builder.addCapability(spv::Capability::StorageUniformBufferBlock16); + break; + case spv::StorageClass::TileAttachmentQCOM: + builder.addCapability(spv::Capability::TileShadingQCOM); + break; + default: + if (storageClass == spv::StorageClass::Workgroup && + node->getType().getBasicType() == glslang::EbtBlock) { + builder.addCapability(spv::Capability::WorkgroupMemoryExplicitLayout16BitAccessKHR); + break; + } + if (node->getType().contains16BitFloat()) + builder.addCapability(spv::Capability::Float16); + if (node->getType().contains16BitInt()) + builder.addCapability(spv::Capability::Int16); + break; + } + } + + if (node->getType().contains8BitInt()) { + if (storageClass == spv::StorageClass::PushConstant) { + builder.addIncorporatedExtension(spv::E_SPV_KHR_8bit_storage, spv::Spv_1_5); + builder.addCapability(spv::Capability::StoragePushConstant8); + } else if (storageClass == spv::StorageClass::Uniform) { + builder.addIncorporatedExtension(spv::E_SPV_KHR_8bit_storage, spv::Spv_1_5); + builder.addCapability(spv::Capability::UniformAndStorageBuffer8BitAccess); + } else if (storageClass == spv::StorageClass::StorageBuffer) { + builder.addIncorporatedExtension(spv::E_SPV_KHR_8bit_storage, spv::Spv_1_5); + builder.addCapability(spv::Capability::StorageBuffer8BitAccess); + } else if (storageClass == spv::StorageClass::Workgroup && + node->getType().getBasicType() == glslang::EbtBlock) { + builder.addCapability(spv::Capability::WorkgroupMemoryExplicitLayout8BitAccessKHR); + } else { + builder.addCapability(spv::Capability::Int8); + } + } + + const char* name = node->getName().c_str(); + if (glslang::IsAnonymous(name)) + name = ""; + + spv::Id initializer = spv::NoResult; + + if (node->getType().getQualifier().storage == glslang::EvqUniform && !node->getConstArray().empty()) { + int nextConst = 0; + initializer = createSpvConstantFromConstUnionArray(node->getType(), + node->getConstArray(), + nextConst, + false /* specConst */); + } else if (node->getType().getQualifier().isNullInit()) { + initializer = builder.makeNullConstant(spvType); + } + + spv::Id var = builder.createVariable(spv::NoPrecision, storageClass, spvType, name, initializer, false); + + if (options.emitNonSemanticShaderDebugInfo && storageClass != spv::StorageClass::Function) { + // Create variable alias for retargeted symbols if any. + // Notably, this is only applicable to built-in variables so that it is okay to only use name as the key. + auto [itBegin, itEnd] = glslangIntermediate->getBuiltinAliasLookup().equal_range(name); + for (auto it = itBegin; it != itEnd; ++it) { + builder.createDebugGlobalVariable(builder.getDebugType(spvType), it->second.c_str(), var); + } + } + + std::vector topLevelDecorations; + glslang::TQualifier typeQualifier = node->getType().getQualifier(); + TranslateMemoryDecoration(typeQualifier, topLevelDecorations, glslangIntermediate->usingVulkanMemoryModel()); + for (auto deco : topLevelDecorations) { + builder.addDecoration(var, deco); + } + return var; +} + +// Return type Id of the sampled type. +spv::Id TGlslangToSpvTraverser::getSampledType(const glslang::TSampler& sampler) +{ + switch (sampler.type) { + case glslang::EbtInt: return builder.makeIntType(32); + case glslang::EbtUint: return builder.makeUintType(32); + case glslang::EbtFloat: return builder.makeFloatType(32); + case glslang::EbtFloat16: + builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float_fetch); + builder.addCapability(spv::Capability::Float16ImageAMD); + return builder.makeFloatType(16); + case glslang::EbtInt64: + builder.addExtension(spv::E_SPV_EXT_shader_image_int64); + builder.addCapability(spv::Capability::Int64ImageEXT); + return builder.makeIntType(64); + case glslang::EbtUint64: + builder.addExtension(spv::E_SPV_EXT_shader_image_int64); + builder.addCapability(spv::Capability::Int64ImageEXT); + return builder.makeUintType(64); + default: + assert(0); + return builder.makeFloatType(32); + } +} + +// If node is a swizzle operation, return the type that should be used if +// the swizzle base is first consumed by another operation, before the swizzle +// is applied. +spv::Id TGlslangToSpvTraverser::getInvertedSwizzleType(const glslang::TIntermTyped& node) +{ + if (node.getAsOperator() && + node.getAsOperator()->getOp() == glslang::EOpVectorSwizzle) + return convertGlslangToSpvType(node.getAsBinaryNode()->getLeft()->getType()); + else + return spv::NoType; +} + +// When inverting a swizzle with a parent op, this function +// will apply the swizzle operation to a completed parent operation. +spv::Id TGlslangToSpvTraverser::createInvertedSwizzle(spv::Decoration precision, const glslang::TIntermTyped& node, + spv::Id parentResult) +{ + std::vector swizzle; + convertSwizzle(*node.getAsBinaryNode()->getRight()->getAsAggregate(), swizzle); + return builder.createRvalueSwizzle(precision, convertGlslangToSpvType(node.getType()), parentResult, swizzle); +} + +// Convert a glslang AST swizzle node to a swizzle vector for building SPIR-V. +void TGlslangToSpvTraverser::convertSwizzle(const glslang::TIntermAggregate& node, std::vector& swizzle) +{ + const glslang::TIntermSequence& swizzleSequence = node.getSequence(); + for (int i = 0; i < (int)swizzleSequence.size(); ++i) + swizzle.push_back(swizzleSequence[i]->getAsConstantUnion()->getConstArray()[0].getIConst()); +} + +// Convert from a glslang type to an SPV type, by calling into a +// recursive version of this function. This establishes the inherited +// layout state rooted from the top-level type. +spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& type, bool forwardReferenceOnly) +{ + return convertGlslangToSpvType(type, getExplicitLayout(type), type.getQualifier(), false, forwardReferenceOnly); +} + +spv::LinkageType TGlslangToSpvTraverser::convertGlslangLinkageToSpv(glslang::TLinkType linkType) +{ + switch (linkType) { + case glslang::ELinkExport: + return spv::LinkageType::Export; + default: + return spv::LinkageType::Max; + } +} + +// Do full recursive conversion of an arbitrary glslang type to a SPIR-V Id. +// explicitLayout can be kept the same throughout the hierarchical recursive walk. +// Mutually recursive with convertGlslangStructToSpvType(). +spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& type, + glslang::TLayoutPacking explicitLayout, const glslang::TQualifier& qualifier, + bool lastBufferBlockMember, bool forwardReferenceOnly) +{ + spv::Id spvType = spv::NoResult; + + switch (type.getBasicType()) { + case glslang::EbtVoid: + spvType = builder.makeVoidType(); + assert (! type.isArray()); + break; + case glslang::EbtBool: + // "transparent" bool doesn't exist in SPIR-V. The GLSL convention is + // a 32-bit int where non-0 means true. + if (explicitLayout != glslang::ElpNone) + spvType = builder.makeUintType(32); + else + spvType = builder.makeBoolType(); + break; + case glslang::EbtInt: + spvType = builder.makeIntType(32); + break; + case glslang::EbtUint: + spvType = builder.makeUintType(32); + break; + case glslang::EbtFloat: + spvType = builder.makeFloatType(32); + break; + case glslang::EbtDouble: + spvType = builder.makeFloatType(64); + break; + case glslang::EbtFloat16: + spvType = builder.makeFloatType(16); + break; + case glslang::EbtBFloat16: + spvType = builder.makeBFloat16Type(); + break; + case glslang::EbtFloatE5M2: + spvType = builder.makeFloatE5M2Type(); + break; + case glslang::EbtFloatE4M3: + spvType = builder.makeFloatE4M3Type(); + break; + case glslang::EbtInt8: + spvType = builder.makeIntType(8); + break; + case glslang::EbtUint8: + spvType = builder.makeUintType(8); + break; + case glslang::EbtInt16: + spvType = builder.makeIntType(16); + break; + case glslang::EbtUint16: + spvType = builder.makeUintType(16); + break; + case glslang::EbtInt64: + spvType = builder.makeIntType(64); + break; + case glslang::EbtUint64: + spvType = builder.makeUintType(64); + break; + case glslang::EbtAtomicUint: + builder.addCapability(spv::Capability::AtomicStorage); + spvType = builder.makeUintType(32); + break; + case glslang::EbtAccStruct: + switch (glslangIntermediate->getStage()) { + case EShLangRayGen: + case EShLangIntersect: + case EShLangAnyHit: + case EShLangClosestHit: + case EShLangMiss: + case EShLangCallable: + // these all should have the RayTracingNV/KHR capability already + break; + default: + { + auto& extensions = glslangIntermediate->getRequestedExtensions(); + if (extensions.find("GL_EXT_ray_query") != extensions.end()) { + builder.addExtension(spv::E_SPV_KHR_ray_query); + builder.addCapability(spv::Capability::RayQueryKHR); + } + } + break; + } + spvType = builder.makeAccelerationStructureType(); + break; + case glslang::EbtRayQuery: + { + auto& extensions = glslangIntermediate->getRequestedExtensions(); + if (extensions.find("GL_EXT_ray_query") != extensions.end()) { + builder.addExtension(spv::E_SPV_KHR_ray_query); + builder.addCapability(spv::Capability::RayQueryKHR); + } + spvType = builder.makeRayQueryType(); + } + break; + case glslang::EbtReference: + { + // Make the forward pointer, then recurse to convert the structure type, then + // patch up the forward pointer with a real pointer type. + if (forwardPointers.find(type.getReferentType()) == forwardPointers.end()) { + spv::Id forwardId = builder.makeForwardPointer(spv::StorageClass::PhysicalStorageBufferEXT); + forwardPointers[type.getReferentType()] = forwardId; + } + spvType = forwardPointers[type.getReferentType()]; + if (!forwardReferenceOnly) { + spv::Id referentType = convertGlslangToSpvType(*type.getReferentType()); + builder.makePointerFromForwardPointer(spv::StorageClass::PhysicalStorageBufferEXT, + forwardPointers[type.getReferentType()], + referentType); + } + } + break; + case glslang::EbtSampler: + { + const glslang::TSampler& sampler = type.getSampler(); + std::string debugName; + + if (sampler.isPureSampler()) { + if (options.emitNonSemanticShaderDebugInfo) { + if (glslangIntermediate->getSource() == glslang::EShSourceGlsl) { + debugName = sampler.getString(); + } + else { + debugName = "type.sampler"; + } + } + spvType = builder.makeSamplerType(debugName.c_str()); + } else { + // an image is present, make its type + if (options.emitNonSemanticShaderDebugInfo) { + if (glslangIntermediate->getSource() == glslang::EShSourceGlsl) { + debugName = sampler.removeCombined().getString(); + } + else { + switch (sampler.dim) { + case glslang::Esd1D: debugName = "type.1d.image"; break; + case glslang::Esd2D: debugName = "type.2d.image"; break; + case glslang::Esd3D: debugName = "type.3d.image"; break; + case glslang::EsdCube: debugName = "type.cube.image"; break; + default: debugName = "type.image"; break; + } + } + } + spvType = builder.makeImageType(getSampledType(sampler), TranslateDimensionality(sampler), + sampler.isShadow(), sampler.isArrayed(), sampler.isMultiSample(), + sampler.isImageClass() ? 2 : 1, TranslateImageFormat(type), debugName.c_str()); + if (sampler.isCombined() && + (!sampler.isBuffer() || glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_6)) { + // Already has both image and sampler, make the combined type. Only combine sampler to + // buffer if before SPIR-V 1.6. + if (options.emitNonSemanticShaderDebugInfo) { + if (glslangIntermediate->getSource() == glslang::EShSourceGlsl) { + debugName = sampler.getString(); + } + else { + debugName = "type.sampled.image"; + } + } + spvType = builder.makeSampledImageType(spvType, debugName.c_str()); + } + } + } + break; + case glslang::EbtStruct: + case glslang::EbtBlock: + { + // If we've seen this struct type, return it + const glslang::TTypeList* glslangMembers = type.getStruct(); + + // Try to share structs for different layouts, but not yet for other + // kinds of qualification (primarily not yet including interpolant qualification). + if (! HasNonLayoutQualifiers(type, qualifier)) + spvType = structMap[explicitLayout][qualifier.layoutMatrix][glslangMembers]; + if (spvType != spv::NoResult) + break; + + // else, we haven't seen it... + if (type.getBasicType() == glslang::EbtBlock) + memberRemapper[glslangTypeToIdMap[glslangMembers]].resize(glslangMembers->size()); + spvType = convertGlslangStructToSpvType(type, glslangMembers, explicitLayout, qualifier); + } + break; + case glslang::EbtString: + // no type used for OpString + return 0; + + case glslang::EbtHitObjectNV: { + builder.addExtension(spv::E_SPV_NV_shader_invocation_reorder); + builder.addCapability(spv::Capability::ShaderInvocationReorderNV); + spvType = builder.makeHitObjectNVType(); + } + break; + + case glslang::EbtHitObjectEXT: { + builder.addExtension(spv::E_SPV_EXT_shader_invocation_reorder); + builder.addCapability(spv::Capability::ShaderInvocationReorderEXT); + spvType = builder.makeHitObjectEXTType(); + } + break; + case glslang::EbtSpirvType: { + // GL_EXT_spirv_intrinsics + const auto& spirvType = type.getSpirvType(); + const auto& spirvInst = spirvType.spirvInst; + + std::vector operands; + for (const auto& typeParam : spirvType.typeParams) { + if (typeParam.getAsConstant() != nullptr) { + // Constant expression + auto constant = typeParam.getAsConstant(); + if (constant->isLiteral()) { + if (constant->getBasicType() == glslang::EbtFloat) { + float floatValue = static_cast(constant->getConstArray()[0].getDConst()); + unsigned literal; + static_assert(sizeof(literal) == sizeof(floatValue), "sizeof(unsigned) != sizeof(float)"); + memcpy(&literal, &floatValue, sizeof(literal)); + operands.push_back({false, literal}); + } else if (constant->getBasicType() == glslang::EbtInt) { + unsigned literal = constant->getConstArray()[0].getIConst(); + operands.push_back({false, literal}); + } else if (constant->getBasicType() == glslang::EbtUint) { + unsigned literal = constant->getConstArray()[0].getUConst(); + operands.push_back({false, literal}); + } else if (constant->getBasicType() == glslang::EbtBool) { + unsigned literal = constant->getConstArray()[0].getBConst(); + operands.push_back({false, literal}); + } else if (constant->getBasicType() == glslang::EbtString) { + auto str = constant->getConstArray()[0].getSConst()->c_str(); + unsigned literal = 0; + char* literalPtr = reinterpret_cast(&literal); + unsigned charCount = 0; + char ch = 0; + do { + ch = *(str++); + *(literalPtr++) = ch; + ++charCount; + if (charCount == 4) { + operands.push_back({false, literal}); + literalPtr = reinterpret_cast(&literal); + charCount = 0; + } + } while (ch != 0); + + // Partial literal is padded with 0 + if (charCount > 0) { + for (; charCount < 4; ++charCount) + *(literalPtr++) = 0; + operands.push_back({false, literal}); + } + } else + assert(0); // Unexpected type + } else + operands.push_back({true, createSpvConstant(*constant)}); + } else { + // Type specifier + assert(typeParam.getAsType() != nullptr); + operands.push_back({true, convertGlslangToSpvType(*typeParam.getAsType())}); + } + } + + assert(spirvInst.set == ""); // Currently, couldn't be extended instructions. + spvType = builder.makeGenericType(static_cast(spirvInst.id), operands); + + break; + } + case glslang::EbtTensorLayoutNV: + { + builder.addCapability(spv::Capability::TensorAddressingNV); + builder.addExtension(spv::E_SPV_NV_tensor_addressing); + + std::vector operands; + for (uint32_t i = 0; i < 2; ++i) { + operands.push_back({true, makeArraySizeId(*type.getTypeParameters()->arraySizes, i, true)}); + } + spvType = builder.makeGenericType(spv::Op::OpTypeTensorLayoutNV, operands); + break; + } + case glslang::EbtTensorViewNV: + { + builder.addCapability(spv::Capability::TensorAddressingNV); + builder.addExtension(spv::E_SPV_NV_tensor_addressing); + + uint32_t dim = type.getTypeParameters()->arraySizes->getDimSize(0); + assert(dim >= 1 && dim <= 5); + std::vector operands; + for (uint32_t i = 0; i < dim + 2; ++i) { + operands.push_back({true, makeArraySizeId(*type.getTypeParameters()->arraySizes, i, true, i==1)}); + } + spvType = builder.makeGenericType(spv::Op::OpTypeTensorViewNV, operands); + break; + } + default: + assert(0); + break; + } + + if (type.isMatrix()) + spvType = builder.makeMatrixType(spvType, type.getMatrixCols(), type.getMatrixRows()); + else { + // If this variable has a vector element count greater than 1, create a SPIR-V vector + if (type.getVectorSize() > 1) + spvType = builder.makeVectorType(spvType, type.getVectorSize()); + } + + if (type.isCoopMatNV()) { + builder.addCapability(spv::Capability::CooperativeMatrixNV); + builder.addExtension(spv::E_SPV_NV_cooperative_matrix); + + if (type.getBasicType() == glslang::EbtFloat16) + builder.addCapability(spv::Capability::Float16); + if (type.getBasicType() == glslang::EbtUint8 || + type.getBasicType() == glslang::EbtInt8) { + builder.addCapability(spv::Capability::Int8); + } + + spv::Id scope = makeArraySizeId(*type.getTypeParameters()->arraySizes, 1); + spv::Id rows = makeArraySizeId(*type.getTypeParameters()->arraySizes, 2); + spv::Id cols = makeArraySizeId(*type.getTypeParameters()->arraySizes, 3); + + spvType = builder.makeCooperativeMatrixTypeNV(spvType, scope, rows, cols); + } + + if (type.isCoopMatKHR()) { + builder.addCapability(spv::Capability::CooperativeMatrixKHR); + builder.addExtension(spv::E_SPV_KHR_cooperative_matrix); + + if (type.getBasicType() == glslang::EbtBFloat16) { + builder.addExtension(spv::E_SPV_KHR_bfloat16); + builder.addCapability(spv::Capability::BFloat16CooperativeMatrixKHR); + } + + if (type.getBasicType() == glslang::EbtFloatE5M2 || type.getBasicType() == glslang::EbtFloatE4M3) { + builder.addExtension(spv::E_SPV_EXT_float8); + builder.addCapability(spv::Capability::Float8CooperativeMatrixEXT); + } + + if (type.getBasicType() == glslang::EbtFloat16) + builder.addCapability(spv::Capability::Float16); + if (type.getBasicType() == glslang::EbtUint8 || type.getBasicType() == glslang::EbtInt8) { + builder.addCapability(spv::Capability::Int8); + } + + spv::Id scope = makeArraySizeId(*type.getTypeParameters()->arraySizes, 0); + spv::Id rows = makeArraySizeId(*type.getTypeParameters()->arraySizes, 1); + spv::Id cols = makeArraySizeId(*type.getTypeParameters()->arraySizes, 2); + spv::Id use = makeArraySizeId(*type.getTypeParameters()->arraySizes, 3, true); + + spvType = builder.makeCooperativeMatrixTypeKHR(spvType, scope, rows, cols, use); + } + else if (type.isTensorARM()) { + builder.addCapability(spv::Capability::TensorsARM); + builder.addExtension(spv::E_SPV_ARM_tensors); + if (type.getBasicType() == glslang::EbtInt8 || type.getBasicType() == glslang::EbtUint8) { + builder.addCapability(spv::Capability::Int8); + } else if (type.getBasicType() == glslang::EbtInt16 || + type.getBasicType() == glslang::EbtUint16) { + builder.addCapability(spv::Capability::Int16); + } else if (type.getBasicType() == glslang::EbtInt64 || + type.getBasicType() == glslang::EbtUint64) { + builder.addCapability(spv::Capability::Int64); + } else if (type.getBasicType() == glslang::EbtFloat16) { + builder.addCapability(spv::Capability::Float16); + } + + spv::Id rank = makeArraySizeId(*type.getTypeParameters()->arraySizes, 0); + + spvType = builder.makeTensorTypeARM(spvType, rank); + } + + if (type.isCoopVecNV()) { + builder.addCapability(spv::Capability::CooperativeVectorNV); + builder.addExtension(spv::E_SPV_NV_cooperative_vector); + + if (type.getBasicType() == glslang::EbtFloat16) + builder.addCapability(spv::Capability::Float16); + if (type.getBasicType() == glslang::EbtUint8 || type.getBasicType() == glslang::EbtInt8) { + builder.addCapability(spv::Capability::Int8); + } + + spv::Id components = makeArraySizeId(*type.getTypeParameters()->arraySizes, 0); + + spvType = builder.makeCooperativeVectorTypeNV(spvType, components); + } + + if (type.isArray()) { + int stride = 0; // keep this 0 unless doing an explicit layout; 0 will mean no decoration, no stride + + // Do all but the outer dimension + if (type.getArraySizes()->getNumDims() > 1) { + // We need to decorate array strides for types needing explicit layout, except blocks. + if (explicitLayout != glslang::ElpNone && type.getBasicType() != glslang::EbtBlock) { + // Use a dummy glslang type for querying internal strides of + // arrays of arrays, but using just a one-dimensional array. + glslang::TType simpleArrayType(type, 0); // deference type of the array + while (simpleArrayType.getArraySizes()->getNumDims() > 1) + simpleArrayType.getArraySizes()->dereference(); + + // Will compute the higher-order strides here, rather than making a whole + // pile of types and doing repetitive recursion on their contents. + stride = getArrayStride(simpleArrayType, explicitLayout, qualifier.layoutMatrix); + } + + // make the arrays + for (int dim = type.getArraySizes()->getNumDims() - 1; dim > 0; --dim) { + spvType = builder.makeArrayType(spvType, makeArraySizeId(*type.getArraySizes(), dim), stride); + if (stride > 0) + builder.addDecoration(spvType, spv::Decoration::ArrayStride, stride); + stride *= type.getArraySizes()->getDimSize(dim); + } + } else { + // single-dimensional array, and don't yet have stride + + // We need to decorate array strides for types needing explicit layout, except blocks. + if (explicitLayout != glslang::ElpNone && type.getBasicType() != glslang::EbtBlock) + stride = getArrayStride(type, explicitLayout, qualifier.layoutMatrix); + } + + // Do the outer dimension, which might not be known for a runtime-sized array. + // (Unsized arrays that survive through linking will be runtime-sized arrays) + if (type.isSizedArray()) + spvType = builder.makeArrayType(spvType, makeArraySizeId(*type.getArraySizes(), 0), stride); + else { + // If we see an runtime array in a buffer_reference, it is not a descriptor + if (!lastBufferBlockMember && type.getBasicType() != glslang::EbtReference) { + builder.addIncorporatedExtension("SPV_EXT_descriptor_indexing", spv::Spv_1_5); + builder.addCapability(spv::Capability::RuntimeDescriptorArrayEXT); + } + spvType = builder.makeRuntimeArray(spvType); + } + if (stride > 0) + builder.addDecoration(spvType, spv::Decoration::ArrayStride, stride); + } + + return spvType; +} + +// Apply SPIR-V decorations to the SPIR-V object (provided by SPIR-V ID). If member index is provided, the +// decorations are applied to this member. +void TGlslangToSpvTraverser::applySpirvDecorate(const glslang::TType& type, spv::Id id, std::optional member) +{ + assert(type.getQualifier().hasSpirvDecorate()); + + const glslang::TSpirvDecorate& spirvDecorate = type.getQualifier().getSpirvDecorate(); + + // Add spirv_decorate + for (auto& decorate : spirvDecorate.decorates) { + if (!decorate.second.empty()) { + std::vector literals; + TranslateLiterals(decorate.second, literals); + if (member.has_value()) + builder.addMemberDecoration(id, *member, static_cast(decorate.first), literals); + else + builder.addDecoration(id, static_cast(decorate.first), literals); + } else { + if (member.has_value()) + builder.addMemberDecoration(id, *member, static_cast(decorate.first)); + else + builder.addDecoration(id, static_cast(decorate.first)); + } + } + + // Add spirv_decorate_id + if (member.has_value()) { + // spirv_decorate_id not applied to members + assert(spirvDecorate.decorateIds.empty()); + } else { + for (auto& decorateId : spirvDecorate.decorateIds) { + std::vector operandIds; + assert(!decorateId.second.empty()); + for (auto extraOperand : decorateId.second) { + if (extraOperand->getQualifier().isFrontEndConstant()) + operandIds.push_back(createSpvConstant(*extraOperand)); + else + operandIds.push_back(getSymbolId(extraOperand->getAsSymbolNode())); + } + builder.addDecorationId(id, static_cast(decorateId.first), operandIds); + } + } + + // Add spirv_decorate_string + for (auto& decorateString : spirvDecorate.decorateStrings) { + std::vector strings; + assert(!decorateString.second.empty()); + for (auto extraOperand : decorateString.second) { + const char* string = extraOperand->getConstArray()[0].getSConst()->c_str(); + strings.push_back(string); + } + if (member.has_value()) + builder.addMemberDecoration(id, *member, static_cast(decorateString.first), strings); + else + builder.addDecoration(id, static_cast(decorateString.first), strings); + } +} + +// TODO: this functionality should exist at a higher level, in creating the AST +// +// Identify interface members that don't have their required extension turned on. +// +bool TGlslangToSpvTraverser::filterMember(const glslang::TType& member) +{ + auto& extensions = glslangIntermediate->getRequestedExtensions(); + + if (member.getFieldName() == "gl_SecondaryViewportMaskNV" && + extensions.find("GL_NV_stereo_view_rendering") == extensions.end()) + return true; + if (member.getFieldName() == "gl_SecondaryPositionNV" && + extensions.find("GL_NV_stereo_view_rendering") == extensions.end()) + return true; + + if (glslangIntermediate->getStage() == EShLangMesh) { + if (member.getFieldName() == "gl_PrimitiveShadingRateEXT" && + extensions.find("GL_EXT_fragment_shading_rate") == extensions.end()) + return true; + } + + if (glslangIntermediate->getStage() != EShLangMesh) { + if (member.getFieldName() == "gl_ViewportMask" && + extensions.find("GL_NV_viewport_array2") == extensions.end()) + return true; + if (member.getFieldName() == "gl_PositionPerViewNV" && + extensions.find("GL_NVX_multiview_per_view_attributes") == extensions.end()) + return true; + if (member.getFieldName() == "gl_ViewportMaskPerViewNV" && + extensions.find("GL_NVX_multiview_per_view_attributes") == extensions.end()) + return true; + } + + return false; +} + +// Do full recursive conversion of a glslang structure (or block) type to a SPIR-V Id. +// explicitLayout can be kept the same throughout the hierarchical recursive walk. +// Mutually recursive with convertGlslangToSpvType(). +spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TType& type, + const glslang::TTypeList* glslangMembers, + glslang::TLayoutPacking explicitLayout, + const glslang::TQualifier& qualifier) +{ + // Create a vector of struct types for SPIR-V to consume + std::vector spvMembers; + int memberDelta = 0; // how much the member's index changes from glslang to SPIR-V, normally 0, + // except sometimes for blocks + std::vector > deferredForwardPointers; + std::vector memberDebugInfo; + for (int i = 0; i < (int)glslangMembers->size(); i++) { + auto& glslangMember = (*glslangMembers)[i]; + if (glslangMember.type->hiddenMember()) { + ++memberDelta; + if (type.getBasicType() == glslang::EbtBlock) + memberRemapper[glslangTypeToIdMap[glslangMembers]][i] = -1; + } else { + if (type.getBasicType() == glslang::EbtBlock) { + if (filterMember(*glslangMember.type)) { + memberDelta++; + memberRemapper[glslangTypeToIdMap[glslangMembers]][i] = -1; + continue; + } + memberRemapper[glslangTypeToIdMap[glslangMembers]][i] = i - memberDelta; + } + // modify just this child's view of the qualifier + glslang::TQualifier memberQualifier = glslangMember.type->getQualifier(); + InheritQualifiers(memberQualifier, qualifier); + + // manually inherit location + if (! memberQualifier.hasLocation() && qualifier.hasLocation()) + memberQualifier.layoutLocation = qualifier.layoutLocation; + + // recurse + bool lastBufferBlockMember = qualifier.storage == glslang::EvqBuffer && + i == (int)glslangMembers->size() - 1; + + // Make forward pointers for any pointer members. + if (glslangMember.type->isReference() && + forwardPointers.find(glslangMember.type->getReferentType()) == forwardPointers.end()) { + deferredForwardPointers.push_back(std::make_pair(glslangMember.type, memberQualifier)); + } + + // Create the member type. + auto const spvMember = convertGlslangToSpvType(*glslangMember.type, explicitLayout, memberQualifier, lastBufferBlockMember, + glslangMember.type->isReference()); + spvMembers.push_back(spvMember); + + // Update the builder with the type's location so that we can create debug types for the structure members. + // There doesn't exist a "clean" entry point for this information to be passed along to the builder so, for now, + // it is stored in the builder and consumed during the construction of composite debug types. + // TODO: This probably warrants further investigation. This approach was decided to be the least ugly of the + // quick and dirty approaches that were tried. + // Advantages of this approach: + // + Relatively clean. No direct calls into debug type system. + // + Handles nested recursive structures. + // Disadvantages of this approach: + // + Not as clean as desired. Traverser queries/sets persistent state. This is fragile. + // + Table lookup during creation of composite debug types. This really shouldn't be necessary. + if(options.emitNonSemanticShaderDebugInfo) { + spv::StructMemberDebugInfo debugInfo{}; + debugInfo.name = glslangMember.type->getFieldName(); + debugInfo.line = glslangMember.loc.line; + debugInfo.column = glslangMember.loc.column; + + // Per the GLSL spec, bool variables inside of a uniform or buffer block are generated as uint. + // But for debug info, we want to represent them as bool because that is the original type in + // the source code. The bool type can be nested within a vector or a multidimensional array, + // so we must construct the chain of types up from the scalar bool. + if (glslangIntermediate->getSource() == glslang::EShSourceGlsl && explicitLayout != glslang::ElpNone && + glslangMember.type->getBasicType() == glslang::EbtBool) { + auto typeId = builder.makeBoolType(); + if (glslangMember.type->isVector()) { + typeId = builder.makeVectorType(typeId, glslangMember.type->getVectorSize()); + } + if (glslangMember.type->isArray()) { + const auto* arraySizes = glslangMember.type->getArraySizes(); + int dims = arraySizes->getNumDims(); + for (int i = dims - 1; i >= 0; --i) { + spv::Id size = builder.makeIntConstant(arraySizes->getDimSize(i)); + typeId = builder.makeArrayType(typeId, size, 0); + } + } + debugInfo.debugTypeOverride = builder.getDebugType(typeId); + } + + memberDebugInfo.push_back(debugInfo); + } + } + } + + // Make the SPIR-V type + spv::Id spvType = builder.makeStructType(spvMembers, memberDebugInfo, type.getTypeName().c_str(), false); + if (! HasNonLayoutQualifiers(type, qualifier)) + structMap[explicitLayout][qualifier.layoutMatrix][glslangMembers] = spvType; + + // Decorate it + decorateStructType(type, glslangMembers, explicitLayout, qualifier, spvType, spvMembers); + + for (int i = 0; i < (int)deferredForwardPointers.size(); ++i) { + auto it = deferredForwardPointers[i]; + convertGlslangToSpvType(*it.first, explicitLayout, it.second, false); + } + + return spvType; +} + +void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type, + const glslang::TTypeList* glslangMembers, + glslang::TLayoutPacking explicitLayout, + const glslang::TQualifier& qualifier, + spv::Id spvType, + const std::vector& spvMembers) +{ + // Name and decorate the non-hidden members + int offset = -1; + bool memberLocationInvalid = type.isArrayOfArrays() || + (type.isArray() && (type.getQualifier().isArrayedIo(glslangIntermediate->getStage()) == false)); + for (int i = 0; i < (int)glslangMembers->size(); i++) { + glslang::TType& glslangMember = *(*glslangMembers)[i].type; + int member = i; + if (type.getBasicType() == glslang::EbtBlock) { + member = memberRemapper[glslangTypeToIdMap[glslangMembers]][i]; + if (filterMember(glslangMember)) + continue; + } + + // modify just this child's view of the qualifier + glslang::TQualifier memberQualifier = glslangMember.getQualifier(); + InheritQualifiers(memberQualifier, qualifier); + + // using -1 above to indicate a hidden member + if (member < 0) + continue; + + builder.addMemberName(spvType, member, glslangMember.getFieldName().c_str()); + builder.addMemberDecoration(spvType, member, + TranslateLayoutDecoration(glslangMember, memberQualifier.layoutMatrix)); + builder.addMemberDecoration(spvType, member, TranslatePrecisionDecoration(glslangMember)); + // Add interpolation and auxiliary storage decorations only to + // top-level members of Input and Output storage classes + if (type.getQualifier().storage == glslang::EvqVaryingIn || + type.getQualifier().storage == glslang::EvqVaryingOut) { + if (type.getBasicType() == glslang::EbtBlock || + glslangIntermediate->getSource() == glslang::EShSourceHlsl) { + builder.addMemberDecoration(spvType, member, TranslateInterpolationDecoration(memberQualifier)); + builder.addMemberDecoration(spvType, member, TranslateAuxiliaryStorageDecoration(memberQualifier)); + addMeshNVDecoration(spvType, member, memberQualifier); + } + } + builder.addMemberDecoration(spvType, member, TranslateInvariantDecoration(memberQualifier)); + + if (type.getBasicType() == glslang::EbtBlock && + qualifier.storage == glslang::EvqBuffer) { + // Add memory decorations only to top-level members of shader storage block + std::vector memory; + TranslateMemoryDecoration(memberQualifier, memory, glslangIntermediate->usingVulkanMemoryModel()); + for (unsigned int i = 0; i < memory.size(); ++i) + builder.addMemberDecoration(spvType, member, memory[i]); + } + + // Location assignment was already completed correctly by the front end, + // just track whether a member needs to be decorated. + // Ignore member locations if the container is an array, as that's + // ill-specified and decisions have been made to not allow this. + if (!memberLocationInvalid && memberQualifier.hasLocation()) + builder.addMemberDecoration(spvType, member, spv::Decoration::Location, memberQualifier.layoutLocation); + + // component, XFB, others + if (glslangMember.getQualifier().hasComponent()) + builder.addMemberDecoration(spvType, member, spv::Decoration::Component, + glslangMember.getQualifier().layoutComponent); + if (glslangMember.getQualifier().hasXfbOffset()) + builder.addMemberDecoration(spvType, member, spv::Decoration::Offset, + glslangMember.getQualifier().layoutXfbOffset); + else if (explicitLayout != glslang::ElpNone) { + // figure out what to do with offset, which is accumulating + int nextOffset; + updateMemberOffset(type, glslangMember, offset, nextOffset, explicitLayout, memberQualifier.layoutMatrix); + if (offset >= 0) + builder.addMemberDecoration(spvType, member, spv::Decoration::Offset, offset); + offset = nextOffset; + } + + if (glslangMember.isMatrix() && explicitLayout != glslang::ElpNone) + builder.addMemberDecoration(spvType, member, spv::Decoration::MatrixStride, + getMatrixStride(glslangMember, explicitLayout, memberQualifier.layoutMatrix)); + + // built-in variable decorations + spv::BuiltIn builtIn = TranslateBuiltInDecoration(glslangMember.getQualifier().builtIn, true); + if (builtIn != spv::BuiltIn::Max) + builder.addMemberDecoration(spvType, member, spv::Decoration::BuiltIn, (int)builtIn); + + // nonuniform + builder.addMemberDecoration(spvType, member, TranslateNonUniformDecoration(glslangMember.getQualifier())); + + if (glslangIntermediate->getHlslFunctionality1() && memberQualifier.semanticName != nullptr) { + builder.addExtension("SPV_GOOGLE_hlsl_functionality1"); + builder.addMemberDecoration(spvType, member, spv::Decoration::HlslSemanticGOOGLE, + memberQualifier.semanticName); + } + + if (builtIn == spv::BuiltIn::Layer) { + // SPV_NV_viewport_array2 extension + if (glslangMember.getQualifier().layoutViewportRelative){ + builder.addMemberDecoration(spvType, member, spv::Decoration::ViewportRelativeNV); + builder.addCapability(spv::Capability::ShaderViewportMaskNV); + builder.addExtension(spv::E_SPV_NV_viewport_array2); + } + if (glslangMember.getQualifier().layoutSecondaryViewportRelativeOffset != -2048){ + builder.addMemberDecoration(spvType, member, + spv::Decoration::SecondaryViewportRelativeNV, + glslangMember.getQualifier().layoutSecondaryViewportRelativeOffset); + builder.addCapability(spv::Capability::ShaderStereoViewNV); + builder.addExtension(spv::E_SPV_NV_stereo_view_rendering); + } + } + if (glslangMember.getQualifier().layoutPassthrough) { + builder.addMemberDecoration(spvType, member, spv::Decoration::PassthroughNV); + builder.addCapability(spv::Capability::GeometryShaderPassthroughNV); + builder.addExtension(spv::E_SPV_NV_geometry_shader_passthrough); + } + + // Add SPIR-V decorations (GL_EXT_spirv_intrinsics) + if (glslangMember.getQualifier().hasSpirvDecorate()) + applySpirvDecorate(glslangMember, spvType, member); + } + + // Decorate the structure + builder.addDecoration(spvType, TranslateLayoutDecoration(type, qualifier.layoutMatrix)); + const auto basicType = type.getBasicType(); + const auto typeStorageQualifier = type.getQualifier().storage; + if (basicType == glslang::EbtBlock) { + builder.addDecoration(spvType, TranslateBlockDecoration(typeStorageQualifier, glslangIntermediate->usingStorageBuffer())); + } else if (basicType == glslang::EbtStruct && glslangIntermediate->getSpv().vulkan > 0) { + const auto hasRuntimeArray = !spvMembers.empty() && builder.getOpCode(spvMembers.back()) == spv::Op::OpTypeRuntimeArray; + if (hasRuntimeArray) { + builder.addDecoration(spvType, TranslateBlockDecoration(typeStorageQualifier, glslangIntermediate->usingStorageBuffer())); + } + } + + if (qualifier.hasHitObjectShaderRecordNV()) + builder.addDecoration(spvType, spv::Decoration::HitObjectShaderRecordBufferNV); + if (qualifier.hasHitObjectShaderRecordEXT()) + builder.addDecoration(spvType, spv::Decoration::HitObjectShaderRecordBufferEXT); +} + +// Turn the expression forming the array size into an id. +// This is not quite trivial, because of specialization constants. +// Sometimes, a raw constant is turned into an Id, and sometimes +// a specialization constant expression is. +spv::Id TGlslangToSpvTraverser::makeArraySizeId(const glslang::TArraySizes& arraySizes, int dim, bool allowZero, bool boolType) +{ + // First, see if this is sized with a node, meaning a specialization constant: + glslang::TIntermTyped* specNode = arraySizes.getDimNode(dim); + if (specNode != nullptr) { + builder.clearAccessChain(); + SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); + spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); + specNode->traverse(this); + return accessChainLoad(specNode->getAsTyped()->getType()); + } + + // Otherwise, need a compile-time (front end) size, get it: + int size = arraySizes.getDimSize(dim); + + if (!allowZero) + assert(size > 0); + + if (boolType) { + return builder.makeBoolConstant(size); + } else { + return builder.makeUintConstant(size); + } +} + +// Wrap the builder's accessChainLoad to: +// - localize handling of RelaxedPrecision +// - use the SPIR-V inferred type instead of another conversion of the glslang type +// (avoids unnecessary work and possible type punning for structures) +// - do conversion of concrete to abstract type +spv::Id TGlslangToSpvTraverser::accessChainLoad(const glslang::TType& type) +{ + spv::Id nominalTypeId = builder.accessChainGetInferredType(); + + spv::Builder::AccessChain::CoherentFlags coherentFlags = builder.getAccessChain().coherentFlags; + coherentFlags |= TranslateCoherent(type); + + spv::MemoryAccessMask accessMask = spv::MemoryAccessMask(TranslateMemoryAccess(coherentFlags) & ~spv::MemoryAccessMask::MakePointerAvailableKHR); + // If the value being loaded is HelperInvocation, SPIR-V 1.6 is being generated (so that + // SPV_EXT_demote_to_helper_invocation is in core) and the memory model is in use, add + // the Volatile MemoryAccess semantic. + if (type.getQualifier().builtIn == glslang::EbvHelperInvocation && + glslangIntermediate->usingVulkanMemoryModel() && + glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6) { + accessMask = spv::MemoryAccessMask(accessMask | spv::MemoryAccessMask::Volatile); + } + + unsigned int alignment = builder.getAccessChain().alignment; + alignment |= type.getBufferReferenceAlignment(); + + spv::Id loadedId = builder.accessChainLoad(TranslatePrecisionDecoration(type), + TranslateNonUniformDecoration(builder.getAccessChain().coherentFlags), + TranslateNonUniformDecoration(type.getQualifier()), + nominalTypeId, + accessMask, + TranslateMemoryScope(coherentFlags), + alignment); + + // Need to convert to abstract types when necessary + if (type.getBasicType() == glslang::EbtBool) { + loadedId = convertLoadedBoolInUniformToUint(type, nominalTypeId, loadedId); + } + + return loadedId; +} + +// Wrap the builder's accessChainStore to: +// - do conversion of concrete to abstract type +// +// Implicitly uses the existing builder.accessChain as the storage target. +void TGlslangToSpvTraverser::accessChainStore(const glslang::TType& type, spv::Id rvalue) +{ + // Need to convert to abstract types when necessary + if (type.getBasicType() == glslang::EbtBool) { + spv::Id nominalTypeId = builder.accessChainGetInferredType(); + + if (builder.isScalarType(nominalTypeId)) { + // Conversion for bool + spv::Id boolType = builder.makeBoolType(); + if (nominalTypeId != boolType) { + // keep these outside arguments, for determinant order-of-evaluation + spv::Id one = builder.makeUintConstant(1); + spv::Id zero = builder.makeUintConstant(0); + rvalue = builder.createTriOp(spv::Op::OpSelect, nominalTypeId, rvalue, one, zero); + } else if (builder.getTypeId(rvalue) != boolType) + rvalue = builder.createBinOp(spv::Op::OpINotEqual, boolType, rvalue, builder.makeUintConstant(0)); + } else if (builder.isVectorType(nominalTypeId)) { + // Conversion for bvec + int vecSize = builder.getNumTypeComponents(nominalTypeId); + spv::Id bvecType = builder.makeVectorType(builder.makeBoolType(), vecSize); + if (nominalTypeId != bvecType) { + // keep these outside arguments, for determinant order-of-evaluation + spv::Id one = makeSmearedConstant(builder.makeUintConstant(1), vecSize); + spv::Id zero = makeSmearedConstant(builder.makeUintConstant(0), vecSize); + rvalue = builder.createTriOp(spv::Op::OpSelect, nominalTypeId, rvalue, one, zero); + } else if (builder.getTypeId(rvalue) != bvecType) + rvalue = builder.createBinOp(spv::Op::OpINotEqual, bvecType, rvalue, + makeSmearedConstant(builder.makeUintConstant(0), vecSize)); + } + } + + spv::Builder::AccessChain::CoherentFlags coherentFlags = builder.getAccessChain().coherentFlags; + coherentFlags |= TranslateCoherent(type); + + unsigned int alignment = builder.getAccessChain().alignment; + alignment |= type.getBufferReferenceAlignment(); + + builder.accessChainStore(rvalue, TranslateNonUniformDecoration(builder.getAccessChain().coherentFlags), + spv::MemoryAccessMask(TranslateMemoryAccess(coherentFlags) & + ~spv::MemoryAccessMask::MakePointerVisibleKHR), + TranslateMemoryScope(coherentFlags), alignment); +} + +// For storing when types match at the glslang level, but not might match at the +// SPIR-V level. +// +// This especially happens when a single glslang type expands to multiple +// SPIR-V types, like a struct that is used in a member-undecorated way as well +// as in a member-decorated way. +// +// NOTE: This function can handle any store request; if it's not special it +// simplifies to a simple OpStore. +// +// Implicitly uses the existing builder.accessChain as the storage target. +void TGlslangToSpvTraverser::multiTypeStore(const glslang::TType& type, spv::Id rValue) +{ + // we only do the complex path here if it's an aggregate + if (! type.isStruct() && ! type.isArray()) { + accessChainStore(type, rValue); + return; + } + + // and, it has to be a case of type aliasing + spv::Id rType = builder.getTypeId(rValue); + spv::Id lValue = builder.accessChainGetLValue(); + spv::Id lType = builder.getContainedTypeId(builder.getTypeId(lValue)); + if (lType == rType) { + accessChainStore(type, rValue); + return; + } + + // Recursively (as needed) copy an aggregate type to a different aggregate type, + // where the two types were the same type in GLSL. This requires member + // by member copy, recursively. + + // SPIR-V 1.4 added an instruction to do help do this. + if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_4) { + // However, bool in uniform space is changed to int, so + // OpCopyLogical does not work for that. + // TODO: It would be more robust to do a full recursive verification of the types satisfying SPIR-V rules. + bool rBool = builder.containsType(builder.getTypeId(rValue), spv::Op::OpTypeBool, 0); + bool lBool = builder.containsType(lType, spv::Op::OpTypeBool, 0); + if (lBool == rBool) { + spv::Id logicalCopy = builder.createUnaryOp(spv::Op::OpCopyLogical, lType, rValue); + accessChainStore(type, logicalCopy); + return; + } + } + + // If an array, copy element by element. + if (type.isArray()) { + glslang::TType glslangElementType(type, 0); + spv::Id elementRType = builder.getContainedTypeId(rType); + for (int index = 0; index < type.getOuterArraySize(); ++index) { + // get the source member + spv::Id elementRValue = builder.createCompositeExtract(rValue, elementRType, index); + + // set up the target storage + builder.clearAccessChain(); + builder.setAccessChainLValue(lValue); + builder.accessChainPush(builder.makeIntConstant(index), TranslateCoherent(type), + type.getBufferReferenceAlignment()); + + // store the member + multiTypeStore(glslangElementType, elementRValue); + } + } else { + assert(type.isStruct()); + + // loop over structure members + const glslang::TTypeList& members = *type.getStruct(); + for (int m = 0; m < (int)members.size(); ++m) { + const glslang::TType& glslangMemberType = *members[m].type; + + // get the source member + spv::Id memberRType = builder.getContainedTypeId(rType, m); + spv::Id memberRValue = builder.createCompositeExtract(rValue, memberRType, m); + + // set up the target storage + builder.clearAccessChain(); + builder.setAccessChainLValue(lValue); + builder.accessChainPush(builder.makeIntConstant(m), TranslateCoherent(type), + type.getBufferReferenceAlignment()); + + // store the member + multiTypeStore(glslangMemberType, memberRValue); + } + } +} + +// Decide whether or not this type should be +// decorated with offsets and strides, and if so +// whether std140 or std430 rules should be applied. +glslang::TLayoutPacking TGlslangToSpvTraverser::getExplicitLayout(const glslang::TType& type) const +{ + // has to be a block + if (type.getBasicType() != glslang::EbtBlock) + return glslang::ElpNone; + + // has to be a uniform or buffer block or task in/out blocks + if (type.getQualifier().storage != glslang::EvqUniform && + type.getQualifier().storage != glslang::EvqBuffer && + type.getQualifier().storage != glslang::EvqShared && + !type.getQualifier().isTaskMemory()) + return glslang::ElpNone; + + // return the layout to use + switch (type.getQualifier().layoutPacking) { + case glslang::ElpStd140: + case glslang::ElpStd430: + case glslang::ElpScalar: + return type.getQualifier().layoutPacking; + default: + return glslang::ElpNone; + } +} + +// Given an array type, returns the integer stride required for that array +int TGlslangToSpvTraverser::getArrayStride(const glslang::TType& arrayType, glslang::TLayoutPacking explicitLayout, + glslang::TLayoutMatrix matrixLayout) +{ + int size; + int stride; + glslangIntermediate->getMemberAlignment(arrayType, size, stride, explicitLayout, + matrixLayout == glslang::ElmRowMajor); + + return stride; +} + +// Given a matrix type, or array (of array) of matrixes type, returns the integer stride required for that matrix +// when used as a member of an interface block +int TGlslangToSpvTraverser::getMatrixStride(const glslang::TType& matrixType, glslang::TLayoutPacking explicitLayout, + glslang::TLayoutMatrix matrixLayout) +{ + glslang::TType elementType; + elementType.shallowCopy(matrixType); + elementType.clearArraySizes(); + + int size; + int stride; + glslangIntermediate->getMemberAlignment(elementType, size, stride, explicitLayout, + matrixLayout == glslang::ElmRowMajor); + + return stride; +} + +// Given a member type of a struct, realign the current offset for it, and compute +// the next (not yet aligned) offset for the next member, which will get aligned +// on the next call. +// 'currentOffset' should be passed in already initialized, ready to modify, and reflecting +// the migration of data from nextOffset -> currentOffset. It should be -1 on the first call. +// -1 means a non-forced member offset (no decoration needed). +void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& structType, const glslang::TType& memberType, + int& currentOffset, int& nextOffset, glslang::TLayoutPacking explicitLayout, glslang::TLayoutMatrix matrixLayout) +{ + // this will get a positive value when deemed necessary + nextOffset = -1; + + // override anything in currentOffset with user-set offset + if (memberType.getQualifier().hasOffset()) + currentOffset = memberType.getQualifier().layoutOffset; + + // It could be that current linker usage in glslang updated all the layoutOffset, + // in which case the following code does not matter. But, that's not quite right + // once cross-compilation unit GLSL validation is done, as the original user + // settings are needed in layoutOffset, and then the following will come into play. + + if (explicitLayout == glslang::ElpNone) { + if (! memberType.getQualifier().hasOffset()) + currentOffset = -1; + + return; + } + + // Getting this far means we need explicit offsets + if (currentOffset < 0) + currentOffset = 0; + + // Now, currentOffset is valid (either 0, or from a previous nextOffset), + // but possibly not yet correctly aligned. + + int memberSize; + int dummyStride; + int memberAlignment = glslangIntermediate->getMemberAlignment(memberType, memberSize, dummyStride, explicitLayout, + matrixLayout == glslang::ElmRowMajor); + + bool isVectorLike = memberType.isVector(); + if (memberType.isMatrix()) { + if (matrixLayout == glslang::ElmRowMajor) + isVectorLike = memberType.getMatrixRows() == 1; + else + isVectorLike = memberType.getMatrixCols() == 1; + } + + // Adjust alignment for HLSL rules + // TODO: make this consistent in early phases of code: + // adjusting this late means inconsistencies with earlier code, which for reflection is an issue + // Until reflection is brought in sync with these adjustments, don't apply to $Global, + // which is the most likely to rely on reflection, and least likely to rely implicit layouts + if (glslangIntermediate->usingHlslOffsets() && + ! memberType.isStruct() && structType.getTypeName().compare("$Global") != 0) { + int componentSize; + int componentAlignment = glslangIntermediate->getBaseAlignmentScalar(memberType, componentSize); + if (! memberType.isArray() && isVectorLike && componentAlignment <= 4) + memberAlignment = componentAlignment; + + // Don't add unnecessary padding after this member + // (undo std140 bumping size to a mutliple of vec4) + if (explicitLayout == glslang::ElpStd140) { + if (memberType.isMatrix()) { + if (matrixLayout == glslang::ElmRowMajor) + memberSize -= componentSize * (4 - memberType.getMatrixCols()); + else + memberSize -= componentSize * (4 - memberType.getMatrixRows()); + } else if (memberType.isArray()) + memberSize -= componentSize * (4 - memberType.getVectorSize()); + } + } + + // Bump up to member alignment + glslang::RoundToPow2(currentOffset, memberAlignment); + + // Bump up to vec4 if there is a bad straddle + if (explicitLayout != glslang::ElpScalar && glslangIntermediate->improperStraddle(memberType, memberSize, + currentOffset, isVectorLike)) + glslang::RoundToPow2(currentOffset, 16); + + nextOffset = currentOffset + memberSize; +} + +void TGlslangToSpvTraverser::declareUseOfStructMember(const glslang::TTypeList& members, int glslangMember) +{ + const glslang::TBuiltInVariable glslangBuiltIn = members[glslangMember].type->getQualifier().builtIn; + switch (glslangBuiltIn) + { + case glslang::EbvPointSize: + case glslang::EbvClipDistance: + case glslang::EbvCullDistance: + case glslang::EbvViewportMaskNV: + case glslang::EbvSecondaryPositionNV: + case glslang::EbvSecondaryViewportMaskNV: + case glslang::EbvPositionPerViewNV: + case glslang::EbvViewportMaskPerViewNV: + case glslang::EbvTaskCountNV: + case glslang::EbvPrimitiveCountNV: + case glslang::EbvPrimitiveIndicesNV: + case glslang::EbvClipDistancePerViewNV: + case glslang::EbvCullDistancePerViewNV: + case glslang::EbvLayerPerViewNV: + case glslang::EbvMeshViewCountNV: + case glslang::EbvMeshViewIndicesNV: + // Generate the associated capability. Delegate to TranslateBuiltInDecoration. + // Alternately, we could just call this for any glslang built-in, since the + // capability already guards against duplicates. + TranslateBuiltInDecoration(glslangBuiltIn, false); + break; + default: + // Capabilities were already generated when the struct was declared. + break; + } +} + +bool TGlslangToSpvTraverser::isShaderEntryPoint(const glslang::TIntermAggregate* node) +{ + return node->getName().compare(glslangIntermediate->getEntryPointMangledName().c_str()) == 0; +} + +// Does parameter need a place to keep writes, separate from the original? +// Assumes called after originalParam(), which filters out block/buffer/opaque-based +// qualifiers such that we should have only in/out/inout/constreadonly here. +bool TGlslangToSpvTraverser::writableParam(glslang::TStorageQualifier qualifier) const +{ + assert(qualifier == glslang::EvqIn || + qualifier == glslang::EvqOut || + qualifier == glslang::EvqInOut || + qualifier == glslang::EvqUniform || + qualifier == glslang::EvqConstReadOnly); + return qualifier != glslang::EvqConstReadOnly && + qualifier != glslang::EvqUniform; +} + +// Is parameter pass-by-original? +bool TGlslangToSpvTraverser::originalParam(glslang::TStorageQualifier qualifier, const glslang::TType& paramType, + bool implicitThisParam) +{ + if (implicitThisParam) // implicit this + return true; + if (glslangIntermediate->getSource() == glslang::EShSourceHlsl) + return paramType.getBasicType() == glslang::EbtBlock; + return (paramType.containsOpaque() && !glslangIntermediate->getBindlessMode()) || // sampler, etc. + paramType.getQualifier().isSpirvByReference() || // spirv_by_reference + (paramType.getBasicType() == glslang::EbtBlock && qualifier == glslang::EvqBuffer); // SSBO +} + +// Make all the functions, skeletally, without actually visiting their bodies. +void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslFunctions) +{ + const auto getParamDecorations = [&](std::vector& decorations, const glslang::TType& type, + bool useVulkanMemoryModel) { + spv::Decoration paramPrecision = TranslatePrecisionDecoration(type); + if (paramPrecision != spv::NoPrecision) + decorations.push_back(paramPrecision); + TranslateMemoryDecoration(type.getQualifier(), decorations, useVulkanMemoryModel); + if (type.isReference()) { + // Original and non-writable params pass the pointer directly and + // use restrict/aliased, others are stored to a pointer in Function + // memory and use RestrictPointer/AliasedPointer. + if (originalParam(type.getQualifier().storage, type, false) || + !writableParam(type.getQualifier().storage)) { + // TranslateMemoryDecoration added Restrict decoration already. + if (!type.getQualifier().isRestrict()) { + decorations.push_back(spv::Decoration::Aliased); + } + } else { + decorations.push_back(type.getQualifier().isRestrict() ? spv::Decoration::RestrictPointerEXT : + spv::Decoration::AliasedPointerEXT); + } + } + }; + + for (int f = 0; f < (int)glslFunctions.size(); ++f) { + glslang::TIntermAggregate* glslFunction = glslFunctions[f]->getAsAggregate(); + if (! glslFunction || glslFunction->getOp() != glslang::EOpFunction) + continue; + + builder.setDebugSourceLocation(glslFunction->getLoc().line, glslFunction->getLoc().getFilename()); + + if (isShaderEntryPoint(glslFunction)) { + // For HLSL, the entry function is actually a compiler generated function to resolve the difference of + // entry function signature between HLSL and SPIR-V. So we don't emit debug information for that. + if (glslangIntermediate->getSource() != glslang::EShSourceHlsl) { + builder.setupFunctionDebugInfo(shaderEntry, glslangIntermediate->getEntryPointMangledName().c_str(), + std::vector(), // main function has no param + std::vector()); + } + continue; + } + // We're on a user function. Set up the basic interface for the function now, + // so that it's available to call. Translating the body will happen later. + // + // Typically (except for a "const in" parameter), an address will be passed to the + // function. What it is an address of varies: + // + // - "in" parameters not marked as "const" can be written to without modifying the calling + // argument so that write needs to be to a copy, hence the address of a copy works. + // + // - "const in" parameters can just be the r-value, as no writes need occur. + // + // - "out" and "inout" arguments can't be done as pointers to the calling argument, because + // GLSL has copy-in/copy-out semantics. They can be handled though with a pointer to a copy. + + std::vector paramTypes; + std::vector paramNames; + std::vector> paramDecorations; // list of decorations per parameter + glslang::TIntermSequence& parameters = glslFunction->getSequence()[0]->getAsAggregate()->getSequence(); + +#ifdef ENABLE_HLSL + bool implicitThis = (int)parameters.size() > 0 && parameters[0]->getAsSymbolNode()->getName() == + glslangIntermediate->implicitThisName; +#else + bool implicitThis = false; +#endif + + paramDecorations.resize(parameters.size()); + for (int p = 0; p < (int)parameters.size(); ++p) { + const glslang::TType& paramType = parameters[p]->getAsTyped()->getType(); + spv::Id typeId = convertGlslangToSpvType(paramType); + if (originalParam(paramType.getQualifier().storage, paramType, implicitThis && p == 0)) + typeId = builder.makePointer(TranslateStorageClass(paramType), typeId); + else if (writableParam(paramType.getQualifier().storage)) + typeId = builder.makePointer(spv::StorageClass::Function, typeId); + else + rValueParameters.insert(parameters[p]->getAsSymbolNode()->getId()); + getParamDecorations(paramDecorations[p], paramType, glslangIntermediate->usingVulkanMemoryModel()); + paramTypes.push_back(typeId); + } + + for (auto const parameter:parameters) { + paramNames.push_back(parameter->getAsSymbolNode()->getName().c_str()); + } + + spv::Block* functionBlock; + spv::Function* function = builder.makeFunctionEntry( + TranslatePrecisionDecoration(glslFunction->getType()), convertGlslangToSpvType(glslFunction->getType()), + glslFunction->getName().c_str(), convertGlslangLinkageToSpv(glslFunction->getLinkType()), paramTypes, + paramDecorations, &functionBlock); + builder.setupFunctionDebugInfo(function, glslFunction->getName().c_str(), paramTypes, paramNames); + if (implicitThis) + function->setImplicitThis(); + + // Track function to emit/call later + functionMap[glslFunction->getName().c_str()] = function; + + // Set the parameter id's + for (int p = 0; p < (int)parameters.size(); ++p) { + symbolValues[parameters[p]->getAsSymbolNode()->getId()] = function->getParamId(p); + // give a name too + builder.addName(function->getParamId(p), parameters[p]->getAsSymbolNode()->getName().c_str()); + + const glslang::TType& paramType = parameters[p]->getAsTyped()->getType(); + if (paramType.contains8BitInt()) + builder.addCapability(spv::Capability::Int8); + if (paramType.contains16BitInt()) + builder.addCapability(spv::Capability::Int16); + if (paramType.contains16BitFloat()) + builder.addCapability(spv::Capability::Float16); + } + } +} + +// Process all the initializers, while skipping the functions and link objects +void TGlslangToSpvTraverser::makeGlobalInitializers(const glslang::TIntermSequence& initializers) +{ + builder.setBuildPoint(shaderEntry->getLastBlock()); + for (int i = 0; i < (int)initializers.size(); ++i) { + glslang::TIntermAggregate* initializer = initializers[i]->getAsAggregate(); + if (initializer && initializer->getOp() != glslang::EOpFunction && initializer->getOp() != + glslang::EOpLinkerObjects) { + + // We're on a top-level node that's not a function. Treat as an initializer, whose + // code goes into the beginning of the entry point. + initializer->traverse(this); + } + } +} +// Walk over all linker objects to create a map for payload and callable data linker objects +// and their location to be used during codegen for OpTraceKHR and OpExecuteCallableKHR +// This is done here since it is possible that these linker objects are not be referenced in the AST +void TGlslangToSpvTraverser::collectRayTracingLinkerObjects() +{ + glslang::TIntermAggregate* linkerObjects = glslangIntermediate->findLinkerObjects(); + for (auto& objSeq : linkerObjects->getSequence()) { + auto objNode = objSeq->getAsSymbolNode(); + if (objNode != nullptr) { + if (objNode->getQualifier().hasLocation()) { + unsigned int location = objNode->getQualifier().layoutLocation; + auto st = objNode->getQualifier().storage; + int set; + switch (st) + { + case glslang::EvqPayload: + case glslang::EvqPayloadIn: + set = 0; + break; + case glslang::EvqCallableData: + case glslang::EvqCallableDataIn: + set = 1; + break; + + case glslang::EvqHitObjectAttrNV: + case glslang::EvqHitObjectAttrEXT: + set = 2; + break; + + default: + set = -1; + } + if (set != -1) + locationToSymbol[set].insert(std::make_pair(location, objNode)); + } + } + } +} +// Process all the functions, while skipping initializers. +void TGlslangToSpvTraverser::visitFunctions(const glslang::TIntermSequence& glslFunctions) +{ + for (int f = 0; f < (int)glslFunctions.size(); ++f) { + glslang::TIntermAggregate* node = glslFunctions[f]->getAsAggregate(); + if (node && (node->getOp() == glslang::EOpFunction || node->getOp() == glslang::EOpLinkerObjects)) + node->traverse(this); + } +} + +void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& node, std::vector& arguments, + spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags) +{ + const glslang::TIntermSequence& glslangArguments = node.getSequence(); + + glslang::TSampler sampler = {}; + bool cubeCompare = false; + bool f16ShadowCompare = false; + if (node.isTexture() || node.isImage()) { + sampler = glslangArguments[0]->getAsTyped()->getType().getSampler(); + cubeCompare = sampler.dim == glslang::EsdCube && sampler.arrayed && sampler.shadow; + f16ShadowCompare = sampler.shadow && + glslangArguments[1]->getAsTyped()->getType().getBasicType() == glslang::EbtFloat16; + } + + for (int i = 0; i < (int)glslangArguments.size(); ++i) { + builder.clearAccessChain(); + glslangArguments[i]->traverse(this); + + // Special case l-value operands + bool lvalue = false; + switch (node.getOp()) { + case glslang::EOpImageAtomicAdd: + case glslang::EOpImageAtomicMin: + case glslang::EOpImageAtomicMax: + case glslang::EOpImageAtomicAnd: + case glslang::EOpImageAtomicOr: + case glslang::EOpImageAtomicXor: + case glslang::EOpImageAtomicExchange: + case glslang::EOpImageAtomicCompSwap: + case glslang::EOpImageAtomicLoad: + case glslang::EOpImageAtomicStore: + if (i == 0) + lvalue = true; + break; + case glslang::EOpSparseImageLoad: + if ((sampler.ms && i == 3) || (! sampler.ms && i == 2)) + lvalue = true; + break; + case glslang::EOpSparseTexture: + if (((cubeCompare || f16ShadowCompare) && i == 3) || (! (cubeCompare || f16ShadowCompare) && i == 2)) + lvalue = true; + break; + case glslang::EOpSparseTextureClamp: + if (((cubeCompare || f16ShadowCompare) && i == 4) || (! (cubeCompare || f16ShadowCompare) && i == 3)) + lvalue = true; + break; + case glslang::EOpSparseTextureLod: + case glslang::EOpSparseTextureOffset: + if ((f16ShadowCompare && i == 4) || (! f16ShadowCompare && i == 3)) + lvalue = true; + break; + case glslang::EOpSparseTextureFetch: + if ((sampler.dim != glslang::EsdRect && i == 3) || (sampler.dim == glslang::EsdRect && i == 2)) + lvalue = true; + break; + case glslang::EOpSparseTextureFetchOffset: + if ((sampler.dim != glslang::EsdRect && i == 4) || (sampler.dim == glslang::EsdRect && i == 3)) + lvalue = true; + break; + case glslang::EOpSparseTextureLodOffset: + case glslang::EOpSparseTextureGrad: + case glslang::EOpSparseTextureOffsetClamp: + if ((f16ShadowCompare && i == 5) || (! f16ShadowCompare && i == 4)) + lvalue = true; + break; + case glslang::EOpSparseTextureGradOffset: + case glslang::EOpSparseTextureGradClamp: + if ((f16ShadowCompare && i == 6) || (! f16ShadowCompare && i == 5)) + lvalue = true; + break; + case glslang::EOpSparseTextureGradOffsetClamp: + if ((f16ShadowCompare && i == 7) || (! f16ShadowCompare && i == 6)) + lvalue = true; + break; + case glslang::EOpSparseTextureGather: + if ((sampler.shadow && i == 3) || (! sampler.shadow && i == 2)) + lvalue = true; + break; + case glslang::EOpSparseTextureGatherOffset: + case glslang::EOpSparseTextureGatherOffsets: + if ((sampler.shadow && i == 4) || (! sampler.shadow && i == 3)) + lvalue = true; + break; + case glslang::EOpSparseTextureGatherLod: + if (i == 3) + lvalue = true; + break; + case glslang::EOpSparseTextureGatherLodOffset: + case glslang::EOpSparseTextureGatherLodOffsets: + if (i == 4) + lvalue = true; + break; + case glslang::EOpSparseImageLoadLod: + if (i == 3) + lvalue = true; + break; + case glslang::EOpImageSampleFootprintNV: + if (i == 4) + lvalue = true; + break; + case glslang::EOpImageSampleFootprintClampNV: + case glslang::EOpImageSampleFootprintLodNV: + if (i == 5) + lvalue = true; + break; + case glslang::EOpImageSampleFootprintGradNV: + if (i == 6) + lvalue = true; + break; + case glslang::EOpImageSampleFootprintGradClampNV: + if (i == 7) + lvalue = true; + break; + case glslang::EOpRayQueryGetIntersectionTriangleVertexPositionsEXT: + case glslang::EOpRayQueryGetIntersectionLSSPositionsNV: + case glslang::EOpRayQueryGetIntersectionLSSRadiiNV: + if (i == 2) + lvalue = true; + break; + case glslang::EOpConstructSaturated: + if (i == 0) + lvalue = true; + break; + default: + break; + } + + if (lvalue) { + spv::Id lvalue_id = builder.accessChainGetLValue(); + arguments.push_back(lvalue_id); + lvalueCoherentFlags = builder.getAccessChain().coherentFlags; + builder.addDecoration(lvalue_id, TranslateNonUniformDecoration(lvalueCoherentFlags)); + lvalueCoherentFlags |= TranslateCoherent(glslangArguments[i]->getAsTyped()->getType()); + } else { + if (i > 0 && + glslangArguments[i]->getAsSymbolNode() && glslangArguments[i-1]->getAsSymbolNode() && + glslangArguments[i]->getAsSymbolNode()->getId() == glslangArguments[i-1]->getAsSymbolNode()->getId()) { + // Reuse the id if possible + arguments.push_back(arguments[i-1]); + } else { + arguments.push_back(accessChainLoad(glslangArguments[i]->getAsTyped()->getType())); + } + } + } +} + +void TGlslangToSpvTraverser::translateArguments(glslang::TIntermUnary& node, std::vector& arguments) +{ + builder.clearAccessChain(); + node.getOperand()->traverse(this); + arguments.push_back(accessChainLoad(node.getOperand()->getType())); +} + +spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermOperator* node) +{ + if (! node->isImage() && ! node->isTexture()) + return spv::NoResult; + + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + + // Process a GLSL texturing op (will be SPV image) + + const glslang::TType &imageType = node->getAsAggregate() + ? node->getAsAggregate()->getSequence()[0]->getAsTyped()->getType() + : node->getAsUnaryNode()->getOperand()->getAsTyped()->getType(); + const glslang::TSampler sampler = imageType.getSampler(); + bool f16ShadowCompare = (sampler.shadow && node->getAsAggregate()) + ? node->getAsAggregate()->getSequence()[1]->getAsTyped()->getType().getBasicType() == glslang::EbtFloat16 + : false; + + const auto signExtensionMask = [&]() { + if (builder.getSpvVersion() >= spv::Spv_1_4) { + if (sampler.type == glslang::EbtUint) + return spv::ImageOperandsMask::ZeroExtend; + else if (sampler.type == glslang::EbtInt) + return spv::ImageOperandsMask::SignExtend; + } + return spv::ImageOperandsMask::MaskNone; + }; + + spv::Builder::AccessChain::CoherentFlags lvalueCoherentFlags; + + std::vector arguments; + if (node->getAsAggregate()) + translateArguments(*node->getAsAggregate(), arguments, lvalueCoherentFlags); + else + translateArguments(*node->getAsUnaryNode(), arguments); + spv::Decoration precision = TranslatePrecisionDecoration(node->getType()); + + spv::Builder::TextureParameters params = { }; + params.sampler = arguments[0]; + + glslang::TCrackedTextureOp cracked; + node->crackTexture(sampler, cracked); + + const bool isUnsignedResult = node->getType().getBasicType() == glslang::EbtUint; + + if (builder.isSampledImage(params.sampler) && + ((cracked.query && node->getOp() != glslang::EOpTextureQueryLod) || cracked.fragMask || cracked.fetch)) { + params.sampler = builder.createUnaryOp(spv::Op::OpImage, builder.getImageType(params.sampler), params.sampler); + if (imageType.getQualifier().isNonUniform()) { + builder.addDecoration(params.sampler, spv::Decoration::NonUniformEXT); + } + } + // Check for queries + if (cracked.query) { + switch (node->getOp()) { + case glslang::EOpImageQuerySize: + case glslang::EOpTextureQuerySize: + if (arguments.size() > 1) { + params.lod = arguments[1]; + return builder.createTextureQueryCall(spv::Op::OpImageQuerySizeLod, params, isUnsignedResult); + } else + return builder.createTextureQueryCall(spv::Op::OpImageQuerySize, params, isUnsignedResult); + case glslang::EOpImageQuerySamples: + case glslang::EOpTextureQuerySamples: + return builder.createTextureQueryCall(spv::Op::OpImageQuerySamples, params, isUnsignedResult); + case glslang::EOpTextureQueryLod: + params.coords = arguments[1]; + return builder.createTextureQueryCall(spv::Op::OpImageQueryLod, params, isUnsignedResult); + case glslang::EOpTextureQueryLevels: + return builder.createTextureQueryCall(spv::Op::OpImageQueryLevels, params, isUnsignedResult); + case glslang::EOpSparseTexelsResident: + return builder.createUnaryOp(spv::Op::OpImageSparseTexelsResident, builder.makeBoolType(), arguments[0]); + default: + assert(0); + break; + } + } + + int components = node->getType().getVectorSize(); + + if (node->getOp() == glslang::EOpImageLoad || + node->getOp() == glslang::EOpImageLoadLod || + node->getOp() == glslang::EOpTextureFetch || + node->getOp() == glslang::EOpTextureFetchOffset) { + // These must produce 4 components, per SPIR-V spec. We'll add a conversion constructor if needed. + // This will only happen through the HLSL path for operator[], so we do not have to handle e.g. + // the EOpTexture/Proj/Lod/etc family. It would be harmless to do so, but would need more logic + // here around e.g. which ones return scalars or other types. + components = 4; + } + + glslang::TType returnType(node->getType().getBasicType(), glslang::EvqTemporary, components); + + auto resultType = [&returnType,this]{ return convertGlslangToSpvType(returnType); }; + + // Check for image functions other than queries + if (node->isImage()) { + std::vector operands; + auto opIt = arguments.begin(); + spv::IdImmediate image = { true, *(opIt++) }; + operands.push_back(image); + + // Handle subpass operations + // TODO: GLSL should change to have the "MS" only on the type rather than the + // built-in function. + if (cracked.subpass) { + // add on the (0,0) coordinate + spv::Id zero = builder.makeIntConstant(0); + std::vector comps; + comps.push_back(zero); + comps.push_back(zero); + spv::IdImmediate coord = { true, + builder.makeCompositeConstant(builder.makeVectorType(builder.makeIntType(32), 2), comps) }; + operands.push_back(coord); + spv::IdImmediate imageOperands = { false, spv::ImageOperandsMask::MaskNone }; + imageOperands.word = imageOperands.word | (unsigned)signExtensionMask(); + if (sampler.isMultiSample()) { + imageOperands.word = imageOperands.word | (unsigned)spv::ImageOperandsMask::Sample; + } + if (imageOperands.word != (unsigned)spv::ImageOperandsMask::MaskNone) { + operands.push_back(imageOperands); + if (sampler.isMultiSample()) { + spv::IdImmediate imageOperand = { true, *(opIt++) }; + operands.push_back(imageOperand); + } + } + spv::Id result = builder.createOp(spv::Op::OpImageRead, resultType(), operands); + builder.setPrecision(result, precision); + return result; + } + + if (cracked.attachmentEXT) { + if (opIt != arguments.end()) { + spv::IdImmediate sample = { true, *opIt }; + operands.push_back(sample); + } + spv::Id result = builder.createOp(spv::Op::OpColorAttachmentReadEXT, resultType(), operands); + builder.addExtension(spv::E_SPV_EXT_shader_tile_image); + builder.setPrecision(result, precision); + return result; + } + + spv::IdImmediate coord = { true, *(opIt++) }; + operands.push_back(coord); + if (node->getOp() == glslang::EOpImageLoad || node->getOp() == glslang::EOpImageLoadLod) { + spv::ImageOperandsMask mask = spv::ImageOperandsMask::MaskNone; + if (sampler.isMultiSample()) { + mask = mask | spv::ImageOperandsMask::Sample; + } + if (cracked.lod) { + builder.addExtension(spv::E_SPV_AMD_shader_image_load_store_lod); + builder.addCapability(spv::Capability::ImageReadWriteLodAMD); + mask = mask | spv::ImageOperandsMask::Lod; + } + mask = mask | TranslateImageOperands(TranslateCoherent(imageType)); + mask = (spv::ImageOperandsMask)(mask & ~spv::ImageOperandsMask::MakeTexelAvailableKHR); + mask = mask | signExtensionMask(); + if (mask != spv::ImageOperandsMask::MaskNone) { + spv::IdImmediate imageOperands = { false, (unsigned int)mask }; + operands.push_back(imageOperands); + } + if (anySet(mask, spv::ImageOperandsMask::Sample)) { + spv::IdImmediate imageOperand = { true, *opIt++ }; + operands.push_back(imageOperand); + } + if (anySet(mask, spv::ImageOperandsMask::Lod)) { + spv::IdImmediate imageOperand = { true, *opIt++ }; + operands.push_back(imageOperand); + } + if (anySet(mask, spv::ImageOperandsMask::MakeTexelVisibleKHR)) { + spv::IdImmediate imageOperand = { true, + builder.makeUintConstant(TranslateMemoryScope(TranslateCoherent(imageType))) }; + operands.push_back(imageOperand); + } + + if (builder.getImageTypeFormat(builder.getImageType(operands.front().word)) == spv::ImageFormat::Unknown) + builder.addCapability(spv::Capability::StorageImageReadWithoutFormat); + + std::vector result(1, builder.createOp(spv::Op::OpImageRead, resultType(), operands)); + builder.setPrecision(result[0], precision); + + // If needed, add a conversion constructor to the proper size. + if (components != node->getType().getVectorSize()) + result[0] = builder.createConstructor(precision, result, convertGlslangToSpvType(node->getType())); + + return result[0]; + } else if (node->getOp() == glslang::EOpImageStore || node->getOp() == glslang::EOpImageStoreLod) { + + // Push the texel value before the operands + if (sampler.isMultiSample() || cracked.lod) { + spv::IdImmediate texel = { true, *(opIt + 1) }; + operands.push_back(texel); + } else { + spv::IdImmediate texel = { true, *opIt }; + operands.push_back(texel); + } + + spv::ImageOperandsMask mask = spv::ImageOperandsMask::MaskNone; + if (sampler.isMultiSample()) { + mask = mask | spv::ImageOperandsMask::Sample; + } + if (cracked.lod) { + builder.addExtension(spv::E_SPV_AMD_shader_image_load_store_lod); + builder.addCapability(spv::Capability::ImageReadWriteLodAMD); + mask = mask | spv::ImageOperandsMask::Lod; + } + mask = mask | TranslateImageOperands(TranslateCoherent(imageType)); + mask = (spv::ImageOperandsMask)(mask & ~spv::ImageOperandsMask::MakeTexelVisibleKHR); + mask = mask | signExtensionMask(); + if (mask != spv::ImageOperandsMask::MaskNone) { + spv::IdImmediate imageOperands = { false, (unsigned int)mask }; + operands.push_back(imageOperands); + } + if (anySet(mask, spv::ImageOperandsMask::Sample)) { + spv::IdImmediate imageOperand = { true, *opIt++ }; + operands.push_back(imageOperand); + } + if (anySet(mask, spv::ImageOperandsMask::Lod)) { + spv::IdImmediate imageOperand = { true, *opIt++ }; + operands.push_back(imageOperand); + } + if (anySet(mask, spv::ImageOperandsMask::MakeTexelAvailableKHR)) { + spv::IdImmediate imageOperand = { true, + builder.makeUintConstant(TranslateMemoryScope(TranslateCoherent(imageType))) }; + operands.push_back(imageOperand); + } + + builder.createNoResultOp(spv::Op::OpImageWrite, operands); + if (builder.getImageTypeFormat(builder.getImageType(operands.front().word)) == spv::ImageFormat::Unknown) + builder.addCapability(spv::Capability::StorageImageWriteWithoutFormat); + return spv::NoResult; + } else if (node->getOp() == glslang::EOpSparseImageLoad || + node->getOp() == glslang::EOpSparseImageLoadLod) { + builder.addCapability(spv::Capability::SparseResidency); + if (builder.getImageTypeFormat(builder.getImageType(operands.front().word)) == spv::ImageFormat::Unknown) + builder.addCapability(spv::Capability::StorageImageReadWithoutFormat); + + spv::ImageOperandsMask mask = spv::ImageOperandsMask::MaskNone; + if (sampler.isMultiSample()) { + mask = mask | spv::ImageOperandsMask::Sample; + } + if (cracked.lod) { + builder.addExtension(spv::E_SPV_AMD_shader_image_load_store_lod); + builder.addCapability(spv::Capability::ImageReadWriteLodAMD); + + mask = mask | spv::ImageOperandsMask::Lod; + } + mask = mask | TranslateImageOperands(TranslateCoherent(imageType)); + mask = (spv::ImageOperandsMask)(mask & ~spv::ImageOperandsMask::MakeTexelAvailableKHR); + mask = mask | signExtensionMask(); + if (mask != spv::ImageOperandsMask::MaskNone) { + spv::IdImmediate imageOperands = { false, (unsigned int)mask }; + operands.push_back(imageOperands); + } + if (anySet(mask, spv::ImageOperandsMask::Sample)) { + spv::IdImmediate imageOperand = { true, *opIt++ }; + operands.push_back(imageOperand); + } + if (anySet(mask, spv::ImageOperandsMask::Lod)) { + spv::IdImmediate imageOperand = { true, *opIt++ }; + operands.push_back(imageOperand); + } + if (anySet(mask, spv::ImageOperandsMask::MakeTexelVisibleKHR)) { + spv::IdImmediate imageOperand = { true, builder.makeUintConstant(TranslateMemoryScope( + TranslateCoherent(imageType))) }; + operands.push_back(imageOperand); + } + + // Create the return type that was a special structure + spv::Id texelOut = *opIt; + spv::Id typeId0 = resultType(); + spv::Id typeId1 = builder.getDerefTypeId(texelOut); + spv::Id resultTypeId = builder.makeStructResultType(typeId0, typeId1); + + spv::Id resultId = builder.createOp(spv::Op::OpImageSparseRead, resultTypeId, operands); + + // Decode the return type + builder.createStore(builder.createCompositeExtract(resultId, typeId1, 1), texelOut); + return builder.createCompositeExtract(resultId, typeId0, 0); + } else { + // Process image atomic operations + + // GLSL "IMAGE_PARAMS" will involve in constructing an image texel pointer and this pointer, + // as the first source operand, is required by SPIR-V atomic operations. + // For non-MS, the sample value should be 0 + spv::IdImmediate sample = { true, sampler.isMultiSample() ? *(opIt++) : builder.makeUintConstant(0) }; + operands.push_back(sample); + + spv::Id resultTypeId; + glslang::TBasicType typeProxy = node->getBasicType(); + // imageAtomicStore has a void return type so base the pointer type on + // the type of the value operand. + if (node->getOp() == glslang::EOpImageAtomicStore) { + resultTypeId = builder.makePointer(spv::StorageClass::Image, builder.getTypeId(*opIt)); + typeProxy = node->getAsAggregate()->getSequence()[0]->getAsTyped()->getType().getSampler().type; + } else { + resultTypeId = builder.makePointer(spv::StorageClass::Image, resultType()); + } + spv::Id pointer = builder.createOp(spv::Op::OpImageTexelPointer, resultTypeId, operands); + if (imageType.getQualifier().nonUniform) { + builder.addDecoration(pointer, spv::Decoration::NonUniformEXT); + } + + std::vector operands; + operands.push_back(pointer); + for (; opIt != arguments.end(); ++opIt) + operands.push_back(*opIt); + + return createAtomicOperation(node->getOp(), precision, resultType(), operands, typeProxy, + lvalueCoherentFlags, node->getType()); + } + } + + // Check for fragment mask functions other than queries + if (cracked.fragMask) { + assert(sampler.ms); + + auto opIt = arguments.begin(); + std::vector operands; + + operands.push_back(params.sampler); + ++opIt; + + if (sampler.isSubpass()) { + // add on the (0,0) coordinate + spv::Id zero = builder.makeIntConstant(0); + std::vector comps; + comps.push_back(zero); + comps.push_back(zero); + operands.push_back(builder.makeCompositeConstant( + builder.makeVectorType(builder.makeIntType(32), 2), comps)); + } + + for (; opIt != arguments.end(); ++opIt) + operands.push_back(*opIt); + + spv::Op fragMaskOp = spv::Op::OpNop; + if (node->getOp() == glslang::EOpFragmentMaskFetch) + fragMaskOp = spv::Op::OpFragmentMaskFetchAMD; + else if (node->getOp() == glslang::EOpFragmentFetch) + fragMaskOp = spv::Op::OpFragmentFetchAMD; + + builder.addExtension(spv::E_SPV_AMD_shader_fragment_mask); + builder.addCapability(spv::Capability::FragmentMaskAMD); + return builder.createOp(fragMaskOp, resultType(), operands); + } + + // Check for texture functions other than queries + bool sparse = node->isSparseTexture(); + bool imageFootprint = node->isImageFootprint(); + bool cubeCompare = sampler.dim == glslang::EsdCube && sampler.isArrayed() && sampler.isShadow(); + + // check for bias argument + bool bias = false; + if (! cracked.lod && ! cracked.grad && ! cracked.fetch && ! cubeCompare) { + int nonBiasArgCount = 2; + if (cracked.gather) + ++nonBiasArgCount; // comp argument should be present when bias argument is present + + if (f16ShadowCompare) + ++nonBiasArgCount; + if (cracked.offset) + ++nonBiasArgCount; + else if (cracked.offsets) + ++nonBiasArgCount; + if (cracked.grad) + nonBiasArgCount += 2; + if (cracked.lodClamp) + ++nonBiasArgCount; + if (sparse) + ++nonBiasArgCount; + if (imageFootprint) + //Following three extra arguments + // int granularity, bool coarse, out gl_TextureFootprint2DNV footprint + nonBiasArgCount += 3; + if ((int)arguments.size() > nonBiasArgCount) + bias = true; + } + + if (cracked.gather) { + const auto& sourceExtensions = glslangIntermediate->getRequestedExtensions(); + if (bias || cracked.lod || + sourceExtensions.find(glslang::E_GL_AMD_texture_gather_bias_lod) != sourceExtensions.end()) { + builder.addExtension(spv::E_SPV_AMD_texture_gather_bias_lod); + builder.addCapability(spv::Capability::ImageGatherBiasLodAMD); + } + } + + // set the rest of the arguments + + params.coords = arguments[1]; + int extraArgs = 0; + bool noImplicitLod = false; + + // sort out where Dref is coming from + if (cubeCompare || f16ShadowCompare) { + params.Dref = arguments[2]; + ++extraArgs; + } else if (sampler.shadow && cracked.gather) { + params.Dref = arguments[2]; + ++extraArgs; + } else if (sampler.shadow) { + std::vector indexes; + int dRefComp; + if (cracked.proj) + dRefComp = 2; // "The resulting 3rd component of P in the shadow forms is used as Dref" + else + dRefComp = builder.getNumComponents(params.coords) - 1; + indexes.push_back(dRefComp); + params.Dref = builder.createCompositeExtract(params.coords, + builder.getScalarTypeId(builder.getTypeId(params.coords)), indexes); + } + + // lod + if (cracked.lod) { + params.lod = arguments[2 + extraArgs]; + ++extraArgs; + } else if (glslangIntermediate->getStage() != EShLangFragment && + !(glslangIntermediate->getStage() == EShLangCompute && + glslangIntermediate->hasLayoutDerivativeModeNone())) { + // we need to invent the default lod for an explicit lod instruction for a non-fragment stage + noImplicitLod = true; + } + + // multisample + if (sampler.isMultiSample()) { + params.sample = arguments[2 + extraArgs]; // For MS, "sample" should be specified + ++extraArgs; + } + + // gradient + if (cracked.grad) { + params.gradX = arguments[2 + extraArgs]; + params.gradY = arguments[3 + extraArgs]; + extraArgs += 2; + } + + // offset and offsets + if (cracked.offset) { + params.offset = arguments[2 + extraArgs]; + ++extraArgs; + } else if (cracked.offsets) { + params.offsets = arguments[2 + extraArgs]; + ++extraArgs; + } + + // lod clamp + if (cracked.lodClamp) { + params.lodClamp = arguments[2 + extraArgs]; + ++extraArgs; + } + // sparse + if (sparse) { + params.texelOut = arguments[2 + extraArgs]; + ++extraArgs; + } + // gather component + if (cracked.gather && ! sampler.shadow) { + // default component is 0, if missing, otherwise an argument + if (2 + extraArgs < (int)arguments.size()) { + params.component = arguments[2 + extraArgs]; + ++extraArgs; + } else + params.component = builder.makeIntConstant(0); + } + spv::Id resultStruct = spv::NoResult; + if (imageFootprint) { + //Following three extra arguments + // int granularity, bool coarse, out gl_TextureFootprint2DNV footprint + params.granularity = arguments[2 + extraArgs]; + params.coarse = arguments[3 + extraArgs]; + resultStruct = arguments[4 + extraArgs]; + extraArgs += 3; + } + + // bias + if (bias) { + params.bias = arguments[2 + extraArgs]; + ++extraArgs; + } + + if (imageFootprint) { + builder.addExtension(spv::E_SPV_NV_shader_image_footprint); + builder.addCapability(spv::Capability::ImageFootprintNV); + + + //resultStructType(OpenGL type) contains 5 elements: + //struct gl_TextureFootprint2DNV { + // uvec2 anchor; + // uvec2 offset; + // uvec2 mask; + // uint lod; + // uint granularity; + //}; + //or + //struct gl_TextureFootprint3DNV { + // uvec3 anchor; + // uvec3 offset; + // uvec2 mask; + // uint lod; + // uint granularity; + //}; + spv::Id resultStructType = builder.getContainedTypeId(builder.getTypeId(resultStruct)); + assert(builder.isStructType(resultStructType)); + + //resType (SPIR-V type) contains 6 elements: + //Member 0 must be a Boolean type scalar(LOD), + //Member 1 must be a vector of integer type, whose Signedness operand is 0(anchor), + //Member 2 must be a vector of integer type, whose Signedness operand is 0(offset), + //Member 3 must be a vector of integer type, whose Signedness operand is 0(mask), + //Member 4 must be a scalar of integer type, whose Signedness operand is 0(lod), + //Member 5 must be a scalar of integer type, whose Signedness operand is 0(granularity). + std::vector members; + members.push_back(resultType()); + for (int i = 0; i < 5; i++) { + members.push_back(builder.getContainedTypeId(resultStructType, i)); + } + spv::Id resType = builder.makeStructType(members, {}, "ResType"); + + //call ImageFootprintNV + spv::Id res = builder.createTextureCall(precision, resType, sparse, cracked.fetch, cracked.proj, + cracked.gather, noImplicitLod, params, signExtensionMask()); + + //copy resType (SPIR-V type) to resultStructType(OpenGL type) + for (int i = 0; i < 5; i++) { + builder.clearAccessChain(); + builder.setAccessChainLValue(resultStruct); + + //Accessing to a struct we created, no coherent flag is set + spv::Builder::AccessChain::CoherentFlags flags; + flags.clear(); + + builder.accessChainPush(builder.makeIntConstant(i), flags, 0); + builder.accessChainStore(builder.createCompositeExtract(res, builder.getContainedTypeId(resType, i+1), + i+1), TranslateNonUniformDecoration(imageType.getQualifier())); + } + return builder.createCompositeExtract(res, resultType(), 0); + } + + // projective component (might not to move) + // GLSL: "The texture coordinates consumed from P, not including the last component of P, + // are divided by the last component of P." + // SPIR-V: "... (u [, v] [, w], q)... It may be a vector larger than needed, but all + // unused components will appear after all used components." + if (cracked.proj) { + int projSourceComp = builder.getNumComponents(params.coords) - 1; + int projTargetComp; + switch (sampler.dim) { + case glslang::Esd1D: projTargetComp = 1; break; + case glslang::Esd2D: projTargetComp = 2; break; + case glslang::EsdRect: projTargetComp = 2; break; + default: projTargetComp = projSourceComp; break; + } + // copy the projective coordinate if we have to + if (projTargetComp != projSourceComp) { + spv::Id projComp = builder.createCompositeExtract(params.coords, + builder.getScalarTypeId(builder.getTypeId(params.coords)), projSourceComp); + params.coords = builder.createCompositeInsert(projComp, params.coords, + builder.getTypeId(params.coords), projTargetComp); + } + } + + // nonprivate + if (imageType.getQualifier().nonprivate) { + params.nonprivate = true; + } + + // volatile + if (imageType.getQualifier().volatil) { + params.volatil = true; + } + + if (imageType.getQualifier().nontemporal) { + params.nontemporal = true; + } + + std::vector result( 1, + builder.createTextureCall(precision, resultType(), sparse, cracked.fetch, cracked.proj, cracked.gather, + noImplicitLod, params, signExtensionMask()) + ); + + if (components != node->getType().getVectorSize()) + result[0] = builder.createConstructor(precision, result, convertGlslangToSpvType(node->getType())); + + return result[0]; +} + +spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAggregate* node) +{ + // Grab the function's pointer from the previously created function + spv::Function* function = functionMap[node->getName().c_str()]; + if (! function) + return 0; + + const glslang::TIntermSequence& glslangArgs = node->getSequence(); + const glslang::TQualifierList& qualifiers = node->getQualifierList(); + + // See comments in makeFunctions() for details about the semantics for parameter passing. + // + // These imply we need a four step process: + // 1. Evaluate the arguments + // 2. Allocate and make copies of in, out, and inout arguments + // 3. Make the call + // 4. Copy back the results + + // 1. Evaluate the arguments and their types + std::vector lValues; + std::vector rValues; + std::vector argTypes; + for (int a = 0; a < (int)glslangArgs.size(); ++a) { + argTypes.push_back(&glslangArgs[a]->getAsTyped()->getType()); + // build l-value + builder.clearAccessChain(); + glslangArgs[a]->traverse(this); + // keep outputs and pass-by-originals as l-values, evaluate others as r-values + if (originalParam(qualifiers[a], *argTypes[a], function->hasImplicitThis() && a == 0) || + writableParam(qualifiers[a])) { + // save l-value + lValues.push_back(builder.getAccessChain()); + } else { + // process r-value + rValues.push_back(accessChainLoad(*argTypes.back())); + } + } + + // Reset source location to the function call location after argument evaluation + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + + // 2. Allocate space for anything needing a copy, and if it's "in" or "inout" + // copy the original into that space. + // + // Also, build up the list of actual arguments to pass in for the call + int lValueCount = 0; + int rValueCount = 0; + std::vector spvArgs; + for (int a = 0; a < (int)glslangArgs.size(); ++a) { + spv::Id arg; + if (originalParam(qualifiers[a], *argTypes[a], function->hasImplicitThis() && a == 0)) { + builder.setAccessChain(lValues[lValueCount]); + arg = builder.accessChainGetLValue(); + ++lValueCount; + } else if (writableParam(qualifiers[a])) { + // need space to hold the copy + arg = builder.createVariable(function->getParamPrecision(a), spv::StorageClass::Function, + builder.getContainedTypeId(function->getParamType(a)), "param"); + if (qualifiers[a] == glslang::EvqIn || qualifiers[a] == glslang::EvqInOut) { + // need to copy the input into output space + builder.setAccessChain(lValues[lValueCount]); + spv::Id copy = accessChainLoad(*argTypes[a]); + builder.clearAccessChain(); + builder.setAccessChainLValue(arg); + multiTypeStore(*argTypes[a], copy); + } + ++lValueCount; + } else { + // process r-value, which involves a copy for a type mismatch + if (function->getParamType(a) != builder.getTypeId(rValues[rValueCount]) || + TranslatePrecisionDecoration(*argTypes[a]) != function->getParamPrecision(a)) + { + spv::Id argCopy = builder.createVariable(function->getParamPrecision(a), spv::StorageClass::Function, function->getParamType(a), "arg"); + builder.clearAccessChain(); + builder.setAccessChainLValue(argCopy); + multiTypeStore(*argTypes[a], rValues[rValueCount]); + arg = builder.createLoad(argCopy, function->getParamPrecision(a)); + } else + arg = rValues[rValueCount]; + ++rValueCount; + } + spvArgs.push_back(arg); + } + + // 3. Make the call. + spv::Id result = builder.createFunctionCall(function, spvArgs); + builder.setPrecision(result, TranslatePrecisionDecoration(node->getType())); + builder.addDecoration(result, TranslateNonUniformDecoration(node->getType().getQualifier())); + + // 4. Copy back out an "out" arguments. + lValueCount = 0; + for (int a = 0; a < (int)glslangArgs.size(); ++a) { + if (originalParam(qualifiers[a], *argTypes[a], function->hasImplicitThis() && a == 0)) + ++lValueCount; + else if (writableParam(qualifiers[a])) { + if (qualifiers[a] == glslang::EvqOut || qualifiers[a] == glslang::EvqInOut) { + spv::Id copy = builder.createLoad(spvArgs[a], spv::NoPrecision); + builder.addDecoration(copy, TranslateNonUniformDecoration(argTypes[a]->getQualifier())); + builder.setAccessChain(lValues[lValueCount]); + multiTypeStore(*argTypes[a], copy); + } + ++lValueCount; + } + } + + return result; +} + +// Translate AST operation to SPV operation, already having SPV-based operands/types. +spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, OpDecorations& decorations, + spv::Id typeId, spv::Id left, spv::Id right, + glslang::TBasicType typeProxy, bool reduceComparison) +{ + bool isUnsigned = isTypeUnsignedInt(typeProxy); + bool isFloat = isTypeFloat(typeProxy); + bool isBool = typeProxy == glslang::EbtBool; + + spv::Op binOp = spv::Op::OpNop; + bool needMatchingVectors = true; // for non-matrix ops, would a scalar need to smear to match a vector? + bool comparison = false; + + switch (op) { + case glslang::EOpAdd: + case glslang::EOpAddAssign: + if (isFloat) + binOp = spv::Op::OpFAdd; + else + binOp = spv::Op::OpIAdd; + break; + case glslang::EOpSub: + case glslang::EOpSubAssign: + if (isFloat) + binOp = spv::Op::OpFSub; + else + binOp = spv::Op::OpISub; + break; + case glslang::EOpMul: + case glslang::EOpMulAssign: + if (isFloat) + binOp = spv::Op::OpFMul; + else + binOp = spv::Op::OpIMul; + break; + case glslang::EOpVectorTimesScalar: + case glslang::EOpVectorTimesScalarAssign: + if (isFloat && (builder.isVector(left) || builder.isVector(right) || builder.isCooperativeVector(left) || builder.isCooperativeVector(right))) { + if (builder.isVector(right) || builder.isCooperativeVector(right)) + std::swap(left, right); + assert(builder.isScalar(right)); + needMatchingVectors = false; + binOp = spv::Op::OpVectorTimesScalar; + } else if (isFloat) { + binOp = spv::Op::OpFMul; + } else if (builder.isCooperativeVector(left) || builder.isCooperativeVector(right)) { + if (builder.isCooperativeVector(right)) + std::swap(left, right); + assert(builder.isScalar(right)); + // Construct a cooperative vector from the scalar + right = builder.createCompositeConstruct(builder.getTypeId(left), { right }); + binOp = spv::Op::OpIMul; + } else { + binOp = spv::Op::OpIMul; + } + break; + case glslang::EOpVectorTimesMatrix: + case glslang::EOpVectorTimesMatrixAssign: + binOp = spv::Op::OpVectorTimesMatrix; + break; + case glslang::EOpMatrixTimesVector: + binOp = spv::Op::OpMatrixTimesVector; + break; + case glslang::EOpMatrixTimesScalar: + case glslang::EOpMatrixTimesScalarAssign: + binOp = spv::Op::OpMatrixTimesScalar; + break; + case glslang::EOpMatrixTimesMatrix: + case glslang::EOpMatrixTimesMatrixAssign: + binOp = spv::Op::OpMatrixTimesMatrix; + break; + case glslang::EOpOuterProduct: + binOp = spv::Op::OpOuterProduct; + needMatchingVectors = false; + break; + + case glslang::EOpDiv: + case glslang::EOpDivAssign: + if (isFloat) + binOp = spv::Op::OpFDiv; + else if (isUnsigned) + binOp = spv::Op::OpUDiv; + else + binOp = spv::Op::OpSDiv; + break; + case glslang::EOpMod: + case glslang::EOpModAssign: + if (isFloat) + binOp = spv::Op::OpFMod; + else if (isUnsigned) + binOp = spv::Op::OpUMod; + else + binOp = spv::Op::OpSMod; + break; + case glslang::EOpRightShift: + case glslang::EOpRightShiftAssign: + if (isUnsigned) + binOp = spv::Op::OpShiftRightLogical; + else + binOp = spv::Op::OpShiftRightArithmetic; + break; + case glslang::EOpLeftShift: + case glslang::EOpLeftShiftAssign: + binOp = spv::Op::OpShiftLeftLogical; + break; + case glslang::EOpAnd: + case glslang::EOpAndAssign: + binOp = spv::Op::OpBitwiseAnd; + break; + case glslang::EOpLogicalAnd: + needMatchingVectors = false; + binOp = spv::Op::OpLogicalAnd; + break; + case glslang::EOpInclusiveOr: + case glslang::EOpInclusiveOrAssign: + binOp = spv::Op::OpBitwiseOr; + break; + case glslang::EOpLogicalOr: + needMatchingVectors = false; + binOp = spv::Op::OpLogicalOr; + break; + case glslang::EOpExclusiveOr: + case glslang::EOpExclusiveOrAssign: + binOp = spv::Op::OpBitwiseXor; + break; + case glslang::EOpLogicalXor: + needMatchingVectors = false; + binOp = spv::Op::OpLogicalNotEqual; + break; + + case glslang::EOpAbsDifference: + binOp = isUnsigned ? spv::Op::OpAbsUSubINTEL : spv::Op::OpAbsISubINTEL; + break; + + case glslang::EOpAddSaturate: + binOp = isUnsigned ? spv::Op::OpUAddSatINTEL : spv::Op::OpIAddSatINTEL; + break; + + case glslang::EOpSubSaturate: + binOp = isUnsigned ? spv::Op::OpUSubSatINTEL : spv::Op::OpISubSatINTEL; + break; + + case glslang::EOpAverage: + binOp = isUnsigned ? spv::Op::OpUAverageINTEL : spv::Op::OpIAverageINTEL; + break; + + case glslang::EOpAverageRounded: + binOp = isUnsigned ? spv::Op::OpUAverageRoundedINTEL : spv::Op::OpIAverageRoundedINTEL; + break; + + case glslang::EOpMul32x16: + binOp = isUnsigned ? spv::Op::OpUMul32x16INTEL : spv::Op::OpIMul32x16INTEL; + break; + + case glslang::EOpExpectEXT: + binOp = spv::Op::OpExpectKHR; + break; + + case glslang::EOpLessThan: + case glslang::EOpGreaterThan: + case glslang::EOpLessThanEqual: + case glslang::EOpGreaterThanEqual: + case glslang::EOpEqual: + case glslang::EOpNotEqual: + case glslang::EOpVectorEqual: + case glslang::EOpVectorNotEqual: + comparison = true; + break; + default: + break; + } + + // handle mapped binary operations (should be non-comparison) + if (binOp != spv::Op::OpNop) { + assert(comparison == false); + if (builder.isMatrix(left) || builder.isMatrix(right) || + builder.isCooperativeMatrix(left) || builder.isCooperativeMatrix(right)) + return createBinaryMatrixOperation(binOp, decorations, typeId, left, right); + + // No matrix involved; make both operands be the same number of components, if needed + if (needMatchingVectors) + builder.promoteScalar(decorations.precision, left, right); + + spv::Id result = builder.createBinOp(binOp, typeId, left, right); + decorations.addNoContraction(builder, result); + decorations.addNonUniform(builder, result); + return builder.setPrecision(result, decorations.precision); + } + + if (! comparison) + return 0; + + // Handle comparison instructions + + if (reduceComparison && (op == glslang::EOpEqual || op == glslang::EOpNotEqual) + && (builder.isVector(left) || builder.isMatrix(left) || builder.isAggregate(left))) { + spv::Id result = builder.createCompositeCompare(decorations.precision, left, right, op == glslang::EOpEqual); + decorations.addNonUniform(builder, result); + return result; + } + + switch (op) { + case glslang::EOpLessThan: + if (isFloat) + binOp = spv::Op::OpFOrdLessThan; + else if (isUnsigned) + binOp = spv::Op::OpULessThan; + else + binOp = spv::Op::OpSLessThan; + break; + case glslang::EOpGreaterThan: + if (isFloat) + binOp = spv::Op::OpFOrdGreaterThan; + else if (isUnsigned) + binOp = spv::Op::OpUGreaterThan; + else + binOp = spv::Op::OpSGreaterThan; + break; + case glslang::EOpLessThanEqual: + if (isFloat) + binOp = spv::Op::OpFOrdLessThanEqual; + else if (isUnsigned) + binOp = spv::Op::OpULessThanEqual; + else + binOp = spv::Op::OpSLessThanEqual; + break; + case glslang::EOpGreaterThanEqual: + if (isFloat) + binOp = spv::Op::OpFOrdGreaterThanEqual; + else if (isUnsigned) + binOp = spv::Op::OpUGreaterThanEqual; + else + binOp = spv::Op::OpSGreaterThanEqual; + break; + case glslang::EOpEqual: + case glslang::EOpVectorEqual: + if (isFloat) + binOp = spv::Op::OpFOrdEqual; + else if (isBool) + binOp = spv::Op::OpLogicalEqual; + else + binOp = spv::Op::OpIEqual; + break; + case glslang::EOpNotEqual: + case glslang::EOpVectorNotEqual: + if (isFloat) + binOp = spv::Op::OpFUnordNotEqual; + else if (isBool) + binOp = spv::Op::OpLogicalNotEqual; + else + binOp = spv::Op::OpINotEqual; + break; + default: + break; + } + + if (binOp != spv::Op::OpNop) { + spv::Id result = builder.createBinOp(binOp, typeId, left, right); + decorations.addNoContraction(builder, result); + decorations.addNonUniform(builder, result); + return builder.setPrecision(result, decorations.precision); + } + + return 0; +} + +// +// Translate AST matrix operation to SPV operation, already having SPV-based operands/types. +// These can be any of: +// +// matrix * scalar +// scalar * matrix +// matrix * matrix linear algebraic +// matrix * vector +// vector * matrix +// matrix * matrix componentwise +// matrix op matrix op in {+, -, /} +// matrix op scalar op in {+, -, /} +// scalar op matrix op in {+, -, /} +// +spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, OpDecorations& decorations, spv::Id typeId, + spv::Id left, spv::Id right) +{ + bool firstClass = true; + + // First, handle first-class matrix operations (* and matrix/scalar) + switch (op) { + case spv::Op::OpFDiv: + if (builder.isMatrix(left) && builder.isScalar(right)) { + // turn matrix / scalar into a multiply... + spv::Id resultType = builder.getTypeId(right); + right = builder.createBinOp(spv::Op::OpFDiv, resultType, builder.makeFpConstant(resultType, 1.0), right); + op = spv::Op::OpMatrixTimesScalar; + } else + firstClass = false; + break; + case spv::Op::OpMatrixTimesScalar: + if (builder.isMatrix(right) || builder.isCooperativeMatrix(right)) + std::swap(left, right); + assert(builder.isScalar(right)); + break; + case spv::Op::OpVectorTimesMatrix: + assert(builder.isVector(left)); + assert(builder.isMatrix(right)); + break; + case spv::Op::OpMatrixTimesVector: + assert(builder.isMatrix(left)); + assert(builder.isVector(right)); + break; + case spv::Op::OpMatrixTimesMatrix: + assert(builder.isMatrix(left)); + assert(builder.isMatrix(right)); + break; + default: + firstClass = false; + break; + } + + if (builder.isCooperativeMatrix(left) || builder.isCooperativeMatrix(right)) + firstClass = true; + + if (firstClass) { + spv::Id result = builder.createBinOp(op, typeId, left, right); + decorations.addNoContraction(builder, result); + decorations.addNonUniform(builder, result); + return builder.setPrecision(result, decorations.precision); + } + + // Handle component-wise +, -, *, %, and / for all combinations of type. + // The result type of all of them is the same type as the (a) matrix operand. + // The algorithm is to: + // - break the matrix(es) into vectors + // - smear any scalar to a vector + // - do vector operations + // - make a matrix out the vector results + switch (op) { + case spv::Op::OpFAdd: + case spv::Op::OpFSub: + case spv::Op::OpFDiv: + case spv::Op::OpFMod: + case spv::Op::OpFMul: + { + // one time set up... + bool leftMat = builder.isMatrix(left); + bool rightMat = builder.isMatrix(right); + unsigned int numCols = leftMat ? builder.getNumColumns(left) : builder.getNumColumns(right); + int numRows = leftMat ? builder.getNumRows(left) : builder.getNumRows(right); + spv::Id scalarType = builder.getScalarTypeId(typeId); + spv::Id vecType = builder.makeVectorType(scalarType, numRows); + std::vector results; + spv::Id smearVec = spv::NoResult; + if (builder.isScalar(left)) + smearVec = builder.smearScalar(decorations.precision, left, vecType); + else if (builder.isScalar(right)) + smearVec = builder.smearScalar(decorations.precision, right, vecType); + + // do each vector op + for (unsigned int c = 0; c < numCols; ++c) { + std::vector indexes; + indexes.push_back(c); + spv::Id leftVec = leftMat ? builder.createCompositeExtract( left, vecType, indexes) : smearVec; + spv::Id rightVec = rightMat ? builder.createCompositeExtract(right, vecType, indexes) : smearVec; + spv::Id result = builder.createBinOp(op, vecType, leftVec, rightVec); + decorations.addNoContraction(builder, result); + decorations.addNonUniform(builder, result); + results.push_back(builder.setPrecision(result, decorations.precision)); + } + + // put the pieces together + spv::Id result = builder.setPrecision(builder.createCompositeConstruct(typeId, results), decorations.precision); + decorations.addNonUniform(builder, result); + return result; + } + default: + assert(0); + return spv::NoResult; + } +} + +spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDecorations& decorations, spv::Id typeId, + spv::Id operand, glslang::TBasicType typeProxy, const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags, + const glslang::TType &opType) +{ + spv::Op unaryOp = spv::Op::OpNop; + int extBuiltins = -1; + int libCall = -1; + bool isUnsigned = isTypeUnsignedInt(typeProxy); + bool isFloat = isTypeFloat(typeProxy); + + switch (op) { + case glslang::EOpNegative: + if (isFloat) { + unaryOp = spv::Op::OpFNegate; + if (builder.isMatrixType(typeId)) + return createUnaryMatrixOperation(unaryOp, decorations, typeId, operand, typeProxy); + } else + unaryOp = spv::Op::OpSNegate; + break; + + case glslang::EOpLogicalNot: + case glslang::EOpVectorLogicalNot: + unaryOp = spv::Op::OpLogicalNot; + break; + case glslang::EOpBitwiseNot: + unaryOp = spv::Op::OpNot; + break; + + case glslang::EOpDeterminant: + libCall = spv::GLSLstd450Determinant; + break; + case glslang::EOpMatrixInverse: + libCall = spv::GLSLstd450MatrixInverse; + break; + case glslang::EOpTranspose: + unaryOp = spv::Op::OpTranspose; + break; + + case glslang::EOpRadians: + libCall = spv::GLSLstd450Radians; + break; + case glslang::EOpDegrees: + libCall = spv::GLSLstd450Degrees; + break; + case glslang::EOpSin: + libCall = spv::GLSLstd450Sin; + break; + case glslang::EOpCos: + libCall = spv::GLSLstd450Cos; + break; + case glslang::EOpTan: + libCall = spv::GLSLstd450Tan; + break; + case glslang::EOpAcos: + libCall = spv::GLSLstd450Acos; + break; + case glslang::EOpAsin: + libCall = spv::GLSLstd450Asin; + break; + case glslang::EOpAtan: + libCall = spv::GLSLstd450Atan; + break; + + case glslang::EOpAcosh: + libCall = spv::GLSLstd450Acosh; + break; + case glslang::EOpAsinh: + libCall = spv::GLSLstd450Asinh; + break; + case glslang::EOpAtanh: + libCall = spv::GLSLstd450Atanh; + break; + case glslang::EOpTanh: + libCall = spv::GLSLstd450Tanh; + break; + case glslang::EOpCosh: + libCall = spv::GLSLstd450Cosh; + break; + case glslang::EOpSinh: + libCall = spv::GLSLstd450Sinh; + break; + + case glslang::EOpLength: + libCall = spv::GLSLstd450Length; + break; + case glslang::EOpNormalize: + libCall = spv::GLSLstd450Normalize; + break; + + case glslang::EOpExp: + libCall = spv::GLSLstd450Exp; + break; + case glslang::EOpLog: + libCall = spv::GLSLstd450Log; + break; + case glslang::EOpExp2: + libCall = spv::GLSLstd450Exp2; + break; + case glslang::EOpLog2: + libCall = spv::GLSLstd450Log2; + break; + case glslang::EOpSqrt: + libCall = spv::GLSLstd450Sqrt; + break; + case glslang::EOpInverseSqrt: + libCall = spv::GLSLstd450InverseSqrt; + break; + + case glslang::EOpFloor: + libCall = spv::GLSLstd450Floor; + break; + case glslang::EOpTrunc: + libCall = spv::GLSLstd450Trunc; + break; + case glslang::EOpRound: + libCall = spv::GLSLstd450Round; + break; + case glslang::EOpRoundEven: + libCall = spv::GLSLstd450RoundEven; + break; + case glslang::EOpCeil: + libCall = spv::GLSLstd450Ceil; + break; + case glslang::EOpFract: + libCall = spv::GLSLstd450Fract; + break; + + case glslang::EOpIsNan: + unaryOp = spv::Op::OpIsNan; + break; + case glslang::EOpIsInf: + unaryOp = spv::Op::OpIsInf; + break; + case glslang::EOpIsFinite: + unaryOp = spv::Op::OpIsFinite; + break; + + case glslang::EOpFloatBitsToInt: + case glslang::EOpFloatBitsToUint: + case glslang::EOpIntBitsToFloat: + case glslang::EOpUintBitsToFloat: + case glslang::EOpDoubleBitsToInt64: + case glslang::EOpDoubleBitsToUint64: + case glslang::EOpInt64BitsToDouble: + case glslang::EOpUint64BitsToDouble: + case glslang::EOpFloat16BitsToInt16: + case glslang::EOpFloat16BitsToUint16: + case glslang::EOpInt16BitsToFloat16: + case glslang::EOpUint16BitsToFloat16: + unaryOp = spv::Op::OpBitcast; + break; + + case glslang::EOpPackSnorm2x16: + libCall = spv::GLSLstd450PackSnorm2x16; + break; + case glslang::EOpUnpackSnorm2x16: + libCall = spv::GLSLstd450UnpackSnorm2x16; + break; + case glslang::EOpPackUnorm2x16: + libCall = spv::GLSLstd450PackUnorm2x16; + break; + case glslang::EOpUnpackUnorm2x16: + libCall = spv::GLSLstd450UnpackUnorm2x16; + break; + case glslang::EOpPackHalf2x16: + libCall = spv::GLSLstd450PackHalf2x16; + break; + case glslang::EOpUnpackHalf2x16: + libCall = spv::GLSLstd450UnpackHalf2x16; + break; + case glslang::EOpPackSnorm4x8: + libCall = spv::GLSLstd450PackSnorm4x8; + break; + case glslang::EOpUnpackSnorm4x8: + libCall = spv::GLSLstd450UnpackSnorm4x8; + break; + case glslang::EOpPackUnorm4x8: + libCall = spv::GLSLstd450PackUnorm4x8; + break; + case glslang::EOpUnpackUnorm4x8: + libCall = spv::GLSLstd450UnpackUnorm4x8; + break; + case glslang::EOpPackDouble2x32: + libCall = spv::GLSLstd450PackDouble2x32; + break; + case glslang::EOpUnpackDouble2x32: + libCall = spv::GLSLstd450UnpackDouble2x32; + break; + + case glslang::EOpPackInt2x32: + case glslang::EOpUnpackInt2x32: + case glslang::EOpPackUint2x32: + case glslang::EOpUnpackUint2x32: + case glslang::EOpPack16: + case glslang::EOpPack32: + case glslang::EOpPack64: + case glslang::EOpUnpack32: + case glslang::EOpUnpack16: + case glslang::EOpUnpack8: + case glslang::EOpPackInt2x16: + case glslang::EOpUnpackInt2x16: + case glslang::EOpPackUint2x16: + case glslang::EOpUnpackUint2x16: + case glslang::EOpPackInt4x16: + case glslang::EOpUnpackInt4x16: + case glslang::EOpPackUint4x16: + case glslang::EOpUnpackUint4x16: + case glslang::EOpPackFloat2x16: + case glslang::EOpUnpackFloat2x16: + unaryOp = spv::Op::OpBitcast; + break; + + case glslang::EOpDPdx: + unaryOp = spv::Op::OpDPdx; + break; + case glslang::EOpDPdy: + unaryOp = spv::Op::OpDPdy; + break; + case glslang::EOpFwidth: + unaryOp = spv::Op::OpFwidth; + break; + + case glslang::EOpAny: + unaryOp = spv::Op::OpAny; + break; + case glslang::EOpAll: + unaryOp = spv::Op::OpAll; + break; + + case glslang::EOpAbs: + if (isFloat) + libCall = spv::GLSLstd450FAbs; + else + libCall = spv::GLSLstd450SAbs; + break; + case glslang::EOpSign: + if (isFloat) + libCall = spv::GLSLstd450FSign; + else + libCall = spv::GLSLstd450SSign; + break; + + case glslang::EOpDPdxFine: + unaryOp = spv::Op::OpDPdxFine; + break; + case glslang::EOpDPdyFine: + unaryOp = spv::Op::OpDPdyFine; + break; + case glslang::EOpFwidthFine: + unaryOp = spv::Op::OpFwidthFine; + break; + case glslang::EOpDPdxCoarse: + unaryOp = spv::Op::OpDPdxCoarse; + break; + case glslang::EOpDPdyCoarse: + unaryOp = spv::Op::OpDPdyCoarse; + break; + case glslang::EOpFwidthCoarse: + unaryOp = spv::Op::OpFwidthCoarse; + break; + case glslang::EOpRayQueryProceed: + unaryOp = spv::Op::OpRayQueryProceedKHR; + break; + case glslang::EOpRayQueryGetRayTMin: + unaryOp = spv::Op::OpRayQueryGetRayTMinKHR; + break; + case glslang::EOpRayQueryGetRayFlags: + unaryOp = spv::Op::OpRayQueryGetRayFlagsKHR; + break; + case glslang::EOpRayQueryGetWorldRayOrigin: + unaryOp = spv::Op::OpRayQueryGetWorldRayOriginKHR; + break; + case glslang::EOpRayQueryGetWorldRayDirection: + unaryOp = spv::Op::OpRayQueryGetWorldRayDirectionKHR; + break; + case glslang::EOpRayQueryGetIntersectionCandidateAABBOpaque: + unaryOp = spv::Op::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR; + break; + case glslang::EOpInterpolateAtCentroid: + if (typeProxy == glslang::EbtFloat16) + builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float); + libCall = spv::GLSLstd450InterpolateAtCentroid; + break; + case glslang::EOpAtomicCounterIncrement: + case glslang::EOpAtomicCounterDecrement: + case glslang::EOpAtomicCounter: + { + // Handle all of the atomics in one place, in createAtomicOperation() + std::vector operands; + operands.push_back(operand); + return createAtomicOperation(op, decorations.precision, typeId, operands, typeProxy, lvalueCoherentFlags, opType); + } + + case glslang::EOpBitFieldReverse: + unaryOp = spv::Op::OpBitReverse; + break; + case glslang::EOpBitCount: + unaryOp = spv::Op::OpBitCount; + break; + case glslang::EOpFindLSB: + libCall = spv::GLSLstd450FindILsb; + break; + case glslang::EOpFindMSB: + if (isUnsigned) + libCall = spv::GLSLstd450FindUMsb; + else + libCall = spv::GLSLstd450FindSMsb; + break; + + case glslang::EOpCountLeadingZeros: + builder.addCapability(spv::Capability::IntegerFunctions2INTEL); + builder.addExtension("SPV_INTEL_shader_integer_functions2"); + unaryOp = spv::Op::OpUCountLeadingZerosINTEL; + break; + + case glslang::EOpCountTrailingZeros: + builder.addCapability(spv::Capability::IntegerFunctions2INTEL); + builder.addExtension("SPV_INTEL_shader_integer_functions2"); + unaryOp = spv::Op::OpUCountTrailingZerosINTEL; + break; + + case glslang::EOpBallot: + case glslang::EOpReadFirstInvocation: + case glslang::EOpAnyInvocation: + case glslang::EOpAllInvocations: + case glslang::EOpAllInvocationsEqual: + case glslang::EOpMinInvocations: + case glslang::EOpMaxInvocations: + case glslang::EOpAddInvocations: + case glslang::EOpMinInvocationsNonUniform: + case glslang::EOpMaxInvocationsNonUniform: + case glslang::EOpAddInvocationsNonUniform: + case glslang::EOpMinInvocationsInclusiveScan: + case glslang::EOpMaxInvocationsInclusiveScan: + case glslang::EOpAddInvocationsInclusiveScan: + case glslang::EOpMinInvocationsInclusiveScanNonUniform: + case glslang::EOpMaxInvocationsInclusiveScanNonUniform: + case glslang::EOpAddInvocationsInclusiveScanNonUniform: + case glslang::EOpMinInvocationsExclusiveScan: + case glslang::EOpMaxInvocationsExclusiveScan: + case glslang::EOpAddInvocationsExclusiveScan: + case glslang::EOpMinInvocationsExclusiveScanNonUniform: + case glslang::EOpMaxInvocationsExclusiveScanNonUniform: + case glslang::EOpAddInvocationsExclusiveScanNonUniform: + { + std::vector operands; + operands.push_back(operand); + return createInvocationsOperation(op, typeId, operands, typeProxy); + } + case glslang::EOpSubgroupAll: + case glslang::EOpSubgroupAny: + case glslang::EOpSubgroupAllEqual: + case glslang::EOpSubgroupBroadcastFirst: + case glslang::EOpSubgroupBallot: + case glslang::EOpSubgroupInverseBallot: + case glslang::EOpSubgroupBallotBitCount: + case glslang::EOpSubgroupBallotInclusiveBitCount: + case glslang::EOpSubgroupBallotExclusiveBitCount: + case glslang::EOpSubgroupBallotFindLSB: + case glslang::EOpSubgroupBallotFindMSB: + case glslang::EOpSubgroupAdd: + case glslang::EOpSubgroupMul: + case glslang::EOpSubgroupMin: + case glslang::EOpSubgroupMax: + case glslang::EOpSubgroupAnd: + case glslang::EOpSubgroupOr: + case glslang::EOpSubgroupXor: + case glslang::EOpSubgroupInclusiveAdd: + case glslang::EOpSubgroupInclusiveMul: + case glslang::EOpSubgroupInclusiveMin: + case glslang::EOpSubgroupInclusiveMax: + case glslang::EOpSubgroupInclusiveAnd: + case glslang::EOpSubgroupInclusiveOr: + case glslang::EOpSubgroupInclusiveXor: + case glslang::EOpSubgroupExclusiveAdd: + case glslang::EOpSubgroupExclusiveMul: + case glslang::EOpSubgroupExclusiveMin: + case glslang::EOpSubgroupExclusiveMax: + case glslang::EOpSubgroupExclusiveAnd: + case glslang::EOpSubgroupExclusiveOr: + case glslang::EOpSubgroupExclusiveXor: + case glslang::EOpSubgroupQuadSwapHorizontal: + case glslang::EOpSubgroupQuadSwapVertical: + case glslang::EOpSubgroupQuadSwapDiagonal: + case glslang::EOpSubgroupQuadAll: + case glslang::EOpSubgroupQuadAny: { + std::vector operands; + operands.push_back(operand); + return createSubgroupOperation(op, typeId, operands, typeProxy); + } + case glslang::EOpMbcnt: + extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_ballot); + libCall = spv::MbcntAMD; + break; + + case glslang::EOpCubeFaceIndex: + extBuiltins = getExtBuiltins(spv::E_SPV_AMD_gcn_shader); + libCall = spv::CubeFaceIndexAMD; + break; + + case glslang::EOpCubeFaceCoord: + extBuiltins = getExtBuiltins(spv::E_SPV_AMD_gcn_shader); + libCall = spv::CubeFaceCoordAMD; + break; + case glslang::EOpSubgroupPartition: + unaryOp = spv::Op::OpGroupNonUniformPartitionNV; + break; + case glslang::EOpConstructReference: + unaryOp = spv::Op::OpBitcast; + break; + + case glslang::EOpConvUint64ToAccStruct: + case glslang::EOpConvUvec2ToAccStruct: + unaryOp = spv::Op::OpConvertUToAccelerationStructureKHR; + break; + + case glslang::EOpHitObjectIsEmptyNV: + unaryOp = spv::Op::OpHitObjectIsEmptyNV; + break; + + case glslang::EOpHitObjectIsEmptyEXT: + unaryOp = spv::Op::OpHitObjectIsEmptyEXT; + break; + + case glslang::EOpHitObjectIsMissNV: + unaryOp = spv::Op::OpHitObjectIsMissNV; + break; + + case glslang::EOpHitObjectIsMissEXT: + unaryOp = spv::Op::OpHitObjectIsMissEXT; + break; + + case glslang::EOpHitObjectIsHitNV: + unaryOp = spv::Op::OpHitObjectIsHitNV; + break; + + case glslang::EOpHitObjectIsHitEXT: + unaryOp = spv::Op::OpHitObjectIsHitEXT; + break; + + case glslang::EOpHitObjectGetObjectRayOriginNV: + unaryOp = spv::Op::OpHitObjectGetObjectRayOriginNV; + break; + + case glslang::EOpHitObjectGetObjectRayOriginEXT: + unaryOp = spv::Op::OpHitObjectGetObjectRayOriginEXT; + break; + + case glslang::EOpHitObjectGetObjectRayDirectionNV: + unaryOp = spv::Op::OpHitObjectGetObjectRayDirectionNV; + break; + + case glslang::EOpHitObjectGetObjectRayDirectionEXT: + unaryOp = spv::Op::OpHitObjectGetObjectRayDirectionEXT; + break; + + case glslang::EOpHitObjectGetWorldRayOriginNV: + unaryOp = spv::Op::OpHitObjectGetWorldRayOriginNV; + break; + + case glslang::EOpHitObjectGetWorldRayOriginEXT: + unaryOp = spv::Op::OpHitObjectGetWorldRayOriginEXT; + break; + + case glslang::EOpHitObjectGetWorldRayDirectionNV: + unaryOp = spv::Op::OpHitObjectGetWorldRayDirectionNV; + break; + + case glslang::EOpHitObjectGetWorldRayDirectionEXT: + unaryOp = spv::Op::OpHitObjectGetWorldRayDirectionEXT; + break; + + case glslang::EOpHitObjectGetObjectToWorldNV: + unaryOp = spv::Op::OpHitObjectGetObjectToWorldNV; + break; + + case glslang::EOpHitObjectGetObjectToWorldEXT: + unaryOp = spv::Op::OpHitObjectGetObjectToWorldEXT; + break; + + case glslang::EOpHitObjectGetWorldToObjectNV: + unaryOp = spv::Op::OpHitObjectGetWorldToObjectNV; + break; + + case glslang::EOpHitObjectGetWorldToObjectEXT: + unaryOp = spv::Op::OpHitObjectGetWorldToObjectEXT; + break; + + case glslang::EOpHitObjectGetRayTMinNV: + unaryOp = spv::Op::OpHitObjectGetRayTMinNV; + break; + + case glslang::EOpHitObjectGetRayTMinEXT: + unaryOp = spv::Op::OpHitObjectGetRayTMinEXT; + break; + + case glslang::EOpHitObjectGetRayTMaxNV: + unaryOp = spv::Op::OpHitObjectGetRayTMaxNV; + break; + + case glslang::EOpHitObjectGetRayTMaxEXT: + unaryOp = spv::Op::OpHitObjectGetRayTMaxEXT; + break; + + case glslang::EOpHitObjectGetRayFlagsEXT: + unaryOp = spv::Op::OpHitObjectGetRayFlagsEXT; + break; + + case glslang::EOpHitObjectGetPrimitiveIndexNV: + unaryOp = spv::Op::OpHitObjectGetPrimitiveIndexNV; + break; + + case glslang::EOpHitObjectGetPrimitiveIndexEXT: + unaryOp = spv::Op::OpHitObjectGetPrimitiveIndexEXT; + break; + + case glslang::EOpHitObjectGetInstanceIdNV: + unaryOp = spv::Op::OpHitObjectGetInstanceIdNV; + break; + + case glslang::EOpHitObjectGetInstanceIdEXT: + unaryOp = spv::Op::OpHitObjectGetInstanceIdEXT; + break; + + case glslang::EOpHitObjectGetInstanceCustomIndexNV: + unaryOp = spv::Op::OpHitObjectGetInstanceCustomIndexNV; + break; + + case glslang::EOpHitObjectGetInstanceCustomIndexEXT: + unaryOp = spv::Op::OpHitObjectGetInstanceCustomIndexEXT; + break; + + case glslang::EOpHitObjectGetGeometryIndexNV: + unaryOp = spv::Op::OpHitObjectGetGeometryIndexNV; + break; + + case glslang::EOpHitObjectGetGeometryIndexEXT: + unaryOp = spv::Op::OpHitObjectGetGeometryIndexEXT; + break; + + case glslang::EOpHitObjectGetHitKindNV: + unaryOp = spv::Op::OpHitObjectGetHitKindNV; + break; + + case glslang::EOpHitObjectGetHitKindEXT: + unaryOp = spv::Op::OpHitObjectGetHitKindEXT; + break; + + case glslang::EOpHitObjectGetCurrentTimeNV: + unaryOp = spv::Op::OpHitObjectGetCurrentTimeNV; + break; + + case glslang::EOpHitObjectGetCurrentTimeEXT: + unaryOp = spv::Op::OpHitObjectGetCurrentTimeEXT; + break; + + case glslang::EOpHitObjectGetShaderBindingTableRecordIndexNV: + unaryOp = spv::Op::OpHitObjectGetShaderBindingTableRecordIndexNV; + break; + + case glslang::EOpHitObjectGetShaderBindingTableRecordIndexEXT: + unaryOp = spv::Op::OpHitObjectGetShaderBindingTableRecordIndexEXT; + break; + + case glslang::EOpHitObjectGetShaderRecordBufferHandleNV: + unaryOp = spv::Op::OpHitObjectGetShaderRecordBufferHandleNV; + break; + + case glslang::EOpHitObjectGetClusterIdNV: + unaryOp = spv::Op::OpHitObjectGetClusterIdNV; + builder.addExtension(spv::E_SPV_NV_cluster_acceleration_structure); + builder.addCapability(spv::Capability::ShaderInvocationReorderNV); + builder.addCapability(spv::Capability::RayTracingClusterAccelerationStructureNV); + break; + + case glslang::EOpHitObjectGetSpherePositionNV: + unaryOp = spv::Op::OpHitObjectGetSpherePositionNV; + builder.addExtension(spv::E_SPV_NV_linear_swept_spheres); + builder.addCapability(spv::Capability::ShaderInvocationReorderNV); + builder.addCapability(spv::Capability::RayTracingSpheresGeometryNV); + break; + + case glslang::EOpHitObjectGetSphereRadiusNV: + unaryOp = spv::Op::OpHitObjectGetSphereRadiusNV; + builder.addExtension(spv::E_SPV_NV_linear_swept_spheres); + builder.addCapability(spv::Capability::ShaderInvocationReorderNV); + builder.addCapability(spv::Capability::RayTracingSpheresGeometryNV); + break; + + case glslang::EOpHitObjectIsSphereHitNV: + unaryOp = spv::Op::OpHitObjectIsSphereHitNV; + builder.addExtension(spv::E_SPV_NV_linear_swept_spheres); + builder.addCapability(spv::Capability::ShaderInvocationReorderNV); + builder.addCapability(spv::Capability::RayTracingSpheresGeometryNV); + break; + + case glslang::EOpHitObjectIsLSSHitNV: + unaryOp = spv::Op::OpHitObjectIsLSSHitNV; + builder.addExtension(spv::E_SPV_NV_linear_swept_spheres); + builder.addCapability(spv::Capability::ShaderInvocationReorderNV); + builder.addCapability(spv::Capability::RayTracingLinearSweptSpheresGeometryNV); + break; + + case glslang::EOpHitObjectGetShaderRecordBufferHandleEXT: + unaryOp = spv::Op::OpHitObjectGetShaderRecordBufferHandleEXT; + break; + + case glslang::EOpFetchMicroTriangleVertexPositionNV: + unaryOp = spv::Op::OpFetchMicroTriangleVertexPositionNV; + break; + + case glslang::EOpFetchMicroTriangleVertexBarycentricNV: + unaryOp = spv::Op::OpFetchMicroTriangleVertexBarycentricNV; + break; + + case glslang::EOpCopyObject: + unaryOp = spv::Op::OpCopyObject; + break; + + case glslang::EOpDepthAttachmentReadEXT: + builder.addExtension(spv::E_SPV_EXT_shader_tile_image); + builder.addCapability(spv::Capability::TileImageDepthReadAccessEXT); + unaryOp = spv::Op::OpDepthAttachmentReadEXT; + decorations.precision = spv::NoPrecision; + break; + case glslang::EOpStencilAttachmentReadEXT: + builder.addExtension(spv::E_SPV_EXT_shader_tile_image); + builder.addCapability(spv::Capability::TileImageStencilReadAccessEXT); + unaryOp = spv::Op::OpStencilAttachmentReadEXT; + decorations.precision = spv::Decoration::RelaxedPrecision; + break; + + default: + return 0; + } + + spv::Id id; + if (libCall >= 0) { + std::vector args; + args.push_back(operand); + id = builder.createBuiltinCall(typeId, extBuiltins >= 0 ? extBuiltins : stdBuiltins, libCall, args); + } else { + id = builder.createUnaryOp(unaryOp, typeId, operand); + } + + decorations.addNoContraction(builder, id); + decorations.addNonUniform(builder, id); + return builder.setPrecision(id, decorations.precision); +} + +// Create a unary operation on a matrix +spv::Id TGlslangToSpvTraverser::createUnaryMatrixOperation(spv::Op op, OpDecorations& decorations, spv::Id typeId, + spv::Id operand, glslang::TBasicType /* typeProxy */) +{ + // Handle unary operations vector by vector. + // The result type is the same type as the original type. + // The algorithm is to: + // - break the matrix into vectors + // - apply the operation to each vector + // - make a matrix out the vector results + + // get the types sorted out + int numCols = builder.getNumColumns(operand); + int numRows = builder.getNumRows(operand); + spv::Id srcVecType = builder.makeVectorType(builder.getScalarTypeId(builder.getTypeId(operand)), numRows); + spv::Id destVecType = builder.makeVectorType(builder.getScalarTypeId(typeId), numRows); + std::vector results; + + // do each vector op + for (int c = 0; c < numCols; ++c) { + std::vector indexes; + indexes.push_back(c); + spv::Id srcVec = builder.createCompositeExtract(operand, srcVecType, indexes); + spv::Id destVec = builder.createUnaryOp(op, destVecType, srcVec); + decorations.addNoContraction(builder, destVec); + decorations.addNonUniform(builder, destVec); + results.push_back(builder.setPrecision(destVec, decorations.precision)); + } + + // put the pieces together + spv::Id result = builder.setPrecision(builder.createCompositeConstruct(typeId, results), decorations.precision); + decorations.addNonUniform(builder, result); + return result; +} + +// For converting integers where both the bitwidth and the signedness could +// change, but only do the width change here. The caller is still responsible +// for the signedness conversion. +// destType is the final type that will be converted to, but this function +// may only be doing part of that conversion. +spv::Id TGlslangToSpvTraverser::createIntWidthConversion(spv::Id operand, int vectorSize, spv::Id destType, + glslang::TBasicType resultBasicType, glslang::TBasicType operandBasicType) +{ + // Get the result type width, based on the type to convert to. + int width = GetNumBits(resultBasicType); + + // Get the conversion operation and result type, + // based on the target width, but the source type. + spv::Id type = spv::NoType; + spv::Op convOp = spv::Op::OpNop; + if (isTypeSignedInt(operandBasicType)) { + convOp = spv::Op::OpSConvert; + type = builder.makeIntType(width); + } else { + convOp = spv::Op::OpUConvert; + type = builder.makeUintType(width); + } + + if (builder.getOpCode(destType) == spv::Op::OpTypeCooperativeVectorNV) { + type = builder.makeCooperativeVectorTypeNV(type, builder.getCooperativeVectorNumComponents(destType)); + } else if (vectorSize > 0) + type = builder.makeVectorType(type, vectorSize); + else if (builder.getOpCode(destType) == spv::Op::OpTypeCooperativeMatrixKHR || + builder.getOpCode(destType) == spv::Op::OpTypeCooperativeMatrixNV) { + + type = builder.makeCooperativeMatrixTypeWithSameShape(type, destType); + } + + return builder.createUnaryOp(convOp, type, operand); +} + +spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, OpDecorations& decorations, spv::Id destType, + spv::Id operand, glslang::TBasicType resultBasicType, glslang::TBasicType operandBasicType) +{ + spv::Op convOp = spv::Op::OpNop; + spv::Id zero = 0; + spv::Id one = 0; + + int vectorSize = builder.isVectorType(destType) ? builder.getNumTypeComponents(destType) : 0; + + if (IsOpNumericConv(op) || op == glslang::EOpConstructSaturated) { + if (isTypeSignedInt(operandBasicType) && isTypeFloat(resultBasicType)) { + convOp = spv::Op::OpConvertSToF; + } + if (isTypeUnsignedInt(operandBasicType) && isTypeFloat(resultBasicType)) { + convOp = spv::Op::OpConvertUToF; + } + if (isTypeFloat(operandBasicType) && isTypeSignedInt(resultBasicType)) { + convOp = spv::Op::OpConvertFToS; + } + if (isTypeFloat(operandBasicType) && isTypeUnsignedInt(resultBasicType)) { + convOp = spv::Op::OpConvertFToU; + } + if (isTypeSignedInt(operandBasicType) && isTypeSignedInt(resultBasicType)) { + convOp = spv::Op::OpSConvert; + } + if (isTypeUnsignedInt(operandBasicType) && isTypeUnsignedInt(resultBasicType)) { + convOp = spv::Op::OpUConvert; + } + if (isTypeFloat(operandBasicType) && isTypeFloat(resultBasicType)) { + convOp = spv::Op::OpFConvert; + if (builder.isMatrixType(destType)) + return createUnaryMatrixOperation(convOp, decorations, destType, operand, operandBasicType); + } + if (isTypeInt(operandBasicType) && isTypeInt(resultBasicType) && + isTypeUnsignedInt(operandBasicType) != isTypeUnsignedInt(resultBasicType)) { + + if (GetNumBits(operandBasicType) != GetNumBits(resultBasicType)) { + // OpSConvert/OpUConvert + OpBitCast + operand = createIntWidthConversion(operand, vectorSize, destType, resultBasicType, operandBasicType); + } + + if (builder.isInSpecConstCodeGenMode()) { + uint32_t bits = GetNumBits(resultBasicType); + spv::Id zeroType = builder.makeUintType(bits); + if (bits == 64) { + zero = builder.makeInt64Constant(zeroType, 0, false); + } else { + zero = builder.makeIntConstant(zeroType, 0, false); + } + zero = makeSmearedConstant(zero, vectorSize); + // Use OpIAdd, instead of OpBitcast to do the conversion when + // generating for OpSpecConstantOp instruction. + return builder.createBinOp(spv::Op::OpIAdd, destType, operand, zero); + } + // For normal run-time conversion instruction, use OpBitcast. + convOp = spv::Op::OpBitcast; + } + if (resultBasicType == glslang::EbtBool) { + uint32_t bits = GetNumBits(operandBasicType); + if (isTypeInt(operandBasicType)) { + spv::Id zeroType = builder.makeUintType(bits); + if (bits == 64) { + zero = builder.makeInt64Constant(zeroType, 0, false); + } else { + zero = builder.makeIntConstant(zeroType, 0, false); + } + zero = makeSmearedConstant(zero, vectorSize); + return builder.createBinOp(spv::Op::OpINotEqual, destType, operand, zero); + } else { + assert(isTypeFloat(operandBasicType)); + if (bits == 64) { + zero = builder.makeDoubleConstant(0.0); + } else if (bits == 32) { + zero = builder.makeFloatConstant(0.0); + } else { + assert(bits == 16); + zero = builder.makeFloat16Constant(0.0); + } + zero = makeSmearedConstant(zero, vectorSize); + return builder.createBinOp(spv::Op::OpFUnordNotEqual, destType, operand, zero); + } + } + if (operandBasicType == glslang::EbtBool) { + uint32_t bits = GetNumBits(resultBasicType); + convOp = spv::Op::OpSelect; + if (isTypeInt(resultBasicType)) { + spv::Id zeroType = isTypeSignedInt(resultBasicType) ? builder.makeIntType(bits) : builder.makeUintType(bits); + if (bits == 64) { + zero = builder.makeInt64Constant(zeroType, 0, false); + one = builder.makeInt64Constant(zeroType, 1, false); + } else { + zero = builder.makeIntConstant(zeroType, 0, false); + one = builder.makeIntConstant(zeroType, 1, false); + } + } else { + assert(isTypeFloat(resultBasicType)); + if (bits == 64) { + zero = builder.makeDoubleConstant(0.0); + one = builder.makeDoubleConstant(1.0); + } else if (bits == 32) { + zero = builder.makeFloatConstant(0.0); + one = builder.makeFloatConstant(1.0); + } else { + assert(bits == 16); + zero = builder.makeFloat16Constant(0.0); + one = builder.makeFloat16Constant(1.0); + } + } + } + } + + if (convOp == spv::Op::OpNop) { + switch (op) { + case glslang::EOpConvUint64ToPtr: + convOp = spv::Op::OpConvertUToPtr; + break; + case glslang::EOpConvPtrToUint64: + convOp = spv::Op::OpConvertPtrToU; + break; + case glslang::EOpConvPtrToUvec2: + case glslang::EOpConvUvec2ToPtr: + convOp = spv::Op::OpBitcast; + break; + + default: + break; + } + } + + spv::Id result = 0; + if (convOp == spv::Op::OpNop) + return result; + + if (convOp == spv::Op::OpSelect) { + zero = makeSmearedConstant(zero, vectorSize); + one = makeSmearedConstant(one, vectorSize); + result = builder.createTriOp(convOp, destType, operand, one, zero); + } else + result = builder.createUnaryOp(convOp, destType, operand); + + result = builder.setPrecision(result, decorations.precision); + decorations.addNonUniform(builder, result); + return result; +} + +spv::Id TGlslangToSpvTraverser::makeSmearedConstant(spv::Id constant, int vectorSize) +{ + if (vectorSize == 0) + return constant; + + spv::Id vectorTypeId = builder.makeVectorType(builder.getTypeId(constant), vectorSize); + std::vector components; + for (int c = 0; c < vectorSize; ++c) + components.push_back(constant); + return builder.makeCompositeConstant(vectorTypeId, components); +} + +// For glslang ops that map to SPV atomic opCodes +spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv::Decoration /*precision*/, + spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy, + const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags, const glslang::TType &opType) +{ + spv::Op opCode = spv::Op::OpNop; + + switch (op) { + case glslang::EOpAtomicAdd: + case glslang::EOpImageAtomicAdd: + case glslang::EOpAtomicCounterAdd: + opCode = spv::Op::OpAtomicIAdd; + if (typeProxy == glslang::EbtFloat16 || typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble) { + opCode = spv::Op::OpAtomicFAddEXT; + if (typeProxy == glslang::EbtFloat16 && + (opType.getVectorSize() == 2 || opType.getVectorSize() == 4)) { + builder.addExtension(spv::E_SPV_NV_shader_atomic_fp16_vector); + builder.addCapability(spv::Capability::AtomicFloat16VectorNV); + } else { + builder.addExtension(spv::E_SPV_EXT_shader_atomic_float_add); + if (typeProxy == glslang::EbtFloat16) { + builder.addExtension(spv::E_SPV_EXT_shader_atomic_float16_add); + builder.addCapability(spv::Capability::AtomicFloat16AddEXT); + } else if (typeProxy == glslang::EbtFloat) { + builder.addCapability(spv::Capability::AtomicFloat32AddEXT); + } else { + builder.addCapability(spv::Capability::AtomicFloat64AddEXT); + } + } + } + break; + case glslang::EOpAtomicSubtract: + case glslang::EOpAtomicCounterSubtract: + opCode = spv::Op::OpAtomicISub; + break; + case glslang::EOpAtomicMin: + case glslang::EOpImageAtomicMin: + case glslang::EOpAtomicCounterMin: + if (typeProxy == glslang::EbtFloat16 || typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble) { + opCode = spv::Op::OpAtomicFMinEXT; + if (typeProxy == glslang::EbtFloat16 && + (opType.getVectorSize() == 2 || opType.getVectorSize() == 4)) { + builder.addExtension(spv::E_SPV_NV_shader_atomic_fp16_vector); + builder.addCapability(spv::Capability::AtomicFloat16VectorNV); + } else { + builder.addExtension(spv::E_SPV_EXT_shader_atomic_float_min_max); + if (typeProxy == glslang::EbtFloat16) + builder.addCapability(spv::Capability::AtomicFloat16MinMaxEXT); + else if (typeProxy == glslang::EbtFloat) + builder.addCapability(spv::Capability::AtomicFloat32MinMaxEXT); + else + builder.addCapability(spv::Capability::AtomicFloat64MinMaxEXT); + } + } else if (typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64) { + opCode = spv::Op::OpAtomicUMin; + } else { + opCode = spv::Op::OpAtomicSMin; + } + break; + case glslang::EOpAtomicMax: + case glslang::EOpImageAtomicMax: + case glslang::EOpAtomicCounterMax: + if (typeProxy == glslang::EbtFloat16 || typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble) { + opCode = spv::Op::OpAtomicFMaxEXT; + if (typeProxy == glslang::EbtFloat16 && + (opType.getVectorSize() == 2 || opType.getVectorSize() == 4)) { + builder.addExtension(spv::E_SPV_NV_shader_atomic_fp16_vector); + builder.addCapability(spv::Capability::AtomicFloat16VectorNV); + } else { + builder.addExtension(spv::E_SPV_EXT_shader_atomic_float_min_max); + if (typeProxy == glslang::EbtFloat16) + builder.addCapability(spv::Capability::AtomicFloat16MinMaxEXT); + else if (typeProxy == glslang::EbtFloat) + builder.addCapability(spv::Capability::AtomicFloat32MinMaxEXT); + else + builder.addCapability(spv::Capability::AtomicFloat64MinMaxEXT); + } + } else if (typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64) { + opCode = spv::Op::OpAtomicUMax; + } else { + opCode = spv::Op::OpAtomicSMax; + } + break; + case glslang::EOpAtomicAnd: + case glslang::EOpImageAtomicAnd: + case glslang::EOpAtomicCounterAnd: + opCode = spv::Op::OpAtomicAnd; + break; + case glslang::EOpAtomicOr: + case glslang::EOpImageAtomicOr: + case glslang::EOpAtomicCounterOr: + opCode = spv::Op::OpAtomicOr; + break; + case glslang::EOpAtomicXor: + case glslang::EOpImageAtomicXor: + case glslang::EOpAtomicCounterXor: + opCode = spv::Op::OpAtomicXor; + break; + case glslang::EOpAtomicExchange: + case glslang::EOpImageAtomicExchange: + case glslang::EOpAtomicCounterExchange: + if ((typeProxy == glslang::EbtFloat16) && + (opType.getVectorSize() == 2 || opType.getVectorSize() == 4)) { + builder.addExtension(spv::E_SPV_NV_shader_atomic_fp16_vector); + builder.addCapability(spv::Capability::AtomicFloat16VectorNV); + } + + opCode = spv::Op::OpAtomicExchange; + break; + case glslang::EOpAtomicCompSwap: + case glslang::EOpImageAtomicCompSwap: + case glslang::EOpAtomicCounterCompSwap: + opCode = spv::Op::OpAtomicCompareExchange; + break; + case glslang::EOpAtomicCounterIncrement: + opCode = spv::Op::OpAtomicIIncrement; + break; + case glslang::EOpAtomicCounterDecrement: + opCode = spv::Op::OpAtomicIDecrement; + break; + case glslang::EOpAtomicCounter: + case glslang::EOpImageAtomicLoad: + case glslang::EOpAtomicLoad: + opCode = spv::Op::OpAtomicLoad; + break; + case glslang::EOpAtomicStore: + case glslang::EOpImageAtomicStore: + opCode = spv::Op::OpAtomicStore; + break; + default: + assert(0); + break; + } + + if (typeProxy == glslang::EbtInt64 || typeProxy == glslang::EbtUint64) + builder.addCapability(spv::Capability::Int64Atomics); + + // Sort out the operands + // - mapping from glslang -> SPV + // - there are extra SPV operands that are optional in glslang + // - compare-exchange swaps the value and comparator + // - compare-exchange has an extra memory semantics + // - EOpAtomicCounterDecrement needs a post decrement + spv::Id pointerId = 0, compareId = 0, valueId = 0; + // scope defaults to Device in the old model, QueueFamilyKHR in the new model + spv::Id scopeId; + if (glslangIntermediate->usingVulkanMemoryModel()) { + scopeId = builder.makeUintConstant(spv::Scope::QueueFamilyKHR); + } else { + scopeId = builder.makeUintConstant(spv::Scope::Device); + } + // semantics default to relaxed + spv::Id semanticsId = builder.makeUintConstant(lvalueCoherentFlags.isVolatile() && + glslangIntermediate->usingVulkanMemoryModel() ? + spv::MemorySemanticsMask::Volatile : + spv::MemorySemanticsMask::MaskNone); + spv::Id semanticsId2 = semanticsId; + + pointerId = operands[0]; + if (opCode == spv::Op::OpAtomicIIncrement || opCode == spv::Op::OpAtomicIDecrement) { + // no additional operands + } else if (opCode == spv::Op::OpAtomicCompareExchange) { + compareId = operands[1]; + valueId = operands[2]; + if (operands.size() > 3) { + scopeId = operands[3]; + semanticsId = builder.makeUintConstant( + builder.getConstantScalar(operands[4]) | builder.getConstantScalar(operands[5])); + semanticsId2 = builder.makeUintConstant( + builder.getConstantScalar(operands[6]) | builder.getConstantScalar(operands[7])); + } + } else if (opCode == spv::Op::OpAtomicLoad) { + if (operands.size() > 1) { + scopeId = operands[1]; + semanticsId = builder.makeUintConstant( + builder.getConstantScalar(operands[2]) | builder.getConstantScalar(operands[3])); + } + } else { + // atomic store or RMW + valueId = operands[1]; + if (operands.size() > 2) { + scopeId = operands[2]; + semanticsId = builder.makeUintConstant + (builder.getConstantScalar(operands[3]) | builder.getConstantScalar(operands[4])); + } + } + + // Check for capabilities + auto const semanticsImmediate = (spv::MemorySemanticsMask)(builder.getConstantScalar(semanticsId) | builder.getConstantScalar(semanticsId2)); + if (anySet(semanticsImmediate, spv::MemorySemanticsMask::MakeAvailableKHR | + spv::MemorySemanticsMask::MakeVisibleKHR | + spv::MemorySemanticsMask::OutputMemoryKHR | + spv::MemorySemanticsMask::Volatile)) { + builder.addCapability(spv::Capability::VulkanMemoryModelKHR); + } + + auto const scope = (spv::Scope)builder.getConstantScalar(scopeId); + if (scope == spv::Scope::QueueFamily) { + builder.addCapability(spv::Capability::VulkanMemoryModelKHR); + } + + if (glslangIntermediate->usingVulkanMemoryModel() && scope == spv::Scope::Device) { + builder.addCapability(spv::Capability::VulkanMemoryModelDeviceScopeKHR); + } + + std::vector spvAtomicOperands; // hold the spv operands + spvAtomicOperands.reserve(6); + spvAtomicOperands.push_back(pointerId); + spvAtomicOperands.push_back(scopeId); + spvAtomicOperands.push_back(semanticsId); + if (opCode == spv::Op::OpAtomicCompareExchange) { + spvAtomicOperands.push_back(semanticsId2); + spvAtomicOperands.push_back(valueId); + spvAtomicOperands.push_back(compareId); + } else if (opCode != spv::Op::OpAtomicLoad && opCode != spv::Op::OpAtomicIIncrement && opCode != spv::Op::OpAtomicIDecrement) { + spvAtomicOperands.push_back(valueId); + } + + if (opCode == spv::Op::OpAtomicStore) { + builder.createNoResultOp(opCode, spvAtomicOperands); + return 0; + } else { + spv::Id resultId = builder.createOp(opCode, typeId, spvAtomicOperands); + + // GLSL and HLSL atomic-counter decrement return post-decrement value, + // while SPIR-V returns pre-decrement value. Translate between these semantics. + if (op == glslang::EOpAtomicCounterDecrement) + resultId = builder.createBinOp(spv::Op::OpISub, typeId, resultId, builder.makeIntConstant(1)); + + return resultId; + } +} + +// Create group invocation operations. +spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op, spv::Id typeId, + std::vector& operands, glslang::TBasicType typeProxy) +{ + bool isUnsigned = isTypeUnsignedInt(typeProxy); + bool isFloat = isTypeFloat(typeProxy); + + spv::Op opCode = spv::Op::OpNop; + std::vector spvGroupOperands; + spv::GroupOperation groupOperation = spv::GroupOperation::Max; + + if (op == glslang::EOpBallot || op == glslang::EOpReadFirstInvocation || + op == glslang::EOpReadInvocation) { + builder.addExtension(spv::E_SPV_KHR_shader_ballot); + builder.addCapability(spv::Capability::SubgroupBallotKHR); + } else if (op == glslang::EOpAnyInvocation || + op == glslang::EOpAllInvocations || + op == glslang::EOpAllInvocationsEqual) { + builder.addExtension(spv::E_SPV_KHR_subgroup_vote); + builder.addCapability(spv::Capability::SubgroupVoteKHR); + } else { + builder.addCapability(spv::Capability::Groups); + if (op == glslang::EOpMinInvocationsNonUniform || + op == glslang::EOpMaxInvocationsNonUniform || + op == glslang::EOpAddInvocationsNonUniform || + op == glslang::EOpMinInvocationsInclusiveScanNonUniform || + op == glslang::EOpMaxInvocationsInclusiveScanNonUniform || + op == glslang::EOpAddInvocationsInclusiveScanNonUniform || + op == glslang::EOpMinInvocationsExclusiveScanNonUniform || + op == glslang::EOpMaxInvocationsExclusiveScanNonUniform || + op == glslang::EOpAddInvocationsExclusiveScanNonUniform) + builder.addExtension(spv::E_SPV_AMD_shader_ballot); + + switch (op) { + case glslang::EOpMinInvocations: + case glslang::EOpMaxInvocations: + case glslang::EOpAddInvocations: + case glslang::EOpMinInvocationsNonUniform: + case glslang::EOpMaxInvocationsNonUniform: + case glslang::EOpAddInvocationsNonUniform: + groupOperation = spv::GroupOperation::Reduce; + break; + case glslang::EOpMinInvocationsInclusiveScan: + case glslang::EOpMaxInvocationsInclusiveScan: + case glslang::EOpAddInvocationsInclusiveScan: + case glslang::EOpMinInvocationsInclusiveScanNonUniform: + case glslang::EOpMaxInvocationsInclusiveScanNonUniform: + case glslang::EOpAddInvocationsInclusiveScanNonUniform: + groupOperation = spv::GroupOperation::InclusiveScan; + break; + case glslang::EOpMinInvocationsExclusiveScan: + case glslang::EOpMaxInvocationsExclusiveScan: + case glslang::EOpAddInvocationsExclusiveScan: + case glslang::EOpMinInvocationsExclusiveScanNonUniform: + case glslang::EOpMaxInvocationsExclusiveScanNonUniform: + case glslang::EOpAddInvocationsExclusiveScanNonUniform: + groupOperation = spv::GroupOperation::ExclusiveScan; + break; + default: + break; + } + spv::IdImmediate scope = { true, builder.makeUintConstant(spv::Scope::Subgroup) }; + spvGroupOperands.push_back(scope); + if (groupOperation != spv::GroupOperation::Max) { + spv::IdImmediate groupOp = { false, (unsigned)groupOperation }; + spvGroupOperands.push_back(groupOp); + } + } + + for (auto opIt = operands.begin(); opIt != operands.end(); ++opIt) { + spv::IdImmediate op = { true, *opIt }; + spvGroupOperands.push_back(op); + } + + switch (op) { + case glslang::EOpAnyInvocation: + opCode = spv::Op::OpSubgroupAnyKHR; + break; + case glslang::EOpAllInvocations: + opCode = spv::Op::OpSubgroupAllKHR; + break; + case glslang::EOpAllInvocationsEqual: + opCode = spv::Op::OpSubgroupAllEqualKHR; + break; + case glslang::EOpReadInvocation: + opCode = spv::Op::OpSubgroupReadInvocationKHR; + if (builder.isVectorType(typeId)) + return CreateInvocationsVectorOperation(opCode, groupOperation, typeId, operands); + break; + case glslang::EOpReadFirstInvocation: + opCode = spv::Op::OpSubgroupFirstInvocationKHR; + if (builder.isVectorType(typeId)) + return CreateInvocationsVectorOperation(opCode, groupOperation, typeId, operands); + break; + case glslang::EOpBallot: + { + // NOTE: According to the spec, the result type of "OpSubgroupBallotKHR" must be a 4 component vector of 32 + // bit integer types. The GLSL built-in function "ballotARB()" assumes the maximum number of invocations in + // a subgroup is 64. Thus, we have to convert uvec4.xy to uint64_t as follow: + // + // result = Bitcast(SubgroupBallotKHR(Predicate).xy) + // + spv::Id uintType = builder.makeUintType(32); + spv::Id uvec4Type = builder.makeVectorType(uintType, 4); + spv::Id result = builder.createOp(spv::Op::OpSubgroupBallotKHR, uvec4Type, spvGroupOperands); + + std::vector components; + components.push_back(builder.createCompositeExtract(result, uintType, 0)); + components.push_back(builder.createCompositeExtract(result, uintType, 1)); + + spv::Id uvec2Type = builder.makeVectorType(uintType, 2); + return builder.createUnaryOp(spv::Op::OpBitcast, typeId, + builder.createCompositeConstruct(uvec2Type, components)); + } + + case glslang::EOpMinInvocations: + case glslang::EOpMaxInvocations: + case glslang::EOpAddInvocations: + case glslang::EOpMinInvocationsInclusiveScan: + case glslang::EOpMaxInvocationsInclusiveScan: + case glslang::EOpAddInvocationsInclusiveScan: + case glslang::EOpMinInvocationsExclusiveScan: + case glslang::EOpMaxInvocationsExclusiveScan: + case glslang::EOpAddInvocationsExclusiveScan: + if (op == glslang::EOpMinInvocations || + op == glslang::EOpMinInvocationsInclusiveScan || + op == glslang::EOpMinInvocationsExclusiveScan) { + if (isFloat) + opCode = spv::Op::OpGroupFMin; + else { + if (isUnsigned) + opCode = spv::Op::OpGroupUMin; + else + opCode = spv::Op::OpGroupSMin; + } + } else if (op == glslang::EOpMaxInvocations || + op == glslang::EOpMaxInvocationsInclusiveScan || + op == glslang::EOpMaxInvocationsExclusiveScan) { + if (isFloat) + opCode = spv::Op::OpGroupFMax; + else { + if (isUnsigned) + opCode = spv::Op::OpGroupUMax; + else + opCode = spv::Op::OpGroupSMax; + } + } else { + if (isFloat) + opCode = spv::Op::OpGroupFAdd; + else + opCode = spv::Op::OpGroupIAdd; + } + + if (builder.isVectorType(typeId)) + return CreateInvocationsVectorOperation(opCode, groupOperation, typeId, operands); + + break; + case glslang::EOpMinInvocationsNonUniform: + case glslang::EOpMaxInvocationsNonUniform: + case glslang::EOpAddInvocationsNonUniform: + case glslang::EOpMinInvocationsInclusiveScanNonUniform: + case glslang::EOpMaxInvocationsInclusiveScanNonUniform: + case glslang::EOpAddInvocationsInclusiveScanNonUniform: + case glslang::EOpMinInvocationsExclusiveScanNonUniform: + case glslang::EOpMaxInvocationsExclusiveScanNonUniform: + case glslang::EOpAddInvocationsExclusiveScanNonUniform: + if (op == glslang::EOpMinInvocationsNonUniform || + op == glslang::EOpMinInvocationsInclusiveScanNonUniform || + op == glslang::EOpMinInvocationsExclusiveScanNonUniform) { + if (isFloat) + opCode = spv::Op::OpGroupFMinNonUniformAMD; + else { + if (isUnsigned) + opCode = spv::Op::OpGroupUMinNonUniformAMD; + else + opCode = spv::Op::OpGroupSMinNonUniformAMD; + } + } + else if (op == glslang::EOpMaxInvocationsNonUniform || + op == glslang::EOpMaxInvocationsInclusiveScanNonUniform || + op == glslang::EOpMaxInvocationsExclusiveScanNonUniform) { + if (isFloat) + opCode = spv::Op::OpGroupFMaxNonUniformAMD; + else { + if (isUnsigned) + opCode = spv::Op::OpGroupUMaxNonUniformAMD; + else + opCode = spv::Op::OpGroupSMaxNonUniformAMD; + } + } + else { + if (isFloat) + opCode = spv::Op::OpGroupFAddNonUniformAMD; + else + opCode = spv::Op::OpGroupIAddNonUniformAMD; + } + + if (builder.isVectorType(typeId)) + return CreateInvocationsVectorOperation(opCode, groupOperation, typeId, operands); + + break; + default: + logger->missingFunctionality("invocation operation"); + return spv::NoResult; + } + + assert(opCode != spv::Op::OpNop); + return builder.createOp(opCode, typeId, spvGroupOperands); +} + +// Create group invocation operations on a vector +spv::Id TGlslangToSpvTraverser::CreateInvocationsVectorOperation(spv::Op op, spv::GroupOperation groupOperation, + spv::Id typeId, std::vector& operands) +{ + assert(op == spv::Op::OpGroupFMin || op == spv::Op::OpGroupUMin || op == spv::Op::OpGroupSMin || + op == spv::Op::OpGroupFMax || op == spv::Op::OpGroupUMax || op == spv::Op::OpGroupSMax || + op == spv::Op::OpGroupFAdd || op == spv::Op::OpGroupIAdd || op == spv::Op::OpGroupBroadcast || + op == spv::Op::OpSubgroupReadInvocationKHR || op == spv::Op::OpSubgroupFirstInvocationKHR || + op == spv::Op::OpGroupFMinNonUniformAMD || op == spv::Op::OpGroupUMinNonUniformAMD || + op == spv::Op::OpGroupSMinNonUniformAMD || + op == spv::Op::OpGroupFMaxNonUniformAMD || op == spv::Op::OpGroupUMaxNonUniformAMD || + op == spv::Op::OpGroupSMaxNonUniformAMD || + op == spv::Op::OpGroupFAddNonUniformAMD || op == spv::Op::OpGroupIAddNonUniformAMD); + + // Handle group invocation operations scalar by scalar. + // The result type is the same type as the original type. + // The algorithm is to: + // - break the vector into scalars + // - apply the operation to each scalar + // - make a vector out the scalar results + + // get the types sorted out + int numComponents = builder.getNumComponents(operands[0]); + spv::Id scalarType = builder.getScalarTypeId(builder.getTypeId(operands[0])); + std::vector results; + + // do each scalar op + for (int comp = 0; comp < numComponents; ++comp) { + std::vector indexes; + indexes.push_back(comp); + spv::IdImmediate scalar = { true, builder.createCompositeExtract(operands[0], scalarType, indexes) }; + std::vector spvGroupOperands; + if (op == spv::Op::OpSubgroupReadInvocationKHR) { + spvGroupOperands.push_back(scalar); + spv::IdImmediate operand = { true, operands[1] }; + spvGroupOperands.push_back(operand); + } else if (op == spv::Op::OpSubgroupFirstInvocationKHR) { + spvGroupOperands.push_back(scalar); + } else if (op == spv::Op::OpGroupBroadcast) { + spv::IdImmediate scope = { true, builder.makeUintConstant(spv::Scope::Subgroup) }; + spvGroupOperands.push_back(scope); + spvGroupOperands.push_back(scalar); + spv::IdImmediate operand = { true, operands[1] }; + spvGroupOperands.push_back(operand); + } else { + spv::IdImmediate scope = { true, builder.makeUintConstant(spv::Scope::Subgroup) }; + spvGroupOperands.push_back(scope); + spv::IdImmediate groupOp = { false, (unsigned)groupOperation }; + spvGroupOperands.push_back(groupOp); + spvGroupOperands.push_back(scalar); + } + + results.push_back(builder.createOp(op, scalarType, spvGroupOperands)); + } + + // put the pieces together + return builder.createCompositeConstruct(typeId, results); +} + +// Create subgroup invocation operations. +spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, spv::Id typeId, + std::vector& operands, glslang::TBasicType typeProxy) +{ + // Add the required capabilities. + switch (op) { + case glslang::EOpSubgroupElect: + builder.addCapability(spv::Capability::GroupNonUniform); + break; + case glslang::EOpSubgroupQuadAll: + case glslang::EOpSubgroupQuadAny: + builder.addExtension(spv::E_SPV_KHR_quad_control); + builder.addCapability(spv::Capability::QuadControlKHR); + [[fallthrough]]; + case glslang::EOpSubgroupAll: + case glslang::EOpSubgroupAny: + case glslang::EOpSubgroupAllEqual: + builder.addCapability(spv::Capability::GroupNonUniform); + builder.addCapability(spv::Capability::GroupNonUniformVote); + break; + case glslang::EOpSubgroupBroadcast: + case glslang::EOpSubgroupBroadcastFirst: + case glslang::EOpSubgroupBallot: + case glslang::EOpSubgroupInverseBallot: + case glslang::EOpSubgroupBallotBitExtract: + case glslang::EOpSubgroupBallotBitCount: + case glslang::EOpSubgroupBallotInclusiveBitCount: + case glslang::EOpSubgroupBallotExclusiveBitCount: + case glslang::EOpSubgroupBallotFindLSB: + case glslang::EOpSubgroupBallotFindMSB: + builder.addCapability(spv::Capability::GroupNonUniform); + builder.addCapability(spv::Capability::GroupNonUniformBallot); + break; + case glslang::EOpSubgroupRotate: + case glslang::EOpSubgroupClusteredRotate: + builder.addExtension(spv::E_SPV_KHR_subgroup_rotate); + builder.addCapability(spv::Capability::GroupNonUniformRotateKHR); + break; + case glslang::EOpSubgroupShuffle: + case glslang::EOpSubgroupShuffleXor: + builder.addCapability(spv::Capability::GroupNonUniform); + builder.addCapability(spv::Capability::GroupNonUniformShuffle); + break; + case glslang::EOpSubgroupShuffleUp: + case glslang::EOpSubgroupShuffleDown: + builder.addCapability(spv::Capability::GroupNonUniform); + builder.addCapability(spv::Capability::GroupNonUniformShuffleRelative); + break; + case glslang::EOpSubgroupAdd: + case glslang::EOpSubgroupMul: + case glslang::EOpSubgroupMin: + case glslang::EOpSubgroupMax: + case glslang::EOpSubgroupAnd: + case glslang::EOpSubgroupOr: + case glslang::EOpSubgroupXor: + case glslang::EOpSubgroupInclusiveAdd: + case glslang::EOpSubgroupInclusiveMul: + case glslang::EOpSubgroupInclusiveMin: + case glslang::EOpSubgroupInclusiveMax: + case glslang::EOpSubgroupInclusiveAnd: + case glslang::EOpSubgroupInclusiveOr: + case glslang::EOpSubgroupInclusiveXor: + case glslang::EOpSubgroupExclusiveAdd: + case glslang::EOpSubgroupExclusiveMul: + case glslang::EOpSubgroupExclusiveMin: + case glslang::EOpSubgroupExclusiveMax: + case glslang::EOpSubgroupExclusiveAnd: + case glslang::EOpSubgroupExclusiveOr: + case glslang::EOpSubgroupExclusiveXor: + builder.addCapability(spv::Capability::GroupNonUniform); + builder.addCapability(spv::Capability::GroupNonUniformArithmetic); + break; + case glslang::EOpSubgroupClusteredAdd: + case glslang::EOpSubgroupClusteredMul: + case glslang::EOpSubgroupClusteredMin: + case glslang::EOpSubgroupClusteredMax: + case glslang::EOpSubgroupClusteredAnd: + case glslang::EOpSubgroupClusteredOr: + case glslang::EOpSubgroupClusteredXor: + builder.addCapability(spv::Capability::GroupNonUniform); + builder.addCapability(spv::Capability::GroupNonUniformClustered); + break; + case glslang::EOpSubgroupQuadBroadcast: + case glslang::EOpSubgroupQuadSwapHorizontal: + case glslang::EOpSubgroupQuadSwapVertical: + case glslang::EOpSubgroupQuadSwapDiagonal: + builder.addCapability(spv::Capability::GroupNonUniform); + builder.addCapability(spv::Capability::GroupNonUniformQuad); + break; + case glslang::EOpSubgroupPartitionedAdd: + case glslang::EOpSubgroupPartitionedMul: + case glslang::EOpSubgroupPartitionedMin: + case glslang::EOpSubgroupPartitionedMax: + case glslang::EOpSubgroupPartitionedAnd: + case glslang::EOpSubgroupPartitionedOr: + case glslang::EOpSubgroupPartitionedXor: + case glslang::EOpSubgroupPartitionedInclusiveAdd: + case glslang::EOpSubgroupPartitionedInclusiveMul: + case glslang::EOpSubgroupPartitionedInclusiveMin: + case glslang::EOpSubgroupPartitionedInclusiveMax: + case glslang::EOpSubgroupPartitionedInclusiveAnd: + case glslang::EOpSubgroupPartitionedInclusiveOr: + case glslang::EOpSubgroupPartitionedInclusiveXor: + case glslang::EOpSubgroupPartitionedExclusiveAdd: + case glslang::EOpSubgroupPartitionedExclusiveMul: + case glslang::EOpSubgroupPartitionedExclusiveMin: + case glslang::EOpSubgroupPartitionedExclusiveMax: + case glslang::EOpSubgroupPartitionedExclusiveAnd: + case glslang::EOpSubgroupPartitionedExclusiveOr: + case glslang::EOpSubgroupPartitionedExclusiveXor: + builder.addExtension(spv::E_SPV_NV_shader_subgroup_partitioned); + builder.addCapability(spv::Capability::GroupNonUniformPartitionedNV); + break; + default: assert(0 && "Unhandled subgroup operation!"); + } + + + const bool isUnsigned = isTypeUnsignedInt(typeProxy); + const bool isFloat = isTypeFloat(typeProxy); + const bool isBool = typeProxy == glslang::EbtBool; + + spv::Op opCode = spv::Op::OpNop; + + // Figure out which opcode to use. + switch (op) { + case glslang::EOpSubgroupElect: opCode = spv::Op::OpGroupNonUniformElect; break; + case glslang::EOpSubgroupQuadAll: opCode = spv::Op::OpGroupNonUniformQuadAllKHR; break; + case glslang::EOpSubgroupAll: opCode = spv::Op::OpGroupNonUniformAll; break; + case glslang::EOpSubgroupQuadAny: opCode = spv::Op::OpGroupNonUniformQuadAnyKHR; break; + case glslang::EOpSubgroupAny: opCode = spv::Op::OpGroupNonUniformAny; break; + case glslang::EOpSubgroupAllEqual: opCode = spv::Op::OpGroupNonUniformAllEqual; break; + case glslang::EOpSubgroupBroadcast: opCode = spv::Op::OpGroupNonUniformBroadcast; break; + case glslang::EOpSubgroupBroadcastFirst: opCode = spv::Op::OpGroupNonUniformBroadcastFirst; break; + case glslang::EOpSubgroupBallot: opCode = spv::Op::OpGroupNonUniformBallot; break; + case glslang::EOpSubgroupInverseBallot: opCode = spv::Op::OpGroupNonUniformInverseBallot; break; + case glslang::EOpSubgroupBallotBitExtract: opCode = spv::Op::OpGroupNonUniformBallotBitExtract; break; + case glslang::EOpSubgroupBallotBitCount: + case glslang::EOpSubgroupBallotInclusiveBitCount: + case glslang::EOpSubgroupBallotExclusiveBitCount: opCode = spv::Op::OpGroupNonUniformBallotBitCount; break; + case glslang::EOpSubgroupBallotFindLSB: opCode = spv::Op::OpGroupNonUniformBallotFindLSB; break; + case glslang::EOpSubgroupBallotFindMSB: opCode = spv::Op::OpGroupNonUniformBallotFindMSB; break; + case glslang::EOpSubgroupShuffle: opCode = spv::Op::OpGroupNonUniformShuffle; break; + case glslang::EOpSubgroupShuffleXor: opCode = spv::Op::OpGroupNonUniformShuffleXor; break; + case glslang::EOpSubgroupShuffleUp: opCode = spv::Op::OpGroupNonUniformShuffleUp; break; + case glslang::EOpSubgroupShuffleDown: opCode = spv::Op::OpGroupNonUniformShuffleDown; break; + case glslang::EOpSubgroupRotate: + case glslang::EOpSubgroupClusteredRotate: opCode = spv::Op::OpGroupNonUniformRotateKHR; break; + case glslang::EOpSubgroupAdd: + case glslang::EOpSubgroupInclusiveAdd: + case glslang::EOpSubgroupExclusiveAdd: + case glslang::EOpSubgroupClusteredAdd: + case glslang::EOpSubgroupPartitionedAdd: + case glslang::EOpSubgroupPartitionedInclusiveAdd: + case glslang::EOpSubgroupPartitionedExclusiveAdd: + if (isFloat) { + opCode = spv::Op::OpGroupNonUniformFAdd; + } else { + opCode = spv::Op::OpGroupNonUniformIAdd; + } + break; + case glslang::EOpSubgroupMul: + case glslang::EOpSubgroupInclusiveMul: + case glslang::EOpSubgroupExclusiveMul: + case glslang::EOpSubgroupClusteredMul: + case glslang::EOpSubgroupPartitionedMul: + case glslang::EOpSubgroupPartitionedInclusiveMul: + case glslang::EOpSubgroupPartitionedExclusiveMul: + if (isFloat) { + opCode = spv::Op::OpGroupNonUniformFMul; + } else { + opCode = spv::Op::OpGroupNonUniformIMul; + } + break; + case glslang::EOpSubgroupMin: + case glslang::EOpSubgroupInclusiveMin: + case glslang::EOpSubgroupExclusiveMin: + case glslang::EOpSubgroupClusteredMin: + case glslang::EOpSubgroupPartitionedMin: + case glslang::EOpSubgroupPartitionedInclusiveMin: + case glslang::EOpSubgroupPartitionedExclusiveMin: + if (isFloat) { + opCode = spv::Op::OpGroupNonUniformFMin; + } else if (isUnsigned) { + opCode = spv::Op::OpGroupNonUniformUMin; + } else { + opCode = spv::Op::OpGroupNonUniformSMin; + } + break; + case glslang::EOpSubgroupMax: + case glslang::EOpSubgroupInclusiveMax: + case glslang::EOpSubgroupExclusiveMax: + case glslang::EOpSubgroupClusteredMax: + case glslang::EOpSubgroupPartitionedMax: + case glslang::EOpSubgroupPartitionedInclusiveMax: + case glslang::EOpSubgroupPartitionedExclusiveMax: + if (isFloat) { + opCode = spv::Op::OpGroupNonUniformFMax; + } else if (isUnsigned) { + opCode = spv::Op::OpGroupNonUniformUMax; + } else { + opCode = spv::Op::OpGroupNonUniformSMax; + } + break; + case glslang::EOpSubgroupAnd: + case glslang::EOpSubgroupInclusiveAnd: + case glslang::EOpSubgroupExclusiveAnd: + case glslang::EOpSubgroupClusteredAnd: + case glslang::EOpSubgroupPartitionedAnd: + case glslang::EOpSubgroupPartitionedInclusiveAnd: + case glslang::EOpSubgroupPartitionedExclusiveAnd: + if (isBool) { + opCode = spv::Op::OpGroupNonUniformLogicalAnd; + } else { + opCode = spv::Op::OpGroupNonUniformBitwiseAnd; + } + break; + case glslang::EOpSubgroupOr: + case glslang::EOpSubgroupInclusiveOr: + case glslang::EOpSubgroupExclusiveOr: + case glslang::EOpSubgroupClusteredOr: + case glslang::EOpSubgroupPartitionedOr: + case glslang::EOpSubgroupPartitionedInclusiveOr: + case glslang::EOpSubgroupPartitionedExclusiveOr: + if (isBool) { + opCode = spv::Op::OpGroupNonUniformLogicalOr; + } else { + opCode = spv::Op::OpGroupNonUniformBitwiseOr; + } + break; + case glslang::EOpSubgroupXor: + case glslang::EOpSubgroupInclusiveXor: + case glslang::EOpSubgroupExclusiveXor: + case glslang::EOpSubgroupClusteredXor: + case glslang::EOpSubgroupPartitionedXor: + case glslang::EOpSubgroupPartitionedInclusiveXor: + case glslang::EOpSubgroupPartitionedExclusiveXor: + if (isBool) { + opCode = spv::Op::OpGroupNonUniformLogicalXor; + } else { + opCode = spv::Op::OpGroupNonUniformBitwiseXor; + } + break; + case glslang::EOpSubgroupQuadBroadcast: opCode = spv::Op::OpGroupNonUniformQuadBroadcast; break; + case glslang::EOpSubgroupQuadSwapHorizontal: + case glslang::EOpSubgroupQuadSwapVertical: + case glslang::EOpSubgroupQuadSwapDiagonal: opCode = spv::Op::OpGroupNonUniformQuadSwap; break; + default: assert(0 && "Unhandled subgroup operation!"); + } + + // get the right Group Operation + spv::GroupOperation groupOperation = spv::GroupOperation::Max; + switch (op) { + default: + break; + case glslang::EOpSubgroupBallotBitCount: + case glslang::EOpSubgroupAdd: + case glslang::EOpSubgroupMul: + case glslang::EOpSubgroupMin: + case glslang::EOpSubgroupMax: + case glslang::EOpSubgroupAnd: + case glslang::EOpSubgroupOr: + case glslang::EOpSubgroupXor: + groupOperation = spv::GroupOperation::Reduce; + break; + case glslang::EOpSubgroupBallotInclusiveBitCount: + case glslang::EOpSubgroupInclusiveAdd: + case glslang::EOpSubgroupInclusiveMul: + case glslang::EOpSubgroupInclusiveMin: + case glslang::EOpSubgroupInclusiveMax: + case glslang::EOpSubgroupInclusiveAnd: + case glslang::EOpSubgroupInclusiveOr: + case glslang::EOpSubgroupInclusiveXor: + groupOperation = spv::GroupOperation::InclusiveScan; + break; + case glslang::EOpSubgroupBallotExclusiveBitCount: + case glslang::EOpSubgroupExclusiveAdd: + case glslang::EOpSubgroupExclusiveMul: + case glslang::EOpSubgroupExclusiveMin: + case glslang::EOpSubgroupExclusiveMax: + case glslang::EOpSubgroupExclusiveAnd: + case glslang::EOpSubgroupExclusiveOr: + case glslang::EOpSubgroupExclusiveXor: + groupOperation = spv::GroupOperation::ExclusiveScan; + break; + case glslang::EOpSubgroupClusteredAdd: + case glslang::EOpSubgroupClusteredMul: + case glslang::EOpSubgroupClusteredMin: + case glslang::EOpSubgroupClusteredMax: + case glslang::EOpSubgroupClusteredAnd: + case glslang::EOpSubgroupClusteredOr: + case glslang::EOpSubgroupClusteredXor: + groupOperation = spv::GroupOperation::ClusteredReduce; + break; + case glslang::EOpSubgroupPartitionedAdd: + case glslang::EOpSubgroupPartitionedMul: + case glslang::EOpSubgroupPartitionedMin: + case glslang::EOpSubgroupPartitionedMax: + case glslang::EOpSubgroupPartitionedAnd: + case glslang::EOpSubgroupPartitionedOr: + case glslang::EOpSubgroupPartitionedXor: + groupOperation = spv::GroupOperation::PartitionedReduceNV; + break; + case glslang::EOpSubgroupPartitionedInclusiveAdd: + case glslang::EOpSubgroupPartitionedInclusiveMul: + case glslang::EOpSubgroupPartitionedInclusiveMin: + case glslang::EOpSubgroupPartitionedInclusiveMax: + case glslang::EOpSubgroupPartitionedInclusiveAnd: + case glslang::EOpSubgroupPartitionedInclusiveOr: + case glslang::EOpSubgroupPartitionedInclusiveXor: + groupOperation = spv::GroupOperation::PartitionedInclusiveScanNV; + break; + case glslang::EOpSubgroupPartitionedExclusiveAdd: + case glslang::EOpSubgroupPartitionedExclusiveMul: + case glslang::EOpSubgroupPartitionedExclusiveMin: + case glslang::EOpSubgroupPartitionedExclusiveMax: + case glslang::EOpSubgroupPartitionedExclusiveAnd: + case glslang::EOpSubgroupPartitionedExclusiveOr: + case glslang::EOpSubgroupPartitionedExclusiveXor: + groupOperation = spv::GroupOperation::PartitionedExclusiveScanNV; + break; + } + + // build the instruction + std::vector spvGroupOperands; + + // Every operation begins with the Execution Scope operand. + spv::IdImmediate executionScope = { true, builder.makeUintConstant(spv::Scope::Subgroup) }; + // All other ops need the execution scope. Quad Control Ops don't need scope, it's always Quad. + if (opCode != spv::Op::OpGroupNonUniformQuadAllKHR && opCode != spv::Op::OpGroupNonUniformQuadAnyKHR) { + spvGroupOperands.push_back(executionScope); + } + + // Next, for all operations that use a Group Operation, push that as an operand. + if (groupOperation != spv::GroupOperation::Max) { + spv::IdImmediate groupOperand = { false, (unsigned)groupOperation }; + spvGroupOperands.push_back(groupOperand); + } + + // Push back the operands next. + for (auto opIt = operands.cbegin(); opIt != operands.cend(); ++opIt) { + spv::IdImmediate operand = { true, *opIt }; + spvGroupOperands.push_back(operand); + } + + // Some opcodes have additional operands. + spv::Id directionId = spv::NoResult; + switch (op) { + default: break; + case glslang::EOpSubgroupQuadSwapHorizontal: directionId = builder.makeUintConstant(0); break; + case glslang::EOpSubgroupQuadSwapVertical: directionId = builder.makeUintConstant(1); break; + case glslang::EOpSubgroupQuadSwapDiagonal: directionId = builder.makeUintConstant(2); break; + } + if (directionId != spv::NoResult) { + spv::IdImmediate direction = { true, directionId }; + spvGroupOperands.push_back(direction); + } + + return builder.createOp(opCode, typeId, spvGroupOperands); +} + +spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::Decoration precision, + spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy) +{ + bool isUnsigned = isTypeUnsignedInt(typeProxy); + bool isFloat = isTypeFloat(typeProxy); + + spv::Op opCode = spv::Op::OpNop; + int extBuiltins = -1; + int libCall = -1; + size_t consumedOperands = operands.size(); + spv::Id typeId0 = 0; + if (consumedOperands > 0) + typeId0 = builder.getTypeId(operands[0]); + spv::Id typeId1 = 0; + if (consumedOperands > 1) + typeId1 = builder.getTypeId(operands[1]); + spv::Id frexpIntType = 0; + + switch (op) { + case glslang::EOpMin: + if (isFloat) + libCall = nanMinMaxClamp ? spv::GLSLstd450NMin : spv::GLSLstd450FMin; + else if (isUnsigned) + libCall = spv::GLSLstd450UMin; + else + libCall = spv::GLSLstd450SMin; + builder.promoteScalar(precision, operands.front(), operands.back()); + break; + case glslang::EOpModf: + { + libCall = spv::GLSLstd450ModfStruct; + assert(builder.isFloatType(builder.getScalarTypeId(typeId0))); + // The returned struct has two members of the same type as the first argument + typeId = builder.makeStructResultType(typeId0, typeId0); + consumedOperands = 1; + } + break; + case glslang::EOpMax: + if (isFloat) + libCall = nanMinMaxClamp ? spv::GLSLstd450NMax : spv::GLSLstd450FMax; + else if (isUnsigned) + libCall = spv::GLSLstd450UMax; + else + libCall = spv::GLSLstd450SMax; + builder.promoteScalar(precision, operands.front(), operands.back()); + break; + case glslang::EOpPow: + libCall = spv::GLSLstd450Pow; + break; + case glslang::EOpDot: + case glslang::EOpDotPackedEXT: + case glslang::EOpDotAccSatEXT: + case glslang::EOpDotPackedAccSatEXT: + { + if (builder.isFloatType(builder.getScalarTypeId(typeId0)) || + // HLSL supports dot(int,int) which is just a multiply + glslangIntermediate->getSource() == glslang::EShSourceHlsl) { + if (typeProxy == glslang::EbtBFloat16) { + builder.addExtension(spv::E_SPV_KHR_bfloat16); + builder.addCapability(spv::Capability::BFloat16DotProductKHR); + } + opCode = spv::Op::OpDot; + } else { + builder.addExtension(spv::E_SPV_KHR_integer_dot_product); + builder.addCapability(spv::Capability::DotProductKHR); + const unsigned int vectorSize = builder.getNumComponents(operands[0]); + if (op == glslang::EOpDotPackedEXT || op == glslang::EOpDotPackedAccSatEXT) { + builder.addCapability(spv::Capability::DotProductInput4x8BitPackedKHR); + } else if (vectorSize == 4 && builder.getScalarTypeWidth(typeId0) == 8) { + builder.addCapability(spv::Capability::DotProductInput4x8BitKHR); + } else { + builder.addCapability(spv::Capability::DotProductInputAllKHR); + } + const bool type0isSigned = builder.isIntType(builder.getScalarTypeId(typeId0)); + const bool type1isSigned = builder.isIntType(builder.getScalarTypeId(typeId1)); + const bool accSat = (op == glslang::EOpDotAccSatEXT || op == glslang::EOpDotPackedAccSatEXT); + if (!type0isSigned && !type1isSigned) { + opCode = accSat ? spv::Op::OpUDotAccSatKHR : spv::Op::OpUDotKHR; + } else if (type0isSigned && type1isSigned) { + opCode = accSat ? spv::Op::OpSDotAccSatKHR : spv::Op::OpSDotKHR; + } else { + opCode = accSat ? spv::Op::OpSUDotAccSatKHR : spv::Op::OpSUDotKHR; + // the spir-v opcode assumes the operands to be "signed, unsigned" in that order, so swap if needed + if (type1isSigned) { + std::swap(operands[0], operands[1]); + } + } + std::vector operands2; + for (auto &o : operands) { + operands2.push_back({true, o}); + } + if (op == glslang::EOpDotPackedEXT || op == glslang::EOpDotPackedAccSatEXT) { + operands2.push_back({false, 0}); + } + return builder.createOp(opCode, typeId, operands2); + } + } + break; + case glslang::EOpAtan: + libCall = spv::GLSLstd450Atan2; + break; + + case glslang::EOpClamp: + if (isFloat) + libCall = nanMinMaxClamp ? spv::GLSLstd450NClamp : spv::GLSLstd450FClamp; + else if (isUnsigned) + libCall = spv::GLSLstd450UClamp; + else + libCall = spv::GLSLstd450SClamp; + builder.promoteScalar(precision, operands.front(), operands[1]); + builder.promoteScalar(precision, operands.front(), operands[2]); + break; + case glslang::EOpMix: + if (! builder.isBoolType(builder.getScalarTypeId(builder.getTypeId(operands.back())))) { + assert(isFloat); + libCall = spv::GLSLstd450FMix; + } else { + opCode = spv::Op::OpSelect; + std::swap(operands.front(), operands.back()); + } + builder.promoteScalar(precision, operands.front(), operands.back()); + break; + case glslang::EOpStep: + libCall = spv::GLSLstd450Step; + builder.promoteScalar(precision, operands.front(), operands.back()); + break; + case glslang::EOpSmoothStep: + libCall = spv::GLSLstd450SmoothStep; + builder.promoteScalar(precision, operands[0], operands[2]); + builder.promoteScalar(precision, operands[1], operands[2]); + break; + + case glslang::EOpDistance: + libCall = spv::GLSLstd450Distance; + break; + case glslang::EOpCross: + libCall = spv::GLSLstd450Cross; + break; + case glslang::EOpFaceForward: + libCall = spv::GLSLstd450FaceForward; + break; + case glslang::EOpReflect: + libCall = spv::GLSLstd450Reflect; + break; + case glslang::EOpRefract: + libCall = spv::GLSLstd450Refract; + break; + case glslang::EOpBarrier: + { + // This is for the extended controlBarrier function, with four operands. + // The unextended barrier() goes through createNoArgOperation. + assert(operands.size() == 4); + auto const executionScope = (spv::Scope)builder.getConstantScalar(operands[0]); + auto const memoryScope = (spv::Scope)builder.getConstantScalar(operands[1]); + auto const semantics = (spv::MemorySemanticsMask)(builder.getConstantScalar(operands[2]) | builder.getConstantScalar(operands[3])); + builder.createControlBarrier(executionScope, memoryScope, + semantics); + if (anySet(semantics, spv::MemorySemanticsMask::MakeAvailableKHR | + spv::MemorySemanticsMask::MakeVisibleKHR | + spv::MemorySemanticsMask::OutputMemoryKHR | + spv::MemorySemanticsMask::Volatile)) { + builder.addCapability(spv::Capability::VulkanMemoryModelKHR); + } + if (glslangIntermediate->usingVulkanMemoryModel() && (executionScope == spv::Scope::Device || + memoryScope == spv::Scope::Device)) { + builder.addCapability(spv::Capability::VulkanMemoryModelDeviceScopeKHR); + } + return 0; + } + break; + case glslang::EOpMemoryBarrier: + { + // This is for the extended memoryBarrier function, with three operands. + // The unextended memoryBarrier() goes through createNoArgOperation. + assert(operands.size() == 3); + auto const memoryScope = (spv::Scope)builder.getConstantScalar(operands[0]); + auto const semantics = (spv::MemorySemanticsMask)(builder.getConstantScalar(operands[1]) | builder.getConstantScalar(operands[2])); + builder.createMemoryBarrier(memoryScope, semantics); + if (anySet(semantics, spv::MemorySemanticsMask::MakeAvailableKHR | + spv::MemorySemanticsMask::MakeVisibleKHR | + spv::MemorySemanticsMask::OutputMemoryKHR | + spv::MemorySemanticsMask::Volatile)) { + builder.addCapability(spv::Capability::VulkanMemoryModelKHR); + } + if (glslangIntermediate->usingVulkanMemoryModel() && memoryScope == spv::Scope::Device) { + builder.addCapability(spv::Capability::VulkanMemoryModelDeviceScopeKHR); + } + return 0; + } + break; + + case glslang::EOpInterpolateAtSample: + if (typeProxy == glslang::EbtFloat16) + builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float); + libCall = spv::GLSLstd450InterpolateAtSample; + break; + case glslang::EOpInterpolateAtOffset: + if (typeProxy == glslang::EbtFloat16) + builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float); + libCall = spv::GLSLstd450InterpolateAtOffset; + break; + case glslang::EOpAddCarry: + opCode = spv::Op::OpIAddCarry; + typeId = builder.makeStructResultType(typeId0, typeId0); + consumedOperands = 2; + break; + case glslang::EOpSubBorrow: + opCode = spv::Op::OpISubBorrow; + typeId = builder.makeStructResultType(typeId0, typeId0); + consumedOperands = 2; + break; + case glslang::EOpUMulExtended: + opCode = spv::Op::OpUMulExtended; + typeId = builder.makeStructResultType(typeId0, typeId0); + consumedOperands = 2; + break; + case glslang::EOpIMulExtended: + opCode = spv::Op::OpSMulExtended; + typeId = builder.makeStructResultType(typeId0, typeId0); + consumedOperands = 2; + break; + case glslang::EOpBitfieldExtract: + if (isUnsigned) + opCode = spv::Op::OpBitFieldUExtract; + else + opCode = spv::Op::OpBitFieldSExtract; + break; + case glslang::EOpBitfieldInsert: + opCode = spv::Op::OpBitFieldInsert; + break; + + case glslang::EOpFma: + libCall = spv::GLSLstd450Fma; + break; + case glslang::EOpFrexp: + { + libCall = spv::GLSLstd450FrexpStruct; + assert(builder.isPointerType(typeId1)); + typeId1 = builder.getContainedTypeId(typeId1); + int width = builder.getScalarTypeWidth(typeId1); + if (width == 16) + // Using 16-bit exp operand, enable extension SPV_AMD_gpu_shader_int16 + builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16); + if (builder.getNumComponents(operands[0]) == 1) + frexpIntType = builder.makeIntegerType(width, true); + else + frexpIntType = builder.makeVectorType(builder.makeIntegerType(width, true), + builder.getNumComponents(operands[0])); + typeId = builder.makeStructResultType(typeId0, frexpIntType); + consumedOperands = 1; + } + break; + case glslang::EOpLdexp: + libCall = spv::GLSLstd450Ldexp; + break; + + case glslang::EOpReadInvocation: + return createInvocationsOperation(op, typeId, operands, typeProxy); + + case glslang::EOpSubgroupBroadcast: + case glslang::EOpSubgroupBallotBitExtract: + case glslang::EOpSubgroupShuffle: + case glslang::EOpSubgroupShuffleXor: + case glslang::EOpSubgroupShuffleUp: + case glslang::EOpSubgroupShuffleDown: + case glslang::EOpSubgroupRotate: + case glslang::EOpSubgroupClusteredRotate: + case glslang::EOpSubgroupClusteredAdd: + case glslang::EOpSubgroupClusteredMul: + case glslang::EOpSubgroupClusteredMin: + case glslang::EOpSubgroupClusteredMax: + case glslang::EOpSubgroupClusteredAnd: + case glslang::EOpSubgroupClusteredOr: + case glslang::EOpSubgroupClusteredXor: + case glslang::EOpSubgroupQuadBroadcast: + case glslang::EOpSubgroupPartitionedAdd: + case glslang::EOpSubgroupPartitionedMul: + case glslang::EOpSubgroupPartitionedMin: + case glslang::EOpSubgroupPartitionedMax: + case glslang::EOpSubgroupPartitionedAnd: + case glslang::EOpSubgroupPartitionedOr: + case glslang::EOpSubgroupPartitionedXor: + case glslang::EOpSubgroupPartitionedInclusiveAdd: + case glslang::EOpSubgroupPartitionedInclusiveMul: + case glslang::EOpSubgroupPartitionedInclusiveMin: + case glslang::EOpSubgroupPartitionedInclusiveMax: + case glslang::EOpSubgroupPartitionedInclusiveAnd: + case glslang::EOpSubgroupPartitionedInclusiveOr: + case glslang::EOpSubgroupPartitionedInclusiveXor: + case glslang::EOpSubgroupPartitionedExclusiveAdd: + case glslang::EOpSubgroupPartitionedExclusiveMul: + case glslang::EOpSubgroupPartitionedExclusiveMin: + case glslang::EOpSubgroupPartitionedExclusiveMax: + case glslang::EOpSubgroupPartitionedExclusiveAnd: + case glslang::EOpSubgroupPartitionedExclusiveOr: + case glslang::EOpSubgroupPartitionedExclusiveXor: + return createSubgroupOperation(op, typeId, operands, typeProxy); + + case glslang::EOpSwizzleInvocations: + extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_ballot); + libCall = spv::SwizzleInvocationsAMD; + break; + case glslang::EOpSwizzleInvocationsMasked: + extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_ballot); + libCall = spv::SwizzleInvocationsMaskedAMD; + break; + case glslang::EOpWriteInvocation: + extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_ballot); + libCall = spv::WriteInvocationAMD; + break; + + case glslang::EOpMin3: + extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_trinary_minmax); + if (isFloat) + libCall = spv::FMin3AMD; + else { + if (isUnsigned) + libCall = spv::UMin3AMD; + else + libCall = spv::SMin3AMD; + } + break; + case glslang::EOpMax3: + extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_trinary_minmax); + if (isFloat) + libCall = spv::FMax3AMD; + else { + if (isUnsigned) + libCall = spv::UMax3AMD; + else + libCall = spv::SMax3AMD; + } + break; + case glslang::EOpMid3: + extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_trinary_minmax); + if (isFloat) + libCall = spv::FMid3AMD; + else { + if (isUnsigned) + libCall = spv::UMid3AMD; + else + libCall = spv::SMid3AMD; + } + break; + + case glslang::EOpInterpolateAtVertex: + if (typeProxy == glslang::EbtFloat16) + builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float); + extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_explicit_vertex_parameter); + libCall = spv::InterpolateAtVertexAMD; + break; + + case glslang::EOpReportIntersection: + typeId = builder.makeBoolType(); + opCode = spv::Op::OpReportIntersectionKHR; + break; + case glslang::EOpTraceNV: + builder.createNoResultOp(spv::Op::OpTraceNV, operands); + return 0; + case glslang::EOpTraceRayMotionNV: + builder.addExtension(spv::E_SPV_NV_ray_tracing_motion_blur); + builder.addCapability(spv::Capability::RayTracingMotionBlurNV); + builder.createNoResultOp(spv::Op::OpTraceRayMotionNV, operands); + return 0; + case glslang::EOpTraceKHR: + builder.createNoResultOp(spv::Op::OpTraceRayKHR, operands); + return 0; + case glslang::EOpExecuteCallableNV: + builder.createNoResultOp(spv::Op::OpExecuteCallableNV, operands); + return 0; + case glslang::EOpExecuteCallableKHR: + builder.createNoResultOp(spv::Op::OpExecuteCallableKHR, operands); + return 0; + + case glslang::EOpRayQueryInitialize: + builder.createNoResultOp(spv::Op::OpRayQueryInitializeKHR, operands); + return 0; + case glslang::EOpRayQueryTerminate: + builder.createNoResultOp(spv::Op::OpRayQueryTerminateKHR, operands); + return 0; + case glslang::EOpRayQueryGenerateIntersection: + builder.createNoResultOp(spv::Op::OpRayQueryGenerateIntersectionKHR, operands); + return 0; + case glslang::EOpRayQueryConfirmIntersection: + builder.createNoResultOp(spv::Op::OpRayQueryConfirmIntersectionKHR, operands); + return 0; + case glslang::EOpRayQueryProceed: + typeId = builder.makeBoolType(); + opCode = spv::Op::OpRayQueryProceedKHR; + break; + case glslang::EOpRayQueryGetIntersectionType: + typeId = builder.makeUintType(32); + opCode = spv::Op::OpRayQueryGetIntersectionTypeKHR; + break; + case glslang::EOpRayQueryGetRayTMin: + typeId = builder.makeFloatType(32); + opCode = spv::Op::OpRayQueryGetRayTMinKHR; + break; + case glslang::EOpRayQueryGetRayFlags: + typeId = builder.makeIntType(32); + opCode = spv::Op::OpRayQueryGetRayFlagsKHR; + break; + case glslang::EOpRayQueryGetIntersectionT: + typeId = builder.makeFloatType(32); + opCode = spv::Op::OpRayQueryGetIntersectionTKHR; + break; + case glslang::EOpRayQueryGetIntersectionInstanceCustomIndex: + typeId = builder.makeIntType(32); + opCode = spv::Op::OpRayQueryGetIntersectionInstanceCustomIndexKHR; + break; + case glslang::EOpRayQueryGetIntersectionInstanceId: + typeId = builder.makeIntType(32); + opCode = spv::Op::OpRayQueryGetIntersectionInstanceIdKHR; + break; + case glslang::EOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffset: + typeId = builder.makeUintType(32); + opCode = spv::Op::OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR; + break; + case glslang::EOpRayQueryGetIntersectionGeometryIndex: + typeId = builder.makeIntType(32); + opCode = spv::Op::OpRayQueryGetIntersectionGeometryIndexKHR; + break; + case glslang::EOpRayQueryGetIntersectionPrimitiveIndex: + typeId = builder.makeIntType(32); + opCode = spv::Op::OpRayQueryGetIntersectionPrimitiveIndexKHR; + break; + case glslang::EOpRayQueryGetIntersectionBarycentrics: + typeId = builder.makeVectorType(builder.makeFloatType(32), 2); + opCode = spv::Op::OpRayQueryGetIntersectionBarycentricsKHR; + break; + case glslang::EOpRayQueryGetIntersectionFrontFace: + typeId = builder.makeBoolType(); + opCode = spv::Op::OpRayQueryGetIntersectionFrontFaceKHR; + break; + case glslang::EOpRayQueryGetIntersectionCandidateAABBOpaque: + typeId = builder.makeBoolType(); + opCode = spv::Op::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR; + break; + case glslang::EOpRayQueryGetIntersectionObjectRayDirection: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::Op::OpRayQueryGetIntersectionObjectRayDirectionKHR; + break; + case glslang::EOpRayQueryGetIntersectionObjectRayOrigin: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::Op::OpRayQueryGetIntersectionObjectRayOriginKHR; + break; + case glslang::EOpRayQueryGetWorldRayDirection: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::Op::OpRayQueryGetWorldRayDirectionKHR; + break; + case glslang::EOpRayQueryGetWorldRayOrigin: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::Op::OpRayQueryGetWorldRayOriginKHR; + break; + case glslang::EOpRayQueryGetIntersectionObjectToWorld: + typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3); + opCode = spv::Op::OpRayQueryGetIntersectionObjectToWorldKHR; + break; + case glslang::EOpRayQueryGetIntersectionClusterIdNV: + typeId = builder.makeIntegerType(32, 1); + opCode = spv::Op::OpRayQueryGetClusterIdNV; + break; + case glslang::EOpRayQueryGetIntersectionWorldToObject: + typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3); + opCode = spv::Op::OpRayQueryGetIntersectionWorldToObjectKHR; + break; + case glslang::EOpRayQueryGetIntersectionSpherePositionNV: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::Op::OpRayQueryGetIntersectionSpherePositionNV; + break; + case glslang::EOpRayQueryGetIntersectionSphereRadiusNV: + typeId = builder.makeFloatType(32); + opCode = spv::Op::OpRayQueryGetIntersectionSphereRadiusNV; + break; + case glslang::EOpRayQueryGetIntersectionLSSHitValueNV: + typeId = builder.makeFloatType(32); + opCode = spv::Op::OpRayQueryGetIntersectionLSSHitValueNV; + break; + case glslang::EOpRayQueryIsSphereHitNV: + typeId = builder.makeBoolType(); + opCode = spv::Op::OpRayQueryIsSphereHitNV; + break; + case glslang::EOpRayQueryIsLSSHitNV: + typeId = builder.makeBoolType(); + opCode = spv::Op::OpRayQueryIsLSSHitNV; + break; + case glslang::EOpWritePackedPrimitiveIndices4x8NV: + builder.createNoResultOp(spv::Op::OpWritePackedPrimitiveIndices4x8NV, operands); + return 0; + case glslang::EOpEmitMeshTasksEXT: + if (taskPayloadID) + operands.push_back(taskPayloadID); + // As per SPV_EXT_mesh_shader make it a terminating instruction in the current block + builder.makeStatementTerminator(spv::Op::OpEmitMeshTasksEXT, operands, "post-OpEmitMeshTasksEXT"); + return 0; + case glslang::EOpSetMeshOutputsEXT: + builder.createNoResultOp(spv::Op::OpSetMeshOutputsEXT, operands); + return 0; + case glslang::EOpCooperativeMatrixMulAddNV: + opCode = spv::Op::OpCooperativeMatrixMulAddNV; + break; + case glslang::EOpHitObjectTraceRayNV: + builder.createNoResultOp(spv::Op::OpHitObjectTraceRayNV, operands); + return 0; + case glslang::EOpHitObjectTraceRayEXT: + builder.createNoResultOp(spv::Op::OpHitObjectTraceRayEXT, operands); + return 0; + case glslang::EOpHitObjectTraceRayMotionNV: + builder.createNoResultOp(spv::Op::OpHitObjectTraceRayMotionNV, operands); + return 0; + case glslang::EOpHitObjectTraceRayMotionEXT: + builder.createNoResultOp(spv::Op::OpHitObjectTraceRayMotionEXT, operands); + return 0; + case glslang::EOpHitObjectRecordHitNV: + builder.createNoResultOp(spv::Op::OpHitObjectRecordHitNV, operands); + return 0; + case glslang::EOpHitObjectRecordHitMotionNV: + builder.createNoResultOp(spv::Op::OpHitObjectRecordHitMotionNV, operands); + return 0; + case glslang::EOpHitObjectRecordHitWithIndexNV: + builder.createNoResultOp(spv::Op::OpHitObjectRecordHitWithIndexNV, operands); + return 0; + case glslang::EOpHitObjectRecordHitWithIndexMotionNV: + builder.createNoResultOp(spv::Op::OpHitObjectRecordHitWithIndexMotionNV, operands); + return 0; + case glslang::EOpHitObjectRecordMissNV: + builder.createNoResultOp(spv::Op::OpHitObjectRecordMissNV, operands); + return 0; + case glslang::EOpHitObjectRecordMissEXT: + builder.createNoResultOp(spv::Op::OpHitObjectRecordMissEXT, operands); + return 0; + case glslang::EOpHitObjectRecordMissMotionNV: + builder.createNoResultOp(spv::Op::OpHitObjectRecordMissMotionNV, operands); + return 0; + case glslang::EOpHitObjectRecordMissMotionEXT: + builder.createNoResultOp(spv::Op::OpHitObjectRecordMissMotionEXT, operands); + return 0; + case glslang::EOpHitObjectExecuteShaderNV: + builder.createNoResultOp(spv::Op::OpHitObjectExecuteShaderNV, operands); + return 0; + case glslang::EOpHitObjectExecuteShaderEXT: + builder.createNoResultOp(spv::Op::OpHitObjectExecuteShaderEXT, operands); + return 0; + case glslang::EOpHitObjectIsEmptyNV: + typeId = builder.makeBoolType(); + opCode = spv::Op::OpHitObjectIsEmptyNV; + break; + case glslang::EOpHitObjectIsEmptyEXT: + typeId = builder.makeBoolType(); + opCode = spv::Op::OpHitObjectIsEmptyEXT; + break; + case glslang::EOpHitObjectIsMissNV: + typeId = builder.makeBoolType(); + opCode = spv::Op::OpHitObjectIsMissNV; + break; + case glslang::EOpHitObjectIsMissEXT: + typeId = builder.makeBoolType(); + opCode = spv::Op::OpHitObjectIsMissEXT; + break; + case glslang::EOpHitObjectIsHitNV: + typeId = builder.makeBoolType(); + opCode = spv::Op::OpHitObjectIsHitNV; + break; + case glslang::EOpHitObjectIsSphereHitNV: + typeId = builder.makeBoolType(); + opCode = spv::Op::OpHitObjectIsSphereHitNV; + break; + case glslang::EOpHitObjectIsLSSHitNV: + typeId = builder.makeBoolType(); + opCode = spv::Op::OpHitObjectIsLSSHitNV; + break; + case glslang::EOpHitObjectIsHitEXT: + typeId = builder.makeBoolType(); + opCode = spv::Op::OpHitObjectIsHitEXT; + break; + case glslang::EOpHitObjectGetRayTMinNV: + typeId = builder.makeFloatType(32); + opCode = spv::Op::OpHitObjectGetRayTMinNV; + break; + case glslang::EOpHitObjectGetRayTMinEXT: + typeId = builder.makeFloatType(32); + opCode = spv::Op::OpHitObjectGetRayTMinEXT; + break; + case glslang::EOpHitObjectGetRayTMaxNV: + typeId = builder.makeFloatType(32); + opCode = spv::Op::OpHitObjectGetRayTMaxNV; + break; + case glslang::EOpHitObjectGetRayTMaxEXT: + typeId = builder.makeFloatType(32); + opCode = spv::Op::OpHitObjectGetRayTMaxEXT; + break; + case glslang::EOpHitObjectGetRayFlagsEXT: + typeId = builder.makeIntegerType(32, 0); + opCode = spv::Op::OpHitObjectGetRayFlagsEXT; + break; + case glslang::EOpHitObjectGetObjectRayOriginNV: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::Op::OpHitObjectGetObjectRayOriginNV; + break; + case glslang::EOpHitObjectGetObjectRayOriginEXT: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::Op::OpHitObjectGetObjectRayOriginEXT; + break; + case glslang::EOpHitObjectGetObjectRayDirectionNV: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::Op::OpHitObjectGetObjectRayDirectionNV; + break; + case glslang::EOpHitObjectGetObjectRayDirectionEXT: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::Op::OpHitObjectGetObjectRayDirectionEXT; + break; + case glslang::EOpHitObjectGetWorldRayOriginNV: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::Op::OpHitObjectGetWorldRayOriginNV; + break; + case glslang::EOpHitObjectGetWorldRayOriginEXT: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::Op::OpHitObjectGetWorldRayOriginEXT; + break; + case glslang::EOpHitObjectGetWorldRayDirectionNV: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::Op::OpHitObjectGetWorldRayDirectionNV; + break; + case glslang::EOpHitObjectGetWorldRayDirectionEXT: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::Op::OpHitObjectGetWorldRayDirectionEXT; + break; + case glslang::EOpHitObjectGetWorldToObjectNV: + typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3); + opCode = spv::Op::OpHitObjectGetWorldToObjectNV; + break; + case glslang::EOpHitObjectGetWorldToObjectEXT: + typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3); + opCode = spv::Op::OpHitObjectGetWorldToObjectEXT; + break; + case glslang::EOpHitObjectGetObjectToWorldNV: + typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3); + opCode = spv::Op::OpHitObjectGetObjectToWorldNV; + break; + case glslang::EOpHitObjectGetObjectToWorldEXT: + typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3); + opCode = spv::Op::OpHitObjectGetObjectToWorldEXT; + break; + case glslang::EOpHitObjectGetInstanceCustomIndexNV: + typeId = builder.makeIntegerType(32, 1); + opCode = spv::Op::OpHitObjectGetInstanceCustomIndexNV; + break; + case glslang::EOpHitObjectGetInstanceCustomIndexEXT: + typeId = builder.makeIntegerType(32, 1); + opCode = spv::Op::OpHitObjectGetInstanceCustomIndexEXT; + break; + case glslang::EOpHitObjectGetInstanceIdNV: + typeId = builder.makeIntegerType(32, 1); + opCode = spv::Op::OpHitObjectGetInstanceIdNV; + break; + case glslang::EOpHitObjectGetInstanceIdEXT: + typeId = builder.makeIntegerType(32, 1); + opCode = spv::Op::OpHitObjectGetInstanceIdEXT; + break; + case glslang::EOpHitObjectGetGeometryIndexNV: + typeId = builder.makeIntegerType(32, 1); + opCode = spv::Op::OpHitObjectGetGeometryIndexNV; + break; + case glslang::EOpHitObjectGetGeometryIndexEXT: + typeId = builder.makeIntegerType(32, 1); + opCode = spv::Op::OpHitObjectGetGeometryIndexEXT; + break; + case glslang::EOpHitObjectGetPrimitiveIndexNV: + typeId = builder.makeIntegerType(32, 1); + opCode = spv::Op::OpHitObjectGetPrimitiveIndexNV; + break; + case glslang::EOpHitObjectGetPrimitiveIndexEXT: + typeId = builder.makeIntegerType(32, 1); + opCode = spv::Op::OpHitObjectGetPrimitiveIndexEXT; + break; + case glslang::EOpHitObjectGetHitKindNV: + typeId = builder.makeIntegerType(32, 0); + opCode = spv::Op::OpHitObjectGetHitKindNV; + break; + case glslang::EOpHitObjectGetHitKindEXT: + typeId = builder.makeIntegerType(32, 0); + opCode = spv::Op::OpHitObjectGetHitKindEXT; + break; + case glslang::EOpHitObjectGetCurrentTimeNV: + typeId = builder.makeFloatType(32); + opCode = spv::Op::OpHitObjectGetCurrentTimeNV; + break; + case glslang::EOpHitObjectGetCurrentTimeEXT: + typeId = builder.makeFloatType(32); + opCode = spv::Op::OpHitObjectGetCurrentTimeEXT; + break; + case glslang::EOpHitObjectGetShaderBindingTableRecordIndexNV: + typeId = builder.makeIntegerType(32, 0); + opCode = spv::Op::OpHitObjectGetShaderBindingTableRecordIndexNV; + return 0; + case glslang::EOpHitObjectGetShaderBindingTableRecordIndexEXT: + typeId = builder.makeIntegerType(32, 0); + opCode = spv::Op::OpHitObjectGetShaderBindingTableRecordIndexEXT; + return 0; + case glslang::EOpHitObjectGetAttributesNV: + builder.createNoResultOp(spv::Op::OpHitObjectGetAttributesNV, operands); + return 0; + case glslang::EOpHitObjectGetAttributesEXT: + builder.createNoResultOp(spv::Op::OpHitObjectGetAttributesEXT, operands); + return 0; + case glslang::EOpHitObjectRecordFromQueryEXT: + builder.createNoResultOp(spv::Op::OpHitObjectRecordFromQueryEXT, operands); + return 0; + case glslang::EOpHitObjectGetShaderRecordBufferHandleNV: + typeId = builder.makeVectorType(builder.makeUintType(32), 2); + opCode = spv::Op::OpHitObjectGetShaderRecordBufferHandleNV; + break; + case glslang::EOpHitObjectGetClusterIdNV: + typeId = builder.makeIntegerType(32, 1); + opCode = spv::Op::OpHitObjectGetClusterIdNV; + break; + case glslang::EOpHitObjectGetShaderRecordBufferHandleEXT: + typeId = builder.makeVectorType(builder.makeUintType(32), 2); + opCode = spv::Op::OpHitObjectGetShaderRecordBufferHandleEXT; + break; + case glslang::EOpHitObjectSetShaderBindingTableRecordIndexEXT: + builder.createNoResultOp(spv::Op::OpHitObjectSetShaderBindingTableRecordIndexEXT, operands); + return 0; + case glslang::EOpReorderThreadNV: { + if (operands.size() == 2) { + builder.createNoResultOp(spv::Op::OpReorderThreadWithHintNV, operands); + } else { + builder.createNoResultOp(spv::Op::OpReorderThreadWithHitObjectNV, operands); + } + return 0; + } + case glslang::EOpReorderThreadEXT: { + if (operands.size() == 2) { + builder.createNoResultOp(spv::Op::OpReorderThreadWithHintEXT, operands); + } else { + builder.createNoResultOp(spv::Op::OpReorderThreadWithHitObjectEXT, operands); + } + return 0; + } + + case glslang::EOpHitObjectReorderExecuteEXT: { + if (operands.size() == 2) { + builder.createNoResultOp(spv::Op::OpHitObjectReorderExecuteShaderEXT, operands); + } else { + // GLSL intrinsic is + // hitObjectReorderExecuteEXT(hitObjectEXT hitObject, uint hint, uint bits,int payload) while + // SPIRV is hitObject id , payload id, optional hint id, optional bits id hence reorder operands + builder.createNoResultOp(spv::Op::OpHitObjectReorderExecuteShaderEXT, {operands[0], operands[3], operands[1], operands[2]}); + } + return 0; + } + + case glslang::EOpHitObjectTraceReorderExecuteEXT: { + if (operands.size() == 12) { + builder.createNoResultOp(spv::Op::OpHitObjectTraceReorderExecuteEXT, operands); + } else { + std::vector argOperands; + std::copy(operands.begin(), operands.begin() + 11, std::back_inserter(argOperands)); + argOperands.push_back(operands[13]); + argOperands.push_back(operands[11]); + argOperands.push_back(operands[12]); + builder.createNoResultOp(spv::Op::OpHitObjectTraceReorderExecuteEXT, argOperands); + } + return 0; + } + case glslang::EOpHitObjectTraceMotionReorderExecuteEXT: { + if (operands.size() == 13) { + builder.createNoResultOp(spv::Op::OpHitObjectTraceMotionReorderExecuteEXT, operands); + } else { + std::vector argOperands; + std::copy(operands.begin(), operands.begin() + 12, std::back_inserter(argOperands)); + argOperands.push_back(operands[14]); + argOperands.push_back(operands[12]); + argOperands.push_back(operands[13]); + builder.createNoResultOp(spv::Op::OpHitObjectTraceMotionReorderExecuteEXT, argOperands); + } + return 0; + } + case glslang::EOpImageSampleWeightedQCOM: + typeId = builder.makeVectorType(builder.makeFloatType(32), 4); + opCode = spv::Op::OpImageSampleWeightedQCOM; + addImageProcessingQCOMDecoration(operands[2], spv::Decoration::WeightTextureQCOM); + break; + case glslang::EOpImageBoxFilterQCOM: + typeId = builder.makeVectorType(builder.makeFloatType(32), 4); + opCode = spv::Op::OpImageBoxFilterQCOM; + break; + case glslang::EOpImageBlockMatchSADQCOM: + typeId = builder.makeVectorType(builder.makeFloatType(32), 4); + opCode = spv::Op::OpImageBlockMatchSADQCOM; + addImageProcessingQCOMDecoration(operands[0], spv::Decoration::BlockMatchTextureQCOM); + addImageProcessingQCOMDecoration(operands[2], spv::Decoration::BlockMatchTextureQCOM); + break; + case glslang::EOpImageBlockMatchSSDQCOM: + typeId = builder.makeVectorType(builder.makeFloatType(32), 4); + opCode = spv::Op::OpImageBlockMatchSSDQCOM; + addImageProcessingQCOMDecoration(operands[0], spv::Decoration::BlockMatchTextureQCOM); + addImageProcessingQCOMDecoration(operands[2], spv::Decoration::BlockMatchTextureQCOM); + break; + + case glslang::EOpFetchMicroTriangleVertexBarycentricNV: + typeId = builder.makeVectorType(builder.makeFloatType(32), 2); + opCode = spv::Op::OpFetchMicroTriangleVertexBarycentricNV; + break; + + case glslang::EOpFetchMicroTriangleVertexPositionNV: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::Op::OpFetchMicroTriangleVertexPositionNV; + break; + + case glslang::EOpImageBlockMatchWindowSSDQCOM: + typeId = builder.makeVectorType(builder.makeFloatType(32), 4); + opCode = spv::Op::OpImageBlockMatchWindowSSDQCOM; + addImageProcessing2QCOMDecoration(operands[0], false); + addImageProcessing2QCOMDecoration(operands[2], false); + break; + case glslang::EOpImageBlockMatchWindowSADQCOM: + typeId = builder.makeVectorType(builder.makeFloatType(32), 4); + opCode = spv::Op::OpImageBlockMatchWindowSADQCOM; + addImageProcessing2QCOMDecoration(operands[0], false); + addImageProcessing2QCOMDecoration(operands[2], false); + break; + case glslang::EOpImageBlockMatchGatherSSDQCOM: + typeId = builder.makeVectorType(builder.makeFloatType(32), 4); + opCode = spv::Op::OpImageBlockMatchGatherSSDQCOM; + addImageProcessing2QCOMDecoration(operands[0], true); + addImageProcessing2QCOMDecoration(operands[2], true); + break; + case glslang::EOpImageBlockMatchGatherSADQCOM: + typeId = builder.makeVectorType(builder.makeFloatType(32), 4); + opCode = spv::Op::OpImageBlockMatchGatherSADQCOM; + addImageProcessing2QCOMDecoration(operands[0], true); + addImageProcessing2QCOMDecoration(operands[2], true); + break; + case glslang::EOpCreateTensorLayoutNV: + return builder.createOp(spv::Op::OpCreateTensorLayoutNV, typeId, std::vector{}); + case glslang::EOpCreateTensorViewNV: + return builder.createOp(spv::Op::OpCreateTensorViewNV, typeId, std::vector{}); + case glslang::EOpTensorLayoutSetBlockSizeNV: + opCode = spv::Op::OpTensorLayoutSetBlockSizeNV; + break; + case glslang::EOpTensorLayoutSetDimensionNV: + opCode = spv::Op::OpTensorLayoutSetDimensionNV; + break; + case glslang::EOpTensorLayoutSetStrideNV: + opCode = spv::Op::OpTensorLayoutSetStrideNV; + break; + case glslang::EOpTensorLayoutSliceNV: + opCode = spv::Op::OpTensorLayoutSliceNV; + break; + case glslang::EOpTensorLayoutSetClampValueNV: + opCode = spv::Op::OpTensorLayoutSetClampValueNV; + break; + case glslang::EOpTensorViewSetDimensionNV: + opCode = spv::Op::OpTensorViewSetDimensionNV; + break; + case glslang::EOpTensorViewSetStrideNV: + opCode = spv::Op::OpTensorViewSetStrideNV; + break; + case glslang::EOpTensorViewSetClipNV: + opCode = spv::Op::OpTensorViewSetClipNV; + break; + default: + return 0; + } + + spv::Id id = 0; + if (libCall >= 0) { + // Use an extended instruction from the standard library. + // Construct the call arguments, without modifying the original operands vector. + // We might need the remaining arguments, e.g. in the EOpFrexp case. + std::vector callArguments(operands.begin(), operands.begin() + consumedOperands); + id = builder.createBuiltinCall(typeId, extBuiltins >= 0 ? extBuiltins : stdBuiltins, libCall, callArguments); + } else if (opCode == spv::Op::OpDot && !isFloat) { + // int dot(int, int) + // NOTE: never called for scalar/vector1, this is turned into simple mul before this can be reached + const int componentCount = builder.getNumComponents(operands[0]); + spv::Id mulOp = builder.createBinOp(spv::Op::OpIMul, builder.getTypeId(operands[0]), operands[0], operands[1]); + builder.setPrecision(mulOp, precision); + id = builder.createCompositeExtract(mulOp, typeId, 0); + for (int i = 1; i < componentCount; ++i) { + builder.setPrecision(id, precision); + id = builder.createBinOp(spv::Op::OpIAdd, typeId, id, builder.createCompositeExtract(mulOp, typeId, i)); + } + } else { + switch (consumedOperands) { + case 0: + // should all be handled by visitAggregate and createNoArgOperation + assert(0); + return 0; + case 1: + // should all be handled by createUnaryOperation + assert(0); + return 0; + case 2: + id = builder.createBinOp(opCode, typeId, operands[0], operands[1]); + break; + default: + // anything 3 or over doesn't have l-value operands, so all should be consumed + assert(consumedOperands == operands.size()); + id = builder.createOp(opCode, typeId, operands); + break; + } + } + + // Decode the return types that were structures + switch (op) { + case glslang::EOpAddCarry: + case glslang::EOpSubBorrow: + builder.createStore(builder.createCompositeExtract(id, typeId0, 1), operands[2]); + id = builder.createCompositeExtract(id, typeId0, 0); + break; + case glslang::EOpUMulExtended: + case glslang::EOpIMulExtended: + builder.createStore(builder.createCompositeExtract(id, typeId0, 0), operands[3]); + builder.createStore(builder.createCompositeExtract(id, typeId0, 1), operands[2]); + break; + case glslang::EOpModf: + { + assert(operands.size() == 2); + builder.createStore(builder.createCompositeExtract(id, typeId0, 1), operands[1]); + id = builder.createCompositeExtract(id, typeId0, 0); + } + break; + case glslang::EOpFrexp: + { + assert(operands.size() == 2); + if (builder.isFloatType(builder.getScalarTypeId(typeId1))) { + // "exp" is floating-point type (from HLSL intrinsic) + spv::Id member1 = builder.createCompositeExtract(id, frexpIntType, 1); + member1 = builder.createUnaryOp(spv::Op::OpConvertSToF, typeId1, member1); + builder.createStore(member1, operands[1]); + } else + // "exp" is integer type (from GLSL built-in function) + builder.createStore(builder.createCompositeExtract(id, frexpIntType, 1), operands[1]); + id = builder.createCompositeExtract(id, typeId0, 0); + } + break; + default: + break; + } + + return builder.setPrecision(id, precision); +} + +// Intrinsics with no arguments (or no return value, and no precision). +spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId) +{ + // GLSL memory barriers use queuefamily scope in new model, device scope in old model + spv::Scope memoryBarrierScope = glslangIntermediate->usingVulkanMemoryModel() ? + spv::Scope::QueueFamilyKHR : spv::Scope::Device; + + switch (op) { + case glslang::EOpBarrier: + if (glslangIntermediate->getStage() == EShLangTessControl) { + if (glslangIntermediate->usingVulkanMemoryModel()) { + builder.createControlBarrier(spv::Scope::Workgroup, spv::Scope::Workgroup, + spv::MemorySemanticsMask::OutputMemoryKHR | + spv::MemorySemanticsMask::AcquireRelease); + builder.addCapability(spv::Capability::VulkanMemoryModelKHR); + } else { + builder.createControlBarrier(spv::Scope::Workgroup, spv::Scope::Invocation, spv::MemorySemanticsMask::MaskNone); + } + } else { + builder.createControlBarrier(spv::Scope::Workgroup, spv::Scope::Workgroup, + spv::MemorySemanticsMask::WorkgroupMemory | + spv::MemorySemanticsMask::AcquireRelease); + } + return 0; + case glslang::EOpMemoryBarrier: + builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsAllMemory | + spv::MemorySemanticsMask::AcquireRelease); + return 0; + case glslang::EOpMemoryBarrierBuffer: + builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsMask::UniformMemory | + spv::MemorySemanticsMask::AcquireRelease); + return 0; + case glslang::EOpMemoryBarrierShared: + builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsMask::WorkgroupMemory | + spv::MemorySemanticsMask::AcquireRelease); + return 0; + case glslang::EOpGroupMemoryBarrier: + builder.createMemoryBarrier(spv::Scope::Workgroup, spv::MemorySemanticsAllMemory | + spv::MemorySemanticsMask::AcquireRelease); + return 0; + case glslang::EOpMemoryBarrierAtomicCounter: + builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsMask::AtomicCounterMemory | + spv::MemorySemanticsMask::AcquireRelease); + return 0; + case glslang::EOpMemoryBarrierImage: + builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsMask::ImageMemory | + spv::MemorySemanticsMask::AcquireRelease); + return 0; + case glslang::EOpAllMemoryBarrierWithGroupSync: + builder.createControlBarrier(spv::Scope::Workgroup, spv::Scope::Device, + spv::MemorySemanticsAllMemory | + spv::MemorySemanticsMask::AcquireRelease); + return 0; + case glslang::EOpDeviceMemoryBarrier: + builder.createMemoryBarrier(spv::Scope::Device, spv::MemorySemanticsMask::UniformMemory | + spv::MemorySemanticsMask::ImageMemory | + spv::MemorySemanticsMask::AcquireRelease); + return 0; + case glslang::EOpDeviceMemoryBarrierWithGroupSync: + builder.createControlBarrier(spv::Scope::Workgroup, spv::Scope::Device, spv::MemorySemanticsMask::UniformMemory | + spv::MemorySemanticsMask::ImageMemory | + spv::MemorySemanticsMask::AcquireRelease); + return 0; + case glslang::EOpWorkgroupMemoryBarrier: + builder.createMemoryBarrier(spv::Scope::Workgroup, spv::MemorySemanticsMask::WorkgroupMemory | + spv::MemorySemanticsMask::AcquireRelease); + return 0; + case glslang::EOpWorkgroupMemoryBarrierWithGroupSync: + builder.createControlBarrier(spv::Scope::Workgroup, spv::Scope::Workgroup, + spv::MemorySemanticsMask::WorkgroupMemory | + spv::MemorySemanticsMask::AcquireRelease); + return 0; + case glslang::EOpSubgroupBarrier: + builder.createControlBarrier(spv::Scope::Subgroup, spv::Scope::Subgroup, spv::MemorySemanticsAllMemory | + spv::MemorySemanticsMask::AcquireRelease); + return spv::NoResult; + case glslang::EOpSubgroupMemoryBarrier: + builder.createMemoryBarrier(spv::Scope::Subgroup, spv::MemorySemanticsAllMemory | + spv::MemorySemanticsMask::AcquireRelease); + return spv::NoResult; + case glslang::EOpSubgroupMemoryBarrierBuffer: + builder.createMemoryBarrier(spv::Scope::Subgroup, spv::MemorySemanticsMask::UniformMemory | + spv::MemorySemanticsMask::AcquireRelease); + return spv::NoResult; + case glslang::EOpSubgroupMemoryBarrierImage: + builder.createMemoryBarrier(spv::Scope::Subgroup, spv::MemorySemanticsMask::ImageMemory | + spv::MemorySemanticsMask::AcquireRelease); + return spv::NoResult; + case glslang::EOpSubgroupMemoryBarrierShared: + builder.createMemoryBarrier(spv::Scope::Subgroup, spv::MemorySemanticsMask::WorkgroupMemory | + spv::MemorySemanticsMask::AcquireRelease); + return spv::NoResult; + + case glslang::EOpEmitVertex: + builder.createNoResultOp(spv::Op::OpEmitVertex); + return 0; + case glslang::EOpEndPrimitive: + builder.createNoResultOp(spv::Op::OpEndPrimitive); + return 0; + + case glslang::EOpSubgroupElect: { + std::vector operands; + return createSubgroupOperation(op, typeId, operands, glslang::EbtVoid); + } + case glslang::EOpTime: + { + std::vector args; // Dummy arguments + spv::Id id = builder.createBuiltinCall(typeId, getExtBuiltins(spv::E_SPV_AMD_gcn_shader), spv::TimeAMD, args); + return builder.setPrecision(id, precision); + } + case glslang::EOpIgnoreIntersectionNV: + builder.createNoResultOp(spv::Op::OpIgnoreIntersectionNV); + return 0; + case glslang::EOpTerminateRayNV: + builder.createNoResultOp(spv::Op::OpTerminateRayNV); + return 0; + case glslang::EOpRayQueryInitialize: + builder.createNoResultOp(spv::Op::OpRayQueryInitializeKHR); + return 0; + case glslang::EOpRayQueryTerminate: + builder.createNoResultOp(spv::Op::OpRayQueryTerminateKHR); + return 0; + case glslang::EOpRayQueryGenerateIntersection: + builder.createNoResultOp(spv::Op::OpRayQueryGenerateIntersectionKHR); + return 0; + case glslang::EOpRayQueryConfirmIntersection: + builder.createNoResultOp(spv::Op::OpRayQueryConfirmIntersectionKHR); + return 0; + case glslang::EOpBeginInvocationInterlock: + builder.createNoResultOp(spv::Op::OpBeginInvocationInterlockEXT); + return 0; + case glslang::EOpEndInvocationInterlock: + builder.createNoResultOp(spv::Op::OpEndInvocationInterlockEXT); + return 0; + + case glslang::EOpIsHelperInvocation: + { + std::vector args; // Dummy arguments + builder.addExtension(spv::E_SPV_EXT_demote_to_helper_invocation); + builder.addCapability(spv::Capability::DemoteToHelperInvocationEXT); + return builder.createOp(spv::Op::OpIsHelperInvocationEXT, typeId, args); + } + + case glslang::EOpReadClockSubgroupKHR: { + std::vector args; + args.push_back(builder.makeUintConstant(spv::Scope::Subgroup)); + builder.addExtension(spv::E_SPV_KHR_shader_clock); + builder.addCapability(spv::Capability::ShaderClockKHR); + return builder.createOp(spv::Op::OpReadClockKHR, typeId, args); + } + + case glslang::EOpReadClockDeviceKHR: { + std::vector args; + args.push_back(builder.makeUintConstant(spv::Scope::Device)); + builder.addExtension(spv::E_SPV_KHR_shader_clock); + builder.addCapability(spv::Capability::ShaderClockKHR); + return builder.createOp(spv::Op::OpReadClockKHR, typeId, args); + } + case glslang::EOpStencilAttachmentReadEXT: + case glslang::EOpDepthAttachmentReadEXT: + { + builder.addExtension(spv::E_SPV_EXT_shader_tile_image); + + spv::Decoration precision; + spv::Op spv_op; + if (op == glslang::EOpStencilAttachmentReadEXT) + { + precision = spv::Decoration::RelaxedPrecision; + spv_op = spv::Op::OpStencilAttachmentReadEXT; + builder.addCapability(spv::Capability::TileImageStencilReadAccessEXT); + } + else + { + precision = spv::NoPrecision; + spv_op = spv::Op::OpDepthAttachmentReadEXT; + builder.addCapability(spv::Capability::TileImageDepthReadAccessEXT); + } + + std::vector args; // Dummy args + spv::Id result = builder.createOp(spv_op, typeId, args); + return builder.setPrecision(result, precision); + } + default: + break; + } + + logger->missingFunctionality("unknown operation with no arguments"); + + return 0; +} + +spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol) +{ + auto iter = symbolValues.find(symbol->getId()); + spv::Id id; + if (symbolValues.end() != iter) { + id = iter->second; + return id; + } + + // it was not found, create it + spv::BuiltIn builtIn = TranslateBuiltInDecoration(symbol->getQualifier().builtIn, false); + auto forcedType = getForcedType(symbol->getQualifier().builtIn, symbol->getType()); + + // There are pairs of symbols that map to the same SPIR-V built-in: + // gl_ObjectToWorldEXT and gl_ObjectToWorld3x4EXT, and gl_WorldToObjectEXT + // and gl_WorldToObject3x4EXT. SPIR-V forbids having two OpVariables + // with the same BuiltIn in the same storage class, so we must re-use one. + const bool mayNeedToReuseBuiltIn = + builtIn == spv::BuiltIn::ObjectToWorldKHR || + builtIn == spv::BuiltIn::WorldToObjectKHR; + + if (mayNeedToReuseBuiltIn) { + auto iter = builtInVariableIds.find(uint32_t(builtIn)); + if (builtInVariableIds.end() != iter) { + id = iter->second; + symbolValues[symbol->getId()] = id; + if (forcedType.second != spv::NoType) + forceType[id] = forcedType.second; + return id; + } + } + + if (symbol->getBasicType() == glslang::EbtFunction) { + return 0; + } + + id = createSpvVariable(symbol, forcedType.first); + + if (mayNeedToReuseBuiltIn) { + builtInVariableIds.insert({uint32_t(builtIn), id}); + } + + symbolValues[symbol->getId()] = id; + if (forcedType.second != spv::NoType) + forceType[id] = forcedType.second; + + if (symbol->getBasicType() != glslang::EbtBlock) { + builder.addDecoration(id, TranslatePrecisionDecoration(symbol->getType())); + builder.addDecoration(id, TranslateInterpolationDecoration(symbol->getType().getQualifier())); + builder.addDecoration(id, TranslateAuxiliaryStorageDecoration(symbol->getType().getQualifier())); + addMeshNVDecoration(id, /*member*/ -1, symbol->getType().getQualifier()); + if (symbol->getQualifier().hasComponent()) + builder.addDecoration(id, spv::Decoration::Component, symbol->getQualifier().layoutComponent); + if (symbol->getQualifier().hasIndex()) + builder.addDecoration(id, spv::Decoration::Index, symbol->getQualifier().layoutIndex); + if (symbol->getType().getQualifier().hasSpecConstantId()) + builder.addDecoration(id, spv::Decoration::SpecId, symbol->getType().getQualifier().layoutSpecConstantId); + // atomic counters use this: + if (symbol->getQualifier().hasOffset()) + builder.addDecoration(id, spv::Decoration::Offset, symbol->getQualifier().layoutOffset); + } + + if (symbol->getQualifier().hasLocation()) { + if (!(glslangIntermediate->isRayTracingStage() && + (glslangIntermediate->IsRequestedExtension(glslang::E_GL_EXT_ray_tracing) || + glslangIntermediate->IsRequestedExtension(glslang::E_GL_NV_shader_invocation_reorder) || + glslangIntermediate->IsRequestedExtension(glslang::E_GL_EXT_shader_invocation_reorder)) + && (builder.getStorageClass(id) == spv::StorageClass::RayPayloadKHR || + builder.getStorageClass(id) == spv::StorageClass::IncomingRayPayloadKHR || + builder.getStorageClass(id) == spv::StorageClass::CallableDataKHR || + builder.getStorageClass(id) == spv::StorageClass::IncomingCallableDataKHR || + builder.getStorageClass(id) == spv::StorageClass::HitObjectAttributeEXT || + builder.getStorageClass(id) == spv::StorageClass::HitObjectAttributeNV))) { + // Location values are used to link TraceRayKHR/ExecuteCallableKHR/HitObjectGetAttributesNV + // to corresponding variables but are not valid in SPIRV since they are supported only + // for Input/Output Storage classes. + builder.addDecoration(id, spv::Decoration::Location, symbol->getQualifier().layoutLocation); + } + } + + builder.addDecoration(id, TranslateInvariantDecoration(symbol->getType().getQualifier())); + if (symbol->getQualifier().hasStream() && glslangIntermediate->isMultiStream()) { + builder.addCapability(spv::Capability::GeometryStreams); + builder.addDecoration(id, spv::Decoration::Stream, symbol->getQualifier().layoutStream); + } + if (symbol->getQualifier().hasSet()) + builder.addDecoration(id, spv::Decoration::DescriptorSet, symbol->getQualifier().layoutSet); + else if (IsDescriptorResource(symbol->getType())) { + // default to 0 + builder.addDecoration(id, spv::Decoration::DescriptorSet, 0); + } + if (symbol->getQualifier().hasBinding()) + builder.addDecoration(id, spv::Decoration::Binding, symbol->getQualifier().layoutBinding); + else if (IsDescriptorResource(symbol->getType())) { + // default to 0 + builder.addDecoration(id, spv::Decoration::Binding, 0); + } + if (symbol->getQualifier().hasAttachment()) + builder.addDecoration(id, spv::Decoration::InputAttachmentIndex, symbol->getQualifier().layoutAttachment); + if (glslangIntermediate->getXfbMode()) { + builder.addCapability(spv::Capability::TransformFeedback); + if (symbol->getQualifier().hasXfbBuffer()) { + builder.addDecoration(id, spv::Decoration::XfbBuffer, symbol->getQualifier().layoutXfbBuffer); + unsigned stride = glslangIntermediate->getXfbStride(symbol->getQualifier().layoutXfbBuffer); + if (stride != glslang::TQualifier::layoutXfbStrideEnd) + builder.addDecoration(id, spv::Decoration::XfbStride, stride); + } + if (symbol->getQualifier().hasXfbOffset()) + builder.addDecoration(id, spv::Decoration::Offset, symbol->getQualifier().layoutXfbOffset); + } + + // add built-in variable decoration + if (builtIn != spv::BuiltIn::Max) { + // WorkgroupSize deprecated in spirv1.6 + if (glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_6 || + builtIn != spv::BuiltIn::WorkgroupSize) + builder.addDecoration(id, spv::Decoration::BuiltIn, (int)builtIn); + } + + // Add volatile decoration to HelperInvocation for spirv1.6 and beyond + if (builtIn == spv::BuiltIn::HelperInvocation && + !glslangIntermediate->usingVulkanMemoryModel() && + glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6) { + builder.addDecoration(id, spv::Decoration::Volatile); + } + + // Subgroup builtins which have input storage class are volatile for ray tracing stages. + if (symbol->getType().isImage() || symbol->getQualifier().isPipeInput()) { + std::vector memory; + TranslateMemoryDecoration(symbol->getType().getQualifier(), memory, + glslangIntermediate->usingVulkanMemoryModel()); + for (unsigned int i = 0; i < memory.size(); ++i) + builder.addDecoration(id, memory[i]); + } + + if (builtIn == spv::BuiltIn::SampleMask) { + spv::Decoration decoration; + // GL_NV_sample_mask_override_coverage extension + if (glslangIntermediate->getLayoutOverrideCoverage()) + decoration = spv::Decoration::OverrideCoverageNV; + else + decoration = spv::Decoration::Max; + builder.addDecoration(id, decoration); + if (decoration != spv::Decoration::Max) { + builder.addCapability(spv::Capability::SampleMaskOverrideCoverageNV); + builder.addExtension(spv::E_SPV_NV_sample_mask_override_coverage); + } + } + else if (builtIn == spv::BuiltIn::Layer) { + // SPV_NV_viewport_array2 extension + if (symbol->getQualifier().layoutViewportRelative) { + builder.addDecoration(id, spv::Decoration::ViewportRelativeNV); + builder.addCapability(spv::Capability::ShaderViewportMaskNV); + builder.addExtension(spv::E_SPV_NV_viewport_array2); + } + if (symbol->getQualifier().layoutSecondaryViewportRelativeOffset != -2048) { + builder.addDecoration(id, spv::Decoration::SecondaryViewportRelativeNV, + symbol->getQualifier().layoutSecondaryViewportRelativeOffset); + builder.addCapability(spv::Capability::ShaderStereoViewNV); + builder.addExtension(spv::E_SPV_NV_stereo_view_rendering); + } + } + + if (symbol->getQualifier().layoutPassthrough) { + builder.addDecoration(id, spv::Decoration::PassthroughNV); + builder.addCapability(spv::Capability::GeometryShaderPassthroughNV); + builder.addExtension(spv::E_SPV_NV_geometry_shader_passthrough); + } + if (symbol->getQualifier().pervertexNV) { + builder.addDecoration(id, spv::Decoration::PerVertexNV); + builder.addCapability(spv::Capability::FragmentBarycentricNV); + builder.addExtension(spv::E_SPV_NV_fragment_shader_barycentric); + } + + if (symbol->getQualifier().pervertexEXT) { + builder.addDecoration(id, spv::Decoration::PerVertexKHR); + builder.addCapability(spv::Capability::FragmentBarycentricKHR); + builder.addExtension(spv::E_SPV_KHR_fragment_shader_barycentric); + } + + if (glslangIntermediate->getHlslFunctionality1() && symbol->getType().getQualifier().semanticName != nullptr) { + builder.addExtension("SPV_GOOGLE_hlsl_functionality1"); + builder.addDecoration(id, spv::Decoration::HlslSemanticGOOGLE, + symbol->getType().getQualifier().semanticName); + } + + if (symbol->isReference()) { + builder.addDecoration(id, symbol->getType().getQualifier().restrict ? + spv::Decoration::RestrictPointerEXT : spv::Decoration::AliasedPointerEXT); + } + + // Add SPIR-V decorations (GL_EXT_spirv_intrinsics) + if (symbol->getType().getQualifier().hasSpirvDecorate()) + applySpirvDecorate(symbol->getType(), id, {}); + + return id; +} + +// add per-primitive, per-view. per-task decorations to a struct member (member >= 0) or an object +void TGlslangToSpvTraverser::addMeshNVDecoration(spv::Id id, int member, const glslang::TQualifier& qualifier) +{ + bool isMeshShaderExt = (glslangIntermediate->getRequestedExtensions().find(glslang::E_GL_EXT_mesh_shader) != + glslangIntermediate->getRequestedExtensions().end()); + + if (member >= 0) { + if (qualifier.perPrimitiveNV) { + // Need to add capability/extension for fragment shader. + // Mesh shader already adds this by default. + if (glslangIntermediate->getStage() == EShLangFragment) { + if(isMeshShaderExt) { + builder.addCapability(spv::Capability::MeshShadingEXT); + builder.addExtension(spv::E_SPV_EXT_mesh_shader); + } else { + builder.addCapability(spv::Capability::MeshShadingNV); + builder.addExtension(spv::E_SPV_NV_mesh_shader); + } + } + builder.addMemberDecoration(id, (unsigned)member, spv::Decoration::PerPrimitiveNV); + } + if (qualifier.perViewNV) + builder.addMemberDecoration(id, (unsigned)member, spv::Decoration::PerViewNV); + if (qualifier.perTaskNV) + builder.addMemberDecoration(id, (unsigned)member, spv::Decoration::PerTaskNV); + } else { + if (qualifier.perPrimitiveNV) { + // Need to add capability/extension for fragment shader. + // Mesh shader already adds this by default. + if (glslangIntermediate->getStage() == EShLangFragment) { + if(isMeshShaderExt) { + builder.addCapability(spv::Capability::MeshShadingEXT); + builder.addExtension(spv::E_SPV_EXT_mesh_shader); + } else { + builder.addCapability(spv::Capability::MeshShadingNV); + builder.addExtension(spv::E_SPV_NV_mesh_shader); + } + } + builder.addDecoration(id, spv::Decoration::PerPrimitiveNV); + } + if (qualifier.perViewNV) + builder.addDecoration(id, spv::Decoration::PerViewNV); + if (qualifier.perTaskNV) + builder.addDecoration(id, spv::Decoration::PerTaskNV); + } +} + +bool TGlslangToSpvTraverser::hasQCOMImageProceessingDecoration(spv::Id id, spv::Decoration decor) +{ + std::vector &decoVec = idToQCOMDecorations[id]; + for ( auto d : decoVec ) { + if ( d == decor ) + return true; + } + return false; +} + +void TGlslangToSpvTraverser::addImageProcessingQCOMDecoration(spv::Id id, spv::Decoration decor) +{ + spv::Op opc = builder.getOpCode(id); + if (opc == spv::Op::OpSampledImage) { + id = builder.getIdOperand(id, 0); + opc = builder.getOpCode(id); + } + + if (opc == spv::Op::OpLoad) { + spv::Id texid = builder.getIdOperand(id, 0); + if (!hasQCOMImageProceessingDecoration(texid, decor)) {// + builder.addDecoration(texid, decor); + idToQCOMDecorations[texid].push_back(decor); + } + } +} + +void TGlslangToSpvTraverser::addImageProcessing2QCOMDecoration(spv::Id id, bool isForGather) +{ + if (isForGather) { + return addImageProcessingQCOMDecoration(id, spv::Decoration::BlockMatchTextureQCOM); + } + + auto addDecor = + [this](spv::Id id, spv::Decoration decor) { + spv::Op tsopc = this->builder.getOpCode(id); + if (tsopc == spv::Op::OpLoad) { + spv::Id tsid = this->builder.getIdOperand(id, 0); + if (this->glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_4) { + assert(iOSet.count(tsid) > 0); + } + if (!hasQCOMImageProceessingDecoration(tsid, decor)) { + this->builder.addDecoration(tsid, decor); + idToQCOMDecorations[tsid].push_back(decor); + } + } + }; + + spv::Op opc = builder.getOpCode(id); + bool isInterfaceObject = (opc != spv::Op::OpSampledImage); + + if (!isInterfaceObject) { + addDecor(builder.getIdOperand(id, 0), spv::Decoration::BlockMatchTextureQCOM); + addDecor(builder.getIdOperand(id, 1), spv::Decoration::BlockMatchSamplerQCOM); + } else { + addDecor(id, spv::Decoration::BlockMatchTextureQCOM); + addDecor(id, spv::Decoration::BlockMatchSamplerQCOM); + } +} + +// Make a full tree of instructions to build a SPIR-V specialization constant, +// or regular constant if possible. +// +// TBD: this is not yet done, nor verified to be the best design, it does do the leaf symbols though +// +// Recursively walk the nodes. The nodes form a tree whose leaves are +// regular constants, which themselves are trees that createSpvConstant() +// recursively walks. So, this function walks the "top" of the tree: +// - emit specialization constant-building instructions for specConstant +// - when running into a non-spec-constant, switch to createSpvConstant() +spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& node) +{ + assert(node.getQualifier().isConstant()); + + // Handle front-end constants first (non-specialization constants). + if (! node.getQualifier().specConstant) { + // hand off to the non-spec-constant path + assert(node.getAsConstantUnion() != nullptr || node.getAsSymbolNode() != nullptr); + int nextConst = 0; + return createSpvConstantFromConstUnionArray(node.getType(), node.getAsConstantUnion() ? + node.getAsConstantUnion()->getConstArray() : node.getAsSymbolNode()->getConstArray(), + nextConst, false); + } + + // We now know we have a specialization constant to build + + // Extra capabilities may be needed. + if (node.getType().contains8BitInt()) + builder.addCapability(spv::Capability::Int8); + if (node.getType().contains16BitFloat()) + builder.addCapability(spv::Capability::Float16); + if (node.getType().contains16BitInt()) + builder.addCapability(spv::Capability::Int16); + if (node.getType().contains64BitInt()) + builder.addCapability(spv::Capability::Int64); + if (node.getType().containsDouble()) + builder.addCapability(spv::Capability::Float64); + + // gl_WorkGroupSize is a special case until the front-end handles hierarchical specialization constants, + // even then, it's specialization ids are handled by special case syntax in GLSL: layout(local_size_x = ... + if (node.getType().getQualifier().builtIn == glslang::EbvWorkGroupSize) { + std::vector dimConstId; + for (int dim = 0; dim < 3; ++dim) { + bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet); + dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst)); + if (specConst) { + builder.addDecoration(dimConstId.back(), spv::Decoration::SpecId, + glslangIntermediate->getLocalSizeSpecId(dim)); + } + } + return builder.makeCompositeConstant(builder.makeVectorType(builder.makeUintType(32), 3), dimConstId, true); + } + + // An AST node labelled as specialization constant should be a symbol node. + // Its initializer should either be a sub tree with constant nodes, or a constant union array. + if (auto* sn = node.getAsSymbolNode()) { + spv::Id result; + if (auto* sub_tree = sn->getConstSubtree()) { + // Traverse the constant constructor sub tree like generating normal run-time instructions. + // During the AST traversal, if the node is marked as 'specConstant', SpecConstantOpModeGuard + // will set the builder into spec constant op instruction generating mode. + sub_tree->traverse(this); + result = accessChainLoad(sub_tree->getType()); + } else if (auto* const_union_array = &sn->getConstArray()) { + int nextConst = 0; + result = createSpvConstantFromConstUnionArray(sn->getType(), *const_union_array, nextConst, true); + } else { + logger->missingFunctionality("Invalid initializer for spec constant."); + return spv::NoResult; + } + builder.addName(result, sn->getName().c_str()); + return result; + } + + // Neither a front-end constant node, nor a specialization constant node with constant union array or + // constant sub tree as initializer. + logger->missingFunctionality("Neither a front-end constant nor a spec constant."); + return spv::NoResult; +} + +// Use 'consts' as the flattened glslang source of scalar constants to recursively +// build the aggregate SPIR-V constant. +// +// If there are not enough elements present in 'consts', 0 will be substituted; +// an empty 'consts' can be used to create a fully zeroed SPIR-V constant. +// +spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glslang::TType& glslangType, + const glslang::TConstUnionArray& consts, int& nextConst, bool specConstant) +{ + // vector of constants for SPIR-V + std::vector spvConsts; + + // Type is used for struct and array constants + spv::Id typeId = convertGlslangToSpvType(glslangType); + + if (glslangType.isArray()) { + glslang::TType elementType(glslangType, 0); + for (int i = 0; i < glslangType.getOuterArraySize(); ++i) + spvConsts.push_back(createSpvConstantFromConstUnionArray(elementType, consts, nextConst, false)); + } else if (glslangType.isMatrix()) { + glslang::TType vectorType(glslangType, 0); + for (int col = 0; col < glslangType.getMatrixCols(); ++col) + spvConsts.push_back(createSpvConstantFromConstUnionArray(vectorType, consts, nextConst, false)); + } else if (glslangType.isCoopMat()) { + glslang::TType componentType(glslangType.getBasicType()); + spvConsts.push_back(createSpvConstantFromConstUnionArray(componentType, consts, nextConst, false)); + } else if (glslangType.isStruct()) { + glslang::TVector::const_iterator iter; + for (iter = glslangType.getStruct()->begin(); iter != glslangType.getStruct()->end(); ++iter) + spvConsts.push_back(createSpvConstantFromConstUnionArray(*iter->type, consts, nextConst, false)); + } else if (glslangType.getVectorSize() > 1 || glslangType.isCoopVecNV()) { + unsigned int numComponents = glslangType.isCoopVecNV() ? glslangType.getTypeParameters()->arraySizes->getDimSize(0) : glslangType.getVectorSize(); + for (unsigned int i = 0; i < numComponents; ++i) { + bool zero = nextConst >= consts.size(); + switch (glslangType.getBasicType()) { + case glslang::EbtInt: + spvConsts.push_back(builder.makeIntConstant(zero ? 0 : consts[nextConst].getIConst())); + break; + case glslang::EbtUint: + spvConsts.push_back(builder.makeUintConstant(zero ? 0 : consts[nextConst].getUConst())); + break; + case glslang::EbtFloat: + spvConsts.push_back(builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst())); + break; + case glslang::EbtBool: + spvConsts.push_back(builder.makeBoolConstant(zero ? false : consts[nextConst].getBConst())); + break; + case glslang::EbtInt8: + builder.addCapability(spv::Capability::Int8); + spvConsts.push_back(builder.makeInt8Constant(zero ? 0 : consts[nextConst].getI8Const())); + break; + case glslang::EbtUint8: + builder.addCapability(spv::Capability::Int8); + spvConsts.push_back(builder.makeUint8Constant(zero ? 0 : consts[nextConst].getU8Const())); + break; + case glslang::EbtInt16: + builder.addCapability(spv::Capability::Int16); + spvConsts.push_back(builder.makeInt16Constant(zero ? 0 : consts[nextConst].getI16Const())); + break; + case glslang::EbtUint16: + builder.addCapability(spv::Capability::Int16); + spvConsts.push_back(builder.makeUint16Constant(zero ? 0 : consts[nextConst].getU16Const())); + break; + case glslang::EbtInt64: + spvConsts.push_back(builder.makeInt64Constant(zero ? 0 : consts[nextConst].getI64Const())); + break; + case glslang::EbtUint64: + spvConsts.push_back(builder.makeUint64Constant(zero ? 0 : consts[nextConst].getU64Const())); + break; + case glslang::EbtDouble: + spvConsts.push_back(builder.makeDoubleConstant(zero ? 0.0 : consts[nextConst].getDConst())); + break; + case glslang::EbtFloat16: + builder.addCapability(spv::Capability::Float16); + spvConsts.push_back(builder.makeFloat16Constant(zero ? 0.0F : (float)consts[nextConst].getDConst())); + break; + case glslang::EbtBFloat16: + spvConsts.push_back(builder.makeBFloat16Constant(zero ? 0.0F : (float)consts[nextConst].getDConst())); + break; + case glslang::EbtFloatE5M2: + spvConsts.push_back(builder.makeFloatE5M2Constant(zero ? 0.0F : (float)consts[nextConst].getDConst())); + break; + case glslang::EbtFloatE4M3: + spvConsts.push_back(builder.makeFloatE4M3Constant(zero ? 0.0F : (float)consts[nextConst].getDConst())); + break; + default: + assert(0); + break; + } + ++nextConst; + } + } else { + // we have a non-aggregate (scalar) constant + bool zero = nextConst >= consts.size(); + spv::Id scalar = 0; + switch (glslangType.getBasicType()) { + case glslang::EbtInt: + scalar = builder.makeIntConstant(zero ? 0 : consts[nextConst].getIConst(), specConstant); + break; + case glslang::EbtUint: + scalar = builder.makeUintConstant(zero ? 0 : consts[nextConst].getUConst(), specConstant); + break; + case glslang::EbtFloat: + scalar = builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst(), specConstant); + break; + case glslang::EbtBool: + scalar = builder.makeBoolConstant(zero ? false : consts[nextConst].getBConst(), specConstant); + break; + case glslang::EbtInt8: + builder.addCapability(spv::Capability::Int8); + scalar = builder.makeInt8Constant(zero ? 0 : consts[nextConst].getI8Const(), specConstant); + break; + case glslang::EbtUint8: + builder.addCapability(spv::Capability::Int8); + scalar = builder.makeUint8Constant(zero ? 0 : consts[nextConst].getU8Const(), specConstant); + break; + case glslang::EbtInt16: + builder.addCapability(spv::Capability::Int16); + scalar = builder.makeInt16Constant(zero ? 0 : consts[nextConst].getI16Const(), specConstant); + break; + case glslang::EbtUint16: + builder.addCapability(spv::Capability::Int16); + scalar = builder.makeUint16Constant(zero ? 0 : consts[nextConst].getU16Const(), specConstant); + break; + case glslang::EbtInt64: + scalar = builder.makeInt64Constant(zero ? 0 : consts[nextConst].getI64Const(), specConstant); + break; + case glslang::EbtUint64: + scalar = builder.makeUint64Constant(zero ? 0 : consts[nextConst].getU64Const(), specConstant); + break; + case glslang::EbtDouble: + scalar = builder.makeDoubleConstant(zero ? 0.0 : consts[nextConst].getDConst(), specConstant); + break; + case glslang::EbtFloat16: + builder.addCapability(spv::Capability::Float16); + scalar = builder.makeFloat16Constant(zero ? 0.0F : (float)consts[nextConst].getDConst(), specConstant); + break; + case glslang::EbtBFloat16: + scalar = builder.makeBFloat16Constant(zero ? 0.0F : (float)consts[nextConst].getDConst(), specConstant); + break; + case glslang::EbtFloatE5M2: + scalar = builder.makeFloatE5M2Constant(zero ? 0.0F : (float)consts[nextConst].getDConst(), specConstant); + break; + case glslang::EbtFloatE4M3: + scalar = builder.makeFloatE4M3Constant(zero ? 0.0F : (float)consts[nextConst].getDConst(), specConstant); + break; + case glslang::EbtReference: + scalar = builder.makeUint64Constant(zero ? 0 : consts[nextConst].getU64Const(), specConstant); + scalar = builder.createUnaryOp(spv::Op::OpBitcast, typeId, scalar); + break; + case glslang::EbtString: + scalar = builder.getStringId(consts[nextConst].getSConst()->c_str()); + break; + default: + assert(0); + break; + } + ++nextConst; + return scalar; + } + + return builder.makeCompositeConstant(typeId, spvConsts); +} + +// Return true if the node is a constant or symbol whose reading has no +// non-trivial observable cost or effect. +bool TGlslangToSpvTraverser::isTrivialLeaf(const glslang::TIntermTyped* node) +{ + // don't know what this is + if (node == nullptr) + return false; + + // a constant is safe + if (node->getAsConstantUnion() != nullptr) + return true; + + // not a symbol means non-trivial + if (node->getAsSymbolNode() == nullptr) + return false; + + // a symbol, depends on what's being read + switch (node->getType().getQualifier().storage) { + case glslang::EvqTemporary: + case glslang::EvqGlobal: + case glslang::EvqIn: + case glslang::EvqInOut: + case glslang::EvqConst: + case glslang::EvqConstReadOnly: + case glslang::EvqUniform: + return true; + default: + return false; + } +} + +// A node is trivial if it is a single operation with no side effects. +// HLSL (and/or vectors) are always trivial, as it does not short circuit. +// Otherwise, error on the side of saying non-trivial. +// Return true if trivial. +bool TGlslangToSpvTraverser::isTrivial(const glslang::TIntermTyped* node) +{ + if (node == nullptr) + return false; + + // count non scalars as trivial, as well as anything coming from HLSL + if (! node->getType().isScalarOrVec1() || glslangIntermediate->getSource() == glslang::EShSourceHlsl) + return true; + + // symbols and constants are trivial + if (isTrivialLeaf(node)) + return true; + + // otherwise, it needs to be a simple operation or one or two leaf nodes + + // not a simple operation + const glslang::TIntermBinary* binaryNode = node->getAsBinaryNode(); + const glslang::TIntermUnary* unaryNode = node->getAsUnaryNode(); + if (binaryNode == nullptr && unaryNode == nullptr) + return false; + + // not on leaf nodes + if (binaryNode && (! isTrivialLeaf(binaryNode->getLeft()) || ! isTrivialLeaf(binaryNode->getRight()))) + return false; + + if (unaryNode && ! isTrivialLeaf(unaryNode->getOperand())) { + return false; + } + + if (IsOpNumericConv(node->getAsOperator()->getOp()) && + node->getType().getBasicType() == glslang::EbtBool) { + return true; + } + + switch (node->getAsOperator()->getOp()) { + case glslang::EOpLogicalNot: + case glslang::EOpEqual: + case glslang::EOpNotEqual: + case glslang::EOpLessThan: + case glslang::EOpGreaterThan: + case glslang::EOpLessThanEqual: + case glslang::EOpGreaterThanEqual: + case glslang::EOpIndexDirect: + case glslang::EOpIndexDirectStruct: + case glslang::EOpLogicalXor: + case glslang::EOpAny: + case glslang::EOpAll: + return true; + default: + return false; + } +} + +// Emit short-circuiting code, where 'right' is never evaluated unless +// the left side is true (for &&) or false (for ||). +spv::Id TGlslangToSpvTraverser::createShortCircuit(glslang::TOperator op, glslang::TIntermTyped& left, + glslang::TIntermTyped& right) +{ + spv::Id boolTypeId = builder.makeBoolType(); + + // emit left operand + builder.clearAccessChain(); + left.traverse(this); + spv::Id leftId = accessChainLoad(left.getType()); + + // Operands to accumulate OpPhi operands + std::vector phiOperands; + phiOperands.reserve(4); + // accumulate left operand's phi information + phiOperands.push_back(leftId); + phiOperands.push_back(builder.getBuildPoint()->getId()); + + // Make the two kinds of operation symmetric with a "!" + // || => emit "if (! left) result = right" + // && => emit "if ( left) result = right" + // + // TODO: this runtime "not" for || could be avoided by adding functionality + // to 'builder' to have an "else" without an "then" + if (op == glslang::EOpLogicalOr) + leftId = builder.createUnaryOp(spv::Op::OpLogicalNot, boolTypeId, leftId); + + // make an "if" based on the left value + spv::Builder::If ifBuilder(leftId, spv::SelectionControlMask::MaskNone, builder); + + // emit right operand as the "then" part of the "if" + builder.clearAccessChain(); + right.traverse(this); + spv::Id rightId = accessChainLoad(right.getType()); + + // accumulate left operand's phi information + phiOperands.push_back(rightId); + phiOperands.push_back(builder.getBuildPoint()->getId()); + + // finish the "if" + ifBuilder.makeEndIf(); + + // phi together the two results + return builder.createOp(spv::Op::OpPhi, boolTypeId, phiOperands); +} + +// Return type Id of the imported set of extended instructions corresponds to the name. +// Import this set if it has not been imported yet. +spv::Id TGlslangToSpvTraverser::getExtBuiltins(const char* name) +{ + if (extBuiltinMap.find(name) != extBuiltinMap.end()) + return extBuiltinMap[name]; + else { + spv::Id extBuiltins = builder.import(name); + extBuiltinMap[name] = extBuiltins; + return extBuiltins; + } +} + +} // end anonymous namespace + +namespace QtShaderTools { +namespace glslang { + +void GetSpirvVersion(std::string& version) +{ + const int bufSize = 100; + char buf[bufSize]; + snprintf(buf, bufSize, "0x%08x, Revision %d", spv::Version, spv::Revision); + version = buf; +} + +// For low-order part of the generator's magic number. Bump up +// when there is a change in the style (e.g., if SSA form changes, +// or a different instruction sequence to do something gets used). +int GetSpirvGeneratorVersion() +{ + // return 1; // start + // return 2; // EOpAtomicCounterDecrement gets a post decrement, to map between GLSL -> SPIR-V + // return 3; // change/correct barrier-instruction operands, to match memory model group decisions + // return 4; // some deeper access chains: for dynamic vector component, and local Boolean component + // return 5; // make OpArrayLength result type be an int with signedness of 0 + // return 6; // revert version 5 change, which makes a different (new) kind of incorrect code, + // versions 4 and 6 each generate OpArrayLength as it has long been done + // return 7; // GLSL volatile keyword maps to both SPIR-V decorations Volatile and Coherent + // return 8; // switch to new dead block eliminator; use OpUnreachable + // return 9; // don't include opaque function parameters in OpEntryPoint global's operand list + // return 10; // Generate OpFUnordNotEqual for != comparisons + return 11; // Make OpEmitMeshTasksEXT a terminal instruction +} + +// Write SPIR-V out to a binary file +bool OutputSpvBin(const std::vector& spirv, const char* baseName) +{ + std::ofstream out; + out.open(baseName, std::ios::binary | std::ios::out); + if (out.fail()) { + printf("ERROR: Failed to open file: %s\n", baseName); + return false; + } + for (int i = 0; i < (int)spirv.size(); ++i) { + unsigned int word = spirv[i]; + out.write((const char*)&word, 4); + } + out.close(); + return true; +} + +// Write SPIR-V out to a text file with 32-bit hexadecimal words +bool OutputSpvHex(const std::vector& spirv, const char* baseName, const char* varName) +{ + std::ofstream out; + out.open(baseName, std::ios::binary | std::ios::out); + if (out.fail()) { + printf("ERROR: Failed to open file: %s\n", baseName); + return false; + } + out << "\t// " << + GetSpirvGeneratorVersion() << + GLSLANG_VERSION_MAJOR << "." << GLSLANG_VERSION_MINOR << "." << GLSLANG_VERSION_PATCH << + GLSLANG_VERSION_FLAVOR << std::endl; + if (varName != nullptr) { + out << "\t #pragma once" << std::endl; + out << "const uint32_t " << varName << "[] = {" << std::endl; + } + const int WORDS_PER_LINE = 8; + for (int i = 0; i < (int)spirv.size(); i += WORDS_PER_LINE) { + out << "\t"; + for (int j = 0; j < WORDS_PER_LINE && i + j < (int)spirv.size(); ++j) { + const unsigned int word = spirv[i + j]; + out << "0x" << std::hex << std::setw(8) << std::setfill('0') << word; + if (i + j + 1 < (int)spirv.size()) { + out << ","; + } + } + out << std::endl; + } + if (varName != nullptr) { + out << "};"; + out << std::endl; + } + out.close(); + return true; +} + +// +// Set up the glslang traversal +// +void GlslangToSpv(const TIntermediate& intermediate, std::vector& spirv, SpvOptions* options) +{ + spv::SpvBuildLogger logger; + GlslangToSpv(intermediate, spirv, &logger, options); +} + +void GlslangToSpv(const TIntermediate& intermediate, std::vector& spirv, + spv::SpvBuildLogger* logger, SpvOptions* options) +{ + TIntermNode* root = intermediate.getTreeRoot(); + + if (root == nullptr) + return; + + SpvOptions defaultOptions; + if (options == nullptr) + options = &defaultOptions; + + GetThreadPoolAllocator().push(); + + TGlslangToSpvTraverser it(intermediate.getSpv().spv, &intermediate, logger, *options); + root->traverse(&it); + it.finishSpv(options->compileOnly); + it.dumpSpv(spirv); + +#if ENABLE_OPT + // If from HLSL, run spirv-opt to "legalize" the SPIR-V for Vulkan + // eg. forward and remove memory writes of opaque types. + bool prelegalization = intermediate.getSource() == EShSourceHlsl; + if ((prelegalization || options->optimizeSize) && !options->disableOptimizer) { + SpirvToolsTransform(intermediate, spirv, logger, options); + prelegalization = false; + } + else if (options->stripDebugInfo) { + // Strip debug info even if optimization is disabled. + SpirvToolsStripDebugInfo(intermediate, spirv, logger); + } + + if (options->validate) + SpirvToolsValidate(intermediate, spirv, logger, prelegalization); + + if (options->disassemble) + SpirvToolsDisassemble(std::cout, spirv); + +#endif + + GetThreadPoolAllocator().pop(); +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GlslangToSpv.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GlslangToSpv.h new file mode 100644 index 0000000000..1bbe3b3228 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/GlslangToSpv.h @@ -0,0 +1,71 @@ +// +// Copyright (C) 2014 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#pragma once + +#include +#include + +#include "Logger.h" +#include "glslang/Include/visibility.h" + +namespace QtShaderTools { +namespace glslang { +class TIntermediate; + +struct SpvOptions { + bool generateDebugInfo {false}; + bool stripDebugInfo {false}; + bool disableOptimizer {true}; + bool optimizeSize {false}; + bool disassemble {false}; + bool validate {false}; + bool emitNonSemanticShaderDebugInfo {false}; + bool emitNonSemanticShaderDebugSource{ false }; + bool compileOnly{false}; + bool optimizerAllowExpandedIDBound{false}; +}; + +GLSLANG_EXPORT void GetSpirvVersion(std::string&); +GLSLANG_EXPORT int GetSpirvGeneratorVersion(); +GLSLANG_EXPORT void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, + SpvOptions* options = nullptr); +GLSLANG_EXPORT void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, + spv::SpvBuildLogger* logger, SpvOptions* options = nullptr); +GLSLANG_EXPORT bool OutputSpvBin(const std::vector& spirv, const char* baseName); +GLSLANG_EXPORT bool OutputSpvHex(const std::vector& spirv, const char* baseName, const char* varName); + +} // namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/InReadableOrder.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/InReadableOrder.cpp new file mode 100644 index 0000000000..18e487d877 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/InReadableOrder.cpp @@ -0,0 +1,131 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// The SPIR-V spec requires code blocks to appear in an order satisfying the +// dominator-tree direction (ie, dominator before the dominated). This is, +// actually, easy to achieve: any pre-order CFG traversal algorithm will do it. +// Because such algorithms visit a block only after traversing some path to it +// from the root, they necessarily visit the block's idom first. +// +// But not every graph-traversal algorithm outputs blocks in an order that +// appears logical to human readers. The problem is that unrelated branches may +// be interspersed with each other, and merge blocks may come before some of the +// branches being merged. +// +// A good, human-readable order of blocks may be achieved by performing +// depth-first search but delaying merge nodes until after all their branches +// have been visited. This is implemented below by the inReadableOrder() +// function. + +#include "spvIR.h" + +#include +#include + +using spv::Block; +using spv::Id; + +namespace { +// Traverses CFG in a readable order, invoking a pre-set callback on each block. +// Use by calling visit() on the root block. +class ReadableOrderTraverser { +public: + ReadableOrderTraverser(std::function callback) + : callback_(callback) {} + // Visits the block if it hasn't been visited already and isn't currently + // being delayed. Invokes callback(block, why, header), then descends into its + // successors. Delays merge-block and continue-block processing until all + // the branches have been completed. If |block| is an unreachable merge block or + // an unreachable continue target, then |header| is the corresponding header block. + void visit(Block* block, spv::ReachReason why, Block* header) + { + assert(block); + if (why == spv::ReachViaControlFlow) { + reachableViaControlFlow_.insert(block); + } + if (visited_.count(block) || delayed_.count(block)) + return; + callback_(block, why, header); + visited_.insert(block); + Block* mergeBlock = nullptr; + Block* continueBlock = nullptr; + auto mergeInst = block->getMergeInstruction(); + if (mergeInst) { + Id mergeId = mergeInst->getIdOperand(0); + mergeBlock = block->getParent().getParent().getInstruction(mergeId)->getBlock(); + delayed_.insert(mergeBlock); + if (mergeInst->getOpCode() == spv::Op::OpLoopMerge) { + Id continueId = mergeInst->getIdOperand(1); + continueBlock = + block->getParent().getParent().getInstruction(continueId)->getBlock(); + delayed_.insert(continueBlock); + } + } + if (why == spv::ReachViaControlFlow) { + const auto& successors = block->getSuccessors(); + for (auto it = successors.cbegin(); it != successors.cend(); ++it) + visit(*it, why, nullptr); + } + if (continueBlock) { + const spv::ReachReason continueWhy = + (reachableViaControlFlow_.count(continueBlock) > 0) + ? spv::ReachViaControlFlow + : spv::ReachDeadContinue; + delayed_.erase(continueBlock); + visit(continueBlock, continueWhy, block); + } + if (mergeBlock) { + const spv::ReachReason mergeWhy = + (reachableViaControlFlow_.count(mergeBlock) > 0) + ? spv::ReachViaControlFlow + : spv::ReachDeadMerge; + delayed_.erase(mergeBlock); + visit(mergeBlock, mergeWhy, block); + } + } + +private: + std::function callback_; + // Whether a block has already been visited or is being delayed. + std::unordered_set visited_, delayed_; + + // The set of blocks that actually are reached via control flow. + std::unordered_set reachableViaControlFlow_; +}; +} + +void spv::inReadableOrder(Block* root, std::function callback) +{ + ReadableOrderTraverser(callback).visit(root, spv::ReachViaControlFlow, nullptr); +} diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/Logger.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/Logger.cpp new file mode 100644 index 0000000000..48bd4e3ade --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/Logger.cpp @@ -0,0 +1,68 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include "Logger.h" + +#include +#include +#include + +namespace spv { + +void SpvBuildLogger::tbdFunctionality(const std::string& f) +{ + if (std::find(std::begin(tbdFeatures), std::end(tbdFeatures), f) == std::end(tbdFeatures)) + tbdFeatures.push_back(f); +} + +void SpvBuildLogger::missingFunctionality(const std::string& f) +{ + if (std::find(std::begin(missingFeatures), std::end(missingFeatures), f) == std::end(missingFeatures)) + missingFeatures.push_back(f); +} + +std::string SpvBuildLogger::getAllMessages() const { + std::ostringstream messages; + for (auto it = tbdFeatures.cbegin(); it != tbdFeatures.cend(); ++it) + messages << "TBD functionality: " << *it << "\n"; + for (auto it = missingFeatures.cbegin(); it != missingFeatures.cend(); ++it) + messages << "Missing functionality: " << *it << "\n"; + for (auto it = warnings.cbegin(); it != warnings.cend(); ++it) + messages << "warning: " << *it << "\n"; + for (auto it = errors.cbegin(); it != errors.cend(); ++it) + messages << "error: " << *it << "\n"; + return messages.str(); +} + +} // end spv namespace diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/Logger.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/Logger.h new file mode 100644 index 0000000000..c64a3b8a36 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/Logger.h @@ -0,0 +1,75 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef GLSLANG_SPIRV_LOGGER_H +#define GLSLANG_SPIRV_LOGGER_H + +#include +#include +#include "glslang/Include/visibility.h" + +namespace spv { + +// A class for holding all SPIR-V build status messages, including +// missing/TBD functionalities, warnings, and errors. +class GLSLANG_EXPORT SpvBuildLogger { +public: + SpvBuildLogger() {} + + // Registers a TBD functionality. + void tbdFunctionality(const std::string& f); + // Registers a missing functionality. + void missingFunctionality(const std::string& f); + + // Logs a warning. + void warning(const std::string& w) { warnings.push_back(w); } + // Logs an error. + void error(const std::string& e) { errors.push_back(e); } + + // Returns all messages accumulated in the order of: + // TBD functionalities, missing functionalities, warnings, errors. + std::string getAllMessages() const; + +private: + SpvBuildLogger(const SpvBuildLogger&); + + std::vector tbdFeatures; + std::vector missingFeatures; + std::vector warnings; + std::vector errors; +}; + +} // end spv namespace + +#endif // GLSLANG_SPIRV_LOGGER_H diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/NonSemanticDebugPrintf.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/NonSemanticDebugPrintf.h new file mode 100644 index 0000000000..3ca7247f2b --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/NonSemanticDebugPrintf.h @@ -0,0 +1,50 @@ +// Copyright (c) 2020 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and/or associated documentation files (the +// "Materials"), to deal in the Materials without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Materials, and to +// permit persons to whom the Materials are furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS +// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS +// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT +// https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +// + +#ifndef SPIRV_UNIFIED1_NonSemanticDebugPrintf_H_ +#define SPIRV_UNIFIED1_NonSemanticDebugPrintf_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + NonSemanticDebugPrintfRevision = 1, + NonSemanticDebugPrintfRevision_BitWidthPadding = 0x7fffffff +}; + +enum NonSemanticDebugPrintfInstructions { + NonSemanticDebugPrintfDebugPrintf = 1, + NonSemanticDebugPrintfInstructionsMax = 0x7fffffff +}; + + +#ifdef __cplusplus +} +#endif + +#endif // SPIRV_UNIFIED1_NonSemanticDebugPrintf_H_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/NonSemanticShaderDebugInfo100.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/NonSemanticShaderDebugInfo100.h new file mode 100644 index 0000000000..f74abcb646 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/NonSemanticShaderDebugInfo100.h @@ -0,0 +1,171 @@ +// Copyright (c) 2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +#ifndef SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_ +#define SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + NonSemanticShaderDebugInfo100Version = 100, + NonSemanticShaderDebugInfo100Version_BitWidthPadding = 0x7fffffff +}; +enum { + NonSemanticShaderDebugInfo100Revision = 6, + NonSemanticShaderDebugInfo100Revision_BitWidthPadding = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100Instructions { + NonSemanticShaderDebugInfo100DebugInfoNone = 0, + NonSemanticShaderDebugInfo100DebugCompilationUnit = 1, + NonSemanticShaderDebugInfo100DebugTypeBasic = 2, + NonSemanticShaderDebugInfo100DebugTypePointer = 3, + NonSemanticShaderDebugInfo100DebugTypeQualifier = 4, + NonSemanticShaderDebugInfo100DebugTypeArray = 5, + NonSemanticShaderDebugInfo100DebugTypeVector = 6, + NonSemanticShaderDebugInfo100DebugTypedef = 7, + NonSemanticShaderDebugInfo100DebugTypeFunction = 8, + NonSemanticShaderDebugInfo100DebugTypeEnum = 9, + NonSemanticShaderDebugInfo100DebugTypeComposite = 10, + NonSemanticShaderDebugInfo100DebugTypeMember = 11, + NonSemanticShaderDebugInfo100DebugTypeInheritance = 12, + NonSemanticShaderDebugInfo100DebugTypePtrToMember = 13, + NonSemanticShaderDebugInfo100DebugTypeTemplate = 14, + NonSemanticShaderDebugInfo100DebugTypeTemplateParameter = 15, + NonSemanticShaderDebugInfo100DebugTypeTemplateTemplateParameter = 16, + NonSemanticShaderDebugInfo100DebugTypeTemplateParameterPack = 17, + NonSemanticShaderDebugInfo100DebugGlobalVariable = 18, + NonSemanticShaderDebugInfo100DebugFunctionDeclaration = 19, + NonSemanticShaderDebugInfo100DebugFunction = 20, + NonSemanticShaderDebugInfo100DebugLexicalBlock = 21, + NonSemanticShaderDebugInfo100DebugLexicalBlockDiscriminator = 22, + NonSemanticShaderDebugInfo100DebugScope = 23, + NonSemanticShaderDebugInfo100DebugNoScope = 24, + NonSemanticShaderDebugInfo100DebugInlinedAt = 25, + NonSemanticShaderDebugInfo100DebugLocalVariable = 26, + NonSemanticShaderDebugInfo100DebugInlinedVariable = 27, + NonSemanticShaderDebugInfo100DebugDeclare = 28, + NonSemanticShaderDebugInfo100DebugValue = 29, + NonSemanticShaderDebugInfo100DebugOperation = 30, + NonSemanticShaderDebugInfo100DebugExpression = 31, + NonSemanticShaderDebugInfo100DebugMacroDef = 32, + NonSemanticShaderDebugInfo100DebugMacroUndef = 33, + NonSemanticShaderDebugInfo100DebugImportedEntity = 34, + NonSemanticShaderDebugInfo100DebugSource = 35, + NonSemanticShaderDebugInfo100DebugFunctionDefinition = 101, + NonSemanticShaderDebugInfo100DebugSourceContinued = 102, + NonSemanticShaderDebugInfo100DebugLine = 103, + NonSemanticShaderDebugInfo100DebugNoLine = 104, + NonSemanticShaderDebugInfo100DebugBuildIdentifier = 105, + NonSemanticShaderDebugInfo100DebugStoragePath = 106, + NonSemanticShaderDebugInfo100DebugEntryPoint = 107, + NonSemanticShaderDebugInfo100DebugTypeMatrix = 108, + NonSemanticShaderDebugInfo100InstructionsMax = 0x7fffffff +}; + + +enum NonSemanticShaderDebugInfo100DebugInfoFlags { + NonSemanticShaderDebugInfo100None = 0x0000, + NonSemanticShaderDebugInfo100FlagIsProtected = 0x01, + NonSemanticShaderDebugInfo100FlagIsPrivate = 0x02, + NonSemanticShaderDebugInfo100FlagIsPublic = 0x03, + NonSemanticShaderDebugInfo100FlagIsLocal = 0x04, + NonSemanticShaderDebugInfo100FlagIsDefinition = 0x08, + NonSemanticShaderDebugInfo100FlagFwdDecl = 0x10, + NonSemanticShaderDebugInfo100FlagArtificial = 0x20, + NonSemanticShaderDebugInfo100FlagExplicit = 0x40, + NonSemanticShaderDebugInfo100FlagPrototyped = 0x80, + NonSemanticShaderDebugInfo100FlagObjectPointer = 0x100, + NonSemanticShaderDebugInfo100FlagStaticMember = 0x200, + NonSemanticShaderDebugInfo100FlagIndirectVariable = 0x400, + NonSemanticShaderDebugInfo100FlagLValueReference = 0x800, + NonSemanticShaderDebugInfo100FlagRValueReference = 0x1000, + NonSemanticShaderDebugInfo100FlagIsOptimized = 0x2000, + NonSemanticShaderDebugInfo100FlagIsEnumClass = 0x4000, + NonSemanticShaderDebugInfo100FlagTypePassByValue = 0x8000, + NonSemanticShaderDebugInfo100FlagTypePassByReference = 0x10000, + NonSemanticShaderDebugInfo100FlagUnknownPhysicalLayout = 0x20000, + NonSemanticShaderDebugInfo100DebugInfoFlagsMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100BuildIdentifierFlags { + NonSemanticShaderDebugInfo100IdentifierPossibleDuplicates = 0x01, + NonSemanticShaderDebugInfo100BuildIdentifierFlagsMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100DebugBaseTypeAttributeEncoding { + NonSemanticShaderDebugInfo100Unspecified = 0, + NonSemanticShaderDebugInfo100Address = 1, + NonSemanticShaderDebugInfo100Boolean = 2, + NonSemanticShaderDebugInfo100Float = 3, + NonSemanticShaderDebugInfo100Signed = 4, + NonSemanticShaderDebugInfo100SignedChar = 5, + NonSemanticShaderDebugInfo100Unsigned = 6, + NonSemanticShaderDebugInfo100UnsignedChar = 7, + NonSemanticShaderDebugInfo100DebugBaseTypeAttributeEncodingMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100DebugCompositeType { + NonSemanticShaderDebugInfo100Class = 0, + NonSemanticShaderDebugInfo100Structure = 1, + NonSemanticShaderDebugInfo100Union = 2, + NonSemanticShaderDebugInfo100DebugCompositeTypeMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100DebugTypeQualifier { + NonSemanticShaderDebugInfo100ConstType = 0, + NonSemanticShaderDebugInfo100VolatileType = 1, + NonSemanticShaderDebugInfo100RestrictType = 2, + NonSemanticShaderDebugInfo100AtomicType = 3, + NonSemanticShaderDebugInfo100DebugTypeQualifierMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100DebugOperation { + NonSemanticShaderDebugInfo100Deref = 0, + NonSemanticShaderDebugInfo100Plus = 1, + NonSemanticShaderDebugInfo100Minus = 2, + NonSemanticShaderDebugInfo100PlusUconst = 3, + NonSemanticShaderDebugInfo100BitPiece = 4, + NonSemanticShaderDebugInfo100Swap = 5, + NonSemanticShaderDebugInfo100Xderef = 6, + NonSemanticShaderDebugInfo100StackValue = 7, + NonSemanticShaderDebugInfo100Constu = 8, + NonSemanticShaderDebugInfo100Fragment = 9, + NonSemanticShaderDebugInfo100DebugOperationMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100DebugImportedEntity { + NonSemanticShaderDebugInfo100ImportedModule = 0, + NonSemanticShaderDebugInfo100ImportedDeclaration = 1, + NonSemanticShaderDebugInfo100DebugImportedEntityMax = 0x7fffffff +}; + + +#ifdef __cplusplus +} +#endif + +#endif // SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SPVRemapper.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SPVRemapper.cpp new file mode 100644 index 0000000000..3f102014ce --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SPVRemapper.cpp @@ -0,0 +1,1559 @@ +// +// Copyright (C) 2015 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "SPVRemapper.h" +#include "doc.h" + +#include +#include + +namespace spv { + + // By default, just abort on error. Can be overridden via RegisterErrorHandler + spirvbin_t::errorfn_t spirvbin_t::errorHandler = [](const std::string&) { exit(5); }; + // By default, eat log messages. Can be overridden via RegisterLogHandler + spirvbin_t::logfn_t spirvbin_t::logHandler = [](const std::string&) { }; + + // This can be overridden to provide other message behavior if needed + void spirvbin_t::msg(int minVerbosity, int indent, const std::string& txt) const + { + if (verbose >= minVerbosity) + logHandler(std::string(indent, ' ') + txt); + } + + // hash opcode, with special handling for OpExtInst + std::uint32_t spirvbin_t::asOpCodeHash(unsigned word) + { + const spv::Op opCode = asOpCode(word); + + std::uint32_t offset = 0; + + switch (opCode) { + case spv::Op::OpExtInst: + offset += asId(word + 4); break; + default: + break; + } + + return std::uint32_t(opCode) * 19 + offset; // 19 = small prime + } + + spirvbin_t::range_t spirvbin_t::literalRange(spv::Op opCode) const + { + static const int maxCount = 1<<30; + + switch (opCode) { + case spv::Op::OpTypeFloat: // fall through... + case spv::Op::OpTypePointer: return range_t(2, 3); + case spv::Op::OpTypeInt: return range_t(2, 4); + // TODO: case spv::OpTypeImage: + // TODO: case spv::OpTypeSampledImage: + case spv::Op::OpTypeSampler: return range_t(3, 8); + case spv::Op::OpTypeVector: // fall through + case spv::Op::OpTypeMatrix: // ... + case spv::Op::OpTypePipe: return range_t(3, 4); + case spv::Op::OpConstant: return range_t(3, maxCount); + default: return range_t(0, 0); + } + } + + spirvbin_t::range_t spirvbin_t::typeRange(spv::Op opCode) const + { + static const int maxCount = 1<<30; + + if (isConstOp(opCode)) + return range_t(1, 2); + + switch (opCode) { + case spv::Op::OpTypeVector: // fall through + case spv::Op::OpTypeMatrix: // ... + case spv::Op::OpTypeSampler: // ... + case spv::Op::OpTypeArray: // ... + case spv::Op::OpTypeRuntimeArray: // ... + case spv::Op::OpTypePipe: return range_t(2, 3); + case spv::Op::OpTypeStruct: // fall through + case spv::Op::OpTypeFunction: return range_t(2, maxCount); + case spv::Op::OpTypePointer: return range_t(3, 4); + default: return range_t(0, 0); + } + } + + spirvbin_t::range_t spirvbin_t::constRange(spv::Op opCode) const + { + static const int maxCount = 1<<30; + + switch (opCode) { + case spv::Op::OpTypeArray: // fall through... + case spv::Op::OpTypeRuntimeArray: return range_t(3, 4); + case spv::Op::OpConstantComposite: return range_t(3, maxCount); + default: return range_t(0, 0); + } + } + + // Return the size of a type in 32-bit words. This currently only + // handles ints and floats, and is only invoked by queries which must be + // integer types. If ever needed, it can be generalized. + unsigned spirvbin_t::typeSizeInWords(spv::Id id) const + { + const unsigned typeStart = idPos(id); + const spv::Op opCode = asOpCode(typeStart); + + if (errorLatch) + return 0; + + switch (opCode) { + case spv::Op::OpTypeInt: // fall through... + case spv::Op::OpTypeFloat: return (spv[typeStart+2]+31)/32; + default: + return 0; + } + } + + // Looks up the type of a given const or variable ID, and + // returns its size in 32-bit words. + unsigned spirvbin_t::idTypeSizeInWords(spv::Id id) const + { + const auto tid_it = idTypeSizeMap.find(id); + if (tid_it == idTypeSizeMap.end()) { + error("type size for ID not found"); + return 0; + } + + return tid_it->second; + } + + // Is this an opcode we should remove when using --strip? + bool spirvbin_t::isStripOp(spv::Op opCode, unsigned start) const + { + switch (opCode) { + case spv::Op::OpSource: + case spv::Op::OpSourceExtension: + case spv::Op::OpName: + case spv::Op::OpMemberName: + case spv::Op::OpLine : + { + const std::string name = literalString(start + 2); + + std::vector::const_iterator it; + for (it = stripWhiteList.begin(); it < stripWhiteList.end(); it++) + { + if (name.find(*it) != std::string::npos) { + return false; + } + } + + return true; + } + default : + return false; + } + } + + // Return true if this opcode is flow control + bool spirvbin_t::isFlowCtrl(spv::Op opCode) const + { + switch (opCode) { + case spv::Op::OpBranchConditional: + case spv::Op::OpBranch: + case spv::Op::OpSwitch: + case spv::Op::OpLoopMerge: + case spv::Op::OpSelectionMerge: + case spv::Op::OpLabel: + case spv::Op::OpFunction: + case spv::Op::OpFunctionEnd: return true; + default: return false; + } + } + + // Return true if this opcode defines a type + bool spirvbin_t::isTypeOp(spv::Op opCode) const + { + switch (opCode) { + case spv::Op::OpTypeVoid: + case spv::Op::OpTypeBool: + case spv::Op::OpTypeInt: + case spv::Op::OpTypeFloat: + case spv::Op::OpTypeVector: + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeImage: + case spv::Op::OpTypeSampler: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: + case spv::Op::OpTypeStruct: + case spv::Op::OpTypeOpaque: + case spv::Op::OpTypePointer: + case spv::Op::OpTypeFunction: + case spv::Op::OpTypeEvent: + case spv::Op::OpTypeDeviceEvent: + case spv::Op::OpTypeReserveId: + case spv::Op::OpTypeQueue: + case spv::Op::OpTypeSampledImage: + case spv::Op::OpTypePipe: return true; + default: return false; + } + } + + // Return true if this opcode defines a constant + bool spirvbin_t::isConstOp(spv::Op opCode) const + { + switch (opCode) { + case spv::Op::OpConstantSampler: + error("unimplemented constant type"); + return true; + + case spv::Op::OpConstantNull: + case spv::Op::OpConstantTrue: + case spv::Op::OpConstantFalse: + case spv::Op::OpConstantComposite: + case spv::Op::OpConstant: + return true; + + default: + return false; + } + } + + const auto inst_fn_nop = [](spv::Op, unsigned) { return false; }; + const auto op_fn_nop = [](spv::Id&) { }; + + // g++ doesn't like these defined in the class proper in an anonymous namespace. + // Dunno why. Also MSVC doesn't like the constexpr keyword. Also dunno why. + // Defining them externally seems to please both compilers, so, here they are. + const spv::Id spirvbin_t::unmapped = spv::Id(-10000); + const spv::Id spirvbin_t::unused = spv::Id(-10001); + const int spirvbin_t::header_size = 5; + + spv::Id spirvbin_t::nextUnusedId(spv::Id id) + { + while (isNewIdMapped(id)) // search for an unused ID + ++id; + + return id; + } + + spv::Id spirvbin_t::localId(spv::Id id, spv::Id newId) + { + //assert(id != spv::NoResult && newId != spv::NoResult); + + if (id > bound()) { + error(std::string("ID out of range: ") + std::to_string(id)); + return spirvbin_t::unused; + } + + if (id >= idMapL.size()) + idMapL.resize(id+1, unused); + + if (newId != unmapped && newId != unused) { + if (isOldIdUnused(id)) { + error(std::string("ID unused in module: ") + std::to_string(id)); + return spirvbin_t::unused; + } + + if (!isOldIdUnmapped(id)) { + error(std::string("ID already mapped: ") + std::to_string(id) + " -> " + + std::to_string(localId(id))); + + return spirvbin_t::unused; + } + + if (isNewIdMapped(newId)) { + error(std::string("ID already used in module: ") + std::to_string(newId)); + return spirvbin_t::unused; + } + + msg(4, 4, std::string("map: ") + std::to_string(id) + " -> " + std::to_string(newId)); + setMapped(newId); + largestNewId = std::max(largestNewId, newId); + } + + return idMapL[id] = newId; + } + + // Parse a literal string from the SPIR binary and return it as an std::string + // Due to C++11 RValue references, this doesn't copy the result string. + std::string spirvbin_t::literalString(unsigned word) const + { + std::string literal; + const spirword_t * pos = spv.data() + word; + + literal.reserve(16); + + do { + spirword_t word = *pos; + for (int i = 0; i < 4; i++) { + char c = word & 0xff; + if (c == '\0') + return literal; + literal += c; + word >>= 8; + } + pos++; + } while (true); + } + + void spirvbin_t::applyMap() + { + msg(3, 2, std::string("Applying map: ")); + + // Map local IDs through the ID map + process(inst_fn_nop, // ignore instructions + [this](spv::Id& id) { + id = localId(id); + + if (errorLatch) + return; + + assert(id != unused && id != unmapped); + } + ); + } + + // Find free IDs for anything we haven't mapped + void spirvbin_t::mapRemainder() + { + msg(3, 2, std::string("Remapping remainder: ")); + + spv::Id unusedId = 1; // can't use 0: that's NoResult + spirword_t maxBound = 0; + + for (spv::Id id = 0; id < idMapL.size(); ++id) { + if (isOldIdUnused(id)) + continue; + + // Find a new mapping for any used but unmapped IDs + if (isOldIdUnmapped(id)) { + localId(id, unusedId = nextUnusedId(unusedId)); + if (errorLatch) + return; + } + + if (isOldIdUnmapped(id)) { + error(std::string("old ID not mapped: ") + std::to_string(id)); + return; + } + + // Track max bound + maxBound = std::max(maxBound, localId(id) + 1); + + if (errorLatch) + return; + } + + bound(maxBound); // reset header ID bound to as big as it now needs to be + } + + // Mark debug instructions for stripping + void spirvbin_t::stripDebug() + { + // Strip instructions in the stripOp set: debug info. + process( + [&](spv::Op opCode, unsigned start) { + // remember opcodes we want to strip later + if (isStripOp(opCode, start)) + stripInst(start); + return true; + }, + op_fn_nop); + } + + // Mark instructions that refer to now-removed IDs for stripping + void spirvbin_t::stripDeadRefs() + { + process( + [&](spv::Op opCode, unsigned start) { + // strip opcodes pointing to removed data + switch (opCode) { + case spv::Op::OpName: + case spv::Op::OpMemberName: + case spv::Op::OpDecorate: + case spv::Op::OpMemberDecorate: + if (idPosR.find(asId(start+1)) == idPosR.end()) + stripInst(start); + break; + default: + break; // leave it alone + } + + return true; + }, + op_fn_nop); + + strip(); + } + + // Update local maps of ID, type, etc positions + void spirvbin_t::buildLocalMaps() + { + msg(2, 2, std::string("build local maps: ")); + + mapped.clear(); + idMapL.clear(); +// preserve nameMap, so we don't clear that. + fnPos.clear(); + fnCalls.clear(); + typeConstPos.clear(); + idPosR.clear(); + entryPoint = spv::NoResult; + largestNewId = 0; + + idMapL.resize(bound(), unused); + + int fnStart = 0; + spv::Id fnRes = spv::NoResult; + + // build local Id and name maps + process( + [&](spv::Op opCode, unsigned start) { + unsigned word = start+1; + spv::Id typeId = spv::NoResult; + + if (spv::InstructionDesc[std::uint32_t(opCode)].hasType()) + typeId = asId(word++); + + // If there's a result ID, remember the size of its type + if (spv::InstructionDesc[std::uint32_t(opCode)].hasResult()) { + const spv::Id resultId = asId(word++); + idPosR[resultId] = start; + + if (typeId != spv::NoResult) { + const unsigned idTypeSize = typeSizeInWords(typeId); + + if (errorLatch) + return false; + + if (idTypeSize != 0) + idTypeSizeMap[resultId] = idTypeSize; + } + } + + if (opCode == spv::Op::OpName) { + const spv::Id target = asId(start+1); + const std::string name = literalString(start+2); + nameMap[name] = target; + + } else if (opCode == spv::Op::OpFunctionCall) { + ++fnCalls[asId(start + 3)]; + } else if (opCode == spv::Op::OpEntryPoint) { + entryPoint = asId(start + 2); + } else if (opCode == spv::Op::OpFunction) { + if (fnStart != 0) { + error("nested function found"); + return false; + } + + fnStart = start; + fnRes = asId(start + 2); + } else if (opCode == spv::Op::OpFunctionEnd) { + assert(fnRes != spv::NoResult); + if (fnStart == 0) { + error("function end without function start"); + return false; + } + + fnPos[fnRes] = range_t(fnStart, start + asWordCount(start)); + fnStart = 0; + } else if (isConstOp(opCode)) { + if (errorLatch) + return false; + + assert(asId(start + 2) != spv::NoResult); + typeConstPos.insert(start); + } else if (isTypeOp(opCode)) { + assert(asId(start + 1) != spv::NoResult); + typeConstPos.insert(start); + } + + return false; + }, + + [this](spv::Id& id) { localId(id, unmapped); } + ); + } + + // Validate the SPIR header + void spirvbin_t::validate() const + { + msg(2, 2, std::string("validating: ")); + + if (spv.size() < header_size) { + error("file too short: "); + return; + } + + if (magic() != spv::MagicNumber) { + error("bad magic number"); + return; + } + + // field 1 = version + // field 2 = generator magic + // field 3 = result bound + + if (schemaNum() != 0) { + error("bad schema, must be 0"); + return; + } + } + + int spirvbin_t::processInstruction(unsigned word, instfn_t instFn, idfn_t idFn) + { + const auto instructionStart = word; + const unsigned wordCount = asWordCount(instructionStart); + const int nextInst = word++ + wordCount; + spv::Op opCode = asOpCode(instructionStart); + + if (nextInst > int(spv.size())) { + error("spir instruction terminated too early"); + return -1; + } + + // Base for computing number of operands; will be updated as more is learned + unsigned numOperands = wordCount - 1; + + if (instFn(opCode, instructionStart)) + return nextInst; + + // Read type and result ID from instruction desc table + if (spv::InstructionDesc[std::uint32_t(opCode)].hasType()) { + idFn(asId(word++)); + --numOperands; + } + + if (spv::InstructionDesc[std::uint32_t(opCode)].hasResult()) { + idFn(asId(word++)); + --numOperands; + } + + // Extended instructions: currently, assume everything is an ID. + // TODO: add whatever data we need for exceptions to that + if (opCode == spv::Op::OpExtInst) { + + idFn(asId(word)); // Instruction set is an ID that also needs to be mapped + + word += 2; // instruction set, and instruction from set + numOperands -= 2; + + for (unsigned op=0; op < numOperands; ++op) + idFn(asId(word++)); // ID + + return nextInst; + } + + // Circular buffer so we can look back at previous unmapped values during the mapping pass. + static const unsigned idBufferSize = 4; + spv::Id idBuffer[idBufferSize]; + unsigned idBufferPos = 0; + + // Store IDs from instruction in our map + for (int op = 0; numOperands > 0; ++op, --numOperands) { + // SpecConstantOp is special: it includes the operands of another opcode which is + // given as a literal in the 3rd word. We will switch over to pretending that the + // opcode being processed is the literal opcode value of the SpecConstantOp. See the + // SPIRV spec for details. This way we will handle IDs and literals as appropriate for + // the embedded op. + if (opCode == spv::Op::OpSpecConstantOp) { + if (op == 0) { + opCode = asOpCode(word++); // this is the opcode embedded in the SpecConstantOp. + --numOperands; + } + } + + switch (spv::InstructionDesc[std::uint32_t(opCode)].operands.getClass(op)) { + case spv::OperandId: + case spv::OperandScope: + case spv::OperandMemorySemantics: + idBuffer[idBufferPos] = asId(word); + idBufferPos = (idBufferPos + 1) % idBufferSize; + idFn(asId(word++)); + break; + + case spv::OperandVariableIds: + for (unsigned i = 0; i < numOperands; ++i) + idFn(asId(word++)); + return nextInst; + + case spv::OperandVariableLiterals: + // for clarity + // if (opCode == spv::OpDecorate && asDecoration(word - 1) == spv::DecorationBuiltIn) { + // ++word; + // --numOperands; + // } + // word += numOperands; + return nextInst; + + case spv::OperandVariableLiteralId: { + if (opCode == spv::Op::OpSwitch) { + // word-2 is the position of the selector ID. OpSwitch Literals match its type. + // In case the IDs are currently being remapped, we get the word[-2] ID from + // the circular idBuffer. + const unsigned literalSizePos = (idBufferPos+idBufferSize-2) % idBufferSize; + const unsigned literalSize = idTypeSizeInWords(idBuffer[literalSizePos]); + const unsigned numLiteralIdPairs = (nextInst-word) / (1+literalSize); + + if (errorLatch) + return -1; + + for (unsigned arg=0; arg instPos; + instPos.reserve(unsigned(spv.size()) / 16); // initial estimate; can grow if needed. + + // Build local table of instruction start positions + process( + [&](spv::Op, unsigned start) { instPos.push_back(start); return true; }, + op_fn_nop); + + if (errorLatch) + return; + + // Window size for context-sensitive canonicalization values + // Empirical best size from a single data set. TODO: Would be a good tunable. + // We essentially perform a little convolution around each instruction, + // to capture the flavor of nearby code, to hopefully match to similar + // code in other modules. + static const unsigned windowSize = 2; + + for (unsigned entry = 0; entry < unsigned(instPos.size()); ++entry) { + const unsigned start = instPos[entry]; + const spv::Op opCode = asOpCode(start); + + if (opCode == spv::Op::OpFunction) + fnId = asId(start + 2); + + if (opCode == spv::Op::OpFunctionEnd) + fnId = spv::NoResult; + + if (fnId != spv::NoResult) { // if inside a function + if (spv::InstructionDesc[std::uint32_t(opCode)].hasResult()) { + const unsigned word = start + (spv::InstructionDesc[std::uint32_t(opCode)].hasType() ? 2 : 1); + const spv::Id resId = asId(word); + std::uint32_t hashval = fnId * 17; // small prime + + for (unsigned i = entry-1; i >= entry-windowSize; --i) { + if (asOpCode(instPos[i]) == spv::Op::OpFunction) + break; + hashval = hashval * 30103 + asOpCodeHash(instPos[i]); // 30103 = semiarbitrary prime + } + + for (unsigned i = entry; i <= entry + windowSize; ++i) { + if (asOpCode(instPos[i]) == spv::Op::OpFunctionEnd) + break; + hashval = hashval * 30103 + asOpCodeHash(instPos[i]); // 30103 = semiarbitrary prime + } + + if (isOldIdUnmapped(resId)) { + localId(resId, nextUnusedId(hashval % softTypeIdLimit + firstMappedID)); + if (errorLatch) + return; + } + + } + } + } + + spv::Op thisOpCode(spv::Op::OpNop); + std::unordered_map opCounter; + int idCounter(0); + fnId = spv::NoResult; + + process( + [&](spv::Op opCode, unsigned start) { + switch (opCode) { + case spv::Op::OpFunction: + // Reset counters at each function + idCounter = 0; + opCounter.clear(); + fnId = asId(start + 2); + break; + + case spv::Op::OpImageSampleImplicitLod: + case spv::Op::OpImageSampleExplicitLod: + case spv::Op::OpImageSampleDrefImplicitLod: + case spv::Op::OpImageSampleDrefExplicitLod: + case spv::Op::OpImageSampleProjImplicitLod: + case spv::Op::OpImageSampleProjExplicitLod: + case spv::Op::OpImageSampleProjDrefImplicitLod: + case spv::Op::OpImageSampleProjDrefExplicitLod: + case spv::Op::OpDot: + case spv::Op::OpCompositeExtract: + case spv::Op::OpCompositeInsert: + case spv::Op::OpVectorShuffle: + case spv::Op::OpLabel: + case spv::Op::OpVariable: + + case spv::Op::OpAccessChain: + case spv::Op::OpLoad: + case spv::Op::OpStore: + case spv::Op::OpCompositeConstruct: + case spv::Op::OpFunctionCall: + ++opCounter[std::uint32_t(opCode)]; + idCounter = 0; + thisOpCode = opCode; + break; + default: + thisOpCode = spv::Op::OpNop; + } + + return false; + }, + + [&](spv::Id& id) { + if (thisOpCode != spv::Op::OpNop) { + ++idCounter; + const std::uint32_t hashval = + // Explicitly cast operands to unsigned int to avoid integer + // promotion to signed int followed by integer overflow, + // which would result in undefined behavior. + static_cast(opCounter[std::uint32_t(thisOpCode)]) + * std::uint32_t(thisOpCode) + * 50047 + + idCounter + + static_cast(fnId) * 117; + + if (isOldIdUnmapped(id)) + localId(id, nextUnusedId(hashval % softTypeIdLimit + firstMappedID)); + } + }); + } + + // EXPERIMENTAL: forward IO and uniform load/stores into operands + // This produces invalid Schema-0 SPIRV + void spirvbin_t::forwardLoadStores() + { + idset_t fnLocalVars; // set of function local vars + idmap_t idMap; // Map of load result IDs to what they load + + // EXPERIMENTAL: Forward input and access chain loads into consumptions + process( + [&](spv::Op opCode, unsigned start) { + // Add inputs and uniforms to the map + if ((opCode == spv::Op::OpVariable && asWordCount(start) == 4) && + (spv[start+3] == std::uint32_t(spv::StorageClass::Uniform) || + spv[start+3] == std::uint32_t(spv::StorageClass::UniformConstant) || + spv[start+3] == std::uint32_t(spv::StorageClass::Input))) + fnLocalVars.insert(asId(start+2)); + + if (opCode == spv::Op::OpAccessChain && fnLocalVars.count(asId(start+3)) > 0) + fnLocalVars.insert(asId(start+2)); + + if (opCode == spv::Op::OpLoad && fnLocalVars.count(asId(start+3)) > 0) { + idMap[asId(start+2)] = asId(start+3); + stripInst(start); + } + + return false; + }, + + [&](spv::Id& id) { if (idMap.find(id) != idMap.end()) id = idMap[id]; } + ); + + if (errorLatch) + return; + + // EXPERIMENTAL: Implicit output stores + fnLocalVars.clear(); + idMap.clear(); + + process( + [&](spv::Op opCode, unsigned start) { + // Add inputs and uniforms to the map + if ((opCode == spv::Op::OpVariable && asWordCount(start) == 4) && + (spv[start+3] == std::uint32_t(spv::StorageClass::Output))) + fnLocalVars.insert(asId(start+2)); + + if (opCode == spv::Op::OpStore && fnLocalVars.count(asId(start+1)) > 0) { + idMap[asId(start+2)] = asId(start+1); + stripInst(start); + } + + return false; + }, + op_fn_nop); + + if (errorLatch) + return; + + process( + inst_fn_nop, + [&](spv::Id& id) { if (idMap.find(id) != idMap.end()) id = idMap[id]; } + ); + + if (errorLatch) + return; + + strip(); // strip out data we decided to eliminate + } + + // optimize loads and stores + void spirvbin_t::optLoadStore() + { + idset_t fnLocalVars; // candidates for removal (only locals) + idmap_t idMap; // Map of load result IDs to what they load + blockmap_t blockMap; // Map of IDs to blocks they first appear in + int blockNum = 0; // block count, to avoid crossing flow control + + // Find all the function local pointers stored at most once, and not via access chains + process( + [&](spv::Op opCode, unsigned start) { + const int wordCount = asWordCount(start); + + // Count blocks, so we can avoid crossing flow control + if (isFlowCtrl(opCode)) + ++blockNum; + + // Add local variables to the map + if ((opCode == spv::Op::OpVariable && spv[start+3] == std::uint32_t(spv::StorageClass::Function) && asWordCount(start) == 4)) { + fnLocalVars.insert(asId(start+2)); + return true; + } + + // Ignore process vars referenced via access chain + if ((opCode == spv::Op::OpAccessChain || opCode == spv::Op::OpInBoundsAccessChain) && fnLocalVars.count(asId(start+3)) > 0) { + fnLocalVars.erase(asId(start+3)); + idMap.erase(asId(start+3)); + return true; + } + + if (opCode == spv::Op::OpLoad && fnLocalVars.count(asId(start+3)) > 0) { + const spv::Id varId = asId(start+3); + + // Avoid loads before stores + if (idMap.find(varId) == idMap.end()) { + fnLocalVars.erase(varId); + idMap.erase(varId); + } + + // don't do for volatile references + if (wordCount > 4 && (spv[start+4] & std::uint32_t(spv::MemoryAccessMask::Volatile))) { + fnLocalVars.erase(varId); + idMap.erase(varId); + } + + // Handle flow control + if (blockMap.find(varId) == blockMap.end()) { + blockMap[varId] = blockNum; // track block we found it in. + } else if (blockMap[varId] != blockNum) { + fnLocalVars.erase(varId); // Ignore if crosses flow control + idMap.erase(varId); + } + + return true; + } + + if (opCode == spv::Op::OpStore && fnLocalVars.count(asId(start+1)) > 0) { + const spv::Id varId = asId(start+1); + + if (idMap.find(varId) == idMap.end()) { + idMap[varId] = asId(start+2); + } else { + // Remove if it has more than one store to the same pointer + fnLocalVars.erase(varId); + idMap.erase(varId); + } + + // don't do for volatile references + if (wordCount > 3 && (spv[start+3] & std::uint32_t(spv::MemoryAccessMask::Volatile))) { + fnLocalVars.erase(asId(start+3)); + idMap.erase(asId(start+3)); + } + + // Handle flow control + if (blockMap.find(varId) == blockMap.end()) { + blockMap[varId] = blockNum; // track block we found it in. + } else if (blockMap[varId] != blockNum) { + fnLocalVars.erase(varId); // Ignore if crosses flow control + idMap.erase(varId); + } + + return true; + } + + return false; + }, + + // If local var id used anywhere else, don't eliminate + [&](spv::Id& id) { + if (fnLocalVars.count(id) > 0) { + fnLocalVars.erase(id); + idMap.erase(id); + } + } + ); + + if (errorLatch) + return; + + process( + [&](spv::Op opCode, unsigned start) { + if (opCode == spv::Op::OpLoad && fnLocalVars.count(asId(start+3)) > 0) + idMap[asId(start+2)] = idMap[asId(start+3)]; + return false; + }, + op_fn_nop); + + if (errorLatch) + return; + + // Chase replacements to their origins, in case there is a chain such as: + // 2 = store 1 + // 3 = load 2 + // 4 = store 3 + // 5 = load 4 + // We want to replace uses of 5 with 1. + for (const auto& idPair : idMap) { + spv::Id id = idPair.first; + while (idMap.find(id) != idMap.end()) // Chase to end of chain + id = idMap[id]; + + idMap[idPair.first] = id; // replace with final result + } + + // Remove the load/store/variables for the ones we've discovered + process( + [&](spv::Op opCode, unsigned start) { + if ((opCode == spv::Op::OpLoad && fnLocalVars.count(asId(start+3)) > 0) || + (opCode == spv::Op::OpStore && fnLocalVars.count(asId(start+1)) > 0) || + (opCode == spv::Op::OpVariable && fnLocalVars.count(asId(start+2)) > 0)) { + + stripInst(start); + return true; + } + + return false; + }, + + [&](spv::Id& id) { + if (idMap.find(id) != idMap.end()) id = idMap[id]; + } + ); + + if (errorLatch) + return; + + strip(); // strip out data we decided to eliminate + } + + // remove bodies of uncalled functions + void spirvbin_t::dceFuncs() + { + msg(3, 2, std::string("Removing Dead Functions: ")); + + // TODO: There are more efficient ways to do this. + bool changed = true; + + while (changed) { + changed = false; + + for (auto fn = fnPos.begin(); fn != fnPos.end(); ) { + if (fn->first == entryPoint) { // don't DCE away the entry point! + ++fn; + continue; + } + + const auto call_it = fnCalls.find(fn->first); + + if (call_it == fnCalls.end() || call_it->second == 0) { + changed = true; + stripRange.push_back(fn->second); + + // decrease counts of called functions + process( + [&](spv::Op opCode, unsigned start) { + if (opCode == spv::Op::OpFunctionCall) { + const auto call_it = fnCalls.find(asId(start + 3)); + if (call_it != fnCalls.end()) { + if (--call_it->second <= 0) + fnCalls.erase(call_it); + } + } + + return true; + }, + op_fn_nop, + fn->second.first, + fn->second.second); + + if (errorLatch) + return; + + fn = fnPos.erase(fn); + } else ++fn; + } + } + } + + // remove unused function variables + decorations + void spirvbin_t::dceVars() + { + msg(3, 2, std::string("DCE Vars: ")); + + std::unordered_map varUseCount; + + // Count function variable use + process( + [&](spv::Op opCode, unsigned start) { + if (opCode == spv::Op::OpVariable) { + ++varUseCount[asId(start+2)]; + return true; + } else if (opCode == spv::Op::OpEntryPoint) { + const int wordCount = asWordCount(start); + for (int i = 4; i < wordCount; i++) { + ++varUseCount[asId(start+i)]; + } + return true; + } else + return false; + }, + + [&](spv::Id& id) { if (varUseCount[id]) ++varUseCount[id]; } + ); + + if (errorLatch) + return; + + // Remove single-use function variables + associated decorations and names + process( + [&](spv::Op opCode, unsigned start) { + spv::Id id = spv::NoResult; + if (opCode == spv::Op::OpVariable) + id = asId(start+2); + if (opCode == spv::Op::OpDecorate || opCode == spv::Op::OpName) + id = asId(start+1); + + if (id != spv::NoResult && varUseCount[id] == 1) + stripInst(start); + + return true; + }, + op_fn_nop); + } + + // remove unused types + void spirvbin_t::dceTypes() + { + std::vector isType(bound(), false); + + // for speed, make O(1) way to get to type query (map is log(n)) + for (const auto typeStart : typeConstPos) + isType[asTypeConstId(typeStart)] = true; + + std::unordered_map typeUseCount; + + // This is not the most efficient algorithm, but this is an offline tool, and + // it's easy to write this way. Can be improved opportunistically if needed. + bool changed = true; + while (changed) { + changed = false; + strip(); + typeUseCount.clear(); + + // Count total type usage + process(inst_fn_nop, + [&](spv::Id& id) { if (isType[id]) ++typeUseCount[id]; } + ); + + if (errorLatch) + return; + + // Remove single reference types + for (const auto typeStart : typeConstPos) { + const spv::Id typeId = asTypeConstId(typeStart); + if (typeUseCount[typeId] == 1) { + changed = true; + --typeUseCount[typeId]; + stripInst(typeStart); + } + } + + if (errorLatch) + return; + } + } + +#ifdef NOTDEF + bool spirvbin_t::matchType(const spirvbin_t::globaltypes_t& globalTypes, spv::Id lt, spv::Id gt) const + { + // Find the local type id "lt" and global type id "gt" + const auto lt_it = typeConstPosR.find(lt); + if (lt_it == typeConstPosR.end()) + return false; + + const auto typeStart = lt_it->second; + + // Search for entry in global table + const auto gtype = globalTypes.find(gt); + if (gtype == globalTypes.end()) + return false; + + const auto& gdata = gtype->second; + + // local wordcount and opcode + const int wordCount = asWordCount(typeStart); + const spv::Op opCode = asOpCode(typeStart); + + // no type match if opcodes don't match, or operand count doesn't match + if (opCode != opOpCode(gdata[0]) || wordCount != opWordCount(gdata[0])) + return false; + + const unsigned numOperands = wordCount - 2; // all types have a result + + const auto cmpIdRange = [&](range_t range) { + for (int x=range.first; xsecond; + } + + // Hash types to canonical values. This can return ID collisions (it's a bit + // inevitable): it's up to the caller to handle that gracefully. + std::uint32_t spirvbin_t::hashType(unsigned typeStart) const + { + const unsigned wordCount = asWordCount(typeStart); + const spv::Op opCode = asOpCode(typeStart); + + switch (opCode) { + case spv::Op::OpTypeVoid: return 0; + case spv::Op::OpTypeBool: return 1; + case spv::Op::OpTypeInt: return 3 + (spv[typeStart+3]); + case spv::Op::OpTypeFloat: return 5; + case spv::Op::OpTypeVector: + return 6 + hashType(idPos(spv[typeStart+2])) * (spv[typeStart+3] - 1); + case spv::Op::OpTypeMatrix: + return 30 + hashType(idPos(spv[typeStart+2])) * (spv[typeStart+3] - 1); + case spv::Op::OpTypeImage: + return 120 + hashType(idPos(spv[typeStart+2])) + + spv[typeStart+3] + // dimensionality + spv[typeStart+4] * 8 * 16 + // depth + spv[typeStart+5] * 4 * 16 + // arrayed + spv[typeStart+6] * 2 * 16 + // multisampled + spv[typeStart+7] * 1 * 16; // format + case spv::Op::OpTypeSampler: + return 500; + case spv::Op::OpTypeSampledImage: + return 502; + case spv::Op::OpTypeArray: + return 501 + hashType(idPos(spv[typeStart+2])) * spv[typeStart+3]; + case spv::Op::OpTypeRuntimeArray: + return 5000 + hashType(idPos(spv[typeStart+2])); + case spv::Op::OpTypeStruct: + { + std::uint32_t hash = 10000; + for (unsigned w=2; w < wordCount; ++w) + hash += w * hashType(idPos(spv[typeStart+w])); + return hash; + } + + case spv::Op::OpTypeOpaque: return 6000 + spv[typeStart+2]; + case spv::Op::OpTypePointer: return 100000 + hashType(idPos(spv[typeStart+3])); + case spv::Op::OpTypeFunction: + { + std::uint32_t hash = 200000; + for (unsigned w=2; w < wordCount; ++w) + hash += w * hashType(idPos(spv[typeStart+w])); + return hash; + } + + case spv::Op::OpTypeEvent: return 300000; + case spv::Op::OpTypeDeviceEvent: return 300001; + case spv::Op::OpTypeReserveId: return 300002; + case spv::Op::OpTypeQueue: return 300003; + case spv::Op::OpTypePipe: return 300004; + case spv::Op::OpConstantTrue: return 300007; + case spv::Op::OpConstantFalse: return 300008; + case spv::Op::OpConstantComposite: + { + std::uint32_t hash = 300011 + hashType(idPos(spv[typeStart+1])); + for (unsigned w=3; w < wordCount; ++w) + hash += w * hashType(idPos(spv[typeStart+w])); + return hash; + } + case spv::Op::OpConstant: + { + std::uint32_t hash = 400011 + hashType(idPos(spv[typeStart+1])); + for (unsigned w=3; w < wordCount; ++w) + hash += w * spv[typeStart+w]; + return hash; + } + case spv::Op::OpConstantNull: + { + std::uint32_t hash = 500009 + hashType(idPos(spv[typeStart+1])); + return hash; + } + case spv::Op::OpConstantSampler: + { + std::uint32_t hash = 600011 + hashType(idPos(spv[typeStart+1])); + for (unsigned w=3; w < wordCount; ++w) + hash += w * spv[typeStart+w]; + return hash; + } + + default: + error("unknown type opcode"); + return 0; + } + } + + void spirvbin_t::mapTypeConst() + { + globaltypes_t globalTypeMap; + + msg(3, 2, std::string("Remapping Consts & Types: ")); + + static const std::uint32_t softTypeIdLimit = 3011; // small prime. TODO: get from options + static const std::uint32_t firstMappedID = 8; // offset into ID space + + for (auto& typeStart : typeConstPos) { + const spv::Id resId = asTypeConstId(typeStart); + const std::uint32_t hashval = hashType(typeStart); + + if (errorLatch) + return; + + if (isOldIdUnmapped(resId)) { + localId(resId, nextUnusedId(hashval % softTypeIdLimit + firstMappedID)); + if (errorLatch) + return; + } + } + } + + // Strip a single binary by removing ranges given in stripRange + void spirvbin_t::strip() + { + if (stripRange.empty()) // nothing to do + return; + + // Sort strip ranges in order of traversal + std::sort(stripRange.begin(), stripRange.end()); + + // Allocate a new binary big enough to hold old binary + // We'll step this iterator through the strip ranges as we go through the binary + auto strip_it = stripRange.begin(); + + int strippedPos = 0; + for (unsigned word = 0; word < unsigned(spv.size()); ++word) { + while (strip_it != stripRange.end() && word >= strip_it->second) + ++strip_it; + + if (strip_it == stripRange.end() || word < strip_it->first || word >= strip_it->second) + spv[strippedPos++] = spv[word]; + } + + spv.resize(strippedPos); + stripRange.clear(); + + buildLocalMaps(); + } + + // Strip a single binary by removing ranges given in stripRange + void spirvbin_t::remap(std::uint32_t opts) + { + options = opts; + + // Set up opcode tables from SpvDoc + spv::Parameterize(); + + validate(); // validate header + buildLocalMaps(); // build ID maps + + msg(3, 4, std::string("ID bound: ") + std::to_string(bound())); + + if (options & STRIP) stripDebug(); + if (errorLatch) return; + + strip(); // strip out data we decided to eliminate + if (errorLatch) return; + + if (options & OPT_LOADSTORE) optLoadStore(); + if (errorLatch) return; + + if (options & OPT_FWD_LS) forwardLoadStores(); + if (errorLatch) return; + + if (options & DCE_FUNCS) dceFuncs(); + if (errorLatch) return; + + if (options & DCE_VARS) dceVars(); + if (errorLatch) return; + + if (options & DCE_TYPES) dceTypes(); + if (errorLatch) return; + + strip(); // strip out data we decided to eliminate + if (errorLatch) return; + + stripDeadRefs(); // remove references to things we DCEed + if (errorLatch) return; + + // after the last strip, we must clean any debug info referring to now-deleted data + + if (options & MAP_TYPES) mapTypeConst(); + if (errorLatch) return; + + if (options & MAP_NAMES) mapNames(); + if (errorLatch) return; + + if (options & MAP_FUNCS) mapFnBodies(); + if (errorLatch) return; + + if (options & MAP_ALL) { + mapRemainder(); // map any unmapped IDs + if (errorLatch) return; + + applyMap(); // Now remap each shader to the new IDs we've come up with + if (errorLatch) return; + } + } + + // remap from a memory image + void spirvbin_t::remap(std::vector& in_spv, const std::vector& whiteListStrings, + std::uint32_t opts) + { + stripWhiteList = whiteListStrings; + spv.swap(in_spv); + remap(opts); + spv.swap(in_spv); + } + + // remap from a memory image - legacy interface without white list + void spirvbin_t::remap(std::vector& in_spv, std::uint32_t opts) + { + stripWhiteList.clear(); + spv.swap(in_spv); + remap(opts); + spv.swap(in_spv); + } + +} // namespace SPV + diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SPVRemapper.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SPVRemapper.h new file mode 100644 index 0000000000..d4c2295c9c --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SPVRemapper.h @@ -0,0 +1,300 @@ +// +// Copyright (C) 2015 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef SPIRVREMAPPER_H +#define SPIRVREMAPPER_H + +#include +#include +#include +#include + +#ifdef GLSLANG_IS_SHARED_LIBRARY + #ifdef _WIN32 + #ifdef GLSLANG_EXPORTING + #define GLSLANG_EXPORT __declspec(dllexport) + #else + #define GLSLANG_EXPORT __declspec(dllimport) + #endif + #elif __GNUC__ >= 4 + #define GLSLANG_EXPORT __attribute__((visibility("default"))) + #endif +#endif // GLSLANG_IS_SHARED_LIBRARY +#ifndef GLSLANG_EXPORT +#define GLSLANG_EXPORT +#endif + +namespace spv { + +class spirvbin_base_t +{ +public: + enum Options { + NONE = 0, + STRIP = (1<<0), + MAP_TYPES = (1<<1), + MAP_NAMES = (1<<2), + MAP_FUNCS = (1<<3), + DCE_FUNCS = (1<<4), + DCE_VARS = (1<<5), + DCE_TYPES = (1<<6), + OPT_LOADSTORE = (1<<7), + OPT_FWD_LS = (1<<8), // EXPERIMENTAL: PRODUCES INVALID SCHEMA-0 SPIRV + MAP_ALL = (MAP_TYPES | MAP_NAMES | MAP_FUNCS), + DCE_ALL = (DCE_FUNCS | DCE_VARS | DCE_TYPES), + OPT_ALL = (OPT_LOADSTORE), + + ALL_BUT_STRIP = (MAP_ALL | DCE_ALL | OPT_ALL), + DO_EVERYTHING = (STRIP | ALL_BUT_STRIP) + }; +}; + +} // namespace SPV + +#include +#include +#include +#include +#include +#include +#include + +#include "spirv.hpp11" + +namespace spv { + +static inline constexpr Id NoResult = 0; + +// class to hold SPIR-V binary data for remapping, DCE, and debug stripping +class GLSLANG_EXPORT spirvbin_t : public spirvbin_base_t +{ +public: + spirvbin_t(int verbose = 0) : entryPoint(spv::NoResult), largestNewId(0), verbose(verbose), errorLatch(false) + { } + + virtual ~spirvbin_t() { } + + // remap on an existing binary in memory + void remap(std::vector& spv, const std::vector& whiteListStrings, + std::uint32_t opts = DO_EVERYTHING); + + // remap on an existing binary in memory - legacy interface without white list + void remap(std::vector& spv, std::uint32_t opts = DO_EVERYTHING); + + // Type for error/log handler functions + typedef std::function errorfn_t; + typedef std::function logfn_t; + + // Register error/log handling functions (can be lambda fn / functor / etc) + static void registerErrorHandler(errorfn_t handler) { errorHandler = handler; } + static void registerLogHandler(logfn_t handler) { logHandler = handler; } + +protected: + // This can be overridden to provide other message behavior if needed + virtual void msg(int minVerbosity, int indent, const std::string& txt) const; + +private: + // Local to global, or global to local ID map + typedef std::unordered_map idmap_t; + typedef std::unordered_set idset_t; + typedef std::unordered_map blockmap_t; + + void remap(std::uint32_t opts = DO_EVERYTHING); + + // Map of names to IDs + typedef std::unordered_map namemap_t; + + typedef std::uint32_t spirword_t; + + typedef std::pair range_t; + typedef std::function idfn_t; + typedef std::function instfn_t; + + // Special Values for ID map: + static const spv::Id unmapped; // unchanged from default value + static const spv::Id unused; // unused ID + static const int header_size; // SPIR header = 5 words + + class id_iterator_t; + + // For mapping type entries between different shaders + typedef std::vector typeentry_t; + typedef std::map globaltypes_t; + + // A set that preserves position order, and a reverse map + typedef std::set posmap_t; + typedef std::unordered_map posmap_rev_t; + + // Maps and ID to the size of its base type, if known. + typedef std::unordered_map typesize_map_t; + + // handle error + void error(const std::string& txt) const { errorLatch = true; errorHandler(txt); } + + bool isConstOp(spv::Op opCode) const; + bool isTypeOp(spv::Op opCode) const; + bool isStripOp(spv::Op opCode) const; + bool isFlowCtrl(spv::Op opCode) const; + range_t literalRange(spv::Op opCode) const; + range_t typeRange(spv::Op opCode) const; + range_t constRange(spv::Op opCode) const; + unsigned typeSizeInWords(spv::Id id) const; + unsigned idTypeSizeInWords(spv::Id id) const; + + bool isStripOp(spv::Op opCode, unsigned start) const; + + spv::Id& asId(unsigned word) { return spv[word]; } + const spv::Id& asId(unsigned word) const { return spv[word]; } + spv::Op asOpCode(unsigned word) const { return opOpCode(spv[word]); } + std::uint32_t asOpCodeHash(unsigned word); + spv::Decoration asDecoration(unsigned word) const { return spv::Decoration(spv[word]); } + unsigned asWordCount(unsigned word) const { return opWordCount(spv[word]); } + spv::Id asTypeConstId(unsigned word) const { return asId(word + (isTypeOp(asOpCode(word)) ? 1 : 2)); } + unsigned idPos(spv::Id id) const; + + static unsigned opWordCount(spirword_t data) { return data >> spv::WordCountShift; } + static spv::Op opOpCode(spirword_t data) { return spv::Op(data & spv::OpCodeMask); } + + // Header access & set methods + spirword_t magic() const { return spv[0]; } // return magic number + spirword_t bound() const { return spv[3]; } // return Id bound from header + spirword_t bound(spirword_t b) { return spv[3] = b; } + spirword_t genmagic() const { return spv[2]; } // generator magic + spirword_t genmagic(spirword_t m) { return spv[2] = m; } + spirword_t schemaNum() const { return spv[4]; } // schema number from header + + // Mapping fns: get + spv::Id localId(spv::Id id) const { return idMapL[id]; } + + // Mapping fns: set + inline spv::Id localId(spv::Id id, spv::Id newId); + void countIds(spv::Id id); + + // Return next unused new local ID. + // NOTE: boost::dynamic_bitset would be more efficient due to find_next(), + // which std::vector doens't have. + inline spv::Id nextUnusedId(spv::Id id); + + void buildLocalMaps(); + std::string literalString(unsigned word) const; // Return literal as a std::string + int literalStringWords(const std::string& str) const { return (int(str.size())+4)/4; } + + bool isNewIdMapped(spv::Id newId) const { return isMapped(newId); } + bool isOldIdUnmapped(spv::Id oldId) const { return localId(oldId) == unmapped; } + bool isOldIdUnused(spv::Id oldId) const { return localId(oldId) == unused; } + bool isOldIdMapped(spv::Id oldId) const { return !isOldIdUnused(oldId) && !isOldIdUnmapped(oldId); } + bool isFunction(spv::Id oldId) const { return fnPos.find(oldId) != fnPos.end(); } + + // bool matchType(const globaltypes_t& globalTypes, spv::Id lt, spv::Id gt) const; + // spv::Id findType(const globaltypes_t& globalTypes, spv::Id lt) const; + std::uint32_t hashType(unsigned typeStart) const; + + spirvbin_t& process(instfn_t, idfn_t, unsigned begin = 0, unsigned end = 0); + int processInstruction(unsigned word, instfn_t, idfn_t); + + void validate() const; + void mapTypeConst(); + void mapFnBodies(); + void optLoadStore(); + void dceFuncs(); + void dceVars(); + void dceTypes(); + void mapNames(); + void foldIds(); // fold IDs to smallest space + void forwardLoadStores(); // load store forwarding (EXPERIMENTAL) + void offsetIds(); // create relative offset IDs + + void applyMap(); // remap per local name map + void mapRemainder(); // map any IDs we haven't touched yet + void stripDebug(); // strip all debug info + void stripDeadRefs(); // strips debug info for now-dead references after DCE + void strip(); // remove debug symbols + + std::vector spv; // SPIR words + + std::vector stripWhiteList; + + namemap_t nameMap; // ID names from OpName + + // Since we want to also do binary ops, we can't use std::vector. we could use + // boost::dynamic_bitset, but we're trying to avoid a boost dependency. + typedef std::uint64_t bits_t; + std::vector mapped; // which new IDs have been mapped + static const int mBits = sizeof(bits_t) * 4; + + bool isMapped(spv::Id id) const { return id < maxMappedId() && ((mapped[id/mBits] & (1LL<<(id%mBits))) != 0); } + void setMapped(spv::Id id) { resizeMapped(id); mapped[id/mBits] |= (1LL<<(id%mBits)); } + void resizeMapped(spv::Id id) { if (id >= maxMappedId()) mapped.resize(id/mBits+1, 0); } + size_t maxMappedId() const { return mapped.size() * mBits; } + + // Add a strip range for a given instruction starting at 'start' + // Note: avoiding brace initializers to please older versions os MSVC. + void stripInst(unsigned start) { stripRange.push_back(range_t(start, start + asWordCount(start))); } + + // Function start and end. use unordered_map because we'll have + // many fewer functions than IDs. + std::unordered_map fnPos; + + // Which functions are called, anywhere in the module, with a call count + std::unordered_map fnCalls; + + posmap_t typeConstPos; // word positions that define types & consts (ordered) + posmap_rev_t idPosR; // reverse map from IDs to positions + typesize_map_t idTypeSizeMap; // maps each ID to its type size, if known. + + std::vector idMapL; // ID {M}ap from {L}ocal to {G}lobal IDs + + spv::Id entryPoint; // module entry point + spv::Id largestNewId; // biggest new ID we have mapped anything to + + // Sections of the binary to strip, given as [begin,end) + std::vector stripRange; + + // processing options: + std::uint32_t options; + int verbose; // verbosity level + + // Error latch: this is set if the error handler is ever executed. It would be better to + // use a try/catch block and throw, but that's not desired for certain environments, so + // this is the alternative. + mutable bool errorLatch; + + static errorfn_t errorHandler; + static logfn_t logHandler; +}; + +} // namespace SPV + +#endif // SPIRVREMAPPER_H diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SpvBuilder.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SpvBuilder.cpp new file mode 100644 index 0000000000..0e4237fb8a --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SpvBuilder.cpp @@ -0,0 +1,4833 @@ +// +// Copyright (C) 2014-2015 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// +// Helper for making SPIR-V IR. Generally, this is documented in the header +// SpvBuilder.h. +// + +#include +#include + +#include +#include + +#include "SpvBuilder.h" +#include "spvUtil.h" +#include "hex_float.h" + +#ifndef _WIN32 + #include +#endif + +namespace spv { + +Builder::Builder(unsigned int spvVersion, unsigned int magicNumber, SpvBuildLogger* buildLogger) : + spvVersion(spvVersion), + sourceLang(SourceLanguage::Unknown), + sourceVersion(0), + addressModel(AddressingModel::Logical), + memoryModel(MemoryModel::GLSL450), + builderNumber(magicNumber), + buildPoint(nullptr), + uniqueId(0), + entryPointFunction(nullptr), + generatingOpCodeForSpecConst(false), + logger(buildLogger) +{ + clearAccessChain(); +} + +Builder::~Builder() +{ +} + +Id Builder::import(const char* name) +{ + Instruction* import = new Instruction(getUniqueId(), NoType, Op::OpExtInstImport); + import->addStringOperand(name); + module.mapInstruction(import); + + imports.push_back(std::unique_ptr(import)); + return import->getResultId(); +} + +// For creating new groupedTypes (will return old type if the requested one was already made). +Id Builder::makeVoidType() +{ + Instruction* type; + if (groupedTypes[enumCast(Op::OpTypeVoid)].size() == 0) { + Id typeId = getUniqueId(); + type = new Instruction(typeId, NoType, Op::OpTypeVoid); + groupedTypes[enumCast(Op::OpTypeVoid)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + // Core OpTypeVoid used for debug void type + if (emitNonSemanticShaderDebugInfo) + debugTypeIdLookup[typeId] = typeId; + } else + type = groupedTypes[enumCast(Op::OpTypeVoid)].back(); + + return type->getResultId(); +} + +Id Builder::makeBoolType() +{ + Instruction* type; + if (groupedTypes[enumCast(Op::OpTypeBool)].size() == 0) { + type = new Instruction(getUniqueId(), NoType, Op::OpTypeBool); + groupedTypes[enumCast(Op::OpTypeBool)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + if (emitNonSemanticShaderDebugInfo) { + auto const debugResultId = makeBoolDebugType(32); + debugTypeIdLookup[type->getResultId()] = debugResultId; + } + + } else + type = groupedTypes[enumCast(Op::OpTypeBool)].back(); + + + return type->getResultId(); +} + +Id Builder::makeSamplerType(const char* debugName) +{ + Instruction* type; + if (groupedTypes[enumCast(Op::OpTypeSampler)].size() == 0) { + type = new Instruction(getUniqueId(), NoType, Op::OpTypeSampler); + groupedTypes[enumCast(Op::OpTypeSampler)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + } else + type = groupedTypes[enumCast(Op::OpTypeSampler)].back(); + + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeOpaqueDebugType(debugName); + debugTypeIdLookup[type->getResultId()] = debugResultId; + } + + return type->getResultId(); +} + +Id Builder::makePointer(StorageClass storageClass, Id pointee) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypePointer)].size(); ++t) { + type = groupedTypes[enumCast(Op::OpTypePointer)][t]; + if (type->getImmediateOperand(0) == (unsigned)storageClass && + type->getIdOperand(1) == pointee) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), NoType, Op::OpTypePointer); + type->reserveOperands(2); + type->addImmediateOperand(storageClass); + type->addIdOperand(pointee); + groupedTypes[enumCast(Op::OpTypePointer)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + if (emitNonSemanticShaderDebugInfo) { + const Id debugResultId = makePointerDebugType(storageClass, pointee); + debugTypeIdLookup[type->getResultId()] = debugResultId; + } + + return type->getResultId(); +} + +Id Builder::makeForwardPointer(StorageClass storageClass) +{ + // Caching/uniquifying doesn't work here, because we don't know the + // pointee type and there can be multiple forward pointers of the same + // storage type. Somebody higher up in the stack must keep track. + Instruction* type = new Instruction(getUniqueId(), NoType, Op::OpTypeForwardPointer); + type->addImmediateOperand(storageClass); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + if (emitNonSemanticShaderDebugInfo) { + const Id debugResultId = makeForwardPointerDebugType(storageClass); + debugTypeIdLookup[type->getResultId()] = debugResultId; + } + return type->getResultId(); +} + +Id Builder::makePointerFromForwardPointer(StorageClass storageClass, Id forwardPointerType, Id pointee) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypePointer)].size(); ++t) { + type = groupedTypes[enumCast(Op::OpTypePointer)][t]; + if (type->getImmediateOperand(0) == (unsigned)storageClass && + type->getIdOperand(1) == pointee) + return type->getResultId(); + } + + type = new Instruction(forwardPointerType, NoType, Op::OpTypePointer); + type->reserveOperands(2); + type->addImmediateOperand(storageClass); + type->addIdOperand(pointee); + groupedTypes[enumCast(Op::OpTypePointer)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + // If we are emitting nonsemantic debuginfo, we need to patch the debug pointer type + // that was emitted alongside the forward pointer, now that we have a pointee debug + // type for it to point to. + if (emitNonSemanticShaderDebugInfo) { + Instruction *debugForwardPointer = module.getInstruction(getDebugType(forwardPointerType)); + assert(getDebugType(pointee)); + debugForwardPointer->setIdOperand(2, getDebugType(pointee)); + } + + return type->getResultId(); +} + +Id Builder::makeIntegerType(int width, bool hasSign) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeInt)].size(); ++t) { + type = groupedTypes[enumCast(Op::OpTypeInt)][t]; + if (type->getImmediateOperand(0) == (unsigned)width && + type->getImmediateOperand(1) == (hasSign ? 1u : 0u)) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), NoType, Op::OpTypeInt); + type->reserveOperands(2); + type->addImmediateOperand(width); + type->addImmediateOperand(hasSign ? 1 : 0); + groupedTypes[enumCast(Op::OpTypeInt)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + // deal with capabilities + switch (width) { + case 8: + case 16: + // these are currently handled by storage-type declarations and post processing + break; + case 64: + addCapability(Capability::Int64); + break; + default: + break; + } + + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeIntegerDebugType(width, hasSign); + debugTypeIdLookup[type->getResultId()] = debugResultId; + } + + return type->getResultId(); +} + +Id Builder::makeFloatType(int width) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeFloat)].size(); ++t) { + type = groupedTypes[enumCast(Op::OpTypeFloat)][t]; + if (type->getNumOperands() != 1) { + continue; + } + if (type->getImmediateOperand(0) == (unsigned)width) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), NoType, Op::OpTypeFloat); + type->addImmediateOperand(width); + groupedTypes[enumCast(Op::OpTypeFloat)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + // deal with capabilities + switch (width) { + case 16: + // currently handled by storage-type declarations and post processing + break; + case 64: + addCapability(Capability::Float64); + break; + default: + break; + } + + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeFloatDebugType(width); + debugTypeIdLookup[type->getResultId()] = debugResultId; + } + + return type->getResultId(); +} + +Id Builder::makeBFloat16Type() +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeFloat)].size(); ++t) { + type = groupedTypes[enumCast(Op::OpTypeFloat)][t]; + if (type->getNumOperands() != 2) { + continue; + } + if (type->getImmediateOperand(0) == (unsigned)16 && + type->getImmediateOperand(1) == FPEncoding::BFloat16KHR) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), NoType, Op::OpTypeFloat); + type->addImmediateOperand(16); + type->addImmediateOperand(FPEncoding::BFloat16KHR); + groupedTypes[enumCast(Op::OpTypeFloat)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + addExtension(spv::E_SPV_KHR_bfloat16); + addCapability(Capability::BFloat16TypeKHR); + +#if 0 + // XXX not supported + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeFloatDebugType(width); + debugTypeIdLookup[type->getResultId()] = debugResultId; + } +#endif + + return type->getResultId(); +} + +Id Builder::makeFloatE5M2Type() +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeFloat)].size(); ++t) { + type = groupedTypes[enumCast(Op::OpTypeFloat)][t]; + if (type->getNumOperands() != 2) { + continue; + } + if (type->getImmediateOperand(0) == (unsigned)8 && + type->getImmediateOperand(1) == FPEncoding::Float8E5M2EXT) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), NoType, Op::OpTypeFloat); + type->addImmediateOperand(8); + type->addImmediateOperand(FPEncoding::Float8E5M2EXT); + groupedTypes[enumCast(Op::OpTypeFloat)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + addExtension(spv::E_SPV_EXT_float8); + addCapability(Capability::Float8EXT); + +#if 0 + // XXX not supported + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeFloatDebugType(width); + debugTypeIdLookup[type->getResultId()] = debugResultId; + } +#endif + + return type->getResultId(); +} + +Id Builder::makeFloatE4M3Type() +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeFloat)].size(); ++t) { + type = groupedTypes[enumCast(Op::OpTypeFloat)][t]; + if (type->getNumOperands() != 2) { + continue; + } + if (type->getImmediateOperand(0) == (unsigned)8 && + type->getImmediateOperand(1) == FPEncoding::Float8E4M3EXT) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), NoType, Op::OpTypeFloat); + type->addImmediateOperand(8); + type->addImmediateOperand(FPEncoding::Float8E4M3EXT); + groupedTypes[enumCast(Op::OpTypeFloat)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + addExtension(spv::E_SPV_EXT_float8); + addCapability(Capability::Float8EXT); + +#if 0 + // XXX not supported + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeFloatDebugType(width); + debugTypeIdLookup[type->getResultId()] = debugResultId; + } +#endif + + return type->getResultId(); +} + +// Make a struct without checking for duplication. +// See makeStructResultType() for non-decorated structs +// needed as the result of some instructions, which does +// check for duplicates. +// For compiler-generated structs, debug info is ignored. +Id Builder::makeStructType(const std::vector& members, const std::vector& memberDebugInfo, + const char* name, bool const compilerGenerated) +{ + // Don't look for previous one, because in the general case, + // structs can be duplicated except for decorations. + + // not found, make it + Instruction* type = new Instruction(getUniqueId(), NoType, Op::OpTypeStruct); + for (int op = 0; op < (int)members.size(); ++op) + type->addIdOperand(members[op]); + groupedTypes[enumCast(Op::OpTypeStruct)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + addName(type->getResultId(), name); + + if (emitNonSemanticShaderDebugInfo && !compilerGenerated) { + assert(members.size() == memberDebugInfo.size()); + auto const debugResultId = + makeCompositeDebugType(members, memberDebugInfo, name, NonSemanticShaderDebugInfo100Structure); + debugTypeIdLookup[type->getResultId()] = debugResultId; + } + + return type->getResultId(); +} + +// Make a struct for the simple results of several instructions, +// checking for duplication. +Id Builder::makeStructResultType(Id type0, Id type1) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeStruct)].size(); ++t) { + type = groupedTypes[enumCast(Op::OpTypeStruct)][t]; + if (type->getNumOperands() != 2) + continue; + if (type->getIdOperand(0) != type0 || + type->getIdOperand(1) != type1) + continue; + return type->getResultId(); + } + + // not found, make it + std::vector members; + members.push_back(type0); + members.push_back(type1); + + return makeStructType(members, {}, "ResType"); +} + +Id Builder::makeVectorType(Id component, int size) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeVector)].size(); ++t) { + type = groupedTypes[enumCast(Op::OpTypeVector)][t]; + if (type->getIdOperand(0) == component && + type->getImmediateOperand(1) == (unsigned)size) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), NoType, Op::OpTypeVector); + type->reserveOperands(2); + type->addIdOperand(component); + type->addImmediateOperand(size); + groupedTypes[enumCast(Op::OpTypeVector)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeVectorDebugType(component, size); + debugTypeIdLookup[type->getResultId()] = debugResultId; + } + + return type->getResultId(); +} + +Id Builder::makeMatrixType(Id component, int cols, int rows) +{ + assert(cols <= maxMatrixSize && rows <= maxMatrixSize); + + Id column = makeVectorType(component, rows); + + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeMatrix)].size(); ++t) { + type = groupedTypes[enumCast(Op::OpTypeMatrix)][t]; + if (type->getIdOperand(0) == column && + type->getImmediateOperand(1) == (unsigned)cols) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), NoType, Op::OpTypeMatrix); + type->reserveOperands(2); + type->addIdOperand(column); + type->addImmediateOperand(cols); + groupedTypes[enumCast(Op::OpTypeMatrix)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeMatrixDebugType(column, cols); + debugTypeIdLookup[type->getResultId()] = debugResultId; + } + + return type->getResultId(); +} + +Id Builder::makeCooperativeMatrixTypeKHR(Id component, Id scope, Id rows, Id cols, Id use) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeCooperativeMatrixKHR)].size(); ++t) { + type = groupedTypes[enumCast(Op::OpTypeCooperativeMatrixKHR)][t]; + if (type->getIdOperand(0) == component && + type->getIdOperand(1) == scope && + type->getIdOperand(2) == rows && + type->getIdOperand(3) == cols && + type->getIdOperand(4) == use) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), NoType, Op::OpTypeCooperativeMatrixKHR); + type->reserveOperands(5); + type->addIdOperand(component); + type->addIdOperand(scope); + type->addIdOperand(rows); + type->addIdOperand(cols); + type->addIdOperand(use); + groupedTypes[enumCast(Op::OpTypeCooperativeMatrixKHR)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + if (emitNonSemanticShaderDebugInfo) + { + // Find a name for one of the parameters. It can either come from debuginfo for another + // type, or an OpName from a constant. + auto const findName = [&](Id id) { + Id id2 = getDebugType(id); + for (auto &t : groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic]) { + if (t->getResultId() == id2) { + for (auto &s : strings) { + if (s->getResultId() == t->getIdOperand(2)) { + return s->getNameString(); + } + } + } + } + for (auto &t : names) { + if (t->getIdOperand(0) == id) { + return t->getNameString(); + } + } + return "unknown"; + }; + std::string debugName = "coopmat<"; + debugName += std::string(findName(component)) + ", "; + if (isConstantScalar(scope)) { + debugName += std::string("gl_Scope") + std::string(spv::ScopeToString((spv::Scope)getConstantScalar(scope))) + ", "; + } else { + debugName += std::string(findName(scope)) + ", "; + } + debugName += std::string(findName(rows)) + ", "; + debugName += std::string(findName(cols)) + ">"; + // There's no nonsemantic debug info instruction for cooperative matrix types, + // use opaque composite instead. + auto const debugResultId = makeOpaqueDebugType(debugName.c_str()); + debugTypeIdLookup[type->getResultId()] = debugResultId; + } + + return type->getResultId(); +} + +Id Builder::makeCooperativeMatrixTypeNV(Id component, Id scope, Id rows, Id cols) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeCooperativeMatrixNV)].size(); ++t) { + type = groupedTypes[enumCast(Op::OpTypeCooperativeMatrixNV)][t]; + if (type->getIdOperand(0) == component && type->getIdOperand(1) == scope && type->getIdOperand(2) == rows && + type->getIdOperand(3) == cols) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), NoType, Op::OpTypeCooperativeMatrixNV); + type->reserveOperands(4); + type->addIdOperand(component); + type->addIdOperand(scope); + type->addIdOperand(rows); + type->addIdOperand(cols); + groupedTypes[enumCast(Op::OpTypeCooperativeMatrixNV)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +Id Builder::makeCooperativeMatrixTypeWithSameShape(Id component, Id otherType) +{ + Instruction* instr = module.getInstruction(otherType); + if (instr->getOpCode() == Op::OpTypeCooperativeMatrixNV) { + return makeCooperativeMatrixTypeNV(component, instr->getIdOperand(1), instr->getIdOperand(2), instr->getIdOperand(3)); + } else { + assert(instr->getOpCode() == Op::OpTypeCooperativeMatrixKHR); + return makeCooperativeMatrixTypeKHR(component, instr->getIdOperand(1), instr->getIdOperand(2), instr->getIdOperand(3), instr->getIdOperand(4)); + } +} + +Id Builder::makeCooperativeVectorTypeNV(Id componentType, Id components) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeCooperativeVectorNV)].size(); ++t) { + type = groupedTypes[enumCast(Op::OpTypeCooperativeVectorNV)][t]; + if (type->getIdOperand(0) == componentType && + type->getIdOperand(1) == components) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), NoType, Op::OpTypeCooperativeVectorNV); + type->addIdOperand(componentType); + type->addIdOperand(components); + groupedTypes[enumCast(Op::OpTypeCooperativeVectorNV)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +Id Builder::makeTensorTypeARM(Id elementType, Id rank) +{ + // See if an OpTypeTensorARM with same element type and rank already exists. + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeTensorARM)].size(); ++t) { + const Instruction *type = groupedTypes[enumCast(Op::OpTypeTensorARM)][t]; + if (type->getIdOperand(0) == elementType && type->getIdOperand(1) == rank) + return type->getResultId(); + } + + // Not found, make it. + std::unique_ptr type(new Instruction(getUniqueId(), NoType, Op::OpTypeTensorARM)); + type->addIdOperand(elementType); + type->addIdOperand(rank); + groupedTypes[enumCast(Op::OpTypeTensorARM)].push_back(type.get()); + module.mapInstruction(type.get()); + Id resultID = type->getResultId(); + constantsTypesGlobals.push_back(std::move(type)); + return resultID; +} + +Id Builder::makeGenericType(spv::Op opcode, std::vector& operands) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[enumCast(opcode)].size(); ++t) { + type = groupedTypes[enumCast(opcode)][t]; + if (static_cast(type->getNumOperands()) != operands.size()) + continue; // Number mismatch, find next + + bool match = true; + for (int op = 0; match && op < (int)operands.size(); ++op) { + match = (operands[op].isId ? type->getIdOperand(op) : type->getImmediateOperand(op)) == operands[op].word; + } + if (match) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), NoType, opcode); + type->reserveOperands(operands.size()); + for (size_t op = 0; op < operands.size(); ++op) { + if (operands[op].isId) + type->addIdOperand(operands[op].word); + else + type->addImmediateOperand(operands[op].word); + } + groupedTypes[enumCast(opcode)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +// TODO: performance: track arrays per stride +// If a stride is supplied (non-zero) make an array. +// If no stride (0), reuse previous array types. +// 'size' is an Id of a constant or specialization constant of the array size +Id Builder::makeArrayType(Id element, Id sizeId, int stride) +{ + Instruction* type; + if (stride == 0) { + // try to find existing type + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeArray)].size(); ++t) { + type = groupedTypes[enumCast(Op::OpTypeArray)][t]; + if (type->getIdOperand(0) == element && + type->getIdOperand(1) == sizeId && + explicitlyLaidOut.find(type->getResultId()) == explicitlyLaidOut.end()) + return type->getResultId(); + } + } + + // not found, make it + type = new Instruction(getUniqueId(), NoType, Op::OpTypeArray); + type->reserveOperands(2); + type->addIdOperand(element); + type->addIdOperand(sizeId); + groupedTypes[enumCast(Op::OpTypeArray)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + if (stride != 0) { + explicitlyLaidOut.insert(type->getResultId()); + } + + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeArrayDebugType(element, sizeId); + debugTypeIdLookup[type->getResultId()] = debugResultId; + } + + return type->getResultId(); +} + +Id Builder::makeRuntimeArray(Id element) +{ + Instruction* type = new Instruction(getUniqueId(), NoType, Op::OpTypeRuntimeArray); + type->addIdOperand(element); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeArrayDebugType(element, makeUintConstant(0)); + debugTypeIdLookup[type->getResultId()] = debugResultId; + } + + return type->getResultId(); +} + +Id Builder::makeFunctionType(Id returnType, const std::vector& paramTypes) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeFunction)].size(); ++t) { + type = groupedTypes[enumCast(Op::OpTypeFunction)][t]; + if (type->getIdOperand(0) != returnType || (int)paramTypes.size() != type->getNumOperands() - 1) + continue; + bool mismatch = false; + for (int p = 0; p < (int)paramTypes.size(); ++p) { + if (paramTypes[p] != type->getIdOperand(p + 1)) { + mismatch = true; + break; + } + } + if (! mismatch) + { + // If compiling HLSL, glslang will create a wrapper function around the entrypoint. Accordingly, a void(void) + // function type is created for the wrapper function. However, nonsemantic shader debug information is disabled + // while creating the HLSL wrapper. Consequently, if we encounter another void(void) function, we need to create + // the associated debug function type if it hasn't been created yet. + if(emitNonSemanticShaderDebugInfo && getDebugType(type->getResultId()) == NoType) { + assert(sourceLang == spv::SourceLanguage::HLSL); + assert(getTypeClass(returnType) == Op::OpTypeVoid && paramTypes.size() == 0); + + Id id = makeDebugFunctionType(returnType, {}); + debugTypeIdLookup[type->getResultId()] = id; + } + return type->getResultId(); + } + } + + // not found, make it + Id typeId = getUniqueId(); + type = new Instruction(typeId, NoType, Op::OpTypeFunction); + type->reserveOperands(paramTypes.size() + 1); + type->addIdOperand(returnType); + for (int p = 0; p < (int)paramTypes.size(); ++p) + type->addIdOperand(paramTypes[p]); + groupedTypes[enumCast(Op::OpTypeFunction)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + // make debug type and map it + if (emitNonSemanticShaderDebugInfo) { + Id debugTypeId = makeDebugFunctionType(returnType, paramTypes); + debugTypeIdLookup[typeId] = debugTypeId; + } + + return type->getResultId(); +} + +Id Builder::makeDebugFunctionType(Id returnType, const std::vector& paramTypes) +{ + assert(getDebugType(returnType) != NoType); + + Id typeId = getUniqueId(); + auto type = new Instruction(typeId, makeVoidType(), Op::OpExtInst); + type->reserveOperands(paramTypes.size() + 4); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeFunction); + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic)); + type->addIdOperand(getDebugType(returnType)); + for (auto const paramType : paramTypes) { + if (isPointerType(paramType) || isArrayType(paramType)) { + type->addIdOperand(getDebugType(getContainedTypeId(paramType))); + } + else { + type->addIdOperand(getDebugType(paramType)); + } + } + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + return typeId; +} + +Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, bool ms, unsigned sampled, + ImageFormat format, const char* debugName) +{ + assert(sampled == 1 || sampled == 2); + + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeImage)].size(); ++t) { + type = groupedTypes[enumCast(Op::OpTypeImage)][t]; + if (type->getIdOperand(0) == sampledType && + type->getImmediateOperand(1) == (unsigned int)dim && + type->getImmediateOperand(2) == ( depth ? 1u : 0u) && + type->getImmediateOperand(3) == (arrayed ? 1u : 0u) && + type->getImmediateOperand(4) == ( ms ? 1u : 0u) && + type->getImmediateOperand(5) == sampled && + type->getImmediateOperand(6) == (unsigned int)format) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), NoType, Op::OpTypeImage); + type->reserveOperands(7); + type->addIdOperand(sampledType); + type->addImmediateOperand( dim); + type->addImmediateOperand( depth ? 1 : 0); + type->addImmediateOperand(arrayed ? 1 : 0); + type->addImmediateOperand( ms ? 1 : 0); + type->addImmediateOperand(sampled); + type->addImmediateOperand((unsigned int)format); + + groupedTypes[enumCast(Op::OpTypeImage)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + // deal with capabilities + switch (dim) { + case Dim::Buffer: + if (sampled == 1) + addCapability(Capability::SampledBuffer); + else + addCapability(Capability::ImageBuffer); + break; + case Dim::Dim1D: + if (sampled == 1) + addCapability(Capability::Sampled1D); + else + addCapability(Capability::Image1D); + break; + case Dim::Cube: + if (arrayed) { + if (sampled == 1) + addCapability(Capability::SampledCubeArray); + else + addCapability(Capability::ImageCubeArray); + } + break; + case Dim::Rect: + if (sampled == 1) + addCapability(Capability::SampledRect); + else + addCapability(Capability::ImageRect); + break; + case Dim::SubpassData: + addCapability(Capability::InputAttachment); + break; + default: + break; + } + + if (ms) { + if (sampled == 2) { + // Images used with subpass data are not storage + // images, so don't require the capability for them. + if (dim != Dim::SubpassData) + addCapability(Capability::StorageImageMultisample); + if (arrayed) + addCapability(Capability::ImageMSArray); + } + } + + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeOpaqueDebugType(debugName); + debugTypeIdLookup[type->getResultId()] = debugResultId; + } + + return type->getResultId(); +} + +Id Builder::makeSampledImageType(Id imageType, const char* debugName) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeSampledImage)].size(); ++t) { + type = groupedTypes[enumCast(Op::OpTypeSampledImage)][t]; + if (type->getIdOperand(0) == imageType) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), NoType, Op::OpTypeSampledImage); + type->addIdOperand(imageType); + + groupedTypes[enumCast(Op::OpTypeSampledImage)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeOpaqueDebugType(debugName); + debugTypeIdLookup[type->getResultId()] = debugResultId; + } + + return type->getResultId(); +} + +Id Builder::makeDebugInfoNone() +{ + if (debugInfoNone != 0) + return debugInfoNone; + + Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + inst->reserveOperands(2); + inst->addIdOperand(nonSemanticShaderDebugInfo); + inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugInfoNone); + + constantsTypesGlobals.push_back(std::unique_ptr(inst)); + module.mapInstruction(inst); + + debugInfoNone = inst->getResultId(); + + return debugInfoNone; +} + +Id Builder::makeBoolDebugType(int const size) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].size(); ++t) { + type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic][t]; + if (type->getIdOperand(0) == getStringId("bool") && + type->getIdOperand(1) == static_cast(size) && + type->getIdOperand(2) == NonSemanticShaderDebugInfo100Boolean) + return type->getResultId(); + } + + type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + type->reserveOperands(6); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeBasic); + + type->addIdOperand(getStringId("bool")); // name id + type->addIdOperand(makeUintConstant(size)); // size id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Boolean)); // encoding id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100None)); // flags id + + groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +Id Builder::makeIntegerDebugType(int const width, bool const hasSign) +{ + const char* typeName = nullptr; + switch (width) { + case 8: typeName = hasSign ? "int8_t" : "uint8_t"; break; + case 16: typeName = hasSign ? "int16_t" : "uint16_t"; break; + case 64: typeName = hasSign ? "int64_t" : "uint64_t"; break; + default: typeName = hasSign ? "int" : "uint"; + } + auto nameId = getStringId(typeName); + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].size(); ++t) { + type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic][t]; + if (type->getIdOperand(0) == nameId && + type->getIdOperand(1) == static_cast(width) && + type->getIdOperand(2) == (hasSign ? NonSemanticShaderDebugInfo100Signed : NonSemanticShaderDebugInfo100Unsigned)) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + type->reserveOperands(6); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeBasic); + type->addIdOperand(nameId); // name id + type->addIdOperand(makeUintConstant(width)); // size id + if(hasSign == true) { + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Signed)); // encoding id + } else { + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Unsigned)); // encoding id + } + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100None)); // flags id + + groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +Id Builder::makeFloatDebugType(int const width) +{ + const char* typeName = nullptr; + switch (width) { + case 16: typeName = "float16_t"; break; + case 64: typeName = "double"; break; + default: typeName = "float"; break; + } + auto nameId = getStringId(typeName); + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].size(); ++t) { + type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic][t]; + if (type->getIdOperand(0) == nameId && + type->getIdOperand(1) == static_cast(width) && + type->getIdOperand(2) == NonSemanticShaderDebugInfo100Float) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + type->reserveOperands(6); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeBasic); + type->addIdOperand(nameId); // name id + type->addIdOperand(makeUintConstant(width)); // size id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Float)); // encoding id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100None)); // flags id + + groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +Id Builder::makeSequentialDebugType(Id const baseType, Id const componentCount, NonSemanticShaderDebugInfo100Instructions const sequenceType) +{ + assert(sequenceType == NonSemanticShaderDebugInfo100DebugTypeArray || + sequenceType == NonSemanticShaderDebugInfo100DebugTypeVector); + + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedDebugTypes[sequenceType].size(); ++t) { + type = groupedDebugTypes[sequenceType][t]; + if (type->getIdOperand(0) == baseType && + type->getIdOperand(1) == makeUintConstant(componentCount)) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + type->reserveOperands(4); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(sequenceType); + type->addIdOperand(getDebugType(baseType)); // base type + type->addIdOperand(componentCount); // component count + + groupedDebugTypes[sequenceType].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +Id Builder::makeArrayDebugType(Id const baseType, Id const componentCount) +{ + return makeSequentialDebugType(baseType, componentCount, NonSemanticShaderDebugInfo100DebugTypeArray); +} + +Id Builder::makeVectorDebugType(Id const baseType, int const componentCount) +{ + return makeSequentialDebugType(baseType, makeUintConstant(componentCount), NonSemanticShaderDebugInfo100DebugTypeVector); +} + +Id Builder::makeMatrixDebugType(Id const vectorType, int const vectorCount, bool columnMajor) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeMatrix].size(); ++t) { + type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeMatrix][t]; + if (type->getIdOperand(0) == vectorType && + type->getIdOperand(1) == makeUintConstant(vectorCount)) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + type->reserveOperands(5); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeMatrix); + type->addIdOperand(getDebugType(vectorType)); // vector type id + type->addIdOperand(makeUintConstant(vectorCount)); // component count id + type->addIdOperand(makeBoolConstant(columnMajor)); // column-major id + + groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeMatrix].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +Id Builder::makeMemberDebugType(Id const memberType, StructMemberDebugInfo const& debugTypeLoc) +{ + assert(getDebugType(memberType) != NoType); + + Instruction* type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + type->reserveOperands(10); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeMember); + type->addIdOperand(getStringId(debugTypeLoc.name)); // name id + type->addIdOperand(debugTypeLoc.debugTypeOverride != 0 ? debugTypeLoc.debugTypeOverride + : getDebugType(memberType)); // type id + type->addIdOperand(makeDebugSource(currentFileId)); // source id + type->addIdOperand(makeUintConstant(debugTypeLoc.line)); // line id TODO: currentLine is always zero + type->addIdOperand(makeUintConstant(debugTypeLoc.column)); // TODO: column id + type->addIdOperand(makeUintConstant(0)); // TODO: offset id + type->addIdOperand(makeUintConstant(0)); // TODO: size id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic)); // flags id + + groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeMember].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +Id Builder::makeCompositeDebugType(std::vector const& memberTypes, std::vector const& memberDebugInfo, + char const* const name, NonSemanticShaderDebugInfo100DebugCompositeType const tag) +{ + // Create the debug member types. + std::vector memberDebugTypes; + assert(memberTypes.size() == memberDebugInfo.size()); + for (size_t i = 0; i < memberTypes.size(); i++) { + if (getDebugType(memberTypes[i]) != NoType) { + memberDebugTypes.emplace_back(makeMemberDebugType(memberTypes[i], memberDebugInfo[i])); + } + } + + // Create The structure debug type. + Instruction* type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + type->reserveOperands(memberDebugTypes.size() + 11); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeComposite); + type->addIdOperand(getStringId(name)); // name id + type->addIdOperand(makeUintConstant(tag)); // tag id + type->addIdOperand(makeDebugSource(currentFileId)); // source id + type->addIdOperand(makeUintConstant(currentLine)); // line id TODO: currentLine always zero? + type->addIdOperand(makeUintConstant(0)); // TODO: column id + type->addIdOperand(makeDebugCompilationUnit()); // scope id + type->addIdOperand(getStringId(name)); // linkage name id + type->addIdOperand(makeUintConstant(0)); // TODO: size id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic)); // flags id + for(auto const memberDebugType : memberDebugTypes) { + type->addIdOperand(memberDebugType); + } + + groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeComposite].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +// The NonSemantic Shader Debug Info doesn't really have a dedicated opcode for opaque types. Instead, we use DebugTypeComposite. +// To represent a source language opaque type, this instruction must have no Members operands, Size operand must be +// DebugInfoNone, and Name must start with @ to avoid clashes with user defined names. +Id Builder::makeOpaqueDebugType(char const* const name) +{ + // Create The structure debug type. + Instruction* type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + type->reserveOperands(11); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeComposite); + type->addIdOperand(getStringId(name)); // name id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Structure)); // tag id + type->addIdOperand(makeDebugSource(currentFileId)); // source id + type->addIdOperand(makeUintConstant(currentLine)); // line id TODO: currentLine always zero? + type->addIdOperand(makeUintConstant(0)); // TODO: column id + type->addIdOperand(makeDebugCompilationUnit()); // scope id + // Prepend '@' to opaque types. + type->addIdOperand(getStringId('@' + std::string(name))); // linkage name id + type->addIdOperand(makeDebugInfoNone()); // size id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic)); // flags id + + groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeComposite].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +Id Builder::makePointerDebugType(StorageClass storageClass, Id const baseType) +{ + const Id debugBaseType = getDebugType(baseType); + if (!debugBaseType) { + return makeDebugInfoNone(); + } + const Id scID = makeUintConstant(storageClass); + for (Instruction* otherType : groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypePointer]) { + if (otherType->getIdOperand(2) == debugBaseType && + otherType->getIdOperand(3) == scID) { + return otherType->getResultId(); + } + } + + Instruction* type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + type->reserveOperands(5); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypePointer); + type->addIdOperand(debugBaseType); + type->addIdOperand(scID); + type->addIdOperand(makeUintConstant(0)); + + groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypePointer].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +// Emit a OpExtInstWithForwardRefsKHR nonsemantic instruction for a pointer debug type +// where we don't have the pointee yet. Since we don't have the pointee yet, it just +// points to itself and we rely on patching it later. +Id Builder::makeForwardPointerDebugType(StorageClass storageClass) +{ + const Id scID = makeUintConstant(storageClass); + + this->addExtension(spv::E_SPV_KHR_relaxed_extended_instruction); + + Instruction *type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInstWithForwardRefsKHR); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypePointer); + type->addIdOperand(type->getResultId()); + type->addIdOperand(scID); + type->addIdOperand(makeUintConstant(0)); + + groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypePointer].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +Id Builder::makeDebugSource(const Id fileName) { + if (debugSourceId.find(fileName) != debugSourceId.end()) + return debugSourceId[fileName]; + spv::Id resultId = getUniqueId(); + Instruction* sourceInst = new Instruction(resultId, makeVoidType(), Op::OpExtInst); + sourceInst->reserveOperands(3); + sourceInst->addIdOperand(nonSemanticShaderDebugInfo); + sourceInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugSource); + sourceInst->addIdOperand(fileName); + constantsTypesGlobals.push_back(std::unique_ptr(sourceInst)); + module.mapInstruction(sourceInst); + if (emitNonSemanticShaderDebugSource) { + const int maxWordCount = 0xFFFF; + const int opSourceWordCount = 4; + const int nonNullBytesPerInstruction = 4 * (maxWordCount - opSourceWordCount) - 1; + auto processDebugSource = [&](std::string source) { + if (source.size() > 0) { + int nextByte = 0; + while ((int)source.size() - nextByte > 0) { + auto subString = source.substr(nextByte, nonNullBytesPerInstruction); + auto sourceId = getStringId(subString); + if (nextByte == 0) { + // DebugSource + sourceInst->addIdOperand(sourceId); + } else { + // DebugSourceContinued + Instruction* sourceContinuedInst = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + sourceContinuedInst->reserveOperands(2); + sourceContinuedInst->addIdOperand(nonSemanticShaderDebugInfo); + sourceContinuedInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugSourceContinued); + sourceContinuedInst->addIdOperand(sourceId); + constantsTypesGlobals.push_back(std::unique_ptr(sourceContinuedInst)); + module.mapInstruction(sourceContinuedInst); + } + nextByte += nonNullBytesPerInstruction; + } + } else { + auto sourceId = getStringId(source); + sourceInst->addIdOperand(sourceId); + } + }; + if (fileName == mainFileId) { + processDebugSource(sourceText); + } else { + auto incItr = includeFiles.find(fileName); + if (incItr != includeFiles.end()) { + processDebugSource(*incItr->second); + } else { + // We omit the optional source text item if not available in glslang + } + } + } + debugSourceId[fileName] = resultId; + return resultId; +} + +Id Builder::makeDebugCompilationUnit() { + if (nonSemanticShaderCompilationUnitId != 0) + return nonSemanticShaderCompilationUnitId; + spv::Id resultId = getUniqueId(); + Instruction* sourceInst = new Instruction(resultId, makeVoidType(), Op::OpExtInst); + sourceInst->reserveOperands(6); + sourceInst->addIdOperand(nonSemanticShaderDebugInfo); + sourceInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugCompilationUnit); + sourceInst->addIdOperand(makeUintConstant(1)); // TODO(greg-lunarg): Get rid of magic number + sourceInst->addIdOperand(makeUintConstant(4)); // TODO(greg-lunarg): Get rid of magic number + sourceInst->addIdOperand(makeDebugSource(mainFileId)); + sourceInst->addIdOperand(makeUintConstant(sourceLang)); + constantsTypesGlobals.push_back(std::unique_ptr(sourceInst)); + module.mapInstruction(sourceInst); + nonSemanticShaderCompilationUnitId = resultId; + + // We can reasonably assume that makeDebugCompilationUnit will be called before any of + // debug-scope stack. Function scopes and lexical scopes will occur afterward. + assert(currentDebugScopeId.empty()); + currentDebugScopeId.push(nonSemanticShaderCompilationUnitId); + + return resultId; +} + +Id Builder::createDebugGlobalVariable(Id const type, char const*const name, Id const variable) +{ + assert(type != 0); + + Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + inst->reserveOperands(11); + inst->addIdOperand(nonSemanticShaderDebugInfo); + inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugGlobalVariable); + inst->addIdOperand(getStringId(name)); // name id + inst->addIdOperand(type); // type id + inst->addIdOperand(makeDebugSource(currentFileId)); // source id + inst->addIdOperand(makeUintConstant(currentLine)); // line id TODO: currentLine always zero? + inst->addIdOperand(makeUintConstant(0)); // TODO: column id + inst->addIdOperand(makeDebugCompilationUnit()); // scope id + inst->addIdOperand(getStringId(name)); // linkage name id + inst->addIdOperand(variable); // variable id + inst->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsDefinition)); // flags id + + constantsTypesGlobals.push_back(std::unique_ptr(inst)); + module.mapInstruction(inst); + + return inst->getResultId(); +} + +Id Builder::createDebugLocalVariable(Id type, char const*const name, size_t const argNumber) +{ + assert(name != nullptr); + assert(!currentDebugScopeId.empty()); + + Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + inst->reserveOperands(9); + inst->addIdOperand(nonSemanticShaderDebugInfo); + inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugLocalVariable); + inst->addIdOperand(getStringId(name)); // name id + inst->addIdOperand(type); // type id + inst->addIdOperand(makeDebugSource(currentFileId)); // source id + inst->addIdOperand(makeUintConstant(currentLine)); // line id + inst->addIdOperand(makeUintConstant(0)); // TODO: column id + inst->addIdOperand(currentDebugScopeId.top()); // scope id + inst->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsLocal)); // flags id + if(argNumber != 0) { + inst->addIdOperand(makeUintConstant(static_cast(argNumber))); + } + + constantsTypesGlobals.push_back(std::unique_ptr(inst)); + module.mapInstruction(inst); + + return inst->getResultId(); +} + +Id Builder::makeDebugExpression() +{ + if (debugExpression != 0) + return debugExpression; + + Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + inst->reserveOperands(2); + inst->addIdOperand(nonSemanticShaderDebugInfo); + inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugExpression); + + constantsTypesGlobals.push_back(std::unique_ptr(inst)); + module.mapInstruction(inst); + + debugExpression = inst->getResultId(); + + return debugExpression; +} + +Id Builder::makeDebugDeclare(Id const debugLocalVariable, Id const pointer) +{ + Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + inst->reserveOperands(5); + inst->addIdOperand(nonSemanticShaderDebugInfo); + inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugDeclare); + inst->addIdOperand(debugLocalVariable); // debug local variable id + inst->addIdOperand(pointer); // pointer to local variable id + inst->addIdOperand(makeDebugExpression()); // expression id + addInstruction(std::unique_ptr(inst)); + + return inst->getResultId(); +} + +Id Builder::makeDebugValue(Id const debugLocalVariable, Id const value) +{ + Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + inst->reserveOperands(5); + inst->addIdOperand(nonSemanticShaderDebugInfo); + inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugValue); + inst->addIdOperand(debugLocalVariable); // debug local variable id + inst->addIdOperand(value); // value of local variable id + inst->addIdOperand(makeDebugExpression()); // expression id + addInstruction(std::unique_ptr(inst)); + + return inst->getResultId(); +} + +Id Builder::makeAccelerationStructureType() +{ + Instruction *type; + if (groupedTypes[enumCast(Op::OpTypeAccelerationStructureKHR)].size() == 0) { + type = new Instruction(getUniqueId(), NoType, Op::OpTypeAccelerationStructureKHR); + groupedTypes[enumCast(Op::OpTypeAccelerationStructureKHR)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + if (emitNonSemanticShaderDebugInfo) { + spv::Id debugType = makeOpaqueDebugType("accelerationStructure"); + debugTypeIdLookup[type->getResultId()] = debugType; + } + } else { + type = groupedTypes[enumCast(Op::OpTypeAccelerationStructureKHR)].back(); + } + + return type->getResultId(); +} + +Id Builder::makeRayQueryType() +{ + Instruction *type; + if (groupedTypes[enumCast(Op::OpTypeRayQueryKHR)].size() == 0) { + type = new Instruction(getUniqueId(), NoType, Op::OpTypeRayQueryKHR); + groupedTypes[enumCast(Op::OpTypeRayQueryKHR)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + if (emitNonSemanticShaderDebugInfo) { + spv::Id debugType = makeOpaqueDebugType("rayQuery"); + debugTypeIdLookup[type->getResultId()] = debugType; + } + } else { + type = groupedTypes[enumCast(Op::OpTypeRayQueryKHR)].back(); + } + + return type->getResultId(); +} + +Id Builder::makeHitObjectEXTType() +{ + Instruction *type; + if (groupedTypes[enumCast(Op::OpTypeHitObjectEXT)].size() == 0) { + type = new Instruction(getUniqueId(), NoType, Op::OpTypeHitObjectEXT); + groupedTypes[enumCast(Op::OpTypeHitObjectEXT)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + } else { + type = groupedTypes[enumCast(Op::OpTypeHitObjectEXT)].back(); + } + + return type->getResultId(); +} +Id Builder::makeHitObjectNVType() +{ + Instruction *type; + if (groupedTypes[enumCast(Op::OpTypeHitObjectNV)].size() == 0) { + type = new Instruction(getUniqueId(), NoType, Op::OpTypeHitObjectNV); + groupedTypes[enumCast(Op::OpTypeHitObjectNV)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + if (emitNonSemanticShaderDebugInfo) { + spv::Id debugType = makeOpaqueDebugType("hitObjectNV"); + debugTypeIdLookup[type->getResultId()] = debugType; + } + } else { + type = groupedTypes[enumCast(Op::OpTypeHitObjectNV)].back(); + } + + return type->getResultId(); +} + +Id Builder::getDerefTypeId(Id resultId) const +{ + Id typeId = getTypeId(resultId); + assert(isPointerType(typeId)); + + return module.getInstruction(typeId)->getIdOperand(1); +} + +Op Builder::getMostBasicTypeClass(Id typeId) const +{ + Instruction* instr = module.getInstruction(typeId); + + Op typeClass = instr->getOpCode(); + switch (typeClass) + { + case Op::OpTypeVector: + case Op::OpTypeMatrix: + case Op::OpTypeArray: + case Op::OpTypeRuntimeArray: + return getMostBasicTypeClass(instr->getIdOperand(0)); + case Op::OpTypePointer: + return getMostBasicTypeClass(instr->getIdOperand(1)); + default: + return typeClass; + } +} + +unsigned int Builder::getNumTypeConstituents(Id typeId) const +{ + Instruction* instr = module.getInstruction(typeId); + + switch (instr->getOpCode()) + { + case Op::OpTypeBool: + case Op::OpTypeInt: + case Op::OpTypeFloat: + case Op::OpTypePointer: + return 1; + case Op::OpTypeVector: + case Op::OpTypeMatrix: + return instr->getImmediateOperand(1); + case Op::OpTypeCooperativeVectorNV: + case Op::OpTypeArray: + { + Id lengthId = instr->getIdOperand(1); + return module.getInstruction(lengthId)->getImmediateOperand(0); + } + case Op::OpTypeStruct: + return instr->getNumOperands(); + case Op::OpTypeCooperativeMatrixKHR: + case Op::OpTypeCooperativeMatrixNV: + // has only one constituent when used with OpCompositeConstruct. + return 1; + default: + assert(0); + return 1; + } +} + +// Return the lowest-level type of scalar that an homogeneous composite is made out of. +// Typically, this is just to find out if something is made out of ints or floats. +// However, it includes returning a structure, if say, it is an array of structure. +Id Builder::getScalarTypeId(Id typeId) const +{ + Instruction* instr = module.getInstruction(typeId); + + Op typeClass = instr->getOpCode(); + switch (typeClass) + { + case Op::OpTypeVoid: + case Op::OpTypeBool: + case Op::OpTypeInt: + case Op::OpTypeFloat: + case Op::OpTypeStruct: + return instr->getResultId(); + case Op::OpTypeVector: + case Op::OpTypeMatrix: + case Op::OpTypeArray: + case Op::OpTypeRuntimeArray: + case Op::OpTypePointer: + case Op::OpTypeCooperativeVectorNV: + return getScalarTypeId(getContainedTypeId(typeId)); + default: + assert(0); + return NoResult; + } +} + +// Return the type of 'member' of a composite. +Id Builder::getContainedTypeId(Id typeId, int member) const +{ + Instruction* instr = module.getInstruction(typeId); + + Op typeClass = instr->getOpCode(); + switch (typeClass) + { + case Op::OpTypeVector: + case Op::OpTypeMatrix: + case Op::OpTypeArray: + case Op::OpTypeRuntimeArray: + case Op::OpTypeCooperativeMatrixKHR: + case Op::OpTypeCooperativeMatrixNV: + case Op::OpTypeCooperativeVectorNV: + return instr->getIdOperand(0); + case Op::OpTypePointer: + return instr->getIdOperand(1); + case Op::OpTypeStruct: + return instr->getIdOperand(member); + default: + assert(0); + return NoResult; + } +} + +// Figure out the final resulting type of the access chain. +Id Builder::getResultingAccessChainType() const +{ + assert(accessChain.base != NoResult); + Id typeId = getTypeId(accessChain.base); + + assert(isPointerType(typeId)); + typeId = getContainedTypeId(typeId); + + for (int i = 0; i < (int)accessChain.indexChain.size(); ++i) { + if (isStructType(typeId)) { + assert(isConstantScalar(accessChain.indexChain[i])); + typeId = getContainedTypeId(typeId, getConstantScalar(accessChain.indexChain[i])); + } else + typeId = getContainedTypeId(typeId, accessChain.indexChain[i]); + } + + return typeId; +} + +// Return the immediately contained type of a given composite type. +Id Builder::getContainedTypeId(Id typeId) const +{ + return getContainedTypeId(typeId, 0); +} + +// Returns true if 'typeId' is or contains a scalar type declared with 'typeOp' +// of width 'width'. The 'width' is only consumed for int and float types. +// Returns false otherwise. +bool Builder::containsType(Id typeId, spv::Op typeOp, unsigned int width) const +{ + const Instruction& instr = *module.getInstruction(typeId); + + Op typeClass = instr.getOpCode(); + switch (typeClass) + { + case Op::OpTypeInt: + case Op::OpTypeFloat: + return typeClass == typeOp && instr.getImmediateOperand(0) == width; + case Op::OpTypeStruct: + for (int m = 0; m < instr.getNumOperands(); ++m) { + if (containsType(instr.getIdOperand(m), typeOp, width)) + return true; + } + return false; + case Op::OpTypePointer: + return false; + case Op::OpTypeVector: + case Op::OpTypeMatrix: + case Op::OpTypeArray: + case Op::OpTypeRuntimeArray: + return containsType(getContainedTypeId(typeId), typeOp, width); + default: + return typeClass == typeOp; + } +} + +// return true if the type is a pointer to PhysicalStorageBufferEXT or an +// contains such a pointer. These require restrict/aliased decorations. +bool Builder::containsPhysicalStorageBufferOrArray(Id typeId) const +{ + const Instruction& instr = *module.getInstruction(typeId); + + Op typeClass = instr.getOpCode(); + switch (typeClass) + { + case Op::OpTypePointer: + return getTypeStorageClass(typeId) == StorageClass::PhysicalStorageBufferEXT; + case Op::OpTypeArray: + return containsPhysicalStorageBufferOrArray(getContainedTypeId(typeId)); + case Op::OpTypeStruct: + for (int m = 0; m < instr.getNumOperands(); ++m) { + if (containsPhysicalStorageBufferOrArray(instr.getIdOperand(m))) + return true; + } + return false; + default: + return false; + } +} + +// See if a scalar constant of this type has already been created, so it +// can be reused rather than duplicated. (Required by the specification). +Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value) +{ + ScalarConstantKey key{ enumCast(typeClass), enumCast(opcode), typeId, value, 0 }; + auto it = groupedScalarConstantResultIDs.find(key); + return (it != groupedScalarConstantResultIDs.end()) ? it->second : 0; +} + +// Version of findScalarConstant (see above) for scalars that take two operands (e.g. a 'double' or 'int64'). +Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) +{ + ScalarConstantKey key{ enumCast(typeClass), enumCast(opcode), typeId, v1, v2 }; + auto it = groupedScalarConstantResultIDs.find(key); + return (it != groupedScalarConstantResultIDs.end()) ? it->second : 0; +} + +// Return true if consuming 'opcode' means consuming a constant. +// "constant" here means after final transform to executable code, +// the value consumed will be a constant, so includes specialization. +bool Builder::isConstantOpCode(Op opcode) const +{ + switch (opcode) { + case Op::OpUndef: + case Op::OpConstantTrue: + case Op::OpConstantFalse: + case Op::OpConstant: + case Op::OpConstantComposite: + case Op::OpConstantCompositeReplicateEXT: + case Op::OpConstantSampler: + case Op::OpConstantNull: + case Op::OpSpecConstantTrue: + case Op::OpSpecConstantFalse: + case Op::OpSpecConstant: + case Op::OpSpecConstantComposite: + case Op::OpSpecConstantCompositeReplicateEXT: + case Op::OpSpecConstantOp: + return true; + default: + return false; + } +} + +// Return true if consuming 'opcode' means consuming a specialization constant. +bool Builder::isSpecConstantOpCode(Op opcode) const +{ + switch (opcode) { + case Op::OpSpecConstantTrue: + case Op::OpSpecConstantFalse: + case Op::OpSpecConstant: + case Op::OpSpecConstantComposite: + case Op::OpSpecConstantOp: + case Op::OpSpecConstantCompositeReplicateEXT: + return true; + default: + return false; + } +} + +Id Builder::makeNullConstant(Id typeId) +{ + Instruction* constant; + + // See if we already made it. + Id existing = NoResult; + for (int i = 0; i < (int)nullConstants.size(); ++i) { + constant = nullConstants[i]; + if (constant->getTypeId() == typeId) + existing = constant->getResultId(); + } + + if (existing != NoResult) + return existing; + + // Make it + Instruction* c = new Instruction(getUniqueId(), typeId, Op::OpConstantNull); + constantsTypesGlobals.push_back(std::unique_ptr(c)); + nullConstants.push_back(c); + module.mapInstruction(c); + + return c->getResultId(); +} + +Id Builder::makeBoolConstant(bool b, bool specConstant) +{ + Id typeId = makeBoolType(); + Op opcode = specConstant ? (b ? Op::OpSpecConstantTrue : Op::OpSpecConstantFalse) : (b ? Op::OpConstantTrue : Op::OpConstantFalse); + + // See if we already made it. Applies only to regular constants, because specialization constants + // must remain distinct for the purpose of applying a SpecId decoration. + if (!specConstant) { + Id existing = findScalarConstant(Op::OpTypeBool, opcode, typeId, 0); + if (existing) + return existing; + } + + // Make it + Instruction* c = new Instruction(getUniqueId(), typeId, opcode); + constantsTypesGlobals.push_back(std::unique_ptr(c)); + module.mapInstruction(c); + + Id resultId = c->getResultId(); + if (!specConstant) { + ScalarConstantKey key{enumCast(Op::OpTypeBool), enumCast(opcode), typeId, 0, 0}; + groupedScalarConstantResultIDs[key] = resultId; + } + return resultId; +} + +Id Builder::makeIntConstant(Id typeId, unsigned value, bool specConstant) +{ + Op opcode = specConstant ? Op::OpSpecConstant : Op::OpConstant; + + // See if we already made it. Applies only to regular constants, because specialization constants + // must remain distinct for the purpose of applying a SpecId decoration. + if (! specConstant) { + Id existing = findScalarConstant(Op::OpTypeInt, opcode, typeId, value); + if (existing) + return existing; + } + + Instruction* c = new Instruction(getUniqueId(), typeId, opcode); + c->addImmediateOperand(value); + constantsTypesGlobals.push_back(std::unique_ptr(c)); + module.mapInstruction(c); + + Id resultId = c->getResultId(); + if (!specConstant) { + ScalarConstantKey key{ enumCast(Op::OpTypeInt), enumCast(opcode), typeId, value, 0 }; + groupedScalarConstantResultIDs[key] = resultId; + } + return resultId; +} + +Id Builder::makeInt64Constant(Id typeId, unsigned long long value, bool specConstant) +{ + Op opcode = specConstant ? Op::OpSpecConstant : Op::OpConstant; + + unsigned op1 = value & 0xFFFFFFFF; + unsigned op2 = value >> 32; + + // See if we already made it. Applies only to regular constants, because specialization constants + // must remain distinct for the purpose of applying a SpecId decoration. + if (! specConstant) { + Id existing = findScalarConstant(Op::OpTypeInt, opcode, typeId, op1, op2); + if (existing) + return existing; + } + + Instruction* c = new Instruction(getUniqueId(), typeId, opcode); + c->reserveOperands(2); + c->addImmediateOperand(op1); + c->addImmediateOperand(op2); + constantsTypesGlobals.push_back(std::unique_ptr(c)); + module.mapInstruction(c); + + Id resultId = c->getResultId(); + if (!specConstant) { + ScalarConstantKey key{ enumCast(Op::OpTypeInt), enumCast(opcode), typeId, op1, op2 }; + groupedScalarConstantResultIDs[key] = resultId; + } + return resultId; +} + +Id Builder::makeFloatConstant(float f, bool specConstant) +{ + Op opcode = specConstant ? Op::OpSpecConstant : Op::OpConstant; + Id typeId = makeFloatType(32); + union { float fl; unsigned int ui; } u; + u.fl = f; + unsigned value = u.ui; + + // See if we already made it. Applies only to regular constants, because specialization constants + // must remain distinct for the purpose of applying a SpecId decoration. + if (! specConstant) { + Id existing = findScalarConstant(Op::OpTypeFloat, opcode, typeId, value); + if (existing) + return existing; + } + + Instruction* c = new Instruction(getUniqueId(), typeId, opcode); + c->addImmediateOperand(value); + constantsTypesGlobals.push_back(std::unique_ptr(c)); + module.mapInstruction(c); + + Id resultId = c->getResultId(); + if (!specConstant) { + ScalarConstantKey key{ enumCast(Op::OpTypeFloat), enumCast(opcode), typeId, value, 0 }; + groupedScalarConstantResultIDs[key] = resultId; + } + return resultId; +} + +Id Builder::makeDoubleConstant(double d, bool specConstant) +{ + Op opcode = specConstant ? Op::OpSpecConstant : Op::OpConstant; + Id typeId = makeFloatType(64); + union { double db; unsigned long long ull; } u; + u.db = d; + unsigned long long value = u.ull; + unsigned op1 = value & 0xFFFFFFFF; + unsigned op2 = value >> 32; + + // See if we already made it. Applies only to regular constants, because specialization constants + // must remain distinct for the purpose of applying a SpecId decoration. + if (! specConstant) { + Id existing = findScalarConstant(Op::OpTypeFloat, opcode, typeId, op1, op2); + if (existing) + return existing; + } + + Instruction* c = new Instruction(getUniqueId(), typeId, opcode); + c->reserveOperands(2); + c->addImmediateOperand(op1); + c->addImmediateOperand(op2); + constantsTypesGlobals.push_back(std::unique_ptr(c)); + module.mapInstruction(c); + + Id resultId = c->getResultId(); + if (!specConstant) { + ScalarConstantKey key{ enumCast(Op::OpTypeFloat), enumCast(opcode), typeId, op1, op2 }; + groupedScalarConstantResultIDs[key] = resultId; + } + return resultId; +} + +Id Builder::makeFloat16Constant(float f16, bool specConstant) +{ + Op opcode = specConstant ? Op::OpSpecConstant : Op::OpConstant; + Id typeId = makeFloatType(16); + + spvutils::HexFloat> fVal(f16); + spvutils::HexFloat> f16Val(0); + fVal.castTo(f16Val, spvutils::kRoundToZero); + + unsigned value = f16Val.value().getAsFloat().get_value(); + + // See if we already made it. Applies only to regular constants, because specialization constants + // must remain distinct for the purpose of applying a SpecId decoration. + if (!specConstant) { + Id existing = findScalarConstant(Op::OpTypeFloat, opcode, typeId, value); + if (existing) + return existing; + } + + Instruction* c = new Instruction(getUniqueId(), typeId, opcode); + c->addImmediateOperand(value); + constantsTypesGlobals.push_back(std::unique_ptr(c)); + module.mapInstruction(c); + + Id resultId = c->getResultId(); + if (!specConstant) { + ScalarConstantKey key{ enumCast(Op::OpTypeFloat), enumCast(opcode), typeId, value, 0 }; + groupedScalarConstantResultIDs[key] = resultId; + } + return resultId; +} + +Id Builder::makeBFloat16Constant(float bf16, bool specConstant) +{ + Op opcode = specConstant ? Op::OpSpecConstant : Op::OpConstant; + Id typeId = makeBFloat16Type(); + + union { + float f; + uint32_t u; + } un; + un.f = bf16; + + // take high 16b of fp32 value. This is effectively round-to-zero, other than certain NaNs. + unsigned value = un.u >> 16; + + // See if we already made it. Applies only to regular constants, because specialization constants + // must remain distinct for the purpose of applying a SpecId decoration. + if (!specConstant) { + Id existing = findScalarConstant(Op::OpTypeFloat, opcode, typeId, value); + if (existing) + return existing; + } + + Instruction* c = new Instruction(getUniqueId(), typeId, opcode); + c->addImmediateOperand(value); + constantsTypesGlobals.push_back(std::unique_ptr(c)); + module.mapInstruction(c); + + Id resultId = c->getResultId(); + if (!specConstant) { + ScalarConstantKey key{ enumCast(Op::OpTypeFloat), enumCast(opcode), typeId, value, 0 }; + groupedScalarConstantResultIDs[key] = resultId; + } + return resultId; +} + +Id Builder::makeFloatE5M2Constant(float fe5m2, bool specConstant) +{ + Op opcode = specConstant ? Op::OpSpecConstant : Op::OpConstant; + Id typeId = makeFloatE5M2Type(); + + spvutils::HexFloat> fVal(fe5m2); + spvutils::HexFloat> fe5m2Val(0); + fVal.castTo(fe5m2Val, spvutils::kRoundToZero); + + unsigned value = fe5m2Val.value().getAsFloat().get_value(); + + // See if we already made it. Applies only to regular constants, because specialization constants + // must remain distinct for the purpose of applying a SpecId decoration. + if (!specConstant) { + Id existing = findScalarConstant(Op::OpTypeFloat, opcode, typeId, value); + if (existing) + return existing; + } + + Instruction* c = new Instruction(getUniqueId(), typeId, opcode); + c->addImmediateOperand(value); + constantsTypesGlobals.push_back(std::unique_ptr(c)); + module.mapInstruction(c); + + Id resultId = c->getResultId(); + if (!specConstant) { + ScalarConstantKey key{enumCast(Op::OpTypeFloat), enumCast(opcode), typeId, value, 0}; + groupedScalarConstantResultIDs[key] = resultId; + } + return resultId; +} + +Id Builder::makeFloatE4M3Constant(float fe4m3, bool specConstant) +{ + Op opcode = specConstant ? Op::OpSpecConstant : Op::OpConstant; + Id typeId = makeFloatE4M3Type(); + + spvutils::HexFloat> fVal(fe4m3); + spvutils::HexFloat> fe4m3Val(0); + fVal.castTo(fe4m3Val, spvutils::kRoundToZero); + + unsigned value = fe4m3Val.value().getAsFloat().get_value(); + + // See if we already made it. Applies only to regular constants, because specialization constants + // must remain distinct for the purpose of applying a SpecId decoration. + if (!specConstant) { + Id existing = findScalarConstant(Op::OpTypeFloat, opcode, typeId, value); + if (existing) + return existing; + } + + Instruction* c = new Instruction(getUniqueId(), typeId, opcode); + c->addImmediateOperand(value); + constantsTypesGlobals.push_back(std::unique_ptr(c)); + module.mapInstruction(c); + + Id resultId = c->getResultId(); + if (!specConstant) { + ScalarConstantKey key{enumCast(Op::OpTypeFloat), enumCast(opcode), typeId, value, 0}; + groupedScalarConstantResultIDs[key] = resultId; + } + return resultId; +} + +Id Builder::makeFpConstant(Id type, double d, bool specConstant) +{ + const int width = getScalarTypeWidth(type); + + assert(isFloatType(type)); + + switch (width) { + case 16: + return makeFloat16Constant((float)d, specConstant); + case 32: + return makeFloatConstant((float)d, specConstant); + case 64: + return makeDoubleConstant(d, specConstant); + default: + break; + } + + assert(false); + return NoResult; +} + +Id Builder::importNonSemanticShaderDebugInfoInstructions() +{ + assert(emitNonSemanticShaderDebugInfo == true); + + if(nonSemanticShaderDebugInfo == 0) + { + this->addExtension(spv::E_SPV_KHR_non_semantic_info); + nonSemanticShaderDebugInfo = this->import("NonSemantic.Shader.DebugInfo.100"); + } + + return nonSemanticShaderDebugInfo; +} + +Id Builder::findCompositeConstant(Op typeClass, Op opcode, Id typeId, const std::vector& comps, size_t numMembers) +{ + Instruction* constant = nullptr; + bool found = false; + for (int i = 0; i < (int)groupedCompositeConstants[enumCast(typeClass)].size(); ++i) { + constant = groupedCompositeConstants[enumCast(typeClass)][i]; + + if (constant->getTypeId() != typeId) + continue; + + if (constant->getOpCode() != opcode) { + continue; + } + + if (constant->getNumOperands() != (int)numMembers) + continue; + + // same contents? + bool mismatch = false; + for (int op = 0; op < constant->getNumOperands(); ++op) { + if (constant->getIdOperand(op) != comps[op]) { + mismatch = true; + break; + } + } + if (! mismatch) { + found = true; + break; + } + } + + return found ? constant->getResultId() : NoResult; +} + +Id Builder::findStructConstant(Id typeId, const std::vector& comps) +{ + Instruction* constant = nullptr; + bool found = false; + for (int i = 0; i < (int)groupedStructConstants[typeId].size(); ++i) { + constant = groupedStructConstants[typeId][i]; + + // same contents? + bool mismatch = false; + for (int op = 0; op < constant->getNumOperands(); ++op) { + if (constant->getIdOperand(op) != comps[op]) { + mismatch = true; + break; + } + } + if (! mismatch) { + found = true; + break; + } + } + + return found ? constant->getResultId() : NoResult; +} + +// Comments in header +Id Builder::makeCompositeConstant(Id typeId, const std::vector& members, bool specConstant) +{ + assert(typeId); + Op typeClass = getTypeClass(typeId); + + bool replicate = false; + size_t numMembers = members.size(); + if (useReplicatedComposites || typeClass == Op::OpTypeCooperativeVectorNV) { + // use replicate if all members are the same + replicate = numMembers > 0 && + std::equal(members.begin() + 1, members.end(), members.begin()); + + if (replicate) { + numMembers = 1; + addCapability(spv::Capability::ReplicatedCompositesEXT); + addExtension(spv::E_SPV_EXT_replicated_composites); + } + } + + Op opcode = replicate ? + (specConstant ? Op::OpSpecConstantCompositeReplicateEXT : Op::OpConstantCompositeReplicateEXT) : + (specConstant ? Op::OpSpecConstantComposite : Op::OpConstantComposite); + + switch (typeClass) { + case Op::OpTypeVector: + case Op::OpTypeArray: + case Op::OpTypeMatrix: + case Op::OpTypeCooperativeMatrixKHR: + case Op::OpTypeCooperativeMatrixNV: + case Op::OpTypeCooperativeVectorNV: + if (! specConstant) { + Id existing = findCompositeConstant(typeClass, opcode, typeId, members, numMembers); + if (existing) + return existing; + } + break; + case Op::OpTypeStruct: + if (! specConstant) { + Id existing = findStructConstant(typeId, members); + if (existing) + return existing; + } + break; + default: + assert(0); + return makeFloatConstant(0.0); + } + + Instruction* c = new Instruction(getUniqueId(), typeId, opcode); + c->reserveOperands(members.size()); + for (size_t op = 0; op < numMembers; ++op) + c->addIdOperand(members[op]); + constantsTypesGlobals.push_back(std::unique_ptr(c)); + if (typeClass == Op::OpTypeStruct) + groupedStructConstants[typeId].push_back(c); + else + groupedCompositeConstants[enumCast(typeClass)].push_back(c); + module.mapInstruction(c); + + return c->getResultId(); +} + +Instruction* Builder::addEntryPoint(ExecutionModel model, Function* function, const char* name) +{ + Instruction* entryPoint = new Instruction(Op::OpEntryPoint); + entryPoint->reserveOperands(3); + entryPoint->addImmediateOperand(model); + entryPoint->addIdOperand(function->getId()); + entryPoint->addStringOperand(name); + + entryPoints.push_back(std::unique_ptr(entryPoint)); + + return entryPoint; +} + +// Currently relying on the fact that all 'value' of interest are small non-negative values. +void Builder::addExecutionMode(Function* entryPoint, ExecutionMode mode, int value1, int value2, int value3) +{ + // entryPoint can be null if we are in compile-only mode + if (!entryPoint) + return; + + Instruction* instr = new Instruction(Op::OpExecutionMode); + instr->reserveOperands(3); + instr->addIdOperand(entryPoint->getId()); + instr->addImmediateOperand(mode); + if (value1 >= 0) + instr->addImmediateOperand(value1); + if (value2 >= 0) + instr->addImmediateOperand(value2); + if (value3 >= 0) + instr->addImmediateOperand(value3); + + executionModes.push_back(std::unique_ptr(instr)); +} + +void Builder::addExecutionMode(Function* entryPoint, ExecutionMode mode, const std::vector& literals) +{ + // entryPoint can be null if we are in compile-only mode + if (!entryPoint) + return; + + Instruction* instr = new Instruction(Op::OpExecutionMode); + instr->reserveOperands(literals.size() + 2); + instr->addIdOperand(entryPoint->getId()); + instr->addImmediateOperand(mode); + for (auto literal : literals) + instr->addImmediateOperand(literal); + + executionModes.push_back(std::unique_ptr(instr)); +} + +void Builder::addExecutionModeId(Function* entryPoint, ExecutionMode mode, const std::vector& operandIds) +{ + // entryPoint can be null if we are in compile-only mode + if (!entryPoint) + return; + + Instruction* instr = new Instruction(Op::OpExecutionModeId); + instr->reserveOperands(operandIds.size() + 2); + instr->addIdOperand(entryPoint->getId()); + instr->addImmediateOperand(mode); + for (auto operandId : operandIds) + instr->addIdOperand(operandId); + + executionModes.push_back(std::unique_ptr(instr)); +} + +void Builder::addName(Id id, const char* string) +{ + Instruction* name = new Instruction(Op::OpName); + name->reserveOperands(2); + name->addIdOperand(id); + name->addStringOperand(string); + + names.push_back(std::unique_ptr(name)); +} + +void Builder::addMemberName(Id id, int memberNumber, const char* string) +{ + Instruction* name = new Instruction(Op::OpMemberName); + name->reserveOperands(3); + name->addIdOperand(id); + name->addImmediateOperand(memberNumber); + name->addStringOperand(string); + + names.push_back(std::unique_ptr(name)); +} + +void Builder::addDecoration(Id id, Decoration decoration, int num) +{ + if (decoration == spv::Decoration::Max) + return; + + Instruction* dec = new Instruction(Op::OpDecorate); + dec->reserveOperands(2); + dec->addIdOperand(id); + dec->addImmediateOperand(decoration); + if (num >= 0) + dec->addImmediateOperand(num); + + decorations.insert(std::unique_ptr(dec)); +} + +void Builder::addDecoration(Id id, Decoration decoration, const char* s) +{ + if (decoration == spv::Decoration::Max) + return; + + Instruction* dec = new Instruction(Op::OpDecorateString); + dec->reserveOperands(3); + dec->addIdOperand(id); + dec->addImmediateOperand(decoration); + dec->addStringOperand(s); + + decorations.insert(std::unique_ptr(dec)); +} + +void Builder::addDecoration(Id id, Decoration decoration, const std::vector& literals) +{ + if (decoration == spv::Decoration::Max) + return; + + Instruction* dec = new Instruction(Op::OpDecorate); + dec->reserveOperands(literals.size() + 2); + dec->addIdOperand(id); + dec->addImmediateOperand(decoration); + for (auto literal : literals) + dec->addImmediateOperand(literal); + + decorations.insert(std::unique_ptr(dec)); +} + +void Builder::addDecoration(Id id, Decoration decoration, const std::vector& strings) +{ + if (decoration == spv::Decoration::Max) + return; + + Instruction* dec = new Instruction(Op::OpDecorateString); + dec->reserveOperands(strings.size() + 2); + dec->addIdOperand(id); + dec->addImmediateOperand(decoration); + for (auto string : strings) + dec->addStringOperand(string); + + decorations.insert(std::unique_ptr(dec)); +} + +void Builder::addLinkageDecoration(Id id, const char* name, spv::LinkageType linkType) { + Instruction* dec = new Instruction(Op::OpDecorate); + dec->reserveOperands(4); + dec->addIdOperand(id); + dec->addImmediateOperand(spv::Decoration::LinkageAttributes); + dec->addStringOperand(name); + dec->addImmediateOperand(linkType); + + decorations.insert(std::unique_ptr(dec)); +} + +void Builder::addDecorationId(Id id, Decoration decoration, Id idDecoration) +{ + if (decoration == spv::Decoration::Max) + return; + + Instruction* dec = new Instruction(Op::OpDecorateId); + dec->reserveOperands(3); + dec->addIdOperand(id); + dec->addImmediateOperand(decoration); + dec->addIdOperand(idDecoration); + + decorations.insert(std::unique_ptr(dec)); +} + +void Builder::addDecorationId(Id id, Decoration decoration, const std::vector& operandIds) +{ + if(decoration == spv::Decoration::Max) + return; + + Instruction* dec = new Instruction(Op::OpDecorateId); + dec->reserveOperands(operandIds.size() + 2); + dec->addIdOperand(id); + dec->addImmediateOperand(decoration); + + for (auto operandId : operandIds) + dec->addIdOperand(operandId); + + decorations.insert(std::unique_ptr(dec)); +} + +void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decoration, int num) +{ + if (decoration == spv::Decoration::Max) + return; + + Instruction* dec = new Instruction(Op::OpMemberDecorate); + dec->reserveOperands(3); + dec->addIdOperand(id); + dec->addImmediateOperand(member); + dec->addImmediateOperand(decoration); + if (num >= 0) + dec->addImmediateOperand(num); + + decorations.insert(std::unique_ptr(dec)); +} + +void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decoration, const char *s) +{ + if (decoration == spv::Decoration::Max) + return; + + Instruction* dec = new Instruction(Op::OpMemberDecorateStringGOOGLE); + dec->reserveOperands(4); + dec->addIdOperand(id); + dec->addImmediateOperand(member); + dec->addImmediateOperand(decoration); + dec->addStringOperand(s); + + decorations.insert(std::unique_ptr(dec)); +} + +void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decoration, const std::vector& literals) +{ + if (decoration == spv::Decoration::Max) + return; + + Instruction* dec = new Instruction(Op::OpMemberDecorate); + dec->reserveOperands(literals.size() + 3); + dec->addIdOperand(id); + dec->addImmediateOperand(member); + dec->addImmediateOperand(decoration); + for (auto literal : literals) + dec->addImmediateOperand(literal); + + decorations.insert(std::unique_ptr(dec)); +} + +void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decoration, const std::vector& strings) +{ + if (decoration == spv::Decoration::Max) + return; + + Instruction* dec = new Instruction(Op::OpMemberDecorateString); + dec->reserveOperands(strings.size() + 3); + dec->addIdOperand(id); + dec->addImmediateOperand(member); + dec->addImmediateOperand(decoration); + for (auto string : strings) + dec->addStringOperand(string); + + decorations.insert(std::unique_ptr(dec)); +} + +void Builder::addInstruction(std::unique_ptr inst) { + // Phis must appear first in their block, don't insert line tracking instructions + // in front of them, just add the OpPhi and return. + if (inst->getOpCode() == Op::OpPhi) { + buildPoint->addInstruction(std::move(inst)); + return; + } + // Optionally insert OpDebugScope + if (emitNonSemanticShaderDebugInfo && dirtyScopeTracker) { + if (buildPoint->updateDebugScope(currentDebugScopeId.top())) { + auto scopeInst = std::make_unique(getUniqueId(), makeVoidType(), Op::OpExtInst); + scopeInst->reserveOperands(3); + scopeInst->addIdOperand(nonSemanticShaderDebugInfo); + scopeInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugScope); + scopeInst->addIdOperand(currentDebugScopeId.top()); + buildPoint->addInstruction(std::move(scopeInst)); + } + + dirtyScopeTracker = false; + } + + // Insert OpLine/OpDebugLine if the debug source location has changed + if (trackDebugInfo && dirtyLineTracker) { + if (buildPoint->updateDebugSourceLocation(currentLine, 0, currentFileId)) { + if (emitSpirvDebugInfo) { + auto lineInst = std::make_unique(Op::OpLine); + lineInst->reserveOperands(3); + lineInst->addIdOperand(currentFileId); + lineInst->addImmediateOperand(currentLine); + lineInst->addImmediateOperand(0); + buildPoint->addInstruction(std::move(lineInst)); + } + if (emitNonSemanticShaderDebugInfo) { + auto lineInst = std::make_unique(getUniqueId(), makeVoidType(), Op::OpExtInst); + lineInst->reserveOperands(7); + lineInst->addIdOperand(nonSemanticShaderDebugInfo); + lineInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugLine); + lineInst->addIdOperand(makeDebugSource(currentFileId)); + lineInst->addIdOperand(makeUintConstant(currentLine)); + lineInst->addIdOperand(makeUintConstant(currentLine)); + lineInst->addIdOperand(makeUintConstant(0)); + lineInst->addIdOperand(makeUintConstant(0)); + buildPoint->addInstruction(std::move(lineInst)); + } + } + + dirtyLineTracker = false; + } + + buildPoint->addInstruction(std::move(inst)); +} + +void Builder::addInstructionNoDebugInfo(std::unique_ptr inst) { + buildPoint->addInstruction(std::move(inst)); +} + +// Comments in header +Function* Builder::makeEntryPoint(const char* entryPoint) +{ + assert(! entryPointFunction); + + auto const returnType = makeVoidType(); + + restoreNonSemanticShaderDebugInfo = emitNonSemanticShaderDebugInfo; + if(sourceLang == spv::SourceLanguage::HLSL) { + emitNonSemanticShaderDebugInfo = false; + } + + Block* entry = nullptr; + entryPointFunction = makeFunctionEntry(NoPrecision, returnType, entryPoint, LinkageType::Max, {}, {}, &entry); + + emitNonSemanticShaderDebugInfo = restoreNonSemanticShaderDebugInfo; + + return entryPointFunction; +} + +// Comments in header +Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const char* name, LinkageType linkType, + const std::vector& paramTypes, + const std::vector>& decorations, Block** entry) +{ + // Make the function and initial instructions in it + Id typeId = makeFunctionType(returnType, paramTypes); + Id firstParamId = paramTypes.size() == 0 ? 0 : getUniqueIds((int)paramTypes.size()); + Id funcId = getUniqueId(); + Function* function = new Function(funcId, returnType, typeId, firstParamId, linkType, name, module); + + // Set up the precisions + setPrecision(function->getId(), precision); + function->setReturnPrecision(precision); + for (unsigned p = 0; p < (unsigned)decorations.size(); ++p) { + for (int d = 0; d < (int)decorations[p].size(); ++d) { + addDecoration(firstParamId + p, decorations[p][d]); + function->addParamPrecision(p, decorations[p][d]); + } + } + + // reset last debug scope + if (emitNonSemanticShaderDebugInfo) { + dirtyScopeTracker = true; + } + + // CFG + assert(entry != nullptr); + *entry = new Block(getUniqueId(), *function); + function->addBlock(*entry); + setBuildPoint(*entry); + + if (name) + addName(function->getId(), name); + + functions.push_back(std::unique_ptr(function)); + + return function; +} + +void Builder::setupFunctionDebugInfo(Function* function, const char* name, const std::vector& paramTypes, + const std::vector& paramNames) +{ + + if (!emitNonSemanticShaderDebugInfo) + return; + + Id nameId = getStringId(unmangleFunctionName(name)); + Id funcTypeId = function->getFuncTypeId(); + assert(getDebugType(funcTypeId) != NoType); + Id funcId = function->getId(); + + assert(funcId != 0); + + // Make the debug function instruction + Id debugFuncId = makeDebugFunction(function, nameId, funcTypeId); + debugFuncIdLookup[funcId] = debugFuncId; + currentDebugScopeId.push(debugFuncId); + + // DebugScope and DebugLine for parameter DebugDeclares + assert(paramTypes.size() == paramNames.size()); + if ((int)paramTypes.size() > 0) { + Id firstParamId = function->getParamId(0); + + for (size_t p = 0; p < paramTypes.size(); ++p) { + bool passByRef = false; + Id paramTypeId = paramTypes[p]; + + // For pointer-typed parameters, they are actually passed by reference and we need unwrap the pointer to get the actual parameter type. + if (isPointerType(paramTypeId) || isArrayType(paramTypeId)) { + passByRef = true; + paramTypeId = getContainedTypeId(paramTypeId); + } + + auto const& paramName = paramNames[p]; + auto const debugLocalVariableId = createDebugLocalVariable(getDebugType(paramTypeId), paramName, p + 1); + auto const paramId = static_cast(firstParamId + p); + + if (passByRef) { + makeDebugDeclare(debugLocalVariableId, paramId); + } else { + makeDebugValue(debugLocalVariableId, paramId); + } + } + } + + // Clear debug scope stack + if (emitNonSemanticShaderDebugInfo) + currentDebugScopeId.pop(); +} + +Id Builder::makeDebugFunction([[maybe_unused]] Function* function, Id nameId, Id funcTypeId) +{ + assert(function != nullptr); + assert(nameId != 0); + assert(funcTypeId != 0); + assert(getDebugType(funcTypeId) != NoType); + + Id funcId = getUniqueId(); + auto type = new Instruction(funcId, makeVoidType(), Op::OpExtInst); + type->reserveOperands(11); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugFunction); + type->addIdOperand(nameId); + type->addIdOperand(getDebugType(funcTypeId)); + type->addIdOperand(makeDebugSource(currentFileId)); // TODO: This points to file of definition instead of declaration + type->addIdOperand(makeUintConstant(currentLine)); // TODO: This points to line of definition instead of declaration + type->addIdOperand(makeUintConstant(0)); // column + type->addIdOperand(makeDebugCompilationUnit()); // scope + type->addIdOperand(nameId); // linkage name + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic)); + type->addIdOperand(makeUintConstant(currentLine)); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + return funcId; +} + +Id Builder::makeDebugLexicalBlock(uint32_t line, uint32_t column) { + assert(!currentDebugScopeId.empty()); + + Id lexId = getUniqueId(); + auto lex = new Instruction(lexId, makeVoidType(), Op::OpExtInst); + lex->reserveOperands(6); + lex->addIdOperand(nonSemanticShaderDebugInfo); + lex->addImmediateOperand(NonSemanticShaderDebugInfo100DebugLexicalBlock); + lex->addIdOperand(makeDebugSource(currentFileId)); + lex->addIdOperand(makeUintConstant(line)); + lex->addIdOperand(makeUintConstant(column)); // column + lex->addIdOperand(currentDebugScopeId.top()); // scope + constantsTypesGlobals.push_back(std::unique_ptr(lex)); + module.mapInstruction(lex); + return lexId; +} + +std::string Builder::unmangleFunctionName(std::string const& name) const +{ + assert(name.length() > 0); + + if(name.rfind('(') != std::string::npos) { + return name.substr(0, name.rfind('(')); + } else { + return name; + } +} + +// Comments in header +void Builder::makeReturn(bool implicit, Id retVal) +{ + if (retVal) { + Instruction* inst = new Instruction(NoResult, NoType, Op::OpReturnValue); + inst->addIdOperand(retVal); + addInstruction(std::unique_ptr(inst)); + } else + addInstruction(std::unique_ptr(new Instruction(NoResult, NoType, Op::OpReturn))); + + if (! implicit) + createAndSetNoPredecessorBlock("post-return"); +} + +// Comments in header +void Builder::enterLexicalBlock(uint32_t line, uint32_t column) +{ + if (!emitNonSemanticShaderDebugInfo) { + return; + } + + // Generate new lexical scope debug instruction + Id lexId = makeDebugLexicalBlock(line, column); + currentDebugScopeId.push(lexId); + dirtyScopeTracker = true; +} + +// Comments in header +void Builder::leaveLexicalBlock() +{ + if (!emitNonSemanticShaderDebugInfo) { + return; + } + + // Pop current scope from stack and clear current scope + currentDebugScopeId.pop(); + dirtyScopeTracker = true; +} + +// Comments in header +void Builder::enterFunction(Function const* function) +{ + currentFunction = function; + + // Save and disable debugInfo for HLSL entry point function. It is a wrapper + // function with no user code in it. + restoreNonSemanticShaderDebugInfo = emitNonSemanticShaderDebugInfo; + if (sourceLang == spv::SourceLanguage::HLSL && function == entryPointFunction) { + emitNonSemanticShaderDebugInfo = false; + } + + if (emitNonSemanticShaderDebugInfo) { + // Initialize scope state + Id funcId = function->getFuncId(); + Id debugFuncId = getDebugFunction(funcId); + currentDebugScopeId.push(debugFuncId); + // Create DebugFunctionDefinition + spv::Id resultId = getUniqueId(); + Instruction* defInst = new Instruction(resultId, makeVoidType(), Op::OpExtInst); + defInst->reserveOperands(4); + defInst->addIdOperand(nonSemanticShaderDebugInfo); + defInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugFunctionDefinition); + defInst->addIdOperand(debugFuncId); + defInst->addIdOperand(funcId); + addInstruction(std::unique_ptr(defInst)); + } + + if (auto linkType = function->getLinkType(); linkType != LinkageType::Max) { + Id funcId = function->getFuncId(); + addCapability(Capability::Linkage); + addLinkageDecoration(funcId, function->getExportName(), linkType); + } +} + +// Comments in header +void Builder::leaveFunction() +{ + Block* block = buildPoint; + Function& function = buildPoint->getParent(); + assert(block); + + // If our function did not contain a return, add a return void now. + if (! block->isTerminated()) { + if (function.getReturnType() == makeVoidType()) + makeReturn(true); + else { + makeReturn(true, createUndefined(function.getReturnType())); + } + } + + // Clear function scope from debug scope stack + if (emitNonSemanticShaderDebugInfo) + currentDebugScopeId.pop(); + + emitNonSemanticShaderDebugInfo = restoreNonSemanticShaderDebugInfo; + + // Clear current function record + currentFunction = nullptr; +} + +// Comments in header +void Builder::makeStatementTerminator(spv::Op opcode, const char *name) +{ + addInstruction(std::unique_ptr(new Instruction(opcode))); + createAndSetNoPredecessorBlock(name); +} + +// Comments in header +void Builder::makeStatementTerminator(spv::Op opcode, const std::vector& operands, const char* name) +{ + // It's assumed that the terminator instruction is always of void return type + // However in future if there is a need for non void return type, new helper + // methods can be created. + createNoResultOp(opcode, operands); + createAndSetNoPredecessorBlock(name); +} + +void Builder::createConstVariable(Id type, const char* name, Id constant, bool isGlobal) +{ + if (emitNonSemanticShaderDebugInfo) { + Id debugType = getDebugType(type); + if (isGlobal) { + createDebugGlobalVariable(debugType, name, constant); + } + else { + auto debugLocal = createDebugLocalVariable(debugType, name); + makeDebugValue(debugLocal, constant); + } + } +} + +// Comments in header +Id Builder::createVariable(Decoration precision, StorageClass storageClass, Id type, const char* name, Id initializer, + bool const compilerGenerated) +{ + Id pointerType = makePointer(storageClass, type); + Instruction* inst = new Instruction(getUniqueId(), pointerType, Op::OpVariable); + inst->addImmediateOperand(storageClass); + if (initializer != NoResult) + inst->addIdOperand(initializer); + + if (storageClass == StorageClass::Function) { + // Validation rules require the declaration in the entry block + buildPoint->getParent().addLocalVariable(std::unique_ptr(inst)); + } + else { + constantsTypesGlobals.push_back(std::unique_ptr(inst)); + module.mapInstruction(inst); + } + + if (emitNonSemanticShaderDebugInfo && !compilerGenerated) + { + // For debug info, we prefer respecting how the variable is declared in source code. + // We may emulate some local variables as global variable with private storage in SPIR-V, but we still want to + // treat them as local variables in debug info. + if (storageClass == StorageClass::Function || (currentFunction && storageClass == StorageClass::Private)) { + auto const debugLocalVariableId = createDebugLocalVariable(getDebugType(type), name); + makeDebugDeclare(debugLocalVariableId, inst->getResultId()); + } + else { + createDebugGlobalVariable(getDebugType(type), name, inst->getResultId()); + } + } + + if (name) + addName(inst->getResultId(), name); + setPrecision(inst->getResultId(), precision); + + return inst->getResultId(); +} + +// Comments in header +Id Builder::createUndefined(Id type) +{ + Instruction* inst = new Instruction(getUniqueId(), type, Op::OpUndef); + addInstruction(std::unique_ptr(inst)); + return inst->getResultId(); +} + +// av/vis/nonprivate are unnecessary and illegal for some storage classes. +spv::MemoryAccessMask Builder::sanitizeMemoryAccessForStorageClass(spv::MemoryAccessMask memoryAccess, StorageClass sc) + const +{ + switch (sc) { + case spv::StorageClass::Uniform: + case spv::StorageClass::Workgroup: + case spv::StorageClass::StorageBuffer: + case spv::StorageClass::PhysicalStorageBufferEXT: + break; + default: + memoryAccess = spv::MemoryAccessMask(memoryAccess & + ~(spv::MemoryAccessMask::MakePointerAvailableKHR | + spv::MemoryAccessMask::MakePointerVisibleKHR | + spv::MemoryAccessMask::NonPrivatePointerKHR)); + break; + } + return memoryAccess; +} + +// Comments in header +void Builder::createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAccess, spv::Scope scope, + unsigned int alignment) +{ + Instruction* store = new Instruction(Op::OpStore); + store->reserveOperands(2); + store->addIdOperand(lValue); + store->addIdOperand(rValue); + + memoryAccess = sanitizeMemoryAccessForStorageClass(memoryAccess, getStorageClass(lValue)); + + if (memoryAccess != MemoryAccessMask::MaskNone) { + store->addImmediateOperand(memoryAccess); + if (anySet(memoryAccess, spv::MemoryAccessMask::Aligned)) { + store->addImmediateOperand(alignment); + } + if (anySet(memoryAccess, spv::MemoryAccessMask::MakePointerAvailableKHR)) { + store->addIdOperand(makeUintConstant(scope)); + } + } + + addInstruction(std::unique_ptr(store)); +} + +// Comments in header +Id Builder::createLoad(Id lValue, spv::Decoration precision, spv::MemoryAccessMask memoryAccess, + spv::Scope scope, unsigned int alignment) +{ + Instruction* load = new Instruction(getUniqueId(), getDerefTypeId(lValue), Op::OpLoad); + load->addIdOperand(lValue); + + memoryAccess = sanitizeMemoryAccessForStorageClass(memoryAccess, getStorageClass(lValue)); + + if (memoryAccess != MemoryAccessMask::MaskNone) { + load->addImmediateOperand(memoryAccess); + if (anySet(memoryAccess, spv::MemoryAccessMask::Aligned)) { + load->addImmediateOperand(alignment); + } + if (anySet(memoryAccess, spv::MemoryAccessMask::MakePointerVisibleKHR)) { + load->addIdOperand(makeUintConstant(scope)); + } + } + + addInstruction(std::unique_ptr(load)); + setPrecision(load->getResultId(), precision); + + return load->getResultId(); +} + +// Comments in header +Id Builder::createAccessChain(StorageClass storageClass, Id base, const std::vector& offsets) +{ + // Figure out the final resulting type. + Id typeId = getResultingAccessChainType(); + typeId = makePointer(storageClass, typeId); + + // Make the instruction + Instruction* chain = new Instruction(getUniqueId(), typeId, Op::OpAccessChain); + chain->reserveOperands(offsets.size() + 1); + chain->addIdOperand(base); + for (int i = 0; i < (int)offsets.size(); ++i) + chain->addIdOperand(offsets[i]); + addInstruction(std::unique_ptr(chain)); + + return chain->getResultId(); +} + +Id Builder::createArrayLength(Id base, unsigned int member, unsigned int bits) +{ + spv::Id intType = makeUintType(bits); + Instruction* length = new Instruction(getUniqueId(), intType, Op::OpArrayLength); + length->reserveOperands(2); + length->addIdOperand(base); + length->addImmediateOperand(member); + addInstruction(std::unique_ptr(length)); + + return length->getResultId(); +} + +Id Builder::createCooperativeMatrixLengthKHR(Id type) +{ + spv::Id intType = makeUintType(32); + + // Generate code for spec constants if in spec constant operation + // generation mode. + if (generatingOpCodeForSpecConst) { + return createSpecConstantOp(Op::OpCooperativeMatrixLengthKHR, intType, std::vector(1, type), std::vector()); + } + + Instruction* length = new Instruction(getUniqueId(), intType, Op::OpCooperativeMatrixLengthKHR); + length->addIdOperand(type); + addInstruction(std::unique_ptr(length)); + + return length->getResultId(); +} + +Id Builder::createCooperativeMatrixLengthNV(Id type) +{ + spv::Id intType = makeUintType(32); + + // Generate code for spec constants if in spec constant operation + // generation mode. + if (generatingOpCodeForSpecConst) { + return createSpecConstantOp(Op::OpCooperativeMatrixLengthNV, intType, std::vector(1, type), std::vector()); + } + + Instruction* length = new Instruction(getUniqueId(), intType, Op::OpCooperativeMatrixLengthNV); + length->addIdOperand(type); + addInstruction(std::unique_ptr(length)); + + return length->getResultId(); +} + +Id Builder::createCompositeExtract(Id composite, Id typeId, unsigned index) +{ + // Generate code for spec constants if in spec constant operation + // generation mode. + if (generatingOpCodeForSpecConst) { + return createSpecConstantOp(Op::OpCompositeExtract, typeId, std::vector(1, composite), + std::vector(1, index)); + } + Instruction* extract = new Instruction(getUniqueId(), typeId, Op::OpCompositeExtract); + extract->reserveOperands(2); + extract->addIdOperand(composite); + extract->addImmediateOperand(index); + addInstruction(std::unique_ptr(extract)); + + return extract->getResultId(); +} + +Id Builder::createCompositeExtract(Id composite, Id typeId, const std::vector& indexes) +{ + // Generate code for spec constants if in spec constant operation + // generation mode. + if (generatingOpCodeForSpecConst) { + return createSpecConstantOp(Op::OpCompositeExtract, typeId, std::vector(1, composite), indexes); + } + Instruction* extract = new Instruction(getUniqueId(), typeId, Op::OpCompositeExtract); + extract->reserveOperands(indexes.size() + 1); + extract->addIdOperand(composite); + for (int i = 0; i < (int)indexes.size(); ++i) + extract->addImmediateOperand(indexes[i]); + addInstruction(std::unique_ptr(extract)); + + return extract->getResultId(); +} + +Id Builder::createCompositeInsert(Id object, Id composite, Id typeId, unsigned index) +{ + Instruction* insert = new Instruction(getUniqueId(), typeId, Op::OpCompositeInsert); + insert->reserveOperands(3); + insert->addIdOperand(object); + insert->addIdOperand(composite); + insert->addImmediateOperand(index); + addInstruction(std::unique_ptr(insert)); + + return insert->getResultId(); +} + +Id Builder::createCompositeInsert(Id object, Id composite, Id typeId, const std::vector& indexes) +{ + Instruction* insert = new Instruction(getUniqueId(), typeId, Op::OpCompositeInsert); + insert->reserveOperands(indexes.size() + 2); + insert->addIdOperand(object); + insert->addIdOperand(composite); + for (int i = 0; i < (int)indexes.size(); ++i) + insert->addImmediateOperand(indexes[i]); + addInstruction(std::unique_ptr(insert)); + + return insert->getResultId(); +} + +Id Builder::createVectorExtractDynamic(Id vector, Id typeId, Id componentIndex) +{ + Instruction* extract = new Instruction(getUniqueId(), typeId, Op::OpVectorExtractDynamic); + extract->reserveOperands(2); + extract->addIdOperand(vector); + extract->addIdOperand(componentIndex); + addInstruction(std::unique_ptr(extract)); + + return extract->getResultId(); +} + +Id Builder::createVectorInsertDynamic(Id vector, Id typeId, Id component, Id componentIndex) +{ + Instruction* insert = new Instruction(getUniqueId(), typeId, Op::OpVectorInsertDynamic); + insert->reserveOperands(3); + insert->addIdOperand(vector); + insert->addIdOperand(component); + insert->addIdOperand(componentIndex); + addInstruction(std::unique_ptr(insert)); + + return insert->getResultId(); +} + +// An opcode that has no operands, no result id, and no type +void Builder::createNoResultOp(Op opCode) +{ + Instruction* op = new Instruction(opCode); + addInstruction(std::unique_ptr(op)); +} + +// An opcode that has one id operand, no result id, and no type +void Builder::createNoResultOp(Op opCode, Id operand) +{ + Instruction* op = new Instruction(opCode); + op->addIdOperand(operand); + addInstruction(std::unique_ptr(op)); +} + +// An opcode that has one or more operands, no result id, and no type +void Builder::createNoResultOp(Op opCode, const std::vector& operands) +{ + Instruction* op = new Instruction(opCode); + op->reserveOperands(operands.size()); + for (auto id : operands) { + op->addIdOperand(id); + } + addInstruction(std::unique_ptr(op)); +} + +// An opcode that has multiple operands, no result id, and no type +void Builder::createNoResultOp(Op opCode, const std::vector& operands) +{ + Instruction* op = new Instruction(opCode); + op->reserveOperands(operands.size()); + for (auto it = operands.cbegin(); it != operands.cend(); ++it) { + if (it->isId) + op->addIdOperand(it->word); + else + op->addImmediateOperand(it->word); + } + addInstruction(std::unique_ptr(op)); +} + +void Builder::createControlBarrier(Scope execution, Scope memory, MemorySemanticsMask semantics) +{ + Instruction* op = new Instruction(Op::OpControlBarrier); + op->reserveOperands(3); + op->addIdOperand(makeUintConstant(execution)); + op->addIdOperand(makeUintConstant(memory)); + op->addIdOperand(makeUintConstant(semantics)); + addInstruction(std::unique_ptr(op)); +} + +void Builder::createMemoryBarrier(Scope executionScope, MemorySemanticsMask memorySemantics) +{ + Instruction* op = new Instruction(Op::OpMemoryBarrier); + op->reserveOperands(2); + op->addIdOperand(makeUintConstant((unsigned)executionScope)); + op->addIdOperand(makeUintConstant((unsigned)memorySemantics)); + addInstruction(std::unique_ptr(op)); +} + +// An opcode that has one operands, a result id, and a type +Id Builder::createUnaryOp(Op opCode, Id typeId, Id operand) +{ + // Generate code for spec constants if in spec constant operation + // generation mode. + if (generatingOpCodeForSpecConst) { + return createSpecConstantOp(opCode, typeId, std::vector(1, operand), std::vector()); + } + Instruction* op = new Instruction(getUniqueId(), typeId, opCode); + op->addIdOperand(operand); + addInstruction(std::unique_ptr(op)); + + return op->getResultId(); +} + +Id Builder::createBinOp(Op opCode, Id typeId, Id left, Id right) +{ + // Generate code for spec constants if in spec constant operation + // generation mode. + if (generatingOpCodeForSpecConst) { + std::vector operands(2); + operands[0] = left; operands[1] = right; + return createSpecConstantOp(opCode, typeId, operands, std::vector()); + } + Instruction* op = new Instruction(getUniqueId(), typeId, opCode); + op->reserveOperands(2); + op->addIdOperand(left); + op->addIdOperand(right); + addInstruction(std::unique_ptr(op)); + + return op->getResultId(); +} + +Id Builder::createTriOp(Op opCode, Id typeId, Id op1, Id op2, Id op3) +{ + // Generate code for spec constants if in spec constant operation + // generation mode. + if (generatingOpCodeForSpecConst) { + std::vector operands(3); + operands[0] = op1; + operands[1] = op2; + operands[2] = op3; + return createSpecConstantOp( + opCode, typeId, operands, std::vector()); + } + Instruction* op = new Instruction(getUniqueId(), typeId, opCode); + op->reserveOperands(3); + op->addIdOperand(op1); + op->addIdOperand(op2); + op->addIdOperand(op3); + addInstruction(std::unique_ptr(op)); + + return op->getResultId(); +} + +Id Builder::createOp(Op opCode, Id typeId, const std::vector& operands) +{ + Instruction* op = new Instruction(getUniqueId(), typeId, opCode); + op->reserveOperands(operands.size()); + for (auto id : operands) + op->addIdOperand(id); + addInstruction(std::unique_ptr(op)); + + return op->getResultId(); +} + +Id Builder::createOp(Op opCode, Id typeId, const std::vector& operands) +{ + Instruction* op = new Instruction(getUniqueId(), typeId, opCode); + op->reserveOperands(operands.size()); + for (auto it = operands.cbegin(); it != operands.cend(); ++it) { + if (it->isId) + op->addIdOperand(it->word); + else + op->addImmediateOperand(it->word); + } + addInstruction(std::unique_ptr(op)); + + return op->getResultId(); +} + +Id Builder::createSpecConstantOp(Op opCode, Id typeId, const std::vector& operands, + const std::vector& literals) +{ + Instruction* op = new Instruction(getUniqueId(), typeId, Op::OpSpecConstantOp); + op->reserveOperands(operands.size() + literals.size() + 1); + op->addImmediateOperand((unsigned) opCode); + for (auto it = operands.cbegin(); it != operands.cend(); ++it) + op->addIdOperand(*it); + for (auto it = literals.cbegin(); it != literals.cend(); ++it) + op->addImmediateOperand(*it); + module.mapInstruction(op); + constantsTypesGlobals.push_back(std::unique_ptr(op)); + + // OpSpecConstantOp's using 8 or 16 bit types require the associated capability + if (containsType(typeId, Op::OpTypeInt, 8)) + addCapability(Capability::Int8); + if (containsType(typeId, Op::OpTypeInt, 16)) + addCapability(Capability::Int16); + if (containsType(typeId, Op::OpTypeFloat, 16)) + addCapability(Capability::Float16); + + return op->getResultId(); +} + +Id Builder::createFunctionCall(spv::Function* function, const std::vector& args) +{ + Instruction* op = new Instruction(getUniqueId(), function->getReturnType(), Op::OpFunctionCall); + op->reserveOperands(args.size() + 1); + op->addIdOperand(function->getId()); + for (int a = 0; a < (int)args.size(); ++a) + op->addIdOperand(args[a]); + addInstruction(std::unique_ptr(op)); + + return op->getResultId(); +} + +// Comments in header +Id Builder::createRvalueSwizzle(Decoration precision, Id typeId, Id source, const std::vector& channels) +{ + if (channels.size() == 1) + return setPrecision(createCompositeExtract(source, typeId, channels.front()), precision); + + if (generatingOpCodeForSpecConst) { + std::vector operands(2); + operands[0] = operands[1] = source; + return setPrecision(createSpecConstantOp(Op::OpVectorShuffle, typeId, operands, channels), precision); + } + Instruction* swizzle = new Instruction(getUniqueId(), typeId, Op::OpVectorShuffle); + assert(isVector(source)); + swizzle->reserveOperands(channels.size() + 2); + swizzle->addIdOperand(source); + swizzle->addIdOperand(source); + for (int i = 0; i < (int)channels.size(); ++i) + swizzle->addImmediateOperand(channels[i]); + addInstruction(std::unique_ptr(swizzle)); + + return setPrecision(swizzle->getResultId(), precision); +} + +// Comments in header +Id Builder::createLvalueSwizzle(Id typeId, Id target, Id source, const std::vector& channels) +{ + if (channels.size() == 1 && getNumComponents(source) == 1) + return createCompositeInsert(source, target, typeId, channels.front()); + + Instruction* swizzle = new Instruction(getUniqueId(), typeId, Op::OpVectorShuffle); + + assert(isVector(target)); + swizzle->reserveOperands(2); + swizzle->addIdOperand(target); + + assert(getNumComponents(source) == channels.size()); + assert(isVector(source)); + swizzle->addIdOperand(source); + + // Set up an identity shuffle from the base value to the result value + unsigned int components[4]; + int numTargetComponents = getNumComponents(target); + for (int i = 0; i < numTargetComponents; ++i) + components[i] = i; + + // Punch in the l-value swizzle + for (int i = 0; i < (int)channels.size(); ++i) + components[channels[i]] = numTargetComponents + i; + + // finish the instruction with these components selectors + swizzle->reserveOperands(numTargetComponents); + for (int i = 0; i < numTargetComponents; ++i) + swizzle->addImmediateOperand(components[i]); + addInstruction(std::unique_ptr(swizzle)); + + return swizzle->getResultId(); +} + +// Comments in header +void Builder::promoteScalar(Decoration precision, Id& left, Id& right) +{ + int direction = getNumComponents(right) - getNumComponents(left); + + if (direction > 0) + left = smearScalar(precision, left, makeVectorType(getTypeId(left), getNumComponents(right))); + else if (direction < 0) + right = smearScalar(precision, right, makeVectorType(getTypeId(right), getNumComponents(left))); + + return; +} + +// Comments in header +Id Builder::smearScalar(Decoration precision, Id scalar, Id vectorType) +{ + assert(getNumComponents(scalar) == 1); + assert(getTypeId(scalar) == getScalarTypeId(vectorType)); + + int numComponents = getNumTypeComponents(vectorType); + if (numComponents == 1 && !isCooperativeVectorType(vectorType)) + return scalar; + + Instruction* smear = nullptr; + if (generatingOpCodeForSpecConst) { + auto members = std::vector(numComponents, scalar); + // Sometime even in spec-constant-op mode, the temporary vector created by + // promoting a scalar might not be a spec constant. This should depend on + // the scalar. + // e.g.: + // const vec2 spec_const_result = a_spec_const_vec2 + a_front_end_const_scalar; + // In such cases, the temporary vector created from a_front_end_const_scalar + // is not a spec constant vector, even though the binary operation node is marked + // as 'specConstant' and we are in spec-constant-op mode. + auto result_id = makeCompositeConstant(vectorType, members, isSpecConstant(scalar)); + smear = module.getInstruction(result_id); + } else { + bool replicate = (useReplicatedComposites || isCooperativeVectorType(vectorType)) && (numComponents > 0); + + if (replicate) { + numComponents = 1; + addCapability(spv::Capability::ReplicatedCompositesEXT); + addExtension(spv::E_SPV_EXT_replicated_composites); + } + + Op opcode = replicate ? Op::OpCompositeConstructReplicateEXT : Op::OpCompositeConstruct; + + smear = new Instruction(getUniqueId(), vectorType, opcode); + smear->reserveOperands(numComponents); + for (int c = 0; c < numComponents; ++c) + smear->addIdOperand(scalar); + addInstruction(std::unique_ptr(smear)); + } + + return setPrecision(smear->getResultId(), precision); +} + +// Comments in header +Id Builder::createBuiltinCall(Id resultType, Id builtins, int entryPoint, const std::vector& args) +{ + Instruction* inst = new Instruction(getUniqueId(), resultType, Op::OpExtInst); + inst->reserveOperands(args.size() + 2); + inst->addIdOperand(builtins); + inst->addImmediateOperand(entryPoint); + for (int arg = 0; arg < (int)args.size(); ++arg) + inst->addIdOperand(args[arg]); + + addInstruction(std::unique_ptr(inst)); + + return inst->getResultId(); +} + +// Accept all parameters needed to create a texture instruction. +// Create the correct instruction based on the inputs, and make the call. +Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, bool fetch, bool proj, bool gather, + bool noImplicitLod, const TextureParameters& parameters, ImageOperandsMask signExtensionMask) +{ + std::vector texArgs; + + // + // Set up the fixed arguments + // + bool explicitLod = false; + texArgs.push_back(parameters.sampler); + texArgs.push_back(parameters.coords); + if (parameters.Dref != NoResult) + texArgs.push_back(parameters.Dref); + if (parameters.component != NoResult) + texArgs.push_back(parameters.component); + + if (parameters.granularity != NoResult) + texArgs.push_back(parameters.granularity); + if (parameters.coarse != NoResult) + texArgs.push_back(parameters.coarse); + + // + // Set up the optional arguments + // + size_t optArgNum = texArgs.size(); // the position of the mask for the optional arguments, if any. + ImageOperandsMask mask = ImageOperandsMask::MaskNone; // the mask operand + if (parameters.bias) { + mask = (ImageOperandsMask)(mask | ImageOperandsMask::Bias); + texArgs.push_back(parameters.bias); + } + if (parameters.lod) { + mask = (ImageOperandsMask)(mask | ImageOperandsMask::Lod); + texArgs.push_back(parameters.lod); + explicitLod = true; + } else if (parameters.gradX) { + mask = (ImageOperandsMask)(mask | ImageOperandsMask::Grad); + texArgs.push_back(parameters.gradX); + texArgs.push_back(parameters.gradY); + explicitLod = true; + } else if (noImplicitLod && ! fetch && ! gather) { + // have to explicitly use lod of 0 if not allowed to have them be implicit, and + // we would otherwise be about to issue an implicit instruction + mask = (ImageOperandsMask)(mask | ImageOperandsMask::Lod); + texArgs.push_back(makeFloatConstant(0.0)); + explicitLod = true; + } + if (parameters.offset) { + if (isConstant(parameters.offset)) + mask = (ImageOperandsMask)(mask | ImageOperandsMask::ConstOffset); + else { + addCapability(Capability::ImageGatherExtended); + mask = (ImageOperandsMask)(mask | ImageOperandsMask::Offset); + } + texArgs.push_back(parameters.offset); + } + if (parameters.offsets) { + if (!isConstant(parameters.offsets) && sourceLang == spv::SourceLanguage::GLSL) { + mask = (ImageOperandsMask)(mask | ImageOperandsMask::Offsets); + } else { + addCapability(Capability::ImageGatherExtended); + mask = (ImageOperandsMask)(mask | ImageOperandsMask::ConstOffsets); + } + texArgs.push_back(parameters.offsets); + } + if (parameters.sample) { + mask = (ImageOperandsMask)(mask | ImageOperandsMask::Sample); + texArgs.push_back(parameters.sample); + } + if (parameters.lodClamp) { + // capability if this bit is used + addCapability(Capability::MinLod); + + mask = (ImageOperandsMask)(mask | ImageOperandsMask::MinLod); + texArgs.push_back(parameters.lodClamp); + } + if (parameters.nonprivate) { + mask = mask | ImageOperandsMask::NonPrivateTexelKHR; + } + if (parameters.volatil) { + mask = mask | ImageOperandsMask::VolatileTexelKHR; + } + if (parameters.nontemporal) { + mask = mask | ImageOperandsMask::Nontemporal; + } + mask = mask | signExtensionMask; + // insert the operand for the mask, if any bits were set. + if (mask != ImageOperandsMask::MaskNone) + texArgs.insert(texArgs.begin() + optArgNum, (Id)mask); + + // + // Set up the instruction + // + Op opCode = Op::OpNop; // All paths below need to set this + if (fetch) { + if (sparse) + opCode = Op::OpImageSparseFetch; + else + opCode = Op::OpImageFetch; + } else if (parameters.granularity && parameters.coarse) { + opCode = Op::OpImageSampleFootprintNV; + } else if (gather) { + if (parameters.Dref) + if (sparse) + opCode = Op::OpImageSparseDrefGather; + else + opCode = Op::OpImageDrefGather; + else + if (sparse) + opCode = Op::OpImageSparseGather; + else + opCode = Op::OpImageGather; + } else if (explicitLod) { + if (parameters.Dref) { + if (proj) + if (sparse) + opCode = Op::OpImageSparseSampleProjDrefExplicitLod; + else + opCode = Op::OpImageSampleProjDrefExplicitLod; + else + if (sparse) + opCode = Op::OpImageSparseSampleDrefExplicitLod; + else + opCode = Op::OpImageSampleDrefExplicitLod; + } else { + if (proj) + if (sparse) + opCode = Op::OpImageSparseSampleProjExplicitLod; + else + opCode = Op::OpImageSampleProjExplicitLod; + else + if (sparse) + opCode = Op::OpImageSparseSampleExplicitLod; + else + opCode = Op::OpImageSampleExplicitLod; + } + } else { + if (parameters.Dref) { + if (proj) + if (sparse) + opCode = Op::OpImageSparseSampleProjDrefImplicitLod; + else + opCode = Op::OpImageSampleProjDrefImplicitLod; + else + if (sparse) + opCode = Op::OpImageSparseSampleDrefImplicitLod; + else + opCode = Op::OpImageSampleDrefImplicitLod; + } else { + if (proj) + if (sparse) + opCode = Op::OpImageSparseSampleProjImplicitLod; + else + opCode = Op::OpImageSampleProjImplicitLod; + else + if (sparse) + opCode = Op::OpImageSparseSampleImplicitLod; + else + opCode = Op::OpImageSampleImplicitLod; + } + } + + // See if the result type is expecting a smeared result. + // This happens when a legacy shadow*() call is made, which + // gets a vec4 back instead of a float. + Id smearedType = resultType; + if (! isScalarType(resultType)) { + switch (opCode) { + case Op::OpImageSampleDrefImplicitLod: + case Op::OpImageSampleDrefExplicitLod: + case Op::OpImageSampleProjDrefImplicitLod: + case Op::OpImageSampleProjDrefExplicitLod: + resultType = getScalarTypeId(resultType); + break; + default: + break; + } + } + + Id typeId0 = 0; + Id typeId1 = 0; + + if (sparse) { + typeId0 = resultType; + typeId1 = getDerefTypeId(parameters.texelOut); + resultType = makeStructResultType(typeId0, typeId1); + } + + // Build the SPIR-V instruction + Instruction* textureInst = new Instruction(getUniqueId(), resultType, opCode); + textureInst->reserveOperands(optArgNum + (texArgs.size() - (optArgNum + 1))); + for (size_t op = 0; op < optArgNum; ++op) + textureInst->addIdOperand(texArgs[op]); + if (optArgNum < texArgs.size()) + textureInst->addImmediateOperand(texArgs[optArgNum]); + for (size_t op = optArgNum + 1; op < texArgs.size(); ++op) + textureInst->addIdOperand(texArgs[op]); + setPrecision(textureInst->getResultId(), precision); + addInstruction(std::unique_ptr(textureInst)); + + Id resultId = textureInst->getResultId(); + + if (sparse) { + // set capability + addCapability(Capability::SparseResidency); + + // Decode the return type that was a special structure + createStore(createCompositeExtract(resultId, typeId1, 1), parameters.texelOut); + resultId = createCompositeExtract(resultId, typeId0, 0); + setPrecision(resultId, precision); + } else { + // When a smear is needed, do it, as per what was computed + // above when resultType was changed to a scalar type. + if (resultType != smearedType) + resultId = smearScalar(precision, resultId, smearedType); + } + + return resultId; +} + +// Comments in header +Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameters, bool isUnsignedResult) +{ + // Figure out the result type + Id resultType = 0; + switch (opCode) { + case Op::OpImageQuerySize: + case Op::OpImageQuerySizeLod: + { + int numComponents = 0; + switch (getTypeDimensionality(getImageType(parameters.sampler))) { + case Dim::Dim1D: + case Dim::Buffer: + numComponents = 1; + break; + case Dim::Dim2D: + case Dim::Cube: + case Dim::Rect: + case Dim::SubpassData: + numComponents = 2; + break; + case Dim::Dim3D: + numComponents = 3; + break; + + default: + assert(0); + break; + } + if (isArrayedImageType(getImageType(parameters.sampler))) + ++numComponents; + + Id intType = isUnsignedResult ? makeUintType(32) : makeIntType(32); + if (numComponents == 1) + resultType = intType; + else + resultType = makeVectorType(intType, numComponents); + + break; + } + case Op::OpImageQueryLod: + resultType = makeVectorType(getScalarTypeId(getTypeId(parameters.coords)), 2); + break; + case Op::OpImageQueryLevels: + case Op::OpImageQuerySamples: + resultType = isUnsignedResult ? makeUintType(32) : makeIntType(32); + break; + default: + assert(0); + break; + } + + Instruction* query = new Instruction(getUniqueId(), resultType, opCode); + query->addIdOperand(parameters.sampler); + if (parameters.coords) + query->addIdOperand(parameters.coords); + if (parameters.lod) + query->addIdOperand(parameters.lod); + addInstruction(std::unique_ptr(query)); + addCapability(Capability::ImageQuery); + + return query->getResultId(); +} + +// External comments in header. +// Operates recursively to visit the composite's hierarchy. +Id Builder::createCompositeCompare(Decoration precision, Id value1, Id value2, bool equal) +{ + Id boolType = makeBoolType(); + Id valueType = getTypeId(value1); + + Id resultId = NoResult; + + int numConstituents = getNumTypeConstituents(valueType); + + // Scalars and Vectors + + if (isScalarType(valueType) || isVectorType(valueType)) { + assert(valueType == getTypeId(value2)); + // These just need a single comparison, just have + // to figure out what it is. + Op op; + switch (getMostBasicTypeClass(valueType)) { + case Op::OpTypeFloat: + op = equal ? Op::OpFOrdEqual : Op::OpFUnordNotEqual; + break; + case Op::OpTypeInt: + default: + op = equal ? Op::OpIEqual : Op::OpINotEqual; + break; + case Op::OpTypeBool: + op = equal ? Op::OpLogicalEqual : Op::OpLogicalNotEqual; + precision = NoPrecision; + break; + } + + if (isScalarType(valueType)) { + // scalar + resultId = createBinOp(op, boolType, value1, value2); + } else { + // vector + resultId = createBinOp(op, makeVectorType(boolType, numConstituents), value1, value2); + setPrecision(resultId, precision); + // reduce vector compares... + resultId = createUnaryOp(equal ? Op::OpAll : Op::OpAny, boolType, resultId); + } + + return setPrecision(resultId, precision); + } + + // Only structs, arrays, and matrices should be left. + // They share in common the reduction operation across their constituents. + assert(isAggregateType(valueType) || isMatrixType(valueType)); + + // Compare each pair of constituents + for (int constituent = 0; constituent < numConstituents; ++constituent) { + std::vector indexes(1, constituent); + Id constituentType1 = getContainedTypeId(getTypeId(value1), constituent); + Id constituentType2 = getContainedTypeId(getTypeId(value2), constituent); + Id constituent1 = createCompositeExtract(value1, constituentType1, indexes); + Id constituent2 = createCompositeExtract(value2, constituentType2, indexes); + + Id subResultId = createCompositeCompare(precision, constituent1, constituent2, equal); + + if (constituent == 0) + resultId = subResultId; + else + resultId = setPrecision(createBinOp(equal ? Op::OpLogicalAnd : Op::OpLogicalOr, boolType, resultId, subResultId), + precision); + } + + return resultId; +} + +// OpCompositeConstruct +Id Builder::createCompositeConstruct(Id typeId, const std::vector& constituents) +{ + assert(isAggregateType(typeId) || (getNumTypeConstituents(typeId) > 1 && + getNumTypeConstituents(typeId) == constituents.size()) || + (isCooperativeVectorType(typeId) && constituents.size() == 1)); + + if (generatingOpCodeForSpecConst) { + // Sometime, even in spec-constant-op mode, the constant composite to be + // constructed may not be a specialization constant. + // e.g.: + // const mat2 m2 = mat2(a_spec_const, a_front_end_const, another_front_end_const, third_front_end_const); + // The first column vector should be a spec constant one, as a_spec_const is a spec constant. + // The second column vector should NOT be spec constant, as it does not contain any spec constants. + // To handle such cases, we check the constituents of the constant vector to determine whether this + // vector should be created as a spec constant. + return makeCompositeConstant(typeId, constituents, + std::any_of(constituents.begin(), constituents.end(), + [&](spv::Id id) { return isSpecConstant(id); })); + } + + bool replicate = false; + size_t numConstituents = constituents.size(); + + if (useReplicatedComposites || isCooperativeVectorType(typeId)) { + replicate = numConstituents > 0 && + std::equal(constituents.begin() + 1, constituents.end(), constituents.begin()); + } + + if (replicate) { + numConstituents = 1; + addCapability(spv::Capability::ReplicatedCompositesEXT); + addExtension(spv::E_SPV_EXT_replicated_composites); + } + + Op opcode = replicate ? Op::OpCompositeConstructReplicateEXT : Op::OpCompositeConstruct; + + Instruction* op = new Instruction(getUniqueId(), typeId, opcode); + op->reserveOperands(constituents.size()); + for (size_t c = 0; c < numConstituents; ++c) + op->addIdOperand(constituents[c]); + addInstruction(std::unique_ptr(op)); + + return op->getResultId(); +} + +// coopmat conversion +Id Builder::createCooperativeMatrixConversion(Id typeId, Id source) +{ + Instruction* op = new Instruction(getUniqueId(), typeId, Op::OpCooperativeMatrixConvertNV); + op->addIdOperand(source); + addInstruction(std::unique_ptr(op)); + + return op->getResultId(); +} + +// coopmat reduce +Id Builder::createCooperativeMatrixReduce(Op opcode, Id typeId, Id source, unsigned int mask, Id func) +{ + Instruction* op = new Instruction(getUniqueId(), typeId, opcode); + op->addIdOperand(source); + op->addImmediateOperand(mask); + op->addIdOperand(func); + addInstruction(std::unique_ptr(op)); + + return op->getResultId(); +} + +// coopmat per-element operation +Id Builder::createCooperativeMatrixPerElementOp(Id typeId, const std::vector& operands) +{ + Instruction* op = new Instruction(getUniqueId(), typeId, spv::Op::OpCooperativeMatrixPerElementOpNV); + // skip operand[0], which is where the result is stored + for (uint32_t i = 1; i < operands.size(); ++i) { + op->addIdOperand(operands[i]); + } + addInstruction(std::unique_ptr(op)); + + return op->getResultId(); +} + +// Vector or scalar constructor +Id Builder::createConstructor(Decoration precision, const std::vector& sources, Id resultTypeId) +{ + Id result = NoResult; + unsigned int numTargetComponents = getNumTypeComponents(resultTypeId); + unsigned int targetComponent = 0; + + // Special case: when calling a vector constructor with a single scalar + // argument, smear the scalar + if (sources.size() == 1 && isScalar(sources[0]) && (numTargetComponents > 1 || isCooperativeVectorType(resultTypeId))) + return smearScalar(precision, sources[0], resultTypeId); + + // Special case: 2 vectors of equal size + if (sources.size() == 1 && isVector(sources[0]) && numTargetComponents == getNumComponents(sources[0])) { + assert(resultTypeId == getTypeId(sources[0])); + return sources[0]; + } + + // accumulate the arguments for OpCompositeConstruct + std::vector constituents; + Id scalarTypeId = getScalarTypeId(resultTypeId); + + // lambda to store the result of visiting an argument component + const auto latchResult = [&](Id comp) { + if (numTargetComponents > 1) + constituents.push_back(comp); + else + result = comp; + ++targetComponent; + }; + + // lambda to visit a vector argument's components + const auto accumulateVectorConstituents = [&](Id sourceArg) { + unsigned int sourceSize = getNumComponents(sourceArg); + unsigned int sourcesToUse = sourceSize; + if (sourcesToUse + targetComponent > numTargetComponents) + sourcesToUse = numTargetComponents - targetComponent; + + for (unsigned int s = 0; s < sourcesToUse; ++s) { + std::vector swiz; + swiz.push_back(s); + latchResult(createRvalueSwizzle(precision, scalarTypeId, sourceArg, swiz)); + } + }; + + // lambda to visit a matrix argument's components + const auto accumulateMatrixConstituents = [&](Id sourceArg) { + unsigned int sourceSize = getNumColumns(sourceArg) * getNumRows(sourceArg); + unsigned int sourcesToUse = sourceSize; + if (sourcesToUse + targetComponent > numTargetComponents) + sourcesToUse = numTargetComponents - targetComponent; + + unsigned int col = 0; + unsigned int row = 0; + for (unsigned int s = 0; s < sourcesToUse; ++s) { + if (row >= getNumRows(sourceArg)) { + row = 0; + col++; + } + std::vector indexes; + indexes.push_back(col); + indexes.push_back(row); + latchResult(createCompositeExtract(sourceArg, scalarTypeId, indexes)); + row++; + } + }; + + // Go through the source arguments, each one could have either + // a single or multiple components to contribute. + for (unsigned int i = 0; i < sources.size(); ++i) { + + if (isScalar(sources[i]) || isPointer(sources[i])) + latchResult(sources[i]); + else if (isVector(sources[i]) || isCooperativeVector(sources[i])) + accumulateVectorConstituents(sources[i]); + else if (isMatrix(sources[i])) + accumulateMatrixConstituents(sources[i]); + else + assert(0); + + if (targetComponent >= numTargetComponents) + break; + } + + // If the result is a vector, make it from the gathered constituents. + if (constituents.size() > 0) { + result = createCompositeConstruct(resultTypeId, constituents); + return setPrecision(result, precision); + } else { + // Precision was set when generating this component. + return result; + } +} + +// Comments in header +Id Builder::createMatrixConstructor(Decoration precision, const std::vector& sources, Id resultTypeId) +{ + Id componentTypeId = getScalarTypeId(resultTypeId); + unsigned int numCols = getTypeNumColumns(resultTypeId); + unsigned int numRows = getTypeNumRows(resultTypeId); + + Instruction* instr = module.getInstruction(componentTypeId); + const unsigned bitCount = instr->getImmediateOperand(0); + + // Optimize matrix constructed from a bigger matrix + if (isMatrix(sources[0]) && getNumColumns(sources[0]) >= numCols && getNumRows(sources[0]) >= numRows) { + // To truncate the matrix to a smaller number of rows/columns, we need to: + // 1. For each column, extract the column and truncate it to the required size using shuffle + // 2. Assemble the resulting matrix from all columns + Id matrix = sources[0]; + Id columnTypeId = getContainedTypeId(resultTypeId); + Id sourceColumnTypeId = getContainedTypeId(getTypeId(matrix)); + + std::vector channels; + for (unsigned int row = 0; row < numRows; ++row) + channels.push_back(row); + + std::vector matrixColumns; + for (unsigned int col = 0; col < numCols; ++col) { + std::vector indexes; + indexes.push_back(col); + Id colv = createCompositeExtract(matrix, sourceColumnTypeId, indexes); + setPrecision(colv, precision); + + if (numRows != getNumRows(matrix)) { + matrixColumns.push_back(createRvalueSwizzle(precision, columnTypeId, colv, channels)); + } else { + matrixColumns.push_back(colv); + } + } + + return setPrecision(createCompositeConstruct(resultTypeId, matrixColumns), precision); + } + + // Detect a matrix being constructed from a repeated vector of the correct size. + // Create the composite directly from it. + if (sources.size() == numCols && isVector(sources[0]) && getNumComponents(sources[0]) == numRows && + std::equal(sources.begin() + 1, sources.end(), sources.begin())) { + return setPrecision(createCompositeConstruct(resultTypeId, sources), precision); + } + + // Otherwise, will use a two step process + // 1. make a compile-time 2D array of values + // 2. construct a matrix from that array + + // Step 1. + + // initialize the array to the identity matrix + Id ids[maxMatrixSize][maxMatrixSize]; + Id one = (bitCount == 64 ? makeDoubleConstant(1.0) : makeFloatConstant(1.0)); + Id zero = (bitCount == 64 ? makeDoubleConstant(0.0) : makeFloatConstant(0.0)); + for (int col = 0; col < 4; ++col) { + for (int row = 0; row < 4; ++row) { + if (col == row) + ids[col][row] = one; + else + ids[col][row] = zero; + } + } + + // modify components as dictated by the arguments + if (sources.size() == 1 && isScalar(sources[0])) { + // a single scalar; resets the diagonals + for (int col = 0; col < 4; ++col) + ids[col][col] = sources[0]; + } else if (isMatrix(sources[0])) { + // constructing from another matrix; copy over the parts that exist in both the argument and constructee + Id matrix = sources[0]; + unsigned int minCols = std::min(numCols, getNumColumns(matrix)); + unsigned int minRows = std::min(numRows, getNumRows(matrix)); + for (unsigned int col = 0; col < minCols; ++col) { + std::vector indexes; + indexes.push_back(col); + for (unsigned int row = 0; row < minRows; ++row) { + indexes.push_back(row); + ids[col][row] = createCompositeExtract(matrix, componentTypeId, indexes); + indexes.pop_back(); + setPrecision(ids[col][row], precision); + } + } + } else { + // fill in the matrix in column-major order with whatever argument components are available + unsigned int row = 0; + unsigned int col = 0; + + for (unsigned int arg = 0; arg < sources.size() && col < numCols; ++arg) { + Id argComp = sources[arg]; + for (unsigned int comp = 0; comp < getNumComponents(sources[arg]); ++comp) { + if (getNumComponents(sources[arg]) > 1) { + argComp = createCompositeExtract(sources[arg], componentTypeId, comp); + setPrecision(argComp, precision); + } + ids[col][row++] = argComp; + if (row == numRows) { + row = 0; + col++; + } + if (col == numCols) { + // If more components are provided than fit the matrix, discard the rest. + break; + } + } + } + } + + // Step 2: Construct a matrix from that array. + // First make the column vectors, then make the matrix. + + // make the column vectors + Id columnTypeId = getContainedTypeId(resultTypeId); + std::vector matrixColumns; + for (unsigned int col = 0; col < numCols; ++col) { + std::vector vectorComponents; + for (unsigned int row = 0; row < numRows; ++row) + vectorComponents.push_back(ids[col][row]); + Id column = createCompositeConstruct(columnTypeId, vectorComponents); + setPrecision(column, precision); + matrixColumns.push_back(column); + } + + // make the matrix + return setPrecision(createCompositeConstruct(resultTypeId, matrixColumns), precision); +} + +// Comments in header +Builder::If::If(Id cond, SelectionControlMask ctrl, Builder& gb) : + builder(gb), + condition(cond), + control(ctrl), + elseBlock(nullptr) +{ + function = &builder.getBuildPoint()->getParent(); + + // make the blocks, but only put the then-block into the function, + // the else-block and merge-block will be added later, in order, after + // earlier code is emitted + thenBlock = new Block(builder.getUniqueId(), *function); + mergeBlock = new Block(builder.getUniqueId(), *function); + + // Save the current block, so that we can add in the flow control split when + // makeEndIf is called. + headerBlock = builder.getBuildPoint(); + builder.createSelectionMerge(mergeBlock, control); + + function->addBlock(thenBlock); + builder.setBuildPoint(thenBlock); +} + +// Comments in header +void Builder::If::makeBeginElse() +{ + // Close out the "then" by having it jump to the mergeBlock + builder.createBranch(true, mergeBlock); + + // Make the first else block and add it to the function + elseBlock = new Block(builder.getUniqueId(), *function); + function->addBlock(elseBlock); + + // Start building the else block + builder.setBuildPoint(elseBlock); +} + +// Comments in header +void Builder::If::makeEndIf() +{ + // jump to the merge block + builder.createBranch(true, mergeBlock); + + // Go back to the headerBlock and make the flow control split + builder.setBuildPoint(headerBlock); + if (elseBlock) + builder.createConditionalBranch(condition, thenBlock, elseBlock); + else + builder.createConditionalBranch(condition, thenBlock, mergeBlock); + + // add the merge block to the function + function->addBlock(mergeBlock); + builder.setBuildPoint(mergeBlock); +} + +// Comments in header +void Builder::makeSwitch(Id selector, SelectionControlMask control, int numSegments, const std::vector& caseValues, + const std::vector& valueIndexToSegment, int defaultSegment, + std::vector& segmentBlocks) +{ + Function& function = buildPoint->getParent(); + + // make all the blocks + for (int s = 0; s < numSegments; ++s) + segmentBlocks.push_back(new Block(getUniqueId(), function)); + + Block* mergeBlock = new Block(getUniqueId(), function); + + // make and insert the switch's selection-merge instruction + createSelectionMerge(mergeBlock, control); + + // make the switch instruction + Instruction* switchInst = new Instruction(NoResult, NoType, Op::OpSwitch); + switchInst->reserveOperands((caseValues.size() * 2) + 2); + switchInst->addIdOperand(selector); + auto defaultOrMerge = (defaultSegment >= 0) ? segmentBlocks[defaultSegment] : mergeBlock; + switchInst->addIdOperand(defaultOrMerge->getId()); + defaultOrMerge->addPredecessor(buildPoint); + for (int i = 0; i < (int)caseValues.size(); ++i) { + switchInst->addImmediateOperand(caseValues[i]); + switchInst->addIdOperand(segmentBlocks[valueIndexToSegment[i]]->getId()); + segmentBlocks[valueIndexToSegment[i]]->addPredecessor(buildPoint); + } + addInstruction(std::unique_ptr(switchInst)); + + // push the merge block + switchMerges.push(mergeBlock); +} + +// Comments in header +void Builder::addSwitchBreak(bool implicit) +{ + // branch to the top of the merge block stack + createBranch(implicit, switchMerges.top()); + createAndSetNoPredecessorBlock("post-switch-break"); +} + +// Comments in header +void Builder::nextSwitchSegment(std::vector& segmentBlock, int nextSegment) +{ + int lastSegment = nextSegment - 1; + if (lastSegment >= 0) { + // Close out previous segment by jumping, if necessary, to next segment + if (! buildPoint->isTerminated()) + createBranch(true, segmentBlock[nextSegment]); + } + Block* block = segmentBlock[nextSegment]; + block->getParent().addBlock(block); + setBuildPoint(block); +} + +// Comments in header +void Builder::endSwitch(std::vector& /*segmentBlock*/) +{ + // Close out previous segment by jumping, if necessary, to next segment + if (! buildPoint->isTerminated()) + addSwitchBreak(true); + + switchMerges.top()->getParent().addBlock(switchMerges.top()); + setBuildPoint(switchMerges.top()); + + switchMerges.pop(); +} + +Block& Builder::makeNewBlock() +{ + Function& function = buildPoint->getParent(); + auto block = new Block(getUniqueId(), function); + function.addBlock(block); + return *block; +} + +Builder::LoopBlocks& Builder::makeNewLoop() +{ + // This verbosity is needed to simultaneously get the same behavior + // everywhere (id's in the same order), have a syntax that works + // across lots of versions of C++, have no warnings from pedantic + // compilation modes, and leave the rest of the code alone. + Block& head = makeNewBlock(); + Block& body = makeNewBlock(); + Block& merge = makeNewBlock(); + Block& continue_target = makeNewBlock(); + LoopBlocks blocks(head, body, merge, continue_target); + loops.push(blocks); + return loops.top(); +} + +void Builder::createLoopContinue() +{ + createBranch(false, &loops.top().continue_target); + // Set up a block for dead code. + createAndSetNoPredecessorBlock("post-loop-continue"); +} + +void Builder::createLoopExit() +{ + createBranch(false, &loops.top().merge); + // Set up a block for dead code. + createAndSetNoPredecessorBlock("post-loop-break"); +} + +void Builder::closeLoop() +{ + loops.pop(); +} + +void Builder::clearAccessChain() +{ + accessChain.base = NoResult; + accessChain.indexChain.clear(); + accessChain.instr = NoResult; + accessChain.swizzle.clear(); + accessChain.component = NoResult; + accessChain.preSwizzleBaseType = NoType; + accessChain.isRValue = false; + accessChain.coherentFlags.clear(); + accessChain.alignment = 0; +} + +// Comments in header +void Builder::accessChainPushSwizzle(std::vector& swizzle, Id preSwizzleBaseType, + AccessChain::CoherentFlags coherentFlags, unsigned int alignment) +{ + accessChain.coherentFlags |= coherentFlags; + accessChain.alignment |= alignment; + + // swizzles can be stacked in GLSL, but simplified to a single + // one here; the base type doesn't change + if (accessChain.preSwizzleBaseType == NoType) + accessChain.preSwizzleBaseType = preSwizzleBaseType; + + // if needed, propagate the swizzle for the current access chain + if (accessChain.swizzle.size() > 0) { + std::vector oldSwizzle = accessChain.swizzle; + accessChain.swizzle.resize(0); + for (unsigned int i = 0; i < swizzle.size(); ++i) { + assert(swizzle[i] < oldSwizzle.size()); + accessChain.swizzle.push_back(oldSwizzle[swizzle[i]]); + } + } else + accessChain.swizzle = swizzle; + + // determine if we need to track this swizzle anymore + simplifyAccessChainSwizzle(); +} + +// Comments in header +void Builder::accessChainStore(Id rvalue, Decoration nonUniform, spv::MemoryAccessMask memoryAccess, spv::Scope scope, unsigned int alignment) +{ + assert(accessChain.isRValue == false); + + transferAccessChainSwizzle(true); + + // If a swizzle exists and is not full and is not dynamic, then the swizzle will be broken into individual stores. + if (accessChain.swizzle.size() > 0 && + getNumTypeComponents(getResultingAccessChainType()) != accessChain.swizzle.size() && + accessChain.component == NoResult) { + for (unsigned int i = 0; i < accessChain.swizzle.size(); ++i) { + accessChain.indexChain.push_back(makeUintConstant(accessChain.swizzle[i])); + accessChain.instr = NoResult; + + Id base = collapseAccessChain(); + addDecoration(base, nonUniform); + + accessChain.indexChain.pop_back(); + accessChain.instr = NoResult; + + // dynamic component should be gone + assert(accessChain.component == NoResult); + + Id source = createCompositeExtract(rvalue, getContainedTypeId(getTypeId(rvalue)), i); + + // take LSB of alignment + alignment = alignment & ~(alignment & (alignment-1)); + if (getStorageClass(base) == StorageClass::PhysicalStorageBufferEXT) { + memoryAccess = (spv::MemoryAccessMask)(memoryAccess | spv::MemoryAccessMask::Aligned); + } + + createStore(source, base, memoryAccess, scope, alignment); + } + } + else { + Id base = collapseAccessChain(); + addDecoration(base, nonUniform); + + Id source = rvalue; + + // dynamic component should be gone + assert(accessChain.component == NoResult); + + // If swizzle still exists, it may be out-of-order, we must load the target vector, + // extract and insert elements to perform writeMask and/or swizzle. + if (accessChain.swizzle.size() > 0) { + Id tempBaseId = createLoad(base, spv::NoPrecision); + source = createLvalueSwizzle(getTypeId(tempBaseId), tempBaseId, source, accessChain.swizzle); + } + + // take LSB of alignment + alignment = alignment & ~(alignment & (alignment-1)); + if (getStorageClass(base) == StorageClass::PhysicalStorageBufferEXT) { + memoryAccess = (spv::MemoryAccessMask)(memoryAccess | spv::MemoryAccessMask::Aligned); + } + + createStore(source, base, memoryAccess, scope, alignment); + } +} + +// Comments in header +Id Builder::accessChainLoad(Decoration precision, Decoration l_nonUniform, + Decoration r_nonUniform, Id resultType, spv::MemoryAccessMask memoryAccess, + spv::Scope scope, unsigned int alignment) +{ + Id id; + + if (accessChain.isRValue) { + // transfer access chain, but try to stay in registers + transferAccessChainSwizzle(false); + if (accessChain.indexChain.size() > 0) { + Id swizzleBase = accessChain.preSwizzleBaseType != NoType ? accessChain.preSwizzleBaseType : resultType; + + // if all the accesses are constants, we can use OpCompositeExtract + std::vector indexes; + bool constant = true; + for (int i = 0; i < (int)accessChain.indexChain.size(); ++i) { + if (isConstantScalar(accessChain.indexChain[i])) + indexes.push_back(getConstantScalar(accessChain.indexChain[i])); + else { + constant = false; + break; + } + } + + if (constant) { + id = createCompositeExtract(accessChain.base, swizzleBase, indexes); + setPrecision(id, precision); + } else if (isCooperativeVector(accessChain.base)) { + assert(accessChain.indexChain.size() == 1); + id = createVectorExtractDynamic(accessChain.base, resultType, accessChain.indexChain[0]); + } else { + Id lValue = NoResult; + if (spvVersion >= Spv_1_4 && isValidInitializer(accessChain.base)) { + // make a new function variable for this r-value, using an initializer, + // and mark it as NonWritable so that downstream it can be detected as a lookup + // table + lValue = createVariable(NoPrecision, StorageClass::Function, getTypeId(accessChain.base), + "indexable", accessChain.base); + addDecoration(lValue, Decoration::NonWritable); + } else { + lValue = createVariable(NoPrecision, StorageClass::Function, getTypeId(accessChain.base), + "indexable"); + // store into it + createStore(accessChain.base, lValue); + } + // move base to the new variable + accessChain.base = lValue; + accessChain.isRValue = false; + + // load through the access chain + id = createLoad(collapseAccessChain(), precision); + } + } else + id = accessChain.base; // no precision, it was set when this was defined + } else { + transferAccessChainSwizzle(true); + + // take LSB of alignment + alignment = alignment & ~(alignment & (alignment-1)); + if (getStorageClass(accessChain.base) == StorageClass::PhysicalStorageBufferEXT) { + memoryAccess = (spv::MemoryAccessMask)(memoryAccess | spv::MemoryAccessMask::Aligned); + } + + // load through the access chain + id = collapseAccessChain(); + // Apply nonuniform both to the access chain and the loaded value. + // Buffer accesses need the access chain decorated, and this is where + // loaded image types get decorated. TODO: This should maybe move to + // createImageTextureFunctionCall. + addDecoration(id, l_nonUniform); + id = createLoad(id, precision, memoryAccess, scope, alignment); + addDecoration(id, r_nonUniform); + } + + // Done, unless there are swizzles to do + if (accessChain.swizzle.size() == 0 && accessChain.component == NoResult) + return id; + + // Do remaining swizzling + + // Do the basic swizzle + if (accessChain.swizzle.size() > 0) { + Id swizzledType = getScalarTypeId(getTypeId(id)); + if (accessChain.swizzle.size() > 1) + swizzledType = makeVectorType(swizzledType, (int)accessChain.swizzle.size()); + id = createRvalueSwizzle(precision, swizzledType, id, accessChain.swizzle); + } + + // Do the dynamic component + if (accessChain.component != NoResult) + id = setPrecision(createVectorExtractDynamic(id, resultType, accessChain.component), precision); + + addDecoration(id, r_nonUniform); + return id; +} + +Id Builder::accessChainGetLValue() +{ + assert(accessChain.isRValue == false); + + transferAccessChainSwizzle(true); + Id lvalue = collapseAccessChain(); + + // If swizzle exists, it is out-of-order or not full, we must load the target vector, + // extract and insert elements to perform writeMask and/or swizzle. This does not + // go with getting a direct l-value pointer. + assert(accessChain.swizzle.size() == 0); + assert(accessChain.component == NoResult); + + return lvalue; +} + +// comment in header +Id Builder::accessChainGetInferredType() +{ + // anything to operate on? + if (accessChain.base == NoResult) + return NoType; + Id type = getTypeId(accessChain.base); + + // do initial dereference + if (! accessChain.isRValue) + type = getContainedTypeId(type); + + // dereference each index + for (auto it = accessChain.indexChain.cbegin(); it != accessChain.indexChain.cend(); ++it) { + if (isStructType(type)) + type = getContainedTypeId(type, getConstantScalar(*it)); + else + type = getContainedTypeId(type); + } + + // dereference swizzle + if (accessChain.swizzle.size() == 1) + type = getContainedTypeId(type); + else if (accessChain.swizzle.size() > 1) + type = makeVectorType(getContainedTypeId(type), (int)accessChain.swizzle.size()); + + // dereference component selection + if (accessChain.component) + type = getContainedTypeId(type); + + return type; +} + +void Builder::dump(std::vector& out) const +{ + // Header, before first instructions: + out.push_back(MagicNumber); + out.push_back(spvVersion); + out.push_back(builderNumber); + out.push_back(uniqueId + 1); + out.push_back(0); + + // Capabilities + for (auto it = capabilities.cbegin(); it != capabilities.cend(); ++it) { + Instruction capInst(0, 0, Op::OpCapability); + capInst.addImmediateOperand(*it); + capInst.dump(out); + } + + for (auto it = extensions.cbegin(); it != extensions.cend(); ++it) { + Instruction extInst(0, 0, Op::OpExtension); + extInst.addStringOperand(it->c_str()); + extInst.dump(out); + } + + dumpInstructions(out, imports); + Instruction memInst(0, 0, Op::OpMemoryModel); + memInst.addImmediateOperand(addressModel); + memInst.addImmediateOperand(memoryModel); + memInst.dump(out); + + // Instructions saved up while building: + dumpInstructions(out, entryPoints); + dumpInstructions(out, executionModes); + + // Debug instructions + dumpInstructions(out, strings); + dumpSourceInstructions(out); + for (int e = 0; e < (int)sourceExtensions.size(); ++e) { + Instruction sourceExtInst(0, 0, Op::OpSourceExtension); + sourceExtInst.addStringOperand(sourceExtensions[e]); + sourceExtInst.dump(out); + } + dumpInstructions(out, names); + dumpModuleProcesses(out); + + // Annotation instructions + dumpInstructions(out, decorations); + + dumpInstructions(out, constantsTypesGlobals); + dumpInstructions(out, externals); + + // The functions + module.dump(out); +} + +// +// Protected methods. +// + +// Turn the described access chain in 'accessChain' into an instruction(s) +// computing its address. This *cannot* include complex swizzles, which must +// be handled after this is called. +// +// Can generate code. +Id Builder::collapseAccessChain() +{ + assert(accessChain.isRValue == false); + + // did we already emit an access chain for this? + if (accessChain.instr != NoResult) + return accessChain.instr; + + // If we have a dynamic component, we can still transfer + // that into a final operand to the access chain. We need to remap the + // dynamic component through the swizzle to get a new dynamic component to + // update. + // + // This was not done in transferAccessChainSwizzle() because it might + // generate code. + remapDynamicSwizzle(); + if (accessChain.component != NoResult) { + // transfer the dynamic component to the access chain + accessChain.indexChain.push_back(accessChain.component); + accessChain.component = NoResult; + } + + // note that non-trivial swizzling is left pending + + // do we have an access chain? + if (accessChain.indexChain.size() == 0) + return accessChain.base; + + // emit the access chain + StorageClass storageClass = (StorageClass)module.getStorageClass(getTypeId(accessChain.base)); + accessChain.instr = createAccessChain(storageClass, accessChain.base, accessChain.indexChain); + + return accessChain.instr; +} + +// For a dynamic component selection of a swizzle. +// +// Turn the swizzle and dynamic component into just a dynamic component. +// +// Generates code. +void Builder::remapDynamicSwizzle() +{ + // do we have a swizzle to remap a dynamic component through? + if (accessChain.component != NoResult && accessChain.swizzle.size() > 1) { + // build a vector of the swizzle for the component to map into + std::vector components; + for (int c = 0; c < (int)accessChain.swizzle.size(); ++c) + components.push_back(makeUintConstant(accessChain.swizzle[c])); + Id mapType = makeVectorType(makeUintType(32), (int)accessChain.swizzle.size()); + Id map = makeCompositeConstant(mapType, components); + + // use it + accessChain.component = createVectorExtractDynamic(map, makeUintType(32), accessChain.component); + accessChain.swizzle.clear(); + } +} + +// clear out swizzle if it is redundant, that is reselecting the same components +// that would be present without the swizzle. +void Builder::simplifyAccessChainSwizzle() +{ + // If the swizzle has fewer components than the vector, it is subsetting, and must stay + // to preserve that fact. + if (getNumTypeComponents(accessChain.preSwizzleBaseType) > accessChain.swizzle.size()) + return; + + // if components are out of order, it is a swizzle + for (unsigned int i = 0; i < accessChain.swizzle.size(); ++i) { + if (i != accessChain.swizzle[i]) + return; + } + + // otherwise, there is no need to track this swizzle + accessChain.swizzle.clear(); + if (accessChain.component == NoResult) + accessChain.preSwizzleBaseType = NoType; +} + +// To the extent any swizzling can become part of the chain +// of accesses instead of a post operation, make it so. +// If 'dynamic' is true, include transferring the dynamic component, +// otherwise, leave it pending. +// +// Does not generate code. just updates the access chain. +void Builder::transferAccessChainSwizzle(bool dynamic) +{ + // non existent? + if (accessChain.swizzle.size() == 0 && accessChain.component == NoResult) + return; + + // too complex? + // (this requires either a swizzle, or generating code for a dynamic component) + if (accessChain.swizzle.size() > 1) + return; + + // single component, either in the swizzle and/or dynamic component + if (accessChain.swizzle.size() == 1) { + assert(accessChain.component == NoResult); + // handle static component selection + accessChain.indexChain.push_back(makeUintConstant(accessChain.swizzle.front())); + accessChain.swizzle.clear(); + accessChain.preSwizzleBaseType = NoType; + } else if (dynamic && accessChain.component != NoResult) { + assert(accessChain.swizzle.size() == 0); + // handle dynamic component + accessChain.indexChain.push_back(accessChain.component); + accessChain.preSwizzleBaseType = NoType; + accessChain.component = NoResult; + } +} + +// Utility method for creating a new block and setting the insert point to +// be in it. This is useful for flow-control operations that need a "dummy" +// block proceeding them (e.g. instructions after a discard, etc). +void Builder::createAndSetNoPredecessorBlock(const char* /*name*/) +{ + Block* block = new Block(getUniqueId(), buildPoint->getParent()); + block->setUnreachable(); + buildPoint->getParent().addBlock(block); + setBuildPoint(block); + + // if (name) + // addName(block->getId(), name); +} + +// Comments in header +void Builder::createBranch(bool implicit, Block* block) +{ + Instruction* branch = new Instruction(Op::OpBranch); + branch->addIdOperand(block->getId()); + if (implicit) { + addInstructionNoDebugInfo(std::unique_ptr(branch)); + } + else { + addInstruction(std::unique_ptr(branch)); + } + block->addPredecessor(buildPoint); +} + +void Builder::createSelectionMerge(Block* mergeBlock, SelectionControlMask control) +{ + Instruction* merge = new Instruction(Op::OpSelectionMerge); + merge->reserveOperands(2); + merge->addIdOperand(mergeBlock->getId()); + merge->addImmediateOperand(control); + addInstruction(std::unique_ptr(merge)); +} + +void Builder::createLoopMerge(Block* mergeBlock, Block* continueBlock, LoopControlMask control, + const std::vector& operands) +{ + Instruction* merge = new Instruction(Op::OpLoopMerge); + merge->reserveOperands(operands.size() + 3); + merge->addIdOperand(mergeBlock->getId()); + merge->addIdOperand(continueBlock->getId()); + merge->addImmediateOperand(control); + for (int op = 0; op < (int)operands.size(); ++op) + merge->addImmediateOperand(operands[op]); + addInstruction(std::unique_ptr(merge)); +} + +void Builder::createConditionalBranch(Id condition, Block* thenBlock, Block* elseBlock) +{ + Instruction* branch = new Instruction(Op::OpBranchConditional); + branch->reserveOperands(3); + branch->addIdOperand(condition); + branch->addIdOperand(thenBlock->getId()); + branch->addIdOperand(elseBlock->getId()); + + // A conditional branch is always attached to a condition expression + addInstructionNoDebugInfo(std::unique_ptr(branch)); + + thenBlock->addPredecessor(buildPoint); + elseBlock->addPredecessor(buildPoint); +} + +// OpSource +// [OpSourceContinued] +// ... +void Builder::dumpSourceInstructions(const spv::Id fileId, const std::string& text, + std::vector& out) const +{ + const int maxWordCount = 0xFFFF; + const int opSourceWordCount = 4; + const int nonNullBytesPerInstruction = 4 * (maxWordCount - opSourceWordCount) - 1; + + if (sourceLang != SourceLanguage::Unknown) { + // OpSource Language Version File Source + Instruction sourceInst(NoResult, NoType, Op::OpSource); + sourceInst.reserveOperands(3); + sourceInst.addImmediateOperand(sourceLang); + sourceInst.addImmediateOperand(sourceVersion); + // File operand + if (fileId != NoResult) { + sourceInst.addIdOperand(fileId); + // Source operand + if (text.size() > 0) { + int nextByte = 0; + std::string subString; + while ((int)text.size() - nextByte > 0) { + subString = text.substr(nextByte, nonNullBytesPerInstruction); + if (nextByte == 0) { + // OpSource + sourceInst.addStringOperand(subString.c_str()); + sourceInst.dump(out); + } else { + // OpSourcContinued + Instruction sourceContinuedInst(Op::OpSourceContinued); + sourceContinuedInst.addStringOperand(subString.c_str()); + sourceContinuedInst.dump(out); + } + nextByte += nonNullBytesPerInstruction; + } + } else + sourceInst.dump(out); + } else + sourceInst.dump(out); + } +} + +// Dump an OpSource[Continued] sequence for the source and every include file +void Builder::dumpSourceInstructions(std::vector& out) const +{ + if (emitNonSemanticShaderDebugInfo) return; + dumpSourceInstructions(mainFileId, sourceText, out); + for (auto iItr = includeFiles.begin(); iItr != includeFiles.end(); ++iItr) + dumpSourceInstructions(iItr->first, *iItr->second, out); +} + +template void Builder::dumpInstructions(std::vector& out, const Range& instructions) const +{ + for (const auto& inst : instructions) { + inst->dump(out); + } +} + +void Builder::dumpModuleProcesses(std::vector& out) const +{ + for (int i = 0; i < (int)moduleProcesses.size(); ++i) { + Instruction moduleProcessed(Op::OpModuleProcessed); + moduleProcessed.addStringOperand(moduleProcesses[i]); + moduleProcessed.dump(out); + } +} + +bool Builder::DecorationInstructionLessThan::operator()(const std::unique_ptr& lhs, + const std::unique_ptr& rhs) const +{ + // Order by the id to which the decoration applies first. This is more intuitive. + assert(lhs->isIdOperand(0) && rhs->isIdOperand(0)); + if (lhs->getIdOperand(0) != rhs->getIdOperand(0)) { + return lhs->getIdOperand(0) < rhs->getIdOperand(0); + } + + if (lhs->getOpCode() != rhs->getOpCode()) + return lhs->getOpCode() < rhs->getOpCode(); + + // Now compare the operands. + int minSize = std::min(lhs->getNumOperands(), rhs->getNumOperands()); + for (int i = 1; i < minSize; ++i) { + if (lhs->isIdOperand(i) != rhs->isIdOperand(i)) { + return lhs->isIdOperand(i) < rhs->isIdOperand(i); + } + + if (lhs->isIdOperand(i)) { + if (lhs->getIdOperand(i) != rhs->getIdOperand(i)) { + return lhs->getIdOperand(i) < rhs->getIdOperand(i); + } + } else { + if (lhs->getImmediateOperand(i) != rhs->getImmediateOperand(i)) { + return lhs->getImmediateOperand(i) < rhs->getImmediateOperand(i); + } + } + } + + if (lhs->getNumOperands() != rhs->getNumOperands()) + return lhs->getNumOperands() < rhs->getNumOperands(); + + // In this case they are equal. + return false; +} +} // end spv namespace diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SpvBuilder.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SpvBuilder.h new file mode 100644 index 0000000000..70c1defb72 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SpvBuilder.h @@ -0,0 +1,1138 @@ +// +// Copyright (C) 2014-2015 LunarG, Inc. +// Copyright (C) 2015-2020 Google, Inc. +// Copyright (C) 2017 ARM Limited. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// +// "Builder" is an interface to fully build SPIR-V IR. Allocate one of +// these to build (a thread safe) internal SPIR-V representation (IR), +// and then dump it as a binary stream according to the SPIR-V specification. +// +// A Builder has a 1:1 relationship with a SPIR-V module. +// + +#pragma once +#ifndef SpvBuilder_H +#define SpvBuilder_H + +#include "Logger.h" +#define SPV_ENABLE_UTILITY_CODE +#include "spirv.hpp11" +#include "spvIR.h" +#include "spvUtil.h" + +namespace spv { + #include "GLSL.ext.KHR.h" + #include "GLSL.ext.EXT.h" + #include "NonSemanticShaderDebugInfo100.h" +} + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace spv { + +typedef enum { + Spv_1_0 = (1 << 16), + Spv_1_1 = (1 << 16) | (1 << 8), + Spv_1_2 = (1 << 16) | (2 << 8), + Spv_1_3 = (1 << 16) | (3 << 8), + Spv_1_4 = (1 << 16) | (4 << 8), + Spv_1_5 = (1 << 16) | (5 << 8), + Spv_1_6 = (1 << 16) | (6 << 8), +} SpvVersion; + +struct StructMemberDebugInfo { + std::string name {}; + int line {0}; + int column {0}; + // Set if the caller knows a better debug type than what is associated with the functional SPIR-V type. + spv::Id debugTypeOverride {0}; +}; + +class Builder { +public: + Builder(unsigned int spvVersion, unsigned int userNumber, SpvBuildLogger* logger); + virtual ~Builder(); + + static const int maxMatrixSize = 4; + + unsigned int getSpvVersion() const { return spvVersion; } + + void setSource(spv::SourceLanguage lang, int version) + { + sourceLang = lang; + sourceVersion = version; + } + spv::Id getStringId(const std::string& str) + { + auto sItr = stringIds.find(str); + if (sItr != stringIds.end()) + return sItr->second; + spv::Id strId = getUniqueId(); + Instruction* fileString = new Instruction(strId, NoType, Op::OpString); + const char* file_c_str = str.c_str(); + fileString->addStringOperand(file_c_str); + strings.push_back(std::unique_ptr(fileString)); + module.mapInstruction(fileString); + stringIds[file_c_str] = strId; + return strId; + } + + spv::Id getMainFileId() const { return mainFileId; } + + // Initialize the main source file name + void setDebugMainSourceFile(const std::string& file) + { + if (trackDebugInfo) { + dirtyLineTracker = true; + mainFileId = getStringId(file); + currentFileId = mainFileId; + } + } + + // Set the debug source location tracker in the builder. + // The upcoming instructions in basic blocks will be associated to this location. + void setDebugSourceLocation(int line, const char* filename) + { + if (trackDebugInfo) { + dirtyLineTracker = true; + if (line != 0) { + // TODO: This is special handling of some AST nodes having (untracked) line 0. + // But they should have a valid line number. + currentLine = line; + if (filename) { + currentFileId = getStringId(filename); + } + } + } + } + + void setSourceText(const std::string& text) { sourceText = text; } + void addSourceExtension(const char* ext) { sourceExtensions.push_back(ext); } + void addModuleProcessed(const std::string& p) { moduleProcesses.push_back(p.c_str()); } + void setEmitSpirvDebugInfo() + { + trackDebugInfo = true; + emitSpirvDebugInfo = true; + } + void setEmitNonSemanticShaderDebugInfo(bool emitSourceText) + { + trackDebugInfo = true; + emitNonSemanticShaderDebugInfo = true; + importNonSemanticShaderDebugInfoInstructions(); + + if (emitSourceText) { + emitNonSemanticShaderDebugSource = emitSourceText; + } + } + void addExtension(const char* ext) { extensions.insert(ext); } + void removeExtension(const char* ext) + { + extensions.erase(ext); + } + void addIncorporatedExtension(const char* ext, SpvVersion incorporatedVersion) + { + if (getSpvVersion() < static_cast(incorporatedVersion)) + addExtension(ext); + } + void promoteIncorporatedExtension(const char* baseExt, const char* promoExt, SpvVersion incorporatedVersion) + { + removeExtension(baseExt); + addIncorporatedExtension(promoExt, incorporatedVersion); + } + void addInclude(const std::string& name, const std::string& text) + { + spv::Id incId = getStringId(name); + includeFiles[incId] = &text; + } + Id import(const char*); + void setMemoryModel(spv::AddressingModel addr, spv::MemoryModel mem) + { + addressModel = addr; + memoryModel = mem; + } + + void addCapability(spv::Capability cap) { capabilities.insert(cap); } + + // To get a new for anything needing a new one. + Id getUniqueId() { return ++uniqueId; } + + // To get a set of new s, e.g., for a set of function parameters + Id getUniqueIds(int numIds) + { + Id id = uniqueId + 1; + uniqueId += numIds; + return id; + } + + // Maps the given OpType Id to a Non-Semantic DebugType Id. + Id getDebugType(Id type) { + if (auto it = debugTypeIdLookup.find(type); it != debugTypeIdLookup.end()) { + return it->second; + } + + return NoType; + } + + // Maps the given OpFunction Id to a Non-Semantic DebugFunction Id. + Id getDebugFunction(Id func) { + if (auto it = debugFuncIdLookup.find(func); it != debugFuncIdLookup.end()) { + return it->second; + } + + return NoResult; + } + + // For creating new types (will return old type if the requested one was already made). + Id makeVoidType(); + Id makeBoolType(); + Id makePointer(StorageClass, Id pointee); + Id makeForwardPointer(StorageClass); + Id makePointerFromForwardPointer(StorageClass, Id forwardPointerType, Id pointee); + Id makeIntegerType(int width, bool hasSign); // generic + Id makeIntType(int width) { return makeIntegerType(width, true); } + Id makeUintType(int width) { return makeIntegerType(width, false); } + Id makeFloatType(int width); + Id makeBFloat16Type(); + Id makeFloatE5M2Type(); + Id makeFloatE4M3Type(); + Id makeStructType(const std::vector& members, const std::vector& memberDebugInfo, + const char* name, bool const compilerGenerated = true); + Id makeStructResultType(Id type0, Id type1); + Id makeVectorType(Id component, int size); + Id makeMatrixType(Id component, int cols, int rows); + Id makeArrayType(Id element, Id sizeId, int stride); // 0 stride means no stride decoration + Id makeRuntimeArray(Id element); + Id makeFunctionType(Id returnType, const std::vector& paramTypes); + Id makeImageType(Id sampledType, Dim, bool depth, bool arrayed, bool ms, unsigned sampled, ImageFormat format, const char* debugNames); + Id makeSamplerType(const char* debugName); + Id makeSampledImageType(Id imageType, const char* debugName); + Id makeCooperativeMatrixTypeKHR(Id component, Id scope, Id rows, Id cols, Id use); + Id makeCooperativeMatrixTypeNV(Id component, Id scope, Id rows, Id cols); + Id makeCooperativeMatrixTypeWithSameShape(Id component, Id otherType); + Id makeCooperativeVectorTypeNV(Id componentType, Id components); + Id makeTensorTypeARM(Id elementType, Id rank); + Id makeGenericType(spv::Op opcode, std::vector& operands); + + // SPIR-V NonSemantic Shader DebugInfo Instructions + Id makeDebugInfoNone(); + Id makeBoolDebugType(int const size); + Id makeIntegerDebugType(int const width, bool const hasSign); + Id makeFloatDebugType(int const width); + Id makeSequentialDebugType(Id const baseType, Id const componentCount, NonSemanticShaderDebugInfo100Instructions const sequenceType); + Id makeArrayDebugType(Id const baseType, Id const componentCount); + Id makeVectorDebugType(Id const baseType, int const componentCount); + Id makeMatrixDebugType(Id const vectorType, int const vectorCount, bool columnMajor = true); + Id makeMemberDebugType(Id const memberType, StructMemberDebugInfo const& debugTypeLoc); + Id makeCompositeDebugType(std::vector const& memberTypes, std::vector const& memberDebugInfo, + char const* const name, NonSemanticShaderDebugInfo100DebugCompositeType const tag); + Id makeOpaqueDebugType(char const* const name); + Id makePointerDebugType(StorageClass storageClass, Id const baseType); + Id makeForwardPointerDebugType(StorageClass storageClass); + Id makeDebugSource(const Id fileName); + Id makeDebugCompilationUnit(); + Id createDebugGlobalVariable(Id const type, char const*const name, Id const variable); + Id createDebugLocalVariable(Id type, char const*const name, size_t const argNumber = 0); + Id makeDebugExpression(); + Id makeDebugDeclare(Id const debugLocalVariable, Id const pointer); + Id makeDebugValue(Id const debugLocalVariable, Id const value); + Id makeDebugFunctionType(Id returnType, const std::vector& paramTypes); + Id makeDebugFunction(Function* function, Id nameId, Id funcTypeId); + Id makeDebugLexicalBlock(uint32_t line, uint32_t column); + std::string unmangleFunctionName(std::string const& name) const; + + // Initialize non-semantic debug information for a function, including those of: + // - The function definition + // - The function parameters + void setupFunctionDebugInfo(Function* function, const char* name, const std::vector& paramTypes, + const std::vector& paramNames); + + // accelerationStructureNV type + Id makeAccelerationStructureType(); + // rayQueryEXT type + Id makeRayQueryType(); + // hitObjectNV type + Id makeHitObjectNVType(); + // hitObjectEXT type + Id makeHitObjectEXTType(); + + // For querying about types. + Id getTypeId(Id resultId) const { return module.getTypeId(resultId); } + Id getDerefTypeId(Id resultId) const; + Op getOpCode(Id id) const { return module.getInstruction(id)->getOpCode(); } + Op getTypeClass(Id typeId) const { return getOpCode(typeId); } + Op getMostBasicTypeClass(Id typeId) const; + unsigned int getNumComponents(Id resultId) const { return getNumTypeComponents(getTypeId(resultId)); } + unsigned int getNumTypeConstituents(Id typeId) const; + unsigned int getNumTypeComponents(Id typeId) const { return getNumTypeConstituents(typeId); } + Id getScalarTypeId(Id typeId) const; + Id getContainedTypeId(Id typeId) const; + Id getContainedTypeId(Id typeId, int) const; + StorageClass getTypeStorageClass(Id typeId) const { return module.getStorageClass(typeId); } + ImageFormat getImageTypeFormat(Id typeId) const + { return (ImageFormat)module.getInstruction(typeId)->getImmediateOperand(6); } + Id getResultingAccessChainType() const; + Id getIdOperand(Id resultId, int idx) { return module.getInstruction(resultId)->getIdOperand(idx); } + Id getCooperativeVectorNumComponents(Id typeId) const { return module.getInstruction(typeId)->getIdOperand(1); } + + bool isPointer(Id resultId) const { return isPointerType(getTypeId(resultId)); } + bool isScalar(Id resultId) const { return isScalarType(getTypeId(resultId)); } + bool isVector(Id resultId) const { return isVectorType(getTypeId(resultId)); } + bool isMatrix(Id resultId) const { return isMatrixType(getTypeId(resultId)); } + bool isCooperativeMatrix(Id resultId)const { return isCooperativeMatrixType(getTypeId(resultId)); } + bool isCooperativeVector(Id resultId)const { return isCooperativeVectorType(getTypeId(resultId)); } + bool isAggregate(Id resultId) const { return isAggregateType(getTypeId(resultId)); } + bool isSampledImage(Id resultId) const { return isSampledImageType(getTypeId(resultId)); } + bool isTensorView(Id resultId)const { return isTensorViewType(getTypeId(resultId)); } + + bool isBoolType(Id typeId) + { return groupedTypes[enumCast(Op::OpTypeBool)].size() > 0 && typeId == groupedTypes[enumCast(Op::OpTypeBool)].back()->getResultId(); } + bool isIntType(Id typeId) const + { return getTypeClass(typeId) == Op::OpTypeInt && module.getInstruction(typeId)->getImmediateOperand(1) != 0; } + bool isUintType(Id typeId) const + { return getTypeClass(typeId) == Op::OpTypeInt && module.getInstruction(typeId)->getImmediateOperand(1) == 0; } + bool isFloatType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeFloat; } + bool isPointerType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypePointer; } + bool isScalarType(Id typeId) const + { return getTypeClass(typeId) == Op::OpTypeFloat || getTypeClass(typeId) == Op::OpTypeInt || + getTypeClass(typeId) == Op::OpTypeBool; } + bool isVectorType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeVector; } + bool isMatrixType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeMatrix; } + bool isStructType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeStruct; } + bool isArrayType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeArray; } + bool isCooperativeMatrixType(Id typeId)const + { + return getTypeClass(typeId) == Op::OpTypeCooperativeMatrixKHR || getTypeClass(typeId) == Op::OpTypeCooperativeMatrixNV; + } + bool isTensorViewType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeTensorViewNV; } + bool isCooperativeVectorType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeCooperativeVectorNV; } + bool isTensorTypeARM(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeTensorARM; } + bool isAggregateType(Id typeId) const + { return isArrayType(typeId) || isStructType(typeId) || isCooperativeMatrixType(typeId); } + bool isImageType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeImage; } + bool isSamplerType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeSampler; } + bool isSampledImageType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeSampledImage; } + bool containsType(Id typeId, Op typeOp, unsigned int width) const; + bool containsPhysicalStorageBufferOrArray(Id typeId) const; + + bool isConstantOpCode(Op opcode) const; + bool isSpecConstantOpCode(Op opcode) const; + bool isConstant(Id resultId) const { return isConstantOpCode(getOpCode(resultId)); } + bool isConstantScalar(Id resultId) const { return getOpCode(resultId) == Op::OpConstant; } + bool isSpecConstant(Id resultId) const { return isSpecConstantOpCode(getOpCode(resultId)); } + unsigned int getConstantScalar(Id resultId) const + { return module.getInstruction(resultId)->getImmediateOperand(0); } + StorageClass getStorageClass(Id resultId) const { return getTypeStorageClass(getTypeId(resultId)); } + + bool isVariableOpCode(Op opcode) const { return opcode == Op::OpVariable; } + bool isVariable(Id resultId) const { return isVariableOpCode(getOpCode(resultId)); } + bool isGlobalStorage(Id resultId) const { return getStorageClass(resultId) != StorageClass::Function; } + bool isGlobalVariable(Id resultId) const { return isVariable(resultId) && isGlobalStorage(resultId); } + // See if a resultId is valid for use as an initializer. + bool isValidInitializer(Id resultId) const { return isConstant(resultId) || isGlobalVariable(resultId); } + + int getScalarTypeWidth(Id typeId) const + { + Id scalarTypeId = getScalarTypeId(typeId); + assert(getTypeClass(scalarTypeId) == Op::OpTypeInt || getTypeClass(scalarTypeId) == Op::OpTypeFloat); + return module.getInstruction(scalarTypeId)->getImmediateOperand(0); + } + + unsigned int getTypeNumColumns(Id typeId) const + { + assert(isMatrixType(typeId)); + return getNumTypeConstituents(typeId); + } + unsigned int getNumColumns(Id resultId) const { return getTypeNumColumns(getTypeId(resultId)); } + unsigned int getTypeNumRows(Id typeId) const + { + assert(isMatrixType(typeId)); + return getNumTypeComponents(getContainedTypeId(typeId)); + } + unsigned int getNumRows(Id resultId) const { return getTypeNumRows(getTypeId(resultId)); } + + Dim getTypeDimensionality(Id typeId) const + { + assert(isImageType(typeId)); + return (Dim)module.getInstruction(typeId)->getImmediateOperand(1); + } + Id getImageType(Id resultId) const + { + Id typeId = getTypeId(resultId); + assert(isImageType(typeId) || isSampledImageType(typeId)); + return isSampledImageType(typeId) ? module.getInstruction(typeId)->getIdOperand(0) : typeId; + } + bool isArrayedImageType(Id typeId) const + { + assert(isImageType(typeId)); + return module.getInstruction(typeId)->getImmediateOperand(3) != 0; + } + + // For making new constants (will return old constant if the requested one was already made). + Id makeNullConstant(Id typeId); + Id makeBoolConstant(bool b, bool specConstant = false); + Id makeIntConstant(Id typeId, unsigned value, bool specConstant); + Id makeInt64Constant(Id typeId, unsigned long long value, bool specConstant); + Id makeInt8Constant(int i, bool specConstant = false) + { return makeIntConstant(makeIntType(8), (unsigned)i, specConstant); } + Id makeUint8Constant(unsigned u, bool specConstant = false) + { return makeIntConstant(makeUintType(8), u, specConstant); } + Id makeInt16Constant(int i, bool specConstant = false) + { return makeIntConstant(makeIntType(16), (unsigned)i, specConstant); } + Id makeUint16Constant(unsigned u, bool specConstant = false) + { return makeIntConstant(makeUintType(16), u, specConstant); } + Id makeIntConstant(int i, bool specConstant = false) + { return makeIntConstant(makeIntType(32), (unsigned)i, specConstant); } + Id makeUintConstant(unsigned u, bool specConstant = false) + { return makeIntConstant(makeUintType(32), u, specConstant); } + Id makeUintConstant(Scope u, bool specConstant = false) + { return makeUintConstant((unsigned)u, specConstant); } + Id makeUintConstant(StorageClass u, bool specConstant = false) + { return makeUintConstant((unsigned)u, specConstant); } + Id makeUintConstant(MemorySemanticsMask u, bool specConstant = false) + { return makeUintConstant((unsigned)u, specConstant); } + Id makeUintConstant(SourceLanguage u, bool specConstant = false) + { return makeUintConstant((unsigned)u, specConstant); } + Id makeInt64Constant(long long i, bool specConstant = false) + { return makeInt64Constant(makeIntType(64), (unsigned long long)i, specConstant); } + Id makeUint64Constant(unsigned long long u, bool specConstant = false) + { return makeInt64Constant(makeUintType(64), u, specConstant); } + Id makeFloatConstant(float f, bool specConstant = false); + Id makeDoubleConstant(double d, bool specConstant = false); + Id makeFloat16Constant(float f16, bool specConstant = false); + Id makeBFloat16Constant(float bf16, bool specConstant = false); + Id makeFloatE5M2Constant(float fe5m2, bool specConstant = false); + Id makeFloatE4M3Constant(float fe4m3, bool specConstant = false); + Id makeFpConstant(Id type, double d, bool specConstant = false); + + Id importNonSemanticShaderDebugInfoInstructions(); + + // Turn the array of constants into a proper spv constant of the requested type. + Id makeCompositeConstant(Id type, const std::vector& comps, bool specConst = false); + + // Methods for adding information outside the CFG. + Instruction* addEntryPoint(ExecutionModel, Function*, const char* name); + void addExecutionMode(Function*, ExecutionMode mode, int value1 = -1, int value2 = -1, int value3 = -1); + void addExecutionMode(Function*, ExecutionMode mode, const std::vector& literals); + void addExecutionModeId(Function*, ExecutionMode mode, const std::vector& operandIds); + void addName(Id, const char* name); + void addMemberName(Id, int member, const char* name); + void addDecoration(Id, Decoration, int num = -1); + void addDecoration(Id, Decoration, const char*); + void addDecoration(Id, Decoration, const std::vector& literals); + void addDecoration(Id, Decoration, const std::vector& strings); + void addLinkageDecoration(Id id, const char* name, spv::LinkageType linkType); + void addDecorationId(Id id, Decoration, Id idDecoration); + void addDecorationId(Id id, Decoration, const std::vector& operandIds); + void addMemberDecoration(Id, unsigned int member, Decoration, int num = -1); + void addMemberDecoration(Id, unsigned int member, Decoration, const char*); + void addMemberDecoration(Id, unsigned int member, Decoration, const std::vector& literals); + void addMemberDecoration(Id, unsigned int member, Decoration, const std::vector& strings); + + // At the end of what block do the next create*() instructions go? + // Also reset current last DebugScope and current source line to unknown + void setBuildPoint(Block* bp) { + buildPoint = bp; + dirtyLineTracker = true; + dirtyScopeTracker = true; + } + Block* getBuildPoint() const { return buildPoint; } + + // Append an instruction to the end of the current build point. + // Optionally, additional debug info instructions may also be prepended. + void addInstruction(std::unique_ptr inst); + + // Append an instruction to the end of the current build point without prepending any debug instructions. + // This is useful for insertion of some debug info instructions themselves or some control flow instructions + // that are attached to its predecessor instruction. + void addInstructionNoDebugInfo(std::unique_ptr inst); + + // Make the entry-point function. The returned pointer is only valid + // for the lifetime of this builder. + Function* makeEntryPoint(const char*); + + // Make a shader-style function, and create its entry block if entry is non-zero. + // Return the function, pass back the entry. + // The returned pointer is only valid for the lifetime of this builder. + Function* makeFunctionEntry(Decoration precision, Id returnType, const char* name, LinkageType linkType, + const std::vector& paramTypes, + const std::vector>& precisions, Block** entry = nullptr); + + // Create a return. An 'implicit' return is one not appearing in the source + // code. In the case of an implicit return, no post-return block is inserted. + void makeReturn(bool implicit, Id retVal = 0); + + // Initialize state and generate instructions for new lexical scope + void enterLexicalBlock(uint32_t line, uint32_t column); + + // Set state and generate instructions to exit current lexical scope + void leaveLexicalBlock(); + + // Prepare builder for generation of instructions for a function. + void enterFunction(Function const* function); + + // Generate all the code needed to finish up a function. + void leaveFunction(); + + // Create block terminator instruction for certain statements like + // discard, terminate-invocation, terminateRayEXT, or ignoreIntersectionEXT + void makeStatementTerminator(spv::Op opcode, const char *name); + + // Create block terminator instruction for statements that have input operands + // such as OpEmitMeshTasksEXT + void makeStatementTerminator(spv::Op opcode, const std::vector& operands, const char* name); + + // Create a global/local constant. Because OpConstant is automatically emitted by getting the constant + // ids, this function only handles debug info. + void createConstVariable(Id type, const char* name, Id constant, bool isGlobal); + + // Create a global or function local or IO variable. + Id createVariable(Decoration precision, StorageClass storageClass, Id type, const char* name = nullptr, + Id initializer = NoResult, bool const compilerGenerated = true); + + // Create an intermediate with an undefined value. + Id createUndefined(Id type); + + // Store into an Id and return the l-value + void createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMask::MaskNone, + spv::Scope scope = spv::Scope::Max, unsigned int alignment = 0); + + // Load from an Id and return it + Id createLoad(Id lValue, spv::Decoration precision, + spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMask::MaskNone, + spv::Scope scope = spv::Scope::Max, unsigned int alignment = 0); + + // Create an OpAccessChain instruction + Id createAccessChain(StorageClass, Id base, const std::vector& offsets); + + // Create an OpArrayLength instruction + Id createArrayLength(Id base, unsigned int member, unsigned int bits); + + // Create an OpCooperativeMatrixLengthKHR instruction + Id createCooperativeMatrixLengthKHR(Id type); + // Create an OpCooperativeMatrixLengthNV instruction + Id createCooperativeMatrixLengthNV(Id type); + + // Create an OpCompositeExtract instruction + Id createCompositeExtract(Id composite, Id typeId, unsigned index); + Id createCompositeExtract(Id composite, Id typeId, const std::vector& indexes); + Id createCompositeInsert(Id object, Id composite, Id typeId, unsigned index); + Id createCompositeInsert(Id object, Id composite, Id typeId, const std::vector& indexes); + + Id createVectorExtractDynamic(Id vector, Id typeId, Id componentIndex); + Id createVectorInsertDynamic(Id vector, Id typeId, Id component, Id componentIndex); + + void createNoResultOp(Op); + void createNoResultOp(Op, Id operand); + void createNoResultOp(Op, const std::vector& operands); + void createNoResultOp(Op, const std::vector& operands); + void createControlBarrier(Scope execution, Scope memory, MemorySemanticsMask); + void createMemoryBarrier(Scope executionScope, MemorySemanticsMask memorySemantics); + Id createUnaryOp(Op, Id typeId, Id operand); + Id createBinOp(Op, Id typeId, Id operand1, Id operand2); + Id createTriOp(Op, Id typeId, Id operand1, Id operand2, Id operand3); + Id createOp(Op, Id typeId, const std::vector& operands); + Id createOp(Op, Id typeId, const std::vector& operands); + Id createFunctionCall(spv::Function*, const std::vector&); + Id createSpecConstantOp(Op, Id typeId, const std::vector& operands, const std::vector& literals); + + // Take an rvalue (source) and a set of channels to extract from it to + // make a new rvalue, which is returned. + Id createRvalueSwizzle(Decoration precision, Id typeId, Id source, const std::vector& channels); + + // Take a copy of an lvalue (target) and a source of components, and set the + // source components into the lvalue where the 'channels' say to put them. + // An updated version of the target is returned. + // (No true lvalue or stores are used.) + Id createLvalueSwizzle(Id typeId, Id target, Id source, const std::vector& channels); + + // If both the id and precision are valid, the id + // gets tagged with the requested precision. + // The passed in id is always the returned id, to simplify use patterns. + Id setPrecision(Id id, Decoration precision) + { + if (precision != NoPrecision && id != NoResult) + addDecoration(id, precision); + + return id; + } + + // Can smear a scalar to a vector for the following forms: + // - promoteScalar(scalar, vector) // smear scalar to width of vector + // - promoteScalar(vector, scalar) // smear scalar to width of vector + // - promoteScalar(pointer, scalar) // smear scalar to width of what pointer points to + // - promoteScalar(scalar, scalar) // do nothing + // Other forms are not allowed. + // + // Generally, the type of 'scalar' does not need to be the same type as the components in 'vector'. + // The type of the created vector is a vector of components of the same type as the scalar. + // + // Note: One of the arguments will change, with the result coming back that way rather than + // through the return value. + void promoteScalar(Decoration precision, Id& left, Id& right); + + // Make a value by smearing the scalar to fill the type. + // vectorType should be the correct type for making a vector of scalarVal. + // (No conversions are done.) + Id smearScalar(Decoration precision, Id scalarVal, Id vectorType); + + // Create a call to a built-in function. + Id createBuiltinCall(Id resultType, Id builtins, int entryPoint, const std::vector& args); + + // List of parameters used to create a texture operation + struct TextureParameters { + Id sampler; + Id coords; + Id bias; + Id lod; + Id Dref; + Id offset; + Id offsets; + Id gradX; + Id gradY; + Id sample; + Id component; + Id texelOut; + Id lodClamp; + Id granularity; + Id coarse; + bool nonprivate; + bool volatil; + bool nontemporal; + }; + + // Select the correct texture operation based on all inputs, and emit the correct instruction + Id createTextureCall(Decoration precision, Id resultType, bool sparse, bool fetch, bool proj, bool gather, + bool noImplicit, const TextureParameters&, ImageOperandsMask); + + // Emit the OpTextureQuery* instruction that was passed in. + // Figure out the right return value and type, and return it. + Id createTextureQueryCall(Op, const TextureParameters&, bool isUnsignedResult); + + Id createSamplePositionCall(Decoration precision, Id, Id); + + Id createBitFieldExtractCall(Decoration precision, Id, Id, Id, bool isSigned); + Id createBitFieldInsertCall(Decoration precision, Id, Id, Id, Id); + + // Reduction comparison for composites: For equal and not-equal resulting in a scalar. + Id createCompositeCompare(Decoration precision, Id, Id, bool /* true if for equal, false if for not-equal */); + + // OpCompositeConstruct + Id createCompositeConstruct(Id typeId, const std::vector& constituents); + + // vector or scalar constructor + Id createConstructor(Decoration precision, const std::vector& sources, Id resultTypeId); + + // matrix constructor + Id createMatrixConstructor(Decoration precision, const std::vector& sources, Id constructee); + + // coopmat conversion + Id createCooperativeMatrixConversion(Id typeId, Id source); + Id createCooperativeMatrixReduce(Op opcode, Id typeId, Id source, unsigned int mask, Id func); + Id createCooperativeMatrixPerElementOp(Id typeId, const std::vector& operands); + + // Helper to use for building nested control flow with if-then-else. + class If { + public: + If(Id condition, SelectionControlMask ctrl, Builder& builder); + ~If() {} + + void makeBeginElse(); + void makeEndIf(); + + private: + If(const If&); + If& operator=(If&); + + Builder& builder; + Id condition; + SelectionControlMask control; + Function* function; + Block* headerBlock; + Block* thenBlock; + Block* elseBlock; + Block* mergeBlock; + }; + + // Make a switch statement. A switch has 'numSegments' of pieces of code, not containing + // any case/default labels, all separated by one or more case/default labels. Each possible + // case value v is a jump to the caseValues[v] segment. The defaultSegment is also in this + // number space. How to compute the value is given by 'condition', as in switch(condition). + // + // The SPIR-V Builder will maintain the stack of post-switch merge blocks for nested switches. + // + // Use a defaultSegment < 0 if there is no default segment (to branch to post switch). + // + // Returns the right set of basic blocks to start each code segment with, so that the caller's + // recursion stack can hold the memory for it. + // + void makeSwitch(Id condition, SelectionControlMask control, int numSegments, const std::vector& caseValues, + const std::vector& valueToSegment, int defaultSegment, std::vector& segmentBB); + + // Add a branch to the innermost switch's merge block. + void addSwitchBreak(bool implicit); + + // Move to the next code segment, passing in the return argument in makeSwitch() + void nextSwitchSegment(std::vector& segmentBB, int segment); + + // Finish off the innermost switch. + void endSwitch(std::vector& segmentBB); + + struct LoopBlocks { + LoopBlocks(Block& head, Block& body, Block& merge, Block& continue_target) : + head(head), body(body), merge(merge), continue_target(continue_target) { } + Block &head, &body, &merge, &continue_target; + private: + LoopBlocks(); + LoopBlocks& operator=(const LoopBlocks&) = delete; + }; + + // Start a new loop and prepare the builder to generate code for it. Until + // closeLoop() is called for this loop, createLoopContinue() and + // createLoopExit() will target its corresponding blocks. + LoopBlocks& makeNewLoop(); + + // Create a new block in the function containing the build point. Memory is + // owned by the function object. + Block& makeNewBlock(); + + // Add a branch to the continue_target of the current (innermost) loop. + void createLoopContinue(); + + // Add an exit (e.g. "break") from the innermost loop that we're currently + // in. + void createLoopExit(); + + // Close the innermost loop that you're in + void closeLoop(); + + // + // Access chain design for an R-Value vs. L-Value: + // + // There is a single access chain the builder is building at + // any particular time. Such a chain can be used to either to a load or + // a store, when desired. + // + // Expressions can be r-values, l-values, or both, or only r-values: + // a[b.c].d = .... // l-value + // ... = a[b.c].d; // r-value, that also looks like an l-value + // ++a[b.c].d; // r-value and l-value + // (x + y)[2]; // r-value only, can't possibly be l-value + // + // Computing an r-value means generating code. Hence, + // r-values should only be computed when they are needed, not speculatively. + // + // Computing an l-value means saving away information for later use in the compiler, + // no code is generated until the l-value is later dereferenced. It is okay + // to speculatively generate an l-value, just not okay to speculatively dereference it. + // + // The base of the access chain (the left-most variable or expression + // from which everything is based) can be set either as an l-value + // or as an r-value. Most efficient would be to set an l-value if one + // is available. If an expression was evaluated, the resulting r-value + // can be set as the chain base. + // + // The users of this single access chain can save and restore if they + // want to nest or manage multiple chains. + // + + struct AccessChain { + Id base; // for l-values, pointer to the base object, for r-values, the base object + std::vector indexChain; + Id instr; // cache the instruction that generates this access chain + std::vector swizzle; // each std::vector element selects the next GLSL component number + Id component; // a dynamic component index, can coexist with a swizzle, + // done after the swizzle, NoResult if not present + Id preSwizzleBaseType; // dereferenced type, before swizzle or component is applied; + // NoType unless a swizzle or component is present + bool isRValue; // true if 'base' is an r-value, otherwise, base is an l-value + unsigned int alignment; // bitwise OR of alignment values passed in. Accumulates worst alignment. + // Only tracks base and (optional) component selection alignment. + + // Accumulate whether anything in the chain of structures has coherent decorations. + struct CoherentFlags { + CoherentFlags() { clear(); } + bool isVolatile() const { return volatil; } + bool isNonUniform() const { return nonUniform; } + bool anyCoherent() const { + return coherent || devicecoherent || queuefamilycoherent || workgroupcoherent || + subgroupcoherent || shadercallcoherent; + } + + unsigned coherent : 1; + unsigned devicecoherent : 1; + unsigned queuefamilycoherent : 1; + unsigned workgroupcoherent : 1; + unsigned subgroupcoherent : 1; + unsigned shadercallcoherent : 1; + unsigned nonprivate : 1; + unsigned volatil : 1; + unsigned nontemporal : 1; + unsigned isImage : 1; + unsigned nonUniform : 1; + + void clear() { + coherent = 0; + devicecoherent = 0; + queuefamilycoherent = 0; + workgroupcoherent = 0; + subgroupcoherent = 0; + shadercallcoherent = 0; + nonprivate = 0; + volatil = 0; + nontemporal = 0; + isImage = 0; + nonUniform = 0; + } + + CoherentFlags operator |=(const CoherentFlags &other) { + coherent |= other.coherent; + devicecoherent |= other.devicecoherent; + queuefamilycoherent |= other.queuefamilycoherent; + workgroupcoherent |= other.workgroupcoherent; + subgroupcoherent |= other.subgroupcoherent; + shadercallcoherent |= other.shadercallcoherent; + nonprivate |= other.nonprivate; + volatil |= other.volatil; + nontemporal = other.nontemporal; + isImage |= other.isImage; + nonUniform |= other.nonUniform; + return *this; + } + }; + CoherentFlags coherentFlags; + }; + + // + // the SPIR-V builder maintains a single active chain that + // the following methods operate on + // + + // for external save and restore + AccessChain getAccessChain() { return accessChain; } + void setAccessChain(AccessChain newChain) { accessChain = newChain; } + + // clear accessChain + void clearAccessChain(); + + // set new base as an l-value base + void setAccessChainLValue(Id lValue) + { + assert(isPointer(lValue)); + accessChain.base = lValue; + } + + // set new base value as an r-value + void setAccessChainRValue(Id rValue) + { + accessChain.isRValue = true; + accessChain.base = rValue; + } + + // push offset onto the end of the chain + void accessChainPush(Id offset, AccessChain::CoherentFlags coherentFlags, unsigned int alignment) + { + accessChain.indexChain.push_back(offset); + accessChain.coherentFlags |= coherentFlags; + accessChain.alignment |= alignment; + } + + // push new swizzle onto the end of any existing swizzle, merging into a single swizzle + void accessChainPushSwizzle(std::vector& swizzle, Id preSwizzleBaseType, + AccessChain::CoherentFlags coherentFlags, unsigned int alignment); + + // push a dynamic component selection onto the access chain, only applicable with a + // non-trivial swizzle or no swizzle + void accessChainPushComponent(Id component, Id preSwizzleBaseType, AccessChain::CoherentFlags coherentFlags, + unsigned int alignment) + { + if (accessChain.swizzle.size() != 1) { + accessChain.component = component; + if (accessChain.preSwizzleBaseType == NoType) + accessChain.preSwizzleBaseType = preSwizzleBaseType; + } + accessChain.coherentFlags |= coherentFlags; + accessChain.alignment |= alignment; + } + + // use accessChain and swizzle to store value + void accessChainStore(Id rvalue, Decoration nonUniform, + spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMask::MaskNone, + spv::Scope scope = spv::Scope::Max, unsigned int alignment = 0); + + // use accessChain and swizzle to load an r-value + Id accessChainLoad(Decoration precision, Decoration l_nonUniform, Decoration r_nonUniform, Id ResultType, + spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMask::MaskNone, spv::Scope scope = spv::Scope::Max, + unsigned int alignment = 0); + + // Return whether or not the access chain can be represented in SPIR-V + // as an l-value. + // E.g., a[3].yx cannot be, while a[3].y and a[3].y[x] can be. + bool isSpvLvalue() const { return accessChain.swizzle.size() <= 1; } + + // get the direct pointer for an l-value + Id accessChainGetLValue(); + + // Get the inferred SPIR-V type of the result of the current access chain, + // based on the type of the base and the chain of dereferences. + Id accessChainGetInferredType(); + + // Add capabilities, extensions, remove unneeded decorations, etc., + // based on the resulting SPIR-V. + void postProcess(bool compileOnly); + + // Prune unreachable blocks in the CFG and remove unneeded decorations. + void postProcessCFG(); + + // Add capabilities, extensions based on instructions in the module. + void postProcessFeatures(); + // Hook to visit each instruction in a block in a function + void postProcess(Instruction&); + // Hook to visit each non-32-bit sized float/int operation in a block. + void postProcessType(const Instruction&, spv::Id typeId); + // move OpSampledImage instructions to be next to their users. + void postProcessSamplers(); + + void dump(std::vector&) const; + + // Add a branch to the target block. + // If set implicit, the branch instruction shouldn't have debug source location. + void createBranch(bool implicit, Block* block); + void createConditionalBranch(Id condition, Block* thenBlock, Block* elseBlock); + void createLoopMerge(Block* mergeBlock, Block* continueBlock, LoopControlMask control, + const std::vector& operands); + + // Sets to generate opcode for specialization constants. + void setToSpecConstCodeGenMode() { generatingOpCodeForSpecConst = true; } + // Sets to generate opcode for non-specialization constants (normal mode). + void setToNormalCodeGenMode() { generatingOpCodeForSpecConst = false; } + // Check if the builder is generating code for spec constants. + bool isInSpecConstCodeGenMode() { return generatingOpCodeForSpecConst; } + + void setUseReplicatedComposites(bool use) { useReplicatedComposites = use; } + +private: + // Helper to get size of a scalar (in bytes) + unsigned int postProcessGetLargestScalarSize(const Instruction& type); + +protected: + Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value); + Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2); + Id findCompositeConstant(Op typeClass, Op opcode, Id typeId, const std::vector& comps, size_t numMembers); + Id findStructConstant(Id typeId, const std::vector& comps); + Id collapseAccessChain(); + void remapDynamicSwizzle(); + void transferAccessChainSwizzle(bool dynamic); + void simplifyAccessChainSwizzle(); + void createAndSetNoPredecessorBlock(const char*); + void createSelectionMerge(Block* mergeBlock, SelectionControlMask control); + void dumpSourceInstructions(std::vector&) const; + void dumpSourceInstructions(const spv::Id fileId, const std::string& text, std::vector&) const; + template void dumpInstructions(std::vector& out, const Range& instructions) const; + void dumpModuleProcesses(std::vector&) const; + spv::MemoryAccessMask sanitizeMemoryAccessForStorageClass(spv::MemoryAccessMask memoryAccess, StorageClass sc) + const; + struct DecorationInstructionLessThan { + bool operator()(const std::unique_ptr& lhs, const std::unique_ptr& rhs) const; + }; + + unsigned int spvVersion; // the version of SPIR-V to emit in the header + SourceLanguage sourceLang; + int sourceVersion; + spv::Id nonSemanticShaderCompilationUnitId {0}; + spv::Id nonSemanticShaderDebugInfo {0}; + spv::Id debugInfoNone {0}; + spv::Id debugExpression {0}; // Debug expression with zero operations. + std::string sourceText; + + // True if an new OpLine/OpDebugLine may need to be inserted. Either: + // 1. The current debug location changed + // 2. The current build point changed + bool dirtyLineTracker; + int currentLine = 0; + // OpString id of the current file name. Always 0 if debug info is off. + spv::Id currentFileId = 0; + // OpString id of the main file name. Always 0 if debug info is off. + spv::Id mainFileId = 0; + + // True if an new OpDebugScope may need to be inserted. Either: + // 1. A new lexical block is pushed + // 2. The current build point changed + bool dirtyScopeTracker; + std::stack currentDebugScopeId; + + // This flag toggles tracking of debug info while building the SPIR-V. + bool trackDebugInfo = false; + // This flag toggles emission of SPIR-V debug instructions, like OpLine and OpSource. + bool emitSpirvDebugInfo = false; + // This flag toggles emission of Non-Semantic Debug extension debug instructions. + bool emitNonSemanticShaderDebugInfo = false; + bool restoreNonSemanticShaderDebugInfo = false; + bool emitNonSemanticShaderDebugSource = false; + + std::set extensions; + std::vector sourceExtensions; + std::vector moduleProcesses; + AddressingModel addressModel; + MemoryModel memoryModel; + std::set capabilities; + int builderNumber; + Module module; + Block* buildPoint; + Id uniqueId; + Function* entryPointFunction; + // This tracks the current function being built, or nullptr if not in a function. + Function const* currentFunction { nullptr }; + bool generatingOpCodeForSpecConst; + bool useReplicatedComposites { false }; + AccessChain accessChain; + + // special blocks of instructions for output + std::vector > strings; + std::vector > imports; + std::vector > entryPoints; + std::vector > executionModes; + std::vector > names; + std::set, DecorationInstructionLessThan> decorations; + std::vector > constantsTypesGlobals; + std::vector > externals; + std::vector > functions; + + // not output, internally used for quick & dirty canonical (unique) creation + + // Key for scalar constants (handles both 32-bit and 64-bit) + struct ScalarConstantKey { + unsigned int typeClass; // OpTypeInt, OpTypeFloat, OpTypeBool + unsigned int opcode; // OpConstant, OpSpecConstant, OpConstantTrue, etc. + Id typeId; // The specific type + unsigned value1; // First operand (or only operand) + unsigned value2; // Second operand (0 for single-operand constants) + + bool operator==(const ScalarConstantKey& other) const { + return typeClass == other.typeClass && + opcode == other.opcode && + typeId == other.typeId && + value1 == other.value1 && + value2 == other.value2; + } + }; + + struct ScalarConstantKeyHash { + // 64/32 bit mix function from MurmurHash3 + inline std::size_t hash_mix(std::size_t h) const { + if constexpr (sizeof(std::size_t) == 8) { + h ^= h >> 33; + h *= UINT64_C(0xff51afd7ed558ccd); + h ^= h >> 33; + h *= UINT64_C(0xc4ceb9fe1a85ec53); + h ^= h >> 33; + return h; + } else { + h ^= h >> 16; + h *= UINT32_C(0x85ebca6b); + h ^= h >> 13; + h *= UINT32_C(0xc2b2ae35); + h ^= h >> 16; + return h; + } + } + + // Hash combine from boost + inline std::size_t hash_combine(std::size_t seed, std::size_t v) const { + return hash_mix(seed + 0x9e3779b9 + v); + } + + std::size_t operator()(const ScalarConstantKey& k) const { + size_t hash1 = hash_combine(std::hash{}(k.typeClass), std::hash{}(k.opcode)); + size_t hash2 = hash_combine(std::hash{}(k.value1), std::hash{}(k.value2)); + size_t hash3 = hash_combine(hash1, hash2); + return hash_combine(hash3, std::hash{}(k.typeId)); + } + }; + + // map type opcodes to constant inst. + std::unordered_map> groupedCompositeConstants; + // map struct-id to constant instructions + std::unordered_map> groupedStructConstants; + // map type opcodes to type instructions + std::unordered_map> groupedTypes; + // map type opcodes to debug type instructions + std::unordered_map> groupedDebugTypes; + // list of OpConstantNull instructions + std::vector nullConstants; + // map scalar constants to result IDs + std::unordered_map groupedScalarConstantResultIDs; + + // Track which types have explicit layouts, to avoid reusing in storage classes without layout. + // Currently only tracks array types. + std::unordered_set explicitlyLaidOut; + + // stack of switches + std::stack switchMerges; + + // Our loop stack. + std::stack loops; + + // map from strings to their string ids + std::unordered_map stringIds; + + // map from include file name ids to their contents + std::map includeFiles; + + // maps from OpTypeXXX id to DebugTypeXXX id + std::unordered_map debugTypeIdLookup; + + // maps from OpFunction id to DebugFunction id + std::unordered_map debugFuncIdLookup; + + // map from file name string id to DebugSource id + std::unordered_map debugSourceId; + + // The stream for outputting warnings and errors. + SpvBuildLogger* logger; +}; // end Builder class + +} // end spv namespace + +#endif // SpvBuilder_H diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SpvPostProcess.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SpvPostProcess.cpp new file mode 100644 index 0000000000..068e33e82e --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SpvPostProcess.cpp @@ -0,0 +1,623 @@ +// +// Copyright (C) 2018 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// +// Post-processing for SPIR-V IR, in internal form, not standard binary form. +// + +#include +#include + +#include +#include +#include + +#include "SPIRV/spvIR.h" +#include "SpvBuilder.h" +#include "spirv.hpp11" +#include "spvUtil.h" + +namespace spv { + #include "GLSL.std.450.h" + #include "GLSL.ext.KHR.h" + #include "GLSL.ext.EXT.h" + #include "GLSL.ext.AMD.h" + #include "GLSL.ext.NV.h" + #include "GLSL.ext.ARM.h" + #include "GLSL.ext.QCOM.h" +} + +namespace spv { + +// Hook to visit each operand type and result type of an instruction. +// Will be called multiple times for one instruction, once for each typed +// operand and the result. +void Builder::postProcessType(const Instruction& inst, Id typeId) +{ + // Characterize the type being questioned + Op basicTypeOp = getMostBasicTypeClass(typeId); + int width = 0; + if (basicTypeOp == Op::OpTypeFloat || basicTypeOp == Op::OpTypeInt) + width = getScalarTypeWidth(typeId); + + // Do opcode-specific checks + switch (inst.getOpCode()) { + case Op::OpLoad: + case Op::OpStore: + if (basicTypeOp == Op::OpTypeStruct) { + if (containsType(typeId, Op::OpTypeInt, 8)) + addCapability(Capability::Int8); + if (containsType(typeId, Op::OpTypeInt, 16)) + addCapability(Capability::Int16); + if (containsType(typeId, Op::OpTypeFloat, 16)) + addCapability(Capability::Float16); + } else { + StorageClass storageClass = getStorageClass(inst.getIdOperand(0)); + if (width == 8) { + switch (storageClass) { + case StorageClass::PhysicalStorageBufferEXT: + case StorageClass::Uniform: + case StorageClass::StorageBuffer: + case StorageClass::PushConstant: + break; + default: + addCapability(Capability::Int8); + break; + } + } else if (width == 16) { + switch (storageClass) { + case StorageClass::PhysicalStorageBufferEXT: + case StorageClass::Uniform: + case StorageClass::StorageBuffer: + case StorageClass::PushConstant: + case StorageClass::Input: + case StorageClass::Output: + break; + default: + if (basicTypeOp == Op::OpTypeInt) + addCapability(Capability::Int16); + if (basicTypeOp == Op::OpTypeFloat) + addCapability(Capability::Float16); + break; + } + } + } + break; + case Op::OpCopyObject: + break; + case Op::OpFConvert: + case Op::OpSConvert: + case Op::OpUConvert: + // Look for any 8/16-bit storage capabilities. If there are none, assume that + // the convert instruction requires the Float16/Int8/16 capability. + if (containsType(typeId, Op::OpTypeFloat, 16) || containsType(typeId, Op::OpTypeInt, 16)) { + bool foundStorage = false; + for (auto it = capabilities.begin(); it != capabilities.end(); ++it) { + spv::Capability cap = *it; + if (cap == spv::Capability::StorageInputOutput16 || + cap == spv::Capability::StoragePushConstant16 || + cap == spv::Capability::StorageUniformBufferBlock16 || + cap == spv::Capability::StorageUniform16) { + foundStorage = true; + break; + } + } + if (!foundStorage) { + if (containsType(typeId, Op::OpTypeFloat, 16)) + addCapability(Capability::Float16); + if (containsType(typeId, Op::OpTypeInt, 16)) + addCapability(Capability::Int16); + } + } + if (containsType(typeId, Op::OpTypeInt, 8)) { + bool foundStorage = false; + for (auto it = capabilities.begin(); it != capabilities.end(); ++it) { + spv::Capability cap = *it; + if (cap == spv::Capability::StoragePushConstant8 || + cap == spv::Capability::UniformAndStorageBuffer8BitAccess || + cap == spv::Capability::StorageBuffer8BitAccess) { + foundStorage = true; + break; + } + } + if (!foundStorage) { + addCapability(Capability::Int8); + } + } + break; + case Op::OpExtInst: + switch (inst.getImmediateOperand(1)) { + case GLSLstd450Frexp: + case GLSLstd450FrexpStruct: + if (getSpvVersion() < spv::Spv_1_3 && containsType(typeId, Op::OpTypeInt, 16)) + addExtension(spv::E_SPV_AMD_gpu_shader_int16); + break; + case GLSLstd450InterpolateAtCentroid: + case GLSLstd450InterpolateAtSample: + case GLSLstd450InterpolateAtOffset: + if (getSpvVersion() < spv::Spv_1_3 && containsType(typeId, Op::OpTypeFloat, 16)) + addExtension(spv::E_SPV_AMD_gpu_shader_half_float); + break; + default: + break; + } + break; + case Op::OpAccessChain: + case Op::OpPtrAccessChain: + if (isPointerType(typeId)) + break; + if (basicTypeOp == Op::OpTypeInt) { + if (width == 16) + addCapability(Capability::Int16); + else if (width == 8) + addCapability(Capability::Int8); + } + break; + default: + if (basicTypeOp == Op::OpTypeInt) { + if (width == 16) + addCapability(Capability::Int16); + else if (width == 8) + addCapability(Capability::Int8); + else if (width == 64) + addCapability(Capability::Int64); + } else if (basicTypeOp == Op::OpTypeFloat) { + if (width == 16) + addCapability(Capability::Float16); + else if (width == 64) + addCapability(Capability::Float64); + } + break; + } +} + +unsigned int Builder::postProcessGetLargestScalarSize(const Instruction& type) +{ + switch (type.getOpCode()) { + case Op::OpTypeBool: + return 1; + case Op::OpTypeInt: + case Op::OpTypeFloat: + return type.getImmediateOperand(0) / 8; + case Op::OpTypePointer: + return 8; + case Op::OpTypeVector: + case Op::OpTypeMatrix: + case Op::OpTypeArray: + case Op::OpTypeRuntimeArray: { + const Instruction* elem_type = module.getInstruction(type.getIdOperand(0)); + return postProcessGetLargestScalarSize(*elem_type); + } + case Op::OpTypeStruct: { + unsigned int largest = 0; + for (int i = 0; i < type.getNumOperands(); ++i) { + const Instruction* elem_type = module.getInstruction(type.getIdOperand(i)); + unsigned int elem_size = postProcessGetLargestScalarSize(*elem_type); + largest = std::max(largest, elem_size); + } + return largest; + } + default: + return 0; + } +} + +// Called for each instruction that resides in a block. +void Builder::postProcess(Instruction& inst) +{ + // Add capabilities based simply on the opcode. + switch (inst.getOpCode()) { + case Op::OpExtInst: + switch (inst.getImmediateOperand(1)) { + case GLSLstd450InterpolateAtCentroid: + case GLSLstd450InterpolateAtSample: + case GLSLstd450InterpolateAtOffset: + addCapability(Capability::InterpolationFunction); + break; + default: + break; + } + break; + case Op::OpDPdxFine: + case Op::OpDPdyFine: + case Op::OpFwidthFine: + case Op::OpDPdxCoarse: + case Op::OpDPdyCoarse: + case Op::OpFwidthCoarse: + addCapability(Capability::DerivativeControl); + break; + + case Op::OpImageQueryLod: + case Op::OpImageQuerySize: + case Op::OpImageQuerySizeLod: + case Op::OpImageQuerySamples: + case Op::OpImageQueryLevels: + addCapability(Capability::ImageQuery); + break; + + case Op::OpGroupNonUniformPartitionNV: + addExtension(E_SPV_NV_shader_subgroup_partitioned); + addCapability(Capability::GroupNonUniformPartitionedNV); + break; + + case Op::OpLoad: + case Op::OpStore: + { + // For any load/store to a PhysicalStorageBufferEXT, walk the accesschain + // index list to compute the misalignment. The pre-existing alignment value + // (set via Builder::AccessChain::alignment) only accounts for the base of + // the reference type and any scalar component selection in the accesschain, + // and this function computes the rest from the SPIR-V Offset decorations. + Instruction *accessChain = module.getInstruction(inst.getIdOperand(0)); + if (accessChain->getOpCode() == Op::OpAccessChain) { + const Instruction* base = module.getInstruction(accessChain->getIdOperand(0)); + // Get the type of the base of the access chain. It must be a pointer type. + Id typeId = base->getTypeId(); + Instruction *type = module.getInstruction(typeId); + assert(type->getOpCode() == Op::OpTypePointer); + if (type->getImmediateOperand(0) != StorageClass::PhysicalStorageBuffer) { + break; + } + // Get the pointee type. + typeId = type->getIdOperand(1); + type = module.getInstruction(typeId); + // Walk the index list for the access chain. For each index, find any + // misalignment that can apply when accessing the member/element via + // Offset/ArrayStride/MatrixStride decorations, and bitwise OR them all + // together. + int alignment = 0; + bool first_struct_elem = false; + for (int i = 1; i < accessChain->getNumOperands(); ++i) { + Instruction *idx = module.getInstruction(accessChain->getIdOperand(i)); + if (type->getOpCode() == Op::OpTypeStruct) { + assert(idx->getOpCode() == Op::OpConstant); + unsigned int c = idx->getImmediateOperand(0); + + const auto function = [&](const std::unique_ptr& decoration) { + if (decoration.get()->getOpCode() == Op::OpMemberDecorate && + decoration.get()->getIdOperand(0) == typeId && + decoration.get()->getImmediateOperand(1) == c && + (decoration.get()->getImmediateOperand(2) == Decoration::Offset || + decoration.get()->getImmediateOperand(2) == Decoration::MatrixStride)) { + unsigned int opernad_value = decoration.get()->getImmediateOperand(3); + alignment |= opernad_value; + if (opernad_value == 0 && + decoration.get()->getImmediateOperand(2) == Decoration::Offset) { + first_struct_elem = true; + } + } + }; + std::for_each(decorations.begin(), decorations.end(), function); + // get the next member type + typeId = type->getIdOperand(c); + type = module.getInstruction(typeId); + } else if (type->getOpCode() == Op::OpTypeArray || + type->getOpCode() == Op::OpTypeRuntimeArray) { + const auto function = [&](const std::unique_ptr& decoration) { + if (decoration.get()->getOpCode() == Op::OpDecorate && + decoration.get()->getIdOperand(0) == typeId && + decoration.get()->getImmediateOperand(1) == Decoration::ArrayStride) { + alignment |= decoration.get()->getImmediateOperand(2); + } + }; + std::for_each(decorations.begin(), decorations.end(), function); + // Get the element type + typeId = type->getIdOperand(0); + type = module.getInstruction(typeId); + } else { + // Once we get to any non-aggregate type, we're done. + break; + } + } + assert(inst.getNumOperands() >= 3); + const bool is_store = inst.getOpCode() == Op::OpStore; + auto const memoryAccess = (MemoryAccessMask)inst.getImmediateOperand(is_store ? 2 : 1); + assert(anySet(memoryAccess, MemoryAccessMask::Aligned)); + static_cast(memoryAccess); + + // Compute the index of the alignment operand. + int alignmentIdx = 2; + if (is_store) + alignmentIdx++; + // Merge new and old (mis)alignment + alignment |= inst.getImmediateOperand(alignmentIdx); + + if (!is_store) { + Instruction* inst_type = module.getInstruction(inst.getTypeId()); + if (inst_type->getOpCode() == Op::OpTypePointer && + inst_type->getImmediateOperand(0) == StorageClass::PhysicalStorageBuffer) { + // This means we are loading a pointer which means need to ensure it is at least 8-byte aligned + // See https://github.com/KhronosGroup/glslang/issues/4084 + // In case the alignment is currently 4, need to ensure it is 8 before grabbing the LSB + alignment |= 8; + alignment &= 8; + } + } + + // Pick the LSB + alignment = alignment & ~(alignment & (alignment-1)); + + // The edge case we find is when copying a struct to another struct, we never find the alignment anywhere, + // so in this case, fallback to doing a full size lookup on the type + if (alignment == 0 && first_struct_elem) { + // Quick get the struct type back + const Instruction* pointer_type = module.getInstruction(base->getTypeId()); + const Instruction* struct_type = module.getInstruction(pointer_type->getIdOperand(1)); + assert(struct_type->getOpCode() == Op::OpTypeStruct); + + const Instruction* elem_type = module.getInstruction(struct_type->getIdOperand(0)); + unsigned int largest_scalar = postProcessGetLargestScalarSize(*elem_type); + if (largest_scalar != 0) { + alignment = largest_scalar; + } else { + alignment = 16; // fallback if can't determine a godo alignment + } + } + // update the Aligned operand + assert(alignment != 0); + inst.setImmediateOperand(alignmentIdx, alignment); + } + break; + } + + default: + break; + } + + // Checks based on type + if (inst.getTypeId() != NoType) + postProcessType(inst, inst.getTypeId()); + for (int op = 0; op < inst.getNumOperands(); ++op) { + if (inst.isIdOperand(op)) { + // In blocks, these are always result ids, but we are relying on + // getTypeId() to return NoType for things like OpLabel. + if (getTypeId(inst.getIdOperand(op)) != NoType) + postProcessType(inst, getTypeId(inst.getIdOperand(op))); + } + } +} + +// comment in header +void Builder::postProcessCFG() +{ + // reachableBlocks is the set of blockss reached via control flow, or which are + // unreachable continue targert or unreachable merge. + std::unordered_set reachableBlocks; + std::unordered_map headerForUnreachableContinue; + std::unordered_set unreachableMerges; + std::unordered_set unreachableDefinitions; + // Collect IDs defined in unreachable blocks. For each function, label the + // reachable blocks first. Then for each unreachable block, collect the + // result IDs of the instructions in it. + for (auto fi = module.getFunctions().cbegin(); fi != module.getFunctions().cend(); fi++) { + Function* f = *fi; + Block* entry = f->getEntryBlock(); + inReadableOrder(entry, + [&reachableBlocks, &unreachableMerges, &headerForUnreachableContinue] + (Block* b, ReachReason why, Block* header) { + reachableBlocks.insert(b); + if (why == ReachDeadContinue) headerForUnreachableContinue[b] = header; + if (why == ReachDeadMerge) unreachableMerges.insert(b); + }); + for (auto bi = f->getBlocks().cbegin(); bi != f->getBlocks().cend(); bi++) { + Block* b = *bi; + if (unreachableMerges.count(b) != 0 || headerForUnreachableContinue.count(b) != 0) { + auto ii = b->getInstructions().cbegin(); + ++ii; // Keep potential decorations on the label. + for (; ii != b->getInstructions().cend(); ++ii) + unreachableDefinitions.insert(ii->get()->getResultId()); + } else if (reachableBlocks.count(b) == 0) { + // The normal case for unreachable code. All definitions are considered dead. + for (auto ii = b->getInstructions().cbegin(); ii != b->getInstructions().cend(); ++ii) + unreachableDefinitions.insert(ii->get()->getResultId()); + } + } + } + + // Modify unreachable merge blocks and unreachable continue targets. + // Delete their contents. + for (auto mergeIter = unreachableMerges.begin(); mergeIter != unreachableMerges.end(); ++mergeIter) { + (*mergeIter)->rewriteAsCanonicalUnreachableMerge(); + } + for (auto continueIter = headerForUnreachableContinue.begin(); + continueIter != headerForUnreachableContinue.end(); + ++continueIter) { + Block* continue_target = continueIter->first; + Block* header = continueIter->second; + continue_target->rewriteAsCanonicalUnreachableContinue(header); + } + + // Remove unneeded decorations, for unreachable instructions + for (auto decorationIter = decorations.begin(); decorationIter != decorations.end();) { + Id decorationId = (*decorationIter)->getIdOperand(0); + if (unreachableDefinitions.count(decorationId) != 0) { + decorationIter = decorations.erase(decorationIter); + } else { + ++decorationIter; + } + } +} + +// comment in header +void Builder::postProcessFeatures() { + // Add per-instruction capabilities, extensions, etc., + + // Look for any 8/16 bit type in physical storage buffer class, and set the + // appropriate capability. This happens in createSpvVariable for other storage + // classes, but there isn't always a variable for physical storage buffer. + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypePointer)].size(); ++t) { + Instruction* type = groupedTypes[enumCast(Op::OpTypePointer)][t]; + if (type->getImmediateOperand(0) == (unsigned)StorageClass::PhysicalStorageBufferEXT) { + if (containsType(type->getIdOperand(1), Op::OpTypeInt, 8)) { + addIncorporatedExtension(spv::E_SPV_KHR_8bit_storage, spv::Spv_1_5); + addCapability(spv::Capability::StorageBuffer8BitAccess); + } + if (containsType(type->getIdOperand(1), Op::OpTypeInt, 16) || + containsType(type->getIdOperand(1), Op::OpTypeFloat, 16)) { + addIncorporatedExtension(spv::E_SPV_KHR_16bit_storage, spv::Spv_1_3); + addCapability(spv::Capability::StorageBuffer16BitAccess); + } + } + } + + // process all block-contained instructions + for (auto fi = module.getFunctions().cbegin(); fi != module.getFunctions().cend(); fi++) { + Function* f = *fi; + for (auto bi = f->getBlocks().cbegin(); bi != f->getBlocks().cend(); bi++) { + Block* b = *bi; + for (auto ii = b->getInstructions().cbegin(); ii != b->getInstructions().cend(); ii++) + postProcess(*ii->get()); + + // For all local variables that contain pointers to PhysicalStorageBufferEXT, check whether + // there is an existing restrict/aliased decoration. If we don't find one, add Aliased as the + // default. + for (auto vi = b->getLocalVariables().cbegin(); vi != b->getLocalVariables().cend(); vi++) { + const Instruction& inst = *vi->get(); + Id resultId = inst.getResultId(); + if (containsPhysicalStorageBufferOrArray(getDerefTypeId(resultId))) { + bool foundDecoration = false; + const auto function = [&](const std::unique_ptr& decoration) { + if (decoration.get()->getIdOperand(0) == resultId && + decoration.get()->getOpCode() == Op::OpDecorate && + (decoration.get()->getImmediateOperand(1) == spv::Decoration::AliasedPointerEXT || + decoration.get()->getImmediateOperand(1) == spv::Decoration::RestrictPointerEXT)) { + foundDecoration = true; + } + }; + std::for_each(decorations.begin(), decorations.end(), function); + if (!foundDecoration) { + addDecoration(resultId, spv::Decoration::AliasedPointerEXT); + } + } + } + } + } + + // If any Vulkan memory model-specific functionality is used, update the + // OpMemoryModel to match. + if (capabilities.find(spv::Capability::VulkanMemoryModelKHR) != capabilities.end()) { + memoryModel = spv::MemoryModel::VulkanKHR; + addIncorporatedExtension(spv::E_SPV_KHR_vulkan_memory_model, spv::Spv_1_5); + } + + // Add Aliased decoration if there's more than one Workgroup Block variable. + if (capabilities.find(spv::Capability::WorkgroupMemoryExplicitLayoutKHR) != capabilities.end()) { + assert(entryPoints.size() == 1); + auto &ep = entryPoints[0]; + + std::vector workgroup_variables; + for (int i = 0; i < (int)ep->getNumOperands(); i++) { + if (!ep->isIdOperand(i)) + continue; + + const Id id = ep->getIdOperand(i); + const Instruction *instr = module.getInstruction(id); + if (instr->getOpCode() != spv::Op::OpVariable) + continue; + + if (instr->getImmediateOperand(0) == spv::StorageClass::Workgroup) + workgroup_variables.push_back(id); + } + + if (workgroup_variables.size() > 1) { + for (size_t i = 0; i < workgroup_variables.size(); i++) + addDecoration(workgroup_variables[i], spv::Decoration::Aliased); + } + } +} + +// SPIR-V requires that any instruction consuming the result of an OpSampledImage +// be in the same block as the OpSampledImage instruction. This pass goes finds +// uses of OpSampledImage where that is not the case and duplicates the +// OpSampledImage to be immediately before the instruction that consumes it. +// The old OpSampledImage is left in place, potentially with no users. +void Builder::postProcessSamplers() +{ + // first, find all OpSampledImage instructions and store them in a map. + std::map sampledImageInstrs; + for (auto f: module.getFunctions()) { + for (auto b: f->getBlocks()) { + for (auto &i: b->getInstructions()) { + if (i->getOpCode() == spv::Op::OpSampledImage) { + sampledImageInstrs[i->getResultId()] = i.get(); + } + } + } + } + // next find all uses of the given ids and rewrite them if needed. + for (auto f: module.getFunctions()) { + for (auto b: f->getBlocks()) { + auto &instrs = b->getInstructions(); + for (size_t idx = 0; idx < instrs.size(); idx++) { + Instruction *i = instrs[idx].get(); + for (int opnum = 0; opnum < i->getNumOperands(); opnum++) { + // Is this operand of the current instruction the result of an OpSampledImage? + if (i->isIdOperand(opnum) && + sampledImageInstrs.count(i->getIdOperand(opnum))) + { + Instruction *opSampImg = sampledImageInstrs[i->getIdOperand(opnum)]; + if (i->getBlock() != opSampImg->getBlock()) { + Instruction *newInstr = new Instruction(getUniqueId(), + opSampImg->getTypeId(), + spv::Op::OpSampledImage); + newInstr->addIdOperand(opSampImg->getIdOperand(0)); + newInstr->addIdOperand(opSampImg->getIdOperand(1)); + newInstr->setBlock(b); + + // rewrite the user of the OpSampledImage to use the new instruction. + i->setIdOperand(opnum, newInstr->getResultId()); + // insert the new OpSampledImage right before the current instruction. + instrs.insert(instrs.begin() + idx, + std::unique_ptr(newInstr)); + idx++; + } + } + } + } + } + } +} + +// comment in header +void Builder::postProcess(bool compileOnly) +{ + // postProcessCFG needs an entrypoint to determine what is reachable, but if we are not creating an "executable" shader, we don't have an entrypoint + if (!compileOnly) + postProcessCFG(); + + postProcessFeatures(); + postProcessSamplers(); +} + +} // end spv namespace diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SpvTools.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SpvTools.cpp new file mode 100644 index 0000000000..0951133e6a --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SpvTools.cpp @@ -0,0 +1,319 @@ +// +// Copyright (C) 2014-2016 LunarG, Inc. +// Copyright (C) 2018-2020 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// +// Call into SPIRV-Tools to disassemble, validate, and optimize. +// + +#if ENABLE_OPT + +#include +#include + +#include "SpvTools.h" +#include "spirv-tools/optimizer.hpp" +#include "glslang/MachineIndependent/localintermediate.h" + +namespace QtShaderTools { +namespace glslang { + +// Translate glslang's view of target versioning to what SPIRV-Tools uses. +spv_target_env MapToSpirvToolsEnv(const SpvVersion& spvVersion, spv::SpvBuildLogger* logger) +{ + switch (spvVersion.vulkan) { + case glslang::EShTargetVulkan_1_0: + return spv_target_env::SPV_ENV_VULKAN_1_0; + case glslang::EShTargetVulkan_1_1: + switch (spvVersion.spv) { + case EShTargetSpv_1_0: + case EShTargetSpv_1_1: + case EShTargetSpv_1_2: + case EShTargetSpv_1_3: + return spv_target_env::SPV_ENV_VULKAN_1_1; + case EShTargetSpv_1_4: + return spv_target_env::SPV_ENV_VULKAN_1_1_SPIRV_1_4; + default: + logger->missingFunctionality("Target version for SPIRV-Tools validator"); + return spv_target_env::SPV_ENV_VULKAN_1_1; + } + case glslang::EShTargetVulkan_1_2: + return spv_target_env::SPV_ENV_VULKAN_1_2; + case glslang::EShTargetVulkan_1_3: + return spv_target_env::SPV_ENV_VULKAN_1_3; + case glslang::EShTargetVulkan_1_4: + return spv_target_env::SPV_ENV_VULKAN_1_4; + default: + break; + } + + if (spvVersion.openGl > 0) + return spv_target_env::SPV_ENV_OPENGL_4_5; + + logger->missingFunctionality("Target version for SPIRV-Tools validator"); + return spv_target_env::SPV_ENV_UNIVERSAL_1_0; +} + +spv_target_env MapToSpirvToolsEnv(const glslang::TIntermediate& intermediate, spv::SpvBuildLogger* logger) +{ + return MapToSpirvToolsEnv(intermediate.getSpv(), logger); +} + +// Callback passed to spvtools::Optimizer::SetMessageConsumer +void OptimizerMesssageConsumer(spv_message_level_t level, const char *source, + const spv_position_t &position, const char *message) +{ + auto &out = std::cerr; + switch (level) + { + case SPV_MSG_FATAL: + case SPV_MSG_INTERNAL_ERROR: + case SPV_MSG_ERROR: + out << "error: "; + break; + case SPV_MSG_WARNING: + out << "warning: "; + break; + case SPV_MSG_INFO: + case SPV_MSG_DEBUG: + out << "info: "; + break; + default: + break; + } + if (source) + { + out << source << ":"; + } + out << position.line << ":" << position.column << ":" << position.index << ":"; + if (message) + { + out << " " << message; + } + out << std::endl; +} + +// Use the SPIRV-Tools disassembler to print SPIR-V using a SPV_ENV_UNIVERSAL_1_3 environment. +void SpirvToolsDisassemble(std::ostream& out, const std::vector& spirv) +{ + SpirvToolsDisassemble(out, spirv, spv_target_env::SPV_ENV_UNIVERSAL_1_3); +} + +// Use the SPIRV-Tools disassembler to print SPIR-V with a provided SPIR-V environment. +void SpirvToolsDisassemble(std::ostream& out, const std::vector& spirv, + spv_target_env requested_context) +{ + // disassemble + spv_context context = spvContextCreate(requested_context); + spv_text text; + spv_diagnostic diagnostic = nullptr; + spvBinaryToText(context, spirv.data(), spirv.size(), + SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES | SPV_BINARY_TO_TEXT_OPTION_INDENT, + &text, &diagnostic); + + // dump + if (diagnostic == nullptr) + out << text->str; + else + spvDiagnosticPrint(diagnostic); + + // teardown + spvDiagnosticDestroy(diagnostic); + spvContextDestroy(context); +} + +// Apply the SPIRV-Tools validator to generated SPIR-V. +void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector& spirv, + spv::SpvBuildLogger* logger, bool prelegalization) +{ + // validate + spv_context context = spvContextCreate(MapToSpirvToolsEnv(intermediate.getSpv(), logger)); + spv_const_binary_t binary = { spirv.data(), spirv.size() }; + spv_diagnostic diagnostic = nullptr; + spv_validator_options options = spvValidatorOptionsCreate(); + spvValidatorOptionsSetRelaxBlockLayout(options, intermediate.usingHlslOffsets()); + spvValidatorOptionsSetBeforeHlslLegalization(options, prelegalization); + spvValidatorOptionsSetScalarBlockLayout(options, intermediate.usingScalarBlockLayout()); + spvValidatorOptionsSetWorkgroupScalarBlockLayout(options, intermediate.usingScalarBlockLayout()); + spvValidatorOptionsSetAllowOffsetTextureOperand(options, intermediate.usingTextureOffsetNonConst()); + spvValidateWithOptions(context, options, &binary, &diagnostic); + + // report + if (diagnostic != nullptr) { + logger->error("SPIRV-Tools Validation Errors"); + logger->error(diagnostic->error); + } + + // tear down + spvValidatorOptionsDestroy(options); + spvDiagnosticDestroy(diagnostic); + spvContextDestroy(context); +} + +// Apply the SPIRV-Tools optimizer to generated SPIR-V. HLSL SPIR-V is legalized in the process. +void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector& spirv, + spv::SpvBuildLogger* logger, const SpvOptions* options) +{ + spv_target_env target_env = MapToSpirvToolsEnv(intermediate.getSpv(), logger); + + spvtools::Optimizer optimizer(target_env); + optimizer.SetMessageConsumer(OptimizerMesssageConsumer); + + // If debug (specifically source line info) is being generated, propagate + // line information into all SPIR-V instructions. This avoids loss of + // information when instructions are deleted or moved. Later, remove + // redundant information to minimize final SPRIR-V size. + if (options->stripDebugInfo) { + optimizer.RegisterPass(spvtools::CreateStripDebugInfoPass()); + } + optimizer.RegisterPass(spvtools::CreateWrapOpKillPass()); + optimizer.RegisterPass(spvtools::CreateDeadBranchElimPass()); + optimizer.RegisterPass(spvtools::CreateMergeReturnPass()); + optimizer.RegisterPass(spvtools::CreateInlineExhaustivePass()); + optimizer.RegisterPass(spvtools::CreateEliminateDeadFunctionsPass()); + optimizer.RegisterPass(spvtools::CreateScalarReplacementPass()); + optimizer.RegisterPass(spvtools::CreateLocalAccessChainConvertPass()); + optimizer.RegisterPass(spvtools::CreateLocalSingleBlockLoadStoreElimPass()); + optimizer.RegisterPass(spvtools::CreateLocalSingleStoreElimPass()); + optimizer.RegisterPass(spvtools::CreateSimplificationPass()); + optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass()); + optimizer.RegisterPass(spvtools::CreateVectorDCEPass()); + optimizer.RegisterPass(spvtools::CreateDeadInsertElimPass()); + optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass()); + optimizer.RegisterPass(spvtools::CreateDeadBranchElimPass()); + optimizer.RegisterPass(spvtools::CreateBlockMergePass()); + optimizer.RegisterPass(spvtools::CreateLocalMultiStoreElimPass()); + optimizer.RegisterPass(spvtools::CreateIfConversionPass()); + optimizer.RegisterPass(spvtools::CreateSimplificationPass()); + optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass()); + optimizer.RegisterPass(spvtools::CreateVectorDCEPass()); + optimizer.RegisterPass(spvtools::CreateDeadInsertElimPass()); + optimizer.RegisterPass(spvtools::CreateInterpolateFixupPass()); + if (options->optimizeSize) { + optimizer.RegisterPass(spvtools::CreateRedundancyEliminationPass()); + optimizer.RegisterPass(spvtools::CreateEliminateDeadInputComponentsSafePass()); + } + optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass()); + optimizer.RegisterPass(spvtools::CreateCFGCleanupPass()); + + spvtools::OptimizerOptions spvOptOptions; + if (options->optimizerAllowExpandedIDBound) + spvOptOptions.set_max_id_bound(0x3FFFFFFF); + optimizer.SetTargetEnv(MapToSpirvToolsEnv(intermediate.getSpv(), logger)); + spvOptOptions.set_run_validator(false); // The validator may run as a separate step later on + optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions); + + if (options->optimizerAllowExpandedIDBound) { + if (spirv.size() > 3 && spirv[3] > kDefaultMaxIdBound) { + spvtools::Optimizer optimizer2(target_env); + optimizer2.SetMessageConsumer(OptimizerMesssageConsumer); + optimizer2.RegisterPass(spvtools::CreateCompactIdsPass()); + optimizer2.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions); + } + } +} + +bool SpirvToolsAnalyzeDeadOutputStores(spv_target_env target_env, std::vector& spirv, + std::unordered_set* live_locs, + std::unordered_set* live_builtins, + spv::SpvBuildLogger*) +{ + spvtools::Optimizer optimizer(target_env); + optimizer.SetMessageConsumer(OptimizerMesssageConsumer); + + optimizer.RegisterPass(spvtools::CreateAnalyzeLiveInputPass(live_locs, live_builtins)); + + spvtools::OptimizerOptions spvOptOptions; + optimizer.SetTargetEnv(target_env); + spvOptOptions.set_run_validator(false); + return optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions); +} + +void SpirvToolsEliminateDeadOutputStores(spv_target_env target_env, std::vector& spirv, + std::unordered_set* live_locs, + std::unordered_set* live_builtins, + spv::SpvBuildLogger*) +{ + spvtools::Optimizer optimizer(target_env); + optimizer.SetMessageConsumer(OptimizerMesssageConsumer); + + optimizer.RegisterPass(spvtools::CreateEliminateDeadOutputStoresPass(live_locs, live_builtins)); + optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass(false, true)); + optimizer.RegisterPass(spvtools::CreateEliminateDeadOutputComponentsPass()); + optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass(false, true)); + + spvtools::OptimizerOptions spvOptOptions; + optimizer.SetTargetEnv(target_env); + spvOptOptions.set_run_validator(false); + optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions); +} + +void SpirvToolsEliminateDeadInputComponents(spv_target_env target_env, std::vector& spirv, + spv::SpvBuildLogger*) +{ + spvtools::Optimizer optimizer(target_env); + optimizer.SetMessageConsumer(OptimizerMesssageConsumer); + + optimizer.RegisterPass(spvtools::CreateEliminateDeadInputComponentsPass()); + optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass()); + + spvtools::OptimizerOptions spvOptOptions; + optimizer.SetTargetEnv(target_env); + spvOptOptions.set_run_validator(false); + optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions); +} + +// Apply the SPIRV-Tools optimizer to strip debug info from SPIR-V. This is implicitly done by +// SpirvToolsTransform if spvOptions->stripDebugInfo is set, but can be called separately if +// optimization is disabled. +void SpirvToolsStripDebugInfo(const glslang::TIntermediate& intermediate, + std::vector& spirv, spv::SpvBuildLogger* logger) +{ + spv_target_env target_env = MapToSpirvToolsEnv(intermediate.getSpv(), logger); + + spvtools::Optimizer optimizer(target_env); + optimizer.SetMessageConsumer(OptimizerMesssageConsumer); + + optimizer.RegisterPass(spvtools::CreateStripDebugInfoPass()); + + spvtools::OptimizerOptions spvOptOptions; + optimizer.SetTargetEnv(MapToSpirvToolsEnv(intermediate.getSpv(), logger)); + spvOptOptions.set_run_validator(false); // The validator may run as a separate step later on + optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions); +} + +} // end namespace glslang +} // namespace QtShaderTools + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SpvTools.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SpvTools.h new file mode 100644 index 0000000000..6178296187 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/SpvTools.h @@ -0,0 +1,111 @@ +// +// Copyright (C) 2014-2016 LunarG, Inc. +// Copyright (C) 2018 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// +// Call into SPIRV-Tools to disassemble, validate, and optimize. +// + +#pragma once +#ifndef GLSLANG_SPV_TOOLS_H +#define GLSLANG_SPV_TOOLS_H + +#if ENABLE_OPT +#include +#include +#include +#include "spirv-tools/libspirv.h" +#endif + +#include "glslang/MachineIndependent/Versions.h" +#include "glslang/Include/visibility.h" +#include "GlslangToSpv.h" +#include "Logger.h" + +namespace QtShaderTools { +namespace glslang { + +#if ENABLE_OPT + +class TIntermediate; + +// Translate glslang's view of target versioning to what SPIRV-Tools uses. +GLSLANG_EXPORT spv_target_env MapToSpirvToolsEnv(const SpvVersion& spvVersion, spv::SpvBuildLogger* logger); +GLSLANG_EXPORT spv_target_env MapToSpirvToolsEnv(const glslang::TIntermediate& intermediate, spv::SpvBuildLogger* logger); + +// Use the SPIRV-Tools disassembler to print SPIR-V using a SPV_ENV_UNIVERSAL_1_3 environment. +GLSLANG_EXPORT void SpirvToolsDisassemble(std::ostream& out, const std::vector& spirv); + +// Use the SPIRV-Tools disassembler to print SPIR-V with a provided SPIR-V environment. +GLSLANG_EXPORT void SpirvToolsDisassemble(std::ostream& out, const std::vector& spirv, + spv_target_env requested_context); + +// Apply the SPIRV-Tools validator to generated SPIR-V. +GLSLANG_EXPORT void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector& spirv, + spv::SpvBuildLogger*, bool prelegalization); + +// Apply the SPIRV-Tools optimizer to generated SPIR-V. HLSL SPIR-V is legalized in the process. +GLSLANG_EXPORT void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector& spirv, + spv::SpvBuildLogger*, const SpvOptions*); + +// Apply the SPIRV-Tools EliminateDeadInputComponents pass to generated SPIR-V. Put result in |spirv|. +GLSLANG_EXPORT void SpirvToolsEliminateDeadInputComponents(spv_target_env target_env, std::vector& spirv, + spv::SpvBuildLogger*); + +// Apply the SPIRV-Tools AnalyzeDeadOutputStores pass to generated SPIR-V. Put result in |live_locs|. +// Return true if the result is valid. +GLSLANG_EXPORT bool SpirvToolsAnalyzeDeadOutputStores(spv_target_env target_env, std::vector& spirv, + std::unordered_set* live_locs, + std::unordered_set* live_builtins, + spv::SpvBuildLogger*); + +// Apply the SPIRV-Tools EliminateDeadOutputStores and AggressiveDeadCodeElimination passes to generated SPIR-V using +// |live_locs|. Put result in |spirv|. +GLSLANG_EXPORT void SpirvToolsEliminateDeadOutputStores(spv_target_env target_env, std::vector& spirv, + std::unordered_set* live_locs, + std::unordered_set* live_builtins, + spv::SpvBuildLogger*); + +// Apply the SPIRV-Tools optimizer to strip debug info from SPIR-V. This is implicitly done by +// SpirvToolsTransform if spvOptions->stripDebugInfo is set, but can be called separately if +// optimization is disabled. +GLSLANG_EXPORT void SpirvToolsStripDebugInfo(const glslang::TIntermediate& intermediate, + std::vector& spirv, spv::SpvBuildLogger*); + +#endif + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // GLSLANG_SPV_TOOLS_H diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/bitutils.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/bitutils.h new file mode 100644 index 0000000000..22e44cec26 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/bitutils.h @@ -0,0 +1,81 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_UTIL_BITUTILS_H_ +#define LIBSPIRV_UTIL_BITUTILS_H_ + +#include +#include + +namespace spvutils { + +// Performs a bitwise copy of source to the destination type Dest. +template +Dest BitwiseCast(Src source) { + Dest dest; + static_assert(sizeof(source) == sizeof(dest), + "BitwiseCast: Source and destination must have the same size"); + std::memcpy(static_cast(&dest), &source, sizeof(dest)); + return dest; +} + +// SetBits returns an integer of type with bits set +// for position through , counting from the least +// significant bit. In particular when Num == 0, no positions are set to 1. +// A static assert will be triggered if First + Num > sizeof(T) * 8, that is, +// a bit that will not fit in the underlying type is set. +template +struct SetBits { + static_assert(First < sizeof(T) * 8, + "Tried to set a bit that is shifted too far."); + const static T get = (T(1) << First) | SetBits::get; +}; + +template +struct SetBits { + const static T get = T(0); +}; + +// This is all compile-time so we can put our tests right here. +static_assert(SetBits::get == uint32_t(0x00000000), + "SetBits failed"); +static_assert(SetBits::get == uint32_t(0x00000001), + "SetBits failed"); +static_assert(SetBits::get == uint32_t(0x80000000), + "SetBits failed"); +static_assert(SetBits::get == uint32_t(0x00000006), + "SetBits failed"); +static_assert(SetBits::get == uint32_t(0xc0000000), + "SetBits failed"); +static_assert(SetBits::get == uint32_t(0x7FFFFFFF), + "SetBits failed"); +static_assert(SetBits::get == uint32_t(0xFFFFFFFF), + "SetBits failed"); +static_assert(SetBits::get == uint32_t(0xFFFF0000), + "SetBits failed"); + +static_assert(SetBits::get == uint64_t(0x0000000000000001LL), + "SetBits failed"); +static_assert(SetBits::get == uint64_t(0x8000000000000000LL), + "SetBits failed"); +static_assert(SetBits::get == uint64_t(0xc000000000000000LL), + "SetBits failed"); +static_assert(SetBits::get == uint64_t(0x0000000080000000LL), + "SetBits failed"); +static_assert(SetBits::get == uint64_t(0x00000000FFFF0000LL), + "SetBits failed"); + +} // namespace spvutils + +#endif // LIBSPIRV_UTIL_BITUTILS_H_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/disassemble.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/disassemble.cpp new file mode 100644 index 0000000000..9b85ff28e0 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/disassemble.cpp @@ -0,0 +1,888 @@ +// +// Copyright (C) 2014-2015 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// +// Disassembler for SPIR-V. +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "disassemble.h" +#include "doc.h" +#include "spvUtil.h" + +namespace spv { + extern "C" { + // Include C-based headers that don't have a namespace + #include "GLSL.std.450.h" + #include "GLSL.ext.AMD.h" + #include "GLSL.ext.NV.h" + #include "GLSL.ext.ARM.h" + #include "NonSemanticShaderDebugInfo100.h" + #include "GLSL.ext.QCOM.h" + } +} +static const char* GlslStd450DebugNames[spv::GLSLstd450Count]; + +namespace spv { + +static const char* GLSLextAMDGetDebugNames(const char*, unsigned); +static const char* GLSLextNVGetDebugNames(const char*, unsigned); +static const char* NonSemanticShaderDebugInfo100GetDebugNames(unsigned); + +static void Kill(std::ostream& out, const char* message) +{ + out << std::endl << "Disassembly failed: " << message << std::endl; + exit(1); +} + +// used to identify the extended instruction library imported when printing +enum ExtInstSet { + GLSL450Inst, + GLSLextAMDInst, + GLSLextNVInst, + OpenCLExtInst, + NonSemanticDebugPrintfExtInst, + NonSemanticDebugBreakExtInst, + NonSemanticShaderDebugInfo100 +}; + +// Container class for a single instance of a SPIR-V stream, with methods for disassembly. +class SpirvStream { +public: + SpirvStream(std::ostream& out, const std::vector& stream) : out(out), stream(stream), word(0), nextNestedControl(0) { } + virtual ~SpirvStream() { } + + void validate(); + void processInstructions(); + +protected: + SpirvStream(const SpirvStream&); + SpirvStream& operator=(const SpirvStream&); + Op getOpCode(int id) const { return idInstruction[id] ? (Op)(stream[idInstruction[id]] & OpCodeMask) : Op::OpNop; } + + // Output methods + void outputIndent(); + void formatId(Id id, std::stringstream&); + void outputResultId(Id id); + void outputTypeId(Id id); + void outputId(Id id); + void outputMask(OperandClass operandClass, unsigned mask); + void disassembleImmediates(int numOperands); + void disassembleIds(int numOperands); + std::pair decodeString(); + int disassembleString(); + void disassembleInstruction(Id resultId, Id typeId, Op opCode, int numOperands); + + // Data + std::ostream& out; // where to write the disassembly + const std::vector& stream; // the actual word stream + int size; // the size of the word stream + int word; // the next word of the stream to read + + // map each to the instruction that created it + Id bound; + std::vector idInstruction; // the word offset into the stream where the instruction for result [id] starts; 0 if not yet seen (forward reference or function parameter) + + std::vector idDescriptor; // the best text string known for explaining the + + // schema + unsigned int schema; + + // stack of structured-merge points + std::stack nestedControl; + Id nextNestedControl; // need a slight delay for when we are nested +}; + +void SpirvStream::validate() +{ + size = (int)stream.size(); + if (size < 4) + Kill(out, "stream is too short"); + + // Magic number + if (stream[word++] != MagicNumber) { + out << "Bad magic number"; + return; + } + + // Version + out << "// Module Version " << std::hex << stream[word++] << std::endl; + + // Generator's magic number + out << "// Generated by (magic number): " << std::hex << stream[word++] << std::dec << std::endl; + + // Result bound + bound = stream[word++]; + idInstruction.resize(bound); + idDescriptor.resize(bound); + out << "// Id's are bound by " << bound << std::endl; + out << std::endl; + + // Reserved schema, must be 0 for now + schema = stream[word++]; + if (schema != 0) + Kill(out, "bad schema, must be 0"); +} + +// Loop over all the instructions, in order, processing each. +// Boiler plate for each is handled here directly, the rest is dispatched. +void SpirvStream::processInstructions() +{ + // Instructions + while (word < size) { + int instructionStart = word; + + // Instruction wordCount and opcode + unsigned int firstWord = stream[word]; + unsigned wordCount = firstWord >> WordCountShift; + Op opCode = (Op)(firstWord & OpCodeMask); + int nextInst = word + wordCount; + ++word; + + // Presence of full instruction + if (nextInst > size) + Kill(out, "stream instruction terminated too early"); + + // Base for computing number of operands; will be updated as more is learned + unsigned numOperands = wordCount - 1; + + // Type + Id typeId = 0; + if (InstructionDesc[enumCast(opCode)].hasType()) { + typeId = stream[word++]; + --numOperands; + } + + // Result + Id resultId = 0; + if (InstructionDesc[enumCast(opCode)].hasResult()) { + resultId = stream[word++]; + --numOperands; + + // save instruction for future reference + idInstruction[resultId] = instructionStart; + } + + outputResultId(resultId); + outputTypeId(typeId); + outputIndent(); + + // Hand off the Op and all its operands + disassembleInstruction(resultId, typeId, opCode, numOperands); + if (word != nextInst) { + out << " ERROR, incorrect number of operands consumed. At " << word << " instead of " << nextInst << " instruction start was " << instructionStart; + word = nextInst; + } + out << std::endl; + } +} + +void SpirvStream::outputIndent() +{ + for (int i = 0; i < (int)nestedControl.size(); ++i) + out << " "; +} + +void SpirvStream::formatId(Id id, std::stringstream& idStream) +{ + if (id != 0) { + // On instructions with no IDs, this is called with "0", which does not + // have to be within ID bounds on null shaders. + if (id >= bound) + Kill(out, "Bad "); + + idStream << id; + if (idDescriptor[id].size() > 0) + idStream << "(" << idDescriptor[id] << ")"; + } +} + +void SpirvStream::outputResultId(Id id) +{ + const int width = 16; + std::stringstream idStream; + formatId(id, idStream); + out << std::setw(width) << std::right << idStream.str(); + if (id != 0) + out << ":"; + else + out << " "; + + if (nestedControl.size() && id == nestedControl.top()) + nestedControl.pop(); +} + +void SpirvStream::outputTypeId(Id id) +{ + const int width = 12; + std::stringstream idStream; + formatId(id, idStream); + out << std::setw(width) << std::right << idStream.str() << " "; +} + +void SpirvStream::outputId(Id id) +{ + if (id >= bound) + Kill(out, "Bad "); + + out << id; + if (idDescriptor[id].size() > 0) + out << "(" << idDescriptor[id] << ")"; +} + +void SpirvStream::outputMask(OperandClass operandClass, unsigned mask) +{ + if (mask == 0) + out << "None"; + else { + for (int m = 0; m < OperandClassParams[operandClass].ceiling; ++m) { + if (mask & (1 << m)) + out << OperandClassParams[operandClass].getName(m) << " "; + } + } +} + +void SpirvStream::disassembleImmediates(int numOperands) +{ + for (int i = 0; i < numOperands; ++i) { + out << stream[word++]; + if (i < numOperands - 1) + out << " "; + } +} + +void SpirvStream::disassembleIds(int numOperands) +{ + for (int i = 0; i < numOperands; ++i) { + outputId(stream[word++]); + if (i < numOperands - 1) + out << " "; + } +} + +// decode string from words at current position (non-consuming) +std::pair SpirvStream::decodeString() +{ + std::string res; + int wordPos = word; + char c; + bool done = false; + + do { + unsigned int content = stream[wordPos]; + for (int charCount = 0; charCount < 4; ++charCount) { + c = content & 0xff; + content >>= 8; + if (c == '\0') { + done = true; + break; + } + res += c; + } + ++wordPos; + } while(! done); + + return std::make_pair(wordPos - word, res); +} + +// return the number of operands consumed by the string +int SpirvStream::disassembleString() +{ + out << " \""; + + std::pair decoderes = decodeString(); + + out << decoderes.second; + out << "\""; + + word += decoderes.first; + + return decoderes.first; +} + +static uint32_t popcount(uint32_t mask) +{ + uint32_t count = 0; + while (mask) { + if (mask & 1) { + count++; + } + mask >>= 1; + } + return count; +} + +void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, int numOperands) +{ + // Process the opcode + + out << (OpcodeString((int)opCode) + 2); // leave out the "Op" + + if (opCode == Op::OpLoopMerge || opCode == Op::OpSelectionMerge) + nextNestedControl = stream[word]; + else if (opCode == Op::OpBranchConditional || opCode == Op::OpSwitch) { + if (nextNestedControl) { + nestedControl.push(nextNestedControl); + nextNestedControl = 0; + } + } else if (opCode == Op::OpExtInstImport) { + idDescriptor[resultId] = decodeString().second; + } + else { + if (resultId != 0 && idDescriptor[resultId].size() == 0) { + switch (opCode) { + case Op::OpTypeInt: + switch (stream[word]) { + case 8: idDescriptor[resultId] = "int8_t"; break; + case 16: idDescriptor[resultId] = "int16_t"; break; + default: assert(0); [[fallthrough]]; + case 32: idDescriptor[resultId] = "int"; break; + case 64: idDescriptor[resultId] = "int64_t"; break; + } + break; + case Op::OpTypeFloat: + switch (stream[word]) { + case 8: + case 16: + if (numOperands > 1) { + switch (stream[word+1]) { + default: + assert(0); [[fallthrough]]; + case (int)spv::FPEncoding::BFloat16KHR: + idDescriptor[resultId] = "bfloat16_t"; + break; + case (int)spv::FPEncoding::Float8E4M3EXT: + idDescriptor[resultId] = "floate4m3_t"; + break; + case (int)spv::FPEncoding::Float8E5M2EXT: + idDescriptor[resultId] = "floate5m2_t"; + break; + } + } else { + idDescriptor[resultId] = "float16_t"; + } + break; + default: assert(0); [[fallthrough]]; + case 32: idDescriptor[resultId] = "float"; break; + case 64: idDescriptor[resultId] = "float64_t"; break; + } + break; + case Op::OpTypeBool: + idDescriptor[resultId] = "bool"; + break; + case Op::OpTypeStruct: + idDescriptor[resultId] = "struct"; + break; + case Op::OpTypePointer: + idDescriptor[resultId] = "ptr"; + break; + case Op::OpTypeVector: + if (idDescriptor[stream[word]].size() > 0) { + if (idDescriptor[stream[word]].substr(0,2) == "bf") { + idDescriptor[resultId].append(idDescriptor[stream[word]].begin(), idDescriptor[stream[word]].begin() + 2); + } else { + idDescriptor[resultId].append(idDescriptor[stream[word]].begin(), idDescriptor[stream[word]].begin() + 1); + } + if (strstr(idDescriptor[stream[word]].c_str(), "8")) { + idDescriptor[resultId].append("8"); + } + if (strstr(idDescriptor[stream[word]].c_str(), "16")) { + idDescriptor[resultId].append("16"); + } + if (strstr(idDescriptor[stream[word]].c_str(), "64")) { + idDescriptor[resultId].append("64"); + } + } + idDescriptor[resultId].append("vec"); + switch (stream[word + 1]) { + case 2: idDescriptor[resultId].append("2"); break; + case 3: idDescriptor[resultId].append("3"); break; + case 4: idDescriptor[resultId].append("4"); break; + case 8: idDescriptor[resultId].append("8"); break; + case 16: idDescriptor[resultId].append("16"); break; + case 32: idDescriptor[resultId].append("32"); break; + default: break; + } + break; + default: + break; + } + } + } + + // Process the operands. Note, a new context-dependent set could be + // swapped in mid-traversal. + + // Handle images specially, so can put out helpful strings. + if (opCode == Op::OpTypeImage) { + out << " "; + disassembleIds(1); + out << " " << DimensionString((int)(Dim)stream[word++]); + out << (stream[word++] != 0 ? " depth" : ""); + out << (stream[word++] != 0 ? " array" : ""); + out << (stream[word++] != 0 ? " multi-sampled" : ""); + switch (stream[word++]) { + case 0: out << " runtime"; break; + case 1: out << " sampled"; break; + case 2: out << " nonsampled"; break; + } + out << " format:" << ImageFormatString((int)(ImageFormat)stream[word++]); + + if (numOperands == 8) { + out << " " << AccessQualifierString(stream[word++]); + } + return; + } + + // Handle all the parameterized operands + for (int op = 0; op < InstructionDesc[enumCast(opCode)].operands.getNum() && numOperands > 0; ++op) { + out << " "; + OperandClass operandClass = InstructionDesc[enumCast(opCode)].operands.getClass(op); + switch (operandClass) { + case OperandId: + case OperandScope: + case OperandMemorySemantics: + disassembleIds(1); + --numOperands; + // Get names for printing "(XXX)" for readability, *after* this id + if (opCode == Op::OpName) + idDescriptor[stream[word - 1]] = decodeString().second; + break; + case OperandVariableIds: + disassembleIds(numOperands); + return; + case OperandImageOperands: + outputMask(OperandImageOperands, stream[word++]); + --numOperands; + disassembleIds(numOperands); + return; + case OperandOptionalLiteral: + case OperandVariableLiterals: + if ((opCode == Op::OpDecorate && stream[word - 1] == Decoration::BuiltIn) || + (opCode == Op::OpMemberDecorate && stream[word - 1] == Decoration::BuiltIn)) { + out << BuiltInString(stream[word++]); + --numOperands; + ++op; + } + disassembleImmediates(numOperands); + return; + case OperandVariableIdLiteral: + while (numOperands > 0) { + out << std::endl; + outputResultId(0); + outputTypeId(0); + outputIndent(); + out << " Type "; + disassembleIds(1); + out << ", member "; + disassembleImmediates(1); + numOperands -= 2; + } + return; + case OperandVariableLiteralId: + while (numOperands > 0) { + out << std::endl; + outputResultId(0); + outputTypeId(0); + outputIndent(); + out << " case "; + disassembleImmediates(1); + out << ": "; + disassembleIds(1); + numOperands -= 2; + } + return; + case OperandLiteralNumber: + disassembleImmediates(1); + --numOperands; + if (opCode == Op::OpExtInst) { + ExtInstSet extInstSet = GLSL450Inst; + const char* name = idDescriptor[stream[word - 2]].c_str(); + if (strcmp("OpenCL.std", name) == 0) { + extInstSet = OpenCLExtInst; + } else if (strcmp("OpenCL.DebugInfo.100", name) == 0) { + extInstSet = OpenCLExtInst; + } else if (strcmp("NonSemantic.DebugPrintf", name) == 0) { + extInstSet = NonSemanticDebugPrintfExtInst; + } else if (strcmp("NonSemantic.DebugBreak", name) == 0) { + extInstSet = NonSemanticDebugBreakExtInst; + } else if (strcmp("NonSemantic.Shader.DebugInfo.100", name) == 0) { + extInstSet = NonSemanticShaderDebugInfo100; + } else if (strcmp(spv::E_SPV_AMD_shader_ballot, name) == 0 || + strcmp(spv::E_SPV_AMD_shader_trinary_minmax, name) == 0 || + strcmp(spv::E_SPV_AMD_shader_explicit_vertex_parameter, name) == 0 || + strcmp(spv::E_SPV_AMD_gcn_shader, name) == 0) { + extInstSet = GLSLextAMDInst; + } else if (strcmp(spv::E_SPV_NV_sample_mask_override_coverage, name) == 0 || + strcmp(spv::E_SPV_NV_geometry_shader_passthrough, name) == 0 || + strcmp(spv::E_SPV_NV_viewport_array2, name) == 0 || + strcmp(spv::E_SPV_NVX_multiview_per_view_attributes, name) == 0 || + strcmp(spv::E_SPV_NV_fragment_shader_barycentric, name) == 0 || + strcmp(spv::E_SPV_NV_mesh_shader, name) == 0) { + extInstSet = GLSLextNVInst; + } + unsigned entrypoint = stream[word - 1]; + if (extInstSet == GLSL450Inst) { + if (entrypoint < GLSLstd450Count) { + out << "(" << GlslStd450DebugNames[entrypoint] << ")"; + } + } else if (extInstSet == GLSLextAMDInst) { + out << "(" << GLSLextAMDGetDebugNames(name, entrypoint) << ")"; + } + else if (extInstSet == GLSLextNVInst) { + out << "(" << GLSLextNVGetDebugNames(name, entrypoint) << ")"; + } else if (extInstSet == NonSemanticDebugPrintfExtInst) { + out << "(DebugPrintf)"; + } else if (extInstSet == NonSemanticDebugBreakExtInst) { + out << "(DebugBreak)"; + } else if (extInstSet == NonSemanticShaderDebugInfo100) { + out << "(" << NonSemanticShaderDebugInfo100GetDebugNames(entrypoint) << ")"; + } + } + break; + case OperandOptionalLiteralString: + case OperandLiteralString: + numOperands -= disassembleString(); + break; + case OperandVariableLiteralStrings: + while (numOperands > 0) + numOperands -= disassembleString(); + return; + case OperandMemoryAccess: + { + outputMask(OperandMemoryAccess, stream[word++]); + --numOperands; + // Put a space after "None" if there are any remaining operands + if (numOperands && stream[word-1] == 0) { + out << " "; + } + uint32_t mask = stream[word-1]; + // Aligned is the only memory access operand that uses an immediate + // value, and it is also the first operand that uses a value at all. + if (mask & (uint32_t)MemoryAccessMask::Aligned) { + disassembleImmediates(1); + numOperands--; + if (numOperands) + out << " "; + } + + uint32_t bitCount = popcount(mask & (uint32_t)(MemoryAccessMask::MakePointerAvailable | MemoryAccessMask::MakePointerVisible)); + disassembleIds(bitCount); + numOperands -= bitCount; + } + break; + case OperandTensorAddressingOperands: + { + outputMask(OperandTensorAddressingOperands, stream[word++]); + --numOperands; + // Put a space after "None" if there are any remaining operands + if (numOperands && stream[word-1] == 0) { + out << " "; + } + uint32_t bitCount = popcount(stream[word-1]); + disassembleIds(bitCount); + numOperands -= bitCount; + } + break; + default: + assert(operandClass >= OperandSource && operandClass < OperandOpcode); + + if (OperandClassParams[operandClass].bitmask) + outputMask(operandClass, stream[word++]); + else + out << OperandClassParams[operandClass].getName(stream[word++]); + --numOperands; + + break; + } + } + + return; +} + +static void GLSLstd450GetDebugNames(const char** names) +{ + for (int i = 0; i < GLSLstd450Count; ++i) + names[i] = "Unknown"; + + names[GLSLstd450Round] = "Round"; + names[GLSLstd450RoundEven] = "RoundEven"; + names[GLSLstd450Trunc] = "Trunc"; + names[GLSLstd450FAbs] = "FAbs"; + names[GLSLstd450SAbs] = "SAbs"; + names[GLSLstd450FSign] = "FSign"; + names[GLSLstd450SSign] = "SSign"; + names[GLSLstd450Floor] = "Floor"; + names[GLSLstd450Ceil] = "Ceil"; + names[GLSLstd450Fract] = "Fract"; + names[GLSLstd450Radians] = "Radians"; + names[GLSLstd450Degrees] = "Degrees"; + names[GLSLstd450Sin] = "Sin"; + names[GLSLstd450Cos] = "Cos"; + names[GLSLstd450Tan] = "Tan"; + names[GLSLstd450Asin] = "Asin"; + names[GLSLstd450Acos] = "Acos"; + names[GLSLstd450Atan] = "Atan"; + names[GLSLstd450Sinh] = "Sinh"; + names[GLSLstd450Cosh] = "Cosh"; + names[GLSLstd450Tanh] = "Tanh"; + names[GLSLstd450Asinh] = "Asinh"; + names[GLSLstd450Acosh] = "Acosh"; + names[GLSLstd450Atanh] = "Atanh"; + names[GLSLstd450Atan2] = "Atan2"; + names[GLSLstd450Pow] = "Pow"; + names[GLSLstd450Exp] = "Exp"; + names[GLSLstd450Log] = "Log"; + names[GLSLstd450Exp2] = "Exp2"; + names[GLSLstd450Log2] = "Log2"; + names[GLSLstd450Sqrt] = "Sqrt"; + names[GLSLstd450InverseSqrt] = "InverseSqrt"; + names[GLSLstd450Determinant] = "Determinant"; + names[GLSLstd450MatrixInverse] = "MatrixInverse"; + names[GLSLstd450Modf] = "Modf"; + names[GLSLstd450ModfStruct] = "ModfStruct"; + names[GLSLstd450FMin] = "FMin"; + names[GLSLstd450SMin] = "SMin"; + names[GLSLstd450UMin] = "UMin"; + names[GLSLstd450FMax] = "FMax"; + names[GLSLstd450SMax] = "SMax"; + names[GLSLstd450UMax] = "UMax"; + names[GLSLstd450FClamp] = "FClamp"; + names[GLSLstd450SClamp] = "SClamp"; + names[GLSLstd450UClamp] = "UClamp"; + names[GLSLstd450FMix] = "FMix"; + names[GLSLstd450Step] = "Step"; + names[GLSLstd450SmoothStep] = "SmoothStep"; + names[GLSLstd450Fma] = "Fma"; + names[GLSLstd450Frexp] = "Frexp"; + names[GLSLstd450FrexpStruct] = "FrexpStruct"; + names[GLSLstd450Ldexp] = "Ldexp"; + names[GLSLstd450PackSnorm4x8] = "PackSnorm4x8"; + names[GLSLstd450PackUnorm4x8] = "PackUnorm4x8"; + names[GLSLstd450PackSnorm2x16] = "PackSnorm2x16"; + names[GLSLstd450PackUnorm2x16] = "PackUnorm2x16"; + names[GLSLstd450PackHalf2x16] = "PackHalf2x16"; + names[GLSLstd450PackDouble2x32] = "PackDouble2x32"; + names[GLSLstd450UnpackSnorm2x16] = "UnpackSnorm2x16"; + names[GLSLstd450UnpackUnorm2x16] = "UnpackUnorm2x16"; + names[GLSLstd450UnpackHalf2x16] = "UnpackHalf2x16"; + names[GLSLstd450UnpackSnorm4x8] = "UnpackSnorm4x8"; + names[GLSLstd450UnpackUnorm4x8] = "UnpackUnorm4x8"; + names[GLSLstd450UnpackDouble2x32] = "UnpackDouble2x32"; + names[GLSLstd450Length] = "Length"; + names[GLSLstd450Distance] = "Distance"; + names[GLSLstd450Cross] = "Cross"; + names[GLSLstd450Normalize] = "Normalize"; + names[GLSLstd450FaceForward] = "FaceForward"; + names[GLSLstd450Reflect] = "Reflect"; + names[GLSLstd450Refract] = "Refract"; + names[GLSLstd450FindILsb] = "FindILsb"; + names[GLSLstd450FindSMsb] = "FindSMsb"; + names[GLSLstd450FindUMsb] = "FindUMsb"; + names[GLSLstd450InterpolateAtCentroid] = "InterpolateAtCentroid"; + names[GLSLstd450InterpolateAtSample] = "InterpolateAtSample"; + names[GLSLstd450InterpolateAtOffset] = "InterpolateAtOffset"; + names[GLSLstd450NMin] = "NMin"; + names[GLSLstd450NMax] = "NMax"; + names[GLSLstd450NClamp] = "NClamp"; +} + +static const char* GLSLextAMDGetDebugNames(const char* name, unsigned entrypoint) +{ + if (strcmp(name, spv::E_SPV_AMD_shader_ballot) == 0) { + switch (entrypoint) { + case SwizzleInvocationsAMD: return "SwizzleInvocationsAMD"; + case SwizzleInvocationsMaskedAMD: return "SwizzleInvocationsMaskedAMD"; + case WriteInvocationAMD: return "WriteInvocationAMD"; + case MbcntAMD: return "MbcntAMD"; + default: return "Bad"; + } + } else if (strcmp(name, spv::E_SPV_AMD_shader_trinary_minmax) == 0) { + switch (entrypoint) { + case FMin3AMD: return "FMin3AMD"; + case UMin3AMD: return "UMin3AMD"; + case SMin3AMD: return "SMin3AMD"; + case FMax3AMD: return "FMax3AMD"; + case UMax3AMD: return "UMax3AMD"; + case SMax3AMD: return "SMax3AMD"; + case FMid3AMD: return "FMid3AMD"; + case UMid3AMD: return "UMid3AMD"; + case SMid3AMD: return "SMid3AMD"; + default: return "Bad"; + } + } else if (strcmp(name, spv::E_SPV_AMD_shader_explicit_vertex_parameter) == 0) { + switch (entrypoint) { + case InterpolateAtVertexAMD: return "InterpolateAtVertexAMD"; + default: return "Bad"; + } + } + else if (strcmp(name, spv::E_SPV_AMD_gcn_shader) == 0) { + switch (entrypoint) { + case CubeFaceIndexAMD: return "CubeFaceIndexAMD"; + case CubeFaceCoordAMD: return "CubeFaceCoordAMD"; + case TimeAMD: return "TimeAMD"; + default: + break; + } + } + + return "Bad"; +} + +static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint) +{ + if (strcmp(name, spv::E_SPV_NV_sample_mask_override_coverage) == 0 || + strcmp(name, spv::E_SPV_NV_geometry_shader_passthrough) == 0 || + strcmp(name, spv::E_ARB_shader_viewport_layer_array) == 0 || + strcmp(name, spv::E_SPV_NV_viewport_array2) == 0 || + strcmp(name, spv::E_SPV_NVX_multiview_per_view_attributes) == 0 || + strcmp(name, spv::E_SPV_NV_fragment_shader_barycentric) == 0 || + strcmp(name, spv::E_SPV_NV_mesh_shader) == 0 || + strcmp(name, spv::E_SPV_NV_shader_image_footprint) == 0) { + switch (entrypoint) { + // NV builtins + case (unsigned)BuiltIn::ViewportMaskNV: return "ViewportMaskNV"; + case (unsigned)BuiltIn::SecondaryPositionNV: return "SecondaryPositionNV"; + case (unsigned)BuiltIn::SecondaryViewportMaskNV: return "SecondaryViewportMaskNV"; + case (unsigned)BuiltIn::PositionPerViewNV: return "PositionPerViewNV"; + case (unsigned)BuiltIn::ViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; + case (unsigned)BuiltIn::BaryCoordNV: return "BaryCoordNV"; + case (unsigned)BuiltIn::BaryCoordNoPerspNV: return "BaryCoordNoPerspNV"; + case (unsigned)BuiltIn::TaskCountNV: return "TaskCountNV"; + case (unsigned)BuiltIn::PrimitiveCountNV: return "PrimitiveCountNV"; + case (unsigned)BuiltIn::PrimitiveIndicesNV: return "PrimitiveIndicesNV"; + case (unsigned)BuiltIn::ClipDistancePerViewNV: return "ClipDistancePerViewNV"; + case (unsigned)BuiltIn::CullDistancePerViewNV: return "CullDistancePerViewNV"; + case (unsigned)BuiltIn::LayerPerViewNV: return "LayerPerViewNV"; + case (unsigned)BuiltIn::MeshViewCountNV: return "MeshViewCountNV"; + case (unsigned)BuiltIn::MeshViewIndicesNV: return "MeshViewIndicesNV"; + + // NV Capabilities + case (unsigned)Capability::GeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV"; + case (unsigned)Capability::ShaderViewportMaskNV: return "ShaderViewportMaskNV"; + case (unsigned)Capability::ShaderStereoViewNV: return "ShaderStereoViewNV"; + case (unsigned)Capability::PerViewAttributesNV: return "PerViewAttributesNV"; + case (unsigned)Capability::FragmentBarycentricNV: return "FragmentBarycentricNV"; + case (unsigned)Capability::MeshShadingNV: return "MeshShadingNV"; + case (unsigned)Capability::ImageFootprintNV: return "ImageFootprintNV"; + case (unsigned)Capability::SampleMaskOverrideCoverageNV:return "SampleMaskOverrideCoverageNV"; + + // NV Decorations + case (unsigned)Decoration::OverrideCoverageNV: return "OverrideCoverageNV"; + case (unsigned)Decoration::PassthroughNV: return "PassthroughNV"; + case (unsigned)Decoration::ViewportRelativeNV: return "ViewportRelativeNV"; + case (unsigned)Decoration::SecondaryViewportRelativeNV: return "SecondaryViewportRelativeNV"; + case (unsigned)Decoration::PerVertexNV: return "PerVertexNV"; + case (unsigned)Decoration::PerPrimitiveNV: return "PerPrimitiveNV"; + case (unsigned)Decoration::PerViewNV: return "PerViewNV"; + case (unsigned)Decoration::PerTaskNV: return "PerTaskNV"; + + default: return "Bad"; + } + } + return "Bad"; +} + +static const char* NonSemanticShaderDebugInfo100GetDebugNames(unsigned entrypoint) +{ + switch (entrypoint) { + case NonSemanticShaderDebugInfo100DebugInfoNone: return "DebugInfoNone"; + case NonSemanticShaderDebugInfo100DebugCompilationUnit: return "DebugCompilationUnit"; + case NonSemanticShaderDebugInfo100DebugTypeBasic: return "DebugTypeBasic"; + case NonSemanticShaderDebugInfo100DebugTypePointer: return "DebugTypePointer"; + case NonSemanticShaderDebugInfo100DebugTypeQualifier: return "DebugTypeQualifier"; + case NonSemanticShaderDebugInfo100DebugTypeArray: return "DebugTypeArray"; + case NonSemanticShaderDebugInfo100DebugTypeVector: return "DebugTypeVector"; + case NonSemanticShaderDebugInfo100DebugTypedef: return "DebugTypedef"; + case NonSemanticShaderDebugInfo100DebugTypeFunction: return "DebugTypeFunction"; + case NonSemanticShaderDebugInfo100DebugTypeEnum: return "DebugTypeEnum"; + case NonSemanticShaderDebugInfo100DebugTypeComposite: return "DebugTypeComposite"; + case NonSemanticShaderDebugInfo100DebugTypeMember: return "DebugTypeMember"; + case NonSemanticShaderDebugInfo100DebugTypeInheritance: return "DebugTypeInheritance"; + case NonSemanticShaderDebugInfo100DebugTypePtrToMember: return "DebugTypePtrToMember"; + case NonSemanticShaderDebugInfo100DebugTypeTemplate: return "DebugTypeTemplate"; + case NonSemanticShaderDebugInfo100DebugTypeTemplateParameter: return "DebugTypeTemplateParameter"; + case NonSemanticShaderDebugInfo100DebugTypeTemplateTemplateParameter: return "DebugTypeTemplateTemplateParameter"; + case NonSemanticShaderDebugInfo100DebugTypeTemplateParameterPack: return "DebugTypeTemplateParameterPack"; + case NonSemanticShaderDebugInfo100DebugGlobalVariable: return "DebugGlobalVariable"; + case NonSemanticShaderDebugInfo100DebugFunctionDeclaration: return "DebugFunctionDeclaration"; + case NonSemanticShaderDebugInfo100DebugFunction: return "DebugFunction"; + case NonSemanticShaderDebugInfo100DebugLexicalBlock: return "DebugLexicalBlock"; + case NonSemanticShaderDebugInfo100DebugLexicalBlockDiscriminator: return "DebugLexicalBlockDiscriminator"; + case NonSemanticShaderDebugInfo100DebugScope: return "DebugScope"; + case NonSemanticShaderDebugInfo100DebugNoScope: return "DebugNoScope"; + case NonSemanticShaderDebugInfo100DebugInlinedAt: return "DebugInlinedAt"; + case NonSemanticShaderDebugInfo100DebugLocalVariable: return "DebugLocalVariable"; + case NonSemanticShaderDebugInfo100DebugInlinedVariable: return "DebugInlinedVariable"; + case NonSemanticShaderDebugInfo100DebugDeclare: return "DebugDeclare"; + case NonSemanticShaderDebugInfo100DebugValue: return "DebugValue"; + case NonSemanticShaderDebugInfo100DebugOperation: return "DebugOperation"; + case NonSemanticShaderDebugInfo100DebugExpression: return "DebugExpression"; + case NonSemanticShaderDebugInfo100DebugMacroDef: return "DebugMacroDef"; + case NonSemanticShaderDebugInfo100DebugMacroUndef: return "DebugMacroUndef"; + case NonSemanticShaderDebugInfo100DebugImportedEntity: return "DebugImportedEntity"; + case NonSemanticShaderDebugInfo100DebugSource: return "DebugSource"; + case NonSemanticShaderDebugInfo100DebugFunctionDefinition: return "DebugFunctionDefinition"; + case NonSemanticShaderDebugInfo100DebugSourceContinued: return "DebugSourceContinued"; + case NonSemanticShaderDebugInfo100DebugLine: return "DebugLine"; + case NonSemanticShaderDebugInfo100DebugNoLine: return "DebugNoLine"; + case NonSemanticShaderDebugInfo100DebugBuildIdentifier: return "DebugBuildIdentifier"; + case NonSemanticShaderDebugInfo100DebugStoragePath: return "DebugStoragePath"; + case NonSemanticShaderDebugInfo100DebugEntryPoint: return "DebugEntryPoint"; + case NonSemanticShaderDebugInfo100DebugTypeMatrix: return "DebugTypeMatrix"; + default: return "Bad"; + } + + return "Bad"; +} + +void Disassemble(std::ostream& out, const std::vector& stream) +{ + SpirvStream SpirvStream(out, stream); + spv::Parameterize(); + GLSLstd450GetDebugNames(GlslStd450DebugNames); + SpirvStream.validate(); + SpirvStream.processInstructions(); +} + +} // end namespace spv diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/disassemble.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/disassemble.h new file mode 100644 index 0000000000..3bded14f2f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/disassemble.h @@ -0,0 +1,55 @@ +// +// Copyright (C) 2014-2015 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// +// Disassembler for SPIR-V. +// + +#pragma once +#ifndef disassembler_H +#define disassembler_H + +#include +#include + +#include "glslang/Include/visibility.h" + +namespace spv { + + // disassemble with glslang custom disassembler + GLSLANG_EXPORT void Disassemble(std::ostream& out, const std::vector&); + +} // end namespace spv + +#endif // disassembler_H diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/doc.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/doc.cpp new file mode 100644 index 0000000000..dcc9b4e1ae --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/doc.cpp @@ -0,0 +1,4088 @@ +// +// Copyright (C) 2014-2015 LunarG, Inc. +// Copyright (C) 2022-2025 Arm Limited. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// +// 1) Programmatically fill in instruction/operand information. +// This can be used for disassembly, printing documentation, etc. +// +// 2) Print documentation from this parameterization. +// + +#include "doc.h" +#include "spvUtil.h" + +#include +#include +#include +#include + +namespace spv { + extern "C" { + // Include C-based headers that don't have a namespace + #include "GLSL.ext.KHR.h" + #include "GLSL.ext.EXT.h" + #include "GLSL.ext.AMD.h" + #include "GLSL.ext.NV.h" + #include "GLSL.ext.ARM.h" + #include "GLSL.ext.QCOM.h" + } +} + +namespace spv { + +// +// Whole set of functions that translate enumerants to their text strings for +// the specification (or their sanitized versions for auto-generating the +// spirv headers. +// +// Also, for masks the ceilings are declared next to these, to help keep them in sync. +// Ceilings should be +// - one more than the maximum value an enumerant takes on, for non-mask enumerants +// (for non-sparse enums, this is the number of enumerants) +// - the number of bits consumed by the set of masks +// (for non-sparse mask enums, this is the number of enumerants) +// + +const char* SourceString(int source) +{ + switch (source) { + case 0: return "Unknown"; + case 1: return "ESSL"; + case 2: return "GLSL"; + case 3: return "OpenCL_C"; + case 4: return "OpenCL_CPP"; + case 5: return "HLSL"; + + default: return "Bad"; + } +} + +const char* ExecutionModelString(int model) +{ + switch (model) { + case 0: return "Vertex"; + case 1: return "TessellationControl"; + case 2: return "TessellationEvaluation"; + case 3: return "Geometry"; + case 4: return "Fragment"; + case 5: return "GLCompute"; + case 6: return "Kernel"; + case (int)ExecutionModel::TaskNV: return "TaskNV"; + case (int)ExecutionModel::MeshNV: return "MeshNV"; + case (int)ExecutionModel::TaskEXT: return "TaskEXT"; + case (int)ExecutionModel::MeshEXT: return "MeshEXT"; + + default: return "Bad"; + + case (int)ExecutionModel::RayGenerationKHR: return "RayGenerationKHR"; + case (int)ExecutionModel::IntersectionKHR: return "IntersectionKHR"; + case (int)ExecutionModel::AnyHitKHR: return "AnyHitKHR"; + case (int)ExecutionModel::ClosestHitKHR: return "ClosestHitKHR"; + case (int)ExecutionModel::MissKHR: return "MissKHR"; + case (int)ExecutionModel::CallableKHR: return "CallableKHR"; + } +} + +const char* AddressingString(int addr) +{ + switch (addr) { + case 0: return "Logical"; + case 1: return "Physical32"; + case 2: return "Physical64"; + + case (int)AddressingModel::PhysicalStorageBuffer64EXT: return "PhysicalStorageBuffer64EXT"; + + default: return "Bad"; + } +} + +const char* MemoryString(int mem) +{ + switch (mem) { + case (int)MemoryModel::Simple: return "Simple"; + case (int)MemoryModel::GLSL450: return "GLSL450"; + case (int)MemoryModel::OpenCL: return "OpenCL"; + case (int)MemoryModel::VulkanKHR: return "VulkanKHR"; + + default: return "Bad"; + } +} + +const int ExecutionModeCeiling = 40; + +const char* ExecutionModeString(int mode) +{ + switch (mode) { + case 0: return "Invocations"; + case 1: return "SpacingEqual"; + case 2: return "SpacingFractionalEven"; + case 3: return "SpacingFractionalOdd"; + case 4: return "VertexOrderCw"; + case 5: return "VertexOrderCcw"; + case 6: return "PixelCenterInteger"; + case 7: return "OriginUpperLeft"; + case 8: return "OriginLowerLeft"; + case 9: return "EarlyFragmentTests"; + case 10: return "PointMode"; + case 11: return "Xfb"; + case 12: return "DepthReplacing"; + case 13: return "Bad"; + case 14: return "DepthGreater"; + case 15: return "DepthLess"; + case 16: return "DepthUnchanged"; + case 17: return "LocalSize"; + case 18: return "LocalSizeHint"; + case 19: return "InputPoints"; + case 20: return "InputLines"; + case 21: return "InputLinesAdjacency"; + case 22: return "Triangles"; + case 23: return "InputTrianglesAdjacency"; + case 24: return "Quads"; + case 25: return "Isolines"; + case 26: return "OutputVertices"; + case 27: return "OutputPoints"; + case 28: return "OutputLineStrip"; + case 29: return "OutputTriangleStrip"; + case 30: return "VecTypeHint"; + case 31: return "ContractionOff"; + case 32: return "Bad"; + + case (int)ExecutionMode::Initializer: return "Initializer"; + case (int)ExecutionMode::Finalizer: return "Finalizer"; + case (int)ExecutionMode::SubgroupSize: return "SubgroupSize"; + case (int)ExecutionMode::SubgroupsPerWorkgroup: return "SubgroupsPerWorkgroup"; + case (int)ExecutionMode::SubgroupsPerWorkgroupId: return "SubgroupsPerWorkgroupId"; + case (int)ExecutionMode::LocalSizeId: return "LocalSizeId"; + case (int)ExecutionMode::LocalSizeHintId: return "LocalSizeHintId"; + + case (int)ExecutionMode::PostDepthCoverage: return "PostDepthCoverage"; + case (int)ExecutionMode::DenormPreserve: return "DenormPreserve"; + case (int)ExecutionMode::DenormFlushToZero: return "DenormFlushToZero"; + case (int)ExecutionMode::SignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve"; + case (int)ExecutionMode::RoundingModeRTE: return "RoundingModeRTE"; + case (int)ExecutionMode::RoundingModeRTZ: return "RoundingModeRTZ"; + + case (int)ExecutionMode::NonCoherentTileAttachmentReadQCOM: return "NonCoherentTileAttachmentReadQCOM"; + case (int)ExecutionMode::TileShadingRateQCOM: return "TileShadingRateQCOM"; + + case (int)ExecutionMode::EarlyAndLateFragmentTestsAMD: return "EarlyAndLateFragmentTestsAMD"; + case (int)ExecutionMode::StencilRefUnchangedFrontAMD: return "StencilRefUnchangedFrontAMD"; + case (int)ExecutionMode::StencilRefLessFrontAMD: return "StencilRefLessFrontAMD"; + case (int)ExecutionMode::StencilRefGreaterBackAMD: return "StencilRefGreaterBackAMD"; + case (int)ExecutionMode::StencilRefReplacingEXT: return "StencilRefReplacingEXT"; + case (int)ExecutionMode::SubgroupUniformControlFlowKHR: return "SubgroupUniformControlFlow"; + case (int)ExecutionMode::MaximallyReconvergesKHR: return "MaximallyReconverges"; + + case (int)ExecutionMode::OutputLinesNV: return "OutputLinesNV"; + case (int)ExecutionMode::OutputPrimitivesNV: return "OutputPrimitivesNV"; + case (int)ExecutionMode::OutputTrianglesNV: return "OutputTrianglesNV"; + case (int)ExecutionMode::DerivativeGroupQuadsNV: return "DerivativeGroupQuadsNV"; + case (int)ExecutionMode::DerivativeGroupLinearNV: return "DerivativeGroupLinearNV"; + + case (int)ExecutionMode::PixelInterlockOrderedEXT: return "PixelInterlockOrderedEXT"; + case (int)ExecutionMode::PixelInterlockUnorderedEXT: return "PixelInterlockUnorderedEXT"; + case (int)ExecutionMode::SampleInterlockOrderedEXT: return "SampleInterlockOrderedEXT"; + case (int)ExecutionMode::SampleInterlockUnorderedEXT: return "SampleInterlockUnorderedEXT"; + case (int)ExecutionMode::ShadingRateInterlockOrderedEXT: return "ShadingRateInterlockOrderedEXT"; + case (int)ExecutionMode::ShadingRateInterlockUnorderedEXT: return "ShadingRateInterlockUnorderedEXT"; + + case (int)ExecutionMode::MaxWorkgroupSizeINTEL: return "MaxWorkgroupSizeINTEL"; + case (int)ExecutionMode::MaxWorkDimINTEL: return "MaxWorkDimINTEL"; + case (int)ExecutionMode::NoGlobalOffsetINTEL: return "NoGlobalOffsetINTEL"; + case (int)ExecutionMode::NumSIMDWorkitemsINTEL: return "NumSIMDWorkitemsINTEL"; + + case (int)ExecutionMode::RequireFullQuadsKHR: return "RequireFullQuadsKHR"; + case (int)ExecutionMode::QuadDerivativesKHR: return "QuadDerivativesKHR"; + + case (int)ExecutionMode::NonCoherentColorAttachmentReadEXT: return "NonCoherentColorAttachmentReadEXT"; + case (int)ExecutionMode::NonCoherentDepthAttachmentReadEXT: return "NonCoherentDepthAttachmentReadEXT"; + case (int)ExecutionMode::NonCoherentStencilAttachmentReadEXT: return "NonCoherentStencilAttachmentReadEXT"; + + case (int)ExecutionMode::Shader64BitIndexingEXT: return "Shader64BitIndexingEXT"; + + case ExecutionModeCeiling: + default: return "Bad"; + } +} + +const char* StorageClassString(int StorageClass) +{ + switch (StorageClass) { + case 0: return "UniformConstant"; + case 1: return "Input"; + case 2: return "Uniform"; + case 3: return "Output"; + case 4: return "Workgroup"; + case 5: return "CrossWorkgroup"; + case 6: return "Private"; + case 7: return "Function"; + case 8: return "Generic"; + case 9: return "PushConstant"; + case 10: return "AtomicCounter"; + case 11: return "Image"; + case 12: return "StorageBuffer"; + + case (int)StorageClass::TileAttachmentQCOM: return "TileAttachmentQCOM"; + case (int)StorageClass::RayPayloadKHR: return "RayPayloadKHR"; + case (int)StorageClass::HitAttributeKHR: return "HitAttributeKHR"; + case (int)StorageClass::IncomingRayPayloadKHR: return "IncomingRayPayloadKHR"; + case (int)StorageClass::ShaderRecordBufferKHR: return "ShaderRecordBufferKHR"; + case (int)StorageClass::CallableDataKHR: return "CallableDataKHR"; + case (int)StorageClass::IncomingCallableDataKHR: return "IncomingCallableDataKHR"; + + case (int)StorageClass::PhysicalStorageBufferEXT: return "PhysicalStorageBufferEXT"; + case (int)StorageClass::TaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT"; + case (int)StorageClass::HitObjectAttributeNV: return "HitObjectAttributeNV"; + case (int)StorageClass::TileImageEXT: return "TileImageEXT"; + case (int)StorageClass::HitObjectAttributeEXT: return "HitObjectAttributeEXT"; + default: return "Bad"; + } +} + +const int DecorationCeiling = 45; + +const char* DecorationString(int decoration) +{ + switch (decoration) { + case 0: return "RelaxedPrecision"; + case 1: return "SpecId"; + case 2: return "Block"; + case 3: return "BufferBlock"; + case 4: return "RowMajor"; + case 5: return "ColMajor"; + case 6: return "ArrayStride"; + case 7: return "MatrixStride"; + case 8: return "GLSLShared"; + case 9: return "GLSLPacked"; + case 10: return "CPacked"; + case 11: return "BuiltIn"; + case 12: return "Bad"; + case 13: return "NoPerspective"; + case 14: return "Flat"; + case 15: return "Patch"; + case 16: return "Centroid"; + case 17: return "Sample"; + case 18: return "Invariant"; + case 19: return "Restrict"; + case 20: return "Aliased"; + case 21: return "Volatile"; + case 22: return "Constant"; + case 23: return "Coherent"; + case 24: return "NonWritable"; + case 25: return "NonReadable"; + case 26: return "Uniform"; + case 27: return "Bad"; + case 28: return "SaturatedConversion"; + case 29: return "Stream"; + case 30: return "Location"; + case 31: return "Component"; + case 32: return "Index"; + case 33: return "Binding"; + case 34: return "DescriptorSet"; + case 35: return "Offset"; + case 36: return "XfbBuffer"; + case 37: return "XfbStride"; + case 38: return "FuncParamAttr"; + case 39: return "FP Rounding Mode"; + case 40: return "FP Fast Math Mode"; + case 41: return "Linkage Attributes"; + case 42: return "NoContraction"; + case 43: return "InputAttachmentIndex"; + case 44: return "Alignment"; + + case DecorationCeiling: + default: return "Bad"; + + case (int)Decoration::WeightTextureQCOM: return "DecorationWeightTextureQCOM"; + case (int)Decoration::BlockMatchTextureQCOM: return "DecorationBlockMatchTextureQCOM"; + case (int)Decoration::BlockMatchSamplerQCOM: return "DecorationBlockMatchSamplerQCOM"; + case (int)Decoration::ExplicitInterpAMD: return "ExplicitInterpAMD"; + case (int)Decoration::OverrideCoverageNV: return "OverrideCoverageNV"; + case (int)Decoration::PassthroughNV: return "PassthroughNV"; + case (int)Decoration::ViewportRelativeNV: return "ViewportRelativeNV"; + case (int)Decoration::SecondaryViewportRelativeNV: return "SecondaryViewportRelativeNV"; + case (int)Decoration::PerPrimitiveNV: return "PerPrimitiveNV"; + case (int)Decoration::PerViewNV: return "PerViewNV"; + case (int)Decoration::PerTaskNV: return "PerTaskNV"; + + case (int)Decoration::PerVertexKHR: return "PerVertexKHR"; + + case (int)Decoration::NonUniformEXT: return "DecorationNonUniformEXT"; + case (int)Decoration::HlslCounterBufferGOOGLE: return "DecorationHlslCounterBufferGOOGLE"; + case (int)Decoration::HlslSemanticGOOGLE: return "DecorationHlslSemanticGOOGLE"; + case (int)Decoration::RestrictPointerEXT: return "DecorationRestrictPointerEXT"; + case (int)Decoration::AliasedPointerEXT: return "DecorationAliasedPointerEXT"; + + case (int)Decoration::HitObjectShaderRecordBufferNV: return "DecorationHitObjectShaderRecordBufferNV"; + case (int)Decoration::HitObjectShaderRecordBufferEXT: return "DecorationHitObjectShaderRecordBufferEXT"; + + case (int)Decoration::SaturatedToLargestFloat8NormalConversionEXT: return "DecorationSaturatedToLargestFloat8NormalConversionEXT"; + } +} + +const char* BuiltInString(int builtIn) +{ + switch (builtIn) { + case 0: return "Position"; + case 1: return "PointSize"; + case 2: return "Bad"; + case 3: return "ClipDistance"; + case 4: return "CullDistance"; + case 5: return "VertexId"; + case 6: return "InstanceId"; + case 7: return "PrimitiveId"; + case 8: return "InvocationId"; + case 9: return "Layer"; + case 10: return "ViewportIndex"; + case 11: return "TessLevelOuter"; + case 12: return "TessLevelInner"; + case 13: return "TessCoord"; + case 14: return "PatchVertices"; + case 15: return "FragCoord"; + case 16: return "PointCoord"; + case 17: return "FrontFacing"; + case 18: return "SampleId"; + case 19: return "SamplePosition"; + case 20: return "SampleMask"; + case 21: return "Bad"; + case 22: return "FragDepth"; + case 23: return "HelperInvocation"; + case 24: return "NumWorkgroups"; + case 25: return "WorkgroupSize"; + case 26: return "WorkgroupId"; + case 27: return "LocalInvocationId"; + case 28: return "GlobalInvocationId"; + case 29: return "LocalInvocationIndex"; + case 30: return "WorkDim"; + case 31: return "GlobalSize"; + case 32: return "EnqueuedWorkgroupSize"; + case 33: return "GlobalOffset"; + case 34: return "GlobalLinearId"; + case 35: return "Bad"; + case 36: return "SubgroupSize"; + case 37: return "SubgroupMaxSize"; + case 38: return "NumSubgroups"; + case 39: return "NumEnqueuedSubgroups"; + case 40: return "SubgroupId"; + case 41: return "SubgroupLocalInvocationId"; + case 42: return "VertexIndex"; // TBD: put next to VertexId? + case 43: return "InstanceIndex"; // TBD: put next to InstanceId? + + case 4416: return "SubgroupEqMaskKHR"; + case 4417: return "SubgroupGeMaskKHR"; + case 4418: return "SubgroupGtMaskKHR"; + case 4419: return "SubgroupLeMaskKHR"; + case 4420: return "SubgroupLtMaskKHR"; + case 4438: return "DeviceIndex"; + case 4440: return "ViewIndex"; + case 4424: return "BaseVertex"; + case 4425: return "BaseInstance"; + case 4426: return "DrawIndex"; + case 4432: return "PrimitiveShadingRateKHR"; + case 4444: return "ShadingRateKHR"; + case 5014: return "FragStencilRefEXT"; + + case (int)BuiltIn::TileOffsetQCOM: return "TileOffsetQCOM"; + case (int)BuiltIn::TileDimensionQCOM: return "TileDimensionQCOM"; + case (int)BuiltIn::TileApronSizeQCOM: return "TileApronSizeQCOM"; + + case 4992: return "BaryCoordNoPerspAMD"; + case 4993: return "BaryCoordNoPerspCentroidAMD"; + case 4994: return "BaryCoordNoPerspSampleAMD"; + case 4995: return "BaryCoordSmoothAMD"; + case 4996: return "BaryCoordSmoothCentroidAMD"; + case 4997: return "BaryCoordSmoothSampleAMD"; + case 4998: return "BaryCoordPullModelAMD"; + case (int)BuiltIn::LaunchIdKHR: return "LaunchIdKHR"; + case (int)BuiltIn::LaunchSizeKHR: return "LaunchSizeKHR"; + case (int)BuiltIn::WorldRayOriginKHR: return "WorldRayOriginKHR"; + case (int)BuiltIn::WorldRayDirectionKHR: return "WorldRayDirectionKHR"; + case (int)BuiltIn::ObjectRayOriginKHR: return "ObjectRayOriginKHR"; + case (int)BuiltIn::ObjectRayDirectionKHR: return "ObjectRayDirectionKHR"; + case (int)BuiltIn::RayTminKHR: return "RayTminKHR"; + case (int)BuiltIn::RayTmaxKHR: return "RayTmaxKHR"; + case (int)BuiltIn::CullMaskKHR: return "CullMaskKHR"; + case (int)BuiltIn::HitTriangleVertexPositionsKHR: return "HitTriangleVertexPositionsKHR"; + case (int)BuiltIn::HitMicroTriangleVertexPositionsNV: return "HitMicroTriangleVertexPositionsNV"; + case (int)BuiltIn::HitMicroTriangleVertexBarycentricsNV: return "HitMicroTriangleVertexBarycentricsNV"; + case (int)BuiltIn::HitKindFrontFacingMicroTriangleNV: return "HitKindFrontFacingMicroTriangleNV"; + case (int)BuiltIn::HitKindBackFacingMicroTriangleNV: return "HitKindBackFacingMicroTriangleNV"; + case (int)BuiltIn::HitIsSphereNV: return "HitIsSphereNV"; + case (int)BuiltIn::HitIsLSSNV: return "HitIsLSSNV"; + case (int)BuiltIn::HitSpherePositionNV: return "HitSpherePositionNV"; + case (int)BuiltIn::HitSphereRadiusNV: return "HitSphereRadiusNV"; + case (int)BuiltIn::HitLSSPositionsNV: return "HitLSSPositionsNV"; + case (int)BuiltIn::HitLSSRadiiNV: return "HitLLSSRadiiNV"; + case (int)BuiltIn::InstanceCustomIndexKHR: return "InstanceCustomIndexKHR"; + case (int)BuiltIn::RayGeometryIndexKHR: return "RayGeometryIndexKHR"; + case (int)BuiltIn::ObjectToWorldKHR: return "ObjectToWorldKHR"; + case (int)BuiltIn::WorldToObjectKHR: return "WorldToObjectKHR"; + case (int)BuiltIn::HitTNV: return "HitTNV"; + case (int)BuiltIn::HitKindKHR: return "HitKindKHR"; + case (int)BuiltIn::IncomingRayFlagsKHR: return "IncomingRayFlagsKHR"; + case (int)BuiltIn::ViewportMaskNV: return "ViewportMaskNV"; + case (int)BuiltIn::SecondaryPositionNV: return "SecondaryPositionNV"; + case (int)BuiltIn::SecondaryViewportMaskNV: return "SecondaryViewportMaskNV"; + case (int)BuiltIn::PositionPerViewNV: return "PositionPerViewNV"; + case (int)BuiltIn::ViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; +// case (int)BuiltIn::FragmentSizeNV: return "FragmentSizeNV"; // superseded by BuiltInFragSizeEXT +// case (int)BuiltIn::InvocationsPerPixelNV: return "InvocationsPerPixelNV"; // superseded by BuiltInFragInvocationCountEXT + case (int)BuiltIn::BaryCoordKHR: return "BaryCoordKHR"; + case (int)BuiltIn::BaryCoordNoPerspKHR: return "BaryCoordNoPerspKHR"; + case (int)BuiltIn::ClusterIDNV: return "ClusterIDNV"; + + case (int)BuiltIn::FragSizeEXT: return "FragSizeEXT"; + case (int)BuiltIn::FragInvocationCountEXT: return "FragInvocationCountEXT"; + + case 5264: return "FullyCoveredEXT"; + + case (int)BuiltIn::TaskCountNV: return "TaskCountNV"; + case (int)BuiltIn::PrimitiveCountNV: return "PrimitiveCountNV"; + case (int)BuiltIn::PrimitiveIndicesNV: return "PrimitiveIndicesNV"; + case (int)BuiltIn::ClipDistancePerViewNV: return "ClipDistancePerViewNV"; + case (int)BuiltIn::CullDistancePerViewNV: return "CullDistancePerViewNV"; + case (int)BuiltIn::LayerPerViewNV: return "LayerPerViewNV"; + case (int)BuiltIn::MeshViewCountNV: return "MeshViewCountNV"; + case (int)BuiltIn::MeshViewIndicesNV: return "MeshViewIndicesNV"; + case (int)BuiltIn::WarpsPerSMNV: return "WarpsPerSMNV"; + case (int)BuiltIn::SMCountNV: return "SMCountNV"; + case (int)BuiltIn::WarpIDNV: return "WarpIDNV"; + case (int)BuiltIn::SMIDNV: return "SMIDNV"; + case (int)BuiltIn::CurrentRayTimeNV: return "CurrentRayTimeNV"; + case (int)BuiltIn::PrimitivePointIndicesEXT: return "PrimitivePointIndicesEXT"; + case (int)BuiltIn::PrimitiveLineIndicesEXT: return "PrimitiveLineIndicesEXT"; + case (int)BuiltIn::PrimitiveTriangleIndicesEXT: return "PrimitiveTriangleIndicesEXT"; + case (int)BuiltIn::CullPrimitiveEXT: return "CullPrimitiveEXT"; + case (int)BuiltIn::CoreCountARM: return "CoreCountARM"; + case (int)BuiltIn::CoreIDARM: return "CoreIDARM"; + case (int)BuiltIn::CoreMaxIDARM: return "CoreMaxIDARM"; + case (int)BuiltIn::WarpIDARM: return "WarpIDARM"; + case (int)BuiltIn::WarpMaxIDARM: return "BuiltInWarpMaxIDARM"; + + default: return "Bad"; + } +} + +const char* DimensionString(int dim) +{ + switch (dim) { + case 0: return "1D"; + case 1: return "2D"; + case 2: return "3D"; + case 3: return "Cube"; + case 4: return "Rect"; + case 5: return "Buffer"; + case 6: return "SubpassData"; + case (int)Dim::TileImageDataEXT: return "TileImageDataEXT"; + + default: return "Bad"; + } +} + +const char* SamplerAddressingModeString(int mode) +{ + switch (mode) { + case 0: return "None"; + case 1: return "ClampToEdge"; + case 2: return "Clamp"; + case 3: return "Repeat"; + case 4: return "RepeatMirrored"; + + default: return "Bad"; + } +} + +const char* SamplerFilterModeString(int mode) +{ + switch (mode) { + case 0: return "Nearest"; + case 1: return "Linear"; + + default: return "Bad"; + } +} + +const char* ImageFormatString(int format) +{ + switch (format) { + case 0: return "Unknown"; + + // ES/Desktop float + case 1: return "Rgba32f"; + case 2: return "Rgba16f"; + case 3: return "R32f"; + case 4: return "Rgba8"; + case 5: return "Rgba8Snorm"; + + // Desktop float + case 6: return "Rg32f"; + case 7: return "Rg16f"; + case 8: return "R11fG11fB10f"; + case 9: return "R16f"; + case 10: return "Rgba16"; + case 11: return "Rgb10A2"; + case 12: return "Rg16"; + case 13: return "Rg8"; + case 14: return "R16"; + case 15: return "R8"; + case 16: return "Rgba16Snorm"; + case 17: return "Rg16Snorm"; + case 18: return "Rg8Snorm"; + case 19: return "R16Snorm"; + case 20: return "R8Snorm"; + + // ES/Desktop int + case 21: return "Rgba32i"; + case 22: return "Rgba16i"; + case 23: return "Rgba8i"; + case 24: return "R32i"; + + // Desktop int + case 25: return "Rg32i"; + case 26: return "Rg16i"; + case 27: return "Rg8i"; + case 28: return "R16i"; + case 29: return "R8i"; + + // ES/Desktop uint + case 30: return "Rgba32ui"; + case 31: return "Rgba16ui"; + case 32: return "Rgba8ui"; + case 33: return "R32ui"; + + // Desktop uint + case 34: return "Rgb10a2ui"; + case 35: return "Rg32ui"; + case 36: return "Rg16ui"; + case 37: return "Rg8ui"; + case 38: return "R16ui"; + case 39: return "R8ui"; + case 40: return "R64ui"; + case 41: return "R64i"; + + default: + return "Bad"; + } +} + +const char* ImageChannelOrderString(int format) +{ + switch (format) { + case 0: return "R"; + case 1: return "A"; + case 2: return "RG"; + case 3: return "RA"; + case 4: return "RGB"; + case 5: return "RGBA"; + case 6: return "BGRA"; + case 7: return "ARGB"; + case 8: return "Intensity"; + case 9: return "Luminance"; + case 10: return "Rx"; + case 11: return "RGx"; + case 12: return "RGBx"; + case 13: return "Depth"; + case 14: return "DepthStencil"; + case 15: return "sRGB"; + case 16: return "sRGBx"; + case 17: return "sRGBA"; + case 18: return "sBGRA"; + + default: + return "Bad"; + } +} + +const char* ImageChannelDataTypeString(int type) +{ + switch (type) + { + case 0: return "SnormInt8"; + case 1: return "SnormInt16"; + case 2: return "UnormInt8"; + case 3: return "UnormInt16"; + case 4: return "UnormShort565"; + case 5: return "UnormShort555"; + case 6: return "UnormInt101010"; + case 7: return "SignedInt8"; + case 8: return "SignedInt16"; + case 9: return "SignedInt32"; + case 10: return "UnsignedInt8"; + case 11: return "UnsignedInt16"; + case 12: return "UnsignedInt32"; + case 13: return "HalfFloat"; + case 14: return "Float"; + case 15: return "UnormInt24"; + case 16: return "UnormInt101010_2"; + + default: + return "Bad"; + } +} + +const int ImageOperandsCeiling = 17; + +const char* ImageOperandsString(int format) +{ + switch (format) { + case (int)ImageOperandsShift::Bias: return "Bias"; + case (int)ImageOperandsShift::Lod: return "Lod"; + case (int)ImageOperandsShift::Grad: return "Grad"; + case (int)ImageOperandsShift::ConstOffset: return "ConstOffset"; + case (int)ImageOperandsShift::Offset: return "Offset"; + case (int)ImageOperandsShift::ConstOffsets: return "ConstOffsets"; + case (int)ImageOperandsShift::Sample: return "Sample"; + case (int)ImageOperandsShift::MinLod: return "MinLod"; + case (int)ImageOperandsShift::MakeTexelAvailableKHR: return "MakeTexelAvailableKHR"; + case (int)ImageOperandsShift::MakeTexelVisibleKHR: return "MakeTexelVisibleKHR"; + case (int)ImageOperandsShift::NonPrivateTexelKHR: return "NonPrivateTexelKHR"; + case (int)ImageOperandsShift::VolatileTexelKHR: return "VolatileTexelKHR"; + case (int)ImageOperandsShift::SignExtend: return "SignExtend"; + case (int)ImageOperandsShift::ZeroExtend: return "ZeroExtend"; + case (int)ImageOperandsShift::Nontemporal: return "Nontemporal"; + case (int)ImageOperandsShift::Offsets: return "Offsets"; + + case ImageOperandsCeiling: + default: + return "Bad"; + } +} + +const char* FPFastMathString(int mode) +{ + switch (mode) { + case 0: return "NotNaN"; + case 1: return "NotInf"; + case 2: return "NSZ"; + case 3: return "AllowRecip"; + case 4: return "Fast"; + + default: return "Bad"; + } +} + +const char* FPRoundingModeString(int mode) +{ + switch (mode) { + case 0: return "RTE"; + case 1: return "RTZ"; + case 2: return "RTP"; + case 3: return "RTN"; + + default: return "Bad"; + } +} + +const char* LinkageTypeString(int type) +{ + switch (type) { + case 0: return "Export"; + case 1: return "Import"; + + default: return "Bad"; + } +} + +const char* FuncParamAttrString(int attr) +{ + switch (attr) { + case 0: return "Zext"; + case 1: return "Sext"; + case 2: return "ByVal"; + case 3: return "Sret"; + case 4: return "NoAlias"; + case 5: return "NoCapture"; + case 6: return "NoWrite"; + case 7: return "NoReadWrite"; + + default: return "Bad"; + } +} + +const char* AccessQualifierString(int attr) +{ + switch (attr) { + case 0: return "ReadOnly"; + case 1: return "WriteOnly"; + case 2: return "ReadWrite"; + + default: return "Bad"; + } +} + +const int SelectControlCeiling = 2; + +const char* SelectControlString(int cont) +{ + switch (cont) { + case 0: return "Flatten"; + case 1: return "DontFlatten"; + + case SelectControlCeiling: + default: return "Bad"; + } +} + +const int LoopControlCeiling = (int)LoopControlShift::PartialCount + 1; + +const char* LoopControlString(int cont) +{ + switch (cont) { + case (int)LoopControlShift::Unroll: return "Unroll"; + case (int)LoopControlShift::DontUnroll: return "DontUnroll"; + case (int)LoopControlShift::DependencyInfinite: return "DependencyInfinite"; + case (int)LoopControlShift::DependencyLength: return "DependencyLength"; + case (int)LoopControlShift::MinIterations: return "MinIterations"; + case (int)LoopControlShift::MaxIterations: return "MaxIterations"; + case (int)LoopControlShift::IterationMultiple: return "IterationMultiple"; + case (int)LoopControlShift::PeelCount: return "PeelCount"; + case (int)LoopControlShift::PartialCount: return "PartialCount"; + + case LoopControlCeiling: + default: return "Bad"; + } +} + +const int FunctionControlCeiling = 4; + +const char* FunctionControlString(int cont) +{ + switch (cont) { + case 0: return "Inline"; + case 1: return "DontInline"; + case 2: return "Pure"; + case 3: return "Const"; + + case FunctionControlCeiling: + default: return "Bad"; + } +} + +const char* MemorySemanticsString(int mem) +{ + // Note: No bits set (None) means "Relaxed" + switch (mem) { + case 0: return "Bad"; // Note: this is a placeholder for 'Consume' + case 1: return "Acquire"; + case 2: return "Release"; + case 3: return "AcquireRelease"; + case 4: return "SequentiallyConsistent"; + case 5: return "Bad"; // Note: reserved for future expansion + case 6: return "UniformMemory"; + case 7: return "SubgroupMemory"; + case 8: return "WorkgroupMemory"; + case 9: return "CrossWorkgroupMemory"; + case 10: return "AtomicCounterMemory"; + case 11: return "ImageMemory"; + + default: return "Bad"; + } +} + +const int MemoryAccessCeiling = 6; + +const char* MemoryAccessString(int mem) +{ + switch (mem) { + case (int)MemoryAccessShift::Volatile: return "Volatile"; + case (int)MemoryAccessShift::Aligned: return "Aligned"; + case (int)MemoryAccessShift::Nontemporal: return "Nontemporal"; + case (int)MemoryAccessShift::MakePointerAvailableKHR: return "MakePointerAvailableKHR"; + case (int)MemoryAccessShift::MakePointerVisibleKHR: return "MakePointerVisibleKHR"; + case (int)MemoryAccessShift::NonPrivatePointerKHR: return "NonPrivatePointerKHR"; + + default: return "Bad"; + } +} + +const int CooperativeMatrixOperandsCeiling = 6; + +const char* CooperativeMatrixOperandsString(int op) +{ + switch (op) { + case (int)CooperativeMatrixOperandsShift::MatrixASignedComponentsKHR: return "ASignedComponentsKHR"; + case (int)CooperativeMatrixOperandsShift::MatrixBSignedComponentsKHR: return "BSignedComponentsKHR"; + case (int)CooperativeMatrixOperandsShift::MatrixCSignedComponentsKHR: return "CSignedComponentsKHR"; + case (int)CooperativeMatrixOperandsShift::MatrixResultSignedComponentsKHR: return "ResultSignedComponentsKHR"; + case (int)CooperativeMatrixOperandsShift::SaturatingAccumulationKHR: return "SaturatingAccumulationKHR"; + + default: return "Bad"; + } +} + +const int TensorAddressingOperandsCeiling = 3; + +const char* TensorAddressingOperandsString(int op) +{ + switch (op) { + case (int)TensorAddressingOperandsShift::TensorView: return "TensorView"; + case (int)TensorAddressingOperandsShift::DecodeFunc: return "DecodeFunc"; + + default: return "Bad"; + } +} + +const char* ScopeString(int mem) +{ + switch (mem) { + case 0: return "CrossDevice"; + case 1: return "Device"; + case 2: return "Workgroup"; + case 3: return "Subgroup"; + case 4: return "Invocation"; + + default: return "Bad"; + } +} + +const char* GroupOperationString(int gop) +{ + + switch (gop) + { + case (int)GroupOperation::Reduce: return "Reduce"; + case (int)GroupOperation::InclusiveScan: return "InclusiveScan"; + case (int)GroupOperation::ExclusiveScan: return "ExclusiveScan"; + case (int)GroupOperation::ClusteredReduce: return "ClusteredReduce"; + case (int)GroupOperation::PartitionedReduceNV: return "PartitionedReduceNV"; + case (int)GroupOperation::PartitionedInclusiveScanNV: return "PartitionedInclusiveScanNV"; + case (int)GroupOperation::PartitionedExclusiveScanNV: return "PartitionedExclusiveScanNV"; + + default: return "Bad"; + } +} + +const char* KernelEnqueueFlagsString(int flag) +{ + switch (flag) + { + case 0: return "NoWait"; + case 1: return "WaitKernel"; + case 2: return "WaitWorkGroup"; + + default: return "Bad"; + } +} + +const char* KernelProfilingInfoString(int info) +{ + switch (info) + { + case 0: return "CmdExecTime"; + + default: return "Bad"; + } +} + +const char* CapabilityString(int info) +{ + switch (info) + { + case 0: return "Matrix"; + case 1: return "Shader"; + case 2: return "Geometry"; + case 3: return "Tessellation"; + case 4: return "Addresses"; + case 5: return "Linkage"; + case 6: return "Kernel"; + case 7: return "Vector16"; + case 8: return "Float16Buffer"; + case 9: return "Float16"; + case 10: return "Float64"; + case 11: return "Int64"; + case 12: return "Int64Atomics"; + case 13: return "ImageBasic"; + case 14: return "ImageReadWrite"; + case 15: return "ImageMipmap"; + case 16: return "Bad"; + case 17: return "Pipes"; + case 18: return "Groups"; + case 19: return "DeviceEnqueue"; + case 20: return "LiteralSampler"; + case 21: return "AtomicStorage"; + case 22: return "Int16"; + case 23: return "TessellationPointSize"; + case 24: return "GeometryPointSize"; + case 25: return "ImageGatherExtended"; + case 26: return "Bad"; + case 27: return "StorageImageMultisample"; + case 28: return "UniformBufferArrayDynamicIndexing"; + case 29: return "SampledImageArrayDynamicIndexing"; + case 30: return "StorageBufferArrayDynamicIndexing"; + case 31: return "StorageImageArrayDynamicIndexing"; + case 32: return "ClipDistance"; + case 33: return "CullDistance"; + case 34: return "ImageCubeArray"; + case 35: return "SampleRateShading"; + case 36: return "ImageRect"; + case 37: return "SampledRect"; + case 38: return "GenericPointer"; + case 39: return "Int8"; + case 40: return "InputAttachment"; + case 41: return "SparseResidency"; + case 42: return "MinLod"; + case 43: return "Sampled1D"; + case 44: return "Image1D"; + case 45: return "SampledCubeArray"; + case 46: return "SampledBuffer"; + case 47: return "ImageBuffer"; + case 48: return "ImageMSArray"; + case 49: return "StorageImageExtendedFormats"; + case 50: return "ImageQuery"; + case 51: return "DerivativeControl"; + case 52: return "InterpolationFunction"; + case 53: return "TransformFeedback"; + case 54: return "GeometryStreams"; + case 55: return "StorageImageReadWithoutFormat"; + case 56: return "StorageImageWriteWithoutFormat"; + case 57: return "MultiViewport"; + case 61: return "GroupNonUniform"; + case 62: return "GroupNonUniformVote"; + case 63: return "GroupNonUniformArithmetic"; + case 64: return "GroupNonUniformBallot"; + case 65: return "GroupNonUniformShuffle"; + case 66: return "GroupNonUniformShuffleRelative"; + case 67: return "GroupNonUniformClustered"; + case 68: return "GroupNonUniformQuad"; + + case (int)Capability::SubgroupBallotKHR: return "SubgroupBallotKHR"; + case (int)Capability::DrawParameters: return "DrawParameters"; + case (int)Capability::SubgroupVoteKHR: return "SubgroupVoteKHR"; + case (int)Capability::GroupNonUniformRotateKHR: return "GroupNonUniformRotateKHR"; + + case (int)Capability::StorageUniformBufferBlock16: return "StorageUniformBufferBlock16"; + case (int)Capability::StorageUniform16: return "StorageUniform16"; + case (int)Capability::StoragePushConstant16: return "StoragePushConstant16"; + case (int)Capability::StorageInputOutput16: return "StorageInputOutput16"; + + case (int)Capability::StorageBuffer8BitAccess: return "StorageBuffer8BitAccess"; + case (int)Capability::UniformAndStorageBuffer8BitAccess: return "UniformAndStorageBuffer8BitAccess"; + case (int)Capability::StoragePushConstant8: return "StoragePushConstant8"; + + case (int)Capability::DeviceGroup: return "DeviceGroup"; + case (int)Capability::MultiView: return "MultiView"; + + case (int)Capability::DenormPreserve: return "DenormPreserve"; + case (int)Capability::DenormFlushToZero: return "DenormFlushToZero"; + case (int)Capability::SignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve"; + case (int)Capability::RoundingModeRTE: return "RoundingModeRTE"; + case (int)Capability::RoundingModeRTZ: return "RoundingModeRTZ"; + + case (int)Capability::StencilExportEXT: return "StencilExportEXT"; + + case (int)Capability::Float16ImageAMD: return "Float16ImageAMD"; + case (int)Capability::ImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD"; + case (int)Capability::FragmentMaskAMD: return "FragmentMaskAMD"; + case (int)Capability::ImageReadWriteLodAMD: return "ImageReadWriteLodAMD"; + + case (int)Capability::AtomicStorageOps: return "AtomicStorageOps"; + + case (int)Capability::SampleMaskPostDepthCoverage: return "SampleMaskPostDepthCoverage"; + case (int)Capability::GeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV"; + case (int)Capability::ShaderViewportIndexLayerNV: return "ShaderViewportIndexLayerNV"; + case (int)Capability::ShaderViewportMaskNV: return "ShaderViewportMaskNV"; + case (int)Capability::ShaderStereoViewNV: return "ShaderStereoViewNV"; + case (int)Capability::PerViewAttributesNV: return "PerViewAttributesNV"; + case (int)Capability::GroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV"; + case (int)Capability::RayTracingNV: return "RayTracingNV"; + case (int)Capability::RayTracingMotionBlurNV: return "RayTracingMotionBlurNV"; + case (int)Capability::RayTracingKHR: return "RayTracingKHR"; + case (int)Capability::RayCullMaskKHR: return "RayCullMaskKHR"; + case (int)Capability::RayQueryKHR: return "RayQueryKHR"; + case (int)Capability::RayTracingProvisionalKHR: return "RayTracingProvisionalKHR"; + case (int)Capability::RayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR"; + case (int)Capability::RayTracingPositionFetchKHR: return "RayTracingPositionFetchKHR"; + case (int)Capability::DisplacementMicromapNV: return "DisplacementMicromapNV"; + case (int)Capability::RayTracingOpacityMicromapEXT: return "RayTracingOpacityMicromapEXT"; + case (int)Capability::RayTracingDisplacementMicromapNV: return "RayTracingDisplacementMicromapNV"; + case (int)Capability::RayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR"; + case (int)Capability::ComputeDerivativeGroupQuadsNV: return "ComputeDerivativeGroupQuadsNV"; + case (int)Capability::ComputeDerivativeGroupLinearNV: return "ComputeDerivativeGroupLinearNV"; + case (int)Capability::FragmentBarycentricKHR: return "FragmentBarycentricKHR"; + case (int)Capability::MeshShadingNV: return "MeshShadingNV"; + case (int)Capability::ImageFootprintNV: return "ImageFootprintNV"; + case (int)Capability::MeshShadingEXT: return "MeshShadingEXT"; +// case (int)Capability::ShadingRateNV: return "ShadingRateNV"; // superseded by FragmentDensityEXT + case (int)Capability::SampleMaskOverrideCoverageNV: return "SampleMaskOverrideCoverageNV"; + case (int)Capability::FragmentDensityEXT: return "FragmentDensityEXT"; + + case (int)Capability::FragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT"; + + case (int)Capability::ShaderNonUniformEXT: return "ShaderNonUniformEXT"; + case (int)Capability::RuntimeDescriptorArrayEXT: return "RuntimeDescriptorArrayEXT"; + case (int)Capability::InputAttachmentArrayDynamicIndexingEXT: return "InputAttachmentArrayDynamicIndexingEXT"; + case (int)Capability::UniformTexelBufferArrayDynamicIndexingEXT: return "UniformTexelBufferArrayDynamicIndexingEXT"; + case (int)Capability::StorageTexelBufferArrayDynamicIndexingEXT: return "StorageTexelBufferArrayDynamicIndexingEXT"; + case (int)Capability::UniformBufferArrayNonUniformIndexingEXT: return "UniformBufferArrayNonUniformIndexingEXT"; + case (int)Capability::SampledImageArrayNonUniformIndexingEXT: return "SampledImageArrayNonUniformIndexingEXT"; + case (int)Capability::StorageBufferArrayNonUniformIndexingEXT: return "StorageBufferArrayNonUniformIndexingEXT"; + case (int)Capability::StorageImageArrayNonUniformIndexingEXT: return "StorageImageArrayNonUniformIndexingEXT"; + case (int)Capability::InputAttachmentArrayNonUniformIndexingEXT: return "InputAttachmentArrayNonUniformIndexingEXT"; + case (int)Capability::UniformTexelBufferArrayNonUniformIndexingEXT: return "UniformTexelBufferArrayNonUniformIndexingEXT"; + case (int)Capability::StorageTexelBufferArrayNonUniformIndexingEXT: return "StorageTexelBufferArrayNonUniformIndexingEXT"; + + case (int)Capability::VulkanMemoryModelKHR: return "VulkanMemoryModelKHR"; + case (int)Capability::VulkanMemoryModelDeviceScopeKHR: return "VulkanMemoryModelDeviceScopeKHR"; + + case (int)Capability::PhysicalStorageBufferAddressesEXT: return "PhysicalStorageBufferAddressesEXT"; + + case (int)Capability::VariablePointers: return "VariablePointers"; + + case (int)Capability::CooperativeMatrixNV: return "CooperativeMatrixNV"; + case (int)Capability::CooperativeMatrixKHR: return "CooperativeMatrixKHR"; + case (int)Capability::CooperativeMatrixReductionsNV: return "CooperativeMatrixReductionsNV"; + case (int)Capability::CooperativeMatrixConversionsNV: return "CooperativeMatrixConversionsNV"; + case (int)Capability::CooperativeMatrixPerElementOperationsNV: return "CooperativeMatrixPerElementOperationsNV"; + case (int)Capability::CooperativeMatrixTensorAddressingNV: return "CooperativeMatrixTensorAddressingNV"; + case (int)Capability::CooperativeMatrixBlockLoadsNV: return "CooperativeMatrixBlockLoadsNV"; + case (int)Capability::TensorAddressingNV: return "TensorAddressingNV"; + + case (int)Capability::ShaderSMBuiltinsNV: return "ShaderSMBuiltinsNV"; + + case (int)Capability::CooperativeVectorNV: return "CooperativeVectorNV"; + case (int)Capability::CooperativeVectorTrainingNV: return "CooperativeVectorTrainingNV"; + + case (int)Capability::FragmentShaderSampleInterlockEXT: return "FragmentShaderSampleInterlockEXT"; + case (int)Capability::FragmentShaderPixelInterlockEXT: return "FragmentShaderPixelInterlockEXT"; + case (int)Capability::FragmentShaderShadingRateInterlockEXT: return "FragmentShaderShadingRateInterlockEXT"; + + case (int)Capability::TileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT"; + case (int)Capability::TileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT"; + case (int)Capability::TileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT"; + + case (int)Capability::CooperativeMatrixLayoutsARM: return "CooperativeMatrixLayoutsARM"; + case (int)Capability::TensorsARM: return "TensorsARM"; + + case (int)Capability::FragmentShadingRateKHR: return "FragmentShadingRateKHR"; + + case (int)Capability::DemoteToHelperInvocationEXT: return "DemoteToHelperInvocationEXT"; + case (int)Capability::AtomicFloat16VectorNV: return "AtomicFloat16VectorNV"; + case (int)Capability::ShaderClockKHR: return "ShaderClockKHR"; + case (int)Capability::QuadControlKHR: return "QuadControlKHR"; + case (int)Capability::Int64ImageEXT: return "Int64ImageEXT"; + + case (int)Capability::IntegerFunctions2INTEL: return "IntegerFunctions2INTEL"; + + case (int)Capability::ExpectAssumeKHR: return "ExpectAssumeKHR"; + + case (int)Capability::AtomicFloat16AddEXT: return "AtomicFloat16AddEXT"; + case (int)Capability::AtomicFloat32AddEXT: return "AtomicFloat32AddEXT"; + case (int)Capability::AtomicFloat64AddEXT: return "AtomicFloat64AddEXT"; + case (int)Capability::AtomicFloat16MinMaxEXT: return "AtomicFloat16MinMaxEXT"; + case (int)Capability::AtomicFloat32MinMaxEXT: return "AtomicFloat32MinMaxEXT"; + case (int)Capability::AtomicFloat64MinMaxEXT: return "AtomicFloat64MinMaxEXT"; + + case (int)Capability::WorkgroupMemoryExplicitLayoutKHR: return "WorkgroupMemoryExplicitLayoutKHR"; + case (int)Capability::WorkgroupMemoryExplicitLayout8BitAccessKHR: return "WorkgroupMemoryExplicitLayout8BitAccessKHR"; + case (int)Capability::WorkgroupMemoryExplicitLayout16BitAccessKHR: return "WorkgroupMemoryExplicitLayout16BitAccessKHR"; + case (int)Capability::CoreBuiltinsARM: return "CoreBuiltinsARM"; + + case (int)Capability::ShaderInvocationReorderNV: return "ShaderInvocationReorderNV"; + case (int)Capability::ShaderInvocationReorderEXT: return "ShaderInvocationReorderEXT"; + + case (int)Capability::TextureSampleWeightedQCOM: return "TextureSampleWeightedQCOM"; + case (int)Capability::TextureBoxFilterQCOM: return "TextureBoxFilterQCOM"; + case (int)Capability::TextureBlockMatchQCOM: return "TextureBlockMatchQCOM"; + case (int)Capability::TileShadingQCOM: return "TileShadingQCOM"; + case (int)Capability::TextureBlockMatch2QCOM: return "TextureBlockMatch2QCOM"; + + case (int)Capability::CooperativeMatrixConversionQCOM: return "CooperativeMatrixConversionQCOM"; + + case (int)Capability::ReplicatedCompositesEXT: return "ReplicatedCompositesEXT"; + + case (int)Capability::DotProductKHR: return "DotProductKHR"; + case (int)Capability::DotProductInputAllKHR: return "DotProductInputAllKHR"; + case (int)Capability::DotProductInput4x8BitKHR: return "DotProductInput4x8BitKHR"; + case (int)Capability::DotProductInput4x8BitPackedKHR: return "DotProductInput4x8BitPackedKHR"; + + case (int)Capability::RayTracingClusterAccelerationStructureNV: return "RayTracingClusterAccelerationStructureNV"; + + case (int)Capability::RayTracingSpheresGeometryNV: return "RayTracingSpheresGeometryNV"; + case (int)Capability::RayTracingLinearSweptSpheresGeometryNV: return "RayTracingLinearSweptSpheresGeometryNV"; + + case (int)Capability::BFloat16TypeKHR: return "BFloat16TypeKHR"; + case (int)Capability::BFloat16DotProductKHR: return "BFloat16DotProductKHR"; + case (int)Capability::BFloat16CooperativeMatrixKHR: return "BFloat16CooperativeMatrixKHR"; + + case (int)Capability::Float8EXT: return "Float8EXT"; + case (int)Capability::Float8CooperativeMatrixEXT: return "Float8CooperativeMatrixEXT"; + + case (int)Capability::Shader64BitIndexingEXT: return "CapabilityShader64BitIndexingEXT"; + + default: return "Bad"; + } +} + +const char* OpcodeString(int op) +{ + switch (op) { + case 0: return "OpNop"; + case 1: return "OpUndef"; + case 2: return "OpSourceContinued"; + case 3: return "OpSource"; + case 4: return "OpSourceExtension"; + case 5: return "OpName"; + case 6: return "OpMemberName"; + case 7: return "OpString"; + case 8: return "OpLine"; + case 9: return "Bad"; + case 10: return "OpExtension"; + case 11: return "OpExtInstImport"; + case 12: return "OpExtInst"; + case 13: return "Bad"; + case 14: return "OpMemoryModel"; + case 15: return "OpEntryPoint"; + case 16: return "OpExecutionMode"; + case 17: return "OpCapability"; + case 18: return "Bad"; + case 19: return "OpTypeVoid"; + case 20: return "OpTypeBool"; + case 21: return "OpTypeInt"; + case 22: return "OpTypeFloat"; + case 23: return "OpTypeVector"; + case 24: return "OpTypeMatrix"; + case 25: return "OpTypeImage"; + case 26: return "OpTypeSampler"; + case 27: return "OpTypeSampledImage"; + case 28: return "OpTypeArray"; + case 29: return "OpTypeRuntimeArray"; + case 30: return "OpTypeStruct"; + case 31: return "OpTypeOpaque"; + case 32: return "OpTypePointer"; + case 33: return "OpTypeFunction"; + case 34: return "OpTypeEvent"; + case 35: return "OpTypeDeviceEvent"; + case 36: return "OpTypeReserveId"; + case 37: return "OpTypeQueue"; + case 38: return "OpTypePipe"; + case 39: return "OpTypeForwardPointer"; + case 40: return "Bad"; + case 41: return "OpConstantTrue"; + case 42: return "OpConstantFalse"; + case 43: return "OpConstant"; + case 44: return "OpConstantComposite"; + case 45: return "OpConstantSampler"; + case 46: return "OpConstantNull"; + case 47: return "Bad"; + case 48: return "OpSpecConstantTrue"; + case 49: return "OpSpecConstantFalse"; + case 50: return "OpSpecConstant"; + case 51: return "OpSpecConstantComposite"; + case 52: return "OpSpecConstantOp"; + case 53: return "Bad"; + case 54: return "OpFunction"; + case 55: return "OpFunctionParameter"; + case 56: return "OpFunctionEnd"; + case 57: return "OpFunctionCall"; + case 58: return "Bad"; + case 59: return "OpVariable"; + case 60: return "OpImageTexelPointer"; + case 61: return "OpLoad"; + case 62: return "OpStore"; + case 63: return "OpCopyMemory"; + case 64: return "OpCopyMemorySized"; + case 65: return "OpAccessChain"; + case 66: return "OpInBoundsAccessChain"; + case 67: return "OpPtrAccessChain"; + case 68: return "OpArrayLength"; + case 69: return "OpGenericPtrMemSemantics"; + case 70: return "OpInBoundsPtrAccessChain"; + case 71: return "OpDecorate"; + case 72: return "OpMemberDecorate"; + case 73: return "OpDecorationGroup"; + case 74: return "OpGroupDecorate"; + case 75: return "OpGroupMemberDecorate"; + case 76: return "Bad"; + case 77: return "OpVectorExtractDynamic"; + case 78: return "OpVectorInsertDynamic"; + case 79: return "OpVectorShuffle"; + case 80: return "OpCompositeConstruct"; + case 81: return "OpCompositeExtract"; + case 82: return "OpCompositeInsert"; + case 83: return "OpCopyObject"; + case 84: return "OpTranspose"; + case (int)Op::OpCopyLogical: return "OpCopyLogical"; + case 85: return "Bad"; + case 86: return "OpSampledImage"; + case 87: return "OpImageSampleImplicitLod"; + case 88: return "OpImageSampleExplicitLod"; + case 89: return "OpImageSampleDrefImplicitLod"; + case 90: return "OpImageSampleDrefExplicitLod"; + case 91: return "OpImageSampleProjImplicitLod"; + case 92: return "OpImageSampleProjExplicitLod"; + case 93: return "OpImageSampleProjDrefImplicitLod"; + case 94: return "OpImageSampleProjDrefExplicitLod"; + case 95: return "OpImageFetch"; + case 96: return "OpImageGather"; + case 97: return "OpImageDrefGather"; + case 98: return "OpImageRead"; + case 99: return "OpImageWrite"; + case 100: return "OpImage"; + case 101: return "OpImageQueryFormat"; + case 102: return "OpImageQueryOrder"; + case 103: return "OpImageQuerySizeLod"; + case 104: return "OpImageQuerySize"; + case 105: return "OpImageQueryLod"; + case 106: return "OpImageQueryLevels"; + case 107: return "OpImageQuerySamples"; + case 108: return "Bad"; + case 109: return "OpConvertFToU"; + case 110: return "OpConvertFToS"; + case 111: return "OpConvertSToF"; + case 112: return "OpConvertUToF"; + case 113: return "OpUConvert"; + case 114: return "OpSConvert"; + case 115: return "OpFConvert"; + case 116: return "OpQuantizeToF16"; + case 117: return "OpConvertPtrToU"; + case 118: return "OpSatConvertSToU"; + case 119: return "OpSatConvertUToS"; + case 120: return "OpConvertUToPtr"; + case 121: return "OpPtrCastToGeneric"; + case 122: return "OpGenericCastToPtr"; + case 123: return "OpGenericCastToPtrExplicit"; + case 124: return "OpBitcast"; + case 125: return "Bad"; + case 126: return "OpSNegate"; + case 127: return "OpFNegate"; + case 128: return "OpIAdd"; + case 129: return "OpFAdd"; + case 130: return "OpISub"; + case 131: return "OpFSub"; + case 132: return "OpIMul"; + case 133: return "OpFMul"; + case 134: return "OpUDiv"; + case 135: return "OpSDiv"; + case 136: return "OpFDiv"; + case 137: return "OpUMod"; + case 138: return "OpSRem"; + case 139: return "OpSMod"; + case 140: return "OpFRem"; + case 141: return "OpFMod"; + case 142: return "OpVectorTimesScalar"; + case 143: return "OpMatrixTimesScalar"; + case 144: return "OpVectorTimesMatrix"; + case 145: return "OpMatrixTimesVector"; + case 146: return "OpMatrixTimesMatrix"; + case 147: return "OpOuterProduct"; + case 148: return "OpDot"; + case 149: return "OpIAddCarry"; + case 150: return "OpISubBorrow"; + case 151: return "OpUMulExtended"; + case 152: return "OpSMulExtended"; + case 153: return "Bad"; + case 154: return "OpAny"; + case 155: return "OpAll"; + case 156: return "OpIsNan"; + case 157: return "OpIsInf"; + case 158: return "OpIsFinite"; + case 159: return "OpIsNormal"; + case 160: return "OpSignBitSet"; + case 161: return "OpLessOrGreater"; + case 162: return "OpOrdered"; + case 163: return "OpUnordered"; + case 164: return "OpLogicalEqual"; + case 165: return "OpLogicalNotEqual"; + case 166: return "OpLogicalOr"; + case 167: return "OpLogicalAnd"; + case 168: return "OpLogicalNot"; + case 169: return "OpSelect"; + case 170: return "OpIEqual"; + case 171: return "OpINotEqual"; + case 172: return "OpUGreaterThan"; + case 173: return "OpSGreaterThan"; + case 174: return "OpUGreaterThanEqual"; + case 175: return "OpSGreaterThanEqual"; + case 176: return "OpULessThan"; + case 177: return "OpSLessThan"; + case 178: return "OpULessThanEqual"; + case 179: return "OpSLessThanEqual"; + case 180: return "OpFOrdEqual"; + case 181: return "OpFUnordEqual"; + case 182: return "OpFOrdNotEqual"; + case 183: return "OpFUnordNotEqual"; + case 184: return "OpFOrdLessThan"; + case 185: return "OpFUnordLessThan"; + case 186: return "OpFOrdGreaterThan"; + case 187: return "OpFUnordGreaterThan"; + case 188: return "OpFOrdLessThanEqual"; + case 189: return "OpFUnordLessThanEqual"; + case 190: return "OpFOrdGreaterThanEqual"; + case 191: return "OpFUnordGreaterThanEqual"; + case 192: return "Bad"; + case 193: return "Bad"; + case 194: return "OpShiftRightLogical"; + case 195: return "OpShiftRightArithmetic"; + case 196: return "OpShiftLeftLogical"; + case 197: return "OpBitwiseOr"; + case 198: return "OpBitwiseXor"; + case 199: return "OpBitwiseAnd"; + case 200: return "OpNot"; + case 201: return "OpBitFieldInsert"; + case 202: return "OpBitFieldSExtract"; + case 203: return "OpBitFieldUExtract"; + case 204: return "OpBitReverse"; + case 205: return "OpBitCount"; + case 206: return "Bad"; + case 207: return "OpDPdx"; + case 208: return "OpDPdy"; + case 209: return "OpFwidth"; + case 210: return "OpDPdxFine"; + case 211: return "OpDPdyFine"; + case 212: return "OpFwidthFine"; + case 213: return "OpDPdxCoarse"; + case 214: return "OpDPdyCoarse"; + case 215: return "OpFwidthCoarse"; + case 216: return "Bad"; + case 217: return "Bad"; + case 218: return "OpEmitVertex"; + case 219: return "OpEndPrimitive"; + case 220: return "OpEmitStreamVertex"; + case 221: return "OpEndStreamPrimitive"; + case 222: return "Bad"; + case 223: return "Bad"; + case 224: return "OpControlBarrier"; + case 225: return "OpMemoryBarrier"; + case 226: return "Bad"; + case 227: return "OpAtomicLoad"; + case 228: return "OpAtomicStore"; + case 229: return "OpAtomicExchange"; + case 230: return "OpAtomicCompareExchange"; + case 231: return "OpAtomicCompareExchangeWeak"; + case 232: return "OpAtomicIIncrement"; + case 233: return "OpAtomicIDecrement"; + case 234: return "OpAtomicIAdd"; + case 235: return "OpAtomicISub"; + case 236: return "OpAtomicSMin"; + case 237: return "OpAtomicUMin"; + case 238: return "OpAtomicSMax"; + case 239: return "OpAtomicUMax"; + case 240: return "OpAtomicAnd"; + case 241: return "OpAtomicOr"; + case 242: return "OpAtomicXor"; + case 243: return "Bad"; + case 244: return "Bad"; + case 245: return "OpPhi"; + case 246: return "OpLoopMerge"; + case 247: return "OpSelectionMerge"; + case 248: return "OpLabel"; + case 249: return "OpBranch"; + case 250: return "OpBranchConditional"; + case 251: return "OpSwitch"; + case 252: return "OpKill"; + case 253: return "OpReturn"; + case 254: return "OpReturnValue"; + case 255: return "OpUnreachable"; + case 256: return "OpLifetimeStart"; + case 257: return "OpLifetimeStop"; + case 258: return "Bad"; + case 259: return "OpGroupAsyncCopy"; + case 260: return "OpGroupWaitEvents"; + case 261: return "OpGroupAll"; + case 262: return "OpGroupAny"; + case 263: return "OpGroupBroadcast"; + case 264: return "OpGroupIAdd"; + case 265: return "OpGroupFAdd"; + case 266: return "OpGroupFMin"; + case 267: return "OpGroupUMin"; + case 268: return "OpGroupSMin"; + case 269: return "OpGroupFMax"; + case 270: return "OpGroupUMax"; + case 271: return "OpGroupSMax"; + case 272: return "Bad"; + case 273: return "Bad"; + case 274: return "OpReadPipe"; + case 275: return "OpWritePipe"; + case 276: return "OpReservedReadPipe"; + case 277: return "OpReservedWritePipe"; + case 278: return "OpReserveReadPipePackets"; + case 279: return "OpReserveWritePipePackets"; + case 280: return "OpCommitReadPipe"; + case 281: return "OpCommitWritePipe"; + case 282: return "OpIsValidReserveId"; + case 283: return "OpGetNumPipePackets"; + case 284: return "OpGetMaxPipePackets"; + case 285: return "OpGroupReserveReadPipePackets"; + case 286: return "OpGroupReserveWritePipePackets"; + case 287: return "OpGroupCommitReadPipe"; + case 288: return "OpGroupCommitWritePipe"; + case 289: return "Bad"; + case 290: return "Bad"; + case 291: return "OpEnqueueMarker"; + case 292: return "OpEnqueueKernel"; + case 293: return "OpGetKernelNDrangeSubGroupCount"; + case 294: return "OpGetKernelNDrangeMaxSubGroupSize"; + case 295: return "OpGetKernelWorkGroupSize"; + case 296: return "OpGetKernelPreferredWorkGroupSizeMultiple"; + case 297: return "OpRetainEvent"; + case 298: return "OpReleaseEvent"; + case 299: return "OpCreateUserEvent"; + case 300: return "OpIsValidEvent"; + case 301: return "OpSetUserEventStatus"; + case 302: return "OpCaptureEventProfilingInfo"; + case 303: return "OpGetDefaultQueue"; + case 304: return "OpBuildNDRange"; + case 305: return "OpImageSparseSampleImplicitLod"; + case 306: return "OpImageSparseSampleExplicitLod"; + case 307: return "OpImageSparseSampleDrefImplicitLod"; + case 308: return "OpImageSparseSampleDrefExplicitLod"; + case 309: return "OpImageSparseSampleProjImplicitLod"; + case 310: return "OpImageSparseSampleProjExplicitLod"; + case 311: return "OpImageSparseSampleProjDrefImplicitLod"; + case 312: return "OpImageSparseSampleProjDrefExplicitLod"; + case 313: return "OpImageSparseFetch"; + case 314: return "OpImageSparseGather"; + case 315: return "OpImageSparseDrefGather"; + case 316: return "OpImageSparseTexelsResident"; + case 317: return "OpNoLine"; + case 318: return "OpAtomicFlagTestAndSet"; + case 319: return "OpAtomicFlagClear"; + case 320: return "OpImageSparseRead"; + + case (int)Op::OpModuleProcessed: return "OpModuleProcessed"; + case (int)Op::OpExecutionModeId: return "OpExecutionModeId"; + case (int)Op::OpDecorateId: return "OpDecorateId"; + + case 333: return "OpGroupNonUniformElect"; + case 334: return "OpGroupNonUniformAll"; + case 335: return "OpGroupNonUniformAny"; + case 336: return "OpGroupNonUniformAllEqual"; + case 337: return "OpGroupNonUniformBroadcast"; + case 338: return "OpGroupNonUniformBroadcastFirst"; + case 339: return "OpGroupNonUniformBallot"; + case 340: return "OpGroupNonUniformInverseBallot"; + case 341: return "OpGroupNonUniformBallotBitExtract"; + case 342: return "OpGroupNonUniformBallotBitCount"; + case 343: return "OpGroupNonUniformBallotFindLSB"; + case 344: return "OpGroupNonUniformBallotFindMSB"; + case 345: return "OpGroupNonUniformShuffle"; + case 346: return "OpGroupNonUniformShuffleXor"; + case 347: return "OpGroupNonUniformShuffleUp"; + case 348: return "OpGroupNonUniformShuffleDown"; + case 349: return "OpGroupNonUniformIAdd"; + case 350: return "OpGroupNonUniformFAdd"; + case 351: return "OpGroupNonUniformIMul"; + case 352: return "OpGroupNonUniformFMul"; + case 353: return "OpGroupNonUniformSMin"; + case 354: return "OpGroupNonUniformUMin"; + case 355: return "OpGroupNonUniformFMin"; + case 356: return "OpGroupNonUniformSMax"; + case 357: return "OpGroupNonUniformUMax"; + case 358: return "OpGroupNonUniformFMax"; + case 359: return "OpGroupNonUniformBitwiseAnd"; + case 360: return "OpGroupNonUniformBitwiseOr"; + case 361: return "OpGroupNonUniformBitwiseXor"; + case 362: return "OpGroupNonUniformLogicalAnd"; + case 363: return "OpGroupNonUniformLogicalOr"; + case 364: return "OpGroupNonUniformLogicalXor"; + case 365: return "OpGroupNonUniformQuadBroadcast"; + case 366: return "OpGroupNonUniformQuadSwap"; + + case (int)Op::OpTerminateInvocation: return "OpTerminateInvocation"; + + case 4421: return "OpSubgroupBallotKHR"; + case 4422: return "OpSubgroupFirstInvocationKHR"; + case 4428: return "OpSubgroupAllKHR"; + case 4429: return "OpSubgroupAnyKHR"; + case 4430: return "OpSubgroupAllEqualKHR"; + case 4432: return "OpSubgroupReadInvocationKHR"; + case 4433: return "OpExtInstWithForwardRefsKHR"; + + case (int)Op::OpGroupNonUniformQuadAllKHR: return "OpGroupNonUniformQuadAllKHR"; + case (int)Op::OpGroupNonUniformQuadAnyKHR: return "OpGroupNonUniformQuadAnyKHR"; + + case (int)Op::OpAtomicFAddEXT: return "OpAtomicFAddEXT"; + case (int)Op::OpAtomicFMinEXT: return "OpAtomicFMinEXT"; + case (int)Op::OpAtomicFMaxEXT: return "OpAtomicFMaxEXT"; + + case (int)Op::OpAssumeTrueKHR: return "OpAssumeTrueKHR"; + case (int)Op::OpExpectKHR: return "OpExpectKHR"; + + case 5000: return "OpGroupIAddNonUniformAMD"; + case 5001: return "OpGroupFAddNonUniformAMD"; + case 5002: return "OpGroupFMinNonUniformAMD"; + case 5003: return "OpGroupUMinNonUniformAMD"; + case 5004: return "OpGroupSMinNonUniformAMD"; + case 5005: return "OpGroupFMaxNonUniformAMD"; + case 5006: return "OpGroupUMaxNonUniformAMD"; + case 5007: return "OpGroupSMaxNonUniformAMD"; + + case 5011: return "OpFragmentMaskFetchAMD"; + case 5012: return "OpFragmentFetchAMD"; + + case (int)Op::OpReadClockKHR: return "OpReadClockKHR"; + + case (int)Op::OpDecorateStringGOOGLE: return "OpDecorateStringGOOGLE"; + case (int)Op::OpMemberDecorateStringGOOGLE: return "OpMemberDecorateStringGOOGLE"; + + case (int)Op::OpReportIntersectionKHR: return "OpReportIntersectionKHR"; + case (int)Op::OpIgnoreIntersectionNV: return "OpIgnoreIntersectionNV"; + case (int)Op::OpIgnoreIntersectionKHR: return "OpIgnoreIntersectionKHR"; + case (int)Op::OpTerminateRayNV: return "OpTerminateRayNV"; + case (int)Op::OpTerminateRayKHR: return "OpTerminateRayKHR"; + case (int)Op::OpTraceNV: return "OpTraceNV"; + case (int)Op::OpTraceRayMotionNV: return "OpTraceRayMotionNV"; + case (int)Op::OpTraceRayKHR: return "OpTraceRayKHR"; + case (int)Op::OpTypeAccelerationStructureKHR: return "OpTypeAccelerationStructureKHR"; + case (int)Op::OpExecuteCallableNV: return "OpExecuteCallableNV"; + case (int)Op::OpExecuteCallableKHR: return "OpExecuteCallableKHR"; + case (int)Op::OpConvertUToAccelerationStructureKHR: return "OpConvertUToAccelerationStructureKHR"; + + case (int)Op::OpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV"; + case (int)Op::OpImageSampleFootprintNV: return "OpImageSampleFootprintNV"; + case (int)Op::OpWritePackedPrimitiveIndices4x8NV: return "OpWritePackedPrimitiveIndices4x8NV"; + case (int)Op::OpEmitMeshTasksEXT: return "OpEmitMeshTasksEXT"; + case (int)Op::OpSetMeshOutputsEXT: return "OpSetMeshOutputsEXT"; + + case (int)Op::OpGroupNonUniformRotateKHR: return "OpGroupNonUniformRotateKHR"; + + case (int)Op::OpTypeRayQueryKHR: return "OpTypeRayQueryKHR"; + case (int)Op::OpRayQueryInitializeKHR: return "OpRayQueryInitializeKHR"; + case (int)Op::OpRayQueryTerminateKHR: return "OpRayQueryTerminateKHR"; + case (int)Op::OpRayQueryGenerateIntersectionKHR: return "OpRayQueryGenerateIntersectionKHR"; + case (int)Op::OpRayQueryConfirmIntersectionKHR: return "OpRayQueryConfirmIntersectionKHR"; + case (int)Op::OpRayQueryProceedKHR: return "OpRayQueryProceedKHR"; + case (int)Op::OpRayQueryGetIntersectionTypeKHR: return "OpRayQueryGetIntersectionTypeKHR"; + case (int)Op::OpRayQueryGetRayTMinKHR: return "OpRayQueryGetRayTMinKHR"; + case (int)Op::OpRayQueryGetRayFlagsKHR: return "OpRayQueryGetRayFlagsKHR"; + case (int)Op::OpRayQueryGetIntersectionTKHR: return "OpRayQueryGetIntersectionTKHR"; + case (int)Op::OpRayQueryGetIntersectionInstanceCustomIndexKHR: return "OpRayQueryGetIntersectionInstanceCustomIndexKHR"; + case (int)Op::OpRayQueryGetIntersectionInstanceIdKHR: return "OpRayQueryGetIntersectionInstanceIdKHR"; + case (int)Op::OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: return "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR"; + case (int)Op::OpRayQueryGetIntersectionGeometryIndexKHR: return "OpRayQueryGetIntersectionGeometryIndexKHR"; + case (int)Op::OpRayQueryGetIntersectionPrimitiveIndexKHR: return "OpRayQueryGetIntersectionPrimitiveIndexKHR"; + case (int)Op::OpRayQueryGetIntersectionBarycentricsKHR: return "OpRayQueryGetIntersectionBarycentricsKHR"; + case (int)Op::OpRayQueryGetIntersectionFrontFaceKHR: return "OpRayQueryGetIntersectionFrontFaceKHR"; + case (int)Op::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: return "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR"; + case (int)Op::OpRayQueryGetIntersectionObjectRayDirectionKHR: return "OpRayQueryGetIntersectionObjectRayDirectionKHR"; + case (int)Op::OpRayQueryGetIntersectionObjectRayOriginKHR: return "OpRayQueryGetIntersectionObjectRayOriginKHR"; + case (int)Op::OpRayQueryGetWorldRayDirectionKHR: return "OpRayQueryGetWorldRayDirectionKHR"; + case (int)Op::OpRayQueryGetWorldRayOriginKHR: return "OpRayQueryGetWorldRayOriginKHR"; + case (int)Op::OpRayQueryGetIntersectionObjectToWorldKHR: return "OpRayQueryGetIntersectionObjectToWorldKHR"; + case (int)Op::OpRayQueryGetIntersectionWorldToObjectKHR: return "OpRayQueryGetIntersectionWorldToObjectKHR"; + case (int)Op::OpRayQueryGetIntersectionTriangleVertexPositionsKHR: return "OpRayQueryGetIntersectionTriangleVertexPositionsKHR"; + case (int)Op::OpRayQueryGetClusterIdNV: return "OpRayQueryGetIntersectionClusterIdNV"; + + case (int)Op::OpRayQueryGetIntersectionSpherePositionNV: return "OpRayQueryGetIntersectionSpherePositionNV"; + case (int)Op::OpRayQueryGetIntersectionSphereRadiusNV: return "OpRayQueryGetIntersectionSphereRadiusNV"; + case (int)Op::OpRayQueryGetIntersectionLSSHitValueNV: return "OpRayQueryGetIntersectionLSSHitValueNV"; + case (int)Op::OpRayQueryGetIntersectionLSSPositionsNV: return "OpRayQueryGetIntersectionLSSPositionsNV"; + case (int)Op::OpRayQueryGetIntersectionLSSRadiiNV: return "OpRayQueryGetIntersectionLSSRadiiNV"; + case (int)Op::OpRayQueryIsSphereHitNV: return "OpRayQueryIsSphereHitNV"; + case (int)Op::OpRayQueryIsLSSHitNV: return "OpRayQueryIsLSSHitNV"; + + case (int)Op::OpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV"; + case (int)Op::OpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV"; + case (int)Op::OpCooperativeMatrixStoreNV: return "OpCooperativeMatrixStoreNV"; + case (int)Op::OpCooperativeMatrixMulAddNV: return "OpCooperativeMatrixMulAddNV"; + case (int)Op::OpCooperativeMatrixLengthNV: return "OpCooperativeMatrixLengthNV"; + case (int)Op::OpTypeCooperativeMatrixKHR: return "OpTypeCooperativeMatrixKHR"; + case (int)Op::OpCooperativeMatrixLoadKHR: return "OpCooperativeMatrixLoadKHR"; + case (int)Op::OpCooperativeMatrixStoreKHR: return "OpCooperativeMatrixStoreKHR"; + case (int)Op::OpCooperativeMatrixMulAddKHR: return "OpCooperativeMatrixMulAddKHR"; + case (int)Op::OpCooperativeMatrixLengthKHR: return "OpCooperativeMatrixLengthKHR"; + case (int)Op::OpDemoteToHelperInvocationEXT: return "OpDemoteToHelperInvocationEXT"; + case (int)Op::OpIsHelperInvocationEXT: return "OpIsHelperInvocationEXT"; + + case (int)Op::OpCooperativeMatrixConvertNV: return "OpCooperativeMatrixConvertNV"; + case (int)Op::OpCooperativeMatrixTransposeNV: return "OpCooperativeMatrixTransposeNV"; + case (int)Op::OpCooperativeMatrixReduceNV: return "OpCooperativeMatrixReduceNV"; + case (int)Op::OpCooperativeMatrixLoadTensorNV: return "OpCooperativeMatrixLoadTensorNV"; + case (int)Op::OpCooperativeMatrixStoreTensorNV: return "OpCooperativeMatrixStoreTensorNV"; + case (int)Op::OpCooperativeMatrixPerElementOpNV: return "OpCooperativeMatrixPerElementOpNV"; + case (int)Op::OpTypeTensorLayoutNV: return "OpTypeTensorLayoutNV"; + case (int)Op::OpTypeTensorViewNV: return "OpTypeTensorViewNV"; + case (int)Op::OpCreateTensorLayoutNV: return "OpCreateTensorLayoutNV"; + case (int)Op::OpTensorLayoutSetBlockSizeNV: return "OpTensorLayoutSetBlockSizeNV"; + case (int)Op::OpTensorLayoutSetDimensionNV: return "OpTensorLayoutSetDimensionNV"; + case (int)Op::OpTensorLayoutSetStrideNV: return "OpTensorLayoutSetStrideNV"; + case (int)Op::OpTensorLayoutSliceNV: return "OpTensorLayoutSliceNV"; + case (int)Op::OpTensorLayoutSetClampValueNV: return "OpTensorLayoutSetClampValueNV"; + case (int)Op::OpCreateTensorViewNV: return "OpCreateTensorViewNV"; + case (int)Op::OpTensorViewSetDimensionNV: return "OpTensorViewSetDimensionNV"; + case (int)Op::OpTensorViewSetStrideNV: return "OpTensorViewSetStrideNV"; + case (int)Op::OpTensorViewSetClipNV: return "OpTensorViewSetClipNV"; + + case (int)Op::OpTypeTensorARM: return "OpTypeTensorARM"; + case (int)Op::OpTensorReadARM: return "OpTensorReadARM"; + case (int)Op::OpTensorWriteARM: return "OpTensorWriteARM"; + case (int)Op::OpTensorQuerySizeARM: return "OpTensorQuerySizeARM"; + + case (int)Op::OpTypeCooperativeVectorNV: return "OpTypeCooperativeVectorNV"; + case (int)Op::OpCooperativeVectorMatrixMulNV: return "OpCooperativeVectorMatrixMulNV"; + case (int)Op::OpCooperativeVectorMatrixMulAddNV: return "OpCooperativeVectorMatrixMulAddNV"; + case (int)Op::OpCooperativeVectorLoadNV: return "OpCooperativeVectorLoadNV"; + case (int)Op::OpCooperativeVectorStoreNV: return "OpCooperativeVectorStoreNV"; + case (int)Op::OpCooperativeVectorOuterProductAccumulateNV: return "OpCooperativeVectorOuterProductAccumulateNV"; + case (int)Op::OpCooperativeVectorReduceSumAccumulateNV: return "OpCooperativeVectorReduceSumAccumulateNV"; + + case (int)Op::OpBeginInvocationInterlockEXT: return "OpBeginInvocationInterlockEXT"; + case (int)Op::OpEndInvocationInterlockEXT: return "OpEndInvocationInterlockEXT"; + + case (int)Op::OpTypeHitObjectNV: return "OpTypeHitObjectNV"; + case (int)Op::OpHitObjectTraceRayNV: return "OpHitObjectTraceRayNV"; + case (int)Op::OpHitObjectTraceRayMotionNV: return "OpHitObjectTraceRayMotionNV"; + case (int)Op::OpHitObjectRecordHitNV: return "OpHitObjectRecordHitNV"; + case (int)Op::OpHitObjectRecordHitMotionNV: return "OpHitObjectRecordHitMotionNV"; + case (int)Op::OpHitObjectRecordHitWithIndexNV: return "OpHitObjectRecordHitWithIndexNV"; + case (int)Op::OpHitObjectRecordHitWithIndexMotionNV: return "OpHitObjectRecordHitWithIndexMotionNV"; + case (int)Op::OpHitObjectRecordMissNV: return "OpHitObjectRecordMissNV"; + case (int)Op::OpHitObjectRecordMissMotionNV: return "OpHitObjectRecordMissMotionNV"; + case (int)Op::OpHitObjectRecordEmptyNV: return "OpHitObjectRecordEmptyNV"; + case (int)Op::OpHitObjectExecuteShaderNV: return "OpHitObjectExecuteShaderNV"; + case (int)Op::OpReorderThreadWithHintNV: return "OpReorderThreadWithHintNV"; + case (int)Op::OpReorderThreadWithHitObjectNV: return "OpReorderThreadWithHitObjectNV"; + case (int)Op::OpHitObjectGetCurrentTimeNV: return "OpHitObjectGetCurrentTimeNV"; + case (int)Op::OpHitObjectGetAttributesNV: return "OpHitObjectGetAttributesNV"; + case (int)Op::OpHitObjectGetHitKindNV: return "OpHitObjectGetFrontFaceNV"; + case (int)Op::OpHitObjectGetPrimitiveIndexNV: return "OpHitObjectGetPrimitiveIndexNV"; + case (int)Op::OpHitObjectGetGeometryIndexNV: return "OpHitObjectGetGeometryIndexNV"; + case (int)Op::OpHitObjectGetInstanceIdNV: return "OpHitObjectGetInstanceIdNV"; + case (int)Op::OpHitObjectGetInstanceCustomIndexNV: return "OpHitObjectGetInstanceCustomIndexNV"; + case (int)Op::OpHitObjectGetObjectRayDirectionNV: return "OpHitObjectGetObjectRayDirectionNV"; + case (int)Op::OpHitObjectGetObjectRayOriginNV: return "OpHitObjectGetObjectRayOriginNV"; + case (int)Op::OpHitObjectGetWorldRayDirectionNV: return "OpHitObjectGetWorldRayDirectionNV"; + case (int)Op::OpHitObjectGetWorldRayOriginNV: return "OpHitObjectGetWorldRayOriginNV"; + case (int)Op::OpHitObjectGetWorldToObjectNV: return "OpHitObjectGetWorldToObjectNV"; + case (int)Op::OpHitObjectGetObjectToWorldNV: return "OpHitObjectGetObjectToWorldNV"; + case (int)Op::OpHitObjectGetRayTMaxNV: return "OpHitObjectGetRayTMaxNV"; + case (int)Op::OpHitObjectGetRayTMinNV: return "OpHitObjectGetRayTMinNV"; + case (int)Op::OpHitObjectIsEmptyNV: return "OpHitObjectIsEmptyNV"; + case (int)Op::OpHitObjectIsHitNV: return "OpHitObjectIsHitNV"; + case (int)Op::OpHitObjectIsMissNV: return "OpHitObjectIsMissNV"; + case (int)Op::OpHitObjectGetShaderBindingTableRecordIndexNV: return "OpHitObjectGetShaderBindingTableRecordIndexNV"; + case (int)Op::OpHitObjectGetShaderRecordBufferHandleNV: return "OpHitObjectGetShaderRecordBufferHandleNV"; + case (int)Op::OpHitObjectGetClusterIdNV: return "OpHitObjectGetClusterIdNV"; + case (int)Op::OpHitObjectGetSpherePositionNV: return "OpHitObjectGetSpherePositionNV"; + case (int)Op::OpHitObjectGetSphereRadiusNV: return "OpHitObjectGetSphereRadiusNV"; + case (int)Op::OpHitObjectGetLSSPositionsNV: return "OpHitObjectGetLSSPositionsNV"; + case (int)Op::OpHitObjectGetLSSRadiiNV: return "OpHitObjectGetLSSRadiiNV"; + case (int)Op::OpHitObjectIsSphereHitNV: return "OpHitObjectIsSphereHitNV"; + case (int)Op::OpHitObjectIsLSSHitNV: return "OpHitObjectIsLSSHitNV"; + + case (int)Op::OpFetchMicroTriangleVertexBarycentricNV: return "OpFetchMicroTriangleVertexBarycentricNV"; + case (int)Op::OpFetchMicroTriangleVertexPositionNV: return "OpFetchMicroTriangleVertexPositionNV"; + + case (int)Op::OpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT"; + case (int)Op::OpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT"; + case (int)Op::OpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT"; + + case (int)Op::OpImageSampleWeightedQCOM: return "OpImageSampleWeightedQCOM"; + case (int)Op::OpImageBoxFilterQCOM: return "OpImageBoxFilterQCOM"; + case (int)Op::OpImageBlockMatchSADQCOM: return "OpImageBlockMatchSADQCOM"; + case (int)Op::OpImageBlockMatchSSDQCOM: return "OpImageBlockMatchSSDQCOM"; + case (int)Op::OpImageBlockMatchWindowSSDQCOM: return "OpImageBlockMatchWindowSSDQCOM"; + case (int)Op::OpImageBlockMatchWindowSADQCOM: return "OpImageBlockMatchWindowSADQCOM"; + case (int)Op::OpImageBlockMatchGatherSSDQCOM: return "OpImageBlockMatchGatherSSDQCOM"; + case (int)Op::OpImageBlockMatchGatherSADQCOM: return "OpImageBlockMatchGatherSADQCOM"; + + case (int)Op::OpBitCastArrayQCOM: return "OpBitCastArrayQCOM"; + case (int)Op::OpCompositeConstructCoopMatQCOM: return "OpCompositeConstructCoopMatQCOM"; + case (int)Op::OpCompositeExtractCoopMatQCOM: return "OpCompositeExtractCoopMatQCOM"; + case (int)Op::OpExtractSubArrayQCOM: return "OpExtractSubArrayQCOM"; + + case (int)Op::OpConstantCompositeReplicateEXT: return "OpConstantCompositeReplicateEXT"; + case (int)Op::OpSpecConstantCompositeReplicateEXT: return "OpSpecConstantCompositeReplicateEXT"; + case (int)Op::OpCompositeConstructReplicateEXT: return "OpCompositeConstructReplicateEXT"; + + case (int)Op::OpSDotKHR: return "OpSDotKHR"; + case (int)Op::OpUDotKHR: return "OpUDotKHR"; + case (int)Op::OpSUDotKHR: return "OpSUDotKHR"; + case (int)Op::OpSDotAccSatKHR: return "OpSDotAccSatKHR"; + case (int)Op::OpUDotAccSatKHR: return "OpUDotAccSatKHR"; + case (int)Op::OpSUDotAccSatKHR: return "OpSUDotAccSatKHR"; + + case (int)Op::OpTypeHitObjectEXT: return "OpTypeHitObjectEXT"; + case (int)Op::OpHitObjectTraceRayEXT: return "OpHitObjectTraceRayEXT"; + case (int)Op::OpHitObjectTraceRayMotionEXT: return "OpHitObjectTraceRayMotionEXT"; + case (int)Op::OpHitObjectRecordMissEXT: return "OpHitObjectRecordMissEXT"; + case (int)Op::OpHitObjectRecordMissMotionEXT: return "OpHitObjectRecordMissMotionEXT"; + case (int)Op::OpHitObjectRecordEmptyEXT: return "OpHitObjectRecordEmptyEXT"; + case (int)Op::OpHitObjectExecuteShaderEXT: return "OpHitObjectExecuteShaderEXT"; + case (int)Op::OpReorderThreadWithHintEXT: return "OpReorderThreadWithHintEXT"; + case (int)Op::OpReorderThreadWithHitObjectEXT: return "OpReorderThreadWithHitObjectEXT"; + case (int)Op::OpHitObjectGetCurrentTimeEXT: return "OpHitObjectGetCurrentTimeEXT"; + case (int)Op::OpHitObjectGetAttributesEXT: return "OpHitObjectGetAttributesEXT"; + case (int)Op::OpHitObjectGetHitKindEXT: return "OpHitObjectGetHitKindEXT"; + case (int)Op::OpHitObjectGetPrimitiveIndexEXT: return "OpHitObjectGetPrimitiveIndexEXT"; + case (int)Op::OpHitObjectGetGeometryIndexEXT: return "OpHitObjectGetGeometryIndexEXT"; + case (int)Op::OpHitObjectGetInstanceIdEXT: return "OpHitObjectGetInstanceIdEXT"; + case (int)Op::OpHitObjectGetInstanceCustomIndexEXT: return "OpHitObjectGetInstanceCustomIndexEXT"; + case (int)Op::OpHitObjectGetObjectRayDirectionEXT: return "OpHitObjectGetObjectRayDirectionEXT"; + case (int)Op::OpHitObjectGetObjectRayOriginEXT: return "OpHitObjectGetObjectRayOriginEXT"; + case (int)Op::OpHitObjectGetWorldRayDirectionEXT: return "OpHitObjectGetWorldRayDirectionEXT"; + case (int)Op::OpHitObjectGetWorldRayOriginEXT: return "OpHitObjectGetWorldRayOriginEXT"; + case (int)Op::OpHitObjectGetWorldToObjectEXT: return "OpHitObjectGetWorldToObjectEXT"; + case (int)Op::OpHitObjectGetObjectToWorldEXT: return "OpHitObjectGetObjectToWorldEXT"; + case (int)Op::OpHitObjectGetRayTMaxEXT: return "OpHitObjectGetRayTMaxEXT"; + case (int)Op::OpHitObjectGetRayTMinEXT: return "OpHitObjectGetRayTMinEXT"; + case (int)Op::OpHitObjectGetRayFlagsEXT: return "OpHitObjectGetRayFlagsEXT"; + case (int)Op::OpHitObjectIsEmptyEXT: return "OpHitObjectIsEmptyEXT"; + case (int)Op::OpHitObjectIsHitEXT: return "OpHitObjectIsHitEXT"; + case (int)Op::OpHitObjectIsMissEXT: return "OpHitObjectIsMissEXT"; + case (int)Op::OpHitObjectGetShaderBindingTableRecordIndexEXT: return "OpHitObjectGetShaderBindingTableRecordIndexEXT"; + case (int)Op::OpHitObjectGetShaderRecordBufferHandleEXT: return "OpHitObjectGetShaderRecordBufferHandleEXT"; + case (int)Op::OpHitObjectSetShaderBindingTableRecordIndexEXT: return "OpHitObjectSetShaderBindingTableRecordIndexEXT"; + case (int)Op::OpHitObjectReorderExecuteShaderEXT: return "OpHitObjectReorderExecuteEXT"; + case (int)Op::OpHitObjectTraceReorderExecuteEXT: return "OpHitObjectTraceReorderExecuteEXT"; + case (int)Op::OpHitObjectTraceMotionReorderExecuteEXT: return "OpHitObjectTraceMotionReorderExecuteEXT"; + case (int)Op::OpHitObjectRecordFromQueryEXT: return "OpHitObjectRecordFromQueryEXT"; + case (int)Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT: return "OpHitObjectGetIntersectionTriangleVertexPositionsEXT"; + + default: + return "Bad"; + } +} + +// The set of objects that hold all the instruction/operand +// parameterization information. +InstructionParameters InstructionDesc[OpCodeMask + 1]; +OperandParameters ExecutionModeOperands[ExecutionModeCeiling]; +OperandParameters DecorationOperands[DecorationCeiling]; + +EnumDefinition OperandClassParams[OperandCount]; +EnumParameters ExecutionModeParams[ExecutionModeCeiling]; +EnumParameters ImageOperandsParams[ImageOperandsCeiling]; +EnumParameters DecorationParams[DecorationCeiling]; +EnumParameters LoopControlParams[FunctionControlCeiling]; +EnumParameters SelectionControlParams[SelectControlCeiling]; +EnumParameters FunctionControlParams[FunctionControlCeiling]; +EnumParameters MemoryAccessParams[MemoryAccessCeiling]; +EnumParameters CooperativeMatrixOperandsParams[CooperativeMatrixOperandsCeiling]; +EnumParameters TensorAddressingOperandsParams[TensorAddressingOperandsCeiling]; + +// Set up all the parameterizing descriptions of the opcodes, operands, etc. +void Parameterize() +{ + // only do this once. + static std::once_flag initialized; + std::call_once(initialized, [](){ + + // Exceptions to having a result and a resulting type . + // (Everything is initialized to have both). + + InstructionDesc[enumCast(Op::OpNop)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpSource)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpSourceContinued)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpSourceExtension)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpExtension)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpExtInstImport)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpCapability)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpMemoryModel)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpEntryPoint)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpExecutionMode)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpExecutionModeId)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpTypeVoid)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeBool)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeInt)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeFloat)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeVector)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeMatrix)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeImage)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeSampler)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeSampledImage)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeArray)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeRuntimeArray)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeStruct)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeOpaque)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypePointer)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeForwardPointer)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpTypeFunction)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeEvent)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeDeviceEvent)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeReserveId)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeQueue)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypePipe)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpFunctionEnd)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpStore)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpImageWrite)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpDecorationGroup)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpDecorate)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpDecorateId)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpDecorateStringGOOGLE)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpMemberDecorate)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpMemberDecorateStringGOOGLE)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpGroupDecorate)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpGroupMemberDecorate)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpName)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpMemberName)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpString)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpLine)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpNoLine)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpCopyMemory)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpCopyMemorySized)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpEmitVertex)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpEndPrimitive)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpEmitStreamVertex)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpEndStreamPrimitive)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpControlBarrier)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpMemoryBarrier)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpAtomicStore)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpLoopMerge)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpSelectionMerge)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpLabel)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpBranch)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpBranchConditional)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpSwitch)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpKill)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpTerminateInvocation)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpReturn)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpReturnValue)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpUnreachable)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpLifetimeStart)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpLifetimeStop)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpCommitReadPipe)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpCommitWritePipe)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpGroupCommitWritePipe)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpGroupCommitReadPipe)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpCaptureEventProfilingInfo)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpSetUserEventStatus)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpRetainEvent)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpReleaseEvent)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpGroupWaitEvents)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpAtomicFlagClear)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpModuleProcessed)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpTypeCooperativeMatrixNV)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreNV)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpTypeCooperativeMatrixKHR)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreKHR)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpBeginInvocationInterlockEXT)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpEndInvocationInterlockEXT)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpAssumeTrueKHR)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpTypeTensorLayoutNV)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeTensorViewNV)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreTensorNV)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpTypeCooperativeVectorNV)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpCooperativeVectorStoreNV)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpCooperativeVectorOuterProductAccumulateNV)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpCooperativeVectorReduceSumAccumulateNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpTypeTensorARM)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTensorReadARM)].setResultAndType(true, true); + InstructionDesc[enumCast(Op::OpTensorWriteARM)].setResultAndType(false, false); + + // Specific additional context-dependent operands + + ExecutionModeOperands[enumCast(ExecutionMode::Invocations)].push(OperandLiteralNumber, "'Number of <>'"); + + ExecutionModeOperands[enumCast(ExecutionMode::LocalSize)].push(OperandLiteralNumber, "'x size'"); + ExecutionModeOperands[enumCast(ExecutionMode::LocalSize)].push(OperandLiteralNumber, "'y size'"); + ExecutionModeOperands[enumCast(ExecutionMode::LocalSize)].push(OperandLiteralNumber, "'z size'"); + + ExecutionModeOperands[enumCast(ExecutionMode::LocalSizeHint)].push(OperandLiteralNumber, "'x size'"); + ExecutionModeOperands[enumCast(ExecutionMode::LocalSizeHint)].push(OperandLiteralNumber, "'y size'"); + ExecutionModeOperands[enumCast(ExecutionMode::LocalSizeHint)].push(OperandLiteralNumber, "'z size'"); + + ExecutionModeOperands[enumCast(ExecutionMode::OutputVertices)].push(OperandLiteralNumber, "'Vertex count'"); + ExecutionModeOperands[enumCast(ExecutionMode::VecTypeHint)].push(OperandLiteralNumber, "'Vector type'"); + + DecorationOperands[enumCast(Decoration::Stream)].push(OperandLiteralNumber, "'Stream Number'"); + DecorationOperands[enumCast(Decoration::Location)].push(OperandLiteralNumber, "'Location'"); + DecorationOperands[enumCast(Decoration::Component)].push(OperandLiteralNumber, "'Component'"); + DecorationOperands[enumCast(Decoration::Index)].push(OperandLiteralNumber, "'Index'"); + DecorationOperands[enumCast(Decoration::Binding)].push(OperandLiteralNumber, "'Binding Point'"); + DecorationOperands[enumCast(Decoration::DescriptorSet)].push(OperandLiteralNumber, "'Descriptor Set'"); + DecorationOperands[enumCast(Decoration::Offset)].push(OperandLiteralNumber, "'Byte Offset'"); + DecorationOperands[enumCast(Decoration::XfbBuffer)].push(OperandLiteralNumber, "'XFB Buffer Number'"); + DecorationOperands[enumCast(Decoration::XfbStride)].push(OperandLiteralNumber, "'XFB Stride'"); + DecorationOperands[enumCast(Decoration::ArrayStride)].push(OperandLiteralNumber, "'Array Stride'"); + DecorationOperands[enumCast(Decoration::MatrixStride)].push(OperandLiteralNumber, "'Matrix Stride'"); + DecorationOperands[enumCast(Decoration::BuiltIn)].push(OperandLiteralNumber, "See <>"); + DecorationOperands[enumCast(Decoration::FPRoundingMode)].push(OperandFPRoundingMode, "'Floating-Point Rounding Mode'"); + DecorationOperands[enumCast(Decoration::FPFastMathMode)].push(OperandFPFastMath, "'Fast-Math Mode'"); + DecorationOperands[enumCast(Decoration::LinkageAttributes)].push(OperandLiteralString, "'Name'"); + DecorationOperands[enumCast(Decoration::LinkageAttributes)].push(OperandLinkageType, "'Linkage Type'"); + DecorationOperands[enumCast(Decoration::FuncParamAttr)].push(OperandFuncParamAttr, "'Function Parameter Attribute'"); + DecorationOperands[enumCast(Decoration::SpecId)].push(OperandLiteralNumber, "'Specialization Constant ID'"); + DecorationOperands[enumCast(Decoration::InputAttachmentIndex)].push(OperandLiteralNumber, "'Attachment Index'"); + DecorationOperands[enumCast(Decoration::Alignment)].push(OperandLiteralNumber, "'Alignment'"); + + OperandClassParams[OperandSource].set(0, SourceString, nullptr); + OperandClassParams[OperandExecutionModel].set(0, ExecutionModelString, nullptr); + OperandClassParams[OperandAddressing].set(0, AddressingString, nullptr); + OperandClassParams[OperandMemory].set(0, MemoryString, nullptr); + OperandClassParams[OperandExecutionMode].set(ExecutionModeCeiling, ExecutionModeString, ExecutionModeParams); + OperandClassParams[OperandExecutionMode].setOperands(ExecutionModeOperands); + OperandClassParams[OperandStorage].set(0, StorageClassString, nullptr); + OperandClassParams[OperandDimensionality].set(0, DimensionString, nullptr); + OperandClassParams[OperandSamplerAddressingMode].set(0, SamplerAddressingModeString, nullptr); + OperandClassParams[OperandSamplerFilterMode].set(0, SamplerFilterModeString, nullptr); + OperandClassParams[OperandSamplerImageFormat].set(0, ImageFormatString, nullptr); + OperandClassParams[OperandImageChannelOrder].set(0, ImageChannelOrderString, nullptr); + OperandClassParams[OperandImageChannelDataType].set(0, ImageChannelDataTypeString, nullptr); + OperandClassParams[OperandImageOperands].set(ImageOperandsCeiling, ImageOperandsString, ImageOperandsParams, true); + OperandClassParams[OperandFPFastMath].set(0, FPFastMathString, nullptr, true); + OperandClassParams[OperandFPRoundingMode].set(0, FPRoundingModeString, nullptr); + OperandClassParams[OperandLinkageType].set(0, LinkageTypeString, nullptr); + OperandClassParams[OperandFuncParamAttr].set(0, FuncParamAttrString, nullptr); + OperandClassParams[OperandAccessQualifier].set(0, AccessQualifierString, nullptr); + OperandClassParams[OperandDecoration].set(DecorationCeiling, DecorationString, DecorationParams); + OperandClassParams[OperandDecoration].setOperands(DecorationOperands); + OperandClassParams[OperandBuiltIn].set(0, BuiltInString, nullptr); + OperandClassParams[OperandSelect].set(SelectControlCeiling, SelectControlString, SelectionControlParams, true); + OperandClassParams[OperandLoop].set(LoopControlCeiling, LoopControlString, LoopControlParams, true); + OperandClassParams[OperandFunction].set(FunctionControlCeiling, FunctionControlString, FunctionControlParams, true); + OperandClassParams[OperandMemorySemantics].set(0, MemorySemanticsString, nullptr, true); + OperandClassParams[OperandMemoryAccess].set(MemoryAccessCeiling, MemoryAccessString, MemoryAccessParams, true); + OperandClassParams[OperandScope].set(0, ScopeString, nullptr); + OperandClassParams[OperandGroupOperation].set(0, GroupOperationString, nullptr); + OperandClassParams[OperandKernelEnqueueFlags].set(0, KernelEnqueueFlagsString, nullptr); + OperandClassParams[OperandKernelProfilingInfo].set(0, KernelProfilingInfoString, nullptr, true); + OperandClassParams[OperandCapability].set(0, CapabilityString, nullptr); + OperandClassParams[OperandCooperativeMatrixOperands].set(CooperativeMatrixOperandsCeiling, CooperativeMatrixOperandsString, CooperativeMatrixOperandsParams, true); + OperandClassParams[OperandTensorAddressingOperands].set(TensorAddressingOperandsCeiling, TensorAddressingOperandsString, TensorAddressingOperandsParams, true); + OperandClassParams[OperandOpcode].set(OpCodeMask + 1, OpcodeString, nullptr); + + // set name of operator, an initial set of style operands, and the description + + InstructionDesc[enumCast(Op::OpSource)].operands.push(OperandSource, ""); + InstructionDesc[enumCast(Op::OpSource)].operands.push(OperandLiteralNumber, "'Version'"); + InstructionDesc[enumCast(Op::OpSource)].operands.push(OperandId, "'File'", true); + InstructionDesc[enumCast(Op::OpSource)].operands.push(OperandLiteralString, "'Source'", true); + + InstructionDesc[enumCast(Op::OpSourceContinued)].operands.push(OperandLiteralString, "'Continued Source'"); + + InstructionDesc[enumCast(Op::OpSourceExtension)].operands.push(OperandLiteralString, "'Extension'"); + + InstructionDesc[enumCast(Op::OpName)].operands.push(OperandId, "'Target'"); + InstructionDesc[enumCast(Op::OpName)].operands.push(OperandLiteralString, "'Name'"); + + InstructionDesc[enumCast(Op::OpMemberName)].operands.push(OperandId, "'Type'"); + InstructionDesc[enumCast(Op::OpMemberName)].operands.push(OperandLiteralNumber, "'Member'"); + InstructionDesc[enumCast(Op::OpMemberName)].operands.push(OperandLiteralString, "'Name'"); + + InstructionDesc[enumCast(Op::OpString)].operands.push(OperandLiteralString, "'String'"); + + InstructionDesc[enumCast(Op::OpLine)].operands.push(OperandId, "'File'"); + InstructionDesc[enumCast(Op::OpLine)].operands.push(OperandLiteralNumber, "'Line'"); + InstructionDesc[enumCast(Op::OpLine)].operands.push(OperandLiteralNumber, "'Column'"); + + InstructionDesc[enumCast(Op::OpExtension)].operands.push(OperandLiteralString, "'Name'"); + + InstructionDesc[enumCast(Op::OpExtInstImport)].operands.push(OperandLiteralString, "'Name'"); + + InstructionDesc[enumCast(Op::OpCapability)].operands.push(OperandCapability, "'Capability'"); + + InstructionDesc[enumCast(Op::OpMemoryModel)].operands.push(OperandAddressing, ""); + InstructionDesc[enumCast(Op::OpMemoryModel)].operands.push(OperandMemory, ""); + + InstructionDesc[enumCast(Op::OpEntryPoint)].operands.push(OperandExecutionModel, ""); + InstructionDesc[enumCast(Op::OpEntryPoint)].operands.push(OperandId, "'Entry Point'"); + InstructionDesc[enumCast(Op::OpEntryPoint)].operands.push(OperandLiteralString, "'Name'"); + InstructionDesc[enumCast(Op::OpEntryPoint)].operands.push(OperandVariableIds, "'Interface'"); + + InstructionDesc[enumCast(Op::OpExecutionMode)].operands.push(OperandId, "'Entry Point'"); + InstructionDesc[enumCast(Op::OpExecutionMode)].operands.push(OperandExecutionMode, "'Mode'"); + InstructionDesc[enumCast(Op::OpExecutionMode)].operands.push(OperandOptionalLiteral, "See <>"); + + InstructionDesc[enumCast(Op::OpExecutionModeId)].operands.push(OperandId, "'Entry Point'"); + InstructionDesc[enumCast(Op::OpExecutionModeId)].operands.push(OperandExecutionMode, "'Mode'"); + InstructionDesc[enumCast(Op::OpExecutionModeId)].operands.push(OperandVariableIds, "See <>"); + + InstructionDesc[enumCast(Op::OpTypeInt)].operands.push(OperandLiteralNumber, "'Width'"); + InstructionDesc[enumCast(Op::OpTypeInt)].operands.push(OperandLiteralNumber, "'Signedness'"); + + InstructionDesc[enumCast(Op::OpTypeFloat)].operands.push(OperandLiteralNumber, "'Width'"); + InstructionDesc[enumCast(Op::OpTypeFloat)].operands.push(OperandOptionalLiteral, "'FP Encoding'"); + + InstructionDesc[enumCast(Op::OpTypeVector)].operands.push(OperandId, "'Component Type'"); + InstructionDesc[enumCast(Op::OpTypeVector)].operands.push(OperandLiteralNumber, "'Component Count'"); + + InstructionDesc[enumCast(Op::OpTypeMatrix)].operands.push(OperandId, "'Column Type'"); + InstructionDesc[enumCast(Op::OpTypeMatrix)].operands.push(OperandLiteralNumber, "'Column Count'"); + + InstructionDesc[enumCast(Op::OpTypeImage)].operands.push(OperandId, "'Sampled Type'"); + InstructionDesc[enumCast(Op::OpTypeImage)].operands.push(OperandDimensionality, ""); + InstructionDesc[enumCast(Op::OpTypeImage)].operands.push(OperandLiteralNumber, "'Depth'"); + InstructionDesc[enumCast(Op::OpTypeImage)].operands.push(OperandLiteralNumber, "'Arrayed'"); + InstructionDesc[enumCast(Op::OpTypeImage)].operands.push(OperandLiteralNumber, "'MS'"); + InstructionDesc[enumCast(Op::OpTypeImage)].operands.push(OperandLiteralNumber, "'Sampled'"); + InstructionDesc[enumCast(Op::OpTypeImage)].operands.push(OperandSamplerImageFormat, ""); + InstructionDesc[enumCast(Op::OpTypeImage)].operands.push(OperandAccessQualifier, "", true); + + InstructionDesc[enumCast(Op::OpTypeSampledImage)].operands.push(OperandId, "'Image Type'"); + + InstructionDesc[enumCast(Op::OpTypeArray)].operands.push(OperandId, "'Element Type'"); + InstructionDesc[enumCast(Op::OpTypeArray)].operands.push(OperandId, "'Length'"); + + InstructionDesc[enumCast(Op::OpTypeRuntimeArray)].operands.push(OperandId, "'Element Type'"); + + InstructionDesc[enumCast(Op::OpTypeStruct)].operands.push(OperandVariableIds, "'Member 0 type', +\n'member 1 type', +\n..."); + + InstructionDesc[enumCast(Op::OpTypeOpaque)].operands.push(OperandLiteralString, "The name of the opaque type."); + + InstructionDesc[enumCast(Op::OpTypePointer)].operands.push(OperandStorage, ""); + InstructionDesc[enumCast(Op::OpTypePointer)].operands.push(OperandId, "'Type'"); + + InstructionDesc[enumCast(Op::OpTypeForwardPointer)].operands.push(OperandId, "'Pointer Type'"); + InstructionDesc[enumCast(Op::OpTypeForwardPointer)].operands.push(OperandStorage, ""); + + InstructionDesc[enumCast(Op::OpTypePipe)].operands.push(OperandAccessQualifier, "'Qualifier'"); + + InstructionDesc[enumCast(Op::OpTypeFunction)].operands.push(OperandId, "'Return Type'"); + InstructionDesc[enumCast(Op::OpTypeFunction)].operands.push(OperandVariableIds, "'Parameter 0 Type', +\n'Parameter 1 Type', +\n..."); + + InstructionDesc[enumCast(Op::OpConstant)].operands.push(OperandVariableLiterals, "'Value'"); + + InstructionDesc[enumCast(Op::OpConstantComposite)].operands.push(OperandVariableIds, "'Constituents'"); + + InstructionDesc[enumCast(Op::OpConstantSampler)].operands.push(OperandSamplerAddressingMode, ""); + InstructionDesc[enumCast(Op::OpConstantSampler)].operands.push(OperandLiteralNumber, "'Param'"); + InstructionDesc[enumCast(Op::OpConstantSampler)].operands.push(OperandSamplerFilterMode, ""); + + InstructionDesc[enumCast(Op::OpSpecConstant)].operands.push(OperandVariableLiterals, "'Value'"); + + InstructionDesc[enumCast(Op::OpSpecConstantComposite)].operands.push(OperandVariableIds, "'Constituents'"); + + InstructionDesc[enumCast(Op::OpSpecConstantOp)].operands.push(OperandLiteralNumber, "'Opcode'"); + InstructionDesc[enumCast(Op::OpSpecConstantOp)].operands.push(OperandVariableIds, "'Operands'"); + + InstructionDesc[enumCast(Op::OpVariable)].operands.push(OperandStorage, ""); + InstructionDesc[enumCast(Op::OpVariable)].operands.push(OperandId, "'Initializer'", true); + + InstructionDesc[enumCast(Op::OpFunction)].operands.push(OperandFunction, ""); + InstructionDesc[enumCast(Op::OpFunction)].operands.push(OperandId, "'Function Type'"); + + InstructionDesc[enumCast(Op::OpFunctionCall)].operands.push(OperandId, "'Function'"); + InstructionDesc[enumCast(Op::OpFunctionCall)].operands.push(OperandVariableIds, "'Argument 0', +\n'Argument 1', +\n..."); + + InstructionDesc[enumCast(Op::OpExtInst)].operands.push(OperandId, "'Set'"); + InstructionDesc[enumCast(Op::OpExtInst)].operands.push(OperandLiteralNumber, "'Instruction'"); + InstructionDesc[enumCast(Op::OpExtInst)].operands.push(OperandVariableIds, "'Operand 1', +\n'Operand 2', +\n..."); + + InstructionDesc[enumCast(Op::OpExtInstWithForwardRefsKHR)].operands.push(OperandId, "'Set'"); + InstructionDesc[enumCast(Op::OpExtInstWithForwardRefsKHR)].operands.push(OperandLiteralNumber, "'Instruction'"); + InstructionDesc[enumCast(Op::OpExtInstWithForwardRefsKHR)].operands.push(OperandVariableIds, "'Operand 1', +\n'Operand 2', +\n..."); + + InstructionDesc[enumCast(Op::OpLoad)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpLoad)].operands.push(OperandMemoryAccess, "", true); + InstructionDesc[enumCast(Op::OpLoad)].operands.push(OperandLiteralNumber, "", true); + InstructionDesc[enumCast(Op::OpLoad)].operands.push(OperandId, "", true); + + InstructionDesc[enumCast(Op::OpStore)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpStore)].operands.push(OperandId, "'Object'"); + InstructionDesc[enumCast(Op::OpStore)].operands.push(OperandMemoryAccess, "", true); + InstructionDesc[enumCast(Op::OpStore)].operands.push(OperandLiteralNumber, "", true); + InstructionDesc[enumCast(Op::OpStore)].operands.push(OperandId, "", true); + + InstructionDesc[enumCast(Op::OpPhi)].operands.push(OperandVariableIds, "'Variable, Parent, ...'"); + + InstructionDesc[enumCast(Op::OpDecorate)].operands.push(OperandId, "'Target'"); + InstructionDesc[enumCast(Op::OpDecorate)].operands.push(OperandDecoration, ""); + InstructionDesc[enumCast(Op::OpDecorate)].operands.push(OperandVariableLiterals, "See <>."); + + InstructionDesc[enumCast(Op::OpDecorateId)].operands.push(OperandId, "'Target'"); + InstructionDesc[enumCast(Op::OpDecorateId)].operands.push(OperandDecoration, ""); + InstructionDesc[enumCast(Op::OpDecorateId)].operands.push(OperandVariableIds, "See <>."); + + InstructionDesc[enumCast(Op::OpDecorateStringGOOGLE)].operands.push(OperandId, "'Target'"); + InstructionDesc[enumCast(Op::OpDecorateStringGOOGLE)].operands.push(OperandDecoration, ""); + InstructionDesc[enumCast(Op::OpDecorateStringGOOGLE)].operands.push(OperandVariableLiteralStrings, "'Literal Strings'"); + + InstructionDesc[enumCast(Op::OpMemberDecorate)].operands.push(OperandId, "'Structure Type'"); + InstructionDesc[enumCast(Op::OpMemberDecorate)].operands.push(OperandLiteralNumber, "'Member'"); + InstructionDesc[enumCast(Op::OpMemberDecorate)].operands.push(OperandDecoration, ""); + InstructionDesc[enumCast(Op::OpMemberDecorate)].operands.push(OperandVariableLiterals, "See <>."); + + InstructionDesc[enumCast(Op::OpMemberDecorateStringGOOGLE)].operands.push(OperandId, "'Structure Type'"); + InstructionDesc[enumCast(Op::OpMemberDecorateStringGOOGLE)].operands.push(OperandLiteralNumber, "'Member'"); + InstructionDesc[enumCast(Op::OpMemberDecorateStringGOOGLE)].operands.push(OperandDecoration, ""); + InstructionDesc[enumCast(Op::OpMemberDecorateStringGOOGLE)].operands.push(OperandVariableLiteralStrings, "'Literal Strings'"); + + InstructionDesc[enumCast(Op::OpGroupDecorate)].operands.push(OperandId, "'Decoration Group'"); + InstructionDesc[enumCast(Op::OpGroupDecorate)].operands.push(OperandVariableIds, "'Targets'"); + + InstructionDesc[enumCast(Op::OpGroupMemberDecorate)].operands.push(OperandId, "'Decoration Group'"); + InstructionDesc[enumCast(Op::OpGroupMemberDecorate)].operands.push(OperandVariableIdLiteral, "'Targets'"); + + InstructionDesc[enumCast(Op::OpVectorExtractDynamic)].operands.push(OperandId, "'Vector'"); + InstructionDesc[enumCast(Op::OpVectorExtractDynamic)].operands.push(OperandId, "'Index'"); + + InstructionDesc[enumCast(Op::OpVectorInsertDynamic)].operands.push(OperandId, "'Vector'"); + InstructionDesc[enumCast(Op::OpVectorInsertDynamic)].operands.push(OperandId, "'Component'"); + InstructionDesc[enumCast(Op::OpVectorInsertDynamic)].operands.push(OperandId, "'Index'"); + + InstructionDesc[enumCast(Op::OpVectorShuffle)].operands.push(OperandId, "'Vector 1'"); + InstructionDesc[enumCast(Op::OpVectorShuffle)].operands.push(OperandId, "'Vector 2'"); + InstructionDesc[enumCast(Op::OpVectorShuffle)].operands.push(OperandVariableLiterals, "'Components'"); + + InstructionDesc[enumCast(Op::OpCompositeConstruct)].operands.push(OperandVariableIds, "'Constituents'"); + + InstructionDesc[enumCast(Op::OpCompositeExtract)].operands.push(OperandId, "'Composite'"); + InstructionDesc[enumCast(Op::OpCompositeExtract)].operands.push(OperandVariableLiterals, "'Indexes'"); + + InstructionDesc[enumCast(Op::OpCompositeInsert)].operands.push(OperandId, "'Object'"); + InstructionDesc[enumCast(Op::OpCompositeInsert)].operands.push(OperandId, "'Composite'"); + InstructionDesc[enumCast(Op::OpCompositeInsert)].operands.push(OperandVariableLiterals, "'Indexes'"); + + InstructionDesc[enumCast(Op::OpCopyObject)].operands.push(OperandId, "'Operand'"); + + InstructionDesc[enumCast(Op::OpCopyMemory)].operands.push(OperandId, "'Target'"); + InstructionDesc[enumCast(Op::OpCopyMemory)].operands.push(OperandId, "'Source'"); + InstructionDesc[enumCast(Op::OpCopyMemory)].operands.push(OperandMemoryAccess, "", true); + + InstructionDesc[enumCast(Op::OpCopyMemorySized)].operands.push(OperandId, "'Target'"); + InstructionDesc[enumCast(Op::OpCopyMemorySized)].operands.push(OperandId, "'Source'"); + InstructionDesc[enumCast(Op::OpCopyMemorySized)].operands.push(OperandId, "'Size'"); + InstructionDesc[enumCast(Op::OpCopyMemorySized)].operands.push(OperandMemoryAccess, "", true); + + InstructionDesc[enumCast(Op::OpSampledImage)].operands.push(OperandId, "'Image'"); + InstructionDesc[enumCast(Op::OpSampledImage)].operands.push(OperandId, "'Sampler'"); + + InstructionDesc[enumCast(Op::OpImage)].operands.push(OperandId, "'Sampled Image'"); + + InstructionDesc[enumCast(Op::OpImageRead)].operands.push(OperandId, "'Image'"); + InstructionDesc[enumCast(Op::OpImageRead)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageRead)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageRead)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageWrite)].operands.push(OperandId, "'Image'"); + InstructionDesc[enumCast(Op::OpImageWrite)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageWrite)].operands.push(OperandId, "'Texel'"); + InstructionDesc[enumCast(Op::OpImageWrite)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageWrite)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSampleImplicitLod)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSampleImplicitLod)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSampleImplicitLod)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSampleImplicitLod)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSampleExplicitLod)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSampleExplicitLod)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSampleExplicitLod)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSampleExplicitLod)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSampleDrefImplicitLod)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSampleDrefImplicitLod)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSampleDrefImplicitLod)].operands.push(OperandId, "'D~ref~'"); + InstructionDesc[enumCast(Op::OpImageSampleDrefImplicitLod)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSampleDrefImplicitLod)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSampleDrefExplicitLod)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSampleDrefExplicitLod)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSampleDrefExplicitLod)].operands.push(OperandId, "'D~ref~'"); + InstructionDesc[enumCast(Op::OpImageSampleDrefExplicitLod)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSampleDrefExplicitLod)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSampleProjImplicitLod)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSampleProjImplicitLod)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSampleProjImplicitLod)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSampleProjImplicitLod)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSampleProjExplicitLod)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSampleProjExplicitLod)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSampleProjExplicitLod)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSampleProjExplicitLod)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSampleProjDrefImplicitLod)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSampleProjDrefImplicitLod)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSampleProjDrefImplicitLod)].operands.push(OperandId, "'D~ref~'"); + InstructionDesc[enumCast(Op::OpImageSampleProjDrefImplicitLod)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSampleProjDrefImplicitLod)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSampleProjDrefExplicitLod)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSampleProjDrefExplicitLod)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSampleProjDrefExplicitLod)].operands.push(OperandId, "'D~ref~'"); + InstructionDesc[enumCast(Op::OpImageSampleProjDrefExplicitLod)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSampleProjDrefExplicitLod)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageFetch)].operands.push(OperandId, "'Image'"); + InstructionDesc[enumCast(Op::OpImageFetch)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageFetch)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageFetch)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageGather)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageGather)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageGather)].operands.push(OperandId, "'Component'"); + InstructionDesc[enumCast(Op::OpImageGather)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageGather)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageDrefGather)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageDrefGather)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageDrefGather)].operands.push(OperandId, "'D~ref~'"); + InstructionDesc[enumCast(Op::OpImageDrefGather)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageDrefGather)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSparseSampleImplicitLod)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleImplicitLod)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleImplicitLod)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSparseSampleImplicitLod)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSparseSampleExplicitLod)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleExplicitLod)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleExplicitLod)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSparseSampleExplicitLod)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSparseSampleDrefImplicitLod)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleDrefImplicitLod)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleDrefImplicitLod)].operands.push(OperandId, "'D~ref~'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleDrefImplicitLod)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSparseSampleDrefImplicitLod)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSparseSampleDrefExplicitLod)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleDrefExplicitLod)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleDrefExplicitLod)].operands.push(OperandId, "'D~ref~'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleDrefExplicitLod)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSparseSampleDrefExplicitLod)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSparseSampleProjImplicitLod)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleProjImplicitLod)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleProjImplicitLod)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSparseSampleProjImplicitLod)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSparseSampleProjExplicitLod)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleProjExplicitLod)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleProjExplicitLod)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSparseSampleProjExplicitLod)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSparseSampleProjDrefImplicitLod)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleProjDrefImplicitLod)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleProjDrefImplicitLod)].operands.push(OperandId, "'D~ref~'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleProjDrefImplicitLod)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSparseSampleProjDrefImplicitLod)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSparseSampleProjDrefExplicitLod)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleProjDrefExplicitLod)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleProjDrefExplicitLod)].operands.push(OperandId, "'D~ref~'"); + InstructionDesc[enumCast(Op::OpImageSparseSampleProjDrefExplicitLod)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSparseSampleProjDrefExplicitLod)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSparseFetch)].operands.push(OperandId, "'Image'"); + InstructionDesc[enumCast(Op::OpImageSparseFetch)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSparseFetch)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSparseFetch)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSparseGather)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSparseGather)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSparseGather)].operands.push(OperandId, "'Component'"); + InstructionDesc[enumCast(Op::OpImageSparseGather)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSparseGather)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSparseDrefGather)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSparseDrefGather)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSparseDrefGather)].operands.push(OperandId, "'D~ref~'"); + InstructionDesc[enumCast(Op::OpImageSparseDrefGather)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSparseDrefGather)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSparseRead)].operands.push(OperandId, "'Image'"); + InstructionDesc[enumCast(Op::OpImageSparseRead)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSparseRead)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSparseRead)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpImageSparseTexelsResident)].operands.push(OperandId, "'Resident Code'"); + + InstructionDesc[enumCast(Op::OpImageQuerySizeLod)].operands.push(OperandId, "'Image'"); + InstructionDesc[enumCast(Op::OpImageQuerySizeLod)].operands.push(OperandId, "'Level of Detail'"); + + InstructionDesc[enumCast(Op::OpImageQuerySize)].operands.push(OperandId, "'Image'"); + + InstructionDesc[enumCast(Op::OpImageQueryLod)].operands.push(OperandId, "'Image'"); + InstructionDesc[enumCast(Op::OpImageQueryLod)].operands.push(OperandId, "'Coordinate'"); + + InstructionDesc[enumCast(Op::OpImageQueryLevels)].operands.push(OperandId, "'Image'"); + + InstructionDesc[enumCast(Op::OpImageQuerySamples)].operands.push(OperandId, "'Image'"); + + InstructionDesc[enumCast(Op::OpImageQueryFormat)].operands.push(OperandId, "'Image'"); + + InstructionDesc[enumCast(Op::OpImageQueryOrder)].operands.push(OperandId, "'Image'"); + + InstructionDesc[enumCast(Op::OpAccessChain)].operands.push(OperandId, "'Base'"); + InstructionDesc[enumCast(Op::OpAccessChain)].operands.push(OperandVariableIds, "'Indexes'"); + + InstructionDesc[enumCast(Op::OpInBoundsAccessChain)].operands.push(OperandId, "'Base'"); + InstructionDesc[enumCast(Op::OpInBoundsAccessChain)].operands.push(OperandVariableIds, "'Indexes'"); + + InstructionDesc[enumCast(Op::OpPtrAccessChain)].operands.push(OperandId, "'Base'"); + InstructionDesc[enumCast(Op::OpPtrAccessChain)].operands.push(OperandId, "'Element'"); + InstructionDesc[enumCast(Op::OpPtrAccessChain)].operands.push(OperandVariableIds, "'Indexes'"); + + InstructionDesc[enumCast(Op::OpInBoundsPtrAccessChain)].operands.push(OperandId, "'Base'"); + InstructionDesc[enumCast(Op::OpInBoundsPtrAccessChain)].operands.push(OperandId, "'Element'"); + InstructionDesc[enumCast(Op::OpInBoundsPtrAccessChain)].operands.push(OperandVariableIds, "'Indexes'"); + + InstructionDesc[enumCast(Op::OpSNegate)].operands.push(OperandId, "'Operand'"); + + InstructionDesc[enumCast(Op::OpFNegate)].operands.push(OperandId, "'Operand'"); + + InstructionDesc[enumCast(Op::OpNot)].operands.push(OperandId, "'Operand'"); + + InstructionDesc[enumCast(Op::OpAny)].operands.push(OperandId, "'Vector'"); + + InstructionDesc[enumCast(Op::OpAll)].operands.push(OperandId, "'Vector'"); + + InstructionDesc[enumCast(Op::OpConvertFToU)].operands.push(OperandId, "'Float Value'"); + + InstructionDesc[enumCast(Op::OpConvertFToS)].operands.push(OperandId, "'Float Value'"); + + InstructionDesc[enumCast(Op::OpConvertSToF)].operands.push(OperandId, "'Signed Value'"); + + InstructionDesc[enumCast(Op::OpConvertUToF)].operands.push(OperandId, "'Unsigned Value'"); + + InstructionDesc[enumCast(Op::OpUConvert)].operands.push(OperandId, "'Unsigned Value'"); + + InstructionDesc[enumCast(Op::OpSConvert)].operands.push(OperandId, "'Signed Value'"); + + InstructionDesc[enumCast(Op::OpFConvert)].operands.push(OperandId, "'Float Value'"); + + InstructionDesc[enumCast(Op::OpSatConvertSToU)].operands.push(OperandId, "'Signed Value'"); + + InstructionDesc[enumCast(Op::OpSatConvertUToS)].operands.push(OperandId, "'Unsigned Value'"); + + InstructionDesc[enumCast(Op::OpConvertPtrToU)].operands.push(OperandId, "'Pointer'"); + + InstructionDesc[enumCast(Op::OpConvertUToPtr)].operands.push(OperandId, "'Integer Value'"); + + InstructionDesc[enumCast(Op::OpPtrCastToGeneric)].operands.push(OperandId, "'Pointer'"); + + InstructionDesc[enumCast(Op::OpGenericCastToPtr)].operands.push(OperandId, "'Pointer'"); + + InstructionDesc[enumCast(Op::OpGenericCastToPtrExplicit)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpGenericCastToPtrExplicit)].operands.push(OperandStorage, "'Storage'"); + + InstructionDesc[enumCast(Op::OpGenericPtrMemSemantics)].operands.push(OperandId, "'Pointer'"); + + InstructionDesc[enumCast(Op::OpBitcast)].operands.push(OperandId, "'Operand'"); + + InstructionDesc[enumCast(Op::OpQuantizeToF16)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpTranspose)].operands.push(OperandId, "'Matrix'"); + + InstructionDesc[enumCast(Op::OpCopyLogical)].operands.push(OperandId, "'Operand'"); + + InstructionDesc[enumCast(Op::OpIsNan)].operands.push(OperandId, "'x'"); + + InstructionDesc[enumCast(Op::OpIsInf)].operands.push(OperandId, "'x'"); + + InstructionDesc[enumCast(Op::OpIsFinite)].operands.push(OperandId, "'x'"); + + InstructionDesc[enumCast(Op::OpIsNormal)].operands.push(OperandId, "'x'"); + + InstructionDesc[enumCast(Op::OpSignBitSet)].operands.push(OperandId, "'x'"); + + InstructionDesc[enumCast(Op::OpLessOrGreater)].operands.push(OperandId, "'x'"); + InstructionDesc[enumCast(Op::OpLessOrGreater)].operands.push(OperandId, "'y'"); + + InstructionDesc[enumCast(Op::OpOrdered)].operands.push(OperandId, "'x'"); + InstructionDesc[enumCast(Op::OpOrdered)].operands.push(OperandId, "'y'"); + + InstructionDesc[enumCast(Op::OpUnordered)].operands.push(OperandId, "'x'"); + InstructionDesc[enumCast(Op::OpUnordered)].operands.push(OperandId, "'y'"); + + InstructionDesc[enumCast(Op::OpArrayLength)].operands.push(OperandId, "'Structure'"); + InstructionDesc[enumCast(Op::OpArrayLength)].operands.push(OperandLiteralNumber, "'Array member'"); + + InstructionDesc[enumCast(Op::OpIAdd)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpIAdd)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpFAdd)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpFAdd)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpISub)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpISub)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpFSub)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpFSub)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpIMul)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpIMul)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpFMul)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpFMul)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpUDiv)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpUDiv)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpSDiv)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpSDiv)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpFDiv)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpFDiv)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpUMod)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpUMod)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpSRem)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpSRem)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpSMod)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpSMod)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpFRem)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpFRem)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpFMod)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpFMod)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpVectorTimesScalar)].operands.push(OperandId, "'Vector'"); + InstructionDesc[enumCast(Op::OpVectorTimesScalar)].operands.push(OperandId, "'Scalar'"); + + InstructionDesc[enumCast(Op::OpMatrixTimesScalar)].operands.push(OperandId, "'Matrix'"); + InstructionDesc[enumCast(Op::OpMatrixTimesScalar)].operands.push(OperandId, "'Scalar'"); + + InstructionDesc[enumCast(Op::OpVectorTimesMatrix)].operands.push(OperandId, "'Vector'"); + InstructionDesc[enumCast(Op::OpVectorTimesMatrix)].operands.push(OperandId, "'Matrix'"); + + InstructionDesc[enumCast(Op::OpMatrixTimesVector)].operands.push(OperandId, "'Matrix'"); + InstructionDesc[enumCast(Op::OpMatrixTimesVector)].operands.push(OperandId, "'Vector'"); + + InstructionDesc[enumCast(Op::OpMatrixTimesMatrix)].operands.push(OperandId, "'LeftMatrix'"); + InstructionDesc[enumCast(Op::OpMatrixTimesMatrix)].operands.push(OperandId, "'RightMatrix'"); + + InstructionDesc[enumCast(Op::OpOuterProduct)].operands.push(OperandId, "'Vector 1'"); + InstructionDesc[enumCast(Op::OpOuterProduct)].operands.push(OperandId, "'Vector 2'"); + + InstructionDesc[enumCast(Op::OpDot)].operands.push(OperandId, "'Vector 1'"); + InstructionDesc[enumCast(Op::OpDot)].operands.push(OperandId, "'Vector 2'"); + + InstructionDesc[enumCast(Op::OpIAddCarry)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpIAddCarry)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpISubBorrow)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpISubBorrow)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpUMulExtended)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpUMulExtended)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpSMulExtended)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpSMulExtended)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpShiftRightLogical)].operands.push(OperandId, "'Base'"); + InstructionDesc[enumCast(Op::OpShiftRightLogical)].operands.push(OperandId, "'Shift'"); + + InstructionDesc[enumCast(Op::OpShiftRightArithmetic)].operands.push(OperandId, "'Base'"); + InstructionDesc[enumCast(Op::OpShiftRightArithmetic)].operands.push(OperandId, "'Shift'"); + + InstructionDesc[enumCast(Op::OpShiftLeftLogical)].operands.push(OperandId, "'Base'"); + InstructionDesc[enumCast(Op::OpShiftLeftLogical)].operands.push(OperandId, "'Shift'"); + + InstructionDesc[enumCast(Op::OpLogicalOr)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpLogicalOr)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpLogicalAnd)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpLogicalAnd)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpLogicalEqual)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpLogicalEqual)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpLogicalNotEqual)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpLogicalNotEqual)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpLogicalNot)].operands.push(OperandId, "'Operand'"); + + InstructionDesc[enumCast(Op::OpBitwiseOr)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpBitwiseOr)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpBitwiseXor)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpBitwiseXor)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpBitwiseAnd)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpBitwiseAnd)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpBitFieldInsert)].operands.push(OperandId, "'Base'"); + InstructionDesc[enumCast(Op::OpBitFieldInsert)].operands.push(OperandId, "'Insert'"); + InstructionDesc[enumCast(Op::OpBitFieldInsert)].operands.push(OperandId, "'Offset'"); + InstructionDesc[enumCast(Op::OpBitFieldInsert)].operands.push(OperandId, "'Count'"); + + InstructionDesc[enumCast(Op::OpBitFieldSExtract)].operands.push(OperandId, "'Base'"); + InstructionDesc[enumCast(Op::OpBitFieldSExtract)].operands.push(OperandId, "'Offset'"); + InstructionDesc[enumCast(Op::OpBitFieldSExtract)].operands.push(OperandId, "'Count'"); + + InstructionDesc[enumCast(Op::OpBitFieldUExtract)].operands.push(OperandId, "'Base'"); + InstructionDesc[enumCast(Op::OpBitFieldUExtract)].operands.push(OperandId, "'Offset'"); + InstructionDesc[enumCast(Op::OpBitFieldUExtract)].operands.push(OperandId, "'Count'"); + + InstructionDesc[enumCast(Op::OpBitReverse)].operands.push(OperandId, "'Base'"); + + InstructionDesc[enumCast(Op::OpBitCount)].operands.push(OperandId, "'Base'"); + + InstructionDesc[enumCast(Op::OpSelect)].operands.push(OperandId, "'Condition'"); + InstructionDesc[enumCast(Op::OpSelect)].operands.push(OperandId, "'Object 1'"); + InstructionDesc[enumCast(Op::OpSelect)].operands.push(OperandId, "'Object 2'"); + + InstructionDesc[enumCast(Op::OpIEqual)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpIEqual)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpFOrdEqual)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpFOrdEqual)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpFUnordEqual)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpFUnordEqual)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpINotEqual)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpINotEqual)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpFOrdNotEqual)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpFOrdNotEqual)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpFUnordNotEqual)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpFUnordNotEqual)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpULessThan)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpULessThan)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpSLessThan)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpSLessThan)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpFOrdLessThan)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpFOrdLessThan)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpFUnordLessThan)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpFUnordLessThan)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpUGreaterThan)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpUGreaterThan)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpSGreaterThan)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpSGreaterThan)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpFOrdGreaterThan)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpFOrdGreaterThan)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpFUnordGreaterThan)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpFUnordGreaterThan)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpULessThanEqual)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpULessThanEqual)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpSLessThanEqual)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpSLessThanEqual)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpFOrdLessThanEqual)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpFOrdLessThanEqual)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpFUnordLessThanEqual)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpFUnordLessThanEqual)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpUGreaterThanEqual)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpUGreaterThanEqual)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpSGreaterThanEqual)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpSGreaterThanEqual)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpFOrdGreaterThanEqual)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpFOrdGreaterThanEqual)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpFUnordGreaterThanEqual)].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[enumCast(Op::OpFUnordGreaterThanEqual)].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[enumCast(Op::OpDPdx)].operands.push(OperandId, "'P'"); + + InstructionDesc[enumCast(Op::OpDPdy)].operands.push(OperandId, "'P'"); + + InstructionDesc[enumCast(Op::OpFwidth)].operands.push(OperandId, "'P'"); + + InstructionDesc[enumCast(Op::OpDPdxFine)].operands.push(OperandId, "'P'"); + + InstructionDesc[enumCast(Op::OpDPdyFine)].operands.push(OperandId, "'P'"); + + InstructionDesc[enumCast(Op::OpFwidthFine)].operands.push(OperandId, "'P'"); + + InstructionDesc[enumCast(Op::OpDPdxCoarse)].operands.push(OperandId, "'P'"); + + InstructionDesc[enumCast(Op::OpDPdyCoarse)].operands.push(OperandId, "'P'"); + + InstructionDesc[enumCast(Op::OpFwidthCoarse)].operands.push(OperandId, "'P'"); + + InstructionDesc[enumCast(Op::OpEmitStreamVertex)].operands.push(OperandId, "'Stream'"); + + InstructionDesc[enumCast(Op::OpEndStreamPrimitive)].operands.push(OperandId, "'Stream'"); + + InstructionDesc[enumCast(Op::OpControlBarrier)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpControlBarrier)].operands.push(OperandScope, "'Memory'"); + InstructionDesc[enumCast(Op::OpControlBarrier)].operands.push(OperandMemorySemantics, "'Semantics'"); + + InstructionDesc[enumCast(Op::OpMemoryBarrier)].operands.push(OperandScope, "'Memory'"); + InstructionDesc[enumCast(Op::OpMemoryBarrier)].operands.push(OperandMemorySemantics, "'Semantics'"); + + InstructionDesc[enumCast(Op::OpImageTexelPointer)].operands.push(OperandId, "'Image'"); + InstructionDesc[enumCast(Op::OpImageTexelPointer)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageTexelPointer)].operands.push(OperandId, "'Sample'"); + + InstructionDesc[enumCast(Op::OpAtomicLoad)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicLoad)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicLoad)].operands.push(OperandMemorySemantics, "'Semantics'"); + + InstructionDesc[enumCast(Op::OpAtomicStore)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicStore)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicStore)].operands.push(OperandMemorySemantics, "'Semantics'"); + InstructionDesc[enumCast(Op::OpAtomicStore)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpAtomicExchange)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicExchange)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicExchange)].operands.push(OperandMemorySemantics, "'Semantics'"); + InstructionDesc[enumCast(Op::OpAtomicExchange)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpAtomicCompareExchange)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicCompareExchange)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicCompareExchange)].operands.push(OperandMemorySemantics, "'Equal'"); + InstructionDesc[enumCast(Op::OpAtomicCompareExchange)].operands.push(OperandMemorySemantics, "'Unequal'"); + InstructionDesc[enumCast(Op::OpAtomicCompareExchange)].operands.push(OperandId, "'Value'"); + InstructionDesc[enumCast(Op::OpAtomicCompareExchange)].operands.push(OperandId, "'Comparator'"); + + InstructionDesc[enumCast(Op::OpAtomicCompareExchangeWeak)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicCompareExchangeWeak)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicCompareExchangeWeak)].operands.push(OperandMemorySemantics, "'Equal'"); + InstructionDesc[enumCast(Op::OpAtomicCompareExchangeWeak)].operands.push(OperandMemorySemantics, "'Unequal'"); + InstructionDesc[enumCast(Op::OpAtomicCompareExchangeWeak)].operands.push(OperandId, "'Value'"); + InstructionDesc[enumCast(Op::OpAtomicCompareExchangeWeak)].operands.push(OperandId, "'Comparator'"); + + InstructionDesc[enumCast(Op::OpAtomicIIncrement)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicIIncrement)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicIIncrement)].operands.push(OperandMemorySemantics, "'Semantics'"); + + InstructionDesc[enumCast(Op::OpAtomicIDecrement)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicIDecrement)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicIDecrement)].operands.push(OperandMemorySemantics, "'Semantics'"); + + InstructionDesc[enumCast(Op::OpAtomicIAdd)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicIAdd)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicIAdd)].operands.push(OperandMemorySemantics, "'Semantics'"); + InstructionDesc[enumCast(Op::OpAtomicIAdd)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpAtomicFAddEXT)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicFAddEXT)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicFAddEXT)].operands.push(OperandMemorySemantics, "'Semantics'"); + InstructionDesc[enumCast(Op::OpAtomicFAddEXT)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpAssumeTrueKHR)].operands.push(OperandId, "'Condition'"); + + InstructionDesc[enumCast(Op::OpExpectKHR)].operands.push(OperandId, "'Value'"); + InstructionDesc[enumCast(Op::OpExpectKHR)].operands.push(OperandId, "'ExpectedValue'"); + + InstructionDesc[enumCast(Op::OpAtomicISub)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicISub)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicISub)].operands.push(OperandMemorySemantics, "'Semantics'"); + InstructionDesc[enumCast(Op::OpAtomicISub)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpAtomicUMin)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicUMin)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicUMin)].operands.push(OperandMemorySemantics, "'Semantics'"); + InstructionDesc[enumCast(Op::OpAtomicUMin)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpAtomicUMax)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicUMax)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicUMax)].operands.push(OperandMemorySemantics, "'Semantics'"); + InstructionDesc[enumCast(Op::OpAtomicUMax)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpAtomicSMin)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicSMin)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicSMin)].operands.push(OperandMemorySemantics, "'Semantics'"); + InstructionDesc[enumCast(Op::OpAtomicSMin)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpAtomicSMax)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicSMax)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicSMax)].operands.push(OperandMemorySemantics, "'Semantics'"); + InstructionDesc[enumCast(Op::OpAtomicSMax)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpAtomicFMinEXT)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicFMinEXT)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicFMinEXT)].operands.push(OperandMemorySemantics, "'Semantics'"); + InstructionDesc[enumCast(Op::OpAtomicFMinEXT)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpAtomicFMaxEXT)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicFMaxEXT)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicFMaxEXT)].operands.push(OperandMemorySemantics, "'Semantics'"); + InstructionDesc[enumCast(Op::OpAtomicFMaxEXT)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpAtomicAnd)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicAnd)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicAnd)].operands.push(OperandMemorySemantics, "'Semantics'"); + InstructionDesc[enumCast(Op::OpAtomicAnd)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpAtomicOr)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicOr)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicOr)].operands.push(OperandMemorySemantics, "'Semantics'"); + InstructionDesc[enumCast(Op::OpAtomicOr)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpAtomicXor)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicXor)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicXor)].operands.push(OperandMemorySemantics, "'Semantics'"); + InstructionDesc[enumCast(Op::OpAtomicXor)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpAtomicFlagTestAndSet)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicFlagTestAndSet)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicFlagTestAndSet)].operands.push(OperandMemorySemantics, "'Semantics'"); + + InstructionDesc[enumCast(Op::OpAtomicFlagClear)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpAtomicFlagClear)].operands.push(OperandScope, "'Scope'"); + InstructionDesc[enumCast(Op::OpAtomicFlagClear)].operands.push(OperandMemorySemantics, "'Semantics'"); + + InstructionDesc[enumCast(Op::OpLoopMerge)].operands.push(OperandId, "'Merge Block'"); + InstructionDesc[enumCast(Op::OpLoopMerge)].operands.push(OperandId, "'Continue Target'"); + InstructionDesc[enumCast(Op::OpLoopMerge)].operands.push(OperandLoop, ""); + InstructionDesc[enumCast(Op::OpLoopMerge)].operands.push(OperandOptionalLiteral, ""); + + InstructionDesc[enumCast(Op::OpSelectionMerge)].operands.push(OperandId, "'Merge Block'"); + InstructionDesc[enumCast(Op::OpSelectionMerge)].operands.push(OperandSelect, ""); + + InstructionDesc[enumCast(Op::OpBranch)].operands.push(OperandId, "'Target Label'"); + + InstructionDesc[enumCast(Op::OpBranchConditional)].operands.push(OperandId, "'Condition'"); + InstructionDesc[enumCast(Op::OpBranchConditional)].operands.push(OperandId, "'True Label'"); + InstructionDesc[enumCast(Op::OpBranchConditional)].operands.push(OperandId, "'False Label'"); + InstructionDesc[enumCast(Op::OpBranchConditional)].operands.push(OperandVariableLiterals, "'Branch weights'"); + + InstructionDesc[enumCast(Op::OpSwitch)].operands.push(OperandId, "'Selector'"); + InstructionDesc[enumCast(Op::OpSwitch)].operands.push(OperandId, "'Default'"); + InstructionDesc[enumCast(Op::OpSwitch)].operands.push(OperandVariableLiteralId, "'Target'"); + + + InstructionDesc[enumCast(Op::OpReturnValue)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpLifetimeStart)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpLifetimeStart)].operands.push(OperandLiteralNumber, "'Size'"); + + InstructionDesc[enumCast(Op::OpLifetimeStop)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpLifetimeStop)].operands.push(OperandLiteralNumber, "'Size'"); + + InstructionDesc[enumCast(Op::OpGroupAsyncCopy)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupAsyncCopy)].operands.push(OperandId, "'Destination'"); + InstructionDesc[enumCast(Op::OpGroupAsyncCopy)].operands.push(OperandId, "'Source'"); + InstructionDesc[enumCast(Op::OpGroupAsyncCopy)].operands.push(OperandId, "'Num Elements'"); + InstructionDesc[enumCast(Op::OpGroupAsyncCopy)].operands.push(OperandId, "'Stride'"); + InstructionDesc[enumCast(Op::OpGroupAsyncCopy)].operands.push(OperandId, "'Event'"); + + InstructionDesc[enumCast(Op::OpGroupWaitEvents)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupWaitEvents)].operands.push(OperandId, "'Num Events'"); + InstructionDesc[enumCast(Op::OpGroupWaitEvents)].operands.push(OperandId, "'Events List'"); + + InstructionDesc[enumCast(Op::OpGroupAll)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupAll)].operands.push(OperandId, "'Predicate'"); + + InstructionDesc[enumCast(Op::OpGroupAny)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupAny)].operands.push(OperandId, "'Predicate'"); + + InstructionDesc[enumCast(Op::OpGroupBroadcast)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupBroadcast)].operands.push(OperandId, "'Value'"); + InstructionDesc[enumCast(Op::OpGroupBroadcast)].operands.push(OperandId, "'LocalId'"); + + InstructionDesc[enumCast(Op::OpGroupIAdd)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupIAdd)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupIAdd)].operands.push(OperandId, "'X'"); + + InstructionDesc[enumCast(Op::OpGroupFAdd)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupFAdd)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupFAdd)].operands.push(OperandId, "'X'"); + + InstructionDesc[enumCast(Op::OpGroupUMin)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupUMin)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupUMin)].operands.push(OperandId, "'X'"); + + InstructionDesc[enumCast(Op::OpGroupSMin)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupSMin)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupSMin)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpGroupFMin)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupFMin)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupFMin)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpGroupUMax)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupUMax)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupUMax)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpGroupSMax)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupSMax)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupSMax)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpGroupFMax)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupFMax)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupFMax)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpReadPipe)].operands.push(OperandId, "'Pipe'"); + InstructionDesc[enumCast(Op::OpReadPipe)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpReadPipe)].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[enumCast(Op::OpReadPipe)].operands.push(OperandId, "'Packet Alignment'"); + + InstructionDesc[enumCast(Op::OpWritePipe)].operands.push(OperandId, "'Pipe'"); + InstructionDesc[enumCast(Op::OpWritePipe)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpWritePipe)].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[enumCast(Op::OpWritePipe)].operands.push(OperandId, "'Packet Alignment'"); + + InstructionDesc[enumCast(Op::OpReservedReadPipe)].operands.push(OperandId, "'Pipe'"); + InstructionDesc[enumCast(Op::OpReservedReadPipe)].operands.push(OperandId, "'Reserve Id'"); + InstructionDesc[enumCast(Op::OpReservedReadPipe)].operands.push(OperandId, "'Index'"); + InstructionDesc[enumCast(Op::OpReservedReadPipe)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpReservedReadPipe)].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[enumCast(Op::OpReservedReadPipe)].operands.push(OperandId, "'Packet Alignment'"); + + InstructionDesc[enumCast(Op::OpReservedWritePipe)].operands.push(OperandId, "'Pipe'"); + InstructionDesc[enumCast(Op::OpReservedWritePipe)].operands.push(OperandId, "'Reserve Id'"); + InstructionDesc[enumCast(Op::OpReservedWritePipe)].operands.push(OperandId, "'Index'"); + InstructionDesc[enumCast(Op::OpReservedWritePipe)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpReservedWritePipe)].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[enumCast(Op::OpReservedWritePipe)].operands.push(OperandId, "'Packet Alignment'"); + + InstructionDesc[enumCast(Op::OpReserveReadPipePackets)].operands.push(OperandId, "'Pipe'"); + InstructionDesc[enumCast(Op::OpReserveReadPipePackets)].operands.push(OperandId, "'Num Packets'"); + InstructionDesc[enumCast(Op::OpReserveReadPipePackets)].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[enumCast(Op::OpReserveReadPipePackets)].operands.push(OperandId, "'Packet Alignment'"); + + InstructionDesc[enumCast(Op::OpReserveWritePipePackets)].operands.push(OperandId, "'Pipe'"); + InstructionDesc[enumCast(Op::OpReserveWritePipePackets)].operands.push(OperandId, "'Num Packets'"); + InstructionDesc[enumCast(Op::OpReserveWritePipePackets)].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[enumCast(Op::OpReserveWritePipePackets)].operands.push(OperandId, "'Packet Alignment'"); + + InstructionDesc[enumCast(Op::OpCommitReadPipe)].operands.push(OperandId, "'Pipe'"); + InstructionDesc[enumCast(Op::OpCommitReadPipe)].operands.push(OperandId, "'Reserve Id'"); + InstructionDesc[enumCast(Op::OpCommitReadPipe)].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[enumCast(Op::OpCommitReadPipe)].operands.push(OperandId, "'Packet Alignment'"); + + InstructionDesc[enumCast(Op::OpCommitWritePipe)].operands.push(OperandId, "'Pipe'"); + InstructionDesc[enumCast(Op::OpCommitWritePipe)].operands.push(OperandId, "'Reserve Id'"); + InstructionDesc[enumCast(Op::OpCommitWritePipe)].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[enumCast(Op::OpCommitWritePipe)].operands.push(OperandId, "'Packet Alignment'"); + + InstructionDesc[enumCast(Op::OpIsValidReserveId)].operands.push(OperandId, "'Reserve Id'"); + + InstructionDesc[enumCast(Op::OpGetNumPipePackets)].operands.push(OperandId, "'Pipe'"); + InstructionDesc[enumCast(Op::OpGetNumPipePackets)].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[enumCast(Op::OpGetNumPipePackets)].operands.push(OperandId, "'Packet Alignment'"); + + InstructionDesc[enumCast(Op::OpGetMaxPipePackets)].operands.push(OperandId, "'Pipe'"); + InstructionDesc[enumCast(Op::OpGetMaxPipePackets)].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[enumCast(Op::OpGetMaxPipePackets)].operands.push(OperandId, "'Packet Alignment'"); + + InstructionDesc[enumCast(Op::OpGroupReserveReadPipePackets)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupReserveReadPipePackets)].operands.push(OperandId, "'Pipe'"); + InstructionDesc[enumCast(Op::OpGroupReserveReadPipePackets)].operands.push(OperandId, "'Num Packets'"); + InstructionDesc[enumCast(Op::OpGroupReserveReadPipePackets)].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[enumCast(Op::OpGroupReserveReadPipePackets)].operands.push(OperandId, "'Packet Alignment'"); + + InstructionDesc[enumCast(Op::OpGroupReserveWritePipePackets)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupReserveWritePipePackets)].operands.push(OperandId, "'Pipe'"); + InstructionDesc[enumCast(Op::OpGroupReserveWritePipePackets)].operands.push(OperandId, "'Num Packets'"); + InstructionDesc[enumCast(Op::OpGroupReserveWritePipePackets)].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[enumCast(Op::OpGroupReserveWritePipePackets)].operands.push(OperandId, "'Packet Alignment'"); + + InstructionDesc[enumCast(Op::OpGroupCommitReadPipe)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupCommitReadPipe)].operands.push(OperandId, "'Pipe'"); + InstructionDesc[enumCast(Op::OpGroupCommitReadPipe)].operands.push(OperandId, "'Reserve Id'"); + InstructionDesc[enumCast(Op::OpGroupCommitReadPipe)].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[enumCast(Op::OpGroupCommitReadPipe)].operands.push(OperandId, "'Packet Alignment'"); + + InstructionDesc[enumCast(Op::OpGroupCommitWritePipe)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupCommitWritePipe)].operands.push(OperandId, "'Pipe'"); + InstructionDesc[enumCast(Op::OpGroupCommitWritePipe)].operands.push(OperandId, "'Reserve Id'"); + InstructionDesc[enumCast(Op::OpGroupCommitWritePipe)].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[enumCast(Op::OpGroupCommitWritePipe)].operands.push(OperandId, "'Packet Alignment'"); + + InstructionDesc[enumCast(Op::OpBuildNDRange)].operands.push(OperandId, "'GlobalWorkSize'"); + InstructionDesc[enumCast(Op::OpBuildNDRange)].operands.push(OperandId, "'LocalWorkSize'"); + InstructionDesc[enumCast(Op::OpBuildNDRange)].operands.push(OperandId, "'GlobalWorkOffset'"); + + InstructionDesc[enumCast(Op::OpCaptureEventProfilingInfo)].operands.push(OperandId, "'Event'"); + InstructionDesc[enumCast(Op::OpCaptureEventProfilingInfo)].operands.push(OperandId, "'Profiling Info'"); + InstructionDesc[enumCast(Op::OpCaptureEventProfilingInfo)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpSetUserEventStatus)].operands.push(OperandId, "'Event'"); + InstructionDesc[enumCast(Op::OpSetUserEventStatus)].operands.push(OperandId, "'Status'"); + + InstructionDesc[enumCast(Op::OpIsValidEvent)].operands.push(OperandId, "'Event'"); + + InstructionDesc[enumCast(Op::OpRetainEvent)].operands.push(OperandId, "'Event'"); + + InstructionDesc[enumCast(Op::OpReleaseEvent)].operands.push(OperandId, "'Event'"); + + InstructionDesc[enumCast(Op::OpGetKernelWorkGroupSize)].operands.push(OperandId, "'Invoke'"); + InstructionDesc[enumCast(Op::OpGetKernelWorkGroupSize)].operands.push(OperandId, "'Param'"); + InstructionDesc[enumCast(Op::OpGetKernelWorkGroupSize)].operands.push(OperandId, "'Param Size'"); + InstructionDesc[enumCast(Op::OpGetKernelWorkGroupSize)].operands.push(OperandId, "'Param Align'"); + + InstructionDesc[enumCast(Op::OpGetKernelPreferredWorkGroupSizeMultiple)].operands.push(OperandId, "'Invoke'"); + InstructionDesc[enumCast(Op::OpGetKernelPreferredWorkGroupSizeMultiple)].operands.push(OperandId, "'Param'"); + InstructionDesc[enumCast(Op::OpGetKernelPreferredWorkGroupSizeMultiple)].operands.push(OperandId, "'Param Size'"); + InstructionDesc[enumCast(Op::OpGetKernelPreferredWorkGroupSizeMultiple)].operands.push(OperandId, "'Param Align'"); + + InstructionDesc[enumCast(Op::OpGetKernelNDrangeSubGroupCount)].operands.push(OperandId, "'ND Range'"); + InstructionDesc[enumCast(Op::OpGetKernelNDrangeSubGroupCount)].operands.push(OperandId, "'Invoke'"); + InstructionDesc[enumCast(Op::OpGetKernelNDrangeSubGroupCount)].operands.push(OperandId, "'Param'"); + InstructionDesc[enumCast(Op::OpGetKernelNDrangeSubGroupCount)].operands.push(OperandId, "'Param Size'"); + InstructionDesc[enumCast(Op::OpGetKernelNDrangeSubGroupCount)].operands.push(OperandId, "'Param Align'"); + + InstructionDesc[enumCast(Op::OpGetKernelNDrangeMaxSubGroupSize)].operands.push(OperandId, "'ND Range'"); + InstructionDesc[enumCast(Op::OpGetKernelNDrangeMaxSubGroupSize)].operands.push(OperandId, "'Invoke'"); + InstructionDesc[enumCast(Op::OpGetKernelNDrangeMaxSubGroupSize)].operands.push(OperandId, "'Param'"); + InstructionDesc[enumCast(Op::OpGetKernelNDrangeMaxSubGroupSize)].operands.push(OperandId, "'Param Size'"); + InstructionDesc[enumCast(Op::OpGetKernelNDrangeMaxSubGroupSize)].operands.push(OperandId, "'Param Align'"); + + InstructionDesc[enumCast(Op::OpEnqueueKernel)].operands.push(OperandId, "'Queue'"); + InstructionDesc[enumCast(Op::OpEnqueueKernel)].operands.push(OperandId, "'Flags'"); + InstructionDesc[enumCast(Op::OpEnqueueKernel)].operands.push(OperandId, "'ND Range'"); + InstructionDesc[enumCast(Op::OpEnqueueKernel)].operands.push(OperandId, "'Num Events'"); + InstructionDesc[enumCast(Op::OpEnqueueKernel)].operands.push(OperandId, "'Wait Events'"); + InstructionDesc[enumCast(Op::OpEnqueueKernel)].operands.push(OperandId, "'Ret Event'"); + InstructionDesc[enumCast(Op::OpEnqueueKernel)].operands.push(OperandId, "'Invoke'"); + InstructionDesc[enumCast(Op::OpEnqueueKernel)].operands.push(OperandId, "'Param'"); + InstructionDesc[enumCast(Op::OpEnqueueKernel)].operands.push(OperandId, "'Param Size'"); + InstructionDesc[enumCast(Op::OpEnqueueKernel)].operands.push(OperandId, "'Param Align'"); + InstructionDesc[enumCast(Op::OpEnqueueKernel)].operands.push(OperandVariableIds, "'Local Size'"); + + InstructionDesc[enumCast(Op::OpEnqueueMarker)].operands.push(OperandId, "'Queue'"); + InstructionDesc[enumCast(Op::OpEnqueueMarker)].operands.push(OperandId, "'Num Events'"); + InstructionDesc[enumCast(Op::OpEnqueueMarker)].operands.push(OperandId, "'Wait Events'"); + InstructionDesc[enumCast(Op::OpEnqueueMarker)].operands.push(OperandId, "'Ret Event'"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformElect)].operands.push(OperandScope, "'Execution'"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformAll)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformAll)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformAny)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformAny)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformAllEqual)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformAllEqual)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformBroadcast)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBroadcast)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBroadcast)].operands.push(OperandId, "ID"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformBroadcastFirst)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBroadcastFirst)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformBallot)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBallot)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformInverseBallot)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformInverseBallot)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformBallotBitExtract)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBallotBitExtract)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBallotBitExtract)].operands.push(OperandId, "Bit"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformBallotBitCount)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBallotBitCount)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBallotBitCount)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformBallotFindLSB)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBallotFindLSB)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformBallotFindMSB)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBallotFindMSB)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformShuffle)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformShuffle)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformShuffle)].operands.push(OperandId, "'Id'"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformShuffleXor)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformShuffleXor)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformShuffleXor)].operands.push(OperandId, "Mask"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformShuffleUp)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformShuffleUp)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformShuffleUp)].operands.push(OperandId, "Offset"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformShuffleDown)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformShuffleDown)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformShuffleDown)].operands.push(OperandId, "Offset"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformIAdd)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformIAdd)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformIAdd)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformIAdd)].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[enumCast(Op::OpGroupNonUniformFAdd)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformFAdd)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformFAdd)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformFAdd)].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[enumCast(Op::OpGroupNonUniformIMul)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformIMul)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformIMul)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformIMul)].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[enumCast(Op::OpGroupNonUniformFMul)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformFMul)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformFMul)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformFMul)].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[enumCast(Op::OpGroupNonUniformSMin)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformSMin)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformSMin)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformSMin)].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[enumCast(Op::OpGroupNonUniformUMin)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformUMin)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformUMin)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformUMin)].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[enumCast(Op::OpGroupNonUniformFMin)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformFMin)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformFMin)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformFMin)].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[enumCast(Op::OpGroupNonUniformSMax)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformSMax)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformSMax)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformSMax)].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[enumCast(Op::OpGroupNonUniformUMax)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformUMax)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformUMax)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformUMax)].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[enumCast(Op::OpGroupNonUniformFMax)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformFMax)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformFMax)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformFMax)].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[enumCast(Op::OpGroupNonUniformBitwiseAnd)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBitwiseAnd)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBitwiseAnd)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBitwiseAnd)].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[enumCast(Op::OpGroupNonUniformBitwiseOr)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBitwiseOr)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBitwiseOr)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBitwiseOr)].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[enumCast(Op::OpGroupNonUniformBitwiseXor)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBitwiseXor)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBitwiseXor)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformBitwiseXor)].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[enumCast(Op::OpGroupNonUniformLogicalAnd)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformLogicalAnd)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformLogicalAnd)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformLogicalAnd)].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[enumCast(Op::OpGroupNonUniformLogicalOr)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformLogicalOr)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformLogicalOr)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformLogicalOr)].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[enumCast(Op::OpGroupNonUniformLogicalXor)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformLogicalXor)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformLogicalXor)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformLogicalXor)].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[enumCast(Op::OpGroupNonUniformQuadBroadcast)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformQuadBroadcast)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformQuadBroadcast)].operands.push(OperandId, "'Id'"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformQuadSwap)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformQuadSwap)].operands.push(OperandId, "X"); + InstructionDesc[enumCast(Op::OpGroupNonUniformQuadSwap)].operands.push(OperandId, "'Direction'"); + + InstructionDesc[enumCast(Op::OpSubgroupBallotKHR)].operands.push(OperandId, "'Predicate'"); + + InstructionDesc[enumCast(Op::OpSubgroupFirstInvocationKHR)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpSubgroupAnyKHR)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpSubgroupAnyKHR)].operands.push(OperandId, "'Predicate'"); + + InstructionDesc[enumCast(Op::OpSubgroupAllKHR)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpSubgroupAllKHR)].operands.push(OperandId, "'Predicate'"); + + InstructionDesc[enumCast(Op::OpSubgroupAllEqualKHR)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpSubgroupAllEqualKHR)].operands.push(OperandId, "'Predicate'"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformRotateKHR)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformRotateKHR)].operands.push(OperandId, "'X'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformRotateKHR)].operands.push(OperandId, "'Delta'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformRotateKHR)].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[enumCast(Op::OpSubgroupReadInvocationKHR)].operands.push(OperandId, "'Value'"); + InstructionDesc[enumCast(Op::OpSubgroupReadInvocationKHR)].operands.push(OperandId, "'Index'"); + + InstructionDesc[enumCast(Op::OpModuleProcessed)].operands.push(OperandLiteralString, "'process'"); + + InstructionDesc[enumCast(Op::OpGroupIAddNonUniformAMD)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupIAddNonUniformAMD)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupIAddNonUniformAMD)].operands.push(OperandId, "'X'"); + + InstructionDesc[enumCast(Op::OpGroupFAddNonUniformAMD)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupFAddNonUniformAMD)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupFAddNonUniformAMD)].operands.push(OperandId, "'X'"); + + InstructionDesc[enumCast(Op::OpGroupUMinNonUniformAMD)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupUMinNonUniformAMD)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupUMinNonUniformAMD)].operands.push(OperandId, "'X'"); + + InstructionDesc[enumCast(Op::OpGroupSMinNonUniformAMD)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupSMinNonUniformAMD)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupSMinNonUniformAMD)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpGroupFMinNonUniformAMD)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupFMinNonUniformAMD)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupFMinNonUniformAMD)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpGroupUMaxNonUniformAMD)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupUMaxNonUniformAMD)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupUMaxNonUniformAMD)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpGroupSMaxNonUniformAMD)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupSMaxNonUniformAMD)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupSMaxNonUniformAMD)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpGroupFMaxNonUniformAMD)].operands.push(OperandScope, "'Execution'"); + InstructionDesc[enumCast(Op::OpGroupFMaxNonUniformAMD)].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[enumCast(Op::OpGroupFMaxNonUniformAMD)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpFragmentMaskFetchAMD)].operands.push(OperandId, "'Image'"); + InstructionDesc[enumCast(Op::OpFragmentMaskFetchAMD)].operands.push(OperandId, "'Coordinate'"); + + InstructionDesc[enumCast(Op::OpFragmentFetchAMD)].operands.push(OperandId, "'Image'"); + InstructionDesc[enumCast(Op::OpFragmentFetchAMD)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpFragmentFetchAMD)].operands.push(OperandId, "'Fragment Index'"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformPartitionNV)].operands.push(OperandId, "X"); + + InstructionDesc[enumCast(Op::OpGroupNonUniformQuadAllKHR)].operands.push(OperandId, "'Predicate'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformQuadAnyKHR)].operands.push(OperandId, "'Predicate'"); + InstructionDesc[enumCast(Op::OpTypeAccelerationStructureKHR)].setResultAndType(true, false); + + InstructionDesc[enumCast(Op::OpTraceNV)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpTraceNV)].operands.push(OperandId, "'Ray Flags'"); + InstructionDesc[enumCast(Op::OpTraceNV)].operands.push(OperandId, "'Cull Mask'"); + InstructionDesc[enumCast(Op::OpTraceNV)].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[enumCast(Op::OpTraceNV)].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[enumCast(Op::OpTraceNV)].operands.push(OperandId, "'Miss Index'"); + InstructionDesc[enumCast(Op::OpTraceNV)].operands.push(OperandId, "'Ray Origin'"); + InstructionDesc[enumCast(Op::OpTraceNV)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpTraceNV)].operands.push(OperandId, "'Ray Direction'"); + InstructionDesc[enumCast(Op::OpTraceNV)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpTraceNV)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpTraceNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpTraceRayMotionNV)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpTraceRayMotionNV)].operands.push(OperandId, "'Ray Flags'"); + InstructionDesc[enumCast(Op::OpTraceRayMotionNV)].operands.push(OperandId, "'Cull Mask'"); + InstructionDesc[enumCast(Op::OpTraceRayMotionNV)].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[enumCast(Op::OpTraceRayMotionNV)].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[enumCast(Op::OpTraceRayMotionNV)].operands.push(OperandId, "'Miss Index'"); + InstructionDesc[enumCast(Op::OpTraceRayMotionNV)].operands.push(OperandId, "'Ray Origin'"); + InstructionDesc[enumCast(Op::OpTraceRayMotionNV)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpTraceRayMotionNV)].operands.push(OperandId, "'Ray Direction'"); + InstructionDesc[enumCast(Op::OpTraceRayMotionNV)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpTraceRayMotionNV)].operands.push(OperandId, "'Time'"); + InstructionDesc[enumCast(Op::OpTraceRayMotionNV)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpTraceRayMotionNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpTraceRayKHR)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpTraceRayKHR)].operands.push(OperandId, "'Ray Flags'"); + InstructionDesc[enumCast(Op::OpTraceRayKHR)].operands.push(OperandId, "'Cull Mask'"); + InstructionDesc[enumCast(Op::OpTraceRayKHR)].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[enumCast(Op::OpTraceRayKHR)].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[enumCast(Op::OpTraceRayKHR)].operands.push(OperandId, "'Miss Index'"); + InstructionDesc[enumCast(Op::OpTraceRayKHR)].operands.push(OperandId, "'Ray Origin'"); + InstructionDesc[enumCast(Op::OpTraceRayKHR)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpTraceRayKHR)].operands.push(OperandId, "'Ray Direction'"); + InstructionDesc[enumCast(Op::OpTraceRayKHR)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpTraceRayKHR)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpTraceRayKHR)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpReportIntersectionKHR)].operands.push(OperandId, "'Hit Parameter'"); + InstructionDesc[enumCast(Op::OpReportIntersectionKHR)].operands.push(OperandId, "'Hit Kind'"); + + InstructionDesc[enumCast(Op::OpIgnoreIntersectionNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpIgnoreIntersectionKHR)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpTerminateRayNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpTerminateRayKHR)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpExecuteCallableNV)].operands.push(OperandId, "SBT Record Index"); + InstructionDesc[enumCast(Op::OpExecuteCallableNV)].operands.push(OperandId, "CallableData ID"); + InstructionDesc[enumCast(Op::OpExecuteCallableNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpExecuteCallableKHR)].operands.push(OperandId, "SBT Record Index"); + InstructionDesc[enumCast(Op::OpExecuteCallableKHR)].operands.push(OperandId, "CallableData"); + InstructionDesc[enumCast(Op::OpExecuteCallableKHR)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpConvertUToAccelerationStructureKHR)].operands.push(OperandId, "Value"); + InstructionDesc[enumCast(Op::OpConvertUToAccelerationStructureKHR)].setResultAndType(true, true); + + // Ray Query + InstructionDesc[enumCast(Op::OpTypeAccelerationStructureKHR)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeRayQueryKHR)].setResultAndType(true, false); + + InstructionDesc[enumCast(Op::OpRayQueryInitializeKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryInitializeKHR)].operands.push(OperandId, "'AccelerationS'"); + InstructionDesc[enumCast(Op::OpRayQueryInitializeKHR)].operands.push(OperandId, "'RayFlags'"); + InstructionDesc[enumCast(Op::OpRayQueryInitializeKHR)].operands.push(OperandId, "'CullMask'"); + InstructionDesc[enumCast(Op::OpRayQueryInitializeKHR)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpRayQueryInitializeKHR)].operands.push(OperandId, "'Tmin'"); + InstructionDesc[enumCast(Op::OpRayQueryInitializeKHR)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpRayQueryInitializeKHR)].operands.push(OperandId, "'Tmax'"); + InstructionDesc[enumCast(Op::OpRayQueryInitializeKHR)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpRayQueryTerminateKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryTerminateKHR)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpRayQueryGenerateIntersectionKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGenerateIntersectionKHR)].operands.push(OperandId, "'THit'"); + InstructionDesc[enumCast(Op::OpRayQueryGenerateIntersectionKHR)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpRayQueryConfirmIntersectionKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryConfirmIntersectionKHR)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpRayQueryProceedKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryProceedKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionTypeKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionTypeKHR)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionTypeKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetRayTMinKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetRayTMinKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetRayFlagsKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetRayFlagsKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionTKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionTKHR)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionTKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionInstanceCustomIndexKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionInstanceCustomIndexKHR)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionInstanceCustomIndexKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionInstanceIdKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionInstanceIdKHR)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionInstanceIdKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionGeometryIndexKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionGeometryIndexKHR)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionGeometryIndexKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionPrimitiveIndexKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionPrimitiveIndexKHR)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionPrimitiveIndexKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionBarycentricsKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionBarycentricsKHR)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionBarycentricsKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionFrontFaceKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionFrontFaceKHR)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionFrontFaceKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionObjectRayDirectionKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionObjectRayDirectionKHR)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionObjectRayDirectionKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionObjectRayOriginKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionObjectRayOriginKHR)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionObjectRayOriginKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetWorldRayDirectionKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetWorldRayDirectionKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetWorldRayOriginKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetWorldRayOriginKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionObjectToWorldKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionObjectToWorldKHR)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionObjectToWorldKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionWorldToObjectKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionWorldToObjectKHR)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionWorldToObjectKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionTriangleVertexPositionsKHR)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionTriangleVertexPositionsKHR)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionTriangleVertexPositionsKHR)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetClusterIdNV)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetClusterIdNV)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetClusterIdNV)].setResultAndType(true, true); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionSpherePositionNV)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionSpherePositionNV)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionSpherePositionNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionSphereRadiusNV)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionSphereRadiusNV)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionSphereRadiusNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionLSSHitValueNV)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionLSSHitValueNV)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionLSSHitValueNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionLSSPositionsNV)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionLSSPositionsNV)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionLSSPositionsNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionLSSRadiiNV)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionLSSRadiiNV)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryGetIntersectionLSSRadiiNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryIsSphereHitNV)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryIsSphereHitNV)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryIsSphereHitNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpRayQueryIsLSSHitNV)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpRayQueryIsLSSHitNV)].operands.push(OperandId, "'Committed'"); + InstructionDesc[enumCast(Op::OpRayQueryIsLSSHitNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpImageSampleFootprintNV)].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[enumCast(Op::OpImageSampleFootprintNV)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpImageSampleFootprintNV)].operands.push(OperandId, "'Granularity'"); + InstructionDesc[enumCast(Op::OpImageSampleFootprintNV)].operands.push(OperandId, "'Coarse'"); + InstructionDesc[enumCast(Op::OpImageSampleFootprintNV)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSampleFootprintNV)].operands.push(OperandVariableIds, "", true); + + InstructionDesc[enumCast(Op::OpWritePackedPrimitiveIndices4x8NV)].operands.push(OperandId, "'Index Offset'"); + InstructionDesc[enumCast(Op::OpWritePackedPrimitiveIndices4x8NV)].operands.push(OperandId, "'Packed Indices'"); + + InstructionDesc[enumCast(Op::OpEmitMeshTasksEXT)].operands.push(OperandId, "'groupCountX'"); + InstructionDesc[enumCast(Op::OpEmitMeshTasksEXT)].operands.push(OperandId, "'groupCountY'"); + InstructionDesc[enumCast(Op::OpEmitMeshTasksEXT)].operands.push(OperandId, "'groupCountZ'"); + InstructionDesc[enumCast(Op::OpEmitMeshTasksEXT)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpEmitMeshTasksEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpSetMeshOutputsEXT)].operands.push(OperandId, "'vertexCount'"); + InstructionDesc[enumCast(Op::OpSetMeshOutputsEXT)].operands.push(OperandId, "'primitiveCount'"); + InstructionDesc[enumCast(Op::OpSetMeshOutputsEXT)].setResultAndType(false, false); + + + InstructionDesc[enumCast(Op::OpTypeCooperativeMatrixNV)].operands.push(OperandId, "'Component Type'"); + InstructionDesc[enumCast(Op::OpTypeCooperativeMatrixNV)].operands.push(OperandId, "'Scope'"); + InstructionDesc[enumCast(Op::OpTypeCooperativeMatrixNV)].operands.push(OperandId, "'Rows'"); + InstructionDesc[enumCast(Op::OpTypeCooperativeMatrixNV)].operands.push(OperandId, "'Columns'"); + + InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadNV)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadNV)].operands.push(OperandId, "'Stride'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadNV)].operands.push(OperandId, "'Column Major'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadNV)].operands.push(OperandMemoryAccess, "'Memory Access'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadNV)].operands.push(OperandLiteralNumber, "", true); + InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadNV)].operands.push(OperandId, "", true); + + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreNV)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreNV)].operands.push(OperandId, "'Object'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreNV)].operands.push(OperandId, "'Stride'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreNV)].operands.push(OperandId, "'Column Major'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreNV)].operands.push(OperandMemoryAccess, "'Memory Access'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreNV)].operands.push(OperandLiteralNumber, "", true); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreNV)].operands.push(OperandId, "", true); + + InstructionDesc[enumCast(Op::OpCooperativeMatrixMulAddNV)].operands.push(OperandId, "'A'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixMulAddNV)].operands.push(OperandId, "'B'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixMulAddNV)].operands.push(OperandId, "'C'"); + + InstructionDesc[enumCast(Op::OpCooperativeMatrixLengthNV)].operands.push(OperandId, "'Type'"); + + InstructionDesc[enumCast(Op::OpTypeCooperativeMatrixKHR)].operands.push(OperandId, "'Component Type'"); + InstructionDesc[enumCast(Op::OpTypeCooperativeMatrixKHR)].operands.push(OperandId, "'Scope'"); + InstructionDesc[enumCast(Op::OpTypeCooperativeMatrixKHR)].operands.push(OperandId, "'Rows'"); + InstructionDesc[enumCast(Op::OpTypeCooperativeMatrixKHR)].operands.push(OperandId, "'Columns'"); + InstructionDesc[enumCast(Op::OpTypeCooperativeMatrixKHR)].operands.push(OperandId, "'Use'"); + + InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadKHR)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadKHR)].operands.push(OperandId, "'Memory Layout'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadKHR)].operands.push(OperandId, "'Stride'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadKHR)].operands.push(OperandMemoryAccess, "'Memory Access'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadKHR)].operands.push(OperandLiteralNumber, "", true); + InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadKHR)].operands.push(OperandId, "", true); + + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreKHR)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreKHR)].operands.push(OperandId, "'Object'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreKHR)].operands.push(OperandId, "'Memory Layout'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreKHR)].operands.push(OperandId, "'Stride'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreKHR)].operands.push(OperandMemoryAccess, "'Memory Access'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreKHR)].operands.push(OperandLiteralNumber, "", true); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreKHR)].operands.push(OperandId, "", true); + + InstructionDesc[enumCast(Op::OpCooperativeMatrixMulAddKHR)].operands.push(OperandId, "'A'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixMulAddKHR)].operands.push(OperandId, "'B'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixMulAddKHR)].operands.push(OperandId, "'C'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixMulAddKHR)].operands.push(OperandCooperativeMatrixOperands, "'Cooperative Matrix Operands'", true); + + InstructionDesc[enumCast(Op::OpCooperativeMatrixLengthKHR)].operands.push(OperandId, "'Type'"); + + InstructionDesc[enumCast(Op::OpTypeCooperativeVectorNV)].operands.push(OperandId, "'Component Type'"); + InstructionDesc[enumCast(Op::OpTypeCooperativeVectorNV)].operands.push(OperandId, "'Components'"); + + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulNV)].operands.push(OperandId, "'Input'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulNV)].operands.push(OperandId, "'InputInterpretation'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulNV)].operands.push(OperandId, "'Matrix'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulNV)].operands.push(OperandId, "'MatrixOffset'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulNV)].operands.push(OperandId, "'MatrixInterpretation'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulNV)].operands.push(OperandId, "'M'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulNV)].operands.push(OperandId, "'K'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulNV)].operands.push(OperandId, "'MemoryLayout'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulNV)].operands.push(OperandId, "'Transpose'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulNV)].operands.push(OperandId, "'MatrixStride'", true); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulNV)].operands.push(OperandCooperativeMatrixOperands, "'Cooperative Matrix Operands'", true); + + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulAddNV)].operands.push(OperandId, "'Input'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulAddNV)].operands.push(OperandId, "'InputInterpretation'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulAddNV)].operands.push(OperandId, "'Matrix'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulAddNV)].operands.push(OperandId, "'MatrixOffset'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulAddNV)].operands.push(OperandId, "'MatrixInterpretation'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulAddNV)].operands.push(OperandId, "'Bias'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulAddNV)].operands.push(OperandId, "'BiasOffset'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulAddNV)].operands.push(OperandId, "'BiasInterpretation'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulAddNV)].operands.push(OperandId, "'M'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulAddNV)].operands.push(OperandId, "'K'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulAddNV)].operands.push(OperandId, "'MemoryLayout'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulAddNV)].operands.push(OperandId, "'Transpose'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulAddNV)].operands.push(OperandId, "'MatrixStride'", true); + InstructionDesc[enumCast(Op::OpCooperativeVectorMatrixMulAddNV)].operands.push(OperandCooperativeMatrixOperands, "'Cooperative Matrix Operands'", true); + + InstructionDesc[enumCast(Op::OpCooperativeVectorLoadNV)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorLoadNV)].operands.push(OperandId, "'Offset'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorLoadNV)].operands.push(OperandMemoryAccess, "'Memory Access'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorLoadNV)].operands.push(OperandLiteralNumber, "", true); + InstructionDesc[enumCast(Op::OpCooperativeVectorLoadNV)].operands.push(OperandId, "", true); + + InstructionDesc[enumCast(Op::OpCooperativeVectorStoreNV)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorStoreNV)].operands.push(OperandId, "'Offset'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorStoreNV)].operands.push(OperandId, "'Object'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorStoreNV)].operands.push(OperandMemoryAccess, "'Memory Access'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorStoreNV)].operands.push(OperandLiteralNumber, "", true); + InstructionDesc[enumCast(Op::OpCooperativeVectorStoreNV)].operands.push(OperandId, "", true); + + InstructionDesc[enumCast(Op::OpCooperativeVectorOuterProductAccumulateNV)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorOuterProductAccumulateNV)].operands.push(OperandId, "'Offset'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorOuterProductAccumulateNV)].operands.push(OperandId, "'A'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorOuterProductAccumulateNV)].operands.push(OperandId, "'B'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorOuterProductAccumulateNV)].operands.push(OperandId, "'MemoryLayout'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorOuterProductAccumulateNV)].operands.push(OperandId, "'MatrixInterpretation'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorOuterProductAccumulateNV)].operands.push(OperandId, "'MatrixStride'", true); + + InstructionDesc[enumCast(Op::OpCooperativeVectorReduceSumAccumulateNV)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorReduceSumAccumulateNV)].operands.push(OperandId, "'Offset'"); + InstructionDesc[enumCast(Op::OpCooperativeVectorReduceSumAccumulateNV)].operands.push(OperandId, "'V'"); + + InstructionDesc[enumCast(Op::OpDemoteToHelperInvocationEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpReadClockKHR)].operands.push(OperandScope, "'Scope'"); + + InstructionDesc[enumCast(Op::OpTypeHitObjectNV)].setResultAndType(true, false); + + InstructionDesc[enumCast(Op::OpHitObjectGetShaderRecordBufferHandleNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetShaderRecordBufferHandleNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpReorderThreadWithHintNV)].operands.push(OperandId, "'Hint'"); + InstructionDesc[enumCast(Op::OpReorderThreadWithHintNV)].operands.push(OperandId, "'Bits'"); + InstructionDesc[enumCast(Op::OpReorderThreadWithHintNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpReorderThreadWithHitObjectNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpReorderThreadWithHitObjectNV)].operands.push(OperandId, "'Hint'"); + InstructionDesc[enumCast(Op::OpReorderThreadWithHitObjectNV)].operands.push(OperandId, "'Bits'"); + InstructionDesc[enumCast(Op::OpReorderThreadWithHitObjectNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectGetCurrentTimeNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetCurrentTimeNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetHitKindNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetHitKindNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetPrimitiveIndexNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetPrimitiveIndexNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetGeometryIndexNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetGeometryIndexNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetInstanceIdNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetInstanceIdNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetInstanceCustomIndexNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetInstanceCustomIndexNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetObjectRayDirectionNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetObjectRayDirectionNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetObjectRayOriginNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetObjectRayOriginNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetWorldRayDirectionNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetWorldRayDirectionNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetWorldRayOriginNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetWorldRayOriginNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetWorldToObjectNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetWorldToObjectNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetObjectToWorldNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetObjectToWorldNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetRayTMaxNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetRayTMaxNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetRayTMinNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetRayTMinNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetShaderBindingTableRecordIndexNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetShaderBindingTableRecordIndexNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectIsEmptyNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectIsEmptyNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectIsHitNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectIsHitNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectIsMissNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectIsMissNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetAttributesNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetAttributesNV)].operands.push(OperandId, "'HitObjectAttribute'"); + InstructionDesc[enumCast(Op::OpHitObjectGetAttributesNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectExecuteShaderNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectExecuteShaderNV)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpHitObjectExecuteShaderNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectRecordHitNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitNV)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitNV)].operands.push(OperandId, "'InstanceId'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitNV)].operands.push(OperandId, "'PrimitiveId'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitNV)].operands.push(OperandId, "'GeometryIndex'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitNV)].operands.push(OperandId, "'HitKind'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitNV)].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitNV)].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitNV)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitNV)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitNV)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitNV)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitNV)].operands.push(OperandId, "'HitObject Attribute'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectRecordHitMotionNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitMotionNV)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitMotionNV)].operands.push(OperandId, "'InstanceId'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitMotionNV)].operands.push(OperandId, "'PrimitiveId'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitMotionNV)].operands.push(OperandId, "'GeometryIndex'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitMotionNV)].operands.push(OperandId, "'HitKind'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitMotionNV)].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitMotionNV)].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitMotionNV)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitMotionNV)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitMotionNV)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitMotionNV)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitMotionNV)].operands.push(OperandId, "'Current Time'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitMotionNV)].operands.push(OperandId, "'HitObject Attribute'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitMotionNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexNV)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexNV)].operands.push(OperandId, "'InstanceId'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexNV)].operands.push(OperandId, "'PrimitiveId'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexNV)].operands.push(OperandId, "'GeometryIndex'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexNV)].operands.push(OperandId, "'HitKind'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexNV)].operands.push(OperandId, "'SBT Record Index'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexNV)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexNV)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexNV)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexNV)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexNV)].operands.push(OperandId, "'HitObject Attribute'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexMotionNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexMotionNV)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexMotionNV)].operands.push(OperandId, "'InstanceId'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexMotionNV)].operands.push(OperandId, "'PrimitiveId'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexMotionNV)].operands.push(OperandId, "'GeometryIndex'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexMotionNV)].operands.push(OperandId, "'HitKind'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexMotionNV)].operands.push(OperandId, "'SBT Record Index'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexMotionNV)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexMotionNV)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexMotionNV)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexMotionNV)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexMotionNV)].operands.push(OperandId, "'Current Time'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexMotionNV)].operands.push(OperandId, "'HitObject Attribute'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordHitWithIndexMotionNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectRecordMissNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissNV)].operands.push(OperandId, "'SBT Index'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissNV)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissNV)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissNV)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissNV)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionNV)].operands.push(OperandId, "'SBT Index'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionNV)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionNV)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionNV)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionNV)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionNV)].operands.push(OperandId, "'Current Time'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectRecordEmptyNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordEmptyNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectTraceRayNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayNV)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayNV)].operands.push(OperandId, "'RayFlags'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayNV)].operands.push(OperandId, "'Cullmask'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayNV)].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayNV)].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayNV)].operands.push(OperandId, "'Miss Index'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayNV)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayNV)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayNV)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayNV)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayNV)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionNV)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionNV)].operands.push(OperandId, "'RayFlags'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionNV)].operands.push(OperandId, "'Cullmask'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionNV)].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionNV)].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionNV)].operands.push(OperandId, "'Miss Index'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionNV)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionNV)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionNV)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionNV)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionNV)].operands.push(OperandId, "'Time'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionNV)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionNV)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectGetClusterIdNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetClusterIdNV)].setResultAndType(true, true); + InstructionDesc[enumCast(Op::OpHitObjectGetSpherePositionNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetSpherePositionNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetSphereRadiusNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetSphereRadiusNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetLSSPositionsNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetLSSPositionsNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetLSSRadiiNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetLSSRadiiNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectIsSphereHitNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectIsSphereHitNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectIsLSSHitNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectIsLSSHitNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpFetchMicroTriangleVertexBarycentricNV)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpFetchMicroTriangleVertexBarycentricNV)].operands.push(OperandId, "'Instance ID'"); + InstructionDesc[enumCast(Op::OpFetchMicroTriangleVertexBarycentricNV)].operands.push(OperandId, "'Geometry Index'"); + InstructionDesc[enumCast(Op::OpFetchMicroTriangleVertexBarycentricNV)].operands.push(OperandId, "'Primitive Index'"); + InstructionDesc[enumCast(Op::OpFetchMicroTriangleVertexBarycentricNV)].operands.push(OperandId, "'Barycentrics'"); + InstructionDesc[enumCast(Op::OpFetchMicroTriangleVertexBarycentricNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpFetchMicroTriangleVertexPositionNV)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpFetchMicroTriangleVertexPositionNV)].operands.push(OperandId, "'Instance ID'"); + InstructionDesc[enumCast(Op::OpFetchMicroTriangleVertexPositionNV)].operands.push(OperandId, "'Geometry Index'"); + InstructionDesc[enumCast(Op::OpFetchMicroTriangleVertexPositionNV)].operands.push(OperandId, "'Primitive Index'"); + InstructionDesc[enumCast(Op::OpFetchMicroTriangleVertexPositionNV)].operands.push(OperandId, "'Barycentrics'"); + InstructionDesc[enumCast(Op::OpFetchMicroTriangleVertexPositionNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpColorAttachmentReadEXT)].operands.push(OperandId, "'Attachment'"); + InstructionDesc[enumCast(Op::OpColorAttachmentReadEXT)].operands.push(OperandId, "'Sample'", true); + InstructionDesc[enumCast(Op::OpStencilAttachmentReadEXT)].operands.push(OperandId, "'Sample'", true); + InstructionDesc[enumCast(Op::OpDepthAttachmentReadEXT)].operands.push(OperandId, "'Sample'", true); + + InstructionDesc[enumCast(Op::OpImageSampleWeightedQCOM)].operands.push(OperandId, "'source texture'"); + InstructionDesc[enumCast(Op::OpImageSampleWeightedQCOM)].operands.push(OperandId, "'texture coordinates'"); + InstructionDesc[enumCast(Op::OpImageSampleWeightedQCOM)].operands.push(OperandId, "'weights texture'"); + InstructionDesc[enumCast(Op::OpImageSampleWeightedQCOM)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageSampleWeightedQCOM)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpImageBoxFilterQCOM)].operands.push(OperandId, "'source texture'"); + InstructionDesc[enumCast(Op::OpImageBoxFilterQCOM)].operands.push(OperandId, "'texture coordinates'"); + InstructionDesc[enumCast(Op::OpImageBoxFilterQCOM)].operands.push(OperandId, "'box size'"); + InstructionDesc[enumCast(Op::OpImageBoxFilterQCOM)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageBoxFilterQCOM)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].operands.push(OperandId, "'target texture'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].operands.push(OperandId, "'target coordinates'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].operands.push(OperandId, "'reference texture'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].operands.push(OperandId, "'reference coordinates'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].operands.push(OperandId, "'block size'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].operands.push(OperandId, "'target texture'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].operands.push(OperandId, "'target coordinates'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].operands.push(OperandId, "'reference texture'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].operands.push(OperandId, "'reference coordinates'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].operands.push(OperandId, "'block size'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].operands.push(OperandId, "'target texture'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].operands.push(OperandId, "'target coordinates'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].operands.push(OperandId, "'reference texture'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].operands.push(OperandId, "'reference coordinates'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].operands.push(OperandId, "'block size'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].operands.push(OperandId, "'target texture'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].operands.push(OperandId, "'target coordinates'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].operands.push(OperandId, "'reference texture'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].operands.push(OperandId, "'reference coordinates'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].operands.push(OperandId, "'block size'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].operands.push(OperandId, "'target texture'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].operands.push(OperandId, "'target coordinates'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].operands.push(OperandId, "'reference texture'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].operands.push(OperandId, "'reference coordinates'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].operands.push(OperandId, "'block size'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].operands.push(OperandId, "'target texture'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].operands.push(OperandId, "'target coordinates'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].operands.push(OperandId, "'reference texture'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].operands.push(OperandId, "'reference coordinates'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].operands.push(OperandId, "'block size'"); + InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].operands.push(OperandImageOperands, "", true); + InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpBitCastArrayQCOM)].operands.push(OperandId, "'source array'"); + InstructionDesc[enumCast(Op::OpBitCastArrayQCOM)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpCompositeConstructCoopMatQCOM)].operands.push(OperandId, "'source array'"); + InstructionDesc[enumCast(Op::OpCompositeConstructCoopMatQCOM)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpCompositeExtractCoopMatQCOM)].operands.push(OperandId, "'source cooperative matrix'"); + InstructionDesc[enumCast(Op::OpCompositeExtractCoopMatQCOM)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpExtractSubArrayQCOM)].operands.push(OperandId, "'source array'"); + InstructionDesc[enumCast(Op::OpExtractSubArrayQCOM)].operands.push(OperandId, "'start index'"); + InstructionDesc[enumCast(Op::OpExtractSubArrayQCOM)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpConstantCompositeReplicateEXT)].operands.push(OperandId, "'Value'"); + InstructionDesc[enumCast(Op::OpSpecConstantCompositeReplicateEXT)].operands.push(OperandId, "'Value'"); + InstructionDesc[enumCast(Op::OpCompositeConstructReplicateEXT)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpCooperativeMatrixConvertNV)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpCooperativeMatrixTransposeNV)].operands.push(OperandId, "'Matrix'"); + + InstructionDesc[enumCast(Op::OpCooperativeMatrixReduceNV)].operands.push(OperandId, "'Matrix'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixReduceNV)].operands.push(OperandLiteralNumber, "'ReduceMask'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixReduceNV)].operands.push(OperandId, "'CombineFunc'"); + + InstructionDesc[enumCast(Op::OpCooperativeMatrixPerElementOpNV)].operands.push(OperandId, "'Matrix'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixPerElementOpNV)].operands.push(OperandId, "'Operation'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixPerElementOpNV)].operands.push(OperandVariableIds, "'Operands'"); + + InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadTensorNV)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadTensorNV)].operands.push(OperandId, "'Object'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadTensorNV)].operands.push(OperandId, "'TensorLayout'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadTensorNV)].operands.push(OperandMemoryAccess, "'Memory Access'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadTensorNV)].operands.push(OperandTensorAddressingOperands, "'Tensor Addressing Operands'"); + + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreTensorNV)].operands.push(OperandId, "'Pointer'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreTensorNV)].operands.push(OperandId, "'Object'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreTensorNV)].operands.push(OperandId, "'TensorLayout'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreTensorNV)].operands.push(OperandMemoryAccess, "'Memory Access'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixStoreTensorNV)].operands.push(OperandTensorAddressingOperands, "'Tensor Addressing Operands'"); + + InstructionDesc[enumCast(Op::OpCooperativeMatrixReduceNV)].operands.push(OperandId, "'Matrix'"); + InstructionDesc[enumCast(Op::OpCooperativeMatrixReduceNV)].operands.push(OperandLiteralNumber, "'ReduceMask'"); + + InstructionDesc[enumCast(Op::OpTypeTensorLayoutNV)].operands.push(OperandId, "'Dim'"); + InstructionDesc[enumCast(Op::OpTypeTensorLayoutNV)].operands.push(OperandId, "'ClampMode'"); + + InstructionDesc[enumCast(Op::OpTypeTensorViewNV)].operands.push(OperandId, "'Dim'"); + InstructionDesc[enumCast(Op::OpTypeTensorViewNV)].operands.push(OperandId, "'HasDimensions'"); + InstructionDesc[enumCast(Op::OpTypeTensorViewNV)].operands.push(OperandVariableIds, "'p'"); + + InstructionDesc[enumCast(Op::OpTensorLayoutSetBlockSizeNV)].operands.push(OperandId, "'TensorLayout'"); + InstructionDesc[enumCast(Op::OpTensorLayoutSetBlockSizeNV)].operands.push(OperandVariableIds, "'BlockSize'"); + + InstructionDesc[enumCast(Op::OpTensorLayoutSetDimensionNV)].operands.push(OperandId, "'TensorLayout'"); + InstructionDesc[enumCast(Op::OpTensorLayoutSetDimensionNV)].operands.push(OperandVariableIds, "'Dim'"); + + InstructionDesc[enumCast(Op::OpTensorLayoutSetStrideNV)].operands.push(OperandId, "'TensorLayout'"); + InstructionDesc[enumCast(Op::OpTensorLayoutSetStrideNV)].operands.push(OperandVariableIds, "'Stride'"); + + InstructionDesc[enumCast(Op::OpTensorLayoutSliceNV)].operands.push(OperandId, "'TensorLayout'"); + InstructionDesc[enumCast(Op::OpTensorLayoutSliceNV)].operands.push(OperandVariableIds, "'Operands'"); + + InstructionDesc[enumCast(Op::OpTensorLayoutSetClampValueNV)].operands.push(OperandId, "'TensorLayout'"); + InstructionDesc[enumCast(Op::OpTensorLayoutSetClampValueNV)].operands.push(OperandId, "'Value'"); + + InstructionDesc[enumCast(Op::OpTensorViewSetDimensionNV)].operands.push(OperandId, "'TensorView'"); + InstructionDesc[enumCast(Op::OpTensorViewSetDimensionNV)].operands.push(OperandVariableIds, "'Dim'"); + + InstructionDesc[enumCast(Op::OpTensorViewSetStrideNV)].operands.push(OperandId, "'TensorView'"); + InstructionDesc[enumCast(Op::OpTensorViewSetStrideNV)].operands.push(OperandVariableIds, "'Stride'"); + + InstructionDesc[enumCast(Op::OpTensorViewSetClipNV)].operands.push(OperandId, "'TensorView'"); + InstructionDesc[enumCast(Op::OpTensorViewSetClipNV)].operands.push(OperandId, "'ClipRowOffset'"); + InstructionDesc[enumCast(Op::OpTensorViewSetClipNV)].operands.push(OperandId, "'ClipRowSpan'"); + InstructionDesc[enumCast(Op::OpTensorViewSetClipNV)].operands.push(OperandId, "'ClipColOffset'"); + InstructionDesc[enumCast(Op::OpTensorViewSetClipNV)].operands.push(OperandId, "'ClipColSpan'"); + + InstructionDesc[enumCast(Op::OpSDotKHR)].operands.push(OperandId, "'Vector1'"); + InstructionDesc[enumCast(Op::OpSDotKHR)].operands.push(OperandId, "'Vector2'"); + InstructionDesc[enumCast(Op::OpSDotKHR)].operands.push(OperandLiteralNumber, "'PackedVectorFormat'"); + + InstructionDesc[enumCast(Op::OpUDotKHR)].operands.push(OperandId, "'Vector1'"); + InstructionDesc[enumCast(Op::OpUDotKHR)].operands.push(OperandId, "'Vector2'"); + InstructionDesc[enumCast(Op::OpUDotKHR)].operands.push(OperandLiteralNumber, "'PackedVectorFormat'"); + + InstructionDesc[enumCast(Op::OpSUDotKHR)].operands.push(OperandId, "'Vector1'"); + InstructionDesc[enumCast(Op::OpSUDotKHR)].operands.push(OperandId, "'Vector2'"); + InstructionDesc[enumCast(Op::OpSUDotKHR)].operands.push(OperandLiteralNumber, "'PackedVectorFormat'"); + + InstructionDesc[enumCast(Op::OpSDotAccSatKHR)].operands.push(OperandId, "'Vector1'"); + InstructionDesc[enumCast(Op::OpSDotAccSatKHR)].operands.push(OperandId, "'Vector2'"); + InstructionDesc[enumCast(Op::OpSDotAccSatKHR)].operands.push(OperandId, "'Accumulator'"); + InstructionDesc[enumCast(Op::OpSDotAccSatKHR)].operands.push(OperandLiteralNumber, "'PackedVectorFormat'"); + + InstructionDesc[enumCast(Op::OpUDotAccSatKHR)].operands.push(OperandId, "'Vector1'"); + InstructionDesc[enumCast(Op::OpUDotAccSatKHR)].operands.push(OperandId, "'Vector2'"); + InstructionDesc[enumCast(Op::OpUDotAccSatKHR)].operands.push(OperandId, "'Accumulator'"); + InstructionDesc[enumCast(Op::OpUDotAccSatKHR)].operands.push(OperandLiteralNumber, "'PackedVectorFormat'"); + + InstructionDesc[enumCast(Op::OpSUDotAccSatKHR)].operands.push(OperandId, "'Vector1'"); + InstructionDesc[enumCast(Op::OpSUDotAccSatKHR)].operands.push(OperandId, "'Vector2'"); + InstructionDesc[enumCast(Op::OpSUDotAccSatKHR)].operands.push(OperandId, "'Accumulator'"); + InstructionDesc[enumCast(Op::OpSUDotAccSatKHR)].operands.push(OperandLiteralNumber, "'PackedVectorFormat'"); + + InstructionDesc[enumCast(Op::OpTypeTensorARM)].operands.push(OperandId, "'Element Type'"); + InstructionDesc[enumCast(Op::OpTypeTensorARM)].operands.push(OperandId, "'Rank'"); + + InstructionDesc[enumCast(Op::OpTensorReadARM)].operands.push(OperandId, "'Tensor'"); + InstructionDesc[enumCast(Op::OpTensorReadARM)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpTensorReadARM)].operands.push(OperandLiteralNumber, "'Tensor Operand'", true); + InstructionDesc[enumCast(Op::OpTensorReadARM)].operands.push(OperandVariableIds, "'Tensor Operands'"); + + InstructionDesc[enumCast(Op::OpTensorWriteARM)].operands.push(OperandId, "'Tensor'"); + InstructionDesc[enumCast(Op::OpTensorWriteARM)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpTensorWriteARM)].operands.push(OperandId, "'Object'"); + InstructionDesc[enumCast(Op::OpTensorWriteARM)].operands.push(OperandLiteralNumber, "'Tensor Operand'", true); + InstructionDesc[enumCast(Op::OpTensorWriteARM)].operands.push(OperandVariableIds, "'Tensor Operands'"); + + InstructionDesc[enumCast(Op::OpTensorQuerySizeARM)].operands.push(OperandId, "'Tensor'"); + InstructionDesc[enumCast(Op::OpTensorQuerySizeARM)].operands.push(OperandId, "'Dimension'", true); + + InstructionDesc[enumCast(Op::OpTypeHitObjectEXT)].setResultAndType(true, false); + + InstructionDesc[enumCast(Op::OpHitObjectGetShaderRecordBufferHandleNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetShaderRecordBufferHandleNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetShaderRecordBufferHandleEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetShaderRecordBufferHandleEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpReorderThreadWithHintEXT)].operands.push(OperandId, "'Hint'"); + InstructionDesc[enumCast(Op::OpReorderThreadWithHintEXT)].operands.push(OperandId, "'Bits'"); + InstructionDesc[enumCast(Op::OpReorderThreadWithHintEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpReorderThreadWithHitObjectEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpReorderThreadWithHitObjectEXT)].operands.push(OperandId, "'Hint'"); + InstructionDesc[enumCast(Op::OpReorderThreadWithHitObjectEXT)].operands.push(OperandId, "'Bits'"); + InstructionDesc[enumCast(Op::OpReorderThreadWithHitObjectEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectGetCurrentTimeEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetCurrentTimeEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetHitKindEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetHitKindEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetPrimitiveIndexEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetPrimitiveIndexEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetGeometryIndexEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetGeometryIndexEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetInstanceIdEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetInstanceIdEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetInstanceCustomIndexEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetInstanceCustomIndexEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetObjectRayDirectionEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetObjectRayDirectionEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetObjectRayOriginEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetObjectRayOriginEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetWorldRayDirectionEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetWorldRayDirectionEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetWorldRayOriginEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetWorldRayOriginEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetWorldToObjectEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetWorldToObjectEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetObjectToWorldEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetObjectToWorldEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetRayTMaxEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetRayTMaxEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetRayTMinEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetRayTMinEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetRayFlagsEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetRayFlagsEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetShaderBindingTableRecordIndexEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetShaderBindingTableRecordIndexEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectIsEmptyEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectIsEmptyEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectIsHitEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectIsHitEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectIsMissEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectIsMissEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetAttributesEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetAttributesEXT)].operands.push(OperandId, "'HitObjectAttribute'"); + InstructionDesc[enumCast(Op::OpHitObjectGetAttributesEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectExecuteShaderEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectExecuteShaderEXT)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpHitObjectExecuteShaderEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'RayFlags'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'SBT Index'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'RayFlags'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'SBT Index'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'Current Time'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectRecordEmptyEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordEmptyEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'RayFlags'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'Cullmask'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'Miss Index'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'RayFlags'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Cullmask'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Miss Index'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Time'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectSetShaderBindingTableRecordIndexEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectSetShaderBindingTableRecordIndexEXT)].operands.push(OperandId, "'SBT Record Index'"); + InstructionDesc[enumCast(Op::OpHitObjectSetShaderBindingTableRecordIndexEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectReorderExecuteShaderEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectReorderExecuteShaderEXT)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpHitObjectReorderExecuteShaderEXT)].operands.push(OperandId, "'Hint'"); + InstructionDesc[enumCast(Op::OpHitObjectReorderExecuteShaderEXT)].operands.push(OperandId, "'Bits'"); + InstructionDesc[enumCast(Op::OpHitObjectReorderExecuteShaderEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'RayFlags'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Cullmask'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Miss Index'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Hint'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Bits'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'RayFlags'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Cullmask'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Miss Index'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Time'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Hint'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Bits'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectRecordFromQueryEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordFromQueryEXT)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordFromQueryEXT)].operands.push(OperandId, "'SBT Record Index'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordFromQueryEXT)].operands.push(OperandId, "'HitObjectAttribute'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordFromQueryEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT)].setResultAndType(true, true); + + }); +} + +} // end spv namespace diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/doc.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/doc.h new file mode 100644 index 0000000000..c818308e2d --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/doc.h @@ -0,0 +1,261 @@ +// +// Copyright (C) 2014-2015 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// +// Parameterize the SPIR-V enumerants. +// + +#pragma once + +#include "spirv.hpp11" + +#include + +namespace spv { + +// Fill in all the parameters +void Parameterize(); + +// Return the English names of all the enums. +const char* SourceString(int); +const char* AddressingString(int); +const char* MemoryString(int); +const char* ExecutionModelString(int); +const char* ExecutionModeString(int); +const char* StorageClassString(int); +const char* DecorationString(int); +const char* BuiltInString(int); +const char* DimensionString(int); +const char* SelectControlString(int); +const char* LoopControlString(int); +const char* FunctionControlString(int); +const char* SamplerAddressingModeString(int); +const char* SamplerFilterModeString(int); +const char* ImageFormatString(int); +const char* ImageChannelOrderString(int); +const char* ImageChannelTypeString(int); +const char* ImageChannelDataTypeString(int type); +const char* ImageOperandsString(int format); +const char* ImageOperands(int); +const char* FPFastMathString(int); +const char* FPRoundingModeString(int); +const char* LinkageTypeString(int); +const char* FuncParamAttrString(int); +const char* AccessQualifierString(int); +const char* MemorySemanticsString(int); +const char* MemoryAccessString(int); +const char* ExecutionScopeString(int); +const char* GroupOperationString(int); +const char* KernelEnqueueFlagsString(int); +const char* KernelProfilingInfoString(int); +const char* CapabilityString(int); +const char* OpcodeString(int); +const char* ScopeString(int mem); + +// For grouping opcodes into subsections +enum OpcodeClass { + OpClassMisc, + OpClassDebug, + OpClassAnnotate, + OpClassExtension, + OpClassMode, + OpClassType, + OpClassConstant, + OpClassMemory, + OpClassFunction, + OpClassImage, + OpClassConvert, + OpClassComposite, + OpClassArithmetic, + OpClassBit, + OpClassRelationalLogical, + OpClassDerivative, + OpClassFlowControl, + OpClassAtomic, + OpClassPrimitive, + OpClassBarrier, + OpClassGroup, + OpClassDeviceSideEnqueue, + OpClassPipe, + + OpClassCount, + OpClassMissing // all instructions start out as missing +}; + +// For parameterizing operands. +enum OperandClass { + OperandNone, + OperandId, + OperandVariableIds, + OperandOptionalLiteral, + OperandOptionalLiteralString, + OperandVariableLiterals, + OperandVariableIdLiteral, + OperandVariableLiteralId, + OperandLiteralNumber, + OperandLiteralString, + OperandVariableLiteralStrings, + OperandSource, + OperandExecutionModel, + OperandAddressing, + OperandMemory, + OperandExecutionMode, + OperandStorage, + OperandDimensionality, + OperandSamplerAddressingMode, + OperandSamplerFilterMode, + OperandSamplerImageFormat, + OperandImageChannelOrder, + OperandImageChannelDataType, + OperandImageOperands, + OperandFPFastMath, + OperandFPRoundingMode, + OperandLinkageType, + OperandAccessQualifier, + OperandFuncParamAttr, + OperandDecoration, + OperandBuiltIn, + OperandSelect, + OperandLoop, + OperandFunction, + OperandMemorySemantics, + OperandMemoryAccess, + OperandScope, + OperandGroupOperation, + OperandKernelEnqueueFlags, + OperandKernelProfilingInfo, + OperandCapability, + OperandCooperativeMatrixOperands, + OperandTensorAddressingOperands, + + OperandOpcode, + + OperandCount +}; + +// Any specific enum can have a set of capabilities that allow it: +typedef std::vector EnumCaps; + +// Parameterize a set of operands with their OperandClass(es) and descriptions. +class OperandParameters { +public: + OperandParameters() { } + void push(OperandClass oc, const char* d, bool opt = false) + { + opClass.push_back(oc); + desc.push_back(d); + optional.push_back(opt); + } + void setOptional(); + OperandClass getClass(int op) const { return opClass[op]; } + const char* getDesc(int op) const { return desc[op]; } + bool isOptional(int op) const { return optional[op]; } + int getNum() const { return (int)opClass.size(); } + +protected: + std::vector opClass; + std::vector desc; + std::vector optional; +}; + +// Parameterize an enumerant +class EnumParameters { +public: + EnumParameters() : desc(nullptr) { } + const char* desc; +}; + +// Parameterize a set of enumerants that form an enum +class EnumDefinition : public EnumParameters { +public: + EnumDefinition() : + ceiling(0), bitmask(false), getName(nullptr), enumParams(nullptr), operandParams(nullptr) { } + void set(int ceil, const char* (*name)(int), EnumParameters* ep, bool mask = false) + { + ceiling = ceil; + getName = name; + bitmask = mask; + enumParams = ep; + } + void setOperands(OperandParameters* op) { operandParams = op; } + int ceiling; // ceiling of enumerants + bool bitmask; // true if these enumerants combine into a bitmask + const char* (*getName)(int); // a function that returns the name for each enumerant value (or shift) + EnumParameters* enumParams; // parameters for each individual enumerant + OperandParameters* operandParams; // sets of operands +}; + +// Parameterize an instruction's logical format, including its known set of operands, +// per OperandParameters above. +class InstructionParameters { +public: + InstructionParameters() : + opDesc("TBD"), + opClass(OpClassMissing), + typePresent(true), // most normal, only exceptions have to be spelled out + resultPresent(true) // most normal, only exceptions have to be spelled out + { } + + void setResultAndType(bool r, bool t) + { + resultPresent = r; + typePresent = t; + } + + bool hasResult() const { return resultPresent != 0; } + bool hasType() const { return typePresent != 0; } + + const char* opDesc; + OpcodeClass opClass; + OperandParameters operands; + +protected: + bool typePresent : 1; + bool resultPresent : 1; +}; + +// The set of objects that hold all the instruction/operand +// parameterization information. +extern InstructionParameters InstructionDesc[]; + +// These hold definitions of the enumerants used for operands +extern EnumDefinition OperandClassParams[]; + +const char* GetOperandDesc(OperandClass operand); +void PrintImmediateRow(int imm, const char* name, const EnumParameters* enumParams, bool caps, bool hex = false); +const char* AccessQualifierString(int attr); + +void PrintOperands(const OperandParameters& operands, int reservedOperands); + +} // end namespace spv diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/hex_float.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/hex_float.h new file mode 100644 index 0000000000..c2259e3f4c --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/hex_float.h @@ -0,0 +1,1174 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_UTIL_HEX_FLOAT_H_ +#define LIBSPIRV_UTIL_HEX_FLOAT_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include "bitutils.h" + +namespace spvutils { + +class Float16 { + public: + Float16(uint16_t v) : val(v) {} + Float16() {} + static bool isNan(const Float16& val) { + return ((val.val & 0x7C00) == 0x7C00) && ((val.val & 0x3FF) != 0); + } + // Returns true if the given value is any kind of infinity. + static bool isInfinity(const Float16& val) { + return ((val.val & 0x7C00) == 0x7C00) && ((val.val & 0x3FF) == 0); + } + Float16(const Float16& other) { val = other.val; } + uint16_t get_value() const { return val; } + + // Returns the maximum normal value. + static Float16 max() { return Float16(0x7bff); } + // Returns the lowest normal value. + static Float16 lowest() { return Float16(0xfbff); } + + private: + uint16_t val; +}; + +class FloatE5M2 { + public: + FloatE5M2(uint8_t v) : val(v) {} + FloatE5M2() {} + static bool isNan(const FloatE5M2& val) { + return ((val.val & 0x7C) == 0x7C) && ((val.val & 0x3) != 0); + } + // Returns true if the given value is any kind of infinity. + static bool isInfinity(const FloatE5M2& val) { + return ((val.val & 0x7C) == 0x7C) && ((val.val & 0x3) == 0); + } + FloatE5M2(const FloatE5M2& other) { val = other.val; } + uint8_t get_value() const { return val; } + + // Returns the maximum normal value. + static FloatE5M2 max() { return FloatE5M2(0x7B); } + // Returns the lowest normal value. + static FloatE5M2 lowest() { return FloatE5M2(0xFB); } + + private: + uint8_t val; +}; + +class FloatE4M3 { + public: + FloatE4M3(uint8_t v) : val(v) {} + FloatE4M3() {} + static bool isNan(const FloatE4M3& val) { + return (val.val & 0x7F) == 0x7F; + } + // Returns true if the given value is any kind of infinity. + static bool isInfinity(const FloatE4M3&) { + return false; + } + FloatE4M3(const FloatE4M3& other) { val = other.val; } + uint8_t get_value() const { return val; } + + // Returns the maximum normal value. + static FloatE4M3 max() { return FloatE4M3(0x7E); } + // Returns the lowest normal value. + static FloatE4M3 lowest() { return FloatE4M3(0xFE); } + + private: + uint8_t val; +}; + +// To specialize this type, you must override uint_type to define +// an unsigned integer that can fit your floating point type. +// You must also add a isNan function that returns true if +// a value is Nan. +template +struct FloatProxyTraits { + typedef void uint_type; +}; + +template <> +struct FloatProxyTraits { + typedef uint32_t uint_type; + static bool isNan(float f) { return std::isnan(f); } + // Returns true if the given value is any kind of infinity. + static bool isInfinity(float f) { return std::isinf(f); } + // Returns the maximum normal value. + static float max() { return std::numeric_limits::max(); } + // Returns the lowest normal value. + static float lowest() { return std::numeric_limits::lowest(); } +}; + +template <> +struct FloatProxyTraits { + typedef uint64_t uint_type; + static bool isNan(double f) { return std::isnan(f); } + // Returns true if the given value is any kind of infinity. + static bool isInfinity(double f) { return std::isinf(f); } + // Returns the maximum normal value. + static double max() { return std::numeric_limits::max(); } + // Returns the lowest normal value. + static double lowest() { return std::numeric_limits::lowest(); } +}; + +template <> +struct FloatProxyTraits { + typedef uint16_t uint_type; + static bool isNan(Float16 f) { return Float16::isNan(f); } + // Returns true if the given value is any kind of infinity. + static bool isInfinity(Float16 f) { return Float16::isInfinity(f); } + // Returns the maximum normal value. + static Float16 max() { return Float16::max(); } + // Returns the lowest normal value. + static Float16 lowest() { return Float16::lowest(); } +}; + +template <> +struct FloatProxyTraits { + typedef uint8_t uint_type; + static bool isNan(FloatE5M2 f) { return FloatE5M2::isNan(f); } + // Returns true if the given value is any kind of infinity. + static bool isInfinity(FloatE5M2 f) { return FloatE5M2::isInfinity(f); } + // Returns the maximum normal value. + static FloatE5M2 max() { return FloatE5M2::max(); } + // Returns the lowest normal value. + static FloatE5M2 lowest() { return FloatE5M2::lowest(); } +}; + +template <> +struct FloatProxyTraits { + typedef uint8_t uint_type; + static bool isNan(FloatE4M3 f) { return FloatE4M3::isNan(f); } + // Returns true if the given value is any kind of infinity. + static bool isInfinity(FloatE4M3 f) { return FloatE4M3::isInfinity(f); } + // Returns the maximum normal value. + static FloatE4M3 max() { return FloatE4M3::max(); } + // Returns the lowest normal value. + static FloatE4M3 lowest() { return FloatE4M3::lowest(); } +}; + +// Since copying a floating point number (especially if it is NaN) +// does not guarantee that bits are preserved, this class lets us +// store the type and use it as a float when necessary. +template +class FloatProxy { + public: + typedef typename FloatProxyTraits::uint_type uint_type; + + // Since this is to act similar to the normal floats, + // do not initialize the data by default. + FloatProxy() {} + + // Intentionally non-explicit. This is a proxy type so + // implicit conversions allow us to use it more transparently. + FloatProxy(T val) { data_ = BitwiseCast(val); } + + // Intentionally non-explicit. This is a proxy type so + // implicit conversions allow us to use it more transparently. + FloatProxy(uint_type val) { data_ = val; } + + // This is helpful to have and is guaranteed not to stomp bits. + FloatProxy operator-() const { + return static_cast(data_ ^ + (uint_type(0x1) << (sizeof(T) * 8 - 1))); + } + + // Returns the data as a floating point value. + T getAsFloat() const { return BitwiseCast(data_); } + + // Returns the raw data. + uint_type data() const { return data_; } + + // Returns true if the value represents any type of NaN. + bool isNan() { return FloatProxyTraits::isNan(getAsFloat()); } + // Returns true if the value represents any type of infinity. + bool isInfinity() { return FloatProxyTraits::isInfinity(getAsFloat()); } + + // Returns the maximum normal value. + static FloatProxy max() { + return FloatProxy(FloatProxyTraits::max()); + } + // Returns the lowest normal value. + static FloatProxy lowest() { + return FloatProxy(FloatProxyTraits::lowest()); + } + + private: + uint_type data_; +}; + +template +bool operator==(const FloatProxy& first, const FloatProxy& second) { + return first.data() == second.data(); +} + +// Reads a FloatProxy value as a normal float from a stream. +template +std::istream& operator>>(std::istream& is, FloatProxy& value) { + T float_val; + is >> float_val; + value = FloatProxy(float_val); + return is; +} + +// This is an example traits. It is not meant to be used in practice, but will +// be the default for any non-specialized type. +template +struct HexFloatTraits { + // Integer type that can store this hex-float. + typedef void uint_type; + // Signed integer type that can store this hex-float. + typedef void int_type; + // The numerical type that this HexFloat represents. + typedef void underlying_type; + // The type needed to construct the underlying type. + typedef void native_type; + // The number of bits that are actually relevant in the uint_type. + // This allows us to deal with, for example, 24-bit values in a 32-bit + // integer. + static const uint32_t num_used_bits = 0; + // Number of bits that represent the exponent. + static const uint32_t num_exponent_bits = 0; + // Number of bits that represent the fractional part. + static const uint32_t num_fraction_bits = 0; + // The bias of the exponent. (How much we need to subtract from the stored + // value to get the correct value.) + static const uint32_t exponent_bias = 0; + static bool supportsInfinity() { return true; } +}; + +// Traits for IEEE float. +// 1 sign bit, 8 exponent bits, 23 fractional bits. +template <> +struct HexFloatTraits> { + typedef uint32_t uint_type; + typedef int32_t int_type; + typedef FloatProxy underlying_type; + typedef float native_type; + static const uint_type num_used_bits = 32; + static const uint_type num_exponent_bits = 8; + static const uint_type num_fraction_bits = 23; + static const uint_type exponent_bias = 127; + static bool supportsInfinity() { return true; } +}; + +// Traits for IEEE double. +// 1 sign bit, 11 exponent bits, 52 fractional bits. +template <> +struct HexFloatTraits> { + typedef uint64_t uint_type; + typedef int64_t int_type; + typedef FloatProxy underlying_type; + typedef double native_type; + static const uint_type num_used_bits = 64; + static const uint_type num_exponent_bits = 11; + static const uint_type num_fraction_bits = 52; + static const uint_type exponent_bias = 1023; + static bool supportsInfinity() { return true; } +}; + +// Traits for IEEE half. +// 1 sign bit, 5 exponent bits, 10 fractional bits. +template <> +struct HexFloatTraits> { + typedef uint16_t uint_type; + typedef int16_t int_type; + typedef uint16_t underlying_type; + typedef uint16_t native_type; + static const uint_type num_used_bits = 16; + static const uint_type num_exponent_bits = 5; + static const uint_type num_fraction_bits = 10; + static const uint_type exponent_bias = 15; + static bool supportsInfinity() { return true; } +}; + +template <> +struct HexFloatTraits> { + typedef uint8_t uint_type; + typedef int8_t int_type; + typedef uint8_t underlying_type; + typedef uint8_t native_type; + static const uint_type num_used_bits = 8; + static const uint_type num_exponent_bits = 5; + static const uint_type num_fraction_bits = 2; + static const uint_type exponent_bias = 15; + static bool supportsInfinity() { return true; } +}; + +template <> +struct HexFloatTraits> { + typedef uint8_t uint_type; + typedef int8_t int_type; + typedef uint8_t underlying_type; + typedef uint8_t native_type; + static const uint_type num_used_bits = 8; + static const uint_type num_exponent_bits = 4; + static const uint_type num_fraction_bits = 3; + static const uint_type exponent_bias = 7; + static bool supportsInfinity() { return false; } +}; + +enum round_direction { + kRoundToZero, + kRoundToNearestEven, + kRoundToPositiveInfinity, + kRoundToNegativeInfinity +}; + +// Template class that houses a floating pointer number. +// It exposes a number of constants based on the provided traits to +// assist in interpreting the bits of the value. +template > +class HexFloat { + public: + typedef typename Traits::uint_type uint_type; + typedef typename Traits::int_type int_type; + typedef typename Traits::underlying_type underlying_type; + typedef typename Traits::native_type native_type; + using Traits_T = Traits; + + explicit HexFloat(T f) : value_(f) {} + + T value() const { return value_; } + void set_value(T f) { value_ = f; } + + // These are all written like this because it is convenient to have + // compile-time constants for all of these values. + + // Pass-through values to save typing. + static const uint32_t num_used_bits = Traits::num_used_bits; + static const uint32_t exponent_bias = Traits::exponent_bias; + static const uint32_t num_exponent_bits = Traits::num_exponent_bits; + static const uint32_t num_fraction_bits = Traits::num_fraction_bits; + + // Number of bits to shift left to set the highest relevant bit. + static const uint32_t top_bit_left_shift = num_used_bits - 1; + // How many nibbles (hex characters) the fractional part takes up. + static const uint32_t fraction_nibbles = (num_fraction_bits + 3) / 4; + // If the fractional part does not fit evenly into a hex character (4-bits) + // then we have to left-shift to get rid of leading 0s. This is the amount + // we have to shift (might be 0). + static const uint32_t num_overflow_bits = + fraction_nibbles * 4 - num_fraction_bits; + + // The representation of the fraction, not the actual bits. This + // includes the leading bit that is usually implicit. + static const uint_type fraction_represent_mask = + spvutils::SetBits::get; + + // The topmost bit in the nibble-aligned fraction. + static const uint_type fraction_top_bit = + uint_type(1) << (num_fraction_bits + num_overflow_bits - 1); + + // The least significant bit in the exponent, which is also the bit + // immediately to the left of the significand. + static const uint_type first_exponent_bit = uint_type(1) + << (num_fraction_bits); + + // The mask for the encoded fraction. It does not include the + // implicit bit. + static const uint_type fraction_encode_mask = + spvutils::SetBits::get; + + // The bit that is used as a sign. + static const uint_type sign_mask = uint_type(1) << top_bit_left_shift; + + // The bits that represent the exponent. + static const uint_type exponent_mask = + spvutils::SetBits::get; + + // How far left the exponent is shifted. + static const uint32_t exponent_left_shift = num_fraction_bits; + + // How far from the right edge the fraction is shifted. + static const uint32_t fraction_right_shift = + static_cast(sizeof(uint_type) * 8) - num_fraction_bits; + + // The maximum representable unbiased exponent. + static const int_type max_exponent = + (exponent_mask >> num_fraction_bits) - exponent_bias; + // The minimum representable exponent for normalized numbers. + static const int_type min_exponent = -static_cast(exponent_bias); + + // Returns the bits associated with the value. + uint_type getBits() const { return spvutils::BitwiseCast(value_); } + + // Returns the bits associated with the value, without the leading sign bit. + uint_type getUnsignedBits() const { + return static_cast(spvutils::BitwiseCast(value_) & + ~sign_mask); + } + + // Returns the bits associated with the exponent, shifted to start at the + // lsb of the type. + const uint_type getExponentBits() const { + return static_cast((getBits() & exponent_mask) >> + num_fraction_bits); + } + + // Returns the exponent in unbiased form. This is the exponent in the + // human-friendly form. + const int_type getUnbiasedExponent() const { + return static_cast(getExponentBits() - exponent_bias); + } + + // Returns just the significand bits from the value. + const uint_type getSignificandBits() const { + return getBits() & fraction_encode_mask; + } + + // If the number was normalized, returns the unbiased exponent. + // If the number was denormal, normalize the exponent first. + const int_type getUnbiasedNormalizedExponent() const { + if ((getBits() & ~sign_mask) == 0) { // special case if everything is 0 + return 0; + } + int_type exp = getUnbiasedExponent(); + if (exp == min_exponent) { // We are in denorm land. + uint_type significand_bits = getSignificandBits(); + while ((significand_bits & (first_exponent_bit >> 1)) == 0) { + significand_bits = static_cast(significand_bits << 1); + exp = static_cast(exp - 1); + } + significand_bits &= fraction_encode_mask; + } + return exp; + } + + // Returns the signficand after it has been normalized. + const uint_type getNormalizedSignificand() const { + int_type unbiased_exponent = getUnbiasedNormalizedExponent(); + uint_type significand = getSignificandBits(); + for (int_type i = unbiased_exponent; i <= min_exponent; ++i) { + significand = static_cast(significand << 1); + } + significand &= fraction_encode_mask; + return significand; + } + + // Returns true if this number represents a negative value. + bool isNegative() const { return (getBits() & sign_mask) != 0; } + + // Sets this HexFloat from the individual components. + // Note this assumes EVERY significand is normalized, and has an implicit + // leading one. This means that the only way that this method will set 0, + // is if you set a number so denormalized that it underflows. + // Do not use this method with raw bits extracted from a subnormal number, + // since subnormals do not have an implicit leading 1 in the significand. + // The significand is also expected to be in the + // lowest-most num_fraction_bits of the uint_type. + // The exponent is expected to be unbiased, meaning an exponent of + // 0 actually means 0. + // If underflow_round_up is set, then on underflow, if a number is non-0 + // and would underflow, we round up to the smallest denorm. + void setFromSignUnbiasedExponentAndNormalizedSignificand( + bool negative, int_type exponent, uint_type significand, + bool round_denorm_up) { + bool significand_is_zero = significand == 0; + + if (exponent <= min_exponent) { + // If this was denormalized, then we have to shift the bit on, meaning + // the significand is not zero. + significand_is_zero = false; + significand |= first_exponent_bit; + significand = static_cast(significand >> 1); + } + + while (exponent < min_exponent) { + significand = static_cast(significand >> 1); + ++exponent; + } + + if (exponent == min_exponent) { + if (significand == 0 && !significand_is_zero && round_denorm_up) { + significand = static_cast(0x1); + } + } + + uint_type new_value = 0; + if (negative) { + new_value = static_cast(new_value | sign_mask); + } + exponent = static_cast(exponent + exponent_bias); + assert(exponent >= 0); + + // put it all together + exponent = static_cast((exponent << exponent_left_shift) & + exponent_mask); + significand = static_cast(significand & fraction_encode_mask); + new_value = static_cast(new_value | (exponent | significand)); + value_ = BitwiseCast(new_value); + } + + // Increments the significand of this number by the given amount. + // If this would spill the significand into the implicit bit, + // carry is set to true and the significand is shifted to fit into + // the correct location, otherwise carry is set to false. + // All significands and to_increment are assumed to be within the bounds + // for a valid significand. + static uint_type incrementSignificand(uint_type significand, + uint_type to_increment, bool* carry) { + significand = static_cast(significand + to_increment); + *carry = false; + if (significand & first_exponent_bit) { + *carry = true; + // The implicit 1-bit will have carried, so we should zero-out the + // top bit and shift back. + significand = static_cast(significand & ~first_exponent_bit); + significand = static_cast(significand >> 1); + } + return significand; + } + + // These exist because MSVC throws warnings on negative right-shifts + // even if they are not going to be executed. Eg: + // constant_number < 0? 0: constant_number + // These convert the negative left-shifts into right shifts. + + template + uint_type negatable_left_shift(int_type N, uint_type val) + { + if(N >= 0) + return val << N; + + return val >> -N; + } + + template + uint_type negatable_right_shift(int_type N, uint_type val) + { + if(N >= 0) + return val >> N; + + return val << -N; + } + + // Returns the significand, rounded to fit in a significand in + // other_T. This is shifted so that the most significant + // bit of the rounded number lines up with the most significant bit + // of the returned significand. + template + typename other_T::uint_type getRoundedNormalizedSignificand( + round_direction dir, bool* carry_bit) { + typedef typename other_T::uint_type other_uint_type; + static const int_type num_throwaway_bits = + static_cast(num_fraction_bits) - + static_cast(other_T::num_fraction_bits); + + static const uint_type last_significant_bit = + (num_throwaway_bits < 0) + ? 0 + : negatable_left_shift(num_throwaway_bits, 1u); + static const uint_type first_rounded_bit = + (num_throwaway_bits < 1) + ? 0 + : negatable_left_shift(num_throwaway_bits - 1, 1u); + + static const uint_type throwaway_mask_bits = + num_throwaway_bits > 0 ? num_throwaway_bits : 0; + static const uint_type throwaway_mask = + spvutils::SetBits::get; + + *carry_bit = false; + other_uint_type out_val = 0; + uint_type significand = getNormalizedSignificand(); + // If we are up-casting, then we just have to shift to the right location. + if (num_throwaway_bits <= 0) { + out_val = static_cast(significand); + uint_type shift_amount = static_cast(-num_throwaway_bits); + out_val = static_cast(out_val << shift_amount); + return out_val; + } + + // If every non-representable bit is 0, then we don't have any casting to + // do. + if ((significand & throwaway_mask) == 0) { + return static_cast( + negatable_right_shift(num_throwaway_bits, significand)); + } + + bool round_away_from_zero = false; + // We actually have to narrow the significand here, so we have to follow the + // rounding rules. + switch (dir) { + case kRoundToZero: + break; + case kRoundToPositiveInfinity: + round_away_from_zero = !isNegative(); + break; + case kRoundToNegativeInfinity: + round_away_from_zero = isNegative(); + break; + case kRoundToNearestEven: + // Have to round down, round bit is 0 + if ((first_rounded_bit & significand) == 0) { + break; + } + if (((significand & throwaway_mask) & ~first_rounded_bit) != 0) { + // If any subsequent bit of the rounded portion is non-0 then we round + // up. + round_away_from_zero = true; + break; + } + // We are exactly half-way between 2 numbers, pick even. + if ((significand & last_significant_bit) != 0) { + // 1 for our last bit, round up. + round_away_from_zero = true; + break; + } + break; + } + + if (round_away_from_zero) { + return static_cast( + negatable_right_shift(num_throwaway_bits, incrementSignificand( + significand, last_significant_bit, carry_bit))); + } else { + return static_cast( + negatable_right_shift(num_throwaway_bits, significand)); + } + } + + // Casts this value to another HexFloat. If the cast is widening, + // then round_dir is ignored. If the cast is narrowing, then + // the result is rounded in the direction specified. + // This number will retain Nan and Inf values. + // It will also saturate to Inf if the number overflows, and + // underflow to (0 or min depending on rounding) if the number underflows. + template + void castTo(other_T& other, round_direction round_dir) { + other = other_T(static_cast(0)); + bool negate = isNegative(); + if (getUnsignedBits() == 0) { + if (negate) { + other.set_value(-other.value()); + } + return; + } + uint_type significand = getSignificandBits(); + bool carried = false; + typename other_T::uint_type rounded_significand = + getRoundedNormalizedSignificand(round_dir, &carried); + + int_type exponent = getUnbiasedExponent(); + if (exponent == min_exponent) { + // If we are denormal, normalize the exponent, so that we can encode + // easily. + exponent = static_cast(exponent + 1); + for (uint_type check_bit = first_exponent_bit >> 1; check_bit != 0; + check_bit = static_cast(check_bit >> 1)) { + exponent = static_cast(exponent - 1); + if (check_bit & significand) break; + } + } + + bool is_nan = + (getBits() & exponent_mask) == exponent_mask && significand != 0; + bool is_inf = + !is_nan && + (((exponent + carried) > static_cast(other_T::exponent_bias) && other_T::Traits_T::supportsInfinity()) || + ((exponent + carried) > static_cast(other_T::exponent_bias + 1) && !other_T::Traits_T::supportsInfinity()) || + (significand == 0 && (getBits() & exponent_mask) == exponent_mask)); + + // If we are Nan or Inf we should pass that through. + if (is_inf) { + if (other_T::Traits_T::supportsInfinity()) { + // encode as +/-inf + other.set_value(BitwiseCast( + static_cast( + (negate ? other_T::sign_mask : 0) | other_T::exponent_mask))); + } else { + // encode as +/-nan + other.set_value(BitwiseCast( + static_cast(negate ? ~0 : ~other_T::sign_mask))); + } + return; + } + if (is_nan) { + typename other_T::uint_type shifted_significand; + shifted_significand = static_cast( + negatable_left_shift( + static_cast(other_T::num_fraction_bits) - + static_cast(num_fraction_bits), significand)); + + // We are some sort of Nan. We try to keep the bit-pattern of the Nan + // as close as possible. If we had to shift off bits so we are 0, then we + // just set the last bit. + other.set_value(BitwiseCast( + static_cast( + (negate ? other_T::sign_mask : 0) | other_T::exponent_mask | + (shifted_significand == 0 ? 0x1 : shifted_significand)))); + return; + } + + bool round_underflow_up = + isNegative() ? round_dir == kRoundToNegativeInfinity + : round_dir == kRoundToPositiveInfinity; + typedef typename other_T::int_type other_int_type; + // setFromSignUnbiasedExponentAndNormalizedSignificand will + // zero out any underflowing value (but retain the sign). + other.setFromSignUnbiasedExponentAndNormalizedSignificand( + negate, static_cast(exponent), rounded_significand, + round_underflow_up); + return; + } + + private: + T value_; + + static_assert(num_used_bits == + Traits::num_exponent_bits + Traits::num_fraction_bits + 1, + "The number of bits do not fit"); + static_assert(sizeof(T) == sizeof(uint_type), "The type sizes do not match"); +}; + +// Returns 4 bits represented by the hex character. +inline uint8_t get_nibble_from_character(int character) { + const char* dec = "0123456789"; + const char* lower = "abcdef"; + const char* upper = "ABCDEF"; + const char* p = nullptr; + if ((p = strchr(dec, character))) { + return static_cast(p - dec); + } else if ((p = strchr(lower, character))) { + return static_cast(p - lower + 0xa); + } else if ((p = strchr(upper, character))) { + return static_cast(p - upper + 0xa); + } + + assert(false && "This was called with a non-hex character"); + return 0; +} + +// Outputs the given HexFloat to the stream. +template +std::ostream& operator<<(std::ostream& os, const HexFloat& value) { + typedef HexFloat HF; + typedef typename HF::uint_type uint_type; + typedef typename HF::int_type int_type; + + static_assert(HF::num_used_bits != 0, + "num_used_bits must be non-zero for a valid float"); + static_assert(HF::num_exponent_bits != 0, + "num_exponent_bits must be non-zero for a valid float"); + static_assert(HF::num_fraction_bits != 0, + "num_fractin_bits must be non-zero for a valid float"); + + const uint_type bits = spvutils::BitwiseCast(value.value()); + const char* const sign = (bits & HF::sign_mask) ? "-" : ""; + const uint_type exponent = static_cast( + (bits & HF::exponent_mask) >> HF::num_fraction_bits); + + uint_type fraction = static_cast((bits & HF::fraction_encode_mask) + << HF::num_overflow_bits); + + const bool is_zero = exponent == 0 && fraction == 0; + const bool is_denorm = exponent == 0 && !is_zero; + + // exponent contains the biased exponent we have to convert it back into + // the normal range. + int_type int_exponent = static_cast(exponent - HF::exponent_bias); + // If the number is all zeros, then we actually have to NOT shift the + // exponent. + int_exponent = is_zero ? 0 : int_exponent; + + // If we are denorm, then start shifting, and decreasing the exponent until + // our leading bit is 1. + + if (is_denorm) { + while ((fraction & HF::fraction_top_bit) == 0) { + fraction = static_cast(fraction << 1); + int_exponent = static_cast(int_exponent - 1); + } + // Since this is denormalized, we have to consume the leading 1 since it + // will end up being implicit. + fraction = static_cast(fraction << 1); // eat the leading 1 + fraction &= HF::fraction_represent_mask; + } + + uint_type fraction_nibbles = HF::fraction_nibbles; + // We do not have to display any trailing 0s, since this represents the + // fractional part. + while (fraction_nibbles > 0 && (fraction & 0xF) == 0) { + // Shift off any trailing values; + fraction = static_cast(fraction >> 4); + --fraction_nibbles; + } + + const auto saved_flags = os.flags(); + const auto saved_fill = os.fill(); + + os << sign << "0x" << (is_zero ? '0' : '1'); + if (fraction_nibbles) { + // Make sure to keep the leading 0s in place, since this is the fractional + // part. + os << "." << std::setw(static_cast(fraction_nibbles)) + << std::setfill('0') << std::hex << fraction; + } + os << "p" << std::dec << (int_exponent >= 0 ? "+" : "") << int_exponent; + + os.flags(saved_flags); + os.fill(saved_fill); + + return os; +} + +// Returns true if negate_value is true and the next character on the +// input stream is a plus or minus sign. In that case we also set the fail bit +// on the stream and set the value to the zero value for its type. +template +inline bool RejectParseDueToLeadingSign(std::istream& is, bool negate_value, + HexFloat& value) { + if (negate_value) { + auto next_char = is.peek(); + if (next_char == '-' || next_char == '+') { + // Fail the parse. Emulate standard behaviour by setting the value to + // the zero value, and set the fail bit on the stream. + value = HexFloat(typename HexFloat::uint_type(0)); + is.setstate(std::ios_base::failbit); + return true; + } + } + return false; +} + +// Parses a floating point number from the given stream and stores it into the +// value parameter. +// If negate_value is true then the number may not have a leading minus or +// plus, and if it successfully parses, then the number is negated before +// being stored into the value parameter. +// If the value cannot be correctly parsed or overflows the target floating +// point type, then set the fail bit on the stream. +// TODO(dneto): Promise C++11 standard behavior in how the value is set in +// the error case, but only after all target platforms implement it correctly. +// In particular, the Microsoft C++ runtime appears to be out of spec. +template +inline std::istream& ParseNormalFloat(std::istream& is, bool negate_value, + HexFloat& value) { + if (RejectParseDueToLeadingSign(is, negate_value, value)) { + return is; + } + T val; + is >> val; + if (negate_value) { + val = -val; + } + value.set_value(val); + // In the failure case, map -0.0 to 0.0. + if (is.fail() && value.getUnsignedBits() == 0u) { + value = HexFloat(typename HexFloat::uint_type(0)); + } + if (val.isInfinity()) { + // Fail the parse. Emulate standard behaviour by setting the value to + // the closest normal value, and set the fail bit on the stream. + value.set_value((value.isNegative() || negate_value) ? T::lowest() + : T::max()); + is.setstate(std::ios_base::failbit); + } + return is; +} + +// Specialization of ParseNormalFloat for FloatProxy values. +// This will parse the float as it were a 32-bit floating point number, +// and then round it down to fit into a Float16 value. +// The number is rounded towards zero. +// If negate_value is true then the number may not have a leading minus or +// plus, and if it successfully parses, then the number is negated before +// being stored into the value parameter. +// If the value cannot be correctly parsed or overflows the target floating +// point type, then set the fail bit on the stream. +// TODO(dneto): Promise C++11 standard behavior in how the value is set in +// the error case, but only after all target platforms implement it correctly. +// In particular, the Microsoft C++ runtime appears to be out of spec. +template <> +inline std::istream& +ParseNormalFloat, HexFloatTraits>>( + std::istream& is, bool negate_value, + HexFloat, HexFloatTraits>>& value) { + // First parse as a 32-bit float. + HexFloat> float_val(0.0f); + ParseNormalFloat(is, negate_value, float_val); + + // Then convert to 16-bit float, saturating at infinities, and + // rounding toward zero. + float_val.castTo(value, kRoundToZero); + + // Overflow on 16-bit behaves the same as for 32- and 64-bit: set the + // fail bit and set the lowest or highest value. + if (Float16::isInfinity(value.value().getAsFloat())) { + value.set_value(value.isNegative() ? Float16::lowest() : Float16::max()); + is.setstate(std::ios_base::failbit); + } + return is; +} + +// Reads a HexFloat from the given stream. +// If the float is not encoded as a hex-float then it will be parsed +// as a regular float. +// This may fail if your stream does not support at least one unget. +// Nan values can be encoded with "0x1.p+exponent_bias". +// This would normally overflow a float and round to +// infinity but this special pattern is the exact representation for a NaN, +// and therefore is actually encoded as the correct NaN. To encode inf, +// either 0x0p+exponent_bias can be specified or any exponent greater than +// exponent_bias. +// Examples using IEEE 32-bit float encoding. +// 0x1.0p+128 (+inf) +// -0x1.0p-128 (-inf) +// +// 0x1.1p+128 (+Nan) +// -0x1.1p+128 (-Nan) +// +// 0x1p+129 (+inf) +// -0x1p+129 (-inf) +template +std::istream& operator>>(std::istream& is, HexFloat& value) { + using HF = HexFloat; + using uint_type = typename HF::uint_type; + using int_type = typename HF::int_type; + + value.set_value(static_cast(0.f)); + + if (is.flags() & std::ios::skipws) { + // If the user wants to skip whitespace , then we should obey that. + while (std::isspace(is.peek())) { + is.get(); + } + } + + auto next_char = is.peek(); + bool negate_value = false; + + if (next_char != '-' && next_char != '0') { + return ParseNormalFloat(is, negate_value, value); + } + + if (next_char == '-') { + negate_value = true; + is.get(); + next_char = is.peek(); + } + + if (next_char == '0') { + is.get(); // We may have to unget this. + auto maybe_hex_start = is.peek(); + if (maybe_hex_start != 'x' && maybe_hex_start != 'X') { + is.unget(); + return ParseNormalFloat(is, negate_value, value); + } else { + is.get(); // Throw away the 'x'; + } + } else { + return ParseNormalFloat(is, negate_value, value); + } + + // This "looks" like a hex-float so treat it as one. + bool seen_p = false; + bool seen_dot = false; + uint_type fraction_index = 0; + + uint_type fraction = 0; + int_type exponent = HF::exponent_bias; + + // Strip off leading zeros so we don't have to special-case them later. + while ((next_char = is.peek()) == '0') { + is.get(); + } + + bool is_denorm = + true; // Assume denorm "representation" until we hear otherwise. + // NB: This does not mean the value is actually denorm, + // it just means that it was written 0. + bool bits_written = false; // Stays false until we write a bit. + while (!seen_p && !seen_dot) { + // Handle characters that are left of the fractional part. + if (next_char == '.') { + seen_dot = true; + } else if (next_char == 'p') { + seen_p = true; + } else if (::isxdigit(next_char)) { + // We know this is not denormalized since we have stripped all leading + // zeroes and we are not a ".". + is_denorm = false; + int number = get_nibble_from_character(next_char); + for (int i = 0; i < 4; ++i, number <<= 1) { + uint_type write_bit = (number & 0x8) ? 0x1 : 0x0; + if (bits_written) { + // If we are here the bits represented belong in the fractional + // part of the float, and we have to adjust the exponent accordingly. + fraction = static_cast( + fraction | + static_cast( + write_bit << (HF::top_bit_left_shift - fraction_index++))); + exponent = static_cast(exponent + 1); + } + bits_written |= write_bit != 0; + } + } else { + // We have not found our exponent yet, so we have to fail. + is.setstate(std::ios::failbit); + return is; + } + is.get(); + next_char = is.peek(); + } + bits_written = false; + while (seen_dot && !seen_p) { + // Handle only fractional parts now. + if (next_char == 'p') { + seen_p = true; + } else if (::isxdigit(next_char)) { + int number = get_nibble_from_character(next_char); + for (int i = 0; i < 4; ++i, number <<= 1) { + uint_type write_bit = (number & 0x8) ? 0x01 : 0x00; + bits_written |= write_bit != 0; + if (is_denorm && !bits_written) { + // Handle modifying the exponent here this way we can handle + // an arbitrary number of hex values without overflowing our + // integer. + exponent = static_cast(exponent - 1); + } else { + fraction = static_cast( + fraction | + static_cast( + write_bit << (HF::top_bit_left_shift - fraction_index++))); + } + } + } else { + // We still have not found our 'p' exponent yet, so this is not a valid + // hex-float. + is.setstate(std::ios::failbit); + return is; + } + is.get(); + next_char = is.peek(); + } + + bool seen_sign = false; + int8_t exponent_sign = 1; + int_type written_exponent = 0; + while (true) { + if ((next_char == '-' || next_char == '+')) { + if (seen_sign) { + is.setstate(std::ios::failbit); + return is; + } + seen_sign = true; + exponent_sign = (next_char == '-') ? -1 : 1; + } else if (::isdigit(next_char)) { + // Hex-floats express their exponent as decimal. + written_exponent = static_cast(written_exponent * 10); + written_exponent = + static_cast(written_exponent + (next_char - '0')); + } else { + break; + } + is.get(); + next_char = is.peek(); + } + + written_exponent = static_cast(written_exponent * exponent_sign); + exponent = static_cast(exponent + written_exponent); + + bool is_zero = is_denorm && (fraction == 0); + if (is_denorm && !is_zero) { + fraction = static_cast(fraction << 1); + exponent = static_cast(exponent - 1); + } else if (is_zero) { + exponent = 0; + } + + if (exponent <= 0 && !is_zero) { + fraction = static_cast(fraction >> 1); + fraction |= static_cast(1) << HF::top_bit_left_shift; + } + + fraction = (fraction >> HF::fraction_right_shift) & HF::fraction_encode_mask; + + const int_type max_exponent = + SetBits::get; + + // Handle actual denorm numbers + while (exponent < 0 && !is_zero) { + fraction = static_cast(fraction >> 1); + exponent = static_cast(exponent + 1); + + fraction &= HF::fraction_encode_mask; + if (fraction == 0) { + // We have underflowed our fraction. We should clamp to zero. + is_zero = true; + exponent = 0; + } + } + + // We have overflowed so we should be inf/-inf. + if (exponent > max_exponent) { + exponent = max_exponent; + fraction = 0; + } + + uint_type output_bits = static_cast( + static_cast(negate_value ? 1 : 0) << HF::top_bit_left_shift); + output_bits |= fraction; + + uint_type shifted_exponent = static_cast( + static_cast(exponent << HF::exponent_left_shift) & + HF::exponent_mask); + output_bits |= shifted_exponent; + + T output_float = spvutils::BitwiseCast(output_bits); + value.set_value(output_float); + + return is; +} + +// Writes a FloatProxy value to a stream. +// Zero and normal numbers are printed in the usual notation, but with +// enough digits to fully reproduce the value. Other values (subnormal, +// NaN, and infinity) are printed as a hex float. +template +std::ostream& operator<<(std::ostream& os, const FloatProxy& value) { + auto float_val = value.getAsFloat(); + switch (std::fpclassify(float_val)) { + case FP_ZERO: + case FP_NORMAL: { + auto saved_precision = os.precision(); + os.precision(std::numeric_limits::digits10); + os << float_val; + os.precision(saved_precision); + } break; + default: + os << HexFloat>(value); + break; + } + return os; +} + +template <> +inline std::ostream& operator<<(std::ostream& os, + const FloatProxy& value) { + os << HexFloat>(value); + return os; +} +} + +#endif // LIBSPIRV_UTIL_HEX_FLOAT_H_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/spirv.hpp11 b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/spirv.hpp11 new file mode 100644 index 0000000000..a2ce735da5 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/spirv.hpp11 @@ -0,0 +1,5348 @@ +// Copyright (c) 2014-2024 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// This header is automatically generated by the same tool that creates +// the Binary Section of the SPIR-V specification. + +// Enumeration tokens for SPIR-V, in various styles: +// C, C++, C++11, JSON, Lua, Python, C#, D, Beef +// +// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// - C# will use enum classes in the Specification class located in the "Spv" namespace, +// e.g.: Spv.Specification.SourceLanguage.GLSL +// - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL +// - Beef will use enum classes in the Specification class located in the "Spv" namespace, +// e.g.: Spv.Specification.SourceLanguage.GLSL +// +// Some tokens act like mask values, which can be OR'd together, +// while others are mutually exclusive. The mask-like ones have +// "Mask" in their name, and a parallel enum that has the shift +// amount (1 << x) for each corresponding enumerant. + +#ifndef spirv_HPP +#define spirv_HPP + +namespace spv { + +typedef unsigned int Id; + +#define SPV_VERSION 0x10600 +#define SPV_REVISION 1 + +static const unsigned int MagicNumber = 0x07230203; +static const unsigned int Version = 0x00010600; +static const unsigned int Revision = 1; +static const unsigned int OpCodeMask = 0xffff; +static const unsigned int WordCountShift = 16; + +enum class SourceLanguage : unsigned { + Unknown = 0, + ESSL = 1, + GLSL = 2, + OpenCL_C = 3, + OpenCL_CPP = 4, + HLSL = 5, + CPP_for_OpenCL = 6, + SYCL = 7, + HERO_C = 8, + NZSL = 9, + WGSL = 10, + Slang = 11, + Zig = 12, + Rust = 13, + Max = 0x7fffffff, +}; + +enum class ExecutionModel : unsigned { + Vertex = 0, + TessellationControl = 1, + TessellationEvaluation = 2, + Geometry = 3, + Fragment = 4, + GLCompute = 5, + Kernel = 6, + TaskNV = 5267, + MeshNV = 5268, + RayGenerationKHR = 5313, + RayGenerationNV = 5313, + IntersectionKHR = 5314, + IntersectionNV = 5314, + AnyHitKHR = 5315, + AnyHitNV = 5315, + ClosestHitKHR = 5316, + ClosestHitNV = 5316, + MissKHR = 5317, + MissNV = 5317, + CallableKHR = 5318, + CallableNV = 5318, + TaskEXT = 5364, + MeshEXT = 5365, + Max = 0x7fffffff, +}; + +enum class AddressingModel : unsigned { + Logical = 0, + Physical32 = 1, + Physical64 = 2, + PhysicalStorageBuffer64 = 5348, + PhysicalStorageBuffer64EXT = 5348, + Max = 0x7fffffff, +}; + +enum class MemoryModel : unsigned { + Simple = 0, + GLSL450 = 1, + OpenCL = 2, + Vulkan = 3, + VulkanKHR = 3, + Max = 0x7fffffff, +}; + +enum class ExecutionMode : unsigned { + Invocations = 0, + SpacingEqual = 1, + SpacingFractionalEven = 2, + SpacingFractionalOdd = 3, + VertexOrderCw = 4, + VertexOrderCcw = 5, + PixelCenterInteger = 6, + OriginUpperLeft = 7, + OriginLowerLeft = 8, + EarlyFragmentTests = 9, + PointMode = 10, + Xfb = 11, + DepthReplacing = 12, + DepthGreater = 14, + DepthLess = 15, + DepthUnchanged = 16, + LocalSize = 17, + LocalSizeHint = 18, + InputPoints = 19, + InputLines = 20, + InputLinesAdjacency = 21, + Triangles = 22, + InputTrianglesAdjacency = 23, + Quads = 24, + Isolines = 25, + OutputVertices = 26, + OutputPoints = 27, + OutputLineStrip = 28, + OutputTriangleStrip = 29, + VecTypeHint = 30, + ContractionOff = 31, + Initializer = 33, + Finalizer = 34, + SubgroupSize = 35, + SubgroupsPerWorkgroup = 36, + SubgroupsPerWorkgroupId = 37, + LocalSizeId = 38, + LocalSizeHintId = 39, + NonCoherentColorAttachmentReadEXT = 4169, + NonCoherentDepthAttachmentReadEXT = 4170, + NonCoherentStencilAttachmentReadEXT = 4171, + SubgroupUniformControlFlowKHR = 4421, + PostDepthCoverage = 4446, + DenormPreserve = 4459, + DenormFlushToZero = 4460, + SignedZeroInfNanPreserve = 4461, + RoundingModeRTE = 4462, + RoundingModeRTZ = 4463, + NonCoherentTileAttachmentReadQCOM = 4489, + TileShadingRateQCOM = 4490, + EarlyAndLateFragmentTestsAMD = 5017, + StencilRefReplacingEXT = 5027, + CoalescingAMDX = 5069, + IsApiEntryAMDX = 5070, + MaxNodeRecursionAMDX = 5071, + StaticNumWorkgroupsAMDX = 5072, + ShaderIndexAMDX = 5073, + MaxNumWorkgroupsAMDX = 5077, + StencilRefUnchangedFrontAMD = 5079, + StencilRefGreaterFrontAMD = 5080, + StencilRefLessFrontAMD = 5081, + StencilRefUnchangedBackAMD = 5082, + StencilRefGreaterBackAMD = 5083, + StencilRefLessBackAMD = 5084, + QuadDerivativesKHR = 5088, + RequireFullQuadsKHR = 5089, + SharesInputWithAMDX = 5102, + OutputLinesEXT = 5269, + OutputLinesNV = 5269, + OutputPrimitivesEXT = 5270, + OutputPrimitivesNV = 5270, + DerivativeGroupQuadsKHR = 5289, + DerivativeGroupQuadsNV = 5289, + DerivativeGroupLinearKHR = 5290, + DerivativeGroupLinearNV = 5290, + OutputTrianglesEXT = 5298, + OutputTrianglesNV = 5298, + PixelInterlockOrderedEXT = 5366, + PixelInterlockUnorderedEXT = 5367, + SampleInterlockOrderedEXT = 5368, + SampleInterlockUnorderedEXT = 5369, + ShadingRateInterlockOrderedEXT = 5370, + ShadingRateInterlockUnorderedEXT = 5371, + Shader64BitIndexingEXT = 5427, + SharedLocalMemorySizeINTEL = 5618, + RoundingModeRTPINTEL = 5620, + RoundingModeRTNINTEL = 5621, + FloatingPointModeALTINTEL = 5622, + FloatingPointModeIEEEINTEL = 5623, + MaxWorkgroupSizeINTEL = 5893, + MaxWorkDimINTEL = 5894, + NoGlobalOffsetINTEL = 5895, + NumSIMDWorkitemsINTEL = 5896, + SchedulerTargetFmaxMhzINTEL = 5903, + MaximallyReconvergesKHR = 6023, + FPFastMathDefault = 6028, + StreamingInterfaceINTEL = 6154, + RegisterMapInterfaceINTEL = 6160, + NamedBarrierCountINTEL = 6417, + MaximumRegistersINTEL = 6461, + MaximumRegistersIdINTEL = 6462, + NamedMaximumRegistersINTEL = 6463, + Max = 0x7fffffff, +}; + +enum class StorageClass : unsigned { + UniformConstant = 0, + Input = 1, + Uniform = 2, + Output = 3, + Workgroup = 4, + CrossWorkgroup = 5, + Private = 6, + Function = 7, + Generic = 8, + PushConstant = 9, + AtomicCounter = 10, + Image = 11, + StorageBuffer = 12, + TileImageEXT = 4172, + TileAttachmentQCOM = 4491, + NodePayloadAMDX = 5068, + CallableDataKHR = 5328, + CallableDataNV = 5328, + IncomingCallableDataKHR = 5329, + IncomingCallableDataNV = 5329, + RayPayloadKHR = 5338, + RayPayloadNV = 5338, + HitAttributeKHR = 5339, + HitAttributeNV = 5339, + IncomingRayPayloadKHR = 5342, + IncomingRayPayloadNV = 5342, + ShaderRecordBufferKHR = 5343, + ShaderRecordBufferNV = 5343, + PhysicalStorageBuffer = 5349, + PhysicalStorageBufferEXT = 5349, + HitObjectAttributeNV = 5385, + TaskPayloadWorkgroupEXT = 5402, + HitObjectAttributeEXT = 5411, + CodeSectionINTEL = 5605, + DeviceOnlyINTEL = 5936, + HostOnlyINTEL = 5937, + Max = 0x7fffffff, +}; + +enum class Dim : unsigned { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + Cube = 3, + Rect = 4, + Buffer = 5, + SubpassData = 6, + TileImageDataEXT = 4173, + Max = 0x7fffffff, +}; + +enum class SamplerAddressingMode : unsigned { + None = 0, + ClampToEdge = 1, + Clamp = 2, + Repeat = 3, + RepeatMirrored = 4, + Max = 0x7fffffff, +}; + +enum class SamplerFilterMode : unsigned { + Nearest = 0, + Linear = 1, + Max = 0x7fffffff, +}; + +enum class ImageFormat : unsigned { + Unknown = 0, + Rgba32f = 1, + Rgba16f = 2, + R32f = 3, + Rgba8 = 4, + Rgba8Snorm = 5, + Rg32f = 6, + Rg16f = 7, + R11fG11fB10f = 8, + R16f = 9, + Rgba16 = 10, + Rgb10A2 = 11, + Rg16 = 12, + Rg8 = 13, + R16 = 14, + R8 = 15, + Rgba16Snorm = 16, + Rg16Snorm = 17, + Rg8Snorm = 18, + R16Snorm = 19, + R8Snorm = 20, + Rgba32i = 21, + Rgba16i = 22, + Rgba8i = 23, + R32i = 24, + Rg32i = 25, + Rg16i = 26, + Rg8i = 27, + R16i = 28, + R8i = 29, + Rgba32ui = 30, + Rgba16ui = 31, + Rgba8ui = 32, + R32ui = 33, + Rgb10a2ui = 34, + Rg32ui = 35, + Rg16ui = 36, + Rg8ui = 37, + R16ui = 38, + R8ui = 39, + R64ui = 40, + R64i = 41, + Max = 0x7fffffff, +}; + +enum class ImageChannelOrder : unsigned { + R = 0, + A = 1, + RG = 2, + RA = 3, + RGB = 4, + RGBA = 5, + BGRA = 6, + ARGB = 7, + Intensity = 8, + Luminance = 9, + Rx = 10, + RGx = 11, + RGBx = 12, + Depth = 13, + DepthStencil = 14, + sRGB = 15, + sRGBx = 16, + sRGBA = 17, + sBGRA = 18, + ABGR = 19, + Max = 0x7fffffff, +}; + +enum class ImageChannelDataType : unsigned { + SnormInt8 = 0, + SnormInt16 = 1, + UnormInt8 = 2, + UnormInt16 = 3, + UnormShort565 = 4, + UnormShort555 = 5, + UnormInt101010 = 6, + SignedInt8 = 7, + SignedInt16 = 8, + SignedInt32 = 9, + UnsignedInt8 = 10, + UnsignedInt16 = 11, + UnsignedInt32 = 12, + HalfFloat = 13, + Float = 14, + UnormInt24 = 15, + UnormInt101010_2 = 16, + UnsignedIntRaw10EXT = 19, + UnsignedIntRaw12EXT = 20, + UnormInt2_101010EXT = 21, + Max = 0x7fffffff, +}; + +enum class ImageOperandsShift : unsigned { + Bias = 0, + Lod = 1, + Grad = 2, + ConstOffset = 3, + Offset = 4, + ConstOffsets = 5, + Sample = 6, + MinLod = 7, + MakeTexelAvailable = 8, + MakeTexelAvailableKHR = 8, + MakeTexelVisible = 9, + MakeTexelVisibleKHR = 9, + NonPrivateTexel = 10, + NonPrivateTexelKHR = 10, + VolatileTexel = 11, + VolatileTexelKHR = 11, + SignExtend = 12, + ZeroExtend = 13, + Nontemporal = 14, + Offsets = 16, + Max = 0x7fffffff, +}; + +enum class ImageOperandsMask : unsigned { + MaskNone = 0, + Bias = 0x00000001, + Lod = 0x00000002, + Grad = 0x00000004, + ConstOffset = 0x00000008, + Offset = 0x00000010, + ConstOffsets = 0x00000020, + Sample = 0x00000040, + MinLod = 0x00000080, + MakeTexelAvailable = 0x00000100, + MakeTexelAvailableKHR = 0x00000100, + MakeTexelVisible = 0x00000200, + MakeTexelVisibleKHR = 0x00000200, + NonPrivateTexel = 0x00000400, + NonPrivateTexelKHR = 0x00000400, + VolatileTexel = 0x00000800, + VolatileTexelKHR = 0x00000800, + SignExtend = 0x00001000, + ZeroExtend = 0x00002000, + Nontemporal = 0x00004000, + Offsets = 0x00010000, +}; + +enum class FPFastMathModeShift : unsigned { + NotNaN = 0, + NotInf = 1, + NSZ = 2, + AllowRecip = 3, + Fast = 4, + AllowContract = 16, + AllowContractFastINTEL = 16, + AllowReassoc = 17, + AllowReassocINTEL = 17, + AllowTransform = 18, + Max = 0x7fffffff, +}; + +enum class FPFastMathModeMask : unsigned { + MaskNone = 0, + NotNaN = 0x00000001, + NotInf = 0x00000002, + NSZ = 0x00000004, + AllowRecip = 0x00000008, + Fast = 0x00000010, + AllowContract = 0x00010000, + AllowContractFastINTEL = 0x00010000, + AllowReassoc = 0x00020000, + AllowReassocINTEL = 0x00020000, + AllowTransform = 0x00040000, +}; + +enum class FPRoundingMode : unsigned { + RTE = 0, + RTZ = 1, + RTP = 2, + RTN = 3, + Max = 0x7fffffff, +}; + +enum class LinkageType : unsigned { + Export = 0, + Import = 1, + LinkOnceODR = 2, + Max = 0x7fffffff, +}; + +enum class AccessQualifier : unsigned { + ReadOnly = 0, + WriteOnly = 1, + ReadWrite = 2, + Max = 0x7fffffff, +}; + +enum class FunctionParameterAttribute : unsigned { + Zext = 0, + Sext = 1, + ByVal = 2, + Sret = 3, + NoAlias = 4, + NoCapture = 5, + NoWrite = 6, + NoReadWrite = 7, + RuntimeAlignedINTEL = 5940, + Max = 0x7fffffff, +}; + +enum class Decoration : unsigned { + RelaxedPrecision = 0, + SpecId = 1, + Block = 2, + BufferBlock = 3, + RowMajor = 4, + ColMajor = 5, + ArrayStride = 6, + MatrixStride = 7, + GLSLShared = 8, + GLSLPacked = 9, + CPacked = 10, + BuiltIn = 11, + NoPerspective = 13, + Flat = 14, + Patch = 15, + Centroid = 16, + Sample = 17, + Invariant = 18, + Restrict = 19, + Aliased = 20, + Volatile = 21, + Constant = 22, + Coherent = 23, + NonWritable = 24, + NonReadable = 25, + Uniform = 26, + UniformId = 27, + SaturatedConversion = 28, + Stream = 29, + Location = 30, + Component = 31, + Index = 32, + Binding = 33, + DescriptorSet = 34, + Offset = 35, + XfbBuffer = 36, + XfbStride = 37, + FuncParamAttr = 38, + FPRoundingMode = 39, + FPFastMathMode = 40, + LinkageAttributes = 41, + NoContraction = 42, + InputAttachmentIndex = 43, + Alignment = 44, + MaxByteOffset = 45, + AlignmentId = 46, + MaxByteOffsetId = 47, + SaturatedToLargestFloat8NormalConversionEXT = 4216, + NoSignedWrap = 4469, + NoUnsignedWrap = 4470, + WeightTextureQCOM = 4487, + BlockMatchTextureQCOM = 4488, + BlockMatchSamplerQCOM = 4499, + ExplicitInterpAMD = 4999, + NodeSharesPayloadLimitsWithAMDX = 5019, + NodeMaxPayloadsAMDX = 5020, + TrackFinishWritingAMDX = 5078, + PayloadNodeNameAMDX = 5091, + PayloadNodeBaseIndexAMDX = 5098, + PayloadNodeSparseArrayAMDX = 5099, + PayloadNodeArraySizeAMDX = 5100, + PayloadDispatchIndirectAMDX = 5105, + OverrideCoverageNV = 5248, + PassthroughNV = 5250, + ViewportRelativeNV = 5252, + SecondaryViewportRelativeNV = 5256, + PerPrimitiveEXT = 5271, + PerPrimitiveNV = 5271, + PerViewNV = 5272, + PerTaskNV = 5273, + PerVertexKHR = 5285, + PerVertexNV = 5285, + NonUniform = 5300, + NonUniformEXT = 5300, + RestrictPointer = 5355, + RestrictPointerEXT = 5355, + AliasedPointer = 5356, + AliasedPointerEXT = 5356, + HitObjectShaderRecordBufferNV = 5386, + HitObjectShaderRecordBufferEXT = 5389, + BindlessSamplerNV = 5398, + BindlessImageNV = 5399, + BoundSamplerNV = 5400, + BoundImageNV = 5401, + SIMTCallINTEL = 5599, + ReferencedIndirectlyINTEL = 5602, + ClobberINTEL = 5607, + SideEffectsINTEL = 5608, + VectorComputeVariableINTEL = 5624, + FuncParamIOKindINTEL = 5625, + VectorComputeFunctionINTEL = 5626, + StackCallINTEL = 5627, + GlobalVariableOffsetINTEL = 5628, + CounterBuffer = 5634, + HlslCounterBufferGOOGLE = 5634, + HlslSemanticGOOGLE = 5635, + UserSemantic = 5635, + UserTypeGOOGLE = 5636, + FunctionRoundingModeINTEL = 5822, + FunctionDenormModeINTEL = 5823, + RegisterINTEL = 5825, + MemoryINTEL = 5826, + NumbanksINTEL = 5827, + BankwidthINTEL = 5828, + MaxPrivateCopiesINTEL = 5829, + SinglepumpINTEL = 5830, + DoublepumpINTEL = 5831, + MaxReplicatesINTEL = 5832, + SimpleDualPortINTEL = 5833, + MergeINTEL = 5834, + BankBitsINTEL = 5835, + ForcePow2DepthINTEL = 5836, + StridesizeINTEL = 5883, + WordsizeINTEL = 5884, + TrueDualPortINTEL = 5885, + BurstCoalesceINTEL = 5899, + CacheSizeINTEL = 5900, + DontStaticallyCoalesceINTEL = 5901, + PrefetchINTEL = 5902, + StallEnableINTEL = 5905, + FuseLoopsInFunctionINTEL = 5907, + MathOpDSPModeINTEL = 5909, + AliasScopeINTEL = 5914, + NoAliasINTEL = 5915, + InitiationIntervalINTEL = 5917, + MaxConcurrencyINTEL = 5918, + PipelineEnableINTEL = 5919, + BufferLocationINTEL = 5921, + IOPipeStorageINTEL = 5944, + FunctionFloatingPointModeINTEL = 6080, + SingleElementVectorINTEL = 6085, + VectorComputeCallableFunctionINTEL = 6087, + MediaBlockIOINTEL = 6140, + StallFreeINTEL = 6151, + FPMaxErrorDecorationINTEL = 6170, + LatencyControlLabelINTEL = 6172, + LatencyControlConstraintINTEL = 6173, + ConduitKernelArgumentINTEL = 6175, + RegisterMapKernelArgumentINTEL = 6176, + MMHostInterfaceAddressWidthINTEL = 6177, + MMHostInterfaceDataWidthINTEL = 6178, + MMHostInterfaceLatencyINTEL = 6179, + MMHostInterfaceReadWriteModeINTEL = 6180, + MMHostInterfaceMaxBurstINTEL = 6181, + MMHostInterfaceWaitRequestINTEL = 6182, + StableKernelArgumentINTEL = 6183, + HostAccessINTEL = 6188, + InitModeINTEL = 6190, + ImplementInRegisterMapINTEL = 6191, + CacheControlLoadINTEL = 6442, + CacheControlStoreINTEL = 6443, + Max = 0x7fffffff, +}; + +enum class BuiltIn : unsigned { + Position = 0, + PointSize = 1, + ClipDistance = 3, + CullDistance = 4, + VertexId = 5, + InstanceId = 6, + PrimitiveId = 7, + InvocationId = 8, + Layer = 9, + ViewportIndex = 10, + TessLevelOuter = 11, + TessLevelInner = 12, + TessCoord = 13, + PatchVertices = 14, + FragCoord = 15, + PointCoord = 16, + FrontFacing = 17, + SampleId = 18, + SamplePosition = 19, + SampleMask = 20, + FragDepth = 22, + HelperInvocation = 23, + NumWorkgroups = 24, + WorkgroupSize = 25, + WorkgroupId = 26, + LocalInvocationId = 27, + GlobalInvocationId = 28, + LocalInvocationIndex = 29, + WorkDim = 30, + GlobalSize = 31, + EnqueuedWorkgroupSize = 32, + GlobalOffset = 33, + GlobalLinearId = 34, + SubgroupSize = 36, + SubgroupMaxSize = 37, + NumSubgroups = 38, + NumEnqueuedSubgroups = 39, + SubgroupId = 40, + SubgroupLocalInvocationId = 41, + VertexIndex = 42, + InstanceIndex = 43, + CoreIDARM = 4160, + CoreCountARM = 4161, + CoreMaxIDARM = 4162, + WarpIDARM = 4163, + WarpMaxIDARM = 4164, + SubgroupEqMask = 4416, + SubgroupEqMaskKHR = 4416, + SubgroupGeMask = 4417, + SubgroupGeMaskKHR = 4417, + SubgroupGtMask = 4418, + SubgroupGtMaskKHR = 4418, + SubgroupLeMask = 4419, + SubgroupLeMaskKHR = 4419, + SubgroupLtMask = 4420, + SubgroupLtMaskKHR = 4420, + BaseVertex = 4424, + BaseInstance = 4425, + DrawIndex = 4426, + PrimitiveShadingRateKHR = 4432, + DeviceIndex = 4438, + ViewIndex = 4440, + ShadingRateKHR = 4444, + TileOffsetQCOM = 4492, + TileDimensionQCOM = 4493, + TileApronSizeQCOM = 4494, + BaryCoordNoPerspAMD = 4992, + BaryCoordNoPerspCentroidAMD = 4993, + BaryCoordNoPerspSampleAMD = 4994, + BaryCoordSmoothAMD = 4995, + BaryCoordSmoothCentroidAMD = 4996, + BaryCoordSmoothSampleAMD = 4997, + BaryCoordPullModelAMD = 4998, + FragStencilRefEXT = 5014, + RemainingRecursionLevelsAMDX = 5021, + ShaderIndexAMDX = 5073, + ViewportMaskNV = 5253, + SecondaryPositionNV = 5257, + SecondaryViewportMaskNV = 5258, + PositionPerViewNV = 5261, + ViewportMaskPerViewNV = 5262, + FullyCoveredEXT = 5264, + TaskCountNV = 5274, + PrimitiveCountNV = 5275, + PrimitiveIndicesNV = 5276, + ClipDistancePerViewNV = 5277, + CullDistancePerViewNV = 5278, + LayerPerViewNV = 5279, + MeshViewCountNV = 5280, + MeshViewIndicesNV = 5281, + BaryCoordKHR = 5286, + BaryCoordNV = 5286, + BaryCoordNoPerspKHR = 5287, + BaryCoordNoPerspNV = 5287, + FragSizeEXT = 5292, + FragmentSizeNV = 5292, + FragInvocationCountEXT = 5293, + InvocationsPerPixelNV = 5293, + PrimitivePointIndicesEXT = 5294, + PrimitiveLineIndicesEXT = 5295, + PrimitiveTriangleIndicesEXT = 5296, + CullPrimitiveEXT = 5299, + LaunchIdKHR = 5319, + LaunchIdNV = 5319, + LaunchSizeKHR = 5320, + LaunchSizeNV = 5320, + WorldRayOriginKHR = 5321, + WorldRayOriginNV = 5321, + WorldRayDirectionKHR = 5322, + WorldRayDirectionNV = 5322, + ObjectRayOriginKHR = 5323, + ObjectRayOriginNV = 5323, + ObjectRayDirectionKHR = 5324, + ObjectRayDirectionNV = 5324, + RayTminKHR = 5325, + RayTminNV = 5325, + RayTmaxKHR = 5326, + RayTmaxNV = 5326, + InstanceCustomIndexKHR = 5327, + InstanceCustomIndexNV = 5327, + ObjectToWorldKHR = 5330, + ObjectToWorldNV = 5330, + WorldToObjectKHR = 5331, + WorldToObjectNV = 5331, + HitTNV = 5332, + HitKindKHR = 5333, + HitKindNV = 5333, + CurrentRayTimeNV = 5334, + HitTriangleVertexPositionsKHR = 5335, + HitMicroTriangleVertexPositionsNV = 5337, + HitMicroTriangleVertexBarycentricsNV = 5344, + IncomingRayFlagsKHR = 5351, + IncomingRayFlagsNV = 5351, + RayGeometryIndexKHR = 5352, + HitIsSphereNV = 5359, + HitIsLSSNV = 5360, + HitSpherePositionNV = 5361, + WarpsPerSMNV = 5374, + SMCountNV = 5375, + WarpIDNV = 5376, + SMIDNV = 5377, + HitLSSPositionsNV = 5396, + HitKindFrontFacingMicroTriangleNV = 5405, + HitKindBackFacingMicroTriangleNV = 5406, + HitSphereRadiusNV = 5420, + HitLSSRadiiNV = 5421, + ClusterIDNV = 5436, + CullMaskKHR = 6021, + Max = 0x7fffffff, +}; + +enum class SelectionControlShift : unsigned { + Flatten = 0, + DontFlatten = 1, + Max = 0x7fffffff, +}; + +enum class SelectionControlMask : unsigned { + MaskNone = 0, + Flatten = 0x00000001, + DontFlatten = 0x00000002, +}; + +enum class LoopControlShift : unsigned { + Unroll = 0, + DontUnroll = 1, + DependencyInfinite = 2, + DependencyLength = 3, + MinIterations = 4, + MaxIterations = 5, + IterationMultiple = 6, + PeelCount = 7, + PartialCount = 8, + InitiationIntervalINTEL = 16, + MaxConcurrencyINTEL = 17, + DependencyArrayINTEL = 18, + PipelineEnableINTEL = 19, + LoopCoalesceINTEL = 20, + MaxInterleavingINTEL = 21, + SpeculatedIterationsINTEL = 22, + NoFusionINTEL = 23, + LoopCountINTEL = 24, + MaxReinvocationDelayINTEL = 25, + Max = 0x7fffffff, +}; + +enum class LoopControlMask : unsigned { + MaskNone = 0, + Unroll = 0x00000001, + DontUnroll = 0x00000002, + DependencyInfinite = 0x00000004, + DependencyLength = 0x00000008, + MinIterations = 0x00000010, + MaxIterations = 0x00000020, + IterationMultiple = 0x00000040, + PeelCount = 0x00000080, + PartialCount = 0x00000100, + InitiationIntervalINTEL = 0x00010000, + MaxConcurrencyINTEL = 0x00020000, + DependencyArrayINTEL = 0x00040000, + PipelineEnableINTEL = 0x00080000, + LoopCoalesceINTEL = 0x00100000, + MaxInterleavingINTEL = 0x00200000, + SpeculatedIterationsINTEL = 0x00400000, + NoFusionINTEL = 0x00800000, + LoopCountINTEL = 0x01000000, + MaxReinvocationDelayINTEL = 0x02000000, +}; + +enum class FunctionControlShift : unsigned { + Inline = 0, + DontInline = 1, + Pure = 2, + Const = 3, + OptNoneEXT = 16, + OptNoneINTEL = 16, + Max = 0x7fffffff, +}; + +enum class FunctionControlMask : unsigned { + MaskNone = 0, + Inline = 0x00000001, + DontInline = 0x00000002, + Pure = 0x00000004, + Const = 0x00000008, + OptNoneEXT = 0x00010000, + OptNoneINTEL = 0x00010000, +}; + +enum class MemorySemanticsShift : unsigned { + Acquire = 1, + Release = 2, + AcquireRelease = 3, + SequentiallyConsistent = 4, + UniformMemory = 6, + SubgroupMemory = 7, + WorkgroupMemory = 8, + CrossWorkgroupMemory = 9, + AtomicCounterMemory = 10, + ImageMemory = 11, + OutputMemory = 12, + OutputMemoryKHR = 12, + MakeAvailable = 13, + MakeAvailableKHR = 13, + MakeVisible = 14, + MakeVisibleKHR = 14, + Volatile = 15, + Max = 0x7fffffff, +}; + +enum class MemorySemanticsMask : unsigned { + MaskNone = 0, + Acquire = 0x00000002, + Release = 0x00000004, + AcquireRelease = 0x00000008, + SequentiallyConsistent = 0x00000010, + UniformMemory = 0x00000040, + SubgroupMemory = 0x00000080, + WorkgroupMemory = 0x00000100, + CrossWorkgroupMemory = 0x00000200, + AtomicCounterMemory = 0x00000400, + ImageMemory = 0x00000800, + OutputMemory = 0x00001000, + OutputMemoryKHR = 0x00001000, + MakeAvailable = 0x00002000, + MakeAvailableKHR = 0x00002000, + MakeVisible = 0x00004000, + MakeVisibleKHR = 0x00004000, + Volatile = 0x00008000, +}; + +enum class MemoryAccessShift : unsigned { + Volatile = 0, + Aligned = 1, + Nontemporal = 2, + MakePointerAvailable = 3, + MakePointerAvailableKHR = 3, + MakePointerVisible = 4, + MakePointerVisibleKHR = 4, + NonPrivatePointer = 5, + NonPrivatePointerKHR = 5, + AliasScopeINTELMask = 16, + NoAliasINTELMask = 17, + Max = 0x7fffffff, +}; + +enum class MemoryAccessMask : unsigned { + MaskNone = 0, + Volatile = 0x00000001, + Aligned = 0x00000002, + Nontemporal = 0x00000004, + MakePointerAvailable = 0x00000008, + MakePointerAvailableKHR = 0x00000008, + MakePointerVisible = 0x00000010, + MakePointerVisibleKHR = 0x00000010, + NonPrivatePointer = 0x00000020, + NonPrivatePointerKHR = 0x00000020, + AliasScopeINTELMask = 0x00010000, + NoAliasINTELMask = 0x00020000, +}; + +enum class Scope : unsigned { + CrossDevice = 0, + Device = 1, + Workgroup = 2, + Subgroup = 3, + Invocation = 4, + QueueFamily = 5, + QueueFamilyKHR = 5, + ShaderCallKHR = 6, + Max = 0x7fffffff, +}; + +enum class GroupOperation : unsigned { + Reduce = 0, + InclusiveScan = 1, + ExclusiveScan = 2, + ClusteredReduce = 3, + PartitionedReduceNV = 6, + PartitionedInclusiveScanNV = 7, + PartitionedExclusiveScanNV = 8, + Max = 0x7fffffff, +}; + +enum class KernelEnqueueFlags : unsigned { + NoWait = 0, + WaitKernel = 1, + WaitWorkGroup = 2, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoShift : unsigned { + CmdExecTime = 0, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoMask : unsigned { + MaskNone = 0, + CmdExecTime = 0x00000001, +}; + +enum class Capability : unsigned { + Matrix = 0, + Shader = 1, + Geometry = 2, + Tessellation = 3, + Addresses = 4, + Linkage = 5, + Kernel = 6, + Vector16 = 7, + Float16Buffer = 8, + Float16 = 9, + Float64 = 10, + Int64 = 11, + Int64Atomics = 12, + ImageBasic = 13, + ImageReadWrite = 14, + ImageMipmap = 15, + Pipes = 17, + Groups = 18, + DeviceEnqueue = 19, + LiteralSampler = 20, + AtomicStorage = 21, + Int16 = 22, + TessellationPointSize = 23, + GeometryPointSize = 24, + ImageGatherExtended = 25, + StorageImageMultisample = 27, + UniformBufferArrayDynamicIndexing = 28, + SampledImageArrayDynamicIndexing = 29, + StorageBufferArrayDynamicIndexing = 30, + StorageImageArrayDynamicIndexing = 31, + ClipDistance = 32, + CullDistance = 33, + ImageCubeArray = 34, + SampleRateShading = 35, + ImageRect = 36, + SampledRect = 37, + GenericPointer = 38, + Int8 = 39, + InputAttachment = 40, + SparseResidency = 41, + MinLod = 42, + Sampled1D = 43, + Image1D = 44, + SampledCubeArray = 45, + SampledBuffer = 46, + ImageBuffer = 47, + ImageMSArray = 48, + StorageImageExtendedFormats = 49, + ImageQuery = 50, + DerivativeControl = 51, + InterpolationFunction = 52, + TransformFeedback = 53, + GeometryStreams = 54, + StorageImageReadWithoutFormat = 55, + StorageImageWriteWithoutFormat = 56, + MultiViewport = 57, + SubgroupDispatch = 58, + NamedBarrier = 59, + PipeStorage = 60, + GroupNonUniform = 61, + GroupNonUniformVote = 62, + GroupNonUniformArithmetic = 63, + GroupNonUniformBallot = 64, + GroupNonUniformShuffle = 65, + GroupNonUniformShuffleRelative = 66, + GroupNonUniformClustered = 67, + GroupNonUniformQuad = 68, + ShaderLayer = 69, + ShaderViewportIndex = 70, + UniformDecoration = 71, + CoreBuiltinsARM = 4165, + TileImageColorReadAccessEXT = 4166, + TileImageDepthReadAccessEXT = 4167, + TileImageStencilReadAccessEXT = 4168, + TensorsARM = 4174, + CooperativeMatrixLayoutsARM = 4201, + Float8EXT = 4212, + Float8CooperativeMatrixEXT = 4213, + FragmentShadingRateKHR = 4422, + SubgroupBallotKHR = 4423, + DrawParameters = 4427, + WorkgroupMemoryExplicitLayoutKHR = 4428, + WorkgroupMemoryExplicitLayout8BitAccessKHR = 4429, + WorkgroupMemoryExplicitLayout16BitAccessKHR = 4430, + SubgroupVoteKHR = 4431, + StorageBuffer16BitAccess = 4433, + StorageUniformBufferBlock16 = 4433, + StorageUniform16 = 4434, + UniformAndStorageBuffer16BitAccess = 4434, + StoragePushConstant16 = 4435, + StorageInputOutput16 = 4436, + DeviceGroup = 4437, + MultiView = 4439, + VariablePointersStorageBuffer = 4441, + VariablePointers = 4442, + AtomicStorageOps = 4445, + SampleMaskPostDepthCoverage = 4447, + StorageBuffer8BitAccess = 4448, + UniformAndStorageBuffer8BitAccess = 4449, + StoragePushConstant8 = 4450, + DenormPreserve = 4464, + DenormFlushToZero = 4465, + SignedZeroInfNanPreserve = 4466, + RoundingModeRTE = 4467, + RoundingModeRTZ = 4468, + RayQueryProvisionalKHR = 4471, + RayQueryKHR = 4472, + UntypedPointersKHR = 4473, + RayTraversalPrimitiveCullingKHR = 4478, + RayTracingKHR = 4479, + TextureSampleWeightedQCOM = 4484, + TextureBoxFilterQCOM = 4485, + TextureBlockMatchQCOM = 4486, + TileShadingQCOM = 4495, + CooperativeMatrixConversionQCOM = 4496, + TextureBlockMatch2QCOM = 4498, + Float16ImageAMD = 5008, + ImageGatherBiasLodAMD = 5009, + FragmentMaskAMD = 5010, + StencilExportEXT = 5013, + ImageReadWriteLodAMD = 5015, + Int64ImageEXT = 5016, + ShaderClockKHR = 5055, + ShaderEnqueueAMDX = 5067, + QuadControlKHR = 5087, + BFloat16TypeKHR = 5116, + BFloat16DotProductKHR = 5117, + BFloat16CooperativeMatrixKHR = 5118, + SampleMaskOverrideCoverageNV = 5249, + GeometryShaderPassthroughNV = 5251, + ShaderViewportIndexLayerEXT = 5254, + ShaderViewportIndexLayerNV = 5254, + ShaderViewportMaskNV = 5255, + ShaderStereoViewNV = 5259, + PerViewAttributesNV = 5260, + FragmentFullyCoveredEXT = 5265, + MeshShadingNV = 5266, + ImageFootprintNV = 5282, + MeshShadingEXT = 5283, + FragmentBarycentricKHR = 5284, + FragmentBarycentricNV = 5284, + ComputeDerivativeGroupQuadsKHR = 5288, + ComputeDerivativeGroupQuadsNV = 5288, + FragmentDensityEXT = 5291, + ShadingRateNV = 5291, + GroupNonUniformPartitionedNV = 5297, + ShaderNonUniform = 5301, + ShaderNonUniformEXT = 5301, + RuntimeDescriptorArray = 5302, + RuntimeDescriptorArrayEXT = 5302, + InputAttachmentArrayDynamicIndexing = 5303, + InputAttachmentArrayDynamicIndexingEXT = 5303, + UniformTexelBufferArrayDynamicIndexing = 5304, + UniformTexelBufferArrayDynamicIndexingEXT = 5304, + StorageTexelBufferArrayDynamicIndexing = 5305, + StorageTexelBufferArrayDynamicIndexingEXT = 5305, + UniformBufferArrayNonUniformIndexing = 5306, + UniformBufferArrayNonUniformIndexingEXT = 5306, + SampledImageArrayNonUniformIndexing = 5307, + SampledImageArrayNonUniformIndexingEXT = 5307, + StorageBufferArrayNonUniformIndexing = 5308, + StorageBufferArrayNonUniformIndexingEXT = 5308, + StorageImageArrayNonUniformIndexing = 5309, + StorageImageArrayNonUniformIndexingEXT = 5309, + InputAttachmentArrayNonUniformIndexing = 5310, + InputAttachmentArrayNonUniformIndexingEXT = 5310, + UniformTexelBufferArrayNonUniformIndexing = 5311, + UniformTexelBufferArrayNonUniformIndexingEXT = 5311, + StorageTexelBufferArrayNonUniformIndexing = 5312, + StorageTexelBufferArrayNonUniformIndexingEXT = 5312, + RayTracingPositionFetchKHR = 5336, + RayTracingNV = 5340, + RayTracingMotionBlurNV = 5341, + VulkanMemoryModel = 5345, + VulkanMemoryModelKHR = 5345, + VulkanMemoryModelDeviceScope = 5346, + VulkanMemoryModelDeviceScopeKHR = 5346, + PhysicalStorageBufferAddresses = 5347, + PhysicalStorageBufferAddressesEXT = 5347, + ComputeDerivativeGroupLinearKHR = 5350, + ComputeDerivativeGroupLinearNV = 5350, + RayTracingProvisionalKHR = 5353, + CooperativeMatrixNV = 5357, + FragmentShaderSampleInterlockEXT = 5363, + FragmentShaderShadingRateInterlockEXT = 5372, + ShaderSMBuiltinsNV = 5373, + FragmentShaderPixelInterlockEXT = 5378, + DemoteToHelperInvocation = 5379, + DemoteToHelperInvocationEXT = 5379, + DisplacementMicromapNV = 5380, + RayTracingOpacityMicromapEXT = 5381, + ShaderInvocationReorderNV = 5383, + ShaderInvocationReorderEXT = 5388, + BindlessTextureNV = 5390, + RayQueryPositionFetchKHR = 5391, + CooperativeVectorNV = 5394, + AtomicFloat16VectorNV = 5404, + RayTracingDisplacementMicromapNV = 5409, + RawAccessChainsNV = 5414, + RayTracingSpheresGeometryNV = 5418, + RayTracingLinearSweptSpheresGeometryNV = 5419, + Shader64BitIndexingEXT = 5426, + CooperativeMatrixReductionsNV = 5430, + CooperativeMatrixConversionsNV = 5431, + CooperativeMatrixPerElementOperationsNV = 5432, + CooperativeMatrixTensorAddressingNV = 5433, + CooperativeMatrixBlockLoadsNV = 5434, + CooperativeVectorTrainingNV = 5435, + RayTracingClusterAccelerationStructureNV = 5437, + TensorAddressingNV = 5439, + SubgroupShuffleINTEL = 5568, + SubgroupBufferBlockIOINTEL = 5569, + SubgroupImageBlockIOINTEL = 5570, + SubgroupImageMediaBlockIOINTEL = 5579, + RoundToInfinityINTEL = 5582, + FloatingPointModeINTEL = 5583, + IntegerFunctions2INTEL = 5584, + FunctionPointersINTEL = 5603, + IndirectReferencesINTEL = 5604, + AsmINTEL = 5606, + AtomicFloat32MinMaxEXT = 5612, + AtomicFloat64MinMaxEXT = 5613, + AtomicFloat16MinMaxEXT = 5616, + VectorComputeINTEL = 5617, + VectorAnyINTEL = 5619, + ExpectAssumeKHR = 5629, + SubgroupAvcMotionEstimationINTEL = 5696, + SubgroupAvcMotionEstimationIntraINTEL = 5697, + SubgroupAvcMotionEstimationChromaINTEL = 5698, + VariableLengthArrayINTEL = 5817, + FunctionFloatControlINTEL = 5821, + FPGAMemoryAttributesINTEL = 5824, + FPFastMathModeINTEL = 5837, + ArbitraryPrecisionIntegersINTEL = 5844, + ArbitraryPrecisionFloatingPointINTEL = 5845, + UnstructuredLoopControlsINTEL = 5886, + FPGALoopControlsINTEL = 5888, + KernelAttributesINTEL = 5892, + FPGAKernelAttributesINTEL = 5897, + FPGAMemoryAccessesINTEL = 5898, + FPGAClusterAttributesINTEL = 5904, + LoopFuseINTEL = 5906, + FPGADSPControlINTEL = 5908, + MemoryAccessAliasingINTEL = 5910, + FPGAInvocationPipeliningAttributesINTEL = 5916, + FPGABufferLocationINTEL = 5920, + ArbitraryPrecisionFixedPointINTEL = 5922, + USMStorageClassesINTEL = 5935, + RuntimeAlignedAttributeINTEL = 5939, + IOPipesINTEL = 5943, + BlockingPipesINTEL = 5945, + FPGARegINTEL = 5948, + DotProductInputAll = 6016, + DotProductInputAllKHR = 6016, + DotProductInput4x8Bit = 6017, + DotProductInput4x8BitKHR = 6017, + DotProductInput4x8BitPacked = 6018, + DotProductInput4x8BitPackedKHR = 6018, + DotProduct = 6019, + DotProductKHR = 6019, + RayCullMaskKHR = 6020, + CooperativeMatrixKHR = 6022, + ReplicatedCompositesEXT = 6024, + BitInstructions = 6025, + GroupNonUniformRotateKHR = 6026, + FloatControls2 = 6029, + AtomicFloat32AddEXT = 6033, + AtomicFloat64AddEXT = 6034, + LongCompositesINTEL = 6089, + OptNoneEXT = 6094, + OptNoneINTEL = 6094, + AtomicFloat16AddEXT = 6095, + DebugInfoModuleINTEL = 6114, + BFloat16ConversionINTEL = 6115, + SplitBarrierINTEL = 6141, + ArithmeticFenceEXT = 6144, + FPGAClusterAttributesV2INTEL = 6150, + FPGAKernelAttributesv2INTEL = 6161, + FPMaxErrorINTEL = 6169, + FPGALatencyControlINTEL = 6171, + FPGAArgumentInterfacesINTEL = 6174, + GlobalVariableHostAccessINTEL = 6187, + GlobalVariableFPGADecorationsINTEL = 6189, + SubgroupBufferPrefetchINTEL = 6220, + Subgroup2DBlockIOINTEL = 6228, + Subgroup2DBlockTransformINTEL = 6229, + Subgroup2DBlockTransposeINTEL = 6230, + SubgroupMatrixMultiplyAccumulateINTEL = 6236, + GroupUniformArithmeticKHR = 6400, + MaskedGatherScatterINTEL = 6427, + CacheControlsINTEL = 6441, + RegisterLimitsINTEL = 6460, + Max = 0x7fffffff, +}; + +enum class RayFlagsShift : unsigned { + OpaqueKHR = 0, + NoOpaqueKHR = 1, + TerminateOnFirstHitKHR = 2, + SkipClosestHitShaderKHR = 3, + CullBackFacingTrianglesKHR = 4, + CullFrontFacingTrianglesKHR = 5, + CullOpaqueKHR = 6, + CullNoOpaqueKHR = 7, + SkipBuiltinPrimitivesNV = 8, + SkipTrianglesKHR = 8, + SkipAABBsKHR = 9, + ForceOpacityMicromap2StateEXT = 10, + Max = 0x7fffffff, +}; + +enum class RayFlagsMask : unsigned { + MaskNone = 0, + OpaqueKHR = 0x00000001, + NoOpaqueKHR = 0x00000002, + TerminateOnFirstHitKHR = 0x00000004, + SkipClosestHitShaderKHR = 0x00000008, + CullBackFacingTrianglesKHR = 0x00000010, + CullFrontFacingTrianglesKHR = 0x00000020, + CullOpaqueKHR = 0x00000040, + CullNoOpaqueKHR = 0x00000080, + SkipBuiltinPrimitivesNV = 0x00000100, + SkipTrianglesKHR = 0x00000100, + SkipAABBsKHR = 0x00000200, + ForceOpacityMicromap2StateEXT = 0x00000400, +}; + +enum class RayQueryIntersection : unsigned { + RayQueryCandidateIntersectionKHR = 0, + RayQueryCommittedIntersectionKHR = 1, + Max = 0x7fffffff, +}; + +enum class RayQueryCommittedIntersectionType : unsigned { + RayQueryCommittedIntersectionNoneKHR = 0, + RayQueryCommittedIntersectionTriangleKHR = 1, + RayQueryCommittedIntersectionGeneratedKHR = 2, + Max = 0x7fffffff, +}; + +enum class RayQueryCandidateIntersectionType : unsigned { + RayQueryCandidateIntersectionTriangleKHR = 0, + RayQueryCandidateIntersectionAABBKHR = 1, + Max = 0x7fffffff, +}; + +enum class FragmentShadingRateShift : unsigned { + Vertical2Pixels = 0, + Vertical4Pixels = 1, + Horizontal2Pixels = 2, + Horizontal4Pixels = 3, + Max = 0x7fffffff, +}; + +enum class FragmentShadingRateMask : unsigned { + MaskNone = 0, + Vertical2Pixels = 0x00000001, + Vertical4Pixels = 0x00000002, + Horizontal2Pixels = 0x00000004, + Horizontal4Pixels = 0x00000008, +}; + +enum class FPDenormMode : unsigned { + Preserve = 0, + FlushToZero = 1, + Max = 0x7fffffff, +}; + +enum class FPOperationMode : unsigned { + IEEE = 0, + ALT = 1, + Max = 0x7fffffff, +}; + +enum class QuantizationModes : unsigned { + TRN = 0, + TRN_ZERO = 1, + RND = 2, + RND_ZERO = 3, + RND_INF = 4, + RND_MIN_INF = 5, + RND_CONV = 6, + RND_CONV_ODD = 7, + Max = 0x7fffffff, +}; + +enum class OverflowModes : unsigned { + WRAP = 0, + SAT = 1, + SAT_ZERO = 2, + SAT_SYM = 3, + Max = 0x7fffffff, +}; + +enum class PackedVectorFormat : unsigned { + PackedVectorFormat4x8Bit = 0, + PackedVectorFormat4x8BitKHR = 0, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixOperandsShift : unsigned { + MatrixASignedComponentsKHR = 0, + MatrixBSignedComponentsKHR = 1, + MatrixCSignedComponentsKHR = 2, + MatrixResultSignedComponentsKHR = 3, + SaturatingAccumulationKHR = 4, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixOperandsMask : unsigned { + MaskNone = 0, + MatrixASignedComponentsKHR = 0x00000001, + MatrixBSignedComponentsKHR = 0x00000002, + MatrixCSignedComponentsKHR = 0x00000004, + MatrixResultSignedComponentsKHR = 0x00000008, + SaturatingAccumulationKHR = 0x00000010, +}; + +enum class CooperativeMatrixLayout : unsigned { + RowMajorKHR = 0, + ColumnMajorKHR = 1, + RowBlockedInterleavedARM = 4202, + ColumnBlockedInterleavedARM = 4203, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixUse : unsigned { + MatrixAKHR = 0, + MatrixBKHR = 1, + MatrixAccumulatorKHR = 2, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixReduceShift : unsigned { + Row = 0, + Column = 1, + CooperativeMatrixReduce2x2 = 2, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixReduceMask : unsigned { + MaskNone = 0, + Row = 0x00000001, + Column = 0x00000002, + CooperativeMatrixReduce2x2 = 0x00000004, +}; + +enum class TensorClampMode : unsigned { + Undefined = 0, + Constant = 1, + ClampToEdge = 2, + Repeat = 3, + RepeatMirrored = 4, + Max = 0x7fffffff, +}; + +enum class TensorAddressingOperandsShift : unsigned { + TensorView = 0, + DecodeFunc = 1, + Max = 0x7fffffff, +}; + +enum class TensorAddressingOperandsMask : unsigned { + MaskNone = 0, + TensorView = 0x00000001, + DecodeFunc = 0x00000002, +}; + +enum class TensorOperandsShift : unsigned { + NontemporalARM = 0, + OutOfBoundsValueARM = 1, + Max = 0x7fffffff, +}; + +enum class TensorOperandsMask : unsigned { + MaskNone = 0, + NontemporalARM = 0x00000001, + OutOfBoundsValueARM = 0x00000002, +}; + +enum class InitializationModeQualifier : unsigned { + InitOnDeviceReprogramINTEL = 0, + InitOnDeviceResetINTEL = 1, + Max = 0x7fffffff, +}; + +enum class HostAccessQualifier : unsigned { + NoneINTEL = 0, + ReadINTEL = 1, + WriteINTEL = 2, + ReadWriteINTEL = 3, + Max = 0x7fffffff, +}; + +enum class LoadCacheControl : unsigned { + UncachedINTEL = 0, + CachedINTEL = 1, + StreamingINTEL = 2, + InvalidateAfterReadINTEL = 3, + ConstCachedINTEL = 4, + Max = 0x7fffffff, +}; + +enum class StoreCacheControl : unsigned { + UncachedINTEL = 0, + WriteThroughINTEL = 1, + WriteBackINTEL = 2, + StreamingINTEL = 3, + Max = 0x7fffffff, +}; + +enum class NamedMaximumNumberOfRegisters : unsigned { + AutoINTEL = 0, + Max = 0x7fffffff, +}; + +enum class MatrixMultiplyAccumulateOperandsShift : unsigned { + MatrixASignedComponentsINTEL = 0, + MatrixBSignedComponentsINTEL = 1, + MatrixCBFloat16INTEL = 2, + MatrixResultBFloat16INTEL = 3, + MatrixAPackedInt8INTEL = 4, + MatrixBPackedInt8INTEL = 5, + MatrixAPackedInt4INTEL = 6, + MatrixBPackedInt4INTEL = 7, + MatrixATF32INTEL = 8, + MatrixBTF32INTEL = 9, + MatrixAPackedFloat16INTEL = 10, + MatrixBPackedFloat16INTEL = 11, + MatrixAPackedBFloat16INTEL = 12, + MatrixBPackedBFloat16INTEL = 13, + Max = 0x7fffffff, +}; + +enum class MatrixMultiplyAccumulateOperandsMask : unsigned { + MaskNone = 0, + MatrixASignedComponentsINTEL = 0x00000001, + MatrixBSignedComponentsINTEL = 0x00000002, + MatrixCBFloat16INTEL = 0x00000004, + MatrixResultBFloat16INTEL = 0x00000008, + MatrixAPackedInt8INTEL = 0x00000010, + MatrixBPackedInt8INTEL = 0x00000020, + MatrixAPackedInt4INTEL = 0x00000040, + MatrixBPackedInt4INTEL = 0x00000080, + MatrixATF32INTEL = 0x00000100, + MatrixBTF32INTEL = 0x00000200, + MatrixAPackedFloat16INTEL = 0x00000400, + MatrixBPackedFloat16INTEL = 0x00000800, + MatrixAPackedBFloat16INTEL = 0x00001000, + MatrixBPackedBFloat16INTEL = 0x00002000, +}; + +enum class RawAccessChainOperandsShift : unsigned { + RobustnessPerComponentNV = 0, + RobustnessPerElementNV = 1, + Max = 0x7fffffff, +}; + +enum class RawAccessChainOperandsMask : unsigned { + MaskNone = 0, + RobustnessPerComponentNV = 0x00000001, + RobustnessPerElementNV = 0x00000002, +}; + +enum class FPEncoding : unsigned { + BFloat16KHR = 0, + Float8E4M3EXT = 4214, + Float8E5M2EXT = 4215, + Max = 0x7fffffff, +}; + +enum class CooperativeVectorMatrixLayout : unsigned { + RowMajorNV = 0, + ColumnMajorNV = 1, + InferencingOptimalNV = 2, + TrainingOptimalNV = 3, + Max = 0x7fffffff, +}; + +enum class ComponentType : unsigned { + Float16NV = 0, + Float32NV = 1, + Float64NV = 2, + SignedInt8NV = 3, + SignedInt16NV = 4, + SignedInt32NV = 5, + SignedInt64NV = 6, + UnsignedInt8NV = 7, + UnsignedInt16NV = 8, + UnsignedInt32NV = 9, + UnsignedInt64NV = 10, + SignedInt8PackedNV = 1000491000, + UnsignedInt8PackedNV = 1000491001, + FloatE4M3NV = 1000491002, + FloatE5M2NV = 1000491003, + Max = 0x7fffffff, +}; + +enum class Op : unsigned { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpExecutionModeId = 331, + OpDecorateId = 332, + OpGroupNonUniformElect = 333, + OpGroupNonUniformAll = 334, + OpGroupNonUniformAny = 335, + OpGroupNonUniformAllEqual = 336, + OpGroupNonUniformBroadcast = 337, + OpGroupNonUniformBroadcastFirst = 338, + OpGroupNonUniformBallot = 339, + OpGroupNonUniformInverseBallot = 340, + OpGroupNonUniformBallotBitExtract = 341, + OpGroupNonUniformBallotBitCount = 342, + OpGroupNonUniformBallotFindLSB = 343, + OpGroupNonUniformBallotFindMSB = 344, + OpGroupNonUniformShuffle = 345, + OpGroupNonUniformShuffleXor = 346, + OpGroupNonUniformShuffleUp = 347, + OpGroupNonUniformShuffleDown = 348, + OpGroupNonUniformIAdd = 349, + OpGroupNonUniformFAdd = 350, + OpGroupNonUniformIMul = 351, + OpGroupNonUniformFMul = 352, + OpGroupNonUniformSMin = 353, + OpGroupNonUniformUMin = 354, + OpGroupNonUniformFMin = 355, + OpGroupNonUniformSMax = 356, + OpGroupNonUniformUMax = 357, + OpGroupNonUniformFMax = 358, + OpGroupNonUniformBitwiseAnd = 359, + OpGroupNonUniformBitwiseOr = 360, + OpGroupNonUniformBitwiseXor = 361, + OpGroupNonUniformLogicalAnd = 362, + OpGroupNonUniformLogicalOr = 363, + OpGroupNonUniformLogicalXor = 364, + OpGroupNonUniformQuadBroadcast = 365, + OpGroupNonUniformQuadSwap = 366, + OpCopyLogical = 400, + OpPtrEqual = 401, + OpPtrNotEqual = 402, + OpPtrDiff = 403, + OpColorAttachmentReadEXT = 4160, + OpDepthAttachmentReadEXT = 4161, + OpStencilAttachmentReadEXT = 4162, + OpTypeTensorARM = 4163, + OpTensorReadARM = 4164, + OpTensorWriteARM = 4165, + OpTensorQuerySizeARM = 4166, + OpTerminateInvocation = 4416, + OpTypeUntypedPointerKHR = 4417, + OpUntypedVariableKHR = 4418, + OpUntypedAccessChainKHR = 4419, + OpUntypedInBoundsAccessChainKHR = 4420, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpUntypedPtrAccessChainKHR = 4423, + OpUntypedInBoundsPtrAccessChainKHR = 4424, + OpUntypedArrayLengthKHR = 4425, + OpUntypedPrefetchKHR = 4426, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpGroupNonUniformRotateKHR = 4431, + OpSubgroupReadInvocationKHR = 4432, + OpExtInstWithForwardRefsKHR = 4433, + OpTraceRayKHR = 4445, + OpExecuteCallableKHR = 4446, + OpConvertUToAccelerationStructureKHR = 4447, + OpIgnoreIntersectionKHR = 4448, + OpTerminateRayKHR = 4449, + OpSDot = 4450, + OpSDotKHR = 4450, + OpUDot = 4451, + OpUDotKHR = 4451, + OpSUDot = 4452, + OpSUDotKHR = 4452, + OpSDotAccSat = 4453, + OpSDotAccSatKHR = 4453, + OpUDotAccSat = 4454, + OpUDotAccSatKHR = 4454, + OpSUDotAccSat = 4455, + OpSUDotAccSatKHR = 4455, + OpTypeCooperativeMatrixKHR = 4456, + OpCooperativeMatrixLoadKHR = 4457, + OpCooperativeMatrixStoreKHR = 4458, + OpCooperativeMatrixMulAddKHR = 4459, + OpCooperativeMatrixLengthKHR = 4460, + OpConstantCompositeReplicateEXT = 4461, + OpSpecConstantCompositeReplicateEXT = 4462, + OpCompositeConstructReplicateEXT = 4463, + OpTypeRayQueryKHR = 4472, + OpRayQueryInitializeKHR = 4473, + OpRayQueryTerminateKHR = 4474, + OpRayQueryGenerateIntersectionKHR = 4475, + OpRayQueryConfirmIntersectionKHR = 4476, + OpRayQueryProceedKHR = 4477, + OpRayQueryGetIntersectionTypeKHR = 4479, + OpImageSampleWeightedQCOM = 4480, + OpImageBoxFilterQCOM = 4481, + OpImageBlockMatchSSDQCOM = 4482, + OpImageBlockMatchSADQCOM = 4483, + OpBitCastArrayQCOM = 4497, + OpImageBlockMatchWindowSSDQCOM = 4500, + OpImageBlockMatchWindowSADQCOM = 4501, + OpImageBlockMatchGatherSSDQCOM = 4502, + OpImageBlockMatchGatherSADQCOM = 4503, + OpCompositeConstructCoopMatQCOM = 4540, + OpCompositeExtractCoopMatQCOM = 4541, + OpExtractSubArrayQCOM = 4542, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpReadClockKHR = 5056, + OpAllocateNodePayloadsAMDX = 5074, + OpEnqueueNodePayloadsAMDX = 5075, + OpTypeNodePayloadArrayAMDX = 5076, + OpFinishWritingNodePayloadAMDX = 5078, + OpNodePayloadArrayLengthAMDX = 5090, + OpIsNodePayloadValidAMDX = 5101, + OpConstantStringAMDX = 5103, + OpSpecConstantStringAMDX = 5104, + OpGroupNonUniformQuadAllKHR = 5110, + OpGroupNonUniformQuadAnyKHR = 5111, + OpHitObjectRecordHitMotionNV = 5249, + OpHitObjectRecordHitWithIndexMotionNV = 5250, + OpHitObjectRecordMissMotionNV = 5251, + OpHitObjectGetWorldToObjectNV = 5252, + OpHitObjectGetObjectToWorldNV = 5253, + OpHitObjectGetObjectRayDirectionNV = 5254, + OpHitObjectGetObjectRayOriginNV = 5255, + OpHitObjectTraceRayMotionNV = 5256, + OpHitObjectGetShaderRecordBufferHandleNV = 5257, + OpHitObjectGetShaderBindingTableRecordIndexNV = 5258, + OpHitObjectRecordEmptyNV = 5259, + OpHitObjectTraceRayNV = 5260, + OpHitObjectRecordHitNV = 5261, + OpHitObjectRecordHitWithIndexNV = 5262, + OpHitObjectRecordMissNV = 5263, + OpHitObjectExecuteShaderNV = 5264, + OpHitObjectGetCurrentTimeNV = 5265, + OpHitObjectGetAttributesNV = 5266, + OpHitObjectGetHitKindNV = 5267, + OpHitObjectGetPrimitiveIndexNV = 5268, + OpHitObjectGetGeometryIndexNV = 5269, + OpHitObjectGetInstanceIdNV = 5270, + OpHitObjectGetInstanceCustomIndexNV = 5271, + OpHitObjectGetWorldRayDirectionNV = 5272, + OpHitObjectGetWorldRayOriginNV = 5273, + OpHitObjectGetRayTMaxNV = 5274, + OpHitObjectGetRayTMinNV = 5275, + OpHitObjectIsEmptyNV = 5276, + OpHitObjectIsHitNV = 5277, + OpHitObjectIsMissNV = 5278, + OpReorderThreadWithHitObjectNV = 5279, + OpReorderThreadWithHintNV = 5280, + OpTypeHitObjectNV = 5281, + OpImageSampleFootprintNV = 5283, + OpTypeCooperativeVectorNV = 5288, + OpCooperativeVectorMatrixMulNV = 5289, + OpCooperativeVectorOuterProductAccumulateNV = 5290, + OpCooperativeVectorReduceSumAccumulateNV = 5291, + OpCooperativeVectorMatrixMulAddNV = 5292, + OpCooperativeMatrixConvertNV = 5293, + OpEmitMeshTasksEXT = 5294, + OpSetMeshOutputsEXT = 5295, + OpGroupNonUniformPartitionNV = 5296, + OpWritePackedPrimitiveIndices4x8NV = 5299, + OpFetchMicroTriangleVertexPositionNV = 5300, + OpFetchMicroTriangleVertexBarycentricNV = 5301, + OpCooperativeVectorLoadNV = 5302, + OpCooperativeVectorStoreNV = 5303, + OpHitObjectRecordFromQueryEXT = 5304, + OpHitObjectRecordMissEXT = 5305, + OpHitObjectRecordMissMotionEXT = 5306, + OpHitObjectGetIntersectionTriangleVertexPositionsEXT = 5307, + OpHitObjectGetRayFlagsEXT = 5308, + OpHitObjectSetShaderBindingTableRecordIndexEXT = 5309, + OpHitObjectReorderExecuteShaderEXT = 5310, + OpHitObjectTraceReorderExecuteEXT = 5311, + OpHitObjectTraceMotionReorderExecuteEXT = 5312, + OpTypeHitObjectEXT = 5313, + OpReorderThreadWithHintEXT = 5314, + OpReorderThreadWithHitObjectEXT = 5315, + OpHitObjectTraceRayEXT = 5316, + OpHitObjectTraceRayMotionEXT = 5317, + OpHitObjectRecordEmptyEXT = 5318, + OpHitObjectExecuteShaderEXT = 5319, + OpHitObjectGetCurrentTimeEXT = 5320, + OpHitObjectGetAttributesEXT = 5321, + OpHitObjectGetHitKindEXT = 5322, + OpHitObjectGetPrimitiveIndexEXT = 5323, + OpHitObjectGetGeometryIndexEXT = 5324, + OpHitObjectGetInstanceIdEXT = 5325, + OpHitObjectGetInstanceCustomIndexEXT = 5326, + OpHitObjectGetObjectRayOriginEXT = 5327, + OpHitObjectGetObjectRayDirectionEXT = 5328, + OpHitObjectGetWorldRayDirectionEXT = 5329, + OpHitObjectGetWorldRayOriginEXT = 5330, + OpHitObjectGetObjectToWorldEXT = 5331, + OpHitObjectGetWorldToObjectEXT = 5332, + OpHitObjectGetRayTMaxEXT = 5333, + OpReportIntersectionKHR = 5334, + OpReportIntersectionNV = 5334, + OpIgnoreIntersectionNV = 5335, + OpTerminateRayNV = 5336, + OpTraceNV = 5337, + OpTraceMotionNV = 5338, + OpTraceRayMotionNV = 5339, + OpRayQueryGetIntersectionTriangleVertexPositionsKHR = 5340, + OpTypeAccelerationStructureKHR = 5341, + OpTypeAccelerationStructureNV = 5341, + OpExecuteCallableNV = 5344, + OpRayQueryGetClusterIdNV = 5345, + OpHitObjectGetClusterIdNV = 5346, + OpHitObjectGetRayTMinEXT = 5347, + OpHitObjectGetShaderBindingTableRecordIndexEXT = 5348, + OpHitObjectGetShaderRecordBufferHandleEXT = 5349, + OpHitObjectIsEmptyEXT = 5350, + OpHitObjectIsHitEXT = 5351, + OpHitObjectIsMissEXT = 5352, + OpTypeCooperativeMatrixNV = 5358, + OpCooperativeMatrixLoadNV = 5359, + OpCooperativeMatrixStoreNV = 5360, + OpCooperativeMatrixMulAddNV = 5361, + OpCooperativeMatrixLengthNV = 5362, + OpBeginInvocationInterlockEXT = 5364, + OpEndInvocationInterlockEXT = 5365, + OpCooperativeMatrixReduceNV = 5366, + OpCooperativeMatrixLoadTensorNV = 5367, + OpCooperativeMatrixStoreTensorNV = 5368, + OpCooperativeMatrixPerElementOpNV = 5369, + OpTypeTensorLayoutNV = 5370, + OpTypeTensorViewNV = 5371, + OpCreateTensorLayoutNV = 5372, + OpTensorLayoutSetDimensionNV = 5373, + OpTensorLayoutSetStrideNV = 5374, + OpTensorLayoutSliceNV = 5375, + OpTensorLayoutSetClampValueNV = 5376, + OpCreateTensorViewNV = 5377, + OpTensorViewSetDimensionNV = 5378, + OpTensorViewSetStrideNV = 5379, + OpDemoteToHelperInvocation = 5380, + OpDemoteToHelperInvocationEXT = 5380, + OpIsHelperInvocationEXT = 5381, + OpTensorViewSetClipNV = 5382, + OpTensorLayoutSetBlockSizeNV = 5384, + OpCooperativeMatrixTransposeNV = 5390, + OpConvertUToImageNV = 5391, + OpConvertUToSamplerNV = 5392, + OpConvertImageToUNV = 5393, + OpConvertSamplerToUNV = 5394, + OpConvertUToSampledImageNV = 5395, + OpConvertSampledImageToUNV = 5396, + OpSamplerImageAddressingModeNV = 5397, + OpRawAccessChainNV = 5398, + OpRayQueryGetIntersectionSpherePositionNV = 5427, + OpRayQueryGetIntersectionSphereRadiusNV = 5428, + OpRayQueryGetIntersectionLSSPositionsNV = 5429, + OpRayQueryGetIntersectionLSSRadiiNV = 5430, + OpRayQueryGetIntersectionLSSHitValueNV = 5431, + OpHitObjectGetSpherePositionNV = 5432, + OpHitObjectGetSphereRadiusNV = 5433, + OpHitObjectGetLSSPositionsNV = 5434, + OpHitObjectGetLSSRadiiNV = 5435, + OpHitObjectIsSphereHitNV = 5436, + OpHitObjectIsLSSHitNV = 5437, + OpRayQueryIsSphereHitNV = 5438, + OpRayQueryIsLSSHitNV = 5439, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpSubgroupImageMediaBlockReadINTEL = 5580, + OpSubgroupImageMediaBlockWriteINTEL = 5581, + OpUCountLeadingZerosINTEL = 5585, + OpUCountTrailingZerosINTEL = 5586, + OpAbsISubINTEL = 5587, + OpAbsUSubINTEL = 5588, + OpIAddSatINTEL = 5589, + OpUAddSatINTEL = 5590, + OpIAverageINTEL = 5591, + OpUAverageINTEL = 5592, + OpIAverageRoundedINTEL = 5593, + OpUAverageRoundedINTEL = 5594, + OpISubSatINTEL = 5595, + OpUSubSatINTEL = 5596, + OpIMul32x16INTEL = 5597, + OpUMul32x16INTEL = 5598, + OpConstantFunctionPointerINTEL = 5600, + OpFunctionPointerCallINTEL = 5601, + OpAsmTargetINTEL = 5609, + OpAsmINTEL = 5610, + OpAsmCallINTEL = 5611, + OpAtomicFMinEXT = 5614, + OpAtomicFMaxEXT = 5615, + OpAssumeTrueKHR = 5630, + OpExpectKHR = 5631, + OpDecorateString = 5632, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateString = 5633, + OpMemberDecorateStringGOOGLE = 5633, + OpVmeImageINTEL = 5699, + OpTypeVmeImageINTEL = 5700, + OpTypeAvcImePayloadINTEL = 5701, + OpTypeAvcRefPayloadINTEL = 5702, + OpTypeAvcSicPayloadINTEL = 5703, + OpTypeAvcMcePayloadINTEL = 5704, + OpTypeAvcMceResultINTEL = 5705, + OpTypeAvcImeResultINTEL = 5706, + OpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707, + OpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708, + OpTypeAvcImeSingleReferenceStreaminINTEL = 5709, + OpTypeAvcImeDualReferenceStreaminINTEL = 5710, + OpTypeAvcRefResultINTEL = 5711, + OpTypeAvcSicResultINTEL = 5712, + OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713, + OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714, + OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715, + OpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716, + OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717, + OpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718, + OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719, + OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720, + OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721, + OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722, + OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723, + OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724, + OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725, + OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726, + OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727, + OpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728, + OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729, + OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730, + OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731, + OpSubgroupAvcMceConvertToImePayloadINTEL = 5732, + OpSubgroupAvcMceConvertToImeResultINTEL = 5733, + OpSubgroupAvcMceConvertToRefPayloadINTEL = 5734, + OpSubgroupAvcMceConvertToRefResultINTEL = 5735, + OpSubgroupAvcMceConvertToSicPayloadINTEL = 5736, + OpSubgroupAvcMceConvertToSicResultINTEL = 5737, + OpSubgroupAvcMceGetMotionVectorsINTEL = 5738, + OpSubgroupAvcMceGetInterDistortionsINTEL = 5739, + OpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740, + OpSubgroupAvcMceGetInterMajorShapeINTEL = 5741, + OpSubgroupAvcMceGetInterMinorShapeINTEL = 5742, + OpSubgroupAvcMceGetInterDirectionsINTEL = 5743, + OpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744, + OpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745, + OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746, + OpSubgroupAvcImeInitializeINTEL = 5747, + OpSubgroupAvcImeSetSingleReferenceINTEL = 5748, + OpSubgroupAvcImeSetDualReferenceINTEL = 5749, + OpSubgroupAvcImeRefWindowSizeINTEL = 5750, + OpSubgroupAvcImeAdjustRefOffsetINTEL = 5751, + OpSubgroupAvcImeConvertToMcePayloadINTEL = 5752, + OpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753, + OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754, + OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755, + OpSubgroupAvcImeSetWeightedSadINTEL = 5756, + OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757, + OpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758, + OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759, + OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760, + OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761, + OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762, + OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763, + OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764, + OpSubgroupAvcImeConvertToMceResultINTEL = 5765, + OpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766, + OpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767, + OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768, + OpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769, + OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770, + OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771, + OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772, + OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773, + OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774, + OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775, + OpSubgroupAvcImeGetBorderReachedINTEL = 5776, + OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777, + OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778, + OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779, + OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780, + OpSubgroupAvcFmeInitializeINTEL = 5781, + OpSubgroupAvcBmeInitializeINTEL = 5782, + OpSubgroupAvcRefConvertToMcePayloadINTEL = 5783, + OpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784, + OpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785, + OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786, + OpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787, + OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788, + OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789, + OpSubgroupAvcRefConvertToMceResultINTEL = 5790, + OpSubgroupAvcSicInitializeINTEL = 5791, + OpSubgroupAvcSicConfigureSkcINTEL = 5792, + OpSubgroupAvcSicConfigureIpeLumaINTEL = 5793, + OpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794, + OpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795, + OpSubgroupAvcSicConvertToMcePayloadINTEL = 5796, + OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797, + OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798, + OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799, + OpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800, + OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801, + OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802, + OpSubgroupAvcSicEvaluateIpeINTEL = 5803, + OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804, + OpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805, + OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806, + OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807, + OpSubgroupAvcSicConvertToMceResultINTEL = 5808, + OpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809, + OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810, + OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811, + OpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812, + OpSubgroupAvcSicGetIpeChromaModeINTEL = 5813, + OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814, + OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815, + OpSubgroupAvcSicGetInterRawSadsINTEL = 5816, + OpVariableLengthArrayINTEL = 5818, + OpSaveMemoryINTEL = 5819, + OpRestoreMemoryINTEL = 5820, + OpArbitraryFloatSinCosPiINTEL = 5840, + OpArbitraryFloatCastINTEL = 5841, + OpArbitraryFloatCastFromIntINTEL = 5842, + OpArbitraryFloatCastToIntINTEL = 5843, + OpArbitraryFloatAddINTEL = 5846, + OpArbitraryFloatSubINTEL = 5847, + OpArbitraryFloatMulINTEL = 5848, + OpArbitraryFloatDivINTEL = 5849, + OpArbitraryFloatGTINTEL = 5850, + OpArbitraryFloatGEINTEL = 5851, + OpArbitraryFloatLTINTEL = 5852, + OpArbitraryFloatLEINTEL = 5853, + OpArbitraryFloatEQINTEL = 5854, + OpArbitraryFloatRecipINTEL = 5855, + OpArbitraryFloatRSqrtINTEL = 5856, + OpArbitraryFloatCbrtINTEL = 5857, + OpArbitraryFloatHypotINTEL = 5858, + OpArbitraryFloatSqrtINTEL = 5859, + OpArbitraryFloatLogINTEL = 5860, + OpArbitraryFloatLog2INTEL = 5861, + OpArbitraryFloatLog10INTEL = 5862, + OpArbitraryFloatLog1pINTEL = 5863, + OpArbitraryFloatExpINTEL = 5864, + OpArbitraryFloatExp2INTEL = 5865, + OpArbitraryFloatExp10INTEL = 5866, + OpArbitraryFloatExpm1INTEL = 5867, + OpArbitraryFloatSinINTEL = 5868, + OpArbitraryFloatCosINTEL = 5869, + OpArbitraryFloatSinCosINTEL = 5870, + OpArbitraryFloatSinPiINTEL = 5871, + OpArbitraryFloatCosPiINTEL = 5872, + OpArbitraryFloatASinINTEL = 5873, + OpArbitraryFloatASinPiINTEL = 5874, + OpArbitraryFloatACosINTEL = 5875, + OpArbitraryFloatACosPiINTEL = 5876, + OpArbitraryFloatATanINTEL = 5877, + OpArbitraryFloatATanPiINTEL = 5878, + OpArbitraryFloatATan2INTEL = 5879, + OpArbitraryFloatPowINTEL = 5880, + OpArbitraryFloatPowRINTEL = 5881, + OpArbitraryFloatPowNINTEL = 5882, + OpLoopControlINTEL = 5887, + OpAliasDomainDeclINTEL = 5911, + OpAliasScopeDeclINTEL = 5912, + OpAliasScopeListDeclINTEL = 5913, + OpFixedSqrtINTEL = 5923, + OpFixedRecipINTEL = 5924, + OpFixedRsqrtINTEL = 5925, + OpFixedSinINTEL = 5926, + OpFixedCosINTEL = 5927, + OpFixedSinCosINTEL = 5928, + OpFixedSinPiINTEL = 5929, + OpFixedCosPiINTEL = 5930, + OpFixedSinCosPiINTEL = 5931, + OpFixedLogINTEL = 5932, + OpFixedExpINTEL = 5933, + OpPtrCastToCrossWorkgroupINTEL = 5934, + OpCrossWorkgroupCastToPtrINTEL = 5938, + OpReadPipeBlockingINTEL = 5946, + OpWritePipeBlockingINTEL = 5947, + OpFPGARegINTEL = 5949, + OpRayQueryGetRayTMinKHR = 6016, + OpRayQueryGetRayFlagsKHR = 6017, + OpRayQueryGetIntersectionTKHR = 6018, + OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019, + OpRayQueryGetIntersectionInstanceIdKHR = 6020, + OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021, + OpRayQueryGetIntersectionGeometryIndexKHR = 6022, + OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023, + OpRayQueryGetIntersectionBarycentricsKHR = 6024, + OpRayQueryGetIntersectionFrontFaceKHR = 6025, + OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026, + OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027, + OpRayQueryGetIntersectionObjectRayOriginKHR = 6028, + OpRayQueryGetWorldRayDirectionKHR = 6029, + OpRayQueryGetWorldRayOriginKHR = 6030, + OpRayQueryGetIntersectionObjectToWorldKHR = 6031, + OpRayQueryGetIntersectionWorldToObjectKHR = 6032, + OpAtomicFAddEXT = 6035, + OpTypeBufferSurfaceINTEL = 6086, + OpTypeStructContinuedINTEL = 6090, + OpConstantCompositeContinuedINTEL = 6091, + OpSpecConstantCompositeContinuedINTEL = 6092, + OpCompositeConstructContinuedINTEL = 6096, + OpConvertFToBF16INTEL = 6116, + OpConvertBF16ToFINTEL = 6117, + OpControlBarrierArriveINTEL = 6142, + OpControlBarrierWaitINTEL = 6143, + OpArithmeticFenceEXT = 6145, + OpSubgroupBlockPrefetchINTEL = 6221, + OpSubgroup2DBlockLoadINTEL = 6231, + OpSubgroup2DBlockLoadTransformINTEL = 6232, + OpSubgroup2DBlockLoadTransposeINTEL = 6233, + OpSubgroup2DBlockPrefetchINTEL = 6234, + OpSubgroup2DBlockStoreINTEL = 6235, + OpSubgroupMatrixMultiplyAccumulateINTEL = 6237, + OpGroupIMulKHR = 6401, + OpGroupFMulKHR = 6402, + OpGroupBitwiseAndKHR = 6403, + OpGroupBitwiseOrKHR = 6404, + OpGroupBitwiseXorKHR = 6405, + OpGroupLogicalAndKHR = 6406, + OpGroupLogicalOrKHR = 6407, + OpGroupLogicalXorKHR = 6408, + OpMaskedGatherINTEL = 6428, + OpMaskedScatterINTEL = 6429, + Max = 0x7fffffff, +}; + +#ifdef SPV_ENABLE_UTILITY_CODE +#ifndef __cplusplus +#include +#endif +inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { + *hasResult = *hasResultType = false; + switch (opcode) { + default: /* unknown opcode */ break; + case Op::OpNop: *hasResult = false; *hasResultType = false; break; + case Op::OpUndef: *hasResult = true; *hasResultType = true; break; + case Op::OpSourceContinued: *hasResult = false; *hasResultType = false; break; + case Op::OpSource: *hasResult = false; *hasResultType = false; break; + case Op::OpSourceExtension: *hasResult = false; *hasResultType = false; break; + case Op::OpName: *hasResult = false; *hasResultType = false; break; + case Op::OpMemberName: *hasResult = false; *hasResultType = false; break; + case Op::OpString: *hasResult = true; *hasResultType = false; break; + case Op::OpLine: *hasResult = false; *hasResultType = false; break; + case Op::OpExtension: *hasResult = false; *hasResultType = false; break; + case Op::OpExtInstImport: *hasResult = true; *hasResultType = false; break; + case Op::OpExtInst: *hasResult = true; *hasResultType = true; break; + case Op::OpMemoryModel: *hasResult = false; *hasResultType = false; break; + case Op::OpEntryPoint: *hasResult = false; *hasResultType = false; break; + case Op::OpExecutionMode: *hasResult = false; *hasResultType = false; break; + case Op::OpCapability: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeVoid: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeBool: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeInt: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeFloat: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeVector: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeMatrix: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeImage: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeSampler: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeSampledImage: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeArray: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeRuntimeArray: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeStruct: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeOpaque: *hasResult = true; *hasResultType = false; break; + case Op::OpTypePointer: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeFunction: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeEvent: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeDeviceEvent: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeReserveId: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeQueue: *hasResult = true; *hasResultType = false; break; + case Op::OpTypePipe: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeForwardPointer: *hasResult = false; *hasResultType = false; break; + case Op::OpConstantTrue: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantFalse: *hasResult = true; *hasResultType = true; break; + case Op::OpConstant: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantComposite: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantSampler: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantNull: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantTrue: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantFalse: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstant: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantComposite: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantOp: *hasResult = true; *hasResultType = true; break; + case Op::OpFunction: *hasResult = true; *hasResultType = true; break; + case Op::OpFunctionParameter: *hasResult = true; *hasResultType = true; break; + case Op::OpFunctionEnd: *hasResult = false; *hasResultType = false; break; + case Op::OpFunctionCall: *hasResult = true; *hasResultType = true; break; + case Op::OpVariable: *hasResult = true; *hasResultType = true; break; + case Op::OpImageTexelPointer: *hasResult = true; *hasResultType = true; break; + case Op::OpLoad: *hasResult = true; *hasResultType = true; break; + case Op::OpStore: *hasResult = false; *hasResultType = false; break; + case Op::OpCopyMemory: *hasResult = false; *hasResultType = false; break; + case Op::OpCopyMemorySized: *hasResult = false; *hasResultType = false; break; + case Op::OpAccessChain: *hasResult = true; *hasResultType = true; break; + case Op::OpInBoundsAccessChain: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrAccessChain: *hasResult = true; *hasResultType = true; break; + case Op::OpArrayLength: *hasResult = true; *hasResultType = true; break; + case Op::OpGenericPtrMemSemantics: *hasResult = true; *hasResultType = true; break; + case Op::OpInBoundsPtrAccessChain: *hasResult = true; *hasResultType = true; break; + case Op::OpDecorate: *hasResult = false; *hasResultType = false; break; + case Op::OpMemberDecorate: *hasResult = false; *hasResultType = false; break; + case Op::OpDecorationGroup: *hasResult = true; *hasResultType = false; break; + case Op::OpGroupDecorate: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupMemberDecorate: *hasResult = false; *hasResultType = false; break; + case Op::OpVectorExtractDynamic: *hasResult = true; *hasResultType = true; break; + case Op::OpVectorInsertDynamic: *hasResult = true; *hasResultType = true; break; + case Op::OpVectorShuffle: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeConstruct: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeExtract: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeInsert: *hasResult = true; *hasResultType = true; break; + case Op::OpCopyObject: *hasResult = true; *hasResultType = true; break; + case Op::OpTranspose: *hasResult = true; *hasResultType = true; break; + case Op::OpSampledImage: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageFetch: *hasResult = true; *hasResultType = true; break; + case Op::OpImageGather: *hasResult = true; *hasResultType = true; break; + case Op::OpImageDrefGather: *hasResult = true; *hasResultType = true; break; + case Op::OpImageRead: *hasResult = true; *hasResultType = true; break; + case Op::OpImageWrite: *hasResult = false; *hasResultType = false; break; + case Op::OpImage: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQueryFormat: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQueryOrder: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQuerySizeLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQuerySize: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQueryLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQueryLevels: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQuerySamples: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertFToU: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertFToS: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertSToF: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToF: *hasResult = true; *hasResultType = true; break; + case Op::OpUConvert: *hasResult = true; *hasResultType = true; break; + case Op::OpSConvert: *hasResult = true; *hasResultType = true; break; + case Op::OpFConvert: *hasResult = true; *hasResultType = true; break; + case Op::OpQuantizeToF16: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertPtrToU: *hasResult = true; *hasResultType = true; break; + case Op::OpSatConvertSToU: *hasResult = true; *hasResultType = true; break; + case Op::OpSatConvertUToS: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToPtr: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrCastToGeneric: *hasResult = true; *hasResultType = true; break; + case Op::OpGenericCastToPtr: *hasResult = true; *hasResultType = true; break; + case Op::OpGenericCastToPtrExplicit: *hasResult = true; *hasResultType = true; break; + case Op::OpBitcast: *hasResult = true; *hasResultType = true; break; + case Op::OpSNegate: *hasResult = true; *hasResultType = true; break; + case Op::OpFNegate: *hasResult = true; *hasResultType = true; break; + case Op::OpIAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpFAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpISub: *hasResult = true; *hasResultType = true; break; + case Op::OpFSub: *hasResult = true; *hasResultType = true; break; + case Op::OpIMul: *hasResult = true; *hasResultType = true; break; + case Op::OpFMul: *hasResult = true; *hasResultType = true; break; + case Op::OpUDiv: *hasResult = true; *hasResultType = true; break; + case Op::OpSDiv: *hasResult = true; *hasResultType = true; break; + case Op::OpFDiv: *hasResult = true; *hasResultType = true; break; + case Op::OpUMod: *hasResult = true; *hasResultType = true; break; + case Op::OpSRem: *hasResult = true; *hasResultType = true; break; + case Op::OpSMod: *hasResult = true; *hasResultType = true; break; + case Op::OpFRem: *hasResult = true; *hasResultType = true; break; + case Op::OpFMod: *hasResult = true; *hasResultType = true; break; + case Op::OpVectorTimesScalar: *hasResult = true; *hasResultType = true; break; + case Op::OpMatrixTimesScalar: *hasResult = true; *hasResultType = true; break; + case Op::OpVectorTimesMatrix: *hasResult = true; *hasResultType = true; break; + case Op::OpMatrixTimesVector: *hasResult = true; *hasResultType = true; break; + case Op::OpMatrixTimesMatrix: *hasResult = true; *hasResultType = true; break; + case Op::OpOuterProduct: *hasResult = true; *hasResultType = true; break; + case Op::OpDot: *hasResult = true; *hasResultType = true; break; + case Op::OpIAddCarry: *hasResult = true; *hasResultType = true; break; + case Op::OpISubBorrow: *hasResult = true; *hasResultType = true; break; + case Op::OpUMulExtended: *hasResult = true; *hasResultType = true; break; + case Op::OpSMulExtended: *hasResult = true; *hasResultType = true; break; + case Op::OpAny: *hasResult = true; *hasResultType = true; break; + case Op::OpAll: *hasResult = true; *hasResultType = true; break; + case Op::OpIsNan: *hasResult = true; *hasResultType = true; break; + case Op::OpIsInf: *hasResult = true; *hasResultType = true; break; + case Op::OpIsFinite: *hasResult = true; *hasResultType = true; break; + case Op::OpIsNormal: *hasResult = true; *hasResultType = true; break; + case Op::OpSignBitSet: *hasResult = true; *hasResultType = true; break; + case Op::OpLessOrGreater: *hasResult = true; *hasResultType = true; break; + case Op::OpOrdered: *hasResult = true; *hasResultType = true; break; + case Op::OpUnordered: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalNotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalOr: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalNot: *hasResult = true; *hasResultType = true; break; + case Op::OpSelect: *hasResult = true; *hasResultType = true; break; + case Op::OpIEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpINotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpUGreaterThan: *hasResult = true; *hasResultType = true; break; + case Op::OpSGreaterThan: *hasResult = true; *hasResultType = true; break; + case Op::OpUGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpSGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpULessThan: *hasResult = true; *hasResultType = true; break; + case Op::OpSLessThan: *hasResult = true; *hasResultType = true; break; + case Op::OpULessThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpSLessThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdNotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordNotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdLessThan: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordLessThan: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdGreaterThan: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordGreaterThan: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdLessThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordLessThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpShiftRightLogical: *hasResult = true; *hasResultType = true; break; + case Op::OpShiftRightArithmetic: *hasResult = true; *hasResultType = true; break; + case Op::OpShiftLeftLogical: *hasResult = true; *hasResultType = true; break; + case Op::OpBitwiseOr: *hasResult = true; *hasResultType = true; break; + case Op::OpBitwiseXor: *hasResult = true; *hasResultType = true; break; + case Op::OpBitwiseAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpNot: *hasResult = true; *hasResultType = true; break; + case Op::OpBitFieldInsert: *hasResult = true; *hasResultType = true; break; + case Op::OpBitFieldSExtract: *hasResult = true; *hasResultType = true; break; + case Op::OpBitFieldUExtract: *hasResult = true; *hasResultType = true; break; + case Op::OpBitReverse: *hasResult = true; *hasResultType = true; break; + case Op::OpBitCount: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdx: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdy: *hasResult = true; *hasResultType = true; break; + case Op::OpFwidth: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdxFine: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdyFine: *hasResult = true; *hasResultType = true; break; + case Op::OpFwidthFine: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdxCoarse: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdyCoarse: *hasResult = true; *hasResultType = true; break; + case Op::OpFwidthCoarse: *hasResult = true; *hasResultType = true; break; + case Op::OpEmitVertex: *hasResult = false; *hasResultType = false; break; + case Op::OpEndPrimitive: *hasResult = false; *hasResultType = false; break; + case Op::OpEmitStreamVertex: *hasResult = false; *hasResultType = false; break; + case Op::OpEndStreamPrimitive: *hasResult = false; *hasResultType = false; break; + case Op::OpControlBarrier: *hasResult = false; *hasResultType = false; break; + case Op::OpMemoryBarrier: *hasResult = false; *hasResultType = false; break; + case Op::OpAtomicLoad: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicStore: *hasResult = false; *hasResultType = false; break; + case Op::OpAtomicExchange: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicCompareExchange: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicCompareExchangeWeak: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicIIncrement: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicIDecrement: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicIAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicISub: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicSMin: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicUMin: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicSMax: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicUMax: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicOr: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicXor: *hasResult = true; *hasResultType = true; break; + case Op::OpPhi: *hasResult = true; *hasResultType = true; break; + case Op::OpLoopMerge: *hasResult = false; *hasResultType = false; break; + case Op::OpSelectionMerge: *hasResult = false; *hasResultType = false; break; + case Op::OpLabel: *hasResult = true; *hasResultType = false; break; + case Op::OpBranch: *hasResult = false; *hasResultType = false; break; + case Op::OpBranchConditional: *hasResult = false; *hasResultType = false; break; + case Op::OpSwitch: *hasResult = false; *hasResultType = false; break; + case Op::OpKill: *hasResult = false; *hasResultType = false; break; + case Op::OpReturn: *hasResult = false; *hasResultType = false; break; + case Op::OpReturnValue: *hasResult = false; *hasResultType = false; break; + case Op::OpUnreachable: *hasResult = false; *hasResultType = false; break; + case Op::OpLifetimeStart: *hasResult = false; *hasResultType = false; break; + case Op::OpLifetimeStop: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupAsyncCopy: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupWaitEvents: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupAll: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupAny: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupBroadcast: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupIAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupUMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupSMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupUMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupSMax: *hasResult = true; *hasResultType = true; break; + case Op::OpReadPipe: *hasResult = true; *hasResultType = true; break; + case Op::OpWritePipe: *hasResult = true; *hasResultType = true; break; + case Op::OpReservedReadPipe: *hasResult = true; *hasResultType = true; break; + case Op::OpReservedWritePipe: *hasResult = true; *hasResultType = true; break; + case Op::OpReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpCommitReadPipe: *hasResult = false; *hasResultType = false; break; + case Op::OpCommitWritePipe: *hasResult = false; *hasResultType = false; break; + case Op::OpIsValidReserveId: *hasResult = true; *hasResultType = true; break; + case Op::OpGetNumPipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpGetMaxPipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupCommitReadPipe: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupCommitWritePipe: *hasResult = false; *hasResultType = false; break; + case Op::OpEnqueueMarker: *hasResult = true; *hasResultType = true; break; + case Op::OpEnqueueKernel: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelNDrangeSubGroupCount: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelNDrangeMaxSubGroupSize: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelWorkGroupSize: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelPreferredWorkGroupSizeMultiple: *hasResult = true; *hasResultType = true; break; + case Op::OpRetainEvent: *hasResult = false; *hasResultType = false; break; + case Op::OpReleaseEvent: *hasResult = false; *hasResultType = false; break; + case Op::OpCreateUserEvent: *hasResult = true; *hasResultType = true; break; + case Op::OpIsValidEvent: *hasResult = true; *hasResultType = true; break; + case Op::OpSetUserEventStatus: *hasResult = false; *hasResultType = false; break; + case Op::OpCaptureEventProfilingInfo: *hasResult = false; *hasResultType = false; break; + case Op::OpGetDefaultQueue: *hasResult = true; *hasResultType = true; break; + case Op::OpBuildNDRange: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseFetch: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseGather: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseDrefGather: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseTexelsResident: *hasResult = true; *hasResultType = true; break; + case Op::OpNoLine: *hasResult = false; *hasResultType = false; break; + case Op::OpAtomicFlagTestAndSet: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicFlagClear: *hasResult = false; *hasResultType = false; break; + case Op::OpImageSparseRead: *hasResult = true; *hasResultType = true; break; + case Op::OpSizeOf: *hasResult = true; *hasResultType = true; break; + case Op::OpTypePipeStorage: *hasResult = true; *hasResultType = false; break; + case Op::OpConstantPipeStorage: *hasResult = true; *hasResultType = true; break; + case Op::OpCreatePipeFromPipeStorage: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelLocalSizeForSubgroupCount: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelMaxNumSubgroups: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeNamedBarrier: *hasResult = true; *hasResultType = false; break; + case Op::OpNamedBarrierInitialize: *hasResult = true; *hasResultType = true; break; + case Op::OpMemoryNamedBarrier: *hasResult = false; *hasResultType = false; break; + case Op::OpModuleProcessed: *hasResult = false; *hasResultType = false; break; + case Op::OpExecutionModeId: *hasResult = false; *hasResultType = false; break; + case Op::OpDecorateId: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupNonUniformElect: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformAll: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformAny: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformAllEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBroadcast: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBroadcastFirst: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallot: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformInverseBallot: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallotBitExtract: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallotBitCount: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallotFindLSB: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallotFindMSB: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformShuffle: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformShuffleXor: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformShuffleUp: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformShuffleDown: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformIAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformFAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformIMul: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformFMul: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformSMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformUMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformFMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformSMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformUMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformFMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBitwiseAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBitwiseOr: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBitwiseXor: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformLogicalAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformLogicalOr: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformLogicalXor: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformQuadBroadcast: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformQuadSwap: *hasResult = true; *hasResultType = true; break; + case Op::OpCopyLogical: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrNotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrDiff: *hasResult = true; *hasResultType = true; break; + case Op::OpColorAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpDepthAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpStencilAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeTensorARM: *hasResult = true; *hasResultType = false; break; + case Op::OpTensorReadARM: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorWriteARM: *hasResult = false; *hasResultType = false; break; + case Op::OpTensorQuerySizeARM: *hasResult = true; *hasResultType = true; break; + case Op::OpTerminateInvocation: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeUntypedPointerKHR: *hasResult = true; *hasResultType = false; break; + case Op::OpUntypedVariableKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedInBoundsAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedPtrAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedInBoundsPtrAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedArrayLengthKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedPrefetchKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpExtInstWithForwardRefsKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpTraceRayKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpTerminateRayKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpSDot: *hasResult = true; *hasResultType = true; break; + case Op::OpUDot: *hasResult = true; *hasResultType = true; break; + case Op::OpSUDot: *hasResult = true; *hasResultType = true; break; + case Op::OpSDotAccSat: *hasResult = true; *hasResultType = true; break; + case Op::OpUDotAccSat: *hasResult = true; *hasResultType = true; break; + case Op::OpSUDotAccSat: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeCooperativeMatrixKHR: *hasResult = true; *hasResultType = false; break; + case Op::OpCooperativeMatrixLoadKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeConstructReplicateEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break; + case Op::OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryGenerateIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryConfirmIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryProceedKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionTypeKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleWeightedQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBoxFilterQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchSSDQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchSADQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpBitCastArrayQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchWindowSSDQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchWindowSADQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchGatherSSDQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchGatherSADQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeConstructCoopMatQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeExtractCoopMatQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpExtractSubArrayQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupUMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupSMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupUMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupSMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpReadClockKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpAllocateNodePayloadsAMDX: *hasResult = true; *hasResultType = true; break; + case Op::OpEnqueueNodePayloadsAMDX: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeNodePayloadArrayAMDX: *hasResult = true; *hasResultType = false; break; + case Op::OpFinishWritingNodePayloadAMDX: *hasResult = true; *hasResultType = true; break; + case Op::OpNodePayloadArrayLengthAMDX: *hasResult = true; *hasResultType = true; break; + case Op::OpIsNodePayloadValidAMDX: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantStringAMDX: *hasResult = true; *hasResultType = false; break; + case Op::OpSpecConstantStringAMDX: *hasResult = true; *hasResultType = false; break; + case Op::OpGroupNonUniformQuadAllKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformQuadAnyKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectRecordHitMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordHitWithIndexMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordMissMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetWorldToObjectNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectToWorldNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectRayDirectionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectRayOriginNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetShaderRecordBufferHandleNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetShaderBindingTableRecordIndexNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectRecordEmptyNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceRayNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordHitNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordHitWithIndexNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordMissNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectExecuteShaderNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetCurrentTimeNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetAttributesNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetHitKindNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetPrimitiveIndexNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetGeometryIndexNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetInstanceIdNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetInstanceCustomIndexNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldRayDirectionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldRayOriginNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayTMaxNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayTMinNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsEmptyNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsHitNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsMissNV: *hasResult = true; *hasResultType = true; break; + case Op::OpReorderThreadWithHitObjectNV: *hasResult = false; *hasResultType = false; break; + case Op::OpReorderThreadWithHintNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeHitObjectNV: *hasResult = true; *hasResultType = false; break; + case Op::OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeCooperativeVectorNV: *hasResult = true; *hasResultType = false; break; + case Op::OpCooperativeVectorMatrixMulNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeVectorOuterProductAccumulateNV: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeVectorReduceSumAccumulateNV: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeVectorMatrixMulAddNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixConvertNV: *hasResult = true; *hasResultType = true; break; + case Op::OpEmitMeshTasksEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpSetMeshOutputsEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break; + case Op::OpFetchMicroTriangleVertexPositionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpFetchMicroTriangleVertexBarycentricNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeVectorLoadNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeVectorStoreNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordFromQueryEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordMissEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordMissMotionEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayFlagsEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectSetShaderBindingTableRecordIndexEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectReorderExecuteShaderEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceReorderExecuteEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceMotionReorderExecuteEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeHitObjectEXT: *hasResult = true; *hasResultType = false; break; + case Op::OpReorderThreadWithHintEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpReorderThreadWithHitObjectEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceRayEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceRayMotionEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordEmptyEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectExecuteShaderEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetCurrentTimeEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetAttributesEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetHitKindEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetPrimitiveIndexEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetGeometryIndexEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetInstanceIdEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetInstanceCustomIndexEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectRayOriginEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectRayDirectionEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldRayDirectionEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldRayOriginEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectToWorldEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldToObjectEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayTMaxEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpReportIntersectionKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTerminateRayNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTraceNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTraceMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryGetIntersectionTriangleVertexPositionsKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeAccelerationStructureKHR: *hasResult = true; *hasResultType = false; break; + case Op::OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryGetClusterIdNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetClusterIdNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayTMinEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetShaderBindingTableRecordIndexEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetShaderRecordBufferHandleEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsEmptyEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsHitEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsMissEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break; + case Op::OpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeMatrixMulAddNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break; + case Op::OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeMatrixReduceNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixLoadTensorNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixStoreTensorNV: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeMatrixPerElementOpNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeTensorLayoutNV: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeTensorViewNV: *hasResult = true; *hasResultType = false; break; + case Op::OpCreateTensorLayoutNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorLayoutSetDimensionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorLayoutSetStrideNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorLayoutSliceNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorLayoutSetClampValueNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCreateTensorViewNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorViewSetDimensionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorViewSetStrideNV: *hasResult = true; *hasResultType = true; break; + case Op::OpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break; + case Op::OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorViewSetClipNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorLayoutSetBlockSizeNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixTransposeNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToImageNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertImageToUNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertSamplerToUNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToSampledImageNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break; + case Op::OpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break; + case Op::OpRawAccessChainNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionSpherePositionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionSphereRadiusNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionLSSPositionsNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionLSSRadiiNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionLSSHitValueNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetSpherePositionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetSphereRadiusNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetLSSPositionsNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetLSSRadiiNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsSphereHitNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsLSSHitNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryIsSphereHitNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryIsLSSHitNV: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupShuffleXorINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroupImageBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupImageBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroupImageMediaBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupImageMediaBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpUCountLeadingZerosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUCountTrailingZerosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAbsISubINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAbsUSubINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpIAddSatINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUAddSatINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpIAverageINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUAverageINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpIAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpISubSatINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUSubSatINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAsmTargetINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpAsmINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAsmCallINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicFMinEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicFMaxEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpAssumeTrueKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpExpectKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpDecorateString: *hasResult = false; *hasResultType = false; break; + case Op::OpMemberDecorateString: *hasResult = false; *hasResultType = false; break; + case Op::OpVmeImageINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeVmeImageINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImePayloadINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcRefPayloadINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcSicPayloadINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcMcePayloadINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcMceResultINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeResultINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeResultSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeResultDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcRefResultINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcSicResultINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetAcOnlyHaarINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToImePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToImeResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToRefPayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToRefResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToSicPayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToSicResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetBestInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterMajorShapeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterMinorShapeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterDirectionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeRefWindowSizeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeAdjustRefOffsetINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetMaxMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetWeightedSadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeStripDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetBorderReachedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcFmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcBmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefSetBidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConfigureSkcINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConfigureIpeLumaINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConfigureIpeLumaChromaINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetMotionVectorMaskINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateIpeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetIpeLumaShapeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetPackedIpeLumaModesINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetIpeChromaModeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetInterRawSadsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpVariableLengthArrayINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSaveMemoryINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpRestoreMemoryINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpArbitraryFloatSinCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCastINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCastFromIntINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCastToIntINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatAddINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSubINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatMulINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatDivINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatGTINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatGEINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLTINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLEINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatEQINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatRecipINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatRSqrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCbrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatHypotINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSqrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLogINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLog2INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLog10INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLog1pINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatExpINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatExp2INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatExp10INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatExpm1INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSinINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSinCosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSinPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatASinINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatASinPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatACosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatACosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatATanINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatATanPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatATan2INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatPowINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpLoopControlINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpAliasDomainDeclINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpAliasScopeDeclINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpAliasScopeListDeclINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedSinINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedCosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedSinCosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedSinPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedSinCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedLogINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedExpINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrCastToCrossWorkgroupINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpCrossWorkgroupCastToPtrINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpReadPipeBlockingINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpWritePipeBlockingINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFPGARegINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetRayTMinKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetRayFlagsKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionTKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionInstanceCustomIndexKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionInstanceIdKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionGeometryIndexKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionPrimitiveIndexKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionBarycentricsKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionFrontFaceKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionObjectRayDirectionKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionObjectRayOriginKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetWorldRayDirectionKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetWorldRayOriginKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionObjectToWorldKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionWorldToObjectKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicFAddEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeBufferSurfaceINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpCompositeConstructContinuedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertFToBF16INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertBF16ToFINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpArithmeticFenceEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupBlockPrefetchINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroup2DBlockLoadINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroup2DBlockLoadTransformINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroup2DBlockLoadTransposeINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroup2DBlockPrefetchINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroup2DBlockStoreINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroupMatrixMultiplyAccumulateINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupIMulKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMulKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpMaskedGatherINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpMaskedScatterINTEL: *hasResult = false; *hasResultType = false; break; + } +} +inline const char* SourceLanguageToString(SourceLanguage value) { + switch (value) { + case SourceLanguage::Unknown: return "Unknown"; + case SourceLanguage::ESSL: return "ESSL"; + case SourceLanguage::GLSL: return "GLSL"; + case SourceLanguage::OpenCL_C: return "OpenCL_C"; + case SourceLanguage::OpenCL_CPP: return "OpenCL_CPP"; + case SourceLanguage::HLSL: return "HLSL"; + case SourceLanguage::CPP_for_OpenCL: return "CPP_for_OpenCL"; + case SourceLanguage::SYCL: return "SYCL"; + case SourceLanguage::HERO_C: return "HERO_C"; + case SourceLanguage::NZSL: return "NZSL"; + case SourceLanguage::WGSL: return "WGSL"; + case SourceLanguage::Slang: return "Slang"; + case SourceLanguage::Zig: return "Zig"; + case SourceLanguage::Rust: return "Rust"; + default: return "Unknown"; + } +} + +inline const char* ExecutionModelToString(ExecutionModel value) { + switch (value) { + case ExecutionModel::Vertex: return "Vertex"; + case ExecutionModel::TessellationControl: return "TessellationControl"; + case ExecutionModel::TessellationEvaluation: return "TessellationEvaluation"; + case ExecutionModel::Geometry: return "Geometry"; + case ExecutionModel::Fragment: return "Fragment"; + case ExecutionModel::GLCompute: return "GLCompute"; + case ExecutionModel::Kernel: return "Kernel"; + case ExecutionModel::TaskNV: return "TaskNV"; + case ExecutionModel::MeshNV: return "MeshNV"; + case ExecutionModel::RayGenerationKHR: return "RayGenerationKHR"; + case ExecutionModel::IntersectionKHR: return "IntersectionKHR"; + case ExecutionModel::AnyHitKHR: return "AnyHitKHR"; + case ExecutionModel::ClosestHitKHR: return "ClosestHitKHR"; + case ExecutionModel::MissKHR: return "MissKHR"; + case ExecutionModel::CallableKHR: return "CallableKHR"; + case ExecutionModel::TaskEXT: return "TaskEXT"; + case ExecutionModel::MeshEXT: return "MeshEXT"; + default: return "Unknown"; + } +} + +inline const char* AddressingModelToString(AddressingModel value) { + switch (value) { + case AddressingModel::Logical: return "Logical"; + case AddressingModel::Physical32: return "Physical32"; + case AddressingModel::Physical64: return "Physical64"; + case AddressingModel::PhysicalStorageBuffer64: return "PhysicalStorageBuffer64"; + default: return "Unknown"; + } +} + +inline const char* MemoryModelToString(MemoryModel value) { + switch (value) { + case MemoryModel::Simple: return "Simple"; + case MemoryModel::GLSL450: return "GLSL450"; + case MemoryModel::OpenCL: return "OpenCL"; + case MemoryModel::Vulkan: return "Vulkan"; + default: return "Unknown"; + } +} + +inline const char* ExecutionModeToString(ExecutionMode value) { + switch (value) { + case ExecutionMode::Invocations: return "Invocations"; + case ExecutionMode::SpacingEqual: return "SpacingEqual"; + case ExecutionMode::SpacingFractionalEven: return "SpacingFractionalEven"; + case ExecutionMode::SpacingFractionalOdd: return "SpacingFractionalOdd"; + case ExecutionMode::VertexOrderCw: return "VertexOrderCw"; + case ExecutionMode::VertexOrderCcw: return "VertexOrderCcw"; + case ExecutionMode::PixelCenterInteger: return "PixelCenterInteger"; + case ExecutionMode::OriginUpperLeft: return "OriginUpperLeft"; + case ExecutionMode::OriginLowerLeft: return "OriginLowerLeft"; + case ExecutionMode::EarlyFragmentTests: return "EarlyFragmentTests"; + case ExecutionMode::PointMode: return "PointMode"; + case ExecutionMode::Xfb: return "Xfb"; + case ExecutionMode::DepthReplacing: return "DepthReplacing"; + case ExecutionMode::DepthGreater: return "DepthGreater"; + case ExecutionMode::DepthLess: return "DepthLess"; + case ExecutionMode::DepthUnchanged: return "DepthUnchanged"; + case ExecutionMode::LocalSize: return "LocalSize"; + case ExecutionMode::LocalSizeHint: return "LocalSizeHint"; + case ExecutionMode::InputPoints: return "InputPoints"; + case ExecutionMode::InputLines: return "InputLines"; + case ExecutionMode::InputLinesAdjacency: return "InputLinesAdjacency"; + case ExecutionMode::Triangles: return "Triangles"; + case ExecutionMode::InputTrianglesAdjacency: return "InputTrianglesAdjacency"; + case ExecutionMode::Quads: return "Quads"; + case ExecutionMode::Isolines: return "Isolines"; + case ExecutionMode::OutputVertices: return "OutputVertices"; + case ExecutionMode::OutputPoints: return "OutputPoints"; + case ExecutionMode::OutputLineStrip: return "OutputLineStrip"; + case ExecutionMode::OutputTriangleStrip: return "OutputTriangleStrip"; + case ExecutionMode::VecTypeHint: return "VecTypeHint"; + case ExecutionMode::ContractionOff: return "ContractionOff"; + case ExecutionMode::Initializer: return "Initializer"; + case ExecutionMode::Finalizer: return "Finalizer"; + case ExecutionMode::SubgroupSize: return "SubgroupSize"; + case ExecutionMode::SubgroupsPerWorkgroup: return "SubgroupsPerWorkgroup"; + case ExecutionMode::SubgroupsPerWorkgroupId: return "SubgroupsPerWorkgroupId"; + case ExecutionMode::LocalSizeId: return "LocalSizeId"; + case ExecutionMode::LocalSizeHintId: return "LocalSizeHintId"; + case ExecutionMode::NonCoherentColorAttachmentReadEXT: return "NonCoherentColorAttachmentReadEXT"; + case ExecutionMode::NonCoherentDepthAttachmentReadEXT: return "NonCoherentDepthAttachmentReadEXT"; + case ExecutionMode::NonCoherentStencilAttachmentReadEXT: return "NonCoherentStencilAttachmentReadEXT"; + case ExecutionMode::SubgroupUniformControlFlowKHR: return "SubgroupUniformControlFlowKHR"; + case ExecutionMode::PostDepthCoverage: return "PostDepthCoverage"; + case ExecutionMode::DenormPreserve: return "DenormPreserve"; + case ExecutionMode::DenormFlushToZero: return "DenormFlushToZero"; + case ExecutionMode::SignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve"; + case ExecutionMode::RoundingModeRTE: return "RoundingModeRTE"; + case ExecutionMode::RoundingModeRTZ: return "RoundingModeRTZ"; + case ExecutionMode::NonCoherentTileAttachmentReadQCOM: return "NonCoherentTileAttachmentReadQCOM"; + case ExecutionMode::TileShadingRateQCOM: return "TileShadingRateQCOM"; + case ExecutionMode::EarlyAndLateFragmentTestsAMD: return "EarlyAndLateFragmentTestsAMD"; + case ExecutionMode::StencilRefReplacingEXT: return "StencilRefReplacingEXT"; + case ExecutionMode::CoalescingAMDX: return "CoalescingAMDX"; + case ExecutionMode::IsApiEntryAMDX: return "IsApiEntryAMDX"; + case ExecutionMode::MaxNodeRecursionAMDX: return "MaxNodeRecursionAMDX"; + case ExecutionMode::StaticNumWorkgroupsAMDX: return "StaticNumWorkgroupsAMDX"; + case ExecutionMode::ShaderIndexAMDX: return "ShaderIndexAMDX"; + case ExecutionMode::MaxNumWorkgroupsAMDX: return "MaxNumWorkgroupsAMDX"; + case ExecutionMode::StencilRefUnchangedFrontAMD: return "StencilRefUnchangedFrontAMD"; + case ExecutionMode::StencilRefGreaterFrontAMD: return "StencilRefGreaterFrontAMD"; + case ExecutionMode::StencilRefLessFrontAMD: return "StencilRefLessFrontAMD"; + case ExecutionMode::StencilRefUnchangedBackAMD: return "StencilRefUnchangedBackAMD"; + case ExecutionMode::StencilRefGreaterBackAMD: return "StencilRefGreaterBackAMD"; + case ExecutionMode::StencilRefLessBackAMD: return "StencilRefLessBackAMD"; + case ExecutionMode::QuadDerivativesKHR: return "QuadDerivativesKHR"; + case ExecutionMode::RequireFullQuadsKHR: return "RequireFullQuadsKHR"; + case ExecutionMode::SharesInputWithAMDX: return "SharesInputWithAMDX"; + case ExecutionMode::OutputLinesEXT: return "OutputLinesEXT"; + case ExecutionMode::OutputPrimitivesEXT: return "OutputPrimitivesEXT"; + case ExecutionMode::DerivativeGroupQuadsKHR: return "DerivativeGroupQuadsKHR"; + case ExecutionMode::DerivativeGroupLinearKHR: return "DerivativeGroupLinearKHR"; + case ExecutionMode::OutputTrianglesEXT: return "OutputTrianglesEXT"; + case ExecutionMode::PixelInterlockOrderedEXT: return "PixelInterlockOrderedEXT"; + case ExecutionMode::PixelInterlockUnorderedEXT: return "PixelInterlockUnorderedEXT"; + case ExecutionMode::SampleInterlockOrderedEXT: return "SampleInterlockOrderedEXT"; + case ExecutionMode::SampleInterlockUnorderedEXT: return "SampleInterlockUnorderedEXT"; + case ExecutionMode::ShadingRateInterlockOrderedEXT: return "ShadingRateInterlockOrderedEXT"; + case ExecutionMode::ShadingRateInterlockUnorderedEXT: return "ShadingRateInterlockUnorderedEXT"; + case ExecutionMode::Shader64BitIndexingEXT: return "Shader64BitIndexingEXT"; + case ExecutionMode::SharedLocalMemorySizeINTEL: return "SharedLocalMemorySizeINTEL"; + case ExecutionMode::RoundingModeRTPINTEL: return "RoundingModeRTPINTEL"; + case ExecutionMode::RoundingModeRTNINTEL: return "RoundingModeRTNINTEL"; + case ExecutionMode::FloatingPointModeALTINTEL: return "FloatingPointModeALTINTEL"; + case ExecutionMode::FloatingPointModeIEEEINTEL: return "FloatingPointModeIEEEINTEL"; + case ExecutionMode::MaxWorkgroupSizeINTEL: return "MaxWorkgroupSizeINTEL"; + case ExecutionMode::MaxWorkDimINTEL: return "MaxWorkDimINTEL"; + case ExecutionMode::NoGlobalOffsetINTEL: return "NoGlobalOffsetINTEL"; + case ExecutionMode::NumSIMDWorkitemsINTEL: return "NumSIMDWorkitemsINTEL"; + case ExecutionMode::SchedulerTargetFmaxMhzINTEL: return "SchedulerTargetFmaxMhzINTEL"; + case ExecutionMode::MaximallyReconvergesKHR: return "MaximallyReconvergesKHR"; + case ExecutionMode::FPFastMathDefault: return "FPFastMathDefault"; + case ExecutionMode::StreamingInterfaceINTEL: return "StreamingInterfaceINTEL"; + case ExecutionMode::RegisterMapInterfaceINTEL: return "RegisterMapInterfaceINTEL"; + case ExecutionMode::NamedBarrierCountINTEL: return "NamedBarrierCountINTEL"; + case ExecutionMode::MaximumRegistersINTEL: return "MaximumRegistersINTEL"; + case ExecutionMode::MaximumRegistersIdINTEL: return "MaximumRegistersIdINTEL"; + case ExecutionMode::NamedMaximumRegistersINTEL: return "NamedMaximumRegistersINTEL"; + default: return "Unknown"; + } +} + +inline const char* StorageClassToString(StorageClass value) { + switch (value) { + case StorageClass::UniformConstant: return "UniformConstant"; + case StorageClass::Input: return "Input"; + case StorageClass::Uniform: return "Uniform"; + case StorageClass::Output: return "Output"; + case StorageClass::Workgroup: return "Workgroup"; + case StorageClass::CrossWorkgroup: return "CrossWorkgroup"; + case StorageClass::Private: return "Private"; + case StorageClass::Function: return "Function"; + case StorageClass::Generic: return "Generic"; + case StorageClass::PushConstant: return "PushConstant"; + case StorageClass::AtomicCounter: return "AtomicCounter"; + case StorageClass::Image: return "Image"; + case StorageClass::StorageBuffer: return "StorageBuffer"; + case StorageClass::TileImageEXT: return "TileImageEXT"; + case StorageClass::TileAttachmentQCOM: return "TileAttachmentQCOM"; + case StorageClass::NodePayloadAMDX: return "NodePayloadAMDX"; + case StorageClass::CallableDataKHR: return "CallableDataKHR"; + case StorageClass::IncomingCallableDataKHR: return "IncomingCallableDataKHR"; + case StorageClass::RayPayloadKHR: return "RayPayloadKHR"; + case StorageClass::HitAttributeKHR: return "HitAttributeKHR"; + case StorageClass::IncomingRayPayloadKHR: return "IncomingRayPayloadKHR"; + case StorageClass::ShaderRecordBufferKHR: return "ShaderRecordBufferKHR"; + case StorageClass::PhysicalStorageBuffer: return "PhysicalStorageBuffer"; + case StorageClass::HitObjectAttributeNV: return "HitObjectAttributeNV"; + case StorageClass::TaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT"; + case StorageClass::HitObjectAttributeEXT: return "HitObjectAttributeEXT"; + case StorageClass::CodeSectionINTEL: return "CodeSectionINTEL"; + case StorageClass::DeviceOnlyINTEL: return "DeviceOnlyINTEL"; + case StorageClass::HostOnlyINTEL: return "HostOnlyINTEL"; + default: return "Unknown"; + } +} + +inline const char* DimToString(Dim value) { + switch (value) { + case Dim::Dim1D: return "1D"; + case Dim::Dim2D: return "2D"; + case Dim::Dim3D: return "3D"; + case Dim::Cube: return "Cube"; + case Dim::Rect: return "Rect"; + case Dim::Buffer: return "Buffer"; + case Dim::SubpassData: return "SubpassData"; + case Dim::TileImageDataEXT: return "TileImageDataEXT"; + default: return "Unknown"; + } +} + +inline const char* SamplerAddressingModeToString(SamplerAddressingMode value) { + switch (value) { + case SamplerAddressingMode::None: return "None"; + case SamplerAddressingMode::ClampToEdge: return "ClampToEdge"; + case SamplerAddressingMode::Clamp: return "Clamp"; + case SamplerAddressingMode::Repeat: return "Repeat"; + case SamplerAddressingMode::RepeatMirrored: return "RepeatMirrored"; + default: return "Unknown"; + } +} + +inline const char* SamplerFilterModeToString(SamplerFilterMode value) { + switch (value) { + case SamplerFilterMode::Nearest: return "Nearest"; + case SamplerFilterMode::Linear: return "Linear"; + default: return "Unknown"; + } +} + +inline const char* ImageFormatToString(ImageFormat value) { + switch (value) { + case ImageFormat::Unknown: return "Unknown"; + case ImageFormat::Rgba32f: return "Rgba32f"; + case ImageFormat::Rgba16f: return "Rgba16f"; + case ImageFormat::R32f: return "R32f"; + case ImageFormat::Rgba8: return "Rgba8"; + case ImageFormat::Rgba8Snorm: return "Rgba8Snorm"; + case ImageFormat::Rg32f: return "Rg32f"; + case ImageFormat::Rg16f: return "Rg16f"; + case ImageFormat::R11fG11fB10f: return "R11fG11fB10f"; + case ImageFormat::R16f: return "R16f"; + case ImageFormat::Rgba16: return "Rgba16"; + case ImageFormat::Rgb10A2: return "Rgb10A2"; + case ImageFormat::Rg16: return "Rg16"; + case ImageFormat::Rg8: return "Rg8"; + case ImageFormat::R16: return "R16"; + case ImageFormat::R8: return "R8"; + case ImageFormat::Rgba16Snorm: return "Rgba16Snorm"; + case ImageFormat::Rg16Snorm: return "Rg16Snorm"; + case ImageFormat::Rg8Snorm: return "Rg8Snorm"; + case ImageFormat::R16Snorm: return "R16Snorm"; + case ImageFormat::R8Snorm: return "R8Snorm"; + case ImageFormat::Rgba32i: return "Rgba32i"; + case ImageFormat::Rgba16i: return "Rgba16i"; + case ImageFormat::Rgba8i: return "Rgba8i"; + case ImageFormat::R32i: return "R32i"; + case ImageFormat::Rg32i: return "Rg32i"; + case ImageFormat::Rg16i: return "Rg16i"; + case ImageFormat::Rg8i: return "Rg8i"; + case ImageFormat::R16i: return "R16i"; + case ImageFormat::R8i: return "R8i"; + case ImageFormat::Rgba32ui: return "Rgba32ui"; + case ImageFormat::Rgba16ui: return "Rgba16ui"; + case ImageFormat::Rgba8ui: return "Rgba8ui"; + case ImageFormat::R32ui: return "R32ui"; + case ImageFormat::Rgb10a2ui: return "Rgb10a2ui"; + case ImageFormat::Rg32ui: return "Rg32ui"; + case ImageFormat::Rg16ui: return "Rg16ui"; + case ImageFormat::Rg8ui: return "Rg8ui"; + case ImageFormat::R16ui: return "R16ui"; + case ImageFormat::R8ui: return "R8ui"; + case ImageFormat::R64ui: return "R64ui"; + case ImageFormat::R64i: return "R64i"; + default: return "Unknown"; + } +} + +inline const char* ImageChannelOrderToString(ImageChannelOrder value) { + switch (value) { + case ImageChannelOrder::R: return "R"; + case ImageChannelOrder::A: return "A"; + case ImageChannelOrder::RG: return "RG"; + case ImageChannelOrder::RA: return "RA"; + case ImageChannelOrder::RGB: return "RGB"; + case ImageChannelOrder::RGBA: return "RGBA"; + case ImageChannelOrder::BGRA: return "BGRA"; + case ImageChannelOrder::ARGB: return "ARGB"; + case ImageChannelOrder::Intensity: return "Intensity"; + case ImageChannelOrder::Luminance: return "Luminance"; + case ImageChannelOrder::Rx: return "Rx"; + case ImageChannelOrder::RGx: return "RGx"; + case ImageChannelOrder::RGBx: return "RGBx"; + case ImageChannelOrder::Depth: return "Depth"; + case ImageChannelOrder::DepthStencil: return "DepthStencil"; + case ImageChannelOrder::sRGB: return "sRGB"; + case ImageChannelOrder::sRGBx: return "sRGBx"; + case ImageChannelOrder::sRGBA: return "sRGBA"; + case ImageChannelOrder::sBGRA: return "sBGRA"; + case ImageChannelOrder::ABGR: return "ABGR"; + default: return "Unknown"; + } +} + +inline const char* ImageChannelDataTypeToString(ImageChannelDataType value) { + switch (value) { + case ImageChannelDataType::SnormInt8: return "SnormInt8"; + case ImageChannelDataType::SnormInt16: return "SnormInt16"; + case ImageChannelDataType::UnormInt8: return "UnormInt8"; + case ImageChannelDataType::UnormInt16: return "UnormInt16"; + case ImageChannelDataType::UnormShort565: return "UnormShort565"; + case ImageChannelDataType::UnormShort555: return "UnormShort555"; + case ImageChannelDataType::UnormInt101010: return "UnormInt101010"; + case ImageChannelDataType::SignedInt8: return "SignedInt8"; + case ImageChannelDataType::SignedInt16: return "SignedInt16"; + case ImageChannelDataType::SignedInt32: return "SignedInt32"; + case ImageChannelDataType::UnsignedInt8: return "UnsignedInt8"; + case ImageChannelDataType::UnsignedInt16: return "UnsignedInt16"; + case ImageChannelDataType::UnsignedInt32: return "UnsignedInt32"; + case ImageChannelDataType::HalfFloat: return "HalfFloat"; + case ImageChannelDataType::Float: return "Float"; + case ImageChannelDataType::UnormInt24: return "UnormInt24"; + case ImageChannelDataType::UnormInt101010_2: return "UnormInt101010_2"; + case ImageChannelDataType::UnsignedIntRaw10EXT: return "UnsignedIntRaw10EXT"; + case ImageChannelDataType::UnsignedIntRaw12EXT: return "UnsignedIntRaw12EXT"; + case ImageChannelDataType::UnormInt2_101010EXT: return "UnormInt2_101010EXT"; + default: return "Unknown"; + } +} + +inline const char* FPRoundingModeToString(FPRoundingMode value) { + switch (value) { + case FPRoundingMode::RTE: return "RTE"; + case FPRoundingMode::RTZ: return "RTZ"; + case FPRoundingMode::RTP: return "RTP"; + case FPRoundingMode::RTN: return "RTN"; + default: return "Unknown"; + } +} + +inline const char* LinkageTypeToString(LinkageType value) { + switch (value) { + case LinkageType::Export: return "Export"; + case LinkageType::Import: return "Import"; + case LinkageType::LinkOnceODR: return "LinkOnceODR"; + default: return "Unknown"; + } +} + +inline const char* AccessQualifierToString(AccessQualifier value) { + switch (value) { + case AccessQualifier::ReadOnly: return "ReadOnly"; + case AccessQualifier::WriteOnly: return "WriteOnly"; + case AccessQualifier::ReadWrite: return "ReadWrite"; + default: return "Unknown"; + } +} + +inline const char* FunctionParameterAttributeToString(FunctionParameterAttribute value) { + switch (value) { + case FunctionParameterAttribute::Zext: return "Zext"; + case FunctionParameterAttribute::Sext: return "Sext"; + case FunctionParameterAttribute::ByVal: return "ByVal"; + case FunctionParameterAttribute::Sret: return "Sret"; + case FunctionParameterAttribute::NoAlias: return "NoAlias"; + case FunctionParameterAttribute::NoCapture: return "NoCapture"; + case FunctionParameterAttribute::NoWrite: return "NoWrite"; + case FunctionParameterAttribute::NoReadWrite: return "NoReadWrite"; + case FunctionParameterAttribute::RuntimeAlignedINTEL: return "RuntimeAlignedINTEL"; + default: return "Unknown"; + } +} + +inline const char* DecorationToString(Decoration value) { + switch (value) { + case Decoration::RelaxedPrecision: return "RelaxedPrecision"; + case Decoration::SpecId: return "SpecId"; + case Decoration::Block: return "Block"; + case Decoration::BufferBlock: return "BufferBlock"; + case Decoration::RowMajor: return "RowMajor"; + case Decoration::ColMajor: return "ColMajor"; + case Decoration::ArrayStride: return "ArrayStride"; + case Decoration::MatrixStride: return "MatrixStride"; + case Decoration::GLSLShared: return "GLSLShared"; + case Decoration::GLSLPacked: return "GLSLPacked"; + case Decoration::CPacked: return "CPacked"; + case Decoration::BuiltIn: return "BuiltIn"; + case Decoration::NoPerspective: return "NoPerspective"; + case Decoration::Flat: return "Flat"; + case Decoration::Patch: return "Patch"; + case Decoration::Centroid: return "Centroid"; + case Decoration::Sample: return "Sample"; + case Decoration::Invariant: return "Invariant"; + case Decoration::Restrict: return "Restrict"; + case Decoration::Aliased: return "Aliased"; + case Decoration::Volatile: return "Volatile"; + case Decoration::Constant: return "Constant"; + case Decoration::Coherent: return "Coherent"; + case Decoration::NonWritable: return "NonWritable"; + case Decoration::NonReadable: return "NonReadable"; + case Decoration::Uniform: return "Uniform"; + case Decoration::UniformId: return "UniformId"; + case Decoration::SaturatedConversion: return "SaturatedConversion"; + case Decoration::Stream: return "Stream"; + case Decoration::Location: return "Location"; + case Decoration::Component: return "Component"; + case Decoration::Index: return "Index"; + case Decoration::Binding: return "Binding"; + case Decoration::DescriptorSet: return "DescriptorSet"; + case Decoration::Offset: return "Offset"; + case Decoration::XfbBuffer: return "XfbBuffer"; + case Decoration::XfbStride: return "XfbStride"; + case Decoration::FuncParamAttr: return "FuncParamAttr"; + case Decoration::FPRoundingMode: return "FPRoundingMode"; + case Decoration::FPFastMathMode: return "FPFastMathMode"; + case Decoration::LinkageAttributes: return "LinkageAttributes"; + case Decoration::NoContraction: return "NoContraction"; + case Decoration::InputAttachmentIndex: return "InputAttachmentIndex"; + case Decoration::Alignment: return "Alignment"; + case Decoration::MaxByteOffset: return "MaxByteOffset"; + case Decoration::AlignmentId: return "AlignmentId"; + case Decoration::MaxByteOffsetId: return "MaxByteOffsetId"; + case Decoration::SaturatedToLargestFloat8NormalConversionEXT: return "SaturatedToLargestFloat8NormalConversionEXT"; + case Decoration::NoSignedWrap: return "NoSignedWrap"; + case Decoration::NoUnsignedWrap: return "NoUnsignedWrap"; + case Decoration::WeightTextureQCOM: return "WeightTextureQCOM"; + case Decoration::BlockMatchTextureQCOM: return "BlockMatchTextureQCOM"; + case Decoration::BlockMatchSamplerQCOM: return "BlockMatchSamplerQCOM"; + case Decoration::ExplicitInterpAMD: return "ExplicitInterpAMD"; + case Decoration::NodeSharesPayloadLimitsWithAMDX: return "NodeSharesPayloadLimitsWithAMDX"; + case Decoration::NodeMaxPayloadsAMDX: return "NodeMaxPayloadsAMDX"; + case Decoration::TrackFinishWritingAMDX: return "TrackFinishWritingAMDX"; + case Decoration::PayloadNodeNameAMDX: return "PayloadNodeNameAMDX"; + case Decoration::PayloadNodeBaseIndexAMDX: return "PayloadNodeBaseIndexAMDX"; + case Decoration::PayloadNodeSparseArrayAMDX: return "PayloadNodeSparseArrayAMDX"; + case Decoration::PayloadNodeArraySizeAMDX: return "PayloadNodeArraySizeAMDX"; + case Decoration::PayloadDispatchIndirectAMDX: return "PayloadDispatchIndirectAMDX"; + case Decoration::OverrideCoverageNV: return "OverrideCoverageNV"; + case Decoration::PassthroughNV: return "PassthroughNV"; + case Decoration::ViewportRelativeNV: return "ViewportRelativeNV"; + case Decoration::SecondaryViewportRelativeNV: return "SecondaryViewportRelativeNV"; + case Decoration::PerPrimitiveEXT: return "PerPrimitiveEXT"; + case Decoration::PerViewNV: return "PerViewNV"; + case Decoration::PerTaskNV: return "PerTaskNV"; + case Decoration::PerVertexKHR: return "PerVertexKHR"; + case Decoration::NonUniform: return "NonUniform"; + case Decoration::RestrictPointer: return "RestrictPointer"; + case Decoration::AliasedPointer: return "AliasedPointer"; + case Decoration::HitObjectShaderRecordBufferNV: return "HitObjectShaderRecordBufferNV"; + case Decoration::HitObjectShaderRecordBufferEXT: return "HitObjectShaderRecordBufferEXT"; + case Decoration::BindlessSamplerNV: return "BindlessSamplerNV"; + case Decoration::BindlessImageNV: return "BindlessImageNV"; + case Decoration::BoundSamplerNV: return "BoundSamplerNV"; + case Decoration::BoundImageNV: return "BoundImageNV"; + case Decoration::SIMTCallINTEL: return "SIMTCallINTEL"; + case Decoration::ReferencedIndirectlyINTEL: return "ReferencedIndirectlyINTEL"; + case Decoration::ClobberINTEL: return "ClobberINTEL"; + case Decoration::SideEffectsINTEL: return "SideEffectsINTEL"; + case Decoration::VectorComputeVariableINTEL: return "VectorComputeVariableINTEL"; + case Decoration::FuncParamIOKindINTEL: return "FuncParamIOKindINTEL"; + case Decoration::VectorComputeFunctionINTEL: return "VectorComputeFunctionINTEL"; + case Decoration::StackCallINTEL: return "StackCallINTEL"; + case Decoration::GlobalVariableOffsetINTEL: return "GlobalVariableOffsetINTEL"; + case Decoration::CounterBuffer: return "CounterBuffer"; + case Decoration::HlslSemanticGOOGLE: return "HlslSemanticGOOGLE"; + case Decoration::UserTypeGOOGLE: return "UserTypeGOOGLE"; + case Decoration::FunctionRoundingModeINTEL: return "FunctionRoundingModeINTEL"; + case Decoration::FunctionDenormModeINTEL: return "FunctionDenormModeINTEL"; + case Decoration::RegisterINTEL: return "RegisterINTEL"; + case Decoration::MemoryINTEL: return "MemoryINTEL"; + case Decoration::NumbanksINTEL: return "NumbanksINTEL"; + case Decoration::BankwidthINTEL: return "BankwidthINTEL"; + case Decoration::MaxPrivateCopiesINTEL: return "MaxPrivateCopiesINTEL"; + case Decoration::SinglepumpINTEL: return "SinglepumpINTEL"; + case Decoration::DoublepumpINTEL: return "DoublepumpINTEL"; + case Decoration::MaxReplicatesINTEL: return "MaxReplicatesINTEL"; + case Decoration::SimpleDualPortINTEL: return "SimpleDualPortINTEL"; + case Decoration::MergeINTEL: return "MergeINTEL"; + case Decoration::BankBitsINTEL: return "BankBitsINTEL"; + case Decoration::ForcePow2DepthINTEL: return "ForcePow2DepthINTEL"; + case Decoration::StridesizeINTEL: return "StridesizeINTEL"; + case Decoration::WordsizeINTEL: return "WordsizeINTEL"; + case Decoration::TrueDualPortINTEL: return "TrueDualPortINTEL"; + case Decoration::BurstCoalesceINTEL: return "BurstCoalesceINTEL"; + case Decoration::CacheSizeINTEL: return "CacheSizeINTEL"; + case Decoration::DontStaticallyCoalesceINTEL: return "DontStaticallyCoalesceINTEL"; + case Decoration::PrefetchINTEL: return "PrefetchINTEL"; + case Decoration::StallEnableINTEL: return "StallEnableINTEL"; + case Decoration::FuseLoopsInFunctionINTEL: return "FuseLoopsInFunctionINTEL"; + case Decoration::MathOpDSPModeINTEL: return "MathOpDSPModeINTEL"; + case Decoration::AliasScopeINTEL: return "AliasScopeINTEL"; + case Decoration::NoAliasINTEL: return "NoAliasINTEL"; + case Decoration::InitiationIntervalINTEL: return "InitiationIntervalINTEL"; + case Decoration::MaxConcurrencyINTEL: return "MaxConcurrencyINTEL"; + case Decoration::PipelineEnableINTEL: return "PipelineEnableINTEL"; + case Decoration::BufferLocationINTEL: return "BufferLocationINTEL"; + case Decoration::IOPipeStorageINTEL: return "IOPipeStorageINTEL"; + case Decoration::FunctionFloatingPointModeINTEL: return "FunctionFloatingPointModeINTEL"; + case Decoration::SingleElementVectorINTEL: return "SingleElementVectorINTEL"; + case Decoration::VectorComputeCallableFunctionINTEL: return "VectorComputeCallableFunctionINTEL"; + case Decoration::MediaBlockIOINTEL: return "MediaBlockIOINTEL"; + case Decoration::StallFreeINTEL: return "StallFreeINTEL"; + case Decoration::FPMaxErrorDecorationINTEL: return "FPMaxErrorDecorationINTEL"; + case Decoration::LatencyControlLabelINTEL: return "LatencyControlLabelINTEL"; + case Decoration::LatencyControlConstraintINTEL: return "LatencyControlConstraintINTEL"; + case Decoration::ConduitKernelArgumentINTEL: return "ConduitKernelArgumentINTEL"; + case Decoration::RegisterMapKernelArgumentINTEL: return "RegisterMapKernelArgumentINTEL"; + case Decoration::MMHostInterfaceAddressWidthINTEL: return "MMHostInterfaceAddressWidthINTEL"; + case Decoration::MMHostInterfaceDataWidthINTEL: return "MMHostInterfaceDataWidthINTEL"; + case Decoration::MMHostInterfaceLatencyINTEL: return "MMHostInterfaceLatencyINTEL"; + case Decoration::MMHostInterfaceReadWriteModeINTEL: return "MMHostInterfaceReadWriteModeINTEL"; + case Decoration::MMHostInterfaceMaxBurstINTEL: return "MMHostInterfaceMaxBurstINTEL"; + case Decoration::MMHostInterfaceWaitRequestINTEL: return "MMHostInterfaceWaitRequestINTEL"; + case Decoration::StableKernelArgumentINTEL: return "StableKernelArgumentINTEL"; + case Decoration::HostAccessINTEL: return "HostAccessINTEL"; + case Decoration::InitModeINTEL: return "InitModeINTEL"; + case Decoration::ImplementInRegisterMapINTEL: return "ImplementInRegisterMapINTEL"; + case Decoration::CacheControlLoadINTEL: return "CacheControlLoadINTEL"; + case Decoration::CacheControlStoreINTEL: return "CacheControlStoreINTEL"; + default: return "Unknown"; + } +} + +inline const char* BuiltInToString(BuiltIn value) { + switch (value) { + case BuiltIn::Position: return "Position"; + case BuiltIn::PointSize: return "PointSize"; + case BuiltIn::ClipDistance: return "ClipDistance"; + case BuiltIn::CullDistance: return "CullDistance"; + case BuiltIn::VertexId: return "VertexId"; + case BuiltIn::InstanceId: return "InstanceId"; + case BuiltIn::PrimitiveId: return "PrimitiveId"; + case BuiltIn::InvocationId: return "InvocationId"; + case BuiltIn::Layer: return "Layer"; + case BuiltIn::ViewportIndex: return "ViewportIndex"; + case BuiltIn::TessLevelOuter: return "TessLevelOuter"; + case BuiltIn::TessLevelInner: return "TessLevelInner"; + case BuiltIn::TessCoord: return "TessCoord"; + case BuiltIn::PatchVertices: return "PatchVertices"; + case BuiltIn::FragCoord: return "FragCoord"; + case BuiltIn::PointCoord: return "PointCoord"; + case BuiltIn::FrontFacing: return "FrontFacing"; + case BuiltIn::SampleId: return "SampleId"; + case BuiltIn::SamplePosition: return "SamplePosition"; + case BuiltIn::SampleMask: return "SampleMask"; + case BuiltIn::FragDepth: return "FragDepth"; + case BuiltIn::HelperInvocation: return "HelperInvocation"; + case BuiltIn::NumWorkgroups: return "NumWorkgroups"; + case BuiltIn::WorkgroupSize: return "WorkgroupSize"; + case BuiltIn::WorkgroupId: return "WorkgroupId"; + case BuiltIn::LocalInvocationId: return "LocalInvocationId"; + case BuiltIn::GlobalInvocationId: return "GlobalInvocationId"; + case BuiltIn::LocalInvocationIndex: return "LocalInvocationIndex"; + case BuiltIn::WorkDim: return "WorkDim"; + case BuiltIn::GlobalSize: return "GlobalSize"; + case BuiltIn::EnqueuedWorkgroupSize: return "EnqueuedWorkgroupSize"; + case BuiltIn::GlobalOffset: return "GlobalOffset"; + case BuiltIn::GlobalLinearId: return "GlobalLinearId"; + case BuiltIn::SubgroupSize: return "SubgroupSize"; + case BuiltIn::SubgroupMaxSize: return "SubgroupMaxSize"; + case BuiltIn::NumSubgroups: return "NumSubgroups"; + case BuiltIn::NumEnqueuedSubgroups: return "NumEnqueuedSubgroups"; + case BuiltIn::SubgroupId: return "SubgroupId"; + case BuiltIn::SubgroupLocalInvocationId: return "SubgroupLocalInvocationId"; + case BuiltIn::VertexIndex: return "VertexIndex"; + case BuiltIn::InstanceIndex: return "InstanceIndex"; + case BuiltIn::CoreIDARM: return "CoreIDARM"; + case BuiltIn::CoreCountARM: return "CoreCountARM"; + case BuiltIn::CoreMaxIDARM: return "CoreMaxIDARM"; + case BuiltIn::WarpIDARM: return "WarpIDARM"; + case BuiltIn::WarpMaxIDARM: return "WarpMaxIDARM"; + case BuiltIn::SubgroupEqMask: return "SubgroupEqMask"; + case BuiltIn::SubgroupGeMask: return "SubgroupGeMask"; + case BuiltIn::SubgroupGtMask: return "SubgroupGtMask"; + case BuiltIn::SubgroupLeMask: return "SubgroupLeMask"; + case BuiltIn::SubgroupLtMask: return "SubgroupLtMask"; + case BuiltIn::BaseVertex: return "BaseVertex"; + case BuiltIn::BaseInstance: return "BaseInstance"; + case BuiltIn::DrawIndex: return "DrawIndex"; + case BuiltIn::PrimitiveShadingRateKHR: return "PrimitiveShadingRateKHR"; + case BuiltIn::DeviceIndex: return "DeviceIndex"; + case BuiltIn::ViewIndex: return "ViewIndex"; + case BuiltIn::ShadingRateKHR: return "ShadingRateKHR"; + case BuiltIn::TileOffsetQCOM: return "TileOffsetQCOM"; + case BuiltIn::TileDimensionQCOM: return "TileDimensionQCOM"; + case BuiltIn::TileApronSizeQCOM: return "TileApronSizeQCOM"; + case BuiltIn::BaryCoordNoPerspAMD: return "BaryCoordNoPerspAMD"; + case BuiltIn::BaryCoordNoPerspCentroidAMD: return "BaryCoordNoPerspCentroidAMD"; + case BuiltIn::BaryCoordNoPerspSampleAMD: return "BaryCoordNoPerspSampleAMD"; + case BuiltIn::BaryCoordSmoothAMD: return "BaryCoordSmoothAMD"; + case BuiltIn::BaryCoordSmoothCentroidAMD: return "BaryCoordSmoothCentroidAMD"; + case BuiltIn::BaryCoordSmoothSampleAMD: return "BaryCoordSmoothSampleAMD"; + case BuiltIn::BaryCoordPullModelAMD: return "BaryCoordPullModelAMD"; + case BuiltIn::FragStencilRefEXT: return "FragStencilRefEXT"; + case BuiltIn::RemainingRecursionLevelsAMDX: return "RemainingRecursionLevelsAMDX"; + case BuiltIn::ShaderIndexAMDX: return "ShaderIndexAMDX"; + case BuiltIn::ViewportMaskNV: return "ViewportMaskNV"; + case BuiltIn::SecondaryPositionNV: return "SecondaryPositionNV"; + case BuiltIn::SecondaryViewportMaskNV: return "SecondaryViewportMaskNV"; + case BuiltIn::PositionPerViewNV: return "PositionPerViewNV"; + case BuiltIn::ViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; + case BuiltIn::FullyCoveredEXT: return "FullyCoveredEXT"; + case BuiltIn::TaskCountNV: return "TaskCountNV"; + case BuiltIn::PrimitiveCountNV: return "PrimitiveCountNV"; + case BuiltIn::PrimitiveIndicesNV: return "PrimitiveIndicesNV"; + case BuiltIn::ClipDistancePerViewNV: return "ClipDistancePerViewNV"; + case BuiltIn::CullDistancePerViewNV: return "CullDistancePerViewNV"; + case BuiltIn::LayerPerViewNV: return "LayerPerViewNV"; + case BuiltIn::MeshViewCountNV: return "MeshViewCountNV"; + case BuiltIn::MeshViewIndicesNV: return "MeshViewIndicesNV"; + case BuiltIn::BaryCoordKHR: return "BaryCoordKHR"; + case BuiltIn::BaryCoordNoPerspKHR: return "BaryCoordNoPerspKHR"; + case BuiltIn::FragSizeEXT: return "FragSizeEXT"; + case BuiltIn::FragInvocationCountEXT: return "FragInvocationCountEXT"; + case BuiltIn::PrimitivePointIndicesEXT: return "PrimitivePointIndicesEXT"; + case BuiltIn::PrimitiveLineIndicesEXT: return "PrimitiveLineIndicesEXT"; + case BuiltIn::PrimitiveTriangleIndicesEXT: return "PrimitiveTriangleIndicesEXT"; + case BuiltIn::CullPrimitiveEXT: return "CullPrimitiveEXT"; + case BuiltIn::LaunchIdKHR: return "LaunchIdKHR"; + case BuiltIn::LaunchSizeKHR: return "LaunchSizeKHR"; + case BuiltIn::WorldRayOriginKHR: return "WorldRayOriginKHR"; + case BuiltIn::WorldRayDirectionKHR: return "WorldRayDirectionKHR"; + case BuiltIn::ObjectRayOriginKHR: return "ObjectRayOriginKHR"; + case BuiltIn::ObjectRayDirectionKHR: return "ObjectRayDirectionKHR"; + case BuiltIn::RayTminKHR: return "RayTminKHR"; + case BuiltIn::RayTmaxKHR: return "RayTmaxKHR"; + case BuiltIn::InstanceCustomIndexKHR: return "InstanceCustomIndexKHR"; + case BuiltIn::ObjectToWorldKHR: return "ObjectToWorldKHR"; + case BuiltIn::WorldToObjectKHR: return "WorldToObjectKHR"; + case BuiltIn::HitTNV: return "HitTNV"; + case BuiltIn::HitKindKHR: return "HitKindKHR"; + case BuiltIn::CurrentRayTimeNV: return "CurrentRayTimeNV"; + case BuiltIn::HitTriangleVertexPositionsKHR: return "HitTriangleVertexPositionsKHR"; + case BuiltIn::HitMicroTriangleVertexPositionsNV: return "HitMicroTriangleVertexPositionsNV"; + case BuiltIn::HitMicroTriangleVertexBarycentricsNV: return "HitMicroTriangleVertexBarycentricsNV"; + case BuiltIn::IncomingRayFlagsKHR: return "IncomingRayFlagsKHR"; + case BuiltIn::RayGeometryIndexKHR: return "RayGeometryIndexKHR"; + case BuiltIn::HitIsSphereNV: return "HitIsSphereNV"; + case BuiltIn::HitIsLSSNV: return "HitIsLSSNV"; + case BuiltIn::HitSpherePositionNV: return "HitSpherePositionNV"; + case BuiltIn::WarpsPerSMNV: return "WarpsPerSMNV"; + case BuiltIn::SMCountNV: return "SMCountNV"; + case BuiltIn::WarpIDNV: return "WarpIDNV"; + case BuiltIn::SMIDNV: return "SMIDNV"; + case BuiltIn::HitLSSPositionsNV: return "HitLSSPositionsNV"; + case BuiltIn::HitKindFrontFacingMicroTriangleNV: return "HitKindFrontFacingMicroTriangleNV"; + case BuiltIn::HitKindBackFacingMicroTriangleNV: return "HitKindBackFacingMicroTriangleNV"; + case BuiltIn::HitSphereRadiusNV: return "HitSphereRadiusNV"; + case BuiltIn::HitLSSRadiiNV: return "HitLSSRadiiNV"; + case BuiltIn::ClusterIDNV: return "ClusterIDNV"; + case BuiltIn::CullMaskKHR: return "CullMaskKHR"; + default: return "Unknown"; + } +} + +inline const char* ScopeToString(Scope value) { + switch (value) { + case Scope::CrossDevice: return "CrossDevice"; + case Scope::Device: return "Device"; + case Scope::Workgroup: return "Workgroup"; + case Scope::Subgroup: return "Subgroup"; + case Scope::Invocation: return "Invocation"; + case Scope::QueueFamily: return "QueueFamily"; + case Scope::ShaderCallKHR: return "ShaderCallKHR"; + default: return "Unknown"; + } +} + +inline const char* GroupOperationToString(GroupOperation value) { + switch (value) { + case GroupOperation::Reduce: return "Reduce"; + case GroupOperation::InclusiveScan: return "InclusiveScan"; + case GroupOperation::ExclusiveScan: return "ExclusiveScan"; + case GroupOperation::ClusteredReduce: return "ClusteredReduce"; + case GroupOperation::PartitionedReduceNV: return "PartitionedReduceNV"; + case GroupOperation::PartitionedInclusiveScanNV: return "PartitionedInclusiveScanNV"; + case GroupOperation::PartitionedExclusiveScanNV: return "PartitionedExclusiveScanNV"; + default: return "Unknown"; + } +} + +inline const char* KernelEnqueueFlagsToString(KernelEnqueueFlags value) { + switch (value) { + case KernelEnqueueFlags::NoWait: return "NoWait"; + case KernelEnqueueFlags::WaitKernel: return "WaitKernel"; + case KernelEnqueueFlags::WaitWorkGroup: return "WaitWorkGroup"; + default: return "Unknown"; + } +} + +inline const char* CapabilityToString(Capability value) { + switch (value) { + case Capability::Matrix: return "Matrix"; + case Capability::Shader: return "Shader"; + case Capability::Geometry: return "Geometry"; + case Capability::Tessellation: return "Tessellation"; + case Capability::Addresses: return "Addresses"; + case Capability::Linkage: return "Linkage"; + case Capability::Kernel: return "Kernel"; + case Capability::Vector16: return "Vector16"; + case Capability::Float16Buffer: return "Float16Buffer"; + case Capability::Float16: return "Float16"; + case Capability::Float64: return "Float64"; + case Capability::Int64: return "Int64"; + case Capability::Int64Atomics: return "Int64Atomics"; + case Capability::ImageBasic: return "ImageBasic"; + case Capability::ImageReadWrite: return "ImageReadWrite"; + case Capability::ImageMipmap: return "ImageMipmap"; + case Capability::Pipes: return "Pipes"; + case Capability::Groups: return "Groups"; + case Capability::DeviceEnqueue: return "DeviceEnqueue"; + case Capability::LiteralSampler: return "LiteralSampler"; + case Capability::AtomicStorage: return "AtomicStorage"; + case Capability::Int16: return "Int16"; + case Capability::TessellationPointSize: return "TessellationPointSize"; + case Capability::GeometryPointSize: return "GeometryPointSize"; + case Capability::ImageGatherExtended: return "ImageGatherExtended"; + case Capability::StorageImageMultisample: return "StorageImageMultisample"; + case Capability::UniformBufferArrayDynamicIndexing: return "UniformBufferArrayDynamicIndexing"; + case Capability::SampledImageArrayDynamicIndexing: return "SampledImageArrayDynamicIndexing"; + case Capability::StorageBufferArrayDynamicIndexing: return "StorageBufferArrayDynamicIndexing"; + case Capability::StorageImageArrayDynamicIndexing: return "StorageImageArrayDynamicIndexing"; + case Capability::ClipDistance: return "ClipDistance"; + case Capability::CullDistance: return "CullDistance"; + case Capability::ImageCubeArray: return "ImageCubeArray"; + case Capability::SampleRateShading: return "SampleRateShading"; + case Capability::ImageRect: return "ImageRect"; + case Capability::SampledRect: return "SampledRect"; + case Capability::GenericPointer: return "GenericPointer"; + case Capability::Int8: return "Int8"; + case Capability::InputAttachment: return "InputAttachment"; + case Capability::SparseResidency: return "SparseResidency"; + case Capability::MinLod: return "MinLod"; + case Capability::Sampled1D: return "Sampled1D"; + case Capability::Image1D: return "Image1D"; + case Capability::SampledCubeArray: return "SampledCubeArray"; + case Capability::SampledBuffer: return "SampledBuffer"; + case Capability::ImageBuffer: return "ImageBuffer"; + case Capability::ImageMSArray: return "ImageMSArray"; + case Capability::StorageImageExtendedFormats: return "StorageImageExtendedFormats"; + case Capability::ImageQuery: return "ImageQuery"; + case Capability::DerivativeControl: return "DerivativeControl"; + case Capability::InterpolationFunction: return "InterpolationFunction"; + case Capability::TransformFeedback: return "TransformFeedback"; + case Capability::GeometryStreams: return "GeometryStreams"; + case Capability::StorageImageReadWithoutFormat: return "StorageImageReadWithoutFormat"; + case Capability::StorageImageWriteWithoutFormat: return "StorageImageWriteWithoutFormat"; + case Capability::MultiViewport: return "MultiViewport"; + case Capability::SubgroupDispatch: return "SubgroupDispatch"; + case Capability::NamedBarrier: return "NamedBarrier"; + case Capability::PipeStorage: return "PipeStorage"; + case Capability::GroupNonUniform: return "GroupNonUniform"; + case Capability::GroupNonUniformVote: return "GroupNonUniformVote"; + case Capability::GroupNonUniformArithmetic: return "GroupNonUniformArithmetic"; + case Capability::GroupNonUniformBallot: return "GroupNonUniformBallot"; + case Capability::GroupNonUniformShuffle: return "GroupNonUniformShuffle"; + case Capability::GroupNonUniformShuffleRelative: return "GroupNonUniformShuffleRelative"; + case Capability::GroupNonUniformClustered: return "GroupNonUniformClustered"; + case Capability::GroupNonUniformQuad: return "GroupNonUniformQuad"; + case Capability::ShaderLayer: return "ShaderLayer"; + case Capability::ShaderViewportIndex: return "ShaderViewportIndex"; + case Capability::UniformDecoration: return "UniformDecoration"; + case Capability::CoreBuiltinsARM: return "CoreBuiltinsARM"; + case Capability::TileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT"; + case Capability::TileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT"; + case Capability::TileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT"; + case Capability::TensorsARM: return "TensorsARM"; + case Capability::CooperativeMatrixLayoutsARM: return "CooperativeMatrixLayoutsARM"; + case Capability::Float8EXT: return "Float8EXT"; + case Capability::Float8CooperativeMatrixEXT: return "Float8CooperativeMatrixEXT"; + case Capability::FragmentShadingRateKHR: return "FragmentShadingRateKHR"; + case Capability::SubgroupBallotKHR: return "SubgroupBallotKHR"; + case Capability::DrawParameters: return "DrawParameters"; + case Capability::WorkgroupMemoryExplicitLayoutKHR: return "WorkgroupMemoryExplicitLayoutKHR"; + case Capability::WorkgroupMemoryExplicitLayout8BitAccessKHR: return "WorkgroupMemoryExplicitLayout8BitAccessKHR"; + case Capability::WorkgroupMemoryExplicitLayout16BitAccessKHR: return "WorkgroupMemoryExplicitLayout16BitAccessKHR"; + case Capability::SubgroupVoteKHR: return "SubgroupVoteKHR"; + case Capability::StorageBuffer16BitAccess: return "StorageBuffer16BitAccess"; + case Capability::StorageUniform16: return "StorageUniform16"; + case Capability::StoragePushConstant16: return "StoragePushConstant16"; + case Capability::StorageInputOutput16: return "StorageInputOutput16"; + case Capability::DeviceGroup: return "DeviceGroup"; + case Capability::MultiView: return "MultiView"; + case Capability::VariablePointersStorageBuffer: return "VariablePointersStorageBuffer"; + case Capability::VariablePointers: return "VariablePointers"; + case Capability::AtomicStorageOps: return "AtomicStorageOps"; + case Capability::SampleMaskPostDepthCoverage: return "SampleMaskPostDepthCoverage"; + case Capability::StorageBuffer8BitAccess: return "StorageBuffer8BitAccess"; + case Capability::UniformAndStorageBuffer8BitAccess: return "UniformAndStorageBuffer8BitAccess"; + case Capability::StoragePushConstant8: return "StoragePushConstant8"; + case Capability::DenormPreserve: return "DenormPreserve"; + case Capability::DenormFlushToZero: return "DenormFlushToZero"; + case Capability::SignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve"; + case Capability::RoundingModeRTE: return "RoundingModeRTE"; + case Capability::RoundingModeRTZ: return "RoundingModeRTZ"; + case Capability::RayQueryProvisionalKHR: return "RayQueryProvisionalKHR"; + case Capability::RayQueryKHR: return "RayQueryKHR"; + case Capability::UntypedPointersKHR: return "UntypedPointersKHR"; + case Capability::RayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR"; + case Capability::RayTracingKHR: return "RayTracingKHR"; + case Capability::TextureSampleWeightedQCOM: return "TextureSampleWeightedQCOM"; + case Capability::TextureBoxFilterQCOM: return "TextureBoxFilterQCOM"; + case Capability::TextureBlockMatchQCOM: return "TextureBlockMatchQCOM"; + case Capability::TileShadingQCOM: return "TileShadingQCOM"; + case Capability::CooperativeMatrixConversionQCOM: return "CooperativeMatrixConversionQCOM"; + case Capability::TextureBlockMatch2QCOM: return "TextureBlockMatch2QCOM"; + case Capability::Float16ImageAMD: return "Float16ImageAMD"; + case Capability::ImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD"; + case Capability::FragmentMaskAMD: return "FragmentMaskAMD"; + case Capability::StencilExportEXT: return "StencilExportEXT"; + case Capability::ImageReadWriteLodAMD: return "ImageReadWriteLodAMD"; + case Capability::Int64ImageEXT: return "Int64ImageEXT"; + case Capability::ShaderClockKHR: return "ShaderClockKHR"; + case Capability::ShaderEnqueueAMDX: return "ShaderEnqueueAMDX"; + case Capability::QuadControlKHR: return "QuadControlKHR"; + case Capability::BFloat16TypeKHR: return "BFloat16TypeKHR"; + case Capability::BFloat16DotProductKHR: return "BFloat16DotProductKHR"; + case Capability::BFloat16CooperativeMatrixKHR: return "BFloat16CooperativeMatrixKHR"; + case Capability::SampleMaskOverrideCoverageNV: return "SampleMaskOverrideCoverageNV"; + case Capability::GeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV"; + case Capability::ShaderViewportIndexLayerEXT: return "ShaderViewportIndexLayerEXT"; + case Capability::ShaderViewportMaskNV: return "ShaderViewportMaskNV"; + case Capability::ShaderStereoViewNV: return "ShaderStereoViewNV"; + case Capability::PerViewAttributesNV: return "PerViewAttributesNV"; + case Capability::FragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT"; + case Capability::MeshShadingNV: return "MeshShadingNV"; + case Capability::ImageFootprintNV: return "ImageFootprintNV"; + case Capability::MeshShadingEXT: return "MeshShadingEXT"; + case Capability::FragmentBarycentricKHR: return "FragmentBarycentricKHR"; + case Capability::ComputeDerivativeGroupQuadsKHR: return "ComputeDerivativeGroupQuadsKHR"; + case Capability::FragmentDensityEXT: return "FragmentDensityEXT"; + case Capability::GroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV"; + case Capability::ShaderNonUniform: return "ShaderNonUniform"; + case Capability::RuntimeDescriptorArray: return "RuntimeDescriptorArray"; + case Capability::InputAttachmentArrayDynamicIndexing: return "InputAttachmentArrayDynamicIndexing"; + case Capability::UniformTexelBufferArrayDynamicIndexing: return "UniformTexelBufferArrayDynamicIndexing"; + case Capability::StorageTexelBufferArrayDynamicIndexing: return "StorageTexelBufferArrayDynamicIndexing"; + case Capability::UniformBufferArrayNonUniformIndexing: return "UniformBufferArrayNonUniformIndexing"; + case Capability::SampledImageArrayNonUniformIndexing: return "SampledImageArrayNonUniformIndexing"; + case Capability::StorageBufferArrayNonUniformIndexing: return "StorageBufferArrayNonUniformIndexing"; + case Capability::StorageImageArrayNonUniformIndexing: return "StorageImageArrayNonUniformIndexing"; + case Capability::InputAttachmentArrayNonUniformIndexing: return "InputAttachmentArrayNonUniformIndexing"; + case Capability::UniformTexelBufferArrayNonUniformIndexing: return "UniformTexelBufferArrayNonUniformIndexing"; + case Capability::StorageTexelBufferArrayNonUniformIndexing: return "StorageTexelBufferArrayNonUniformIndexing"; + case Capability::RayTracingPositionFetchKHR: return "RayTracingPositionFetchKHR"; + case Capability::RayTracingNV: return "RayTracingNV"; + case Capability::RayTracingMotionBlurNV: return "RayTracingMotionBlurNV"; + case Capability::VulkanMemoryModel: return "VulkanMemoryModel"; + case Capability::VulkanMemoryModelDeviceScope: return "VulkanMemoryModelDeviceScope"; + case Capability::PhysicalStorageBufferAddresses: return "PhysicalStorageBufferAddresses"; + case Capability::ComputeDerivativeGroupLinearKHR: return "ComputeDerivativeGroupLinearKHR"; + case Capability::RayTracingProvisionalKHR: return "RayTracingProvisionalKHR"; + case Capability::CooperativeMatrixNV: return "CooperativeMatrixNV"; + case Capability::FragmentShaderSampleInterlockEXT: return "FragmentShaderSampleInterlockEXT"; + case Capability::FragmentShaderShadingRateInterlockEXT: return "FragmentShaderShadingRateInterlockEXT"; + case Capability::ShaderSMBuiltinsNV: return "ShaderSMBuiltinsNV"; + case Capability::FragmentShaderPixelInterlockEXT: return "FragmentShaderPixelInterlockEXT"; + case Capability::DemoteToHelperInvocation: return "DemoteToHelperInvocation"; + case Capability::DisplacementMicromapNV: return "DisplacementMicromapNV"; + case Capability::RayTracingOpacityMicromapEXT: return "RayTracingOpacityMicromapEXT"; + case Capability::ShaderInvocationReorderNV: return "ShaderInvocationReorderNV"; + case Capability::ShaderInvocationReorderEXT: return "ShaderInvocationReorderEXT"; + case Capability::BindlessTextureNV: return "BindlessTextureNV"; + case Capability::RayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR"; + case Capability::CooperativeVectorNV: return "CooperativeVectorNV"; + case Capability::AtomicFloat16VectorNV: return "AtomicFloat16VectorNV"; + case Capability::RayTracingDisplacementMicromapNV: return "RayTracingDisplacementMicromapNV"; + case Capability::RawAccessChainsNV: return "RawAccessChainsNV"; + case Capability::RayTracingSpheresGeometryNV: return "RayTracingSpheresGeometryNV"; + case Capability::RayTracingLinearSweptSpheresGeometryNV: return "RayTracingLinearSweptSpheresGeometryNV"; + case Capability::Shader64BitIndexingEXT: return "Shader64BitIndexingEXT"; + case Capability::CooperativeMatrixReductionsNV: return "CooperativeMatrixReductionsNV"; + case Capability::CooperativeMatrixConversionsNV: return "CooperativeMatrixConversionsNV"; + case Capability::CooperativeMatrixPerElementOperationsNV: return "CooperativeMatrixPerElementOperationsNV"; + case Capability::CooperativeMatrixTensorAddressingNV: return "CooperativeMatrixTensorAddressingNV"; + case Capability::CooperativeMatrixBlockLoadsNV: return "CooperativeMatrixBlockLoadsNV"; + case Capability::CooperativeVectorTrainingNV: return "CooperativeVectorTrainingNV"; + case Capability::RayTracingClusterAccelerationStructureNV: return "RayTracingClusterAccelerationStructureNV"; + case Capability::TensorAddressingNV: return "TensorAddressingNV"; + case Capability::SubgroupShuffleINTEL: return "SubgroupShuffleINTEL"; + case Capability::SubgroupBufferBlockIOINTEL: return "SubgroupBufferBlockIOINTEL"; + case Capability::SubgroupImageBlockIOINTEL: return "SubgroupImageBlockIOINTEL"; + case Capability::SubgroupImageMediaBlockIOINTEL: return "SubgroupImageMediaBlockIOINTEL"; + case Capability::RoundToInfinityINTEL: return "RoundToInfinityINTEL"; + case Capability::FloatingPointModeINTEL: return "FloatingPointModeINTEL"; + case Capability::IntegerFunctions2INTEL: return "IntegerFunctions2INTEL"; + case Capability::FunctionPointersINTEL: return "FunctionPointersINTEL"; + case Capability::IndirectReferencesINTEL: return "IndirectReferencesINTEL"; + case Capability::AsmINTEL: return "AsmINTEL"; + case Capability::AtomicFloat32MinMaxEXT: return "AtomicFloat32MinMaxEXT"; + case Capability::AtomicFloat64MinMaxEXT: return "AtomicFloat64MinMaxEXT"; + case Capability::AtomicFloat16MinMaxEXT: return "AtomicFloat16MinMaxEXT"; + case Capability::VectorComputeINTEL: return "VectorComputeINTEL"; + case Capability::VectorAnyINTEL: return "VectorAnyINTEL"; + case Capability::ExpectAssumeKHR: return "ExpectAssumeKHR"; + case Capability::SubgroupAvcMotionEstimationINTEL: return "SubgroupAvcMotionEstimationINTEL"; + case Capability::SubgroupAvcMotionEstimationIntraINTEL: return "SubgroupAvcMotionEstimationIntraINTEL"; + case Capability::SubgroupAvcMotionEstimationChromaINTEL: return "SubgroupAvcMotionEstimationChromaINTEL"; + case Capability::VariableLengthArrayINTEL: return "VariableLengthArrayINTEL"; + case Capability::FunctionFloatControlINTEL: return "FunctionFloatControlINTEL"; + case Capability::FPGAMemoryAttributesINTEL: return "FPGAMemoryAttributesINTEL"; + case Capability::FPFastMathModeINTEL: return "FPFastMathModeINTEL"; + case Capability::ArbitraryPrecisionIntegersINTEL: return "ArbitraryPrecisionIntegersINTEL"; + case Capability::ArbitraryPrecisionFloatingPointINTEL: return "ArbitraryPrecisionFloatingPointINTEL"; + case Capability::UnstructuredLoopControlsINTEL: return "UnstructuredLoopControlsINTEL"; + case Capability::FPGALoopControlsINTEL: return "FPGALoopControlsINTEL"; + case Capability::KernelAttributesINTEL: return "KernelAttributesINTEL"; + case Capability::FPGAKernelAttributesINTEL: return "FPGAKernelAttributesINTEL"; + case Capability::FPGAMemoryAccessesINTEL: return "FPGAMemoryAccessesINTEL"; + case Capability::FPGAClusterAttributesINTEL: return "FPGAClusterAttributesINTEL"; + case Capability::LoopFuseINTEL: return "LoopFuseINTEL"; + case Capability::FPGADSPControlINTEL: return "FPGADSPControlINTEL"; + case Capability::MemoryAccessAliasingINTEL: return "MemoryAccessAliasingINTEL"; + case Capability::FPGAInvocationPipeliningAttributesINTEL: return "FPGAInvocationPipeliningAttributesINTEL"; + case Capability::FPGABufferLocationINTEL: return "FPGABufferLocationINTEL"; + case Capability::ArbitraryPrecisionFixedPointINTEL: return "ArbitraryPrecisionFixedPointINTEL"; + case Capability::USMStorageClassesINTEL: return "USMStorageClassesINTEL"; + case Capability::RuntimeAlignedAttributeINTEL: return "RuntimeAlignedAttributeINTEL"; + case Capability::IOPipesINTEL: return "IOPipesINTEL"; + case Capability::BlockingPipesINTEL: return "BlockingPipesINTEL"; + case Capability::FPGARegINTEL: return "FPGARegINTEL"; + case Capability::DotProductInputAll: return "DotProductInputAll"; + case Capability::DotProductInput4x8Bit: return "DotProductInput4x8Bit"; + case Capability::DotProductInput4x8BitPacked: return "DotProductInput4x8BitPacked"; + case Capability::DotProduct: return "DotProduct"; + case Capability::RayCullMaskKHR: return "RayCullMaskKHR"; + case Capability::CooperativeMatrixKHR: return "CooperativeMatrixKHR"; + case Capability::ReplicatedCompositesEXT: return "ReplicatedCompositesEXT"; + case Capability::BitInstructions: return "BitInstructions"; + case Capability::GroupNonUniformRotateKHR: return "GroupNonUniformRotateKHR"; + case Capability::FloatControls2: return "FloatControls2"; + case Capability::AtomicFloat32AddEXT: return "AtomicFloat32AddEXT"; + case Capability::AtomicFloat64AddEXT: return "AtomicFloat64AddEXT"; + case Capability::LongCompositesINTEL: return "LongCompositesINTEL"; + case Capability::OptNoneEXT: return "OptNoneEXT"; + case Capability::AtomicFloat16AddEXT: return "AtomicFloat16AddEXT"; + case Capability::DebugInfoModuleINTEL: return "DebugInfoModuleINTEL"; + case Capability::BFloat16ConversionINTEL: return "BFloat16ConversionINTEL"; + case Capability::SplitBarrierINTEL: return "SplitBarrierINTEL"; + case Capability::ArithmeticFenceEXT: return "ArithmeticFenceEXT"; + case Capability::FPGAClusterAttributesV2INTEL: return "FPGAClusterAttributesV2INTEL"; + case Capability::FPGAKernelAttributesv2INTEL: return "FPGAKernelAttributesv2INTEL"; + case Capability::FPMaxErrorINTEL: return "FPMaxErrorINTEL"; + case Capability::FPGALatencyControlINTEL: return "FPGALatencyControlINTEL"; + case Capability::FPGAArgumentInterfacesINTEL: return "FPGAArgumentInterfacesINTEL"; + case Capability::GlobalVariableHostAccessINTEL: return "GlobalVariableHostAccessINTEL"; + case Capability::GlobalVariableFPGADecorationsINTEL: return "GlobalVariableFPGADecorationsINTEL"; + case Capability::SubgroupBufferPrefetchINTEL: return "SubgroupBufferPrefetchINTEL"; + case Capability::Subgroup2DBlockIOINTEL: return "Subgroup2DBlockIOINTEL"; + case Capability::Subgroup2DBlockTransformINTEL: return "Subgroup2DBlockTransformINTEL"; + case Capability::Subgroup2DBlockTransposeINTEL: return "Subgroup2DBlockTransposeINTEL"; + case Capability::SubgroupMatrixMultiplyAccumulateINTEL: return "SubgroupMatrixMultiplyAccumulateINTEL"; + case Capability::GroupUniformArithmeticKHR: return "GroupUniformArithmeticKHR"; + case Capability::MaskedGatherScatterINTEL: return "MaskedGatherScatterINTEL"; + case Capability::CacheControlsINTEL: return "CacheControlsINTEL"; + case Capability::RegisterLimitsINTEL: return "RegisterLimitsINTEL"; + default: return "Unknown"; + } +} + +inline const char* RayQueryIntersectionToString(RayQueryIntersection value) { + switch (value) { + case RayQueryIntersection::RayQueryCandidateIntersectionKHR: return "RayQueryCandidateIntersectionKHR"; + case RayQueryIntersection::RayQueryCommittedIntersectionKHR: return "RayQueryCommittedIntersectionKHR"; + default: return "Unknown"; + } +} + +inline const char* RayQueryCommittedIntersectionTypeToString(RayQueryCommittedIntersectionType value) { + switch (value) { + case RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionNoneKHR: return "RayQueryCommittedIntersectionNoneKHR"; + case RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionTriangleKHR: return "RayQueryCommittedIntersectionTriangleKHR"; + case RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionGeneratedKHR: return "RayQueryCommittedIntersectionGeneratedKHR"; + default: return "Unknown"; + } +} + +inline const char* RayQueryCandidateIntersectionTypeToString(RayQueryCandidateIntersectionType value) { + switch (value) { + case RayQueryCandidateIntersectionType::RayQueryCandidateIntersectionTriangleKHR: return "RayQueryCandidateIntersectionTriangleKHR"; + case RayQueryCandidateIntersectionType::RayQueryCandidateIntersectionAABBKHR: return "RayQueryCandidateIntersectionAABBKHR"; + default: return "Unknown"; + } +} + +inline const char* FPDenormModeToString(FPDenormMode value) { + switch (value) { + case FPDenormMode::Preserve: return "Preserve"; + case FPDenormMode::FlushToZero: return "FlushToZero"; + default: return "Unknown"; + } +} + +inline const char* FPOperationModeToString(FPOperationMode value) { + switch (value) { + case FPOperationMode::IEEE: return "IEEE"; + case FPOperationMode::ALT: return "ALT"; + default: return "Unknown"; + } +} + +inline const char* QuantizationModesToString(QuantizationModes value) { + switch (value) { + case QuantizationModes::TRN: return "TRN"; + case QuantizationModes::TRN_ZERO: return "TRN_ZERO"; + case QuantizationModes::RND: return "RND"; + case QuantizationModes::RND_ZERO: return "RND_ZERO"; + case QuantizationModes::RND_INF: return "RND_INF"; + case QuantizationModes::RND_MIN_INF: return "RND_MIN_INF"; + case QuantizationModes::RND_CONV: return "RND_CONV"; + case QuantizationModes::RND_CONV_ODD: return "RND_CONV_ODD"; + default: return "Unknown"; + } +} + +inline const char* OverflowModesToString(OverflowModes value) { + switch (value) { + case OverflowModes::WRAP: return "WRAP"; + case OverflowModes::SAT: return "SAT"; + case OverflowModes::SAT_ZERO: return "SAT_ZERO"; + case OverflowModes::SAT_SYM: return "SAT_SYM"; + default: return "Unknown"; + } +} + +inline const char* PackedVectorFormatToString(PackedVectorFormat value) { + switch (value) { + case PackedVectorFormat::PackedVectorFormat4x8Bit: return "PackedVectorFormat4x8Bit"; + default: return "Unknown"; + } +} + +inline const char* CooperativeMatrixLayoutToString(CooperativeMatrixLayout value) { + switch (value) { + case CooperativeMatrixLayout::RowMajorKHR: return "RowMajorKHR"; + case CooperativeMatrixLayout::ColumnMajorKHR: return "ColumnMajorKHR"; + case CooperativeMatrixLayout::RowBlockedInterleavedARM: return "RowBlockedInterleavedARM"; + case CooperativeMatrixLayout::ColumnBlockedInterleavedARM: return "ColumnBlockedInterleavedARM"; + default: return "Unknown"; + } +} + +inline const char* CooperativeMatrixUseToString(CooperativeMatrixUse value) { + switch (value) { + case CooperativeMatrixUse::MatrixAKHR: return "MatrixAKHR"; + case CooperativeMatrixUse::MatrixBKHR: return "MatrixBKHR"; + case CooperativeMatrixUse::MatrixAccumulatorKHR: return "MatrixAccumulatorKHR"; + default: return "Unknown"; + } +} + +inline const char* TensorClampModeToString(TensorClampMode value) { + switch (value) { + case TensorClampMode::Undefined: return "Undefined"; + case TensorClampMode::Constant: return "Constant"; + case TensorClampMode::ClampToEdge: return "ClampToEdge"; + case TensorClampMode::Repeat: return "Repeat"; + case TensorClampMode::RepeatMirrored: return "RepeatMirrored"; + default: return "Unknown"; + } +} + +inline const char* InitializationModeQualifierToString(InitializationModeQualifier value) { + switch (value) { + case InitializationModeQualifier::InitOnDeviceReprogramINTEL: return "InitOnDeviceReprogramINTEL"; + case InitializationModeQualifier::InitOnDeviceResetINTEL: return "InitOnDeviceResetINTEL"; + default: return "Unknown"; + } +} + +inline const char* HostAccessQualifierToString(HostAccessQualifier value) { + switch (value) { + case HostAccessQualifier::NoneINTEL: return "NoneINTEL"; + case HostAccessQualifier::ReadINTEL: return "ReadINTEL"; + case HostAccessQualifier::WriteINTEL: return "WriteINTEL"; + case HostAccessQualifier::ReadWriteINTEL: return "ReadWriteINTEL"; + default: return "Unknown"; + } +} + +inline const char* LoadCacheControlToString(LoadCacheControl value) { + switch (value) { + case LoadCacheControl::UncachedINTEL: return "UncachedINTEL"; + case LoadCacheControl::CachedINTEL: return "CachedINTEL"; + case LoadCacheControl::StreamingINTEL: return "StreamingINTEL"; + case LoadCacheControl::InvalidateAfterReadINTEL: return "InvalidateAfterReadINTEL"; + case LoadCacheControl::ConstCachedINTEL: return "ConstCachedINTEL"; + default: return "Unknown"; + } +} + +inline const char* StoreCacheControlToString(StoreCacheControl value) { + switch (value) { + case StoreCacheControl::UncachedINTEL: return "UncachedINTEL"; + case StoreCacheControl::WriteThroughINTEL: return "WriteThroughINTEL"; + case StoreCacheControl::WriteBackINTEL: return "WriteBackINTEL"; + case StoreCacheControl::StreamingINTEL: return "StreamingINTEL"; + default: return "Unknown"; + } +} + +inline const char* NamedMaximumNumberOfRegistersToString(NamedMaximumNumberOfRegisters value) { + switch (value) { + case NamedMaximumNumberOfRegisters::AutoINTEL: return "AutoINTEL"; + default: return "Unknown"; + } +} + +inline const char* FPEncodingToString(FPEncoding value) { + switch (value) { + case FPEncoding::BFloat16KHR: return "BFloat16KHR"; + case FPEncoding::Float8E4M3EXT: return "Float8E4M3EXT"; + case FPEncoding::Float8E5M2EXT: return "Float8E5M2EXT"; + default: return "Unknown"; + } +} + +inline const char* CooperativeVectorMatrixLayoutToString(CooperativeVectorMatrixLayout value) { + switch (value) { + case CooperativeVectorMatrixLayout::RowMajorNV: return "RowMajorNV"; + case CooperativeVectorMatrixLayout::ColumnMajorNV: return "ColumnMajorNV"; + case CooperativeVectorMatrixLayout::InferencingOptimalNV: return "InferencingOptimalNV"; + case CooperativeVectorMatrixLayout::TrainingOptimalNV: return "TrainingOptimalNV"; + default: return "Unknown"; + } +} + +inline const char* ComponentTypeToString(ComponentType value) { + switch (value) { + case ComponentType::Float16NV: return "Float16NV"; + case ComponentType::Float32NV: return "Float32NV"; + case ComponentType::Float64NV: return "Float64NV"; + case ComponentType::SignedInt8NV: return "SignedInt8NV"; + case ComponentType::SignedInt16NV: return "SignedInt16NV"; + case ComponentType::SignedInt32NV: return "SignedInt32NV"; + case ComponentType::SignedInt64NV: return "SignedInt64NV"; + case ComponentType::UnsignedInt8NV: return "UnsignedInt8NV"; + case ComponentType::UnsignedInt16NV: return "UnsignedInt16NV"; + case ComponentType::UnsignedInt32NV: return "UnsignedInt32NV"; + case ComponentType::UnsignedInt64NV: return "UnsignedInt64NV"; + case ComponentType::SignedInt8PackedNV: return "SignedInt8PackedNV"; + case ComponentType::UnsignedInt8PackedNV: return "UnsignedInt8PackedNV"; + case ComponentType::FloatE4M3NV: return "FloatE4M3NV"; + case ComponentType::FloatE5M2NV: return "FloatE5M2NV"; + default: return "Unknown"; + } +} + +inline const char* OpToString(Op value) { + switch (value) { + case Op::OpNop: return "OpNop"; + case Op::OpUndef: return "OpUndef"; + case Op::OpSourceContinued: return "OpSourceContinued"; + case Op::OpSource: return "OpSource"; + case Op::OpSourceExtension: return "OpSourceExtension"; + case Op::OpName: return "OpName"; + case Op::OpMemberName: return "OpMemberName"; + case Op::OpString: return "OpString"; + case Op::OpLine: return "OpLine"; + case Op::OpExtension: return "OpExtension"; + case Op::OpExtInstImport: return "OpExtInstImport"; + case Op::OpExtInst: return "OpExtInst"; + case Op::OpMemoryModel: return "OpMemoryModel"; + case Op::OpEntryPoint: return "OpEntryPoint"; + case Op::OpExecutionMode: return "OpExecutionMode"; + case Op::OpCapability: return "OpCapability"; + case Op::OpTypeVoid: return "OpTypeVoid"; + case Op::OpTypeBool: return "OpTypeBool"; + case Op::OpTypeInt: return "OpTypeInt"; + case Op::OpTypeFloat: return "OpTypeFloat"; + case Op::OpTypeVector: return "OpTypeVector"; + case Op::OpTypeMatrix: return "OpTypeMatrix"; + case Op::OpTypeImage: return "OpTypeImage"; + case Op::OpTypeSampler: return "OpTypeSampler"; + case Op::OpTypeSampledImage: return "OpTypeSampledImage"; + case Op::OpTypeArray: return "OpTypeArray"; + case Op::OpTypeRuntimeArray: return "OpTypeRuntimeArray"; + case Op::OpTypeStruct: return "OpTypeStruct"; + case Op::OpTypeOpaque: return "OpTypeOpaque"; + case Op::OpTypePointer: return "OpTypePointer"; + case Op::OpTypeFunction: return "OpTypeFunction"; + case Op::OpTypeEvent: return "OpTypeEvent"; + case Op::OpTypeDeviceEvent: return "OpTypeDeviceEvent"; + case Op::OpTypeReserveId: return "OpTypeReserveId"; + case Op::OpTypeQueue: return "OpTypeQueue"; + case Op::OpTypePipe: return "OpTypePipe"; + case Op::OpTypeForwardPointer: return "OpTypeForwardPointer"; + case Op::OpConstantTrue: return "OpConstantTrue"; + case Op::OpConstantFalse: return "OpConstantFalse"; + case Op::OpConstant: return "OpConstant"; + case Op::OpConstantComposite: return "OpConstantComposite"; + case Op::OpConstantSampler: return "OpConstantSampler"; + case Op::OpConstantNull: return "OpConstantNull"; + case Op::OpSpecConstantTrue: return "OpSpecConstantTrue"; + case Op::OpSpecConstantFalse: return "OpSpecConstantFalse"; + case Op::OpSpecConstant: return "OpSpecConstant"; + case Op::OpSpecConstantComposite: return "OpSpecConstantComposite"; + case Op::OpSpecConstantOp: return "OpSpecConstantOp"; + case Op::OpFunction: return "OpFunction"; + case Op::OpFunctionParameter: return "OpFunctionParameter"; + case Op::OpFunctionEnd: return "OpFunctionEnd"; + case Op::OpFunctionCall: return "OpFunctionCall"; + case Op::OpVariable: return "OpVariable"; + case Op::OpImageTexelPointer: return "OpImageTexelPointer"; + case Op::OpLoad: return "OpLoad"; + case Op::OpStore: return "OpStore"; + case Op::OpCopyMemory: return "OpCopyMemory"; + case Op::OpCopyMemorySized: return "OpCopyMemorySized"; + case Op::OpAccessChain: return "OpAccessChain"; + case Op::OpInBoundsAccessChain: return "OpInBoundsAccessChain"; + case Op::OpPtrAccessChain: return "OpPtrAccessChain"; + case Op::OpArrayLength: return "OpArrayLength"; + case Op::OpGenericPtrMemSemantics: return "OpGenericPtrMemSemantics"; + case Op::OpInBoundsPtrAccessChain: return "OpInBoundsPtrAccessChain"; + case Op::OpDecorate: return "OpDecorate"; + case Op::OpMemberDecorate: return "OpMemberDecorate"; + case Op::OpDecorationGroup: return "OpDecorationGroup"; + case Op::OpGroupDecorate: return "OpGroupDecorate"; + case Op::OpGroupMemberDecorate: return "OpGroupMemberDecorate"; + case Op::OpVectorExtractDynamic: return "OpVectorExtractDynamic"; + case Op::OpVectorInsertDynamic: return "OpVectorInsertDynamic"; + case Op::OpVectorShuffle: return "OpVectorShuffle"; + case Op::OpCompositeConstruct: return "OpCompositeConstruct"; + case Op::OpCompositeExtract: return "OpCompositeExtract"; + case Op::OpCompositeInsert: return "OpCompositeInsert"; + case Op::OpCopyObject: return "OpCopyObject"; + case Op::OpTranspose: return "OpTranspose"; + case Op::OpSampledImage: return "OpSampledImage"; + case Op::OpImageSampleImplicitLod: return "OpImageSampleImplicitLod"; + case Op::OpImageSampleExplicitLod: return "OpImageSampleExplicitLod"; + case Op::OpImageSampleDrefImplicitLod: return "OpImageSampleDrefImplicitLod"; + case Op::OpImageSampleDrefExplicitLod: return "OpImageSampleDrefExplicitLod"; + case Op::OpImageSampleProjImplicitLod: return "OpImageSampleProjImplicitLod"; + case Op::OpImageSampleProjExplicitLod: return "OpImageSampleProjExplicitLod"; + case Op::OpImageSampleProjDrefImplicitLod: return "OpImageSampleProjDrefImplicitLod"; + case Op::OpImageSampleProjDrefExplicitLod: return "OpImageSampleProjDrefExplicitLod"; + case Op::OpImageFetch: return "OpImageFetch"; + case Op::OpImageGather: return "OpImageGather"; + case Op::OpImageDrefGather: return "OpImageDrefGather"; + case Op::OpImageRead: return "OpImageRead"; + case Op::OpImageWrite: return "OpImageWrite"; + case Op::OpImage: return "OpImage"; + case Op::OpImageQueryFormat: return "OpImageQueryFormat"; + case Op::OpImageQueryOrder: return "OpImageQueryOrder"; + case Op::OpImageQuerySizeLod: return "OpImageQuerySizeLod"; + case Op::OpImageQuerySize: return "OpImageQuerySize"; + case Op::OpImageQueryLod: return "OpImageQueryLod"; + case Op::OpImageQueryLevels: return "OpImageQueryLevels"; + case Op::OpImageQuerySamples: return "OpImageQuerySamples"; + case Op::OpConvertFToU: return "OpConvertFToU"; + case Op::OpConvertFToS: return "OpConvertFToS"; + case Op::OpConvertSToF: return "OpConvertSToF"; + case Op::OpConvertUToF: return "OpConvertUToF"; + case Op::OpUConvert: return "OpUConvert"; + case Op::OpSConvert: return "OpSConvert"; + case Op::OpFConvert: return "OpFConvert"; + case Op::OpQuantizeToF16: return "OpQuantizeToF16"; + case Op::OpConvertPtrToU: return "OpConvertPtrToU"; + case Op::OpSatConvertSToU: return "OpSatConvertSToU"; + case Op::OpSatConvertUToS: return "OpSatConvertUToS"; + case Op::OpConvertUToPtr: return "OpConvertUToPtr"; + case Op::OpPtrCastToGeneric: return "OpPtrCastToGeneric"; + case Op::OpGenericCastToPtr: return "OpGenericCastToPtr"; + case Op::OpGenericCastToPtrExplicit: return "OpGenericCastToPtrExplicit"; + case Op::OpBitcast: return "OpBitcast"; + case Op::OpSNegate: return "OpSNegate"; + case Op::OpFNegate: return "OpFNegate"; + case Op::OpIAdd: return "OpIAdd"; + case Op::OpFAdd: return "OpFAdd"; + case Op::OpISub: return "OpISub"; + case Op::OpFSub: return "OpFSub"; + case Op::OpIMul: return "OpIMul"; + case Op::OpFMul: return "OpFMul"; + case Op::OpUDiv: return "OpUDiv"; + case Op::OpSDiv: return "OpSDiv"; + case Op::OpFDiv: return "OpFDiv"; + case Op::OpUMod: return "OpUMod"; + case Op::OpSRem: return "OpSRem"; + case Op::OpSMod: return "OpSMod"; + case Op::OpFRem: return "OpFRem"; + case Op::OpFMod: return "OpFMod"; + case Op::OpVectorTimesScalar: return "OpVectorTimesScalar"; + case Op::OpMatrixTimesScalar: return "OpMatrixTimesScalar"; + case Op::OpVectorTimesMatrix: return "OpVectorTimesMatrix"; + case Op::OpMatrixTimesVector: return "OpMatrixTimesVector"; + case Op::OpMatrixTimesMatrix: return "OpMatrixTimesMatrix"; + case Op::OpOuterProduct: return "OpOuterProduct"; + case Op::OpDot: return "OpDot"; + case Op::OpIAddCarry: return "OpIAddCarry"; + case Op::OpISubBorrow: return "OpISubBorrow"; + case Op::OpUMulExtended: return "OpUMulExtended"; + case Op::OpSMulExtended: return "OpSMulExtended"; + case Op::OpAny: return "OpAny"; + case Op::OpAll: return "OpAll"; + case Op::OpIsNan: return "OpIsNan"; + case Op::OpIsInf: return "OpIsInf"; + case Op::OpIsFinite: return "OpIsFinite"; + case Op::OpIsNormal: return "OpIsNormal"; + case Op::OpSignBitSet: return "OpSignBitSet"; + case Op::OpLessOrGreater: return "OpLessOrGreater"; + case Op::OpOrdered: return "OpOrdered"; + case Op::OpUnordered: return "OpUnordered"; + case Op::OpLogicalEqual: return "OpLogicalEqual"; + case Op::OpLogicalNotEqual: return "OpLogicalNotEqual"; + case Op::OpLogicalOr: return "OpLogicalOr"; + case Op::OpLogicalAnd: return "OpLogicalAnd"; + case Op::OpLogicalNot: return "OpLogicalNot"; + case Op::OpSelect: return "OpSelect"; + case Op::OpIEqual: return "OpIEqual"; + case Op::OpINotEqual: return "OpINotEqual"; + case Op::OpUGreaterThan: return "OpUGreaterThan"; + case Op::OpSGreaterThan: return "OpSGreaterThan"; + case Op::OpUGreaterThanEqual: return "OpUGreaterThanEqual"; + case Op::OpSGreaterThanEqual: return "OpSGreaterThanEqual"; + case Op::OpULessThan: return "OpULessThan"; + case Op::OpSLessThan: return "OpSLessThan"; + case Op::OpULessThanEqual: return "OpULessThanEqual"; + case Op::OpSLessThanEqual: return "OpSLessThanEqual"; + case Op::OpFOrdEqual: return "OpFOrdEqual"; + case Op::OpFUnordEqual: return "OpFUnordEqual"; + case Op::OpFOrdNotEqual: return "OpFOrdNotEqual"; + case Op::OpFUnordNotEqual: return "OpFUnordNotEqual"; + case Op::OpFOrdLessThan: return "OpFOrdLessThan"; + case Op::OpFUnordLessThan: return "OpFUnordLessThan"; + case Op::OpFOrdGreaterThan: return "OpFOrdGreaterThan"; + case Op::OpFUnordGreaterThan: return "OpFUnordGreaterThan"; + case Op::OpFOrdLessThanEqual: return "OpFOrdLessThanEqual"; + case Op::OpFUnordLessThanEqual: return "OpFUnordLessThanEqual"; + case Op::OpFOrdGreaterThanEqual: return "OpFOrdGreaterThanEqual"; + case Op::OpFUnordGreaterThanEqual: return "OpFUnordGreaterThanEqual"; + case Op::OpShiftRightLogical: return "OpShiftRightLogical"; + case Op::OpShiftRightArithmetic: return "OpShiftRightArithmetic"; + case Op::OpShiftLeftLogical: return "OpShiftLeftLogical"; + case Op::OpBitwiseOr: return "OpBitwiseOr"; + case Op::OpBitwiseXor: return "OpBitwiseXor"; + case Op::OpBitwiseAnd: return "OpBitwiseAnd"; + case Op::OpNot: return "OpNot"; + case Op::OpBitFieldInsert: return "OpBitFieldInsert"; + case Op::OpBitFieldSExtract: return "OpBitFieldSExtract"; + case Op::OpBitFieldUExtract: return "OpBitFieldUExtract"; + case Op::OpBitReverse: return "OpBitReverse"; + case Op::OpBitCount: return "OpBitCount"; + case Op::OpDPdx: return "OpDPdx"; + case Op::OpDPdy: return "OpDPdy"; + case Op::OpFwidth: return "OpFwidth"; + case Op::OpDPdxFine: return "OpDPdxFine"; + case Op::OpDPdyFine: return "OpDPdyFine"; + case Op::OpFwidthFine: return "OpFwidthFine"; + case Op::OpDPdxCoarse: return "OpDPdxCoarse"; + case Op::OpDPdyCoarse: return "OpDPdyCoarse"; + case Op::OpFwidthCoarse: return "OpFwidthCoarse"; + case Op::OpEmitVertex: return "OpEmitVertex"; + case Op::OpEndPrimitive: return "OpEndPrimitive"; + case Op::OpEmitStreamVertex: return "OpEmitStreamVertex"; + case Op::OpEndStreamPrimitive: return "OpEndStreamPrimitive"; + case Op::OpControlBarrier: return "OpControlBarrier"; + case Op::OpMemoryBarrier: return "OpMemoryBarrier"; + case Op::OpAtomicLoad: return "OpAtomicLoad"; + case Op::OpAtomicStore: return "OpAtomicStore"; + case Op::OpAtomicExchange: return "OpAtomicExchange"; + case Op::OpAtomicCompareExchange: return "OpAtomicCompareExchange"; + case Op::OpAtomicCompareExchangeWeak: return "OpAtomicCompareExchangeWeak"; + case Op::OpAtomicIIncrement: return "OpAtomicIIncrement"; + case Op::OpAtomicIDecrement: return "OpAtomicIDecrement"; + case Op::OpAtomicIAdd: return "OpAtomicIAdd"; + case Op::OpAtomicISub: return "OpAtomicISub"; + case Op::OpAtomicSMin: return "OpAtomicSMin"; + case Op::OpAtomicUMin: return "OpAtomicUMin"; + case Op::OpAtomicSMax: return "OpAtomicSMax"; + case Op::OpAtomicUMax: return "OpAtomicUMax"; + case Op::OpAtomicAnd: return "OpAtomicAnd"; + case Op::OpAtomicOr: return "OpAtomicOr"; + case Op::OpAtomicXor: return "OpAtomicXor"; + case Op::OpPhi: return "OpPhi"; + case Op::OpLoopMerge: return "OpLoopMerge"; + case Op::OpSelectionMerge: return "OpSelectionMerge"; + case Op::OpLabel: return "OpLabel"; + case Op::OpBranch: return "OpBranch"; + case Op::OpBranchConditional: return "OpBranchConditional"; + case Op::OpSwitch: return "OpSwitch"; + case Op::OpKill: return "OpKill"; + case Op::OpReturn: return "OpReturn"; + case Op::OpReturnValue: return "OpReturnValue"; + case Op::OpUnreachable: return "OpUnreachable"; + case Op::OpLifetimeStart: return "OpLifetimeStart"; + case Op::OpLifetimeStop: return "OpLifetimeStop"; + case Op::OpGroupAsyncCopy: return "OpGroupAsyncCopy"; + case Op::OpGroupWaitEvents: return "OpGroupWaitEvents"; + case Op::OpGroupAll: return "OpGroupAll"; + case Op::OpGroupAny: return "OpGroupAny"; + case Op::OpGroupBroadcast: return "OpGroupBroadcast"; + case Op::OpGroupIAdd: return "OpGroupIAdd"; + case Op::OpGroupFAdd: return "OpGroupFAdd"; + case Op::OpGroupFMin: return "OpGroupFMin"; + case Op::OpGroupUMin: return "OpGroupUMin"; + case Op::OpGroupSMin: return "OpGroupSMin"; + case Op::OpGroupFMax: return "OpGroupFMax"; + case Op::OpGroupUMax: return "OpGroupUMax"; + case Op::OpGroupSMax: return "OpGroupSMax"; + case Op::OpReadPipe: return "OpReadPipe"; + case Op::OpWritePipe: return "OpWritePipe"; + case Op::OpReservedReadPipe: return "OpReservedReadPipe"; + case Op::OpReservedWritePipe: return "OpReservedWritePipe"; + case Op::OpReserveReadPipePackets: return "OpReserveReadPipePackets"; + case Op::OpReserveWritePipePackets: return "OpReserveWritePipePackets"; + case Op::OpCommitReadPipe: return "OpCommitReadPipe"; + case Op::OpCommitWritePipe: return "OpCommitWritePipe"; + case Op::OpIsValidReserveId: return "OpIsValidReserveId"; + case Op::OpGetNumPipePackets: return "OpGetNumPipePackets"; + case Op::OpGetMaxPipePackets: return "OpGetMaxPipePackets"; + case Op::OpGroupReserveReadPipePackets: return "OpGroupReserveReadPipePackets"; + case Op::OpGroupReserveWritePipePackets: return "OpGroupReserveWritePipePackets"; + case Op::OpGroupCommitReadPipe: return "OpGroupCommitReadPipe"; + case Op::OpGroupCommitWritePipe: return "OpGroupCommitWritePipe"; + case Op::OpEnqueueMarker: return "OpEnqueueMarker"; + case Op::OpEnqueueKernel: return "OpEnqueueKernel"; + case Op::OpGetKernelNDrangeSubGroupCount: return "OpGetKernelNDrangeSubGroupCount"; + case Op::OpGetKernelNDrangeMaxSubGroupSize: return "OpGetKernelNDrangeMaxSubGroupSize"; + case Op::OpGetKernelWorkGroupSize: return "OpGetKernelWorkGroupSize"; + case Op::OpGetKernelPreferredWorkGroupSizeMultiple: return "OpGetKernelPreferredWorkGroupSizeMultiple"; + case Op::OpRetainEvent: return "OpRetainEvent"; + case Op::OpReleaseEvent: return "OpReleaseEvent"; + case Op::OpCreateUserEvent: return "OpCreateUserEvent"; + case Op::OpIsValidEvent: return "OpIsValidEvent"; + case Op::OpSetUserEventStatus: return "OpSetUserEventStatus"; + case Op::OpCaptureEventProfilingInfo: return "OpCaptureEventProfilingInfo"; + case Op::OpGetDefaultQueue: return "OpGetDefaultQueue"; + case Op::OpBuildNDRange: return "OpBuildNDRange"; + case Op::OpImageSparseSampleImplicitLod: return "OpImageSparseSampleImplicitLod"; + case Op::OpImageSparseSampleExplicitLod: return "OpImageSparseSampleExplicitLod"; + case Op::OpImageSparseSampleDrefImplicitLod: return "OpImageSparseSampleDrefImplicitLod"; + case Op::OpImageSparseSampleDrefExplicitLod: return "OpImageSparseSampleDrefExplicitLod"; + case Op::OpImageSparseSampleProjImplicitLod: return "OpImageSparseSampleProjImplicitLod"; + case Op::OpImageSparseSampleProjExplicitLod: return "OpImageSparseSampleProjExplicitLod"; + case Op::OpImageSparseSampleProjDrefImplicitLod: return "OpImageSparseSampleProjDrefImplicitLod"; + case Op::OpImageSparseSampleProjDrefExplicitLod: return "OpImageSparseSampleProjDrefExplicitLod"; + case Op::OpImageSparseFetch: return "OpImageSparseFetch"; + case Op::OpImageSparseGather: return "OpImageSparseGather"; + case Op::OpImageSparseDrefGather: return "OpImageSparseDrefGather"; + case Op::OpImageSparseTexelsResident: return "OpImageSparseTexelsResident"; + case Op::OpNoLine: return "OpNoLine"; + case Op::OpAtomicFlagTestAndSet: return "OpAtomicFlagTestAndSet"; + case Op::OpAtomicFlagClear: return "OpAtomicFlagClear"; + case Op::OpImageSparseRead: return "OpImageSparseRead"; + case Op::OpSizeOf: return "OpSizeOf"; + case Op::OpTypePipeStorage: return "OpTypePipeStorage"; + case Op::OpConstantPipeStorage: return "OpConstantPipeStorage"; + case Op::OpCreatePipeFromPipeStorage: return "OpCreatePipeFromPipeStorage"; + case Op::OpGetKernelLocalSizeForSubgroupCount: return "OpGetKernelLocalSizeForSubgroupCount"; + case Op::OpGetKernelMaxNumSubgroups: return "OpGetKernelMaxNumSubgroups"; + case Op::OpTypeNamedBarrier: return "OpTypeNamedBarrier"; + case Op::OpNamedBarrierInitialize: return "OpNamedBarrierInitialize"; + case Op::OpMemoryNamedBarrier: return "OpMemoryNamedBarrier"; + case Op::OpModuleProcessed: return "OpModuleProcessed"; + case Op::OpExecutionModeId: return "OpExecutionModeId"; + case Op::OpDecorateId: return "OpDecorateId"; + case Op::OpGroupNonUniformElect: return "OpGroupNonUniformElect"; + case Op::OpGroupNonUniformAll: return "OpGroupNonUniformAll"; + case Op::OpGroupNonUniformAny: return "OpGroupNonUniformAny"; + case Op::OpGroupNonUniformAllEqual: return "OpGroupNonUniformAllEqual"; + case Op::OpGroupNonUniformBroadcast: return "OpGroupNonUniformBroadcast"; + case Op::OpGroupNonUniformBroadcastFirst: return "OpGroupNonUniformBroadcastFirst"; + case Op::OpGroupNonUniformBallot: return "OpGroupNonUniformBallot"; + case Op::OpGroupNonUniformInverseBallot: return "OpGroupNonUniformInverseBallot"; + case Op::OpGroupNonUniformBallotBitExtract: return "OpGroupNonUniformBallotBitExtract"; + case Op::OpGroupNonUniformBallotBitCount: return "OpGroupNonUniformBallotBitCount"; + case Op::OpGroupNonUniformBallotFindLSB: return "OpGroupNonUniformBallotFindLSB"; + case Op::OpGroupNonUniformBallotFindMSB: return "OpGroupNonUniformBallotFindMSB"; + case Op::OpGroupNonUniformShuffle: return "OpGroupNonUniformShuffle"; + case Op::OpGroupNonUniformShuffleXor: return "OpGroupNonUniformShuffleXor"; + case Op::OpGroupNonUniformShuffleUp: return "OpGroupNonUniformShuffleUp"; + case Op::OpGroupNonUniformShuffleDown: return "OpGroupNonUniformShuffleDown"; + case Op::OpGroupNonUniformIAdd: return "OpGroupNonUniformIAdd"; + case Op::OpGroupNonUniformFAdd: return "OpGroupNonUniformFAdd"; + case Op::OpGroupNonUniformIMul: return "OpGroupNonUniformIMul"; + case Op::OpGroupNonUniformFMul: return "OpGroupNonUniformFMul"; + case Op::OpGroupNonUniformSMin: return "OpGroupNonUniformSMin"; + case Op::OpGroupNonUniformUMin: return "OpGroupNonUniformUMin"; + case Op::OpGroupNonUniformFMin: return "OpGroupNonUniformFMin"; + case Op::OpGroupNonUniformSMax: return "OpGroupNonUniformSMax"; + case Op::OpGroupNonUniformUMax: return "OpGroupNonUniformUMax"; + case Op::OpGroupNonUniformFMax: return "OpGroupNonUniformFMax"; + case Op::OpGroupNonUniformBitwiseAnd: return "OpGroupNonUniformBitwiseAnd"; + case Op::OpGroupNonUniformBitwiseOr: return "OpGroupNonUniformBitwiseOr"; + case Op::OpGroupNonUniformBitwiseXor: return "OpGroupNonUniformBitwiseXor"; + case Op::OpGroupNonUniformLogicalAnd: return "OpGroupNonUniformLogicalAnd"; + case Op::OpGroupNonUniformLogicalOr: return "OpGroupNonUniformLogicalOr"; + case Op::OpGroupNonUniformLogicalXor: return "OpGroupNonUniformLogicalXor"; + case Op::OpGroupNonUniformQuadBroadcast: return "OpGroupNonUniformQuadBroadcast"; + case Op::OpGroupNonUniformQuadSwap: return "OpGroupNonUniformQuadSwap"; + case Op::OpCopyLogical: return "OpCopyLogical"; + case Op::OpPtrEqual: return "OpPtrEqual"; + case Op::OpPtrNotEqual: return "OpPtrNotEqual"; + case Op::OpPtrDiff: return "OpPtrDiff"; + case Op::OpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT"; + case Op::OpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT"; + case Op::OpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT"; + case Op::OpTypeTensorARM: return "OpTypeTensorARM"; + case Op::OpTensorReadARM: return "OpTensorReadARM"; + case Op::OpTensorWriteARM: return "OpTensorWriteARM"; + case Op::OpTensorQuerySizeARM: return "OpTensorQuerySizeARM"; + case Op::OpTerminateInvocation: return "OpTerminateInvocation"; + case Op::OpTypeUntypedPointerKHR: return "OpTypeUntypedPointerKHR"; + case Op::OpUntypedVariableKHR: return "OpUntypedVariableKHR"; + case Op::OpUntypedAccessChainKHR: return "OpUntypedAccessChainKHR"; + case Op::OpUntypedInBoundsAccessChainKHR: return "OpUntypedInBoundsAccessChainKHR"; + case Op::OpSubgroupBallotKHR: return "OpSubgroupBallotKHR"; + case Op::OpSubgroupFirstInvocationKHR: return "OpSubgroupFirstInvocationKHR"; + case Op::OpUntypedPtrAccessChainKHR: return "OpUntypedPtrAccessChainKHR"; + case Op::OpUntypedInBoundsPtrAccessChainKHR: return "OpUntypedInBoundsPtrAccessChainKHR"; + case Op::OpUntypedArrayLengthKHR: return "OpUntypedArrayLengthKHR"; + case Op::OpUntypedPrefetchKHR: return "OpUntypedPrefetchKHR"; + case Op::OpSubgroupAllKHR: return "OpSubgroupAllKHR"; + case Op::OpSubgroupAnyKHR: return "OpSubgroupAnyKHR"; + case Op::OpSubgroupAllEqualKHR: return "OpSubgroupAllEqualKHR"; + case Op::OpGroupNonUniformRotateKHR: return "OpGroupNonUniformRotateKHR"; + case Op::OpSubgroupReadInvocationKHR: return "OpSubgroupReadInvocationKHR"; + case Op::OpExtInstWithForwardRefsKHR: return "OpExtInstWithForwardRefsKHR"; + case Op::OpTraceRayKHR: return "OpTraceRayKHR"; + case Op::OpExecuteCallableKHR: return "OpExecuteCallableKHR"; + case Op::OpConvertUToAccelerationStructureKHR: return "OpConvertUToAccelerationStructureKHR"; + case Op::OpIgnoreIntersectionKHR: return "OpIgnoreIntersectionKHR"; + case Op::OpTerminateRayKHR: return "OpTerminateRayKHR"; + case Op::OpSDot: return "OpSDot"; + case Op::OpUDot: return "OpUDot"; + case Op::OpSUDot: return "OpSUDot"; + case Op::OpSDotAccSat: return "OpSDotAccSat"; + case Op::OpUDotAccSat: return "OpUDotAccSat"; + case Op::OpSUDotAccSat: return "OpSUDotAccSat"; + case Op::OpTypeCooperativeMatrixKHR: return "OpTypeCooperativeMatrixKHR"; + case Op::OpCooperativeMatrixLoadKHR: return "OpCooperativeMatrixLoadKHR"; + case Op::OpCooperativeMatrixStoreKHR: return "OpCooperativeMatrixStoreKHR"; + case Op::OpCooperativeMatrixMulAddKHR: return "OpCooperativeMatrixMulAddKHR"; + case Op::OpCooperativeMatrixLengthKHR: return "OpCooperativeMatrixLengthKHR"; + case Op::OpConstantCompositeReplicateEXT: return "OpConstantCompositeReplicateEXT"; + case Op::OpSpecConstantCompositeReplicateEXT: return "OpSpecConstantCompositeReplicateEXT"; + case Op::OpCompositeConstructReplicateEXT: return "OpCompositeConstructReplicateEXT"; + case Op::OpTypeRayQueryKHR: return "OpTypeRayQueryKHR"; + case Op::OpRayQueryInitializeKHR: return "OpRayQueryInitializeKHR"; + case Op::OpRayQueryTerminateKHR: return "OpRayQueryTerminateKHR"; + case Op::OpRayQueryGenerateIntersectionKHR: return "OpRayQueryGenerateIntersectionKHR"; + case Op::OpRayQueryConfirmIntersectionKHR: return "OpRayQueryConfirmIntersectionKHR"; + case Op::OpRayQueryProceedKHR: return "OpRayQueryProceedKHR"; + case Op::OpRayQueryGetIntersectionTypeKHR: return "OpRayQueryGetIntersectionTypeKHR"; + case Op::OpImageSampleWeightedQCOM: return "OpImageSampleWeightedQCOM"; + case Op::OpImageBoxFilterQCOM: return "OpImageBoxFilterQCOM"; + case Op::OpImageBlockMatchSSDQCOM: return "OpImageBlockMatchSSDQCOM"; + case Op::OpImageBlockMatchSADQCOM: return "OpImageBlockMatchSADQCOM"; + case Op::OpBitCastArrayQCOM: return "OpBitCastArrayQCOM"; + case Op::OpImageBlockMatchWindowSSDQCOM: return "OpImageBlockMatchWindowSSDQCOM"; + case Op::OpImageBlockMatchWindowSADQCOM: return "OpImageBlockMatchWindowSADQCOM"; + case Op::OpImageBlockMatchGatherSSDQCOM: return "OpImageBlockMatchGatherSSDQCOM"; + case Op::OpImageBlockMatchGatherSADQCOM: return "OpImageBlockMatchGatherSADQCOM"; + case Op::OpCompositeConstructCoopMatQCOM: return "OpCompositeConstructCoopMatQCOM"; + case Op::OpCompositeExtractCoopMatQCOM: return "OpCompositeExtractCoopMatQCOM"; + case Op::OpExtractSubArrayQCOM: return "OpExtractSubArrayQCOM"; + case Op::OpGroupIAddNonUniformAMD: return "OpGroupIAddNonUniformAMD"; + case Op::OpGroupFAddNonUniformAMD: return "OpGroupFAddNonUniformAMD"; + case Op::OpGroupFMinNonUniformAMD: return "OpGroupFMinNonUniformAMD"; + case Op::OpGroupUMinNonUniformAMD: return "OpGroupUMinNonUniformAMD"; + case Op::OpGroupSMinNonUniformAMD: return "OpGroupSMinNonUniformAMD"; + case Op::OpGroupFMaxNonUniformAMD: return "OpGroupFMaxNonUniformAMD"; + case Op::OpGroupUMaxNonUniformAMD: return "OpGroupUMaxNonUniformAMD"; + case Op::OpGroupSMaxNonUniformAMD: return "OpGroupSMaxNonUniformAMD"; + case Op::OpFragmentMaskFetchAMD: return "OpFragmentMaskFetchAMD"; + case Op::OpFragmentFetchAMD: return "OpFragmentFetchAMD"; + case Op::OpReadClockKHR: return "OpReadClockKHR"; + case Op::OpAllocateNodePayloadsAMDX: return "OpAllocateNodePayloadsAMDX"; + case Op::OpEnqueueNodePayloadsAMDX: return "OpEnqueueNodePayloadsAMDX"; + case Op::OpTypeNodePayloadArrayAMDX: return "OpTypeNodePayloadArrayAMDX"; + case Op::OpFinishWritingNodePayloadAMDX: return "OpFinishWritingNodePayloadAMDX"; + case Op::OpNodePayloadArrayLengthAMDX: return "OpNodePayloadArrayLengthAMDX"; + case Op::OpIsNodePayloadValidAMDX: return "OpIsNodePayloadValidAMDX"; + case Op::OpConstantStringAMDX: return "OpConstantStringAMDX"; + case Op::OpSpecConstantStringAMDX: return "OpSpecConstantStringAMDX"; + case Op::OpGroupNonUniformQuadAllKHR: return "OpGroupNonUniformQuadAllKHR"; + case Op::OpGroupNonUniformQuadAnyKHR: return "OpGroupNonUniformQuadAnyKHR"; + case Op::OpHitObjectRecordHitMotionNV: return "OpHitObjectRecordHitMotionNV"; + case Op::OpHitObjectRecordHitWithIndexMotionNV: return "OpHitObjectRecordHitWithIndexMotionNV"; + case Op::OpHitObjectRecordMissMotionNV: return "OpHitObjectRecordMissMotionNV"; + case Op::OpHitObjectGetWorldToObjectNV: return "OpHitObjectGetWorldToObjectNV"; + case Op::OpHitObjectGetObjectToWorldNV: return "OpHitObjectGetObjectToWorldNV"; + case Op::OpHitObjectGetObjectRayDirectionNV: return "OpHitObjectGetObjectRayDirectionNV"; + case Op::OpHitObjectGetObjectRayOriginNV: return "OpHitObjectGetObjectRayOriginNV"; + case Op::OpHitObjectTraceRayMotionNV: return "OpHitObjectTraceRayMotionNV"; + case Op::OpHitObjectGetShaderRecordBufferHandleNV: return "OpHitObjectGetShaderRecordBufferHandleNV"; + case Op::OpHitObjectGetShaderBindingTableRecordIndexNV: return "OpHitObjectGetShaderBindingTableRecordIndexNV"; + case Op::OpHitObjectRecordEmptyNV: return "OpHitObjectRecordEmptyNV"; + case Op::OpHitObjectTraceRayNV: return "OpHitObjectTraceRayNV"; + case Op::OpHitObjectRecordHitNV: return "OpHitObjectRecordHitNV"; + case Op::OpHitObjectRecordHitWithIndexNV: return "OpHitObjectRecordHitWithIndexNV"; + case Op::OpHitObjectRecordMissNV: return "OpHitObjectRecordMissNV"; + case Op::OpHitObjectExecuteShaderNV: return "OpHitObjectExecuteShaderNV"; + case Op::OpHitObjectGetCurrentTimeNV: return "OpHitObjectGetCurrentTimeNV"; + case Op::OpHitObjectGetAttributesNV: return "OpHitObjectGetAttributesNV"; + case Op::OpHitObjectGetHitKindNV: return "OpHitObjectGetHitKindNV"; + case Op::OpHitObjectGetPrimitiveIndexNV: return "OpHitObjectGetPrimitiveIndexNV"; + case Op::OpHitObjectGetGeometryIndexNV: return "OpHitObjectGetGeometryIndexNV"; + case Op::OpHitObjectGetInstanceIdNV: return "OpHitObjectGetInstanceIdNV"; + case Op::OpHitObjectGetInstanceCustomIndexNV: return "OpHitObjectGetInstanceCustomIndexNV"; + case Op::OpHitObjectGetWorldRayDirectionNV: return "OpHitObjectGetWorldRayDirectionNV"; + case Op::OpHitObjectGetWorldRayOriginNV: return "OpHitObjectGetWorldRayOriginNV"; + case Op::OpHitObjectGetRayTMaxNV: return "OpHitObjectGetRayTMaxNV"; + case Op::OpHitObjectGetRayTMinNV: return "OpHitObjectGetRayTMinNV"; + case Op::OpHitObjectIsEmptyNV: return "OpHitObjectIsEmptyNV"; + case Op::OpHitObjectIsHitNV: return "OpHitObjectIsHitNV"; + case Op::OpHitObjectIsMissNV: return "OpHitObjectIsMissNV"; + case Op::OpReorderThreadWithHitObjectNV: return "OpReorderThreadWithHitObjectNV"; + case Op::OpReorderThreadWithHintNV: return "OpReorderThreadWithHintNV"; + case Op::OpTypeHitObjectNV: return "OpTypeHitObjectNV"; + case Op::OpImageSampleFootprintNV: return "OpImageSampleFootprintNV"; + case Op::OpTypeCooperativeVectorNV: return "OpTypeCooperativeVectorNV"; + case Op::OpCooperativeVectorMatrixMulNV: return "OpCooperativeVectorMatrixMulNV"; + case Op::OpCooperativeVectorOuterProductAccumulateNV: return "OpCooperativeVectorOuterProductAccumulateNV"; + case Op::OpCooperativeVectorReduceSumAccumulateNV: return "OpCooperativeVectorReduceSumAccumulateNV"; + case Op::OpCooperativeVectorMatrixMulAddNV: return "OpCooperativeVectorMatrixMulAddNV"; + case Op::OpCooperativeMatrixConvertNV: return "OpCooperativeMatrixConvertNV"; + case Op::OpEmitMeshTasksEXT: return "OpEmitMeshTasksEXT"; + case Op::OpSetMeshOutputsEXT: return "OpSetMeshOutputsEXT"; + case Op::OpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV"; + case Op::OpWritePackedPrimitiveIndices4x8NV: return "OpWritePackedPrimitiveIndices4x8NV"; + case Op::OpFetchMicroTriangleVertexPositionNV: return "OpFetchMicroTriangleVertexPositionNV"; + case Op::OpFetchMicroTriangleVertexBarycentricNV: return "OpFetchMicroTriangleVertexBarycentricNV"; + case Op::OpCooperativeVectorLoadNV: return "OpCooperativeVectorLoadNV"; + case Op::OpCooperativeVectorStoreNV: return "OpCooperativeVectorStoreNV"; + case Op::OpHitObjectRecordFromQueryEXT: return "OpHitObjectRecordFromQueryEXT"; + case Op::OpHitObjectRecordMissEXT: return "OpHitObjectRecordMissEXT"; + case Op::OpHitObjectRecordMissMotionEXT: return "OpHitObjectRecordMissMotionEXT"; + case Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT: return "OpHitObjectGetIntersectionTriangleVertexPositionsEXT"; + case Op::OpHitObjectGetRayFlagsEXT: return "OpHitObjectGetRayFlagsEXT"; + case Op::OpHitObjectSetShaderBindingTableRecordIndexEXT: return "OpHitObjectSetShaderBindingTableRecordIndexEXT"; + case Op::OpHitObjectReorderExecuteShaderEXT: return "OpHitObjectReorderExecuteShaderEXT"; + case Op::OpHitObjectTraceReorderExecuteEXT: return "OpHitObjectTraceReorderExecuteEXT"; + case Op::OpHitObjectTraceMotionReorderExecuteEXT: return "OpHitObjectTraceMotionReorderExecuteEXT"; + case Op::OpTypeHitObjectEXT: return "OpTypeHitObjectEXT"; + case Op::OpReorderThreadWithHintEXT: return "OpReorderThreadWithHintEXT"; + case Op::OpReorderThreadWithHitObjectEXT: return "OpReorderThreadWithHitObjectEXT"; + case Op::OpHitObjectTraceRayEXT: return "OpHitObjectTraceRayEXT"; + case Op::OpHitObjectTraceRayMotionEXT: return "OpHitObjectTraceRayMotionEXT"; + case Op::OpHitObjectRecordEmptyEXT: return "OpHitObjectRecordEmptyEXT"; + case Op::OpHitObjectExecuteShaderEXT: return "OpHitObjectExecuteShaderEXT"; + case Op::OpHitObjectGetCurrentTimeEXT: return "OpHitObjectGetCurrentTimeEXT"; + case Op::OpHitObjectGetAttributesEXT: return "OpHitObjectGetAttributesEXT"; + case Op::OpHitObjectGetHitKindEXT: return "OpHitObjectGetHitKindEXT"; + case Op::OpHitObjectGetPrimitiveIndexEXT: return "OpHitObjectGetPrimitiveIndexEXT"; + case Op::OpHitObjectGetGeometryIndexEXT: return "OpHitObjectGetGeometryIndexEXT"; + case Op::OpHitObjectGetInstanceIdEXT: return "OpHitObjectGetInstanceIdEXT"; + case Op::OpHitObjectGetInstanceCustomIndexEXT: return "OpHitObjectGetInstanceCustomIndexEXT"; + case Op::OpHitObjectGetObjectRayOriginEXT: return "OpHitObjectGetObjectRayOriginEXT"; + case Op::OpHitObjectGetObjectRayDirectionEXT: return "OpHitObjectGetObjectRayDirectionEXT"; + case Op::OpHitObjectGetWorldRayDirectionEXT: return "OpHitObjectGetWorldRayDirectionEXT"; + case Op::OpHitObjectGetWorldRayOriginEXT: return "OpHitObjectGetWorldRayOriginEXT"; + case Op::OpHitObjectGetObjectToWorldEXT: return "OpHitObjectGetObjectToWorldEXT"; + case Op::OpHitObjectGetWorldToObjectEXT: return "OpHitObjectGetWorldToObjectEXT"; + case Op::OpHitObjectGetRayTMaxEXT: return "OpHitObjectGetRayTMaxEXT"; + case Op::OpReportIntersectionKHR: return "OpReportIntersectionKHR"; + case Op::OpIgnoreIntersectionNV: return "OpIgnoreIntersectionNV"; + case Op::OpTerminateRayNV: return "OpTerminateRayNV"; + case Op::OpTraceNV: return "OpTraceNV"; + case Op::OpTraceMotionNV: return "OpTraceMotionNV"; + case Op::OpTraceRayMotionNV: return "OpTraceRayMotionNV"; + case Op::OpRayQueryGetIntersectionTriangleVertexPositionsKHR: return "OpRayQueryGetIntersectionTriangleVertexPositionsKHR"; + case Op::OpTypeAccelerationStructureKHR: return "OpTypeAccelerationStructureKHR"; + case Op::OpExecuteCallableNV: return "OpExecuteCallableNV"; + case Op::OpRayQueryGetClusterIdNV: return "OpRayQueryGetClusterIdNV"; + case Op::OpHitObjectGetClusterIdNV: return "OpHitObjectGetClusterIdNV"; + case Op::OpHitObjectGetRayTMinEXT: return "OpHitObjectGetRayTMinEXT"; + case Op::OpHitObjectGetShaderBindingTableRecordIndexEXT: return "OpHitObjectGetShaderBindingTableRecordIndexEXT"; + case Op::OpHitObjectGetShaderRecordBufferHandleEXT: return "OpHitObjectGetShaderRecordBufferHandleEXT"; + case Op::OpHitObjectIsEmptyEXT: return "OpHitObjectIsEmptyEXT"; + case Op::OpHitObjectIsHitEXT: return "OpHitObjectIsHitEXT"; + case Op::OpHitObjectIsMissEXT: return "OpHitObjectIsMissEXT"; + case Op::OpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV"; + case Op::OpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV"; + case Op::OpCooperativeMatrixStoreNV: return "OpCooperativeMatrixStoreNV"; + case Op::OpCooperativeMatrixMulAddNV: return "OpCooperativeMatrixMulAddNV"; + case Op::OpCooperativeMatrixLengthNV: return "OpCooperativeMatrixLengthNV"; + case Op::OpBeginInvocationInterlockEXT: return "OpBeginInvocationInterlockEXT"; + case Op::OpEndInvocationInterlockEXT: return "OpEndInvocationInterlockEXT"; + case Op::OpCooperativeMatrixReduceNV: return "OpCooperativeMatrixReduceNV"; + case Op::OpCooperativeMatrixLoadTensorNV: return "OpCooperativeMatrixLoadTensorNV"; + case Op::OpCooperativeMatrixStoreTensorNV: return "OpCooperativeMatrixStoreTensorNV"; + case Op::OpCooperativeMatrixPerElementOpNV: return "OpCooperativeMatrixPerElementOpNV"; + case Op::OpTypeTensorLayoutNV: return "OpTypeTensorLayoutNV"; + case Op::OpTypeTensorViewNV: return "OpTypeTensorViewNV"; + case Op::OpCreateTensorLayoutNV: return "OpCreateTensorLayoutNV"; + case Op::OpTensorLayoutSetDimensionNV: return "OpTensorLayoutSetDimensionNV"; + case Op::OpTensorLayoutSetStrideNV: return "OpTensorLayoutSetStrideNV"; + case Op::OpTensorLayoutSliceNV: return "OpTensorLayoutSliceNV"; + case Op::OpTensorLayoutSetClampValueNV: return "OpTensorLayoutSetClampValueNV"; + case Op::OpCreateTensorViewNV: return "OpCreateTensorViewNV"; + case Op::OpTensorViewSetDimensionNV: return "OpTensorViewSetDimensionNV"; + case Op::OpTensorViewSetStrideNV: return "OpTensorViewSetStrideNV"; + case Op::OpDemoteToHelperInvocation: return "OpDemoteToHelperInvocation"; + case Op::OpIsHelperInvocationEXT: return "OpIsHelperInvocationEXT"; + case Op::OpTensorViewSetClipNV: return "OpTensorViewSetClipNV"; + case Op::OpTensorLayoutSetBlockSizeNV: return "OpTensorLayoutSetBlockSizeNV"; + case Op::OpCooperativeMatrixTransposeNV: return "OpCooperativeMatrixTransposeNV"; + case Op::OpConvertUToImageNV: return "OpConvertUToImageNV"; + case Op::OpConvertUToSamplerNV: return "OpConvertUToSamplerNV"; + case Op::OpConvertImageToUNV: return "OpConvertImageToUNV"; + case Op::OpConvertSamplerToUNV: return "OpConvertSamplerToUNV"; + case Op::OpConvertUToSampledImageNV: return "OpConvertUToSampledImageNV"; + case Op::OpConvertSampledImageToUNV: return "OpConvertSampledImageToUNV"; + case Op::OpSamplerImageAddressingModeNV: return "OpSamplerImageAddressingModeNV"; + case Op::OpRawAccessChainNV: return "OpRawAccessChainNV"; + case Op::OpRayQueryGetIntersectionSpherePositionNV: return "OpRayQueryGetIntersectionSpherePositionNV"; + case Op::OpRayQueryGetIntersectionSphereRadiusNV: return "OpRayQueryGetIntersectionSphereRadiusNV"; + case Op::OpRayQueryGetIntersectionLSSPositionsNV: return "OpRayQueryGetIntersectionLSSPositionsNV"; + case Op::OpRayQueryGetIntersectionLSSRadiiNV: return "OpRayQueryGetIntersectionLSSRadiiNV"; + case Op::OpRayQueryGetIntersectionLSSHitValueNV: return "OpRayQueryGetIntersectionLSSHitValueNV"; + case Op::OpHitObjectGetSpherePositionNV: return "OpHitObjectGetSpherePositionNV"; + case Op::OpHitObjectGetSphereRadiusNV: return "OpHitObjectGetSphereRadiusNV"; + case Op::OpHitObjectGetLSSPositionsNV: return "OpHitObjectGetLSSPositionsNV"; + case Op::OpHitObjectGetLSSRadiiNV: return "OpHitObjectGetLSSRadiiNV"; + case Op::OpHitObjectIsSphereHitNV: return "OpHitObjectIsSphereHitNV"; + case Op::OpHitObjectIsLSSHitNV: return "OpHitObjectIsLSSHitNV"; + case Op::OpRayQueryIsSphereHitNV: return "OpRayQueryIsSphereHitNV"; + case Op::OpRayQueryIsLSSHitNV: return "OpRayQueryIsLSSHitNV"; + case Op::OpSubgroupShuffleINTEL: return "OpSubgroupShuffleINTEL"; + case Op::OpSubgroupShuffleDownINTEL: return "OpSubgroupShuffleDownINTEL"; + case Op::OpSubgroupShuffleUpINTEL: return "OpSubgroupShuffleUpINTEL"; + case Op::OpSubgroupShuffleXorINTEL: return "OpSubgroupShuffleXorINTEL"; + case Op::OpSubgroupBlockReadINTEL: return "OpSubgroupBlockReadINTEL"; + case Op::OpSubgroupBlockWriteINTEL: return "OpSubgroupBlockWriteINTEL"; + case Op::OpSubgroupImageBlockReadINTEL: return "OpSubgroupImageBlockReadINTEL"; + case Op::OpSubgroupImageBlockWriteINTEL: return "OpSubgroupImageBlockWriteINTEL"; + case Op::OpSubgroupImageMediaBlockReadINTEL: return "OpSubgroupImageMediaBlockReadINTEL"; + case Op::OpSubgroupImageMediaBlockWriteINTEL: return "OpSubgroupImageMediaBlockWriteINTEL"; + case Op::OpUCountLeadingZerosINTEL: return "OpUCountLeadingZerosINTEL"; + case Op::OpUCountTrailingZerosINTEL: return "OpUCountTrailingZerosINTEL"; + case Op::OpAbsISubINTEL: return "OpAbsISubINTEL"; + case Op::OpAbsUSubINTEL: return "OpAbsUSubINTEL"; + case Op::OpIAddSatINTEL: return "OpIAddSatINTEL"; + case Op::OpUAddSatINTEL: return "OpUAddSatINTEL"; + case Op::OpIAverageINTEL: return "OpIAverageINTEL"; + case Op::OpUAverageINTEL: return "OpUAverageINTEL"; + case Op::OpIAverageRoundedINTEL: return "OpIAverageRoundedINTEL"; + case Op::OpUAverageRoundedINTEL: return "OpUAverageRoundedINTEL"; + case Op::OpISubSatINTEL: return "OpISubSatINTEL"; + case Op::OpUSubSatINTEL: return "OpUSubSatINTEL"; + case Op::OpIMul32x16INTEL: return "OpIMul32x16INTEL"; + case Op::OpUMul32x16INTEL: return "OpUMul32x16INTEL"; + case Op::OpConstantFunctionPointerINTEL: return "OpConstantFunctionPointerINTEL"; + case Op::OpFunctionPointerCallINTEL: return "OpFunctionPointerCallINTEL"; + case Op::OpAsmTargetINTEL: return "OpAsmTargetINTEL"; + case Op::OpAsmINTEL: return "OpAsmINTEL"; + case Op::OpAsmCallINTEL: return "OpAsmCallINTEL"; + case Op::OpAtomicFMinEXT: return "OpAtomicFMinEXT"; + case Op::OpAtomicFMaxEXT: return "OpAtomicFMaxEXT"; + case Op::OpAssumeTrueKHR: return "OpAssumeTrueKHR"; + case Op::OpExpectKHR: return "OpExpectKHR"; + case Op::OpDecorateString: return "OpDecorateString"; + case Op::OpMemberDecorateString: return "OpMemberDecorateString"; + case Op::OpVmeImageINTEL: return "OpVmeImageINTEL"; + case Op::OpTypeVmeImageINTEL: return "OpTypeVmeImageINTEL"; + case Op::OpTypeAvcImePayloadINTEL: return "OpTypeAvcImePayloadINTEL"; + case Op::OpTypeAvcRefPayloadINTEL: return "OpTypeAvcRefPayloadINTEL"; + case Op::OpTypeAvcSicPayloadINTEL: return "OpTypeAvcSicPayloadINTEL"; + case Op::OpTypeAvcMcePayloadINTEL: return "OpTypeAvcMcePayloadINTEL"; + case Op::OpTypeAvcMceResultINTEL: return "OpTypeAvcMceResultINTEL"; + case Op::OpTypeAvcImeResultINTEL: return "OpTypeAvcImeResultINTEL"; + case Op::OpTypeAvcImeResultSingleReferenceStreamoutINTEL: return "OpTypeAvcImeResultSingleReferenceStreamoutINTEL"; + case Op::OpTypeAvcImeResultDualReferenceStreamoutINTEL: return "OpTypeAvcImeResultDualReferenceStreamoutINTEL"; + case Op::OpTypeAvcImeSingleReferenceStreaminINTEL: return "OpTypeAvcImeSingleReferenceStreaminINTEL"; + case Op::OpTypeAvcImeDualReferenceStreaminINTEL: return "OpTypeAvcImeDualReferenceStreaminINTEL"; + case Op::OpTypeAvcRefResultINTEL: return "OpTypeAvcRefResultINTEL"; + case Op::OpTypeAvcSicResultINTEL: return "OpTypeAvcSicResultINTEL"; + case Op::OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL"; + case Op::OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL"; + case Op::OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL"; + case Op::OpSubgroupAvcMceSetInterShapePenaltyINTEL: return "OpSubgroupAvcMceSetInterShapePenaltyINTEL"; + case Op::OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL"; + case Op::OpSubgroupAvcMceSetInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceSetInterDirectionPenaltyINTEL"; + case Op::OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL"; + case Op::OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: return "OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL"; + case Op::OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL"; + case Op::OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL"; + case Op::OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL"; + case Op::OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: return "OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL"; + case Op::OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL"; + case Op::OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL"; + case Op::OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL"; + case Op::OpSubgroupAvcMceSetAcOnlyHaarINTEL: return "OpSubgroupAvcMceSetAcOnlyHaarINTEL"; + case Op::OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL"; + case Op::OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL"; + case Op::OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL"; + case Op::OpSubgroupAvcMceConvertToImePayloadINTEL: return "OpSubgroupAvcMceConvertToImePayloadINTEL"; + case Op::OpSubgroupAvcMceConvertToImeResultINTEL: return "OpSubgroupAvcMceConvertToImeResultINTEL"; + case Op::OpSubgroupAvcMceConvertToRefPayloadINTEL: return "OpSubgroupAvcMceConvertToRefPayloadINTEL"; + case Op::OpSubgroupAvcMceConvertToRefResultINTEL: return "OpSubgroupAvcMceConvertToRefResultINTEL"; + case Op::OpSubgroupAvcMceConvertToSicPayloadINTEL: return "OpSubgroupAvcMceConvertToSicPayloadINTEL"; + case Op::OpSubgroupAvcMceConvertToSicResultINTEL: return "OpSubgroupAvcMceConvertToSicResultINTEL"; + case Op::OpSubgroupAvcMceGetMotionVectorsINTEL: return "OpSubgroupAvcMceGetMotionVectorsINTEL"; + case Op::OpSubgroupAvcMceGetInterDistortionsINTEL: return "OpSubgroupAvcMceGetInterDistortionsINTEL"; + case Op::OpSubgroupAvcMceGetBestInterDistortionsINTEL: return "OpSubgroupAvcMceGetBestInterDistortionsINTEL"; + case Op::OpSubgroupAvcMceGetInterMajorShapeINTEL: return "OpSubgroupAvcMceGetInterMajorShapeINTEL"; + case Op::OpSubgroupAvcMceGetInterMinorShapeINTEL: return "OpSubgroupAvcMceGetInterMinorShapeINTEL"; + case Op::OpSubgroupAvcMceGetInterDirectionsINTEL: return "OpSubgroupAvcMceGetInterDirectionsINTEL"; + case Op::OpSubgroupAvcMceGetInterMotionVectorCountINTEL: return "OpSubgroupAvcMceGetInterMotionVectorCountINTEL"; + case Op::OpSubgroupAvcMceGetInterReferenceIdsINTEL: return "OpSubgroupAvcMceGetInterReferenceIdsINTEL"; + case Op::OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL"; + case Op::OpSubgroupAvcImeInitializeINTEL: return "OpSubgroupAvcImeInitializeINTEL"; + case Op::OpSubgroupAvcImeSetSingleReferenceINTEL: return "OpSubgroupAvcImeSetSingleReferenceINTEL"; + case Op::OpSubgroupAvcImeSetDualReferenceINTEL: return "OpSubgroupAvcImeSetDualReferenceINTEL"; + case Op::OpSubgroupAvcImeRefWindowSizeINTEL: return "OpSubgroupAvcImeRefWindowSizeINTEL"; + case Op::OpSubgroupAvcImeAdjustRefOffsetINTEL: return "OpSubgroupAvcImeAdjustRefOffsetINTEL"; + case Op::OpSubgroupAvcImeConvertToMcePayloadINTEL: return "OpSubgroupAvcImeConvertToMcePayloadINTEL"; + case Op::OpSubgroupAvcImeSetMaxMotionVectorCountINTEL: return "OpSubgroupAvcImeSetMaxMotionVectorCountINTEL"; + case Op::OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: return "OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL"; + case Op::OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: return "OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL"; + case Op::OpSubgroupAvcImeSetWeightedSadINTEL: return "OpSubgroupAvcImeSetWeightedSadINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL"; + case Op::OpSubgroupAvcImeConvertToMceResultINTEL: return "OpSubgroupAvcImeConvertToMceResultINTEL"; + case Op::OpSubgroupAvcImeGetSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeGetSingleReferenceStreaminINTEL"; + case Op::OpSubgroupAvcImeGetDualReferenceStreaminINTEL: return "OpSubgroupAvcImeGetDualReferenceStreaminINTEL"; + case Op::OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL"; + case Op::OpSubgroupAvcImeStripDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripDualReferenceStreamoutINTEL"; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL"; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL"; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL"; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL"; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL"; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL"; + case Op::OpSubgroupAvcImeGetBorderReachedINTEL: return "OpSubgroupAvcImeGetBorderReachedINTEL"; + case Op::OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: return "OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL"; + case Op::OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: return "OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL"; + case Op::OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL"; + case Op::OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL"; + case Op::OpSubgroupAvcFmeInitializeINTEL: return "OpSubgroupAvcFmeInitializeINTEL"; + case Op::OpSubgroupAvcBmeInitializeINTEL: return "OpSubgroupAvcBmeInitializeINTEL"; + case Op::OpSubgroupAvcRefConvertToMcePayloadINTEL: return "OpSubgroupAvcRefConvertToMcePayloadINTEL"; + case Op::OpSubgroupAvcRefSetBidirectionalMixDisableINTEL: return "OpSubgroupAvcRefSetBidirectionalMixDisableINTEL"; + case Op::OpSubgroupAvcRefSetBilinearFilterEnableINTEL: return "OpSubgroupAvcRefSetBilinearFilterEnableINTEL"; + case Op::OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL"; + case Op::OpSubgroupAvcRefEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithDualReferenceINTEL"; + case Op::OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL"; + case Op::OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL"; + case Op::OpSubgroupAvcRefConvertToMceResultINTEL: return "OpSubgroupAvcRefConvertToMceResultINTEL"; + case Op::OpSubgroupAvcSicInitializeINTEL: return "OpSubgroupAvcSicInitializeINTEL"; + case Op::OpSubgroupAvcSicConfigureSkcINTEL: return "OpSubgroupAvcSicConfigureSkcINTEL"; + case Op::OpSubgroupAvcSicConfigureIpeLumaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaINTEL"; + case Op::OpSubgroupAvcSicConfigureIpeLumaChromaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaChromaINTEL"; + case Op::OpSubgroupAvcSicGetMotionVectorMaskINTEL: return "OpSubgroupAvcSicGetMotionVectorMaskINTEL"; + case Op::OpSubgroupAvcSicConvertToMcePayloadINTEL: return "OpSubgroupAvcSicConvertToMcePayloadINTEL"; + case Op::OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL"; + case Op::OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL"; + case Op::OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL"; + case Op::OpSubgroupAvcSicSetBilinearFilterEnableINTEL: return "OpSubgroupAvcSicSetBilinearFilterEnableINTEL"; + case Op::OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: return "OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL"; + case Op::OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: return "OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL"; + case Op::OpSubgroupAvcSicEvaluateIpeINTEL: return "OpSubgroupAvcSicEvaluateIpeINTEL"; + case Op::OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL"; + case Op::OpSubgroupAvcSicEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithDualReferenceINTEL"; + case Op::OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL"; + case Op::OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL"; + case Op::OpSubgroupAvcSicConvertToMceResultINTEL: return "OpSubgroupAvcSicConvertToMceResultINTEL"; + case Op::OpSubgroupAvcSicGetIpeLumaShapeINTEL: return "OpSubgroupAvcSicGetIpeLumaShapeINTEL"; + case Op::OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL"; + case Op::OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL"; + case Op::OpSubgroupAvcSicGetPackedIpeLumaModesINTEL: return "OpSubgroupAvcSicGetPackedIpeLumaModesINTEL"; + case Op::OpSubgroupAvcSicGetIpeChromaModeINTEL: return "OpSubgroupAvcSicGetIpeChromaModeINTEL"; + case Op::OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL"; + case Op::OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL"; + case Op::OpSubgroupAvcSicGetInterRawSadsINTEL: return "OpSubgroupAvcSicGetInterRawSadsINTEL"; + case Op::OpVariableLengthArrayINTEL: return "OpVariableLengthArrayINTEL"; + case Op::OpSaveMemoryINTEL: return "OpSaveMemoryINTEL"; + case Op::OpRestoreMemoryINTEL: return "OpRestoreMemoryINTEL"; + case Op::OpArbitraryFloatSinCosPiINTEL: return "OpArbitraryFloatSinCosPiINTEL"; + case Op::OpArbitraryFloatCastINTEL: return "OpArbitraryFloatCastINTEL"; + case Op::OpArbitraryFloatCastFromIntINTEL: return "OpArbitraryFloatCastFromIntINTEL"; + case Op::OpArbitraryFloatCastToIntINTEL: return "OpArbitraryFloatCastToIntINTEL"; + case Op::OpArbitraryFloatAddINTEL: return "OpArbitraryFloatAddINTEL"; + case Op::OpArbitraryFloatSubINTEL: return "OpArbitraryFloatSubINTEL"; + case Op::OpArbitraryFloatMulINTEL: return "OpArbitraryFloatMulINTEL"; + case Op::OpArbitraryFloatDivINTEL: return "OpArbitraryFloatDivINTEL"; + case Op::OpArbitraryFloatGTINTEL: return "OpArbitraryFloatGTINTEL"; + case Op::OpArbitraryFloatGEINTEL: return "OpArbitraryFloatGEINTEL"; + case Op::OpArbitraryFloatLTINTEL: return "OpArbitraryFloatLTINTEL"; + case Op::OpArbitraryFloatLEINTEL: return "OpArbitraryFloatLEINTEL"; + case Op::OpArbitraryFloatEQINTEL: return "OpArbitraryFloatEQINTEL"; + case Op::OpArbitraryFloatRecipINTEL: return "OpArbitraryFloatRecipINTEL"; + case Op::OpArbitraryFloatRSqrtINTEL: return "OpArbitraryFloatRSqrtINTEL"; + case Op::OpArbitraryFloatCbrtINTEL: return "OpArbitraryFloatCbrtINTEL"; + case Op::OpArbitraryFloatHypotINTEL: return "OpArbitraryFloatHypotINTEL"; + case Op::OpArbitraryFloatSqrtINTEL: return "OpArbitraryFloatSqrtINTEL"; + case Op::OpArbitraryFloatLogINTEL: return "OpArbitraryFloatLogINTEL"; + case Op::OpArbitraryFloatLog2INTEL: return "OpArbitraryFloatLog2INTEL"; + case Op::OpArbitraryFloatLog10INTEL: return "OpArbitraryFloatLog10INTEL"; + case Op::OpArbitraryFloatLog1pINTEL: return "OpArbitraryFloatLog1pINTEL"; + case Op::OpArbitraryFloatExpINTEL: return "OpArbitraryFloatExpINTEL"; + case Op::OpArbitraryFloatExp2INTEL: return "OpArbitraryFloatExp2INTEL"; + case Op::OpArbitraryFloatExp10INTEL: return "OpArbitraryFloatExp10INTEL"; + case Op::OpArbitraryFloatExpm1INTEL: return "OpArbitraryFloatExpm1INTEL"; + case Op::OpArbitraryFloatSinINTEL: return "OpArbitraryFloatSinINTEL"; + case Op::OpArbitraryFloatCosINTEL: return "OpArbitraryFloatCosINTEL"; + case Op::OpArbitraryFloatSinCosINTEL: return "OpArbitraryFloatSinCosINTEL"; + case Op::OpArbitraryFloatSinPiINTEL: return "OpArbitraryFloatSinPiINTEL"; + case Op::OpArbitraryFloatCosPiINTEL: return "OpArbitraryFloatCosPiINTEL"; + case Op::OpArbitraryFloatASinINTEL: return "OpArbitraryFloatASinINTEL"; + case Op::OpArbitraryFloatASinPiINTEL: return "OpArbitraryFloatASinPiINTEL"; + case Op::OpArbitraryFloatACosINTEL: return "OpArbitraryFloatACosINTEL"; + case Op::OpArbitraryFloatACosPiINTEL: return "OpArbitraryFloatACosPiINTEL"; + case Op::OpArbitraryFloatATanINTEL: return "OpArbitraryFloatATanINTEL"; + case Op::OpArbitraryFloatATanPiINTEL: return "OpArbitraryFloatATanPiINTEL"; + case Op::OpArbitraryFloatATan2INTEL: return "OpArbitraryFloatATan2INTEL"; + case Op::OpArbitraryFloatPowINTEL: return "OpArbitraryFloatPowINTEL"; + case Op::OpArbitraryFloatPowRINTEL: return "OpArbitraryFloatPowRINTEL"; + case Op::OpArbitraryFloatPowNINTEL: return "OpArbitraryFloatPowNINTEL"; + case Op::OpLoopControlINTEL: return "OpLoopControlINTEL"; + case Op::OpAliasDomainDeclINTEL: return "OpAliasDomainDeclINTEL"; + case Op::OpAliasScopeDeclINTEL: return "OpAliasScopeDeclINTEL"; + case Op::OpAliasScopeListDeclINTEL: return "OpAliasScopeListDeclINTEL"; + case Op::OpFixedSqrtINTEL: return "OpFixedSqrtINTEL"; + case Op::OpFixedRecipINTEL: return "OpFixedRecipINTEL"; + case Op::OpFixedRsqrtINTEL: return "OpFixedRsqrtINTEL"; + case Op::OpFixedSinINTEL: return "OpFixedSinINTEL"; + case Op::OpFixedCosINTEL: return "OpFixedCosINTEL"; + case Op::OpFixedSinCosINTEL: return "OpFixedSinCosINTEL"; + case Op::OpFixedSinPiINTEL: return "OpFixedSinPiINTEL"; + case Op::OpFixedCosPiINTEL: return "OpFixedCosPiINTEL"; + case Op::OpFixedSinCosPiINTEL: return "OpFixedSinCosPiINTEL"; + case Op::OpFixedLogINTEL: return "OpFixedLogINTEL"; + case Op::OpFixedExpINTEL: return "OpFixedExpINTEL"; + case Op::OpPtrCastToCrossWorkgroupINTEL: return "OpPtrCastToCrossWorkgroupINTEL"; + case Op::OpCrossWorkgroupCastToPtrINTEL: return "OpCrossWorkgroupCastToPtrINTEL"; + case Op::OpReadPipeBlockingINTEL: return "OpReadPipeBlockingINTEL"; + case Op::OpWritePipeBlockingINTEL: return "OpWritePipeBlockingINTEL"; + case Op::OpFPGARegINTEL: return "OpFPGARegINTEL"; + case Op::OpRayQueryGetRayTMinKHR: return "OpRayQueryGetRayTMinKHR"; + case Op::OpRayQueryGetRayFlagsKHR: return "OpRayQueryGetRayFlagsKHR"; + case Op::OpRayQueryGetIntersectionTKHR: return "OpRayQueryGetIntersectionTKHR"; + case Op::OpRayQueryGetIntersectionInstanceCustomIndexKHR: return "OpRayQueryGetIntersectionInstanceCustomIndexKHR"; + case Op::OpRayQueryGetIntersectionInstanceIdKHR: return "OpRayQueryGetIntersectionInstanceIdKHR"; + case Op::OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: return "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR"; + case Op::OpRayQueryGetIntersectionGeometryIndexKHR: return "OpRayQueryGetIntersectionGeometryIndexKHR"; + case Op::OpRayQueryGetIntersectionPrimitiveIndexKHR: return "OpRayQueryGetIntersectionPrimitiveIndexKHR"; + case Op::OpRayQueryGetIntersectionBarycentricsKHR: return "OpRayQueryGetIntersectionBarycentricsKHR"; + case Op::OpRayQueryGetIntersectionFrontFaceKHR: return "OpRayQueryGetIntersectionFrontFaceKHR"; + case Op::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: return "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR"; + case Op::OpRayQueryGetIntersectionObjectRayDirectionKHR: return "OpRayQueryGetIntersectionObjectRayDirectionKHR"; + case Op::OpRayQueryGetIntersectionObjectRayOriginKHR: return "OpRayQueryGetIntersectionObjectRayOriginKHR"; + case Op::OpRayQueryGetWorldRayDirectionKHR: return "OpRayQueryGetWorldRayDirectionKHR"; + case Op::OpRayQueryGetWorldRayOriginKHR: return "OpRayQueryGetWorldRayOriginKHR"; + case Op::OpRayQueryGetIntersectionObjectToWorldKHR: return "OpRayQueryGetIntersectionObjectToWorldKHR"; + case Op::OpRayQueryGetIntersectionWorldToObjectKHR: return "OpRayQueryGetIntersectionWorldToObjectKHR"; + case Op::OpAtomicFAddEXT: return "OpAtomicFAddEXT"; + case Op::OpTypeBufferSurfaceINTEL: return "OpTypeBufferSurfaceINTEL"; + case Op::OpTypeStructContinuedINTEL: return "OpTypeStructContinuedINTEL"; + case Op::OpConstantCompositeContinuedINTEL: return "OpConstantCompositeContinuedINTEL"; + case Op::OpSpecConstantCompositeContinuedINTEL: return "OpSpecConstantCompositeContinuedINTEL"; + case Op::OpCompositeConstructContinuedINTEL: return "OpCompositeConstructContinuedINTEL"; + case Op::OpConvertFToBF16INTEL: return "OpConvertFToBF16INTEL"; + case Op::OpConvertBF16ToFINTEL: return "OpConvertBF16ToFINTEL"; + case Op::OpControlBarrierArriveINTEL: return "OpControlBarrierArriveINTEL"; + case Op::OpControlBarrierWaitINTEL: return "OpControlBarrierWaitINTEL"; + case Op::OpArithmeticFenceEXT: return "OpArithmeticFenceEXT"; + case Op::OpSubgroupBlockPrefetchINTEL: return "OpSubgroupBlockPrefetchINTEL"; + case Op::OpSubgroup2DBlockLoadINTEL: return "OpSubgroup2DBlockLoadINTEL"; + case Op::OpSubgroup2DBlockLoadTransformINTEL: return "OpSubgroup2DBlockLoadTransformINTEL"; + case Op::OpSubgroup2DBlockLoadTransposeINTEL: return "OpSubgroup2DBlockLoadTransposeINTEL"; + case Op::OpSubgroup2DBlockPrefetchINTEL: return "OpSubgroup2DBlockPrefetchINTEL"; + case Op::OpSubgroup2DBlockStoreINTEL: return "OpSubgroup2DBlockStoreINTEL"; + case Op::OpSubgroupMatrixMultiplyAccumulateINTEL: return "OpSubgroupMatrixMultiplyAccumulateINTEL"; + case Op::OpGroupIMulKHR: return "OpGroupIMulKHR"; + case Op::OpGroupFMulKHR: return "OpGroupFMulKHR"; + case Op::OpGroupBitwiseAndKHR: return "OpGroupBitwiseAndKHR"; + case Op::OpGroupBitwiseOrKHR: return "OpGroupBitwiseOrKHR"; + case Op::OpGroupBitwiseXorKHR: return "OpGroupBitwiseXorKHR"; + case Op::OpGroupLogicalAndKHR: return "OpGroupLogicalAndKHR"; + case Op::OpGroupLogicalOrKHR: return "OpGroupLogicalOrKHR"; + case Op::OpGroupLogicalXorKHR: return "OpGroupLogicalXorKHR"; + case Op::OpMaskedGatherINTEL: return "OpMaskedGatherINTEL"; + case Op::OpMaskedScatterINTEL: return "OpMaskedScatterINTEL"; + default: return "Unknown"; + } +} + +#endif /* SPV_ENABLE_UTILITY_CODE */ + +// Overload bitwise operators for mask bit combining + +constexpr ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +constexpr ImageOperandsMask operator&(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) & unsigned(b)); } +constexpr ImageOperandsMask operator^(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr ImageOperandsMask operator~(ImageOperandsMask a) { return ImageOperandsMask(~unsigned(a)); } +constexpr FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +constexpr FPFastMathModeMask operator&(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) & unsigned(b)); } +constexpr FPFastMathModeMask operator^(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) ^ unsigned(b)); } +constexpr FPFastMathModeMask operator~(FPFastMathModeMask a) { return FPFastMathModeMask(~unsigned(a)); } +constexpr SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +constexpr SelectionControlMask operator&(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) & unsigned(b)); } +constexpr SelectionControlMask operator^(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) ^ unsigned(b)); } +constexpr SelectionControlMask operator~(SelectionControlMask a) { return SelectionControlMask(~unsigned(a)); } +constexpr LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +constexpr LoopControlMask operator&(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) & unsigned(b)); } +constexpr LoopControlMask operator^(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) ^ unsigned(b)); } +constexpr LoopControlMask operator~(LoopControlMask a) { return LoopControlMask(~unsigned(a)); } +constexpr FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +constexpr FunctionControlMask operator&(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) & unsigned(b)); } +constexpr FunctionControlMask operator^(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) ^ unsigned(b)); } +constexpr FunctionControlMask operator~(FunctionControlMask a) { return FunctionControlMask(~unsigned(a)); } +constexpr MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +constexpr MemorySemanticsMask operator&(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) & unsigned(b)); } +constexpr MemorySemanticsMask operator^(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) ^ unsigned(b)); } +constexpr MemorySemanticsMask operator~(MemorySemanticsMask a) { return MemorySemanticsMask(~unsigned(a)); } +constexpr MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +constexpr MemoryAccessMask operator&(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) & unsigned(b)); } +constexpr MemoryAccessMask operator^(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) ^ unsigned(b)); } +constexpr MemoryAccessMask operator~(MemoryAccessMask a) { return MemoryAccessMask(~unsigned(a)); } +constexpr KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } +constexpr KernelProfilingInfoMask operator&(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) & unsigned(b)); } +constexpr KernelProfilingInfoMask operator^(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) ^ unsigned(b)); } +constexpr KernelProfilingInfoMask operator~(KernelProfilingInfoMask a) { return KernelProfilingInfoMask(~unsigned(a)); } +constexpr RayFlagsMask operator|(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) | unsigned(b)); } +constexpr RayFlagsMask operator&(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) & unsigned(b)); } +constexpr RayFlagsMask operator^(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) ^ unsigned(b)); } +constexpr RayFlagsMask operator~(RayFlagsMask a) { return RayFlagsMask(~unsigned(a)); } +constexpr FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) | unsigned(b)); } +constexpr FragmentShadingRateMask operator&(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) & unsigned(b)); } +constexpr FragmentShadingRateMask operator^(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) ^ unsigned(b)); } +constexpr FragmentShadingRateMask operator~(FragmentShadingRateMask a) { return FragmentShadingRateMask(~unsigned(a)); } +constexpr CooperativeMatrixOperandsMask operator|(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) | unsigned(b)); } +constexpr CooperativeMatrixOperandsMask operator&(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) & unsigned(b)); } +constexpr CooperativeMatrixOperandsMask operator^(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr CooperativeMatrixOperandsMask operator~(CooperativeMatrixOperandsMask a) { return CooperativeMatrixOperandsMask(~unsigned(a)); } +constexpr CooperativeMatrixReduceMask operator|(CooperativeMatrixReduceMask a, CooperativeMatrixReduceMask b) { return CooperativeMatrixReduceMask(unsigned(a) | unsigned(b)); } +constexpr CooperativeMatrixReduceMask operator&(CooperativeMatrixReduceMask a, CooperativeMatrixReduceMask b) { return CooperativeMatrixReduceMask(unsigned(a) & unsigned(b)); } +constexpr CooperativeMatrixReduceMask operator^(CooperativeMatrixReduceMask a, CooperativeMatrixReduceMask b) { return CooperativeMatrixReduceMask(unsigned(a) ^ unsigned(b)); } +constexpr CooperativeMatrixReduceMask operator~(CooperativeMatrixReduceMask a) { return CooperativeMatrixReduceMask(~unsigned(a)); } +constexpr TensorAddressingOperandsMask operator|(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) | unsigned(b)); } +constexpr TensorAddressingOperandsMask operator&(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) & unsigned(b)); } +constexpr TensorAddressingOperandsMask operator^(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr TensorAddressingOperandsMask operator~(TensorAddressingOperandsMask a) { return TensorAddressingOperandsMask(~unsigned(a)); } +constexpr TensorOperandsMask operator|(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) | unsigned(b)); } +constexpr TensorOperandsMask operator&(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) & unsigned(b)); } +constexpr TensorOperandsMask operator^(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr TensorOperandsMask operator~(TensorOperandsMask a) { return TensorOperandsMask(~unsigned(a)); } +constexpr MatrixMultiplyAccumulateOperandsMask operator|(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) | unsigned(b)); } +constexpr MatrixMultiplyAccumulateOperandsMask operator&(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) & unsigned(b)); } +constexpr MatrixMultiplyAccumulateOperandsMask operator^(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr MatrixMultiplyAccumulateOperandsMask operator~(MatrixMultiplyAccumulateOperandsMask a) { return MatrixMultiplyAccumulateOperandsMask(~unsigned(a)); } +constexpr RawAccessChainOperandsMask operator|(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) | unsigned(b)); } +constexpr RawAccessChainOperandsMask operator&(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) & unsigned(b)); } +constexpr RawAccessChainOperandsMask operator^(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr RawAccessChainOperandsMask operator~(RawAccessChainOperandsMask a) { return RawAccessChainOperandsMask(~unsigned(a)); } + +} // end namespace spv + +#endif // #ifndef spirv_HPP + diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/spvIR.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/spvIR.h new file mode 100755 index 0000000000..f1039cfdb3 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/spvIR.h @@ -0,0 +1,657 @@ +// +// Copyright (C) 2014 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// SPIRV-IR +// +// Simple in-memory representation (IR) of SPIRV. Just for holding +// Each function's CFG of blocks. Has this hierarchy: +// - Module, which is a list of +// - Function, which is a list of +// - Block, which is a list of +// - Instruction +// + +#pragma once +#ifndef spvIR_H +#define spvIR_H + +#include "spirv.hpp11" + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace spv { + +class Block; +class Function; +class Module; + +const Id NoResult = 0; +const Id NoType = 0; + +const Decoration NoPrecision = Decoration::Max; + +#ifdef __GNUC__ +# define POTENTIALLY_UNUSED __attribute__((unused)) +#else +# define POTENTIALLY_UNUSED +#endif + +POTENTIALLY_UNUSED +const MemorySemanticsMask MemorySemanticsAllMemory = + (MemorySemanticsMask)(MemorySemanticsMask::UniformMemory | + MemorySemanticsMask::WorkgroupMemory | + MemorySemanticsMask::AtomicCounterMemory | + MemorySemanticsMask::ImageMemory); + +struct IdImmediate { + bool isId; // true if word is an Id, false if word is an immediate + unsigned word; + IdImmediate(bool i, unsigned w) : isId(i), word(w) {} + IdImmediate(bool i, spv::MemoryAccessMask w) : isId(i), word((unsigned)w) {} + IdImmediate(bool i, spv::TensorAddressingOperandsMask w) : isId(i), word((unsigned)w) {} + IdImmediate(bool i, spv::ImageOperandsMask w) : isId(i), word((unsigned)w) {} + IdImmediate(bool i, spv::CooperativeMatrixOperandsMask w) : isId(i), word((unsigned)w) {} +}; + +// +// SPIR-V IR instruction. +// + +class Instruction { +public: + Instruction(Id resultId, Id typeId, Op opCode) : resultId(resultId), typeId(typeId), opCode(opCode), block(nullptr) { } + explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode), block(nullptr) { } + virtual ~Instruction() {} + void reserveOperands(size_t count) { + operands.reserve(count); + idOperand.reserve(count); + } + void addIdOperand(Id id) { + // ids can't be 0 + assert(id); + operands.push_back(id); + idOperand.push_back(true); + } + // This method is potentially dangerous as it can break assumptions + // about SSA and lack of forward references. + void setIdOperand(unsigned idx, Id id) { + assert(id); + assert(idOperand[idx]); + operands[idx] = id; + } + + void addImmediateOperand(unsigned int immediate) { + operands.push_back(immediate); + idOperand.push_back(false); + } + + void addImmediateOperand(spv::StorageClass immediate) { + addImmediateOperand((unsigned)immediate); + } + + void addImmediateOperand(spv::ExecutionMode immediate) { + addImmediateOperand((unsigned)immediate); + } + + void addImmediateOperand(spv::ExecutionModel immediate) { + addImmediateOperand((unsigned)immediate); + } + + void addImmediateOperand(spv::Decoration immediate) { + addImmediateOperand((unsigned)immediate); + } + + void addImmediateOperand(spv::LinkageType immediate) { + addImmediateOperand((unsigned)immediate); + } + + void addImmediateOperand(spv::MemoryAccessMask immediate) { + addImmediateOperand((unsigned)immediate); + } + + void addImmediateOperand(spv::Capability immediate) { + addImmediateOperand((unsigned)immediate); + } + + void addImmediateOperand(spv::AddressingModel immediate) { + addImmediateOperand((unsigned)immediate); + } + + void addImmediateOperand(spv::MemoryModel immediate) { + addImmediateOperand((unsigned)immediate); + } + + void addImmediateOperand(spv::FPEncoding immediate) { + addImmediateOperand((unsigned)immediate); + } + + void addImmediateOperand(spv::SourceLanguage immediate) { + addImmediateOperand((unsigned)immediate); + } + + void addImmediateOperand(spv::Dim immediate) { + addImmediateOperand((unsigned)immediate); + } + + void addImmediateOperand(spv::FunctionControlMask immediate){ + addImmediateOperand((unsigned)immediate); + } + + void addImmediateOperand(spv::SelectionControlMask immediate) { + addImmediateOperand((unsigned)immediate); + } + + void addImmediateOperand(spv::LoopControlMask immediate) { + addImmediateOperand((unsigned)immediate); + } + + void setImmediateOperand(unsigned idx, unsigned int immediate) { + assert(!idOperand[idx]); + operands[idx] = immediate; + } + + void addStringOperand(const char* str) + { + unsigned int word = 0; + unsigned int shiftAmount = 0; + unsigned char c; + + do { + c = *(str++); + word |= ((unsigned int)c) << shiftAmount; + shiftAmount += 8; + if (shiftAmount == 32) { + addImmediateOperand(word); + word = 0; + shiftAmount = 0; + } + } while (c != 0); + + // deal with partial last word + if (shiftAmount > 0) { + addImmediateOperand(word); + } + } + bool isIdOperand(int op) const { return idOperand[op]; } + void setBlock(Block* b) { block = b; } + Block* getBlock() const { return block; } + Op getOpCode() const { return opCode; } + int getNumOperands() const + { + assert(operands.size() == idOperand.size()); + return (int)operands.size(); + } + Id getResultId() const { return resultId; } + Id getTypeId() const { return typeId; } + Id getIdOperand(int op) const { + assert(idOperand[op]); + return operands[op]; + } + unsigned int getImmediateOperand(int op) const { + assert(!idOperand[op]); + return operands[op]; + } + + // Write out the binary form. + void dump(std::vector& out) const + { + // Compute the wordCount + unsigned int wordCount = 1; + if (typeId) + ++wordCount; + if (resultId) + ++wordCount; + wordCount += (unsigned int)operands.size(); + + // Write out the beginning of the instruction + out.push_back(((wordCount) << WordCountShift) | (unsigned)opCode); + if (typeId) + out.push_back(typeId); + if (resultId) + out.push_back(resultId); + + // Write out the operands + for (int op = 0; op < (int)operands.size(); ++op) + out.push_back(operands[op]); + } + + const char *getNameString() const { + if (opCode == Op::OpString) { + return (const char *)&operands[0]; + } else { + assert(opCode == Op::OpName); + return (const char *)&operands[1]; + } + } + +protected: + Instruction(const Instruction&); + Id resultId; + Id typeId; + Op opCode; + std::vector operands; // operands, both and immediates (both are unsigned int) + std::vector idOperand; // true for operands that are , false for immediates + Block* block; +}; + +// +// SPIR-V IR block. +// + +struct DebugSourceLocation { + int line; + int column; + spv::Id fileId; +}; + +class Block { +public: + Block(Id id, Function& parent); + virtual ~Block() + { + } + + Id getId() { return instructions.front()->getResultId(); } + + Function& getParent() const { return parent; } + // Returns true if the source location is actually updated. + // Note we still need the builder to insert the line marker instruction. This is just a tracker. + bool updateDebugSourceLocation(int line, int column, spv::Id fileId) { + if (currentSourceLoc && currentSourceLoc->line == line && currentSourceLoc->column == column && + currentSourceLoc->fileId == fileId) { + return false; + } + + currentSourceLoc = DebugSourceLocation{line, column, fileId}; + return true; + } + // Returns true if the scope is actually updated. + // Note we still need the builder to insert the debug scope instruction. This is just a tracker. + bool updateDebugScope(spv::Id scopeId) { + assert(scopeId); + if (currentDebugScope && *currentDebugScope == scopeId) { + return false; + } + + currentDebugScope = scopeId; + return true; + } + void addInstruction(std::unique_ptr inst); + void addPredecessor(Block* pred) { predecessors.push_back(pred); pred->successors.push_back(this);} + void addLocalVariable(std::unique_ptr inst) { localVariables.push_back(std::move(inst)); } + const std::vector& getPredecessors() const { return predecessors; } + const std::vector& getSuccessors() const { return successors; } + std::vector >& getInstructions() { + return instructions; + } + const std::vector >& getLocalVariables() const { return localVariables; } + void setUnreachable() { unreachable = true; } + bool isUnreachable() const { return unreachable; } + // Returns the block's merge instruction, if one exists (otherwise null). + const Instruction* getMergeInstruction() const { + if (instructions.size() < 2) return nullptr; + const Instruction* nextToLast = (instructions.cend() - 2)->get(); + switch (nextToLast->getOpCode()) { + case Op::OpSelectionMerge: + case Op::OpLoopMerge: + return nextToLast; + default: + return nullptr; + } + return nullptr; + } + + // Change this block into a canonical dead merge block. Delete instructions + // as necessary. A canonical dead merge block has only an OpLabel and an + // OpUnreachable. + void rewriteAsCanonicalUnreachableMerge() { + assert(localVariables.empty()); + // Delete all instructions except for the label. + assert(instructions.size() > 0); + instructions.resize(1); + successors.clear(); + addInstruction(std::unique_ptr(new Instruction(Op::OpUnreachable))); + } + // Change this block into a canonical dead continue target branching to the + // given header ID. Delete instructions as necessary. A canonical dead continue + // target has only an OpLabel and an unconditional branch back to the corresponding + // header. + void rewriteAsCanonicalUnreachableContinue(Block* header) { + assert(localVariables.empty()); + // Delete all instructions except for the label. + assert(instructions.size() > 0); + instructions.resize(1); + successors.clear(); + // Add OpBranch back to the header. + assert(header != nullptr); + Instruction* branch = new Instruction(Op::OpBranch); + branch->addIdOperand(header->getId()); + addInstruction(std::unique_ptr(branch)); + successors.push_back(header); + } + + bool isTerminated() const + { + switch (instructions.back()->getOpCode()) { + case Op::OpBranch: + case Op::OpBranchConditional: + case Op::OpSwitch: + case Op::OpKill: + case Op::OpTerminateInvocation: + case Op::OpReturn: + case Op::OpReturnValue: + case Op::OpUnreachable: + return true; + default: + return false; + } + } + + void dump(std::vector& out) const + { + instructions[0]->dump(out); + for (int i = 0; i < (int)localVariables.size(); ++i) + localVariables[i]->dump(out); + for (int i = 1; i < (int)instructions.size(); ++i) + instructions[i]->dump(out); + } + +protected: + Block(const Block&); + Block& operator=(Block&); + + // To enforce keeping parent and ownership in sync: + friend Function; + + std::vector > instructions; + std::vector predecessors, successors; + std::vector > localVariables; + Function& parent; + + // Track source location of the last source location marker instruction. + std::optional currentSourceLoc; + + // Track scope of the last debug scope instruction. + std::optional currentDebugScope; + + // track whether this block is known to be uncreachable (not necessarily + // true for all unreachable blocks, but should be set at least + // for the extraneous ones introduced by the builder). + bool unreachable; +}; + +// The different reasons for reaching a block in the inReadableOrder traversal. +enum ReachReason { + // Reachable from the entry block via transfers of control, i.e. branches. + ReachViaControlFlow = 0, + // A continue target that is not reachable via control flow. + ReachDeadContinue, + // A merge block that is not reachable via control flow. + ReachDeadMerge +}; + +// Traverses the control-flow graph rooted at root in an order suited for +// readable code generation. Invokes callback at every node in the traversal +// order. The callback arguments are: +// - the block, +// - the reason we reached the block, +// - if the reason was that block is an unreachable continue or unreachable merge block +// then the last parameter is the corresponding header block. +void inReadableOrder(Block* root, std::function callback); + +// +// SPIR-V IR Function. +// + +class Function { +public: + Function(Id id, Id resultType, Id functionType, Id firstParam, LinkageType linkage, const std::string& name, Module& parent); + virtual ~Function() + { + for (int i = 0; i < (int)parameterInstructions.size(); ++i) + delete parameterInstructions[i]; + + for (int i = 0; i < (int)blocks.size(); ++i) + delete blocks[i]; + } + Id getId() const { return functionInstruction.getResultId(); } + Id getParamId(int p) const { return parameterInstructions[p]->getResultId(); } + Id getParamType(int p) const { return parameterInstructions[p]->getTypeId(); } + + void addBlock(Block* block) { blocks.push_back(block); } + void removeBlock(Block* block) + { + auto found = find(blocks.begin(), blocks.end(), block); + assert(found != blocks.end()); + blocks.erase(found); + delete block; + } + + Module& getParent() const { return parent; } + Block* getEntryBlock() const { return blocks.front(); } + Block* getLastBlock() const { return blocks.back(); } + const std::vector& getBlocks() const { return blocks; } + void addLocalVariable(std::unique_ptr inst); + Id getReturnType() const { return functionInstruction.getTypeId(); } + Id getFuncId() const { return functionInstruction.getResultId(); } + Id getFuncTypeId() const { return functionInstruction.getIdOperand(1); } + void setReturnPrecision(Decoration precision) + { + if (precision == Decoration::RelaxedPrecision) + reducedPrecisionReturn = true; + } + Decoration getReturnPrecision() const + { return reducedPrecisionReturn ? Decoration::RelaxedPrecision : NoPrecision; } + + void setDebugLineInfo(Id fileName, int line, int column) { + lineInstruction = std::unique_ptr{new Instruction(Op::OpLine)}; + lineInstruction->reserveOperands(3); + lineInstruction->addIdOperand(fileName); + lineInstruction->addImmediateOperand(line); + lineInstruction->addImmediateOperand(column); + } + bool hasDebugLineInfo() const { return lineInstruction != nullptr; } + + void setImplicitThis() { implicitThis = true; } + bool hasImplicitThis() const { return implicitThis; } + + void addParamPrecision(unsigned param, Decoration precision) + { + if (precision == Decoration::RelaxedPrecision) + reducedPrecisionParams.insert(param); + } + Decoration getParamPrecision(unsigned param) const + { + return reducedPrecisionParams.find(param) != reducedPrecisionParams.end() ? + Decoration::RelaxedPrecision : NoPrecision; + } + + void dump(std::vector& out) const + { + // OpLine + if (lineInstruction != nullptr) { + lineInstruction->dump(out); + } + + // OpFunction + functionInstruction.dump(out); + + // OpFunctionParameter + for (int p = 0; p < (int)parameterInstructions.size(); ++p) + parameterInstructions[p]->dump(out); + + // Blocks + inReadableOrder(blocks[0], [&out](const Block* b, ReachReason, Block*) { b->dump(out); }); + Instruction end(0, 0, Op::OpFunctionEnd); + end.dump(out); + } + + LinkageType getLinkType() const { return linkType; } + const char* getExportName() const { return exportName.c_str(); } + +protected: + Function(const Function&); + Function& operator=(Function&); + + Module& parent; + std::unique_ptr lineInstruction; + Instruction functionInstruction; + std::vector parameterInstructions; + std::vector blocks; + bool implicitThis; // true if this is a member function expecting to be passed a 'this' as the first argument + bool reducedPrecisionReturn; + std::set reducedPrecisionParams; // list of parameter indexes that need a relaxed precision arg + LinkageType linkType; + std::string exportName; +}; + +// +// SPIR-V IR Module. +// + +class Module { +public: + Module() {} + virtual ~Module() + { + // TODO delete things + } + + void addFunction(Function *fun) { functions.push_back(fun); } + + void mapInstruction(Instruction *instruction) + { + spv::Id resultId = instruction->getResultId(); + // map the instruction's result id + if (resultId >= idToInstruction.size()) + idToInstruction.resize(resultId + 16); + idToInstruction[resultId] = instruction; + } + + Instruction* getInstruction(Id id) const { return idToInstruction[id]; } + const std::vector& getFunctions() const { return functions; } + spv::Id getTypeId(Id resultId) const { + return idToInstruction[resultId] == nullptr ? NoType : idToInstruction[resultId]->getTypeId(); + } + StorageClass getStorageClass(Id typeId) const + { + assert(idToInstruction[typeId]->getOpCode() == spv::Op::OpTypePointer); + return (StorageClass)idToInstruction[typeId]->getImmediateOperand(0); + } + + void dump(std::vector& out) const + { + for (int f = 0; f < (int)functions.size(); ++f) + functions[f]->dump(out); + } + +protected: + Module(const Module&); + std::vector functions; + + // map from result id to instruction having that result id + std::vector idToInstruction; + + // map from a result id to its type id +}; + +// +// Implementation (it's here due to circular type definitions). +// + +// Add both +// - the OpFunction instruction +// - all the OpFunctionParameter instructions +__inline Function::Function(Id id, Id resultType, Id functionType, Id firstParamId, LinkageType linkage, const std::string& name, Module& parent) + : parent(parent), lineInstruction(nullptr), + functionInstruction(id, resultType, Op::OpFunction), implicitThis(false), + reducedPrecisionReturn(false), + linkType(linkage) +{ + // OpFunction + functionInstruction.reserveOperands(2); + functionInstruction.addImmediateOperand(FunctionControlMask::MaskNone); + functionInstruction.addIdOperand(functionType); + parent.mapInstruction(&functionInstruction); + parent.addFunction(this); + + // OpFunctionParameter + Instruction* typeInst = parent.getInstruction(functionType); + int numParams = typeInst->getNumOperands() - 1; + for (int p = 0; p < numParams; ++p) { + Instruction* param = new Instruction(firstParamId + p, typeInst->getIdOperand(p + 1), Op::OpFunctionParameter); + parent.mapInstruction(param); + parameterInstructions.push_back(param); + } + + // If importing/exporting, save the function name (without the mangled parameters) for the linkage decoration + if (linkType != LinkageType::Max) { + exportName = name.substr(0, name.find_first_of('(')); + } +} + +__inline void Function::addLocalVariable(std::unique_ptr inst) +{ + Instruction* raw_instruction = inst.get(); + blocks[0]->addLocalVariable(std::move(inst)); + parent.mapInstruction(raw_instruction); +} + +__inline Block::Block(Id id, Function& parent) : parent(parent), unreachable(false) +{ + instructions.push_back(std::unique_ptr(new Instruction(id, NoType, Op::OpLabel))); + instructions.back()->setBlock(this); + parent.getParent().mapInstruction(instructions.back().get()); +} + +__inline void Block::addInstruction(std::unique_ptr inst) +{ + Instruction* raw_instruction = inst.get(); + instructions.push_back(std::move(inst)); + raw_instruction->setBlock(this); + if (raw_instruction->getResultId()) + parent.getParent().mapInstruction(raw_instruction); +} + +} // end spv namespace + +#endif // spvIR_H diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/spvUtil.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/spvUtil.h new file mode 100644 index 0000000000..d772a30dd4 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/SPIRV/spvUtil.h @@ -0,0 +1,88 @@ +// +// Copyright (C) 2025 Jan Kelemen +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +#pragma once +#ifndef spvUtil_H +#define spvUtil_H + +#include +#include + +#include "spirv.hpp11" + +namespace spv { +__inline uint32_t operator&(uint32_t value, spv::MemoryAccessMask mask) { return value & (unsigned)mask; } + +__inline bool operator==(uint32_t word, spv::FPEncoding encoding) { return word == (unsigned)encoding; } +__inline bool operator!=(uint32_t word, spv::FPEncoding encoding) { return !(word == encoding); } + +__inline bool operator==(uint32_t word, spv::Decoration decoration) { return word == (unsigned)decoration; } +__inline bool operator!=(uint32_t word, spv::Decoration decoration) { return !(word == decoration); } + +__inline bool operator==(uint32_t word, spv::Op op) { return word == (unsigned)op; } +__inline bool operator!=(uint32_t word, spv::Op op) { return !(word == op); } + +__inline bool operator==(uint32_t word, spv::StorageClass storage) { return word == (unsigned)storage; } +__inline bool operator!=(uint32_t word, spv::StorageClass storage) { return !(word == storage); } + +__inline bool anySet(spv::MemoryAccessMask value, spv::MemoryAccessMask mask) +{ + return (value & mask) != spv::MemoryAccessMask::MaskNone; +} + +__inline bool anySet(spv::ImageOperandsMask value, spv::ImageOperandsMask mask) +{ + return (value & mask) != spv::ImageOperandsMask::MaskNone; +} + +__inline bool anySet(spv::MemorySemanticsMask value, spv::MemorySemanticsMask mask) +{ + return (value & mask) != spv::MemorySemanticsMask::MaskNone; +} + +__inline void addMask(uint32_t& word, spv::TensorAddressingOperandsMask mask) { word |= (unsigned)mask; } + +__inline void addMask(spv::CooperativeMatrixOperandsMask& word, spv::CooperativeMatrixOperandsMask mask) +{ + word = word | mask; +} + +template> +__inline To enumCast(Enum value) +{ + return static_cast(value); +} +} + +#endif // spvUtil_H diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/CInterface/glslang_c_interface.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/CInterface/glslang_c_interface.cpp new file mode 100644 index 0000000000..72841c15db --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/CInterface/glslang_c_interface.cpp @@ -0,0 +1,549 @@ +/** + This code is based on the glslang_c_interface implementation by Viktor Latypov +**/ + +/** +BSD 2-Clause License + +Copyright (c) 2019, Viktor Latypov +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +#include "glslang/Include/glslang_c_interface.h" + +#include "StandAlone/DirStackFileIncluder.h" +#include "glslang/Public/ResourceLimits.h" +#include "glslang/Public/ShaderLang.h" +#include "glslang/Include/ShHandle.h" + +#include "glslang/Include/BaseTypes.h" +#include "glslang/Include/ResourceLimits.h" +#include "glslang/Include/Types.h" +#include "glslang/MachineIndependent/iomapper.h" +#include "glslang/MachineIndependent/Versions.h" +#include "glslang/MachineIndependent/localintermediate.h" + +static_assert(int(GLSLANG_STAGE_COUNT) == EShLangCount, ""); +static_assert(int(GLSLANG_STAGE_MASK_COUNT) == EShLanguageMaskCount, ""); +static_assert(int(GLSLANG_SOURCE_COUNT) == glslang::EShSourceCount, ""); +static_assert(int(GLSLANG_CLIENT_COUNT) == glslang::EShClientCount, ""); +static_assert(int(GLSLANG_TARGET_COUNT) == glslang::EShTargetCount, ""); +static_assert(int(GLSLANG_TARGET_CLIENT_VERSION_COUNT) == glslang::EShTargetClientVersionCount, ""); +static_assert(int(GLSLANG_TARGET_LANGUAGE_VERSION_COUNT) == glslang::EShTargetLanguageVersionCount, ""); +static_assert(int(GLSLANG_OPT_LEVEL_COUNT) == EshOptLevelCount, ""); +static_assert(int(GLSLANG_TEX_SAMP_TRANS_COUNT) == EShTexSampTransCount, ""); +static_assert(int(GLSLANG_MSG_COUNT) == EShMsgCount, ""); +static_assert(int(GLSLANG_REFLECTION_COUNT) == EShReflectionCount, ""); +static_assert(int(GLSLANG_PROFILE_COUNT) == EProfileCount, ""); +static_assert(sizeof(glslang_limits_t) == sizeof(TLimits), ""); +static_assert(sizeof(glslang_resource_t) == sizeof(TBuiltInResource), ""); +static_assert(sizeof(glslang_version_t) == sizeof(glslang::Version), ""); + +typedef struct glslang_shader_s { + glslang::TShader* shader; + std::string preprocessedGLSL; + std::vector baseResourceSetBinding; +} glslang_shader_t; + +typedef struct glslang_program_s { + glslang::TProgram* program; + std::vector spirv; + std::string loggerMessages; +} glslang_program_t; + +/* Wrapper/Adapter for C glsl_include_callbacks_t functions + + This class contains a 'glsl_include_callbacks_t' structure + with C include_local/include_system callback pointers. + + This class implement TShader::Includer interface + by redirecting C++ virtual methods to C callbacks. + + The 'IncludeResult' instances produced by this Includer + contain a reference to glsl_include_result_t C structure + to allow its lifetime management by another C callback + (CallbackIncluder::callbacks::free_include_result) +*/ +class CallbackIncluder : public glslang::TShader::Includer { +public: + CallbackIncluder(glsl_include_callbacks_t _callbacks, void* _context) : callbacks(_callbacks), context(_context) {} + + virtual ~CallbackIncluder() {} + + virtual IncludeResult* includeSystem(const char* headerName, const char* includerName, + size_t inclusionDepth) override + { + if (this->callbacks.include_system) { + glsl_include_result_t* result = + this->callbacks.include_system(this->context, headerName, includerName, inclusionDepth); + return makeIncludeResult(result); + } + + return glslang::TShader::Includer::includeSystem(headerName, includerName, inclusionDepth); + } + + virtual IncludeResult* includeLocal(const char* headerName, const char* includerName, + size_t inclusionDepth) override + { + if (this->callbacks.include_local) { + glsl_include_result_t* result = + this->callbacks.include_local(this->context, headerName, includerName, inclusionDepth); + return makeIncludeResult(result); + } + + return glslang::TShader::Includer::includeLocal(headerName, includerName, inclusionDepth); + } + + /* This function only calls free_include_result callback + when the IncludeResult instance is allocated by a C function */ + virtual void releaseInclude(IncludeResult* result) override + { + if (result == nullptr) + return; + + if (this->callbacks.free_include_result) { + this->callbacks.free_include_result(this->context, static_cast(result->userData)); + } + + delete result; + } + +private: + CallbackIncluder() {} + + IncludeResult* makeIncludeResult(glsl_include_result_t* result) { + if (!result) { + return nullptr; + } + + return new glslang::TShader::Includer::IncludeResult( + std::string(result->header_name), result->header_data, result->header_length, result); + } + + /* C callback pointers */ + glsl_include_callbacks_t callbacks; + /* User-defined context */ + void* context; +}; + +GLSLANG_EXPORT void glslang_get_version(glslang_version_t* version) +{ + *reinterpret_cast(version) = glslang::GetVersion(); +} + +GLSLANG_EXPORT int glslang_initialize_process() { return static_cast(glslang::InitializeProcess()); } + +GLSLANG_EXPORT void glslang_finalize_process() { glslang::FinalizeProcess(); } + +static EShLanguage c_shader_stage(glslang_stage_t stage) +{ + switch (stage) { + case GLSLANG_STAGE_VERTEX: + return EShLangVertex; + case GLSLANG_STAGE_TESSCONTROL: + return EShLangTessControl; + case GLSLANG_STAGE_TESSEVALUATION: + return EShLangTessEvaluation; + case GLSLANG_STAGE_GEOMETRY: + return EShLangGeometry; + case GLSLANG_STAGE_FRAGMENT: + return EShLangFragment; + case GLSLANG_STAGE_COMPUTE: + return EShLangCompute; + case GLSLANG_STAGE_RAYGEN_NV: + return EShLangRayGen; + case GLSLANG_STAGE_INTERSECT_NV: + return EShLangIntersect; + case GLSLANG_STAGE_ANYHIT_NV: + return EShLangAnyHit; + case GLSLANG_STAGE_CLOSESTHIT_NV: + return EShLangClosestHit; + case GLSLANG_STAGE_MISS_NV: + return EShLangMiss; + case GLSLANG_STAGE_CALLABLE_NV: + return EShLangCallable; + case GLSLANG_STAGE_TASK: + return EShLangTask; + case GLSLANG_STAGE_MESH: + return EShLangMesh; + default: + break; + } + return EShLangCount; +} + +static int c_shader_messages(glslang_messages_t messages) +{ +#define CONVERT_MSG(in, out) \ + if ((messages & in) == in) \ + res |= out; + + int res = 0; + + CONVERT_MSG(GLSLANG_MSG_RELAXED_ERRORS_BIT, EShMsgRelaxedErrors); + CONVERT_MSG(GLSLANG_MSG_SUPPRESS_WARNINGS_BIT, EShMsgSuppressWarnings); + CONVERT_MSG(GLSLANG_MSG_AST_BIT, EShMsgAST); + CONVERT_MSG(GLSLANG_MSG_SPV_RULES_BIT, EShMsgSpvRules); + CONVERT_MSG(GLSLANG_MSG_VULKAN_RULES_BIT, EShMsgVulkanRules); + CONVERT_MSG(GLSLANG_MSG_ONLY_PREPROCESSOR_BIT, EShMsgOnlyPreprocessor); + CONVERT_MSG(GLSLANG_MSG_READ_HLSL_BIT, EShMsgReadHlsl); + CONVERT_MSG(GLSLANG_MSG_CASCADING_ERRORS_BIT, EShMsgCascadingErrors); + CONVERT_MSG(GLSLANG_MSG_KEEP_UNCALLED_BIT, EShMsgKeepUncalled); + CONVERT_MSG(GLSLANG_MSG_HLSL_OFFSETS_BIT, EShMsgHlslOffsets); + CONVERT_MSG(GLSLANG_MSG_DEBUG_INFO_BIT, EShMsgDebugInfo); + CONVERT_MSG(GLSLANG_MSG_HLSL_ENABLE_16BIT_TYPES_BIT, EShMsgHlslEnable16BitTypes); + CONVERT_MSG(GLSLANG_MSG_HLSL_LEGALIZATION_BIT, EShMsgHlslLegalization); + CONVERT_MSG(GLSLANG_MSG_HLSL_DX9_COMPATIBLE_BIT, EShMsgHlslDX9Compatible); + CONVERT_MSG(GLSLANG_MSG_BUILTIN_SYMBOL_TABLE_BIT, EShMsgBuiltinSymbolTable); + CONVERT_MSG(GLSLANG_MSG_ENHANCED, EShMsgEnhanced); + CONVERT_MSG(GLSLANG_MSG_ABSOLUTE_PATH, EShMsgAbsolutePath); + CONVERT_MSG(GLSLANG_MSG_DISPLAY_ERROR_COLUMN, EShMsgDisplayErrorColumn); + return res; +#undef CONVERT_MSG +} + +static glslang::EShTargetLanguageVersion +c_shader_target_language_version(glslang_target_language_version_t target_language_version) +{ + switch (target_language_version) { + case GLSLANG_TARGET_SPV_1_0: + return glslang::EShTargetSpv_1_0; + case GLSLANG_TARGET_SPV_1_1: + return glslang::EShTargetSpv_1_1; + case GLSLANG_TARGET_SPV_1_2: + return glslang::EShTargetSpv_1_2; + case GLSLANG_TARGET_SPV_1_3: + return glslang::EShTargetSpv_1_3; + case GLSLANG_TARGET_SPV_1_4: + return glslang::EShTargetSpv_1_4; + case GLSLANG_TARGET_SPV_1_5: + return glslang::EShTargetSpv_1_5; + case GLSLANG_TARGET_SPV_1_6: + return glslang::EShTargetSpv_1_6; + default: + break; + } + return glslang::EShTargetSpv_1_0; +} + +static glslang::EShClient c_shader_client(glslang_client_t client) +{ + switch (client) { + case GLSLANG_CLIENT_VULKAN: + return glslang::EShClientVulkan; + case GLSLANG_CLIENT_OPENGL: + return glslang::EShClientOpenGL; + default: + break; + } + + return glslang::EShClientNone; +} + +static glslang::EShTargetClientVersion c_shader_client_version(glslang_target_client_version_t client_version) +{ + switch (client_version) { + case GLSLANG_TARGET_VULKAN_1_1: + return glslang::EShTargetVulkan_1_1; + case GLSLANG_TARGET_VULKAN_1_2: + return glslang::EShTargetVulkan_1_2; + case GLSLANG_TARGET_VULKAN_1_3: + return glslang::EShTargetVulkan_1_3; + case GLSLANG_TARGET_VULKAN_1_4: + return glslang::EShTargetVulkan_1_4; + case GLSLANG_TARGET_OPENGL_450: + return glslang::EShTargetOpenGL_450; + default: + break; + } + + return glslang::EShTargetVulkan_1_0; +} + +static glslang::EShTargetLanguage c_shader_target_language(glslang_target_language_t target_language) +{ + if (target_language == GLSLANG_TARGET_NONE) + return glslang::EShTargetNone; + + return glslang::EShTargetSpv; +} + +static glslang::EShSource c_shader_source(glslang_source_t source) +{ + switch (source) { + case GLSLANG_SOURCE_GLSL: + return glslang::EShSourceGlsl; + case GLSLANG_SOURCE_HLSL: + return glslang::EShSourceHlsl; + default: + break; + } + + return glslang::EShSourceNone; +} + +static EProfile c_shader_profile(glslang_profile_t profile) +{ + switch (profile) { + case GLSLANG_BAD_PROFILE: + return EBadProfile; + case GLSLANG_NO_PROFILE: + return ENoProfile; + case GLSLANG_CORE_PROFILE: + return ECoreProfile; + case GLSLANG_COMPATIBILITY_PROFILE: + return ECompatibilityProfile; + case GLSLANG_ES_PROFILE: + return EEsProfile; + case GLSLANG_PROFILE_COUNT: // Should not use this + break; + } + + return EProfile(); +} + +GLSLANG_EXPORT glslang_shader_t* glslang_shader_create(const glslang_input_t* input) +{ + if (!input || !input->code) { + printf("Error creating shader: null input(%p)/input->code\n", (void*)input); + + if (input) + printf("input->code = %p\n", input->code); + + return nullptr; + } + + glslang_shader_t* shader = new glslang_shader_t(); + + shader->shader = new glslang::TShader(c_shader_stage(input->stage)); + shader->shader->setStrings(&input->code, 1); + shader->shader->setEnvInput(c_shader_source(input->language), c_shader_stage(input->stage), + c_shader_client(input->client), input->default_version); + shader->shader->setEnvClient(c_shader_client(input->client), c_shader_client_version(input->client_version)); + shader->shader->setEnvTarget(c_shader_target_language(input->target_language), + c_shader_target_language_version(input->target_language_version)); + + return shader; +} + +GLSLANG_EXPORT void glslang_shader_set_preamble(glslang_shader_t* shader, const char* s) { + shader->shader->setPreamble(s); +} + +GLSLANG_EXPORT void glslang_shader_set_entry_point(glslang_shader_t* shader, const char* s) { + shader->shader->setEntryPoint(s); +} + +GLSLANG_EXPORT void glslang_shader_set_invert_y(glslang_shader_t* shader, bool y) { + shader->shader->setInvertY(y); +} + +GLSLANG_EXPORT void glslang_shader_shift_binding(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base) +{ + const glslang::TResourceType res_type = glslang::TResourceType(res); + shader->shader->setShiftBinding(res_type, base); +} + +GLSLANG_EXPORT void glslang_shader_shift_binding_for_set(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base, unsigned int set) +{ + const glslang::TResourceType res_type = glslang::TResourceType(res); + shader->shader->setShiftBindingForSet(res_type, base, set); +} + +GLSLANG_EXPORT void glslang_shader_set_options(glslang_shader_t* shader, int options) +{ + if (options & GLSLANG_SHADER_AUTO_MAP_BINDINGS) { + shader->shader->setAutoMapBindings(true); + } + + if (options & GLSLANG_SHADER_AUTO_MAP_LOCATIONS) { + shader->shader->setAutoMapLocations(true); + } + + if (options & GLSLANG_SHADER_VULKAN_RULES_RELAXED) { + shader->shader->setEnvInputVulkanRulesRelaxed(); + } +} + +GLSLANG_EXPORT void glslang_shader_set_glsl_version(glslang_shader_t* shader, int version) +{ + shader->shader->setOverrideVersion(version); +} + +GLSLANG_EXPORT void glslang_shader_set_default_uniform_block_set_and_binding(glslang_shader_t* shader, unsigned int set, unsigned int binding) { + shader->shader->setGlobalUniformSet(set); + shader->shader->setGlobalUniformBinding(binding); +} + +GLSLANG_EXPORT void glslang_shader_set_default_uniform_block_name(glslang_shader_t* shader, const char *name) { + shader->shader->setGlobalUniformBlockName(name); +} + +GLSLANG_EXPORT void glslang_shader_set_resource_set_binding(glslang_shader_t* shader, const char *const *bindings, unsigned int num_bindings) { + shader->baseResourceSetBinding.clear(); + + for (unsigned int i = 0; i < num_bindings; ++i) { + shader->baseResourceSetBinding.push_back(std::string(bindings[i])); + } + + shader->shader->setResourceSetBinding(shader->baseResourceSetBinding); +} + +GLSLANG_EXPORT const char* glslang_shader_get_preprocessed_code(glslang_shader_t* shader) +{ + return shader->preprocessedGLSL.c_str(); +} + +GLSLANG_EXPORT void glslang_shader_set_preprocessed_code(glslang_shader_t* shader, const char* code) +{ + shader->preprocessedGLSL.assign(code); +} + +GLSLANG_EXPORT int glslang_shader_preprocess(glslang_shader_t* shader, const glslang_input_t* input) +{ + DirStackFileIncluder dirStackFileIncluder; + CallbackIncluder callbackIncluder(input->callbacks, input->callbacks_ctx); + glslang::TShader::Includer& Includer = (input->callbacks.include_local||input->callbacks.include_system) + ? static_cast(callbackIncluder) + : static_cast(dirStackFileIncluder); + return shader->shader->preprocess( + reinterpret_cast(input->resource), + input->default_version, + c_shader_profile(input->default_profile), + input->force_default_version_and_profile != 0, + input->forward_compatible != 0, + (EShMessages)c_shader_messages(input->messages), + &shader->preprocessedGLSL, + Includer + ); +} + +GLSLANG_EXPORT int glslang_shader_parse(glslang_shader_t* shader, const glslang_input_t* input) +{ + const char* preprocessedCStr = shader->preprocessedGLSL.c_str(); + shader->shader->setStrings(&preprocessedCStr, 1); + + return shader->shader->parse( + reinterpret_cast(input->resource), + input->default_version, + input->forward_compatible != 0, + (EShMessages)c_shader_messages(input->messages) + ); +} + +GLSLANG_EXPORT const char* glslang_shader_get_info_log(glslang_shader_t* shader) { return shader->shader->getInfoLog(); } + +GLSLANG_EXPORT const char* glslang_shader_get_info_debug_log(glslang_shader_t* shader) { return shader->shader->getInfoDebugLog(); } + +GLSLANG_EXPORT void glslang_shader_delete(glslang_shader_t* shader) +{ + if (!shader) + return; + + delete (shader->shader); + delete (shader); +} + +GLSLANG_EXPORT glslang_program_t* glslang_program_create() +{ + glslang_program_t* p = new glslang_program_t(); + p->program = new glslang::TProgram(); + return p; +} + +GLSLANG_EXPORT void glslang_program_delete(glslang_program_t* program) +{ + if (!program) + return; + + delete (program->program); + delete (program); +} + +GLSLANG_EXPORT void glslang_program_add_shader(glslang_program_t* program, glslang_shader_t* shader) +{ + program->program->addShader(shader->shader); +} + +GLSLANG_EXPORT int glslang_program_link(glslang_program_t* program, int messages) +{ + return (int)program->program->link((EShMessages)messages); +} + +GLSLANG_EXPORT void glslang_program_add_source_text(glslang_program_t* program, glslang_stage_t stage, const char* text, size_t len) { + glslang::TIntermediate* intermediate = program->program->getIntermediate(c_shader_stage(stage)); + intermediate->addSourceText(text, len); +} + +GLSLANG_EXPORT void glslang_program_set_source_file(glslang_program_t* program, glslang_stage_t stage, const char* file) { + glslang::TIntermediate* intermediate = program->program->getIntermediate(c_shader_stage(stage)); + intermediate->setSourceFile(file); +} + +GLSLANG_EXPORT int glslang_program_map_io(glslang_program_t* program) +{ + return (int)program->program->mapIO(); +} + +GLSLANG_EXPORT int glslang_program_map_io_with_resolver_and_mapper(glslang_program_t* program, glslang_resolver_t* resolver, glslang_mapper_t* mapper) +{ + return (int)program->program->mapIO(reinterpret_cast(resolver), reinterpret_cast(mapper)); +} + +GLSLANG_EXPORT const char* glslang_program_get_info_log(glslang_program_t* program) +{ + return program->program->getInfoLog(); +} + +GLSLANG_EXPORT const char* glslang_program_get_info_debug_log(glslang_program_t* program) +{ + return program->program->getInfoDebugLog(); +} + +GLSLANG_EXPORT glslang_mapper_t* glslang_glsl_mapper_create() +{ + return reinterpret_cast(new glslang::TGlslIoMapper()); +} + +GLSLANG_EXPORT void glslang_glsl_mapper_delete(glslang_mapper_t* mapper) +{ + if (!mapper) + return; + + delete reinterpret_cast(mapper); +} + +GLSLANG_EXPORT glslang_resolver_t* glslang_glsl_resolver_create(glslang_program_t* program, glslang_stage_t stage) +{ + glslang::TIntermediate* intermediate = program->program->getIntermediate(c_shader_stage(stage)); + return reinterpret_cast(new glslang::TDefaultGlslIoResolver(reinterpret_cast(*intermediate))); +} + +GLSLANG_EXPORT void glslang_glsl_resolver_delete(glslang_resolver_t* resolver) +{ + if (!resolver) + return; + + delete reinterpret_cast(resolver); +} diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl new file mode 100644 index 0000000000..7cf545d94d --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl @@ -0,0 +1,38 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013-2016 LunarG, Inc. +// Copyright (C) 2016-2020 Google, Inc. +// Modifications Copyright(C) 2021 Advanced Micro Devices, Inc.All rights reserved. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp new file mode 100644 index 0000000000..7c6297e0bb --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp @@ -0,0 +1,74 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "../Include/Common.h" +#include "../Include/ShHandle.h" +#include "../MachineIndependent/Versions.h" + +namespace QtShaderTools { +// +// Here is where real machine specific high-level data would be defined. +// +class TGenericCompiler : public TCompiler { +public: + TGenericCompiler(EShLanguage l) : TCompiler(l, infoSink) {} + virtual bool compile(TIntermNode* root, int version = 0, EProfile profile = ENoProfile); + TInfoSink infoSink; +}; + +// +// This function must be provided to create the actual +// compile object used by higher level code. It returns +// a subclass of TCompiler. +// +TCompiler* ConstructCompiler(EShLanguage language, int) { return new TGenericCompiler(language); } + +// +// Delete the compiler made by ConstructCompiler +// +void DeleteCompiler(TCompiler* compiler) +{ + delete compiler; +} + +// +// Generate code from the given parse tree +// +bool TGenericCompiler::compile(TIntermNode* /*root*/, int /*version*/, EProfile /*profile*/) +{ + haveValidObjectCode = true; + + return haveValidObjectCode; +} +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp new file mode 100644 index 0000000000..9b96f057ad --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp @@ -0,0 +1,90 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// The top level algorithms for linking multiple +// shaders together. +// +#include "../Include/Common.h" +#include "../Include/ShHandle.h" + +namespace QtShaderTools { +// +// Actual link object, derived from the shader handle base classes. +// +class TGenericLinker : public TLinker { +public: + TGenericLinker(EShExecutable e) : TLinker(e, infoSink) {} + bool link(TCompilerList&, TUniformMap*) { return true; } + void getAttributeBindings(ShBindingTable const **) const { } + TInfoSink infoSink; +}; + +// +// The internal view of a uniform/float object exchanged with the driver. +// +class TUniformLinkedMap : public TUniformMap { +public: + TUniformLinkedMap() { } + virtual int getLocation(const char*) { return 0; } +}; + +TShHandleBase* ConstructLinker(EShExecutable executable, int) { return new TGenericLinker(executable); } + +void DeleteLinker(TShHandleBase* linker) +{ + delete linker; +} + +TUniformMap* ConstructUniformMap() +{ + return new TUniformLinkedMap(); +} + +void DeleteUniformMap(TUniformMap* map) +{ + delete map; +} + +TShHandleBase* ConstructBindings() +{ + return nullptr; +} + +void DeleteBindingList(TShHandleBase* bindingList) +{ + delete bindingList; +} + +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslAttributes.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslAttributes.cpp new file mode 100644 index 0000000000..973054931c --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslAttributes.cpp @@ -0,0 +1,151 @@ +// +// Copyright (C) 2016 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "hlslAttributes.h" +#include "hlslParseHelper.h" + +namespace glslang { + // Map the given string to an attribute enum from TAttributeType, + // or EatNone if invalid. + TAttributeType HlslParseContext::attributeFromName(const TString& nameSpace, const TString& name) const + { + // handle names within a namespace + + if (nameSpace == "vk") { + if (name == "input_attachment_index") + return EatInputAttachment; + else if (name == "location") + return EatLocation; + else if (name == "binding") + return EatBinding; + else if (name == "global_cbuffer_binding") + return EatGlobalBinding; + else if (name == "builtin") + return EatBuiltIn; + else if (name == "constant_id") + return EatConstantId; + else if (name == "push_constant") + return EatPushConstant; + } else if (nameSpace == "spv") { + if (name == "format_rgba32f") return EatFormatRgba32f; + if (name == "format_rgba16f") return EatFormatRgba16f; + if (name == "format_r32f") return EatFormatR32f; + if (name == "format_rgba8") return EatFormatRgba8; + if (name == "format_rgba8snorm") return EatFormatRgba8Snorm; + if (name == "format_rg32f") return EatFormatRg32f; + if (name == "format_rg16f") return EatFormatRg16f; + if (name == "format_r11fg11fb10f") return EatFormatR11fG11fB10f; + if (name == "format_r16f") return EatFormatR16f; + if (name == "format_rgba16") return EatFormatRgba16; + if (name == "format_rgb10a2") return EatFormatRgb10A2; + if (name == "format_rg16") return EatFormatRg16; + if (name == "format_rg8") return EatFormatRg8; + if (name == "format_r16") return EatFormatR16; + if (name == "format_r8") return EatFormatR8; + if (name == "format_rgba16snorm") return EatFormatRgba16Snorm; + if (name == "format_rg16snorm") return EatFormatRg16Snorm; + if (name == "format_rg8snorm") return EatFormatRg8Snorm; + if (name == "format_r16snorm") return EatFormatR16Snorm; + if (name == "format_r8snorm") return EatFormatR8Snorm; + if (name == "format_rgba32i") return EatFormatRgba32i; + if (name == "format_rgba16i") return EatFormatRgba16i; + if (name == "format_rgba8i") return EatFormatRgba8i; + if (name == "format_r32i") return EatFormatR32i; + if (name == "format_rg32i") return EatFormatRg32i; + if (name == "format_rg16i") return EatFormatRg16i; + if (name == "format_rg8i") return EatFormatRg8i; + if (name == "format_r16i") return EatFormatR16i; + if (name == "format_r8i") return EatFormatR8i; + if (name == "format_rgba32ui") return EatFormatRgba32ui; + if (name == "format_rgba16ui") return EatFormatRgba16ui; + if (name == "format_rgba8ui") return EatFormatRgba8ui; + if (name == "format_r32ui") return EatFormatR32ui; + if (name == "format_rgb10a2ui") return EatFormatRgb10a2ui; + if (name == "format_rg32ui") return EatFormatRg32ui; + if (name == "format_rg16ui") return EatFormatRg16ui; + if (name == "format_rg8ui") return EatFormatRg8ui; + if (name == "format_r16ui") return EatFormatR16ui; + if (name == "format_r8ui") return EatFormatR8ui; + + if (name == "nonwritable") return EatNonWritable; + if (name == "nonreadable") return EatNonReadable; + + if (name == "export") return EatExport; + } else if (nameSpace.size() > 0) + return EatNone; + + // handle names with no namespace + + if (name == "allow_uav_condition") + return EatAllow_uav_condition; + else if (name == "branch") + return EatBranch; + else if (name == "call") + return EatCall; + else if (name == "domain") + return EatDomain; + else if (name == "earlydepthstencil") + return EatEarlyDepthStencil; + else if (name == "fastopt") + return EatFastOpt; + else if (name == "flatten") + return EatFlatten; + else if (name == "forcecase") + return EatForceCase; + else if (name == "instance") + return EatInstance; + else if (name == "maxtessfactor") + return EatMaxTessFactor; + else if (name == "maxvertexcount") + return EatMaxVertexCount; + else if (name == "numthreads") + return EatNumThreads; + else if (name == "outputcontrolpoints") + return EatOutputControlPoints; + else if (name == "outputtopology") + return EatOutputTopology; + else if (name == "partitioning") + return EatPartitioning; + else if (name == "patchconstantfunc") + return EatPatchConstantFunc; + else if (name == "unroll") + return EatUnroll; + else if (name == "loop") + return EatLoop; + else + return EatNone; + } + +} // end namespace glslang diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslAttributes.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslAttributes.h new file mode 100644 index 0000000000..62faa5b889 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslAttributes.h @@ -0,0 +1,59 @@ +// +// Copyright (C) 2016 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef HLSLATTRIBUTES_H_ +#define HLSLATTRIBUTES_H_ + +#include +#include + +#include "../MachineIndependent/attribute.h" +#include "../MachineIndependent/SymbolTable.h" +#include "hlslScanContext.h" + +namespace glslang { + + class TFunctionDeclarator { + public: + TFunctionDeclarator() : function(nullptr), body(nullptr) { } + TSourceLoc loc; + TFunction* function; + TAttributes attributes; + TVector* body; + }; + +} // end namespace glslang + +#endif // HLSLATTRIBUTES_H_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp new file mode 100644 index 0000000000..ed32ff0caa --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp @@ -0,0 +1,4484 @@ +// +// Copyright (C) 2016-2018 Google, Inc. +// Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2023 Mobica Limited. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// This is a set of mutually recursive methods implementing the HLSL grammar. +// Generally, each returns +// - through an argument: a type specifically appropriate to which rule it +// recognized +// - through the return value: true/false to indicate whether or not it +// recognized its rule +// +// As much as possible, only grammar recognition should happen in this file, +// with all other work being farmed out to hlslParseHelper.cpp, which in turn +// will build the AST. +// +// The next token, yet to be "accepted" is always sitting in 'token'. +// When a method says it accepts a rule, that means all tokens involved +// in the rule will have been consumed, and none left in 'token'. +// + +#include "hlslTokens.h" +#include "hlslGrammar.h" +#include "hlslAttributes.h" + +namespace glslang { + +// Root entry point to this recursive decent parser. +// Return true if compilation unit was successfully accepted. +bool HlslGrammar::parse() +{ + advanceToken(); + return acceptCompilationUnit(); +} + +void HlslGrammar::expected(const char* syntax) +{ + parseContext.error(token.loc, "Expected", syntax, ""); +} + +void HlslGrammar::unimplemented(const char* error) +{ + parseContext.error(token.loc, "Unimplemented", error, ""); +} + +// IDENTIFIER +// THIS +// type that can be used as IDENTIFIER +// +// Only process the next token if it is an identifier. +// Return true if it was an identifier. +bool HlslGrammar::acceptIdentifier(HlslToken& idToken) +{ + // IDENTIFIER + if (peekTokenClass(EHTokIdentifier)) { + idToken = token; + advanceToken(); + return true; + } + + // THIS + // -> maps to the IDENTIFIER spelled with the internal special name for 'this' + if (peekTokenClass(EHTokThis)) { + idToken = token; + advanceToken(); + idToken.tokenClass = EHTokIdentifier; + idToken.string = NewPoolTString(intermediate.implicitThisName); + return true; + } + + // type that can be used as IDENTIFIER + + // Even though "sample", "bool", "float", etc keywords (for types, interpolation modifiers), + // they ARE still accepted as identifiers. This is not a dense space: e.g, "void" is not a + // valid identifier, nor is "linear". This code special cases the known instances of this, so + // e.g, "int sample;" or "float float;" is accepted. Other cases can be added here if needed. + + const char* idString = getTypeString(peek()); + if (idString == nullptr) + return false; + + token.string = NewPoolTString(idString); + token.tokenClass = EHTokIdentifier; + idToken = token; + typeIdentifiers = true; + + advanceToken(); + + return true; +} + +// compilationUnit +// : declaration_list EOF +// +bool HlslGrammar::acceptCompilationUnit() +{ + if (! acceptDeclarationList(unitNode)) + return false; + + if (! peekTokenClass(EHTokNone)) + return false; + + // set root of AST + if (unitNode && !unitNode->getAsAggregate()) + unitNode = intermediate.growAggregate(nullptr, unitNode); + intermediate.setTreeRoot(unitNode); + + return true; +} + +// Recognize the following, but with the extra condition that it can be +// successfully terminated by EOF or '}'. +// +// declaration_list +// : list of declaration_or_semicolon followed by EOF or RIGHT_BRACE +// +// declaration_or_semicolon +// : declaration +// : SEMICOLON +// +bool HlslGrammar::acceptDeclarationList(TIntermNode*& nodeList) +{ + do { + // HLSL allows extra semicolons between global declarations + do { } while (acceptTokenClass(EHTokSemicolon)); + + // EOF or RIGHT_BRACE + if (peekTokenClass(EHTokNone) || peekTokenClass(EHTokRightBrace)) + return true; + + // declaration + if (! acceptDeclaration(nodeList)) { + expected("declaration"); + return false; + } + } while (true); + + return true; +} + +// sampler_state +// : LEFT_BRACE [sampler_state_assignment ... ] RIGHT_BRACE +// +// sampler_state_assignment +// : sampler_state_identifier EQUAL value SEMICOLON +// +// sampler_state_identifier +// : ADDRESSU +// | ADDRESSV +// | ADDRESSW +// | BORDERCOLOR +// | FILTER +// | MAXANISOTROPY +// | MAXLOD +// | MINLOD +// | MIPLODBIAS +// +bool HlslGrammar::acceptSamplerState() +{ + // TODO: this should be genericized to accept a list of valid tokens and + // return token/value pairs. Presently it is specific to texture values. + + if (! acceptTokenClass(EHTokLeftBrace)) + return true; + + parseContext.warn(token.loc, "unimplemented", "immediate sampler state", ""); + + do { + // read state name + HlslToken state; + if (! acceptIdentifier(state)) + break; // end of list + + // FXC accepts any case + TString stateName = *state.string; + std::transform(stateName.begin(), stateName.end(), stateName.begin(), ::tolower); + + if (! acceptTokenClass(EHTokAssign)) { + expected("assign"); + return false; + } + + if (stateName == "minlod" || stateName == "maxlod") { + if (! peekTokenClass(EHTokIntConstant)) { + expected("integer"); + return false; + } + + TIntermTyped* lod = nullptr; + if (! acceptLiteral(lod)) // should never fail, since we just looked for an integer + return false; + } else if (stateName == "maxanisotropy") { + if (! peekTokenClass(EHTokIntConstant)) { + expected("integer"); + return false; + } + + TIntermTyped* maxAnisotropy = nullptr; + if (! acceptLiteral(maxAnisotropy)) // should never fail, since we just looked for an integer + return false; + } else if (stateName == "filter") { + HlslToken filterMode; + if (! acceptIdentifier(filterMode)) { + expected("filter mode"); + return false; + } + } else if (stateName == "addressu" || stateName == "addressv" || stateName == "addressw") { + HlslToken addrMode; + if (! acceptIdentifier(addrMode)) { + expected("texture address mode"); + return false; + } + } else if (stateName == "miplodbias") { + TIntermTyped* lodBias = nullptr; + if (! acceptLiteral(lodBias)) { + expected("lod bias"); + return false; + } + } else if (stateName == "bordercolor") { + return false; + } else { + expected("texture state"); + return false; + } + + // SEMICOLON + if (! acceptTokenClass(EHTokSemicolon)) { + expected("semicolon"); + return false; + } + } while (true); + + if (! acceptTokenClass(EHTokRightBrace)) + return false; + + return true; +} + +// sampler_declaration_dx9 +// : SAMPLER identifier EQUAL sampler_type sampler_state +// +bool HlslGrammar::acceptSamplerDeclarationDX9(TType& /*type*/) +{ + if (! acceptTokenClass(EHTokSampler)) + return false; + + // TODO: remove this when DX9 style declarations are implemented. + unimplemented("Direct3D 9 sampler declaration"); + + // read sampler name + HlslToken name; + if (! acceptIdentifier(name)) { + expected("sampler name"); + return false; + } + + if (! acceptTokenClass(EHTokAssign)) { + expected("="); + return false; + } + + return false; +} + +// declaration +// : attributes attributed_declaration +// | NAMESPACE IDENTIFIER LEFT_BRACE declaration_list RIGHT_BRACE +// +// attributed_declaration +// : sampler_declaration_dx9 post_decls SEMICOLON +// | fully_specified_type // for cbuffer/tbuffer +// | fully_specified_type declarator_list SEMICOLON // for non cbuffer/tbuffer +// | fully_specified_type identifier function_parameters post_decls compound_statement // function definition +// | fully_specified_type identifier sampler_state post_decls compound_statement // sampler definition +// | typedef declaration +// +// declarator_list +// : declarator COMMA declarator COMMA declarator... // zero or more declarators +// +// declarator +// : identifier array_specifier post_decls +// | identifier array_specifier post_decls EQUAL assignment_expression +// | identifier function_parameters post_decls // function prototype +// +// Parsing has to go pretty far in to know whether it's a variable, prototype, or +// function definition, so the implementation below doesn't perfectly divide up the grammar +// as above. (The 'identifier' in the first item in init_declarator list is the +// same as 'identifier' for function declarations.) +// +// This can generate more than one subtree, one per initializer or a function body. +// All initializer subtrees are put in their own aggregate node, making one top-level +// node for all the initializers. Each function created is a top-level node to grow +// into the passed-in nodeList. +// +// If 'nodeList' is passed in as non-null, it must be an aggregate to extend for +// each top-level node the declaration creates. Otherwise, if only one top-level +// node in generated here, that is want is returned in nodeList. +// +bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList) +{ + // NAMESPACE IDENTIFIER LEFT_BRACE declaration_list RIGHT_BRACE + if (acceptTokenClass(EHTokNamespace)) { + HlslToken namespaceToken; + if (!acceptIdentifier(namespaceToken)) { + expected("namespace name"); + return false; + } + parseContext.pushNamespace(*namespaceToken.string); + if (!acceptTokenClass(EHTokLeftBrace)) { + expected("{"); + return false; + } + if (!acceptDeclarationList(nodeList)) { + expected("declaration list"); + return false; + } + if (!acceptTokenClass(EHTokRightBrace)) { + expected("}"); + return false; + } + parseContext.popNamespace(); + return true; + } + + bool declarator_list = false; // true when processing comma separation + + // attributes + TFunctionDeclarator declarator; + acceptAttributes(declarator.attributes); + + // typedef + bool typedefDecl = acceptTokenClass(EHTokTypedef); + + TType declaredType; + + // DX9 sampler declaration use a different syntax + // DX9 shaders need to run through HLSL compiler (fxc) via a back compat mode, it isn't going to + // be possible to simultaneously compile D3D10+ style shaders and DX9 shaders. If we want to compile DX9 + // HLSL shaders, this will have to be a master level switch + // As such, the sampler keyword in D3D10+ turns into an automatic sampler type, and is commonly used + // For that reason, this line is commented out + // if (acceptSamplerDeclarationDX9(declaredType)) + // return true; + + bool forbidDeclarators = (peekTokenClass(EHTokCBuffer) || peekTokenClass(EHTokTBuffer)); + // fully_specified_type + if (! acceptFullySpecifiedType(declaredType, nodeList, declarator.attributes, forbidDeclarators)) + return false; + + // cbuffer and tbuffer end with the closing '}'. + // No semicolon is included. + if (forbidDeclarators) + return true; + + // Check if there are invalid in/out qualifiers + switch (declaredType.getQualifier().storage) { + case EvqIn: + case EvqOut: + case EvqInOut: + parseContext.error(token.loc, "in/out qualifiers are only valid on parameters", token.string->c_str(), ""); + break; + default: + break; + } + + // declarator_list + // : declarator + // : identifier + HlslToken idToken; + TIntermAggregate* initializers = nullptr; + while (acceptIdentifier(idToken)) { + TString *fullName = idToken.string; + if (parseContext.symbolTable.atGlobalLevel()) + parseContext.getFullNamespaceName(fullName); + if (peekTokenClass(EHTokLeftParen)) { + // looks like function parameters + + // merge in the attributes into the return type + parseContext.transferTypeAttributes(token.loc, declarator.attributes, declaredType, true); + + // Potentially rename shader entry point function. No-op most of the time. + parseContext.renameShaderFunction(fullName); + + // function_parameters + declarator.function = new TFunction(fullName, declaredType); + if (!acceptFunctionParameters(*declarator.function)) { + expected("function parameter list"); + return false; + } + + // post_decls + acceptPostDecls(declarator.function->getWritableType().getQualifier()); + + // compound_statement (function body definition) or just a prototype? + declarator.loc = token.loc; + if (peekTokenClass(EHTokLeftBrace)) { + if (declarator_list) + parseContext.error(idToken.loc, "function body can't be in a declarator list", "{", ""); + if (typedefDecl) + parseContext.error(idToken.loc, "function body can't be in a typedef", "{", ""); + return acceptFunctionDefinition(declarator, nodeList, nullptr); + } else { + if (typedefDecl) + parseContext.error(idToken.loc, "function typedefs not implemented", "{", ""); + parseContext.handleFunctionDeclarator(declarator.loc, *declarator.function, true); + } + } else { + // A variable declaration. + + // merge in the attributes, the first time around, into the shared type + if (! declarator_list) + parseContext.transferTypeAttributes(token.loc, declarator.attributes, declaredType); + + // Fix the storage qualifier if it's a global. + if (declaredType.getQualifier().storage == EvqTemporary && parseContext.symbolTable.atGlobalLevel()) + declaredType.getQualifier().storage = EvqUniform; + + // recognize array_specifier + TArraySizes* arraySizes = nullptr; + acceptArraySpecifier(arraySizes); + + // We can handle multiple variables per type declaration, so + // the number of types can expand when arrayness is different. + TType variableType; + variableType.shallowCopy(declaredType); + + // In the most general case, arrayness is potentially coming both from the + // declared type and from the variable: "int[] a[];" or just one or the other. + // Merge it all to the variableType, so all arrayness is part of the variableType. + variableType.transferArraySizes(arraySizes); + variableType.copyArrayInnerSizes(declaredType.getArraySizes()); + + // samplers accept immediate sampler state + if (variableType.getBasicType() == EbtSampler) { + if (! acceptSamplerState()) + return false; + } + + // post_decls + acceptPostDecls(variableType.getQualifier()); + + // EQUAL assignment_expression + TIntermTyped* expressionNode = nullptr; + if (acceptTokenClass(EHTokAssign)) { + if (typedefDecl) + parseContext.error(idToken.loc, "can't have an initializer", "typedef", ""); + if (! acceptAssignmentExpression(expressionNode)) { + expected("initializer"); + return false; + } + } + + // TODO: things scoped within an annotation need their own name space; + // TODO: non-constant strings are not yet handled. + if (!(variableType.getBasicType() == EbtString && !variableType.getQualifier().isConstant()) && + parseContext.getAnnotationNestingLevel() == 0) { + if (typedefDecl) + parseContext.declareTypedef(idToken.loc, *fullName, variableType); + else if (variableType.getBasicType() == EbtBlock) { + if (expressionNode) + parseContext.error(idToken.loc, "buffer aliasing not yet supported", "block initializer", ""); + parseContext.declareBlock(idToken.loc, variableType, fullName); + parseContext.declareStructBufferCounter(idToken.loc, variableType, *fullName); + } else { + if (variableType.getQualifier().storage == EvqUniform && ! variableType.containsOpaque()) { + // this isn't really an individual variable, but a member of the $Global buffer + parseContext.growGlobalUniformBlock(idToken.loc, variableType, *fullName); + } else { + // Declare the variable and add any initializer code to the AST. + // The top-level node is always made into an aggregate, as that's + // historically how the AST has been. + initializers = intermediate.growAggregate(initializers, + parseContext.declareVariable(idToken.loc, *fullName, variableType, expressionNode), + idToken.loc); + } + } + } + } + + // COMMA + if (acceptTokenClass(EHTokComma)) + declarator_list = true; + } + + // The top-level initializer node is a sequence. + if (initializers != nullptr) + initializers->setOperator(EOpSequence); + + // if we have a locally scoped static, it needs a globally scoped initializer + if (declaredType.getQualifier().storage == EvqGlobal && !parseContext.symbolTable.atGlobalLevel()) { + unitNode = intermediate.growAggregate(unitNode, initializers, idToken.loc); + } else { + // Add the initializers' aggregate to the nodeList we were handed. + if (nodeList) + nodeList = intermediate.growAggregate(nodeList, initializers); + else + nodeList = initializers; + } + + // SEMICOLON + if (! acceptTokenClass(EHTokSemicolon)) { + // This may have been a false detection of what appeared to be a declaration, but + // was actually an assignment such as "float = 4", where "float" is an identifier. + // We put the token back to let further parsing happen for cases where that may + // happen. This errors on the side of caution, and mostly triggers the error. + if (peek() == EHTokAssign || peek() == EHTokLeftBracket || peek() == EHTokDot || peek() == EHTokComma) + recedeToken(); + else + expected(";"); + return false; + } + + return true; +} + +// control_declaration +// : fully_specified_type identifier EQUAL expression +// +bool HlslGrammar::acceptControlDeclaration(TIntermNode*& node) +{ + node = nullptr; + TAttributes attributes; + + // fully_specified_type + TType type; + if (! acceptFullySpecifiedType(type, attributes)) + return false; + + if (attributes.size() > 0) + parseContext.warn(token.loc, "attributes don't apply to control declaration", "", ""); + + // filter out type casts + if (peekTokenClass(EHTokLeftParen)) { + recedeToken(); + return false; + } + + // identifier + HlslToken idToken; + if (! acceptIdentifier(idToken)) { + expected("identifier"); + return false; + } + + // EQUAL + TIntermTyped* expressionNode = nullptr; + if (! acceptTokenClass(EHTokAssign)) { + expected("="); + return false; + } + + // expression + if (! acceptExpression(expressionNode)) { + expected("initializer"); + return false; + } + + node = parseContext.declareVariable(idToken.loc, *idToken.string, type, expressionNode); + + return true; +} + +// fully_specified_type +// : type_specifier +// | type_qualifier type_specifier +// | type_specifier type_qualifier +// +bool HlslGrammar::acceptFullySpecifiedType(TType& type, const TAttributes& attributes) +{ + TIntermNode* nodeList = nullptr; + return acceptFullySpecifiedType(type, nodeList, attributes); +} +bool HlslGrammar::acceptFullySpecifiedType(TType& type, TIntermNode*& nodeList, const TAttributes& attributes, bool forbidDeclarators) +{ + // type_qualifier + TQualifier qualifier; + qualifier.clear(); + if (! acceptPreQualifier(qualifier)) + return false; + TSourceLoc loc = token.loc; + + // type_specifier + if (! acceptType(type, nodeList)) { + // If this is not a type, we may have inadvertently gone down a wrong path + // by parsing "sample", which can be treated like either an identifier or a + // qualifier. Back it out, if we did. + if (qualifier.sample) + recedeToken(); + + return false; + } + + // type_qualifier + if (! acceptPostQualifier(qualifier)) + return false; + + if (type.getBasicType() == EbtBlock) { + // the type was a block, which set some parts of the qualifier + parseContext.mergeQualifiers(type.getQualifier(), qualifier); + + // merge in the attributes + parseContext.transferTypeAttributes(token.loc, attributes, type); + + // further, it can create an anonymous instance of the block + // (cbuffer and tbuffer don't consume the next identifier, and + // should set forbidDeclarators) + if (forbidDeclarators || peek() != EHTokIdentifier) + parseContext.declareBlock(loc, type); + } else { + // Some qualifiers are set when parsing the type. Merge those with + // whatever comes from acceptPreQualifier and acceptPostQualifier. + assert(qualifier.layoutFormat == ElfNone); + + qualifier.layoutFormat = type.getQualifier().layoutFormat; + qualifier.precision = type.getQualifier().precision; + + if (type.getQualifier().storage == EvqOut || + type.getQualifier().storage == EvqBuffer) { + qualifier.storage = type.getQualifier().storage; + qualifier.readonly = type.getQualifier().readonly; + } + + if (type.isBuiltIn()) + qualifier.builtIn = type.getQualifier().builtIn; + + type.getQualifier() = qualifier; + } + + return true; +} + +// type_qualifier +// : qualifier qualifier ... +// +// Zero or more of these, so this can't return false. +// +bool HlslGrammar::acceptPreQualifier(TQualifier& qualifier) +{ + do { + switch (peek()) { + case EHTokStatic: + qualifier.storage = EvqGlobal; + break; + case EHTokExtern: + // TODO: no meaning in glslang? + break; + case EHTokShared: + // TODO: hint + break; + case EHTokGroupShared: + qualifier.storage = EvqShared; + break; + case EHTokUniform: + qualifier.storage = EvqUniform; + break; + case EHTokConst: + qualifier.storage = EvqConst; + break; + case EHTokVolatile: + qualifier.volatil = true; + break; + case EHTokLinear: + qualifier.smooth = true; + break; + case EHTokCentroid: + qualifier.centroid = true; + break; + case EHTokNointerpolation: + qualifier.flat = true; + break; + case EHTokNoperspective: + qualifier.nopersp = true; + break; + case EHTokSample: + qualifier.sample = true; + break; + case EHTokRowMajor: + qualifier.layoutMatrix = ElmColumnMajor; + break; + case EHTokColumnMajor: + qualifier.layoutMatrix = ElmRowMajor; + break; + case EHTokPrecise: + qualifier.noContraction = true; + break; + case EHTokIn: + if (qualifier.storage != EvqUniform) { + qualifier.storage = (qualifier.storage == EvqOut) ? EvqInOut : EvqIn; + } + break; + case EHTokOut: + qualifier.storage = (qualifier.storage == EvqIn) ? EvqInOut : EvqOut; + break; + case EHTokInOut: + qualifier.storage = EvqInOut; + break; + case EHTokLayout: + if (! acceptLayoutQualifierList(qualifier)) + return false; + continue; + case EHTokGloballyCoherent: + qualifier.coherent = true; + break; + case EHTokInline: + // TODO: map this to SPIR-V function control + break; + + // GS geometries: these are specified on stage input variables, and are an error (not verified here) + // for output variables. + case EHTokPoint: + qualifier.storage = EvqIn; + if (!parseContext.handleInputGeometry(token.loc, ElgPoints)) + return false; + break; + case EHTokLine: + qualifier.storage = EvqIn; + if (!parseContext.handleInputGeometry(token.loc, ElgLines)) + return false; + break; + case EHTokTriangle: + qualifier.storage = EvqIn; + if (!parseContext.handleInputGeometry(token.loc, ElgTriangles)) + return false; + break; + case EHTokLineAdj: + qualifier.storage = EvqIn; + if (!parseContext.handleInputGeometry(token.loc, ElgLinesAdjacency)) + return false; + break; + case EHTokTriangleAdj: + qualifier.storage = EvqIn; + if (!parseContext.handleInputGeometry(token.loc, ElgTrianglesAdjacency)) + return false; + break; + + default: + return true; + } + advanceToken(); + } while (true); +} + +// type_qualifier +// : qualifier qualifier ... +// +// Zero or more of these, so this can't return false. +// +bool HlslGrammar::acceptPostQualifier(TQualifier& qualifier) +{ + do { + switch (peek()) { + case EHTokConst: + qualifier.storage = EvqConst; + break; + default: + return true; + } + advanceToken(); + } while (true); +} + +// layout_qualifier_list +// : LAYOUT LEFT_PAREN layout_qualifier COMMA layout_qualifier ... RIGHT_PAREN +// +// layout_qualifier +// : identifier +// | identifier EQUAL expression +// +// Zero or more of these, so this can't return false. +// +bool HlslGrammar::acceptLayoutQualifierList(TQualifier& qualifier) +{ + if (! acceptTokenClass(EHTokLayout)) + return false; + + // LEFT_PAREN + if (! acceptTokenClass(EHTokLeftParen)) + return false; + + do { + // identifier + HlslToken idToken; + if (! acceptIdentifier(idToken)) + break; + + // EQUAL expression + if (acceptTokenClass(EHTokAssign)) { + TIntermTyped* expr; + if (! acceptConditionalExpression(expr)) { + expected("expression"); + return false; + } + parseContext.setLayoutQualifier(idToken.loc, qualifier, *idToken.string, expr); + } else + parseContext.setLayoutQualifier(idToken.loc, qualifier, *idToken.string); + + // COMMA + if (! acceptTokenClass(EHTokComma)) + break; + } while (true); + + // RIGHT_PAREN + if (! acceptTokenClass(EHTokRightParen)) { + expected(")"); + return false; + } + + return true; +} + +// template_type +// : FLOAT +// | DOUBLE +// | INT +// | DWORD +// | UINT +// | BOOL +// +bool HlslGrammar::acceptTemplateVecMatBasicType(TBasicType& basicType, + TPrecisionQualifier& precision) +{ + precision = EpqNone; + switch (peek()) { + case EHTokFloat: + basicType = EbtFloat; + break; + case EHTokDouble: + basicType = EbtDouble; + break; + case EHTokInt: + case EHTokDword: + basicType = EbtInt; + break; + case EHTokUint: + basicType = EbtUint; + break; + case EHTokBool: + basicType = EbtBool; + break; + case EHTokHalf: + basicType = parseContext.hlslEnable16BitTypes() ? EbtFloat16 : EbtFloat; + break; + case EHTokMin16float: + case EHTokMin10float: + basicType = parseContext.hlslEnable16BitTypes() ? EbtFloat16 : EbtFloat; + precision = EpqMedium; + break; + case EHTokMin16int: + case EHTokMin12int: + basicType = parseContext.hlslEnable16BitTypes() ? EbtInt16 : EbtInt; + precision = EpqMedium; + break; + case EHTokMin16uint: + basicType = parseContext.hlslEnable16BitTypes() ? EbtUint16 : EbtUint; + precision = EpqMedium; + break; + default: + return false; + } + + advanceToken(); + + return true; +} + +// vector_template_type +// : VECTOR +// | VECTOR LEFT_ANGLE template_type COMMA integer_literal RIGHT_ANGLE +// +bool HlslGrammar::acceptVectorTemplateType(TType& type) +{ + if (! acceptTokenClass(EHTokVector)) + return false; + + if (! acceptTokenClass(EHTokLeftAngle)) { + // in HLSL, 'vector' alone means float4. + new(&type) TType(EbtFloat, EvqTemporary, 4); + return true; + } + + TBasicType basicType; + TPrecisionQualifier precision; + if (! acceptTemplateVecMatBasicType(basicType, precision)) { + expected("scalar type"); + return false; + } + + // COMMA + if (! acceptTokenClass(EHTokComma)) { + expected(","); + return false; + } + + // integer + if (! peekTokenClass(EHTokIntConstant)) { + expected("literal integer"); + return false; + } + + TIntermTyped* vecSize; + if (! acceptLiteral(vecSize)) + return false; + + const int vecSizeI = vecSize->getAsConstantUnion()->getConstArray()[0].getIConst(); + + new(&type) TType(basicType, EvqTemporary, precision, vecSizeI); + + if (vecSizeI == 1) + type.makeVector(); + + if (!acceptTokenClass(EHTokRightAngle)) { + expected("right angle bracket"); + return false; + } + + return true; +} + +// matrix_template_type +// : MATRIX +// | MATRIX LEFT_ANGLE template_type COMMA integer_literal COMMA integer_literal RIGHT_ANGLE +// +bool HlslGrammar::acceptMatrixTemplateType(TType& type) +{ + if (! acceptTokenClass(EHTokMatrix)) + return false; + + if (! acceptTokenClass(EHTokLeftAngle)) { + // in HLSL, 'matrix' alone means float4x4. + new(&type) TType(EbtFloat, EvqTemporary, 0, 4, 4); + return true; + } + + TBasicType basicType; + TPrecisionQualifier precision; + if (! acceptTemplateVecMatBasicType(basicType, precision)) { + expected("scalar type"); + return false; + } + + // COMMA + if (! acceptTokenClass(EHTokComma)) { + expected(","); + return false; + } + + // integer rows + if (! peekTokenClass(EHTokIntConstant)) { + expected("literal integer"); + return false; + } + + TIntermTyped* rows; + if (! acceptLiteral(rows)) + return false; + + // COMMA + if (! acceptTokenClass(EHTokComma)) { + expected(","); + return false; + } + + // integer cols + if (! peekTokenClass(EHTokIntConstant)) { + expected("literal integer"); + return false; + } + + TIntermTyped* cols; + if (! acceptLiteral(cols)) + return false; + + new(&type) TType(basicType, EvqTemporary, precision, 0, + rows->getAsConstantUnion()->getConstArray()[0].getIConst(), + cols->getAsConstantUnion()->getConstArray()[0].getIConst()); + + if (!acceptTokenClass(EHTokRightAngle)) { + expected("right angle bracket"); + return false; + } + + return true; +} + +// layout_geometry +// : LINESTREAM +// | POINTSTREAM +// | TRIANGLESTREAM +// +bool HlslGrammar::acceptOutputPrimitiveGeometry(TLayoutGeometry& geometry) +{ + // read geometry type + const EHlslTokenClass geometryType = peek(); + + switch (geometryType) { + case EHTokPointStream: geometry = ElgPoints; break; + case EHTokLineStream: geometry = ElgLineStrip; break; + case EHTokTriangleStream: geometry = ElgTriangleStrip; break; + default: + return false; // not a layout geometry + } + + advanceToken(); // consume the layout keyword + return true; +} + +// tessellation_decl_type +// : INPUTPATCH +// | OUTPUTPATCH +// +bool HlslGrammar::acceptTessellationDeclType(TBuiltInVariable& patchType) +{ + // read geometry type + const EHlslTokenClass tessType = peek(); + + switch (tessType) { + case EHTokInputPatch: patchType = EbvInputPatch; break; + case EHTokOutputPatch: patchType = EbvOutputPatch; break; + default: + return false; // not a tessellation decl + } + + advanceToken(); // consume the keyword + return true; +} + +// tessellation_patch_template_type +// : tessellation_decl_type LEFT_ANGLE type comma integer_literal RIGHT_ANGLE +// +bool HlslGrammar::acceptTessellationPatchTemplateType(TType& type) +{ + TBuiltInVariable patchType; + + if (! acceptTessellationDeclType(patchType)) + return false; + + if (! acceptTokenClass(EHTokLeftAngle)) + return false; + + if (! acceptType(type)) { + expected("tessellation patch type"); + return false; + } + + if (! acceptTokenClass(EHTokComma)) + return false; + + // integer size + if (! peekTokenClass(EHTokIntConstant)) { + expected("literal integer"); + return false; + } + + TIntermTyped* size; + if (! acceptLiteral(size)) + return false; + + TArraySizes* arraySizes = new TArraySizes; + arraySizes->addInnerSize(size->getAsConstantUnion()->getConstArray()[0].getIConst()); + type.transferArraySizes(arraySizes); + type.getQualifier().builtIn = patchType; + + if (! acceptTokenClass(EHTokRightAngle)) { + expected("right angle bracket"); + return false; + } + + return true; +} + +// stream_out_template_type +// : output_primitive_geometry_type LEFT_ANGLE type RIGHT_ANGLE +// +bool HlslGrammar::acceptStreamOutTemplateType(TType& type, TLayoutGeometry& geometry) +{ + geometry = ElgNone; + + if (! acceptOutputPrimitiveGeometry(geometry)) + return false; + + if (! acceptTokenClass(EHTokLeftAngle)) + return false; + + if (! acceptType(type)) { + expected("stream output type"); + return false; + } + + type.getQualifier().storage = EvqOut; + type.getQualifier().builtIn = EbvGsOutputStream; + + if (! acceptTokenClass(EHTokRightAngle)) { + expected("right angle bracket"); + return false; + } + + return true; +} + +// annotations +// : LEFT_ANGLE declaration SEMI_COLON ... declaration SEMICOLON RIGHT_ANGLE +// +bool HlslGrammar::acceptAnnotations(TQualifier&) +{ + if (! acceptTokenClass(EHTokLeftAngle)) + return false; + + // note that we are nesting a name space + parseContext.nestAnnotations(); + + // declaration SEMI_COLON ... declaration SEMICOLON RIGHT_ANGLE + do { + // eat any extra SEMI_COLON; don't know if the grammar calls for this or not + while (acceptTokenClass(EHTokSemicolon)) + ; + + if (acceptTokenClass(EHTokRightAngle)) + break; + + // declaration + TIntermNode* node = nullptr; + if (! acceptDeclaration(node)) { + expected("declaration in annotation"); + return false; + } + } while (true); + + parseContext.unnestAnnotations(); + return true; +} + +// subpass input type +// : SUBPASSINPUT +// | SUBPASSINPUT VECTOR LEFT_ANGLE template_type RIGHT_ANGLE +// | SUBPASSINPUTMS +// | SUBPASSINPUTMS VECTOR LEFT_ANGLE template_type RIGHT_ANGLE +bool HlslGrammar::acceptSubpassInputType(TType& type) +{ + // read subpass type + const EHlslTokenClass subpassInputType = peek(); + + bool multisample; + + switch (subpassInputType) { + case EHTokSubpassInput: multisample = false; break; + case EHTokSubpassInputMS: multisample = true; break; + default: + return false; // not a subpass input declaration + } + + advanceToken(); // consume the sampler type keyword + + TType subpassType(EbtFloat, EvqUniform, 4); // default type is float4 + + if (acceptTokenClass(EHTokLeftAngle)) { + if (! acceptType(subpassType)) { + expected("scalar or vector type"); + return false; + } + + const TBasicType basicRetType = subpassType.getBasicType() ; + + switch (basicRetType) { + case EbtFloat: + case EbtUint: + case EbtInt: + case EbtStruct: + break; + default: + unimplemented("basic type in subpass input"); + return false; + } + + if (! acceptTokenClass(EHTokRightAngle)) { + expected("right angle bracket"); + return false; + } + } + + const TBasicType subpassBasicType = subpassType.isStruct() ? (*subpassType.getStruct())[0].type->getBasicType() + : subpassType.getBasicType(); + + TSampler sampler; + sampler.setSubpass(subpassBasicType, multisample); + + // Remember the declared return type. Function returns false on error. + if (!parseContext.setTextureReturnType(sampler, subpassType, token.loc)) + return false; + + type.shallowCopy(TType(sampler, EvqUniform)); + + return true; +} + +// sampler_type for DX9 compatibility +// : SAMPLER +// | SAMPLER1D +// | SAMPLER2D +// | SAMPLER3D +// | SAMPLERCUBE +bool HlslGrammar::acceptSamplerTypeDX9(TType &type) +{ + // read sampler type + const EHlslTokenClass samplerType = peek(); + + TSamplerDim dim = EsdNone; + TType txType(EbtFloat, EvqUniform, 4); // default type is float4 + + bool isShadow = false; + + switch (samplerType) + { + case EHTokSampler: dim = Esd2D; break; + case EHTokSampler1d: dim = Esd1D; break; + case EHTokSampler2d: dim = Esd2D; break; + case EHTokSampler3d: dim = Esd3D; break; + case EHTokSamplerCube: dim = EsdCube; break; + default: + return false; // not a dx9 sampler declaration + } + + advanceToken(); // consume the sampler type keyword + + TArraySizes *arraySizes = nullptr; // TODO: array + + TSampler sampler; + sampler.set(txType.getBasicType(), dim, false, isShadow, false); + + if (!parseContext.setTextureReturnType(sampler, txType, token.loc)) + return false; + + type.shallowCopy(TType(sampler, EvqUniform, arraySizes)); + type.getQualifier().layoutFormat = ElfNone; + + return true; +} + +// sampler_type +// : SAMPLER +// | SAMPLER1D +// | SAMPLER2D +// | SAMPLER3D +// | SAMPLERCUBE +// | SAMPLERSTATE +// | SAMPLERCOMPARISONSTATE +bool HlslGrammar::acceptSamplerType(TType& type) +{ + // read sampler type + const EHlslTokenClass samplerType = peek(); + + // TODO: for DX9 + // TSamplerDim dim = EsdNone; + + bool isShadow = false; + + switch (samplerType) { + case EHTokSampler: break; + case EHTokSampler1d: /*dim = Esd1D*/; break; + case EHTokSampler2d: /*dim = Esd2D*/; break; + case EHTokSampler3d: /*dim = Esd3D*/; break; + case EHTokSamplerCube: /*dim = EsdCube*/; break; + case EHTokSamplerState: break; + case EHTokSamplerComparisonState: isShadow = true; break; + default: + return false; // not a sampler declaration + } + + advanceToken(); // consume the sampler type keyword + + TArraySizes* arraySizes = nullptr; // TODO: array + + TSampler sampler; + sampler.setPureSampler(isShadow); + + type.shallowCopy(TType(sampler, EvqUniform, arraySizes)); + + return true; +} + +// texture_type +// | BUFFER +// | TEXTURE1D +// | TEXTURE1DARRAY +// | TEXTURE2D +// | TEXTURE2DARRAY +// | TEXTURE3D +// | TEXTURECUBE +// | TEXTURECUBEARRAY +// | TEXTURE2DMS +// | TEXTURE2DMSARRAY +// | RWBUFFER +// | RWTEXTURE1D +// | RWTEXTURE1DARRAY +// | RWTEXTURE2D +// | RWTEXTURE2DARRAY +// | RWTEXTURE3D + +bool HlslGrammar::acceptTextureType(TType& type) +{ + const EHlslTokenClass textureType = peek(); + + TSamplerDim dim = EsdNone; + bool array = false; + bool ms = false; + bool image = false; + bool combined = true; + + switch (textureType) { + case EHTokBuffer: dim = EsdBuffer; combined = false; break; + case EHTokTexture1d: dim = Esd1D; break; + case EHTokTexture1darray: dim = Esd1D; array = true; break; + case EHTokTexture2d: dim = Esd2D; break; + case EHTokTexture2darray: dim = Esd2D; array = true; break; + case EHTokTexture3d: dim = Esd3D; break; + case EHTokTextureCube: dim = EsdCube; break; + case EHTokTextureCubearray: dim = EsdCube; array = true; break; + case EHTokTexture2DMS: dim = Esd2D; ms = true; break; + case EHTokTexture2DMSarray: dim = Esd2D; array = true; ms = true; break; + case EHTokRWBuffer: dim = EsdBuffer; image=true; break; + case EHTokRWTexture1d: dim = Esd1D; array=false; image=true; break; + case EHTokRWTexture1darray: dim = Esd1D; array=true; image=true; break; + case EHTokRWTexture2d: dim = Esd2D; array=false; image=true; break; + case EHTokRWTexture2darray: dim = Esd2D; array=true; image=true; break; + case EHTokRWTexture3d: dim = Esd3D; array=false; image=true; break; + default: + return false; // not a texture declaration + } + + advanceToken(); // consume the texture object keyword + + TType txType(EbtFloat, EvqUniform, 4); // default type is float4 + + TIntermTyped* msCount = nullptr; + + // texture type: required for multisample types and RWBuffer/RWTextures! + if (acceptTokenClass(EHTokLeftAngle)) { + if (! acceptType(txType)) { + expected("scalar or vector type"); + return false; + } + + const TBasicType basicRetType = txType.getBasicType() ; + + switch (basicRetType) { + case EbtFloat: + case EbtUint: + case EbtInt: + case EbtStruct: + break; + default: + unimplemented("basic type in texture"); + return false; + } + + // Buffers can handle small mats if they fit in 4 components + if (dim == EsdBuffer && txType.isMatrix()) { + if ((txType.getMatrixCols() * txType.getMatrixRows()) > 4) { + expected("components < 4 in matrix buffer type"); + return false; + } + + // TODO: except we don't handle it yet... + unimplemented("matrix type in buffer"); + return false; + } + + if (!txType.isScalar() && !txType.isVector() && !txType.isStruct()) { + expected("scalar, vector, or struct type"); + return false; + } + + if (ms && acceptTokenClass(EHTokComma)) { + // read sample count for multisample types, if given + if (! peekTokenClass(EHTokIntConstant)) { + expected("multisample count"); + return false; + } + + if (! acceptLiteral(msCount)) // should never fail, since we just found an integer + return false; + } + + if (! acceptTokenClass(EHTokRightAngle)) { + expected("right angle bracket"); + return false; + } + } else if (ms) { + expected("texture type for multisample"); + return false; + } else if (image) { + expected("type for RWTexture/RWBuffer"); + return false; + } + + TArraySizes* arraySizes = nullptr; + const bool shadow = false; // declared on the sampler + + TSampler sampler; + TLayoutFormat format = ElfNone; + + // Buffer, RWBuffer and RWTexture (images) require a TLayoutFormat. We handle only a limit set. + if (image || dim == EsdBuffer) + format = parseContext.getLayoutFromTxType(token.loc, txType); + + const TBasicType txBasicType = txType.isStruct() ? (*txType.getStruct())[0].type->getBasicType() + : txType.getBasicType(); + + // Non-image Buffers are combined + if (dim == EsdBuffer && !image) { + sampler.set(txType.getBasicType(), dim, array); + } else { + // DX10 textures are separated. TODO: DX9. + if (image) { + sampler.setImage(txBasicType, dim, array, shadow, ms); + } else { + sampler.setTexture(txBasicType, dim, array, shadow, ms); + } + } + + // Remember the declared return type. Function returns false on error. + if (!parseContext.setTextureReturnType(sampler, txType, token.loc)) + return false; + + // Force uncombined, if necessary + if (!combined) + sampler.combined = false; + + type.shallowCopy(TType(sampler, EvqUniform, arraySizes)); + type.getQualifier().layoutFormat = format; + + return true; +} + +// If token is for a type, update 'type' with the type information, +// and return true and advance. +// Otherwise, return false, and don't advance +bool HlslGrammar::acceptType(TType& type) +{ + TIntermNode* nodeList = nullptr; + return acceptType(type, nodeList); +} +bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList) +{ + // Basic types for min* types, use native halfs if the option allows them. + bool enable16BitTypes = parseContext.hlslEnable16BitTypes(); + + const TBasicType min16float_bt = enable16BitTypes ? EbtFloat16 : EbtFloat; + const TBasicType min10float_bt = enable16BitTypes ? EbtFloat16 : EbtFloat; + const TBasicType half_bt = enable16BitTypes ? EbtFloat16 : EbtFloat; + const TBasicType min16int_bt = enable16BitTypes ? EbtInt16 : EbtInt; + const TBasicType min12int_bt = enable16BitTypes ? EbtInt16 : EbtInt; + const TBasicType min16uint_bt = enable16BitTypes ? EbtUint16 : EbtUint; + + // Some types might have turned into identifiers. Take the hit for checking + // when this has happened. + if (typeIdentifiers) { + const char* identifierString = getTypeString(peek()); + if (identifierString != nullptr) { + TString name = identifierString; + // if it's an identifier, it's not a type + if (parseContext.symbolTable.find(name) != nullptr) + return false; + } + } + + bool isUnorm = false; + bool isSnorm = false; + + // Accept snorm and unorm. Presently, this is ignored, save for an error check below. + switch (peek()) { + case EHTokUnorm: + isUnorm = true; + advanceToken(); // eat the token + break; + case EHTokSNorm: + isSnorm = true; + advanceToken(); // eat the token + break; + default: + break; + } + + switch (peek()) { + case EHTokVector: + return acceptVectorTemplateType(type); + break; + + case EHTokMatrix: + return acceptMatrixTemplateType(type); + break; + + case EHTokPointStream: // fall through + case EHTokLineStream: // ... + case EHTokTriangleStream: // ... + { + TLayoutGeometry geometry; + if (! acceptStreamOutTemplateType(type, geometry)) + return false; + + if (! parseContext.handleOutputGeometry(token.loc, geometry)) + return false; + + return true; + } + + case EHTokInputPatch: // fall through + case EHTokOutputPatch: // ... + { + if (! acceptTessellationPatchTemplateType(type)) + return false; + + return true; + } + + case EHTokSampler: // fall through + case EHTokSampler1d: // ... + case EHTokSampler2d: // ... + case EHTokSampler3d: // ... + case EHTokSamplerCube: // ... + if (parseContext.hlslDX9Compatible()) + return acceptSamplerTypeDX9(type); + else + return acceptSamplerType(type); + break; + + case EHTokSamplerState: // fall through + case EHTokSamplerComparisonState: // ... + return acceptSamplerType(type); + break; + + case EHTokSubpassInput: // fall through + case EHTokSubpassInputMS: // ... + return acceptSubpassInputType(type); + break; + + case EHTokBuffer: // fall through + case EHTokTexture1d: // ... + case EHTokTexture1darray: // ... + case EHTokTexture2d: // ... + case EHTokTexture2darray: // ... + case EHTokTexture3d: // ... + case EHTokTextureCube: // ... + case EHTokTextureCubearray: // ... + case EHTokTexture2DMS: // ... + case EHTokTexture2DMSarray: // ... + case EHTokRWTexture1d: // ... + case EHTokRWTexture1darray: // ... + case EHTokRWTexture2d: // ... + case EHTokRWTexture2darray: // ... + case EHTokRWTexture3d: // ... + case EHTokRWBuffer: // ... + return acceptTextureType(type); + break; + + case EHTokAppendStructuredBuffer: + case EHTokByteAddressBuffer: + case EHTokConsumeStructuredBuffer: + case EHTokRWByteAddressBuffer: + case EHTokRWStructuredBuffer: + case EHTokStructuredBuffer: + return acceptStructBufferType(type); + break; + + case EHTokTextureBuffer: + return acceptTextureBufferType(type); + break; + + case EHTokConstantBuffer: + return acceptConstantBufferType(type); + + case EHTokClass: + case EHTokStruct: + case EHTokCBuffer: + case EHTokTBuffer: + return acceptStruct(type, nodeList); + + case EHTokIdentifier: + // An identifier could be for a user-defined type. + // Note we cache the symbol table lookup, to save for a later rule + // when this is not a type. + if (parseContext.lookupUserType(*token.string, type) != nullptr) { + advanceToken(); + return true; + } else + return false; + + case EHTokVoid: + new(&type) TType(EbtVoid); + break; + + case EHTokString: + new(&type) TType(EbtString); + break; + + case EHTokFloat: + new(&type) TType(EbtFloat); + break; + case EHTokFloat1: + new(&type) TType(EbtFloat); + type.makeVector(); + break; + case EHTokFloat2: + new(&type) TType(EbtFloat, EvqTemporary, 2); + break; + case EHTokFloat3: + new(&type) TType(EbtFloat, EvqTemporary, 3); + break; + case EHTokFloat4: + new(&type) TType(EbtFloat, EvqTemporary, 4); + break; + + case EHTokDouble: + new(&type) TType(EbtDouble); + break; + case EHTokDouble1: + new(&type) TType(EbtDouble); + type.makeVector(); + break; + case EHTokDouble2: + new(&type) TType(EbtDouble, EvqTemporary, 2); + break; + case EHTokDouble3: + new(&type) TType(EbtDouble, EvqTemporary, 3); + break; + case EHTokDouble4: + new(&type) TType(EbtDouble, EvqTemporary, 4); + break; + + case EHTokInt: + case EHTokDword: + new(&type) TType(EbtInt); + break; + case EHTokInt1: + new(&type) TType(EbtInt); + type.makeVector(); + break; + case EHTokInt2: + new(&type) TType(EbtInt, EvqTemporary, 2); + break; + case EHTokInt3: + new(&type) TType(EbtInt, EvqTemporary, 3); + break; + case EHTokInt4: + new(&type) TType(EbtInt, EvqTemporary, 4); + break; + + case EHTokUint: + new(&type) TType(EbtUint); + break; + case EHTokUint1: + new(&type) TType(EbtUint); + type.makeVector(); + break; + case EHTokUint2: + new(&type) TType(EbtUint, EvqTemporary, 2); + break; + case EHTokUint3: + new(&type) TType(EbtUint, EvqTemporary, 3); + break; + case EHTokUint4: + new(&type) TType(EbtUint, EvqTemporary, 4); + break; + + case EHTokUint64: + new(&type) TType(EbtUint64); + break; + + case EHTokBool: + new(&type) TType(EbtBool); + break; + case EHTokBool1: + new(&type) TType(EbtBool); + type.makeVector(); + break; + case EHTokBool2: + new(&type) TType(EbtBool, EvqTemporary, 2); + break; + case EHTokBool3: + new(&type) TType(EbtBool, EvqTemporary, 3); + break; + case EHTokBool4: + new(&type) TType(EbtBool, EvqTemporary, 4); + break; + + case EHTokHalf: + new(&type) TType(half_bt, EvqTemporary); + break; + case EHTokHalf1: + new(&type) TType(half_bt, EvqTemporary); + type.makeVector(); + break; + case EHTokHalf2: + new(&type) TType(half_bt, EvqTemporary, 2); + break; + case EHTokHalf3: + new(&type) TType(half_bt, EvqTemporary, 3); + break; + case EHTokHalf4: + new(&type) TType(half_bt, EvqTemporary, 4); + break; + + case EHTokMin16float: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium); + break; + case EHTokMin16float1: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium); + type.makeVector(); + break; + case EHTokMin16float2: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 2); + break; + case EHTokMin16float3: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 3); + break; + case EHTokMin16float4: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 4); + break; + + case EHTokMin10float: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium); + break; + case EHTokMin10float1: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium); + type.makeVector(); + break; + case EHTokMin10float2: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 2); + break; + case EHTokMin10float3: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 3); + break; + case EHTokMin10float4: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 4); + break; + + case EHTokMin16int: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium); + break; + case EHTokMin16int1: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium); + type.makeVector(); + break; + case EHTokMin16int2: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 2); + break; + case EHTokMin16int3: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 3); + break; + case EHTokMin16int4: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 4); + break; + + case EHTokMin12int: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium); + break; + case EHTokMin12int1: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium); + type.makeVector(); + break; + case EHTokMin12int2: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 2); + break; + case EHTokMin12int3: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 3); + break; + case EHTokMin12int4: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 4); + break; + + case EHTokMin16uint: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium); + break; + case EHTokMin16uint1: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium); + type.makeVector(); + break; + case EHTokMin16uint2: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 2); + break; + case EHTokMin16uint3: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 3); + break; + case EHTokMin16uint4: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 4); + break; + + case EHTokInt1x1: + new(&type) TType(EbtInt, EvqTemporary, 0, 1, 1); + break; + case EHTokInt1x2: + new(&type) TType(EbtInt, EvqTemporary, 0, 1, 2); + break; + case EHTokInt1x3: + new(&type) TType(EbtInt, EvqTemporary, 0, 1, 3); + break; + case EHTokInt1x4: + new(&type) TType(EbtInt, EvqTemporary, 0, 1, 4); + break; + case EHTokInt2x1: + new(&type) TType(EbtInt, EvqTemporary, 0, 2, 1); + break; + case EHTokInt2x2: + new(&type) TType(EbtInt, EvqTemporary, 0, 2, 2); + break; + case EHTokInt2x3: + new(&type) TType(EbtInt, EvqTemporary, 0, 2, 3); + break; + case EHTokInt2x4: + new(&type) TType(EbtInt, EvqTemporary, 0, 2, 4); + break; + case EHTokInt3x1: + new(&type) TType(EbtInt, EvqTemporary, 0, 3, 1); + break; + case EHTokInt3x2: + new(&type) TType(EbtInt, EvqTemporary, 0, 3, 2); + break; + case EHTokInt3x3: + new(&type) TType(EbtInt, EvqTemporary, 0, 3, 3); + break; + case EHTokInt3x4: + new(&type) TType(EbtInt, EvqTemporary, 0, 3, 4); + break; + case EHTokInt4x1: + new(&type) TType(EbtInt, EvqTemporary, 0, 4, 1); + break; + case EHTokInt4x2: + new(&type) TType(EbtInt, EvqTemporary, 0, 4, 2); + break; + case EHTokInt4x3: + new(&type) TType(EbtInt, EvqTemporary, 0, 4, 3); + break; + case EHTokInt4x4: + new(&type) TType(EbtInt, EvqTemporary, 0, 4, 4); + break; + + case EHTokUint1x1: + new(&type) TType(EbtUint, EvqTemporary, 0, 1, 1); + break; + case EHTokUint1x2: + new(&type) TType(EbtUint, EvqTemporary, 0, 1, 2); + break; + case EHTokUint1x3: + new(&type) TType(EbtUint, EvqTemporary, 0, 1, 3); + break; + case EHTokUint1x4: + new(&type) TType(EbtUint, EvqTemporary, 0, 1, 4); + break; + case EHTokUint2x1: + new(&type) TType(EbtUint, EvqTemporary, 0, 2, 1); + break; + case EHTokUint2x2: + new(&type) TType(EbtUint, EvqTemporary, 0, 2, 2); + break; + case EHTokUint2x3: + new(&type) TType(EbtUint, EvqTemporary, 0, 2, 3); + break; + case EHTokUint2x4: + new(&type) TType(EbtUint, EvqTemporary, 0, 2, 4); + break; + case EHTokUint3x1: + new(&type) TType(EbtUint, EvqTemporary, 0, 3, 1); + break; + case EHTokUint3x2: + new(&type) TType(EbtUint, EvqTemporary, 0, 3, 2); + break; + case EHTokUint3x3: + new(&type) TType(EbtUint, EvqTemporary, 0, 3, 3); + break; + case EHTokUint3x4: + new(&type) TType(EbtUint, EvqTemporary, 0, 3, 4); + break; + case EHTokUint4x1: + new(&type) TType(EbtUint, EvqTemporary, 0, 4, 1); + break; + case EHTokUint4x2: + new(&type) TType(EbtUint, EvqTemporary, 0, 4, 2); + break; + case EHTokUint4x3: + new(&type) TType(EbtUint, EvqTemporary, 0, 4, 3); + break; + case EHTokUint4x4: + new(&type) TType(EbtUint, EvqTemporary, 0, 4, 4); + break; + + case EHTokBool1x1: + new(&type) TType(EbtBool, EvqTemporary, 0, 1, 1); + break; + case EHTokBool1x2: + new(&type) TType(EbtBool, EvqTemporary, 0, 1, 2); + break; + case EHTokBool1x3: + new(&type) TType(EbtBool, EvqTemporary, 0, 1, 3); + break; + case EHTokBool1x4: + new(&type) TType(EbtBool, EvqTemporary, 0, 1, 4); + break; + case EHTokBool2x1: + new(&type) TType(EbtBool, EvqTemporary, 0, 2, 1); + break; + case EHTokBool2x2: + new(&type) TType(EbtBool, EvqTemporary, 0, 2, 2); + break; + case EHTokBool2x3: + new(&type) TType(EbtBool, EvqTemporary, 0, 2, 3); + break; + case EHTokBool2x4: + new(&type) TType(EbtBool, EvqTemporary, 0, 2, 4); + break; + case EHTokBool3x1: + new(&type) TType(EbtBool, EvqTemporary, 0, 3, 1); + break; + case EHTokBool3x2: + new(&type) TType(EbtBool, EvqTemporary, 0, 3, 2); + break; + case EHTokBool3x3: + new(&type) TType(EbtBool, EvqTemporary, 0, 3, 3); + break; + case EHTokBool3x4: + new(&type) TType(EbtBool, EvqTemporary, 0, 3, 4); + break; + case EHTokBool4x1: + new(&type) TType(EbtBool, EvqTemporary, 0, 4, 1); + break; + case EHTokBool4x2: + new(&type) TType(EbtBool, EvqTemporary, 0, 4, 2); + break; + case EHTokBool4x3: + new(&type) TType(EbtBool, EvqTemporary, 0, 4, 3); + break; + case EHTokBool4x4: + new(&type) TType(EbtBool, EvqTemporary, 0, 4, 4); + break; + + case EHTokFloat1x1: + new(&type) TType(EbtFloat, EvqTemporary, 0, 1, 1); + break; + case EHTokFloat1x2: + new(&type) TType(EbtFloat, EvqTemporary, 0, 1, 2); + break; + case EHTokFloat1x3: + new(&type) TType(EbtFloat, EvqTemporary, 0, 1, 3); + break; + case EHTokFloat1x4: + new(&type) TType(EbtFloat, EvqTemporary, 0, 1, 4); + break; + case EHTokFloat2x1: + new(&type) TType(EbtFloat, EvqTemporary, 0, 2, 1); + break; + case EHTokFloat2x2: + new(&type) TType(EbtFloat, EvqTemporary, 0, 2, 2); + break; + case EHTokFloat2x3: + new(&type) TType(EbtFloat, EvqTemporary, 0, 2, 3); + break; + case EHTokFloat2x4: + new(&type) TType(EbtFloat, EvqTemporary, 0, 2, 4); + break; + case EHTokFloat3x1: + new(&type) TType(EbtFloat, EvqTemporary, 0, 3, 1); + break; + case EHTokFloat3x2: + new(&type) TType(EbtFloat, EvqTemporary, 0, 3, 2); + break; + case EHTokFloat3x3: + new(&type) TType(EbtFloat, EvqTemporary, 0, 3, 3); + break; + case EHTokFloat3x4: + new(&type) TType(EbtFloat, EvqTemporary, 0, 3, 4); + break; + case EHTokFloat4x1: + new(&type) TType(EbtFloat, EvqTemporary, 0, 4, 1); + break; + case EHTokFloat4x2: + new(&type) TType(EbtFloat, EvqTemporary, 0, 4, 2); + break; + case EHTokFloat4x3: + new(&type) TType(EbtFloat, EvqTemporary, 0, 4, 3); + break; + case EHTokFloat4x4: + new(&type) TType(EbtFloat, EvqTemporary, 0, 4, 4); + break; + + case EHTokHalf1x1: + new(&type) TType(half_bt, EvqTemporary, 0, 1, 1); + break; + case EHTokHalf1x2: + new(&type) TType(half_bt, EvqTemporary, 0, 1, 2); + break; + case EHTokHalf1x3: + new(&type) TType(half_bt, EvqTemporary, 0, 1, 3); + break; + case EHTokHalf1x4: + new(&type) TType(half_bt, EvqTemporary, 0, 1, 4); + break; + case EHTokHalf2x1: + new(&type) TType(half_bt, EvqTemporary, 0, 2, 1); + break; + case EHTokHalf2x2: + new(&type) TType(half_bt, EvqTemporary, 0, 2, 2); + break; + case EHTokHalf2x3: + new(&type) TType(half_bt, EvqTemporary, 0, 2, 3); + break; + case EHTokHalf2x4: + new(&type) TType(half_bt, EvqTemporary, 0, 2, 4); + break; + case EHTokHalf3x1: + new(&type) TType(half_bt, EvqTemporary, 0, 3, 1); + break; + case EHTokHalf3x2: + new(&type) TType(half_bt, EvqTemporary, 0, 3, 2); + break; + case EHTokHalf3x3: + new(&type) TType(half_bt, EvqTemporary, 0, 3, 3); + break; + case EHTokHalf3x4: + new(&type) TType(half_bt, EvqTemporary, 0, 3, 4); + break; + case EHTokHalf4x1: + new(&type) TType(half_bt, EvqTemporary, 0, 4, 1); + break; + case EHTokHalf4x2: + new(&type) TType(half_bt, EvqTemporary, 0, 4, 2); + break; + case EHTokHalf4x3: + new(&type) TType(half_bt, EvqTemporary, 0, 4, 3); + break; + case EHTokHalf4x4: + new(&type) TType(half_bt, EvqTemporary, 0, 4, 4); + break; + + case EHTokDouble1x1: + new(&type) TType(EbtDouble, EvqTemporary, 0, 1, 1); + break; + case EHTokDouble1x2: + new(&type) TType(EbtDouble, EvqTemporary, 0, 1, 2); + break; + case EHTokDouble1x3: + new(&type) TType(EbtDouble, EvqTemporary, 0, 1, 3); + break; + case EHTokDouble1x4: + new(&type) TType(EbtDouble, EvqTemporary, 0, 1, 4); + break; + case EHTokDouble2x1: + new(&type) TType(EbtDouble, EvqTemporary, 0, 2, 1); + break; + case EHTokDouble2x2: + new(&type) TType(EbtDouble, EvqTemporary, 0, 2, 2); + break; + case EHTokDouble2x3: + new(&type) TType(EbtDouble, EvqTemporary, 0, 2, 3); + break; + case EHTokDouble2x4: + new(&type) TType(EbtDouble, EvqTemporary, 0, 2, 4); + break; + case EHTokDouble3x1: + new(&type) TType(EbtDouble, EvqTemporary, 0, 3, 1); + break; + case EHTokDouble3x2: + new(&type) TType(EbtDouble, EvqTemporary, 0, 3, 2); + break; + case EHTokDouble3x3: + new(&type) TType(EbtDouble, EvqTemporary, 0, 3, 3); + break; + case EHTokDouble3x4: + new(&type) TType(EbtDouble, EvqTemporary, 0, 3, 4); + break; + case EHTokDouble4x1: + new(&type) TType(EbtDouble, EvqTemporary, 0, 4, 1); + break; + case EHTokDouble4x2: + new(&type) TType(EbtDouble, EvqTemporary, 0, 4, 2); + break; + case EHTokDouble4x3: + new(&type) TType(EbtDouble, EvqTemporary, 0, 4, 3); + break; + case EHTokDouble4x4: + new(&type) TType(EbtDouble, EvqTemporary, 0, 4, 4); + break; + + case EHTokMin16float1x1: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 1, 1); + break; + case EHTokMin16float1x2: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 1, 2); + break; + case EHTokMin16float1x3: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 1, 3); + break; + case EHTokMin16float1x4: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 1, 4); + break; + case EHTokMin16float2x1: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 2, 1); + break; + case EHTokMin16float2x2: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 2, 2); + break; + case EHTokMin16float2x3: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 2, 3); + break; + case EHTokMin16float2x4: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 2, 4); + break; + case EHTokMin16float3x1: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 3, 1); + break; + case EHTokMin16float3x2: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 3, 2); + break; + case EHTokMin16float3x3: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 3, 3); + break; + case EHTokMin16float3x4: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 3, 4); + break; + case EHTokMin16float4x1: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 4, 1); + break; + case EHTokMin16float4x2: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 4, 2); + break; + case EHTokMin16float4x3: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 4, 3); + break; + case EHTokMin16float4x4: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 4, 4); + break; + + case EHTokMin10float1x1: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 1, 1); + break; + case EHTokMin10float1x2: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 1, 2); + break; + case EHTokMin10float1x3: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 1, 3); + break; + case EHTokMin10float1x4: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 1, 4); + break; + case EHTokMin10float2x1: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 2, 1); + break; + case EHTokMin10float2x2: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 2, 2); + break; + case EHTokMin10float2x3: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 2, 3); + break; + case EHTokMin10float2x4: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 2, 4); + break; + case EHTokMin10float3x1: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 3, 1); + break; + case EHTokMin10float3x2: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 3, 2); + break; + case EHTokMin10float3x3: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 3, 3); + break; + case EHTokMin10float3x4: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 3, 4); + break; + case EHTokMin10float4x1: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 4, 1); + break; + case EHTokMin10float4x2: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 4, 2); + break; + case EHTokMin10float4x3: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 4, 3); + break; + case EHTokMin10float4x4: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 4, 4); + break; + + case EHTokMin16int1x1: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 1, 1); + break; + case EHTokMin16int1x2: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 1, 2); + break; + case EHTokMin16int1x3: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 1, 3); + break; + case EHTokMin16int1x4: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 1, 4); + break; + case EHTokMin16int2x1: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 2, 1); + break; + case EHTokMin16int2x2: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 2, 2); + break; + case EHTokMin16int2x3: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 2, 3); + break; + case EHTokMin16int2x4: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 2, 4); + break; + case EHTokMin16int3x1: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 3, 1); + break; + case EHTokMin16int3x2: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 3, 2); + break; + case EHTokMin16int3x3: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 3, 3); + break; + case EHTokMin16int3x4: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 3, 4); + break; + case EHTokMin16int4x1: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 4, 1); + break; + case EHTokMin16int4x2: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 4, 2); + break; + case EHTokMin16int4x3: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 4, 3); + break; + case EHTokMin16int4x4: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 4, 4); + break; + + case EHTokMin12int1x1: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 1, 1); + break; + case EHTokMin12int1x2: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 1, 2); + break; + case EHTokMin12int1x3: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 1, 3); + break; + case EHTokMin12int1x4: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 1, 4); + break; + case EHTokMin12int2x1: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 2, 1); + break; + case EHTokMin12int2x2: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 2, 2); + break; + case EHTokMin12int2x3: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 2, 3); + break; + case EHTokMin12int2x4: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 2, 4); + break; + case EHTokMin12int3x1: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 3, 1); + break; + case EHTokMin12int3x2: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 3, 2); + break; + case EHTokMin12int3x3: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 3, 3); + break; + case EHTokMin12int3x4: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 3, 4); + break; + case EHTokMin12int4x1: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 4, 1); + break; + case EHTokMin12int4x2: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 4, 2); + break; + case EHTokMin12int4x3: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 4, 3); + break; + case EHTokMin12int4x4: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 4, 4); + break; + + case EHTokMin16uint1x1: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 1, 1); + break; + case EHTokMin16uint1x2: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 1, 2); + break; + case EHTokMin16uint1x3: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 1, 3); + break; + case EHTokMin16uint1x4: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 1, 4); + break; + case EHTokMin16uint2x1: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 2, 1); + break; + case EHTokMin16uint2x2: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 2, 2); + break; + case EHTokMin16uint2x3: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 2, 3); + break; + case EHTokMin16uint2x4: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 2, 4); + break; + case EHTokMin16uint3x1: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 3, 1); + break; + case EHTokMin16uint3x2: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 3, 2); + break; + case EHTokMin16uint3x3: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 3, 3); + break; + case EHTokMin16uint3x4: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 3, 4); + break; + case EHTokMin16uint4x1: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 4, 1); + break; + case EHTokMin16uint4x2: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 4, 2); + break; + case EHTokMin16uint4x3: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 4, 3); + break; + case EHTokMin16uint4x4: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 4, 4); + break; + + default: + return false; + } + + advanceToken(); + + if ((isUnorm || isSnorm) && !type.isFloatingDomain()) { + parseContext.error(token.loc, "unorm and snorm only valid in floating point domain", "", ""); + return false; + } + + return true; +} + +// struct +// : struct_type IDENTIFIER post_decls LEFT_BRACE struct_declaration_list RIGHT_BRACE +// | struct_type post_decls LEFT_BRACE struct_declaration_list RIGHT_BRACE +// | struct_type IDENTIFIER // use of previously declared struct type +// +// struct_type +// : STRUCT +// | CLASS +// | CBUFFER +// | TBUFFER +// +bool HlslGrammar::acceptStruct(TType& type, TIntermNode*& nodeList) +{ + // This storage qualifier will tell us whether it's an AST + // block type or just a generic structure type. + TStorageQualifier storageQualifier = EvqTemporary; + bool readonly = false; + + if (acceptTokenClass(EHTokCBuffer)) { + // CBUFFER + storageQualifier = EvqUniform; + } else if (acceptTokenClass(EHTokTBuffer)) { + // TBUFFER + storageQualifier = EvqBuffer; + readonly = true; + } else if (! acceptTokenClass(EHTokClass) && ! acceptTokenClass(EHTokStruct)) { + // Neither CLASS nor STRUCT + return false; + } + + // Now known to be one of CBUFFER, TBUFFER, CLASS, or STRUCT + + + // IDENTIFIER. It might also be a keyword which can double as an identifier. + // For example: 'cbuffer ConstantBuffer' or 'struct ConstantBuffer' is legal. + // 'cbuffer int' is also legal, and 'struct int' appears rejected only because + // it attempts to redefine the 'int' type. + const char* idString = getTypeString(peek()); + TString structName = ""; + if (peekTokenClass(EHTokIdentifier) || idString != nullptr) { + if (idString != nullptr) + structName = *idString; + else + structName = *token.string; + advanceToken(); + } + + // post_decls + TQualifier postDeclQualifier; + postDeclQualifier.clear(); + bool postDeclsFound = acceptPostDecls(postDeclQualifier); + + // LEFT_BRACE, or + // struct_type IDENTIFIER + if (! acceptTokenClass(EHTokLeftBrace)) { + if (structName.size() > 0 && !postDeclsFound && parseContext.lookupUserType(structName, type) != nullptr) { + // struct_type IDENTIFIER + return true; + } else { + expected("{"); + return false; + } + } + + + // struct_declaration_list + TTypeList* typeList; + // Save each member function so they can be processed after we have a fully formed 'this'. + TVector functionDeclarators; + + parseContext.pushNamespace(structName); + bool acceptedList = acceptStructDeclarationList(typeList, nodeList, functionDeclarators); + parseContext.popNamespace(); + + if (! acceptedList) { + expected("struct member declarations"); + return false; + } + + // RIGHT_BRACE + if (! acceptTokenClass(EHTokRightBrace)) { + expected("}"); + return false; + } + + // create the user-defined type + if (storageQualifier == EvqTemporary) + new(&type) TType(typeList, structName); + else { + postDeclQualifier.storage = storageQualifier; + postDeclQualifier.readonly = readonly; + new(&type) TType(typeList, structName, postDeclQualifier); // sets EbtBlock + } + + parseContext.declareStruct(token.loc, structName, type); + + // For member functions: now that we know the type of 'this', go back and + // - add their implicit argument with 'this' (not to the mangling, just the argument list) + // - parse the functions, their tokens were saved for deferred parsing (now) + for (int b = 0; b < (int)functionDeclarators.size(); ++b) { + // update signature + if (functionDeclarators[b].function->hasImplicitThis()) + functionDeclarators[b].function->addThisParameter(type, intermediate.implicitThisName); + } + + // All member functions get parsed inside the class/struct namespace and with the + // class/struct members in a symbol-table level. + parseContext.pushNamespace(structName); + parseContext.pushThisScope(type, functionDeclarators); + bool deferredSuccess = true; + for (int b = 0; b < (int)functionDeclarators.size() && deferredSuccess; ++b) { + // parse body + pushTokenStream(functionDeclarators[b].body); + if (! acceptFunctionBody(functionDeclarators[b], nodeList)) + deferredSuccess = false; + popTokenStream(); + } + parseContext.popThisScope(); + parseContext.popNamespace(); + + return deferredSuccess; +} + +// constantbuffer +// : CONSTANTBUFFER LEFT_ANGLE type RIGHT_ANGLE +bool HlslGrammar::acceptConstantBufferType(TType& type) +{ + if (! acceptTokenClass(EHTokConstantBuffer)) + return false; + + if (! acceptTokenClass(EHTokLeftAngle)) { + expected("left angle bracket"); + return false; + } + + TType templateType; + if (! acceptType(templateType)) { + expected("type"); + return false; + } + + if (! acceptTokenClass(EHTokRightAngle)) { + expected("right angle bracket"); + return false; + } + + TQualifier postDeclQualifier; + postDeclQualifier.clear(); + postDeclQualifier.storage = EvqUniform; + + if (templateType.isStruct()) { + // Make a block from the type parsed as the template argument + TTypeList* typeList = templateType.getWritableStruct(); + new(&type) TType(typeList, "", postDeclQualifier); // sets EbtBlock + + type.getQualifier().storage = EvqUniform; + + return true; + } else { + parseContext.error(token.loc, "non-structure type in ConstantBuffer", "", ""); + return false; + } +} + +// texture_buffer +// : TEXTUREBUFFER LEFT_ANGLE type RIGHT_ANGLE +bool HlslGrammar::acceptTextureBufferType(TType& type) +{ + if (! acceptTokenClass(EHTokTextureBuffer)) + return false; + + if (! acceptTokenClass(EHTokLeftAngle)) { + expected("left angle bracket"); + return false; + } + + TType templateType; + if (! acceptType(templateType)) { + expected("type"); + return false; + } + + if (! acceptTokenClass(EHTokRightAngle)) { + expected("right angle bracket"); + return false; + } + + templateType.getQualifier().storage = EvqBuffer; + templateType.getQualifier().readonly = true; + + TType blockType(templateType.getWritableStruct(), "", templateType.getQualifier()); + + blockType.getQualifier().storage = EvqBuffer; + blockType.getQualifier().readonly = true; + + type.shallowCopy(blockType); + + return true; +} + + +// struct_buffer +// : APPENDSTRUCTUREDBUFFER +// | BYTEADDRESSBUFFER +// | CONSUMESTRUCTUREDBUFFER +// | RWBYTEADDRESSBUFFER +// | RWSTRUCTUREDBUFFER +// | STRUCTUREDBUFFER +bool HlslGrammar::acceptStructBufferType(TType& type) +{ + const EHlslTokenClass structBuffType = peek(); + + // TODO: globallycoherent + bool hasTemplateType = true; + bool readonly = false; + + TStorageQualifier storage = EvqBuffer; + TBuiltInVariable builtinType = EbvNone; + + switch (structBuffType) { + case EHTokAppendStructuredBuffer: + builtinType = EbvAppendConsume; + break; + case EHTokByteAddressBuffer: + hasTemplateType = false; + readonly = true; + builtinType = EbvByteAddressBuffer; + break; + case EHTokConsumeStructuredBuffer: + builtinType = EbvAppendConsume; + break; + case EHTokRWByteAddressBuffer: + hasTemplateType = false; + builtinType = EbvRWByteAddressBuffer; + break; + case EHTokRWStructuredBuffer: + builtinType = EbvRWStructuredBuffer; + break; + case EHTokStructuredBuffer: + builtinType = EbvStructuredBuffer; + readonly = true; + break; + default: + return false; // not a structure buffer type + } + + advanceToken(); // consume the structure keyword + + // type on which this StructedBuffer is templatized. E.g, StructedBuffer ==> MyStruct + TType* templateType = new TType; + + if (hasTemplateType) { + if (! acceptTokenClass(EHTokLeftAngle)) { + expected("left angle bracket"); + return false; + } + + if (! acceptType(*templateType)) { + expected("type"); + return false; + } + if (! acceptTokenClass(EHTokRightAngle)) { + expected("right angle bracket"); + return false; + } + } else { + // byte address buffers have no explicit type. + TType uintType(EbtUint, storage); + templateType->shallowCopy(uintType); + } + + // Create an unsized array out of that type. + // TODO: does this work if it's already an array type? + TArraySizes* unsizedArray = new TArraySizes; + unsizedArray->addInnerSize(UnsizedArraySize); + templateType->transferArraySizes(unsizedArray); + templateType->getQualifier().storage = storage; + + // field name is canonical for all structbuffers + templateType->setFieldName("@data"); + + TTypeList* blockStruct = new TTypeList; + TTypeLoc member = { templateType, token.loc }; + blockStruct->push_back(member); + + // This is the type of the buffer block (SSBO) + TType blockType(blockStruct, "", templateType->getQualifier()); + + blockType.getQualifier().storage = storage; + blockType.getQualifier().readonly = readonly; + blockType.getQualifier().builtIn = builtinType; + + // We may have created an equivalent type before, in which case we should use its + // deep structure. + parseContext.shareStructBufferType(blockType); + + type.shallowCopy(blockType); + + return true; +} + +// struct_declaration_list +// : struct_declaration SEMI_COLON struct_declaration SEMI_COLON ... +// +// struct_declaration +// : attributes fully_specified_type struct_declarator COMMA struct_declarator ... +// | attributes fully_specified_type IDENTIFIER function_parameters post_decls compound_statement // member-function definition +// +// struct_declarator +// : IDENTIFIER post_decls +// | IDENTIFIER array_specifier post_decls +// | IDENTIFIER function_parameters post_decls // member-function prototype +// +bool HlslGrammar::acceptStructDeclarationList(TTypeList*& typeList, TIntermNode*& nodeList, + TVector& declarators) +{ + typeList = new TTypeList(); + HlslToken idToken; + + do { + // success on seeing the RIGHT_BRACE coming up + if (peekTokenClass(EHTokRightBrace)) + break; + + // struct_declaration + + // attributes + TAttributes attributes; + acceptAttributes(attributes); + + bool declarator_list = false; + + // fully_specified_type + TType memberType; + if (! acceptFullySpecifiedType(memberType, nodeList, attributes)) { + expected("member type"); + return false; + } + + // merge in the attributes + parseContext.transferTypeAttributes(token.loc, attributes, memberType); + + // struct_declarator COMMA struct_declarator ... + bool functionDefinitionAccepted = false; + do { + if (! acceptIdentifier(idToken)) { + expected("member name"); + return false; + } + + if (peekTokenClass(EHTokLeftParen)) { + // function_parameters + if (!declarator_list) { + declarators.resize(declarators.size() + 1); + // request a token stream for deferred processing + functionDefinitionAccepted = acceptMemberFunctionDefinition(nodeList, memberType, *idToken.string, + declarators.back()); + if (functionDefinitionAccepted) + break; + } + expected("member-function definition"); + return false; + } else { + // add it to the list of members + TTypeLoc member = { new TType(EbtVoid), token.loc }; + member.type->shallowCopy(memberType); + member.type->setFieldName(*idToken.string); + typeList->push_back(member); + + // array_specifier + TArraySizes* arraySizes = nullptr; + acceptArraySpecifier(arraySizes); + if (arraySizes) + typeList->back().type->transferArraySizes(arraySizes); + + acceptPostDecls(member.type->getQualifier()); + + // EQUAL assignment_expression + if (acceptTokenClass(EHTokAssign)) { + parseContext.warn(idToken.loc, "struct-member initializers ignored", "typedef", ""); + TIntermTyped* expressionNode = nullptr; + if (! acceptAssignmentExpression(expressionNode)) { + expected("initializer"); + return false; + } + } + } + // success on seeing the SEMICOLON coming up + if (peekTokenClass(EHTokSemicolon)) + break; + + // COMMA + if (acceptTokenClass(EHTokComma)) + declarator_list = true; + else { + expected(","); + return false; + } + + } while (true); + + // SEMI_COLON + if (! functionDefinitionAccepted && ! acceptTokenClass(EHTokSemicolon)) { + expected(";"); + return false; + } + + } while (true); + + return true; +} + +// member_function_definition +// | function_parameters post_decls compound_statement +// +// Expects type to have EvqGlobal for a static member and +// EvqTemporary for non-static member. +bool HlslGrammar::acceptMemberFunctionDefinition(TIntermNode*& nodeList, const TType& type, TString& memberName, + TFunctionDeclarator& declarator) +{ + bool accepted = false; + + TString* functionName = &memberName; + parseContext.getFullNamespaceName(functionName); + declarator.function = new TFunction(functionName, type); + if (type.getQualifier().storage == EvqTemporary) + declarator.function->setImplicitThis(); + else + declarator.function->setIllegalImplicitThis(); + + // function_parameters + if (acceptFunctionParameters(*declarator.function)) { + // post_decls + acceptPostDecls(declarator.function->getWritableType().getQualifier()); + + // compound_statement (function body definition) + if (peekTokenClass(EHTokLeftBrace)) { + declarator.loc = token.loc; + declarator.body = new TVector; + accepted = acceptFunctionDefinition(declarator, nodeList, declarator.body); + } + } else + expected("function parameter list"); + + return accepted; +} + +// function_parameters +// : LEFT_PAREN parameter_declaration COMMA parameter_declaration ... RIGHT_PAREN +// | LEFT_PAREN VOID RIGHT_PAREN +// +bool HlslGrammar::acceptFunctionParameters(TFunction& function) +{ + parseContext.beginParameterParsing(function); + + // LEFT_PAREN + if (! acceptTokenClass(EHTokLeftParen)) + return false; + + // VOID RIGHT_PAREN + if (! acceptTokenClass(EHTokVoid)) { + do { + // parameter_declaration + if (! acceptParameterDeclaration(function)) + break; + + // COMMA + if (! acceptTokenClass(EHTokComma)) + break; + } while (true); + } + + // RIGHT_PAREN + if (! acceptTokenClass(EHTokRightParen)) { + expected(")"); + return false; + } + + return true; +} + +// default_parameter_declaration +// : EQUAL conditional_expression +// : EQUAL initializer +bool HlslGrammar::acceptDefaultParameterDeclaration(const TType& type, TIntermTyped*& node) +{ + node = nullptr; + + // Valid not to have a default_parameter_declaration + if (!acceptTokenClass(EHTokAssign)) + return true; + + if (!acceptConditionalExpression(node)) { + if (!acceptInitializer(node)) + return false; + + // For initializer lists, we have to const-fold into a constructor for the type, so build + // that. + TFunction* constructor = parseContext.makeConstructorCall(token.loc, type); + if (constructor == nullptr) // cannot construct + return false; + + TIntermTyped* arguments = nullptr; + for (int i = 0; i < int(node->getAsAggregate()->getSequence().size()); i++) + parseContext.handleFunctionArgument(constructor, arguments, node->getAsAggregate()->getSequence()[i]->getAsTyped()); + + node = parseContext.handleFunctionCall(token.loc, constructor, node); + } + + if (node == nullptr) + return false; + + // If this is simply a constant, we can use it directly. + if (node->getAsConstantUnion()) + return true; + + // Otherwise, it has to be const-foldable. + TIntermTyped* origNode = node; + + node = intermediate.fold(node->getAsAggregate()); + + if (node != nullptr && origNode != node) + return true; + + parseContext.error(token.loc, "invalid default parameter value", "", ""); + + return false; +} + +// parameter_declaration +// : attributes attributed_declaration +// +// attributed_declaration +// : fully_specified_type post_decls [ = default_parameter_declaration ] +// | fully_specified_type identifier array_specifier post_decls [ = default_parameter_declaration ] +// +bool HlslGrammar::acceptParameterDeclaration(TFunction& function) +{ + // attributes + TAttributes attributes; + acceptAttributes(attributes); + + // fully_specified_type + TType* type = new TType; + if (! acceptFullySpecifiedType(*type, attributes)) + return false; + + // merge in the attributes + parseContext.transferTypeAttributes(token.loc, attributes, *type); + + // identifier + HlslToken idToken; + acceptIdentifier(idToken); + + // array_specifier + TArraySizes* arraySizes = nullptr; + acceptArraySpecifier(arraySizes); + if (arraySizes) { + if (arraySizes->hasUnsized()) { + parseContext.error(token.loc, "function parameter requires array size", "[]", ""); + return false; + } + + type->transferArraySizes(arraySizes); + } + + // post_decls + acceptPostDecls(type->getQualifier()); + + TIntermTyped* defaultValue; + if (!acceptDefaultParameterDeclaration(*type, defaultValue)) + return false; + + parseContext.paramFix(*type); + + // If any prior parameters have default values, all the parameters after that must as well. + if (defaultValue == nullptr && function.getDefaultParamCount() > 0) { + parseContext.error(idToken.loc, "invalid parameter after default value parameters", idToken.string->c_str(), ""); + return false; + } + + TParameter param = { idToken.string, type, defaultValue }; + function.addParameter(param); + + return true; +} + +// Do the work to create the function definition in addition to +// parsing the body (compound_statement). +// +// If 'deferredTokens' are passed in, just get the token stream, +// don't process. +// +bool HlslGrammar::acceptFunctionDefinition(TFunctionDeclarator& declarator, TIntermNode*& nodeList, + TVector* deferredTokens) +{ + parseContext.handleFunctionDeclarator(declarator.loc, *declarator.function, false /* not prototype */); + + if (deferredTokens) + return captureBlockTokens(*deferredTokens); + else + return acceptFunctionBody(declarator, nodeList); +} + +bool HlslGrammar::acceptFunctionBody(TFunctionDeclarator& declarator, TIntermNode*& nodeList) +{ + // we might get back an entry-point + TIntermNode* entryPointNode = nullptr; + + // This does a pushScope() + TIntermNode* functionNode = parseContext.handleFunctionDefinition(declarator.loc, *declarator.function, + declarator.attributes, entryPointNode); + + // compound_statement + TIntermNode* functionBody = nullptr; + if (! acceptCompoundStatement(functionBody)) + return false; + + // this does a popScope() + parseContext.handleFunctionBody(declarator.loc, *declarator.function, functionBody, functionNode); + + // Hook up the 1 or 2 function definitions. + nodeList = intermediate.growAggregate(nodeList, functionNode); + nodeList = intermediate.growAggregate(nodeList, entryPointNode); + + return true; +} + +// Accept an expression with parenthesis around it, where +// the parenthesis ARE NOT expression parenthesis, but the +// syntactically required ones like in "if ( expression )". +// +// Also accepts a declaration expression; "if (int a = expression)". +// +// Note this one is not set up to be speculative; as it gives +// errors if not found. +// +bool HlslGrammar::acceptParenExpression(TIntermTyped*& expression) +{ + expression = nullptr; + + // LEFT_PAREN + if (! acceptTokenClass(EHTokLeftParen)) + expected("("); + + bool decl = false; + TIntermNode* declNode = nullptr; + decl = acceptControlDeclaration(declNode); + if (decl) { + if (declNode == nullptr || declNode->getAsTyped() == nullptr) { + expected("initialized declaration"); + return false; + } else + expression = declNode->getAsTyped(); + } else { + // no declaration + if (! acceptExpression(expression)) { + expected("expression"); + return false; + } + } + + // RIGHT_PAREN + if (! acceptTokenClass(EHTokRightParen)) + expected(")"); + + return true; +} + +// The top-level full expression recognizer. +// +// expression +// : assignment_expression COMMA assignment_expression COMMA assignment_expression ... +// +bool HlslGrammar::acceptExpression(TIntermTyped*& node) +{ + node = nullptr; + + // assignment_expression + if (! acceptAssignmentExpression(node)) + return false; + + if (! peekTokenClass(EHTokComma)) + return true; + + do { + // ... COMMA + TSourceLoc loc = token.loc; + advanceToken(); + + // ... assignment_expression + TIntermTyped* rightNode = nullptr; + if (! acceptAssignmentExpression(rightNode)) { + expected("assignment expression"); + return false; + } + + node = intermediate.addComma(node, rightNode, loc); + + if (! peekTokenClass(EHTokComma)) + return true; + } while (true); +} + +// initializer +// : LEFT_BRACE RIGHT_BRACE +// | LEFT_BRACE initializer_list RIGHT_BRACE +// +// initializer_list +// : assignment_expression COMMA assignment_expression COMMA ... +// +bool HlslGrammar::acceptInitializer(TIntermTyped*& node) +{ + // LEFT_BRACE + if (! acceptTokenClass(EHTokLeftBrace)) + return false; + + // RIGHT_BRACE + TSourceLoc loc = token.loc; + if (acceptTokenClass(EHTokRightBrace)) { + // a zero-length initializer list + node = intermediate.makeAggregate(loc); + return true; + } + + // initializer_list + node = nullptr; + do { + // assignment_expression + TIntermTyped* expr; + if (! acceptAssignmentExpression(expr)) { + expected("assignment expression in initializer list"); + return false; + } + + const bool firstNode = (node == nullptr); + + node = intermediate.growAggregate(node, expr, loc); + + // If every sub-node in the list has qualifier EvqConst, the returned node becomes + // EvqConst. Otherwise, it becomes EvqTemporary. That doesn't happen with e.g. + // EvqIn or EvqPosition, since the collection isn't EvqPosition if all the members are. + if (firstNode && expr->getQualifier().storage == EvqConst) + node->getQualifier().storage = EvqConst; + else if (expr->getQualifier().storage != EvqConst) + node->getQualifier().storage = EvqTemporary; + + // COMMA + if (acceptTokenClass(EHTokComma)) { + if (acceptTokenClass(EHTokRightBrace)) // allow trailing comma + return true; + continue; + } + + // RIGHT_BRACE + if (acceptTokenClass(EHTokRightBrace)) + return true; + + expected(", or }"); + return false; + } while (true); +} + +// Accept an assignment expression, where assignment operations +// associate right-to-left. That is, it is implicit, for example +// +// a op (b op (c op d)) +// +// assigment_expression +// : initializer +// | conditional_expression +// | conditional_expression assign_op conditional_expression assign_op conditional_expression ... +// +bool HlslGrammar::acceptAssignmentExpression(TIntermTyped*& node) +{ + // initializer + if (peekTokenClass(EHTokLeftBrace)) { + if (acceptInitializer(node)) + return true; + + expected("initializer"); + return false; + } + + // conditional_expression + if (! acceptConditionalExpression(node)) + return false; + + // assignment operation? + TOperator assignOp = HlslOpMap::assignment(peek()); + if (assignOp == EOpNull) + return true; + + // assign_op + TSourceLoc loc = token.loc; + advanceToken(); + + // conditional_expression assign_op conditional_expression ... + // Done by recursing this function, which automatically + // gets the right-to-left associativity. + TIntermTyped* rightNode = nullptr; + if (! acceptAssignmentExpression(rightNode)) { + expected("assignment expression"); + return false; + } + + node = parseContext.handleAssign(loc, assignOp, node, rightNode); + node = parseContext.handleLvalue(loc, "assign", node); + + if (node == nullptr) { + parseContext.error(loc, "could not create assignment", "", ""); + return false; + } + + if (! peekTokenClass(EHTokComma)) + return true; + + return true; +} + +// Accept a conditional expression, which associates right-to-left, +// accomplished by the "true" expression calling down to lower +// precedence levels than this level. +// +// conditional_expression +// : binary_expression +// | binary_expression QUESTION expression COLON assignment_expression +// +bool HlslGrammar::acceptConditionalExpression(TIntermTyped*& node) +{ + // binary_expression + if (! acceptBinaryExpression(node, PlLogicalOr)) + return false; + + if (! acceptTokenClass(EHTokQuestion)) + return true; + + node = parseContext.convertConditionalExpression(token.loc, node, false); + if (node == nullptr) + return false; + + ++parseContext.controlFlowNestingLevel; // this only needs to work right if no errors + + TIntermTyped* trueNode = nullptr; + if (! acceptExpression(trueNode)) { + expected("expression after ?"); + return false; + } + TSourceLoc loc = token.loc; + + if (! acceptTokenClass(EHTokColon)) { + expected(":"); + return false; + } + + TIntermTyped* falseNode = nullptr; + if (! acceptAssignmentExpression(falseNode)) { + expected("expression after :"); + return false; + } + + --parseContext.controlFlowNestingLevel; + + node = intermediate.addSelection(node, trueNode, falseNode, loc); + + return true; +} + +// Accept a binary expression, for binary operations that +// associate left-to-right. This is, it is implicit, for example +// +// ((a op b) op c) op d +// +// binary_expression +// : expression op expression op expression ... +// +// where 'expression' is the next higher level in precedence. +// +bool HlslGrammar::acceptBinaryExpression(TIntermTyped*& node, PrecedenceLevel precedenceLevel) +{ + if (precedenceLevel > PlMul) + return acceptUnaryExpression(node); + + // assignment_expression + if (! acceptBinaryExpression(node, (PrecedenceLevel)(precedenceLevel + 1))) + return false; + + do { + TOperator op = HlslOpMap::binary(peek()); + PrecedenceLevel tokenLevel = HlslOpMap::precedenceLevel(op); + if (tokenLevel < precedenceLevel) + return true; + + // ... op + TSourceLoc loc = token.loc; + advanceToken(); + + // ... expression + TIntermTyped* rightNode = nullptr; + if (! acceptBinaryExpression(rightNode, (PrecedenceLevel)(precedenceLevel + 1))) { + expected("expression"); + return false; + } + + node = intermediate.addBinaryMath(op, node, rightNode, loc); + if (node == nullptr) { + parseContext.error(loc, "Could not perform requested binary operation", "", ""); + return false; + } + } while (true); +} + +// unary_expression +// : (type) unary_expression +// | + unary_expression +// | - unary_expression +// | ! unary_expression +// | ~ unary_expression +// | ++ unary_expression +// | -- unary_expression +// | postfix_expression +// +bool HlslGrammar::acceptUnaryExpression(TIntermTyped*& node) +{ + // (type) unary_expression + // Have to look two steps ahead, because this could be, e.g., a + // postfix_expression instead, since that also starts with at "(". + if (acceptTokenClass(EHTokLeftParen)) { + TType castType; + if (acceptType(castType)) { + // recognize any array_specifier as part of the type + TArraySizes* arraySizes = nullptr; + acceptArraySpecifier(arraySizes); + if (arraySizes != nullptr) + castType.transferArraySizes(arraySizes); + TSourceLoc loc = token.loc; + if (acceptTokenClass(EHTokRightParen)) { + // We've matched "(type)" now, get the expression to cast + if (! acceptUnaryExpression(node)) + return false; + + // Hook it up like a constructor + TFunction* constructorFunction = parseContext.makeConstructorCall(loc, castType); + if (constructorFunction == nullptr) { + expected("type that can be constructed"); + return false; + } + TIntermTyped* arguments = nullptr; + parseContext.handleFunctionArgument(constructorFunction, arguments, node); + node = parseContext.handleFunctionCall(loc, constructorFunction, arguments); + + return node != nullptr; + } else { + // This could be a parenthesized constructor, ala (int(3)), and we just accepted + // the '(int' part. We must back up twice. + recedeToken(); + recedeToken(); + + // Note, there are no array constructors like + // (float[2](...)) + if (arraySizes != nullptr) + parseContext.error(loc, "parenthesized array constructor not allowed", "([]())", "", ""); + } + } else { + // This isn't a type cast, but it still started "(", so if it is a + // unary expression, it can only be a postfix_expression, so try that. + // Back it up first. + recedeToken(); + return acceptPostfixExpression(node); + } + } + + // peek for "op unary_expression" + TOperator unaryOp = HlslOpMap::preUnary(peek()); + + // postfix_expression (if no unary operator) + if (unaryOp == EOpNull) + return acceptPostfixExpression(node); + + // op unary_expression + TSourceLoc loc = token.loc; + advanceToken(); + if (! acceptUnaryExpression(node)) + return false; + + // + is a no-op + if (unaryOp == EOpAdd) + return true; + + node = intermediate.addUnaryMath(unaryOp, node, loc); + + // These unary ops require lvalues + if (unaryOp == EOpPreIncrement || unaryOp == EOpPreDecrement) + node = parseContext.handleLvalue(loc, "unary operator", node); + + return node != nullptr; +} + +// postfix_expression +// : LEFT_PAREN expression RIGHT_PAREN +// | literal +// | constructor +// | IDENTIFIER [ COLONCOLON IDENTIFIER [ COLONCOLON IDENTIFIER ... ] ] +// | function_call +// | postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET +// | postfix_expression DOT IDENTIFIER +// | postfix_expression DOT IDENTIFIER arguments +// | postfix_expression arguments +// | postfix_expression INC_OP +// | postfix_expression DEC_OP +// +bool HlslGrammar::acceptPostfixExpression(TIntermTyped*& node) +{ + // Not implemented as self-recursive: + // The logical "right recursion" is done with a loop at the end + + // idToken will pick up either a variable or a function name in a function call + HlslToken idToken; + + // Find something before the postfix operations, as they can't operate + // on nothing. So, no "return true", they fall through, only "return false". + if (acceptTokenClass(EHTokLeftParen)) { + // LEFT_PAREN expression RIGHT_PAREN + if (! acceptExpression(node)) { + expected("expression"); + return false; + } + if (! acceptTokenClass(EHTokRightParen)) { + expected(")"); + return false; + } + } else if (acceptLiteral(node)) { + // literal (nothing else to do yet) + } else if (acceptConstructor(node)) { + // constructor (nothing else to do yet) + } else if (acceptIdentifier(idToken)) { + // user-type, namespace name, variable, or function name + TString* fullName = idToken.string; + while (acceptTokenClass(EHTokColonColon)) { + // user-type or namespace name + fullName = NewPoolTString(fullName->c_str()); + fullName->append(parseContext.scopeMangler); + if (acceptIdentifier(idToken)) + fullName->append(*idToken.string); + else { + expected("identifier after ::"); + return false; + } + } + if (! peekTokenClass(EHTokLeftParen)) { + node = parseContext.handleVariable(idToken.loc, fullName); + if (node == nullptr) + return false; + } else if (acceptFunctionCall(idToken.loc, *fullName, node, nullptr)) { + // function_call (nothing else to do yet) + } else { + expected("function call arguments"); + return false; + } + } else { + // nothing found, can't post operate + return false; + } + + // Something was found, chain as many postfix operations as exist. + do { + TSourceLoc loc = token.loc; + TOperator postOp = HlslOpMap::postUnary(peek()); + + // Consume only a valid post-unary operator, otherwise we are done. + switch (postOp) { + case EOpIndexDirectStruct: + case EOpIndexIndirect: + case EOpPostIncrement: + case EOpPostDecrement: + case EOpScoping: + advanceToken(); + break; + default: + return true; + } + + // We have a valid post-unary operator, process it. + switch (postOp) { + case EOpScoping: + case EOpIndexDirectStruct: + { + // DOT IDENTIFIER + // includes swizzles, member variables, and member functions + HlslToken field; + if (! acceptIdentifier(field)) { + expected("swizzle or member"); + return false; + } + + if (peekTokenClass(EHTokLeftParen)) { + // member function + TIntermTyped* thisNode = node; + + // arguments + if (! acceptFunctionCall(field.loc, *field.string, node, thisNode)) { + expected("function parameters"); + return false; + } + } else + node = parseContext.handleDotDereference(field.loc, node, *field.string); + + break; + } + case EOpIndexIndirect: + { + // LEFT_BRACKET integer_expression RIGHT_BRACKET + TIntermTyped* indexNode = nullptr; + if (! acceptExpression(indexNode) || + ! peekTokenClass(EHTokRightBracket)) { + expected("expression followed by ']'"); + return false; + } + advanceToken(); + node = parseContext.handleBracketDereference(indexNode->getLoc(), node, indexNode); + if (node == nullptr) + return false; + break; + } + case EOpPostIncrement: + // INC_OP + // fall through + case EOpPostDecrement: + // DEC_OP + node = intermediate.addUnaryMath(postOp, node, loc); + node = parseContext.handleLvalue(loc, "unary operator", node); + break; + default: + assert(0); + break; + } + } while (true); +} + +// constructor +// : type argument_list +// +bool HlslGrammar::acceptConstructor(TIntermTyped*& node) +{ + // type + TType type; + if (acceptType(type)) { + TFunction* constructorFunction = parseContext.makeConstructorCall(token.loc, type); + if (constructorFunction == nullptr) + return false; + + // arguments + TIntermTyped* arguments = nullptr; + if (! acceptArguments(constructorFunction, arguments)) { + // It's possible this is a type keyword used as an identifier. Put the token back + // for later use. + recedeToken(); + return false; + } + + if (arguments == nullptr) { + expected("one or more arguments"); + return false; + } + + // hook it up + node = parseContext.handleFunctionCall(token.loc, constructorFunction, arguments); + + return node != nullptr; + } + + return false; +} + +// The function_call identifier was already recognized, and passed in as idToken. +// +// function_call +// : [idToken] arguments +// +bool HlslGrammar::acceptFunctionCall(const TSourceLoc& loc, TString& name, TIntermTyped*& node, TIntermTyped* baseObject) +{ + // name + TString* functionName = nullptr; + if (baseObject == nullptr) { + functionName = &name; + } else if (parseContext.isBuiltInMethod(loc, baseObject, name)) { + // Built-in methods are not in the symbol table as methods, but as global functions + // taking an explicit 'this' as the first argument. + functionName = NewPoolTString(BUILTIN_PREFIX); + functionName->append(name); + } else { + if (! baseObject->getType().isStruct()) { + expected("structure"); + return false; + } + functionName = NewPoolTString(""); + functionName->append(baseObject->getType().getTypeName()); + parseContext.addScopeMangler(*functionName); + functionName->append(name); + } + + // function + TFunction* function = new TFunction(functionName, TType(EbtVoid)); + + // arguments + TIntermTyped* arguments = nullptr; + if (baseObject != nullptr) { + // Non-static member functions have an implicit first argument of the base object. + parseContext.handleFunctionArgument(function, arguments, baseObject); + } + if (! acceptArguments(function, arguments)) + return false; + + // call + node = parseContext.handleFunctionCall(loc, function, arguments); + + return node != nullptr; +} + +// arguments +// : LEFT_PAREN expression COMMA expression COMMA ... RIGHT_PAREN +// +// The arguments are pushed onto the 'function' argument list and +// onto the 'arguments' aggregate. +// +bool HlslGrammar::acceptArguments(TFunction* function, TIntermTyped*& arguments) +{ + // LEFT_PAREN + if (! acceptTokenClass(EHTokLeftParen)) + return false; + + // RIGHT_PAREN + if (acceptTokenClass(EHTokRightParen)) + return true; + + // must now be at least one expression... + do { + // expression + TIntermTyped* arg; + if (! acceptAssignmentExpression(arg)) + return false; + + // hook it up + parseContext.handleFunctionArgument(function, arguments, arg); + + // COMMA + if (! acceptTokenClass(EHTokComma)) + break; + } while (true); + + // RIGHT_PAREN + if (! acceptTokenClass(EHTokRightParen)) { + expected(")"); + return false; + } + + return true; +} + +bool HlslGrammar::acceptLiteral(TIntermTyped*& node) +{ + switch (token.tokenClass) { + case EHTokIntConstant: + node = intermediate.addConstantUnion(token.i, token.loc, true); + break; + case EHTokUintConstant: + node = intermediate.addConstantUnion(token.u, token.loc, true); + break; + case EHTokFloat16Constant: + node = intermediate.addConstantUnion(token.d, EbtFloat16, token.loc, true); + break; + case EHTokFloatConstant: + node = intermediate.addConstantUnion(token.d, EbtFloat, token.loc, true); + break; + case EHTokDoubleConstant: + node = intermediate.addConstantUnion(token.d, EbtDouble, token.loc, true); + break; + case EHTokBoolConstant: + node = intermediate.addConstantUnion(token.b, token.loc, true); + break; + case EHTokStringConstant: + node = intermediate.addConstantUnion(token.string, token.loc, true); + break; + + default: + return false; + } + + advanceToken(); + + return true; +} + +// simple_statement +// : SEMICOLON +// | declaration_statement +// | expression SEMICOLON +// +bool HlslGrammar::acceptSimpleStatement(TIntermNode*& statement) +{ + // SEMICOLON + if (acceptTokenClass(EHTokSemicolon)) + return true; + + // declaration + if (acceptDeclaration(statement)) + return true; + + // expression + TIntermTyped* node; + if (acceptExpression(node)) + statement = node; + else + return false; + + // SEMICOLON (following an expression) + if (acceptTokenClass(EHTokSemicolon)) + return true; + else { + expected(";"); + return false; + } +} + +// compound_statement +// : LEFT_CURLY statement statement ... RIGHT_CURLY +// +bool HlslGrammar::acceptCompoundStatement(TIntermNode*& retStatement) +{ + TIntermAggregate* compoundStatement = nullptr; + + // LEFT_CURLY + if (! acceptTokenClass(EHTokLeftBrace)) + return false; + + // statement statement ... + TIntermNode* statement = nullptr; + while (acceptStatement(statement)) { + TIntermBranch* branch = statement ? statement->getAsBranchNode() : nullptr; + if (branch != nullptr && (branch->getFlowOp() == EOpCase || + branch->getFlowOp() == EOpDefault)) { + // hook up individual subsequences within a switch statement + parseContext.wrapupSwitchSubsequence(compoundStatement, statement); + compoundStatement = nullptr; + } else { + // hook it up to the growing compound statement + compoundStatement = intermediate.growAggregate(compoundStatement, statement); + } + } + if (compoundStatement) + compoundStatement->setOperator(intermediate.getDebugInfo() ? EOpScope : EOpSequence); + + retStatement = compoundStatement; + + // RIGHT_CURLY + return acceptTokenClass(EHTokRightBrace); +} + +bool HlslGrammar::acceptScopedStatement(TIntermNode*& statement) +{ + parseContext.pushScope(); + bool result = acceptStatement(statement); + parseContext.popScope(); + + return result; +} + +bool HlslGrammar::acceptScopedCompoundStatement(TIntermNode*& statement) +{ + parseContext.pushScope(); + bool result = acceptCompoundStatement(statement); + parseContext.popScope(); + + return result; +} + +// statement +// : attributes attributed_statement +// +// attributed_statement +// : compound_statement +// | simple_statement +// | selection_statement +// | switch_statement +// | case_label +// | default_label +// | iteration_statement +// | jump_statement +// +bool HlslGrammar::acceptStatement(TIntermNode*& statement) +{ + statement = nullptr; + + // attributes + TAttributes attributes; + acceptAttributes(attributes); + + // attributed_statement + switch (peek()) { + case EHTokLeftBrace: + return acceptScopedCompoundStatement(statement); + + case EHTokIf: + return acceptSelectionStatement(statement, attributes); + + case EHTokSwitch: + return acceptSwitchStatement(statement, attributes); + + case EHTokFor: + case EHTokDo: + case EHTokWhile: + return acceptIterationStatement(statement, attributes); + + case EHTokContinue: + case EHTokBreak: + case EHTokDiscard: + case EHTokReturn: + return acceptJumpStatement(statement); + + case EHTokCase: + return acceptCaseLabel(statement); + case EHTokDefault: + return acceptDefaultLabel(statement); + + case EHTokRightBrace: + // Performance: not strictly necessary, but stops a bunch of hunting early, + // and is how sequences of statements end. + return false; + + default: + return acceptSimpleStatement(statement); + } + + return true; +} + +// attributes +// : [zero or more:] bracketed-attribute +// +// bracketed-attribute: +// : LEFT_BRACKET scoped-attribute RIGHT_BRACKET +// : LEFT_BRACKET LEFT_BRACKET scoped-attribute RIGHT_BRACKET RIGHT_BRACKET +// +// scoped-attribute: +// : attribute +// | namespace COLON COLON attribute +// +// attribute: +// : UNROLL +// | UNROLL LEFT_PAREN literal RIGHT_PAREN +// | FASTOPT +// | ALLOW_UAV_CONDITION +// | BRANCH +// | FLATTEN +// | FORCECASE +// | CALL +// | DOMAIN +// | EARLYDEPTHSTENCIL +// | INSTANCE +// | MAXTESSFACTOR +// | OUTPUTCONTROLPOINTS +// | OUTPUTTOPOLOGY +// | PARTITIONING +// | PATCHCONSTANTFUNC +// | NUMTHREADS LEFT_PAREN x_size, y_size,z z_size RIGHT_PAREN +// +void HlslGrammar::acceptAttributes(TAttributes& attributes) +{ + // For now, accept the [ XXX(X) ] syntax, but drop all but + // numthreads, which is used to set the CS local size. + // TODO: subset to correct set? Pass on? + do { + HlslToken attributeToken; + + // LEFT_BRACKET? + if (! acceptTokenClass(EHTokLeftBracket)) + return; + // another LEFT_BRACKET? + bool doubleBrackets = false; + if (acceptTokenClass(EHTokLeftBracket)) + doubleBrackets = true; + + // attribute? (could be namespace; will adjust later) + if (!acceptIdentifier(attributeToken)) { + if (!peekTokenClass(EHTokRightBracket)) { + expected("namespace or attribute identifier"); + advanceToken(); + } + } + + TString nameSpace; + if (acceptTokenClass(EHTokColonColon)) { + // namespace COLON COLON + nameSpace = *attributeToken.string; + // attribute + if (!acceptIdentifier(attributeToken)) { + expected("attribute identifier"); + return; + } + } + + TIntermAggregate* expressions = nullptr; + + // (x, ...) + if (acceptTokenClass(EHTokLeftParen)) { + expressions = new TIntermAggregate; + + TIntermTyped* node; + bool expectingExpression = false; + + while (acceptAssignmentExpression(node)) { + expectingExpression = false; + expressions->getSequence().push_back(node); + if (acceptTokenClass(EHTokComma)) + expectingExpression = true; + } + + // 'expressions' is an aggregate with the expressions in it + if (! acceptTokenClass(EHTokRightParen)) + expected(")"); + + // Error for partial or missing expression + if (expectingExpression || expressions->getSequence().empty()) + expected("expression"); + } + + // RIGHT_BRACKET + if (!acceptTokenClass(EHTokRightBracket)) { + expected("]"); + return; + } + // another RIGHT_BRACKET? + if (doubleBrackets && !acceptTokenClass(EHTokRightBracket)) { + expected("]]"); + return; + } + + // Add any values we found into the attribute map. + if (attributeToken.string != nullptr) { + TAttributeType attributeType = parseContext.attributeFromName(nameSpace, *attributeToken.string); + if (attributeType == EatNone) + parseContext.warn(attributeToken.loc, "unrecognized attribute", attributeToken.string->c_str(), ""); + else { + TAttributeArgs attributeArgs = { attributeType, expressions }; + attributes.push_back(attributeArgs); + } + } + } while (true); +} + +// selection_statement +// : IF LEFT_PAREN expression RIGHT_PAREN statement +// : IF LEFT_PAREN expression RIGHT_PAREN statement ELSE statement +// +bool HlslGrammar::acceptSelectionStatement(TIntermNode*& statement, const TAttributes& attributes) +{ + TSourceLoc loc = token.loc; + + // IF + if (! acceptTokenClass(EHTokIf)) + return false; + + // so that something declared in the condition is scoped to the lifetimes + // of the then-else statements + parseContext.pushScope(); + + // LEFT_PAREN expression RIGHT_PAREN + TIntermTyped* condition; + if (! acceptParenExpression(condition)) + return false; + condition = parseContext.convertConditionalExpression(loc, condition); + if (condition == nullptr) + return false; + + // create the child statements + TIntermNodePair thenElse = { nullptr, nullptr }; + + ++parseContext.controlFlowNestingLevel; // this only needs to work right if no errors + + // then statement + if (! acceptScopedStatement(thenElse.node1)) { + expected("then statement"); + return false; + } + + // ELSE + if (acceptTokenClass(EHTokElse)) { + // else statement + if (! acceptScopedStatement(thenElse.node2)) { + expected("else statement"); + return false; + } + } + + // Put the pieces together + statement = intermediate.addSelection(condition, thenElse, loc); + parseContext.handleSelectionAttributes(loc, statement->getAsSelectionNode(), attributes); + + parseContext.popScope(); + --parseContext.controlFlowNestingLevel; + + return true; +} + +// switch_statement +// : SWITCH LEFT_PAREN expression RIGHT_PAREN compound_statement +// +bool HlslGrammar::acceptSwitchStatement(TIntermNode*& statement, const TAttributes& attributes) +{ + // SWITCH + TSourceLoc loc = token.loc; + + if (! acceptTokenClass(EHTokSwitch)) + return false; + + // LEFT_PAREN expression RIGHT_PAREN + parseContext.pushScope(); + TIntermTyped* switchExpression; + if (! acceptParenExpression(switchExpression)) { + parseContext.popScope(); + return false; + } + + // compound_statement + parseContext.pushSwitchSequence(new TIntermSequence); + + ++parseContext.controlFlowNestingLevel; + bool statementOkay = acceptCompoundStatement(statement); + --parseContext.controlFlowNestingLevel; + + if (statementOkay) + statement = parseContext.addSwitch(loc, switchExpression, statement ? statement->getAsAggregate() : nullptr, + attributes); + + parseContext.popSwitchSequence(); + parseContext.popScope(); + + return statementOkay; +} + +// iteration_statement +// : WHILE LEFT_PAREN condition RIGHT_PAREN statement +// | DO LEFT_BRACE statement RIGHT_BRACE WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON +// | FOR LEFT_PAREN for_init_statement for_rest_statement RIGHT_PAREN statement +// +// Non-speculative, only call if it needs to be found; WHILE or DO or FOR already seen. +bool HlslGrammar::acceptIterationStatement(TIntermNode*& statement, const TAttributes& attributes) +{ + TSourceLoc loc = token.loc; + TIntermTyped* condition = nullptr; + + EHlslTokenClass loop = peek(); + assert(loop == EHTokDo || loop == EHTokFor || loop == EHTokWhile); + + // WHILE or DO or FOR + advanceToken(); + + TIntermLoop* loopNode = nullptr; + switch (loop) { + case EHTokWhile: + // so that something declared in the condition is scoped to the lifetime + // of the while sub-statement + parseContext.pushScope(); // this only needs to work right if no errors + parseContext.nestLooping(); + ++parseContext.controlFlowNestingLevel; + + // LEFT_PAREN condition RIGHT_PAREN + if (! acceptParenExpression(condition)) + return false; + condition = parseContext.convertConditionalExpression(loc, condition); + if (condition == nullptr) + return false; + + // statement + if (! acceptScopedStatement(statement)) { + expected("while sub-statement"); + return false; + } + + parseContext.unnestLooping(); + parseContext.popScope(); + --parseContext.controlFlowNestingLevel; + + loopNode = intermediate.addLoop(statement, condition, nullptr, true, loc); + statement = loopNode; + break; + + case EHTokDo: + parseContext.nestLooping(); // this only needs to work right if no errors + ++parseContext.controlFlowNestingLevel; + + // statement + if (! acceptScopedStatement(statement)) { + expected("do sub-statement"); + return false; + } + + // WHILE + if (! acceptTokenClass(EHTokWhile)) { + expected("while"); + return false; + } + + // LEFT_PAREN condition RIGHT_PAREN + if (! acceptParenExpression(condition)) + return false; + condition = parseContext.convertConditionalExpression(loc, condition); + if (condition == nullptr) + return false; + + if (! acceptTokenClass(EHTokSemicolon)) + expected(";"); + + parseContext.unnestLooping(); + --parseContext.controlFlowNestingLevel; + + loopNode = intermediate.addLoop(statement, condition, nullptr, false, loc); + statement = loopNode; + break; + + case EHTokFor: + { + // LEFT_PAREN + if (! acceptTokenClass(EHTokLeftParen)) + expected("("); + + // so that something declared in the condition is scoped to the lifetime + // of the for sub-statement + parseContext.pushScope(); + + // initializer + TIntermNode* initNode = nullptr; + if (! acceptSimpleStatement(initNode)) + expected("for-loop initializer statement"); + + parseContext.nestLooping(); // this only needs to work right if no errors + ++parseContext.controlFlowNestingLevel; + + // condition SEMI_COLON + acceptExpression(condition); + if (! acceptTokenClass(EHTokSemicolon)) + expected(";"); + if (condition != nullptr) { + condition = parseContext.convertConditionalExpression(loc, condition); + if (condition == nullptr) + return false; + } + + // iterator SEMI_COLON + TIntermTyped* iterator = nullptr; + acceptExpression(iterator); + if (! acceptTokenClass(EHTokRightParen)) + expected(")"); + + // statement + if (! acceptScopedStatement(statement)) { + expected("for sub-statement"); + return false; + } + + statement = intermediate.addForLoop(statement, initNode, condition, iterator, true, loc, loopNode); + + parseContext.popScope(); + parseContext.unnestLooping(); + --parseContext.controlFlowNestingLevel; + + break; + } + + default: + return false; + } + + parseContext.handleLoopAttributes(loc, loopNode, attributes); + return true; +} + +// jump_statement +// : CONTINUE SEMICOLON +// | BREAK SEMICOLON +// | DISCARD SEMICOLON +// | RETURN SEMICOLON +// | RETURN expression SEMICOLON +// +bool HlslGrammar::acceptJumpStatement(TIntermNode*& statement) +{ + EHlslTokenClass jump = peek(); + switch (jump) { + case EHTokContinue: + case EHTokBreak: + case EHTokDiscard: + case EHTokReturn: + advanceToken(); + break; + default: + // not something we handle in this function + return false; + } + + switch (jump) { + case EHTokContinue: + statement = intermediate.addBranch(EOpContinue, token.loc); + if (parseContext.loopNestingLevel == 0) { + expected("loop"); + return false; + } + break; + case EHTokBreak: + statement = intermediate.addBranch(EOpBreak, token.loc); + if (parseContext.loopNestingLevel == 0 && parseContext.switchSequenceStack.size() == 0) { + expected("loop or switch"); + return false; + } + break; + case EHTokDiscard: + statement = intermediate.addBranch(EOpKill, token.loc); + break; + + case EHTokReturn: + { + // expression + TIntermTyped* node; + if (acceptExpression(node)) { + // hook it up + statement = parseContext.handleReturnValue(token.loc, node); + } else + statement = intermediate.addBranch(EOpReturn, token.loc); + break; + } + + default: + assert(0); + return false; + } + + // SEMICOLON + if (! acceptTokenClass(EHTokSemicolon)) + expected(";"); + + return true; +} + +// case_label +// : CASE expression COLON +// +bool HlslGrammar::acceptCaseLabel(TIntermNode*& statement) +{ + TSourceLoc loc = token.loc; + if (! acceptTokenClass(EHTokCase)) + return false; + + TIntermTyped* expression; + if (! acceptExpression(expression)) { + expected("case expression"); + return false; + } + + if (! acceptTokenClass(EHTokColon)) { + expected(":"); + return false; + } + + statement = parseContext.intermediate.addBranch(EOpCase, expression, loc); + + return true; +} + +// default_label +// : DEFAULT COLON +// +bool HlslGrammar::acceptDefaultLabel(TIntermNode*& statement) +{ + TSourceLoc loc = token.loc; + if (! acceptTokenClass(EHTokDefault)) + return false; + + if (! acceptTokenClass(EHTokColon)) { + expected(":"); + return false; + } + + statement = parseContext.intermediate.addBranch(EOpDefault, loc); + + return true; +} + +// array_specifier +// : LEFT_BRACKET integer_expression RGHT_BRACKET ... // optional +// : LEFT_BRACKET RGHT_BRACKET // optional +// +void HlslGrammar::acceptArraySpecifier(TArraySizes*& arraySizes) +{ + arraySizes = nullptr; + + // Early-out if there aren't any array dimensions + if (!peekTokenClass(EHTokLeftBracket)) + return; + + // If we get here, we have at least one array dimension. This will track the sizes we find. + arraySizes = new TArraySizes; + + // Collect each array dimension. + while (acceptTokenClass(EHTokLeftBracket)) { + TSourceLoc loc = token.loc; + TIntermTyped* sizeExpr = nullptr; + + // Array sizing expression is optional. If omitted, array will be later sized by initializer list. + const bool hasArraySize = acceptAssignmentExpression(sizeExpr); + + if (! acceptTokenClass(EHTokRightBracket)) { + expected("]"); + return; + } + + if (hasArraySize) { + TArraySize arraySize; + parseContext.arraySizeCheck(loc, sizeExpr, arraySize); + arraySizes->addInnerSize(arraySize); + } else { + arraySizes->addInnerSize(0); // sized by initializers. + } + } +} + +// post_decls +// : COLON semantic // optional +// COLON PACKOFFSET LEFT_PAREN c[Subcomponent][.component] RIGHT_PAREN // optional +// COLON REGISTER LEFT_PAREN [shader_profile,] Type#[subcomp]opt (COMMA SPACEN)opt RIGHT_PAREN // optional +// COLON LAYOUT layout_qualifier_list +// annotations // optional +// +// Return true if any tokens were accepted. That is, +// false can be returned on successfully recognizing nothing, +// not necessarily meaning bad syntax. +// +bool HlslGrammar::acceptPostDecls(TQualifier& qualifier) +{ + bool found = false; + + do { + // COLON + if (acceptTokenClass(EHTokColon)) { + found = true; + HlslToken idToken; + if (peekTokenClass(EHTokLayout)) + acceptLayoutQualifierList(qualifier); + else if (acceptTokenClass(EHTokPackOffset)) { + // PACKOFFSET LEFT_PAREN c[Subcomponent][.component] RIGHT_PAREN + if (! acceptTokenClass(EHTokLeftParen)) { + expected("("); + return false; + } + HlslToken locationToken; + if (! acceptIdentifier(locationToken)) { + expected("c[subcomponent][.component]"); + return false; + } + HlslToken componentToken; + if (acceptTokenClass(EHTokDot)) { + if (! acceptIdentifier(componentToken)) { + expected("component"); + return false; + } + } + if (! acceptTokenClass(EHTokRightParen)) { + expected(")"); + break; + } + parseContext.handlePackOffset(locationToken.loc, qualifier, *locationToken.string, componentToken.string); + } else if (! acceptIdentifier(idToken)) { + expected("layout, semantic, packoffset, or register"); + return false; + } else if (*idToken.string == "register") { + // REGISTER LEFT_PAREN [shader_profile,] Type#[subcomp]opt (COMMA SPACEN)opt RIGHT_PAREN + // LEFT_PAREN + if (! acceptTokenClass(EHTokLeftParen)) { + expected("("); + return false; + } + HlslToken registerDesc; // for Type# + HlslToken profile; + if (! acceptIdentifier(registerDesc)) { + expected("register number description"); + return false; + } + if (registerDesc.string->size() > 1 && !isdigit((*registerDesc.string)[1]) && + acceptTokenClass(EHTokComma)) { + // Then we didn't really see the registerDesc yet, it was + // actually the profile. Adjust... + profile = registerDesc; + if (! acceptIdentifier(registerDesc)) { + expected("register number description"); + return false; + } + } + int subComponent = 0; + if (acceptTokenClass(EHTokLeftBracket)) { + // LEFT_BRACKET subcomponent RIGHT_BRACKET + if (! peekTokenClass(EHTokIntConstant)) { + expected("literal integer"); + return false; + } + subComponent = token.i; + advanceToken(); + if (! acceptTokenClass(EHTokRightBracket)) { + expected("]"); + break; + } + } + // (COMMA SPACEN)opt + HlslToken spaceDesc; + if (acceptTokenClass(EHTokComma)) { + if (! acceptIdentifier(spaceDesc)) { + expected ("space identifier"); + return false; + } + } + // RIGHT_PAREN + if (! acceptTokenClass(EHTokRightParen)) { + expected(")"); + break; + } + parseContext.handleRegister(registerDesc.loc, qualifier, profile.string, *registerDesc.string, subComponent, spaceDesc.string); + } else { + // semantic, in idToken.string + TString semanticUpperCase = *idToken.string; + std::transform(semanticUpperCase.begin(), semanticUpperCase.end(), semanticUpperCase.begin(), ::toupper); + parseContext.handleSemantic(idToken.loc, qualifier, mapSemantic(semanticUpperCase.c_str()), semanticUpperCase); + } + } else if (peekTokenClass(EHTokLeftAngle)) { + found = true; + acceptAnnotations(qualifier); + } else + break; + + } while (true); + + return found; +} + +// +// Get the stream of tokens from the scanner, but skip all syntactic/semantic +// processing. +// +bool HlslGrammar::captureBlockTokens(TVector& tokens) +{ + if (! peekTokenClass(EHTokLeftBrace)) + return false; + + int braceCount = 0; + + do { + switch (peek()) { + case EHTokLeftBrace: + ++braceCount; + break; + case EHTokRightBrace: + --braceCount; + break; + case EHTokNone: + // End of input before balance { } is bad... + return false; + default: + break; + } + + tokens.push_back(token); + advanceToken(); + } while (braceCount > 0); + + return true; +} + +// Return a string for just the types that can also be declared as an identifier. +const char* HlslGrammar::getTypeString(EHlslTokenClass tokenClass) const +{ + switch (tokenClass) { + case EHTokSample: return "sample"; + case EHTokHalf: return "half"; + case EHTokHalf1x1: return "half1x1"; + case EHTokHalf1x2: return "half1x2"; + case EHTokHalf1x3: return "half1x3"; + case EHTokHalf1x4: return "half1x4"; + case EHTokHalf2x1: return "half2x1"; + case EHTokHalf2x2: return "half2x2"; + case EHTokHalf2x3: return "half2x3"; + case EHTokHalf2x4: return "half2x4"; + case EHTokHalf3x1: return "half3x1"; + case EHTokHalf3x2: return "half3x2"; + case EHTokHalf3x3: return "half3x3"; + case EHTokHalf3x4: return "half3x4"; + case EHTokHalf4x1: return "half4x1"; + case EHTokHalf4x2: return "half4x2"; + case EHTokHalf4x3: return "half4x3"; + case EHTokHalf4x4: return "half4x4"; + case EHTokBool: return "bool"; + case EHTokFloat: return "float"; + case EHTokDouble: return "double"; + case EHTokInt: return "int"; + case EHTokUint: return "uint"; + case EHTokMin16float: return "min16float"; + case EHTokMin10float: return "min10float"; + case EHTokMin16int: return "min16int"; + case EHTokMin12int: return "min12int"; + case EHTokConstantBuffer: return "ConstantBuffer"; + case EHTokLayout: return "layout"; + default: + return nullptr; + } +} + +} // end namespace glslang diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslGrammar.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslGrammar.h new file mode 100644 index 0000000000..cfe294bc0d --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslGrammar.h @@ -0,0 +1,144 @@ +// +// Copyright (C) 2016-2018 Google, Inc. +// Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2023 Mobica Limited. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef HLSLGRAMMAR_H_ +#define HLSLGRAMMAR_H_ + +#include "hlslParseHelper.h" +#include "hlslOpMap.h" +#include "hlslTokenStream.h" + +namespace glslang { + + class TFunctionDeclarator; + + // Should just be the grammar aspect of HLSL. + // Described in more detail in hlslGrammar.cpp. + + class HlslGrammar : public HlslTokenStream { + public: + HlslGrammar(HlslScanContext& scanner, HlslParseContext& parseContext) + : HlslTokenStream(scanner), parseContext(parseContext), intermediate(parseContext.intermediate), + typeIdentifiers(false), unitNode(nullptr) { } + virtual ~HlslGrammar() { } + + bool parse(); + + protected: + HlslGrammar(); + HlslGrammar& operator=(const HlslGrammar&); + + void expected(const char*); + void unimplemented(const char*); + bool acceptIdentifier(HlslToken&); + bool acceptCompilationUnit(); + bool acceptDeclarationList(TIntermNode*&); + bool acceptDeclaration(TIntermNode*&); + bool acceptControlDeclaration(TIntermNode*& node); + bool acceptSamplerDeclarationDX9(TType&); + bool acceptSamplerState(); + bool acceptFullySpecifiedType(TType&, const TAttributes&); + bool acceptFullySpecifiedType(TType&, TIntermNode*& nodeList, const TAttributes&, bool forbidDeclarators = false); + bool acceptPreQualifier(TQualifier&); + bool acceptPostQualifier(TQualifier&); + bool acceptLayoutQualifierList(TQualifier&); + bool acceptType(TType&); + bool acceptType(TType&, TIntermNode*& nodeList); + bool acceptTemplateVecMatBasicType(TBasicType&, TPrecisionQualifier&); + bool acceptVectorTemplateType(TType&); + bool acceptMatrixTemplateType(TType&); + bool acceptTessellationDeclType(TBuiltInVariable&); + bool acceptTessellationPatchTemplateType(TType&); + bool acceptStreamOutTemplateType(TType&, TLayoutGeometry&); + bool acceptOutputPrimitiveGeometry(TLayoutGeometry&); + bool acceptAnnotations(TQualifier&); + bool acceptSamplerTypeDX9(TType &); + bool acceptSamplerType(TType&); + bool acceptTextureType(TType&); + bool acceptSubpassInputType(TType&); + bool acceptStructBufferType(TType&); + bool acceptTextureBufferType(TType&); + bool acceptConstantBufferType(TType&); + bool acceptStruct(TType&, TIntermNode*& nodeList); + bool acceptStructDeclarationList(TTypeList*&, TIntermNode*& nodeList, TVector&); + bool acceptMemberFunctionDefinition(TIntermNode*& nodeList, const TType&, TString& memberName, + TFunctionDeclarator&); + bool acceptFunctionParameters(TFunction&); + bool acceptParameterDeclaration(TFunction&); + bool acceptFunctionDefinition(TFunctionDeclarator&, TIntermNode*& nodeList, TVector* deferredTokens); + bool acceptFunctionBody(TFunctionDeclarator& declarator, TIntermNode*& nodeList); + bool acceptParenExpression(TIntermTyped*&); + bool acceptExpression(TIntermTyped*&); + bool acceptInitializer(TIntermTyped*&); + bool acceptAssignmentExpression(TIntermTyped*&); + bool acceptConditionalExpression(TIntermTyped*&); + bool acceptBinaryExpression(TIntermTyped*&, PrecedenceLevel); + bool acceptUnaryExpression(TIntermTyped*&); + bool acceptPostfixExpression(TIntermTyped*&); + bool acceptConstructor(TIntermTyped*&); + bool acceptFunctionCall(const TSourceLoc&, TString& name, TIntermTyped*&, TIntermTyped* objectBase); + bool acceptArguments(TFunction*, TIntermTyped*&); + bool acceptLiteral(TIntermTyped*&); + bool acceptSimpleStatement(TIntermNode*&); + bool acceptCompoundStatement(TIntermNode*&); + bool acceptScopedStatement(TIntermNode*&); + bool acceptScopedCompoundStatement(TIntermNode*&); + bool acceptStatement(TIntermNode*&); + bool acceptNestedStatement(TIntermNode*&); + void acceptAttributes(TAttributes&); + bool acceptSelectionStatement(TIntermNode*&, const TAttributes&); + bool acceptSwitchStatement(TIntermNode*&, const TAttributes&); + bool acceptIterationStatement(TIntermNode*&, const TAttributes&); + bool acceptJumpStatement(TIntermNode*&); + bool acceptCaseLabel(TIntermNode*&); + bool acceptDefaultLabel(TIntermNode*&); + void acceptArraySpecifier(TArraySizes*&); + bool acceptPostDecls(TQualifier&); + bool acceptDefaultParameterDeclaration(const TType&, TIntermTyped*&); + + bool captureBlockTokens(TVector& tokens); + const char* getTypeString(EHlslTokenClass tokenClass) const; + + HlslParseContext& parseContext; // state of parsing and helper functions for building the intermediate + TIntermediate& intermediate; // the final product, the intermediate representation, includes the AST + bool typeIdentifiers; // shader uses some types as identifiers + TIntermNode* unitNode; + }; + +} // end namespace glslang + +#endif // HLSLGRAMMAR_H_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslOpMap.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslOpMap.cpp new file mode 100644 index 0000000000..ebe6fbd96c --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslOpMap.cpp @@ -0,0 +1,173 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// Map from physical token form (e.g. '-') to logical operator +// form (e.g., binary subtract or unary negate). + +#include "hlslOpMap.h" + +namespace glslang { + +// Map parsing tokens that could be assignments into assignment operators. +TOperator HlslOpMap::assignment(EHlslTokenClass op) +{ + switch (op) { + case EHTokAssign: return EOpAssign; + case EHTokMulAssign: return EOpMulAssign; + case EHTokDivAssign: return EOpDivAssign; + case EHTokAddAssign: return EOpAddAssign; + case EHTokModAssign: return EOpModAssign; + case EHTokLeftAssign: return EOpLeftShiftAssign; + case EHTokRightAssign: return EOpRightShiftAssign; + case EHTokAndAssign: return EOpAndAssign; + case EHTokXorAssign: return EOpExclusiveOrAssign; + case EHTokOrAssign: return EOpInclusiveOrAssign; + case EHTokSubAssign: return EOpSubAssign; + + default: + return EOpNull; + } +} + +// Map parsing tokens that could be binary operations into binary operators. +TOperator HlslOpMap::binary(EHlslTokenClass op) +{ + switch (op) { + case EHTokPlus: return EOpAdd; + case EHTokDash: return EOpSub; + case EHTokStar: return EOpMul; + case EHTokSlash: return EOpDiv; + case EHTokPercent: return EOpMod; + case EHTokRightOp: return EOpRightShift; + case EHTokLeftOp: return EOpLeftShift; + case EHTokAmpersand: return EOpAnd; + case EHTokVerticalBar: return EOpInclusiveOr; + case EHTokCaret: return EOpExclusiveOr; + case EHTokEqOp: return EOpEqual; + case EHTokNeOp: return EOpNotEqual; + case EHTokLeftAngle: return EOpLessThan; + case EHTokRightAngle: return EOpGreaterThan; + case EHTokLeOp: return EOpLessThanEqual; + case EHTokGeOp: return EOpGreaterThanEqual; + case EHTokOrOp: return EOpLogicalOr; + case EHTokXorOp: return EOpLogicalXor; + case EHTokAndOp: return EOpLogicalAnd; + + default: + return EOpNull; + } +} + +// Map parsing tokens that could be unary operations into unary operators. +// These are just the ones that can appear in front of its operand. +TOperator HlslOpMap::preUnary(EHlslTokenClass op) +{ + switch (op) { + case EHTokPlus: return EOpAdd; // means no-op, but still a unary op was present + case EHTokDash: return EOpNegative; + case EHTokBang: return EOpLogicalNot; + case EHTokTilde: return EOpBitwiseNot; + + case EHTokIncOp: return EOpPreIncrement; + case EHTokDecOp: return EOpPreDecrement; + + default: return EOpNull; // means not a pre-unary op + } +} + +// Map parsing tokens that could be unary operations into unary operators. +// These are just the ones that can appear behind its operand. +TOperator HlslOpMap::postUnary(EHlslTokenClass op) +{ + switch (op) { + case EHTokDot: return EOpIndexDirectStruct; + case EHTokLeftBracket: return EOpIndexIndirect; + + case EHTokIncOp: return EOpPostIncrement; + case EHTokDecOp: return EOpPostDecrement; + + case EHTokColonColon: return EOpScoping; + + default: return EOpNull; // means not a post-unary op + } +} + +// Map operators into their level of precedence. +PrecedenceLevel HlslOpMap::precedenceLevel(TOperator op) +{ + switch (op) { + case EOpLogicalOr: + return PlLogicalOr; + case EOpLogicalXor: + return PlLogicalXor; + case EOpLogicalAnd: + return PlLogicalAnd; + + case EOpInclusiveOr: + return PlBitwiseOr; + case EOpExclusiveOr: + return PlBitwiseXor; + case EOpAnd: + return PlBitwiseAnd; + + case EOpEqual: + case EOpNotEqual: + return PlEquality; + + case EOpLessThan: + case EOpGreaterThan: + case EOpLessThanEqual: + case EOpGreaterThanEqual: + return PlRelational; + + case EOpRightShift: + case EOpLeftShift: + return PlShift; + + case EOpAdd: + case EOpSub: + return PlAdd; + + case EOpMul: + case EOpDiv: + case EOpMod: + return PlMul; + + default: + return PlBad; + } +} + +} // end namespace glslang diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslOpMap.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslOpMap.h new file mode 100644 index 0000000000..4e783f3f0c --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslOpMap.h @@ -0,0 +1,69 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef HLSLOPMAP_H_ +#define HLSLOPMAP_H_ + +#include "hlslScanContext.h" + +namespace glslang { + + enum PrecedenceLevel { + PlBad, + PlLogicalOr, + PlLogicalXor, + PlLogicalAnd, + PlBitwiseOr, + PlBitwiseXor, + PlBitwiseAnd, + PlEquality, + PlRelational, + PlShift, + PlAdd, + PlMul + }; + + class HlslOpMap { + public: + static TOperator assignment(EHlslTokenClass op); + static TOperator binary(EHlslTokenClass op); + static TOperator preUnary(EHlslTokenClass op); + static TOperator postUnary(EHlslTokenClass op); + static PrecedenceLevel precedenceLevel(TOperator); + }; + +} // end namespace glslang + +#endif // HLSLOPMAP_H_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp new file mode 100644 index 0000000000..3dbdcb8b46 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp @@ -0,0 +1,10294 @@ +// +// Copyright (C) 2017-2018 Google, Inc. +// Copyright (C) 2017 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "hlslParseHelper.h" +#include "hlslScanContext.h" +#include "hlslGrammar.h" +#include "hlslAttributes.h" + +#include "../Include/Common.h" +#include "../MachineIndependent/Scan.h" +#include "../MachineIndependent/preprocessor/PpContext.h" + +#include +#include +#include +#include +#include + +namespace glslang { + +HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& interm, bool parsingBuiltins, + int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, + TInfoSink& infoSink, + const TString sourceEntryPointName, + bool forwardCompatible, EShMessages messages) : + TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language, infoSink, + forwardCompatible, messages, &sourceEntryPointName), + annotationNestingLevel(0), + inputPatch(nullptr), + nextInLocation(0), nextOutLocation(0), + entryPointFunction(nullptr), + entryPointFunctionBody(nullptr), + gsStreamOutput(nullptr), + clipDistanceOutput(nullptr), + cullDistanceOutput(nullptr), + clipDistanceInput(nullptr), + cullDistanceInput(nullptr), + parsingEntrypointParameters(false) +{ + globalUniformDefaults.clear(); + globalUniformDefaults.layoutMatrix = ElmRowMajor; + globalUniformDefaults.layoutPacking = ElpStd140; + + globalBufferDefaults.clear(); + globalBufferDefaults.layoutMatrix = ElmRowMajor; + globalBufferDefaults.layoutPacking = ElpStd430; + + globalInputDefaults.clear(); + globalOutputDefaults.clear(); + + clipSemanticNSizeIn.fill(0); + cullSemanticNSizeIn.fill(0); + clipSemanticNSizeOut.fill(0); + cullSemanticNSizeOut.fill(0); + + // "Shaders in the transform + // feedback capturing mode have an initial global default of + // layout(xfb_buffer = 0) out;" + if (language == EShLangVertex || + language == EShLangTessControl || + language == EShLangTessEvaluation || + language == EShLangGeometry) + globalOutputDefaults.layoutXfbBuffer = 0; + + if (language == EShLangGeometry) + globalOutputDefaults.layoutStream = 0; +} + +HlslParseContext::~HlslParseContext() +{ +} + +void HlslParseContext::initializeExtensionBehavior() +{ + TParseContextBase::initializeExtensionBehavior(); + + // HLSL allows #line by default. + extensionBehavior[E_GL_GOOGLE_cpp_style_line_directive] = EBhEnable; +} + +void HlslParseContext::setLimits(const TBuiltInResource& r) +{ + resources = r; + intermediate.setLimits(resources); +} + +// +// Parse an array of strings using the parser in HlslRules. +// +// Returns true for successful acceptance of the shader, false if any errors. +// +bool HlslParseContext::parseShaderStrings(TPpContext& ppContext, TInputScanner& input, bool versionWillBeError) +{ + currentScanner = &input; + ppContext.setInput(input, versionWillBeError); + + HlslScanContext scanContext(*this, ppContext); + HlslGrammar grammar(scanContext, *this); + if (!grammar.parse()) { + // Print a message formated such that if you click on the message it will take you right to + // the line through most UIs. + const glslang::TSourceLoc& sourceLoc = input.getSourceLoc(); + infoSink.info << sourceLoc.getFilenameStr() << "(" << sourceLoc.line << "): error at column " << sourceLoc.column + << ", HLSL parsing failed.\n"; + ++numErrors; + return false; + } + + finish(); + + return numErrors == 0; +} + +// +// Return true if this l-value node should be converted in some manner. +// For instance: turning a load aggregate into a store in an l-value. +// +bool HlslParseContext::shouldConvertLValue(const TIntermNode* node) const +{ + if (node == nullptr || node->getAsTyped() == nullptr) + return false; + + const TIntermAggregate* lhsAsAggregate = node->getAsAggregate(); + const TIntermBinary* lhsAsBinary = node->getAsBinaryNode(); + + // If it's a swizzled/indexed aggregate, look at the left node instead. + if (lhsAsBinary != nullptr && + (lhsAsBinary->getOp() == EOpVectorSwizzle || lhsAsBinary->getOp() == EOpIndexDirect)) + lhsAsAggregate = lhsAsBinary->getLeft()->getAsAggregate(); + if (lhsAsAggregate != nullptr && lhsAsAggregate->getOp() == EOpImageLoad) + return true; + + return false; +} + +void HlslParseContext::growGlobalUniformBlock(const TSourceLoc& loc, TType& memberType, const TString& memberName, + TTypeList* newTypeList) +{ + newTypeList = nullptr; + correctUniform(memberType.getQualifier()); + if (memberType.isStruct()) { + auto it = ioTypeMap.find(memberType.getStruct()); + if (it != ioTypeMap.end() && it->second.uniform) + newTypeList = it->second.uniform; + } + TParseContextBase::growGlobalUniformBlock(loc, memberType, memberName, newTypeList); +} + +// +// Return a TLayoutFormat corresponding to the given texture type. +// +TLayoutFormat HlslParseContext::getLayoutFromTxType(const TSourceLoc& loc, const TType& txType) +{ + if (txType.isStruct()) { + // TODO: implement. + error(loc, "unimplemented: structure type in image or buffer", "", ""); + return ElfNone; + } + + const int components = txType.getVectorSize(); + const TBasicType txBasicType = txType.getBasicType(); + + const auto selectFormat = [this,&components](TLayoutFormat v1, TLayoutFormat v2, TLayoutFormat v4) -> TLayoutFormat { + if (intermediate.getNoStorageFormat()) + return ElfNone; + + return components == 1 ? v1 : + components == 2 ? v2 : v4; + }; + + switch (txBasicType) { + case EbtFloat: return selectFormat(ElfR32f, ElfRg32f, ElfRgba32f); + case EbtInt: return selectFormat(ElfR32i, ElfRg32i, ElfRgba32i); + case EbtUint: return selectFormat(ElfR32ui, ElfRg32ui, ElfRgba32ui); + default: + error(loc, "unknown basic type in image format", "", ""); + return ElfNone; + } +} + +// +// Both test and if necessary, spit out an error, to see if the node is really +// an l-value that can be operated on this way. +// +// Returns true if there was an error. +// +bool HlslParseContext::lValueErrorCheck(const TSourceLoc& loc, const char* op, TIntermTyped* node) +{ + if (shouldConvertLValue(node)) { + // if we're writing to a texture, it must be an RW form. + + TIntermAggregate* lhsAsAggregate = node->getAsAggregate(); + TIntermTyped* object = lhsAsAggregate->getSequence()[0]->getAsTyped(); + + if (!object->getType().getSampler().isImage()) { + error(loc, "operator[] on a non-RW texture must be an r-value", "", ""); + return true; + } + } + + // We tolerate samplers as l-values, even though they are nominally + // illegal, because we expect a later optimization to eliminate them. + if (node->getType().getBasicType() == EbtSampler) { + intermediate.setNeedsLegalization(); + return false; + } + + // Let the base class check errors + return TParseContextBase::lValueErrorCheck(loc, op, node); +} + +// +// This function handles l-value conversions and verifications. It uses, but is not synonymous +// with lValueErrorCheck. That function accepts an l-value directly, while this one must be +// given the surrounding tree - e.g, with an assignment, so we can convert the assign into a +// series of other image operations. +// +// Most things are passed through unmodified, except for error checking. +// +TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char* op, TIntermTyped*& node) +{ + if (node == nullptr) + return nullptr; + + TIntermBinary* nodeAsBinary = node->getAsBinaryNode(); + TIntermUnary* nodeAsUnary = node->getAsUnaryNode(); + TIntermAggregate* sequence = nullptr; + + TIntermTyped* lhs = nodeAsUnary ? nodeAsUnary->getOperand() : + nodeAsBinary ? nodeAsBinary->getLeft() : + nullptr; + + // Early bail out if there is no conversion to apply + if (!shouldConvertLValue(lhs)) { + if (lhs != nullptr) + if (lValueErrorCheck(loc, op, lhs)) + return nullptr; + return node; + } + + // *** If we get here, we're going to apply some conversion to an l-value. + + // Helper to create a load. + const auto makeLoad = [&](TIntermSymbol* rhsTmp, TIntermTyped* object, TIntermTyped* coord, const TType& derefType) { + TIntermAggregate* loadOp = new TIntermAggregate(EOpImageLoad); + loadOp->setLoc(loc); + loadOp->getSequence().push_back(object); + loadOp->getSequence().push_back(intermediate.addSymbol(*coord->getAsSymbolNode())); + loadOp->setType(derefType); + + sequence = intermediate.growAggregate(sequence, + intermediate.addAssign(EOpAssign, rhsTmp, loadOp, loc), + loc); + }; + + // Helper to create a store. + const auto makeStore = [&](TIntermTyped* object, TIntermTyped* coord, TIntermSymbol* rhsTmp) { + TIntermAggregate* storeOp = new TIntermAggregate(EOpImageStore); + storeOp->getSequence().push_back(object); + storeOp->getSequence().push_back(coord); + storeOp->getSequence().push_back(intermediate.addSymbol(*rhsTmp)); + storeOp->setLoc(loc); + storeOp->setType(TType(EbtVoid)); + + sequence = intermediate.growAggregate(sequence, storeOp); + }; + + // Helper to create an assign. + const auto makeBinary = [&](TOperator op, TIntermTyped* lhs, TIntermTyped* rhs) { + sequence = intermediate.growAggregate(sequence, + intermediate.addBinaryNode(op, lhs, rhs, loc, lhs->getType()), + loc); + }; + + // Helper to complete sequence by adding trailing variable, so we evaluate to the right value. + const auto finishSequence = [&](TIntermSymbol* rhsTmp, const TType& derefType) -> TIntermAggregate* { + // Add a trailing use of the temp, so the sequence returns the proper value. + sequence = intermediate.growAggregate(sequence, intermediate.addSymbol(*rhsTmp)); + sequence->setOperator(EOpSequence); + sequence->setLoc(loc); + sequence->setType(derefType); + + return sequence; + }; + + // Helper to add unary op + const auto makeUnary = [&](TOperator op, TIntermSymbol* rhsTmp) { + sequence = intermediate.growAggregate(sequence, + intermediate.addUnaryNode(op, intermediate.addSymbol(*rhsTmp), loc, + rhsTmp->getType()), + loc); + }; + + // Return true if swizzle or index writes all components of the given variable. + const auto writesAllComponents = [&](TIntermSymbol* var, TIntermBinary* swizzle) -> bool { + if (swizzle == nullptr) // not a swizzle or index + return true; + + // Track which components are being set. + std::array compIsSet; + compIsSet.fill(false); + + const TIntermConstantUnion* asConst = swizzle->getRight()->getAsConstantUnion(); + const TIntermAggregate* asAggregate = swizzle->getRight()->getAsAggregate(); + + // This could be either a direct index, or a swizzle. + if (asConst) { + compIsSet[asConst->getConstArray()[0].getIConst()] = true; + } else if (asAggregate) { + const TIntermSequence& seq = asAggregate->getSequence(); + for (int comp=0; compgetAsConstantUnion()->getConstArray()[0].getIConst()] = true; + } else { + assert(0); + } + + // Return true if all components are being set by the index or swizzle + return std::all_of(compIsSet.begin(), compIsSet.begin() + var->getType().getVectorSize(), + [](bool isSet) { return isSet; } ); + }; + + // Create swizzle matching input swizzle + const auto addSwizzle = [&](TIntermSymbol* var, TIntermBinary* swizzle) -> TIntermTyped* { + if (swizzle) + return intermediate.addBinaryNode(swizzle->getOp(), var, swizzle->getRight(), loc, swizzle->getType()); + else + return var; + }; + + TIntermBinary* lhsAsBinary = lhs->getAsBinaryNode(); + TIntermAggregate* lhsAsAggregate = lhs->getAsAggregate(); + bool lhsIsSwizzle = false; + + // If it's a swizzled L-value, remember the swizzle, and use the LHS. + if (lhsAsBinary != nullptr && (lhsAsBinary->getOp() == EOpVectorSwizzle || lhsAsBinary->getOp() == EOpIndexDirect)) { + lhsAsAggregate = lhsAsBinary->getLeft()->getAsAggregate(); + lhsIsSwizzle = true; + } + + TIntermTyped* object = lhsAsAggregate->getSequence()[0]->getAsTyped(); + TIntermTyped* coord = lhsAsAggregate->getSequence()[1]->getAsTyped(); + + const TSampler& texSampler = object->getType().getSampler(); + + TType objDerefType; + getTextureReturnType(texSampler, objDerefType); + + if (nodeAsBinary) { + TIntermTyped* rhs = nodeAsBinary->getRight(); + const TOperator assignOp = nodeAsBinary->getOp(); + + bool isModifyOp = false; + + switch (assignOp) { + case EOpAddAssign: + case EOpSubAssign: + case EOpMulAssign: + case EOpVectorTimesMatrixAssign: + case EOpVectorTimesScalarAssign: + case EOpMatrixTimesScalarAssign: + case EOpMatrixTimesMatrixAssign: + case EOpDivAssign: + case EOpModAssign: + case EOpAndAssign: + case EOpInclusiveOrAssign: + case EOpExclusiveOrAssign: + case EOpLeftShiftAssign: + case EOpRightShiftAssign: + isModifyOp = true; + [[fallthrough]]; + case EOpAssign: + { + // Since this is an lvalue, we'll convert an image load to a sequence like this + // (to still provide the value): + // OpSequence + // OpImageStore(object, lhs, rhs) + // rhs + // But if it's not a simple symbol RHS (say, a fn call), we don't want to duplicate the RHS, + // so we'll convert instead to this: + // OpSequence + // rhsTmp = rhs + // OpImageStore(object, coord, rhsTmp) + // rhsTmp + // If this is a read-modify-write op, like +=, we issue: + // OpSequence + // coordtmp = load's param1 + // rhsTmp = OpImageLoad(object, coordTmp) + // rhsTmp op= rhs + // OpImageStore(object, coordTmp, rhsTmp) + // rhsTmp + // + // If the lvalue is swizzled, we apply that when writing the temp variable, like so: + // ... + // rhsTmp.some_swizzle = ... + // For partial writes, an error is generated. + + TIntermSymbol* rhsTmp = rhs->getAsSymbolNode(); + TIntermTyped* coordTmp = coord; + + if (rhsTmp == nullptr || isModifyOp || lhsIsSwizzle) { + rhsTmp = makeInternalVariableNode(loc, "storeTemp", objDerefType); + + // Partial updates not yet supported + if (!writesAllComponents(rhsTmp, lhsAsBinary)) { + error(loc, "unimplemented: partial image updates", "", ""); + } + + // Assign storeTemp = rhs + if (isModifyOp) { + // We have to make a temp var for the coordinate, to avoid evaluating it twice. + coordTmp = makeInternalVariableNode(loc, "coordTemp", coord->getType()); + makeBinary(EOpAssign, coordTmp, coord); // coordtmp = load[param1] + makeLoad(rhsTmp, object, coordTmp, objDerefType); // rhsTmp = OpImageLoad(object, coordTmp) + } + + // rhsTmp op= rhs. + makeBinary(assignOp, addSwizzle(intermediate.addSymbol(*rhsTmp), lhsAsBinary), rhs); + } + + makeStore(object, coordTmp, rhsTmp); // add a store + return finishSequence(rhsTmp, objDerefType); // return rhsTmp from sequence + } + + default: + break; + } + } + + if (nodeAsUnary) { + const TOperator assignOp = nodeAsUnary->getOp(); + + switch (assignOp) { + case EOpPreIncrement: + case EOpPreDecrement: + { + // We turn this into: + // OpSequence + // coordtmp = load's param1 + // rhsTmp = OpImageLoad(object, coordTmp) + // rhsTmp op + // OpImageStore(object, coordTmp, rhsTmp) + // rhsTmp + + TIntermSymbol* rhsTmp = makeInternalVariableNode(loc, "storeTemp", objDerefType); + TIntermTyped* coordTmp = makeInternalVariableNode(loc, "coordTemp", coord->getType()); + + makeBinary(EOpAssign, coordTmp, coord); // coordtmp = load[param1] + makeLoad(rhsTmp, object, coordTmp, objDerefType); // rhsTmp = OpImageLoad(object, coordTmp) + makeUnary(assignOp, rhsTmp); // op rhsTmp + makeStore(object, coordTmp, rhsTmp); // OpImageStore(object, coordTmp, rhsTmp) + return finishSequence(rhsTmp, objDerefType); // return rhsTmp from sequence + } + + case EOpPostIncrement: + case EOpPostDecrement: + { + // We turn this into: + // OpSequence + // coordtmp = load's param1 + // rhsTmp1 = OpImageLoad(object, coordTmp) + // rhsTmp2 = rhsTmp1 + // rhsTmp2 op + // OpImageStore(object, coordTmp, rhsTmp2) + // rhsTmp1 (pre-op value) + TIntermSymbol* rhsTmp1 = makeInternalVariableNode(loc, "storeTempPre", objDerefType); + TIntermSymbol* rhsTmp2 = makeInternalVariableNode(loc, "storeTempPost", objDerefType); + TIntermTyped* coordTmp = makeInternalVariableNode(loc, "coordTemp", coord->getType()); + + makeBinary(EOpAssign, coordTmp, coord); // coordtmp = load[param1] + makeLoad(rhsTmp1, object, coordTmp, objDerefType); // rhsTmp1 = OpImageLoad(object, coordTmp) + makeBinary(EOpAssign, rhsTmp2, rhsTmp1); // rhsTmp2 = rhsTmp1 + makeUnary(assignOp, rhsTmp2); // rhsTmp op + makeStore(object, coordTmp, rhsTmp2); // OpImageStore(object, coordTmp, rhsTmp2) + return finishSequence(rhsTmp1, objDerefType); // return rhsTmp from sequence + } + + default: + break; + } + } + + if (lhs) + if (lValueErrorCheck(loc, op, lhs)) + return nullptr; + + return node; +} + +void HlslParseContext::handlePragma(const TSourceLoc& loc, const TVector& tokens) +{ + if (pragmaCallback) + pragmaCallback(loc.line, tokens); + + if (tokens.size() == 0) + return; + + // These pragmas are case insensitive in HLSL, so we'll compare in lower case. + TVector lowerTokens = tokens; + + for (auto it = lowerTokens.begin(); it != lowerTokens.end(); ++it) + std::transform(it->begin(), it->end(), it->begin(), ::tolower); + + // Handle pack_matrix + if (tokens.size() == 4 && lowerTokens[0] == "pack_matrix" && tokens[1] == "(" && tokens[3] == ")") { + // Note that HLSL semantic order is Mrc, not Mcr like SPIR-V, so we reverse the sense. + // Row major becomes column major and vice versa. + + if (lowerTokens[2] == "row_major") { + globalUniformDefaults.layoutMatrix = globalBufferDefaults.layoutMatrix = ElmColumnMajor; + } else if (lowerTokens[2] == "column_major") { + globalUniformDefaults.layoutMatrix = globalBufferDefaults.layoutMatrix = ElmRowMajor; + } else { + // unknown majorness strings are treated as (HLSL column major)==(SPIR-V row major) + warn(loc, "unknown pack_matrix pragma value", tokens[2].c_str(), ""); + globalUniformDefaults.layoutMatrix = globalBufferDefaults.layoutMatrix = ElmRowMajor; + } + return; + } + + // Handle once + if (lowerTokens[0] == "once") { + warn(loc, "not implemented", "#pragma once", ""); + return; + } +} + +// +// Look at a '.' matrix selector string and change it into components +// for a matrix. There are two types: +// +// _21 second row, first column (one based) +// _m21 third row, second column (zero based) +// +// Returns true if there is no error. +// +bool HlslParseContext::parseMatrixSwizzleSelector(const TSourceLoc& loc, const TString& fields, int cols, int rows, + TSwizzleSelectors& components) +{ + int startPos[MaxSwizzleSelectors]; + int numComps = 0; + TString compString = fields; + + // Find where each component starts, + // recording the first character position after the '_'. + for (size_t c = 0; c < compString.size(); ++c) { + if (compString[c] == '_') { + if (numComps >= MaxSwizzleSelectors) { + error(loc, "matrix component swizzle has too many components", compString.c_str(), ""); + return false; + } + if (c > compString.size() - 3 || + ((compString[c+1] == 'm' || compString[c+1] == 'M') && c > compString.size() - 4)) { + error(loc, "matrix component swizzle missing", compString.c_str(), ""); + return false; + } + startPos[numComps++] = (int)c + 1; + } + } + + // Process each component + for (int i = 0; i < numComps; ++i) { + int pos = startPos[i]; + int bias = -1; + if (compString[pos] == 'm' || compString[pos] == 'M') { + bias = 0; + ++pos; + } + TMatrixSelector comp; + comp.coord1 = compString[pos+0] - '0' + bias; + comp.coord2 = compString[pos+1] - '0' + bias; + if (comp.coord1 < 0 || comp.coord1 >= cols) { + error(loc, "matrix row component out of range", compString.c_str(), ""); + return false; + } + if (comp.coord2 < 0 || comp.coord2 >= rows) { + error(loc, "matrix column component out of range", compString.c_str(), ""); + return false; + } + components.push_back(comp); + } + + return true; +} + +// If the 'comps' express a column of a matrix, +// return the column. Column means the first coords all match. +// +// Otherwise, return -1. +// +int HlslParseContext::getMatrixComponentsColumn(int rows, const TSwizzleSelectors& selector) +{ + int col = -1; + + // right number of comps? + if (selector.size() != rows) + return -1; + + // all comps in the same column? + // rows in order? + col = selector[0].coord1; + for (int i = 0; i < rows; ++i) { + if (col != selector[i].coord1) + return -1; + if (i != selector[i].coord2) + return -1; + } + + return col; +} + +// +// Handle seeing a variable identifier in the grammar. +// +TIntermTyped* HlslParseContext::handleVariable(const TSourceLoc& loc, const TString* string) +{ + int thisDepth; + TSymbol* symbol = symbolTable.find(*string, thisDepth); + if (symbol && symbol->getAsVariable() && symbol->getAsVariable()->isUserType()) { + error(loc, "expected symbol, not user-defined type", string->c_str(), ""); + return nullptr; + } + + const TVariable* variable = nullptr; + const TAnonMember* anon = symbol ? symbol->getAsAnonMember() : nullptr; + TIntermTyped* node = nullptr; + if (anon) { + // It was a member of an anonymous container, which could be a 'this' structure. + + // Create a subtree for its dereference. + if (thisDepth > 0) { + variable = getImplicitThis(thisDepth); + if (variable == nullptr) + error(loc, "cannot access member variables (static member function?)", "this", ""); + } + if (variable == nullptr) + variable = anon->getAnonContainer().getAsVariable(); + + TIntermTyped* container = intermediate.addSymbol(*variable, loc); + TIntermTyped* constNode = intermediate.addConstantUnion(anon->getMemberNumber(), loc); + node = intermediate.addIndex(EOpIndexDirectStruct, container, constNode, loc); + + node->setType(*(*variable->getType().getStruct())[anon->getMemberNumber()].type); + if (node->getType().hiddenMember()) + error(loc, "member of nameless block was not redeclared", string->c_str(), ""); + } else { + // Not a member of an anonymous container. + + // The symbol table search was done in the lexical phase. + // See if it was a variable. + variable = symbol ? symbol->getAsVariable() : nullptr; + if (variable) { + if ((variable->getType().getBasicType() == EbtBlock || + variable->getType().getBasicType() == EbtStruct) && variable->getType().getStruct() == nullptr) { + error(loc, "cannot be used (maybe an instance name is needed)", string->c_str(), ""); + variable = nullptr; + } + } else { + if (symbol) + error(loc, "variable name expected", string->c_str(), ""); + } + + // Recovery, if it wasn't found or was not a variable. + if (variable == nullptr) { + error(loc, "unknown variable", string->c_str(), ""); + variable = new TVariable(string, TType(EbtVoid)); + } + + if (variable->getType().getQualifier().isFrontEndConstant()) + node = intermediate.addConstantUnion(variable->getConstArray(), variable->getType(), loc); + else + node = intermediate.addSymbol(*variable, loc); + } + + if (variable->getType().getQualifier().isIo()) + intermediate.addIoAccessed(*string); + + return node; +} + +// +// Handle operator[] on any objects it applies to. Currently: +// Textures +// Buffers +// +TIntermTyped* HlslParseContext::handleBracketOperator(const TSourceLoc& loc, TIntermTyped* base, TIntermTyped* index) +{ + // handle r-value operator[] on textures and images. l-values will be processed later. + if (base->getType().getBasicType() == EbtSampler && !base->isArray()) { + const TSampler& sampler = base->getType().getSampler(); + if (sampler.isImage() || sampler.isTexture()) { + if (! mipsOperatorMipArg.empty() && mipsOperatorMipArg.back().mipLevel == nullptr) { + // The first operator[] to a .mips[] sequence is the mip level. We'll remember it. + mipsOperatorMipArg.back().mipLevel = index; + return base; // next [] index is to the same base. + } else { + TIntermAggregate* load = new TIntermAggregate(sampler.isImage() ? EOpImageLoad : EOpTextureFetch); + + TType sampReturnType; + getTextureReturnType(sampler, sampReturnType); + + load->setType(sampReturnType); + load->setLoc(loc); + load->getSequence().push_back(base); + load->getSequence().push_back(index); + + // Textures need a MIP. If we saw one go by, use it. Otherwise, use zero. + if (sampler.isTexture()) { + if (! mipsOperatorMipArg.empty()) { + load->getSequence().push_back(mipsOperatorMipArg.back().mipLevel); + mipsOperatorMipArg.pop_back(); + } else { + load->getSequence().push_back(intermediate.addConstantUnion(0, loc, true)); + } + } + + return load; + } + } + } + + // Handle operator[] on structured buffers: this indexes into the array element of the buffer. + // indexStructBufferContent returns nullptr if it isn't a structuredbuffer (SSBO). + TIntermTyped* sbArray = indexStructBufferContent(loc, base); + if (sbArray != nullptr) { + // Now we'll apply the [] index to that array + const TOperator idxOp = (index->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect; + + TIntermTyped* element = intermediate.addIndex(idxOp, sbArray, index, loc); + const TType derefType(sbArray->getType(), 0); + element->setType(derefType); + return element; + } + + return nullptr; +} + +// +// Cast index value to a uint if it isn't already (for operator[], load indexes, etc) +TIntermTyped* HlslParseContext::makeIntegerIndex(TIntermTyped* index) +{ + const TBasicType indexBasicType = index->getType().getBasicType(); + const int vecSize = index->getType().getVectorSize(); + + // We can use int types directly as the index + if (indexBasicType == EbtInt || indexBasicType == EbtUint || + indexBasicType == EbtInt64 || indexBasicType == EbtUint64) + return index; + + // Cast index to unsigned integer if it isn't one. + return intermediate.addConversion(EOpConstructUint, TType(EbtUint, EvqTemporary, vecSize), index); +} + +// +// Handle seeing a base[index] dereference in the grammar. +// +TIntermTyped* HlslParseContext::handleBracketDereference(const TSourceLoc& loc, TIntermTyped* base, TIntermTyped* index) +{ + index = makeIntegerIndex(index); + + if (index == nullptr) { + error(loc, " unknown index type ", "", ""); + return nullptr; + } + + TIntermTyped* result = handleBracketOperator(loc, base, index); + + if (result != nullptr) + return result; // it was handled as an operator[] + + bool flattened = false; + int64_t indexValue = 0; + if (index->getQualifier().isFrontEndConstant()) { + if (index->getType().contains64BitInt()) { + indexValue = index->getAsConstantUnion()->getConstArray()[0].getI64Const(); + } else if (index->getType().getBasicType() == EbtUint) { + indexValue = index->getAsConstantUnion()->getConstArray()[0].getUConst(); + } else { + indexValue = index->getAsConstantUnion()->getConstArray()[0].getIConst(); + } + } + + variableCheck(base); + if (! base->isArray() && ! base->isMatrix() && ! base->isVector()) { + if (base->getAsSymbolNode()) + error(loc, " left of '[' is not of type array, matrix, or vector ", + base->getAsSymbolNode()->getName().c_str(), ""); + else + error(loc, " left of '[' is not of type array, matrix, or vector ", "expression", ""); + } else if (base->getType().getQualifier().isFrontEndConstant() && + index->getQualifier().isFrontEndConstant()) { + // both base and index are front-end constants + checkIndex(loc, base->getType(), indexValue); + return intermediate.foldDereference(base, indexValue, loc); + } else { + // at least one of base and index is variable... + + if (index->getQualifier().isFrontEndConstant()) + checkIndex(loc, base->getType(), indexValue); + + if (base->getType().isScalarOrVec1()) + result = base; + else if (base->getAsSymbolNode() && wasFlattened(base)) { + if (index->getQualifier().storage != EvqConst) + error(loc, "Invalid variable index to flattened array", base->getAsSymbolNode()->getName().c_str(), ""); + + result = flattenAccess(base, indexValue); + flattened = (result != base); + } else { + if (index->getQualifier().isFrontEndConstant()) { + if (base->getType().isUnsizedArray()) + base->getWritableType().updateImplicitArraySize(indexValue + 1); + else + checkIndex(loc, base->getType(), indexValue); + result = intermediate.addIndex(EOpIndexDirect, base, index, loc); + } else + result = intermediate.addIndex(EOpIndexIndirect, base, index, loc); + } + } + + if (result == nullptr) { + // Insert dummy error-recovery result + result = intermediate.addConstantUnion(0.0, EbtFloat, loc); + } else { + // If the array reference was flattened, it has the correct type. E.g, if it was + // a uniform array, it was flattened INTO a set of scalar uniforms, not scalar temps. + // In that case, we preserve the qualifiers. + if (!flattened) { + // Insert valid dereferenced result + TType newType(base->getType(), 0); // dereferenced type + if (base->getType().getQualifier().storage == EvqConst && index->getQualifier().storage == EvqConst) + newType.getQualifier().storage = EvqConst; + else + newType.getQualifier().storage = EvqTemporary; + result->setType(newType); + } + } + + return result; +} + +// Handle seeing a binary node with a math operation. +TIntermTyped* HlslParseContext::handleBinaryMath(const TSourceLoc& loc, const char* str, TOperator op, + TIntermTyped* left, TIntermTyped* right) +{ + TIntermTyped* result = intermediate.addBinaryMath(op, left, right, loc); + if (result == nullptr) + binaryOpError(loc, str, left->getCompleteString(), right->getCompleteString()); + + return result; +} + +// Handle seeing a unary node with a math operation. +TIntermTyped* HlslParseContext::handleUnaryMath(const TSourceLoc& loc, const char* str, TOperator op, + TIntermTyped* childNode) +{ + TIntermTyped* result = intermediate.addUnaryMath(op, childNode, loc); + + if (result) + return result; + else + unaryOpError(loc, str, childNode->getCompleteString()); + + return childNode; +} +// +// Return true if the name is a struct buffer method +// +bool HlslParseContext::isStructBufferMethod(const TString& name) const +{ + return + name == "GetDimensions" || + name == "Load" || + name == "Load2" || + name == "Load3" || + name == "Load4" || + name == "Store" || + name == "Store2" || + name == "Store3" || + name == "Store4" || + name == "InterlockedAdd" || + name == "InterlockedAnd" || + name == "InterlockedCompareExchange" || + name == "InterlockedCompareStore" || + name == "InterlockedExchange" || + name == "InterlockedMax" || + name == "InterlockedMin" || + name == "InterlockedOr" || + name == "InterlockedXor" || + name == "IncrementCounter" || + name == "DecrementCounter" || + name == "Append" || + name == "Consume"; +} + +// +// Handle seeing a base.field dereference in the grammar, where 'field' is a +// swizzle or member variable. +// +TIntermTyped* HlslParseContext::handleDotDereference(const TSourceLoc& loc, TIntermTyped* base, const TString& field) +{ + variableCheck(base); + + if (base->isArray()) { + error(loc, "cannot apply to an array:", ".", field.c_str()); + return base; + } + + TIntermTyped* result = base; + + if (base->getType().getBasicType() == EbtSampler) { + // Handle .mips[mipid][pos] operation on textures + const TSampler& sampler = base->getType().getSampler(); + if (sampler.isTexture() && field == "mips") { + // Push a null to signify that we expect a mip level under operator[] next. + mipsOperatorMipArg.push_back(tMipsOperatorData(loc, nullptr)); + // Keep 'result' pointing to 'base', since we expect an operator[] to go by next. + } else { + if (field == "mips") + error(loc, "unexpected texture type for .mips[][] operator:", + base->getType().getCompleteString().c_str(), ""); + else + error(loc, "unexpected operator on texture type:", field.c_str(), + base->getType().getCompleteString().c_str()); + } + } else if (base->isVector() || base->isScalar()) { + TSwizzleSelectors selectors; + parseSwizzleSelector(loc, field, base->getVectorSize(), selectors); + + if (base->isScalar()) { + if (selectors.size() == 1) + return result; + else { + TType type(base->getBasicType(), EvqTemporary, selectors.size()); + return addConstructor(loc, base, type); + } + } + // Use EOpIndexDirect (below) with vec1.x so that it remains l-value (Test/hlsl.swizzle.vec1.comp) + if (base->getVectorSize() == 1 && selectors.size() > 1) { + TType scalarType(base->getBasicType(), EvqTemporary, 1); + TType vectorType(base->getBasicType(), EvqTemporary, selectors.size()); + return addConstructor(loc, addConstructor(loc, base, scalarType), vectorType); + } + + if (base->getType().getQualifier().isFrontEndConstant()) + result = intermediate.foldSwizzle(base, selectors, loc); + else { + if (selectors.size() == 1) { + TIntermTyped* index = intermediate.addConstantUnion(selectors[0], loc); + result = intermediate.addIndex(EOpIndexDirect, base, index, loc); + result->setType(TType(base->getBasicType(), EvqTemporary)); + } else { + TIntermTyped* index = intermediate.addSwizzle(selectors, loc); + result = intermediate.addIndex(EOpVectorSwizzle, base, index, loc); + result->setType(TType(base->getBasicType(), EvqTemporary, base->getType().getQualifier().precision, + selectors.size())); + } + } + } else if (base->isMatrix()) { + TSwizzleSelectors selectors; + if (! parseMatrixSwizzleSelector(loc, field, base->getMatrixCols(), base->getMatrixRows(), selectors)) + return result; + + if (selectors.size() == 1) { + // Representable by m[c][r] + if (base->getType().getQualifier().isFrontEndConstant()) { + result = intermediate.foldDereference(base, selectors[0].coord1, loc); + result = intermediate.foldDereference(result, selectors[0].coord2, loc); + } else { + result = intermediate.addIndex(EOpIndexDirect, base, + intermediate.addConstantUnion(selectors[0].coord1, loc), + loc); + TType dereferencedCol(base->getType(), 0); + result->setType(dereferencedCol); + result = intermediate.addIndex(EOpIndexDirect, result, + intermediate.addConstantUnion(selectors[0].coord2, loc), + loc); + TType dereferenced(dereferencedCol, 0); + result->setType(dereferenced); + } + } else { + int column = getMatrixComponentsColumn(base->getMatrixRows(), selectors); + if (column >= 0) { + // Representable by m[c] + if (base->getType().getQualifier().isFrontEndConstant()) + result = intermediate.foldDereference(base, column, loc); + else { + result = intermediate.addIndex(EOpIndexDirect, base, intermediate.addConstantUnion(column, loc), + loc); + TType dereferenced(base->getType(), 0); + result->setType(dereferenced); + } + } else { + // general case, not a column, not a single component + TIntermTyped* index = intermediate.addSwizzle(selectors, loc); + result = intermediate.addIndex(EOpMatrixSwizzle, base, index, loc); + result->setType(TType(base->getBasicType(), EvqTemporary, base->getType().getQualifier().precision, + selectors.size())); + } + } + } else if (base->getBasicType() == EbtStruct || base->getBasicType() == EbtBlock) { + const TTypeList* fields = base->getType().getStruct(); + bool fieldFound = false; + int member; + for (member = 0; member < (int)fields->size(); ++member) { + if ((*fields)[member].type->getFieldName() == field) { + fieldFound = true; + break; + } + } + if (fieldFound) { + if (base->getAsSymbolNode() && wasFlattened(base)) { + result = flattenAccess(base, member); + } else { + if (base->getType().getQualifier().storage == EvqConst) + result = intermediate.foldDereference(base, member, loc); + else { + TIntermTyped* index = intermediate.addConstantUnion(member, loc); + result = intermediate.addIndex(EOpIndexDirectStruct, base, index, loc); + result->setType(*(*fields)[member].type); + } + } + } else + error(loc, "no such field in structure", field.c_str(), ""); + } else + error(loc, "does not apply to this type:", field.c_str(), base->getType().getCompleteString().c_str()); + + return result; +} + +// +// Return true if the field should be treated as a built-in method. +// Return false otherwise. +// +bool HlslParseContext::isBuiltInMethod(const TSourceLoc&, TIntermTyped* base, const TString& field) +{ + if (base == nullptr) + return false; + + variableCheck(base); + + if (base->getType().getBasicType() == EbtSampler) { + return true; + } else if (isStructBufferType(base->getType()) && isStructBufferMethod(field)) { + return true; + } else if (field == "Append" || + field == "RestartStrip") { + // We cannot check the type here: it may be sanitized if we're not compiling a geometry shader, but + // the code is around in the shader source. + return true; + } else + return false; +} + +// Independently establish a built-in that is a member of a structure. +// 'arraySizes' are what's desired for the independent built-in, whatever +// the higher-level source/expression of them was. +void HlslParseContext::splitBuiltIn(const TString& baseName, const TType& memberType, const TArraySizes* arraySizes, + const TQualifier& outerQualifier) +{ + // Because of arrays of structs, we might be asked more than once, + // but the arraySizes passed in should have captured the whole thing + // the first time. + // However, clip/cull rely on multiple updates. + if (!isClipOrCullDistance(memberType)) + if (splitBuiltIns.find(tInterstageIoData(memberType.getQualifier().builtIn, outerQualifier.storage)) != + splitBuiltIns.end()) + return; + + TVariable* ioVar = makeInternalVariable(baseName + "." + memberType.getFieldName(), memberType); + + if (arraySizes != nullptr && !memberType.isArray()) + ioVar->getWritableType().copyArraySizes(*arraySizes); + + splitBuiltIns[tInterstageIoData(memberType.getQualifier().builtIn, outerQualifier.storage)] = ioVar; + if (!isClipOrCullDistance(ioVar->getType())) + trackLinkage(*ioVar); + + // Merge qualifier from the user structure + mergeQualifiers(ioVar->getWritableType().getQualifier(), outerQualifier); + + // Fix the builtin type if needed (e.g, some types require fixed array sizes, no matter how the + // shader declared them). This is done after mergeQualifiers(), in case fixBuiltInIoType looks + // at the qualifier to determine e.g, in or out qualifications. + fixBuiltInIoType(ioVar->getWritableType()); + + // But, not location, we're losing that + ioVar->getWritableType().getQualifier().layoutLocation = TQualifier::layoutLocationEnd; +} + +// Split a type into +// 1. a struct of non-I/O members +// 2. a collection of independent I/O variables +void HlslParseContext::split(const TVariable& variable) +{ + // Create a new variable: + const TType& clonedType = *variable.getType().clone(); + const TType& splitType = split(clonedType, variable.getName(), clonedType.getQualifier()); + splitNonIoVars[variable.getUniqueId()] = makeInternalVariable(variable.getName(), splitType); +} + +// Recursive implementation of split(). +// Returns reference to the modified type. +const TType& HlslParseContext::split(const TType& type, const TString& name, const TQualifier& outerQualifier) +{ + if (type.isStruct()) { + TTypeList* userStructure = type.getWritableStruct(); + for (auto ioType = userStructure->begin(); ioType != userStructure->end(); ) { + if (ioType->type->isBuiltIn()) { + // move out the built-in + splitBuiltIn(name, *ioType->type, type.getArraySizes(), outerQualifier); + ioType = userStructure->erase(ioType); + } else { + split(*ioType->type, name + "." + ioType->type->getFieldName(), outerQualifier); + ++ioType; + } + } + } + + return type; +} + +// Is this an aggregate that should be flattened? +// Can be applied to intermediate levels of type in a hierarchy. +// Some things like flattening uniform arrays are only about the top level +// of the aggregate, triggered on 'topLevel'. +bool HlslParseContext::shouldFlatten(const TType& type, TStorageQualifier qualifier, bool topLevel) const +{ + switch (qualifier) { + case EvqVaryingIn: + case EvqVaryingOut: + return type.isStruct() || type.isArray(); + case EvqUniform: + return (type.isArray() && intermediate.getFlattenUniformArrays() && topLevel) || + (type.isStruct() && type.containsOpaque()); + default: + return false; + }; +} + +// Top level variable flattening: construct data +void HlslParseContext::flatten(const TVariable& variable, bool linkage, bool arrayed) +{ + const TType& type = variable.getType(); + + // If it's a standalone built-in, there is nothing to flatten + if (type.isBuiltIn() && !type.isStruct()) + return; + + + auto entry = flattenMap.insert(std::make_pair(variable.getUniqueId(), + TFlattenData(type.getQualifier().layoutBinding, + type.getQualifier().layoutLocation))); + + if (type.isStruct() && type.getStruct()->size()==0) + return; + // if flattening arrayed io struct, array each member of dereferenced type + if (arrayed) { + const TType dereferencedType(type, 0); + flatten(variable, dereferencedType, entry.first->second, variable.getName(), linkage, + type.getQualifier(), type.getArraySizes()); + } else { + flatten(variable, type, entry.first->second, variable.getName(), linkage, + type.getQualifier(), nullptr); + } +} + +// Recursively flatten the given variable at the provided type, building the flattenData as we go. +// +// This is mutually recursive with flattenStruct and flattenArray. +// We are going to flatten an arbitrarily nested composite structure into a linear sequence of +// members, and later on, we want to turn a path through the tree structure into a final +// location in this linear sequence. +// +// If the tree was N-ary, that can be directly calculated. However, we are dealing with +// arbitrary numbers - perhaps a struct of 7 members containing an array of 3. Thus, we must +// build a data structure to allow the sequence of bracket and dot operators on arrays and +// structs to arrive at the proper member. +// +// To avoid storing a tree with pointers, we are going to flatten the tree into a vector of integers. +// The leaves are the indexes into the flattened member array. +// Each level will have the next location for the Nth item stored sequentially, so for instance: +// +// struct { float2 a[2]; int b; float4 c[3] }; +// +// This will produce the following flattened tree: +// Pos: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 +// (3, 7, 8, 5, 6, 0, 1, 2, 11, 12, 13, 3, 4, 5} +// +// Given a reference to mystruct.c[1], the access chain is (2,1), so we traverse: +// (0+2) = 8 --> (8+1) = 12 --> 12 = 4 +// +// so the 4th flattened member in traversal order is ours. +// +int HlslParseContext::flatten(const TVariable& variable, const TType& type, + TFlattenData& flattenData, TString name, bool linkage, + const TQualifier& outerQualifier, + const TArraySizes* builtInArraySizes) +{ + // If something is an arrayed struct, the array flattener will recursively call flatten() + // to then flatten the struct, so this is an "if else": we don't do both. + if (type.isArray()) + return flattenArray(variable, type, flattenData, name, linkage, outerQualifier); + else if (type.isStruct()) + return flattenStruct(variable, type, flattenData, name, linkage, outerQualifier, builtInArraySizes); + else { + assert(0); // should never happen + return -1; + } +} + +// Add a single flattened member to the flattened data being tracked for the composite +// Returns true for the final flattening level. +int HlslParseContext::addFlattenedMember(const TVariable& variable, const TType& type, TFlattenData& flattenData, + const TString& memberName, bool linkage, + const TQualifier& outerQualifier, + const TArraySizes* builtInArraySizes) +{ + if (!shouldFlatten(type, outerQualifier.storage, false)) { + // This is as far as we flatten. Insert the variable. + TVariable* memberVariable = makeInternalVariable(memberName, type); + mergeQualifiers(memberVariable->getWritableType().getQualifier(), variable.getType().getQualifier()); + + if (flattenData.nextBinding != TQualifier::layoutBindingEnd) + memberVariable->getWritableType().getQualifier().layoutBinding = flattenData.nextBinding++; + + if (memberVariable->getType().isBuiltIn()) { + // inherited locations are nonsensical for built-ins (TODO: what if semantic had a number) + memberVariable->getWritableType().getQualifier().layoutLocation = TQualifier::layoutLocationEnd; + } else { + // inherited locations must be auto bumped, not replicated + if (flattenData.nextLocation != TQualifier::layoutLocationEnd) { + memberVariable->getWritableType().getQualifier().layoutLocation = flattenData.nextLocation; + flattenData.nextLocation += intermediate.computeTypeLocationSize(memberVariable->getType(), language); + nextOutLocation = std::max(nextOutLocation, flattenData.nextLocation); + } + } + + // Only propagate arraysizes here for arrayed io + if (variable.getType().getQualifier().isArrayedIo(language) && builtInArraySizes != nullptr) + memberVariable->getWritableType().copyArraySizes(*builtInArraySizes); + + flattenData.offsets.push_back(static_cast(flattenData.members.size())); + flattenData.members.push_back(memberVariable); + + if (linkage) + trackLinkage(*memberVariable); + + return static_cast(flattenData.offsets.size()) - 1; // location of the member reference + } else { + // Further recursion required + return flatten(variable, type, flattenData, memberName, linkage, outerQualifier, builtInArraySizes); + } +} + +// Figure out the mapping between an aggregate's top members and an +// equivalent set of individual variables. +// +// Assumes shouldFlatten() or equivalent was called first. +int HlslParseContext::flattenStruct(const TVariable& variable, const TType& type, + TFlattenData& flattenData, TString name, bool linkage, + const TQualifier& outerQualifier, + const TArraySizes* builtInArraySizes) +{ + assert(type.isStruct()); + + auto members = *type.getStruct(); + + // Reserve space for this tree level. + int start = static_cast(flattenData.offsets.size()); + int pos = start; + flattenData.offsets.resize(int(pos + members.size()), -1); + + for (int member = 0; member < (int)members.size(); ++member) { + TType& dereferencedType = *members[member].type; + if (dereferencedType.isBuiltIn()) + splitBuiltIn(variable.getName(), dereferencedType, builtInArraySizes, outerQualifier); + else { + const int mpos = addFlattenedMember(variable, dereferencedType, flattenData, + name + "." + dereferencedType.getFieldName(), + linkage, outerQualifier, + builtInArraySizes == nullptr && dereferencedType.isArray() + ? dereferencedType.getArraySizes() + : builtInArraySizes); + flattenData.offsets[pos++] = mpos; + } + } + + return start; +} + +// Figure out mapping between an array's members and an +// equivalent set of individual variables. +// +// Assumes shouldFlatten() or equivalent was called first. +int HlslParseContext::flattenArray(const TVariable& variable, const TType& type, + TFlattenData& flattenData, TString name, bool linkage, + const TQualifier& outerQualifier) +{ + assert(type.isSizedArray()); + + const int size = type.getOuterArraySize(); + const TType dereferencedType(type, 0); + + if (name.empty()) + name = variable.getName(); + + // Reserve space for this tree level. + int start = static_cast(flattenData.offsets.size()); + int pos = start; + flattenData.offsets.resize(int(pos + size), -1); + + for (int element=0; element < size; ++element) { + char elementNumBuf[20]; // sufficient for MAXINT + snprintf(elementNumBuf, sizeof(elementNumBuf)-1, "[%d]", element); + const int mpos = addFlattenedMember(variable, dereferencedType, flattenData, + name + elementNumBuf, linkage, outerQualifier, + type.getArraySizes()); + + flattenData.offsets[pos++] = mpos; + } + + return start; +} + +// Return true if we have flattened this node. +bool HlslParseContext::wasFlattened(const TIntermTyped* node) const +{ + return node != nullptr && node->getAsSymbolNode() != nullptr && + wasFlattened(node->getAsSymbolNode()->getId()); +} + +// Return true if we have split this structure +bool HlslParseContext::wasSplit(const TIntermTyped* node) const +{ + return node != nullptr && node->getAsSymbolNode() != nullptr && + wasSplit(node->getAsSymbolNode()->getId()); +} + +// Turn an access into an aggregate that was flattened to instead be +// an access to the individual variable the member was flattened to. +// Assumes wasFlattened() or equivalent was called first. +TIntermTyped* HlslParseContext::flattenAccess(TIntermTyped* base, int member) +{ + const TType dereferencedType(base->getType(), member); // dereferenced type + const TIntermSymbol& symbolNode = *base->getAsSymbolNode(); + TIntermTyped* flattened = flattenAccess(symbolNode.getId(), member, base->getQualifier().storage, + dereferencedType, symbolNode.getFlattenSubset()); + + return flattened ? flattened : base; +} +TIntermTyped* HlslParseContext::flattenAccess(long long uniqueId, int member, TStorageQualifier outerStorage, + const TType& dereferencedType, int subset) +{ + const auto flattenData = flattenMap.find(uniqueId); + + if (flattenData == flattenMap.end()) + return nullptr; + + // Calculate new cumulative offset from the packed tree + int newSubset = flattenData->second.offsets[subset >= 0 ? subset + member : member]; + + TIntermSymbol* subsetSymbol; + if (!shouldFlatten(dereferencedType, outerStorage, false)) { + // Finished flattening: create symbol for variable + member = flattenData->second.offsets[newSubset]; + const TVariable* memberVariable = flattenData->second.members[member]; + subsetSymbol = intermediate.addSymbol(*memberVariable); + subsetSymbol->setFlattenSubset(-1); + } else { + + // If this is not the final flattening, accumulate the position and return + // an object of the partially dereferenced type. + subsetSymbol = new TIntermSymbol(uniqueId, "flattenShadow", getLanguage(), dereferencedType); + subsetSymbol->setFlattenSubset(newSubset); + } + + return subsetSymbol; +} + +// For finding where the first leaf is in a subtree of a multi-level aggregate +// that is just getting a subset assigned. Follows the same logic as flattenAccess, +// but logically going down the "left-most" tree branch each step of the way. +// +// Returns the offset into the first leaf of the subset. +int HlslParseContext::findSubtreeOffset(const TIntermNode& node) const +{ + const TIntermSymbol* sym = node.getAsSymbolNode(); + if (sym == nullptr) + return 0; + if (!sym->isArray() && !sym->isStruct()) + return 0; + int subset = sym->getFlattenSubset(); + if (subset == -1) + return 0; + + // Getting this far means a partial aggregate is identified by the flatten subset. + // Find the first leaf of the subset. + + const auto flattenData = flattenMap.find(sym->getId()); + if (flattenData == flattenMap.end()) + return 0; + + return findSubtreeOffset(sym->getType(), subset, flattenData->second.offsets); + + do { + subset = flattenData->second.offsets[subset]; + } while (true); +} +// Recursively do the desent +int HlslParseContext::findSubtreeOffset(const TType& type, int subset, const TVector& offsets) const +{ + if (!type.isArray() && !type.isStruct()) + return offsets[subset]; + TType derefType(type, 0); + return findSubtreeOffset(derefType, offsets[subset], offsets); +} + +// Find and return the split IO TVariable for id, or nullptr if none. +TVariable* HlslParseContext::getSplitNonIoVar(long long id) const +{ + const auto splitNonIoVar = splitNonIoVars.find(id); + if (splitNonIoVar == splitNonIoVars.end()) + return nullptr; + + return splitNonIoVar->second; +} + +// Pass through to base class after remembering built-in mappings. +void HlslParseContext::trackLinkage(TSymbol& symbol) +{ + TBuiltInVariable biType = symbol.getType().getQualifier().builtIn; + + if (biType != EbvNone) + builtInTessLinkageSymbols[biType] = symbol.clone(); + + TParseContextBase::trackLinkage(symbol); +} + + +// Returns true if the built-in is a clip or cull distance variable. +bool HlslParseContext::isClipOrCullDistance(TBuiltInVariable builtIn) +{ + return builtIn == EbvClipDistance || builtIn == EbvCullDistance; +} + +// Some types require fixed array sizes in SPIR-V, but can be scalars or +// arrays of sizes SPIR-V doesn't allow. For example, tessellation factors. +// This creates the right size. A conversion is performed when the internal +// type is copied to or from the external type. This corrects the externally +// facing input or output type to abide downstream semantics. +void HlslParseContext::fixBuiltInIoType(TType& type) +{ + int requiredArraySize = 0; + int requiredVectorSize = 0; + + switch (type.getQualifier().builtIn) { + case EbvTessLevelOuter: requiredArraySize = 4; break; + case EbvTessLevelInner: requiredArraySize = 2; break; + + case EbvSampleMask: + { + // Promote scalar to array of size 1. Leave existing arrays alone. + if (!type.isArray()) + requiredArraySize = 1; + break; + } + + case EbvWorkGroupId: requiredVectorSize = 3; break; + case EbvGlobalInvocationId: requiredVectorSize = 3; break; + case EbvLocalInvocationId: requiredVectorSize = 3; break; + case EbvTessCoord: requiredVectorSize = 3; break; + + default: + if (isClipOrCullDistance(type)) { + const int loc = type.getQualifier().layoutLocation; + + if (type.getQualifier().builtIn == EbvClipDistance) { + if (type.getQualifier().storage == EvqVaryingIn) + clipSemanticNSizeIn[loc] = type.getVectorSize(); + else + clipSemanticNSizeOut[loc] = type.getVectorSize(); + } else { + if (type.getQualifier().storage == EvqVaryingIn) + cullSemanticNSizeIn[loc] = type.getVectorSize(); + else + cullSemanticNSizeOut[loc] = type.getVectorSize(); + } + } + + return; + } + + // Alter or set vector size as needed. + if (requiredVectorSize > 0) { + TType newType(type.getBasicType(), type.getQualifier().storage, requiredVectorSize); + newType.getQualifier() = type.getQualifier(); + + type.shallowCopy(newType); + } + + // Alter or set array size as needed. + if (requiredArraySize > 0) { + if (!type.isArray() || type.getOuterArraySize() != requiredArraySize) { + TArraySizes* arraySizes = new TArraySizes; + arraySizes->addInnerSize(requiredArraySize); + type.transferArraySizes(arraySizes); + } + } +} + +// Variables that correspond to the user-interface in and out of a stage +// (not the built-in interface) are +// - assigned locations +// - registered as a linkage node (part of the stage's external interface). +// Assumes it is called in the order in which locations should be assigned. +void HlslParseContext::assignToInterface(TVariable& variable) +{ + const auto assignLocation = [&](TVariable& variable) { + TType& type = variable.getWritableType(); + if (!type.isStruct() || type.getStruct()->size() > 0) { + TQualifier& qualifier = type.getQualifier(); + if (qualifier.storage == EvqVaryingIn || qualifier.storage == EvqVaryingOut) { + if (qualifier.builtIn == EbvNone && !qualifier.hasLocation()) { + // Strip off the outer array dimension for those having an extra one. + int size; + if (type.isArray() && qualifier.isArrayedIo(language)) { + TType elementType(type, 0); + size = intermediate.computeTypeLocationSize(elementType, language); + } else + size = intermediate.computeTypeLocationSize(type, language); + + if (qualifier.storage == EvqVaryingIn) { + variable.getWritableType().getQualifier().layoutLocation = nextInLocation; + nextInLocation += size; + } else { + variable.getWritableType().getQualifier().layoutLocation = nextOutLocation; + nextOutLocation += size; + } + } + trackLinkage(variable); + } + } + }; + + if (wasFlattened(variable.getUniqueId())) { + auto& memberList = flattenMap[variable.getUniqueId()].members; + for (auto member = memberList.begin(); member != memberList.end(); ++member) + assignLocation(**member); + } else if (wasSplit(variable.getUniqueId())) { + TVariable* splitIoVar = getSplitNonIoVar(variable.getUniqueId()); + assignLocation(*splitIoVar); + } else { + assignLocation(variable); + } +} + +// +// Handle seeing a function declarator in the grammar. This is the precursor +// to recognizing a function prototype or function definition. +// +void HlslParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFunction& function, bool prototype) +{ + // + // Multiple declarations of the same function name are allowed. + // + // If this is a definition, the definition production code will check for redefinitions + // (we don't know at this point if it's a definition or not). + // + bool builtIn; + TSymbol* symbol = symbolTable.find(function.getMangledName(), &builtIn); + const TFunction* prevDec = symbol ? symbol->getAsFunction() : nullptr; + + if (prototype) { + // All built-in functions are defined, even though they don't have a body. + // Count their prototype as a definition instead. + if (symbolTable.atBuiltInLevel()) + function.setDefined(); + else { + if (prevDec && ! builtIn) + symbol->getAsFunction()->setPrototyped(); // need a writable one, but like having prevDec as a const + function.setPrototyped(); + } + } + + // This insert won't actually insert it if it's a duplicate signature, but it will still check for + // other forms of name collisions. + if (! symbolTable.insert(function)) + error(loc, "function name is redeclaration of existing name", function.getName().c_str(), ""); +} + +// For struct buffers with counters, we must pass the counter buffer as hidden parameter. +// This adds the hidden parameter to the parameter list in 'paramNodes' if needed. +// Otherwise, it's a no-op +void HlslParseContext::addStructBufferHiddenCounterParam(const TSourceLoc& loc, TParameter& param, + TIntermAggregate*& paramNodes) +{ + if (! hasStructBuffCounter(*param.type)) + return; + + const TString counterBlockName(intermediate.addCounterBufferName(*param.name)); + + TType counterType; + counterBufferType(loc, counterType); + TVariable *variable = makeInternalVariable(counterBlockName, counterType); + + if (! symbolTable.insert(*variable)) + error(loc, "redefinition", variable->getName().c_str(), ""); + + paramNodes = intermediate.growAggregate(paramNodes, + intermediate.addSymbol(*variable, loc), + loc); +} + +// +// Handle seeing the function prototype in front of a function definition in the grammar. +// The body is handled after this function returns. +// +// Returns an aggregate of parameter-symbol nodes. +// +TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& loc, TFunction& function, + const TAttributes& attributes, + TIntermNode*& entryPointTree) +{ + currentCaller = function.getMangledName(); + TSymbol* symbol = symbolTable.find(function.getMangledName()); + TFunction* prevDec = symbol ? symbol->getAsFunction() : nullptr; + + if (prevDec == nullptr) + error(loc, "can't find function", function.getName().c_str(), ""); + // Note: 'prevDec' could be 'function' if this is the first time we've seen function + // as it would have just been put in the symbol table. Otherwise, we're looking up + // an earlier occurrence. + + if (prevDec && prevDec->isDefined()) { + // Then this function already has a body. + error(loc, "function already has a body", function.getName().c_str(), ""); + } + if (prevDec && ! prevDec->isDefined()) { + prevDec->setDefined(); + + // Remember the return type for later checking for RETURN statements. + currentFunctionType = &(prevDec->getType()); + } else + currentFunctionType = new TType(EbtVoid); + functionReturnsValue = false; + + // Entry points need different I/O and other handling, transform it so the + // rest of this function doesn't care. + entryPointTree = transformEntryPoint(loc, function, attributes); + + // + // New symbol table scope for body of function plus its arguments + // + pushScope(); + + // + // Insert parameters into the symbol table. + // If the parameter has no name, it's not an error, just don't insert it + // (could be used for unused args). + // + // Also, accumulate the list of parameters into the AST, so lower level code + // knows where to find parameters. + // + TIntermAggregate* paramNodes = new TIntermAggregate; + for (int i = 0; i < function.getParamCount(); i++) { + TParameter& param = function[i]; + if (param.name != nullptr) { + TVariable *variable = new TVariable(param.name, *param.type); + + if (i == 0 && function.hasImplicitThis()) { + // Anonymous 'this' members are already in a symbol-table level, + // and we need to know what function parameter to map them to. + symbolTable.makeInternalVariable(*variable); + pushImplicitThis(variable); + } + + // Insert the parameters with name in the symbol table. + if (! symbolTable.insert(*variable)) + error(loc, "redefinition", variable->getName().c_str(), ""); + + // Add parameters to the AST list. + if (shouldFlatten(variable->getType(), variable->getType().getQualifier().storage, true)) { + // Expand the AST parameter nodes (but not the name mangling or symbol table view) + // for structures that need to be flattened. + flatten(*variable, false); + const TTypeList* structure = variable->getType().getStruct(); + for (int mem = 0; mem < (int)structure->size(); ++mem) { + paramNodes = intermediate.growAggregate(paramNodes, + flattenAccess(variable->getUniqueId(), mem, + variable->getType().getQualifier().storage, + *(*structure)[mem].type), + loc); + } + } else { + // Add the parameter to the AST + paramNodes = intermediate.growAggregate(paramNodes, + intermediate.addSymbol(*variable, loc), + loc); + } + + // Add hidden AST parameter for struct buffer counters, if needed. + addStructBufferHiddenCounterParam(loc, param, paramNodes); + } else + paramNodes = intermediate.growAggregate(paramNodes, intermediate.addSymbol(*param.type, loc), loc); + } + if (function.hasIllegalImplicitThis()) + pushImplicitThis(nullptr); + + intermediate.setAggregateOperator(paramNodes, EOpParameters, TType(EbtVoid), loc); + loopNestingLevel = 0; + controlFlowNestingLevel = 0; + postEntryPointReturn = false; + + return paramNodes; +} + +// Handle all [attrib] attribute for the shader entry point +void HlslParseContext::handleEntryPointAttributes(const TSourceLoc& loc, const TAttributes& attributes) +{ + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + switch (it->name) { + case EatNumThreads: + { + const TIntermSequence& sequence = it->args->getSequence(); + for (int lid = 0; lid < int(sequence.size()); ++lid) + intermediate.setLocalSize(lid, sequence[lid]->getAsConstantUnion()->getConstArray()[0].getIConst()); + break; + } + case EatInstance: + { + int invocations; + + if (!it->getInt(invocations)) { + error(loc, "invalid instance", "", ""); + } else { + if (!intermediate.setInvocations(invocations)) + error(loc, "cannot change previously set instance attribute", "", ""); + } + break; + } + case EatMaxVertexCount: + { + int maxVertexCount; + + if (! it->getInt(maxVertexCount)) { + error(loc, "invalid maxvertexcount", "", ""); + } else { + if (! intermediate.setVertices(maxVertexCount)) + error(loc, "cannot change previously set maxvertexcount attribute", "", ""); + } + break; + } + case EatPatchConstantFunc: + { + TString pcfName; + if (! it->getString(pcfName, 0, false)) { + error(loc, "invalid patch constant function", "", ""); + } else { + patchConstantFunctionName = pcfName; + } + break; + } + case EatDomain: + { + // Handle [domain("...")] + TString domainStr; + if (! it->getString(domainStr)) { + error(loc, "invalid domain", "", ""); + } else { + TLayoutGeometry domain = ElgNone; + + if (domainStr == "tri") { + domain = ElgTriangles; + } else if (domainStr == "quad") { + domain = ElgQuads; + } else if (domainStr == "isoline") { + domain = ElgIsolines; + } else { + error(loc, "unsupported domain type", domainStr.c_str(), ""); + } + + if (language == EShLangTessEvaluation) { + if (! intermediate.setInputPrimitive(domain)) + error(loc, "cannot change previously set domain", TQualifier::getGeometryString(domain), ""); + } else { + if (! intermediate.setOutputPrimitive(domain)) + error(loc, "cannot change previously set domain", TQualifier::getGeometryString(domain), ""); + } + } + break; + } + case EatOutputTopology: + { + // Handle [outputtopology("...")] + TString topologyStr; + if (! it->getString(topologyStr)) { + error(loc, "invalid outputtopology", "", ""); + } else { + TVertexOrder vertexOrder = EvoNone; + TLayoutGeometry primitive = ElgNone; + + if (topologyStr == "point") { + intermediate.setPointMode(); + } else if (topologyStr == "line") { + primitive = ElgIsolines; + } else if (topologyStr == "triangle_cw") { + vertexOrder = EvoCw; + primitive = ElgTriangles; + } else if (topologyStr == "triangle_ccw") { + vertexOrder = EvoCcw; + primitive = ElgTriangles; + } else { + error(loc, "unsupported outputtopology type", topologyStr.c_str(), ""); + } + + if (vertexOrder != EvoNone) { + if (! intermediate.setVertexOrder(vertexOrder)) { + error(loc, "cannot change previously set outputtopology", + TQualifier::getVertexOrderString(vertexOrder), ""); + } + } + if (primitive != ElgNone) + intermediate.setOutputPrimitive(primitive); + } + break; + } + case EatPartitioning: + { + // Handle [partitioning("...")] + TString partitionStr; + if (! it->getString(partitionStr)) { + error(loc, "invalid partitioning", "", ""); + } else { + TVertexSpacing partitioning = EvsNone; + + if (partitionStr == "integer") { + partitioning = EvsEqual; + } else if (partitionStr == "fractional_even") { + partitioning = EvsFractionalEven; + } else if (partitionStr == "fractional_odd") { + partitioning = EvsFractionalOdd; + //} else if (partition == "pow2") { // TODO: currently nothing to map this to. + } else { + error(loc, "unsupported partitioning type", partitionStr.c_str(), ""); + } + + if (! intermediate.setVertexSpacing(partitioning)) + error(loc, "cannot change previously set partitioning", + TQualifier::getVertexSpacingString(partitioning), ""); + } + break; + } + case EatOutputControlPoints: + { + // Handle [outputcontrolpoints("...")] + int ctrlPoints; + if (! it->getInt(ctrlPoints)) { + error(loc, "invalid outputcontrolpoints", "", ""); + } else { + if (! intermediate.setVertices(ctrlPoints)) { + error(loc, "cannot change previously set outputcontrolpoints attribute", "", ""); + } + } + break; + } + case EatEarlyDepthStencil: + intermediate.setEarlyFragmentTests(); + break; + case EatBuiltIn: + case EatLocation: + // tolerate these because of dual use of entrypoint and type attributes + break; + default: + warn(loc, "attribute does not apply to entry point", "", ""); + break; + } + } +} + +// Update the given type with any type-like attribute information in the +// attributes. +void HlslParseContext::transferTypeAttributes(const TSourceLoc& loc, const TAttributes& attributes, TType& type, + bool allowEntry) +{ + if (attributes.size() == 0) + return; + + int value; + TString builtInString; + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + switch (it->name) { + case EatLocation: + // location + if (it->getInt(value)) + type.getQualifier().layoutLocation = value; + else + error(loc, "needs a literal integer", "location", ""); + break; + case EatBinding: + // binding + if (it->getInt(value)) { + type.getQualifier().layoutBinding = value; + type.getQualifier().layoutSet = 0; + } else + error(loc, "needs a literal integer", "binding", ""); + // set + if (it->getInt(value, 1)) + type.getQualifier().layoutSet = value; + break; + case EatGlobalBinding: + // global cbuffer binding + if (it->getInt(value)) + globalUniformBinding = value; + else + error(loc, "needs a literal integer", "global binding", ""); + // global cbuffer set + if (it->getInt(value, 1)) + globalUniformSet = value; + break; + case EatInputAttachment: + // input attachment + if (it->getInt(value)) + type.getQualifier().layoutAttachment = value; + else + error(loc, "needs a literal integer", "input attachment", ""); + break; + case EatBuiltIn: + // PointSize built-in + if (it->getString(builtInString, 0, false)) { + if (builtInString == "PointSize") + type.getQualifier().builtIn = EbvPointSize; + } + break; + case EatPushConstant: + // push_constant + type.getQualifier().layoutPushConstant = true; + break; + case EatConstantId: + // specialization constant + if (type.getQualifier().storage != EvqConst) { + error(loc, "needs a const type", "constant_id", ""); + break; + } + if (it->getInt(value)) { + TSourceLoc loc; + loc.init(); + setSpecConstantId(loc, type.getQualifier(), value); + } + break; + + // image formats + case EatFormatRgba32f: type.getQualifier().layoutFormat = ElfRgba32f; break; + case EatFormatRgba16f: type.getQualifier().layoutFormat = ElfRgba16f; break; + case EatFormatR32f: type.getQualifier().layoutFormat = ElfR32f; break; + case EatFormatRgba8: type.getQualifier().layoutFormat = ElfRgba8; break; + case EatFormatRgba8Snorm: type.getQualifier().layoutFormat = ElfRgba8Snorm; break; + case EatFormatRg32f: type.getQualifier().layoutFormat = ElfRg32f; break; + case EatFormatRg16f: type.getQualifier().layoutFormat = ElfRg16f; break; + case EatFormatR11fG11fB10f: type.getQualifier().layoutFormat = ElfR11fG11fB10f; break; + case EatFormatR16f: type.getQualifier().layoutFormat = ElfR16f; break; + case EatFormatRgba16: type.getQualifier().layoutFormat = ElfRgba16; break; + case EatFormatRgb10A2: type.getQualifier().layoutFormat = ElfRgb10A2; break; + case EatFormatRg16: type.getQualifier().layoutFormat = ElfRg16; break; + case EatFormatRg8: type.getQualifier().layoutFormat = ElfRg8; break; + case EatFormatR16: type.getQualifier().layoutFormat = ElfR16; break; + case EatFormatR8: type.getQualifier().layoutFormat = ElfR8; break; + case EatFormatRgba16Snorm: type.getQualifier().layoutFormat = ElfRgba16Snorm; break; + case EatFormatRg16Snorm: type.getQualifier().layoutFormat = ElfRg16Snorm; break; + case EatFormatRg8Snorm: type.getQualifier().layoutFormat = ElfRg8Snorm; break; + case EatFormatR16Snorm: type.getQualifier().layoutFormat = ElfR16Snorm; break; + case EatFormatR8Snorm: type.getQualifier().layoutFormat = ElfR8Snorm; break; + case EatFormatRgba32i: type.getQualifier().layoutFormat = ElfRgba32i; break; + case EatFormatRgba16i: type.getQualifier().layoutFormat = ElfRgba16i; break; + case EatFormatRgba8i: type.getQualifier().layoutFormat = ElfRgba8i; break; + case EatFormatR32i: type.getQualifier().layoutFormat = ElfR32i; break; + case EatFormatRg32i: type.getQualifier().layoutFormat = ElfRg32i; break; + case EatFormatRg16i: type.getQualifier().layoutFormat = ElfRg16i; break; + case EatFormatRg8i: type.getQualifier().layoutFormat = ElfRg8i; break; + case EatFormatR16i: type.getQualifier().layoutFormat = ElfR16i; break; + case EatFormatR8i: type.getQualifier().layoutFormat = ElfR8i; break; + case EatFormatRgba32ui: type.getQualifier().layoutFormat = ElfRgba32ui; break; + case EatFormatRgba16ui: type.getQualifier().layoutFormat = ElfRgba16ui; break; + case EatFormatRgba8ui: type.getQualifier().layoutFormat = ElfRgba8ui; break; + case EatFormatR32ui: type.getQualifier().layoutFormat = ElfR32ui; break; + case EatFormatRgb10a2ui: type.getQualifier().layoutFormat = ElfRgb10a2ui; break; + case EatFormatRg32ui: type.getQualifier().layoutFormat = ElfRg32ui; break; + case EatFormatRg16ui: type.getQualifier().layoutFormat = ElfRg16ui; break; + case EatFormatRg8ui: type.getQualifier().layoutFormat = ElfRg8ui; break; + case EatFormatR16ui: type.getQualifier().layoutFormat = ElfR16ui; break; + case EatFormatR8ui: type.getQualifier().layoutFormat = ElfR8ui; break; + case EatFormatUnknown: type.getQualifier().layoutFormat = ElfNone; break; + + case EatNonWritable: type.getQualifier().readonly = true; break; + case EatNonReadable: type.getQualifier().writeonly = true; break; + + default: + if (! allowEntry) + warn(loc, "attribute does not apply to a type", "", ""); + break; + } + } +} + +// +// Do all special handling for the entry point, including wrapping +// the shader's entry point with the official entry point that will call it. +// +// The following: +// +// retType shaderEntryPoint(args...) // shader declared entry point +// { body } +// +// Becomes +// +// out retType ret; +// in iargs...; +// out oargs ...; +// +// void shaderEntryPoint() // synthesized, but official, entry point +// { +// args = iargs...; +// ret = @shaderEntryPoint(args...); +// oargs = args...; +// } +// retType @shaderEntryPoint(args...) +// { body } +// +// The symbol table will still map the original entry point name to the +// the modified function and its new name: +// +// symbol table: shaderEntryPoint -> @shaderEntryPoint +// +// Returns nullptr if no entry-point tree was built, otherwise, returns +// a subtree that creates the entry point. +// +TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunction& userFunction, + const TAttributes& attributes) +{ + // Return true if this is a tessellation patch constant function input to a domain shader. + const auto isDsPcfInput = [this](const TType& type) { + return language == EShLangTessEvaluation && + type.contains([](const TType* t) { + return t->getQualifier().builtIn == EbvTessLevelOuter || + t->getQualifier().builtIn == EbvTessLevelInner; + }); + }; + + // if we aren't in the entry point, fix the IO as such and exit + if (! isEntrypointName(userFunction.getName())) { + remapNonEntryPointIO(userFunction); + return nullptr; + } + + entryPointFunction = &userFunction; // needed in finish() + + // Handle entry point attributes + handleEntryPointAttributes(loc, attributes); + + // entry point logic... + + // Move parameters and return value to shader in/out + TVariable* entryPointOutput; // gets created in remapEntryPointIO + TVector inputs; + TVector outputs; + remapEntryPointIO(userFunction, entryPointOutput, inputs, outputs); + + // Further this return/in/out transform by flattening, splitting, and assigning locations + const auto makeVariableInOut = [&](TVariable& variable) { + if (variable.getType().isStruct()) { + bool arrayed = variable.getType().getQualifier().isArrayedIo(language); + flatten(variable, false /* don't track linkage here, it will be tracked in assignToInterface() */, arrayed); + } + // TODO: flatten arrays too + // TODO: flatten everything in I/O + // TODO: replace all split with flatten, make all paths can create flattened I/O, then split code can be removed + + // For clip and cull distance, multiple output variables potentially get merged + // into one in assignClipCullDistance. That code in assignClipCullDistance + // handles the interface logic, so we avoid it here in that case. + if (!isClipOrCullDistance(variable.getType())) + assignToInterface(variable); + }; + if (entryPointOutput != nullptr) + makeVariableInOut(*entryPointOutput); + for (auto it = inputs.begin(); it != inputs.end(); ++it) + if (!isDsPcfInput((*it)->getType())) // wait until the end for PCF input (see comment below) + makeVariableInOut(*(*it)); + for (auto it = outputs.begin(); it != outputs.end(); ++it) + makeVariableInOut(*(*it)); + + // In the domain shader, PCF input must be at the end of the linkage. That's because in the + // hull shader there is no ordering: the output comes from the separate PCF, which does not + // participate in the argument list. That is always put at the end of the HS linkage, so the + // input side of the DS must match. The argument may be in any position in the DS argument list + // however, so this ensures the linkage is built in the correct order regardless of argument order. + if (language == EShLangTessEvaluation) { + for (auto it = inputs.begin(); it != inputs.end(); ++it) + if (isDsPcfInput((*it)->getType())) + makeVariableInOut(*(*it)); + } + + // Add uniform parameters to the $Global uniform block. + TVector opaque_uniforms; + for (int i = 0; i < userFunction.getParamCount(); i++) { + TType& paramType = *userFunction[i].type; + TString& paramName = *userFunction[i].name; + if (paramType.getQualifier().storage == EvqUniform) { + if (!paramType.containsOpaque()) { + // Add it to the global uniform block. + growGlobalUniformBlock(loc, paramType, paramName); + } else { + // Declare it as a separate variable. + TVariable *var = makeInternalVariable(paramName.c_str(), paramType); + opaque_uniforms.push_back(var); + } + } + } + + // Synthesize the call + + pushScope(); // matches the one in handleFunctionBody() + + // new signature + TType voidType(EbtVoid); + TFunction synthEntryPoint(&userFunction.getName(), voidType); + TIntermAggregate* synthParams = new TIntermAggregate(); + intermediate.setAggregateOperator(synthParams, EOpParameters, voidType, loc); + intermediate.setEntryPointMangledName(synthEntryPoint.getMangledName().c_str()); + intermediate.incrementEntryPointCount(); + TFunction callee(&userFunction.getName(), voidType); // call based on old name, which is still in the symbol table + + // change original name + userFunction.addPrefix("@"); // change the name in the function, but not in the symbol table + + // Copy inputs (shader-in -> calling arg), while building up the call node + TVector argVars; + TIntermAggregate* synthBody = new TIntermAggregate(); + auto inputIt = inputs.begin(); + auto opaqueUniformIt = opaque_uniforms.begin(); + TIntermTyped* callingArgs = nullptr; + + for (int i = 0; i < userFunction.getParamCount(); i++) { + TParameter& param = userFunction[i]; + argVars.push_back(makeInternalVariable(*param.name, *param.type)); + argVars.back()->getWritableType().getQualifier().makeTemporary(); + + // Track the input patch, which is the only non-builtin supported by hull shader PCF. + if (param.getDeclaredBuiltIn() == EbvInputPatch) + inputPatch = argVars.back(); + + TIntermSymbol* arg = intermediate.addSymbol(*argVars.back()); + handleFunctionArgument(&callee, callingArgs, arg); + if (param.type->getQualifier().isParamInput()) { + TIntermTyped* input = intermediate.addSymbol(**inputIt); + if (input->getType().getQualifier().builtIn == EbvFragCoord && intermediate.getDxPositionW()) { + // Replace FragCoord W with reciprocal + auto pos_xyz = handleDotDereference(loc, input, "xyz"); + auto pos_w = handleDotDereference(loc, input, "w"); + auto one = intermediate.addConstantUnion(1.0, EbtFloat, loc); + auto recip_w = intermediate.addBinaryMath(EOpDiv, one, pos_w, loc); + TIntermAggregate* dst = new TIntermAggregate(EOpConstructVec4); + dst->getSequence().push_back(pos_xyz); + dst->getSequence().push_back(recip_w); + dst->setType(TType(EbtFloat, EvqTemporary, 4)); + dst->setLoc(loc); + input = dst; + } + intermediate.growAggregate(synthBody, handleAssign(loc, EOpAssign, arg, input)); + inputIt++; + } + if (param.type->getQualifier().storage == EvqUniform) { + if (!param.type->containsOpaque()) { + // Look it up in the $Global uniform block. + intermediate.growAggregate(synthBody, handleAssign(loc, EOpAssign, arg, + handleVariable(loc, param.name))); + } else { + intermediate.growAggregate(synthBody, handleAssign(loc, EOpAssign, arg, + intermediate.addSymbol(**opaqueUniformIt))); + ++opaqueUniformIt; + } + } + } + + // Call + currentCaller = synthEntryPoint.getMangledName(); + TIntermTyped* callReturn = handleFunctionCall(loc, &callee, callingArgs); + currentCaller = userFunction.getMangledName(); + + // Return value + if (entryPointOutput) { + TIntermTyped* returnAssign; + + // For hull shaders, the wrapped entry point return value is written to + // an array element as indexed by invocation ID, which we might have to make up. + // This is required to match SPIR-V semantics. + if (language == EShLangTessControl) { + TIntermSymbol* invocationIdSym = findTessLinkageSymbol(EbvInvocationId); + + // If there is no user declared invocation ID, we must make one. + if (invocationIdSym == nullptr) { + TType invocationIdType(EbtUint, EvqIn, 1); + TString* invocationIdName = NewPoolTString("InvocationId"); + invocationIdType.getQualifier().builtIn = EbvInvocationId; + + TVariable* variable = makeInternalVariable(*invocationIdName, invocationIdType); + + globalQualifierFix(loc, variable->getWritableType().getQualifier()); + trackLinkage(*variable); + + invocationIdSym = intermediate.addSymbol(*variable); + } + + TIntermTyped* element = intermediate.addIndex(EOpIndexIndirect, intermediate.addSymbol(*entryPointOutput), + invocationIdSym, loc); + + // Set the type of the array element being dereferenced + const TType derefElementType(entryPointOutput->getType(), 0); + element->setType(derefElementType); + + returnAssign = handleAssign(loc, EOpAssign, element, callReturn); + } else { + returnAssign = handleAssign(loc, EOpAssign, intermediate.addSymbol(*entryPointOutput), callReturn); + } + intermediate.growAggregate(synthBody, returnAssign); + } else + intermediate.growAggregate(synthBody, callReturn); + + // Output copies + auto outputIt = outputs.begin(); + for (int i = 0; i < userFunction.getParamCount(); i++) { + TParameter& param = userFunction[i]; + + // GS outputs are via emit, so we do not copy them here. + if (param.type->getQualifier().isParamOutput()) { + if (param.getDeclaredBuiltIn() == EbvGsOutputStream) { + // GS output stream does not assign outputs here: it's the Append() method + // which writes to the output, probably multiple times separated by Emit. + // We merely remember the output to use, here. + gsStreamOutput = *outputIt; + } else { + intermediate.growAggregate(synthBody, handleAssign(loc, EOpAssign, + intermediate.addSymbol(**outputIt), + intermediate.addSymbol(*argVars[i]))); + } + + outputIt++; + } + } + + // Put the pieces together to form a full function subtree + // for the synthesized entry point. + synthBody->setOperator(EOpSequence); + TIntermNode* synthFunctionDef = synthParams; + handleFunctionBody(loc, synthEntryPoint, synthBody, synthFunctionDef); + + entryPointFunctionBody = synthBody; + + return synthFunctionDef; +} + +void HlslParseContext::handleFunctionBody(const TSourceLoc& loc, TFunction& function, TIntermNode* functionBody, + TIntermNode*& node) +{ + node = intermediate.growAggregate(node, functionBody); + intermediate.setAggregateOperator(node, EOpFunction, function.getType(), loc); + node->getAsAggregate()->setName(function.getMangledName().c_str()); + + popScope(); + if (function.hasImplicitThis()) + popImplicitThis(); + + if (function.getType().getBasicType() != EbtVoid && ! functionReturnsValue) + error(loc, "function does not return a value:", "", function.getName().c_str()); +} + +// AST I/O is done through shader globals declared in the 'in' or 'out' +// storage class. An HLSL entry point has a return value, input parameters +// and output parameters. These need to get remapped to the AST I/O. +void HlslParseContext::remapEntryPointIO(TFunction& function, TVariable*& returnValue, + TVector& inputs, TVector& outputs) +{ + // We might have in input structure type with no decorations that caused it + // to look like an input type, yet it has (e.g.) interpolation types that + // must be modified that turn it into an input type. + // Hence, a missing ioTypeMap for 'input' might need to be synthesized. + const auto synthesizeEditedInput = [this](TType& type) { + // True if a type needs to be 'flat' + const auto needsFlat = [](const TType& type) { + return type.containsBasicType(EbtInt) || + type.containsBasicType(EbtUint) || + type.containsBasicType(EbtInt64) || + type.containsBasicType(EbtUint64) || + type.containsBasicType(EbtBool) || + type.containsBasicType(EbtDouble); + }; + + if (language == EShLangFragment && needsFlat(type)) { + if (type.isStruct()) { + TTypeList* finalList = nullptr; + auto it = ioTypeMap.find(type.getStruct()); + if (it == ioTypeMap.end() || it->second.input == nullptr) { + // Getting here means we have no input struct, but we need one. + auto list = new TTypeList; + for (auto member = type.getStruct()->begin(); member != type.getStruct()->end(); ++member) { + TType* newType = new TType; + newType->shallowCopy(*member->type); + TTypeLoc typeLoc = { newType, member->loc }; + list->push_back(typeLoc); + } + // install the new input type + if (it == ioTypeMap.end()) { + tIoKinds newLists = { list, nullptr, nullptr }; + ioTypeMap[type.getStruct()] = newLists; + } else + it->second.input = list; + finalList = list; + } else + finalList = it->second.input; + // edit for 'flat' + for (auto member = finalList->begin(); member != finalList->end(); ++member) { + if (needsFlat(*member->type)) { + member->type->getQualifier().clearInterpolation(); + member->type->getQualifier().flat = true; + } + } + } else { + type.getQualifier().clearInterpolation(); + type.getQualifier().flat = true; + } + } + }; + + // Do the actual work to make a type be a shader input or output variable, + // and clear the original to be non-IO (for use as a normal function parameter/return). + const auto makeIoVariable = [this](const char* name, TType& type, TStorageQualifier storage) -> TVariable* { + TVariable* ioVariable = makeInternalVariable(name, type); + clearUniformInputOutput(type.getQualifier()); + if (type.isStruct()) { + auto newLists = ioTypeMap.find(ioVariable->getType().getStruct()); + if (newLists != ioTypeMap.end()) { + if (storage == EvqVaryingIn && newLists->second.input) + ioVariable->getWritableType().setStruct(newLists->second.input); + else if (storage == EvqVaryingOut && newLists->second.output) + ioVariable->getWritableType().setStruct(newLists->second.output); + } + } + if (storage == EvqVaryingIn) { + correctInput(ioVariable->getWritableType().getQualifier()); + if (language == EShLangTessEvaluation) + if (!ioVariable->getType().isArray()) + ioVariable->getWritableType().getQualifier().patch = true; + } else { + correctOutput(ioVariable->getWritableType().getQualifier()); + } + ioVariable->getWritableType().getQualifier().storage = storage; + + fixBuiltInIoType(ioVariable->getWritableType()); + + return ioVariable; + }; + + // return value is actually a shader-scoped output (out) + if (function.getType().getBasicType() == EbtVoid) { + returnValue = nullptr; + } else { + if (language == EShLangTessControl) { + // tessellation evaluation in HLSL writes a per-ctrl-pt value, but it needs to be an + // array in SPIR-V semantics. We'll write to it indexed by invocation ID. + + returnValue = makeIoVariable("@entryPointOutput", function.getWritableType(), EvqVaryingOut); + + TType outputType; + outputType.shallowCopy(function.getType()); + + // vertices has necessarily already been set when handling entry point attributes. + TArraySizes* arraySizes = new TArraySizes; + arraySizes->addInnerSize(intermediate.getVertices()); + outputType.transferArraySizes(arraySizes); + + clearUniformInputOutput(function.getWritableType().getQualifier()); + returnValue = makeIoVariable("@entryPointOutput", outputType, EvqVaryingOut); + } else { + returnValue = makeIoVariable("@entryPointOutput", function.getWritableType(), EvqVaryingOut); + } + } + + // parameters are actually shader-scoped inputs and outputs (in or out) + for (int i = 0; i < function.getParamCount(); i++) { + TType& paramType = *function[i].type; + if (paramType.getQualifier().isParamInput()) { + synthesizeEditedInput(paramType); + TVariable* argAsGlobal = makeIoVariable(function[i].name->c_str(), paramType, EvqVaryingIn); + inputs.push_back(argAsGlobal); + } + if (paramType.getQualifier().isParamOutput()) { + TVariable* argAsGlobal = makeIoVariable(function[i].name->c_str(), paramType, EvqVaryingOut); + outputs.push_back(argAsGlobal); + } + } +} + +// An HLSL function that looks like an entry point, but is not, +// declares entry point IO built-ins, but these have to be undone. +void HlslParseContext::remapNonEntryPointIO(TFunction& function) +{ + // return value + if (function.getType().getBasicType() != EbtVoid) + clearUniformInputOutput(function.getWritableType().getQualifier()); + + // parameters. + // References to structuredbuffer types are left unmodified + for (int i = 0; i < function.getParamCount(); i++) + if (!isReference(*function[i].type)) + clearUniformInputOutput(function[i].type->getQualifier()); +} + +TIntermNode* HlslParseContext::handleDeclare(const TSourceLoc& loc, TIntermTyped* var) +{ + return intermediate.addUnaryNode(EOpDeclare, var, loc, TType(EbtVoid)); +} + +// Handle function returns, including type conversions to the function return type +// if necessary. +TIntermNode* HlslParseContext::handleReturnValue(const TSourceLoc& loc, TIntermTyped* value) +{ + functionReturnsValue = true; + + if (currentFunctionType->getBasicType() == EbtVoid) { + error(loc, "void function cannot return a value", "return", ""); + return intermediate.addBranch(EOpReturn, loc); + } else if (*currentFunctionType != value->getType()) { + value = intermediate.addConversion(EOpReturn, *currentFunctionType, value); + if (value && *currentFunctionType != value->getType()) + value = intermediate.addUniShapeConversion(EOpReturn, *currentFunctionType, value); + if (value == nullptr || *currentFunctionType != value->getType()) { + error(loc, "type does not match, or is not convertible to, the function's return type", "return", ""); + return value; + } + } + + return intermediate.addBranch(EOpReturn, value, loc); +} + +void HlslParseContext::handleFunctionArgument(TFunction* function, + TIntermTyped*& arguments, TIntermTyped* newArg) +{ + TParameter param = { nullptr, new TType, nullptr }; + param.type->shallowCopy(newArg->getType()); + + function->addParameter(param); + if (arguments) + arguments = intermediate.growAggregate(arguments, newArg); + else + arguments = newArg; +} + +// FragCoord may require special loading: we can optionally reciprocate W. +TIntermTyped* HlslParseContext::assignFromFragCoord(const TSourceLoc& loc, TOperator op, + TIntermTyped* left, TIntermTyped* right) +{ + // If we are not asked for reciprocal W, use a plain old assign. + if (!intermediate.getDxPositionW()) + return intermediate.addAssign(op, left, right, loc); + + // If we get here, we should reciprocate W. + TIntermAggregate* assignList = nullptr; + + // If this is a complex rvalue, we don't want to dereference it many times. Create a temporary. + TVariable* rhsTempVar = nullptr; + rhsTempVar = makeInternalVariable("@fragcoord", right->getType()); + rhsTempVar->getWritableType().getQualifier().makeTemporary(); + + { + TIntermTyped* rhsTempSym = intermediate.addSymbol(*rhsTempVar, loc); + assignList = intermediate.growAggregate(assignList, + intermediate.addAssign(EOpAssign, rhsTempSym, right, loc), loc); + } + + // tmp.w = 1.0 / tmp.w + { + const int W = 3; + + TIntermTyped* tempSymL = intermediate.addSymbol(*rhsTempVar, loc); + TIntermTyped* tempSymR = intermediate.addSymbol(*rhsTempVar, loc); + TIntermTyped* index = intermediate.addConstantUnion(W, loc); + + TIntermTyped* lhsElement = intermediate.addIndex(EOpIndexDirect, tempSymL, index, loc); + TIntermTyped* rhsElement = intermediate.addIndex(EOpIndexDirect, tempSymR, index, loc); + + const TType derefType(right->getType(), 0); + + lhsElement->setType(derefType); + rhsElement->setType(derefType); + + auto one = intermediate.addConstantUnion(1.0, EbtFloat, loc); + auto recip_w = intermediate.addBinaryMath(EOpDiv, one, rhsElement, loc); + + assignList = intermediate.growAggregate(assignList, intermediate.addAssign(EOpAssign, lhsElement, recip_w, loc)); + } + + // Assign the rhs temp (now with W reciprocal) to the final output + { + TIntermTyped* rhsTempSym = intermediate.addSymbol(*rhsTempVar, loc); + assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, left, rhsTempSym, loc)); + } + + assert(assignList != nullptr); + assignList->setOperator(EOpSequence); + + return assignList; +} + +// Position may require special handling: we can optionally invert Y. +// See: https://github.com/KhronosGroup/glslang/issues/1173 +// https://github.com/KhronosGroup/glslang/issues/494 +TIntermTyped* HlslParseContext::assignPosition(const TSourceLoc& loc, TOperator op, + TIntermTyped* left, TIntermTyped* right) +{ + // If we are not asked for Y inversion, use a plain old assign. + if (!intermediate.getInvertY()) + return intermediate.addAssign(op, left, right, loc); + + // If we get here, we should invert Y. + TIntermAggregate* assignList = nullptr; + + // If this is a complex rvalue, we don't want to dereference it many times. Create a temporary. + TVariable* rhsTempVar = nullptr; + rhsTempVar = makeInternalVariable("@position", right->getType()); + rhsTempVar->getWritableType().getQualifier().makeTemporary(); + + { + TIntermTyped* rhsTempSym = intermediate.addSymbol(*rhsTempVar, loc); + assignList = intermediate.growAggregate(assignList, + intermediate.addAssign(EOpAssign, rhsTempSym, right, loc), loc); + } + + // pos.y = -pos.y + { + const int Y = 1; + + TIntermTyped* tempSymL = intermediate.addSymbol(*rhsTempVar, loc); + TIntermTyped* tempSymR = intermediate.addSymbol(*rhsTempVar, loc); + TIntermTyped* index = intermediate.addConstantUnion(Y, loc); + + TIntermTyped* lhsElement = intermediate.addIndex(EOpIndexDirect, tempSymL, index, loc); + TIntermTyped* rhsElement = intermediate.addIndex(EOpIndexDirect, tempSymR, index, loc); + + const TType derefType(right->getType(), 0); + + lhsElement->setType(derefType); + rhsElement->setType(derefType); + + TIntermTyped* yNeg = intermediate.addUnaryMath(EOpNegative, rhsElement, loc); + + assignList = intermediate.growAggregate(assignList, intermediate.addAssign(EOpAssign, lhsElement, yNeg, loc)); + } + + // Assign the rhs temp (now with Y inversion) to the final output + { + TIntermTyped* rhsTempSym = intermediate.addSymbol(*rhsTempVar, loc); + assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, left, rhsTempSym, loc)); + } + + assert(assignList != nullptr); + assignList->setOperator(EOpSequence); + + return assignList; +} + +// Clip and cull distance require special handling due to a semantic mismatch. In HLSL, +// these can be float scalar, float vector, or arrays of float scalar or float vector. +// In SPIR-V, they are arrays of scalar floats in all cases. We must copy individual components +// (e.g, both x and y components of a float2) out into the destination float array. +// +// The values are assigned to sequential members of the output array. The inner dimension +// is vector components. The outer dimension is array elements. +TIntermAggregate* HlslParseContext::assignClipCullDistance(const TSourceLoc& loc, TOperator op, int semanticId, + TIntermTyped* left, TIntermTyped* right) +{ + switch (language) { + case EShLangFragment: + case EShLangVertex: + case EShLangGeometry: + break; + default: + error(loc, "unimplemented: clip/cull not currently implemented for this stage", "", ""); + return nullptr; + } + + TVariable** clipCullVar = nullptr; + + // Figure out if we are assigning to, or from, clip or cull distance. + const bool isOutput = isClipOrCullDistance(left->getType()); + + // This is the rvalue or lvalue holding the clip or cull distance. + TIntermTyped* clipCullNode = isOutput ? left : right; + // This is the value going into or out of the clip or cull distance. + TIntermTyped* internalNode = isOutput ? right : left; + + const TBuiltInVariable builtInType = clipCullNode->getQualifier().builtIn; + + decltype(clipSemanticNSizeIn)* semanticNSize = nullptr; + + // Refer to either the clip or the cull distance, depending on semantic. + switch (builtInType) { + case EbvClipDistance: + clipCullVar = isOutput ? &clipDistanceOutput : &clipDistanceInput; + semanticNSize = isOutput ? &clipSemanticNSizeOut : &clipSemanticNSizeIn; + break; + case EbvCullDistance: + clipCullVar = isOutput ? &cullDistanceOutput : &cullDistanceInput; + semanticNSize = isOutput ? &cullSemanticNSizeOut : &cullSemanticNSizeIn; + break; + + // called invalidly: we expected a clip or a cull distance. + // static compile time problem: should not happen. + default: assert(0); return nullptr; + } + + // This is the offset in the destination array of a given semantic's data + std::array semanticOffset; + + // Calculate offset of variable of semantic N in destination array + int arrayLoc = 0; + int vecItems = 0; + + for (int x = 0; x < maxClipCullRegs; ++x) { + // See if we overflowed the vec4 packing + if ((vecItems + (*semanticNSize)[x]) > 4) { + arrayLoc = (arrayLoc + 3) & (~0x3); // round up to next multiple of 4 + vecItems = 0; + } + + semanticOffset[x] = arrayLoc; + vecItems += (*semanticNSize)[x]; + arrayLoc += (*semanticNSize)[x]; + } + + + // It can have up to 2 array dimensions (in the case of geometry shader inputs) + const TArraySizes* const internalArraySizes = internalNode->getType().getArraySizes(); + const int internalArrayDims = internalNode->getType().isArray() ? internalArraySizes->getNumDims() : 0; + // vector sizes: + const int internalVectorSize = internalNode->getType().getVectorSize(); + // array sizes, or 1 if it's not an array: + const int internalInnerArraySize = (internalArrayDims > 0 ? internalArraySizes->getDimSize(internalArrayDims-1) : 1); + const int internalOuterArraySize = (internalArrayDims > 1 ? internalArraySizes->getDimSize(0) : 1); + + // The created type may be an array of arrays, e.g, for geometry shader inputs. + const bool isImplicitlyArrayed = (language == EShLangGeometry && !isOutput); + + // If we haven't created the output already, create it now. + if (*clipCullVar == nullptr) { + // ClipDistance and CullDistance are handled specially in the entry point input/output copy + // algorithm, because they may need to be unpacked from components of vectors (or a scalar) + // into a float array, or vice versa. Here, we make the array the right size and type, + // which depends on the incoming data, which has several potential dimensions: + // * Semantic ID + // * vector size + // * array size + // Of those, semantic ID and array size cannot appear simultaneously. + // + // Also to note: for implicitly arrayed forms (e.g, geometry shader inputs), we need to create two + // array dimensions. The shader's declaration may have one or two array dimensions. One is always + // the geometry's dimension. + + const bool useInnerSize = internalArrayDims > 1 || !isImplicitlyArrayed; + + const int requiredInnerArraySize = arrayLoc * (useInnerSize ? internalInnerArraySize : 1); + const int requiredOuterArraySize = (internalArrayDims > 0) ? internalArraySizes->getDimSize(0) : 1; + + TType clipCullType(EbtFloat, clipCullNode->getType().getQualifier().storage, 1); + clipCullType.getQualifier() = clipCullNode->getType().getQualifier(); + + // Create required array dimension + TArraySizes* arraySizes = new TArraySizes; + if (isImplicitlyArrayed) + arraySizes->addInnerSize(requiredOuterArraySize); + arraySizes->addInnerSize(requiredInnerArraySize); + clipCullType.transferArraySizes(arraySizes); + + // Obtain symbol name: we'll use that for the symbol we introduce. + TIntermSymbol* sym = clipCullNode->getAsSymbolNode(); + assert(sym != nullptr); + + // We are moving the semantic ID from the layout location, so it is no longer needed or + // desired there. + clipCullType.getQualifier().layoutLocation = TQualifier::layoutLocationEnd; + + // Create variable and track its linkage + *clipCullVar = makeInternalVariable(sym->getName().c_str(), clipCullType); + + trackLinkage(**clipCullVar); + } + + // Create symbol for the clip or cull variable. + TIntermSymbol* clipCullSym = intermediate.addSymbol(**clipCullVar); + + // vector sizes: + const int clipCullVectorSize = clipCullSym->getType().getVectorSize(); + + // array sizes, or 1 if it's not an array: + const TArraySizes* const clipCullArraySizes = clipCullSym->getType().getArraySizes(); + const int clipCullOuterArraySize = isImplicitlyArrayed ? clipCullArraySizes->getDimSize(0) : 1; + const int clipCullInnerArraySize = clipCullArraySizes->getDimSize(isImplicitlyArrayed ? 1 : 0); + + // clipCullSym has got to be an array of scalar floats, per SPIR-V semantics. + // fixBuiltInIoType() should have handled that upstream. + assert(clipCullSym->getType().isArray()); + assert(clipCullSym->getType().getVectorSize() == 1); + assert(clipCullSym->getType().getBasicType() == EbtFloat); + + // We may be creating multiple sub-assignments. This is an aggregate to hold them. + // TODO: it would be possible to be clever sometimes and avoid the sequence node if not needed. + TIntermAggregate* assignList = nullptr; + + // Holds individual component assignments as we make them. + TIntermTyped* clipCullAssign = nullptr; + + // If the types are homomorphic, use a simple assign. No need to mess about with + // individual components. + if (clipCullSym->getType().isArray() == internalNode->getType().isArray() && + clipCullInnerArraySize == internalInnerArraySize && + clipCullOuterArraySize == internalOuterArraySize && + clipCullVectorSize == internalVectorSize) { + + if (isOutput) + clipCullAssign = intermediate.addAssign(op, clipCullSym, internalNode, loc); + else + clipCullAssign = intermediate.addAssign(op, internalNode, clipCullSym, loc); + + assignList = intermediate.growAggregate(assignList, clipCullAssign); + assignList->setOperator(EOpSequence); + + return assignList; + } + + // We are going to copy each component of the internal (per array element if indicated) to sequential + // array elements of the clipCullSym. This tracks the lhs element we're writing to as we go along. + // We may be starting in the middle - e.g, for a non-zero semantic ID calculated above. + int clipCullInnerArrayPos = semanticOffset[semanticId]; + int clipCullOuterArrayPos = 0; + + // Lambda to add an index to a node, set the type of the result, and return the new node. + const auto addIndex = [this, &loc](TIntermTyped* node, int pos) -> TIntermTyped* { + const TType derefType(node->getType(), 0); + node = intermediate.addIndex(EOpIndexDirect, node, intermediate.addConstantUnion(pos, loc), loc); + node->setType(derefType); + return node; + }; + + // Loop through every component of every element of the internal, and copy to or from the matching external. + for (int internalOuterArrayPos = 0; internalOuterArrayPos < internalOuterArraySize; ++internalOuterArrayPos) { + for (int internalInnerArrayPos = 0; internalInnerArrayPos < internalInnerArraySize; ++internalInnerArrayPos) { + for (int internalComponent = 0; internalComponent < internalVectorSize; ++internalComponent) { + // clip/cull array member to read from / write to: + TIntermTyped* clipCullMember = clipCullSym; + + // If implicitly arrayed, there is an outer array dimension involved + if (isImplicitlyArrayed) + clipCullMember = addIndex(clipCullMember, clipCullOuterArrayPos); + + // Index into proper array position for clip cull member + clipCullMember = addIndex(clipCullMember, clipCullInnerArrayPos++); + + // if needed, start over with next outer array slice. + if (isImplicitlyArrayed && clipCullInnerArrayPos >= clipCullInnerArraySize) { + clipCullInnerArrayPos = semanticOffset[semanticId]; + ++clipCullOuterArrayPos; + } + + // internal member to read from / write to: + TIntermTyped* internalMember = internalNode; + + // If internal node has outer array dimension, index appropriately. + if (internalArrayDims > 1) + internalMember = addIndex(internalMember, internalOuterArrayPos); + + // If internal node has inner array dimension, index appropriately. + if (internalArrayDims > 0) + internalMember = addIndex(internalMember, internalInnerArrayPos); + + // If internal node is a vector, extract the component of interest. + if (internalNode->getType().isVector()) + internalMember = addIndex(internalMember, internalComponent); + + // Create an assignment: output from internal to clip cull, or input from clip cull to internal. + if (isOutput) + clipCullAssign = intermediate.addAssign(op, clipCullMember, internalMember, loc); + else + clipCullAssign = intermediate.addAssign(op, internalMember, clipCullMember, loc); + + // Track assignment in the sequence. + assignList = intermediate.growAggregate(assignList, clipCullAssign); + } + } + } + + assert(assignList != nullptr); + assignList->setOperator(EOpSequence); + + return assignList; +} + +// Some simple source assignments need to be flattened to a sequence +// of AST assignments. Catch these and flatten, otherwise, pass through +// to intermediate.addAssign(). +// +// Also, assignment to matrix swizzles requires multiple component assignments, +// intercept those as well. +TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op, TIntermTyped* left, + TIntermTyped* right) +{ + if (left == nullptr || right == nullptr) + return nullptr; + + // writing to opaques will require fixing transforms + if (left->getType().containsOpaque()) + intermediate.setNeedsLegalization(); + + if (left->getAsOperator() && left->getAsOperator()->getOp() == EOpMatrixSwizzle) + return handleAssignToMatrixSwizzle(loc, op, left, right); + + // Return true if the given node is an index operation into a split variable. + const auto indexesSplit = [this](const TIntermTyped* node) -> bool { + const TIntermBinary* binaryNode = node->getAsBinaryNode(); + + if (binaryNode == nullptr) + return false; + + return (binaryNode->getOp() == EOpIndexDirect || binaryNode->getOp() == EOpIndexIndirect) && + wasSplit(binaryNode->getLeft()); + }; + + // Return symbol if node is symbol or index ref + const auto getSymbol = [](const TIntermTyped* node) -> const TIntermSymbol* { + const TIntermSymbol* symbolNode = node->getAsSymbolNode(); + if (symbolNode != nullptr) + return symbolNode; + + const TIntermBinary* binaryNode = node->getAsBinaryNode(); + if (binaryNode != nullptr && (binaryNode->getOp() == EOpIndexDirect || binaryNode->getOp() == EOpIndexIndirect)) + return binaryNode->getLeft()->getAsSymbolNode(); + + return nullptr; + }; + + // Return true if this stage assigns clip position with potentially inverted Y + const auto assignsClipPos = [this](const TIntermTyped* node) -> bool { + return node->getType().getQualifier().builtIn == EbvPosition && + (language == EShLangVertex || language == EShLangGeometry || language == EShLangTessEvaluation); + }; + + const TIntermSymbol* leftSymbol = getSymbol(left); + const TIntermSymbol* rightSymbol = getSymbol(right); + + const bool isSplitLeft = wasSplit(left) || indexesSplit(left); + const bool isSplitRight = wasSplit(right) || indexesSplit(right); + + const bool isFlattenLeft = wasFlattened(leftSymbol); + const bool isFlattenRight = wasFlattened(rightSymbol); + + // OK to do a single assign if neither side is split or flattened. Otherwise, + // fall through to a member-wise copy. + if (!isFlattenLeft && !isFlattenRight && !isSplitLeft && !isSplitRight) { + // Clip and cull distance requires more processing. See comment above assignClipCullDistance. + if (isClipOrCullDistance(left->getType()) || isClipOrCullDistance(right->getType())) { + const bool isOutput = isClipOrCullDistance(left->getType()); + + const int semanticId = (isOutput ? left : right)->getType().getQualifier().layoutLocation; + return assignClipCullDistance(loc, op, semanticId, left, right); + } else if (assignsClipPos(left)) { + // Position can require special handling: see comment above assignPosition + return assignPosition(loc, op, left, right); + } else if (left->getQualifier().builtIn == EbvSampleMask) { + // Certain builtins are required to be arrayed outputs in SPIR-V, but may internally be scalars + // in the shader. Copy the scalar RHS into the LHS array element zero, if that happens. + if (left->isArray() && !right->isArray()) { + const TType derefType(left->getType(), 0); + left = intermediate.addIndex(EOpIndexDirect, left, intermediate.addConstantUnion(0, loc), loc); + left->setType(derefType); + // Fall through to add assign. + } + } + + return intermediate.addAssign(op, left, right, loc); + } + + TIntermAggregate* assignList = nullptr; + const TVector* leftVariables = nullptr; + const TVector* rightVariables = nullptr; + + // A temporary to store the right node's value, so we don't keep indirecting into it + // if it's not a simple symbol. + TVariable* rhsTempVar = nullptr; + + // If the RHS is a simple symbol node, we'll copy it for each member. + TIntermSymbol* cloneSymNode = nullptr; + + int memberCount = 0; + + // Track how many items there are to copy. + if (left->getType().isStruct()) + memberCount = (int)left->getType().getStruct()->size(); + if (left->getType().isArray()) + memberCount = left->getType().getCumulativeArraySize(); + + if (isFlattenLeft) + leftVariables = &flattenMap.find(leftSymbol->getId())->second.members; + + if (isFlattenRight) { + rightVariables = &flattenMap.find(rightSymbol->getId())->second.members; + } else { + // The RHS is not flattened. There are several cases: + // 1. 1 item to copy: Use the RHS directly. + // 2. >1 item, simple symbol RHS: we'll create a new TIntermSymbol node for each, but no assign to temp. + // 3. >1 item, complex RHS: assign it to a new temp variable, and create a TIntermSymbol for each member. + + if (memberCount <= 1) { + // case 1: we'll use the symbol directly below. Nothing to do. + } else { + if (right->getAsSymbolNode() != nullptr) { + // case 2: we'll copy the symbol per iteration below. + cloneSymNode = right->getAsSymbolNode(); + } else { + // case 3: assign to a temp, and indirect into that. + rhsTempVar = makeInternalVariable("flattenTemp", right->getType()); + rhsTempVar->getWritableType().getQualifier().makeTemporary(); + TIntermTyped* noFlattenRHS = intermediate.addSymbol(*rhsTempVar, loc); + + // Add this to the aggregate being built. + assignList = intermediate.growAggregate(assignList, + intermediate.addAssign(op, noFlattenRHS, right, loc), loc); + } + } + } + + // When dealing with split arrayed structures of built-ins, the arrayness is moved to the extracted built-in + // variables, which is awkward when copying between split and unsplit structures. This variable tracks + // array indirections so they can be percolated from outer structs to inner variables. + std::vector arrayElement; + + TStorageQualifier leftStorage = left->getType().getQualifier().storage; + TStorageQualifier rightStorage = right->getType().getQualifier().storage; + + int leftOffsetStart = findSubtreeOffset(*left); + int rightOffsetStart = findSubtreeOffset(*right); + int leftOffset = leftOffsetStart; + int rightOffset = rightOffsetStart; + + const auto getMember = [&](bool isLeft, const TType& type, int member, TIntermTyped* splitNode, int splitMember, + bool flattened) + -> TIntermTyped * { + const bool split = isLeft ? isSplitLeft : isSplitRight; + + TIntermTyped* subTree; + const TType derefType(type, member); + const TVariable* builtInVar = nullptr; + if ((flattened || split) && derefType.isBuiltIn()) { + auto splitPair = splitBuiltIns.find(HlslParseContext::tInterstageIoData( + derefType.getQualifier().builtIn, + isLeft ? leftStorage : rightStorage)); + if (splitPair != splitBuiltIns.end()) + builtInVar = splitPair->second; + } + if (builtInVar != nullptr) { + // copy from interstage IO built-in if needed + subTree = intermediate.addSymbol(*builtInVar); + + if (subTree->getType().isArray()) { + // Arrayness of builtIn symbols isn't handled by the normal recursion: + // it's been extracted and moved to the built-in. + if (!arrayElement.empty()) { + const TType splitDerefType(subTree->getType(), arrayElement.back()); + subTree = intermediate.addIndex(EOpIndexDirect, subTree, + intermediate.addConstantUnion(arrayElement.back(), loc), loc); + subTree->setType(splitDerefType); + } else if (splitNode->getAsOperator() != nullptr && (splitNode->getAsOperator()->getOp() == EOpIndexIndirect)) { + // This might also be a stage with arrayed outputs, in which case there's an index + // operation we should transfer to the output builtin. + + const TType splitDerefType(subTree->getType(), 0); + subTree = intermediate.addIndex(splitNode->getAsOperator()->getOp(), subTree, + splitNode->getAsBinaryNode()->getRight(), loc); + subTree->setType(splitDerefType); + } + } + } else if (flattened && !shouldFlatten(derefType, isLeft ? leftStorage : rightStorage, false)) { + if (isLeft) { + // offset will cycle through variables for arrayed io + if (leftOffset >= static_cast(leftVariables->size())) + leftOffset = leftOffsetStart; + subTree = intermediate.addSymbol(*(*leftVariables)[leftOffset++]); + } else { + // offset will cycle through variables for arrayed io + if (rightOffset >= static_cast(rightVariables->size())) + rightOffset = rightOffsetStart; + subTree = intermediate.addSymbol(*(*rightVariables)[rightOffset++]); + } + + // arrayed io + if (subTree->getType().isArray()) { + if (!arrayElement.empty()) { + const TType derefType(subTree->getType(), arrayElement.front()); + subTree = intermediate.addIndex(EOpIndexDirect, subTree, + intermediate.addConstantUnion(arrayElement.front(), loc), loc); + subTree->setType(derefType); + } else { + // There's an index operation we should transfer to the output builtin. + assert(splitNode->getAsOperator() != nullptr && + splitNode->getAsOperator()->getOp() == EOpIndexIndirect); + const TType splitDerefType(subTree->getType(), 0); + subTree = intermediate.addIndex(splitNode->getAsOperator()->getOp(), subTree, + splitNode->getAsBinaryNode()->getRight(), loc); + subTree->setType(splitDerefType); + } + } + } else { + // Index operator if it's an aggregate, else EOpNull + const TOperator accessOp = type.isArray() ? EOpIndexDirect + : type.isStruct() ? EOpIndexDirectStruct + : EOpNull; + if (accessOp == EOpNull) { + subTree = splitNode; + } else { + subTree = intermediate.addIndex(accessOp, splitNode, intermediate.addConstantUnion(splitMember, loc), + loc); + const TType splitDerefType(splitNode->getType(), splitMember); + subTree->setType(splitDerefType); + } + } + + return subTree; + }; + + // Use the proper RHS node: a new symbol from a TVariable, copy + // of an TIntermSymbol node, or sometimes the right node directly. + right = rhsTempVar != nullptr ? intermediate.addSymbol(*rhsTempVar, loc) : + cloneSymNode != nullptr ? intermediate.addSymbol(*cloneSymNode) : + right; + + // Cannot use auto here, because this is recursive, and auto can't work out the type without seeing the + // whole thing. So, we'll resort to an explicit type via std::function. + const std::function + traverse = [&](TIntermTyped* left, TIntermTyped* right, TIntermTyped* splitLeft, TIntermTyped* splitRight, + bool topLevel) -> void { + // If we get here, we are assigning to or from a whole array or struct that must be + // flattened, so have to do member-by-member assignment: + + bool shouldFlattenSubsetLeft = isFlattenLeft && shouldFlatten(left->getType(), leftStorage, topLevel); + bool shouldFlattenSubsetRight = isFlattenRight && shouldFlatten(right->getType(), rightStorage, topLevel); + + if ((left->getType().isArray() || right->getType().isArray()) && + (shouldFlattenSubsetLeft || isSplitLeft || + shouldFlattenSubsetRight || isSplitRight)) { + const int elementsL = left->getType().isArray() ? left->getType().getOuterArraySize() : 1; + const int elementsR = right->getType().isArray() ? right->getType().getOuterArraySize() : 1; + + // The arrays might not be the same size, + // e.g., if the size has been forced for EbvTessLevelInner/Outer. + const int elementsToCopy = std::min(elementsL, elementsR); + + // array case + for (int element = 0; element < elementsToCopy; ++element) { + arrayElement.push_back(element); + + // Add a new AST symbol node if we have a temp variable holding a complex RHS. + TIntermTyped* subLeft = getMember(true, left->getType(), element, left, element, + shouldFlattenSubsetLeft); + TIntermTyped* subRight = getMember(false, right->getType(), element, right, element, + shouldFlattenSubsetRight); + + TIntermTyped* subSplitLeft = isSplitLeft ? getMember(true, left->getType(), element, splitLeft, + element, shouldFlattenSubsetLeft) + : subLeft; + TIntermTyped* subSplitRight = isSplitRight ? getMember(false, right->getType(), element, splitRight, + element, shouldFlattenSubsetRight) + : subRight; + + traverse(subLeft, subRight, subSplitLeft, subSplitRight, false); + + arrayElement.pop_back(); + } + } else if (left->getType().isStruct() && (shouldFlattenSubsetLeft || isSplitLeft || + shouldFlattenSubsetRight || isSplitRight)) { + // struct case + const auto& membersL = *left->getType().getStruct(); + const auto& membersR = *right->getType().getStruct(); + + // These track the members in the split structures corresponding to the same in the unsplit structures, + // which we traverse in parallel. + int memberL = 0; + int memberR = 0; + + // Handle empty structure assignment + if (int(membersL.size()) == 0 && int(membersR.size()) == 0) + assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, left, right, loc), loc); + + for (int member = 0; member < int(membersL.size()); ++member) { + const TType& typeL = *membersL[member].type; + const TType& typeR = *membersR[member].type; + + TIntermTyped* subLeft = getMember(true, left->getType(), member, left, member, + shouldFlattenSubsetLeft); + TIntermTyped* subRight = getMember(false, right->getType(), member, right, member, + shouldFlattenSubsetRight); + + // If there is no splitting, use the same values to avoid inefficiency. + TIntermTyped* subSplitLeft = isSplitLeft ? getMember(true, left->getType(), member, splitLeft, + memberL, shouldFlattenSubsetLeft) + : subLeft; + TIntermTyped* subSplitRight = isSplitRight ? getMember(false, right->getType(), member, splitRight, + memberR, shouldFlattenSubsetRight) + : subRight; + + if (isClipOrCullDistance(subSplitLeft->getType()) || isClipOrCullDistance(subSplitRight->getType())) { + // Clip and cull distance built-in assignment is complex in its own right, and is handled in + // a separate function dedicated to that task. See comment above assignClipCullDistance; + + const bool isOutput = isClipOrCullDistance(subSplitLeft->getType()); + + // Since all clip/cull semantics boil down to the same built-in type, we need to get the + // semantic ID from the dereferenced type's layout location, to avoid an N-1 mapping. + const TType derefType((isOutput ? left : right)->getType(), member); + const int semanticId = derefType.getQualifier().layoutLocation; + + TIntermAggregate* clipCullAssign = assignClipCullDistance(loc, op, semanticId, + subSplitLeft, subSplitRight); + + assignList = intermediate.growAggregate(assignList, clipCullAssign, loc); + } else if (subSplitRight->getType().getQualifier().builtIn == EbvFragCoord) { + // FragCoord can require special handling: see comment above assignFromFragCoord + TIntermTyped* fragCoordAssign = assignFromFragCoord(loc, op, subSplitLeft, subSplitRight); + assignList = intermediate.growAggregate(assignList, fragCoordAssign, loc); + } else if (assignsClipPos(subSplitLeft)) { + // Position can require special handling: see comment above assignPosition + TIntermTyped* positionAssign = assignPosition(loc, op, subSplitLeft, subSplitRight); + assignList = intermediate.growAggregate(assignList, positionAssign, loc); + } else if (!shouldFlattenSubsetLeft && !shouldFlattenSubsetRight && + !typeL.containsBuiltIn() && !typeR.containsBuiltIn()) { + // If this is the final flattening (no nested types below to flatten) + // we'll copy the member, else recurse into the type hierarchy. + // However, if splitting the struct, that means we can copy a whole + // subtree here IFF it does not itself contain any interstage built-in + // IO variables, so we only have to recurse into it if there's something + // for splitting to do. That can save a lot of AST verbosity for + // a bunch of memberwise copies. + + assignList = intermediate.growAggregate(assignList, + intermediate.addAssign(op, subSplitLeft, subSplitRight, loc), + loc); + } else { + traverse(subLeft, subRight, subSplitLeft, subSplitRight, false); + } + + memberL += (typeL.isBuiltIn() ? 0 : 1); + memberR += (typeR.isBuiltIn() ? 0 : 1); + } + } else { + // Member copy + assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, left, right, loc), loc); + } + + }; + + TIntermTyped* splitLeft = left; + TIntermTyped* splitRight = right; + + // If either left or right was a split structure, we must read or write it, but still have to + // parallel-recurse through the unsplit structure to identify the built-in IO vars. + // The left can be either a symbol, or an index into a symbol (e.g, array reference) + if (isSplitLeft) { + if (indexesSplit(left)) { + // Index case: Refer to the indexed symbol, if the left is an index operator. + const TIntermSymbol* symNode = left->getAsBinaryNode()->getLeft()->getAsSymbolNode(); + + TIntermTyped* splitLeftNonIo = intermediate.addSymbol(*getSplitNonIoVar(symNode->getId()), loc); + + splitLeft = intermediate.addIndex(left->getAsBinaryNode()->getOp(), splitLeftNonIo, + left->getAsBinaryNode()->getRight(), loc); + + const TType derefType(splitLeftNonIo->getType(), 0); + splitLeft->setType(derefType); + } else { + // Symbol case: otherwise, if not indexed, we have the symbol directly. + const TIntermSymbol* symNode = left->getAsSymbolNode(); + splitLeft = intermediate.addSymbol(*getSplitNonIoVar(symNode->getId()), loc); + } + } + + if (isSplitRight) + splitRight = intermediate.addSymbol(*getSplitNonIoVar(right->getAsSymbolNode()->getId()), loc); + + // This makes the whole assignment, recursing through subtypes as needed. + traverse(left, right, splitLeft, splitRight, true); + + assert(assignList != nullptr); + assignList->setOperator(EOpSequence); + + return assignList; +} + +// An assignment to matrix swizzle must be decomposed into individual assignments. +// These must be selected component-wise from the RHS and stored component-wise +// into the LHS. +TIntermTyped* HlslParseContext::handleAssignToMatrixSwizzle(const TSourceLoc& loc, TOperator op, TIntermTyped* left, + TIntermTyped* right) +{ + assert(left->getAsOperator() && left->getAsOperator()->getOp() == EOpMatrixSwizzle); + + if (op != EOpAssign) + error(loc, "only simple assignment to non-simple matrix swizzle is supported", "assign", ""); + + // isolate the matrix and swizzle nodes + TIntermTyped* matrix = left->getAsBinaryNode()->getLeft()->getAsTyped(); + const TIntermSequence& swizzle = left->getAsBinaryNode()->getRight()->getAsAggregate()->getSequence(); + + // if the RHS isn't already a simple vector, let's store into one + TIntermSymbol* vector = right->getAsSymbolNode(); + TIntermTyped* vectorAssign = nullptr; + if (vector == nullptr) { + // create a new intermediate vector variable to assign to + TType vectorType(matrix->getBasicType(), EvqTemporary, matrix->getQualifier().precision, (int)swizzle.size()/2); + vector = intermediate.addSymbol(*makeInternalVariable("intermVec", vectorType), loc); + + // assign the right to the new vector + vectorAssign = handleAssign(loc, op, vector, right); + } + + // Assign the vector components to the matrix components. + // Store this as a sequence, so a single aggregate node represents this + // entire operation. + TIntermAggregate* result = intermediate.makeAggregate(vectorAssign); + TType columnType(matrix->getType(), 0); + TType componentType(columnType, 0); + TType indexType(EbtInt); + for (int i = 0; i < (int)swizzle.size(); i += 2) { + // the right component, single index into the RHS vector + TIntermTyped* rightComp = intermediate.addIndex(EOpIndexDirect, vector, + intermediate.addConstantUnion(i/2, loc), loc); + + // the left component, double index into the LHS matrix + TIntermTyped* leftComp = intermediate.addIndex(EOpIndexDirect, matrix, + intermediate.addConstantUnion(swizzle[i]->getAsConstantUnion()->getConstArray(), + indexType, loc), + loc); + leftComp->setType(columnType); + leftComp = intermediate.addIndex(EOpIndexDirect, leftComp, + intermediate.addConstantUnion(swizzle[i+1]->getAsConstantUnion()->getConstArray(), + indexType, loc), + loc); + leftComp->setType(componentType); + + // Add the assignment to the aggregate + result = intermediate.growAggregate(result, intermediate.addAssign(op, leftComp, rightComp, loc)); + } + + result->setOp(EOpSequence); + + return result; +} + +// +// HLSL atomic operations have slightly different arguments than +// GLSL/AST/SPIRV. The semantics are converted below in decomposeIntrinsic. +// This provides the post-decomposition equivalent opcode. +// +TOperator HlslParseContext::mapAtomicOp(const TSourceLoc& loc, TOperator op, bool isImage) +{ + switch (op) { + case EOpInterlockedAdd: return isImage ? EOpImageAtomicAdd : EOpAtomicAdd; + case EOpInterlockedAnd: return isImage ? EOpImageAtomicAnd : EOpAtomicAnd; + case EOpInterlockedCompareExchange: return isImage ? EOpImageAtomicCompSwap : EOpAtomicCompSwap; + case EOpInterlockedMax: return isImage ? EOpImageAtomicMax : EOpAtomicMax; + case EOpInterlockedMin: return isImage ? EOpImageAtomicMin : EOpAtomicMin; + case EOpInterlockedOr: return isImage ? EOpImageAtomicOr : EOpAtomicOr; + case EOpInterlockedXor: return isImage ? EOpImageAtomicXor : EOpAtomicXor; + case EOpInterlockedExchange: return isImage ? EOpImageAtomicExchange : EOpAtomicExchange; + case EOpInterlockedCompareStore: // TODO: ... + default: + error(loc, "unknown atomic operation", "unknown op", ""); + return EOpNull; + } +} + +// +// Create a combined sampler/texture from separate sampler and texture. +// +TIntermAggregate* HlslParseContext::handleSamplerTextureCombine(const TSourceLoc& loc, TIntermTyped* argTex, + TIntermTyped* argSampler) +{ + TIntermAggregate* txcombine = new TIntermAggregate(EOpConstructTextureSampler); + + txcombine->getSequence().push_back(argTex); + txcombine->getSequence().push_back(argSampler); + + TSampler samplerType = argTex->getType().getSampler(); + samplerType.combined = true; + + // TODO: + // This block exists until the spec no longer requires shadow modes on texture objects. + // It can be deleted after that, along with the shadowTextureVariant member. + { + const bool shadowMode = argSampler->getType().getSampler().shadow; + + TIntermSymbol* texSymbol = argTex->getAsSymbolNode(); + + if (texSymbol == nullptr) + texSymbol = argTex->getAsBinaryNode()->getLeft()->getAsSymbolNode(); + + if (texSymbol == nullptr) { + error(loc, "unable to find texture symbol", "", ""); + return nullptr; + } + + // This forces the texture's shadow state to be the sampler's + // shadow state. This depends on downstream optimization to + // DCE one variant in [shadow, nonshadow] if both are present, + // or the SPIR-V module would be invalid. + long long newId = texSymbol->getId(); + + // Check to see if this texture has been given a shadow mode already. + // If so, look up the one we already have. + const auto textureShadowEntry = textureShadowVariant.find(texSymbol->getId()); + + if (textureShadowEntry != textureShadowVariant.end()) + newId = textureShadowEntry->second->get(shadowMode); + else + textureShadowVariant[texSymbol->getId()] = NewPoolObject(tShadowTextureSymbols(), 1); + + // Sometimes we have to create another symbol (if this texture has been seen before, + // and we haven't created the form for this shadow mode). + if (newId == -1) { + TType texType; + texType.shallowCopy(argTex->getType()); + texType.getSampler().shadow = shadowMode; // set appropriate shadow mode. + globalQualifierFix(loc, texType.getQualifier()); + + TVariable* newTexture = makeInternalVariable(texSymbol->getName(), texType); + + trackLinkage(*newTexture); + + newId = newTexture->getUniqueId(); + } + + assert(newId != -1); + + if (textureShadowVariant.find(newId) == textureShadowVariant.end()) + textureShadowVariant[newId] = textureShadowVariant[texSymbol->getId()]; + + textureShadowVariant[newId]->set(shadowMode, newId); + + // Remember this shadow mode in the texture and the merged type. + argTex->getWritableType().getSampler().shadow = shadowMode; + samplerType.shadow = shadowMode; + + texSymbol->switchId(newId); + } + + txcombine->setType(TType(samplerType, EvqTemporary)); + txcombine->setLoc(loc); + + return txcombine; +} + +// Return true if this a buffer type that has an associated counter buffer. +bool HlslParseContext::hasStructBuffCounter(const TType& type) const +{ + switch (type.getQualifier().declaredBuiltIn) { + case EbvAppendConsume: // fall through... + case EbvRWStructuredBuffer: // ... + return true; + default: + return false; // the other structuredbuffer types do not have a counter. + } +} + +void HlslParseContext::counterBufferType(const TSourceLoc& loc, TType& type) +{ + // Counter type + TType* counterType = new TType(EbtUint, EvqBuffer); + counterType->setFieldName(intermediate.implicitCounterName); + + TTypeList* blockStruct = new TTypeList; + TTypeLoc member = { counterType, loc }; + blockStruct->push_back(member); + + TType blockType(blockStruct, "", counterType->getQualifier()); + blockType.getQualifier().storage = EvqBuffer; + + type.shallowCopy(blockType); + shareStructBufferType(type); +} + +// declare counter for a structured buffer type +void HlslParseContext::declareStructBufferCounter(const TSourceLoc& loc, const TType& bufferType, const TString& name) +{ + // Bail out if not a struct buffer + if (! isStructBufferType(bufferType)) + return; + + if (! hasStructBuffCounter(bufferType)) + return; + + TType blockType; + counterBufferType(loc, blockType); + + TString* blockName = NewPoolTString(intermediate.addCounterBufferName(name).c_str()); + + // Counter buffer is not yet in use + structBufferCounter[*blockName] = false; + + shareStructBufferType(blockType); + declareBlock(loc, blockType, blockName); +} + +// return the counter that goes with a given structuredbuffer +TIntermTyped* HlslParseContext::getStructBufferCounter(const TSourceLoc& loc, TIntermTyped* buffer) +{ + // Bail out if not a struct buffer + if (buffer == nullptr || ! isStructBufferType(buffer->getType())) + return nullptr; + + const TString counterBlockName(intermediate.addCounterBufferName(buffer->getAsSymbolNode()->getName())); + + // Mark the counter as being used + structBufferCounter[counterBlockName] = true; + + TIntermTyped* counterVar = handleVariable(loc, &counterBlockName); // find the block structure + TIntermTyped* index = intermediate.addConstantUnion(0, loc); // index to counter inside block struct + + TIntermTyped* counterMember = intermediate.addIndex(EOpIndexDirectStruct, counterVar, index, loc); + counterMember->setType(TType(EbtUint)); + return counterMember; +} + +// +// Decompose structure buffer methods into AST +// +void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TIntermTyped*& node, TIntermNode* arguments) +{ + if (node == nullptr || node->getAsOperator() == nullptr || arguments == nullptr) + return; + + const TOperator op = node->getAsOperator()->getOp(); + TIntermAggregate* argAggregate = arguments->getAsAggregate(); + + // Buffer is the object upon which method is called, so always arg 0 + TIntermTyped* bufferObj = nullptr; + + // The parameters can be an aggregate, or just a the object as a symbol if there are no fn params. + if (argAggregate) { + if (argAggregate->getSequence().empty()) + return; + if (argAggregate->getSequence()[0]) + bufferObj = argAggregate->getSequence()[0]->getAsTyped(); + } else { + bufferObj = arguments->getAsSymbolNode(); + } + + if (bufferObj == nullptr || bufferObj->getAsSymbolNode() == nullptr) + return; + + // Some methods require a hidden internal counter, obtained via getStructBufferCounter(). + // This lambda adds something to it and returns the old value. + const auto incDecCounter = [&](int incval) -> TIntermTyped* { + TIntermTyped* incrementValue = intermediate.addConstantUnion(static_cast(incval), loc, true); + TIntermTyped* counter = getStructBufferCounter(loc, bufferObj); // obtain the counter member + + if (counter == nullptr) + return nullptr; + + TIntermAggregate* counterIncrement = new TIntermAggregate(EOpAtomicAdd); + counterIncrement->setType(TType(EbtUint, EvqTemporary)); + counterIncrement->setLoc(loc); + counterIncrement->getSequence().push_back(counter); + counterIncrement->getSequence().push_back(incrementValue); + + return counterIncrement; + }; + + // Index to obtain the runtime sized array out of the buffer. + TIntermTyped* argArray = indexStructBufferContent(loc, bufferObj); + if (argArray == nullptr) + return; // It might not be a struct buffer method. + + switch (op) { + case EOpMethodLoad: + { + TIntermTyped* argIndex = makeIntegerIndex(argAggregate->getSequence()[1]->getAsTyped()); // index + + const TType& bufferType = bufferObj->getType(); + + const TBuiltInVariable builtInType = bufferType.getQualifier().declaredBuiltIn; + + // Byte address buffers index in bytes (only multiples of 4 permitted... not so much a byte address + // buffer then, but that's what it calls itself. + const bool isByteAddressBuffer = (builtInType == EbvByteAddressBuffer || + builtInType == EbvRWByteAddressBuffer); + + + if (isByteAddressBuffer) + argIndex = intermediate.addBinaryNode(EOpRightShift, argIndex, + intermediate.addConstantUnion(2, loc, true), + loc, TType(EbtInt)); + + // Index into the array to find the item being loaded. + const TOperator idxOp = (argIndex->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect; + + node = intermediate.addIndex(idxOp, argArray, argIndex, loc); + + const TType derefType(argArray->getType(), 0); + node->setType(derefType); + } + + break; + + case EOpMethodLoad2: + case EOpMethodLoad3: + case EOpMethodLoad4: + { + TIntermTyped* argIndex = makeIntegerIndex(argAggregate->getSequence()[1]->getAsTyped()); // index + + TOperator constructOp = EOpNull; + int size = 0; + + switch (op) { + case EOpMethodLoad2: size = 2; constructOp = EOpConstructVec2; break; + case EOpMethodLoad3: size = 3; constructOp = EOpConstructVec3; break; + case EOpMethodLoad4: size = 4; constructOp = EOpConstructVec4; break; + default: assert(0); + } + + TIntermTyped* body = nullptr; + + // First, we'll store the address in a variable to avoid multiple shifts + // (we must convert the byte address to an item address) + TIntermTyped* byteAddrIdx = intermediate.addBinaryNode(EOpRightShift, argIndex, + intermediate.addConstantUnion(2, loc, true), + loc, TType(EbtInt)); + + TVariable* byteAddrSym = makeInternalVariable("byteAddrTemp", TType(EbtInt, EvqTemporary)); + TIntermTyped* byteAddrIdxVar = intermediate.addSymbol(*byteAddrSym, loc); + + body = intermediate.growAggregate(body, intermediate.addAssign(EOpAssign, byteAddrIdxVar, byteAddrIdx, loc)); + + TIntermTyped* vec = nullptr; + + // These are only valid on (rw)byteaddressbuffers, so we can always perform the >>2 + // address conversion. + for (int idx=0; idxgetQualifier().storage == EvqConst) ? EOpIndexDirect + : EOpIndexIndirect; + + TIntermTyped* indexVal = intermediate.addIndex(idxOp, argArray, offsetIdx, loc); + + TType derefType(argArray->getType(), 0); + derefType.getQualifier().makeTemporary(); + indexVal->setType(derefType); + + vec = intermediate.growAggregate(vec, indexVal); + } + + vec->setType(TType(argArray->getBasicType(), EvqTemporary, size)); + vec->getAsAggregate()->setOperator(constructOp); + + body = intermediate.growAggregate(body, vec); + body->setType(vec->getType()); + body->getAsAggregate()->setOperator(EOpSequence); + + node = body; + } + + break; + + case EOpMethodStore: + case EOpMethodStore2: + case EOpMethodStore3: + case EOpMethodStore4: + { + TIntermTyped* argIndex = makeIntegerIndex(argAggregate->getSequence()[1]->getAsTyped()); // index + TIntermTyped* argValue = argAggregate->getSequence()[2]->getAsTyped(); // value + + // Index into the array to find the item being loaded. + // Byte address buffers index in bytes (only multiples of 4 permitted... not so much a byte address + // buffer then, but that's what it calls itself). + + int size = 0; + + switch (op) { + case EOpMethodStore: size = 1; break; + case EOpMethodStore2: size = 2; break; + case EOpMethodStore3: size = 3; break; + case EOpMethodStore4: size = 4; break; + default: assert(0); + } + + TIntermAggregate* body = nullptr; + + // First, we'll store the address in a variable to avoid multiple shifts + // (we must convert the byte address to an item address) + TIntermTyped* byteAddrIdx = intermediate.addBinaryNode(EOpRightShift, argIndex, + intermediate.addConstantUnion(2, loc, true), loc, TType(EbtInt)); + + TVariable* byteAddrSym = makeInternalVariable("byteAddrTemp", TType(EbtInt, EvqTemporary)); + TIntermTyped* byteAddrIdxVar = intermediate.addSymbol(*byteAddrSym, loc); + + body = intermediate.growAggregate(body, intermediate.addAssign(EOpAssign, byteAddrIdxVar, byteAddrIdx, loc)); + + for (int idx=0; idxgetQualifier().storage == EvqConst) ? EOpIndexDirect + : EOpIndexIndirect; + + TIntermTyped* lValue = intermediate.addIndex(idxOp, argArray, offsetIdx, loc); + const TType derefType(argArray->getType(), 0); + lValue->setType(derefType); + + TIntermTyped* rValue; + if (size == 1) { + rValue = argValue; + } else { + rValue = intermediate.addIndex(EOpIndexDirect, argValue, idxConst, loc); + const TType indexType(argValue->getType(), 0); + rValue->setType(indexType); + } + + TIntermTyped* assign = intermediate.addAssign(EOpAssign, lValue, rValue, loc); + + body = intermediate.growAggregate(body, assign); + } + + body->setOperator(EOpSequence); + node = body; + } + + break; + + case EOpMethodGetDimensions: + { + const int numArgs = (int)argAggregate->getSequence().size(); + TIntermTyped* argNumItems = argAggregate->getSequence()[1]->getAsTyped(); // out num items + TIntermTyped* argStride = numArgs > 2 ? argAggregate->getSequence()[2]->getAsTyped() : nullptr; // out stride + + TIntermAggregate* body = nullptr; + + // Length output: + if (argArray->getType().isSizedArray()) { + const int length = argArray->getType().getOuterArraySize(); + TIntermTyped* assign = intermediate.addAssign(EOpAssign, argNumItems, + intermediate.addConstantUnion(length, loc, true), loc); + body = intermediate.growAggregate(body, assign, loc); + } else { + TIntermTyped* lengthCall = intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, argArray, + argNumItems->getType()); + TIntermTyped* assign = intermediate.addAssign(EOpAssign, argNumItems, lengthCall, loc); + body = intermediate.growAggregate(body, assign, loc); + } + + // Stride output: + if (argStride != nullptr) { + int size; + int stride; + intermediate.getMemberAlignment(argArray->getType(), size, stride, argArray->getType().getQualifier().layoutPacking, + argArray->getType().getQualifier().layoutMatrix == ElmRowMajor); + + TIntermTyped* assign = intermediate.addAssign(EOpAssign, argStride, + intermediate.addConstantUnion(stride, loc, true), loc); + + body = intermediate.growAggregate(body, assign); + } + + body->setOperator(EOpSequence); + node = body; + } + + break; + + case EOpInterlockedAdd: + case EOpInterlockedAnd: + case EOpInterlockedExchange: + case EOpInterlockedMax: + case EOpInterlockedMin: + case EOpInterlockedOr: + case EOpInterlockedXor: + case EOpInterlockedCompareExchange: + case EOpInterlockedCompareStore: + { + // We'll replace the first argument with the block dereference, and let + // downstream decomposition handle the rest. + + TIntermSequence& sequence = argAggregate->getSequence(); + + TIntermTyped* argIndex = makeIntegerIndex(sequence[1]->getAsTyped()); // index + argIndex = intermediate.addBinaryNode(EOpRightShift, argIndex, intermediate.addConstantUnion(2, loc, true), + loc, TType(EbtInt)); + + const TOperator idxOp = (argIndex->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect; + TIntermTyped* element = intermediate.addIndex(idxOp, argArray, argIndex, loc); + + const TType derefType(argArray->getType(), 0); + element->setType(derefType); + + // Replace the numeric byte offset parameter with array reference. + sequence[1] = element; + sequence.erase(sequence.begin(), sequence.begin()+1); + } + break; + + case EOpMethodIncrementCounter: + { + node = incDecCounter(1); + break; + } + + case EOpMethodDecrementCounter: + { + TIntermTyped* preIncValue = incDecCounter(-1); // result is original value + node = intermediate.addBinaryNode(EOpAdd, preIncValue, intermediate.addConstantUnion(-1, loc, true), loc, + preIncValue->getType()); + break; + } + + case EOpMethodAppend: + { + TIntermTyped* oldCounter = incDecCounter(1); + + TIntermTyped* lValue = intermediate.addIndex(EOpIndexIndirect, argArray, oldCounter, loc); + TIntermTyped* rValue = argAggregate->getSequence()[1]->getAsTyped(); + + const TType derefType(argArray->getType(), 0); + lValue->setType(derefType); + + node = intermediate.addAssign(EOpAssign, lValue, rValue, loc); + + break; + } + + case EOpMethodConsume: + { + TIntermTyped* oldCounter = incDecCounter(-1); + + TIntermTyped* newCounter = intermediate.addBinaryNode(EOpAdd, oldCounter, + intermediate.addConstantUnion(-1, loc, true), loc, + oldCounter->getType()); + + node = intermediate.addIndex(EOpIndexIndirect, argArray, newCounter, loc); + + const TType derefType(argArray->getType(), 0); + node->setType(derefType); + + break; + } + + default: + break; // most pass through unchanged + } +} + +// Create array of standard sample positions for given sample count. +// TODO: remove when a real method to query sample pos exists in SPIR-V. +TIntermConstantUnion* HlslParseContext::getSamplePosArray(int count) +{ + struct tSamplePos { float x, y; }; + + static const tSamplePos pos1[] = { + { 0.0/16.0, 0.0/16.0 }, + }; + + // standard sample positions for 2, 4, 8, and 16 samples. + static const tSamplePos pos2[] = { + { 4.0/16.0, 4.0/16.0 }, {-4.0/16.0, -4.0/16.0 }, + }; + + static const tSamplePos pos4[] = { + {-2.0/16.0, -6.0/16.0 }, { 6.0/16.0, -2.0/16.0 }, {-6.0/16.0, 2.0/16.0 }, { 2.0/16.0, 6.0/16.0 }, + }; + + static const tSamplePos pos8[] = { + { 1.0/16.0, -3.0/16.0 }, {-1.0/16.0, 3.0/16.0 }, { 5.0/16.0, 1.0/16.0 }, {-3.0/16.0, -5.0/16.0 }, + {-5.0/16.0, 5.0/16.0 }, {-7.0/16.0, -1.0/16.0 }, { 3.0/16.0, 7.0/16.0 }, { 7.0/16.0, -7.0/16.0 }, + }; + + static const tSamplePos pos16[] = { + { 1.0/16.0, 1.0/16.0 }, {-1.0/16.0, -3.0/16.0 }, {-3.0/16.0, 2.0/16.0 }, { 4.0/16.0, -1.0/16.0 }, + {-5.0/16.0, -2.0/16.0 }, { 2.0/16.0, 5.0/16.0 }, { 5.0/16.0, 3.0/16.0 }, { 3.0/16.0, -5.0/16.0 }, + {-2.0/16.0, 6.0/16.0 }, { 0.0/16.0, -7.0/16.0 }, {-4.0/16.0, -6.0/16.0 }, {-6.0/16.0, 4.0/16.0 }, + {-8.0/16.0, 0.0/16.0 }, { 7.0/16.0, -4.0/16.0 }, { 6.0/16.0, 7.0/16.0 }, {-7.0/16.0, -8.0/16.0 }, + }; + + const tSamplePos* sampleLoc = nullptr; + int numSamples = count; + + switch (count) { + case 2: sampleLoc = pos2; break; + case 4: sampleLoc = pos4; break; + case 8: sampleLoc = pos8; break; + case 16: sampleLoc = pos16; break; + default: + sampleLoc = pos1; + numSamples = 1; + } + + TConstUnionArray* values = new TConstUnionArray(numSamples*2); + + for (int pos=0; posaddInnerSize(numSamples); + retType.transferArraySizes(arraySizes); + } + + return new TIntermConstantUnion(*values, retType); +} + +// +// Decompose DX9 and DX10 sample intrinsics & object methods into AST +// +void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermTyped*& node, TIntermNode* arguments) +{ + if (node == nullptr || !node->getAsOperator()) + return; + + // Sampler return must always be a vec4, but we can construct a shorter vector or a structure from it. + const auto convertReturn = [&loc, &node, this](TIntermTyped* result, const TSampler& sampler) -> TIntermTyped* { + result->setType(TType(node->getType().getBasicType(), EvqTemporary, node->getVectorSize())); + + TIntermTyped* convertedResult = nullptr; + + TType retType; + getTextureReturnType(sampler, retType); + + if (retType.isStruct()) { + // For type convenience, conversionAggregate points to the convertedResult (we know it's an aggregate here) + TIntermAggregate* conversionAggregate = new TIntermAggregate; + convertedResult = conversionAggregate; + + // Convert vector output to return structure. We will need a temp symbol to copy the results to. + TVariable* structVar = makeInternalVariable("@sampleStructTemp", retType); + + // We also need a temp symbol to hold the result of the texture. We don't want to re-fetch the + // sample each time we'll index into the result, so we'll copy to this, and index into the copy. + TVariable* sampleShadow = makeInternalVariable("@sampleResultShadow", result->getType()); + + // Initial copy from texture to our sample result shadow. + TIntermTyped* shadowCopy = intermediate.addAssign(EOpAssign, intermediate.addSymbol(*sampleShadow, loc), + result, loc); + + conversionAggregate->getSequence().push_back(shadowCopy); + + unsigned vec4Pos = 0; + + for (unsigned m = 0; m < unsigned(retType.getStruct()->size()); ++m) { + const TType memberType(retType, m); // dereferenced type of the member we're about to assign. + + // Check for bad struct members. This should have been caught upstream. Complain, because + // wwe don't know what to do with it. This algorithm could be generalized to handle + // other things, e.g, sub-structures, but HLSL doesn't allow them. + if (!memberType.isVector() && !memberType.isScalar()) { + error(loc, "expected: scalar or vector type in texture structure", "", ""); + return nullptr; + } + + // Index into the struct variable to find the member to assign. + TIntermTyped* structMember = intermediate.addIndex(EOpIndexDirectStruct, + intermediate.addSymbol(*structVar, loc), + intermediate.addConstantUnion(m, loc), loc); + + structMember->setType(memberType); + + // Assign each component of (possible) vector in struct member. + for (int component = 0; component < memberType.getVectorSize(); ++component) { + TIntermTyped* vec4Member = intermediate.addIndex(EOpIndexDirect, + intermediate.addSymbol(*sampleShadow, loc), + intermediate.addConstantUnion(vec4Pos++, loc), loc); + vec4Member->setType(TType(memberType.getBasicType(), EvqTemporary, 1)); + + TIntermTyped* memberAssign = nullptr; + + if (memberType.isVector()) { + // Vector member: we need to create an access chain to the vector component. + + TIntermTyped* structVecComponent = intermediate.addIndex(EOpIndexDirect, structMember, + intermediate.addConstantUnion(component, loc), loc); + + memberAssign = intermediate.addAssign(EOpAssign, structVecComponent, vec4Member, loc); + } else { + // Scalar member: we can assign to it directly. + memberAssign = intermediate.addAssign(EOpAssign, structMember, vec4Member, loc); + } + + + conversionAggregate->getSequence().push_back(memberAssign); + } + } + + // Add completed variable so the expression results in the whole struct value we just built. + conversionAggregate->getSequence().push_back(intermediate.addSymbol(*structVar, loc)); + + // Make it a sequence. + intermediate.setAggregateOperator(conversionAggregate, EOpSequence, retType, loc); + } else { + // vector clamp the output if template vector type is smaller than sample result. + if (retType.getVectorSize() < node->getVectorSize()) { + // Too many components. Construct shorter vector from it. + const TOperator op = intermediate.mapTypeToConstructorOp(retType); + + convertedResult = constructBuiltIn(retType, op, result, loc, false); + } else { + // Enough components. Use directly. + convertedResult = result; + } + } + + convertedResult->setLoc(loc); + return convertedResult; + }; + + const TOperator op = node->getAsOperator()->getOp(); + const TIntermAggregate* argAggregate = arguments ? arguments->getAsAggregate() : nullptr; + + // Bail out if not a sampler method. + // Note though this is odd to do before checking the op, because the op + // could be something that takes the arguments, and the function in question + // takes the result of the op. So, this is not the final word. + if (arguments != nullptr) { + if (argAggregate == nullptr) { + if (arguments->getAsTyped()->getBasicType() != EbtSampler) + return; + } else { + if (argAggregate->getSequence().size() == 0 || + argAggregate->getSequence()[0] == nullptr || + argAggregate->getSequence()[0]->getAsTyped()->getBasicType() != EbtSampler) + return; + } + } + + switch (op) { + // **** DX9 intrinsics: **** + case EOpTexture: + { + // Texture with ddx & ddy is really gradient form in HLSL + if (argAggregate->getSequence().size() == 4) + node->getAsAggregate()->setOperator(EOpTextureGrad); + + break; + } + case EOpTextureLod: //is almost EOpTextureBias (only args & operations are different) + { + TIntermTyped *argSamp = argAggregate->getSequence()[0]->getAsTyped(); // sampler + TIntermTyped *argCoord = argAggregate->getSequence()[1]->getAsTyped(); // coord + + assert(argCoord->getVectorSize() == 4); + TIntermTyped *w = intermediate.addConstantUnion(3, loc, true); + TIntermTyped *argLod = intermediate.addIndex(EOpIndexDirect, argCoord, w, loc); + + TOperator constructOp = EOpNull; + const TSampler &sampler = argSamp->getType().getSampler(); + int coordSize = 0; + + switch (sampler.dim) + { + case Esd1D: constructOp = EOpConstructFloat; coordSize = 1; break; // 1D + case Esd2D: constructOp = EOpConstructVec2; coordSize = 2; break; // 2D + case Esd3D: constructOp = EOpConstructVec3; coordSize = 3; break; // 3D + case EsdCube: constructOp = EOpConstructVec3; coordSize = 3; break; // also 3D + default: + error(loc, "unhandled DX9 texture LoD dimension", "", ""); + break; + } + + TIntermAggregate *constructCoord = new TIntermAggregate(constructOp); + constructCoord->getSequence().push_back(argCoord); + constructCoord->setLoc(loc); + constructCoord->setType(TType(argCoord->getBasicType(), EvqTemporary, coordSize)); + + TIntermAggregate *tex = new TIntermAggregate(EOpTextureLod); + tex->getSequence().push_back(argSamp); // sampler + tex->getSequence().push_back(constructCoord); // coordinate + tex->getSequence().push_back(argLod); // lod + + node = convertReturn(tex, sampler); + + break; + } + + case EOpTextureBias: + { + TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped(); // sampler + TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped(); // coord + + // HLSL puts bias in W component of coordinate. We extract it and add it to + // the argument list, instead + TIntermTyped* w = intermediate.addConstantUnion(3, loc, true); + TIntermTyped* bias = intermediate.addIndex(EOpIndexDirect, arg1, w, loc); + + TOperator constructOp = EOpNull; + const TSampler& sampler = arg0->getType().getSampler(); + + switch (sampler.dim) { + case Esd1D: constructOp = EOpConstructFloat; break; // 1D + case Esd2D: constructOp = EOpConstructVec2; break; // 2D + case Esd3D: constructOp = EOpConstructVec3; break; // 3D + case EsdCube: constructOp = EOpConstructVec3; break; // also 3D + default: + error(loc, "unhandled DX9 texture bias dimension", "", ""); + break; + } + + TIntermAggregate* constructCoord = new TIntermAggregate(constructOp); + constructCoord->getSequence().push_back(arg1); + constructCoord->setLoc(loc); + + // The input vector should never be less than 2, since there's always a bias. + // The max is for safety, and should be a no-op. + constructCoord->setType(TType(arg1->getBasicType(), EvqTemporary, std::max(arg1->getVectorSize() - 1, 0))); + + TIntermAggregate* tex = new TIntermAggregate(EOpTexture); + tex->getSequence().push_back(arg0); // sampler + tex->getSequence().push_back(constructCoord); // coordinate + tex->getSequence().push_back(bias); // bias + + node = convertReturn(tex, sampler); + + break; + } + + // **** DX10 methods: **** + case EOpMethodSample: // fall through + case EOpMethodSampleBias: // ... + { + TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped(); + TIntermTyped* argSamp = argAggregate->getSequence()[1]->getAsTyped(); + TIntermTyped* argCoord = argAggregate->getSequence()[2]->getAsTyped(); + TIntermTyped* argBias = nullptr; + TIntermTyped* argOffset = nullptr; + const TSampler& sampler = argTex->getType().getSampler(); + + int nextArg = 3; + + if (op == EOpMethodSampleBias) // SampleBias has a bias arg + argBias = argAggregate->getSequence()[nextArg++]->getAsTyped(); + + TOperator textureOp = EOpTexture; + + if ((int)argAggregate->getSequence().size() == (nextArg+1)) { // last parameter is offset form + textureOp = EOpTextureOffset; + argOffset = argAggregate->getSequence()[nextArg++]->getAsTyped(); + } + + TIntermAggregate* txcombine = handleSamplerTextureCombine(loc, argTex, argSamp); + + TIntermAggregate* txsample = new TIntermAggregate(textureOp); + txsample->getSequence().push_back(txcombine); + txsample->getSequence().push_back(argCoord); + + if (argOffset != nullptr) + txsample->getSequence().push_back(argOffset); + + if (argBias != nullptr) + txsample->getSequence().push_back(argBias); + + node = convertReturn(txsample, sampler); + + break; + } + + case EOpMethodSampleGrad: // ... + { + TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped(); + TIntermTyped* argSamp = argAggregate->getSequence()[1]->getAsTyped(); + TIntermTyped* argCoord = argAggregate->getSequence()[2]->getAsTyped(); + TIntermTyped* argDDX = argAggregate->getSequence()[3]->getAsTyped(); + TIntermTyped* argDDY = argAggregate->getSequence()[4]->getAsTyped(); + TIntermTyped* argOffset = nullptr; + const TSampler& sampler = argTex->getType().getSampler(); + + TOperator textureOp = EOpTextureGrad; + + if (argAggregate->getSequence().size() == 6) { // last parameter is offset form + textureOp = EOpTextureGradOffset; + argOffset = argAggregate->getSequence()[5]->getAsTyped(); + } + + TIntermAggregate* txcombine = handleSamplerTextureCombine(loc, argTex, argSamp); + + TIntermAggregate* txsample = new TIntermAggregate(textureOp); + txsample->getSequence().push_back(txcombine); + txsample->getSequence().push_back(argCoord); + txsample->getSequence().push_back(argDDX); + txsample->getSequence().push_back(argDDY); + + if (argOffset != nullptr) + txsample->getSequence().push_back(argOffset); + + node = convertReturn(txsample, sampler); + + break; + } + + case EOpMethodGetDimensions: + { + // AST returns a vector of results, which we break apart component-wise into + // separate values to assign to the HLSL method's outputs, ala: + // tx . GetDimensions(width, height); + // float2 sizeQueryTemp = EOpTextureQuerySize + // width = sizeQueryTemp.X; + // height = sizeQueryTemp.Y; + + TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped(); + const TType& texType = argTex->getType(); + + assert(texType.getBasicType() == EbtSampler); + + const TSampler& sampler = texType.getSampler(); + const TSamplerDim dim = sampler.dim; + const bool isImage = sampler.isImage(); + const bool isMs = sampler.isMultiSample(); + const int numArgs = (int)argAggregate->getSequence().size(); + + int numDims = 0; + + switch (dim) { + case Esd1D: numDims = 1; break; // W + case Esd2D: numDims = 2; break; // W, H + case Esd3D: numDims = 3; break; // W, H, D + case EsdCube: numDims = 2; break; // W, H (cube) + case EsdBuffer: numDims = 1; break; // W (buffers) + case EsdRect: numDims = 2; break; // W, H (rect) + default: + error(loc, "unhandled DX10 MethodGet dimension", "", ""); + break; + } + + // Arrayed adds another dimension for the number of array elements + if (sampler.isArrayed()) + ++numDims; + + // Establish whether the method itself is querying mip levels. This can be false even + // if the underlying query requires a MIP level, due to the available HLSL method overloads. + const bool mipQuery = (numArgs > (numDims + 1 + (isMs ? 1 : 0))); + + // Establish whether we must use the LOD form of query (even if the method did not supply a mip level to query). + // True if: + // 1. 1D/2D/3D/Cube AND multisample==0 AND NOT image (those can be sent to the non-LOD query) + // or, + // 2. There is a LOD (because the non-LOD query cannot be used in that case, per spec) + const bool mipRequired = + ((dim == Esd1D || dim == Esd2D || dim == Esd3D || dim == EsdCube) && !isMs && !isImage) || // 1... + mipQuery; // 2... + + // AST assumes integer return. Will be converted to float if required. + TIntermAggregate* sizeQuery = new TIntermAggregate(isImage ? EOpImageQuerySize : EOpTextureQuerySize); + sizeQuery->getSequence().push_back(argTex); + + // If we're building an LOD query, add the LOD. + if (mipRequired) { + // If the base HLSL query had no MIP level given, use level 0. + TIntermTyped* queryLod = mipQuery ? argAggregate->getSequence()[1]->getAsTyped() : + intermediate.addConstantUnion(0, loc, true); + sizeQuery->getSequence().push_back(queryLod); + } + + sizeQuery->setType(TType(EbtUint, EvqTemporary, numDims)); + sizeQuery->setLoc(loc); + + // Return value from size query + TVariable* tempArg = makeInternalVariable("sizeQueryTemp", sizeQuery->getType()); + tempArg->getWritableType().getQualifier().makeTemporary(); + TIntermTyped* sizeQueryAssign = intermediate.addAssign(EOpAssign, + intermediate.addSymbol(*tempArg, loc), + sizeQuery, loc); + + // Compound statement for assigning outputs + TIntermAggregate* compoundStatement = intermediate.makeAggregate(sizeQueryAssign, loc); + // Index of first output parameter + const int outParamBase = mipQuery ? 2 : 1; + + for (int compNum = 0; compNum < numDims; ++compNum) { + TIntermTyped* indexedOut = nullptr; + TIntermSymbol* sizeQueryReturn = intermediate.addSymbol(*tempArg, loc); + + if (numDims > 1) { + TIntermTyped* component = intermediate.addConstantUnion(compNum, loc, true); + indexedOut = intermediate.addIndex(EOpIndexDirect, sizeQueryReturn, component, loc); + indexedOut->setType(TType(EbtUint, EvqTemporary, 1)); + indexedOut->setLoc(loc); + } else { + indexedOut = sizeQueryReturn; + } + + TIntermTyped* outParam = argAggregate->getSequence()[outParamBase + compNum]->getAsTyped(); + TIntermTyped* compAssign = intermediate.addAssign(EOpAssign, outParam, indexedOut, loc); + + compoundStatement = intermediate.growAggregate(compoundStatement, compAssign); + } + + // handle mip level parameter + if (mipQuery) { + TIntermTyped* outParam = argAggregate->getSequence()[outParamBase + numDims]->getAsTyped(); + + TIntermAggregate* levelsQuery = new TIntermAggregate(EOpTextureQueryLevels); + levelsQuery->getSequence().push_back(argTex); + levelsQuery->setType(TType(EbtUint, EvqTemporary, 1)); + levelsQuery->setLoc(loc); + + TIntermTyped* compAssign = intermediate.addAssign(EOpAssign, outParam, levelsQuery, loc); + compoundStatement = intermediate.growAggregate(compoundStatement, compAssign); + } + + // 2DMS formats query # samples, which needs a different query op + if (sampler.isMultiSample()) { + TIntermTyped* outParam = argAggregate->getSequence()[outParamBase + numDims]->getAsTyped(); + + TIntermAggregate* samplesQuery = new TIntermAggregate(EOpImageQuerySamples); + samplesQuery->getSequence().push_back(argTex); + samplesQuery->setType(TType(EbtUint, EvqTemporary, 1)); + samplesQuery->setLoc(loc); + + TIntermTyped* compAssign = intermediate.addAssign(EOpAssign, outParam, samplesQuery, loc); + compoundStatement = intermediate.growAggregate(compoundStatement, compAssign); + } + + compoundStatement->setOperator(EOpSequence); + compoundStatement->setLoc(loc); + compoundStatement->setType(TType(EbtVoid)); + + node = compoundStatement; + + break; + } + + case EOpMethodSampleCmp: // fall through... + case EOpMethodSampleCmpLevelZero: + { + TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped(); + TIntermTyped* argSamp = argAggregate->getSequence()[1]->getAsTyped(); + TIntermTyped* argCoord = argAggregate->getSequence()[2]->getAsTyped(); + TIntermTyped* argCmpVal = argAggregate->getSequence()[3]->getAsTyped(); + TIntermTyped* argOffset = nullptr; + + // Sampler argument should be a sampler. + if (argSamp->getType().getBasicType() != EbtSampler) { + error(loc, "expected: sampler type", "", ""); + return; + } + + // Sampler should be a SamplerComparisonState + if (! argSamp->getType().getSampler().isShadow()) { + error(loc, "expected: SamplerComparisonState", "", ""); + return; + } + + // optional offset value + if (argAggregate->getSequence().size() > 4) + argOffset = argAggregate->getSequence()[4]->getAsTyped(); + + const int coordDimWithCmpVal = argCoord->getType().getVectorSize() + 1; // +1 for cmp + + // AST wants comparison value as one of the texture coordinates + TOperator constructOp = EOpNull; + switch (coordDimWithCmpVal) { + // 1D can't happen: there's always at least 1 coordinate dimension + 1 cmp val + case 2: constructOp = EOpConstructVec2; break; + case 3: constructOp = EOpConstructVec3; break; + case 4: constructOp = EOpConstructVec4; break; + case 5: constructOp = EOpConstructVec4; break; // cubeArrayShadow, cmp value is separate arg. + default: + error(loc, "unhandled DX10 MethodSample dimension", "", ""); + break; + } + + TIntermAggregate* coordWithCmp = new TIntermAggregate(constructOp); + coordWithCmp->getSequence().push_back(argCoord); + if (coordDimWithCmpVal != 5) // cube array shadow is special. + coordWithCmp->getSequence().push_back(argCmpVal); + coordWithCmp->setLoc(loc); + coordWithCmp->setType(TType(argCoord->getBasicType(), EvqTemporary, std::min(coordDimWithCmpVal, 4))); + + TOperator textureOp = (op == EOpMethodSampleCmpLevelZero ? EOpTextureLod : EOpTexture); + if (argOffset != nullptr) + textureOp = (op == EOpMethodSampleCmpLevelZero ? EOpTextureLodOffset : EOpTextureOffset); + + // Create combined sampler & texture op + TIntermAggregate* txcombine = handleSamplerTextureCombine(loc, argTex, argSamp); + TIntermAggregate* txsample = new TIntermAggregate(textureOp); + txsample->getSequence().push_back(txcombine); + txsample->getSequence().push_back(coordWithCmp); + + if (coordDimWithCmpVal == 5) // cube array shadow is special: cmp val follows coord. + txsample->getSequence().push_back(argCmpVal); + + // the LevelZero form uses 0 as an explicit LOD + if (op == EOpMethodSampleCmpLevelZero) + txsample->getSequence().push_back(intermediate.addConstantUnion(0.0, EbtFloat, loc, true)); + + // Add offset if present + if (argOffset != nullptr) + txsample->getSequence().push_back(argOffset); + + txsample->setType(node->getType()); + txsample->setLoc(loc); + node = txsample; + + break; + } + + case EOpMethodLoad: + { + TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped(); + TIntermTyped* argCoord = argAggregate->getSequence()[1]->getAsTyped(); + TIntermTyped* argOffset = nullptr; + TIntermTyped* lodComponent = nullptr; + TIntermTyped* coordSwizzle = nullptr; + + const TSampler& sampler = argTex->getType().getSampler(); + const bool isMS = sampler.isMultiSample(); + const bool isBuffer = sampler.dim == EsdBuffer; + const bool isImage = sampler.isImage(); + const TBasicType coordBaseType = argCoord->getType().getBasicType(); + + // Last component of coordinate is the mip level, for non-MS. we separate them here: + if (isMS || isBuffer || isImage) { + // MS, Buffer, and Image have no LOD + coordSwizzle = argCoord; + } else { + // Extract coordinate + int swizzleSize = argCoord->getType().getVectorSize() - (isMS ? 0 : 1); + TSwizzleSelectors coordFields; + for (int i = 0; i < swizzleSize; ++i) + coordFields.push_back(i); + TIntermTyped* coordIdx = intermediate.addSwizzle(coordFields, loc); + coordSwizzle = intermediate.addIndex(EOpVectorSwizzle, argCoord, coordIdx, loc); + coordSwizzle->setType(TType(coordBaseType, EvqTemporary, coordFields.size())); + + // Extract LOD + TIntermTyped* lodIdx = intermediate.addConstantUnion(coordFields.size(), loc, true); + lodComponent = intermediate.addIndex(EOpIndexDirect, argCoord, lodIdx, loc); + lodComponent->setType(TType(coordBaseType, EvqTemporary, 1)); + } + + const int numArgs = (int)argAggregate->getSequence().size(); + const bool hasOffset = ((!isMS && numArgs == 3) || (isMS && numArgs == 4)); + + // Create texel fetch + const TOperator fetchOp = (isImage ? EOpImageLoad : + hasOffset ? EOpTextureFetchOffset : + EOpTextureFetch); + TIntermAggregate* txfetch = new TIntermAggregate(fetchOp); + + // Build up the fetch + txfetch->getSequence().push_back(argTex); + txfetch->getSequence().push_back(coordSwizzle); + + if (isMS) { + // add 2DMS sample index + TIntermTyped* argSampleIdx = argAggregate->getSequence()[2]->getAsTyped(); + txfetch->getSequence().push_back(argSampleIdx); + } else if (isBuffer) { + // Nothing else to do for buffers. + } else if (isImage) { + // Nothing else to do for images. + } else { + // 2DMS and buffer have no LOD, but everything else does. + txfetch->getSequence().push_back(lodComponent); + } + + // Obtain offset arg, if there is one. + if (hasOffset) { + const int offsetPos = (isMS ? 3 : 2); + argOffset = argAggregate->getSequence()[offsetPos]->getAsTyped(); + txfetch->getSequence().push_back(argOffset); + } + + node = convertReturn(txfetch, sampler); + + break; + } + + case EOpMethodSampleLevel: + { + TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped(); + TIntermTyped* argSamp = argAggregate->getSequence()[1]->getAsTyped(); + TIntermTyped* argCoord = argAggregate->getSequence()[2]->getAsTyped(); + TIntermTyped* argLod = argAggregate->getSequence()[3]->getAsTyped(); + TIntermTyped* argOffset = nullptr; + const TSampler& sampler = argTex->getType().getSampler(); + + const int numArgs = (int)argAggregate->getSequence().size(); + + if (numArgs == 5) // offset, if present + argOffset = argAggregate->getSequence()[4]->getAsTyped(); + + const TOperator textureOp = (argOffset == nullptr ? EOpTextureLod : EOpTextureLodOffset); + TIntermAggregate* txsample = new TIntermAggregate(textureOp); + + TIntermAggregate* txcombine = handleSamplerTextureCombine(loc, argTex, argSamp); + + txsample->getSequence().push_back(txcombine); + txsample->getSequence().push_back(argCoord); + txsample->getSequence().push_back(argLod); + + if (argOffset != nullptr) + txsample->getSequence().push_back(argOffset); + + node = convertReturn(txsample, sampler); + + break; + } + + case EOpMethodGather: + { + TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped(); + TIntermTyped* argSamp = argAggregate->getSequence()[1]->getAsTyped(); + TIntermTyped* argCoord = argAggregate->getSequence()[2]->getAsTyped(); + TIntermTyped* argOffset = nullptr; + + // Offset is optional + if (argAggregate->getSequence().size() > 3) + argOffset = argAggregate->getSequence()[3]->getAsTyped(); + + const TOperator textureOp = (argOffset == nullptr ? EOpTextureGather : EOpTextureGatherOffset); + TIntermAggregate* txgather = new TIntermAggregate(textureOp); + + TIntermAggregate* txcombine = handleSamplerTextureCombine(loc, argTex, argSamp); + + txgather->getSequence().push_back(txcombine); + txgather->getSequence().push_back(argCoord); + // Offset if not given is implicitly channel 0 (red) + + if (argOffset != nullptr) + txgather->getSequence().push_back(argOffset); + + txgather->setType(node->getType()); + txgather->setLoc(loc); + node = txgather; + + break; + } + + case EOpMethodGatherRed: // fall through... + case EOpMethodGatherGreen: // ... + case EOpMethodGatherBlue: // ... + case EOpMethodGatherAlpha: // ... + case EOpMethodGatherCmpRed: // ... + case EOpMethodGatherCmpGreen: // ... + case EOpMethodGatherCmpBlue: // ... + case EOpMethodGatherCmpAlpha: // ... + { + int channel = 0; // the channel we are gathering + int cmpValues = 0; // 1 if there is a compare value (handier than a bool below) + + switch (op) { + case EOpMethodGatherCmpRed: cmpValues = 1; [[fallthrough]]; + case EOpMethodGatherRed: channel = 0; break; + case EOpMethodGatherCmpGreen: cmpValues = 1; [[fallthrough]]; + case EOpMethodGatherGreen: channel = 1; break; + case EOpMethodGatherCmpBlue: cmpValues = 1; [[fallthrough]]; + case EOpMethodGatherBlue: channel = 2; break; + case EOpMethodGatherCmpAlpha: cmpValues = 1; [[fallthrough]]; + case EOpMethodGatherAlpha: channel = 3; break; + default: assert(0); break; + } + + // For now, we have nothing to map the component-wise comparison forms + // to, because neither GLSL nor SPIR-V has such an opcode. Issue an + // unimplemented error instead. Most of the machinery is here if that + // should ever become available. However, red can be passed through + // to OpImageDrefGather. G/B/A cannot, because that opcode does not + // accept a component. + if (cmpValues != 0 && op != EOpMethodGatherCmpRed) { + error(loc, "unimplemented: component-level gather compare", "", ""); + return; + } + + int arg = 0; + + TIntermTyped* argTex = argAggregate->getSequence()[arg++]->getAsTyped(); + TIntermTyped* argSamp = argAggregate->getSequence()[arg++]->getAsTyped(); + TIntermTyped* argCoord = argAggregate->getSequence()[arg++]->getAsTyped(); + TIntermTyped* argOffset = nullptr; + TIntermTyped* argOffsets[4] = { nullptr, nullptr, nullptr, nullptr }; + // TIntermTyped* argStatus = nullptr; // TODO: residency + TIntermTyped* argCmp = nullptr; + + const TSamplerDim dim = argTex->getType().getSampler().dim; + + const int argSize = (int)argAggregate->getSequence().size(); + bool hasStatus = (argSize == (5+cmpValues) || argSize == (8+cmpValues)); + bool hasOffset1 = false; + bool hasOffset4 = false; + + // Sampler argument should be a sampler. + if (argSamp->getType().getBasicType() != EbtSampler) { + error(loc, "expected: sampler type", "", ""); + return; + } + + // Cmp forms require SamplerComparisonState + if (cmpValues > 0 && ! argSamp->getType().getSampler().isShadow()) { + error(loc, "expected: SamplerComparisonState", "", ""); + return; + } + + // Only 2D forms can have offsets. Discover if we have 0, 1 or 4 offsets. + if (dim == Esd2D) { + hasOffset1 = (argSize == (4+cmpValues) || argSize == (5+cmpValues)); + hasOffset4 = (argSize == (7+cmpValues) || argSize == (8+cmpValues)); + } + + assert(!(hasOffset1 && hasOffset4)); + + TOperator textureOp = EOpTextureGather; + + // Compare forms have compare value + if (cmpValues != 0) + argCmp = argOffset = argAggregate->getSequence()[arg++]->getAsTyped(); + + // Some forms have single offset + if (hasOffset1) { + textureOp = EOpTextureGatherOffset; // single offset form + argOffset = argAggregate->getSequence()[arg++]->getAsTyped(); + } + + // Some forms have 4 gather offsets + if (hasOffset4) { + textureOp = EOpTextureGatherOffsets; // note plural, for 4 offset form + for (int offsetNum = 0; offsetNum < 4; ++offsetNum) + argOffsets[offsetNum] = argAggregate->getSequence()[arg++]->getAsTyped(); + } + + // Residency status + if (hasStatus) { + // argStatus = argAggregate->getSequence()[arg++]->getAsTyped(); + error(loc, "unimplemented: residency status", "", ""); + return; + } + + TIntermAggregate* txgather = new TIntermAggregate(textureOp); + TIntermAggregate* txcombine = handleSamplerTextureCombine(loc, argTex, argSamp); + + TIntermTyped* argChannel = intermediate.addConstantUnion(channel, loc, true); + + txgather->getSequence().push_back(txcombine); + txgather->getSequence().push_back(argCoord); + + // AST wants an array of 4 offsets, where HLSL has separate args. Here + // we construct an array from the separate args. + if (hasOffset4) { + TType arrayType(EbtInt, EvqTemporary, 2); + TArraySizes* arraySizes = new TArraySizes; + arraySizes->addInnerSize(4); + arrayType.transferArraySizes(arraySizes); + + TIntermAggregate* initList = new TIntermAggregate(EOpNull); + + for (int offsetNum = 0; offsetNum < 4; ++offsetNum) + initList->getSequence().push_back(argOffsets[offsetNum]); + + argOffset = addConstructor(loc, initList, arrayType); + } + + // Add comparison value if we have one + if (argCmp != nullptr) + txgather->getSequence().push_back(argCmp); + + // Add offset (either 1, or an array of 4) if we have one + if (argOffset != nullptr) + txgather->getSequence().push_back(argOffset); + + // Add channel value if the sampler is not shadow + if (! argSamp->getType().getSampler().isShadow()) + txgather->getSequence().push_back(argChannel); + + txgather->setType(node->getType()); + txgather->setLoc(loc); + node = txgather; + + break; + } + + case EOpMethodCalculateLevelOfDetail: + case EOpMethodCalculateLevelOfDetailUnclamped: + { + TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped(); + TIntermTyped* argSamp = argAggregate->getSequence()[1]->getAsTyped(); + TIntermTyped* argCoord = argAggregate->getSequence()[2]->getAsTyped(); + + TIntermAggregate* txquerylod = new TIntermAggregate(EOpTextureQueryLod); + + TIntermAggregate* txcombine = handleSamplerTextureCombine(loc, argTex, argSamp); + txquerylod->getSequence().push_back(txcombine); + txquerylod->getSequence().push_back(argCoord); + + TIntermTyped* lodComponent = intermediate.addConstantUnion( + op == EOpMethodCalculateLevelOfDetail ? 0 : 1, + loc, true); + TIntermTyped* lodComponentIdx = intermediate.addIndex(EOpIndexDirect, txquerylod, lodComponent, loc); + lodComponentIdx->setType(TType(EbtFloat, EvqTemporary, 1)); + node = lodComponentIdx; + + break; + } + + case EOpMethodGetSamplePosition: + { + // TODO: this entire decomposition exists because there is not yet a way to query + // the sample position directly through SPIR-V. Instead, we return fixed sample + // positions for common cases. *** If the sample positions are set differently, + // this will be wrong. *** + + TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped(); + TIntermTyped* argSampIdx = argAggregate->getSequence()[1]->getAsTyped(); + + TIntermAggregate* samplesQuery = new TIntermAggregate(EOpImageQuerySamples); + samplesQuery->getSequence().push_back(argTex); + samplesQuery->setType(TType(EbtUint, EvqTemporary, 1)); + samplesQuery->setLoc(loc); + + TIntermAggregate* compoundStatement = nullptr; + + TVariable* outSampleCount = makeInternalVariable("@sampleCount", TType(EbtUint)); + outSampleCount->getWritableType().getQualifier().makeTemporary(); + TIntermTyped* compAssign = intermediate.addAssign(EOpAssign, intermediate.addSymbol(*outSampleCount, loc), + samplesQuery, loc); + compoundStatement = intermediate.growAggregate(compoundStatement, compAssign); + + TIntermTyped* idxtest[4]; + + // Create tests against 2, 4, 8, and 16 sample values + int count = 0; + for (int val = 2; val <= 16; val *= 2) + idxtest[count++] = + intermediate.addBinaryNode(EOpEqual, + intermediate.addSymbol(*outSampleCount, loc), + intermediate.addConstantUnion(val, loc), + loc, TType(EbtBool)); + + const TOperator idxOp = (argSampIdx->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect; + + // Create index ops into position arrays given sample index. + // TODO: should it be clamped? + TIntermTyped* index[4]; + count = 0; + for (int val = 2; val <= 16; val *= 2) { + index[count] = intermediate.addIndex(idxOp, getSamplePosArray(val), argSampIdx, loc); + index[count++]->setType(TType(EbtFloat, EvqTemporary, 2)); + } + + // Create expression as: + // (sampleCount == 2) ? pos2[idx] : + // (sampleCount == 4) ? pos4[idx] : + // (sampleCount == 8) ? pos8[idx] : + // (sampleCount == 16) ? pos16[idx] : float2(0,0); + TIntermTyped* test = + intermediate.addSelection(idxtest[0], index[0], + intermediate.addSelection(idxtest[1], index[1], + intermediate.addSelection(idxtest[2], index[2], + intermediate.addSelection(idxtest[3], index[3], + getSamplePosArray(1), loc), loc), loc), loc); + + compoundStatement = intermediate.growAggregate(compoundStatement, test); + compoundStatement->setOperator(EOpSequence); + compoundStatement->setLoc(loc); + compoundStatement->setType(TType(EbtFloat, EvqTemporary, 2)); + + node = compoundStatement; + + break; + } + + case EOpSubpassLoad: + { + const TIntermTyped* argSubpass = + argAggregate ? argAggregate->getSequence()[0]->getAsTyped() : + arguments->getAsTyped(); + + const TSampler& sampler = argSubpass->getType().getSampler(); + + // subpass load: the multisample form is overloaded. Here, we convert that to + // the EOpSubpassLoadMS opcode. + if (argAggregate != nullptr && argAggregate->getSequence().size() > 1) + node->getAsOperator()->setOp(EOpSubpassLoadMS); + + node = convertReturn(node, sampler); + + break; + } + + + default: + break; // most pass through unchanged + } +} + +// +// Decompose geometry shader methods +// +void HlslParseContext::decomposeGeometryMethods(const TSourceLoc& loc, TIntermTyped*& node, TIntermNode* arguments) +{ + if (node == nullptr || !node->getAsOperator()) + return; + + const TOperator op = node->getAsOperator()->getOp(); + const TIntermAggregate* argAggregate = arguments ? arguments->getAsAggregate() : nullptr; + + switch (op) { + case EOpMethodAppend: + if (argAggregate) { + // Don't emit these for non-GS stage, since we won't have the gsStreamOutput symbol. + if (language != EShLangGeometry) { + node = nullptr; + return; + } + + TIntermAggregate* sequence = nullptr; + TIntermAggregate* emit = new TIntermAggregate(EOpEmitVertex); + + emit->setLoc(loc); + emit->setType(TType(EbtVoid)); + + TIntermTyped* data = argAggregate->getSequence()[1]->getAsTyped(); + + // This will be patched in finalization during finalizeAppendMethods() + sequence = intermediate.growAggregate(sequence, data, loc); + sequence = intermediate.growAggregate(sequence, emit); + + sequence->setOperator(EOpSequence); + sequence->setLoc(loc); + sequence->setType(TType(EbtVoid)); + + gsAppends.push_back({sequence, loc}); + + node = sequence; + } + break; + + case EOpMethodRestartStrip: + { + // Don't emit these for non-GS stage, since we won't have the gsStreamOutput symbol. + if (language != EShLangGeometry) { + node = nullptr; + return; + } + + TIntermAggregate* cut = new TIntermAggregate(EOpEndPrimitive); + cut->setLoc(loc); + cut->setType(TType(EbtVoid)); + node = cut; + } + break; + + default: + break; // most pass through unchanged + } +} + +// +// Optionally decompose intrinsics to AST opcodes. +// +void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*& node, TIntermNode* arguments) +{ + // Helper to find image data for image atomics: + // OpImageLoad(image[idx]) + // We take the image load apart and add its params to the atomic op aggregate node + const auto imageAtomicParams = [this, &loc, &node](TIntermAggregate* atomic, TIntermTyped* load) { + TIntermAggregate* loadOp = load->getAsAggregate(); + if (loadOp == nullptr) { + error(loc, "unknown image type in atomic operation", "", ""); + node = nullptr; + return; + } + + atomic->getSequence().push_back(loadOp->getSequence()[0]); + atomic->getSequence().push_back(loadOp->getSequence()[1]); + }; + + // Return true if this is an imageLoad, which we will change to an image atomic. + const auto isImageParam = [](TIntermTyped* image) -> bool { + TIntermAggregate* imageAggregate = image->getAsAggregate(); + return imageAggregate != nullptr && imageAggregate->getOp() == EOpImageLoad; + }; + + const auto lookupBuiltinVariable = [&](const char* name, TBuiltInVariable builtin, TType& type) -> TIntermTyped* { + TSymbol* symbol = symbolTable.find(name); + if (nullptr == symbol) { + type.getQualifier().builtIn = builtin; + + TVariable* variable = new TVariable(NewPoolTString(name), type); + + symbolTable.insert(*variable); + + symbol = symbolTable.find(name); + assert(symbol && "Inserted symbol could not be found!"); + } + + return intermediate.addSymbol(*(symbol->getAsVariable()), loc); + }; + + // HLSL intrinsics can be pass through to native AST opcodes, or decomposed here to existing AST + // opcodes for compatibility with existing software stacks. + static const bool decomposeHlslIntrinsics = true; + + if (!decomposeHlslIntrinsics || !node || !node->getAsOperator()) + return; + + const TIntermAggregate* argAggregate = arguments ? arguments->getAsAggregate() : nullptr; + TIntermUnary* fnUnary = node->getAsUnaryNode(); + const TOperator op = node->getAsOperator()->getOp(); + + switch (op) { + case EOpGenMul: + { + // mul(a,b) -> MatrixTimesMatrix, MatrixTimesVector, MatrixTimesScalar, VectorTimesScalar, Dot, Mul + // Since we are treating HLSL rows like GLSL columns (the first matrix indirection), + // we must reverse the operand order here. Hence, arg0 gets sequence[1], etc. + TIntermTyped* arg0 = argAggregate->getSequence()[1]->getAsTyped(); + TIntermTyped* arg1 = argAggregate->getSequence()[0]->getAsTyped(); + + if (arg0->isVector() && arg1->isVector()) { // vec * vec + node->getAsAggregate()->setOperator(EOpDot); + } else { + node = handleBinaryMath(loc, "mul", EOpMul, arg0, arg1); + } + + break; + } + + case EOpRcp: + { + // rcp(a) -> 1 / a + TIntermTyped* arg0 = fnUnary->getOperand(); + TBasicType type0 = arg0->getBasicType(); + TIntermTyped* one = intermediate.addConstantUnion(1, type0, loc, true); + node = handleBinaryMath(loc, "rcp", EOpDiv, one, arg0); + + break; + } + + case EOpAny: // fall through + case EOpAll: + { + TIntermTyped* typedArg = arguments->getAsTyped(); + + // HLSL allows float/etc types here, and the SPIR-V opcode requires a bool. + // We'll convert here. Note that for efficiency, we could add a smarter + // decomposition for some type cases, e.g, maybe by decomposing a dot product. + if (typedArg->getType().getBasicType() != EbtBool) { + const TType boolType(EbtBool, EvqTemporary, + typedArg->getVectorSize(), + typedArg->getMatrixCols(), + typedArg->getMatrixRows(), + typedArg->isVector()); + + typedArg = intermediate.addConversion(EOpConstructBool, boolType, typedArg); + node->getAsUnaryNode()->setOperand(typedArg); + } + + break; + } + + case EOpSaturate: + { + // saturate(a) -> clamp(a,0,1) + TIntermTyped* arg0 = fnUnary->getOperand(); + TBasicType type0 = arg0->getBasicType(); + TIntermAggregate* clamp = new TIntermAggregate(EOpClamp); + + clamp->getSequence().push_back(arg0); + clamp->getSequence().push_back(intermediate.addConstantUnion(0, type0, loc, true)); + clamp->getSequence().push_back(intermediate.addConstantUnion(1, type0, loc, true)); + clamp->setLoc(loc); + clamp->setType(node->getType()); + clamp->getWritableType().getQualifier().makeTemporary(); + node = clamp; + + break; + } + + case EOpSinCos: + { + // sincos(a,b,c) -> b = sin(a), c = cos(a) + TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped(); + TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped(); + TIntermTyped* arg2 = argAggregate->getSequence()[2]->getAsTyped(); + + TIntermTyped* sinStatement = handleUnaryMath(loc, "sin", EOpSin, arg0); + TIntermTyped* cosStatement = handleUnaryMath(loc, "cos", EOpCos, arg0); + TIntermTyped* sinAssign = intermediate.addAssign(EOpAssign, arg1, sinStatement, loc); + TIntermTyped* cosAssign = intermediate.addAssign(EOpAssign, arg2, cosStatement, loc); + + TIntermAggregate* compoundStatement = intermediate.makeAggregate(sinAssign, loc); + compoundStatement = intermediate.growAggregate(compoundStatement, cosAssign); + compoundStatement->setOperator(EOpSequence); + compoundStatement->setLoc(loc); + compoundStatement->setType(TType(EbtVoid)); + + node = compoundStatement; + + break; + } + + case EOpClip: + { + // clip(a) -> if (any(a<0)) discard; + TIntermTyped* arg0 = fnUnary->getOperand(); + TBasicType type0 = arg0->getBasicType(); + TIntermTyped* compareNode = nullptr; + + // For non-scalars: per experiment with FXC compiler, discard if any component < 0. + if (!arg0->isScalar()) { + // component-wise compare: a < 0 + TIntermAggregate* less = new TIntermAggregate(EOpLessThan); + less->getSequence().push_back(arg0); + less->setLoc(loc); + + // make vec or mat of bool matching dimensions of input + less->setType(TType(EbtBool, EvqTemporary, + arg0->getType().getVectorSize(), + arg0->getType().getMatrixCols(), + arg0->getType().getMatrixRows(), + arg0->getType().isVector())); + + // calculate # of components for comparison const + const int constComponentCount = + std::max(arg0->getType().getVectorSize(), 1) * + std::max(arg0->getType().getMatrixCols(), 1) * + std::max(arg0->getType().getMatrixRows(), 1); + + TConstUnion zero; + if (arg0->getType().isIntegerDomain()) + zero.setDConst(0); + else + zero.setDConst(0.0); + TConstUnionArray zeros(constComponentCount, zero); + + less->getSequence().push_back(intermediate.addConstantUnion(zeros, arg0->getType(), loc, true)); + + compareNode = intermediate.addBuiltInFunctionCall(loc, EOpAny, true, less, TType(EbtBool)); + } else { + TIntermTyped* zero; + if (arg0->getType().isIntegerDomain()) + zero = intermediate.addConstantUnion(0, loc, true); + else + zero = intermediate.addConstantUnion(0.0, type0, loc, true); + compareNode = handleBinaryMath(loc, "clip", EOpLessThan, arg0, zero); + } + + TIntermBranch* killNode = intermediate.addBranch(EOpKill, loc); + + node = new TIntermSelection(compareNode, killNode, nullptr); + node->setLoc(loc); + + break; + } + + case EOpLog10: + { + // log10(a) -> log2(a) * 0.301029995663981 (== 1/log2(10)) + TIntermTyped* arg0 = fnUnary->getOperand(); + TIntermTyped* log2 = handleUnaryMath(loc, "log2", EOpLog2, arg0); + TIntermTyped* base = intermediate.addConstantUnion(0.301029995663981f, EbtFloat, loc, true); + + node = handleBinaryMath(loc, "mul", EOpMul, log2, base); + + break; + } + + case EOpDst: + { + // dest.x = 1; + // dest.y = src0.y * src1.y; + // dest.z = src0.z; + // dest.w = src1.w; + + TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped(); + TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped(); + + TIntermTyped* y = intermediate.addConstantUnion(1, loc, true); + TIntermTyped* z = intermediate.addConstantUnion(2, loc, true); + TIntermTyped* w = intermediate.addConstantUnion(3, loc, true); + + TIntermTyped* src0y = intermediate.addIndex(EOpIndexDirect, arg0, y, loc); + TIntermTyped* src1y = intermediate.addIndex(EOpIndexDirect, arg1, y, loc); + TIntermTyped* src0z = intermediate.addIndex(EOpIndexDirect, arg0, z, loc); + TIntermTyped* src1w = intermediate.addIndex(EOpIndexDirect, arg1, w, loc); + + TIntermAggregate* dst = new TIntermAggregate(EOpConstructVec4); + + dst->getSequence().push_back(intermediate.addConstantUnion(1.0, EbtFloat, loc, true)); + dst->getSequence().push_back(handleBinaryMath(loc, "mul", EOpMul, src0y, src1y)); + dst->getSequence().push_back(src0z); + dst->getSequence().push_back(src1w); + dst->setType(TType(EbtFloat, EvqTemporary, 4)); + dst->setLoc(loc); + node = dst; + + break; + } + + case EOpInterlockedAdd: // optional last argument (if present) is assigned from return value + case EOpInterlockedMin: // ... + case EOpInterlockedMax: // ... + case EOpInterlockedAnd: // ... + case EOpInterlockedOr: // ... + case EOpInterlockedXor: // ... + case EOpInterlockedExchange: // always has output arg + { + TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped(); // dest + TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped(); // value + TIntermTyped* arg2 = nullptr; + + if (argAggregate->getSequence().size() > 2) + arg2 = argAggregate->getSequence()[2]->getAsTyped(); + + const bool isImage = isImageParam(arg0); + const TOperator atomicOp = mapAtomicOp(loc, op, isImage); + TIntermAggregate* atomic = new TIntermAggregate(atomicOp); + atomic->setType(arg0->getType()); + atomic->getWritableType().getQualifier().makeTemporary(); + atomic->setLoc(loc); + + if (isImage) { + // orig_value = imageAtomicOp(image, loc, data) + imageAtomicParams(atomic, arg0); + atomic->getSequence().push_back(arg1); + + if (argAggregate->getSequence().size() > 2) { + node = intermediate.addAssign(EOpAssign, arg2, atomic, loc); + } else { + node = atomic; // no assignment needed, as there was no out var. + } + } else { + // Normal memory variable: + // arg0 = mem, arg1 = data, arg2(optional,out) = orig_value + if (argAggregate->getSequence().size() > 2) { + // optional output param is present. return value goes to arg2. + atomic->getSequence().push_back(arg0); + atomic->getSequence().push_back(arg1); + + node = intermediate.addAssign(EOpAssign, arg2, atomic, loc); + } else { + // Set the matching operator. Since output is absent, this is all we need to do. + node->getAsAggregate()->setOperator(atomicOp); + node->setType(atomic->getType()); + } + } + + break; + } + + case EOpInterlockedCompareExchange: + { + TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped(); // dest + TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped(); // cmp + TIntermTyped* arg2 = argAggregate->getSequence()[2]->getAsTyped(); // value + TIntermTyped* arg3 = argAggregate->getSequence()[3]->getAsTyped(); // orig + + const bool isImage = isImageParam(arg0); + TIntermAggregate* atomic = new TIntermAggregate(mapAtomicOp(loc, op, isImage)); + atomic->setLoc(loc); + atomic->setType(arg2->getType()); + atomic->getWritableType().getQualifier().makeTemporary(); + + if (isImage) { + imageAtomicParams(atomic, arg0); + } else { + atomic->getSequence().push_back(arg0); + } + + atomic->getSequence().push_back(arg1); + atomic->getSequence().push_back(arg2); + node = intermediate.addAssign(EOpAssign, arg3, atomic, loc); + + break; + } + + case EOpEvaluateAttributeSnapped: + { + // SPIR-V InterpolateAtOffset uses float vec2 offset in pixels + // HLSL uses int2 offset on a 16x16 grid in [-8..7] on x & y: + // iU = (iU<<28)>>28 + // fU = ((float)iU)/16 + // Targets might handle this natively, in which case they can disable + // decompositions. + + TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped(); // value + TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped(); // offset + + TIntermTyped* i28 = intermediate.addConstantUnion(28, loc, true); + TIntermTyped* iU = handleBinaryMath(loc, ">>", EOpRightShift, + handleBinaryMath(loc, "<<", EOpLeftShift, arg1, i28), + i28); + + TIntermTyped* recip16 = intermediate.addConstantUnion((1.0/16.0), EbtFloat, loc, true); + TIntermTyped* floatOffset = handleBinaryMath(loc, "mul", EOpMul, + intermediate.addConversion(EOpConstructFloat, + TType(EbtFloat, EvqTemporary, 2), iU), + recip16); + + TIntermAggregate* interp = new TIntermAggregate(EOpInterpolateAtOffset); + interp->getSequence().push_back(arg0); + interp->getSequence().push_back(floatOffset); + interp->setLoc(loc); + interp->setType(arg0->getType()); + interp->getWritableType().getQualifier().makeTemporary(); + + node = interp; + + break; + } + + case EOpLit: + { + TIntermTyped* n_dot_l = argAggregate->getSequence()[0]->getAsTyped(); + TIntermTyped* n_dot_h = argAggregate->getSequence()[1]->getAsTyped(); + TIntermTyped* m = argAggregate->getSequence()[2]->getAsTyped(); + + TIntermAggregate* dst = new TIntermAggregate(EOpConstructVec4); + + // Ambient + dst->getSequence().push_back(intermediate.addConstantUnion(1.0, EbtFloat, loc, true)); + + // Diffuse: + TIntermTyped* zero = intermediate.addConstantUnion(0.0, EbtFloat, loc, true); + TIntermAggregate* diffuse = new TIntermAggregate(EOpMax); + diffuse->getSequence().push_back(n_dot_l); + diffuse->getSequence().push_back(zero); + diffuse->setLoc(loc); + diffuse->setType(TType(EbtFloat)); + dst->getSequence().push_back(diffuse); + + // Specular: + TIntermAggregate* min_ndot = new TIntermAggregate(EOpMin); + min_ndot->getSequence().push_back(n_dot_l); + min_ndot->getSequence().push_back(n_dot_h); + min_ndot->setLoc(loc); + min_ndot->setType(TType(EbtFloat)); + + TIntermTyped* compare = handleBinaryMath(loc, "<", EOpLessThan, min_ndot, zero); + TIntermTyped* n_dot_h_m = handleBinaryMath(loc, "mul", EOpMul, n_dot_h, m); // n_dot_h * m + + dst->getSequence().push_back(intermediate.addSelection(compare, zero, n_dot_h_m, loc)); + + // One: + dst->getSequence().push_back(intermediate.addConstantUnion(1.0, EbtFloat, loc, true)); + + dst->setLoc(loc); + dst->setType(TType(EbtFloat, EvqTemporary, 4)); + node = dst; + break; + } + + case EOpAsDouble: + { + // asdouble accepts two 32 bit ints. we can use EOpUint64BitsToDouble, but must + // first construct a uint64. + TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped(); + TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped(); + + if (arg0->getType().isVector()) { // TODO: ... + error(loc, "double2 conversion not implemented", "asdouble", ""); + break; + } + + TIntermAggregate* uint64 = new TIntermAggregate(EOpConstructUVec2); + + uint64->getSequence().push_back(arg0); + uint64->getSequence().push_back(arg1); + uint64->setType(TType(EbtUint, EvqTemporary, 2)); // convert 2 uints to a uint2 + uint64->setLoc(loc); + + // bitcast uint2 to a double + TIntermTyped* convert = new TIntermUnary(EOpUint64BitsToDouble); + convert->getAsUnaryNode()->setOperand(uint64); + convert->setLoc(loc); + convert->setType(TType(EbtDouble, EvqTemporary)); + node = convert; + + break; + } + + case EOpF16tof32: + { + // input uvecN with low 16 bits of each component holding a float16. convert to float32. + TIntermTyped* argValue = node->getAsUnaryNode()->getOperand(); + TIntermTyped* zero = intermediate.addConstantUnion(0, loc, true); + const int vecSize = argValue->getType().getVectorSize(); + + TOperator constructOp = EOpNull; + switch (vecSize) { + case 1: constructOp = EOpNull; break; // direct use, no construct needed + case 2: constructOp = EOpConstructVec2; break; + case 3: constructOp = EOpConstructVec3; break; + case 4: constructOp = EOpConstructVec4; break; + default: assert(0); break; + } + + // For scalar case, we don't need to construct another type. + TIntermAggregate* result = (vecSize > 1) ? new TIntermAggregate(constructOp) : nullptr; + + if (result) { + result->setType(TType(EbtFloat, EvqTemporary, vecSize)); + result->setLoc(loc); + } + + for (int idx = 0; idx < vecSize; ++idx) { + TIntermTyped* idxConst = intermediate.addConstantUnion(idx, loc, true); + TIntermTyped* component = argValue->getType().isVector() ? + intermediate.addIndex(EOpIndexDirect, argValue, idxConst, loc) : argValue; + + if (component != argValue) + component->setType(TType(argValue->getBasicType(), EvqTemporary)); + + TIntermTyped* unpackOp = new TIntermUnary(EOpUnpackHalf2x16); + unpackOp->setType(TType(EbtFloat, EvqTemporary, 2)); + unpackOp->getAsUnaryNode()->setOperand(component); + unpackOp->setLoc(loc); + + TIntermTyped* lowOrder = intermediate.addIndex(EOpIndexDirect, unpackOp, zero, loc); + + if (result != nullptr) { + result->getSequence().push_back(lowOrder); + node = result; + } else { + node = lowOrder; + } + } + + break; + } + + case EOpF32tof16: + { + // input floatN converted to 16 bit float in low order bits of each component of uintN + TIntermTyped* argValue = node->getAsUnaryNode()->getOperand(); + + TIntermTyped* zero = intermediate.addConstantUnion(0.0, EbtFloat, loc, true); + const int vecSize = argValue->getType().getVectorSize(); + + TOperator constructOp = EOpNull; + switch (vecSize) { + case 1: constructOp = EOpNull; break; // direct use, no construct needed + case 2: constructOp = EOpConstructUVec2; break; + case 3: constructOp = EOpConstructUVec3; break; + case 4: constructOp = EOpConstructUVec4; break; + default: assert(0); break; + } + + // For scalar case, we don't need to construct another type. + TIntermAggregate* result = (vecSize > 1) ? new TIntermAggregate(constructOp) : nullptr; + + if (result) { + result->setType(TType(EbtUint, EvqTemporary, vecSize)); + result->setLoc(loc); + } + + for (int idx = 0; idx < vecSize; ++idx) { + TIntermTyped* idxConst = intermediate.addConstantUnion(idx, loc, true); + TIntermTyped* component = argValue->getType().isVector() ? + intermediate.addIndex(EOpIndexDirect, argValue, idxConst, loc) : argValue; + + if (component != argValue) + component->setType(TType(argValue->getBasicType(), EvqTemporary)); + + TIntermAggregate* vec2ComponentAndZero = new TIntermAggregate(EOpConstructVec2); + vec2ComponentAndZero->getSequence().push_back(component); + vec2ComponentAndZero->getSequence().push_back(zero); + vec2ComponentAndZero->setType(TType(EbtFloat, EvqTemporary, 2)); + vec2ComponentAndZero->setLoc(loc); + + TIntermTyped* packOp = new TIntermUnary(EOpPackHalf2x16); + packOp->getAsUnaryNode()->setOperand(vec2ComponentAndZero); + packOp->setLoc(loc); + packOp->setType(TType(EbtUint, EvqTemporary)); + + if (result != nullptr) { + result->getSequence().push_back(packOp); + node = result; + } else { + node = packOp; + } + } + + break; + } + + case EOpD3DCOLORtoUBYTE4: + { + // ivec4 ( x.zyxw * 255.001953 ); + TIntermTyped* arg0 = node->getAsUnaryNode()->getOperand(); + TSwizzleSelectors selectors; + selectors.push_back(2); + selectors.push_back(1); + selectors.push_back(0); + selectors.push_back(3); + TIntermTyped* swizzleIdx = intermediate.addSwizzle(selectors, loc); + TIntermTyped* swizzled = intermediate.addIndex(EOpVectorSwizzle, arg0, swizzleIdx, loc); + swizzled->setType(arg0->getType()); + swizzled->getWritableType().getQualifier().makeTemporary(); + + TIntermTyped* conversion = intermediate.addConstantUnion(255.001953f, EbtFloat, loc, true); + TIntermTyped* rangeConverted = handleBinaryMath(loc, "mul", EOpMul, conversion, swizzled); + rangeConverted->setType(arg0->getType()); + rangeConverted->getWritableType().getQualifier().makeTemporary(); + + node = intermediate.addConversion(EOpConstructInt, TType(EbtInt, EvqTemporary, 4), rangeConverted); + node->setLoc(loc); + node->setType(TType(EbtInt, EvqTemporary, 4)); + break; + } + + case EOpIsFinite: + { + // Since OPIsFinite in SPIR-V is only supported with the Kernel capability, we translate + // it to !isnan && !isinf + + TIntermTyped* arg0 = node->getAsUnaryNode()->getOperand(); + + // We'll make a temporary in case the RHS is cmoplex + TVariable* tempArg = makeInternalVariable("@finitetmp", arg0->getType()); + tempArg->getWritableType().getQualifier().makeTemporary(); + + TIntermTyped* tmpArgAssign = intermediate.addAssign(EOpAssign, + intermediate.addSymbol(*tempArg, loc), + arg0, loc); + + TIntermAggregate* compoundStatement = intermediate.makeAggregate(tmpArgAssign, loc); + + const TType boolType(EbtBool, EvqTemporary, arg0->getVectorSize(), arg0->getMatrixCols(), + arg0->getMatrixRows()); + + TIntermTyped* isnan = handleUnaryMath(loc, "isnan", EOpIsNan, intermediate.addSymbol(*tempArg, loc)); + isnan->setType(boolType); + + TIntermTyped* notnan = handleUnaryMath(loc, "!", EOpLogicalNot, isnan); + notnan->setType(boolType); + + TIntermTyped* isinf = handleUnaryMath(loc, "isinf", EOpIsInf, intermediate.addSymbol(*tempArg, loc)); + isinf->setType(boolType); + + TIntermTyped* notinf = handleUnaryMath(loc, "!", EOpLogicalNot, isinf); + notinf->setType(boolType); + + TIntermTyped* andNode = handleBinaryMath(loc, "and", EOpLogicalAnd, notnan, notinf); + andNode->setType(boolType); + + compoundStatement = intermediate.growAggregate(compoundStatement, andNode); + compoundStatement->setOperator(EOpSequence); + compoundStatement->setLoc(loc); + compoundStatement->setType(boolType); + + node = compoundStatement; + + break; + } + case EOpWaveGetLaneCount: + { + // Mapped to gl_SubgroupSize builtin (We preprend @ to the symbol + // so that it inhabits the symbol table, but has a user-invalid name + // in-case some source HLSL defined the symbol also). + TType type(EbtUint, EvqVaryingIn); + node = lookupBuiltinVariable("@gl_SubgroupSize", EbvSubgroupSize2, type); + break; + } + case EOpWaveGetLaneIndex: + { + // Mapped to gl_SubgroupInvocationID builtin (We preprend @ to the + // symbol so that it inhabits the symbol table, but has a + // user-invalid name in-case some source HLSL defined the symbol + // also). + TType type(EbtUint, EvqVaryingIn); + node = lookupBuiltinVariable("@gl_SubgroupInvocationID", EbvSubgroupInvocation2, type); + break; + } + case EOpWaveActiveCountBits: + { + // Mapped to subgroupBallotBitCount(subgroupBallot()) builtin + + // uvec4 type. + TType uvec4Type(EbtUint, EvqTemporary, 4); + + // Get the uvec4 return from subgroupBallot(). + TIntermTyped* res = intermediate.addBuiltInFunctionCall(loc, + EOpSubgroupBallot, true, arguments, uvec4Type); + + // uint type. + TType uintType(EbtUint, EvqTemporary); + + node = intermediate.addBuiltInFunctionCall(loc, + EOpSubgroupBallotBitCount, true, res, uintType); + + break; + } + case EOpWavePrefixCountBits: + { + // Mapped to subgroupBallotExclusiveBitCount(subgroupBallot()) + // builtin + + // uvec4 type. + TType uvec4Type(EbtUint, EvqTemporary, 4); + + // Get the uvec4 return from subgroupBallot(). + TIntermTyped* res = intermediate.addBuiltInFunctionCall(loc, + EOpSubgroupBallot, true, arguments, uvec4Type); + + // uint type. + TType uintType(EbtUint, EvqTemporary); + + node = intermediate.addBuiltInFunctionCall(loc, + EOpSubgroupBallotExclusiveBitCount, true, res, uintType); + + break; + } + + default: + break; // most pass through unchanged + } +} + +// +// Handle seeing function call syntax in the grammar, which could be any of +// - .length() method +// - constructor +// - a call to a built-in function mapped to an operator +// - a call to a built-in function that will remain a function call (e.g., texturing) +// - user function +// - subroutine call (not implemented yet) +// +TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction* function, TIntermTyped* arguments) +{ + TIntermTyped* result = nullptr; + + TOperator op = function->getBuiltInOp(); + if (op != EOpNull) { + // + // Then this should be a constructor. + // Don't go through the symbol table for constructors. + // Their parameters will be verified algorithmically. + // + TType type(EbtVoid); // use this to get the type back + if (! constructorError(loc, arguments, *function, op, type)) { + // + // It's a constructor, of type 'type'. + // + result = handleConstructor(loc, arguments, type); + if (result == nullptr) { + error(loc, "cannot construct with these arguments", type.getCompleteString().c_str(), ""); + return nullptr; + } + } + } else { + // + // Find it in the symbol table. + // + const TFunction* fnCandidate = nullptr; + bool builtIn = false; + int thisDepth = 0; + + // For mat mul, the situation is unusual: we have to compare vector sizes to mat row or col sizes, + // and clamp the opposite arg. Since that's complex, we farm it off to a separate method. + // It doesn't naturally fall out of processing an argument at a time in isolation. + if (function->getName() == "mul") + addGenMulArgumentConversion(loc, *function, arguments); + + TIntermAggregate* aggregate = arguments ? arguments->getAsAggregate() : nullptr; + + // TODO: this needs improvement: there's no way at present to look up a signature in + // the symbol table for an arbitrary type. This is a temporary hack until that ability exists. + // It will have false positives, since it doesn't check arg counts or types. + if (arguments) { + // Check if first argument is struct buffer type. It may be an aggregate or a symbol, so we + // look for either case. + + TIntermTyped* arg0 = nullptr; + + if (aggregate && aggregate->getSequence().size() > 0 && aggregate->getSequence()[0]) + arg0 = aggregate->getSequence()[0]->getAsTyped(); + else if (arguments->getAsSymbolNode()) + arg0 = arguments->getAsSymbolNode(); + + if (arg0 != nullptr && isStructBufferType(arg0->getType())) { + static const int methodPrefixSize = sizeof(BUILTIN_PREFIX)-1; + + if (function->getName().length() > methodPrefixSize && + isStructBufferMethod(function->getName().substr(methodPrefixSize))) { + const TString mangle = function->getName() + "("; + TSymbol* symbol = symbolTable.find(mangle, &builtIn); + + if (symbol) + fnCandidate = symbol->getAsFunction(); + } + } + } + + if (fnCandidate == nullptr) + fnCandidate = findFunction(loc, *function, builtIn, thisDepth, arguments); + + if (fnCandidate) { + // This is a declared function that might map to + // - a built-in operator, + // - a built-in function not mapped to an operator, or + // - a user function. + + // turn an implicit member-function resolution into an explicit call + TString callerName; + if (thisDepth == 0) + callerName = fnCandidate->getMangledName(); + else { + // get the explicit (full) name of the function + callerName = currentTypePrefix[currentTypePrefix.size() - thisDepth]; + callerName += fnCandidate->getMangledName(); + // insert the implicit calling argument + pushFrontArguments(intermediate.addSymbol(*getImplicitThis(thisDepth)), arguments); + } + + // Convert 'in' arguments, so that types match. + // However, skip those that need expansion, that is covered next. + if (arguments) + addInputArgumentConversions(*fnCandidate, arguments); + + // Expand arguments. Some arguments must physically expand to a different set + // than what the shader declared and passes. + if (arguments && !builtIn) + expandArguments(loc, *fnCandidate, arguments); + + // Expansion may have changed the form of arguments + aggregate = arguments ? arguments->getAsAggregate() : nullptr; + + op = fnCandidate->getBuiltInOp(); + if (builtIn && op != EOpNull) { + // SM 4.0 and above guarantees roundEven semantics for round() + if (!hlslDX9Compatible() && op == EOpRound) + op = EOpRoundEven; + + // A function call mapped to a built-in operation. + result = intermediate.addBuiltInFunctionCall(loc, op, fnCandidate->getParamCount() == 1, arguments, + fnCandidate->getType()); + if (result == nullptr) { + error(arguments->getLoc(), " wrong operand type", "Internal Error", + "built in unary operator function. Type: %s", + static_cast(arguments)->getCompleteString().c_str()); + } else if (result->getAsOperator()) { + builtInOpCheck(loc, *fnCandidate, *result->getAsOperator()); + } + } else { + // This is a function call not mapped to built-in operator. + // It could still be a built-in function, but only if PureOperatorBuiltins == false. + result = intermediate.setAggregateOperator(arguments, EOpFunctionCall, fnCandidate->getType(), loc); + TIntermAggregate* call = result->getAsAggregate(); + call->setName(callerName); + + // this is how we know whether the given function is a built-in function or a user-defined function + // if builtIn == false, it's a userDefined -> could be an overloaded built-in function also + // if builtIn == true, it's definitely a built-in function with EOpNull + if (! builtIn) { + call->setUserDefined(); + intermediate.addToCallGraph(infoSink, currentCaller, callerName); + } + } + + // for decompositions, since we want to operate on the function node, not the aggregate holding + // output conversions. + const TIntermTyped* fnNode = result; + + decomposeStructBufferMethods(loc, result, arguments); // HLSL->AST struct buffer method decompositions + decomposeIntrinsic(loc, result, arguments); // HLSL->AST intrinsic decompositions + decomposeSampleMethods(loc, result, arguments); // HLSL->AST sample method decompositions + decomposeGeometryMethods(loc, result, arguments); // HLSL->AST geometry method decompositions + + // Create the qualifier list, carried in the AST for the call. + // Because some arguments expand to multiple arguments, the qualifier list will + // be longer than the formal parameter list. + if (result == fnNode && result->getAsAggregate()) { + TQualifierList& qualifierList = result->getAsAggregate()->getQualifierList(); + for (int i = 0; i < fnCandidate->getParamCount(); ++i) { + TStorageQualifier qual = (*fnCandidate)[i].type->getQualifier().storage; + if (hasStructBuffCounter(*(*fnCandidate)[i].type)) { + // add buffer and counter buffer argument qualifier + qualifierList.push_back(qual); + qualifierList.push_back(qual); + } else if (shouldFlatten(*(*fnCandidate)[i].type, (*fnCandidate)[i].type->getQualifier().storage, + true)) { + // add structure member expansion + for (int memb = 0; memb < (int)(*fnCandidate)[i].type->getStruct()->size(); ++memb) + qualifierList.push_back(qual); + } else { + // Normal 1:1 case + qualifierList.push_back(qual); + } + } + } + + // Convert 'out' arguments. If it was a constant folded built-in, it won't be an aggregate anymore. + // Built-ins with a single argument aren't called with an aggregate, but they also don't have an output. + // Also, build the qualifier list for user function calls, which are always called with an aggregate. + // We don't do this is if there has been a decomposition, which will have added its own conversions + // for output parameters. + if (result == fnNode && result->getAsAggregate()) + result = addOutputArgumentConversions(*fnCandidate, *result->getAsOperator()); + } + } + + // generic error recovery + // TODO: simplification: localize all the error recoveries that look like this, and taking type into account to + // reduce cascades + if (result == nullptr) + result = intermediate.addConstantUnion(0.0, EbtFloat, loc); + + return result; +} + +// An initial argument list is difficult: it can be null, or a single node, +// or an aggregate if more than one argument. Add one to the front, maintaining +// this lack of uniformity. +void HlslParseContext::pushFrontArguments(TIntermTyped* front, TIntermTyped*& arguments) +{ + if (arguments == nullptr) + arguments = front; + else if (arguments->getAsAggregate() != nullptr) + arguments->getAsAggregate()->getSequence().insert(arguments->getAsAggregate()->getSequence().begin(), front); + else + arguments = intermediate.growAggregate(front, arguments); +} + +// +// HLSL allows mismatched dimensions on vec*mat, mat*vec, vec*vec, and mat*mat. This is a +// situation not well suited to resolution in intrinsic selection, but we can do so here, since we +// can look at both arguments insert explicit shape changes if required. +// +void HlslParseContext::addGenMulArgumentConversion(const TSourceLoc& loc, TFunction& call, TIntermTyped*& args) +{ + TIntermAggregate* argAggregate = args ? args->getAsAggregate() : nullptr; + + if (argAggregate == nullptr || argAggregate->getSequence().size() != 2) { + // It really ought to have two arguments. + error(loc, "expected: mul arguments", "", ""); + return; + } + + TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped(); + TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped(); + + if (arg0->isVector() && arg1->isVector()) { + // For: + // vec * vec: it's handled during intrinsic selection, so while we could do it here, + // we can also ignore it, which is easier. + } else if (arg0->isVector() && arg1->isMatrix()) { + // vec * mat: we clamp the vec if the mat col is smaller, else clamp the mat col. + if (arg0->getVectorSize() < arg1->getMatrixCols()) { + // vec is smaller, so truncate larger mat dimension + const TType truncType(arg1->getBasicType(), arg1->getQualifier().storage, arg1->getQualifier().precision, + 0, arg0->getVectorSize(), arg1->getMatrixRows()); + arg1 = addConstructor(loc, arg1, truncType); + } else if (arg0->getVectorSize() > arg1->getMatrixCols()) { + // vec is larger, so truncate vec to mat size + const TType truncType(arg0->getBasicType(), arg0->getQualifier().storage, arg0->getQualifier().precision, + arg1->getMatrixCols()); + arg0 = addConstructor(loc, arg0, truncType); + } + } else if (arg0->isMatrix() && arg1->isVector()) { + // mat * vec: we clamp the vec if the mat col is smaller, else clamp the mat col. + if (arg1->getVectorSize() < arg0->getMatrixRows()) { + // vec is smaller, so truncate larger mat dimension + const TType truncType(arg0->getBasicType(), arg0->getQualifier().storage, arg0->getQualifier().precision, + 0, arg0->getMatrixCols(), arg1->getVectorSize()); + arg0 = addConstructor(loc, arg0, truncType); + } else if (arg1->getVectorSize() > arg0->getMatrixRows()) { + // vec is larger, so truncate vec to mat size + const TType truncType(arg1->getBasicType(), arg1->getQualifier().storage, arg1->getQualifier().precision, + arg0->getMatrixRows()); + arg1 = addConstructor(loc, arg1, truncType); + } + } else if (arg0->isMatrix() && arg1->isMatrix()) { + // mat * mat: we clamp the smaller inner dimension to match the other matrix size. + // Remember, HLSL Mrc = GLSL/SPIRV Mcr. + if (arg0->getMatrixRows() > arg1->getMatrixCols()) { + const TType truncType(arg0->getBasicType(), arg0->getQualifier().storage, arg0->getQualifier().precision, + 0, arg0->getMatrixCols(), arg1->getMatrixCols()); + arg0 = addConstructor(loc, arg0, truncType); + } else if (arg0->getMatrixRows() < arg1->getMatrixCols()) { + const TType truncType(arg1->getBasicType(), arg1->getQualifier().storage, arg1->getQualifier().precision, + 0, arg0->getMatrixRows(), arg1->getMatrixRows()); + arg1 = addConstructor(loc, arg1, truncType); + } + } else { + // It's something with scalars: we'll just leave it alone. Function selection will handle it + // downstream. + } + + // Warn if we altered one of the arguments + if (arg0 != argAggregate->getSequence()[0] || arg1 != argAggregate->getSequence()[1]) + warn(loc, "mul() matrix size mismatch", "", ""); + + // Put arguments back. (They might be unchanged, in which case this is harmless). + argAggregate->getSequence()[0] = arg0; + argAggregate->getSequence()[1] = arg1; + + call[0].type = &arg0->getWritableType(); + call[1].type = &arg1->getWritableType(); +} + +// +// Add any needed implicit conversions for function-call arguments to input parameters. +// +void HlslParseContext::addInputArgumentConversions(const TFunction& function, TIntermTyped*& arguments) +{ + TIntermAggregate* aggregate = arguments->getAsAggregate(); + + // Replace a single argument with a single argument. + const auto setArg = [&](int paramNum, TIntermTyped* arg) { + if (function.getParamCount() == 1) + arguments = arg; + else { + if (aggregate == nullptr) + arguments = arg; + else + aggregate->getSequence()[paramNum] = arg; + } + }; + + // Process each argument's conversion + for (int param = 0; param < function.getParamCount(); ++param) { + if (! function[param].type->getQualifier().isParamInput()) + continue; + + // At this early point there is a slight ambiguity between whether an aggregate 'arguments' + // is the single argument itself or its children are the arguments. Only one argument + // means take 'arguments' itself as the one argument. + TIntermTyped* arg = function.getParamCount() == 1 + ? arguments->getAsTyped() + : (aggregate ? + aggregate->getSequence()[param]->getAsTyped() : + arguments->getAsTyped()); + if (*function[param].type != arg->getType()) { + // In-qualified arguments just need an extra node added above the argument to + // convert to the correct type. + TIntermTyped* convArg = intermediate.addConversion(EOpFunctionCall, *function[param].type, arg); + if (convArg != nullptr) + convArg = intermediate.addUniShapeConversion(EOpFunctionCall, *function[param].type, convArg); + if (convArg != nullptr) + setArg(param, convArg); + else + error(arg->getLoc(), "cannot convert input argument, argument", "", "%d", param); + } else { + if (wasFlattened(arg)) { + // If both formal and calling arg are to be flattened, leave that to argument + // expansion, not conversion. + if (!shouldFlatten(*function[param].type, function[param].type->getQualifier().storage, true)) { + // Will make a two-level subtree. + // The deepest will copy member-by-member to build the structure to pass. + // The level above that will be a two-operand EOpComma sequence that follows the copy by the + // object itself. + TVariable* internalAggregate = makeInternalVariable("aggShadow", *function[param].type); + internalAggregate->getWritableType().getQualifier().makeTemporary(); + TIntermSymbol* internalSymbolNode = new TIntermSymbol(internalAggregate->getUniqueId(), + internalAggregate->getName(), + getLanguage(), + internalAggregate->getType()); + internalSymbolNode->setLoc(arg->getLoc()); + // This makes the deepest level, the member-wise copy + TIntermAggregate* assignAgg = handleAssign(arg->getLoc(), EOpAssign, + internalSymbolNode, arg)->getAsAggregate(); + + // Now, pair that with the resulting aggregate. + assignAgg = intermediate.growAggregate(assignAgg, internalSymbolNode, arg->getLoc()); + assignAgg->setOperator(EOpComma); + assignAgg->setType(internalAggregate->getType()); + setArg(param, assignAgg); + } + } + } + } +} + +// +// Add any needed implicit expansion of calling arguments from what the shader listed to what's +// internally needed for the AST (given the constraints downstream). +// +void HlslParseContext::expandArguments(const TSourceLoc& loc, const TFunction& function, TIntermTyped*& arguments) +{ + TIntermAggregate* aggregate = arguments->getAsAggregate(); + int functionParamNumberOffset = 0; + + // Replace a single argument with a single argument. + const auto setArg = [&](int paramNum, TIntermTyped* arg) { + if (function.getParamCount() + functionParamNumberOffset == 1) + arguments = arg; + else { + if (aggregate == nullptr) + arguments = arg; + else + aggregate->getSequence()[paramNum] = arg; + } + }; + + // Replace a single argument with a list of arguments + const auto setArgList = [&](int paramNum, const TVector& args) { + if (args.size() == 1) + setArg(paramNum, args.front()); + else if (args.size() > 1) { + if (function.getParamCount() + functionParamNumberOffset == 1) { + arguments = intermediate.makeAggregate(args.front()); + std::for_each(args.begin() + 1, args.end(), + [&](TIntermTyped* arg) { + arguments = intermediate.growAggregate(arguments, arg); + }); + } else { + auto it = aggregate->getSequence().erase(aggregate->getSequence().begin() + paramNum); + aggregate->getSequence().insert(it, args.begin(), args.end()); + } + functionParamNumberOffset += (int)(args.size() - 1); + } + }; + + // Process each argument's conversion + for (int param = 0; param < function.getParamCount(); ++param) { + // At this early point there is a slight ambiguity between whether an aggregate 'arguments' + // is the single argument itself or its children are the arguments. Only one argument + // means take 'arguments' itself as the one argument. + TIntermTyped* arg = function.getParamCount() == 1 + ? arguments->getAsTyped() + : (aggregate ? + aggregate->getSequence()[param + functionParamNumberOffset]->getAsTyped() : + arguments->getAsTyped()); + + if (wasFlattened(arg) && shouldFlatten(*function[param].type, function[param].type->getQualifier().storage, true)) { + // Need to pass the structure members instead of the structure. + TVector memberArgs; + for (int memb = 0; memb < (int)arg->getType().getStruct()->size(); ++memb) + memberArgs.push_back(flattenAccess(arg, memb)); + setArgList(param + functionParamNumberOffset, memberArgs); + } + } + + // TODO: if we need both hidden counter args (below) and struct expansion (above) + // the two algorithms need to be merged: Each assumes the list starts out 1:1 between + // parameters and arguments. + + // If any argument is a pass-by-reference struct buffer with an associated counter + // buffer, we have to add another hidden parameter for that counter. + if (aggregate) + addStructBuffArguments(loc, aggregate); +} + +// +// Add any needed implicit output conversions for function-call arguments. This +// can require a new tree topology, complicated further by whether the function +// has a return value. +// +// Returns a node of a subtree that evaluates to the return value of the function. +// +TIntermTyped* HlslParseContext::addOutputArgumentConversions(const TFunction& function, TIntermOperator& intermNode) +{ + assert (intermNode.getAsAggregate() != nullptr || intermNode.getAsUnaryNode() != nullptr); + + const TSourceLoc& loc = intermNode.getLoc(); + + TIntermSequence argSequence; // temp sequence for unary node args + + if (intermNode.getAsUnaryNode()) + argSequence.push_back(intermNode.getAsUnaryNode()->getOperand()); + + TIntermSequence& arguments = argSequence.empty() ? intermNode.getAsAggregate()->getSequence() : argSequence; + + const auto needsConversion = [&](int argNum) { + return function[argNum].type->getQualifier().isParamOutput() && + (*function[argNum].type != arguments[argNum]->getAsTyped()->getType() || + shouldConvertLValue(arguments[argNum]) || + wasFlattened(arguments[argNum]->getAsTyped())); + }; + + // Will there be any output conversions? + bool outputConversions = false; + for (int i = 0; i < function.getParamCount(); ++i) { + if (needsConversion(i)) { + outputConversions = true; + break; + } + } + + if (! outputConversions) + return &intermNode; + + // Setup for the new tree, if needed: + // + // Output conversions need a different tree topology. + // Out-qualified arguments need a temporary of the correct type, with the call + // followed by an assignment of the temporary to the original argument: + // void: function(arg, ...) -> ( function(tempArg, ...), arg = tempArg, ...) + // ret = function(arg, ...) -> ret = (tempRet = function(tempArg, ...), arg = tempArg, ..., tempRet) + // Where the "tempArg" type needs no conversion as an argument, but will convert on assignment. + TIntermTyped* conversionTree = nullptr; + TVariable* tempRet = nullptr; + if (intermNode.getBasicType() != EbtVoid) { + // do the "tempRet = function(...), " bit from above + tempRet = makeInternalVariable("tempReturn", intermNode.getType()); + TIntermSymbol* tempRetNode = intermediate.addSymbol(*tempRet, loc); + conversionTree = intermediate.addAssign(EOpAssign, tempRetNode, &intermNode, loc); + } else + conversionTree = &intermNode; + + conversionTree = intermediate.makeAggregate(conversionTree); + + // Process each argument's conversion + for (int i = 0; i < function.getParamCount(); ++i) { + if (needsConversion(i)) { + // Out-qualified arguments needing conversion need to use the topology setup above. + // Do the " ...(tempArg, ...), arg = tempArg" bit from above. + + // Make a temporary for what the function expects the argument to look like. + TVariable* tempArg = makeInternalVariable("tempArg", *function[i].type); + tempArg->getWritableType().getQualifier().makeTemporary(); + TIntermSymbol* tempArgNode = intermediate.addSymbol(*tempArg, loc); + + // This makes the deepest level, the member-wise copy + TIntermTyped* tempAssign = handleAssign(arguments[i]->getLoc(), EOpAssign, arguments[i]->getAsTyped(), + tempArgNode); + tempAssign = handleLvalue(arguments[i]->getLoc(), "assign", tempAssign); + conversionTree = intermediate.growAggregate(conversionTree, tempAssign, arguments[i]->getLoc()); + + // replace the argument with another node for the same tempArg variable + arguments[i] = intermediate.addSymbol(*tempArg, loc); + } + } + + // Finalize the tree topology (see bigger comment above). + if (tempRet) { + // do the "..., tempRet" bit from above + TIntermSymbol* tempRetNode = intermediate.addSymbol(*tempRet, loc); + conversionTree = intermediate.growAggregate(conversionTree, tempRetNode, loc); + } + + conversionTree = intermediate.setAggregateOperator(conversionTree, EOpComma, intermNode.getType(), loc); + + return conversionTree; +} + +// +// Add any needed "hidden" counter buffer arguments for function calls. +// +// Modifies the 'aggregate' argument if needed. Otherwise, is no-op. +// +void HlslParseContext::addStructBuffArguments(const TSourceLoc& loc, TIntermAggregate*& aggregate) +{ + // See if there are any SB types with counters. + const bool hasStructBuffArg = + std::any_of(aggregate->getSequence().begin(), + aggregate->getSequence().end(), + [this](const TIntermNode* node) { + return (node && node->getAsTyped() != nullptr) && hasStructBuffCounter(node->getAsTyped()->getType()); + }); + + // Nothing to do, if we didn't find one. + if (! hasStructBuffArg) + return; + + TIntermSequence argsWithCounterBuffers; + + for (int param = 0; param < int(aggregate->getSequence().size()); ++param) { + argsWithCounterBuffers.push_back(aggregate->getSequence()[param]); + + if (hasStructBuffCounter(aggregate->getSequence()[param]->getAsTyped()->getType())) { + const TIntermSymbol* blockSym = aggregate->getSequence()[param]->getAsSymbolNode(); + if (blockSym != nullptr) { + TType counterType; + counterBufferType(loc, counterType); + + const TString counterBlockName(intermediate.addCounterBufferName(blockSym->getName())); + + TVariable* variable = makeInternalVariable(counterBlockName, counterType); + + // Mark this buffer's counter block as being in use + structBufferCounter[counterBlockName] = true; + + TIntermSymbol* sym = intermediate.addSymbol(*variable, loc); + argsWithCounterBuffers.push_back(sym); + } + } + } + + // Swap with the temp list we've built up. + aggregate->getSequence().swap(argsWithCounterBuffers); +} + + +// +// Do additional checking of built-in function calls that is not caught +// by normal semantic checks on argument type, extension tagging, etc. +// +// Assumes there has been a semantically correct match to a built-in function prototype. +// +void HlslParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCandidate, TIntermOperator& callNode) +{ + // Set up convenience accessors to the argument(s). There is almost always + // multiple arguments for the cases below, but when there might be one, + // check the unaryArg first. + const TIntermSequence* argp = nullptr; // confusing to use [] syntax on a pointer, so this is to help get a reference + const TIntermTyped* unaryArg = nullptr; + const TIntermTyped* arg0 = nullptr; + if (callNode.getAsAggregate()) { + argp = &callNode.getAsAggregate()->getSequence(); + if (argp->size() > 0) + arg0 = (*argp)[0]->getAsTyped(); + } else { + assert(callNode.getAsUnaryNode()); + unaryArg = callNode.getAsUnaryNode()->getOperand(); + arg0 = unaryArg; + } + const TIntermSequence& aggArgs = argp ? *argp : TIntermSequence(); // only valid when unaryArg is nullptr + + switch (callNode.getOp()) { + case EOpTextureGather: + case EOpTextureGatherOffset: + case EOpTextureGatherOffsets: + { + // Figure out which variants are allowed by what extensions, + // and what arguments must be constant for which situations. + + TString featureString = fnCandidate.getName() + "(...)"; + const char* feature = featureString.c_str(); + int compArg = -1; // track which argument, if any, is the constant component argument + switch (callNode.getOp()) { + case EOpTextureGather: + // More than two arguments needs gpu_shader5, and rectangular or shadow needs gpu_shader5, + // otherwise, need GL_ARB_texture_gather. + if (fnCandidate.getParamCount() > 2 || fnCandidate[0].type->getSampler().dim == EsdRect || + fnCandidate[0].type->getSampler().shadow) { + if (! fnCandidate[0].type->getSampler().shadow) + compArg = 2; + } + break; + case EOpTextureGatherOffset: + // GL_ARB_texture_gather is good enough for 2D non-shadow textures with no component argument + if (! fnCandidate[0].type->getSampler().shadow) + compArg = 3; + break; + case EOpTextureGatherOffsets: + if (! fnCandidate[0].type->getSampler().shadow) + compArg = 3; + break; + default: + break; + } + + if (compArg > 0 && compArg < fnCandidate.getParamCount()) { + if (aggArgs[compArg]->getAsConstantUnion()) { + int value = aggArgs[compArg]->getAsConstantUnion()->getConstArray()[0].getIConst(); + if (value < 0 || value > 3) + error(loc, "must be 0, 1, 2, or 3:", feature, "component argument"); + } else + error(loc, "must be a compile-time constant:", feature, "component argument"); + } + + break; + } + + case EOpTextureOffset: + case EOpTextureFetchOffset: + case EOpTextureProjOffset: + case EOpTextureLodOffset: + case EOpTextureProjLodOffset: + case EOpTextureGradOffset: + case EOpTextureProjGradOffset: + { + // Handle texture-offset limits checking + // Pick which argument has to hold constant offsets + int arg = -1; + switch (callNode.getOp()) { + case EOpTextureOffset: arg = 2; break; + case EOpTextureFetchOffset: arg = (arg0->getType().getSampler().dim != EsdRect) ? 3 : 2; break; + case EOpTextureProjOffset: arg = 2; break; + case EOpTextureLodOffset: arg = 3; break; + case EOpTextureProjLodOffset: arg = 3; break; + case EOpTextureGradOffset: arg = 4; break; + case EOpTextureProjGradOffset: arg = 4; break; + default: + assert(0); + break; + } + + if (arg > 0) { + if (aggArgs[arg]->getAsConstantUnion() == nullptr) + error(loc, "argument must be compile-time constant", "texel offset", ""); + else { + const TType& type = aggArgs[arg]->getAsTyped()->getType(); + for (int c = 0; c < type.getVectorSize(); ++c) { + int offset = aggArgs[arg]->getAsConstantUnion()->getConstArray()[c].getIConst(); + if (offset > resources.maxProgramTexelOffset || offset < resources.minProgramTexelOffset) + error(loc, "value is out of range:", "texel offset", + "[gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]"); + } + } + } + + break; + } + + case EOpTextureQuerySamples: + case EOpImageQuerySamples: + break; + + case EOpImageAtomicAdd: + case EOpImageAtomicMin: + case EOpImageAtomicMax: + case EOpImageAtomicAnd: + case EOpImageAtomicOr: + case EOpImageAtomicXor: + case EOpImageAtomicExchange: + case EOpImageAtomicCompSwap: + break; + + case EOpInterpolateAtCentroid: + case EOpInterpolateAtSample: + case EOpInterpolateAtOffset: + // TODO(greg-lunarg): Re-enable this check. It currently gives false errors for builtins + // defined and passed as members of a struct. In this case the storage class is showing to be + // Function. See glslang #2584 + + // Make sure the first argument is an interpolant, or an array element of an interpolant + // if (arg0->getType().getQualifier().storage != EvqVaryingIn) { + // It might still be an array element. + // + // We could check more, but the semantics of the first argument are already met; the + // only way to turn an array into a float/vec* is array dereference and swizzle. + // + // ES and desktop 4.3 and earlier: swizzles may not be used + // desktop 4.4 and later: swizzles may be used + // const TIntermTyped* base = TIntermediate::findLValueBase(arg0, true); + // if (base == nullptr || base->getType().getQualifier().storage != EvqVaryingIn) + // error(loc, "first argument must be an interpolant, or interpolant-array element", + // fnCandidate.getName().c_str(), ""); + // } + break; + + default: + break; + } +} + +// +// Handle seeing something in a grammar production that can be done by calling +// a constructor. +// +// The constructor still must be "handled" by handleFunctionCall(), which will +// then call handleConstructor(). +// +TFunction* HlslParseContext::makeConstructorCall(const TSourceLoc& loc, const TType& type) +{ + TOperator op = intermediate.mapTypeToConstructorOp(type); + + if (op == EOpNull) { + error(loc, "cannot construct this type", type.getBasicString(), ""); + return nullptr; + } + + TString empty(""); + + return new TFunction(&empty, type, op); +} + +// +// Handle seeing a "COLON semantic" at the end of a type declaration, +// by updating the type according to the semantic. +// +void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, TBuiltInVariable builtIn, + const TString& upperCase) +{ + // Parse and return semantic number. If limit is 0, it will be ignored. Otherwise, if the parsed + // semantic number is >= limit, errorMsg is issued and 0 is returned. + // TODO: it would be nicer if limit and errorMsg had default parameters, but some compilers don't yet + // accept those in lambda functions. + const auto getSemanticNumber = [this, loc](const TString& semantic, unsigned int limit, const char* errorMsg) -> unsigned int { + size_t pos = semantic.find_last_not_of("0123456789"); + if (pos == std::string::npos) + return 0u; + + unsigned int semanticNum = (unsigned int)atoi(semantic.c_str() + pos + 1); + + if (limit != 0 && semanticNum >= limit) { + error(loc, errorMsg, semantic.c_str(), ""); + return 0u; + } + + return semanticNum; + }; + + if (builtIn == EbvNone && hlslDX9Compatible()) { + if (language == EShLangVertex) { + if (qualifier.isParamOutput()) { + if (upperCase == "POSITION") { + builtIn = EbvPosition; + } + if (upperCase == "PSIZE") { + builtIn = EbvPointSize; + } + } + } else if (language == EShLangFragment) { + if (qualifier.isParamInput() && upperCase == "VPOS") { + builtIn = EbvFragCoord; + } + if (qualifier.isParamOutput()) { + if (upperCase.compare(0, 5, "COLOR") == 0) { + qualifier.layoutLocation = getSemanticNumber(upperCase, 0, nullptr); + nextOutLocation = std::max(nextOutLocation, qualifier.layoutLocation + 1u); + } + if (upperCase == "DEPTH") { + builtIn = EbvFragDepth; + } + } + } + } + + switch(builtIn) { + case EbvNone: + // Get location numbers from fragment outputs, instead of + // auto-assigning them. + if (language == EShLangFragment && upperCase.compare(0, 9, "SV_TARGET") == 0) { + qualifier.layoutLocation = getSemanticNumber(upperCase, 0, nullptr); + nextOutLocation = std::max(nextOutLocation, qualifier.layoutLocation + 1u); + } else if (upperCase.compare(0, 15, "SV_CLIPDISTANCE") == 0) { + builtIn = EbvClipDistance; + qualifier.layoutLocation = getSemanticNumber(upperCase, maxClipCullRegs, "invalid clip semantic"); + } else if (upperCase.compare(0, 15, "SV_CULLDISTANCE") == 0) { + builtIn = EbvCullDistance; + qualifier.layoutLocation = getSemanticNumber(upperCase, maxClipCullRegs, "invalid cull semantic"); + } + break; + case EbvPosition: + // adjust for stage in/out + if (language == EShLangFragment) + builtIn = EbvFragCoord; + break; + case EbvFragStencilRef: + error(loc, "unimplemented; need ARB_shader_stencil_export", "SV_STENCILREF", ""); + break; + case EbvTessLevelInner: + case EbvTessLevelOuter: + qualifier.patch = true; + break; + default: + break; + } + + if (qualifier.builtIn == EbvNone) + qualifier.builtIn = builtIn; + qualifier.semanticName = intermediate.addSemanticName(upperCase); +} + +// +// Handle seeing something like "PACKOFFSET LEFT_PAREN c[Subcomponent][.component] RIGHT_PAREN" +// +// 'location' has the "c[Subcomponent]" part. +// 'component' points to the "component" part, or nullptr if not present. +// +void HlslParseContext::handlePackOffset(const TSourceLoc& loc, TQualifier& qualifier, const glslang::TString& location, + const glslang::TString* component) +{ + if (location.size() == 0 || location[0] != 'c') { + error(loc, "expected 'c'", "packoffset", ""); + return; + } + if (location.size() == 1) + return; + if (! isdigit(location[1])) { + error(loc, "expected number after 'c'", "packoffset", ""); + return; + } + + qualifier.layoutOffset = 16 * atoi(location.substr(1, location.size()).c_str()); + if (component != nullptr) { + int componentOffset = 0; + switch ((*component)[0]) { + case 'x': componentOffset = 0; break; + case 'y': componentOffset = 4; break; + case 'z': componentOffset = 8; break; + case 'w': componentOffset = 12; break; + default: + componentOffset = -1; + break; + } + if (componentOffset < 0 || component->size() > 1) { + error(loc, "expected {x, y, z, w} for component", "packoffset", ""); + return; + } + qualifier.layoutOffset += componentOffset; + } +} + +// +// Handle seeing something like "REGISTER LEFT_PAREN [shader_profile,] Type# RIGHT_PAREN" +// +// 'profile' points to the shader_profile part, or nullptr if not present. +// 'desc' is the type# part. +// +void HlslParseContext::handleRegister(const TSourceLoc& loc, TQualifier& qualifier, const glslang::TString* profile, + const glslang::TString& desc, int subComponent, const glslang::TString* spaceDesc) +{ + if (profile != nullptr) + warn(loc, "ignoring shader_profile", "register", ""); + + if (desc.size() < 1) { + error(loc, "expected register type", "register", ""); + return; + } + + int regNumber = 0; + if (desc.size() > 1) { + if (isdigit(desc[1])) + regNumber = atoi(desc.substr(1, desc.size()).c_str()); + else { + error(loc, "expected register number after register type", "register", ""); + return; + } + } + + // more information about register types see + // https://docs.microsoft.com/en-us/windows/desktop/direct3dhlsl/dx-graphics-hlsl-variable-register + const std::vector& resourceInfo = intermediate.getResourceSetBinding(); + switch (std::tolower(desc[0])) { + case 'c': + // c register is the register slot in the global const buffer + // each slot is a vector of 4 32 bit components + qualifier.layoutOffset = regNumber * 4 * 4; + break; + // const buffer register slot + case 'b': + // textrues and structured buffers + case 't': + // samplers + case 's': + // uav resources + case 'u': + // if nothing else has set the binding, do so now + // (other mechanisms override this one) + if (!qualifier.hasBinding()) + qualifier.layoutBinding = regNumber + subComponent; + + // This handles per-register layout sets numbers. For the global mode which sets + // every symbol to the same value, see setLinkageLayoutSets(). + if ((resourceInfo.size() % 3) == 0) { + // Apply per-symbol resource set and binding. + for (auto it = resourceInfo.cbegin(); it != resourceInfo.cend(); it = it + 3) { + if (strcmp(desc.c_str(), it[0].c_str()) == 0) { + qualifier.layoutSet = atoi(it[1].c_str()); + qualifier.layoutBinding = atoi(it[2].c_str()) + subComponent; + break; + } + } + } + break; + default: + warn(loc, "ignoring unrecognized register type", "register", "%c", desc[0]); + break; + } + + // space + unsigned int setNumber; + const auto crackSpace = [&]() -> bool { + const int spaceLen = 5; + if (spaceDesc->size() < spaceLen + 1) + return false; + if (spaceDesc->compare(0, spaceLen, "space") != 0) + return false; + if (! isdigit((*spaceDesc)[spaceLen])) + return false; + setNumber = atoi(spaceDesc->substr(spaceLen, spaceDesc->size()).c_str()); + return true; + }; + + // if nothing else has set the set, do so now + // (other mechanisms override this one) + if (spaceDesc && !qualifier.hasSet()) { + if (! crackSpace()) { + error(loc, "expected spaceN", "register", ""); + return; + } + qualifier.layoutSet = setNumber; + } +} + +// Convert to a scalar boolean, or if not allowed by HLSL semantics, +// report an error and return nullptr. +TIntermTyped* HlslParseContext::convertConditionalExpression(const TSourceLoc& loc, TIntermTyped* condition, + bool mustBeScalar) +{ + if (mustBeScalar && !condition->getType().isScalarOrVec1()) { + error(loc, "requires a scalar", "conditional expression", ""); + return nullptr; + } + + return intermediate.addConversion(EOpConstructBool, TType(EbtBool, EvqTemporary, condition->getVectorSize()), + condition); +} + +// +// Same error message for all places assignments don't work. +// +void HlslParseContext::assignError(const TSourceLoc& loc, const char* op, TString left, TString right) +{ + error(loc, "", op, "cannot convert from '%s' to '%s'", + right.c_str(), left.c_str()); +} + +// +// Same error message for all places unary operations don't work. +// +void HlslParseContext::unaryOpError(const TSourceLoc& loc, const char* op, TString operand) +{ + error(loc, " wrong operand type", op, + "no operation '%s' exists that takes an operand of type %s (or there is no acceptable conversion)", + op, operand.c_str()); +} + +// +// Same error message for all binary operations don't work. +// +void HlslParseContext::binaryOpError(const TSourceLoc& loc, const char* op, TString left, TString right) +{ + error(loc, " wrong operand types:", op, + "no operation '%s' exists that takes a left-hand operand of type '%s' and " + "a right operand of type '%s' (or there is no acceptable conversion)", + op, left.c_str(), right.c_str()); +} + +// +// A basic type of EbtVoid is a key that the name string was seen in the source, but +// it was not found as a variable in the symbol table. If so, give the error +// message and insert a dummy variable in the symbol table to prevent future errors. +// +void HlslParseContext::variableCheck(TIntermTyped*& nodePtr) +{ + TIntermSymbol* symbol = nodePtr->getAsSymbolNode(); + if (! symbol) + return; + + if (symbol->getType().getBasicType() == EbtVoid) { + error(symbol->getLoc(), "undeclared identifier", symbol->getName().c_str(), ""); + + // Add to symbol table to prevent future error messages on the same name + if (symbol->getName().size() > 0) { + TVariable* fakeVariable = new TVariable(&symbol->getName(), TType(EbtFloat)); + symbolTable.insert(*fakeVariable); + + // substitute a symbol node for this new variable + nodePtr = intermediate.addSymbol(*fakeVariable, symbol->getLoc()); + } + } +} + +// +// Both test, and if necessary spit out an error, to see if the node is really +// a constant. +// +void HlslParseContext::constantValueCheck(TIntermTyped* node, const char* token) +{ + if (node->getQualifier().storage != EvqConst) + error(node->getLoc(), "constant expression required", token, ""); +} + +// +// Both test, and if necessary spit out an error, to see if the node is really +// an integer. +// +void HlslParseContext::integerCheck(const TIntermTyped* node, const char* token) +{ + if ((node->getBasicType() == EbtInt || node->getBasicType() == EbtUint) && node->isScalar()) + return; + + error(node->getLoc(), "scalar integer expression required", token, ""); +} + +// +// Both test, and if necessary spit out an error, to see if we are currently +// globally scoped. +// +void HlslParseContext::globalCheck(const TSourceLoc& loc, const char* token) +{ + if (! symbolTable.atGlobalLevel()) + error(loc, "not allowed in nested scope", token, ""); +} + +bool HlslParseContext::builtInName(const TString& /*identifier*/) +{ + return false; +} + +// +// Make sure there is enough data and not too many arguments provided to the +// constructor to build something of the type of the constructor. Also returns +// the type of the constructor. +// +// Returns true if there was an error in construction. +// +bool HlslParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, TFunction& function, + TOperator op, TType& type) +{ + type.shallowCopy(function.getType()); + + bool constructingMatrix = false; + switch (op) { + case EOpConstructTextureSampler: + error(loc, "unhandled texture constructor", "constructor", ""); + return true; + case EOpConstructMat2x2: + case EOpConstructMat2x3: + case EOpConstructMat2x4: + case EOpConstructMat3x2: + case EOpConstructMat3x3: + case EOpConstructMat3x4: + case EOpConstructMat4x2: + case EOpConstructMat4x3: + case EOpConstructMat4x4: + case EOpConstructDMat2x2: + case EOpConstructDMat2x3: + case EOpConstructDMat2x4: + case EOpConstructDMat3x2: + case EOpConstructDMat3x3: + case EOpConstructDMat3x4: + case EOpConstructDMat4x2: + case EOpConstructDMat4x3: + case EOpConstructDMat4x4: + case EOpConstructIMat2x2: + case EOpConstructIMat2x3: + case EOpConstructIMat2x4: + case EOpConstructIMat3x2: + case EOpConstructIMat3x3: + case EOpConstructIMat3x4: + case EOpConstructIMat4x2: + case EOpConstructIMat4x3: + case EOpConstructIMat4x4: + case EOpConstructUMat2x2: + case EOpConstructUMat2x3: + case EOpConstructUMat2x4: + case EOpConstructUMat3x2: + case EOpConstructUMat3x3: + case EOpConstructUMat3x4: + case EOpConstructUMat4x2: + case EOpConstructUMat4x3: + case EOpConstructUMat4x4: + case EOpConstructBMat2x2: + case EOpConstructBMat2x3: + case EOpConstructBMat2x4: + case EOpConstructBMat3x2: + case EOpConstructBMat3x3: + case EOpConstructBMat3x4: + case EOpConstructBMat4x2: + case EOpConstructBMat4x3: + case EOpConstructBMat4x4: + constructingMatrix = true; + break; + default: + break; + } + + // + // Walk the arguments for first-pass checks and collection of information. + // + + int size = 0; + bool constType = true; + bool full = false; + bool overFull = false; + bool matrixInMatrix = false; + bool arrayArg = false; + for (int arg = 0; arg < function.getParamCount(); ++arg) { + if (function[arg].type->isArray()) { + if (function[arg].type->isUnsizedArray()) { + // Can't construct from an unsized array. + error(loc, "array argument must be sized", "constructor", ""); + return true; + } + arrayArg = true; + } + if (constructingMatrix && function[arg].type->isMatrix()) + matrixInMatrix = true; + + // 'full' will go to true when enough args have been seen. If we loop + // again, there is an extra argument. + if (full) { + // For vectors and matrices, it's okay to have too many components + // available, but not okay to have unused arguments. + overFull = true; + } + + size += function[arg].type->computeNumComponents(); + if (op != EOpConstructStruct && ! type.isArray() && size >= type.computeNumComponents()) + full = true; + + if (function[arg].type->getQualifier().storage != EvqConst) + constType = false; + } + + if (constType) + type.getQualifier().storage = EvqConst; + + if (type.isArray()) { + if (function.getParamCount() == 0) { + error(loc, "array constructor must have at least one argument", "constructor", ""); + return true; + } + + if (type.isUnsizedArray()) { + // auto adapt the constructor type to the number of arguments + type.changeOuterArraySize(function.getParamCount()); + } else if (type.getOuterArraySize() != function.getParamCount() && type.computeNumComponents() > size) { + error(loc, "array constructor needs one argument per array element", "constructor", ""); + return true; + } + + if (type.isArrayOfArrays()) { + // Types have to match, but we're still making the type. + // Finish making the type, and the comparison is done later + // when checking for conversion. + TArraySizes& arraySizes = *type.getArraySizes(); + + // At least the dimensionalities have to match. + if (! function[0].type->isArray() || + arraySizes.getNumDims() != function[0].type->getArraySizes()->getNumDims() + 1) { + error(loc, "array constructor argument not correct type to construct array element", "constructor", ""); + return true; + } + + if (arraySizes.isInnerUnsized()) { + // "Arrays of arrays ..., and the size for any dimension is optional" + // That means we need to adopt (from the first argument) the other array sizes into the type. + for (int d = 1; d < arraySizes.getNumDims(); ++d) { + if (arraySizes.getDimSize(d) == UnsizedArraySize) { + arraySizes.setDimSize(d, function[0].type->getArraySizes()->getDimSize(d - 1)); + } + } + } + } + } + + // Some array -> array type casts are okay + if (arrayArg && function.getParamCount() == 1 && op != EOpConstructStruct && type.isArray() && + !type.isArrayOfArrays() && !function[0].type->isArrayOfArrays() && + type.getVectorSize() >= 1 && function[0].type->getVectorSize() >= 1) + return false; + + if (arrayArg && op != EOpConstructStruct && ! type.isArrayOfArrays()) { + error(loc, "constructing non-array constituent from array argument", "constructor", ""); + return true; + } + + if (matrixInMatrix && ! type.isArray()) { + return false; + } + + if (overFull) { + error(loc, "too many arguments", "constructor", ""); + return true; + } + + if (op == EOpConstructStruct && ! type.isArray()) { + if (isScalarConstructor(node)) + return false; + + // Self-type construction: e.g, we can construct a struct from a single identically typed object. + if (function.getParamCount() == 1 && type == *function[0].type) + return false; + + if ((int)type.getStruct()->size() != function.getParamCount()) { + error(loc, "Number of constructor parameters does not match the number of structure fields", "constructor", ""); + return true; + } + } + + if ((op != EOpConstructStruct && size != 1 && size < type.computeNumComponents()) || + (op == EOpConstructStruct && size < type.computeNumComponents())) { + error(loc, "not enough data provided for construction", "constructor", ""); + return true; + } + + return false; +} + +// See if 'node', in the context of constructing aggregates, is a scalar argument +// to a constructor. +// +bool HlslParseContext::isScalarConstructor(const TIntermNode* node) +{ + // Obviously, it must be a scalar, but an aggregate node might not be fully + // completed yet: holding a sequence of initializers under an aggregate + // would not yet be typed, so don't check it's type. This corresponds to + // the aggregate operator also not being set yet. (An aggregate operation + // that legitimately yields a scalar will have a getOp() of that operator, + // not EOpNull.) + + return node->getAsTyped() != nullptr && + node->getAsTyped()->isScalar() && + (node->getAsAggregate() == nullptr || node->getAsAggregate()->getOp() != EOpNull); +} + +// Checks to see if a void variable has been declared and raise an error message for such a case +// +// returns true in case of an error +// +bool HlslParseContext::voidErrorCheck(const TSourceLoc& loc, const TString& identifier, const TBasicType basicType) +{ + if (basicType == EbtVoid) { + error(loc, "illegal use of type 'void'", identifier.c_str(), ""); + return true; + } + + return false; +} + +// +// Fix just a full qualifier (no variables or types yet, but qualifier is complete) at global level. +// +void HlslParseContext::globalQualifierFix(const TSourceLoc&, TQualifier& qualifier) +{ + // move from parameter/unknown qualifiers to pipeline in/out qualifiers + switch (qualifier.storage) { + case EvqIn: + qualifier.storage = EvqVaryingIn; + break; + case EvqOut: + qualifier.storage = EvqVaryingOut; + break; + default: + break; + } +} + +// +// Merge characteristics of the 'src' qualifier into the 'dst'. +// +void HlslParseContext::mergeQualifiers(TQualifier& dst, const TQualifier& src) +{ + // Storage qualification + if (dst.storage == EvqTemporary || dst.storage == EvqGlobal) + dst.storage = src.storage; + else if ((dst.storage == EvqIn && src.storage == EvqOut) || + (dst.storage == EvqOut && src.storage == EvqIn)) + dst.storage = EvqInOut; + else if ((dst.storage == EvqIn && src.storage == EvqConst) || + (dst.storage == EvqConst && src.storage == EvqIn)) + dst.storage = EvqConstReadOnly; + + // Layout qualifiers + mergeObjectLayoutQualifiers(dst, src, false); + + // individual qualifiers +#define MERGE_SINGLETON(field) dst.field |= src.field; + MERGE_SINGLETON(invariant); + MERGE_SINGLETON(noContraction); + MERGE_SINGLETON(centroid); + MERGE_SINGLETON(smooth); + MERGE_SINGLETON(flat); + MERGE_SINGLETON(nopersp); + MERGE_SINGLETON(patch); + MERGE_SINGLETON(sample); + MERGE_SINGLETON(coherent); + MERGE_SINGLETON(volatil); + MERGE_SINGLETON(restrict); + MERGE_SINGLETON(readonly); + MERGE_SINGLETON(writeonly); + MERGE_SINGLETON(specConstant); + MERGE_SINGLETON(nonUniform); +} + +// used to flatten the sampler type space into a single dimension +// correlates with the declaration of defaultSamplerPrecision[] +int HlslParseContext::computeSamplerTypeIndex(TSampler& sampler) +{ + int arrayIndex = sampler.arrayed ? 1 : 0; + int shadowIndex = sampler.shadow ? 1 : 0; + int externalIndex = sampler.external ? 1 : 0; + + return EsdNumDims * + (EbtNumTypes * (2 * (2 * arrayIndex + shadowIndex) + externalIndex) + sampler.type) + sampler.dim; +} + +// +// Do size checking for an array type's size. +// +void HlslParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, TArraySize& sizePair) +{ + bool isConst = false; + sizePair.size = 1; + sizePair.node = nullptr; + + TIntermConstantUnion* constant = expr->getAsConstantUnion(); + if (constant) { + // handle true (non-specialization) constant + sizePair.size = constant->getConstArray()[0].getIConst(); + isConst = true; + } else { + // see if it's a specialization constant instead + if (expr->getQualifier().isSpecConstant()) { + isConst = true; + sizePair.node = expr; + TIntermSymbol* symbol = expr->getAsSymbolNode(); + if (symbol && symbol->getConstArray().size() > 0) + sizePair.size = symbol->getConstArray()[0].getIConst(); + } + } + + if (! isConst || (expr->getBasicType() != EbtInt && expr->getBasicType() != EbtUint)) { + error(loc, "array size must be a constant integer expression", "", ""); + return; + } + + if (sizePair.size <= 0) { + error(loc, "array size must be a positive integer", "", ""); + return; + } +} + +// +// Require array to be completely sized +// +void HlslParseContext::arraySizeRequiredCheck(const TSourceLoc& loc, const TArraySizes& arraySizes) +{ + if (arraySizes.hasUnsized()) + error(loc, "array size required", "", ""); +} + +void HlslParseContext::structArrayCheck(const TSourceLoc& /*loc*/, const TType& type) +{ + const TTypeList& structure = *type.getStruct(); + for (int m = 0; m < (int)structure.size(); ++m) { + const TType& member = *structure[m].type; + if (member.isArray()) + arraySizeRequiredCheck(structure[m].loc, *member.getArraySizes()); + } +} + +// +// Do all the semantic checking for declaring or redeclaring an array, with and +// without a size, and make the right changes to the symbol table. +// +void HlslParseContext::declareArray(const TSourceLoc& loc, const TString& identifier, const TType& type, + TSymbol*& symbol, bool track) +{ + if (symbol == nullptr) { + bool currentScope; + symbol = symbolTable.find(identifier, nullptr, ¤tScope); + + if (symbol && builtInName(identifier) && ! symbolTable.atBuiltInLevel()) { + // bad shader (errors already reported) trying to redeclare a built-in name as an array + return; + } + if (symbol == nullptr || ! currentScope) { + // + // Successfully process a new definition. + // (Redeclarations have to take place at the same scope; otherwise they are hiding declarations) + // + symbol = new TVariable(&identifier, type); + symbolTable.insert(*symbol); + if (track && symbolTable.atGlobalLevel()) + trackLinkage(*symbol); + + return; + } + if (symbol->getAsAnonMember()) { + error(loc, "cannot redeclare a user-block member array", identifier.c_str(), ""); + symbol = nullptr; + return; + } + } + + // + // Process a redeclaration. + // + + if (symbol == nullptr) { + error(loc, "array variable name expected", identifier.c_str(), ""); + return; + } + + // redeclareBuiltinVariable() should have already done the copyUp() + TType& existingType = symbol->getWritableType(); + + if (existingType.isSizedArray()) { + // be more lenient for input arrays to geometry shaders and tessellation control outputs, + // where the redeclaration is the same size + return; + } + + existingType.updateArraySizes(type); +} + +// +// Enforce non-initializer type/qualifier rules. +// +void HlslParseContext::fixConstInit(const TSourceLoc& loc, const TString& identifier, TType& type, + TIntermTyped*& initializer) +{ + // + // Make the qualifier make sense, given that there is an initializer. + // + if (initializer == nullptr) { + if (type.getQualifier().storage == EvqConst || + type.getQualifier().storage == EvqConstReadOnly) { + initializer = intermediate.makeAggregate(loc); + warn(loc, "variable with qualifier 'const' not initialized; zero initializing", identifier.c_str(), ""); + } + } +} + +// +// See if the identifier is a built-in symbol that can be redeclared, and if so, +// copy the symbol table's read-only built-in variable to the current +// global level, where it can be modified based on the passed in type. +// +// Returns nullptr if no redeclaration took place; meaning a normal declaration still +// needs to occur for it, not necessarily an error. +// +// Returns a redeclared and type-modified variable if a redeclared occurred. +// +TSymbol* HlslParseContext::redeclareBuiltinVariable(const TSourceLoc& /*loc*/, const TString& identifier, + const TQualifier& /*qualifier*/, + const TShaderQualifiers& /*publicType*/) +{ + if (! builtInName(identifier) || symbolTable.atBuiltInLevel() || ! symbolTable.atGlobalLevel()) + return nullptr; + + return nullptr; +} + +// +// Generate index to the array element in a structure buffer (SSBO) +// +TIntermTyped* HlslParseContext::indexStructBufferContent(const TSourceLoc& loc, TIntermTyped* buffer) const +{ + // Bail out if not a struct buffer + if (buffer == nullptr || ! isStructBufferType(buffer->getType())) + return nullptr; + + // Runtime sized array is always the last element. + const TTypeList* bufferStruct = buffer->getType().getStruct(); + TIntermTyped* arrayPosition = intermediate.addConstantUnion(unsigned(bufferStruct->size()-1), loc); + + TIntermTyped* argArray = intermediate.addIndex(EOpIndexDirectStruct, buffer, arrayPosition, loc); + argArray->setType(*(*bufferStruct)[bufferStruct->size()-1].type); + + return argArray; +} + +// +// IFF type is a structuredbuffer/byteaddressbuffer type, return the content +// (template) type. E.g, StructuredBuffer -> MyType. Else return nullptr. +// +TType* HlslParseContext::getStructBufferContentType(const TType& type) const +{ + if (type.getBasicType() != EbtBlock || type.getQualifier().storage != EvqBuffer) + return nullptr; + + const int memberCount = (int)type.getStruct()->size(); + assert(memberCount > 0); + + TType* contentType = (*type.getStruct())[memberCount-1].type; + + return contentType->isUnsizedArray() ? contentType : nullptr; +} + +// +// If an existing struct buffer has a sharable type, then share it. +// +void HlslParseContext::shareStructBufferType(TType& type) +{ + // PackOffset must be equivalent to share types on a per-member basis. + // Note: cannot use auto type due to recursion. Thus, this is a std::function. + const std::function + compareQualifiers = [&](TType& lhs, TType& rhs) -> bool { + if (lhs.getQualifier().layoutOffset != rhs.getQualifier().layoutOffset) + return false; + + if (lhs.isStruct() != rhs.isStruct()) + return false; + + if (lhs.getQualifier().builtIn != rhs.getQualifier().builtIn) + return false; + + if (lhs.isStruct() && rhs.isStruct()) { + if (lhs.getStruct()->size() != rhs.getStruct()->size()) + return false; + + for (int i = 0; i < int(lhs.getStruct()->size()); ++i) + if (!compareQualifiers(*(*lhs.getStruct())[i].type, *(*rhs.getStruct())[i].type)) + return false; + } + + return true; + }; + + // We need to compare certain qualifiers in addition to the type. + const auto typeEqual = [compareQualifiers](TType& lhs, TType& rhs) -> bool { + if (lhs.getQualifier().readonly != rhs.getQualifier().readonly) + return false; + + // If both are structures, recursively look for packOffset equality + // as well as type equality. + return compareQualifiers(lhs, rhs) && lhs == rhs; + }; + + // This is an exhaustive O(N) search, but real world shaders have + // only a small number of these. + for (int idx = 0; idx < int(structBufferTypes.size()); ++idx) { + // If the deep structure matches, modulo qualifiers, use it + if (typeEqual(*structBufferTypes[idx], type)) { + type.shallowCopy(*structBufferTypes[idx]); + return; + } + } + + // Otherwise, remember it: + TType* typeCopy = new TType; + typeCopy->shallowCopy(type); + structBufferTypes.push_back(typeCopy); +} + +void HlslParseContext::paramFix(TType& type) +{ + switch (type.getQualifier().storage) { + case EvqConst: + type.getQualifier().storage = EvqConstReadOnly; + break; + case EvqGlobal: + case EvqTemporary: + type.getQualifier().storage = EvqIn; + break; + case EvqBuffer: + { + // SSBO parameter. These do not go through the declareBlock path since they are fn parameters. + correctUniform(type.getQualifier()); + TQualifier bufferQualifier = globalBufferDefaults; + mergeObjectLayoutQualifiers(bufferQualifier, type.getQualifier(), true); + bufferQualifier.storage = type.getQualifier().storage; + bufferQualifier.readonly = type.getQualifier().readonly; + bufferQualifier.coherent = type.getQualifier().coherent; + bufferQualifier.declaredBuiltIn = type.getQualifier().declaredBuiltIn; + type.getQualifier() = bufferQualifier; + break; + } + default: + break; + } +} + +void HlslParseContext::specializationCheck(const TSourceLoc& loc, const TType& type, const char* op) +{ + if (type.containsSpecializationSize()) + error(loc, "can't use with types containing arrays sized with a specialization constant", op, ""); +} + +// +// Layout qualifier stuff. +// + +// Put the id's layout qualification into the public type, for qualifiers not having a number set. +// This is before we know any type information for error checking. +void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qualifier, TString& id) +{ + std::transform(id.begin(), id.end(), id.begin(), ::tolower); + + if (id == TQualifier::getLayoutMatrixString(ElmColumnMajor)) { + qualifier.layoutMatrix = ElmRowMajor; + return; + } + if (id == TQualifier::getLayoutMatrixString(ElmRowMajor)) { + qualifier.layoutMatrix = ElmColumnMajor; + return; + } + if (id == "push_constant") { + requireVulkan(loc, "push_constant"); + qualifier.layoutPushConstant = true; + return; + } + if (language == EShLangGeometry || language == EShLangTessEvaluation) { + if (id == TQualifier::getGeometryString(ElgTriangles)) { + // publicType.shaderQualifiers.geometry = ElgTriangles; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (language == EShLangGeometry) { + if (id == TQualifier::getGeometryString(ElgPoints)) { + // publicType.shaderQualifiers.geometry = ElgPoints; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (id == TQualifier::getGeometryString(ElgLineStrip)) { + // publicType.shaderQualifiers.geometry = ElgLineStrip; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (id == TQualifier::getGeometryString(ElgLines)) { + // publicType.shaderQualifiers.geometry = ElgLines; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (id == TQualifier::getGeometryString(ElgLinesAdjacency)) { + // publicType.shaderQualifiers.geometry = ElgLinesAdjacency; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (id == TQualifier::getGeometryString(ElgTrianglesAdjacency)) { + // publicType.shaderQualifiers.geometry = ElgTrianglesAdjacency; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (id == TQualifier::getGeometryString(ElgTriangleStrip)) { + // publicType.shaderQualifiers.geometry = ElgTriangleStrip; + warn(loc, "ignored", id.c_str(), ""); + return; + } + } else { + assert(language == EShLangTessEvaluation); + + // input primitive + if (id == TQualifier::getGeometryString(ElgTriangles)) { + // publicType.shaderQualifiers.geometry = ElgTriangles; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (id == TQualifier::getGeometryString(ElgQuads)) { + // publicType.shaderQualifiers.geometry = ElgQuads; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (id == TQualifier::getGeometryString(ElgIsolines)) { + // publicType.shaderQualifiers.geometry = ElgIsolines; + warn(loc, "ignored", id.c_str(), ""); + return; + } + + // vertex spacing + if (id == TQualifier::getVertexSpacingString(EvsEqual)) { + // publicType.shaderQualifiers.spacing = EvsEqual; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (id == TQualifier::getVertexSpacingString(EvsFractionalEven)) { + // publicType.shaderQualifiers.spacing = EvsFractionalEven; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (id == TQualifier::getVertexSpacingString(EvsFractionalOdd)) { + // publicType.shaderQualifiers.spacing = EvsFractionalOdd; + warn(loc, "ignored", id.c_str(), ""); + return; + } + + // triangle order + if (id == TQualifier::getVertexOrderString(EvoCw)) { + // publicType.shaderQualifiers.order = EvoCw; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (id == TQualifier::getVertexOrderString(EvoCcw)) { + // publicType.shaderQualifiers.order = EvoCcw; + warn(loc, "ignored", id.c_str(), ""); + return; + } + + // point mode + if (id == "point_mode") { + // publicType.shaderQualifiers.pointMode = true; + warn(loc, "ignored", id.c_str(), ""); + return; + } + } + } + if (language == EShLangFragment) { + if (id == "origin_upper_left") { + // publicType.shaderQualifiers.originUpperLeft = true; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (id == "pixel_center_integer") { + // publicType.shaderQualifiers.pixelCenterInteger = true; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (id == "early_fragment_tests") { + // publicType.shaderQualifiers.earlyFragmentTests = true; + warn(loc, "ignored", id.c_str(), ""); + return; + } + for (TLayoutDepth depth = (TLayoutDepth)(EldNone + 1); depth < EldCount; depth = (TLayoutDepth)(depth + 1)) { + if (id == TQualifier::getLayoutDepthString(depth)) { + // publicType.shaderQualifiers.layoutDepth = depth; + warn(loc, "ignored", id.c_str(), ""); + return; + } + } + if (id.compare(0, 13, "blend_support") == 0) { + bool found = false; + for (TBlendEquationShift be = (TBlendEquationShift)0; be < EBlendCount; be = (TBlendEquationShift)(be + 1)) { + if (id == TQualifier::getBlendEquationString(be)) { + requireExtensions(loc, 1, &E_GL_KHR_blend_equation_advanced, "blend equation"); + intermediate.addBlendEquation(be); + // publicType.shaderQualifiers.blendEquation = true; + warn(loc, "ignored", id.c_str(), ""); + found = true; + break; + } + } + if (! found) + error(loc, "unknown blend equation", "blend_support", ""); + return; + } + } + error(loc, "unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4)", id.c_str(), ""); +} + +// Put the id's layout qualifier value into the public type, for qualifiers having a number set. +// This is before we know any type information for error checking. +void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qualifier, TString& id, + const TIntermTyped* node) +{ + const char* feature = "layout-id value"; + // const char* nonLiteralFeature = "non-literal layout-id value"; + + integerCheck(node, feature); + const TIntermConstantUnion* constUnion = node->getAsConstantUnion(); + int value = 0; + if (constUnion) { + value = constUnion->getConstArray()[0].getIConst(); + } + + std::transform(id.begin(), id.end(), id.begin(), ::tolower); + + if (id == "offset") { + qualifier.layoutOffset = value; + return; + } else if (id == "align") { + // "The specified alignment must be a power of 2, or a compile-time error results." + if (! IsPow2(value)) + error(loc, "must be a power of 2", "align", ""); + else + qualifier.layoutAlign = value; + return; + } else if (id == "location") { + if ((unsigned int)value >= TQualifier::layoutLocationEnd) + error(loc, "location is too large", id.c_str(), ""); + else + qualifier.layoutLocation = value; + return; + } else if (id == "set") { + if ((unsigned int)value >= TQualifier::layoutSetEnd) + error(loc, "set is too large", id.c_str(), ""); + else + qualifier.layoutSet = value; + return; + } else if (id == "binding") { + if ((unsigned int)value >= TQualifier::layoutBindingEnd) + error(loc, "binding is too large", id.c_str(), ""); + else + qualifier.layoutBinding = value; + return; + } else if (id == "component") { + if ((unsigned)value >= TQualifier::layoutComponentEnd) + error(loc, "component is too large", id.c_str(), ""); + else + qualifier.layoutComponent = value; + return; + } else if (id.compare(0, 4, "xfb_") == 0) { + // "Any shader making any static use (after preprocessing) of any of these + // *xfb_* qualifiers will cause the shader to be in a transform feedback + // capturing mode and hence responsible for describing the transform feedback + // setup." + intermediate.setXfbMode(); + if (id == "xfb_buffer") { + // "It is a compile-time error to specify an *xfb_buffer* that is greater than + // the implementation-dependent constant gl_MaxTransformFeedbackBuffers." + if (value >= resources.maxTransformFeedbackBuffers) + error(loc, "buffer is too large:", id.c_str(), "gl_MaxTransformFeedbackBuffers is %d", + resources.maxTransformFeedbackBuffers); + if (value >= (int)TQualifier::layoutXfbBufferEnd) + error(loc, "buffer is too large:", id.c_str(), "internal max is %d", TQualifier::layoutXfbBufferEnd - 1); + else + qualifier.layoutXfbBuffer = value; + return; + } else if (id == "xfb_offset") { + if (value >= (int)TQualifier::layoutXfbOffsetEnd) + error(loc, "offset is too large:", id.c_str(), "internal max is %d", TQualifier::layoutXfbOffsetEnd - 1); + else + qualifier.layoutXfbOffset = value; + return; + } else if (id == "xfb_stride") { + // "The resulting stride (implicit or explicit), when divided by 4, must be less than or equal to the + // implementation-dependent constant gl_MaxTransformFeedbackInterleavedComponents." + if (value > 4 * resources.maxTransformFeedbackInterleavedComponents) + error(loc, "1/4 stride is too large:", id.c_str(), "gl_MaxTransformFeedbackInterleavedComponents is %d", + resources.maxTransformFeedbackInterleavedComponents); + else if (value >= (int)TQualifier::layoutXfbStrideEnd) + error(loc, "stride is too large:", id.c_str(), "internal max is %d", TQualifier::layoutXfbStrideEnd - 1); + if (value < (int)TQualifier::layoutXfbStrideEnd) + qualifier.layoutXfbStride = value; + return; + } + } + + if (id == "input_attachment_index") { + requireVulkan(loc, "input_attachment_index"); + if (value >= (int)TQualifier::layoutAttachmentEnd) + error(loc, "attachment index is too large", id.c_str(), ""); + else + qualifier.layoutAttachment = value; + return; + } + if (id == "constant_id") { + setSpecConstantId(loc, qualifier, value); + return; + } + + switch (language) { + case EShLangVertex: + break; + + case EShLangTessControl: + if (id == "vertices") { + if (value == 0) + error(loc, "must be greater than 0", "vertices", ""); + else + // publicType.shaderQualifiers.vertices = value; + warn(loc, "ignored", id.c_str(), ""); + return; + } + break; + + case EShLangTessEvaluation: + break; + + case EShLangGeometry: + if (id == "invocations") { + if (value == 0) + error(loc, "must be at least 1", "invocations", ""); + else + // publicType.shaderQualifiers.invocations = value; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (id == "max_vertices") { + // publicType.shaderQualifiers.vertices = value; + warn(loc, "ignored", id.c_str(), ""); + if (value > resources.maxGeometryOutputVertices) + error(loc, "too large, must be less than gl_MaxGeometryOutputVertices", "max_vertices", ""); + return; + } + if (id == "stream") { + qualifier.layoutStream = value; + return; + } + break; + + case EShLangFragment: + if (id == "index") { + qualifier.layoutIndex = value; + return; + } + break; + + case EShLangCompute: + if (id.compare(0, 11, "local_size_") == 0) { + if (id == "local_size_x") { + // publicType.shaderQualifiers.localSize[0] = value; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (id == "local_size_y") { + // publicType.shaderQualifiers.localSize[1] = value; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (id == "local_size_z") { + // publicType.shaderQualifiers.localSize[2] = value; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (spvVersion.spv != 0) { + if (id == "local_size_x_id") { + // publicType.shaderQualifiers.localSizeSpecId[0] = value; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (id == "local_size_y_id") { + // publicType.shaderQualifiers.localSizeSpecId[1] = value; + warn(loc, "ignored", id.c_str(), ""); + return; + } + if (id == "local_size_z_id") { + // publicType.shaderQualifiers.localSizeSpecId[2] = value; + warn(loc, "ignored", id.c_str(), ""); + return; + } + } + } + break; + + default: + break; + } + + error(loc, "there is no such layout identifier for this stage taking an assigned value", id.c_str(), ""); +} + +void HlslParseContext::setSpecConstantId(const TSourceLoc& loc, TQualifier& qualifier, int value) +{ + if (value >= (int)TQualifier::layoutSpecConstantIdEnd) { + error(loc, "specialization-constant id is too large", "constant_id", ""); + } else { + qualifier.layoutSpecConstantId = value; + qualifier.specConstant = true; + if (! intermediate.addUsedConstantId(value)) + error(loc, "specialization-constant id already used", "constant_id", ""); + } + return; +} + +// Merge any layout qualifier information from src into dst, leaving everything else in dst alone +// +// "More than one layout qualifier may appear in a single declaration. +// Additionally, the same layout-qualifier-name can occur multiple times +// within a layout qualifier or across multiple layout qualifiers in the +// same declaration. When the same layout-qualifier-name occurs +// multiple times, in a single declaration, the last occurrence overrides +// the former occurrence(s). Further, if such a layout-qualifier-name +// will effect subsequent declarations or other observable behavior, it +// is only the last occurrence that will have any effect, behaving as if +// the earlier occurrence(s) within the declaration are not present. +// This is also true for overriding layout-qualifier-names, where one +// overrides the other (e.g., row_major vs. column_major); only the last +// occurrence has any effect." +// +void HlslParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifier& src, bool inheritOnly) +{ + if (src.hasMatrix()) + dst.layoutMatrix = src.layoutMatrix; + if (src.hasPacking()) + dst.layoutPacking = src.layoutPacking; + + if (src.hasStream()) + dst.layoutStream = src.layoutStream; + + if (src.hasFormat()) + dst.layoutFormat = src.layoutFormat; + + if (src.hasXfbBuffer()) + dst.layoutXfbBuffer = src.layoutXfbBuffer; + + if (src.hasAlign()) + dst.layoutAlign = src.layoutAlign; + + if (! inheritOnly) { + if (src.hasLocation()) + dst.layoutLocation = src.layoutLocation; + if (src.hasComponent()) + dst.layoutComponent = src.layoutComponent; + if (src.hasIndex()) + dst.layoutIndex = src.layoutIndex; + + if (src.hasOffset()) + dst.layoutOffset = src.layoutOffset; + + if (src.hasSet()) + dst.layoutSet = src.layoutSet; + if (src.layoutBinding != TQualifier::layoutBindingEnd) + dst.layoutBinding = src.layoutBinding; + + if (src.hasXfbStride()) + dst.layoutXfbStride = src.layoutXfbStride; + if (src.hasXfbOffset()) + dst.layoutXfbOffset = src.layoutXfbOffset; + if (src.hasAttachment()) + dst.layoutAttachment = src.layoutAttachment; + if (src.hasSpecConstantId()) + dst.layoutSpecConstantId = src.layoutSpecConstantId; + + if (src.layoutPushConstant) + dst.layoutPushConstant = true; + } +} + + +// +// Look up a function name in the symbol table, and make sure it is a function. +// +// First, look for an exact match. If there is none, use the generic selector +// TParseContextBase::selectFunction() to find one, parameterized by the +// convertible() and better() predicates defined below. +// +// Return the function symbol if found, otherwise nullptr. +// +const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, TFunction& call, bool& builtIn, int& thisDepth, + TIntermTyped*& args) +{ + if (symbolTable.isFunctionNameVariable(call.getName())) { + error(loc, "can't use function syntax on variable", call.getName().c_str(), ""); + return nullptr; + } + + // first, look for an exact match + bool dummyScope; + TSymbol* symbol = symbolTable.find(call.getMangledName(), &builtIn, &dummyScope, &thisDepth); + if (symbol) + return symbol->getAsFunction(); + + // no exact match, use the generic selector, parameterized by the GLSL rules + + // create list of candidates to send + TVector candidateList; + symbolTable.findFunctionNameList(call.getMangledName(), candidateList, builtIn); + + // These built-in ops can accept any type, so we bypass the argument selection + if (candidateList.size() == 1 && builtIn && + (candidateList[0]->getBuiltInOp() == EOpMethodAppend || + candidateList[0]->getBuiltInOp() == EOpMethodRestartStrip || + candidateList[0]->getBuiltInOp() == EOpMethodIncrementCounter || + candidateList[0]->getBuiltInOp() == EOpMethodDecrementCounter || + candidateList[0]->getBuiltInOp() == EOpMethodConsume)) { + return candidateList[0]; + } + + bool allowOnlyUpConversions = true; + + // can 'from' convert to 'to'? + const auto convertible = [&](const TType& from, const TType& to, TOperator op, int arg) -> bool { + if (from == to) + return true; + + // no aggregate conversions + if (from.isArray() || to.isArray() || + from.isStruct() || to.isStruct()) + return false; + + switch (op) { + case EOpInterlockedAdd: + case EOpInterlockedAnd: + case EOpInterlockedCompareExchange: + case EOpInterlockedCompareStore: + case EOpInterlockedExchange: + case EOpInterlockedMax: + case EOpInterlockedMin: + case EOpInterlockedOr: + case EOpInterlockedXor: + // We do not promote the texture or image type for these ocodes. Normally that would not + // be an issue because it's a buffer, but we haven't decomposed the opcode yet, and at this + // stage it's merely e.g, a basic integer type. + // + // Instead, we want to promote other arguments, but stay within the same family. In other + // words, InterlockedAdd(RWBuffer, ...) will always use the int flavor, never the uint flavor, + // but it is allowed to promote its other arguments. + if (arg == 0) + return false; + break; + case EOpMethodSample: + case EOpMethodSampleBias: + case EOpMethodSampleCmp: + case EOpMethodSampleCmpLevelZero: + case EOpMethodSampleGrad: + case EOpMethodSampleLevel: + case EOpMethodLoad: + case EOpMethodGetDimensions: + case EOpMethodGetSamplePosition: + case EOpMethodGather: + case EOpMethodCalculateLevelOfDetail: + case EOpMethodCalculateLevelOfDetailUnclamped: + case EOpMethodGatherRed: + case EOpMethodGatherGreen: + case EOpMethodGatherBlue: + case EOpMethodGatherAlpha: + case EOpMethodGatherCmp: + case EOpMethodGatherCmpRed: + case EOpMethodGatherCmpGreen: + case EOpMethodGatherCmpBlue: + case EOpMethodGatherCmpAlpha: + case EOpMethodAppend: + case EOpMethodRestartStrip: + // those are method calls, the object type can not be changed + // they are equal if the dim and type match (is dim sufficient?) + if (arg == 0) + return from.getSampler().type == to.getSampler().type && + from.getSampler().arrayed == to.getSampler().arrayed && + from.getSampler().shadow == to.getSampler().shadow && + from.getSampler().ms == to.getSampler().ms && + from.getSampler().dim == to.getSampler().dim; + break; + default: + break; + } + + // basic types have to be convertible + if (allowOnlyUpConversions) + if (! intermediate.canImplicitlyPromote(from.getBasicType(), to.getBasicType(), EOpFunctionCall)) + return false; + + // shapes have to be convertible + if ((from.isScalarOrVec1() && to.isScalarOrVec1()) || + (from.isScalarOrVec1() && to.isVector()) || + (from.isScalarOrVec1() && to.isMatrix()) || + (from.isVector() && to.isVector() && from.getVectorSize() >= to.getVectorSize())) + return true; + + // TODO: what are the matrix rules? they go here + + return false; + }; + + // Is 'to2' a better conversion than 'to1'? + // Ties should not be considered as better. + // Assumes 'convertible' already said true. + const auto better = [](const TType& from, const TType& to1, const TType& to2) -> bool { + // exact match is always better than mismatch + if (from == to2) + return from != to1; + if (from == to1) + return false; + + // shape changes are always worse + if (from.isScalar() || from.isVector()) { + if (from.getVectorSize() == to2.getVectorSize() && + from.getVectorSize() != to1.getVectorSize()) + return true; + if (from.getVectorSize() == to1.getVectorSize() && + from.getVectorSize() != to2.getVectorSize()) + return false; + } + + // Handle sampler betterness: An exact sampler match beats a non-exact match. + // (If we just looked at basic type, all EbtSamplers would look the same). + // If any type is not a sampler, just use the linearize function below. + if (from.getBasicType() == EbtSampler && to1.getBasicType() == EbtSampler && to2.getBasicType() == EbtSampler) { + // We can ignore the vector size in the comparison. + TSampler to1Sampler = to1.getSampler(); + TSampler to2Sampler = to2.getSampler(); + + to1Sampler.vectorSize = to2Sampler.vectorSize = from.getSampler().vectorSize; + + if (from.getSampler() == to2Sampler) + return from.getSampler() != to1Sampler; + if (from.getSampler() == to1Sampler) + return false; + } + + // Might or might not be changing shape, which means basic type might + // or might not match, so within that, the question is how big a + // basic-type conversion is being done. + // + // Use a hierarchy of domains, translated to order of magnitude + // in a linearized view: + // - floating-point vs. integer + // - 32 vs. 64 bit (or width in general) + // - bool vs. non bool + // - signed vs. not signed + const auto linearize = [](const TBasicType& basicType) -> int { + switch (basicType) { + case EbtBool: return 1; + case EbtInt: return 10; + case EbtUint: return 11; + case EbtInt64: return 20; + case EbtUint64: return 21; + case EbtFloat: return 100; + case EbtDouble: return 110; + default: return 0; + } + }; + + return abs(linearize(to2.getBasicType()) - linearize(from.getBasicType())) < + abs(linearize(to1.getBasicType()) - linearize(from.getBasicType())); + }; + + // for ambiguity reporting + bool tie = false; + + // send to the generic selector + const TFunction* bestMatch = nullptr; + + // printf has var args and is in the symbol table as "printf()", + // mangled to "printf(" + if (call.getName() == "printf") { + TSymbol* symbol = symbolTable.find("printf(", &builtIn); + if (symbol) + return symbol->getAsFunction(); + } + + bestMatch = selectFunction(candidateList, call, convertible, better, tie); + + if (bestMatch == nullptr) { + // If there is nothing selected by allowing only up-conversions (to a larger linearize() value), + // we instead try down-conversions, which are valid in HLSL, but not preferred if there are any + // upconversions possible. + allowOnlyUpConversions = false; + bestMatch = selectFunction(candidateList, call, convertible, better, tie); + } + + if (bestMatch == nullptr) { + error(loc, "no matching overloaded function found", call.getName().c_str(), ""); + return nullptr; + } + + // For built-ins, we can convert across the arguments. This will happen in several steps: + // Step 1: If there's an exact match, use it. + // Step 2a: Otherwise, get the operator from the best match and promote arguments: + // Step 2b: reconstruct the TFunction based on the new arg types + // Step 3: Re-select after type promotion is applied, to find proper candidate. + if (builtIn) { + // Step 1: If there's an exact match, use it. + if (call.getMangledName() == bestMatch->getMangledName()) + return bestMatch; + + // Step 2a: Otherwise, get the operator from the best match and promote arguments as if we + // are that kind of operator. + if (args != nullptr) { + // The arg list can be a unary node, or an aggregate. We have to handle both. + // We will use the normal promote() facilities, which require an interm node. + TIntermOperator* promote = nullptr; + + if (call.getParamCount() == 1) { + promote = new TIntermUnary(bestMatch->getBuiltInOp()); + promote->getAsUnaryNode()->setOperand(args->getAsTyped()); + } else { + promote = new TIntermAggregate(bestMatch->getBuiltInOp()); + promote->getAsAggregate()->getSequence().swap(args->getAsAggregate()->getSequence()); + } + + if (! intermediate.promote(promote)) + return nullptr; + + // Obtain the promoted arg list. + if (call.getParamCount() == 1) { + args = promote->getAsUnaryNode()->getOperand(); + } else { + promote->getAsAggregate()->getSequence().swap(args->getAsAggregate()->getSequence()); + } + } + + // Step 2b: reconstruct the TFunction based on the new arg types + TFunction convertedCall(&call.getName(), call.getType(), call.getBuiltInOp()); + + if (args->getAsAggregate()) { + // Handle aggregates: put all args into the new function call + for (int arg = 0; arg < int(args->getAsAggregate()->getSequence().size()); ++arg) { + // TODO: But for constness, we could avoid the new & shallowCopy, and use the pointer directly. + TParameter param = { nullptr, new TType, nullptr }; + param.type->shallowCopy(args->getAsAggregate()->getSequence()[arg]->getAsTyped()->getType()); + convertedCall.addParameter(param); + } + } else if (args->getAsUnaryNode()) { + // Handle unaries: put all args into the new function call + TParameter param = { nullptr, new TType, nullptr }; + param.type->shallowCopy(args->getAsUnaryNode()->getOperand()->getAsTyped()->getType()); + convertedCall.addParameter(param); + } else if (args->getAsTyped()) { + // Handle bare e.g, floats, not in an aggregate. + TParameter param = { nullptr, new TType, nullptr }; + param.type->shallowCopy(args->getAsTyped()->getType()); + convertedCall.addParameter(param); + } else { + assert(0); // unknown argument list. + return nullptr; + } + + // Step 3: Re-select after type promotion, to find proper candidate + // send to the generic selector + bestMatch = selectFunction(candidateList, convertedCall, convertible, better, tie); + + // At this point, there should be no tie. + } + + if (tie) + error(loc, "ambiguous best function under implicit type conversion", call.getName().c_str(), ""); + + // Append default parameter values if needed + if (!tie && bestMatch != nullptr) { + for (int defParam = call.getParamCount(); defParam < bestMatch->getParamCount(); ++defParam) { + handleFunctionArgument(&call, args, (*bestMatch)[defParam].defaultValue); + } + } + + return bestMatch; +} + +// +// Do everything necessary to handle a typedef declaration, for a single symbol. +// +// 'parseType' is the type part of the declaration (to the left) +// 'arraySizes' is the arrayness tagged on the identifier (to the right) +// +void HlslParseContext::declareTypedef(const TSourceLoc& loc, const TString& identifier, const TType& parseType) +{ + TVariable* typeSymbol = new TVariable(&identifier, parseType, true); + if (! symbolTable.insert(*typeSymbol)) + error(loc, "name already defined", "typedef", identifier.c_str()); +} + +// Do everything necessary to handle a struct declaration, including +// making IO aliases because HLSL allows mixed IO in a struct that specializes +// based on the usage (input, output, uniform, none). +void HlslParseContext::declareStruct(const TSourceLoc& loc, TString& structName, TType& type) +{ + // If it was named, which means the type can be reused later, add + // it to the symbol table. (Unless it's a block, in which + // case the name is not a type.) + if (type.getBasicType() == EbtBlock || structName.size() == 0) + return; + + TVariable* userTypeDef = new TVariable(&structName, type, true); + if (! symbolTable.insert(*userTypeDef)) { + error(loc, "redefinition", structName.c_str(), "struct"); + return; + } + + // See if we need IO aliases for the structure typeList + + const auto condAlloc = [](bool pred, TTypeList*& list) { + if (pred && list == nullptr) + list = new TTypeList; + }; + + tIoKinds newLists = { nullptr, nullptr, nullptr }; // allocate for each kind found + for (auto member = type.getStruct()->begin(); member != type.getStruct()->end(); ++member) { + condAlloc(hasUniform(member->type->getQualifier()), newLists.uniform); + condAlloc( hasInput(member->type->getQualifier()), newLists.input); + condAlloc( hasOutput(member->type->getQualifier()), newLists.output); + + if (member->type->isStruct()) { + auto it = ioTypeMap.find(member->type->getStruct()); + if (it != ioTypeMap.end()) { + condAlloc(it->second.uniform != nullptr, newLists.uniform); + condAlloc(it->second.input != nullptr, newLists.input); + condAlloc(it->second.output != nullptr, newLists.output); + } + } + } + if (newLists.uniform == nullptr && + newLists.input == nullptr && + newLists.output == nullptr) { + // Won't do any IO caching, clear up the type and get out now. + for (auto member = type.getStruct()->begin(); member != type.getStruct()->end(); ++member) + clearUniformInputOutput(member->type->getQualifier()); + return; + } + + // We have IO involved. + + // Make a pure typeList for the symbol table, and cache side copies of IO versions. + for (auto member = type.getStruct()->begin(); member != type.getStruct()->end(); ++member) { + const auto inheritStruct = [&](TTypeList* s, TTypeLoc& ioMember) { + if (s != nullptr) { + ioMember.type = new TType; + ioMember.type->shallowCopy(*member->type); + ioMember.type->setStruct(s); + } + }; + const auto newMember = [&](TTypeLoc& m) { + if (m.type == nullptr) { + m.type = new TType; + m.type->shallowCopy(*member->type); + } + }; + + TTypeLoc newUniformMember = { nullptr, member->loc }; + TTypeLoc newInputMember = { nullptr, member->loc }; + TTypeLoc newOutputMember = { nullptr, member->loc }; + if (member->type->isStruct()) { + // swap in an IO child if there is one + auto it = ioTypeMap.find(member->type->getStruct()); + if (it != ioTypeMap.end()) { + inheritStruct(it->second.uniform, newUniformMember); + inheritStruct(it->second.input, newInputMember); + inheritStruct(it->second.output, newOutputMember); + } + } + if (newLists.uniform) { + newMember(newUniformMember); + + // inherit default matrix layout (changeable via #pragma pack_matrix), if none given. + if (member->type->isMatrix() && member->type->getQualifier().layoutMatrix == ElmNone) + newUniformMember.type->getQualifier().layoutMatrix = globalUniformDefaults.layoutMatrix; + + correctUniform(newUniformMember.type->getQualifier()); + newLists.uniform->push_back(newUniformMember); + } + if (newLists.input) { + newMember(newInputMember); + correctInput(newInputMember.type->getQualifier()); + newLists.input->push_back(newInputMember); + } + if (newLists.output) { + newMember(newOutputMember); + correctOutput(newOutputMember.type->getQualifier()); + newLists.output->push_back(newOutputMember); + } + + // make original pure + clearUniformInputOutput(member->type->getQualifier()); + } + ioTypeMap[type.getStruct()] = newLists; +} + +// Lookup a user-type by name. +// If found, fill in the type and return the defining symbol. +// If not found, return nullptr. +TSymbol* HlslParseContext::lookupUserType(const TString& typeName, TType& type) +{ + TSymbol* symbol = symbolTable.find(typeName); + if (symbol && symbol->getAsVariable() && symbol->getAsVariable()->isUserType()) { + type.shallowCopy(symbol->getType()); + return symbol; + } else + return nullptr; +} + +// +// Do everything necessary to handle a variable (non-block) declaration. +// Either redeclaring a variable, or making a new one, updating the symbol +// table, and all error checking. +// +// Returns a subtree node that computes an initializer, if needed. +// Returns nullptr if there is no code to execute for initialization. +// +// 'parseType' is the type part of the declaration (to the left) +// 'arraySizes' is the arrayness tagged on the identifier (to the right) +// +TIntermNode* HlslParseContext::declareVariable(const TSourceLoc& loc, const TString& identifier, TType& type, + TIntermTyped* initializer) +{ + if (voidErrorCheck(loc, identifier, type.getBasicType())) + return nullptr; + + // Global consts with initializers that are non-const act like EvqGlobal in HLSL. + // This test is implicitly recursive, because initializers propagate constness + // up the aggregate node tree during creation. E.g, for: + // { { 1, 2 }, { 3, 4 } } + // the initializer list is marked EvqConst at the top node, and remains so here. However: + // { 1, { myvar, 2 }, 3 } + // is not a const intializer, and still becomes EvqGlobal here. + + const bool nonConstInitializer = (initializer != nullptr && initializer->getQualifier().storage != EvqConst); + + if (type.getQualifier().storage == EvqConst && symbolTable.atGlobalLevel() && nonConstInitializer) { + // Force to global + type.getQualifier().storage = EvqGlobal; + } + + // make const and initialization consistent + fixConstInit(loc, identifier, type, initializer); + + // Check for redeclaration of built-ins and/or attempting to declare a reserved name + TSymbol* symbol = nullptr; + + inheritGlobalDefaults(type.getQualifier()); + + const bool flattenVar = shouldFlatten(type, type.getQualifier().storage, true); + + // correct IO in the type + switch (type.getQualifier().storage) { + case EvqGlobal: + case EvqTemporary: + clearUniformInputOutput(type.getQualifier()); + break; + case EvqUniform: + case EvqBuffer: + correctUniform(type.getQualifier()); + if (type.isStruct()) { + auto it = ioTypeMap.find(type.getStruct()); + if (it != ioTypeMap.end()) + type.setStruct(it->second.uniform); + } + + break; + default: + break; + } + + // Declare the variable + if (type.isArray()) { + // array case + declareArray(loc, identifier, type, symbol, !flattenVar); + } else { + // non-array case + if (symbol == nullptr) + symbol = declareNonArray(loc, identifier, type, !flattenVar); + else if (type != symbol->getType()) + error(loc, "cannot change the type of", "redeclaration", symbol->getName().c_str()); + } + + if (symbol == nullptr) + return nullptr; + + if (flattenVar) + flatten(*symbol->getAsVariable(), symbolTable.atGlobalLevel()); + + TVariable* variable = symbol->getAsVariable(); + + if (initializer == nullptr) { + if (intermediate.getDebugInfo()) + return executeDeclaration(loc, variable); + else + return nullptr; + } + + // Deal with initializer + if (variable == nullptr) { + error(loc, "initializer requires a variable, not a member", identifier.c_str(), ""); + return nullptr; + } + return executeInitializer(loc, initializer, variable); +} + +// Pick up global defaults from the provide global defaults into dst. +void HlslParseContext::inheritGlobalDefaults(TQualifier& dst) const +{ + if (dst.storage == EvqVaryingOut) { + if (! dst.hasStream() && language == EShLangGeometry) + dst.layoutStream = globalOutputDefaults.layoutStream; + if (! dst.hasXfbBuffer()) + dst.layoutXfbBuffer = globalOutputDefaults.layoutXfbBuffer; + } +} + +// +// Make an internal-only variable whose name is for debug purposes only +// and won't be searched for. Callers will only use the return value to use +// the variable, not the name to look it up. It is okay if the name +// is the same as other names; there won't be any conflict. +// +TVariable* HlslParseContext::makeInternalVariable(const char* name, const TType& type) const +{ + TString* nameString = NewPoolTString(name); + TVariable* variable = new TVariable(nameString, type); + symbolTable.makeInternalVariable(*variable); + + return variable; +} + +// Make a symbol node holding a new internal temporary variable. +TIntermSymbol* HlslParseContext::makeInternalVariableNode(const TSourceLoc& loc, const char* name, + const TType& type) const +{ + TVariable* tmpVar = makeInternalVariable(name, type); + tmpVar->getWritableType().getQualifier().makeTemporary(); + + return intermediate.addSymbol(*tmpVar, loc); +} + +// +// Declare a non-array variable, the main point being there is no redeclaration +// for resizing allowed. +// +// Return the successfully declared variable. +// +TVariable* HlslParseContext::declareNonArray(const TSourceLoc& loc, const TString& identifier, const TType& type, + bool track) +{ + // make a new variable + TVariable* variable = new TVariable(&identifier, type); + + // add variable to symbol table + if (symbolTable.insert(*variable)) { + if (track && symbolTable.atGlobalLevel()) + trackLinkage(*variable); + return variable; + } + + error(loc, "redefinition", variable->getName().c_str(), ""); + return nullptr; +} + +// Return a declaration of a temporary variable +// +// This is used to force a variable to be declared in the correct scope +// when debug information is being generated. + +TIntermNode* HlslParseContext::executeDeclaration(const TSourceLoc& loc, TVariable* variable) +{ + // + // Identifier must be of type temporary. + // + TStorageQualifier qualifier = variable->getType().getQualifier().storage; + if (qualifier != EvqTemporary) + return nullptr; + + TIntermSymbol* intermSymbol = intermediate.addSymbol(*variable, loc); + return handleDeclare(loc, intermSymbol); +} + +// +// Handle all types of initializers from the grammar. +// +// Returning nullptr just means there is no code to execute to handle the +// initializer, which will, for example, be the case for constant initializers. +// +// Returns a subtree that accomplished the initialization. +// +TIntermNode* HlslParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyped* initializer, TVariable* variable) +{ + // + // Identifier must be of type constant, a global, or a temporary, and + // starting at version 120, desktop allows uniforms to have initializers. + // + TStorageQualifier qualifier = variable->getType().getQualifier().storage; + + // + // If the initializer was from braces { ... }, we convert the whole subtree to a + // constructor-style subtree, allowing the rest of the code to operate + // identically for both kinds of initializers. + // + // + // Type can't be deduced from the initializer list, so a skeletal type to + // follow has to be passed in. Constness and specialization-constness + // should be deduced bottom up, not dictated by the skeletal type. + // + TType skeletalType; + skeletalType.shallowCopy(variable->getType()); + skeletalType.getQualifier().makeTemporary(); + if (initializer->getAsAggregate() && initializer->getAsAggregate()->getOp() == EOpNull) + initializer = convertInitializerList(loc, skeletalType, initializer, nullptr); + if (initializer == nullptr) { + // error recovery; don't leave const without constant values + if (qualifier == EvqConst) + variable->getWritableType().getQualifier().storage = EvqTemporary; + return nullptr; + } + + // Fix outer arrayness if variable is unsized, getting size from the initializer + if (initializer->getType().isSizedArray() && variable->getType().isUnsizedArray()) + variable->getWritableType().changeOuterArraySize(initializer->getType().getOuterArraySize()); + + // Inner arrayness can also get set by an initializer + if (initializer->getType().isArrayOfArrays() && variable->getType().isArrayOfArrays() && + initializer->getType().getArraySizes()->getNumDims() == + variable->getType().getArraySizes()->getNumDims()) { + // adopt unsized sizes from the initializer's sizes + for (int d = 1; d < variable->getType().getArraySizes()->getNumDims(); ++d) { + if (variable->getType().getArraySizes()->getDimSize(d) == UnsizedArraySize) { + variable->getWritableType().getArraySizes()->setDimSize(d, + initializer->getType().getArraySizes()->getDimSize(d)); + } + } + } + + // Uniform and global consts require a constant initializer + if (qualifier == EvqUniform && initializer->getType().getQualifier().storage != EvqConst) { + error(loc, "uniform initializers must be constant", "=", "'%s'", variable->getType().getCompleteString().c_str()); + variable->getWritableType().getQualifier().storage = EvqTemporary; + return nullptr; + } + + // Const variables require a constant initializer + if (qualifier == EvqConst) { + if (initializer->getType().getQualifier().storage != EvqConst) { + variable->getWritableType().getQualifier().storage = EvqConstReadOnly; + qualifier = EvqConstReadOnly; + } + } + + if (qualifier == EvqConst || qualifier == EvqUniform) { + // Compile-time tagging of the variable with its constant value... + + initializer = intermediate.addConversion(EOpAssign, variable->getType(), initializer); + if (initializer != nullptr && variable->getType() != initializer->getType()) + initializer = intermediate.addUniShapeConversion(EOpAssign, variable->getType(), initializer); + if (initializer == nullptr || !initializer->getAsConstantUnion() || + variable->getType() != initializer->getType()) { + error(loc, "non-matching or non-convertible constant type for const initializer", + variable->getType().getStorageQualifierString(), ""); + variable->getWritableType().getQualifier().storage = EvqTemporary; + return nullptr; + } + + variable->setConstArray(initializer->getAsConstantUnion()->getConstArray()); + } else { + // normal assigning of a value to a variable... + specializationCheck(loc, initializer->getType(), "initializer"); + TIntermSymbol* intermSymbol = intermediate.addSymbol(*variable, loc); + TIntermNode* initNode = handleAssign(loc, EOpAssign, intermSymbol, initializer); + if (initNode == nullptr) + assignError(loc, "=", intermSymbol->getCompleteString(), initializer->getCompleteString()); + return initNode; + } + + return nullptr; +} + +// +// Reprocess any initializer-list { ... } parts of the initializer. +// Need to hierarchically assign correct types and implicit +// conversions. Will do this mimicking the same process used for +// creating a constructor-style initializer, ensuring we get the +// same form. +// +// Returns a node representing an expression for the initializer list expressed +// as the correct type. +// +// Returns nullptr if there is an error. +// +TIntermTyped* HlslParseContext::convertInitializerList(const TSourceLoc& loc, const TType& type, + TIntermTyped* initializer, TIntermTyped* scalarInit) +{ + // Will operate recursively. Once a subtree is found that is constructor style, + // everything below it is already good: Only the "top part" of the initializer + // can be an initializer list, where "top part" can extend for several (or all) levels. + + // see if we have bottomed out in the tree within the initializer-list part + TIntermAggregate* initList = initializer->getAsAggregate(); + if (initList == nullptr || initList->getOp() != EOpNull) { + // We don't have a list, but if it's a scalar and the 'type' is a + // composite, we need to lengthen below to make it useful. + // Otherwise, this is an already formed object to initialize with. + if (type.isScalar() || !initializer->getType().isScalar()) + return initializer; + else + initList = intermediate.makeAggregate(initializer); + } + + // Of the initializer-list set of nodes, need to process bottom up, + // so recurse deep, then process on the way up. + + // Go down the tree here... + if (type.isArray()) { + // The type's array might be unsized, which could be okay, so base sizes on the size of the aggregate. + // Later on, initializer execution code will deal with array size logic. + TType arrayType; + arrayType.shallowCopy(type); // sharing struct stuff is fine + arrayType.copyArraySizes(*type.getArraySizes()); // but get a fresh copy of the array information, to edit below + + // edit array sizes to fill in unsized dimensions + if (type.isUnsizedArray()) + arrayType.changeOuterArraySize((int)initList->getSequence().size()); + + // set unsized array dimensions that can be derived from the initializer's first element + if (arrayType.isArrayOfArrays() && initList->getSequence().size() > 0) { + TIntermTyped* firstInit = initList->getSequence()[0]->getAsTyped(); + if (firstInit->getType().isArray() && + arrayType.getArraySizes()->getNumDims() == firstInit->getType().getArraySizes()->getNumDims() + 1) { + for (int d = 1; d < arrayType.getArraySizes()->getNumDims(); ++d) { + if (arrayType.getArraySizes()->getDimSize(d) == UnsizedArraySize) + arrayType.getArraySizes()->setDimSize(d, firstInit->getType().getArraySizes()->getDimSize(d - 1)); + } + } + } + + // lengthen list to be long enough + lengthenList(loc, initList->getSequence(), arrayType.getOuterArraySize(), scalarInit); + + // recursively process each element + TType elementType(arrayType, 0); // dereferenced type + for (int i = 0; i < arrayType.getOuterArraySize(); ++i) { + initList->getSequence()[i] = convertInitializerList(loc, elementType, + initList->getSequence()[i]->getAsTyped(), scalarInit); + if (initList->getSequence()[i] == nullptr) + return nullptr; + } + + return addConstructor(loc, initList, arrayType); + } else if (type.isStruct()) { + // do we have implicit assignments to opaques? + for (size_t i = initList->getSequence().size(); i < type.getStruct()->size(); ++i) { + if ((*type.getStruct())[i].type->containsOpaque()) { + error(loc, "cannot implicitly initialize opaque members", "initializer list", ""); + return nullptr; + } + } + + // lengthen list to be long enough + lengthenList(loc, initList->getSequence(), static_cast(type.getStruct()->size()), scalarInit); + + if (type.getStruct()->size() != initList->getSequence().size()) { + error(loc, "wrong number of structure members", "initializer list", ""); + return nullptr; + } + for (size_t i = 0; i < type.getStruct()->size(); ++i) { + initList->getSequence()[i] = convertInitializerList(loc, *(*type.getStruct())[i].type, + initList->getSequence()[i]->getAsTyped(), scalarInit); + if (initList->getSequence()[i] == nullptr) + return nullptr; + } + } else if (type.isMatrix()) { + if (type.computeNumComponents() == (int)initList->getSequence().size()) { + // This means the matrix is initialized component-wise, rather than as + // a series of rows and columns. We can just use the list directly as + // a constructor; no further processing needed. + } else { + // lengthen list to be long enough + lengthenList(loc, initList->getSequence(), type.getMatrixCols(), scalarInit); + + if (type.getMatrixCols() != (int)initList->getSequence().size()) { + error(loc, "wrong number of matrix columns:", "initializer list", type.getCompleteString().c_str()); + return nullptr; + } + TType vectorType(type, 0); // dereferenced type + for (int i = 0; i < type.getMatrixCols(); ++i) { + initList->getSequence()[i] = convertInitializerList(loc, vectorType, + initList->getSequence()[i]->getAsTyped(), scalarInit); + if (initList->getSequence()[i] == nullptr) + return nullptr; + } + } + } else if (type.isVector()) { + // lengthen list to be long enough + lengthenList(loc, initList->getSequence(), type.getVectorSize(), scalarInit); + + // error check; we're at bottom, so work is finished below + if (type.getVectorSize() != (int)initList->getSequence().size()) { + error(loc, "wrong vector size (or rows in a matrix column):", "initializer list", + type.getCompleteString().c_str()); + return nullptr; + } + } else if (type.isScalar()) { + // lengthen list to be long enough + lengthenList(loc, initList->getSequence(), 1, scalarInit); + + if ((int)initList->getSequence().size() != 1) { + error(loc, "scalar expected one element:", "initializer list", type.getCompleteString().c_str()); + return nullptr; + } + } else { + error(loc, "unexpected initializer-list type:", "initializer list", type.getCompleteString().c_str()); + return nullptr; + } + + // Now that the subtree is processed, process this node as if the + // initializer list is a set of arguments to a constructor. + TIntermTyped* emulatedConstructorArguments; + if (initList->getSequence().size() == 1) + emulatedConstructorArguments = initList->getSequence()[0]->getAsTyped(); + else + emulatedConstructorArguments = initList; + + return addConstructor(loc, emulatedConstructorArguments, type); +} + +// Lengthen list to be long enough to cover any gap from the current list size +// to 'size'. If the list is longer, do nothing. +// The value to lengthen with is the default for short lists. +// +// By default, lists that are too short due to lack of initializers initialize to zero. +// Alternatively, it could be a scalar initializer for a structure. Both cases are handled, +// based on whether something is passed in as 'scalarInit'. +// +// 'scalarInit' must be safe to use each time this is called (no side effects replication). +// +void HlslParseContext::lengthenList(const TSourceLoc& loc, TIntermSequence& list, int size, TIntermTyped* scalarInit) +{ + for (int c = (int)list.size(); c < size; ++c) { + if (scalarInit == nullptr) + list.push_back(intermediate.addConstantUnion(0, loc)); + else + list.push_back(scalarInit); + } +} + +// +// Test for the correctness of the parameters passed to various constructor functions +// and also convert them to the right data type, if allowed and required. +// +// Returns nullptr for an error or the constructed node (aggregate or typed) for no error. +// +TIntermTyped* HlslParseContext::handleConstructor(const TSourceLoc& loc, TIntermTyped* node, const TType& type) +{ + if (node == nullptr) + return nullptr; + + // Construct identical type + if (type == node->getType()) + return node; + + // Handle the idiom "(struct type)" + if (type.isStruct() && isScalarConstructor(node)) { + // 'node' will almost always get used multiple times, so should not be used directly, + // it would create a DAG instead of a tree, which might be okay (would + // like to formalize that for constants and symbols), but if it has + // side effects, they would get executed multiple times, which is not okay. + if (node->getAsConstantUnion() == nullptr && node->getAsSymbolNode() == nullptr) { + TIntermAggregate* seq = intermediate.makeAggregate(loc); + TIntermSymbol* copy = makeInternalVariableNode(loc, "scalarCopy", node->getType()); + seq = intermediate.growAggregate(seq, intermediate.addBinaryNode(EOpAssign, copy, node, loc)); + seq = intermediate.growAggregate(seq, convertInitializerList(loc, type, intermediate.makeAggregate(loc), copy)); + seq->setOp(EOpComma); + seq->setType(type); + return seq; + } else + return convertInitializerList(loc, type, intermediate.makeAggregate(loc), node); + } + + return addConstructor(loc, node, type); +} + +// Add a constructor, either from the grammar, or other programmatic reasons. +// +// 'node' is what to construct from. +// 'type' is what type to construct. +// +// Returns the constructed object. +// Return nullptr if it can't be done. +// +TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyped* node, const TType& type) +{ + TIntermAggregate* aggrNode = node->getAsAggregate(); + TOperator op = intermediate.mapTypeToConstructorOp(type); + + if (op == EOpConstructTextureSampler) + return intermediate.setAggregateOperator(aggrNode, op, type, loc); + + TTypeList::const_iterator memberTypes; + if (op == EOpConstructStruct) + memberTypes = type.getStruct()->begin(); + + TType elementType; + if (type.isArray()) { + TType dereferenced(type, 0); + elementType.shallowCopy(dereferenced); + } else + elementType.shallowCopy(type); + + bool singleArg; + if (aggrNode != nullptr) { + if (aggrNode->getOp() != EOpNull) + singleArg = true; + else + singleArg = false; + } else + singleArg = true; + + TIntermTyped *newNode; + if (singleArg) { + // Handle array -> array conversion + // Constructing an array of one type from an array of another type is allowed, + // assuming there are enough components available (semantic-checked earlier). + if (type.isArray() && node->isArray()) + newNode = convertArray(node, type); + + // If structure constructor or array constructor is being called + // for only one parameter inside the aggregate, we need to call constructAggregate function once. + else if (type.isArray()) + newNode = constructAggregate(node, elementType, 1, node->getLoc()); + else if (op == EOpConstructStruct) + newNode = constructAggregate(node, *(*memberTypes).type, 1, node->getLoc()); + else { + // shape conversion for matrix constructor from scalar. HLSL semantics are: scalar + // is replicated into every element of the matrix (not just the diagnonal), so + // that is handled specially here. + if (type.isMatrix() && node->getType().isScalarOrVec1()) + node = intermediate.addShapeConversion(type, node); + + newNode = constructBuiltIn(type, op, node, node->getLoc(), false); + } + + if (newNode && (type.isArray() || op == EOpConstructStruct)) + newNode = intermediate.setAggregateOperator(newNode, EOpConstructStruct, type, loc); + + return newNode; + } + + // + // Handle list of arguments. + // + TIntermSequence& sequenceVector = aggrNode->getSequence(); // Stores the information about the parameter to the constructor + // if the structure constructor contains more than one parameter, then construct + // each parameter + + int paramCount = 0; // keeps a track of the constructor parameter number being checked + + // for each parameter to the constructor call, check to see if the right type is passed or convert them + // to the right type if possible (and allowed). + // for structure constructors, just check if the right type is passed, no conversion is allowed. + + for (TIntermSequence::iterator p = sequenceVector.begin(); + p != sequenceVector.end(); p++, paramCount++) { + if (type.isArray()) + newNode = constructAggregate(*p, elementType, paramCount + 1, node->getLoc()); + else if (op == EOpConstructStruct) + newNode = constructAggregate(*p, *(memberTypes[paramCount]).type, paramCount + 1, node->getLoc()); + else + newNode = constructBuiltIn(type, op, (*p)->getAsTyped(), node->getLoc(), true); + + if (newNode) + *p = newNode; + else + return nullptr; + } + + TIntermTyped* constructor = intermediate.setAggregateOperator(aggrNode, op, type, loc); + + return constructor; +} + +// Function for constructor implementation. Calls addUnaryMath with appropriate EOp value +// for the parameter to the constructor (passed to this function). Essentially, it converts +// the parameter types correctly. If a constructor expects an int (like ivec2) and is passed a +// float, then float is converted to int. +// +// Returns nullptr for an error or the constructed node. +// +TIntermTyped* HlslParseContext::constructBuiltIn(const TType& type, TOperator op, TIntermTyped* node, + const TSourceLoc& loc, bool subset) +{ + TIntermTyped* newNode; + TOperator basicOp; + + // + // First, convert types as needed. + // + switch (op) { + case EOpConstructF16Vec2: + case EOpConstructF16Vec3: + case EOpConstructF16Vec4: + case EOpConstructF16Mat2x2: + case EOpConstructF16Mat2x3: + case EOpConstructF16Mat2x4: + case EOpConstructF16Mat3x2: + case EOpConstructF16Mat3x3: + case EOpConstructF16Mat3x4: + case EOpConstructF16Mat4x2: + case EOpConstructF16Mat4x3: + case EOpConstructF16Mat4x4: + case EOpConstructFloat16: + basicOp = EOpConstructFloat16; + break; + + case EOpConstructVec2: + case EOpConstructVec3: + case EOpConstructVec4: + case EOpConstructMat2x2: + case EOpConstructMat2x3: + case EOpConstructMat2x4: + case EOpConstructMat3x2: + case EOpConstructMat3x3: + case EOpConstructMat3x4: + case EOpConstructMat4x2: + case EOpConstructMat4x3: + case EOpConstructMat4x4: + case EOpConstructFloat: + basicOp = EOpConstructFloat; + break; + + case EOpConstructDVec2: + case EOpConstructDVec3: + case EOpConstructDVec4: + case EOpConstructDMat2x2: + case EOpConstructDMat2x3: + case EOpConstructDMat2x4: + case EOpConstructDMat3x2: + case EOpConstructDMat3x3: + case EOpConstructDMat3x4: + case EOpConstructDMat4x2: + case EOpConstructDMat4x3: + case EOpConstructDMat4x4: + case EOpConstructDouble: + basicOp = EOpConstructDouble; + break; + + case EOpConstructI16Vec2: + case EOpConstructI16Vec3: + case EOpConstructI16Vec4: + case EOpConstructInt16: + basicOp = EOpConstructInt16; + break; + + case EOpConstructIVec2: + case EOpConstructIVec3: + case EOpConstructIVec4: + case EOpConstructIMat2x2: + case EOpConstructIMat2x3: + case EOpConstructIMat2x4: + case EOpConstructIMat3x2: + case EOpConstructIMat3x3: + case EOpConstructIMat3x4: + case EOpConstructIMat4x2: + case EOpConstructIMat4x3: + case EOpConstructIMat4x4: + case EOpConstructInt: + basicOp = EOpConstructInt; + break; + + case EOpConstructU16Vec2: + case EOpConstructU16Vec3: + case EOpConstructU16Vec4: + case EOpConstructUint16: + basicOp = EOpConstructUint16; + break; + + case EOpConstructUVec2: + case EOpConstructUVec3: + case EOpConstructUVec4: + case EOpConstructUMat2x2: + case EOpConstructUMat2x3: + case EOpConstructUMat2x4: + case EOpConstructUMat3x2: + case EOpConstructUMat3x3: + case EOpConstructUMat3x4: + case EOpConstructUMat4x2: + case EOpConstructUMat4x3: + case EOpConstructUMat4x4: + case EOpConstructUint: + basicOp = EOpConstructUint; + break; + + case EOpConstructBVec2: + case EOpConstructBVec3: + case EOpConstructBVec4: + case EOpConstructBMat2x2: + case EOpConstructBMat2x3: + case EOpConstructBMat2x4: + case EOpConstructBMat3x2: + case EOpConstructBMat3x3: + case EOpConstructBMat3x4: + case EOpConstructBMat4x2: + case EOpConstructBMat4x3: + case EOpConstructBMat4x4: + case EOpConstructBool: + basicOp = EOpConstructBool; + break; + + default: + error(loc, "unsupported construction", "", ""); + + return nullptr; + } + newNode = intermediate.addUnaryMath(basicOp, node, node->getLoc()); + if (newNode == nullptr) { + error(loc, "can't convert", "constructor", ""); + return nullptr; + } + + // + // Now, if there still isn't an operation to do the construction, and we need one, add one. + // + + // Otherwise, skip out early. + if (subset || (newNode != node && newNode->getType() == type)) + return newNode; + + // setAggregateOperator will insert a new node for the constructor, as needed. + return intermediate.setAggregateOperator(newNode, op, type, loc); +} + +// Convert the array in node to the requested type, which is also an array. +// Returns nullptr on failure, otherwise returns aggregate holding the list of +// elements needed to construct the array. +TIntermTyped* HlslParseContext::convertArray(TIntermTyped* node, const TType& type) +{ + assert(node->isArray() && type.isArray()); + if (node->getType().computeNumComponents() < type.computeNumComponents()) + return nullptr; + + // TODO: write an argument replicator, for the case the argument should not be + // executed multiple times, yet multiple copies are needed. + + TIntermTyped* constructee = node->getAsTyped(); + // track where we are in consuming the argument + int constructeeElement = 0; + int constructeeComponent = 0; + + // bump up to the next component to consume + const auto getNextComponent = [&]() { + TIntermTyped* component; + component = handleBracketDereference(node->getLoc(), constructee, + intermediate.addConstantUnion(constructeeElement, node->getLoc())); + if (component->isVector()) + component = handleBracketDereference(node->getLoc(), component, + intermediate.addConstantUnion(constructeeComponent, node->getLoc())); + // bump component pointer up + ++constructeeComponent; + if (constructeeComponent == constructee->getVectorSize()) { + constructeeComponent = 0; + ++constructeeElement; + } + return component; + }; + + // make one subnode per constructed array element + TIntermAggregate* constructor = nullptr; + TType derefType(type, 0); + TType speculativeComponentType(derefType, 0); + TType* componentType = derefType.isVector() ? &speculativeComponentType : &derefType; + TOperator componentOp = intermediate.mapTypeToConstructorOp(*componentType); + TType crossType(node->getBasicType(), EvqTemporary, type.getVectorSize()); + for (int e = 0; e < type.getOuterArraySize(); ++e) { + // construct an element + TIntermTyped* elementArg; + if (type.getVectorSize() == constructee->getVectorSize()) { + // same element shape + elementArg = handleBracketDereference(node->getLoc(), constructee, + intermediate.addConstantUnion(e, node->getLoc())); + } else { + // mismatched element shapes + if (type.getVectorSize() == 1) + elementArg = getNextComponent(); + else { + // make a vector + TIntermAggregate* elementConstructee = nullptr; + for (int c = 0; c < type.getVectorSize(); ++c) + elementConstructee = intermediate.growAggregate(elementConstructee, getNextComponent()); + elementArg = addConstructor(node->getLoc(), elementConstructee, crossType); + } + } + // convert basic types + elementArg = intermediate.addConversion(componentOp, derefType, elementArg); + if (elementArg == nullptr) + return nullptr; + // combine with top-level constructor + constructor = intermediate.growAggregate(constructor, elementArg); + } + + return constructor; +} + +// This function tests for the type of the parameters to the structure or array constructor. Raises +// an error message if the expected type does not match the parameter passed to the constructor. +// +// Returns nullptr for an error or the input node itself if the expected and the given parameter types match. +// +TIntermTyped* HlslParseContext::constructAggregate(TIntermNode* node, const TType& type, int paramCount, + const TSourceLoc& loc) +{ + // Handle cases that map more 1:1 between constructor arguments and constructed. + TIntermTyped* converted = intermediate.addConversion(EOpConstructStruct, type, node->getAsTyped()); + if (converted == nullptr || converted->getType() != type) { + error(loc, "", "constructor", "cannot convert parameter %d from '%s' to '%s'", paramCount, + node->getAsTyped()->getType().getCompleteString().c_str(), type.getCompleteString().c_str()); + + return nullptr; + } + + return converted; +} + +// +// Do everything needed to add an interface block. +// +void HlslParseContext::declareBlock(const TSourceLoc& loc, TType& type, const TString* instanceName) +{ + assert(type.getWritableStruct() != nullptr); + + // Clean up top-level decorations that don't belong. + switch (type.getQualifier().storage) { + case EvqUniform: + case EvqBuffer: + correctUniform(type.getQualifier()); + break; + case EvqVaryingIn: + correctInput(type.getQualifier()); + break; + case EvqVaryingOut: + correctOutput(type.getQualifier()); + break; + default: + break; + } + + TTypeList& typeList = *type.getWritableStruct(); + // fix and check for member storage qualifiers and types that don't belong within a block + for (unsigned int member = 0; member < typeList.size(); ++member) { + TType& memberType = *typeList[member].type; + TQualifier& memberQualifier = memberType.getQualifier(); + const TSourceLoc& memberLoc = typeList[member].loc; + globalQualifierFix(memberLoc, memberQualifier); + memberQualifier.storage = type.getQualifier().storage; + + if (memberType.isStruct()) { + // clean up and pick up the right set of decorations + auto it = ioTypeMap.find(memberType.getStruct()); + switch (type.getQualifier().storage) { + case EvqUniform: + case EvqBuffer: + correctUniform(type.getQualifier()); + if (it != ioTypeMap.end() && it->second.uniform) + memberType.setStruct(it->second.uniform); + break; + case EvqVaryingIn: + correctInput(type.getQualifier()); + if (it != ioTypeMap.end() && it->second.input) + memberType.setStruct(it->second.input); + break; + case EvqVaryingOut: + correctOutput(type.getQualifier()); + if (it != ioTypeMap.end() && it->second.output) + memberType.setStruct(it->second.output); + break; + default: + break; + } + } + } + + // Make default block qualification, and adjust the member qualifications + + TQualifier defaultQualification; + switch (type.getQualifier().storage) { + case EvqUniform: defaultQualification = globalUniformDefaults; break; + case EvqBuffer: defaultQualification = globalBufferDefaults; break; + case EvqVaryingIn: defaultQualification = globalInputDefaults; break; + case EvqVaryingOut: defaultQualification = globalOutputDefaults; break; + default: defaultQualification.clear(); break; + } + + // Special case for "push_constant uniform", which has a default of std430, + // contrary to normal uniform defaults, and can't have a default tracked for it. + if (type.getQualifier().layoutPushConstant && ! type.getQualifier().hasPacking()) + type.getQualifier().layoutPacking = ElpStd430; + + // fix and check for member layout qualifiers + + mergeObjectLayoutQualifiers(defaultQualification, type.getQualifier(), true); + + bool memberWithLocation = false; + bool memberWithoutLocation = false; + for (unsigned int member = 0; member < typeList.size(); ++member) { + TQualifier& memberQualifier = typeList[member].type->getQualifier(); + const TSourceLoc& memberLoc = typeList[member].loc; + if (memberQualifier.hasStream()) { + if (defaultQualification.layoutStream != memberQualifier.layoutStream) + error(memberLoc, "member cannot contradict block", "stream", ""); + } + + // "This includes a block's inheritance of the + // current global default buffer, a block member's inheritance of the block's + // buffer, and the requirement that any *xfb_buffer* declared on a block + // member must match the buffer inherited from the block." + if (memberQualifier.hasXfbBuffer()) { + if (defaultQualification.layoutXfbBuffer != memberQualifier.layoutXfbBuffer) + error(memberLoc, "member cannot contradict block (or what block inherited from global)", "xfb_buffer", ""); + } + + if (memberQualifier.hasLocation()) { + switch (type.getQualifier().storage) { + case EvqVaryingIn: + case EvqVaryingOut: + memberWithLocation = true; + break; + default: + break; + } + } else + memberWithoutLocation = true; + + TQualifier newMemberQualification = defaultQualification; + mergeQualifiers(newMemberQualification, memberQualifier); + memberQualifier = newMemberQualification; + } + + // Process the members + fixBlockLocations(loc, type.getQualifier(), typeList, memberWithLocation, memberWithoutLocation); + fixXfbOffsets(type.getQualifier(), typeList); + fixBlockUniformOffsets(type.getQualifier(), typeList); + + // reverse merge, so that currentBlockQualifier now has all layout information + // (can't use defaultQualification directly, it's missing other non-layout-default-class qualifiers) + mergeObjectLayoutQualifiers(type.getQualifier(), defaultQualification, true); + + // + // Build and add the interface block as a new type named 'blockName' + // + + // Use the instance name as the interface name if one exists, else the block name. + const TString& interfaceName = (instanceName && !instanceName->empty()) ? *instanceName : type.getTypeName(); + + TType blockType(&typeList, interfaceName, type.getQualifier()); + if (type.isArray()) + blockType.transferArraySizes(type.getArraySizes()); + + // Add the variable, as anonymous or named instanceName. + // Make an anonymous variable if no name was provided. + if (instanceName == nullptr) + instanceName = NewPoolTString(""); + + TVariable& variable = *new TVariable(instanceName, blockType); + if (! symbolTable.insert(variable)) { + if (*instanceName == "") + error(loc, "nameless block contains a member that already has a name at global scope", + "" /* blockName->c_str() */, ""); + else + error(loc, "block instance name redefinition", variable.getName().c_str(), ""); + + return; + } + + // Save it in the AST for linker use. + if (symbolTable.atGlobalLevel()) + trackLinkage(variable); +} + +// +// "For a block, this process applies to the entire block, or until the first member +// is reached that has a location layout qualifier. When a block member is declared with a location +// qualifier, its location comes from that qualifier: The member's location qualifier overrides the block-level +// declaration. Subsequent members are again assigned consecutive locations, based on the newest location, +// until the next member declared with a location qualifier. The values used for locations do not have to be +// declared in increasing order." +void HlslParseContext::fixBlockLocations(const TSourceLoc& loc, TQualifier& qualifier, TTypeList& typeList, bool memberWithLocation, bool memberWithoutLocation) +{ + // "If a block has no block-level location layout qualifier, it is required that either all or none of its members + // have a location layout qualifier, or a compile-time error results." + if (! qualifier.hasLocation() && memberWithLocation && memberWithoutLocation) + error(loc, "either the block needs a location, or all members need a location, or no members have a location", "location", ""); + else { + if (memberWithLocation) { + // remove any block-level location and make it per *every* member + int nextLocation = 0; // by the rule above, initial value is not relevant + if (qualifier.hasAnyLocation()) { + nextLocation = qualifier.layoutLocation; + qualifier.layoutLocation = TQualifier::layoutLocationEnd; + if (qualifier.hasComponent()) { + // "It is a compile-time error to apply the *component* qualifier to a ... block" + error(loc, "cannot apply to a block", "component", ""); + } + if (qualifier.hasIndex()) { + error(loc, "cannot apply to a block", "index", ""); + } + } + for (unsigned int member = 0; member < typeList.size(); ++member) { + TQualifier& memberQualifier = typeList[member].type->getQualifier(); + const TSourceLoc& memberLoc = typeList[member].loc; + if (! memberQualifier.hasLocation()) { + if (nextLocation >= (int)TQualifier::layoutLocationEnd) + error(memberLoc, "location is too large", "location", ""); + memberQualifier.layoutLocation = nextLocation; + memberQualifier.layoutComponent = 0; + } + nextLocation = memberQualifier.layoutLocation + + intermediate.computeTypeLocationSize(*typeList[member].type, language); + } + } + } +} + +void HlslParseContext::fixXfbOffsets(TQualifier& qualifier, TTypeList& typeList) +{ + // "If a block is qualified with xfb_offset, all its + // members are assigned transform feedback buffer offsets. If a block is not qualified with xfb_offset, any + // members of that block not qualified with an xfb_offset will not be assigned transform feedback buffer + // offsets." + + if (! qualifier.hasXfbBuffer() || ! qualifier.hasXfbOffset()) + return; + + int nextOffset = qualifier.layoutXfbOffset; + for (unsigned int member = 0; member < typeList.size(); ++member) { + TQualifier& memberQualifier = typeList[member].type->getQualifier(); + bool contains64BitType = false; + bool contains32BitType = false; + bool contains16BitType = false; + int memberSize = intermediate.computeTypeXfbSize(*typeList[member].type, contains64BitType, contains32BitType, contains16BitType); + // see if we need to auto-assign an offset to this member + if (! memberQualifier.hasXfbOffset()) { + // "if applied to an aggregate containing a double or 64-bit integer, the offset must also be a multiple of 8" + if (contains64BitType) + RoundToPow2(nextOffset, 8); + else if (contains32BitType) + RoundToPow2(nextOffset, 4); + // "if applied to an aggregate containing a half float or 16-bit integer, the offset must also be a multiple of 2" + else if (contains16BitType) + RoundToPow2(nextOffset, 2); + memberQualifier.layoutXfbOffset = nextOffset; + } else + nextOffset = memberQualifier.layoutXfbOffset; + nextOffset += memberSize; + } + + // The above gave all block members an offset, so we can take it off the block now, + // which will avoid double counting the offset usage. + qualifier.layoutXfbOffset = TQualifier::layoutXfbOffsetEnd; +} + +// Calculate and save the offset of each block member, using the recursively +// defined block offset rules and the user-provided offset and align. +// +// Also, compute and save the total size of the block. For the block's size, arrayness +// is not taken into account, as each element is backed by a separate buffer. +// +void HlslParseContext::fixBlockUniformOffsets(const TQualifier& qualifier, TTypeList& typeList) +{ + if (! qualifier.isUniformOrBuffer()) + return; + if (qualifier.layoutPacking != ElpStd140 && qualifier.layoutPacking != ElpStd430 && qualifier.layoutPacking != ElpScalar) + return; + + int offset = 0; + int memberSize; + for (unsigned int member = 0; member < typeList.size(); ++member) { + TQualifier& memberQualifier = typeList[member].type->getQualifier(); + const TSourceLoc& memberLoc = typeList[member].loc; + + // "When align is applied to an array, it effects only the start of the array, not the array's internal stride." + + // modify just the children's view of matrix layout, if there is one for this member + TLayoutMatrix subMatrixLayout = typeList[member].type->getQualifier().layoutMatrix; + int dummyStride; + int memberAlignment = intermediate.getMemberAlignment(*typeList[member].type, memberSize, dummyStride, + qualifier.layoutPacking, + subMatrixLayout != ElmNone + ? subMatrixLayout == ElmRowMajor + : qualifier.layoutMatrix == ElmRowMajor); + if (memberQualifier.hasOffset()) { + // "The specified offset must be a multiple + // of the base alignment of the type of the block member it qualifies, or a compile-time error results." + if (! IsMultipleOfPow2(memberQualifier.layoutOffset, memberAlignment)) + error(memberLoc, "must be a multiple of the member's alignment", "offset", + "(layout offset = %d | member alignment = %d)", memberQualifier.layoutOffset, memberAlignment); + + // "The offset qualifier forces the qualified member to start at or after the specified + // integral-constant expression, which will be its byte offset from the beginning of the buffer. + // "The actual offset of a member is computed as + // follows: If offset was declared, start with that offset, otherwise start with the next available offset." + offset = std::max(offset, memberQualifier.layoutOffset); + } + + // "The actual alignment of a member will be the greater of the specified align alignment and the standard + // (e.g., std140) base alignment for the member's type." + if (memberQualifier.hasAlign()) + memberAlignment = std::max(memberAlignment, memberQualifier.layoutAlign); + + // "If the resulting offset is not a multiple of the actual alignment, + // increase it to the first offset that is a multiple of + // the actual alignment." + RoundToPow2(offset, memberAlignment); + typeList[member].type->getQualifier().layoutOffset = offset; + offset += memberSize; + } +} + +// For an identifier that is already declared, add more qualification to it. +void HlslParseContext::addQualifierToExisting(const TSourceLoc& loc, TQualifier qualifier, const TString& identifier) +{ + TSymbol* symbol = symbolTable.find(identifier); + if (symbol == nullptr) { + error(loc, "identifier not previously declared", identifier.c_str(), ""); + return; + } + if (symbol->getAsFunction()) { + error(loc, "cannot re-qualify a function name", identifier.c_str(), ""); + return; + } + + if (qualifier.isAuxiliary() || + qualifier.isMemory() || + qualifier.isInterpolation() || + qualifier.hasLayout() || + qualifier.storage != EvqTemporary || + qualifier.precision != EpqNone) { + error(loc, "cannot add storage, auxiliary, memory, interpolation, layout, or precision qualifier to an existing variable", identifier.c_str(), ""); + return; + } + + // For read-only built-ins, add a new symbol for holding the modified qualifier. + // This will bring up an entire block, if a block type has to be modified (e.g., gl_Position inside a block) + if (symbol->isReadOnly()) + symbol = symbolTable.copyUp(symbol); + + if (qualifier.invariant) { + if (intermediate.inIoAccessed(identifier)) + error(loc, "cannot change qualification after use", "invariant", ""); + symbol->getWritableType().getQualifier().invariant = true; + } else if (qualifier.noContraction) { + if (intermediate.inIoAccessed(identifier)) + error(loc, "cannot change qualification after use", "precise", ""); + symbol->getWritableType().getQualifier().noContraction = true; + } else if (qualifier.specConstant) { + symbol->getWritableType().getQualifier().makeSpecConstant(); + if (qualifier.hasSpecConstantId()) + symbol->getWritableType().getQualifier().layoutSpecConstantId = qualifier.layoutSpecConstantId; + } else + warn(loc, "unknown requalification", "", ""); +} + +void HlslParseContext::addQualifierToExisting(const TSourceLoc& loc, TQualifier qualifier, TIdentifierList& identifiers) +{ + for (unsigned int i = 0; i < identifiers.size(); ++i) + addQualifierToExisting(loc, qualifier, *identifiers[i]); +} + +// +// Update the intermediate for the given input geometry +// +bool HlslParseContext::handleInputGeometry(const TSourceLoc& loc, const TLayoutGeometry& geometry) +{ + // these can be declared on non-entry-points, in which case they lose their meaning + if (! parsingEntrypointParameters) + return true; + + switch (geometry) { + case ElgPoints: // fall through + case ElgLines: // ... + case ElgTriangles: // ... + case ElgLinesAdjacency: // ... + case ElgTrianglesAdjacency: // ... + if (! intermediate.setInputPrimitive(geometry)) { + error(loc, "input primitive geometry redefinition", TQualifier::getGeometryString(geometry), ""); + return false; + } + break; + + default: + error(loc, "cannot apply to 'in'", TQualifier::getGeometryString(geometry), ""); + return false; + } + + return true; +} + +// +// Update the intermediate for the given output geometry +// +bool HlslParseContext::handleOutputGeometry(const TSourceLoc& loc, const TLayoutGeometry& geometry) +{ + // If this is not a geometry shader, ignore. It might be a mixed shader including several stages. + // Since that's an OK situation, return true for success. + if (language != EShLangGeometry) + return true; + + // these can be declared on non-entry-points, in which case they lose their meaning + if (! parsingEntrypointParameters) + return true; + + switch (geometry) { + case ElgPoints: + case ElgLineStrip: + case ElgTriangleStrip: + if (! intermediate.setOutputPrimitive(geometry)) { + error(loc, "output primitive geometry redefinition", TQualifier::getGeometryString(geometry), ""); + return false; + } + break; + default: + error(loc, "cannot apply to 'out'", TQualifier::getGeometryString(geometry), ""); + return false; + } + + return true; +} + +// +// Selection attributes +// +void HlslParseContext::handleSelectionAttributes(const TSourceLoc& loc, TIntermSelection* selection, + const TAttributes& attributes) +{ + if (selection == nullptr) + return; + + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + switch (it->name) { + case EatFlatten: + selection->setFlatten(); + break; + case EatBranch: + selection->setDontFlatten(); + break; + default: + warn(loc, "attribute does not apply to a selection", "", ""); + break; + } + } +} + +// +// Switch attributes +// +void HlslParseContext::handleSwitchAttributes(const TSourceLoc& loc, TIntermSwitch* selection, + const TAttributes& attributes) +{ + if (selection == nullptr) + return; + + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + switch (it->name) { + case EatFlatten: + selection->setFlatten(); + break; + case EatBranch: + selection->setDontFlatten(); + break; + default: + warn(loc, "attribute does not apply to a switch", "", ""); + break; + } + } +} + +// +// Loop attributes +// +void HlslParseContext::handleLoopAttributes(const TSourceLoc& loc, TIntermLoop* loop, + const TAttributes& attributes) +{ + if (loop == nullptr) + return; + + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + switch (it->name) { + case EatUnroll: + loop->setUnroll(); + break; + case EatLoop: + loop->setDontUnroll(); + break; + default: + warn(loc, "attribute does not apply to a loop", "", ""); + break; + } + } +} + +// +// Updating default qualifier for the case of a declaration with just a qualifier, +// no type, block, or identifier. +// +void HlslParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, const TPublicType& publicType) +{ + if (publicType.shaderQualifiers.vertices != TQualifier::layoutNotSet) { + assert(language == EShLangTessControl || language == EShLangGeometry); + // const char* id = (language == EShLangTessControl) ? "vertices" : "max_vertices"; + } + if (publicType.shaderQualifiers.invocations != TQualifier::layoutNotSet) { + if (! intermediate.setInvocations(publicType.shaderQualifiers.invocations)) + error(loc, "cannot change previously set layout value", "invocations", ""); + } + if (publicType.shaderQualifiers.geometry != ElgNone) { + if (publicType.qualifier.storage == EvqVaryingIn) { + switch (publicType.shaderQualifiers.geometry) { + case ElgPoints: + case ElgLines: + case ElgLinesAdjacency: + case ElgTriangles: + case ElgTrianglesAdjacency: + case ElgQuads: + case ElgIsolines: + break; + default: + error(loc, "cannot apply to input", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), + ""); + } + } else if (publicType.qualifier.storage == EvqVaryingOut) { + handleOutputGeometry(loc, publicType.shaderQualifiers.geometry); + } else + error(loc, "cannot apply to:", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), + GetStorageQualifierString(publicType.qualifier.storage)); + } + if (publicType.shaderQualifiers.spacing != EvsNone) + intermediate.setVertexSpacing(publicType.shaderQualifiers.spacing); + if (publicType.shaderQualifiers.order != EvoNone) + intermediate.setVertexOrder(publicType.shaderQualifiers.order); + if (publicType.shaderQualifiers.pointMode) + intermediate.setPointMode(); + for (int i = 0; i < 3; ++i) { + if (publicType.shaderQualifiers.localSize[i] > 1) { + int max = 0; + switch (i) { + case 0: max = resources.maxComputeWorkGroupSizeX; break; + case 1: max = resources.maxComputeWorkGroupSizeY; break; + case 2: max = resources.maxComputeWorkGroupSizeZ; break; + default: break; + } + if (intermediate.getLocalSize(i) > (unsigned int)max) + error(loc, "too large; see gl_MaxComputeWorkGroupSize", "local_size", ""); + + // Fix the existing constant gl_WorkGroupSize with this new information. + TVariable* workGroupSize = getEditableVariable("gl_WorkGroupSize"); + workGroupSize->getWritableConstArray()[i].setUConst(intermediate.getLocalSize(i)); + } + if (publicType.shaderQualifiers.localSizeSpecId[i] != TQualifier::layoutNotSet) { + intermediate.setLocalSizeSpecId(i, publicType.shaderQualifiers.localSizeSpecId[i]); + // Set the workgroup built-in variable as a specialization constant + TVariable* workGroupSize = getEditableVariable("gl_WorkGroupSize"); + workGroupSize->getWritableType().getQualifier().specConstant = true; + } + } + if (publicType.shaderQualifiers.earlyFragmentTests) + intermediate.setEarlyFragmentTests(); + + const TQualifier& qualifier = publicType.qualifier; + + switch (qualifier.storage) { + case EvqUniform: + if (qualifier.hasMatrix()) + globalUniformDefaults.layoutMatrix = qualifier.layoutMatrix; + if (qualifier.hasPacking()) + globalUniformDefaults.layoutPacking = qualifier.layoutPacking; + break; + case EvqBuffer: + if (qualifier.hasMatrix()) + globalBufferDefaults.layoutMatrix = qualifier.layoutMatrix; + if (qualifier.hasPacking()) + globalBufferDefaults.layoutPacking = qualifier.layoutPacking; + break; + case EvqVaryingIn: + break; + case EvqVaryingOut: + if (qualifier.hasStream()) + globalOutputDefaults.layoutStream = qualifier.layoutStream; + if (qualifier.hasXfbBuffer()) + globalOutputDefaults.layoutXfbBuffer = qualifier.layoutXfbBuffer; + if (globalOutputDefaults.hasXfbBuffer() && qualifier.hasXfbStride()) { + if (! intermediate.setXfbBufferStride(globalOutputDefaults.layoutXfbBuffer, qualifier.layoutXfbStride)) + error(loc, "all stride settings must match for xfb buffer", "xfb_stride", "%d", + qualifier.layoutXfbBuffer); + } + break; + default: + error(loc, "default qualifier requires 'uniform', 'buffer', 'in', or 'out' storage qualification", "", ""); + return; + } +} + +// +// Take the sequence of statements that has been built up since the last case/default, +// put it on the list of top-level nodes for the current (inner-most) switch statement, +// and follow that by the case/default we are on now. (See switch topology comment on +// TIntermSwitch.) +// +void HlslParseContext::wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode) +{ + TIntermSequence* switchSequence = switchSequenceStack.back(); + + if (statements) { + statements->setOperator(EOpSequence); + switchSequence->push_back(statements); + } + if (branchNode) { + // check all previous cases for the same label (or both are 'default') + for (unsigned int s = 0; s < switchSequence->size(); ++s) { + TIntermBranch* prevBranch = (*switchSequence)[s]->getAsBranchNode(); + if (prevBranch) { + TIntermTyped* prevExpression = prevBranch->getExpression(); + TIntermTyped* newExpression = branchNode->getAsBranchNode()->getExpression(); + if (prevExpression == nullptr && newExpression == nullptr) + error(branchNode->getLoc(), "duplicate label", "default", ""); + else if (prevExpression != nullptr && + newExpression != nullptr && + prevExpression->getAsConstantUnion() && + newExpression->getAsConstantUnion() && + prevExpression->getAsConstantUnion()->getConstArray()[0].getIConst() == + newExpression->getAsConstantUnion()->getConstArray()[0].getIConst()) + error(branchNode->getLoc(), "duplicated value", "case", ""); + } + } + switchSequence->push_back(branchNode); + } +} + +// +// Turn the top-level node sequence built up of wrapupSwitchSubsequence +// into a switch node. +// +TIntermNode* HlslParseContext::addSwitch(const TSourceLoc& loc, TIntermTyped* expression, + TIntermAggregate* lastStatements, const TAttributes& attributes) +{ + wrapupSwitchSubsequence(lastStatements, nullptr); + + if (expression == nullptr || + (expression->getBasicType() != EbtInt && expression->getBasicType() != EbtUint) || + expression->getType().isArray() || expression->getType().isMatrix() || expression->getType().isVector()) + error(loc, "condition must be a scalar integer expression", "switch", ""); + + // If there is nothing to do, drop the switch but still execute the expression + TIntermSequence* switchSequence = switchSequenceStack.back(); + if (switchSequence->size() == 0) + return expression; + + if (lastStatements == nullptr) { + // emulate a break for error recovery + lastStatements = intermediate.makeAggregate(intermediate.addBranch(EOpBreak, loc)); + lastStatements->setOperator(EOpSequence); + switchSequence->push_back(lastStatements); + } + + TIntermAggregate* body = new TIntermAggregate(EOpSequence); + body->getSequence() = *switchSequenceStack.back(); + body->setLoc(loc); + + TIntermSwitch* switchNode = new TIntermSwitch(expression, body); + switchNode->setLoc(loc); + handleSwitchAttributes(loc, switchNode, attributes); + + return switchNode; +} + +// Make a new symbol-table level that is made out of the members of a structure. +// This should be done as an anonymous struct (name is "") so that the symbol table +// finds the members with no explicit reference to a 'this' variable. +void HlslParseContext::pushThisScope(const TType& thisStruct, const TVector& functionDeclarators) +{ + // member variables + TVariable& thisVariable = *new TVariable(NewPoolTString(""), thisStruct); + symbolTable.pushThis(thisVariable); + + // member functions + for (auto it = functionDeclarators.begin(); it != functionDeclarators.end(); ++it) { + // member should have a prefix matching currentTypePrefix.back() + // but, symbol lookup within the class scope will just use the + // unprefixed name. Hence, there are two: one fully prefixed and + // one with no prefix. + TFunction& member = *it->function->clone(); + member.removePrefix(currentTypePrefix.back()); + symbolTable.insert(member); + } +} + +// Track levels of class/struct/namespace nesting with a prefix string using +// the type names separated by the scoping operator. E.g., two levels +// would look like: +// +// outer::inner +// +// The string is empty when at normal global level. +// +void HlslParseContext::pushNamespace(const TString& typeName) +{ + // make new type prefix + TString newPrefix; + if (currentTypePrefix.size() > 0) + newPrefix = currentTypePrefix.back(); + newPrefix.append(typeName); + newPrefix.append(scopeMangler); + currentTypePrefix.push_back(newPrefix); +} + +// Opposite of pushNamespace(), see above +void HlslParseContext::popNamespace() +{ + currentTypePrefix.pop_back(); +} + +// Use the class/struct nesting string to create a global name for +// a member of a class/struct. +void HlslParseContext::getFullNamespaceName(TString*& name) const +{ + if (currentTypePrefix.size() == 0) + return; + + TString* fullName = NewPoolTString(currentTypePrefix.back().c_str()); + fullName->append(*name); + name = fullName; +} + +// Helper function to add the namespace scope mangling syntax to a string. +void HlslParseContext::addScopeMangler(TString& name) +{ + name.append(scopeMangler); +} + +// Return true if this has uniform-interface like decorations. +bool HlslParseContext::hasUniform(const TQualifier& qualifier) const +{ + return qualifier.hasUniformLayout() || + qualifier.layoutPushConstant; +} + +// Potentially not the opposite of hasUniform(), as if some characteristic is +// ever used for more than one thing (e.g., uniform or input), hasUniform() should +// say it exists, but clearUniform() should leave it in place. +void HlslParseContext::clearUniform(TQualifier& qualifier) +{ + qualifier.clearUniformLayout(); + qualifier.layoutPushConstant = false; +} + +// Return false if builtIn by itself doesn't force this qualifier to be an input qualifier. +bool HlslParseContext::isInputBuiltIn(const TQualifier& qualifier) const +{ + switch (qualifier.builtIn) { + case EbvPosition: + case EbvPointSize: + return language != EShLangVertex && language != EShLangCompute && language != EShLangFragment; + case EbvClipDistance: + case EbvCullDistance: + return language != EShLangVertex && language != EShLangCompute; + case EbvFragCoord: + case EbvFace: + case EbvHelperInvocation: + case EbvLayer: + case EbvPointCoord: + case EbvSampleId: + case EbvSampleMask: + case EbvSamplePosition: + case EbvViewportIndex: + return language == EShLangFragment; + case EbvGlobalInvocationId: + case EbvLocalInvocationIndex: + case EbvLocalInvocationId: + case EbvNumWorkGroups: + case EbvWorkGroupId: + case EbvWorkGroupSize: + return language == EShLangCompute; + case EbvInvocationId: + return language == EShLangTessControl || language == EShLangTessEvaluation || language == EShLangGeometry; + case EbvPatchVertices: + return language == EShLangTessControl || language == EShLangTessEvaluation; + case EbvInstanceId: + case EbvInstanceIndex: + case EbvVertexId: + case EbvVertexIndex: + return language == EShLangVertex; + case EbvPrimitiveId: + return language == EShLangGeometry || language == EShLangFragment || language == EShLangTessControl; + case EbvTessLevelInner: + case EbvTessLevelOuter: + return language == EShLangTessEvaluation; + case EbvTessCoord: + return language == EShLangTessEvaluation; + case EbvViewIndex: + return language != EShLangCompute; + default: + return false; + } +} + +// Return true if there are decorations to preserve for input-like storage. +bool HlslParseContext::hasInput(const TQualifier& qualifier) const +{ + if (qualifier.hasAnyLocation()) + return true; + + if (language == EShLangFragment && (qualifier.isInterpolation() || qualifier.centroid || qualifier.sample)) + return true; + + if (language == EShLangTessEvaluation && qualifier.patch) + return true; + + if (isInputBuiltIn(qualifier)) + return true; + + return false; +} + +// Return false if builtIn by itself doesn't force this qualifier to be an output qualifier. +bool HlslParseContext::isOutputBuiltIn(const TQualifier& qualifier) const +{ + switch (qualifier.builtIn) { + case EbvPosition: + case EbvPointSize: + case EbvClipVertex: + case EbvClipDistance: + case EbvCullDistance: + return language != EShLangFragment && language != EShLangCompute; + case EbvFragDepth: + case EbvFragDepthGreater: + case EbvFragDepthLesser: + case EbvSampleMask: + return language == EShLangFragment; + case EbvLayer: + case EbvViewportIndex: + return language == EShLangGeometry || language == EShLangVertex; + case EbvPrimitiveId: + return language == EShLangGeometry; + case EbvTessLevelInner: + case EbvTessLevelOuter: + return language == EShLangTessControl; + default: + return false; + } +} + +// Return true if there are decorations to preserve for output-like storage. +bool HlslParseContext::hasOutput(const TQualifier& qualifier) const +{ + if (qualifier.hasAnyLocation()) + return true; + + if (language != EShLangFragment && language != EShLangCompute && qualifier.hasXfb()) + return true; + + if (language == EShLangTessControl && qualifier.patch) + return true; + + if (language == EShLangGeometry && qualifier.hasStream()) + return true; + + if (isOutputBuiltIn(qualifier)) + return true; + + return false; +} + +// Make the IO decorations etc. be appropriate only for an input interface. +void HlslParseContext::correctInput(TQualifier& qualifier) +{ + clearUniform(qualifier); + if (language == EShLangVertex) + qualifier.clearInterstage(); + if (language != EShLangTessEvaluation) + qualifier.patch = false; + if (language != EShLangFragment) { + qualifier.clearInterpolation(); + qualifier.sample = false; + } + + qualifier.clearStreamLayout(); + qualifier.clearXfbLayout(); + + if (! isInputBuiltIn(qualifier)) + qualifier.builtIn = EbvNone; +} + +// Make the IO decorations etc. be appropriate only for an output interface. +void HlslParseContext::correctOutput(TQualifier& qualifier) +{ + clearUniform(qualifier); + if (language == EShLangFragment) + qualifier.clearInterstage(); + if (language != EShLangGeometry) + qualifier.clearStreamLayout(); + if (language == EShLangFragment) + qualifier.clearXfbLayout(); + if (language != EShLangTessControl) + qualifier.patch = false; + + // Fixes Test/hlsl.entry-inout.vert (SV_Position will not become a varying). + if (qualifier.builtIn == EbvNone) + qualifier.builtIn = qualifier.declaredBuiltIn; + + switch (qualifier.builtIn) { + case EbvFragDepth: + intermediate.setDepthReplacing(); + intermediate.setDepth(EldAny); + break; + case EbvFragDepthGreater: + intermediate.setDepthReplacing(); + intermediate.setDepth(EldGreater); + qualifier.builtIn = EbvFragDepth; + break; + case EbvFragDepthLesser: + intermediate.setDepthReplacing(); + intermediate.setDepth(EldLess); + qualifier.builtIn = EbvFragDepth; + break; + default: + break; + } + + if (! isOutputBuiltIn(qualifier)) + qualifier.builtIn = EbvNone; +} + +// Make the IO decorations etc. be appropriate only for uniform type interfaces. +void HlslParseContext::correctUniform(TQualifier& qualifier) +{ + if (qualifier.declaredBuiltIn == EbvNone) + qualifier.declaredBuiltIn = qualifier.builtIn; + + qualifier.builtIn = EbvNone; + qualifier.clearInterstage(); + qualifier.clearInterstageLayout(); +} + +// Clear out all IO/Uniform stuff, so this has nothing to do with being an IO interface. +void HlslParseContext::clearUniformInputOutput(TQualifier& qualifier) +{ + clearUniform(qualifier); + correctUniform(qualifier); +} + + +// Set texture return type. Returns success (not all types are valid). +bool HlslParseContext::setTextureReturnType(TSampler& sampler, const TType& retType, const TSourceLoc& loc) +{ + // Seed the output with an invalid index. We will set it to a valid one if we can. + sampler.structReturnIndex = TSampler::noReturnStruct; + + // Arrays aren't supported. + if (retType.isArray()) { + error(loc, "Arrays not supported in texture template types", "", ""); + return false; + } + + // If return type is a vector, remember the vector size in the sampler, and return. + if (retType.isVector() || retType.isScalar()) { + sampler.vectorSize = retType.getVectorSize(); + return true; + } + + // If it wasn't a vector, it must be a struct meeting certain requirements. The requirements + // are checked below: just check for struct-ness here. + if (!retType.isStruct()) { + error(loc, "Invalid texture template type", "", ""); + return false; + } + + // TODO: Subpass doesn't handle struct returns, due to some oddities with fn overloading. + if (sampler.isSubpass()) { + error(loc, "Unimplemented: structure template type in subpass input", "", ""); + return false; + } + + TTypeList* members = retType.getWritableStruct(); + + // Check for too many or not enough structure members. + if (members->size() > 4 || members->size() == 0) { + error(loc, "Invalid member count in texture template structure", "", ""); + return false; + } + + // Error checking: We must have <= 4 total components, all of the same basic type. + unsigned totalComponents = 0; + for (unsigned m = 0; m < members->size(); ++m) { + // Check for bad member types + if (!(*members)[m].type->isScalar() && !(*members)[m].type->isVector()) { + error(loc, "Invalid texture template struct member type", "", ""); + return false; + } + + const unsigned memberVectorSize = (*members)[m].type->getVectorSize(); + totalComponents += memberVectorSize; + + // too many total member components + if (totalComponents > 4) { + error(loc, "Too many components in texture template structure type", "", ""); + return false; + } + + // All members must be of a common basic type + if ((*members)[m].type->getBasicType() != (*members)[0].type->getBasicType()) { + error(loc, "Texture template structure members must same basic type", "", ""); + return false; + } + } + + // If the structure in the return type already exists in the table, we'll use it. Otherwise, we'll make + // a new entry. This is a linear search, but it hardly ever happens, and the list cannot be very large. + for (unsigned int idx = 0; idx < textureReturnStruct.size(); ++idx) { + if (textureReturnStruct[idx] == members) { + sampler.structReturnIndex = idx; + return true; + } + } + + // It wasn't found as an existing entry. See if we have room for a new one. + if (textureReturnStruct.size() >= TSampler::structReturnSlots) { + error(loc, "Texture template struct return slots exceeded", "", ""); + return false; + } + + // Insert it in the vector that tracks struct return types. + sampler.structReturnIndex = unsigned(textureReturnStruct.size()); + textureReturnStruct.push_back(members); + + // Success! + return true; +} + +// Return the sampler return type in retType. +void HlslParseContext::getTextureReturnType(const TSampler& sampler, TType& retType) const +{ + if (sampler.hasReturnStruct()) { + assert(textureReturnStruct.size() >= sampler.structReturnIndex); + + // We land here if the texture return is a structure. + TTypeList* blockStruct = textureReturnStruct[sampler.structReturnIndex]; + + const TType resultType(blockStruct, ""); + retType.shallowCopy(resultType); + } else { + // We land here if the texture return is a vector or scalar. + const TType resultType(sampler.type, EvqTemporary, sampler.getVectorSize()); + retType.shallowCopy(resultType); + } +} + + +// Return a symbol for the tessellation linkage variable of the given TBuiltInVariable type +TIntermSymbol* HlslParseContext::findTessLinkageSymbol(TBuiltInVariable biType) const +{ + const auto it = builtInTessLinkageSymbols.find(biType); + if (it == builtInTessLinkageSymbols.end()) // if it wasn't declared by the user, return nullptr + return nullptr; + + return intermediate.addSymbol(*it->second->getAsVariable()); +} + +// Find the patch constant function (issues error, returns nullptr if not found) +const TFunction* HlslParseContext::findPatchConstantFunction(const TSourceLoc& loc) +{ + if (symbolTable.isFunctionNameVariable(patchConstantFunctionName)) { + error(loc, "can't use variable in patch constant function", patchConstantFunctionName.c_str(), ""); + return nullptr; + } + + const TString mangledName = patchConstantFunctionName + "("; + + // create list of PCF candidates + TVector candidateList; + bool builtIn; + symbolTable.findFunctionNameList(mangledName, candidateList, builtIn); + + // We have to have one and only one, or we don't know which to pick: the patchconstantfunc does not + // allow any disambiguation of overloads. + if (candidateList.empty()) { + error(loc, "patch constant function not found", patchConstantFunctionName.c_str(), ""); + return nullptr; + } + + // Based on directed experiments, it appears that if there are overloaded patchconstantfunctions, + // HLSL picks the last one in shader source order. Since that isn't yet implemented here, error + // out if there is more than one candidate. + if (candidateList.size() > 1) { + error(loc, "ambiguous patch constant function", patchConstantFunctionName.c_str(), ""); + return nullptr; + } + + return candidateList[0]; +} + +// Finalization step: Add patch constant function invocation +void HlslParseContext::addPatchConstantInvocation() +{ + TSourceLoc loc; + loc.init(); + + // If there's no patch constant function, or we're not a HS, do nothing. + if (patchConstantFunctionName.empty() || language != EShLangTessControl) + return; + + // Look for built-in variables in a function's parameter list. + const auto findBuiltIns = [&](const TFunction& function, std::set& builtIns) { + for (int p=0; pgetQualifier().storage; + + if (storage == EvqConstReadOnly) // treated identically to input + storage = EvqIn; + + if (function[p].getDeclaredBuiltIn() != EbvNone) + builtIns.insert(HlslParseContext::tInterstageIoData(function[p].getDeclaredBuiltIn(), storage)); + else + builtIns.insert(HlslParseContext::tInterstageIoData(function[p].type->getQualifier().builtIn, storage)); + } + }; + + // If we synthesize a built-in interface variable, we must add it to the linkage. + const auto addToLinkage = [&](const TType& type, const TString* name, TIntermSymbol** symbolNode) { + if (name == nullptr) { + error(loc, "unable to locate patch function parameter name", "", ""); + return; + } else { + TVariable& variable = *new TVariable(name, type); + if (! symbolTable.insert(variable)) { + error(loc, "unable to declare patch constant function interface variable", name->c_str(), ""); + return; + } + + globalQualifierFix(loc, variable.getWritableType().getQualifier()); + + if (symbolNode != nullptr) + *symbolNode = intermediate.addSymbol(variable); + + trackLinkage(variable); + } + }; + + const auto isOutputPatch = [](TFunction& patchConstantFunction, int param) { + const TType& type = *patchConstantFunction[param].type; + const TBuiltInVariable biType = patchConstantFunction[param].getDeclaredBuiltIn(); + + return type.isSizedArray() && biType == EbvOutputPatch; + }; + + // We will perform these steps. Each is in a scoped block for separation: they could + // become separate functions to make addPatchConstantInvocation shorter. + // + // 1. Union the interfaces, and create built-ins for anything present in the PCF and + // declared as a built-in variable that isn't present in the entry point's signature. + // + // 2. Synthesizes a call to the patchconstfunction using built-in variables from either main, + // or the ones we created. Matching is based on built-in type. We may use synthesized + // variables from (1) above. + // + // 2B: Synthesize per control point invocations of wrapped entry point if the PCF requires them. + // + // 3. Create a return sequence: copy the return value (if any) from the PCF to a + // (non-sanitized) output variable. In case this may involve multiple copies, such as for + // an arrayed variable, a temporary copy of the PCF output is created to avoid multiple + // indirections into a complex R-value coming from the call to the PCF. + // + // 4. Create a barrier. + // + // 5/5B. Call the PCF inside an if test for (invocation id == 0). + + TFunction* patchConstantFunctionPtr = const_cast(findPatchConstantFunction(loc)); + + if (patchConstantFunctionPtr == nullptr) + return; + + TFunction& patchConstantFunction = *patchConstantFunctionPtr; + + const int pcfParamCount = patchConstantFunction.getParamCount(); + TIntermSymbol* invocationIdSym = findTessLinkageSymbol(EbvInvocationId); + TIntermSequence& epBodySeq = entryPointFunctionBody->getAsAggregate()->getSequence(); + + int outPatchParam = -1; // -1 means there isn't one. + + // ================ Step 1A: Union Interfaces ================ + // Our patch constant function. + { + std::set pcfBuiltIns; // patch constant function built-ins + std::set epfBuiltIns; // entry point function built-ins + + assert(entryPointFunction); + assert(entryPointFunctionBody); + + findBuiltIns(patchConstantFunction, pcfBuiltIns); + findBuiltIns(*entryPointFunction, epfBuiltIns); + + // Find the set of built-ins in the PCF that are not present in the entry point. + std::set notInEntryPoint; + + notInEntryPoint = pcfBuiltIns; + + // std::set_difference not usable on unordered containers + for (auto bi = epfBuiltIns.begin(); bi != epfBuiltIns.end(); ++bi) + notInEntryPoint.erase(*bi); + + // Now we'll add those to the entry and to the linkage. + for (int p=0; pgetQualifier().storage; + + // Track whether there is an output patch param + if (isOutputPatch(patchConstantFunction, p)) { + if (outPatchParam >= 0) { + // Presently we only support one per ctrl pt input. + error(loc, "unimplemented: multiple output patches in patch constant function", "", ""); + return; + } + outPatchParam = p; + } + + if (biType != EbvNone) { + TType* paramType = patchConstantFunction[p].type->clone(); + + if (storage == EvqConstReadOnly) // treated identically to input + storage = EvqIn; + + // Presently, the only non-built-in we support is InputPatch, which is treated as + // a pseudo-built-in. + if (biType == EbvInputPatch) { + builtInTessLinkageSymbols[biType] = inputPatch; + } else if (biType == EbvOutputPatch) { + // Nothing... + } else { + // Use the original declaration type for the linkage + paramType->getQualifier().builtIn = biType; + if (biType == EbvTessLevelInner || biType == EbvTessLevelOuter) + paramType->getQualifier().patch = true; + + if (notInEntryPoint.count(tInterstageIoData(biType, storage)) == 1) + addToLinkage(*paramType, patchConstantFunction[p].name, nullptr); + } + } + } + + // If we didn't find it because the shader made one, add our own. + if (invocationIdSym == nullptr) { + TType invocationIdType(EbtUint, EvqIn, 1); + TString* invocationIdName = NewPoolTString("InvocationId"); + invocationIdType.getQualifier().builtIn = EbvInvocationId; + addToLinkage(invocationIdType, invocationIdName, &invocationIdSym); + } + + assert(invocationIdSym); + } + + TIntermTyped* pcfArguments = nullptr; + TVariable* perCtrlPtVar = nullptr; + + // ================ Step 1B: Argument synthesis ================ + // Create pcfArguments for synthesis of patchconstantfunction invocation + { + for (int p=0; pgetWritableType().getQualifier().makeTemporary(); + } + inputArg = intermediate.addSymbol(*perCtrlPtVar, loc); + } else { + // find which built-in it is + const TBuiltInVariable biType = patchConstantFunction[p].getDeclaredBuiltIn(); + + if (biType == EbvInputPatch && inputPatch == nullptr) { + error(loc, "unimplemented: PCF input patch without entry point input patch parameter", "", ""); + return; + } + + inputArg = findTessLinkageSymbol(biType); + + if (inputArg == nullptr) { + error(loc, "unable to find patch constant function built-in variable", "", ""); + return; + } + } + + if (pcfParamCount == 1) + pcfArguments = inputArg; + else + pcfArguments = intermediate.growAggregate(pcfArguments, inputArg); + } + } + + // ================ Step 2: Synthesize call to PCF ================ + TIntermAggregate* pcfCallSequence = nullptr; + TIntermTyped* pcfCall = nullptr; + + { + // Create a function call to the patchconstantfunction + if (pcfArguments) + addInputArgumentConversions(patchConstantFunction, pcfArguments); + + // Synthetic call. + pcfCall = intermediate.setAggregateOperator(pcfArguments, EOpFunctionCall, patchConstantFunction.getType(), loc); + pcfCall->getAsAggregate()->setUserDefined(); + pcfCall->getAsAggregate()->setName(patchConstantFunction.getMangledName()); + intermediate.addToCallGraph(infoSink, intermediate.getEntryPointMangledName().c_str(), + patchConstantFunction.getMangledName()); + + if (pcfCall->getAsAggregate()) { + TQualifierList& qualifierList = pcfCall->getAsAggregate()->getQualifierList(); + for (int i = 0; i < patchConstantFunction.getParamCount(); ++i) { + TStorageQualifier qual = patchConstantFunction[i].type->getQualifier().storage; + qualifierList.push_back(qual); + } + pcfCall = addOutputArgumentConversions(patchConstantFunction, *pcfCall->getAsOperator()); + } + } + + // ================ Step 2B: Per Control Point synthesis ================ + // If there is per control point data, we must either emulate that with multiple + // invocations of the entry point to build up an array, or (TODO:) use a yet + // unavailable extension to look across the SIMD lanes. This is the former + // as a placeholder for the latter. + if (outPatchParam >= 0) { + // We must introduce a local temp variable of the type wanted by the PCF input. + const int arraySize = patchConstantFunction[outPatchParam].type->getOuterArraySize(); + + if (entryPointFunction->getType().getBasicType() == EbtVoid) { + error(loc, "entry point must return a value for use with patch constant function", "", ""); + return; + } + + // Create calls to wrapped main to fill in the array. We will substitute fixed values + // of invocation ID when calling the wrapped main. + + // This is the type of the each member of the per ctrl point array. + const TType derefType(perCtrlPtVar->getType(), 0); + + for (int cpt = 0; cpt < arraySize; ++cpt) { + // TODO: improve. substr(1) here is to avoid the '@' that was grafted on but isn't in the symtab + // for this function. + const TString origName = entryPointFunction->getName().substr(1); + TFunction callee(&origName, TType(EbtVoid)); + TIntermTyped* callingArgs = nullptr; + + for (int i = 0; i < entryPointFunction->getParamCount(); i++) { + TParameter& param = (*entryPointFunction)[i]; + TType& paramType = *param.type; + + if (paramType.getQualifier().isParamOutput()) { + error(loc, "unimplemented: entry point outputs in patch constant function invocation", "", ""); + return; + } + + if (paramType.getQualifier().isParamInput()) { + TIntermTyped* arg = nullptr; + if ((*entryPointFunction)[i].getDeclaredBuiltIn() == EbvInvocationId) { + // substitute invocation ID with the array element ID + arg = intermediate.addConstantUnion(cpt, loc); + } else { + TVariable* argVar = makeInternalVariable(*param.name, *param.type); + argVar->getWritableType().getQualifier().makeTemporary(); + arg = intermediate.addSymbol(*argVar); + } + + handleFunctionArgument(&callee, callingArgs, arg); + } + } + + // Call and assign to per ctrl point variable + currentCaller = intermediate.getEntryPointMangledName().c_str(); + TIntermTyped* callReturn = handleFunctionCall(loc, &callee, callingArgs); + TIntermTyped* index = intermediate.addConstantUnion(cpt, loc); + TIntermSymbol* perCtrlPtSym = intermediate.addSymbol(*perCtrlPtVar, loc); + TIntermTyped* element = intermediate.addIndex(EOpIndexDirect, perCtrlPtSym, index, loc); + element->setType(derefType); + element->setLoc(loc); + + pcfCallSequence = intermediate.growAggregate(pcfCallSequence, + handleAssign(loc, EOpAssign, element, callReturn)); + } + } + + // ================ Step 3: Create return Sequence ================ + // Return sequence: copy PCF result to a temporary, then to shader output variable. + if (pcfCall->getBasicType() != EbtVoid) { + const TType* retType = &patchConstantFunction.getType(); // return type from the PCF + TType outType; // output type that goes with the return type. + outType.shallowCopy(*retType); + + // substitute the output type + const auto newLists = ioTypeMap.find(retType->getStruct()); + if (newLists != ioTypeMap.end()) + outType.setStruct(newLists->second.output); + + // Substitute the top level type's built-in type + if (patchConstantFunction.getDeclaredBuiltInType() != EbvNone) + outType.getQualifier().builtIn = patchConstantFunction.getDeclaredBuiltInType(); + + outType.getQualifier().patch = true; // make it a per-patch variable + + TVariable* pcfOutput = makeInternalVariable("@patchConstantOutput", outType); + pcfOutput->getWritableType().getQualifier().storage = EvqVaryingOut; + + if (pcfOutput->getType().isStruct()) + flatten(*pcfOutput, false); + + assignToInterface(*pcfOutput); + + TIntermSymbol* pcfOutputSym = intermediate.addSymbol(*pcfOutput, loc); + + // The call to the PCF is a complex R-value: we want to store it in a temp to avoid + // repeated calls to the PCF: + TVariable* pcfCallResult = makeInternalVariable("@patchConstantResult", *retType); + pcfCallResult->getWritableType().getQualifier().makeTemporary(); + + TIntermSymbol* pcfResultVar = intermediate.addSymbol(*pcfCallResult, loc); + TIntermNode* pcfResultAssign = handleAssign(loc, EOpAssign, pcfResultVar, pcfCall); + TIntermNode* pcfResultToOut = handleAssign(loc, EOpAssign, pcfOutputSym, + intermediate.addSymbol(*pcfCallResult, loc)); + + pcfCallSequence = intermediate.growAggregate(pcfCallSequence, pcfResultAssign); + pcfCallSequence = intermediate.growAggregate(pcfCallSequence, pcfResultToOut); + } else { + pcfCallSequence = intermediate.growAggregate(pcfCallSequence, pcfCall); + } + + // ================ Step 4: Barrier ================ + TIntermTyped* barrier = new TIntermAggregate(EOpBarrier); + barrier->setLoc(loc); + barrier->setType(TType(EbtVoid)); + epBodySeq.insert(epBodySeq.end(), barrier); + + // ================ Step 5: Test on invocation ID ================ + TIntermTyped* zero = intermediate.addConstantUnion(0, loc, true); + TIntermTyped* cmp = intermediate.addBinaryNode(EOpEqual, invocationIdSym, zero, loc, TType(EbtBool)); + + + // ================ Step 5B: Create if statement on Invocation ID == 0 ================ + intermediate.setAggregateOperator(pcfCallSequence, EOpSequence, TType(EbtVoid), loc); + TIntermTyped* invocationIdTest = new TIntermSelection(cmp, pcfCallSequence, nullptr); + invocationIdTest->setLoc(loc); + + // add our test sequence before the return. + epBodySeq.insert(epBodySeq.end(), invocationIdTest); +} + +// Finalization step: remove unused buffer blocks from linkage (we don't know until the +// shader is entirely compiled). +// Preserve order of remaining symbols. +void HlslParseContext::removeUnusedStructBufferCounters() +{ + const auto endIt = std::remove_if(linkageSymbols.begin(), linkageSymbols.end(), + [this](const TSymbol* sym) { + const auto sbcIt = structBufferCounter.find(sym->getName()); + return sbcIt != structBufferCounter.end() && !sbcIt->second; + }); + + linkageSymbols.erase(endIt, linkageSymbols.end()); +} + +// Finalization step: patch texture shadow modes to match samplers they were combined with +void HlslParseContext::fixTextureShadowModes() +{ + for (auto symbol = linkageSymbols.begin(); symbol != linkageSymbols.end(); ++symbol) { + TSampler& sampler = (*symbol)->getWritableType().getSampler(); + + if (sampler.isTexture()) { + const auto shadowMode = textureShadowVariant.find((*symbol)->getUniqueId()); + if (shadowMode != textureShadowVariant.end()) { + + if (shadowMode->second->overloaded()) + // Texture needs legalization if it's been seen with both shadow and non-shadow modes. + intermediate.setNeedsLegalization(); + + sampler.shadow = shadowMode->second->isShadowId((*symbol)->getUniqueId()); + } + } + } +} + +// Finalization step: patch append methods to use proper stream output, which isn't known until +// main is parsed, which could happen after the append method is parsed. +void HlslParseContext::finalizeAppendMethods() +{ + TSourceLoc loc; + loc.init(); + + // Nothing to do: bypass test for valid stream output. + if (gsAppends.empty()) + return; + + if (gsStreamOutput == nullptr) { + error(loc, "unable to find output symbol for Append()", "", ""); + return; + } + + // Patch append sequences, now that we know the stream output symbol. + for (auto append = gsAppends.begin(); append != gsAppends.end(); ++append) { + append->node->getSequence()[0] = + handleAssign(append->loc, EOpAssign, + intermediate.addSymbol(*gsStreamOutput, append->loc), + append->node->getSequence()[0]->getAsTyped()); + } +} + +// post-processing +void HlslParseContext::finish() +{ + // Error check: There was a dangling .mips operator. These are not nested constructs in the grammar, so + // cannot be detected there. This is not strictly needed in a non-validating parser; it's just helpful. + if (! mipsOperatorMipArg.empty()) { + error(mipsOperatorMipArg.back().loc, "unterminated mips operator:", "", ""); + } + + removeUnusedStructBufferCounters(); + addPatchConstantInvocation(); + fixTextureShadowModes(); + finalizeAppendMethods(); + + // Communicate out (esp. for command line) that we formed AST that will make + // illegal AST SPIR-V and it needs transforms to legalize it. + if (intermediate.needsLegalization() && (messages & EShMsgHlslLegalization)) + infoSink.info << "WARNING: AST will form illegal SPIR-V; need to transform to legalize"; + + TParseContextBase::finish(); +} + +} // end namespace glslang diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslParseHelper.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslParseHelper.h new file mode 100644 index 0000000000..97c52d453a --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslParseHelper.h @@ -0,0 +1,517 @@ +// +// Copyright (C) 2016-2018 Google, Inc. +// Copyright (C) 2016 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +#ifndef HLSL_PARSE_INCLUDED_ +#define HLSL_PARSE_INCLUDED_ + +#include "../MachineIndependent/parseVersions.h" +#include "../MachineIndependent/ParseHelper.h" +#include "../MachineIndependent/attribute.h" + +#include + +namespace glslang { + +class TFunctionDeclarator; + +class HlslParseContext : public TParseContextBase { +public: + HlslParseContext(TSymbolTable&, TIntermediate&, bool parsingBuiltins, + int version, EProfile, const SpvVersion& spvVersion, EShLanguage, TInfoSink&, + const TString sourceEntryPointName, + bool forwardCompatible = false, EShMessages messages = EShMsgDefault); + virtual ~HlslParseContext(); + void initializeExtensionBehavior() override; + + void setLimits(const TBuiltInResource&) override; + bool parseShaderStrings(TPpContext&, TInputScanner& input, bool versionWillBeError = false) override; + virtual const char* getGlobalUniformBlockName() const override { return "$Global"; } + virtual void setUniformBlockDefaults(TType& block) const override + { + block.getQualifier().layoutPacking = globalUniformDefaults.layoutPacking; + block.getQualifier().layoutMatrix = globalUniformDefaults.layoutMatrix; + } + + void reservedPpErrorCheck(const TSourceLoc&, const char* /*name*/, const char* /*op*/) override { } + bool lineContinuationCheck(const TSourceLoc&, bool /*endOfComment*/) override { return true; } + bool lineDirectiveShouldSetNextLine() const override { return true; } + bool builtInName(const TString&); + + void handlePragma(const TSourceLoc&, const TVector&) override; + TIntermTyped* handleVariable(const TSourceLoc&, const TString* string); + TIntermTyped* handleBracketDereference(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index); + TIntermTyped* handleBracketOperator(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index); + + TIntermTyped* handleBinaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* left, TIntermTyped* right); + TIntermTyped* handleUnaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* childNode); + TIntermTyped* handleDotDereference(const TSourceLoc&, TIntermTyped* base, const TString& field); + bool isBuiltInMethod(const TSourceLoc&, TIntermTyped* base, const TString& field); + void assignToInterface(TVariable& variable); + void handleFunctionDeclarator(const TSourceLoc&, TFunction& function, bool prototype); + TIntermAggregate* handleFunctionDefinition(const TSourceLoc&, TFunction&, const TAttributes&, TIntermNode*& entryPointTree); + TIntermNode* transformEntryPoint(const TSourceLoc&, TFunction&, const TAttributes&); + void handleEntryPointAttributes(const TSourceLoc&, const TAttributes&); + void transferTypeAttributes(const TSourceLoc&, const TAttributes&, TType&, bool allowEntry = false); + void handleFunctionBody(const TSourceLoc&, TFunction&, TIntermNode* functionBody, TIntermNode*& node); + void remapEntryPointIO(TFunction& function, TVariable*& returnValue, TVector& inputs, TVector& outputs); + void remapNonEntryPointIO(TFunction& function); + TIntermNode* handleDeclare(const TSourceLoc&, TIntermTyped*); + TIntermNode* handleReturnValue(const TSourceLoc&, TIntermTyped*); + void handleFunctionArgument(TFunction*, TIntermTyped*& arguments, TIntermTyped* newArg); + TIntermTyped* handleAssign(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right); + TIntermTyped* handleAssignToMatrixSwizzle(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right); + TIntermTyped* handleFunctionCall(const TSourceLoc&, TFunction*, TIntermTyped*); + TIntermAggregate* assignClipCullDistance(const TSourceLoc&, TOperator, int semanticId, TIntermTyped* left, TIntermTyped* right); + TIntermTyped* assignPosition(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right); + TIntermTyped* assignFromFragCoord(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right); + void decomposeIntrinsic(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments); + void decomposeSampleMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments); + void decomposeStructBufferMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments); + void decomposeGeometryMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments); + void pushFrontArguments(TIntermTyped* front, TIntermTyped*& arguments); + void addInputArgumentConversions(const TFunction&, TIntermTyped*&); + void expandArguments(const TSourceLoc&, const TFunction&, TIntermTyped*&); + TIntermTyped* addOutputArgumentConversions(const TFunction&, TIntermOperator&); + void builtInOpCheck(const TSourceLoc&, const TFunction&, TIntermOperator&); + TFunction* makeConstructorCall(const TSourceLoc&, const TType&); + void handleSemantic(TSourceLoc, TQualifier&, TBuiltInVariable, const TString& upperCase); + void handlePackOffset(const TSourceLoc&, TQualifier&, const glslang::TString& location, + const glslang::TString* component); + void handleRegister(const TSourceLoc&, TQualifier&, const glslang::TString* profile, const glslang::TString& desc, + int subComponent, const glslang::TString*); + TIntermTyped* convertConditionalExpression(const TSourceLoc&, TIntermTyped*, bool mustBeScalar = true); + TIntermAggregate* handleSamplerTextureCombine(const TSourceLoc& loc, TIntermTyped* argTex, TIntermTyped* argSampler); + + bool parseMatrixSwizzleSelector(const TSourceLoc&, const TString&, int cols, int rows, TSwizzleSelectors&); + int getMatrixComponentsColumn(int rows, const TSwizzleSelectors&); + void assignError(const TSourceLoc&, const char* op, TString left, TString right); + void unaryOpError(const TSourceLoc&, const char* op, TString operand); + void binaryOpError(const TSourceLoc&, const char* op, TString left, TString right); + void variableCheck(TIntermTyped*& nodePtr); + void constantValueCheck(TIntermTyped* node, const char* token); + void integerCheck(const TIntermTyped* node, const char* token); + void globalCheck(const TSourceLoc&, const char* token); + bool constructorError(const TSourceLoc&, TIntermNode*, TFunction&, TOperator, TType&); + void arraySizeCheck(const TSourceLoc&, TIntermTyped* expr, TArraySize&); + void arraySizeRequiredCheck(const TSourceLoc&, const TArraySizes&); + void structArrayCheck(const TSourceLoc&, const TType& structure); + bool voidErrorCheck(const TSourceLoc&, const TString&, TBasicType); + void globalQualifierFix(const TSourceLoc&, TQualifier&); + bool structQualifierErrorCheck(const TSourceLoc&, const TPublicType& pType); + void mergeQualifiers(TQualifier& dst, const TQualifier& src); + int computeSamplerTypeIndex(TSampler&); + TSymbol* redeclareBuiltinVariable(const TSourceLoc&, const TString&, const TQualifier&, const TShaderQualifiers&); + void paramFix(TType& type); + void specializationCheck(const TSourceLoc&, const TType&, const char* op); + + void setLayoutQualifier(const TSourceLoc&, TQualifier&, TString&); + void setLayoutQualifier(const TSourceLoc&, TQualifier&, TString&, const TIntermTyped*); + void setSpecConstantId(const TSourceLoc&, TQualifier&, int value); + void mergeObjectLayoutQualifiers(TQualifier& dest, const TQualifier& src, bool inheritOnly); + void checkNoShaderLayouts(const TSourceLoc&, const TShaderQualifiers&); + + const TFunction* findFunction(const TSourceLoc& loc, TFunction& call, bool& builtIn, int& thisDepth, TIntermTyped*& args); + void addGenMulArgumentConversion(const TSourceLoc& loc, TFunction& call, TIntermTyped*& args); + void declareTypedef(const TSourceLoc&, const TString& identifier, const TType&); + void declareStruct(const TSourceLoc&, TString& structName, TType&); + TSymbol* lookupUserType(const TString&, TType&); + TIntermNode* declareVariable(const TSourceLoc&, const TString& identifier, TType&, TIntermTyped* initializer = nullptr); + void lengthenList(const TSourceLoc&, TIntermSequence& list, int size, TIntermTyped* scalarInit); + TIntermTyped* handleConstructor(const TSourceLoc&, TIntermTyped*, const TType&); + TIntermTyped* addConstructor(const TSourceLoc&, TIntermTyped*, const TType&); + TIntermTyped* convertArray(TIntermTyped*, const TType&); + TIntermTyped* constructAggregate(TIntermNode*, const TType&, int, const TSourceLoc&); + TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset); + void declareBlock(const TSourceLoc&, TType&, const TString* instanceName = nullptr); + void declareStructBufferCounter(const TSourceLoc& loc, const TType& bufferType, const TString& name); + void fixBlockLocations(const TSourceLoc&, TQualifier&, TTypeList&, bool memberWithLocation, bool memberWithoutLocation); + void fixXfbOffsets(TQualifier&, TTypeList&); + void fixBlockUniformOffsets(const TQualifier&, TTypeList&); + void addQualifierToExisting(const TSourceLoc&, TQualifier, const TString& identifier); + void addQualifierToExisting(const TSourceLoc&, TQualifier, TIdentifierList&); + void updateStandaloneQualifierDefaults(const TSourceLoc&, const TPublicType&); + void wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode); + TIntermNode* addSwitch(const TSourceLoc&, TIntermTyped* expression, TIntermAggregate* body, const TAttributes&); + + void nestLooping() { ++loopNestingLevel; } + void unnestLooping() { --loopNestingLevel; } + void nestAnnotations() { ++annotationNestingLevel; } + void unnestAnnotations() { --annotationNestingLevel; } + int getAnnotationNestingLevel() { return annotationNestingLevel; } + void pushScope() { symbolTable.push(); } + void popScope() { symbolTable.pop(nullptr); } + + void pushThisScope(const TType&, const TVector&); + void popThisScope() { symbolTable.pop(nullptr); } + + void pushImplicitThis(TVariable* thisParameter) { implicitThisStack.push_back(thisParameter); } + void popImplicitThis() { implicitThisStack.pop_back(); } + TVariable* getImplicitThis(int thisDepth) const { return implicitThisStack[implicitThisStack.size() - thisDepth]; } + + void pushNamespace(const TString& name); + void popNamespace(); + void getFullNamespaceName(TString*&) const; + void addScopeMangler(TString&); + + void beginParameterParsing(TFunction& function) + { + parsingEntrypointParameters = isEntrypointName(function.getName()); + } + + void pushSwitchSequence(TIntermSequence* sequence) { switchSequenceStack.push_back(sequence); } + void popSwitchSequence() { switchSequenceStack.pop_back(); } + + virtual void growGlobalUniformBlock(const TSourceLoc&, TType&, const TString& memberName, + TTypeList* typeList = nullptr) override; + + // Apply L-value conversions. E.g, turning a write to a RWTexture into an ImageStore. + TIntermTyped* handleLvalue(const TSourceLoc&, const char* op, TIntermTyped*& node); + bool lValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*) override; + + TLayoutFormat getLayoutFromTxType(const TSourceLoc&, const TType&); + + bool handleOutputGeometry(const TSourceLoc&, const TLayoutGeometry& geometry); + bool handleInputGeometry(const TSourceLoc&, const TLayoutGeometry& geometry); + + // Determine selection control from attributes + void handleSelectionAttributes(const TSourceLoc& loc, TIntermSelection*, const TAttributes& attributes); + void handleSwitchAttributes(const TSourceLoc& loc, TIntermSwitch*, const TAttributes& attributes); + + // Determine loop control from attributes + void handleLoopAttributes(const TSourceLoc& loc, TIntermLoop*, const TAttributes& attributes); + + // Share struct buffer deep types + void shareStructBufferType(TType&); + + // Set texture return type of the given sampler. Returns success (not all types are valid). + bool setTextureReturnType(TSampler& sampler, const TType& retType, const TSourceLoc& loc); + + // Obtain the sampler return type of the given sampler in retType. + void getTextureReturnType(const TSampler& sampler, TType& retType) const; + + TAttributeType attributeFromName(const TString& nameSpace, const TString& name) const; + +protected: + struct TFlattenData { + TFlattenData() : nextBinding(TQualifier::layoutBindingEnd), + nextLocation(TQualifier::layoutLocationEnd) { } + TFlattenData(int nb, int nl) : nextBinding(nb), nextLocation(nl) { } + + TVector members; // individual flattened variables + TVector offsets; // offset to next tree level + unsigned int nextBinding; // next binding to use. + unsigned int nextLocation; // next location to use + }; + + void fixConstInit(const TSourceLoc&, const TString& identifier, TType& type, TIntermTyped*& initializer); + void inheritGlobalDefaults(TQualifier& dst) const; + TVariable* makeInternalVariable(const char* name, const TType&) const; + TVariable* makeInternalVariable(const TString& name, const TType& type) const { + return makeInternalVariable(name.c_str(), type); + } + TIntermSymbol* makeInternalVariableNode(const TSourceLoc&, const char* name, const TType&) const; + TVariable* declareNonArray(const TSourceLoc&, const TString& identifier, const TType&, bool track); + void declareArray(const TSourceLoc&, const TString& identifier, const TType&, TSymbol*&, bool track); + TIntermNode* executeDeclaration(const TSourceLoc&, TVariable* variable); + TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable); + TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer, TIntermTyped* scalarInit); + bool isScalarConstructor(const TIntermNode*); + TOperator mapAtomicOp(const TSourceLoc& loc, TOperator op, bool isImage); + bool isEntrypointName(const TString& name) { return name.compare(intermediate.getEntryPointName().c_str()) == 0; } + + // Return true if this node requires L-value conversion (e.g, to an imageStore). + bool shouldConvertLValue(const TIntermNode*) const; + + // Array and struct flattening + TIntermTyped* flattenAccess(TIntermTyped* base, int member); + TIntermTyped* flattenAccess(long long uniqueId, int member, TStorageQualifier outerStorage, const TType&, int subset = -1); + int findSubtreeOffset(const TIntermNode&) const; + int findSubtreeOffset(const TType&, int subset, const TVector& offsets) const; + bool shouldFlatten(const TType&, TStorageQualifier, bool topLevel) const; + bool wasFlattened(const TIntermTyped* node) const; + bool wasFlattened(long long id) const { return flattenMap.find(id) != flattenMap.end(); } + int addFlattenedMember(const TVariable&, const TType&, TFlattenData&, const TString& name, bool linkage, + const TQualifier& outerQualifier, const TArraySizes* builtInArraySizes); + + // Structure splitting (splits interstage built-in types into its own struct) + void split(const TVariable&); + void splitBuiltIn(const TString& baseName, const TType& memberType, const TArraySizes*, const TQualifier&); + const TType& split(const TType& type, const TString& name, const TQualifier&); + bool wasSplit(const TIntermTyped* node) const; + bool wasSplit(long long id) const { return splitNonIoVars.find(id) != splitNonIoVars.end(); } + TVariable* getSplitNonIoVar(long long id) const; + void addPatchConstantInvocation(); + void fixTextureShadowModes(); + void finalizeAppendMethods(); + TIntermTyped* makeIntegerIndex(TIntermTyped*); + + void fixBuiltInIoType(TType&); + + void flatten(const TVariable& variable, bool linkage, bool arrayed = false); + int flatten(const TVariable& variable, const TType&, TFlattenData&, TString name, bool linkage, + const TQualifier& outerQualifier, const TArraySizes* builtInArraySizes); + int flattenStruct(const TVariable& variable, const TType&, TFlattenData&, TString name, bool linkage, + const TQualifier& outerQualifier, const TArraySizes* builtInArraySizes); + int flattenArray(const TVariable& variable, const TType&, TFlattenData&, TString name, bool linkage, + const TQualifier& outerQualifier); + + bool hasUniform(const TQualifier& qualifier) const; + void clearUniform(TQualifier& qualifier); + bool isInputBuiltIn(const TQualifier& qualifier) const; + bool hasInput(const TQualifier& qualifier) const; + void correctOutput(TQualifier& qualifier); + bool isOutputBuiltIn(const TQualifier& qualifier) const; + bool hasOutput(const TQualifier& qualifier) const; + void correctInput(TQualifier& qualifier); + void correctUniform(TQualifier& qualifier); + void clearUniformInputOutput(TQualifier& qualifier); + + // Test method names + bool isStructBufferMethod(const TString& name) const; + void counterBufferType(const TSourceLoc& loc, TType& type); + + // Return standard sample position array + TIntermConstantUnion* getSamplePosArray(int count); + + TType* getStructBufferContentType(const TType& type) const; + bool isStructBufferType(const TType& type) const { return getStructBufferContentType(type) != nullptr; } + TIntermTyped* indexStructBufferContent(const TSourceLoc& loc, TIntermTyped* buffer) const; + TIntermTyped* getStructBufferCounter(const TSourceLoc& loc, TIntermTyped* buffer); + TString getStructBuffCounterName(const TString&) const; + void addStructBuffArguments(const TSourceLoc& loc, TIntermAggregate*&); + void addStructBufferHiddenCounterParam(const TSourceLoc& loc, TParameter&, TIntermAggregate*&); + + // Return true if this type is a reference. This is not currently a type method in case that's + // a language specific answer. + bool isReference(const TType& type) const { return isStructBufferType(type); } + + // Return true if this a buffer type that has an associated counter buffer. + bool hasStructBuffCounter(const TType&) const; + + // Finalization step: remove unused buffer blocks from linkage (we don't know until the + // shader is entirely compiled) + void removeUnusedStructBufferCounters(); + + static bool isClipOrCullDistance(TBuiltInVariable); + static bool isClipOrCullDistance(const TQualifier& qual) { return isClipOrCullDistance(qual.builtIn); } + static bool isClipOrCullDistance(const TType& type) { return isClipOrCullDistance(type.getQualifier()); } + + // Find the patch constant function (issues error, returns nullptr if not found) + const TFunction* findPatchConstantFunction(const TSourceLoc& loc); + + // Pass through to base class after remembering built-in mappings. + using TParseContextBase::trackLinkage; + void trackLinkage(TSymbol& variable) override; + + void finish() override; // post-processing + + // Linkage symbol helpers + TIntermSymbol* findTessLinkageSymbol(TBuiltInVariable biType) const; + + // Current state of parsing + int annotationNestingLevel; // 0 if outside all annotations + + HlslParseContext(HlslParseContext&); + HlslParseContext& operator=(HlslParseContext&); + + static const int maxSamplerIndex = EsdNumDims * (EbtNumTypes * (2 * 2 * 2)); // see computeSamplerTypeIndex() + TQualifier globalBufferDefaults; + TQualifier globalUniformDefaults; + TQualifier globalInputDefaults; + TQualifier globalOutputDefaults; + TString currentCaller; // name of last function body entered (not valid when at global scope) + TIdSetType inductiveLoopIds; + TVector needsIndexLimitationChecking; + + // + // Geometry shader input arrays: + // - array sizing is based on input primitive and/or explicit size + // + // Tessellation control output arrays: + // - array sizing is based on output layout(vertices=...) and/or explicit size + // + // Both: + // - array sizing is retroactive + // - built-in block redeclarations interact with this + // + // Design: + // - use a per-context "resize-list", a list of symbols whose array sizes + // can be fixed + // + // - the resize-list starts empty at beginning of user-shader compilation, it does + // not have built-ins in it + // + // - on built-in array use: copyUp() symbol and add it to the resize-list + // + // - on user array declaration: add it to the resize-list + // + // - on block redeclaration: copyUp() symbol and add it to the resize-list + // * note, that appropriately gives an error if redeclaring a block that + // was already used and hence already copied-up + // + // - on seeing a layout declaration that sizes the array, fix everything in the + // resize-list, giving errors for mismatch + // + // - on seeing an array size declaration, give errors on mismatch between it and previous + // array-sizing declarations + // + TVector ioArraySymbolResizeList; + + TMap flattenMap; + + // IO-type map. Maps a pure symbol-table form of a structure-member list into + // each of the (up to) three kinds of IO, as each as different allowed decorations, + // but HLSL allows mixing all in the same structure. + struct tIoKinds { + TTypeList* input; + TTypeList* output; + TTypeList* uniform; + }; + TMap ioTypeMap; + + // Structure splitting data: + TMap splitNonIoVars; // variables with the built-in interstage IO removed, indexed by unique ID. + + // Structuredbuffer shared types. Typically there are only a few. + TVector structBufferTypes; + + // This tracks texture sample user structure return types. Only a limited number are supported, as + // may fit in TSampler::structReturnIndex. + TVector textureReturnStruct; + + TMap structBufferCounter; // true if counter buffer is in use + + // The built-in interstage IO map considers e.g, EvqPosition on input and output separately, so that we + // can build the linkage correctly if position appears on both sides. Otherwise, multiple positions + // are considered identical. + struct tInterstageIoData { + tInterstageIoData(TBuiltInVariable bi, TStorageQualifier q) : + builtIn(bi), storage(q) { } + + TBuiltInVariable builtIn; + TStorageQualifier storage; + + // ordering for maps + bool operator<(const tInterstageIoData d) const { + return (builtIn != d.builtIn) ? (builtIn < d.builtIn) : (storage < d.storage); + } + }; + + TMap splitBuiltIns; // split built-ins, indexed by built-in type. + TVariable* inputPatch; // input patch is special for PCF: it's the only non-builtin PCF input, + // and is handled as a pseudo-builtin. + + unsigned int nextInLocation; + unsigned int nextOutLocation; + + TFunction* entryPointFunction; + TIntermNode* entryPointFunctionBody; + + TString patchConstantFunctionName; // hull shader patch constant function name, from function level attribute. + TMap builtInTessLinkageSymbols; // used for tessellation, finding declared built-ins + + TVector currentTypePrefix; // current scoping prefix for nested structures + TVector implicitThisStack; // currently active 'this' variables for nested structures + + TVariable* gsStreamOutput; // geometry shader stream outputs, for emit (Append method) + + TVariable* clipDistanceOutput; // synthesized clip distance out variable (shader might have >1) + TVariable* cullDistanceOutput; // synthesized cull distance out variable (shader might have >1) + TVariable* clipDistanceInput; // synthesized clip distance in variable (shader might have >1) + TVariable* cullDistanceInput; // synthesized cull distance in variable (shader might have >1) + + static const int maxClipCullRegs = 2; + std::array clipSemanticNSizeIn; // vector, indexed by clip semantic ID + std::array cullSemanticNSizeIn; // vector, indexed by cull semantic ID + std::array clipSemanticNSizeOut; // vector, indexed by clip semantic ID + std::array cullSemanticNSizeOut; // vector, indexed by cull semantic ID + + // This tracks the first (mip level) argument to the .mips[][] operator. Since this can be nested as + // in tx.mips[tx.mips[0][1].x][2], we need a stack. We also track the TSourceLoc for error reporting + // purposes. + struct tMipsOperatorData { + tMipsOperatorData(TSourceLoc l, TIntermTyped* m) : loc(l), mipLevel(m) { } + TSourceLoc loc; + TIntermTyped* mipLevel; + }; + + TVector mipsOperatorMipArg; + + // The geometry output stream is not copied out from the entry point as a typical output variable + // is. It's written via EmitVertex (hlsl=Append), which may happen in arbitrary control flow. + // For this we need the real output symbol. Since it may not be known at the time and Append() + // method is parsed, the sequence will be patched during finalization. + struct tGsAppendData { + TIntermAggregate* node; + TSourceLoc loc; + }; + + TVector gsAppends; + + // A texture object may be used with shadow and non-shadow samplers, but both may not be + // alive post-DCE in the same shader. We do not know at compilation time which are alive: that's + // only known post-DCE. If a texture is used both ways, we create two textures, and + // leave the elimiation of one to the optimizer. This maps the shader variant to + // the shadow variant. + // + // This can be removed if and when the texture shadow code in + // HlslParseContext::handleSamplerTextureCombine is removed. + struct tShadowTextureSymbols { + tShadowTextureSymbols() { symId.fill(-1); } + + void set(bool shadow, long long id) { symId[int(shadow)] = id; } + long long get(bool shadow) const { return symId[int(shadow)]; } + + // True if this texture has been seen with both shadow and non-shadow modes + bool overloaded() const { return symId[0] != -1 && symId[1] != -1; } + bool isShadowId(long long id) const { return symId[1] == id; } + + private: + std::array symId; + }; + + TMap textureShadowVariant; + bool parsingEntrypointParameters; +}; + +// This is the prefix we use for built-in methods to avoid namespace collisions with +// global scope user functions. +// TODO: this would be better as a nonparseable character, but that would +// require changing the scanner. +#define BUILTIN_PREFIX "__BI_" + +} // end namespace glslang + +#endif // HLSL_PARSE_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslParseables.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslParseables.cpp new file mode 100644 index 0000000000..8fb1d2909c --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslParseables.cpp @@ -0,0 +1,1259 @@ +// +// Copyright (C) 2016 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// Create strings that declare built-in definitions, add built-ins programmatically +// that cannot be expressed in the strings, and establish mappings between +// built-in functions and operators. +// +// Where to put a built-in: +// TBuiltInParseablesHlsl::initialize(version,profile) context-independent textual built-ins; add them to the right string +// TBuiltInParseablesHlsl::initialize(resources,...) context-dependent textual built-ins; add them to the right string +// TBuiltInParseablesHlsl::identifyBuiltIns(...,symbolTable) context-independent programmatic additions/mappings to the symbol table, +// including identifying what extensions are needed if a version does not allow a symbol +// TBuiltInParseablesHlsl::identifyBuiltIns(...,symbolTable, resources) context-dependent programmatic additions/mappings to the +// symbol table, including identifying what extensions are needed if a version does +// not allow a symbol +// + +#include "hlslParseables.h" +#include "hlslParseHelper.h" +#include +#include +#include + +namespace { // anonymous namespace functions + +// arg order queries +bool IsSamplerType(const char argType) { return argType == 'S' || argType == 's'; } +bool IsArrayed(const char argOrder) { return argOrder == '@' || argOrder == '&' || argOrder == '#'; } +bool IsTextureNonMS(const char argOrder) { return argOrder == '%'; } +bool IsSubpassInput(const char argOrder) { return argOrder == '[' || argOrder == ']'; } +bool IsArrayedTexture(const char argOrder) { return argOrder == '@'; } +bool IsTextureMS(const char argOrder) { return argOrder == '$' || argOrder == '&'; } +bool IsMS(const char argOrder) { return IsTextureMS(argOrder) || argOrder == ']'; } +bool IsBuffer(const char argOrder) { return argOrder == '*' || argOrder == '~'; } +bool IsImage(const char argOrder) { return argOrder == '!' || argOrder == '#' || argOrder == '~'; } + +bool IsTextureType(const char argOrder) +{ + return IsTextureNonMS(argOrder) || IsArrayedTexture(argOrder) || + IsTextureMS(argOrder) || IsBuffer(argOrder) || IsImage(argOrder); +} + +// Reject certain combinations that are illegal sample methods. For example, +// 3D arrays. +bool IsIllegalSample(const glslang::TString& name, const char* argOrder, int dim0) +{ + const bool isArrayed = IsArrayed(*argOrder); + const bool isMS = IsTextureMS(*argOrder); + const bool isBuffer = IsBuffer(*argOrder); + + // there are no 3D arrayed textures, or 3D SampleCmp(LevelZero) + if (dim0 == 3 && (isArrayed || name == "SampleCmp" || name == "SampleCmpLevelZero")) + return true; + + const int numArgs = int(std::count(argOrder, argOrder + strlen(argOrder), ',')) + 1; + + // Reject invalid offset forms with cubemaps + if (dim0 == 4) { + if ((name == "Sample" && numArgs >= 4) || + (name == "SampleBias" && numArgs >= 5) || + (name == "SampleCmp" && numArgs >= 5) || + (name == "SampleCmpLevelZero" && numArgs >= 5) || + (name == "SampleGrad" && numArgs >= 6) || + (name == "SampleLevel" && numArgs >= 5)) + return true; + } + + const bool isGather = + (name == "Gather" || + name == "GatherRed" || + name == "GatherGreen" || + name == "GatherBlue" || + name == "GatherAlpha"); + + const bool isGatherCmp = + (name == "GatherCmp" || + name == "GatherCmpRed" || + name == "GatherCmpGreen" || + name == "GatherCmpBlue" || + name == "GatherCmpAlpha"); + + // Reject invalid Gathers + if (isGather || isGatherCmp) { + if (dim0 == 1 || dim0 == 3) // there are no 1D or 3D gathers + return true; + + // no offset on cube or cube array gathers + if (dim0 == 4) { + if ((isGather && numArgs > 3) || (isGatherCmp && numArgs > 4)) + return true; + } + } + + // Reject invalid Loads + if (name == "Load" && dim0 == 4) + return true; // Load does not support any cubemaps, arrayed or not. + + // Multisample formats are only 2D and 2Darray + if (isMS && dim0 != 2) + return true; + + // Buffer are only 1D + if (isBuffer && dim0 != 1) + return true; + + return false; +} + +// Return the number of the coordinate arg, if any +int CoordinateArgPos(const glslang::TString& name, bool isTexture) +{ + if (!isTexture || (name == "GetDimensions")) + return -1; // has none + else if (name == "Load") + return 1; + else + return 2; // other texture methods are 2 +} + +// Some texture methods use an addition coordinate dimension for the mip +bool HasMipInCoord(const glslang::TString& name, bool isMS, bool isBuffer, bool isImage) +{ + return name == "Load" && !isMS && !isBuffer && !isImage; +} + +// LOD calculations don't pass the array level in the coordinate. +bool NoArrayCoord(const glslang::TString& name) +{ + return name == "CalculateLevelOfDetail" || name == "CalculateLevelOfDetailUnclamped"; +} + +// Handle IO params marked with > or < +const char* IoParam(glslang::TString& s, const char* nthArgOrder) +{ + if (*nthArgOrder == '>') { // output params + ++nthArgOrder; + s.append("out "); + } else if (*nthArgOrder == '<') { // input params + ++nthArgOrder; + s.append("in "); + } + + return nthArgOrder; +} + +// Handle repeated args +void HandleRepeatArg(const char*& arg, const char*& prev, const char* current) +{ + if (*arg == ',' || *arg == '\0') + arg = prev; + else + prev = current; +} + +// Return true for the end of a single argument key, which can be the end of the string, or +// the comma separator. +inline bool IsEndOfArg(const char* arg) +{ + return arg == nullptr || *arg == '\0' || *arg == ','; +} + +// If this is a fixed vector size, such as V3, return the size. Else return 0. +int FixedVecSize(const char* arg) +{ + while (!IsEndOfArg(arg)) { + if (isdigit(*arg)) + return *arg - '0'; + ++arg; + } + + return 0; // none found. +} + +// Create and return a type name, using HLSL type conventions. +// +// order: S = scalar, V = vector, M = matrix +// argType: F = float, D = double, I = int, U = uint, B = bool, S = sampler +// dim0 = vector dimension, or matrix 1st dimension +// dim1 = matrix 2nd dimension +glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, const char* argType, int dim0, int dim1) +{ + const bool isTranspose = (argOrder[0] == '^'); + const bool isTexture = IsTextureType(argOrder[0]); + const bool isArrayed = IsArrayed(argOrder[0]); + const bool isSampler = IsSamplerType(argType[0]); + const bool isMS = IsMS(argOrder[0]); + const bool isBuffer = IsBuffer(argOrder[0]); + const bool isImage = IsImage(argOrder[0]); + const bool isSubpass = IsSubpassInput(argOrder[0]); + + char type = *argType; + + if (isTranspose) { // Take transpose of matrix dimensions + std::swap(dim0, dim1); + } else if (isTexture || isSubpass) { + if (type == 'F') // map base type to texture of that type. + type = 'T'; // e.g, int -> itexture, uint -> utexture, etc. + else if (type == 'I') + type = 'i'; + else if (type == 'U') + type = 'u'; + } + + if (isTranspose) + ++argOrder; + + char order = *argOrder; + + switch (type) { + case '-': s += "void"; break; + case 'F': s += "float"; break; + case 'D': s += "double"; break; + case 'I': s += "int"; break; + case 'U': s += "uint"; break; + case 'L': s += "int64_t"; break; + case 'M': s += "uint64_t"; break; + case 'B': s += "bool"; break; + case 'S': s += "sampler"; break; + case 's': s += "SamplerComparisonState"; break; + case 'T': s += ((isBuffer && isImage) ? "RWBuffer" : + isSubpass ? "SubpassInput" : + isBuffer ? "Buffer" : + isImage ? "RWTexture" : "Texture"); break; + case 'i': s += ((isBuffer && isImage) ? "RWBuffer" : + isSubpass ? "SubpassInput" : + isBuffer ? "Buffer" : + isImage ? "RWTexture" : "Texture"); break; + case 'u': s += ((isBuffer && isImage) ? "RWBuffer" : + isSubpass ? "SubpassInput" : + isBuffer ? "Buffer" : + isImage ? "RWTexture" : "Texture"); break; + default: s += "UNKNOWN_TYPE"; break; + } + + if (isSubpass && isMS) + s += "MS"; + + // handle fixed vector sizes, such as float3, and only ever 3. + const int fixedVecSize = FixedVecSize(argOrder); + if (fixedVecSize != 0) + dim0 = dim1 = fixedVecSize; + + const char dim0Char = ('0' + char(dim0)); + const char dim1Char = ('0' + char(dim1)); + + // Add sampler dimensions + if (isSampler || isTexture) { + if ((order == 'V' || isTexture) && !isBuffer) { + switch (dim0) { + case 1: s += "1D"; break; + case 2: s += (isMS ? "2DMS" : "2D"); break; + case 3: s += "3D"; break; + case 4: s += (type == 'S'? "CUBE" : "Cube"); break; + default: s += "UNKNOWN_SAMPLER"; break; + } + } + } else { + // Non-sampler type: + // verify dimensions + if (((order == 'V' || order == 'M') && (dim0 < 1 || dim0 > 4)) || + (order == 'M' && (dim1 < 1 || dim1 > 4))) { + s += "UNKNOWN_DIMENSION"; + return s; + } + + switch (order) { + case '-': break; // no dimensions for voids + case 'S': break; // no dimensions on scalars + case 'V': + s += dim0Char; + break; + case 'M': + s += dim0Char; + s += 'x'; + s += dim1Char; + break; + default: + break; + } + } + + // handle arrayed textures + if (isArrayed) + s += "Array"; + + switch (type) { + case 'i': s += " 0) // handle fixed sized vectors + dim0Min = dim0Max = fixedVecSize; +} + +} // end anonymous namespace + +namespace glslang { + +TBuiltInParseablesHlsl::TBuiltInParseablesHlsl() +{ +} + +// +// Handle creation of mat*mat specially, since it doesn't fall conveniently out of +// the generic prototype creation code below. +// +void TBuiltInParseablesHlsl::createMatTimesMat() +{ + TString& s = commonBuiltins; + + for (int xRows = 1; xRows <=4; xRows++) { + for (int xCols = 1; xCols <=4; xCols++) { + const int yRows = xCols; + for (int yCols = 1; yCols <=4; yCols++) { + const int retRows = xRows; + const int retCols = yCols; + + // Create a mat * mat of the appropriate dimensions + AppendTypeName(s, "M", "F", retRows, retCols); // add return type + s.append(" "); // space between type and name + s.append("mul"); // intrinsic name + s.append("("); // open paren + + AppendTypeName(s, "M", "F", xRows, xCols); // add X input + s.append(", "); + AppendTypeName(s, "M", "F", yRows, yCols); // add Y input + + s.append(");\n"); // close paren + } + + // Create M*V + AppendTypeName(s, "V", "F", xRows, 1); // add return type + s.append(" "); // space between type and name + s.append("mul"); // intrinsic name + s.append("("); // open paren + + AppendTypeName(s, "M", "F", xRows, xCols); // add X input + s.append(", "); + AppendTypeName(s, "V", "F", xCols, 1); // add Y input + + s.append(");\n"); // close paren + + // Create V*M + AppendTypeName(s, "V", "F", xCols, 1); // add return type + s.append(" "); // space between type and name + s.append("mul"); // intrinsic name + s.append("("); // open paren + + AppendTypeName(s, "V", "F", xRows, 1); // add Y input + s.append(", "); + AppendTypeName(s, "M", "F", xRows, xCols); // add X input + + s.append(");\n"); // close paren + } + } +} + +// +// Add all context-independent built-in functions and variables that are present +// for the given version and profile. Share common ones across stages, otherwise +// make stage-specific entries. +// +// Most built-ins variables can be added as simple text strings. Some need to +// be added programmatically, which is done later in IdentifyBuiltIns() below. +// +void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, const SpvVersion& /*spvVersion*/) +{ + static const EShLanguageMask EShLangAll = EShLanguageMask(EShLangCount - 1); + + // These are the actual stage masks defined in the documentation, in case they are + // needed for future validation. For now, they are commented out, and set below + // to EShLangAll, to allow any intrinsic to be used in any shader, which is legal + // if it is not called. + // + // static const EShLanguageMask EShLangPSCS = EShLanguageMask(EShLangFragmentMask | EShLangComputeMask); + // static const EShLanguageMask EShLangVSPSGS = EShLanguageMask(EShLangVertexMask | EShLangFragmentMask | EShLangGeometryMask); + // static const EShLanguageMask EShLangCS = EShLangComputeMask; + // static const EShLanguageMask EShLangPS = EShLangFragmentMask; + // static const EShLanguageMask EShLangHS = EShLangTessControlMask; + + // This set uses EShLangAll for everything. + static const EShLanguageMask EShLangPSCS = EShLangAll; + static const EShLanguageMask EShLangVSPSGS = EShLangAll; + static const EShLanguageMask EShLangCS = EShLangAll; + static const EShLanguageMask EShLangPS = EShLangAll; + static const EShLanguageMask EShLangHS = EShLangAll; + static const EShLanguageMask EShLangGS = EShLangAll; + + // This structure encodes the prototype information for each HLSL intrinsic. + // Because explicit enumeration would be cumbersome, it's procedurally generated. + // orderKey can be: + // S = scalar, V = vector, M = matrix, - = void + // typekey can be: + // D = double, F = float, U = uint, I = int, B = bool, S = sampler, s = shadowSampler, M = uint64_t, L = int64_t + // An empty order or type key repeats the first one. E.g: SVM,, means 3 args each of SVM. + // '>' as first letter of order creates an output parameter + // '<' as first letter of order creates an input parameter + // '^' as first letter of order takes transpose dimensions + // '%' as first letter of order creates texture of given F/I/U type (texture, itexture, etc) + // '@' as first letter of order creates arrayed texture of given type + // '$' / '&' as first letter of order creates 2DMS / 2DMSArray textures + // '*' as first letter of order creates buffer object + // '!' as first letter of order creates image object + // '#' as first letter of order creates arrayed image object + // '~' as first letter of order creates an image buffer object + // '[' / ']' as first letter of order creates a SubpassInput/SubpassInputMS object + + static const struct { + const char* name; // intrinsic name + const char* retOrder; // return type key: empty matches order of 1st argument + const char* retType; // return type key: empty matches type of 1st argument + const char* argOrder; // argument order key + const char* argType; // argument type key + unsigned int stage; // stage mask + bool method; // true if it's a method. + } hlslIntrinsics[] = { + // name retOrd retType argOrder argType stage mask method + // ---------------------------------------------------------------------------------------------------------------- + { "abort", nullptr, nullptr, "-", "-", EShLangAll, false }, + { "abs", nullptr, nullptr, "SVM", "DFUI", EShLangAll, false }, + { "acos", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "all", "S", "B", "SVM", "BFIU", EShLangAll, false }, + { "AllMemoryBarrier", nullptr, nullptr, "-", "-", EShLangCS, false }, + { "AllMemoryBarrierWithGroupSync", nullptr, nullptr, "-", "-", EShLangCS, false }, + { "any", "S", "B", "SVM", "BFIU", EShLangAll, false }, + { "asdouble", "S", "D", "S,", "UI,", EShLangAll, false }, + { "asdouble", "V2", "D", "V2,", "UI,", EShLangAll, false }, + { "asfloat", nullptr, "F", "SVM", "BFIU", EShLangAll, false }, + { "asin", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "asint", nullptr, "I", "SVM", "FIU", EShLangAll, false }, + { "asuint", nullptr, "U", "SVM", "FIU", EShLangAll, false }, + { "atan", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "atan2", nullptr, nullptr, "SVM,", "F,", EShLangAll, false }, + { "ceil", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "CheckAccessFullyMapped", "S", "B" , "S", "U", EShLangPSCS, false }, + { "clamp", nullptr, nullptr, "SVM,,", "FUI,,", EShLangAll, false }, + { "clip", "-", "-", "SVM", "FUI", EShLangPS, false }, + { "cos", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "cosh", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "countbits", nullptr, nullptr, "SV", "UI", EShLangAll, false }, + { "cross", nullptr, nullptr, "V3,", "F,", EShLangAll, false }, + { "D3DCOLORtoUBYTE4", "V4", "I", "V4", "F", EShLangAll, false }, + { "ddx", nullptr, nullptr, "SVM", "F", EShLangPS, false }, + { "ddx_coarse", nullptr, nullptr, "SVM", "F", EShLangPS, false }, + { "ddx_fine", nullptr, nullptr, "SVM", "F", EShLangPS, false }, + { "ddy", nullptr, nullptr, "SVM", "F", EShLangPS, false }, + { "ddy_coarse", nullptr, nullptr, "SVM", "F", EShLangPS, false }, + { "ddy_fine", nullptr, nullptr, "SVM", "F", EShLangPS, false }, + { "degrees", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "determinant", "S", "F", "M", "F", EShLangAll, false }, + { "DeviceMemoryBarrier", nullptr, nullptr, "-", "-", EShLangPSCS, false }, + { "DeviceMemoryBarrierWithGroupSync", nullptr, nullptr, "-", "-", EShLangCS, false }, + { "distance", "S", "F", "SV,", "F,", EShLangAll, false }, + { "dot", "S", nullptr, "SV,", "FI,", EShLangAll, false }, + { "dst", nullptr, nullptr, "V4,", "F,", EShLangAll, false }, + // { "errorf", "-", "-", "", "", EShLangAll, false }, TODO: varargs + { "EvaluateAttributeAtCentroid", nullptr, nullptr, "SVM", "F", EShLangPS, false }, + { "EvaluateAttributeAtSample", nullptr, nullptr, "SVM,S", "F,U", EShLangPS, false }, + { "EvaluateAttributeSnapped", nullptr, nullptr, "SVM,V2", "F,I", EShLangPS, false }, + { "exp", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "exp2", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "f16tof32", nullptr, "F", "SV", "U", EShLangAll, false }, + { "f32tof16", nullptr, "U", "SV", "F", EShLangAll, false }, + { "faceforward", nullptr, nullptr, "V,,", "F,,", EShLangAll, false }, + { "firstbithigh", nullptr, nullptr, "SV", "UI", EShLangAll, false }, + { "firstbitlow", nullptr, nullptr, "SV", "UI", EShLangAll, false }, + { "floor", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "fma", nullptr, nullptr, "SVM,,", "D,,", EShLangAll, false }, + { "fmod", nullptr, nullptr, "SVM,", "F,", EShLangAll, false }, + { "frac", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "frexp", nullptr, nullptr, "SVM,", "F,", EShLangAll, false }, + { "fwidth", nullptr, nullptr, "SVM", "F", EShLangPS, false }, + { "GetRenderTargetSampleCount", "S", "U", "-", "-", EShLangAll, false }, + { "GetRenderTargetSamplePosition", "V2", "F", "V1", "I", EShLangAll, false }, + { "GroupMemoryBarrier", nullptr, nullptr, "-", "-", EShLangCS, false }, + { "GroupMemoryBarrierWithGroupSync", nullptr, nullptr, "-", "-", EShLangCS, false }, + { "InterlockedAdd", "-", "-", "SVM,,>", "FUI,,", EShLangPSCS, false }, + { "InterlockedAdd", "-", "-", "SVM,", "FUI,", EShLangPSCS, false }, + { "InterlockedAnd", "-", "-", "SVM,,>", "UI,,", EShLangPSCS, false }, + { "InterlockedAnd", "-", "-", "SVM,", "UI,", EShLangPSCS, false }, + { "InterlockedCompareExchange", "-", "-", "SVM,,,>", "UI,,,", EShLangPSCS, false }, + { "InterlockedCompareStore", "-", "-", "SVM,,", "UI,,", EShLangPSCS, false }, + { "InterlockedExchange", "-", "-", "SVM,,>", "UI,,", EShLangPSCS, false }, + { "InterlockedMax", "-", "-", "SVM,,>", "UI,,", EShLangPSCS, false }, + { "InterlockedMax", "-", "-", "SVM,", "UI,", EShLangPSCS, false }, + { "InterlockedMin", "-", "-", "SVM,,>", "UI,,", EShLangPSCS, false }, + { "InterlockedMin", "-", "-", "SVM,", "UI,", EShLangPSCS, false }, + { "InterlockedOr", "-", "-", "SVM,,>", "UI,,", EShLangPSCS, false }, + { "InterlockedOr", "-", "-", "SVM,", "UI,", EShLangPSCS, false }, + { "InterlockedXor", "-", "-", "SVM,,>", "UI,,", EShLangPSCS, false }, + { "InterlockedXor", "-", "-", "SVM,", "UI,", EShLangPSCS, false }, + { "isfinite", nullptr, "B" , "SVM", "F", EShLangAll, false }, + { "isinf", nullptr, "B" , "SVM", "F", EShLangAll, false }, + { "isnan", nullptr, "B" , "SVM", "F", EShLangAll, false }, + { "ldexp", nullptr, nullptr, "SVM,", "F,", EShLangAll, false }, + { "length", "S", "F", "SV", "F", EShLangAll, false }, + { "lerp", nullptr, nullptr, "VM,,", "F,,", EShLangAll, false }, + { "lerp", nullptr, nullptr, "SVM,,S", "F,,", EShLangAll, false }, + { "lit", "V4", "F", "S,,", "F,,", EShLangAll, false }, + { "log", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "log10", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "log2", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "mad", nullptr, nullptr, "SVM,,", "DFUI,,", EShLangAll, false }, + { "max", nullptr, nullptr, "SVM,", "FIU,", EShLangAll, false }, + { "min", nullptr, nullptr, "SVM,", "FIU,", EShLangAll, false }, + { "modf", nullptr, nullptr, "SVM,>", "FIU,", EShLangAll, false }, + { "msad4", "V4", "U", "S,V2,V4", "U,,", EShLangAll, false }, + { "mul", "S", nullptr, "S,S", "FI,", EShLangAll, false }, + { "mul", "V", nullptr, "S,V", "FI,", EShLangAll, false }, + { "mul", "M", nullptr, "S,M", "FI,", EShLangAll, false }, + { "mul", "V", nullptr, "V,S", "FI,", EShLangAll, false }, + { "mul", "S", nullptr, "V,V", "FI,", EShLangAll, false }, + { "mul", "M", nullptr, "M,S", "FI,", EShLangAll, false }, + // mat*mat form of mul is handled in createMatTimesMat() + { "noise", "S", "F", "V", "F", EShLangPS, false }, + { "normalize", nullptr, nullptr, "V", "F", EShLangAll, false }, + { "pow", nullptr, nullptr, "SVM,", "F,", EShLangAll, false }, + { "printf", nullptr, nullptr, "-", "-", EShLangAll, false }, + { "Process2DQuadTessFactorsAvg", "-", "-", "V4,V2,>V4,>V2,", "F,,,,", EShLangHS, false }, + { "Process2DQuadTessFactorsMax", "-", "-", "V4,V2,>V4,>V2,", "F,,,,", EShLangHS, false }, + { "Process2DQuadTessFactorsMin", "-", "-", "V4,V2,>V4,>V2,", "F,,,,", EShLangHS, false }, + { "ProcessIsolineTessFactors", "-", "-", "S,,>,>", "F,,,", EShLangHS, false }, + { "ProcessQuadTessFactorsAvg", "-", "-", "V4,S,>V4,>V2,", "F,,,,", EShLangHS, false }, + { "ProcessQuadTessFactorsMax", "-", "-", "V4,S,>V4,>V2,", "F,,,,", EShLangHS, false }, + { "ProcessQuadTessFactorsMin", "-", "-", "V4,S,>V4,>V2,", "F,,,,", EShLangHS, false }, + { "ProcessTriTessFactorsAvg", "-", "-", "V3,S,>V3,>S,", "F,,,,", EShLangHS, false }, + { "ProcessTriTessFactorsMax", "-", "-", "V3,S,>V3,>S,", "F,,,,", EShLangHS, false }, + { "ProcessTriTessFactorsMin", "-", "-", "V3,S,>V3,>S,", "F,,,,", EShLangHS, false }, + { "radians", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "rcp", nullptr, nullptr, "SVM", "FD", EShLangAll, false }, + { "reflect", nullptr, nullptr, "V,", "F,", EShLangAll, false }, + { "refract", nullptr, nullptr, "V,V,S", "F,,", EShLangAll, false }, + { "reversebits", nullptr, nullptr, "SV", "UI", EShLangAll, false }, + { "round", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "rsqrt", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "saturate", nullptr, nullptr , "SVM", "F", EShLangAll, false }, + { "sign", nullptr, nullptr, "SVM", "FI", EShLangAll, false }, + { "sin", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "sincos", "-", "-", "SVM,>,>", "F,,", EShLangAll, false }, + { "sinh", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "smoothstep", nullptr, nullptr, "SVM,,", "F,,", EShLangAll, false }, + { "sqrt", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "step", nullptr, nullptr, "SVM,", "F,", EShLangAll, false }, + { "tan", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "tanh", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + { "tex1D", "V4", "F", "S,S", "S,F", EShLangPS, false }, + { "tex1D", "V4", "F", "S,S,V1,", "S,F,,", EShLangPS, false }, + { "tex1Dbias", "V4", "F", "S,V4", "S,F", EShLangPS, false }, + { "tex1Dgrad", "V4", "F", "S,,,", "S,F,,", EShLangPS, false }, + { "tex1Dlod", "V4", "F", "S,V4", "S,F", EShLangPS, false }, + { "tex1Dproj", "V4", "F", "S,V4", "S,F", EShLangPS, false }, + { "tex2D", "V4", "F", "V2,", "S,F", EShLangPS, false }, + { "tex2D", "V4", "F", "V2,,,", "S,F,,", EShLangPS, false }, + { "tex2Dbias", "V4", "F", "V2,V4", "S,F", EShLangPS, false }, + { "tex2Dgrad", "V4", "F", "V2,,,", "S,F,,", EShLangPS, false }, + { "tex2Dlod", "V4", "F", "V2,V4", "S,F", EShLangAll, false }, + { "tex2Dproj", "V4", "F", "V2,V4", "S,F", EShLangPS, false }, + { "tex3D", "V4", "F", "V3,", "S,F", EShLangPS, false }, + { "tex3D", "V4", "F", "V3,,,", "S,F,,", EShLangPS, false }, + { "tex3Dbias", "V4", "F", "V3,V4", "S,F", EShLangPS, false }, + { "tex3Dgrad", "V4", "F", "V3,,,", "S,F,,", EShLangPS, false }, + { "tex3Dlod", "V4", "F", "V3,V4", "S,F", EShLangPS, false }, + { "tex3Dproj", "V4", "F", "V3,V4", "S,F", EShLangPS, false }, + { "texCUBE", "V4", "F", "V4,V3", "S,F", EShLangPS, false }, + { "texCUBE", "V4", "F", "V4,V3,,", "S,F,,", EShLangPS, false }, + { "texCUBEbias", "V4", "F", "V4,", "S,F", EShLangPS, false }, + { "texCUBEgrad", "V4", "F", "V4,V3,,", "S,F,,", EShLangPS, false }, + { "texCUBElod", "V4", "F", "V4,", "S,F", EShLangPS, false }, + { "texCUBEproj", "V4", "F", "V4,", "S,F", EShLangPS, false }, + { "transpose", "^M", nullptr, "M", "FUIB", EShLangAll, false }, + { "trunc", nullptr, nullptr, "SVM", "F", EShLangAll, false }, + + // Texture object methods. Return type can be overridden by shader declaration. + // !O = no offset, O = offset + { "Sample", /*!O*/ "V4", nullptr, "%@,S,V", "FIU,S,F", EShLangPS, true }, + { "Sample", /* O*/ "V4", nullptr, "%@,S,V,", "FIU,S,F,I", EShLangPS, true }, + + { "SampleBias", /*!O*/ "V4", nullptr, "%@,S,V,S", "FIU,S,F,F", EShLangPS, true }, + { "SampleBias", /* O*/ "V4", nullptr, "%@,S,V,S,V", "FIU,S,F,F,I", EShLangPS, true }, + + // TODO: FXC accepts int/uint samplers here. unclear what that means. + { "SampleCmp", /*!O*/ "S", "F", "%@,S,V,S", "FIU,s,F,", EShLangPS, true }, + { "SampleCmp", /* O*/ "S", "F", "%@,S,V,S,V", "FIU,s,F,,I", EShLangPS, true }, + + // TODO: FXC accepts int/uint samplers here. unclear what that means. + { "SampleCmpLevelZero", /*!O*/ "S", "F", "%@,S,V,S", "FIU,s,F,F", EShLangPS, true }, + { "SampleCmpLevelZero", /* O*/ "S", "F", "%@,S,V,S,V", "FIU,s,F,F,I", EShLangPS, true }, + + { "SampleGrad", /*!O*/ "V4", nullptr, "%@,S,V,,", "FIU,S,F,,", EShLangAll, true }, + { "SampleGrad", /* O*/ "V4", nullptr, "%@,S,V,,,", "FIU,S,F,,,I", EShLangAll, true }, + + { "SampleLevel", /*!O*/ "V4", nullptr, "%@,S,V,S", "FIU,S,F,", EShLangAll, true }, + { "SampleLevel", /* O*/ "V4", nullptr, "%@,S,V,S,V", "FIU,S,F,,I", EShLangAll, true }, + + { "Load", /*!O*/ "V4", nullptr, "%@,V", "FIU,I", EShLangAll, true }, + { "Load", /* O*/ "V4", nullptr, "%@,V,V", "FIU,I,I", EShLangAll, true }, + { "Load", /* +sampleidex*/ "V4", nullptr, "$&,V,S", "FIU,I,I", EShLangAll, true }, + { "Load", /* +samplindex, offset*/ "V4", nullptr, "$&,V,S,V", "FIU,I,I,I", EShLangAll, true }, + + // RWTexture loads + { "Load", "V4", nullptr, "!#,V", "FIU,I", EShLangAll, true }, + // (RW)Buffer loads + { "Load", "V4", nullptr, "~*1,V", "FIU,I", EShLangAll, true }, + + { "Gather", /*!O*/ "V4", nullptr, "%@,S,V", "FIU,S,F", EShLangAll, true }, + { "Gather", /* O*/ "V4", nullptr, "%@,S,V,V", "FIU,S,F,I", EShLangAll, true }, + + { "CalculateLevelOfDetail", "S", "F", "%@,S,V", "FUI,S,F", EShLangPS, true }, + { "CalculateLevelOfDetailUnclamped", "S", "F", "%@,S,V", "FUI,S,F", EShLangPS, true }, + + { "GetSamplePosition", "V2", "F", "$&2,S", "FUI,I", EShLangVSPSGS,true }, + + // + // UINT Width + // UINT MipLevel, UINT Width, UINT NumberOfLevels + { "GetDimensions", /* 1D */ "-", "-", "%!~1,>S", "FUI,U", EShLangAll, true }, + { "GetDimensions", /* 1D */ "-", "-", "%!~1,>S", "FUI,F", EShLangAll, true }, + { "GetDimensions", /* 1D */ "-", "-", "%1,S,>S,", "FUI,U,,", EShLangAll, true }, + { "GetDimensions", /* 1D */ "-", "-", "%1,S,>S,", "FUI,U,F,", EShLangAll, true }, + + // UINT Width, UINT Elements + // UINT MipLevel, UINT Width, UINT Elements, UINT NumberOfLevels + { "GetDimensions", /* 1DArray */ "-", "-", "@#1,>S,", "FUI,U,", EShLangAll, true }, + { "GetDimensions", /* 1DArray */ "-", "-", "@#1,>S,", "FUI,F,", EShLangAll, true }, + { "GetDimensions", /* 1DArray */ "-", "-", "@1,S,>S,,", "FUI,U,,,", EShLangAll, true }, + { "GetDimensions", /* 1DArray */ "-", "-", "@1,S,>S,,", "FUI,U,F,,", EShLangAll, true }, + + // UINT Width, UINT Height + // UINT MipLevel, UINT Width, UINT Height, UINT NumberOfLevels + { "GetDimensions", /* 2D */ "-", "-", "%!2,>S,", "FUI,U,", EShLangAll, true }, + { "GetDimensions", /* 2D */ "-", "-", "%!2,>S,", "FUI,F,", EShLangAll, true }, + { "GetDimensions", /* 2D */ "-", "-", "%2,S,>S,,", "FUI,U,,,", EShLangAll, true }, + { "GetDimensions", /* 2D */ "-", "-", "%2,S,>S,,", "FUI,U,F,,", EShLangAll, true }, + + // UINT Width, UINT Height, UINT Elements + // UINT MipLevel, UINT Width, UINT Height, UINT Elements, UINT NumberOfLevels + { "GetDimensions", /* 2DArray */ "-", "-", "@#2,>S,,", "FUI,U,,", EShLangAll, true }, + { "GetDimensions", /* 2DArray */ "-", "-", "@#2,>S,,", "FUI,F,F,F", EShLangAll, true }, + { "GetDimensions", /* 2DArray */ "-", "-", "@2,S,>S,,,", "FUI,U,,,,", EShLangAll, true }, + { "GetDimensions", /* 2DArray */ "-", "-", "@2,S,>S,,,", "FUI,U,F,,,", EShLangAll, true }, + + // UINT Width, UINT Height, UINT Depth + // UINT MipLevel, UINT Width, UINT Height, UINT Depth, UINT NumberOfLevels + { "GetDimensions", /* 3D */ "-", "-", "%!3,>S,,", "FUI,U,,", EShLangAll, true }, + { "GetDimensions", /* 3D */ "-", "-", "%!3,>S,,", "FUI,F,,", EShLangAll, true }, + { "GetDimensions", /* 3D */ "-", "-", "%3,S,>S,,,", "FUI,U,,,,", EShLangAll, true }, + { "GetDimensions", /* 3D */ "-", "-", "%3,S,>S,,,", "FUI,U,F,,,", EShLangAll, true }, + + // UINT Width, UINT Height + // UINT MipLevel, UINT Width, UINT Height, UINT NumberOfLevels + { "GetDimensions", /* Cube */ "-", "-", "%4,>S,", "FUI,U,", EShLangAll, true }, + { "GetDimensions", /* Cube */ "-", "-", "%4,>S,", "FUI,F,", EShLangAll, true }, + { "GetDimensions", /* Cube */ "-", "-", "%4,S,>S,,", "FUI,U,,,", EShLangAll, true }, + { "GetDimensions", /* Cube */ "-", "-", "%4,S,>S,,", "FUI,U,F,,", EShLangAll, true }, + + // UINT Width, UINT Height, UINT Elements + // UINT MipLevel, UINT Width, UINT Height, UINT Elements, UINT NumberOfLevels + { "GetDimensions", /* CubeArray */ "-", "-", "@4,>S,,", "FUI,U,,", EShLangAll, true }, + { "GetDimensions", /* CubeArray */ "-", "-", "@4,>S,,", "FUI,F,,", EShLangAll, true }, + { "GetDimensions", /* CubeArray */ "-", "-", "@4,S,>S,,,", "FUI,U,,,,", EShLangAll, true }, + { "GetDimensions", /* CubeArray */ "-", "-", "@4,S,>S,,,", "FUI,U,F,,,", EShLangAll, true }, + + // UINT Width, UINT Height, UINT Samples + // UINT Width, UINT Height, UINT Elements, UINT Samples + { "GetDimensions", /* 2DMS */ "-", "-", "$2,>S,,", "FUI,U,,", EShLangAll, true }, + { "GetDimensions", /* 2DMS */ "-", "-", "$2,>S,,", "FUI,U,,", EShLangAll, true }, + { "GetDimensions", /* 2DMSArray */ "-", "-", "&2,>S,,,", "FUI,U,,,", EShLangAll, true }, + { "GetDimensions", /* 2DMSArray */ "-", "-", "&2,>S,,,", "FUI,U,,,", EShLangAll, true }, + + // SM5 texture methods + { "GatherRed", /*!O*/ "V4", nullptr, "%@,S,V", "FIU,S,F", EShLangAll, true }, + { "GatherRed", /* O*/ "V4", nullptr, "%@,S,V,", "FIU,S,F,I", EShLangAll, true }, + { "GatherRed", /* O, status*/ "V4", nullptr, "%@,S,V,,>S", "FIU,S,F,I,U", EShLangAll, true }, + { "GatherRed", /* O-4 */ "V4", nullptr, "%@,S,V,,,,", "FIU,S,F,I,,,", EShLangAll, true }, + { "GatherRed", /* O-4, status */"V4", nullptr, "%@,S,V,,,,,S", "FIU,S,F,I,,,,U", EShLangAll, true }, + + { "GatherGreen", /*!O*/ "V4", nullptr, "%@,S,V", "FIU,S,F", EShLangAll, true }, + { "GatherGreen", /* O*/ "V4", nullptr, "%@,S,V,", "FIU,S,F,I", EShLangAll, true }, + { "GatherGreen", /* O, status*/ "V4", nullptr, "%@,S,V,,>S", "FIU,S,F,I,U", EShLangAll, true }, + { "GatherGreen", /* O-4 */ "V4", nullptr, "%@,S,V,,,,", "FIU,S,F,I,,,", EShLangAll, true }, + { "GatherGreen", /* O-4, status */"V4", nullptr, "%@,S,V,,,,,S", "FIU,S,F,I,,,,U", EShLangAll, true }, + + { "GatherBlue", /*!O*/ "V4", nullptr, "%@,S,V", "FIU,S,F", EShLangAll, true }, + { "GatherBlue", /* O*/ "V4", nullptr, "%@,S,V,", "FIU,S,F,I", EShLangAll, true }, + { "GatherBlue", /* O, status*/ "V4", nullptr, "%@,S,V,,>S", "FIU,S,F,I,U", EShLangAll, true }, + { "GatherBlue", /* O-4 */ "V4", nullptr, "%@,S,V,,,,", "FIU,S,F,I,,,", EShLangAll, true }, + { "GatherBlue", /* O-4, status */"V4", nullptr, "%@,S,V,,,,,S", "FIU,S,F,I,,,,U", EShLangAll, true }, + + { "GatherAlpha", /*!O*/ "V4", nullptr, "%@,S,V", "FIU,S,F", EShLangAll, true }, + { "GatherAlpha", /* O*/ "V4", nullptr, "%@,S,V,", "FIU,S,F,I", EShLangAll, true }, + { "GatherAlpha", /* O, status*/ "V4", nullptr, "%@,S,V,,>S", "FIU,S,F,I,U", EShLangAll, true }, + { "GatherAlpha", /* O-4 */ "V4", nullptr, "%@,S,V,,,,", "FIU,S,F,I,,,", EShLangAll, true }, + { "GatherAlpha", /* O-4, status */"V4", nullptr, "%@,S,V,,,,,S", "FIU,S,F,I,,,,U", EShLangAll, true }, + + { "GatherCmp", /*!O*/ "V4", nullptr, "%@,S,V,S", "FIU,s,F,", EShLangAll, true }, + { "GatherCmp", /* O*/ "V4", nullptr, "%@,S,V,S,V", "FIU,s,F,,I", EShLangAll, true }, + { "GatherCmp", /* O, status*/ "V4", nullptr, "%@,S,V,S,V,>S", "FIU,s,F,,I,U", EShLangAll, true }, + { "GatherCmp", /* O-4 */ "V4", nullptr, "%@,S,V,S,V,,,", "FIU,s,F,,I,,,", EShLangAll, true }, + { "GatherCmp", /* O-4, status */"V4", nullptr, "%@,S,V,S,V,,V,S","FIU,s,F,,I,,,,U",EShLangAll, true }, + + { "GatherCmpRed", /*!O*/ "V4", nullptr, "%@,S,V,S", "FIU,s,F,", EShLangAll, true }, + { "GatherCmpRed", /* O*/ "V4", nullptr, "%@,S,V,S,V", "FIU,s,F,,I", EShLangAll, true }, + { "GatherCmpRed", /* O, status*/ "V4", nullptr, "%@,S,V,S,V,>S", "FIU,s,F,,I,U", EShLangAll, true }, + { "GatherCmpRed", /* O-4 */ "V4", nullptr, "%@,S,V,S,V,,,", "FIU,s,F,,I,,,", EShLangAll, true }, + { "GatherCmpRed", /* O-4, status */"V4", nullptr, "%@,S,V,S,V,,V,S","FIU,s,F,,I,,,,U",EShLangAll, true }, + + { "GatherCmpGreen", /*!O*/ "V4", nullptr, "%@,S,V,S", "FIU,s,F,", EShLangAll, true }, + { "GatherCmpGreen", /* O*/ "V4", nullptr, "%@,S,V,S,V", "FIU,s,F,,I", EShLangAll, true }, + { "GatherCmpGreen", /* O, status*/ "V4", nullptr, "%@,S,V,S,V,>S", "FIU,s,F,,I,U", EShLangAll, true }, + { "GatherCmpGreen", /* O-4 */ "V4", nullptr, "%@,S,V,S,V,,,", "FIU,s,F,,I,,,", EShLangAll, true }, + { "GatherCmpGreen", /* O-4, status */"V4", nullptr, "%@,S,V,S,V,,,,S","FIU,s,F,,I,,,,U",EShLangAll, true }, + + { "GatherCmpBlue", /*!O*/ "V4", nullptr, "%@,S,V,S", "FIU,s,F,", EShLangAll, true }, + { "GatherCmpBlue", /* O*/ "V4", nullptr, "%@,S,V,S,V", "FIU,s,F,,I", EShLangAll, true }, + { "GatherCmpBlue", /* O, status*/ "V4", nullptr, "%@,S,V,S,V,>S", "FIU,s,F,,I,U", EShLangAll, true }, + { "GatherCmpBlue", /* O-4 */ "V4", nullptr, "%@,S,V,S,V,,,", "FIU,s,F,,I,,,", EShLangAll, true }, + { "GatherCmpBlue", /* O-4, status */"V4", nullptr, "%@,S,V,S,V,,,,S","FIU,s,F,,I,,,,U",EShLangAll, true }, + + { "GatherCmpAlpha", /*!O*/ "V4", nullptr, "%@,S,V,S", "FIU,s,F,", EShLangAll, true }, + { "GatherCmpAlpha", /* O*/ "V4", nullptr, "%@,S,V,S,V", "FIU,s,F,,I", EShLangAll, true }, + { "GatherCmpAlpha", /* O, status*/ "V4", nullptr, "%@,S,V,S,V,>S", "FIU,s,F,,I,U", EShLangAll, true }, + { "GatherCmpAlpha", /* O-4 */ "V4", nullptr, "%@,S,V,S,V,,,", "FIU,s,F,,I,,,", EShLangAll, true }, + { "GatherCmpAlpha", /* O-4, status */"V4", nullptr, "%@,S,V,S,V,,,,S","FIU,s,F,,I,,,,U",EShLangAll, true }, + + // geometry methods + { "Append", "-", "-", "-", "-", EShLangGS , true }, + { "RestartStrip", "-", "-", "-", "-", EShLangGS , true }, + + // Methods for structurebuffers. TODO: wildcard type matching. + { "Load", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "Load2", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "Load3", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "Load4", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "Store", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "Store2", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "Store3", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "Store4", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "GetDimensions", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "InterlockedAdd", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "InterlockedAnd", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "InterlockedCompareExchange", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "InterlockedCompareStore", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "InterlockedExchange", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "InterlockedMax", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "InterlockedMin", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "InterlockedOr", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "InterlockedXor", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "IncrementCounter", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "DecrementCounter", nullptr, nullptr, "-", "-", EShLangAll, true }, + { "Consume", nullptr, nullptr, "-", "-", EShLangAll, true }, + + // SM 6.0 + + { "WaveIsFirstLane", "S", "B", "-", "-", EShLangPSCS, false}, + { "WaveGetLaneCount", "S", "U", "-", "-", EShLangPSCS, false}, + { "WaveGetLaneIndex", "S", "U", "-", "-", EShLangPSCS, false}, + { "WaveActiveAnyTrue", "S", "B", "S", "B", EShLangPSCS, false}, + { "WaveActiveAllTrue", "S", "B", "S", "B", EShLangPSCS, false}, + { "WaveActiveBallot", "V4", "U", "S", "B", EShLangPSCS, false}, + { "WaveReadLaneAt", nullptr, nullptr, "SV,S", "DFUI,U", EShLangPSCS, false}, + { "WaveReadLaneFirst", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveAllEqual", "S", "B", "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveAllEqualBool", "S", "B", "S", "B", EShLangPSCS, false}, + { "WaveActiveCountBits", "S", "U", "S", "B", EShLangPSCS, false}, + + { "WaveActiveSum", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveProduct", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveBitAnd", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveBitOr", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveBitXor", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveMin", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveMax", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WavePrefixSum", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WavePrefixProduct", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WavePrefixCountBits", "S", "U", "S", "B", EShLangPSCS, false}, + { "QuadReadAcrossX", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "QuadReadAcrossY", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "QuadReadAcrossDiagonal", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "QuadReadLaneAt", nullptr, nullptr, "SV,S", "DFUI,U", EShLangPSCS, false}, + + // Methods for subpass input objects + { "SubpassLoad", "V4", nullptr, "[", "FIU", EShLangPS, true }, + { "SubpassLoad", "V4", nullptr, "],S", "FIU,I", EShLangPS, true }, + + // Mark end of list, since we want to avoid a range-based for, as some compilers don't handle it yet. + { nullptr, nullptr, nullptr, nullptr, nullptr, 0, false }, + }; + + // Create prototypes for the intrinsics. TODO: Avoid ranged based for until all compilers can handle it. + for (int icount = 0; hlslIntrinsics[icount].name; ++icount) { + const auto& intrinsic = hlslIntrinsics[icount]; + + for (int stage = 0; stage < EShLangCount; ++stage) { // for each stage... + if ((intrinsic.stage & (1< 0 ? std::min(dim0, 3) : dim0; + + s.append(arg > 0 ? ", ": ""); // comma separator if needed + + const char* orderBegin = nthArgOrder; + nthArgOrder = IoParam(s, nthArgOrder); + + // Comma means use the previous argument order and type. + HandleRepeatArg(nthArgOrder, prevArgOrder, orderBegin); + HandleRepeatArg(nthArgType, prevArgType, nthArgType); + + // In case the repeated arg has its own I/O marker + nthArgOrder = IoParam(s, nthArgOrder); + + // arrayed textures have one extra coordinate dimension, except for + // the CalculateLevelOfDetail family. + if (isArrayed && arg == coordArg && !NoArrayCoord(intrinsic.name)) + argDim0++; + + // Some texture methods use an addition arg dimension to hold mip + if (arg == coordArg && mipInCoord) + argDim0++; + + // For textures, the 1D case isn't a 1-vector, but a scalar. + if (isTexture && argDim0 == 1 && arg > 0 && *nthArgOrder == 'V') + nthArgOrder = "S"; + + AppendTypeName(s, nthArgOrder, nthArgType, argDim0, dim1); // Add arguments + } + + s.append(");\n"); // close paren and trailing semicolon + } // dim 1 loop + } // dim 0 loop + } // arg type loop + + // skip over special characters + if (isTexture && isalpha(argOrder[1])) + ++argOrder; + if (isdigit(argOrder[1])) + ++argOrder; + } // arg order loop + + if (intrinsic.stage == EShLangAll) // common builtins are only added once. + break; + } + } + + createMatTimesMat(); // handle this case separately, for convenience + + // printf("Common:\n%s\n", getCommonString().c_str()); + // printf("Frag:\n%s\n", getStageString(EShLangFragment).c_str()); + // printf("Vertex:\n%s\n", getStageString(EShLangVertex).c_str()); + // printf("Geo:\n%s\n", getStageString(EShLangGeometry).c_str()); + // printf("TessCtrl:\n%s\n", getStageString(EShLangTessControl).c_str()); + // printf("TessEval:\n%s\n", getStageString(EShLangTessEvaluation).c_str()); + // printf("Compute:\n%s\n", getStageString(EShLangCompute).c_str()); +} + +// +// Add context-dependent built-in functions and variables that are present +// for the given version and profile. All the results are put into just the +// commonBuiltins, because it is called for just a specific stage. So, +// add stage-specific entries to the commonBuiltins, and only if that stage +// was requested. +// +void TBuiltInParseablesHlsl::initialize(const TBuiltInResource& /*resources*/, int /*version*/, EProfile /*profile*/, + const SpvVersion& /*spvVersion*/, EShLanguage /*language*/) +{ +} + +// +// Finish adding/processing context-independent built-in symbols. +// 1) Programmatically add symbols that could not be added by simple text strings above. +// 2) Map built-in functions to operators, for those that will turn into an operation node +// instead of remaining a function call. +// 3) Tag extension-related symbols added to their base version with their extensions, so +// that if an early version has the extension turned off, there is an error reported on use. +// +void TBuiltInParseablesHlsl::identifyBuiltIns(int /*version*/, EProfile /*profile*/, const SpvVersion& /*spvVersion*/, EShLanguage /*language*/, + TSymbolTable& symbolTable) +{ + // symbolTable.relateToOperator("abort", EOpAbort); + symbolTable.relateToOperator("abs", EOpAbs); + symbolTable.relateToOperator("acos", EOpAcos); + symbolTable.relateToOperator("all", EOpAll); + symbolTable.relateToOperator("AllMemoryBarrier", EOpMemoryBarrier); + symbolTable.relateToOperator("AllMemoryBarrierWithGroupSync", EOpAllMemoryBarrierWithGroupSync); + symbolTable.relateToOperator("any", EOpAny); + symbolTable.relateToOperator("asdouble", EOpAsDouble); + symbolTable.relateToOperator("asfloat", EOpIntBitsToFloat); + symbolTable.relateToOperator("asin", EOpAsin); + symbolTable.relateToOperator("asint", EOpFloatBitsToInt); + symbolTable.relateToOperator("asuint", EOpFloatBitsToUint); + symbolTable.relateToOperator("atan", EOpAtan); + symbolTable.relateToOperator("atan2", EOpAtan); + symbolTable.relateToOperator("ceil", EOpCeil); + // symbolTable.relateToOperator("CheckAccessFullyMapped"); + symbolTable.relateToOperator("clamp", EOpClamp); + symbolTable.relateToOperator("clip", EOpClip); + symbolTable.relateToOperator("cos", EOpCos); + symbolTable.relateToOperator("cosh", EOpCosh); + symbolTable.relateToOperator("countbits", EOpBitCount); + symbolTable.relateToOperator("cross", EOpCross); + symbolTable.relateToOperator("D3DCOLORtoUBYTE4", EOpD3DCOLORtoUBYTE4); + symbolTable.relateToOperator("ddx", EOpDPdx); + symbolTable.relateToOperator("ddx_coarse", EOpDPdxCoarse); + symbolTable.relateToOperator("ddx_fine", EOpDPdxFine); + symbolTable.relateToOperator("ddy", EOpDPdy); + symbolTable.relateToOperator("ddy_coarse", EOpDPdyCoarse); + symbolTable.relateToOperator("ddy_fine", EOpDPdyFine); + symbolTable.relateToOperator("degrees", EOpDegrees); + symbolTable.relateToOperator("determinant", EOpDeterminant); + symbolTable.relateToOperator("DeviceMemoryBarrier", EOpDeviceMemoryBarrier); + symbolTable.relateToOperator("DeviceMemoryBarrierWithGroupSync", EOpDeviceMemoryBarrierWithGroupSync); + symbolTable.relateToOperator("distance", EOpDistance); + symbolTable.relateToOperator("dot", EOpDot); + symbolTable.relateToOperator("dst", EOpDst); + // symbolTable.relateToOperator("errorf", EOpErrorf); + symbolTable.relateToOperator("EvaluateAttributeAtCentroid", EOpInterpolateAtCentroid); + symbolTable.relateToOperator("EvaluateAttributeAtSample", EOpInterpolateAtSample); + symbolTable.relateToOperator("EvaluateAttributeSnapped", EOpEvaluateAttributeSnapped); + symbolTable.relateToOperator("exp", EOpExp); + symbolTable.relateToOperator("exp2", EOpExp2); + symbolTable.relateToOperator("f16tof32", EOpF16tof32); + symbolTable.relateToOperator("f32tof16", EOpF32tof16); + symbolTable.relateToOperator("faceforward", EOpFaceForward); + symbolTable.relateToOperator("firstbithigh", EOpFindMSB); + symbolTable.relateToOperator("firstbitlow", EOpFindLSB); + symbolTable.relateToOperator("floor", EOpFloor); + symbolTable.relateToOperator("fma", EOpFma); + symbolTable.relateToOperator("fmod", EOpMod); + symbolTable.relateToOperator("frac", EOpFract); + symbolTable.relateToOperator("frexp", EOpFrexp); + symbolTable.relateToOperator("fwidth", EOpFwidth); + // symbolTable.relateToOperator("GetRenderTargetSampleCount"); + // symbolTable.relateToOperator("GetRenderTargetSamplePosition"); + symbolTable.relateToOperator("GroupMemoryBarrier", EOpWorkgroupMemoryBarrier); + symbolTable.relateToOperator("GroupMemoryBarrierWithGroupSync", EOpWorkgroupMemoryBarrierWithGroupSync); + symbolTable.relateToOperator("InterlockedAdd", EOpInterlockedAdd); + symbolTable.relateToOperator("InterlockedAnd", EOpInterlockedAnd); + symbolTable.relateToOperator("InterlockedCompareExchange", EOpInterlockedCompareExchange); + symbolTable.relateToOperator("InterlockedCompareStore", EOpInterlockedCompareStore); + symbolTable.relateToOperator("InterlockedExchange", EOpInterlockedExchange); + symbolTable.relateToOperator("InterlockedMax", EOpInterlockedMax); + symbolTable.relateToOperator("InterlockedMin", EOpInterlockedMin); + symbolTable.relateToOperator("InterlockedOr", EOpInterlockedOr); + symbolTable.relateToOperator("InterlockedXor", EOpInterlockedXor); + symbolTable.relateToOperator("isfinite", EOpIsFinite); + symbolTable.relateToOperator("isinf", EOpIsInf); + symbolTable.relateToOperator("isnan", EOpIsNan); + symbolTable.relateToOperator("ldexp", EOpLdexp); + symbolTable.relateToOperator("length", EOpLength); + symbolTable.relateToOperator("lerp", EOpMix); + symbolTable.relateToOperator("lit", EOpLit); + symbolTable.relateToOperator("log", EOpLog); + symbolTable.relateToOperator("log10", EOpLog10); + symbolTable.relateToOperator("log2", EOpLog2); + symbolTable.relateToOperator("mad", EOpFma); + symbolTable.relateToOperator("max", EOpMax); + symbolTable.relateToOperator("min", EOpMin); + symbolTable.relateToOperator("modf", EOpModf); + // symbolTable.relateToOperator("msad4", EOpMsad4); + symbolTable.relateToOperator("mul", EOpGenMul); + // symbolTable.relateToOperator("noise", EOpNoise); // TODO: check return type + symbolTable.relateToOperator("normalize", EOpNormalize); + symbolTable.relateToOperator("pow", EOpPow); + symbolTable.relateToOperator("printf", EOpDebugPrintf); + // symbolTable.relateToOperator("Process2DQuadTessFactorsAvg"); + // symbolTable.relateToOperator("Process2DQuadTessFactorsMax"); + // symbolTable.relateToOperator("Process2DQuadTessFactorsMin"); + // symbolTable.relateToOperator("ProcessIsolineTessFactors"); + // symbolTable.relateToOperator("ProcessQuadTessFactorsAvg"); + // symbolTable.relateToOperator("ProcessQuadTessFactorsMax"); + // symbolTable.relateToOperator("ProcessQuadTessFactorsMin"); + // symbolTable.relateToOperator("ProcessTriTessFactorsAvg"); + // symbolTable.relateToOperator("ProcessTriTessFactorsMax"); + // symbolTable.relateToOperator("ProcessTriTessFactorsMin"); + symbolTable.relateToOperator("radians", EOpRadians); + symbolTable.relateToOperator("rcp", EOpRcp); + symbolTable.relateToOperator("reflect", EOpReflect); + symbolTable.relateToOperator("refract", EOpRefract); + symbolTable.relateToOperator("reversebits", EOpBitFieldReverse); + symbolTable.relateToOperator("round", EOpRound); + symbolTable.relateToOperator("rsqrt", EOpInverseSqrt); + symbolTable.relateToOperator("saturate", EOpSaturate); + symbolTable.relateToOperator("sign", EOpSign); + symbolTable.relateToOperator("sin", EOpSin); + symbolTable.relateToOperator("sincos", EOpSinCos); + symbolTable.relateToOperator("sinh", EOpSinh); + symbolTable.relateToOperator("smoothstep", EOpSmoothStep); + symbolTable.relateToOperator("sqrt", EOpSqrt); + symbolTable.relateToOperator("step", EOpStep); + symbolTable.relateToOperator("tan", EOpTan); + symbolTable.relateToOperator("tanh", EOpTanh); + symbolTable.relateToOperator("tex1D", EOpTexture); + symbolTable.relateToOperator("tex1Dbias", EOpTextureBias); + symbolTable.relateToOperator("tex1Dgrad", EOpTextureGrad); + symbolTable.relateToOperator("tex1Dlod", EOpTextureLod); + symbolTable.relateToOperator("tex1Dproj", EOpTextureProj); + symbolTable.relateToOperator("tex2D", EOpTexture); + symbolTable.relateToOperator("tex2Dbias", EOpTextureBias); + symbolTable.relateToOperator("tex2Dgrad", EOpTextureGrad); + symbolTable.relateToOperator("tex2Dlod", EOpTextureLod); + symbolTable.relateToOperator("tex2Dproj", EOpTextureProj); + symbolTable.relateToOperator("tex3D", EOpTexture); + symbolTable.relateToOperator("tex3Dbias", EOpTextureBias); + symbolTable.relateToOperator("tex3Dgrad", EOpTextureGrad); + symbolTable.relateToOperator("tex3Dlod", EOpTextureLod); + symbolTable.relateToOperator("tex3Dproj", EOpTextureProj); + symbolTable.relateToOperator("texCUBE", EOpTexture); + symbolTable.relateToOperator("texCUBEbias", EOpTextureBias); + symbolTable.relateToOperator("texCUBEgrad", EOpTextureGrad); + symbolTable.relateToOperator("texCUBElod", EOpTextureLod); + symbolTable.relateToOperator("texCUBEproj", EOpTextureProj); + symbolTable.relateToOperator("transpose", EOpTranspose); + symbolTable.relateToOperator("trunc", EOpTrunc); + + // Texture methods + symbolTable.relateToOperator(BUILTIN_PREFIX "Sample", EOpMethodSample); + symbolTable.relateToOperator(BUILTIN_PREFIX "SampleBias", EOpMethodSampleBias); + symbolTable.relateToOperator(BUILTIN_PREFIX "SampleCmp", EOpMethodSampleCmp); + symbolTable.relateToOperator(BUILTIN_PREFIX "SampleCmpLevelZero", EOpMethodSampleCmpLevelZero); + symbolTable.relateToOperator(BUILTIN_PREFIX "SampleGrad", EOpMethodSampleGrad); + symbolTable.relateToOperator(BUILTIN_PREFIX "SampleLevel", EOpMethodSampleLevel); + symbolTable.relateToOperator(BUILTIN_PREFIX "Load", EOpMethodLoad); + symbolTable.relateToOperator(BUILTIN_PREFIX "GetDimensions", EOpMethodGetDimensions); + symbolTable.relateToOperator(BUILTIN_PREFIX "GetSamplePosition", EOpMethodGetSamplePosition); + symbolTable.relateToOperator(BUILTIN_PREFIX "Gather", EOpMethodGather); + symbolTable.relateToOperator(BUILTIN_PREFIX "CalculateLevelOfDetail", EOpMethodCalculateLevelOfDetail); + symbolTable.relateToOperator(BUILTIN_PREFIX "CalculateLevelOfDetailUnclamped", EOpMethodCalculateLevelOfDetailUnclamped); + + // Structure buffer methods (excluding associations already made above for texture methods w/ same name) + symbolTable.relateToOperator(BUILTIN_PREFIX "Load2", EOpMethodLoad2); + symbolTable.relateToOperator(BUILTIN_PREFIX "Load3", EOpMethodLoad3); + symbolTable.relateToOperator(BUILTIN_PREFIX "Load4", EOpMethodLoad4); + symbolTable.relateToOperator(BUILTIN_PREFIX "Store", EOpMethodStore); + symbolTable.relateToOperator(BUILTIN_PREFIX "Store2", EOpMethodStore2); + symbolTable.relateToOperator(BUILTIN_PREFIX "Store3", EOpMethodStore3); + symbolTable.relateToOperator(BUILTIN_PREFIX "Store4", EOpMethodStore4); + symbolTable.relateToOperator(BUILTIN_PREFIX "IncrementCounter", EOpMethodIncrementCounter); + symbolTable.relateToOperator(BUILTIN_PREFIX "DecrementCounter", EOpMethodDecrementCounter); + // Append is also a GS method: we don't add it twice + symbolTable.relateToOperator(BUILTIN_PREFIX "Consume", EOpMethodConsume); + + symbolTable.relateToOperator(BUILTIN_PREFIX "InterlockedAdd", EOpInterlockedAdd); + symbolTable.relateToOperator(BUILTIN_PREFIX "InterlockedAnd", EOpInterlockedAnd); + symbolTable.relateToOperator(BUILTIN_PREFIX "InterlockedCompareExchange", EOpInterlockedCompareExchange); + symbolTable.relateToOperator(BUILTIN_PREFIX "InterlockedCompareStore", EOpInterlockedCompareStore); + symbolTable.relateToOperator(BUILTIN_PREFIX "InterlockedExchange", EOpInterlockedExchange); + symbolTable.relateToOperator(BUILTIN_PREFIX "InterlockedMax", EOpInterlockedMax); + symbolTable.relateToOperator(BUILTIN_PREFIX "InterlockedMin", EOpInterlockedMin); + symbolTable.relateToOperator(BUILTIN_PREFIX "InterlockedOr", EOpInterlockedOr); + symbolTable.relateToOperator(BUILTIN_PREFIX "InterlockedXor", EOpInterlockedXor); + + // SM5 Texture methods + symbolTable.relateToOperator(BUILTIN_PREFIX "GatherRed", EOpMethodGatherRed); + symbolTable.relateToOperator(BUILTIN_PREFIX "GatherGreen", EOpMethodGatherGreen); + symbolTable.relateToOperator(BUILTIN_PREFIX "GatherBlue", EOpMethodGatherBlue); + symbolTable.relateToOperator(BUILTIN_PREFIX "GatherAlpha", EOpMethodGatherAlpha); + symbolTable.relateToOperator(BUILTIN_PREFIX "GatherCmp", EOpMethodGatherCmpRed); // alias + symbolTable.relateToOperator(BUILTIN_PREFIX "GatherCmpRed", EOpMethodGatherCmpRed); + symbolTable.relateToOperator(BUILTIN_PREFIX "GatherCmpGreen", EOpMethodGatherCmpGreen); + symbolTable.relateToOperator(BUILTIN_PREFIX "GatherCmpBlue", EOpMethodGatherCmpBlue); + symbolTable.relateToOperator(BUILTIN_PREFIX "GatherCmpAlpha", EOpMethodGatherCmpAlpha); + + // GS methods + symbolTable.relateToOperator(BUILTIN_PREFIX "Append", EOpMethodAppend); + symbolTable.relateToOperator(BUILTIN_PREFIX "RestartStrip", EOpMethodRestartStrip); + + // Wave ops + symbolTable.relateToOperator("WaveIsFirstLane", EOpSubgroupElect); + symbolTable.relateToOperator("WaveGetLaneCount", EOpWaveGetLaneCount); + symbolTable.relateToOperator("WaveGetLaneIndex", EOpWaveGetLaneIndex); + symbolTable.relateToOperator("WaveActiveAnyTrue", EOpSubgroupAny); + symbolTable.relateToOperator("WaveActiveAllTrue", EOpSubgroupAll); + symbolTable.relateToOperator("WaveActiveBallot", EOpSubgroupBallot); + symbolTable.relateToOperator("WaveReadLaneFirst", EOpSubgroupBroadcastFirst); + symbolTable.relateToOperator("WaveReadLaneAt", EOpSubgroupShuffle); + symbolTable.relateToOperator("WaveActiveAllEqual", EOpSubgroupAllEqual); + symbolTable.relateToOperator("WaveActiveAllEqualBool", EOpSubgroupAllEqual); + symbolTable.relateToOperator("WaveActiveCountBits", EOpWaveActiveCountBits); + symbolTable.relateToOperator("WaveActiveSum", EOpSubgroupAdd); + symbolTable.relateToOperator("WaveActiveProduct", EOpSubgroupMul); + symbolTable.relateToOperator("WaveActiveBitAnd", EOpSubgroupAnd); + symbolTable.relateToOperator("WaveActiveBitOr", EOpSubgroupOr); + symbolTable.relateToOperator("WaveActiveBitXor", EOpSubgroupXor); + symbolTable.relateToOperator("WaveActiveMin", EOpSubgroupMin); + symbolTable.relateToOperator("WaveActiveMax", EOpSubgroupMax); + symbolTable.relateToOperator("WavePrefixSum", EOpSubgroupInclusiveAdd); + symbolTable.relateToOperator("WavePrefixProduct", EOpSubgroupInclusiveMul); + symbolTable.relateToOperator("WavePrefixCountBits", EOpWavePrefixCountBits); + symbolTable.relateToOperator("QuadReadAcrossX", EOpSubgroupQuadSwapHorizontal); + symbolTable.relateToOperator("QuadReadAcrossY", EOpSubgroupQuadSwapVertical); + symbolTable.relateToOperator("QuadReadAcrossDiagonal", EOpSubgroupQuadSwapDiagonal); + symbolTable.relateToOperator("QuadReadLaneAt", EOpSubgroupQuadBroadcast); + + // Subpass input methods + symbolTable.relateToOperator(BUILTIN_PREFIX "SubpassLoad", EOpSubpassLoad); + symbolTable.relateToOperator(BUILTIN_PREFIX "SubpassLoadMS", EOpSubpassLoadMS); +} + +// +// Add context-dependent (resource-specific) built-ins not handled by the above. These +// would be ones that need to be programmatically added because they cannot +// be added by simple text strings. For these, also +// 1) Map built-in functions to operators, for those that will turn into an operation node +// instead of remaining a function call. +// 2) Tag extension-related symbols added to their base version with their extensions, so +// that if an early version has the extension turned off, there is an error reported on use. +// +void TBuiltInParseablesHlsl::identifyBuiltIns(int /*version*/, EProfile /*profile*/, const SpvVersion& /*spvVersion*/, EShLanguage /*language*/, + TSymbolTable& /*symbolTable*/, const TBuiltInResource& /*resources*/) +{ +} + +} // end namespace glslang diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslParseables.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslParseables.h new file mode 100644 index 0000000000..a4aef6c3e6 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslParseables.h @@ -0,0 +1,64 @@ +// +// Copyright (C) 2016 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef _HLSLPARSEABLES_INCLUDED_ +#define _HLSLPARSEABLES_INCLUDED_ + +#include "../MachineIndependent/Initialize.h" + +namespace glslang { + +// +// This is an HLSL specific derivation of TBuiltInParseables. See comment +// above TBuiltInParseables for details. +// +class TBuiltInParseablesHlsl : public TBuiltInParseables { +public: + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + TBuiltInParseablesHlsl(); + void initialize(int version, EProfile, const SpvVersion& spvVersion); + void initialize(const TBuiltInResource& resources, int version, EProfile, const SpvVersion& spvVersion, EShLanguage); + + void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable); + + void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources); + +private: + void createMatTimesMat(); +}; + +} // end namespace glslang + +#endif // _HLSLPARSEABLES_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslScanContext.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslScanContext.cpp new file mode 100644 index 0000000000..e45643e913 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslScanContext.cpp @@ -0,0 +1,1038 @@ +// +// Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// HLSL scanning, leveraging the scanning done by the preprocessor. +// + +#include +#include +#include + +#include "../Include/Types.h" +#include "../MachineIndependent/SymbolTable.h" +#include "../MachineIndependent/ParseHelper.h" +#include "hlslScanContext.h" +#include "hlslTokens.h" + +// preprocessor includes +#include "../MachineIndependent/preprocessor/PpContext.h" +#include "../MachineIndependent/preprocessor/PpTokens.h" + +namespace { + +struct str_eq +{ + bool operator()(const char* lhs, const char* rhs) const + { + return strcmp(lhs, rhs) == 0; + } +}; + +struct str_hash +{ + size_t operator()(const char* str) const + { + // djb2 + unsigned long hash = 5381; + int c; + + while ((c = *str++) != 0) + hash = ((hash << 5) + hash) + c; + + return hash; + } +}; + +// A single global usable by all threads, by all versions, by all languages. +const std::unordered_map KeywordMap { + {"static",glslang::EHTokStatic}, + {"const",glslang::EHTokConst}, + {"unorm",glslang::EHTokUnorm}, + {"snorm",glslang::EHTokSNorm}, + {"extern",glslang::EHTokExtern}, + {"uniform",glslang::EHTokUniform}, + {"volatile",glslang::EHTokVolatile}, + {"precise",glslang::EHTokPrecise}, + {"shared",glslang::EHTokShared}, + {"groupshared",glslang::EHTokGroupShared}, + {"linear",glslang::EHTokLinear}, + {"centroid",glslang::EHTokCentroid}, + {"nointerpolation",glslang::EHTokNointerpolation}, + {"noperspective",glslang::EHTokNoperspective}, + {"sample",glslang::EHTokSample}, + {"row_major",glslang::EHTokRowMajor}, + {"column_major",glslang::EHTokColumnMajor}, + {"packoffset",glslang::EHTokPackOffset}, + {"in",glslang::EHTokIn}, + {"out",glslang::EHTokOut}, + {"inout",glslang::EHTokInOut}, + {"layout",glslang::EHTokLayout}, + {"globallycoherent",glslang::EHTokGloballyCoherent}, + {"inline",glslang::EHTokInline}, + + {"point",glslang::EHTokPoint}, + {"line",glslang::EHTokLine}, + {"triangle",glslang::EHTokTriangle}, + {"lineadj",glslang::EHTokLineAdj}, + {"triangleadj",glslang::EHTokTriangleAdj}, + + {"PointStream",glslang::EHTokPointStream}, + {"LineStream",glslang::EHTokLineStream}, + {"TriangleStream",glslang::EHTokTriangleStream}, + + {"InputPatch",glslang::EHTokInputPatch}, + {"OutputPatch",glslang::EHTokOutputPatch}, + + {"Buffer",glslang::EHTokBuffer}, + {"vector",glslang::EHTokVector}, + {"matrix",glslang::EHTokMatrix}, + + {"void",glslang::EHTokVoid}, + {"string",glslang::EHTokString}, + {"bool",glslang::EHTokBool}, + {"int",glslang::EHTokInt}, + {"uint",glslang::EHTokUint}, + {"uint64_t",glslang::EHTokUint64}, + {"dword",glslang::EHTokDword}, + {"half",glslang::EHTokHalf}, + {"float",glslang::EHTokFloat}, + {"double",glslang::EHTokDouble}, + {"min16float",glslang::EHTokMin16float}, + {"min10float",glslang::EHTokMin10float}, + {"min16int",glslang::EHTokMin16int}, + {"min12int",glslang::EHTokMin12int}, + {"min16uint",glslang::EHTokMin16uint}, + + {"bool1",glslang::EHTokBool1}, + {"bool2",glslang::EHTokBool2}, + {"bool3",glslang::EHTokBool3}, + {"bool4",glslang::EHTokBool4}, + {"float1",glslang::EHTokFloat1}, + {"float2",glslang::EHTokFloat2}, + {"float3",glslang::EHTokFloat3}, + {"float4",glslang::EHTokFloat4}, + {"int1",glslang::EHTokInt1}, + {"int2",glslang::EHTokInt2}, + {"int3",glslang::EHTokInt3}, + {"int4",glslang::EHTokInt4}, + {"double1",glslang::EHTokDouble1}, + {"double2",glslang::EHTokDouble2}, + {"double3",glslang::EHTokDouble3}, + {"double4",glslang::EHTokDouble4}, + {"uint1",glslang::EHTokUint1}, + {"uint2",glslang::EHTokUint2}, + {"uint3",glslang::EHTokUint3}, + {"uint4",glslang::EHTokUint4}, + + {"half1",glslang::EHTokHalf1}, + {"half2",glslang::EHTokHalf2}, + {"half3",glslang::EHTokHalf3}, + {"half4",glslang::EHTokHalf4}, + {"min16float1",glslang::EHTokMin16float1}, + {"min16float2",glslang::EHTokMin16float2}, + {"min16float3",glslang::EHTokMin16float3}, + {"min16float4",glslang::EHTokMin16float4}, + {"min10float1",glslang::EHTokMin10float1}, + {"min10float2",glslang::EHTokMin10float2}, + {"min10float3",glslang::EHTokMin10float3}, + {"min10float4",glslang::EHTokMin10float4}, + {"min16int1",glslang::EHTokMin16int1}, + {"min16int2",glslang::EHTokMin16int2}, + {"min16int3",glslang::EHTokMin16int3}, + {"min16int4",glslang::EHTokMin16int4}, + {"min12int1",glslang::EHTokMin12int1}, + {"min12int2",glslang::EHTokMin12int2}, + {"min12int3",glslang::EHTokMin12int3}, + {"min12int4",glslang::EHTokMin12int4}, + {"min16uint1",glslang::EHTokMin16uint1}, + {"min16uint2",glslang::EHTokMin16uint2}, + {"min16uint3",glslang::EHTokMin16uint3}, + {"min16uint4",glslang::EHTokMin16uint4}, + + {"bool1x1",glslang::EHTokBool1x1}, + {"bool1x2",glslang::EHTokBool1x2}, + {"bool1x3",glslang::EHTokBool1x3}, + {"bool1x4",glslang::EHTokBool1x4}, + {"bool2x1",glslang::EHTokBool2x1}, + {"bool2x2",glslang::EHTokBool2x2}, + {"bool2x3",glslang::EHTokBool2x3}, + {"bool2x4",glslang::EHTokBool2x4}, + {"bool3x1",glslang::EHTokBool3x1}, + {"bool3x2",glslang::EHTokBool3x2}, + {"bool3x3",glslang::EHTokBool3x3}, + {"bool3x4",glslang::EHTokBool3x4}, + {"bool4x1",glslang::EHTokBool4x1}, + {"bool4x2",glslang::EHTokBool4x2}, + {"bool4x3",glslang::EHTokBool4x3}, + {"bool4x4",glslang::EHTokBool4x4}, + {"int1x1",glslang::EHTokInt1x1}, + {"int1x2",glslang::EHTokInt1x2}, + {"int1x3",glslang::EHTokInt1x3}, + {"int1x4",glslang::EHTokInt1x4}, + {"int2x1",glslang::EHTokInt2x1}, + {"int2x2",glslang::EHTokInt2x2}, + {"int2x3",glslang::EHTokInt2x3}, + {"int2x4",glslang::EHTokInt2x4}, + {"int3x1",glslang::EHTokInt3x1}, + {"int3x2",glslang::EHTokInt3x2}, + {"int3x3",glslang::EHTokInt3x3}, + {"int3x4",glslang::EHTokInt3x4}, + {"int4x1",glslang::EHTokInt4x1}, + {"int4x2",glslang::EHTokInt4x2}, + {"int4x3",glslang::EHTokInt4x3}, + {"int4x4",glslang::EHTokInt4x4}, + {"uint1x1",glslang::EHTokUint1x1}, + {"uint1x2",glslang::EHTokUint1x2}, + {"uint1x3",glslang::EHTokUint1x3}, + {"uint1x4",glslang::EHTokUint1x4}, + {"uint2x1",glslang::EHTokUint2x1}, + {"uint2x2",glslang::EHTokUint2x2}, + {"uint2x3",glslang::EHTokUint2x3}, + {"uint2x4",glslang::EHTokUint2x4}, + {"uint3x1",glslang::EHTokUint3x1}, + {"uint3x2",glslang::EHTokUint3x2}, + {"uint3x3",glslang::EHTokUint3x3}, + {"uint3x4",glslang::EHTokUint3x4}, + {"uint4x1",glslang::EHTokUint4x1}, + {"uint4x2",glslang::EHTokUint4x2}, + {"uint4x3",glslang::EHTokUint4x3}, + {"uint4x4",glslang::EHTokUint4x4}, + {"bool1x1",glslang::EHTokBool1x1}, + {"bool1x2",glslang::EHTokBool1x2}, + {"bool1x3",glslang::EHTokBool1x3}, + {"bool1x4",glslang::EHTokBool1x4}, + {"bool2x1",glslang::EHTokBool2x1}, + {"bool2x2",glslang::EHTokBool2x2}, + {"bool2x3",glslang::EHTokBool2x3}, + {"bool2x4",glslang::EHTokBool2x4}, + {"bool3x1",glslang::EHTokBool3x1}, + {"bool3x2",glslang::EHTokBool3x2}, + {"bool3x3",glslang::EHTokBool3x3}, + {"bool3x4",glslang::EHTokBool3x4}, + {"bool4x1",glslang::EHTokBool4x1}, + {"bool4x2",glslang::EHTokBool4x2}, + {"bool4x3",glslang::EHTokBool4x3}, + {"bool4x4",glslang::EHTokBool4x4}, + {"float1x1",glslang::EHTokFloat1x1}, + {"float1x2",glslang::EHTokFloat1x2}, + {"float1x3",glslang::EHTokFloat1x3}, + {"float1x4",glslang::EHTokFloat1x4}, + {"float2x1",glslang::EHTokFloat2x1}, + {"float2x2",glslang::EHTokFloat2x2}, + {"float2x3",glslang::EHTokFloat2x3}, + {"float2x4",glslang::EHTokFloat2x4}, + {"float3x1",glslang::EHTokFloat3x1}, + {"float3x2",glslang::EHTokFloat3x2}, + {"float3x3",glslang::EHTokFloat3x3}, + {"float3x4",glslang::EHTokFloat3x4}, + {"float4x1",glslang::EHTokFloat4x1}, + {"float4x2",glslang::EHTokFloat4x2}, + {"float4x3",glslang::EHTokFloat4x3}, + {"float4x4",glslang::EHTokFloat4x4}, + {"half1x1",glslang::EHTokHalf1x1}, + {"half1x2",glslang::EHTokHalf1x2}, + {"half1x3",glslang::EHTokHalf1x3}, + {"half1x4",glslang::EHTokHalf1x4}, + {"half2x1",glslang::EHTokHalf2x1}, + {"half2x2",glslang::EHTokHalf2x2}, + {"half2x3",glslang::EHTokHalf2x3}, + {"half2x4",glslang::EHTokHalf2x4}, + {"half3x1",glslang::EHTokHalf3x1}, + {"half3x2",glslang::EHTokHalf3x2}, + {"half3x3",glslang::EHTokHalf3x3}, + {"half3x4",glslang::EHTokHalf3x4}, + {"half4x1",glslang::EHTokHalf4x1}, + {"half4x2",glslang::EHTokHalf4x2}, + {"half4x3",glslang::EHTokHalf4x3}, + {"half4x4",glslang::EHTokHalf4x4}, + {"double1x1",glslang::EHTokDouble1x1}, + {"double1x2",glslang::EHTokDouble1x2}, + {"double1x3",glslang::EHTokDouble1x3}, + {"double1x4",glslang::EHTokDouble1x4}, + {"double2x1",glslang::EHTokDouble2x1}, + {"double2x2",glslang::EHTokDouble2x2}, + {"double2x3",glslang::EHTokDouble2x3}, + {"double2x4",glslang::EHTokDouble2x4}, + {"double3x1",glslang::EHTokDouble3x1}, + {"double3x2",glslang::EHTokDouble3x2}, + {"double3x3",glslang::EHTokDouble3x3}, + {"double3x4",glslang::EHTokDouble3x4}, + {"double4x1",glslang::EHTokDouble4x1}, + {"double4x2",glslang::EHTokDouble4x2}, + {"double4x3",glslang::EHTokDouble4x3}, + {"double4x4",glslang::EHTokDouble4x4}, + {"min16float1x1",glslang::EHTokMin16float1x1}, + {"min16float1x2",glslang::EHTokMin16float1x2}, + {"min16float1x3",glslang::EHTokMin16float1x3}, + {"min16float1x4",glslang::EHTokMin16float1x4}, + {"min16float2x1",glslang::EHTokMin16float2x1}, + {"min16float2x2",glslang::EHTokMin16float2x2}, + {"min16float2x3",glslang::EHTokMin16float2x3}, + {"min16float2x4",glslang::EHTokMin16float2x4}, + {"min16float3x1",glslang::EHTokMin16float3x1}, + {"min16float3x2",glslang::EHTokMin16float3x2}, + {"min16float3x3",glslang::EHTokMin16float3x3}, + {"min16float3x4",glslang::EHTokMin16float3x4}, + {"min16float4x1",glslang::EHTokMin16float4x1}, + {"min16float4x2",glslang::EHTokMin16float4x2}, + {"min16float4x3",glslang::EHTokMin16float4x3}, + {"min16float4x4",glslang::EHTokMin16float4x4}, + {"min10float1x1",glslang::EHTokMin10float1x1}, + {"min10float1x2",glslang::EHTokMin10float1x2}, + {"min10float1x3",glslang::EHTokMin10float1x3}, + {"min10float1x4",glslang::EHTokMin10float1x4}, + {"min10float2x1",glslang::EHTokMin10float2x1}, + {"min10float2x2",glslang::EHTokMin10float2x2}, + {"min10float2x3",glslang::EHTokMin10float2x3}, + {"min10float2x4",glslang::EHTokMin10float2x4}, + {"min10float3x1",glslang::EHTokMin10float3x1}, + {"min10float3x2",glslang::EHTokMin10float3x2}, + {"min10float3x3",glslang::EHTokMin10float3x3}, + {"min10float3x4",glslang::EHTokMin10float3x4}, + {"min10float4x1",glslang::EHTokMin10float4x1}, + {"min10float4x2",glslang::EHTokMin10float4x2}, + {"min10float4x3",glslang::EHTokMin10float4x3}, + {"min10float4x4",glslang::EHTokMin10float4x4}, + {"min16int1x1",glslang::EHTokMin16int1x1}, + {"min16int1x2",glslang::EHTokMin16int1x2}, + {"min16int1x3",glslang::EHTokMin16int1x3}, + {"min16int1x4",glslang::EHTokMin16int1x4}, + {"min16int2x1",glslang::EHTokMin16int2x1}, + {"min16int2x2",glslang::EHTokMin16int2x2}, + {"min16int2x3",glslang::EHTokMin16int2x3}, + {"min16int2x4",glslang::EHTokMin16int2x4}, + {"min16int3x1",glslang::EHTokMin16int3x1}, + {"min16int3x2",glslang::EHTokMin16int3x2}, + {"min16int3x3",glslang::EHTokMin16int3x3}, + {"min16int3x4",glslang::EHTokMin16int3x4}, + {"min16int4x1",glslang::EHTokMin16int4x1}, + {"min16int4x2",glslang::EHTokMin16int4x2}, + {"min16int4x3",glslang::EHTokMin16int4x3}, + {"min16int4x4",glslang::EHTokMin16int4x4}, + {"min12int1x1",glslang::EHTokMin12int1x1}, + {"min12int1x2",glslang::EHTokMin12int1x2}, + {"min12int1x3",glslang::EHTokMin12int1x3}, + {"min12int1x4",glslang::EHTokMin12int1x4}, + {"min12int2x1",glslang::EHTokMin12int2x1}, + {"min12int2x2",glslang::EHTokMin12int2x2}, + {"min12int2x3",glslang::EHTokMin12int2x3}, + {"min12int2x4",glslang::EHTokMin12int2x4}, + {"min12int3x1",glslang::EHTokMin12int3x1}, + {"min12int3x2",glslang::EHTokMin12int3x2}, + {"min12int3x3",glslang::EHTokMin12int3x3}, + {"min12int3x4",glslang::EHTokMin12int3x4}, + {"min12int4x1",glslang::EHTokMin12int4x1}, + {"min12int4x2",glslang::EHTokMin12int4x2}, + {"min12int4x3",glslang::EHTokMin12int4x3}, + {"min12int4x4",glslang::EHTokMin12int4x4}, + {"min16uint1x1",glslang::EHTokMin16uint1x1}, + {"min16uint1x2",glslang::EHTokMin16uint1x2}, + {"min16uint1x3",glslang::EHTokMin16uint1x3}, + {"min16uint1x4",glslang::EHTokMin16uint1x4}, + {"min16uint2x1",glslang::EHTokMin16uint2x1}, + {"min16uint2x2",glslang::EHTokMin16uint2x2}, + {"min16uint2x3",glslang::EHTokMin16uint2x3}, + {"min16uint2x4",glslang::EHTokMin16uint2x4}, + {"min16uint3x1",glslang::EHTokMin16uint3x1}, + {"min16uint3x2",glslang::EHTokMin16uint3x2}, + {"min16uint3x3",glslang::EHTokMin16uint3x3}, + {"min16uint3x4",glslang::EHTokMin16uint3x4}, + {"min16uint4x1",glslang::EHTokMin16uint4x1}, + {"min16uint4x2",glslang::EHTokMin16uint4x2}, + {"min16uint4x3",glslang::EHTokMin16uint4x3}, + {"min16uint4x4",glslang::EHTokMin16uint4x4}, + + {"sampler",glslang::EHTokSampler}, + {"sampler1D",glslang::EHTokSampler1d}, + {"sampler2D",glslang::EHTokSampler2d}, + {"sampler3D",glslang::EHTokSampler3d}, + {"samplerCUBE",glslang::EHTokSamplerCube}, + {"sampler_state",glslang::EHTokSamplerState}, + {"SamplerState",glslang::EHTokSamplerState}, + {"SamplerComparisonState",glslang::EHTokSamplerComparisonState}, + {"texture",glslang::EHTokTexture}, + {"Texture1D",glslang::EHTokTexture1d}, + {"Texture1DArray",glslang::EHTokTexture1darray}, + {"Texture2D",glslang::EHTokTexture2d}, + {"Texture2DArray",glslang::EHTokTexture2darray}, + {"Texture3D",glslang::EHTokTexture3d}, + {"TextureCube",glslang::EHTokTextureCube}, + {"TextureCubeArray",glslang::EHTokTextureCubearray}, + {"Texture2DMS",glslang::EHTokTexture2DMS}, + {"Texture2DMSArray",glslang::EHTokTexture2DMSarray}, + {"RWTexture1D",glslang::EHTokRWTexture1d}, + {"RWTexture1DArray",glslang::EHTokRWTexture1darray}, + {"RWTexture2D",glslang::EHTokRWTexture2d}, + {"RWTexture2DArray",glslang::EHTokRWTexture2darray}, + {"RWTexture3D",glslang::EHTokRWTexture3d}, + {"RWBuffer",glslang::EHTokRWBuffer}, + {"SubpassInput",glslang::EHTokSubpassInput}, + {"SubpassInputMS",glslang::EHTokSubpassInputMS}, + + {"AppendStructuredBuffer",glslang::EHTokAppendStructuredBuffer}, + {"ByteAddressBuffer",glslang::EHTokByteAddressBuffer}, + {"ConsumeStructuredBuffer",glslang::EHTokConsumeStructuredBuffer}, + {"RWByteAddressBuffer",glslang::EHTokRWByteAddressBuffer}, + {"RWStructuredBuffer",glslang::EHTokRWStructuredBuffer}, + {"StructuredBuffer",glslang::EHTokStructuredBuffer}, + {"TextureBuffer",glslang::EHTokTextureBuffer}, + + {"class",glslang::EHTokClass}, + {"struct",glslang::EHTokStruct}, + {"cbuffer",glslang::EHTokCBuffer}, + {"ConstantBuffer",glslang::EHTokConstantBuffer}, + {"tbuffer",glslang::EHTokTBuffer}, + {"typedef",glslang::EHTokTypedef}, + {"this",glslang::EHTokThis}, + {"namespace",glslang::EHTokNamespace}, + + {"true",glslang::EHTokBoolConstant}, + {"false",glslang::EHTokBoolConstant}, + + {"for",glslang::EHTokFor}, + {"do",glslang::EHTokDo}, + {"while",glslang::EHTokWhile}, + {"break",glslang::EHTokBreak}, + {"continue",glslang::EHTokContinue}, + {"if",glslang::EHTokIf}, + {"else",glslang::EHTokElse}, + {"discard",glslang::EHTokDiscard}, + {"return",glslang::EHTokReturn}, + {"switch",glslang::EHTokSwitch}, + {"case",glslang::EHTokCase}, + {"default",glslang::EHTokDefault}, +}; + +const std::unordered_set ReservedSet { + "auto", + "catch", + "char", + "const_cast", + "enum", + "explicit", + "friend", + "goto", + "long", + "mutable", + "new", + "operator", + "private", + "protected", + "public", + "reinterpret_cast", + "short", + "signed", + "sizeof", + "static_cast", + "template", + "throw", + "try", + "typename", + "union", + "unsigned", + "using", + "virtual", +}; +std::unordered_map SemanticMap { + + // in DX9, all outputs had to have a semantic associated with them, that was either consumed + // by the system or was a specific register assignment + // in DX10+, only semantics with the SV_ prefix have any meaning beyond decoration + // Fxc will only accept DX9 style semantics in compat mode + // Also, in DX10 if a SV value is present as the input of a stage, but isn't appropriate for that + // stage, it would just be ignored as it is likely there as part of an output struct from one stage + // to the next +#if 0 + (*SemanticMap)["PSIZE"] = EbvPointSize; + (*SemanticMap)["FOG"] = EbvFogFragCoord; + (*SemanticMap)["DEPTH"] = EbvFragDepth; + (*SemanticMap)["VFACE"] = EbvFace; + (*SemanticMap)["VPOS"] = EbvFragCoord; +#endif + + {"SV_POSITION",glslang::EbvPosition}, + {"SV_VERTEXID",glslang::EbvVertexIndex}, + {"SV_VIEWPORTARRAYINDEX",glslang::EbvViewportIndex}, + {"SV_TESSFACTOR",glslang::EbvTessLevelOuter}, + {"SV_SAMPLEINDEX",glslang::EbvSampleId}, + {"SV_RENDERTARGETARRAYINDEX",glslang::EbvLayer}, + {"SV_PRIMITIVEID",glslang::EbvPrimitiveId}, + {"SV_OUTPUTCONTROLPOINTID",glslang::EbvInvocationId}, + {"SV_ISFRONTFACE",glslang::EbvFace}, + {"SV_VIEWID",glslang::EbvViewIndex}, + {"SV_INSTANCEID",glslang::EbvInstanceIndex}, + {"SV_INSIDETESSFACTOR",glslang::EbvTessLevelInner}, + {"SV_GSINSTANCEID",glslang::EbvInvocationId}, + {"SV_DISPATCHTHREADID",glslang::EbvGlobalInvocationId}, + {"SV_GROUPTHREADID",glslang::EbvLocalInvocationId}, + {"SV_GROUPINDEX",glslang::EbvLocalInvocationIndex}, + {"SV_GROUPID",glslang::EbvWorkGroupId}, + {"SV_DOMAINLOCATION",glslang::EbvTessCoord}, + {"SV_DEPTH",glslang::EbvFragDepth}, + {"SV_COVERAGE",glslang::EbvSampleMask}, + {"SV_DEPTHGREATEREQUAL",glslang::EbvFragDepthGreater}, + {"SV_DEPTHLESSEQUAL",glslang::EbvFragDepthLesser}, + {"SV_STENCILREF", glslang::EbvFragStencilRef}, +}; +} + +namespace glslang { + +// Wrapper for tokenizeClass() to get everything inside the token. +void HlslScanContext::tokenize(HlslToken& token) +{ + EHlslTokenClass tokenClass = tokenizeClass(token); + token.tokenClass = tokenClass; +} + +glslang::TBuiltInVariable HlslScanContext::mapSemantic(const char* upperCase) +{ + auto it = SemanticMap.find(upperCase); + if (it != SemanticMap.end()) + return it->second; + else + return glslang::EbvNone; +} + +// +// Fill in token information for the next token, except for the token class. +// Returns the enum value of the token class of the next token found. +// Return 0 (EndOfTokens) on end of input. +// +EHlslTokenClass HlslScanContext::tokenizeClass(HlslToken& token) +{ + do { + parserToken = &token; + TPpToken ppToken; + int token = ppContext.tokenize(ppToken); + if (token == EndOfInput) + return EHTokNone; + + tokenText = ppToken.name; + loc = ppToken.loc; + parserToken->loc = loc; + switch (token) { + case ';': return EHTokSemicolon; + case ',': return EHTokComma; + case ':': return EHTokColon; + case '=': return EHTokAssign; + case '(': return EHTokLeftParen; + case ')': return EHTokRightParen; + case '.': return EHTokDot; + case '!': return EHTokBang; + case '-': return EHTokDash; + case '~': return EHTokTilde; + case '+': return EHTokPlus; + case '*': return EHTokStar; + case '/': return EHTokSlash; + case '%': return EHTokPercent; + case '<': return EHTokLeftAngle; + case '>': return EHTokRightAngle; + case '|': return EHTokVerticalBar; + case '^': return EHTokCaret; + case '&': return EHTokAmpersand; + case '?': return EHTokQuestion; + case '[': return EHTokLeftBracket; + case ']': return EHTokRightBracket; + case '{': return EHTokLeftBrace; + case '}': return EHTokRightBrace; + case '\\': + parseContext.error(loc, "illegal use of escape character", "\\", ""); + break; + + case PPAtomAddAssign: return EHTokAddAssign; + case PPAtomSubAssign: return EHTokSubAssign; + case PPAtomMulAssign: return EHTokMulAssign; + case PPAtomDivAssign: return EHTokDivAssign; + case PPAtomModAssign: return EHTokModAssign; + + case PpAtomRight: return EHTokRightOp; + case PpAtomLeft: return EHTokLeftOp; + + case PpAtomRightAssign: return EHTokRightAssign; + case PpAtomLeftAssign: return EHTokLeftAssign; + case PpAtomAndAssign: return EHTokAndAssign; + case PpAtomOrAssign: return EHTokOrAssign; + case PpAtomXorAssign: return EHTokXorAssign; + + case PpAtomAnd: return EHTokAndOp; + case PpAtomOr: return EHTokOrOp; + case PpAtomXor: return EHTokXorOp; + + case PpAtomEQ: return EHTokEqOp; + case PpAtomGE: return EHTokGeOp; + case PpAtomNE: return EHTokNeOp; + case PpAtomLE: return EHTokLeOp; + + case PpAtomDecrement: return EHTokDecOp; + case PpAtomIncrement: return EHTokIncOp; + + case PpAtomColonColon: return EHTokColonColon; + + case PpAtomConstInt: parserToken->i = ppToken.ival; return EHTokIntConstant; + case PpAtomConstUint: parserToken->i = ppToken.ival; return EHTokUintConstant; + case PpAtomConstFloat16: parserToken->d = ppToken.dval; return EHTokFloat16Constant; + case PpAtomConstFloat: parserToken->d = ppToken.dval; return EHTokFloatConstant; + case PpAtomConstDouble: parserToken->d = ppToken.dval; return EHTokDoubleConstant; + case PpAtomIdentifier: + { + EHlslTokenClass token = tokenizeIdentifier(); + return token; + } + + case PpAtomConstString: { + parserToken->string = NewPoolTString(tokenText); + return EHTokStringConstant; + } + + case EndOfInput: return EHTokNone; + + default: + if (token < PpAtomMaxSingle) { + char buf[2]; + buf[0] = (char)token; + buf[1] = 0; + parseContext.error(loc, "unexpected token", buf, ""); + } else if (tokenText[0] != 0) + parseContext.error(loc, "unexpected token", tokenText, ""); + else + parseContext.error(loc, "unexpected token", "", ""); + break; + } + } while (true); +} + +EHlslTokenClass HlslScanContext::tokenizeIdentifier() +{ + if (ReservedSet.find(tokenText) != ReservedSet.end()) + return reservedWord(); + + auto it = KeywordMap.find(tokenText); + if (it == KeywordMap.end()) { + // Should have an identifier of some sort + return identifierOrType(); + } + keyword = it->second; + + switch (keyword) { + + // qualifiers + case EHTokStatic: + case EHTokConst: + case EHTokSNorm: + case EHTokUnorm: + case EHTokExtern: + case EHTokUniform: + case EHTokVolatile: + case EHTokShared: + case EHTokGroupShared: + case EHTokLinear: + case EHTokCentroid: + case EHTokNointerpolation: + case EHTokNoperspective: + case EHTokSample: + case EHTokRowMajor: + case EHTokColumnMajor: + case EHTokPackOffset: + case EHTokIn: + case EHTokOut: + case EHTokInOut: + case EHTokPrecise: + case EHTokLayout: + case EHTokGloballyCoherent: + case EHTokInline: + return keyword; + + // primitive types + case EHTokPoint: + case EHTokLine: + case EHTokTriangle: + case EHTokLineAdj: + case EHTokTriangleAdj: + return keyword; + + // stream out types + case EHTokPointStream: + case EHTokLineStream: + case EHTokTriangleStream: + return keyword; + + // Tessellation patches + case EHTokInputPatch: + case EHTokOutputPatch: + return keyword; + + case EHTokBuffer: + case EHTokVector: + case EHTokMatrix: + return keyword; + + // scalar types + case EHTokVoid: + case EHTokString: + case EHTokBool: + case EHTokInt: + case EHTokUint: + case EHTokUint64: + case EHTokDword: + case EHTokHalf: + case EHTokFloat: + case EHTokDouble: + case EHTokMin16float: + case EHTokMin10float: + case EHTokMin16int: + case EHTokMin12int: + case EHTokMin16uint: + + // vector types + case EHTokBool1: + case EHTokBool2: + case EHTokBool3: + case EHTokBool4: + case EHTokFloat1: + case EHTokFloat2: + case EHTokFloat3: + case EHTokFloat4: + case EHTokInt1: + case EHTokInt2: + case EHTokInt3: + case EHTokInt4: + case EHTokDouble1: + case EHTokDouble2: + case EHTokDouble3: + case EHTokDouble4: + case EHTokUint1: + case EHTokUint2: + case EHTokUint3: + case EHTokUint4: + case EHTokHalf1: + case EHTokHalf2: + case EHTokHalf3: + case EHTokHalf4: + case EHTokMin16float1: + case EHTokMin16float2: + case EHTokMin16float3: + case EHTokMin16float4: + case EHTokMin10float1: + case EHTokMin10float2: + case EHTokMin10float3: + case EHTokMin10float4: + case EHTokMin16int1: + case EHTokMin16int2: + case EHTokMin16int3: + case EHTokMin16int4: + case EHTokMin12int1: + case EHTokMin12int2: + case EHTokMin12int3: + case EHTokMin12int4: + case EHTokMin16uint1: + case EHTokMin16uint2: + case EHTokMin16uint3: + case EHTokMin16uint4: + + // matrix types + case EHTokBool1x1: + case EHTokBool1x2: + case EHTokBool1x3: + case EHTokBool1x4: + case EHTokBool2x1: + case EHTokBool2x2: + case EHTokBool2x3: + case EHTokBool2x4: + case EHTokBool3x1: + case EHTokBool3x2: + case EHTokBool3x3: + case EHTokBool3x4: + case EHTokBool4x1: + case EHTokBool4x2: + case EHTokBool4x3: + case EHTokBool4x4: + case EHTokInt1x1: + case EHTokInt1x2: + case EHTokInt1x3: + case EHTokInt1x4: + case EHTokInt2x1: + case EHTokInt2x2: + case EHTokInt2x3: + case EHTokInt2x4: + case EHTokInt3x1: + case EHTokInt3x2: + case EHTokInt3x3: + case EHTokInt3x4: + case EHTokInt4x1: + case EHTokInt4x2: + case EHTokInt4x3: + case EHTokInt4x4: + case EHTokUint1x1: + case EHTokUint1x2: + case EHTokUint1x3: + case EHTokUint1x4: + case EHTokUint2x1: + case EHTokUint2x2: + case EHTokUint2x3: + case EHTokUint2x4: + case EHTokUint3x1: + case EHTokUint3x2: + case EHTokUint3x3: + case EHTokUint3x4: + case EHTokUint4x1: + case EHTokUint4x2: + case EHTokUint4x3: + case EHTokUint4x4: + case EHTokFloat1x1: + case EHTokFloat1x2: + case EHTokFloat1x3: + case EHTokFloat1x4: + case EHTokFloat2x1: + case EHTokFloat2x2: + case EHTokFloat2x3: + case EHTokFloat2x4: + case EHTokFloat3x1: + case EHTokFloat3x2: + case EHTokFloat3x3: + case EHTokFloat3x4: + case EHTokFloat4x1: + case EHTokFloat4x2: + case EHTokFloat4x3: + case EHTokFloat4x4: + case EHTokHalf1x1: + case EHTokHalf1x2: + case EHTokHalf1x3: + case EHTokHalf1x4: + case EHTokHalf2x1: + case EHTokHalf2x2: + case EHTokHalf2x3: + case EHTokHalf2x4: + case EHTokHalf3x1: + case EHTokHalf3x2: + case EHTokHalf3x3: + case EHTokHalf3x4: + case EHTokHalf4x1: + case EHTokHalf4x2: + case EHTokHalf4x3: + case EHTokHalf4x4: + case EHTokDouble1x1: + case EHTokDouble1x2: + case EHTokDouble1x3: + case EHTokDouble1x4: + case EHTokDouble2x1: + case EHTokDouble2x2: + case EHTokDouble2x3: + case EHTokDouble2x4: + case EHTokDouble3x1: + case EHTokDouble3x2: + case EHTokDouble3x3: + case EHTokDouble3x4: + case EHTokDouble4x1: + case EHTokDouble4x2: + case EHTokDouble4x3: + case EHTokDouble4x4: + case EHTokMin16float1x1: + case EHTokMin16float1x2: + case EHTokMin16float1x3: + case EHTokMin16float1x4: + case EHTokMin16float2x1: + case EHTokMin16float2x2: + case EHTokMin16float2x3: + case EHTokMin16float2x4: + case EHTokMin16float3x1: + case EHTokMin16float3x2: + case EHTokMin16float3x3: + case EHTokMin16float3x4: + case EHTokMin16float4x1: + case EHTokMin16float4x2: + case EHTokMin16float4x3: + case EHTokMin16float4x4: + case EHTokMin10float1x1: + case EHTokMin10float1x2: + case EHTokMin10float1x3: + case EHTokMin10float1x4: + case EHTokMin10float2x1: + case EHTokMin10float2x2: + case EHTokMin10float2x3: + case EHTokMin10float2x4: + case EHTokMin10float3x1: + case EHTokMin10float3x2: + case EHTokMin10float3x3: + case EHTokMin10float3x4: + case EHTokMin10float4x1: + case EHTokMin10float4x2: + case EHTokMin10float4x3: + case EHTokMin10float4x4: + case EHTokMin16int1x1: + case EHTokMin16int1x2: + case EHTokMin16int1x3: + case EHTokMin16int1x4: + case EHTokMin16int2x1: + case EHTokMin16int2x2: + case EHTokMin16int2x3: + case EHTokMin16int2x4: + case EHTokMin16int3x1: + case EHTokMin16int3x2: + case EHTokMin16int3x3: + case EHTokMin16int3x4: + case EHTokMin16int4x1: + case EHTokMin16int4x2: + case EHTokMin16int4x3: + case EHTokMin16int4x4: + case EHTokMin12int1x1: + case EHTokMin12int1x2: + case EHTokMin12int1x3: + case EHTokMin12int1x4: + case EHTokMin12int2x1: + case EHTokMin12int2x2: + case EHTokMin12int2x3: + case EHTokMin12int2x4: + case EHTokMin12int3x1: + case EHTokMin12int3x2: + case EHTokMin12int3x3: + case EHTokMin12int3x4: + case EHTokMin12int4x1: + case EHTokMin12int4x2: + case EHTokMin12int4x3: + case EHTokMin12int4x4: + case EHTokMin16uint1x1: + case EHTokMin16uint1x2: + case EHTokMin16uint1x3: + case EHTokMin16uint1x4: + case EHTokMin16uint2x1: + case EHTokMin16uint2x2: + case EHTokMin16uint2x3: + case EHTokMin16uint2x4: + case EHTokMin16uint3x1: + case EHTokMin16uint3x2: + case EHTokMin16uint3x3: + case EHTokMin16uint3x4: + case EHTokMin16uint4x1: + case EHTokMin16uint4x2: + case EHTokMin16uint4x3: + case EHTokMin16uint4x4: + return keyword; + + // texturing types + case EHTokSampler: + case EHTokSampler1d: + case EHTokSampler2d: + case EHTokSampler3d: + case EHTokSamplerCube: + case EHTokSamplerState: + case EHTokSamplerComparisonState: + case EHTokTexture: + case EHTokTexture1d: + case EHTokTexture1darray: + case EHTokTexture2d: + case EHTokTexture2darray: + case EHTokTexture3d: + case EHTokTextureCube: + case EHTokTextureCubearray: + case EHTokTexture2DMS: + case EHTokTexture2DMSarray: + case EHTokRWTexture1d: + case EHTokRWTexture1darray: + case EHTokRWTexture2d: + case EHTokRWTexture2darray: + case EHTokRWTexture3d: + case EHTokRWBuffer: + case EHTokAppendStructuredBuffer: + case EHTokByteAddressBuffer: + case EHTokConsumeStructuredBuffer: + case EHTokRWByteAddressBuffer: + case EHTokRWStructuredBuffer: + case EHTokStructuredBuffer: + case EHTokTextureBuffer: + case EHTokSubpassInput: + case EHTokSubpassInputMS: + return keyword; + + // variable, user type, ... + case EHTokClass: + case EHTokStruct: + case EHTokTypedef: + case EHTokCBuffer: + case EHTokConstantBuffer: + case EHTokTBuffer: + case EHTokThis: + case EHTokNamespace: + return keyword; + + case EHTokBoolConstant: + if (strcmp("true", tokenText) == 0) + parserToken->b = true; + else + parserToken->b = false; + return keyword; + + // control flow + case EHTokFor: + case EHTokDo: + case EHTokWhile: + case EHTokBreak: + case EHTokContinue: + case EHTokIf: + case EHTokElse: + case EHTokDiscard: + case EHTokReturn: + case EHTokCase: + case EHTokSwitch: + case EHTokDefault: + return keyword; + + default: + parseContext.infoSink.info.message(EPrefixInternalError, "Unknown glslang keyword", loc); + return EHTokNone; + } +} + +EHlslTokenClass HlslScanContext::identifierOrType() +{ + parserToken->string = NewPoolTString(tokenText); + + return EHTokIdentifier; +} + +// Give an error for use of a reserved symbol. +// However, allow built-in declarations to use reserved words, to allow +// extension support before the extension is enabled. +EHlslTokenClass HlslScanContext::reservedWord() +{ + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.error(loc, "Reserved word.", tokenText, "", ""); + + return EHTokNone; +} + +} // end namespace glslang diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslScanContext.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslScanContext.h new file mode 100644 index 0000000000..3b191e489f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslScanContext.h @@ -0,0 +1,109 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// This holds context specific to the HLSL scanner, which +// sits between the preprocessor scanner and HLSL parser. +// + +#ifndef HLSLSCANCONTEXT_H_ +#define HLSLSCANCONTEXT_H_ + +#include "../MachineIndependent/ParseHelper.h" +#include "hlslTokens.h" + +namespace glslang { + +class TPpContext; +class TPpToken; + + +// +// Everything needed to fully describe a token. +// +struct HlslToken { + HlslToken() : string(nullptr) { loc.init(); } + TSourceLoc loc; // location of token in the source + EHlslTokenClass tokenClass; // what kind of token it is + union { // what data the token holds + glslang::TString *string; // for identifiers + int i; // for literals + unsigned int u; + bool b; + double d; + }; +}; + +// +// The state of scanning and translating raw tokens to slightly richer +// semantics, like knowing if an identifier is an existing symbol, or +// user-defined type. +// +class HlslScanContext { +public: + HlslScanContext(TParseContextBase& parseContext, TPpContext& ppContext) + : parseContext(parseContext), ppContext(ppContext) { } + virtual ~HlslScanContext() { } + + static void fillInKeywordMap(); + static void deleteKeywordMap(); + + void tokenize(HlslToken&); + glslang::TBuiltInVariable mapSemantic(const char*); + +protected: + HlslScanContext(HlslScanContext&); + HlslScanContext& operator=(HlslScanContext&); + + EHlslTokenClass tokenizeClass(HlslToken&); + EHlslTokenClass tokenizeIdentifier(); + EHlslTokenClass identifierOrType(); + EHlslTokenClass reservedWord(); + EHlslTokenClass identifierOrReserved(bool reserved); + EHlslTokenClass nonreservedKeyword(int version); + + TParseContextBase& parseContext; + TPpContext& ppContext; + TSourceLoc loc; + TPpToken* ppToken; + HlslToken* parserToken; + + const char* tokenText; + EHlslTokenClass keyword; +}; + +} // end namespace glslang + +#endif // HLSLSCANCONTEXT_H_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslTokenStream.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslTokenStream.cpp new file mode 100644 index 0000000000..5d9311cfd7 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslTokenStream.cpp @@ -0,0 +1,150 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "hlslTokenStream.h" + +namespace glslang { + +void HlslTokenStream::pushPreToken(const HlslToken& tok) +{ + assert(preTokenStackSize < tokenBufferSize); + preTokenStack[preTokenStackSize++] = tok; +} + +HlslToken HlslTokenStream::popPreToken() +{ + assert(preTokenStackSize > 0); + + return preTokenStack[--preTokenStackSize]; +} + +void HlslTokenStream::pushTokenBuffer(const HlslToken& tok) +{ + tokenBuffer[tokenBufferPos] = tok; + tokenBufferPos = (tokenBufferPos+1) % tokenBufferSize; +} + +HlslToken HlslTokenStream::popTokenBuffer() +{ + // Back up + tokenBufferPos = (tokenBufferPos+tokenBufferSize-1) % tokenBufferSize; + + return tokenBuffer[tokenBufferPos]; +} + +// +// Make a new source of tokens, not from the source, but from an +// already pre-processed token stream. +// +// This interrupts current token processing which must be restored +// later. Some simplifying assumptions are made (and asserted). +// +void HlslTokenStream::pushTokenStream(const TVector* tokens) +{ + // not yet setup to interrupt a stream that has been receded + // and not yet reconsumed + assert(preTokenStackSize == 0); + + // save current state + currentTokenStack.push_back(token); + + // set up new token stream + tokenStreamStack.push_back(tokens); + + // start position at first token: + token = (*tokens)[0]; + tokenPosition.push_back(0); +} + +// Undo pushTokenStream(), see above +void HlslTokenStream::popTokenStream() +{ + tokenStreamStack.pop_back(); + tokenPosition.pop_back(); + token = currentTokenStack.back(); + currentTokenStack.pop_back(); +} + +// Load 'token' with the next token in the stream of tokens. +void HlslTokenStream::advanceToken() +{ + pushTokenBuffer(token); + if (preTokenStackSize > 0) + token = popPreToken(); + else { + if (tokenStreamStack.size() == 0) + scanner.tokenize(token); + else { + ++tokenPosition.back(); + if (tokenPosition.back() >= (int)tokenStreamStack.back()->size()) + token.tokenClass = EHTokNone; + else + token = (*tokenStreamStack.back())[tokenPosition.back()]; + } + } +} + +void HlslTokenStream::recedeToken() +{ + pushPreToken(token); + token = popTokenBuffer(); +} + +// Return the current token class. +EHlslTokenClass HlslTokenStream::peek() const +{ + return token.tokenClass; +} + +// Return true, without advancing to the next token, if the current token is +// the expected (passed in) token class. +bool HlslTokenStream::peekTokenClass(EHlslTokenClass tokenClass) const +{ + return peek() == tokenClass; +} + +// Return true and advance to the next token if the current token is the +// expected (passed in) token class. +bool HlslTokenStream::acceptTokenClass(EHlslTokenClass tokenClass) +{ + if (peekTokenClass(tokenClass)) { + advanceToken(); + return true; + } + + return false; +} + +} // end namespace glslang diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslTokenStream.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslTokenStream.h new file mode 100644 index 0000000000..cb6c9e7234 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslTokenStream.h @@ -0,0 +1,96 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef HLSLTOKENSTREAM_H_ +#define HLSLTOKENSTREAM_H_ + +#include "hlslScanContext.h" + +namespace glslang { + + class HlslTokenStream { + public: + explicit HlslTokenStream(HlslScanContext& scanner) + : scanner(scanner), preTokenStackSize(0), tokenBufferPos(0) { } + virtual ~HlslTokenStream() { } + + public: + void advanceToken(); + void recedeToken(); + bool acceptTokenClass(EHlslTokenClass); + EHlslTokenClass peek() const; + bool peekTokenClass(EHlslTokenClass) const; + glslang::TBuiltInVariable mapSemantic(const char* upperCase) { return scanner.mapSemantic(upperCase); } + + void pushTokenStream(const TVector* tokens); + void popTokenStream(); + + protected: + HlslToken token; // the token we are currently looking at, but have not yet accepted + + private: + HlslTokenStream(); + HlslTokenStream& operator=(const HlslTokenStream&); + + HlslScanContext& scanner; // lexical scanner, to get next token from source file + TVector*> tokenStreamStack; // for getting the next token from an existing vector of tokens + TVector tokenPosition; + TVector currentTokenStack; + + // This is the number of tokens we can recedeToken() over. + static const int tokenBufferSize = 2; + + // Previously scanned tokens, returned for future advances, + // so logically in front of the token stream. + // Is logically a stack; needs last in last out semantics. + // Currently implemented as a stack of size 2. + HlslToken preTokenStack[tokenBufferSize]; + int preTokenStackSize; + void pushPreToken(const HlslToken&); + HlslToken popPreToken(); + + // Previously scanned tokens, not yet returned for future advances, + // but available for that. + // Is logically a fifo for normal advances, and a stack for recession. + // Currently implemented with an intrinsic size of 2. + HlslToken tokenBuffer[tokenBufferSize]; + int tokenBufferPos; + void pushTokenBuffer(const HlslToken&); + HlslToken popTokenBuffer(); + }; + +} // end namespace glslang + +#endif // HLSLTOKENSTREAM_H_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslTokens.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslTokens.h new file mode 100644 index 0000000000..a7c129907f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/hlslTokens.h @@ -0,0 +1,454 @@ +// +// Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef EHLSLTOKENS_H_ +#define EHLSLTOKENS_H_ + +namespace glslang { + +enum EHlslTokenClass { + EHTokNone = 0, + + // qualifiers + EHTokStatic, + EHTokConst, + EHTokSNorm, + EHTokUnorm, + EHTokExtern, + EHTokUniform, + EHTokVolatile, + EHTokPrecise, + EHTokShared, + EHTokGroupShared, + EHTokLinear, + EHTokCentroid, + EHTokNointerpolation, + EHTokNoperspective, + EHTokSample, + EHTokRowMajor, + EHTokColumnMajor, + EHTokPackOffset, + EHTokIn, + EHTokOut, + EHTokInOut, + EHTokLayout, + EHTokGloballyCoherent, + EHTokInline, + + // primitive types + EHTokPoint, + EHTokLine, + EHTokTriangle, + EHTokLineAdj, + EHTokTriangleAdj, + + // stream out types + EHTokPointStream, + EHTokLineStream, + EHTokTriangleStream, + + // Tessellation patches + EHTokInputPatch, + EHTokOutputPatch, + + // template types + EHTokBuffer, + EHTokVector, + EHTokMatrix, + + // scalar types + EHTokVoid, + EHTokString, + EHTokBool, + EHTokInt, + EHTokUint, + EHTokUint64, + EHTokDword, + EHTokHalf, + EHTokFloat, + EHTokDouble, + EHTokMin16float, + EHTokMin10float, + EHTokMin16int, + EHTokMin12int, + EHTokMin16uint, + + // vector types + EHTokBool1, + EHTokBool2, + EHTokBool3, + EHTokBool4, + EHTokFloat1, + EHTokFloat2, + EHTokFloat3, + EHTokFloat4, + EHTokInt1, + EHTokInt2, + EHTokInt3, + EHTokInt4, + EHTokDouble1, + EHTokDouble2, + EHTokDouble3, + EHTokDouble4, + EHTokUint1, + EHTokUint2, + EHTokUint3, + EHTokUint4, + EHTokHalf1, + EHTokHalf2, + EHTokHalf3, + EHTokHalf4, + EHTokMin16float1, + EHTokMin16float2, + EHTokMin16float3, + EHTokMin16float4, + EHTokMin10float1, + EHTokMin10float2, + EHTokMin10float3, + EHTokMin10float4, + EHTokMin16int1, + EHTokMin16int2, + EHTokMin16int3, + EHTokMin16int4, + EHTokMin12int1, + EHTokMin12int2, + EHTokMin12int3, + EHTokMin12int4, + EHTokMin16uint1, + EHTokMin16uint2, + EHTokMin16uint3, + EHTokMin16uint4, + + // matrix types + EHTokInt1x1, + EHTokInt1x2, + EHTokInt1x3, + EHTokInt1x4, + EHTokInt2x1, + EHTokInt2x2, + EHTokInt2x3, + EHTokInt2x4, + EHTokInt3x1, + EHTokInt3x2, + EHTokInt3x3, + EHTokInt3x4, + EHTokInt4x1, + EHTokInt4x2, + EHTokInt4x3, + EHTokInt4x4, + EHTokUint1x1, + EHTokUint1x2, + EHTokUint1x3, + EHTokUint1x4, + EHTokUint2x1, + EHTokUint2x2, + EHTokUint2x3, + EHTokUint2x4, + EHTokUint3x1, + EHTokUint3x2, + EHTokUint3x3, + EHTokUint3x4, + EHTokUint4x1, + EHTokUint4x2, + EHTokUint4x3, + EHTokUint4x4, + EHTokBool1x1, + EHTokBool1x2, + EHTokBool1x3, + EHTokBool1x4, + EHTokBool2x1, + EHTokBool2x2, + EHTokBool2x3, + EHTokBool2x4, + EHTokBool3x1, + EHTokBool3x2, + EHTokBool3x3, + EHTokBool3x4, + EHTokBool4x1, + EHTokBool4x2, + EHTokBool4x3, + EHTokBool4x4, + EHTokFloat1x1, + EHTokFloat1x2, + EHTokFloat1x3, + EHTokFloat1x4, + EHTokFloat2x1, + EHTokFloat2x2, + EHTokFloat2x3, + EHTokFloat2x4, + EHTokFloat3x1, + EHTokFloat3x2, + EHTokFloat3x3, + EHTokFloat3x4, + EHTokFloat4x1, + EHTokFloat4x2, + EHTokFloat4x3, + EHTokFloat4x4, + EHTokHalf1x1, + EHTokHalf1x2, + EHTokHalf1x3, + EHTokHalf1x4, + EHTokHalf2x1, + EHTokHalf2x2, + EHTokHalf2x3, + EHTokHalf2x4, + EHTokHalf3x1, + EHTokHalf3x2, + EHTokHalf3x3, + EHTokHalf3x4, + EHTokHalf4x1, + EHTokHalf4x2, + EHTokHalf4x3, + EHTokHalf4x4, + EHTokDouble1x1, + EHTokDouble1x2, + EHTokDouble1x3, + EHTokDouble1x4, + EHTokDouble2x1, + EHTokDouble2x2, + EHTokDouble2x3, + EHTokDouble2x4, + EHTokDouble3x1, + EHTokDouble3x2, + EHTokDouble3x3, + EHTokDouble3x4, + EHTokDouble4x1, + EHTokDouble4x2, + EHTokDouble4x3, + EHTokDouble4x4, + EHTokMin16float1x1, + EHTokMin16float1x2, + EHTokMin16float1x3, + EHTokMin16float1x4, + EHTokMin16float2x1, + EHTokMin16float2x2, + EHTokMin16float2x3, + EHTokMin16float2x4, + EHTokMin16float3x1, + EHTokMin16float3x2, + EHTokMin16float3x3, + EHTokMin16float3x4, + EHTokMin16float4x1, + EHTokMin16float4x2, + EHTokMin16float4x3, + EHTokMin16float4x4, + EHTokMin10float1x1, + EHTokMin10float1x2, + EHTokMin10float1x3, + EHTokMin10float1x4, + EHTokMin10float2x1, + EHTokMin10float2x2, + EHTokMin10float2x3, + EHTokMin10float2x4, + EHTokMin10float3x1, + EHTokMin10float3x2, + EHTokMin10float3x3, + EHTokMin10float3x4, + EHTokMin10float4x1, + EHTokMin10float4x2, + EHTokMin10float4x3, + EHTokMin10float4x4, + EHTokMin16int1x1, + EHTokMin16int1x2, + EHTokMin16int1x3, + EHTokMin16int1x4, + EHTokMin16int2x1, + EHTokMin16int2x2, + EHTokMin16int2x3, + EHTokMin16int2x4, + EHTokMin16int3x1, + EHTokMin16int3x2, + EHTokMin16int3x3, + EHTokMin16int3x4, + EHTokMin16int4x1, + EHTokMin16int4x2, + EHTokMin16int4x3, + EHTokMin16int4x4, + EHTokMin12int1x1, + EHTokMin12int1x2, + EHTokMin12int1x3, + EHTokMin12int1x4, + EHTokMin12int2x1, + EHTokMin12int2x2, + EHTokMin12int2x3, + EHTokMin12int2x4, + EHTokMin12int3x1, + EHTokMin12int3x2, + EHTokMin12int3x3, + EHTokMin12int3x4, + EHTokMin12int4x1, + EHTokMin12int4x2, + EHTokMin12int4x3, + EHTokMin12int4x4, + EHTokMin16uint1x1, + EHTokMin16uint1x2, + EHTokMin16uint1x3, + EHTokMin16uint1x4, + EHTokMin16uint2x1, + EHTokMin16uint2x2, + EHTokMin16uint2x3, + EHTokMin16uint2x4, + EHTokMin16uint3x1, + EHTokMin16uint3x2, + EHTokMin16uint3x3, + EHTokMin16uint3x4, + EHTokMin16uint4x1, + EHTokMin16uint4x2, + EHTokMin16uint4x3, + EHTokMin16uint4x4, + + // texturing types + EHTokSampler, + EHTokSampler1d, + EHTokSampler2d, + EHTokSampler3d, + EHTokSamplerCube, + EHTokSamplerState, + EHTokSamplerComparisonState, + EHTokTexture, + EHTokTexture1d, + EHTokTexture1darray, + EHTokTexture2d, + EHTokTexture2darray, + EHTokTexture3d, + EHTokTextureCube, + EHTokTextureCubearray, + EHTokTexture2DMS, + EHTokTexture2DMSarray, + EHTokRWTexture1d, + EHTokRWTexture1darray, + EHTokRWTexture2d, + EHTokRWTexture2darray, + EHTokRWTexture3d, + EHTokRWBuffer, + EHTokSubpassInput, + EHTokSubpassInputMS, + + // Structure buffer variants + EHTokAppendStructuredBuffer, + EHTokByteAddressBuffer, + EHTokConsumeStructuredBuffer, + EHTokRWByteAddressBuffer, + EHTokRWStructuredBuffer, + EHTokStructuredBuffer, + EHTokTextureBuffer, + + // variable, user type, ... + EHTokIdentifier, + EHTokClass, + EHTokStruct, + EHTokCBuffer, + EHTokTBuffer, + EHTokTypedef, + EHTokThis, + EHTokNamespace, + EHTokConstantBuffer, + + // constant + EHTokFloat16Constant, + EHTokFloatConstant, + EHTokDoubleConstant, + EHTokIntConstant, + EHTokUintConstant, + EHTokBoolConstant, + EHTokStringConstant, + + // control flow + EHTokFor, + EHTokDo, + EHTokWhile, + EHTokBreak, + EHTokContinue, + EHTokIf, + EHTokElse, + EHTokDiscard, + EHTokReturn, + EHTokSwitch, + EHTokCase, + EHTokDefault, + + // expressions + EHTokLeftOp, + EHTokRightOp, + EHTokIncOp, + EHTokDecOp, + EHTokLeOp, + EHTokGeOp, + EHTokEqOp, + EHTokNeOp, + EHTokAndOp, + EHTokOrOp, + EHTokXorOp, + EHTokAssign, + EHTokMulAssign, + EHTokDivAssign, + EHTokAddAssign, + EHTokModAssign, + EHTokLeftAssign, + EHTokRightAssign, + EHTokAndAssign, + EHTokXorAssign, + EHTokOrAssign, + EHTokSubAssign, + EHTokLeftParen, + EHTokRightParen, + EHTokLeftBracket, + EHTokRightBracket, + EHTokLeftBrace, + EHTokRightBrace, + EHTokDot, + EHTokComma, + EHTokColon, + EHTokColonColon, + EHTokSemicolon, + EHTokBang, + EHTokDash, + EHTokTilde, + EHTokPlus, + EHTokStar, + EHTokSlash, + EHTokPercent, + EHTokLeftAngle, + EHTokRightAngle, + EHTokVerticalBar, + EHTokCaret, + EHTokAmpersand, + EHTokQuestion, +}; + +} // end namespace glslang + +#endif // EHLSLTOKENS_H_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/pch.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/pch.h new file mode 100644 index 0000000000..f51efacc6d --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/HLSL/pch.h @@ -0,0 +1,51 @@ +#ifndef _PCH_H +#define _PCH_H +// +// Copyright (C) 2018 The Khronos Group Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "hlslAttributes.h" +#include "hlslGrammar.h" +#include "hlslParseHelper.h" +#include "hlslScanContext.h" + +#include "../MachineIndependent/Scan.h" +#include "../MachineIndependent/preprocessor/PpContext.h" + +#include +#include +#include +#include +#include + +#endif /* _PCH_H */ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/BaseTypes.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/BaseTypes.h new file mode 100644 index 0000000000..d50fc865bf --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/BaseTypes.h @@ -0,0 +1,684 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef _BASICTYPES_INCLUDED_ +#define _BASICTYPES_INCLUDED_ + +namespace QtShaderTools { +namespace glslang { + +// +// Basic type. Arrays, vectors, sampler details, etc., are orthogonal to this. +// +enum TBasicType { + EbtVoid, + EbtFloat, + EbtDouble, + EbtFloat16, + EbtBFloat16, + EbtFloatE5M2, + EbtFloatE4M3, + EbtInt8, + EbtUint8, + EbtInt16, + EbtUint16, + EbtInt, + EbtUint, + EbtInt64, + EbtUint64, + EbtBool, + EbtAtomicUint, + EbtSampler, + EbtStruct, + EbtBlock, + EbtAccStruct, + EbtReference, + EbtRayQuery, + EbtHitObjectNV, + EbtHitObjectEXT, + EbtCoopmat, + EbtFunction, + EbtTensorLayoutNV, + EbtTensorViewNV, + EbtCoopvecNV, + EbtTensorARM, + // SPIR-V type defined by spirv_type + EbtSpirvType, + + // HLSL types that live only temporarily. + EbtString, + + EbtNumTypes +}; + +// +// Storage qualifiers. Should align with different kinds of storage or +// resource or GLSL storage qualifier. Expansion is deprecated. +// +// N.B.: You probably DON'T want to add anything here, but rather just add it +// to the built-in variables. See the comment above TBuiltInVariable. +// +// A new built-in variable will normally be an existing qualifier, like 'in', 'out', etc. +// DO NOT follow the design pattern of, say EvqInstanceId, etc. +// +enum TStorageQualifier { + EvqTemporary, // For temporaries (within a function), read/write + EvqGlobal, // For globals read/write + EvqConst, // User-defined constant values, will be semantically constant and constant folded + EvqVaryingIn, // pipeline input, read only, also supercategory for all built-ins not included in this enum (see TBuiltInVariable) + EvqVaryingOut, // pipeline output, read/write, also supercategory for all built-ins not included in this enum (see TBuiltInVariable) + EvqUniform, // read only, shared with app + EvqBuffer, // read/write, shared with app + EvqShared, // compute shader's read/write 'shared' qualifier + EvqSpirvStorageClass, // spirv_storage_class + + EvqPayload, + EvqPayloadIn, + EvqHitAttr, + EvqCallableData, + EvqCallableDataIn, + EvqHitObjectAttrNV, + EvqHitObjectAttrEXT, + + EvqtaskPayloadSharedEXT, + + // parameters + EvqIn, // also, for 'in' in the grammar before we know if it's a pipeline input or an 'in' parameter + EvqOut, // also, for 'out' in the grammar before we know if it's a pipeline output or an 'out' parameter + EvqInOut, + EvqConstReadOnly, // input; also other read-only types having neither a constant value nor constant-value semantics + + // built-ins read by vertex shader + EvqVertexId, + EvqInstanceId, + + // built-ins written by vertex shader + EvqPosition, + EvqPointSize, + EvqClipVertex, + + // built-ins read by fragment shader + EvqFace, + EvqFragCoord, + EvqPointCoord, + + // built-ins written by fragment shader + EvqFragColor, + EvqFragDepth, + EvqFragStencil, + + EvqTileImageEXT, + + // end of list + EvqLast +}; + +// +// Subcategories of the TStorageQualifier, simply to give a direct mapping +// between built-in variable names and an numerical value (the enum). +// +// For backward compatibility, there is some redundancy between the +// TStorageQualifier and these. Existing members should both be maintained accurately. +// However, any new built-in variable (and any existing non-redundant one) +// must follow the pattern that the specific built-in is here, and only its +// general qualifier is in TStorageQualifier. +// +// Something like gl_Position, which is sometimes 'in' and sometimes 'out' +// shows up as two different built-in variables in a single stage, but +// only has a single enum in TBuiltInVariable, so both the +// TStorageQualifier and the TBuitinVariable are needed to distinguish +// between them. +// +enum TBuiltInVariable { + EbvNone, + EbvNumWorkGroups, + EbvWorkGroupSize, + EbvWorkGroupId, + EbvLocalInvocationId, + EbvGlobalInvocationId, + EbvLocalInvocationIndex, + EbvNumSubgroups, + EbvSubgroupID, + EbvSubGroupSize, + EbvSubGroupInvocation, + EbvSubGroupEqMask, + EbvSubGroupGeMask, + EbvSubGroupGtMask, + EbvSubGroupLeMask, + EbvSubGroupLtMask, + EbvSubgroupSize2, + EbvSubgroupInvocation2, + EbvSubgroupEqMask2, + EbvSubgroupGeMask2, + EbvSubgroupGtMask2, + EbvSubgroupLeMask2, + EbvSubgroupLtMask2, + EbvVertexId, + EbvInstanceId, + EbvVertexIndex, + EbvInstanceIndex, + EbvBaseVertex, + EbvBaseInstance, + EbvDrawId, + EbvPosition, + EbvPointSize, + EbvClipVertex, + EbvClipDistance, + EbvCullDistance, + EbvNormal, + EbvVertex, + EbvMultiTexCoord0, + EbvMultiTexCoord1, + EbvMultiTexCoord2, + EbvMultiTexCoord3, + EbvMultiTexCoord4, + EbvMultiTexCoord5, + EbvMultiTexCoord6, + EbvMultiTexCoord7, + EbvFrontColor, + EbvBackColor, + EbvFrontSecondaryColor, + EbvBackSecondaryColor, + EbvTexCoord, + EbvFogFragCoord, + EbvInvocationId, + EbvPrimitiveId, + EbvLayer, + EbvViewportIndex, + EbvPatchVertices, + EbvTessLevelOuter, + EbvTessLevelInner, + EbvBoundingBox, + EbvTessCoord, + EbvColor, + EbvSecondaryColor, + EbvFace, + EbvFragCoord, + EbvPointCoord, + EbvFragColor, + EbvFragData, + EbvFragDepth, + EbvFragStencilRef, + EbvSampleId, + EbvSamplePosition, + EbvSampleMask, + EbvHelperInvocation, + + EbvBaryCoordNoPersp, + EbvBaryCoordNoPerspCentroid, + EbvBaryCoordNoPerspSample, + EbvBaryCoordSmooth, + EbvBaryCoordSmoothCentroid, + EbvBaryCoordSmoothSample, + EbvBaryCoordPullModel, + + EbvViewIndex, + EbvDeviceIndex, + + EbvShadingRateKHR, + EbvPrimitiveShadingRateKHR, + + EbvFragSizeEXT, + EbvFragInvocationCountEXT, + + EbvSecondaryFragDataEXT, + EbvSecondaryFragColorEXT, + + EbvViewportMaskNV, + EbvSecondaryPositionNV, + EbvSecondaryViewportMaskNV, + EbvPositionPerViewNV, + EbvViewportMaskPerViewNV, + EbvFragFullyCoveredNV, + EbvFragmentSizeNV, + EbvInvocationsPerPixelNV, + // ray tracing + EbvLaunchId, + EbvLaunchSize, + EbvInstanceCustomIndex, + EbvGeometryIndex, + EbvWorldRayOrigin, + EbvWorldRayDirection, + EbvObjectRayOrigin, + EbvObjectRayDirection, + EbvRayTmin, + EbvRayTmax, + EbvCullMask, + EbvHitKind, + EbvObjectToWorld, + EbvObjectToWorld3x4, + EbvWorldToObject, + EbvWorldToObject3x4, + EbvIncomingRayFlags, + EbvCurrentRayTimeNV, + EbvClusterIDNV, + // barycentrics + EbvBaryCoordNV, + EbvBaryCoordNoPerspNV, + EbvBaryCoordEXT, + EbvBaryCoordNoPerspEXT, + // mesh shaders + EbvTaskCountNV, + EbvPrimitiveCountNV, + EbvPrimitiveIndicesNV, + EbvClipDistancePerViewNV, + EbvCullDistancePerViewNV, + EbvLayerPerViewNV, + EbvMeshViewCountNV, + EbvMeshViewIndicesNV, + + EbvMicroTrianglePositionNV, + EbvMicroTriangleBaryNV, + EbvHitKindFrontFacingMicroTriangleNV, + EbvHitKindBackFacingMicroTriangleNV, + + EbvHitIsSphereNV, + EbvHitIsLSSNV, + EbvHitSpherePositionNV, + EbvHitSphereRadiusNV, + EbvHitLSSPositionsNV, + EbvHitLSSRadiiNV, + + //GL_EXT_mesh_shader + EbvPrimitivePointIndicesEXT, + EbvPrimitiveLineIndicesEXT, + EbvPrimitiveTriangleIndicesEXT, + EbvCullPrimitiveEXT, + + // sm builtins + EbvWarpsPerSM, + EbvSMCount, + EbvWarpID, + EbvSMID, + + // HLSL built-ins that live only temporarily, until they get remapped + // to one of the above. + EbvFragDepthGreater, + EbvFragDepthLesser, + EbvGsOutputStream, + EbvOutputPatch, + EbvInputPatch, + + // structbuffer types + EbvAppendConsume, // no need to differentiate append and consume + EbvRWStructuredBuffer, + EbvStructuredBuffer, + EbvByteAddressBuffer, + EbvRWByteAddressBuffer, + + // ARM specific core builtins + EbvCoreCountARM, + EbvCoreIDARM, + EbvCoreMaxIDARM, + EbvWarpIDARM, + EbvWarpMaxIDARM, + + EbvPositionFetch, + + // SPV_QCOM_tile_shading + EbvTileOffsetQCOM, + EbvTileDimensionQCOM, + EbvTileApronSizeQCOM, + + EbvLast +}; + +// In this enum, order matters; users can assume higher precision is a bigger value +// and EpqNone is 0. +enum TPrecisionQualifier { + EpqNone = 0, + EpqLow, + EpqMedium, + EpqHigh +}; + +// These will show up in error messages +__inline const char* GetStorageQualifierString(TStorageQualifier q) +{ + switch (q) { + case EvqTemporary: return "temp"; break; + case EvqGlobal: return "global"; break; + case EvqConst: return "const"; break; + case EvqConstReadOnly: return "const (read only)"; break; + case EvqSpirvStorageClass: return "spirv_storage_class"; break; + case EvqVaryingIn: return "in"; break; + case EvqVaryingOut: return "out"; break; + case EvqUniform: return "uniform"; break; + case EvqBuffer: return "buffer"; break; + case EvqShared: return "shared"; break; + case EvqIn: return "in"; break; + case EvqOut: return "out"; break; + case EvqInOut: return "inout"; break; + case EvqVertexId: return "gl_VertexId"; break; + case EvqInstanceId: return "gl_InstanceId"; break; + case EvqPosition: return "gl_Position"; break; + case EvqPointSize: return "gl_PointSize"; break; + case EvqClipVertex: return "gl_ClipVertex"; break; + case EvqFace: return "gl_FrontFacing"; break; + case EvqFragCoord: return "gl_FragCoord"; break; + case EvqPointCoord: return "gl_PointCoord"; break; + case EvqFragColor: return "fragColor"; break; + case EvqFragDepth: return "gl_FragDepth"; break; + case EvqFragStencil: return "gl_FragStencilRefARB"; break; + case EvqPayload: return "rayPayloadNV"; break; + case EvqPayloadIn: return "rayPayloadInNV"; break; + case EvqHitAttr: return "hitAttributeNV"; break; + case EvqCallableData: return "callableDataNV"; break; + case EvqCallableDataIn: return "callableDataInNV"; break; + case EvqtaskPayloadSharedEXT: return "taskPayloadSharedEXT"; break; + case EvqHitObjectAttrNV: return "hitObjectAttributeNV"; break; + case EvqHitObjectAttrEXT:return "hitObjectAttributeEXT"; break; + default: return "unknown qualifier"; + } +} + +__inline const char* GetBuiltInVariableString(TBuiltInVariable v) +{ + switch (v) { + case EbvNone: return ""; + case EbvNumWorkGroups: return "NumWorkGroups"; + case EbvWorkGroupSize: return "WorkGroupSize"; + case EbvWorkGroupId: return "WorkGroupID"; + case EbvLocalInvocationId: return "LocalInvocationID"; + case EbvGlobalInvocationId: return "GlobalInvocationID"; + case EbvLocalInvocationIndex: return "LocalInvocationIndex"; + case EbvNumSubgroups: return "NumSubgroups"; + case EbvSubgroupID: return "SubgroupID"; + case EbvSubGroupSize: return "SubGroupSize"; + case EbvSubGroupInvocation: return "SubGroupInvocation"; + case EbvSubGroupEqMask: return "SubGroupEqMask"; + case EbvSubGroupGeMask: return "SubGroupGeMask"; + case EbvSubGroupGtMask: return "SubGroupGtMask"; + case EbvSubGroupLeMask: return "SubGroupLeMask"; + case EbvSubGroupLtMask: return "SubGroupLtMask"; + case EbvSubgroupSize2: return "SubgroupSize"; + case EbvSubgroupInvocation2: return "SubgroupInvocationID"; + case EbvSubgroupEqMask2: return "SubgroupEqMask"; + case EbvSubgroupGeMask2: return "SubgroupGeMask"; + case EbvSubgroupGtMask2: return "SubgroupGtMask"; + case EbvSubgroupLeMask2: return "SubgroupLeMask"; + case EbvSubgroupLtMask2: return "SubgroupLtMask"; + case EbvVertexId: return "VertexId"; + case EbvInstanceId: return "InstanceId"; + case EbvVertexIndex: return "VertexIndex"; + case EbvInstanceIndex: return "InstanceIndex"; + case EbvBaseVertex: return "BaseVertex"; + case EbvBaseInstance: return "BaseInstance"; + case EbvDrawId: return "DrawId"; + case EbvPosition: return "Position"; + case EbvPointSize: return "PointSize"; + case EbvClipVertex: return "ClipVertex"; + case EbvClipDistance: return "ClipDistance"; + case EbvCullDistance: return "CullDistance"; + case EbvNormal: return "Normal"; + case EbvVertex: return "Vertex"; + case EbvMultiTexCoord0: return "MultiTexCoord0"; + case EbvMultiTexCoord1: return "MultiTexCoord1"; + case EbvMultiTexCoord2: return "MultiTexCoord2"; + case EbvMultiTexCoord3: return "MultiTexCoord3"; + case EbvMultiTexCoord4: return "MultiTexCoord4"; + case EbvMultiTexCoord5: return "MultiTexCoord5"; + case EbvMultiTexCoord6: return "MultiTexCoord6"; + case EbvMultiTexCoord7: return "MultiTexCoord7"; + case EbvFrontColor: return "FrontColor"; + case EbvBackColor: return "BackColor"; + case EbvFrontSecondaryColor: return "FrontSecondaryColor"; + case EbvBackSecondaryColor: return "BackSecondaryColor"; + case EbvTexCoord: return "TexCoord"; + case EbvFogFragCoord: return "FogFragCoord"; + case EbvInvocationId: return "InvocationID"; + case EbvPrimitiveId: return "PrimitiveID"; + case EbvLayer: return "Layer"; + case EbvViewportIndex: return "ViewportIndex"; + case EbvPatchVertices: return "PatchVertices"; + case EbvTessLevelOuter: return "TessLevelOuter"; + case EbvTessLevelInner: return "TessLevelInner"; + case EbvBoundingBox: return "BoundingBox"; + case EbvTessCoord: return "TessCoord"; + case EbvColor: return "Color"; + case EbvSecondaryColor: return "SecondaryColor"; + case EbvFace: return "Face"; + case EbvFragCoord: return "FragCoord"; + case EbvPointCoord: return "PointCoord"; + case EbvFragColor: return "FragColor"; + case EbvFragData: return "FragData"; + case EbvFragDepth: return "FragDepth"; + case EbvFragStencilRef: return "FragStencilRef"; + case EbvSampleId: return "SampleId"; + case EbvSamplePosition: return "SamplePosition"; + case EbvSampleMask: return "SampleMaskIn"; + case EbvHelperInvocation: return "HelperInvocation"; + + case EbvBaryCoordNoPersp: return "BaryCoordNoPersp"; + case EbvBaryCoordNoPerspCentroid: return "BaryCoordNoPerspCentroid"; + case EbvBaryCoordNoPerspSample: return "BaryCoordNoPerspSample"; + case EbvBaryCoordSmooth: return "BaryCoordSmooth"; + case EbvBaryCoordSmoothCentroid: return "BaryCoordSmoothCentroid"; + case EbvBaryCoordSmoothSample: return "BaryCoordSmoothSample"; + case EbvBaryCoordPullModel: return "BaryCoordPullModel"; + + case EbvViewIndex: return "ViewIndex"; + case EbvDeviceIndex: return "DeviceIndex"; + + case EbvFragSizeEXT: return "FragSizeEXT"; + case EbvFragInvocationCountEXT: return "FragInvocationCountEXT"; + + case EbvSecondaryFragDataEXT: return "SecondaryFragDataEXT"; + case EbvSecondaryFragColorEXT: return "SecondaryFragColorEXT"; + + case EbvViewportMaskNV: return "ViewportMaskNV"; + case EbvSecondaryPositionNV: return "SecondaryPositionNV"; + case EbvSecondaryViewportMaskNV: return "SecondaryViewportMaskNV"; + case EbvPositionPerViewNV: return "PositionPerViewNV"; + case EbvViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; + case EbvFragFullyCoveredNV: return "FragFullyCoveredNV"; + case EbvFragmentSizeNV: return "FragmentSizeNV"; + case EbvInvocationsPerPixelNV: return "InvocationsPerPixelNV"; + case EbvLaunchId: return "LaunchIdNV"; + case EbvLaunchSize: return "LaunchSizeNV"; + case EbvInstanceCustomIndex: return "InstanceCustomIndexNV"; + case EbvGeometryIndex: return "GeometryIndexEXT"; + case EbvWorldRayOrigin: return "WorldRayOriginNV"; + case EbvWorldRayDirection: return "WorldRayDirectionNV"; + case EbvObjectRayOrigin: return "ObjectRayOriginNV"; + case EbvObjectRayDirection: return "ObjectRayDirectionNV"; + case EbvRayTmin: return "ObjectRayTminNV"; + case EbvRayTmax: return "ObjectRayTmaxNV"; + case EbvHitKind: return "HitKindNV"; + case EbvIncomingRayFlags: return "IncomingRayFlagsNV"; + case EbvObjectToWorld: return "ObjectToWorldNV"; + case EbvWorldToObject: return "WorldToObjectNV"; + case EbvCurrentRayTimeNV: return "CurrentRayTimeNV"; + case EbvClusterIDNV: return "ClusterIDNV"; + + case EbvBaryCoordEXT: + case EbvBaryCoordNV: return "BaryCoordKHR"; + case EbvBaryCoordNoPerspEXT: + case EbvBaryCoordNoPerspNV: return "BaryCoordNoPerspKHR"; + + case EbvTaskCountNV: return "TaskCountNV"; + case EbvPrimitiveCountNV: return "PrimitiveCountNV"; + case EbvPrimitiveIndicesNV: return "PrimitiveIndicesNV"; + case EbvClipDistancePerViewNV: return "ClipDistancePerViewNV"; + case EbvCullDistancePerViewNV: return "CullDistancePerViewNV"; + case EbvLayerPerViewNV: return "LayerPerViewNV"; + case EbvMeshViewCountNV: return "MeshViewCountNV"; + case EbvMeshViewIndicesNV: return "MeshViewIndicesNV"; + // GL_EXT_mesh_shader + case EbvPrimitivePointIndicesEXT: return "PrimitivePointIndicesEXT"; + case EbvPrimitiveLineIndicesEXT: return "PrimitiveLineIndicesEXT"; + case EbvPrimitiveTriangleIndicesEXT: return "PrimitiveTriangleIndicesEXT"; + case EbvCullPrimitiveEXT: return "CullPrimitiveEXT"; + + case EbvWarpsPerSM: return "WarpsPerSMNV"; + case EbvSMCount: return "SMCountNV"; + case EbvWarpID: return "WarpIDNV"; + case EbvSMID: return "SMIDNV"; + + case EbvShadingRateKHR: return "ShadingRateKHR"; + case EbvPrimitiveShadingRateKHR: return "PrimitiveShadingRateKHR"; + + case EbvHitKindFrontFacingMicroTriangleNV: return "HitKindFrontFacingMicroTriangleNV"; + case EbvHitKindBackFacingMicroTriangleNV: return "HitKindBackFacingMicroTriangleNV"; + + case EbvHitIsSphereNV: return "HitIsSphereNV"; + case EbvHitIsLSSNV: return "HitIsLSSNV"; + case EbvHitSpherePositionNV: return "HitSpherePositionNV"; + case EbvHitSphereRadiusNV: return "HitSphereRadiusNV"; + case EbvHitLSSPositionsNV: return "HitSpherePositionsNV"; + case EbvHitLSSRadiiNV: return "HitLSSRadiiNV"; + + default: return "unknown built-in variable"; + } +} + +__inline const char* GetPrecisionQualifierString(TPrecisionQualifier p) +{ + switch (p) { + case EpqNone: return ""; break; + case EpqLow: return "lowp"; break; + case EpqMedium: return "mediump"; break; + case EpqHigh: return "highp"; break; + default: return "unknown precision qualifier"; + } +} + +__inline bool isTypeSignedInt(TBasicType type) +{ + switch (type) { + case EbtInt8: + case EbtInt16: + case EbtInt: + case EbtInt64: + return true; + default: + return false; + } +} + +__inline bool isTypeUnsignedInt(TBasicType type) +{ + switch (type) { + case EbtUint8: + case EbtUint16: + case EbtUint: + case EbtUint64: + return true; + default: + return false; + } +} + +__inline bool isTypeInt(TBasicType type) +{ + return isTypeSignedInt(type) || isTypeUnsignedInt(type); +} + +__inline bool isTypeFloat(TBasicType type) +{ + switch (type) { + case EbtFloat: + case EbtDouble: + case EbtFloat16: + case EbtBFloat16: + case EbtFloatE5M2: + case EbtFloatE4M3: + return true; + default: + return false; + } +} + +__inline uint32_t GetNumBits(TBasicType type) +{ + switch (type) { + case EbtInt8: + case EbtUint8: + case EbtFloatE5M2: + case EbtFloatE4M3: + return 8; + case EbtBFloat16: + case EbtFloat16: + case EbtInt16: + case EbtUint16: + return 16; + case EbtInt: + case EbtUint: + case EbtFloat: + return 32; + case EbtDouble: + case EbtInt64: + case EbtUint64: + return 64; + default: + assert(false); + return 0; + } +} + +__inline int getTypeRank(TBasicType type) +{ + int res = -1; + switch(type) { + case EbtInt8: + case EbtUint8: + res = 0; + break; + case EbtInt16: + case EbtUint16: + res = 1; + break; + case EbtInt: + case EbtUint: + res = 2; + break; + case EbtInt64: + case EbtUint64: + res = 3; + break; + default: + assert(false); + break; + } + return res; +} + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // _BASICTYPES_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/Common.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/Common.h new file mode 100644 index 0000000000..cc2934f67b --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/Common.h @@ -0,0 +1,311 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef _COMMON_INCLUDED_ +#define _COMMON_INCLUDED_ + +#include +#include +#ifdef _MSC_VER +#include +#else +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(__ANDROID__) +#include +namespace std { +template +std::string to_string(const T& val) { + std::ostringstream os; + os << val; + return os.str(); +} +} +#endif + +#if defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API + #include + #ifndef snprintf + #define snprintf sprintf_s + #endif + #define safe_vsprintf(buf,max,format,args) vsnprintf_s((buf), (max), (max), (format), (args)) +#elif defined (solaris) + #define safe_vsprintf(buf,max,format,args) vsnprintf((buf), (max), (format), (args)) + #include + #define UINT_PTR uintptr_t +#else + #define safe_vsprintf(buf,max,format,args) vsnprintf((buf), (max), (format), (args)) + #include + #define UINT_PTR uintptr_t +#endif + +#if defined(_MSC_VER) +#define strdup _strdup +#endif + +/* windows only pragma */ +#ifdef _MSC_VER + #pragma warning(disable : 4786) // Don't warn about too long identifiers + #pragma warning(disable : 4514) // unused inline method + #pragma warning(disable : 4201) // nameless union +#endif + +// Allow compilation to WASI which does not support threads yet. +#ifdef __wasi__ +#define DISABLE_THREAD_SUPPORT +#endif + +#include "PoolAlloc.h" + +// +// Put POOL_ALLOCATOR_NEW_DELETE in base classes to make them use this scheme. +// +#define POOL_ALLOCATOR_NEW_DELETE(A) \ + void* operator new(size_t s) { return (A).allocate(s); } \ + void* operator new(size_t, void *_Where) { return (_Where); } \ + void operator delete(void*) { } \ + void operator delete(void *, void *) { } \ + void* operator new[](size_t s) { return (A).allocate(s); } \ + void* operator new[](size_t, void *_Where) { return (_Where); } \ + void operator delete[](void*) { } \ + void operator delete[](void *, void *) { } + +namespace QtShaderTools { +namespace glslang { + + // + // Pool version of string. + // + typedef pool_allocator TStringAllocator; + typedef std::basic_string , TStringAllocator> TString; + +} // end namespace glslang +} // namespace QtShaderTools + +// Repackage the std::hash for use by unordered map/set with a TString key. +namespace std { + + template<> struct hash { + std::size_t operator()(const QtShaderTools::glslang::TString& s) const + { + const unsigned _FNV_offset_basis = 2166136261U; + const unsigned _FNV_prime = 16777619U; + unsigned _Val = _FNV_offset_basis; + size_t _Count = s.size(); + const char* _First = s.c_str(); + for (size_t _Next = 0; _Next < _Count; ++_Next) + { + _Val ^= (unsigned)_First[_Next]; + _Val *= _FNV_prime; + } + + return _Val; + } + }; +} + +namespace QtShaderTools { +namespace glslang { + +inline TString* NewPoolTString(const char* s) +{ + void* memory = GetThreadPoolAllocator().allocate(sizeof(TString)); + return new(memory) TString(s); +} + +template inline T* NewPoolObject(T*) +{ + return new(GetThreadPoolAllocator().allocate(sizeof(T))) T; +} + +template inline T* NewPoolObject(T, int instances) +{ + return new(GetThreadPoolAllocator().allocate(instances * sizeof(T))) T[instances]; +} + +inline bool StartsWith(TString const &str, const char *prefix) +{ + return str.compare(0, strlen(prefix), prefix) == 0; +} + +// +// Pool allocator versions of vectors, lists, and maps +// +template class TVector : public std::vector > { +public: + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + + typedef typename std::vector >::size_type size_type; + TVector() : std::vector >() {} + TVector(const pool_allocator& a) : std::vector >(a) {} + TVector(size_type i) : std::vector >(i) {} + TVector(size_type i, const T& val) : std::vector >(i, val) {} +}; + +template class TList : public std::list > { +}; + +template > +class TMap : public std::map > > { +}; + +template , class PRED = std::equal_to > +class TUnorderedMap : public std::unordered_map > > { +}; + +template > +class TSet : public std::set > { +}; + +// +// Persistent string memory. Should only be used for strings that survive +// across compiles/links. +// +typedef std::basic_string TPersistString; + +// +// templatized min and max functions. +// +template T Min(const T a, const T b) { return a < b ? a : b; } +template T Max(const T a, const T b) { return a > b ? a : b; } + +// +// Create a TString object from an integer. +// +#if defined(_MSC_VER) || (defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API) +inline const TString String(const int i, const int base = 10) +{ + char text[16]; // 32 bit ints are at most 10 digits in base 10 + _itoa_s(i, text, sizeof(text), base); + return text; +} +#else +inline const TString String(const int i, const int /*base*/ = 10) +{ + char text[16]; // 32 bit ints are at most 10 digits in base 10 + + // we assume base 10 for all cases + snprintf(text, sizeof(text), "%d", i); + + return text; +} +#endif + +struct TSourceLoc { + void init() + { + name = nullptr; string = 0; line = 0; column = 0; + } + void init(int stringNum) { init(); string = stringNum; } + // Returns the name if it exists. Otherwise, returns the string number. + std::string getStringNameOrNum(bool quoteStringName = true) const + { + if (name != nullptr) { + TString qstr = quoteStringName ? ("\"" + *name + "\"") : *name; + std::string ret_str(qstr.c_str()); + return ret_str; + } + return std::to_string((long long)string); + } + const char* getFilename() const + { + if (name == nullptr) + return nullptr; + return name->c_str(); + } + const char* getFilenameStr() const { return name == nullptr ? "" : name->c_str(); } + TString* name; // descriptive name for this string, when a textual name is available, otherwise nullptr + int string; + int line; + int column; +}; + +class TPragmaTable : public TMap { +public: + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) +}; + +const int MaxTokenLength = 1024; + +template bool IsPow2(T powerOf2) +{ + if (powerOf2 <= 0) + return false; + + return (powerOf2 & (powerOf2 - 1)) == 0; +} + +// Round number up to a multiple of the given powerOf2, which is not +// a power, just a number that must be a power of 2. +template void RoundToPow2(T& number, int powerOf2) +{ + assert(IsPow2(powerOf2)); + number = (number + powerOf2 - 1) & ~(powerOf2 - 1); +} + +template bool IsMultipleOfPow2(T number, int powerOf2) +{ + assert(IsPow2(powerOf2)); + return ! (number & (powerOf2 - 1)); +} + +// Returns log2 of an integer power of 2. +// T should be integral. +template int IntLog2(T n) +{ + assert(IsPow2(n)); + int result = 0; + while ((T(1) << result) != n) { + result++; + } + return result; +} + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // _COMMON_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/ConstantUnion.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/ConstantUnion.h new file mode 100644 index 0000000000..bfaa4787cb --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/ConstantUnion.h @@ -0,0 +1,951 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef _CONSTANT_UNION_INCLUDED_ +#define _CONSTANT_UNION_INCLUDED_ + +#include "../Include/Common.h" +#include "../Include/BaseTypes.h" + +namespace QtShaderTools { +namespace glslang { + +class TConstUnion { +public: + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + + TConstUnion() : iConst(0), type(EbtInt) { } + + void setI8Const(signed char i) + { + i8Const = i; + type = EbtInt8; + } + + void setU8Const(unsigned char u) + { + u8Const = u; + type = EbtUint8; + } + + void setI16Const(signed short i) + { + i16Const = i; + type = EbtInt16; + } + + void setU16Const(unsigned short u) + { + u16Const = u; + type = EbtUint16; + } + + void setIConst(int i) + { + iConst = i; + type = EbtInt; + } + + void setUConst(unsigned int u) + { + uConst = u; + type = EbtUint; + } + + void setI64Const(long long i64) + { + i64Const = i64; + type = EbtInt64; + } + + void setU64Const(unsigned long long u64) + { + u64Const = u64; + type = EbtUint64; + } + + void setDConst(double d) + { + dConst = d; + type = EbtDouble; + } + + void setBConst(bool b) + { + bConst = b; + type = EbtBool; + } + + void setSConst(const TString* s) + { + sConst = s; + type = EbtString; + } + + signed char getI8Const() const { return i8Const; } + unsigned char getU8Const() const { return u8Const; } + signed short getI16Const() const { return i16Const; } + unsigned short getU16Const() const { return u16Const; } + int getIConst() const { return iConst; } + unsigned int getUConst() const { return uConst; } + long long getI64Const() const { return i64Const; } + unsigned long long getU64Const() const { return u64Const; } + double getDConst() const { return dConst; } + bool getBConst() const { return bConst; } + const TString* getSConst() const { return sConst; } + + bool operator==(const signed char i) const + { + if (i == i8Const) + return true; + + return false; + } + + bool operator==(const unsigned char u) const + { + if (u == u8Const) + return true; + + return false; + } + + bool operator==(const signed short i) const + { + if (i == i16Const) + return true; + + return false; + } + + bool operator==(const unsigned short u) const + { + if (u == u16Const) + return true; + + return false; + } + + bool operator==(const int i) const + { + if (i == iConst) + return true; + + return false; + } + + bool operator==(const unsigned int u) const + { + if (u == uConst) + return true; + + return false; + } + + bool operator==(const long long i64) const + { + if (i64 == i64Const) + return true; + + return false; + } + + bool operator==(const unsigned long long u64) const + { + if (u64 == u64Const) + return true; + + return false; + } + + bool operator==(const double d) const + { + if (d == dConst) + return true; + + return false; + } + + bool operator==(const bool b) const + { + if (b == bConst) + return true; + + return false; + } + + bool operator==(const TConstUnion& constant) const + { + if (constant.type != type) + return false; + + switch (type) { + case EbtInt: + if (constant.iConst == iConst) + return true; + + break; + case EbtUint: + if (constant.uConst == uConst) + return true; + + break; + case EbtBool: + if (constant.bConst == bConst) + return true; + + break; + case EbtDouble: + if (constant.dConst == dConst) + return true; + + break; + + case EbtInt16: + if (constant.i16Const == i16Const) + return true; + + break; + case EbtUint16: + if (constant.u16Const == u16Const) + return true; + + break; + case EbtInt8: + if (constant.i8Const == i8Const) + return true; + + break; + case EbtUint8: + if (constant.u8Const == u8Const) + return true; + + break; + case EbtInt64: + if (constant.i64Const == i64Const) + return true; + + break; + case EbtUint64: + if (constant.u64Const == u64Const) + return true; + + break; + default: + assert(false && "Default missing"); + } + + return false; + } + + bool operator!=(const signed char i) const + { + return !operator==(i); + } + + bool operator!=(const unsigned char u) const + { + return !operator==(u); + } + + bool operator!=(const signed short i) const + { + return !operator==(i); + } + + bool operator!=(const unsigned short u) const + { + return !operator==(u); + } + + bool operator!=(const int i) const + { + return !operator==(i); + } + + bool operator!=(const unsigned int u) const + { + return !operator==(u); + } + + bool operator!=(const long long i) const + { + return !operator==(i); + } + + bool operator!=(const unsigned long long u) const + { + return !operator==(u); + } + + bool operator!=(const float f) const + { + return !operator==(f); + } + + bool operator!=(const bool b) const + { + return !operator==(b); + } + + bool operator!=(const TConstUnion& constant) const + { + return !operator==(constant); + } + + bool operator>(const TConstUnion& constant) const + { + assert(type == constant.type); + switch (type) { + case EbtInt: + if (iConst > constant.iConst) + return true; + + return false; + case EbtUint: + if (uConst > constant.uConst) + return true; + + return false; + case EbtDouble: + if (dConst > constant.dConst) + return true; + + return false; + case EbtInt8: + if (i8Const > constant.i8Const) + return true; + + return false; + case EbtUint8: + if (u8Const > constant.u8Const) + return true; + + return false; + case EbtInt16: + if (i16Const > constant.i16Const) + return true; + + return false; + case EbtUint16: + if (u16Const > constant.u16Const) + return true; + + return false; + case EbtInt64: + if (i64Const > constant.i64Const) + return true; + + return false; + case EbtUint64: + if (u64Const > constant.u64Const) + return true; + + return false; + default: + assert(false && "Default missing"); + return false; + } + } + + bool operator<(const TConstUnion& constant) const + { + assert(type == constant.type); + switch (type) { + case EbtInt8: + if (i8Const < constant.i8Const) + return true; + + return false; + case EbtUint8: + if (u8Const < constant.u8Const) + return true; + + return false; + case EbtInt16: + if (i16Const < constant.i16Const) + return true; + + return false; + case EbtUint16: + if (u16Const < constant.u16Const) + return true; + return false; + case EbtInt64: + if (i64Const < constant.i64Const) + return true; + + return false; + case EbtUint64: + if (u64Const < constant.u64Const) + return true; + + return false; + case EbtDouble: + if (dConst < constant.dConst) + return true; + + return false; + case EbtInt: + if (iConst < constant.iConst) + return true; + + return false; + case EbtUint: + if (uConst < constant.uConst) + return true; + + return false; + default: + assert(false && "Default missing"); + return false; + } + } + + TConstUnion operator+(const TConstUnion& constant) const + { + TConstUnion returnValue; + assert(type == constant.type); + switch (type) { + case EbtInt: returnValue.setIConst(iConst + constant.iConst); break; + case EbtUint: returnValue.setUConst(uConst + constant.uConst); break; + case EbtDouble: returnValue.setDConst(dConst + constant.dConst); break; + case EbtInt8: returnValue.setI8Const(i8Const + constant.i8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const + constant.i16Const); break; + case EbtInt64: returnValue.setI64Const(i64Const + constant.i64Const); break; + case EbtUint8: returnValue.setU8Const(u8Const + constant.u8Const); break; + case EbtUint16: returnValue.setU16Const(u16Const + constant.u16Const); break; + case EbtUint64: returnValue.setU64Const(u64Const + constant.u64Const); break; + default: assert(false && "Default missing"); + } + + return returnValue; + } + + TConstUnion operator-(const TConstUnion& constant) const + { + TConstUnion returnValue; + assert(type == constant.type); + switch (type) { + case EbtInt: returnValue.setIConst(iConst - constant.iConst); break; + case EbtUint: returnValue.setUConst(uConst - constant.uConst); break; + case EbtDouble: returnValue.setDConst(dConst - constant.dConst); break; + case EbtInt8: returnValue.setI8Const(i8Const - constant.i8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const - constant.i16Const); break; + case EbtInt64: returnValue.setI64Const(i64Const - constant.i64Const); break; + case EbtUint8: returnValue.setU8Const(u8Const - constant.u8Const); break; + case EbtUint16: returnValue.setU16Const(u16Const - constant.u16Const); break; + case EbtUint64: returnValue.setU64Const(u64Const - constant.u64Const); break; + default: assert(false && "Default missing"); + } + + return returnValue; + } + + TConstUnion operator*(const TConstUnion& constant) const + { + TConstUnion returnValue; + assert(type == constant.type); + switch (type) { + case EbtInt: returnValue.setIConst(iConst * constant.iConst); break; + case EbtUint: returnValue.setUConst(uConst * constant.uConst); break; + case EbtDouble: returnValue.setDConst(dConst * constant.dConst); break; + case EbtInt8: returnValue.setI8Const(i8Const * constant.i8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const * constant.i16Const); break; + case EbtInt64: returnValue.setI64Const(i64Const * constant.i64Const); break; + case EbtUint8: returnValue.setU8Const(u8Const * constant.u8Const); break; + case EbtUint16: returnValue.setU16Const(u16Const * constant.u16Const); break; + case EbtUint64: returnValue.setU64Const(u64Const * constant.u64Const); break; + default: assert(false && "Default missing"); + } + + return returnValue; + } + + TConstUnion operator%(const TConstUnion& constant) const + { + TConstUnion returnValue; + assert(type == constant.type); + switch (type) { + case EbtInt: returnValue.setIConst(iConst % constant.iConst); break; + case EbtUint: returnValue.setUConst(uConst % constant.uConst); break; + case EbtInt8: returnValue.setI8Const(i8Const % constant.i8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const % constant.i16Const); break; + case EbtInt64: returnValue.setI64Const(i64Const % constant.i64Const); break; + case EbtUint8: returnValue.setU8Const(u8Const % constant.u8Const); break; + case EbtUint16: returnValue.setU16Const(u16Const % constant.u16Const); break; + case EbtUint64: returnValue.setU64Const(u64Const % constant.u64Const); break; + default: assert(false && "Default missing"); + } + + return returnValue; + } + + TConstUnion operator>>(const TConstUnion& constant) const + { + TConstUnion returnValue; + switch (type) { + case EbtInt8: + switch (constant.type) { + case EbtInt8: returnValue.setI8Const(i8Const >> constant.i8Const); break; + case EbtUint8: returnValue.setI8Const(i8Const >> constant.u8Const); break; + case EbtInt16: returnValue.setI8Const(i8Const >> constant.i16Const); break; + case EbtUint16: returnValue.setI8Const(i8Const >> constant.u16Const); break; + case EbtInt: returnValue.setI8Const(i8Const >> constant.iConst); break; + case EbtUint: returnValue.setI8Const(i8Const >> constant.uConst); break; + case EbtInt64: returnValue.setI8Const(i8Const >> constant.i64Const); break; + case EbtUint64: returnValue.setI8Const(i8Const >> constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtUint8: + switch (constant.type) { + case EbtInt8: returnValue.setU8Const(u8Const >> constant.i8Const); break; + case EbtUint8: returnValue.setU8Const(u8Const >> constant.u8Const); break; + case EbtInt16: returnValue.setU8Const(u8Const >> constant.i16Const); break; + case EbtUint16: returnValue.setU8Const(u8Const >> constant.u16Const); break; + case EbtInt: returnValue.setU8Const(u8Const >> constant.iConst); break; + case EbtUint: returnValue.setU8Const(u8Const >> constant.uConst); break; + case EbtInt64: returnValue.setU8Const(u8Const >> constant.i64Const); break; + case EbtUint64: returnValue.setU8Const(u8Const >> constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtInt16: + switch (constant.type) { + case EbtInt8: returnValue.setI16Const(i16Const >> constant.i8Const); break; + case EbtUint8: returnValue.setI16Const(i16Const >> constant.u8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const >> constant.i16Const); break; + case EbtUint16: returnValue.setI16Const(i16Const >> constant.u16Const); break; + case EbtInt: returnValue.setI16Const(i16Const >> constant.iConst); break; + case EbtUint: returnValue.setI16Const(i16Const >> constant.uConst); break; + case EbtInt64: returnValue.setI16Const(i16Const >> constant.i64Const); break; + case EbtUint64: returnValue.setI16Const(i16Const >> constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtUint16: + switch (constant.type) { + case EbtInt8: returnValue.setU16Const(u16Const >> constant.i8Const); break; + case EbtUint8: returnValue.setU16Const(u16Const >> constant.u8Const); break; + case EbtInt16: returnValue.setU16Const(u16Const >> constant.i16Const); break; + case EbtUint16: returnValue.setU16Const(u16Const >> constant.u16Const); break; + case EbtInt: returnValue.setU16Const(u16Const >> constant.iConst); break; + case EbtUint: returnValue.setU16Const(u16Const >> constant.uConst); break; + case EbtInt64: returnValue.setU16Const(u16Const >> constant.i64Const); break; + case EbtUint64: returnValue.setU16Const(u16Const >> constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtInt: + switch (constant.type) { + case EbtInt: returnValue.setIConst(iConst >> constant.iConst); break; + case EbtUint: returnValue.setIConst(iConst >> constant.uConst); break; + case EbtInt8: returnValue.setIConst(iConst >> constant.i8Const); break; + case EbtUint8: returnValue.setIConst(iConst >> constant.u8Const); break; + case EbtInt16: returnValue.setIConst(iConst >> constant.i16Const); break; + case EbtUint16: returnValue.setIConst(iConst >> constant.u16Const); break; + case EbtInt64: returnValue.setIConst(iConst >> constant.i64Const); break; + case EbtUint64: returnValue.setIConst(iConst >> constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtUint: + switch (constant.type) { + case EbtInt: returnValue.setUConst(uConst >> constant.iConst); break; + case EbtUint: returnValue.setUConst(uConst >> constant.uConst); break; + case EbtInt8: returnValue.setUConst(uConst >> constant.i8Const); break; + case EbtUint8: returnValue.setUConst(uConst >> constant.u8Const); break; + case EbtInt16: returnValue.setUConst(uConst >> constant.i16Const); break; + case EbtUint16: returnValue.setUConst(uConst >> constant.u16Const); break; + case EbtInt64: returnValue.setUConst(uConst >> constant.i64Const); break; + case EbtUint64: returnValue.setUConst(uConst >> constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtInt64: + switch (constant.type) { + case EbtInt8: returnValue.setI64Const(i64Const >> constant.i8Const); break; + case EbtUint8: returnValue.setI64Const(i64Const >> constant.u8Const); break; + case EbtInt16: returnValue.setI64Const(i64Const >> constant.i16Const); break; + case EbtUint16: returnValue.setI64Const(i64Const >> constant.u16Const); break; + case EbtInt: returnValue.setI64Const(i64Const >> constant.iConst); break; + case EbtUint: returnValue.setI64Const(i64Const >> constant.uConst); break; + case EbtInt64: returnValue.setI64Const(i64Const >> constant.i64Const); break; + case EbtUint64: returnValue.setI64Const(i64Const >> constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtUint64: + switch (constant.type) { + case EbtInt8: returnValue.setU64Const(u64Const >> constant.i8Const); break; + case EbtUint8: returnValue.setU64Const(u64Const >> constant.u8Const); break; + case EbtInt16: returnValue.setU64Const(u64Const >> constant.i16Const); break; + case EbtUint16: returnValue.setU64Const(u64Const >> constant.u16Const); break; + case EbtInt: returnValue.setU64Const(u64Const >> constant.iConst); break; + case EbtUint: returnValue.setU64Const(u64Const >> constant.uConst); break; + case EbtInt64: returnValue.setU64Const(u64Const >> constant.i64Const); break; + case EbtUint64: returnValue.setU64Const(u64Const >> constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + default: assert(false && "Default missing"); + } + + return returnValue; + } + + TConstUnion operator<<(const TConstUnion& constant) const + { + TConstUnion returnValue; + switch (type) { + case EbtInt8: + switch (constant.type) { + case EbtInt8: returnValue.setI8Const(i8Const << constant.i8Const); break; + case EbtUint8: returnValue.setI8Const(i8Const << constant.u8Const); break; + case EbtInt16: returnValue.setI8Const(i8Const << constant.i16Const); break; + case EbtUint16: returnValue.setI8Const(i8Const << constant.u16Const); break; + case EbtInt: returnValue.setI8Const(i8Const << constant.iConst); break; + case EbtUint: returnValue.setI8Const(i8Const << constant.uConst); break; + case EbtInt64: returnValue.setI8Const(i8Const << constant.i64Const); break; + case EbtUint64: returnValue.setI8Const(i8Const << constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtUint8: + switch (constant.type) { + case EbtInt8: returnValue.setU8Const(u8Const << constant.i8Const); break; + case EbtUint8: returnValue.setU8Const(u8Const << constant.u8Const); break; + case EbtInt16: returnValue.setU8Const(u8Const << constant.i16Const); break; + case EbtUint16: returnValue.setU8Const(u8Const << constant.u16Const); break; + case EbtInt: returnValue.setU8Const(u8Const << constant.iConst); break; + case EbtUint: returnValue.setU8Const(u8Const << constant.uConst); break; + case EbtInt64: returnValue.setU8Const(u8Const << constant.i64Const); break; + case EbtUint64: returnValue.setU8Const(u8Const << constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtInt16: + switch (constant.type) { + case EbtInt8: returnValue.setI16Const(i16Const << constant.i8Const); break; + case EbtUint8: returnValue.setI16Const(i16Const << constant.u8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const << constant.i16Const); break; + case EbtUint16: returnValue.setI16Const(i16Const << constant.u16Const); break; + case EbtInt: returnValue.setI16Const(i16Const << constant.iConst); break; + case EbtUint: returnValue.setI16Const(i16Const << constant.uConst); break; + case EbtInt64: returnValue.setI16Const(i16Const << constant.i64Const); break; + case EbtUint64: returnValue.setI16Const(i16Const << constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtUint16: + switch (constant.type) { + case EbtInt8: returnValue.setU16Const(u16Const << constant.i8Const); break; + case EbtUint8: returnValue.setU16Const(u16Const << constant.u8Const); break; + case EbtInt16: returnValue.setU16Const(u16Const << constant.i16Const); break; + case EbtUint16: returnValue.setU16Const(u16Const << constant.u16Const); break; + case EbtInt: returnValue.setU16Const(u16Const << constant.iConst); break; + case EbtUint: returnValue.setU16Const(u16Const << constant.uConst); break; + case EbtInt64: returnValue.setU16Const(u16Const << constant.i64Const); break; + case EbtUint64: returnValue.setU16Const(u16Const << constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtInt64: + switch (constant.type) { + case EbtInt8: returnValue.setI64Const(i64Const << constant.i8Const); break; + case EbtUint8: returnValue.setI64Const(i64Const << constant.u8Const); break; + case EbtInt16: returnValue.setI64Const(i64Const << constant.i16Const); break; + case EbtUint16: returnValue.setI64Const(i64Const << constant.u16Const); break; + case EbtInt: returnValue.setI64Const(i64Const << constant.iConst); break; + case EbtUint: returnValue.setI64Const(i64Const << constant.uConst); break; + case EbtInt64: returnValue.setI64Const(i64Const << constant.i64Const); break; + case EbtUint64: returnValue.setI64Const(i64Const << constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtUint64: + switch (constant.type) { + case EbtInt8: returnValue.setU64Const(u64Const << constant.i8Const); break; + case EbtUint8: returnValue.setU64Const(u64Const << constant.u8Const); break; + case EbtInt16: returnValue.setU64Const(u64Const << constant.i16Const); break; + case EbtUint16: returnValue.setU64Const(u64Const << constant.u16Const); break; + case EbtInt: returnValue.setU64Const(u64Const << constant.iConst); break; + case EbtUint: returnValue.setU64Const(u64Const << constant.uConst); break; + case EbtInt64: returnValue.setU64Const(u64Const << constant.i64Const); break; + case EbtUint64: returnValue.setU64Const(u64Const << constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtInt: + switch (constant.type) { + case EbtInt: returnValue.setIConst(iConst << constant.iConst); break; + case EbtUint: returnValue.setIConst(iConst << constant.uConst); break; + case EbtInt8: returnValue.setIConst(iConst << constant.i8Const); break; + case EbtUint8: returnValue.setIConst(iConst << constant.u8Const); break; + case EbtInt16: returnValue.setIConst(iConst << constant.i16Const); break; + case EbtUint16: returnValue.setIConst(iConst << constant.u16Const); break; + case EbtInt64: returnValue.setIConst(iConst << constant.i64Const); break; + case EbtUint64: returnValue.setIConst(iConst << constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtUint: + switch (constant.type) { + case EbtInt: returnValue.setUConst(uConst << constant.iConst); break; + case EbtUint: returnValue.setUConst(uConst << constant.uConst); break; + case EbtInt8: returnValue.setUConst(uConst << constant.i8Const); break; + case EbtUint8: returnValue.setUConst(uConst << constant.u8Const); break; + case EbtInt16: returnValue.setUConst(uConst << constant.i16Const); break; + case EbtUint16: returnValue.setUConst(uConst << constant.u16Const); break; + case EbtInt64: returnValue.setUConst(uConst << constant.i64Const); break; + case EbtUint64: returnValue.setUConst(uConst << constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + default: assert(false && "Default missing"); + } + + return returnValue; + } + + TConstUnion operator&(const TConstUnion& constant) const + { + TConstUnion returnValue; + assert(type == constant.type); + switch (type) { + case EbtInt: returnValue.setIConst(iConst & constant.iConst); break; + case EbtUint: returnValue.setUConst(uConst & constant.uConst); break; + case EbtInt8: returnValue.setI8Const(i8Const & constant.i8Const); break; + case EbtUint8: returnValue.setU8Const(u8Const & constant.u8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const & constant.i16Const); break; + case EbtUint16: returnValue.setU16Const(u16Const & constant.u16Const); break; + case EbtInt64: returnValue.setI64Const(i64Const & constant.i64Const); break; + case EbtUint64: returnValue.setU64Const(u64Const & constant.u64Const); break; + default: assert(false && "Default missing"); + } + + return returnValue; + } + + TConstUnion operator|(const TConstUnion& constant) const + { + TConstUnion returnValue; + assert(type == constant.type); + switch (type) { + case EbtInt: returnValue.setIConst(iConst | constant.iConst); break; + case EbtUint: returnValue.setUConst(uConst | constant.uConst); break; + case EbtInt8: returnValue.setI8Const(i8Const | constant.i8Const); break; + case EbtUint8: returnValue.setU8Const(u8Const | constant.u8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const | constant.i16Const); break; + case EbtUint16: returnValue.setU16Const(u16Const | constant.u16Const); break; + case EbtInt64: returnValue.setI64Const(i64Const | constant.i64Const); break; + case EbtUint64: returnValue.setU64Const(u64Const | constant.u64Const); break; + default: assert(false && "Default missing"); + } + + return returnValue; + } + + TConstUnion operator^(const TConstUnion& constant) const + { + TConstUnion returnValue; + assert(type == constant.type); + switch (type) { + case EbtInt: returnValue.setIConst(iConst ^ constant.iConst); break; + case EbtUint: returnValue.setUConst(uConst ^ constant.uConst); break; + case EbtInt8: returnValue.setI8Const(i8Const ^ constant.i8Const); break; + case EbtUint8: returnValue.setU8Const(u8Const ^ constant.u8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const ^ constant.i16Const); break; + case EbtUint16: returnValue.setU16Const(u16Const ^ constant.u16Const); break; + case EbtInt64: returnValue.setI64Const(i64Const ^ constant.i64Const); break; + case EbtUint64: returnValue.setU64Const(u64Const ^ constant.u64Const); break; + default: assert(false && "Default missing"); + } + + return returnValue; + } + + TConstUnion operator~() const + { + TConstUnion returnValue; + switch (type) { + case EbtInt: returnValue.setIConst(~iConst); break; + case EbtUint: returnValue.setUConst(~uConst); break; + case EbtInt8: returnValue.setI8Const(~i8Const); break; + case EbtUint8: returnValue.setU8Const(~u8Const); break; + case EbtInt16: returnValue.setI16Const(~i16Const); break; + case EbtUint16: returnValue.setU16Const(~u16Const); break; + case EbtInt64: returnValue.setI64Const(~i64Const); break; + case EbtUint64: returnValue.setU64Const(~u64Const); break; + default: assert(false && "Default missing"); + } + + return returnValue; + } + + TConstUnion operator&&(const TConstUnion& constant) const + { + TConstUnion returnValue; + assert(type == constant.type); + switch (type) { + case EbtBool: returnValue.setBConst(bConst && constant.bConst); break; + default: assert(false && "Default missing"); + } + + return returnValue; + } + + TConstUnion operator||(const TConstUnion& constant) const + { + TConstUnion returnValue; + assert(type == constant.type); + switch (type) { + case EbtBool: returnValue.setBConst(bConst || constant.bConst); break; + default: assert(false && "Default missing"); + } + + return returnValue; + } + + TBasicType getType() const { return type; } + +private: + union { + signed char i8Const; // used for i8vec, scalar int8s + unsigned char u8Const; // used for u8vec, scalar uint8s + signed short i16Const; // used for i16vec, scalar int16s + unsigned short u16Const; // used for u16vec, scalar uint16s + int iConst; // used for ivec, scalar ints + unsigned int uConst; // used for uvec, scalar uints + long long i64Const; // used for i64vec, scalar int64s + unsigned long long u64Const; // used for u64vec, scalar uint64s + bool bConst; // used for bvec, scalar bools + double dConst; // used for vec, dvec, mat, dmat, scalar floats and doubles + const TString* sConst; // string constant + }; + + TBasicType type; +}; + +// Encapsulate having a pointer to an array of TConstUnion, +// which only needs to be allocated if its size is going to be +// bigger than 0. +// +// One convenience is being able to use [] to go inside the array, instead +// of C++ assuming it as an array of pointers to vectors. +// +// General usage is that the size is known up front, and it is +// created once with the proper size. +// +class TConstUnionArray { +public: + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + + TConstUnionArray() : unionArray(nullptr) { } + virtual ~TConstUnionArray() { } + + explicit TConstUnionArray(int size) + { + if (size == 0) + unionArray = nullptr; + else + unionArray = new TConstUnionVector(size); + } + TConstUnionArray(const TConstUnionArray& a) = default; + TConstUnionArray(const TConstUnionArray& a, int start, int size) + { + unionArray = new TConstUnionVector(size); + for (int i = 0; i < size; ++i) + (*unionArray)[i] = a[start + i]; + } + + // Use this constructor for a smear operation + TConstUnionArray(int size, const TConstUnion& val) + { + unionArray = new TConstUnionVector(size, val); + } + + TConstUnionArray* clone() const + { + TConstUnionArray *copy = new TConstUnionArray(size()); + if (unionArray) { + for (const auto i : *unionArray) { + copy->unionArray->push_back(i); + } + } + return copy; + } + + int size() const { return unionArray ? (int)unionArray->size() : 0; } + TConstUnion& operator[](size_t index) { return (*unionArray)[index]; } + const TConstUnion& operator[](size_t index) const { return (*unionArray)[index]; } + bool operator==(const TConstUnionArray& rhs) const + { + // this includes the case that both are unallocated + if (unionArray == rhs.unionArray) + return true; + + if (! unionArray || ! rhs.unionArray) + return false; + + return *unionArray == *rhs.unionArray; + } + bool operator!=(const TConstUnionArray& rhs) const { return ! operator==(rhs); } + + double dot(const TConstUnionArray& rhs) + { + assert(rhs.unionArray->size() == unionArray->size()); + double sum = 0.0; + + for (size_t comp = 0; comp < unionArray->size(); ++comp) + sum += (*this)[comp].getDConst() * rhs[comp].getDConst(); + + return sum; + } + + bool empty() const { return unionArray == nullptr; } + +protected: + typedef TVector TConstUnionVector; + TConstUnionVector* unionArray; +}; + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // _CONSTANT_UNION_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/InfoSink.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/InfoSink.h new file mode 100644 index 0000000000..0ed7d59116 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/InfoSink.h @@ -0,0 +1,173 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef _INFOSINK_INCLUDED_ +#define _INFOSINK_INCLUDED_ + +#include "../Include/Common.h" + +// QNX says no +//#include + +#include + +namespace QtShaderTools { +namespace glslang { + +// +// TPrefixType is used to centralize how info log messages start. +// See below. +// +enum TPrefixType { + EPrefixNone, + EPrefixWarning, + EPrefixError, + EPrefixInternalError, + EPrefixUnimplemented, + EPrefixNote +}; + +enum TOutputStream { + ENull = 0, + EDebugger = 0x01, + EStdOut = 0x02, + EString = 0x04, +}; +// +// Encapsulate info logs for all objects that have them. +// +// The methods are a general set of tools for getting a variety of +// messages and types inserted into the log. +// +class TInfoSinkBase { +public: + TInfoSinkBase() : outputStream(4), shaderFileName(nullptr) {} + void erase() { sink.erase(); } + TInfoSinkBase& operator<<(const TPersistString& t) { append(t); return *this; } + TInfoSinkBase& operator<<(char c) { append(1, c); return *this; } + TInfoSinkBase& operator<<(const char* s) { append(s); return *this; } + TInfoSinkBase& operator<<(int n) { append(String(n)); return *this; } + TInfoSinkBase& operator<<(unsigned int n) { append(String(n)); return *this; } + TInfoSinkBase& operator<<(float n) { const int size = 40; char buf[size]; + snprintf(buf, size, (fabs(n) > 1e-8 && fabs(n) < 1e8) || n == 0.0f ? "%f" : "%g", n); + append(buf); + return *this; } + TInfoSinkBase& operator+(const TPersistString& t) { append(t); return *this; } + TInfoSinkBase& operator+(const TString& t) { append(t); return *this; } + TInfoSinkBase& operator<<(const TString& t) { append(t); return *this; } + TInfoSinkBase& operator+(const char* s) { append(s); return *this; } + const char* c_str() const { return sink.c_str(); } + void prefix(TPrefixType message) { + switch(message) { + case EPrefixNone: break; + case EPrefixWarning: append("WARNING: "); break; + case EPrefixError: append("ERROR: "); break; + case EPrefixInternalError: append("INTERNAL ERROR: "); break; + case EPrefixUnimplemented: append("UNIMPLEMENTED: "); break; + case EPrefixNote: append("NOTE: "); break; + default: append("UNKNOWN ERROR: "); break; + } + } + void location(const TSourceLoc& loc, bool absolute = false, bool displayColumn = false) { + const int maxSize = 24; + char locText[maxSize]; + if (displayColumn) { + snprintf(locText, maxSize, ":%d:%d", loc.line, loc.column); + } else { + snprintf(locText, maxSize, ":%d", loc.line); + } + + // if(loc.getFilename() == nullptr && shaderFileName != nullptr && absolute) { + // append(std::filesystem::absolute(shaderFileName).string()); + // } else { + // std::string location = loc.getStringNameOrNum(false); + // if (absolute) { + // append(std::filesystem::absolute(location).string()); + // } else { + // append(location); + // } + // } + + append(locText); + append(": "); + } + void message(TPrefixType message, const char* s) { + prefix(message); + append(s); + append("\n"); + } + void message(TPrefixType message, const char* s, const TSourceLoc& loc, bool absolute = false, + bool displayColumn = false) + { + prefix(message); + location(loc, absolute, displayColumn); + append(s); + append("\n"); + } + + void setOutputStream(int output = 4) + { + outputStream = output; + } + + void setShaderFileName(const char* file = nullptr) + { + shaderFileName = file; + } + +protected: + void append(const char* s); + + void append(int count, char c); + void append(const TPersistString& t); + void append(const TString& t); + + void checkMem(size_t growth) { if (sink.capacity() < sink.size() + growth + 2) + sink.reserve(sink.capacity() + sink.capacity() / 2); } + void appendToStream(const char* s); + TPersistString sink; + int outputStream; + const char* shaderFileName; +}; + +} // end namespace glslang + +class TInfoSink { +public: + glslang::TInfoSinkBase info; + glslang::TInfoSinkBase debug; +}; +} // namespace QtShaderTools + +#endif // _INFOSINK_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/InitializeGlobals.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/InitializeGlobals.h new file mode 100644 index 0000000000..d196bad306 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/InitializeGlobals.h @@ -0,0 +1,46 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef __INITIALIZE_GLOBALS_INCLUDED_ +#define __INITIALIZE_GLOBALS_INCLUDED_ + +namespace QtShaderTools { +namespace glslang { + +inline bool InitializePoolIndex() { return true; } // DEPRECATED: No need to call + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // __INITIALIZE_GLOBALS_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/PoolAlloc.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/PoolAlloc.h new file mode 100644 index 0000000000..4cf64b8a0f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/PoolAlloc.h @@ -0,0 +1,329 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef _POOLALLOC_INCLUDED_ +#define _POOLALLOC_INCLUDED_ + +#ifndef NDEBUG +# define GUARD_BLOCKS // define to enable guard block sanity checking +#endif + +// +// This header defines an allocator that can be used to efficiently +// allocate a large number of small requests for heap memory, with the +// intention that they are not individually deallocated, but rather +// collectively deallocated at one time. +// +// This simultaneously +// +// * Makes each individual allocation much more efficient; the +// typical allocation is trivial. +// * Completely avoids the cost of doing individual deallocation. +// * Saves the trouble of tracking down and plugging a large class of leaks. +// +// Individual classes can use this allocator by supplying their own +// new and delete methods. +// +// STL containers can use this allocator by using the pool_allocator +// class as the allocator (second) template argument. +// + +#include "visibility.h" + +#include +#include +#include + +namespace QtShaderTools { +namespace glslang { + +// If we are using guard blocks, we must track each individual +// allocation. If we aren't using guard blocks, these +// never get instantiated, so won't have any impact. +// + +class TAllocation { +public: + TAllocation(size_t size, unsigned char* mem, TAllocation* prev = nullptr) : + size(size), mem(mem), prevAlloc(prev) { + // Allocations are bracketed: + // [allocationHeader][initialGuardBlock][userData][finalGuardBlock] + // This would be cleaner with if (guardBlockSize)..., but that + // makes the compiler print warnings about 0 length memsets, + // even with the if() protecting them. +# ifdef GUARD_BLOCKS + memset(preGuard(), guardBlockBeginVal, guardBlockSize); + memset(data(), userDataFill, size); + memset(postGuard(), guardBlockEndVal, guardBlockSize); +# endif + } + + void check() const { + checkGuardBlock(preGuard(), guardBlockBeginVal, "before"); + checkGuardBlock(postGuard(), guardBlockEndVal, "after"); + } + + void checkAllocList() const; + + // Return total size needed to accommodate user buffer of 'size', + // plus our tracking data. + inline static size_t allocationSize(size_t size) { + return size + 2 * guardBlockSize + headerSize(); + } + + // Offset from surrounding buffer to get to user data buffer. + inline static unsigned char* offsetAllocation(unsigned char* m) { + return m + guardBlockSize + headerSize(); + } + +private: + void checkGuardBlock(unsigned char* blockMem, unsigned char val, const char* locText) const; + + // Find offsets to pre and post guard blocks, and user data buffer + unsigned char* preGuard() const { return mem + headerSize(); } + unsigned char* data() const { return preGuard() + guardBlockSize; } + unsigned char* postGuard() const { return data() + size; } + + size_t size; // size of the user data area + unsigned char* mem; // beginning of our allocation (pts to header) + TAllocation* prevAlloc; // prior allocation in the chain + + static inline constexpr unsigned char guardBlockBeginVal = 0xfb; + static inline constexpr unsigned char guardBlockEndVal = 0xfe; + static inline constexpr unsigned char userDataFill = 0xcd; + +# ifdef GUARD_BLOCKS + static inline constexpr size_t guardBlockSize = 16; +# else + static inline constexpr size_t guardBlockSize = 0; +# endif + +# ifdef GUARD_BLOCKS + inline static size_t headerSize() { return sizeof(TAllocation); } +# else + inline static size_t headerSize() { return 0; } +# endif +}; + +// +// There are several stacks. One is to track the pushing and popping +// of the user, and not yet implemented. The others are simply a +// repositories of free pages or used pages. +// +// Page stacks are linked together with a simple header at the beginning +// of each allocation obtained from the underlying OS. Multi-page allocations +// are returned to the OS. Individual page allocations are kept for future +// re-use. +// +// The "page size" used is not, nor must it match, the underlying OS +// page size. But, having it be about that size or equal to a set of +// pages is likely most optimal. +// +class TPoolAllocator { +public: + TPoolAllocator(int growthIncrement = 8*1024, int allocationAlignment = 16); + + // + // Don't call the destructor just to free up the memory, call pop() + // + ~TPoolAllocator(); + + // + // Call push() to establish a new place to pop memory too. Does not + // have to be called to get things started. + // + void push(); + + // + // Call pop() to free all memory allocated since the last call to push(), + // or if no last call to push, frees all memory since first allocation. + // + void pop(); + + // + // Call popAll() to free all memory allocated. + // + void popAll(); + + // + // Call allocate() to actually acquire memory. Returns nullptr if no memory + // available, otherwise a properly aligned pointer to 'numBytes' of memory. + // + GLSLANG_EXPORT_FOR_TESTS + void* allocate(size_t numBytes); + + // + // There is no deallocate. The point of this class is that + // deallocation can be skipped by the user of it, as the model + // of use is to simultaneously deallocate everything at once + // by calling pop(), and to not have to solve memory leak problems. + // + +protected: + friend struct tHeader; + + struct tHeader { + tHeader(tHeader* nextPage, size_t pageCount) : +#ifdef GUARD_BLOCKS + lastAllocation(nullptr), +#endif + nextPage(nextPage), pageCount(pageCount) { } + + ~tHeader() { +#ifdef GUARD_BLOCKS + if (lastAllocation) + lastAllocation->checkAllocList(); +#endif + } + +#ifdef GUARD_BLOCKS + TAllocation* lastAllocation; +#endif + tHeader* nextPage; + size_t pageCount; + }; + + struct tAllocState { + size_t offset; + tHeader* page; + }; + typedef std::vector tAllocStack; + + // Track allocations if and only if we're using guard blocks +#ifndef GUARD_BLOCKS + void* initializeAllocation(tHeader*, unsigned char* memory, size_t) { +#else + void* initializeAllocation(tHeader* block, unsigned char* memory, size_t numBytes) { + new(memory) TAllocation(numBytes, memory, block->lastAllocation); + block->lastAllocation = reinterpret_cast(memory); +#endif + + // This is optimized entirely away if GUARD_BLOCKS is not defined. + return TAllocation::offsetAllocation(memory); + } + + size_t pageSize; // granularity of allocation from the OS + size_t alignment; // all returned allocations will be aligned at + // this granularity, which will be a power of 2 + size_t alignmentMask; + size_t headerSkip; // amount of memory to skip to make room for the + // header (basically, size of header, rounded + // up to make it aligned + size_t currentPageOffset; // next offset in top of inUseList to allocate from + tHeader* freeList; // list of popped memory + tHeader* inUseList; // list of all memory currently being used + tAllocStack stack; // stack of where to allocate from, to partition pool + + int numCalls; // just an interesting statistic + size_t totalBytes; // just an interesting statistic +private: + TPoolAllocator& operator=(const TPoolAllocator&); // don't allow assignment operator + TPoolAllocator(const TPoolAllocator&); // don't allow default copy constructor +}; + +// +// There could potentially be many pools with pops happening at +// different times. But a simple use is to have a global pop +// with everyone using the same global allocator. +// +GLSLANG_EXPORT_FOR_TESTS +extern TPoolAllocator& GetThreadPoolAllocator(); +void SetThreadPoolAllocator(TPoolAllocator* poolAllocator); + +// +// This STL compatible allocator is intended to be used as the allocator +// parameter to templatized STL containers, like vector and map. +// +// It will use the pools for allocation, and not +// do any deallocation, but will still do destruction. +// +template +class pool_allocator { +public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef T *pointer; + typedef const T *const_pointer; + typedef T& reference; + typedef const T& const_reference; + typedef T value_type; + template + struct rebind { + typedef pool_allocator other; + }; + pointer address(reference x) const { return &x; } + const_pointer address(const_reference x) const { return &x; } + + pool_allocator() : allocator(GetThreadPoolAllocator()) { } + pool_allocator(TPoolAllocator& a) : allocator(a) { } + pool_allocator(const pool_allocator& p) : allocator(p.allocator) { } + + template + pool_allocator(const pool_allocator& p) : allocator(p.getAllocator()) { } + + pointer allocate(size_type n) { + return reinterpret_cast(getAllocator().allocate(n * sizeof(T))); } + pointer allocate(size_type n, const void*) { + return reinterpret_cast(getAllocator().allocate(n * sizeof(T))); } + + void deallocate(void*, size_type) { } + void deallocate(pointer, size_type) { } + + pointer _Charalloc(size_t n) { + return reinterpret_cast(getAllocator().allocate(n)); } + + void construct(pointer p, const T& val) { new ((void *)p) T(val); } + void destroy(pointer p) { p->T::~T(); } + + bool operator==(const pool_allocator& rhs) const { return &getAllocator() == &rhs.getAllocator(); } + bool operator!=(const pool_allocator& rhs) const { return &getAllocator() != &rhs.getAllocator(); } + + size_type max_size() const { return static_cast(-1) / sizeof(T); } + size_type max_size(int size) const { return static_cast(-1) / size; } + + TPoolAllocator& getAllocator() const { return allocator; } + + pool_allocator select_on_container_copy_construction() const { return pool_allocator{}; } + +protected: + pool_allocator& operator=(const pool_allocator&) { return *this; } + TPoolAllocator& allocator; +}; + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // _POOLALLOC_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/ResourceLimits.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/ResourceLimits.h new file mode 100644 index 0000000000..b36c8d6273 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/ResourceLimits.h @@ -0,0 +1,159 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef _RESOURCE_LIMITS_INCLUDED_ +#define _RESOURCE_LIMITS_INCLUDED_ + +struct TLimits { + bool nonInductiveForLoops; + bool whileLoops; + bool doWhileLoops; + bool generalUniformIndexing; + bool generalAttributeMatrixVectorIndexing; + bool generalVaryingIndexing; + bool generalSamplerIndexing; + bool generalVariableIndexing; + bool generalConstantMatrixVectorIndexing; +}; + +struct TBuiltInResource { + int maxLights; + int maxClipPlanes; + int maxTextureUnits; + int maxTextureCoords; + int maxVertexAttribs; + int maxVertexUniformComponents; + int maxVaryingFloats; + int maxVertexTextureImageUnits; + int maxCombinedTextureImageUnits; + int maxTextureImageUnits; + int maxFragmentUniformComponents; + int maxDrawBuffers; + int maxVertexUniformVectors; + int maxVaryingVectors; + int maxFragmentUniformVectors; + int maxVertexOutputVectors; + int maxFragmentInputVectors; + int minProgramTexelOffset; + int maxProgramTexelOffset; + int maxClipDistances; + int maxComputeWorkGroupCountX; + int maxComputeWorkGroupCountY; + int maxComputeWorkGroupCountZ; + int maxComputeWorkGroupSizeX; + int maxComputeWorkGroupSizeY; + int maxComputeWorkGroupSizeZ; + int maxComputeUniformComponents; + int maxComputeTextureImageUnits; + int maxComputeImageUniforms; + int maxComputeAtomicCounters; + int maxComputeAtomicCounterBuffers; + int maxVaryingComponents; + int maxVertexOutputComponents; + int maxGeometryInputComponents; + int maxGeometryOutputComponents; + int maxFragmentInputComponents; + int maxImageUnits; + int maxCombinedImageUnitsAndFragmentOutputs; + int maxCombinedShaderOutputResources; + int maxImageSamples; + int maxVertexImageUniforms; + int maxTessControlImageUniforms; + int maxTessEvaluationImageUniforms; + int maxGeometryImageUniforms; + int maxFragmentImageUniforms; + int maxCombinedImageUniforms; + int maxGeometryTextureImageUnits; + int maxGeometryOutputVertices; + int maxGeometryTotalOutputComponents; + int maxGeometryUniformComponents; + int maxGeometryVaryingComponents; + int maxTessControlInputComponents; + int maxTessControlOutputComponents; + int maxTessControlTextureImageUnits; + int maxTessControlUniformComponents; + int maxTessControlTotalOutputComponents; + int maxTessEvaluationInputComponents; + int maxTessEvaluationOutputComponents; + int maxTessEvaluationTextureImageUnits; + int maxTessEvaluationUniformComponents; + int maxTessPatchComponents; + int maxPatchVertices; + int maxTessGenLevel; + int maxViewports; + int maxVertexAtomicCounters; + int maxTessControlAtomicCounters; + int maxTessEvaluationAtomicCounters; + int maxGeometryAtomicCounters; + int maxFragmentAtomicCounters; + int maxCombinedAtomicCounters; + int maxAtomicCounterBindings; + int maxVertexAtomicCounterBuffers; + int maxTessControlAtomicCounterBuffers; + int maxTessEvaluationAtomicCounterBuffers; + int maxGeometryAtomicCounterBuffers; + int maxFragmentAtomicCounterBuffers; + int maxCombinedAtomicCounterBuffers; + int maxAtomicCounterBufferSize; + int maxTransformFeedbackBuffers; + int maxTransformFeedbackInterleavedComponents; + int maxCullDistances; + int maxCombinedClipAndCullDistances; + int maxSamples; + int maxMeshOutputVerticesNV; + int maxMeshOutputPrimitivesNV; + int maxMeshWorkGroupSizeX_NV; + int maxMeshWorkGroupSizeY_NV; + int maxMeshWorkGroupSizeZ_NV; + int maxTaskWorkGroupSizeX_NV; + int maxTaskWorkGroupSizeY_NV; + int maxTaskWorkGroupSizeZ_NV; + int maxMeshViewCountNV; + int maxMeshOutputVerticesEXT; + int maxMeshOutputPrimitivesEXT; + int maxMeshWorkGroupSizeX_EXT; + int maxMeshWorkGroupSizeY_EXT; + int maxMeshWorkGroupSizeZ_EXT; + int maxTaskWorkGroupSizeX_EXT; + int maxTaskWorkGroupSizeY_EXT; + int maxTaskWorkGroupSizeZ_EXT; + int maxMeshViewCountEXT; + int maxDualSourceDrawBuffersEXT; + + TLimits limits; +}; + +#endif // _RESOURCE_LIMITS_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/ShHandle.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/ShHandle.h new file mode 100644 index 0000000000..edc9b18d68 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/ShHandle.h @@ -0,0 +1,180 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef _SHHANDLE_INCLUDED_ +#define _SHHANDLE_INCLUDED_ + +// +// Machine independent part of the compiler private objects +// sent as ShHandle to the driver. +// +// This should not be included by driver code. +// + +#define SH_EXPORTING +#include "../Public/ShaderLang.h" +#include "../MachineIndependent/Versions.h" +#include "InfoSink.h" + +namespace QtShaderTools { + +class TCompiler; +class TLinker; +class TUniformMap; + +// +// The base class used to back handles returned to the driver. +// +class TShHandleBase { +public: + TShHandleBase() { pool = new glslang::TPoolAllocator; } + virtual ~TShHandleBase() { delete pool; } + virtual TCompiler* getAsCompiler() { return nullptr; } + virtual TLinker* getAsLinker() { return nullptr; } + virtual TUniformMap* getAsUniformMap() { return nullptr; } + virtual glslang::TPoolAllocator* getPool() const { return pool; } +private: + glslang::TPoolAllocator* pool; +}; + +// +// The base class for the machine dependent linker to derive from +// for managing where uniforms live. +// +class TUniformMap : public TShHandleBase { +public: + TUniformMap() { } + virtual ~TUniformMap() { } + virtual TUniformMap* getAsUniformMap() { return this; } + virtual int getLocation(const char* name) = 0; + virtual TInfoSink& getInfoSink() { return infoSink; } + TInfoSink infoSink; +}; + +class TIntermNode; + +// +// The base class for the machine dependent compiler to derive from +// for managing object code from the compile. +// +class TCompiler : public TShHandleBase { +public: + TCompiler(EShLanguage l, TInfoSink& sink) : infoSink(sink) , language(l), haveValidObjectCode(false) { } + virtual ~TCompiler() { } + EShLanguage getLanguage() { return language; } + virtual TInfoSink& getInfoSink() { return infoSink; } + + virtual bool compile(TIntermNode* root, int version = 0, EProfile profile = ENoProfile) = 0; + + virtual TCompiler* getAsCompiler() { return this; } + virtual bool linkable() { return haveValidObjectCode; } + + TInfoSink& infoSink; +protected: + TCompiler& operator=(TCompiler&); + + EShLanguage language; + bool haveValidObjectCode; +}; + +// +// Link operations are based on a list of compile results... +// +typedef glslang::TVector TCompilerList; +typedef glslang::TVector THandleList; + +// +// The base class for the machine dependent linker to derive from +// to manage the resulting executable. +// + +class TLinker : public TShHandleBase { +public: + TLinker(EShExecutable e, TInfoSink& iSink) : + infoSink(iSink), + executable(e), + haveReturnableObjectCode(false), + appAttributeBindings(nullptr), + fixedAttributeBindings(nullptr), + excludedAttributes(nullptr), + excludedCount(0), + uniformBindings(nullptr) { } + virtual TLinker* getAsLinker() { return this; } + virtual ~TLinker() { } + virtual bool link(TCompilerList&, TUniformMap*) = 0; + virtual bool link(THandleList&) { return false; } + virtual void setAppAttributeBindings(const ShBindingTable* t) { appAttributeBindings = t; } + virtual void setFixedAttributeBindings(const ShBindingTable* t) { fixedAttributeBindings = t; } + virtual void getAttributeBindings(ShBindingTable const **t) const = 0; + virtual void setExcludedAttributes(const int* attributes, int count) { excludedAttributes = attributes; excludedCount = count; } + virtual ShBindingTable* getUniformBindings() const { return uniformBindings; } + virtual const void* getObjectCode() const { return nullptr; } // a real compiler would be returning object code here + virtual TInfoSink& getInfoSink() { return infoSink; } + TInfoSink& infoSink; +protected: + TLinker& operator=(TLinker&); + EShExecutable executable; + bool haveReturnableObjectCode; // true when objectCode is acceptable to send to driver + + const ShBindingTable* appAttributeBindings; + const ShBindingTable* fixedAttributeBindings; + const int* excludedAttributes; + int excludedCount; + ShBindingTable* uniformBindings; // created by the linker +}; + +// +// This is the interface between the machine independent code +// and the machine dependent code. +// +// The machine dependent code should derive from the classes +// above. Then Construct*() and Delete*() will create and +// destroy the machine dependent objects, which contain the +// above machine independent information. +// +TCompiler* ConstructCompiler(EShLanguage, int); + +TShHandleBase* ConstructLinker(EShExecutable, int); +TShHandleBase* ConstructBindings(); +void DeleteLinker(TShHandleBase*); +void DeleteBindingList(TShHandleBase* bindingList); + +TUniformMap* ConstructUniformMap(); +void DeleteCompiler(TCompiler*); + +void DeleteUniformMap(TUniformMap*); + +} //namespace QtShaderTools + +#endif // _SHHANDLE_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/SpirvIntrinsics.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/SpirvIntrinsics.h new file mode 100644 index 0000000000..1b015361df --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/SpirvIntrinsics.h @@ -0,0 +1,142 @@ +// +// Copyright(C) 2021 Advanced Micro Devices, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#pragma once + +// +// GL_EXT_spirv_intrinsics +// +#include "Common.h" +#include + +namespace QtShaderTools { +namespace glslang { + +class TIntermTyped; +class TIntermConstantUnion; +class TType; + +// SPIR-V requirements +struct TSpirvRequirement { + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + + // capability = [..] + TSet extensions; + // extension = [..] + TSet capabilities; +}; + +// SPIR-V execution modes +struct TSpirvExecutionMode { + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + + // spirv_execution_mode + TMap> modes; + // spirv_execution_mode_id + TMap > modeIds; +}; + +// SPIR-V decorations +struct TSpirvDecorate { + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + + // spirv_decorate + TMap > decorates; + // spirv_decorate_id + TMap> decorateIds; + // spirv_decorate_string + TMap > decorateStrings; +}; + +// SPIR-V instruction +struct TSpirvInstruction { + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + + TSpirvInstruction() { set = ""; id = -1; } + + bool operator==(const TSpirvInstruction& rhs) const { return set == rhs.set && id == rhs.id; } + bool operator!=(const TSpirvInstruction& rhs) const { return !operator==(rhs); } + + // spirv_instruction + TString set; + int id; +}; + +// SPIR-V type parameter +struct TSpirvTypeParameter { + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + + TSpirvTypeParameter(const TIntermConstantUnion* arg) { value = arg; } + TSpirvTypeParameter(const TType* arg) { value = arg; } + + const TIntermConstantUnion* getAsConstant() const + { + if (value.index() == 0) + return std::get(value); + return nullptr; + } + const TType* getAsType() const + { + if (value.index() == 1) + return std::get(value); + return nullptr; + } + + bool operator==(const TSpirvTypeParameter& rhs) const; + bool operator!=(const TSpirvTypeParameter& rhs) const { return !operator==(rhs); } + + // Parameter value: constant expression or type specifier + std::variant value; +}; + +typedef TVector TSpirvTypeParameters; + +// SPIR-V type +struct TSpirvType { + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + + bool operator==(const TSpirvType& rhs) const + { + return spirvInst == rhs.spirvInst && typeParams == rhs.typeParams; + } + bool operator!=(const TSpirvType& rhs) const { return !operator==(rhs); } + + // spirv_type + TSpirvInstruction spirvInst; + TSpirvTypeParameters typeParams; +}; + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/Types.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/Types.h new file mode 100644 index 0000000000..2676d23f5d --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/Types.h @@ -0,0 +1,3094 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2016 LunarG, Inc. +// Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2017 ARM Limited. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef _TYPES_INCLUDED +#define _TYPES_INCLUDED + +#include "../Include/Common.h" +#include "../Include/BaseTypes.h" +#include "../Public/ShaderLang.h" +#include "arrays.h" +#include "SpirvIntrinsics.h" + +#include + +#ifdef restrict +#undef restrict +#endif + +namespace QtShaderTools { +namespace glslang { + +class TIntermAggregate; + +const int GlslangMaxTypeLength = 200; // TODO: need to print block/struct one member per line, so this can stay bounded + +const char* const AnonymousPrefix = "anon@"; // for something like a block whose members can be directly accessed +inline bool IsAnonymous(const TString& name) +{ + return name.compare(0, 5, AnonymousPrefix) == 0; +} + +// +// Details within a sampler type +// +enum TSamplerDim { + EsdNone, + Esd1D, + Esd2D, + Esd3D, + EsdCube, + EsdRect, + EsdBuffer, + EsdSubpass, // goes only with non-sampled image (image is true) + EsdAttachmentEXT, + EsdNumDims +}; + +struct TSampler { // misnomer now; includes images, textures without sampler, and textures with sampler + TBasicType type : 8; // type returned by sampler + TSamplerDim dim : 8; + bool arrayed : 1; + bool shadow : 1; + bool ms : 1; + bool image : 1; // image, combined should be false + bool combined : 1; // true means texture is combined with a sampler, false means texture with no sampler + bool sampler : 1; // true means a pure sampler, other fields should be clear() + bool tileQCOM : 1; // is tile shading attachment + + unsigned int vectorSize : 3; // vector return type size. + // Some languages support structures as sample results. Storing the whole structure in the + // TSampler is too large, so there is an index to a separate table. + static const unsigned structReturnIndexBits = 4; // number of index bits to use. + static const unsigned structReturnSlots = (1< TTypeList; + +typedef TVector TIdentifierList; + +enum TLayoutMatrix { + ElmNone, + ElmRowMajor, + ElmColumnMajor, // default, but different than saying nothing + ElmCount // If expanding, see bitfield width below +}; + +// Union of geometry shader and tessellation shader geometry types. +// They don't go into TType, but rather have current state per shader or +// active parser type (TPublicType). +enum TLayoutGeometry { + ElgNone, + ElgPoints, + ElgLines, + ElgLinesAdjacency, + ElgLineStrip, + ElgTriangles, + ElgTrianglesAdjacency, + ElgTriangleStrip, + ElgQuads, + ElgIsolines, +}; + +enum TVertexSpacing { + EvsNone, + EvsEqual, + EvsFractionalEven, + EvsFractionalOdd +}; + +enum TVertexOrder { + EvoNone, + EvoCw, + EvoCcw +}; + +// Note: order matters, as type of format is done by comparison. +enum TLayoutFormat { + ElfNone, + + // Float image + ElfRgba32f, + ElfRgba16f, + ElfR32f, + ElfRgba8, + ElfRgba8Snorm, + + ElfEsFloatGuard, // to help with comparisons + + ElfRg32f, + ElfRg16f, + ElfR11fG11fB10f, + ElfR16f, + ElfRgba16, + ElfRgb10A2, + ElfRg16, + ElfRg8, + ElfR16, + ElfR8, + ElfRgba16Snorm, + ElfRg16Snorm, + ElfRg8Snorm, + ElfR16Snorm, + ElfR8Snorm, + + ElfFloatGuard, // to help with comparisons + + // Int image + ElfRgba32i, + ElfRgba16i, + ElfRgba8i, + ElfR32i, + + ElfEsIntGuard, // to help with comparisons + + ElfRg32i, + ElfRg16i, + ElfRg8i, + ElfR16i, + ElfR8i, + ElfR64i, + + ElfIntGuard, // to help with comparisons + + // Uint image + ElfRgba32ui, + ElfRgba16ui, + ElfRgba8ui, + ElfR32ui, + + ElfEsUintGuard, // to help with comparisons + + ElfRg32ui, + ElfRg16ui, + ElfRgb10a2ui, + ElfRg8ui, + ElfR16ui, + ElfR8ui, + ElfR64ui, + ElfExtSizeGuard, // to help with comparisons + ElfSize1x8, + ElfSize1x16, + ElfSize1x32, + ElfSize2x32, + ElfSize4x32, + + ElfCount +}; + +enum TLayoutDepth { + EldNone, + EldAny, + EldGreater, + EldLess, + EldUnchanged, + + EldCount +}; + +enum TLayoutStencil { + ElsNone, + ElsRefUnchangedFrontAMD, + ElsRefGreaterFrontAMD, + ElsRefLessFrontAMD, + ElsRefUnchangedBackAMD, + ElsRefGreaterBackAMD, + ElsRefLessBackAMD, + + ElsCount +}; + +enum TBlendEquationShift { + // No 'EBlendNone': + // These are used as bit-shift amounts. A mask of such shifts will have type 'int', + // and in that space, 0 means no bits set, or none. In this enum, 0 means (1 << 0), a bit is set. + EBlendMultiply, + EBlendScreen, + EBlendOverlay, + EBlendDarken, + EBlendLighten, + EBlendColordodge, + EBlendColorburn, + EBlendHardlight, + EBlendSoftlight, + EBlendDifference, + EBlendExclusion, + EBlendHslHue, + EBlendHslSaturation, + EBlendHslColor, + EBlendHslLuminosity, + EBlendAllEquations, + + EBlendCount +}; + +enum TInterlockOrdering { + EioNone, + EioPixelInterlockOrdered, + EioPixelInterlockUnordered, + EioSampleInterlockOrdered, + EioSampleInterlockUnordered, + EioShadingRateInterlockOrdered, + EioShadingRateInterlockUnordered, + + EioCount, +}; + +enum TShaderInterface +{ + // Includes both uniform blocks and buffer blocks + EsiUniform = 0, + EsiInput, + EsiOutput, + EsiNone, + + EsiCount +}; + +class TQualifier { +public: + static const int layoutNotSet = -1; + + void clear() + { + precision = EpqNone; + invariant = false; + makeTemporary(); + declaredBuiltIn = EbvNone; + noContraction = false; + nullInit = false; + spirvByReference = false; + spirvLiteral = false; + defaultBlock = false; + } + + // drop qualifiers that don't belong in a temporary variable + void makeTemporary() + { + semanticName = nullptr; + storage = EvqTemporary; + builtIn = EbvNone; + clearInterstage(); + clearMemory(); + specConstant = false; + nonUniform = false; + nullInit = false; + defaultBlock = false; + clearLayout(); + spirvStorageClass = -1; + spirvDecorate = nullptr; + spirvByReference = false; + spirvLiteral = false; + } + + void clearInterstage() + { + clearInterpolation(); + patch = false; + sample = false; + } + + void clearInterpolation() + { + centroid = false; + smooth = false; + flat = false; + nopersp = false; + explicitInterp = false; + pervertexNV = false; + perPrimitiveNV = false; + perViewNV = false; + perTaskNV = false; + pervertexEXT = false; + } + + void clearMemory() + { + coherent = false; + devicecoherent = false; + queuefamilycoherent = false; + workgroupcoherent = false; + subgroupcoherent = false; + shadercallcoherent = false; + nonprivate = false; + volatil = false; + nontemporal = false; + restrict = false; + readonly = false; + writeonly = false; + } + + const char* semanticName; + TStorageQualifier storage : 7; + static_assert(EvqLast < 64, "need to increase size of TStorageQualifier bitfields!"); + TBuiltInVariable builtIn : 9; + TBuiltInVariable declaredBuiltIn : 9; + static_assert(EbvLast < 256, "need to increase size of TBuiltInVariable bitfields!"); + TPrecisionQualifier precision : 3; + bool invariant : 1; // require canonical treatment for cross-shader invariance + bool centroid : 1; + bool smooth : 1; + bool flat : 1; + // having a constant_id is not sufficient: expressions have no id, but are still specConstant + bool specConstant : 1; + bool nonUniform : 1; + bool explicitOffset : 1; + bool defaultBlock : 1; // default blocks with matching names have structures merged when linking + + bool noContraction: 1; // prevent contraction and reassociation, e.g., for 'precise' keyword, and expressions it affects + bool nopersp : 1; + bool explicitInterp : 1; + bool pervertexNV : 1; + bool pervertexEXT : 1; + bool perPrimitiveNV : 1; + bool perViewNV : 1; + bool perTaskNV : 1; + bool patch : 1; + bool sample : 1; + bool restrict : 1; + bool readonly : 1; + bool writeonly : 1; + bool coherent : 1; + bool volatil : 1; + bool nontemporal : 1; + bool devicecoherent : 1; + bool queuefamilycoherent : 1; + bool workgroupcoherent : 1; + bool subgroupcoherent : 1; + bool shadercallcoherent : 1; + bool nonprivate : 1; + bool nullInit : 1; + bool spirvByReference : 1; + bool spirvLiteral : 1; + bool isWriteOnly() const { return writeonly; } + bool isReadOnly() const { return readonly; } + bool isRestrict() const { return restrict; } + bool isCoherent() const { return coherent; } + bool isVolatile() const { return volatil; } + bool isNonTemporal() const { return nontemporal; } + bool isSample() const { return sample; } + bool isMemory() const + { + return shadercallcoherent || subgroupcoherent || workgroupcoherent || queuefamilycoherent || devicecoherent || coherent || volatil || nontemporal || restrict || readonly || writeonly || nonprivate; + } + bool isMemoryQualifierImageAndSSBOOnly() const + { + return shadercallcoherent || subgroupcoherent || workgroupcoherent || queuefamilycoherent || devicecoherent || coherent || volatil || nontemporal || restrict || readonly || writeonly; + } + bool bufferReferenceNeedsVulkanMemoryModel() const + { + // include qualifiers that map to load/store availability/visibility/nonprivate memory access operands + return subgroupcoherent || workgroupcoherent || queuefamilycoherent || devicecoherent || coherent || nonprivate; + } + bool isInterpolation() const + { + return flat || smooth || nopersp || explicitInterp; + } + bool isExplicitInterpolation() const + { + return explicitInterp; + } + bool isAuxiliary() const + { + return centroid || patch || sample || pervertexNV || pervertexEXT; + } + bool isPatch() const { return patch; } + bool isNoContraction() const { return noContraction; } + void setNoContraction() { noContraction = true; } + bool isPervertexNV() const { return pervertexNV; } + bool isPervertexEXT() const { return pervertexEXT; } + void setNullInit() { nullInit = true; } + bool isNullInit() const { return nullInit; } + void setSpirvByReference() { spirvByReference = true; } + bool isSpirvByReference() const { return spirvByReference; } + void setSpirvLiteral() { spirvLiteral = true; } + bool isSpirvLiteral() const { return spirvLiteral; } + + bool isPipeInput() const + { + switch (storage) { + case EvqVaryingIn: + case EvqFragCoord: + case EvqPointCoord: + case EvqFace: + case EvqVertexId: + case EvqInstanceId: + return true; + default: + return false; + } + } + + bool isPipeOutput() const + { + switch (storage) { + case EvqPosition: + case EvqPointSize: + case EvqClipVertex: + case EvqVaryingOut: + case EvqFragColor: + case EvqFragDepth: + case EvqFragStencil: + return true; + default: + return false; + } + } + + bool isParamInput() const + { + switch (storage) { + case EvqIn: + case EvqInOut: + case EvqConstReadOnly: + return true; + default: + return false; + } + } + + bool isParamOutput() const + { + switch (storage) { + case EvqOut: + case EvqInOut: + return true; + default: + return false; + } + } + + bool isUniformOrBuffer() const + { + switch (storage) { + case EvqUniform: + case EvqBuffer: + return true; + default: + return false; + } + } + + bool isUniform() const + { + switch (storage) { + case EvqUniform: + return true; + default: + return false; + } + } + + bool isIo() const + { + switch (storage) { + case EvqUniform: + case EvqBuffer: + case EvqVaryingIn: + case EvqFragCoord: + case EvqPointCoord: + case EvqFace: + case EvqVertexId: + case EvqInstanceId: + case EvqPosition: + case EvqPointSize: + case EvqClipVertex: + case EvqVaryingOut: + case EvqFragColor: + case EvqFragDepth: + case EvqFragStencil: + return true; + default: + return false; + } + } + + // non-built-in symbols that might link between compilation units + bool isLinkable() const + { + switch (storage) { + case EvqGlobal: + case EvqVaryingIn: + case EvqVaryingOut: + case EvqUniform: + case EvqBuffer: + case EvqShared: + return true; + default: + return false; + } + } + + TBlockStorageClass getBlockStorage() const { + if (storage == EvqUniform && !isPushConstant()) { + return EbsUniform; + } + else if (storage == EvqUniform) { + return EbsPushConstant; + } + else if (storage == EvqBuffer) { + return EbsStorageBuffer; + } + return EbsNone; + } + + void setBlockStorage(TBlockStorageClass newBacking) { + layoutPushConstant = (newBacking == EbsPushConstant); + switch (newBacking) { + case EbsUniform : + if (layoutPacking == ElpStd430) { + // std430 would not be valid + layoutPacking = ElpStd140; + } + storage = EvqUniform; + break; + case EbsStorageBuffer : + storage = EvqBuffer; + break; + case EbsPushConstant : + storage = EvqUniform; + layoutSet = TQualifier::layoutSetEnd; + layoutBinding = TQualifier::layoutBindingEnd; + break; + default: + break; + } + } + + bool isPerPrimitive() const { return perPrimitiveNV; } + bool isPerView() const { return perViewNV; } + bool isTaskMemory() const { return perTaskNV; } + bool isTaskPayload() const { return storage == EvqtaskPayloadSharedEXT; } + bool isAnyPayload() const { + return storage == EvqPayload || storage == EvqPayloadIn; + } + bool isAnyCallable() const { + return storage == EvqCallableData || storage == EvqCallableDataIn; + } + bool isHitObjectAttrNV() const { + return storage == EvqHitObjectAttrNV; + } + bool isHitObjectAttrEXT() const { + return storage == EvqHitObjectAttrEXT; + } + + // True if this type of IO is supposed to be arrayed with extra level for per-vertex data + bool isArrayedIo(EShLanguage language) const + { + switch (language) { + case EShLangGeometry: + return isPipeInput(); + case EShLangTessControl: + return ! patch && (isPipeInput() || isPipeOutput()); + case EShLangTessEvaluation: + return ! patch && isPipeInput(); + case EShLangFragment: + return (pervertexNV || pervertexEXT) && isPipeInput(); + case EShLangMesh: + return ! perTaskNV && isPipeOutput(); + + default: + return false; + } + } + + // Implementing an embedded layout-qualifier class here, since C++ can't have a real class bitfield + void clearLayout() // all layout + { + clearUniformLayout(); + + layoutPushConstant = false; + layoutBufferReference = false; + layoutPassthrough = false; + layoutViewportRelative = false; + // -2048 as the default value indicating layoutSecondaryViewportRelative is not set + layoutSecondaryViewportRelativeOffset = -2048; + layoutShaderRecord = false; + layoutFullQuads = false; + layoutQuadDeriv = false; + layoutHitObjectShaderRecordNV = false; + layoutHitObjectShaderRecordEXT = false; + layoutBindlessSampler = false; + layoutBindlessImage = false; + layoutBufferReferenceAlign = layoutBufferReferenceAlignEnd; + layoutFormat = ElfNone; + + layoutTileAttachmentQCOM = false; + + clearInterstageLayout(); + + layoutSpecConstantId = layoutSpecConstantIdEnd; + } + void clearInterstageLayout() + { + layoutLocation = layoutLocationEnd; + layoutComponent = layoutComponentEnd; + layoutIndex = layoutIndexEnd; + clearStreamLayout(); + clearXfbLayout(); + } + + void clearStreamLayout() + { + layoutStream = layoutStreamEnd; + } + void clearXfbLayout() + { + layoutXfbBuffer = layoutXfbBufferEnd; + layoutXfbStride = layoutXfbStrideEnd; + layoutXfbOffset = layoutXfbOffsetEnd; + } + + bool hasNonXfbLayout() const + { + return hasUniformLayout() || + hasAnyLocation() || + hasStream() || + hasFormat() || + isShaderRecord() || + isPushConstant() || + hasBufferReference(); + } + bool hasLayout() const + { + return hasNonXfbLayout() || + hasXfb(); + } + + TLayoutMatrix layoutMatrix : 3; + TLayoutPacking layoutPacking : 4; + int layoutOffset; + int layoutAlign; + + unsigned int layoutLocation : 12; + static const unsigned int layoutLocationEnd = 0xFFF; + + unsigned int layoutComponent : 3; + static const unsigned int layoutComponentEnd = 4; + + unsigned int layoutSet : 7; + static const unsigned int layoutSetEnd = 0x3F; + + unsigned int layoutBinding : 16; + static const unsigned int layoutBindingEnd = 0xFFFF; + + unsigned int layoutIndex : 8; + static const unsigned int layoutIndexEnd = 0xFF; + + unsigned int layoutStream : 8; + static const unsigned int layoutStreamEnd = 0xFF; + + unsigned int layoutXfbBuffer : 4; + static const unsigned int layoutXfbBufferEnd = 0xF; + + unsigned int layoutXfbStride : 14; + static const unsigned int layoutXfbStrideEnd = 0x3FFF; + + unsigned int layoutXfbOffset : 13; + static const unsigned int layoutXfbOffsetEnd = 0x1FFF; + + unsigned int layoutAttachment : 8; // for input_attachment_index + static const unsigned int layoutAttachmentEnd = 0XFF; + + unsigned int layoutSpecConstantId : 11; + static const unsigned int layoutSpecConstantIdEnd = 0x7FF; + + // stored as log2 of the actual alignment value + unsigned int layoutBufferReferenceAlign : 6; + static const unsigned int layoutBufferReferenceAlignEnd = 0x3F; + + TLayoutFormat layoutFormat : 8; + + bool layoutPushConstant; + bool layoutBufferReference; + bool layoutPassthrough; + bool layoutViewportRelative; + int layoutSecondaryViewportRelativeOffset; + bool layoutShaderRecord; + bool layoutFullQuads; + bool layoutQuadDeriv; + bool layoutHitObjectShaderRecordNV; + bool layoutHitObjectShaderRecordEXT; + + // GL_EXT_spirv_intrinsics + int spirvStorageClass; + TSpirvDecorate* spirvDecorate; + + bool layoutBindlessSampler; + bool layoutBindlessImage; + + bool layoutTileAttachmentQCOM; + + bool hasUniformLayout() const + { + return hasMatrix() || + hasPacking() || + hasOffset() || + hasBinding() || + hasSet() || + hasAlign(); + } + void clearUniformLayout() // only uniform specific + { + layoutMatrix = ElmNone; + layoutPacking = ElpNone; + layoutOffset = layoutNotSet; + layoutAlign = layoutNotSet; + + layoutSet = layoutSetEnd; + layoutBinding = layoutBindingEnd; + layoutAttachment = layoutAttachmentEnd; + } + + bool hasMatrix() const + { + return layoutMatrix != ElmNone; + } + bool hasPacking() const + { + return layoutPacking != ElpNone; + } + bool hasAlign() const + { + return layoutAlign != layoutNotSet; + } + bool hasAnyLocation() const + { + return hasLocation() || + hasComponent() || + hasIndex(); + } + bool hasLocation() const + { + return layoutLocation != layoutLocationEnd; + } + bool hasSet() const + { + return layoutSet != layoutSetEnd; + } + bool hasBinding() const + { + return layoutBinding != layoutBindingEnd; + } + bool hasOffset() const + { + return layoutOffset != layoutNotSet; + } + bool isNonPerspective() const { return nopersp; } + bool hasIndex() const + { + return layoutIndex != layoutIndexEnd; + } + unsigned getIndex() const { return layoutIndex; } + bool hasComponent() const + { + return layoutComponent != layoutComponentEnd; + } + bool hasStream() const + { + return layoutStream != layoutStreamEnd; + } + bool hasFormat() const + { + return layoutFormat != ElfNone; + } + bool hasXfb() const + { + return hasXfbBuffer() || + hasXfbStride() || + hasXfbOffset(); + } + bool hasXfbBuffer() const + { + return layoutXfbBuffer != layoutXfbBufferEnd; + } + bool hasXfbStride() const + { + return layoutXfbStride != layoutXfbStrideEnd; + } + bool hasXfbOffset() const + { + return layoutXfbOffset != layoutXfbOffsetEnd; + } + bool hasAttachment() const + { + return layoutAttachment != layoutAttachmentEnd; + } + TLayoutFormat getFormat() const { return layoutFormat; } + bool isPushConstant() const { return layoutPushConstant; } + bool isShaderRecord() const { return layoutShaderRecord; } + bool isFullQuads() const { return layoutFullQuads; } + bool isQuadDeriv() const { return layoutQuadDeriv; } + bool hasHitObjectShaderRecordNV() const { return layoutHitObjectShaderRecordNV; } + bool hasHitObjectShaderRecordEXT() const { return layoutHitObjectShaderRecordEXT; } + bool hasBufferReference() const { return layoutBufferReference; } + bool hasBufferReferenceAlign() const + { + return layoutBufferReferenceAlign != layoutBufferReferenceAlignEnd; + } + bool isNonUniform() const + { + return nonUniform; + } + bool isBindlessSampler() const + { + return layoutBindlessSampler; + } + bool isBindlessImage() const + { + return layoutBindlessImage; + } + bool isTileAttachmentQCOM() const + { + return layoutTileAttachmentQCOM; + } + + // GL_EXT_spirv_intrinsics + bool hasSpirvDecorate() const { return spirvDecorate != nullptr; } + void setSpirvDecorate(int decoration, const TIntermAggregate* args = nullptr); + void setSpirvDecorateId(int decoration, const TIntermAggregate* args); + void setSpirvDecorateString(int decoration, const TIntermAggregate* args); + const TSpirvDecorate& getSpirvDecorate() const { assert(spirvDecorate); return *spirvDecorate; } + TSpirvDecorate& getSpirvDecorate() { assert(spirvDecorate); return *spirvDecorate; } + TString getSpirvDecorateQualifierString() const; + + bool hasSpecConstantId() const + { + // Not the same thing as being a specialization constant, this + // is just whether or not it was declared with an ID. + return layoutSpecConstantId != layoutSpecConstantIdEnd; + } + bool isSpecConstant() const + { + // True if type is a specialization constant, whether or not it + // had a specialization-constant ID, and false if it is not a + // true front-end constant. + return specConstant; + } + bool isFrontEndConstant() const + { + // True if the front-end knows the final constant value. + // This allows front-end constant folding. + return storage == EvqConst && ! specConstant; + } + bool isConstant() const + { + // True if is either kind of constant; specialization or regular. + return isFrontEndConstant() || isSpecConstant(); + } + void makeSpecConstant() + { + storage = EvqConst; + specConstant = true; + } + static const char* getLayoutPackingString(TLayoutPacking packing) + { + switch (packing) { + case ElpStd140: return "std140"; + case ElpPacked: return "packed"; + case ElpShared: return "shared"; + case ElpStd430: return "std430"; + case ElpScalar: return "scalar"; + default: return "none"; + } + } + static const char* getLayoutMatrixString(TLayoutMatrix m) + { + switch (m) { + case ElmColumnMajor: return "column_major"; + case ElmRowMajor: return "row_major"; + default: return "none"; + } + } + static const char* getLayoutFormatString(TLayoutFormat f) + { + switch (f) { + case ElfRgba32f: return "rgba32f"; + case ElfRgba16f: return "rgba16f"; + case ElfRg32f: return "rg32f"; + case ElfRg16f: return "rg16f"; + case ElfR11fG11fB10f: return "r11f_g11f_b10f"; + case ElfR32f: return "r32f"; + case ElfR16f: return "r16f"; + case ElfRgba16: return "rgba16"; + case ElfRgb10A2: return "rgb10_a2"; + case ElfRgba8: return "rgba8"; + case ElfRg16: return "rg16"; + case ElfRg8: return "rg8"; + case ElfR16: return "r16"; + case ElfR8: return "r8"; + case ElfRgba16Snorm: return "rgba16_snorm"; + case ElfRgba8Snorm: return "rgba8_snorm"; + case ElfRg16Snorm: return "rg16_snorm"; + case ElfRg8Snorm: return "rg8_snorm"; + case ElfR16Snorm: return "r16_snorm"; + case ElfR8Snorm: return "r8_snorm"; + + case ElfRgba32i: return "rgba32i"; + case ElfRgba16i: return "rgba16i"; + case ElfRgba8i: return "rgba8i"; + case ElfRg32i: return "rg32i"; + case ElfRg16i: return "rg16i"; + case ElfRg8i: return "rg8i"; + case ElfR32i: return "r32i"; + case ElfR16i: return "r16i"; + case ElfR8i: return "r8i"; + + case ElfRgba32ui: return "rgba32ui"; + case ElfRgba16ui: return "rgba16ui"; + case ElfRgba8ui: return "rgba8ui"; + case ElfRg32ui: return "rg32ui"; + case ElfRg16ui: return "rg16ui"; + case ElfRgb10a2ui: return "rgb10_a2ui"; + case ElfRg8ui: return "rg8ui"; + case ElfR32ui: return "r32ui"; + case ElfR16ui: return "r16ui"; + case ElfR8ui: return "r8ui"; + case ElfR64ui: return "r64ui"; + case ElfR64i: return "r64i"; + case ElfSize1x8: return "size1x8"; + case ElfSize1x16: return "size1x16"; + case ElfSize1x32: return "size1x32"; + case ElfSize2x32: return "size2x32"; + case ElfSize4x32: return "size4x32"; + default: return "none"; + } + } + static const char* getLayoutDepthString(TLayoutDepth d) + { + switch (d) { + case EldAny: return "depth_any"; + case EldGreater: return "depth_greater"; + case EldLess: return "depth_less"; + case EldUnchanged: return "depth_unchanged"; + default: return "none"; + } + } + static const char* getLayoutStencilString(TLayoutStencil s) + { + switch (s) { + case ElsRefUnchangedFrontAMD: return "stencil_ref_unchanged_front_amd"; + case ElsRefGreaterFrontAMD: return "stencil_ref_greater_front_amd"; + case ElsRefLessFrontAMD: return "stencil_ref_less_front_amd"; + case ElsRefUnchangedBackAMD: return "stencil_ref_unchanged_back_amd"; + case ElsRefGreaterBackAMD: return "stencil_ref_greater_back_amd"; + case ElsRefLessBackAMD: return "stencil_ref_less_back_amd"; + default: return "none"; + } + } + static const char* getBlendEquationString(TBlendEquationShift e) + { + switch (e) { + case EBlendMultiply: return "blend_support_multiply"; + case EBlendScreen: return "blend_support_screen"; + case EBlendOverlay: return "blend_support_overlay"; + case EBlendDarken: return "blend_support_darken"; + case EBlendLighten: return "blend_support_lighten"; + case EBlendColordodge: return "blend_support_colordodge"; + case EBlendColorburn: return "blend_support_colorburn"; + case EBlendHardlight: return "blend_support_hardlight"; + case EBlendSoftlight: return "blend_support_softlight"; + case EBlendDifference: return "blend_support_difference"; + case EBlendExclusion: return "blend_support_exclusion"; + case EBlendHslHue: return "blend_support_hsl_hue"; + case EBlendHslSaturation: return "blend_support_hsl_saturation"; + case EBlendHslColor: return "blend_support_hsl_color"; + case EBlendHslLuminosity: return "blend_support_hsl_luminosity"; + case EBlendAllEquations: return "blend_support_all_equations"; + default: return "unknown"; + } + } + static const char* getGeometryString(TLayoutGeometry geometry) + { + switch (geometry) { + case ElgPoints: return "points"; + case ElgLines: return "lines"; + case ElgLinesAdjacency: return "lines_adjacency"; + case ElgLineStrip: return "line_strip"; + case ElgTriangles: return "triangles"; + case ElgTrianglesAdjacency: return "triangles_adjacency"; + case ElgTriangleStrip: return "triangle_strip"; + case ElgQuads: return "quads"; + case ElgIsolines: return "isolines"; + default: return "none"; + } + } + static const char* getVertexSpacingString(TVertexSpacing spacing) + { + switch (spacing) { + case EvsEqual: return "equal_spacing"; + case EvsFractionalEven: return "fractional_even_spacing"; + case EvsFractionalOdd: return "fractional_odd_spacing"; + default: return "none"; + } + } + static const char* getVertexOrderString(TVertexOrder order) + { + switch (order) { + case EvoCw: return "cw"; + case EvoCcw: return "ccw"; + default: return "none"; + } + } + static int mapGeometryToSize(TLayoutGeometry geometry) + { + switch (geometry) { + case ElgPoints: return 1; + case ElgLines: return 2; + case ElgLinesAdjacency: return 4; + case ElgTriangles: return 3; + case ElgTrianglesAdjacency: return 6; + default: return 0; + } + } + static const char* getInterlockOrderingString(TInterlockOrdering order) + { + switch (order) { + case EioPixelInterlockOrdered: return "pixel_interlock_ordered"; + case EioPixelInterlockUnordered: return "pixel_interlock_unordered"; + case EioSampleInterlockOrdered: return "sample_interlock_ordered"; + case EioSampleInterlockUnordered: return "sample_interlock_unordered"; + case EioShadingRateInterlockOrdered: return "shading_rate_interlock_ordered"; + case EioShadingRateInterlockUnordered: return "shading_rate_interlock_unordered"; + default: return "none"; + } + } +}; + +// Qualifiers that don't need to be kept per object. They have shader scope, not object scope. +// So, they will not be part of TType, TQualifier, etc. +struct TShaderQualifiers { + TLayoutGeometry geometry; // geometry/tessellation shader in/out primitives + bool pixelCenterInteger; // fragment shader + bool originUpperLeft; // fragment shader + int invocations; + int vertices; // for tessellation "vertices", geometry & mesh "max_vertices" + TVertexSpacing spacing; + TVertexOrder order; + bool pointMode; + int localSize[3]; // compute shader + bool localSizeNotDefault[3]; // compute shader + int localSizeSpecId[3]; // compute shader specialization id for gl_WorkGroupSize + bool earlyFragmentTests; // fragment input + bool postDepthCoverage; // fragment input + bool earlyAndLateFragmentTestsAMD; //fragment input + bool nonCoherentColorAttachmentReadEXT; // fragment input + bool nonCoherentDepthAttachmentReadEXT; // fragment input + bool nonCoherentStencilAttachmentReadEXT; // fragment input + TLayoutDepth layoutDepth; + TLayoutStencil layoutStencil; + bool blendEquation; // true if any blend equation was specified + int numViews; // multiview extenstions + TInterlockOrdering interlockOrdering; + bool layoutOverrideCoverage; // true if layout override_coverage set + bool layoutDerivativeGroupQuads; // true if layout derivative_group_quadsNV set + bool layoutDerivativeGroupLinear; // true if layout derivative_group_linearNV set + int primitives; // mesh shader "max_primitives"DerivativeGroupLinear; // true if layout derivative_group_linearNV set + bool layoutPrimitiveCulling; // true if layout primitive_culling set + bool layoutNonCoherentTileAttachmentReadQCOM; // fragment shaders -- per object + int layoutTileShadingRateQCOM[3]; // compute shader + bool layoutTileShadingRateQCOMNotDefault[3]; // compute shader + TLayoutDepth getDepth() const { return layoutDepth; } + TLayoutStencil getStencil() const { return layoutStencil; } + + void init() + { + geometry = ElgNone; + originUpperLeft = false; + pixelCenterInteger = false; + invocations = TQualifier::layoutNotSet; + vertices = TQualifier::layoutNotSet; + spacing = EvsNone; + order = EvoNone; + pointMode = false; + localSize[0] = 1; + localSize[1] = 1; + localSize[2] = 1; + localSizeNotDefault[0] = false; + localSizeNotDefault[1] = false; + localSizeNotDefault[2] = false; + localSizeSpecId[0] = TQualifier::layoutNotSet; + localSizeSpecId[1] = TQualifier::layoutNotSet; + localSizeSpecId[2] = TQualifier::layoutNotSet; + earlyFragmentTests = false; + earlyAndLateFragmentTestsAMD = false; + postDepthCoverage = false; + nonCoherentColorAttachmentReadEXT = false; + nonCoherentDepthAttachmentReadEXT = false; + nonCoherentStencilAttachmentReadEXT = false; + layoutDepth = EldNone; + layoutStencil = ElsNone; + blendEquation = false; + numViews = TQualifier::layoutNotSet; + layoutOverrideCoverage = false; + layoutDerivativeGroupQuads = false; + layoutDerivativeGroupLinear = false; + layoutPrimitiveCulling = false; + layoutNonCoherentTileAttachmentReadQCOM = false; + layoutTileShadingRateQCOM[0] = 0; + layoutTileShadingRateQCOM[1] = 0; + layoutTileShadingRateQCOM[2] = 0; + layoutTileShadingRateQCOMNotDefault[0] = false; + layoutTileShadingRateQCOMNotDefault[1] = false; + layoutTileShadingRateQCOMNotDefault[2] = false; + primitives = TQualifier::layoutNotSet; + interlockOrdering = EioNone; + } + + bool hasBlendEquation() const { return blendEquation; } + + // Merge in characteristics from the 'src' qualifier. They can override when + // set, but never erase when not set. + void merge(const TShaderQualifiers& src) + { + if (src.geometry != ElgNone) + geometry = src.geometry; + if (src.pixelCenterInteger) + pixelCenterInteger = src.pixelCenterInteger; + if (src.originUpperLeft) + originUpperLeft = src.originUpperLeft; + if (src.invocations != TQualifier::layoutNotSet) + invocations = src.invocations; + if (src.vertices != TQualifier::layoutNotSet) + vertices = src.vertices; + if (src.spacing != EvsNone) + spacing = src.spacing; + if (src.order != EvoNone) + order = src.order; + if (src.pointMode) + pointMode = true; + for (int i = 0; i < 3; ++i) { + if (src.localSize[i] > 1) + localSize[i] = src.localSize[i]; + } + for (int i = 0; i < 3; ++i) { + localSizeNotDefault[i] = src.localSizeNotDefault[i] || localSizeNotDefault[i]; + } + for (int i = 0; i < 3; ++i) { + if (src.localSizeSpecId[i] != TQualifier::layoutNotSet) + localSizeSpecId[i] = src.localSizeSpecId[i]; + } + if (src.earlyFragmentTests) + earlyFragmentTests = true; + if (src.earlyAndLateFragmentTestsAMD) + earlyAndLateFragmentTestsAMD = true; + if (src.postDepthCoverage) + postDepthCoverage = true; + if (src.nonCoherentColorAttachmentReadEXT) + nonCoherentColorAttachmentReadEXT = true; + if (src.nonCoherentDepthAttachmentReadEXT) + nonCoherentDepthAttachmentReadEXT = true; + if (src.nonCoherentStencilAttachmentReadEXT) + nonCoherentStencilAttachmentReadEXT = true; + if (src.layoutDepth) + layoutDepth = src.layoutDepth; + if (src.layoutStencil) + layoutStencil = src.layoutStencil; + if (src.blendEquation) + blendEquation = src.blendEquation; + if (src.numViews != TQualifier::layoutNotSet) + numViews = src.numViews; + if (src.layoutOverrideCoverage) + layoutOverrideCoverage = src.layoutOverrideCoverage; + if (src.layoutDerivativeGroupQuads) + layoutDerivativeGroupQuads = src.layoutDerivativeGroupQuads; + if (src.layoutDerivativeGroupLinear) + layoutDerivativeGroupLinear = src.layoutDerivativeGroupLinear; + if (src.primitives != TQualifier::layoutNotSet) + primitives = src.primitives; + if (src.interlockOrdering != EioNone) + interlockOrdering = src.interlockOrdering; + if (src.layoutPrimitiveCulling) + layoutPrimitiveCulling = src.layoutPrimitiveCulling; + if (src.layoutNonCoherentTileAttachmentReadQCOM) + layoutNonCoherentTileAttachmentReadQCOM = src.layoutNonCoherentTileAttachmentReadQCOM; + for (int i = 0; i < 3; ++i) { + if (src.layoutTileShadingRateQCOM[i] > 1) + layoutTileShadingRateQCOM[i] = src.layoutTileShadingRateQCOM[i]; + } + for (int i = 0; i < 3; ++i) { + layoutTileShadingRateQCOMNotDefault[i] = src.layoutTileShadingRateQCOMNotDefault[i] || layoutTileShadingRateQCOMNotDefault[i]; + } + } +}; + +class TTypeParameters { +public: + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + + TTypeParameters() : basicType(EbtVoid), arraySizes(nullptr), spirvType(nullptr) {} + + TBasicType basicType; + TArraySizes *arraySizes; + TSpirvType *spirvType; + + bool operator==(const TTypeParameters& rhs) const + { + bool same = basicType == rhs.basicType && *arraySizes == *rhs.arraySizes; + if (same && basicType == EbtSpirvType) { + assert(spirvType && rhs.spirvType); + return *spirvType == *rhs.spirvType; + } + return same; + } + bool operator!=(const TTypeParameters& rhs) const + { + return !(*this == rhs); + } +}; + +// +// TPublicType is just temporarily used while parsing and not quite the same +// information kept per node in TType. Due to the bison stack, it can't have +// types that it thinks have non-trivial constructors. It should +// just be used while recognizing the grammar, not anything else. +// Once enough is known about the situation, the proper information +// moved into a TType, or the parse context, etc. +// +class TPublicType { +public: + TBasicType basicType; + TSampler sampler; + TQualifier qualifier; + TShaderQualifiers shaderQualifiers; + uint32_t vectorSize : 4; + uint32_t matrixCols : 4; + uint32_t matrixRows : 4; + bool coopmatNV : 1; + bool coopmatKHR : 1; + bool coopvecNV : 1; + bool tileAttachmentQCOM: 1; + uint32_t tensorRankARM : 4; + TArraySizes* arraySizes; + const TType* userDef; + TSourceLoc loc; + TTypeParameters* typeParameters; + // SPIR-V type defined by spirv_type directive + TSpirvType* spirvType; + + bool isCoopmat() const { return coopmatNV || coopmatKHR; } + bool isCoopmatNV() const { return coopmatNV; } + bool isCoopmatKHR() const { return coopmatKHR; } + bool isCoopvecNV() const { return coopvecNV; } + bool isTensorARM() const { return tensorRankARM; } + bool hasTypeParameter() const { return isCoopmat() || isCoopvecNV() || isTensorARM(); } + + bool isTensorLayoutNV() const { return basicType == EbtTensorLayoutNV; } + bool isTensorViewNV() const { return basicType == EbtTensorViewNV; } + + void initType(const TSourceLoc& l) + { + basicType = EbtVoid; + vectorSize = 1u; + matrixRows = 0; + matrixCols = 0; + arraySizes = nullptr; + userDef = nullptr; + loc = l; + typeParameters = nullptr; + coopmatNV = false; + coopmatKHR = false; + coopvecNV = false; + tileAttachmentQCOM = false; + tensorRankARM = 0; + spirvType = nullptr; + } + + void initQualifiers(bool global = false) + { + qualifier.clear(); + if (global) + qualifier.storage = EvqGlobal; + } + + void init(const TSourceLoc& l, bool global = false) + { + initType(l); + sampler.clear(); + initQualifiers(global); + shaderQualifiers.init(); + } + + void setVector(int s) + { + matrixRows = 0; + matrixCols = 0; + assert(s >= 0); + vectorSize = static_cast(s) & 0b1111; + } + + void setMatrix(int c, int r) + { + assert(r >= 0); + matrixRows = static_cast(r) & 0b1111; + assert(c >= 0); + matrixCols = static_cast(c) & 0b1111; + vectorSize = 0; + } + + bool isScalar() const + { + return matrixCols == 0u && vectorSize == 1u && arraySizes == nullptr && userDef == nullptr; + } + + // GL_EXT_spirv_intrinsics + void setSpirvType(const TSpirvInstruction& spirvInst, const TSpirvTypeParameters* typeParams = nullptr); + + // "Image" is a superset of "Subpass" + bool isImage() const { return basicType == EbtSampler && sampler.isImage(); } + bool isSubpass() const { return basicType == EbtSampler && sampler.isSubpass(); } + bool isAttachmentEXT() const { return basicType == EbtSampler && sampler.isAttachmentEXT(); } +}; + +// +// Base class for things that have a type. +// +class TType { +public: + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + + // for "empty" type (no args) or simple scalar/vector/matrix + explicit TType(TBasicType t = EbtVoid, TStorageQualifier q = EvqTemporary, int vs = 1, int mc = 0, int mr = 0, + bool isVector = false) : + basicType(t), vectorSize(static_cast(vs) & 0b1111), matrixCols(static_cast(mc) & 0b1111), matrixRows(static_cast(mr) & 0b1111), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false), + tileAttachmentQCOM(false), tensorRankARM(0), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr), + spirvType(nullptr) + { + assert(vs >= 0); + assert(mc >= 0); + assert(mr >= 0); + + sampler.clear(); + qualifier.clear(); + qualifier.storage = q; + assert(!(isMatrix() && vectorSize != 0)); // prevent vectorSize != 0 on matrices + } + // for explicit precision qualifier + TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0, + bool isVector = false) : + basicType(t), vectorSize(static_cast(vs) & 0b1111), matrixCols(static_cast(mc) & 0b1111), matrixRows(static_cast(mr) & 0b1111), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false), + tileAttachmentQCOM(false), tensorRankARM(0), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr), + spirvType(nullptr) + { + assert(vs >= 0); + assert(mc >= 0); + assert(mr >= 0); + + sampler.clear(); + qualifier.clear(); + qualifier.storage = q; + qualifier.precision = p; + assert(p >= EpqNone && p <= EpqHigh); + assert(!(isMatrix() && vectorSize != 0)); // prevent vectorSize != 0 on matrices + } + // for turning a TPublicType into a TType, using a shallow copy + explicit TType(const TPublicType& p) : + basicType(p.basicType), + vectorSize(p.vectorSize), matrixCols(p.matrixCols), matrixRows(p.matrixRows), vector1(false), coopmatNV(p.coopmatNV), coopmatKHR(p.coopmatKHR), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(p.coopvecNV), + tileAttachmentQCOM(p.tileAttachmentQCOM), tensorRankARM(p.tensorRankARM), arraySizes(p.arraySizes), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(p.typeParameters), + spirvType(p.spirvType) + { + if (basicType == EbtSampler) + sampler = p.sampler; + else + sampler.clear(); + qualifier = p.qualifier; + if (p.userDef) { + if (p.userDef->basicType == EbtReference) { + basicType = EbtReference; + referentType = p.userDef->referentType; + } else { + structure = p.userDef->getWritableStruct(); // public type is short-lived; there are no sharing issues + } + typeName = NewPoolTString(p.userDef->getTypeName().c_str()); + } + if (p.isCoopmatNV() && p.typeParameters && p.typeParameters->arraySizes->getNumDims() > 0) { + int numBits = p.typeParameters->arraySizes->getDimSize(0); + if (p.basicType == EbtFloat && numBits == 16) { + basicType = EbtFloat16; + qualifier.precision = EpqNone; + } else if (p.basicType == EbtUint && numBits == 8) { + basicType = EbtUint8; + qualifier.precision = EpqNone; + } else if (p.basicType == EbtUint && numBits == 16) { + basicType = EbtUint16; + qualifier.precision = EpqNone; + } else if (p.basicType == EbtInt && numBits == 8) { + basicType = EbtInt8; + qualifier.precision = EpqNone; + } else if (p.basicType == EbtInt && numBits == 16) { + basicType = EbtInt16; + qualifier.precision = EpqNone; + } + } + if (p.isCoopmatKHR() && p.typeParameters && p.typeParameters->arraySizes->getNumDims() > 0) { + basicType = p.typeParameters->basicType; + if (isSpirvType()) { + assert(p.typeParameters->spirvType); + spirvType = p.typeParameters->spirvType; + } + + if (p.typeParameters->arraySizes->getNumDims() == 4) { + const int dimSize = p.typeParameters->arraySizes->getDimSize(3); + assert(dimSize >= 0); + coopmatKHRuse = static_cast(dimSize) & 0b111; + coopmatKHRUseValid = true; + } + } + if (p.isCoopvecNV() && p.typeParameters) { + basicType = p.typeParameters->basicType; + } + if (p.isTensorARM() && p.typeParameters) { + basicType = p.typeParameters->basicType; + if (p.typeParameters->arraySizes->getNumDims() > 0) { + tensorRankARM = static_cast(p.typeParameters->arraySizes->getDimSize(0)) & 0b1111; + } + } + } + // for construction of sampler types + TType(const TSampler& sampler, TStorageQualifier q = EvqUniform, TArraySizes* as = nullptr) : + basicType(EbtSampler), vectorSize(1u), matrixCols(0u), matrixRows(0u), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false), + tileAttachmentQCOM(false), tensorRankARM(0), arraySizes(as), structure(nullptr), fieldName(nullptr), typeName(nullptr), + sampler(sampler), typeParameters(nullptr), spirvType(nullptr) + { + qualifier.clear(); + qualifier.storage = q; + } + // to efficiently make a dereferenced type + // without ever duplicating the outer structure that will be thrown away + // and using only shallow copy + TType(const TType& type, int derefIndex, bool rowMajor = false) + { + if (type.isArray()) { + shallowCopy(type); + if (type.getArraySizes()->getNumDims() == 1) { + arraySizes = nullptr; + } else { + // want our own copy of the array, so we can edit it + arraySizes = new TArraySizes; + arraySizes->copyDereferenced(*type.arraySizes); + } + } else if (type.basicType == EbtStruct || type.basicType == EbtBlock) { + // do a structure dereference + const TTypeList& memberList = *type.getStruct(); + shallowCopy(*memberList[derefIndex].type); + return; + } else { + // do a vector/matrix dereference + shallowCopy(type); + if (matrixCols > 0) { + // dereference from matrix to vector + if (rowMajor) + vectorSize = matrixCols; + else + vectorSize = matrixRows; + matrixCols = 0; + matrixRows = 0; + if (vectorSize == 1) + vector1 = true; + } else if (isVector()) { + // dereference from vector to scalar + vectorSize = 1; + vector1 = false; + } else if (isCoopMat() || isCoopVecNV()) { + coopmatNV = false; + coopmatKHR = false; + coopmatKHRuse = 0; + coopmatKHRUseValid = false; + coopvecNV = false; + typeParameters = nullptr; + } else if (isTileAttachmentQCOM()) { + tileAttachmentQCOM = false; + typeParameters = nullptr; + } + } + } + // for making structures, ... + TType(TTypeList* userDef, const TString& n) : + basicType(EbtStruct), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false), + tileAttachmentQCOM(false), tensorRankARM(0), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr), + spirvType(nullptr) + { + sampler.clear(); + qualifier.clear(); + typeName = NewPoolTString(n.c_str()); + } + // For interface blocks + TType(TTypeList* userDef, const TString& n, const TQualifier& q) : + basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false), + tileAttachmentQCOM(false), tensorRankARM(0), qualifier(q), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr), + spirvType(nullptr) + { + sampler.clear(); + typeName = NewPoolTString(n.c_str()); + } + // for block reference (first parameter must be EbtReference) + explicit TType(TBasicType t, const TType &p, const TString& n) : + basicType(t), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), + tileAttachmentQCOM(false), tensorRankARM(0), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr), + spirvType(nullptr) + { + assert(t == EbtReference); + typeName = NewPoolTString(n.c_str()); + sampler.clear(); + qualifier.clear(); + qualifier.storage = p.qualifier.storage; + referentType = p.clone(); + } + virtual ~TType() {} + + // Not for use across pool pops; it will cause multiple instances of TType to point to the same information. + // This only works if that information (like a structure's list of types) does not change and + // the instances are sharing the same pool. + void shallowCopy(const TType& copyOf) + { + basicType = copyOf.basicType; + sampler = copyOf.sampler; + qualifier = copyOf.qualifier; + vectorSize = copyOf.vectorSize; + matrixCols = copyOf.matrixCols; + matrixRows = copyOf.matrixRows; + vector1 = copyOf.vector1; + arraySizes = copyOf.arraySizes; // copying the pointer only, not the contents + fieldName = copyOf.fieldName; + typeName = copyOf.typeName; + if (isStruct()) { + structure = copyOf.structure; + } else { + referentType = copyOf.referentType; + } + typeParameters = copyOf.typeParameters; + spirvType = copyOf.spirvType; + coopmatNV = copyOf.isCoopMatNV(); + coopmatKHR = copyOf.isCoopMatKHR(); + coopmatKHRuse = copyOf.coopmatKHRuse; + coopmatKHRUseValid = copyOf.coopmatKHRUseValid; + coopvecNV = copyOf.isCoopVecNV(); + tileAttachmentQCOM = copyOf.tileAttachmentQCOM; + tensorRankARM = copyOf.tensorRankARM; + } + + // Make complete copy of the whole type graph rooted at 'copyOf'. + void deepCopy(const TType& copyOf) + { + TMap copied; // to enable copying a type graph as a graph, not a tree + deepCopy(copyOf, copied); + } + + // Recursively make temporary + void makeTemporary() + { + getQualifier().makeTemporary(); + + if (isStruct()) + for (unsigned int i = 0; i < structure->size(); ++i) + (*structure)[i].type->makeTemporary(); + } + + TType* clone() const + { + TType *newType = new TType(); + newType->deepCopy(*this); + + return newType; + } + + void makeVector() { vector1 = true; } + + virtual void hideMember() { basicType = EbtVoid; vectorSize = 1u; } + virtual bool hiddenMember() const { return basicType == EbtVoid; } + + virtual void setFieldName(const TString& n) { fieldName = NewPoolTString(n.c_str()); } + virtual const TString& getTypeName() const + { + assert(typeName); + return *typeName; + } + + virtual bool hasFieldName() const { return (fieldName != nullptr); } + virtual const TString& getFieldName() const + { + assert(fieldName); + return *fieldName; + } + TShaderInterface getShaderInterface() const + { + if (basicType != EbtBlock) + return EsiNone; + + switch (qualifier.storage) { + default: + return EsiNone; + case EvqVaryingIn: + return EsiInput; + case EvqVaryingOut: + return EsiOutput; + case EvqUniform: + case EvqBuffer: + return EsiUniform; + } + } + + virtual TBasicType getBasicType() const { return basicType; } + virtual const TSampler& getSampler() const { return sampler; } + virtual TSampler& getSampler() { return sampler; } + + virtual TQualifier& getQualifier() { return qualifier; } + virtual const TQualifier& getQualifier() const { return qualifier; } + + virtual int getVectorSize() const { return static_cast(vectorSize); } // returns 1 for either scalar or vector of size 1, valid for both + virtual int getMatrixCols() const { return static_cast(matrixCols); } + virtual int getMatrixRows() const { return static_cast(matrixRows); } + virtual int getOuterArraySize() const { return arraySizes->getOuterSize(); } + virtual TIntermTyped* getOuterArrayNode() const { return arraySizes->getOuterNode(); } + virtual int getCumulativeArraySize() const { return arraySizes->getCumulativeSize(); } + bool isArrayOfArrays() const { return arraySizes != nullptr && arraySizes->getNumDims() > 1; } + virtual int getImplicitArraySize() const { return arraySizes->getImplicitSize(); } + virtual const TArraySizes* getArraySizes() const { return arraySizes; } + virtual TArraySizes* getArraySizes() { return arraySizes; } + virtual TType* getReferentType() const { return referentType; } + virtual const TTypeParameters* getTypeParameters() const { return typeParameters; } + virtual TTypeParameters* getTypeParameters() { return typeParameters; } + + virtual bool isScalar() const { return ! isVector() && ! isMatrix() && ! isStruct() && ! isArray() && ! isCoopVecNV(); } + virtual bool isScalarOrVec1() const { return isScalar() || vector1; } + virtual bool isScalarOrVector() const { return !isMatrix() && !isStruct() && !isArray(); } + virtual bool isVector() const { return vectorSize > 1u || vector1; } + virtual bool isMatrix() const { return matrixCols ? true : false; } + virtual bool isArray() const { return arraySizes != nullptr; } + virtual bool isSizedArray() const { return isArray() && arraySizes->isSized(); } + virtual bool isUnsizedArray() const { return isArray() && !arraySizes->isSized(); } + virtual bool isImplicitlySizedArray() const { return isArray() && arraySizes->isImplicitlySized(); } + virtual bool isArrayVariablyIndexed() const { assert(isArray()); return arraySizes->isVariablyIndexed(); } + virtual void setArrayVariablyIndexed() { assert(isArray()); arraySizes->setVariablyIndexed(); } + virtual void updateImplicitArraySize(int size) { assert(isArray()); arraySizes->updateImplicitSize(size); } + virtual void setImplicitlySized(bool isImplicitSized) { arraySizes->setImplicitlySized(isImplicitSized); } + virtual bool isStruct() const { return basicType == EbtStruct || basicType == EbtBlock; } + virtual bool isFloatingDomain() const { return basicType == EbtFloat || basicType == EbtDouble || basicType == EbtFloat16 || + basicType == EbtBFloat16 || basicType == EbtFloatE5M2 || basicType == EbtFloatE4M3; } + virtual bool isIntegerDomain() const + { + switch (basicType) { + case EbtInt8: + case EbtUint8: + case EbtInt16: + case EbtUint16: + case EbtInt: + case EbtUint: + case EbtInt64: + case EbtUint64: + case EbtAtomicUint: + return true; + default: + break; + } + return false; + } + virtual bool isOpaque() const { return basicType == EbtSampler + || basicType == EbtAtomicUint || basicType == EbtAccStruct || basicType == EbtRayQuery + || basicType == EbtHitObjectNV || basicType == EbtHitObjectEXT || isTileAttachmentQCOM() + || isTensorARM(); + } + virtual bool isBuiltIn() const { return getQualifier().builtIn != EbvNone; } + + virtual bool isAttachmentEXT() const { return basicType == EbtSampler && getSampler().isAttachmentEXT(); } + virtual bool isImage() const { return basicType == EbtSampler && getSampler().isImage(); } + virtual bool isSubpass() const { return basicType == EbtSampler && getSampler().isSubpass(); } + virtual bool isTexture() const { return basicType == EbtSampler && getSampler().isTexture(); } + virtual bool isBindlessImage() const { return isImage() && qualifier.layoutBindlessImage; } + virtual bool isBindlessTexture() const { return isTexture() && qualifier.layoutBindlessSampler; } + // Check the block-name convention of creating a block without populating it's members: + virtual bool isUnusableName() const { return isStruct() && structure == nullptr; } + virtual bool isParameterized() const { return typeParameters != nullptr; } + bool isAtomic() const { return basicType == EbtAtomicUint; } + bool isCoopMat() const { return coopmatNV || coopmatKHR; } + bool isCoopMatNV() const { return coopmatNV; } + bool isCoopMatKHR() const { return coopmatKHR; } + bool isCoopVecNV() const { return coopvecNV; } + bool isTileAttachmentQCOM() const { return tileAttachmentQCOM; } + bool isTensorARM() const { return tensorRankARM; } + bool hasTypeParameter() const { return isCoopMat() || isCoopVecNV() || isTensorARM(); } + int getTensorRankARM() const { return static_cast(tensorRankARM); } + bool isReference() const { return getBasicType() == EbtReference; } + bool isSpirvType() const { return getBasicType() == EbtSpirvType; } + int getCoopMatKHRuse() const { return static_cast(coopmatKHRuse); } + + bool isTensorLayoutNV() const { return getBasicType() == EbtTensorLayoutNV; } + bool isTensorViewNV() const { return getBasicType() == EbtTensorViewNV; } + + // return true if this type contains any subtype which satisfies the given predicate. + template + bool contains(P predicate) const + { + if (predicate(this)) + return true; + + const auto hasa = [predicate](const TTypeLoc& tl) { return tl.type->contains(predicate); }; + + return isStruct() && std::any_of(structure->begin(), structure->end(), hasa); + } + + // Recursively checks if the type contains the given basic type + virtual bool containsBasicType(TBasicType checkType) const + { + return contains([checkType](const TType* t) { return t->basicType == checkType; } ); + } + + // Recursively check the structure for any arrays, needed for some error checks + virtual bool containsArray() const + { + return contains([](const TType* t) { return t->isArray(); } ); + } + + // Check the structure for any structures, needed for some error checks + virtual bool containsStructure() const + { + return contains([this](const TType* t) { return t != this && t->isStruct(); } ); + } + + // Recursively check the structure for any unsized arrays, needed for triggering a copyUp(). + virtual bool containsUnsizedArray() const + { + return contains([](const TType* t) { return t->isUnsizedArray(); } ); + } + + virtual bool containsOpaque() const + { + return contains([](const TType* t) { return t->isOpaque(); } ); + } + + virtual bool containsSampler() const + { + return contains([](const TType* t) { return t->isTexture() || t->isImage(); }); + } + + // Recursively checks if the type contains a built-in variable + virtual bool containsBuiltIn() const + { + return contains([](const TType* t) { return t->isBuiltIn(); } ); + } + + virtual bool containsNonOpaque() const + { + if (isTensorARM()) { + // Tensors have a numerical basicType even though it is Opaque + return false; + } + + const auto nonOpaque = [](const TType* t) { + switch (t->basicType) { + case EbtVoid: + case EbtFloat: + case EbtDouble: + case EbtFloat16: + case EbtBFloat16: + case EbtFloatE5M2: + case EbtFloatE4M3: + case EbtInt8: + case EbtUint8: + case EbtInt16: + case EbtUint16: + case EbtInt: + case EbtUint: + case EbtInt64: + case EbtUint64: + case EbtBool: + case EbtReference: + return true; + default: + return false; + } + }; + + return contains(nonOpaque); + } + + virtual bool containsSpecializationSize() const + { + return contains([](const TType* t) { return t->isArray() && t->arraySizes->isOuterSpecialization(); } ); + } + + bool containsDouble() const + { + return containsBasicType(EbtDouble); + } + bool contains16BitFloat() const + { + return containsBasicType(EbtFloat16); + } + bool containsBFloat16() const + { + return containsBasicType(EbtBFloat16); + } + bool contains8BitFloat() const + { + return containsBasicType(EbtFloatE5M2) || containsBasicType(EbtFloatE4M3); + } + bool contains64BitInt() const + { + return containsBasicType(EbtInt64) || containsBasicType(EbtUint64); + } + bool contains16BitInt() const + { + return containsBasicType(EbtInt16) || containsBasicType(EbtUint16); + } + bool contains8BitInt() const + { + return containsBasicType(EbtInt8) || containsBasicType(EbtUint8); + } + bool containsCoopMat() const + { + return contains([](const TType* t) { return t->coopmatNV || t->coopmatKHR; } ); + } + bool containsCoopVec() const + { + return contains([](const TType* t) { return t->coopvecNV; } ); + } + bool containsReference() const + { + return containsBasicType(EbtReference); + } + + // Array editing methods. Array descriptors can be shared across + // type instances. This allows all uses of the same array + // to be updated at once. E.g., all nodes can be explicitly sized + // by tracking and correcting one implicit size. Or, all nodes + // can get the explicit size on a redeclaration that gives size. + // + // N.B.: Don't share with the shared symbol tables (symbols are + // marked as isReadOnly(). Such symbols with arrays that will be + // edited need to copyUp() on first use, so that + // A) the edits don't effect the shared symbol table, and + // B) the edits are shared across all users. + void updateArraySizes(const TType& type) + { + // For when we may already be sharing existing array descriptors, + // keeping the pointers the same, just updating the contents. + assert(arraySizes != nullptr); + assert(type.arraySizes != nullptr); + *arraySizes = *type.arraySizes; + } + void copyArraySizes(const TArraySizes& s) + { + // For setting a fresh new set of array sizes, not yet worrying about sharing. + arraySizes = new TArraySizes; + *arraySizes = s; + } + void transferArraySizes(TArraySizes* s) + { + // For setting an already allocated set of sizes that this type can use + // (no copy made). + arraySizes = s; + } + void clearArraySizes() + { + arraySizes = nullptr; + } + + // Add inner array sizes, to any existing sizes, via copy; the + // sizes passed in can still be reused for other purposes. + void copyArrayInnerSizes(const TArraySizes* s) + { + if (s != nullptr) { + if (arraySizes == nullptr) + copyArraySizes(*s); + else + arraySizes->addInnerSizes(*s); + } + } + void changeOuterArraySize(int s) { arraySizes->changeOuterSize(s); } + + // Recursively make the implicit array size the explicit array size. + // Expicit arrays are compile-time or link-time sized, never run-time sized. + // Sometimes, policy calls for an array to be run-time sized even if it was + // never variably indexed: Don't turn a 'skipNonvariablyIndexed' array into + // an explicit array. + void adoptImplicitArraySizes(bool skipNonvariablyIndexed) + { + if (isUnsizedArray() && + (qualifier.builtIn == EbvSampleMask || + !(skipNonvariablyIndexed || isArrayVariablyIndexed()))) { + changeOuterArraySize(getImplicitArraySize()); + setImplicitlySized(true); + } + // For multi-dim per-view arrays, set unsized inner dimension size to 1 + if (qualifier.isPerView() && arraySizes && arraySizes->isInnerUnsized()) + arraySizes->clearInnerUnsized(); + if (isStruct() && structure->size() > 0) { + int lastMember = (int)structure->size() - 1; + for (int i = 0; i < lastMember; ++i) + (*structure)[i].type->adoptImplicitArraySizes(false); + // implement the "last member of an SSBO" policy + (*structure)[lastMember].type->adoptImplicitArraySizes(getQualifier().storage == EvqBuffer); + } + } + + void copyTypeParameters(const TTypeParameters& s) + { + // For setting a fresh new set of type parameters, not yet worrying about sharing. + typeParameters = new TTypeParameters; + *typeParameters = s; + } + + const char* getBasicString() const + { + return TType::getBasicString(basicType); + } + + static const char* getBasicString(TBasicType t) + { + switch (t) { + case EbtFloat: return "float"; + case EbtInt: return "int"; + case EbtUint: return "uint"; + case EbtSampler: return "sampler/image"; + case EbtVoid: return "void"; + case EbtDouble: return "double"; + case EbtFloat16: return "float16_t"; + case EbtBFloat16: return "bfloat16_t"; + case EbtFloatE5M2: return "floate5m2_t"; + case EbtFloatE4M3: return "floate4m3_t"; + case EbtInt8: return "int8_t"; + case EbtUint8: return "uint8_t"; + case EbtInt16: return "int16_t"; + case EbtUint16: return "uint16_t"; + case EbtInt64: return "int64_t"; + case EbtUint64: return "uint64_t"; + case EbtBool: return "bool"; + case EbtAtomicUint: return "atomic_uint"; + case EbtStruct: return "structure"; + case EbtBlock: return "block"; + case EbtAccStruct: return "accelerationStructureNV"; + case EbtRayQuery: return "rayQueryEXT"; + case EbtReference: return "reference"; + case EbtString: return "string"; + case EbtSpirvType: return "spirv_type"; + case EbtCoopmat: return "coopmat"; + case EbtTensorLayoutNV: return "tensorLayoutNV"; + case EbtTensorViewNV: return "tensorViewNV"; + case EbtCoopvecNV: return "coopvecNV"; + case EbtTensorARM: return "tensorARM"; + default: return "unknown type"; + } + } + + TString getCompleteString(bool syntactic = false, bool getQualifiers = true, bool getPrecision = true, + bool getType = true, TString name = "", TString structName = "") const + { + TString typeString; + + const auto appendStr = [&](const char* s) { typeString.append(s); }; + const auto appendUint = [&](unsigned int u) { typeString.append(std::to_string(u).c_str()); }; + const auto appendInt = [&](int i) { typeString.append(std::to_string(i).c_str()); }; + + if (getQualifiers) { + if (qualifier.hasSpirvDecorate()) + appendStr(qualifier.getSpirvDecorateQualifierString().c_str()); + + if (qualifier.hasLayout()) { + // To reduce noise, skip this if the only layout is an xfb_buffer + // with no triggering xfb_offset. + TQualifier noXfbBuffer = qualifier; + noXfbBuffer.layoutXfbBuffer = TQualifier::layoutXfbBufferEnd; + if (noXfbBuffer.hasLayout()) { + appendStr("layout("); + if (qualifier.hasAnyLocation()) { + appendStr(" location="); + appendUint(qualifier.layoutLocation); + if (qualifier.hasComponent()) { + appendStr(" component="); + appendUint(qualifier.layoutComponent); + } + if (qualifier.hasIndex()) { + appendStr(" index="); + appendUint(qualifier.layoutIndex); + } + } + if (qualifier.hasSet()) { + appendStr(" set="); + appendUint(qualifier.layoutSet); + } + if (qualifier.hasBinding()) { + appendStr(" binding="); + appendUint(qualifier.layoutBinding); + } + if (qualifier.hasStream()) { + appendStr(" stream="); + appendUint(qualifier.layoutStream); + } + if (qualifier.hasMatrix()) { + appendStr(" "); + appendStr(TQualifier::getLayoutMatrixString(qualifier.layoutMatrix)); + } + if (qualifier.hasPacking()) { + appendStr(" "); + appendStr(TQualifier::getLayoutPackingString(qualifier.layoutPacking)); + } + if (qualifier.hasOffset()) { + appendStr(" offset="); + appendInt(qualifier.layoutOffset); + } + if (qualifier.hasAlign()) { + appendStr(" align="); + appendInt(qualifier.layoutAlign); + } + if (qualifier.hasFormat()) { + appendStr(" "); + appendStr(TQualifier::getLayoutFormatString(qualifier.layoutFormat)); + } + if (qualifier.hasXfbBuffer() && qualifier.hasXfbOffset()) { + appendStr(" xfb_buffer="); + appendUint(qualifier.layoutXfbBuffer); + } + if (qualifier.hasXfbOffset()) { + appendStr(" xfb_offset="); + appendUint(qualifier.layoutXfbOffset); + } + if (qualifier.hasXfbStride()) { + appendStr(" xfb_stride="); + appendUint(qualifier.layoutXfbStride); + } + if (qualifier.hasAttachment()) { + appendStr(" input_attachment_index="); + appendUint(qualifier.layoutAttachment); + } + if (qualifier.hasSpecConstantId()) { + appendStr(" constant_id="); + appendUint(qualifier.layoutSpecConstantId); + } + if (qualifier.layoutPushConstant) + appendStr(" push_constant"); + if (qualifier.layoutBufferReference) + appendStr(" buffer_reference"); + if (qualifier.hasBufferReferenceAlign()) { + appendStr(" buffer_reference_align="); + appendUint(1u << qualifier.layoutBufferReferenceAlign); + } + + if (qualifier.layoutPassthrough) + appendStr(" passthrough"); + if (qualifier.layoutViewportRelative) + appendStr(" layoutViewportRelative"); + if (qualifier.layoutSecondaryViewportRelativeOffset != -2048) { + appendStr(" layoutSecondaryViewportRelativeOffset="); + appendInt(qualifier.layoutSecondaryViewportRelativeOffset); + } + + if (qualifier.layoutShaderRecord) + appendStr(" shaderRecordNV"); + if (qualifier.layoutFullQuads) + appendStr(" full_quads"); + if (qualifier.layoutQuadDeriv) + appendStr(" quad_derivatives"); + if (qualifier.layoutHitObjectShaderRecordNV) + appendStr(" hitobjectshaderrecordnv"); + if (qualifier.layoutHitObjectShaderRecordEXT) + appendStr(" hitobjectshaderrecordext"); + + if (qualifier.layoutBindlessSampler) + appendStr(" layoutBindlessSampler"); + if (qualifier.layoutBindlessImage) + appendStr(" layoutBindlessImage"); + + appendStr(")"); + } + } + + if (qualifier.invariant) + appendStr(" invariant"); + if (qualifier.noContraction) + appendStr(" noContraction"); + if (qualifier.centroid) + appendStr(" centroid"); + if (qualifier.smooth) + appendStr(" smooth"); + if (qualifier.flat) + appendStr(" flat"); + if (qualifier.nopersp) + appendStr(" noperspective"); + if (qualifier.explicitInterp) + appendStr(" __explicitInterpAMD"); + if (qualifier.pervertexNV) + appendStr(" pervertexNV"); + if (qualifier.pervertexEXT) + appendStr(" pervertexEXT"); + if (qualifier.perPrimitiveNV) + appendStr(" perprimitiveNV"); + if (qualifier.perViewNV) + appendStr(" perviewNV"); + if (qualifier.perTaskNV) + appendStr(" taskNV"); + if (qualifier.patch) + appendStr(" patch"); + if (qualifier.sample) + appendStr(" sample"); + if (qualifier.coherent) + appendStr(" coherent"); + if (qualifier.devicecoherent) + appendStr(" devicecoherent"); + if (qualifier.queuefamilycoherent) + appendStr(" queuefamilycoherent"); + if (qualifier.workgroupcoherent) + appendStr(" workgroupcoherent"); + if (qualifier.subgroupcoherent) + appendStr(" subgroupcoherent"); + if (qualifier.shadercallcoherent) + appendStr(" shadercallcoherent"); + if (qualifier.nonprivate) + appendStr(" nonprivate"); + if (qualifier.volatil) + appendStr(" volatile"); + if (qualifier.nontemporal) + appendStr(" nontemporal"); + if (qualifier.restrict) + appendStr(" restrict"); + if (qualifier.readonly) + appendStr(" readonly"); + if (qualifier.writeonly) + appendStr(" writeonly"); + if (qualifier.specConstant) + appendStr(" specialization-constant"); + if (qualifier.nonUniform) + appendStr(" nonuniform"); + if (qualifier.isNullInit()) + appendStr(" null-init"); + if (qualifier.isSpirvByReference()) + appendStr(" spirv_by_reference"); + if (qualifier.isSpirvLiteral()) + appendStr(" spirv_literal"); + appendStr(" "); + appendStr(getStorageQualifierString()); + } + if (getType) { + if (syntactic) { + if (getPrecision && qualifier.precision != EpqNone) { + appendStr(" "); + appendStr(getPrecisionQualifierString()); + } + if (isVector() || isMatrix()) { + appendStr(" "); + switch (basicType) { + case EbtDouble: + appendStr("d"); + break; + case EbtInt: + appendStr("i"); + break; + case EbtUint: + appendStr("u"); + break; + case EbtBool: + appendStr("b"); + break; + case EbtFloat: + default: + break; + } + if (isVector()) { + appendStr("vec"); + appendInt(vectorSize); + } else { + appendStr("mat"); + appendInt(matrixCols); + appendStr("x"); + appendInt(matrixRows); + } + } else if (isStruct() && structure) { + appendStr(" "); + appendStr(structName.c_str()); + appendStr("{"); + bool hasHiddenMember = true; + for (size_t i = 0; i < structure->size(); ++i) { + if (!(*structure)[i].type->hiddenMember()) { + if (!hasHiddenMember) + appendStr(", "); + typeString.append((*structure)[i].type->getCompleteString(syntactic, getQualifiers, getPrecision, getType, (*structure)[i].type->getFieldName())); + hasHiddenMember = false; + } + } + appendStr("}"); + } else { + appendStr(" "); + switch (basicType) { + case EbtDouble: + appendStr("double"); + break; + case EbtInt: + appendStr("int"); + break; + case EbtUint: + appendStr("uint"); + break; + case EbtBool: + appendStr("bool"); + break; + case EbtFloat: + appendStr("float"); + break; + default: + appendStr("unexpected"); + break; + } + } + if (name.length() > 0) { + appendStr(" "); + appendStr(name.c_str()); + } + if (isArray()) { + for (int i = 0; i < (int)arraySizes->getNumDims(); ++i) { + int size = arraySizes->getDimSize(i); + if (size == UnsizedArraySize && i == 0 && arraySizes->isVariablyIndexed()) + appendStr("[]"); + else { + if (size == UnsizedArraySize) { + appendStr("["); + if (i == 0) + appendInt(arraySizes->getImplicitSize()); + appendStr("]"); + } + else { + appendStr("["); + appendInt(arraySizes->getDimSize(i)); + appendStr("]"); + } + } + } + } + } + else { + if (isArray()) { + for (int i = 0; i < (int)arraySizes->getNumDims(); ++i) { + int size = arraySizes->getDimSize(i); + if (size == UnsizedArraySize && i == 0 && arraySizes->isVariablyIndexed()) + appendStr(" runtime-sized array of"); + else { + if (size == UnsizedArraySize) { + appendStr(" unsized"); + if (i == 0) { + appendStr(" "); + appendInt(arraySizes->getImplicitSize()); + } + } + else { + appendStr(" "); + appendInt(arraySizes->getDimSize(i)); + } + appendStr("-element array of"); + } + } + } + if (isParameterized()) { + if (isCoopMatKHR()) { + appendStr(" "); + appendStr("coopmat"); + } + if (isTensorLayoutNV()) { + appendStr(" "); + appendStr("tensorLayoutNV"); + } + if (isTensorViewNV()) { + appendStr(" "); + appendStr("tensorViewNV"); + } + if (isCoopVecNV()) { + appendStr(" "); + appendStr("coopvecNV"); + } + + appendStr("<"); + for (int i = 0; i < (int)typeParameters->arraySizes->getNumDims(); ++i) { + appendInt(typeParameters->arraySizes->getDimSize(i)); + if (i != (int)typeParameters->arraySizes->getNumDims() - 1) + appendStr(", "); + } + appendStr(">"); + } + if (getPrecision && qualifier.precision != EpqNone) { + appendStr(" "); + appendStr(getPrecisionQualifierString()); + } + if (isMatrix()) { + appendStr(" "); + appendInt(matrixCols); + appendStr("X"); + appendInt(matrixRows); + appendStr(" matrix of"); + } + else if (isVector()) { + appendStr(" "); + appendInt(vectorSize); + appendStr("-component vector of"); + } + + appendStr(" "); + typeString.append(getBasicTypeString()); + + if (qualifier.builtIn != EbvNone) { + appendStr(" "); + appendStr(getBuiltInVariableString()); + } + + // Add struct/block members + if (isStruct() && structure) { + appendStr("{"); + bool hasHiddenMember = true; + for (size_t i = 0; i < structure->size(); ++i) { + if (!(*structure)[i].type->hiddenMember()) { + if (!hasHiddenMember) + appendStr(", "); + typeString.append((*structure)[i].type->getCompleteString()); + typeString.append(" "); + typeString.append((*structure)[i].type->getFieldName()); + hasHiddenMember = false; + } + } + appendStr("}"); + } + } + } + + return typeString; + } + + TString getBasicTypeString() const + { + if (basicType == EbtSampler) + return TString{sampler.getString()}; + else + return getBasicString(); + } + + const char* getStorageQualifierString() const { return GetStorageQualifierString(qualifier.storage); } + const char* getBuiltInVariableString() const { return GetBuiltInVariableString(qualifier.builtIn); } + const char* getPrecisionQualifierString() const { return GetPrecisionQualifierString(qualifier.precision); } + + const TTypeList* getStruct() const { assert(isStruct()); return structure; } + void setStruct(TTypeList* s) { assert(isStruct()); structure = s; } + TTypeList* getWritableStruct() const { assert(isStruct()); return structure; } // This should only be used when known to not be sharing with other threads + void setBasicType(const TBasicType& t) { basicType = t; } + void setVectorSize(int s) { + assert(s >= 0); + vectorSize = static_cast(s) & 0b1111; + } + + int computeNumComponents() const + { + uint32_t components = 0; + + if (isCoopVecNV()) { + components = typeParameters->arraySizes->getDimSize(0); + } else if (getBasicType() == EbtStruct || getBasicType() == EbtBlock) { + for (TTypeList::const_iterator tl = getStruct()->begin(); tl != getStruct()->end(); tl++) + components += ((*tl).type)->computeNumComponents(); + } else if (matrixCols) + components = matrixCols * matrixRows; + else + components = vectorSize; + + if (arraySizes != nullptr) { + components *= arraySizes->getCumulativeSize(); + } + + return static_cast(components); + } + + // append this type's mangled name to the passed in 'name' + void appendMangledName(TString& name) const + { + buildMangledName(name); + name += ';' ; + } + + // These variables are inconsistently declared inside and outside of gl_PerVertex in glslang right now. + // They are declared inside of 'in gl_PerVertex', but sitting as standalone when they are 'out'puts. + bool isInconsistentGLPerVertexMember(const TString& name) const + { + if (name == "gl_SecondaryPositionNV" || + name == "gl_PositionPerViewNV") + return true; + return false; + } + + + // Do two structure types match? They could be declared independently, + // in different places, but still might satisfy the definition of matching. + // From the spec: + // + // "Structures must have the same name, sequence of type names, and + // type definitions, and member names to be considered the same type. + // This rule applies recursively for nested or embedded types." + // + // If type mismatch in structure, return member indices through lpidx and rpidx. + // If matching members for either block are exhausted, return -1 for exhausted + // block and the index of the unmatched member. Otherwise return {-1,-1}. + // + bool sameStructType(const TType& right, int* lpidx = nullptr, int* rpidx = nullptr) const + { + // Initialize error to general type mismatch. + if (lpidx != nullptr) { + *lpidx = -1; + *rpidx = -1; + } + + // Most commonly, they are both nullptr, or the same pointer to the same actual structure + // TODO: Why return true when neither types are structures? + if ((!isStruct() && !right.isStruct()) || + (isStruct() && right.isStruct() && structure == right.structure)) + return true; + + if (!isStruct() || !right.isStruct()) + return false; + + // Structure names have to match + if (*typeName != *right.typeName) + return false; + + // There are inconsistencies with how gl_PerVertex is setup. For now ignore those as errors if they + // are known inconsistencies. + bool isGLPerVertex = *typeName == "gl_PerVertex"; + + // Both being nullptr was caught above, now they both have to be structures of the same number of elements + if (lpidx == nullptr && + (structure->size() != right.structure->size() && !isGLPerVertex)) { + return false; + } + + // Compare the names and types of all the members, which have to match + for (size_t li = 0, ri = 0; li < structure->size() || ri < right.structure->size(); ++li, ++ri) { + if (lpidx != nullptr) { + *lpidx = static_cast(li); + *rpidx = static_cast(ri); + } + if (li < structure->size() && ri < right.structure->size()) { + if ((*structure)[li].type->getFieldName() == (*right.structure)[ri].type->getFieldName()) { + if (*(*structure)[li].type != *(*right.structure)[ri].type) + return false; + } else { + // Skip hidden members + if ((*structure)[li].type->hiddenMember()) { + ri--; + continue; + } else if ((*right.structure)[ri].type->hiddenMember()) { + li--; + continue; + } + // If one of the members is something that's inconsistently declared, skip over it + // for now. + if (isGLPerVertex) { + if (isInconsistentGLPerVertexMember((*structure)[li].type->getFieldName())) { + ri--; + continue; + } else if (isInconsistentGLPerVertexMember((*right.structure)[ri].type->getFieldName())) { + li--; + continue; + } + } else { + return false; + } + } + // If we get here, then there should only be inconsistently declared members left + } else if (li < structure->size()) { + if (!(*structure)[li].type->hiddenMember() && !isInconsistentGLPerVertexMember((*structure)[li].type->getFieldName())) { + if (lpidx != nullptr) { + *rpidx = -1; + } + return false; + } + } else { + if (!(*right.structure)[ri].type->hiddenMember() && !isInconsistentGLPerVertexMember((*right.structure)[ri].type->getFieldName())) { + if (lpidx != nullptr) { + *lpidx = -1; + } + return false; + } + } + } + + return true; + } + + bool sameReferenceType(const TType& right) const + { + if (isReference() != right.isReference()) + return false; + + if (!isReference() && !right.isReference()) + return true; + + assert(referentType != nullptr); + assert(right.referentType != nullptr); + + if (referentType == right.referentType) + return true; + + return *referentType == *right.referentType; + } + + // See if two types match, in all aspects except arrayness + // If mismatch in structure members, return member indices in lpidx and rpidx. + bool sameElementType(const TType& right, int* lpidx = nullptr, int* rpidx = nullptr) const + { + if (lpidx != nullptr) { + *lpidx = -1; + *rpidx = -1; + } + return basicType == right.basicType && sameElementShape(right, lpidx, rpidx); + } + + // See if two type's arrayness match + bool sameArrayness(const TType& right) const + { + return ((arraySizes == nullptr && right.arraySizes == nullptr) || + (arraySizes != nullptr && right.arraySizes != nullptr && + (*arraySizes == *right.arraySizes || + (arraySizes->isImplicitlySized() && right.arraySizes->isDefaultImplicitlySized()) || + (right.arraySizes->isImplicitlySized() && arraySizes->isDefaultImplicitlySized())))); + } + + // See if two type's arrayness match in everything except their outer dimension + bool sameInnerArrayness(const TType& right) const + { + assert(arraySizes != nullptr && right.arraySizes != nullptr); + return arraySizes->sameInnerArrayness(*right.arraySizes); + } + + // See if two type's parameters match + bool sameTypeParameters(const TType& right) const + { + return ((typeParameters == nullptr && right.typeParameters == nullptr) || + (typeParameters != nullptr && right.typeParameters != nullptr && *typeParameters == *right.typeParameters)); + } + + // See if two type's SPIR-V type contents match + bool sameSpirvType(const TType& right) const + { + return ((spirvType == nullptr && right.spirvType == nullptr) || + (spirvType != nullptr && right.spirvType != nullptr && *spirvType == *right.spirvType)); + } + + // See if two type's elements match in all ways except basic type + // If mismatch in structure members, return member indices in lpidx and rpidx. + bool sameElementShape(const TType& right, int* lpidx = nullptr, int* rpidx = nullptr) const + { + if (lpidx != nullptr) { + *lpidx = -1; + *rpidx = -1; + } + return ((basicType != EbtSampler && right.basicType != EbtSampler) || sampler == right.sampler) && + vectorSize == right.vectorSize && + matrixCols == right.matrixCols && + matrixRows == right.matrixRows && + vector1 == right.vector1 && + isCoopMatNV() == right.isCoopMatNV() && + isCoopMatKHR() == right.isCoopMatKHR() && + isCoopVecNV() == right.isCoopVecNV() && + isTensorARM() == right.isTensorARM() && + sameStructType(right, lpidx, rpidx) && + sameReferenceType(right); + } + + // See if a cooperative matrix type parameter with unspecified parameters is + // an OK function parameter + bool coopMatParameterOK(const TType& right) const + { + if (isCoopMatNV()) { + return right.isCoopMatNV() && (getBasicType() == right.getBasicType()) && typeParameters == nullptr && + right.typeParameters != nullptr; + } + if (isCoopMatKHR() && right.isCoopMatKHR()) { + return ((getBasicType() == right.getBasicType()) || (getBasicType() == EbtCoopmat) || + (right.getBasicType() == EbtCoopmat)) && + ((typeParameters == nullptr && right.typeParameters != nullptr) || + (typeParameters != nullptr && right.typeParameters == nullptr)); + } + return false; + } + + // See if a cooperative vector type parameter with unspecified parameters is + // an OK function parameter + bool coopVecParameterOK(const TType& right) const + { + if (isCoopVecNV() && right.isCoopVecNV()) { + return ((getBasicType() == right.getBasicType()) || (getBasicType() == EbtCoopvecNV) || + (right.getBasicType() == EbtCoopvecNV)) && + typeParameters == nullptr && right.typeParameters != nullptr; + } + return false; + } + + bool sameCoopMatBaseType(const TType &right) const { + bool rv = false; + + if (isCoopMatNV()) { + rv = isCoopMatNV() && right.isCoopMatNV(); + if (getBasicType() == EbtFloat || getBasicType() == EbtFloat16) + rv = right.getBasicType() == EbtFloat || right.getBasicType() == EbtFloat16; + else if (getBasicType() == EbtUint || getBasicType() == EbtUint8 || getBasicType() == EbtUint16) + rv = right.getBasicType() == EbtUint || right.getBasicType() == EbtUint8 || right.getBasicType() == EbtUint16; + else if (getBasicType() == EbtInt || getBasicType() == EbtInt8 || getBasicType() == EbtInt16) + rv = right.getBasicType() == EbtInt || right.getBasicType() == EbtInt8 || right.getBasicType() == EbtInt16; + else + rv = false; + } else if (isCoopMatKHR() && right.isCoopMatKHR()) { + if (isFloatingDomain()) + rv = right.isFloatingDomain() || right.getBasicType() == EbtCoopmat; + else if (getBasicType() == EbtUint || getBasicType() == EbtUint8 || getBasicType() == EbtUint16) + rv = right.getBasicType() == EbtUint || right.getBasicType() == EbtUint8 || right.getBasicType() == EbtUint16 || right.getBasicType() == EbtCoopmat; + else if (getBasicType() == EbtInt || getBasicType() == EbtInt8 || getBasicType() == EbtInt16) + rv = right.getBasicType() == EbtInt || right.getBasicType() == EbtInt8 || right.getBasicType() == EbtInt16 || right.getBasicType() == EbtCoopmat; + else + rv = false; + } + return rv; + } + + bool tensorParameterOK(const TType& right) const + { + if (isTensorLayoutNV()) { + return right.isTensorLayoutNV() && right.typeParameters == nullptr && typeParameters != nullptr; + } + if (isTensorViewNV()) { + return right.isTensorViewNV() && right.typeParameters == nullptr && typeParameters != nullptr; + } + if (isTensorARM()) { + return right.isTensorARM() && right.typeParameters == nullptr && typeParameters != nullptr; + } + + return false; + } + + bool sameTensorBaseTypeARM(const TType &right) const { + return (typeParameters == nullptr || right.typeParameters == nullptr || + (tensorRankARM == right.tensorRankARM && getBasicType() == right.getBasicType())); + } + + bool sameCoopVecBaseType(const TType &right) const { + bool rv = false; + + if (isCoopVecNV() && right.isCoopVecNV()) { + if (getBasicType() == EbtFloat || getBasicType() == EbtFloat16) + rv = right.getBasicType() == EbtFloat || right.getBasicType() == EbtFloat16 || right.getBasicType() == EbtCoopvecNV; + else if (getBasicType() == EbtUint || getBasicType() == EbtUint8 || getBasicType() == EbtUint16) + rv = right.getBasicType() == EbtUint || right.getBasicType() == EbtUint8 || right.getBasicType() == EbtUint16 || right.getBasicType() == EbtCoopvecNV; + else if (getBasicType() == EbtInt || getBasicType() == EbtInt8 || getBasicType() == EbtInt16) + rv = right.getBasicType() == EbtInt || right.getBasicType() == EbtInt8 || right.getBasicType() == EbtInt16 || right.getBasicType() == EbtCoopvecNV; + else + rv = false; + } + return rv; + } + + bool sameCoopMatUse(const TType &right) const { + return coopmatKHRuse == right.coopmatKHRuse; + } + + bool sameCoopMatShape(const TType &right) const + { + if (!isCoopMat() || !right.isCoopMat() || isCoopMatKHR() != right.isCoopMatKHR()) + return false; + + // Skip bit width type parameter (first array size) for coopmatNV + int firstArrayDimToCompare = isCoopMatNV() ? 1 : 0; + int lastArrayDimToCompare = typeParameters->arraySizes->getNumDims() - (isCoopMatKHR() ? 1 : 0); + for (int i = firstArrayDimToCompare; i < lastArrayDimToCompare; ++i) { + if (typeParameters->arraySizes->getDimSize(i) != right.typeParameters->arraySizes->getDimSize(i)) + return false; + } + return true; + } + + bool sameCoopMatShapeAndUse(const TType &right) const + { + if (!sameCoopMatShape(right)) + return false; + + if (coopmatKHRuse != right.coopmatKHRuse) + return false; + + return true; + } + + // See if two types match in all ways (just the actual type, not qualification) + bool operator==(const TType& right) const + { + return sameElementType(right) && sameArrayness(right) && sameTypeParameters(right) && sameCoopMatUse(right) && sameSpirvType(right); + } + + bool operator!=(const TType& right) const + { + return ! operator==(right); + } + + unsigned int getBufferReferenceAlignment() const + { + if (getBasicType() == glslang::EbtReference) { + return getReferentType()->getQualifier().hasBufferReferenceAlign() ? + (1u << getReferentType()->getQualifier().layoutBufferReferenceAlign) : 16u; + } + return 0; + } + + const TSpirvType& getSpirvType() const { assert(spirvType); return *spirvType; } + +protected: + // Require consumer to pick between deep copy and shallow copy. + TType(const TType& type); + TType& operator=(const TType& type); + + // Recursively copy a type graph, while preserving the graph-like + // quality. That is, don't make more than one copy of a structure that + // gets reused multiple times in the type graph. + void deepCopy(const TType& copyOf, TMap& copiedMap) + { + shallowCopy(copyOf); + + // GL_EXT_spirv_intrinsics + if (copyOf.qualifier.spirvDecorate) { + qualifier.spirvDecorate = new TSpirvDecorate; + *qualifier.spirvDecorate = *copyOf.qualifier.spirvDecorate; + } + + if (copyOf.spirvType) { + spirvType = new TSpirvType; + *spirvType = *copyOf.spirvType; + } + + if (copyOf.arraySizes) { + arraySizes = new TArraySizes; + *arraySizes = *copyOf.arraySizes; + } + + if (copyOf.typeParameters) { + typeParameters = new TTypeParameters; + typeParameters->arraySizes = new TArraySizes; + *typeParameters->arraySizes = *copyOf.typeParameters->arraySizes; + if (copyOf.typeParameters->spirvType) { + *typeParameters->spirvType = *copyOf.typeParameters->spirvType; + } + typeParameters->basicType = copyOf.basicType; + } + + if (copyOf.isStruct() && copyOf.structure) { + auto prevCopy = copiedMap.find(copyOf.structure); + if (prevCopy != copiedMap.end()) + structure = prevCopy->second; + else { + structure = new TTypeList; + copiedMap[copyOf.structure] = structure; + for (unsigned int i = 0; i < copyOf.structure->size(); ++i) { + TTypeLoc typeLoc; + typeLoc.loc = (*copyOf.structure)[i].loc; + typeLoc.type = new TType(); + typeLoc.type->deepCopy(*(*copyOf.structure)[i].type, copiedMap); + structure->push_back(typeLoc); + } + } + } + + if (copyOf.fieldName) + fieldName = NewPoolTString(copyOf.fieldName->c_str()); + if (copyOf.typeName) + typeName = NewPoolTString(copyOf.typeName->c_str()); + } + + + void buildMangledName(TString&) const; + + TBasicType basicType : 8; + uint32_t vectorSize : 4; // 1 means either scalar or 1-component vector; see vector1 to disambiguate. + uint32_t matrixCols : 4; + uint32_t matrixRows : 4; + bool vector1 : 1; // Backward-compatible tracking of a 1-component vector distinguished from a scalar. + // GLSL 4.5 never has a 1-component vector; so this will always be false until such + // functionality is added. + // HLSL does have a 1-component vectors, so this will be true to disambiguate + // from a scalar. + bool coopmatNV : 1; + bool coopmatKHR : 1; + uint32_t coopmatKHRuse : 3; // Accepts one of three values: 0, 1, 2 (gl_MatrixUseA, gl_MatrixUseB, gl_MatrixUseAccumulator) + bool coopmatKHRUseValid : 1; // True if coopmatKHRuse has been set + bool coopvecNV : 1; + bool tileAttachmentQCOM : 1; + uint32_t tensorRankARM : 4; // 0 means not a tensor; non-zero indicates the tensor rank. + TQualifier qualifier; + + TArraySizes* arraySizes; // nullptr unless an array; can be shared across types + // A type can't be both a structure (EbtStruct/EbtBlock) and a reference (EbtReference), so + // conserve space by making these a union + union { + TTypeList* structure; // invalid unless this is a struct; can be shared across types + TType *referentType; // invalid unless this is an EbtReference + }; + TString *fieldName; // for structure field names + TString *typeName; // for structure type name + TSampler sampler; + TTypeParameters *typeParameters;// nullptr unless a parameterized type; can be shared across types + TSpirvType* spirvType; // SPIR-V type defined by spirv_type directive +}; + +} // end namespace glslang +} // end namespace QtShaderTools + +#endif // _TYPES_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/arrays.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/arrays.h new file mode 100644 index 0000000000..e16c3a3aad --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/arrays.h @@ -0,0 +1,375 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// Implement types for tracking GLSL arrays, arrays of arrays, etc. +// + +#ifndef _ARRAYS_INCLUDED +#define _ARRAYS_INCLUDED + +#include + +namespace QtShaderTools { +namespace glslang { + +// This is used to mean there is no size yet (unsized), it is waiting to get a size from somewhere else. +const int UnsizedArraySize = 0; + +class TIntermTyped; +extern bool SameSpecializationConstants(TIntermTyped*, TIntermTyped*); + +// Specialization constants need both a nominal size and a node that defines +// the specialization constant being used. Array types are the same when their +// size and specialization constant nodes are the same. +struct TArraySize { + unsigned int size; + TIntermTyped* node; // nullptr means no specialization constant node + bool operator==(const TArraySize& rhs) const + { + if (size != rhs.size) + return false; + if (node == nullptr || rhs.node == nullptr) + return node == rhs.node; + + return SameSpecializationConstants(node, rhs.node); + } + bool operator!=(const TArraySize& rhs) const { return !(*this == rhs); } +}; + +// +// TSmallArrayVector is used as the container for the set of sizes in TArraySizes. +// It has generic-container semantics, while TArraySizes has array-of-array semantics. +// That is, TSmallArrayVector should be more focused on mechanism and TArraySizes on policy. +// +struct TSmallArrayVector { + // + // TODO: memory: TSmallArrayVector is intended to be smaller. + // Almost all arrays could be handled by two sizes each fitting + // in 16 bits, needing a real vector only in the cases where there + // are more than 3 sizes or a size needing more than 16 bits. + // + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + + TSmallArrayVector() : sizes(nullptr) { } + virtual ~TSmallArrayVector() { dealloc(); } + + // For breaking into two non-shared copies, independently modifiable. + TSmallArrayVector& operator=(const TSmallArrayVector& from) + { + if (from.sizes == nullptr) + sizes = nullptr; + else { + alloc(); + *sizes = *from.sizes; + } + + return *this; + } + + int size() const + { + if (sizes == nullptr) + return 0; + return (int)sizes->size(); + } + + unsigned int frontSize() const + { + assert(sizes != nullptr && sizes->size() > 0); + return sizes->front().size; + } + + TIntermTyped* frontNode() const + { + assert(sizes != nullptr && sizes->size() > 0); + return sizes->front().node; + } + + void changeFront(unsigned int s) + { + assert(sizes != nullptr); + // this should only happen for implicitly sized arrays, not specialization constants + assert(sizes->front().node == nullptr); + sizes->front().size = s; + } + + void push_back(unsigned int e, TIntermTyped* n) + { + alloc(); + TArraySize pair = { e, n }; + sizes->push_back(pair); + } + + void push_back(const TSmallArrayVector& newDims) + { + alloc(); + sizes->insert(sizes->end(), newDims.sizes->begin(), newDims.sizes->end()); + } + + void pop_front() + { + assert(sizes != nullptr && sizes->size() > 0); + if (sizes->size() == 1) + dealloc(); + else + sizes->erase(sizes->begin()); + } + + void pop_back() + { + assert(sizes != nullptr && sizes->size() > 0); + if (sizes->size() == 1) + dealloc(); + else + sizes->resize(sizes->size() - 1); + } + + // 'this' should currently not be holding anything, and copyNonFront + // will make it hold a copy of all but the first element of rhs. + // (This would be useful for making a type that is dereferenced by + // one dimension.) + void copyNonFront(const TSmallArrayVector& rhs) + { + assert(sizes == nullptr); + if (rhs.size() > 1) { + alloc(); + sizes->insert(sizes->begin(), rhs.sizes->begin() + 1, rhs.sizes->end()); + } + } + + unsigned int getDimSize(int i) const + { + assert(sizes != nullptr && (int)sizes->size() > i); + return (*sizes)[i].size; + } + + void setDimSize(int i, unsigned int size) const + { + assert(sizes != nullptr && (int)sizes->size() > i); + assert((*sizes)[i].node == nullptr); + (*sizes)[i].size = size; + } + + TIntermTyped* getDimNode(int i) const + { + assert(sizes != nullptr && (int)sizes->size() > i); + return (*sizes)[i].node; + } + + bool operator==(const TSmallArrayVector& rhs) const + { + if (sizes == nullptr && rhs.sizes == nullptr) + return true; + if (sizes == nullptr || rhs.sizes == nullptr) + return false; + return *sizes == *rhs.sizes; + } + bool operator!=(const TSmallArrayVector& rhs) const { return ! operator==(rhs); } + + const TArraySize& operator[](int index) const + { + assert(sizes && index < (int)sizes->size()); + return (*sizes)[index]; + } + +protected: + TSmallArrayVector(const TSmallArrayVector&); + + void alloc() + { + if (sizes == nullptr) + sizes = new TVector; + } + void dealloc() + { + delete sizes; + sizes = nullptr; + } + + TVector* sizes; // will either hold such a pointer, or in the future, hold the two array sizes +}; + +// +// Represent an array, or array of arrays, to arbitrary depth. This is not +// done through a hierarchy of types in a type tree, rather all contiguous arrayness +// in the type hierarchy is localized into this single cumulative object. +// +// The arrayness in TTtype is a pointer, so that it can be non-allocated and zero +// for the vast majority of types that are non-array types. +// +// Order Policy: these are all identical: +// - left to right order within a contiguous set of ...[..][..][..]... in the source language +// - index order 0, 1, 2, ... within the 'sizes' member below +// - outer-most to inner-most +// +struct TArraySizes { + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + + TArraySizes() : implicitArraySize(0), implicitlySized(true), variablyIndexed(false){ } + + // For breaking into two non-shared copies, independently modifiable. + TArraySizes& operator=(const TArraySizes& from) + { + implicitArraySize = from.implicitArraySize; + variablyIndexed = from.variablyIndexed; + sizes = from.sizes; + implicitlySized = from.implicitlySized; + + return *this; + } + + // translate from array-of-array semantics to container semantics + int getNumDims() const { return sizes.size(); } + int getDimSize(int dim) const { return sizes.getDimSize(dim); } + TIntermTyped* getDimNode(int dim) const { return sizes.getDimNode(dim); } + void setDimSize(int dim, int size) { sizes.setDimSize(dim, size); } + int getOuterSize() const { return sizes.frontSize(); } + TIntermTyped* getOuterNode() const { return sizes.frontNode(); } + int getCumulativeSize() const + { + int size = 1; + for (int d = 0; d < sizes.size(); ++d) { + // this only makes sense in paths that have a known array size + assert(sizes.getDimSize(d) != UnsizedArraySize); + size *= sizes.getDimSize(d); + } + return size; + } + void addInnerSize() { addInnerSize((unsigned)UnsizedArraySize); } + void addInnerSize(int s) { addInnerSize((unsigned)s, nullptr); } + void addInnerSize(int s, TIntermTyped* n) { sizes.push_back((unsigned)s, n); } + void addInnerSize(TArraySize pair) { + sizes.push_back(pair.size, pair.node); + implicitlySized = false; + } + void addInnerSizes(const TArraySizes& s) { sizes.push_back(s.sizes); } + void changeOuterSize(int s) { + sizes.changeFront((unsigned)s); + implicitlySized = false; + } + int getImplicitSize() const { return implicitArraySize > 0 ? implicitArraySize : 1; } + void updateImplicitSize(int s) { + implicitArraySize = (std::max)(implicitArraySize, s); + } + bool isInnerUnsized() const + { + for (int d = 1; d < sizes.size(); ++d) { + if (sizes.getDimSize(d) == (unsigned)UnsizedArraySize) + return true; + } + + return false; + } + bool clearInnerUnsized() + { + for (int d = 1; d < sizes.size(); ++d) { + if (sizes.getDimSize(d) == (unsigned)UnsizedArraySize) + setDimSize(d, 1); + } + + return false; + } + bool isInnerSpecialization() const + { + for (int d = 1; d < sizes.size(); ++d) { + if (sizes.getDimNode(d) != nullptr) + return true; + } + + return false; + } + bool isOuterSpecialization() + { + return sizes.getDimNode(0) != nullptr; + } + + bool hasUnsized() const { return getOuterSize() == UnsizedArraySize || isInnerUnsized(); } + bool isSized() const { return getOuterSize() != UnsizedArraySize; } + bool isImplicitlySized() const { return implicitlySized; } + bool isDefaultImplicitlySized() const { return implicitlySized && implicitArraySize == 0; } + void setImplicitlySized(bool isImplicitSizing) { implicitlySized = isImplicitSizing; } + void dereference() { sizes.pop_front(); } + void removeLastSize() { sizes.pop_back(); } + void copyDereferenced(const TArraySizes& rhs) + { + assert(sizes.size() == 0); + if (rhs.sizes.size() > 1) + sizes.copyNonFront(rhs.sizes); + } + + bool sameInnerArrayness(const TArraySizes& rhs) const + { + if (sizes.size() != rhs.sizes.size()) + return false; + + for (int d = 1; d < sizes.size(); ++d) { + if (sizes.getDimSize(d) != rhs.sizes.getDimSize(d) || + sizes.getDimNode(d) != rhs.sizes.getDimNode(d)) + return false; + } + + return true; + } + const TArraySize& getArraySize(int index) const + { + return sizes[index]; + } + + void setVariablyIndexed() { variablyIndexed = true; } + bool isVariablyIndexed() const { return variablyIndexed; } + + bool operator==(const TArraySizes& rhs) const { return sizes == rhs.sizes; } + bool operator!=(const TArraySizes& rhs) const { return sizes != rhs.sizes; } + +protected: + TSmallArrayVector sizes; + + TArraySizes(const TArraySizes&); + + // For tracking maximum referenced compile-time constant index. + // Applies only to the outer-most dimension. Potentially becomes + // the implicit size of the array, if not variably indexed and + // otherwise legal. + int implicitArraySize; + bool implicitlySized; + bool variablyIndexed; // true if array is indexed with a non compile-time constant +}; + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // _ARRAYS_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/glslang_c_interface.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/glslang_c_interface.h new file mode 100644 index 0000000000..4eec55b582 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/glslang_c_interface.h @@ -0,0 +1,299 @@ +/** + This code is based on the glslang_c_interface implementation by Viktor Latypov +**/ + +/** +BSD 2-Clause License + +Copyright (c) 2019, Viktor Latypov +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +#ifndef GLSLANG_C_IFACE_H_INCLUDED +#define GLSLANG_C_IFACE_H_INCLUDED + +#include +#include + +#include "glslang_c_shader_types.h" +#include "visibility.h" + +typedef struct glslang_shader_s glslang_shader_t; +typedef struct glslang_program_s glslang_program_t; +typedef struct glslang_mapper_s glslang_mapper_t; +typedef struct glslang_resolver_s glslang_resolver_t; + +/* Version counterpart */ +typedef struct glslang_version_s { + int major; + int minor; + int patch; + const char* flavor; +} glslang_version_t; + +/* TLimits counterpart */ +typedef struct glslang_limits_s { + bool non_inductive_for_loops; + bool while_loops; + bool do_while_loops; + bool general_uniform_indexing; + bool general_attribute_matrix_vector_indexing; + bool general_varying_indexing; + bool general_sampler_indexing; + bool general_variable_indexing; + bool general_constant_matrix_vector_indexing; +} glslang_limits_t; + +/* TBuiltInResource counterpart */ +typedef struct glslang_resource_s { + int max_lights; + int max_clip_planes; + int max_texture_units; + int max_texture_coords; + int max_vertex_attribs; + int max_vertex_uniform_components; + int max_varying_floats; + int max_vertex_texture_image_units; + int max_combined_texture_image_units; + int max_texture_image_units; + int max_fragment_uniform_components; + int max_draw_buffers; + int max_vertex_uniform_vectors; + int max_varying_vectors; + int max_fragment_uniform_vectors; + int max_vertex_output_vectors; + int max_fragment_input_vectors; + int min_program_texel_offset; + int max_program_texel_offset; + int max_clip_distances; + int max_compute_work_group_count_x; + int max_compute_work_group_count_y; + int max_compute_work_group_count_z; + int max_compute_work_group_size_x; + int max_compute_work_group_size_y; + int max_compute_work_group_size_z; + int max_compute_uniform_components; + int max_compute_texture_image_units; + int max_compute_image_uniforms; + int max_compute_atomic_counters; + int max_compute_atomic_counter_buffers; + int max_varying_components; + int max_vertex_output_components; + int max_geometry_input_components; + int max_geometry_output_components; + int max_fragment_input_components; + int max_image_units; + int max_combined_image_units_and_fragment_outputs; + int max_combined_shader_output_resources; + int max_image_samples; + int max_vertex_image_uniforms; + int max_tess_control_image_uniforms; + int max_tess_evaluation_image_uniforms; + int max_geometry_image_uniforms; + int max_fragment_image_uniforms; + int max_combined_image_uniforms; + int max_geometry_texture_image_units; + int max_geometry_output_vertices; + int max_geometry_total_output_components; + int max_geometry_uniform_components; + int max_geometry_varying_components; + int max_tess_control_input_components; + int max_tess_control_output_components; + int max_tess_control_texture_image_units; + int max_tess_control_uniform_components; + int max_tess_control_total_output_components; + int max_tess_evaluation_input_components; + int max_tess_evaluation_output_components; + int max_tess_evaluation_texture_image_units; + int max_tess_evaluation_uniform_components; + int max_tess_patch_components; + int max_patch_vertices; + int max_tess_gen_level; + int max_viewports; + int max_vertex_atomic_counters; + int max_tess_control_atomic_counters; + int max_tess_evaluation_atomic_counters; + int max_geometry_atomic_counters; + int max_fragment_atomic_counters; + int max_combined_atomic_counters; + int max_atomic_counter_bindings; + int max_vertex_atomic_counter_buffers; + int max_tess_control_atomic_counter_buffers; + int max_tess_evaluation_atomic_counter_buffers; + int max_geometry_atomic_counter_buffers; + int max_fragment_atomic_counter_buffers; + int max_combined_atomic_counter_buffers; + int max_atomic_counter_buffer_size; + int max_transform_feedback_buffers; + int max_transform_feedback_interleaved_components; + int max_cull_distances; + int max_combined_clip_and_cull_distances; + int max_samples; + int max_mesh_output_vertices_nv; + int max_mesh_output_primitives_nv; + int max_mesh_work_group_size_x_nv; + int max_mesh_work_group_size_y_nv; + int max_mesh_work_group_size_z_nv; + int max_task_work_group_size_x_nv; + int max_task_work_group_size_y_nv; + int max_task_work_group_size_z_nv; + int max_mesh_view_count_nv; + int max_mesh_output_vertices_ext; + int max_mesh_output_primitives_ext; + int max_mesh_work_group_size_x_ext; + int max_mesh_work_group_size_y_ext; + int max_mesh_work_group_size_z_ext; + int max_task_work_group_size_x_ext; + int max_task_work_group_size_y_ext; + int max_task_work_group_size_z_ext; + int max_mesh_view_count_ext; + union + { + int max_dual_source_draw_buffers_ext; + + /* Incorrectly capitalized name retained for backward compatibility */ + int maxDualSourceDrawBuffersEXT; + }; + + glslang_limits_t limits; +} glslang_resource_t; + +/* Inclusion result structure allocated by C include_local/include_system callbacks */ +typedef struct glsl_include_result_s { + /* Header file name or NULL if inclusion failed */ + const char* header_name; + + /* Header contents or NULL */ + const char* header_data; + size_t header_length; + +} glsl_include_result_t; + +/* Callback for local file inclusion */ +typedef glsl_include_result_t* (*glsl_include_local_func)(void* ctx, const char* header_name, const char* includer_name, + size_t include_depth); + +/* Callback for system file inclusion */ +typedef glsl_include_result_t* (*glsl_include_system_func)(void* ctx, const char* header_name, + const char* includer_name, size_t include_depth); + +/* Callback for include result destruction */ +typedef int (*glsl_free_include_result_func)(void* ctx, glsl_include_result_t* result); + +/* Collection of callbacks for GLSL preprocessor */ +typedef struct glsl_include_callbacks_s { + glsl_include_system_func include_system; + glsl_include_local_func include_local; + glsl_free_include_result_func free_include_result; +} glsl_include_callbacks_t; + +typedef struct glslang_input_s { + glslang_source_t language; + glslang_stage_t stage; + glslang_client_t client; + glslang_target_client_version_t client_version; + glslang_target_language_t target_language; + glslang_target_language_version_t target_language_version; + /** Shader source code */ + const char* code; + int default_version; + glslang_profile_t default_profile; + int force_default_version_and_profile; + int forward_compatible; + glslang_messages_t messages; + const glslang_resource_t* resource; + glsl_include_callbacks_t callbacks; + void* callbacks_ctx; +} glslang_input_t; + +/* SpvOptions counterpart */ +typedef struct glslang_spv_options_s { + bool generate_debug_info; + bool strip_debug_info; + bool disable_optimizer; + bool optimize_size; + bool disassemble; + bool validate; + bool emit_nonsemantic_shader_debug_info; + bool emit_nonsemantic_shader_debug_source; + bool compile_only; + bool optimize_allow_expanded_id_bound; +} glslang_spv_options_t; + +#ifdef __cplusplus +extern "C" { +#endif + +GLSLANG_EXPORT void glslang_get_version(glslang_version_t* version); + +GLSLANG_EXPORT int glslang_initialize_process(void); +GLSLANG_EXPORT void glslang_finalize_process(void); + +GLSLANG_EXPORT glslang_shader_t* glslang_shader_create(const glslang_input_t* input); +GLSLANG_EXPORT void glslang_shader_delete(glslang_shader_t* shader); +GLSLANG_EXPORT void glslang_shader_set_preamble(glslang_shader_t* shader, const char* s); +GLSLANG_EXPORT void glslang_shader_set_entry_point(glslang_shader_t* shader, const char* s); +GLSLANG_EXPORT void glslang_shader_set_invert_y(glslang_shader_t* shader, bool y); +GLSLANG_EXPORT void glslang_shader_shift_binding(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base); +GLSLANG_EXPORT void glslang_shader_shift_binding_for_set(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base, unsigned int set); +GLSLANG_EXPORT void glslang_shader_set_options(glslang_shader_t* shader, int options); // glslang_shader_options_t +GLSLANG_EXPORT void glslang_shader_set_glsl_version(glslang_shader_t* shader, int version); +GLSLANG_EXPORT void glslang_shader_set_default_uniform_block_set_and_binding(glslang_shader_t* shader, unsigned int set, unsigned int binding); +GLSLANG_EXPORT void glslang_shader_set_default_uniform_block_name(glslang_shader_t* shader, const char *name); +GLSLANG_EXPORT void glslang_shader_set_resource_set_binding(glslang_shader_t* shader, const char *const *bindings, unsigned int num_bindings); +GLSLANG_EXPORT int glslang_shader_preprocess(glslang_shader_t* shader, const glslang_input_t* input); +GLSLANG_EXPORT int glslang_shader_parse(glslang_shader_t* shader, const glslang_input_t* input); +GLSLANG_EXPORT const char* glslang_shader_get_preprocessed_code(glslang_shader_t* shader); +GLSLANG_EXPORT void glslang_shader_set_preprocessed_code(glslang_shader_t* shader, const char* code); +GLSLANG_EXPORT const char* glslang_shader_get_info_log(glslang_shader_t* shader); +GLSLANG_EXPORT const char* glslang_shader_get_info_debug_log(glslang_shader_t* shader); + +GLSLANG_EXPORT glslang_program_t* glslang_program_create(void); +GLSLANG_EXPORT void glslang_program_delete(glslang_program_t* program); +GLSLANG_EXPORT void glslang_program_add_shader(glslang_program_t* program, glslang_shader_t* shader); +GLSLANG_EXPORT int glslang_program_link(glslang_program_t* program, int messages); // glslang_messages_t +GLSLANG_EXPORT void glslang_program_add_source_text(glslang_program_t* program, glslang_stage_t stage, const char* text, size_t len); +GLSLANG_EXPORT void glslang_program_set_source_file(glslang_program_t* program, glslang_stage_t stage, const char* file); +GLSLANG_EXPORT int glslang_program_map_io(glslang_program_t* program); +GLSLANG_EXPORT int glslang_program_map_io_with_resolver_and_mapper(glslang_program_t* program, glslang_resolver_t* resolver, glslang_mapper_t* mapper); +GLSLANG_EXPORT void glslang_program_SPIRV_generate(glslang_program_t* program, glslang_stage_t stage); +GLSLANG_EXPORT void glslang_program_SPIRV_generate_with_options(glslang_program_t* program, glslang_stage_t stage, glslang_spv_options_t* spv_options); +GLSLANG_EXPORT size_t glslang_program_SPIRV_get_size(glslang_program_t* program); +GLSLANG_EXPORT void glslang_program_SPIRV_get(glslang_program_t* program, unsigned int*); +GLSLANG_EXPORT unsigned int* glslang_program_SPIRV_get_ptr(glslang_program_t* program); +GLSLANG_EXPORT const char* glslang_program_SPIRV_get_messages(glslang_program_t* program); +GLSLANG_EXPORT const char* glslang_program_get_info_log(glslang_program_t* program); +GLSLANG_EXPORT const char* glslang_program_get_info_debug_log(glslang_program_t* program); + +GLSLANG_EXPORT glslang_mapper_t* glslang_glsl_mapper_create(void); +GLSLANG_EXPORT void glslang_glsl_mapper_delete(glslang_mapper_t* mapper); + +GLSLANG_EXPORT glslang_resolver_t* glslang_glsl_resolver_create(glslang_program_t* program, glslang_stage_t stage); +GLSLANG_EXPORT void glslang_glsl_resolver_delete(glslang_resolver_t* resolver); + +#ifdef __cplusplus +} +#endif + +#endif /* #ifdef GLSLANG_C_IFACE_INCLUDED */ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/glslang_c_shader_types.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/glslang_c_shader_types.h new file mode 100644 index 0000000000..ccba2fde6c --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/glslang_c_shader_types.h @@ -0,0 +1,235 @@ +/** + This code is based on the glslang_c_interface implementation by Viktor Latypov +**/ + +/** +BSD 2-Clause License + +Copyright (c) 2019, Viktor Latypov +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +#ifndef C_SHADER_TYPES_H_INCLUDED +#define C_SHADER_TYPES_H_INCLUDED + +#define LAST_ELEMENT_MARKER(x) x + +/* EShLanguage counterpart */ +typedef enum { + GLSLANG_STAGE_VERTEX, + GLSLANG_STAGE_TESSCONTROL, + GLSLANG_STAGE_TESSEVALUATION, + GLSLANG_STAGE_GEOMETRY, + GLSLANG_STAGE_FRAGMENT, + GLSLANG_STAGE_COMPUTE, + GLSLANG_STAGE_RAYGEN, + GLSLANG_STAGE_RAYGEN_NV = GLSLANG_STAGE_RAYGEN, + GLSLANG_STAGE_INTERSECT, + GLSLANG_STAGE_INTERSECT_NV = GLSLANG_STAGE_INTERSECT, + GLSLANG_STAGE_ANYHIT, + GLSLANG_STAGE_ANYHIT_NV = GLSLANG_STAGE_ANYHIT, + GLSLANG_STAGE_CLOSESTHIT, + GLSLANG_STAGE_CLOSESTHIT_NV = GLSLANG_STAGE_CLOSESTHIT, + GLSLANG_STAGE_MISS, + GLSLANG_STAGE_MISS_NV = GLSLANG_STAGE_MISS, + GLSLANG_STAGE_CALLABLE, + GLSLANG_STAGE_CALLABLE_NV = GLSLANG_STAGE_CALLABLE, + GLSLANG_STAGE_TASK, + GLSLANG_STAGE_TASK_NV = GLSLANG_STAGE_TASK, + GLSLANG_STAGE_MESH, + GLSLANG_STAGE_MESH_NV = GLSLANG_STAGE_MESH, + LAST_ELEMENT_MARKER(GLSLANG_STAGE_COUNT), +} glslang_stage_t; // would be better as stage, but this is ancient now + +/* EShLanguageMask counterpart */ +typedef enum { + GLSLANG_STAGE_VERTEX_MASK = (1 << GLSLANG_STAGE_VERTEX), + GLSLANG_STAGE_TESSCONTROL_MASK = (1 << GLSLANG_STAGE_TESSCONTROL), + GLSLANG_STAGE_TESSEVALUATION_MASK = (1 << GLSLANG_STAGE_TESSEVALUATION), + GLSLANG_STAGE_GEOMETRY_MASK = (1 << GLSLANG_STAGE_GEOMETRY), + GLSLANG_STAGE_FRAGMENT_MASK = (1 << GLSLANG_STAGE_FRAGMENT), + GLSLANG_STAGE_COMPUTE_MASK = (1 << GLSLANG_STAGE_COMPUTE), + GLSLANG_STAGE_RAYGEN_MASK = (1 << GLSLANG_STAGE_RAYGEN), + GLSLANG_STAGE_RAYGEN_NV_MASK = GLSLANG_STAGE_RAYGEN_MASK, + GLSLANG_STAGE_INTERSECT_MASK = (1 << GLSLANG_STAGE_INTERSECT), + GLSLANG_STAGE_INTERSECT_NV_MASK = GLSLANG_STAGE_INTERSECT_MASK, + GLSLANG_STAGE_ANYHIT_MASK = (1 << GLSLANG_STAGE_ANYHIT), + GLSLANG_STAGE_ANYHIT_NV_MASK = GLSLANG_STAGE_ANYHIT_MASK, + GLSLANG_STAGE_CLOSESTHIT_MASK = (1 << GLSLANG_STAGE_CLOSESTHIT), + GLSLANG_STAGE_CLOSESTHIT_NV_MASK = GLSLANG_STAGE_CLOSESTHIT_MASK, + GLSLANG_STAGE_MISS_MASK = (1 << GLSLANG_STAGE_MISS), + GLSLANG_STAGE_MISS_NV_MASK = GLSLANG_STAGE_MISS_MASK, + GLSLANG_STAGE_CALLABLE_MASK = (1 << GLSLANG_STAGE_CALLABLE), + GLSLANG_STAGE_CALLABLE_NV_MASK = GLSLANG_STAGE_CALLABLE_MASK, + GLSLANG_STAGE_TASK_MASK = (1 << GLSLANG_STAGE_TASK), + GLSLANG_STAGE_TASK_NV_MASK = GLSLANG_STAGE_TASK_MASK, + GLSLANG_STAGE_MESH_MASK = (1 << GLSLANG_STAGE_MESH), + GLSLANG_STAGE_MESH_NV_MASK = GLSLANG_STAGE_MESH_MASK, + LAST_ELEMENT_MARKER(GLSLANG_STAGE_MASK_COUNT), +} glslang_stage_mask_t; + +/* EShSource counterpart */ +typedef enum { + GLSLANG_SOURCE_NONE, + GLSLANG_SOURCE_GLSL, + GLSLANG_SOURCE_HLSL, + LAST_ELEMENT_MARKER(GLSLANG_SOURCE_COUNT), +} glslang_source_t; + +/* EShClient counterpart */ +typedef enum { + GLSLANG_CLIENT_NONE, + GLSLANG_CLIENT_VULKAN, + GLSLANG_CLIENT_OPENGL, + LAST_ELEMENT_MARKER(GLSLANG_CLIENT_COUNT), +} glslang_client_t; + +/* EShTargetLanguage counterpart */ +typedef enum { + GLSLANG_TARGET_NONE, + GLSLANG_TARGET_SPV, + LAST_ELEMENT_MARKER(GLSLANG_TARGET_COUNT), +} glslang_target_language_t; + +/* SH_TARGET_ClientVersion counterpart */ +typedef enum { + GLSLANG_TARGET_VULKAN_1_0 = (1 << 22), + GLSLANG_TARGET_VULKAN_1_1 = (1 << 22) | (1 << 12), + GLSLANG_TARGET_VULKAN_1_2 = (1 << 22) | (2 << 12), + GLSLANG_TARGET_VULKAN_1_3 = (1 << 22) | (3 << 12), + GLSLANG_TARGET_VULKAN_1_4 = (1 << 22) | (4 << 12), + GLSLANG_TARGET_OPENGL_450 = 450, + LAST_ELEMENT_MARKER(GLSLANG_TARGET_CLIENT_VERSION_COUNT = 6), +} glslang_target_client_version_t; + +/* SH_TARGET_LanguageVersion counterpart */ +typedef enum { + GLSLANG_TARGET_SPV_1_0 = (1 << 16), + GLSLANG_TARGET_SPV_1_1 = (1 << 16) | (1 << 8), + GLSLANG_TARGET_SPV_1_2 = (1 << 16) | (2 << 8), + GLSLANG_TARGET_SPV_1_3 = (1 << 16) | (3 << 8), + GLSLANG_TARGET_SPV_1_4 = (1 << 16) | (4 << 8), + GLSLANG_TARGET_SPV_1_5 = (1 << 16) | (5 << 8), + GLSLANG_TARGET_SPV_1_6 = (1 << 16) | (6 << 8), + LAST_ELEMENT_MARKER(GLSLANG_TARGET_LANGUAGE_VERSION_COUNT = 7), +} glslang_target_language_version_t; + +/* EShExecutable counterpart */ +typedef enum { GLSLANG_EX_VERTEX_FRAGMENT, GLSLANG_EX_FRAGMENT } glslang_executable_t; + +// EShOptimizationLevel counterpart +// This enum is not used in the current C interface, but could be added at a later date. +// GLSLANG_OPT_NONE is the current default. +typedef enum { + GLSLANG_OPT_NO_GENERATION, + GLSLANG_OPT_NONE, + GLSLANG_OPT_SIMPLE, + GLSLANG_OPT_FULL, + LAST_ELEMENT_MARKER(GLSLANG_OPT_LEVEL_COUNT), +} glslang_optimization_level_t; + +/* EShTextureSamplerTransformMode counterpart */ +typedef enum { + GLSLANG_TEX_SAMP_TRANS_KEEP, + GLSLANG_TEX_SAMP_TRANS_UPGRADE_TEXTURE_REMOVE_SAMPLER, + LAST_ELEMENT_MARKER(GLSLANG_TEX_SAMP_TRANS_COUNT), +} glslang_texture_sampler_transform_mode_t; + +/* EShMessages counterpart */ +typedef enum { + GLSLANG_MSG_DEFAULT_BIT = 0, + GLSLANG_MSG_RELAXED_ERRORS_BIT = (1 << 0), + GLSLANG_MSG_SUPPRESS_WARNINGS_BIT = (1 << 1), + GLSLANG_MSG_AST_BIT = (1 << 2), + GLSLANG_MSG_SPV_RULES_BIT = (1 << 3), + GLSLANG_MSG_VULKAN_RULES_BIT = (1 << 4), + GLSLANG_MSG_ONLY_PREPROCESSOR_BIT = (1 << 5), + GLSLANG_MSG_READ_HLSL_BIT = (1 << 6), + GLSLANG_MSG_CASCADING_ERRORS_BIT = (1 << 7), + GLSLANG_MSG_KEEP_UNCALLED_BIT = (1 << 8), + GLSLANG_MSG_HLSL_OFFSETS_BIT = (1 << 9), + GLSLANG_MSG_DEBUG_INFO_BIT = (1 << 10), + GLSLANG_MSG_HLSL_ENABLE_16BIT_TYPES_BIT = (1 << 11), + GLSLANG_MSG_HLSL_LEGALIZATION_BIT = (1 << 12), + GLSLANG_MSG_HLSL_DX9_COMPATIBLE_BIT = (1 << 13), + GLSLANG_MSG_BUILTIN_SYMBOL_TABLE_BIT = (1 << 14), + GLSLANG_MSG_ENHANCED = (1 << 15), + GLSLANG_MSG_ABSOLUTE_PATH = (1 << 16), + GLSLANG_MSG_DISPLAY_ERROR_COLUMN = (1 << 17), + GLSLANG_MSG_LINK_TIME_OPTIMIZATION_BIT = (1 << 18), + GLSLANG_MSG_VALIDATE_CROSS_STAGE_IO_BIT = (1 << 19), + LAST_ELEMENT_MARKER(GLSLANG_MSG_COUNT), +} glslang_messages_t; + +/* EShReflectionOptions counterpart */ +typedef enum { + GLSLANG_REFLECTION_DEFAULT_BIT = 0, + GLSLANG_REFLECTION_STRICT_ARRAY_SUFFIX_BIT = (1 << 0), + GLSLANG_REFLECTION_BASIC_ARRAY_SUFFIX_BIT = (1 << 1), + GLSLANG_REFLECTION_INTERMEDIATE_IOO_BIT = (1 << 2), + GLSLANG_REFLECTION_SEPARATE_BUFFERS_BIT = (1 << 3), + GLSLANG_REFLECTION_ALL_BLOCK_VARIABLES_BIT = (1 << 4), + GLSLANG_REFLECTION_UNWRAP_IO_BLOCKS_BIT = (1 << 5), + GLSLANG_REFLECTION_ALL_IO_VARIABLES_BIT = (1 << 6), + GLSLANG_REFLECTION_SHARED_STD140_SSBO_BIT = (1 << 7), + GLSLANG_REFLECTION_SHARED_STD140_UBO_BIT = (1 << 8), + LAST_ELEMENT_MARKER(GLSLANG_REFLECTION_COUNT), +} glslang_reflection_options_t; + +/* EProfile counterpart (from Versions.h) */ +typedef enum { + GLSLANG_BAD_PROFILE = 0, + GLSLANG_NO_PROFILE = (1 << 0), + GLSLANG_CORE_PROFILE = (1 << 1), + GLSLANG_COMPATIBILITY_PROFILE = (1 << 2), + GLSLANG_ES_PROFILE = (1 << 3), + LAST_ELEMENT_MARKER(GLSLANG_PROFILE_COUNT), +} glslang_profile_t; + +/* Shader options */ +typedef enum { + GLSLANG_SHADER_DEFAULT_BIT = 0, + GLSLANG_SHADER_AUTO_MAP_BINDINGS = (1 << 0), + GLSLANG_SHADER_AUTO_MAP_LOCATIONS = (1 << 1), + GLSLANG_SHADER_VULKAN_RULES_RELAXED = (1 << 2), + LAST_ELEMENT_MARKER(GLSLANG_SHADER_COUNT), +} glslang_shader_options_t; + +/* TResourceType counterpart */ +typedef enum { + GLSLANG_RESOURCE_TYPE_SAMPLER, + GLSLANG_RESOURCE_TYPE_TEXTURE, + GLSLANG_RESOURCE_TYPE_IMAGE, + GLSLANG_RESOURCE_TYPE_UBO, + GLSLANG_RESOURCE_TYPE_SSBO, + GLSLANG_RESOURCE_TYPE_UAV, + GLSLANG_RESOURCE_TYPE_COMBINED_SAMPLER, + GLSLANG_RESOURCE_TYPE_AS, + GLSLANG_RESOURCE_TYPE_TENSOR, + LAST_ELEMENT_MARKER(GLSLANG_RESOURCE_TYPE_COUNT), +} glslang_resource_type_t; + +#undef LAST_ELEMENT_MARKER + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/intermediate.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/intermediate.h new file mode 100644 index 0000000000..7518b24da9 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/intermediate.h @@ -0,0 +1,1911 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2016 LunarG, Inc. +// Copyright (C) 2017, 2022-2024 Arm Limited. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// Definition of the in-memory high-level intermediate representation +// of shaders. This is a tree that parser creates. +// +// Nodes in the tree are defined as a hierarchy of classes derived from +// TIntermNode. Each is a node in a tree. There is no preset branching factor; +// each node can have it's own type of list of children. +// + +#ifndef __INTERMEDIATE_H +#define __INTERMEDIATE_H + +#include "Common.h" +#include "Types.h" +#include "ConstantUnion.h" + +namespace QtShaderTools { +namespace glslang { + +class TIntermediate; + +// +// Operators used by the high-level (parse tree) representation. +// +enum TOperator { + EOpNull, // if in a node, should only mean a node is still being built + EOpSequence, // denotes a list of statements, or parameters, etc. + EOpScope, // Used by debugging to denote a scoped list of statements + EOpLinkerObjects, // for aggregate node of objects the linker may need, if not reference by the rest of the AST + EOpFunctionCall, + EOpFunction, // For function definition + EOpParameters, // an aggregate listing the parameters to a function + EOpSpirvInst, + + // + // Unary operators + // + + EOpNegative, + EOpLogicalNot, + EOpVectorLogicalNot, + EOpBitwiseNot, + + EOpPostIncrement, + EOpPostDecrement, + EOpPreIncrement, + EOpPreDecrement, + + EOpCopyObject, + + EOpDeclare, // Used by debugging to force declaration of variable in correct scope + + // Operator used to represent all conversions between int, float, and bool. + // The specific types are inferred from TBasicType. + EOpConvNumeric, + + // uint64_t <-> pointer + EOpConvUint64ToPtr, + EOpConvPtrToUint64, + + // uvec2 <-> pointer + EOpConvUvec2ToPtr, + EOpConvPtrToUvec2, + + // uint64_t -> accelerationStructureEXT + EOpConvUint64ToAccStruct, + + // uvec2 -> accelerationStructureEXT + EOpConvUvec2ToAccStruct, + + // + // binary operations + // + + EOpAdd, + EOpSub, + EOpMul, + EOpDiv, + EOpMod, + EOpRightShift, + EOpLeftShift, + EOpAnd, + EOpInclusiveOr, + EOpExclusiveOr, + EOpEqual, + EOpNotEqual, + EOpVectorEqual, + EOpVectorNotEqual, + EOpLessThan, + EOpGreaterThan, + EOpLessThanEqual, + EOpGreaterThanEqual, + EOpComma, + + EOpVectorTimesScalar, + EOpVectorTimesMatrix, + EOpMatrixTimesVector, + EOpMatrixTimesScalar, + + EOpLogicalOr, + EOpLogicalXor, + EOpLogicalAnd, + + EOpIndexDirect, + EOpIndexIndirect, + EOpIndexDirectStruct, + + EOpVectorSwizzle, + + EOpMethod, + EOpScoping, + + // + // Built-in functions mapped to operators + // + + EOpRadians, + EOpDegrees, + EOpSin, + EOpCos, + EOpTan, + EOpAsin, + EOpAcos, + EOpAtan, + EOpSinh, + EOpCosh, + EOpTanh, + EOpAsinh, + EOpAcosh, + EOpAtanh, + + EOpPow, + EOpExp, + EOpLog, + EOpExp2, + EOpLog2, + EOpSqrt, + EOpInverseSqrt, + + EOpAbs, + EOpSign, + EOpFloor, + EOpTrunc, + EOpRound, + EOpRoundEven, + EOpCeil, + EOpFract, + EOpModf, + EOpMin, + EOpMax, + EOpClamp, + EOpMix, + EOpStep, + EOpSmoothStep, + + EOpIsNan, + EOpIsInf, + + EOpFma, + + EOpFrexp, + EOpLdexp, + + EOpFloatBitsToInt, + EOpFloatBitsToUint, + EOpIntBitsToFloat, + EOpUintBitsToFloat, + EOpDoubleBitsToInt64, + EOpDoubleBitsToUint64, + EOpInt64BitsToDouble, + EOpUint64BitsToDouble, + EOpFloat16BitsToInt16, + EOpFloat16BitsToUint16, + EOpInt16BitsToFloat16, + EOpUint16BitsToFloat16, + EOpPackSnorm2x16, + EOpUnpackSnorm2x16, + EOpPackUnorm2x16, + EOpUnpackUnorm2x16, + EOpPackSnorm4x8, + EOpUnpackSnorm4x8, + EOpPackUnorm4x8, + EOpUnpackUnorm4x8, + EOpPackHalf2x16, + EOpUnpackHalf2x16, + EOpPackDouble2x32, + EOpUnpackDouble2x32, + EOpPackInt2x32, + EOpUnpackInt2x32, + EOpPackUint2x32, + EOpUnpackUint2x32, + EOpPackFloat2x16, + EOpUnpackFloat2x16, + EOpPackInt2x16, + EOpUnpackInt2x16, + EOpPackUint2x16, + EOpUnpackUint2x16, + EOpPackInt4x16, + EOpUnpackInt4x16, + EOpPackUint4x16, + EOpUnpackUint4x16, + EOpPack16, + EOpPack32, + EOpPack64, + EOpUnpack32, + EOpUnpack16, + EOpUnpack8, + + EOpLength, + EOpDistance, + EOpDot, + EOpCross, + EOpNormalize, + EOpFaceForward, + EOpReflect, + EOpRefract, + + EOpMin3, + EOpMax3, + EOpMid3, + + EOpDPdx, // Fragment only + EOpDPdy, // Fragment only + EOpFwidth, // Fragment only + EOpDPdxFine, // Fragment only + EOpDPdyFine, // Fragment only + EOpFwidthFine, // Fragment only + EOpDPdxCoarse, // Fragment only + EOpDPdyCoarse, // Fragment only + EOpFwidthCoarse, // Fragment only + + EOpInterpolateAtCentroid, // Fragment only + EOpInterpolateAtSample, // Fragment only + EOpInterpolateAtOffset, // Fragment only + EOpInterpolateAtVertex, + + EOpMatrixTimesMatrix, + EOpOuterProduct, + EOpDeterminant, + EOpMatrixInverse, + EOpTranspose, + + EOpFtransform, + + EOpNoise, + + EOpEmitVertex, // geometry only + EOpEndPrimitive, // geometry only + EOpEmitStreamVertex, // geometry only + EOpEndStreamPrimitive, // geometry only + + EOpBarrier, + EOpMemoryBarrier, + EOpMemoryBarrierAtomicCounter, + EOpMemoryBarrierBuffer, + EOpMemoryBarrierImage, + EOpMemoryBarrierShared, // compute only + EOpGroupMemoryBarrier, // compute only + + EOpBallot, + EOpReadInvocation, + EOpReadFirstInvocation, + + EOpAnyInvocation, + EOpAllInvocations, + EOpAllInvocationsEqual, + + EOpSubgroupGuardStart, + EOpSubgroupBarrier, + EOpSubgroupMemoryBarrier, + EOpSubgroupMemoryBarrierBuffer, + EOpSubgroupMemoryBarrierImage, + EOpSubgroupMemoryBarrierShared, // compute only + EOpSubgroupElect, + EOpSubgroupAll, + EOpSubgroupAny, + EOpSubgroupAllEqual, + EOpSubgroupBroadcast, + EOpSubgroupBroadcastFirst, + EOpSubgroupBallot, + EOpSubgroupInverseBallot, + EOpSubgroupBallotBitExtract, + EOpSubgroupBallotBitCount, + EOpSubgroupBallotInclusiveBitCount, + EOpSubgroupBallotExclusiveBitCount, + EOpSubgroupBallotFindLSB, + EOpSubgroupBallotFindMSB, + EOpSubgroupShuffle, + EOpSubgroupShuffleXor, + EOpSubgroupShuffleUp, + EOpSubgroupShuffleDown, + EOpSubgroupRotate, + EOpSubgroupClusteredRotate, + EOpSubgroupAdd, + EOpSubgroupMul, + EOpSubgroupMin, + EOpSubgroupMax, + EOpSubgroupAnd, + EOpSubgroupOr, + EOpSubgroupXor, + EOpSubgroupInclusiveAdd, + EOpSubgroupInclusiveMul, + EOpSubgroupInclusiveMin, + EOpSubgroupInclusiveMax, + EOpSubgroupInclusiveAnd, + EOpSubgroupInclusiveOr, + EOpSubgroupInclusiveXor, + EOpSubgroupExclusiveAdd, + EOpSubgroupExclusiveMul, + EOpSubgroupExclusiveMin, + EOpSubgroupExclusiveMax, + EOpSubgroupExclusiveAnd, + EOpSubgroupExclusiveOr, + EOpSubgroupExclusiveXor, + EOpSubgroupClusteredAdd, + EOpSubgroupClusteredMul, + EOpSubgroupClusteredMin, + EOpSubgroupClusteredMax, + EOpSubgroupClusteredAnd, + EOpSubgroupClusteredOr, + EOpSubgroupClusteredXor, + EOpSubgroupQuadBroadcast, + EOpSubgroupQuadSwapHorizontal, + EOpSubgroupQuadSwapVertical, + EOpSubgroupQuadSwapDiagonal, + EOpSubgroupQuadAll, + EOpSubgroupQuadAny, + + EOpSubgroupPartition, + EOpSubgroupPartitionedAdd, + EOpSubgroupPartitionedMul, + EOpSubgroupPartitionedMin, + EOpSubgroupPartitionedMax, + EOpSubgroupPartitionedAnd, + EOpSubgroupPartitionedOr, + EOpSubgroupPartitionedXor, + EOpSubgroupPartitionedInclusiveAdd, + EOpSubgroupPartitionedInclusiveMul, + EOpSubgroupPartitionedInclusiveMin, + EOpSubgroupPartitionedInclusiveMax, + EOpSubgroupPartitionedInclusiveAnd, + EOpSubgroupPartitionedInclusiveOr, + EOpSubgroupPartitionedInclusiveXor, + EOpSubgroupPartitionedExclusiveAdd, + EOpSubgroupPartitionedExclusiveMul, + EOpSubgroupPartitionedExclusiveMin, + EOpSubgroupPartitionedExclusiveMax, + EOpSubgroupPartitionedExclusiveAnd, + EOpSubgroupPartitionedExclusiveOr, + EOpSubgroupPartitionedExclusiveXor, + + EOpSubgroupGuardStop, + + // Integer dot product + EOpDotPackedEXT, + EOpDotAccSatEXT, + EOpDotPackedAccSatEXT, + + EOpMinInvocations, + EOpMaxInvocations, + EOpAddInvocations, + EOpMinInvocationsNonUniform, + EOpMaxInvocationsNonUniform, + EOpAddInvocationsNonUniform, + EOpMinInvocationsInclusiveScan, + EOpMaxInvocationsInclusiveScan, + EOpAddInvocationsInclusiveScan, + EOpMinInvocationsInclusiveScanNonUniform, + EOpMaxInvocationsInclusiveScanNonUniform, + EOpAddInvocationsInclusiveScanNonUniform, + EOpMinInvocationsExclusiveScan, + EOpMaxInvocationsExclusiveScan, + EOpAddInvocationsExclusiveScan, + EOpMinInvocationsExclusiveScanNonUniform, + EOpMaxInvocationsExclusiveScanNonUniform, + EOpAddInvocationsExclusiveScanNonUniform, + EOpSwizzleInvocations, + EOpSwizzleInvocationsMasked, + EOpWriteInvocation, + EOpMbcnt, + + EOpCubeFaceIndex, + EOpCubeFaceCoord, + EOpTime, + + EOpAtomicAdd, + EOpAtomicSubtract, + EOpAtomicMin, + EOpAtomicMax, + EOpAtomicAnd, + EOpAtomicOr, + EOpAtomicXor, + EOpAtomicExchange, + EOpAtomicCompSwap, + EOpAtomicLoad, + EOpAtomicStore, + + EOpAtomicCounterIncrement, // results in pre-increment value + EOpAtomicCounterDecrement, // results in post-decrement value + EOpAtomicCounter, + EOpAtomicCounterAdd, + EOpAtomicCounterSubtract, + EOpAtomicCounterMin, + EOpAtomicCounterMax, + EOpAtomicCounterAnd, + EOpAtomicCounterOr, + EOpAtomicCounterXor, + EOpAtomicCounterExchange, + EOpAtomicCounterCompSwap, + + EOpAny, + EOpAll, + + EOpCooperativeMatrixLoad, + EOpCooperativeMatrixStore, + EOpCooperativeMatrixMulAdd, + EOpCooperativeMatrixLoadNV, + EOpCooperativeMatrixStoreNV, + EOpCooperativeMatrixLoadTensorNV, + EOpCooperativeMatrixStoreTensorNV, + EOpCooperativeMatrixMulAddNV, + EOpCooperativeMatrixReduceNV, + EOpCooperativeMatrixPerElementOpNV, + EOpCooperativeMatrixTransposeNV, + + EOpCreateTensorLayoutNV, + EOpTensorLayoutSetBlockSizeNV, + EOpTensorLayoutSetDimensionNV, + EOpTensorLayoutSetStrideNV, + EOpTensorLayoutSliceNV, + EOpTensorLayoutSetClampValueNV, + + EOpCreateTensorViewNV, + EOpTensorViewSetDimensionNV, + EOpTensorViewSetStrideNV, + EOpTensorViewSetClipNV, + + EOpCooperativeVectorMatMulNV, + EOpCooperativeVectorMatMulAddNV, + EOpCooperativeVectorLoadNV, + EOpCooperativeVectorStoreNV, + EOpCooperativeVectorOuterProductAccumulateNV, + EOpCooperativeVectorReduceSumAccumulateNV, + + EOpTensorReadARM, + EOpTensorWriteARM, + EOpTensorSizeARM, + + EOpBeginInvocationInterlock, // Fragment only + EOpEndInvocationInterlock, // Fragment only + + EOpIsHelperInvocation, + + EOpDebugPrintf, + + // + // Branch + // + + EOpKill, // Fragment only + EOpTerminateInvocation, // Fragment only + EOpDemote, // Fragment only + EOpTerminateRayKHR, // Any-hit only + EOpIgnoreIntersectionKHR, // Any-hit only + EOpReturn, + EOpBreak, + EOpContinue, + EOpCase, + EOpDefault, + + // + // Constructors + // + + EOpConstructGuardStart, + EOpConstructInt, // these first scalar forms also identify what implicit conversion is needed + EOpConstructUint, + EOpConstructInt8, + EOpConstructUint8, + EOpConstructInt16, + EOpConstructUint16, + EOpConstructInt64, + EOpConstructUint64, + EOpConstructBool, + EOpConstructFloat, + EOpConstructDouble, + // Keep vector and matrix constructors in a consistent relative order for + // TParseContext::constructBuiltIn, which converts between 8/16/32 bit + // vector constructors + EOpConstructVec2, + EOpConstructVec3, + EOpConstructVec4, + EOpConstructMat2x2, + EOpConstructMat2x3, + EOpConstructMat2x4, + EOpConstructMat3x2, + EOpConstructMat3x3, + EOpConstructMat3x4, + EOpConstructMat4x2, + EOpConstructMat4x3, + EOpConstructMat4x4, + EOpConstructDVec2, + EOpConstructDVec3, + EOpConstructDVec4, + EOpConstructBVec2, + EOpConstructBVec3, + EOpConstructBVec4, + EOpConstructI8Vec2, + EOpConstructI8Vec3, + EOpConstructI8Vec4, + EOpConstructU8Vec2, + EOpConstructU8Vec3, + EOpConstructU8Vec4, + EOpConstructI16Vec2, + EOpConstructI16Vec3, + EOpConstructI16Vec4, + EOpConstructU16Vec2, + EOpConstructU16Vec3, + EOpConstructU16Vec4, + EOpConstructIVec2, + EOpConstructIVec3, + EOpConstructIVec4, + EOpConstructUVec2, + EOpConstructUVec3, + EOpConstructUVec4, + EOpConstructI64Vec2, + EOpConstructI64Vec3, + EOpConstructI64Vec4, + EOpConstructU64Vec2, + EOpConstructU64Vec3, + EOpConstructU64Vec4, + EOpConstructDMat2x2, + EOpConstructDMat2x3, + EOpConstructDMat2x4, + EOpConstructDMat3x2, + EOpConstructDMat3x3, + EOpConstructDMat3x4, + EOpConstructDMat4x2, + EOpConstructDMat4x3, + EOpConstructDMat4x4, + EOpConstructIMat2x2, + EOpConstructIMat2x3, + EOpConstructIMat2x4, + EOpConstructIMat3x2, + EOpConstructIMat3x3, + EOpConstructIMat3x4, + EOpConstructIMat4x2, + EOpConstructIMat4x3, + EOpConstructIMat4x4, + EOpConstructUMat2x2, + EOpConstructUMat2x3, + EOpConstructUMat2x4, + EOpConstructUMat3x2, + EOpConstructUMat3x3, + EOpConstructUMat3x4, + EOpConstructUMat4x2, + EOpConstructUMat4x3, + EOpConstructUMat4x4, + EOpConstructBMat2x2, + EOpConstructBMat2x3, + EOpConstructBMat2x4, + EOpConstructBMat3x2, + EOpConstructBMat3x3, + EOpConstructBMat3x4, + EOpConstructBMat4x2, + EOpConstructBMat4x3, + EOpConstructBMat4x4, + EOpConstructFloat16, + EOpConstructF16Vec2, + EOpConstructF16Vec3, + EOpConstructF16Vec4, + EOpConstructF16Mat2x2, + EOpConstructF16Mat2x3, + EOpConstructF16Mat2x4, + EOpConstructF16Mat3x2, + EOpConstructF16Mat3x3, + EOpConstructF16Mat3x4, + EOpConstructF16Mat4x2, + EOpConstructF16Mat4x3, + EOpConstructF16Mat4x4, + EOpConstructBFloat16, + EOpConstructBF16Vec2, + EOpConstructBF16Vec3, + EOpConstructBF16Vec4, + EOpConstructFloatE5M2, + EOpConstructFloatE5M2Vec2, + EOpConstructFloatE5M2Vec3, + EOpConstructFloatE5M2Vec4, + EOpConstructFloatE4M3, + EOpConstructFloatE4M3Vec2, + EOpConstructFloatE4M3Vec3, + EOpConstructFloatE4M3Vec4, + EOpConstructStruct, + EOpConstructTextureSampler, + EOpConstructNonuniform, // expected to be transformed away, not present in final AST + EOpConstructReference, + EOpConstructCooperativeMatrixNV, + EOpConstructCooperativeMatrixKHR, + EOpConstructCooperativeVectorNV, + EOpConstructAccStruct, + EOpConstructSaturated, + EOpConstructGuardEnd, + + // + // moves + // + + EOpAssign, + EOpAddAssign, + EOpSubAssign, + EOpMulAssign, + EOpVectorTimesMatrixAssign, + EOpVectorTimesScalarAssign, + EOpMatrixTimesScalarAssign, + EOpMatrixTimesMatrixAssign, + EOpDivAssign, + EOpModAssign, + EOpAndAssign, + EOpInclusiveOrAssign, + EOpExclusiveOrAssign, + EOpLeftShiftAssign, + EOpRightShiftAssign, + + // + // Array operators + // + + // Can apply to arrays, vectors, or matrices. + // Can be decomposed to a constant at compile time, but this does not always happen, + // due to link-time effects. So, consumer can expect either a link-time sized or + // run-time sized array. + EOpArrayLength, + + // + // Image operations + // + + EOpImageGuardBegin, + + EOpImageQuerySize, + EOpImageQuerySamples, + EOpImageLoad, + EOpImageStore, + EOpImageLoadLod, + EOpImageStoreLod, + EOpImageAtomicAdd, + EOpImageAtomicMin, + EOpImageAtomicMax, + EOpImageAtomicAnd, + EOpImageAtomicOr, + EOpImageAtomicXor, + EOpImageAtomicExchange, + EOpImageAtomicCompSwap, + EOpImageAtomicLoad, + EOpImageAtomicStore, + + EOpSubpassLoad, + EOpSubpassLoadMS, + EOpSparseImageLoad, + EOpSparseImageLoadLod, + EOpColorAttachmentReadEXT, // Fragment only + + EOpImageGuardEnd, + + // + // Texture operations + // + + EOpTextureGuardBegin, + + EOpTextureQuerySize, + EOpTextureQueryLod, + EOpTextureQueryLevels, + EOpTextureQuerySamples, + + EOpSamplingGuardBegin, + + EOpTexture, + EOpTextureProj, + EOpTextureLod, + EOpTextureOffset, + EOpTextureFetch, + EOpTextureFetchOffset, + EOpTextureProjOffset, + EOpTextureLodOffset, + EOpTextureProjLod, + EOpTextureProjLodOffset, + EOpTextureGrad, + EOpTextureGradOffset, + EOpTextureProjGrad, + EOpTextureProjGradOffset, + EOpTextureGather, + EOpTextureGatherOffset, + EOpTextureGatherOffsets, + EOpTextureClamp, + EOpTextureOffsetClamp, + EOpTextureGradClamp, + EOpTextureGradOffsetClamp, + EOpTextureGatherLod, + EOpTextureGatherLodOffset, + EOpTextureGatherLodOffsets, + EOpFragmentMaskFetch, + EOpFragmentFetch, + + EOpSparseTextureGuardBegin, + + EOpSparseTexture, + EOpSparseTextureLod, + EOpSparseTextureOffset, + EOpSparseTextureFetch, + EOpSparseTextureFetchOffset, + EOpSparseTextureLodOffset, + EOpSparseTextureGrad, + EOpSparseTextureGradOffset, + EOpSparseTextureGather, + EOpSparseTextureGatherOffset, + EOpSparseTextureGatherOffsets, + EOpSparseTexelsResident, + EOpSparseTextureClamp, + EOpSparseTextureOffsetClamp, + EOpSparseTextureGradClamp, + EOpSparseTextureGradOffsetClamp, + EOpSparseTextureGatherLod, + EOpSparseTextureGatherLodOffset, + EOpSparseTextureGatherLodOffsets, + + EOpSparseTextureGuardEnd, + + EOpImageFootprintGuardBegin, + EOpImageSampleFootprintNV, + EOpImageSampleFootprintClampNV, + EOpImageSampleFootprintLodNV, + EOpImageSampleFootprintGradNV, + EOpImageSampleFootprintGradClampNV, + EOpImageFootprintGuardEnd, + EOpSamplingGuardEnd, + EOpTextureGuardEnd, + + // + // Integer operations + // + + EOpAddCarry, + EOpSubBorrow, + EOpUMulExtended, + EOpIMulExtended, + EOpBitfieldExtract, + EOpBitfieldInsert, + EOpBitFieldReverse, + EOpBitCount, + EOpFindLSB, + EOpFindMSB, + + EOpCountLeadingZeros, + EOpCountTrailingZeros, + EOpAbsDifference, + EOpAddSaturate, + EOpSubSaturate, + EOpAverage, + EOpAverageRounded, + EOpMul32x16, + + EOpTraceNV, + EOpTraceRayMotionNV, + EOpTraceKHR, + EOpReportIntersection, + EOpIgnoreIntersectionNV, + EOpTerminateRayNV, + EOpExecuteCallableNV, + EOpExecuteCallableKHR, + EOpWritePackedPrimitiveIndices4x8NV, + EOpEmitMeshTasksEXT, + EOpSetMeshOutputsEXT, + + // + // GL_EXT_ray_query operations + // + + EOpRayQueryInitialize, + EOpRayQueryTerminate, + EOpRayQueryGenerateIntersection, + EOpRayQueryConfirmIntersection, + EOpRayQueryProceed, + EOpRayQueryGetIntersectionType, + EOpRayQueryGetRayTMin, + EOpRayQueryGetRayFlags, + EOpRayQueryGetIntersectionT, + EOpRayQueryGetIntersectionInstanceCustomIndex, + EOpRayQueryGetIntersectionInstanceId, + EOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffset, + EOpRayQueryGetIntersectionGeometryIndex, + EOpRayQueryGetIntersectionPrimitiveIndex, + EOpRayQueryGetIntersectionBarycentrics, + EOpRayQueryGetIntersectionFrontFace, + EOpRayQueryGetIntersectionCandidateAABBOpaque, + EOpRayQueryGetIntersectionObjectRayDirection, + EOpRayQueryGetIntersectionObjectRayOrigin, + EOpRayQueryGetWorldRayDirection, + EOpRayQueryGetWorldRayOrigin, + EOpRayQueryGetIntersectionObjectToWorld, + EOpRayQueryGetIntersectionWorldToObject, + + // + // GL_NV_shader_invocation_reorder + // + + EOpHitObjectTraceRayNV, + EOpHitObjectTraceRayMotionNV, + EOpHitObjectRecordHitNV, + EOpHitObjectRecordHitMotionNV, + EOpHitObjectRecordHitWithIndexNV, + EOpHitObjectRecordHitWithIndexMotionNV, + EOpHitObjectRecordMissNV, + EOpHitObjectRecordMissMotionNV, + EOpHitObjectRecordEmptyNV, + EOpHitObjectExecuteShaderNV, + EOpHitObjectIsEmptyNV, + EOpHitObjectIsMissNV, + EOpHitObjectIsHitNV, + EOpHitObjectGetRayTMinNV, + EOpHitObjectGetRayTMaxNV, + EOpHitObjectGetObjectRayOriginNV, + EOpHitObjectGetObjectRayDirectionNV, + EOpHitObjectGetWorldRayOriginNV, + EOpHitObjectGetWorldRayDirectionNV, + EOpHitObjectGetWorldToObjectNV, + EOpHitObjectGetObjectToWorldNV, + EOpHitObjectGetInstanceCustomIndexNV, + EOpHitObjectGetInstanceIdNV, + EOpHitObjectGetGeometryIndexNV, + EOpHitObjectGetPrimitiveIndexNV, + EOpHitObjectGetHitKindNV, + EOpHitObjectGetShaderBindingTableRecordIndexNV, + EOpHitObjectGetShaderRecordBufferHandleNV, + EOpHitObjectGetAttributesNV, + EOpHitObjectGetCurrentTimeNV, + EOpReorderThreadNV, + EOpFetchMicroTriangleVertexPositionNV, + EOpFetchMicroTriangleVertexBarycentricNV, + + // + // GL_EXT_shader_invocation_reorder + // + + EOpHitObjectTraceRayEXT, + EOpHitObjectTraceRayMotionEXT, + EOpHitObjectRecordMissEXT, + EOpHitObjectRecordMissMotionEXT, + EOpHitObjectRecordEmptyEXT, + EOpHitObjectExecuteShaderEXT, + EOpHitObjectIsEmptyEXT, + EOpHitObjectIsMissEXT, + EOpHitObjectIsHitEXT, + EOpHitObjectGetRayTMinEXT, + EOpHitObjectGetRayTMaxEXT, + EOpHitObjectGetRayFlagsEXT, + EOpHitObjectGetObjectRayOriginEXT, + EOpHitObjectGetObjectRayDirectionEXT, + EOpHitObjectGetWorldRayOriginEXT, + EOpHitObjectGetWorldRayDirectionEXT, + EOpHitObjectGetWorldToObjectEXT, + EOpHitObjectGetObjectToWorldEXT, + EOpHitObjectGetInstanceCustomIndexEXT, + EOpHitObjectGetInstanceIdEXT, + EOpHitObjectGetGeometryIndexEXT, + EOpHitObjectGetPrimitiveIndexEXT, + EOpHitObjectGetHitKindEXT, + EOpHitObjectGetShaderBindingTableRecordIndexEXT, + EOpHitObjectSetShaderBindingTableRecordIndexEXT, + EOpHitObjectGetShaderRecordBufferHandleEXT, + EOpHitObjectGetAttributesEXT, + EOpHitObjectGetCurrentTimeEXT, + EOpReorderThreadEXT, + EOpHitObjectReorderExecuteEXT, + EOpHitObjectTraceReorderExecuteEXT, + EOpHitObjectTraceMotionReorderExecuteEXT, + EOpHitObjectRecordFromQueryEXT, + EOpHitObjectGetIntersectionTriangleVertexPositionsEXT, + // HLSL operations + // + + EOpClip, // discard if input value < 0 + EOpIsFinite, + EOpLog10, // base 10 log + EOpRcp, // 1/x + EOpSaturate, // clamp from 0 to 1 + EOpSinCos, // sin and cos in out parameters + EOpGenMul, // mul(x,y) on any of mat/vec/scalars + EOpDst, // x = 1, y=src0.y * src1.y, z=src0.z, w=src1.w + EOpInterlockedAdd, // atomic ops, but uses [optional] out arg instead of return + EOpInterlockedAnd, // ... + EOpInterlockedCompareExchange, // ... + EOpInterlockedCompareStore, // ... + EOpInterlockedExchange, // ... + EOpInterlockedMax, // ... + EOpInterlockedMin, // ... + EOpInterlockedOr, // ... + EOpInterlockedXor, // ... + EOpAllMemoryBarrierWithGroupSync, // memory barriers without non-hlsl AST equivalents + EOpDeviceMemoryBarrier, // ... + EOpDeviceMemoryBarrierWithGroupSync, // ... + EOpWorkgroupMemoryBarrier, // ... + EOpWorkgroupMemoryBarrierWithGroupSync, // ... + EOpEvaluateAttributeSnapped, // InterpolateAtOffset with int position on 16x16 grid + EOpF32tof16, // HLSL conversion: half of a PackHalf2x16 + EOpF16tof32, // HLSL conversion: half of an UnpackHalf2x16 + EOpLit, // HLSL lighting coefficient vector + EOpTextureBias, // HLSL texture bias: will be lowered to EOpTexture + EOpAsDouble, // slightly different from EOpUint64BitsToDouble + EOpD3DCOLORtoUBYTE4, // convert and swizzle 4-component color to UBYTE4 range + + EOpMethodSample, // Texture object methods. These are translated to existing + EOpMethodSampleBias, // AST methods, and exist to represent HLSL semantics until that + EOpMethodSampleCmp, // translation is performed. See HlslParseContext::decomposeSampleMethods(). + EOpMethodSampleCmpLevelZero, // ... + EOpMethodSampleGrad, // ... + EOpMethodSampleLevel, // ... + EOpMethodLoad, // ... + EOpMethodGetDimensions, // ... + EOpMethodGetSamplePosition, // ... + EOpMethodGather, // ... + EOpMethodCalculateLevelOfDetail, // ... + EOpMethodCalculateLevelOfDetailUnclamped, // ... + + // Load already defined above for textures + EOpMethodLoad2, // Structure buffer object methods. These are translated to existing + EOpMethodLoad3, // AST methods, and exist to represent HLSL semantics until that + EOpMethodLoad4, // translation is performed. See HlslParseContext::decomposeSampleMethods(). + EOpMethodStore, // ... + EOpMethodStore2, // ... + EOpMethodStore3, // ... + EOpMethodStore4, // ... + EOpMethodIncrementCounter, // ... + EOpMethodDecrementCounter, // ... + // EOpMethodAppend is defined for geo shaders below + EOpMethodConsume, + + // SM5 texture methods + EOpMethodGatherRed, // These are covered under the above EOpMethodSample comment about + EOpMethodGatherGreen, // translation to existing AST opcodes. They exist temporarily + EOpMethodGatherBlue, // because HLSL arguments are slightly different. + EOpMethodGatherAlpha, // ... + EOpMethodGatherCmp, // ... + EOpMethodGatherCmpRed, // ... + EOpMethodGatherCmpGreen, // ... + EOpMethodGatherCmpBlue, // ... + EOpMethodGatherCmpAlpha, // ... + + // geometry methods + EOpMethodAppend, // Geometry shader methods + EOpMethodRestartStrip, // ... + + // matrix + EOpMatrixSwizzle, // select multiple matrix components (non-column) + + // SM6 wave ops + EOpWaveGetLaneCount, // Will decompose to gl_SubgroupSize. + EOpWaveGetLaneIndex, // Will decompose to gl_SubgroupInvocationID. + EOpWaveActiveCountBits, // Will decompose to subgroupBallotBitCount(subgroupBallot()). + EOpWavePrefixCountBits, // Will decompose to subgroupBallotInclusiveBitCount(subgroupBallot()). + + // GL_EXT_expect_assume + EOpAssumeEXT, + EOpExpectEXT, + + // Shader Clock Ops + EOpReadClockSubgroupKHR, + EOpReadClockDeviceKHR, + + // GL_EXT_ray_tracing_position_fetch + EOpRayQueryGetIntersectionTriangleVertexPositionsEXT, + + // Shader tile image ops + EOpStencilAttachmentReadEXT, // Fragment only + EOpDepthAttachmentReadEXT, // Fragment only + + // Image processing + EOpImageSampleWeightedQCOM, + EOpImageBoxFilterQCOM, + EOpImageBlockMatchSADQCOM, + EOpImageBlockMatchSSDQCOM, + + // Image processing2 + EOpImageBlockMatchWindowSSDQCOM, + EOpImageBlockMatchWindowSADQCOM, + EOpImageBlockMatchGatherSSDQCOM, + EOpImageBlockMatchGatherSADQCOM, + + // Cooperative Matrix Conversion + EOpBitCastArrayQCOM, + EOpExtractSubArrayQCOM, + EOpCompositeConstructCoopMatQCOM, + EOpCompositeExtractCoopMatQCOM, + + // GL_NV_cluster_acceleration_structure + EOpRayQueryGetIntersectionClusterIdNV, + EOpHitObjectGetClusterIdNV, + + // GL_NV_linear_swept_spheres + EOpRayQueryGetIntersectionSpherePositionNV, + EOpRayQueryGetIntersectionSphereRadiusNV, + EOpRayQueryGetIntersectionLSSHitValueNV, + EOpRayQueryGetIntersectionLSSPositionsNV, + EOpRayQueryGetIntersectionLSSRadiiNV, + EOpRayQueryIsSphereHitNV, + EOpRayQueryIsLSSHitNV, + EOpHitObjectGetSpherePositionNV, + EOpHitObjectGetSphereRadiusNV, + EOpHitObjectGetLSSPositionsNV, + EOpHitObjectGetLSSRadiiNV, + EOpHitObjectIsSphereHitNV, + EOpHitObjectIsLSSHitNV, +}; + +inline bool IsOpNumericConv(const TOperator op) { + return op == EOpConvNumeric; +} + +enum TLinkType { + ELinkNone, + ELinkExport, +}; + +class TIntermTraverser; +class TIntermVariableDecl; +class TIntermOperator; +class TIntermAggregate; +class TIntermUnary; +class TIntermBinary; +class TIntermConstantUnion; +class TIntermSelection; +class TIntermSwitch; +class TIntermBranch; +class TIntermTyped; +class TIntermMethod; +class TIntermSymbol; +class TIntermLoop; + +} // end namespace glslang + +// +// Base class for the tree nodes +// +// (Put outside the glslang namespace, as it's used as part of the external interface.) +// +class TIntermNode { +public: + POOL_ALLOCATOR_NEW_DELETE(glslang::GetThreadPoolAllocator()) + + TIntermNode() { loc.init(); } + virtual const glslang::TSourceLoc& getLoc() const { return loc; } + virtual void setLoc(const glslang::TSourceLoc& l) { loc = l; } + virtual void traverse(glslang::TIntermTraverser*) = 0; + virtual glslang::TIntermVariableDecl* getAsVariableDecl() { return nullptr; } + virtual glslang::TIntermTyped* getAsTyped() { return nullptr; } + virtual glslang::TIntermOperator* getAsOperator() { return nullptr; } + virtual glslang::TIntermConstantUnion* getAsConstantUnion() { return nullptr; } + virtual glslang::TIntermAggregate* getAsAggregate() { return nullptr; } + virtual glslang::TIntermUnary* getAsUnaryNode() { return nullptr; } + virtual glslang::TIntermBinary* getAsBinaryNode() { return nullptr; } + virtual glslang::TIntermSelection* getAsSelectionNode() { return nullptr; } + virtual glslang::TIntermSwitch* getAsSwitchNode() { return nullptr; } + virtual glslang::TIntermMethod* getAsMethodNode() { return nullptr; } + virtual glslang::TIntermSymbol* getAsSymbolNode() { return nullptr; } + virtual glslang::TIntermBranch* getAsBranchNode() { return nullptr; } + virtual glslang::TIntermLoop* getAsLoopNode() { return nullptr; } + + virtual const glslang::TIntermVariableDecl* getAsVariableDecl() const { return nullptr; } + virtual const glslang::TIntermTyped* getAsTyped() const { return nullptr; } + virtual const glslang::TIntermOperator* getAsOperator() const { return nullptr; } + virtual const glslang::TIntermConstantUnion* getAsConstantUnion() const { return nullptr; } + virtual const glslang::TIntermAggregate* getAsAggregate() const { return nullptr; } + virtual const glslang::TIntermUnary* getAsUnaryNode() const { return nullptr; } + virtual const glslang::TIntermBinary* getAsBinaryNode() const { return nullptr; } + virtual const glslang::TIntermSelection* getAsSelectionNode() const { return nullptr; } + virtual const glslang::TIntermSwitch* getAsSwitchNode() const { return nullptr; } + virtual const glslang::TIntermMethod* getAsMethodNode() const { return nullptr; } + virtual const glslang::TIntermSymbol* getAsSymbolNode() const { return nullptr; } + virtual const glslang::TIntermBranch* getAsBranchNode() const { return nullptr; } + virtual const glslang::TIntermLoop* getAsLoopNode() const { return nullptr; } + virtual ~TIntermNode() { } + +protected: + TIntermNode(const TIntermNode&); + TIntermNode& operator=(const TIntermNode&); + glslang::TSourceLoc loc; +}; + +namespace glslang { + +// +// This is just to help yacc. +// +struct TIntermNodePair { + TIntermNode* node1; + TIntermNode* node2; +}; + +// +// Represent declaration of a variable. +// +class TIntermVariableDecl : public TIntermNode { +public: + TIntermVariableDecl(TIntermSymbol* declSymbol, TIntermNode* initNode) : declSymbol(declSymbol), initNode(initNode) + { + } + TIntermVariableDecl(const TIntermVariableDecl&) = delete; + TIntermVariableDecl& operator=(const TIntermVariableDecl&) = delete; + + void traverse(glslang::TIntermTraverser* traverser) override; + + TIntermVariableDecl* getAsVariableDecl() override { return this; } + const TIntermVariableDecl* getAsVariableDecl() const override { return this; } + + TIntermSymbol* getDeclSymbol() { return declSymbol; } + const TIntermSymbol* getDeclSymbol() const { return declSymbol; } + + TIntermNode* getInitNode() { return initNode; } + const TIntermNode* getInitNode() const { return initNode; } + +private: + // This symbol represents the declared variable at its declaration point. + // It's not traversed by default. To traverse it, the visitor needs to have includeDeclSymbol enabled. + TIntermSymbol* declSymbol = nullptr; + + // The initializer + TIntermNode* initNode = nullptr; +}; + +// +// Intermediate class for nodes that have a type. +// +class TIntermTyped : public TIntermNode { +public: + TIntermTyped(const TType& t) { type.shallowCopy(t); } + TIntermTyped(TBasicType basicType) { TType bt(basicType); type.shallowCopy(bt); } + virtual TIntermTyped* getAsTyped() { return this; } + virtual const TIntermTyped* getAsTyped() const { return this; } + virtual void setType(const TType& t) { type.shallowCopy(t); } + virtual const TType& getType() const { return type; } + virtual TType& getWritableType() { return type; } + + virtual TBasicType getBasicType() const { return type.getBasicType(); } + virtual TQualifier& getQualifier() { return type.getQualifier(); } + virtual const TQualifier& getQualifier() const { return type.getQualifier(); } + virtual TArraySizes* getArraySizes() { return type.getArraySizes(); } + virtual const TArraySizes* getArraySizes() const { return type.getArraySizes(); } + virtual void propagatePrecision(TPrecisionQualifier); + virtual int getVectorSize() const { return type.getVectorSize(); } + virtual int getMatrixCols() const { return type.getMatrixCols(); } + virtual int getMatrixRows() const { return type.getMatrixRows(); } + virtual int getTensorRankARM() const { return type.getTensorRankARM(); } + virtual bool isMatrix() const { return type.isMatrix(); } + virtual bool isArray() const { return type.isArray(); } + virtual bool isVector() const { return type.isVector(); } + virtual bool isScalar() const { return type.isScalar(); } + virtual bool isStruct() const { return type.isStruct(); } + virtual bool isFloatingDomain() const { return type.isFloatingDomain(); } + virtual bool isIntegerDomain() const { return type.isIntegerDomain(); } + bool isAtomic() const { return type.isAtomic(); } + bool isReference() const { return type.isReference(); } + TString getCompleteString(bool enhanced = false) const { return type.getCompleteString(enhanced); } + +protected: + TIntermTyped& operator=(const TIntermTyped&); + TType type; +}; + +// +// Handle for, do-while, and while loops. +// +class TIntermLoop : public TIntermNode { +public: + TIntermLoop(TIntermNode* aBody, TIntermNode* aTest, TIntermTyped* aTerminal, bool testFirst) : + body(aBody), + test(aTest), + terminal(aTerminal), + first(testFirst), + unroll(false), + dontUnroll(false), + dependency(0), + minIterations(0), + maxIterations(iterationsInfinite), + iterationMultiple(1), + peelCount(0), + partialCount(0) + { } + + virtual TIntermLoop* getAsLoopNode() { return this; } + virtual const TIntermLoop* getAsLoopNode() const { return this; } + virtual void traverse(TIntermTraverser*); + TIntermNode* getBody() const { return body; } + TIntermNode* getTest() const { return test; } + TIntermTyped* getTerminal() const { return terminal; } + bool testFirst() const { return first; } + + // Because the test node can be a declaration in a while loop, this function unwraps it to get the actual expression. + TIntermTyped* getTestExpr() const { + if (auto decl = test->getAsVariableDecl()) { + return decl->getInitNode()->getAsTyped(); + } + else { + return test->getAsTyped(); + } + } + + void setUnroll() { unroll = true; } + void setDontUnroll() { + dontUnroll = true; + peelCount = 0; + partialCount = 0; + } + bool getUnroll() const { return unroll; } + bool getDontUnroll() const { return dontUnroll; } + + static const unsigned int dependencyInfinite = 0xFFFFFFFF; + static const unsigned int iterationsInfinite = 0xFFFFFFFF; + void setLoopDependency(int d) { dependency = d; } + int getLoopDependency() const { return dependency; } + + void setMinIterations(unsigned int v) { minIterations = v; } + unsigned int getMinIterations() const { return minIterations; } + void setMaxIterations(unsigned int v) { maxIterations = v; } + unsigned int getMaxIterations() const { return maxIterations; } + void setIterationMultiple(unsigned int v) { iterationMultiple = v; } + unsigned int getIterationMultiple() const { return iterationMultiple; } + void setPeelCount(unsigned int v) { + peelCount = v; + dontUnroll = false; + } + unsigned int getPeelCount() const { return peelCount; } + void setPartialCount(unsigned int v) { + partialCount = v; + dontUnroll = false; + } + unsigned int getPartialCount() const { return partialCount; } + +protected: + TIntermNode* body; // code to loop over + TIntermNode* test; // exit condition associated with loop, could be 0 for 'for' loops + TIntermTyped* terminal; // exists for for-loops + bool first; // true for while and for, not for do-while + bool unroll; // true if unroll requested + bool dontUnroll; // true if request to not unroll + unsigned int dependency; // loop dependency hint; 0 means not set or unknown + unsigned int minIterations; // as per the SPIR-V specification + unsigned int maxIterations; // as per the SPIR-V specification + unsigned int iterationMultiple; // as per the SPIR-V specification + unsigned int peelCount; // as per the SPIR-V specification + unsigned int partialCount; // as per the SPIR-V specification +}; + +// +// Handle case, break, continue, return, and kill. +// +class TIntermBranch : public TIntermNode { +public: + TIntermBranch(TOperator op, TIntermTyped* e) : + flowOp(op), + expression(e) { } + virtual TIntermBranch* getAsBranchNode() { return this; } + virtual const TIntermBranch* getAsBranchNode() const { return this; } + virtual void traverse(TIntermTraverser*); + TOperator getFlowOp() const { return flowOp; } + TIntermTyped* getExpression() const { return expression; } + void setExpression(TIntermTyped* pExpression) { expression = pExpression; } + void updatePrecision(TPrecisionQualifier parentPrecision); +protected: + TOperator flowOp; + TIntermTyped* expression; +}; + +// +// Represent method names before seeing their calling signature +// or resolving them to operations. Just an expression as the base object +// and a textural name. +// +class TIntermMethod : public TIntermTyped { +public: + TIntermMethod(TIntermTyped* o, const TType& t, const TString& m) : TIntermTyped(t), object(o), method(m) { } + virtual TIntermMethod* getAsMethodNode() { return this; } + virtual const TIntermMethod* getAsMethodNode() const { return this; } + virtual const TString& getMethodName() const { return method; } + virtual TIntermTyped* getObject() const { return object; } + virtual void traverse(TIntermTraverser*); + void setExport() { linkType = ELinkExport; } +protected: + TIntermTyped* object; + TString method; + TLinkType linkType; +}; + +// +// Nodes that correspond to symbols or constants in the source code. +// +class TIntermSymbol : public TIntermTyped { +public: + // if symbol is initialized as symbol(sym), the memory comes from the pool allocator of sym. If sym comes from + // per process threadPoolAllocator, then it causes increased memory usage per compile + // it is essential to use "symbol = sym" to assign to symbol + TIntermSymbol(long long i, const TString& n, EShLanguage s, const TType& t, const TString* mn = nullptr) + : TIntermTyped(t), id(i), flattenSubset(-1), stage(s), constSubtree(nullptr) { + name = n; + if (mn) { + mangledName = *mn; + } else { + mangledName = n; + } + } + virtual long long getId() const { return id; } + virtual void changeId(long long i) { id = i; } + virtual const TString& getName() const { return name; } + virtual const TString& getMangledName() const { return mangledName; } + virtual void traverse(TIntermTraverser*); + virtual TIntermSymbol* getAsSymbolNode() { return this; } + virtual const TIntermSymbol* getAsSymbolNode() const { return this; } + void setConstArray(const TConstUnionArray& c) { constArray = c; } + const TConstUnionArray& getConstArray() const { return constArray; } + void setConstSubtree(TIntermTyped* subtree) { constSubtree = subtree; } + TIntermTyped* getConstSubtree() const { return constSubtree; } + void setFlattenSubset(int subset) { flattenSubset = subset; } + virtual const TString& getAccessName() const; + + int getFlattenSubset() const { return flattenSubset; } // -1 means full object + + // This is meant for cases where a node has already been constructed, and + // later on, it becomes necessary to switch to a different symbol. + virtual void switchId(long long newId) { id = newId; } + EShLanguage getStage() const { return stage; } + +protected: + long long id; // the unique id of the symbol this node represents + int flattenSubset; // how deeply the flattened object rooted at id has been dereferenced + TString name; // the name of the symbol this node represents + EShLanguage stage; + TString mangledName; // mangled function name, or a copy of name if not a function + TConstUnionArray constArray; // if the symbol is a front-end compile-time constant, this is its value + TIntermTyped* constSubtree; +}; + +class TIntermConstantUnion : public TIntermTyped { +public: + TIntermConstantUnion(const TConstUnionArray& ua, const TType& t) : TIntermTyped(t), constArray(ua), literal(false) { } + const TConstUnionArray& getConstArray() const { return constArray; } + virtual TIntermConstantUnion* getAsConstantUnion() { return this; } + virtual const TIntermConstantUnion* getAsConstantUnion() const { return this; } + virtual void traverse(TIntermTraverser*); + virtual TIntermTyped* fold(TOperator, const TIntermTyped*) const; + virtual TIntermTyped* fold(TOperator, const TType&) const; + void setLiteral() { literal = true; } + void setExpression() { literal = false; } + bool isLiteral() const { return literal; } + +protected: + TIntermConstantUnion& operator=(const TIntermConstantUnion&); + + const TConstUnionArray constArray; + bool literal; // true if node represents a literal in the source code +}; + +// Represent the independent aspects of a texturing TOperator +struct TCrackedTextureOp { + bool query; + bool proj; + bool lod; + bool fetch; + bool offset; + bool offsets; + bool gather; + bool grad; + bool subpass; + bool lodClamp; + bool fragMask; + bool attachmentEXT; +}; + +// +// Intermediate class for node types that hold operators. +// +class TIntermOperator : public TIntermTyped { +public: + virtual TIntermOperator* getAsOperator() { return this; } + virtual const TIntermOperator* getAsOperator() const { return this; } + TOperator getOp() const { return op; } + void setOp(TOperator newOp) { op = newOp; } + bool modifiesState() const; + bool isConstructor() const; + bool isTexture() const { return op > EOpTextureGuardBegin && op < EOpTextureGuardEnd; } + bool isSampling() const { return op > EOpSamplingGuardBegin && op < EOpSamplingGuardEnd; } + bool isImage() const { return op > EOpImageGuardBegin && op < EOpImageGuardEnd; } + bool isSparseTexture() const { return op > EOpSparseTextureGuardBegin && op < EOpSparseTextureGuardEnd; } + bool isImageFootprint() const { return op > EOpImageFootprintGuardBegin && op < EOpImageFootprintGuardEnd; } + bool isSparseImage() const { return op == EOpSparseImageLoad; } + bool isSubgroup() const { return op > EOpSubgroupGuardStart && op < EOpSubgroupGuardStop; } + + void setOperationPrecision(TPrecisionQualifier p) { operationPrecision = p; } + TPrecisionQualifier getOperationPrecision() const { return operationPrecision != EpqNone ? + operationPrecision : + type.getQualifier().precision; } + TString getCompleteString() const + { + TString cs = type.getCompleteString(); + if (getOperationPrecision() != type.getQualifier().precision) { + cs += ", operation at "; + cs += GetPrecisionQualifierString(getOperationPrecision()); + } + + return cs; + } + + // Crack the op into the individual dimensions of texturing operation. + void crackTexture(TSampler sampler, TCrackedTextureOp& cracked) const + { + cracked.query = false; + cracked.proj = false; + cracked.lod = false; + cracked.fetch = false; + cracked.offset = false; + cracked.offsets = false; + cracked.gather = false; + cracked.grad = false; + cracked.subpass = false; + cracked.attachmentEXT = false; + cracked.lodClamp = false; + cracked.fragMask = false; + + switch (op) { + case EOpImageQuerySize: + case EOpImageQuerySamples: + case EOpTextureQuerySize: + case EOpTextureQueryLod: + case EOpTextureQueryLevels: + case EOpTextureQuerySamples: + case EOpSparseTexelsResident: + cracked.query = true; + break; + case EOpTexture: + case EOpSparseTexture: + break; + case EOpTextureProj: + cracked.proj = true; + break; + case EOpTextureLod: + case EOpSparseTextureLod: + cracked.lod = true; + break; + case EOpTextureOffset: + case EOpSparseTextureOffset: + cracked.offset = true; + break; + case EOpTextureFetch: + case EOpSparseTextureFetch: + cracked.fetch = true; + if (sampler.is1D() || (sampler.dim == Esd2D && ! sampler.isMultiSample()) || sampler.dim == Esd3D) + cracked.lod = true; + break; + case EOpTextureFetchOffset: + case EOpSparseTextureFetchOffset: + cracked.fetch = true; + cracked.offset = true; + if (sampler.is1D() || (sampler.dim == Esd2D && ! sampler.isMultiSample()) || sampler.dim == Esd3D) + cracked.lod = true; + break; + case EOpTextureProjOffset: + cracked.offset = true; + cracked.proj = true; + break; + case EOpTextureLodOffset: + case EOpSparseTextureLodOffset: + cracked.offset = true; + cracked.lod = true; + break; + case EOpTextureProjLod: + cracked.lod = true; + cracked.proj = true; + break; + case EOpTextureProjLodOffset: + cracked.offset = true; + cracked.lod = true; + cracked.proj = true; + break; + case EOpTextureGrad: + case EOpSparseTextureGrad: + cracked.grad = true; + break; + case EOpTextureGradOffset: + case EOpSparseTextureGradOffset: + cracked.grad = true; + cracked.offset = true; + break; + case EOpTextureProjGrad: + cracked.grad = true; + cracked.proj = true; + break; + case EOpTextureProjGradOffset: + cracked.grad = true; + cracked.offset = true; + cracked.proj = true; + break; + case EOpTextureClamp: + case EOpSparseTextureClamp: + cracked.lodClamp = true; + break; + case EOpTextureOffsetClamp: + case EOpSparseTextureOffsetClamp: + cracked.offset = true; + cracked.lodClamp = true; + break; + case EOpTextureGradClamp: + case EOpSparseTextureGradClamp: + cracked.grad = true; + cracked.lodClamp = true; + break; + case EOpTextureGradOffsetClamp: + case EOpSparseTextureGradOffsetClamp: + cracked.grad = true; + cracked.offset = true; + cracked.lodClamp = true; + break; + case EOpTextureGather: + case EOpSparseTextureGather: + cracked.gather = true; + break; + case EOpTextureGatherOffset: + case EOpSparseTextureGatherOffset: + cracked.gather = true; + cracked.offset = true; + break; + case EOpTextureGatherOffsets: + case EOpSparseTextureGatherOffsets: + cracked.gather = true; + cracked.offsets = true; + break; + case EOpTextureGatherLod: + case EOpSparseTextureGatherLod: + cracked.gather = true; + cracked.lod = true; + break; + case EOpTextureGatherLodOffset: + case EOpSparseTextureGatherLodOffset: + cracked.gather = true; + cracked.offset = true; + cracked.lod = true; + break; + case EOpTextureGatherLodOffsets: + case EOpSparseTextureGatherLodOffsets: + cracked.gather = true; + cracked.offsets = true; + cracked.lod = true; + break; + case EOpImageLoadLod: + case EOpImageStoreLod: + case EOpSparseImageLoadLod: + cracked.lod = true; + break; + case EOpFragmentMaskFetch: + cracked.subpass = sampler.dim == EsdSubpass; + cracked.fragMask = true; + break; + case EOpFragmentFetch: + cracked.subpass = sampler.dim == EsdSubpass; + cracked.fragMask = true; + break; + case EOpImageSampleFootprintNV: + break; + case EOpImageSampleFootprintClampNV: + cracked.lodClamp = true; + break; + case EOpImageSampleFootprintLodNV: + cracked.lod = true; + break; + case EOpImageSampleFootprintGradNV: + cracked.grad = true; + break; + case EOpImageSampleFootprintGradClampNV: + cracked.lodClamp = true; + cracked.grad = true; + break; + case EOpSubpassLoad: + case EOpSubpassLoadMS: + cracked.subpass = true; + break; + case EOpColorAttachmentReadEXT: + cracked.attachmentEXT = true; + break; + default: + break; + } + } + +protected: + TIntermOperator(TOperator o) : TIntermTyped(EbtFloat), op(o), operationPrecision(EpqNone) {} + TIntermOperator(TOperator o, TType& t) : TIntermTyped(t), op(o), operationPrecision(EpqNone) {} + TOperator op; + // The result precision is in the inherited TType, and is usually meant to be both + // the operation precision and the result precision. However, some more complex things, + // like built-in function calls, distinguish between the two, in which case non-EqpNone + // 'operationPrecision' overrides the result precision as far as operation precision + // is concerned. + TPrecisionQualifier operationPrecision; +}; + +// +// Nodes for all the basic binary math operators. +// +class TIntermBinary : public TIntermOperator { +public: + TIntermBinary(TOperator o) : TIntermOperator(o) {} + virtual void traverse(TIntermTraverser*); + virtual void setLeft(TIntermTyped* n) { left = n; } + virtual void setRight(TIntermTyped* n) { right = n; } + virtual TIntermTyped* getLeft() const { return left; } + virtual TIntermTyped* getRight() const { return right; } + virtual TIntermBinary* getAsBinaryNode() { return this; } + virtual const TIntermBinary* getAsBinaryNode() const { return this; } + virtual void updatePrecision(); +protected: + TIntermTyped* left; + TIntermTyped* right; +}; + +// +// Nodes for unary math operators. +// +class TIntermUnary : public TIntermOperator { +public: + TIntermUnary(TOperator o, TType& t) : TIntermOperator(o, t), operand(nullptr) {} + TIntermUnary(TOperator o) : TIntermOperator(o), operand(nullptr) {} + virtual void traverse(TIntermTraverser*); + virtual void setOperand(TIntermTyped* o) { operand = o; } + virtual TIntermTyped* getOperand() { return operand; } + virtual const TIntermTyped* getOperand() const { return operand; } + virtual TIntermUnary* getAsUnaryNode() { return this; } + virtual const TIntermUnary* getAsUnaryNode() const { return this; } + virtual void updatePrecision(); + void setSpirvInstruction(const TSpirvInstruction& inst) { spirvInst = inst; } + const TSpirvInstruction& getSpirvInstruction() const { return spirvInst; } +protected: + TIntermTyped* operand; + TSpirvInstruction spirvInst; +}; + +typedef TVector TIntermSequence; +typedef TVector TQualifierList; +// +// Nodes that operate on an arbitrary sized set of children. +// +class TIntermAggregate : public TIntermOperator { +public: + TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(nullptr) { + endLoc.init(); + } + TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(nullptr) { + endLoc.init(); + } + ~TIntermAggregate() { delete pragmaTable; } + virtual TIntermAggregate* getAsAggregate() { return this; } + virtual const TIntermAggregate* getAsAggregate() const { return this; } + virtual void updatePrecision(); + virtual void setOperator(TOperator o) { op = o; } + virtual TIntermSequence& getSequence() { return sequence; } + virtual const TIntermSequence& getSequence() const { return sequence; } + virtual void setName(const TString& n) { name = n; } + virtual const TString& getName() const { return name; } + virtual void traverse(TIntermTraverser*); + virtual void setUserDefined() { userDefined = true; } + virtual bool isUserDefined() { return userDefined; } + virtual TQualifierList& getQualifierList() { return qualifier; } + virtual const TQualifierList& getQualifierList() const { return qualifier; } + void setOptimize(bool o) { optimize = o; } + void setDebug(bool d) { debug = d; } + bool getOptimize() const { return optimize; } + bool getDebug() const { return debug; } + void setPragmaTable(const TPragmaTable& pTable); + const TPragmaTable& getPragmaTable() const { return *pragmaTable; } + void setSpirvInstruction(const TSpirvInstruction& inst) { spirvInst = inst; } + const TSpirvInstruction& getSpirvInstruction() const { return spirvInst; } + + void setEndLoc(TSourceLoc loc) { endLoc = loc; } + TSourceLoc getEndLoc() const { return endLoc; } + + void setLinkType(TLinkType l) { linkType = l; } + TLinkType getLinkType() const { return linkType; } +protected: + TIntermAggregate(const TIntermAggregate&); // disallow copy constructor + TIntermAggregate& operator=(const TIntermAggregate&); // disallow assignment operator + TIntermSequence sequence; + TQualifierList qualifier; + TString name; + bool userDefined; // used for user defined function names + bool optimize; + bool debug; + TPragmaTable* pragmaTable; + TSpirvInstruction spirvInst; + TLinkType linkType = ELinkNone; + + // Marking the end source location of the aggregate. + // This is currently only set for a compound statement or a function body, pointing to '}'. + TSourceLoc endLoc; +}; + +// +// For if tests. +// +class TIntermSelection : public TIntermTyped { +public: + TIntermSelection(TIntermTyped* cond, TIntermNode* trueB, TIntermNode* falseB) : + TIntermTyped(EbtVoid), condition(cond), trueBlock(trueB), falseBlock(falseB), + shortCircuit(true), + flatten(false), dontFlatten(false) {} + TIntermSelection(TIntermTyped* cond, TIntermNode* trueB, TIntermNode* falseB, const TType& type) : + TIntermTyped(type), condition(cond), trueBlock(trueB), falseBlock(falseB), + shortCircuit(true), + flatten(false), dontFlatten(false) {} + virtual void traverse(TIntermTraverser*); + virtual TIntermTyped* getCondition() const { return condition; } + virtual void setCondition(TIntermTyped* c) { condition = c; } + virtual TIntermNode* getTrueBlock() const { return trueBlock; } + virtual void setTrueBlock(TIntermTyped* tb) { trueBlock = tb; } + virtual TIntermNode* getFalseBlock() const { return falseBlock; } + virtual void setFalseBlock(TIntermTyped* fb) { falseBlock = fb; } + virtual TIntermSelection* getAsSelectionNode() { return this; } + virtual const TIntermSelection* getAsSelectionNode() const { return this; } + + void setNoShortCircuit() { shortCircuit = false; } + bool getShortCircuit() const { return shortCircuit; } + + void setFlatten() { flatten = true; } + void setDontFlatten() { dontFlatten = true; } + bool getFlatten() const { return flatten; } + bool getDontFlatten() const { return dontFlatten; } + +protected: + TIntermTyped* condition; + TIntermNode* trueBlock; + TIntermNode* falseBlock; + bool shortCircuit; // normally all if-then-else and all GLSL ?: short-circuit, but HLSL ?: does not + bool flatten; // true if flatten requested + bool dontFlatten; // true if requested to not flatten +}; + +// +// For switch statements. Designed use is that a switch will have sequence of nodes +// that are either case/default nodes or a *single* node that represents all the code +// in between (if any) consecutive case/defaults. So, a traversal need only deal with +// 0 or 1 nodes per case/default statement. +// +class TIntermSwitch : public TIntermNode { +public: + TIntermSwitch(TIntermTyped* cond, TIntermAggregate* b) : condition(cond), body(b), + flatten(false), dontFlatten(false) {} + virtual void traverse(TIntermTraverser*); + virtual TIntermNode* getCondition() const { return condition; } + virtual TIntermAggregate* getBody() const { return body; } + virtual TIntermSwitch* getAsSwitchNode() { return this; } + virtual const TIntermSwitch* getAsSwitchNode() const { return this; } + + void setFlatten() { flatten = true; } + void setDontFlatten() { dontFlatten = true; } + bool getFlatten() const { return flatten; } + bool getDontFlatten() const { return dontFlatten; } + +protected: + TIntermTyped* condition; + TIntermAggregate* body; + bool flatten; // true if flatten requested + bool dontFlatten; // true if requested to not flatten +}; + +enum TVisit +{ + EvPreVisit, + EvInVisit, + EvPostVisit +}; + +// +// For traversing the tree. User should derive from this, +// put their traversal specific data in it, and then pass +// it to a Traverse method. +// +// When using this, just fill in the methods for nodes you want visited. +// Return false from a pre-visit to skip visiting that node's subtree. +// +// Explicitly set postVisit to true if you want post visiting, otherwise, +// filled in methods will only be called at pre-visit time (before processing +// the subtree). Similarly for inVisit for in-order visiting of nodes with +// multiple children. +// +// If you only want post-visits, explicitly turn off preVisit (and inVisit) +// and turn on postVisit. +// +// In general, for the visit*() methods, return true from interior nodes +// to have the traversal continue on to children. +// +// If you process children yourself, or don't want them processed, return false. +// +class TIntermTraverser { +public: + POOL_ALLOCATOR_NEW_DELETE(glslang::GetThreadPoolAllocator()) + TIntermTraverser(bool preVisit = true, bool inVisit = false, bool postVisit = false, bool rightToLeft = false, bool includeDeclSymbol = false) : + preVisit(preVisit), + inVisit(inVisit), + postVisit(postVisit), + rightToLeft(rightToLeft), + includeDeclSymbol(includeDeclSymbol), + depth(0), + maxDepth(0) { } + virtual ~TIntermTraverser() { } + + virtual void visitSymbol(TIntermSymbol*) { } + virtual void visitConstantUnion(TIntermConstantUnion*) { } + virtual bool visitBinary(TVisit, TIntermBinary*) { return true; } + virtual bool visitUnary(TVisit, TIntermUnary*) { return true; } + virtual bool visitSelection(TVisit, TIntermSelection*) { return true; } + virtual bool visitAggregate(TVisit, TIntermAggregate*) { return true; } + virtual bool visitLoop(TVisit, TIntermLoop*) { return true; } + virtual bool visitBranch(TVisit, TIntermBranch*) { return true; } + virtual bool visitSwitch(TVisit, TIntermSwitch*) { return true; } + virtual bool visitVariableDecl(TVisit, TIntermVariableDecl*) { return true; } + + int getMaxDepth() const { return maxDepth; } + + void incrementDepth(TIntermNode *current) + { + depth++; + maxDepth = (std::max)(maxDepth, depth); + path.push_back(current); + } + + void decrementDepth() + { + depth--; + path.pop_back(); + } + + TIntermNode *getParentNode() + { + return path.size() == 0 ? nullptr : path.back(); + } + + const bool preVisit; + const bool inVisit; + const bool postVisit; + const bool rightToLeft; + + // Whether to traverse declaration symbols in the traversal. + // By default, declaration symbols are not visited in the traversal to avoid + // visiting them in SPIR-V generation where they are not needed. + const bool includeDeclSymbol; + +protected: + TIntermTraverser& operator=(TIntermTraverser&); + + int depth; + int maxDepth; + + // All the nodes from root to the current node's parent during traversing. + TVector path; +}; + +// KHR_vulkan_glsl says "Two arrays sized with specialization constants are the same type only if +// sized with the same symbol, involving no operations" +inline bool SameSpecializationConstants(TIntermTyped* node1, TIntermTyped* node2) +{ + return node1->getAsSymbolNode() && node2->getAsSymbolNode() && + node1->getAsSymbolNode()->getId() == node2->getAsSymbolNode()->getId(); +} + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // __INTERMEDIATE_H diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/visibility.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/visibility.h new file mode 100644 index 0000000000..dd32351f83 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Include/visibility.h @@ -0,0 +1,58 @@ +// +// Copyright (C) 2023 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +#ifdef GLSLANG_IS_SHARED_LIBRARY + #ifdef _WIN32 + #ifdef GLSLANG_EXPORTING + #define GLSLANG_EXPORT __declspec(dllexport) + #else + #define GLSLANG_EXPORT __declspec(dllimport) + #endif + #elif __GNUC__ >= 4 + #define GLSLANG_EXPORT __attribute__((visibility("default"))) + #endif +#endif // GLSLANG_IS_SHARED_LIBRARY + +#ifndef GLSLANG_EXPORT +#define GLSLANG_EXPORT +#endif + +// Symbols marked with this macro are only meant for public use by the test suite +// and do not appear in publicly installed headers. They are not considered to be +// part of the glslang library ABI. +#ifdef GLSLANG_TEST_BUILD + #define GLSLANG_EXPORT_FOR_TESTS GLSLANG_EXPORT +#else + #define GLSLANG_EXPORT_FOR_TESTS +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp new file mode 100644 index 0000000000..c00b7f442f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp @@ -0,0 +1,1310 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. +// Copyright (C) 2018-2020 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "localintermediate.h" +#include +#include +#include +#include + +namespace { + +using namespace QtShaderTools; +using namespace glslang; + +const double pi = 3.1415926535897932384626433832795; + +} // end anonymous namespace + + +namespace QtShaderTools { +namespace glslang { + +// +// The fold functions see if an operation on a constant can be done in place, +// without generating run-time code. +// +// Returns the node to keep using, which may or may not be the node passed in. +// +// Note: As of version 1.2, all constant operations must be folded. It is +// not opportunistic, but rather a semantic requirement. +// + +// +// Do folding between a pair of nodes. +// 'this' is the left-hand operand and 'rightConstantNode' is the right-hand operand. +// +// Returns a new node representing the result. +// +TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* rightConstantNode) const +{ + // For most cases, the return type matches the argument type, so set that + // up and just code to exceptions below. + TType returnType; + returnType.shallowCopy(getType()); + + // + // A pair of nodes is to be folded together + // + + const TIntermConstantUnion *rightNode = rightConstantNode->getAsConstantUnion(); + TConstUnionArray leftUnionArray = getConstArray(); + TConstUnionArray rightUnionArray = rightNode->getConstArray(); + + // Figure out the size of the result + int newComps; + int constComps; + switch(op) { + case EOpMatrixTimesMatrix: + newComps = rightNode->getMatrixCols() * getMatrixRows(); + break; + case EOpMatrixTimesVector: + newComps = getMatrixRows(); + break; + case EOpVectorTimesMatrix: + newComps = rightNode->getMatrixCols(); + break; + default: + newComps = getType().computeNumComponents(); + constComps = rightConstantNode->getType().computeNumComponents(); + if (constComps == 1 && newComps > 1) { + // for a case like vec4 f = vec4(2,3,4,5) + 1.2; + TConstUnionArray smearedArray(newComps, rightNode->getConstArray()[0]); + rightUnionArray = smearedArray; + } else if (constComps > 1 && newComps == 1) { + // for a case like vec4 f = 1.2 + vec4(2,3,4,5); + newComps = constComps; + rightUnionArray = rightNode->getConstArray(); + TConstUnionArray smearedArray(newComps, getConstArray()[0]); + leftUnionArray = smearedArray; + returnType.shallowCopy(rightNode->getType()); + } + break; + } + + TConstUnionArray newConstArray(newComps); + TType constBool(EbtBool, EvqConst); + + switch(op) { + case EOpAdd: + for (int i = 0; i < newComps; i++) + newConstArray[i] = leftUnionArray[i] + rightUnionArray[i]; + break; + case EOpSub: + for (int i = 0; i < newComps; i++) + newConstArray[i] = leftUnionArray[i] - rightUnionArray[i]; + break; + + case EOpMul: + case EOpVectorTimesScalar: + case EOpMatrixTimesScalar: + for (int i = 0; i < newComps; i++) + newConstArray[i] = leftUnionArray[i] * rightUnionArray[i]; + break; + case EOpMatrixTimesMatrix: + for (int row = 0; row < getMatrixRows(); row++) { + for (int column = 0; column < rightNode->getMatrixCols(); column++) { + double sum = 0.0f; + for (int i = 0; i < rightNode->getMatrixRows(); i++) + sum += leftUnionArray[i * getMatrixRows() + row].getDConst() * rightUnionArray[column * rightNode->getMatrixRows() + i].getDConst(); + newConstArray[column * getMatrixRows() + row].setDConst(sum); + } + } + returnType.shallowCopy(TType(getType().getBasicType(), EvqConst, 0, rightNode->getMatrixCols(), getMatrixRows())); + break; + case EOpDiv: + for (int i = 0; i < newComps; i++) { + switch (getType().getBasicType()) { + case EbtDouble: + case EbtFloat: + case EbtFloat16: + case EbtBFloat16: + case EbtFloatE5M2: + case EbtFloatE4M3: + if (rightUnionArray[i].getDConst() != 0.0) + newConstArray[i].setDConst(leftUnionArray[i].getDConst() / rightUnionArray[i].getDConst()); + else if (leftUnionArray[i].getDConst() > 0.0) + newConstArray[i].setDConst((double)INFINITY); + else if (leftUnionArray[i].getDConst() < 0.0) + newConstArray[i].setDConst(-(double)INFINITY); + else + newConstArray[i].setDConst((double)NAN); + break; + + case EbtInt: + if (rightUnionArray[i] == 0) + newConstArray[i].setIConst(0x7FFFFFFF); + else if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == (int)-0x80000000ll) + newConstArray[i].setIConst((int)-0x80000000ll); + else + newConstArray[i].setIConst(leftUnionArray[i].getIConst() / rightUnionArray[i].getIConst()); + break; + + case EbtUint: + if (rightUnionArray[i] == 0u) + newConstArray[i].setUConst(0xFFFFFFFFu); + else + newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst()); + break; + + case EbtInt8: + if (rightUnionArray[i] == (signed char)0) + newConstArray[i].setI8Const((signed char)0x7F); + else if (rightUnionArray[i].getI8Const() == (signed char)-1 && leftUnionArray[i].getI8Const() == (signed char)-0x80) + newConstArray[i].setI8Const((signed char)-0x80); + else + newConstArray[i].setI8Const(leftUnionArray[i].getI8Const() / rightUnionArray[i].getI8Const()); + break; + + case EbtUint8: + if (rightUnionArray[i] == (unsigned char)0u) + newConstArray[i].setU8Const((unsigned char)0xFFu); + else + newConstArray[i].setU8Const(leftUnionArray[i].getU8Const() / rightUnionArray[i].getU8Const()); + break; + + case EbtInt16: + if (rightUnionArray[i] == (signed short)0) + newConstArray[i].setI16Const((signed short)0x7FFF); + else if (rightUnionArray[i].getI16Const() == (signed short)-1 && leftUnionArray[i].getI16Const() == (signed short)-0x8000) + newConstArray[i].setI16Const((signed short)-0x8000); + else + newConstArray[i].setI16Const(leftUnionArray[i].getI16Const() / rightUnionArray[i].getI16Const()); + break; + + case EbtUint16: + if (rightUnionArray[i] == (unsigned short)0u) + newConstArray[i].setU16Const((unsigned short)0xFFFFu); + else + newConstArray[i].setU16Const(leftUnionArray[i].getU16Const() / rightUnionArray[i].getU16Const()); + break; + + case EbtInt64: + if (rightUnionArray[i] == 0ll) + newConstArray[i].setI64Const(LLONG_MAX); + else if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == LLONG_MIN) + newConstArray[i].setI64Const(LLONG_MIN); + else + newConstArray[i].setI64Const(leftUnionArray[i].getI64Const() / rightUnionArray[i].getI64Const()); + break; + + case EbtUint64: + if (rightUnionArray[i] == 0ull) + newConstArray[i].setU64Const(0xFFFFFFFFFFFFFFFFull); + else + newConstArray[i].setU64Const(leftUnionArray[i].getU64Const() / rightUnionArray[i].getU64Const()); + break; + default: + return nullptr; + } + } + break; + + case EOpMatrixTimesVector: + for (int i = 0; i < getMatrixRows(); i++) { + double sum = 0.0f; + for (int j = 0; j < rightNode->getVectorSize(); j++) { + sum += leftUnionArray[j*getMatrixRows() + i].getDConst() * rightUnionArray[j].getDConst(); + } + newConstArray[i].setDConst(sum); + } + + returnType.shallowCopy(TType(getBasicType(), EvqConst, getMatrixRows())); + break; + + case EOpVectorTimesMatrix: + for (int i = 0; i < rightNode->getMatrixCols(); i++) { + double sum = 0.0f; + for (int j = 0; j < getVectorSize(); j++) + sum += leftUnionArray[j].getDConst() * rightUnionArray[i*rightNode->getMatrixRows() + j].getDConst(); + newConstArray[i].setDConst(sum); + } + + returnType.shallowCopy(TType(getBasicType(), EvqConst, rightNode->getMatrixCols())); + break; + + case EOpMod: + for (int i = 0; i < newComps; i++) { + if (rightUnionArray[i] == 0) + newConstArray[i] = leftUnionArray[i]; + else { + switch (getType().getBasicType()) { + case EbtInt: + if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == INT_MIN) { + newConstArray[i].setIConst(0); + break; + } else goto modulo_default; + case EbtInt64: + if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == LLONG_MIN) { + newConstArray[i].setI64Const(0); + break; + } else goto modulo_default; + case EbtInt16: + if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == SHRT_MIN) { + newConstArray[i].setIConst(0); + break; + } else goto modulo_default; + default: + modulo_default: + newConstArray[i] = leftUnionArray[i] % rightUnionArray[i]; + } + } + } + break; + + case EOpRightShift: + for (int i = 0; i < newComps; i++) + newConstArray[i] = leftUnionArray[i] >> rightUnionArray[i]; + break; + + case EOpLeftShift: + for (int i = 0; i < newComps; i++) + newConstArray[i] = leftUnionArray[i] << rightUnionArray[i]; + break; + + case EOpAnd: + for (int i = 0; i < newComps; i++) + newConstArray[i] = leftUnionArray[i] & rightUnionArray[i]; + break; + case EOpInclusiveOr: + for (int i = 0; i < newComps; i++) + newConstArray[i] = leftUnionArray[i] | rightUnionArray[i]; + break; + case EOpExclusiveOr: + for (int i = 0; i < newComps; i++) + newConstArray[i] = leftUnionArray[i] ^ rightUnionArray[i]; + break; + + case EOpLogicalAnd: // this code is written for possible future use, will not get executed currently + for (int i = 0; i < newComps; i++) + newConstArray[i] = leftUnionArray[i] && rightUnionArray[i]; + break; + + case EOpLogicalOr: // this code is written for possible future use, will not get executed currently + for (int i = 0; i < newComps; i++) + newConstArray[i] = leftUnionArray[i] || rightUnionArray[i]; + break; + + case EOpLogicalXor: + for (int i = 0; i < newComps; i++) { + switch (getType().getBasicType()) { + case EbtBool: newConstArray[i].setBConst((leftUnionArray[i] == rightUnionArray[i]) ? false : true); break; + default: assert(false && "Default missing"); + } + } + break; + + case EOpLessThan: + newConstArray[0].setBConst(leftUnionArray[0] < rightUnionArray[0]); + returnType.shallowCopy(constBool); + break; + case EOpGreaterThan: + newConstArray[0].setBConst(leftUnionArray[0] > rightUnionArray[0]); + returnType.shallowCopy(constBool); + break; + case EOpLessThanEqual: + newConstArray[0].setBConst(! (leftUnionArray[0] > rightUnionArray[0])); + returnType.shallowCopy(constBool); + break; + case EOpGreaterThanEqual: + newConstArray[0].setBConst(! (leftUnionArray[0] < rightUnionArray[0])); + returnType.shallowCopy(constBool); + break; + case EOpEqual: + newConstArray[0].setBConst(rightNode->getConstArray() == leftUnionArray); + returnType.shallowCopy(constBool); + break; + case EOpNotEqual: + newConstArray[0].setBConst(rightNode->getConstArray() != leftUnionArray); + returnType.shallowCopy(constBool); + break; + + default: + return nullptr; + } + + TIntermConstantUnion *newNode = new TIntermConstantUnion(newConstArray, returnType); + newNode->setLoc(getLoc()); + + return newNode; +} + +// +// Do single unary node folding +// +// Returns a new node representing the result. +// +TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) const +{ + // First, size the result, which is mostly the same as the argument's size, + // but not always, and classify what is componentwise. + // Also, eliminate cases that can't be compile-time constant. + int resultSize; + bool componentWise = true; + + int objectSize = getType().computeNumComponents(); + switch (op) { + case EOpDeterminant: + case EOpAny: + case EOpAll: + case EOpLength: + componentWise = false; + resultSize = 1; + break; + + case EOpEmitStreamVertex: + case EOpEndStreamPrimitive: + // These don't fold + return nullptr; + + case EOpPackSnorm2x16: + case EOpPackUnorm2x16: + case EOpPackHalf2x16: + componentWise = false; + resultSize = 1; + break; + + case EOpUnpackSnorm2x16: + case EOpUnpackUnorm2x16: + case EOpUnpackHalf2x16: + componentWise = false; + resultSize = 2; + break; + + case EOpPack16: + case EOpPack32: + case EOpPack64: + case EOpUnpack32: + case EOpUnpack16: + case EOpUnpack8: + case EOpNormalize: + componentWise = false; + resultSize = objectSize; + break; + + default: + resultSize = objectSize; + break; + } + + // Set up for processing + TConstUnionArray newConstArray(resultSize); + const TConstUnionArray& unionArray = getConstArray(); + + // Process non-component-wise operations + switch (op) { + case EOpLength: + case EOpNormalize: + { + double sum = 0; + for (int i = 0; i < objectSize; i++) + sum += unionArray[i].getDConst() * unionArray[i].getDConst(); + double length = sqrt(sum); + if (op == EOpLength) + newConstArray[0].setDConst(length); + else { + for (int i = 0; i < objectSize; i++) + newConstArray[i].setDConst(unionArray[i].getDConst() / length); + } + break; + } + + case EOpAny: + { + bool result = false; + for (int i = 0; i < objectSize; i++) { + if (unionArray[i].getBConst()) + result = true; + } + newConstArray[0].setBConst(result); + break; + } + case EOpAll: + { + bool result = true; + for (int i = 0; i < objectSize; i++) { + if (! unionArray[i].getBConst()) + result = false; + } + newConstArray[0].setBConst(result); + break; + } + + case EOpPackSnorm2x16: + case EOpPackUnorm2x16: + case EOpPackHalf2x16: + case EOpPack16: + case EOpPack32: + case EOpPack64: + case EOpUnpack32: + case EOpUnpack16: + case EOpUnpack8: + + case EOpUnpackSnorm2x16: + case EOpUnpackUnorm2x16: + case EOpUnpackHalf2x16: + + case EOpDeterminant: + case EOpMatrixInverse: + case EOpTranspose: + return nullptr; + + default: + assert(componentWise); + break; + } + + // Turn off the componentwise loop + if (! componentWise) + objectSize = 0; + + // Process component-wise operations + for (int i = 0; i < objectSize; i++) { + // First read the value and convert to i64/u64/f64/bool, then convert + // to the destination type (still 64b), then convert down to the + // destination size. + if (IsOpNumericConv(op)) { + enum ConvType { CONV_FLOAT, CONV_INT, CONV_UINT, CONV_BOOL }; + ConvType srcType = CONV_UINT, dstType = CONV_UINT; + double valf = 0.0; + uint64_t valu = 0; + int64_t vali = 0; + bool valb = false; + switch (getType().getBasicType()) { + case EbtDouble: + case EbtFloat16: + case EbtBFloat16: + case EbtFloatE5M2: + case EbtFloatE4M3: + case EbtFloat: + valf = unionArray[i].getDConst(); + srcType = CONV_FLOAT; + break; + case EbtInt8: + vali = unionArray[i].getI8Const(); + srcType = CONV_INT; + break; + case EbtInt16: + vali = unionArray[i].getI16Const(); + srcType = CONV_INT; + break; + case EbtInt: + vali = unionArray[i].getIConst(); + srcType = CONV_INT; + break; + case EbtInt64: + vali = unionArray[i].getI64Const(); + srcType = CONV_INT; + break; + case EbtUint8: + valu = unionArray[i].getU8Const(); + srcType = CONV_UINT; + break; + case EbtUint16: + valu = unionArray[i].getU16Const(); + srcType = CONV_UINT; + break; + case EbtUint: + valu = unionArray[i].getUConst(); + srcType = CONV_UINT; + break; + case EbtUint64: + valu = unionArray[i].getU64Const(); + srcType = CONV_UINT; + break; + case EbtBool: + valb = unionArray[i].getBConst(); + srcType = CONV_BOOL; + break; + default: + assert(0); + break; + } + + switch (returnType.getBasicType()) { + case EbtDouble: + case EbtFloat16: + case EbtBFloat16: + case EbtFloatE5M2: + case EbtFloatE4M3: + case EbtFloat: + dstType = CONV_FLOAT; + break; + case EbtInt8: + case EbtInt16: + case EbtInt: + case EbtInt64: + dstType = CONV_INT; + break; + case EbtUint8: + case EbtUint16: + case EbtUint: + case EbtUint64: + dstType = CONV_UINT; + break; + case EbtBool: + dstType = CONV_BOOL; + break; + default: + assert(0); + break; + } + if (dstType == CONV_BOOL) { + switch (srcType) { + case CONV_FLOAT: + valb = (valf != 0.0); break; + case CONV_INT: + valb = (vali != 0.0); break; + case CONV_UINT: + valb = (valu != 0.0); break; + default: + break; + } + } else if (dstType == CONV_FLOAT) { + switch (srcType) { + case CONV_BOOL: + valf = (double)valb; break; + case CONV_INT: + valf = (double)vali; break; + case CONV_UINT: + valf = (double)valu; break; + default: + break; + } + } else if (dstType == CONV_INT) { + switch (srcType) { + case CONV_BOOL: + vali = (int64_t)valb; break; + case CONV_FLOAT: + vali = (int64_t)valf; break; + case CONV_UINT: + vali = (int64_t)valu; break; + default: + break; + } + } else if (dstType == CONV_UINT) { + switch (srcType) { + case CONV_BOOL: + valu = (uint64_t)valb; break; + case CONV_FLOAT: + valu = (uint64_t)valf; break; + case CONV_INT: + valu = (uint64_t)vali; break; + default: + break; + } + } + switch (returnType.getBasicType()) { + case EbtDouble: + case EbtFloat16: + case EbtBFloat16: + case EbtFloatE5M2: + case EbtFloatE4M3: + case EbtFloat: + newConstArray[i].setDConst(valf); break; + case EbtInt8: + newConstArray[i].setI8Const(static_cast(vali)); break; + case EbtInt16: + newConstArray[i].setI16Const(static_cast(vali)); break; + case EbtInt: + newConstArray[i].setIConst(static_cast(vali)); break; + case EbtInt64: + newConstArray[i].setI64Const(vali); break; + case EbtUint8: + newConstArray[i].setU8Const(static_cast(valu)); break; + case EbtUint16: + newConstArray[i].setU16Const(static_cast(valu)); break; + case EbtUint: + newConstArray[i].setUConst(static_cast(valu)); break; + case EbtUint64: + newConstArray[i].setU64Const(valu); break; + case EbtBool: + newConstArray[i].setBConst(valb); break; + default: + assert(0); + break; + } + continue; + } + switch (op) { + case EOpNegative: + switch (getType().getBasicType()) { + case EbtDouble: + case EbtFloat16: + case EbtBFloat16: + case EbtFloatE5M2: + case EbtFloatE4M3: + case EbtFloat: newConstArray[i].setDConst(-unionArray[i].getDConst()); break; + // Note: avoid UBSAN error regarding negating 0x80000000 + case EbtInt: newConstArray[i].setIConst( + static_cast(unionArray[i].getIConst()) == 0x80000000 + ? -0x7FFFFFFF - 1 + : -unionArray[i].getIConst()); + break; + case EbtUint: newConstArray[i].setUConst(static_cast(-static_cast(unionArray[i].getUConst()))); break; + case EbtInt8: newConstArray[i].setI8Const(-unionArray[i].getI8Const()); break; + case EbtUint8: newConstArray[i].setU8Const(static_cast(-static_cast(unionArray[i].getU8Const()))); break; + case EbtInt16: newConstArray[i].setI16Const(-unionArray[i].getI16Const()); break; + case EbtUint16:newConstArray[i].setU16Const(static_cast(-static_cast(unionArray[i].getU16Const()))); break; + case EbtInt64: { + int64_t i64val = unionArray[i].getI64Const(); + newConstArray[i].setI64Const(i64val == INT64_MIN ? INT64_MIN : -i64val); + break; + } + case EbtUint64: newConstArray[i].setU64Const(static_cast(-static_cast(unionArray[i].getU64Const()))); break; + default: + return nullptr; + } + break; + case EOpLogicalNot: + case EOpVectorLogicalNot: + switch (getType().getBasicType()) { + case EbtBool: newConstArray[i].setBConst(!unionArray[i].getBConst()); break; + default: + return nullptr; + } + break; + case EOpBitwiseNot: + newConstArray[i] = ~unionArray[i]; + break; + case EOpRadians: + newConstArray[i].setDConst(unionArray[i].getDConst() * pi / 180.0); + break; + case EOpDegrees: + newConstArray[i].setDConst(unionArray[i].getDConst() * 180.0 / pi); + break; + case EOpSin: + newConstArray[i].setDConst(sin(unionArray[i].getDConst())); + break; + case EOpCos: + newConstArray[i].setDConst(cos(unionArray[i].getDConst())); + break; + case EOpTan: + newConstArray[i].setDConst(tan(unionArray[i].getDConst())); + break; + case EOpAsin: + newConstArray[i].setDConst(asin(unionArray[i].getDConst())); + break; + case EOpAcos: + newConstArray[i].setDConst(acos(unionArray[i].getDConst())); + break; + case EOpAtan: + newConstArray[i].setDConst(atan(unionArray[i].getDConst())); + break; + + case EOpDPdx: + case EOpDPdy: + case EOpFwidth: + case EOpDPdxFine: + case EOpDPdyFine: + case EOpFwidthFine: + case EOpDPdxCoarse: + case EOpDPdyCoarse: + case EOpFwidthCoarse: + // The derivatives are all mandated to create a constant 0. + newConstArray[i].setDConst(0.0); + break; + + case EOpExp: + newConstArray[i].setDConst(exp(unionArray[i].getDConst())); + break; + case EOpLog: + newConstArray[i].setDConst(log(unionArray[i].getDConst())); + break; + case EOpExp2: + newConstArray[i].setDConst(exp2(unionArray[i].getDConst())); + break; + case EOpLog2: + newConstArray[i].setDConst(log2(unionArray[i].getDConst())); + break; + case EOpSqrt: + newConstArray[i].setDConst(sqrt(unionArray[i].getDConst())); + break; + case EOpInverseSqrt: + newConstArray[i].setDConst(1.0 / sqrt(unionArray[i].getDConst())); + break; + + case EOpAbs: + if (unionArray[i].getType() == EbtDouble) + newConstArray[i].setDConst(fabs(unionArray[i].getDConst())); + else if (unionArray[i].getType() == EbtInt) + newConstArray[i].setIConst(abs(unionArray[i].getIConst())); + else + newConstArray[i] = unionArray[i]; + break; + case EOpSign: + #define SIGN(X) (X == 0 ? 0 : (X < 0 ? -1 : 1)) + if (unionArray[i].getType() == EbtDouble) + newConstArray[i].setDConst(SIGN(unionArray[i].getDConst())); + else + newConstArray[i].setIConst(SIGN(unionArray[i].getIConst())); + break; + case EOpFloor: + newConstArray[i].setDConst(floor(unionArray[i].getDConst())); + break; + case EOpTrunc: + if (unionArray[i].getDConst() > 0) + newConstArray[i].setDConst(floor(unionArray[i].getDConst())); + else + newConstArray[i].setDConst(ceil(unionArray[i].getDConst())); + break; + case EOpRound: + newConstArray[i].setDConst(floor(0.5 + unionArray[i].getDConst())); + break; + case EOpRoundEven: + { + double flr = floor(unionArray[i].getDConst()); + bool even = flr / 2.0 == floor(flr / 2.0); + double rounded = even ? ceil(unionArray[i].getDConst() - 0.5) : floor(unionArray[i].getDConst() + 0.5); + newConstArray[i].setDConst(rounded); + break; + } + case EOpCeil: + newConstArray[i].setDConst(ceil(unionArray[i].getDConst())); + break; + case EOpFract: + { + double x = unionArray[i].getDConst(); + newConstArray[i].setDConst(x - floor(x)); + break; + } + + case EOpIsNan: + { + newConstArray[i].setBConst(std::isnan(unionArray[i].getDConst())); + break; + } + case EOpIsInf: + { + newConstArray[i].setBConst(std::isinf(unionArray[i].getDConst())); + break; + } + + case EOpConvPtrToUint64: + case EOpConvUint64ToPtr: + case EOpConstructReference: + newConstArray[i].setU64Const(unionArray[i].getU64Const()); break; + + // TODO: 3.0 Functionality: unary constant folding: the rest of the ops have to be fleshed out + + case EOpSinh: + case EOpCosh: + case EOpTanh: + case EOpAsinh: + case EOpAcosh: + case EOpAtanh: + + case EOpFloatBitsToInt: + case EOpFloatBitsToUint: + case EOpIntBitsToFloat: + case EOpUintBitsToFloat: + case EOpDoubleBitsToInt64: + case EOpDoubleBitsToUint64: + case EOpInt64BitsToDouble: + case EOpUint64BitsToDouble: + case EOpFloat16BitsToInt16: + case EOpFloat16BitsToUint16: + case EOpInt16BitsToFloat16: + case EOpUint16BitsToFloat16: + default: + return nullptr; + } + } + + TIntermConstantUnion *newNode = new TIntermConstantUnion(newConstArray, returnType); + newNode->getWritableType().getQualifier().storage = EvqConst; + newNode->setLoc(getLoc()); + + return newNode; +} + +// +// Do constant folding for an aggregate node that has all its children +// as constants and an operator that requires constant folding. +// +TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode) +{ + if (aggrNode == nullptr) + return aggrNode; + + if (! areAllChildConst(aggrNode)) + return aggrNode; + + if (aggrNode->isConstructor()) + return foldConstructor(aggrNode); + + TIntermSequence& children = aggrNode->getSequence(); + + // First, see if this is an operation to constant fold, kick out if not, + // see what size the result is if so. + + bool componentwise = false; // will also say componentwise if a scalar argument gets repeated to make per-component results + int objectSize; + switch (aggrNode->getOp()) { + case EOpAtan: + case EOpPow: + case EOpMin: + case EOpMax: + case EOpMix: + case EOpMod: + case EOpClamp: + case EOpLessThan: + case EOpGreaterThan: + case EOpLessThanEqual: + case EOpGreaterThanEqual: + case EOpVectorEqual: + case EOpVectorNotEqual: + componentwise = true; + objectSize = children[0]->getAsConstantUnion()->getType().computeNumComponents(); + break; + case EOpCross: + case EOpReflect: + case EOpRefract: + case EOpFaceForward: + objectSize = children[0]->getAsConstantUnion()->getType().computeNumComponents(); + break; + case EOpDistance: + case EOpDot: + objectSize = 1; + break; + case EOpOuterProduct: + objectSize = children[0]->getAsTyped()->getType().getVectorSize() * + children[1]->getAsTyped()->getType().getVectorSize(); + break; + case EOpStep: + componentwise = true; + objectSize = std::max(children[0]->getAsTyped()->getType().getVectorSize(), + children[1]->getAsTyped()->getType().getVectorSize()); + break; + case EOpSmoothStep: + componentwise = true; + objectSize = std::max(children[0]->getAsTyped()->getType().getVectorSize(), + children[2]->getAsTyped()->getType().getVectorSize()); + break; + case EOpMul: + { + TIntermConstantUnion* left = children[0]->getAsConstantUnion(); + TIntermConstantUnion* right = children[1]->getAsConstantUnion(); + return left->fold(EOpMul, right); + } + default: + return aggrNode; + } + TConstUnionArray newConstArray(objectSize); + + TVector childConstUnions; + for (unsigned int arg = 0; arg < children.size(); ++arg) + childConstUnions.push_back(children[arg]->getAsConstantUnion()->getConstArray()); + + if (componentwise) { + for (int comp = 0; comp < objectSize; comp++) { + + // some arguments are scalars instead of matching vectors; simulate a smear + int arg0comp = std::min(comp, children[0]->getAsTyped()->getType().getVectorSize() - 1); + int arg1comp = 0; + if (children.size() > 1) + arg1comp = std::min(comp, children[1]->getAsTyped()->getType().getVectorSize() - 1); + int arg2comp = 0; + if (children.size() > 2) + arg2comp = std::min(comp, children[2]->getAsTyped()->getType().getVectorSize() - 1); + + switch (aggrNode->getOp()) { + case EOpAtan: + newConstArray[comp].setDConst(atan2(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst())); + break; + case EOpPow: + newConstArray[comp].setDConst(pow(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst())); + break; + case EOpMod: + { + double arg0 = childConstUnions[0][arg0comp].getDConst(); + double arg1 = childConstUnions[1][arg1comp].getDConst(); + double result = arg0 - arg1 * floor(arg0 / arg1); + newConstArray[comp].setDConst(result); + break; + } + case EOpMin: + switch(children[0]->getAsTyped()->getBasicType()) { + case EbtFloat16: + case EbtBFloat16: + case EbtFloatE5M2: + case EbtFloatE4M3: + case EbtFloat: + case EbtDouble: + newConstArray[comp].setDConst(std::min(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst())); + break; + case EbtInt: + newConstArray[comp].setIConst(std::min(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst())); + break; + case EbtUint: + newConstArray[comp].setUConst(std::min(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst())); + break; + case EbtInt8: + newConstArray[comp].setI8Const(std::min(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const())); + break; + case EbtUint8: + newConstArray[comp].setU8Const(std::min(childConstUnions[0][arg0comp].getU8Const(), childConstUnions[1][arg1comp].getU8Const())); + break; + case EbtInt16: + newConstArray[comp].setI16Const(std::min(childConstUnions[0][arg0comp].getI16Const(), childConstUnions[1][arg1comp].getI16Const())); + break; + case EbtUint16: + newConstArray[comp].setU16Const(std::min(childConstUnions[0][arg0comp].getU16Const(), childConstUnions[1][arg1comp].getU16Const())); + break; + case EbtInt64: + newConstArray[comp].setI64Const(std::min(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const())); + break; + case EbtUint64: + newConstArray[comp].setU64Const(std::min(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const())); + break; + default: assert(false && "Default missing"); + } + break; + case EOpMax: + switch(children[0]->getAsTyped()->getBasicType()) { + case EbtFloat16: + case EbtBFloat16: + case EbtFloatE5M2: + case EbtFloatE4M3: + case EbtFloat: + case EbtDouble: + newConstArray[comp].setDConst(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst())); + break; + case EbtInt: + newConstArray[comp].setIConst(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst())); + break; + case EbtUint: + newConstArray[comp].setUConst(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst())); + break; + case EbtInt8: + newConstArray[comp].setI8Const(std::max(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const())); + break; + case EbtUint8: + newConstArray[comp].setU8Const(std::max(childConstUnions[0][arg0comp].getU8Const(), childConstUnions[1][arg1comp].getU8Const())); + break; + case EbtInt16: + newConstArray[comp].setI16Const(std::max(childConstUnions[0][arg0comp].getI16Const(), childConstUnions[1][arg1comp].getI16Const())); + break; + case EbtUint16: + newConstArray[comp].setU16Const(std::max(childConstUnions[0][arg0comp].getU16Const(), childConstUnions[1][arg1comp].getU16Const())); + break; + case EbtInt64: + newConstArray[comp].setI64Const(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const())); + break; + case EbtUint64: + newConstArray[comp].setU64Const(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const())); + break; + default: assert(false && "Default missing"); + } + break; + case EOpClamp: + switch(children[0]->getAsTyped()->getBasicType()) { + case EbtFloat16: + case EbtBFloat16: + case EbtFloatE5M2: + case EbtFloatE4M3: + case EbtFloat: + case EbtDouble: + newConstArray[comp].setDConst(std::min(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()), + childConstUnions[2][arg2comp].getDConst())); + break; + case EbtUint: + newConstArray[comp].setUConst(std::min(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()), + childConstUnions[2][arg2comp].getUConst())); + break; + case EbtInt8: + newConstArray[comp].setI8Const(std::min(std::max(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()), + childConstUnions[2][arg2comp].getI8Const())); + break; + case EbtUint8: + newConstArray[comp].setU8Const(std::min(std::max(childConstUnions[0][arg0comp].getU8Const(), childConstUnions[1][arg1comp].getU8Const()), + childConstUnions[2][arg2comp].getU8Const())); + break; + case EbtInt16: + newConstArray[comp].setI16Const(std::min(std::max(childConstUnions[0][arg0comp].getI16Const(), childConstUnions[1][arg1comp].getI16Const()), + childConstUnions[2][arg2comp].getI16Const())); + break; + case EbtUint16: + newConstArray[comp].setU16Const(std::min(std::max(childConstUnions[0][arg0comp].getU16Const(), childConstUnions[1][arg1comp].getU16Const()), + childConstUnions[2][arg2comp].getU16Const())); + break; + case EbtInt: + newConstArray[comp].setIConst(std::min(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()), + childConstUnions[2][arg2comp].getIConst())); + break; + case EbtInt64: + newConstArray[comp].setI64Const(std::min(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()), + childConstUnions[2][arg2comp].getI64Const())); + break; + case EbtUint64: + newConstArray[comp].setU64Const(std::min(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()), + childConstUnions[2][arg2comp].getU64Const())); + break; + default: assert(false && "Default missing"); + } + break; + case EOpLessThan: + newConstArray[comp].setBConst(childConstUnions[0][arg0comp] < childConstUnions[1][arg1comp]); + break; + case EOpGreaterThan: + newConstArray[comp].setBConst(childConstUnions[0][arg0comp] > childConstUnions[1][arg1comp]); + break; + case EOpLessThanEqual: + newConstArray[comp].setBConst(! (childConstUnions[0][arg0comp] > childConstUnions[1][arg1comp])); + break; + case EOpGreaterThanEqual: + newConstArray[comp].setBConst(! (childConstUnions[0][arg0comp] < childConstUnions[1][arg1comp])); + break; + case EOpVectorEqual: + newConstArray[comp].setBConst(childConstUnions[0][arg0comp] == childConstUnions[1][arg1comp]); + break; + case EOpVectorNotEqual: + newConstArray[comp].setBConst(childConstUnions[0][arg0comp] != childConstUnions[1][arg1comp]); + break; + case EOpMix: + if (!children[0]->getAsTyped()->isFloatingDomain()) + return aggrNode; + if (children[2]->getAsTyped()->getBasicType() == EbtBool) { + newConstArray[comp].setDConst(childConstUnions[2][arg2comp].getBConst() + ? childConstUnions[1][arg1comp].getDConst() + : childConstUnions[0][arg0comp].getDConst()); + } else { + newConstArray[comp].setDConst( + childConstUnions[0][arg0comp].getDConst() * (1.0 - childConstUnions[2][arg2comp].getDConst()) + + childConstUnions[1][arg1comp].getDConst() * childConstUnions[2][arg2comp].getDConst()); + } + break; + case EOpStep: + newConstArray[comp].setDConst(childConstUnions[1][arg1comp].getDConst() < childConstUnions[0][arg0comp].getDConst() ? 0.0 : 1.0); + break; + case EOpSmoothStep: + { + double t = (childConstUnions[2][arg2comp].getDConst() - childConstUnions[0][arg0comp].getDConst()) / + (childConstUnions[1][arg1comp].getDConst() - childConstUnions[0][arg0comp].getDConst()); + if (t < 0.0) + t = 0.0; + if (t > 1.0) + t = 1.0; + newConstArray[comp].setDConst(t * t * (3.0 - 2.0 * t)); + break; + } + default: + return aggrNode; + } + } + } else { + // Non-componentwise... + + int numComps = children[0]->getAsConstantUnion()->getType().computeNumComponents(); + double dot; + + switch (aggrNode->getOp()) { + case EOpDistance: + { + double sum = 0.0; + for (int comp = 0; comp < numComps; ++comp) { + double diff = childConstUnions[1][comp].getDConst() - childConstUnions[0][comp].getDConst(); + sum += diff * diff; + } + newConstArray[0].setDConst(sqrt(sum)); + break; + } + case EOpDot: + if (!children[0]->getAsTyped()->isFloatingDomain()) { + return aggrNode; + } + newConstArray[0].setDConst(childConstUnions[0].dot(childConstUnions[1])); + break; + case EOpCross: + newConstArray[0] = childConstUnions[0][1] * childConstUnions[1][2] - childConstUnions[0][2] * childConstUnions[1][1]; + newConstArray[1] = childConstUnions[0][2] * childConstUnions[1][0] - childConstUnions[0][0] * childConstUnions[1][2]; + newConstArray[2] = childConstUnions[0][0] * childConstUnions[1][1] - childConstUnions[0][1] * childConstUnions[1][0]; + break; + case EOpFaceForward: + // If dot(Nref, I) < 0 return N, otherwise return -N: Arguments are (N, I, Nref). + dot = childConstUnions[1].dot(childConstUnions[2]); + for (int comp = 0; comp < numComps; ++comp) { + if (dot < 0.0) + newConstArray[comp] = childConstUnions[0][comp]; + else + newConstArray[comp].setDConst(-childConstUnions[0][comp].getDConst()); + } + break; + case EOpReflect: + // I - 2 * dot(N, I) * N: Arguments are (I, N). + dot = childConstUnions[0].dot(childConstUnions[1]); + dot *= 2.0; + for (int comp = 0; comp < numComps; ++comp) + newConstArray[comp].setDConst(childConstUnions[0][comp].getDConst() - dot * childConstUnions[1][comp].getDConst()); + break; + case EOpRefract: + { + // Arguments are (I, N, eta). + // k = 1.0 - eta * eta * (1.0 - dot(N, I) * dot(N, I)) + // if (k < 0.0) + // return dvec(0.0) + // else + // return eta * I - (eta * dot(N, I) + sqrt(k)) * N + dot = childConstUnions[0].dot(childConstUnions[1]); + double eta = childConstUnions[2][0].getDConst(); + double k = 1.0 - eta * eta * (1.0 - dot * dot); + if (k < 0.0) { + for (int comp = 0; comp < numComps; ++comp) + newConstArray[comp].setDConst(0.0); + } else { + for (int comp = 0; comp < numComps; ++comp) + newConstArray[comp].setDConst(eta * childConstUnions[0][comp].getDConst() - (eta * dot + sqrt(k)) * childConstUnions[1][comp].getDConst()); + } + break; + } + case EOpOuterProduct: + { + int numRows = numComps; + int numCols = children[1]->getAsConstantUnion()->getType().computeNumComponents(); + for (int row = 0; row < numRows; ++row) + for (int col = 0; col < numCols; ++col) + newConstArray[col * numRows + row] = childConstUnions[0][row] * childConstUnions[1][col]; + break; + } + default: + return aggrNode; + } + } + + TIntermConstantUnion *newNode = new TIntermConstantUnion(newConstArray, aggrNode->getType()); + newNode->getWritableType().getQualifier().storage = EvqConst; + newNode->setLoc(aggrNode->getLoc()); + + return newNode; +} + +bool TIntermediate::areAllChildConst(TIntermAggregate* aggrNode) +{ + bool allConstant = true; + + // check if all the child nodes are constants so that they can be inserted into + // the parent node + if (aggrNode) { + TIntermSequence& childSequenceVector = aggrNode->getSequence(); + for (TIntermSequence::iterator p = childSequenceVector.begin(); + p != childSequenceVector.end(); p++) { + if (!(*p)->getAsTyped()->getAsConstantUnion()) + return false; + } + } + + return allConstant; +} + +TIntermTyped* TIntermediate::foldConstructor(TIntermAggregate* aggrNode) +{ + bool error = false; + + TConstUnionArray unionArray(aggrNode->getType().computeNumComponents()); + if (aggrNode->getSequence().size() == 1) + error = parseConstTree(aggrNode, unionArray, aggrNode->getOp(), aggrNode->getType(), true); + else + error = parseConstTree(aggrNode, unionArray, aggrNode->getOp(), aggrNode->getType()); + + if (error) + return aggrNode; + + return addConstantUnion(unionArray, aggrNode->getType(), aggrNode->getLoc()); +} + +// +// Constant folding of a bracket (array-style) dereference or struct-like dot +// dereference. Can handle anything except a multi-character swizzle, though +// all swizzles may go to foldSwizzle(). +// +TIntermTyped* TIntermediate::foldDereference(TIntermTyped* node, int index, const TSourceLoc& loc) +{ + TType dereferencedType(node->getType(), index); + dereferencedType.getQualifier().storage = EvqConst; + TIntermTyped* result = nullptr; + int size = dereferencedType.computeNumComponents(); + + // arrays, vectors, matrices, all use simple multiplicative math + // while structures need to add up heterogeneous members + int start; + if (node->getType().isCoopMat()) + start = 0; + else if (node->isArray() || ! node->isStruct()) + start = size * index; + else { + // it is a structure + assert(node->isStruct()); + start = 0; + for (int i = 0; i < index; ++i) + start += (*node->getType().getStruct())[i].type->computeNumComponents(); + } + + result = addConstantUnion(TConstUnionArray(node->getAsConstantUnion()->getConstArray(), start, size), node->getType(), loc); + + if (result == nullptr) + result = node; + else + result->setType(dereferencedType); + + return result; +} + +// +// Make a constant vector node or constant scalar node, representing a given +// constant vector and constant swizzle into it. +// +TIntermTyped* TIntermediate::foldSwizzle(TIntermTyped* node, TSwizzleSelectors& selectors, const TSourceLoc& loc) +{ + const TConstUnionArray& unionArray = node->getAsConstantUnion()->getConstArray(); + TConstUnionArray constArray(selectors.size()); + + for (int i = 0; i < selectors.size(); i++) + constArray[i] = unionArray[selectors[i]]; + + TIntermTyped* result = addConstantUnion(constArray, node->getType(), loc); + + if (result == nullptr) + result = node; + else + result->setType(TType(node->getBasicType(), EvqConst, selectors.size())); + + return result; +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/InfoSink.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/InfoSink.cpp new file mode 100644 index 0000000000..7c14783769 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/InfoSink.cpp @@ -0,0 +1,115 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "../Include/InfoSink.h" + +#include + +namespace QtShaderTools { +namespace glslang { + +void TInfoSinkBase::append(const char* s) +{ + if (outputStream & EString) { + if (s == nullptr) + sink.append("(null)"); + else { + checkMem(strlen(s)); + sink.append(s); + } + } + +//#ifdef _WIN32 +// if (outputStream & EDebugger) +// OutputDebugString(s); +//#endif + + if (outputStream & EStdOut) + fprintf(stdout, "%s", s); +} + +void TInfoSinkBase::append(int count, char c) +{ + if (outputStream & EString) { + checkMem(count); + sink.append(count, c); + } + +//#ifdef _WIN32 +// if (outputStream & EDebugger) { +// char str[2]; +// str[0] = c; +// str[1] = '\0'; +// OutputDebugString(str); +// } +//#endif + + if (outputStream & EStdOut) + fprintf(stdout, "%c", c); +} + +void TInfoSinkBase::append(const TPersistString& t) +{ + if (outputStream & EString) { + checkMem(t.size()); + sink.append(t); + } + +//#ifdef _WIN32 +// if (outputStream & EDebugger) +// OutputDebugString(t.c_str()); +//#endif + + if (outputStream & EStdOut) + fprintf(stdout, "%s", t.c_str()); +} + +void TInfoSinkBase::append(const TString& t) +{ + if (outputStream & EString) { + checkMem(t.size()); + sink.append(t.c_str()); + } + +//#ifdef _WIN32 +// if (outputStream & EDebugger) +// OutputDebugString(t.c_str()); +//#endif + + if (outputStream & EStdOut) + fprintf(stdout, "%s", t.c_str()); +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp new file mode 100644 index 0000000000..be5ca669d2 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp @@ -0,0 +1,11553 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2016 LunarG, Inc. +// Copyright (C) 2015-2020 Google, Inc. +// Copyright (C) 2017, 2022-2024 Arm Limited. +// Modifications Copyright (C) 2020-2021 Advanced Micro Devices, Inc. All rights reserved. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// Create strings that declare built-in definitions, add built-ins programmatically +// that cannot be expressed in the strings, and establish mappings between +// built-in functions and operators. +// +// Where to put a built-in: +// TBuiltIns::initialize(version,profile) context-independent textual built-ins; add them to the right string +// TBuiltIns::initialize(resources,...) context-dependent textual built-ins; add them to the right string +// TBuiltIns::identifyBuiltIns(...,symbolTable) context-independent programmatic additions/mappings to the symbol table, +// including identifying what extensions are needed if a version does not allow a symbol +// TBuiltIns::identifyBuiltIns(...,symbolTable, resources) context-dependent programmatic additions/mappings to the symbol table, +// including identifying what extensions are needed if a version does not allow a symbol +// + +#include +#include +#include "Initialize.h" +#include "span.h" + +namespace QtShaderTools { +namespace glslang { + +// TODO: ARB_Compatability: do full extension support +const bool ARBCompatibility = true; + +const bool ForwardCompatibility = false; + +namespace { + +// +// A set of definitions for tabling of the built-in functions. +// + +// Order matters here, as does correlation with the subsequent +// "const int ..." declarations and the ArgType enumerants. +const char* TypeString[] = { + "bool", "bvec2", "bvec3", "bvec4", + "float", "vec2", "vec3", "vec4", + "int", "ivec2", "ivec3", "ivec4", + "uint", "uvec2", "uvec3", "uvec4", +}; +const int TypeStringCount = sizeof(TypeString) / sizeof(char*); // number of entries in 'TypeString' +const int TypeStringRowShift = 2; // shift amount to go downe one row in 'TypeString' +const int TypeStringColumnMask = (1 << TypeStringRowShift) - 1; // reduce type to its column number in 'TypeString' +const int TypeStringScalarMask = ~TypeStringColumnMask; // take type to its scalar column in 'TypeString' + +enum ArgType { + // numbers hardcoded to correspond to 'TypeString'; order and value matter + TypeB = 1 << 0, // Boolean + TypeF = 1 << 1, // float 32 + TypeI = 1 << 2, // int 32 + TypeU = 1 << 3, // uint 32 + TypeF16 = 1 << 4, // float 16 + TypeF64 = 1 << 5, // float 64 + TypeI8 = 1 << 6, // int 8 + TypeI16 = 1 << 7, // int 16 + TypeI64 = 1 << 8, // int 64 + TypeU8 = 1 << 9, // uint 8 + TypeU16 = 1 << 10, // uint 16 + TypeU64 = 1 << 11, // uint 64 +}; +// Mixtures of the above, to help the function tables +const ArgType TypeFI = static_cast(TypeF | TypeI); +const ArgType TypeFIB = static_cast(TypeF | TypeI | TypeB); +const ArgType TypeIU = static_cast(TypeI | TypeU); + +// The relationships between arguments and return type, whether anything is +// output, or other unusual situations. +enum ArgClass { + ClassRegular = 0, // nothing special, just all vector widths with matching return type; traditional arithmetic + ClassLS = 1 << 0, // the last argument is also held fixed as a (type-matched) scalar while the others cycle + ClassXLS = 1 << 1, // the last argument is exclusively a (type-matched) scalar while the others cycle + ClassLS2 = 1 << 2, // the last two arguments are held fixed as a (type-matched) scalar while the others cycle + ClassFS = 1 << 3, // the first argument is held fixed as a (type-matched) scalar while the others cycle + ClassFS2 = 1 << 4, // the first two arguments are held fixed as a (type-matched) scalar while the others cycle + ClassLO = 1 << 5, // the last argument is an output + ClassB = 1 << 6, // return type cycles through only bool/bvec, matching vector width of args + ClassLB = 1 << 7, // last argument cycles through only bool/bvec, matching vector width of args + ClassV1 = 1 << 8, // scalar only + ClassFIO = 1 << 9, // first argument is inout + ClassRS = 1 << 10, // the return is held scalar as the arguments cycle + ClassNS = 1 << 11, // no scalar prototype + ClassCVN = 1 << 12, // first argument is 'coherent volatile nontemporal' + ClassFO = 1 << 13, // first argument is output + ClassV3 = 1 << 14, // vec3 only +}; +// Mixtures of the above, to help the function tables +const ArgClass ClassV1FIOCVN = (ArgClass)(ClassV1 | ClassFIO | ClassCVN); +const ArgClass ClassBNS = (ArgClass)(ClassB | ClassNS); +const ArgClass ClassRSNS = (ArgClass)(ClassRS | ClassNS); + +// A descriptor, for a single profile, of when something is available. +// If the current profile does not match 'profile' mask below, the other fields +// do not apply (nor validate). +// profiles == EBadProfile is the end of an array of these +struct Versioning { + EProfile profiles; // the profile(s) (mask) that the following fields are valid for + int minExtendedVersion; // earliest version when extensions are enabled; ignored if numExtensions is 0 + int minCoreVersion; // earliest version function is in core; 0 means never + int numExtensions; // how many extensions are in the 'extensions' list + const char** extensions; // list of extension names enabling the function +}; + +EProfile EDesktopProfile = static_cast(ENoProfile | ECoreProfile | ECompatibilityProfile); + +// Declare pointers to put into the table for versioning. + const std::array Es300Desktop130Version = { Versioning{ EEsProfile, 0, 300, 0, nullptr }, + Versioning{ EDesktopProfile, 0, 130, 0, nullptr }, + }; + + const std::array Es310Desktop400Version = { Versioning{ EEsProfile, 0, 310, 0, nullptr }, + Versioning{ EDesktopProfile, 0, 400, 0, nullptr }, + }; + + const std::array Es310Desktop450Version = { Versioning{ EEsProfile, 0, 310, 0, nullptr }, + Versioning{ EDesktopProfile, 0, 450, 0, nullptr }, + }; + +// The main descriptor of what a set of function prototypes can look like, and +// a pointer to extra versioning information, when needed. +struct BuiltInFunction { + TOperator op; // operator to map the name to + const char* name; // function name + int numArguments; // number of arguments (overloads with varying arguments need different entries) + ArgType types; // ArgType mask + ArgClass classes; // the ways this particular function entry manifests + const span versioning; // An empty span means always a valid version +}; + +// The tables can have the same built-in function name more than one time, +// but the exact same prototype must be indicated at most once. +// The prototypes that get declared are the union of all those indicated. +// This is important when different releases add new prototypes for the same name. +// It also also congnitively simpler tiling of the prototype space. +// In practice, most names can be fully represented with one entry. +// +// Table is terminated by an OpNull TOperator. + +const std::array BaseFunctions = { +// TOperator, name, arg-count, ArgType, ArgClass, versioning +// --------- ---- --------- ------- -------- ---------- + BuiltInFunction{ EOpRadians, "radians", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpDegrees, "degrees", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpSin, "sin", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpCos, "cos", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpTan, "tan", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpAsin, "asin", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpAcos, "acos", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpAtan, "atan", 2, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpAtan, "atan", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpPow, "pow", 2, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpExp, "exp", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpLog, "log", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpExp2, "exp2", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpLog2, "log2", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpSqrt, "sqrt", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpInverseSqrt, "inversesqrt", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpAbs, "abs", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpSign, "sign", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpFloor, "floor", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpCeil, "ceil", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpFract, "fract", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpMod, "mod", 2, TypeF, ClassLS, {} }, + BuiltInFunction{ EOpMin, "min", 2, TypeF, ClassLS, {} }, + BuiltInFunction{ EOpMax, "max", 2, TypeF, ClassLS, {} }, + BuiltInFunction{ EOpClamp, "clamp", 3, TypeF, ClassLS2, {} }, + BuiltInFunction{ EOpMix, "mix", 3, TypeF, ClassLS, {} }, + BuiltInFunction{ EOpStep, "step", 2, TypeF, ClassFS, {} }, + BuiltInFunction{ EOpSmoothStep, "smoothstep", 3, TypeF, ClassFS2, {} }, + BuiltInFunction{ EOpNormalize, "normalize", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpFaceForward, "faceforward", 3, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpReflect, "reflect", 2, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpRefract, "refract", 3, TypeF, ClassXLS, {} }, + BuiltInFunction{ EOpLength, "length", 1, TypeF, ClassRS, {} }, + BuiltInFunction{ EOpDistance, "distance", 2, TypeF, ClassRS, {} }, + BuiltInFunction{ EOpDot, "dot", 2, TypeF, ClassRS, {} }, + BuiltInFunction{ EOpCross, "cross", 2, TypeF, ClassV3, {} }, + BuiltInFunction{ EOpLessThan, "lessThan", 2, TypeFI, ClassBNS, {} }, + BuiltInFunction{ EOpLessThanEqual, "lessThanEqual", 2, TypeFI, ClassBNS, {} }, + BuiltInFunction{ EOpGreaterThan, "greaterThan", 2, TypeFI, ClassBNS, {} }, + BuiltInFunction{ EOpGreaterThanEqual, "greaterThanEqual", 2, TypeFI, ClassBNS, {} }, + BuiltInFunction{ EOpVectorEqual, "equal", 2, TypeFIB, ClassBNS, {} }, + BuiltInFunction{ EOpVectorNotEqual, "notEqual", 2, TypeFIB, ClassBNS, {} }, + BuiltInFunction{ EOpAny, "any", 1, TypeB, ClassRSNS, {} }, + BuiltInFunction{ EOpAll, "all", 1, TypeB, ClassRSNS, {} }, + BuiltInFunction{ EOpVectorLogicalNot, "not", 1, TypeB, ClassNS, {} }, + BuiltInFunction{ EOpSinh, "sinh", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpCosh, "cosh", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpTanh, "tanh", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpAsinh, "asinh", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpAcosh, "acosh", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpAtanh, "atanh", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpAbs, "abs", 1, TypeI, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpSign, "sign", 1, TypeI, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpTrunc, "trunc", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpRound, "round", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpRoundEven, "roundEven", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpModf, "modf", 2, TypeF, ClassLO, {Es300Desktop130Version} }, + BuiltInFunction{ EOpMin, "min", 2, TypeIU, ClassLS, {Es300Desktop130Version} }, + BuiltInFunction{ EOpMax, "max", 2, TypeIU, ClassLS, {Es300Desktop130Version} }, + BuiltInFunction{ EOpClamp, "clamp", 3, TypeIU, ClassLS2, {Es300Desktop130Version} }, + BuiltInFunction{ EOpMix, "mix", 3, TypeF, ClassLB, {Es300Desktop130Version} }, + BuiltInFunction{ EOpIsInf, "isinf", 1, TypeF, ClassB, {Es300Desktop130Version} }, + BuiltInFunction{ EOpIsNan, "isnan", 1, TypeF, ClassB, {Es300Desktop130Version} }, + BuiltInFunction{ EOpLessThan, "lessThan", 2, TypeU, ClassBNS, {Es300Desktop130Version} }, + BuiltInFunction{ EOpLessThanEqual, "lessThanEqual", 2, TypeU, ClassBNS, {Es300Desktop130Version} }, + BuiltInFunction{ EOpGreaterThan, "greaterThan", 2, TypeU, ClassBNS, {Es300Desktop130Version} }, + BuiltInFunction{ EOpGreaterThanEqual, "greaterThanEqual", 2, TypeU, ClassBNS, {Es300Desktop130Version} }, + BuiltInFunction{ EOpVectorEqual, "equal", 2, TypeU, ClassBNS, {Es300Desktop130Version} }, + BuiltInFunction{ EOpVectorNotEqual, "notEqual", 2, TypeU, ClassBNS, {Es300Desktop130Version} }, + BuiltInFunction{ EOpAtomicAdd, "atomicAdd", 2, TypeIU, ClassV1FIOCVN, {Es310Desktop400Version} }, + BuiltInFunction{ EOpAtomicMin, "atomicMin", 2, TypeIU, ClassV1FIOCVN, {Es310Desktop400Version} }, + BuiltInFunction{ EOpAtomicMax, "atomicMax", 2, TypeIU, ClassV1FIOCVN, {Es310Desktop400Version} }, + BuiltInFunction{ EOpAtomicAnd, "atomicAnd", 2, TypeIU, ClassV1FIOCVN, {Es310Desktop400Version} }, + BuiltInFunction{ EOpAtomicOr, "atomicOr", 2, TypeIU, ClassV1FIOCVN, {Es310Desktop400Version} }, + BuiltInFunction{ EOpAtomicXor, "atomicXor", 2, TypeIU, ClassV1FIOCVN, {Es310Desktop400Version} }, + BuiltInFunction{ EOpAtomicExchange, "atomicExchange", 2, TypeIU, ClassV1FIOCVN, {Es310Desktop400Version} }, + BuiltInFunction{ EOpAtomicCompSwap, "atomicCompSwap", 3, TypeIU, ClassV1FIOCVN, {Es310Desktop400Version} }, + BuiltInFunction{ EOpMix, "mix", 3, TypeB, ClassRegular, {Es310Desktop450Version} }, + BuiltInFunction{ EOpMix, "mix", 3, TypeIU, ClassLB, {Es310Desktop450Version} }, +}; + +const std::array DerivativeFunctions = { + BuiltInFunction{ EOpDPdx, "dFdx", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpDPdy, "dFdy", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpFwidth, "fwidth", 1, TypeF, ClassRegular, {} }, +}; + +// For functions declared some other way, but still use the table to relate to operator. +struct CustomFunction { + TOperator op; // operator to map the name to + const char* name; // function name + const span versioning; // An empty span means always a valid version +}; + +const CustomFunction CustomFunctions[] = { + { EOpBarrier, "barrier", {} }, + { EOpMemoryBarrierShared, "memoryBarrierShared", {} }, + { EOpGroupMemoryBarrier, "groupMemoryBarrier", {} }, + { EOpMemoryBarrier, "memoryBarrier", {} }, + { EOpMemoryBarrierBuffer, "memoryBarrierBuffer", {} }, + + { EOpPackSnorm2x16, "packSnorm2x16", {} }, + { EOpUnpackSnorm2x16, "unpackSnorm2x16", {} }, + { EOpPackUnorm2x16, "packUnorm2x16", {} }, + { EOpUnpackUnorm2x16, "unpackUnorm2x16", {} }, + { EOpPackHalf2x16, "packHalf2x16", {} }, + { EOpUnpackHalf2x16, "unpackHalf2x16", {} }, + + { EOpMul, "matrixCompMult", {} }, + { EOpOuterProduct, "outerProduct", {} }, + { EOpTranspose, "transpose", {} }, + { EOpDeterminant, "determinant", {} }, + { EOpMatrixInverse, "inverse", {} }, + { EOpFloatBitsToInt, "floatBitsToInt", {} }, + { EOpFloatBitsToUint, "floatBitsToUint", {} }, + { EOpIntBitsToFloat, "intBitsToFloat", {} }, + { EOpUintBitsToFloat, "uintBitsToFloat", {} }, + + { EOpTextureQuerySize, "textureSize", {} }, + { EOpTextureQueryLod, "textureQueryLod", {} }, + { EOpTextureQueryLod, "textureQueryLOD", {} }, // extension GL_ARB_texture_query_lod + { EOpTextureQueryLevels, "textureQueryLevels", {} }, + { EOpTextureQuerySamples, "textureSamples", {} }, + { EOpTexture, "texture", {} }, + { EOpTextureProj, "textureProj", {} }, + { EOpTextureLod, "textureLod", {} }, + { EOpTextureOffset, "textureOffset", {} }, + { EOpTextureFetch, "texelFetch", {} }, + { EOpTextureFetchOffset, "texelFetchOffset", {} }, + { EOpTextureProjOffset, "textureProjOffset", {} }, + { EOpTextureLodOffset, "textureLodOffset", {} }, + { EOpTextureProjLod, "textureProjLod", {} }, + { EOpTextureProjLodOffset, "textureProjLodOffset", {} }, + { EOpTextureGrad, "textureGrad", {} }, + { EOpTextureGradOffset, "textureGradOffset", {} }, + { EOpTextureProjGrad, "textureProjGrad", {} }, + { EOpTextureProjGradOffset, "textureProjGradOffset", {} }, +}; + +// For the given table of functions, add all the indicated prototypes for each +// one, to be returned in the passed in decls. +void AddTabledBuiltin(TString& decls, const BuiltInFunction& function) +{ + const auto isScalarType = [](int type) { return (type & TypeStringColumnMask) == 0; }; + + // loop across these two: + // 0: the varying arg set, and + // 1: the fixed scalar args + const ArgClass ClassFixed = (ArgClass)(ClassLS | ClassXLS | ClassLS2 | ClassFS | ClassFS2); + for (int fixed = 0; fixed < ((function.classes & ClassFixed) > 0 ? 2 : 1); ++fixed) { + + if (fixed == 0 && (function.classes & ClassXLS)) + continue; + + // walk the type strings in TypeString[] + for (int type = 0; type < TypeStringCount; ++type) { + // skip types not selected: go from type to row number to type bit + if ((function.types & (1 << (type >> TypeStringRowShift))) == 0) + continue; + + // if we aren't on a scalar, and should be, skip + if ((function.classes & ClassV1) && !isScalarType(type)) + continue; + + // if we aren't on a 3-vector, and should be, skip + if ((function.classes & ClassV3) && (type & TypeStringColumnMask) != 2) + continue; + + // skip replication of all arg scalars between the varying arg set and the fixed args + if (fixed == 1 && type == (type & TypeStringScalarMask) && (function.classes & ClassXLS) == 0) + continue; + + // skip scalars when we are told to + if ((function.classes & ClassNS) && isScalarType(type)) + continue; + + // return type + if (function.classes & ClassB) + decls.append(TypeString[type & TypeStringColumnMask]); + else if (function.classes & ClassRS) + decls.append(TypeString[type & TypeStringScalarMask]); + else + decls.append(TypeString[type]); + decls.append(" "); + decls.append(function.name); + decls.append("("); + + // arguments + for (int arg = 0; arg < function.numArguments; ++arg) { + if (arg == function.numArguments - 1 && (function.classes & ClassLO)) + decls.append("out "); + if (arg == 0) { + if (function.classes & ClassCVN) + decls.append("coherent volatile nontemporal "); + if (function.classes & ClassFIO) + decls.append("inout "); + if (function.classes & ClassFO) + decls.append("out "); + } + if ((function.classes & ClassLB) && arg == function.numArguments - 1) + decls.append(TypeString[type & TypeStringColumnMask]); + else if (fixed && ((arg == function.numArguments - 1 && (function.classes & (ClassLS | ClassXLS | + ClassLS2))) || + (arg == function.numArguments - 2 && (function.classes & ClassLS2)) || + (arg == 0 && (function.classes & (ClassFS | ClassFS2))) || + (arg == 1 && (function.classes & ClassFS2)))) + decls.append(TypeString[type & TypeStringScalarMask]); + else + decls.append(TypeString[type]); + if (arg < function.numArguments - 1) + decls.append(","); + } + decls.append(");\n"); + } + } +} + +// See if the tabled versioning information allows the current version. +bool ValidVersion(const BuiltInFunction& function, int version, EProfile profile, const SpvVersion& /* spVersion */) +{ + // nullptr means always valid + if (function.versioning.empty()) + return true; + + // check for what is said about our current profile + for (const auto& v : function.versioning) { + if ((v.profiles & profile) != 0) { + if (v.minCoreVersion <= version || (v.numExtensions > 0 && v.minExtendedVersion <= version)) + return true; + } + } + + return false; +} + +// Relate a single table of built-ins to their AST operator. +// This can get called redundantly (especially for the common built-ins, when +// called once per stage). This is a performance issue only, not a correctness +// concern. It is done for quality arising from simplicity, as there are subtleties +// to get correct if instead trying to do it surgically. +template +void RelateTabledBuiltins(const FunctionContainer& functions, TSymbolTable& symbolTable) +{ + for (const auto& fn : functions) { + symbolTable.relateToOperator(fn.name, fn.op); + } +} + +} // end anonymous namespace + +// Add declarations for all tables of built-in functions. +void TBuiltIns::addTabledBuiltins(int version, EProfile profile, const SpvVersion& spvVersion) +{ + const auto forEachFunction = [&](TString& decls, const span& functions) { + for (const auto& fn : functions) { + if (ValidVersion(fn, version, profile, spvVersion)) + AddTabledBuiltin(decls, fn); + } + }; + + forEachFunction(commonBuiltins, BaseFunctions); + forEachFunction(stageBuiltins[EShLangFragment], DerivativeFunctions); + + if ((profile == EEsProfile && version >= 320) || (profile != EEsProfile && version >= 450)) + forEachFunction(stageBuiltins[EShLangCompute], DerivativeFunctions); +} + +// Relate all tables of built-ins to the AST operators. +void TBuiltIns::relateTabledBuiltins(int /* version */, EProfile /* profile */, const SpvVersion& /* spvVersion */, EShLanguage /* stage */, TSymbolTable& symbolTable) +{ + RelateTabledBuiltins(BaseFunctions, symbolTable); + RelateTabledBuiltins(DerivativeFunctions, symbolTable); + RelateTabledBuiltins(CustomFunctions, symbolTable); +} + +inline bool IncludeLegacy(int version, EProfile profile, const SpvVersion& spvVersion) +{ + return profile != EEsProfile && (version <= 130 || (spvVersion.spv == 0 && version == 140 && ARBCompatibility) || + profile == ECompatibilityProfile); +} + +// Construct TBuiltInParseables base class. This can be used for language-common constructs. +TBuiltInParseables::TBuiltInParseables() +{ +} + +// Destroy TBuiltInParseables. +TBuiltInParseables::~TBuiltInParseables() +{ +} + +TBuiltIns::TBuiltIns() +{ + // Set up textual representations for making all the permutations + // of texturing/imaging functions. + prefixes[EbtFloat] = ""; + prefixes[EbtInt] = "i"; + prefixes[EbtUint] = "u"; + prefixes[EbtFloat16] = "f16"; + prefixes[EbtInt8] = "i8"; + prefixes[EbtUint8] = "u8"; + prefixes[EbtInt16] = "i16"; + prefixes[EbtUint16] = "u16"; + prefixes[EbtInt64] = "i64"; + prefixes[EbtUint64] = "u64"; + + postfixes[2] = "2"; + postfixes[3] = "3"; + postfixes[4] = "4"; + + // Map from symbolic class of texturing dimension to numeric dimensions. + dimMap[Esd2D] = 2; + dimMap[Esd3D] = 3; + dimMap[EsdCube] = 3; + dimMap[Esd1D] = 1; + dimMap[EsdRect] = 2; + dimMap[EsdBuffer] = 1; + dimMap[EsdSubpass] = 2; // potentially unused for now + dimMap[EsdAttachmentEXT] = 2; // potentially unused for now +} + +TBuiltIns::~TBuiltIns() +{ +} + + +// +// Add all context-independent built-in functions and variables that are present +// for the given version and profile. Share common ones across stages, otherwise +// make stage-specific entries. +// +// Most built-ins variables can be added as simple text strings. Some need to +// be added programmatically, which is done later in IdentifyBuiltIns() below. +// +void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvVersion) +{ + addTabledBuiltins(version, profile, spvVersion); + + //============================================================================ + // + // Prototypes for built-in functions used repeatly by different shaders + // + //============================================================================ + + // + // Derivatives Functions. + // + TString derivativeControls ( + "float dFdxFine(float p);" + "vec2 dFdxFine(vec2 p);" + "vec3 dFdxFine(vec3 p);" + "vec4 dFdxFine(vec4 p);" + + "float dFdyFine(float p);" + "vec2 dFdyFine(vec2 p);" + "vec3 dFdyFine(vec3 p);" + "vec4 dFdyFine(vec4 p);" + + "float fwidthFine(float p);" + "vec2 fwidthFine(vec2 p);" + "vec3 fwidthFine(vec3 p);" + "vec4 fwidthFine(vec4 p);" + + "float dFdxCoarse(float p);" + "vec2 dFdxCoarse(vec2 p);" + "vec3 dFdxCoarse(vec3 p);" + "vec4 dFdxCoarse(vec4 p);" + + "float dFdyCoarse(float p);" + "vec2 dFdyCoarse(vec2 p);" + "vec3 dFdyCoarse(vec3 p);" + "vec4 dFdyCoarse(vec4 p);" + + "float fwidthCoarse(float p);" + "vec2 fwidthCoarse(vec2 p);" + "vec3 fwidthCoarse(vec3 p);" + "vec4 fwidthCoarse(vec4 p);" + ); + + TString derivativesAndControl16bits ( + "float16_t dFdx(float16_t);" + "f16vec2 dFdx(f16vec2);" + "f16vec3 dFdx(f16vec3);" + "f16vec4 dFdx(f16vec4);" + + "float16_t dFdy(float16_t);" + "f16vec2 dFdy(f16vec2);" + "f16vec3 dFdy(f16vec3);" + "f16vec4 dFdy(f16vec4);" + + "float16_t dFdxFine(float16_t);" + "f16vec2 dFdxFine(f16vec2);" + "f16vec3 dFdxFine(f16vec3);" + "f16vec4 dFdxFine(f16vec4);" + + "float16_t dFdyFine(float16_t);" + "f16vec2 dFdyFine(f16vec2);" + "f16vec3 dFdyFine(f16vec3);" + "f16vec4 dFdyFine(f16vec4);" + + "float16_t dFdxCoarse(float16_t);" + "f16vec2 dFdxCoarse(f16vec2);" + "f16vec3 dFdxCoarse(f16vec3);" + "f16vec4 dFdxCoarse(f16vec4);" + + "float16_t dFdyCoarse(float16_t);" + "f16vec2 dFdyCoarse(f16vec2);" + "f16vec3 dFdyCoarse(f16vec3);" + "f16vec4 dFdyCoarse(f16vec4);" + + "float16_t fwidth(float16_t);" + "f16vec2 fwidth(f16vec2);" + "f16vec3 fwidth(f16vec3);" + "f16vec4 fwidth(f16vec4);" + + "float16_t fwidthFine(float16_t);" + "f16vec2 fwidthFine(f16vec2);" + "f16vec3 fwidthFine(f16vec3);" + "f16vec4 fwidthFine(f16vec4);" + + "float16_t fwidthCoarse(float16_t);" + "f16vec2 fwidthCoarse(f16vec2);" + "f16vec3 fwidthCoarse(f16vec3);" + "f16vec4 fwidthCoarse(f16vec4);" + ); + + TString derivativesAndControl64bits ( + "float64_t dFdx(float64_t);" + "f64vec2 dFdx(f64vec2);" + "f64vec3 dFdx(f64vec3);" + "f64vec4 dFdx(f64vec4);" + + "float64_t dFdy(float64_t);" + "f64vec2 dFdy(f64vec2);" + "f64vec3 dFdy(f64vec3);" + "f64vec4 dFdy(f64vec4);" + + "float64_t dFdxFine(float64_t);" + "f64vec2 dFdxFine(f64vec2);" + "f64vec3 dFdxFine(f64vec3);" + "f64vec4 dFdxFine(f64vec4);" + + "float64_t dFdyFine(float64_t);" + "f64vec2 dFdyFine(f64vec2);" + "f64vec3 dFdyFine(f64vec3);" + "f64vec4 dFdyFine(f64vec4);" + + "float64_t dFdxCoarse(float64_t);" + "f64vec2 dFdxCoarse(f64vec2);" + "f64vec3 dFdxCoarse(f64vec3);" + "f64vec4 dFdxCoarse(f64vec4);" + + "float64_t dFdyCoarse(float64_t);" + "f64vec2 dFdyCoarse(f64vec2);" + "f64vec3 dFdyCoarse(f64vec3);" + "f64vec4 dFdyCoarse(f64vec4);" + + "float64_t fwidth(float64_t);" + "f64vec2 fwidth(f64vec2);" + "f64vec3 fwidth(f64vec3);" + "f64vec4 fwidth(f64vec4);" + + "float64_t fwidthFine(float64_t);" + "f64vec2 fwidthFine(f64vec2);" + "f64vec3 fwidthFine(f64vec3);" + "f64vec4 fwidthFine(f64vec4);" + + "float64_t fwidthCoarse(float64_t);" + "f64vec2 fwidthCoarse(f64vec2);" + "f64vec3 fwidthCoarse(f64vec3);" + "f64vec4 fwidthCoarse(f64vec4);" + ); + + //============================================================================ + // + // Prototypes for built-in functions seen by both vertex and fragment shaders. + // + //============================================================================ + + // + // double functions added to desktop 4.00, but not fma, frexp, ldexp, or pack/unpack + // + if (profile != EEsProfile && version >= 150) { // ARB_gpu_shader_fp64 + commonBuiltins.append( + + "double sqrt(double);" + "dvec2 sqrt(dvec2);" + "dvec3 sqrt(dvec3);" + "dvec4 sqrt(dvec4);" + + "double inversesqrt(double);" + "dvec2 inversesqrt(dvec2);" + "dvec3 inversesqrt(dvec3);" + "dvec4 inversesqrt(dvec4);" + + "double abs(double);" + "dvec2 abs(dvec2);" + "dvec3 abs(dvec3);" + "dvec4 abs(dvec4);" + + "double sign(double);" + "dvec2 sign(dvec2);" + "dvec3 sign(dvec3);" + "dvec4 sign(dvec4);" + + "double floor(double);" + "dvec2 floor(dvec2);" + "dvec3 floor(dvec3);" + "dvec4 floor(dvec4);" + + "double trunc(double);" + "dvec2 trunc(dvec2);" + "dvec3 trunc(dvec3);" + "dvec4 trunc(dvec4);" + + "double round(double);" + "dvec2 round(dvec2);" + "dvec3 round(dvec3);" + "dvec4 round(dvec4);" + + "double roundEven(double);" + "dvec2 roundEven(dvec2);" + "dvec3 roundEven(dvec3);" + "dvec4 roundEven(dvec4);" + + "double ceil(double);" + "dvec2 ceil(dvec2);" + "dvec3 ceil(dvec3);" + "dvec4 ceil(dvec4);" + + "double fract(double);" + "dvec2 fract(dvec2);" + "dvec3 fract(dvec3);" + "dvec4 fract(dvec4);" + + "double mod(double, double);" + "dvec2 mod(dvec2 , double);" + "dvec3 mod(dvec3 , double);" + "dvec4 mod(dvec4 , double);" + "dvec2 mod(dvec2 , dvec2);" + "dvec3 mod(dvec3 , dvec3);" + "dvec4 mod(dvec4 , dvec4);" + + "double modf(double, out double);" + "dvec2 modf(dvec2, out dvec2);" + "dvec3 modf(dvec3, out dvec3);" + "dvec4 modf(dvec4, out dvec4);" + + "double min(double, double);" + "dvec2 min(dvec2, double);" + "dvec3 min(dvec3, double);" + "dvec4 min(dvec4, double);" + "dvec2 min(dvec2, dvec2);" + "dvec3 min(dvec3, dvec3);" + "dvec4 min(dvec4, dvec4);" + + "double max(double, double);" + "dvec2 max(dvec2 , double);" + "dvec3 max(dvec3 , double);" + "dvec4 max(dvec4 , double);" + "dvec2 max(dvec2 , dvec2);" + "dvec3 max(dvec3 , dvec3);" + "dvec4 max(dvec4 , dvec4);" + + "double clamp(double, double, double);" + "dvec2 clamp(dvec2 , double, double);" + "dvec3 clamp(dvec3 , double, double);" + "dvec4 clamp(dvec4 , double, double);" + "dvec2 clamp(dvec2 , dvec2 , dvec2);" + "dvec3 clamp(dvec3 , dvec3 , dvec3);" + "dvec4 clamp(dvec4 , dvec4 , dvec4);" + + "double mix(double, double, double);" + "dvec2 mix(dvec2, dvec2, double);" + "dvec3 mix(dvec3, dvec3, double);" + "dvec4 mix(dvec4, dvec4, double);" + "dvec2 mix(dvec2, dvec2, dvec2);" + "dvec3 mix(dvec3, dvec3, dvec3);" + "dvec4 mix(dvec4, dvec4, dvec4);" + "double mix(double, double, bool);" + "dvec2 mix(dvec2, dvec2, bvec2);" + "dvec3 mix(dvec3, dvec3, bvec3);" + "dvec4 mix(dvec4, dvec4, bvec4);" + + "double step(double, double);" + "dvec2 step(dvec2 , dvec2);" + "dvec3 step(dvec3 , dvec3);" + "dvec4 step(dvec4 , dvec4);" + "dvec2 step(double, dvec2);" + "dvec3 step(double, dvec3);" + "dvec4 step(double, dvec4);" + + "double smoothstep(double, double, double);" + "dvec2 smoothstep(dvec2 , dvec2 , dvec2);" + "dvec3 smoothstep(dvec3 , dvec3 , dvec3);" + "dvec4 smoothstep(dvec4 , dvec4 , dvec4);" + "dvec2 smoothstep(double, double, dvec2);" + "dvec3 smoothstep(double, double, dvec3);" + "dvec4 smoothstep(double, double, dvec4);" + + "bool isnan(double);" + "bvec2 isnan(dvec2);" + "bvec3 isnan(dvec3);" + "bvec4 isnan(dvec4);" + + "bool isinf(double);" + "bvec2 isinf(dvec2);" + "bvec3 isinf(dvec3);" + "bvec4 isinf(dvec4);" + + "double length(double);" + "double length(dvec2);" + "double length(dvec3);" + "double length(dvec4);" + + "double distance(double, double);" + "double distance(dvec2 , dvec2);" + "double distance(dvec3 , dvec3);" + "double distance(dvec4 , dvec4);" + + "double dot(double, double);" + "double dot(dvec2 , dvec2);" + "double dot(dvec3 , dvec3);" + "double dot(dvec4 , dvec4);" + + "dvec3 cross(dvec3, dvec3);" + + "double normalize(double);" + "dvec2 normalize(dvec2);" + "dvec3 normalize(dvec3);" + "dvec4 normalize(dvec4);" + + "double faceforward(double, double, double);" + "dvec2 faceforward(dvec2, dvec2, dvec2);" + "dvec3 faceforward(dvec3, dvec3, dvec3);" + "dvec4 faceforward(dvec4, dvec4, dvec4);" + + "double reflect(double, double);" + "dvec2 reflect(dvec2 , dvec2 );" + "dvec3 reflect(dvec3 , dvec3 );" + "dvec4 reflect(dvec4 , dvec4 );" + + "double refract(double, double, double);" + "dvec2 refract(dvec2 , dvec2 , double);" + "dvec3 refract(dvec3 , dvec3 , double);" + "dvec4 refract(dvec4 , dvec4 , double);" + + "dmat2 matrixCompMult(dmat2, dmat2);" + "dmat3 matrixCompMult(dmat3, dmat3);" + "dmat4 matrixCompMult(dmat4, dmat4);" + "dmat2x3 matrixCompMult(dmat2x3, dmat2x3);" + "dmat2x4 matrixCompMult(dmat2x4, dmat2x4);" + "dmat3x2 matrixCompMult(dmat3x2, dmat3x2);" + "dmat3x4 matrixCompMult(dmat3x4, dmat3x4);" + "dmat4x2 matrixCompMult(dmat4x2, dmat4x2);" + "dmat4x3 matrixCompMult(dmat4x3, dmat4x3);" + + "dmat2 outerProduct(dvec2, dvec2);" + "dmat3 outerProduct(dvec3, dvec3);" + "dmat4 outerProduct(dvec4, dvec4);" + "dmat2x3 outerProduct(dvec3, dvec2);" + "dmat3x2 outerProduct(dvec2, dvec3);" + "dmat2x4 outerProduct(dvec4, dvec2);" + "dmat4x2 outerProduct(dvec2, dvec4);" + "dmat3x4 outerProduct(dvec4, dvec3);" + "dmat4x3 outerProduct(dvec3, dvec4);" + + "dmat2 transpose(dmat2);" + "dmat3 transpose(dmat3);" + "dmat4 transpose(dmat4);" + "dmat2x3 transpose(dmat3x2);" + "dmat3x2 transpose(dmat2x3);" + "dmat2x4 transpose(dmat4x2);" + "dmat4x2 transpose(dmat2x4);" + "dmat3x4 transpose(dmat4x3);" + "dmat4x3 transpose(dmat3x4);" + + "double determinant(dmat2);" + "double determinant(dmat3);" + "double determinant(dmat4);" + + "dmat2 inverse(dmat2);" + "dmat3 inverse(dmat3);" + "dmat4 inverse(dmat4);" + + "bvec2 lessThan(dvec2, dvec2);" + "bvec3 lessThan(dvec3, dvec3);" + "bvec4 lessThan(dvec4, dvec4);" + + "bvec2 lessThanEqual(dvec2, dvec2);" + "bvec3 lessThanEqual(dvec3, dvec3);" + "bvec4 lessThanEqual(dvec4, dvec4);" + + "bvec2 greaterThan(dvec2, dvec2);" + "bvec3 greaterThan(dvec3, dvec3);" + "bvec4 greaterThan(dvec4, dvec4);" + + "bvec2 greaterThanEqual(dvec2, dvec2);" + "bvec3 greaterThanEqual(dvec3, dvec3);" + "bvec4 greaterThanEqual(dvec4, dvec4);" + + "bvec2 equal(dvec2, dvec2);" + "bvec3 equal(dvec3, dvec3);" + "bvec4 equal(dvec4, dvec4);" + + "bvec2 notEqual(dvec2, dvec2);" + "bvec3 notEqual(dvec3, dvec3);" + "bvec4 notEqual(dvec4, dvec4);" + + "\n"); + } + + if (profile == EEsProfile && version >= 310) { // Explicit Types + commonBuiltins.append( + + "float64_t sqrt(float64_t);" + "f64vec2 sqrt(f64vec2);" + "f64vec3 sqrt(f64vec3);" + "f64vec4 sqrt(f64vec4);" + + "float64_t inversesqrt(float64_t);" + "f64vec2 inversesqrt(f64vec2);" + "f64vec3 inversesqrt(f64vec3);" + "f64vec4 inversesqrt(f64vec4);" + + "float64_t abs(float64_t);" + "f64vec2 abs(f64vec2);" + "f64vec3 abs(f64vec3);" + "f64vec4 abs(f64vec4);" + + "float64_t sign(float64_t);" + "f64vec2 sign(f64vec2);" + "f64vec3 sign(f64vec3);" + "f64vec4 sign(f64vec4);" + + "float64_t floor(float64_t);" + "f64vec2 floor(f64vec2);" + "f64vec3 floor(f64vec3);" + "f64vec4 floor(f64vec4);" + + "float64_t trunc(float64_t);" + "f64vec2 trunc(f64vec2);" + "f64vec3 trunc(f64vec3);" + "f64vec4 trunc(f64vec4);" + + "float64_t round(float64_t);" + "f64vec2 round(f64vec2);" + "f64vec3 round(f64vec3);" + "f64vec4 round(f64vec4);" + + "float64_t roundEven(float64_t);" + "f64vec2 roundEven(f64vec2);" + "f64vec3 roundEven(f64vec3);" + "f64vec4 roundEven(f64vec4);" + + "float64_t ceil(float64_t);" + "f64vec2 ceil(f64vec2);" + "f64vec3 ceil(f64vec3);" + "f64vec4 ceil(f64vec4);" + + "float64_t fract(float64_t);" + "f64vec2 fract(f64vec2);" + "f64vec3 fract(f64vec3);" + "f64vec4 fract(f64vec4);" + + "float64_t mod(float64_t, float64_t);" + "f64vec2 mod(f64vec2 , float64_t);" + "f64vec3 mod(f64vec3 , float64_t);" + "f64vec4 mod(f64vec4 , float64_t);" + "f64vec2 mod(f64vec2 , f64vec2);" + "f64vec3 mod(f64vec3 , f64vec3);" + "f64vec4 mod(f64vec4 , f64vec4);" + + "float64_t modf(float64_t, out float64_t);" + "f64vec2 modf(f64vec2, out f64vec2);" + "f64vec3 modf(f64vec3, out f64vec3);" + "f64vec4 modf(f64vec4, out f64vec4);" + + "float64_t min(float64_t, float64_t);" + "f64vec2 min(f64vec2, float64_t);" + "f64vec3 min(f64vec3, float64_t);" + "f64vec4 min(f64vec4, float64_t);" + "f64vec2 min(f64vec2, f64vec2);" + "f64vec3 min(f64vec3, f64vec3);" + "f64vec4 min(f64vec4, f64vec4);" + + "float64_t max(float64_t, float64_t);" + "f64vec2 max(f64vec2 , float64_t);" + "f64vec3 max(f64vec3 , float64_t);" + "f64vec4 max(f64vec4 , float64_t);" + "f64vec2 max(f64vec2 , f64vec2);" + "f64vec3 max(f64vec3 , f64vec3);" + "f64vec4 max(f64vec4 , f64vec4);" + + "float64_t clamp(float64_t, float64_t, float64_t);" + "f64vec2 clamp(f64vec2 , float64_t, float64_t);" + "f64vec3 clamp(f64vec3 , float64_t, float64_t);" + "f64vec4 clamp(f64vec4 , float64_t, float64_t);" + "f64vec2 clamp(f64vec2 , f64vec2 , f64vec2);" + "f64vec3 clamp(f64vec3 , f64vec3 , f64vec3);" + "f64vec4 clamp(f64vec4 , f64vec4 , f64vec4);" + + "float64_t mix(float64_t, float64_t, float64_t);" + "f64vec2 mix(f64vec2, f64vec2, float64_t);" + "f64vec3 mix(f64vec3, f64vec3, float64_t);" + "f64vec4 mix(f64vec4, f64vec4, float64_t);" + "f64vec2 mix(f64vec2, f64vec2, f64vec2);" + "f64vec3 mix(f64vec3, f64vec3, f64vec3);" + "f64vec4 mix(f64vec4, f64vec4, f64vec4);" + "float64_t mix(float64_t, float64_t, bool);" + "f64vec2 mix(f64vec2, f64vec2, bvec2);" + "f64vec3 mix(f64vec3, f64vec3, bvec3);" + "f64vec4 mix(f64vec4, f64vec4, bvec4);" + + "float64_t step(float64_t, float64_t);" + "f64vec2 step(f64vec2 , f64vec2);" + "f64vec3 step(f64vec3 , f64vec3);" + "f64vec4 step(f64vec4 , f64vec4);" + "f64vec2 step(float64_t, f64vec2);" + "f64vec3 step(float64_t, f64vec3);" + "f64vec4 step(float64_t, f64vec4);" + + "float64_t smoothstep(float64_t, float64_t, float64_t);" + "f64vec2 smoothstep(f64vec2 , f64vec2 , f64vec2);" + "f64vec3 smoothstep(f64vec3 , f64vec3 , f64vec3);" + "f64vec4 smoothstep(f64vec4 , f64vec4 , f64vec4);" + "f64vec2 smoothstep(float64_t, float64_t, f64vec2);" + "f64vec3 smoothstep(float64_t, float64_t, f64vec3);" + "f64vec4 smoothstep(float64_t, float64_t, f64vec4);" + + "float64_t length(float64_t);" + "float64_t length(f64vec2);" + "float64_t length(f64vec3);" + "float64_t length(f64vec4);" + + "float64_t distance(float64_t, float64_t);" + "float64_t distance(f64vec2 , f64vec2);" + "float64_t distance(f64vec3 , f64vec3);" + "float64_t distance(f64vec4 , f64vec4);" + + "float64_t dot(float64_t, float64_t);" + "float64_t dot(f64vec2 , f64vec2);" + "float64_t dot(f64vec3 , f64vec3);" + "float64_t dot(f64vec4 , f64vec4);" + + "f64vec3 cross(f64vec3, f64vec3);" + + "float64_t normalize(float64_t);" + "f64vec2 normalize(f64vec2);" + "f64vec3 normalize(f64vec3);" + "f64vec4 normalize(f64vec4);" + + "float64_t faceforward(float64_t, float64_t, float64_t);" + "f64vec2 faceforward(f64vec2, f64vec2, f64vec2);" + "f64vec3 faceforward(f64vec3, f64vec3, f64vec3);" + "f64vec4 faceforward(f64vec4, f64vec4, f64vec4);" + + "float64_t reflect(float64_t, float64_t);" + "f64vec2 reflect(f64vec2 , f64vec2 );" + "f64vec3 reflect(f64vec3 , f64vec3 );" + "f64vec4 reflect(f64vec4 , f64vec4 );" + + "float64_t refract(float64_t, float64_t, float64_t);" + "f64vec2 refract(f64vec2 , f64vec2 , float64_t);" + "f64vec3 refract(f64vec3 , f64vec3 , float64_t);" + "f64vec4 refract(f64vec4 , f64vec4 , float64_t);" + + "f64mat2 matrixCompMult(f64mat2, f64mat2);" + "f64mat3 matrixCompMult(f64mat3, f64mat3);" + "f64mat4 matrixCompMult(f64mat4, f64mat4);" + "f64mat2x3 matrixCompMult(f64mat2x3, f64mat2x3);" + "f64mat2x4 matrixCompMult(f64mat2x4, f64mat2x4);" + "f64mat3x2 matrixCompMult(f64mat3x2, f64mat3x2);" + "f64mat3x4 matrixCompMult(f64mat3x4, f64mat3x4);" + "f64mat4x2 matrixCompMult(f64mat4x2, f64mat4x2);" + "f64mat4x3 matrixCompMult(f64mat4x3, f64mat4x3);" + + "f64mat2 outerProduct(f64vec2, f64vec2);" + "f64mat3 outerProduct(f64vec3, f64vec3);" + "f64mat4 outerProduct(f64vec4, f64vec4);" + "f64mat2x3 outerProduct(f64vec3, f64vec2);" + "f64mat3x2 outerProduct(f64vec2, f64vec3);" + "f64mat2x4 outerProduct(f64vec4, f64vec2);" + "f64mat4x2 outerProduct(f64vec2, f64vec4);" + "f64mat3x4 outerProduct(f64vec4, f64vec3);" + "f64mat4x3 outerProduct(f64vec3, f64vec4);" + + "f64mat2 transpose(f64mat2);" + "f64mat3 transpose(f64mat3);" + "f64mat4 transpose(f64mat4);" + "f64mat2x3 transpose(f64mat3x2);" + "f64mat3x2 transpose(f64mat2x3);" + "f64mat2x4 transpose(f64mat4x2);" + "f64mat4x2 transpose(f64mat2x4);" + "f64mat3x4 transpose(f64mat4x3);" + "f64mat4x3 transpose(f64mat3x4);" + + "float64_t determinant(f64mat2);" + "float64_t determinant(f64mat3);" + "float64_t determinant(f64mat4);" + + "f64mat2 inverse(f64mat2);" + "f64mat3 inverse(f64mat3);" + "f64mat4 inverse(f64mat4);" + + "\n"); + } + + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) { + commonBuiltins.append( + + "int64_t abs(int64_t);" + "i64vec2 abs(i64vec2);" + "i64vec3 abs(i64vec3);" + "i64vec4 abs(i64vec4);" + + "int64_t sign(int64_t);" + "i64vec2 sign(i64vec2);" + "i64vec3 sign(i64vec3);" + "i64vec4 sign(i64vec4);" + + "int64_t min(int64_t, int64_t);" + "i64vec2 min(i64vec2, int64_t);" + "i64vec3 min(i64vec3, int64_t);" + "i64vec4 min(i64vec4, int64_t);" + "i64vec2 min(i64vec2, i64vec2);" + "i64vec3 min(i64vec3, i64vec3);" + "i64vec4 min(i64vec4, i64vec4);" + "uint64_t min(uint64_t, uint64_t);" + "u64vec2 min(u64vec2, uint64_t);" + "u64vec3 min(u64vec3, uint64_t);" + "u64vec4 min(u64vec4, uint64_t);" + "u64vec2 min(u64vec2, u64vec2);" + "u64vec3 min(u64vec3, u64vec3);" + "u64vec4 min(u64vec4, u64vec4);" + + "int64_t max(int64_t, int64_t);" + "i64vec2 max(i64vec2, int64_t);" + "i64vec3 max(i64vec3, int64_t);" + "i64vec4 max(i64vec4, int64_t);" + "i64vec2 max(i64vec2, i64vec2);" + "i64vec3 max(i64vec3, i64vec3);" + "i64vec4 max(i64vec4, i64vec4);" + "uint64_t max(uint64_t, uint64_t);" + "u64vec2 max(u64vec2, uint64_t);" + "u64vec3 max(u64vec3, uint64_t);" + "u64vec4 max(u64vec4, uint64_t);" + "u64vec2 max(u64vec2, u64vec2);" + "u64vec3 max(u64vec3, u64vec3);" + "u64vec4 max(u64vec4, u64vec4);" + + "int64_t clamp(int64_t, int64_t, int64_t);" + "i64vec2 clamp(i64vec2, int64_t, int64_t);" + "i64vec3 clamp(i64vec3, int64_t, int64_t);" + "i64vec4 clamp(i64vec4, int64_t, int64_t);" + "i64vec2 clamp(i64vec2, i64vec2, i64vec2);" + "i64vec3 clamp(i64vec3, i64vec3, i64vec3);" + "i64vec4 clamp(i64vec4, i64vec4, i64vec4);" + "uint64_t clamp(uint64_t, uint64_t, uint64_t);" + "u64vec2 clamp(u64vec2, uint64_t, uint64_t);" + "u64vec3 clamp(u64vec3, uint64_t, uint64_t);" + "u64vec4 clamp(u64vec4, uint64_t, uint64_t);" + "u64vec2 clamp(u64vec2, u64vec2, u64vec2);" + "u64vec3 clamp(u64vec3, u64vec3, u64vec3);" + "u64vec4 clamp(u64vec4, u64vec4, u64vec4);" + + "int64_t mix(int64_t, int64_t, bool);" + "i64vec2 mix(i64vec2, i64vec2, bvec2);" + "i64vec3 mix(i64vec3, i64vec3, bvec3);" + "i64vec4 mix(i64vec4, i64vec4, bvec4);" + "uint64_t mix(uint64_t, uint64_t, bool);" + "u64vec2 mix(u64vec2, u64vec2, bvec2);" + "u64vec3 mix(u64vec3, u64vec3, bvec3);" + "u64vec4 mix(u64vec4, u64vec4, bvec4);" + + "int64_t doubleBitsToInt64(float64_t);" + "i64vec2 doubleBitsToInt64(f64vec2);" + "i64vec3 doubleBitsToInt64(f64vec3);" + "i64vec4 doubleBitsToInt64(f64vec4);" + + "uint64_t doubleBitsToUint64(float64_t);" + "u64vec2 doubleBitsToUint64(f64vec2);" + "u64vec3 doubleBitsToUint64(f64vec3);" + "u64vec4 doubleBitsToUint64(f64vec4);" + + "float64_t int64BitsToDouble(int64_t);" + "f64vec2 int64BitsToDouble(i64vec2);" + "f64vec3 int64BitsToDouble(i64vec3);" + "f64vec4 int64BitsToDouble(i64vec4);" + + "float64_t uint64BitsToDouble(uint64_t);" + "f64vec2 uint64BitsToDouble(u64vec2);" + "f64vec3 uint64BitsToDouble(u64vec3);" + "f64vec4 uint64BitsToDouble(u64vec4);" + + "int64_t packInt2x32(ivec2);" + "uint64_t packUint2x32(uvec2);" + "ivec2 unpackInt2x32(int64_t);" + "uvec2 unpackUint2x32(uint64_t);" + + "bvec2 lessThan(i64vec2, i64vec2);" + "bvec3 lessThan(i64vec3, i64vec3);" + "bvec4 lessThan(i64vec4, i64vec4);" + "bvec2 lessThan(u64vec2, u64vec2);" + "bvec3 lessThan(u64vec3, u64vec3);" + "bvec4 lessThan(u64vec4, u64vec4);" + + "bvec2 lessThanEqual(i64vec2, i64vec2);" + "bvec3 lessThanEqual(i64vec3, i64vec3);" + "bvec4 lessThanEqual(i64vec4, i64vec4);" + "bvec2 lessThanEqual(u64vec2, u64vec2);" + "bvec3 lessThanEqual(u64vec3, u64vec3);" + "bvec4 lessThanEqual(u64vec4, u64vec4);" + + "bvec2 greaterThan(i64vec2, i64vec2);" + "bvec3 greaterThan(i64vec3, i64vec3);" + "bvec4 greaterThan(i64vec4, i64vec4);" + "bvec2 greaterThan(u64vec2, u64vec2);" + "bvec3 greaterThan(u64vec3, u64vec3);" + "bvec4 greaterThan(u64vec4, u64vec4);" + + "bvec2 greaterThanEqual(i64vec2, i64vec2);" + "bvec3 greaterThanEqual(i64vec3, i64vec3);" + "bvec4 greaterThanEqual(i64vec4, i64vec4);" + "bvec2 greaterThanEqual(u64vec2, u64vec2);" + "bvec3 greaterThanEqual(u64vec3, u64vec3);" + "bvec4 greaterThanEqual(u64vec4, u64vec4);" + + "bvec2 equal(i64vec2, i64vec2);" + "bvec3 equal(i64vec3, i64vec3);" + "bvec4 equal(i64vec4, i64vec4);" + "bvec2 equal(u64vec2, u64vec2);" + "bvec3 equal(u64vec3, u64vec3);" + "bvec4 equal(u64vec4, u64vec4);" + + "bvec2 notEqual(i64vec2, i64vec2);" + "bvec3 notEqual(i64vec3, i64vec3);" + "bvec4 notEqual(i64vec4, i64vec4);" + "bvec2 notEqual(u64vec2, u64vec2);" + "bvec3 notEqual(u64vec3, u64vec3);" + "bvec4 notEqual(u64vec4, u64vec4);" + + "int64_t bitCount(int64_t);" + "i64vec2 bitCount(i64vec2);" + "i64vec3 bitCount(i64vec3);" + "i64vec4 bitCount(i64vec4);" + + "int64_t bitCount(uint64_t);" + "i64vec2 bitCount(u64vec2);" + "i64vec3 bitCount(u64vec3);" + "i64vec4 bitCount(u64vec4);" + + "int64_t findLSB(int64_t);" + "i64vec2 findLSB(i64vec2);" + "i64vec3 findLSB(i64vec3);" + "i64vec4 findLSB(i64vec4);" + + "int64_t findLSB(uint64_t);" + "i64vec2 findLSB(u64vec2);" + "i64vec3 findLSB(u64vec3);" + "i64vec4 findLSB(u64vec4);" + + "int64_t findMSB(int64_t);" + "i64vec2 findMSB(i64vec2);" + "i64vec3 findMSB(i64vec3);" + "i64vec4 findMSB(i64vec4);" + + "int64_t findMSB(uint64_t);" + "i64vec2 findMSB(u64vec2);" + "i64vec3 findMSB(u64vec3);" + "i64vec4 findMSB(u64vec4);" + + "\n" + ); + } + + // GL_AMD_shader_trinary_minmax + if (profile != EEsProfile && version >= 430) { + commonBuiltins.append( + "float min3(float, float, float);" + "vec2 min3(vec2, vec2, vec2);" + "vec3 min3(vec3, vec3, vec3);" + "vec4 min3(vec4, vec4, vec4);" + + "int min3(int, int, int);" + "ivec2 min3(ivec2, ivec2, ivec2);" + "ivec3 min3(ivec3, ivec3, ivec3);" + "ivec4 min3(ivec4, ivec4, ivec4);" + + "uint min3(uint, uint, uint);" + "uvec2 min3(uvec2, uvec2, uvec2);" + "uvec3 min3(uvec3, uvec3, uvec3);" + "uvec4 min3(uvec4, uvec4, uvec4);" + + "float max3(float, float, float);" + "vec2 max3(vec2, vec2, vec2);" + "vec3 max3(vec3, vec3, vec3);" + "vec4 max3(vec4, vec4, vec4);" + + "int max3(int, int, int);" + "ivec2 max3(ivec2, ivec2, ivec2);" + "ivec3 max3(ivec3, ivec3, ivec3);" + "ivec4 max3(ivec4, ivec4, ivec4);" + + "uint max3(uint, uint, uint);" + "uvec2 max3(uvec2, uvec2, uvec2);" + "uvec3 max3(uvec3, uvec3, uvec3);" + "uvec4 max3(uvec4, uvec4, uvec4);" + + "float mid3(float, float, float);" + "vec2 mid3(vec2, vec2, vec2);" + "vec3 mid3(vec3, vec3, vec3);" + "vec4 mid3(vec4, vec4, vec4);" + + "int mid3(int, int, int);" + "ivec2 mid3(ivec2, ivec2, ivec2);" + "ivec3 mid3(ivec3, ivec3, ivec3);" + "ivec4 mid3(ivec4, ivec4, ivec4);" + + "uint mid3(uint, uint, uint);" + "uvec2 mid3(uvec2, uvec2, uvec2);" + "uvec3 mid3(uvec3, uvec3, uvec3);" + "uvec4 mid3(uvec4, uvec4, uvec4);" + + "float16_t min3(float16_t, float16_t, float16_t);" + "f16vec2 min3(f16vec2, f16vec2, f16vec2);" + "f16vec3 min3(f16vec3, f16vec3, f16vec3);" + "f16vec4 min3(f16vec4, f16vec4, f16vec4);" + + "float16_t max3(float16_t, float16_t, float16_t);" + "f16vec2 max3(f16vec2, f16vec2, f16vec2);" + "f16vec3 max3(f16vec3, f16vec3, f16vec3);" + "f16vec4 max3(f16vec4, f16vec4, f16vec4);" + + "float16_t mid3(float16_t, float16_t, float16_t);" + "f16vec2 mid3(f16vec2, f16vec2, f16vec2);" + "f16vec3 mid3(f16vec3, f16vec3, f16vec3);" + "f16vec4 mid3(f16vec4, f16vec4, f16vec4);" + + "int16_t min3(int16_t, int16_t, int16_t);" + "i16vec2 min3(i16vec2, i16vec2, i16vec2);" + "i16vec3 min3(i16vec3, i16vec3, i16vec3);" + "i16vec4 min3(i16vec4, i16vec4, i16vec4);" + + "int16_t max3(int16_t, int16_t, int16_t);" + "i16vec2 max3(i16vec2, i16vec2, i16vec2);" + "i16vec3 max3(i16vec3, i16vec3, i16vec3);" + "i16vec4 max3(i16vec4, i16vec4, i16vec4);" + + "int16_t mid3(int16_t, int16_t, int16_t);" + "i16vec2 mid3(i16vec2, i16vec2, i16vec2);" + "i16vec3 mid3(i16vec3, i16vec3, i16vec3);" + "i16vec4 mid3(i16vec4, i16vec4, i16vec4);" + + "uint16_t min3(uint16_t, uint16_t, uint16_t);" + "u16vec2 min3(u16vec2, u16vec2, u16vec2);" + "u16vec3 min3(u16vec3, u16vec3, u16vec3);" + "u16vec4 min3(u16vec4, u16vec4, u16vec4);" + + "uint16_t max3(uint16_t, uint16_t, uint16_t);" + "u16vec2 max3(u16vec2, u16vec2, u16vec2);" + "u16vec3 max3(u16vec3, u16vec3, u16vec3);" + "u16vec4 max3(u16vec4, u16vec4, u16vec4);" + + "uint16_t mid3(uint16_t, uint16_t, uint16_t);" + "u16vec2 mid3(u16vec2, u16vec2, u16vec2);" + "u16vec3 mid3(u16vec3, u16vec3, u16vec3);" + "u16vec4 mid3(u16vec4, u16vec4, u16vec4);" + + "\n" + ); + } + + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 430)) { + commonBuiltins.append( + "uint atomicAdd(coherent volatile nontemporal inout uint, uint, int, int, int);" + " int atomicAdd(coherent volatile nontemporal inout int, int, int, int, int);" + + "uint atomicMin(coherent volatile nontemporal inout uint, uint, int, int, int);" + " int atomicMin(coherent volatile nontemporal inout int, int, int, int, int);" + + "uint atomicMax(coherent volatile nontemporal inout uint, uint, int, int, int);" + " int atomicMax(coherent volatile nontemporal inout int, int, int, int, int);" + + "uint atomicAnd(coherent volatile nontemporal inout uint, uint, int, int, int);" + " int atomicAnd(coherent volatile nontemporal inout int, int, int, int, int);" + + "uint atomicOr (coherent volatile nontemporal inout uint, uint, int, int, int);" + " int atomicOr (coherent volatile nontemporal inout int, int, int, int, int);" + + "uint atomicXor(coherent volatile nontemporal inout uint, uint, int, int, int);" + " int atomicXor(coherent volatile nontemporal inout int, int, int, int, int);" + + "uint atomicExchange(coherent volatile nontemporal inout uint, uint, int, int, int);" + " int atomicExchange(coherent volatile nontemporal inout int, int, int, int, int);" + + "uint atomicCompSwap(coherent volatile nontemporal inout uint, uint, uint, int, int, int, int, int);" + " int atomicCompSwap(coherent volatile nontemporal inout int, int, int, int, int, int, int, int);" + + "uint atomicLoad(coherent volatile nontemporal in uint, int, int, int);" + " int atomicLoad(coherent volatile nontemporal in int, int, int, int);" + + "void atomicStore(coherent volatile nontemporal out uint, uint, int, int, int);" + "void atomicStore(coherent volatile nontemporal out int, int, int, int, int);" + + "\n"); + } + + if (profile != EEsProfile && version >= 440) { + commonBuiltins.append( + "uint64_t atomicMin(coherent volatile nontemporal inout uint64_t, uint64_t);" + " int64_t atomicMin(coherent volatile nontemporal inout int64_t, int64_t);" + "uint64_t atomicMin(coherent volatile nontemporal inout uint64_t, uint64_t, int, int, int);" + " int64_t atomicMin(coherent volatile nontemporal inout int64_t, int64_t, int, int, int);" + "float16_t atomicMin(coherent volatile nontemporal inout float16_t, float16_t);" + "float16_t atomicMin(coherent volatile nontemporal inout float16_t, float16_t, int, int, int);" + " float atomicMin(coherent volatile nontemporal inout float, float);" + " float atomicMin(coherent volatile nontemporal inout float, float, int, int, int);" + " double atomicMin(coherent volatile nontemporal inout double, double);" + " double atomicMin(coherent volatile nontemporal inout double, double, int, int, int);" + + "uint64_t atomicMax(coherent volatile nontemporal inout uint64_t, uint64_t);" + " int64_t atomicMax(coherent volatile nontemporal inout int64_t, int64_t);" + "uint64_t atomicMax(coherent volatile nontemporal inout uint64_t, uint64_t, int, int, int);" + " int64_t atomicMax(coherent volatile nontemporal inout int64_t, int64_t, int, int, int);" + "float16_t atomicMax(coherent volatile nontemporal inout float16_t, float16_t);" + "float16_t atomicMax(coherent volatile nontemporal inout float16_t, float16_t, int, int, int);" + " float atomicMax(coherent volatile nontemporal inout float, float);" + " float atomicMax(coherent volatile nontemporal inout float, float, int, int, int);" + " double atomicMax(coherent volatile nontemporal inout double, double);" + " double atomicMax(coherent volatile nontemporal inout double, double, int, int, int);" + + "uint64_t atomicAnd(coherent volatile nontemporal inout uint64_t, uint64_t);" + " int64_t atomicAnd(coherent volatile nontemporal inout int64_t, int64_t);" + "uint64_t atomicAnd(coherent volatile nontemporal inout uint64_t, uint64_t, int, int, int);" + " int64_t atomicAnd(coherent volatile nontemporal inout int64_t, int64_t, int, int, int);" + + "uint64_t atomicOr (coherent volatile nontemporal inout uint64_t, uint64_t);" + " int64_t atomicOr (coherent volatile nontemporal inout int64_t, int64_t);" + "uint64_t atomicOr (coherent volatile nontemporal inout uint64_t, uint64_t, int, int, int);" + " int64_t atomicOr (coherent volatile nontemporal inout int64_t, int64_t, int, int, int);" + + "uint64_t atomicXor(coherent volatile nontemporal inout uint64_t, uint64_t);" + " int64_t atomicXor(coherent volatile nontemporal inout int64_t, int64_t);" + "uint64_t atomicXor(coherent volatile nontemporal inout uint64_t, uint64_t, int, int, int);" + " int64_t atomicXor(coherent volatile nontemporal inout int64_t, int64_t, int, int, int);" + + "uint64_t atomicAdd(coherent volatile nontemporal inout uint64_t, uint64_t);" + " int64_t atomicAdd(coherent volatile nontemporal inout int64_t, int64_t);" + "uint64_t atomicAdd(coherent volatile nontemporal inout uint64_t, uint64_t, int, int, int);" + " int64_t atomicAdd(coherent volatile nontemporal inout int64_t, int64_t, int, int, int);" + "float16_t atomicAdd(coherent volatile nontemporal inout float16_t, float16_t);" + "float16_t atomicAdd(coherent volatile nontemporal inout float16_t, float16_t, int, int, int);" + " float atomicAdd(coherent volatile nontemporal inout float, float);" + " float atomicAdd(coherent volatile nontemporal inout float, float, int, int, int);" + " double atomicAdd(coherent volatile nontemporal inout double, double);" + " double atomicAdd(coherent volatile nontemporal inout double, double, int, int, int);" + + "uint64_t atomicExchange(coherent volatile nontemporal inout uint64_t, uint64_t);" + " int64_t atomicExchange(coherent volatile nontemporal inout int64_t, int64_t);" + "uint64_t atomicExchange(coherent volatile nontemporal inout uint64_t, uint64_t, int, int, int);" + " int64_t atomicExchange(coherent volatile nontemporal inout int64_t, int64_t, int, int, int);" + "float16_t atomicExchange(coherent volatile nontemporal inout float16_t, float16_t);" + "float16_t atomicExchange(coherent volatile nontemporal inout float16_t, float16_t, int, int, int);" + " float atomicExchange(coherent volatile nontemporal inout float, float);" + " float atomicExchange(coherent volatile nontemporal inout float, float, int, int, int);" + " double atomicExchange(coherent volatile nontemporal inout double, double);" + " double atomicExchange(coherent volatile nontemporal inout double, double, int, int, int);" + + "uint64_t atomicCompSwap(coherent volatile nontemporal inout uint64_t, uint64_t, uint64_t);" + " int64_t atomicCompSwap(coherent volatile nontemporal inout int64_t, int64_t, int64_t);" + "uint64_t atomicCompSwap(coherent volatile nontemporal inout uint64_t, uint64_t, uint64_t, int, int, int, int, int);" + " int64_t atomicCompSwap(coherent volatile nontemporal inout int64_t, int64_t, int64_t, int, int, int, int, int);" + + "uint64_t atomicLoad(coherent volatile nontemporal in uint64_t, int, int, int);" + " int64_t atomicLoad(coherent volatile nontemporal in int64_t, int, int, int);" + "float16_t atomicLoad(coherent volatile nontemporal in float16_t, int, int, int);" + " float atomicLoad(coherent volatile nontemporal in float, int, int, int);" + " double atomicLoad(coherent volatile nontemporal in double, int, int, int);" + + "void atomicStore(coherent volatile nontemporal out uint64_t, uint64_t, int, int, int);" + "void atomicStore(coherent volatile nontemporal out int64_t, int64_t, int, int, int);" + "void atomicStore(coherent volatile nontemporal out float16_t, float16_t, int, int, int);" + "void atomicStore(coherent volatile nontemporal out float, float, int, int, int);" + "void atomicStore(coherent volatile nontemporal out double, double, int, int, int);" + "\n"); + } + + // NV_shader_atomic_fp16_vector + if (profile != EEsProfile && version >= 430) { + commonBuiltins.append( + "f16vec2 atomicAdd(coherent volatile nontemporal inout f16vec2, f16vec2);" + "f16vec4 atomicAdd(coherent volatile nontemporal inout f16vec4, f16vec4);" + "f16vec2 atomicMin(coherent volatile nontemporal inout f16vec2, f16vec2);" + "f16vec4 atomicMin(coherent volatile nontemporal inout f16vec4, f16vec4);" + "f16vec2 atomicMax(coherent volatile nontemporal inout f16vec2, f16vec2);" + "f16vec4 atomicMax(coherent volatile nontemporal inout f16vec4, f16vec4);" + "f16vec2 atomicExchange(coherent volatile nontemporal inout f16vec2, f16vec2);" + "f16vec4 atomicExchange(coherent volatile nontemporal inout f16vec4, f16vec4);" + "\n"); + } + + if ((profile == EEsProfile && version >= 300) || + (profile != EEsProfile && version >= 150)) { // GL_ARB_shader_bit_encoding + commonBuiltins.append( + "int floatBitsToInt(highp float value);" + "ivec2 floatBitsToInt(highp vec2 value);" + "ivec3 floatBitsToInt(highp vec3 value);" + "ivec4 floatBitsToInt(highp vec4 value);" + + "uint floatBitsToUint(highp float value);" + "uvec2 floatBitsToUint(highp vec2 value);" + "uvec3 floatBitsToUint(highp vec3 value);" + "uvec4 floatBitsToUint(highp vec4 value);" + + "float intBitsToFloat(highp int value);" + "vec2 intBitsToFloat(highp ivec2 value);" + "vec3 intBitsToFloat(highp ivec3 value);" + "vec4 intBitsToFloat(highp ivec4 value);" + + "float uintBitsToFloat(highp uint value);" + "vec2 uintBitsToFloat(highp uvec2 value);" + "vec3 uintBitsToFloat(highp uvec3 value);" + "vec4 uintBitsToFloat(highp uvec4 value);" + + "\n"); + } + + if ((profile != EEsProfile && version >= 150) || // GL_NV_gpu_shader5 + (profile == EEsProfile && version >= 310)) { // GL_OES_gpu_shader5 + + commonBuiltins.append( + "float fma(float, float, float );" + "vec2 fma(vec2, vec2, vec2 );" + "vec3 fma(vec3, vec3, vec3 );" + "vec4 fma(vec4, vec4, vec4 );" + "\n"); + } + + if (profile != EEsProfile && version >= 150) { // ARB_gpu_shader_fp64 + commonBuiltins.append( + "double fma(double, double, double);" + "dvec2 fma(dvec2, dvec2, dvec2 );" + "dvec3 fma(dvec3, dvec3, dvec3 );" + "dvec4 fma(dvec4, dvec4, dvec4 );" + "\n"); + } + + if (profile == EEsProfile && version >= 310) { // ARB_gpu_shader_fp64 + commonBuiltins.append( + "float64_t fma(float64_t, float64_t, float64_t);" + "f64vec2 fma(f64vec2, f64vec2, f64vec2 );" + "f64vec3 fma(f64vec3, f64vec3, f64vec3 );" + "f64vec4 fma(f64vec4, f64vec4, f64vec4 );" + "\n"); + } + + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 150)) { // GL_NV_gpu_shader5 + commonBuiltins.append( + "float frexp(highp float, out highp int);" + "vec2 frexp(highp vec2, out highp ivec2);" + "vec3 frexp(highp vec3, out highp ivec3);" + "vec4 frexp(highp vec4, out highp ivec4);" + + "float ldexp(highp float, highp int);" + "vec2 ldexp(highp vec2, highp ivec2);" + "vec3 ldexp(highp vec3, highp ivec3);" + "vec4 ldexp(highp vec4, highp ivec4);" + + "\n"); + } + + if (profile != EEsProfile && version >= 150) { // ARB_gpu_shader_fp64 + commonBuiltins.append( + "double frexp(double, out int);" + "dvec2 frexp( dvec2, out ivec2);" + "dvec3 frexp( dvec3, out ivec3);" + "dvec4 frexp( dvec4, out ivec4);" + + "double ldexp(double, int);" + "dvec2 ldexp( dvec2, ivec2);" + "dvec3 ldexp( dvec3, ivec3);" + "dvec4 ldexp( dvec4, ivec4);" + + "double packDouble2x32(uvec2);" + "uvec2 unpackDouble2x32(double);" + + "\n"); + } + + if (profile == EEsProfile && version >= 310) { // ARB_gpu_shader_fp64 + commonBuiltins.append( + "float64_t frexp(float64_t, out int);" + "f64vec2 frexp( f64vec2, out ivec2);" + "f64vec3 frexp( f64vec3, out ivec3);" + "f64vec4 frexp( f64vec4, out ivec4);" + + "float64_t ldexp(float64_t, int);" + "f64vec2 ldexp( f64vec2, ivec2);" + "f64vec3 ldexp( f64vec3, ivec3);" + "f64vec4 ldexp( f64vec4, ivec4);" + + "\n"); + } + + if ((profile == EEsProfile && version >= 300) || + (profile != EEsProfile && version >= 150)) { + commonBuiltins.append( + "highp uint packUnorm2x16(vec2);" + "vec2 unpackUnorm2x16(highp uint);" + "\n"); + } + + if ((profile == EEsProfile && version >= 300) || + (profile != EEsProfile && version >= 150)) { + commonBuiltins.append( + "highp uint packSnorm2x16(vec2);" + " vec2 unpackSnorm2x16(highp uint);" + "highp uint packHalf2x16(vec2);" + "\n"); + } + + if (profile == EEsProfile && version >= 300) { + commonBuiltins.append( + "mediump vec2 unpackHalf2x16(highp uint);" + "\n"); + } else if (profile != EEsProfile && version >= 150) { + commonBuiltins.append( + " vec2 unpackHalf2x16(highp uint);" + "\n"); + } + + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 150)) { + commonBuiltins.append( + "highp uint packSnorm4x8(vec4);" + "highp uint packUnorm4x8(vec4);" + "\n"); + } + + if (profile == EEsProfile && version >= 310) { + commonBuiltins.append( + "mediump vec4 unpackSnorm4x8(highp uint);" + "mediump vec4 unpackUnorm4x8(highp uint);" + "\n"); + } else if (profile != EEsProfile && version >= 150) { + commonBuiltins.append( + "vec4 unpackSnorm4x8(highp uint);" + "vec4 unpackUnorm4x8(highp uint);" + "\n"); + } + + // + // Matrix Functions. + // + commonBuiltins.append( + "mat2 matrixCompMult(mat2 x, mat2 y);" + "mat3 matrixCompMult(mat3 x, mat3 y);" + "mat4 matrixCompMult(mat4 x, mat4 y);" + + "\n"); + + // 120 is correct for both ES and desktop + if (version >= 120) { + commonBuiltins.append( + "mat2 outerProduct(vec2 c, vec2 r);" + "mat3 outerProduct(vec3 c, vec3 r);" + "mat4 outerProduct(vec4 c, vec4 r);" + "mat2x3 outerProduct(vec3 c, vec2 r);" + "mat3x2 outerProduct(vec2 c, vec3 r);" + "mat2x4 outerProduct(vec4 c, vec2 r);" + "mat4x2 outerProduct(vec2 c, vec4 r);" + "mat3x4 outerProduct(vec4 c, vec3 r);" + "mat4x3 outerProduct(vec3 c, vec4 r);" + + "mat2 transpose(mat2 m);" + "mat3 transpose(mat3 m);" + "mat4 transpose(mat4 m);" + "mat2x3 transpose(mat3x2 m);" + "mat3x2 transpose(mat2x3 m);" + "mat2x4 transpose(mat4x2 m);" + "mat4x2 transpose(mat2x4 m);" + "mat3x4 transpose(mat4x3 m);" + "mat4x3 transpose(mat3x4 m);" + + "mat2x3 matrixCompMult(mat2x3, mat2x3);" + "mat2x4 matrixCompMult(mat2x4, mat2x4);" + "mat3x2 matrixCompMult(mat3x2, mat3x2);" + "mat3x4 matrixCompMult(mat3x4, mat3x4);" + "mat4x2 matrixCompMult(mat4x2, mat4x2);" + "mat4x3 matrixCompMult(mat4x3, mat4x3);" + + "\n"); + + // 150 is correct for both ES and desktop + if (version >= 150) { + commonBuiltins.append( + "float determinant(mat2 m);" + "float determinant(mat3 m);" + "float determinant(mat4 m);" + + "mat2 inverse(mat2 m);" + "mat3 inverse(mat3 m);" + "mat4 inverse(mat4 m);" + + "\n"); + } + } + + // + // Original-style texture functions existing in all stages. + // (Per-stage functions below.) + // + if ((profile == EEsProfile && version == 100) || + profile == ECompatibilityProfile || + (profile == ECoreProfile && version < 420) || + profile == ENoProfile) { + if (spvVersion.spv == 0) { + commonBuiltins.append( + "vec4 texture2D(sampler2D, vec2);" + + "vec4 texture2DProj(sampler2D, vec3);" + "vec4 texture2DProj(sampler2D, vec4);" + + "vec4 texture3D(sampler3D, vec3);" // OES_texture_3D, but caught by keyword check + "vec4 texture3DProj(sampler3D, vec4);" // OES_texture_3D, but caught by keyword check + + "vec4 textureCube(samplerCube, vec3);" + + "\n"); + } + } + + if ( profile == ECompatibilityProfile || + (profile == ECoreProfile && version < 420) || + profile == ENoProfile) { + if (spvVersion.spv == 0) { + commonBuiltins.append( + "vec4 texture1D(sampler1D, float);" + + "vec4 texture1DProj(sampler1D, vec2);" + "vec4 texture1DProj(sampler1D, vec4);" + + "vec4 shadow1D(sampler1DShadow, vec3);" + "vec4 shadow2D(sampler2DShadow, vec3);" + "vec4 shadow1DProj(sampler1DShadow, vec4);" + "vec4 shadow2DProj(sampler2DShadow, vec4);" + + "vec4 texture2DRect(sampler2DRect, vec2);" // GL_ARB_texture_rectangle, caught by keyword check + "vec4 texture2DRectProj(sampler2DRect, vec3);" // GL_ARB_texture_rectangle, caught by keyword check + "vec4 texture2DRectProj(sampler2DRect, vec4);" // GL_ARB_texture_rectangle, caught by keyword check + "vec4 shadow2DRect(sampler2DRectShadow, vec3);" // GL_ARB_texture_rectangle, caught by keyword check + "vec4 shadow2DRectProj(sampler2DRectShadow, vec4);" // GL_ARB_texture_rectangle, caught by keyword check + + "vec4 texture1DArray(sampler1DArray, vec2);" // GL_EXT_texture_array + "vec4 texture2DArray(sampler2DArray, vec3);" // GL_EXT_texture_array + "vec4 shadow1DArray(sampler1DArrayShadow, vec3);" // GL_EXT_texture_array + "vec4 shadow2DArray(sampler2DArrayShadow, vec4);" // GL_EXT_texture_array + "vec4 texture1DArray(sampler1DArray, vec2, float);" // GL_EXT_texture_array + "vec4 texture2DArray(sampler2DArray, vec3, float);" // GL_EXT_texture_array + "vec4 shadow1DArray(sampler1DArrayShadow, vec3, float);" // GL_EXT_texture_array + "vec4 texture1DArrayLod(sampler1DArray, vec2, float);" // GL_EXT_texture_array + "vec4 texture2DArrayLod(sampler2DArray, vec3, float);" // GL_EXT_texture_array + "vec4 shadow1DArrayLod(sampler1DArrayShadow, vec3, float);" // GL_EXT_texture_array + "\n"); + } + } + + if (profile == EEsProfile) { + if (spvVersion.spv == 0) { + if (version < 300) { + commonBuiltins.append( + "vec4 texture2D(samplerExternalOES, vec2 coord);" // GL_OES_EGL_image_external + "vec4 texture2DProj(samplerExternalOES, vec3);" // GL_OES_EGL_image_external + "vec4 texture2DProj(samplerExternalOES, vec4);" // GL_OES_EGL_image_external + "\n"); + } else { + commonBuiltins.append( + "highp ivec2 textureSize(samplerExternalOES, int lod);" // GL_OES_EGL_image_external_essl3 + "vec4 texture(samplerExternalOES, vec2);" // GL_OES_EGL_image_external_essl3 + "vec4 texture(samplerExternalOES, vec2, float bias);" // GL_OES_EGL_image_external_essl3 + "vec4 textureProj(samplerExternalOES, vec3);" // GL_OES_EGL_image_external_essl3 + "vec4 textureProj(samplerExternalOES, vec3, float bias);" // GL_OES_EGL_image_external_essl3 + "vec4 textureProj(samplerExternalOES, vec4);" // GL_OES_EGL_image_external_essl3 + "vec4 textureProj(samplerExternalOES, vec4, float bias);" // GL_OES_EGL_image_external_essl3 + "vec4 texelFetch(samplerExternalOES, ivec2, int lod);" // GL_OES_EGL_image_external_essl3 + "\n"); + } + commonBuiltins.append( + "highp ivec2 textureSize(__samplerExternal2DY2YEXT, int lod);" // GL_EXT_YUV_target + "vec4 texture(__samplerExternal2DY2YEXT, vec2);" // GL_EXT_YUV_target + "vec4 texture(__samplerExternal2DY2YEXT, vec2, float bias);" // GL_EXT_YUV_target + "vec4 textureProj(__samplerExternal2DY2YEXT, vec3);" // GL_EXT_YUV_target + "vec4 textureProj(__samplerExternal2DY2YEXT, vec3, float bias);" // GL_EXT_YUV_target + "vec4 textureProj(__samplerExternal2DY2YEXT, vec4);" // GL_EXT_YUV_target + "vec4 textureProj(__samplerExternal2DY2YEXT, vec4, float bias);" // GL_EXT_YUV_target + "vec4 texelFetch(__samplerExternal2DY2YEXT sampler, ivec2, int lod);" // GL_EXT_YUV_target + "\n"); + commonBuiltins.append( + "vec4 texture2DGradEXT(sampler2D, vec2, vec2, vec2);" // GL_EXT_shader_texture_lod + "vec4 texture2DProjGradEXT(sampler2D, vec3, vec2, vec2);" // GL_EXT_shader_texture_lod + "vec4 texture2DProjGradEXT(sampler2D, vec4, vec2, vec2);" // GL_EXT_shader_texture_lod + "vec4 textureCubeGradEXT(samplerCube, vec3, vec3, vec3);" // GL_EXT_shader_texture_lod + + "float shadow2DEXT(sampler2DShadow, vec3);" // GL_EXT_shadow_samplers + "float shadow2DProjEXT(sampler2DShadow, vec4);" // GL_EXT_shadow_samplers + + "\n"); + } + } + + // + // Noise functions. + // + if (spvVersion.spv == 0 && profile != EEsProfile) { + commonBuiltins.append( + "float noise1(float x);" + "float noise1(vec2 x);" + "float noise1(vec3 x);" + "float noise1(vec4 x);" + + "vec2 noise2(float x);" + "vec2 noise2(vec2 x);" + "vec2 noise2(vec3 x);" + "vec2 noise2(vec4 x);" + + "vec3 noise3(float x);" + "vec3 noise3(vec2 x);" + "vec3 noise3(vec3 x);" + "vec3 noise3(vec4 x);" + + "vec4 noise4(float x);" + "vec4 noise4(vec2 x);" + "vec4 noise4(vec3 x);" + "vec4 noise4(vec4 x);" + + "\n"); + } + + if (spvVersion.vulkan == 0) { + // + // Atomic counter functions. + // + if ((profile != EEsProfile && version >= 300) || + (profile == EEsProfile && version >= 310)) { + commonBuiltins.append( + "uint atomicCounterIncrement(atomic_uint);" + "uint atomicCounterDecrement(atomic_uint);" + "uint atomicCounter(atomic_uint);" + + "\n"); + } + if (profile != EEsProfile && version == 450) { + commonBuiltins.append( + "uint atomicCounterAddARB(atomic_uint, uint);" + "uint atomicCounterSubtractARB(atomic_uint, uint);" + "uint atomicCounterMinARB(atomic_uint, uint);" + "uint atomicCounterMaxARB(atomic_uint, uint);" + "uint atomicCounterAndARB(atomic_uint, uint);" + "uint atomicCounterOrARB(atomic_uint, uint);" + "uint atomicCounterXorARB(atomic_uint, uint);" + "uint atomicCounterExchangeARB(atomic_uint, uint);" + "uint atomicCounterCompSwapARB(atomic_uint, uint, uint);" + + "\n"); + } + + + if (profile != EEsProfile && version >= 460) { + commonBuiltins.append( + "uint atomicCounterAdd(atomic_uint, uint);" + "uint atomicCounterSubtract(atomic_uint, uint);" + "uint atomicCounterMin(atomic_uint, uint);" + "uint atomicCounterMax(atomic_uint, uint);" + "uint atomicCounterAnd(atomic_uint, uint);" + "uint atomicCounterOr(atomic_uint, uint);" + "uint atomicCounterXor(atomic_uint, uint);" + "uint atomicCounterExchange(atomic_uint, uint);" + "uint atomicCounterCompSwap(atomic_uint, uint, uint);" + + "\n"); + } + } + else if (spvVersion.vulkanRelaxed) { + // + // Atomic counter functions act as aliases to normal atomic functions. + // replace definitions to take 'volatile coherent nontemporal uint' instead of 'atomic_uint' + // and map to equivalent non-counter atomic op + // + if ((profile != EEsProfile && version >= 300) || + (profile == EEsProfile && version >= 310)) { + commonBuiltins.append( + "uint atomicCounterIncrement(volatile coherent nontemporal uint);" + "uint atomicCounterDecrement(volatile coherent nontemporal uint);" + "uint atomicCounter(volatile coherent nontemporal uint);" + + "\n"); + } + if (profile != EEsProfile && version >= 460) { + commonBuiltins.append( + "uint atomicCounterAdd(volatile coherent nontemporal uint, uint);" + "uint atomicCounterSubtract(volatile coherent nontemporal uint, uint);" + "uint atomicCounterMin(volatile coherent nontemporal uint, uint);" + "uint atomicCounterMax(volatile coherent nontemporal uint, uint);" + "uint atomicCounterAnd(volatile coherent nontemporal uint, uint);" + "uint atomicCounterOr(volatile coherent nontemporal uint, uint);" + "uint atomicCounterXor(volatile coherent nontemporal uint, uint);" + "uint atomicCounterExchange(volatile coherent nontemporal uint, uint);" + "uint atomicCounterCompSwap(volatile coherent nontemporal uint, uint, uint);" + + "\n"); + } + } + + // Bitfield + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 150)) { // ARB_gpu_shader5/NV_gpu_shader5 + commonBuiltins.append( + " int bitfieldExtract( int, int, int);" + "ivec2 bitfieldExtract(ivec2, int, int);" + "ivec3 bitfieldExtract(ivec3, int, int);" + "ivec4 bitfieldExtract(ivec4, int, int);" + + " uint bitfieldExtract( uint, int, int);" + "uvec2 bitfieldExtract(uvec2, int, int);" + "uvec3 bitfieldExtract(uvec3, int, int);" + "uvec4 bitfieldExtract(uvec4, int, int);" + + " int bitfieldInsert( int base, int, int, int);" + "ivec2 bitfieldInsert(ivec2 base, ivec2, int, int);" + "ivec3 bitfieldInsert(ivec3 base, ivec3, int, int);" + "ivec4 bitfieldInsert(ivec4 base, ivec4, int, int);" + + " uint bitfieldInsert( uint base, uint, int, int);" + "uvec2 bitfieldInsert(uvec2 base, uvec2, int, int);" + "uvec3 bitfieldInsert(uvec3 base, uvec3, int, int);" + "uvec4 bitfieldInsert(uvec4 base, uvec4, int, int);" + + "\n"); + } + + if (profile != EEsProfile && version >= 150) { //GL_ARB_gpu_shader5/GL_NV_gpu_shader5 + commonBuiltins.append( + " int findLSB( int);" + "ivec2 findLSB(ivec2);" + "ivec3 findLSB(ivec3);" + "ivec4 findLSB(ivec4);" + + " int findLSB( uint);" + "ivec2 findLSB(uvec2);" + "ivec3 findLSB(uvec3);" + "ivec4 findLSB(uvec4);" + + "\n"); + } else if (profile == EEsProfile && version >= 310) { + commonBuiltins.append( + "lowp int findLSB( int);" + "lowp ivec2 findLSB(ivec2);" + "lowp ivec3 findLSB(ivec3);" + "lowp ivec4 findLSB(ivec4);" + + "lowp int findLSB( uint);" + "lowp ivec2 findLSB(uvec2);" + "lowp ivec3 findLSB(uvec3);" + "lowp ivec4 findLSB(uvec4);" + + "\n"); + } + + if (profile != EEsProfile && version >= 150) { //GL_ARB_gpu_shader5/GL_NV_gpu_shader5 + commonBuiltins.append( + " int bitCount( int);" + "ivec2 bitCount(ivec2);" + "ivec3 bitCount(ivec3);" + "ivec4 bitCount(ivec4);" + + " int bitCount( uint);" + "ivec2 bitCount(uvec2);" + "ivec3 bitCount(uvec3);" + "ivec4 bitCount(uvec4);" + + " int findMSB(highp int);" + "ivec2 findMSB(highp ivec2);" + "ivec3 findMSB(highp ivec3);" + "ivec4 findMSB(highp ivec4);" + + " int findMSB(highp uint);" + "ivec2 findMSB(highp uvec2);" + "ivec3 findMSB(highp uvec3);" + "ivec4 findMSB(highp uvec4);" + "\n"); + } + + if (profile != EEsProfile && version >= 150 && version < 450) { //GL_NV_gpu_shader5 + commonBuiltins.append( + "int64_t packInt2x32(ivec2);" + "uint64_t packUint2x32(uvec2);" + "ivec2 unpackInt2x32(int64_t);" + "uvec2 unpackUint2x32(uint64_t);" + + "uint packFloat2x16(f16vec2);" + "f16vec2 unpackFloat2x16(uint);" + + "int64_t doubleBitsToInt64(double);" + "i64vec2 doubleBitsToInt64(dvec2);" + "i64vec3 doubleBitsToInt64(dvec3);" + "i64vec4 doubleBitsToInt64(dvec4);" + + "uint64_t doubleBitsToUint64(double);" + "u64vec2 doubleBitsToUint64(dvec2);" + "u64vec3 doubleBitsToUint64(dvec3);" + "u64vec4 doubleBitsToUint64(dvec4);" + + "double int64BitsToDouble(int64_t);" + "dvec2 int64BitsToDouble(i64vec2);" + "dvec3 int64BitsToDouble(i64vec3);" + "dvec4 int64BitsToDouble(i64vec4);" + + "double uint64BitsToDouble(uint64_t);" + "dvec2 uint64BitsToDouble(u64vec2);" + "dvec3 uint64BitsToDouble(u64vec3);" + "dvec4 uint64BitsToDouble(u64vec4);" + // Modifications to Vector Relational Functions + // Introduction of explicitly sized types + "bvec2 lessThan(i64vec2, i64vec2);" + "bvec3 lessThan(i64vec3, i64vec3);" + "bvec4 lessThan(i64vec4, i64vec4);" + "bvec2 lessThan(u64vec2, u64vec2);" + "bvec3 lessThan(u64vec3, u64vec3);" + "bvec4 lessThan(u64vec4, u64vec4);" + + "bvec2 lessThanEqual(i64vec2, i64vec2);" + "bvec3 lessThanEqual(i64vec3, i64vec3);" + "bvec4 lessThanEqual(i64vec4, i64vec4);" + "bvec2 lessThanEqual(u64vec2, u64vec2);" + "bvec3 lessThanEqual(u64vec3, u64vec3);" + "bvec4 lessThanEqual(u64vec4, u64vec4);" + + "bvec2 greaterThan(i64vec2, i64vec2);" + "bvec3 greaterThan(i64vec3, i64vec3);" + "bvec4 greaterThan(i64vec4, i64vec4);" + "bvec2 greaterThan(u64vec2, u64vec2);" + "bvec3 greaterThan(u64vec3, u64vec3);" + "bvec4 greaterThan(u64vec4, u64vec4);" + + "bvec2 greaterThanEqual(i64vec2, i64vec2);" + "bvec3 greaterThanEqual(i64vec3, i64vec3);" + "bvec4 greaterThanEqual(i64vec4, i64vec4);" + "bvec2 greaterThanEqual(u64vec2, u64vec2);" + "bvec3 greaterThanEqual(u64vec3, u64vec3);" + "bvec4 greaterThanEqual(u64vec4, u64vec4);" + + "bvec2 equal(i64vec2, i64vec2);" + "bvec3 equal(i64vec3, i64vec3);" + "bvec4 equal(i64vec4, i64vec4);" + "bvec2 equal(u64vec2, u64vec2);" + "bvec3 equal(u64vec3, u64vec3);" + "bvec4 equal(u64vec4, u64vec4);" + + "bvec2 notEqual(i64vec2, i64vec2);" + "bvec3 notEqual(i64vec3, i64vec3);" + "bvec4 notEqual(i64vec4, i64vec4);" + "bvec2 notEqual(u64vec2, u64vec2);" + "bvec3 notEqual(u64vec3, u64vec3);" + "bvec4 notEqual(u64vec4, u64vec4);" + + "bvec2 lessThan(f16vec2, f16vec2);" + "bvec3 lessThan(f16vec3, f16vec3);" + "bvec4 lessThan(f16vec4, f16vec4);" + + "bvec2 lessThanEqual(f16vec2, f16vec2);" + "bvec3 lessThanEqual(f16vec3, f16vec3);" + "bvec4 lessThanEqual(f16vec4, f16vec4);" + + "bvec2 greaterThan(f16vec2, f16vec2);" + "bvec3 greaterThan(f16vec3, f16vec3);" + "bvec4 greaterThan(f16vec4, f16vec4);" + + "bvec2 greaterThanEqual(f16vec2, f16vec2);" + "bvec3 greaterThanEqual(f16vec3, f16vec3);" + "bvec4 greaterThanEqual(f16vec4, f16vec4);" + + "bvec2 equal(f16vec2, f16vec2);" + "bvec3 equal(f16vec3, f16vec3);" + "bvec4 equal(f16vec4, f16vec4);" + + "bvec2 notEqual(f16vec2, f16vec2);" + "bvec3 notEqual(f16vec3, f16vec3);" + "bvec4 notEqual(f16vec4, f16vec4);" + + // Dependency on GL_ARB_gpu_shader_fp64 + "bvec2 lessThan(dvec2, dvec2);" + "bvec3 lessThan(dvec3, dvec3);" + "bvec4 lessThan(dvec4, dvec4);" + + "bvec2 lessThanEqual(dvec2, dvec2);" + "bvec3 lessThanEqual(dvec3, dvec3);" + "bvec4 lessThanEqual(dvec4, dvec4);" + + "bvec2 greaterThan(dvec2, dvec2);" + "bvec3 greaterThan(dvec3, dvec3);" + "bvec4 greaterThan(dvec4, dvec4);" + + "bvec2 greaterThanEqual(dvec2, dvec2);" + "bvec3 greaterThanEqual(dvec3, dvec3);" + "bvec4 greaterThanEqual(dvec4, dvec4);" + + "bvec2 equal(dvec2, dvec2);" + "bvec3 equal(dvec3, dvec3);" + "bvec4 equal(dvec4, dvec4);" + + "bvec2 notEqual(dvec2, dvec2);" + "bvec3 notEqual(dvec3, dvec3);" + "bvec4 notEqual(dvec4, dvec4);" + + "\n"); + } + + + if (profile != EEsProfile && version >= 150) { + commonBuiltins.append( + "bool anyThreadNV(bool);" + "bool allThreadsNV(bool);" + "bool allThreadsEqualNV(bool);" + + "\n"); + } + + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 150)) { // NV_gpu_shader5 + commonBuiltins.append( + " uint uaddCarry(highp uint, highp uint, out lowp uint carry);" + "uvec2 uaddCarry(highp uvec2, highp uvec2, out lowp uvec2 carry);" + "uvec3 uaddCarry(highp uvec3, highp uvec3, out lowp uvec3 carry);" + "uvec4 uaddCarry(highp uvec4, highp uvec4, out lowp uvec4 carry);" + + " uint usubBorrow(highp uint, highp uint, out lowp uint borrow);" + "uvec2 usubBorrow(highp uvec2, highp uvec2, out lowp uvec2 borrow);" + "uvec3 usubBorrow(highp uvec3, highp uvec3, out lowp uvec3 borrow);" + "uvec4 usubBorrow(highp uvec4, highp uvec4, out lowp uvec4 borrow);" + + "void umulExtended(highp uint, highp uint, out highp uint, out highp uint lsb);" + "void umulExtended(highp uvec2, highp uvec2, out highp uvec2, out highp uvec2 lsb);" + "void umulExtended(highp uvec3, highp uvec3, out highp uvec3, out highp uvec3 lsb);" + "void umulExtended(highp uvec4, highp uvec4, out highp uvec4, out highp uvec4 lsb);" + + "void imulExtended(highp int, highp int, out highp int, out highp int lsb);" + "void imulExtended(highp ivec2, highp ivec2, out highp ivec2, out highp ivec2 lsb);" + "void imulExtended(highp ivec3, highp ivec3, out highp ivec3, out highp ivec3 lsb);" + "void imulExtended(highp ivec4, highp ivec4, out highp ivec4, out highp ivec4 lsb);" + + " int bitfieldReverse(highp int);" + "ivec2 bitfieldReverse(highp ivec2);" + "ivec3 bitfieldReverse(highp ivec3);" + "ivec4 bitfieldReverse(highp ivec4);" + + " uint bitfieldReverse(highp uint);" + "uvec2 bitfieldReverse(highp uvec2);" + "uvec3 bitfieldReverse(highp uvec3);" + "uvec4 bitfieldReverse(highp uvec4);" + + "\n"); + } + + if (profile == EEsProfile && version >= 310) { + commonBuiltins.append( + "lowp int bitCount( int);" + "lowp ivec2 bitCount(ivec2);" + "lowp ivec3 bitCount(ivec3);" + "lowp ivec4 bitCount(ivec4);" + + "lowp int bitCount( uint);" + "lowp ivec2 bitCount(uvec2);" + "lowp ivec3 bitCount(uvec3);" + "lowp ivec4 bitCount(uvec4);" + + "lowp int findMSB(highp int);" + "lowp ivec2 findMSB(highp ivec2);" + "lowp ivec3 findMSB(highp ivec3);" + "lowp ivec4 findMSB(highp ivec4);" + + "lowp int findMSB(highp uint);" + "lowp ivec2 findMSB(highp uvec2);" + "lowp ivec3 findMSB(highp uvec3);" + "lowp ivec4 findMSB(highp uvec4);" + + "\n"); + } + + // GL_ARB_shader_ballot + if (profile != EEsProfile && version >= 450) { + commonBuiltins.append( + "uint64_t ballotARB(bool);" + + "float readInvocationARB(float, uint);" + "vec2 readInvocationARB(vec2, uint);" + "vec3 readInvocationARB(vec3, uint);" + "vec4 readInvocationARB(vec4, uint);" + + "int readInvocationARB(int, uint);" + "ivec2 readInvocationARB(ivec2, uint);" + "ivec3 readInvocationARB(ivec3, uint);" + "ivec4 readInvocationARB(ivec4, uint);" + + "uint readInvocationARB(uint, uint);" + "uvec2 readInvocationARB(uvec2, uint);" + "uvec3 readInvocationARB(uvec3, uint);" + "uvec4 readInvocationARB(uvec4, uint);" + + "float readFirstInvocationARB(float);" + "vec2 readFirstInvocationARB(vec2);" + "vec3 readFirstInvocationARB(vec3);" + "vec4 readFirstInvocationARB(vec4);" + + "int readFirstInvocationARB(int);" + "ivec2 readFirstInvocationARB(ivec2);" + "ivec3 readFirstInvocationARB(ivec3);" + "ivec4 readFirstInvocationARB(ivec4);" + + "uint readFirstInvocationARB(uint);" + "uvec2 readFirstInvocationARB(uvec2);" + "uvec3 readFirstInvocationARB(uvec3);" + "uvec4 readFirstInvocationARB(uvec4);" + + "\n"); + } + + // GL_ARB_shader_group_vote + if (profile != EEsProfile && version >= 430) { + commonBuiltins.append( + "bool anyInvocationARB(bool);" + "bool allInvocationsARB(bool);" + "bool allInvocationsEqualARB(bool);" + + "\n"); + } + + // GL_EXT_integer_dot_product + if ((profile == EEsProfile && version >= 300) || + (profile != EEsProfile && version >= 450)) { + commonBuiltins.append( + + "uint dotEXT(uvec2 a, uvec2 b);" + "int dotEXT(ivec2 a, ivec2 b);" + "int dotEXT(ivec2 a, uvec2 b);" + "int dotEXT(uvec2 a, ivec2 b);" + + "uint dotEXT(uvec3 a, uvec3 b);" + "int dotEXT(ivec3 a, ivec3 b);" + "int dotEXT(ivec3 a, uvec3 b);" + "int dotEXT(uvec3 a, ivec3 b);" + + "uint dotEXT(uvec4 a, uvec4 b);" + "int dotEXT(ivec4 a, ivec4 b);" + "int dotEXT(ivec4 a, uvec4 b);" + "int dotEXT(uvec4 a, ivec4 b);" + + "uint dotPacked4x8EXT(uint a, uint b);" + "int dotPacked4x8EXT(int a, uint b);" + "int dotPacked4x8EXT(uint a, int b);" + "int dotPacked4x8EXT(int a, int b);" + + "uint dotEXT(u8vec2 a, u8vec2 b);" + "int dotEXT(i8vec2 a, u8vec2 b);" + "int dotEXT(u8vec2 a, i8vec2 b);" + "int dotEXT(i8vec2 a, i8vec2 b);" + + "uint dotEXT(u8vec3 a, u8vec3 b);" + "int dotEXT(i8vec3 a, u8vec3 b);" + "int dotEXT(u8vec3 a, i8vec3 b);" + "int dotEXT(i8vec3 a, i8vec3 b);" + + "uint dotEXT(u8vec4 a, u8vec4 b);" + "int dotEXT(i8vec4 a, u8vec4 b);" + "int dotEXT(u8vec4 a, i8vec4 b);" + "int dotEXT(i8vec4 a, i8vec4 b);" + + "uint dotEXT(u16vec2 a, u16vec2 b);" + "int dotEXT(i16vec2 a, u16vec2 b);" + "int dotEXT(u16vec2 a, i16vec2 b);" + "int dotEXT(i16vec2 a, i16vec2 b);" + + "uint dotEXT(u16vec3 a, u16vec3 b);" + "int dotEXT(i16vec3 a, u16vec3 b);" + "int dotEXT(u16vec3 a, i16vec3 b);" + "int dotEXT(i16vec3 a, i16vec3 b);" + + "uint dotEXT(u16vec4 a, u16vec4 b);" + "int dotEXT(i16vec4 a, u16vec4 b);" + "int dotEXT(u16vec4 a, i16vec4 b);" + "int dotEXT(i16vec4 a, i16vec4 b);" + + "uint64_t dotEXT(u64vec2 a, u64vec2 b);" + "int64_t dotEXT(i64vec2 a, u64vec2 b);" + "int64_t dotEXT(u64vec2 a, i64vec2 b);" + "int64_t dotEXT(i64vec2 a, i64vec2 b);" + + "uint64_t dotEXT(u64vec3 a, u64vec3 b);" + "int64_t dotEXT(i64vec3 a, u64vec3 b);" + "int64_t dotEXT(u64vec3 a, i64vec3 b);" + "int64_t dotEXT(i64vec3 a, i64vec3 b);" + + "uint64_t dotEXT(u64vec4 a, u64vec4 b);" + "int64_t dotEXT(i64vec4 a, u64vec4 b);" + "int64_t dotEXT(u64vec4 a, i64vec4 b);" + "int64_t dotEXT(i64vec4 a, i64vec4 b);" + + "uint dotAccSatEXT(uvec2 a, uvec2 b, uint c);" + "int dotAccSatEXT(ivec2 a, uvec2 b, int c);" + "int dotAccSatEXT(uvec2 a, ivec2 b, int c);" + "int dotAccSatEXT(ivec2 a, ivec2 b, int c);" + + "uint dotAccSatEXT(uvec3 a, uvec3 b, uint c);" + "int dotAccSatEXT(ivec3 a, uvec3 b, int c);" + "int dotAccSatEXT(uvec3 a, ivec3 b, int c);" + "int dotAccSatEXT(ivec3 a, ivec3 b, int c);" + + "uint dotAccSatEXT(uvec4 a, uvec4 b, uint c);" + "int dotAccSatEXT(ivec4 a, uvec4 b, int c);" + "int dotAccSatEXT(uvec4 a, ivec4 b, int c);" + "int dotAccSatEXT(ivec4 a, ivec4 b, int c);" + + "uint dotPacked4x8AccSatEXT(uint a, uint b, uint c);" + "int dotPacked4x8AccSatEXT(int a, uint b, int c);" + "int dotPacked4x8AccSatEXT(uint a, int b, int c);" + "int dotPacked4x8AccSatEXT(int a, int b, int c);" + + "uint dotAccSatEXT(u8vec2 a, u8vec2 b, uint c);" + "int dotAccSatEXT(i8vec2 a, u8vec2 b, int c);" + "int dotAccSatEXT(u8vec2 a, i8vec2 b, int c);" + "int dotAccSatEXT(i8vec2 a, i8vec2 b, int c);" + + "uint dotAccSatEXT(u8vec3 a, u8vec3 b, uint c);" + "int dotAccSatEXT(i8vec3 a, u8vec3 b, int c);" + "int dotAccSatEXT(u8vec3 a, i8vec3 b, int c);" + "int dotAccSatEXT(i8vec3 a, i8vec3 b, int c);" + + "uint dotAccSatEXT(u8vec4 a, u8vec4 b, uint c);" + "int dotAccSatEXT(i8vec4 a, u8vec4 b, int c);" + "int dotAccSatEXT(u8vec4 a, i8vec4 b, int c);" + "int dotAccSatEXT(i8vec4 a, i8vec4 b, int c);" + + "uint dotAccSatEXT(u16vec2 a, u16vec2 b, uint c);" + "int dotAccSatEXT(i16vec2 a, u16vec2 b, int c);" + "int dotAccSatEXT(u16vec2 a, i16vec2 b, int c);" + "int dotAccSatEXT(i16vec2 a, i16vec2 b, int c);" + + "uint dotAccSatEXT(u16vec3 a, u16vec3 b, uint c);" + "int dotAccSatEXT(i16vec3 a, u16vec3 b, int c);" + "int dotAccSatEXT(u16vec3 a, i16vec3 b, int c);" + "int dotAccSatEXT(i16vec3 a, i16vec3 b, int c);" + + "uint dotAccSatEXT(u16vec4 a, u16vec4 b, uint c);" + "int dotAccSatEXT(i16vec4 a, u16vec4 b, int c);" + "int dotAccSatEXT(u16vec4 a, i16vec4 b, int c);" + "int dotAccSatEXT(i16vec4 a, i16vec4 b, int c);" + + "uint64_t dotAccSatEXT(u64vec2 a, u64vec2 b, uint64_t c);" + "int64_t dotAccSatEXT(i64vec2 a, u64vec2 b, int64_t c);" + "int64_t dotAccSatEXT(u64vec2 a, i64vec2 b, int64_t c);" + "int64_t dotAccSatEXT(i64vec2 a, i64vec2 b, int64_t c);" + + "uint64_t dotAccSatEXT(u64vec3 a, u64vec3 b, uint64_t c);" + "int64_t dotAccSatEXT(i64vec3 a, u64vec3 b, int64_t c);" + "int64_t dotAccSatEXT(u64vec3 a, i64vec3 b, int64_t c);" + "int64_t dotAccSatEXT(i64vec3 a, i64vec3 b, int64_t c);" + + "uint64_t dotAccSatEXT(u64vec4 a, u64vec4 b, uint64_t c);" + "int64_t dotAccSatEXT(i64vec4 a, u64vec4 b, int64_t c);" + "int64_t dotAccSatEXT(u64vec4 a, i64vec4 b, int64_t c);" + "int64_t dotAccSatEXT(i64vec4 a, i64vec4 b, int64_t c);" + "\n"); + } + + // GL_KHR_shader_subgroup + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + commonBuiltins.append( + "void subgroupBarrier();" + "void subgroupMemoryBarrier();" + "void subgroupMemoryBarrierBuffer();" + "void subgroupMemoryBarrierImage();" + "bool subgroupElect();" + + "bool subgroupAll(bool);\n" + "bool subgroupAny(bool);\n" + "uvec4 subgroupBallot(bool);\n" + "bool subgroupInverseBallot(uvec4);\n" + "bool subgroupBallotBitExtract(uvec4, uint);\n" + "uint subgroupBallotBitCount(uvec4);\n" + "uint subgroupBallotInclusiveBitCount(uvec4);\n" + "uint subgroupBallotExclusiveBitCount(uvec4);\n" + "uint subgroupBallotFindLSB(uvec4);\n" + "uint subgroupBallotFindMSB(uvec4);\n" + ); + + // Generate all flavors of subgroup ops. + static const char *subgroupOps[] = + { + "bool subgroupAllEqual(%s);\n", + "%s subgroupBroadcast(%s, uint);\n", + "%s subgroupBroadcastFirst(%s);\n", + "%s subgroupShuffle(%s, uint);\n", + "%s subgroupShuffleXor(%s, uint);\n", + "%s subgroupShuffleUp(%s, uint delta);\n", + "%s subgroupShuffleDown(%s, uint delta);\n", + "%s subgroupRotate(%s, uint);\n", + "%s subgroupClusteredRotate(%s, uint, uint);\n", + "%s subgroupAdd(%s);\n", + "%s subgroupMul(%s);\n", + "%s subgroupMin(%s);\n", + "%s subgroupMax(%s);\n", + "%s subgroupAnd(%s);\n", + "%s subgroupOr(%s);\n", + "%s subgroupXor(%s);\n", + "%s subgroupInclusiveAdd(%s);\n", + "%s subgroupInclusiveMul(%s);\n", + "%s subgroupInclusiveMin(%s);\n", + "%s subgroupInclusiveMax(%s);\n", + "%s subgroupInclusiveAnd(%s);\n", + "%s subgroupInclusiveOr(%s);\n", + "%s subgroupInclusiveXor(%s);\n", + "%s subgroupExclusiveAdd(%s);\n", + "%s subgroupExclusiveMul(%s);\n", + "%s subgroupExclusiveMin(%s);\n", + "%s subgroupExclusiveMax(%s);\n", + "%s subgroupExclusiveAnd(%s);\n", + "%s subgroupExclusiveOr(%s);\n", + "%s subgroupExclusiveXor(%s);\n", + "%s subgroupClusteredAdd(%s, uint);\n", + "%s subgroupClusteredMul(%s, uint);\n", + "%s subgroupClusteredMin(%s, uint);\n", + "%s subgroupClusteredMax(%s, uint);\n", + "%s subgroupClusteredAnd(%s, uint);\n", + "%s subgroupClusteredOr(%s, uint);\n", + "%s subgroupClusteredXor(%s, uint);\n", + "%s subgroupQuadBroadcast(%s, uint);\n", + "%s subgroupQuadSwapHorizontal(%s);\n", + "%s subgroupQuadSwapVertical(%s);\n", + "%s subgroupQuadSwapDiagonal(%s);\n", + "uvec4 subgroupPartitionNV(%s);\n", + "%s subgroupPartitionedAddNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedMulNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedMinNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedMaxNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedAndNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedOrNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedXorNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedInclusiveAddNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedInclusiveMulNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedInclusiveMinNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedInclusiveMaxNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedInclusiveAndNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedInclusiveOrNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedInclusiveXorNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedExclusiveAddNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedExclusiveMulNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedExclusiveMinNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedExclusiveMaxNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedExclusiveAndNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedExclusiveOrNV(%s, uvec4 ballot);\n", + "%s subgroupPartitionedExclusiveXorNV(%s, uvec4 ballot);\n", + }; + + static const char *floatTypes[] = { + "float", "vec2", "vec3", "vec4", + "float16_t", "f16vec2", "f16vec3", "f16vec4", + }; + static const char *doubleTypes[] = { + "double", "dvec2", "dvec3", "dvec4", + }; + static const char *intTypes[] = { + "int8_t", "i8vec2", "i8vec3", "i8vec4", + "int16_t", "i16vec2", "i16vec3", "i16vec4", + "int", "ivec2", "ivec3", "ivec4", + "int64_t", "i64vec2", "i64vec3", "i64vec4", + "uint8_t", "u8vec2", "u8vec3", "u8vec4", + "uint16_t", "u16vec2", "u16vec3", "u16vec4", + "uint", "uvec2", "uvec3", "uvec4", + "uint64_t", "u64vec2", "u64vec3", "u64vec4", + }; + static const char *boolTypes[] = { + "bool", "bvec2", "bvec3", "bvec4", + }; + + for (size_t i = 0; i < sizeof(subgroupOps)/sizeof(subgroupOps[0]); ++i) { + const char *op = subgroupOps[i]; + + // Logical operations don't support float + bool logicalOp = strstr(op, "Or") || strstr(op, "And") || + (strstr(op, "Xor") && !strstr(op, "ShuffleXor")); + // Math operations don't support bool + bool mathOp = strstr(op, "Add") || strstr(op, "Mul") || strstr(op, "Min") || strstr(op, "Max"); + + const int bufSize = 256; + char buf[bufSize]; + + if (!logicalOp) { + for (size_t j = 0; j < sizeof(floatTypes)/sizeof(floatTypes[0]); ++j) { + snprintf(buf, bufSize, op, floatTypes[j], floatTypes[j]); + commonBuiltins.append(buf); + } + if (profile != EEsProfile && version >= 400) { + for (size_t j = 0; j < sizeof(doubleTypes)/sizeof(doubleTypes[0]); ++j) { + snprintf(buf, bufSize, op, doubleTypes[j], doubleTypes[j]); + commonBuiltins.append(buf); + } + } + } + if (!mathOp) { + for (size_t j = 0; j < sizeof(boolTypes)/sizeof(boolTypes[0]); ++j) { + snprintf(buf, bufSize, op, boolTypes[j], boolTypes[j]); + commonBuiltins.append(buf); + } + } + for (size_t j = 0; j < sizeof(intTypes)/sizeof(intTypes[0]); ++j) { + snprintf(buf, bufSize, op, intTypes[j], intTypes[j]); + commonBuiltins.append(buf); + } + } + + stageBuiltins[EShLangCompute].append( + "void subgroupMemoryBarrierShared();" + + "\n" + ); + stageBuiltins[EShLangMesh].append( + "void subgroupMemoryBarrierShared();" + "\n" + ); + stageBuiltins[EShLangTask].append( + "void subgroupMemoryBarrierShared();" + "\n" + ); + } + + // GL_EXT_shader_quad_control + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + commonBuiltins.append( + "bool subgroupQuadAll(bool);\n" + "bool subgroupQuadAny(bool);\n" + ); + } + + if (profile != EEsProfile && version >= 460) { + commonBuiltins.append( + "bool anyInvocation(bool);" + "bool allInvocations(bool);" + "bool allInvocationsEqual(bool);" + + "\n"); + } + + // GL_AMD_shader_ballot + if (profile != EEsProfile && version >= 450) { + commonBuiltins.append( + "float minInvocationsAMD(float);" + "vec2 minInvocationsAMD(vec2);" + "vec3 minInvocationsAMD(vec3);" + "vec4 minInvocationsAMD(vec4);" + + "int minInvocationsAMD(int);" + "ivec2 minInvocationsAMD(ivec2);" + "ivec3 minInvocationsAMD(ivec3);" + "ivec4 minInvocationsAMD(ivec4);" + + "uint minInvocationsAMD(uint);" + "uvec2 minInvocationsAMD(uvec2);" + "uvec3 minInvocationsAMD(uvec3);" + "uvec4 minInvocationsAMD(uvec4);" + + "double minInvocationsAMD(double);" + "dvec2 minInvocationsAMD(dvec2);" + "dvec3 minInvocationsAMD(dvec3);" + "dvec4 minInvocationsAMD(dvec4);" + + "int64_t minInvocationsAMD(int64_t);" + "i64vec2 minInvocationsAMD(i64vec2);" + "i64vec3 minInvocationsAMD(i64vec3);" + "i64vec4 minInvocationsAMD(i64vec4);" + + "uint64_t minInvocationsAMD(uint64_t);" + "u64vec2 minInvocationsAMD(u64vec2);" + "u64vec3 minInvocationsAMD(u64vec3);" + "u64vec4 minInvocationsAMD(u64vec4);" + + "float16_t minInvocationsAMD(float16_t);" + "f16vec2 minInvocationsAMD(f16vec2);" + "f16vec3 minInvocationsAMD(f16vec3);" + "f16vec4 minInvocationsAMD(f16vec4);" + + "int16_t minInvocationsAMD(int16_t);" + "i16vec2 minInvocationsAMD(i16vec2);" + "i16vec3 minInvocationsAMD(i16vec3);" + "i16vec4 minInvocationsAMD(i16vec4);" + + "uint16_t minInvocationsAMD(uint16_t);" + "u16vec2 minInvocationsAMD(u16vec2);" + "u16vec3 minInvocationsAMD(u16vec3);" + "u16vec4 minInvocationsAMD(u16vec4);" + + "float minInvocationsInclusiveScanAMD(float);" + "vec2 minInvocationsInclusiveScanAMD(vec2);" + "vec3 minInvocationsInclusiveScanAMD(vec3);" + "vec4 minInvocationsInclusiveScanAMD(vec4);" + + "int minInvocationsInclusiveScanAMD(int);" + "ivec2 minInvocationsInclusiveScanAMD(ivec2);" + "ivec3 minInvocationsInclusiveScanAMD(ivec3);" + "ivec4 minInvocationsInclusiveScanAMD(ivec4);" + + "uint minInvocationsInclusiveScanAMD(uint);" + "uvec2 minInvocationsInclusiveScanAMD(uvec2);" + "uvec3 minInvocationsInclusiveScanAMD(uvec3);" + "uvec4 minInvocationsInclusiveScanAMD(uvec4);" + + "double minInvocationsInclusiveScanAMD(double);" + "dvec2 minInvocationsInclusiveScanAMD(dvec2);" + "dvec3 minInvocationsInclusiveScanAMD(dvec3);" + "dvec4 minInvocationsInclusiveScanAMD(dvec4);" + + "int64_t minInvocationsInclusiveScanAMD(int64_t);" + "i64vec2 minInvocationsInclusiveScanAMD(i64vec2);" + "i64vec3 minInvocationsInclusiveScanAMD(i64vec3);" + "i64vec4 minInvocationsInclusiveScanAMD(i64vec4);" + + "uint64_t minInvocationsInclusiveScanAMD(uint64_t);" + "u64vec2 minInvocationsInclusiveScanAMD(u64vec2);" + "u64vec3 minInvocationsInclusiveScanAMD(u64vec3);" + "u64vec4 minInvocationsInclusiveScanAMD(u64vec4);" + + "float16_t minInvocationsInclusiveScanAMD(float16_t);" + "f16vec2 minInvocationsInclusiveScanAMD(f16vec2);" + "f16vec3 minInvocationsInclusiveScanAMD(f16vec3);" + "f16vec4 minInvocationsInclusiveScanAMD(f16vec4);" + + "int16_t minInvocationsInclusiveScanAMD(int16_t);" + "i16vec2 minInvocationsInclusiveScanAMD(i16vec2);" + "i16vec3 minInvocationsInclusiveScanAMD(i16vec3);" + "i16vec4 minInvocationsInclusiveScanAMD(i16vec4);" + + "uint16_t minInvocationsInclusiveScanAMD(uint16_t);" + "u16vec2 minInvocationsInclusiveScanAMD(u16vec2);" + "u16vec3 minInvocationsInclusiveScanAMD(u16vec3);" + "u16vec4 minInvocationsInclusiveScanAMD(u16vec4);" + + "float minInvocationsExclusiveScanAMD(float);" + "vec2 minInvocationsExclusiveScanAMD(vec2);" + "vec3 minInvocationsExclusiveScanAMD(vec3);" + "vec4 minInvocationsExclusiveScanAMD(vec4);" + + "int minInvocationsExclusiveScanAMD(int);" + "ivec2 minInvocationsExclusiveScanAMD(ivec2);" + "ivec3 minInvocationsExclusiveScanAMD(ivec3);" + "ivec4 minInvocationsExclusiveScanAMD(ivec4);" + + "uint minInvocationsExclusiveScanAMD(uint);" + "uvec2 minInvocationsExclusiveScanAMD(uvec2);" + "uvec3 minInvocationsExclusiveScanAMD(uvec3);" + "uvec4 minInvocationsExclusiveScanAMD(uvec4);" + + "double minInvocationsExclusiveScanAMD(double);" + "dvec2 minInvocationsExclusiveScanAMD(dvec2);" + "dvec3 minInvocationsExclusiveScanAMD(dvec3);" + "dvec4 minInvocationsExclusiveScanAMD(dvec4);" + + "int64_t minInvocationsExclusiveScanAMD(int64_t);" + "i64vec2 minInvocationsExclusiveScanAMD(i64vec2);" + "i64vec3 minInvocationsExclusiveScanAMD(i64vec3);" + "i64vec4 minInvocationsExclusiveScanAMD(i64vec4);" + + "uint64_t minInvocationsExclusiveScanAMD(uint64_t);" + "u64vec2 minInvocationsExclusiveScanAMD(u64vec2);" + "u64vec3 minInvocationsExclusiveScanAMD(u64vec3);" + "u64vec4 minInvocationsExclusiveScanAMD(u64vec4);" + + "float16_t minInvocationsExclusiveScanAMD(float16_t);" + "f16vec2 minInvocationsExclusiveScanAMD(f16vec2);" + "f16vec3 minInvocationsExclusiveScanAMD(f16vec3);" + "f16vec4 minInvocationsExclusiveScanAMD(f16vec4);" + + "int16_t minInvocationsExclusiveScanAMD(int16_t);" + "i16vec2 minInvocationsExclusiveScanAMD(i16vec2);" + "i16vec3 minInvocationsExclusiveScanAMD(i16vec3);" + "i16vec4 minInvocationsExclusiveScanAMD(i16vec4);" + + "uint16_t minInvocationsExclusiveScanAMD(uint16_t);" + "u16vec2 minInvocationsExclusiveScanAMD(u16vec2);" + "u16vec3 minInvocationsExclusiveScanAMD(u16vec3);" + "u16vec4 minInvocationsExclusiveScanAMD(u16vec4);" + + "float maxInvocationsAMD(float);" + "vec2 maxInvocationsAMD(vec2);" + "vec3 maxInvocationsAMD(vec3);" + "vec4 maxInvocationsAMD(vec4);" + + "int maxInvocationsAMD(int);" + "ivec2 maxInvocationsAMD(ivec2);" + "ivec3 maxInvocationsAMD(ivec3);" + "ivec4 maxInvocationsAMD(ivec4);" + + "uint maxInvocationsAMD(uint);" + "uvec2 maxInvocationsAMD(uvec2);" + "uvec3 maxInvocationsAMD(uvec3);" + "uvec4 maxInvocationsAMD(uvec4);" + + "double maxInvocationsAMD(double);" + "dvec2 maxInvocationsAMD(dvec2);" + "dvec3 maxInvocationsAMD(dvec3);" + "dvec4 maxInvocationsAMD(dvec4);" + + "int64_t maxInvocationsAMD(int64_t);" + "i64vec2 maxInvocationsAMD(i64vec2);" + "i64vec3 maxInvocationsAMD(i64vec3);" + "i64vec4 maxInvocationsAMD(i64vec4);" + + "uint64_t maxInvocationsAMD(uint64_t);" + "u64vec2 maxInvocationsAMD(u64vec2);" + "u64vec3 maxInvocationsAMD(u64vec3);" + "u64vec4 maxInvocationsAMD(u64vec4);" + + "float16_t maxInvocationsAMD(float16_t);" + "f16vec2 maxInvocationsAMD(f16vec2);" + "f16vec3 maxInvocationsAMD(f16vec3);" + "f16vec4 maxInvocationsAMD(f16vec4);" + + "int16_t maxInvocationsAMD(int16_t);" + "i16vec2 maxInvocationsAMD(i16vec2);" + "i16vec3 maxInvocationsAMD(i16vec3);" + "i16vec4 maxInvocationsAMD(i16vec4);" + + "uint16_t maxInvocationsAMD(uint16_t);" + "u16vec2 maxInvocationsAMD(u16vec2);" + "u16vec3 maxInvocationsAMD(u16vec3);" + "u16vec4 maxInvocationsAMD(u16vec4);" + + "float maxInvocationsInclusiveScanAMD(float);" + "vec2 maxInvocationsInclusiveScanAMD(vec2);" + "vec3 maxInvocationsInclusiveScanAMD(vec3);" + "vec4 maxInvocationsInclusiveScanAMD(vec4);" + + "int maxInvocationsInclusiveScanAMD(int);" + "ivec2 maxInvocationsInclusiveScanAMD(ivec2);" + "ivec3 maxInvocationsInclusiveScanAMD(ivec3);" + "ivec4 maxInvocationsInclusiveScanAMD(ivec4);" + + "uint maxInvocationsInclusiveScanAMD(uint);" + "uvec2 maxInvocationsInclusiveScanAMD(uvec2);" + "uvec3 maxInvocationsInclusiveScanAMD(uvec3);" + "uvec4 maxInvocationsInclusiveScanAMD(uvec4);" + + "double maxInvocationsInclusiveScanAMD(double);" + "dvec2 maxInvocationsInclusiveScanAMD(dvec2);" + "dvec3 maxInvocationsInclusiveScanAMD(dvec3);" + "dvec4 maxInvocationsInclusiveScanAMD(dvec4);" + + "int64_t maxInvocationsInclusiveScanAMD(int64_t);" + "i64vec2 maxInvocationsInclusiveScanAMD(i64vec2);" + "i64vec3 maxInvocationsInclusiveScanAMD(i64vec3);" + "i64vec4 maxInvocationsInclusiveScanAMD(i64vec4);" + + "uint64_t maxInvocationsInclusiveScanAMD(uint64_t);" + "u64vec2 maxInvocationsInclusiveScanAMD(u64vec2);" + "u64vec3 maxInvocationsInclusiveScanAMD(u64vec3);" + "u64vec4 maxInvocationsInclusiveScanAMD(u64vec4);" + + "float16_t maxInvocationsInclusiveScanAMD(float16_t);" + "f16vec2 maxInvocationsInclusiveScanAMD(f16vec2);" + "f16vec3 maxInvocationsInclusiveScanAMD(f16vec3);" + "f16vec4 maxInvocationsInclusiveScanAMD(f16vec4);" + + "int16_t maxInvocationsInclusiveScanAMD(int16_t);" + "i16vec2 maxInvocationsInclusiveScanAMD(i16vec2);" + "i16vec3 maxInvocationsInclusiveScanAMD(i16vec3);" + "i16vec4 maxInvocationsInclusiveScanAMD(i16vec4);" + + "uint16_t maxInvocationsInclusiveScanAMD(uint16_t);" + "u16vec2 maxInvocationsInclusiveScanAMD(u16vec2);" + "u16vec3 maxInvocationsInclusiveScanAMD(u16vec3);" + "u16vec4 maxInvocationsInclusiveScanAMD(u16vec4);" + + "float maxInvocationsExclusiveScanAMD(float);" + "vec2 maxInvocationsExclusiveScanAMD(vec2);" + "vec3 maxInvocationsExclusiveScanAMD(vec3);" + "vec4 maxInvocationsExclusiveScanAMD(vec4);" + + "int maxInvocationsExclusiveScanAMD(int);" + "ivec2 maxInvocationsExclusiveScanAMD(ivec2);" + "ivec3 maxInvocationsExclusiveScanAMD(ivec3);" + "ivec4 maxInvocationsExclusiveScanAMD(ivec4);" + + "uint maxInvocationsExclusiveScanAMD(uint);" + "uvec2 maxInvocationsExclusiveScanAMD(uvec2);" + "uvec3 maxInvocationsExclusiveScanAMD(uvec3);" + "uvec4 maxInvocationsExclusiveScanAMD(uvec4);" + + "double maxInvocationsExclusiveScanAMD(double);" + "dvec2 maxInvocationsExclusiveScanAMD(dvec2);" + "dvec3 maxInvocationsExclusiveScanAMD(dvec3);" + "dvec4 maxInvocationsExclusiveScanAMD(dvec4);" + + "int64_t maxInvocationsExclusiveScanAMD(int64_t);" + "i64vec2 maxInvocationsExclusiveScanAMD(i64vec2);" + "i64vec3 maxInvocationsExclusiveScanAMD(i64vec3);" + "i64vec4 maxInvocationsExclusiveScanAMD(i64vec4);" + + "uint64_t maxInvocationsExclusiveScanAMD(uint64_t);" + "u64vec2 maxInvocationsExclusiveScanAMD(u64vec2);" + "u64vec3 maxInvocationsExclusiveScanAMD(u64vec3);" + "u64vec4 maxInvocationsExclusiveScanAMD(u64vec4);" + + "float16_t maxInvocationsExclusiveScanAMD(float16_t);" + "f16vec2 maxInvocationsExclusiveScanAMD(f16vec2);" + "f16vec3 maxInvocationsExclusiveScanAMD(f16vec3);" + "f16vec4 maxInvocationsExclusiveScanAMD(f16vec4);" + + "int16_t maxInvocationsExclusiveScanAMD(int16_t);" + "i16vec2 maxInvocationsExclusiveScanAMD(i16vec2);" + "i16vec3 maxInvocationsExclusiveScanAMD(i16vec3);" + "i16vec4 maxInvocationsExclusiveScanAMD(i16vec4);" + + "uint16_t maxInvocationsExclusiveScanAMD(uint16_t);" + "u16vec2 maxInvocationsExclusiveScanAMD(u16vec2);" + "u16vec3 maxInvocationsExclusiveScanAMD(u16vec3);" + "u16vec4 maxInvocationsExclusiveScanAMD(u16vec4);" + + "float addInvocationsAMD(float);" + "vec2 addInvocationsAMD(vec2);" + "vec3 addInvocationsAMD(vec3);" + "vec4 addInvocationsAMD(vec4);" + + "int addInvocationsAMD(int);" + "ivec2 addInvocationsAMD(ivec2);" + "ivec3 addInvocationsAMD(ivec3);" + "ivec4 addInvocationsAMD(ivec4);" + + "uint addInvocationsAMD(uint);" + "uvec2 addInvocationsAMD(uvec2);" + "uvec3 addInvocationsAMD(uvec3);" + "uvec4 addInvocationsAMD(uvec4);" + + "double addInvocationsAMD(double);" + "dvec2 addInvocationsAMD(dvec2);" + "dvec3 addInvocationsAMD(dvec3);" + "dvec4 addInvocationsAMD(dvec4);" + + "int64_t addInvocationsAMD(int64_t);" + "i64vec2 addInvocationsAMD(i64vec2);" + "i64vec3 addInvocationsAMD(i64vec3);" + "i64vec4 addInvocationsAMD(i64vec4);" + + "uint64_t addInvocationsAMD(uint64_t);" + "u64vec2 addInvocationsAMD(u64vec2);" + "u64vec3 addInvocationsAMD(u64vec3);" + "u64vec4 addInvocationsAMD(u64vec4);" + + "float16_t addInvocationsAMD(float16_t);" + "f16vec2 addInvocationsAMD(f16vec2);" + "f16vec3 addInvocationsAMD(f16vec3);" + "f16vec4 addInvocationsAMD(f16vec4);" + + "int16_t addInvocationsAMD(int16_t);" + "i16vec2 addInvocationsAMD(i16vec2);" + "i16vec3 addInvocationsAMD(i16vec3);" + "i16vec4 addInvocationsAMD(i16vec4);" + + "uint16_t addInvocationsAMD(uint16_t);" + "u16vec2 addInvocationsAMD(u16vec2);" + "u16vec3 addInvocationsAMD(u16vec3);" + "u16vec4 addInvocationsAMD(u16vec4);" + + "float addInvocationsInclusiveScanAMD(float);" + "vec2 addInvocationsInclusiveScanAMD(vec2);" + "vec3 addInvocationsInclusiveScanAMD(vec3);" + "vec4 addInvocationsInclusiveScanAMD(vec4);" + + "int addInvocationsInclusiveScanAMD(int);" + "ivec2 addInvocationsInclusiveScanAMD(ivec2);" + "ivec3 addInvocationsInclusiveScanAMD(ivec3);" + "ivec4 addInvocationsInclusiveScanAMD(ivec4);" + + "uint addInvocationsInclusiveScanAMD(uint);" + "uvec2 addInvocationsInclusiveScanAMD(uvec2);" + "uvec3 addInvocationsInclusiveScanAMD(uvec3);" + "uvec4 addInvocationsInclusiveScanAMD(uvec4);" + + "double addInvocationsInclusiveScanAMD(double);" + "dvec2 addInvocationsInclusiveScanAMD(dvec2);" + "dvec3 addInvocationsInclusiveScanAMD(dvec3);" + "dvec4 addInvocationsInclusiveScanAMD(dvec4);" + + "int64_t addInvocationsInclusiveScanAMD(int64_t);" + "i64vec2 addInvocationsInclusiveScanAMD(i64vec2);" + "i64vec3 addInvocationsInclusiveScanAMD(i64vec3);" + "i64vec4 addInvocationsInclusiveScanAMD(i64vec4);" + + "uint64_t addInvocationsInclusiveScanAMD(uint64_t);" + "u64vec2 addInvocationsInclusiveScanAMD(u64vec2);" + "u64vec3 addInvocationsInclusiveScanAMD(u64vec3);" + "u64vec4 addInvocationsInclusiveScanAMD(u64vec4);" + + "float16_t addInvocationsInclusiveScanAMD(float16_t);" + "f16vec2 addInvocationsInclusiveScanAMD(f16vec2);" + "f16vec3 addInvocationsInclusiveScanAMD(f16vec3);" + "f16vec4 addInvocationsInclusiveScanAMD(f16vec4);" + + "int16_t addInvocationsInclusiveScanAMD(int16_t);" + "i16vec2 addInvocationsInclusiveScanAMD(i16vec2);" + "i16vec3 addInvocationsInclusiveScanAMD(i16vec3);" + "i16vec4 addInvocationsInclusiveScanAMD(i16vec4);" + + "uint16_t addInvocationsInclusiveScanAMD(uint16_t);" + "u16vec2 addInvocationsInclusiveScanAMD(u16vec2);" + "u16vec3 addInvocationsInclusiveScanAMD(u16vec3);" + "u16vec4 addInvocationsInclusiveScanAMD(u16vec4);" + + "float addInvocationsExclusiveScanAMD(float);" + "vec2 addInvocationsExclusiveScanAMD(vec2);" + "vec3 addInvocationsExclusiveScanAMD(vec3);" + "vec4 addInvocationsExclusiveScanAMD(vec4);" + + "int addInvocationsExclusiveScanAMD(int);" + "ivec2 addInvocationsExclusiveScanAMD(ivec2);" + "ivec3 addInvocationsExclusiveScanAMD(ivec3);" + "ivec4 addInvocationsExclusiveScanAMD(ivec4);" + + "uint addInvocationsExclusiveScanAMD(uint);" + "uvec2 addInvocationsExclusiveScanAMD(uvec2);" + "uvec3 addInvocationsExclusiveScanAMD(uvec3);" + "uvec4 addInvocationsExclusiveScanAMD(uvec4);" + + "double addInvocationsExclusiveScanAMD(double);" + "dvec2 addInvocationsExclusiveScanAMD(dvec2);" + "dvec3 addInvocationsExclusiveScanAMD(dvec3);" + "dvec4 addInvocationsExclusiveScanAMD(dvec4);" + + "int64_t addInvocationsExclusiveScanAMD(int64_t);" + "i64vec2 addInvocationsExclusiveScanAMD(i64vec2);" + "i64vec3 addInvocationsExclusiveScanAMD(i64vec3);" + "i64vec4 addInvocationsExclusiveScanAMD(i64vec4);" + + "uint64_t addInvocationsExclusiveScanAMD(uint64_t);" + "u64vec2 addInvocationsExclusiveScanAMD(u64vec2);" + "u64vec3 addInvocationsExclusiveScanAMD(u64vec3);" + "u64vec4 addInvocationsExclusiveScanAMD(u64vec4);" + + "float16_t addInvocationsExclusiveScanAMD(float16_t);" + "f16vec2 addInvocationsExclusiveScanAMD(f16vec2);" + "f16vec3 addInvocationsExclusiveScanAMD(f16vec3);" + "f16vec4 addInvocationsExclusiveScanAMD(f16vec4);" + + "int16_t addInvocationsExclusiveScanAMD(int16_t);" + "i16vec2 addInvocationsExclusiveScanAMD(i16vec2);" + "i16vec3 addInvocationsExclusiveScanAMD(i16vec3);" + "i16vec4 addInvocationsExclusiveScanAMD(i16vec4);" + + "uint16_t addInvocationsExclusiveScanAMD(uint16_t);" + "u16vec2 addInvocationsExclusiveScanAMD(u16vec2);" + "u16vec3 addInvocationsExclusiveScanAMD(u16vec3);" + "u16vec4 addInvocationsExclusiveScanAMD(u16vec4);" + + "float minInvocationsNonUniformAMD(float);" + "vec2 minInvocationsNonUniformAMD(vec2);" + "vec3 minInvocationsNonUniformAMD(vec3);" + "vec4 minInvocationsNonUniformAMD(vec4);" + + "int minInvocationsNonUniformAMD(int);" + "ivec2 minInvocationsNonUniformAMD(ivec2);" + "ivec3 minInvocationsNonUniformAMD(ivec3);" + "ivec4 minInvocationsNonUniformAMD(ivec4);" + + "uint minInvocationsNonUniformAMD(uint);" + "uvec2 minInvocationsNonUniformAMD(uvec2);" + "uvec3 minInvocationsNonUniformAMD(uvec3);" + "uvec4 minInvocationsNonUniformAMD(uvec4);" + + "double minInvocationsNonUniformAMD(double);" + "dvec2 minInvocationsNonUniformAMD(dvec2);" + "dvec3 minInvocationsNonUniformAMD(dvec3);" + "dvec4 minInvocationsNonUniformAMD(dvec4);" + + "int64_t minInvocationsNonUniformAMD(int64_t);" + "i64vec2 minInvocationsNonUniformAMD(i64vec2);" + "i64vec3 minInvocationsNonUniformAMD(i64vec3);" + "i64vec4 minInvocationsNonUniformAMD(i64vec4);" + + "uint64_t minInvocationsNonUniformAMD(uint64_t);" + "u64vec2 minInvocationsNonUniformAMD(u64vec2);" + "u64vec3 minInvocationsNonUniformAMD(u64vec3);" + "u64vec4 minInvocationsNonUniformAMD(u64vec4);" + + "float16_t minInvocationsNonUniformAMD(float16_t);" + "f16vec2 minInvocationsNonUniformAMD(f16vec2);" + "f16vec3 minInvocationsNonUniformAMD(f16vec3);" + "f16vec4 minInvocationsNonUniformAMD(f16vec4);" + + "int16_t minInvocationsNonUniformAMD(int16_t);" + "i16vec2 minInvocationsNonUniformAMD(i16vec2);" + "i16vec3 minInvocationsNonUniformAMD(i16vec3);" + "i16vec4 minInvocationsNonUniformAMD(i16vec4);" + + "uint16_t minInvocationsNonUniformAMD(uint16_t);" + "u16vec2 minInvocationsNonUniformAMD(u16vec2);" + "u16vec3 minInvocationsNonUniformAMD(u16vec3);" + "u16vec4 minInvocationsNonUniformAMD(u16vec4);" + + "float minInvocationsInclusiveScanNonUniformAMD(float);" + "vec2 minInvocationsInclusiveScanNonUniformAMD(vec2);" + "vec3 minInvocationsInclusiveScanNonUniformAMD(vec3);" + "vec4 minInvocationsInclusiveScanNonUniformAMD(vec4);" + + "int minInvocationsInclusiveScanNonUniformAMD(int);" + "ivec2 minInvocationsInclusiveScanNonUniformAMD(ivec2);" + "ivec3 minInvocationsInclusiveScanNonUniformAMD(ivec3);" + "ivec4 minInvocationsInclusiveScanNonUniformAMD(ivec4);" + + "uint minInvocationsInclusiveScanNonUniformAMD(uint);" + "uvec2 minInvocationsInclusiveScanNonUniformAMD(uvec2);" + "uvec3 minInvocationsInclusiveScanNonUniformAMD(uvec3);" + "uvec4 minInvocationsInclusiveScanNonUniformAMD(uvec4);" + + "double minInvocationsInclusiveScanNonUniformAMD(double);" + "dvec2 minInvocationsInclusiveScanNonUniformAMD(dvec2);" + "dvec3 minInvocationsInclusiveScanNonUniformAMD(dvec3);" + "dvec4 minInvocationsInclusiveScanNonUniformAMD(dvec4);" + + "int64_t minInvocationsInclusiveScanNonUniformAMD(int64_t);" + "i64vec2 minInvocationsInclusiveScanNonUniformAMD(i64vec2);" + "i64vec3 minInvocationsInclusiveScanNonUniformAMD(i64vec3);" + "i64vec4 minInvocationsInclusiveScanNonUniformAMD(i64vec4);" + + "uint64_t minInvocationsInclusiveScanNonUniformAMD(uint64_t);" + "u64vec2 minInvocationsInclusiveScanNonUniformAMD(u64vec2);" + "u64vec3 minInvocationsInclusiveScanNonUniformAMD(u64vec3);" + "u64vec4 minInvocationsInclusiveScanNonUniformAMD(u64vec4);" + + "float16_t minInvocationsInclusiveScanNonUniformAMD(float16_t);" + "f16vec2 minInvocationsInclusiveScanNonUniformAMD(f16vec2);" + "f16vec3 minInvocationsInclusiveScanNonUniformAMD(f16vec3);" + "f16vec4 minInvocationsInclusiveScanNonUniformAMD(f16vec4);" + + "int16_t minInvocationsInclusiveScanNonUniformAMD(int16_t);" + "i16vec2 minInvocationsInclusiveScanNonUniformAMD(i16vec2);" + "i16vec3 minInvocationsInclusiveScanNonUniformAMD(i16vec3);" + "i16vec4 minInvocationsInclusiveScanNonUniformAMD(i16vec4);" + + "uint16_t minInvocationsInclusiveScanNonUniformAMD(uint16_t);" + "u16vec2 minInvocationsInclusiveScanNonUniformAMD(u16vec2);" + "u16vec3 minInvocationsInclusiveScanNonUniformAMD(u16vec3);" + "u16vec4 minInvocationsInclusiveScanNonUniformAMD(u16vec4);" + + "float minInvocationsExclusiveScanNonUniformAMD(float);" + "vec2 minInvocationsExclusiveScanNonUniformAMD(vec2);" + "vec3 minInvocationsExclusiveScanNonUniformAMD(vec3);" + "vec4 minInvocationsExclusiveScanNonUniformAMD(vec4);" + + "int minInvocationsExclusiveScanNonUniformAMD(int);" + "ivec2 minInvocationsExclusiveScanNonUniformAMD(ivec2);" + "ivec3 minInvocationsExclusiveScanNonUniformAMD(ivec3);" + "ivec4 minInvocationsExclusiveScanNonUniformAMD(ivec4);" + + "uint minInvocationsExclusiveScanNonUniformAMD(uint);" + "uvec2 minInvocationsExclusiveScanNonUniformAMD(uvec2);" + "uvec3 minInvocationsExclusiveScanNonUniformAMD(uvec3);" + "uvec4 minInvocationsExclusiveScanNonUniformAMD(uvec4);" + + "double minInvocationsExclusiveScanNonUniformAMD(double);" + "dvec2 minInvocationsExclusiveScanNonUniformAMD(dvec2);" + "dvec3 minInvocationsExclusiveScanNonUniformAMD(dvec3);" + "dvec4 minInvocationsExclusiveScanNonUniformAMD(dvec4);" + + "int64_t minInvocationsExclusiveScanNonUniformAMD(int64_t);" + "i64vec2 minInvocationsExclusiveScanNonUniformAMD(i64vec2);" + "i64vec3 minInvocationsExclusiveScanNonUniformAMD(i64vec3);" + "i64vec4 minInvocationsExclusiveScanNonUniformAMD(i64vec4);" + + "uint64_t minInvocationsExclusiveScanNonUniformAMD(uint64_t);" + "u64vec2 minInvocationsExclusiveScanNonUniformAMD(u64vec2);" + "u64vec3 minInvocationsExclusiveScanNonUniformAMD(u64vec3);" + "u64vec4 minInvocationsExclusiveScanNonUniformAMD(u64vec4);" + + "float16_t minInvocationsExclusiveScanNonUniformAMD(float16_t);" + "f16vec2 minInvocationsExclusiveScanNonUniformAMD(f16vec2);" + "f16vec3 minInvocationsExclusiveScanNonUniformAMD(f16vec3);" + "f16vec4 minInvocationsExclusiveScanNonUniformAMD(f16vec4);" + + "int16_t minInvocationsExclusiveScanNonUniformAMD(int16_t);" + "i16vec2 minInvocationsExclusiveScanNonUniformAMD(i16vec2);" + "i16vec3 minInvocationsExclusiveScanNonUniformAMD(i16vec3);" + "i16vec4 minInvocationsExclusiveScanNonUniformAMD(i16vec4);" + + "uint16_t minInvocationsExclusiveScanNonUniformAMD(uint16_t);" + "u16vec2 minInvocationsExclusiveScanNonUniformAMD(u16vec2);" + "u16vec3 minInvocationsExclusiveScanNonUniformAMD(u16vec3);" + "u16vec4 minInvocationsExclusiveScanNonUniformAMD(u16vec4);" + + "float maxInvocationsNonUniformAMD(float);" + "vec2 maxInvocationsNonUniformAMD(vec2);" + "vec3 maxInvocationsNonUniformAMD(vec3);" + "vec4 maxInvocationsNonUniformAMD(vec4);" + + "int maxInvocationsNonUniformAMD(int);" + "ivec2 maxInvocationsNonUniformAMD(ivec2);" + "ivec3 maxInvocationsNonUniformAMD(ivec3);" + "ivec4 maxInvocationsNonUniformAMD(ivec4);" + + "uint maxInvocationsNonUniformAMD(uint);" + "uvec2 maxInvocationsNonUniformAMD(uvec2);" + "uvec3 maxInvocationsNonUniformAMD(uvec3);" + "uvec4 maxInvocationsNonUniformAMD(uvec4);" + + "double maxInvocationsNonUniformAMD(double);" + "dvec2 maxInvocationsNonUniformAMD(dvec2);" + "dvec3 maxInvocationsNonUniformAMD(dvec3);" + "dvec4 maxInvocationsNonUniformAMD(dvec4);" + + "int64_t maxInvocationsNonUniformAMD(int64_t);" + "i64vec2 maxInvocationsNonUniformAMD(i64vec2);" + "i64vec3 maxInvocationsNonUniformAMD(i64vec3);" + "i64vec4 maxInvocationsNonUniformAMD(i64vec4);" + + "uint64_t maxInvocationsNonUniformAMD(uint64_t);" + "u64vec2 maxInvocationsNonUniformAMD(u64vec2);" + "u64vec3 maxInvocationsNonUniformAMD(u64vec3);" + "u64vec4 maxInvocationsNonUniformAMD(u64vec4);" + + "float16_t maxInvocationsNonUniformAMD(float16_t);" + "f16vec2 maxInvocationsNonUniformAMD(f16vec2);" + "f16vec3 maxInvocationsNonUniformAMD(f16vec3);" + "f16vec4 maxInvocationsNonUniformAMD(f16vec4);" + + "int16_t maxInvocationsNonUniformAMD(int16_t);" + "i16vec2 maxInvocationsNonUniformAMD(i16vec2);" + "i16vec3 maxInvocationsNonUniformAMD(i16vec3);" + "i16vec4 maxInvocationsNonUniformAMD(i16vec4);" + + "uint16_t maxInvocationsNonUniformAMD(uint16_t);" + "u16vec2 maxInvocationsNonUniformAMD(u16vec2);" + "u16vec3 maxInvocationsNonUniformAMD(u16vec3);" + "u16vec4 maxInvocationsNonUniformAMD(u16vec4);" + + "float maxInvocationsInclusiveScanNonUniformAMD(float);" + "vec2 maxInvocationsInclusiveScanNonUniformAMD(vec2);" + "vec3 maxInvocationsInclusiveScanNonUniformAMD(vec3);" + "vec4 maxInvocationsInclusiveScanNonUniformAMD(vec4);" + + "int maxInvocationsInclusiveScanNonUniformAMD(int);" + "ivec2 maxInvocationsInclusiveScanNonUniformAMD(ivec2);" + "ivec3 maxInvocationsInclusiveScanNonUniformAMD(ivec3);" + "ivec4 maxInvocationsInclusiveScanNonUniformAMD(ivec4);" + + "uint maxInvocationsInclusiveScanNonUniformAMD(uint);" + "uvec2 maxInvocationsInclusiveScanNonUniformAMD(uvec2);" + "uvec3 maxInvocationsInclusiveScanNonUniformAMD(uvec3);" + "uvec4 maxInvocationsInclusiveScanNonUniformAMD(uvec4);" + + "double maxInvocationsInclusiveScanNonUniformAMD(double);" + "dvec2 maxInvocationsInclusiveScanNonUniformAMD(dvec2);" + "dvec3 maxInvocationsInclusiveScanNonUniformAMD(dvec3);" + "dvec4 maxInvocationsInclusiveScanNonUniformAMD(dvec4);" + + "int64_t maxInvocationsInclusiveScanNonUniformAMD(int64_t);" + "i64vec2 maxInvocationsInclusiveScanNonUniformAMD(i64vec2);" + "i64vec3 maxInvocationsInclusiveScanNonUniformAMD(i64vec3);" + "i64vec4 maxInvocationsInclusiveScanNonUniformAMD(i64vec4);" + + "uint64_t maxInvocationsInclusiveScanNonUniformAMD(uint64_t);" + "u64vec2 maxInvocationsInclusiveScanNonUniformAMD(u64vec2);" + "u64vec3 maxInvocationsInclusiveScanNonUniformAMD(u64vec3);" + "u64vec4 maxInvocationsInclusiveScanNonUniformAMD(u64vec4);" + + "float16_t maxInvocationsInclusiveScanNonUniformAMD(float16_t);" + "f16vec2 maxInvocationsInclusiveScanNonUniformAMD(f16vec2);" + "f16vec3 maxInvocationsInclusiveScanNonUniformAMD(f16vec3);" + "f16vec4 maxInvocationsInclusiveScanNonUniformAMD(f16vec4);" + + "int16_t maxInvocationsInclusiveScanNonUniformAMD(int16_t);" + "i16vec2 maxInvocationsInclusiveScanNonUniformAMD(i16vec2);" + "i16vec3 maxInvocationsInclusiveScanNonUniformAMD(i16vec3);" + "i16vec4 maxInvocationsInclusiveScanNonUniformAMD(i16vec4);" + + "uint16_t maxInvocationsInclusiveScanNonUniformAMD(uint16_t);" + "u16vec2 maxInvocationsInclusiveScanNonUniformAMD(u16vec2);" + "u16vec3 maxInvocationsInclusiveScanNonUniformAMD(u16vec3);" + "u16vec4 maxInvocationsInclusiveScanNonUniformAMD(u16vec4);" + + "float maxInvocationsExclusiveScanNonUniformAMD(float);" + "vec2 maxInvocationsExclusiveScanNonUniformAMD(vec2);" + "vec3 maxInvocationsExclusiveScanNonUniformAMD(vec3);" + "vec4 maxInvocationsExclusiveScanNonUniformAMD(vec4);" + + "int maxInvocationsExclusiveScanNonUniformAMD(int);" + "ivec2 maxInvocationsExclusiveScanNonUniformAMD(ivec2);" + "ivec3 maxInvocationsExclusiveScanNonUniformAMD(ivec3);" + "ivec4 maxInvocationsExclusiveScanNonUniformAMD(ivec4);" + + "uint maxInvocationsExclusiveScanNonUniformAMD(uint);" + "uvec2 maxInvocationsExclusiveScanNonUniformAMD(uvec2);" + "uvec3 maxInvocationsExclusiveScanNonUniformAMD(uvec3);" + "uvec4 maxInvocationsExclusiveScanNonUniformAMD(uvec4);" + + "double maxInvocationsExclusiveScanNonUniformAMD(double);" + "dvec2 maxInvocationsExclusiveScanNonUniformAMD(dvec2);" + "dvec3 maxInvocationsExclusiveScanNonUniformAMD(dvec3);" + "dvec4 maxInvocationsExclusiveScanNonUniformAMD(dvec4);" + + "int64_t maxInvocationsExclusiveScanNonUniformAMD(int64_t);" + "i64vec2 maxInvocationsExclusiveScanNonUniformAMD(i64vec2);" + "i64vec3 maxInvocationsExclusiveScanNonUniformAMD(i64vec3);" + "i64vec4 maxInvocationsExclusiveScanNonUniformAMD(i64vec4);" + + "uint64_t maxInvocationsExclusiveScanNonUniformAMD(uint64_t);" + "u64vec2 maxInvocationsExclusiveScanNonUniformAMD(u64vec2);" + "u64vec3 maxInvocationsExclusiveScanNonUniformAMD(u64vec3);" + "u64vec4 maxInvocationsExclusiveScanNonUniformAMD(u64vec4);" + + "float16_t maxInvocationsExclusiveScanNonUniformAMD(float16_t);" + "f16vec2 maxInvocationsExclusiveScanNonUniformAMD(f16vec2);" + "f16vec3 maxInvocationsExclusiveScanNonUniformAMD(f16vec3);" + "f16vec4 maxInvocationsExclusiveScanNonUniformAMD(f16vec4);" + + "int16_t maxInvocationsExclusiveScanNonUniformAMD(int16_t);" + "i16vec2 maxInvocationsExclusiveScanNonUniformAMD(i16vec2);" + "i16vec3 maxInvocationsExclusiveScanNonUniformAMD(i16vec3);" + "i16vec4 maxInvocationsExclusiveScanNonUniformAMD(i16vec4);" + + "uint16_t maxInvocationsExclusiveScanNonUniformAMD(uint16_t);" + "u16vec2 maxInvocationsExclusiveScanNonUniformAMD(u16vec2);" + "u16vec3 maxInvocationsExclusiveScanNonUniformAMD(u16vec3);" + "u16vec4 maxInvocationsExclusiveScanNonUniformAMD(u16vec4);" + + "float addInvocationsNonUniformAMD(float);" + "vec2 addInvocationsNonUniformAMD(vec2);" + "vec3 addInvocationsNonUniformAMD(vec3);" + "vec4 addInvocationsNonUniformAMD(vec4);" + + "int addInvocationsNonUniformAMD(int);" + "ivec2 addInvocationsNonUniformAMD(ivec2);" + "ivec3 addInvocationsNonUniformAMD(ivec3);" + "ivec4 addInvocationsNonUniformAMD(ivec4);" + + "uint addInvocationsNonUniformAMD(uint);" + "uvec2 addInvocationsNonUniformAMD(uvec2);" + "uvec3 addInvocationsNonUniformAMD(uvec3);" + "uvec4 addInvocationsNonUniformAMD(uvec4);" + + "double addInvocationsNonUniformAMD(double);" + "dvec2 addInvocationsNonUniformAMD(dvec2);" + "dvec3 addInvocationsNonUniformAMD(dvec3);" + "dvec4 addInvocationsNonUniformAMD(dvec4);" + + "int64_t addInvocationsNonUniformAMD(int64_t);" + "i64vec2 addInvocationsNonUniformAMD(i64vec2);" + "i64vec3 addInvocationsNonUniformAMD(i64vec3);" + "i64vec4 addInvocationsNonUniformAMD(i64vec4);" + + "uint64_t addInvocationsNonUniformAMD(uint64_t);" + "u64vec2 addInvocationsNonUniformAMD(u64vec2);" + "u64vec3 addInvocationsNonUniformAMD(u64vec3);" + "u64vec4 addInvocationsNonUniformAMD(u64vec4);" + + "float16_t addInvocationsNonUniformAMD(float16_t);" + "f16vec2 addInvocationsNonUniformAMD(f16vec2);" + "f16vec3 addInvocationsNonUniformAMD(f16vec3);" + "f16vec4 addInvocationsNonUniformAMD(f16vec4);" + + "int16_t addInvocationsNonUniformAMD(int16_t);" + "i16vec2 addInvocationsNonUniformAMD(i16vec2);" + "i16vec3 addInvocationsNonUniformAMD(i16vec3);" + "i16vec4 addInvocationsNonUniformAMD(i16vec4);" + + "uint16_t addInvocationsNonUniformAMD(uint16_t);" + "u16vec2 addInvocationsNonUniformAMD(u16vec2);" + "u16vec3 addInvocationsNonUniformAMD(u16vec3);" + "u16vec4 addInvocationsNonUniformAMD(u16vec4);" + + "float addInvocationsInclusiveScanNonUniformAMD(float);" + "vec2 addInvocationsInclusiveScanNonUniformAMD(vec2);" + "vec3 addInvocationsInclusiveScanNonUniformAMD(vec3);" + "vec4 addInvocationsInclusiveScanNonUniformAMD(vec4);" + + "int addInvocationsInclusiveScanNonUniformAMD(int);" + "ivec2 addInvocationsInclusiveScanNonUniformAMD(ivec2);" + "ivec3 addInvocationsInclusiveScanNonUniformAMD(ivec3);" + "ivec4 addInvocationsInclusiveScanNonUniformAMD(ivec4);" + + "uint addInvocationsInclusiveScanNonUniformAMD(uint);" + "uvec2 addInvocationsInclusiveScanNonUniformAMD(uvec2);" + "uvec3 addInvocationsInclusiveScanNonUniformAMD(uvec3);" + "uvec4 addInvocationsInclusiveScanNonUniformAMD(uvec4);" + + "double addInvocationsInclusiveScanNonUniformAMD(double);" + "dvec2 addInvocationsInclusiveScanNonUniformAMD(dvec2);" + "dvec3 addInvocationsInclusiveScanNonUniformAMD(dvec3);" + "dvec4 addInvocationsInclusiveScanNonUniformAMD(dvec4);" + + "int64_t addInvocationsInclusiveScanNonUniformAMD(int64_t);" + "i64vec2 addInvocationsInclusiveScanNonUniformAMD(i64vec2);" + "i64vec3 addInvocationsInclusiveScanNonUniformAMD(i64vec3);" + "i64vec4 addInvocationsInclusiveScanNonUniformAMD(i64vec4);" + + "uint64_t addInvocationsInclusiveScanNonUniformAMD(uint64_t);" + "u64vec2 addInvocationsInclusiveScanNonUniformAMD(u64vec2);" + "u64vec3 addInvocationsInclusiveScanNonUniformAMD(u64vec3);" + "u64vec4 addInvocationsInclusiveScanNonUniformAMD(u64vec4);" + + "float16_t addInvocationsInclusiveScanNonUniformAMD(float16_t);" + "f16vec2 addInvocationsInclusiveScanNonUniformAMD(f16vec2);" + "f16vec3 addInvocationsInclusiveScanNonUniformAMD(f16vec3);" + "f16vec4 addInvocationsInclusiveScanNonUniformAMD(f16vec4);" + + "int16_t addInvocationsInclusiveScanNonUniformAMD(int16_t);" + "i16vec2 addInvocationsInclusiveScanNonUniformAMD(i16vec2);" + "i16vec3 addInvocationsInclusiveScanNonUniformAMD(i16vec3);" + "i16vec4 addInvocationsInclusiveScanNonUniformAMD(i16vec4);" + + "uint16_t addInvocationsInclusiveScanNonUniformAMD(uint16_t);" + "u16vec2 addInvocationsInclusiveScanNonUniformAMD(u16vec2);" + "u16vec3 addInvocationsInclusiveScanNonUniformAMD(u16vec3);" + "u16vec4 addInvocationsInclusiveScanNonUniformAMD(u16vec4);" + + "float addInvocationsExclusiveScanNonUniformAMD(float);" + "vec2 addInvocationsExclusiveScanNonUniformAMD(vec2);" + "vec3 addInvocationsExclusiveScanNonUniformAMD(vec3);" + "vec4 addInvocationsExclusiveScanNonUniformAMD(vec4);" + + "int addInvocationsExclusiveScanNonUniformAMD(int);" + "ivec2 addInvocationsExclusiveScanNonUniformAMD(ivec2);" + "ivec3 addInvocationsExclusiveScanNonUniformAMD(ivec3);" + "ivec4 addInvocationsExclusiveScanNonUniformAMD(ivec4);" + + "uint addInvocationsExclusiveScanNonUniformAMD(uint);" + "uvec2 addInvocationsExclusiveScanNonUniformAMD(uvec2);" + "uvec3 addInvocationsExclusiveScanNonUniformAMD(uvec3);" + "uvec4 addInvocationsExclusiveScanNonUniformAMD(uvec4);" + + "double addInvocationsExclusiveScanNonUniformAMD(double);" + "dvec2 addInvocationsExclusiveScanNonUniformAMD(dvec2);" + "dvec3 addInvocationsExclusiveScanNonUniformAMD(dvec3);" + "dvec4 addInvocationsExclusiveScanNonUniformAMD(dvec4);" + + "int64_t addInvocationsExclusiveScanNonUniformAMD(int64_t);" + "i64vec2 addInvocationsExclusiveScanNonUniformAMD(i64vec2);" + "i64vec3 addInvocationsExclusiveScanNonUniformAMD(i64vec3);" + "i64vec4 addInvocationsExclusiveScanNonUniformAMD(i64vec4);" + + "uint64_t addInvocationsExclusiveScanNonUniformAMD(uint64_t);" + "u64vec2 addInvocationsExclusiveScanNonUniformAMD(u64vec2);" + "u64vec3 addInvocationsExclusiveScanNonUniformAMD(u64vec3);" + "u64vec4 addInvocationsExclusiveScanNonUniformAMD(u64vec4);" + + "float16_t addInvocationsExclusiveScanNonUniformAMD(float16_t);" + "f16vec2 addInvocationsExclusiveScanNonUniformAMD(f16vec2);" + "f16vec3 addInvocationsExclusiveScanNonUniformAMD(f16vec3);" + "f16vec4 addInvocationsExclusiveScanNonUniformAMD(f16vec4);" + + "int16_t addInvocationsExclusiveScanNonUniformAMD(int16_t);" + "i16vec2 addInvocationsExclusiveScanNonUniformAMD(i16vec2);" + "i16vec3 addInvocationsExclusiveScanNonUniformAMD(i16vec3);" + "i16vec4 addInvocationsExclusiveScanNonUniformAMD(i16vec4);" + + "uint16_t addInvocationsExclusiveScanNonUniformAMD(uint16_t);" + "u16vec2 addInvocationsExclusiveScanNonUniformAMD(u16vec2);" + "u16vec3 addInvocationsExclusiveScanNonUniformAMD(u16vec3);" + "u16vec4 addInvocationsExclusiveScanNonUniformAMD(u16vec4);" + + "float swizzleInvocationsAMD(float, uvec4);" + "vec2 swizzleInvocationsAMD(vec2, uvec4);" + "vec3 swizzleInvocationsAMD(vec3, uvec4);" + "vec4 swizzleInvocationsAMD(vec4, uvec4);" + + "int swizzleInvocationsAMD(int, uvec4);" + "ivec2 swizzleInvocationsAMD(ivec2, uvec4);" + "ivec3 swizzleInvocationsAMD(ivec3, uvec4);" + "ivec4 swizzleInvocationsAMD(ivec4, uvec4);" + + "uint swizzleInvocationsAMD(uint, uvec4);" + "uvec2 swizzleInvocationsAMD(uvec2, uvec4);" + "uvec3 swizzleInvocationsAMD(uvec3, uvec4);" + "uvec4 swizzleInvocationsAMD(uvec4, uvec4);" + + "float swizzleInvocationsMaskedAMD(float, uvec3);" + "vec2 swizzleInvocationsMaskedAMD(vec2, uvec3);" + "vec3 swizzleInvocationsMaskedAMD(vec3, uvec3);" + "vec4 swizzleInvocationsMaskedAMD(vec4, uvec3);" + + "int swizzleInvocationsMaskedAMD(int, uvec3);" + "ivec2 swizzleInvocationsMaskedAMD(ivec2, uvec3);" + "ivec3 swizzleInvocationsMaskedAMD(ivec3, uvec3);" + "ivec4 swizzleInvocationsMaskedAMD(ivec4, uvec3);" + + "uint swizzleInvocationsMaskedAMD(uint, uvec3);" + "uvec2 swizzleInvocationsMaskedAMD(uvec2, uvec3);" + "uvec3 swizzleInvocationsMaskedAMD(uvec3, uvec3);" + "uvec4 swizzleInvocationsMaskedAMD(uvec4, uvec3);" + + "float writeInvocationAMD(float, float, uint);" + "vec2 writeInvocationAMD(vec2, vec2, uint);" + "vec3 writeInvocationAMD(vec3, vec3, uint);" + "vec4 writeInvocationAMD(vec4, vec4, uint);" + + "int writeInvocationAMD(int, int, uint);" + "ivec2 writeInvocationAMD(ivec2, ivec2, uint);" + "ivec3 writeInvocationAMD(ivec3, ivec3, uint);" + "ivec4 writeInvocationAMD(ivec4, ivec4, uint);" + + "uint writeInvocationAMD(uint, uint, uint);" + "uvec2 writeInvocationAMD(uvec2, uvec2, uint);" + "uvec3 writeInvocationAMD(uvec3, uvec3, uint);" + "uvec4 writeInvocationAMD(uvec4, uvec4, uint);" + + "uint mbcntAMD(uint64_t);" + + "\n"); + } + + // GL_AMD_gcn_shader + if (profile != EEsProfile && version >= 440) { + commonBuiltins.append( + "float cubeFaceIndexAMD(vec3);" + "vec2 cubeFaceCoordAMD(vec3);" + "uint64_t timeAMD();" + + "in int gl_SIMDGroupSizeAMD;" + "\n"); + } + + // GL_AMD_shader_fragment_mask + if (profile != EEsProfile && version >= 450) { + commonBuiltins.append( + "uint fragmentMaskFetchAMD(sampler2DMS, ivec2);" + "uint fragmentMaskFetchAMD(isampler2DMS, ivec2);" + "uint fragmentMaskFetchAMD(usampler2DMS, ivec2);" + + "uint fragmentMaskFetchAMD(sampler2DMSArray, ivec3);" + "uint fragmentMaskFetchAMD(isampler2DMSArray, ivec3);" + "uint fragmentMaskFetchAMD(usampler2DMSArray, ivec3);" + + "vec4 fragmentFetchAMD(sampler2DMS, ivec2, uint);" + "ivec4 fragmentFetchAMD(isampler2DMS, ivec2, uint);" + "uvec4 fragmentFetchAMD(usampler2DMS, ivec2, uint);" + + "vec4 fragmentFetchAMD(sampler2DMSArray, ivec3, uint);" + "ivec4 fragmentFetchAMD(isampler2DMSArray, ivec3, uint);" + "uvec4 fragmentFetchAMD(usampler2DMSArray, ivec3, uint);" + + "\n"); + } + + if ((profile != EEsProfile && version >= 130) || + (profile == EEsProfile && version >= 300)) { + commonBuiltins.append( + "uint countLeadingZeros(uint);" + "uvec2 countLeadingZeros(uvec2);" + "uvec3 countLeadingZeros(uvec3);" + "uvec4 countLeadingZeros(uvec4);" + + "uint countTrailingZeros(uint);" + "uvec2 countTrailingZeros(uvec2);" + "uvec3 countTrailingZeros(uvec3);" + "uvec4 countTrailingZeros(uvec4);" + + "uint absoluteDifference(int, int);" + "uvec2 absoluteDifference(ivec2, ivec2);" + "uvec3 absoluteDifference(ivec3, ivec3);" + "uvec4 absoluteDifference(ivec4, ivec4);" + + "uint16_t absoluteDifference(int16_t, int16_t);" + "u16vec2 absoluteDifference(i16vec2, i16vec2);" + "u16vec3 absoluteDifference(i16vec3, i16vec3);" + "u16vec4 absoluteDifference(i16vec4, i16vec4);" + + "uint64_t absoluteDifference(int64_t, int64_t);" + "u64vec2 absoluteDifference(i64vec2, i64vec2);" + "u64vec3 absoluteDifference(i64vec3, i64vec3);" + "u64vec4 absoluteDifference(i64vec4, i64vec4);" + + "uint absoluteDifference(uint, uint);" + "uvec2 absoluteDifference(uvec2, uvec2);" + "uvec3 absoluteDifference(uvec3, uvec3);" + "uvec4 absoluteDifference(uvec4, uvec4);" + + "uint16_t absoluteDifference(uint16_t, uint16_t);" + "u16vec2 absoluteDifference(u16vec2, u16vec2);" + "u16vec3 absoluteDifference(u16vec3, u16vec3);" + "u16vec4 absoluteDifference(u16vec4, u16vec4);" + + "uint64_t absoluteDifference(uint64_t, uint64_t);" + "u64vec2 absoluteDifference(u64vec2, u64vec2);" + "u64vec3 absoluteDifference(u64vec3, u64vec3);" + "u64vec4 absoluteDifference(u64vec4, u64vec4);" + + "int addSaturate(int, int);" + "ivec2 addSaturate(ivec2, ivec2);" + "ivec3 addSaturate(ivec3, ivec3);" + "ivec4 addSaturate(ivec4, ivec4);" + + "int16_t addSaturate(int16_t, int16_t);" + "i16vec2 addSaturate(i16vec2, i16vec2);" + "i16vec3 addSaturate(i16vec3, i16vec3);" + "i16vec4 addSaturate(i16vec4, i16vec4);" + + "int64_t addSaturate(int64_t, int64_t);" + "i64vec2 addSaturate(i64vec2, i64vec2);" + "i64vec3 addSaturate(i64vec3, i64vec3);" + "i64vec4 addSaturate(i64vec4, i64vec4);" + + "uint addSaturate(uint, uint);" + "uvec2 addSaturate(uvec2, uvec2);" + "uvec3 addSaturate(uvec3, uvec3);" + "uvec4 addSaturate(uvec4, uvec4);" + + "uint16_t addSaturate(uint16_t, uint16_t);" + "u16vec2 addSaturate(u16vec2, u16vec2);" + "u16vec3 addSaturate(u16vec3, u16vec3);" + "u16vec4 addSaturate(u16vec4, u16vec4);" + + "uint64_t addSaturate(uint64_t, uint64_t);" + "u64vec2 addSaturate(u64vec2, u64vec2);" + "u64vec3 addSaturate(u64vec3, u64vec3);" + "u64vec4 addSaturate(u64vec4, u64vec4);" + + "int subtractSaturate(int, int);" + "ivec2 subtractSaturate(ivec2, ivec2);" + "ivec3 subtractSaturate(ivec3, ivec3);" + "ivec4 subtractSaturate(ivec4, ivec4);" + + "int16_t subtractSaturate(int16_t, int16_t);" + "i16vec2 subtractSaturate(i16vec2, i16vec2);" + "i16vec3 subtractSaturate(i16vec3, i16vec3);" + "i16vec4 subtractSaturate(i16vec4, i16vec4);" + + "int64_t subtractSaturate(int64_t, int64_t);" + "i64vec2 subtractSaturate(i64vec2, i64vec2);" + "i64vec3 subtractSaturate(i64vec3, i64vec3);" + "i64vec4 subtractSaturate(i64vec4, i64vec4);" + + "uint subtractSaturate(uint, uint);" + "uvec2 subtractSaturate(uvec2, uvec2);" + "uvec3 subtractSaturate(uvec3, uvec3);" + "uvec4 subtractSaturate(uvec4, uvec4);" + + "uint16_t subtractSaturate(uint16_t, uint16_t);" + "u16vec2 subtractSaturate(u16vec2, u16vec2);" + "u16vec3 subtractSaturate(u16vec3, u16vec3);" + "u16vec4 subtractSaturate(u16vec4, u16vec4);" + + "uint64_t subtractSaturate(uint64_t, uint64_t);" + "u64vec2 subtractSaturate(u64vec2, u64vec2);" + "u64vec3 subtractSaturate(u64vec3, u64vec3);" + "u64vec4 subtractSaturate(u64vec4, u64vec4);" + + "int average(int, int);" + "ivec2 average(ivec2, ivec2);" + "ivec3 average(ivec3, ivec3);" + "ivec4 average(ivec4, ivec4);" + + "int16_t average(int16_t, int16_t);" + "i16vec2 average(i16vec2, i16vec2);" + "i16vec3 average(i16vec3, i16vec3);" + "i16vec4 average(i16vec4, i16vec4);" + + "int64_t average(int64_t, int64_t);" + "i64vec2 average(i64vec2, i64vec2);" + "i64vec3 average(i64vec3, i64vec3);" + "i64vec4 average(i64vec4, i64vec4);" + + "uint average(uint, uint);" + "uvec2 average(uvec2, uvec2);" + "uvec3 average(uvec3, uvec3);" + "uvec4 average(uvec4, uvec4);" + + "uint16_t average(uint16_t, uint16_t);" + "u16vec2 average(u16vec2, u16vec2);" + "u16vec3 average(u16vec3, u16vec3);" + "u16vec4 average(u16vec4, u16vec4);" + + "uint64_t average(uint64_t, uint64_t);" + "u64vec2 average(u64vec2, u64vec2);" + "u64vec3 average(u64vec3, u64vec3);" + "u64vec4 average(u64vec4, u64vec4);" + + "int averageRounded(int, int);" + "ivec2 averageRounded(ivec2, ivec2);" + "ivec3 averageRounded(ivec3, ivec3);" + "ivec4 averageRounded(ivec4, ivec4);" + + "int16_t averageRounded(int16_t, int16_t);" + "i16vec2 averageRounded(i16vec2, i16vec2);" + "i16vec3 averageRounded(i16vec3, i16vec3);" + "i16vec4 averageRounded(i16vec4, i16vec4);" + + "int64_t averageRounded(int64_t, int64_t);" + "i64vec2 averageRounded(i64vec2, i64vec2);" + "i64vec3 averageRounded(i64vec3, i64vec3);" + "i64vec4 averageRounded(i64vec4, i64vec4);" + + "uint averageRounded(uint, uint);" + "uvec2 averageRounded(uvec2, uvec2);" + "uvec3 averageRounded(uvec3, uvec3);" + "uvec4 averageRounded(uvec4, uvec4);" + + "uint16_t averageRounded(uint16_t, uint16_t);" + "u16vec2 averageRounded(u16vec2, u16vec2);" + "u16vec3 averageRounded(u16vec3, u16vec3);" + "u16vec4 averageRounded(u16vec4, u16vec4);" + + "uint64_t averageRounded(uint64_t, uint64_t);" + "u64vec2 averageRounded(u64vec2, u64vec2);" + "u64vec3 averageRounded(u64vec3, u64vec3);" + "u64vec4 averageRounded(u64vec4, u64vec4);" + + "int multiply32x16(int, int);" + "ivec2 multiply32x16(ivec2, ivec2);" + "ivec3 multiply32x16(ivec3, ivec3);" + "ivec4 multiply32x16(ivec4, ivec4);" + + "uint multiply32x16(uint, uint);" + "uvec2 multiply32x16(uvec2, uvec2);" + "uvec3 multiply32x16(uvec3, uvec3);" + "uvec4 multiply32x16(uvec4, uvec4);" + "\n"); + } + + if ((profile != EEsProfile && version >= 450) || + (profile == EEsProfile && version >= 320)) { + commonBuiltins.append( + "struct gl_TextureFootprint2DNV {" + "uvec2 anchor;" + "uvec2 offset;" + "uvec2 mask;" + "uint lod;" + "uint granularity;" + "};" + + "struct gl_TextureFootprint3DNV {" + "uvec3 anchor;" + "uvec3 offset;" + "uvec2 mask;" + "uint lod;" + "uint granularity;" + "};" + "bool textureFootprintNV(sampler2D, vec2, int, bool, out gl_TextureFootprint2DNV);" + "bool textureFootprintNV(sampler3D, vec3, int, bool, out gl_TextureFootprint3DNV);" + "bool textureFootprintNV(sampler2D, vec2, int, bool, out gl_TextureFootprint2DNV, float);" + "bool textureFootprintNV(sampler3D, vec3, int, bool, out gl_TextureFootprint3DNV, float);" + "bool textureFootprintClampNV(sampler2D, vec2, float, int, bool, out gl_TextureFootprint2DNV);" + "bool textureFootprintClampNV(sampler3D, vec3, float, int, bool, out gl_TextureFootprint3DNV);" + "bool textureFootprintClampNV(sampler2D, vec2, float, int, bool, out gl_TextureFootprint2DNV, float);" + "bool textureFootprintClampNV(sampler3D, vec3, float, int, bool, out gl_TextureFootprint3DNV, float);" + "bool textureFootprintLodNV(sampler2D, vec2, float, int, bool, out gl_TextureFootprint2DNV);" + "bool textureFootprintLodNV(sampler3D, vec3, float, int, bool, out gl_TextureFootprint3DNV);" + "bool textureFootprintGradNV(sampler2D, vec2, vec2, vec2, int, bool, out gl_TextureFootprint2DNV);" + "bool textureFootprintGradClampNV(sampler2D, vec2, vec2, vec2, float, int, bool, out gl_TextureFootprint2DNV);" + "\n"); + } + + if ((profile == EEsProfile && version >= 300 && version < 310) || + (profile != EEsProfile && version >= 150 && version < 450)) { // GL_EXT_shader_integer_mix + commonBuiltins.append("int mix(int, int, bool);" + "ivec2 mix(ivec2, ivec2, bvec2);" + "ivec3 mix(ivec3, ivec3, bvec3);" + "ivec4 mix(ivec4, ivec4, bvec4);" + "uint mix(uint, uint, bool );" + "uvec2 mix(uvec2, uvec2, bvec2);" + "uvec3 mix(uvec3, uvec3, bvec3);" + "uvec4 mix(uvec4, uvec4, bvec4);" + "bool mix(bool, bool, bool );" + "bvec2 mix(bvec2, bvec2, bvec2);" + "bvec3 mix(bvec3, bvec3, bvec3);" + "bvec4 mix(bvec4, bvec4, bvec4);" + + "\n"); + } + + // GL_AMD_gpu_shader_half_float/Explicit types + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) { + commonBuiltins.append( + "float16_t radians(float16_t);" + "f16vec2 radians(f16vec2);" + "f16vec3 radians(f16vec3);" + "f16vec4 radians(f16vec4);" + + "float16_t degrees(float16_t);" + "f16vec2 degrees(f16vec2);" + "f16vec3 degrees(f16vec3);" + "f16vec4 degrees(f16vec4);" + + "float16_t sin(float16_t);" + "f16vec2 sin(f16vec2);" + "f16vec3 sin(f16vec3);" + "f16vec4 sin(f16vec4);" + + "float16_t cos(float16_t);" + "f16vec2 cos(f16vec2);" + "f16vec3 cos(f16vec3);" + "f16vec4 cos(f16vec4);" + + "float16_t tan(float16_t);" + "f16vec2 tan(f16vec2);" + "f16vec3 tan(f16vec3);" + "f16vec4 tan(f16vec4);" + + "float16_t asin(float16_t);" + "f16vec2 asin(f16vec2);" + "f16vec3 asin(f16vec3);" + "f16vec4 asin(f16vec4);" + + "float16_t acos(float16_t);" + "f16vec2 acos(f16vec2);" + "f16vec3 acos(f16vec3);" + "f16vec4 acos(f16vec4);" + + "float16_t atan(float16_t, float16_t);" + "f16vec2 atan(f16vec2, f16vec2);" + "f16vec3 atan(f16vec3, f16vec3);" + "f16vec4 atan(f16vec4, f16vec4);" + + "float16_t atan(float16_t);" + "f16vec2 atan(f16vec2);" + "f16vec3 atan(f16vec3);" + "f16vec4 atan(f16vec4);" + + "float16_t sinh(float16_t);" + "f16vec2 sinh(f16vec2);" + "f16vec3 sinh(f16vec3);" + "f16vec4 sinh(f16vec4);" + + "float16_t cosh(float16_t);" + "f16vec2 cosh(f16vec2);" + "f16vec3 cosh(f16vec3);" + "f16vec4 cosh(f16vec4);" + + "float16_t tanh(float16_t);" + "f16vec2 tanh(f16vec2);" + "f16vec3 tanh(f16vec3);" + "f16vec4 tanh(f16vec4);" + + "float16_t asinh(float16_t);" + "f16vec2 asinh(f16vec2);" + "f16vec3 asinh(f16vec3);" + "f16vec4 asinh(f16vec4);" + + "float16_t acosh(float16_t);" + "f16vec2 acosh(f16vec2);" + "f16vec3 acosh(f16vec3);" + "f16vec4 acosh(f16vec4);" + + "float16_t atanh(float16_t);" + "f16vec2 atanh(f16vec2);" + "f16vec3 atanh(f16vec3);" + "f16vec4 atanh(f16vec4);" + + "float16_t pow(float16_t, float16_t);" + "f16vec2 pow(f16vec2, f16vec2);" + "f16vec3 pow(f16vec3, f16vec3);" + "f16vec4 pow(f16vec4, f16vec4);" + + "float16_t exp(float16_t);" + "f16vec2 exp(f16vec2);" + "f16vec3 exp(f16vec3);" + "f16vec4 exp(f16vec4);" + + "float16_t log(float16_t);" + "f16vec2 log(f16vec2);" + "f16vec3 log(f16vec3);" + "f16vec4 log(f16vec4);" + + "float16_t exp2(float16_t);" + "f16vec2 exp2(f16vec2);" + "f16vec3 exp2(f16vec3);" + "f16vec4 exp2(f16vec4);" + + "float16_t log2(float16_t);" + "f16vec2 log2(f16vec2);" + "f16vec3 log2(f16vec3);" + "f16vec4 log2(f16vec4);" + + "float16_t sqrt(float16_t);" + "f16vec2 sqrt(f16vec2);" + "f16vec3 sqrt(f16vec3);" + "f16vec4 sqrt(f16vec4);" + + "float16_t inversesqrt(float16_t);" + "f16vec2 inversesqrt(f16vec2);" + "f16vec3 inversesqrt(f16vec3);" + "f16vec4 inversesqrt(f16vec4);" + + "float16_t abs(float16_t);" + "f16vec2 abs(f16vec2);" + "f16vec3 abs(f16vec3);" + "f16vec4 abs(f16vec4);" + + "float16_t sign(float16_t);" + "f16vec2 sign(f16vec2);" + "f16vec3 sign(f16vec3);" + "f16vec4 sign(f16vec4);" + + "float16_t floor(float16_t);" + "f16vec2 floor(f16vec2);" + "f16vec3 floor(f16vec3);" + "f16vec4 floor(f16vec4);" + + "float16_t trunc(float16_t);" + "f16vec2 trunc(f16vec2);" + "f16vec3 trunc(f16vec3);" + "f16vec4 trunc(f16vec4);" + + "float16_t round(float16_t);" + "f16vec2 round(f16vec2);" + "f16vec3 round(f16vec3);" + "f16vec4 round(f16vec4);" + + "float16_t roundEven(float16_t);" + "f16vec2 roundEven(f16vec2);" + "f16vec3 roundEven(f16vec3);" + "f16vec4 roundEven(f16vec4);" + + "float16_t ceil(float16_t);" + "f16vec2 ceil(f16vec2);" + "f16vec3 ceil(f16vec3);" + "f16vec4 ceil(f16vec4);" + + "float16_t fract(float16_t);" + "f16vec2 fract(f16vec2);" + "f16vec3 fract(f16vec3);" + "f16vec4 fract(f16vec4);" + + "float16_t mod(float16_t, float16_t);" + "f16vec2 mod(f16vec2, float16_t);" + "f16vec3 mod(f16vec3, float16_t);" + "f16vec4 mod(f16vec4, float16_t);" + "f16vec2 mod(f16vec2, f16vec2);" + "f16vec3 mod(f16vec3, f16vec3);" + "f16vec4 mod(f16vec4, f16vec4);" + + "float16_t modf(float16_t, out float16_t);" + "f16vec2 modf(f16vec2, out f16vec2);" + "f16vec3 modf(f16vec3, out f16vec3);" + "f16vec4 modf(f16vec4, out f16vec4);" + + "float16_t min(float16_t, float16_t);" + "f16vec2 min(f16vec2, float16_t);" + "f16vec3 min(f16vec3, float16_t);" + "f16vec4 min(f16vec4, float16_t);" + "f16vec2 min(f16vec2, f16vec2);" + "f16vec3 min(f16vec3, f16vec3);" + "f16vec4 min(f16vec4, f16vec4);" + + "float16_t max(float16_t, float16_t);" + "f16vec2 max(f16vec2, float16_t);" + "f16vec3 max(f16vec3, float16_t);" + "f16vec4 max(f16vec4, float16_t);" + "f16vec2 max(f16vec2, f16vec2);" + "f16vec3 max(f16vec3, f16vec3);" + "f16vec4 max(f16vec4, f16vec4);" + + "float16_t clamp(float16_t, float16_t, float16_t);" + "f16vec2 clamp(f16vec2, float16_t, float16_t);" + "f16vec3 clamp(f16vec3, float16_t, float16_t);" + "f16vec4 clamp(f16vec4, float16_t, float16_t);" + "f16vec2 clamp(f16vec2, f16vec2, f16vec2);" + "f16vec3 clamp(f16vec3, f16vec3, f16vec3);" + "f16vec4 clamp(f16vec4, f16vec4, f16vec4);" + + "float16_t mix(float16_t, float16_t, float16_t);" + "f16vec2 mix(f16vec2, f16vec2, float16_t);" + "f16vec3 mix(f16vec3, f16vec3, float16_t);" + "f16vec4 mix(f16vec4, f16vec4, float16_t);" + "f16vec2 mix(f16vec2, f16vec2, f16vec2);" + "f16vec3 mix(f16vec3, f16vec3, f16vec3);" + "f16vec4 mix(f16vec4, f16vec4, f16vec4);" + "float16_t mix(float16_t, float16_t, bool);" + "f16vec2 mix(f16vec2, f16vec2, bvec2);" + "f16vec3 mix(f16vec3, f16vec3, bvec3);" + "f16vec4 mix(f16vec4, f16vec4, bvec4);" + + "float16_t step(float16_t, float16_t);" + "f16vec2 step(f16vec2, f16vec2);" + "f16vec3 step(f16vec3, f16vec3);" + "f16vec4 step(f16vec4, f16vec4);" + "f16vec2 step(float16_t, f16vec2);" + "f16vec3 step(float16_t, f16vec3);" + "f16vec4 step(float16_t, f16vec4);" + + "float16_t smoothstep(float16_t, float16_t, float16_t);" + "f16vec2 smoothstep(f16vec2, f16vec2, f16vec2);" + "f16vec3 smoothstep(f16vec3, f16vec3, f16vec3);" + "f16vec4 smoothstep(f16vec4, f16vec4, f16vec4);" + "f16vec2 smoothstep(float16_t, float16_t, f16vec2);" + "f16vec3 smoothstep(float16_t, float16_t, f16vec3);" + "f16vec4 smoothstep(float16_t, float16_t, f16vec4);" + + "bool isnan(float16_t);" + "bvec2 isnan(f16vec2);" + "bvec3 isnan(f16vec3);" + "bvec4 isnan(f16vec4);" + + "bool isinf(float16_t);" + "bvec2 isinf(f16vec2);" + "bvec3 isinf(f16vec3);" + "bvec4 isinf(f16vec4);" + + "float16_t fma(float16_t, float16_t, float16_t);" + "f16vec2 fma(f16vec2, f16vec2, f16vec2);" + "f16vec3 fma(f16vec3, f16vec3, f16vec3);" + "f16vec4 fma(f16vec4, f16vec4, f16vec4);" + + "float16_t frexp(float16_t, out int);" + "f16vec2 frexp(f16vec2, out ivec2);" + "f16vec3 frexp(f16vec3, out ivec3);" + "f16vec4 frexp(f16vec4, out ivec4);" + + "float16_t ldexp(float16_t, in int);" + "f16vec2 ldexp(f16vec2, in ivec2);" + "f16vec3 ldexp(f16vec3, in ivec3);" + "f16vec4 ldexp(f16vec4, in ivec4);" + + "uint packFloat2x16(f16vec2);" + "f16vec2 unpackFloat2x16(uint);" + + "float16_t length(float16_t);" + "float16_t length(f16vec2);" + "float16_t length(f16vec3);" + "float16_t length(f16vec4);" + + "float16_t distance(float16_t, float16_t);" + "float16_t distance(f16vec2, f16vec2);" + "float16_t distance(f16vec3, f16vec3);" + "float16_t distance(f16vec4, f16vec4);" + + "float16_t dot(float16_t, float16_t);" + "float16_t dot(f16vec2, f16vec2);" + "float16_t dot(f16vec3, f16vec3);" + "float16_t dot(f16vec4, f16vec4);" + + "f16vec3 cross(f16vec3, f16vec3);" + + "float16_t normalize(float16_t);" + "f16vec2 normalize(f16vec2);" + "f16vec3 normalize(f16vec3);" + "f16vec4 normalize(f16vec4);" + + "float16_t faceforward(float16_t, float16_t, float16_t);" + "f16vec2 faceforward(f16vec2, f16vec2, f16vec2);" + "f16vec3 faceforward(f16vec3, f16vec3, f16vec3);" + "f16vec4 faceforward(f16vec4, f16vec4, f16vec4);" + + "float16_t reflect(float16_t, float16_t);" + "f16vec2 reflect(f16vec2, f16vec2);" + "f16vec3 reflect(f16vec3, f16vec3);" + "f16vec4 reflect(f16vec4, f16vec4);" + + "float16_t refract(float16_t, float16_t, float16_t);" + "f16vec2 refract(f16vec2, f16vec2, float16_t);" + "f16vec3 refract(f16vec3, f16vec3, float16_t);" + "f16vec4 refract(f16vec4, f16vec4, float16_t);" + + "f16mat2 matrixCompMult(f16mat2, f16mat2);" + "f16mat3 matrixCompMult(f16mat3, f16mat3);" + "f16mat4 matrixCompMult(f16mat4, f16mat4);" + "f16mat2x3 matrixCompMult(f16mat2x3, f16mat2x3);" + "f16mat2x4 matrixCompMult(f16mat2x4, f16mat2x4);" + "f16mat3x2 matrixCompMult(f16mat3x2, f16mat3x2);" + "f16mat3x4 matrixCompMult(f16mat3x4, f16mat3x4);" + "f16mat4x2 matrixCompMult(f16mat4x2, f16mat4x2);" + "f16mat4x3 matrixCompMult(f16mat4x3, f16mat4x3);" + + "f16mat2 outerProduct(f16vec2, f16vec2);" + "f16mat3 outerProduct(f16vec3, f16vec3);" + "f16mat4 outerProduct(f16vec4, f16vec4);" + "f16mat2x3 outerProduct(f16vec3, f16vec2);" + "f16mat3x2 outerProduct(f16vec2, f16vec3);" + "f16mat2x4 outerProduct(f16vec4, f16vec2);" + "f16mat4x2 outerProduct(f16vec2, f16vec4);" + "f16mat3x4 outerProduct(f16vec4, f16vec3);" + "f16mat4x3 outerProduct(f16vec3, f16vec4);" + + "f16mat2 transpose(f16mat2);" + "f16mat3 transpose(f16mat3);" + "f16mat4 transpose(f16mat4);" + "f16mat2x3 transpose(f16mat3x2);" + "f16mat3x2 transpose(f16mat2x3);" + "f16mat2x4 transpose(f16mat4x2);" + "f16mat4x2 transpose(f16mat2x4);" + "f16mat3x4 transpose(f16mat4x3);" + "f16mat4x3 transpose(f16mat3x4);" + + "float16_t determinant(f16mat2);" + "float16_t determinant(f16mat3);" + "float16_t determinant(f16mat4);" + + "f16mat2 inverse(f16mat2);" + "f16mat3 inverse(f16mat3);" + "f16mat4 inverse(f16mat4);" + + "bvec2 lessThan(f16vec2, f16vec2);" + "bvec3 lessThan(f16vec3, f16vec3);" + "bvec4 lessThan(f16vec4, f16vec4);" + + "bvec2 lessThanEqual(f16vec2, f16vec2);" + "bvec3 lessThanEqual(f16vec3, f16vec3);" + "bvec4 lessThanEqual(f16vec4, f16vec4);" + + "bvec2 greaterThan(f16vec2, f16vec2);" + "bvec3 greaterThan(f16vec3, f16vec3);" + "bvec4 greaterThan(f16vec4, f16vec4);" + + "bvec2 greaterThanEqual(f16vec2, f16vec2);" + "bvec3 greaterThanEqual(f16vec3, f16vec3);" + "bvec4 greaterThanEqual(f16vec4, f16vec4);" + + "bvec2 equal(f16vec2, f16vec2);" + "bvec3 equal(f16vec3, f16vec3);" + "bvec4 equal(f16vec4, f16vec4);" + + "bvec2 notEqual(f16vec2, f16vec2);" + "bvec3 notEqual(f16vec3, f16vec3);" + "bvec4 notEqual(f16vec4, f16vec4);" + + "bfloat16_t dot(bfloat16_t, bfloat16_t);" + "bfloat16_t dot(bf16vec2, bf16vec2);" + "bfloat16_t dot(bf16vec3, bf16vec3);" + "bfloat16_t dot(bf16vec4, bf16vec4);" + + "int16_t bfloat16BitsToIntEXT(bfloat16_t value);" + "i16vec2 bfloat16BitsToIntEXT(bf16vec2 value);" + "i16vec3 bfloat16BitsToIntEXT(bf16vec3 value);" + "i16vec4 bfloat16BitsToIntEXT(bf16vec4 value);" + + "uint16_t bfloat16BitsToUintEXT(bfloat16_t value);" + "u16vec2 bfloat16BitsToUintEXT(bf16vec2 value);" + "u16vec3 bfloat16BitsToUintEXT(bf16vec3 value);" + "u16vec4 bfloat16BitsToUintEXT(bf16vec4 value);" + + "bfloat16_t intBitsToBFloat16EXT(int16_t value);" + "bf16vec2 intBitsToBFloat16EXT(i16vec2 value);" + "bf16vec3 intBitsToBFloat16EXT(i16vec3 value);" + "bf16vec4 intBitsToBFloat16EXT(i16vec4 value);" + + "bfloat16_t uintBitsToBFloat16EXT(uint16_t value);" + "bf16vec2 uintBitsToBFloat16EXT(u16vec2 value);" + "bf16vec3 uintBitsToBFloat16EXT(u16vec3 value);" + "bf16vec4 uintBitsToBFloat16EXT(u16vec4 value);" + + "int8_t floate5m2BitsToIntEXT(floate5m2_t value);" + "i8vec2 floate5m2BitsToIntEXT(fe5m2vec2 value);" + "i8vec3 floate5m2BitsToIntEXT(fe5m2vec3 value);" + "i8vec4 floate5m2BitsToIntEXT(fe5m2vec4 value);" + + "uint8_t floate5m2BitsToUintEXT(floate5m2_t value);" + "u8vec2 floate5m2BitsToUintEXT(fe5m2vec2 value);" + "u8vec3 floate5m2BitsToUintEXT(fe5m2vec3 value);" + "u8vec4 floate5m2BitsToUintEXT(fe5m2vec4 value);" + + "floate5m2_t intBitsToFloate5m2EXT(int8_t value);" + "fe5m2vec2 intBitsToFloate5m2EXT(i8vec2 value);" + "fe5m2vec3 intBitsToFloate5m2EXT(i8vec3 value);" + "fe5m2vec4 intBitsToFloate5m2EXT(i8vec4 value);" + + "floate5m2_t uintBitsToFloate5m2EXT(uint8_t value);" + "fe5m2vec2 uintBitsToFloate5m2EXT(u8vec2 value);" + "fe5m2vec3 uintBitsToFloate5m2EXT(u8vec3 value);" + "fe5m2vec4 uintBitsToFloate5m2EXT(u8vec4 value);" + + "int8_t floate4m3BitsToIntEXT(floate4m3_t value);" + "i8vec2 floate4m3BitsToIntEXT(fe4m3vec2 value);" + "i8vec3 floate4m3BitsToIntEXT(fe4m3vec3 value);" + "i8vec4 floate4m3BitsToIntEXT(fe4m3vec4 value);" + + "uint8_t floate4m3BitsToUintEXT(floate4m3_t value);" + "u8vec2 floate4m3BitsToUintEXT(fe4m3vec2 value);" + "u8vec3 floate4m3BitsToUintEXT(fe4m3vec3 value);" + "u8vec4 floate4m3BitsToUintEXT(fe4m3vec4 value);" + + "floate4m3_t intBitsToFloate4m3EXT(int8_t value);" + "fe4m3vec2 intBitsToFloate4m3EXT(i8vec2 value);" + "fe4m3vec3 intBitsToFloate4m3EXT(i8vec3 value);" + "fe4m3vec4 intBitsToFloate4m3EXT(i8vec4 value);" + + "floate4m3_t uintBitsToFloate4m3EXT(uint8_t value);" + "fe4m3vec2 uintBitsToFloate4m3EXT(u8vec2 value);" + "fe4m3vec3 uintBitsToFloate4m3EXT(u8vec3 value);" + "fe4m3vec4 uintBitsToFloate4m3EXT(u8vec4 value);" + + "void saturatedConvertEXT();" + "\n"); + } + + // Explicit types + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) { + commonBuiltins.append( + "int8_t abs(int8_t);" + "i8vec2 abs(i8vec2);" + "i8vec3 abs(i8vec3);" + "i8vec4 abs(i8vec4);" + + "int8_t sign(int8_t);" + "i8vec2 sign(i8vec2);" + "i8vec3 sign(i8vec3);" + "i8vec4 sign(i8vec4);" + + "int8_t min(int8_t x, int8_t y);" + "i8vec2 min(i8vec2 x, int8_t y);" + "i8vec3 min(i8vec3 x, int8_t y);" + "i8vec4 min(i8vec4 x, int8_t y);" + "i8vec2 min(i8vec2 x, i8vec2 y);" + "i8vec3 min(i8vec3 x, i8vec3 y);" + "i8vec4 min(i8vec4 x, i8vec4 y);" + + "uint8_t min(uint8_t x, uint8_t y);" + "u8vec2 min(u8vec2 x, uint8_t y);" + "u8vec3 min(u8vec3 x, uint8_t y);" + "u8vec4 min(u8vec4 x, uint8_t y);" + "u8vec2 min(u8vec2 x, u8vec2 y);" + "u8vec3 min(u8vec3 x, u8vec3 y);" + "u8vec4 min(u8vec4 x, u8vec4 y);" + + "int8_t max(int8_t x, int8_t y);" + "i8vec2 max(i8vec2 x, int8_t y);" + "i8vec3 max(i8vec3 x, int8_t y);" + "i8vec4 max(i8vec4 x, int8_t y);" + "i8vec2 max(i8vec2 x, i8vec2 y);" + "i8vec3 max(i8vec3 x, i8vec3 y);" + "i8vec4 max(i8vec4 x, i8vec4 y);" + + "uint8_t max(uint8_t x, uint8_t y);" + "u8vec2 max(u8vec2 x, uint8_t y);" + "u8vec3 max(u8vec3 x, uint8_t y);" + "u8vec4 max(u8vec4 x, uint8_t y);" + "u8vec2 max(u8vec2 x, u8vec2 y);" + "u8vec3 max(u8vec3 x, u8vec3 y);" + "u8vec4 max(u8vec4 x, u8vec4 y);" + + "int8_t clamp(int8_t x, int8_t minVal, int8_t maxVal);" + "i8vec2 clamp(i8vec2 x, int8_t minVal, int8_t maxVal);" + "i8vec3 clamp(i8vec3 x, int8_t minVal, int8_t maxVal);" + "i8vec4 clamp(i8vec4 x, int8_t minVal, int8_t maxVal);" + "i8vec2 clamp(i8vec2 x, i8vec2 minVal, i8vec2 maxVal);" + "i8vec3 clamp(i8vec3 x, i8vec3 minVal, i8vec3 maxVal);" + "i8vec4 clamp(i8vec4 x, i8vec4 minVal, i8vec4 maxVal);" + + "uint8_t clamp(uint8_t x, uint8_t minVal, uint8_t maxVal);" + "u8vec2 clamp(u8vec2 x, uint8_t minVal, uint8_t maxVal);" + "u8vec3 clamp(u8vec3 x, uint8_t minVal, uint8_t maxVal);" + "u8vec4 clamp(u8vec4 x, uint8_t minVal, uint8_t maxVal);" + "u8vec2 clamp(u8vec2 x, u8vec2 minVal, u8vec2 maxVal);" + "u8vec3 clamp(u8vec3 x, u8vec3 minVal, u8vec3 maxVal);" + "u8vec4 clamp(u8vec4 x, u8vec4 minVal, u8vec4 maxVal);" + + "int8_t mix(int8_t, int8_t, bool);" + "i8vec2 mix(i8vec2, i8vec2, bvec2);" + "i8vec3 mix(i8vec3, i8vec3, bvec3);" + "i8vec4 mix(i8vec4, i8vec4, bvec4);" + "uint8_t mix(uint8_t, uint8_t, bool);" + "u8vec2 mix(u8vec2, u8vec2, bvec2);" + "u8vec3 mix(u8vec3, u8vec3, bvec3);" + "u8vec4 mix(u8vec4, u8vec4, bvec4);" + + "bvec2 lessThan(i8vec2, i8vec2);" + "bvec3 lessThan(i8vec3, i8vec3);" + "bvec4 lessThan(i8vec4, i8vec4);" + "bvec2 lessThan(u8vec2, u8vec2);" + "bvec3 lessThan(u8vec3, u8vec3);" + "bvec4 lessThan(u8vec4, u8vec4);" + + "bvec2 lessThanEqual(i8vec2, i8vec2);" + "bvec3 lessThanEqual(i8vec3, i8vec3);" + "bvec4 lessThanEqual(i8vec4, i8vec4);" + "bvec2 lessThanEqual(u8vec2, u8vec2);" + "bvec3 lessThanEqual(u8vec3, u8vec3);" + "bvec4 lessThanEqual(u8vec4, u8vec4);" + + "bvec2 greaterThan(i8vec2, i8vec2);" + "bvec3 greaterThan(i8vec3, i8vec3);" + "bvec4 greaterThan(i8vec4, i8vec4);" + "bvec2 greaterThan(u8vec2, u8vec2);" + "bvec3 greaterThan(u8vec3, u8vec3);" + "bvec4 greaterThan(u8vec4, u8vec4);" + + "bvec2 greaterThanEqual(i8vec2, i8vec2);" + "bvec3 greaterThanEqual(i8vec3, i8vec3);" + "bvec4 greaterThanEqual(i8vec4, i8vec4);" + "bvec2 greaterThanEqual(u8vec2, u8vec2);" + "bvec3 greaterThanEqual(u8vec3, u8vec3);" + "bvec4 greaterThanEqual(u8vec4, u8vec4);" + + "bvec2 equal(i8vec2, i8vec2);" + "bvec3 equal(i8vec3, i8vec3);" + "bvec4 equal(i8vec4, i8vec4);" + "bvec2 equal(u8vec2, u8vec2);" + "bvec3 equal(u8vec3, u8vec3);" + "bvec4 equal(u8vec4, u8vec4);" + + "bvec2 notEqual(i8vec2, i8vec2);" + "bvec3 notEqual(i8vec3, i8vec3);" + "bvec4 notEqual(i8vec4, i8vec4);" + "bvec2 notEqual(u8vec2, u8vec2);" + "bvec3 notEqual(u8vec3, u8vec3);" + "bvec4 notEqual(u8vec4, u8vec4);" + + " int8_t bitfieldExtract( int8_t, int8_t, int8_t);" + "i8vec2 bitfieldExtract(i8vec2, int8_t, int8_t);" + "i8vec3 bitfieldExtract(i8vec3, int8_t, int8_t);" + "i8vec4 bitfieldExtract(i8vec4, int8_t, int8_t);" + + " uint8_t bitfieldExtract( uint8_t, int8_t, int8_t);" + "u8vec2 bitfieldExtract(u8vec2, int8_t, int8_t);" + "u8vec3 bitfieldExtract(u8vec3, int8_t, int8_t);" + "u8vec4 bitfieldExtract(u8vec4, int8_t, int8_t);" + + " int8_t bitfieldInsert( int8_t base, int8_t, int8_t, int8_t);" + "i8vec2 bitfieldInsert(i8vec2 base, i8vec2, int8_t, int8_t);" + "i8vec3 bitfieldInsert(i8vec3 base, i8vec3, int8_t, int8_t);" + "i8vec4 bitfieldInsert(i8vec4 base, i8vec4, int8_t, int8_t);" + + " uint8_t bitfieldInsert( uint8_t base, uint8_t, int8_t, int8_t);" + "u8vec2 bitfieldInsert(u8vec2 base, u8vec2, int8_t, int8_t);" + "u8vec3 bitfieldInsert(u8vec3 base, u8vec3, int8_t, int8_t);" + "u8vec4 bitfieldInsert(u8vec4 base, u8vec4, int8_t, int8_t);" + + " int8_t bitCount( int8_t);" + "i8vec2 bitCount(i8vec2);" + "i8vec3 bitCount(i8vec3);" + "i8vec4 bitCount(i8vec4);" + + " int8_t bitCount( uint8_t);" + "i8vec2 bitCount(u8vec2);" + "i8vec3 bitCount(u8vec3);" + "i8vec4 bitCount(u8vec4);" + + " int8_t findLSB( int8_t);" + "i8vec2 findLSB(i8vec2);" + "i8vec3 findLSB(i8vec3);" + "i8vec4 findLSB(i8vec4);" + + " int8_t findLSB( uint8_t);" + "i8vec2 findLSB(u8vec2);" + "i8vec3 findLSB(u8vec3);" + "i8vec4 findLSB(u8vec4);" + + " int8_t findMSB( int8_t);" + "i8vec2 findMSB(i8vec2);" + "i8vec3 findMSB(i8vec3);" + "i8vec4 findMSB(i8vec4);" + + " int8_t findMSB( uint8_t);" + "i8vec2 findMSB(u8vec2);" + "i8vec3 findMSB(u8vec3);" + "i8vec4 findMSB(u8vec4);" + + "int16_t abs(int16_t);" + "i16vec2 abs(i16vec2);" + "i16vec3 abs(i16vec3);" + "i16vec4 abs(i16vec4);" + + "int16_t sign(int16_t);" + "i16vec2 sign(i16vec2);" + "i16vec3 sign(i16vec3);" + "i16vec4 sign(i16vec4);" + + "int16_t min(int16_t x, int16_t y);" + "i16vec2 min(i16vec2 x, int16_t y);" + "i16vec3 min(i16vec3 x, int16_t y);" + "i16vec4 min(i16vec4 x, int16_t y);" + "i16vec2 min(i16vec2 x, i16vec2 y);" + "i16vec3 min(i16vec3 x, i16vec3 y);" + "i16vec4 min(i16vec4 x, i16vec4 y);" + + "uint16_t min(uint16_t x, uint16_t y);" + "u16vec2 min(u16vec2 x, uint16_t y);" + "u16vec3 min(u16vec3 x, uint16_t y);" + "u16vec4 min(u16vec4 x, uint16_t y);" + "u16vec2 min(u16vec2 x, u16vec2 y);" + "u16vec3 min(u16vec3 x, u16vec3 y);" + "u16vec4 min(u16vec4 x, u16vec4 y);" + + "int16_t max(int16_t x, int16_t y);" + "i16vec2 max(i16vec2 x, int16_t y);" + "i16vec3 max(i16vec3 x, int16_t y);" + "i16vec4 max(i16vec4 x, int16_t y);" + "i16vec2 max(i16vec2 x, i16vec2 y);" + "i16vec3 max(i16vec3 x, i16vec3 y);" + "i16vec4 max(i16vec4 x, i16vec4 y);" + + "uint16_t max(uint16_t x, uint16_t y);" + "u16vec2 max(u16vec2 x, uint16_t y);" + "u16vec3 max(u16vec3 x, uint16_t y);" + "u16vec4 max(u16vec4 x, uint16_t y);" + "u16vec2 max(u16vec2 x, u16vec2 y);" + "u16vec3 max(u16vec3 x, u16vec3 y);" + "u16vec4 max(u16vec4 x, u16vec4 y);" + + "int16_t clamp(int16_t x, int16_t minVal, int16_t maxVal);" + "i16vec2 clamp(i16vec2 x, int16_t minVal, int16_t maxVal);" + "i16vec3 clamp(i16vec3 x, int16_t minVal, int16_t maxVal);" + "i16vec4 clamp(i16vec4 x, int16_t minVal, int16_t maxVal);" + "i16vec2 clamp(i16vec2 x, i16vec2 minVal, i16vec2 maxVal);" + "i16vec3 clamp(i16vec3 x, i16vec3 minVal, i16vec3 maxVal);" + "i16vec4 clamp(i16vec4 x, i16vec4 minVal, i16vec4 maxVal);" + + "uint16_t clamp(uint16_t x, uint16_t minVal, uint16_t maxVal);" + "u16vec2 clamp(u16vec2 x, uint16_t minVal, uint16_t maxVal);" + "u16vec3 clamp(u16vec3 x, uint16_t minVal, uint16_t maxVal);" + "u16vec4 clamp(u16vec4 x, uint16_t minVal, uint16_t maxVal);" + "u16vec2 clamp(u16vec2 x, u16vec2 minVal, u16vec2 maxVal);" + "u16vec3 clamp(u16vec3 x, u16vec3 minVal, u16vec3 maxVal);" + "u16vec4 clamp(u16vec4 x, u16vec4 minVal, u16vec4 maxVal);" + + "int16_t mix(int16_t, int16_t, bool);" + "i16vec2 mix(i16vec2, i16vec2, bvec2);" + "i16vec3 mix(i16vec3, i16vec3, bvec3);" + "i16vec4 mix(i16vec4, i16vec4, bvec4);" + "uint16_t mix(uint16_t, uint16_t, bool);" + "u16vec2 mix(u16vec2, u16vec2, bvec2);" + "u16vec3 mix(u16vec3, u16vec3, bvec3);" + "u16vec4 mix(u16vec4, u16vec4, bvec4);" + + "float16_t frexp(float16_t, out int16_t);" + "f16vec2 frexp(f16vec2, out i16vec2);" + "f16vec3 frexp(f16vec3, out i16vec3);" + "f16vec4 frexp(f16vec4, out i16vec4);" + + "float16_t ldexp(float16_t, int16_t);" + "f16vec2 ldexp(f16vec2, i16vec2);" + "f16vec3 ldexp(f16vec3, i16vec3);" + "f16vec4 ldexp(f16vec4, i16vec4);" + + "int16_t halfBitsToInt16(float16_t);" + "i16vec2 halfBitsToInt16(f16vec2);" + "i16vec3 halhBitsToInt16(f16vec3);" + "i16vec4 halfBitsToInt16(f16vec4);" + + "uint16_t halfBitsToUint16(float16_t);" + "u16vec2 halfBitsToUint16(f16vec2);" + "u16vec3 halfBitsToUint16(f16vec3);" + "u16vec4 halfBitsToUint16(f16vec4);" + + "int16_t float16BitsToInt16(float16_t);" + "i16vec2 float16BitsToInt16(f16vec2);" + "i16vec3 float16BitsToInt16(f16vec3);" + "i16vec4 float16BitsToInt16(f16vec4);" + + "uint16_t float16BitsToUint16(float16_t);" + "u16vec2 float16BitsToUint16(f16vec2);" + "u16vec3 float16BitsToUint16(f16vec3);" + "u16vec4 float16BitsToUint16(f16vec4);" + + "float16_t int16BitsToFloat16(int16_t);" + "f16vec2 int16BitsToFloat16(i16vec2);" + "f16vec3 int16BitsToFloat16(i16vec3);" + "f16vec4 int16BitsToFloat16(i16vec4);" + + "float16_t uint16BitsToFloat16(uint16_t);" + "f16vec2 uint16BitsToFloat16(u16vec2);" + "f16vec3 uint16BitsToFloat16(u16vec3);" + "f16vec4 uint16BitsToFloat16(u16vec4);" + + "float16_t int16BitsToHalf(int16_t);" + "f16vec2 int16BitsToHalf(i16vec2);" + "f16vec3 int16BitsToHalf(i16vec3);" + "f16vec4 int16BitsToHalf(i16vec4);" + + "float16_t uint16BitsToHalf(uint16_t);" + "f16vec2 uint16BitsToHalf(u16vec2);" + "f16vec3 uint16BitsToHalf(u16vec3);" + "f16vec4 uint16BitsToHalf(u16vec4);" + + "int packInt2x16(i16vec2);" + "uint packUint2x16(u16vec2);" + "int64_t packInt4x16(i16vec4);" + "uint64_t packUint4x16(u16vec4);" + "i16vec2 unpackInt2x16(int);" + "u16vec2 unpackUint2x16(uint);" + "i16vec4 unpackInt4x16(int64_t);" + "u16vec4 unpackUint4x16(uint64_t);" + + "bvec2 lessThan(i16vec2, i16vec2);" + "bvec3 lessThan(i16vec3, i16vec3);" + "bvec4 lessThan(i16vec4, i16vec4);" + "bvec2 lessThan(u16vec2, u16vec2);" + "bvec3 lessThan(u16vec3, u16vec3);" + "bvec4 lessThan(u16vec4, u16vec4);" + + "bvec2 lessThanEqual(i16vec2, i16vec2);" + "bvec3 lessThanEqual(i16vec3, i16vec3);" + "bvec4 lessThanEqual(i16vec4, i16vec4);" + "bvec2 lessThanEqual(u16vec2, u16vec2);" + "bvec3 lessThanEqual(u16vec3, u16vec3);" + "bvec4 lessThanEqual(u16vec4, u16vec4);" + + "bvec2 greaterThan(i16vec2, i16vec2);" + "bvec3 greaterThan(i16vec3, i16vec3);" + "bvec4 greaterThan(i16vec4, i16vec4);" + "bvec2 greaterThan(u16vec2, u16vec2);" + "bvec3 greaterThan(u16vec3, u16vec3);" + "bvec4 greaterThan(u16vec4, u16vec4);" + + "bvec2 greaterThanEqual(i16vec2, i16vec2);" + "bvec3 greaterThanEqual(i16vec3, i16vec3);" + "bvec4 greaterThanEqual(i16vec4, i16vec4);" + "bvec2 greaterThanEqual(u16vec2, u16vec2);" + "bvec3 greaterThanEqual(u16vec3, u16vec3);" + "bvec4 greaterThanEqual(u16vec4, u16vec4);" + + "bvec2 equal(i16vec2, i16vec2);" + "bvec3 equal(i16vec3, i16vec3);" + "bvec4 equal(i16vec4, i16vec4);" + "bvec2 equal(u16vec2, u16vec2);" + "bvec3 equal(u16vec3, u16vec3);" + "bvec4 equal(u16vec4, u16vec4);" + + "bvec2 notEqual(i16vec2, i16vec2);" + "bvec3 notEqual(i16vec3, i16vec3);" + "bvec4 notEqual(i16vec4, i16vec4);" + "bvec2 notEqual(u16vec2, u16vec2);" + "bvec3 notEqual(u16vec3, u16vec3);" + "bvec4 notEqual(u16vec4, u16vec4);" + + " int16_t bitfieldExtract( int16_t, int16_t, int16_t);" + "i16vec2 bitfieldExtract(i16vec2, int16_t, int16_t);" + "i16vec3 bitfieldExtract(i16vec3, int16_t, int16_t);" + "i16vec4 bitfieldExtract(i16vec4, int16_t, int16_t);" + + " uint16_t bitfieldExtract( uint16_t, int16_t, int16_t);" + "u16vec2 bitfieldExtract(u16vec2, int16_t, int16_t);" + "u16vec3 bitfieldExtract(u16vec3, int16_t, int16_t);" + "u16vec4 bitfieldExtract(u16vec4, int16_t, int16_t);" + + " int16_t bitfieldInsert( int16_t base, int16_t, int16_t, int16_t);" + "i16vec2 bitfieldInsert(i16vec2 base, i16vec2, int16_t, int16_t);" + "i16vec3 bitfieldInsert(i16vec3 base, i16vec3, int16_t, int16_t);" + "i16vec4 bitfieldInsert(i16vec4 base, i16vec4, int16_t, int16_t);" + + " uint16_t bitfieldInsert( uint16_t base, uint16_t, int16_t, int16_t);" + "u16vec2 bitfieldInsert(u16vec2 base, u16vec2, int16_t, int16_t);" + "u16vec3 bitfieldInsert(u16vec3 base, u16vec3, int16_t, int16_t);" + "u16vec4 bitfieldInsert(u16vec4 base, u16vec4, int16_t, int16_t);" + + " int16_t bitCount( int16_t);" + "i16vec2 bitCount(i16vec2);" + "i16vec3 bitCount(i16vec3);" + "i16vec4 bitCount(i16vec4);" + + " int16_t bitCount( uint16_t);" + "i16vec2 bitCount(u16vec2);" + "i16vec3 bitCount(u16vec3);" + "i16vec4 bitCount(u16vec4);" + + " int16_t findLSB( int16_t);" + "i16vec2 findLSB(i16vec2);" + "i16vec3 findLSB(i16vec3);" + "i16vec4 findLSB(i16vec4);" + + " int16_t findLSB( uint16_t);" + "i16vec2 findLSB(u16vec2);" + "i16vec3 findLSB(u16vec3);" + "i16vec4 findLSB(u16vec4);" + + " int16_t findMSB( int16_t);" + "i16vec2 findMSB(i16vec2);" + "i16vec3 findMSB(i16vec3);" + "i16vec4 findMSB(i16vec4);" + + " int16_t findMSB( uint16_t);" + "i16vec2 findMSB(u16vec2);" + "i16vec3 findMSB(u16vec3);" + "i16vec4 findMSB(u16vec4);" + + "int16_t pack16(i8vec2);" + "uint16_t pack16(u8vec2);" + "int32_t pack32(i8vec4);" + "uint32_t pack32(u8vec4);" + "int32_t pack32(i16vec2);" + "uint32_t pack32(u16vec2);" + "int64_t pack64(i16vec4);" + "uint64_t pack64(u16vec4);" + "int64_t pack64(i32vec2);" + "uint64_t pack64(u32vec2);" + + "i8vec2 unpack8(int16_t);" + "u8vec2 unpack8(uint16_t);" + "i8vec4 unpack8(int32_t);" + "u8vec4 unpack8(uint32_t);" + "i16vec2 unpack16(int32_t);" + "u16vec2 unpack16(uint32_t);" + "i16vec4 unpack16(int64_t);" + "u16vec4 unpack16(uint64_t);" + "i32vec2 unpack32(int64_t);" + "u32vec2 unpack32(uint64_t);" + + // GL_EXT_expect_assume + "int8_t expectEXT(int8_t, int8_t);" + "i8vec2 expectEXT(i8vec2, i8vec2);" + "i8vec3 expectEXT(i8vec3, i8vec3);" + "i8vec4 expectEXT(i8vec4, i8vec4);" + + "uint8_t expectEXT(uint8_t, uint8_t);" + "u8vec2 expectEXT(u8vec2, u8vec2);" + "u8vec3 expectEXT(u8vec3, u8vec3);" + "u8vec4 expectEXT(u8vec4, u8vec4);" + + "int16_t expectEXT(int16_t, int16_t);" + "i16vec2 expectEXT(i16vec2, i16vec2);" + "i16vec3 expectEXT(i16vec3, i16vec3);" + "i16vec4 expectEXT(i16vec4, i16vec4);" + + "uint16_t expectEXT(uint16_t, uint16_t);" + "u16vec2 expectEXT(u16vec2, u16vec2);" + "u16vec3 expectEXT(u16vec3, u16vec3);" + "u16vec4 expectEXT(u16vec4, u16vec4);" + + "int64_t expectEXT(int64_t, int64_t);" + "i64vec2 expectEXT(i64vec2, i64vec2);" + "i64vec3 expectEXT(i64vec3, i64vec3);" + "i64vec4 expectEXT(i64vec4, i64vec4);" + + "uint64_t expectEXT(uint64_t, uint64_t);" + "u64vec2 expectEXT(u64vec2, u64vec2);" + "u64vec3 expectEXT(u64vec3, u64vec3);" + "u64vec4 expectEXT(u64vec4, u64vec4);" + "\n"); + } + + // Builtins for GL_EXT_texture_shadow_lod + if ((profile == EEsProfile && version >= 300) || ((profile != EEsProfile && version >= 130))) { + commonBuiltins.append( + "float texture(sampler2DArrayShadow, vec4, float);" + "float texture(samplerCubeArrayShadow, vec4, float, float);" + "float textureLod(sampler2DArrayShadow, vec4, float);" + "float textureLod(samplerCubeShadow, vec4, float);" + "float textureLod(samplerCubeArrayShadow, vec4, float, float);" + "float textureLodOffset(sampler2DArrayShadow, vec4, float, ivec2);" + "float textureOffset(sampler2DArrayShadow, vec4 , ivec2, float);" + "\n"); + } + + if (profile != EEsProfile && version >= 450) { + stageBuiltins[EShLangFragment].append(derivativesAndControl64bits); + stageBuiltins[EShLangFragment].append( + "float64_t interpolateAtCentroid(float64_t);" + "f64vec2 interpolateAtCentroid(f64vec2);" + "f64vec3 interpolateAtCentroid(f64vec3);" + "f64vec4 interpolateAtCentroid(f64vec4);" + + "float64_t interpolateAtSample(float64_t, int);" + "f64vec2 interpolateAtSample(f64vec2, int);" + "f64vec3 interpolateAtSample(f64vec3, int);" + "f64vec4 interpolateAtSample(f64vec4, int);" + + "float64_t interpolateAtOffset(float64_t, f64vec2);" + "f64vec2 interpolateAtOffset(f64vec2, f64vec2);" + "f64vec3 interpolateAtOffset(f64vec3, f64vec2);" + "f64vec4 interpolateAtOffset(f64vec4, f64vec2);" + + "\n"); + + } + + // GL_EXT_expect_assume + if ((profile == EEsProfile && version >= 310) || + ((profile != EEsProfile && version >= 140))) { + commonBuiltins.append( + "void assumeEXT(bool);" + + "bool expectEXT(bool, bool);" + "bvec2 expectEXT(bvec2, bvec2);" + "bvec3 expectEXT(bvec3, bvec3);" + "bvec4 expectEXT(bvec4, bvec4);" + + "int expectEXT(int, int);" + "ivec2 expectEXT(ivec2, ivec2);" + "ivec3 expectEXT(ivec3, ivec3);" + "ivec4 expectEXT(ivec4, ivec4);" + + "uint expectEXT(uint, uint);" + "uvec2 expectEXT(uvec2, uvec2);" + "uvec3 expectEXT(uvec3, uvec3);" + "uvec4 expectEXT(uvec4, uvec4);" + "\n"); + } + + // QCOM_image_processing + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + commonBuiltins.append( + "vec4 textureWeightedQCOM(sampler2D, vec2, sampler2DArray);" + "vec4 textureWeightedQCOM(sampler2D, vec2, sampler1DArray);" + "vec4 textureBoxFilterQCOM(sampler2D, vec2, vec2);" + "vec4 textureBlockMatchSADQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" + "vec4 textureBlockMatchSSDQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" + + "vec4 textureBlockMatchWindowSSDQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" + "vec4 textureBlockMatchWindowSADQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" + "vec4 textureBlockMatchGatherSSDQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" + "vec4 textureBlockMatchGatherSADQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" + "\n"); + } + + //============================================================================ + // + // Prototypes for built-in functions seen by vertex shaders only. + // (Except legacy lod functions, where it depends which release they are + // vertex only.) + // + //============================================================================ + + // + // Geometric Functions. + // + if (spvVersion.vulkan == 0 && IncludeLegacy(version, profile, spvVersion)) + stageBuiltins[EShLangVertex].append("vec4 ftransform();"); + + // + // Original-style texture Functions with lod. + // + TString* s; + if (version == 100) + s = &stageBuiltins[EShLangVertex]; + else + s = &commonBuiltins; + if ((profile == EEsProfile && version == 100) || + profile == ECompatibilityProfile || + (profile == ECoreProfile && version < 420) || + profile == ENoProfile) { + if (spvVersion.spv == 0) { + s->append( + "vec4 texture2DLod(sampler2D, vec2, float);" // GL_ARB_shader_texture_lod + "vec4 texture2DProjLod(sampler2D, vec3, float);" // GL_ARB_shader_texture_lod + "vec4 texture2DProjLod(sampler2D, vec4, float);" // GL_ARB_shader_texture_lod + "vec4 texture3DLod(sampler3D, vec3, float);" // GL_ARB_shader_texture_lod // OES_texture_3D, but caught by keyword check + "vec4 texture3DProjLod(sampler3D, vec4, float);" // GL_ARB_shader_texture_lod // OES_texture_3D, but caught by keyword check + "vec4 textureCubeLod(samplerCube, vec3, float);" // GL_ARB_shader_texture_lod + + "\n"); + } + } + if ( profile == ECompatibilityProfile || + (profile == ECoreProfile && version < 420) || + profile == ENoProfile) { + if (spvVersion.spv == 0) { + s->append( + "vec4 texture1DLod(sampler1D, float, float);" // GL_ARB_shader_texture_lod + "vec4 texture1DProjLod(sampler1D, vec2, float);" // GL_ARB_shader_texture_lod + "vec4 texture1DProjLod(sampler1D, vec4, float);" // GL_ARB_shader_texture_lod + "vec4 shadow1DLod(sampler1DShadow, vec3, float);" // GL_ARB_shader_texture_lod + "vec4 shadow2DLod(sampler2DShadow, vec3, float);" // GL_ARB_shader_texture_lod + "vec4 shadow1DProjLod(sampler1DShadow, vec4, float);" // GL_ARB_shader_texture_lod + "vec4 shadow2DProjLod(sampler2DShadow, vec4, float);" // GL_ARB_shader_texture_lod + + "vec4 texture1DGradARB(sampler1D, float, float, float);" // GL_ARB_shader_texture_lod + "vec4 texture1DProjGradARB(sampler1D, vec2, float, float);" // GL_ARB_shader_texture_lod + "vec4 texture1DProjGradARB(sampler1D, vec4, float, float);" // GL_ARB_shader_texture_lod + "vec4 texture2DGradARB(sampler2D, vec2, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 texture2DProjGradARB(sampler2D, vec3, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 texture2DProjGradARB(sampler2D, vec4, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 texture3DGradARB(sampler3D, vec3, vec3, vec3);" // GL_ARB_shader_texture_lod + "vec4 texture3DProjGradARB(sampler3D, vec4, vec3, vec3);" // GL_ARB_shader_texture_lod + "vec4 textureCubeGradARB(samplerCube, vec3, vec3, vec3);" // GL_ARB_shader_texture_lod + "vec4 shadow1DGradARB(sampler1DShadow, vec3, float, float);" // GL_ARB_shader_texture_lod + "vec4 shadow1DProjGradARB( sampler1DShadow, vec4, float, float);" // GL_ARB_shader_texture_lod + "vec4 shadow2DGradARB(sampler2DShadow, vec3, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 shadow2DProjGradARB( sampler2DShadow, vec4, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 texture2DRectGradARB(sampler2DRect, vec2, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 texture2DRectProjGradARB( sampler2DRect, vec3, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 texture2DRectProjGradARB( sampler2DRect, vec4, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 shadow2DRectGradARB( sampler2DRectShadow, vec3, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 shadow2DRectProjGradARB(sampler2DRectShadow, vec4, vec2, vec2);" // GL_ARB_shader_texture_lod + + "\n"); + } + } + + if ((profile != EEsProfile && version >= 150) || + (profile == EEsProfile && version >= 310)) { + //============================================================================ + // + // Prototypes for built-in functions seen by geometry shaders only. + // + //============================================================================ + if (profile != EEsProfile && version >= 150) { + stageBuiltins[EShLangGeometry].append( + "void EmitStreamVertex(int);" + "void EndStreamPrimitive(int);" + ); + } + stageBuiltins[EShLangGeometry].append( + "void EmitVertex();" + "void EndPrimitive();" + "\n"); + } + + //============================================================================ + // + // Prototypes for all control functions. + // + //============================================================================ + bool esBarrier = (profile == EEsProfile && version >= 310); + if ((profile != EEsProfile && version >= 150) || esBarrier) + stageBuiltins[EShLangTessControl].append( + "void barrier();" + ); + if ((profile != EEsProfile && version >= 420) || esBarrier) + stageBuiltins[EShLangCompute].append( + "void barrier();" + ); + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + stageBuiltins[EShLangMesh].append( + "void barrier();" + ); + stageBuiltins[EShLangTask].append( + "void barrier();" + ); + } + if ((profile != EEsProfile && version >= 130) || esBarrier) + commonBuiltins.append( + "void memoryBarrier();" + ); + if ((profile != EEsProfile && version >= 420) || esBarrier) { + commonBuiltins.append( + "void memoryBarrierBuffer();" + ); + stageBuiltins[EShLangCompute].append( + "void memoryBarrierShared();" + "void groupMemoryBarrier();" + ); + } + if ((profile != EEsProfile && version >= 420) || esBarrier) { + if (spvVersion.vulkan == 0 || spvVersion.vulkanRelaxed) { + commonBuiltins.append("void memoryBarrierAtomicCounter();"); + } + commonBuiltins.append("void memoryBarrierImage();"); + } + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + stageBuiltins[EShLangMesh].append( + "void memoryBarrierShared();" + "void groupMemoryBarrier();" + ); + stageBuiltins[EShLangTask].append( + "void memoryBarrierShared();" + "void groupMemoryBarrier();" + ); + } + + commonBuiltins.append("void controlBarrier(int, int, int, int);\n" + "void memoryBarrier(int, int, int);\n"); + + commonBuiltins.append("void debugPrintfEXT();\n"); + + if (profile != EEsProfile && version >= 450) { + // coopMatStoreNV perhaps ought to have "out" on the buf parameter, but + // adding it introduces undesirable tempArgs on the stack. What we want + // is more like "buf" thought of as a pointer value being an in parameter. + stageBuiltins[EShLangCompute].append( + "void coopMatLoadNV(out fcoopmatNV m, volatile coherent nontemporal float16_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out fcoopmatNV m, volatile coherent nontemporal float[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out fcoopmatNV m, volatile coherent nontemporal uint8_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out fcoopmatNV m, volatile coherent nontemporal uint16_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out fcoopmatNV m, volatile coherent nontemporal uint[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out fcoopmatNV m, volatile coherent nontemporal uint64_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out fcoopmatNV m, volatile coherent nontemporal uvec2[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out fcoopmatNV m, volatile coherent nontemporal uvec4[] buf, uint element, uint stride, bool colMajor);\n" + + "void coopMatStoreNV(fcoopmatNV m, volatile coherent nontemporal float16_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(fcoopmatNV m, volatile coherent nontemporal float[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(fcoopmatNV m, volatile coherent nontemporal float64_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(fcoopmatNV m, volatile coherent nontemporal uint8_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(fcoopmatNV m, volatile coherent nontemporal uint16_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(fcoopmatNV m, volatile coherent nontemporal uint[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(fcoopmatNV m, volatile coherent nontemporal uint64_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(fcoopmatNV m, volatile coherent nontemporal uvec2[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(fcoopmatNV m, volatile coherent nontemporal uvec4[] buf, uint element, uint stride, bool colMajor);\n" + + "fcoopmatNV coopMatMulAddNV(fcoopmatNV A, fcoopmatNV B, fcoopmatNV C);\n" + "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal int8_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal int16_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal int[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal int64_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal ivec2[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal ivec4[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal uint8_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal uint16_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal uint[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal uint64_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal uvec2[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal uvec4[] buf, uint element, uint stride, bool colMajor);\n" + + "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal int8_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal int16_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal int[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal int64_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal ivec2[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal ivec4[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal uint8_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal uint16_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal uint[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal uint64_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal uvec2[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal uvec4[] buf, uint element, uint stride, bool colMajor);\n" + + "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal int8_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal int16_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal int[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal int64_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal ivec2[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal ivec4[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal uint8_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal uint16_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal uint[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal uint64_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal uvec2[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal uvec4[] buf, uint element, uint stride, bool colMajor);\n" + + "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal int8_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal int16_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal int[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal int64_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal ivec2[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal ivec4[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal uint8_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal uint16_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal uint[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal uint64_t[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal uvec2[] buf, uint element, uint stride, bool colMajor);\n" + "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal uvec4[] buf, uint element, uint stride, bool colMajor);\n" + + "icoopmatNV coopMatMulAddNV(icoopmatNV A, icoopmatNV B, icoopmatNV C);\n" + "ucoopmatNV coopMatMulAddNV(ucoopmatNV A, ucoopmatNV B, ucoopmatNV C);\n" + ); + + std::stringstream cooperativeMatrixFuncs; + + { + static const char *allTypes[] = + { + "float", "vec2", "vec4", + "float16_t", "f16vec2", "f16vec4", + "bfloat16_t", "bf16vec2", "bf16vec4", + "floate5m2_t", "fe5m2vec2", "fe5m2vec4", + "floate4m3_t", "fe4m3vec2", "fe4m3vec4", + "double", "dvec2", "dvec4", + "int8_t", "i8vec2", "i8vec4", + "int16_t", "i16vec2", "i16vec4", + "int", "ivec2", "ivec4", + "int64_t", "i64vec2", "i64vec4", + "uint8_t", "u8vec2", "u8vec4", + "uint16_t", "u16vec2", "u16vec4", + "uint", "uvec2", "uvec4", + "uint64_t", "u64vec2", "u64vec4", + }; + for (auto elemTy : {"uint", "uint64_t"}) { + for (auto t : allTypes) { + cooperativeMatrixFuncs << "void coopMatLoad(out coopmat m, volatile coherent nontemporal " << t << "[] buf, " << elemTy << " element, uint stride, int matrixLayout);\n"; + cooperativeMatrixFuncs << "void coopMatStore(coopmat m, volatile coherent nontemporal " << t << "[] buf, " << elemTy << " element, uint stride, int matrixLayout);\n"; + } + // Just use uint8_t for buffer type, we have special matching rules to allow any conversion + cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t);\n"; + cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t, tensorViewNV v);\n"; + cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t, __function f);\n"; + cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t, tensorViewNV v, __function f);\n"; + cooperativeMatrixFuncs << "void coopMatStoreTensorNV(coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t);\n"; + cooperativeMatrixFuncs << "void coopMatStoreTensorNV(coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t, tensorViewNV v);\n"; + } + } + + cooperativeMatrixFuncs << + "coopmat coopMatMulAdd(coopmat A, coopmat B, coopmat C);\n" + "coopmat coopMatMulAdd(coopmat A, coopmat B, coopmat C, int matrixOperands);\n"; + + commonBuiltins.append(cooperativeMatrixFuncs.str().c_str()); + + commonBuiltins.append( + "const int gl_MatrixUseA = 0;\n" + "const int gl_MatrixUseB = 1;\n" + "const int gl_MatrixUseAccumulator = 2;\n" + "const int gl_MatrixOperandsSaturatingAccumulation = 0x10;\n" + "const int gl_CooperativeMatrixLayoutRowMajor = 0;\n" + "const int gl_CooperativeMatrixLayoutColumnMajor = 1;\n" + "const int gl_CooperativeMatrixLayoutRowBlockedInterleavedARM = 4202;\n" + "const int gl_CooperativeMatrixLayoutColumnBlockedInterleavedARM = 4203;\n" + "\n" + ); + + commonBuiltins.append( + "void coopMatTransposeNV(out coopmat, coopmat);" + "void coopMatReduceNV(out coopmat, coopmat, int, __function);" + "void coopMatPerElementNV();" + ); + + commonBuiltins.append( + "const int gl_CooperativeMatrixReduceRowNV = 0x1;\n" + "const int gl_CooperativeMatrixReduceColumnNV = 0x2;\n" + "const int gl_CooperativeMatrixReduceRowAndColumnNV = 0x3;\n" + "const int gl_CooperativeMatrixReduce2x2NV = 0x4;\n" + "\n" + ); + + commonBuiltins.append( + "const int gl_CooperativeMatrixClampModeUndefinedNV = 0x0;\n" + "const int gl_CooperativeMatrixClampModeConstantNV = 0x1;\n" + "const int gl_CooperativeMatrixClampModeClampToEdgeNV = 0x2;\n" + "const int gl_CooperativeMatrixClampModeRepeatNV = 0x3;\n" + "const int gl_CooperativeMatrixClampModeMirrorRepeatNV = 0x4;\n" + "\n" + ); + + { + std::stringstream coopMatConvFuncs; + + const std::string eltTypes[] = {"uint32_t", "uint", "int32_t", "int", "float32_t", "float", "float16_t"}; + + for (auto srcEltTy : eltTypes) { + for (auto dstEltTy : eltTypes) { + coopMatConvFuncs << "void bitcastQCOM(" << srcEltTy.c_str() << " SrcArr[], " << dstEltTy.c_str() + << " DstArr[]);\n"; + } + } + coopMatConvFuncs << "\n"; + + for (auto eltTy : {"float32_t", "float16_t", "int8_t", "uint8_t", "uint32_t", "uint", "int32_t", "int"}) { + coopMatConvFuncs << "void vectorToCoopmatQCOM(" << eltTy << " SrcVec[], coopmat CM);\n"; + coopMatConvFuncs << "void coopmatToVectorQCOM(coopmat CM, " << eltTy << " Dstvec[]);\n"; + } + + for (auto eltTy : {"uint32_t", "uint", "int32_t", "int", "float32_t", "float", "float16_t"}) { + coopMatConvFuncs << "void extractSubArrayQCOM(" << eltTy << " arr[], uint index, " << eltTy << " subarr[]);\n"; + } + + commonBuiltins.append(coopMatConvFuncs.str().c_str()); + } + + commonBuiltins.append( + "tensorLayoutNV createTensorLayoutNV(uint Dim);\n" + "tensorLayoutNV createTensorLayoutNV(uint Dim, uint Mode);\n" + + "tensorLayoutNV setTensorLayoutBlockSizeNV(tensorLayoutNV t, uint blockSize0);\n" + "tensorLayoutNV setTensorLayoutBlockSizeNV(tensorLayoutNV t, uint blockSize0, uint blockSize1);\n" + "tensorLayoutNV setTensorLayoutBlockSizeNV(tensorLayoutNV t, uint blockSize0, uint blockSize1, uint blockSize2);\n" + "tensorLayoutNV setTensorLayoutBlockSizeNV(tensorLayoutNV t, uint blockSize0, uint blockSize1, uint blockSize2, uint blockSize3);\n" + "tensorLayoutNV setTensorLayoutBlockSizeNV(tensorLayoutNV t, uint blockSize0, uint blockSize1, uint blockSize2, uint blockSize3, uint blockSize4);\n" + + "tensorLayoutNV setTensorLayoutDimensionNV(tensorLayoutNV t, uint dim0);\n" + "tensorLayoutNV setTensorLayoutDimensionNV(tensorLayoutNV t, uint dim0, uint dim1);\n" + "tensorLayoutNV setTensorLayoutDimensionNV(tensorLayoutNV t, uint dim0, uint dim1, uint dim2);\n" + "tensorLayoutNV setTensorLayoutDimensionNV(tensorLayoutNV t, uint dim0, uint dim1, uint dim2, uint dim3);\n" + "tensorLayoutNV setTensorLayoutDimensionNV(tensorLayoutNV t, uint dim0, uint dim1, uint dim2, uint dim3, uint dim4);\n" + + "tensorLayoutNV setTensorLayoutStrideNV(tensorLayoutNV t, uint stride0);\n" + "tensorLayoutNV setTensorLayoutStrideNV(tensorLayoutNV t, uint stride0, uint stride1);\n" + "tensorLayoutNV setTensorLayoutStrideNV(tensorLayoutNV t, uint stride0, uint stride1, uint stride2);\n" + "tensorLayoutNV setTensorLayoutStrideNV(tensorLayoutNV t, uint stride0, uint stride1, uint stride2, uint stride3);\n" + "tensorLayoutNV setTensorLayoutStrideNV(tensorLayoutNV t, uint stride0, uint stride1, uint stride2, uint stride3, uint stride4);\n" + + "tensorLayoutNV sliceTensorLayoutNV(tensorLayoutNV t, uint offset0, uint span0);\n" + "tensorLayoutNV sliceTensorLayoutNV(tensorLayoutNV t, uint offset0, uint span0, uint offset1, uint span1);\n" + "tensorLayoutNV sliceTensorLayoutNV(tensorLayoutNV t, uint offset0, uint span0, uint offset1, uint span1, uint offset2, uint span2);\n" + "tensorLayoutNV sliceTensorLayoutNV(tensorLayoutNV t, uint offset0, uint span0, uint offset1, uint span1, uint offset2, uint span2, uint offset3, uint span3);\n" + "tensorLayoutNV sliceTensorLayoutNV(tensorLayoutNV t, uint offset0, uint span0, uint offset1, uint span1, uint offset2, uint span2, uint offset3, uint span3, uint offset4, uint span4);\n" + + "tensorLayoutNV setTensorLayoutClampValueNV(tensorLayoutNV t, uint value);\n" + + "tensorViewNV createTensorViewNV(uint Dim);\n" + "tensorViewNV createTensorViewNV(uint Dim, bool HasDimensions);\n" + "tensorViewNV createTensorViewNV(uint Dim, bool HasDimensions, uint p0);\n" + "tensorViewNV createTensorViewNV(uint Dim, bool HasDimensions, uint p0, uint p1);\n" + "tensorViewNV createTensorViewNV(uint Dim, bool HasDimensions, uint p0, uint p1, uint p2);\n" + "tensorViewNV createTensorViewNV(uint Dim, bool HasDimensions, uint p0, uint p1, uint p2, uint p3);\n" + "tensorViewNV createTensorViewNV(uint Dim, bool HasDimensions, uint p0, uint p1, uint p2, uint p3, uint p4);\n" + + "tensorViewNV setTensorViewDimensionsNV(tensorViewNV v, uint dim0);\n" + "tensorViewNV setTensorViewDimensionsNV(tensorViewNV v, uint dim0, uint dim1);\n" + "tensorViewNV setTensorViewDimensionsNV(tensorViewNV v, uint dim0, uint dim1, uint dim2);\n" + "tensorViewNV setTensorViewDimensionsNV(tensorViewNV v, uint dim0, uint dim1, uint dim2, uint dim3);\n" + "tensorViewNV setTensorViewDimensionsNV(tensorViewNV v, uint dim0, uint dim1, uint dim2, uint dim3, uint dim4);\n" + + "tensorViewNV setTensorViewStrideNV(tensorViewNV v, uint stride0);\n" + "tensorViewNV setTensorViewStrideNV(tensorViewNV v, uint stride0, uint stride1);\n" + "tensorViewNV setTensorViewStrideNV(tensorViewNV v, uint stride0, uint stride1, uint stride2);\n" + "tensorViewNV setTensorViewStrideNV(tensorViewNV v, uint stride0, uint stride1, uint stride2, uint stride3);\n" + "tensorViewNV setTensorViewStrideNV(tensorViewNV v, uint stride0, uint stride1, uint stride2, uint stride3, uint stride4);\n" + + "tensorViewNV setTensorViewClipNV(tensorViewNV v, uint clipRowOffset, uint clipRowSpan, uint clipColOffset, uint clipColSpan);\n" + "\n" + ); + + // GL_ARM_tensors builtins. + static const char *tensorDataTypesARM[] = { + "bool", + "int8_t", "int16_t", "int32_t", "int64_t", + "uint8_t", "uint16_t", "uint32_t", "uint64_t", + "float16_t", "float32_t", "float64_t", + }; + std::ostringstream ostream; + for (auto t : tensorDataTypesARM) { + // Scalar + ostream << "void tensorReadARM(readonly tensorARM t, uint coords[], out " + << t << " data, uint tensorOperands = 0U, ...);\n"; + ostream << "void tensorWriteARM(writeonly tensorARM t, uint coords[], " + << t << " data, uint tensorOperands = 0U, ...);\n"; + // Array + ostream << "void tensorReadARM(readonly tensorARM t, uint coords[], " + << t << " data[], uint tensorOperands = 0U, ...);\n"; + ostream << "void tensorWriteARM(writeonly tensorARM t, uint coords[], " + << t << " data[], uint tensorOperands = 0U, ...);\n"; + } + ostream << "uint tensorSizeARM(readonly writeonly tensorARM t, uint dim);\n"; + commonBuiltins.append(ostream.str()); + } + + if (profile != EEsProfile && version >= 450) { + const char *basicTypes[] = { + "int8_t", + "int16_t", + "int32_t", + "int64_t", + "uint8_t", + "uint16_t", + "uint32_t", + "uint64_t", + "float16_t", + "float32_t", + "float64_t", + }; + std::string coopVecOffsetTypes[] = { + "uint", + "uint64_t", + }; + for (auto offsetTy : coopVecOffsetTypes) { + for (uint32_t i = 0; i < sizeof(basicTypes)/sizeof(basicTypes[0]); ++i) { + std::string func = std::string("void coopVecMatMulNV(out coopvecNV result, ") + + std::string("coopvecNV v, ") + + std::string("int inputInterpretation, ") + + std::string(basicTypes[i]) + std::string("[] matrix, ") + + offsetTy + std::string(" matrixOffset, ") + + std::string("int matrixInterpretation, ") + + std::string("uint M, ") + + std::string("uint K, ") + + std::string("int matrixLayout, ") + + std::string("bool transpose, ") + + std::string("uint matrixStride);\n"); + commonBuiltins.append(func.c_str()); + + for (uint32_t j = 0; j < sizeof(basicTypes)/sizeof(basicTypes[0]); ++j) { + func = std::string("void coopVecMatMulAddNV(out coopvecNV result, ") + + std::string("coopvecNV v, ") + + std::string("int inputInterpretation, ") + + std::string(basicTypes[i]) + std::string("[] matrix, ") + + offsetTy + std::string(" matrixOffset, ") + + std::string("int matrixInterpretation, ") + + std::string(basicTypes[j]) + std::string("[] bias, ") + + offsetTy + std::string(" biasOffset, ") + + std::string("int biasInterpretation, ") + + std::string("uint M, ") + + std::string("uint K, ") + + std::string("int matrixLayout, ") + + std::string("bool transpose, ") + + std::string("uint matrixStride);\n"); + commonBuiltins.append(func.c_str()); + } + + func = std::string("void coopVecOuterProductAccumulateNV(coopvecNV v1, coopvecNV v2, ") + + std::string(basicTypes[i]) + + std::string("[] buf, ") + offsetTy + std::string(" offset, uint stride, int matrixLayout, int matrixInterpretation);\n"); + commonBuiltins.append(func.c_str()); + + func = std::string("void coopVecReduceSumAccumulateNV(coopvecNV v, ") + + std::string(basicTypes[i]) + + std::string("[] buf, ") + offsetTy + std::string(" offset);\n"); + commonBuiltins.append(func.c_str()); + } + } + std::string cooperativeVectorFuncs = + "coopvecNV fma(coopvecNV, coopvecNV, coopvecNV);\n" + "coopvecNV min(coopvecNV, coopvecNV);\n" + "coopvecNV max(coopvecNV, coopvecNV);\n" + "coopvecNV step(coopvecNV, coopvecNV);\n" + "coopvecNV exp(coopvecNV);\n" + "coopvecNV log(coopvecNV);\n" + "coopvecNV tanh(coopvecNV);\n" + "coopvecNV atan(coopvecNV);\n" + "coopvecNV clamp(coopvecNV, coopvecNV, coopvecNV);\n" + "\n" + ; + + commonBuiltins.append(cooperativeVectorFuncs.c_str()); + + const char *scalarAndVectorTypes[] = { + "int8_t", + "int16_t", + "int32_t", + "int64_t", + "uint8_t", + "uint16_t", + "uint32_t", + "uint64_t", + "float16_t", + "float32_t", + "float64_t", + "i8vec2", + "i16vec2", + "i32vec2", + "i64vec2", + "u8vec2", + "u16vec2", + "u32vec2", + "u64vec2", + "f16vec2", + "f32vec2", + "f64vec2", + "i8vec3", + "i16vec3", + "i32vec3", + "i64vec3", + "u8vec3", + "u16vec3", + "u32vec3", + "u64vec3", + "f16vec3", + "f32vec3", + "f64vec3", + "i8vec4", + "i16vec4", + "i32vec4", + "i64vec4", + "u8vec4", + "u16vec4", + "u32vec4", + "u64vec4", + "f16vec4", + "f32vec4", + "f64vec4", + }; + + for (auto offsetTy : coopVecOffsetTypes) { + for (uint32_t i = 0; i < sizeof(scalarAndVectorTypes)/sizeof(scalarAndVectorTypes[0]); ++i) { + std::string load = std::string("void coopVecLoadNV(out coopvecNV v, volatile coherent ") + + std::string(scalarAndVectorTypes[i]) + std::string("[] buf, ") + offsetTy + std::string(" offset);"); + std::string store = std::string("void coopVecStoreNV(coopvecNV v, volatile coherent ") + + std::string(scalarAndVectorTypes[i]) + std::string("[] buf, ") + offsetTy + std::string(" offset);"); + commonBuiltins.append(load.c_str()); + commonBuiltins.append(store.c_str()); + } + } + + commonBuiltins.append( + "const int gl_CooperativeVectorMatrixLayoutRowMajorNV = 0;\n" + "const int gl_CooperativeVectorMatrixLayoutColumnMajorNV = 1;\n" + "const int gl_CooperativeVectorMatrixLayoutInferencingOptimalNV = 2;\n" + "const int gl_CooperativeVectorMatrixLayoutTrainingOptimalNV = 3;\n" + "\n" + ); + + commonBuiltins.append( + "const int gl_ComponentTypeFloat16NV = 0;\n" + "const int gl_ComponentTypeFloat32NV = 1;\n" + "const int gl_ComponentTypeFloat64NV = 2;\n" + "const int gl_ComponentTypeSignedInt8NV = 3;\n" + "const int gl_ComponentTypeSignedInt16NV = 4;\n" + "const int gl_ComponentTypeSignedInt32NV = 5;\n" + "const int gl_ComponentTypeSignedInt64NV = 6;\n" + "const int gl_ComponentTypeUnsignedInt8NV = 7;\n" + "const int gl_ComponentTypeUnsignedInt16NV = 8;\n" + "const int gl_ComponentTypeUnsignedInt32NV = 9;\n" + "const int gl_ComponentTypeUnsignedInt64NV = 10;\n" + "const int gl_ComponentTypeSignedInt8PackedNV = 1000491000;\n" + "const int gl_ComponentTypeUnsignedInt8PackedNV = 1000491001;\n" + "const int gl_ComponentTypeFloatE4M3NV = 1000491002;\n" + "const int gl_ComponentTypeFloatE5M2NV = 1000491003;\n" + "\n" + ); + } + + //============================================================================ + // + // Prototypes for built-in functions seen by fragment shaders only. + // + //============================================================================ + + // + // Original-style texture Functions with bias. + // + if (spvVersion.spv == 0 && (profile != EEsProfile || version == 100)) { + stageBuiltins[EShLangFragment].append( + "vec4 texture2D(sampler2D, vec2, float);" + "vec4 texture2DProj(sampler2D, vec3, float);" + "vec4 texture2DProj(sampler2D, vec4, float);" + "vec4 texture3D(sampler3D, vec3, float);" // OES_texture_3D + "vec4 texture3DProj(sampler3D, vec4, float);" // OES_texture_3D + "vec4 textureCube(samplerCube, vec3, float);" + + "\n"); + } + if (spvVersion.spv == 0 && (profile != EEsProfile && version > 100)) { + stageBuiltins[EShLangFragment].append( + "vec4 texture1D(sampler1D, float, float);" + "vec4 texture1DProj(sampler1D, vec2, float);" + "vec4 texture1DProj(sampler1D, vec4, float);" + "vec4 shadow1D(sampler1DShadow, vec3, float);" + "vec4 shadow2D(sampler2DShadow, vec3, float);" + "vec4 shadow1DProj(sampler1DShadow, vec4, float);" + "vec4 shadow2DProj(sampler2DShadow, vec4, float);" + + "\n"); + } + if (spvVersion.spv == 0 && profile == EEsProfile) { + stageBuiltins[EShLangFragment].append( + "vec4 texture2DLodEXT(sampler2D, vec2, float);" // GL_EXT_shader_texture_lod + "vec4 texture2DProjLodEXT(sampler2D, vec3, float);" // GL_EXT_shader_texture_lod + "vec4 texture2DProjLodEXT(sampler2D, vec4, float);" // GL_EXT_shader_texture_lod + "vec4 textureCubeLodEXT(samplerCube, vec3, float);" // GL_EXT_shader_texture_lod + + "\n"); + } + + // GL_EXT_shader_tile_image + if (spvVersion.vulkan > 0) { + stageBuiltins[EShLangFragment].append( + "lowp uint stencilAttachmentReadEXT();" + "lowp uint stencilAttachmentReadEXT(int);" + "highp float depthAttachmentReadEXT();" + "highp float depthAttachmentReadEXT(int);" + "\n"); + stageBuiltins[EShLangFragment].append( + "vec4 colorAttachmentReadEXT(attachmentEXT);" + "vec4 colorAttachmentReadEXT(attachmentEXT, int);" + "ivec4 colorAttachmentReadEXT(iattachmentEXT);" + "ivec4 colorAttachmentReadEXT(iattachmentEXT, int);" + "uvec4 colorAttachmentReadEXT(uattachmentEXT);" + "uvec4 colorAttachmentReadEXT(uattachmentEXT, int);" + "\n"); + } + + // GL_ARB_derivative_control + if (profile != EEsProfile && version >= 400) { + stageBuiltins[EShLangFragment].append(derivativeControls); + stageBuiltins[EShLangFragment].append("\n"); + } + + // GL_OES_shader_multisample_interpolation + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 150)) { // NV_gpu_shader5 + stageBuiltins[EShLangFragment].append( + "float interpolateAtCentroid(float);" + "vec2 interpolateAtCentroid(vec2);" + "vec3 interpolateAtCentroid(vec3);" + "vec4 interpolateAtCentroid(vec4);" + + "float interpolateAtSample(float, int);" + "vec2 interpolateAtSample(vec2, int);" + "vec3 interpolateAtSample(vec3, int);" + "vec4 interpolateAtSample(vec4, int);" + + "float interpolateAtOffset(float, vec2);" + "vec2 interpolateAtOffset(vec2, vec2);" + "vec3 interpolateAtOffset(vec3, vec2);" + "vec4 interpolateAtOffset(vec4, vec2);" + + "\n"); + } + + stageBuiltins[EShLangFragment].append( + "void beginInvocationInterlockARB(void);" + "void endInvocationInterlockARB(void);"); + + stageBuiltins[EShLangFragment].append( + "bool helperInvocationEXT();" + "\n"); + + // GL_AMD_shader_explicit_vertex_parameter + if (profile != EEsProfile && version >= 450) { + stageBuiltins[EShLangFragment].append( + "float interpolateAtVertexAMD(float, uint);" + "vec2 interpolateAtVertexAMD(vec2, uint);" + "vec3 interpolateAtVertexAMD(vec3, uint);" + "vec4 interpolateAtVertexAMD(vec4, uint);" + + "int interpolateAtVertexAMD(int, uint);" + "ivec2 interpolateAtVertexAMD(ivec2, uint);" + "ivec3 interpolateAtVertexAMD(ivec3, uint);" + "ivec4 interpolateAtVertexAMD(ivec4, uint);" + + "uint interpolateAtVertexAMD(uint, uint);" + "uvec2 interpolateAtVertexAMD(uvec2, uint);" + "uvec3 interpolateAtVertexAMD(uvec3, uint);" + "uvec4 interpolateAtVertexAMD(uvec4, uint);" + + "float16_t interpolateAtVertexAMD(float16_t, uint);" + "f16vec2 interpolateAtVertexAMD(f16vec2, uint);" + "f16vec3 interpolateAtVertexAMD(f16vec3, uint);" + "f16vec4 interpolateAtVertexAMD(f16vec4, uint);" + + "\n"); + } + + // GL_AMD_gpu_shader_half_float + if (profile != EEsProfile && version >= 450) { + stageBuiltins[EShLangFragment].append(derivativesAndControl16bits); + stageBuiltins[EShLangFragment].append("\n"); + + stageBuiltins[EShLangFragment].append( + "float16_t interpolateAtCentroid(float16_t);" + "f16vec2 interpolateAtCentroid(f16vec2);" + "f16vec3 interpolateAtCentroid(f16vec3);" + "f16vec4 interpolateAtCentroid(f16vec4);" + + "float16_t interpolateAtSample(float16_t, int);" + "f16vec2 interpolateAtSample(f16vec2, int);" + "f16vec3 interpolateAtSample(f16vec3, int);" + "f16vec4 interpolateAtSample(f16vec4, int);" + + "float16_t interpolateAtOffset(float16_t, f16vec2);" + "f16vec2 interpolateAtOffset(f16vec2, f16vec2);" + "f16vec3 interpolateAtOffset(f16vec3, f16vec2);" + "f16vec4 interpolateAtOffset(f16vec4, f16vec2);" + + "\n"); + } + + // GL_ARB_shader_clock& GL_EXT_shader_realtime_clock + if (profile != EEsProfile && version >= 450) { + commonBuiltins.append( + "uvec2 clock2x32ARB();" + "uint64_t clockARB();" + "uvec2 clockRealtime2x32EXT();" + "uint64_t clockRealtimeEXT();" + "\n"); + } + + // GL_AMD_shader_fragment_mask + if (profile != EEsProfile && version >= 450 && spvVersion.vulkan > 0) { + stageBuiltins[EShLangFragment].append( + "uint fragmentMaskFetchAMD(subpassInputMS);" + "uint fragmentMaskFetchAMD(isubpassInputMS);" + "uint fragmentMaskFetchAMD(usubpassInputMS);" + + "vec4 fragmentFetchAMD(subpassInputMS, uint);" + "ivec4 fragmentFetchAMD(isubpassInputMS, uint);" + "uvec4 fragmentFetchAMD(usubpassInputMS, uint);" + + "\n"); + } + + // Builtins for GL_NV_ray_tracing/GL_NV_ray_tracing_motion_blur/GL_EXT_ray_tracing/GL_EXT_ray_query/ + // GL_NV_shader_invocation_reorder/GL_KHR_ray_tracing_position_Fetch + if (profile != EEsProfile && version >= 460) { + commonBuiltins.append("void rayQueryInitializeEXT(rayQueryEXT, accelerationStructureEXT, uint, uint, vec3, float, vec3, float);" + "void rayQueryTerminateEXT(rayQueryEXT);" + "void rayQueryGenerateIntersectionEXT(rayQueryEXT, float);" + "void rayQueryConfirmIntersectionEXT(rayQueryEXT);" + "bool rayQueryProceedEXT(rayQueryEXT);" + "uint rayQueryGetIntersectionTypeEXT(rayQueryEXT, bool);" + "float rayQueryGetRayTMinEXT(rayQueryEXT);" + "uint rayQueryGetRayFlagsEXT(rayQueryEXT);" + "vec3 rayQueryGetWorldRayOriginEXT(rayQueryEXT);" + "vec3 rayQueryGetWorldRayDirectionEXT(rayQueryEXT);" + "float rayQueryGetIntersectionTEXT(rayQueryEXT, bool);" + "int rayQueryGetIntersectionInstanceCustomIndexEXT(rayQueryEXT, bool);" + "int rayQueryGetIntersectionInstanceIdEXT(rayQueryEXT, bool);" + "uint rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT(rayQueryEXT, bool);" + "int rayQueryGetIntersectionGeometryIndexEXT(rayQueryEXT, bool);" + "int rayQueryGetIntersectionPrimitiveIndexEXT(rayQueryEXT, bool);" + "vec2 rayQueryGetIntersectionBarycentricsEXT(rayQueryEXT, bool);" + "bool rayQueryGetIntersectionFrontFaceEXT(rayQueryEXT, bool);" + "bool rayQueryGetIntersectionCandidateAABBOpaqueEXT(rayQueryEXT);" + "vec3 rayQueryGetIntersectionObjectRayDirectionEXT(rayQueryEXT, bool);" + "vec3 rayQueryGetIntersectionObjectRayOriginEXT(rayQueryEXT, bool);" + "mat4x3 rayQueryGetIntersectionObjectToWorldEXT(rayQueryEXT, bool);" + "mat4x3 rayQueryGetIntersectionWorldToObjectEXT(rayQueryEXT, bool);" + "void rayQueryGetIntersectionTriangleVertexPositionsEXT(rayQueryEXT, bool, out vec3[3]);" + "int rayQueryGetIntersectionClusterIdNV(rayQueryEXT, bool);" + "vec3 rayQueryGetIntersectionSpherePositionNV(rayQueryEXT, bool);" + "float rayQueryGetIntersectionSphereRadiusNV(rayQueryEXT, bool);" + "float rayQueryGetIntersectionLSSHitValueNV(rayQueryEXT, bool);" + "void rayQueryGetIntersectionLSSPositionsNV(rayQueryEXT, bool, out vec3[2]);" + "void rayQueryGetIntersectionLSSRadiiNV(rayQueryEXT, bool, out float[2]);" + "bool rayQueryIsSphereHitNV(rayQueryEXT, bool);" + "bool rayQueryIsLSSHitNV(rayQueryEXT, bool);" + "\n"); + + stageBuiltins[EShLangRayGen].append( + "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void traceRayMotionNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void executeCallableNV(uint, int);" + "void executeCallableEXT(uint, int);" + "void hitObjectTraceRayNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectTraceRayMotionNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordHitNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectRecordHitMotionNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordHitWithIndexNV(hitObjectNV, accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectRecordHitWithIndexMotionNV(hitObjectNV, accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordMissNV(hitObjectNV,uint,vec3,float,vec3,float);" + "void hitObjectRecordMissMotionNV(hitObjectNV,uint,vec3,float,vec3,float,float);" + "void hitObjectRecordEmptyNV(hitObjectNV);" + "void hitObjectExecuteShaderNV(hitObjectNV,int);" + "bool hitObjectIsEmptyNV(hitObjectNV);" + "bool hitObjectIsMissNV(hitObjectNV);" + "bool hitObjectIsHitNV(hitObjectNV);" + "float hitObjectGetRayTMinNV(hitObjectNV);" + "float hitObjectGetRayTMaxNV(hitObjectNV);" + "vec3 hitObjectGetWorldRayOriginNV(hitObjectNV);" + "vec3 hitObjectGetWorldRayDirectionNV(hitObjectNV);" + "vec3 hitObjectGetObjectRayOriginNV(hitObjectNV);" + "vec3 hitObjectGetObjectRayDirectionNV(hitObjectNV);" + "mat4x3 hitObjectGetWorldToObjectNV(hitObjectNV);" + "mat4x3 hitObjectGetObjectToWorldNV(hitObjectNV);" + "int hitObjectGetInstanceCustomIndexNV(hitObjectNV);" + "int hitObjectGetInstanceIdNV(hitObjectNV);" + "int hitObjectGetGeometryIndexNV(hitObjectNV);" + "int hitObjectGetPrimitiveIndexNV(hitObjectNV);" + "uint hitObjectGetHitKindNV(hitObjectNV);" + "void hitObjectGetAttributesNV(hitObjectNV,int);" + "float hitObjectGetCurrentTimeNV(hitObjectNV);" + "uint hitObjectGetShaderBindingTableRecordIndexNV(hitObjectNV);" + "uvec2 hitObjectGetShaderRecordBufferHandleNV(hitObjectNV);" + "int hitObjectGetClusterIdNV(hitObjectNV);" + "void reorderThreadNV(uint, uint);" + "void reorderThreadNV(hitObjectNV);" + "void reorderThreadNV(hitObjectNV, uint, uint);" + "vec3 fetchMicroTriangleVertexPositionNV(accelerationStructureEXT, int, int, int, ivec2);" + "vec2 fetchMicroTriangleVertexBarycentricNV(accelerationStructureEXT, int, int, int, ivec2);" + "vec3 hitObjectGetSpherePositionNV(hitObjectNV);" + "float hitObjectGetSphereRadiusNV(hitObjectNV);" + "void hitObjectGetLSSPositionsNV(hitObjectNV, out vec3[2]);" + "void hitObjectGetLSSRadiiNV(hitObjectNV, out float[2]);" + "bool hitObjectIsSphereHitNV(hitObjectNV);" + "bool hitObjectIsLSSHitNV(hitObjectNV);" + "void hitObjectTraceRayEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectTraceRayMotionEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordMissEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float);" + "void hitObjectRecordMissMotionEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float,float);" + "void hitObjectRecordEmptyEXT(hitObjectEXT);" + "void hitObjectExecuteShaderEXT(hitObjectEXT,int);" + "bool hitObjectIsEmptyEXT(hitObjectEXT);" + "bool hitObjectIsMissEXT(hitObjectEXT);" + "bool hitObjectIsHitEXT(hitObjectEXT);" + "float hitObjectGetRayTMinEXT(hitObjectEXT);" + "float hitObjectGetRayTMaxEXT(hitObjectEXT);" + "uint hitObjectGetRayFlagsEXT(hitObjectEXT);" + "vec3 hitObjectGetWorldRayOriginEXT(hitObjectEXT);" + "vec3 hitObjectGetWorldRayDirectionEXT(hitObjectEXT);" + "vec3 hitObjectGetObjectRayOriginEXT(hitObjectEXT);" + "vec3 hitObjectGetObjectRayDirectionEXT(hitObjectEXT);" + "mat4x3 hitObjectGetWorldToObjectEXT(hitObjectEXT);" + "mat4x3 hitObjectGetObjectToWorldEXT(hitObjectEXT);" + "int hitObjectGetInstanceCustomIndexEXT(hitObjectEXT);" + "int hitObjectGetInstanceIdEXT(hitObjectEXT);" + "int hitObjectGetGeometryIndexEXT(hitObjectEXT);" + "int hitObjectGetPrimitiveIndexEXT(hitObjectEXT);" + "uint hitObjectGetHitKindEXT(hitObjectEXT);" + "void hitObjectGetAttributesEXT(hitObjectEXT,int);" + "float hitObjectGetCurrentTimeEXT(hitObjectEXT);" + "uint hitObjectGetShaderBindingTableRecordIndexEXT(hitObjectEXT);" + "uvec2 hitObjectGetShaderRecordBufferHandleEXT(hitObjectEXT);" + "void hitObjectSetShaderBindingTableRecordIndexEXT(hitObjectEXT, uint);" + "void hitObjectReorderExecuteEXT(hitObjectEXT,int);" + "void hitObjectReorderExecuteEXT(hitObjectEXT,uint,uint,int);" + "void hitObjectTraceReorderExecuteEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectTraceReorderExecuteEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,uint,uint,int);" + "void hitObjectTraceMotionReorderExecuteEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectTraceMotionReorderExecuteEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,uint,uint,int);" + "void hitObjectRecordFromQueryEXT(hitObjectEXT, rayQueryEXT, uint, int);" + "void hitObjectGetIntersectionTriangleVertexPositionsEXT(hitObjectEXT, out vec3[3]);" + "void reorderThreadEXT(uint, uint);" + "void reorderThreadEXT(hitObjectEXT);" + "void reorderThreadEXT(hitObjectEXT, uint, uint);" + "\n"); + stageBuiltins[EShLangIntersect].append( + "bool reportIntersectionNV(float, uint);" + "bool reportIntersectionEXT(float, uint);" + "\n"); + stageBuiltins[EShLangAnyHit].append( + "void ignoreIntersectionNV();" + "void terminateRayNV();" + "\n"); + stageBuiltins[EShLangClosestHit].append( + "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void traceRayMotionNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void executeCallableNV(uint, int);" + "void executeCallableEXT(uint, int);" + "void hitObjectTraceRayNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectTraceRayMotionNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordHitNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectRecordHitMotionNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordHitWithIndexNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectRecordHitWithIndexMotionNV(hitObjectNV, accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordMissNV(hitObjectNV, uint, vec3, float, vec3, float);" + "void hitObjectRecordMissMotionNV(hitObjectNV,uint,vec3,float,vec3,float,float);" + "void hitObjectRecordEmptyNV(hitObjectNV);" + "void hitObjectExecuteShaderNV(hitObjectNV, int);" + "bool hitObjectIsEmptyNV(hitObjectNV);" + "bool hitObjectIsMissNV(hitObjectNV);" + "bool hitObjectIsHitNV(hitObjectNV);" + "float hitObjectGetRayTMinNV(hitObjectNV);" + "float hitObjectGetRayTMaxNV(hitObjectNV);" + "vec3 hitObjectGetWorldRayOriginNV(hitObjectNV);" + "vec3 hitObjectGetWorldRayDirectionNV(hitObjectNV);" + "vec3 hitObjectGetObjectRayOriginNV(hitObjectNV);" + "vec3 hitObjectGetObjectRayDirectionNV(hitObjectNV);" + "mat4x3 hitObjectGetWorldToObjectNV(hitObjectNV);" + "mat4x3 hitObjectGetObjectToWorldNV(hitObjectNV);" + "int hitObjectGetInstanceCustomIndexNV(hitObjectNV);" + "int hitObjectGetInstanceIdNV(hitObjectNV);" + "int hitObjectGetGeometryIndexNV(hitObjectNV);" + "int hitObjectGetPrimitiveIndexNV(hitObjectNV);" + "uint hitObjectGetHitKindNV(hitObjectNV);" + "void hitObjectGetAttributesNV(hitObjectNV,int);" + "float hitObjectGetCurrentTimeNV(hitObjectNV);" + "uint hitObjectGetShaderBindingTableRecordIndexNV(hitObjectNV);" + "uvec2 hitObjectGetShaderRecordBufferHandleNV(hitObjectNV);" + "int hitObjectGetClusterIdNV(hitObjectNV);" + "vec3 hitObjectGetSpherePositionNV(hitObjectNV);" + "float hitObjectGetSphereRadiusNV(hitObjectNV);" + "void hitObjectGetLSSPositionsNV(hitObjectNV, out vec3[2]);" + "void hitObjectGetLSSRadiiNV(hitObjectNV, out float[2]);" + "bool hitObjectIsSphereHitNV(hitObjectNV);" + "bool hitObjectIsLSSHitNV(hitObjectNV);" + "void hitObjectTraceRayEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectTraceRayMotionEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordMissEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float);" + "void hitObjectRecordMissMotionEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float,float);" + "void hitObjectRecordEmptyEXT(hitObjectEXT);" + "void hitObjectExecuteShaderEXT(hitObjectEXT,int);" + "bool hitObjectIsEmptyEXT(hitObjectEXT);" + "bool hitObjectIsMissEXT(hitObjectEXT);" + "bool hitObjectIsHitEXT(hitObjectEXT);" + "float hitObjectGetRayTMinEXT(hitObjectEXT);" + "float hitObjectGetRayTMaxEXT(hitObjectEXT);" + "uint hitObjectGetRayFlagsEXT(hitObjectEXT);" + "vec3 hitObjectGetWorldRayOriginEXT(hitObjectEXT);" + "vec3 hitObjectGetWorldRayDirectionEXT(hitObjectEXT);" + "vec3 hitObjectGetObjectRayOriginEXT(hitObjectEXT);" + "vec3 hitObjectGetObjectRayDirectionEXT(hitObjectEXT);" + "mat4x3 hitObjectGetWorldToObjectEXT(hitObjectEXT);" + "mat4x3 hitObjectGetObjectToWorldEXT(hitObjectEXT);" + "int hitObjectGetInstanceCustomIndexEXT(hitObjectEXT);" + "int hitObjectGetInstanceIdEXT(hitObjectEXT);" + "int hitObjectGetGeometryIndexEXT(hitObjectEXT);" + "int hitObjectGetPrimitiveIndexEXT(hitObjectEXT);" + "uint hitObjectGetHitKindEXT(hitObjectEXT);" + "void hitObjectGetAttributesEXT(hitObjectEXT,int);" + "float hitObjectGetCurrentTimeEXT(hitObjectEXT);" + "uint hitObjectGetShaderBindingTableRecordIndexEXT(hitObjectEXT);" + "uvec2 hitObjectGetShaderRecordBufferHandleEXT(hitObjectEXT);" + "void hitObjectSetShaderBindingTableRecordIndexEXT(hitObjectEXT, uint);" + "void hitObjectRecordFromQueryEXT(hitObjectEXT, rayQueryEXT,uint, int);" + "void hitObjectGetIntersectionTriangleVertexPositionsEXT(hitObjectEXT, out vec3[3]);" + "\n"); + stageBuiltins[EShLangMiss].append( + "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void traceRayMotionNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void executeCallableNV(uint, int);" + "void executeCallableEXT(uint, int);" + "void hitObjectTraceRayNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectTraceRayMotionNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordHitNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectRecordHitMotionNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordHitWithIndexNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectRecordHitWithIndexMotionNV(hitObjectNV, accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordMissNV(hitObjectNV, uint, vec3, float, vec3, float);" + "void hitObjectRecordMissMotionNV(hitObjectNV,uint,vec3,float,vec3,float,float);" + "void hitObjectRecordEmptyNV(hitObjectNV);" + "void hitObjectExecuteShaderNV(hitObjectNV, int);" + "bool hitObjectIsEmptyNV(hitObjectNV);" + "bool hitObjectIsMissNV(hitObjectNV);" + "bool hitObjectIsHitNV(hitObjectNV);" + "float hitObjectGetRayTMinNV(hitObjectNV);" + "float hitObjectGetRayTMaxNV(hitObjectNV);" + "vec3 hitObjectGetWorldRayOriginNV(hitObjectNV);" + "vec3 hitObjectGetWorldRayDirectionNV(hitObjectNV);" + "vec3 hitObjectGetObjectRayOriginNV(hitObjectNV);" + "vec3 hitObjectGetObjectRayDirectionNV(hitObjectNV);" + "mat4x3 hitObjectGetWorldToObjectNV(hitObjectNV);" + "mat4x3 hitObjectGetObjectToWorldNV(hitObjectNV);" + "int hitObjectGetInstanceCustomIndexNV(hitObjectNV);" + "int hitObjectGetInstanceIdNV(hitObjectNV);" + "int hitObjectGetGeometryIndexNV(hitObjectNV);" + "int hitObjectGetPrimitiveIndexNV(hitObjectNV);" + "uint hitObjectGetHitKindNV(hitObjectNV);" + "void hitObjectGetAttributesNV(hitObjectNV,int);" + "float hitObjectGetCurrentTimeNV(hitObjectNV);" + "uint hitObjectGetShaderBindingTableRecordIndexNV(hitObjectNV);" + "uvec2 hitObjectGetShaderRecordBufferHandleNV(hitObjectNV);" + "int hitObjectGetClusterIdNV(hitObjectNV);" + "vec3 hitObjectGetSpherePositionNV(hitObjectNV);" + "float hitObjectGetSphereRadiusNV(hitObjectNV);" + "void hitObjectGetLSSPositionsNV(hitObjectNV, out vec3[2]);" + "void hitObjectGetLSSRadiiNV(hitObjectNV, out float[2]);" + "bool hitObjectIsSphereHitNV(hitObjectNV);" + "bool hitObjectIsLSSHitNV(hitObjectNV);" + "void hitObjectTraceRayEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectTraceRayMotionEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordMissEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float);" + "void hitObjectRecordMissMotionEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float,float);" + "void hitObjectRecordEmptyEXT(hitObjectEXT);" + "void hitObjectExecuteShaderEXT(hitObjectEXT,int);" + "bool hitObjectIsEmptyEXT(hitObjectEXT);" + "bool hitObjectIsMissEXT(hitObjectEXT);" + "bool hitObjectIsHitEXT(hitObjectEXT);" + "float hitObjectGetRayTMinEXT(hitObjectEXT);" + "float hitObjectGetRayTMaxEXT(hitObjectEXT);" + "uint hitObjectGetRayFlagsEXT(hitObjectEXT);" + "vec3 hitObjectGetWorldRayOriginEXT(hitObjectEXT);" + "vec3 hitObjectGetWorldRayDirectionEXT(hitObjectEXT);" + "vec3 hitObjectGetObjectRayOriginEXT(hitObjectEXT);" + "vec3 hitObjectGetObjectRayDirectionEXT(hitObjectEXT);" + "mat4x3 hitObjectGetWorldToObjectEXT(hitObjectEXT);" + "mat4x3 hitObjectGetObjectToWorldEXT(hitObjectEXT);" + "int hitObjectGetInstanceCustomIndexEXT(hitObjectEXT);" + "int hitObjectGetInstanceIdEXT(hitObjectEXT);" + "int hitObjectGetGeometryIndexEXT(hitObjectEXT);" + "int hitObjectGetPrimitiveIndexEXT(hitObjectEXT);" + "uint hitObjectGetHitKindEXT(hitObjectEXT);" + "void hitObjectGetAttributesEXT(hitObjectEXT,int);" + "float hitObjectGetCurrentTimeEXT(hitObjectEXT);" + "uint hitObjectGetShaderBindingTableRecordIndexEXT(hitObjectEXT);" + "uvec2 hitObjectGetShaderRecordBufferHandleEXT(hitObjectEXT);" + "void hitObjectSetShaderBindingTableRecordIndexEXT(hitObjectEXT, uint);" + "void hitObjectRecordFromQueryEXT(hitObjectEXT, rayQueryEXT, uint, int);" + "void hitObjectGetIntersectionTriangleVertexPositionsEXT(hitObjectEXT, out vec3[3]);" + "\n"); + stageBuiltins[EShLangCallable].append( + "void executeCallableNV(uint, int);" + "void executeCallableEXT(uint, int);" + "\n"); + } + + //E_SPV_NV_compute_shader_derivatives + if ((profile == EEsProfile && version >= 320) || (profile != EEsProfile && version >= 450)) { + stageBuiltins[EShLangCompute].append(derivativeControls); + stageBuiltins[EShLangCompute].append("\n"); + } + if (profile != EEsProfile && version >= 450) { + stageBuiltins[EShLangCompute].append(derivativesAndControl16bits); + stageBuiltins[EShLangCompute].append(derivativesAndControl64bits); + stageBuiltins[EShLangCompute].append("\n"); + } + + // Builtins for GL_NV_mesh_shader + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + stageBuiltins[EShLangMesh].append( + "void writePackedPrimitiveIndices4x8NV(uint, uint);" + "\n"); + } + // Builtins for GL_EXT_mesh_shader + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + // Builtins for GL_EXT_mesh_shader + stageBuiltins[EShLangTask].append( + "void EmitMeshTasksEXT(uint, uint, uint);" + "\n"); + + stageBuiltins[EShLangMesh].append( + "void SetMeshOutputsEXT(uint, uint);" + "\n"); + } + // Builtins for GL_NV_displacement_micromap + if ((profile != EEsProfile && version >= 460) || (profile == EEsProfile && version >= 320)) { + stageBuiltins[EShLangMesh].append( + "vec3 fetchMicroTriangleVertexPositionNV(accelerationStructureEXT, int, int, int, ivec2);" + "vec2 fetchMicroTriangleVertexBarycentricNV(accelerationStructureEXT, int, int, int, ivec2);" + "\n"); + + stageBuiltins[EShLangCompute].append( + "vec3 fetchMicroTriangleVertexPositionNV(accelerationStructureEXT, int, int, int, ivec2);" + "vec2 fetchMicroTriangleVertexBarycentricNV(accelerationStructureEXT, int, int, int, ivec2);" + "\n"); + + } + + + //============================================================================ + // + // Standard Uniforms + // + //============================================================================ + + // + // Depth range in window coordinates, p. 33 + // + if (spvVersion.spv == 0) { + commonBuiltins.append( + "struct gl_DepthRangeParameters {" + ); + if (profile == EEsProfile) { + commonBuiltins.append( + "highp float near;" // n + "highp float far;" // f + "highp float diff;" // f - n + ); + } else { + commonBuiltins.append( + "float near;" // n + "float far;" // f + "float diff;" // f - n + ); + } + + commonBuiltins.append( + "};" + "uniform gl_DepthRangeParameters gl_DepthRange;" + "\n"); + } + + if (spvVersion.spv == 0 && IncludeLegacy(version, profile, spvVersion)) { + // + // Matrix state. p. 31, 32, 37, 39, 40. + // + commonBuiltins.append( + "uniform mat4 gl_ModelViewMatrix;" + "uniform mat4 gl_ProjectionMatrix;" + "uniform mat4 gl_ModelViewProjectionMatrix;" + + // + // Derived matrix state that provides inverse and transposed versions + // of the matrices above. + // + "uniform mat3 gl_NormalMatrix;" + + "uniform mat4 gl_ModelViewMatrixInverse;" + "uniform mat4 gl_ProjectionMatrixInverse;" + "uniform mat4 gl_ModelViewProjectionMatrixInverse;" + + "uniform mat4 gl_ModelViewMatrixTranspose;" + "uniform mat4 gl_ProjectionMatrixTranspose;" + "uniform mat4 gl_ModelViewProjectionMatrixTranspose;" + + "uniform mat4 gl_ModelViewMatrixInverseTranspose;" + "uniform mat4 gl_ProjectionMatrixInverseTranspose;" + "uniform mat4 gl_ModelViewProjectionMatrixInverseTranspose;" + + // + // Normal scaling p. 39. + // + "uniform float gl_NormalScale;" + + // + // Point Size, p. 66, 67. + // + "struct gl_PointParameters {" + "float size;" + "float sizeMin;" + "float sizeMax;" + "float fadeThresholdSize;" + "float distanceConstantAttenuation;" + "float distanceLinearAttenuation;" + "float distanceQuadraticAttenuation;" + "};" + + "uniform gl_PointParameters gl_Point;" + + // + // Material State p. 50, 55. + // + "struct gl_MaterialParameters {" + "vec4 emission;" // Ecm + "vec4 ambient;" // Acm + "vec4 diffuse;" // Dcm + "vec4 specular;" // Scm + "float shininess;" // Srm + "};" + "uniform gl_MaterialParameters gl_FrontMaterial;" + "uniform gl_MaterialParameters gl_BackMaterial;" + + // + // Light State p 50, 53, 55. + // + "struct gl_LightSourceParameters {" + "vec4 ambient;" // Acli + "vec4 diffuse;" // Dcli + "vec4 specular;" // Scli + "vec4 position;" // Ppli + "vec4 halfVector;" // Derived: Hi + "vec3 spotDirection;" // Sdli + "float spotExponent;" // Srli + "float spotCutoff;" // Crli + // (range: [0.0,90.0], 180.0) + "float spotCosCutoff;" // Derived: cos(Crli) + // (range: [1.0,0.0],-1.0) + "float constantAttenuation;" // K0 + "float linearAttenuation;" // K1 + "float quadraticAttenuation;"// K2 + "};" + + "struct gl_LightModelParameters {" + "vec4 ambient;" // Acs + "};" + + "uniform gl_LightModelParameters gl_LightModel;" + + // + // Derived state from products of light and material. + // + "struct gl_LightModelProducts {" + "vec4 sceneColor;" // Derived. Ecm + Acm * Acs + "};" + + "uniform gl_LightModelProducts gl_FrontLightModelProduct;" + "uniform gl_LightModelProducts gl_BackLightModelProduct;" + + "struct gl_LightProducts {" + "vec4 ambient;" // Acm * Acli + "vec4 diffuse;" // Dcm * Dcli + "vec4 specular;" // Scm * Scli + "};" + + // + // Fog p. 161 + // + "struct gl_FogParameters {" + "vec4 color;" + "float density;" + "float start;" + "float end;" + "float scale;" // 1 / (gl_FogEnd - gl_FogStart) + "};" + + "uniform gl_FogParameters gl_Fog;" + + "\n"); + } + + //============================================================================ + // + // Define the interface to the compute shader. + // + //============================================================================ + + if ((profile != EEsProfile && version >= 420) || + (profile == EEsProfile && version >= 310)) { + stageBuiltins[EShLangCompute].append( + "in highp uvec3 gl_NumWorkGroups;" + "const highp uvec3 gl_WorkGroupSize = uvec3(1,1,1);" + + "in highp uvec3 gl_WorkGroupID;" + "in highp uvec3 gl_LocalInvocationID;" + + "in highp uvec3 gl_GlobalInvocationID;" + "in highp uint gl_LocalInvocationIndex;" + + "\n"); + } + + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + stageBuiltins[EShLangCompute].append( + "in highp int gl_DeviceIndex;" // GL_EXT_device_group + "\n"); + } + + // GL_QCOM_tile_shading + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 460)) { + stageBuiltins[EShLangCompute].append( + "in highp uvec2 gl_TileOffsetQCOM;" // GL_QCOM_tile_shading + "in highp uvec3 gl_TileDimensionQCOM;" // GL_QCOM_tile_shading + "in highp uvec2 gl_TileApronSizeQCOM;" // GL_QCOM_tile_shading + "\n"); + } + + //============================================================================ + // + // Define the interface to the mesh/task shader. + // + //============================================================================ + + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + // per-vertex attributes + stageBuiltins[EShLangMesh].append( + "out gl_MeshPerVertexNV {" + "vec4 gl_Position;" + "float gl_PointSize;" + "float gl_ClipDistance[];" + "float gl_CullDistance[];" + "perviewNV vec4 gl_PositionPerViewNV[];" + "perviewNV float gl_ClipDistancePerViewNV[][];" + "perviewNV float gl_CullDistancePerViewNV[][];" + "} gl_MeshVerticesNV[];" + ); + + // per-primitive attributes + stageBuiltins[EShLangMesh].append( + "perprimitiveNV out gl_MeshPerPrimitiveNV {" + "int gl_PrimitiveID;" + "int gl_Layer;" + "int gl_ViewportIndex;" + "int gl_ViewportMask[];" + "perviewNV int gl_LayerPerViewNV[];" + "perviewNV int gl_ViewportMaskPerViewNV[][];" + "} gl_MeshPrimitivesNV[];" + ); + + stageBuiltins[EShLangMesh].append( + "out uint gl_PrimitiveCountNV;" + "out uint gl_PrimitiveIndicesNV[];" + + "in uint gl_MeshViewCountNV;" + "in uint gl_MeshViewIndicesNV[4];" + + "const highp uvec3 gl_WorkGroupSize = uvec3(1,1,1);" + + "in highp uvec3 gl_WorkGroupID;" + "in highp uvec3 gl_LocalInvocationID;" + + "in highp uvec3 gl_GlobalInvocationID;" + "in highp uint gl_LocalInvocationIndex;" + "\n"); + + // GL_EXT_mesh_shader + stageBuiltins[EShLangMesh].append( + "out uint gl_PrimitivePointIndicesEXT[];" + "out uvec2 gl_PrimitiveLineIndicesEXT[];" + "out uvec3 gl_PrimitiveTriangleIndicesEXT[];" + "in highp uvec3 gl_NumWorkGroups;" + "\n"); + + // per-vertex attributes + stageBuiltins[EShLangMesh].append( + "out gl_MeshPerVertexEXT {" + "vec4 gl_Position;" + "float gl_PointSize;" + "float gl_ClipDistance[];" + "float gl_CullDistance[];" + "} gl_MeshVerticesEXT[];" + ); + + // per-primitive attributes + stageBuiltins[EShLangMesh].append( + "perprimitiveEXT out gl_MeshPerPrimitiveEXT {" + "int gl_PrimitiveID;" + "int gl_Layer;" + "int gl_ViewportIndex;" + "bool gl_CullPrimitiveEXT;" + "int gl_PrimitiveShadingRateEXT;" + "} gl_MeshPrimitivesEXT[];" + ); + + stageBuiltins[EShLangTask].append( + "out uint gl_TaskCountNV;" + + "const highp uvec3 gl_WorkGroupSize = uvec3(1,1,1);" + + "in highp uvec3 gl_WorkGroupID;" + "in highp uvec3 gl_LocalInvocationID;" + + "in highp uvec3 gl_GlobalInvocationID;" + "in highp uint gl_LocalInvocationIndex;" + + "in uint gl_MeshViewCountNV;" + "in uint gl_MeshViewIndicesNV[4];" + "in highp uvec3 gl_NumWorkGroups;" + "\n"); + } + + if (profile != EEsProfile && version >= 450) { + stageBuiltins[EShLangMesh].append( + "in highp int gl_DeviceIndex;" // GL_EXT_device_group + "in int gl_DrawIDARB;" // GL_ARB_shader_draw_parameters + "in int gl_ViewIndex;" // GL_EXT_multiview + "\n"); + + stageBuiltins[EShLangTask].append( + "in highp int gl_DeviceIndex;" // GL_EXT_device_group + "in int gl_DrawIDARB;" // GL_ARB_shader_draw_parameters + "\n"); + + if (version >= 460) { + stageBuiltins[EShLangMesh].append( + "in int gl_DrawID;" + "\n"); + + stageBuiltins[EShLangTask].append( + "in int gl_DrawID;" + "\n"); + } + } + + //============================================================================ + // + // Define the interface to the vertex shader. + // + //============================================================================ + + if (profile != EEsProfile) { + if (version < 130) { + stageBuiltins[EShLangVertex].append( + "attribute vec4 gl_Color;" + "attribute vec4 gl_SecondaryColor;" + "attribute vec3 gl_Normal;" + "attribute vec4 gl_Vertex;" + "attribute vec4 gl_MultiTexCoord0;" + "attribute vec4 gl_MultiTexCoord1;" + "attribute vec4 gl_MultiTexCoord2;" + "attribute vec4 gl_MultiTexCoord3;" + "attribute vec4 gl_MultiTexCoord4;" + "attribute vec4 gl_MultiTexCoord5;" + "attribute vec4 gl_MultiTexCoord6;" + "attribute vec4 gl_MultiTexCoord7;" + "attribute float gl_FogCoord;" + "\n"); + } else if (IncludeLegacy(version, profile, spvVersion)) { + stageBuiltins[EShLangVertex].append( + "in vec4 gl_Color;" + "in vec4 gl_SecondaryColor;" + "in vec3 gl_Normal;" + "in vec4 gl_Vertex;" + "in vec4 gl_MultiTexCoord0;" + "in vec4 gl_MultiTexCoord1;" + "in vec4 gl_MultiTexCoord2;" + "in vec4 gl_MultiTexCoord3;" + "in vec4 gl_MultiTexCoord4;" + "in vec4 gl_MultiTexCoord5;" + "in vec4 gl_MultiTexCoord6;" + "in vec4 gl_MultiTexCoord7;" + "in float gl_FogCoord;" + "\n"); + } + + if (version < 150) { + if (version < 130) { + stageBuiltins[EShLangVertex].append( + " vec4 gl_ClipVertex;" // needs qualifier fixed later + "varying vec4 gl_FrontColor;" + "varying vec4 gl_BackColor;" + "varying vec4 gl_FrontSecondaryColor;" + "varying vec4 gl_BackSecondaryColor;" + "varying vec4 gl_TexCoord[];" + "varying float gl_FogFragCoord;" + "\n"); + } else if (IncludeLegacy(version, profile, spvVersion)) { + stageBuiltins[EShLangVertex].append( + " vec4 gl_ClipVertex;" // needs qualifier fixed later + "out vec4 gl_FrontColor;" + "out vec4 gl_BackColor;" + "out vec4 gl_FrontSecondaryColor;" + "out vec4 gl_BackSecondaryColor;" + "out vec4 gl_TexCoord[];" + "out float gl_FogFragCoord;" + "\n"); + } + stageBuiltins[EShLangVertex].append( + "vec4 gl_Position;" // needs qualifier fixed later + "float gl_PointSize;" // needs qualifier fixed later + ); + + if (version == 130 || version == 140) + stageBuiltins[EShLangVertex].append( + "out float gl_ClipDistance[];" + ); + } else { + // version >= 150 + stageBuiltins[EShLangVertex].append( + "out gl_PerVertex {" + "vec4 gl_Position;" // needs qualifier fixed later + "float gl_PointSize;" // needs qualifier fixed later + "float gl_ClipDistance[];" + ); + if (IncludeLegacy(version, profile, spvVersion)) + stageBuiltins[EShLangVertex].append( + "vec4 gl_ClipVertex;" // needs qualifier fixed later + "vec4 gl_FrontColor;" + "vec4 gl_BackColor;" + "vec4 gl_FrontSecondaryColor;" + "vec4 gl_BackSecondaryColor;" + "vec4 gl_TexCoord[];" + "float gl_FogFragCoord;" + ); + if (version >= 450) + stageBuiltins[EShLangVertex].append( + "float gl_CullDistance[];" + ); + stageBuiltins[EShLangVertex].append( + "};" + "\n"); + } + if (version >= 130 && spvVersion.vulkan == 0) + stageBuiltins[EShLangVertex].append( + "int gl_VertexID;" // needs qualifier fixed later + ); + if (spvVersion.vulkan == 0) + stageBuiltins[EShLangVertex].append( + "int gl_InstanceID;" // needs qualifier fixed later + ); + if (spvVersion.vulkan > 0 && version >= 140) + stageBuiltins[EShLangVertex].append( + "in int gl_VertexIndex;" + "in int gl_InstanceIndex;" + ); + + if (spvVersion.vulkan > 0 && version >= 140 && spvVersion.vulkanRelaxed) + stageBuiltins[EShLangVertex].append( + "in int gl_VertexID;" // declare with 'in' qualifier + "in int gl_InstanceID;" + ); + + if (version >= 440) { + stageBuiltins[EShLangVertex].append( + "in int gl_BaseVertexARB;" + "in int gl_BaseInstanceARB;" + "in int gl_DrawIDARB;" + ); + } + if (version >= 410) { + stageBuiltins[EShLangVertex].append( + "out int gl_ViewportIndex;" + "out int gl_Layer;" + ); + } + if (version >= 460) { + stageBuiltins[EShLangVertex].append( + "in int gl_BaseVertex;" + "in int gl_BaseInstance;" + "in int gl_DrawID;" + ); + } + + if (version >= 430) + stageBuiltins[EShLangVertex].append( + "out int gl_ViewportMask[];" // GL_NV_viewport_array2 + ); + + if (version >= 450) + stageBuiltins[EShLangVertex].append( + "out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering + "out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering + "out vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes + "out int gl_ViewportMaskPerViewNV[];" // GL_NVX_multiview_per_view_attributes + ); + } else { + // ES profile + if (version == 100) { + stageBuiltins[EShLangVertex].append( + "highp vec4 gl_Position;" // needs qualifier fixed later + "mediump float gl_PointSize;" // needs qualifier fixed later + "highp int gl_InstanceID;" // needs qualifier fixed later + ); + } else { + if (spvVersion.vulkan == 0 || spvVersion.vulkanRelaxed) + stageBuiltins[EShLangVertex].append( + "in highp int gl_VertexID;" // needs qualifier fixed later + "in highp int gl_InstanceID;" // needs qualifier fixed later + ); + if (spvVersion.vulkan > 0) + stageBuiltins[EShLangVertex].append( + "in highp int gl_VertexIndex;" + "in highp int gl_InstanceIndex;" + ); + if (version < 310) + stageBuiltins[EShLangVertex].append( + "highp vec4 gl_Position;" // needs qualifier fixed later + "highp float gl_PointSize;" // needs qualifier fixed later + ); + else + stageBuiltins[EShLangVertex].append( + "out gl_PerVertex {" + "highp vec4 gl_Position;" // needs qualifier fixed later + "highp float gl_PointSize;" // needs qualifier fixed later + "};" + ); + } + } + + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + stageBuiltins[EShLangVertex].append( + "in highp int gl_DeviceIndex;" // GL_EXT_device_group + "in highp int gl_ViewIndex;" // GL_EXT_multiview + "\n"); + } + + if (version >= 300 /* both ES and non-ES */) { + stageBuiltins[EShLangVertex].append( + "in highp uint gl_ViewID_OVR;" // GL_OVR_multiview, GL_OVR_multiview2 + "\n"); + } + + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) { + stageBuiltins[EShLangVertex].append( + "out highp int gl_PrimitiveShadingRateEXT;" // GL_EXT_fragment_shading_rate + "\n"); + } + + //============================================================================ + // + // Define the interface to the geometry shader. + // + //============================================================================ + + if (profile == ECoreProfile || profile == ECompatibilityProfile) { + stageBuiltins[EShLangGeometry].append( + "in gl_PerVertex {" + "vec4 gl_Position;" + "float gl_PointSize;" + "float gl_ClipDistance[];" + ); + if (profile == ECompatibilityProfile) + stageBuiltins[EShLangGeometry].append( + "vec4 gl_ClipVertex;" + "vec4 gl_FrontColor;" + "vec4 gl_BackColor;" + "vec4 gl_FrontSecondaryColor;" + "vec4 gl_BackSecondaryColor;" + "vec4 gl_TexCoord[];" + "float gl_FogFragCoord;" + ); + if (version >= 450) + stageBuiltins[EShLangGeometry].append( + "float gl_CullDistance[];" + "vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering + "vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes + ); + stageBuiltins[EShLangGeometry].append( + "} gl_in[];" + + "in int gl_PrimitiveIDIn;" + "out gl_PerVertex {" + "vec4 gl_Position;" + "float gl_PointSize;" + "float gl_ClipDistance[];" + "\n"); + if (profile == ECompatibilityProfile && version >= 400) + stageBuiltins[EShLangGeometry].append( + "vec4 gl_ClipVertex;" + "vec4 gl_FrontColor;" + "vec4 gl_BackColor;" + "vec4 gl_FrontSecondaryColor;" + "vec4 gl_BackSecondaryColor;" + "vec4 gl_TexCoord[];" + "float gl_FogFragCoord;" + ); + if (version >= 450) + stageBuiltins[EShLangGeometry].append( + "float gl_CullDistance[];" + ); + stageBuiltins[EShLangGeometry].append( + "};" + + "out int gl_PrimitiveID;" + "out int gl_Layer;"); + + if (version >= 150) + stageBuiltins[EShLangGeometry].append( + "out int gl_ViewportIndex;" + ); + + if (profile == ECompatibilityProfile && version < 400) + stageBuiltins[EShLangGeometry].append( + "out vec4 gl_ClipVertex;" + ); + + if (version >= 150) + stageBuiltins[EShLangGeometry].append( + "in int gl_InvocationID;" + ); + + if (version >= 430) + stageBuiltins[EShLangGeometry].append( + "out int gl_ViewportMask[];" // GL_NV_viewport_array2 + ); + + if (version >= 450) + stageBuiltins[EShLangGeometry].append( + "out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering + "out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering + "out vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes + "out int gl_ViewportMaskPerViewNV[];" // GL_NVX_multiview_per_view_attributes + ); + + stageBuiltins[EShLangGeometry].append("\n"); + } else if (profile == EEsProfile && version >= 310) { + stageBuiltins[EShLangGeometry].append( + "in gl_PerVertex {" + "highp vec4 gl_Position;" + "highp float gl_PointSize;" + "} gl_in[];" + "\n" + "in highp int gl_PrimitiveIDIn;" + "in highp int gl_InvocationID;" + "\n" + "out gl_PerVertex {" + "highp vec4 gl_Position;" + "highp float gl_PointSize;" + "};" + "\n" + "out highp int gl_PrimitiveID;" + "out highp int gl_Layer;" + "\n" + ); + } + + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + stageBuiltins[EShLangGeometry].append( + "in highp int gl_DeviceIndex;" // GL_EXT_device_group + "in highp int gl_ViewIndex;" // GL_EXT_multiview + "\n"); + } + + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) { + stageBuiltins[EShLangGeometry].append( + "out highp int gl_PrimitiveShadingRateEXT;" // GL_EXT_fragment_shading_rate + "\n"); + } + + //============================================================================ + // + // Define the interface to the tessellation control shader. + // + //============================================================================ + + if (profile != EEsProfile && version >= 150) { + // Note: "in gl_PerVertex {...} gl_in[gl_MaxPatchVertices];" is declared in initialize() below, + // as it depends on the resource sizing of gl_MaxPatchVertices. + + stageBuiltins[EShLangTessControl].append( + "in int gl_PatchVerticesIn;" + "in int gl_PrimitiveID;" + "in int gl_InvocationID;" + + "out gl_PerVertex {" + "vec4 gl_Position;" + "float gl_PointSize;" + "float gl_ClipDistance[];" + ); + if (profile == ECompatibilityProfile) + stageBuiltins[EShLangTessControl].append( + "vec4 gl_ClipVertex;" + "vec4 gl_FrontColor;" + "vec4 gl_BackColor;" + "vec4 gl_FrontSecondaryColor;" + "vec4 gl_BackSecondaryColor;" + "vec4 gl_TexCoord[];" + "float gl_FogFragCoord;" + ); + if (version >= 450) + stageBuiltins[EShLangTessControl].append( + "float gl_CullDistance[];" + ); + if (version >= 430) + stageBuiltins[EShLangTessControl].append( + "int gl_ViewportMask[];" // GL_NV_viewport_array2 + ); + if (version >= 450) + stageBuiltins[EShLangTessControl].append( + "vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering + "int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering + "vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes + "int gl_ViewportMaskPerViewNV[];" // GL_NVX_multiview_per_view_attributes + ); + stageBuiltins[EShLangTessControl].append( + "} gl_out[];" + + "patch out float gl_TessLevelOuter[4];" + "patch out float gl_TessLevelInner[2];" + "\n"); + + if (version >= 410) + stageBuiltins[EShLangTessControl].append( + "out int gl_ViewportIndex;" + "out int gl_Layer;" + "\n"); + + } else { + // Note: "in gl_PerVertex {...} gl_in[gl_MaxPatchVertices];" is declared in initialize() below, + // as it depends on the resource sizing of gl_MaxPatchVertices. + + stageBuiltins[EShLangTessControl].append( + "in highp int gl_PatchVerticesIn;" + "in highp int gl_PrimitiveID;" + "in highp int gl_InvocationID;" + + "out gl_PerVertex {" + "highp vec4 gl_Position;" + "highp float gl_PointSize;" + ); + stageBuiltins[EShLangTessControl].append( + "} gl_out[];" + + "patch out highp float gl_TessLevelOuter[4];" + "patch out highp float gl_TessLevelInner[2];" + "patch out highp vec4 gl_BoundingBoxOES[2];" + "patch out highp vec4 gl_BoundingBoxEXT[2];" + "\n"); + if (profile == EEsProfile && version >= 320) { + stageBuiltins[EShLangTessControl].append( + "patch out highp vec4 gl_BoundingBox[2];" + "\n" + ); + } + } + + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + stageBuiltins[EShLangTessControl].append( + "in highp int gl_DeviceIndex;" // GL_EXT_device_group + "in highp int gl_ViewIndex;" // GL_EXT_multiview + "\n"); + } + + //============================================================================ + // + // Define the interface to the tessellation evaluation shader. + // + //============================================================================ + + if (profile != EEsProfile && version >= 150) { + // Note: "in gl_PerVertex {...} gl_in[gl_MaxPatchVertices];" is declared in initialize() below, + // as it depends on the resource sizing of gl_MaxPatchVertices. + + stageBuiltins[EShLangTessEvaluation].append( + "in int gl_PatchVerticesIn;" + "in int gl_PrimitiveID;" + "in vec3 gl_TessCoord;" + + "patch in float gl_TessLevelOuter[4];" + "patch in float gl_TessLevelInner[2];" + + "out gl_PerVertex {" + "vec4 gl_Position;" + "float gl_PointSize;" + "float gl_ClipDistance[];" + ); + if (version >= 400 && profile == ECompatibilityProfile) + stageBuiltins[EShLangTessEvaluation].append( + "vec4 gl_ClipVertex;" + "vec4 gl_FrontColor;" + "vec4 gl_BackColor;" + "vec4 gl_FrontSecondaryColor;" + "vec4 gl_BackSecondaryColor;" + "vec4 gl_TexCoord[];" + "float gl_FogFragCoord;" + ); + if (version >= 450) + stageBuiltins[EShLangTessEvaluation].append( + "float gl_CullDistance[];" + ); + stageBuiltins[EShLangTessEvaluation].append( + "};" + "\n"); + + if (version >= 410) + stageBuiltins[EShLangTessEvaluation].append( + "out int gl_ViewportIndex;" + "out int gl_Layer;" + "\n"); + + if (version >= 430) + stageBuiltins[EShLangTessEvaluation].append( + "out int gl_ViewportMask[];" // GL_NV_viewport_array2 + ); + + if (version >= 450) + stageBuiltins[EShLangTessEvaluation].append( + "out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering + "out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering + "out vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes + "out int gl_ViewportMaskPerViewNV[];" // GL_NVX_multiview_per_view_attributes + ); + + } else if (profile == EEsProfile && version >= 310) { + // Note: "in gl_PerVertex {...} gl_in[gl_MaxPatchVertices];" is declared in initialize() below, + // as it depends on the resource sizing of gl_MaxPatchVertices. + + stageBuiltins[EShLangTessEvaluation].append( + "in highp int gl_PatchVerticesIn;" + "in highp int gl_PrimitiveID;" + "in highp vec3 gl_TessCoord;" + + "patch in highp float gl_TessLevelOuter[4];" + "patch in highp float gl_TessLevelInner[2];" + + "out gl_PerVertex {" + "highp vec4 gl_Position;" + "highp float gl_PointSize;" + ); + stageBuiltins[EShLangTessEvaluation].append( + "};" + "\n"); + } + + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + stageBuiltins[EShLangTessEvaluation].append( + "in highp int gl_DeviceIndex;" // GL_EXT_device_group + "in highp int gl_ViewIndex;" // GL_EXT_multiview + "\n"); + } + + //============================================================================ + // + // Define the interface to the fragment shader. + // + //============================================================================ + + if (profile != EEsProfile) { + + stageBuiltins[EShLangFragment].append( + "vec4 gl_FragCoord;" // needs qualifier fixed later + "bool gl_FrontFacing;" // needs qualifier fixed later + "float gl_FragDepth;" // needs qualifier fixed later + ); + if (version >= 120) + stageBuiltins[EShLangFragment].append( + "vec2 gl_PointCoord;" // needs qualifier fixed later + ); + if (version >= 140) + stageBuiltins[EShLangFragment].append( + "out int gl_FragStencilRefARB;" + ); + if (IncludeLegacy(version, profile, spvVersion) || (! ForwardCompatibility && version < 420)) + stageBuiltins[EShLangFragment].append( + "vec4 gl_FragColor;" // needs qualifier fixed later + ); + + if (version < 130) { + stageBuiltins[EShLangFragment].append( + "varying vec4 gl_Color;" + "varying vec4 gl_SecondaryColor;" + "varying vec4 gl_TexCoord[];" + "varying float gl_FogFragCoord;" + ); + } else { + stageBuiltins[EShLangFragment].append( + "in float gl_ClipDistance[];" + ); + + if (IncludeLegacy(version, profile, spvVersion)) { + if (version < 150) + stageBuiltins[EShLangFragment].append( + "in float gl_FogFragCoord;" + "in vec4 gl_TexCoord[];" + "in vec4 gl_Color;" + "in vec4 gl_SecondaryColor;" + ); + else + stageBuiltins[EShLangFragment].append( + "in gl_PerFragment {" + "in float gl_FogFragCoord;" + "in vec4 gl_TexCoord[];" + "in vec4 gl_Color;" + "in vec4 gl_SecondaryColor;" + "};" + ); + } + } + + if (version >= 150) + stageBuiltins[EShLangFragment].append( + "flat in int gl_PrimitiveID;" + ); + + if (version >= 130) { // ARB_sample_shading + stageBuiltins[EShLangFragment].append( + "flat in int gl_SampleID;" + " in vec2 gl_SamplePosition;" + " out int gl_SampleMask[];" + ); + + if (spvVersion.spv == 0) { + stageBuiltins[EShLangFragment].append( + "uniform int gl_NumSamples;" + ); + } + } + + if (version >= 150) + stageBuiltins[EShLangFragment].append( + "flat in int gl_SampleMaskIn[];" + ); + + if (version >= 430) + stageBuiltins[EShLangFragment].append( + "flat in int gl_Layer;" + "flat in int gl_ViewportIndex;" + ); + + if (version >= 450) + stageBuiltins[EShLangFragment].append( + "in float gl_CullDistance[];" + "bool gl_HelperInvocation;" // needs qualifier fixed later + ); + + if (version >= 450) + stageBuiltins[EShLangFragment].append( // GL_EXT_fragment_invocation_density + "flat in ivec2 gl_FragSizeEXT;" + "flat in int gl_FragInvocationCountEXT;" + ); + + if (version >= 450) + stageBuiltins[EShLangFragment].append( + "in vec2 gl_BaryCoordNoPerspAMD;" + "in vec2 gl_BaryCoordNoPerspCentroidAMD;" + "in vec2 gl_BaryCoordNoPerspSampleAMD;" + "in vec2 gl_BaryCoordSmoothAMD;" + "in vec2 gl_BaryCoordSmoothCentroidAMD;" + "in vec2 gl_BaryCoordSmoothSampleAMD;" + "in vec3 gl_BaryCoordPullModelAMD;" + ); + + if (version >= 430) + stageBuiltins[EShLangFragment].append( + "in bool gl_FragFullyCoveredNV;" + ); + if (version >= 450) + stageBuiltins[EShLangFragment].append( + "flat in ivec2 gl_FragmentSizeNV;" // GL_NV_shading_rate_image + "flat in int gl_InvocationsPerPixelNV;" + "in vec3 gl_BaryCoordNV;" // GL_NV_fragment_shader_barycentric + "in vec3 gl_BaryCoordNoPerspNV;" + "in vec3 gl_BaryCoordEXT;" // GL_EXT_fragment_shader_barycentric + "in vec3 gl_BaryCoordNoPerspEXT;" + ); + + if (version >= 450) + stageBuiltins[EShLangFragment].append( + "flat in int gl_ShadingRateEXT;" // GL_EXT_fragment_shading_rate + ); + + } else { + // ES profile + + if (version == 100) { + stageBuiltins[EShLangFragment].append( + "mediump vec4 gl_FragCoord;" // needs qualifier fixed later + " bool gl_FrontFacing;" // needs qualifier fixed later + "mediump vec4 gl_FragColor;" // needs qualifier fixed later + "mediump vec2 gl_PointCoord;" // needs qualifier fixed later + ); + } + if (version >= 300) { + stageBuiltins[EShLangFragment].append( + "highp vec4 gl_FragCoord;" // needs qualifier fixed later + " bool gl_FrontFacing;" // needs qualifier fixed later + "mediump vec2 gl_PointCoord;" // needs qualifier fixed later + "highp float gl_FragDepth;" // needs qualifier fixed later + ); + } + if (version >= 310) { + stageBuiltins[EShLangFragment].append( + "bool gl_HelperInvocation;" // needs qualifier fixed later + "flat in highp int gl_PrimitiveID;" // needs qualifier fixed later + "flat in highp int gl_Layer;" // needs qualifier fixed later + ); + + stageBuiltins[EShLangFragment].append( // GL_OES_sample_variables + "flat in lowp int gl_SampleID;" + " in mediump vec2 gl_SamplePosition;" + "flat in highp int gl_SampleMaskIn[];" + " out highp int gl_SampleMask[];" + ); + if (spvVersion.spv == 0) + stageBuiltins[EShLangFragment].append( // GL_OES_sample_variables + "uniform lowp int gl_NumSamples;" + ); + } + stageBuiltins[EShLangFragment].append( + "highp float gl_FragDepthEXT;" // GL_EXT_frag_depth + ); + + if (version >= 310) + stageBuiltins[EShLangFragment].append( // GL_EXT_fragment_invocation_density + "flat in ivec2 gl_FragSizeEXT;" + "flat in int gl_FragInvocationCountEXT;" + ); + if (version >= 320) + stageBuiltins[EShLangFragment].append( // GL_NV_shading_rate_image + "flat in ivec2 gl_FragmentSizeNV;" + "flat in int gl_InvocationsPerPixelNV;" + ); + if (version >= 320) + stageBuiltins[EShLangFragment].append( + "in vec3 gl_BaryCoordNV;" + "in vec3 gl_BaryCoordNoPerspNV;" + "in vec3 gl_BaryCoordEXT;" + "in vec3 gl_BaryCoordNoPerspEXT;" + ); + if (version >= 310) + stageBuiltins[EShLangFragment].append( + "flat in highp int gl_ShadingRateEXT;" // GL_EXT_fragment_shading_rate + ); + } + + stageBuiltins[EShLangFragment].append("\n"); + + if (version >= 130) + add2ndGenerationSamplingImaging(version, profile, spvVersion); + + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + stageBuiltins[EShLangFragment].append( + "flat in highp int gl_DeviceIndex;" // GL_EXT_device_group + "flat in highp int gl_ViewIndex;" // GL_EXT_multiview + "\n"); + } + + if (version >= 300 /* both ES and non-ES */) { + stageBuiltins[EShLangFragment].append( + "flat in highp uint gl_ViewID_OVR;" // GL_OVR_multiview, GL_OVR_multiview2 + "\n"); + } + + // GL_QCOM_tile_shading + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 460)) { + stageBuiltins[EShLangFragment].append( + "flat in highp uvec2 gl_TileOffsetQCOM;" // GL_QCOM_tile_shading + "flat in highp uvec3 gl_TileDimensionQCOM;" // GL_QCOM_tile_shading + "flat in highp uvec2 gl_TileApronSizeQCOM;" // GL_QCOM_tile_shading + "\n"); + } + + // GL_ARB_shader_ballot + if (profile != EEsProfile && version >= 450) { + const char* ballotDecls = + "uniform uint gl_SubGroupSizeARB;" + "in uint gl_SubGroupInvocationARB;" + "in uint64_t gl_SubGroupEqMaskARB;" + "in uint64_t gl_SubGroupGeMaskARB;" + "in uint64_t gl_SubGroupGtMaskARB;" + "in uint64_t gl_SubGroupLeMaskARB;" + "in uint64_t gl_SubGroupLtMaskARB;" + "\n"; + const char* rtBallotDecls = + "uniform volatile uint gl_SubGroupSizeARB;" + "in volatile uint gl_SubGroupInvocationARB;" + "in volatile uint64_t gl_SubGroupEqMaskARB;" + "in volatile uint64_t gl_SubGroupGeMaskARB;" + "in volatile uint64_t gl_SubGroupGtMaskARB;" + "in volatile uint64_t gl_SubGroupLeMaskARB;" + "in volatile uint64_t gl_SubGroupLtMaskARB;" + "\n"; + const char* fragmentBallotDecls = + "uniform uint gl_SubGroupSizeARB;" + "flat in uint gl_SubGroupInvocationARB;" + "flat in uint64_t gl_SubGroupEqMaskARB;" + "flat in uint64_t gl_SubGroupGeMaskARB;" + "flat in uint64_t gl_SubGroupGtMaskARB;" + "flat in uint64_t gl_SubGroupLeMaskARB;" + "flat in uint64_t gl_SubGroupLtMaskARB;" + "\n"; + stageBuiltins[EShLangVertex] .append(ballotDecls); + stageBuiltins[EShLangTessControl] .append(ballotDecls); + stageBuiltins[EShLangTessEvaluation].append(ballotDecls); + stageBuiltins[EShLangGeometry] .append(ballotDecls); + stageBuiltins[EShLangCompute] .append(ballotDecls); + stageBuiltins[EShLangFragment] .append(fragmentBallotDecls); + stageBuiltins[EShLangMesh] .append(ballotDecls); + stageBuiltins[EShLangTask] .append(ballotDecls); + stageBuiltins[EShLangRayGen] .append(rtBallotDecls); + stageBuiltins[EShLangIntersect] .append(rtBallotDecls); + // No volatile qualifier on these builtins in any-hit + stageBuiltins[EShLangAnyHit] .append(ballotDecls); + stageBuiltins[EShLangClosestHit] .append(rtBallotDecls); + stageBuiltins[EShLangMiss] .append(rtBallotDecls); + stageBuiltins[EShLangCallable] .append(rtBallotDecls); + } + + // GL_KHR_shader_subgroup + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + const char* subgroupDecls = + "in mediump uint gl_SubgroupSize;" + "in mediump uint gl_SubgroupInvocationID;" + "in highp uvec4 gl_SubgroupEqMask;" + "in highp uvec4 gl_SubgroupGeMask;" + "in highp uvec4 gl_SubgroupGtMask;" + "in highp uvec4 gl_SubgroupLeMask;" + "in highp uvec4 gl_SubgroupLtMask;" + // GL_NV_shader_sm_builtins + "in highp uint gl_WarpsPerSMNV;" + "in highp uint gl_SMCountNV;" + "in highp uint gl_WarpIDNV;" + "in highp uint gl_SMIDNV;" + // GL_ARM_shader_core_builtins + "in highp uint gl_CoreIDARM;" + "in highp uint gl_CoreCountARM;" + "in highp uint gl_CoreMaxIDARM;" + "in highp uint gl_WarpIDARM;" + "in highp uint gl_WarpMaxIDARM;" + "\n"; + const char* fragmentSubgroupDecls = + "flat in mediump uint gl_SubgroupSize;" + "flat in mediump uint gl_SubgroupInvocationID;" + "flat in highp uvec4 gl_SubgroupEqMask;" + "flat in highp uvec4 gl_SubgroupGeMask;" + "flat in highp uvec4 gl_SubgroupGtMask;" + "flat in highp uvec4 gl_SubgroupLeMask;" + "flat in highp uvec4 gl_SubgroupLtMask;" + // GL_NV_shader_sm_builtins + "flat in highp uint gl_WarpsPerSMNV;" + "flat in highp uint gl_SMCountNV;" + "flat in highp uint gl_WarpIDNV;" + "flat in highp uint gl_SMIDNV;" + // GL_ARM_shader_core_builtins + "flat in highp uint gl_CoreIDARM;" + "flat in highp uint gl_CoreCountARM;" + "flat in highp uint gl_CoreMaxIDARM;" + "flat in highp uint gl_WarpIDARM;" + "flat in highp uint gl_WarpMaxIDARM;" + "\n"; + const char* computeSubgroupDecls = + "in highp uint gl_NumSubgroups;" + "in highp uint gl_SubgroupID;" + "\n"; + // These builtins are volatile for RT stages + const char* rtSubgroupDecls = + "in mediump volatile uint gl_SubgroupSize;" + "in mediump volatile uint gl_SubgroupInvocationID;" + "in highp volatile uvec4 gl_SubgroupEqMask;" + "in highp volatile uvec4 gl_SubgroupGeMask;" + "in highp volatile uvec4 gl_SubgroupGtMask;" + "in highp volatile uvec4 gl_SubgroupLeMask;" + "in highp volatile uvec4 gl_SubgroupLtMask;" + // GL_NV_shader_sm_builtins + "in highp uint gl_WarpsPerSMNV;" + "in highp uint gl_SMCountNV;" + "in highp volatile uint gl_WarpIDNV;" + "in highp volatile uint gl_SMIDNV;" + // GL_ARM_shader_core_builtins + "in highp uint gl_CoreIDARM;" + "in highp uint gl_CoreCountARM;" + "in highp uint gl_CoreMaxIDARM;" + "in highp uint gl_WarpIDARM;" + "in highp uint gl_WarpMaxIDARM;" + "\n"; + + stageBuiltins[EShLangVertex] .append(subgroupDecls); + stageBuiltins[EShLangTessControl] .append(subgroupDecls); + stageBuiltins[EShLangTessEvaluation].append(subgroupDecls); + stageBuiltins[EShLangGeometry] .append(subgroupDecls); + stageBuiltins[EShLangCompute] .append(subgroupDecls); + stageBuiltins[EShLangCompute] .append(computeSubgroupDecls); + stageBuiltins[EShLangFragment] .append(fragmentSubgroupDecls); + stageBuiltins[EShLangMesh] .append(subgroupDecls); + stageBuiltins[EShLangMesh] .append(computeSubgroupDecls); + stageBuiltins[EShLangTask] .append(subgroupDecls); + stageBuiltins[EShLangTask] .append(computeSubgroupDecls); + stageBuiltins[EShLangRayGen] .append(rtSubgroupDecls); + stageBuiltins[EShLangIntersect] .append(rtSubgroupDecls); + // No volatile qualifier on these builtins in any-hit + stageBuiltins[EShLangAnyHit] .append(subgroupDecls); + stageBuiltins[EShLangClosestHit] .append(rtSubgroupDecls); + stageBuiltins[EShLangMiss] .append(rtSubgroupDecls); + stageBuiltins[EShLangCallable] .append(rtSubgroupDecls); + } + + // GL_NV_ray_tracing/GL_EXT_ray_tracing + if (profile != EEsProfile && version >= 460) { + + const char *constRayFlags = + "const uint gl_RayFlagsNoneNV = 0U;" + "const uint gl_RayFlagsNoneEXT = 0U;" + "const uint gl_RayFlagsOpaqueNV = 1U;" + "const uint gl_RayFlagsOpaqueEXT = 1U;" + "const uint gl_RayFlagsNoOpaqueNV = 2U;" + "const uint gl_RayFlagsNoOpaqueEXT = 2U;" + "const uint gl_RayFlagsTerminateOnFirstHitNV = 4U;" + "const uint gl_RayFlagsTerminateOnFirstHitEXT = 4U;" + "const uint gl_RayFlagsSkipClosestHitShaderNV = 8U;" + "const uint gl_RayFlagsSkipClosestHitShaderEXT = 8U;" + "const uint gl_RayFlagsCullBackFacingTrianglesNV = 16U;" + "const uint gl_RayFlagsCullBackFacingTrianglesEXT = 16U;" + "const uint gl_RayFlagsCullFrontFacingTrianglesNV = 32U;" + "const uint gl_RayFlagsCullFrontFacingTrianglesEXT = 32U;" + "const uint gl_RayFlagsCullOpaqueNV = 64U;" + "const uint gl_RayFlagsCullOpaqueEXT = 64U;" + "const uint gl_RayFlagsCullNoOpaqueNV = 128U;" + "const uint gl_RayFlagsCullNoOpaqueEXT = 128U;" + "const uint gl_RayFlagsSkipTrianglesEXT = 256U;" + "const uint gl_RayFlagsSkipBuiltinPrimitivesNV = 256U;" + "const uint gl_RayFlagsSkipAABBEXT = 512U;" + "const uint gl_RayFlagsForceOpacityMicromap2StateEXT = 1024U;" + "const uint gl_HitKindFrontFacingTriangleEXT = 254U;" + "const uint gl_HitKindBackFacingTriangleEXT = 255U;" + "in uint gl_HitKindFrontFacingMicroTriangleNV;" + "in uint gl_HitKindBackFacingMicroTriangleNV;" + "const int gl_ClusterIDNoneNV = -1;" + "\n"; + + const char *constRayQueryIntersection = + "const uint gl_RayQueryCandidateIntersectionEXT = 0U;" + "const uint gl_RayQueryCommittedIntersectionEXT = 1U;" + "const uint gl_RayQueryCommittedIntersectionNoneEXT = 0U;" + "const uint gl_RayQueryCommittedIntersectionTriangleEXT = 1U;" + "const uint gl_RayQueryCommittedIntersectionGeneratedEXT = 2U;" + "const uint gl_RayQueryCandidateIntersectionTriangleEXT = 0U;" + "const uint gl_RayQueryCandidateIntersectionAABBEXT = 1U;" + "\n"; + + const char *rayGenDecls = + "in uvec3 gl_LaunchIDNV;" + "in uvec3 gl_LaunchIDEXT;" + "in uvec3 gl_LaunchSizeNV;" + "in uvec3 gl_LaunchSizeEXT;" + "\n"; + const char *intersectDecls = + "in uvec3 gl_LaunchIDNV;" + "in uvec3 gl_LaunchIDEXT;" + "in uvec3 gl_LaunchSizeNV;" + "in uvec3 gl_LaunchSizeEXT;" + "in int gl_PrimitiveID;" + "in int gl_InstanceID;" + "in int gl_InstanceCustomIndexNV;" + "in int gl_InstanceCustomIndexEXT;" + "in int gl_GeometryIndexEXT;" + "in vec3 gl_WorldRayOriginNV;" + "in vec3 gl_WorldRayOriginEXT;" + "in vec3 gl_WorldRayDirectionNV;" + "in vec3 gl_WorldRayDirectionEXT;" + "in vec3 gl_ObjectRayOriginNV;" + "in vec3 gl_ObjectRayOriginEXT;" + "in vec3 gl_ObjectRayDirectionNV;" + "in vec3 gl_ObjectRayDirectionEXT;" + "in float gl_RayTminNV;" + "in float gl_RayTminEXT;" + "in float gl_RayTmaxNV;" + "in volatile float gl_RayTmaxEXT;" + "in mat4x3 gl_ObjectToWorldNV;" + "in mat4x3 gl_ObjectToWorldEXT;" + "in mat3x4 gl_ObjectToWorld3x4EXT;" + "in mat4x3 gl_WorldToObjectNV;" + "in mat4x3 gl_WorldToObjectEXT;" + "in mat3x4 gl_WorldToObject3x4EXT;" + "in uint gl_IncomingRayFlagsNV;" + "in uint gl_IncomingRayFlagsEXT;" + "in float gl_CurrentRayTimeNV;" + "in uint gl_CullMaskEXT;" + "\n"; + const char *hitDecls = + "in uvec3 gl_LaunchIDNV;" + "in uvec3 gl_LaunchIDEXT;" + "in uvec3 gl_LaunchSizeNV;" + "in uvec3 gl_LaunchSizeEXT;" + "in int gl_PrimitiveID;" + "in int gl_InstanceID;" + "in int gl_InstanceCustomIndexNV;" + "in int gl_InstanceCustomIndexEXT;" + "in int gl_GeometryIndexEXT;" + "in vec3 gl_WorldRayOriginNV;" + "in vec3 gl_WorldRayOriginEXT;" + "in vec3 gl_WorldRayDirectionNV;" + "in vec3 gl_WorldRayDirectionEXT;" + "in vec3 gl_ObjectRayOriginNV;" + "in vec3 gl_ObjectRayOriginEXT;" + "in vec3 gl_ObjectRayDirectionNV;" + "in vec3 gl_ObjectRayDirectionEXT;" + "in float gl_RayTminNV;" + "in float gl_RayTminEXT;" + "in float gl_RayTmaxNV;" + "in float gl_RayTmaxEXT;" + "in float gl_HitTNV;" + "in float gl_HitTEXT;" + "in uint gl_HitKindNV;" + "in uint gl_HitKindEXT;" + "in mat4x3 gl_ObjectToWorldNV;" + "in mat4x3 gl_ObjectToWorldEXT;" + "in mat3x4 gl_ObjectToWorld3x4EXT;" + "in mat4x3 gl_WorldToObjectNV;" + "in mat4x3 gl_WorldToObjectEXT;" + "in mat3x4 gl_WorldToObject3x4EXT;" + "in uint gl_IncomingRayFlagsNV;" + "in uint gl_IncomingRayFlagsEXT;" + "in float gl_CurrentRayTimeNV;" + "in uint gl_CullMaskEXT;" + "in vec3 gl_HitTriangleVertexPositionsEXT[3];" + "in vec3 gl_HitMicroTriangleVertexPositionsNV[3];" + "in vec2 gl_HitMicroTriangleVertexBarycentricsNV[3];" + "in int gl_ClusterIDNV;" + "in bool gl_HitIsSphereNV;" + "in bool gl_HitIsLSSNV;" + "in vec3 gl_HitSpherePositionNV;" + "in float gl_HitSphereRadiusNV;" + "in vec3 gl_HitLSSPositionsNV[2];" + "in float gl_HitLSSRadiiNV[2];" + "\n"; + + const char *missDecls = + "in uvec3 gl_LaunchIDNV;" + "in uvec3 gl_LaunchIDEXT;" + "in uvec3 gl_LaunchSizeNV;" + "in uvec3 gl_LaunchSizeEXT;" + "in vec3 gl_WorldRayOriginNV;" + "in vec3 gl_WorldRayOriginEXT;" + "in vec3 gl_WorldRayDirectionNV;" + "in vec3 gl_WorldRayDirectionEXT;" + "in vec3 gl_ObjectRayOriginNV;" + "in vec3 gl_ObjectRayDirectionNV;" + "in float gl_RayTminNV;" + "in float gl_RayTminEXT;" + "in float gl_RayTmaxNV;" + "in float gl_RayTmaxEXT;" + "in uint gl_IncomingRayFlagsNV;" + "in uint gl_IncomingRayFlagsEXT;" + "in float gl_CurrentRayTimeNV;" + "in uint gl_CullMaskEXT;" + "\n"; + + const char *callableDecls = + "in uvec3 gl_LaunchIDNV;" + "in uvec3 gl_LaunchIDEXT;" + "in uvec3 gl_LaunchSizeNV;" + "in uvec3 gl_LaunchSizeEXT;" + "\n"; + + + commonBuiltins.append(constRayQueryIntersection); + commonBuiltins.append(constRayFlags); + + stageBuiltins[EShLangRayGen].append(rayGenDecls); + stageBuiltins[EShLangIntersect].append(intersectDecls); + stageBuiltins[EShLangAnyHit].append(hitDecls); + stageBuiltins[EShLangClosestHit].append(hitDecls); + stageBuiltins[EShLangMiss].append(missDecls); + stageBuiltins[EShLangCallable].append(callableDecls); + + } + + if ((profile != EEsProfile && version >= 140)) { + const char *deviceIndex = + "in highp int gl_DeviceIndex;" // GL_EXT_device_group + "\n"; + + stageBuiltins[EShLangRayGen].append(deviceIndex); + stageBuiltins[EShLangIntersect].append(deviceIndex); + stageBuiltins[EShLangAnyHit].append(deviceIndex); + stageBuiltins[EShLangClosestHit].append(deviceIndex); + stageBuiltins[EShLangMiss].append(deviceIndex); + } + + if ((profile != EEsProfile && version >= 420) || + (profile == EEsProfile && version >= 310)) { + commonBuiltins.append("const int gl_ScopeDevice = 1;\n"); + commonBuiltins.append("const int gl_ScopeWorkgroup = 2;\n"); + commonBuiltins.append("const int gl_ScopeSubgroup = 3;\n"); + commonBuiltins.append("const int gl_ScopeInvocation = 4;\n"); + commonBuiltins.append("const int gl_ScopeQueueFamily = 5;\n"); + commonBuiltins.append("const int gl_ScopeShaderCallEXT = 6;\n"); + + commonBuiltins.append("const int gl_SemanticsRelaxed = 0x0;\n"); + commonBuiltins.append("const int gl_SemanticsAcquire = 0x2;\n"); + commonBuiltins.append("const int gl_SemanticsRelease = 0x4;\n"); + commonBuiltins.append("const int gl_SemanticsAcquireRelease = 0x8;\n"); + commonBuiltins.append("const int gl_SemanticsMakeAvailable = 0x2000;\n"); + commonBuiltins.append("const int gl_SemanticsMakeVisible = 0x4000;\n"); + commonBuiltins.append("const int gl_SemanticsVolatile = 0x8000;\n"); + + commonBuiltins.append("const int gl_StorageSemanticsNone = 0x0;\n"); + commonBuiltins.append("const int gl_StorageSemanticsBuffer = 0x40;\n"); + commonBuiltins.append("const int gl_StorageSemanticsShared = 0x100;\n"); + commonBuiltins.append("const int gl_StorageSemanticsImage = 0x800;\n"); + commonBuiltins.append("const int gl_StorageSemanticsOutput = 0x1000;\n"); + } + + // Adding these to common built-ins triggers an assert due to a memory corruption in related code when testing + // So instead add to each stage individually, avoiding the GLSLang bug + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) { + for (int stage=EShLangVertex; stage(stage)].append("const highp int gl_ShadingRateFlag2VerticalPixelsEXT = 1;\n"); + stageBuiltins[static_cast(stage)].append("const highp int gl_ShadingRateFlag4VerticalPixelsEXT = 2;\n"); + stageBuiltins[static_cast(stage)].append("const highp int gl_ShadingRateFlag2HorizontalPixelsEXT = 4;\n"); + stageBuiltins[static_cast(stage)].append("const highp int gl_ShadingRateFlag4HorizontalPixelsEXT = 8;\n"); + } + } + + // GL_EXT_shader_image_int64 + if ((profile != EEsProfile && version >= 420) || + (profile == EEsProfile && version >= 310)) { + + const TBasicType bTypes[] = { EbtInt64, EbtUint64 }; + for (int ms = 0; ms <= 1; ++ms) { // loop over "bool" multisample or not + for (int arrayed = 0; arrayed <= 1; ++arrayed) { // loop over "bool" arrayed or not + for (int dim = Esd1D; dim < EsdSubpass; ++dim) { // 1D, ..., buffer + if ((dim == Esd1D || dim == EsdRect) && profile == EEsProfile) + continue; + + if ((dim == Esd3D || dim == EsdRect || dim == EsdBuffer) && arrayed) + continue; + + if (dim != Esd2D && ms) + continue; + + // Loop over the bTypes + for (size_t bType = 0; bType < sizeof(bTypes)/sizeof(TBasicType); ++bType) { + // + // Now, make all the function prototypes for the type we just built... + // + TSampler sampler; + + sampler.setImage(bTypes[bType], (TSamplerDim)dim, arrayed ? true : false, + false, + ms ? true : false); + + TString typeName = TString{sampler.getString()}; + + addQueryFunctions(sampler, typeName, version, profile); + addImageFunctions(sampler, typeName, version, profile); + } + } + } + } + } + + // printf("%s\n", commonBuiltins.c_str()); + // printf("%s\n", stageBuiltins[EShLangFragment].c_str()); +} + +// +// Helper function for initialize(), to add the second set of names for texturing, +// when adding context-independent built-in functions. +// +void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, const SpvVersion& spvVersion) +{ + // + // In this function proper, enumerate the types, then calls the next set of functions + // to enumerate all the uses for that type. + // + + // enumerate all the types + const TBasicType bTypes[] = { EbtFloat, EbtInt, EbtUint, + EbtFloat16 + }; + bool skipBuffer = (profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 140); + bool skipCubeArrayed = (profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 130); + for (int image = 0; image <= 1; ++image) // loop over "bool" image vs sampler + { + for (int shadow = 0; shadow <= 1; ++shadow) { // loop over "bool" shadow or not + for (int ms = 0; ms <= 1; ++ms) // loop over "bool" multisample or not + { + if ((ms || image) && shadow) + continue; + if (ms && profile != EEsProfile && version < 140) + continue; + if (ms && image && profile == EEsProfile) + continue; + if (ms && profile == EEsProfile && version < 310) + continue; + + for (int arrayed = 0; arrayed <= 1; ++arrayed) { // loop over "bool" arrayed or not + for (int dim = Esd1D; dim < EsdNumDims; ++dim) { // 1D, ..., buffer, subpass + if (dim == EsdAttachmentEXT) + continue; + if (dim == EsdSubpass && spvVersion.vulkan == 0) + continue; + if (dim == EsdSubpass && (image || shadow || arrayed)) + continue; + if ((dim == Esd1D || dim == EsdRect) && profile == EEsProfile) + continue; + if (dim == EsdSubpass && spvVersion.vulkan == 0) + continue; + if (dim == EsdSubpass && (image || shadow || arrayed)) + continue; + if ((dim == Esd1D || dim == EsdRect) && profile == EEsProfile) + continue; + if (dim != Esd2D && dim != EsdSubpass && ms) + continue; + if (dim == EsdBuffer && skipBuffer) + continue; + if (dim == EsdBuffer && (shadow || arrayed || ms)) + continue; + if (ms && arrayed && profile == EEsProfile && version < 310) + continue; + if (dim == Esd3D && shadow) + continue; + if (dim == EsdCube && arrayed && skipCubeArrayed) + continue; + if ((dim == Esd3D || dim == EsdRect) && arrayed) + continue; + + // Loop over the bTypes + for (size_t bType = 0; bType < sizeof(bTypes)/sizeof(TBasicType); ++bType) { + if (bTypes[bType] == EbtFloat16 && (profile == EEsProfile || version < 450)) + continue; + if (dim == EsdRect && version < 140 && bType > 0) + continue; + if (shadow && (bTypes[bType] == EbtInt || bTypes[bType] == EbtUint)) + continue; + // + // Now, make all the function prototypes for the type we just built... + // + TSampler sampler; + if (dim == EsdSubpass) { + sampler.setSubpass(bTypes[bType], ms ? true : false); + } else if (dim == EsdAttachmentEXT) { + sampler.setAttachmentEXT(bTypes[bType]); + } else + if (image) { + sampler.setImage(bTypes[bType], (TSamplerDim)dim, arrayed ? true : false, + shadow ? true : false, + ms ? true : false); + } else { + sampler.set(bTypes[bType], (TSamplerDim)dim, arrayed ? true : false, + shadow ? true : false, + ms ? true : false); + } + + TString typeName = TString{sampler.getString()}; + + if (dim == EsdSubpass) { + addSubpassSampling(sampler, typeName, version, profile); + continue; + } + + addQueryFunctions(sampler, typeName, version, profile); + + if (image) + addImageFunctions(sampler, typeName, version, profile); + else { + addSamplingFunctions(sampler, typeName, version, profile); + addGatherFunctions(sampler, typeName, version, profile); + if (spvVersion.vulkan > 0 && sampler.isCombined() && !sampler.shadow) { + // Base Vulkan allows texelFetch() for + // textureBuffer (i.e. without sampler). + // + // GL_EXT_samplerless_texture_functions + // allows texelFetch() and query functions + // (other than textureQueryLod()) for all + // texture types. + sampler.setTexture(sampler.type, sampler.dim, sampler.arrayed, sampler.shadow, + sampler.ms); + TString textureTypeName = TString{sampler.getString()}; + addSamplingFunctions(sampler, textureTypeName, version, profile); + addQueryFunctions(sampler, textureTypeName, version, profile); + } + } + } + } + } + } + } + } + + // + // sparseTexelsResidentARB() + // + if (profile != EEsProfile && version >= 450) { + commonBuiltins.append("bool sparseTexelsResidentARB(int code);\n"); + } +} + +// +// Helper function for add2ndGenerationSamplingImaging(), +// when adding context-independent built-in functions. +// +// Add all the query functions for the given type. +// +void TBuiltIns::addQueryFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile) +{ + // + // textureSize() and imageSize() + // + + int sizeDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0) - (sampler.dim == EsdCube ? 1 : 0); + + if (sampler.isImage() && ((profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 420))) + return; + + if (profile == EEsProfile) + commonBuiltins.append("highp "); + if (sizeDims == 1) + commonBuiltins.append("int"); + else { + commonBuiltins.append("ivec"); + commonBuiltins.append(postfixes[sizeDims]); + } + if (sampler.isImage()) + commonBuiltins.append(" imageSize(readonly writeonly volatile coherent nontemporal "); + else + commonBuiltins.append(" textureSize("); + commonBuiltins.append(typeName); + if (! sampler.isImage() && ! sampler.isRect() && ! sampler.isBuffer() && ! sampler.isMultiSample()) + commonBuiltins.append(",int);\n"); + else + commonBuiltins.append(");\n"); + + // + // textureSamples() and imageSamples() + // + + // GL_ARB_shader_texture_image_samples + // TODO: spec issue? there are no memory qualifiers; how to query a writeonly/readonly image, etc? + if (profile != EEsProfile && version >= 430 && sampler.isMultiSample()) { + commonBuiltins.append("int "); + if (sampler.isImage()) + commonBuiltins.append("imageSamples(readonly writeonly volatile coherent nontemporal "); + else + commonBuiltins.append("textureSamples("); + commonBuiltins.append(typeName); + commonBuiltins.append(");\n"); + } + + // + // textureQueryLod(), fragment stage only + // Also enabled with extension GL_ARB_texture_query_lod + // Extension GL_ARB_texture_query_lod says that textureQueryLOD() also exist at extension. + + if (profile != EEsProfile && version >= 150 && sampler.isCombined() && sampler.dim != EsdRect && + ! sampler.isMultiSample() && ! sampler.isBuffer()) { + + const TString funcName[2] = {"vec2 textureQueryLod(", "vec2 textureQueryLOD("}; + + for (int i = 0; i < 2; ++i){ + for (int f16TexAddr = 0; f16TexAddr < 2; ++f16TexAddr) { + if (f16TexAddr && sampler.type != EbtFloat16) + continue; + stageBuiltins[EShLangFragment].append(funcName[i]); + stageBuiltins[EShLangFragment].append(typeName); + if (dimMap[sampler.dim] == 1) + if (f16TexAddr) + stageBuiltins[EShLangFragment].append(", float16_t"); + else + stageBuiltins[EShLangFragment].append(", float"); + else { + if (f16TexAddr) + stageBuiltins[EShLangFragment].append(", f16vec"); + else + stageBuiltins[EShLangFragment].append(", vec"); + stageBuiltins[EShLangFragment].append(postfixes[dimMap[sampler.dim]]); + } + stageBuiltins[EShLangFragment].append(");\n"); + } + + stageBuiltins[EShLangCompute].append(funcName[i]); + stageBuiltins[EShLangCompute].append(typeName); + if (dimMap[sampler.dim] == 1) + stageBuiltins[EShLangCompute].append(", float"); + else { + stageBuiltins[EShLangCompute].append(", vec"); + stageBuiltins[EShLangCompute].append(postfixes[dimMap[sampler.dim]]); + } + stageBuiltins[EShLangCompute].append(");\n"); + } + } + + // + // textureQueryLevels() + // + + if (profile != EEsProfile && version >= 430 && ! sampler.isImage() && sampler.dim != EsdRect && + ! sampler.isMultiSample() && ! sampler.isBuffer()) { + commonBuiltins.append("int textureQueryLevels("); + commonBuiltins.append(typeName); + commonBuiltins.append(");\n"); + } +} + +// +// Helper function for add2ndGenerationSamplingImaging(), +// when adding context-independent built-in functions. +// +// Add all the image access functions for the given type. +// +void TBuiltIns::addImageFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile) +{ + int dims = dimMap[sampler.dim]; + // most things with an array add a dimension, except for cubemaps + if (sampler.arrayed && sampler.dim != EsdCube) + ++dims; + + TString imageParams = typeName; + if (dims == 1) + imageParams.append(", int"); + else { + imageParams.append(", ivec"); + imageParams.append(postfixes[dims]); + } + if (sampler.isMultiSample()) + imageParams.append(", int"); + + if (profile == EEsProfile) + commonBuiltins.append("highp "); + commonBuiltins.append(prefixes[sampler.type]); + commonBuiltins.append("vec4 imageLoad(readonly volatile coherent nontemporal "); + commonBuiltins.append(imageParams); + commonBuiltins.append(");\n"); + + commonBuiltins.append("void imageStore(writeonly volatile coherent nontemporal "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", "); + commonBuiltins.append(prefixes[sampler.type]); + commonBuiltins.append("vec4);\n"); + + if (! sampler.is1D() && ! sampler.isBuffer() && profile != EEsProfile && version >= 450) { + commonBuiltins.append("int sparseImageLoadARB(readonly volatile coherent nontemporal "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", out "); + commonBuiltins.append(prefixes[sampler.type]); + commonBuiltins.append("vec4"); + commonBuiltins.append(");\n"); + } + + if ( profile != EEsProfile || + (profile == EEsProfile && version >= 310)) { + if (sampler.type == EbtInt || sampler.type == EbtUint || sampler.type == EbtInt64 || sampler.type == EbtUint64 ) { + + const char* dataType; + switch (sampler.type) { + case(EbtInt): dataType = "highp int"; break; + case(EbtUint): dataType = "highp uint"; break; + case(EbtInt64): dataType = "highp int64_t"; break; + case(EbtUint64): dataType = "highp uint64_t"; break; + default: dataType = ""; + } + + const int numBuiltins = 7; + + static const char* atomicFunc[numBuiltins] = { + " imageAtomicAdd(volatile coherent nontemporal ", + " imageAtomicMin(volatile coherent nontemporal ", + " imageAtomicMax(volatile coherent nontemporal ", + " imageAtomicAnd(volatile coherent nontemporal ", + " imageAtomicOr(volatile coherent nontemporal ", + " imageAtomicXor(volatile coherent nontemporal ", + " imageAtomicExchange(volatile coherent nontemporal " + }; + + // Loop twice to add prototypes with/without scope/semantics + for (int j = 0; j < 2; ++j) { + for (size_t i = 0; i < numBuiltins; ++i) { + commonBuiltins.append(dataType); + commonBuiltins.append(atomicFunc[i]); + commonBuiltins.append(imageParams); + commonBuiltins.append(", "); + commonBuiltins.append(dataType); + if (j == 1) { + commonBuiltins.append(", int, int, int"); + } + commonBuiltins.append(");\n"); + } + + commonBuiltins.append(dataType); + commonBuiltins.append(" imageAtomicCompSwap(volatile coherent nontemporal "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", "); + commonBuiltins.append(dataType); + commonBuiltins.append(", "); + commonBuiltins.append(dataType); + if (j == 1) { + commonBuiltins.append(", int, int, int, int, int"); + } + commonBuiltins.append(");\n"); + } + + commonBuiltins.append(dataType); + commonBuiltins.append(" imageAtomicLoad(volatile coherent nontemporal "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", int, int, int);\n"); + + commonBuiltins.append("void imageAtomicStore(volatile coherent nontemporal "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", "); + commonBuiltins.append(dataType); + commonBuiltins.append(", int, int, int);\n"); + + } else { + // not int or uint + // GL_ARB_ES3_1_compatibility + // TODO: spec issue: are there restrictions on the kind of layout() that can be used? what about dropping memory qualifiers? + if (profile == EEsProfile && version >= 310) { + commonBuiltins.append("float imageAtomicExchange(volatile coherent nontemporal "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", float);\n"); + } + + // GL_NV_shader_atomic_fp16_vector + if (profile != EEsProfile && version >= 430) { + const int numFp16Builtins = 4; + const char* atomicFp16Func[numFp16Builtins] = { + " imageAtomicAdd(volatile coherent nontemporal ", + " imageAtomicMin(volatile coherent nontemporal ", + " imageAtomicMax(volatile coherent nontemporal ", + " imageAtomicExchange(volatile coherent nontemporal " + }; + const int numFp16DataTypes = 2; + const char* atomicFp16DataTypes[numFp16DataTypes] = { + "f16vec2", + "f16vec4" + }; + // Loop twice to add prototypes with/without scope/semantics + for (int j = 0; j < numFp16DataTypes; ++j) { + for (int i = 0; i < numFp16Builtins; ++i) { + commonBuiltins.append(atomicFp16DataTypes[j]); + commonBuiltins.append(atomicFp16Func[i]); + commonBuiltins.append(imageParams); + commonBuiltins.append(", "); + commonBuiltins.append(atomicFp16DataTypes[j]); + commonBuiltins.append(");\n"); + } + } + } + + if (profile != EEsProfile && version >= 450) { + commonBuiltins.append("float imageAtomicAdd(volatile coherent nontemporal "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", float);\n"); + + commonBuiltins.append("float imageAtomicAdd(volatile coherent nontemporal "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", float"); + commonBuiltins.append(", int, int, int);\n"); + + commonBuiltins.append("float imageAtomicExchange(volatile coherent nontemporal "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", float);\n"); + + commonBuiltins.append("float imageAtomicExchange(volatile coherent nontemporal "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", float"); + commonBuiltins.append(", int, int, int);\n"); + + commonBuiltins.append("float imageAtomicLoad(readonly volatile coherent nontemporal "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", int, int, int);\n"); + + commonBuiltins.append("void imageAtomicStore(writeonly volatile coherent nontemporal "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", float"); + commonBuiltins.append(", int, int, int);\n"); + + commonBuiltins.append("float imageAtomicMin(volatile coherent nontemporal "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", float);\n"); + + commonBuiltins.append("float imageAtomicMin(volatile coherent nontemporal "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", float"); + commonBuiltins.append(", int, int, int);\n"); + + commonBuiltins.append("float imageAtomicMax(volatile coherent nontemporal "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", float);\n"); + + commonBuiltins.append("float imageAtomicMax(volatile coherent nontemporal "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", float"); + commonBuiltins.append(", int, int, int);\n"); + } + } + } + + if (sampler.dim == EsdRect || sampler.dim == EsdBuffer || sampler.shadow || sampler.isMultiSample()) + return; + + if (profile == EEsProfile || version < 450) + return; + + TString imageLodParams = typeName; + if (dims == 1) + imageLodParams.append(", int"); + else { + imageLodParams.append(", ivec"); + imageLodParams.append(postfixes[dims]); + } + imageLodParams.append(", int"); + + commonBuiltins.append(prefixes[sampler.type]); + commonBuiltins.append("vec4 imageLoadLodAMD(readonly volatile coherent nontemporal "); + commonBuiltins.append(imageLodParams); + commonBuiltins.append(");\n"); + + commonBuiltins.append("void imageStoreLodAMD(writeonly volatile coherent nontemporal "); + commonBuiltins.append(imageLodParams); + commonBuiltins.append(", "); + commonBuiltins.append(prefixes[sampler.type]); + commonBuiltins.append("vec4);\n"); + + if (! sampler.is1D()) { + commonBuiltins.append("int sparseImageLoadLodAMD(readonly volatile coherent nontemporal "); + commonBuiltins.append(imageLodParams); + commonBuiltins.append(", out "); + commonBuiltins.append(prefixes[sampler.type]); + commonBuiltins.append("vec4"); + commonBuiltins.append(");\n"); + } +} + +// +// Helper function for initialize(), +// when adding context-independent built-in functions. +// +// Add all the subpass access functions for the given type. +// +void TBuiltIns::addSubpassSampling(TSampler sampler, const TString& typeName, int /*version*/, EProfile /*profile*/) +{ + stageBuiltins[EShLangFragment].append(prefixes[sampler.type]); + stageBuiltins[EShLangFragment].append("vec4 subpassLoad"); + stageBuiltins[EShLangFragment].append("("); + stageBuiltins[EShLangFragment].append(typeName.c_str()); + if (sampler.isMultiSample()) + stageBuiltins[EShLangFragment].append(", int"); + stageBuiltins[EShLangFragment].append(");\n"); +} + +// +// Helper function for add2ndGenerationSamplingImaging(), +// when adding context-independent built-in functions. +// +// Add all the texture lookup functions for the given type. +// +void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile) +{ + // + // texturing + // + for (int proj = 0; proj <= 1; ++proj) { // loop over "bool" projective or not + + if (proj && (sampler.dim == EsdCube || sampler.isBuffer() || sampler.arrayed || sampler.isMultiSample() + || !sampler.isCombined())) + continue; + + for (int lod = 0; lod <= 1; ++lod) { + + if (lod && (sampler.isBuffer() || sampler.isRect() || sampler.isMultiSample() || !sampler.isCombined())) + continue; + if (lod && sampler.dim == Esd2D && sampler.arrayed && sampler.shadow) + continue; + if (lod && sampler.dim == EsdCube && sampler.shadow) + continue; + + for (int bias = 0; bias <= 1; ++bias) { + + if (bias && (lod || sampler.isMultiSample() || !sampler.isCombined())) + continue; + if (bias && (sampler.dim == Esd2D || sampler.dim == EsdCube) && sampler.shadow && sampler.arrayed) + continue; + if (bias && (sampler.isRect() || sampler.isBuffer())) + continue; + + for (int offset = 0; offset <= 1; ++offset) { // loop over "bool" offset or not + + if (proj + offset + bias + lod > 3) + continue; + if (offset && (sampler.dim == EsdCube || sampler.isBuffer() || sampler.isMultiSample())) + continue; + + for (int fetch = 0; fetch <= 1; ++fetch) { // loop over "bool" fetch or not + + if (proj + offset + fetch + bias + lod > 3) + continue; + if (fetch && (lod || bias)) + continue; + if (fetch && (sampler.shadow || sampler.dim == EsdCube)) + continue; + if (fetch == 0 && (sampler.isMultiSample() || sampler.isBuffer() + || !sampler.isCombined())) + continue; + + for (int grad = 0; grad <= 1; ++grad) { // loop over "bool" grad or not + + if (grad && (lod || bias || sampler.isMultiSample() || !sampler.isCombined())) + continue; + if (grad && sampler.isBuffer()) + continue; + if (proj + offset + fetch + grad + bias + lod > 3) + continue; + + for (int extraProj = 0; extraProj <= 1; ++extraProj) { + bool compare = false; + int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); + // skip dummy unused second component for 1D non-array shadows + if (sampler.shadow && totalDims < 2) + totalDims = 2; + totalDims += (sampler.shadow ? 1 : 0) + proj; + if (totalDims > 4 && sampler.shadow) { + compare = true; + totalDims = 4; + } + assert(totalDims <= 4); + + if (extraProj && ! proj) + continue; + if (extraProj && (sampler.dim == Esd3D || sampler.shadow || !sampler.isCombined())) + continue; + + // loop over 16-bit floating-point texel addressing + for (int f16TexAddr = 0; f16TexAddr <= 1; ++f16TexAddr) + { + if (f16TexAddr && sampler.type != EbtFloat16) + continue; + if (f16TexAddr && sampler.shadow && ! compare) { + compare = true; // compare argument is always present + totalDims--; + } + // loop over "bool" lod clamp + for (int lodClamp = 0; lodClamp <= 1 ;++lodClamp) + { + if (lodClamp && (profile == EEsProfile || version < 450)) + continue; + if (lodClamp && (proj || lod || fetch)) + continue; + + // loop over "bool" sparse or not + for (int sparse = 0; sparse <= 1; ++sparse) + { + if (sparse && (profile == EEsProfile || version < 450)) + continue; + // Sparse sampling is not for 1D/1D array texture, buffer texture, and + // projective texture + if (sparse && (sampler.is1D() || sampler.isBuffer() || proj)) + continue; + + TString s; + + // return type + if (sparse) + s.append("int "); + else { + if (sampler.shadow) + if (sampler.type == EbtFloat16) + s.append("float16_t "); + else + s.append("float "); + else { + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } + } + + // name + if (sparse) { + if (fetch) + s.append("sparseTexel"); + else + s.append("sparseTexture"); + } + else { + if (fetch) + s.append("texel"); + else + s.append("texture"); + } + if (proj) + s.append("Proj"); + if (lod) + s.append("Lod"); + if (grad) + s.append("Grad"); + if (fetch) + s.append("Fetch"); + if (offset) + s.append("Offset"); + if (lodClamp) + s.append("Clamp"); + if (lodClamp != 0 || sparse) + s.append("ARB"); + s.append("("); + + // sampler type + s.append(typeName); + // P coordinate + if (extraProj) { + if (f16TexAddr) + s.append(",f16vec4"); + else + s.append(",vec4"); + } else { + s.append(","); + TBasicType t = fetch ? EbtInt : (f16TexAddr ? EbtFloat16 : EbtFloat); + if (totalDims == 1) + s.append(TType::getBasicString(t)); + else { + s.append(prefixes[t]); + s.append("vec"); + s.append(postfixes[totalDims]); + } + } + // non-optional compare + if (compare) + s.append(",float"); + + // non-optional lod argument (lod that's not driven by lod loop) or sample + if ((fetch && !sampler.isBuffer() && + !sampler.isRect() && !sampler.isMultiSample()) + || (sampler.isMultiSample() && fetch)) + s.append(",int"); + // non-optional lod + if (lod) { + if (f16TexAddr) + s.append(",float16_t"); + else + s.append(",float"); + } + + // gradient arguments + if (grad) { + if (dimMap[sampler.dim] == 1) { + if (f16TexAddr) + s.append(",float16_t,float16_t"); + else + s.append(",float,float"); + } else { + if (f16TexAddr) + s.append(",f16vec"); + else + s.append(",vec"); + s.append(postfixes[dimMap[sampler.dim]]); + if (f16TexAddr) + s.append(",f16vec"); + else + s.append(",vec"); + s.append(postfixes[dimMap[sampler.dim]]); + } + } + // offset + if (offset) { + if (dimMap[sampler.dim] == 1) + s.append(",int"); + else { + s.append(",ivec"); + s.append(postfixes[dimMap[sampler.dim]]); + } + } + + // lod clamp + if (lodClamp) { + if (f16TexAddr) + s.append(",float16_t"); + else + s.append(",float"); + } + // texel out (for sparse texture) + if (sparse) { + s.append(",out "); + if (sampler.shadow) + if (sampler.type == EbtFloat16) + s.append("float16_t"); + else + s.append("float"); + else { + s.append(prefixes[sampler.type]); + s.append("vec4"); + } + } + // optional bias + if (bias) { + if (f16TexAddr) + s.append(",float16_t"); + else + s.append(",float"); + } + s.append(");\n"); + + // Add to the per-language set of built-ins + if (!grad && (bias || lodClamp != 0)) { + stageBuiltins[EShLangFragment].append(s); + stageBuiltins[EShLangCompute].append(s); + } else + commonBuiltins.append(s); + + } + } + } + } + } + } + } + } + } + } +} + +// +// Helper function for add2ndGenerationSamplingImaging(), +// when adding context-independent built-in functions. +// +// Add all the texture gather functions for the given type. +// +void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile) +{ + switch (sampler.dim) { + case Esd2D: + case EsdRect: + case EsdCube: + break; + default: + return; + } + + if (sampler.isMultiSample()) + return; + + if (version < 140 && sampler.dim == EsdRect && sampler.type != EbtFloat) + return; + + for (int f16TexAddr = 0; f16TexAddr <= 1; ++f16TexAddr) { // loop over 16-bit floating-point texel addressing + + if (f16TexAddr && sampler.type != EbtFloat16) + continue; + for (int offset = 0; offset < 3; ++offset) { // loop over three forms of offset in the call name: none, Offset, and Offsets + + for (int comp = 0; comp < 2; ++comp) { // loop over presence of comp argument + + if (comp > 0 && sampler.shadow) + continue; + + if (offset > 0 && sampler.dim == EsdCube) + continue; + + for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not + if (sparse && (profile == EEsProfile || version < 450)) + continue; + + TString s; + + // return type + if (sparse) + s.append("int "); + else { + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } + + // name + if (sparse) + s.append("sparseTextureGather"); + else + s.append("textureGather"); + switch (offset) { + case 1: + s.append("Offset"); + break; + case 2: + s.append("Offsets"); + break; + default: + break; + } + if (sparse) + s.append("ARB"); + s.append("("); + + // sampler type argument + s.append(typeName); + + // P coordinate argument + if (f16TexAddr) + s.append(",f16vec"); + else + s.append(",vec"); + int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); + s.append(postfixes[totalDims]); + + // refZ argument + if (sampler.shadow) + s.append(",float"); + + // offset argument + if (offset > 0) { + s.append(",ivec2"); + if (offset == 2) + s.append("[4]"); + } + + // texel out (for sparse texture) + if (sparse) { + s.append(",out "); + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } + + // comp argument + if (comp) + s.append(",int"); + + s.append(");\n"); + commonBuiltins.append(s); + } + } + } + } + + if (sampler.dim == EsdRect || sampler.shadow) + return; + + if (profile == EEsProfile || version < 450) + return; + + for (int bias = 0; bias < 2; ++bias) { // loop over presence of bias argument + + for (int lod = 0; lod < 2; ++lod) { // loop over presence of lod argument + + if ((lod && bias) || (lod == 0 && bias == 0)) + continue; + + for (int f16TexAddr = 0; f16TexAddr <= 1; ++f16TexAddr) { // loop over 16-bit floating-point texel addressing + + if (f16TexAddr && sampler.type != EbtFloat16) + continue; + + for (int offset = 0; offset < 3; ++offset) { // loop over three forms of offset in the call name: none, Offset, and Offsets + + for (int comp = 0; comp < 2; ++comp) { // loop over presence of comp argument + + if (comp == 0 && bias) + continue; + + if (offset > 0 && sampler.dim == EsdCube) + continue; + + for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not + if (sparse && (profile == EEsProfile || version < 450)) + continue; + + TString s; + + // return type + if (sparse) + s.append("int "); + else { + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } + + // name + if (sparse) + s.append("sparseTextureGather"); + else + s.append("textureGather"); + + if (lod) + s.append("Lod"); + + switch (offset) { + case 1: + s.append("Offset"); + break; + case 2: + s.append("Offsets"); + break; + default: + break; + } + + if (lod) + s.append("AMD"); + else if (sparse) + s.append("ARB"); + + s.append("("); + + // sampler type argument + s.append(typeName); + + // P coordinate argument + if (f16TexAddr) + s.append(",f16vec"); + else + s.append(",vec"); + int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); + s.append(postfixes[totalDims]); + + // lod argument + if (lod) { + if (f16TexAddr) + s.append(",float16_t"); + else + s.append(",float"); + } + + // offset argument + if (offset > 0) { + s.append(",ivec2"); + if (offset == 2) + s.append("[4]"); + } + + // texel out (for sparse texture) + if (sparse) { + s.append(",out "); + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } + + // comp argument + if (comp) + s.append(",int"); + + // bias argument + if (bias) { + if (f16TexAddr) + s.append(",float16_t"); + else + s.append(",float"); + } + + s.append(");\n"); + if (bias) + stageBuiltins[EShLangFragment].append(s); + else + commonBuiltins.append(s); + } + } + } + } + } + } +} + +// +// Add context-dependent built-in functions and variables that are present +// for the given version and profile. All the results are put into just the +// commonBuiltins, because it is called for just a specific stage. So, +// add stage-specific entries to the commonBuiltins, and only if that stage +// was requested. +// +void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language) +{ + // + // Initialize the context-dependent (resource-dependent) built-in strings for parsing. + // + + //============================================================================ + // + // Standard Uniforms + // + //============================================================================ + + TString& s = commonBuiltins; + const int maxSize = 200; + char builtInConstant[maxSize]; + + // + // Build string of implementation dependent constants. + // + + if (profile == EEsProfile) { + snprintf(builtInConstant, maxSize, "const mediump int gl_MaxVertexAttribs = %d;", resources.maxVertexAttribs); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const mediump int gl_MaxVertexUniformVectors = %d;", resources.maxVertexUniformVectors); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const mediump int gl_MaxVertexTextureImageUnits = %d;", resources.maxVertexTextureImageUnits); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const mediump int gl_MaxCombinedTextureImageUnits = %d;", resources.maxCombinedTextureImageUnits); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const mediump int gl_MaxTextureImageUnits = %d;", resources.maxTextureImageUnits); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const mediump int gl_MaxFragmentUniformVectors = %d;", resources.maxFragmentUniformVectors); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const mediump int gl_MaxDrawBuffers = %d;", resources.maxDrawBuffers); + s.append(builtInConstant); + + if (version == 100) { + snprintf(builtInConstant, maxSize, "const mediump int gl_MaxVaryingVectors = %d;", resources.maxVaryingVectors); + s.append(builtInConstant); + } else { + snprintf(builtInConstant, maxSize, "const mediump int gl_MaxVertexOutputVectors = %d;", resources.maxVertexOutputVectors); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const mediump int gl_MaxFragmentInputVectors = %d;", resources.maxFragmentInputVectors); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const mediump int gl_MinProgramTexelOffset = %d;", resources.minProgramTexelOffset); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const mediump int gl_MaxProgramTexelOffset = %d;", resources.maxProgramTexelOffset); + s.append(builtInConstant); + } + + if (version >= 310) { + // geometry + + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryInputComponents = %d;", resources.maxGeometryInputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryOutputComponents = %d;", resources.maxGeometryOutputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryImageUniforms = %d;", resources.maxGeometryImageUniforms); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryTextureImageUnits = %d;", resources.maxGeometryTextureImageUnits); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryOutputVertices = %d;", resources.maxGeometryOutputVertices); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryTotalOutputComponents = %d;", resources.maxGeometryTotalOutputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryUniformComponents = %d;", resources.maxGeometryUniformComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryAtomicCounters = %d;", resources.maxGeometryAtomicCounters); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryAtomicCounterBuffers = %d;", resources.maxGeometryAtomicCounterBuffers); + s.append(builtInConstant); + + // tessellation + + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlInputComponents = %d;", resources.maxTessControlInputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlOutputComponents = %d;", resources.maxTessControlOutputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlTextureImageUnits = %d;", resources.maxTessControlTextureImageUnits); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlUniformComponents = %d;", resources.maxTessControlUniformComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlTotalOutputComponents = %d;", resources.maxTessControlTotalOutputComponents); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationInputComponents = %d;", resources.maxTessEvaluationInputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationOutputComponents = %d;", resources.maxTessEvaluationOutputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationTextureImageUnits = %d;", resources.maxTessEvaluationTextureImageUnits); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationUniformComponents = %d;", resources.maxTessEvaluationUniformComponents); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxTessPatchComponents = %d;", resources.maxTessPatchComponents); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxPatchVertices = %d;", resources.maxPatchVertices); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessGenLevel = %d;", resources.maxTessGenLevel); + s.append(builtInConstant); + + // this is here instead of with the others in initialize(version, profile) due to the dependence on gl_MaxPatchVertices + if (language == EShLangTessControl || language == EShLangTessEvaluation) { + s.append( + "in gl_PerVertex {" + "highp vec4 gl_Position;" + "highp float gl_PointSize;" + "highp vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering + "highp vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes + "} gl_in[gl_MaxPatchVertices];" + "\n"); + } + } + + if (version >= 320) { + // tessellation + + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlImageUniforms = %d;", resources.maxTessControlImageUniforms); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationImageUniforms = %d;", resources.maxTessEvaluationImageUniforms); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlAtomicCounters = %d;", resources.maxTessControlAtomicCounters); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationAtomicCounters = %d;", resources.maxTessEvaluationAtomicCounters); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlAtomicCounterBuffers = %d;", resources.maxTessControlAtomicCounterBuffers); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationAtomicCounterBuffers = %d;", resources.maxTessEvaluationAtomicCounterBuffers); + s.append(builtInConstant); + } + + if (version >= 100) { + // GL_EXT_blend_func_extended + snprintf(builtInConstant, maxSize, "const mediump int gl_MaxDualSourceDrawBuffersEXT = %d;", resources.maxDualSourceDrawBuffersEXT); + s.append(builtInConstant); + // this is here instead of with the others in initialize(version, profile) due to the dependence on gl_MaxDualSourceDrawBuffersEXT + if (language == EShLangFragment) { + s.append( + "mediump vec4 gl_SecondaryFragColorEXT;" + "mediump vec4 gl_SecondaryFragDataEXT[gl_MaxDualSourceDrawBuffersEXT];" + "\n"); + } + } + } else { + // non-ES profile + + if (version > 400) { + snprintf(builtInConstant, maxSize, "const int gl_MaxVertexUniformVectors = %d;", resources.maxVertexUniformVectors); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxFragmentUniformVectors = %d;", resources.maxFragmentUniformVectors); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxVaryingVectors = %d;", resources.maxVaryingVectors); + s.append(builtInConstant); + } + + snprintf(builtInConstant, maxSize, "const int gl_MaxVertexAttribs = %d;", resources.maxVertexAttribs); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxVertexTextureImageUnits = %d;", resources.maxVertexTextureImageUnits); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxCombinedTextureImageUnits = %d;", resources.maxCombinedTextureImageUnits); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxTextureImageUnits = %d;", resources.maxTextureImageUnits); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxDrawBuffers = %d;", resources.maxDrawBuffers); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxLights = %d;", resources.maxLights); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxClipPlanes = %d;", resources.maxClipPlanes); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxTextureUnits = %d;", resources.maxTextureUnits); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxTextureCoords = %d;", resources.maxTextureCoords); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxVertexUniformComponents = %d;", resources.maxVertexUniformComponents); + s.append(builtInConstant); + + // Moved from just being deprecated into compatibility profile only as of 4.20 + if (version < 420 || profile == ECompatibilityProfile) { + snprintf(builtInConstant, maxSize, "const int gl_MaxVaryingFloats = %d;", resources.maxVaryingFloats); + s.append(builtInConstant); + } + + snprintf(builtInConstant, maxSize, "const int gl_MaxFragmentUniformComponents = %d;", resources.maxFragmentUniformComponents); + s.append(builtInConstant); + + if (spvVersion.spv == 0 && IncludeLegacy(version, profile, spvVersion)) { + // + // OpenGL'uniform' state. Page numbers are in reference to version + // 1.4 of the OpenGL specification. + // + + // + // Matrix state. p. 31, 32, 37, 39, 40. + // + s.append("uniform mat4 gl_TextureMatrix[gl_MaxTextureCoords];" + + // + // Derived matrix state that provides inverse and transposed versions + // of the matrices above. + // + "uniform mat4 gl_TextureMatrixInverse[gl_MaxTextureCoords];" + + "uniform mat4 gl_TextureMatrixTranspose[gl_MaxTextureCoords];" + + "uniform mat4 gl_TextureMatrixInverseTranspose[gl_MaxTextureCoords];" + + // + // Clip planes p. 42. + // + "uniform vec4 gl_ClipPlane[gl_MaxClipPlanes];" + + // + // Light State p 50, 53, 55. + // + "uniform gl_LightSourceParameters gl_LightSource[gl_MaxLights];" + + // + // Derived state from products of light. + // + "uniform gl_LightProducts gl_FrontLightProduct[gl_MaxLights];" + "uniform gl_LightProducts gl_BackLightProduct[gl_MaxLights];" + + // + // Texture Environment and Generation, p. 152, p. 40-42. + // + "uniform vec4 gl_TextureEnvColor[gl_MaxTextureImageUnits];" + "uniform vec4 gl_EyePlaneS[gl_MaxTextureCoords];" + "uniform vec4 gl_EyePlaneT[gl_MaxTextureCoords];" + "uniform vec4 gl_EyePlaneR[gl_MaxTextureCoords];" + "uniform vec4 gl_EyePlaneQ[gl_MaxTextureCoords];" + "uniform vec4 gl_ObjectPlaneS[gl_MaxTextureCoords];" + "uniform vec4 gl_ObjectPlaneT[gl_MaxTextureCoords];" + "uniform vec4 gl_ObjectPlaneR[gl_MaxTextureCoords];" + "uniform vec4 gl_ObjectPlaneQ[gl_MaxTextureCoords];"); + } + + if (version >= 130) { + snprintf(builtInConstant, maxSize, "const int gl_MaxClipDistances = %d;", resources.maxClipDistances); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxVaryingComponents = %d;", resources.maxVaryingComponents); + s.append(builtInConstant); + + // GL_ARB_shading_language_420pack + snprintf(builtInConstant, maxSize, "const mediump int gl_MinProgramTexelOffset = %d;", resources.minProgramTexelOffset); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const mediump int gl_MaxProgramTexelOffset = %d;", resources.maxProgramTexelOffset); + s.append(builtInConstant); + } + + // geometry + if (version >= 150) { + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryInputComponents = %d;", resources.maxGeometryInputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryOutputComponents = %d;", resources.maxGeometryOutputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryTextureImageUnits = %d;", resources.maxGeometryTextureImageUnits); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryOutputVertices = %d;", resources.maxGeometryOutputVertices); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryTotalOutputComponents = %d;", resources.maxGeometryTotalOutputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryUniformComponents = %d;", resources.maxGeometryUniformComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryVaryingComponents = %d;", resources.maxGeometryVaryingComponents); + s.append(builtInConstant); + + } + + if (version >= 150) { + snprintf(builtInConstant, maxSize, "const int gl_MaxVertexOutputComponents = %d;", resources.maxVertexOutputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxFragmentInputComponents = %d;", resources.maxFragmentInputComponents); + s.append(builtInConstant); + } + + // tessellation + if (version >= 150) { + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlInputComponents = %d;", resources.maxTessControlInputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlOutputComponents = %d;", resources.maxTessControlOutputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlTextureImageUnits = %d;", resources.maxTessControlTextureImageUnits); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlUniformComponents = %d;", resources.maxTessControlUniformComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlTotalOutputComponents = %d;", resources.maxTessControlTotalOutputComponents); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationInputComponents = %d;", resources.maxTessEvaluationInputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationOutputComponents = %d;", resources.maxTessEvaluationOutputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationTextureImageUnits = %d;", resources.maxTessEvaluationTextureImageUnits); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationUniformComponents = %d;", resources.maxTessEvaluationUniformComponents); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxTessPatchComponents = %d;", resources.maxTessPatchComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessGenLevel = %d;", resources.maxTessGenLevel); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxPatchVertices = %d;", resources.maxPatchVertices); + s.append(builtInConstant); + + // this is here instead of with the others in initialize(version, profile) due to the dependence on gl_MaxPatchVertices + if (language == EShLangTessControl || language == EShLangTessEvaluation) { + s.append( + "in gl_PerVertex {" + "vec4 gl_Position;" + "float gl_PointSize;" + "float gl_ClipDistance[];" + ); + if (profile == ECompatibilityProfile) + s.append( + "vec4 gl_ClipVertex;" + "vec4 gl_FrontColor;" + "vec4 gl_BackColor;" + "vec4 gl_FrontSecondaryColor;" + "vec4 gl_BackSecondaryColor;" + "vec4 gl_TexCoord[];" + "float gl_FogFragCoord;" + ); + if (profile != EEsProfile && version >= 450) + s.append( + "float gl_CullDistance[];" + "vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering + "vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes + ); + s.append( + "} gl_in[gl_MaxPatchVertices];" + "\n"); + } + } + + if (version >= 150) { + snprintf(builtInConstant, maxSize, "const int gl_MaxViewports = %d;", resources.maxViewports); + s.append(builtInConstant); + } + + // images + if (version >= 130) { + snprintf(builtInConstant, maxSize, "const int gl_MaxCombinedImageUnitsAndFragmentOutputs = %d;", resources.maxCombinedImageUnitsAndFragmentOutputs); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxImageSamples = %d;", resources.maxImageSamples); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlImageUniforms = %d;", resources.maxTessControlImageUniforms); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationImageUniforms = %d;", resources.maxTessEvaluationImageUniforms); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryImageUniforms = %d;", resources.maxGeometryImageUniforms); + s.append(builtInConstant); + } + + // enhanced layouts + if (version >= 430) { + snprintf(builtInConstant, maxSize, "const int gl_MaxTransformFeedbackBuffers = %d;", resources.maxTransformFeedbackBuffers); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTransformFeedbackInterleavedComponents = %d;", resources.maxTransformFeedbackInterleavedComponents); + s.append(builtInConstant); + } + } + + // compute + if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 420)) { + snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupCount = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupCountX, + resources.maxComputeWorkGroupCountY, + resources.maxComputeWorkGroupCountZ); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupSize = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupSizeX, + resources.maxComputeWorkGroupSizeY, + resources.maxComputeWorkGroupSizeZ); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxComputeUniformComponents = %d;", resources.maxComputeUniformComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxComputeTextureImageUnits = %d;", resources.maxComputeTextureImageUnits); + s.append(builtInConstant); + + // GL_ARM_tensors operands. + snprintf(builtInConstant, maxSize, "const uint gl_TensorOperandsNonTemporalARM = 0x1U;"); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const uint gl_TensorOperandsOutOfBoundsValueARM = 0x2U;"); + s.append(builtInConstant); + + s.append("\n"); + } + + // images (some in compute below) + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 130)) { + snprintf(builtInConstant, maxSize, "const int gl_MaxImageUnits = %d;", resources.maxImageUnits); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxCombinedShaderOutputResources = %d;", resources.maxCombinedShaderOutputResources); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxVertexImageUniforms = %d;", resources.maxVertexImageUniforms); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxFragmentImageUniforms = %d;", resources.maxFragmentImageUniforms); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxCombinedImageUniforms = %d;", resources.maxCombinedImageUniforms); + s.append(builtInConstant); + } + + // compute + if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 420)) { + snprintf(builtInConstant, maxSize, "const int gl_MaxComputeImageUniforms = %d;", resources.maxComputeImageUniforms); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxComputeAtomicCounters = %d;", resources.maxComputeAtomicCounters); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxComputeAtomicCounterBuffers = %d;", resources.maxComputeAtomicCounterBuffers); + s.append(builtInConstant); + + s.append("\n"); + } + + // atomic counters (some in compute below) + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 420)) { + snprintf(builtInConstant, maxSize, "const int gl_MaxVertexAtomicCounters = %d;", resources. maxVertexAtomicCounters); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxFragmentAtomicCounters = %d;", resources. maxFragmentAtomicCounters); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxCombinedAtomicCounters = %d;", resources. maxCombinedAtomicCounters); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxAtomicCounterBindings = %d;", resources. maxAtomicCounterBindings); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxVertexAtomicCounterBuffers = %d;", resources. maxVertexAtomicCounterBuffers); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxFragmentAtomicCounterBuffers = %d;", resources. maxFragmentAtomicCounterBuffers); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxCombinedAtomicCounterBuffers = %d;", resources. maxCombinedAtomicCounterBuffers); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxAtomicCounterBufferSize = %d;", resources. maxAtomicCounterBufferSize); + s.append(builtInConstant); + } + if (profile != EEsProfile && version >= 420) { + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlAtomicCounters = %d;", resources. maxTessControlAtomicCounters); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationAtomicCounters = %d;", resources. maxTessEvaluationAtomicCounters); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryAtomicCounters = %d;", resources. maxGeometryAtomicCounters); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlAtomicCounterBuffers = %d;", resources. maxTessControlAtomicCounterBuffers); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationAtomicCounterBuffers = %d;", resources. maxTessEvaluationAtomicCounterBuffers); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryAtomicCounterBuffers = %d;", resources. maxGeometryAtomicCounterBuffers); + s.append(builtInConstant); + + s.append("\n"); + } + + // GL_ARB_cull_distance + if (profile != EEsProfile && version >= 450) { + snprintf(builtInConstant, maxSize, "const int gl_MaxCullDistances = %d;", resources.maxCullDistances); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxCombinedClipAndCullDistances = %d;", resources.maxCombinedClipAndCullDistances); + s.append(builtInConstant); + } + + // GL_ARB_ES3_1_compatibility + if ((profile != EEsProfile && version >= 450) || + (profile == EEsProfile && version >= 310)) { + snprintf(builtInConstant, maxSize, "const int gl_MaxSamples = %d;", resources.maxSamples); + s.append(builtInConstant); + } + + // SPV_NV_mesh_shader + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + snprintf(builtInConstant, maxSize, "const int gl_MaxMeshOutputVerticesNV = %d;", resources.maxMeshOutputVerticesNV); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxMeshOutputPrimitivesNV = %d;", resources.maxMeshOutputPrimitivesNV); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxMeshWorkGroupSizeNV = ivec3(%d,%d,%d);", resources.maxMeshWorkGroupSizeX_NV, + resources.maxMeshWorkGroupSizeY_NV, + resources.maxMeshWorkGroupSizeZ_NV); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxTaskWorkGroupSizeNV = ivec3(%d,%d,%d);", resources.maxTaskWorkGroupSizeX_NV, + resources.maxTaskWorkGroupSizeY_NV, + resources.maxTaskWorkGroupSizeZ_NV); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxMeshViewCountNV = %d;", resources.maxMeshViewCountNV); + s.append(builtInConstant); + + s.append("\n"); + } + + s.append("\n"); +} + +// +// To support special built-ins that have a special qualifier that cannot be declared textually +// in a shader, like gl_Position. +// +// This lets the type of the built-in be declared textually, and then have just its qualifier be +// updated afterward. +// +// Safe to call even if name is not present. +// +// Only use this for built-in variables that have a special qualifier in TStorageQualifier. +// New built-in variables should use a generic (textually declarable) qualifier in +// TStoraregQualifier and only call BuiltInVariable(). +// +static void SpecialQualifier(const char* name, TStorageQualifier qualifier, TBuiltInVariable builtIn, TSymbolTable& symbolTable) +{ + TSymbol* symbol = symbolTable.find(name); + if (symbol == nullptr) + return; + + TQualifier& symQualifier = symbol->getWritableType().getQualifier(); + symQualifier.storage = qualifier; + symQualifier.builtIn = builtIn; +} + +// +// Modify the symbol's flat decoration. +// +// Safe to call even if name is not present. +// +// Originally written to transform gl_SubGroupSizeARB from uniform to fragment input in Vulkan. +// +static void ModifyFlatDecoration(const char* name, bool flat, TSymbolTable& symbolTable) +{ + TSymbol* symbol = symbolTable.find(name); + if (symbol == nullptr) + return; + + TQualifier& symQualifier = symbol->getWritableType().getQualifier(); + symQualifier.flat = flat; +} + +// +// To tag built-in variables with their TBuiltInVariable enum. Use this when the +// normal declaration text already gets the qualifier right, and all that's needed +// is setting the builtIn field. This should be the normal way for all new +// built-in variables. +// +// If SpecialQualifier() was called, this does not need to be called. +// +// Safe to call even if name is not present. +// +static void BuiltInVariable(const char* name, TBuiltInVariable builtIn, TSymbolTable& symbolTable) +{ + TSymbol* symbol = symbolTable.find(name); + if (symbol == nullptr) + return; + + TQualifier& symQualifier = symbol->getWritableType().getQualifier(); + symQualifier.builtIn = builtIn; +} + +static void RetargetVariable(const char* from, const char* to, TSymbolTable& symbolTable) +{ + symbolTable.retargetSymbol(from, to); +} + +// +// For built-in variables inside a named block. +// SpecialQualifier() won't ever go inside a block; their member's qualifier come +// from the qualification of the block. +// +// See comments above for other detail. +// +static void BuiltInVariable(const char* blockName, const char* name, TBuiltInVariable builtIn, TSymbolTable& symbolTable) +{ + TSymbol* symbol = symbolTable.find(blockName); + if (symbol == nullptr) + return; + + TTypeList& structure = *symbol->getWritableType().getWritableStruct(); + for (int i = 0; i < (int)structure.size(); ++i) { + if (structure[i].type->getFieldName().compare(name) == 0) { + structure[i].type->getQualifier().builtIn = builtIn; + return; + } + } +} + +// +// Finish adding/processing context-independent built-in symbols. +// 1) Programmatically add symbols that could not be added by simple text strings above. +// 2) Map built-in functions to operators, for those that will turn into an operation node +// instead of remaining a function call. +// 3) Tag extension-related symbols added to their base version with their extensions, so +// that if an early version has the extension turned off, there is an error reported on use. +// +void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable) +{ + // + // Tag built-in variables and functions with additional qualifier and extension information + // that cannot be declared with the text strings. + // + + // N.B.: a symbol should only be tagged once, and this function is called multiple times, once + // per stage that's used for this profile. So + // - generally, stick common ones in the fragment stage to ensure they are tagged exactly once + // - for ES, which has different precisions for different stages, the coarsest-grained tagging + // for a built-in used in many stages needs to be once for the fragment stage and once for + // the vertex stage + + switch(language) { + case EShLangVertex: + if (spvVersion.vulkan > 0) { + BuiltInVariable("gl_VertexIndex", EbvVertexIndex, symbolTable); + BuiltInVariable("gl_InstanceIndex", EbvInstanceIndex, symbolTable); + } + + if (spvVersion.vulkan == 0) { + SpecialQualifier("gl_VertexID", EvqVertexId, EbvVertexId, symbolTable); + SpecialQualifier("gl_InstanceID", EvqInstanceId, EbvInstanceId, symbolTable); + if (version < 140) + symbolTable.setVariableExtensions("gl_InstanceID", 1, &E_GL_EXT_draw_instanced); + } + + if (spvVersion.vulkan > 0 && spvVersion.vulkanRelaxed) { + // treat these built-ins as aliases of VertexIndex and InstanceIndex + RetargetVariable("gl_InstanceID", "gl_InstanceIndex", symbolTable); + RetargetVariable("gl_VertexID", "gl_VertexIndex", symbolTable); + } + + if (profile != EEsProfile) { + if (version >= 440) { + symbolTable.setVariableExtensions("gl_BaseVertexARB", 1, &E_GL_ARB_shader_draw_parameters); + symbolTable.setVariableExtensions("gl_BaseInstanceARB", 1, &E_GL_ARB_shader_draw_parameters); + symbolTable.setVariableExtensions("gl_DrawIDARB", 1, &E_GL_ARB_shader_draw_parameters); + BuiltInVariable("gl_BaseVertexARB", EbvBaseVertex, symbolTable); + BuiltInVariable("gl_BaseInstanceARB", EbvBaseInstance, symbolTable); + BuiltInVariable("gl_DrawIDARB", EbvDrawId, symbolTable); + } + if (version >= 460) { + BuiltInVariable("gl_BaseVertex", EbvBaseVertex, symbolTable); + BuiltInVariable("gl_BaseInstance", EbvBaseInstance, symbolTable); + BuiltInVariable("gl_DrawID", EbvDrawId, symbolTable); + } + symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); + + symbolTable.setFunctionExtensions("ballotARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setFunctionExtensions("readInvocationARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setFunctionExtensions("readFirstInvocationARB", 1, &E_GL_ARB_shader_ballot); + + if (version >= 430) { + symbolTable.setFunctionExtensions("anyInvocationARB", 1, &E_GL_ARB_shader_group_vote); + symbolTable.setFunctionExtensions("allInvocationsARB", 1, &E_GL_ARB_shader_group_vote); + symbolTable.setFunctionExtensions("allInvocationsEqualARB", 1, &E_GL_ARB_shader_group_vote); + } + if (version >= 150) { + symbolTable.setFunctionExtensions("anyThreadNV", 1, &E_GL_NV_gpu_shader5); + symbolTable.setFunctionExtensions("allThreadsNV", 1, &E_GL_NV_gpu_shader5); + symbolTable.setFunctionExtensions("allThreadsEqualNV", 1, &E_GL_NV_gpu_shader5); + } + } + + + if (profile != EEsProfile) { + symbolTable.setFunctionExtensions("minInvocationsAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("maxInvocationsAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("addInvocationsAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("minInvocationsNonUniformAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("maxInvocationsNonUniformAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("addInvocationsNonUniformAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("swizzleInvocationsAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("swizzleInvocationsWithPatternAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("writeInvocationAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("mbcntAMD", 1, &E_GL_AMD_shader_ballot); + + symbolTable.setFunctionExtensions("minInvocationsInclusiveScanAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("maxInvocationsInclusiveScanAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("addInvocationsInclusiveScanAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("minInvocationsInclusiveScanNonUniformAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("maxInvocationsInclusiveScanNonUniformAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("addInvocationsInclusiveScanNonUniformAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("minInvocationsExclusiveScanAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("maxInvocationsExclusiveScanAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("addInvocationsExclusiveScanAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("minInvocationsExclusiveScanNonUniformAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("maxInvocationsExclusiveScanNonUniformAMD", 1, &E_GL_AMD_shader_ballot); + symbolTable.setFunctionExtensions("addInvocationsExclusiveScanNonUniformAMD", 1, &E_GL_AMD_shader_ballot); + } + + if (profile != EEsProfile) { + symbolTable.setFunctionExtensions("min3", 1, &E_GL_AMD_shader_trinary_minmax); + symbolTable.setFunctionExtensions("max3", 1, &E_GL_AMD_shader_trinary_minmax); + symbolTable.setFunctionExtensions("mid3", 1, &E_GL_AMD_shader_trinary_minmax); + } + + if (profile != EEsProfile) { + symbolTable.setVariableExtensions("gl_SIMDGroupSizeAMD", 1, &E_GL_AMD_gcn_shader); + SpecialQualifier("gl_SIMDGroupSizeAMD", EvqVaryingIn, EbvSubGroupSize, symbolTable); + + symbolTable.setFunctionExtensions("cubeFaceIndexAMD", 1, &E_GL_AMD_gcn_shader); + symbolTable.setFunctionExtensions("cubeFaceCoordAMD", 1, &E_GL_AMD_gcn_shader); + symbolTable.setFunctionExtensions("timeAMD", 1, &E_GL_AMD_gcn_shader); + } + + if (profile != EEsProfile) { + symbolTable.setFunctionExtensions("fragmentMaskFetchAMD", 1, &E_GL_AMD_shader_fragment_mask); + symbolTable.setFunctionExtensions("fragmentFetchAMD", 1, &E_GL_AMD_shader_fragment_mask); + } + + symbolTable.setFunctionExtensions("countLeadingZeros", 1, &E_GL_INTEL_shader_integer_functions2); + symbolTable.setFunctionExtensions("countTrailingZeros", 1, &E_GL_INTEL_shader_integer_functions2); + symbolTable.setFunctionExtensions("absoluteDifference", 1, &E_GL_INTEL_shader_integer_functions2); + symbolTable.setFunctionExtensions("addSaturate", 1, &E_GL_INTEL_shader_integer_functions2); + symbolTable.setFunctionExtensions("subtractSaturate", 1, &E_GL_INTEL_shader_integer_functions2); + symbolTable.setFunctionExtensions("average", 1, &E_GL_INTEL_shader_integer_functions2); + symbolTable.setFunctionExtensions("averageRounded", 1, &E_GL_INTEL_shader_integer_functions2); + symbolTable.setFunctionExtensions("multiply32x16", 1, &E_GL_INTEL_shader_integer_functions2); + + symbolTable.setFunctionExtensions("textureFootprintNV", 1, &E_GL_NV_shader_texture_footprint); + symbolTable.setFunctionExtensions("textureFootprintClampNV", 1, &E_GL_NV_shader_texture_footprint); + symbolTable.setFunctionExtensions("textureFootprintLodNV", 1, &E_GL_NV_shader_texture_footprint); + symbolTable.setFunctionExtensions("textureFootprintGradNV", 1, &E_GL_NV_shader_texture_footprint); + symbolTable.setFunctionExtensions("textureFootprintGradClampNV", 1, &E_GL_NV_shader_texture_footprint); + // Compatibility variables, vertex only + if (spvVersion.spv == 0) { + BuiltInVariable("gl_Color", EbvColor, symbolTable); + BuiltInVariable("gl_SecondaryColor", EbvSecondaryColor, symbolTable); + BuiltInVariable("gl_Normal", EbvNormal, symbolTable); + BuiltInVariable("gl_Vertex", EbvVertex, symbolTable); + BuiltInVariable("gl_MultiTexCoord0", EbvMultiTexCoord0, symbolTable); + BuiltInVariable("gl_MultiTexCoord1", EbvMultiTexCoord1, symbolTable); + BuiltInVariable("gl_MultiTexCoord2", EbvMultiTexCoord2, symbolTable); + BuiltInVariable("gl_MultiTexCoord3", EbvMultiTexCoord3, symbolTable); + BuiltInVariable("gl_MultiTexCoord4", EbvMultiTexCoord4, symbolTable); + BuiltInVariable("gl_MultiTexCoord5", EbvMultiTexCoord5, symbolTable); + BuiltInVariable("gl_MultiTexCoord6", EbvMultiTexCoord6, symbolTable); + BuiltInVariable("gl_MultiTexCoord7", EbvMultiTexCoord7, symbolTable); + BuiltInVariable("gl_FogCoord", EbvFogFragCoord, symbolTable); + } + + if (profile == EEsProfile) { + if (spvVersion.spv == 0) { + symbolTable.setFunctionExtensions("texture2DGradEXT", 1, &E_GL_EXT_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DProjGradEXT", 1, &E_GL_EXT_shader_texture_lod); + symbolTable.setFunctionExtensions("textureCubeGradEXT", 1, &E_GL_EXT_shader_texture_lod); + if (version == 310) + symbolTable.setFunctionExtensions("textureGatherOffsets", Num_AEP_gpu_shader5, AEP_gpu_shader5); + } + if (version == 310) { + symbolTable.setFunctionExtensions("fma", Num_AEP_gpu_shader5, AEP_gpu_shader5); + } else if (profile != EEsProfile && version >= 150) { + symbolTable.setFunctionExtensions("fma", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); + } + } + + if (profile == EEsProfile && version < 320) { + symbolTable.setFunctionExtensions("imageAtomicAdd", 1, &E_GL_OES_shader_image_atomic); + symbolTable.setFunctionExtensions("imageAtomicMin", 1, &E_GL_OES_shader_image_atomic); + symbolTable.setFunctionExtensions("imageAtomicMax", 1, &E_GL_OES_shader_image_atomic); + symbolTable.setFunctionExtensions("imageAtomicAnd", 1, &E_GL_OES_shader_image_atomic); + symbolTable.setFunctionExtensions("imageAtomicOr", 1, &E_GL_OES_shader_image_atomic); + symbolTable.setFunctionExtensions("imageAtomicXor", 1, &E_GL_OES_shader_image_atomic); + symbolTable.setFunctionExtensions("imageAtomicExchange", 1, &E_GL_OES_shader_image_atomic); + symbolTable.setFunctionExtensions("imageAtomicCompSwap", 1, &E_GL_OES_shader_image_atomic); + } + + if (version >= 300 /* both ES and non-ES */) { + symbolTable.setVariableExtensions("gl_ViewID_OVR", Num_OVR_multiview_EXTs, OVR_multiview_EXTs); + BuiltInVariable("gl_ViewID_OVR", EbvViewIndex, symbolTable); + } + + if (profile == EEsProfile) { + symbolTable.setFunctionExtensions("shadow2DEXT", 1, &E_GL_EXT_shadow_samplers); + symbolTable.setFunctionExtensions("shadow2DProjEXT", 1, &E_GL_EXT_shadow_samplers); + } + + // E_GL_EXT_texture_array + if (profile != EEsProfile && spvVersion.spv == 0) { + symbolTable.setFunctionExtensions("texture1DArray", 1, &E_GL_EXT_texture_array); + symbolTable.setFunctionExtensions("texture2DArray", 1, &E_GL_EXT_texture_array); + symbolTable.setFunctionExtensions("shadow1DArray", 1, &E_GL_EXT_texture_array); + symbolTable.setFunctionExtensions("shadow2DArray", 1, &E_GL_EXT_texture_array); + + symbolTable.setFunctionExtensions("texture1DArrayLod", 1, &E_GL_EXT_texture_array); + symbolTable.setFunctionExtensions("texture2DArrayLod", 1, &E_GL_EXT_texture_array); + symbolTable.setFunctionExtensions("shadow1DArrayLod", 1, &E_GL_EXT_texture_array); + } + [[fallthrough]]; + + case EShLangTessControl: + if (profile == EEsProfile && version >= 310) { + BuiltInVariable("gl_BoundingBoxEXT", EbvBoundingBox, symbolTable); + symbolTable.setVariableExtensions("gl_BoundingBoxEXT", 1, + &E_GL_EXT_primitive_bounding_box); + BuiltInVariable("gl_BoundingBoxOES", EbvBoundingBox, symbolTable); + symbolTable.setVariableExtensions("gl_BoundingBoxOES", 1, + &E_GL_OES_primitive_bounding_box); + + if (version >= 320) { + BuiltInVariable("gl_BoundingBox", EbvBoundingBox, symbolTable); + } + } + [[fallthrough]]; + + case EShLangTessEvaluation: + case EShLangGeometry: + SpecialQualifier("gl_Position", EvqPosition, EbvPosition, symbolTable); + SpecialQualifier("gl_PointSize", EvqPointSize, EbvPointSize, symbolTable); + + BuiltInVariable("gl_in", "gl_Position", EbvPosition, symbolTable); + BuiltInVariable("gl_in", "gl_PointSize", EbvPointSize, symbolTable); + + BuiltInVariable("gl_out", "gl_Position", EbvPosition, symbolTable); + BuiltInVariable("gl_out", "gl_PointSize", EbvPointSize, symbolTable); + + SpecialQualifier("gl_ClipVertex", EvqClipVertex, EbvClipVertex, symbolTable); + + BuiltInVariable("gl_in", "gl_ClipDistance", EbvClipDistance, symbolTable); + BuiltInVariable("gl_in", "gl_CullDistance", EbvCullDistance, symbolTable); + + BuiltInVariable("gl_out", "gl_ClipDistance", EbvClipDistance, symbolTable); + BuiltInVariable("gl_out", "gl_CullDistance", EbvCullDistance, symbolTable); + + BuiltInVariable("gl_ClipDistance", EbvClipDistance, symbolTable); + BuiltInVariable("gl_CullDistance", EbvCullDistance, symbolTable); + BuiltInVariable("gl_PrimitiveIDIn", EbvPrimitiveId, symbolTable); + BuiltInVariable("gl_PrimitiveID", EbvPrimitiveId, symbolTable); + BuiltInVariable("gl_InvocationID", EbvInvocationId, symbolTable); + BuiltInVariable("gl_Layer", EbvLayer, symbolTable); + BuiltInVariable("gl_ViewportIndex", EbvViewportIndex, symbolTable); + + if (language != EShLangGeometry) { + symbolTable.setVariableExtensions("gl_Layer", Num_viewportEXTs, viewportEXTs); + symbolTable.setVariableExtensions("gl_ViewportIndex", Num_viewportEXTs, viewportEXTs); + } + symbolTable.setVariableExtensions("gl_ViewportMask", 1, &E_GL_NV_viewport_array2); + symbolTable.setVariableExtensions("gl_SecondaryPositionNV", 1, &E_GL_NV_stereo_view_rendering); + symbolTable.setVariableExtensions("gl_SecondaryViewportMaskNV", 1, &E_GL_NV_stereo_view_rendering); + symbolTable.setVariableExtensions("gl_PositionPerViewNV", 1, &E_GL_NVX_multiview_per_view_attributes); + symbolTable.setVariableExtensions("gl_ViewportMaskPerViewNV", 1, &E_GL_NVX_multiview_per_view_attributes); + + if (profile != EEsProfile && language == EShLangGeometry && version < 400) { + symbolTable.setVariableExtensions("gl_InvocationID", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); + } + BuiltInVariable("gl_ViewportMask", EbvViewportMaskNV, symbolTable); + BuiltInVariable("gl_SecondaryPositionNV", EbvSecondaryPositionNV, symbolTable); + BuiltInVariable("gl_SecondaryViewportMaskNV", EbvSecondaryViewportMaskNV, symbolTable); + BuiltInVariable("gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable); + BuiltInVariable("gl_ViewportMaskPerViewNV", EbvViewportMaskPerViewNV, symbolTable); + + if (language == EShLangVertex || language == EShLangGeometry) { + symbolTable.setVariableExtensions("gl_in", "gl_SecondaryPositionNV", 1, &E_GL_NV_stereo_view_rendering); + symbolTable.setVariableExtensions("gl_in", "gl_PositionPerViewNV", 1, &E_GL_NVX_multiview_per_view_attributes); + + BuiltInVariable("gl_in", "gl_SecondaryPositionNV", EbvSecondaryPositionNV, symbolTable); + BuiltInVariable("gl_in", "gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable); + } + symbolTable.setVariableExtensions("gl_out", "gl_ViewportMask", 1, &E_GL_NV_viewport_array2); + symbolTable.setVariableExtensions("gl_out", "gl_SecondaryPositionNV", 1, &E_GL_NV_stereo_view_rendering); + symbolTable.setVariableExtensions("gl_out", "gl_SecondaryViewportMaskNV", 1, &E_GL_NV_stereo_view_rendering); + symbolTable.setVariableExtensions("gl_out", "gl_PositionPerViewNV", 1, &E_GL_NVX_multiview_per_view_attributes); + symbolTable.setVariableExtensions("gl_out", "gl_ViewportMaskPerViewNV", 1, &E_GL_NVX_multiview_per_view_attributes); + + BuiltInVariable("gl_out", "gl_ViewportMask", EbvViewportMaskNV, symbolTable); + BuiltInVariable("gl_out", "gl_SecondaryPositionNV", EbvSecondaryPositionNV, symbolTable); + BuiltInVariable("gl_out", "gl_SecondaryViewportMaskNV", EbvSecondaryViewportMaskNV, symbolTable); + BuiltInVariable("gl_out", "gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable); + BuiltInVariable("gl_out", "gl_ViewportMaskPerViewNV", EbvViewportMaskPerViewNV, symbolTable); + + BuiltInVariable("gl_PatchVerticesIn", EbvPatchVertices, symbolTable); + BuiltInVariable("gl_TessLevelOuter", EbvTessLevelOuter, symbolTable); + BuiltInVariable("gl_TessLevelInner", EbvTessLevelInner, symbolTable); + BuiltInVariable("gl_TessCoord", EbvTessCoord, symbolTable); + + if (version < 410) + symbolTable.setVariableExtensions("gl_ViewportIndex", 1, &E_GL_ARB_viewport_array); + + // Compatibility variables + + BuiltInVariable("gl_in", "gl_ClipVertex", EbvClipVertex, symbolTable); + BuiltInVariable("gl_in", "gl_FrontColor", EbvFrontColor, symbolTable); + BuiltInVariable("gl_in", "gl_BackColor", EbvBackColor, symbolTable); + BuiltInVariable("gl_in", "gl_FrontSecondaryColor", EbvFrontSecondaryColor, symbolTable); + BuiltInVariable("gl_in", "gl_BackSecondaryColor", EbvBackSecondaryColor, symbolTable); + BuiltInVariable("gl_in", "gl_TexCoord", EbvTexCoord, symbolTable); + BuiltInVariable("gl_in", "gl_FogFragCoord", EbvFogFragCoord, symbolTable); + + BuiltInVariable("gl_out", "gl_ClipVertex", EbvClipVertex, symbolTable); + BuiltInVariable("gl_out", "gl_FrontColor", EbvFrontColor, symbolTable); + BuiltInVariable("gl_out", "gl_BackColor", EbvBackColor, symbolTable); + BuiltInVariable("gl_out", "gl_FrontSecondaryColor", EbvFrontSecondaryColor, symbolTable); + BuiltInVariable("gl_out", "gl_BackSecondaryColor", EbvBackSecondaryColor, symbolTable); + BuiltInVariable("gl_out", "gl_TexCoord", EbvTexCoord, symbolTable); + BuiltInVariable("gl_out", "gl_FogFragCoord", EbvFogFragCoord, symbolTable); + + BuiltInVariable("gl_ClipVertex", EbvClipVertex, symbolTable); + BuiltInVariable("gl_FrontColor", EbvFrontColor, symbolTable); + BuiltInVariable("gl_BackColor", EbvBackColor, symbolTable); + BuiltInVariable("gl_FrontSecondaryColor", EbvFrontSecondaryColor, symbolTable); + BuiltInVariable("gl_BackSecondaryColor", EbvBackSecondaryColor, symbolTable); + BuiltInVariable("gl_TexCoord", EbvTexCoord, symbolTable); + BuiltInVariable("gl_FogFragCoord", EbvFogFragCoord, symbolTable); + + // gl_PointSize, when it needs to be tied to an extension, is always a member of a block. + // (Sometimes with an instance name, sometimes anonymous). + if (profile == EEsProfile) { + if (language == EShLangGeometry) { + symbolTable.setVariableExtensions("gl_PointSize", Num_AEP_geometry_point_size, AEP_geometry_point_size); + symbolTable.setVariableExtensions("gl_in", "gl_PointSize", Num_AEP_geometry_point_size, AEP_geometry_point_size); + } else if (language == EShLangTessEvaluation || language == EShLangTessControl) { + // gl_in tessellation settings of gl_PointSize are in the context-dependent paths + symbolTable.setVariableExtensions("gl_PointSize", Num_AEP_tessellation_point_size, AEP_tessellation_point_size); + symbolTable.setVariableExtensions("gl_out", "gl_PointSize", Num_AEP_tessellation_point_size, AEP_tessellation_point_size); + } + } + + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); + BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); + symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview); + BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable); + } + + if (profile != EEsProfile) { + BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); + BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); + BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); + BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); + BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); + BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); + + if (spvVersion.vulkan > 0) { + // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan + SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); + if (language == EShLangFragment) + ModifyFlatDecoration("gl_SubGroupSizeARB", true, symbolTable); + } + else + BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); + } + + // GL_ARB_gpu_shader5/GL_NV_gpu_shader5 + if (profile != EEsProfile && version < 400 && language == EShLangGeometry) { + symbolTable.setFunctionExtensions("EmitStreamVertex", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); + symbolTable.setFunctionExtensions("EndStreamPrimitive", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); + } + // GL_KHR_shader_subgroup + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + + BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); + BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); + BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); + BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); + BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); + BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); + BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); + + // GL_NV_shader_sm_builtins + symbolTable.setVariableExtensions("gl_WarpsPerSMNV", 1, &E_GL_NV_shader_sm_builtins); + symbolTable.setVariableExtensions("gl_SMCountNV", 1, &E_GL_NV_shader_sm_builtins); + symbolTable.setVariableExtensions("gl_WarpIDNV", 1, &E_GL_NV_shader_sm_builtins); + symbolTable.setVariableExtensions("gl_SMIDNV", 1, &E_GL_NV_shader_sm_builtins); + BuiltInVariable("gl_WarpsPerSMNV", EbvWarpsPerSM, symbolTable); + BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable); + BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable); + BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable); + + // GL_ARM_shader_core_builtins + symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + + BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable); + BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable); + BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable); + BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable); + BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable); + } + + if (language == EShLangGeometry || language == EShLangVertex) { + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 450)) { + symbolTable.setVariableExtensions("gl_PrimitiveShadingRateEXT", 1, &E_GL_EXT_fragment_shading_rate); + BuiltInVariable("gl_PrimitiveShadingRateEXT", EbvPrimitiveShadingRateKHR, symbolTable); + + symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + } + } + break; + + case EShLangFragment: + SpecialQualifier("gl_FrontFacing", EvqFace, EbvFace, symbolTable); + SpecialQualifier("gl_FragCoord", EvqFragCoord, EbvFragCoord, symbolTable); + SpecialQualifier("gl_PointCoord", EvqPointCoord, EbvPointCoord, symbolTable); + if (spvVersion.spv == 0) + SpecialQualifier("gl_FragColor", EvqFragColor, EbvFragColor, symbolTable); + else { + TSymbol* symbol = symbolTable.find("gl_FragColor"); + if (symbol) { + symbol->getWritableType().getQualifier().storage = EvqVaryingOut; + symbol->getWritableType().getQualifier().layoutLocation = 0; + } + } + SpecialQualifier("gl_FragDepth", EvqFragDepth, EbvFragDepth, symbolTable); + SpecialQualifier("gl_FragDepthEXT", EvqFragDepth, EbvFragDepth, symbolTable); + SpecialQualifier("gl_FragStencilRefARB", EvqFragStencil, EbvFragStencilRef, symbolTable); + SpecialQualifier("gl_HelperInvocation", EvqVaryingIn, EbvHelperInvocation, symbolTable); + + BuiltInVariable("gl_ClipDistance", EbvClipDistance, symbolTable); + BuiltInVariable("gl_CullDistance", EbvCullDistance, symbolTable); + BuiltInVariable("gl_PrimitiveID", EbvPrimitiveId, symbolTable); + + if (profile != EEsProfile && version >= 140) { + symbolTable.setVariableExtensions("gl_FragStencilRefARB", 1, &E_GL_ARB_shader_stencil_export); + BuiltInVariable("gl_FragStencilRefARB", EbvFragStencilRef, symbolTable); + } + + if (profile != EEsProfile && version < 400) { + symbolTable.setFunctionExtensions("textureQueryLOD", 1, &E_GL_ARB_texture_query_lod); + } + + if (profile != EEsProfile && version >= 460) { + symbolTable.setFunctionExtensions("rayQueryInitializeEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryTerminateEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGenerateIntersectionEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryConfirmIntersectionEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryProceedEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionTypeEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionTEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetRayFlagsEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetRayTMinEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionInstanceCustomIndexEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionInstanceIdEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionGeometryIndexEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionPrimitiveIndexEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionBarycentricsEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionFrontFaceEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionCandidateAABBOpaqueEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionObjectRayDirectionEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionObjectRayOriginEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionObjectToWorldEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionWorldToObjectEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetWorldRayOriginEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetWorldRayDirectionEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionTriangleVertexPositionsEXT", 1, &E_GL_EXT_ray_tracing_position_fetch); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionClusterIdNV", 1, &E_GL_NV_cluster_acceleration_structure); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionSpherePositionNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionSphereRadiusNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionLSSHitValueNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionLSSPositionsNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionLSSRadiiNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setFunctionExtensions("rayQueryIsSphereHitNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setFunctionExtensions("rayQueryIsLSSHitNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setVariableExtensions("gl_RayFlagsSkipAABBEXT", 1, &E_GL_EXT_ray_flags_primitive_culling); + symbolTable.setVariableExtensions("gl_RayFlagsSkipTrianglesEXT", 1, &E_GL_EXT_ray_flags_primitive_culling); + symbolTable.setVariableExtensions("gl_RayFlagsForceOpacityMicromap2StateEXT", 1, &E_GL_EXT_opacity_micromap); + } + + if ((profile != EEsProfile && version >= 130) || + (profile == EEsProfile && version >= 310)) { + BuiltInVariable("gl_SampleID", EbvSampleId, symbolTable); + BuiltInVariable("gl_SamplePosition", EbvSamplePosition, symbolTable); + BuiltInVariable("gl_SampleMask", EbvSampleMask, symbolTable); + + if (profile != EEsProfile && version < 400) { + BuiltInVariable("gl_SampleMaskIn", EbvSampleMask, symbolTable); + symbolTable.setVariableExtensions("gl_SampleMaskIn", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); + + BuiltInVariable("gl_NumSamples", EbvSampleMask, symbolTable); + + symbolTable.setVariableExtensions("gl_SampleMask", 1, &E_GL_ARB_sample_shading); + symbolTable.setVariableExtensions("gl_SampleID", 1, &E_GL_ARB_sample_shading); + symbolTable.setVariableExtensions("gl_SamplePosition", 1, &E_GL_ARB_sample_shading); + symbolTable.setVariableExtensions("gl_NumSamples", 1, &E_GL_ARB_sample_shading); + } else { + BuiltInVariable("gl_SampleMaskIn", EbvSampleMask, symbolTable); + + if (profile == EEsProfile && version < 320) { + symbolTable.setVariableExtensions("gl_SampleID", 1, &E_GL_OES_sample_variables); + symbolTable.setVariableExtensions("gl_SamplePosition", 1, &E_GL_OES_sample_variables); + symbolTable.setVariableExtensions("gl_SampleMaskIn", 1, &E_GL_OES_sample_variables); + symbolTable.setVariableExtensions("gl_SampleMask", 1, &E_GL_OES_sample_variables); + symbolTable.setVariableExtensions("gl_NumSamples", 1, &E_GL_OES_sample_variables); + } + } + } + + BuiltInVariable("gl_Layer", EbvLayer, symbolTable); + BuiltInVariable("gl_ViewportIndex", EbvViewportIndex, symbolTable); + + // Compatibility variables + + BuiltInVariable("gl_in", "gl_FogFragCoord", EbvFogFragCoord, symbolTable); + BuiltInVariable("gl_in", "gl_TexCoord", EbvTexCoord, symbolTable); + BuiltInVariable("gl_in", "gl_Color", EbvColor, symbolTable); + BuiltInVariable("gl_in", "gl_SecondaryColor", EbvSecondaryColor, symbolTable); + + BuiltInVariable("gl_FogFragCoord", EbvFogFragCoord, symbolTable); + BuiltInVariable("gl_TexCoord", EbvTexCoord, symbolTable); + BuiltInVariable("gl_Color", EbvColor, symbolTable); + BuiltInVariable("gl_SecondaryColor", EbvSecondaryColor, symbolTable); + + // built-in functions + + if (profile == EEsProfile) { + if (spvVersion.spv == 0) { + symbolTable.setFunctionExtensions("texture2DLodEXT", 1, &E_GL_EXT_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DProjLodEXT", 1, &E_GL_EXT_shader_texture_lod); + symbolTable.setFunctionExtensions("textureCubeLodEXT", 1, &E_GL_EXT_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DGradEXT", 1, &E_GL_EXT_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DProjGradEXT", 1, &E_GL_EXT_shader_texture_lod); + symbolTable.setFunctionExtensions("textureCubeGradEXT", 1, &E_GL_EXT_shader_texture_lod); + if (version < 320) + symbolTable.setFunctionExtensions("textureGatherOffsets", Num_AEP_gpu_shader5, AEP_gpu_shader5); + } + if (version == 100) { + symbolTable.setFunctionExtensions("dFdx", 1, &E_GL_OES_standard_derivatives); + symbolTable.setFunctionExtensions("dFdy", 1, &E_GL_OES_standard_derivatives); + symbolTable.setFunctionExtensions("fwidth", 1, &E_GL_OES_standard_derivatives); + } + if (version == 310) { + symbolTable.setFunctionExtensions("fma", Num_AEP_gpu_shader5, AEP_gpu_shader5); + symbolTable.setFunctionExtensions("interpolateAtCentroid", 1, &E_GL_OES_shader_multisample_interpolation); + symbolTable.setFunctionExtensions("interpolateAtSample", 1, &E_GL_OES_shader_multisample_interpolation); + symbolTable.setFunctionExtensions("interpolateAtOffset", 1, &E_GL_OES_shader_multisample_interpolation); + } + } else if (version < 130) { + if (spvVersion.spv == 0) { + symbolTable.setFunctionExtensions("texture1DLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture3DLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("textureCubeLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture1DProjLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DProjLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture3DProjLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow1DLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow2DLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow1DProjLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow2DProjLod", 1, &E_GL_ARB_shader_texture_lod); + } + } + + // E_GL_ARB_shader_texture_lod functions usable only with the extension enabled + if (profile != EEsProfile && spvVersion.spv == 0) { + symbolTable.setFunctionExtensions("texture1DGradARB", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture1DProjGradARB", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DGradARB", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DProjGradARB", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture3DGradARB", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture3DProjGradARB", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("textureCubeGradARB", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow1DGradARB", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow1DProjGradARB", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow2DGradARB", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow2DProjGradARB", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DRectGradARB", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DRectProjGradARB", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow2DRectGradARB", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow2DRectProjGradARB", 1, &E_GL_ARB_shader_texture_lod); + } + + // E_GL_ARB_shader_image_load_store + if (profile != EEsProfile && version < 420) + symbolTable.setFunctionExtensions("memoryBarrier", 1, &E_GL_ARB_shader_image_load_store); + // All the image access functions are protected by checks on the type of the first argument. + + // E_GL_ARB_shader_atomic_counters + if (profile != EEsProfile && version < 420) { + symbolTable.setFunctionExtensions("atomicCounterIncrement", 1, &E_GL_ARB_shader_atomic_counters); + symbolTable.setFunctionExtensions("atomicCounterDecrement", 1, &E_GL_ARB_shader_atomic_counters); + symbolTable.setFunctionExtensions("atomicCounter" , 1, &E_GL_ARB_shader_atomic_counters); + } + + // E_GL_ARB_gpu_shader5/E_GL_NV_gpu_shader5 + if (profile != EEsProfile && version < 400) { + symbolTable.setFunctionExtensions("bitfieldExtract", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); + symbolTable.setFunctionExtensions("bitfieldInsert", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); + symbolTable.setFunctionExtensions("bitfieldReverse", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); + symbolTable.setFunctionExtensions("bitCount", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); + symbolTable.setFunctionExtensions("findLSB", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); + symbolTable.setFunctionExtensions("findMSB", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); + symbolTable.setFunctionExtensions("uaddCarry", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); + symbolTable.setFunctionExtensions("usubBorrow", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); + symbolTable.setFunctionExtensions("umulExtended", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); + symbolTable.setFunctionExtensions("imulExtended", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); + symbolTable.setFunctionExtensions("interpolateAtCentroid", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); + symbolTable.setFunctionExtensions("interpolateAtSample", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); + symbolTable.setFunctionExtensions("interpolateAtOffset", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); + } + + // E_GL_NV_gpu_shader5 + if (profile != EEsProfile && version < 450) { + symbolTable.setFunctionExtensions("packInt2x32", 1, &E_GL_NV_gpu_shader5); + symbolTable.setFunctionExtensions("packUint2x32", 1, &E_GL_NV_gpu_shader5); + symbolTable.setFunctionExtensions("unpackInt2x32", 1, &E_GL_NV_gpu_shader5); + symbolTable.setFunctionExtensions("unpackUint2x32", 1, &E_GL_NV_gpu_shader5); + symbolTable.setFunctionExtensions("packFloat2x16", 1, &E_GL_NV_gpu_shader5); + symbolTable.setFunctionExtensions("unpackFloat2x16", 1, &E_GL_NV_gpu_shader5); + symbolTable.setFunctionExtensions("doubleBitsToInt64", 1, &E_GL_NV_gpu_shader5); + symbolTable.setFunctionExtensions("doubleBitsToUint64", 1, &E_GL_NV_gpu_shader5); + symbolTable.setFunctionExtensions("int64BitsToDouble", 1, &E_GL_NV_gpu_shader5); + symbolTable.setFunctionExtensions("uint64BitsToDouble", 1, &E_GL_NV_gpu_shader5); + } + + // E_GL_ARB_shader_atomic_counter_ops + if (profile != EEsProfile && version == 450) { + symbolTable.setFunctionExtensions("atomicCounterAddARB" , 1, &E_GL_ARB_shader_atomic_counter_ops); + symbolTable.setFunctionExtensions("atomicCounterSubtractARB", 1, &E_GL_ARB_shader_atomic_counter_ops); + symbolTable.setFunctionExtensions("atomicCounterMinARB" , 1, &E_GL_ARB_shader_atomic_counter_ops); + symbolTable.setFunctionExtensions("atomicCounterMaxARB" , 1, &E_GL_ARB_shader_atomic_counter_ops); + symbolTable.setFunctionExtensions("atomicCounterAndARB" , 1, &E_GL_ARB_shader_atomic_counter_ops); + symbolTable.setFunctionExtensions("atomicCounterOrARB" , 1, &E_GL_ARB_shader_atomic_counter_ops); + symbolTable.setFunctionExtensions("atomicCounterXorARB" , 1, &E_GL_ARB_shader_atomic_counter_ops); + symbolTable.setFunctionExtensions("atomicCounterExchangeARB", 1, &E_GL_ARB_shader_atomic_counter_ops); + symbolTable.setFunctionExtensions("atomicCounterCompSwapARB", 1, &E_GL_ARB_shader_atomic_counter_ops); + } + + // E_GL_ARB_derivative_control + if (profile != EEsProfile && version < 450) { + symbolTable.setFunctionExtensions("dFdxFine", 1, &E_GL_ARB_derivative_control); + symbolTable.setFunctionExtensions("dFdyFine", 1, &E_GL_ARB_derivative_control); + symbolTable.setFunctionExtensions("fwidthFine", 1, &E_GL_ARB_derivative_control); + symbolTable.setFunctionExtensions("dFdxCoarse", 1, &E_GL_ARB_derivative_control); + symbolTable.setFunctionExtensions("dFdyCoarse", 1, &E_GL_ARB_derivative_control); + symbolTable.setFunctionExtensions("fwidthCoarse", 1, &E_GL_ARB_derivative_control); + } + + // E_GL_ARB_sparse_texture2 + if (profile != EEsProfile) + { + symbolTable.setFunctionExtensions("sparseTextureARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureLodARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureOffsetARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTexelFetchARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTexelFetchOffsetARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureLodOffsetARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureGradARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureGradOffsetARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureGatherARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureGatherOffsetARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureGatherOffsetsARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseImageLoadARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTexelsResident", 1, &E_GL_ARB_sparse_texture2); + } + + // E_GL_ARB_sparse_texture_clamp + if (profile != EEsProfile) + { + symbolTable.setFunctionExtensions("sparseTextureClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("sparseTextureOffsetClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("sparseTextureGradClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("sparseTextureGradOffsetClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("textureClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("textureOffsetClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("textureGradClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("textureGradOffsetClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + } + + // E_GL_AMD_shader_explicit_vertex_parameter + if (profile != EEsProfile) { + symbolTable.setVariableExtensions("gl_BaryCoordNoPerspAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter); + symbolTable.setVariableExtensions("gl_BaryCoordNoPerspCentroidAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter); + symbolTable.setVariableExtensions("gl_BaryCoordNoPerspSampleAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter); + symbolTable.setVariableExtensions("gl_BaryCoordSmoothAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter); + symbolTable.setVariableExtensions("gl_BaryCoordSmoothCentroidAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter); + symbolTable.setVariableExtensions("gl_BaryCoordSmoothSampleAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter); + symbolTable.setVariableExtensions("gl_BaryCoordPullModelAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter); + + symbolTable.setFunctionExtensions("interpolateAtVertexAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter); + + BuiltInVariable("gl_BaryCoordNoPerspAMD", EbvBaryCoordNoPersp, symbolTable); + BuiltInVariable("gl_BaryCoordNoPerspCentroidAMD", EbvBaryCoordNoPerspCentroid, symbolTable); + BuiltInVariable("gl_BaryCoordNoPerspSampleAMD", EbvBaryCoordNoPerspSample, symbolTable); + BuiltInVariable("gl_BaryCoordSmoothAMD", EbvBaryCoordSmooth, symbolTable); + BuiltInVariable("gl_BaryCoordSmoothCentroidAMD", EbvBaryCoordSmoothCentroid, symbolTable); + BuiltInVariable("gl_BaryCoordSmoothSampleAMD", EbvBaryCoordSmoothSample, symbolTable); + BuiltInVariable("gl_BaryCoordPullModelAMD", EbvBaryCoordPullModel, symbolTable); + } + + // E_GL_AMD_texture_gather_bias_lod + if (profile != EEsProfile) { + symbolTable.setFunctionExtensions("textureGatherLodAMD", 1, &E_GL_AMD_texture_gather_bias_lod); + symbolTable.setFunctionExtensions("textureGatherLodOffsetAMD", 1, &E_GL_AMD_texture_gather_bias_lod); + symbolTable.setFunctionExtensions("textureGatherLodOffsetsAMD", 1, &E_GL_AMD_texture_gather_bias_lod); + symbolTable.setFunctionExtensions("sparseTextureGatherLodAMD", 1, &E_GL_AMD_texture_gather_bias_lod); + symbolTable.setFunctionExtensions("sparseTextureGatherLodOffsetAMD", 1, &E_GL_AMD_texture_gather_bias_lod); + symbolTable.setFunctionExtensions("sparseTextureGatherLodOffsetsAMD", 1, &E_GL_AMD_texture_gather_bias_lod); + } + + // E_GL_AMD_shader_image_load_store_lod + if (profile != EEsProfile) { + symbolTable.setFunctionExtensions("imageLoadLodAMD", 1, &E_GL_AMD_shader_image_load_store_lod); + symbolTable.setFunctionExtensions("imageStoreLodAMD", 1, &E_GL_AMD_shader_image_load_store_lod); + symbolTable.setFunctionExtensions("sparseImageLoadLodAMD", 1, &E_GL_AMD_shader_image_load_store_lod); + } + if (profile != EEsProfile && version >= 430) { + symbolTable.setVariableExtensions("gl_FragFullyCoveredNV", 1, &E_GL_NV_conservative_raster_underestimation); + BuiltInVariable("gl_FragFullyCoveredNV", EbvFragFullyCoveredNV, symbolTable); + } + if ((profile != EEsProfile && version >= 450) || + (profile == EEsProfile && version >= 320)) { + symbolTable.setVariableExtensions("gl_FragmentSizeNV", 1, &E_GL_NV_shading_rate_image); + symbolTable.setVariableExtensions("gl_InvocationsPerPixelNV", 1, &E_GL_NV_shading_rate_image); + BuiltInVariable("gl_FragmentSizeNV", EbvFragmentSizeNV, symbolTable); + BuiltInVariable("gl_InvocationsPerPixelNV", EbvInvocationsPerPixelNV, symbolTable); + symbolTable.setVariableExtensions("gl_BaryCoordNV", 1, &E_GL_NV_fragment_shader_barycentric); + symbolTable.setVariableExtensions("gl_BaryCoordNoPerspNV", 1, &E_GL_NV_fragment_shader_barycentric); + BuiltInVariable("gl_BaryCoordNV", EbvBaryCoordNV, symbolTable); + BuiltInVariable("gl_BaryCoordNoPerspNV", EbvBaryCoordNoPerspNV, symbolTable); + symbolTable.setVariableExtensions("gl_BaryCoordEXT", 1, &E_GL_EXT_fragment_shader_barycentric); + symbolTable.setVariableExtensions("gl_BaryCoordNoPerspEXT", 1, &E_GL_EXT_fragment_shader_barycentric); + BuiltInVariable("gl_BaryCoordEXT", EbvBaryCoordEXT, symbolTable); + BuiltInVariable("gl_BaryCoordNoPerspEXT", EbvBaryCoordNoPerspEXT, symbolTable); + } + + if ((profile != EEsProfile && version >= 450) || + (profile == EEsProfile && version >= 310)) { + symbolTable.setVariableExtensions("gl_FragSizeEXT", 1, &E_GL_EXT_fragment_invocation_density); + symbolTable.setVariableExtensions("gl_FragInvocationCountEXT", 1, &E_GL_EXT_fragment_invocation_density); + BuiltInVariable("gl_FragSizeEXT", EbvFragSizeEXT, symbolTable); + BuiltInVariable("gl_FragInvocationCountEXT", EbvFragInvocationCountEXT, symbolTable); + } + + symbolTable.setVariableExtensions("gl_FragDepthEXT", 1, &E_GL_EXT_frag_depth); + + symbolTable.setFunctionExtensions("clockARB", 1, &E_GL_ARB_shader_clock); + symbolTable.setFunctionExtensions("clock2x32ARB", 1, &E_GL_ARB_shader_clock); + + symbolTable.setFunctionExtensions("clockRealtimeEXT", 1, &E_GL_EXT_shader_realtime_clock); + symbolTable.setFunctionExtensions("clockRealtime2x32EXT", 1, &E_GL_EXT_shader_realtime_clock); + + if (profile == EEsProfile && version < 320) { + symbolTable.setVariableExtensions("gl_PrimitiveID", Num_AEP_geometry_shader, AEP_geometry_shader); + symbolTable.setVariableExtensions("gl_Layer", Num_AEP_geometry_shader, AEP_geometry_shader); + } + + if (profile == EEsProfile && version < 320) { + symbolTable.setFunctionExtensions("imageAtomicAdd", 1, &E_GL_OES_shader_image_atomic); + symbolTable.setFunctionExtensions("imageAtomicMin", 1, &E_GL_OES_shader_image_atomic); + symbolTable.setFunctionExtensions("imageAtomicMax", 1, &E_GL_OES_shader_image_atomic); + symbolTable.setFunctionExtensions("imageAtomicAnd", 1, &E_GL_OES_shader_image_atomic); + symbolTable.setFunctionExtensions("imageAtomicOr", 1, &E_GL_OES_shader_image_atomic); + symbolTable.setFunctionExtensions("imageAtomicXor", 1, &E_GL_OES_shader_image_atomic); + symbolTable.setFunctionExtensions("imageAtomicExchange", 1, &E_GL_OES_shader_image_atomic); + symbolTable.setFunctionExtensions("imageAtomicCompSwap", 1, &E_GL_OES_shader_image_atomic); + } + + if (profile != EEsProfile && version < 330 ) { + const int numBitEncodingExts = 3; + const char* bitEncodingExts[numBitEncodingExts] = { E_GL_ARB_shader_bit_encoding, + E_GL_ARB_gpu_shader5, + E_GL_NV_gpu_shader5}; + symbolTable.setFunctionExtensions("floatBitsToInt", numBitEncodingExts, bitEncodingExts); + symbolTable.setFunctionExtensions("floatBitsToUint", numBitEncodingExts, bitEncodingExts); + symbolTable.setFunctionExtensions("intBitsToFloat", numBitEncodingExts, bitEncodingExts); + symbolTable.setFunctionExtensions("uintBitsToFloat", numBitEncodingExts, bitEncodingExts); + + } + + if (profile != EEsProfile && version < 430 ) { + symbolTable.setFunctionExtensions("imageSize", 1, &E_GL_ARB_shader_image_size); + } + + // GL_ARB_shader_storage_buffer_object + if (profile != EEsProfile && version < 430 ) { + symbolTable.setFunctionExtensions("atomicAdd", 1, &E_GL_ARB_shader_storage_buffer_object); + symbolTable.setFunctionExtensions("atomicMin", 1, &E_GL_ARB_shader_storage_buffer_object); + symbolTable.setFunctionExtensions("atomicMax", 1, &E_GL_ARB_shader_storage_buffer_object); + symbolTable.setFunctionExtensions("atomicAnd", 1, &E_GL_ARB_shader_storage_buffer_object); + symbolTable.setFunctionExtensions("atomicOr", 1, &E_GL_ARB_shader_storage_buffer_object); + symbolTable.setFunctionExtensions("atomicXor", 1, &E_GL_ARB_shader_storage_buffer_object); + symbolTable.setFunctionExtensions("atomicExchange", 1, &E_GL_ARB_shader_storage_buffer_object); + symbolTable.setFunctionExtensions("atomicCompSwap", 1, &E_GL_ARB_shader_storage_buffer_object); + } + + // GL_ARB_shading_language_packing + if (profile != EEsProfile && version < 400 ) { + const int numPackingExts = 3; + const char* packingExts[numPackingExts] = { E_GL_ARB_shading_language_packing, + E_GL_ARB_gpu_shader5, + E_GL_NV_gpu_shader5}; + symbolTable.setFunctionExtensions("packUnorm2x16", numPackingExts, packingExts); + symbolTable.setFunctionExtensions("unpackUnorm2x16", numPackingExts, packingExts); + symbolTable.setFunctionExtensions("packSnorm4x8", numPackingExts, packingExts); + symbolTable.setFunctionExtensions("packUnorm4x8", numPackingExts, packingExts); + symbolTable.setFunctionExtensions("unpackSnorm4x8", numPackingExts, packingExts); + symbolTable.setFunctionExtensions("unpackUnorm4x8", numPackingExts, packingExts); + } + if (profile != EEsProfile && version < 420 ) { + symbolTable.setFunctionExtensions("packSnorm2x16", 1, &E_GL_ARB_shading_language_packing); + symbolTable.setFunctionExtensions("unpackSnorm2x16", 1, &E_GL_ARB_shading_language_packing); + symbolTable.setFunctionExtensions("unpackHalf2x16", 1, &E_GL_ARB_shading_language_packing); + symbolTable.setFunctionExtensions("packHalf2x16", 1, &E_GL_ARB_shading_language_packing); + } + + symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); + BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); + symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview); + BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable); + if (version >= 300 /* both ES and non-ES */) { + symbolTable.setVariableExtensions("gl_ViewID_OVR", Num_OVR_multiview_EXTs, OVR_multiview_EXTs); + BuiltInVariable("gl_ViewID_OVR", EbvViewIndex, symbolTable); + } + + // GL_ARB_shader_ballot + if (profile != EEsProfile) { + symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); + + BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); + BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); + BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); + BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); + BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); + BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); + + if (spvVersion.vulkan > 0) { + // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan + SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); + if (language == EShLangFragment) + ModifyFlatDecoration("gl_SubGroupSizeARB", true, symbolTable); + } + else + BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); + } + + // GL_EXT_expect_assume + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + symbolTable.setFunctionExtensions("assumeEXT", 1, &E_GL_EXT_expect_assume); + symbolTable.setFunctionExtensions("expectEXT", 1, &E_GL_EXT_expect_assume); + } + + // GL_KHR_shader_subgroup + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + + BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); + BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); + BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); + BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); + BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); + BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); + BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); + + symbolTable.setFunctionExtensions("subgroupBarrier", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setFunctionExtensions("subgroupMemoryBarrier", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setFunctionExtensions("subgroupMemoryBarrierBuffer", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setFunctionExtensions("subgroupMemoryBarrierImage", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setFunctionExtensions("subgroupElect", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setFunctionExtensions("subgroupAll", 1, &E_GL_KHR_shader_subgroup_vote); + symbolTable.setFunctionExtensions("subgroupAny", 1, &E_GL_KHR_shader_subgroup_vote); + symbolTable.setFunctionExtensions("subgroupAllEqual", 1, &E_GL_KHR_shader_subgroup_vote); + symbolTable.setFunctionExtensions("subgroupBroadcast", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBroadcastFirst", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallot", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupInverseBallot", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallotBitExtract", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallotBitCount", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallotInclusiveBitCount", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallotExclusiveBitCount", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallotFindLSB", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallotFindMSB", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupShuffle", 1, &E_GL_KHR_shader_subgroup_shuffle); + symbolTable.setFunctionExtensions("subgroupShuffleXor", 1, &E_GL_KHR_shader_subgroup_shuffle); + symbolTable.setFunctionExtensions("subgroupShuffleUp", 1, &E_GL_KHR_shader_subgroup_shuffle_relative); + symbolTable.setFunctionExtensions("subgroupShuffleDown", 1, &E_GL_KHR_shader_subgroup_shuffle_relative); + symbolTable.setFunctionExtensions("subgroupRotate", 1, &E_GL_KHR_shader_subgroup_rotate); + symbolTable.setFunctionExtensions("subgroupClusteredRotate", 1, &E_GL_KHR_shader_subgroup_rotate); + symbolTable.setFunctionExtensions("subgroupAdd", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupMul", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupMin", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupMax", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupAnd", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupOr", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupXor", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveAdd", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveMul", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveMin", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveMax", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveAnd", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveOr", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveXor", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveAdd", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveMul", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveMin", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveMax", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveAnd", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveOr", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveXor", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupClusteredAdd", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupClusteredMul", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupClusteredMin", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupClusteredMax", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupClusteredAnd", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupClusteredOr", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupClusteredXor", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupQuadBroadcast", 1, &E_GL_KHR_shader_subgroup_quad); + symbolTable.setFunctionExtensions("subgroupQuadSwapHorizontal", 1, &E_GL_KHR_shader_subgroup_quad); + symbolTable.setFunctionExtensions("subgroupQuadSwapVertical", 1, &E_GL_KHR_shader_subgroup_quad); + symbolTable.setFunctionExtensions("subgroupQuadSwapDiagonal", 1, &E_GL_KHR_shader_subgroup_quad); + symbolTable.setFunctionExtensions("subgroupPartitionNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedAddNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedMulNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedMinNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedMaxNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedAndNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedOrNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedXorNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveAddNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveMulNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveMinNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveMaxNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveAndNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveOrNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveXorNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveAddNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveMulNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveMinNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveMaxNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveAndNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveOrNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveXorNV", 1, &E_GL_NV_shader_subgroup_partitioned); + + // GL_NV_shader_sm_builtins + symbolTable.setVariableExtensions("gl_WarpsPerSMNV", 1, &E_GL_NV_shader_sm_builtins); + symbolTable.setVariableExtensions("gl_SMCountNV", 1, &E_GL_NV_shader_sm_builtins); + symbolTable.setVariableExtensions("gl_WarpIDNV", 1, &E_GL_NV_shader_sm_builtins); + symbolTable.setVariableExtensions("gl_SMIDNV", 1, &E_GL_NV_shader_sm_builtins); + BuiltInVariable("gl_WarpsPerSMNV", EbvWarpsPerSM, symbolTable); + BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable); + BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable); + BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable); + + // GL_ARM_shader_core_builtins + symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + + BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable); + BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable); + BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable); + BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable); + BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable); + } + + if (profile == EEsProfile) { + symbolTable.setFunctionExtensions("shadow2DEXT", 1, &E_GL_EXT_shadow_samplers); + symbolTable.setFunctionExtensions("shadow2DProjEXT", 1, &E_GL_EXT_shadow_samplers); + } + + if (spvVersion.vulkan > 0) { + symbolTable.setVariableExtensions("gl_ScopeDevice", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_ScopeWorkgroup", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_ScopeSubgroup", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_ScopeInvocation", 1, &E_GL_KHR_memory_scope_semantics); + + symbolTable.setVariableExtensions("gl_SemanticsRelaxed", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_SemanticsAcquire", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_SemanticsRelease", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_SemanticsAcquireRelease", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_SemanticsMakeAvailable", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_SemanticsMakeVisible", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_SemanticsVolatile", 1, &E_GL_KHR_memory_scope_semantics); + + symbolTable.setVariableExtensions("gl_StorageSemanticsNone", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_StorageSemanticsBuffer", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_StorageSemanticsShared", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_StorageSemanticsImage", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_StorageSemanticsOutput", 1, &E_GL_KHR_memory_scope_semantics); + } + + symbolTable.setFunctionExtensions("helperInvocationEXT", 1, &E_GL_EXT_demote_to_helper_invocation); + + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 450)) { + symbolTable.setVariableExtensions("gl_ShadingRateEXT", 1, &E_GL_EXT_fragment_shading_rate); + BuiltInVariable("gl_ShadingRateEXT", EbvShadingRateKHR, symbolTable); + + symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + } + + // GL_EXT_shader_quad_control + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + symbolTable.setFunctionExtensions("subgroupQuadAll", 1, &E_GL_KHR_shader_subgroup_vote); + symbolTable.setFunctionExtensions("subgroupQuadAny", 1, &E_GL_KHR_shader_subgroup_vote); + } + + // GL_EXT_shader_tile_image + symbolTable.setFunctionExtensions("stencilAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image); + symbolTable.setFunctionExtensions("depthAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image); + symbolTable.setFunctionExtensions("colorAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image); + + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + + symbolTable.setFunctionExtensions("textureWeightedQCOM", 1, &E_GL_QCOM_image_processing); + symbolTable.setFunctionExtensions("textureBoxFilterQCOM", 1, &E_GL_QCOM_image_processing); + symbolTable.setFunctionExtensions("textureBlockMatchSADQCOM", 1, &E_GL_QCOM_image_processing); + symbolTable.setFunctionExtensions("textureBlockMatchSSDQCOM", 1, &E_GL_QCOM_image_processing); + + symbolTable.setFunctionExtensions("textureBlockMatchWindowSSDQCOM", 1, &E_GL_QCOM_image_processing2); + symbolTable.setFunctionExtensions("textureBlockMatchWindowSADQCOM", 1, &E_GL_QCOM_image_processing2); + symbolTable.setFunctionExtensions("textureBlockMatchGatherSSDQCOM", 1, &E_GL_QCOM_image_processing2); + symbolTable.setFunctionExtensions("textureBlockMatchGatherSADQCOM", 1, &E_GL_QCOM_image_processing2); + } + + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 460)) { + BuiltInVariable("gl_TileOffsetQCOM", EbvTileOffsetQCOM, symbolTable); + BuiltInVariable("gl_TileDimensionQCOM", EbvTileDimensionQCOM, symbolTable); + BuiltInVariable("gl_TileApronSizeQCOM", EbvTileApronSizeQCOM, symbolTable); + + symbolTable.setVariableExtensions("gl_TileOffsetQCOM", 1, &E_GL_QCOM_tile_shading); + symbolTable.setVariableExtensions("gl_TileDimensionQCOM", 1, &E_GL_QCOM_tile_shading); + symbolTable.setVariableExtensions("gl_TileApronSizeQCOM", 1, &E_GL_QCOM_tile_shading); + } + break; + + case EShLangCompute: + BuiltInVariable("gl_NumWorkGroups", EbvNumWorkGroups, symbolTable); + BuiltInVariable("gl_WorkGroupSize", EbvWorkGroupSize, symbolTable); + BuiltInVariable("gl_WorkGroupID", EbvWorkGroupId, symbolTable); + BuiltInVariable("gl_LocalInvocationID", EbvLocalInvocationId, symbolTable); + BuiltInVariable("gl_GlobalInvocationID", EbvGlobalInvocationId, symbolTable); + BuiltInVariable("gl_LocalInvocationIndex", EbvLocalInvocationIndex, symbolTable); + BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); + BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable); + + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); + symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview); + } + + if (profile != EEsProfile && version < 430) { + symbolTable.setVariableExtensions("gl_NumWorkGroups", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_WorkGroupSize", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_WorkGroupID", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_LocalInvocationID", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_GlobalInvocationID", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_LocalInvocationIndex", 1, &E_GL_ARB_compute_shader); + + symbolTable.setVariableExtensions("gl_MaxComputeWorkGroupCount", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_MaxComputeWorkGroupSize", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_MaxComputeUniformComponents", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_MaxComputeTextureImageUnits", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_MaxComputeImageUniforms", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_MaxComputeAtomicCounters", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_MaxComputeAtomicCounterBuffers", 1, &E_GL_ARB_compute_shader); + + symbolTable.setFunctionExtensions("barrier", 1, &E_GL_ARB_compute_shader); + symbolTable.setFunctionExtensions("memoryBarrierAtomicCounter", 1, &E_GL_ARB_compute_shader); + symbolTable.setFunctionExtensions("memoryBarrierBuffer", 1, &E_GL_ARB_compute_shader); + symbolTable.setFunctionExtensions("memoryBarrierImage", 1, &E_GL_ARB_compute_shader); + symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_ARB_compute_shader); + symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_ARB_compute_shader); + } + + + symbolTable.setFunctionExtensions("controlBarrier", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setFunctionExtensions("debugPrintfEXT", 1, &E_GL_EXT_debug_printf); + + // GL_ARB_shader_ballot + if (profile != EEsProfile) { + symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); + + BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); + BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); + BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); + BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); + BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); + BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); + + if (spvVersion.vulkan > 0) { + // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan + SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); + if (language == EShLangFragment) + ModifyFlatDecoration("gl_SubGroupSizeARB", true, symbolTable); + } + else + BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); + } + + // GL_KHR_shader_subgroup + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + + BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); + BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); + BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); + BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); + BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); + BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); + BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); + + // GL_NV_shader_sm_builtins + symbolTable.setVariableExtensions("gl_WarpsPerSMNV", 1, &E_GL_NV_shader_sm_builtins); + symbolTable.setVariableExtensions("gl_SMCountNV", 1, &E_GL_NV_shader_sm_builtins); + symbolTable.setVariableExtensions("gl_WarpIDNV", 1, &E_GL_NV_shader_sm_builtins); + symbolTable.setVariableExtensions("gl_SMIDNV", 1, &E_GL_NV_shader_sm_builtins); + BuiltInVariable("gl_WarpsPerSMNV", EbvWarpsPerSM, symbolTable); + BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable); + BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable); + BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable); + + // GL_ARM_shader_core_builtins + symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + + BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable); + BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable); + BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable); + BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable); + BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable); + } + + // GL_KHR_shader_subgroup + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + symbolTable.setVariableExtensions("gl_NumSubgroups", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupID", 1, &E_GL_KHR_shader_subgroup_basic); + + BuiltInVariable("gl_NumSubgroups", EbvNumSubgroups, symbolTable); + BuiltInVariable("gl_SubgroupID", EbvSubgroupID, symbolTable); + + symbolTable.setFunctionExtensions("subgroupMemoryBarrierShared", 1, &E_GL_KHR_shader_subgroup_basic); + } + + { + const char *coopExt[2] = { E_GL_NV_cooperative_matrix, E_GL_NV_integer_cooperative_matrix }; + symbolTable.setFunctionExtensions("coopMatLoadNV", 2, coopExt); + symbolTable.setFunctionExtensions("coopMatStoreNV", 2, coopExt); + symbolTable.setFunctionExtensions("coopMatMulAddNV", 2, coopExt); + } + + { + auto coopMatKHRCallback = [](const char *name) -> std::vector { + std::vector ret; + if (strstr(name, "u64") != nullptr) { + ret.push_back(E_GL_EXT_shader_64bit_indexing); + } else { + ret.push_back(E_GL_KHR_cooperative_matrix); + } + return ret; + }; + auto coopMat2NVCallback = [](const char *name) -> std::vector { + std::vector ret; + if (strstr(name, "u64") != nullptr) { + ret.push_back(E_GL_EXT_shader_64bit_indexing); + } else { + ret.push_back(E_GL_NV_cooperative_matrix2); + } + return ret; + }; + + symbolTable.setFunctionExtensionsCallback("coopMatLoad", coopMatKHRCallback); + symbolTable.setFunctionExtensionsCallback("coopMatStore", coopMatKHRCallback); + symbolTable.setFunctionExtensions("coopMatMulAdd", 1, &E_GL_KHR_cooperative_matrix); + + symbolTable.setFunctionExtensionsCallback("coopMatLoadTensorNV", coopMat2NVCallback); + symbolTable.setFunctionExtensionsCallback("coopMatStoreTensorNV", coopMat2NVCallback); + + symbolTable.setFunctionExtensions("coopMatReduceNV", 1, &E_GL_NV_cooperative_matrix2); + symbolTable.setFunctionExtensions("coopMatPerElementNV", 1, &E_GL_NV_cooperative_matrix2); + symbolTable.setFunctionExtensions("coopMatTransposeNV", 1, &E_GL_NV_cooperative_matrix2); + + symbolTable.setFunctionExtensions("createTensorLayoutNV", 1, &E_GL_NV_cooperative_matrix2); + symbolTable.setFunctionExtensions("setTensorLayoutBlockSizeNV", 1, &E_GL_NV_cooperative_matrix2); + symbolTable.setFunctionExtensions("setTensorLayoutDimensionNV", 1, &E_GL_NV_cooperative_matrix2); + symbolTable.setFunctionExtensions("setTensorLayoutStrideNV", 1, &E_GL_NV_cooperative_matrix2); + symbolTable.setFunctionExtensions("sliceTensorLayoutNV", 1, &E_GL_NV_cooperative_matrix2); + symbolTable.setFunctionExtensions("setTensorLayoutClampValueNV", 1, &E_GL_NV_cooperative_matrix2); + + symbolTable.setFunctionExtensions("createTensorViewNV", 1, &E_GL_NV_cooperative_matrix2); + symbolTable.setFunctionExtensions("setTensorViewDimensionsNV", 1, &E_GL_NV_cooperative_matrix2); + symbolTable.setFunctionExtensions("setTensorViewStrideNV", 1, &E_GL_NV_cooperative_matrix2); + symbolTable.setFunctionExtensions("setTensorViewClipNV", 1, &E_GL_NV_cooperative_matrix2); + } + + { + symbolTable.setFunctionExtensions("tensorReadARM", 1, &E_GL_ARM_tensors); + symbolTable.setFunctionExtensions("tensorWriteARM", 1, &E_GL_ARM_tensors); + symbolTable.setFunctionExtensions("tensorSizeARM", 1, &E_GL_ARM_tensors); + } + { + auto coopVecCallback = [](const char *name) -> std::vector { + std::vector ret; + // This looks for u64 as the last parameter (the offset) + if (strstr(name, "u641;") != nullptr) { + ret.push_back(E_GL_EXT_shader_64bit_indexing); + } else { + ret.push_back(E_GL_NV_cooperative_vector); + } + return ret; + }; + symbolTable.setFunctionExtensionsCallback("coopVecMatMulNV", coopVecCallback); + symbolTable.setFunctionExtensionsCallback("coopVecMatMulAddNV", coopVecCallback); + symbolTable.setFunctionExtensionsCallback("coopVecLoadNV", coopVecCallback); + symbolTable.setFunctionExtensionsCallback("coopVecStoreNV", coopVecCallback); + symbolTable.setFunctionExtensionsCallback("coopVecOuterProductAccumulateNV", coopVecCallback); + symbolTable.setFunctionExtensionsCallback("coopVecReduceSumAccumulateNV", coopVecCallback); + } + + { + symbolTable.setFunctionExtensions("bitcastQCOM", 1, &E_GL_QCOM_cooperative_matrix_conversion); + symbolTable.setFunctionExtensions("extractSubArrayQCOM", 1, &E_GL_QCOM_cooperative_matrix_conversion); + symbolTable.setFunctionExtensions("vectorToCoopmatQCOM", 1, &E_GL_QCOM_cooperative_matrix_conversion); + symbolTable.setFunctionExtensions("coopmatToVectorQCOM", 1, &E_GL_QCOM_cooperative_matrix_conversion); + } + + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + symbolTable.setFunctionExtensions("dFdx", 1, &E_GL_NV_compute_shader_derivatives); + symbolTable.setFunctionExtensions("dFdy", 1, &E_GL_NV_compute_shader_derivatives); + symbolTable.setFunctionExtensions("fwidth", 1, &E_GL_NV_compute_shader_derivatives); + symbolTable.setFunctionExtensions("dFdxFine", 1, &E_GL_NV_compute_shader_derivatives); + symbolTable.setFunctionExtensions("dFdyFine", 1, &E_GL_NV_compute_shader_derivatives); + symbolTable.setFunctionExtensions("fwidthFine", 1, &E_GL_NV_compute_shader_derivatives); + symbolTable.setFunctionExtensions("dFdxCoarse", 1, &E_GL_NV_compute_shader_derivatives); + symbolTable.setFunctionExtensions("dFdyCoarse", 1, &E_GL_NV_compute_shader_derivatives); + symbolTable.setFunctionExtensions("fwidthCoarse", 1, &E_GL_NV_compute_shader_derivatives); + } + + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 450)) { + symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + } + + if ((profile != EEsProfile && version >= 460)) { + symbolTable.setFunctionExtensions("fetchMicroTriangleVertexPositionNV", 1, &E_GL_NV_displacement_micromap); + symbolTable.setFunctionExtensions("fetchMicroTriangleVertexBarycentricNV", 1, &E_GL_NV_displacement_micromap); + } + + // GL_EXT_integer_dot_product + if ((profile == EEsProfile && version >= 300) || + (profile != EEsProfile && version >= 450)) { + symbolTable.setFunctionExtensions("dotEXT", 1, &E_GL_EXT_integer_dot_product); + symbolTable.setFunctionExtensions("dotPacked4x8EXT", 1, &E_GL_EXT_integer_dot_product); + symbolTable.setFunctionExtensions("dotAccSatEXT", 1, &E_GL_EXT_integer_dot_product); + symbolTable.setFunctionExtensions("dotPacked4x8AccSatEXT", 1, &E_GL_EXT_integer_dot_product); + } + + { + symbolTable.setFunctionExtensions("bfloat16BitsToIntEXT", 1, &E_GL_EXT_bfloat16); + symbolTable.setFunctionExtensions("bfloat16BitsToUintEXT", 1, &E_GL_EXT_bfloat16); + symbolTable.setFunctionExtensions("intBitsToBFloat16EXT", 1, &E_GL_EXT_bfloat16); + symbolTable.setFunctionExtensions("uintBitsToBFloat16EXT", 1, &E_GL_EXT_bfloat16); + + symbolTable.setFunctionExtensions("floate5m2BitsToIntEXT", 1, &E_GL_EXT_float_e5m2); + symbolTable.setFunctionExtensions("floate5m2BitsToUintEXT", 1, &E_GL_EXT_float_e5m2); + symbolTable.setFunctionExtensions("intBitsToFloate5m2EXT", 1, &E_GL_EXT_float_e5m2); + symbolTable.setFunctionExtensions("uintBitsToFloate5m2EXT", 1, &E_GL_EXT_float_e5m2); + + symbolTable.setFunctionExtensions("floate4m3BitsToIntEXT", 1, &E_GL_EXT_float_e4m3); + symbolTable.setFunctionExtensions("floate4m3BitsToUintEXT", 1, &E_GL_EXT_float_e4m3); + symbolTable.setFunctionExtensions("intBitsToFloate4m3EXT", 1, &E_GL_EXT_float_e4m3); + symbolTable.setFunctionExtensions("uintBitsToFloate4m3EXT", 1, &E_GL_EXT_float_e4m3); + + const char *float8exts[] = {E_GL_EXT_float_e5m2, E_GL_EXT_float_e4m3}; + symbolTable.setFunctionExtensions("saturatedConvertEXT", 2, float8exts); + } + + // E_SPV_QCOM_tile_shading + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 460)) { + BuiltInVariable("gl_TileOffsetQCOM", EbvTileOffsetQCOM, symbolTable); + BuiltInVariable("gl_TileDimensionQCOM", EbvTileDimensionQCOM, symbolTable); + BuiltInVariable("gl_TileApronSizeQCOM", EbvTileApronSizeQCOM, symbolTable); + + symbolTable.setVariableExtensions("gl_TileOffsetQCOM", 1, &E_GL_QCOM_tile_shading); + symbolTable.setVariableExtensions("gl_TileDimensionQCOM", 1, &E_GL_QCOM_tile_shading); + symbolTable.setVariableExtensions("gl_TileApronSizeQCOM", 1, &E_GL_QCOM_tile_shading); + } + break; + + case EShLangRayGen: + case EShLangIntersect: + case EShLangAnyHit: + case EShLangClosestHit: + case EShLangMiss: + case EShLangCallable: + if (profile != EEsProfile && version >= 460) { + const char *rtexts[] = { E_GL_NV_ray_tracing, E_GL_EXT_ray_tracing }; + symbolTable.setVariableExtensions("gl_LaunchIDNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_LaunchIDEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_LaunchSizeNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_LaunchSizeEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_PrimitiveID", 2, rtexts); + symbolTable.setVariableExtensions("gl_InstanceID", 2, rtexts); + symbolTable.setVariableExtensions("gl_InstanceCustomIndexNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_InstanceCustomIndexEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_GeometryIndexEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_WorldRayOriginNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_WorldRayOriginEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_WorldRayDirectionNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_WorldRayDirectionEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_ObjectRayOriginNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_ObjectRayOriginEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_ObjectRayDirectionNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_ObjectRayDirectionEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_RayTminNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_RayTminEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_RayTmaxNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_RayTmaxEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_CullMaskEXT", 1, &E_GL_EXT_ray_cull_mask); + symbolTable.setVariableExtensions("gl_HitTNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_HitTEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_HitKindNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_HitKindEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_ObjectToWorldNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_ObjectToWorldEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_ObjectToWorld3x4EXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_WorldToObjectNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_WorldToObjectEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_WorldToObject3x4EXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_IncomingRayFlagsNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_IncomingRayFlagsEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_CurrentRayTimeNV", 1, &E_GL_NV_ray_tracing_motion_blur); + symbolTable.setVariableExtensions("gl_HitTriangleVertexPositionsEXT", 1, &E_GL_EXT_ray_tracing_position_fetch); + symbolTable.setVariableExtensions("gl_HitMicroTriangleVertexPositionsNV", 1, &E_GL_NV_displacement_micromap); + symbolTable.setVariableExtensions("gl_HitMicroTriangleVertexBarycentricsNV", 1, &E_GL_NV_displacement_micromap); + symbolTable.setVariableExtensions("gl_ClusterIDNV", 1, &E_GL_NV_cluster_acceleration_structure); + symbolTable.setVariableExtensions("gl_HitKindSphereNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setVariableExtensions("gl_HitKindLSSNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setVariableExtensions("gl_HitSpherePositionNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setVariableExtensions("gl_HitSphereRadiusNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setVariableExtensions("gl_HitLSSPositionNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setVariableExtensions("gl_HitLSSRadiiNV", 1, &E_GL_NV_linear_swept_spheres); + + symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); + + + symbolTable.setFunctionExtensions("traceNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setFunctionExtensions("traceRayMotionNV", 1, &E_GL_NV_ray_tracing_motion_blur); + symbolTable.setFunctionExtensions("traceRayEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setFunctionExtensions("reportIntersectionNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setFunctionExtensions("reportIntersectionEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setFunctionExtensions("ignoreIntersectionNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setFunctionExtensions("terminateRayNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setFunctionExtensions("executeCallableNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setFunctionExtensions("executeCallableEXT", 1, &E_GL_EXT_ray_tracing); + + symbolTable.setFunctionExtensions("hitObjectTraceRayNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectTraceRayMotionNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordHitNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordHitMotionNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordHitWithIndexNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordHitWithIndexMotionNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordMissNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordMissMotionNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordEmptyNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectExecuteShaderNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectIsEmptyNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectIsMissNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectIsHitNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetRayTMinNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetRayTMaxNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetObjectRayOriginNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetObjectRayDirectionNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetWorldRayOriginNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetWorldRayDirectionNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetWorldToObjectNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetbjectToWorldNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetInstanceCustomIndexNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetInstanceIdNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetGeometryIndexNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetPrimitiveIndexNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetHitKindNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetAttributesNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetCurrentTimeNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetShaderBindingTableRecordIndexNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetShaderRecordBufferHandleNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetClusterIdNV", 1, &E_GL_NV_cluster_acceleration_structure); + symbolTable.setFunctionExtensions("reorderThreadNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("fetchMicroTriangleVertexPositionNV", 1, &E_GL_NV_displacement_micromap); + symbolTable.setFunctionExtensions("fetchMicroTriangleVertexBarycentricNV", 1, &E_GL_NV_displacement_micromap); + symbolTable.setFunctionExtensions("hitObjectGetSpherePositionNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setFunctionExtensions("hitObjectGetSphereRadiusNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setFunctionExtensions("hitObjectGetLSSPositionsNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setFunctionExtensions("hitObjectGetLSSRadiiNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setFunctionExtensions("hitObjectIsSphereHitNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setFunctionExtensions("hitObjectIsLSSHitNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setFunctionExtensions("hitObjectTraceRayEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectTraceRayMotionEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordMissEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordMissMotionEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordEmptyEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectExecuteShaderEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectIsEmptyEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectIsMissEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectIsHitEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetRayTMinEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetRayTMaxEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetRayFlagsEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetObjectRayOriginEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetObjectRayDirectionEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetWorldRayOriginEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetWorldRayDirectionEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetWorldToObjectEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetObjectToWorldEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetInstanceCustomIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetInstanceIdEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetGeometryIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetPrimitiveIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetHitKindEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetAttributesEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetCurrentTimeEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetShaderBindingTableRecordIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetShaderRecordBufferHandleEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectSetShaderBindingTableRecordIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("reorderThreadEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectReorderExecuteEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectTraceReorderExecuteEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectTraceMotionReorderExecuteEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordFromQueryEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetIntersectionTriangleVertexPositionsEXT", 1, &E_GL_EXT_shader_invocation_reorder); + + + BuiltInVariable("gl_LaunchIDNV", EbvLaunchId, symbolTable); + BuiltInVariable("gl_LaunchIDEXT", EbvLaunchId, symbolTable); + BuiltInVariable("gl_LaunchSizeNV", EbvLaunchSize, symbolTable); + BuiltInVariable("gl_LaunchSizeEXT", EbvLaunchSize, symbolTable); + BuiltInVariable("gl_PrimitiveID", EbvPrimitiveId, symbolTable); + BuiltInVariable("gl_InstanceID", EbvInstanceId, symbolTable); + BuiltInVariable("gl_InstanceCustomIndexNV", EbvInstanceCustomIndex,symbolTable); + BuiltInVariable("gl_InstanceCustomIndexEXT", EbvInstanceCustomIndex,symbolTable); + BuiltInVariable("gl_GeometryIndexEXT", EbvGeometryIndex, symbolTable); + BuiltInVariable("gl_WorldRayOriginNV", EbvWorldRayOrigin, symbolTable); + BuiltInVariable("gl_WorldRayOriginEXT", EbvWorldRayOrigin, symbolTable); + BuiltInVariable("gl_WorldRayDirectionNV", EbvWorldRayDirection, symbolTable); + BuiltInVariable("gl_WorldRayDirectionEXT", EbvWorldRayDirection, symbolTable); + BuiltInVariable("gl_ObjectRayOriginNV", EbvObjectRayOrigin, symbolTable); + BuiltInVariable("gl_ObjectRayOriginEXT", EbvObjectRayOrigin, symbolTable); + BuiltInVariable("gl_ObjectRayDirectionNV", EbvObjectRayDirection, symbolTable); + BuiltInVariable("gl_ObjectRayDirectionEXT", EbvObjectRayDirection, symbolTable); + BuiltInVariable("gl_RayTminNV", EbvRayTmin, symbolTable); + BuiltInVariable("gl_RayTminEXT", EbvRayTmin, symbolTable); + BuiltInVariable("gl_RayTmaxNV", EbvRayTmax, symbolTable); + BuiltInVariable("gl_RayTmaxEXT", EbvRayTmax, symbolTable); + BuiltInVariable("gl_CullMaskEXT", EbvCullMask, symbolTable); + BuiltInVariable("gl_HitKindNV", EbvHitKind, symbolTable); + BuiltInVariable("gl_HitKindEXT", EbvHitKind, symbolTable); + BuiltInVariable("gl_ObjectToWorldNV", EbvObjectToWorld, symbolTable); + BuiltInVariable("gl_ObjectToWorldEXT", EbvObjectToWorld, symbolTable); + BuiltInVariable("gl_ObjectToWorld3x4EXT", EbvObjectToWorld3x4, symbolTable); + BuiltInVariable("gl_WorldToObjectNV", EbvWorldToObject, symbolTable); + BuiltInVariable("gl_WorldToObjectEXT", EbvWorldToObject, symbolTable); + BuiltInVariable("gl_WorldToObject3x4EXT", EbvWorldToObject3x4, symbolTable); + BuiltInVariable("gl_IncomingRayFlagsNV", EbvIncomingRayFlags, symbolTable); + BuiltInVariable("gl_IncomingRayFlagsEXT", EbvIncomingRayFlags, symbolTable); + BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); + BuiltInVariable("gl_CurrentRayTimeNV", EbvCurrentRayTimeNV, symbolTable); + BuiltInVariable("gl_HitTriangleVertexPositionsEXT", EbvPositionFetch, symbolTable); + BuiltInVariable("gl_HitMicroTriangleVertexPositionsNV", EbvMicroTrianglePositionNV, symbolTable); + BuiltInVariable("gl_HitMicroTriangleVertexBarycentricsNV", EbvMicroTriangleBaryNV, symbolTable); + BuiltInVariable("gl_HitKindFrontFacingMicroTriangleNV", EbvHitKindFrontFacingMicroTriangleNV, symbolTable); + BuiltInVariable("gl_HitKindBackFacingMicroTriangleNV", EbvHitKindBackFacingMicroTriangleNV, symbolTable); + BuiltInVariable("gl_ClusterIDNV", EbvClusterIDNV, symbolTable); + BuiltInVariable("gl_HitIsSphereNV", EbvHitIsSphereNV, symbolTable); + BuiltInVariable("gl_HitIsLSSNV", EbvHitIsLSSNV, symbolTable); + BuiltInVariable("gl_HitSpherePositionNV", EbvHitSpherePositionNV, symbolTable); + BuiltInVariable("gl_HitSphereRadiusNV", EbvHitSphereRadiusNV, symbolTable); + BuiltInVariable("gl_HitLSSPositionsNV", EbvHitLSSPositionsNV, symbolTable); + BuiltInVariable("gl_HitLSSRadiiNV", EbvHitLSSRadiiNV, symbolTable); + + // gl_HitT variables are aliases of their gl_RayTmax counterparts. + RetargetVariable("gl_HitTNV", "gl_RayTmaxNV", symbolTable); + RetargetVariable("gl_HitTEXT", "gl_RayTmaxEXT", symbolTable); + + // GL_ARB_shader_ballot + symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); + + BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); + BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); + BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); + BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); + BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); + BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); + + if (spvVersion.vulkan > 0) { + // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan + SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); + if (language == EShLangFragment) + ModifyFlatDecoration("gl_SubGroupSizeARB", true, symbolTable); + } + else + BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); + + // GL_KHR_shader_subgroup + symbolTable.setVariableExtensions("gl_NumSubgroups", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + + BuiltInVariable("gl_NumSubgroups", EbvNumSubgroups, symbolTable); + BuiltInVariable("gl_SubgroupID", EbvSubgroupID, symbolTable); + BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); + BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); + BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); + BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); + BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); + BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); + BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); + + // GL_NV_shader_sm_builtins + symbolTable.setVariableExtensions("gl_WarpsPerSMNV", 1, &E_GL_NV_shader_sm_builtins); + symbolTable.setVariableExtensions("gl_SMCountNV", 1, &E_GL_NV_shader_sm_builtins); + symbolTable.setVariableExtensions("gl_WarpIDNV", 1, &E_GL_NV_shader_sm_builtins); + symbolTable.setVariableExtensions("gl_SMIDNV", 1, &E_GL_NV_shader_sm_builtins); + BuiltInVariable("gl_WarpsPerSMNV", EbvWarpsPerSM, symbolTable); + BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable); + BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable); + BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable); + + // GL_ARM_shader_core_builtins + symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + + BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable); + BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable); + BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable); + BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable); + BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable); + } + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 450)) { + symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + } + break; + + case EShLangMesh: + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + // per-vertex builtins + symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_Position", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_PointSize", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_ClipDistance", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_CullDistance", 1, &E_GL_NV_mesh_shader); + + BuiltInVariable("gl_MeshVerticesNV", "gl_Position", EbvPosition, symbolTable); + BuiltInVariable("gl_MeshVerticesNV", "gl_PointSize", EbvPointSize, symbolTable); + BuiltInVariable("gl_MeshVerticesNV", "gl_ClipDistance", EbvClipDistance, symbolTable); + BuiltInVariable("gl_MeshVerticesNV", "gl_CullDistance", EbvCullDistance, symbolTable); + + symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_PositionPerViewNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_ClipDistancePerViewNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_CullDistancePerViewNV", 1, &E_GL_NV_mesh_shader); + + BuiltInVariable("gl_MeshVerticesNV", "gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable); + BuiltInVariable("gl_MeshVerticesNV", "gl_ClipDistancePerViewNV", EbvClipDistancePerViewNV, symbolTable); + BuiltInVariable("gl_MeshVerticesNV", "gl_CullDistancePerViewNV", EbvCullDistancePerViewNV, symbolTable); + + // per-primitive builtins + symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_PrimitiveID", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_Layer", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_ViewportIndex", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_ViewportMask", 1, &E_GL_NV_mesh_shader); + + BuiltInVariable("gl_MeshPrimitivesNV", "gl_PrimitiveID", EbvPrimitiveId, symbolTable); + BuiltInVariable("gl_MeshPrimitivesNV", "gl_Layer", EbvLayer, symbolTable); + BuiltInVariable("gl_MeshPrimitivesNV", "gl_ViewportIndex", EbvViewportIndex, symbolTable); + BuiltInVariable("gl_MeshPrimitivesNV", "gl_ViewportMask", EbvViewportMaskNV, symbolTable); + + // per-view per-primitive builtins + symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_LayerPerViewNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_ViewportMaskPerViewNV", 1, &E_GL_NV_mesh_shader); + + BuiltInVariable("gl_MeshPrimitivesNV", "gl_LayerPerViewNV", EbvLayerPerViewNV, symbolTable); + BuiltInVariable("gl_MeshPrimitivesNV", "gl_ViewportMaskPerViewNV", EbvViewportMaskPerViewNV, symbolTable); + + // other builtins + symbolTable.setVariableExtensions("gl_PrimitiveCountNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_PrimitiveIndicesNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshViewCountNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshViewIndicesNV", 1, &E_GL_NV_mesh_shader); + if (profile != EEsProfile) { + symbolTable.setVariableExtensions("gl_WorkGroupSize", Num_AEP_mesh_shader, AEP_mesh_shader); + symbolTable.setVariableExtensions("gl_WorkGroupID", Num_AEP_mesh_shader, AEP_mesh_shader); + symbolTable.setVariableExtensions("gl_LocalInvocationID", Num_AEP_mesh_shader, AEP_mesh_shader); + symbolTable.setVariableExtensions("gl_GlobalInvocationID", Num_AEP_mesh_shader, AEP_mesh_shader); + symbolTable.setVariableExtensions("gl_LocalInvocationIndex", Num_AEP_mesh_shader, AEP_mesh_shader); + } else { + symbolTable.setVariableExtensions("gl_WorkGroupSize", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_WorkGroupID", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_LocalInvocationID", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_GlobalInvocationID", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_LocalInvocationIndex", 1, &E_GL_NV_mesh_shader); + } + BuiltInVariable("gl_PrimitiveCountNV", EbvPrimitiveCountNV, symbolTable); + BuiltInVariable("gl_PrimitiveIndicesNV", EbvPrimitiveIndicesNV, symbolTable); + BuiltInVariable("gl_MeshViewCountNV", EbvMeshViewCountNV, symbolTable); + BuiltInVariable("gl_MeshViewIndicesNV", EbvMeshViewIndicesNV, symbolTable); + BuiltInVariable("gl_WorkGroupSize", EbvWorkGroupSize, symbolTable); + BuiltInVariable("gl_WorkGroupID", EbvWorkGroupId, symbolTable); + BuiltInVariable("gl_LocalInvocationID", EbvLocalInvocationId, symbolTable); + BuiltInVariable("gl_GlobalInvocationID", EbvGlobalInvocationId, symbolTable); + BuiltInVariable("gl_LocalInvocationIndex", EbvLocalInvocationIndex, symbolTable); + + // builtin constants + symbolTable.setVariableExtensions("gl_MaxMeshOutputVerticesNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MaxMeshOutputPrimitivesNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MaxMeshWorkGroupSizeNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MaxMeshViewCountNV", 1, &E_GL_NV_mesh_shader); + + // builtin functions + if (profile != EEsProfile) { + symbolTable.setFunctionExtensions("barrier", Num_AEP_mesh_shader, AEP_mesh_shader); + symbolTable.setFunctionExtensions("memoryBarrierShared", Num_AEP_mesh_shader, AEP_mesh_shader); + symbolTable.setFunctionExtensions("groupMemoryBarrier", Num_AEP_mesh_shader, AEP_mesh_shader); + } else { + symbolTable.setFunctionExtensions("barrier", 1, &E_GL_NV_mesh_shader); + symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_NV_mesh_shader); + symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_NV_mesh_shader); + } + symbolTable.setFunctionExtensions("writePackedPrimitiveIndices4x8NV", 1, &E_GL_NV_mesh_shader); + } + + if (profile != EEsProfile && version >= 450) { + // GL_EXT_Mesh_shader + symbolTable.setVariableExtensions("gl_PrimitivePointIndicesEXT", 1, &E_GL_EXT_mesh_shader); + symbolTable.setVariableExtensions("gl_PrimitiveLineIndicesEXT", 1, &E_GL_EXT_mesh_shader); + symbolTable.setVariableExtensions("gl_PrimitiveTriangleIndicesEXT", 1, &E_GL_EXT_mesh_shader); + symbolTable.setVariableExtensions("gl_NumWorkGroups", 1, &E_GL_EXT_mesh_shader); + + BuiltInVariable("gl_PrimitivePointIndicesEXT", EbvPrimitivePointIndicesEXT, symbolTable); + BuiltInVariable("gl_PrimitiveLineIndicesEXT", EbvPrimitiveLineIndicesEXT, symbolTable); + BuiltInVariable("gl_PrimitiveTriangleIndicesEXT", EbvPrimitiveTriangleIndicesEXT, symbolTable); + BuiltInVariable("gl_NumWorkGroups", EbvNumWorkGroups, symbolTable); + + symbolTable.setVariableExtensions("gl_MeshVerticesEXT", "gl_Position", 1, &E_GL_EXT_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshVerticesEXT", "gl_PointSize", 1, &E_GL_EXT_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshVerticesEXT", "gl_ClipDistance", 1, &E_GL_EXT_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshVerticesEXT", "gl_CullDistance", 1, &E_GL_EXT_mesh_shader); + + BuiltInVariable("gl_MeshVerticesEXT", "gl_Position", EbvPosition, symbolTable); + BuiltInVariable("gl_MeshVerticesEXT", "gl_PointSize", EbvPointSize, symbolTable); + BuiltInVariable("gl_MeshVerticesEXT", "gl_ClipDistance", EbvClipDistance, symbolTable); + BuiltInVariable("gl_MeshVerticesEXT", "gl_CullDistance", EbvCullDistance, symbolTable); + + symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_PrimitiveID", 1, &E_GL_EXT_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_Layer", 1, &E_GL_EXT_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_ViewportIndex", 1, &E_GL_EXT_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_CullPrimitiveEXT", 1, &E_GL_EXT_mesh_shader); + + // note: technically this member requires both GL_EXT_mesh_shader and GL_EXT_fragment_shading_rate + // since setVariableExtensions only needs *one of* the extensions to validate, it's more useful to specify EXT_fragment_shading_rate + // GL_EXT_mesh_shader will be required in practice by use of other fields of gl_MeshPrimitivesEXT + symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_PrimitiveShadingRateEXT", 1, &E_GL_EXT_fragment_shading_rate); + + BuiltInVariable("gl_MeshPrimitivesEXT", "gl_PrimitiveID", EbvPrimitiveId, symbolTable); + BuiltInVariable("gl_MeshPrimitivesEXT", "gl_Layer", EbvLayer, symbolTable); + BuiltInVariable("gl_MeshPrimitivesEXT", "gl_ViewportIndex", EbvViewportIndex, symbolTable); + BuiltInVariable("gl_MeshPrimitivesEXT", "gl_CullPrimitiveEXT", EbvCullPrimitiveEXT, symbolTable); + BuiltInVariable("gl_MeshPrimitivesEXT", "gl_PrimitiveShadingRateEXT", EbvPrimitiveShadingRateKHR, symbolTable); + + symbolTable.setFunctionExtensions("SetMeshOutputsEXT", 1, &E_GL_EXT_mesh_shader); + + // GL_EXT_device_group + symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); + BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); + + // GL_ARB_shader_draw_parameters + symbolTable.setVariableExtensions("gl_DrawIDARB", 1, &E_GL_ARB_shader_draw_parameters); + BuiltInVariable("gl_DrawIDARB", EbvDrawId, symbolTable); + if (version >= 460) { + BuiltInVariable("gl_DrawID", EbvDrawId, symbolTable); + } + // GL_EXT_multiview + BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable); + symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview); + + // GL_ARB_shader_ballot + symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); + + BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); + BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); + BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); + BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); + BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); + BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); + + if (spvVersion.vulkan > 0) { + // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan + SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); + if (language == EShLangFragment) + ModifyFlatDecoration("gl_SubGroupSizeARB", true, symbolTable); + } + else + BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); + } + + // GL_KHR_shader_subgroup + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + symbolTable.setVariableExtensions("gl_NumSubgroups", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + + BuiltInVariable("gl_NumSubgroups", EbvNumSubgroups, symbolTable); + BuiltInVariable("gl_SubgroupID", EbvSubgroupID, symbolTable); + BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); + BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); + BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); + BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); + BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); + BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); + BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); + + symbolTable.setFunctionExtensions("subgroupMemoryBarrierShared", 1, &E_GL_KHR_shader_subgroup_basic); + + // GL_NV_shader_sm_builtins + symbolTable.setVariableExtensions("gl_WarpsPerSMNV", 1, &E_GL_NV_shader_sm_builtins); + symbolTable.setVariableExtensions("gl_SMCountNV", 1, &E_GL_NV_shader_sm_builtins); + symbolTable.setVariableExtensions("gl_WarpIDNV", 1, &E_GL_NV_shader_sm_builtins); + symbolTable.setVariableExtensions("gl_SMIDNV", 1, &E_GL_NV_shader_sm_builtins); + BuiltInVariable("gl_WarpsPerSMNV", EbvWarpsPerSM, symbolTable); + BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable); + BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable); + BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable); + + // GL_ARM_shader_core_builtins + symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + + BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable); + BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable); + BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable); + BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable); + BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable); + } + + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 450)) { + symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + } + + // Builtins for GL_NV_displacment_micromap + if ((profile != EEsProfile && version >= 460)) { + symbolTable.setFunctionExtensions("fetchMicroTriangleVertexPositionNV", 1, &E_GL_NV_displacement_micromap); + symbolTable.setFunctionExtensions("fetchMicroTriangleVertexBarycentricNV", 1, &E_GL_NV_displacement_micromap); + } + + break; + + case EShLangTask: + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + symbolTable.setVariableExtensions("gl_TaskCountNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshViewCountNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshViewIndicesNV", 1, &E_GL_NV_mesh_shader); + if (profile != EEsProfile) { + symbolTable.setVariableExtensions("gl_WorkGroupSize", Num_AEP_mesh_shader, AEP_mesh_shader); + symbolTable.setVariableExtensions("gl_WorkGroupID", Num_AEP_mesh_shader, AEP_mesh_shader); + symbolTable.setVariableExtensions("gl_LocalInvocationID", Num_AEP_mesh_shader, AEP_mesh_shader); + symbolTable.setVariableExtensions("gl_GlobalInvocationID", Num_AEP_mesh_shader, AEP_mesh_shader); + symbolTable.setVariableExtensions("gl_LocalInvocationIndex", Num_AEP_mesh_shader, AEP_mesh_shader); + } else { + symbolTable.setVariableExtensions("gl_WorkGroupSize", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_WorkGroupID", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_LocalInvocationID", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_GlobalInvocationID", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_LocalInvocationIndex", 1, &E_GL_NV_mesh_shader); + } + + BuiltInVariable("gl_TaskCountNV", EbvTaskCountNV, symbolTable); + BuiltInVariable("gl_WorkGroupSize", EbvWorkGroupSize, symbolTable); + BuiltInVariable("gl_WorkGroupID", EbvWorkGroupId, symbolTable); + BuiltInVariable("gl_LocalInvocationID", EbvLocalInvocationId, symbolTable); + BuiltInVariable("gl_GlobalInvocationID", EbvGlobalInvocationId, symbolTable); + BuiltInVariable("gl_LocalInvocationIndex", EbvLocalInvocationIndex, symbolTable); + BuiltInVariable("gl_MeshViewCountNV", EbvMeshViewCountNV, symbolTable); + BuiltInVariable("gl_MeshViewIndicesNV", EbvMeshViewIndicesNV, symbolTable); + + symbolTable.setVariableExtensions("gl_MaxTaskWorkGroupSizeNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MaxMeshViewCountNV", 1, &E_GL_NV_mesh_shader); + + if (profile != EEsProfile) { + symbolTable.setFunctionExtensions("barrier", Num_AEP_mesh_shader, AEP_mesh_shader); + symbolTable.setFunctionExtensions("memoryBarrierShared", Num_AEP_mesh_shader, AEP_mesh_shader); + symbolTable.setFunctionExtensions("groupMemoryBarrier", Num_AEP_mesh_shader, AEP_mesh_shader); + } else { + symbolTable.setFunctionExtensions("barrier", 1, &E_GL_NV_mesh_shader); + symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_NV_mesh_shader); + symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_NV_mesh_shader); + } + } + + if (profile != EEsProfile && version >= 450) { + // GL_EXT_mesh_shader + symbolTable.setFunctionExtensions("EmitMeshTasksEXT", 1, &E_GL_EXT_mesh_shader); + symbolTable.setVariableExtensions("gl_NumWorkGroups", 1, &E_GL_EXT_mesh_shader); + BuiltInVariable("gl_NumWorkGroups", EbvNumWorkGroups, symbolTable); + + // GL_EXT_device_group + symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); + BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); + + // GL_ARB_shader_draw_parameters + symbolTable.setVariableExtensions("gl_DrawIDARB", 1, &E_GL_ARB_shader_draw_parameters); + BuiltInVariable("gl_DrawIDARB", EbvDrawId, symbolTable); + if (version >= 460) { + BuiltInVariable("gl_DrawID", EbvDrawId, symbolTable); + } + + // GL_ARB_shader_ballot + symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); + + BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); + BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); + BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); + BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); + BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); + BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); + + if (spvVersion.vulkan > 0) { + // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan + SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); + if (language == EShLangFragment) + ModifyFlatDecoration("gl_SubGroupSizeARB", true, symbolTable); + } + else + BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); + } + + // GL_KHR_shader_subgroup + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + symbolTable.setVariableExtensions("gl_NumSubgroups", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + + BuiltInVariable("gl_NumSubgroups", EbvNumSubgroups, symbolTable); + BuiltInVariable("gl_SubgroupID", EbvSubgroupID, symbolTable); + BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); + BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); + BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); + BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); + BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); + BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); + BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); + + symbolTable.setFunctionExtensions("subgroupMemoryBarrierShared", 1, &E_GL_KHR_shader_subgroup_basic); + + // GL_NV_shader_sm_builtins + symbolTable.setVariableExtensions("gl_WarpsPerSMNV", 1, &E_GL_NV_shader_sm_builtins); + symbolTable.setVariableExtensions("gl_SMCountNV", 1, &E_GL_NV_shader_sm_builtins); + symbolTable.setVariableExtensions("gl_WarpIDNV", 1, &E_GL_NV_shader_sm_builtins); + symbolTable.setVariableExtensions("gl_SMIDNV", 1, &E_GL_NV_shader_sm_builtins); + BuiltInVariable("gl_WarpsPerSMNV", EbvWarpsPerSM, symbolTable); + BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable); + BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable); + BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable); + + // GL_ARM_shader_core_builtins + symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + + BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable); + BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable); + BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable); + BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable); + BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable); + } + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 450)) { + symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); + } + break; + + default: + assert(false && "Language not supported"); + break; + } + + // + // Next, identify which built-ins have a mapping to an operator. + // If PureOperatorBuiltins is false, those that are not identified as such are + // expected to be resolved through a library of functions, versus as + // operations. + // + + relateTabledBuiltins(version, profile, spvVersion, language, symbolTable); + + symbolTable.relateToOperator("doubleBitsToInt64", EOpDoubleBitsToInt64); + symbolTable.relateToOperator("doubleBitsToUint64", EOpDoubleBitsToUint64); + symbolTable.relateToOperator("int64BitsToDouble", EOpInt64BitsToDouble); + symbolTable.relateToOperator("uint64BitsToDouble", EOpUint64BitsToDouble); + symbolTable.relateToOperator("halfBitsToInt16", EOpFloat16BitsToInt16); + symbolTable.relateToOperator("halfBitsToUint16", EOpFloat16BitsToUint16); + symbolTable.relateToOperator("float16BitsToInt16", EOpFloat16BitsToInt16); + symbolTable.relateToOperator("float16BitsToUint16", EOpFloat16BitsToUint16); + symbolTable.relateToOperator("int16BitsToFloat16", EOpInt16BitsToFloat16); + symbolTable.relateToOperator("uint16BitsToFloat16", EOpUint16BitsToFloat16); + + symbolTable.relateToOperator("int16BitsToHalf", EOpInt16BitsToFloat16); + symbolTable.relateToOperator("uint16BitsToHalf", EOpUint16BitsToFloat16); + + symbolTable.relateToOperator("packSnorm4x8", EOpPackSnorm4x8); + symbolTable.relateToOperator("unpackSnorm4x8", EOpUnpackSnorm4x8); + symbolTable.relateToOperator("packUnorm4x8", EOpPackUnorm4x8); + symbolTable.relateToOperator("unpackUnorm4x8", EOpUnpackUnorm4x8); + + symbolTable.relateToOperator("packDouble2x32", EOpPackDouble2x32); + symbolTable.relateToOperator("unpackDouble2x32", EOpUnpackDouble2x32); + + symbolTable.relateToOperator("packInt2x32", EOpPackInt2x32); + symbolTable.relateToOperator("unpackInt2x32", EOpUnpackInt2x32); + symbolTable.relateToOperator("packUint2x32", EOpPackUint2x32); + symbolTable.relateToOperator("unpackUint2x32", EOpUnpackUint2x32); + + symbolTable.relateToOperator("packInt2x16", EOpPackInt2x16); + symbolTable.relateToOperator("unpackInt2x16", EOpUnpackInt2x16); + symbolTable.relateToOperator("packUint2x16", EOpPackUint2x16); + symbolTable.relateToOperator("unpackUint2x16", EOpUnpackUint2x16); + + symbolTable.relateToOperator("packInt4x16", EOpPackInt4x16); + symbolTable.relateToOperator("unpackInt4x16", EOpUnpackInt4x16); + symbolTable.relateToOperator("packUint4x16", EOpPackUint4x16); + symbolTable.relateToOperator("unpackUint4x16", EOpUnpackUint4x16); + symbolTable.relateToOperator("packFloat2x16", EOpPackFloat2x16); + symbolTable.relateToOperator("unpackFloat2x16", EOpUnpackFloat2x16); + + symbolTable.relateToOperator("pack16", EOpPack16); + symbolTable.relateToOperator("pack32", EOpPack32); + symbolTable.relateToOperator("pack64", EOpPack64); + + symbolTable.relateToOperator("unpack32", EOpUnpack32); + symbolTable.relateToOperator("unpack16", EOpUnpack16); + symbolTable.relateToOperator("unpack8", EOpUnpack8); + + symbolTable.relateToOperator("controlBarrier", EOpBarrier); + symbolTable.relateToOperator("memoryBarrierAtomicCounter", EOpMemoryBarrierAtomicCounter); + symbolTable.relateToOperator("memoryBarrierImage", EOpMemoryBarrierImage); + + if (spvVersion.vulkanRelaxed) { + // + // functions signature have been replaced to take uint operations on buffer variables + // remap atomic counter functions to atomic operations + // + symbolTable.relateToOperator("memoryBarrierAtomicCounter", EOpMemoryBarrierBuffer); + } + + symbolTable.relateToOperator("atomicLoad", EOpAtomicLoad); + symbolTable.relateToOperator("atomicStore", EOpAtomicStore); + + symbolTable.relateToOperator("atomicCounterIncrement", EOpAtomicCounterIncrement); + symbolTable.relateToOperator("atomicCounterDecrement", EOpAtomicCounterDecrement); + symbolTable.relateToOperator("atomicCounter", EOpAtomicCounter); + + if (spvVersion.vulkanRelaxed) { + // + // functions signature have been replaced to take uint operations + // remap atomic counter functions to atomic operations + // + // these atomic counter functions do not match signatures of glsl + // atomic functions, so they will be remapped to semantically + // equivalent functions in the parser + // + symbolTable.relateToOperator("atomicCounterIncrement", EOpNull); + symbolTable.relateToOperator("atomicCounterDecrement", EOpNull); + symbolTable.relateToOperator("atomicCounter", EOpNull); + } + + symbolTable.relateToOperator("clockARB", EOpReadClockSubgroupKHR); + symbolTable.relateToOperator("clock2x32ARB", EOpReadClockSubgroupKHR); + + symbolTable.relateToOperator("clockRealtimeEXT", EOpReadClockDeviceKHR); + symbolTable.relateToOperator("clockRealtime2x32EXT", EOpReadClockDeviceKHR); + + if (profile != EEsProfile && version == 450) { + symbolTable.relateToOperator("atomicCounterAddARB", EOpAtomicCounterAdd); + symbolTable.relateToOperator("atomicCounterSubtractARB", EOpAtomicCounterSubtract); + symbolTable.relateToOperator("atomicCounterMinARB", EOpAtomicCounterMin); + symbolTable.relateToOperator("atomicCounterMaxARB", EOpAtomicCounterMax); + symbolTable.relateToOperator("atomicCounterAndARB", EOpAtomicCounterAnd); + symbolTable.relateToOperator("atomicCounterOrARB", EOpAtomicCounterOr); + symbolTable.relateToOperator("atomicCounterXorARB", EOpAtomicCounterXor); + symbolTable.relateToOperator("atomicCounterExchangeARB", EOpAtomicCounterExchange); + symbolTable.relateToOperator("atomicCounterCompSwapARB", EOpAtomicCounterCompSwap); + } + + if (profile != EEsProfile && version >= 460) { + symbolTable.relateToOperator("atomicCounterAdd", EOpAtomicCounterAdd); + symbolTable.relateToOperator("atomicCounterSubtract", EOpAtomicCounterSubtract); + symbolTable.relateToOperator("atomicCounterMin", EOpAtomicCounterMin); + symbolTable.relateToOperator("atomicCounterMax", EOpAtomicCounterMax); + symbolTable.relateToOperator("atomicCounterAnd", EOpAtomicCounterAnd); + symbolTable.relateToOperator("atomicCounterOr", EOpAtomicCounterOr); + symbolTable.relateToOperator("atomicCounterXor", EOpAtomicCounterXor); + symbolTable.relateToOperator("atomicCounterExchange", EOpAtomicCounterExchange); + symbolTable.relateToOperator("atomicCounterCompSwap", EOpAtomicCounterCompSwap); + } + + if (spvVersion.vulkanRelaxed) { + // + // functions signature have been replaced to take 'uint' instead of 'atomic_uint' + // remap atomic counter functions to non-counter atomic ops so + // functions act as aliases to non-counter atomic ops + // + symbolTable.relateToOperator("atomicCounterAdd", EOpAtomicAdd); + symbolTable.relateToOperator("atomicCounterSubtract", EOpAtomicSubtract); + symbolTable.relateToOperator("atomicCounterMin", EOpAtomicMin); + symbolTable.relateToOperator("atomicCounterMax", EOpAtomicMax); + symbolTable.relateToOperator("atomicCounterAnd", EOpAtomicAnd); + symbolTable.relateToOperator("atomicCounterOr", EOpAtomicOr); + symbolTable.relateToOperator("atomicCounterXor", EOpAtomicXor); + symbolTable.relateToOperator("atomicCounterExchange", EOpAtomicExchange); + symbolTable.relateToOperator("atomicCounterCompSwap", EOpAtomicCompSwap); + } + + symbolTable.relateToOperator("fma", EOpFma); + symbolTable.relateToOperator("frexp", EOpFrexp); + symbolTable.relateToOperator("ldexp", EOpLdexp); + symbolTable.relateToOperator("uaddCarry", EOpAddCarry); + symbolTable.relateToOperator("usubBorrow", EOpSubBorrow); + symbolTable.relateToOperator("umulExtended", EOpUMulExtended); + symbolTable.relateToOperator("imulExtended", EOpIMulExtended); + symbolTable.relateToOperator("bitfieldExtract", EOpBitfieldExtract); + symbolTable.relateToOperator("bitfieldInsert", EOpBitfieldInsert); + symbolTable.relateToOperator("bitfieldReverse", EOpBitFieldReverse); + symbolTable.relateToOperator("bitCount", EOpBitCount); + symbolTable.relateToOperator("findLSB", EOpFindLSB); + symbolTable.relateToOperator("findMSB", EOpFindMSB); + + symbolTable.relateToOperator("helperInvocationEXT", EOpIsHelperInvocation); + + symbolTable.relateToOperator("countLeadingZeros", EOpCountLeadingZeros); + symbolTable.relateToOperator("countTrailingZeros", EOpCountTrailingZeros); + symbolTable.relateToOperator("absoluteDifference", EOpAbsDifference); + symbolTable.relateToOperator("addSaturate", EOpAddSaturate); + symbolTable.relateToOperator("subtractSaturate", EOpSubSaturate); + symbolTable.relateToOperator("average", EOpAverage); + symbolTable.relateToOperator("averageRounded", EOpAverageRounded); + symbolTable.relateToOperator("multiply32x16", EOpMul32x16); + symbolTable.relateToOperator("debugPrintfEXT", EOpDebugPrintf); + symbolTable.relateToOperator("assumeEXT", EOpAssumeEXT); + symbolTable.relateToOperator("expectEXT", EOpExpectEXT); + + + if (PureOperatorBuiltins) { + symbolTable.relateToOperator("imageSize", EOpImageQuerySize); + symbolTable.relateToOperator("imageSamples", EOpImageQuerySamples); + symbolTable.relateToOperator("imageLoad", EOpImageLoad); + symbolTable.relateToOperator("imageStore", EOpImageStore); + symbolTable.relateToOperator("imageAtomicAdd", EOpImageAtomicAdd); + symbolTable.relateToOperator("imageAtomicMin", EOpImageAtomicMin); + symbolTable.relateToOperator("imageAtomicMax", EOpImageAtomicMax); + symbolTable.relateToOperator("imageAtomicAnd", EOpImageAtomicAnd); + symbolTable.relateToOperator("imageAtomicOr", EOpImageAtomicOr); + symbolTable.relateToOperator("imageAtomicXor", EOpImageAtomicXor); + symbolTable.relateToOperator("imageAtomicExchange", EOpImageAtomicExchange); + symbolTable.relateToOperator("imageAtomicCompSwap", EOpImageAtomicCompSwap); + symbolTable.relateToOperator("imageAtomicLoad", EOpImageAtomicLoad); + symbolTable.relateToOperator("imageAtomicStore", EOpImageAtomicStore); + + symbolTable.relateToOperator("subpassLoad", EOpSubpassLoad); + symbolTable.relateToOperator("subpassLoadMS", EOpSubpassLoadMS); + + symbolTable.relateToOperator("textureGather", EOpTextureGather); + symbolTable.relateToOperator("textureGatherOffset", EOpTextureGatherOffset); + symbolTable.relateToOperator("textureGatherOffsets", EOpTextureGatherOffsets); + + symbolTable.relateToOperator("noise1", EOpNoise); + symbolTable.relateToOperator("noise2", EOpNoise); + symbolTable.relateToOperator("noise3", EOpNoise); + symbolTable.relateToOperator("noise4", EOpNoise); + + symbolTable.relateToOperator("textureFootprintNV", EOpImageSampleFootprintNV); + symbolTable.relateToOperator("textureFootprintClampNV", EOpImageSampleFootprintClampNV); + symbolTable.relateToOperator("textureFootprintLodNV", EOpImageSampleFootprintLodNV); + symbolTable.relateToOperator("textureFootprintGradNV", EOpImageSampleFootprintGradNV); + symbolTable.relateToOperator("textureFootprintGradClampNV", EOpImageSampleFootprintGradClampNV); + + if (spvVersion.spv == 0 && IncludeLegacy(version, profile, spvVersion)) + symbolTable.relateToOperator("ftransform", EOpFtransform); + + if (spvVersion.spv == 0 && (IncludeLegacy(version, profile, spvVersion) || + (profile == EEsProfile && version == 100))) { + + symbolTable.relateToOperator("texture1D", EOpTexture); + symbolTable.relateToOperator("texture1DGradARB", EOpTextureGrad); + symbolTable.relateToOperator("texture1DProj", EOpTextureProj); + symbolTable.relateToOperator("texture1DProjGradARB", EOpTextureProjGrad); + symbolTable.relateToOperator("texture1DLod", EOpTextureLod); + symbolTable.relateToOperator("texture1DProjLod", EOpTextureProjLod); + + symbolTable.relateToOperator("texture2DRect", EOpTexture); + symbolTable.relateToOperator("texture2DRectProj", EOpTextureProj); + symbolTable.relateToOperator("texture2DRectGradARB", EOpTextureGrad); + symbolTable.relateToOperator("texture2DRectProjGradARB", EOpTextureProjGrad); + symbolTable.relateToOperator("shadow2DRect", EOpTexture); + symbolTable.relateToOperator("shadow2DRectProj", EOpTextureProj); + symbolTable.relateToOperator("shadow2DRectGradARB", EOpTextureGrad); + symbolTable.relateToOperator("shadow2DRectProjGradARB", EOpTextureProjGrad); + + symbolTable.relateToOperator("texture2D", EOpTexture); + symbolTable.relateToOperator("texture2DProj", EOpTextureProj); + symbolTable.relateToOperator("texture2DGradEXT", EOpTextureGrad); + symbolTable.relateToOperator("texture2DGradARB", EOpTextureGrad); + symbolTable.relateToOperator("texture2DProjGradEXT", EOpTextureProjGrad); + symbolTable.relateToOperator("texture2DProjGradARB", EOpTextureProjGrad); + symbolTable.relateToOperator("texture2DLod", EOpTextureLod); + symbolTable.relateToOperator("texture2DLodEXT", EOpTextureLod); + symbolTable.relateToOperator("texture2DProjLod", EOpTextureProjLod); + symbolTable.relateToOperator("texture2DProjLodEXT", EOpTextureProjLod); + + symbolTable.relateToOperator("texture3D", EOpTexture); + symbolTable.relateToOperator("texture3DGradARB", EOpTextureGrad); + symbolTable.relateToOperator("texture3DProj", EOpTextureProj); + symbolTable.relateToOperator("texture3DProjGradARB", EOpTextureProjGrad); + symbolTable.relateToOperator("texture3DLod", EOpTextureLod); + symbolTable.relateToOperator("texture3DProjLod", EOpTextureProjLod); + symbolTable.relateToOperator("textureCube", EOpTexture); + symbolTable.relateToOperator("textureCubeGradEXT", EOpTextureGrad); + symbolTable.relateToOperator("textureCubeGradARB", EOpTextureGrad); + symbolTable.relateToOperator("textureCubeLod", EOpTextureLod); + symbolTable.relateToOperator("textureCubeLodEXT", EOpTextureLod); + symbolTable.relateToOperator("shadow1D", EOpTexture); + symbolTable.relateToOperator("shadow1DGradARB", EOpTextureGrad); + symbolTable.relateToOperator("shadow2D", EOpTexture); + symbolTable.relateToOperator("shadow2DGradARB", EOpTextureGrad); + symbolTable.relateToOperator("shadow1DProj", EOpTextureProj); + symbolTable.relateToOperator("shadow2DProj", EOpTextureProj); + symbolTable.relateToOperator("shadow1DProjGradARB", EOpTextureProjGrad); + symbolTable.relateToOperator("shadow2DProjGradARB", EOpTextureProjGrad); + symbolTable.relateToOperator("shadow1DLod", EOpTextureLod); + symbolTable.relateToOperator("shadow2DLod", EOpTextureLod); + symbolTable.relateToOperator("shadow1DProjLod", EOpTextureProjLod); + symbolTable.relateToOperator("shadow2DProjLod", EOpTextureProjLod); + } + + if (profile != EEsProfile) { + symbolTable.relateToOperator("sparseTextureARB", EOpSparseTexture); + symbolTable.relateToOperator("sparseTextureLodARB", EOpSparseTextureLod); + symbolTable.relateToOperator("sparseTextureOffsetARB", EOpSparseTextureOffset); + symbolTable.relateToOperator("sparseTexelFetchARB", EOpSparseTextureFetch); + symbolTable.relateToOperator("sparseTexelFetchOffsetARB", EOpSparseTextureFetchOffset); + symbolTable.relateToOperator("sparseTextureLodOffsetARB", EOpSparseTextureLodOffset); + symbolTable.relateToOperator("sparseTextureGradARB", EOpSparseTextureGrad); + symbolTable.relateToOperator("sparseTextureGradOffsetARB", EOpSparseTextureGradOffset); + symbolTable.relateToOperator("sparseTextureGatherARB", EOpSparseTextureGather); + symbolTable.relateToOperator("sparseTextureGatherOffsetARB", EOpSparseTextureGatherOffset); + symbolTable.relateToOperator("sparseTextureGatherOffsetsARB", EOpSparseTextureGatherOffsets); + symbolTable.relateToOperator("sparseImageLoadARB", EOpSparseImageLoad); + symbolTable.relateToOperator("sparseTexelsResidentARB", EOpSparseTexelsResident); + + symbolTable.relateToOperator("sparseTextureClampARB", EOpSparseTextureClamp); + symbolTable.relateToOperator("sparseTextureOffsetClampARB", EOpSparseTextureOffsetClamp); + symbolTable.relateToOperator("sparseTextureGradClampARB", EOpSparseTextureGradClamp); + symbolTable.relateToOperator("sparseTextureGradOffsetClampARB", EOpSparseTextureGradOffsetClamp); + symbolTable.relateToOperator("textureClampARB", EOpTextureClamp); + symbolTable.relateToOperator("textureOffsetClampARB", EOpTextureOffsetClamp); + symbolTable.relateToOperator("textureGradClampARB", EOpTextureGradClamp); + symbolTable.relateToOperator("textureGradOffsetClampARB", EOpTextureGradOffsetClamp); + + symbolTable.relateToOperator("ballotARB", EOpBallot); + symbolTable.relateToOperator("readInvocationARB", EOpReadInvocation); + symbolTable.relateToOperator("readFirstInvocationARB", EOpReadFirstInvocation); + + if (version >= 430) { + symbolTable.relateToOperator("anyInvocationARB", EOpAnyInvocation); + symbolTable.relateToOperator("allInvocationsARB", EOpAllInvocations); + symbolTable.relateToOperator("allInvocationsEqualARB", EOpAllInvocationsEqual); + } + if (version >= 460) { + symbolTable.relateToOperator("anyInvocation", EOpAnyInvocation); + symbolTable.relateToOperator("allInvocations", EOpAllInvocations); + symbolTable.relateToOperator("allInvocationsEqual", EOpAllInvocationsEqual); + } + // As per dependency between NV_gpu_shader5 and ARB_shader_group_vote + // anyInvocationARB = anyThreadNV + // allInvocationsARB = allThreadsNV + // allInvocationsEqualARB = allThreadsEqualNV + // Thus we reuse the Op's + if (version >= 150) { + symbolTable.relateToOperator("anyThreadNV", EOpAnyInvocation); + symbolTable.relateToOperator("allThreadsNV", EOpAllInvocations); + symbolTable.relateToOperator("allThreadsEqualNV", EOpAllInvocationsEqual); + } + symbolTable.relateToOperator("minInvocationsAMD", EOpMinInvocations); + symbolTable.relateToOperator("maxInvocationsAMD", EOpMaxInvocations); + symbolTable.relateToOperator("addInvocationsAMD", EOpAddInvocations); + symbolTable.relateToOperator("minInvocationsNonUniformAMD", EOpMinInvocationsNonUniform); + symbolTable.relateToOperator("maxInvocationsNonUniformAMD", EOpMaxInvocationsNonUniform); + symbolTable.relateToOperator("addInvocationsNonUniformAMD", EOpAddInvocationsNonUniform); + symbolTable.relateToOperator("minInvocationsInclusiveScanAMD", EOpMinInvocationsInclusiveScan); + symbolTable.relateToOperator("maxInvocationsInclusiveScanAMD", EOpMaxInvocationsInclusiveScan); + symbolTable.relateToOperator("addInvocationsInclusiveScanAMD", EOpAddInvocationsInclusiveScan); + symbolTable.relateToOperator("minInvocationsInclusiveScanNonUniformAMD", EOpMinInvocationsInclusiveScanNonUniform); + symbolTable.relateToOperator("maxInvocationsInclusiveScanNonUniformAMD", EOpMaxInvocationsInclusiveScanNonUniform); + symbolTable.relateToOperator("addInvocationsInclusiveScanNonUniformAMD", EOpAddInvocationsInclusiveScanNonUniform); + symbolTable.relateToOperator("minInvocationsExclusiveScanAMD", EOpMinInvocationsExclusiveScan); + symbolTable.relateToOperator("maxInvocationsExclusiveScanAMD", EOpMaxInvocationsExclusiveScan); + symbolTable.relateToOperator("addInvocationsExclusiveScanAMD", EOpAddInvocationsExclusiveScan); + symbolTable.relateToOperator("minInvocationsExclusiveScanNonUniformAMD", EOpMinInvocationsExclusiveScanNonUniform); + symbolTable.relateToOperator("maxInvocationsExclusiveScanNonUniformAMD", EOpMaxInvocationsExclusiveScanNonUniform); + symbolTable.relateToOperator("addInvocationsExclusiveScanNonUniformAMD", EOpAddInvocationsExclusiveScanNonUniform); + symbolTable.relateToOperator("swizzleInvocationsAMD", EOpSwizzleInvocations); + symbolTable.relateToOperator("swizzleInvocationsMaskedAMD", EOpSwizzleInvocationsMasked); + symbolTable.relateToOperator("writeInvocationAMD", EOpWriteInvocation); + symbolTable.relateToOperator("mbcntAMD", EOpMbcnt); + + symbolTable.relateToOperator("min3", EOpMin3); + symbolTable.relateToOperator("max3", EOpMax3); + symbolTable.relateToOperator("mid3", EOpMid3); + + symbolTable.relateToOperator("cubeFaceIndexAMD", EOpCubeFaceIndex); + symbolTable.relateToOperator("cubeFaceCoordAMD", EOpCubeFaceCoord); + symbolTable.relateToOperator("timeAMD", EOpTime); + + symbolTable.relateToOperator("textureGatherLodAMD", EOpTextureGatherLod); + symbolTable.relateToOperator("textureGatherLodOffsetAMD", EOpTextureGatherLodOffset); + symbolTable.relateToOperator("textureGatherLodOffsetsAMD", EOpTextureGatherLodOffsets); + symbolTable.relateToOperator("sparseTextureGatherLodAMD", EOpSparseTextureGatherLod); + symbolTable.relateToOperator("sparseTextureGatherLodOffsetAMD", EOpSparseTextureGatherLodOffset); + symbolTable.relateToOperator("sparseTextureGatherLodOffsetsAMD", EOpSparseTextureGatherLodOffsets); + + symbolTable.relateToOperator("imageLoadLodAMD", EOpImageLoadLod); + symbolTable.relateToOperator("imageStoreLodAMD", EOpImageStoreLod); + symbolTable.relateToOperator("sparseImageLoadLodAMD", EOpSparseImageLoadLod); + + symbolTable.relateToOperator("fragmentMaskFetchAMD", EOpFragmentMaskFetch); + symbolTable.relateToOperator("fragmentFetchAMD", EOpFragmentFetch); + } + + // GL_EXT_integer_dot_product + if ((profile == EEsProfile && version >= 300) || + (profile != EEsProfile && version >= 450)) { + symbolTable.relateToOperator("dotEXT", EOpDot); + symbolTable.relateToOperator("dotPacked4x8EXT", EOpDotPackedEXT); + symbolTable.relateToOperator("dotAccSatEXT", EOpDotAccSatEXT); + symbolTable.relateToOperator("dotPacked4x8AccSatEXT", EOpDotPackedAccSatEXT); + } + + // GL_EXT_bfloat16 + if ((profile == EEsProfile && version >= 320) || + (profile != EEsProfile && version >= 450)) { + symbolTable.relateToOperator("bfloat16BitsToIntEXT", EOpFloatBitsToInt); + symbolTable.relateToOperator("bfloat16BitsToUintEXT", EOpFloatBitsToUint); + symbolTable.relateToOperator("intBitsToBFloat16EXT", EOpIntBitsToFloat); + symbolTable.relateToOperator("uintBitsToBFloat16EXT", EOpUintBitsToFloat); + + symbolTable.relateToOperator("floate5m2BitsToIntEXT", EOpFloatBitsToInt); + symbolTable.relateToOperator("floate5m2BitsToUintEXT", EOpFloatBitsToUint); + symbolTable.relateToOperator("intBitsToFloate5m2EXT", EOpIntBitsToFloat); + symbolTable.relateToOperator("uintBitsToFloate5m2EXT", EOpUintBitsToFloat); + + symbolTable.relateToOperator("floate4m3BitsToIntEXT", EOpFloatBitsToInt); + symbolTable.relateToOperator("floate4m3BitsToUintEXT", EOpFloatBitsToUint); + symbolTable.relateToOperator("intBitsToFloate4m3EXT", EOpIntBitsToFloat); + symbolTable.relateToOperator("uintBitsToFloate4m3EXT", EOpUintBitsToFloat); + + symbolTable.relateToOperator("saturatedConvertEXT", EOpConstructSaturated); + } + + // GL_KHR_shader_subgroup + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + symbolTable.relateToOperator("subgroupBarrier", EOpSubgroupBarrier); + symbolTable.relateToOperator("subgroupMemoryBarrier", EOpSubgroupMemoryBarrier); + symbolTable.relateToOperator("subgroupMemoryBarrierBuffer", EOpSubgroupMemoryBarrierBuffer); + symbolTable.relateToOperator("subgroupMemoryBarrierImage", EOpSubgroupMemoryBarrierImage); + symbolTable.relateToOperator("subgroupElect", EOpSubgroupElect); + symbolTable.relateToOperator("subgroupAll", EOpSubgroupAll); + symbolTable.relateToOperator("subgroupAny", EOpSubgroupAny); + symbolTable.relateToOperator("subgroupAllEqual", EOpSubgroupAllEqual); + symbolTable.relateToOperator("subgroupBroadcast", EOpSubgroupBroadcast); + symbolTable.relateToOperator("subgroupBroadcastFirst", EOpSubgroupBroadcastFirst); + symbolTable.relateToOperator("subgroupBallot", EOpSubgroupBallot); + symbolTable.relateToOperator("subgroupInverseBallot", EOpSubgroupInverseBallot); + symbolTable.relateToOperator("subgroupBallotBitExtract", EOpSubgroupBallotBitExtract); + symbolTable.relateToOperator("subgroupBallotBitCount", EOpSubgroupBallotBitCount); + symbolTable.relateToOperator("subgroupBallotInclusiveBitCount", EOpSubgroupBallotInclusiveBitCount); + symbolTable.relateToOperator("subgroupBallotExclusiveBitCount", EOpSubgroupBallotExclusiveBitCount); + symbolTable.relateToOperator("subgroupBallotFindLSB", EOpSubgroupBallotFindLSB); + symbolTable.relateToOperator("subgroupBallotFindMSB", EOpSubgroupBallotFindMSB); + symbolTable.relateToOperator("subgroupShuffle", EOpSubgroupShuffle); + symbolTable.relateToOperator("subgroupShuffleXor", EOpSubgroupShuffleXor); + symbolTable.relateToOperator("subgroupShuffleUp", EOpSubgroupShuffleUp); + symbolTable.relateToOperator("subgroupShuffleDown", EOpSubgroupShuffleDown); + symbolTable.relateToOperator("subgroupRotate", EOpSubgroupRotate); + symbolTable.relateToOperator("subgroupClusteredRotate", EOpSubgroupClusteredRotate); + symbolTable.relateToOperator("subgroupAdd", EOpSubgroupAdd); + symbolTable.relateToOperator("subgroupMul", EOpSubgroupMul); + symbolTable.relateToOperator("subgroupMin", EOpSubgroupMin); + symbolTable.relateToOperator("subgroupMax", EOpSubgroupMax); + symbolTable.relateToOperator("subgroupAnd", EOpSubgroupAnd); + symbolTable.relateToOperator("subgroupOr", EOpSubgroupOr); + symbolTable.relateToOperator("subgroupXor", EOpSubgroupXor); + symbolTable.relateToOperator("subgroupInclusiveAdd", EOpSubgroupInclusiveAdd); + symbolTable.relateToOperator("subgroupInclusiveMul", EOpSubgroupInclusiveMul); + symbolTable.relateToOperator("subgroupInclusiveMin", EOpSubgroupInclusiveMin); + symbolTable.relateToOperator("subgroupInclusiveMax", EOpSubgroupInclusiveMax); + symbolTable.relateToOperator("subgroupInclusiveAnd", EOpSubgroupInclusiveAnd); + symbolTable.relateToOperator("subgroupInclusiveOr", EOpSubgroupInclusiveOr); + symbolTable.relateToOperator("subgroupInclusiveXor", EOpSubgroupInclusiveXor); + symbolTable.relateToOperator("subgroupExclusiveAdd", EOpSubgroupExclusiveAdd); + symbolTable.relateToOperator("subgroupExclusiveMul", EOpSubgroupExclusiveMul); + symbolTable.relateToOperator("subgroupExclusiveMin", EOpSubgroupExclusiveMin); + symbolTable.relateToOperator("subgroupExclusiveMax", EOpSubgroupExclusiveMax); + symbolTable.relateToOperator("subgroupExclusiveAnd", EOpSubgroupExclusiveAnd); + symbolTable.relateToOperator("subgroupExclusiveOr", EOpSubgroupExclusiveOr); + symbolTable.relateToOperator("subgroupExclusiveXor", EOpSubgroupExclusiveXor); + symbolTable.relateToOperator("subgroupClusteredAdd", EOpSubgroupClusteredAdd); + symbolTable.relateToOperator("subgroupClusteredMul", EOpSubgroupClusteredMul); + symbolTable.relateToOperator("subgroupClusteredMin", EOpSubgroupClusteredMin); + symbolTable.relateToOperator("subgroupClusteredMax", EOpSubgroupClusteredMax); + symbolTable.relateToOperator("subgroupClusteredAnd", EOpSubgroupClusteredAnd); + symbolTable.relateToOperator("subgroupClusteredOr", EOpSubgroupClusteredOr); + symbolTable.relateToOperator("subgroupClusteredXor", EOpSubgroupClusteredXor); + symbolTable.relateToOperator("subgroupQuadBroadcast", EOpSubgroupQuadBroadcast); + symbolTable.relateToOperator("subgroupQuadSwapHorizontal", EOpSubgroupQuadSwapHorizontal); + symbolTable.relateToOperator("subgroupQuadSwapVertical", EOpSubgroupQuadSwapVertical); + symbolTable.relateToOperator("subgroupQuadSwapDiagonal", EOpSubgroupQuadSwapDiagonal); + + symbolTable.relateToOperator("subgroupPartitionNV", EOpSubgroupPartition); + symbolTable.relateToOperator("subgroupPartitionedAddNV", EOpSubgroupPartitionedAdd); + symbolTable.relateToOperator("subgroupPartitionedMulNV", EOpSubgroupPartitionedMul); + symbolTable.relateToOperator("subgroupPartitionedMinNV", EOpSubgroupPartitionedMin); + symbolTable.relateToOperator("subgroupPartitionedMaxNV", EOpSubgroupPartitionedMax); + symbolTable.relateToOperator("subgroupPartitionedAndNV", EOpSubgroupPartitionedAnd); + symbolTable.relateToOperator("subgroupPartitionedOrNV", EOpSubgroupPartitionedOr); + symbolTable.relateToOperator("subgroupPartitionedXorNV", EOpSubgroupPartitionedXor); + symbolTable.relateToOperator("subgroupPartitionedInclusiveAddNV", EOpSubgroupPartitionedInclusiveAdd); + symbolTable.relateToOperator("subgroupPartitionedInclusiveMulNV", EOpSubgroupPartitionedInclusiveMul); + symbolTable.relateToOperator("subgroupPartitionedInclusiveMinNV", EOpSubgroupPartitionedInclusiveMin); + symbolTable.relateToOperator("subgroupPartitionedInclusiveMaxNV", EOpSubgroupPartitionedInclusiveMax); + symbolTable.relateToOperator("subgroupPartitionedInclusiveAndNV", EOpSubgroupPartitionedInclusiveAnd); + symbolTable.relateToOperator("subgroupPartitionedInclusiveOrNV", EOpSubgroupPartitionedInclusiveOr); + symbolTable.relateToOperator("subgroupPartitionedInclusiveXorNV", EOpSubgroupPartitionedInclusiveXor); + symbolTable.relateToOperator("subgroupPartitionedExclusiveAddNV", EOpSubgroupPartitionedExclusiveAdd); + symbolTable.relateToOperator("subgroupPartitionedExclusiveMulNV", EOpSubgroupPartitionedExclusiveMul); + symbolTable.relateToOperator("subgroupPartitionedExclusiveMinNV", EOpSubgroupPartitionedExclusiveMin); + symbolTable.relateToOperator("subgroupPartitionedExclusiveMaxNV", EOpSubgroupPartitionedExclusiveMax); + symbolTable.relateToOperator("subgroupPartitionedExclusiveAndNV", EOpSubgroupPartitionedExclusiveAnd); + symbolTable.relateToOperator("subgroupPartitionedExclusiveOrNV", EOpSubgroupPartitionedExclusiveOr); + symbolTable.relateToOperator("subgroupPartitionedExclusiveXorNV", EOpSubgroupPartitionedExclusiveXor); + } + + if (profile == EEsProfile) { + symbolTable.relateToOperator("shadow2DEXT", EOpTexture); + symbolTable.relateToOperator("shadow2DProjEXT", EOpTextureProj); + } + + // GL_EXT_shader_quad_control + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + symbolTable.relateToOperator("subgroupQuadAll", EOpSubgroupQuadAll); + symbolTable.relateToOperator("subgroupQuadAny", EOpSubgroupQuadAny); + } + + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + symbolTable.relateToOperator("textureWeightedQCOM", EOpImageSampleWeightedQCOM); + symbolTable.relateToOperator("textureBoxFilterQCOM", EOpImageBoxFilterQCOM); + symbolTable.relateToOperator("textureBlockMatchSADQCOM", EOpImageBlockMatchSADQCOM); + symbolTable.relateToOperator("textureBlockMatchSSDQCOM", EOpImageBlockMatchSSDQCOM); + + symbolTable.relateToOperator("textureBlockMatchWindowSSDQCOM", EOpImageBlockMatchWindowSSDQCOM); + symbolTable.relateToOperator("textureBlockMatchWindowSADQCOM", EOpImageBlockMatchWindowSADQCOM); + symbolTable.relateToOperator("textureBlockMatchGatherSSDQCOM", EOpImageBlockMatchGatherSSDQCOM); + symbolTable.relateToOperator("textureBlockMatchGatherSADQCOM", EOpImageBlockMatchGatherSADQCOM); + } + + if (profile != EEsProfile && spvVersion.spv == 0) { + symbolTable.relateToOperator("texture1DArray", EOpTexture); + symbolTable.relateToOperator("texture2DArray", EOpTexture); + symbolTable.relateToOperator("shadow1DArray", EOpTexture); + symbolTable.relateToOperator("shadow2DArray", EOpTexture); + + symbolTable.relateToOperator("texture1DArrayLod", EOpTextureLod); + symbolTable.relateToOperator("texture2DArrayLod", EOpTextureLod); + symbolTable.relateToOperator("shadow1DArrayLod", EOpTextureLod); + } + + symbolTable.relateToOperator("coopVecMatMulNV", EOpCooperativeVectorMatMulNV); + symbolTable.relateToOperator("coopVecMatMulAddNV", EOpCooperativeVectorMatMulAddNV); + symbolTable.relateToOperator("coopVecLoadNV", EOpCooperativeVectorLoadNV); + symbolTable.relateToOperator("coopVecStoreNV", EOpCooperativeVectorStoreNV); + symbolTable.relateToOperator("coopVecOuterProductAccumulateNV", EOpCooperativeVectorOuterProductAccumulateNV); + symbolTable.relateToOperator("coopVecReduceSumAccumulateNV", EOpCooperativeVectorReduceSumAccumulateNV); + } + + switch(language) { + case EShLangVertex: + break; + + case EShLangTessControl: + case EShLangTessEvaluation: + break; + + case EShLangGeometry: + symbolTable.relateToOperator("EmitStreamVertex", EOpEmitStreamVertex); + symbolTable.relateToOperator("EndStreamPrimitive", EOpEndStreamPrimitive); + symbolTable.relateToOperator("EmitVertex", EOpEmitVertex); + symbolTable.relateToOperator("EndPrimitive", EOpEndPrimitive); + break; + + case EShLangFragment: + if (profile != EEsProfile && version >= 400) { + symbolTable.relateToOperator("dFdxFine", EOpDPdxFine); + symbolTable.relateToOperator("dFdyFine", EOpDPdyFine); + symbolTable.relateToOperator("fwidthFine", EOpFwidthFine); + symbolTable.relateToOperator("dFdxCoarse", EOpDPdxCoarse); + symbolTable.relateToOperator("dFdyCoarse", EOpDPdyCoarse); + symbolTable.relateToOperator("fwidthCoarse", EOpFwidthCoarse); + } + + if (profile != EEsProfile && version >= 460) { + symbolTable.relateToOperator("rayQueryInitializeEXT", EOpRayQueryInitialize); + symbolTable.relateToOperator("rayQueryTerminateEXT", EOpRayQueryTerminate); + symbolTable.relateToOperator("rayQueryGenerateIntersectionEXT", EOpRayQueryGenerateIntersection); + symbolTable.relateToOperator("rayQueryConfirmIntersectionEXT", EOpRayQueryConfirmIntersection); + symbolTable.relateToOperator("rayQueryProceedEXT", EOpRayQueryProceed); + symbolTable.relateToOperator("rayQueryGetIntersectionTypeEXT", EOpRayQueryGetIntersectionType); + symbolTable.relateToOperator("rayQueryGetRayTMinEXT", EOpRayQueryGetRayTMin); + symbolTable.relateToOperator("rayQueryGetRayFlagsEXT", EOpRayQueryGetRayFlags); + symbolTable.relateToOperator("rayQueryGetIntersectionTEXT", EOpRayQueryGetIntersectionT); + symbolTable.relateToOperator("rayQueryGetIntersectionInstanceCustomIndexEXT", EOpRayQueryGetIntersectionInstanceCustomIndex); + symbolTable.relateToOperator("rayQueryGetIntersectionInstanceIdEXT", EOpRayQueryGetIntersectionInstanceId); + symbolTable.relateToOperator("rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT", EOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffset); + symbolTable.relateToOperator("rayQueryGetIntersectionGeometryIndexEXT", EOpRayQueryGetIntersectionGeometryIndex); + symbolTable.relateToOperator("rayQueryGetIntersectionPrimitiveIndexEXT", EOpRayQueryGetIntersectionPrimitiveIndex); + symbolTable.relateToOperator("rayQueryGetIntersectionBarycentricsEXT", EOpRayQueryGetIntersectionBarycentrics); + symbolTable.relateToOperator("rayQueryGetIntersectionFrontFaceEXT", EOpRayQueryGetIntersectionFrontFace); + symbolTable.relateToOperator("rayQueryGetIntersectionCandidateAABBOpaqueEXT", EOpRayQueryGetIntersectionCandidateAABBOpaque); + symbolTable.relateToOperator("rayQueryGetIntersectionObjectRayDirectionEXT", EOpRayQueryGetIntersectionObjectRayDirection); + symbolTable.relateToOperator("rayQueryGetIntersectionObjectRayOriginEXT", EOpRayQueryGetIntersectionObjectRayOrigin); + symbolTable.relateToOperator("rayQueryGetWorldRayDirectionEXT", EOpRayQueryGetWorldRayDirection); + symbolTable.relateToOperator("rayQueryGetWorldRayOriginEXT", EOpRayQueryGetWorldRayOrigin); + symbolTable.relateToOperator("rayQueryGetIntersectionObjectToWorldEXT", EOpRayQueryGetIntersectionObjectToWorld); + symbolTable.relateToOperator("rayQueryGetIntersectionWorldToObjectEXT", EOpRayQueryGetIntersectionWorldToObject); + symbolTable.relateToOperator("rayQueryGetIntersectionTriangleVertexPositionsEXT", EOpRayQueryGetIntersectionTriangleVertexPositionsEXT); + symbolTable.relateToOperator("rayQueryGetIntersectionClusterIdNV", EOpRayQueryGetIntersectionClusterIdNV); + symbolTable.relateToOperator("rayQueryGetIntersectionSpherePositionNV", EOpRayQueryGetIntersectionSpherePositionNV); + symbolTable.relateToOperator("rayQueryGetIntersectionSphereRadiusNV", EOpRayQueryGetIntersectionSphereRadiusNV); + symbolTable.relateToOperator("rayQueryGetIntersectionLSSHitValueNV", EOpRayQueryGetIntersectionLSSHitValueNV); + symbolTable.relateToOperator("rayQueryGetIntersectionLSSPositionsNV", EOpRayQueryGetIntersectionLSSPositionsNV); + symbolTable.relateToOperator("rayQueryGetIntersectionLSSRadiiNV", EOpRayQueryGetIntersectionLSSRadiiNV); + symbolTable.relateToOperator("rayQueryIsSphereHitNV", EOpRayQueryIsSphereHitNV); + symbolTable.relateToOperator("rayQueryIsLSSHitNV", EOpRayQueryIsLSSHitNV); + } + + symbolTable.relateToOperator("interpolateAtCentroid", EOpInterpolateAtCentroid); + symbolTable.relateToOperator("interpolateAtSample", EOpInterpolateAtSample); + symbolTable.relateToOperator("interpolateAtOffset", EOpInterpolateAtOffset); + + if (profile != EEsProfile) + symbolTable.relateToOperator("interpolateAtVertexAMD", EOpInterpolateAtVertex); + + symbolTable.relateToOperator("beginInvocationInterlockARB", EOpBeginInvocationInterlock); + symbolTable.relateToOperator("endInvocationInterlockARB", EOpEndInvocationInterlock); + + symbolTable.relateToOperator("stencilAttachmentReadEXT", EOpStencilAttachmentReadEXT); + symbolTable.relateToOperator("depthAttachmentReadEXT", EOpDepthAttachmentReadEXT); + symbolTable.relateToOperator("colorAttachmentReadEXT", EOpColorAttachmentReadEXT); + + break; + + case EShLangCompute: + symbolTable.relateToOperator("subgroupMemoryBarrierShared", EOpSubgroupMemoryBarrierShared); + if ((profile != EEsProfile && version >= 450) || + (profile == EEsProfile && version >= 320)) { + symbolTable.relateToOperator("dFdx", EOpDPdx); + symbolTable.relateToOperator("dFdy", EOpDPdy); + symbolTable.relateToOperator("fwidth", EOpFwidth); + symbolTable.relateToOperator("dFdxFine", EOpDPdxFine); + symbolTable.relateToOperator("dFdyFine", EOpDPdyFine); + symbolTable.relateToOperator("fwidthFine", EOpFwidthFine); + symbolTable.relateToOperator("dFdxCoarse", EOpDPdxCoarse); + symbolTable.relateToOperator("dFdyCoarse", EOpDPdyCoarse); + symbolTable.relateToOperator("fwidthCoarse",EOpFwidthCoarse); + } + symbolTable.relateToOperator("coopMatLoadNV", EOpCooperativeMatrixLoadNV); + symbolTable.relateToOperator("coopMatStoreNV", EOpCooperativeMatrixStoreNV); + symbolTable.relateToOperator("coopMatMulAddNV", EOpCooperativeMatrixMulAddNV); + + symbolTable.relateToOperator("coopMatLoad", EOpCooperativeMatrixLoad); + symbolTable.relateToOperator("coopMatStore", EOpCooperativeMatrixStore); + symbolTable.relateToOperator("coopMatMulAdd", EOpCooperativeMatrixMulAdd); + + symbolTable.relateToOperator("coopMatLoadTensorNV", EOpCooperativeMatrixLoadTensorNV); + symbolTable.relateToOperator("coopMatStoreTensorNV", EOpCooperativeMatrixStoreTensorNV); + + symbolTable.relateToOperator("coopMatReduceNV", EOpCooperativeMatrixReduceNV); + symbolTable.relateToOperator("coopMatPerElementNV", EOpCooperativeMatrixPerElementOpNV); + symbolTable.relateToOperator("coopMatTransposeNV", EOpCooperativeMatrixTransposeNV); + + symbolTable.relateToOperator("createTensorLayoutNV", EOpCreateTensorLayoutNV); + symbolTable.relateToOperator("setTensorLayoutBlockSizeNV", EOpTensorLayoutSetBlockSizeNV); + symbolTable.relateToOperator("setTensorLayoutDimensionNV", EOpTensorLayoutSetDimensionNV); + symbolTable.relateToOperator("setTensorLayoutStrideNV", EOpTensorLayoutSetStrideNV); + symbolTable.relateToOperator("sliceTensorLayoutNV", EOpTensorLayoutSliceNV); + symbolTable.relateToOperator("setTensorLayoutClampValueNV", EOpTensorLayoutSetClampValueNV); + + symbolTable.relateToOperator("createTensorViewNV", EOpCreateTensorViewNV); + symbolTable.relateToOperator("setTensorViewDimensionsNV", EOpTensorViewSetDimensionNV); + symbolTable.relateToOperator("setTensorViewStrideNV", EOpTensorViewSetStrideNV); + symbolTable.relateToOperator("setTensorViewClipNV", EOpTensorViewSetClipNV); + + symbolTable.relateToOperator("tensorReadARM", EOpTensorReadARM); + symbolTable.relateToOperator("tensorWriteARM", EOpTensorWriteARM); + symbolTable.relateToOperator("tensorSizeARM", EOpTensorSizeARM); + + symbolTable.relateToOperator("bitcastQCOM", EOpBitCastArrayQCOM); + symbolTable.relateToOperator("extractSubArrayQCOM", EOpExtractSubArrayQCOM); + symbolTable.relateToOperator("vectorToCoopmatQCOM", EOpCompositeConstructCoopMatQCOM); + symbolTable.relateToOperator("coopmatToVectorQCOM", EOpCompositeExtractCoopMatQCOM); + + if (profile != EEsProfile && version >= 460) { + symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV); + symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV); + } + break; + + case EShLangRayGen: + if (profile != EEsProfile && version >= 460) { + symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV); + symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV); + } + [[fallthrough]]; + case EShLangClosestHit: + case EShLangMiss: + if (profile != EEsProfile && version >= 460) { + symbolTable.relateToOperator("traceNV", EOpTraceNV); + symbolTable.relateToOperator("traceRayMotionNV", EOpTraceRayMotionNV); + symbolTable.relateToOperator("traceRayEXT", EOpTraceKHR); + symbolTable.relateToOperator("executeCallableNV", EOpExecuteCallableNV); + symbolTable.relateToOperator("executeCallableEXT", EOpExecuteCallableKHR); + + symbolTable.relateToOperator("hitObjectTraceRayNV", EOpHitObjectTraceRayNV); + symbolTable.relateToOperator("hitObjectTraceRayMotionNV", EOpHitObjectTraceRayMotionNV); + symbolTable.relateToOperator("hitObjectRecordHitNV", EOpHitObjectRecordHitNV); + symbolTable.relateToOperator("hitObjectRecordHitMotionNV", EOpHitObjectRecordHitMotionNV); + symbolTable.relateToOperator("hitObjectRecordHitWithIndexNV", EOpHitObjectRecordHitWithIndexNV); + symbolTable.relateToOperator("hitObjectRecordHitWithIndexMotionNV", EOpHitObjectRecordHitWithIndexMotionNV); + symbolTable.relateToOperator("hitObjectRecordMissNV", EOpHitObjectRecordMissNV); + symbolTable.relateToOperator("hitObjectRecordMissMotionNV", EOpHitObjectRecordMissMotionNV); + symbolTable.relateToOperator("hitObjectRecordEmptyNV", EOpHitObjectRecordEmptyNV); + symbolTable.relateToOperator("hitObjectExecuteShaderNV", EOpHitObjectExecuteShaderNV); + symbolTable.relateToOperator("hitObjectIsEmptyNV", EOpHitObjectIsEmptyNV); + symbolTable.relateToOperator("hitObjectIsMissNV", EOpHitObjectIsMissNV); + symbolTable.relateToOperator("hitObjectIsHitNV", EOpHitObjectIsHitNV); + symbolTable.relateToOperator("hitObjectGetRayTMinNV", EOpHitObjectGetRayTMinNV); + symbolTable.relateToOperator("hitObjectGetRayTMaxNV", EOpHitObjectGetRayTMaxNV); + symbolTable.relateToOperator("hitObjectGetObjectRayOriginNV", EOpHitObjectGetObjectRayOriginNV); + symbolTable.relateToOperator("hitObjectGetObjectRayDirectionNV", EOpHitObjectGetObjectRayDirectionNV); + symbolTable.relateToOperator("hitObjectGetWorldRayOriginNV", EOpHitObjectGetWorldRayOriginNV); + symbolTable.relateToOperator("hitObjectGetWorldRayDirectionNV", EOpHitObjectGetWorldRayDirectionNV); + symbolTable.relateToOperator("hitObjectGetWorldToObjectNV", EOpHitObjectGetWorldToObjectNV); + symbolTable.relateToOperator("hitObjectGetObjectToWorldNV", EOpHitObjectGetObjectToWorldNV); + symbolTable.relateToOperator("hitObjectGetInstanceCustomIndexNV", EOpHitObjectGetInstanceCustomIndexNV); + symbolTable.relateToOperator("hitObjectGetInstanceIdNV", EOpHitObjectGetInstanceIdNV); + symbolTable.relateToOperator("hitObjectGetGeometryIndexNV", EOpHitObjectGetGeometryIndexNV); + symbolTable.relateToOperator("hitObjectGetPrimitiveIndexNV", EOpHitObjectGetPrimitiveIndexNV); + symbolTable.relateToOperator("hitObjectGetHitKindNV", EOpHitObjectGetHitKindNV); + symbolTable.relateToOperator("hitObjectGetAttributesNV", EOpHitObjectGetAttributesNV); + symbolTable.relateToOperator("hitObjectGetCurrentTimeNV", EOpHitObjectGetCurrentTimeNV); + symbolTable.relateToOperator("hitObjectGetShaderBindingTableRecordIndexNV", EOpHitObjectGetShaderBindingTableRecordIndexNV); + symbolTable.relateToOperator("hitObjectGetShaderRecordBufferHandleNV", EOpHitObjectGetShaderRecordBufferHandleNV); + symbolTable.relateToOperator("hitObjectGetClusterIdNV", EOpHitObjectGetClusterIdNV); + symbolTable.relateToOperator("reorderThreadNV", EOpReorderThreadNV); + symbolTable.relateToOperator("hitObjectGetSpherePositionNV", EOpHitObjectGetSpherePositionNV); + symbolTable.relateToOperator("hitObjectGetSphereRadiusNV", EOpHitObjectGetSphereRadiusNV); + symbolTable.relateToOperator("hitObjectGetLSSPositionsNV", EOpHitObjectGetLSSPositionsNV); + symbolTable.relateToOperator("hitObjectGetLSSRadiiNV", EOpHitObjectGetLSSRadiiNV); + symbolTable.relateToOperator("hitObjectIsSphereHitNV", EOpHitObjectIsSphereHitNV); + symbolTable.relateToOperator("hitObjectIsLSSHitNV", EOpHitObjectIsLSSHitNV); + symbolTable.relateToOperator("hitObjectTraceRayEXT", EOpHitObjectTraceRayEXT); + symbolTable.relateToOperator("hitObjectTraceRayMotionEXT", EOpHitObjectTraceRayMotionEXT); + symbolTable.relateToOperator("hitObjectRecordMissEXT", EOpHitObjectRecordMissEXT); + symbolTable.relateToOperator("hitObjectRecordMissMotionEXT", EOpHitObjectRecordMissMotionEXT); + symbolTable.relateToOperator("hitObjectRecordEmptyEXT", EOpHitObjectRecordEmptyEXT); + symbolTable.relateToOperator("hitObjectExecuteShaderEXT", EOpHitObjectExecuteShaderEXT); + symbolTable.relateToOperator("hitObjectIsEmptyEXT", EOpHitObjectIsEmptyEXT); + symbolTable.relateToOperator("hitObjectIsMissEXT", EOpHitObjectIsMissEXT); + symbolTable.relateToOperator("hitObjectIsHitEXT", EOpHitObjectIsHitEXT); + symbolTable.relateToOperator("hitObjectGetRayTMinEXT", EOpHitObjectGetRayTMinEXT); + symbolTable.relateToOperator("hitObjectGetRayTMaxEXT", EOpHitObjectGetRayTMaxEXT); + symbolTable.relateToOperator("hitObjectGetRayFlagsEXT", EOpHitObjectGetRayFlagsEXT); + symbolTable.relateToOperator("hitObjectGetObjectRayOriginEXT", EOpHitObjectGetObjectRayOriginEXT); + symbolTable.relateToOperator("hitObjectGetObjectRayDirectionEXT", EOpHitObjectGetObjectRayDirectionEXT); + symbolTable.relateToOperator("hitObjectGetWorldRayOriginEXT", EOpHitObjectGetWorldRayOriginEXT); + symbolTable.relateToOperator("hitObjectGetWorldRayDirectionEXT", EOpHitObjectGetWorldRayDirectionEXT); + symbolTable.relateToOperator("hitObjectGetWorldToObjectEXT", EOpHitObjectGetWorldToObjectEXT); + symbolTable.relateToOperator("hitObjectGetObjectToWorldEXT", EOpHitObjectGetObjectToWorldEXT); + symbolTable.relateToOperator("hitObjectGetInstanceCustomIndexEXT", EOpHitObjectGetInstanceCustomIndexEXT); + symbolTable.relateToOperator("hitObjectGetInstanceIdEXT", EOpHitObjectGetInstanceIdEXT); + symbolTable.relateToOperator("hitObjectGetGeometryIndexEXT", EOpHitObjectGetGeometryIndexEXT); + symbolTable.relateToOperator("hitObjectGetPrimitiveIndexEXT", EOpHitObjectGetPrimitiveIndexEXT); + symbolTable.relateToOperator("hitObjectGetHitKindEXT", EOpHitObjectGetHitKindEXT); + symbolTable.relateToOperator("hitObjectGetAttributesEXT", EOpHitObjectGetAttributesEXT); + symbolTable.relateToOperator("hitObjectGetCurrentTimeEXT", EOpHitObjectGetCurrentTimeEXT); + symbolTable.relateToOperator("hitObjectGetShaderBindingTableRecordIndexEXT", EOpHitObjectGetShaderBindingTableRecordIndexEXT); + symbolTable.relateToOperator("hitObjectGetShaderRecordBufferHandleEXT", EOpHitObjectGetShaderRecordBufferHandleEXT); + symbolTable.relateToOperator("hitObjectSetShaderBindingTableRecordIndexEXT", EOpHitObjectSetShaderBindingTableRecordIndexEXT); + symbolTable.relateToOperator("reorderThreadEXT", EOpReorderThreadEXT); + symbolTable.relateToOperator("hitObjectReorderExecuteEXT", EOpHitObjectReorderExecuteEXT); + symbolTable.relateToOperator("hitObjectTraceReorderExecuteEXT", EOpHitObjectTraceReorderExecuteEXT); + symbolTable.relateToOperator("hitObjectTraceMotionReorderExecuteEXT", EOpHitObjectTraceMotionReorderExecuteEXT); + symbolTable.relateToOperator("hitObjectRecordFromQueryEXT", EOpHitObjectRecordFromQueryEXT); + symbolTable.relateToOperator("hitObjectGetIntersectionTriangleVertexPositionsEXT", EOpHitObjectGetIntersectionTriangleVertexPositionsEXT); + } + break; + case EShLangIntersect: + if (profile != EEsProfile && version >= 460) { + symbolTable.relateToOperator("reportIntersectionNV", EOpReportIntersection); + symbolTable.relateToOperator("reportIntersectionEXT", EOpReportIntersection); + } + break; + case EShLangAnyHit: + if (profile != EEsProfile && version >= 460) { + symbolTable.relateToOperator("ignoreIntersectionNV", EOpIgnoreIntersectionNV); + symbolTable.relateToOperator("terminateRayNV", EOpTerminateRayNV); + } + break; + case EShLangCallable: + if (profile != EEsProfile && version >= 460) { + symbolTable.relateToOperator("executeCallableNV", EOpExecuteCallableNV); + symbolTable.relateToOperator("executeCallableEXT", EOpExecuteCallableKHR); + } + break; + case EShLangMesh: + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + symbolTable.relateToOperator("writePackedPrimitiveIndices4x8NV", EOpWritePackedPrimitiveIndices4x8NV); + symbolTable.relateToOperator("memoryBarrierShared", EOpMemoryBarrierShared); + symbolTable.relateToOperator("groupMemoryBarrier", EOpGroupMemoryBarrier); + symbolTable.relateToOperator("subgroupMemoryBarrierShared", EOpSubgroupMemoryBarrierShared); + } + + if (profile != EEsProfile && version >= 450) { + symbolTable.relateToOperator("SetMeshOutputsEXT", EOpSetMeshOutputsEXT); + } + + if (profile != EEsProfile && version >= 460) { + // Builtins for GL_NV_displacement_micromap. + symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV); + symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV); + } + break; + case EShLangTask: + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + symbolTable.relateToOperator("memoryBarrierShared", EOpMemoryBarrierShared); + symbolTable.relateToOperator("groupMemoryBarrier", EOpGroupMemoryBarrier); + symbolTable.relateToOperator("subgroupMemoryBarrierShared", EOpSubgroupMemoryBarrierShared); + } + if (profile != EEsProfile && version >= 450) { + symbolTable.relateToOperator("EmitMeshTasksEXT", EOpEmitMeshTasksEXT); + } + break; + + default: + assert(false && "Language not supported"); + } +} + +// +// Add context-dependent (resource-specific) built-ins not handled by the above. These +// would be ones that need to be programmatically added because they cannot +// be added by simple text strings. For these, also +// 1) Map built-in functions to operators, for those that will turn into an operation node +// instead of remaining a function call. +// 2) Tag extension-related symbols added to their base version with their extensions, so +// that if an early version has the extension turned off, there is an error reported on use. +// +void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources) +{ + if (profile != EEsProfile && version >= 430 && version < 440) { + symbolTable.setVariableExtensions("gl_MaxTransformFeedbackBuffers", 1, &E_GL_ARB_enhanced_layouts); + symbolTable.setVariableExtensions("gl_MaxTransformFeedbackInterleavedComponents", 1, &E_GL_ARB_enhanced_layouts); + } + if (profile != EEsProfile && version >= 130 && version < 420) { + symbolTable.setVariableExtensions("gl_MinProgramTexelOffset", 1, &E_GL_ARB_shading_language_420pack); + symbolTable.setVariableExtensions("gl_MaxProgramTexelOffset", 1, &E_GL_ARB_shading_language_420pack); + } + if (profile != EEsProfile && version >= 150 && version < 410) + symbolTable.setVariableExtensions("gl_MaxViewports", 1, &E_GL_ARB_viewport_array); + + switch(language) { + case EShLangFragment: + // Set up gl_FragData based on current array size. + if (version == 100 || IncludeLegacy(version, profile, spvVersion) || (! ForwardCompatibility && profile != EEsProfile && version < 420)) { + TPrecisionQualifier pq = profile == EEsProfile ? EpqMedium : EpqNone; + TType fragData(EbtFloat, EvqFragColor, pq, 4); + TArraySizes* arraySizes = new TArraySizes; + arraySizes->addInnerSize(resources.maxDrawBuffers); + fragData.transferArraySizes(arraySizes); + symbolTable.insert(*new TVariable(NewPoolTString("gl_FragData"), fragData)); + SpecialQualifier("gl_FragData", EvqFragColor, EbvFragData, symbolTable); + } + + // GL_EXT_blend_func_extended + if (profile == EEsProfile && version >= 100) { + symbolTable.setVariableExtensions("gl_MaxDualSourceDrawBuffersEXT", 1, &E_GL_EXT_blend_func_extended); + symbolTable.setVariableExtensions("gl_SecondaryFragColorEXT", 1, &E_GL_EXT_blend_func_extended); + symbolTable.setVariableExtensions("gl_SecondaryFragDataEXT", 1, &E_GL_EXT_blend_func_extended); + SpecialQualifier("gl_SecondaryFragColorEXT", EvqVaryingOut, EbvSecondaryFragColorEXT, symbolTable); + SpecialQualifier("gl_SecondaryFragDataEXT", EvqVaryingOut, EbvSecondaryFragDataEXT, symbolTable); + } + + break; + + case EShLangTessControl: + case EShLangTessEvaluation: + // Because of the context-dependent array size (gl_MaxPatchVertices), + // these variables were added later than the others and need to be mapped now. + + // standard members + BuiltInVariable("gl_in", "gl_Position", EbvPosition, symbolTable); + BuiltInVariable("gl_in", "gl_PointSize", EbvPointSize, symbolTable); + BuiltInVariable("gl_in", "gl_ClipDistance", EbvClipDistance, symbolTable); + BuiltInVariable("gl_in", "gl_CullDistance", EbvCullDistance, symbolTable); + + // compatibility members + BuiltInVariable("gl_in", "gl_ClipVertex", EbvClipVertex, symbolTable); + BuiltInVariable("gl_in", "gl_FrontColor", EbvFrontColor, symbolTable); + BuiltInVariable("gl_in", "gl_BackColor", EbvBackColor, symbolTable); + BuiltInVariable("gl_in", "gl_FrontSecondaryColor", EbvFrontSecondaryColor, symbolTable); + BuiltInVariable("gl_in", "gl_BackSecondaryColor", EbvBackSecondaryColor, symbolTable); + BuiltInVariable("gl_in", "gl_TexCoord", EbvTexCoord, symbolTable); + BuiltInVariable("gl_in", "gl_FogFragCoord", EbvFogFragCoord, symbolTable); + + symbolTable.setVariableExtensions("gl_in", "gl_SecondaryPositionNV", 1, &E_GL_NV_stereo_view_rendering); + symbolTable.setVariableExtensions("gl_in", "gl_PositionPerViewNV", 1, &E_GL_NVX_multiview_per_view_attributes); + + BuiltInVariable("gl_in", "gl_SecondaryPositionNV", EbvSecondaryPositionNV, symbolTable); + BuiltInVariable("gl_in", "gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable); + + // extension requirements + if (profile == EEsProfile) { + symbolTable.setVariableExtensions("gl_in", "gl_PointSize", Num_AEP_tessellation_point_size, AEP_tessellation_point_size); + } + + break; + + default: + break; + } +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.h new file mode 100644 index 0000000000..73fb5a53ac --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.h @@ -0,0 +1,117 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013-2016 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef _INITIALIZE_INCLUDED_ +#define _INITIALIZE_INCLUDED_ + +#include "../Include/ResourceLimits.h" +#include "../Include/Common.h" +#include "../Include/ShHandle.h" +#include "SymbolTable.h" +#include "Versions.h" + +namespace QtShaderTools { +namespace glslang { + +// +// This is made to hold parseable strings for almost all the built-in +// functions and variables for one specific combination of version +// and profile. (Some still need to be added programmatically.) +// This is a base class for language-specific derivations, which +// can be used for language independent builtins. +// +// The strings are organized by +// commonBuiltins: intersection of all stages' built-ins, processed just once +// stageBuiltins[]: anything a stage needs that's not in commonBuiltins +// +class TBuiltInParseables { +public: + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + TBuiltInParseables(); + virtual ~TBuiltInParseables(); + virtual void initialize(int version, EProfile, const SpvVersion& spvVersion) = 0; + virtual void initialize(const TBuiltInResource& resources, int version, EProfile, const SpvVersion& spvVersion, EShLanguage) = 0; + virtual const TString& getCommonString() const { return commonBuiltins; } + virtual const TString& getStageString(EShLanguage language) const { return stageBuiltins[language]; } + + virtual void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable) = 0; + virtual void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources) = 0; + +protected: + TString commonBuiltins; + TString stageBuiltins[EShLangCount]; +}; + +// +// This is a GLSL specific derivation of TBuiltInParseables. To present a stable +// interface and match other similar code, it is called TBuiltIns, rather +// than TBuiltInParseablesGlsl. +// +class TBuiltIns : public TBuiltInParseables { +public: + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + TBuiltIns(); + virtual ~TBuiltIns(); + void initialize(int version, EProfile, const SpvVersion& spvVersion); + void initialize(const TBuiltInResource& resources, int version, EProfile, const SpvVersion& spvVersion, EShLanguage); + + void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable); + void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources); + +protected: + void addTabledBuiltins(int version, EProfile profile, const SpvVersion& spvVersion); + void relateTabledBuiltins(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage, TSymbolTable&); + void add2ndGenerationSamplingImaging(int version, EProfile profile, const SpvVersion& spvVersion); + void addSubpassSampling(TSampler, const TString& typeName, int version, EProfile profile); + void addQueryFunctions(TSampler, const TString& typeName, int version, EProfile profile); + void addImageFunctions(TSampler, const TString& typeName, int version, EProfile profile); + void addSamplingFunctions(TSampler, const TString& typeName, int version, EProfile profile); + void addGatherFunctions(TSampler, const TString& typeName, int version, EProfile profile); + + // Helpers for making textual representations of the permutations + // of texturing/imaging functions. + const char* postfixes[5]; + const char* prefixes[EbtNumTypes]; + int dimMap[EsdNumDims]; +}; + +// change this back to false if depending on textual spellings of texturing calls when consuming the AST +// Using PureOperatorBuiltins=false is deprecated. +constexpr bool PureOperatorBuiltins = true; +} // end namespace glslang +} // namespace QtShaderTools + +#endif // _INITIALIZE_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/IntermTraverse.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/IntermTraverse.cpp new file mode 100644 index 0000000000..f1b8704352 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/IntermTraverse.cpp @@ -0,0 +1,342 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// Copyright (c) 2002-2010 The ANGLE Project Authors. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "../Include/intermediate.h" + +namespace QtShaderTools { +namespace glslang { + +// +// Traverse the intermediate representation tree, and +// call a node type specific function for each node. +// Done recursively through the member function Traverse(). +// Node types can be skipped if their function to call is 0, +// but their subtree will still be traversed. +// Nodes with children can have their whole subtree skipped +// if preVisit is turned on and the type specific function +// returns false. +// +// preVisit, postVisit, and rightToLeft control what order +// nodes are visited in. +// + +// +// Traversal functions for terminals are straightforward.... +// +void TIntermMethod::traverse(TIntermTraverser*) +{ + // Tree should always resolve all methods as a non-method. +} + +void TIntermSymbol::traverse(TIntermTraverser *it) +{ + it->visitSymbol(this); +} + +void TIntermConstantUnion::traverse(TIntermTraverser *it) +{ + it->visitConstantUnion(this); +} + +const TString& TIntermSymbol::getAccessName() const { + if (getBasicType() == EbtBlock) + return getType().getTypeName(); + else + return getName(); +} + +// +// Traverse a binary node. +// +void TIntermBinary::traverse(TIntermTraverser *it) +{ + bool visit = true; + + // + // visit the node before children if pre-visiting. + // + if (it->preVisit) + visit = it->visitBinary(EvPreVisit, this); + + // + // Visit the children, in the right order. + // + if (visit) { + it->incrementDepth(this); + + if (it->rightToLeft) { + if (right) + right->traverse(it); + + if (it->inVisit) + visit = it->visitBinary(EvInVisit, this); + + if (visit && left) + left->traverse(it); + } else { + if (left) + left->traverse(it); + + if (it->inVisit) + visit = it->visitBinary(EvInVisit, this); + + if (visit && right) + right->traverse(it); + } + + it->decrementDepth(); + } + + // + // Visit the node after the children, if requested and the traversal + // hasn't been canceled yet. + // + if (visit && it->postVisit) + it->visitBinary(EvPostVisit, this); +} + +// +// Traverse a unary node. Same comments in binary node apply here. +// +void TIntermUnary::traverse(TIntermTraverser *it) +{ + bool visit = true; + + if (it->preVisit) + visit = it->visitUnary(EvPreVisit, this); + + if (visit) { + it->incrementDepth(this); + operand->traverse(it); + it->decrementDepth(); + } + + if (visit && it->postVisit) + it->visitUnary(EvPostVisit, this); +} + +// +// Traverse an aggregate node. Same comments in binary node apply here. +// +void TIntermAggregate::traverse(TIntermTraverser *it) +{ + bool visit = true; + + if (it->preVisit) + visit = it->visitAggregate(EvPreVisit, this); + + if (visit) { + it->incrementDepth(this); + + if (it->rightToLeft) { + for (TIntermSequence::reverse_iterator sit = sequence.rbegin(); sit != sequence.rend(); sit++) { + (*sit)->traverse(it); + + if (visit && it->inVisit) { + if (*sit != sequence.front()) + visit = it->visitAggregate(EvInVisit, this); + } + } + } else { + for (TIntermSequence::iterator sit = sequence.begin(); sit != sequence.end(); sit++) { + (*sit)->traverse(it); + + if (visit && it->inVisit) { + if (*sit != sequence.back()) + visit = it->visitAggregate(EvInVisit, this); + } + } + } + + it->decrementDepth(); + } + + if (visit && it->postVisit) + it->visitAggregate(EvPostVisit, this); +} + +// +// Traverse a selection node. Same comments in binary node apply here. +// +void TIntermSelection::traverse(TIntermTraverser *it) +{ + bool visit = true; + + if (it->preVisit) + visit = it->visitSelection(EvPreVisit, this); + + if (visit) { + it->incrementDepth(this); + if (it->rightToLeft) { + if (falseBlock) + falseBlock->traverse(it); + if (trueBlock) + trueBlock->traverse(it); + condition->traverse(it); + } else { + condition->traverse(it); + if (trueBlock) + trueBlock->traverse(it); + if (falseBlock) + falseBlock->traverse(it); + } + it->decrementDepth(); + } + + if (visit && it->postVisit) + it->visitSelection(EvPostVisit, this); +} + +// +// Traverse a loop node. Same comments in binary node apply here. +// +void TIntermLoop::traverse(TIntermTraverser *it) +{ + bool visit = true; + + if (it->preVisit) + visit = it->visitLoop(EvPreVisit, this); + + if (visit) { + it->incrementDepth(this); + + if (it->rightToLeft) { + if (terminal) + terminal->traverse(it); + + if (body) + body->traverse(it); + + if (test) + test->traverse(it); + } else { + if (test) + test->traverse(it); + + if (body) + body->traverse(it); + + if (terminal) + terminal->traverse(it); + } + + it->decrementDepth(); + } + + if (visit && it->postVisit) + it->visitLoop(EvPostVisit, this); +} + +// +// Traverse a branch node. Same comments in binary node apply here. +// +void TIntermBranch::traverse(TIntermTraverser *it) +{ + bool visit = true; + + if (it->preVisit) + visit = it->visitBranch(EvPreVisit, this); + + if (visit && expression) { + it->incrementDepth(this); + expression->traverse(it); + it->decrementDepth(); + } + + if (visit && it->postVisit) + it->visitBranch(EvPostVisit, this); +} + +// +// Traverse a switch node. +// +void TIntermSwitch::traverse(TIntermTraverser* it) +{ + bool visit = true; + + if (it->preVisit) + visit = it->visitSwitch(EvPreVisit, this); + + if (visit) { + it->incrementDepth(this); + if (it->rightToLeft) { + body->traverse(it); + condition->traverse(it); + } else { + condition->traverse(it); + body->traverse(it); + } + it->decrementDepth(); + } + + if (visit && it->postVisit) + it->visitSwitch(EvPostVisit, this); +} + +// +// Traverse a variable declaration. +// +void TIntermVariableDecl::traverse(TIntermTraverser *it) +{ + bool visit = true; + + if (it->preVisit) + visit = it->visitVariableDecl(EvPreVisit, this); + + if (visit) { + it->incrementDepth(this); + if (it->rightToLeft) { + if (it->includeDeclSymbol) + declSymbol->traverse(it); + if (initNode) + initNode->traverse(it); + } + else { + if (initNode) + initNode->traverse(it); + if (it->includeDeclSymbol) + declSymbol->traverse(it); + } + it->decrementDepth(); + } + + if (visit && it->postVisit) + it->visitVariableDecl(EvPostVisit, this); +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp new file mode 100644 index 0000000000..862ec6957e --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp @@ -0,0 +1,3927 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2015 LunarG, Inc. +// Copyright (C) 2015-2020 Google, Inc. +// Copyright (C) 2017 ARM Limited. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// Build the intermediate representation. +// + +#include "localintermediate.h" +#include "RemoveTree.h" +#include "SymbolTable.h" +#include "propagateNoContraction.h" + +#include +#include +#include +#include + +namespace QtShaderTools { +namespace glslang { + +//////////////////////////////////////////////////////////////////////////// +// +// First set of functions are to help build the intermediate representation. +// These functions are not member functions of the nodes. +// They are called from parser productions. +// +///////////////////////////////////////////////////////////////////////////// + +// +// Add a terminal node for an identifier in an expression. +// +// Returns the added node. +// + +TIntermSymbol* TIntermediate::addSymbol(long long id, const TString& name, const TString& mangledName, const TType& type, const TConstUnionArray& constArray, + TIntermTyped* constSubtree, const TSourceLoc& loc) +{ + TIntermSymbol* node = new TIntermSymbol(id, name, getStage(), type, &mangledName); + node->setLoc(loc); + node->setConstArray(constArray); + node->setConstSubtree(constSubtree); + + return node; +} + +TIntermSymbol* TIntermediate::addSymbol(const TIntermSymbol& intermSymbol) +{ + return addSymbol(intermSymbol.getId(), + intermSymbol.getName(), + intermSymbol.getMangledName(), + intermSymbol.getType(), + intermSymbol.getConstArray(), + intermSymbol.getConstSubtree(), + intermSymbol.getLoc()); +} + +TIntermSymbol* TIntermediate::addSymbol(const TVariable& variable) +{ + glslang::TSourceLoc loc; // just a null location + loc.init(); + + return addSymbol(variable, loc); +} + +TIntermSymbol* TIntermediate::addSymbol(const TVariable& variable, const TSourceLoc& loc) +{ + return addSymbol(variable.getUniqueId(), variable.getName(), variable.getMangledName(), variable.getType(), variable.getConstArray(), variable.getConstSubtree(), loc); +} + +TIntermSymbol* TIntermediate::addSymbol(const TType& type, const TSourceLoc& loc) +{ + TConstUnionArray unionArray; // just a null constant + + return addSymbol(0, "", "", type, unionArray, nullptr, loc); +} + +// +// Connect two nodes with a new parent that does a binary operation on the nodes. +// +// Returns the added node. +// +// Returns nullptr if the working conversions and promotions could not be found. +// +TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIntermTyped* right, const TSourceLoc& loc) +{ + // No operations work on blocks + if (left->getType().getBasicType() == EbtBlock || right->getType().getBasicType() == EbtBlock || + left->getType().getBasicType() == EbtString || right->getType().getBasicType() == EbtString) + return nullptr; + + // Convert "reference +/- int" and "reference - reference" to integer math + if (op == EOpAdd || op == EOpSub) { + + // No addressing math on struct with unsized array. + if ((left->isReference() && left->getType().getReferentType()->containsUnsizedArray()) || + (right->isReference() && right->getType().getReferentType()->containsUnsizedArray())) { + return nullptr; + } + + if (left->isReference() && isTypeInt(right->getBasicType())) { + const TType& referenceType = left->getType(); + TIntermConstantUnion* size = addConstantUnion((unsigned long long)computeBufferReferenceTypeSize(left->getType()), loc, true); + left = addBuiltInFunctionCall(loc, EOpConvPtrToUint64, true, left, TType(EbtUint64)); + + right = createConversion(EbtInt64, right); + right = addBinaryMath(EOpMul, right, size, loc); + + TIntermTyped *node = addBinaryMath(op, left, right, loc); + node = addBuiltInFunctionCall(loc, EOpConvUint64ToPtr, true, node, referenceType); + return node; + } + } + + if (op == EOpAdd && right->isReference() && isTypeInt(left->getBasicType())) { + const TType& referenceType = right->getType(); + TIntermConstantUnion* size = + addConstantUnion((unsigned long long)computeBufferReferenceTypeSize(right->getType()), loc, true); + right = addBuiltInFunctionCall(loc, EOpConvPtrToUint64, true, right, TType(EbtUint64)); + + left = createConversion(EbtInt64, left); + left = addBinaryMath(EOpMul, left, size, loc); + + TIntermTyped *node = addBinaryMath(op, left, right, loc); + node = addBuiltInFunctionCall(loc, EOpConvUint64ToPtr, true, node, referenceType); + return node; + } + + if (op == EOpSub && left->isReference() && right->isReference()) { + TIntermConstantUnion* size = + addConstantUnion((long long)computeBufferReferenceTypeSize(left->getType()), loc, true); + + left = addBuiltInFunctionCall(loc, EOpConvPtrToUint64, true, left, TType(EbtUint64)); + right = addBuiltInFunctionCall(loc, EOpConvPtrToUint64, true, right, TType(EbtUint64)); + + left = addBuiltInFunctionCall(loc, EOpConvNumeric, true, left, TType(EbtInt64)); + right = addBuiltInFunctionCall(loc, EOpConvNumeric, true, right, TType(EbtInt64)); + + left = addBinaryMath(EOpSub, left, right, loc); + + TIntermTyped *node = addBinaryMath(EOpDiv, left, size, loc); + return node; + } + + // No other math operators supported on references + if (left->isReference() || right->isReference()) + return nullptr; + + // Try converting the children's base types to compatible types. + auto children = addPairConversion(op, left, right); + left = std::get<0>(children); + right = std::get<1>(children); + + if (left == nullptr || right == nullptr) + return nullptr; + + // Convert the children's type shape to be compatible. + addBiShapeConversion(op, left, right); + if (left == nullptr || right == nullptr) + return nullptr; + + // + // Need a new node holding things together. Make + // one and promote it to the right type. + // + TIntermBinary* node = addBinaryNode(op, left, right, loc); + if (! promote(node)) + return nullptr; + + node->updatePrecision(); + + // + // If they are both (non-specialization) constants, they must be folded. + // (Unless it's the sequence (comma) operator, but that's handled in addComma().) + // + TIntermConstantUnion *leftTempConstant = node->getLeft()->getAsConstantUnion(); + TIntermConstantUnion *rightTempConstant = node->getRight()->getAsConstantUnion(); + if (leftTempConstant && rightTempConstant) { + TIntermTyped* folded = leftTempConstant->fold(node->getOp(), rightTempConstant); + if (folded) + return folded; + } + + // If can propagate spec-constantness and if the operation is an allowed + // specialization-constant operation, make a spec-constant. + if (specConstantPropagates(*node->getLeft(), *node->getRight()) && isSpecializationOperation(*node)) + node->getWritableType().getQualifier().makeSpecConstant(); + + // If must propagate nonuniform, make a nonuniform. + if ((node->getLeft()->getQualifier().isNonUniform() || node->getRight()->getQualifier().isNonUniform()) && + isNonuniformPropagating(node->getOp())) + node->getWritableType().getQualifier().nonUniform = true; + + return node; +} + +// +// Low level: add binary node (no promotions or other argument modifications) +// +TIntermBinary* TIntermediate::addBinaryNode(TOperator op, TIntermTyped* left, TIntermTyped* right, + const TSourceLoc& loc) const +{ + // build the node + TIntermBinary* node = new TIntermBinary(op); + node->setLoc(loc.line != 0 ? loc : left->getLoc()); + node->setLeft(left); + node->setRight(right); + + return node; +} + +// +// like non-type form, but sets node's type. +// +TIntermBinary* TIntermediate::addBinaryNode(TOperator op, TIntermTyped* left, TIntermTyped* right, + const TSourceLoc& loc, const TType& type) const +{ + TIntermBinary* node = addBinaryNode(op, left, right, loc); + node->setType(type); + return node; +} + +// +// Low level: add unary node (no promotions or other argument modifications) +// +TIntermUnary* TIntermediate::addUnaryNode(TOperator op, TIntermTyped* child, const TSourceLoc& loc) const +{ + TIntermUnary* node = new TIntermUnary(op); + node->setLoc(loc.line != 0 ? loc : child->getLoc()); + node->setOperand(child); + + return node; +} + +// +// like non-type form, but sets node's type. +// +TIntermUnary* TIntermediate::addUnaryNode(TOperator op, TIntermTyped* child, const TSourceLoc& loc, const TType& type) + const +{ + TIntermUnary* node = addUnaryNode(op, child, loc); + node->setType(type); + return node; +} + +// +// Connect two nodes through an assignment. +// +// Returns the added node. +// +// Returns nullptr if the 'right' type could not be converted to match the 'left' type, +// or the resulting operation cannot be properly promoted. +// +TIntermTyped* TIntermediate::addAssign(TOperator op, TIntermTyped* left, TIntermTyped* right, + const TSourceLoc& loc) +{ + // No block assignment + if (left->getType().getBasicType() == EbtBlock || right->getType().getBasicType() == EbtBlock) + return nullptr; + + // Convert "reference += int" to "reference = reference + int". We need this because the + // "reference + int" calculation involves a cast back to the original type, which makes it + // not an lvalue. + if ((op == EOpAddAssign || op == EOpSubAssign) && left->isReference()) { + if (!(right->getType().isScalar() && right->getType().isIntegerDomain())) + return nullptr; + + TIntermTyped* node = addBinaryMath(op == EOpAddAssign ? EOpAdd : EOpSub, left, right, loc); + if (!node) + return nullptr; + + TIntermSymbol* symbol = left->getAsSymbolNode(); + left = addSymbol(*symbol); + + node = addAssign(EOpAssign, left, node, loc); + return node; + } + + // + // Like adding binary math, except the conversion can only go + // from right to left. + // + + // convert base types, nullptr return means not possible + right = addConversion(op, left->getType(), right); + if (right == nullptr) + return nullptr; + + // convert shape + right = addUniShapeConversion(op, left->getType(), right); + + // build the node + TIntermBinary* node = addBinaryNode(op, left, right, loc); + + if (! promote(node)) + return nullptr; + + node->updatePrecision(); + + return node; +} + +// +// Connect two nodes through an index operator, where the left node is the base +// of an array or struct, and the right node is a direct or indirect offset. +// +// Returns the added node. +// The caller should set the type of the returned node. +// +TIntermTyped* TIntermediate::addIndex(TOperator op, TIntermTyped* base, TIntermTyped* index, + const TSourceLoc& loc) +{ + // caller should set the type + return addBinaryNode(op, base, index, loc); +} + +// +// Add one node as the parent of another that it operates on. +// +// Returns the added node. +// +TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, + const TSourceLoc& loc) +{ + if (child == nullptr) + return nullptr; + + if (child->getType().getBasicType() == EbtBlock) + return nullptr; + + switch (op) { + case EOpLogicalNot: + if (getSource() == EShSourceHlsl) { + break; // HLSL can promote logical not + } + + if (child->getType().getBasicType() != EbtBool || child->getType().isMatrix() || child->getType().isArray() || child->getType().isVector()) { + return nullptr; + } + break; + + case EOpPostIncrement: + case EOpPreIncrement: + case EOpPostDecrement: + case EOpPreDecrement: + case EOpNegative: + if (child->getType().getBasicType() == EbtStruct || child->getType().isArray()) + return nullptr; + break; + default: break; // some compilers want this + } + + // + // Do we need to promote the operand? + // + TBasicType newType = EbtVoid; + switch (op) { + case EOpConstructBool: newType = EbtBool; break; + case EOpConstructFloat: newType = EbtFloat; break; + case EOpConstructInt: newType = EbtInt; break; + case EOpConstructUint: newType = EbtUint; break; + case EOpConstructInt8: newType = EbtInt8; break; + case EOpConstructUint8: newType = EbtUint8; break; + case EOpConstructInt16: newType = EbtInt16; break; + case EOpConstructUint16: newType = EbtUint16; break; + case EOpConstructInt64: newType = EbtInt64; break; + case EOpConstructUint64: newType = EbtUint64; break; + case EOpConstructDouble: newType = EbtDouble; break; + case EOpConstructFloat16: newType = EbtFloat16; break; + case EOpConstructBFloat16: newType = EbtBFloat16; break; + case EOpConstructFloatE4M3: newType = EbtFloatE4M3; break; + case EOpConstructFloatE5M2: newType = EbtFloatE5M2; break; + default: break; // some compilers want this + } + + if (newType != EbtVoid) { + child = addConversion(op, TType(newType, EvqTemporary, child->getVectorSize(), + child->getMatrixCols(), + child->getMatrixRows(), + child->isVector()), + child); + if (child == nullptr) + return nullptr; + } + + // + // For constructors, we are now done, it was all in the conversion. + // TODO: but, did this bypass constant folding? + // + switch (op) { + case EOpConstructInt8: + case EOpConstructUint8: + case EOpConstructInt16: + case EOpConstructUint16: + case EOpConstructInt: + case EOpConstructUint: + case EOpConstructInt64: + case EOpConstructUint64: + case EOpConstructBool: + case EOpConstructFloat: + case EOpConstructDouble: + case EOpConstructFloat16: + case EOpConstructBFloat16: + case EOpConstructFloatE5M2: + case EOpConstructFloatE4M3: { + TIntermUnary* unary_node = child->getAsUnaryNode(); + if (unary_node != nullptr) + unary_node->updatePrecision(); + return child; + } + default: break; // some compilers want this + } + + // + // Make a new node for the operator. + // + TIntermUnary* node = addUnaryNode(op, child, loc); + + if (! promote(node)) + return nullptr; + + node->updatePrecision(); + + // If it's a (non-specialization) constant, it must be folded. + if (node->getOperand()->getAsConstantUnion()) + return node->getOperand()->getAsConstantUnion()->fold(op, node->getType()); + + // If it's a specialization constant, the result is too, + // if the operation is allowed for specialization constants. + if (node->getOperand()->getType().getQualifier().isSpecConstant() && isSpecializationOperation(*node)) + node->getWritableType().getQualifier().makeSpecConstant(); + + // If must propagate nonuniform, make a nonuniform. + if (node->getOperand()->getQualifier().isNonUniform() && isNonuniformPropagating(node->getOp())) + node->getWritableType().getQualifier().nonUniform = true; + + return node; +} + +TIntermTyped* TIntermediate::addBuiltInFunctionCall(const TSourceLoc& loc, TOperator op, bool unary, + TIntermNode* childNode, const TType& returnType) +{ + if (unary) { + // + // Treat it like a unary operator. + // addUnaryMath() should get the type correct on its own; + // including constness (which would differ from the prototype). + // + TIntermTyped* child = childNode->getAsTyped(); + if (child == nullptr) + return nullptr; + + if (child->getAsConstantUnion()) { + TIntermTyped* folded = child->getAsConstantUnion()->fold(op, returnType); + if (folded) + return folded; + } + + return addUnaryNode(op, child, child->getLoc(), returnType); + } else { + // setAggregateOperater() calls fold() for constant folding + TIntermTyped* node = setAggregateOperator(childNode, op, returnType, loc); + + return node; + } +} + +// +// This is the safe way to change the operator on an aggregate, as it +// does lots of error checking and fixing. Especially for establishing +// a function call's operation on its set of parameters. Sequences +// of instructions are also aggregates, but they just directly set +// their operator to EOpSequence. +// +// Returns an aggregate node, which could be the one passed in if +// it was already an aggregate. +// +TIntermTyped* TIntermediate::setAggregateOperator(TIntermNode* node, TOperator op, const TType& type, + const TSourceLoc& loc) +{ + TIntermAggregate* aggNode; + + // + // Make sure we have an aggregate. If not turn it into one. + // + if (node != nullptr) { + aggNode = node->getAsAggregate(); + if (aggNode == nullptr || aggNode->getOp() != EOpNull) { + // + // Make an aggregate containing this node. + // + aggNode = new TIntermAggregate(); + aggNode->getSequence().push_back(node); + } + } else + aggNode = new TIntermAggregate(); + + // + // Set the operator. + // + aggNode->setOperator(op); + if (loc.line != 0 || node != nullptr) + aggNode->setLoc(loc.line != 0 ? loc : node->getLoc()); + + aggNode->setType(type); + + return fold(aggNode); +} + +bool TIntermediate::isConversionAllowed(TOperator op, TIntermTyped* node) const +{ + // + // Does the base type even allow the operation? + // + switch (node->getBasicType()) { + case EbtVoid: + return false; + case EbtAtomicUint: + case EbtSampler: + case EbtAccStruct: + // opaque types can be passed to functions + if (op == EOpFunction) + break; + + // HLSL can assign samplers directly (no constructor) + if (getSource() == EShSourceHlsl && node->getBasicType() == EbtSampler) + break; + + // samplers can get assigned via a sampler constructor + // (well, not yet, but code in the rest of this function is ready for it) + if (node->getBasicType() == EbtSampler && op == EOpAssign && + node->getAsOperator() != nullptr && node->getAsOperator()->getOp() == EOpConstructTextureSampler) + break; + + // otherwise, opaque types can't even be operated on, let alone converted + return false; + default: + break; + } + + return true; +} + +bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& newOp) const +{ + // (bfloat16_t,fp8) <-> bool not supported + if (((src == EbtBFloat16 || src == EbtFloatE5M2 || src == EbtFloatE4M3) && dst == EbtBool) || + ((dst == EbtBFloat16 || dst == EbtFloatE5M2 || dst == EbtFloatE4M3) && src == EbtBool)) { + return false; + } + + if ((isTypeInt(dst) || isTypeFloat(dst) || dst == EbtBool) && + (isTypeInt(src) || isTypeFloat(src) || src == EbtBool)) { + newOp = EOpConvNumeric; + return true; + } + return false; +} + +// This is 'mechanism' here, it does any conversion told. +// It is about basic type, not about shape. +// The policy comes from the shader or the calling code. +TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped* node) const +{ + // + // Add a new newNode for the conversion. + // + + bool convertToIntTypes = (convertTo == EbtInt8 || convertTo == EbtUint8 || + convertTo == EbtInt16 || convertTo == EbtUint16 || + convertTo == EbtInt || convertTo == EbtUint || + convertTo == EbtInt64 || convertTo == EbtUint64); + + bool convertFromIntTypes = (node->getBasicType() == EbtInt8 || node->getBasicType() == EbtUint8 || + node->getBasicType() == EbtInt16 || node->getBasicType() == EbtUint16 || + node->getBasicType() == EbtInt || node->getBasicType() == EbtUint || + node->getBasicType() == EbtInt64 || node->getBasicType() == EbtUint64); + + bool convertToFloatTypes = (convertTo == EbtFloat16 || convertTo == EbtBFloat16 || convertTo == EbtFloat || convertTo == EbtDouble || + convertTo == EbtFloatE5M2 || convertTo == EbtFloatE4M3); + + bool convertFromFloatTypes = (node->getBasicType() == EbtFloat16 || + node->getBasicType() == EbtBFloat16 || + node->getBasicType() == EbtFloat || + node->getBasicType() == EbtDouble || + node->getBasicType() == EbtFloatE5M2 || + node->getBasicType() == EbtFloatE4M3); + + if (((convertTo == EbtInt8 || convertTo == EbtUint8) && ! convertFromIntTypes) || + ((node->getBasicType() == EbtInt8 || node->getBasicType() == EbtUint8) && ! convertToIntTypes)) { + if (! getArithemeticInt8Enabled()) { + return nullptr; + } + } + + if (((convertTo == EbtInt16 || convertTo == EbtUint16) && ! convertFromIntTypes) || + ((node->getBasicType() == EbtInt16 || node->getBasicType() == EbtUint16) && ! convertToIntTypes)) { + if (! getArithemeticInt16Enabled()) { + return nullptr; + } + } + + if ((convertTo == EbtFloat16 && ! convertFromFloatTypes) || + (node->getBasicType() == EbtFloat16 && ! convertToFloatTypes)) { + if (! getArithemeticFloat16Enabled()) { + return nullptr; + } + } + + TIntermUnary* newNode = nullptr; + TOperator newOp = EOpNull; + if (!buildConvertOp(convertTo, node->getBasicType(), newOp)) { + return nullptr; + } + + TType newType(convertTo, EvqTemporary, node->getVectorSize(), node->getMatrixCols(), node->getMatrixRows()); + newNode = addUnaryNode(newOp, node, node->getLoc(), newType); + + if (node->getAsConstantUnion()) { + // 8/16-bit storage extensions don't support 8/16-bit constants, so don't fold conversions + // to those types + if ((getArithemeticInt8Enabled() || !(convertTo == EbtInt8 || convertTo == EbtUint8)) && + (getArithemeticInt16Enabled() || !(convertTo == EbtInt16 || convertTo == EbtUint16)) && + (getArithemeticFloat16Enabled() || !(convertTo == EbtFloat16))) + { + TIntermTyped* folded = node->getAsConstantUnion()->fold(newOp, newType); + if (folded) + return folded; + } + } + + // Propagate specialization-constant-ness, if allowed + if (node->getType().getQualifier().isSpecConstant() && isSpecializationOperation(*newNode)) + newNode->getWritableType().getQualifier().makeSpecConstant(); + + return newNode; +} + +TIntermTyped* TIntermediate::addConversion(TBasicType convertTo, TIntermTyped* node) const +{ + return createConversion(convertTo, node); +} + +// For converting a pair of operands to a binary operation to compatible +// types with each other, relative to the operation in 'op'. +// This does not cover assignment operations, which is asymmetric in that the +// left type is not changeable. +// See addConversion(op, type, node) for assignments and unary operation +// conversions. +// +// Generally, this is focused on basic type conversion, not shape conversion. +// See addShapeConversion() for shape conversions. +// +// Returns the converted pair of nodes. +// Returns when there is no conversion. +std::tuple +TIntermediate::addPairConversion(TOperator op, TIntermTyped* node0, TIntermTyped* node1) +{ + if (!isConversionAllowed(op, node0) || !isConversionAllowed(op, node1)) + return std::make_tuple(nullptr, nullptr); + + if (node0->getType() != node1->getType()) { + // If differing structure, then no conversions. + if (node0->isStruct() || node1->isStruct()) + return std::make_tuple(nullptr, nullptr); + + // If differing arrays, then no conversions. + if (node0->getType().isArray() || node1->getType().isArray()) + return std::make_tuple(nullptr, nullptr); + + // No implicit conversions for operations involving cooperative matrices + if (node0->getType().isCoopMat() || node1->getType().isCoopMat()) + return std::make_tuple(node0, node1); + } + + auto promoteTo = std::make_tuple(EbtNumTypes, EbtNumTypes); + + switch (op) { + // + // List all the binary ops that can implicitly convert one operand to the other's type; + // This implements the 'policy' for implicit type conversion. + // + case EOpLessThan: + case EOpGreaterThan: + case EOpLessThanEqual: + case EOpGreaterThanEqual: + case EOpEqual: + case EOpNotEqual: + + case EOpAdd: + case EOpSub: + case EOpMul: + case EOpDiv: + case EOpMod: + + case EOpVectorTimesScalar: + case EOpVectorTimesMatrix: + case EOpMatrixTimesVector: + case EOpMatrixTimesScalar: + + case EOpAnd: + case EOpInclusiveOr: + case EOpExclusiveOr: + + case EOpSequence: // used by ?: + + if (node0->getBasicType() == node1->getBasicType()) + return std::make_tuple(node0, node1); + + promoteTo = getConversionDestinationType(node0->getBasicType(), node1->getBasicType(), op); + if (std::get<0>(promoteTo) == EbtNumTypes || std::get<1>(promoteTo) == EbtNumTypes) + return std::make_tuple(nullptr, nullptr); + + break; + + case EOpLogicalAnd: + case EOpLogicalOr: + case EOpLogicalXor: + if (getSource() == EShSourceHlsl) + promoteTo = std::make_tuple(EbtBool, EbtBool); + else + return std::make_tuple(node0, node1); + break; + + // There are no conversions needed for GLSL; the shift amount just needs to be an + // integer type, as does the base. + // HLSL can promote bools to ints to make this work. + case EOpLeftShift: + case EOpRightShift: + if (getSource() == EShSourceHlsl) { + TBasicType node0BasicType = node0->getBasicType(); + if (node0BasicType == EbtBool) + node0BasicType = EbtInt; + if (node1->getBasicType() == EbtBool) + promoteTo = std::make_tuple(node0BasicType, EbtInt); + else + promoteTo = std::make_tuple(node0BasicType, node1->getBasicType()); + } else { + if (isTypeInt(node0->getBasicType()) && isTypeInt(node1->getBasicType())) + return std::make_tuple(node0, node1); + else + return std::make_tuple(nullptr, nullptr); + } + break; + + default: + if (node0->getType() == node1->getType()) + return std::make_tuple(node0, node1); + + return std::make_tuple(nullptr, nullptr); + } + + TIntermTyped* newNode0; + TIntermTyped* newNode1; + + if (std::get<0>(promoteTo) != node0->getType().getBasicType()) { + if (node0->getAsConstantUnion()) + newNode0 = promoteConstantUnion(std::get<0>(promoteTo), node0->getAsConstantUnion()); + else + newNode0 = createConversion(std::get<0>(promoteTo), node0); + } else + newNode0 = node0; + + if (std::get<1>(promoteTo) != node1->getType().getBasicType()) { + if (node1->getAsConstantUnion()) + newNode1 = promoteConstantUnion(std::get<1>(promoteTo), node1->getAsConstantUnion()); + else + newNode1 = createConversion(std::get<1>(promoteTo), node1); + } else + newNode1 = node1; + + return std::make_tuple(newNode0, newNode1); +} + +// +// Convert the node's type to the given type, as allowed by the operation involved: 'op'. +// For implicit conversions, 'op' is not the requested conversion, it is the explicit +// operation requiring the implicit conversion. +// +// Binary operation conversions should be handled by addConversion(op, node, node), not here. +// +// Returns a node representing the conversion, which could be the same +// node passed in if no conversion was needed. +// +// Generally, this is focused on basic type conversion, not shape conversion. +// See addShapeConversion() for shape conversions. +// +// Return nullptr if a conversion can't be done. +// +TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TIntermTyped* node) +{ + if (!isConversionAllowed(op, node)) + return nullptr; + + // Otherwise, if types are identical, no problem + if (type == node->getType()) + return node; + + // If one's a structure, then no conversions. + if (type.isStruct() || node->isStruct()) + return nullptr; + + // If one's an array, then no conversions. + if (type.isArray() || node->getType().isArray()) + return nullptr; + + // Reject implicit conversions to cooperative matrix types + if (node->getType().isCoopMat() && + op != EOpConstructCooperativeMatrixNV && + op != EOpConstructCooperativeMatrixKHR && + op != glslang::EOpCompositeConstructCoopMatQCOM) + return nullptr; + + if (node->getType().isTensorLayoutNV() || + node->getType().isTensorViewNV()) + return nullptr; + + // Reject implicit conversions to cooperative vector types + if (node->getType().isCoopVecNV() && + op != EOpConstructCooperativeVectorNV) + return nullptr; + + // Note: callers are responsible for other aspects of shape, + // like vector and matrix sizes. + + switch (op) { + // + // Explicit conversions (unary operations) + // + case EOpConstructBool: + case EOpConstructFloat: + case EOpConstructInt: + case EOpConstructUint: + case EOpConstructDouble: + case EOpConstructFloat16: + case EOpConstructBFloat16: + case EOpConstructFloatE5M2: + case EOpConstructFloatE4M3: + case EOpConstructInt8: + case EOpConstructUint8: + case EOpConstructInt16: + case EOpConstructUint16: + case EOpConstructInt64: + case EOpConstructUint64: + case EOpConstructSaturated: + break; + + // + // Implicit conversions + // + case EOpLogicalNot: + + case EOpFunctionCall: + + case EOpReturn: + case EOpAssign: + case EOpAddAssign: + case EOpSubAssign: + case EOpMulAssign: + case EOpVectorTimesScalarAssign: + case EOpMatrixTimesScalarAssign: + case EOpDivAssign: + case EOpModAssign: + case EOpAndAssign: + case EOpInclusiveOrAssign: + case EOpExclusiveOrAssign: + + case EOpAtan: + case EOpClamp: + case EOpCross: + case EOpDistance: + case EOpDot: + case EOpDst: + case EOpFaceForward: + case EOpFma: + case EOpFrexp: + case EOpLdexp: + case EOpMix: + case EOpLit: + case EOpMax: + case EOpMin: + case EOpMod: + case EOpModf: + case EOpPow: + case EOpReflect: + case EOpRefract: + case EOpSmoothStep: + case EOpStep: + + case EOpSequence: + case EOpConstructStruct: + case EOpConstructCooperativeMatrixNV: + case EOpConstructCooperativeMatrixKHR: + case EOpConstructCooperativeVectorNV: + + if (type.isReference() || node->getType().isReference()) { + // types must match to assign a reference + if (type == node->getType()) + return node; + else + return nullptr; + } + + if (type.getBasicType() == node->getType().getBasicType()) + return node; + + if (! canImplicitlyPromote(node->getBasicType(), type.getBasicType(), op)) + return nullptr; + break; + + // For GLSL, there are no conversions needed; the shift amount just needs to be an + // integer type, as do the base/result. + // HLSL can convert the shift from a bool to an int. + case EOpLeftShiftAssign: + case EOpRightShiftAssign: + { + if (!(getSource() == EShSourceHlsl && node->getType().getBasicType() == EbtBool)) { + if (isTypeInt(type.getBasicType()) && isTypeInt(node->getBasicType())) + return node; + else + return nullptr; + } + break; + } + + default: + // default is to require a match; all exceptions should have case statements above + + if (type.getBasicType() == node->getType().getBasicType()) + return node; + else + return nullptr; + } + + bool canPromoteConstant = true; + // GL_EXT_shader_16bit_storage can't do OpConstantComposite with + // 16-bit types, so disable promotion for those types. + // Many issues with this, from JohnK: + // - this isn't really right to discuss SPIR-V here + // - this could easily be entirely about scalars, so is overstepping + // - we should be looking at what the shader asked for, and saying whether or + // not it can be done, in the parser, by calling requireExtensions(), not + // changing language sementics on the fly by asking what extensions are in use + // - at the time of this writing (14-Aug-2020), no test results are changed by this. + switch (op) { + case EOpConstructBFloat16: + case EOpConstructFloatE5M2: + case EOpConstructFloatE4M3: + canPromoteConstant = true; + break; + case EOpConstructFloat16: + canPromoteConstant = numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types) || + numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types_float16); + break; + case EOpConstructInt8: + case EOpConstructUint8: + canPromoteConstant = numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types) || + numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types_int8); + break; + case EOpConstructInt16: + case EOpConstructUint16: + canPromoteConstant = numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types) || + numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types_int16); + break; + default: + break; + } + + if (canPromoteConstant && node->getAsConstantUnion()) + return promoteConstantUnion(type.getBasicType(), node->getAsConstantUnion()); + + // + // Add a new newNode for the conversion. + // + TIntermTyped* newNode = createConversion(type.getBasicType(), node); + + return newNode; +} + +// Convert the node's shape of type for the given type, as allowed by the +// operation involved: 'op'. This is for situations where there is only one +// direction to consider doing the shape conversion. +// +// This implements policy, it call addShapeConversion() for the mechanism. +// +// Generally, the AST represents allowed GLSL shapes, so this isn't needed +// for GLSL. Bad shapes are caught in conversion or promotion. +// +// Return 'node' if no conversion was done. Promotion handles final shape +// checking. +// +TIntermTyped* TIntermediate::addUniShapeConversion(TOperator op, const TType& type, TIntermTyped* node) +{ + // some source languages don't do this + switch (getSource()) { + case EShSourceHlsl: + break; + case EShSourceGlsl: + default: + return node; + } + + // some operations don't do this + switch (op) { + case EOpFunctionCall: + case EOpReturn: + break; + + case EOpMulAssign: + // want to support vector *= scalar native ops in AST and lower, not smear, similarly for + // matrix *= scalar, etc. + + case EOpAddAssign: + case EOpSubAssign: + case EOpDivAssign: + case EOpAndAssign: + case EOpInclusiveOrAssign: + case EOpExclusiveOrAssign: + case EOpRightShiftAssign: + case EOpLeftShiftAssign: + if (node->getVectorSize() == 1) + return node; + break; + + case EOpAssign: + break; + + case EOpMix: + break; + + default: + return node; + } + + return addShapeConversion(type, node); +} + +// Convert the nodes' shapes to be compatible for the operation 'op'. +// +// This implements policy, it call addShapeConversion() for the mechanism. +// +// Generally, the AST represents allowed GLSL shapes, so this isn't needed +// for GLSL. Bad shapes are caught in conversion or promotion. +// +void TIntermediate::addBiShapeConversion(TOperator op, TIntermTyped*& lhsNode, TIntermTyped*& rhsNode) +{ + // some source languages don't do this + switch (getSource()) { + case EShSourceHlsl: + break; + case EShSourceGlsl: + default: + return; + } + + // some operations don't do this + // 'break' will mean attempt bidirectional conversion + switch (op) { + case EOpMulAssign: + case EOpAssign: + case EOpAddAssign: + case EOpSubAssign: + case EOpDivAssign: + case EOpAndAssign: + case EOpInclusiveOrAssign: + case EOpExclusiveOrAssign: + case EOpRightShiftAssign: + case EOpLeftShiftAssign: + // switch to unidirectional conversion (the lhs can't change) + rhsNode = addUniShapeConversion(op, lhsNode->getType(), rhsNode); + return; + + case EOpMul: + // matrix multiply does not change shapes + if (lhsNode->isMatrix() && rhsNode->isMatrix()) + return; + [[fallthrough]]; + case EOpAdd: + case EOpSub: + case EOpDiv: + // want to support vector * scalar native ops in AST and lower, not smear, similarly for + // matrix * vector, etc. + if (lhsNode->getVectorSize() == 1 || rhsNode->getVectorSize() == 1) + return; + break; + + case EOpRightShift: + case EOpLeftShift: + // can natively support the right operand being a scalar and the left a vector, + // but not the reverse + if (rhsNode->getVectorSize() == 1) + return; + break; + + case EOpLessThan: + case EOpGreaterThan: + case EOpLessThanEqual: + case EOpGreaterThanEqual: + + case EOpEqual: + case EOpNotEqual: + + case EOpLogicalAnd: + case EOpLogicalOr: + case EOpLogicalXor: + + case EOpAnd: + case EOpInclusiveOr: + case EOpExclusiveOr: + + case EOpMix: + break; + + default: + return; + } + + // Do bidirectional conversions + if (lhsNode->getType().isScalarOrVec1() || rhsNode->getType().isScalarOrVec1()) { + if (lhsNode->getType().isScalarOrVec1()) + lhsNode = addShapeConversion(rhsNode->getType(), lhsNode); + else + rhsNode = addShapeConversion(lhsNode->getType(), rhsNode); + } + lhsNode = addShapeConversion(rhsNode->getType(), lhsNode); + rhsNode = addShapeConversion(lhsNode->getType(), rhsNode); +} + +// Convert the node's shape of type for the given type, as allowed by the +// operation involved: 'op'. +// +// Generally, the AST represents allowed GLSL shapes, so this isn't needed +// for GLSL. Bad shapes are caught in conversion or promotion. +// +// Return 'node' if no conversion was done. Promotion handles final shape +// checking. +// +TIntermTyped* TIntermediate::addShapeConversion(const TType& type, TIntermTyped* node) +{ + // no conversion needed + if (node->getType() == type) + return node; + + // structures and arrays don't change shape, either to or from + if (node->getType().isStruct() || node->getType().isArray() || + type.isStruct() || type.isArray()) + return node; + + // The new node that handles the conversion + TOperator constructorOp = mapTypeToConstructorOp(type); + + if (getSource() == EShSourceHlsl) { + // HLSL rules for scalar, vector and matrix conversions: + // 1) scalar can become anything, initializing every component with its value + // 2) vector and matrix can become scalar, first element is used (warning: truncation) + // 3) matrix can become matrix with less rows and/or columns (warning: truncation) + // 4) vector can become vector with less rows size (warning: truncation) + // 5a) vector 4 can become 2x2 matrix (special case) (same packing layout, its a reinterpret) + // 5b) 2x2 matrix can become vector 4 (special case) (same packing layout, its a reinterpret) + + const TType &sourceType = node->getType(); + + // rule 1 for scalar to matrix is special + if (sourceType.isScalarOrVec1() && type.isMatrix()) { + + // HLSL semantics: the scalar (or vec1) is replicated to every component of the matrix. Left to its + // own devices, the constructor from a scalar would populate the diagonal. This forces replication + // to every matrix element. + + // Note that if the node is complex (e.g, a function call), we don't want to duplicate it here + // repeatedly, so we copy it to a temp, then use the temp. + const int matSize = type.computeNumComponents(); + TIntermAggregate* rhsAggregate = new TIntermAggregate(); + + const bool isSimple = (node->getAsSymbolNode() != nullptr) || (node->getAsConstantUnion() != nullptr); + + if (!isSimple) { + assert(0); // TODO: use node replicator service when available. + } + + for (int x = 0; x < matSize; ++x) + rhsAggregate->getSequence().push_back(node); + + return setAggregateOperator(rhsAggregate, constructorOp, type, node->getLoc()); + } + + // rule 1 and 2 + if ((sourceType.isScalar() && !type.isScalar()) || (!sourceType.isScalar() && type.isScalar())) + return setAggregateOperator(makeAggregate(node), constructorOp, type, node->getLoc()); + + // rule 3 and 5b + if (sourceType.isMatrix()) { + // rule 3 + if (type.isMatrix()) { + if ((sourceType.getMatrixCols() != type.getMatrixCols() || sourceType.getMatrixRows() != type.getMatrixRows()) && + sourceType.getMatrixCols() >= type.getMatrixCols() && sourceType.getMatrixRows() >= type.getMatrixRows()) + return setAggregateOperator(makeAggregate(node), constructorOp, type, node->getLoc()); + // rule 5b + } else if (type.isVector()) { + if (type.getVectorSize() == 4 && sourceType.getMatrixCols() == 2 && sourceType.getMatrixRows() == 2) + return setAggregateOperator(makeAggregate(node), constructorOp, type, node->getLoc()); + } + } + + // rule 4 and 5a + if (sourceType.isVector()) { + // rule 4 + if (type.isVector()) + { + if (sourceType.getVectorSize() > type.getVectorSize()) + return setAggregateOperator(makeAggregate(node), constructorOp, type, node->getLoc()); + // rule 5a + } else if (type.isMatrix()) { + if (sourceType.getVectorSize() == 4 && type.getMatrixCols() == 2 && type.getMatrixRows() == 2) + return setAggregateOperator(makeAggregate(node), constructorOp, type, node->getLoc()); + } + } + } + + // scalar -> vector or vec1 -> vector or + // vector -> scalar or + // bigger vector -> smaller vector + if ((node->getType().isScalarOrVec1() && type.isVector()) || + (node->getType().isVector() && type.isScalar()) || + (node->isVector() && type.isVector() && node->getVectorSize() > type.getVectorSize())) + return setAggregateOperator(makeAggregate(node), constructorOp, type, node->getLoc()); + + return node; +} + +bool TIntermediate::isIntegralPromotion(TBasicType from, TBasicType to) const +{ + // integral promotions + if (to == EbtInt) { + switch(from) { + case EbtInt8: + case EbtInt16: + case EbtUint8: + case EbtUint16: + return true; + default: + break; + } + } + return false; +} + +bool TIntermediate::isFPPromotion(TBasicType from, TBasicType to) const +{ + // floating-point promotions + if (to == EbtDouble) { + switch(from) { + case EbtBFloat16: + case EbtFloatE5M2: + case EbtFloatE4M3: + case EbtFloat16: + case EbtFloat: + return true; + default: + break; + } + } + return false; +} + +bool TIntermediate::isIntegralConversion(TBasicType from, TBasicType to) const +{ + switch (from) { + case EbtInt: + switch(to) { + case EbtUint: + return version >= 400 || getSource() == EShSourceHlsl; + case EbtInt64: + case EbtUint64: + return true; + default: + break; + } + break; + case EbtUint: + switch(to) { + case EbtInt64: + case EbtUint64: + return true; + default: + break; + } + break; + case EbtInt8: + switch (to) { + case EbtUint8: + case EbtInt16: + case EbtUint16: + case EbtUint: + case EbtInt64: + case EbtUint64: + return true; + default: + break; + } + break; + case EbtUint8: + switch (to) { + case EbtInt16: + case EbtUint16: + case EbtUint: + case EbtInt64: + case EbtUint64: + return true; + default: + break; + } + break; + case EbtInt16: + switch(to) { + case EbtUint16: + case EbtUint: + case EbtInt64: + case EbtUint64: + return true; + default: + break; + } + break; + case EbtUint16: + switch(to) { + case EbtUint: + case EbtInt64: + case EbtUint64: + return true; + default: + break; + } + break; + case EbtInt64: + if (to == EbtUint64) { + return true; + } + break; + default: + break; + } + return false; +} + +bool TIntermediate::isFPConversion(TBasicType from, TBasicType to) const +{ + if (to == EbtFloat && (from == EbtFloat16 || from == EbtBFloat16 || from == EbtFloatE5M2 || from == EbtFloatE4M3)) { + return true; + } else { + return false; + } +} + +bool TIntermediate::isFPIntegralConversion(TBasicType from, TBasicType to) const +{ + switch (from) { + case EbtInt: + case EbtUint: + switch(to) { + case EbtFloat: + case EbtDouble: + return true; + default: + break; + } + break; + case EbtInt8: + case EbtUint8: + case EbtInt16: + case EbtUint16: + switch (to) { + case EbtFloat16: + case EbtFloat: + case EbtDouble: + return true; + default: + break; + } + break; + case EbtInt64: + case EbtUint64: + if (to == EbtDouble) { + return true; + } + break; + default: + break; + } + return false; +} + +// +// See if the 'from' type is allowed to be implicitly converted to the +// 'to' type. This is not about vector/array/struct, only about basic type. +// +bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperator op) const +{ + if ((isEsProfile() && version < 310 ) || version == 110) + return false; + + if (from == to) + return true; + + // TODO: Move more policies into language-specific handlers. + // Some languages allow more general (or potentially, more specific) conversions under some conditions. + if (getSource() == EShSourceHlsl) { + const bool fromConvertable = (from == EbtFloat || from == EbtDouble || from == EbtInt || from == EbtUint || from == EbtBool); + const bool toConvertable = (to == EbtFloat || to == EbtDouble || to == EbtInt || to == EbtUint || to == EbtBool); + + if (fromConvertable && toConvertable) { + switch (op) { + case EOpAndAssign: // assignments can perform arbitrary conversions + case EOpInclusiveOrAssign: // ... + case EOpExclusiveOrAssign: // ... + case EOpAssign: // ... + case EOpAddAssign: // ... + case EOpSubAssign: // ... + case EOpMulAssign: // ... + case EOpVectorTimesScalarAssign: // ... + case EOpMatrixTimesScalarAssign: // ... + case EOpDivAssign: // ... + case EOpModAssign: // ... + case EOpReturn: // function returns can also perform arbitrary conversions + case EOpFunctionCall: // conversion of a calling parameter + case EOpLogicalNot: + case EOpLogicalAnd: + case EOpLogicalOr: + case EOpLogicalXor: + case EOpConstructStruct: + return true; + default: + break; + } + } + } + + if (getSource() == EShSourceHlsl) { + // HLSL + if (from == EbtBool && (to == EbtInt || to == EbtUint || to == EbtFloat)) + return true; + } else { + // GLSL + if (isIntegralPromotion(from, to) || + isFPPromotion(from, to) || + isIntegralConversion(from, to) || + isFPConversion(from, to) || + isFPIntegralConversion(from, to)) { + + if (numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types) || + numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types_int8) || + numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types_int16) || + numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types_int32) || + numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types_int64) || + numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types_float16) || + numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types_float32) || + numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types_float64)) { + return true; + } + } + } + + if (isEsProfile()) { + switch (to) { + case EbtFloat: + switch (from) { + case EbtInt: + case EbtUint: + return numericFeatures.contains(TNumericFeatures::shader_implicit_conversions); + default: + return false; + } + case EbtUint: + switch (from) { + case EbtInt: + return numericFeatures.contains(TNumericFeatures::shader_implicit_conversions); + default: + return false; + } + default: + return false; + } + } else { + switch (to) { + case EbtDouble: + switch (from) { + case EbtInt: + case EbtUint: + case EbtInt64: + case EbtUint64: + case EbtFloat: + return version >= 400 || numericFeatures.contains(TNumericFeatures::gpu_shader_fp64); + case EbtInt16: + case EbtUint16: + return (version >= 400 || numericFeatures.contains(TNumericFeatures::gpu_shader_fp64)) && + (numericFeatures.contains(TNumericFeatures::nv_gpu_shader5_types) || + numericFeatures.contains(TNumericFeatures::gpu_shader_int16)); + case EbtFloat16: + return (version >= 400 || numericFeatures.contains(TNumericFeatures::gpu_shader_fp64)) && + (numericFeatures.contains(TNumericFeatures::nv_gpu_shader5_types) || + numericFeatures.contains(TNumericFeatures::gpu_shader_half_float)); + case EbtBFloat16: + case EbtFloatE5M2: + case EbtFloatE4M3: + return true; + case EbtInt8: + case EbtUint8: + return numericFeatures.contains(TNumericFeatures::nv_gpu_shader5_types); + default: + return false; + } + case EbtFloat: + switch (from) { + case EbtInt: + case EbtUint: + return true; + case EbtBool: + return getSource() == EShSourceHlsl; + case EbtInt16: + case EbtUint16: + return numericFeatures.contains(TNumericFeatures::gpu_shader_int16) || + numericFeatures.contains(TNumericFeatures::nv_gpu_shader5_types); + case EbtFloat16: + return numericFeatures.contains(TNumericFeatures::gpu_shader_half_float) || + numericFeatures.contains(TNumericFeatures::nv_gpu_shader5_types) || + getSource() == EShSourceHlsl; + case EbtBFloat16: + case EbtFloatE5M2: + case EbtFloatE4M3: + return true; + case EbtInt8: + case EbtUint8: + return numericFeatures.contains(TNumericFeatures::nv_gpu_shader5_types); + default: + return false; + } + case EbtUint: + switch (from) { + case EbtInt: + return version >= 400 || getSource() == EShSourceHlsl || + IsRequestedExtension(E_GL_ARB_gpu_shader5) || + numericFeatures.contains(TNumericFeatures::nv_gpu_shader5_types); + case EbtBool: + return getSource() == EShSourceHlsl; + case EbtInt16: + case EbtUint16: + return numericFeatures.contains(TNumericFeatures::gpu_shader_int16) || + numericFeatures.contains(TNumericFeatures::nv_gpu_shader5_types); + case EbtInt8: + case EbtUint8: + return numericFeatures.contains(TNumericFeatures::nv_gpu_shader5_types); + default: + return false; + } + case EbtInt: + switch (from) { + case EbtBool: + return getSource() == EShSourceHlsl; + case EbtInt16: + return numericFeatures.contains(TNumericFeatures::gpu_shader_int16) || + numericFeatures.contains(TNumericFeatures::nv_gpu_shader5_types); + case EbtInt8: + return numericFeatures.contains(TNumericFeatures::nv_gpu_shader5_types); + default: + return false; + } + case EbtUint64: + switch (from) { + case EbtInt: + case EbtUint: + case EbtInt64: + return true; + case EbtInt16: + case EbtUint16: + return numericFeatures.contains(TNumericFeatures::gpu_shader_int16) || + numericFeatures.contains(TNumericFeatures::nv_gpu_shader5_types); + case EbtInt8: + case EbtUint8: + return numericFeatures.contains(TNumericFeatures::nv_gpu_shader5_types); + default: + return false; + } + case EbtInt64: + switch (from) { + case EbtInt: + return true; + case EbtInt8: + return numericFeatures.contains(TNumericFeatures::nv_gpu_shader5_types); + case EbtInt16: + return numericFeatures.contains(TNumericFeatures::gpu_shader_int16) || + numericFeatures.contains(TNumericFeatures::nv_gpu_shader5_types); + default: + return false; + } + case EbtFloat16: + switch (from) { + case EbtInt16: + case EbtUint16: + return numericFeatures.contains(TNumericFeatures::gpu_shader_int16); + case EbtFloatE5M2: + case EbtFloatE4M3: + return true; + default: + break; + } + return false; + case EbtBFloat16: + switch (from) { + case EbtFloatE5M2: + case EbtFloatE4M3: + return true; + default: + break; + } + return false; + case EbtUint16: + switch (from) { + case EbtInt16: + return numericFeatures.contains(TNumericFeatures::gpu_shader_int16); + default: + break; + } + return false; + default: + return false; + } + } + + return false; +} + +static bool canSignedIntTypeRepresentAllUnsignedValues(TBasicType sintType, TBasicType uintType) +{ + switch(sintType) { + case EbtInt8: + switch(uintType) { + case EbtUint8: + case EbtUint16: + case EbtUint: + case EbtUint64: + return false; + default: + assert(false); + return false; + } + break; + case EbtInt16: + switch(uintType) { + case EbtUint8: + return true; + case EbtUint16: + case EbtUint: + case EbtUint64: + return false; + default: + assert(false); + return false; + } + break; + case EbtInt: + switch(uintType) { + case EbtUint8: + case EbtUint16: + return true; + case EbtUint: + return false; + default: + assert(false); + return false; + } + break; + case EbtInt64: + switch(uintType) { + case EbtUint8: + case EbtUint16: + case EbtUint: + return true; + case EbtUint64: + return false; + default: + assert(false); + return false; + } + break; + default: + assert(false); + return false; + } +} + + +static TBasicType getCorrespondingUnsignedType(TBasicType type) +{ + switch(type) { + case EbtInt8: + return EbtUint8; + case EbtInt16: + return EbtUint16; + case EbtInt: + return EbtUint; + case EbtInt64: + return EbtUint64; + default: + assert(false); + return EbtNumTypes; + } +} + +// Implements the following rules +// - If either operand has type float64_t or derived from float64_t, +// the other shall be converted to float64_t or derived type. +// - Otherwise, if either operand has type float32_t or derived from +// float32_t, the other shall be converted to float32_t or derived type. +// - Otherwise, if either operand has type float16_t or derived from +// float16_t, the other shall be converted to float16_t or derived type. +// - Otherwise, if both operands have integer types the following rules +// shall be applied to the operands: +// - If both operands have the same type, no further conversion +// is needed. +// - Otherwise, if both operands have signed integer types or both +// have unsigned integer types, the operand with the type of lesser +// integer conversion rank shall be converted to the type of the +// operand with greater rank. +// - Otherwise, if the operand that has unsigned integer type has rank +// greater than or equal to the rank of the type of the other +// operand, the operand with signed integer type shall be converted +// to the type of the operand with unsigned integer type. +// - Otherwise, if the type of the operand with signed integer type can +// represent all of the values of the type of the operand with +// unsigned integer type, the operand with unsigned integer type +// shall be converted to the type of the operand with signed +// integer type. +// - Otherwise, both operands shall be converted to the unsigned +// integer type corresponding to the type of the operand with signed +// integer type. + +std::tuple TIntermediate::getConversionDestinationType(TBasicType type0, TBasicType type1, TOperator op) const +{ + TBasicType res0 = EbtNumTypes; + TBasicType res1 = EbtNumTypes; + + if ((isEsProfile() && + (version < 310 || !numericFeatures.contains(TNumericFeatures::shader_implicit_conversions))) || + version == 110) + return std::make_tuple(res0, res1); + + if (getSource() == EShSourceHlsl) { + if (canImplicitlyPromote(type1, type0, op)) { + res0 = type0; + res1 = type0; + } else if (canImplicitlyPromote(type0, type1, op)) { + res0 = type1; + res1 = type1; + } + return std::make_tuple(res0, res1); + } + + if ((type0 == EbtDouble && canImplicitlyPromote(type1, EbtDouble, op)) || + (type1 == EbtDouble && canImplicitlyPromote(type0, EbtDouble, op)) ) { + res0 = EbtDouble; + res1 = EbtDouble; + } else if ((type0 == EbtFloat && canImplicitlyPromote(type1, EbtFloat, op)) || + (type1 == EbtFloat && canImplicitlyPromote(type0, EbtFloat, op)) ) { + res0 = EbtFloat; + res1 = EbtFloat; + } else if ((type0 == EbtFloat16 && canImplicitlyPromote(type1, EbtFloat16, op)) || + (type1 == EbtFloat16 && canImplicitlyPromote(type0, EbtFloat16, op)) ) { + res0 = EbtFloat16; + res1 = EbtFloat16; + } else if ((type0 == EbtBFloat16 && canImplicitlyPromote(type1, EbtBFloat16, op)) || + (type1 == EbtBFloat16 && canImplicitlyPromote(type0, EbtBFloat16, op)) ) { + res0 = EbtBFloat16; + res1 = EbtBFloat16; + } else if (isTypeInt(type0) && isTypeInt(type1) && + (canImplicitlyPromote(type0, type1, op) || canImplicitlyPromote(type1, type0, op))) { + if ((isTypeSignedInt(type0) && isTypeSignedInt(type1)) || + (isTypeUnsignedInt(type0) && isTypeUnsignedInt(type1))) { + if (getTypeRank(type0) < getTypeRank(type1)) { + res0 = type1; + res1 = type1; + } else { + res0 = type0; + res1 = type0; + } + } else if (isTypeUnsignedInt(type0) && (getTypeRank(type0) > getTypeRank(type1))) { + res0 = type0; + res1 = type0; + } else if (isTypeUnsignedInt(type1) && (getTypeRank(type1) > getTypeRank(type0))) { + res0 = type1; + res1 = type1; + } else if (isTypeSignedInt(type0)) { + if (canSignedIntTypeRepresentAllUnsignedValues(type0, type1)) { + res0 = type0; + res1 = type0; + } else { + res0 = getCorrespondingUnsignedType(type0); + res1 = getCorrespondingUnsignedType(type0); + } + } else if (isTypeSignedInt(type1)) { + if (canSignedIntTypeRepresentAllUnsignedValues(type1, type0)) { + res0 = type1; + res1 = type1; + } else { + res0 = getCorrespondingUnsignedType(type1); + res1 = getCorrespondingUnsignedType(type1); + } + } + } + + return std::make_tuple(res0, res1); +} + +// +// Given a type, find what operation would fully construct it. +// +TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const +{ + TOperator op = EOpNull; + + if (type.getQualifier().isNonUniform()) + return EOpConstructNonuniform; + + if (type.isCoopMatNV()) + return EOpConstructCooperativeMatrixNV; + + if (type.isCoopMatKHR()) + return EOpConstructCooperativeMatrixKHR; + + if (type.isCoopVecNV()) + return EOpConstructCooperativeVectorNV; + + switch (type.getBasicType()) { + case EbtStruct: + op = EOpConstructStruct; + break; + case EbtSampler: + if (type.getSampler().isCombined()) + op = EOpConstructTextureSampler; + break; + case EbtFloat: + if (type.isMatrix()) { + switch (type.getMatrixCols()) { + case 2: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructMat2x2; break; + case 3: op = EOpConstructMat2x3; break; + case 4: op = EOpConstructMat2x4; break; + default: break; // some compilers want this + } + break; + case 3: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructMat3x2; break; + case 3: op = EOpConstructMat3x3; break; + case 4: op = EOpConstructMat3x4; break; + default: break; // some compilers want this + } + break; + case 4: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructMat4x2; break; + case 3: op = EOpConstructMat4x3; break; + case 4: op = EOpConstructMat4x4; break; + default: break; // some compilers want this + } + break; + default: break; // some compilers want this + } + } else { + switch(type.getVectorSize()) { + case 1: op = EOpConstructFloat; break; + case 2: op = EOpConstructVec2; break; + case 3: op = EOpConstructVec3; break; + case 4: op = EOpConstructVec4; break; + default: break; // some compilers want this + } + } + break; + case EbtInt: + if (type.getMatrixCols()) { + switch (type.getMatrixCols()) { + case 2: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructIMat2x2; break; + case 3: op = EOpConstructIMat2x3; break; + case 4: op = EOpConstructIMat2x4; break; + default: break; // some compilers want this + } + break; + case 3: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructIMat3x2; break; + case 3: op = EOpConstructIMat3x3; break; + case 4: op = EOpConstructIMat3x4; break; + default: break; // some compilers want this + } + break; + case 4: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructIMat4x2; break; + case 3: op = EOpConstructIMat4x3; break; + case 4: op = EOpConstructIMat4x4; break; + default: break; // some compilers want this + } + break; + } + } else { + switch(type.getVectorSize()) { + case 1: op = EOpConstructInt; break; + case 2: op = EOpConstructIVec2; break; + case 3: op = EOpConstructIVec3; break; + case 4: op = EOpConstructIVec4; break; + default: break; // some compilers want this + } + } + break; + case EbtUint: + if (type.getMatrixCols()) { + switch (type.getMatrixCols()) { + case 2: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructUMat2x2; break; + case 3: op = EOpConstructUMat2x3; break; + case 4: op = EOpConstructUMat2x4; break; + default: break; // some compilers want this + } + break; + case 3: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructUMat3x2; break; + case 3: op = EOpConstructUMat3x3; break; + case 4: op = EOpConstructUMat3x4; break; + default: break; // some compilers want this + } + break; + case 4: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructUMat4x2; break; + case 3: op = EOpConstructUMat4x3; break; + case 4: op = EOpConstructUMat4x4; break; + default: break; // some compilers want this + } + break; + } + } else { + switch(type.getVectorSize()) { + case 1: op = EOpConstructUint; break; + case 2: op = EOpConstructUVec2; break; + case 3: op = EOpConstructUVec3; break; + case 4: op = EOpConstructUVec4; break; + default: break; // some compilers want this + } + } + break; + case EbtBool: + if (type.getMatrixCols()) { + switch (type.getMatrixCols()) { + case 2: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructBMat2x2; break; + case 3: op = EOpConstructBMat2x3; break; + case 4: op = EOpConstructBMat2x4; break; + default: break; // some compilers want this + } + break; + case 3: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructBMat3x2; break; + case 3: op = EOpConstructBMat3x3; break; + case 4: op = EOpConstructBMat3x4; break; + default: break; // some compilers want this + } + break; + case 4: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructBMat4x2; break; + case 3: op = EOpConstructBMat4x3; break; + case 4: op = EOpConstructBMat4x4; break; + default: break; // some compilers want this + } + break; + } + } else { + switch(type.getVectorSize()) { + case 1: op = EOpConstructBool; break; + case 2: op = EOpConstructBVec2; break; + case 3: op = EOpConstructBVec3; break; + case 4: op = EOpConstructBVec4; break; + default: break; // some compilers want this + } + } + break; + case EbtDouble: + if (type.getMatrixCols()) { + switch (type.getMatrixCols()) { + case 2: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructDMat2x2; break; + case 3: op = EOpConstructDMat2x3; break; + case 4: op = EOpConstructDMat2x4; break; + default: break; // some compilers want this + } + break; + case 3: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructDMat3x2; break; + case 3: op = EOpConstructDMat3x3; break; + case 4: op = EOpConstructDMat3x4; break; + default: break; // some compilers want this + } + break; + case 4: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructDMat4x2; break; + case 3: op = EOpConstructDMat4x3; break; + case 4: op = EOpConstructDMat4x4; break; + default: break; // some compilers want this + } + break; + } + } else { + switch(type.getVectorSize()) { + case 1: op = EOpConstructDouble; break; + case 2: op = EOpConstructDVec2; break; + case 3: op = EOpConstructDVec3; break; + case 4: op = EOpConstructDVec4; break; + default: break; // some compilers want this + } + } + break; + case EbtFloat16: + if (type.getMatrixCols()) { + switch (type.getMatrixCols()) { + case 2: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructF16Mat2x2; break; + case 3: op = EOpConstructF16Mat2x3; break; + case 4: op = EOpConstructF16Mat2x4; break; + default: break; // some compilers want this + } + break; + case 3: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructF16Mat3x2; break; + case 3: op = EOpConstructF16Mat3x3; break; + case 4: op = EOpConstructF16Mat3x4; break; + default: break; // some compilers want this + } + break; + case 4: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructF16Mat4x2; break; + case 3: op = EOpConstructF16Mat4x3; break; + case 4: op = EOpConstructF16Mat4x4; break; + default: break; // some compilers want this + } + break; + } + } + else { + switch (type.getVectorSize()) { + case 1: op = EOpConstructFloat16; break; + case 2: op = EOpConstructF16Vec2; break; + case 3: op = EOpConstructF16Vec3; break; + case 4: op = EOpConstructF16Vec4; break; + default: break; // some compilers want this + } + } + break; + case EbtBFloat16: + switch (type.getVectorSize()) { + case 1: op = EOpConstructBFloat16; break; + case 2: op = EOpConstructBF16Vec2; break; + case 3: op = EOpConstructBF16Vec3; break; + case 4: op = EOpConstructBF16Vec4; break; + default: break; // some compilers want this + } + break; + case EbtFloatE5M2: + switch (type.getVectorSize()) { + case 1: op = EOpConstructFloatE5M2; break; + case 2: op = EOpConstructFloatE5M2Vec2; break; + case 3: op = EOpConstructFloatE5M2Vec3; break; + case 4: op = EOpConstructFloatE5M2Vec4; break; + default: break; // some compilers want this + } + break; + case EbtFloatE4M3: + switch (type.getVectorSize()) { + case 1: op = EOpConstructFloatE4M3; break; + case 2: op = EOpConstructFloatE4M3Vec2; break; + case 3: op = EOpConstructFloatE4M3Vec3; break; + case 4: op = EOpConstructFloatE4M3Vec4; break; + default: break; // some compilers want this + } + break; + case EbtInt8: + switch(type.getVectorSize()) { + case 1: op = EOpConstructInt8; break; + case 2: op = EOpConstructI8Vec2; break; + case 3: op = EOpConstructI8Vec3; break; + case 4: op = EOpConstructI8Vec4; break; + default: break; // some compilers want this + } + break; + case EbtUint8: + switch(type.getVectorSize()) { + case 1: op = EOpConstructUint8; break; + case 2: op = EOpConstructU8Vec2; break; + case 3: op = EOpConstructU8Vec3; break; + case 4: op = EOpConstructU8Vec4; break; + default: break; // some compilers want this + } + break; + case EbtInt16: + switch(type.getVectorSize()) { + case 1: op = EOpConstructInt16; break; + case 2: op = EOpConstructI16Vec2; break; + case 3: op = EOpConstructI16Vec3; break; + case 4: op = EOpConstructI16Vec4; break; + default: break; // some compilers want this + } + break; + case EbtUint16: + switch(type.getVectorSize()) { + case 1: op = EOpConstructUint16; break; + case 2: op = EOpConstructU16Vec2; break; + case 3: op = EOpConstructU16Vec3; break; + case 4: op = EOpConstructU16Vec4; break; + default: break; // some compilers want this + } + break; + case EbtInt64: + switch(type.getVectorSize()) { + case 1: op = EOpConstructInt64; break; + case 2: op = EOpConstructI64Vec2; break; + case 3: op = EOpConstructI64Vec3; break; + case 4: op = EOpConstructI64Vec4; break; + default: break; // some compilers want this + } + break; + case EbtUint64: + switch(type.getVectorSize()) { + case 1: op = EOpConstructUint64; break; + case 2: op = EOpConstructU64Vec2; break; + case 3: op = EOpConstructU64Vec3; break; + case 4: op = EOpConstructU64Vec4; break; + default: break; // some compilers want this + } + break; + case EbtReference: + op = EOpConstructReference; + break; + + case EbtAccStruct: + op = EOpConstructAccStruct; + break; + default: + break; + } + + return op; +} + +// +// Safe way to combine two nodes into an aggregate. Works with null pointers, +// a node that's not a aggregate yet, etc. +// +// Returns the resulting aggregate, unless nullptr was passed in for +// both existing nodes. +// +TIntermAggregate* TIntermediate::growAggregate(TIntermNode* left, TIntermNode* right) +{ + if (left == nullptr && right == nullptr) + return nullptr; + + TIntermAggregate* aggNode = nullptr; + if (left != nullptr) + aggNode = left->getAsAggregate(); + if (aggNode == nullptr || aggNode->getOp() != EOpNull) { + aggNode = new TIntermAggregate; + if (left != nullptr) + aggNode->getSequence().push_back(left); + } + + if (right != nullptr) + aggNode->getSequence().push_back(right); + + return aggNode; +} + +TIntermAggregate* TIntermediate::growAggregate(TIntermNode* left, TIntermNode* right, const TSourceLoc& loc) +{ + TIntermAggregate* aggNode = growAggregate(left, right); + if (aggNode) + aggNode->setLoc(loc); + + return aggNode; +} + +TIntermAggregate* TIntermediate::mergeAggregate(TIntermNode* left, TIntermNode* right) +{ + if (left == nullptr && right == nullptr) + return nullptr; + + TIntermAggregate* aggNode = nullptr; + if (left != nullptr) + aggNode = left->getAsAggregate(); + if (aggNode == nullptr || aggNode->getOp() != EOpNull) { + aggNode = new TIntermAggregate; + if (left != nullptr) + aggNode->getSequence().push_back(left); + } + + TIntermAggregate* rhsagg = right->getAsAggregate(); + if (rhsagg == nullptr || rhsagg->getOp() != EOpNull) + aggNode->getSequence().push_back(right); + else + aggNode->getSequence().insert(aggNode->getSequence().end(), + rhsagg->getSequence().begin(), + rhsagg->getSequence().end()); + + return aggNode; +} + +TIntermAggregate* TIntermediate::mergeAggregate(TIntermNode* left, TIntermNode* right, const TSourceLoc& loc) +{ + TIntermAggregate* aggNode = mergeAggregate(left, right); + if (aggNode) + aggNode->setLoc(loc); + + return aggNode; +} + +// +// Turn an existing node into an aggregate. +// +// Returns an aggregate, unless nullptr was passed in for the existing node. +// +TIntermAggregate* TIntermediate::makeAggregate(TIntermNode* node) +{ + if (node == nullptr) + return nullptr; + + TIntermAggregate* aggNode = new TIntermAggregate; + aggNode->getSequence().push_back(node); + aggNode->setLoc(node->getLoc()); + + return aggNode; +} + +TIntermAggregate* TIntermediate::makeAggregate(TIntermNode* node, const TSourceLoc& loc) +{ + if (node == nullptr) + return nullptr; + + TIntermAggregate* aggNode = new TIntermAggregate; + aggNode->getSequence().push_back(node); + aggNode->setLoc(loc); + + return aggNode; +} + +// +// Make an aggregate with an empty sequence. +// +TIntermAggregate* TIntermediate::makeAggregate(const TSourceLoc& loc) +{ + TIntermAggregate* aggNode = new TIntermAggregate; + aggNode->setLoc(loc); + + return aggNode; +} + +// +// For "if" test nodes. There are three children; a condition, +// a true path, and a false path. The two paths are in the +// nodePair. +// +// Returns the selection node created. +// +TIntermSelection* TIntermediate::addSelection(TIntermTyped* cond, TIntermNodePair nodePair, const TSourceLoc& loc) +{ + // + // Don't prune the false path for compile-time constants; it's needed + // for static access analysis. + // + + TIntermSelection* node = new TIntermSelection(cond, nodePair.node1, nodePair.node2); + node->setLoc(loc); + + return node; +} + +TIntermTyped* TIntermediate::addComma(TIntermTyped* left, TIntermTyped* right, const TSourceLoc& loc) +{ + // However, the lowest precedence operators of the sequence operator ( , ) and the assignment operators + // ... are not included in the operators that can create a constant expression. + // + // if (left->getType().getQualifier().storage == EvqConst && + // right->getType().getQualifier().storage == EvqConst) { + + // return right; + //} + + TIntermTyped *commaAggregate = growAggregate(left, right, loc); + commaAggregate->getAsAggregate()->setOperator(EOpComma); + commaAggregate->setType(right->getType()); + commaAggregate->getWritableType().getQualifier().makeTemporary(); + + return commaAggregate; +} + +TIntermTyped* TIntermediate::addMethod(TIntermTyped* object, const TType& type, const TString* name, const TSourceLoc& loc) +{ + TIntermMethod* method = new TIntermMethod(object, type, *name); + method->setLoc(loc); + + return method; +} + +// +// For "?:" test nodes. There are three children; a condition, +// a true path, and a false path. The two paths are specified +// as separate parameters. For vector 'cond', the true and false +// are not paths, but vectors to mix. +// +// Specialization constant operations include +// - The ternary operator ( ? : ) +// +// Returns the selection node created, or nullptr if one could not be. +// +TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, + const TSourceLoc& loc) +{ + // If it's void, go to the if-then-else selection() + if (trueBlock->getBasicType() == EbtVoid && falseBlock->getBasicType() == EbtVoid) { + TIntermNodePair pair = { trueBlock, falseBlock }; + TIntermSelection* selection = addSelection(cond, pair, loc); + if (getSource() == EShSourceHlsl) + selection->setNoShortCircuit(); + + return selection; + } + + // + // Get compatible types. + // + auto children = addPairConversion(EOpSequence, trueBlock, falseBlock); + trueBlock = std::get<0>(children); + falseBlock = std::get<1>(children); + + if (trueBlock == nullptr || falseBlock == nullptr || + trueBlock->getBasicType() == EbtString || falseBlock->getBasicType() == EbtString) + return nullptr; + + // Handle a vector condition as a mix + if (!cond->getType().isScalarOrVec1()) { + TType targetVectorType(trueBlock->getType().getBasicType(), EvqTemporary, + cond->getType().getVectorSize()); + // smear true/false operands as needed + trueBlock = addUniShapeConversion(EOpMix, targetVectorType, trueBlock); + falseBlock = addUniShapeConversion(EOpMix, targetVectorType, falseBlock); + + // After conversion, types have to match. + if (falseBlock->getType() != trueBlock->getType()) + return nullptr; + + // make the mix operation + TIntermAggregate* mix = makeAggregate(loc); + mix = growAggregate(mix, falseBlock); + mix = growAggregate(mix, trueBlock); + mix = growAggregate(mix, cond); + mix->setType(targetVectorType); + mix->setOp(EOpMix); + + return mix; + } + + // Now have a scalar condition... + + // Convert true and false expressions to matching types + addBiShapeConversion(EOpMix, trueBlock, falseBlock); + + // After conversion, types have to match. + if (falseBlock->getType() != trueBlock->getType()) + return nullptr; + + // Eliminate the selection when the condition is a scalar and all operands are constant. + if (cond->getAsConstantUnion() && trueBlock->getAsConstantUnion() && falseBlock->getAsConstantUnion()) { + if (cond->getAsConstantUnion()->getConstArray()[0].getBConst()) + return trueBlock; + else + return falseBlock; + } + + // + // Make a selection node. + // + TIntermSelection* node = new TIntermSelection(cond, trueBlock, falseBlock, trueBlock->getType()); + node->setLoc(loc); + node->getQualifier().precision = std::max(trueBlock->getQualifier().precision, falseBlock->getQualifier().precision); + + if ((cond->getQualifier().isConstant() && specConstantPropagates(*trueBlock, *falseBlock)) || + (cond->getQualifier().isSpecConstant() && trueBlock->getQualifier().isConstant() && + falseBlock->getQualifier().isConstant())) + node->getQualifier().makeSpecConstant(); + else + node->getQualifier().makeTemporary(); + + if (getSource() == EShSourceHlsl) + node->setNoShortCircuit(); + + return node; +} + +// +// Constant terminal nodes. Has a union that contains bool, float or int constants +// +// Returns the constant union node created. +// + +TIntermConstantUnion* TIntermediate::addConstantUnion(const TConstUnionArray& unionArray, const TType& t, const TSourceLoc& loc, bool literal) const +{ + TIntermConstantUnion* node = new TIntermConstantUnion(unionArray, t); + node->getQualifier().storage = EvqConst; + node->setLoc(loc); + if (literal) + node->setLiteral(); + + return node; +} +TIntermConstantUnion* TIntermediate::addConstantUnion(signed char i8, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setI8Const(i8); + + return addConstantUnion(unionArray, TType(EbtInt8, EvqConst), loc, literal); +} + +TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned char u8, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setUConst(u8); + + return addConstantUnion(unionArray, TType(EbtUint8, EvqConst), loc, literal); +} + +TIntermConstantUnion* TIntermediate::addConstantUnion(signed short i16, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setI16Const(i16); + + return addConstantUnion(unionArray, TType(EbtInt16, EvqConst), loc, literal); +} + +TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned short u16, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setU16Const(u16); + + return addConstantUnion(unionArray, TType(EbtUint16, EvqConst), loc, literal); +} + +TIntermConstantUnion* TIntermediate::addConstantUnion(int i, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setIConst(i); + + return addConstantUnion(unionArray, TType(EbtInt, EvqConst), loc, literal); +} + +TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned int u, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setUConst(u); + + return addConstantUnion(unionArray, TType(EbtUint, EvqConst), loc, literal); +} + +TIntermConstantUnion* TIntermediate::addConstantUnion(long long i64, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setI64Const(i64); + + return addConstantUnion(unionArray, TType(EbtInt64, EvqConst), loc, literal); +} + +TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned long long u64, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setU64Const(u64); + + return addConstantUnion(unionArray, TType(EbtUint64, EvqConst), loc, literal); +} + +TIntermConstantUnion* TIntermediate::addConstantUnion(bool b, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setBConst(b); + + return addConstantUnion(unionArray, TType(EbtBool, EvqConst), loc, literal); +} + +TIntermConstantUnion* TIntermediate::addConstantUnion(double d, TBasicType baseType, const TSourceLoc& loc, bool literal) const +{ + assert(baseType == EbtFloat || baseType == EbtDouble || baseType == EbtFloat16 || baseType == EbtBFloat16 || baseType == EbtFloatE5M2 || baseType == EbtFloatE4M3); + + if (isEsProfile() && (baseType == EbtFloat || baseType == EbtFloat16)) { + int exponent = 0; + frexp(d, &exponent); + int minExp = baseType == EbtFloat ? -126 : -14; + int maxExp = baseType == EbtFloat ? 127 : 15; + if (exponent > maxExp) { //overflow, d = inf + d = std::numeric_limits::infinity(); + } else if (exponent < minExp) { //underflow, d = 0.0; + d = 0.0; + } + } + + TConstUnionArray unionArray(1); + unionArray[0].setDConst(d); + + return addConstantUnion(unionArray, TType(baseType, EvqConst), loc, literal); +} + +TIntermConstantUnion* TIntermediate::addConstantUnion(const TString* s, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setSConst(s); + + return addConstantUnion(unionArray, TType(EbtString, EvqConst), loc, literal); +} + +// Put vector swizzle selectors onto the given sequence +void TIntermediate::pushSelector(TIntermSequence& sequence, const TVectorSelector& selector, const TSourceLoc& loc) +{ + TIntermConstantUnion* constIntNode = addConstantUnion(selector, loc); + sequence.push_back(constIntNode); +} + +// Put matrix swizzle selectors onto the given sequence +void TIntermediate::pushSelector(TIntermSequence& sequence, const TMatrixSelector& selector, const TSourceLoc& loc) +{ + TIntermConstantUnion* constIntNode = addConstantUnion(selector.coord1, loc); + sequence.push_back(constIntNode); + constIntNode = addConstantUnion(selector.coord2, loc); + sequence.push_back(constIntNode); +} + +// Make an aggregate node that has a sequence of all selectors. +template TIntermTyped* TIntermediate::addSwizzle(TSwizzleSelectors& selector, const TSourceLoc& loc); +template TIntermTyped* TIntermediate::addSwizzle(TSwizzleSelectors& selector, const TSourceLoc& loc); +template +TIntermTyped* TIntermediate::addSwizzle(TSwizzleSelectors& selector, const TSourceLoc& loc) +{ + TIntermAggregate* node = new TIntermAggregate(EOpSequence); + + node->setLoc(loc); + TIntermSequence &sequenceVector = node->getSequence(); + + for (int i = 0; i < selector.size(); i++) + pushSelector(sequenceVector, selector[i], loc); + + return node; +} + +// +// Follow the left branches down to the root of an l-value +// expression (just "." and []). +// +// Return the base of the l-value (where following indexing quits working). +// Return nullptr if a chain following dereferences cannot be followed. +// +// 'swizzleOkay' says whether or not it is okay to consider a swizzle +// a valid part of the dereference chain. +// +// 'bufferReferenceOk' says if type is buffer_reference, the routine will stop to find the most left node. +// +// 'proc' is an optional function to run on each node that is processed during the traversal. 'proc' must +// return true to continue the traversal, or false to end the traversal early. +// + +const TIntermTyped* TIntermediate::traverseLValueBase(const TIntermTyped* node, bool swizzleOkay, + bool bufferReferenceOk, + std::function proc) +{ + do { + const TIntermBinary* binary = node->getAsBinaryNode(); + if (binary == nullptr) { + if (proc) { + proc(*node); + } + return node; + } + TOperator op = binary->getOp(); + if (op != EOpIndexDirect && op != EOpIndexIndirect && op != EOpIndexDirectStruct && op != EOpVectorSwizzle && + op != EOpMatrixSwizzle) + return nullptr; + if (!swizzleOkay) { + if (op == EOpVectorSwizzle || op == EOpMatrixSwizzle) + return nullptr; + if ((op == EOpIndexDirect || op == EOpIndexIndirect) && + (binary->getLeft()->getType().isVector() || binary->getLeft()->getType().isScalar()) && + !binary->getLeft()->getType().isArray()) + return nullptr; + } + if (proc) { + if (!proc(*node)) { + return node; + } + } + node = binary->getLeft(); + if (bufferReferenceOk && node->isReference()) + return node; + } while (true); +} + +// +// Create while and do-while loop nodes. +// +TIntermLoop* TIntermediate::addLoop(TIntermNode* body, TIntermNode* test, TIntermTyped* terminal, bool testFirst, + const TSourceLoc& loc) +{ + TIntermLoop* node = new TIntermLoop(body, test, terminal, testFirst); + node->setLoc(loc); + + return node; +} + +// +// Create a for-loop sequence. +// +TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* initializer, TIntermNode* test, + TIntermTyped* terminal, bool testFirst, const TSourceLoc& loc, TIntermLoop*& node) +{ + node = new TIntermLoop(body, test, terminal, testFirst); + node->setLoc(loc); + + // make a sequence of the initializer and statement, but try to reuse the + // aggregate already created for whatever is in the initializer, if there is one + TIntermAggregate* loopSequence = (initializer == nullptr || + initializer->getAsAggregate() == nullptr) ? makeAggregate(initializer, loc) + : initializer->getAsAggregate(); + if (loopSequence != nullptr && (loopSequence->getOp() == EOpSequence || loopSequence->getOp() == EOpScope)) + loopSequence->setOp(EOpNull); + loopSequence = growAggregate(loopSequence, node); + loopSequence->setOperator(getDebugInfo() ? EOpScope : EOpSequence); + + return loopSequence; +} + +// +// Add branches. +// +TIntermBranch* TIntermediate::addBranch(TOperator branchOp, const TSourceLoc& loc) +{ + return addBranch(branchOp, nullptr, loc); +} + +TIntermBranch* TIntermediate::addBranch(TOperator branchOp, TIntermTyped* expression, const TSourceLoc& loc) +{ + TIntermBranch* node = new TIntermBranch(branchOp, expression); + node->setLoc(loc); + + return node; +} + +// Propagate precision from formal function return type to actual return type, +// and on to its subtree. +void TIntermBranch::updatePrecision(TPrecisionQualifier parentPrecision) +{ + TIntermTyped* exp = getExpression(); + if (exp == nullptr) + return; + + if (exp->getBasicType() == EbtInt || exp->getBasicType() == EbtUint || + exp->getBasicType() == EbtFloat) { + if (parentPrecision != EpqNone && exp->getQualifier().precision == EpqNone) { + exp->propagatePrecision(parentPrecision); + } + } +} + +// +// This is to be executed after the final root is put on top by the parsing +// process. +// +bool TIntermediate::postProcess(TIntermNode* root, EShLanguage /*language*/) +{ + if (root == nullptr) + return true; + + // Finish off the top-level sequence + TIntermAggregate* aggRoot = root->getAsAggregate(); + if (aggRoot && aggRoot->getOp() == EOpNull) + aggRoot->setOperator(EOpSequence); + + // Propagate 'noContraction' label in backward from 'precise' variables. + glslang::PropagateNoContraction(*this); + + switch (textureSamplerTransformMode) { + case EShTexSampTransKeep: + break; + case EShTexSampTransUpgradeTextureRemoveSampler: + performTextureUpgradeAndSamplerRemovalTransformation(root); + break; + case EShTexSampTransCount: + assert(0); + break; + } + + return true; +} + +void TIntermediate::addSymbolLinkageNodes(TIntermAggregate*& linkage, EShLanguage language, TSymbolTable& symbolTable) +{ + // Add top-level nodes for declarations that must be checked cross + // compilation unit by a linker, yet might not have been referenced + // by the AST. + // + // Almost entirely, translation of symbols is driven by what's present + // in the AST traversal, not by translating the symbol table. + // + // However, there are some special cases: + // - From the specification: "Special built-in inputs gl_VertexID and + // gl_InstanceID are also considered active vertex attributes." + // - Linker-based type mismatch error reporting needs to see all + // uniforms/ins/outs variables and blocks. + // - ftransform() can make gl_Vertex and gl_ModelViewProjectionMatrix active. + // + + // if (ftransformUsed) { + // TODO: 1.1 lowering functionality: track ftransform() usage + // addSymbolLinkageNode(root, symbolTable, "gl_Vertex"); + // addSymbolLinkageNode(root, symbolTable, "gl_ModelViewProjectionMatrix"); + //} + + if (language == EShLangVertex) { + addSymbolLinkageNode(linkage, symbolTable, "gl_VertexID"); + if ((version < 140 && requestedExtensions.find(E_GL_EXT_draw_instanced) != requestedExtensions.end()) || version >= 140) + addSymbolLinkageNode(linkage, symbolTable, "gl_InstanceID"); + } + + // Add a child to the root node for the linker objects + linkage->setOperator(EOpLinkerObjects); + treeRoot = growAggregate(treeRoot, linkage); +} + +// +// Add the given name or symbol to the list of nodes at the end of the tree used +// for link-time checking and external linkage. +// + +void TIntermediate::addSymbolLinkageNode(TIntermAggregate*& linkage, TSymbolTable& symbolTable, const TString& name) +{ + TSymbol* symbol = symbolTable.find(name); + if (symbol) + addSymbolLinkageNode(linkage, *symbol->getAsVariable()); +} + +void TIntermediate::addSymbolLinkageNode(TIntermAggregate*& linkage, const TSymbol& symbol) +{ + const TVariable* variable = symbol.getAsVariable(); + if (! variable) { + // This must be a member of an anonymous block, and we need to add the whole block + const TAnonMember* anon = symbol.getAsAnonMember(); + variable = &anon->getAnonContainer(); + } + TIntermSymbol* node = addSymbol(*variable); + linkage = growAggregate(linkage, node); +} + +// +// Add a caller->callee relationship to the call graph. +// Assumes the strings are unique per signature. +// +void TIntermediate::addToCallGraph(TInfoSink& /*infoSink*/, const TString& caller, const TString& callee) +{ + // Duplicates are okay, but faster to not keep them, and they come grouped by caller, + // as long as new ones are push on the same end we check on for duplicates + for (TGraph::const_iterator call = callGraph.begin(); call != callGraph.end(); ++call) { + if (call->caller != caller) + break; + if (call->callee == callee) + return; + } + + callGraph.emplace_front(caller, callee); +} + +// +// This deletes the tree. +// +void TIntermediate::removeTree() +{ + if (treeRoot) + RemoveAllTreeNodes(treeRoot); +} + +// +// Implement the part of KHR_vulkan_glsl that lists the set of operations +// that can result in a specialization constant operation. +// +// "5.x Specialization Constant Operations" +// +// Only some operations discussed in this section may be applied to a +// specialization constant and still yield a result that is as +// specialization constant. The operations allowed are listed below. +// When a specialization constant is operated on with one of these +// operators and with another constant or specialization constant, the +// result is implicitly a specialization constant. +// +// - int(), uint(), and bool() constructors for type conversions +// from any of the following types to any of the following types: +// * int +// * uint +// * bool +// - vector versions of the above conversion constructors +// - allowed implicit conversions of the above +// - swizzles (e.g., foo.yx) +// - The following when applied to integer or unsigned integer types: +// * unary negative ( - ) +// * binary operations ( + , - , * , / , % ) +// * shift ( <<, >> ) +// * bitwise operations ( & , | , ^ ) +// - The following when applied to integer or unsigned integer scalar types: +// * comparison ( == , != , > , >= , < , <= ) +// - The following when applied to the Boolean scalar type: +// * not ( ! ) +// * logical operations ( && , || , ^^ ) +// * comparison ( == , != )" +// +// This function just handles binary and unary nodes. Construction +// rules are handled in construction paths that are not covered by the unary +// and binary paths, while required conversions will still show up here +// as unary converters in the from a construction operator. +// +bool TIntermediate::isSpecializationOperation(const TIntermOperator& node) const +{ + // The operations resulting in floating point are quite limited + // (However, some floating-point operations result in bool, like ">", + // so are handled later.) + if (node.getType().isFloatingDomain()) { + if (IsOpNumericConv(node.getOp()) && + isTypeFloat(node.getType().getBasicType()) && + isTypeFloat(node.getAsUnaryNode()->getOperand()->getAsTyped()->getType().getBasicType())) { + return true; + } + switch (node.getOp()) { + case EOpIndexDirect: + case EOpIndexIndirect: + case EOpIndexDirectStruct: + case EOpVectorSwizzle: + return true; + default: + return false; + } + } + + // Check for floating-point arguments + if (const TIntermBinary* bin = node.getAsBinaryNode()) + if (bin->getLeft() ->getType().isFloatingDomain() || + bin->getRight()->getType().isFloatingDomain()) + return false; + + // So, for now, we can assume everything left is non-floating-point... + + if (IsOpNumericConv(node.getOp())) { + TBasicType srcType = node.getAsUnaryNode()->getOperand()->getAsTyped()->getType().getBasicType(); + TBasicType dstType = node.getType().getBasicType(); + if ((isTypeInt(srcType) || srcType == EbtBool) && + (isTypeInt(dstType) || dstType == EbtBool)) { + return true; + } + } + + // Now check for integer/bool-based operations + switch (node.getOp()) { + + // dereference/swizzle + case EOpIndexDirect: + case EOpIndexIndirect: + case EOpIndexDirectStruct: + case EOpVectorSwizzle: + + // unary operations + case EOpNegative: + case EOpLogicalNot: + case EOpBitwiseNot: + + // binary operations + case EOpAdd: + case EOpSub: + case EOpMul: + case EOpVectorTimesScalar: + case EOpDiv: + case EOpMod: + case EOpRightShift: + case EOpLeftShift: + case EOpAnd: + case EOpInclusiveOr: + case EOpExclusiveOr: + case EOpLogicalOr: + case EOpLogicalXor: + case EOpLogicalAnd: + case EOpEqual: + case EOpNotEqual: + case EOpLessThan: + case EOpGreaterThan: + case EOpLessThanEqual: + case EOpGreaterThanEqual: + return true; + default: + return false; + } +} + +// Is the operation one that must propagate nonuniform? +bool TIntermediate::isNonuniformPropagating(TOperator op) const +{ + // "* All Operators in Section 5.1 (Operators), except for assignment, + // arithmetic assignment, and sequence + // * Component selection in Section 5.5 + // * Matrix components in Section 5.6 + // * Structure and Array Operations in Section 5.7, except for the length + // method." + switch (op) { + case EOpPostIncrement: + case EOpPostDecrement: + case EOpPreIncrement: + case EOpPreDecrement: + + case EOpNegative: + case EOpLogicalNot: + case EOpVectorLogicalNot: + case EOpBitwiseNot: + + case EOpAdd: + case EOpSub: + case EOpMul: + case EOpDiv: + case EOpMod: + case EOpRightShift: + case EOpLeftShift: + case EOpAnd: + case EOpInclusiveOr: + case EOpExclusiveOr: + case EOpEqual: + case EOpNotEqual: + case EOpLessThan: + case EOpGreaterThan: + case EOpLessThanEqual: + case EOpGreaterThanEqual: + case EOpVectorTimesScalar: + case EOpVectorTimesMatrix: + case EOpMatrixTimesVector: + case EOpMatrixTimesScalar: + + case EOpLogicalOr: + case EOpLogicalXor: + case EOpLogicalAnd: + + case EOpIndexDirect: + case EOpIndexIndirect: + case EOpIndexDirectStruct: + case EOpVectorSwizzle: + return true; + + default: + break; + } + + return false; +} + +//////////////////////////////////////////////////////////////// +// +// Member functions of the nodes used for building the tree. +// +//////////////////////////////////////////////////////////////// + +// +// Say whether or not an operation node changes the value of a variable. +// +// Returns true if state is modified. +// +bool TIntermOperator::modifiesState() const +{ + switch (op) { + case EOpPostIncrement: + case EOpPostDecrement: + case EOpPreIncrement: + case EOpPreDecrement: + case EOpAssign: + case EOpAddAssign: + case EOpSubAssign: + case EOpMulAssign: + case EOpVectorTimesMatrixAssign: + case EOpVectorTimesScalarAssign: + case EOpMatrixTimesScalarAssign: + case EOpMatrixTimesMatrixAssign: + case EOpDivAssign: + case EOpModAssign: + case EOpAndAssign: + case EOpInclusiveOrAssign: + case EOpExclusiveOrAssign: + case EOpLeftShiftAssign: + case EOpRightShiftAssign: + return true; + default: + return false; + } +} + +// +// returns true if the operator is for one of the constructors +// +bool TIntermOperator::isConstructor() const +{ + return op > EOpConstructGuardStart && op < EOpConstructGuardEnd; +} + +// +// Make sure the type of an operator is appropriate for its +// combination of operation and operand type. This will invoke +// promoteUnary, promoteBinary, etc as needed. +// +// Returns false if nothing makes sense. +// +bool TIntermediate::promote(TIntermOperator* node) +{ + if (node == nullptr) + return false; + + if (node->getAsUnaryNode()) + return promoteUnary(*node->getAsUnaryNode()); + + if (node->getAsBinaryNode()) + return promoteBinary(*node->getAsBinaryNode()); + + if (node->getAsAggregate()) + return promoteAggregate(*node->getAsAggregate()); + + return false; +} + +// +// See TIntermediate::promote +// +bool TIntermediate::promoteUnary(TIntermUnary& node) +{ + const TOperator op = node.getOp(); + TIntermTyped* operand = node.getOperand(); + + switch (op) { + case EOpLogicalNot: + // Convert operand to a boolean type + if (operand->getBasicType() != EbtBool) { + // Add constructor to boolean type. If that fails, we can't do it, so return false. + TIntermTyped* converted = addConversion(op, TType(EbtBool), operand); + if (converted == nullptr) + return false; + + // Use the result of converting the node to a bool. + node.setOperand(operand = converted); // also updates stack variable + } + break; + case EOpBitwiseNot: + if (!isTypeInt(operand->getBasicType())) + return false; + break; + case EOpNegative: + case EOpPostIncrement: + case EOpPostDecrement: + case EOpPreIncrement: + case EOpPreDecrement: + if (!isTypeInt(operand->getBasicType()) && + operand->getBasicType() != EbtFloat && + operand->getBasicType() != EbtFloat16 && + operand->getBasicType() != EbtDouble) + + return false; + break; + default: + // HLSL uses this path for initial function signature finding for built-ins + // taking a single argument, which generally don't participate in + // operator-based type promotion (type conversion will occur later). + // For now, scalar argument cases are relying on the setType() call below. + if (getSource() == EShSourceHlsl) + break; + + // GLSL only allows integer arguments for the cases identified above in the + // case statements. + if (operand->getBasicType() != EbtFloat) + return false; + } + + node.setType(operand->getType()); + node.getWritableType().getQualifier().makeTemporary(); + + return true; +} + +// Propagate precision qualifiers *up* from children to parent. +void TIntermUnary::updatePrecision() +{ + if (getBasicType() == EbtInt || getBasicType() == EbtUint || + getBasicType() == EbtFloat) { + if (operand->getQualifier().precision > getQualifier().precision) + getQualifier().precision = operand->getQualifier().precision; + } +} + +// +// See TIntermediate::promote +// +bool TIntermediate::promoteBinary(TIntermBinary& node) +{ + TOperator op = node.getOp(); + TIntermTyped* left = node.getLeft(); + TIntermTyped* right = node.getRight(); + + // Arrays and structures have to be exact matches. + if ((left->isArray() || right->isArray() || left->getBasicType() == EbtStruct || right->getBasicType() == EbtStruct) + && left->getType() != right->getType()) + return false; + + // Base assumption: just make the type the same as the left + // operand. Only deviations from this will be coded. + node.setType(left->getType()); + node.getWritableType().getQualifier().clear(); + + // Composite and opaque types don't having pending operator changes, e.g., + // array, structure, and samplers. Just establish final type and correctness. + if (left->isArray() || left->getBasicType() == EbtStruct || left->getBasicType() == EbtSampler) { + switch (op) { + case EOpEqual: + case EOpNotEqual: + if (left->getBasicType() == EbtSampler) { + // can't compare samplers + return false; + } else { + // Promote to conditional + node.setType(TType(EbtBool)); + } + + return true; + + case EOpAssign: + // Keep type from above + + return true; + + default: + return false; + } + } + + // + // We now have only scalars, vectors, and matrices to worry about. + // + + // HLSL implicitly promotes bool -> int for numeric operations. + // (Implicit conversions to make the operands match each other's types were already done.) + if (getSource() == EShSourceHlsl && + (left->getBasicType() == EbtBool || right->getBasicType() == EbtBool)) { + switch (op) { + case EOpLessThan: + case EOpGreaterThan: + case EOpLessThanEqual: + case EOpGreaterThanEqual: + + case EOpRightShift: + case EOpLeftShift: + + case EOpMod: + + case EOpAnd: + case EOpInclusiveOr: + case EOpExclusiveOr: + + case EOpAdd: + case EOpSub: + case EOpDiv: + case EOpMul: + if (left->getBasicType() == EbtBool) + left = createConversion(EbtInt, left); + if (right->getBasicType() == EbtBool) + right = createConversion(EbtInt, right); + if (left == nullptr || right == nullptr) + return false; + node.setLeft(left); + node.setRight(right); + + // Update the original base assumption on result type.. + node.setType(left->getType()); + node.getWritableType().getQualifier().clear(); + + break; + + default: + break; + } + } + + // Do general type checks against individual operands (comparing left and right is coming up, checking mixed shapes after that) + switch (op) { + case EOpLessThan: + case EOpGreaterThan: + case EOpLessThanEqual: + case EOpGreaterThanEqual: + // Relational comparisons need numeric types and will promote to scalar Boolean. + if (left->getBasicType() == EbtBool) + return false; + + node.setType(TType(EbtBool, EvqTemporary, left->getVectorSize())); + break; + + case EOpEqual: + case EOpNotEqual: + if (getSource() == EShSourceHlsl) { + const int resultWidth = std::max(left->getVectorSize(), right->getVectorSize()); + + // In HLSL, == or != on vectors means component-wise comparison. + if (resultWidth > 1) { + op = (op == EOpEqual) ? EOpVectorEqual : EOpVectorNotEqual; + node.setOp(op); + } + + node.setType(TType(EbtBool, EvqTemporary, resultWidth)); + } else { + // All the above comparisons result in a bool (but not the vector compares) + node.setType(TType(EbtBool)); + } + break; + + case EOpLogicalAnd: + case EOpLogicalOr: + case EOpLogicalXor: + // logical ops operate only on Booleans or vectors of Booleans. + if (left->getBasicType() != EbtBool || left->isMatrix()) + return false; + + if (getSource() == EShSourceGlsl) { + // logical ops operate only on scalar Booleans and will promote to scalar Boolean. + if (left->isVector()) + return false; + } + + node.setType(TType(EbtBool, EvqTemporary, left->getVectorSize())); + break; + + case EOpRightShift: + case EOpLeftShift: + case EOpRightShiftAssign: + case EOpLeftShiftAssign: + + case EOpMod: + case EOpModAssign: + + case EOpAnd: + case EOpInclusiveOr: + case EOpExclusiveOr: + case EOpAndAssign: + case EOpInclusiveOrAssign: + case EOpExclusiveOrAssign: + if (getSource() == EShSourceHlsl) + break; + + // Check for integer-only operands. + if (!isTypeInt(left->getBasicType()) && !isTypeInt(right->getBasicType())) + return false; + if (left->isMatrix() || right->isMatrix()) + return false; + + break; + + case EOpAdd: + case EOpSub: + case EOpDiv: + case EOpMul: + case EOpAddAssign: + case EOpSubAssign: + case EOpMulAssign: + case EOpDivAssign: + // check for non-Boolean operands + if (left->getBasicType() == EbtBool || right->getBasicType() == EbtBool) + return false; + break; + + default: + break; + } + + // Compare left and right, and finish with the cases where the operand types must match + switch (op) { + case EOpLessThan: + case EOpGreaterThan: + case EOpLessThanEqual: + case EOpGreaterThanEqual: + + case EOpEqual: + case EOpNotEqual: + case EOpVectorEqual: + case EOpVectorNotEqual: + + case EOpLogicalAnd: + case EOpLogicalOr: + case EOpLogicalXor: + return left->getType() == right->getType(); + + case EOpMod: + case EOpModAssign: + + case EOpAnd: + case EOpInclusiveOr: + case EOpExclusiveOr: + case EOpAndAssign: + case EOpInclusiveOrAssign: + case EOpExclusiveOrAssign: + + case EOpAdd: + case EOpSub: + case EOpDiv: + + case EOpAddAssign: + case EOpSubAssign: + case EOpDivAssign: + // Quick out in case the types do match + if (left->getType() == right->getType()) + return true; + + [[fallthrough]]; + + case EOpMul: + case EOpMulAssign: + // At least the basic type has to match + if (left->getBasicType() != right->getBasicType()) + return false; + break; + + default: + break; + } + + if (left->getType().isCoopMat() || right->getType().isCoopMat()) { + // Operations on two cooperative matrices must have identical types + if (left->getType().isCoopMat() && right->getType().isCoopMat() && + left->getType() != right->getType()) { + return false; + } + switch (op) { + case EOpMul: + case EOpMulAssign: + // Mul not supported in NV_cooperative_matrix + if (left->getType().isCoopMatNV() && right->getType().isCoopMatNV()) { + return false; + } + // NV_cooperative_matrix supports MulAssign is for mat*=scalar only. + // KHR_cooperative_matrix supports it for mat*=mat as well. + if (op == EOpMulAssign && right->getType().isCoopMatNV()) { + return false; + } + // Use MatrixTimesScalar if either operand is not a matrix. Otherwise use Mul. + if (!left->getType().isCoopMat() || !right->getType().isCoopMat()) { + node.setOp(op == EOpMulAssign ? EOpMatrixTimesScalarAssign : EOpMatrixTimesScalar); + } + // In case of scalar*matrix, take the result type from the matrix. + if (right->getType().isCoopMat()) { + node.setType(right->getType()); + } + return true; + case EOpAdd: + case EOpSub: + case EOpDiv: + case EOpAssign: + // These require both to be cooperative matrices + if (!left->getType().isCoopMat() || !right->getType().isCoopMat()) { + return false; + } + return true; + default: + break; + } + return false; + } + + if (left->getType().isCoopVecNV() || right->getType().isCoopVecNV()) { + // Operations on two cooperative vectors must have identical types + if (left->getType().isCoopVecNV() && right->getType().isCoopVecNV() && + left->getType() != right->getType()) { + return false; + } + switch (op) { + case EOpMul: + case EOpMulAssign: + // Use VectorTimesScalar if either operand is not a vector. Otherwise use Mul. + if (!left->getType().isCoopVecNV() || !right->getType().isCoopVecNV()) { + node.setOp(op == EOpMulAssign ? EOpVectorTimesScalarAssign : EOpVectorTimesScalar); + } + // In case of scalar*vector, take the result type from the vector. + if (right->getType().isCoopVecNV()) { + node.setType(right->getType()); + } + return true; + case EOpLeftShift: + case EOpLeftShiftAssign: + case EOpRightShift: + case EOpRightShiftAssign: + case EOpAdd: + case EOpSub: + case EOpDiv: + case EOpAssign: + // These require both to be cooperative vectors + if (!left->getType().isCoopVecNV() || !right->getType().isCoopVecNV()) { + return false; + } + return true; + default: + break; + } + return false; + } + + // Finish handling the case, for all ops, where both operands are scalars. + if (left->isScalar() && right->isScalar()) + return true; + + // Finish handling the case, for all ops, where there are two vectors of different sizes + if (left->isVector() && right->isVector() && left->getVectorSize() != right->getVectorSize() && right->getVectorSize() > 1) + return false; + + // + // We now have a mix of scalars, vectors, or matrices, for non-relational operations. + // + + // Can these two operands be combined, what is the resulting type? + TBasicType basicType = left->getBasicType(); + switch (op) { + case EOpMul: + if (!left->isMatrix() && right->isMatrix()) { + if (left->isVector()) { + if (left->getVectorSize() != right->getMatrixRows()) + return false; + node.setOp(op = EOpVectorTimesMatrix); + node.setType(TType(basicType, EvqTemporary, right->getMatrixCols())); + } else { + node.setOp(op = EOpMatrixTimesScalar); + node.setType(TType(basicType, EvqTemporary, 0, right->getMatrixCols(), right->getMatrixRows())); + } + } else if (left->isMatrix() && !right->isMatrix()) { + if (right->isVector()) { + if (left->getMatrixCols() != right->getVectorSize()) + return false; + node.setOp(op = EOpMatrixTimesVector); + node.setType(TType(basicType, EvqTemporary, left->getMatrixRows())); + } else { + node.setOp(op = EOpMatrixTimesScalar); + } + } else if (left->isMatrix() && right->isMatrix()) { + if (left->getMatrixCols() != right->getMatrixRows()) + return false; + node.setOp(op = EOpMatrixTimesMatrix); + node.setType(TType(basicType, EvqTemporary, 0, right->getMatrixCols(), left->getMatrixRows())); + } else if (! left->isMatrix() && ! right->isMatrix()) { + if (left->isVector() && right->isVector()) { + ; // leave as component product + } else if (left->isVector() || right->isVector()) { + node.setOp(op = EOpVectorTimesScalar); + if (right->isVector()) + node.setType(TType(basicType, EvqTemporary, right->getVectorSize())); + } + } else { + return false; + } + break; + case EOpMulAssign: + if (! left->isMatrix() && right->isMatrix()) { + if (left->isVector()) { + if (left->getVectorSize() != right->getMatrixRows() || left->getVectorSize() != right->getMatrixCols()) + return false; + node.setOp(op = EOpVectorTimesMatrixAssign); + } else { + return false; + } + } else if (left->isMatrix() && !right->isMatrix()) { + if (right->isVector()) { + return false; + } else { + node.setOp(op = EOpMatrixTimesScalarAssign); + } + } else if (left->isMatrix() && right->isMatrix()) { + if (left->getMatrixCols() != right->getMatrixCols() || left->getMatrixCols() != right->getMatrixRows()) + return false; + node.setOp(op = EOpMatrixTimesMatrixAssign); + } else if (!left->isMatrix() && !right->isMatrix()) { + if (left->isVector() && right->isVector()) { + // leave as component product + } else if (left->isVector() || right->isVector()) { + if (! left->isVector()) + return false; + node.setOp(op = EOpVectorTimesScalarAssign); + } + } else { + return false; + } + break; + + case EOpRightShift: + case EOpLeftShift: + case EOpRightShiftAssign: + case EOpLeftShiftAssign: + if (right->isVector() && (! left->isVector() || right->getVectorSize() != left->getVectorSize())) + return false; + break; + + case EOpAssign: + if (left->getVectorSize() != right->getVectorSize() || left->getMatrixCols() != right->getMatrixCols() || left->getMatrixRows() != right->getMatrixRows()) + return false; + [[fallthrough]]; + + case EOpAdd: + case EOpSub: + case EOpDiv: + case EOpMod: + case EOpAnd: + case EOpInclusiveOr: + case EOpExclusiveOr: + case EOpAddAssign: + case EOpSubAssign: + case EOpDivAssign: + case EOpModAssign: + case EOpAndAssign: + case EOpInclusiveOrAssign: + case EOpExclusiveOrAssign: + + if ((left->isMatrix() && right->isVector()) || + (left->isVector() && right->isMatrix()) || + left->getBasicType() != right->getBasicType()) + return false; + if (left->isMatrix() && right->isMatrix() && (left->getMatrixCols() != right->getMatrixCols() || left->getMatrixRows() != right->getMatrixRows())) + return false; + if (left->isVector() && right->isVector() && left->getVectorSize() != right->getVectorSize()) + return false; + if (right->isVector() || right->isMatrix()) { + node.getWritableType().shallowCopy(right->getType()); + node.getWritableType().getQualifier().makeTemporary(); + } + break; + + default: + return false; + } + + // + // One more check for assignment. + // + switch (op) { + // The resulting type has to match the left operand. + case EOpAssign: + case EOpAddAssign: + case EOpSubAssign: + case EOpMulAssign: + case EOpDivAssign: + case EOpModAssign: + case EOpAndAssign: + case EOpInclusiveOrAssign: + case EOpExclusiveOrAssign: + case EOpLeftShiftAssign: + case EOpRightShiftAssign: + if (node.getType() != left->getType()) + return false; + break; + default: + break; + } + + return true; +} + +// +// See TIntermediate::promote +// +bool TIntermediate::promoteAggregate(TIntermAggregate& node) +{ + TOperator op = node.getOp(); + TIntermSequence& args = node.getSequence(); + const int numArgs = static_cast(args.size()); + + // Presently, only hlsl does intrinsic promotions. + if (getSource() != EShSourceHlsl) + return true; + + // set of opcodes that can be promoted in this manner. + switch (op) { + case EOpAtan: + case EOpClamp: + case EOpCross: + case EOpDistance: + case EOpDot: + case EOpDst: + case EOpFaceForward: + // case EOpFindMSB: TODO: + // case EOpFindLSB: TODO: + case EOpFma: + case EOpMod: + case EOpFrexp: + case EOpLdexp: + case EOpMix: + case EOpLit: + case EOpMax: + case EOpMin: + case EOpModf: + // case EOpGenMul: TODO: + case EOpPow: + case EOpReflect: + case EOpRefract: + // case EOpSinCos: TODO: + case EOpSmoothStep: + case EOpStep: + break; + default: + return true; + } + + // TODO: array and struct behavior + + // Try converting all nodes to the given node's type + TIntermSequence convertedArgs(numArgs, nullptr); + + // Try to convert all types to the nonConvArg type. + for (int nonConvArg = 0; nonConvArg < numArgs; ++nonConvArg) { + // Try converting all args to this arg's type + for (int convArg = 0; convArg < numArgs; ++convArg) { + convertedArgs[convArg] = addConversion(op, args[nonConvArg]->getAsTyped()->getType(), + args[convArg]->getAsTyped()); + } + + // If we successfully converted all the args, use the result. + if (std::all_of(convertedArgs.begin(), convertedArgs.end(), + [](const TIntermNode* node) { return node != nullptr; })) { + + std::swap(args, convertedArgs); + return true; + } + } + + return false; +} + +// Propagate precision qualifiers *up* from children to parent, and then +// back *down* again to the children's subtrees. +void TIntermAggregate::updatePrecision() +{ + if (getBasicType() == EbtInt || getBasicType() == EbtUint || + getBasicType() == EbtFloat) { + TPrecisionQualifier maxPrecision = EpqNone; + TIntermSequence operands = getSequence(); + for (unsigned int i = 0; i < operands.size(); ++i) { + TIntermTyped* typedNode = operands[i]->getAsTyped(); + assert(typedNode); + maxPrecision = std::max(maxPrecision, typedNode->getQualifier().precision); + } + getQualifier().precision = maxPrecision; + for (unsigned int i = 0; i < operands.size(); ++i) { + TIntermTyped* typedNode = operands[i]->getAsTyped(); + assert(typedNode); + typedNode->propagatePrecision(maxPrecision); + } + } +} + +// Propagate precision qualifiers *up* from children to parent, and then +// back *down* again to the children's subtrees. +void TIntermBinary::updatePrecision() +{ + if (getBasicType() == EbtInt || getBasicType() == EbtUint || + getBasicType() == EbtFloat) { + if (op == EOpRightShift || op == EOpLeftShift) { + // For shifts get precision from left side only and thus no need to propagate + getQualifier().precision = left->getQualifier().precision; + } else { + getQualifier().precision = std::max(right->getQualifier().precision, left->getQualifier().precision); + if (getQualifier().precision != EpqNone) { + left->propagatePrecision(getQualifier().precision); + right->propagatePrecision(getQualifier().precision); + } + } + } +} + +// Recursively propagate precision qualifiers *down* the subtree of the current node, +// until reaching a node that already has a precision qualifier or otherwise does +// not participate in precision propagation. +void TIntermTyped::propagatePrecision(TPrecisionQualifier newPrecision) +{ + if (getQualifier().precision != EpqNone || + (getBasicType() != EbtInt && getBasicType() != EbtUint && + getBasicType() != EbtFloat && getBasicType() != EbtFloat16)) + return; + + getQualifier().precision = newPrecision; + + TIntermBinary* binaryNode = getAsBinaryNode(); + if (binaryNode) { + binaryNode->getLeft()->propagatePrecision(newPrecision); + binaryNode->getRight()->propagatePrecision(newPrecision); + + return; + } + + TIntermUnary* unaryNode = getAsUnaryNode(); + if (unaryNode) { + unaryNode->getOperand()->propagatePrecision(newPrecision); + + return; + } + + TIntermAggregate* aggregateNode = getAsAggregate(); + if (aggregateNode) { + TIntermSequence operands = aggregateNode->getSequence(); + for (unsigned int i = 0; i < operands.size(); ++i) { + TIntermTyped* typedNode = operands[i]->getAsTyped(); + if (! typedNode) + break; + typedNode->propagatePrecision(newPrecision); + } + + return; + } + + TIntermSelection* selectionNode = getAsSelectionNode(); + if (selectionNode) { + TIntermTyped* typedNode = selectionNode->getTrueBlock()->getAsTyped(); + if (typedNode) { + typedNode->propagatePrecision(newPrecision); + typedNode = selectionNode->getFalseBlock()->getAsTyped(); + if (typedNode) + typedNode->propagatePrecision(newPrecision); + } + + return; + } +} + +TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermConstantUnion* node) const +{ + const TConstUnionArray& rightUnionArray = node->getConstArray(); + int size = node->getType().computeNumComponents(); + + TConstUnionArray leftUnionArray(size); + + for (int i=0; i < size; i++) { + +#define PROMOTE(Set, CType, Get) leftUnionArray[i].Set(static_cast(rightUnionArray[i].Get())) +#define PROMOTE_TO_BOOL(Get) leftUnionArray[i].setBConst(rightUnionArray[i].Get() != 0) + +#define TO_ALL(Get) \ + switch (promoteTo) { \ + case EbtBFloat16: PROMOTE(setDConst, double, Get); break; \ + case EbtFloatE5M2: PROMOTE(setDConst, double, Get); break; \ + case EbtFloatE4M3: PROMOTE(setDConst, double, Get); break; \ + case EbtFloat16: PROMOTE(setDConst, double, Get); break; \ + case EbtFloat: PROMOTE(setDConst, double, Get); break; \ + case EbtDouble: PROMOTE(setDConst, double, Get); break; \ + case EbtInt8: PROMOTE(setI8Const, signed char, Get); break; \ + case EbtInt16: PROMOTE(setI16Const, short, Get); break; \ + case EbtInt: PROMOTE(setIConst, int, Get); break; \ + case EbtInt64: PROMOTE(setI64Const, long long, Get); break; \ + case EbtUint8: PROMOTE(setU8Const, unsigned char, Get); break; \ + case EbtUint16: PROMOTE(setU16Const, unsigned short, Get); break; \ + case EbtUint: PROMOTE(setUConst, unsigned int, Get); break; \ + case EbtUint64: PROMOTE(setU64Const, unsigned long long, Get); break; \ + case EbtBool: PROMOTE_TO_BOOL(Get); break; \ + default: return node; \ + } + + switch (node->getType().getBasicType()) { + case EbtFloat: TO_ALL(getDConst); break; + case EbtInt: TO_ALL(getIConst); break; + case EbtUint: TO_ALL(getUConst); break; + case EbtBool: TO_ALL(getBConst); break; + case EbtFloat16: TO_ALL(getDConst); break; + case EbtBFloat16: TO_ALL(getDConst); break; + case EbtFloatE5M2: TO_ALL(getDConst); break; + case EbtFloatE4M3: TO_ALL(getDConst); break; + case EbtDouble: TO_ALL(getDConst); break; + case EbtInt8: TO_ALL(getI8Const); break; + case EbtInt16: TO_ALL(getI16Const); break; + case EbtInt64: TO_ALL(getI64Const); break; + case EbtUint8: TO_ALL(getU8Const); break; + case EbtUint16: TO_ALL(getU16Const); break; + case EbtUint64: TO_ALL(getU64Const); break; + default: return node; + } + } + + const TType& t = node->getType(); + + return addConstantUnion(leftUnionArray, TType(promoteTo, t.getQualifier().storage, t.getVectorSize(), t.getMatrixCols(), t.getMatrixRows()), + node->getLoc()); +} + +void TIntermAggregate::setPragmaTable(const TPragmaTable& pTable) +{ + assert(pragmaTable == nullptr); + pragmaTable = new TPragmaTable; + *pragmaTable = pTable; +} + +// If either node is a specialization constant, while the other is +// a constant (or specialization constant), the result is still +// a specialization constant. +bool TIntermediate::specConstantPropagates(const TIntermTyped& node1, const TIntermTyped& node2) +{ + return (node1.getType().getQualifier().isSpecConstant() && node2.getType().getQualifier().isConstant()) || + (node2.getType().getQualifier().isSpecConstant() && node1.getType().getQualifier().isConstant()); +} + +struct TextureUpgradeAndSamplerRemovalTransform : public TIntermTraverser { + void visitSymbol(TIntermSymbol* symbol) override { + if (symbol->getBasicType() == EbtSampler && symbol->getType().getSampler().isTexture()) { + symbol->getWritableType().getSampler().setCombined(true); + } + } + bool visitAggregate(TVisit, TIntermAggregate* ag) override { + using namespace std; + TIntermSequence& seq = ag->getSequence(); + TQualifierList& qual = ag->getQualifierList(); + + // qual and seq are indexed using the same indices, so we have to modify both in lock-step + assert(seq.size() == qual.size() || qual.empty()); + + size_t write = 0; + for (size_t i = 0; i < seq.size(); ++i) { + TIntermSymbol* symbol = seq[i]->getAsSymbolNode(); + if (symbol && symbol->getBasicType() == EbtSampler && symbol->getType().getSampler().isPureSampler()) { + // remove pure sampler variables + continue; + } + + TIntermNode* result = seq[i]; + + // replace constructors with sampler/textures + TIntermAggregate *constructor = seq[i]->getAsAggregate(); + if (constructor && constructor->getOp() == EOpConstructTextureSampler) { + if (!constructor->getSequence().empty()) + result = constructor->getSequence()[0]; + } + + // write new node & qualifier + seq[write] = result; + if (!qual.empty()) + qual[write] = qual[i]; + write++; + } + + seq.resize(write); + if (!qual.empty()) + qual.resize(write); + + return true; + } +}; + +void TIntermediate::performTextureUpgradeAndSamplerRemovalTransformation(TIntermNode* root) +{ + TextureUpgradeAndSamplerRemovalTransform transform; + root->traverse(&transform); +} + +const char* TIntermediate::getResourceName(TResourceType res) +{ + switch (res) { + case EResSampler: return "shift-sampler-binding"; + case EResTexture: return "shift-texture-binding"; + case EResImage: return "shift-image-binding"; + case EResUbo: return "shift-ubo-binding"; + case EResSsbo: return "shift-ssbo-binding"; + case EResUav: return "shift-uav-binding"; + case EResCombinedSampler: return "shift-combined-sampler-binding"; + case EResAs: return "shift-as-binding"; + case EResTensor: return nullptr; + default: + assert(0); // internal error: should only be called with valid resource types. + return nullptr; + } +} + + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/LiveTraverser.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/LiveTraverser.h new file mode 100644 index 0000000000..d1b4e7f61d --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/LiveTraverser.h @@ -0,0 +1,211 @@ +// +// Copyright (C) 2016 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#pragma once + +#include "../Include/Common.h" +#include "reflection.h" +#include "localintermediate.h" + +#include "gl_types.h" + +#include +#include + +namespace QtShaderTools { +namespace glslang { + +// +// The traverser: mostly pass through, except +// - processing function-call nodes to push live functions onto the stack of functions to process +// - processing selection nodes to trim semantically dead code +// +// This is in the glslang namespace directly so it can be a friend of TReflection. +// This can be derived from to implement reflection database traversers or +// binding mappers: anything that wants to traverse the live subset of the tree. +// + +class TLiveTraverser : public TIntermTraverser { +public: + TLiveTraverser(const TIntermediate& i, bool traverseAll = false, + bool preVisit = true, bool inVisit = false, bool postVisit = false, bool includeDeclSymbol = false) : + TIntermTraverser(preVisit, inVisit, postVisit, false, includeDeclSymbol), + intermediate(i), traverseAll(traverseAll) + { } + + // + // Given a function name, find its subroot in the tree, and push it onto the stack of + // functions left to process. + // + void pushFunction(const TString& name) + { + TIntermSequence& globals = intermediate.getTreeRoot()->getAsAggregate()->getSequence(); + for (unsigned int f = 0; f < globals.size(); ++f) { + TIntermAggregate* candidate = globals[f]->getAsAggregate(); + if (candidate && candidate->getOp() == EOpFunction && candidate->getName() == name) { + destinations.push_back(candidate); + break; + } + } + } + + void pushGlobalReference(const TString& name) + { + TIntermSequence& globals = intermediate.getTreeRoot()->getAsAggregate()->getSequence(); + for (unsigned int f = 0; f < globals.size(); ++f) { + TIntermAggregate* candidate = globals[f]->getAsAggregate(); + if (candidate && candidate->getOp() == EOpSequence && + candidate->getSequence().size() == 1 && + candidate->getSequence()[0]->getAsBinaryNode()) { + TIntermBinary* binary = candidate->getSequence()[0]->getAsBinaryNode(); + TIntermSymbol* symbol = binary->getLeft()->getAsSymbolNode(); + if (symbol && symbol->getQualifier().storage == EvqGlobal && + symbol->getName() == name) { + destinations.push_back(candidate); + break; + } + } + } + } + + typedef std::list TDestinationStack; + TDestinationStack destinations; + +protected: + // To catch which function calls are not dead, and hence which functions must be visited. + virtual bool visitAggregate(TVisit, TIntermAggregate* node) + { + if (!traverseAll) + if (node->getOp() == EOpFunctionCall) + addFunctionCall(node); + + return true; // traverse this subtree + } + + // To prune semantically dead paths. + virtual bool visitSelection(TVisit /* visit */, TIntermSelection* node) + { + if (traverseAll) + return true; // traverse all code + + TIntermConstantUnion* constant = node->getCondition()->getAsConstantUnion(); + if (constant) { + // cull the path that is dead + if (constant->getConstArray()[0].getBConst() == true && node->getTrueBlock()) + node->getTrueBlock()->traverse(this); + if (constant->getConstArray()[0].getBConst() == false && node->getFalseBlock()) + node->getFalseBlock()->traverse(this); + + return false; // don't traverse any more, we did it all above + } else + return true; // traverse the whole subtree + } + + // To prune semantically dead paths in switch statements with constant expressions. + virtual bool visitSwitch(TVisit /* visit */, TIntermSwitch* node) + { + if (traverseAll) + return true; // traverse all code + + TIntermConstantUnion* constant = node->getCondition()->getAsConstantUnion(); + if (constant) { + TConstUnion switchValue = constant->getConstArray()[0]; + int liveBranch = -1; + const auto& body = node->getBody()->getSequence(); + for (unsigned int i = 0; i < body.size(); ++i) { + if (body[i]->getAsBranchNode()) { + if (body[i]->getAsBranchNode()->getFlowOp() == glslang::EOpCase) { + TConstUnion caseValue = + body[i]->getAsBranchNode()->getExpression()->getAsConstantUnion()->getConstArray()[0]; + if (switchValue == caseValue.getIConst()) { + liveBranch = (int)i; + break; + } + } else if (body[i]->getAsBranchNode()->getFlowOp() == glslang::EOpDefault) { + liveBranch = (int)i; + } + } + } + if (liveBranch != -1) { + for (int i = liveBranch; i < (int)body.size(); ++i) { + if (body[i]->getAsAggregate()) { + for (auto* inst : body[i]->getAsAggregate()->getSequence()) { + if (inst->getAsBranchNode() && (inst->getAsBranchNode()->getFlowOp() == glslang::EOpBreak)) + return false; // found and traversed the live case(s) + inst->traverse(this); + } + } + } + } + return false; // finished traversing all cases + } else + return true; // traverse the whole subtree + } + + // Track live functions as well as uniforms, so that we don't visit dead functions + // and only visit each function once. + void addFunctionCall(TIntermAggregate* call) + { + // just use the map to ensure we process each function at most once + if (liveFunctions.find(call->getName()) == liveFunctions.end()) { + liveFunctions.insert(call->getName()); + pushFunction(call->getName()); + } + } + + void addGlobalReference(const TString& name) + { + // just use the map to ensure we process each global at most once + if (liveGlobals.find(name) == liveGlobals.end()) { + liveGlobals.insert(name); + pushGlobalReference(name); + } + } + + const TIntermediate& intermediate; + typedef std::unordered_set TLiveFunctions; + TLiveFunctions liveFunctions; + typedef std::unordered_set TLiveGlobals; + TLiveGlobals liveGlobals; + bool traverseAll; + +private: + // prevent copy & copy construct + TLiveTraverser(TLiveTraverser&); + TLiveTraverser& operator=(TLiveTraverser&); +}; + +} // namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp new file mode 100644 index 0000000000..9f7eecd4b4 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp @@ -0,0 +1,773 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// Implement the TParseContextBase class. + +#include + +#include "ParseHelper.h" + +extern int yyparse(QtShaderTools::glslang::TParseContext*); + +namespace QtShaderTools { +namespace glslang { + +// +// Used to output syntax, parsing, and semantic errors. +// + +void TParseContextBase::outputMessage(const TSourceLoc& loc, const char* szReason, + const char* szToken, + const char* szExtraInfoFormat, + TPrefixType prefix, va_list args) +{ + const int maxSize = MaxTokenLength + 200; + char szExtraInfo[maxSize]; + + safe_vsprintf(szExtraInfo, maxSize, szExtraInfoFormat, args); + + infoSink.info.prefix(prefix); + infoSink.info.location(loc, messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); + infoSink.info << "'" << szToken << "' : " << szReason << " " << szExtraInfo << "\n"; + + if (prefix == EPrefixError) { + ++numErrors; + } +} + +void C_DECL TParseContextBase::error(const TSourceLoc& loc, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...) +{ + if (messages & EShMsgOnlyPreprocessor) + return; + // If enhanced msg readability, only print one error + if (messages & EShMsgEnhanced && numErrors > 0) + return; + va_list args; + va_start(args, szExtraInfoFormat); + outputMessage(loc, szReason, szToken, szExtraInfoFormat, EPrefixError, args); + va_end(args); + + if ((messages & EShMsgCascadingErrors) == 0) + currentScanner->setEndOfInput(); +} + +void C_DECL TParseContextBase::warn(const TSourceLoc& loc, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...) +{ + if (suppressWarnings()) + return; + va_list args; + va_start(args, szExtraInfoFormat); + outputMessage(loc, szReason, szToken, szExtraInfoFormat, EPrefixWarning, args); + va_end(args); +} + +void C_DECL TParseContextBase::ppError(const TSourceLoc& loc, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...) +{ + va_list args; + va_start(args, szExtraInfoFormat); + outputMessage(loc, szReason, szToken, szExtraInfoFormat, EPrefixError, args); + va_end(args); + + if ((messages & EShMsgCascadingErrors) == 0) + currentScanner->setEndOfInput(); +} + +void C_DECL TParseContextBase::ppWarn(const TSourceLoc& loc, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...) +{ + va_list args; + va_start(args, szExtraInfoFormat); + outputMessage(loc, szReason, szToken, szExtraInfoFormat, EPrefixWarning, args); + va_end(args); +} + +// +// Both test and if necessary, spit out an error, to see if the node is really +// an l-value that can be operated on this way. +// +// Returns true if there was an error. +// +bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op, TIntermTyped* node) +{ + TIntermBinary* binaryNode = node->getAsBinaryNode(); + + const char* symbol = nullptr; + TIntermSymbol* symNode = node->getAsSymbolNode(); + if (symNode != nullptr) + symbol = symNode->getName().c_str(); + + const char* message = nullptr; + switch (node->getQualifier().storage) { + case EvqConst: message = "can't modify a const"; break; + case EvqConstReadOnly: message = "can't modify a const"; break; + case EvqUniform: message = "can't modify a uniform"; break; + case EvqBuffer: + if (node->getQualifier().isReadOnly()) + message = "can't modify a readonly buffer"; + if (node->getQualifier().isShaderRecord()) + message = "can't modify a shaderrecordnv qualified buffer"; + break; + case EvqHitAttr: + if (language != EShLangIntersect) + message = "cannot modify hitAttributeNV in this stage"; + break; + + default: + // + // Type that can't be written to? + // + switch (node->getBasicType()) { + case EbtSampler: + if (extensionTurnedOn(E_GL_ARB_bindless_texture) == false) + message = "can't modify a sampler"; + break; + case EbtVoid: + message = "can't modify void"; + break; + case EbtAtomicUint: + message = "can't modify an atomic_uint"; + break; + case EbtAccStruct: + message = "can't modify accelerationStructureNV"; + break; + case EbtRayQuery: + message = "can't modify rayQueryEXT"; + break; + case EbtHitObjectNV: + message = "can't modify hitObjectNV"; + break; + case EbtHitObjectEXT: + message = "can't modify hitObjectEXT"; + break; + default: + break; + } + } + + if (message == nullptr && binaryNode == nullptr && symNode == nullptr) { + error(loc, " l-value required", op, "", ""); + + return true; + } + + // + // Everything else is okay, no error. + // + if (message == nullptr) + { + if (binaryNode) { + switch (binaryNode->getOp()) { + case EOpIndexDirect: + case EOpIndexIndirect: // fall through + case EOpIndexDirectStruct: // fall through + case EOpVectorSwizzle: + case EOpMatrixSwizzle: + return lValueErrorCheck(loc, op, binaryNode->getLeft()); + default: + break; + } + error(loc, " l-value required", op, "", ""); + + return true; + } + return false; + } + + // + // If we get here, we have an error and a message. + // + const TIntermTyped* leftMostTypeNode = TIntermediate::traverseLValueBase(node, true); + + if (symNode) + error(loc, " l-value required", op, "\"%s\" (%s)", symbol, message); + else + if (binaryNode && binaryNode->getAsOperator()->getOp() == EOpIndexDirectStruct) + if(IsAnonymous(leftMostTypeNode->getAsSymbolNode()->getName())) + error(loc, " l-value required", op, "\"%s\" (%s)", leftMostTypeNode->getAsSymbolNode()->getAccessName().c_str(), message); + else + error(loc, " l-value required", op, "\"%s\" (%s)", leftMostTypeNode->getAsSymbolNode()->getName().c_str(), message); + else + error(loc, " l-value required", op, "(%s)", message); + + return true; +} + +// Test for and give an error if the node can't be read from. +void TParseContextBase::rValueErrorCheck(const TSourceLoc& loc, const char* op, TIntermTyped* node) +{ + if (! node) + return; + + TIntermBinary* binaryNode = node->getAsBinaryNode(); + const TIntermSymbol* symNode = node->getAsSymbolNode(); + + if (node->getQualifier().isWriteOnly()) { + const TIntermTyped* leftMostTypeNode = TIntermediate::traverseLValueBase(node, true); + + if (symNode != nullptr) + error(loc, "can't read from writeonly object: ", op, symNode->getName().c_str()); + else if (binaryNode && + (binaryNode->getAsOperator()->getOp() == EOpIndexDirectStruct || + binaryNode->getAsOperator()->getOp() == EOpIndexDirect)) + if(IsAnonymous(leftMostTypeNode->getAsSymbolNode()->getName())) + error(loc, "can't read from writeonly object: ", op, leftMostTypeNode->getAsSymbolNode()->getAccessName().c_str()); + else + error(loc, "can't read from writeonly object: ", op, leftMostTypeNode->getAsSymbolNode()->getName().c_str()); + else + error(loc, "can't read from writeonly object: ", op, ""); + + } else { + if (binaryNode) { + switch (binaryNode->getOp()) { + case EOpIndexDirect: + case EOpIndexIndirect: + case EOpIndexDirectStruct: + case EOpVectorSwizzle: + case EOpMatrixSwizzle: + rValueErrorCheck(loc, op, binaryNode->getLeft()); + break; + default: + break; + } + } + } +} + +// Add 'symbol' to the list of deferred linkage symbols, which +// are later processed in finish(), at which point the symbol +// must still be valid. +// It is okay if the symbol's type will be subsequently edited; +// the modifications will be tracked. +// Order is preserved, to avoid creating novel forward references. +void TParseContextBase::trackLinkage(TSymbol& symbol) +{ + if (!parsingBuiltins) + linkageSymbols.push_back(&symbol); +} + +// Ensure index is in bounds, correct if necessary. +// Give an error if not. +void TParseContextBase::checkIndex(const TSourceLoc& loc, const TType& type, int64_t& index) +{ + const auto sizeIsSpecializationExpression = [&type]() { + return type.containsSpecializationSize() && + type.getArraySizes()->getOuterNode() != nullptr && + type.getArraySizes()->getOuterNode()->getAsSymbolNode() == nullptr; }; + + if (index < 0) { + error(loc, "", "[", "index out of range '%d'", index); + index = 0; + } else if (type.isArray()) { + if (type.isSizedArray() && !sizeIsSpecializationExpression() && + index >= type.getOuterArraySize()) { + error(loc, "", "[", "array index out of range '%d'", index); + index = type.getOuterArraySize() - 1; + } + } else if (type.isVector()) { + if (index >= type.getVectorSize()) { + error(loc, "", "[", "vector index out of range '%d'", index); + index = type.getVectorSize() - 1; + } + } else if (type.isMatrix()) { + if (index >= type.getMatrixCols()) { + error(loc, "", "[", "matrix index out of range '%d'", index); + index = type.getMatrixCols() - 1; + } + } else if (type.isCoopVecNV()) { + if (index >= type.computeNumComponents()) { + error(loc, "", "[", "cooperative vector index out of range '%d'", index); + index = type.computeNumComponents() - 1; + } + } +} + +// Make a shared symbol have a non-shared version that can be edited by the current +// compile, such that editing its type will not change the shared version and will +// effect all nodes already sharing it (non-shallow type), +// or adopting its full type after being edited (shallow type). +void TParseContextBase::makeEditable(TSymbol*& symbol) +{ + // copyUp() does a deep copy of the type. + symbol = symbolTable.copyUp(symbol); + + // Save it (deferred, so it can be edited first) in the AST for linker use. + if (symbol) + trackLinkage(*symbol); +} + +// Return a writable version of the variable 'name'. +// +// Return nullptr if 'name' is not found. This should mean +// something is seriously wrong (e.g., compiler asking self for +// built-in that doesn't exist). +TVariable* TParseContextBase::getEditableVariable(const char* name) +{ + bool builtIn; + TSymbol* symbol = symbolTable.find(name, &builtIn); + + assert(symbol != nullptr); + if (symbol == nullptr) + return nullptr; + + if (builtIn) + makeEditable(symbol); + + return symbol->getAsVariable(); +} + +// Select the best matching function for 'call' from 'candidateList'. +// +// Assumptions +// +// There is no exact match, so a selection algorithm needs to run. That is, the +// language-specific handler should check for exact match first, to +// decide what to do, before calling this selector. +// +// Input +// +// * list of candidate signatures to select from +// * the call +// * a predicate function convertible(from, to) that says whether or not type +// 'from' can implicitly convert to type 'to' (it includes the case of what +// the calling language would consider a matching type with no conversion +// needed) +// * a predicate function better(from1, from2, to1, to2) that says whether or +// not a conversion from <-> to2 is considered better than a conversion +// from <-> to1 (both in and out directions need testing, as declared by the +// formal parameter) +// +// Output +// +// * best matching candidate (or none, if no viable candidates found) +// * whether there was a tie for the best match (ambiguous overload selection, +// caller's choice for how to report) +// +const TFunction* TParseContextBase::selectFunction( + const TVector candidateList, + const TFunction& call, + std::function convertible, + std::function better, + /* output */ bool& tie) +{ +// +// Operation +// +// 1. Prune the input list of candidates down to a list of viable candidates, +// where each viable candidate has +// +// * at least as many parameters as there are calling arguments, with any +// remaining parameters being optional or having default values +// * each parameter is true under convertible(A, B), where A is the calling +// type for in and B is the formal type, and in addition, for out B is the +// calling type and A is the formal type +// +// 2. If there are no viable candidates, return with no match. +// +// 3. If there is only one viable candidate, it is the best match. +// +// 4. If there are multiple viable candidates, select the first viable candidate +// as the incumbent. Compare the incumbent to the next viable candidate, and if +// that candidate is better (bullets below), make it the incumbent. Repeat, with +// a linear walk through the viable candidate list. The final incumbent will be +// returned as the best match. A viable candidate is better than the incumbent if +// +// * it has a function argument with a better(...) conversion than the incumbent, +// for all directions needed by in and out +// * the incumbent has no argument with a better(...) conversion then the +// candidate, for either in or out (as needed) +// +// 5. Check for ambiguity by comparing the best match against all other viable +// candidates. If any other viable candidate has a function argument with a +// better(...) conversion than the best candidate (for either in or out +// directions), return that there was a tie for best. +// + + tie = false; + + // 1. prune to viable... + TVector viableCandidates; + for (auto it = candidateList.begin(); it != candidateList.end(); ++it) { + const TFunction& candidate = *(*it); + + // to even be a potential match, number of arguments must be >= the number of + // fixed (non-default) parameters, and <= the total (including parameter with defaults). + if (call.getParamCount() < candidate.getFixedParamCount() || + (call.getParamCount() > candidate.getParamCount() && !candidate.isVariadic())) + continue; + + // see if arguments are convertible + bool viable = true; + + // The call can have fewer parameters than the candidate, if some have defaults. + const int paramCount = std::min(call.getParamCount(), candidate.getParamCount()); + for (int param = 0; param < paramCount; ++param) { + if (candidate[param].type->getQualifier().isParamInput()) { + if (! convertible(*call[param].type, *candidate[param].type, candidate.getBuiltInOp(), param)) { + viable = false; + break; + } + } + if (candidate[param].type->getQualifier().isParamOutput()) { + if (! convertible(*candidate[param].type, *call[param].type, candidate.getBuiltInOp(), param)) { + viable = false; + break; + } + } + } + + if (viable) + viableCandidates.push_back(&candidate); + } + + // 2. none viable... + if (viableCandidates.size() == 0) + return nullptr; + + // 3. only one viable... + if (viableCandidates.size() == 1) + return viableCandidates.front(); + + // 4. find best... + const auto betterParam = [&call, &better](const TFunction& can1, const TFunction& can2) -> bool { + // is call -> can2 better than call -> can1 for any parameter + bool hasBetterParam = false; + const int paramCount = std::min({call.getParamCount(), can1.getParamCount(), can2.getParamCount()}); + for (int param = 0; param < paramCount; ++param) { + if (better(*call[param].type, *can1[param].type, *can2[param].type)) { + hasBetterParam = true; + break; + } + } + return hasBetterParam; + }; + + const auto equivalentParams = [&call, &better](const TFunction& can1, const TFunction& can2) -> bool { + // is call -> can2 equivalent to call -> can1 for all the call parameters? + const int paramCount = std::min({call.getParamCount(), can1.getParamCount(), can2.getParamCount()}); + for (int param = 0; param < paramCount; ++param) { + if (better(*call[param].type, *can1[param].type, *can2[param].type) || + better(*call[param].type, *can2[param].type, *can1[param].type)) + return false; + } + return true; + }; + + const auto enabled = [this](const TFunction& candidate) -> bool { + bool enabled = candidate.getNumExtensions() == 0; + for (int i = 0; i < candidate.getNumExtensions(); ++i) { + TExtensionBehavior behavior = getExtensionBehavior(candidate.getExtensions()[i]); + if (behavior == EBhEnable || behavior == EBhRequire) + enabled = true; + } + return enabled; + }; + + const TFunction* incumbent = viableCandidates.front(); + for (auto it = viableCandidates.begin() + 1; it != viableCandidates.end(); ++it) { + const TFunction& candidate = *(*it); + if (betterParam(*incumbent, candidate) && ! betterParam(candidate, *incumbent)) + incumbent = &candidate; + } + + // 5. ambiguity... + for (auto it = viableCandidates.begin(); it != viableCandidates.end(); ++it) { + if (incumbent == *it) + continue; + const TFunction& candidate = *(*it); + + // In the case of default parameters, it may have an identical initial set, which is + // also ambiguous + if ((betterParam(*incumbent, candidate) || equivalentParams(*incumbent, candidate)) && enabled(candidate)) + tie = true; + } + + return incumbent; +} + +// +// Look at a '.' field selector string and change it into numerical selectors +// for a vector or scalar. +// +// Always return some form of swizzle, so the result is always usable. +// +void TParseContextBase::parseSwizzleSelector(const TSourceLoc& loc, const TString& compString, int vecSize, + TSwizzleSelectors& selector) +{ + // Too long? + if (compString.size() > MaxSwizzleSelectors) + error(loc, "vector swizzle too long", compString.c_str(), ""); + + // Use this to test that all swizzle characters are from the same swizzle-namespace-set + enum { + exyzw, + ergba, + estpq, + } fieldSet[MaxSwizzleSelectors]; + + // Decode the swizzle string. + int size = std::min(MaxSwizzleSelectors, (int)compString.size()); + for (int i = 0; i < size; ++i) { + switch (compString[i]) { + case 'x': + selector.push_back(0); + fieldSet[i] = exyzw; + break; + case 'r': + selector.push_back(0); + fieldSet[i] = ergba; + break; + case 's': + selector.push_back(0); + fieldSet[i] = estpq; + break; + + case 'y': + selector.push_back(1); + fieldSet[i] = exyzw; + break; + case 'g': + selector.push_back(1); + fieldSet[i] = ergba; + break; + case 't': + selector.push_back(1); + fieldSet[i] = estpq; + break; + + case 'z': + selector.push_back(2); + fieldSet[i] = exyzw; + break; + case 'b': + selector.push_back(2); + fieldSet[i] = ergba; + break; + case 'p': + selector.push_back(2); + fieldSet[i] = estpq; + break; + + case 'w': + selector.push_back(3); + fieldSet[i] = exyzw; + break; + case 'a': + selector.push_back(3); + fieldSet[i] = ergba; + break; + case 'q': + selector.push_back(3); + fieldSet[i] = estpq; + break; + + default: + error(loc, "unknown swizzle selection", compString.c_str(), ""); + break; + } + } + + // Additional error checking. + for (int i = 0; i < selector.size(); ++i) { + if (selector[i] >= vecSize) { + error(loc, "vector swizzle selection out of range", compString.c_str(), ""); + selector.resize(i); + break; + } + + if (i > 0 && fieldSet[i] != fieldSet[i-1]) { + error(loc, "vector swizzle selectors not from the same set", compString.c_str(), ""); + selector.resize(i); + break; + } + } + + // Ensure it is valid. + if (selector.size() == 0) + selector.push_back(0); +} + +// +// Make the passed-in variable information become a member of the +// global uniform block. If this doesn't exist yet, make it. +// +void TParseContextBase::growGlobalUniformBlock(const TSourceLoc& loc, TType& memberType, const TString& memberName, TTypeList* typeList) +{ + // Make the global block, if not yet made. + if (globalUniformBlock == nullptr) { + TQualifier blockQualifier; + blockQualifier.clear(); + blockQualifier.storage = EvqUniform; + TType blockType(new TTypeList, *NewPoolTString(getGlobalUniformBlockName()), blockQualifier); + setUniformBlockDefaults(blockType); + globalUniformBlock = new TVariable(NewPoolTString(""), blockType, true); + firstNewMember = 0; + } + + // Update with binding and set + globalUniformBlock->getWritableType().getQualifier().layoutBinding = globalUniformBinding; + globalUniformBlock->getWritableType().getQualifier().layoutSet = globalUniformSet; + + // Check for declarations of this default uniform that already exist due to other compilation units. + TSymbol* symbol = symbolTable.find(memberName); + if (symbol) { + if (memberType != symbol->getType()) { + TString err; + err += "Redeclaration: already declared as \"" + symbol->getType().getCompleteString() + "\""; + error(loc, "", memberName.c_str(), err.c_str()); + } + return; + } + + // Add the requested member as a member to the global block. + TType* type = new TType; + type->shallowCopy(memberType); + type->setFieldName(memberName); + if (typeList) + type->setStruct(typeList); + TTypeLoc typeLoc = {type, loc}; + globalUniformBlock->getType().getWritableStruct()->push_back(typeLoc); + + // Insert into the symbol table. + if (firstNewMember == 0) { + // This is the first request; we need a normal symbol table insert + if (symbolTable.insert(*globalUniformBlock)) + trackLinkage(*globalUniformBlock); + else + error(loc, "failed to insert the global constant buffer", "uniform", ""); + } else { + // This is a follow-on request; we need to amend the first insert + symbolTable.amend(*globalUniformBlock, firstNewMember); + } + + ++firstNewMember; +} + +void TParseContextBase::growAtomicCounterBlock(int binding, const TSourceLoc& loc, TType& memberType, const TString& memberName, TTypeList* typeList) { + // Make the atomic counter block, if not yet made. + const auto &at = atomicCounterBuffers.find(binding); + if (at == atomicCounterBuffers.end()) { + atomicCounterBuffers.insert({binding, (TVariable*)nullptr }); + atomicCounterBlockFirstNewMember.insert({binding, 0}); + } + + TVariable*& atomicCounterBuffer = atomicCounterBuffers[binding]; + int& bufferNewMember = atomicCounterBlockFirstNewMember[binding]; + + if (atomicCounterBuffer == nullptr) { + TQualifier blockQualifier; + blockQualifier.clear(); + blockQualifier.storage = EvqBuffer; + + char charBuffer[512]; + if (binding != TQualifier::layoutBindingEnd) { + snprintf(charBuffer, 512, "%s_%d", getAtomicCounterBlockName(), binding); + } else { + snprintf(charBuffer, 512, "%s_0", getAtomicCounterBlockName()); + } + + TType blockType(new TTypeList, *NewPoolTString(charBuffer), blockQualifier); + setUniformBlockDefaults(blockType); + blockType.getQualifier().layoutPacking = ElpStd430; + atomicCounterBuffer = new TVariable(NewPoolTString(""), blockType, true); + // If we arn't auto mapping bindings then set the block to use the same + // binding as what the atomic was set to use + if (!intermediate.getAutoMapBindings()) { + atomicCounterBuffer->getWritableType().getQualifier().layoutBinding = binding; + } + bufferNewMember = 0; + + atomicCounterBuffer->getWritableType().getQualifier().layoutSet = atomicCounterBlockSet; + } + + // Add the requested member as a member to the global block. + TType* type = new TType; + type->shallowCopy(memberType); + type->setFieldName(memberName); + if (typeList) + type->setStruct(typeList); + TTypeLoc typeLoc = {type, loc}; + atomicCounterBuffer->getType().getWritableStruct()->push_back(typeLoc); + + // Insert into the symbol table. + if (bufferNewMember == 0) { + // This is the first request; we need a normal symbol table insert + if (symbolTable.insert(*atomicCounterBuffer)) + trackLinkage(*atomicCounterBuffer); + else + error(loc, "failed to insert the global constant buffer", "buffer", ""); + } else { + // This is a follow-on request; we need to amend the first insert + symbolTable.amend(*atomicCounterBuffer, bufferNewMember); + } + + ++bufferNewMember; +} + +void TParseContextBase::finish() +{ + if (parsingBuiltins) + return; + + for (const TString& relaxedSymbol : relaxedSymbols) + { + TSymbol* symbol = symbolTable.find(relaxedSymbol); + TType& type = symbol->getWritableType(); + for (const TTypeLoc& typeLoc : *type.getStruct()) + { + if (typeLoc.type->isOpaque()) + { + typeLoc.type->getSampler() = TSampler{}; + typeLoc.type->setBasicType(EbtInt); + TString fieldName("/*"); + fieldName.append(typeLoc.type->getFieldName()); + fieldName.append("*/"); + typeLoc.type->setFieldName(fieldName); + } + } + } + + // Transfer the linkage symbols to AST nodes, preserving order. + TIntermAggregate* linkage = new TIntermAggregate; + for (auto i = linkageSymbols.begin(); i != linkageSymbols.end(); ++i) + intermediate.addSymbolLinkageNode(linkage, **i); + intermediate.addSymbolLinkageNodes(linkage, getLanguage(), symbolTable); +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp new file mode 100644 index 0000000000..71aee4235f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -0,0 +1,11471 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2015 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. +// Copyright (C) 2017, 2019 ARM Limited. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +// Modifications Copyright (C) 2024 Ravi Prakash Singh. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "ParseHelper.h" +#include "Initialize.h" +#include "Scan.h" + +#include +#include + +#include "Versions.h" +#include "preprocessor/PpContext.h" + +namespace QtShaderTools { + +extern int yyparse(glslang::TParseContext*); + +namespace glslang { + +TParseContext::TParseContext(TSymbolTable& symbolTable, TIntermediate& interm, bool parsingBuiltins, + int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, + TInfoSink& infoSink, bool forwardCompatible, EShMessages messages, + const TString* entryPoint) : + TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language, + infoSink, forwardCompatible, messages, entryPoint), + inMain(false), + blockName(nullptr), + limits(resources.limits), + atomicUintOffsets(nullptr), anyIndexLimits(false) +{ + // decide whether precision qualifiers should be ignored or respected + if (isEsProfile() || spvVersion.vulkan > 0) { + precisionManager.respectPrecisionQualifiers(); + if (! parsingBuiltins && language == EShLangFragment && !isEsProfile() && spvVersion.vulkan > 0) + precisionManager.warnAboutDefaults(); + } + + setPrecisionDefaults(); + + globalUniformDefaults.clear(); + globalUniformDefaults.layoutMatrix = ElmColumnMajor; + globalUniformDefaults.layoutPacking = spvVersion.spv != 0 ? ElpStd140 : ElpShared; + + globalBufferDefaults.clear(); + globalBufferDefaults.layoutMatrix = ElmColumnMajor; + globalBufferDefaults.layoutPacking = spvVersion.spv != 0 ? ElpStd430 : ElpShared; + + globalInputDefaults.clear(); + globalOutputDefaults.clear(); + + globalSharedDefaults.clear(); + globalSharedDefaults.layoutMatrix = ElmColumnMajor; + globalSharedDefaults.layoutPacking = ElpStd430; + + // "Shaders in the transform + // feedback capturing mode have an initial global default of + // layout(xfb_buffer = 0) out;" + if (language == EShLangVertex || + language == EShLangTessControl || + language == EShLangTessEvaluation || + language == EShLangGeometry) + globalOutputDefaults.layoutXfbBuffer = 0; + + if (language == EShLangGeometry) + globalOutputDefaults.layoutStream = 0; + + if (entryPoint != nullptr && entryPoint->size() > 0 && *entryPoint != "main") + infoSink.info.message(EPrefixError, "Source entry point must be \"main\""); +} + +TParseContext::~TParseContext() +{ + delete [] atomicUintOffsets; +} + +// Set up all default precisions as needed by the current environment. +// Intended just as a TParseContext constructor helper. +void TParseContext::setPrecisionDefaults() +{ + // Set all precision defaults to EpqNone, which is correct for all types + // when not obeying precision qualifiers, and correct for types that don't + // have defaults (thus getting an error on use) when obeying precision + // qualifiers. + + for (int type = 0; type < EbtNumTypes; ++type) + defaultPrecision[type] = EpqNone; + + for (int type = 0; type < maxSamplerIndex; ++type) + defaultSamplerPrecision[type] = EpqNone; + + // replace with real precision defaults for those that have them + if (obeyPrecisionQualifiers()) { + if (isEsProfile()) { + // Most don't have defaults, a few default to lowp. + TSampler sampler; + sampler.set(EbtFloat, Esd2D); + defaultSamplerPrecision[computeSamplerTypeIndex(sampler)] = EpqLow; + sampler.set(EbtFloat, EsdCube); + defaultSamplerPrecision[computeSamplerTypeIndex(sampler)] = EpqLow; + sampler.set(EbtFloat, Esd2D); + sampler.setExternal(true); + defaultSamplerPrecision[computeSamplerTypeIndex(sampler)] = EpqLow; + } + + // If we are parsing built-in computational variables/functions, it is meaningful to record + // whether the built-in has no precision qualifier, as that ambiguity + // is used to resolve the precision from the supplied arguments/operands instead. + // So, we don't actually want to replace EpqNone with a default precision for built-ins. + if (! parsingBuiltins) { + if (isEsProfile() && language == EShLangFragment) { + defaultPrecision[EbtInt] = EpqMedium; + defaultPrecision[EbtUint] = EpqMedium; + } else { + defaultPrecision[EbtInt] = EpqHigh; + defaultPrecision[EbtUint] = EpqHigh; + defaultPrecision[EbtFloat] = EpqHigh; + } + + if (!isEsProfile()) { + // Non-ES profile + // All sampler precisions default to highp. + for (int type = 0; type < maxSamplerIndex; ++type) + defaultSamplerPrecision[type] = EpqHigh; + } + } + + defaultPrecision[EbtSampler] = EpqLow; + defaultPrecision[EbtAtomicUint] = EpqHigh; + } +} + +void TParseContext::setLimits(const TBuiltInResource& r) +{ + resources = r; + intermediate.setLimits(r); + + anyIndexLimits = ! limits.generalAttributeMatrixVectorIndexing || + ! limits.generalConstantMatrixVectorIndexing || + ! limits.generalSamplerIndexing || + ! limits.generalUniformIndexing || + ! limits.generalVariableIndexing || + ! limits.generalVaryingIndexing; + + + // "Each binding point tracks its own current default offset for + // inheritance of subsequent variables using the same binding. The initial state of compilation is that all + // binding points have an offset of 0." + atomicUintOffsets = new int[resources.maxAtomicCounterBindings]; + for (int b = 0; b < resources.maxAtomicCounterBindings; ++b) + atomicUintOffsets[b] = 0; +} + +// +// Parse an array of strings using yyparse, going through the +// preprocessor to tokenize the shader strings, then through +// the GLSL scanner. +// +// Returns true for successful acceptance of the shader, false if any errors. +// +bool TParseContext::parseShaderStrings(TPpContext& ppContext, TInputScanner& input, bool versionWillBeError) +{ + currentScanner = &input; + ppContext.setInput(input, versionWillBeError); + yyparse(this); + + finish(); + + return numErrors == 0; +} + +// This is called from bison when it has a parse (syntax) error +// Note though that to stop cascading errors, we set EOF, which +// will usually cause a syntax error, so be more accurate that +// compilation is terminating. +void TParseContext::parserError(const char* s) +{ + if (! getScanner()->atEndOfInput() || numErrors == 0) + error(getCurrentLoc(), "", "", s, ""); + else + error(getCurrentLoc(), "compilation terminated", "", ""); +} + +void TParseContext::growGlobalUniformBlock(const TSourceLoc& loc, TType& memberType, const TString& memberName, TTypeList* typeList) +{ + bool createBlock = globalUniformBlock == nullptr; + + if (createBlock) { + globalUniformBinding = intermediate.getGlobalUniformBinding(); + globalUniformSet = intermediate.getGlobalUniformSet(); + } + + // use base class function to create/expand block + TParseContextBase::growGlobalUniformBlock(loc, memberType, memberName, typeList); + + if (spvVersion.vulkan > 0 && spvVersion.vulkanRelaxed) { + // check for a block storage override + TBlockStorageClass storageOverride = intermediate.getBlockStorageOverride(getGlobalUniformBlockName()); + TQualifier& qualifier = globalUniformBlock->getWritableType().getQualifier(); + qualifier.defaultBlock = true; + + if (storageOverride != EbsNone) { + if (createBlock) { + // Remap block storage + qualifier.setBlockStorage(storageOverride); + + // check that the change didn't create errors + blockQualifierCheck(loc, qualifier, false); + } + + // remap meber storage as well + memberType.getQualifier().setBlockStorage(storageOverride); + } + } +} + +void TParseContext::growAtomicCounterBlock(int binding, const TSourceLoc& loc, TType& memberType, const TString& memberName, TTypeList* typeList) +{ + bool createBlock = atomicCounterBuffers.find(binding) == atomicCounterBuffers.end(); + + if (createBlock) { + atomicCounterBlockSet = intermediate.getAtomicCounterBlockSet(); + } + + // use base class function to create/expand block + TParseContextBase::growAtomicCounterBlock(binding, loc, memberType, memberName, typeList); + TQualifier& qualifier = atomicCounterBuffers[binding]->getWritableType().getQualifier(); + qualifier.defaultBlock = true; + + if (spvVersion.vulkan > 0 && spvVersion.vulkanRelaxed) { + // check for a Block storage override + TBlockStorageClass storageOverride = intermediate.getBlockStorageOverride(getAtomicCounterBlockName()); + + if (storageOverride != EbsNone) { + if (createBlock) { + // Remap block storage + + qualifier.setBlockStorage(storageOverride); + + // check that the change didn't create errors + blockQualifierCheck(loc, qualifier, false); + } + + // remap meber storage as well + memberType.getQualifier().setBlockStorage(storageOverride); + } + } +} + +const char* TParseContext::getGlobalUniformBlockName() const +{ + const char* name = intermediate.getGlobalUniformBlockName(); + if (std::string(name) == "") + return "gl_DefaultUniformBlock"; + else + return name; +} +void TParseContext::finalizeGlobalUniformBlockLayout(TVariable&) +{ +} +void TParseContext::setUniformBlockDefaults(TType& block) const +{ + block.getQualifier().layoutPacking = ElpStd140; + block.getQualifier().layoutMatrix = ElmColumnMajor; +} + + +const char* TParseContext::getAtomicCounterBlockName() const +{ + const char* name = intermediate.getAtomicCounterBlockName(); + if (std::string(name) == "") + return "gl_AtomicCounterBlock"; + else + return name; +} +void TParseContext::finalizeAtomicCounterBlockLayout(TVariable&) +{ +} + +void TParseContext::setAtomicCounterBlockDefaults(TType& block) const +{ + block.getQualifier().layoutPacking = ElpStd430; + block.getQualifier().layoutMatrix = ElmRowMajor; +} + +void TParseContext::setInvariant(const TSourceLoc& loc, const char* builtin) { + TSymbol* symbol = symbolTable.find(builtin); + if (symbol && symbol->getType().getQualifier().isPipeOutput()) { + if (intermediate.inIoAccessed(builtin)) + warn(loc, "changing qualification after use", "invariant", builtin); + TSymbol* csymbol = symbolTable.copyUp(symbol); + csymbol->getWritableType().getQualifier().invariant = true; + } +} + +void TParseContext::handlePragma(const TSourceLoc& loc, const TVector& tokens) +{ + if (pragmaCallback) + pragmaCallback(loc.line, tokens); + + if (tokens.size() == 0) + return; + + if (tokens[0].compare("optimize") == 0) { + if (tokens.size() != 4) { + error(loc, "optimize pragma syntax is incorrect", "#pragma", ""); + return; + } + + if (tokens[1].compare("(") != 0) { + error(loc, "\"(\" expected after 'optimize' keyword", "#pragma", ""); + return; + } + + if (tokens[2].compare("on") == 0) + contextPragma.optimize = true; + else if (tokens[2].compare("off") == 0) + contextPragma.optimize = false; + else { + if(relaxedErrors()) + // If an implementation does not recognize the tokens following #pragma, then it will ignore that pragma. + warn(loc, "\"on\" or \"off\" expected after '(' for 'optimize' pragma", "#pragma", ""); + return; + } + + if (tokens[3].compare(")") != 0) { + error(loc, "\")\" expected to end 'optimize' pragma", "#pragma", ""); + return; + } + } else if (tokens[0].compare("debug") == 0) { + if (tokens.size() != 4) { + error(loc, "debug pragma syntax is incorrect", "#pragma", ""); + return; + } + + if (tokens[1].compare("(") != 0) { + error(loc, "\"(\" expected after 'debug' keyword", "#pragma", ""); + return; + } + + if (tokens[2].compare("on") == 0) + contextPragma.debug = true; + else if (tokens[2].compare("off") == 0) + contextPragma.debug = false; + else { + if(relaxedErrors()) + // If an implementation does not recognize the tokens following #pragma, then it will ignore that pragma. + warn(loc, "\"on\" or \"off\" expected after '(' for 'debug' pragma", "#pragma", ""); + return; + } + + if (tokens[3].compare(")") != 0) { + error(loc, "\")\" expected to end 'debug' pragma", "#pragma", ""); + return; + } + } else if (spvVersion.spv > 0 && tokens[0].compare("use_storage_buffer") == 0) { + if (tokens.size() != 1) + error(loc, "extra tokens", "#pragma", ""); + intermediate.setUseStorageBuffer(); + } else if (spvVersion.spv > 0 && tokens[0].compare("use_vulkan_memory_model") == 0) { + if (tokens.size() != 1) + error(loc, "extra tokens", "#pragma", ""); + intermediate.setUseVulkanMemoryModel(); + } else if (spvVersion.spv > 0 && tokens[0].compare("use_variable_pointers") == 0) { + if (tokens.size() != 1) + error(loc, "extra tokens", "#pragma", ""); + if (spvVersion.spv < glslang::EShTargetSpv_1_3) + error(loc, "requires SPIR-V 1.3", "#pragma use_variable_pointers", ""); + intermediate.setUseVariablePointers(); + } else if (spvVersion.spv > 0 && tokens[0].compare("use_replicated_composites") == 0) { + if (tokens.size() != 1) + error(loc, "extra tokens", "#pragma", ""); + intermediate.setReplicatedComposites(); + } else if (spvVersion.spv > 0 && tokens[0].compare("promote_uint32_indices") == 0) { + if (tokens.size() != 1) + error(loc, "extra tokens", "#pragma", ""); + intermediate.setPromoteUint32Indices(); + } else if (spvVersion.spv > 0 && tokens[0].compare("shader_64bit_indexing") == 0) { + if (tokens.size() != 1) + error(loc, "extra tokens", "#pragma", ""); + intermediate.setShader64BitIndexing(); + } else if (tokens[0].compare("once") == 0) { + warn(loc, "not implemented", "#pragma once", ""); + } else if (tokens[0].compare("glslang_binary_double_output") == 0) { + intermediate.setBinaryDoubleOutput(); + } else if (spvVersion.spv > 0 && tokens[0].compare("STDGL") == 0 && + tokens[1].compare("invariant") == 0 && tokens[3].compare("all") == 0) { + intermediate.setInvariantAll(); + // Set all builtin out variables invariant if declared + setInvariant(loc, "gl_Position"); + setInvariant(loc, "gl_PointSize"); + setInvariant(loc, "gl_ClipDistance"); + setInvariant(loc, "gl_CullDistance"); + setInvariant(loc, "gl_TessLevelOuter"); + setInvariant(loc, "gl_TessLevelInner"); + setInvariant(loc, "gl_PrimitiveID"); + setInvariant(loc, "gl_Layer"); + setInvariant(loc, "gl_ViewportIndex"); + setInvariant(loc, "gl_FragDepth"); + setInvariant(loc, "gl_SampleMask"); + setInvariant(loc, "gl_ClipVertex"); + setInvariant(loc, "gl_FrontColor"); + setInvariant(loc, "gl_BackColor"); + setInvariant(loc, "gl_FrontSecondaryColor"); + setInvariant(loc, "gl_BackSecondaryColor"); + setInvariant(loc, "gl_TexCoord"); + setInvariant(loc, "gl_FogFragCoord"); + setInvariant(loc, "gl_FragColor"); + setInvariant(loc, "gl_FragData"); + } +} + +// +// Handle seeing a variable identifier in the grammar. +// +TIntermTyped* TParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symbol, const TString* string) +{ + TIntermTyped* node = nullptr; + + // Error check for requiring specific extensions present. + if (symbol && symbol->getNumExtensions()) + requireExtensions(loc, symbol->getNumExtensions(), symbol->getExtensions(), symbol->getName().c_str()); + + if (symbol && symbol->isReadOnly()) { + // All shared things containing an unsized array must be copied up + // on first use, so that all future references will share its array structure, + // so that editing the implicit size will effect all nodes consuming it, + // and so that editing the implicit size won't change the shared one. + // + // If this is a variable or a block, check it and all it contains, but if this + // is a member of an anonymous block, check the whole block, as the whole block + // will need to be copied up if it contains an unsized array. + // + // This check is being done before the block-name check further down, so guard + // for that too. + if (!symbol->getType().isUnusableName()) { + if (symbol->getType().containsUnsizedArray() || + (symbol->getAsAnonMember() && + symbol->getAsAnonMember()->getAnonContainer().getType().containsUnsizedArray())) + makeEditable(symbol); + } + } + + const TVariable* variable; + const TAnonMember* anon = symbol ? symbol->getAsAnonMember() : nullptr; + if (anon) { + // It was a member of an anonymous container. + + // Create a subtree for its dereference. + variable = anon->getAnonContainer().getAsVariable(); + TIntermTyped* container = intermediate.addSymbol(*variable, loc); + TIntermTyped* constNode = intermediate.addConstantUnion(anon->getMemberNumber(), loc); + node = intermediate.addIndex(EOpIndexDirectStruct, container, constNode, loc); + + node->setType(*(*variable->getType().getStruct())[anon->getMemberNumber()].type); + if (node->getType().hiddenMember()) + error(loc, "member of nameless block was not redeclared", string->c_str(), ""); + } else { + // Not a member of an anonymous container. + + // The symbol table search was done in the lexical phase. + // See if it was a variable. + variable = symbol ? symbol->getAsVariable() : nullptr; + if (variable) { + if (variable->getType().isUnusableName()) { + error(loc, "cannot be used (maybe an instance name is needed)", string->c_str(), ""); + variable = nullptr; + } + + if (language == EShLangMesh && variable) { + TLayoutGeometry primitiveType = intermediate.getOutputPrimitive(); + if ((variable->getMangledName() == "gl_PrimitiveTriangleIndicesEXT" && primitiveType != ElgTriangles) || + (variable->getMangledName() == "gl_PrimitiveLineIndicesEXT" && primitiveType != ElgLines) || + (variable->getMangledName() == "gl_PrimitivePointIndicesEXT" && primitiveType != ElgPoints)) { + error(loc, "cannot be used (output primitive type mismatch)", string->c_str(), ""); + variable = nullptr; + } + } + } else { + if (symbol) + error(loc, "variable name expected", string->c_str(), ""); + } + + // Recovery, if it wasn't found or was not a variable. + if (! variable) { + bool builtIn = false; + TVector candidateList; + symbolTable.findFunctionNameList(*string + "(", candidateList, builtIn); + + // If it's a function, pass the name/mangledName + if (!candidateList.empty() && !builtIn) { + variable = new TVariable(&candidateList[0]->getName(), &candidateList[0]->getMangledName(), TType(EbtFunction)); + } else { + variable = new TVariable(string, TType(EbtVoid)); + } + } + + if (variable->getType().getQualifier().isFrontEndConstant()) + node = intermediate.addConstantUnion(variable->getConstArray(), variable->getType(), loc); + else + node = intermediate.addSymbol(*variable, loc); + } + + if (variable->getType().getQualifier().isIo()) + intermediate.addIoAccessed(*string); + + if (variable->getType().isReference() && + variable->getType().getQualifier().bufferReferenceNeedsVulkanMemoryModel()) { + intermediate.setUseVulkanMemoryModel(); + } + + return node; +} + +// +// Handle seeing a base[index] dereference in the grammar. +// +TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIntermTyped* base, TIntermTyped* index) +{ + int64_t indexValue = 0; + if (index->getQualifier().isFrontEndConstant()) { + if (index->getType().contains64BitInt()) { + indexValue = index->getAsConstantUnion()->getConstArray()[0].getI64Const(); + } else if (index->getType().getBasicType() == EbtUint) { + indexValue = index->getAsConstantUnion()->getConstArray()[0].getUConst(); + } else { + indexValue = index->getAsConstantUnion()->getConstArray()[0].getIConst(); + } + } + // basic type checks... + variableCheck(base); + + if (! base->isArray() && ! base->isMatrix() && ! base->isVector() && ! base->getType().isCoopMat() && + ! base->isReference() && ! base->getType().isCoopVecNV()) { + if (base->getAsSymbolNode()) + error(loc, " left of '[' is not of type array, matrix, or vector ", base->getAsSymbolNode()->getName().c_str(), ""); + else + error(loc, " left of '[' is not of type array, matrix, or vector ", "expression", ""); + + // Insert dummy error-recovery result + return intermediate.addConstantUnion(0.0, EbtFloat, loc); + } + + if (!base->isArray() && base->isVector()) { + if (base->getType().contains16BitFloat()) + requireFloat16Arithmetic(loc, "[", "does not operate on types containing float16"); + if (base->getType().contains16BitInt()) + requireInt16Arithmetic(loc, "[", "does not operate on types containing (u)int16"); + if (base->getType().contains8BitInt()) + requireInt8Arithmetic(loc, "[", "does not operate on types containing (u)int8"); + } + + // check for constant folding + if (base->getType().getQualifier().isFrontEndConstant() && index->getQualifier().isFrontEndConstant()) { + // both base and index are front-end constants + checkIndex(loc, base->getType(), indexValue); + return intermediate.foldDereference(base, indexValue, loc); + } + + // at least one of base and index is not a front-end constant variable... + TIntermTyped* result = nullptr; + + if (base->isReference() && ! base->isArray()) { + requireExtensions(loc, 1, &E_GL_EXT_buffer_reference2, "buffer reference indexing"); + if (base->getType().getReferentType()->containsUnsizedArray()) { + error(loc, "cannot index reference to buffer containing an unsized array", "", ""); + result = nullptr; + } else { + result = intermediate.addBinaryMath(EOpAdd, base, index, loc); + if (result != nullptr) + result->setType(base->getType()); + } + if (result == nullptr) { + error(loc, "cannot index buffer reference", "", ""); + result = intermediate.addConstantUnion(0.0, EbtFloat, loc); + } + return result; + } + if (base->getAsSymbolNode() && isIoResizeArray(base->getType())) + handleIoResizeArrayAccess(loc, base); + + if (index->getQualifier().isFrontEndConstant()) + checkIndex(loc, base->getType(), indexValue); + + if (index->getQualifier().isFrontEndConstant()) { + if (base->getType().isUnsizedArray()) { + base->getWritableType().updateImplicitArraySize(indexValue + 1); + base->getWritableType().setImplicitlySized(true); + if (base->getQualifier().builtIn == EbvClipDistance && + indexValue >= resources.maxClipDistances) { + error(loc, "gl_ClipDistance", "[", "array index out of range '%d'", indexValue); + } + else if (base->getQualifier().builtIn == EbvCullDistance && + indexValue >= resources.maxCullDistances) { + error(loc, "gl_CullDistance", "[", "array index out of range '%d'", indexValue); + } + else if (base->getQualifier().builtIn == EbvSampleMask && + indexValue >= (resources.maxSamples + 31) / 32) { + error(loc, "gl_SampleMask", "[", "array index out of range '%d'", indexValue); + } + // For 2D per-view builtin arrays, update the inner dimension size in parent type + if (base->getQualifier().isPerView() && base->getQualifier().builtIn != EbvNone) { + TIntermBinary* binaryNode = base->getAsBinaryNode(); + if (binaryNode) { + TType& leftType = binaryNode->getLeft()->getWritableType(); + TArraySizes& arraySizes = *leftType.getArraySizes(); + assert(arraySizes.getNumDims() == 2); + assert(indexValue < std::numeric_limits::max()); + arraySizes.setDimSize(1, std::max(arraySizes.getDimSize(1), (int)indexValue + 1)); + } + } + } else + checkIndex(loc, base->getType(), indexValue); + result = intermediate.addIndex(EOpIndexDirect, base, index, loc); + } else { + if (base->getType().isUnsizedArray()) { + // we have a variable index into an unsized array, which is okay, + // depending on the situation + if (base->getAsSymbolNode() && isIoResizeArray(base->getType())) + error(loc, "", "[", "array must be sized by a redeclaration or layout qualifier before being indexed with a variable"); + else { + // it is okay for a run-time sized array + checkRuntimeSizable(loc, *base); + } + base->getWritableType().setArrayVariablyIndexed(); + } + if (base->getBasicType() == EbtBlock) { + if (base->getQualifier().storage == EvqBuffer) + requireProfile(base->getLoc(), ~EEsProfile, "variable indexing buffer block array"); + else if (base->getQualifier().storage == EvqUniform) { + profileRequires(base->getLoc(), EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, + "variable indexing uniform block array"); + profileRequires(base->getLoc(), ECoreProfile, 400, Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5, + "variable indexing uniform block array"); + + } + else { + // input/output blocks either don't exist or can't be variably indexed + } + } else if (language == EShLangFragment && base->getQualifier().isPipeOutput() && base->getQualifier().builtIn != EbvSampleMask) + requireProfile(base->getLoc(), ~EEsProfile, "variable indexing fragment shader output array"); + else if (base->getBasicType() == EbtSampler && version >= 130) { + const char* explanation = "variable indexing sampler array"; + requireProfile(base->getLoc(), EEsProfile | ECoreProfile | ECompatibilityProfile, explanation); + profileRequires(base->getLoc(), EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, explanation); + profileRequires(base->getLoc(), ECoreProfile | ECompatibilityProfile, 400, Num_AEP_core_gpu_shader5, + AEP_core_gpu_shader5, explanation); + } + + result = intermediate.addIndex(EOpIndexIndirect, base, index, loc); + } + + // Insert valid dereferenced result type + TType newType(base->getType(), 0); + if (base->getType().getQualifier().isConstant() && index->getQualifier().isConstant()) { + newType.getQualifier().storage = EvqConst; + // If base or index is a specialization constant, the result should also be a specialization constant. + if (base->getType().getQualifier().isSpecConstant() || index->getQualifier().isSpecConstant()) { + newType.getQualifier().makeSpecConstant(); + } + } else { + newType.getQualifier().storage = EvqTemporary; + newType.getQualifier().specConstant = false; + } + result->setType(newType); + + inheritMemoryQualifiers(base->getQualifier(), result->getWritableType().getQualifier()); + + // Propagate nonuniform + if (base->getQualifier().isNonUniform() || index->getQualifier().isNonUniform()) + result->getWritableType().getQualifier().nonUniform = true; + + if (anyIndexLimits) + handleIndexLimits(loc, base, index); + + return result; +} + +// for ES 2.0 (version 100) limitations for almost all index operations except vertex-shader uniforms +void TParseContext::handleIndexLimits(const TSourceLoc& /*loc*/, TIntermTyped* base, TIntermTyped* index) +{ + if ((! limits.generalSamplerIndexing && base->getBasicType() == EbtSampler) || + (! limits.generalUniformIndexing && base->getQualifier().isUniformOrBuffer() && language != EShLangVertex) || + (! limits.generalAttributeMatrixVectorIndexing && base->getQualifier().isPipeInput() && language == EShLangVertex && (base->getType().isMatrix() || base->getType().isVector())) || + (! limits.generalConstantMatrixVectorIndexing && base->getAsConstantUnion()) || + (! limits.generalVariableIndexing && ! base->getType().getQualifier().isUniformOrBuffer() && + ! base->getType().getQualifier().isPipeInput() && + ! base->getType().getQualifier().isPipeOutput() && + ! base->getType().getQualifier().isConstant()) || + (! limits.generalVaryingIndexing && (base->getType().getQualifier().isPipeInput() || + base->getType().getQualifier().isPipeOutput()))) { + // it's too early to know what the inductive variables are, save it for post processing + needsIndexLimitationChecking.push_back(index); + } +} + +// Make a shared symbol have a non-shared version that can be edited by the current +// compile, such that editing its type will not change the shared version and will +// effect all nodes sharing it. +void TParseContext::makeEditable(TSymbol*& symbol) +{ + TParseContextBase::makeEditable(symbol); + + // See if it's tied to IO resizing + if (isIoResizeArray(symbol->getType())) + ioArraySymbolResizeList.push_back(symbol); +} + +// Return true if this is a geometry shader input array or tessellation control output array +// or mesh shader output array. +bool TParseContext::isIoResizeArray(const TType& type) const +{ + return type.isArray() && + ((language == EShLangGeometry && type.getQualifier().storage == EvqVaryingIn) || + (language == EShLangTessControl && type.getQualifier().storage == EvqVaryingOut && + ! type.getQualifier().patch) || + (language == EShLangFragment && type.getQualifier().storage == EvqVaryingIn && + (type.getQualifier().pervertexNV || type.getQualifier().pervertexEXT)) || + (language == EShLangMesh && type.getQualifier().storage == EvqVaryingOut && + !type.getQualifier().perTaskNV)); +} + +// If an array is not isIoResizeArray() but is an io array, make sure it has the right size +void TParseContext::fixIoArraySize(const TSourceLoc& loc, TType& type) +{ + if (! type.isArray() || type.getQualifier().patch || symbolTable.atBuiltInLevel()) + return; + + assert(! isIoResizeArray(type)); + + if (type.getQualifier().storage != EvqVaryingIn || type.getQualifier().patch) + return; + + if (language == EShLangTessControl || language == EShLangTessEvaluation) { + if (type.getOuterArraySize() != resources.maxPatchVertices) { + if (type.isSizedArray()) + error(loc, "tessellation input array size must be gl_MaxPatchVertices or implicitly sized", "[]", ""); + type.changeOuterArraySize(resources.maxPatchVertices); + } + } +} + +// Issue any errors if the non-array object is missing arrayness WRT +// shader I/O that has array requirements. +// All arrayness checking is handled in array paths, this is for +void TParseContext::ioArrayCheck(const TSourceLoc& loc, const TType& type, const TString& identifier) +{ + if (! type.isArray() && ! symbolTable.atBuiltInLevel()) { + if (type.getQualifier().isArrayedIo(language) && !type.getQualifier().layoutPassthrough) + error(loc, "type must be an array:", type.getStorageQualifierString(), identifier.c_str()); + } +} + +// Handle a dereference of a geometry shader input array or tessellation control output array. +// See ioArraySymbolResizeList comment in ParseHelper.h. +// +void TParseContext::handleIoResizeArrayAccess(const TSourceLoc& /*loc*/, TIntermTyped* base) +{ + TIntermSymbol* symbolNode = base->getAsSymbolNode(); + assert(symbolNode); + if (! symbolNode) + return; + + // fix array size, if it can be fixed and needs to be fixed (will allow variable indexing) + if (symbolNode->getType().isUnsizedArray()) { + int newSize = getIoArrayImplicitSize(symbolNode->getType().getQualifier()); + if (newSize > 0) + symbolNode->getWritableType().changeOuterArraySize(newSize); + } +} + +// If there has been an input primitive declaration (geometry shader) or an output +// number of vertices declaration(tessellation shader), make sure all input array types +// match it in size. Types come either from nodes in the AST or symbols in the +// symbol table. +// +// Types without an array size will be given one. +// Types already having a size that is wrong will get an error. +// +void TParseContext::checkIoArraysConsistency(const TSourceLoc &loc, bool tailOnly) +{ + int requiredSize = 0; + TString featureString; + size_t listSize = ioArraySymbolResizeList.size(); + size_t i = 0; + + // If tailOnly = true, only check the last array symbol in the list. + if (tailOnly) { + i = listSize - 1; + } + for (bool firstIteration = true; i < listSize; ++i) { + TType &type = ioArraySymbolResizeList[i]->getWritableType(); + + // As I/O array sizes don't change, fetch requiredSize only once, + // except for mesh shaders which could have different I/O array sizes based on type qualifiers. + if (firstIteration || (language == EShLangMesh)) { + requiredSize = getIoArrayImplicitSize(type.getQualifier(), &featureString); + if (requiredSize == 0) + break; + firstIteration = false; + } + + checkIoArrayConsistency(loc, requiredSize, featureString.c_str(), type, + ioArraySymbolResizeList[i]->getName()); + } +} + +int TParseContext::getIoArrayImplicitSize(const TQualifier &qualifier, TString *featureString) const +{ + int expectedSize = 0; + TString str = "unknown"; + unsigned int maxVertices = intermediate.getVertices() != TQualifier::layoutNotSet ? intermediate.getVertices() : 0; + + if (language == EShLangGeometry) { + expectedSize = TQualifier::mapGeometryToSize(intermediate.getInputPrimitive()); + str = TQualifier::getGeometryString(intermediate.getInputPrimitive()); + } + else if (language == EShLangTessControl) { + expectedSize = maxVertices; + str = "vertices"; + } else if (language == EShLangFragment) { + // Number of vertices for Fragment shader is always three. + expectedSize = 3; + str = "vertices"; + } else if (language == EShLangMesh) { + unsigned int maxPrimitives = + intermediate.getPrimitives() != TQualifier::layoutNotSet ? intermediate.getPrimitives() : 0; + if (qualifier.builtIn == EbvPrimitiveIndicesNV) { + expectedSize = maxPrimitives * TQualifier::mapGeometryToSize(intermediate.getOutputPrimitive()); + str = "max_primitives*"; + str += TQualifier::getGeometryString(intermediate.getOutputPrimitive()); + } + else if (qualifier.builtIn == EbvPrimitiveTriangleIndicesEXT || qualifier.builtIn == EbvPrimitiveLineIndicesEXT || + qualifier.builtIn == EbvPrimitivePointIndicesEXT) { + expectedSize = maxPrimitives; + str = "max_primitives"; + } + else if (qualifier.isPerPrimitive()) { + expectedSize = maxPrimitives; + str = "max_primitives"; + } + else { + expectedSize = maxVertices; + str = "max_vertices"; + } + } + if (featureString) + *featureString = str; + return expectedSize; +} + +void TParseContext::checkIoArrayConsistency(const TSourceLoc& loc, int requiredSize, const char* feature, TType& type, const TString& name) +{ + if (type.isUnsizedArray()) + type.changeOuterArraySize(requiredSize); + else if (type.getOuterArraySize() != requiredSize) { + if (language == EShLangGeometry) + error(loc, "inconsistent input primitive for array size of", feature, name.c_str()); + else if (language == EShLangTessControl) + error(loc, "inconsistent output number of vertices for array size of", feature, name.c_str()); + else if (language == EShLangFragment) { + if (type.getOuterArraySize() > requiredSize) + error(loc, " cannot be greater than 3 for pervertexEXT", feature, name.c_str()); + } + else if (language == EShLangMesh) + error(loc, "inconsistent output array size of", feature, name.c_str()); + else + assert(0); + } +} + +// Handle seeing a binary node with a math operation. +// Returns nullptr if not semantically allowed. +TIntermTyped* TParseContext::handleBinaryMath(const TSourceLoc& loc, const char* str, TOperator op, TIntermTyped* left, TIntermTyped* right) +{ + rValueErrorCheck(loc, str, left->getAsTyped()); + rValueErrorCheck(loc, str, right->getAsTyped()); + + bool allowed = true; + switch (op) { + // TODO: Bring more source language-specific checks up from intermediate.cpp + // to the specific parse helpers for that source language. + case EOpLessThan: + case EOpGreaterThan: + case EOpLessThanEqual: + case EOpGreaterThanEqual: + if (! left->isScalar() || ! right->isScalar()) + allowed = false; + break; + default: + break; + } + + if (((left->getType().contains16BitFloat() || right->getType().contains16BitFloat()) && !float16Arithmetic()) || + ((left->getType().contains16BitInt() || right->getType().contains16BitInt()) && !int16Arithmetic()) || + ((left->getType().contains8BitInt() || right->getType().contains8BitInt()) && !int8Arithmetic()) || + (left->getType().containsBFloat16() || right->getType().containsBFloat16()) || + (left->getType().contains8BitFloat() || right->getType().contains8BitFloat())) { + allowed = false; + } + + TIntermTyped* result = nullptr; + if (allowed) { + if ((left->isReference() || right->isReference())) + requireExtensions(loc, 1, &E_GL_EXT_buffer_reference2, "buffer reference math"); + result = intermediate.addBinaryMath(op, left, right, loc); + } + + if (result == nullptr) { + bool enhanced = intermediate.getEnhancedMsgs(); + binaryOpError(loc, str, left->getCompleteString(enhanced), right->getCompleteString(enhanced)); + } + + return result; +} + +// Handle seeing a unary node with a math operation. +TIntermTyped* TParseContext::handleUnaryMath(const TSourceLoc& loc, const char* str, TOperator op, TIntermTyped* childNode) +{ + rValueErrorCheck(loc, str, childNode); + + bool allowed = true; + if ((childNode->getType().contains16BitFloat() && !float16Arithmetic()) || + (childNode->getType().contains16BitInt() && !int16Arithmetic()) || + (childNode->getType().contains8BitInt() && !int8Arithmetic()) || + (childNode->getType().containsBFloat16()) || + (childNode->getType().contains8BitFloat())) { + allowed = false; + } + + TIntermTyped* result = nullptr; + if (allowed) + result = intermediate.addUnaryMath(op, childNode, loc); + + if (result) + return result; + else { + bool enhanced = intermediate.getEnhancedMsgs(); + unaryOpError(loc, str, childNode->getCompleteString(enhanced)); + } + + return childNode; +} + +// +// Handle seeing a base.field dereference in the grammar. +// +TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TIntermTyped* base, const TString& field) +{ + variableCheck(base); + + // + // .length() can't be resolved until we later see the function-calling syntax. + // Save away the name in the AST for now. Processing is completed in + // handleLengthMethod(). + // + if (field == "length" || field == "length64") { + if (base->isArray()) { + profileRequires(loc, ENoProfile, 120, E_GL_3DL_array_objects, (TString(".") + field).c_str()); + profileRequires(loc, EEsProfile, 300, nullptr, (TString(".") + field).c_str()); + } else if (base->isVector() || base->isMatrix()) { + const char* feature = ".length() on vectors and matrices"; + requireProfile(loc, ~EEsProfile, feature); + profileRequires(loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, feature); + } else if (!base->getType().isCoopMat() && !base->getType().isCoopVecNV()) { + bool enhanced = intermediate.getEnhancedMsgs(); + error(loc, "does not operate on this type:", field.c_str(), base->getType().getCompleteString(enhanced).c_str()); + return base; + } + + if (field == "length") { + return intermediate.addMethod(base, TType(EbtInt), &field, loc); + } else { + requireExtensions(loc, 1, &E_GL_EXT_shader_64bit_indexing, "length64"); + return intermediate.addMethod(base, TType(EbtInt64), &field, loc); + } + } + + // It's not .length() if we get to here. + + if (base->isArray()) { + error(loc, "cannot apply to an array:", ".", field.c_str()); + + return base; + } + + if (base->getType().isCoopMat()) { + error(loc, "cannot apply to a cooperative matrix type:", ".", field.c_str()); + return base; + } + + // It's neither an array nor .length() if we get here, + // leaving swizzles and struct/block dereferences. + + TIntermTyped* result = base; + if ((base->isVector() || base->isScalar()) && + (base->isFloatingDomain() || base->isIntegerDomain() || base->getBasicType() == EbtBool)) { + result = handleDotSwizzle(loc, base, field); + } else if (base->isStruct() || base->isReference()) { + const TTypeList* fields = base->isReference() ? + base->getType().getReferentType()->getStruct() : + base->getType().getStruct(); + bool fieldFound = false; + int member; + for (member = 0; member < (int)fields->size(); ++member) { + if ((*fields)[member].type->getFieldName() == field) { + fieldFound = true; + break; + } + } + + if (fieldFound) { + if (spvVersion.vulkan != 0 && spvVersion.vulkanRelaxed) + result = vkRelaxedRemapDotDereference(loc, *base, *(*fields)[member].type, field); + + if (result == base) + { + if (base->getType().getQualifier().isFrontEndConstant()) + result = intermediate.foldDereference(base, member, loc); + else { + blockMemberExtensionCheck(loc, base, member, field); + TIntermTyped* index = intermediate.addConstantUnion(member, loc); + result = intermediate.addIndex(EOpIndexDirectStruct, base, index, loc); + result->setType(*(*fields)[member].type); + if ((*fields)[member].type->getQualifier().isIo()) + intermediate.addIoAccessed(field); + } + } + + inheritMemoryQualifiers(base->getQualifier(), result->getWritableType().getQualifier()); + } else { + auto baseSymbol = base; + while (baseSymbol->getAsSymbolNode() == nullptr) { + auto binaryNode = baseSymbol->getAsBinaryNode(); + if (binaryNode == nullptr) break; + baseSymbol = binaryNode->getLeft(); + } + if (baseSymbol->getAsSymbolNode() != nullptr) { + TString structName; + structName.append("\'").append(baseSymbol->getAsSymbolNode()->getName().c_str()).append("\'"); + error(loc, "no such field in structure", field.c_str(), structName.c_str()); + } else { + error(loc, "no such field in structure", field.c_str(), ""); + } + } + } else + error(loc, "does not apply to this type:", field.c_str(), + base->getType().getCompleteString(intermediate.getEnhancedMsgs()).c_str()); + + // Propagate noContraction up the dereference chain + if (base->getQualifier().isNoContraction()) + result->getWritableType().getQualifier().setNoContraction(); + + // Propagate nonuniform + if (base->getQualifier().isNonUniform()) + result->getWritableType().getQualifier().nonUniform = true; + + return result; +} + +// +// Handle seeing a base.swizzle, a subset of base.identifier in the grammar. +// +TIntermTyped* TParseContext::handleDotSwizzle(const TSourceLoc& loc, TIntermTyped* base, const TString& field) +{ + TIntermTyped* result = base; + if (base->isScalar()) { + const char* dotFeature = "scalar swizzle"; + requireProfile(loc, ~EEsProfile, dotFeature); + profileRequires(loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, dotFeature); + } + + TSwizzleSelectors selectors; + parseSwizzleSelector(loc, field, base->getVectorSize(), selectors); + + if (base->isVector() && selectors.size() != 1 && base->getType().contains16BitFloat()) + requireFloat16Arithmetic(loc, ".", "can't swizzle types containing float16"); + if (base->isVector() && selectors.size() != 1 && base->getType().contains16BitInt()) + requireInt16Arithmetic(loc, ".", "can't swizzle types containing (u)int16"); + if (base->isVector() && selectors.size() != 1 && base->getType().contains8BitInt()) + requireInt8Arithmetic(loc, ".", "can't swizzle types containing (u)int8"); + + if (base->isScalar()) { + if (selectors.size() == 1) + return result; + else { + TType type(base->getBasicType(), EvqTemporary, selectors.size()); + // Swizzle operations propagate specialization-constantness + if (base->getQualifier().isSpecConstant()) + type.getQualifier().makeSpecConstant(); + return addConstructor(loc, base, type); + } + } + + if (base->getType().getQualifier().isFrontEndConstant()) + result = intermediate.foldSwizzle(base, selectors, loc); + else { + if (selectors.size() == 1) { + TIntermTyped* index = intermediate.addConstantUnion(selectors[0], loc); + result = intermediate.addIndex(EOpIndexDirect, base, index, loc); + result->setType(TType(base->getBasicType(), EvqTemporary, base->getType().getQualifier().precision)); + } else { + TIntermTyped* index = intermediate.addSwizzle(selectors, loc); + result = intermediate.addIndex(EOpVectorSwizzle, base, index, loc); + result->setType(TType(base->getBasicType(), EvqTemporary, base->getType().getQualifier().precision, selectors.size())); + } + // Swizzle operations propagate specialization-constantness + if (base->getType().getQualifier().isSpecConstant()) + result->getWritableType().getQualifier().makeSpecConstant(); + } + + return result; +} + +void TParseContext::blockMemberExtensionCheck(const TSourceLoc& loc, const TIntermTyped* base, int member, const TString& memberName) +{ + // a block that needs extension checking is either 'base', or if arrayed, + // one level removed to the left + const TIntermSymbol* baseSymbol = nullptr; + if (base->getAsBinaryNode() == nullptr) + baseSymbol = base->getAsSymbolNode(); + else + baseSymbol = base->getAsBinaryNode()->getLeft()->getAsSymbolNode(); + if (baseSymbol == nullptr) + return; + const TSymbol* symbol = symbolTable.find(baseSymbol->getName()); + if (symbol == nullptr) + return; + const TVariable* variable = symbol->getAsVariable(); + if (variable == nullptr) + return; + if (!variable->hasMemberExtensions()) + return; + + // We now have a variable that is the base of a dot reference + // with members that need extension checking. + if (variable->getNumMemberExtensions(member) > 0) + requireExtensions(loc, variable->getNumMemberExtensions(member), variable->getMemberExtensions(member), memberName.c_str()); +} + +// +// Handle seeing a function declarator in the grammar. This is the precursor +// to recognizing a function prototype or function definition. +// +TFunction* TParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFunction& function, bool prototype) +{ + // ES can't declare prototypes inside functions + if (! symbolTable.atGlobalLevel()) + requireProfile(loc, ~EEsProfile, "local function declaration"); + + // + // Multiple declarations of the same function name are allowed. + // + // If this is a definition, the definition production code will check for redefinitions + // (we don't know at this point if it's a definition or not). + // + // Redeclarations (full signature match) are allowed. But, return types and parameter qualifiers must also match. + // - except ES 100, which only allows a single prototype + // + // ES 100 does not allow redefining, but does allow overloading of built-in functions. + // ES 300 does not allow redefining or overloading of built-in functions. + // + bool builtIn; + TSymbol* symbol = symbolTable.find(function.getMangledName(), &builtIn); + if (symbol && symbol->getAsFunction() && builtIn) + requireProfile(loc, ~EEsProfile, "redefinition of built-in function"); + // Check the validity of using spirv_literal qualifier + for (int i = 0; i < function.getParamCount(); ++i) { + if (function[i].type->getQualifier().isSpirvLiteral() && function.getBuiltInOp() != EOpSpirvInst) + error(loc, "'spirv_literal' can only be used on functions defined with 'spirv_instruction' for argument", + function.getName().c_str(), "%d", i + 1); + } + + // For function declaration with SPIR-V instruction qualifier, always ignore the built-in function and + // respect this redeclared one. + if (symbol && builtIn && function.getBuiltInOp() == EOpSpirvInst) + symbol = nullptr; + const TFunction* prevDec = symbol ? symbol->getAsFunction() : nullptr; + if (prevDec) { + if (prevDec->isPrototyped() && prototype) + profileRequires(loc, EEsProfile, 300, nullptr, "multiple prototypes for same function"); + if (prevDec->getSpirvInstruction() != function.getSpirvInstruction()) { + error(loc, "overloaded functions must have the same qualifiers", function.getName().c_str(), + "spirv_instruction"); + } + bool parameterTypesDiffer = false; + for (int i = 0; i < prevDec->getParamCount(); ++i) { + if ((*prevDec)[i].type->getQualifier().storage != function[i].type->getQualifier().storage) + error(loc, "overloaded functions must have the same parameter storage qualifiers for argument", function[i].type->getStorageQualifierString(), "%d", i+1); + + if ((*prevDec)[i].type->getQualifier().precision != function[i].type->getQualifier().precision) + error(loc, "overloaded functions must have the same parameter precision qualifiers for argument", function[i].type->getPrecisionQualifierString(), "%d", i+1); + + if (*(*prevDec)[i].type != *function[i].type) + parameterTypesDiffer = true; + } + if (!parameterTypesDiffer && prevDec->getType() != function.getType()) + error(loc, "overloaded functions must have the same return type", function.getName().c_str(), ""); + } + + arrayObjectCheck(loc, function.getType(), "array in function return type"); + + if (prototype) { + // All built-in functions are defined, even though they don't have a body. + // Count their prototype as a definition instead. + if (symbolTable.atBuiltInLevel()) + function.setDefined(); + else { + if (prevDec && ! builtIn) + symbol->getAsFunction()->setPrototyped(); // need a writable one, but like having prevDec as a const + function.setPrototyped(); + } + } + + // This insert won't actually insert it if it's a duplicate signature, but it will still check for + // other forms of name collisions. + if (! symbolTable.insert(function)) + error(loc, "function name is redeclaration of existing name", function.getName().c_str(), ""); + + // + // If this is a redeclaration, it could also be a definition, + // in which case, we need to use the parameter names from this one, and not the one that's + // being redeclared. So, pass back this declaration, not the one in the symbol table. + // + return &function; +} + +// +// Handle seeing the function prototype in front of a function definition in the grammar. +// The body is handled after this function returns. +// +TIntermAggregate* TParseContext::handleFunctionDefinition(const TSourceLoc& loc, TFunction& function) +{ + currentCaller = function.getMangledName(); + TSymbol* symbol = symbolTable.find(function.getMangledName()); + TFunction* prevDec = symbol ? symbol->getAsFunction() : nullptr; + + if (! prevDec) + error(loc, "can't find function", function.getName().c_str(), ""); + // Note: 'prevDec' could be 'function' if this is the first time we've seen function + // as it would have just been put in the symbol table. Otherwise, we're looking up + // an earlier occurrence. + + if (prevDec && prevDec->isDefined()) { + // Then this function already has a body. + error(loc, "function already has a body", function.getName().c_str(), ""); + } + if (prevDec && ! prevDec->isDefined()) { + prevDec->setDefined(); + + // Remember the return type for later checking for RETURN statements. + currentFunctionType = &(prevDec->getType()); + } else + currentFunctionType = new TType(EbtVoid); + functionReturnsValue = false; + + // Check for entry point + if (function.getName().compare(intermediate.getEntryPointName().c_str()) == 0) { + intermediate.setEntryPointMangledName(function.getMangledName().c_str()); + intermediate.incrementEntryPointCount(); + inMain = true; + } else + inMain = false; + + // + // Raise error message if main function takes any parameters or returns anything other than void + // + if (inMain) { + if (function.getParamCount() > 0) + error(loc, "function cannot take any parameter(s)", function.getName().c_str(), ""); + if (function.getType().getBasicType() != EbtVoid) + error(loc, "", function.getType().getBasicTypeString().c_str(), "entry point cannot return a value"); + if (function.getLinkType() != ELinkNone) + error(loc, "main function cannot be exported", "", ""); + } + + // + // New symbol table scope for body of function plus its arguments + // + symbolTable.push(); + + // + // Insert parameters into the symbol table. + // If the parameter has no name, it's not an error, just don't insert it + // (could be used for unused args). + // + // Also, accumulate the list of parameters into the HIL, so lower level code + // knows where to find parameters. + // + TIntermAggregate* paramNodes = new TIntermAggregate; + for (int i = 0; i < function.getParamCount(); i++) { + TParameter& param = function[i]; + if (param.name != nullptr) { + TVariable *variable = new TVariable(param.name, *param.type); + + // Insert the parameters with name in the symbol table. + if (! symbolTable.insert(*variable)) + error(loc, "redefinition", variable->getName().c_str(), ""); + else { + // Transfer ownership of name pointer to symbol table. + param.name = nullptr; + + // Add the parameter to the HIL + paramNodes = intermediate.growAggregate(paramNodes, + intermediate.addSymbol(*variable, loc), + loc); + } + } else + paramNodes = intermediate.growAggregate(paramNodes, intermediate.addSymbol(*param.type, loc), loc); + } + paramNodes->setLinkType(function.getLinkType()); + intermediate.setAggregateOperator(paramNodes, EOpParameters, TType(EbtVoid), loc); + loopNestingLevel = 0; + statementNestingLevel = 0; + controlFlowNestingLevel = 0; + postEntryPointReturn = false; + + return paramNodes; +} + +// +// Handle seeing function call syntax in the grammar, which could be any of +// - .length() method +// - constructor +// - a call to a built-in function mapped to an operator +// - a call to a built-in function that will remain a function call (e.g., texturing) +// - user function +// - subroutine call (not implemented yet) +// +TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction* function, TIntermNode* arguments) +{ + TIntermTyped* result = nullptr; + + if (spvVersion.vulkan != 0 && spvVersion.vulkanRelaxed) { + // allow calls that are invalid in Vulkan Semantics to be invisibily + // remapped to equivalent valid functions + result = vkRelaxedRemapFunctionCall(loc, function, arguments); + if (result) + return result; + } + + if (function->getBuiltInOp() == EOpArrayLength) + result = handleLengthMethod(loc, function, arguments); + else if (function->getBuiltInOp() != EOpNull) { + // + // Then this should be a constructor. + // Don't go through the symbol table for constructors. + // Their parameters will be verified algorithmically. + // + TType type(EbtVoid); // use this to get the type back + if (! constructorError(loc, arguments, *function, function->getBuiltInOp(), type)) { + // + // It's a constructor, of type 'type'. + // + result = addConstructor(loc, arguments, type); + if (result == nullptr) + error(loc, "cannot construct with these arguments", type.getCompleteString(intermediate.getEnhancedMsgs()).c_str(), ""); + } + } else { + // + // Find it in the symbol table. + // + const TFunction* fnCandidate; + bool builtIn {false}; + fnCandidate = findFunction(loc, *function, builtIn); + if (fnCandidate) { + // This is a declared function that might map to + // - a built-in operator, + // - a built-in function not mapped to an operator, or + // - a user function. + + // Error check for a function requiring specific extensions present. + if (builtIn && + (fnCandidate->getBuiltInOp() == EOpSubgroupQuadAll || fnCandidate->getBuiltInOp() == EOpSubgroupQuadAny)) + requireExtensions(loc, 1, &E_GL_EXT_shader_quad_control, fnCandidate->getName().c_str()); + + if (builtIn && fnCandidate->getNumExtensions()) + requireExtensions(loc, fnCandidate->getNumExtensions(), fnCandidate->getExtensions(), fnCandidate->getName().c_str()); + + if (builtIn && fnCandidate->getType().contains16BitFloat()) + requireFloat16Arithmetic(loc, "built-in function", "float16 types can only be in uniform block or buffer storage"); + if (builtIn && fnCandidate->getType().contains16BitInt()) + requireInt16Arithmetic(loc, "built-in function", "(u)int16 types can only be in uniform block or buffer storage"); + if (builtIn && fnCandidate->getType().contains8BitInt()) + requireInt8Arithmetic(loc, "built-in function", "(u)int8 types can only be in uniform block or buffer storage"); + if (builtIn && (fnCandidate->getBuiltInOp() == EOpTextureFetch || fnCandidate->getBuiltInOp() == EOpTextureQuerySize)) { + if ((*fnCandidate)[0].type->getSampler().isMultiSample() && version <= 140) + requireExtensions(loc, 1, &E_GL_ARB_texture_multisample, fnCandidate->getName().c_str()); + } + if (arguments != nullptr) { + // Make sure qualifications work for these arguments. + TIntermAggregate* aggregate = arguments->getAsAggregate(); + for (int i = 0; i < fnCandidate->getParamCount(); ++i) { + // At this early point there is a slight ambiguity between whether an aggregate 'arguments' + // is the single argument itself or its children are the arguments. Only one argument + // means take 'arguments' itself as the one argument. + if ((*fnCandidate)[i].defaultValue) { + if (!aggregate) { + // Only one argument was passed (rest are default arguments) so arguments isn't a TIntermAggregate. + // But the function takes at least one more argument, so a TIntermAggregate is needed. + aggregate = new TIntermAggregate; + aggregate->getSequence().push_back(arguments); + arguments = aggregate; + } + if (i >= static_cast(aggregate->getSequence().size())) { + // Append the default value if there are no more arguments left in the aggregate. + TIntermConstantUnion *defaultValue = nullptr; + if (const auto *constUnion = (*fnCandidate)[i].defaultValue->getAsConstantUnion()) { + defaultValue = new TIntermConstantUnion(constUnion->getConstArray(), constUnion->getType()); + } + assert(defaultValue && "unsupported default value construct"); + aggregate->getSequence().push_back(defaultValue); + } + } + TIntermNode* arg = fnCandidate->getParamCount() == 1 ? arguments : (aggregate ? aggregate->getSequence()[i] : arguments); + TQualifier& formalQualifier = (*fnCandidate)[i].type->getQualifier(); + if (formalQualifier.isParamOutput()) { + if (lValueErrorCheck(arguments->getLoc(), "assign", arg->getAsTyped())) + error(arguments->getLoc(), "Non-L-value cannot be passed for 'out' or 'inout' parameters.", "out", ""); + } + if (formalQualifier.isSpirvLiteral()) { + if (!arg->getAsTyped()->getQualifier().isFrontEndConstant()) { + error(arguments->getLoc(), + "Non front-end constant expressions cannot be passed for 'spirv_literal' parameters.", + "spirv_literal", ""); + } + } + const TType& argType = arg->getAsTyped()->getType(); + const TQualifier& argQualifier = argType.getQualifier(); + bool containsBindlessSampler = intermediate.getBindlessMode() && argType.containsSampler(); + if (argQualifier.isMemory() && !containsBindlessSampler && (argType.containsOpaque() || argType.isReference())) { + const char* message = "argument cannot drop memory qualifier when passed to formal parameter"; + if (argQualifier.volatil && ! formalQualifier.volatil) + error(arguments->getLoc(), message, "volatile", ""); + if (argQualifier.coherent && ! (formalQualifier.devicecoherent || formalQualifier.coherent)) + error(arguments->getLoc(), message, "coherent", ""); + if (argQualifier.devicecoherent && ! (formalQualifier.devicecoherent || formalQualifier.coherent)) + error(arguments->getLoc(), message, "devicecoherent", ""); + if (argQualifier.queuefamilycoherent && ! (formalQualifier.queuefamilycoherent || formalQualifier.devicecoherent || formalQualifier.coherent)) + error(arguments->getLoc(), message, "queuefamilycoherent", ""); + if (argQualifier.workgroupcoherent && ! (formalQualifier.workgroupcoherent || formalQualifier.queuefamilycoherent || formalQualifier.devicecoherent || formalQualifier.coherent)) + error(arguments->getLoc(), message, "workgroupcoherent", ""); + if (argQualifier.subgroupcoherent && ! (formalQualifier.subgroupcoherent || formalQualifier.workgroupcoherent || formalQualifier.queuefamilycoherent || formalQualifier.devicecoherent || formalQualifier.coherent)) + error(arguments->getLoc(), message, "subgroupcoherent", ""); + if (argQualifier.readonly && ! formalQualifier.readonly) + error(arguments->getLoc(), message, "readonly", ""); + if (argQualifier.writeonly && ! formalQualifier.writeonly) + error(arguments->getLoc(), message, "writeonly", ""); + if (argQualifier.nontemporal && ! formalQualifier.nontemporal) + error(arguments->getLoc(), message, "nontemporal", ""); + // Don't check 'restrict', it is different than the rest: + // "...but only restrict can be taken away from a calling argument, by a formal parameter that + // lacks the restrict qualifier..." + } + if (!builtIn && argQualifier.getFormat() != formalQualifier.getFormat()) { + // we have mismatched formats, which should only be allowed if writeonly + // and at least one format is unknown + if (!formalQualifier.isWriteOnly() || (formalQualifier.getFormat() != ElfNone && + argQualifier.getFormat() != ElfNone)) + error(arguments->getLoc(), "image formats must match", "format", ""); + } + if (builtIn && arg->getAsTyped()->getType().contains16BitFloat()) + requireFloat16Arithmetic(arguments->getLoc(), "built-in function", "float16 types can only be in uniform block or buffer storage"); + if (builtIn && arg->getAsTyped()->getType().contains16BitInt()) + requireInt16Arithmetic(arguments->getLoc(), "built-in function", "(u)int16 types can only be in uniform block or buffer storage"); + if (builtIn && arg->getAsTyped()->getType().contains8BitInt()) + requireInt8Arithmetic(arguments->getLoc(), "built-in function", "(u)int8 types can only be in uniform block or buffer storage"); + + // Check that coopVecOuterProductAccumulateNV vector component types match + if (builtIn && fnCandidate->getBuiltInOp() == EOpCooperativeVectorOuterProductAccumulateNV && + i == 1 && arg->getAsTyped()->getType().getBasicType() != aggregate->getSequence()[0]->getAsTyped()->getType().getBasicType()) + error(arguments->getLoc(), "cooperative vector basic types must match", fnCandidate->getName().c_str(), ""); + + // Check that coopVecLoadNV and coopVecStoreNV buffer parameter is in buffer or shared storage + if (builtIn && (fnCandidate->getBuiltInOp() == EOpCooperativeVectorLoadNV || + fnCandidate->getBuiltInOp() == EOpCooperativeVectorStoreNV) && + i == 1) { + TStorageQualifier storage = arg->getAsTyped()->getType().getQualifier().storage; + if (storage != EvqBuffer && storage != EvqShared) { + error(arguments->getLoc(), "buffer argument must be in buffer or shared storage", + fnCandidate->getName().c_str(), ""); + } + } + + // TODO 4.5 functionality: A shader will fail to compile + // if the value passed to the memargument of an atomic memory function does not correspond to a buffer or + // shared variable. It is acceptable to pass an element of an array or a single component of a vector to the + // memargument of an atomic memory function, as long as the underlying array or vector is a buffer or + // shared variable. + } + + // Convert 'in' arguments + addInputArgumentConversions(*fnCandidate, arguments); // arguments may be modified if it's just a single argument node + } + + if (builtIn && fnCandidate->getBuiltInOp() != EOpNull) { + // A function call mapped to a built-in operation. + result = handleBuiltInFunctionCall(loc, arguments, *fnCandidate); + } else if (fnCandidate->getBuiltInOp() == EOpSpirvInst) { + // When SPIR-V instruction qualifier is specified, the function call is still mapped to a built-in operation. + result = handleBuiltInFunctionCall(loc, arguments, *fnCandidate); + } else { + // This is a function call not mapped to built-in operator. + // It could still be a built-in function, but only if PureOperatorBuiltins == false. + result = intermediate.setAggregateOperator(arguments, EOpFunctionCall, fnCandidate->getType(), loc); + TIntermAggregate* call = result->getAsAggregate(); + call->setName(fnCandidate->getMangledName()); + + // this is how we know whether the given function is a built-in function or a user-defined function + // if builtIn == false, it's a userDefined -> could be an overloaded built-in function also + // if builtIn == true, it's definitely a built-in function with EOpNull + if (! builtIn) { + call->setUserDefined(); + if (symbolTable.atGlobalLevel()) { + requireProfile(loc, ~EEsProfile, "calling user function from global scope"); + intermediate.addToCallGraph(infoSink, "main(", fnCandidate->getMangledName()); + } else + intermediate.addToCallGraph(infoSink, currentCaller, fnCandidate->getMangledName()); + } + + if (builtIn) + nonOpBuiltInCheck(loc, *fnCandidate, *call); + else + userFunctionCallCheck(loc, *call); + } + + // Convert 'out' arguments. If it was a constant folded built-in, it won't be an aggregate anymore. + // Built-ins with a single argument aren't called with an aggregate, but they also don't have an output. + // Also, build the qualifier list for user function calls, which are always called with an aggregate. + if (result->getAsAggregate()) { + TQualifierList& qualifierList = result->getAsAggregate()->getQualifierList(); + for (int i = 0; i < fnCandidate->getParamCount(); ++i) { + TStorageQualifier qual = (*fnCandidate)[i].type->getQualifier().storage; + qualifierList.push_back(qual); + } + result = addOutputArgumentConversions(*fnCandidate, *result->getAsAggregate()); + } + + handleCoopMat2FunctionCall(loc, fnCandidate, result, arguments); + + handleVector2CoopMatConversionCall(loc, fnCandidate, result, arguments); + + if (result->getAsTyped()->getType().isCoopVecNV() && + !result->getAsTyped()->getType().isParameterized()) { + if (auto unaryNode = result->getAsUnaryNode()) + result->setType(unaryNode->getOperand()->getAsTyped()->getType()); + else + result->setType(result->getAsAggregate()->getSequence()[0]->getAsTyped()->getType()); + } + + if (fnCandidate->getBuiltInOp() == EOpConstructSaturated) { + // result type is taken from the first parameter + result->setType(result->getAsAggregate()->getSequence()[0]->getAsTyped()->getType()); + } + } + } + + // generic error recovery + // TODO: simplification: localize all the error recoveries that look like this, and taking type into account to reduce cascades + if (result == nullptr) + result = intermediate.addConstantUnion(0.0, EbtFloat, loc); + + return result; +} + +void TParseContext::handleCoopMat2FunctionCall(const TSourceLoc& loc, const TFunction* fnCandidate, TIntermTyped* result, TIntermNode* arguments) +{ + if (arguments && arguments->getAsAggregate()) { + auto &sequence = arguments->getAsAggregate()->getSequence(); + for (uint32_t i = 0; i < sequence.size(); ++i) { + auto param = sequence[i]; + if (param->getAsTyped()->getBasicType() == EbtFunction) { + // Add the function to the callgraph + intermediate.addToCallGraph(infoSink, currentCaller, param->getAsSymbolNode()->getMangledName()); + + // error checking that all parameters are 'const in' + if (fnCandidate->getBuiltInOp() == EOpCooperativeMatrixLoadTensorNV || + fnCandidate->getBuiltInOp() == EOpCooperativeMatrixReduceNV || + fnCandidate->getBuiltInOp() == EOpCooperativeMatrixPerElementOpNV) { + const TFunction* func = symbolTable.find(param->getAsSymbolNode()->getMangledName())->getAsFunction(); + for (int i = 0; i < func->getParamCount(); ++i) { + const TParameter& arg = (*func)[i]; + const TQualifier& formalQualifier = arg.type->getQualifier(); + if (formalQualifier.storage != EvqConstReadOnly) { + error(loc, "function parameters must all be qualified 'const in'", param->getAsSymbolNode()->getMangledName().c_str(), ""); + } + } + } + + // error checking decodeFunc parameters are (reference, uint32_t[], uint32_t[]) + if (fnCandidate->getBuiltInOp() == EOpCooperativeMatrixLoadTensorNV) { + const TFunction* decodeFunc = symbolTable.find(param->getAsSymbolNode()->getMangledName())->getAsFunction(); + + if (decodeFunc->getParamCount() != 3) { + error(loc, "must have three parameters", param->getAsSymbolNode()->getMangledName().c_str(), ""); + } + + if ((*decodeFunc)[0].type->getBasicType() != EbtReference) { + error(loc, "first parameter must be buffer reference type", param->getAsSymbolNode()->getMangledName().c_str(), ""); + } + if ((*decodeFunc)[1].type->getBasicType() != EbtUint || (*decodeFunc)[2].type->getBasicType() != EbtUint) { + error(loc, "coordinate parameters must be uint32_t", param->getAsSymbolNode()->getMangledName().c_str(), ""); + } + if (!(*decodeFunc)[1].type->isArray() || !(*decodeFunc)[2].type->isArray()) { + error(loc, "coordinate parameters must be uint32_t", param->getAsSymbolNode()->getMangledName().c_str(), ""); + } + } + + // error checking reduce function has matching parameters + if (fnCandidate->getBuiltInOp() == EOpCooperativeMatrixReduceNV) { + const TFunction* combineOp = symbolTable.find(param->getAsSymbolNode()->getMangledName())->getAsFunction(); + + if (combineOp->getParamCount() != 2) { + error(loc, "must have two parameters", param->getAsSymbolNode()->getMangledName().c_str(), ""); + } + + for (int i = 0; i < combineOp->getParamCount(); ++i) { + const TParameter& arg = (*combineOp)[i]; + if (sequence[1]->getAsTyped()->getType().getBasicType() != arg.type->getBasicType()) { + error(loc, "parameter types must match cooperative matrix component type", param->getAsSymbolNode()->getMangledName().c_str(), ""); + } + } + if (sequence[1]->getAsTyped()->getType().getBasicType() != combineOp->getType().getBasicType()) { + error(loc, "return type must match cooperative matrix component type", param->getAsSymbolNode()->getMangledName().c_str(), ""); + } + } + + // error checking perelement op has correct parameters + if (fnCandidate->getBuiltInOp() == EOpCooperativeMatrixPerElementOpNV) { + const TFunction* elemOp = symbolTable.find(param->getAsSymbolNode()->getMangledName())->getAsFunction(); + + if (sequence[1]->getAsTyped()->getType() != sequence[0]->getAsTyped()->getType()) { + error(loc, "cooperative matrix input and result types must match", "", ""); + } + + if (elemOp->getParamCount() < 3) { + error(loc, "not enough parameters", param->getAsSymbolNode()->getMangledName().c_str(), ""); + } else if (elemOp->getParamCount() != (int)sequence.size()) { + error(loc, "number of parameters must match call to coopMatPerElementNV", param->getAsSymbolNode()->getMangledName().c_str(), ""); + } else { + if ((*elemOp)[0].type->getBasicType() != EbtUint || (*elemOp)[1].type->getBasicType() != EbtUint) { + error(loc, "row/column parameters must be uint32_t", param->getAsSymbolNode()->getMangledName().c_str(), ""); + } + + const TParameter& matArg = (*elemOp)[2]; + if (sequence[1]->getAsTyped()->getType().getBasicType() != matArg.type->getBasicType()) { + error(loc, "third parameter must match cooperative matrix component type", param->getAsSymbolNode()->getMangledName().c_str(), ""); + } + + for (int i = 3; i < elemOp->getParamCount(); ++i) { + const TParameter& arg = (*elemOp)[i]; + if (sequence[i]->getAsTyped()->getType().getBasicType() != arg.type->getBasicType()) { + error(loc, "parameter types must match or be cooperative matrix component type", param->getAsSymbolNode()->getMangledName().c_str(), ""); + } + } + if (sequence[1]->getAsTyped()->getType().getBasicType() != elemOp->getType().getBasicType()) { + error(loc, "return type must match cooperative matrix component type", param->getAsSymbolNode()->getMangledName().c_str(), ""); + } + } + } + } + } + } + if ((result->getAsTyped()->getType().isCoopMat() || + result->getAsTyped()->getType().isTensorLayoutNV() || + result->getAsTyped()->getType().isTensorViewNV()) && + !result->getAsTyped()->getType().isParameterized()) { + assert(fnCandidate->getBuiltInOp() == EOpCooperativeMatrixMulAdd || + fnCandidate->getBuiltInOp() == EOpCooperativeMatrixMulAddNV || + fnCandidate->getBuiltInOp() == EOpCooperativeMatrixReduceNV || + fnCandidate->getBuiltInOp() == EOpCooperativeMatrixPerElementOpNV || + fnCandidate->getBuiltInOp() == EOpCooperativeMatrixTransposeNV || + fnCandidate->getBuiltInOp() == EOpCreateTensorLayoutNV || + fnCandidate->getBuiltInOp() == EOpTensorLayoutSetDimensionNV || + fnCandidate->getBuiltInOp() == EOpTensorLayoutSetBlockSizeNV || + fnCandidate->getBuiltInOp() == EOpTensorLayoutSetStrideNV || + fnCandidate->getBuiltInOp() == EOpTensorLayoutSliceNV || + fnCandidate->getBuiltInOp() == EOpTensorLayoutSetClampValueNV || + fnCandidate->getBuiltInOp() == EOpCreateTensorViewNV || + fnCandidate->getBuiltInOp() == EOpTensorViewSetDimensionNV || + fnCandidate->getBuiltInOp() == EOpTensorViewSetStrideNV || + fnCandidate->getBuiltInOp() == EOpTensorViewSetClipNV); + + if (fnCandidate->getBuiltInOp() == EOpCreateTensorLayoutNV) { + + // Convert template parameters to arraySizes/typeParameters + TArraySizes *arraySizes = new TArraySizes; + for (uint32_t i = 0; i < 2; ++i) { + TIntermNode *param {}; + if (arguments->getAsConstantUnion()) { + if (i == 0) { + param = arguments; + } + } else { + assert(arguments->getAsAggregate()); + auto &sequence = arguments->getAsAggregate()->getSequence(); + if (i < sequence.size()) { + param = sequence[i]; + } + } + if (param) { + if (param->getAsTyped()->getType().getQualifier().isSpecConstant()) { + uint32_t value = param->getAsSymbolNode()->getConstArray()[0].getIConst(); + arraySizes->addInnerSize(value, param->getAsTyped()); + } else { + uint32_t value = param->getAsConstantUnion()->getConstArray()[0].getIConst(); + arraySizes->addInnerSize(value); + } + } else { + // gl_CooperativeMatrixClampModeUndefined + arraySizes->addInnerSize(0); + } + } + TTypeParameters typeParameters; + typeParameters.arraySizes = arraySizes; + + TType resultType; + resultType.deepCopy(result->getAsTyped()->getType()); + + resultType.copyTypeParameters(typeParameters); + result->setType(resultType); + } else if (fnCandidate->getBuiltInOp() == EOpCreateTensorViewNV) { + + // Convert template parameters to arraySizes/typeParameters + TArraySizes *arraySizes = new TArraySizes; + for (uint32_t i = 0; i < 7; ++i) { + TIntermNode *param {}; + if (arguments->getAsConstantUnion()) { + if (i == 0) { + param = arguments; + } + } else { + assert(arguments->getAsAggregate()); + auto &sequence = arguments->getAsAggregate()->getSequence(); + if (i < sequence.size()) { + param = sequence[i]; + } + } + if (param) { + if (param->getAsTyped()->getType().getQualifier().isSpecConstant()) { + uint32_t value = param->getAsSymbolNode()->getConstArray()[0].getIConst(); + arraySizes->addInnerSize(value, param->getAsTyped()); + } else { + uint32_t value = param->getAsConstantUnion()->getConstArray()[0].getIConst(); + arraySizes->addInnerSize(value); + } + } else { + uint32_t value = 0; + if (i >= 2) { + // default permutation values are an increasing sequence + value = i - 2; + } + arraySizes->addInnerSize(value); + } + } + TTypeParameters typeParameters; + typeParameters.arraySizes = arraySizes; + + TType resultType; + resultType.deepCopy(result->getAsTyped()->getType()); + + resultType.copyTypeParameters(typeParameters); + result->setType(resultType); + } else if (fnCandidate->getBuiltInOp() == EOpCooperativeMatrixReduceNV || + fnCandidate->getBuiltInOp() == EOpCooperativeMatrixPerElementOpNV || + fnCandidate->getBuiltInOp() == EOpCooperativeMatrixTransposeNV || + fnCandidate->getBuiltInOp() == EOpTensorLayoutSetDimensionNV || + fnCandidate->getBuiltInOp() == EOpTensorLayoutSetBlockSizeNV || + fnCandidate->getBuiltInOp() == EOpTensorLayoutSetStrideNV || + fnCandidate->getBuiltInOp() == EOpTensorLayoutSliceNV || + fnCandidate->getBuiltInOp() == EOpTensorLayoutSetClampValueNV || + fnCandidate->getBuiltInOp() == EOpTensorViewSetDimensionNV || + fnCandidate->getBuiltInOp() == EOpTensorViewSetStrideNV || + fnCandidate->getBuiltInOp() == EOpTensorViewSetClipNV) { + // Set result type to match type of first parameter + result->setType(result->getAsAggregate()->getSequence()[0]->getAsTyped()->getType()); + } else { + // The only remaining operation is MulAdd + assert(fnCandidate->getBuiltInOp() == EOpCooperativeMatrixMulAdd || + fnCandidate->getBuiltInOp() == EOpCooperativeMatrixMulAddNV); + + // Validate that the matrix sizes are compatible for multiplication and addition + const auto &sequence = arguments->getAsAggregate()->getSequence(); + + using ArrayDim = const TArraySize&; + auto getDim = [](const TIntermSequence& seq, int idx) -> std::tuple { + const auto &type = seq[idx]->getAsTyped()->getType(); + const auto *size = type.getTypeParameters()->arraySizes; + + if (type.isCoopMatNV()) { + // coopmatNV don't encode usage, so provide the correct usage by default + return {size->getArraySize(2), size->getArraySize(3), idx}; + } else { + assert(type.isCoopMatKHR()); + return {size->getArraySize(1), size->getArraySize(2), size->getDimSize(3)}; + } + }; + + // sizes look like: [scope, rows, cols, use] + auto [aRows, aCols, aUse] = getDim(sequence, 0); + auto [bRows, bCols, bUse] = getDim(sequence, 1); + auto [cRows, cCols, cUse] = getDim(sequence, 2); + + auto toString = [](ArrayDim dim) -> std::string { + std::stringstream buf; + if (dim.node == nullptr) { + buf << dim.size; + } else { + buf << "spec_const"; + } + return buf.str(); + }; + + if (aCols != bRows) { + auto aRowsStr = toString(aRows); + auto aColsStr = toString(aCols); + auto bRowsStr = toString(bRows); + auto bColsStr = toString(bCols); + error(loc, "cannot multiply coop matrices with incompatible sizes", + sequence[0]->getAsSymbolNode()->getMangledName().c_str(), + "%s x %s with %s x %s", + aRowsStr.c_str(), + aColsStr.c_str(), + bRowsStr.c_str(), + bColsStr.c_str()); + } else if (aRows != cRows || bCols != cCols) { + auto aRowsStr = toString(aRows); + auto bColsStr = toString(bCols); + auto cRowsStr = toString(cRows); + auto cColsStr = toString(cCols); + error(loc, "cannot add coop matrices with incompatible sizes", + sequence[2]->getAsSymbolNode()->getMangledName().c_str(), + "%s x %s with %s x %s", + aRowsStr.c_str(), + bColsStr.c_str(), + cRowsStr.c_str(), + cColsStr.c_str()); + } else if (aUse != 0) { + error(loc, "coop matrix A in MulAdd operation has incompatible usage property,", + sequence[0]->getAsSymbolNode()->getMangledName().c_str(), + "found %d, but needed 0", aUse); + } else if (bUse != 1) { + error(loc, "coop matrix B in MulAdd operation has incompatible usage property,", + sequence[1]->getAsSymbolNode()->getMangledName().c_str(), + "found %d, but needed 1", bUse); + } else if (cUse != 2) { + error(loc, "coop matrix C in MulAdd operation has incompatible usage property,", + sequence[2]->getAsSymbolNode()->getMangledName().c_str(), + "found %d, but needed 2", cUse); + } + + // Set result type to match type of C parameter + result->setType(result->getAsAggregate()->getSequence()[2]->getAsTyped()->getType()); + } + } +} + + +static const uint32_t spv_Scope_Subgroup = 3; + +void TParseContext::handleVector2CoopMatConversionCall(const TSourceLoc& loc, const TFunction* fnCandidate, + TIntermTyped*& result, TIntermNode* arguments) +{ + const uint32_t CM_MatrixUseA = 0; // == gl_MatrixUseA + const uint32_t CM_MatrixUseB = 1; // == gl_MatrixUseB + const uint32_t CM_MatrixUseAccumulator = 2; // == gl_MatrixUseAccumulator + + TOperator builtinOp = fnCandidate->getBuiltInOp(); + + if (!(builtinOp == EOpBitCastArrayQCOM || builtinOp == EOpExtractSubArrayQCOM || + builtinOp == EOpCompositeConstructCoopMatQCOM || builtinOp == EOpCompositeExtractCoopMatQCOM)) + return; + + TPublicType pubType{}; + auto* oldResult = result; + + if (builtinOp == EOpBitCastArrayQCOM) { + auto srcArr = arguments->getAsAggregate()->getSequence()[0]->getAsTyped(); + auto& srcTy = srcArr->getType(); + auto srcArrLen = srcTy.getArraySizes()->getDimSize(0); + auto srcLenAsNode = srcTy.getArraySizes()->getDimNode(0); + + auto dstArr = arguments->getAsAggregate()->getSequence()[1]->getAsTyped(); + auto& dstTy = dstArr->getType(); + auto dstArrLen = dstTy.getArraySizes()->getDimSize(0); + auto dstLenAsNode = dstTy.getArraySizes()->getDimNode(0); + + if (srcLenAsNode == nullptr && dstLenAsNode == nullptr) { + //do basic tests: + if ((srcArrLen * GetNumBits(srcTy.getBasicType())) != (dstArrLen * GetNumBits(dstTy.getBasicType()))) + error(loc, "source and target arrays have different bit sizes", "", ""); + } + + pubType.basicType = dstTy.getBasicType(); + pubType.vectorSize = 1u; + pubType.qualifier.precision = EpqNone; + pubType.coopmatNV = false; + pubType.coopmatKHR = false; + pubType.arraySizes = new TArraySizes; + pubType.arraySizes->addInnerSize(dstArrLen, dstLenAsNode); + pubType.typeParameters = nullptr; + } + + if (builtinOp == EOpExtractSubArrayQCOM) { + auto dstArr = arguments->getAsAggregate()->getSequence()[2]->getAsTyped(); + auto& dstTy = dstArr->getType(); + auto dstArrLen = dstTy.getArraySizes()->getDimSize(0); + auto dstLenAsNode = dstTy.getArraySizes()->getDimNode(0); + + if (dstLenAsNode == nullptr) { + if ((dstArrLen * GetNumBits(dstTy.getBasicType())) == 32) + error(loc, "the byte size of the target array must be 32", "", ""); + } + + pubType.basicType = dstTy.getBasicType(); + pubType.vectorSize = 1u; + pubType.qualifier.precision = EpqNone; + pubType.coopmatNV = false; + pubType.coopmatKHR = false; + pubType.arraySizes = new TArraySizes; + pubType.arraySizes->addInnerSize(dstArrLen, dstLenAsNode); + pubType.typeParameters = nullptr; + } + + if (builtinOp == EOpCompositeConstructCoopMatQCOM) { + + auto& srcType = arguments->getAsAggregate()->getSequence()[0]->getAsTyped()->getType(); + auto& dstType = arguments->getAsAggregate()->getSequence()[1]->getAsTyped()->getType(); + + glslang::TBasicType srcBasicType = srcType.getBasicType(); + glslang::TBasicType dstBasicType = dstType.getBasicType(); + + if (srcBasicType != EbtUint && srcBasicType != dstBasicType) + error(loc, "source and destination element types are not compatible", "", ""); + + uint32_t scope = spv_Scope_Subgroup; + uint32_t coopMatKHRuse = !0u; + uint32_t coopMatNumRows = !0u, coopMatNumCols = !0u; + TIntermTyped *nodeNumRows = nullptr, *nodeNumCols = nullptr; + const TTypeParameters* dstTypeParameters = dstType.getTypeParameters(); + if (dstTypeParameters->arraySizes == nullptr || dstTypeParameters->arraySizes->getNumDims() != 4) { + error(loc, "destination cooperative matrix has an unsupported type", "", ""); + } else { + auto arraySizes = dstTypeParameters->arraySizes; + scope = arraySizes->getDimSize(0); + coopMatNumRows = arraySizes->getDimSize(1); + nodeNumRows = arraySizes->getDimNode(1); + coopMatNumCols = arraySizes->getDimSize(2); + nodeNumCols = arraySizes->getDimNode(2); + coopMatKHRuse = arraySizes->getDimSize(3); + } + + if (scope != spv_Scope_Subgroup) { + scope = spv_Scope_Subgroup; + error(loc, "cooperative matrix has unsupported scope; gl_SubgroupScope is expected", "", ""); + } + + if (coopMatKHRuse > CM_MatrixUseAccumulator) { + coopMatKHRuse = CM_MatrixUseA; + error(loc, "cooperative matrix use must be one of gl_MatrixUseA, gl_MatrixUseB, gl_MatrixUseAccumulator", + "", ""); + } + + uint32_t dstBasicTypeSize = GetNumBits(dstBasicType) / 8; + + unsigned numRows = coopMatNumRows; + TIntermTyped* specConstRows = nodeNumRows; + unsigned numCols = coopMatNumCols; + TIntermTyped* specConstCols = nodeNumCols; + + // input array type + const TType& type = arguments->getAsAggregate()->getSequence()[0]->getAsTyped()->getType(); + uint32_t arrayLen = type.getArraySizes()->getDimSize(0); + auto arrayDimNode = type.getArraySizes()->getDimNode(0); + + if (coopMatKHRuse == CM_MatrixUseA || coopMatKHRuse == CM_MatrixUseAccumulator) { + // update numCols + if (arrayDimNode == nullptr && specConstCols == nullptr) + numCols = arrayLen * (sizeof(uint32_t) / dstBasicTypeSize); + } else if (coopMatKHRuse == CM_MatrixUseB) { + // update numRows + if (arrayDimNode == nullptr && specConstRows == nullptr) { + numRows = arrayLen * (sizeof(uint32_t) / dstBasicTypeSize); + } + } + + // construct the type + TArraySizes* arraySizes = new TArraySizes; + + // add Scope + arraySizes->addInnerSize(scope); + + // add the row size + arraySizes->addInnerSize(numRows, specConstRows); // copy from source + // add the column size + arraySizes->addInnerSize(numCols, specConstCols); // copy from source + // add cooperative matrix use + arraySizes->addInnerSize(coopMatKHRuse); + + pubType.basicType = dstBasicType; + pubType.vectorSize = 1u; + pubType.qualifier = srcType.getQualifier(); + pubType.qualifier.precision = EpqNone; + pubType.coopmatNV = dstType.isCoopMatNV(); + pubType.coopmatKHR = dstType.isCoopMatKHR(); + pubType.arraySizes = nullptr; + pubType.typeParameters = const_cast(dstTypeParameters); + } + + if (builtinOp == EOpCompositeExtractCoopMatQCOM) { + auto& srcType = arguments->getAsAggregate()->getSequence()[0]->getAsTyped()->getType(); + auto& dstType = arguments->getAsAggregate()->getSequence()[1]->getAsTyped()->getType(); + + glslang::TBasicType srcBasicType = srcType.getBasicType(); + glslang::TBasicType dstBasicType = dstType.getBasicType(); + + if (dstBasicType != EbtUint && srcBasicType != dstBasicType) + error(loc, "source and destination element types are not compatible", "", ""); + + uint32_t scope = spv_Scope_Subgroup; + unsigned coopMatKHRuse = !0u; + const TTypeParameters* srcTypeParameters = srcType.getTypeParameters(); + if (srcTypeParameters->arraySizes == nullptr || srcTypeParameters->arraySizes->getNumDims() != 4) { + error(loc, "source cooperative matrix has an unsupported type", "", ""); + } else { + auto arraySizes = srcTypeParameters->arraySizes; + scope = arraySizes->getDimSize(0); + coopMatKHRuse = arraySizes->getDimSize(3); + } + + if (scope != spv_Scope_Subgroup) { + scope = spv_Scope_Subgroup; + error(loc, "cooperative matrix has unsupported scope; gl_SubgroupScope is expected", "", ""); + } + + if (coopMatKHRuse > CM_MatrixUseAccumulator) { + coopMatKHRuse = CM_MatrixUseA; + error(loc, "cooperative matrix use must be one of gl_MatrixUseA, gl_MatrixUseB, gl_MatrixUseAccumulator", + "", ""); + } + + auto dstArrLen = dstType.getArraySizes()->getDimSize(0); + auto dstLenAsNode = dstType.getArraySizes()->getDimNode(0); + + if (dstLenAsNode == nullptr) { + bool ok = true; + switch (dstBasicType) { + case EbtUint: + case EbtInt: + case EbtFloat: + ok = (((coopMatKHRuse == CM_MatrixUseA || coopMatKHRuse == CM_MatrixUseB) && dstArrLen == 8) || + (coopMatKHRuse == + CM_MatrixUseAccumulator) /* && (dstArrLen == 64 || dstArrLen == 32 || dstArrLen == 16))*/); + break; + case EbtFloat16: + ok = (((coopMatKHRuse == CM_MatrixUseA || coopMatKHRuse == CM_MatrixUseB) && dstArrLen == 16) || + (coopMatKHRuse == + CM_MatrixUseAccumulator) /* && (dstArrLen == 64 || dstArrLen == 32 || dstArrLen == 16))*/); + break; + case EbtInt8: + case EbtUint8: + ok = (((coopMatKHRuse == CM_MatrixUseA || coopMatKHRuse == CM_MatrixUseB) && dstArrLen == 32) || + (coopMatKHRuse == + CM_MatrixUseAccumulator) /* && (dstArrLen == 64 || dstArrLen == 32 || dstArrLen == 16))*/); + break; + default: + error(loc, "unsupported element type", "", ""); + } + if (!ok) + error(loc, "unsupported destination array length", "", ""); + } + + pubType.basicType = dstBasicType; + pubType.vectorSize = 1u; + pubType.qualifier.precision = EpqNone; + pubType.coopmatNV = false; + pubType.coopmatKHR = false; + + pubType.arraySizes = new TArraySizes; + + { + //int coopMatKHRuse = srcTypeParameters->arraySizes->getDimSize(3); + uint32_t index = !0u; + if (coopMatKHRuse == CM_MatrixUseA) { + index = 2; + } else if (coopMatKHRuse == CM_MatrixUseB) { + index = 1; + } else if (coopMatKHRuse == CM_MatrixUseAccumulator) { + index = 2; + } else { + error(loc, "source cooperative matrix has an unexpected cooperative matrix use", "", ""); + } + int32_t numRowsOrCols = srcTypeParameters->arraySizes->getDimSize(index); + auto dimNode = srcTypeParameters->arraySizes->getDimNode(index); + if (dimNode != nullptr && dstLenAsNode == nullptr) { + numRowsOrCols = dstType.getArraySizes()->getDimSize(0); + dimNode = nullptr; + } + //int32_t dstArrLen = dstType.getArraySizes()->getDimSize(0); + pubType.arraySizes->addInnerSize(dstArrLen, dstLenAsNode); + if (dimNode == nullptr && dstLenAsNode == nullptr) { + const char* msg = nullptr; + if (coopMatKHRuse == CM_MatrixUseA && (numRowsOrCols != dstArrLen && dstArrLen != 8)) { + msg = "the source matrix's column is not compatible with the destination array"; + } else if (coopMatKHRuse == CM_MatrixUseB && (numRowsOrCols != dstArrLen && dstArrLen != 8)) { + msg = "the source matrix's row is not compatible with the destination array"; + } else if (coopMatKHRuse == CM_MatrixUseAccumulator && + (numRowsOrCols != dstArrLen && + (srcBasicType == EbtFloat16 && numRowsOrCols != 2 * dstArrLen))) { + msg = "the source matrix's column is not compatible with the destination array"; + } + if (msg != nullptr) + error(loc, msg, "", ""); + } + } + + pubType.typeParameters = nullptr; + } + + TType resultType(pubType); + if (pubType.typeParameters != nullptr) + resultType.copyTypeParameters(*pubType.typeParameters); + // need to make StorageQualifier temp + resultType.makeTemporary(); + result->setType(resultType); + + // the RHS of an assignment to be formed + auto rhs = result; + + // the LHS of an assignment to be formed; pick the last argument + int lhsIdx = (builtinOp == EOpExtractSubArrayQCOM ? 2 : 1); + auto lhs = arguments->getAsAggregate()->getSequence()[lhsIdx]->getAsTyped(); + // pop the last argument from the arguments sequence + arguments->getAsAggregate()->getSequence().pop_back(); + + // Create OpAssign + { + arrayObjectCheck(loc, lhs->getType(), "array assignment"); + storage16BitAssignmentCheck(loc, lhs->getType(), "="); + lValueErrorCheck(loc, "assign", lhs); + rValueErrorCheck(loc, "assign", rhs); + result = addAssign(loc, EOpAssign, lhs, rhs); + if (result == nullptr) + result = oldResult; + } +} + + +TIntermTyped* TParseContext::handleBuiltInFunctionCall(TSourceLoc loc, TIntermNode* arguments, + const TFunction& function) +{ + checkLocation(loc, function.getBuiltInOp()); + TIntermTyped *result = intermediate.addBuiltInFunctionCall(loc, function.getBuiltInOp(), + function.getParamCount() == 1, + arguments, function.getType()); + if (result != nullptr && obeyPrecisionQualifiers()) + computeBuiltinPrecisions(*result, function); + + if (result == nullptr) { + if (arguments == nullptr) + error(loc, " wrong operand type", "Internal Error", + "built in unary operator function. Type: %s", ""); + else + error(arguments->getLoc(), " wrong operand type", "Internal Error", + "built in unary operator function. Type: %s", + static_cast(arguments)->getCompleteString(intermediate.getEnhancedMsgs()).c_str()); + } else if (result->getAsOperator()) + builtInOpCheck(loc, function, *result->getAsOperator()); + + // Special handling for function call with SPIR-V instruction qualifier specified + if (function.getBuiltInOp() == EOpSpirvInst) { + if (auto agg = result->getAsAggregate()) { + // Propogate spirv_by_reference/spirv_literal from parameters to arguments + auto& sequence = agg->getSequence(); + for (unsigned i = 0; i < sequence.size(); ++i) { + if (function[i].type->getQualifier().isSpirvByReference()) + sequence[i]->getAsTyped()->getQualifier().setSpirvByReference(); + if (function[i].type->getQualifier().isSpirvLiteral()) + sequence[i]->getAsTyped()->getQualifier().setSpirvLiteral(); + } + + // Attach the function call to SPIR-V intruction + agg->setSpirvInstruction(function.getSpirvInstruction()); + } else if (auto unaryNode = result->getAsUnaryNode()) { + // Propogate spirv_by_reference/spirv_literal from parameters to arguments + if (function[0].type->getQualifier().isSpirvByReference()) + unaryNode->getOperand()->getQualifier().setSpirvByReference(); + if (function[0].type->getQualifier().isSpirvLiteral()) + unaryNode->getOperand()->getQualifier().setSpirvLiteral(); + + // Attach the function call to SPIR-V intruction + unaryNode->setSpirvInstruction(function.getSpirvInstruction()); + } else + assert(0); + } + + return result; +} + +// "The operation of a built-in function can have a different precision +// qualification than the precision qualification of the resulting value. +// These two precision qualifications are established as follows. +// +// The precision qualification of the operation of a built-in function is +// based on the precision qualification of its input arguments and formal +// parameters: When a formal parameter specifies a precision qualifier, +// that is used, otherwise, the precision qualification of the calling +// argument is used. The highest precision of these will be the precision +// qualification of the operation of the built-in function. Generally, +// this is applied across all arguments to a built-in function, with the +// exceptions being: +// - bitfieldExtract and bitfieldInsert ignore the 'offset' and 'bits' +// arguments. +// - interpolateAt* functions only look at the 'interpolant' argument. +// +// The precision qualification of the result of a built-in function is +// determined in one of the following ways: +// +// - For the texture sampling, image load, and image store functions, +// the precision of the return type matches the precision of the +// sampler type +// +// Otherwise: +// +// - For prototypes that do not specify a resulting precision qualifier, +// the precision will be the same as the precision of the operation. +// +// - For prototypes that do specify a resulting precision qualifier, +// the specified precision qualifier is the precision qualification of +// the result." +// +void TParseContext::computeBuiltinPrecisions(TIntermTyped& node, const TFunction& function) +{ + TPrecisionQualifier operationPrecision = EpqNone; + TPrecisionQualifier resultPrecision = EpqNone; + + TIntermOperator* opNode = node.getAsOperator(); + if (opNode == nullptr) + return; + + if (TIntermUnary* unaryNode = node.getAsUnaryNode()) { + operationPrecision = std::max(function[0].type->getQualifier().precision, + unaryNode->getOperand()->getType().getQualifier().precision); + if (function.getType().getBasicType() != EbtBool) + resultPrecision = function.getType().getQualifier().precision == EpqNone ? + operationPrecision : + function.getType().getQualifier().precision; + } else if (TIntermAggregate* agg = node.getAsAggregate()) { + TIntermSequence& sequence = agg->getSequence(); + unsigned int numArgs = (unsigned int)sequence.size(); + switch (agg->getOp()) { + case EOpBitfieldExtract: + numArgs = 1; + break; + case EOpBitfieldInsert: + numArgs = 2; + break; + case EOpInterpolateAtCentroid: + case EOpInterpolateAtOffset: + case EOpInterpolateAtSample: + numArgs = 1; + break; + case EOpDebugPrintf: + case EOpCooperativeMatrixPerElementOpNV: + case EOpCooperativeMatrixReduceNV: + case EOpConstructSaturated: + numArgs = 0; + break; + default: + break; + } + // find the maximum precision from the arguments and parameters + for (unsigned int arg = 0; arg < numArgs; ++arg) { + operationPrecision = std::max(operationPrecision, sequence[arg]->getAsTyped()->getQualifier().precision); + } + for (int arg = 0; arg < function.getParamCount(); ++arg) { + operationPrecision = std::max(operationPrecision, function[arg].type->getQualifier().precision); + } + // compute the result precision + if (agg->isSampling() || + agg->getOp() == EOpImageLoad || agg->getOp() == EOpImageStore || + agg->getOp() == EOpImageLoadLod || agg->getOp() == EOpImageStoreLod) + resultPrecision = sequence[0]->getAsTyped()->getQualifier().precision; + else if (function.getType().getBasicType() != EbtBool) + resultPrecision = function.getType().getQualifier().precision == EpqNone ? + operationPrecision : + function.getType().getQualifier().precision; + } + + // Propagate precision through this node and its children. That algorithm stops + // when a precision is found, so start by clearing this subroot precision + opNode->getQualifier().precision = EpqNone; + if (operationPrecision != EpqNone) { + opNode->propagatePrecision(operationPrecision); + opNode->setOperationPrecision(operationPrecision); + } + // Now, set the result precision, which might not match + opNode->getQualifier().precision = resultPrecision; +} + +TIntermNode* TParseContext::handleReturnValue(const TSourceLoc& loc, TIntermTyped* value) +{ + storage16BitAssignmentCheck(loc, value->getType(), "return"); + + functionReturnsValue = true; + TIntermBranch* branch = nullptr; + if (currentFunctionType->getBasicType() == EbtVoid) { + error(loc, "void function cannot return a value", "return", ""); + branch = intermediate.addBranch(EOpReturn, loc); + } else if (*currentFunctionType != value->getType()) { + TIntermTyped* converted = intermediate.addConversion(EOpReturn, *currentFunctionType, value); + if (converted) { + if (*currentFunctionType != converted->getType()) + error(loc, "cannot convert return value to function return type", "return", ""); + if (version < 420) + warn(loc, "type conversion on return values was not explicitly allowed until version 420", + "return", ""); + branch = intermediate.addBranch(EOpReturn, converted, loc); + } else { + error(loc, "type does not match, or is not convertible to, the function's return type", "return", ""); + branch = intermediate.addBranch(EOpReturn, value, loc); + } + } else { + if (value->getType().isTexture() || value->getType().isImage()) { + if (spvVersion.spv != 0) + error(loc, "sampler or image cannot be used as return type when generating SPIR-V", "return", ""); + else if (!extensionTurnedOn(E_GL_ARB_bindless_texture)) + error(loc, "sampler or image can be used as return type only when the extension GL_ARB_bindless_texture enabled", "return", ""); + } + branch = intermediate.addBranch(EOpReturn, value, loc); + } + branch->updatePrecision(currentFunctionType->getQualifier().precision); + return branch; +} + +// See if the operation is being done in an illegal location. +void TParseContext::checkLocation(const TSourceLoc& loc, TOperator op) +{ + switch (op) { + case EOpBarrier: + if (language == EShLangTessControl) { + if (controlFlowNestingLevel > 0) + error(loc, "tessellation control barrier() cannot be placed within flow control", "", ""); + if (! inMain) + error(loc, "tessellation control barrier() must be in main()", "", ""); + else if (postEntryPointReturn) + error(loc, "tessellation control barrier() cannot be placed after a return from main()", "", ""); + } + break; + case EOpBeginInvocationInterlock: + if (language != EShLangFragment) + error(loc, "beginInvocationInterlockARB() must be in a fragment shader", "", ""); + if (! inMain) + error(loc, "beginInvocationInterlockARB() must be in main()", "", ""); + else if (postEntryPointReturn) + error(loc, "beginInvocationInterlockARB() cannot be placed after a return from main()", "", ""); + if (controlFlowNestingLevel > 0) + error(loc, "beginInvocationInterlockARB() cannot be placed within flow control", "", ""); + + if (beginInvocationInterlockCount > 0) + error(loc, "beginInvocationInterlockARB() must only be called once", "", ""); + if (endInvocationInterlockCount > 0) + error(loc, "beginInvocationInterlockARB() must be called before endInvocationInterlockARB()", "", ""); + + beginInvocationInterlockCount++; + + // default to pixel_interlock_ordered + if (intermediate.getInterlockOrdering() == EioNone) + intermediate.setInterlockOrdering(EioPixelInterlockOrdered); + break; + case EOpEndInvocationInterlock: + if (language != EShLangFragment) + error(loc, "endInvocationInterlockARB() must be in a fragment shader", "", ""); + if (! inMain) + error(loc, "endInvocationInterlockARB() must be in main()", "", ""); + else if (postEntryPointReturn) + error(loc, "endInvocationInterlockARB() cannot be placed after a return from main()", "", ""); + if (controlFlowNestingLevel > 0) + error(loc, "endInvocationInterlockARB() cannot be placed within flow control", "", ""); + + if (endInvocationInterlockCount > 0) + error(loc, "endInvocationInterlockARB() must only be called once", "", ""); + if (beginInvocationInterlockCount == 0) + error(loc, "beginInvocationInterlockARB() must be called before endInvocationInterlockARB()", "", ""); + + endInvocationInterlockCount++; + break; + default: + break; + } +} + +// Finish processing object.length(). This started earlier in handleDotDereference(), where +// the ".length" part was recognized and semantically checked, and finished here where the +// function syntax "()" is recognized. +// +// Return resulting tree node. +TIntermTyped* TParseContext::handleLengthMethod(const TSourceLoc& loc, TFunction* function, TIntermNode* intermNode) +{ + int length = 0; + + if (function->getParamCount() > 0) + error(loc, "method does not accept any arguments", function->getName().c_str(), ""); + else { + const TType& type = intermNode->getAsTyped()->getType(); + if (type.isArray()) { + if (type.isUnsizedArray()) { + if (intermNode->getAsSymbolNode() && isIoResizeArray(type)) { + // We could be between a layout declaration that gives a built-in io array implicit size and + // a user redeclaration of that array, meaning we have to substitute its implicit size here + // without actually redeclaring the array. (It is an error to use a member before the + // redeclaration, but not an error to use the array name itself.) + const TString& name = intermNode->getAsSymbolNode()->getName(); + if (name == "gl_in" || name == "gl_out" || name == "gl_MeshVerticesNV" || + name == "gl_MeshPrimitivesNV") { + length = getIoArrayImplicitSize(type.getQualifier()); + } + } else if (const auto typed = intermNode->getAsTyped()) { + if (typed->getQualifier().builtIn == EbvSampleMask) { + requireProfile(loc, EEsProfile, "the array size of gl_SampleMask and gl_SampleMaskIn is ceil(gl_MaxSamples/32)"); + length = (resources.maxSamples + 31) / 32; + } + } + if (length == 0) { + if (intermNode->getAsSymbolNode() && isIoResizeArray(type)) + error(loc, "", function->getName().c_str(), "array must first be sized by a redeclaration or layout qualifier"); + else if (isRuntimeLength(*intermNode->getAsTyped())) { + // Create a unary op and let the back end handle it + return intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, intermNode, function->getType()); + } else + error(loc, "", function->getName().c_str(), "array must be declared with a size before using this method"); + } + } else if (type.getOuterArrayNode()) { + // If the array's outer size is specified by an intermediate node, it means the array's length + // was specified by a specialization constant. In such a case, we should return the node of the + // specialization constants to represent the length. + return type.getOuterArrayNode(); + } else + length = type.getOuterArraySize(); + } else if (type.isMatrix()) + length = type.getMatrixCols(); + else if (type.isVector()) + length = type.getVectorSize(); + else if (type.isCoopMat() || type.isCoopVecNV()) + return intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, intermNode, TType(EbtInt)); + else { + // we should not get here, because earlier semantic checking should have prevented this path + error(loc, ".length()", "unexpected use of .length()", ""); + } + } + + if (length == 0) + length = 1; + + return intermediate.addConstantUnion(length, loc); +} + +// +// Add any needed implicit conversions for function-call arguments to input parameters. +// +void TParseContext::addInputArgumentConversions(const TFunction& function, TIntermNode*& arguments) const +{ + TIntermAggregate* aggregate = arguments->getAsAggregate(); + + // Process each argument's conversion + for (int i = 0; i < function.getParamCount(); ++i) { + // At this early point there is a slight ambiguity between whether an aggregate 'arguments' + // is the single argument itself or its children are the arguments. Only one argument + // means take 'arguments' itself as the one argument. + TIntermTyped* arg = function.getParamCount() == 1 ? arguments->getAsTyped() : (aggregate ? aggregate->getSequence()[i]->getAsTyped() : arguments->getAsTyped()); + if (*function[i].type != arg->getType()) { + if (function[i].type->getQualifier().isParamInput() && + !function[i].type->isCoopMat() && !function[i].type->isTensorARM() && + // tensor layout/view type declarations don't do conversions, so we can't convert these parameters either + (function.getName() != "createTensorLayoutNV") && + (function.getName() != "createTensorViewNV")) { + // In-qualified arguments just need an extra node added above the argument to + // convert to the correct type. + arg = intermediate.addConversion(EOpFunctionCall, *function[i].type, arg); + if (arg) { + if (function.getParamCount() == 1) + arguments = arg; + else { + if (aggregate) + aggregate->getSequence()[i] = arg; + else + arguments = arg; + } + } + } + } + } +} + +// +// Add any needed implicit output conversions for function-call arguments. This +// can require a new tree topology, complicated further by whether the function +// has a return value. +// +// Returns a node of a subtree that evaluates to the return value of the function. +// +TIntermTyped* TParseContext::addOutputArgumentConversions(const TFunction& function, TIntermAggregate& intermNode) const +{ + TIntermSequence& arguments = intermNode.getSequence(); + + // Will there be any output conversions? + bool outputConversions = false; + for (int i = 0; i < function.getParamCount(); ++i) { + if (*function[i].type != arguments[i]->getAsTyped()->getType() && function[i].type->getQualifier().isParamOutput() && + !function[i].type->isCoopMat()) { + outputConversions = true; + break; + } + } + + if (! outputConversions) + return &intermNode; + + // Setup for the new tree, if needed: + // + // Output conversions need a different tree topology. + // Out-qualified arguments need a temporary of the correct type, with the call + // followed by an assignment of the temporary to the original argument: + // void: function(arg, ...) -> ( function(tempArg, ...), arg = tempArg, ...) + // ret = function(arg, ...) -> ret = (tempRet = function(tempArg, ...), arg = tempArg, ..., tempRet) + // Where the "tempArg" type needs no conversion as an argument, but will convert on assignment. + TIntermTyped* conversionTree = nullptr; + TVariable* tempRet = nullptr; + if (intermNode.getBasicType() != EbtVoid) { + // do the "tempRet = function(...), " bit from above + tempRet = makeInternalVariable("tempReturn", intermNode.getType()); + TIntermSymbol* tempRetNode = intermediate.addSymbol(*tempRet, intermNode.getLoc()); + conversionTree = intermediate.addAssign(EOpAssign, tempRetNode, &intermNode, intermNode.getLoc()); + } else + conversionTree = &intermNode; + + conversionTree = intermediate.makeAggregate(conversionTree); + + // Process each argument's conversion + for (int i = 0; i < function.getParamCount(); ++i) { + if (*function[i].type != arguments[i]->getAsTyped()->getType()) { + if (function[i].type->getQualifier().isParamOutput()) { + // Out-qualified arguments need to use the topology set up above. + // do the " ...(tempArg, ...), arg = tempArg" bit from above + TType paramType; + paramType.shallowCopy(*function[i].type); + if (arguments[i]->getAsTyped()->getType().isParameterized() && + !paramType.isParameterized()) { + paramType.shallowCopy(arguments[i]->getAsTyped()->getType()); + paramType.copyTypeParameters(*arguments[i]->getAsTyped()->getType().getTypeParameters()); + } + TVariable* tempArg = makeInternalVariable("tempArg", paramType); + tempArg->getWritableType().getQualifier().makeTemporary(); + TIntermSymbol* tempArgNode = intermediate.addSymbol(*tempArg, intermNode.getLoc()); + TIntermTyped* tempAssign = intermediate.addAssign(EOpAssign, arguments[i]->getAsTyped(), tempArgNode, arguments[i]->getLoc()); + conversionTree = intermediate.growAggregate(conversionTree, tempAssign, arguments[i]->getLoc()); + // replace the argument with another node for the same tempArg variable + arguments[i] = intermediate.addSymbol(*tempArg, intermNode.getLoc()); + } + } + } + + // Finalize the tree topology (see bigger comment above). + if (tempRet) { + // do the "..., tempRet" bit from above + TIntermSymbol* tempRetNode = intermediate.addSymbol(*tempRet, intermNode.getLoc()); + conversionTree = intermediate.growAggregate(conversionTree, tempRetNode, intermNode.getLoc()); + } + conversionTree = intermediate.setAggregateOperator(conversionTree, EOpComma, intermNode.getType(), intermNode.getLoc()); + + return conversionTree; +} + +TIntermTyped* TParseContext::addAssign(const TSourceLoc& loc, TOperator op, TIntermTyped* left, TIntermTyped* right) +{ + if ((op == EOpAddAssign || op == EOpSubAssign) && left->isReference()) + requireExtensions(loc, 1, &E_GL_EXT_buffer_reference2, "+= and -= on a buffer reference"); + + if (op == EOpAssign && left->getBasicType() == EbtSampler && right->getBasicType() == EbtSampler) + requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "sampler assignment for bindless texture"); + + return intermediate.addAssign(op, left, right, loc); +} + +void TParseContext::memorySemanticsCheck(const TSourceLoc& loc, const TFunction& fnCandidate, const TIntermOperator& callNode) +{ + const TIntermSequence* argp = &callNode.getAsAggregate()->getSequence(); + + //const int gl_SemanticsRelaxed = 0x0; + const int gl_SemanticsAcquire = 0x2; + const int gl_SemanticsRelease = 0x4; + const int gl_SemanticsAcquireRelease = 0x8; + const int gl_SemanticsMakeAvailable = 0x2000; + const int gl_SemanticsMakeVisible = 0x4000; + const int gl_SemanticsVolatile = 0x8000; + + //const int gl_StorageSemanticsNone = 0x0; + const int gl_StorageSemanticsBuffer = 0x40; + const int gl_StorageSemanticsShared = 0x100; + const int gl_StorageSemanticsImage = 0x800; + const int gl_StorageSemanticsOutput = 0x1000; + + const int nonRelaxedMemoryOrder = gl_SemanticsAcquire | + gl_SemanticsRelease | + gl_SemanticsAcquireRelease; + + unsigned int semantics = 0, storageClassSemantics = 0; + unsigned int semantics2 = 0, storageClassSemantics2 = 0; + + const TIntermTyped* arg0 = (*argp)[0]->getAsTyped(); + const bool isMS = arg0->getBasicType() == EbtSampler && arg0->getType().getSampler().isMultiSample(); + + // Grab the semantics and storage class semantics from the operands, based on opcode + switch (callNode.getOp()) { + case EOpAtomicAdd: + case EOpAtomicSubtract: + case EOpAtomicMin: + case EOpAtomicMax: + case EOpAtomicAnd: + case EOpAtomicOr: + case EOpAtomicXor: + case EOpAtomicExchange: + case EOpAtomicStore: + storageClassSemantics = (*argp)[3]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[4]->getAsConstantUnion()->getConstArray()[0].getIConst(); + break; + case EOpAtomicLoad: + storageClassSemantics = (*argp)[2]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[3]->getAsConstantUnion()->getConstArray()[0].getIConst(); + break; + case EOpAtomicCompSwap: + storageClassSemantics = (*argp)[4]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[5]->getAsConstantUnion()->getConstArray()[0].getIConst(); + storageClassSemantics2 = (*argp)[6]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics2 = (*argp)[7]->getAsConstantUnion()->getConstArray()[0].getIConst(); + break; + + case EOpImageAtomicAdd: + case EOpImageAtomicMin: + case EOpImageAtomicMax: + case EOpImageAtomicAnd: + case EOpImageAtomicOr: + case EOpImageAtomicXor: + case EOpImageAtomicExchange: + case EOpImageAtomicStore: + storageClassSemantics = (*argp)[isMS ? 5 : 4]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[isMS ? 6 : 5]->getAsConstantUnion()->getConstArray()[0].getIConst(); + break; + case EOpImageAtomicLoad: + storageClassSemantics = (*argp)[isMS ? 4 : 3]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[isMS ? 5 : 4]->getAsConstantUnion()->getConstArray()[0].getIConst(); + break; + case EOpImageAtomicCompSwap: + storageClassSemantics = (*argp)[isMS ? 6 : 5]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[isMS ? 7 : 6]->getAsConstantUnion()->getConstArray()[0].getIConst(); + storageClassSemantics2 = (*argp)[isMS ? 8 : 7]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics2 = (*argp)[isMS ? 9 : 8]->getAsConstantUnion()->getConstArray()[0].getIConst(); + break; + + case EOpBarrier: + storageClassSemantics = (*argp)[2]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[3]->getAsConstantUnion()->getConstArray()[0].getIConst(); + break; + case EOpMemoryBarrier: + storageClassSemantics = (*argp)[1]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[2]->getAsConstantUnion()->getConstArray()[0].getIConst(); + break; + default: + break; + } + + if (((semantics | semantics2) & ~(gl_SemanticsAcquire | + gl_SemanticsRelease | + gl_SemanticsAcquireRelease | + gl_SemanticsMakeAvailable | + gl_SemanticsMakeVisible | + gl_SemanticsVolatile))) { + error(loc, "Invalid semantics value", fnCandidate.getName().c_str(), ""); + } + + if (((storageClassSemantics | storageClassSemantics2) & ~(gl_StorageSemanticsBuffer | + gl_StorageSemanticsShared | + gl_StorageSemanticsImage | + gl_StorageSemanticsOutput))) { + error(loc, "Invalid storage class semantics value", fnCandidate.getName().c_str(), ""); + } + + if (((semantics & nonRelaxedMemoryOrder) && !IsPow2(semantics & nonRelaxedMemoryOrder)) || + ((semantics2 & nonRelaxedMemoryOrder) && !IsPow2(semantics2 & nonRelaxedMemoryOrder))) { + error(loc, + "Semantics must not include multiple of gl_SemanticsRelease, gl_SemanticsAcquire, or " + "gl_SemanticsAcquireRelease", + fnCandidate.getName().c_str(), ""); + } + + if (((semantics & nonRelaxedMemoryOrder) && !storageClassSemantics) || + ((semantics2 & nonRelaxedMemoryOrder) && !storageClassSemantics2)) { + error(loc, + "Storage class semantics must not be zero when used with gl_SemanticsRelease, " + "gl_SemanticsAcquire, or gl_SemanticsAcquireRelease", + fnCandidate.getName().c_str(), ""); + } + + if ((storageClassSemantics && !(semantics & nonRelaxedMemoryOrder)) || + (storageClassSemantics2 && !(semantics2 & nonRelaxedMemoryOrder))) { + error(loc, + "Semantics must be gl_SemanticsRelease, gl_SemanticsAcquire, or gl_SemanticsAcquireRelease when used " + "with non-zero storage class semantics", + fnCandidate.getName().c_str(), ""); + } + + if (((semantics & gl_SemanticsMakeAvailable) && + !(semantics & (gl_SemanticsRelease | gl_SemanticsAcquireRelease))) || + ((semantics2 & gl_SemanticsMakeAvailable) && + !(semantics2 & (gl_SemanticsRelease | gl_SemanticsAcquireRelease)))) { + error(loc, "gl_SemanticsMakeAvailable requires gl_SemanticsRelease or gl_SemanticsAcquireRelease", + fnCandidate.getName().c_str(), ""); + } + + if (((semantics & gl_SemanticsMakeVisible) && !(semantics & (gl_SemanticsAcquire | gl_SemanticsAcquireRelease))) || + ((semantics2 & gl_SemanticsMakeVisible) && + !(semantics2 & (gl_SemanticsAcquire | gl_SemanticsAcquireRelease)))) { + error(loc, "gl_SemanticsMakeVisible requires gl_SemanticsAcquire or gl_SemanticsAcquireRelease", + fnCandidate.getName().c_str(), ""); + } + + if ((callNode.getOp() == EOpAtomicStore || callNode.getOp() == EOpImageAtomicStore) && + (semantics & gl_SemanticsAcquire)) { + error(loc, "gl_SemanticsAcquire must not be used with (image) atomic store", fnCandidate.getName().c_str(), ""); + } + + if ((callNode.getOp() == EOpAtomicLoad || callNode.getOp() == EOpImageAtomicLoad) && + (semantics & gl_SemanticsRelease)) { + error(loc, "gl_SemanticsRelease must not be used with (image) atomic load", fnCandidate.getName().c_str(), ""); + } + + if ((callNode.getOp() == EOpAtomicStore || callNode.getOp() == EOpImageAtomicStore || + callNode.getOp() == EOpAtomicLoad || callNode.getOp() == EOpImageAtomicLoad) && + (semantics & gl_SemanticsAcquireRelease)) { + error(loc, "gl_SemanticsAcquireRelease must not be used with (image) atomic load/store", + fnCandidate.getName().c_str(), ""); + } + + if (callNode.getOp() == EOpMemoryBarrier && + !(semantics & (gl_SemanticsAcquire | gl_SemanticsRelease | gl_SemanticsAcquireRelease))) { + error(loc, + "Semantics must include exactly one of gl_SemanticsRelease, gl_SemanticsAcquire, or " + "gl_SemanticsAcquireRelease when used with memoryBarrier", + fnCandidate.getName().c_str(), ""); + } + + if ((callNode.getOp() == EOpMemoryBarrier || callNode.getOp() == EOpBarrier) && + (semantics & gl_SemanticsVolatile)) { + error(loc, "gl_SemanticsVolatile must not be used with memoryBarrier or controlBarrier", + fnCandidate.getName().c_str(), ""); + } + + if (callNode.getOp() == EOpAtomicCompSwap || callNode.getOp() == EOpImageAtomicCompSwap) { + if (semantics2 & (gl_SemanticsRelease | gl_SemanticsAcquireRelease)) { + error(loc, "semUnequal must not be gl_SemanticsRelease or gl_SemanticsAcquireRelease", + fnCandidate.getName().c_str(), ""); + } + if ((semantics2 & gl_SemanticsAcquire) && !(semantics & (gl_SemanticsAcquire | gl_SemanticsAcquireRelease))) { + error(loc, + "semUnequal must not be gl_SemanticsAcquire unless semEqual is gl_SemanticsAcquire " + "or gl_SemanticsAcquireRelease", + fnCandidate.getName().c_str(), ""); + } + if ((semantics2 & gl_SemanticsMakeVisible) && !(semantics & gl_SemanticsMakeVisible)) { + error(loc, + "semUnequal must not include gl_SemanticsMakeVisible unless semEqual also includes " + "gl_SemanticsMakeVisible", + fnCandidate.getName().c_str(), ""); + } + if (storageClassSemantics2 & ~(storageClassSemantics)) { + error(loc, "semStorageUnequal must not include any option that is not present in semStorageEqual", + fnCandidate.getName().c_str(), ""); + } + if ((semantics ^ semantics2) & gl_SemanticsVolatile) { + error(loc, "semEqual and semUnequal must either both include gl_SemanticsVolatile or neither", + fnCandidate.getName().c_str(), ""); + } + } +} + +// +// Do additional checking of built-in function calls that is not caught +// by normal semantic checks on argument type, extension tagging, etc. +// +// Assumes there has been a semantically correct match to a built-in function prototype. +// +void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCandidate, TIntermOperator& callNode) +{ + // Set up convenience accessors to the argument(s). There is almost always + // multiple arguments for the cases below, but when there might be one, + // check the unaryArg first. + const TIntermSequence* argp = nullptr; // confusing to use [] syntax on a pointer, so this is to help get a reference + const TIntermTyped* unaryArg = nullptr; + const TIntermTyped* arg0 = nullptr; + if (callNode.getAsAggregate()) { + argp = &callNode.getAsAggregate()->getSequence(); + if (argp->size() > 0) + arg0 = (*argp)[0]->getAsTyped(); + } else { + assert(callNode.getAsUnaryNode()); + unaryArg = callNode.getAsUnaryNode()->getOperand(); + arg0 = unaryArg; + } + + TString featureString; + const char* feature = nullptr; + + auto checkConstantArgWithLocation = [&](int argIndex, const char* argDescription, + const char* errMsg, int ioRTLocationSet) { + //ioRTLocationSet refers to grouping of locations of RT input/outputs as defined in TIntermediate::usedIoRT + if (!(*argp)[argIndex]->getAsConstantUnion()) { + error(loc, "argument must be compile-time constant", argDescription, argIndex == 10 ? "a" : ""); + } else if (ioRTLocationSet >= 0) { + unsigned int location = (*argp)[argIndex]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); + if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(ioRTLocationSet, location) < 0) + error(loc, "with layout(location =", errMsg, "%d)", location); + } + }; + + switch (callNode.getOp()) { + case EOpTextureGather: + case EOpTextureGatherOffset: + case EOpTextureGatherOffsets: + { + // Figure out which variants are allowed by what extensions, + // and what arguments must be constant for which situations. + + featureString = fnCandidate.getName(); + featureString += "(...)"; + feature = featureString.c_str(); + profileRequires(loc, EEsProfile, 310, nullptr, feature); + int compArg = -1; // track which argument, if any, is the constant component argument + const int numTexGatherExts = 3; + const char* texGatherExts[numTexGatherExts] = { E_GL_ARB_texture_gather, + E_GL_ARB_gpu_shader5, + E_GL_NV_gpu_shader5}; + switch (callNode.getOp()) { + case EOpTextureGather: + // More than two arguments needs gpu_shader5, and rectangular or shadow needs gpu_shader5, + // otherwise, need GL_ARB_texture_gather. + if (fnCandidate.getParamCount() > 2 || fnCandidate[0].type->getSampler().dim == EsdRect || fnCandidate[0].type->getSampler().shadow) { + profileRequires(loc, ~EEsProfile, 400, Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5, feature); + if (! fnCandidate[0].type->getSampler().shadow) + compArg = 2; + } else + profileRequires(loc, ~EEsProfile, 400, numTexGatherExts, texGatherExts, feature); + break; + case EOpTextureGatherOffset: + // GL_ARB_texture_gather is good enough for 2D non-shadow textures with no component argument + if (fnCandidate[0].type->getSampler().dim == Esd2D && ! fnCandidate[0].type->getSampler().shadow && fnCandidate.getParamCount() == 3) + profileRequires(loc, ~EEsProfile, 400, numTexGatherExts, texGatherExts, feature); + else + profileRequires(loc, ~EEsProfile, 400, Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5, feature); + if (! (*argp)[fnCandidate[0].type->getSampler().shadow ? 3 : 2]->getAsConstantUnion()) + profileRequires(loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, + "non-constant offset argument"); + if (! fnCandidate[0].type->getSampler().shadow) + compArg = 3; + break; + case EOpTextureGatherOffsets: + profileRequires(loc, ~EEsProfile, 400, Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5, feature); + if (! fnCandidate[0].type->getSampler().shadow) + compArg = 3; + // check for constant offsets + if (! (*argp)[fnCandidate[0].type->getSampler().shadow ? 3 : 2]->getAsConstantUnion() + // NV_gpu_shader5 relaxes this limitation and allows for non-constant offsets + && !extensionTurnedOn(E_GL_NV_gpu_shader5)) + error(loc, "must be a compile-time constant:", feature, "offsets argument"); + break; + default: + break; + } + + if (compArg > 0 && compArg < fnCandidate.getParamCount()) { + if ((*argp)[compArg]->getAsConstantUnion()) { + int value = (*argp)[compArg]->getAsConstantUnion()->getConstArray()[0].getIConst(); + if (value < 0 || value > 3) + error(loc, "must be 0, 1, 2, or 3:", feature, "component argument"); + } else + error(loc, "must be a compile-time constant:", feature, "component argument"); + } + + bool bias = false; + if (callNode.getOp() == EOpTextureGather) + bias = fnCandidate.getParamCount() > 3; + else if (callNode.getOp() == EOpTextureGatherOffset || + callNode.getOp() == EOpTextureGatherOffsets) + bias = fnCandidate.getParamCount() > 4; + + if (bias) { + featureString = fnCandidate.getName(); + featureString += "with bias argument"; + feature = featureString.c_str(); + profileRequires(loc, ~EEsProfile, 450, nullptr, feature); + requireExtensions(loc, 1, &E_GL_AMD_texture_gather_bias_lod, feature); + } + break; + } + + case EOpTexture: + case EOpTextureLod: + { + if ((fnCandidate.getParamCount() > 2) && ((*argp)[1]->getAsTyped()->getType().getBasicType() == EbtFloat) && + ((*argp)[1]->getAsTyped()->getType().getVectorSize() == 4) && fnCandidate[0].type->getSampler().shadow) { + featureString = fnCandidate.getName(); + if (callNode.getOp() == EOpTexture) + featureString += "(..., float bias)"; + else + featureString += "(..., float lod)"; + feature = featureString.c_str(); + + if ((fnCandidate[0].type->getSampler().dim == Esd2D && fnCandidate[0].type->getSampler().arrayed) || //2D Array Shadow + (fnCandidate[0].type->getSampler().dim == EsdCube && fnCandidate[0].type->getSampler().arrayed && fnCandidate.getParamCount() > 3) || // Cube Array Shadow + (fnCandidate[0].type->getSampler().dim == EsdCube && callNode.getOp() == EOpTextureLod)) { // Cube Shadow + requireExtensions(loc, 1, &E_GL_EXT_texture_shadow_lod, feature); + if (isEsProfile()) { + if (version < 320 && + !extensionsTurnedOn(Num_AEP_texture_cube_map_array, AEP_texture_cube_map_array)) + error(loc, "GL_EXT_texture_shadow_lod not supported for this ES version", feature, ""); + else + profileRequires(loc, EEsProfile, 320, nullptr, feature); + } else { // Desktop + profileRequires(loc, ~EEsProfile, 130, nullptr, feature); + } + } + } + break; + } + + case EOpSparseTextureGather: + case EOpSparseTextureGatherOffset: + case EOpSparseTextureGatherOffsets: + { + bool bias = false; + if (callNode.getOp() == EOpSparseTextureGather) + bias = fnCandidate.getParamCount() > 4; + else if (callNode.getOp() == EOpSparseTextureGatherOffset || + callNode.getOp() == EOpSparseTextureGatherOffsets) + bias = fnCandidate.getParamCount() > 5; + + if (bias) { + featureString = fnCandidate.getName(); + featureString += "with bias argument"; + feature = featureString.c_str(); + profileRequires(loc, ~EEsProfile, 450, nullptr, feature); + requireExtensions(loc, 1, &E_GL_AMD_texture_gather_bias_lod, feature); + } + // As per GL_ARB_sparse_texture2 extension "Offsets" parameter must be constant integral expression + // for sparseTextureGatherOffsetsARB just as textureGatherOffsets + if (callNode.getOp() == EOpSparseTextureGatherOffsets) { + int offsetsArg = arg0->getType().getSampler().shadow ? 3 : 2; + if (!(*argp)[offsetsArg]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "offsets", ""); + } + break; + } + + case EOpSparseTextureGatherLod: + case EOpSparseTextureGatherLodOffset: + case EOpSparseTextureGatherLodOffsets: + { + requireExtensions(loc, 1, &E_GL_ARB_sparse_texture2, fnCandidate.getName().c_str()); + break; + } + + case EOpSwizzleInvocations: + { + if (! (*argp)[1]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "offset", ""); + else { + unsigned offset[4] = {}; + offset[0] = (*argp)[1]->getAsConstantUnion()->getConstArray()[0].getUConst(); + offset[1] = (*argp)[1]->getAsConstantUnion()->getConstArray()[1].getUConst(); + offset[2] = (*argp)[1]->getAsConstantUnion()->getConstArray()[2].getUConst(); + offset[3] = (*argp)[1]->getAsConstantUnion()->getConstArray()[3].getUConst(); + if (offset[0] > 3 || offset[1] > 3 || offset[2] > 3 || offset[3] > 3) + error(loc, "components must be in the range [0, 3]", "offset", ""); + } + + break; + } + + case EOpSwizzleInvocationsMasked: + { + if (! (*argp)[1]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "mask", ""); + else { + unsigned mask[3] = {}; + mask[0] = (*argp)[1]->getAsConstantUnion()->getConstArray()[0].getUConst(); + mask[1] = (*argp)[1]->getAsConstantUnion()->getConstArray()[1].getUConst(); + mask[2] = (*argp)[1]->getAsConstantUnion()->getConstArray()[2].getUConst(); + if (mask[0] > 31 || mask[1] > 31 || mask[2] > 31) + error(loc, "components must be in the range [0, 31]", "mask", ""); + } + + break; + } + + case EOpTextureOffset: + case EOpTextureFetchOffset: + case EOpTextureProjOffset: + case EOpTextureLodOffset: + case EOpTextureProjLodOffset: + case EOpTextureGradOffset: + case EOpTextureProjGradOffset: + case EOpSparseTextureOffset: + case EOpSparseTextureFetchOffset: + case EOpSparseTextureLodOffset: + case EOpSparseTextureGradOffset: + { + // Handle texture-offset limits checking + // Pick which argument has to hold constant offsets + int arg = -1; + switch (callNode.getOp()) { + case EOpSparseTextureOffset: + case EOpTextureOffset: + case EOpTextureProjOffset: + arg = 2; + break; + case EOpSparseTextureLodOffset: + case EOpTextureLodOffset: + case EOpTextureProjLodOffset: + arg = 3; + break; + case EOpSparseTextureGradOffset: + case EOpTextureGradOffset: + case EOpTextureProjGradOffset: + arg = 4; + break; + case EOpSparseTextureFetchOffset: + case EOpTextureFetchOffset: + arg = (arg0->getType().getSampler().isRect()) ? 2 : 3; + break; + default: + assert(0); + break; + } + + if (arg > 0) { + + bool f16ShadowCompare = (*argp)[1]->getAsTyped()->getBasicType() == EbtFloat16 && + arg0->getType().getSampler().shadow; + if (f16ShadowCompare) + ++arg; + // Allow non-constant offsets for certain texture ops + bool variableOffsetSupport = extensionTurnedOn(E_GL_NV_gpu_shader5) && + (callNode.getOp() == EOpTextureOffset || + callNode.getOp() == EOpTextureFetchOffset || + callNode.getOp() == EOpTextureProjOffset || + callNode.getOp() == EOpTextureLodOffset || + callNode.getOp() == EOpTextureProjLodOffset); + if (! (*argp)[arg]->getAsTyped()->getQualifier().isConstant()) { + if (!extensionTurnedOn(E_GL_EXT_texture_offset_non_const) && !variableOffsetSupport) + error(loc, "argument must be compile-time constant", "texel offset", ""); + } + else if ((*argp)[arg]->getAsConstantUnion()) { + const TType& type = (*argp)[arg]->getAsTyped()->getType(); + for (int c = 0; c < type.getVectorSize(); ++c) { + int offset = (*argp)[arg]->getAsConstantUnion()->getConstArray()[c].getIConst(); + if (offset > resources.maxProgramTexelOffset || offset < resources.minProgramTexelOffset) + error(loc, "value is out of range:", "texel offset", + "[gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]"); + } + } + + // This check does not apply to sparse because + // GL_ARB_sparse_texture2 always includes this function. + if (callNode.getOp() == EOpTextureOffset) { + TSampler s = arg0->getType().getSampler(); + if (s.is2D() && s.isArrayed() && s.isShadow()) { + if ( + ((*argp)[1]->getAsTyped()->getType().getBasicType() == EbtFloat) && + ((*argp)[1]->getAsTyped()->getType().getVectorSize() == 4) && + (fnCandidate.getParamCount() == 4)) { + featureString = fnCandidate.getName() + " for sampler2DArrayShadow"; + feature = featureString.c_str(); + requireExtensions(loc, 1, &E_GL_EXT_texture_shadow_lod, feature); + profileRequires(loc, EEsProfile, 300, nullptr, feature); + profileRequires(loc, ~EEsProfile, 130, nullptr, feature); + } + else if (isEsProfile()) + error(loc, "TextureOffset does not support sampler2DArrayShadow : ", "sampler", "ES Profile"); + else if (version <= 420) + error(loc, "TextureOffset does not support sampler2DArrayShadow : ", "sampler", "version <= 420"); + } + } + + // This check does not apply to sparse because + // GL_ARB_sparse_texture2 does not define sparseTextureLodOffsetARB + // with a sampler2DArrayShadow. + if (callNode.getOp() == EOpTextureLodOffset) { + TSampler s = arg0->getType().getSampler(); + if (s.is2D() && s.isArrayed() && s.isShadow() && + ((*argp)[1]->getAsTyped()->getType().getBasicType() == EbtFloat) && + ((*argp)[1]->getAsTyped()->getType().getVectorSize() == 4) && + (fnCandidate.getParamCount() == 4)) { + featureString = fnCandidate.getName() + " for sampler2DArrayShadow"; + feature = featureString.c_str(); + profileRequires(loc, EEsProfile, 300, nullptr, feature); + profileRequires(loc, ~EEsProfile, 130, nullptr, feature); + requireExtensions(loc, 1, &E_GL_EXT_texture_shadow_lod, feature); + } + } + } + + break; + } + + + case EOpTraceNV: + checkConstantArgWithLocation(10, "payload number", nullptr, -1); + break; + case EOpTraceRayMotionNV: + checkConstantArgWithLocation(11, "payload number", nullptr, -1); + break; + case EOpTraceKHR: + checkConstantArgWithLocation(10, "payload number", "no rayPayloadEXT/rayPayloadInEXT declared", 0); + break; + case EOpExecuteCallableNV: + checkConstantArgWithLocation(1, "callable data number", nullptr, -1); + break; + case EOpExecuteCallableKHR: + checkConstantArgWithLocation(1, "callable data number", "no callableDataEXT/callableDataInEXT declared", 1); + break; + + case EOpHitObjectTraceRayNV: + checkConstantArgWithLocation(11, "payload number", "no rayPayloadEXT/rayPayloadInEXT declared", 0); + break; + case EOpHitObjectTraceRayMotionNV: + checkConstantArgWithLocation(12, "payload number", "no rayPayloadEXT/rayPayloadInEXT declared", 0); + break; + case EOpHitObjectExecuteShaderNV: + checkConstantArgWithLocation(1, "payload number", "no rayPayloadEXT/rayPayloadInEXT declared", 0); + break; + case EOpHitObjectRecordHitNV: + checkConstantArgWithLocation(12, "hitobjectattribute number", "no hitObjectAttributeNV declared", 2); + break; + case EOpHitObjectRecordHitMotionNV: + checkConstantArgWithLocation(13, "hitobjectattribute number", "no hitObjectAttributeNV declared", 2); + break; + case EOpHitObjectRecordHitWithIndexNV: + checkConstantArgWithLocation(11, "hitobjectattribute number", "no hitObjectAttributeNV declared", 2); + break; + case EOpHitObjectRecordHitWithIndexMotionNV: + checkConstantArgWithLocation(12, "hitobjectattribute number", "no hitObjectAttributeNV declared", 2); + break; + case EOpHitObjectGetAttributesNV: + checkConstantArgWithLocation(1, "hitobjectattribute number", "no hitObjectAttributeNV declared", 2); + break; + + case EOpRayQueryGetIntersectionType: + case EOpRayQueryGetIntersectionT: + case EOpRayQueryGetIntersectionInstanceCustomIndex: + case EOpRayQueryGetIntersectionInstanceId: + case EOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffset: + case EOpRayQueryGetIntersectionGeometryIndex: + case EOpRayQueryGetIntersectionPrimitiveIndex: + case EOpRayQueryGetIntersectionBarycentrics: + case EOpRayQueryGetIntersectionFrontFace: + case EOpRayQueryGetIntersectionObjectRayDirection: + case EOpRayQueryGetIntersectionObjectRayOrigin: + case EOpRayQueryGetIntersectionObjectToWorld: + case EOpRayQueryGetIntersectionWorldToObject: + case EOpRayQueryGetIntersectionTriangleVertexPositionsEXT: + case EOpRayQueryGetIntersectionClusterIdNV: + case EOpRayQueryGetIntersectionSpherePositionNV: + case EOpRayQueryGetIntersectionSphereRadiusNV: + case EOpRayQueryGetIntersectionLSSHitValueNV: + case EOpRayQueryGetIntersectionLSSPositionsNV: + case EOpRayQueryGetIntersectionLSSRadiiNV: + if (!(*argp)[1]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "committed", ""); + break; + + case EOpTextureQuerySamples: + case EOpImageQuerySamples: + // GL_ARB_shader_texture_image_samples + profileRequires(loc, ~EEsProfile, 450, E_GL_ARB_shader_texture_image_samples, "textureSamples and imageSamples"); + break; + + case EOpImageAtomicAdd: + case EOpImageAtomicMin: + case EOpImageAtomicMax: + case EOpImageAtomicAnd: + case EOpImageAtomicOr: + case EOpImageAtomicXor: + case EOpImageAtomicExchange: + case EOpImageAtomicCompSwap: + case EOpImageAtomicLoad: + case EOpImageAtomicStore: + { + // Make sure the image types have the correct layout() format and correct argument types + const TType& imageType = arg0->getType(); + if (imageType.getSampler().type == EbtInt || imageType.getSampler().type == EbtUint || + imageType.getSampler().type == EbtInt64 || imageType.getSampler().type == EbtUint64) { + if (imageType.getQualifier().getFormat() != ElfR32i && imageType.getQualifier().getFormat() != ElfR32ui && + imageType.getQualifier().getFormat() != ElfR64i && imageType.getQualifier().getFormat() != ElfR64ui) + error(loc, "only supported on image with format r32i or r32ui", fnCandidate.getName().c_str(), ""); + if (callNode.getType().getBasicType() == EbtInt64 && imageType.getQualifier().getFormat() != ElfR64i) + error(loc, "only supported on image with format r64i", fnCandidate.getName().c_str(), ""); + else if (callNode.getType().getBasicType() == EbtUint64 && imageType.getQualifier().getFormat() != ElfR64ui) + error(loc, "only supported on image with format r64ui", fnCandidate.getName().c_str(), ""); + } else if(callNode.getType().getBasicType() == EbtFloat16 && + ((callNode.getType().getVectorSize() == 2 && arg0->getType().getQualifier().getFormat() == ElfRg16f) || + (callNode.getType().getVectorSize() == 4 && arg0->getType().getQualifier().getFormat() == ElfRgba16f))) { + if (StartsWith(fnCandidate.getName(), "imageAtomicAdd") || + StartsWith(fnCandidate.getName(), "imageAtomicExchange") || + StartsWith(fnCandidate.getName(), "imageAtomicMin") || + StartsWith(fnCandidate.getName(), "imageAtomicMax")) { + requireExtensions(loc, 1, &E_GL_NV_shader_atomic_fp16_vector, fnCandidate.getName().c_str()); + } else { + error(loc, "f16vec2/4 operation not supported on: ", fnCandidate.getName().c_str(), ""); + } + } else if (imageType.getSampler().type == EbtFloat) { + if (StartsWith(fnCandidate.getName(), "imageAtomicExchange")) { + // imageAtomicExchange doesn't require an extension + } else if (StartsWith(fnCandidate.getName(), "imageAtomicAdd") || + StartsWith(fnCandidate.getName(), "imageAtomicLoad") || + StartsWith(fnCandidate.getName(), "imageAtomicStore")) { + requireExtensions(loc, 1, &E_GL_EXT_shader_atomic_float, fnCandidate.getName().c_str()); + } else if (StartsWith(fnCandidate.getName(), "imageAtomicMin") || + StartsWith(fnCandidate.getName(), "imageAtomicMax")) { + requireExtensions(loc, 1, &E_GL_EXT_shader_atomic_float2, fnCandidate.getName().c_str()); + } else { + error(loc, "only supported on integer images", fnCandidate.getName().c_str(), ""); + } + if (imageType.getQualifier().getFormat() != ElfR32f && isEsProfile()) + error(loc, "only supported on image with format r32f", fnCandidate.getName().c_str(), ""); + } else { + error(loc, "not supported on this image type", fnCandidate.getName().c_str(), ""); + } + + const size_t maxArgs = imageType.getSampler().isMultiSample() ? 5 : 4; + if (argp->size() > maxArgs) { + requireExtensions(loc, 1, &E_GL_KHR_memory_scope_semantics, fnCandidate.getName().c_str()); + memorySemanticsCheck(loc, fnCandidate, callNode); + } + + break; + } + + case EOpAtomicAdd: + case EOpAtomicSubtract: + case EOpAtomicMin: + case EOpAtomicMax: + case EOpAtomicAnd: + case EOpAtomicOr: + case EOpAtomicXor: + case EOpAtomicExchange: + case EOpAtomicCompSwap: + case EOpAtomicLoad: + case EOpAtomicStore: + { + if (argp->size() > 3) { + requireExtensions(loc, 1, &E_GL_KHR_memory_scope_semantics, fnCandidate.getName().c_str()); + memorySemanticsCheck(loc, fnCandidate, callNode); + if ((callNode.getOp() == EOpAtomicAdd || callNode.getOp() == EOpAtomicExchange || + callNode.getOp() == EOpAtomicLoad || callNode.getOp() == EOpAtomicStore) && + (arg0->getType().getBasicType() == EbtFloat || + arg0->getType().getBasicType() == EbtDouble)) { + requireExtensions(loc, 1, &E_GL_EXT_shader_atomic_float, fnCandidate.getName().c_str()); + } else if ((callNode.getOp() == EOpAtomicAdd || callNode.getOp() == EOpAtomicExchange || + callNode.getOp() == EOpAtomicLoad || callNode.getOp() == EOpAtomicStore || + callNode.getOp() == EOpAtomicMin || callNode.getOp() == EOpAtomicMax) && + arg0->getType().isFloatingDomain()) { + requireExtensions(loc, 1, &E_GL_EXT_shader_atomic_float2, fnCandidate.getName().c_str()); + } + } else if (arg0->getType().getBasicType() == EbtInt64 || arg0->getType().getBasicType() == EbtUint64) { + const char* const extensions[2] = { E_GL_NV_shader_atomic_int64, + E_GL_EXT_shader_atomic_int64 }; + requireExtensions(loc, 2, extensions, fnCandidate.getName().c_str()); + } else if ((callNode.getOp() == EOpAtomicAdd || callNode.getOp() == EOpAtomicExchange || + callNode.getOp() == EOpAtomicMin || callNode.getOp() == EOpAtomicMax) && + arg0->getType().getBasicType() == EbtFloat16 && + (arg0->getType().getVectorSize() == 2 || arg0->getType().getVectorSize() == 4 )) { + requireExtensions(loc, 1, &E_GL_NV_shader_atomic_fp16_vector, fnCandidate.getName().c_str()); + } else if ((callNode.getOp() == EOpAtomicAdd || callNode.getOp() == EOpAtomicExchange) && + (arg0->getType().getBasicType() == EbtFloat || + arg0->getType().getBasicType() == EbtDouble)) { + requireExtensions(loc, 1, &E_GL_EXT_shader_atomic_float, fnCandidate.getName().c_str()); + } else if ((callNode.getOp() == EOpAtomicAdd || callNode.getOp() == EOpAtomicExchange || + callNode.getOp() == EOpAtomicLoad || callNode.getOp() == EOpAtomicStore || + callNode.getOp() == EOpAtomicMin || callNode.getOp() == EOpAtomicMax) && + arg0->getType().isFloatingDomain()) { + requireExtensions(loc, 1, &E_GL_EXT_shader_atomic_float2, fnCandidate.getName().c_str()); + } + + const TIntermTyped* base = TIntermediate::traverseLValueBase(arg0, true, true); + const char* errMsg = "Only l-values corresponding to shader block storage or shared variables can be used with " + "atomic memory functions."; + if (base) { + const TType* refType = (base->getType().isReference()) ? base->getType().getReferentType() : nullptr; + const TQualifier& qualifier = + (refType != nullptr) ? refType->getQualifier() : base->getType().getQualifier(); + if (qualifier.storage != EvqShared && qualifier.storage != EvqBuffer && + qualifier.storage != EvqtaskPayloadSharedEXT) + error(loc, errMsg, fnCandidate.getName().c_str(), ""); + } else { + error(loc, errMsg, fnCandidate.getName().c_str(), ""); + } + + break; + } + + case EOpInterpolateAtCentroid: + case EOpInterpolateAtSample: + case EOpInterpolateAtOffset: + case EOpInterpolateAtVertex: { + if (arg0->getType().getQualifier().storage != EvqVaryingIn) { + // Traverse down the left branch of arg0 to ensure this argument is a valid interpolant. + // + // For desktop GL >4.3 we effectively only need to ensure that arg0 represents an l-value from an + // input declaration. + // + // For desktop GL <= 4.3 and ES, we must also ensure that swizzling is not used + // + // For ES, we must also ensure that a field selection operator (i.e., '.') is not used on a named + // struct. + + const bool esProfile = isEsProfile(); + const bool swizzleOkay = !esProfile && (version >= 440); + + std::string interpolantErrorMsg = "first argument must be an interpolant, or interpolant-array element"; + bool isValid = true; // Assume that the interpolant is valid until we find a condition making it invalid + bool isIn = false; // Checks whether or not the interpolant is a shader input + bool structAccessOp = false; // Whether or not the previous node in the chain is a struct accessor + TIntermediate::traverseLValueBase( + arg0, swizzleOkay, false, + [&isValid, &isIn, &interpolantErrorMsg, esProfile, &structAccessOp](const TIntermNode& n) -> bool { + auto* type = n.getAsTyped(); + if (type) { + if (type->getType().getQualifier().storage == EvqVaryingIn) { + isIn = true; + } + // If a field accessor was used, it can only be used to access a field with an input block, not a struct. + if (structAccessOp && (type->getType().getBasicType() != EbtBlock)) { + interpolantErrorMsg += + ". Using the field of a named struct as an interpolant argument is not " + "allowed (ES-only)."; + isValid = false; + } + } + + // ES has different requirements for interpolants than GL + if (esProfile) { + // Swizzling will be taken care of by the 'swizzleOkay' argument passsed to traverseLValueBase, + // so we only ned to check whether or not a field accessor has been used with a named struct. + auto* binary = n.getAsBinaryNode(); + if (binary && (binary->getOp() == EOpIndexDirectStruct)) { + structAccessOp = true; + } + } + // Don't continue traversing if we know we have an invalid interpolant at this point. + return isValid; + }); + if (!isIn || !isValid) { + error(loc, interpolantErrorMsg.c_str(), fnCandidate.getName().c_str(), ""); + } + } + + if (callNode.getOp() == EOpInterpolateAtVertex) { + if (!arg0->getType().getQualifier().isExplicitInterpolation()) + error(loc, "argument must be qualified as __explicitInterpAMD in", "interpolant", ""); + else { + if (! (*argp)[1]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "vertex index", ""); + else { + unsigned vertexIdx = (*argp)[1]->getAsConstantUnion()->getConstArray()[0].getUConst(); + if (vertexIdx > 2) + error(loc, "must be in the range [0, 2]", "vertex index", ""); + } + } + } + } break; + + case EOpEmitStreamVertex: + case EOpEndStreamPrimitive: + if (version == 150) + requireExtensions(loc, Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5, "if the verison is 150 , the EmitStreamVertex and EndStreamPrimitive only support at extension GL_ARB_gpu_shader5/GL_NV_gpu_shader5"); + intermediate.setMultiStream(); + break; + + case EOpSubgroupClusteredAdd: + case EOpSubgroupClusteredMul: + case EOpSubgroupClusteredMin: + case EOpSubgroupClusteredMax: + case EOpSubgroupClusteredAnd: + case EOpSubgroupClusteredOr: + case EOpSubgroupClusteredXor: + // The as used in the subgroupClustered() operations must be: + // - An integral constant expression. + // - At least 1. + // - A power of 2. + if ((*argp)[1]->getAsConstantUnion() == nullptr) + error(loc, "argument must be compile-time constant", "cluster size", ""); + else { + int size = (*argp)[1]->getAsConstantUnion()->getConstArray()[0].getIConst(); + if (size < 1) + error(loc, "argument must be at least 1", "cluster size", ""); + else if (!IsPow2(size)) + error(loc, "argument must be a power of 2", "cluster size", ""); + } + break; + + case EOpSubgroupBroadcast: + case EOpSubgroupQuadBroadcast: + if (spvVersion.spv < EShTargetSpv_1_5) { + // must be an integral constant expression. + if ((*argp)[1]->getAsConstantUnion() == nullptr) + error(loc, "argument must be compile-time constant", "id", ""); + } + break; + + case EOpBarrier: + case EOpMemoryBarrier: + if (argp->size() > 0) { + requireExtensions(loc, 1, &E_GL_KHR_memory_scope_semantics, fnCandidate.getName().c_str()); + memorySemanticsCheck(loc, fnCandidate, callNode); + } + break; + + case EOpMix: + if (profile == EEsProfile && version < 310) { + // Look for specific signatures + if ((*argp)[0]->getAsTyped()->getBasicType() != EbtFloat && + (*argp)[1]->getAsTyped()->getBasicType() != EbtFloat && + (*argp)[2]->getAsTyped()->getBasicType() == EbtBool) { + requireExtensions(loc, 1, &E_GL_EXT_shader_integer_mix, "specific signature of builtin mix"); + } + } + + if (profile != EEsProfile && version < 450) { + if ((*argp)[0]->getAsTyped()->getBasicType() != EbtFloat && + (*argp)[0]->getAsTyped()->getBasicType() != EbtDouble && + (*argp)[1]->getAsTyped()->getBasicType() != EbtFloat && + (*argp)[1]->getAsTyped()->getBasicType() != EbtDouble && + (*argp)[2]->getAsTyped()->getBasicType() == EbtBool) { + requireExtensions(loc, 1, &E_GL_EXT_shader_integer_mix, fnCandidate.getName().c_str()); + } + } + + break; + case EOpLessThan: + case EOpLessThanEqual: + case EOpGreaterThan: + case EOpGreaterThanEqual: + case EOpEqual: + case EOpNotEqual: + if (profile != EEsProfile && version >= 150 && version < 450) { + if ((*argp)[1]->getAsTyped()->getBasicType() == EbtInt64 || + (*argp)[1]->getAsTyped()->getBasicType() == EbtUint64) + requireExtensions(loc, 1, &E_GL_NV_gpu_shader5, fnCandidate.getName().c_str()); + } + break; + case EOpFma: + case EOpFrexp: + case EOpLdexp: + if (profile != EEsProfile && version < 400) { + if ((*argp)[0]->getAsTyped()->getBasicType() == EbtFloat) { + requireExtensions(loc, Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5, fnCandidate.getName().c_str()); + } + } + + break; + case EOpCooperativeVectorMatMulNV: + case EOpCooperativeVectorMatMulAddNV: + { + int inputInterpIdx = 2; + int matrixInterpIdx = 5; + int biasInterpIdx = 8; + int MIdx = callNode.getOp() == EOpCooperativeVectorMatMulAddNV ? 9 : 6; + int KIdx = callNode.getOp() == EOpCooperativeVectorMatMulAddNV ? 10 : 7; + int matrixLayoutIdx = callNode.getOp() == EOpCooperativeVectorMatMulAddNV ? 11 : 8; + int transposeIdx = callNode.getOp() == EOpCooperativeVectorMatMulAddNV ? 12 : 9; + + if (!(*argp)[inputInterpIdx]->getAsTyped()->getType().getQualifier().isConstant()) + error(loc, "argument must be compile-time constant", "inputInterpretation", ""); + if (!(*argp)[matrixInterpIdx]->getAsTyped()->getType().getQualifier().isConstant()) + error(loc, "argument must be compile-time constant", "matrixInterpretation", ""); + if (callNode.getOp() == EOpCooperativeVectorMatMulAddNV) { + if (!(*argp)[biasInterpIdx]->getAsTyped()->getType().getQualifier().isConstant()) + error(loc, "argument must be compile-time constant", "biasInterpretation", ""); + } + if (!(*argp)[MIdx]->getAsTyped()->getType().getQualifier().isConstant()) + error(loc, "argument must be compile-time constant", "M", ""); + if (!(*argp)[KIdx]->getAsTyped()->getType().getQualifier().isConstant()) + error(loc, "argument must be compile-time constant", "K", ""); + if (!(*argp)[matrixLayoutIdx]->getAsTyped()->getType().getQualifier().isConstant()) + error(loc, "argument must be compile-time constant", "matrixLayout", ""); + if (!(*argp)[transposeIdx]->getAsTyped()->getType().getQualifier().isConstant()) + error(loc, "argument must be compile-time constant", "transpose", ""); + } + break; + case EOpCooperativeVectorOuterProductAccumulateNV: + if (!(*argp)[5]->getAsTyped()->getType().getQualifier().isConstant()) + error(loc, "argument must be compile-time constant", "matrixLayout", ""); + if (!(*argp)[6]->getAsTyped()->getType().getQualifier().isConstant()) + error(loc, "argument must be compile-time constant", "matrixInterpretation", ""); + break; + + case EOpCooperativeMatrixLoad: + case EOpCooperativeMatrixLoadNV: + case EOpCooperativeMatrixLoadTensorNV: + case EOpCooperativeMatrixStore: + case EOpCooperativeMatrixStoreNV: + case EOpCooperativeMatrixStoreTensorNV: + { + const TIntermTyped *arg1 = (*argp)[1]->getAsTyped(); + const TIntermTyped* base = TIntermediate::traverseLValueBase(arg1, true, true); + const char* errMsg = "Only l-values corresponding to storage block or shared variables can be used with " + "cooperative matrix load/store functions."; + if (base) { + const TType* refType = (base->getType().isReference()) ? base->getType().getReferentType() : nullptr; + const TQualifier& qualifier = + (refType != nullptr) ? refType->getQualifier() : base->getType().getQualifier(); + if (qualifier.storage != EvqShared && qualifier.storage != EvqBuffer) + error(loc, errMsg, fnCandidate.getName().c_str(), ""); + } else { + error(loc, errMsg, fnCandidate.getName().c_str(), ""); + } + } + break; + + default: + break; + } + + // Texture operations on texture objects (aside from texelFetch on a + // textureBuffer) require EXT_samplerless_texture_functions. + switch (callNode.getOp()) { + case EOpTextureQuerySize: + case EOpTextureQueryLevels: + case EOpTextureQuerySamples: + case EOpTextureFetch: + case EOpTextureFetchOffset: + { + const TSampler& sampler = fnCandidate[0].type->getSampler(); + + const bool isTexture = sampler.isTexture() && !sampler.isCombined(); + const bool isBuffer = sampler.isBuffer(); + const bool isFetch = callNode.getOp() == EOpTextureFetch || callNode.getOp() == EOpTextureFetchOffset; + + if (isTexture && (!isBuffer || !isFetch)) + requireExtensions(loc, 1, &E_GL_EXT_samplerless_texture_functions, fnCandidate.getName().c_str()); + + break; + } + + case EOpConstructSaturated: + { + auto &sequence = callNode.getAsAggregate()->getSequence(); + if (sequence.size() != 2) { + error(loc, "requires exactly two parameters", "", ""); + } + auto &op0Type = sequence[0]->getAsTyped()->getType(); + auto &op1Type = sequence[1]->getAsTyped()->getType(); + if (op0Type.getBasicType() != EbtFloatE5M2 && op0Type.getBasicType() != EbtFloatE4M3) { + error(loc, "first parameter must have floate5m2 or floate4m3 basic type", "", ""); + } + if (op1Type.getBasicType() == EbtFloatE5M2 || op1Type.getBasicType() == EbtFloatE4M3) { + error(loc, "second parameter must not have floate5m2 or floate4m3 basic type", "", ""); + } + + if (!(op0Type.isScalar() || op0Type.isVector() || op0Type.isCoopMatKHR())) { + error(loc, "first parameter must be scalar, vector, or cooperative matrix", "", ""); + } + if (!(op1Type.isScalar() || op1Type.isVector() || op1Type.isCoopMatKHR())) { + error(loc, "second parameter must be scalar, vector, or cooperative matrix", "", ""); + } + if (!(op0Type.sameElementShape(op1Type) || op0Type.sameCoopMatShape(op1Type))) { + error(loc, "types must match other than scalar type and coopmat Use", "", ""); + } + break; + } + case EOpTensorReadARM: + case EOpTensorWriteARM: + { + const TType &tensorType = (*argp)[0]->getAsTyped()->getType(); + + // Check that coordinates argument length matches rank of tensor argument. + int tensorRank = tensorType.getTensorRankARM(); + const TArraySizes *coordArgArrayTy = (*argp)[1]->getAsTyped()->getType().getArraySizes(); + assert(coordArgArrayTy->getNumDims() == 1 && "expecting 1D coordinate array"); + if (coordArgArrayTy->getDimSize(0) != tensorRank) { + error(loc, "number of coordinates does not match tensor rank", "coord", ""); + } + + // Check that tensor element type matches data argument. + TBasicType eltTy = tensorType.getBasicType(); + TBasicType argTy = (*argp)[2]->getAsTyped()->getType().getBasicType(); + if (eltTy != argTy) { + error(loc, "", "data", "data argument type (%s) does not match tensor element type (%s)", + TType::getBasicString(argTy), TType::getBasicString(eltTy)); + } + + // Check optional tensor operands. + if (argp->size() > 3) { + const TIntermConstantUnion* opArg = (*argp)[3]->getAsConstantUnion(); + if (!opArg) { + error(loc, "tensor operands argument must be a constant integral expression", "tensorOps", ""); + } + const unsigned int ops = opArg ? opArg->getConstArray()[0].getUConst() : 0; + const int gl_TensorOperandsOutOfBoundsValueARM = 0x2; + if (ops & gl_TensorOperandsOutOfBoundsValueARM) { + // Out-of-bounds values can only be used with reads. + if (callNode.getOp() != EOpTensorReadARM) { + error(loc, "out-of-bounds value is only valid with tensorReadARM", "tensorOps", ""); + } + // Check that an out-of-bounds value is present. + if (argp->size() == 4) { + error(loc, "expecting out-of-bounds value as next argument", "tensorOps", ""); + } else { + // Check constantness of out-of-bounds value. + const TIntermConstantUnion* oobArg = (*argp)[4]->getAsConstantUnion(); + if (!oobArg) { + error(loc, "argument following gl_TensorOperandsOutOfBoundsValueARM must be constant", "vararg", + ""); + } else if (oobArg->getType().getBasicType() != tensorType.getBasicType()) { + // The type of the OOB value does not match the tensor type. + error(loc, "", "vararg", + "out-of-bounds value type (%s) does not match tensor element type (%s)", + TType::getBasicString(oobArg->getBasicType()), TType::getBasicString(eltTy)); + + } + } + } + } + break; + } + + case EOpTensorSizeARM: + { + unsigned int tensorRank = (*argp)[0]->getAsTyped()->getType().getTensorRankARM(); + const TIntermConstantUnion *dimArg = (*argp)[1]->getAsConstantUnion(); + if (dimArg) { + if (dimArg->getConstArray()[0].getUConst() >= tensorRank) { + error(loc, "dimension argument exceeds tensor rank", "dim", ""); + } + } else { + error(loc, "dimension argument must be constant", "dim", ""); + } + break; + } + + default: + break; + } + + if (callNode.isSubgroup()) { + // these require SPIR-V 1.3 + if (spvVersion.spv > 0 && spvVersion.spv < EShTargetSpv_1_3) + error(loc, "requires SPIR-V 1.3", "subgroup op", ""); + + // Check that if extended types are being used that the correct extensions are enabled. + if (arg0 != nullptr) { + const TType& type = arg0->getType(); + bool enhanced = intermediate.getEnhancedMsgs(); + switch (type.getBasicType()) { + default: + break; + case EbtInt8: + case EbtUint8: + requireExtensions(loc, 1, &E_GL_EXT_shader_subgroup_extended_types_int8, type.getCompleteString(enhanced).c_str()); + break; + case EbtInt16: + case EbtUint16: + requireExtensions(loc, 1, &E_GL_EXT_shader_subgroup_extended_types_int16, type.getCompleteString(enhanced).c_str()); + break; + case EbtInt64: + case EbtUint64: + requireExtensions(loc, 1, &E_GL_EXT_shader_subgroup_extended_types_int64, type.getCompleteString(enhanced).c_str()); + break; + case EbtFloat16: + requireExtensions(loc, 1, &E_GL_EXT_shader_subgroup_extended_types_float16, type.getCompleteString(enhanced).c_str()); + break; + } + } + } +} + + +// Deprecated! Use PureOperatorBuiltins == true instead, in which case this +// functionality is handled in builtInOpCheck() instead of here. +// +// Do additional checking of built-in function calls that were not mapped +// to built-in operations (e.g., texturing functions). +// +// Assumes there has been a semantically correct match to a built-in function. +// +void TParseContext::nonOpBuiltInCheck(const TSourceLoc& loc, const TFunction& fnCandidate, TIntermAggregate& callNode) +{ + // Further maintenance of this function is deprecated, because the "correct" + // future-oriented design is to not have to do string compares on function names. + + // If PureOperatorBuiltins == true, then all built-ins should be mapped + // to a TOperator, and this function would then never get called. + + assert(PureOperatorBuiltins == false); + + // built-in texturing functions get their return value precision from the precision of the sampler + if (fnCandidate.getType().getQualifier().precision == EpqNone && + fnCandidate.getParamCount() > 0 && fnCandidate[0].type->getBasicType() == EbtSampler) + callNode.getQualifier().precision = callNode.getSequence()[0]->getAsTyped()->getQualifier().precision; + + if (fnCandidate.getName().compare(0, 7, "texture") == 0) { + if (fnCandidate.getName().compare(0, 13, "textureGather") == 0) { + TString featureString = fnCandidate.getName() + "(...)"; + const char* feature = featureString.c_str(); + profileRequires(loc, EEsProfile, 310, nullptr, feature); + + int compArg = -1; // track which argument, if any, is the constant component argument + if (fnCandidate.getName().compare("textureGatherOffset") == 0) { + // GL_ARB_texture_gather is good enough for 2D non-shadow textures with no component argument + if (fnCandidate[0].type->getSampler().dim == Esd2D && ! fnCandidate[0].type->getSampler().shadow && fnCandidate.getParamCount() == 3) + profileRequires(loc, ~EEsProfile, 400, E_GL_ARB_texture_gather, feature); + else + profileRequires(loc, ~EEsProfile, 400, E_GL_ARB_gpu_shader5, feature); + int offsetArg = fnCandidate[0].type->getSampler().shadow ? 3 : 2; + if (! callNode.getSequence()[offsetArg]->getAsConstantUnion()) + profileRequires(loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, + "non-constant offset argument"); + if (! fnCandidate[0].type->getSampler().shadow) + compArg = 3; + } else if (fnCandidate.getName().compare("textureGatherOffsets") == 0) { + profileRequires(loc, ~EEsProfile, 400, E_GL_ARB_gpu_shader5, feature); + if (! fnCandidate[0].type->getSampler().shadow) + compArg = 3; + // check for constant offsets + int offsetArg = fnCandidate[0].type->getSampler().shadow ? 3 : 2; + if (! callNode.getSequence()[offsetArg]->getAsConstantUnion() && !extensionTurnedOn(E_GL_NV_gpu_shader5)) + error(loc, "must be a compile-time constant:", feature, "offsets argument"); + } else if (fnCandidate.getName().compare("textureGather") == 0) { + // More than two arguments needs gpu_shader5, and rectangular or shadow needs gpu_shader5, + // otherwise, need GL_ARB_texture_gather. + if (fnCandidate.getParamCount() > 2 || fnCandidate[0].type->getSampler().dim == EsdRect || fnCandidate[0].type->getSampler().shadow) { + profileRequires(loc, ~EEsProfile, 400, E_GL_ARB_gpu_shader5, feature); + if (! fnCandidate[0].type->getSampler().shadow) + compArg = 2; + } else + profileRequires(loc, ~EEsProfile, 400, E_GL_ARB_texture_gather, feature); + } + + if (compArg > 0 && compArg < fnCandidate.getParamCount()) { + if (callNode.getSequence()[compArg]->getAsConstantUnion()) { + int value = callNode.getSequence()[compArg]->getAsConstantUnion()->getConstArray()[0].getIConst(); + if (value < 0 || value > 3) + error(loc, "must be 0, 1, 2, or 3:", feature, "component argument"); + } else + error(loc, "must be a compile-time constant:", feature, "component argument"); + } + } else { + // this is only for functions not starting "textureGather"... + if (fnCandidate.getName().find("Offset") != TString::npos) { + + // Handle texture-offset limits checking + int arg = -1; + if (fnCandidate.getName().compare("textureOffset") == 0) + arg = 2; + else if (fnCandidate.getName().compare("texelFetchOffset") == 0) + arg = 3; + else if (fnCandidate.getName().compare("textureProjOffset") == 0) + arg = 2; + else if (fnCandidate.getName().compare("textureLodOffset") == 0) + arg = 3; + else if (fnCandidate.getName().compare("textureProjLodOffset") == 0) + arg = 3; + else if (fnCandidate.getName().compare("textureGradOffset") == 0) + arg = 4; + else if (fnCandidate.getName().compare("textureProjGradOffset") == 0) + arg = 4; + + if (arg > 0) { + if (! callNode.getSequence()[arg]->getAsConstantUnion()) { + if (!extensionTurnedOn(E_GL_EXT_texture_offset_non_const)) + error(loc, "argument must be compile-time constant", "texel offset", ""); + } + else { + const TType& type = callNode.getSequence()[arg]->getAsTyped()->getType(); + for (int c = 0; c < type.getVectorSize(); ++c) { + int offset = callNode.getSequence()[arg]->getAsConstantUnion()->getConstArray()[c].getIConst(); + if (offset > resources.maxProgramTexelOffset || offset < resources.minProgramTexelOffset) + error(loc, "value is out of range:", "texel offset", "[gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]"); + } + } + } + } + } + } + + // GL_ARB_shader_texture_image_samples + if (fnCandidate.getName().compare(0, 14, "textureSamples") == 0 || fnCandidate.getName().compare(0, 12, "imageSamples") == 0) + profileRequires(loc, ~EEsProfile, 450, E_GL_ARB_shader_texture_image_samples, "textureSamples and imageSamples"); + + if (fnCandidate.getName().compare(0, 11, "imageAtomic") == 0) { + const TType& imageType = callNode.getSequence()[0]->getAsTyped()->getType(); + if (imageType.getSampler().type == EbtInt || imageType.getSampler().type == EbtUint) { + if (imageType.getQualifier().getFormat() != ElfR32i && imageType.getQualifier().getFormat() != ElfR32ui) + error(loc, "only supported on image with format r32i or r32ui", fnCandidate.getName().c_str(), ""); + } else { + if (fnCandidate.getName().compare(0, 19, "imageAtomicExchange") != 0) + error(loc, "only supported on integer images", fnCandidate.getName().c_str(), ""); + else if (imageType.getQualifier().getFormat() != ElfR32f && isEsProfile()) + error(loc, "only supported on image with format r32f", fnCandidate.getName().c_str(), ""); + } + } +} + +// +// Do any extra checking for a user function call. +// +void TParseContext::userFunctionCallCheck(const TSourceLoc& loc, TIntermAggregate& callNode) +{ + TIntermSequence& arguments = callNode.getSequence(); + + for (int i = 0; i < (int)arguments.size(); ++i) + samplerConstructorLocationCheck(loc, "call argument", arguments[i]); +} + +// +// Emit an error if this is a sampler constructor +// +void TParseContext::samplerConstructorLocationCheck(const TSourceLoc& loc, const char* token, TIntermNode* node) +{ + if (node->getAsOperator() && node->getAsOperator()->getOp() == EOpConstructTextureSampler) + error(loc, "sampler constructor must appear at point of use", token, ""); +} + +// +// Handle seeing a built-in constructor in a grammar production. +// +TFunction* TParseContext::handleConstructorCall(const TSourceLoc& loc, const TPublicType& publicType) +{ + TType type(publicType); + type.getQualifier().precision = EpqNone; + + if (type.isArray()) { + profileRequires(loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed constructor"); + profileRequires(loc, EEsProfile, 300, nullptr, "arrayed constructor"); + } + + // Reuse EOpConstructTextureSampler for bindless image constructor + // uvec2 imgHandle; + // imageLoad(image1D(imgHandle), 0); + if (type.isImage() && extensionTurnedOn(E_GL_ARB_bindless_texture)) + { + intermediate.setBindlessImageMode(currentCaller, AstRefTypeFunc); + } + + TOperator op = intermediate.mapTypeToConstructorOp(type); + + if (op == EOpNull) { + if (intermediate.getEnhancedMsgs() && type.getBasicType() == EbtSampler) + error(loc, "function not supported in this version; use texture() instead", "texture*D*", ""); + else + error(loc, "cannot construct this type", type.getBasicString(), ""); + op = EOpConstructFloat; + TType errorType(EbtFloat); + type.shallowCopy(errorType); + } + + TString empty(""); + + return new TFunction(&empty, type, op); +} + +// Handle seeing a precision qualifier in the grammar. +void TParseContext::handlePrecisionQualifier(const TSourceLoc& /*loc*/, TQualifier& qualifier, TPrecisionQualifier precision) +{ + if (obeyPrecisionQualifiers()) + qualifier.precision = precision; +} + +// Check for messages to give on seeing a precision qualifier used in a +// declaration in the grammar. +void TParseContext::checkPrecisionQualifier(const TSourceLoc& loc, TPrecisionQualifier) +{ + if (precisionManager.shouldWarnAboutDefaults()) { + warn(loc, "all default precisions are highp; use precision statements to quiet warning, e.g.:\n" + " \"precision mediump int; precision highp float;\"", "", ""); + precisionManager.defaultWarningGiven(); + } +} + +// +// Same error message for all places assignments don't work. +// +void TParseContext::assignError(const TSourceLoc& loc, const char* op, TString left, TString right) +{ + error(loc, "", op, "cannot convert from '%s' to '%s'", + right.c_str(), left.c_str()); +} + +// +// Same error message for all places unary operations don't work. +// +void TParseContext::unaryOpError(const TSourceLoc& loc, const char* op, TString operand) +{ + error(loc, " wrong operand type", op, + "no operation '%s' exists that takes an operand of type %s (or there is no acceptable conversion)", + op, operand.c_str()); +} + +// +// Same error message for all binary operations don't work. +// +void TParseContext::binaryOpError(const TSourceLoc& loc, const char* op, TString left, TString right) +{ + error(loc, " wrong operand types:", op, + "no operation '%s' exists that takes a left-hand operand of type '%s' and " + "a right operand of type '%s' (or there is no acceptable conversion)", + op, left.c_str(), right.c_str()); +} + +// +// A basic type of EbtVoid is a key that the name string was seen in the source, but +// it was not found as a variable in the symbol table. If so, give the error +// message and insert a dummy variable in the symbol table to prevent future errors. +// +void TParseContext::variableCheck(TIntermTyped*& nodePtr) +{ + TIntermSymbol* symbol = nodePtr->getAsSymbolNode(); + if (! symbol) + return; + + if (symbol->getType().getBasicType() == EbtVoid) { + const char *extraInfoFormat = ""; + if (spvVersion.vulkan != 0 && symbol->getName() == "gl_VertexID") { + extraInfoFormat = "(Did you mean gl_VertexIndex?)"; + } else if (spvVersion.vulkan != 0 && symbol->getName() == "gl_InstanceID") { + extraInfoFormat = "(Did you mean gl_InstanceIndex?)"; + } + error(symbol->getLoc(), "undeclared identifier", symbol->getName().c_str(), extraInfoFormat); + + // Add to symbol table to prevent future error messages on the same name + if (symbol->getName().size() > 0) { + TVariable* fakeVariable = new TVariable(&symbol->getName(), TType(EbtFloat)); + symbolTable.insert(*fakeVariable); + + // substitute a symbol node for this new variable + nodePtr = intermediate.addSymbol(*fakeVariable, symbol->getLoc()); + } + } else { + switch (symbol->getQualifier().storage) { + case EvqPointCoord: + profileRequires(symbol->getLoc(), ENoProfile, 120, nullptr, "gl_PointCoord"); + break; + default: break; // some compilers want this + } + } +} + +// +// Both test and if necessary, spit out an error, to see if the node is really +// an l-value that can be operated on this way. +// +// Returns true if there was an error. +// +bool TParseContext::lValueErrorCheck(const TSourceLoc& loc, const char* op, TIntermTyped* node) +{ + TIntermBinary* binaryNode = node->getAsBinaryNode(); + + if (binaryNode) { + bool errorReturn = false; + + switch(binaryNode->getOp()) { + case EOpIndexDirect: + case EOpIndexIndirect: + // ... tessellation control shader ... + // If a per-vertex output variable is used as an l-value, it is a + // compile-time or link-time error if the expression indicating the + // vertex index is not the identifier gl_InvocationID. + if (language == EShLangTessControl) { + const TType& leftType = binaryNode->getLeft()->getType(); + if (leftType.getQualifier().storage == EvqVaryingOut && ! leftType.getQualifier().patch && binaryNode->getLeft()->getAsSymbolNode()) { + // we have a per-vertex output + const TIntermSymbol* rightSymbol = binaryNode->getRight()->getAsSymbolNode(); + if (! rightSymbol || rightSymbol->getQualifier().builtIn != EbvInvocationId) + error(loc, "tessellation-control per-vertex output l-value must be indexed with gl_InvocationID", "[]", ""); + } + } + break; // left node is checked by base class + case EOpVectorSwizzle: + errorReturn = lValueErrorCheck(loc, op, binaryNode->getLeft()); + if (!errorReturn) { + int offset[4] = {0,0,0,0}; + + TIntermTyped* rightNode = binaryNode->getRight(); + TIntermAggregate *aggrNode = rightNode->getAsAggregate(); + + for (TIntermSequence::iterator p = aggrNode->getSequence().begin(); + p != aggrNode->getSequence().end(); p++) { + int value = (*p)->getAsTyped()->getAsConstantUnion()->getConstArray()[0].getIConst(); + offset[value]++; + if (offset[value] > 1) { + error(loc, " l-value of swizzle cannot have duplicate components", op, "", ""); + + return true; + } + } + } + + return errorReturn; + default: + break; + } + + if (errorReturn) { + error(loc, " l-value required", op, "", ""); + return true; + } + } + + if (binaryNode && binaryNode->getOp() == EOpIndexDirectStruct && binaryNode->getLeft()->isReference()) + return false; + + // Let the base class check errors + if (TParseContextBase::lValueErrorCheck(loc, op, node)) + return true; + + const char* symbol = nullptr; + TIntermSymbol* symNode = node->getAsSymbolNode(); + if (symNode != nullptr) + symbol = symNode->getName().c_str(); + + const char* message = nullptr; + switch (node->getQualifier().storage) { + case EvqVaryingIn: message = "can't modify shader input"; break; + case EvqInstanceId: message = "can't modify gl_InstanceID"; break; + case EvqVertexId: message = "can't modify gl_VertexID"; break; + case EvqFace: message = "can't modify gl_FrontFace"; break; + case EvqFragCoord: message = "can't modify gl_FragCoord"; break; + case EvqPointCoord: message = "can't modify gl_PointCoord"; break; + case EvqFragDepth: + intermediate.setDepthReplacing(); + // "In addition, it is an error to statically write to gl_FragDepth in the fragment shader." + if (isEsProfile() && intermediate.getEarlyFragmentTests()) + message = "can't modify gl_FragDepth if using early_fragment_tests"; + break; + case EvqFragStencil: + intermediate.setStencilReplacing(); + // "In addition, it is an error to statically write to gl_FragDepth in the fragment shader." + if (isEsProfile() && intermediate.getEarlyFragmentTests()) + message = "can't modify EvqFragStencil if using early_fragment_tests"; + break; + + case EvqtaskPayloadSharedEXT: + if (language == EShLangMesh) + message = "can't modify variable with storage qualifier taskPayloadSharedEXT in mesh shaders"; + break; + default: + break; + } + + if (message == nullptr && binaryNode == nullptr && symNode == nullptr) { + error(loc, " l-value required", op, "", ""); + + return true; + } + + // + // Everything else is okay, no error. + // + if (message == nullptr) + return false; + + // + // If we get here, we have an error and a message. + // + if (symNode) + error(loc, " l-value required", op, "\"%s\" (%s)", symbol, message); + else + error(loc, " l-value required", op, "(%s)", message); + + return true; +} + +// Test for and give an error if the node can't be read from. +void TParseContext::rValueErrorCheck(const TSourceLoc& loc, const char* op, TIntermTyped* node) +{ + // Let the base class check errors + TParseContextBase::rValueErrorCheck(loc, op, node); + + TIntermSymbol* symNode = node->getAsSymbolNode(); + if (!(symNode && symNode->getQualifier().isWriteOnly())) // base class checks + if (symNode && symNode->getQualifier().isExplicitInterpolation()) + error(loc, "can't read from explicitly-interpolated object: ", op, symNode->getName().c_str()); + + // local_size_{xyz} must be assigned or specialized before gl_WorkGroupSize can be assigned. + if(node->getQualifier().builtIn == EbvWorkGroupSize && + !(intermediate.isLocalSizeSet() || intermediate.isLocalSizeSpecialized())) + error(loc, "can't read from gl_WorkGroupSize before a fixed workgroup size has been declared", op, ""); +} + +// +// Both test, and if necessary spit out an error, to see if the node is really +// a constant. +// +void TParseContext::constantValueCheck(TIntermTyped* node, const char* token) +{ + if (! node->getQualifier().isConstant()) + error(node->getLoc(), "constant expression required", token, ""); +} + +// +// Both test, and if necessary spit out an error, to see if the node is really +// a 32-bit integer or can implicitly convert to one. +// +void TParseContext::integerCheck(const TIntermTyped* node, const char* token) +{ + auto from_type = node->getBasicType(); + if ((from_type == EbtInt || from_type == EbtUint || + intermediate.canImplicitlyPromote(from_type, EbtInt, EOpNull) || + intermediate.canImplicitlyPromote(from_type, EbtUint, EOpNull)) && node->isScalar()) + return; + + error(node->getLoc(), "scalar integer expression required", token, ""); +} + +// +// Both test, and if necessary spit out an error, to see if the node is really +// supported as an array index. +// +void TParseContext::arrayIndexCheck(const TIntermTyped* node, const char* token) +{ + auto from_type = node->getBasicType(); + + if ((from_type == EbtInt64 || from_type == EbtUint64) && + extensionTurnedOn(E_GL_EXT_shader_64bit_indexing)) + return; + + integerCheck(node, token); +} + +// +// Both test, and if necessary spit out an error, to see if we are currently +// globally scoped. +// +void TParseContext::globalCheck(const TSourceLoc& loc, const char* token) +{ + if (! symbolTable.atGlobalLevel()) + error(loc, "not allowed in nested scope", token, ""); +} + +// +// Reserved errors for GLSL. +// +void TParseContext::reservedErrorCheck(const TSourceLoc& loc, const TString& identifier) +{ + // "Identifiers starting with "gl_" are reserved for use by OpenGL, and may not be + // declared in a shader; this results in a compile-time error." + if (! symbolTable.atBuiltInLevel()) { + if (builtInName(identifier) && !extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) + // The extension GL_EXT_spirv_intrinsics allows us to declare identifiers starting with "gl_". + error(loc, "identifiers starting with \"gl_\" are reserved", identifier.c_str(), ""); + + // "__" are not supposed to be an error. ES 300 (and desktop) added the clarification: + // "In addition, all identifiers containing two consecutive underscores (__) are + // reserved; using such a name does not itself result in an error, but may result + // in undefined behavior." + // however, before that, ES tests required an error. + if (identifier.find("__") != TString::npos && !extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) { + // The extension GL_EXT_spirv_intrinsics allows us to declare identifiers starting with "__". + if (isEsProfile() && version < 300) + error(loc, "identifiers containing consecutive underscores (\"__\") are reserved, and an error if version < 300", identifier.c_str(), ""); + else + warn(loc, "identifiers containing consecutive underscores (\"__\") are reserved", identifier.c_str(), ""); + } + } +} + +// +// Reserved errors for the preprocessor. +// +void TParseContext::reservedPpErrorCheck(const TSourceLoc& loc, const char* identifier, const char* op) +{ + // "__" are not supposed to be an error. ES 300 (and desktop) added the clarification: + // "All macro names containing two consecutive underscores ( __ ) are reserved; + // defining such a name does not itself result in an error, but may result in + // undefined behavior. All macro names prefixed with "GL_" ("GL" followed by a + // single underscore) are also reserved, and defining such a name results in a + // compile-time error." + // however, before that, ES tests required an error. + if (strncmp(identifier, "GL_", 3) == 0 && !extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) + // The extension GL_EXT_spirv_intrinsics allows us to declare macros prefixed with "GL_". + ppError(loc, "names beginning with \"GL_\" can't be (un)defined:", op, identifier); + else if (strncmp(identifier, "defined", 8) == 0) + if (relaxedErrors()) + ppWarn(loc, "\"defined\" is (un)defined:", op, identifier); + else + ppError(loc, "\"defined\" can't be (un)defined:", op, identifier); + else if (strstr(identifier, "__") != nullptr && !extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) { + // The extension GL_EXT_spirv_intrinsics allows us to declare macros prefixed with "__". + if (isEsProfile() && version >= 300 && + (strcmp(identifier, "__LINE__") == 0 || + strcmp(identifier, "__FILE__") == 0 || + strcmp(identifier, "__VERSION__") == 0)) + ppError(loc, "predefined names can't be (un)defined:", op, identifier); + else { + if (isEsProfile() && version < 300 && !relaxedErrors()) + ppError(loc, "names containing consecutive underscores are reserved, and an error if version < 300:", op, identifier); + else + ppWarn(loc, "names containing consecutive underscores are reserved:", op, identifier); + } + } +} + +// +// See if this version/profile allows use of the line-continuation character '\'. +// +// Returns true if a line continuation should be done. +// +bool TParseContext::lineContinuationCheck(const TSourceLoc& loc, bool endOfComment) +{ + const char* message = "line continuation"; + + bool lineContinuationAllowed = (isEsProfile() && version >= 300) || + (!isEsProfile() && (version >= 420 || extensionTurnedOn(E_GL_ARB_shading_language_420pack))); + + if (endOfComment) { + if (lineContinuationAllowed) + warn(loc, "used at end of comment; the following line is still part of the comment", message, ""); + else + warn(loc, "used at end of comment, but this version does not provide line continuation", message, ""); + + return lineContinuationAllowed; + } + + if (relaxedErrors()) { + if (! lineContinuationAllowed) + warn(loc, "not allowed in this version", message, ""); + return true; + } else { + profileRequires(loc, EEsProfile, 300, nullptr, message); + profileRequires(loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, message); + } + + return lineContinuationAllowed; +} + +bool TParseContext::builtInName(const TString& identifier) +{ + return identifier.compare(0, 3, "gl_") == 0; +} + +// +// Make sure there is enough data and not too many arguments provided to the +// constructor to build something of the type of the constructor. Also returns +// the type of the constructor. +// +// Part of establishing type is establishing specialization-constness. +// We don't yet know "top down" whether type is a specialization constant, +// but a const constructor can becomes a specialization constant if any of +// its children are, subject to KHR_vulkan_glsl rules: +// +// - int(), uint(), and bool() constructors for type conversions +// from any of the following types to any of the following types: +// * int +// * uint +// * bool +// - vector versions of the above conversion constructors +// +// Returns true if there was an error in construction. +// +bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, TFunction& function, TOperator op, TType& type) +{ + // See if the constructor does not establish the main type, only requalifies + // it, in which case the type comes from the argument instead of from the + // constructor function. + switch (op) { + case EOpConstructNonuniform: + if (node != nullptr && node->getAsTyped() != nullptr) { + type.shallowCopy(node->getAsTyped()->getType()); + type.getQualifier().makeTemporary(); + type.getQualifier().nonUniform = true; + } + break; + default: + type.shallowCopy(function.getType()); + break; + } + + TString constructorString; + if (intermediate.getEnhancedMsgs()) + constructorString.append(type.getCompleteString(true, false, false, true)).append(" constructor"); + else + constructorString.append("constructor"); + + // See if it's a matrix + bool constructingMatrix = false; + switch (op) { + case EOpConstructTextureSampler: + return constructorTextureSamplerError(loc, function); + case EOpConstructMat2x2: + case EOpConstructMat2x3: + case EOpConstructMat2x4: + case EOpConstructMat3x2: + case EOpConstructMat3x3: + case EOpConstructMat3x4: + case EOpConstructMat4x2: + case EOpConstructMat4x3: + case EOpConstructMat4x4: + case EOpConstructDMat2x2: + case EOpConstructDMat2x3: + case EOpConstructDMat2x4: + case EOpConstructDMat3x2: + case EOpConstructDMat3x3: + case EOpConstructDMat3x4: + case EOpConstructDMat4x2: + case EOpConstructDMat4x3: + case EOpConstructDMat4x4: + case EOpConstructF16Mat2x2: + case EOpConstructF16Mat2x3: + case EOpConstructF16Mat2x4: + case EOpConstructF16Mat3x2: + case EOpConstructF16Mat3x3: + case EOpConstructF16Mat3x4: + case EOpConstructF16Mat4x2: + case EOpConstructF16Mat4x3: + case EOpConstructF16Mat4x4: + constructingMatrix = true; + break; + default: + break; + } + + // + // Walk the arguments for first-pass checks and collection of information. + // + + int size = 0; + bool constType = true; + bool specConstType = false; // value is only valid if constType is true + bool full = false; + bool overFull = false; + bool matrixInMatrix = false; + bool arrayArg = false; + bool floatArgument = false; + bool intArgument = false; + for (int arg = 0; arg < function.getParamCount(); ++arg) { + if (function[arg].type->isArray()) { + if (function[arg].type->isUnsizedArray()) { + // Can't construct from an unsized array. + error(loc, "array argument must be sized", constructorString.c_str(), ""); + return true; + } + arrayArg = true; + } + if (constructingMatrix && function[arg].type->isMatrix()) + matrixInMatrix = true; + + // 'full' will go to true when enough args have been seen. If we loop + // again, there is an extra argument. + if (full) { + // For vectors and matrices, it's okay to have too many components + // available, but not okay to have unused arguments. + overFull = true; + } + + size += function[arg].type->computeNumComponents(); + if (op != EOpConstructStruct && ! type.isArray() && size >= type.computeNumComponents()) + full = true; + + if (! function[arg].type->getQualifier().isConstant()) + constType = false; + if (function[arg].type->getQualifier().isSpecConstant()) + specConstType = true; + if (function[arg].type->isFloatingDomain()) + floatArgument = true; + if (function[arg].type->isIntegerDomain()) + intArgument = true; + if (type.isStruct()) { + if (function[arg].type->contains16BitFloat()) { + requireFloat16Arithmetic(loc, constructorString.c_str(), "can't construct structure containing 16-bit type"); + } + if (function[arg].type->contains16BitInt()) { + requireInt16Arithmetic(loc, constructorString.c_str(), "can't construct structure containing 16-bit type"); + } + if (function[arg].type->contains8BitInt()) { + requireInt8Arithmetic(loc, constructorString.c_str(), "can't construct structure containing 8-bit type"); + } + } + } + if (op == EOpConstructNonuniform) + constType = false; + + switch (op) { + case EOpConstructFloat16: + case EOpConstructF16Vec2: + case EOpConstructF16Vec3: + case EOpConstructF16Vec4: + if (type.isArray()) + requireFloat16Arithmetic(loc, constructorString.c_str(), "16-bit arrays not supported"); + if (type.isVector() && function.getParamCount() != 1) + requireFloat16Arithmetic(loc, constructorString.c_str(), "16-bit vectors only take vector types"); + break; + case EOpConstructUint16: + case EOpConstructU16Vec2: + case EOpConstructU16Vec3: + case EOpConstructU16Vec4: + case EOpConstructInt16: + case EOpConstructI16Vec2: + case EOpConstructI16Vec3: + case EOpConstructI16Vec4: + if (type.isArray()) + requireInt16Arithmetic(loc, constructorString.c_str(), "16-bit arrays not supported"); + if (type.isVector() && function.getParamCount() != 1) + requireInt16Arithmetic(loc, constructorString.c_str(), "16-bit vectors only take vector types"); + break; + case EOpConstructUint8: + case EOpConstructU8Vec2: + case EOpConstructU8Vec3: + case EOpConstructU8Vec4: + case EOpConstructInt8: + case EOpConstructI8Vec2: + case EOpConstructI8Vec3: + case EOpConstructI8Vec4: + if (type.isArray()) + requireInt8Arithmetic(loc, constructorString.c_str(), "8-bit arrays not supported"); + if (type.isVector() && function.getParamCount() != 1) + requireInt8Arithmetic(loc, constructorString.c_str(), "8-bit vectors only take vector types"); + break; + default: + break; + } + + // inherit constness from children + if (constType) { + bool makeSpecConst; + // Finish pinning down spec-const semantics + if (specConstType) { + switch (op) { + case EOpConstructInt8: + case EOpConstructInt: + case EOpConstructUint: + case EOpConstructBool: + case EOpConstructBVec2: + case EOpConstructBVec3: + case EOpConstructBVec4: + case EOpConstructIVec2: + case EOpConstructIVec3: + case EOpConstructIVec4: + case EOpConstructUVec2: + case EOpConstructUVec3: + case EOpConstructUVec4: + case EOpConstructUint8: + case EOpConstructInt16: + case EOpConstructUint16: + case EOpConstructInt64: + case EOpConstructUint64: + case EOpConstructI8Vec2: + case EOpConstructI8Vec3: + case EOpConstructI8Vec4: + case EOpConstructU8Vec2: + case EOpConstructU8Vec3: + case EOpConstructU8Vec4: + case EOpConstructI16Vec2: + case EOpConstructI16Vec3: + case EOpConstructI16Vec4: + case EOpConstructU16Vec2: + case EOpConstructU16Vec3: + case EOpConstructU16Vec4: + case EOpConstructI64Vec2: + case EOpConstructI64Vec3: + case EOpConstructI64Vec4: + case EOpConstructU64Vec2: + case EOpConstructU64Vec3: + case EOpConstructU64Vec4: + // This was the list of valid ones, if they aren't converting from float + // and aren't making an array. + makeSpecConst = ! floatArgument && ! type.isArray(); + break; + + case EOpConstructVec2: + case EOpConstructVec3: + case EOpConstructVec4: + // This was the list of valid ones, if they aren't converting from int + // and aren't making an array. + makeSpecConst = ! intArgument && !type.isArray(); + break; + + case EOpConstructCooperativeMatrixNV: + case EOpConstructCooperativeMatrixKHR: + case EOpConstructStruct: + { + const char *specConstantCompositeExt[] = { E_GL_EXT_spec_constant_composites }; + if (checkExtensionsRequested(loc, 1, specConstantCompositeExt, "spec constant aggregate constructor")) { + makeSpecConst = true; + } else { + makeSpecConst = false; + } + } + break; + + default: + // anything else wasn't white-listed in the spec as a conversion + makeSpecConst = false; + break; + } + } else + makeSpecConst = false; + + if (makeSpecConst) + type.getQualifier().makeSpecConstant(); + else if (specConstType) + type.getQualifier().makeTemporary(); + else + type.getQualifier().storage = EvqConst; + } + + if (type.isArray()) { + if (function.getParamCount() == 0) { + error(loc, "array constructor must have at least one argument", constructorString.c_str(), ""); + return true; + } + + if (type.isUnsizedArray()) { + // auto adapt the constructor type to the number of arguments + type.changeOuterArraySize(function.getParamCount()); + } else if (type.getOuterArraySize() != function.getParamCount()) { + error(loc, "array constructor needs one argument per array element", constructorString.c_str(), ""); + return true; + } + + if (type.isArrayOfArrays()) { + // Types have to match, but we're still making the type. + // Finish making the type, and the comparison is done later + // when checking for conversion. + TArraySizes& arraySizes = *type.getArraySizes(); + + // At least the dimensionalities have to match. + if (! function[0].type->isArray() || + arraySizes.getNumDims() != function[0].type->getArraySizes()->getNumDims() + 1) { + error(loc, "array constructor argument not correct type to construct array element", constructorString.c_str(), ""); + return true; + } + + if (arraySizes.isInnerUnsized()) { + // "Arrays of arrays ..., and the size for any dimension is optional" + // That means we need to adopt (from the first argument) the other array sizes into the type. + for (int d = 1; d < arraySizes.getNumDims(); ++d) { + if (arraySizes.getDimSize(d) == UnsizedArraySize) { + arraySizes.setDimSize(d, function[0].type->getArraySizes()->getDimSize(d - 1)); + } + } + } + } + } + + if (arrayArg && op != EOpConstructStruct && ! type.isArrayOfArrays()) { + error(loc, "constructing non-array constituent from array argument", constructorString.c_str(), ""); + return true; + } + + if (matrixInMatrix && ! type.isArray()) { + profileRequires(loc, ENoProfile, 120, nullptr, "constructing matrix from matrix"); + + // "If a matrix argument is given to a matrix constructor, + // it is a compile-time error to have any other arguments." + if (function.getParamCount() != 1) + error(loc, "matrix constructed from matrix can only have one argument", constructorString.c_str(), ""); + return false; + } + + if (overFull) { + error(loc, "too many arguments", constructorString.c_str(), ""); + return true; + } + + if (op == EOpConstructStruct && ! type.isArray() && (int)type.getStruct()->size() != function.getParamCount()) { + error(loc, "Number of constructor parameters does not match the number of structure fields", constructorString.c_str(), ""); + return true; + } + + if ((op != EOpConstructStruct && size != 1 && size < type.computeNumComponents()) || + (op == EOpConstructStruct && size < type.computeNumComponents())) { + error(loc, "not enough data provided for construction", constructorString.c_str(), ""); + return true; + } + + if (type.isCoopMat() && function.getParamCount() != 1) { + error(loc, "wrong number of arguments", constructorString.c_str(), ""); + return true; + } + if (type.isCoopMat() && + !(function[0].type->isScalar() || function[0].type->isCoopMat())) { + error(loc, "Cooperative matrix constructor argument must be scalar or cooperative matrix", constructorString.c_str(), ""); + return true; + } + + TIntermTyped* typed = node->getAsTyped(); + if (type.isCoopMat() && typed->getType().isCoopMat() && + ((extensionTurnedOn(E_GL_NV_cooperative_matrix2) && !type.sameCoopMatShape(typed->getType())) || + (!extensionTurnedOn(E_GL_NV_cooperative_matrix2) && !type.sameCoopMatShapeAndUse(typed->getType())))) { + error(loc, "Cooperative matrix type parameters mismatch", constructorString.c_str(), ""); + return true; + } + + if (typed == nullptr) { + error(loc, "constructor argument does not have a type", constructorString.c_str(), ""); + return true; + } + if (op != EOpConstructStruct && op != EOpConstructNonuniform && typed->getBasicType() == EbtSampler) { + if (op == EOpConstructUVec2 && extensionTurnedOn(E_GL_ARB_bindless_texture)) { + intermediate.setBindlessTextureMode(currentCaller, AstRefTypeFunc); + } + else { + error(loc, "cannot convert a sampler", constructorString.c_str(), ""); + return true; + } + } + if (op != EOpConstructStruct && typed->isAtomic()) { + error(loc, "cannot convert an atomic_uint", constructorString.c_str(), ""); + return true; + } + if (typed->getBasicType() == EbtVoid) { + error(loc, "cannot convert a void", constructorString.c_str(), ""); + return true; + } + + return false; +} + +// Verify all the correct semantics for constructing a combined texture/sampler. +// Return true if the semantics are incorrect. +bool TParseContext::constructorTextureSamplerError(const TSourceLoc& loc, const TFunction& function) +{ + TString constructorName = function.getType().getBasicTypeString(); // TODO: performance: should not be making copy; interface needs to change + const char* token = constructorName.c_str(); + // verify the constructor for bindless texture, the input must be ivec2 or uvec2 + if (function.getParamCount() == 1) { + TType* pType = function[0].type; + TBasicType basicType = pType->getBasicType(); + bool isIntegerVec2 = ((basicType == EbtUint || basicType == EbtInt) && pType->getVectorSize() == 2); + bool bindlessMode = extensionTurnedOn(E_GL_ARB_bindless_texture); + if (isIntegerVec2 && bindlessMode) { + if (pType->getSampler().isImage()) + intermediate.setBindlessImageMode(currentCaller, AstRefTypeFunc); + else + intermediate.setBindlessTextureMode(currentCaller, AstRefTypeFunc); + return false; + } else { + if (!bindlessMode) + error(loc, "sampler-constructor requires the extension GL_ARB_bindless_texture enabled", token, ""); + else + error(loc, "sampler-constructor requires the input to be ivec2 or uvec2", token, ""); + return true; + } + } + + // exactly two arguments needed + if (function.getParamCount() != 2) { + error(loc, "sampler-constructor requires two arguments", token, ""); + return true; + } + + // For now, not allowing arrayed constructors, the rest of this function + // is set up to allow them, if this test is removed: + if (function.getType().isArray()) { + error(loc, "sampler-constructor cannot make an array of samplers", token, ""); + return true; + } + + // first argument + // * the constructor's first argument must be a texture type + // * the dimensionality (1D, 2D, 3D, Cube, Rect, Buffer, MS, and Array) + // of the texture type must match that of the constructed sampler type + // (that is, the suffixes of the type of the first argument and the + // type of the constructor will be spelled the same way) + if (function[0].type->getBasicType() != EbtSampler || + ! function[0].type->getSampler().isTexture() || + function[0].type->isArray()) { + error(loc, "sampler-constructor first argument must be a scalar *texture* type", token, ""); + return true; + } + + // simulate the first argument's impact on the result type, so it can be compared with the encapsulated operator!=() + TSampler texture = function.getType().getSampler(); + texture.setCombined(false); + texture.shadow = false; + if (function[0].type->getSampler().isTileAttachmentQCOM()) { + //TSampler& texture = const_cast(function).getWritableType().getSampler(); + texture.image = true; + texture.tileQCOM = true; + } + if (texture != function[0].type->getSampler()) { + error(loc, "sampler-constructor first argument must be a *texture* type" + " matching the dimensionality and sampled type of the constructor", token, ""); + return true; + } + + // second argument + // * the constructor's second argument must be a scalar of type + // *sampler* or *samplerShadow* + if ( function[1].type->getBasicType() != EbtSampler || + ! function[1].type->getSampler().isPureSampler() || + function[1].type->isArray()) { + error(loc, "sampler-constructor second argument must be a scalar sampler or samplerShadow", token, ""); + return true; + } + + return false; +} + +// Checks to see if a void variable has been declared and raise an error message for such a case +// +// returns true in case of an error +// +bool TParseContext::voidErrorCheck(const TSourceLoc& loc, const TString& identifier, const TBasicType basicType) +{ + if (basicType == EbtVoid) { + error(loc, "illegal use of type 'void'", identifier.c_str(), ""); + return true; + } + + return false; +} + +// Checks to see if the node (for the expression) contains a scalar boolean expression or not +void TParseContext::boolCheck(const TSourceLoc& loc, const TIntermTyped* type) +{ + if (type->getBasicType() != EbtBool || type->isArray() || type->isMatrix() || type->isVector()) + error(loc, "boolean expression expected", "", ""); +} + +// This function checks to see if the node (for the expression) contains a scalar boolean expression or not +void TParseContext::boolCheck(const TSourceLoc& loc, const TPublicType& pType) +{ + if (pType.basicType != EbtBool || pType.arraySizes || pType.matrixCols > 1 || (pType.vectorSize > 1)) + error(loc, "boolean expression expected", "", ""); +} + +void TParseContext::samplerCheck(const TSourceLoc& loc, const TType& type, const TString& identifier, TIntermTyped* /*initializer*/) +{ + // Check that the appropriate extension is enabled if external sampler is used. + // There are two extensions. The correct one must be used based on GLSL version. + if (type.getBasicType() == EbtSampler && type.getSampler().isExternal()) { + if (version < 300) { + requireExtensions(loc, 1, &E_GL_OES_EGL_image_external, "samplerExternalOES"); + } else { + requireExtensions(loc, 1, &E_GL_OES_EGL_image_external_essl3, "samplerExternalOES"); + } + } + if (type.getSampler().isYuv()) { + requireExtensions(loc, 1, &E_GL_EXT_YUV_target, "__samplerExternal2DY2YEXT"); + } + + if (type.getQualifier().storage == EvqUniform) + return; + + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtSampler)) { + // For bindless texture, sampler can be declared as an struct member + if (extensionTurnedOn(E_GL_ARB_bindless_texture)) { + if (type.getSampler().isImage()) + intermediate.setBindlessImageMode(currentCaller, AstRefTypeVar); + else + intermediate.setBindlessTextureMode(currentCaller, AstRefTypeVar); + } + else { + error(loc, "non-uniform struct contains a sampler or image:", type.getBasicTypeString().c_str(), identifier.c_str()); + } + } + else if (type.getBasicType() == EbtSampler && type.getQualifier().storage != EvqUniform) { + // For bindless texture, sampler can be declared as an input/output/block member + if (extensionTurnedOn(E_GL_ARB_bindless_texture)) { + if (type.getSampler().isImage()) + intermediate.setBindlessImageMode(currentCaller, AstRefTypeVar); + else + intermediate.setBindlessTextureMode(currentCaller, AstRefTypeVar); + } + else { + // non-uniform sampler + // not yet: okay if it has an initializer + // if (! initializer) + if (type.getSampler().isAttachmentEXT() && type.getQualifier().storage != EvqTileImageEXT) + error(loc, "can only be used in tileImageEXT variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str()); + else if (type.getQualifier().storage != EvqTileImageEXT) + error(loc, "sampler/image types can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str()); + } + } + else if (type.isTensorARM() && type.getQualifier().storage != EvqUniform) { + error(loc, "tensorARM types can only be used in uniform variables or function parameters:", "tensorARM", identifier.c_str()); + } +} + +void TParseContext::atomicUintCheck(const TSourceLoc& loc, const TType& type, const TString& identifier) +{ + if (type.getQualifier().storage == EvqUniform) + return; + + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtAtomicUint)) + error(loc, "non-uniform struct contains an atomic_uint:", type.getBasicTypeString().c_str(), identifier.c_str()); + else if (type.getBasicType() == EbtAtomicUint && type.getQualifier().storage != EvqUniform) + error(loc, "atomic_uints can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str()); +} + +void TParseContext::accStructCheck(const TSourceLoc& loc, const TType& type, const TString& identifier) +{ + if (type.getQualifier().storage == EvqUniform) + return; + + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtAccStruct)) + error(loc, "non-uniform struct contains an accelerationStructureNV:", type.getBasicTypeString().c_str(), identifier.c_str()); + else if (type.getBasicType() == EbtAccStruct && type.getQualifier().storage != EvqUniform) + error(loc, "accelerationStructureNV can only be used in uniform variables or function parameters:", + type.getBasicTypeString().c_str(), identifier.c_str()); + +} + +void TParseContext::hitObjectEXTCheck(const TSourceLoc & loc, const TType & type, const TString & identifier) +{ + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtHitObjectEXT)) { + error(loc, "struct is not allowed to contain hitObjectEXT:", type.getTypeName().c_str(), identifier.c_str()); + } else if (type.getBasicType() == EbtHitObjectEXT) { + TStorageQualifier qualifier = type.getQualifier().storage; + if (qualifier != EvqGlobal && qualifier != EvqTemporary) { + error(loc, "hitObjectEXT can only be declared in global or function scope with no storage qualifier:", "hitObjectEXT", identifier.c_str()); + } + } +} +void TParseContext::hitObjectNVCheck(const TSourceLoc & loc, const TType & type, const TString & identifier) +{ + if (type.getBasicType() == EbtStruct && ( containsFieldWithBasicType(type, EbtHitObjectNV))) { + error(loc, "struct is not allowed to contain hitObjectNV:", type.getTypeName().c_str(), identifier.c_str()); + } else if ((type.getBasicType() == EbtHitObjectNV)) { + TStorageQualifier qualifier = type.getQualifier().storage; + if (qualifier != EvqGlobal && qualifier != EvqTemporary) { + error(loc, "hitObjectNV can only be declared in global or function scope with no storage qualifier:", "hitObjectNV", identifier.c_str()); + } + } +} + +void TParseContext::transparentOpaqueCheck(const TSourceLoc& loc, const TType& type, const TString& identifier) +{ + if (parsingBuiltins) + return; + + if (type.getQualifier().storage != EvqUniform) + return; + + if (type.containsNonOpaque()) { + // Vulkan doesn't allow transparent uniforms outside of blocks + if (spvVersion.vulkan > 0 && !spvVersion.vulkanRelaxed) + vulkanRemoved(loc, "non-opaque uniforms outside a block"); + // OpenGL wants locations on these (unless they are getting automapped) + if (spvVersion.openGl > 0 && !type.getQualifier().hasLocation() && !intermediate.getAutoMapLocations()) + error(loc, "non-opaque uniform variables need a layout(location=L)", identifier.c_str(), ""); + } +} + +// +// Qualifier checks knowing the qualifier and that it is a member of a struct/block. +// +void TParseContext::memberQualifierCheck(glslang::TPublicType& publicType) +{ + globalQualifierFixCheck(publicType.loc, publicType.qualifier, true); + checkNoShaderLayouts(publicType.loc, publicType.shaderQualifiers); + if (publicType.qualifier.isNonUniform()) { + error(publicType.loc, "not allowed on block or structure members", "nonuniformEXT", ""); + publicType.qualifier.nonUniform = false; + } + if (publicType.qualifier.isPatch()) { + error(publicType.loc, "not allowed on block or structure members", + "patch", ""); + } +} + +// +// Check/fix just a full qualifier (no variables or types yet, but qualifier is complete) at global level. +// +void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& qualifier, bool isMemberCheck, const TPublicType* publicType) +{ + bool nonuniformOkay = false; + + // move from parameter/unknown qualifiers to pipeline in/out qualifiers + switch (qualifier.storage) { + case EvqIn: + profileRequires(loc, ENoProfile, 130, nullptr, "in for stage inputs"); + profileRequires(loc, EEsProfile, 300, nullptr, "in for stage inputs"); + qualifier.storage = EvqVaryingIn; + nonuniformOkay = true; + break; + case EvqOut: + profileRequires(loc, ENoProfile, 130, nullptr, "out for stage outputs"); + profileRequires(loc, EEsProfile, 300, nullptr, "out for stage outputs"); + qualifier.storage = EvqVaryingOut; + if (intermediate.isInvariantAll()) + qualifier.invariant = true; + break; + case EvqInOut: + qualifier.storage = EvqVaryingIn; + error(loc, "cannot use 'inout' at global scope", "", ""); + break; + case EvqGlobal: + case EvqTemporary: + nonuniformOkay = true; + break; + case EvqUniform: + // According to GLSL spec: The std430 qualifier is supported only for shader storage blocks; a shader using + // the std430 qualifier on a uniform block will fail to compile. + // Only check the global declaration: layout(std430) uniform; + if (blockName == nullptr && + qualifier.layoutPacking == ElpStd430) + { + requireExtensions(loc, 1, &E_GL_EXT_scalar_block_layout, "default std430 layout for uniform"); + } + + if (publicType != nullptr && publicType->isImage() && + (qualifier.layoutFormat > ElfExtSizeGuard && qualifier.layoutFormat < ElfCount)) + qualifier.layoutFormat = mapLegacyLayoutFormat(qualifier.layoutFormat, publicType->sampler.getBasicType()); + + break; + default: + break; + } + + if (!nonuniformOkay && qualifier.isNonUniform()) + error(loc, "for non-parameter, can only apply to 'in' or no storage qualifier", "nonuniformEXT", ""); + + if (qualifier.isSpirvByReference()) + error(loc, "can only apply to parameter", "spirv_by_reference", ""); + + if (qualifier.isSpirvLiteral()) + error(loc, "can only apply to parameter", "spirv_literal", ""); + + // Storage qualifier isn't ready for memberQualifierCheck, we should skip invariantCheck for it. + if (!isMemberCheck || structNestingLevel > 0) + invariantCheck(loc, qualifier); + + if (qualifier.isFullQuads()) { + if (qualifier.storage != EvqVaryingIn) + error(loc, "can only apply to input layout", "full_quads ", ""); + intermediate.setReqFullQuadsMode(); + } + + if (qualifier.isQuadDeriv()) { + if (qualifier.storage != EvqVaryingIn) + error(loc, "can only apply to input layout", "quad_derivatives", ""); + intermediate.setQuadDerivMode(); + } +} + +// +// Check a full qualifier and type (no variable yet) at global level. +// +void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQualifier& qualifier, const TPublicType& publicType) +{ + if (! symbolTable.atGlobalLevel()) + return; + + if (!(publicType.userDef && publicType.userDef->isReference()) && !publicType.isTensorARM() && !parsingBuiltins) { + if (qualifier.isMemoryQualifierImageAndSSBOOnly() && ! publicType.isImage() && publicType.qualifier.storage != EvqBuffer) { + error(loc, "memory qualifiers cannot be used on this type", "", ""); + } else if (qualifier.isMemory() && (publicType.basicType != EbtSampler) && !publicType.qualifier.isUniformOrBuffer()) { + error(loc, "memory qualifiers cannot be used on this type", "", ""); + } + } + + if (qualifier.storage == EvqBuffer && + publicType.basicType != EbtBlock && + !qualifier.hasBufferReference()) + error(loc, "buffers can be declared only as blocks", "buffer", ""); + + if (qualifier.storage != EvqVaryingIn && publicType.basicType == EbtDouble && + extensionTurnedOn(E_GL_ARB_vertex_attrib_64bit) && language == EShLangVertex && + version < 400) { + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 410, E_GL_ARB_gpu_shader_fp64, "vertex-shader `double` type"); + } + if (qualifier.storage != EvqVaryingIn && qualifier.storage != EvqVaryingOut) + return; + + if (publicType.shaderQualifiers.hasBlendEquation()) + error(loc, "can only be applied to a standalone 'out'", "blend equation", ""); + + // now, knowing it is a shader in/out, do all the in/out semantic checks + + if (isTypeInt(publicType.basicType) || publicType.basicType == EbtDouble) { + profileRequires(loc, EEsProfile, 300, nullptr, "non-float shader input/output"); + profileRequires(loc, ~EEsProfile, 130, nullptr, "non-float shader input/output"); + } + + if (!qualifier.flat && !qualifier.isExplicitInterpolation() && !qualifier.isPervertexNV() && !qualifier.isPervertexEXT()) { + if (isTypeInt(publicType.basicType) || + publicType.basicType == EbtDouble || + (publicType.userDef && ( publicType.userDef->containsBasicType(EbtInt) + || publicType.userDef->containsBasicType(EbtUint) + || publicType.userDef->contains16BitInt() + || publicType.userDef->contains8BitInt() + || publicType.userDef->contains64BitInt() + || publicType.userDef->containsDouble()))) { + if (qualifier.storage == EvqVaryingIn && language == EShLangFragment) + error(loc, "must be qualified as flat", TType::getBasicString(publicType.basicType), GetStorageQualifierString(qualifier.storage)); + else if (qualifier.storage == EvqVaryingOut && language == EShLangVertex && version == 300) + error(loc, "must be qualified as flat", TType::getBasicString(publicType.basicType), GetStorageQualifierString(qualifier.storage)); + } + } + + if (qualifier.isPatch() && qualifier.isInterpolation()) + error(loc, "cannot use interpolation qualifiers with patch", "patch", ""); + + // Only "patch in" is supported via GL_NV_gpu_shader5 + if (! symbolTable.atBuiltInLevel() && qualifier.isPatch() && + (language == EShLangGeometry) && qualifier.storage != EvqVaryingIn && + extensionTurnedOn(E_GL_NV_gpu_shader5)) + error(loc, "only 'patch in' is supported in this stage:", "patch", "geometry"); + + if (qualifier.isTaskPayload() && publicType.basicType == EbtBlock) + error(loc, "taskPayloadSharedEXT variables should not be declared as interface blocks", "taskPayloadSharedEXT", ""); + + if (qualifier.isTaskMemory() && publicType.basicType != EbtBlock) + error(loc, "taskNV variables can be declared only as blocks", "taskNV", ""); + + if (qualifier.storage == EvqVaryingIn) { + switch (language) { + case EShLangVertex: + if (publicType.basicType == EbtStruct) { + error(loc, "cannot be a structure", GetStorageQualifierString(qualifier.storage), ""); + return; + } + if (publicType.arraySizes) { + requireProfile(loc, ~EEsProfile, "vertex input arrays"); + profileRequires(loc, ENoProfile, 150, nullptr, "vertex input arrays"); + } + if (publicType.basicType == EbtDouble) { + const char* const float64_attrib[] = {E_GL_NV_gpu_shader5, E_GL_ARB_vertex_attrib_64bit}; + const int Num_float64_attrib = sizeof(float64_attrib) / sizeof(float64_attrib[0]); + profileRequires(loc, ~EEsProfile, 410, Num_float64_attrib, float64_attrib, "vertex-shader `double` type input"); + } + if (qualifier.isAuxiliary() || qualifier.isInterpolation() || qualifier.isMemory() || qualifier.invariant) + error(loc, "vertex input cannot be further qualified", "", ""); + break; + case EShLangFragment: + if (publicType.userDef) { + profileRequires(loc, EEsProfile, 300, nullptr, "fragment-shader struct input"); + profileRequires(loc, ~EEsProfile, 150, nullptr, "fragment-shader struct input"); + if (publicType.userDef->containsStructure()) + requireProfile(loc, ~EEsProfile, "fragment-shader struct input containing structure"); + if (publicType.userDef->containsArray()) + requireProfile(loc, ~EEsProfile, "fragment-shader struct input containing an array"); + } + break; + case EShLangCompute: + if (! symbolTable.atBuiltInLevel()) + error(loc, "global storage input qualifier cannot be used in a compute shader", "in", ""); + break; + case EShLangTessControl: + if (qualifier.patch) + error(loc, "can only use on output in tessellation-control shader", "patch", ""); + break; + default: + break; + } + } else { + // qualifier.storage == EvqVaryingOut + switch (language) { + case EShLangVertex: + if (publicType.userDef) { + profileRequires(loc, EEsProfile, 300, nullptr, "vertex-shader struct output"); + profileRequires(loc, ~EEsProfile, 150, nullptr, "vertex-shader struct output"); + if (publicType.userDef->containsStructure()) + requireProfile(loc, ~EEsProfile, "vertex-shader struct output containing structure"); + if (publicType.userDef->containsArray()) + requireProfile(loc, ~EEsProfile, "vertex-shader struct output containing an array"); + } + + break; + case EShLangFragment: + profileRequires(loc, EEsProfile, 300, nullptr, "fragment shader output"); + if (publicType.basicType == EbtStruct) { + error(loc, "cannot be a structure", GetStorageQualifierString(qualifier.storage), ""); + return; + } + if (publicType.matrixRows > 0) { + error(loc, "cannot be a matrix", GetStorageQualifierString(qualifier.storage), ""); + return; + } + if (qualifier.isAuxiliary()) + error(loc, "can't use auxiliary qualifier on a fragment output", "centroid/sample/patch", ""); + if (qualifier.isInterpolation()) + error(loc, "can't use interpolation qualifier on a fragment output", "flat/smooth/noperspective", ""); + if (publicType.basicType == EbtDouble || publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64) + error(loc, "cannot contain a double, int64, or uint64", GetStorageQualifierString(qualifier.storage), ""); + break; + + case EShLangCompute: + error(loc, "global storage output qualifier cannot be used in a compute shader", "out", ""); + break; + case EShLangTessEvaluation: + if (qualifier.patch) + error(loc, "can only use on input in tessellation-evaluation shader", "patch", ""); + break; + default: + break; + } + } +} + +// +// Merge characteristics of the 'src' qualifier into the 'dst'. +// If there is duplication, issue error messages, unless 'force' +// is specified, which means to just override default settings. +// +// Also, when force is false, it will be assumed that 'src' follows +// 'dst', for the purpose of error checking order for versions +// that require specific orderings of qualifiers. +// +void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, const TQualifier& src, bool force) +{ + // Multiple auxiliary qualifiers (mostly done later by 'individual qualifiers') + if (src.isAuxiliary() && dst.isAuxiliary()) + error(loc, "can only have one auxiliary qualifier (centroid, patch, and sample)", "", ""); + + // Multiple interpolation qualifiers (mostly done later by 'individual qualifiers') + if (src.isInterpolation() && dst.isInterpolation()) + error(loc, "can only have one interpolation qualifier (flat, smooth, noperspective, __explicitInterpAMD)", "", ""); + + // Ordering + if (! force && ((!isEsProfile() && version < 420) || + (isEsProfile() && version < 310)) + && ! extensionTurnedOn(E_GL_ARB_shading_language_420pack)) { + // non-function parameters + if (src.isNoContraction() && (dst.invariant || dst.isInterpolation() || dst.isAuxiliary() || dst.storage != EvqTemporary || dst.precision != EpqNone)) + error(loc, "precise qualifier must appear first", "", ""); + if (src.invariant && (dst.isInterpolation() || dst.isAuxiliary() || dst.storage != EvqTemporary || dst.precision != EpqNone)) + error(loc, "invariant qualifier must appear before interpolation, storage, and precision qualifiers ", "", ""); + else if (src.isInterpolation() && (dst.isAuxiliary() || dst.storage != EvqTemporary || dst.precision != EpqNone)) + error(loc, "interpolation qualifiers must appear before storage and precision qualifiers", "", ""); + else if (src.isAuxiliary() && (dst.storage != EvqTemporary || dst.precision != EpqNone)) + error(loc, "Auxiliary qualifiers (centroid, patch, and sample) must appear before storage and precision qualifiers", "", ""); + else if (src.storage != EvqTemporary && (dst.precision != EpqNone)) + error(loc, "precision qualifier must appear as last qualifier", "", ""); + + // function parameters + if (src.isNoContraction() && (dst.storage == EvqConst || dst.storage == EvqIn || dst.storage == EvqOut)) + error(loc, "precise qualifier must appear first", "", ""); + if (src.storage == EvqConst && (dst.storage == EvqIn || dst.storage == EvqOut)) + error(loc, "in/out must appear before const", "", ""); + } + + // Storage qualification + if (dst.storage == EvqTemporary || dst.storage == EvqGlobal) + dst.storage = src.storage; + else if ((dst.storage == EvqIn && src.storage == EvqOut) || + (dst.storage == EvqOut && src.storage == EvqIn)) + dst.storage = EvqInOut; + else if ((dst.storage == EvqIn && src.storage == EvqConst) || + (dst.storage == EvqConst && src.storage == EvqIn)) + dst.storage = EvqConstReadOnly; + else if (src.storage != EvqTemporary && + src.storage != EvqGlobal) + error(loc, "too many storage qualifiers", GetStorageQualifierString(src.storage), ""); + + // Precision qualifiers + if (! force && src.precision != EpqNone && dst.precision != EpqNone) + error(loc, "only one precision qualifier allowed", GetPrecisionQualifierString(src.precision), ""); + if (dst.precision == EpqNone || (force && src.precision != EpqNone)) + dst.precision = src.precision; + + if (!force && ((src.coherent && (dst.devicecoherent || dst.queuefamilycoherent || dst.workgroupcoherent || dst.subgroupcoherent || dst.shadercallcoherent)) || + (src.devicecoherent && (dst.coherent || dst.queuefamilycoherent || dst.workgroupcoherent || dst.subgroupcoherent || dst.shadercallcoherent)) || + (src.queuefamilycoherent && (dst.coherent || dst.devicecoherent || dst.workgroupcoherent || dst.subgroupcoherent || dst.shadercallcoherent)) || + (src.workgroupcoherent && (dst.coherent || dst.devicecoherent || dst.queuefamilycoherent || dst.subgroupcoherent || dst.shadercallcoherent)) || + (src.subgroupcoherent && (dst.coherent || dst.devicecoherent || dst.queuefamilycoherent || dst.workgroupcoherent || dst.shadercallcoherent)) || + (src.shadercallcoherent && (dst.coherent || dst.devicecoherent || dst.queuefamilycoherent || dst.workgroupcoherent || dst.subgroupcoherent)))) { + error(loc, "only one coherent/devicecoherent/queuefamilycoherent/workgroupcoherent/subgroupcoherent/shadercallcoherent qualifier allowed", + GetPrecisionQualifierString(src.precision), ""); + } + + // Layout qualifiers + mergeObjectLayoutQualifiers(dst, src, false); + + // individual qualifiers + bool repeated = false; + #define MERGE_SINGLETON(field) repeated |= dst.field && src.field; dst.field |= src.field; + MERGE_SINGLETON(invariant); + MERGE_SINGLETON(centroid); + MERGE_SINGLETON(smooth); + MERGE_SINGLETON(flat); + MERGE_SINGLETON(specConstant); + MERGE_SINGLETON(noContraction); + MERGE_SINGLETON(nopersp); + MERGE_SINGLETON(explicitInterp); + MERGE_SINGLETON(perPrimitiveNV); + MERGE_SINGLETON(perViewNV); + MERGE_SINGLETON(perTaskNV); + MERGE_SINGLETON(patch); + MERGE_SINGLETON(sample); + MERGE_SINGLETON(coherent); + MERGE_SINGLETON(devicecoherent); + MERGE_SINGLETON(queuefamilycoherent); + MERGE_SINGLETON(workgroupcoherent); + MERGE_SINGLETON(subgroupcoherent); + MERGE_SINGLETON(shadercallcoherent); + MERGE_SINGLETON(nonprivate); + MERGE_SINGLETON(volatil); + MERGE_SINGLETON(nontemporal); + MERGE_SINGLETON(restrict); + MERGE_SINGLETON(readonly); + MERGE_SINGLETON(writeonly); + MERGE_SINGLETON(nonUniform); + + // SPIR-V storage class qualifier (GL_EXT_spirv_intrinsics) + dst.spirvStorageClass = src.spirvStorageClass; + + // SPIR-V decorate qualifiers (GL_EXT_spirv_intrinsics) + if (src.hasSpirvDecorate()) { + if (dst.hasSpirvDecorate()) { + const TSpirvDecorate& srcSpirvDecorate = src.getSpirvDecorate(); + TSpirvDecorate& dstSpirvDecorate = dst.getSpirvDecorate(); + for (auto& decorate : srcSpirvDecorate.decorates) { + if (dstSpirvDecorate.decorates.find(decorate.first) != dstSpirvDecorate.decorates.end()) + error(loc, "too many SPIR-V decorate qualifiers", "spirv_decorate", "(decoration=%u)", decorate.first); + else + dstSpirvDecorate.decorates.insert(decorate); + } + + for (auto& decorateId : srcSpirvDecorate.decorateIds) { + if (dstSpirvDecorate.decorateIds.find(decorateId.first) != dstSpirvDecorate.decorateIds.end()) + error(loc, "too many SPIR-V decorate qualifiers", "spirv_decorate_id", "(decoration=%u)", decorateId.first); + else + dstSpirvDecorate.decorateIds.insert(decorateId); + } + + for (auto& decorateString : srcSpirvDecorate.decorateStrings) { + if (dstSpirvDecorate.decorates.find(decorateString.first) != dstSpirvDecorate.decorates.end()) + error(loc, "too many SPIR-V decorate qualifiers", "spirv_decorate_string", "(decoration=%u)", decorateString.first); + else + dstSpirvDecorate.decorateStrings.insert(decorateString); + } + } else { + dst.spirvDecorate = src.spirvDecorate; + } + } + + if (repeated) + error(loc, "replicated qualifiers", "", ""); +} + +void TParseContext::setDefaultPrecision(const TSourceLoc& loc, TPublicType& publicType, TPrecisionQualifier qualifier) +{ + TBasicType basicType = publicType.basicType; + + if (basicType == EbtSampler) { + defaultSamplerPrecision[computeSamplerTypeIndex(publicType.sampler)] = qualifier; + + return; // all is well + } + + if (basicType == EbtInt || basicType == EbtFloat) { + if (publicType.isScalar()) { + defaultPrecision[basicType] = qualifier; + if (basicType == EbtInt) { + defaultPrecision[EbtUint] = qualifier; + precisionManager.explicitIntDefaultSeen(); + } else + precisionManager.explicitFloatDefaultSeen(); + + return; // all is well + } + } + + if (basicType == EbtAtomicUint) { + if (qualifier != EpqHigh) + error(loc, "can only apply highp to atomic_uint", "precision", ""); + + return; + } + + error(loc, "cannot apply precision statement to this type; use 'float', 'int' or a sampler type", TType::getBasicString(basicType), ""); +} + +// used to flatten the sampler type space into a single dimension +// correlates with the declaration of defaultSamplerPrecision[] +int TParseContext::computeSamplerTypeIndex(TSampler& sampler) +{ + int arrayIndex = sampler.arrayed ? 1 : 0; + int shadowIndex = sampler.shadow ? 1 : 0; + int externalIndex = sampler.isExternal() ? 1 : 0; + int imageIndex = sampler.isImageClass() ? 1 : 0; + int msIndex = sampler.isMultiSample() ? 1 : 0; + + int flattened = EsdNumDims * (EbtNumTypes * (2 * (2 * (2 * (2 * arrayIndex + msIndex) + imageIndex) + shadowIndex) + + externalIndex) + sampler.type) + sampler.dim; + assert(flattened < maxSamplerIndex); + + return flattened; +} + +TPrecisionQualifier TParseContext::getDefaultPrecision(TPublicType& publicType) +{ + if (publicType.basicType == EbtSampler) + return defaultSamplerPrecision[computeSamplerTypeIndex(publicType.sampler)]; + else + return defaultPrecision[publicType.basicType]; +} + +void TParseContext::precisionQualifierCheck(const TSourceLoc& loc, TBasicType baseType, TQualifier& qualifier, bool hasTypeParameter) +{ + // Built-in symbols are allowed some ambiguous precisions, to be pinned down + // later by context. + if (! obeyPrecisionQualifiers() || parsingBuiltins) + return; + + if (baseType == EbtAtomicUint && qualifier.precision != EpqNone && qualifier.precision != EpqHigh) + error(loc, "atomic counters can only be highp", "atomic_uint", ""); + + if (hasTypeParameter) + return; + + if (baseType == EbtFloat || baseType == EbtUint || baseType == EbtInt || baseType == EbtSampler || baseType == EbtAtomicUint) { + if (qualifier.precision == EpqNone) { + if (relaxedErrors()) + warn(loc, "type requires declaration of default precision qualifier", TType::getBasicString(baseType), "substituting 'mediump'"); + else + error(loc, "type requires declaration of default precision qualifier", TType::getBasicString(baseType), ""); + qualifier.precision = EpqMedium; + defaultPrecision[baseType] = EpqMedium; + } + } else if (qualifier.precision != EpqNone) + error(loc, "type cannot have precision qualifier", TType::getBasicString(baseType), ""); +} + +void TParseContext::parameterTypeCheck(const TSourceLoc& loc, TStorageQualifier qualifier, const TType& type) +{ + if ((qualifier == EvqOut || qualifier == EvqInOut) && type.isOpaque() && !intermediate.getBindlessMode()) + error(loc, "samplers and atomic_uints cannot be output parameters", type.getBasicTypeString().c_str(), ""); + if (!parsingBuiltins && type.contains16BitFloat()) + requireFloat16Arithmetic(loc, type.getBasicTypeString().c_str(), "float16 types can only be in uniform block or buffer storage"); + if (!parsingBuiltins && type.contains16BitInt()) + requireInt16Arithmetic(loc, type.getBasicTypeString().c_str(), "(u)int16 types can only be in uniform block or buffer storage"); + if (!parsingBuiltins && type.contains8BitInt()) + requireInt8Arithmetic(loc, type.getBasicTypeString().c_str(), "(u)int8 types can only be in uniform block or buffer storage"); +} + +bool TParseContext::containsFieldWithBasicType(const TType& type, TBasicType basicType) +{ + if (type.getBasicType() == basicType) + return true; + + if (type.getBasicType() == EbtStruct) { + const TTypeList& structure = *type.getStruct(); + for (unsigned int i = 0; i < structure.size(); ++i) { + if (containsFieldWithBasicType(*structure[i].type, basicType)) + return true; + } + } + + return false; +} + +// +// Do size checking for an array type's size. +// +void TParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, TArraySize& sizePair, + const char* sizeType, const bool isTypeParameter) +{ + bool isConst = false; + sizePair.node = nullptr; + + int size = 1; + + TIntermConstantUnion* constant = expr->getAsConstantUnion(); + if (constant) { + // handle true (non-specialization) constant + size = constant->getConstArray()[0].getIConst(); + isConst = true; + } else { + // see if it's a specialization constant instead + if (expr->getQualifier().isSpecConstant()) { + isConst = true; + sizePair.node = expr; + TIntermSymbol* symbol = expr->getAsSymbolNode(); + if (symbol && symbol->getConstArray().size() > 0) + size = symbol->getConstArray()[0].getIConst(); + } else if (expr->getAsUnaryNode() && expr->getAsUnaryNode()->getOp() == glslang::EOpArrayLength && + expr->getAsUnaryNode()->getOperand()->getType().isCoopMatNV()) { + isConst = true; + size = 1; + sizePair.node = expr->getAsUnaryNode(); + } + } + + sizePair.size = size; + + if (isTypeParameter) { + if (extensionTurnedOn(E_GL_NV_cooperative_matrix2)) { + if (! isConst || (expr->getBasicType() != EbtInt && expr->getBasicType() != EbtUint && expr->getBasicType() != EbtBool)) { + error(loc, sizeType, "", "must be a constant integer or boolean expression"); + return; + } + } else { + if (! isConst || (expr->getBasicType() != EbtInt && expr->getBasicType() != EbtUint)) { + error(loc, sizeType, "", "must be a constant integer expression"); + return; + } + } + if (size < 0) { + error(loc, sizeType, "", "must be a non-negative integer"); + return; + } + } else { + if (! isConst || (expr->getBasicType() != EbtInt && expr->getBasicType() != EbtUint)) { + error(loc, sizeType, "", "must be a constant integer expression"); + return; + } + if (size <= 0) { + error(loc, sizeType, "", "must be a positive integer"); + return; + } + } +} + +// +// See if this qualifier can be an array. +// +// Returns true if there is an error. +// +bool TParseContext::arrayQualifierError(const TSourceLoc& loc, const TQualifier& qualifier) +{ + if (qualifier.storage == EvqConst) { + profileRequires(loc, ENoProfile, 120, E_GL_3DL_array_objects, "const array"); + profileRequires(loc, EEsProfile, 300, nullptr, "const array"); + } + + if (qualifier.storage == EvqVaryingIn && language == EShLangVertex) { + requireProfile(loc, ~EEsProfile, "vertex input arrays"); + profileRequires(loc, ENoProfile, 150, nullptr, "vertex input arrays"); + } + + return false; +} + +// +// See if this qualifier and type combination can be an array. +// Assumes arrayQualifierError() was also called to catch the type-invariant tests. +// +// Returns true if there is an error. +// +bool TParseContext::arrayError(const TSourceLoc& loc, const TType& type) +{ + if (type.getQualifier().storage == EvqVaryingOut && language == EShLangVertex) { + if (type.isArrayOfArrays()) + requireProfile(loc, ~EEsProfile, "vertex-shader array-of-array output"); + else if (type.isStruct()) + requireProfile(loc, ~EEsProfile, "vertex-shader array-of-struct output"); + } + if (type.getQualifier().storage == EvqVaryingIn && language == EShLangFragment) { + if (type.isArrayOfArrays()) + requireProfile(loc, ~EEsProfile, "fragment-shader array-of-array input"); + else if (type.isStruct()) + requireProfile(loc, ~EEsProfile, "fragment-shader array-of-struct input"); + } + if (type.getQualifier().storage == EvqVaryingOut && language == EShLangFragment) { + if (type.isArrayOfArrays()) + requireProfile(loc, ~EEsProfile, "fragment-shader array-of-array output"); + } + + return false; +} + +// +// Require array to be completely sized +// +void TParseContext::arraySizeRequiredCheck(const TSourceLoc& loc, const TArraySizes& arraySizes) +{ + if (!parsingBuiltins && arraySizes.hasUnsized()) + error(loc, "array size required", "", ""); +} + +void TParseContext::structArrayCheck(const TSourceLoc& /*loc*/, const TType& type) +{ + const TTypeList& structure = *type.getStruct(); + for (int m = 0; m < (int)structure.size(); ++m) { + const TType& member = *structure[m].type; + if (member.isArray()) + arraySizeRequiredCheck(structure[m].loc, *member.getArraySizes()); + } +} + +void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qualifier, TArraySizes* arraySizes, + const TIntermTyped* initializer, bool lastMember) +{ + assert(arraySizes); + + // always allow special built-in ins/outs sized to topologies + if (parsingBuiltins) + return; + + // initializer must be a sized array, in which case + // allow the initializer to set any unknown array sizes + if (initializer != nullptr) { + if (initializer->getType().isUnsizedArray()) + error(loc, "array initializer must be sized", "[]", ""); + return; + } + + // No environment allows any non-outer-dimension to be implicitly sized + if (arraySizes->isInnerUnsized()) { + error(loc, "only outermost dimension of an array of arrays can be implicitly sized", "[]", ""); + arraySizes->clearInnerUnsized(); + } + + if (arraySizes->isInnerSpecialization() && + (qualifier.storage != EvqTemporary && qualifier.storage != EvqGlobal && qualifier.storage != EvqShared && qualifier.storage != EvqConst)) + error(loc, "only outermost dimension of an array of arrays can be a specialization constant", "[]", ""); + + // desktop always allows outer-dimension-unsized variable arrays, + if (!isEsProfile()) + return; + + // for ES, if size isn't coming from an initializer, it has to be explicitly declared now, + // with very few exceptions + + // implicitly-sized io exceptions: + switch (language) { + case EShLangGeometry: + if (qualifier.storage == EvqVaryingIn) + if ((isEsProfile() && version >= 320) || + extensionsTurnedOn(Num_AEP_geometry_shader, AEP_geometry_shader)) + return; + break; + case EShLangTessControl: + if ( qualifier.storage == EvqVaryingIn || + (qualifier.storage == EvqVaryingOut && ! qualifier.isPatch())) + if ((isEsProfile() && version >= 320) || + extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader)) + return; + break; + case EShLangTessEvaluation: + if ((qualifier.storage == EvqVaryingIn && ! qualifier.isPatch()) || + qualifier.storage == EvqVaryingOut) + if ((isEsProfile() && version >= 320) || + extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader)) + return; + break; + case EShLangMesh: + if (qualifier.storage == EvqVaryingOut) + if ((isEsProfile() && version >= 320) || + extensionsTurnedOn(Num_AEP_mesh_shader, AEP_mesh_shader)) + return; + break; + default: + break; + } + + // last member of ssbo block exception: + if (qualifier.storage == EvqBuffer && lastMember) + return; + + if (qualifier.storage == EvqUniform && lastMember && extensionTurnedOn(E_GL_EXT_uniform_buffer_unsized_array)) + return; + + arraySizeRequiredCheck(loc, *arraySizes); +} + +void TParseContext::arrayOfArrayVersionCheck(const TSourceLoc& loc, const TArraySizes* sizes) +{ + if (sizes == nullptr || sizes->getNumDims() == 1) + return; + + const char* feature = "arrays of arrays"; + + requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, feature); + profileRequires(loc, EEsProfile, 310, nullptr, feature); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, nullptr, feature); +} + +// +// Do all the semantic checking for declaring or redeclaring an array, with and +// without a size, and make the right changes to the symbol table. +// +void TParseContext::declareArray(const TSourceLoc& loc, const TString& identifier, const TType& type, TSymbol*& symbol) +{ + if (symbol == nullptr) { + bool currentScope; + symbol = symbolTable.find(identifier, nullptr, ¤tScope); + + if (symbol && builtInName(identifier) && ! symbolTable.atBuiltInLevel()) { + // bad shader (errors already reported) trying to redeclare a built-in name as an array + symbol = nullptr; + return; + } + if (symbol == nullptr || ! currentScope) { + // + // Successfully process a new definition. + // (Redeclarations have to take place at the same scope; otherwise they are hiding declarations) + // + symbol = new TVariable(&identifier, type); + symbolTable.insert(*symbol); + if (symbolTable.atGlobalLevel()) + trackLinkage(*symbol); + + if (! symbolTable.atBuiltInLevel()) { + if (isIoResizeArray(type)) { + ioArraySymbolResizeList.push_back(symbol); + checkIoArraysConsistency(loc, true); + } else + fixIoArraySize(loc, symbol->getWritableType()); + } + + return; + } + if (symbol->getAsAnonMember()) { + error(loc, "cannot redeclare a user-block member array", identifier.c_str(), ""); + symbol = nullptr; + return; + } + } + + // + // Process a redeclaration. + // + + if (symbol == nullptr) { + error(loc, "array variable name expected", identifier.c_str(), ""); + return; + } + + // redeclareBuiltinVariable() should have already done the copyUp() + TType& existingType = symbol->getWritableType(); + + if (! existingType.isArray()) { + error(loc, "redeclaring non-array as array", identifier.c_str(), ""); + return; + } + + if (! existingType.sameElementType(type)) { + error(loc, "redeclaration of array with a different element type", identifier.c_str(), ""); + return; + } + + if (! existingType.sameInnerArrayness(type)) { + error(loc, "redeclaration of array with a different array dimensions or sizes", identifier.c_str(), ""); + return; + } + + if (existingType.isSizedArray()) { + // be more leniant for input arrays to geometry shaders and tessellation control outputs, where the redeclaration is the same size + if (! (isIoResizeArray(type) && existingType.getOuterArraySize() == type.getOuterArraySize())) + error(loc, "redeclaration of array with size", identifier.c_str(), ""); + return; + } + + arrayLimitCheck(loc, identifier, type.getOuterArraySize()); + + existingType.updateArraySizes(type); + + if (isIoResizeArray(type)) + checkIoArraysConsistency(loc); +} + +// Policy and error check for needing a runtime sized array. +void TParseContext::checkRuntimeSizable(const TSourceLoc& loc, const TIntermTyped& base) +{ + // runtime length implies runtime sizeable, so no problem + if (isRuntimeLength(base)) + return; + + if (base.getType().getQualifier().builtIn == EbvSampleMask) + return; + + // Check for last member of a bufferreference type, which is runtime sizeable + // but doesn't support runtime length + if (base.getType().getQualifier().storage == EvqBuffer) { + const TIntermBinary* binary = base.getAsBinaryNode(); + if (binary != nullptr && + binary->getOp() == EOpIndexDirectStruct && + binary->getLeft()->isReference()) { + + const int index = binary->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); + const int memberCount = (int)binary->getLeft()->getType().getReferentType()->getStruct()->size(); + if (index == memberCount - 1) + return; + } + } + + // Check for last member of a uniform block, which can be runtime sizeable + // when using GL_EXT_uniform_buffer_unsized_array + if (base.getType().getQualifier().storage == EvqUniform && extensionTurnedOn(E_GL_EXT_uniform_buffer_unsized_array)) { + const TIntermBinary* binary = base.getAsBinaryNode(); + if (binary != nullptr && + binary->getOp() == EOpIndexDirectStruct) { + + const int index = binary->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); + const int memberCount = (int)binary->getLeft()->getType().getStruct()->size(); + if (index == memberCount - 1) + return; + } + } + + // check for additional things allowed by GL_EXT_nonuniform_qualifier + if (base.getBasicType() == EbtSampler || base.getBasicType() == EbtAccStruct || base.getBasicType() == EbtRayQuery || + base.getBasicType() == EbtHitObjectNV || (base.getBasicType() == EbtBlock && base.getType().getQualifier().isUniformOrBuffer())) + requireExtensions(loc, 1, &E_GL_EXT_nonuniform_qualifier, "variable index"); + else + error(loc, "", "[", "array must be redeclared with a size before being indexed with a variable"); +} + +// Policy decision for whether a run-time .length() is allowed. +bool TParseContext::isRuntimeLength(const TIntermTyped& base) const +{ + if (base.getType().getQualifier().storage == EvqBuffer) { + // in a buffer block + const TIntermBinary* binary = base.getAsBinaryNode(); + if (binary != nullptr && binary->getOp() == EOpIndexDirectStruct) { + // is it the last member? + const int index = binary->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); + + if (binary->getLeft()->isReference()) + return false; + + const int memberCount = (int)binary->getLeft()->getType().getStruct()->size(); + if (index == memberCount - 1) + return true; + } + } + + return false; +} + +// Check if mesh perviewNV attributes have a view dimension +// and resize it to gl_MaxMeshViewCountNV when implicitly sized. +void TParseContext::checkAndResizeMeshViewDim(const TSourceLoc& loc, TType& type, bool isBlockMember) +{ + // see if member is a per-view attribute + if (!type.getQualifier().isPerView()) + return; + + if ((isBlockMember && type.isArray()) || (!isBlockMember && type.isArrayOfArrays())) { + // since we don't have the maxMeshViewCountNV set during parsing builtins, we hardcode the value. + int maxViewCount = parsingBuiltins ? 4 : resources.maxMeshViewCountNV; + // For block members, outermost array dimension is the view dimension. + // For non-block members, outermost array dimension is the vertex/primitive dimension + // and 2nd outermost is the view dimension. + int viewDim = isBlockMember ? 0 : 1; + int viewDimSize = type.getArraySizes()->getDimSize(viewDim); + + if (viewDimSize != UnsizedArraySize && viewDimSize != maxViewCount) + error(loc, "mesh view output array size must be gl_MaxMeshViewCountNV or implicitly sized", "[]", ""); + else if (viewDimSize == UnsizedArraySize) + type.getArraySizes()->setDimSize(viewDim, maxViewCount); + } + else { + error(loc, "requires a view array dimension", "perviewNV", ""); + } +} + +// Returns true if the first argument to the #line directive is the line number for the next line. +// +// Desktop, pre-version 3.30: "After processing this directive +// (including its new-line), the implementation will behave as if it is compiling at line number line+1 and +// source string number source-string-number." +// +// Desktop, version 3.30 and later, and ES: "After processing this directive +// (including its new-line), the implementation will behave as if it is compiling at line number line and +// source string number source-string-number. +bool TParseContext::lineDirectiveShouldSetNextLine() const +{ + return isEsProfile() || version >= 330; +} + +// +// Enforce non-initializer type/qualifier rules. +// +void TParseContext::nonInitConstCheck(const TSourceLoc& loc, TString& identifier, TType& type) +{ + // + // Make the qualifier make sense, given that there is not an initializer. + // + if (type.getQualifier().storage == EvqConst || + type.getQualifier().storage == EvqConstReadOnly) { + type.getQualifier().makeTemporary(); + error(loc, "variables with qualifier 'const' must be initialized", identifier.c_str(), ""); + } +} + +// +// See if the identifier is a built-in symbol that can be redeclared, and if so, +// copy the symbol table's read-only built-in variable to the current +// global level, where it can be modified based on the passed in type. +// +// Returns nullptr if no redeclaration took place; meaning a normal declaration still +// needs to occur for it, not necessarily an error. +// +// Returns a redeclared and type-modified variable if a redeclarated occurred. +// +TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TString& identifier, + const TQualifier& qualifier, const TShaderQualifiers& publicType) +{ + if (! builtInName(identifier) || symbolTable.atBuiltInLevel() || ! symbolTable.atGlobalLevel()) + return nullptr; + + bool nonEsRedecls = (!isEsProfile() && (version >= 130 || identifier == "gl_TexCoord")); + bool esRedecls = (isEsProfile() && + (version >= 320 || extensionsTurnedOn(Num_AEP_shader_io_blocks, AEP_shader_io_blocks))); + if (! esRedecls && ! nonEsRedecls) + return nullptr; + + // Special case when using GL_ARB_separate_shader_objects + bool ssoPre150 = false; // means the only reason this variable is redeclared is due to this combination + if (!isEsProfile() && version <= 140 && extensionTurnedOn(E_GL_ARB_separate_shader_objects)) { + if (identifier == "gl_Position" || + identifier == "gl_PointSize" || + identifier == "gl_ClipVertex" || + identifier == "gl_FogFragCoord") + ssoPre150 = true; + } + + // Potentially redeclaring a built-in variable... + + if (ssoPre150 || + (identifier == "gl_FragDepth" && ((nonEsRedecls && version >= 420) || esRedecls)) || + (identifier == "gl_FragCoord" && ((nonEsRedecls && version >= 140) || esRedecls)) || + identifier == "gl_ClipDistance" || + identifier == "gl_CullDistance" || + identifier == "gl_ShadingRateEXT" || + identifier == "gl_PrimitiveShadingRateEXT" || + identifier == "gl_FrontColor" || + identifier == "gl_BackColor" || + identifier == "gl_FrontSecondaryColor" || + identifier == "gl_BackSecondaryColor" || + identifier == "gl_SecondaryColor" || + (identifier == "gl_Color" && language == EShLangFragment) || + (identifier == "gl_FragStencilRefARB" && (nonEsRedecls && version >= 140) + && language == EShLangFragment) || + identifier == "gl_SampleMask" || + identifier == "gl_Layer" || + identifier == "gl_PrimitiveIndicesNV" || + identifier == "gl_PrimitivePointIndicesEXT" || + identifier == "gl_PrimitiveLineIndicesEXT" || + identifier == "gl_PrimitiveTriangleIndicesEXT" || + identifier == "gl_TexCoord") { + + // Find the existing symbol, if any. + bool builtIn; + TSymbol* symbol = symbolTable.find(identifier, &builtIn); + + // If the symbol was not found, this must be a version/profile/stage + // that doesn't have it. + if (! symbol) + return nullptr; + + // If it wasn't at a built-in level, then it's already been redeclared; + // that is, this is a redeclaration of a redeclaration; reuse that initial + // redeclaration. Otherwise, make the new one. + if (builtIn) { + makeEditable(symbol); + symbolTable.amendSymbolIdLevel(*symbol); + } + + // Now, modify the type of the copy, as per the type of the current redeclaration. + + TQualifier& symbolQualifier = symbol->getWritableType().getQualifier(); + if (ssoPre150) { + if (intermediate.inIoAccessed(identifier)) + error(loc, "cannot redeclare after use", identifier.c_str(), ""); + if (qualifier.hasLayout()) + error(loc, "cannot apply layout qualifier to", "redeclaration", symbol->getName().c_str()); + if (qualifier.isMemory() || qualifier.isAuxiliary() || (language == EShLangVertex && qualifier.storage != EvqVaryingOut) || + (language == EShLangFragment && qualifier.storage != EvqVaryingIn)) + error(loc, "cannot change storage, memory, or auxiliary qualification of", "redeclaration", symbol->getName().c_str()); + if (! qualifier.smooth) + error(loc, "cannot change interpolation qualification of", "redeclaration", symbol->getName().c_str()); + } else if (identifier == "gl_FrontColor" || + identifier == "gl_BackColor" || + identifier == "gl_FrontSecondaryColor" || + identifier == "gl_BackSecondaryColor" || + identifier == "gl_SecondaryColor" || + identifier == "gl_Color") { + symbolQualifier.flat = qualifier.flat; + symbolQualifier.smooth = qualifier.smooth; + symbolQualifier.nopersp = qualifier.nopersp; + if (qualifier.hasLayout()) + error(loc, "cannot apply layout qualifier to", "redeclaration", symbol->getName().c_str()); + if (qualifier.isMemory() || qualifier.isAuxiliary() || symbol->getType().getQualifier().storage != qualifier.storage) + error(loc, "cannot change storage, memory, or auxiliary qualification of", "redeclaration", symbol->getName().c_str()); + } else if (identifier == "gl_TexCoord" || + identifier == "gl_ClipDistance" || + identifier == "gl_CullDistance") { + if (qualifier.hasLayout() || qualifier.isMemory() || qualifier.isAuxiliary() || + qualifier.nopersp != symbolQualifier.nopersp || qualifier.flat != symbolQualifier.flat || + symbolQualifier.storage != qualifier.storage) + error(loc, "cannot change qualification of", "redeclaration", symbol->getName().c_str()); + } else if (identifier == "gl_FragCoord") { + if (!intermediate.getTexCoordRedeclared() && intermediate.inIoAccessed("gl_FragCoord")) + error(loc, "cannot redeclare after use", "gl_FragCoord", ""); + if (qualifier.nopersp != symbolQualifier.nopersp || qualifier.flat != symbolQualifier.flat || + qualifier.isMemory() || qualifier.isAuxiliary()) + error(loc, "can only change layout qualification of", "redeclaration", symbol->getName().c_str()); + if (qualifier.storage != EvqVaryingIn) + error(loc, "cannot change input storage qualification of", "redeclaration", symbol->getName().c_str()); + if (! builtIn && (publicType.pixelCenterInteger != intermediate.getPixelCenterInteger() || + publicType.originUpperLeft != intermediate.getOriginUpperLeft())) + error(loc, "cannot redeclare with different qualification:", "redeclaration", symbol->getName().c_str()); + + + intermediate.setTexCoordRedeclared(); + if (publicType.pixelCenterInteger) + intermediate.setPixelCenterInteger(); + if (publicType.originUpperLeft) + intermediate.setOriginUpperLeft(); + } else if (identifier == "gl_FragDepth") { + if (qualifier.nopersp != symbolQualifier.nopersp || qualifier.flat != symbolQualifier.flat || + qualifier.isMemory() || qualifier.isAuxiliary()) + error(loc, "can only change layout qualification of", "redeclaration", symbol->getName().c_str()); + if (qualifier.storage != EvqVaryingOut) + error(loc, "cannot change output storage qualification of", "redeclaration", symbol->getName().c_str()); + if (publicType.layoutDepth != EldNone) { + if (intermediate.inIoAccessed("gl_FragDepth")) + error(loc, "cannot redeclare after use", "gl_FragDepth", ""); + if (! intermediate.setDepth(publicType.layoutDepth)) + error(loc, "all redeclarations must use the same depth layout on", "redeclaration", symbol->getName().c_str()); + } + } else if (identifier == "gl_FragStencilRefARB") { + if (qualifier.nopersp != symbolQualifier.nopersp || qualifier.flat != symbolQualifier.flat || + qualifier.isMemory() || qualifier.isAuxiliary()) + error(loc, "can only change layout qualification of", "redeclaration", symbol->getName().c_str()); + if (qualifier.storage != EvqVaryingOut) + error(loc, "cannot change output storage qualification of", "redeclaration", symbol->getName().c_str()); + if (publicType.layoutStencil != ElsNone) { + if (intermediate.inIoAccessed("gl_FragStencilRefARB")) + error(loc, "cannot redeclare after use", "gl_FragStencilRefARB", ""); + if (!intermediate.setStencil(publicType.layoutStencil)) + error(loc, "all redeclarations must use the same stencil layout on", "redeclaration", + symbol->getName().c_str()); + } + } + else if ( + identifier == "gl_PrimitiveIndicesNV") { + if (qualifier.hasLayout()) + error(loc, "cannot apply layout qualifier to", "redeclaration", symbol->getName().c_str()); + if (qualifier.storage != EvqVaryingOut) + error(loc, "cannot change output storage qualification of", "redeclaration", symbol->getName().c_str()); + } + else if (identifier == "gl_SampleMask") { + if (!publicType.layoutOverrideCoverage) { + error(loc, "redeclaration only allowed for override_coverage layout", "redeclaration", symbol->getName().c_str()); + } + intermediate.setLayoutOverrideCoverage(); + } + else if (identifier == "gl_Layer") { + if (!qualifier.layoutViewportRelative && qualifier.layoutSecondaryViewportRelativeOffset == -2048) + error(loc, "redeclaration only allowed for viewport_relative or secondary_view_offset layout", "redeclaration", symbol->getName().c_str()); + symbolQualifier.layoutViewportRelative = qualifier.layoutViewportRelative; + symbolQualifier.layoutSecondaryViewportRelativeOffset = qualifier.layoutSecondaryViewportRelativeOffset; + } + + // TODO: semantics quality: separate smooth from nothing declared, then use IsInterpolation for several tests above + + return symbol; + } + + return nullptr; +} + +// +// Either redeclare the requested block, or give an error message why it can't be done. +// +// TODO: functionality: explicitly sizing members of redeclared blocks is not giving them an explicit size +void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newTypeList, const TString& blockName, + const TString* instanceName, TArraySizes* arraySizes) +{ + const char* feature = "built-in block redeclaration"; + profileRequires(loc, EEsProfile, 320, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, feature); + profileRequires(loc, ~EEsProfile, 410, E_GL_ARB_separate_shader_objects, feature); + + if (blockName != "gl_PerVertex" && blockName != "gl_PerFragment" && + blockName != "gl_MeshPerVertexNV" && blockName != "gl_MeshPerPrimitiveNV" && + blockName != "gl_MeshPerVertexEXT" && blockName != "gl_MeshPerPrimitiveEXT") { + error(loc, "cannot redeclare block: ", "block declaration", blockName.c_str()); + return; + } + + // Redeclaring a built-in block... + + if (instanceName && ! builtInName(*instanceName)) { + error(loc, "cannot redeclare a built-in block with a user name", instanceName->c_str(), ""); + return; + } + + // Blocks with instance names are easy to find, lookup the instance name, + // Anonymous blocks need to be found via a member. + bool builtIn; + TSymbol* block; + if (instanceName) + block = symbolTable.find(*instanceName, &builtIn); + else + block = symbolTable.find(newTypeList.front().type->getFieldName(), &builtIn); + + // If the block was not found, this must be a version/profile/stage + // that doesn't have it, or the instance name is wrong. + const char* errorName = instanceName ? instanceName->c_str() : newTypeList.front().type->getFieldName().c_str(); + if (! block) { + error(loc, "no declaration found for redeclaration", errorName, ""); + return; + } + // Built-in blocks cannot be redeclared more than once, which if happened, + // we'd be finding the already redeclared one here, rather than the built in. + if (! builtIn) { + error(loc, "can only redeclare a built-in block once, and before any use", blockName.c_str(), ""); + return; + } + + // Copy the block to make a writable version, to insert into the block table after editing. + block = symbolTable.copyUpDeferredInsert(block); + + if (block->getType().getBasicType() != EbtBlock) { + error(loc, "cannot redeclare a non block as a block", errorName, ""); + return; + } + + // Fix XFB stuff up, it applies to the order of the redeclaration, not + // the order of the original members. + if (currentBlockQualifier.storage == EvqVaryingOut && globalOutputDefaults.hasXfbBuffer()) { + if (!currentBlockQualifier.hasXfbBuffer()) + currentBlockQualifier.layoutXfbBuffer = globalOutputDefaults.layoutXfbBuffer; + if (!currentBlockQualifier.hasStream()) + currentBlockQualifier.layoutStream = globalOutputDefaults.layoutStream; + fixXfbOffsets(currentBlockQualifier, newTypeList); + } + + // Edit and error check the container against the redeclaration + // - remove unused members + // - ensure remaining qualifiers/types match + + TType& type = block->getWritableType(); + + // if gl_PerVertex is redeclared for the purpose of passing through "gl_Position" + // for passthrough purpose, the redeclared block should have the same qualifers as + // the current one + if (currentBlockQualifier.layoutPassthrough) { + type.getQualifier().layoutPassthrough = currentBlockQualifier.layoutPassthrough; + type.getQualifier().storage = currentBlockQualifier.storage; + type.getQualifier().layoutStream = currentBlockQualifier.layoutStream; + type.getQualifier().layoutXfbBuffer = currentBlockQualifier.layoutXfbBuffer; + } + + TTypeList::iterator member = type.getWritableStruct()->begin(); + size_t numOriginalMembersFound = 0; + while (member != type.getStruct()->end()) { + // look for match + bool found = false; + TTypeList::const_iterator newMember; + TSourceLoc memberLoc; + memberLoc.init(); + for (newMember = newTypeList.begin(); newMember != newTypeList.end(); ++newMember) { + if (member->type->getFieldName() == newMember->type->getFieldName()) { + found = true; + memberLoc = newMember->loc; + break; + } + } + + if (found) { + ++numOriginalMembersFound; + // - ensure match between redeclared members' types + // - check for things that can't be changed + // - update things that can be changed + TType& oldType = *member->type; + const TType& newType = *newMember->type; + if (! newType.sameElementType(oldType)) + error(memberLoc, "cannot redeclare block member with a different type", member->type->getFieldName().c_str(), ""); + if (oldType.isArray() != newType.isArray()) + error(memberLoc, "cannot change arrayness of redeclared block member", member->type->getFieldName().c_str(), ""); + else if (! oldType.getQualifier().isPerView() && ! oldType.sameArrayness(newType) && oldType.isSizedArray()) + error(memberLoc, "cannot change array size of redeclared block member", member->type->getFieldName().c_str(), ""); + else if (! oldType.getQualifier().isPerView() && newType.isArray()) + arrayLimitCheck(loc, member->type->getFieldName(), newType.getOuterArraySize()); + if (oldType.getQualifier().isPerView() && ! newType.getQualifier().isPerView()) + error(memberLoc, "missing perviewNV qualifier to redeclared block member", member->type->getFieldName().c_str(), ""); + else if (! oldType.getQualifier().isPerView() && newType.getQualifier().isPerView()) + error(memberLoc, "cannot add perviewNV qualifier to redeclared block member", member->type->getFieldName().c_str(), ""); + else if (newType.getQualifier().isPerView()) { + if (oldType.getArraySizes()->getNumDims() != newType.getArraySizes()->getNumDims()) + error(memberLoc, "cannot change arrayness of redeclared block member", member->type->getFieldName().c_str(), ""); + else if (! newType.isUnsizedArray() && newType.getOuterArraySize() != resources.maxMeshViewCountNV) + error(loc, "mesh view output array size must be gl_MaxMeshViewCountNV or implicitly sized", "[]", ""); + else if (newType.getArraySizes()->getNumDims() == 2) { + int innerDimSize = newType.getArraySizes()->getDimSize(1); + arrayLimitCheck(memberLoc, member->type->getFieldName(), innerDimSize); + oldType.getArraySizes()->setDimSize(1, innerDimSize); + } + } + if (oldType.getQualifier().isPerPrimitive() && ! newType.getQualifier().isPerPrimitive()) + error(memberLoc, "missing perprimitiveNV qualifier to redeclared block member", member->type->getFieldName().c_str(), ""); + else if (! oldType.getQualifier().isPerPrimitive() && newType.getQualifier().isPerPrimitive()) + error(memberLoc, "cannot add perprimitiveNV qualifier to redeclared block member", member->type->getFieldName().c_str(), ""); + if (newType.getQualifier().isMemory()) + error(memberLoc, "cannot add memory qualifier to redeclared block member", member->type->getFieldName().c_str(), ""); + if (newType.getQualifier().hasNonXfbLayout()) + error(memberLoc, "cannot add non-XFB layout to redeclared block member", member->type->getFieldName().c_str(), ""); + if (newType.getQualifier().patch) + error(memberLoc, "cannot add patch to redeclared block member", member->type->getFieldName().c_str(), ""); + if (newType.getQualifier().hasXfbBuffer() && + newType.getQualifier().layoutXfbBuffer != currentBlockQualifier.layoutXfbBuffer) + error(memberLoc, "member cannot contradict block (or what block inherited from global)", "xfb_buffer", ""); + if (newType.getQualifier().hasStream() && + newType.getQualifier().layoutStream != currentBlockQualifier.layoutStream) + error(memberLoc, "member cannot contradict block (or what block inherited from global)", "xfb_stream", ""); + oldType.getQualifier().centroid = newType.getQualifier().centroid; + oldType.getQualifier().sample = newType.getQualifier().sample; + oldType.getQualifier().invariant = newType.getQualifier().invariant; + oldType.getQualifier().noContraction = newType.getQualifier().noContraction; + oldType.getQualifier().smooth = newType.getQualifier().smooth; + oldType.getQualifier().flat = newType.getQualifier().flat; + oldType.getQualifier().nopersp = newType.getQualifier().nopersp; + oldType.getQualifier().layoutXfbOffset = newType.getQualifier().layoutXfbOffset; + oldType.getQualifier().layoutXfbBuffer = newType.getQualifier().layoutXfbBuffer; + oldType.getQualifier().layoutXfbStride = newType.getQualifier().layoutXfbStride; + if (oldType.getQualifier().layoutXfbOffset != TQualifier::layoutXfbBufferEnd) { + // If any member has an xfb_offset, then the block's xfb_buffer inherents current xfb_buffer, + // and for xfb processing, the member needs it as well, along with xfb_stride. + type.getQualifier().layoutXfbBuffer = currentBlockQualifier.layoutXfbBuffer; + oldType.getQualifier().layoutXfbBuffer = currentBlockQualifier.layoutXfbBuffer; + } + if (oldType.isUnsizedArray() && newType.isSizedArray()) + oldType.changeOuterArraySize(newType.getOuterArraySize()); + + // check and process the member's type, which will include managing xfb information + layoutTypeCheck(loc, oldType); + + // go to next member + ++member; + } else { + // For missing members of anonymous blocks that have been redeclared, + // hide the original (shared) declaration. + // Instance-named blocks can just have the member removed. + if (instanceName) + member = type.getWritableStruct()->erase(member); + else { + member->type->hideMember(); + ++member; + } + } + } + + if (spvVersion.vulkan > 0) { + // ...then streams apply to built-in blocks, instead of them being only on stream 0 + type.getQualifier().layoutStream = currentBlockQualifier.layoutStream; + } + + if (numOriginalMembersFound < newTypeList.size()) + error(loc, "block redeclaration has extra members", blockName.c_str(), ""); + if (type.isArray() != (arraySizes != nullptr) || + (type.isArray() && arraySizes != nullptr && type.getArraySizes()->getNumDims() != arraySizes->getNumDims())) + error(loc, "cannot change arrayness of redeclared block", blockName.c_str(), ""); + else if (type.isArray()) { + // At this point, we know both are arrays and both have the same number of dimensions. + + // It is okay for a built-in block redeclaration to be unsized, and keep the size of the + // original block declaration. + if (!arraySizes->isSized() && type.isSizedArray()) + arraySizes->changeOuterSize(type.getOuterArraySize()); + + // And, okay to be giving a size to the array, by the redeclaration + if (!type.isSizedArray() && arraySizes->isSized()) + type.changeOuterArraySize(arraySizes->getOuterSize()); + + // Now, they must match in all dimensions. + if (type.isSizedArray() && *type.getArraySizes() != *arraySizes) + error(loc, "cannot change array size of redeclared block", blockName.c_str(), ""); + } + + symbolTable.insert(*block); + + // Check for general layout qualifier errors + layoutObjectCheck(loc, *block); + + // Tracking for implicit sizing of array + if (isIoResizeArray(block->getType())) { + ioArraySymbolResizeList.push_back(block); + checkIoArraysConsistency(loc, true); + } else if (block->getType().isArray()) + fixIoArraySize(loc, block->getWritableType()); + + // Save it in the AST for linker use. + trackLinkage(*block); +} + +void TParseContext::paramCheckFixStorage(const TSourceLoc& loc, const TStorageQualifier& qualifier, TType& type) +{ + switch (qualifier) { + case EvqConst: + case EvqConstReadOnly: + type.getQualifier().storage = EvqConstReadOnly; + break; + case EvqIn: + case EvqOut: + case EvqInOut: + case EvqTileImageEXT: + type.getQualifier().storage = qualifier; + break; + case EvqGlobal: + case EvqTemporary: + type.getQualifier().storage = EvqIn; + break; + default: + type.getQualifier().storage = EvqIn; + error(loc, "storage qualifier not allowed on function parameter", GetStorageQualifierString(qualifier), ""); + break; + } +} + +void TParseContext::paramCheckFix(const TSourceLoc& loc, const TQualifier& qualifier, TType& type) +{ + if (qualifier.isMemory()) { + type.getQualifier().volatil = qualifier.volatil; + type.getQualifier().nontemporal = qualifier.nontemporal; + type.getQualifier().coherent = qualifier.coherent; + type.getQualifier().devicecoherent = qualifier.devicecoherent ; + type.getQualifier().queuefamilycoherent = qualifier.queuefamilycoherent; + type.getQualifier().workgroupcoherent = qualifier.workgroupcoherent; + type.getQualifier().subgroupcoherent = qualifier.subgroupcoherent; + type.getQualifier().shadercallcoherent = qualifier.shadercallcoherent; + type.getQualifier().nonprivate = qualifier.nonprivate; + type.getQualifier().readonly = qualifier.readonly; + type.getQualifier().writeonly = qualifier.writeonly; + type.getQualifier().restrict = qualifier.restrict; + } + + if (qualifier.isAuxiliary() || + qualifier.isInterpolation()) + error(loc, "cannot use auxiliary or interpolation qualifiers on a function parameter", "", ""); + if (qualifier.hasLayout()) + error(loc, "cannot use layout qualifiers on a function parameter", "", ""); + if (qualifier.invariant) + error(loc, "cannot use invariant qualifier on a function parameter", "", ""); + if (qualifier.isNoContraction()) { + if (qualifier.isParamOutput()) + type.getQualifier().setNoContraction(); + else + warn(loc, "qualifier has no effect on non-output parameters", "precise", ""); + } + if (qualifier.isNonUniform()) + type.getQualifier().nonUniform = qualifier.nonUniform; + if (qualifier.isSpirvByReference()) + type.getQualifier().setSpirvByReference(); + if (qualifier.isSpirvLiteral()) { + if (type.getBasicType() == EbtFloat || type.getBasicType() == EbtInt || type.getBasicType() == EbtUint || + type.getBasicType() == EbtBool) + type.getQualifier().setSpirvLiteral(); + else + error(loc, "cannot use spirv_literal qualifier", type.getBasicTypeString().c_str(), ""); + } + + paramCheckFixStorage(loc, qualifier.storage, type); +} + +void TParseContext::nestedBlockCheck(const TSourceLoc& loc) +{ + if (structNestingLevel > 0 || blockNestingLevel > 0) + error(loc, "cannot nest a block definition inside a structure or block", "", ""); + ++blockNestingLevel; +} + +void TParseContext::nestedStructCheck(const TSourceLoc& loc) +{ + if (structNestingLevel > 0 || blockNestingLevel > 0) + error(loc, "cannot nest a structure definition inside a structure or block", "", ""); + ++structNestingLevel; +} + +void TParseContext::arrayObjectCheck(const TSourceLoc& loc, const TType& type, const char* op) +{ + // Some versions don't allow comparing arrays or structures containing arrays + if (type.containsArray()) { + profileRequires(loc, ENoProfile, 120, E_GL_3DL_array_objects, op); + profileRequires(loc, EEsProfile, 300, nullptr, op); + } +} + +void TParseContext::opaqueCheck(const TSourceLoc& loc, const TType& type, const char* op) +{ + if (containsFieldWithBasicType(type, EbtSampler) && !extensionTurnedOn(E_GL_ARB_bindless_texture)) + error(loc, "can't use with samplers or structs containing samplers", op, ""); +} + +void TParseContext::referenceCheck(const TSourceLoc& loc, const TType& type, const char* op) +{ + if (containsFieldWithBasicType(type, EbtReference)) + error(loc, "can't use with reference types", op, ""); +} + +void TParseContext::storage16BitAssignmentCheck(const TSourceLoc& loc, const TType& type, const char* op) +{ + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtFloat16)) + requireFloat16Arithmetic(loc, op, "can't use with structs containing float16"); + + if (type.isArray() && type.getBasicType() == EbtFloat16) + requireFloat16Arithmetic(loc, op, "can't use with arrays containing float16"); + + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtInt16)) + requireInt16Arithmetic(loc, op, "can't use with structs containing int16"); + + if (type.isArray() && type.getBasicType() == EbtInt16) + requireInt16Arithmetic(loc, op, "can't use with arrays containing int16"); + + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtUint16)) + requireInt16Arithmetic(loc, op, "can't use with structs containing uint16"); + + if (type.isArray() && type.getBasicType() == EbtUint16) + requireInt16Arithmetic(loc, op, "can't use with arrays containing uint16"); + + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtInt8)) + requireInt8Arithmetic(loc, op, "can't use with structs containing int8"); + + if (type.isArray() && type.getBasicType() == EbtInt8) + requireInt8Arithmetic(loc, op, "can't use with arrays containing int8"); + + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtUint8)) + requireInt8Arithmetic(loc, op, "can't use with structs containing uint8"); + + if (type.isArray() && type.getBasicType() == EbtUint8) + requireInt8Arithmetic(loc, op, "can't use with arrays containing uint8"); +} + +void TParseContext::specializationCheck(const TSourceLoc& loc, const TType& type, const char* op) +{ + if (type.containsSpecializationSize()) + error(loc, "can't use with types containing arrays sized with a specialization constant", op, ""); +} + +void TParseContext::structTypeCheck(const TSourceLoc& /*loc*/, TPublicType& publicType) +{ + const TTypeList& typeList = *publicType.userDef->getStruct(); + + // fix and check for member storage qualifiers and types that don't belong within a structure + for (unsigned int member = 0; member < typeList.size(); ++member) { + TQualifier& memberQualifier = typeList[member].type->getQualifier(); + const TSourceLoc& memberLoc = typeList[member].loc; + if (memberQualifier.isAuxiliary() || + memberQualifier.isInterpolation() || + (memberQualifier.storage != EvqTemporary && memberQualifier.storage != EvqGlobal)) + error(memberLoc, "cannot use storage or interpolation qualifiers on structure members", typeList[member].type->getFieldName().c_str(), ""); + if (memberQualifier.isMemory()) + error(memberLoc, "cannot use memory qualifiers on structure members", typeList[member].type->getFieldName().c_str(), ""); + if (memberQualifier.hasLayout()) { + error(memberLoc, "cannot use layout qualifiers on structure members", typeList[member].type->getFieldName().c_str(), ""); + memberQualifier.clearLayout(); + } + if (memberQualifier.invariant) + error(memberLoc, "cannot use invariant qualifier on structure members", typeList[member].type->getFieldName().c_str(), ""); + } +} + +// +// See if this loop satisfies the limitations for ES 2.0 (version 100) for loops in Appendex A: +// +// "The loop index has type int or float. +// +// "The for statement has the form: +// for ( init-declaration ; condition ; expression ) +// init-declaration has the form: type-specifier identifier = constant-expression +// condition has the form: loop-index relational_operator constant-expression +// where relational_operator is one of: > >= < <= == or != +// expression [sic] has one of the following forms: +// loop-index++ +// loop-index-- +// loop-index += constant-expression +// loop-index -= constant-expression +// +// The body is handled in an AST traversal. +// +void TParseContext::inductiveLoopCheck(const TSourceLoc& loc, TIntermNode* init, TIntermLoop* loop) +{ + // loop index init must exist and be a declaration, which shows up in the AST as an aggregate of size 1 of the declaration + bool badInit = false; + if (! init || ! init->getAsAggregate() || init->getAsAggregate()->getSequence().size() != 1) + badInit = true; + TIntermBinary* binaryInit = nullptr; + if (! badInit) { + // get the declaration assignment + binaryInit = init->getAsAggregate()->getSequence()[0]->getAsBinaryNode(); + if (! binaryInit) + badInit = true; + } + if (badInit) { + error(loc, "inductive-loop init-declaration requires the form \"type-specifier loop-index = constant-expression\"", "limitations", ""); + return; + } + + // loop index must be type int or float + if (! binaryInit->getType().isScalar() || (binaryInit->getBasicType() != EbtInt && binaryInit->getBasicType() != EbtFloat)) { + error(loc, "inductive loop requires a scalar 'int' or 'float' loop index", "limitations", ""); + return; + } + + // init is the form "loop-index = constant" + if (binaryInit->getOp() != EOpAssign || ! binaryInit->getLeft()->getAsSymbolNode() || ! binaryInit->getRight()->getAsConstantUnion()) { + error(loc, "inductive-loop init-declaration requires the form \"type-specifier loop-index = constant-expression\"", "limitations", ""); + return; + } + + // get the unique id of the loop index + long long loopIndex = binaryInit->getLeft()->getAsSymbolNode()->getId(); + inductiveLoopIds.insert(loopIndex); + + // condition's form must be "loop-index relational-operator constant-expression" + bool badCond = ! loop->getTestExpr(); + if (! badCond) { + TIntermBinary* binaryCond = loop->getTestExpr()->getAsBinaryNode(); + badCond = ! binaryCond; + if (! badCond) { + switch (binaryCond->getOp()) { + case EOpGreaterThan: + case EOpGreaterThanEqual: + case EOpLessThan: + case EOpLessThanEqual: + case EOpEqual: + case EOpNotEqual: + break; + default: + badCond = true; + } + } + if (binaryCond && (! binaryCond->getLeft()->getAsSymbolNode() || + binaryCond->getLeft()->getAsSymbolNode()->getId() != loopIndex || + ! binaryCond->getRight()->getAsConstantUnion())) + badCond = true; + } + if (badCond) { + error(loc, "inductive-loop condition requires the form \"loop-index constant-expression\"", "limitations", ""); + return; + } + + // loop-index++ + // loop-index-- + // loop-index += constant-expression + // loop-index -= constant-expression + bool badTerminal = ! loop->getTerminal(); + if (! badTerminal) { + TIntermUnary* unaryTerminal = loop->getTerminal()->getAsUnaryNode(); + TIntermBinary* binaryTerminal = loop->getTerminal()->getAsBinaryNode(); + if (unaryTerminal || binaryTerminal) { + switch(loop->getTerminal()->getAsOperator()->getOp()) { + case EOpPostDecrement: + case EOpPostIncrement: + case EOpAddAssign: + case EOpSubAssign: + break; + default: + badTerminal = true; + } + } else + badTerminal = true; + if (binaryTerminal && (! binaryTerminal->getLeft()->getAsSymbolNode() || + binaryTerminal->getLeft()->getAsSymbolNode()->getId() != loopIndex || + ! binaryTerminal->getRight()->getAsConstantUnion())) + badTerminal = true; + if (unaryTerminal && (! unaryTerminal->getOperand()->getAsSymbolNode() || + unaryTerminal->getOperand()->getAsSymbolNode()->getId() != loopIndex)) + badTerminal = true; + } + if (badTerminal) { + error(loc, "inductive-loop termination requires the form \"loop-index++, loop-index--, loop-index += constant-expression, or loop-index -= constant-expression\"", "limitations", ""); + return; + } + + // the body + inductiveLoopBodyCheck(loop->getBody(), loopIndex, symbolTable); +} + +// Do limit checks for built-in arrays. +void TParseContext::arrayLimitCheck(const TSourceLoc& loc, const TString& identifier, int size) +{ + if (identifier.compare("gl_TexCoord") == 0) + limitCheck(loc, size, "gl_MaxTextureCoords", "gl_TexCoord array size"); + else if (identifier.compare("gl_ClipDistance") == 0) + limitCheck(loc, size, "gl_MaxClipDistances", "gl_ClipDistance array size"); + else if (identifier.compare("gl_CullDistance") == 0) + limitCheck(loc, size, "gl_MaxCullDistances", "gl_CullDistance array size"); + else if (identifier.compare("gl_ClipDistancePerViewNV") == 0) + limitCheck(loc, size, "gl_MaxClipDistances", "gl_ClipDistancePerViewNV array size"); + else if (identifier.compare("gl_CullDistancePerViewNV") == 0) + limitCheck(loc, size, "gl_MaxCullDistances", "gl_CullDistancePerViewNV array size"); +} + +// See if the provided value is less than or equal to the symbol indicated by limit, +// which should be a constant in the symbol table. +void TParseContext::limitCheck(const TSourceLoc& loc, int value, const char* limit, const char* feature) +{ + TSymbol* symbol = symbolTable.find(limit); + assert(symbol->getAsVariable()); + const TConstUnionArray& constArray = symbol->getAsVariable()->getConstArray(); + assert(! constArray.empty()); + if (value > constArray[0].getIConst()) + error(loc, "must be less than or equal to", feature, "%s (%d)", limit, constArray[0].getIConst()); +} + +// +// Do any additional error checking, etc., once we know the parsing is done. +// +void TParseContext::finish() +{ + TParseContextBase::finish(); + + if (parsingBuiltins) + return; + + // Forward builtin alias to AST for later use + intermediate.setBuiltinAliasLookup(symbolTable.collectBuiltinAlias()); + + // Check on array indexes for ES 2.0 (version 100) limitations. + for (size_t i = 0; i < needsIndexLimitationChecking.size(); ++i) + constantIndexExpressionCheck(needsIndexLimitationChecking[i]); + + // Check for stages that are enabled by extension. + // Can't do this at the beginning, it is chicken and egg to add a stage by + // extension. + // Stage-specific features were correctly tested for already, this is just + // about the stage itself. + switch (language) { + case EShLangGeometry: + if (isEsProfile() && version == 310) + requireExtensions(getCurrentLoc(), Num_AEP_geometry_shader, AEP_geometry_shader, "geometry shaders"); + break; + case EShLangTessControl: + case EShLangTessEvaluation: + if (isEsProfile() && version == 310) + requireExtensions(getCurrentLoc(), Num_AEP_tessellation_shader, AEP_tessellation_shader, "tessellation shaders"); + else if (!isEsProfile() && version < 400) + requireExtensions(getCurrentLoc(), 1, &E_GL_ARB_tessellation_shader, "tessellation shaders"); + break; + case EShLangCompute: + if (!isEsProfile() && version < 430) + requireExtensions(getCurrentLoc(), 1, &E_GL_ARB_compute_shader, "compute shaders"); + break; + case EShLangTask: + requireExtensions(getCurrentLoc(), Num_AEP_mesh_shader, AEP_mesh_shader, "task shaders"); + break; + case EShLangMesh: + requireExtensions(getCurrentLoc(), Num_AEP_mesh_shader, AEP_mesh_shader, "mesh shaders"); + break; + default: + break; + } + + // Set default outputs for GL_NV_geometry_shader_passthrough + if (language == EShLangGeometry && extensionTurnedOn(E_SPV_NV_geometry_shader_passthrough)) { + if (intermediate.getOutputPrimitive() == ElgNone) { + switch (intermediate.getInputPrimitive()) { + case ElgPoints: intermediate.setOutputPrimitive(ElgPoints); break; + case ElgLines: intermediate.setOutputPrimitive(ElgLineStrip); break; + case ElgTriangles: intermediate.setOutputPrimitive(ElgTriangleStrip); break; + default: break; + } + } + if (intermediate.getVertices() == TQualifier::layoutNotSet) { + switch (intermediate.getInputPrimitive()) { + case ElgPoints: intermediate.setVertices(1); break; + case ElgLines: intermediate.setVertices(2); break; + case ElgTriangles: intermediate.setVertices(3); break; + default: break; + } + } + } +} + +// +// Layout qualifier stuff. +// + +// Put the id's layout qualification into the public type, for qualifiers not having a number set. +// This is before we know any type information for error checking. +void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publicType, TString& id) +{ + std::transform(id.begin(), id.end(), id.begin(), ::tolower); + + if (id == TQualifier::getLayoutMatrixString(ElmColumnMajor)) { + publicType.qualifier.layoutMatrix = ElmColumnMajor; + return; + } + if (id == TQualifier::getLayoutMatrixString(ElmRowMajor)) { + publicType.qualifier.layoutMatrix = ElmRowMajor; + return; + } + if (id == TQualifier::getLayoutPackingString(ElpPacked)) { + if (spvVersion.spv != 0) { + if (spvVersion.vulkanRelaxed) + return; // silently ignore qualifier + else + spvRemoved(loc, "packed"); + } + publicType.qualifier.layoutPacking = ElpPacked; + return; + } + if (id == TQualifier::getLayoutPackingString(ElpShared)) { + if (spvVersion.spv != 0) { + if (spvVersion.vulkanRelaxed) + return; // silently ignore qualifier + else + spvRemoved(loc, "shared"); + } + publicType.qualifier.layoutPacking = ElpShared; + return; + } + if (id == TQualifier::getLayoutPackingString(ElpStd140)) { + publicType.qualifier.layoutPacking = ElpStd140; + return; + } + if (id == TQualifier::getLayoutPackingString(ElpStd430)) { + requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, "std430"); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_shader_storage_buffer_object, "std430"); + profileRequires(loc, EEsProfile, 310, nullptr, "std430"); + publicType.qualifier.layoutPacking = ElpStd430; + return; + } + if (id == TQualifier::getLayoutPackingString(ElpScalar)) { + requireVulkan(loc, "scalar"); + requireExtensions(loc, 1, &E_GL_EXT_scalar_block_layout, "scalar block layout"); + publicType.qualifier.layoutPacking = ElpScalar; + return; + } + // TODO: compile-time performance: may need to stop doing linear searches + for (TLayoutFormat format = (TLayoutFormat)(ElfNone + 1); format < ElfCount; format = (TLayoutFormat)(format + 1)) { + if (id == TQualifier::getLayoutFormatString(format)) { + if ((format > ElfEsFloatGuard && format < ElfFloatGuard) || + (format > ElfEsIntGuard && format < ElfIntGuard) || + (format > ElfEsUintGuard && format < ElfCount)) + requireProfile(loc, ENoProfile | ECoreProfile | ECompatibilityProfile, "image load-store format"); + profileRequires(loc, ENoProfile | ECoreProfile | ECompatibilityProfile, 420, E_GL_ARB_shader_image_load_store, "image load store"); + profileRequires(loc, EEsProfile, 310, E_GL_ARB_shader_image_load_store, "image load store"); + publicType.qualifier.layoutFormat = format; + return; + } + } + if (id == "push_constant") { + requireVulkan(loc, "push_constant"); + publicType.qualifier.layoutPushConstant = true; + return; + } + if (id == "buffer_reference") { + requireVulkan(loc, "buffer_reference"); + requireExtensions(loc, 1, &E_GL_EXT_buffer_reference, "buffer_reference"); + publicType.qualifier.layoutBufferReference = true; + intermediate.setUseStorageBuffer(); + intermediate.setUsePhysicalStorageBuffer(); + return; + } + if (id == "bindless_sampler") { + requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "bindless_sampler"); + publicType.qualifier.layoutBindlessSampler = true; + intermediate.setBindlessTextureMode(currentCaller, AstRefTypeLayout); + return; + } + if (id == "bindless_image") { + requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "bindless_image"); + publicType.qualifier.layoutBindlessImage = true; + intermediate.setBindlessImageMode(currentCaller, AstRefTypeLayout); + return; + } + if (id == "bound_sampler") { + requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "bound_sampler"); + publicType.qualifier.layoutBindlessSampler = false; + return; + } + if (id == "bound_image") { + requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "bound_image"); + publicType.qualifier.layoutBindlessImage = false; + return; + } + if (language == EShLangGeometry || language == EShLangTessEvaluation || language == EShLangMesh) { + if (id == TQualifier::getGeometryString(ElgTriangles)) { + publicType.shaderQualifiers.geometry = ElgTriangles; + return; + } + if (language == EShLangGeometry || language == EShLangMesh) { + if (id == TQualifier::getGeometryString(ElgPoints)) { + publicType.shaderQualifiers.geometry = ElgPoints; + return; + } + if (id == TQualifier::getGeometryString(ElgLines)) { + publicType.shaderQualifiers.geometry = ElgLines; + return; + } + if (language == EShLangGeometry) { + if (id == TQualifier::getGeometryString(ElgLineStrip)) { + publicType.shaderQualifiers.geometry = ElgLineStrip; + return; + } + if (id == TQualifier::getGeometryString(ElgLinesAdjacency)) { + publicType.shaderQualifiers.geometry = ElgLinesAdjacency; + return; + } + if (id == TQualifier::getGeometryString(ElgTrianglesAdjacency)) { + publicType.shaderQualifiers.geometry = ElgTrianglesAdjacency; + return; + } + if (id == TQualifier::getGeometryString(ElgTriangleStrip)) { + publicType.shaderQualifiers.geometry = ElgTriangleStrip; + return; + } + if (id == "passthrough") { + requireExtensions(loc, 1, &E_SPV_NV_geometry_shader_passthrough, "geometry shader passthrough"); + publicType.qualifier.layoutPassthrough = true; + intermediate.setGeoPassthroughEXT(); + return; + } + } + } else { + assert(language == EShLangTessEvaluation); + + // input primitive + if (id == TQualifier::getGeometryString(ElgTriangles)) { + publicType.shaderQualifiers.geometry = ElgTriangles; + return; + } + if (id == TQualifier::getGeometryString(ElgQuads)) { + publicType.shaderQualifiers.geometry = ElgQuads; + return; + } + if (id == TQualifier::getGeometryString(ElgIsolines)) { + publicType.shaderQualifiers.geometry = ElgIsolines; + return; + } + + // vertex spacing + if (id == TQualifier::getVertexSpacingString(EvsEqual)) { + publicType.shaderQualifiers.spacing = EvsEqual; + return; + } + if (id == TQualifier::getVertexSpacingString(EvsFractionalEven)) { + publicType.shaderQualifiers.spacing = EvsFractionalEven; + return; + } + if (id == TQualifier::getVertexSpacingString(EvsFractionalOdd)) { + publicType.shaderQualifiers.spacing = EvsFractionalOdd; + return; + } + + // triangle order + if (id == TQualifier::getVertexOrderString(EvoCw)) { + publicType.shaderQualifiers.order = EvoCw; + return; + } + if (id == TQualifier::getVertexOrderString(EvoCcw)) { + publicType.shaderQualifiers.order = EvoCcw; + return; + } + + // point mode + if (id == "point_mode") { + publicType.shaderQualifiers.pointMode = true; + return; + } + } + } + if (language == EShLangFragment) { + if (id == "origin_upper_left") { + requireProfile(loc, ECoreProfile | ECompatibilityProfile | ENoProfile, "origin_upper_left"); + if (profile == ENoProfile) { + profileRequires(loc,ECoreProfile | ECompatibilityProfile, 140, E_GL_ARB_fragment_coord_conventions, "origin_upper_left"); + } + + publicType.shaderQualifiers.originUpperLeft = true; + return; + } + if (id == "pixel_center_integer") { + requireProfile(loc, ECoreProfile | ECompatibilityProfile | ENoProfile, "pixel_center_integer"); + if (profile == ENoProfile) { + profileRequires(loc,ECoreProfile | ECompatibilityProfile, 140, E_GL_ARB_fragment_coord_conventions, "pixel_center_integer"); + } + publicType.shaderQualifiers.pixelCenterInteger = true; + return; + } + if (id == "early_fragment_tests") { + profileRequires(loc, ENoProfile | ECoreProfile | ECompatibilityProfile, 420, E_GL_ARB_shader_image_load_store, "early_fragment_tests"); + profileRequires(loc, EEsProfile, 310, nullptr, "early_fragment_tests"); + publicType.shaderQualifiers.earlyFragmentTests = true; + return; + } + if (id == "early_and_late_fragment_tests_amd") { + profileRequires(loc, ENoProfile | ECoreProfile | ECompatibilityProfile, 420, E_GL_AMD_shader_early_and_late_fragment_tests, "early_and_late_fragment_tests_amd"); + profileRequires(loc, EEsProfile, 310, nullptr, "early_and_late_fragment_tests_amd"); + publicType.shaderQualifiers.earlyAndLateFragmentTestsAMD = true; + return; + } + if (id == "post_depth_coverage") { + requireExtensions(loc, Num_post_depth_coverageEXTs, post_depth_coverageEXTs, "post depth coverage"); + if (extensionTurnedOn(E_GL_ARB_post_depth_coverage)) { + publicType.shaderQualifiers.earlyFragmentTests = true; + } + publicType.shaderQualifiers.postDepthCoverage = true; + return; + } + /* id is transformed into lower case in the beginning of this function. */ + if (id == "non_coherent_color_attachment_readext") { + requireExtensions(loc, 1, &E_GL_EXT_shader_tile_image, "non_coherent_color_attachment_readEXT"); + publicType.shaderQualifiers.nonCoherentColorAttachmentReadEXT = true; + return; + } + if (id == "non_coherent_depth_attachment_readext") { + requireExtensions(loc, 1, &E_GL_EXT_shader_tile_image, "non_coherent_depth_attachment_readEXT"); + publicType.shaderQualifiers.nonCoherentDepthAttachmentReadEXT = true; + return; + } + if (id == "non_coherent_stencil_attachment_readext") { + requireExtensions(loc, 1, &E_GL_EXT_shader_tile_image, "non_coherent_stencil_attachment_readEXT"); + publicType.shaderQualifiers.nonCoherentStencilAttachmentReadEXT = true; + return; + } + for (TLayoutDepth depth = (TLayoutDepth)(EldNone + 1); depth < EldCount; depth = (TLayoutDepth)(depth+1)) { + if (id == TQualifier::getLayoutDepthString(depth)) { + const char* feature = "depth layout qualifier"; + requireProfile(loc, ECoreProfile | ECompatibilityProfile | EEsProfile, feature); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 420, E_GL_ARB_conservative_depth, feature); + profileRequires(loc, EEsProfile, 0, E_GL_EXT_conservative_depth, feature); + publicType.shaderQualifiers.layoutDepth = depth; + return; + } + } + for (TLayoutStencil stencil = (TLayoutStencil)(ElsNone + 1); stencil < ElsCount; stencil = (TLayoutStencil)(stencil+1)) { + if (id == TQualifier::getLayoutStencilString(stencil)) { + requireProfile(loc, ECoreProfile | ECompatibilityProfile, "stencil layout qualifier"); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 420, nullptr, "stencil layout qualifier"); + publicType.shaderQualifiers.layoutStencil = stencil; + return; + } + } + for (TInterlockOrdering order = (TInterlockOrdering)(EioNone + 1); order < EioCount; order = (TInterlockOrdering)(order+1)) { + if (id == TQualifier::getInterlockOrderingString(order)) { + requireProfile(loc, ECoreProfile | ECompatibilityProfile, "fragment shader interlock layout qualifier"); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 450, nullptr, "fragment shader interlock layout qualifier"); + requireExtensions(loc, 1, &E_GL_ARB_fragment_shader_interlock, TQualifier::getInterlockOrderingString(order)); + if (order == EioShadingRateInterlockOrdered || order == EioShadingRateInterlockUnordered) + requireExtensions(loc, 1, &E_GL_NV_shading_rate_image, TQualifier::getInterlockOrderingString(order)); + publicType.shaderQualifiers.interlockOrdering = order; + return; + } + } + if (id.compare(0, 13, "blend_support") == 0) { + bool found = false; + for (TBlendEquationShift be = (TBlendEquationShift)0; be < EBlendCount; be = (TBlendEquationShift)(be + 1)) { + if (id == TQualifier::getBlendEquationString(be)) { + profileRequires(loc, EEsProfile, 320, E_GL_KHR_blend_equation_advanced, "blend equation"); + profileRequires(loc, ~EEsProfile, 0, E_GL_KHR_blend_equation_advanced, "blend equation"); + intermediate.addBlendEquation(be); + publicType.shaderQualifiers.blendEquation = true; + found = true; + break; + } + } + if (! found) + error(loc, "unknown blend equation", "blend_support", ""); + return; + } + if (id == "override_coverage") { + requireExtensions(loc, 1, &E_GL_NV_sample_mask_override_coverage, "sample mask override coverage"); + publicType.shaderQualifiers.layoutOverrideCoverage = true; + return; + } + if (id == "full_quads") + { + const char* feature = "full_quads qualifier"; + requireProfile(loc, ECompatibilityProfile | ECoreProfile | EEsProfile, feature); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 140, E_GL_EXT_shader_quad_control, feature); + profileRequires(loc, EEsProfile, 310, E_GL_EXT_shader_quad_control, feature); + publicType.qualifier.layoutFullQuads = true; + return; + } + if (id == "non_coherent_attachment_readqcom") { + requireExtensions(loc, 1, &E_GL_QCOM_tile_shading, "tile shading QCOM"); + publicType.shaderQualifiers.layoutNonCoherentTileAttachmentReadQCOM = true; + return; + } + if (id == "tile_attachmentqcom") { + requireExtensions(loc, 1, &E_GL_QCOM_tile_shading, "tile shading QCOM"); + publicType.qualifier.layoutTileAttachmentQCOM = true; + return; + } + } + if (language == EShLangVertex || + language == EShLangTessControl || + language == EShLangTessEvaluation || + language == EShLangGeometry ) { + if (id == "viewport_relative") { + requireExtensions(loc, 1, &E_GL_NV_viewport_array2, "view port array2"); + publicType.qualifier.layoutViewportRelative = true; + return; + } + } else { + if (language == EShLangRayGen || language == EShLangIntersect || + language == EShLangAnyHit || language == EShLangClosestHit || + language == EShLangMiss || language == EShLangCallable) { + if (id == "shaderrecordnv" || id == "shaderrecordext") { + if (id == "shaderrecordnv") { + requireExtensions(loc, 1, &E_GL_NV_ray_tracing, "shader record NV"); + } else { + requireExtensions(loc, 1, &E_GL_EXT_ray_tracing, "shader record EXT"); + } + publicType.qualifier.layoutShaderRecord = true; + return; + } else if (id == "hitobjectshaderrecordnv") { + requireExtensions(loc, 1, &E_GL_NV_shader_invocation_reorder, "hitobject shader record NV"); + publicType.qualifier.layoutHitObjectShaderRecordNV = true; + return; + } else if (id == "hitobjectshaderrecordext") { + requireExtensions(loc, 1, &E_GL_EXT_shader_invocation_reorder, "hitobject shader record EXT"); + publicType.qualifier.layoutHitObjectShaderRecordEXT = true; + return; + } + + } + } + if (language == EShLangCompute) { + if (id.compare(0, 17, "derivative_group_") == 0) { + requireExtensions(loc, 1, &E_GL_NV_compute_shader_derivatives, "compute shader derivatives"); + if (id == "derivative_group_quadsnv") { + publicType.shaderQualifiers.layoutDerivativeGroupQuads = true; + return; + } else if (id == "derivative_group_linearnv") { + publicType.shaderQualifiers.layoutDerivativeGroupLinear = true; + return; + } + } + if (id == "tile_attachmentqcom") { + requireExtensions(loc, 1, &E_GL_QCOM_tile_shading, "tile shading QCOM"); + publicType.qualifier.layoutTileAttachmentQCOM = true; + return; + } + } + + if (id == "primitive_culling") { + requireExtensions(loc, 1, &E_GL_EXT_ray_flags_primitive_culling, "primitive culling"); + publicType.shaderQualifiers.layoutPrimitiveCulling = true; + return; + } + + if (id == "quad_derivatives") + { + const char* feature = "quad_derivatives qualifier"; + requireProfile(loc, ECompatibilityProfile | ECoreProfile | EEsProfile, feature); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 140, E_GL_EXT_shader_quad_control, feature); + profileRequires(loc, EEsProfile, 310, E_GL_EXT_shader_quad_control, feature); + publicType.qualifier.layoutQuadDeriv = true; + return; + } + + error(loc, "unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4)", id.c_str(), ""); +} + +// Put the id's layout qualifier value into the public type, for qualifiers having a number set. +// This is before we know any type information for error checking. +void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publicType, TString& id, const TIntermTyped* node) +{ + const char* feature = "layout-id value"; + const char* nonLiteralFeature = "non-literal layout-id value"; + + integerCheck(node, feature); + const TIntermConstantUnion* constUnion = node->getAsConstantUnion(); + int value; + bool nonLiteral = false; + if (constUnion) { + value = constUnion->getConstArray()[0].getIConst(); + if (! constUnion->isLiteral()) { + requireProfile(loc, ECoreProfile | ECompatibilityProfile, nonLiteralFeature); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 440, E_GL_ARB_enhanced_layouts, nonLiteralFeature); + } + } else { + // grammar should have give out the error message + value = 0; + nonLiteral = true; + } + + if (value < 0) { + error(loc, "cannot be negative", feature, ""); + return; + } + + std::transform(id.begin(), id.end(), id.begin(), ::tolower); + + if (id == "offset") { + // "offset" can be for either + // - uniform offsets + // - atomic_uint offsets + const char* feature = "offset"; + if (spvVersion.spv == 0) { + requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, feature); + const char* exts[2] = { E_GL_ARB_enhanced_layouts, E_GL_ARB_shader_atomic_counters }; + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 420, 2, exts, feature); + profileRequires(loc, EEsProfile, 310, nullptr, feature); + } + publicType.qualifier.layoutOffset = value; + publicType.qualifier.explicitOffset = true; + if (nonLiteral) + error(loc, "needs a literal integer", "offset", ""); + return; + } else if (id == "align") { + const char* feature = "uniform buffer-member align"; + if (spvVersion.spv == 0) { + requireProfile(loc, ECoreProfile | ECompatibilityProfile, feature); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 440, E_GL_ARB_enhanced_layouts, feature); + } + // "The specified alignment must be a power of 2, or a compile-time error results." + if (! IsPow2(value)) + error(loc, "must be a power of 2", "align", ""); + else + publicType.qualifier.layoutAlign = value; + if (nonLiteral) + error(loc, "needs a literal integer", "align", ""); + return; + } else if (id == "location") { + profileRequires(loc, EEsProfile, 300, nullptr, "location"); + const char* exts[2] = { E_GL_ARB_separate_shader_objects, E_GL_ARB_explicit_attrib_location }; + // GL_ARB_explicit_uniform_location requires 330 or GL_ARB_explicit_attrib_location we do not need to add it here + profileRequires(loc, ~EEsProfile, 330, 2, exts, "location"); + if ((unsigned int)value >= TQualifier::layoutLocationEnd) + error(loc, "location is too large", id.c_str(), ""); + else + publicType.qualifier.layoutLocation = value; + if (nonLiteral) + error(loc, "needs a literal integer", "location", ""); + return; + } else if (id == "set") { + if ((unsigned int)value >= TQualifier::layoutSetEnd) + error(loc, "set is too large", id.c_str(), ""); + else + publicType.qualifier.layoutSet = value; + if (value != 0) + requireVulkan(loc, "descriptor set"); + if (nonLiteral) + error(loc, "needs a literal integer", "set", ""); + return; + } else if (id == "binding") { + profileRequires(loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, "binding"); + profileRequires(loc, EEsProfile, 310, nullptr, "binding"); + if ((unsigned int)value >= TQualifier::layoutBindingEnd) + error(loc, "binding is too large", id.c_str(), ""); + else + publicType.qualifier.layoutBinding = value; + if (nonLiteral) + error(loc, "needs a literal integer", "binding", ""); + return; + } + if (id == "constant_id") { + requireSpv(loc, "constant_id"); + if (value >= (int)TQualifier::layoutSpecConstantIdEnd) { + error(loc, "specialization-constant id is too large", id.c_str(), ""); + } else { + publicType.qualifier.layoutSpecConstantId = value; + publicType.qualifier.specConstant = true; + if (! intermediate.addUsedConstantId(value)) + error(loc, "specialization-constant id already used", id.c_str(), ""); + } + if (nonLiteral) + error(loc, "needs a literal integer", "constant_id", ""); + return; + } + if (id == "component") { + requireProfile(loc, ECoreProfile | ECompatibilityProfile, "component"); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 440, E_GL_ARB_enhanced_layouts, "component"); + if ((unsigned)value >= TQualifier::layoutComponentEnd) + error(loc, "component is too large", id.c_str(), ""); + else + publicType.qualifier.layoutComponent = value; + if (nonLiteral) + error(loc, "needs a literal integer", "component", ""); + return; + } + if (id.compare(0, 4, "xfb_") == 0) { + // "Any shader making any static use (after preprocessing) of any of these + // *xfb_* qualifiers will cause the shader to be in a transform feedback + // capturing mode and hence responsible for describing the transform feedback + // setup." + intermediate.setXfbMode(); + const char* feature = "transform feedback qualifier"; + requireStage(loc, (EShLanguageMask)(EShLangVertexMask | EShLangGeometryMask | EShLangTessControlMask | EShLangTessEvaluationMask), feature); + requireProfile(loc, ECoreProfile | ECompatibilityProfile, feature); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 440, E_GL_ARB_enhanced_layouts, feature); + if (id == "xfb_buffer") { + // "It is a compile-time error to specify an *xfb_buffer* that is greater than + // the implementation-dependent constant gl_MaxTransformFeedbackBuffers." + if (value >= resources.maxTransformFeedbackBuffers) + error(loc, "buffer is too large:", id.c_str(), "gl_MaxTransformFeedbackBuffers is %d", resources.maxTransformFeedbackBuffers); + if (value >= (int)TQualifier::layoutXfbBufferEnd) + error(loc, "buffer is too large:", id.c_str(), "internal max is %d", TQualifier::layoutXfbBufferEnd-1); + else + publicType.qualifier.layoutXfbBuffer = value; + if (nonLiteral) + error(loc, "needs a literal integer", "xfb_buffer", ""); + return; + } else if (id == "xfb_offset") { + if (value >= (int)TQualifier::layoutXfbOffsetEnd) + error(loc, "offset is too large:", id.c_str(), "internal max is %d", TQualifier::layoutXfbOffsetEnd-1); + else + publicType.qualifier.layoutXfbOffset = value; + if (nonLiteral) + error(loc, "needs a literal integer", "xfb_offset", ""); + return; + } else if (id == "xfb_stride") { + // "The resulting stride (implicit or explicit), when divided by 4, must be less than or equal to the + // implementation-dependent constant gl_MaxTransformFeedbackInterleavedComponents." + if (value > 4 * resources.maxTransformFeedbackInterleavedComponents) { + error(loc, "1/4 stride is too large:", id.c_str(), "gl_MaxTransformFeedbackInterleavedComponents is %d", + resources.maxTransformFeedbackInterleavedComponents); + } + if (value >= (int)TQualifier::layoutXfbStrideEnd) + error(loc, "stride is too large:", id.c_str(), "internal max is %d", TQualifier::layoutXfbStrideEnd-1); + else + publicType.qualifier.layoutXfbStride = value; + if (nonLiteral) + error(loc, "needs a literal integer", "xfb_stride", ""); + return; + } + } + if (id == "input_attachment_index") { + requireVulkan(loc, "input_attachment_index"); + if (value >= (int)TQualifier::layoutAttachmentEnd) + error(loc, "attachment index is too large", id.c_str(), ""); + else + publicType.qualifier.layoutAttachment = value; + if (nonLiteral) + error(loc, "needs a literal integer", "input_attachment_index", ""); + return; + } + if (id == "num_views") { + requireExtensions(loc, Num_OVR_multiview_EXTs, OVR_multiview_EXTs, "num_views"); + publicType.shaderQualifiers.numViews = value; + if (nonLiteral) + error(loc, "needs a literal integer", "num_views", ""); + return; + } + if (language == EShLangVertex || + language == EShLangTessControl || + language == EShLangTessEvaluation || + language == EShLangGeometry) { + if (id == "secondary_view_offset") { + requireExtensions(loc, 1, &E_GL_NV_stereo_view_rendering, "stereo view rendering"); + publicType.qualifier.layoutSecondaryViewportRelativeOffset = value; + if (nonLiteral) + error(loc, "needs a literal integer", "secondary_view_offset", ""); + return; + } + } + + if (id == "buffer_reference_align") { + requireExtensions(loc, 1, &E_GL_EXT_buffer_reference, "buffer_reference_align"); + if (! IsPow2(value)) + error(loc, "must be a power of 2", "buffer_reference_align", ""); + else + publicType.qualifier.layoutBufferReferenceAlign = IntLog2(value); + if (nonLiteral) + error(loc, "needs a literal integer", "buffer_reference_align", ""); + return; + } + + switch (language) { + case EShLangTessControl: + if (id == "vertices") { + if (value == 0) + error(loc, "must be greater than 0", "vertices", ""); + else + publicType.shaderQualifiers.vertices = value; + if (nonLiteral) + error(loc, "needs a literal integer", "vertices", ""); + return; + } + break; + + case EShLangGeometry: + if (id == "invocations") { + profileRequires(loc, ECompatibilityProfile | ECoreProfile, 400, + Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5, "invocations"); + + if (value == 0) + error(loc, "must be at least 1", "invocations", ""); + else + publicType.shaderQualifiers.invocations = value; + if (nonLiteral) + error(loc, "needs a literal integer", "invocations", ""); + return; + } + if (id == "max_vertices") { + publicType.shaderQualifiers.vertices = value; + if (value > resources.maxGeometryOutputVertices) + error(loc, "too large, must be less than gl_MaxGeometryOutputVertices", "max_vertices", ""); + if (nonLiteral) + error(loc, "needs a literal integer", "max_vertices", ""); + return; + } + if (id == "stream") { + requireProfile(loc, ~EEsProfile, "selecting output stream"); + publicType.qualifier.layoutStream = value; + if (value > 0) + intermediate.setMultiStream(); + if (nonLiteral) + error(loc, "needs a literal integer", "stream", ""); + return; + } + break; + + case EShLangFragment: + if (id == "index") { + requireProfile(loc, ECompatibilityProfile | ECoreProfile | EEsProfile, "index layout qualifier on fragment output"); + const char* exts[2] = { E_GL_ARB_separate_shader_objects, E_GL_ARB_explicit_attrib_location }; + profileRequires(loc, ECompatibilityProfile | ECoreProfile, 330, 2, exts, "index layout qualifier on fragment output"); + profileRequires(loc, EEsProfile ,310, E_GL_EXT_blend_func_extended, "index layout qualifier on fragment output"); + // "It is also a compile-time error if a fragment shader sets a layout index to less than 0 or greater than 1." + if (value < 0 || value > 1) { + value = 0; + error(loc, "value must be 0 or 1", "index", ""); + } + + publicType.qualifier.layoutIndex = value; + if (nonLiteral) + error(loc, "needs a literal integer", "index", ""); + return; + } + break; + + case EShLangMesh: + if (id == "max_vertices") { + requireExtensions(loc, Num_AEP_mesh_shader, AEP_mesh_shader, "max_vertices"); + publicType.shaderQualifiers.vertices = value; + int max = extensionTurnedOn(E_GL_EXT_mesh_shader) ? resources.maxMeshOutputVerticesEXT + : resources.maxMeshOutputVerticesNV; + if (value > max) { + TString maxsErrtring = "too large, must be less than "; + maxsErrtring.append(extensionTurnedOn(E_GL_EXT_mesh_shader) ? "gl_MaxMeshOutputVerticesEXT" + : "gl_MaxMeshOutputVerticesNV"); + error(loc, maxsErrtring.c_str(), "max_vertices", ""); + } + if (nonLiteral) + error(loc, "needs a literal integer", "max_vertices", ""); + return; + } + if (id == "max_primitives") { + requireExtensions(loc, Num_AEP_mesh_shader, AEP_mesh_shader, "max_primitives"); + publicType.shaderQualifiers.primitives = value; + int max = extensionTurnedOn(E_GL_EXT_mesh_shader) ? resources.maxMeshOutputPrimitivesEXT + : resources.maxMeshOutputPrimitivesNV; + if (value > max) { + TString maxsErrtring = "too large, must be less than "; + maxsErrtring.append(extensionTurnedOn(E_GL_EXT_mesh_shader) ? "gl_MaxMeshOutputPrimitivesEXT" + : "gl_MaxMeshOutputPrimitivesNV"); + error(loc, maxsErrtring.c_str(), "max_primitives", ""); + } + if (nonLiteral) + error(loc, "needs a literal integer", "max_primitives", ""); + return; + } + [[fallthrough]]; + + case EShLangTask: + // Fall through + case EShLangCompute: + if (id.compare(0, 11, "local_size_") == 0) { + if (language == EShLangMesh || language == EShLangTask) { + requireExtensions(loc, Num_AEP_mesh_shader, AEP_mesh_shader, "gl_WorkGroupSize"); + } else { + profileRequires(loc, EEsProfile, 310, nullptr, "gl_WorkGroupSize"); + profileRequires(loc, ~EEsProfile, 430, E_GL_ARB_compute_shader, "gl_WorkGroupSize"); + } + if (nonLiteral) + error(loc, "needs a literal integer", "local_size", ""); + if (id.size() == 12 && value == 0) { + error(loc, "must be at least 1", id.c_str(), ""); + return; + } + if (id == "local_size_x") { + publicType.shaderQualifiers.localSize[0] = value; + publicType.shaderQualifiers.localSizeNotDefault[0] = true; + return; + } + if (id == "local_size_y") { + publicType.shaderQualifiers.localSize[1] = value; + publicType.shaderQualifiers.localSizeNotDefault[1] = true; + return; + } + if (id == "local_size_z") { + publicType.shaderQualifiers.localSize[2] = value; + publicType.shaderQualifiers.localSizeNotDefault[2] = true; + return; + } + if (spvVersion.spv != 0) { + if (id == "local_size_x_id") { + publicType.shaderQualifiers.localSizeSpecId[0] = value; + return; + } + if (id == "local_size_y_id") { + publicType.shaderQualifiers.localSizeSpecId[1] = value; + return; + } + if (id == "local_size_z_id") { + publicType.shaderQualifiers.localSizeSpecId[2] = value; + return; + } + } + } + if (id.compare(0, 18, "shading_rate_xqcom") == 0 || + id.compare(0, 18, "shading_rate_yqcom") == 0 || + id.compare(0, 18, "shading_rate_zqcom") == 0) { + requireExtensions(loc, 1, &E_GL_QCOM_tile_shading, "tile shading QCOM"); + if (nonLiteral) + error(loc, "needs a literal integer", "shading_rate_*QCOM", ""); + if (id.size() == 18 && value == 0) { + error(loc, "must be at least 1", id.c_str(), ""); + return; + } + if (id == "shading_rate_xqcom") { + publicType.shaderQualifiers.layoutTileShadingRateQCOM[0] = value; + publicType.shaderQualifiers.layoutTileShadingRateQCOMNotDefault[0] = true; + if (! IsPow2(value)) + error(loc, "must be a power of 2", id.c_str(), ""); + return; + } + if (id == "shading_rate_yqcom") { + publicType.shaderQualifiers.layoutTileShadingRateQCOM[1] = value; + publicType.shaderQualifiers.layoutTileShadingRateQCOMNotDefault[1] = true; + if (! IsPow2(value)) + error(loc, "must be a power of 2", id.c_str(), ""); + return; + } + if (id == "shading_rate_zqcom") { + publicType.shaderQualifiers.layoutTileShadingRateQCOM[2] = value; + publicType.shaderQualifiers.layoutTileShadingRateQCOMNotDefault[2] = true; + if (value <= 0) + error(loc, "must be a positive value", id.c_str(), ""); + return; + } + } + break; + + default: + break; + } + + error(loc, "there is no such layout identifier for this stage taking an assigned value", id.c_str(), ""); +} + +// Merge any layout qualifier information from src into dst, leaving everything else in dst alone +// +// "More than one layout qualifier may appear in a single declaration. +// Additionally, the same layout-qualifier-name can occur multiple times +// within a layout qualifier or across multiple layout qualifiers in the +// same declaration. When the same layout-qualifier-name occurs +// multiple times, in a single declaration, the last occurrence overrides +// the former occurrence(s). Further, if such a layout-qualifier-name +// will effect subsequent declarations or other observable behavior, it +// is only the last occurrence that will have any effect, behaving as if +// the earlier occurrence(s) within the declaration are not present. +// This is also true for overriding layout-qualifier-names, where one +// overrides the other (e.g., row_major vs. column_major); only the last +// occurrence has any effect." +void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifier& src, bool inheritOnly) +{ + if (src.hasMatrix()) + dst.layoutMatrix = src.layoutMatrix; + if (src.hasPacking()) + dst.layoutPacking = src.layoutPacking; + + if (src.hasStream()) + dst.layoutStream = src.layoutStream; + if (src.hasFormat()) + dst.layoutFormat = src.layoutFormat; + if (src.hasXfbBuffer()) + dst.layoutXfbBuffer = src.layoutXfbBuffer; + if (src.hasBufferReferenceAlign()) + dst.layoutBufferReferenceAlign = src.layoutBufferReferenceAlign; + + if (src.hasAlign()) + dst.layoutAlign = src.layoutAlign; + + if (! inheritOnly) { + if (src.hasLocation()) + dst.layoutLocation = src.layoutLocation; + if (src.hasOffset()) + dst.layoutOffset = src.layoutOffset; + if (src.hasSet()) + dst.layoutSet = src.layoutSet; + if (src.layoutBinding != TQualifier::layoutBindingEnd) + dst.layoutBinding = src.layoutBinding; + + if (src.hasSpecConstantId()) + dst.layoutSpecConstantId = src.layoutSpecConstantId; + + if (src.hasComponent()) + dst.layoutComponent = src.layoutComponent; + if (src.hasIndex()) + dst.layoutIndex = src.layoutIndex; + if (src.hasXfbStride()) + dst.layoutXfbStride = src.layoutXfbStride; + if (src.hasXfbOffset()) + dst.layoutXfbOffset = src.layoutXfbOffset; + if (src.hasAttachment()) + dst.layoutAttachment = src.layoutAttachment; + if (src.layoutPushConstant) + dst.layoutPushConstant = true; + + if (src.layoutBufferReference) + dst.layoutBufferReference = true; + + if (src.layoutPassthrough) + dst.layoutPassthrough = true; + if (src.layoutViewportRelative) + dst.layoutViewportRelative = true; + if (src.layoutSecondaryViewportRelativeOffset != -2048) + dst.layoutSecondaryViewportRelativeOffset = src.layoutSecondaryViewportRelativeOffset; + if (src.layoutShaderRecord) + dst.layoutShaderRecord = true; + if (src.layoutFullQuads) + dst.layoutFullQuads = true; + if (src.layoutQuadDeriv) + dst.layoutQuadDeriv = true; + if (src.layoutBindlessSampler) + dst.layoutBindlessSampler = true; + if (src.layoutBindlessImage) + dst.layoutBindlessImage = true; + if (src.pervertexNV) + dst.pervertexNV = true; + if (src.pervertexEXT) + dst.pervertexEXT = true; + if (src.layoutHitObjectShaderRecordNV) + dst.layoutHitObjectShaderRecordNV = true; + dst.layoutTileAttachmentQCOM |= src.layoutTileAttachmentQCOM; + if (src.layoutHitObjectShaderRecordEXT) + dst.layoutHitObjectShaderRecordEXT = true; + } +} + +// Do error layout error checking given a full variable/block declaration. +void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symbol) +{ + const TType& type = symbol.getType(); + const TQualifier& qualifier = type.getQualifier(); + + // first, cross check WRT to just the type + layoutTypeCheck(loc, type); + + // now, any remaining error checking based on the object itself + + if (qualifier.hasAnyLocation()) { + switch (qualifier.storage) { + case EvqUniform: + case EvqBuffer: + if (symbol.getAsVariable() == nullptr) + error(loc, "can only be used on variable declaration", "location", ""); + break; + default: + break; + } + } + + // user-variable location check, which are required for SPIR-V in/out: + // - variables have it directly, + // - blocks have it on each member (already enforced), so check first one + if (spvVersion.spv > 0 && !parsingBuiltins && qualifier.builtIn == EbvNone && + !qualifier.hasLocation() && !intermediate.getAutoMapLocations()) { + + switch (qualifier.storage) { + case EvqVaryingIn: + case EvqVaryingOut: + if (!type.getQualifier().isTaskMemory() && !type.getQualifier().hasSpirvDecorate() && + (type.getBasicType() != EbtBlock || + (!(*type.getStruct())[0].type->getQualifier().hasLocation() && + (*type.getStruct())[0].type->getQualifier().builtIn == EbvNone))) + error(loc, "SPIR-V requires location for user input/output", "location", ""); + break; + default: + break; + } + } + + // Check packing and matrix + if (qualifier.hasUniformLayout()) { + switch (qualifier.storage) { + case EvqUniform: + case EvqBuffer: + if (type.getBasicType() != EbtBlock) { + if (qualifier.hasMatrix()) + error(loc, "cannot specify matrix layout on a variable declaration", "layout", ""); + if (qualifier.hasPacking()) + error(loc, "cannot specify packing on a variable declaration", "layout", ""); + // "The offset qualifier can only be used on block members of blocks..." + if (qualifier.hasOffset() && !type.isAtomic()) + error(loc, "cannot specify on a variable declaration", "offset", ""); + // "The align qualifier can only be used on blocks or block members..." + if (qualifier.hasAlign()) + error(loc, "cannot specify on a variable declaration", "align", ""); + if (qualifier.isPushConstant()) + error(loc, "can only specify on a uniform block", "push_constant", ""); + if (qualifier.isShaderRecord()) + error(loc, "can only specify on a buffer block", "shaderRecordNV", ""); + if (qualifier.hasLocation() && type.isAtomic()) + error(loc, "cannot specify on atomic counter", "location", ""); + } + break; + default: + // these were already filtered by layoutTypeCheck() (or its callees) + break; + } + } + + // Check that an in/out variable or block doesn't contain a boolean member + // Don't enforce if redeclaring a builtin, which are allowed to contain bool + if (!parsingBuiltins && type.containsBasicType(EbtBool) && !builtInName(symbol.getName())) { + switch(qualifier.storage) { + case EvqVaryingIn: + case EvqVaryingOut: + { + const char *reason = type.getBasicType() == EbtBool ? "cannot be bool" : "cannot contain bool"; + error(loc, reason, GetStorageQualifierString(qualifier.storage), ""); + break; + } + default: + break; + } + } +} + +// "For some blocks declared as arrays, the location can only be applied at the block level: +// When a block is declared as an array where additional locations are needed for each member +// for each block array element, it is a compile-time error to specify locations on the block +// members. That is, when locations would be under specified by applying them on block members, +// they are not allowed on block members. For arrayed interfaces (those generally having an +// extra level of arrayness due to interface expansion), the outer array is stripped before +// applying this rule." +void TParseContext::layoutMemberLocationArrayCheck(const TSourceLoc& loc, bool memberWithLocation, + TArraySizes* arraySizes) +{ + if (memberWithLocation && arraySizes != nullptr) { + if (arraySizes->getNumDims() > (currentBlockQualifier.isArrayedIo(language) ? 1 : 0)) + error(loc, "cannot use in a block array where new locations are needed for each block element", + "location", ""); + } +} + +// Do layout error checking with respect to a type. +void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) +{ + const TQualifier& qualifier = type.getQualifier(); + + // first, intra-layout qualifier-only error checking + layoutQualifierCheck(loc, qualifier); + + // now, error checking combining type and qualifier + + if (qualifier.hasAnyLocation()) { + if (qualifier.hasLocation()) { + if (qualifier.storage == EvqVaryingOut && language == EShLangFragment) { + if (qualifier.layoutLocation >= (unsigned int)resources.maxDrawBuffers) + error(loc, "too large for fragment output", "location", ""); + } + } + if (qualifier.hasComponent()) { + // "It is a compile-time error if this sequence of components gets larger than 3." + if (qualifier.layoutComponent + type.getVectorSize() * (type.getBasicType() == EbtDouble ? 2 : 1) > 4) + error(loc, "type overflows the available 4 components", "component", ""); + + // "It is a compile-time error to apply the component qualifier to a matrix, a structure, a block, or an array containing any of these." + if (type.isMatrix() || type.getBasicType() == EbtBlock || type.getBasicType() == EbtStruct) + error(loc, "cannot apply to a matrix, structure, or block", "component", ""); + + // " It is a compile-time error to use component 1 or 3 as the beginning of a double or dvec2." + if (type.getBasicType() == EbtDouble) + if (qualifier.layoutComponent & 1) + error(loc, "doubles cannot start on an odd-numbered component", "component", ""); + } + + switch (qualifier.storage) { + case EvqVaryingIn: + case EvqVaryingOut: + if (type.getBasicType() == EbtBlock) + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 440, E_GL_ARB_enhanced_layouts, "location qualifier on in/out block"); + if (type.getQualifier().isTaskMemory()) + error(loc, "cannot apply to taskNV in/out blocks", "location", ""); + break; + case EvqUniform: + case EvqBuffer: + if (type.getBasicType() == EbtBlock) + error(loc, "cannot apply to uniform or buffer block", "location", ""); + else if (type.getBasicType() == EbtSampler && type.getSampler().isAttachmentEXT()) + error(loc, "only applies to", "location", "%s with storage tileImageEXT", type.getBasicTypeString().c_str()); + break; + case EvqtaskPayloadSharedEXT: + error(loc, "cannot apply to taskPayloadSharedEXT", "location", ""); + break; + case EvqPayload: + case EvqPayloadIn: + case EvqHitAttr: + case EvqCallableData: + case EvqCallableDataIn: + case EvqHitObjectAttrNV: + case EvqHitObjectAttrEXT: + case EvqSpirvStorageClass: + break; + case EvqTileImageEXT: + break; + default: + error(loc, "can only apply to uniform, buffer, in, or out storage qualifiers", "location", ""); + break; + } + + bool typeCollision; + int repeated = intermediate.addUsedLocation(qualifier, type, typeCollision); + if (repeated >= 0 && ! typeCollision) + error(loc, "overlapping use of location", "location", "%d", repeated); + // When location aliasing, the aliases sharing the location must have the same underlying numerical type and bit width( + // floating - point or integer, 32 - bit versus 64 - bit,etc.) + if (typeCollision && (qualifier.isPipeInput() || qualifier.isPipeOutput() || qualifier.storage == EvqTileImageEXT)) + error(loc, "the aliases sharing the location", "location", "%d must be the same basic type and interpolation qualification", repeated); + } + + if (qualifier.hasXfbOffset() && qualifier.hasXfbBuffer()) { + if (type.isUnsizedArray()) { + error(loc, "unsized array", "xfb_offset", "in buffer %d", qualifier.layoutXfbBuffer); + } else { + int repeated = intermediate.addXfbBufferOffset(type); + if (repeated >= 0) + error(loc, "overlapping offsets at", "xfb_offset", "offset %d in buffer %d", repeated, qualifier.layoutXfbBuffer); + } + + // "The offset must be a multiple of the size of the first component of the first + // qualified variable or block member, or a compile-time error results. Further, if applied to an aggregate + // containing a double or 64-bit integer, the offset must also be a multiple of 8..." + if ((type.containsBasicType(EbtDouble) || type.containsBasicType(EbtInt64) || type.containsBasicType(EbtUint64)) && + ! IsMultipleOfPow2(qualifier.layoutXfbOffset, 8)) + error(loc, "type contains double or 64-bit integer; xfb_offset must be a multiple of 8", "xfb_offset", ""); + else if ((type.containsBasicType(EbtBool) || type.containsBasicType(EbtFloat) || + type.containsBasicType(EbtInt) || type.containsBasicType(EbtUint)) && + ! IsMultipleOfPow2(qualifier.layoutXfbOffset, 4)) + error(loc, "must be a multiple of size of first component", "xfb_offset", ""); + // ..., if applied to an aggregate containing a half float or 16-bit integer, the offset must also be a multiple of 2..." + else if ((type.contains16BitFloat() || type.containsBasicType(EbtInt16) || type.containsBasicType(EbtUint16)) && + !IsMultipleOfPow2(qualifier.layoutXfbOffset, 2)) + error(loc, "type contains half float or 16-bit integer; xfb_offset must be a multiple of 2", "xfb_offset", ""); + } + if (qualifier.hasXfbStride() && qualifier.hasXfbBuffer()) { + if (! intermediate.setXfbBufferStride(qualifier.layoutXfbBuffer, qualifier.layoutXfbStride)) + error(loc, "all stride settings must match for xfb buffer", "xfb_stride", "%d", qualifier.layoutXfbBuffer); + } + + if (qualifier.hasBinding()) { + // Binding checking, from the spec: + // + // "If the binding point for any uniform or shader storage block instance is less than zero, or greater than or + // equal to the implementation-dependent maximum number of uniform buffer bindings, a compile-time + // error will occur. When the binding identifier is used with a uniform or shader storage block instanced as + // an array of size N, all elements of the array from binding through binding + N - 1 must be within this + // range." + // + if (!type.isOpaque() && type.getBasicType() != EbtBlock && type.getBasicType() != EbtSpirvType) + error(loc, "requires block, or sampler/image, or atomic-counter type", "binding", ""); + if (type.getBasicType() == EbtSampler) { + int lastBinding = qualifier.layoutBinding; + if (type.isArray()) { + if (spvVersion.vulkan == 0) { + if (type.isSizedArray()) + lastBinding += (type.getCumulativeArraySize() - 1); + else { + warn(loc, "assuming binding count of one for compile-time checking of binding numbers for unsized array", "[]", ""); + } + } + } + if (spvVersion.vulkan == 0 && lastBinding >= resources.maxCombinedTextureImageUnits) + error(loc, "sampler binding not less than gl_MaxCombinedTextureImageUnits", "binding", type.isArray() ? "(using array)" : ""); + } + if (type.isAtomic() && !spvVersion.vulkanRelaxed) { + if (qualifier.layoutBinding >= (unsigned int)resources.maxAtomicCounterBindings) { + error(loc, "atomic_uint binding is too large; see gl_MaxAtomicCounterBindings", "binding", ""); + return; + } + } + } else if (!intermediate.getAutoMapBindings()) { + // some types require bindings + + // atomic_uint + if (type.isAtomic()) + error(loc, "layout(binding=X) is required", "atomic_uint", ""); + + // SPIR-V + if (spvVersion.spv > 0) { + if (qualifier.isUniformOrBuffer()) { + if (type.getBasicType() == EbtBlock && !qualifier.isPushConstant() && + !qualifier.isShaderRecord() && + !qualifier.hasAttachment() && + !qualifier.hasBufferReference()) + error(loc, "uniform/buffer blocks require layout(binding=X)", "binding", ""); + else if (spvVersion.vulkan > 0 && type.getBasicType() == EbtSampler && !type.getSampler().isAttachmentEXT()) + error(loc, "sampler/texture/image requires layout(binding=X)", "binding", ""); + } + } + } + + // some things can't have arrays of arrays + if (type.isArrayOfArrays()) { + if (spvVersion.vulkan > 0) { + if (type.isOpaque() || (type.getQualifier().isUniformOrBuffer() && type.getBasicType() == EbtBlock)) + warn(loc, "Generating SPIR-V array-of-arrays, but Vulkan only supports single array level for this resource", "[][]", ""); + } + } + + // "The offset qualifier can only be used on block members of blocks..." + if (qualifier.hasOffset()) { + if (type.getBasicType() == EbtBlock) + error(loc, "only applies to block members, not blocks", "offset", ""); + } + + // Image format + if (qualifier.hasFormat()) { + if (! type.isImage() && !intermediate.getBindlessImageMode()) + error(loc, "only apply to images", TQualifier::getLayoutFormatString(qualifier.getFormat()), ""); + else { + if (type.getSampler().type == EbtFloat && qualifier.getFormat() > ElfFloatGuard) + error(loc, "does not apply to floating point images", TQualifier::getLayoutFormatString(qualifier.getFormat()), ""); + if (type.getSampler().type == EbtInt && (qualifier.getFormat() < ElfFloatGuard || qualifier.getFormat() > ElfIntGuard)) + error(loc, "does not apply to signed integer images", TQualifier::getLayoutFormatString(qualifier.getFormat()), ""); + if (type.getSampler().type == EbtUint && qualifier.getFormat() < ElfIntGuard) + error(loc, "does not apply to unsigned integer images", TQualifier::getLayoutFormatString(qualifier.getFormat()), ""); + + if (isEsProfile()) { + // "Except for image variables qualified with the format qualifiers r32f, r32i, and r32ui, image variables must + // specify either memory qualifier readonly or the memory qualifier writeonly." + if (! (qualifier.getFormat() == ElfR32f || qualifier.getFormat() == ElfR32i || qualifier.getFormat() == ElfR32ui)) { + if (! qualifier.isReadOnly() && ! qualifier.isWriteOnly()) + error(loc, "format requires readonly or writeonly memory qualifier", TQualifier::getLayoutFormatString(qualifier.getFormat()), ""); + } + } + } + } else if (type.isImage() && ! qualifier.isWriteOnly() && !intermediate.getBindlessImageMode()) { + const char *explanation = "image variables not declared 'writeonly' and without a format layout qualifier"; + requireProfile(loc, ECoreProfile | ECompatibilityProfile, explanation); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 0, E_GL_EXT_shader_image_load_formatted, explanation); + } + + if (qualifier.isPushConstant()) { + if (type.getBasicType() != EbtBlock) + error(loc, "can only be used with a block", "push_constant", ""); + if (type.isArray()) + error(loc, "Push constants blocks can't be an array", "push_constant", ""); + } + + if (type.getBasicType() == EbtReference) { + if (qualifier.isPipeInput()) + error(loc, "cannot contain any structs with buffer_reference.", "in", + "If you want to interface shader stages with a buffer_reference cast to a uint64 or uvec2 instead."); + if (qualifier.isPipeOutput()) + error(loc, "cannot contain any structs with buffer_reference.", "out", + "If you want to interface shader stages with a buffer_reference cast to a uint64 or uvec2 instead."); + } + + if (qualifier.hasBufferReference() && type.getBasicType() != EbtBlock) + error(loc, "can only be used with a block", "buffer_reference", ""); + + if (qualifier.isShaderRecord() && type.getBasicType() != EbtBlock) + error(loc, "can only be used with a block", "shaderRecordNV", ""); + + // input attachment + if (type.isSubpass()) { + if (extensionTurnedOn(E_GL_EXT_shader_tile_image)) + error(loc, "cannot be used with GL_EXT_shader_tile_image enabled", type.getSampler().getString().c_str(), + ""); + if (! qualifier.hasAttachment()) + error(loc, "requires an input_attachment_index layout qualifier", "subpass", ""); + } else { + if (qualifier.hasAttachment()) + error(loc, "can only be used with a subpass", "input_attachment_index", ""); + } + + // specialization-constant id + if (qualifier.hasSpecConstantId()) { + if (type.getQualifier().storage != EvqConst) + error(loc, "can only be applied to 'const'-qualified scalar", "constant_id", ""); + if (! type.isScalar()) + error(loc, "can only be applied to a scalar", "constant_id", ""); + switch (type.getBasicType()) + { + case EbtInt8: + case EbtUint8: + case EbtInt16: + case EbtUint16: + case EbtInt: + case EbtUint: + case EbtInt64: + case EbtUint64: + case EbtBool: + case EbtFloat: + case EbtDouble: + case EbtFloat16: + case EbtBFloat16: + case EbtFloatE5M2: + case EbtFloatE4M3: + break; + default: + error(loc, "cannot be applied to this type", "constant_id", ""); + break; + } + } +} + +static bool storageCanHaveLayoutInBlock(const enum TStorageQualifier storage) +{ + switch (storage) { + case EvqUniform: + case EvqBuffer: + case EvqShared: + return true; + default: + return false; + } +} + +// Do layout error checking that can be done within a layout qualifier proper, not needing to know +// if there are blocks, atomic counters, variables, etc. +void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier& qualifier) +{ + if (qualifier.storage == EvqShared && qualifier.hasLayout()) { + if (spvVersion.spv > 0 && spvVersion.spv < EShTargetSpv_1_4) { + error(loc, "shared block requires at least SPIR-V 1.4", "shared block", ""); + } + profileRequires(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, 0, E_GL_EXT_shared_memory_block, "shared block"); + } + + // "It is a compile-time error to use *component* without also specifying the location qualifier (order does not matter)." + if (qualifier.hasComponent() && ! qualifier.hasLocation()) + error(loc, "must specify 'location' to use 'component'", "component", ""); + + if (qualifier.hasAnyLocation()) { + + // "As with input layout qualifiers, all shaders except compute shaders + // allow *location* layout qualifiers on output variable declarations, + // output block declarations, and output block member declarations." + + switch (qualifier.storage) { + case EvqVaryingIn: + { + const char* feature = "location qualifier on input"; + if (isEsProfile() && version < 310) + requireStage(loc, EShLangVertex, feature); + else + requireStage(loc, (EShLanguageMask)~EShLangComputeMask, feature); + if (language == EShLangVertex) { + const char* exts[2] = { E_GL_ARB_separate_shader_objects, E_GL_ARB_explicit_attrib_location }; + profileRequires(loc, ~EEsProfile, 330, 2, exts, feature); + profileRequires(loc, EEsProfile, 300, nullptr, feature); + } else { + profileRequires(loc, ~EEsProfile, 410, E_GL_ARB_separate_shader_objects, feature); + profileRequires(loc, EEsProfile, 310, nullptr, feature); + } + break; + } + case EvqVaryingOut: + { + const char* feature = "location qualifier on output"; + if (isEsProfile() && version < 310) + requireStage(loc, EShLangFragment, feature); + else + requireStage(loc, (EShLanguageMask)~EShLangComputeMask, feature); + if (language == EShLangFragment) { + const char* exts[2] = { E_GL_ARB_separate_shader_objects, E_GL_ARB_explicit_attrib_location }; + profileRequires(loc, ~EEsProfile, 330, 2, exts, feature); + profileRequires(loc, EEsProfile, 300, nullptr, feature); + } else { + profileRequires(loc, ~EEsProfile, 410, E_GL_ARB_separate_shader_objects, feature); + profileRequires(loc, EEsProfile, 310, nullptr, feature); + } + break; + } + case EvqUniform: + case EvqBuffer: + { + const char* feature = "location qualifier on uniform or buffer"; + requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile | ENoProfile, feature); + profileRequires(loc, ~EEsProfile, 330, E_GL_ARB_explicit_attrib_location, feature); + profileRequires(loc, ~EEsProfile, 430, E_GL_ARB_explicit_uniform_location, feature); + profileRequires(loc, EEsProfile, 310, nullptr, feature); + break; + } + default: + break; + } + if (qualifier.hasIndex()) { + if (qualifier.storage != EvqVaryingOut) + error(loc, "can only be used on an output", "index", ""); + if (! qualifier.hasLocation()) + error(loc, "can only be used with an explicit location", "index", ""); + } + } + + if (qualifier.hasBinding()) { + if (! qualifier.isUniformOrBuffer() && !qualifier.isTaskMemory() && !qualifier.isTileAttachmentQCOM()) + error(loc, "requires uniform or buffer or tile image storage qualifier", "binding", ""); + } + if (qualifier.hasStream()) { + if (!qualifier.isPipeOutput()) + error(loc, "can only be used on an output", "stream", ""); + } + if (qualifier.hasXfb()) { + if (!qualifier.isPipeOutput()) + error(loc, "can only be used on an output", "xfb layout qualifier", ""); + } + if (qualifier.hasUniformLayout()) { + if (!storageCanHaveLayoutInBlock(qualifier.storage) && !qualifier.isTaskMemory()) { + if (qualifier.hasMatrix() || qualifier.hasPacking()) + error(loc, "matrix or packing qualifiers can only be used on a uniform or buffer", "layout", ""); + if (qualifier.hasOffset() || qualifier.hasAlign()) + error(loc, "offset/align can only be used on a uniform or buffer", "layout", ""); + } + } + if (qualifier.isPushConstant()) { + if (qualifier.storage != EvqUniform) + error(loc, "can only be used with a uniform", "push_constant", ""); + if (qualifier.hasSet()) + error(loc, "cannot be used with push_constant", "set", ""); + if (qualifier.hasBinding()) + error(loc, "cannot be used with push_constant", "binding", ""); + } + if (qualifier.hasBufferReference()) { + if (qualifier.storage != EvqBuffer) + error(loc, "can only be used with buffer", "buffer_reference", ""); + } + if (qualifier.isShaderRecord()) { + if (qualifier.storage != EvqBuffer) + error(loc, "can only be used with a buffer", "shaderRecordNV", ""); + if (qualifier.hasBinding()) + error(loc, "cannot be used with shaderRecordNV", "binding", ""); + if (qualifier.hasSet()) + error(loc, "cannot be used with shaderRecordNV", "set", ""); + + } + + if (qualifier.storage == EvqTileImageEXT) { + if (qualifier.hasSet()) + error(loc, "cannot be used with tileImageEXT", "set", ""); + if (!qualifier.hasLocation()) + error(loc, "can only be used with an explicit location", "tileImageEXT", ""); + } + + if (qualifier.storage == EvqHitAttr && qualifier.hasLayout()) { + error(loc, "cannot apply layout qualifiers to hitAttributeNV variable", "hitAttributeNV", ""); + } +} + +// For places that can't have shader-level layout qualifiers +void TParseContext::checkNoShaderLayouts(const TSourceLoc& loc, const TShaderQualifiers& shaderQualifiers) +{ + const char* message = "can only apply to a standalone qualifier"; + + if (shaderQualifiers.geometry != ElgNone) + error(loc, message, TQualifier::getGeometryString(shaderQualifiers.geometry), ""); + if (shaderQualifiers.spacing != EvsNone) + error(loc, message, TQualifier::getVertexSpacingString(shaderQualifiers.spacing), ""); + if (shaderQualifiers.order != EvoNone) + error(loc, message, TQualifier::getVertexOrderString(shaderQualifiers.order), ""); + if (shaderQualifiers.pointMode) + error(loc, message, "point_mode", ""); + if (shaderQualifiers.invocations != TQualifier::layoutNotSet) + error(loc, message, "invocations", ""); + for (int i = 0; i < 3; ++i) { + if (shaderQualifiers.localSize[i] > 1) + error(loc, message, "local_size", ""); + if (shaderQualifiers.localSizeSpecId[i] != TQualifier::layoutNotSet) + error(loc, message, "local_size id", ""); + } + if (shaderQualifiers.vertices != TQualifier::layoutNotSet) { + if (language == EShLangGeometry || language == EShLangMesh) + error(loc, message, "max_vertices", ""); + else if (language == EShLangTessControl) + error(loc, message, "vertices", ""); + else + assert(0); + } + if (shaderQualifiers.earlyFragmentTests) + error(loc, message, "early_fragment_tests", ""); + if (shaderQualifiers.postDepthCoverage) + error(loc, message, "post_depth_coverage", ""); + if (shaderQualifiers.nonCoherentColorAttachmentReadEXT) + error(loc, message, "non_coherent_color_attachment_readEXT", ""); + if (shaderQualifiers.nonCoherentDepthAttachmentReadEXT) + error(loc, message, "non_coherent_depth_attachment_readEXT", ""); + if (shaderQualifiers.nonCoherentStencilAttachmentReadEXT) + error(loc, message, "non_coherent_stencil_attachment_readEXT", ""); + if (shaderQualifiers.primitives != TQualifier::layoutNotSet) { + if (language == EShLangMesh) + error(loc, message, "max_primitives", ""); + else + assert(0); + } + if (shaderQualifiers.hasBlendEquation()) + error(loc, message, "blend equation", ""); + if (shaderQualifiers.numViews != TQualifier::layoutNotSet) + error(loc, message, "num_views", ""); + if (shaderQualifiers.interlockOrdering != EioNone) + error(loc, message, TQualifier::getInterlockOrderingString(shaderQualifiers.interlockOrdering), ""); + if (shaderQualifiers.layoutPrimitiveCulling) + error(loc, "can only be applied as standalone", "primitive_culling", ""); + + if (shaderQualifiers.layoutNonCoherentTileAttachmentReadQCOM) + error(loc, message, "non_coherent_attachment_readQCOM", ""); + if (shaderQualifiers.layoutTileShadingRateQCOM[0] >= 1) + error(loc, message, "shading_rate_xQCOM", ""); + if (shaderQualifiers.layoutTileShadingRateQCOM[1] >= 1) + error(loc, message, "shading_rate_yQCOM", ""); + if (shaderQualifiers.layoutTileShadingRateQCOM[2] >= 1) + error(loc, message, "shading_rate_zQCOM", ""); +} + +// Correct and/or advance an object's offset layout qualifier. +void TParseContext::fixOffset(const TSourceLoc& loc, TSymbol& symbol) +{ + const TQualifier& qualifier = symbol.getType().getQualifier(); + if (symbol.getType().isAtomic()) { + if (qualifier.hasBinding() && (int)qualifier.layoutBinding < resources.maxAtomicCounterBindings) { + + // Set the offset + int offset; + if (qualifier.hasOffset()) + offset = qualifier.layoutOffset; + else + offset = atomicUintOffsets[qualifier.layoutBinding]; + + if (offset % 4 != 0) + error(loc, "atomic counters offset should align based on 4:", "offset", "%d", offset); + + symbol.getWritableType().getQualifier().layoutOffset = offset; + + // Check for overlap + int numOffsets = 4; + if (symbol.getType().isArray()) { + if (symbol.getType().isSizedArray() && !symbol.getType().getArraySizes()->isInnerUnsized()) + numOffsets *= symbol.getType().getCumulativeArraySize(); + else { + // "It is a compile-time error to declare an unsized array of atomic_uint." + error(loc, "array must be explicitly sized", "atomic_uint", ""); + } + } + int repeated = intermediate.addUsedOffsets(qualifier.layoutBinding, offset, numOffsets); + if (repeated >= 0) + error(loc, "atomic counters sharing the same offset:", "offset", "%d", repeated); + + // Bump the default offset + atomicUintOffsets[qualifier.layoutBinding] = offset + numOffsets; + } + } +} + +// +// Look up a function name in the symbol table, and make sure it is a function. +// +// Return the function symbol if found, otherwise nullptr. +// +const TFunction* TParseContext::findFunction(const TSourceLoc& loc, const TFunction& call, bool& builtIn) +{ + if (symbolTable.isFunctionNameVariable(call.getName())) { + error(loc, "can't use function syntax on variable", call.getName().c_str(), ""); + return nullptr; + } + + const TFunction* function = nullptr; + + // debugPrintfEXT has var args and is in the symbol table as "debugPrintfEXT()", + // mangled to "debugPrintfEXT(" + if (call.getName() == "debugPrintfEXT") { + TSymbol* symbol = symbolTable.find("debugPrintfEXT(", &builtIn); + if (symbol) + return symbol->getAsFunction(); + } + + // coopMatPerElementNV is variadic. There is some function signature error + // checking in handleCoopMat2FunctionCall. + if (call.getName() == "coopMatPerElementNV") { + TSymbol* symbol = symbolTable.find("coopMatPerElementNV(", &builtIn); + if (symbol) + return symbol->getAsFunction(); + } + + if (call.getName() == "saturatedConvertEXT") { + TSymbol* symbol = symbolTable.find("saturatedConvertEXT(", &builtIn); + if (symbol) + return symbol->getAsFunction(); + } + + bool explicitTypesEnabled = extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int8) || + extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int16) || + extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int32) || + extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int64) || + extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float16) || + extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float32) || + extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float64); + + if (isEsProfile()) + function = (explicitTypesEnabled && version >= 310) + ? findFunctionExplicitTypes(loc, call, builtIn) + : ((extensionTurnedOn(E_GL_EXT_shader_implicit_conversions) && version >= 310) + ? findFunction120(loc, call, builtIn) + : findFunctionExact(loc, call, builtIn)); + else if (version < 120) + function = findFunctionExact(loc, call, builtIn); + else if (version < 400) { + bool needfindFunction400 = extensionTurnedOn(E_GL_ARB_gpu_shader_fp64) + || extensionTurnedOn(E_GL_ARB_gpu_shader5) + || extensionTurnedOn(E_GL_NV_gpu_shader5); + function = needfindFunction400 ? findFunction400(loc, call, builtIn) : findFunction120(loc, call, builtIn); + } + else if (explicitTypesEnabled) + function = findFunctionExplicitTypes(loc, call, builtIn); + else + function = findFunction400(loc, call, builtIn); + + return function; +} + +// Function finding algorithm for ES and desktop 110. +const TFunction* TParseContext::findFunctionExact(const TSourceLoc& loc, const TFunction& call, bool& builtIn) +{ + TSymbol* symbol = symbolTable.find(call.getMangledName(), &builtIn); + if (symbol == nullptr) { + error(loc, "no matching overloaded function found", call.getName().c_str(), ""); + + return nullptr; + } + + return symbol->getAsFunction(); +} + +// Function finding algorithm for desktop versions 120 through 330. +const TFunction* TParseContext::findFunction120(const TSourceLoc& loc, const TFunction& call, bool& builtIn) +{ + // first, look for an exact match + TSymbol* symbol = symbolTable.find(call.getMangledName(), &builtIn); + if (symbol) + return symbol->getAsFunction(); + + // exact match not found, look through a list of overloaded functions of the same name + + // "If no exact match is found, then [implicit conversions] will be applied to find a match. Mismatched types + // on input parameters (in or inout or default) must have a conversion from the calling argument type to the + // formal parameter type. Mismatched types on output parameters (out or inout) must have a conversion + // from the formal parameter type to the calling argument type. When argument conversions are used to find + // a match, it is a semantic error if there are multiple ways to apply these conversions to make the call match + // more than one function." + + const TFunction* candidate = nullptr; + TVector candidateList; + symbolTable.findFunctionNameList(call.getMangledName(), candidateList, builtIn); + + for (auto it = candidateList.begin(); it != candidateList.end(); ++it) { + const TFunction& function = *(*it); + + // to even be a potential match, number of arguments has to match + if (call.getParamCount() != function.getParamCount()) + continue; + + bool possibleMatch = true; + for (int i = 0; i < function.getParamCount(); ++i) { + // same types is easy + if (*function[i].type == *call[i].type) + continue; + + // We have a mismatch in type, see if it is implicitly convertible + + if (function[i].type->isArray() || call[i].type->isArray() || + ! function[i].type->sameElementShape(*call[i].type)) + possibleMatch = false; + else { + // do direction-specific checks for conversion of basic type + if (function[i].type->getQualifier().isParamInput()) { + if (! intermediate.canImplicitlyPromote(call[i].type->getBasicType(), function[i].type->getBasicType())) + possibleMatch = false; + } + if (function[i].type->getQualifier().isParamOutput()) { + if (! intermediate.canImplicitlyPromote(function[i].type->getBasicType(), call[i].type->getBasicType())) + possibleMatch = false; + } + } + if (! possibleMatch) + break; + } + if (possibleMatch) { + if (candidate) { + // our second match, meaning ambiguity + error(loc, "ambiguous function signature match: multiple signatures match under implicit type conversion", call.getName().c_str(), ""); + } else + candidate = &function; + } + } + + if (candidate == nullptr) + error(loc, "no matching overloaded function found", call.getName().c_str(), ""); + + return candidate; +} + +// Function finding algorithm for desktop version 400 and above. +// +// "When function calls are resolved, an exact type match for all the arguments +// is sought. If an exact match is found, all other functions are ignored, and +// the exact match is used. If no exact match is found, then the implicit +// conversions in section 4.1.10 Implicit Conversions will be applied to find +// a match. Mismatched types on input parameters (in or inout or default) must +// have a conversion from the calling argument type to the formal parameter type. +// Mismatched types on output parameters (out or inout) must have a conversion +// from the formal parameter type to the calling argument type. +// +// "If implicit conversions can be used to find more than one matching function, +// a single best-matching function is sought. To determine a best match, the +// conversions between calling argument and formal parameter types are compared +// for each function argument and pair of matching functions. After these +// comparisons are performed, each pair of matching functions are compared. +// A function declaration A is considered a better match than function +// declaration B if +// +// * for at least one function argument, the conversion for that argument in A +// is better than the corresponding conversion in B; and +// * there is no function argument for which the conversion in B is better than +// the corresponding conversion in A. +// +// "If a single function declaration is considered a better match than every +// other matching function declaration, it will be used. Otherwise, a +// compile-time semantic error for an ambiguous overloaded function call occurs. +// +// "To determine whether the conversion for a single argument in one match is +// better than that for another match, the following rules are applied, in order: +// +// 1. An exact match is better than a match involving any implicit conversion. +// 2. A match involving an implicit conversion from float to double is better +// than a match involving any other implicit conversion. +// 3. A match involving an implicit conversion from either int or uint to float +// is better than a match involving an implicit conversion from either int +// or uint to double. +// +// "If none of the rules above apply to a particular pair of conversions, neither +// conversion is considered better than the other." +// +const TFunction* TParseContext::findFunction400(const TSourceLoc& loc, const TFunction& call, bool& builtIn) +{ + // first, look for an exact match + TSymbol* symbol = symbolTable.find(call.getMangledName(), &builtIn); + if (symbol) + return symbol->getAsFunction(); + + // no exact match, use the generic selector, parameterized by the GLSL rules + + // create list of candidates to send + TVector candidateList; + symbolTable.findFunctionNameList(call.getMangledName(), candidateList, builtIn); + + // can 'from' convert to 'to'? + const auto convertible = [this,builtIn](const TType& from, const TType& to, TOperator op, int param) -> bool { + if (from == to) + return true; + if (from.coopMatParameterOK(to)) + return true; + if (from.tensorParameterOK(to)) + return true; + if (from.getBasicType() == EbtFunction && to.getBasicType() == EbtFunction) + return true; + if (from.coopVecParameterOK(to)) + return true; + // Allow a sized array to be passed through an unsized array parameter, for coopMatLoad/Store functions + if (builtIn && from.isArray() && to.isUnsizedArray()) { + TType fromElementType(from, 0); + TType toElementType(to, 0); + // Load/store tensor functions allow any element type for the pointer + if ((op == EOpCooperativeMatrixLoadTensorNV || op == EOpCooperativeMatrixStoreTensorNV) && + param == 1) { + return true; + } + if (fromElementType == toElementType) + return true; + } + if (from.isArray() || to.isArray() || ! from.sameElementShape(to)) + return false; + if (from.isCoopMat() && to.isCoopMat()) + return from.sameCoopMatBaseType(to); + if (from.isCoopVecNV() && to.isCoopVecNV()) + return from.sameCoopVecBaseType(to); + if (from.isTensorARM() && to.isTensorARM()) + return from.sameTensorBaseTypeARM(to); + return intermediate.canImplicitlyPromote(from.getBasicType(), to.getBasicType()); + }; + + // Is 'to2' a better conversion than 'to1'? + // Ties should not be considered as better. + // Assumes 'convertible' already said true. + const auto better = [&](const TType& from, const TType& to1, const TType& to2) -> bool { + // 1. exact match + if (from == to2) + return from != to1; + if (from == to1) + return false; + if (extensionTurnedOn(E_GL_NV_gpu_shader5)) { + // This map refers to the conversion table mentioned under the + // section "Modify Section 6.1, Function Definitions, p. 63" in NV_gpu_shader5 spec + const static std::map> conversionTable = { + {EbtInt8, {EbtInt, EbtInt64}}, + {EbtInt16, {EbtInt, EbtInt64}}, + {EbtInt, {EbtInt64}}, + {EbtUint8, {EbtUint, EbtUint64}}, + {EbtUint16, {EbtUint, EbtUint64}}, + {EbtUint, {EbtUint64}}, + }; + auto source = conversionTable.find(from.getBasicType()); + if (source != conversionTable.end()) { + for (auto destination : source->second) { + if (to2.getBasicType() == destination && + to1.getBasicType() != destination) // to2 is better then to1 + return true; + else if (to1.getBasicType() == destination && + to2.getBasicType() != destination) // This means to1 is better then to2 + return false; + } + } + } + // 2. float -> double is better + if (from.getBasicType() == EbtFloat) { + if (to2.getBasicType() == EbtDouble && to1.getBasicType() != EbtDouble) + return true; + } + + // 3. -> float is better than -> double + return to2.getBasicType() == EbtFloat && to1.getBasicType() == EbtDouble; + }; + + // for ambiguity reporting + bool tie = false; + + // send to the generic selector + const TFunction* bestMatch = selectFunction(candidateList, call, convertible, better, tie); + + if (bestMatch == nullptr) + error(loc, "no matching overloaded function found", call.getName().c_str(), ""); + else if (tie) + error(loc, "ambiguous best function under implicit type conversion", call.getName().c_str(), ""); + + return bestMatch; +} + +// "To determine whether the conversion for a single argument in one match +// is better than that for another match, the conversion is assigned of the +// three ranks ordered from best to worst: +// 1. Exact match: no conversion. +// 2. Promotion: integral or floating-point promotion. +// 3. Conversion: integral conversion, floating-point conversion, +// floating-integral conversion. +// A conversion C1 is better than a conversion C2 if the rank of C1 is +// better than the rank of C2." +const TFunction* TParseContext::findFunctionExplicitTypes(const TSourceLoc& loc, const TFunction& call, bool& builtIn) +{ + // first, look for an exact match + TSymbol* symbol = symbolTable.find(call.getMangledName(), &builtIn); + if (symbol) + return symbol->getAsFunction(); + + // no exact match, use the generic selector, parameterized by the GLSL rules + + // create list of candidates to send + TVector candidateList; + symbolTable.findFunctionNameList(call.getMangledName(), candidateList, builtIn); + + // can 'from' convert to 'to'? + const auto convertible = [this,builtIn](const TType& from, const TType& to, TOperator op, int param) -> bool { + if (from == to) + return true; + if (from.coopMatParameterOK(to)) + return true; + if (from.tensorParameterOK(to)) + return true; + if (from.getBasicType() == EbtFunction && to.getBasicType() == EbtFunction) + return true; + if (from.coopVecParameterOK(to)) + return true; + // Allow a sized array to be passed through an unsized array parameter, for coopMatLoad/Store functions + if (builtIn && from.isArray() && to.isUnsizedArray()) { + TType fromElementType(from, 0); + TType toElementType(to, 0); + // Load/store tensor functions allow any element type for the pointer + if ((op == EOpCooperativeMatrixLoadTensorNV || op == EOpCooperativeMatrixStoreTensorNV) && + param == 1) { + return true; + } + if (fromElementType == toElementType) + return true; + } + if (from.isArray() || to.isArray() || ! from.sameElementShape(to)) + return false; + if (from.isCoopMat() && to.isCoopMat()) + return from.sameCoopMatBaseType(to); + if (from.isCoopVecNV() && to.isCoopVecNV()) + return from.sameCoopVecBaseType(to); + if (from.isTensorARM() && to.isTensorARM()) + return from.sameTensorBaseTypeARM(to); + return intermediate.canImplicitlyPromote(from.getBasicType(), to.getBasicType()); + }; + + // Is 'to2' a better conversion than 'to1'? + // Ties should not be considered as better. + // Assumes 'convertible' already said true. + const auto better = [this](const TType& from, const TType& to1, const TType& to2) -> bool { + // 1. exact match + if (from == to2) + return from != to1; + if (from == to1) + return false; + + // 2. Promotion (integral, floating-point) is better + TBasicType from_type = from.getBasicType(); + TBasicType to1_type = to1.getBasicType(); + TBasicType to2_type = to2.getBasicType(); + bool isPromotion1 = (intermediate.isIntegralPromotion(from_type, to1_type) || + intermediate.isFPPromotion(from_type, to1_type)); + bool isPromotion2 = (intermediate.isIntegralPromotion(from_type, to2_type) || + intermediate.isFPPromotion(from_type, to2_type)); + if (isPromotion2) + return !isPromotion1; + if(isPromotion1) + return false; + + // 3. Conversion (integral, floating-point , floating-integral) + bool isConversion1 = (intermediate.isIntegralConversion(from_type, to1_type) || + intermediate.isFPConversion(from_type, to1_type) || + intermediate.isFPIntegralConversion(from_type, to1_type)); + bool isConversion2 = (intermediate.isIntegralConversion(from_type, to2_type) || + intermediate.isFPConversion(from_type, to2_type) || + intermediate.isFPIntegralConversion(from_type, to2_type)); + + return isConversion2 && !isConversion1; + }; + + // for ambiguity reporting + bool tie = false; + + // send to the generic selector + const TFunction* bestMatch = selectFunction(candidateList, call, convertible, better, tie); + + if (bestMatch == nullptr) + error(loc, "no matching overloaded function found", call.getName().c_str(), ""); + else if (tie) + error(loc, "ambiguous best function under implicit type conversion", call.getName().c_str(), ""); + + return bestMatch; +} + +// +// Adjust function calls that aren't declared in Vulkan to a +// calls with equivalent effects +// +TIntermTyped* TParseContext::vkRelaxedRemapFunctionCall(const TSourceLoc& loc, TFunction* function, TIntermNode* arguments) +{ + TIntermTyped* result = nullptr; + + if (function->getBuiltInOp() != EOpNull) { + return nullptr; + } + + if (function->getName() == "atomicCounterIncrement") { + // change atomicCounterIncrement into an atomicAdd of 1 + TString name("atomicAdd"); + TType uintType(EbtUint); + + TFunction realFunc(&name, function->getType()); + + // Use copyParam to avoid shared ownership of the 'type' field + // of the parameter. + for (int i = 0; i < function->getParamCount(); ++i) { + realFunc.addParameter(TParameter().copyParam((*function)[i])); + } + + TParameter tmpP = { nullptr, &uintType, {} }; + realFunc.addParameter(TParameter().copyParam(tmpP)); + arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(1, loc, true)); + + result = handleFunctionCall(loc, &realFunc, arguments); + } else if (function->getName() == "atomicCounterDecrement") { + // change atomicCounterDecrement into an atomicAdd with -1 + // and subtract 1 from result, to return post-decrement value + TString name("atomicAdd"); + TType uintType(EbtUint); + + TFunction realFunc(&name, function->getType()); + + for (int i = 0; i < function->getParamCount(); ++i) { + realFunc.addParameter(TParameter().copyParam((*function)[i])); + } + + TParameter tmpP = { nullptr, &uintType, {} }; + realFunc.addParameter(TParameter().copyParam(tmpP)); + arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(-1, loc, true)); + + result = handleFunctionCall(loc, &realFunc, arguments); + + // post decrement, so that it matches AtomicCounterDecrement semantics + if (result) { + result = handleBinaryMath(loc, "-", EOpSub, result, intermediate.addConstantUnion(1, loc, true)); + } + } else if (function->getName() == "atomicCounter") { + // change atomicCounter into a direct read of the variable + if (arguments && arguments->getAsTyped()) { + result = arguments->getAsTyped(); + } + } + + return result; +} + +// When a declaration includes a type, but not a variable name, it can be used +// to establish defaults. +void TParseContext::declareTypeDefaults(const TSourceLoc& loc, const TPublicType& publicType) +{ + if (publicType.basicType == EbtAtomicUint && publicType.qualifier.hasBinding()) { + if (publicType.qualifier.layoutBinding >= (unsigned int)resources.maxAtomicCounterBindings) { + error(loc, "atomic_uint binding is too large", "binding", ""); + return; + } + if (publicType.qualifier.hasOffset()) + atomicUintOffsets[publicType.qualifier.layoutBinding] = publicType.qualifier.layoutOffset; + return; + } + + if (publicType.arraySizes) { + error(loc, "expect an array name", "", ""); + } + + if (publicType.qualifier.hasLayout() && !publicType.qualifier.hasBufferReference()) + warn(loc, "useless application of layout qualifier", "layout", ""); +} + +void TParseContext::typeParametersCheck(const TSourceLoc& loc, const TPublicType& publicType) +{ + if (parsingBuiltins) + return; + if (publicType.isCoopmatKHR()) { + if (publicType.typeParameters == nullptr) { + error(loc, "coopmat missing type parameters", "", ""); + return; + } + switch (publicType.typeParameters->basicType) { + case EbtFloat: + case EbtFloat16: + case EbtBFloat16: + case EbtFloatE5M2: + case EbtFloatE4M3: + case EbtInt: + case EbtInt8: + case EbtInt16: + case EbtUint: + case EbtUint8: + case EbtUint16: + case EbtSpirvType: + break; + default: + error(loc, "coopmat invalid basic type", TType::getBasicString(publicType.typeParameters->basicType), ""); + break; + } + if (publicType.typeParameters->arraySizes->getNumDims() != 4) { + error(loc, "coopmat incorrect number of type parameters", "", ""); + return; + } + int use = publicType.typeParameters->arraySizes->getDimSize(3); + if (use < 0 || use > 2) { + error(loc, "coopmat invalid matrix Use", "", ""); + return; + } + } + if (publicType.isTensorLayoutNV()) { + if (publicType.typeParameters == nullptr) { + error(loc, "tensorLayout missing type parameters", "", ""); + return; + } + if (publicType.typeParameters->arraySizes->getNumDims() > 2) { + error(loc, "tensorLayout incorrect number of type parameters", "", ""); + return; + } + if (publicType.typeParameters && publicType.typeParameters->arraySizes->getNumDims() < 2) { + while (publicType.typeParameters->arraySizes->getNumDims() < 2) { + publicType.typeParameters->arraySizes->addInnerSize(0); + } + } + } + if (publicType.isTensorViewNV()) { + if (publicType.typeParameters == nullptr) { + error(loc, "tensorView missing type parameters", "", ""); + return; + } + if (publicType.typeParameters->arraySizes->getNumDims() < 1 || + publicType.typeParameters->arraySizes->getNumDims() > 7) { + error(loc, "tensorView incorrect number of type parameters", "", ""); + return; + } + if (publicType.typeParameters && publicType.typeParameters->arraySizes->getNumDims() < 7) { + uint32_t numDims = publicType.typeParameters->arraySizes->getNumDims(); + while (numDims < 7) { + uint32_t dim = (numDims == 1) ? 0 : (numDims - 2); + publicType.typeParameters->arraySizes->addInnerSize(dim); + numDims++; + } + } + } + if (publicType.isTensorARM()) { + if (publicType.typeParameters == nullptr) { + error(loc, "tensor type is missing type parameters", "", ""); + return; + } + if (publicType.typeParameters->arraySizes == nullptr) { + error(loc, "tensor type is missing rank information", "", ""); + return; + } + if (publicType.typeParameters->arraySizes->getNumDims() != 1) { + error(loc, "tensor type requires exactly 1 rank specifier", "", ""); + return; + } + if (publicType.typeParameters->arraySizes->getDimSize(0) < 1) { + error(loc, "tensor rank must be greater than or equal to 1", "", ""); + return; + } + } +} + +bool TParseContext::vkRelaxedRemapUniformVariable(const TSourceLoc& loc, TString& identifier, const TPublicType& publicType, + TArraySizes*, TIntermTyped* initializer, TType& type) +{ + vkRelaxedRemapUniformMembers(loc, publicType, type, identifier); + + if (parsingBuiltins || symbolTable.atBuiltInLevel() || !symbolTable.atGlobalLevel() || + type.getQualifier().storage != EvqUniform || + !(type.containsNonOpaque() || type.getBasicType() == EbtAtomicUint || (type.containsSampler() && type.isStruct()))) { + return false; + } + + if (type.getQualifier().hasLocation()) { + warn(loc, "ignoring layout qualifier for uniform", identifier.c_str(), "location"); + type.getQualifier().layoutLocation = TQualifier::layoutLocationEnd; + } + + if (initializer) { + warn(loc, "Ignoring initializer for uniform", identifier.c_str(), ""); + initializer = nullptr; + } + + if (type.isArray()) { + // do array size checks here + arraySizesCheck(loc, type.getQualifier(), type.getArraySizes(), initializer, false); + + if (arrayQualifierError(loc, type.getQualifier()) || arrayError(loc, type)) { + error(loc, "array param error", identifier.c_str(), ""); + } + } + + // do some checking on the type as it was declared + layoutTypeCheck(loc, type); + + int bufferBinding = TQualifier::layoutBindingEnd; + TVariable* updatedBlock = nullptr; + + // Convert atomic_uint into members of a buffer block + if (type.isAtomic()) { + type.setBasicType(EbtUint); + type.getQualifier().storage = EvqBuffer; + + type.getQualifier().volatil = true; + type.getQualifier().coherent = true; + + // xxTODO: use logic from fixOffset() to apply explicit member offset + bufferBinding = type.getQualifier().layoutBinding; + type.getQualifier().layoutBinding = TQualifier::layoutBindingEnd; + type.getQualifier().explicitOffset = false; + growAtomicCounterBlock(bufferBinding, loc, type, identifier, nullptr); + updatedBlock = atomicCounterBuffers[bufferBinding]; + } + + if (!updatedBlock) { + growGlobalUniformBlock(loc, type, identifier, nullptr); + updatedBlock = globalUniformBlock; + } + + // + // don't assign explicit member offsets here + // if any are assigned, need to be updated here and in the merge/link step + // fixBlockUniformOffsets(updatedBlock->getWritableType().getQualifier(), *updatedBlock->getWritableType().getWritableStruct()); + + // checks on update buffer object + layoutObjectCheck(loc, *updatedBlock); + + TSymbol* symbol = symbolTable.find(identifier); + + if (!symbol) { + if (updatedBlock == globalUniformBlock) + error(loc, "error adding uniform to default uniform block", identifier.c_str(), ""); + else + error(loc, "error adding atomic counter to atomic counter block", identifier.c_str(), ""); + return false; + } + + // merge qualifiers + mergeObjectLayoutQualifiers(updatedBlock->getWritableType().getQualifier(), type.getQualifier(), true); + + return true; +} + +template +static void ForEachOpaque(const TType& type, const TString& path, Function callback) +{ + auto recursion = [&callback](const TType& type, const TString& path, bool skipArray, auto& recursion) -> void { + if (!skipArray && type.isArray()) + { + std::vector indices(type.getArraySizes()->getNumDims()); + for (int flatIndex = 0; + flatIndex < type.getArraySizes()->getCumulativeSize(); + ++flatIndex) + { + TString subscriptPath = path; + if (path != "") + { + for (size_t dimIndex = 0; dimIndex < indices.size(); ++dimIndex) + { + int index = indices[dimIndex]; + subscriptPath.append("["); + subscriptPath.append(String(index)); + subscriptPath.append("]"); + } + } + + recursion(type, subscriptPath, true, recursion); + + for (size_t dimIndex = 0; dimIndex < indices.size(); ++dimIndex) + { + ++indices[dimIndex]; + if (indices[dimIndex] < type.getArraySizes()->getDimSize(static_cast(dimIndex))) + break; + else + indices[dimIndex] = 0; + } + } + } + + else if (type.isStruct() && type.containsOpaque()) + { + const TTypeList& types = *type.getStruct(); + for (const TTypeLoc& typeLoc : types) + { + TString nextPath = path; + if (path != "") + { + nextPath.append("."); + nextPath.append(typeLoc.type->getFieldName()); + } + + recursion(*(typeLoc.type), nextPath, false, recursion); + } + } + + else if (type.isOpaque()) + { + callback(type, path); + } + }; + + recursion(type, path, false, recursion); +} + +void TParseContext::vkRelaxedRemapUniformMembers(const TSourceLoc& loc, const TPublicType& publicType, const TType& type, + const TString& identifier) +{ + if (!type.isStruct() || !type.containsOpaque()) + return; + + ForEachOpaque(type, identifier, + [&publicType, &loc, this](const TType& type, const TString& path) { + TArraySizes arraySizes = {}; + if (type.getArraySizes()) arraySizes = *type.getArraySizes(); + TTypeParameters typeParameters = {}; + if (type.getTypeParameters()) typeParameters = *type.getTypeParameters(); + + TPublicType memberType{}; + memberType.basicType = type.getBasicType(); + memberType.sampler = type.getSampler(); + memberType.qualifier = type.getQualifier(); + memberType.vectorSize = type.getVectorSize(); + memberType.matrixCols = type.getMatrixCols(); + memberType.matrixRows = type.getMatrixRows(); + memberType.coopmatNV = type.isCoopMatNV(); + memberType.coopmatKHR = type.isCoopMatKHR(); + memberType.arraySizes = nullptr; + memberType.userDef = nullptr; + memberType.loc = loc; + memberType.typeParameters = (type.getTypeParameters() ? &typeParameters : nullptr); + memberType.spirvType = nullptr; + + memberType.qualifier.storage = publicType.qualifier.storage; + memberType.shaderQualifiers = publicType.shaderQualifiers; + + TString& structMemberName = *NewPoolTString(path.c_str()); // A copy is required due to declareVariable() signature. + declareVariable(loc, structMemberName, memberType, nullptr, nullptr); + }); +} + +void TParseContext::vkRelaxedRemapFunctionParameter(TFunction* function, TParameter& param, std::vector* newParams) +{ + function->addParameter(param); + + if (!param.type->isStruct() || !param.type->containsOpaque()) + return; + + TString fieldName = param.name + ? *param.name + : param.type->hasFieldName() ? param.type->getFieldName() : ""; + + ForEachOpaque(*param.type, fieldName, + [function, param, newParams](const TType& type, const TString& path) { + TString* memberName = path != "" ? NewPoolTString(path.c_str()) : nullptr; + + TType* memberType = new TType(); + memberType->shallowCopy(type); + memberType->getQualifier().storage = param.type->getQualifier().storage; + memberType->clearArraySizes(); + + TParameter memberParam = {}; + memberParam.name = memberName; + memberParam.type = memberType; + memberParam.defaultValue = nullptr; + function->addParameter(memberParam); + if (newParams) + newParams->push_back(function->getParamCount()-1); + }); +} + +// +// Generates a valid GLSL dereferencing string for the input TIntermNode +// +struct AccessChainTraverser : public TIntermTraverser { + AccessChainTraverser() : TIntermTraverser(false, false, true) + {} + + TString path = ""; + TStorageQualifier topLevelStorageQualifier = TStorageQualifier::EvqLast; + + bool visitBinary(TVisit, TIntermBinary* binary) override { + if (binary->getOp() == EOpIndexDirectStruct) + { + const TTypeList& members = *binary->getLeft()->getType().getStruct(); + const TTypeLoc& member = + members[binary->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst()]; + TString memberName = member.type->getFieldName(); + + if (path != "") + path.append("."); + + path.append(memberName); + } + + if (binary->getOp() == EOpIndexDirect) + { + const TConstUnionArray& indices = binary->getRight()->getAsConstantUnion()->getConstArray(); + for (int index = 0; index < indices.size(); ++index) + { + path.append("["); + path.append(String(indices[index].getIConst())); + path.append("]"); + } + } + + return true; + } + + void visitSymbol(TIntermSymbol* symbol) override { + if (symbol->getType().isOpaque()) + topLevelStorageQualifier = symbol->getQualifier().storage; + if (!IsAnonymous(symbol->getName())) + path.append(symbol->getName()); + } +}; + +TIntermNode* TParseContext::vkRelaxedRemapFunctionArgument(const TSourceLoc& loc, TFunction* function, TIntermTyped* intermTyped) +{ + AccessChainTraverser accessChainTraverser{}; + intermTyped->traverse(&accessChainTraverser); + + if (accessChainTraverser.topLevelStorageQualifier == TStorageQualifier::EvqUniform) + { + TParameter param = { 0, new TType, {} }; + param.type->shallowCopy(intermTyped->getType()); + + function->addParameter(param); + return intermTyped; + } + + TParameter param = { NewPoolTString(accessChainTraverser.path.c_str()), new TType, {} }; + param.type->shallowCopy(intermTyped->getType()); + + std::vector newParams = {}; + vkRelaxedRemapFunctionParameter(function, param, &newParams); + + if (intermTyped->getType().isOpaque()) + { + TIntermNode* remappedArgument = intermTyped; + { + TIntermSymbol* intermSymbol = nullptr; + TSymbol* symbol = symbolTable.find(*param.name); + if (symbol && symbol->getAsVariable()) + intermSymbol = intermediate.addSymbol(*symbol->getAsVariable(), loc); + else + { + TVariable* variable = new TVariable(param.name, *param.type); + intermSymbol = intermediate.addSymbol(*variable, loc); + } + + remappedArgument = intermSymbol; + } + + return remappedArgument; + } + else if (!(intermTyped->isStruct() && intermTyped->getType().containsOpaque())) + return intermTyped; + else + { + TIntermNode* remappedArgument = intermTyped; + { + TSymbol* symbol = symbolTable.find(*param.name); + if (symbol && symbol->getAsVariable()) + remappedArgument = intermediate.addSymbol(*symbol->getAsVariable(), loc); + } + + if (!newParams.empty()) + remappedArgument = intermediate.makeAggregate(remappedArgument, loc); + + for (int paramIndex : newParams) + { + TParameter& newParam = function->operator[](paramIndex); + TIntermSymbol* intermSymbol = nullptr; + TSymbol* symbol = symbolTable.find(*newParam.name); + if (symbol && symbol->getAsVariable()) + intermSymbol = intermediate.addSymbol(*symbol->getAsVariable(), loc); + else + { + TVariable* variable = new TVariable(newParam.name, *newParam.type); + intermSymbol = intermediate.addSymbol(*variable, loc); + } + + remappedArgument = intermediate.growAggregate(remappedArgument, intermSymbol); + } + + return remappedArgument; + } +} + +TIntermTyped* TParseContext::vkRelaxedRemapDotDereference(const TSourceLoc&, TIntermTyped& base, const TType& member, + const TString& identifier) +{ + if (!member.isOpaque()) + return &base; + + AccessChainTraverser traverser{}; + base.traverse(&traverser); + if (!traverser.path.empty()) + traverser.path.append("."); + traverser.path.append(identifier); + + const TSymbol* symbol = symbolTable.find(traverser.path); + if (!symbol) + return &base; + + TIntermTyped* result = intermediate.addSymbol(*symbol->getAsVariable()); + result->setType(symbol->getType()); + return result; +} + +// +// Do everything necessary to handle a variable (non-block) declaration. +// Either redeclaring a variable, or making a new one, updating the symbol +// table, and all error checking. +// +// Returns a subtree node that computes an initializer, if needed. +// Returns nullptr if there is no code to execute for initialization. +// +// 'publicType' is the type part of the declaration (to the left) +// 'arraySizes' is the arrayness tagged on the identifier (to the right) +// +TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& identifier, const TPublicType& publicType, + TArraySizes* arraySizes, TIntermTyped* initializer) +{ + // Make a fresh type that combines the characteristics from the individual + // identifier syntax and the declaration-type syntax. + TType type(publicType); + type.transferArraySizes(arraySizes); + type.copyArrayInnerSizes(publicType.arraySizes); + arrayOfArrayVersionCheck(loc, type.getArraySizes()); + + if (initializer) { + if (type.getBasicType() == EbtRayQuery) { + error(loc, "ray queries can only be initialized by using the rayQueryInitializeEXT intrinsic:", "=", identifier.c_str()); + } else if ((type.getBasicType() == EbtHitObjectNV) || (type.getBasicType() == EbtHitObjectEXT)) { + error(loc, "hit objects cannot be initialized using initializers", "=", identifier.c_str()); + } + + } + + if (type.isCoopMatKHR()) { + intermediate.setUseVulkanMemoryModel(); + intermediate.setUseStorageBuffer(); + + if (!publicType.typeParameters || !publicType.typeParameters->arraySizes || + publicType.typeParameters->arraySizes->getNumDims() != 4) { + error(loc, "unexpected number type parameters", identifier.c_str(), ""); + } + if (publicType.typeParameters) { + if (!isTypeFloat(publicType.typeParameters->basicType) && + !isTypeInt(publicType.typeParameters->basicType) && publicType.typeParameters->basicType != EbtSpirvType) { + error(loc, "expected 8, 16, 32, or 64 bit signed or unsigned integer or 16, 32, or 64 bit float type", identifier.c_str(), ""); + } + } + } + else if (type.isCoopMatNV()) { + intermediate.setUseVulkanMemoryModel(); + intermediate.setUseStorageBuffer(); + + if (!publicType.typeParameters || !publicType.typeParameters->arraySizes || publicType.typeParameters->arraySizes->getNumDims() != 4) { + error(loc, "expected four type parameters", identifier.c_str(), ""); + } else { + if (isTypeFloat(publicType.basicType) && + publicType.typeParameters->arraySizes->getDimSize(0) != 16 && + publicType.typeParameters->arraySizes->getDimSize(0) != 32 && + publicType.typeParameters->arraySizes->getDimSize(0) != 64) { + error(loc, "expected 16, 32, or 64 bits for first type parameter", identifier.c_str(), ""); + } + if (isTypeInt(publicType.basicType) && + publicType.typeParameters->arraySizes->getDimSize(0) != 8 && + publicType.typeParameters->arraySizes->getDimSize(0) != 16 && + publicType.typeParameters->arraySizes->getDimSize(0) != 32) { + error(loc, "expected 8, 16, or 32 bits for first type parameter", identifier.c_str(), ""); + } + } + } else if (type.isTensorLayoutNV()) { + if (!publicType.typeParameters || publicType.typeParameters->arraySizes->getNumDims() > 2) { + error(loc, "expected 1-2 type parameters", identifier.c_str(), ""); + } + } else if (type.isTensorViewNV()) { + if (!publicType.typeParameters || publicType.typeParameters->arraySizes->getNumDims() > 7) { + error(loc, "expected 1-7 type parameters", identifier.c_str(), ""); + } + } else if (type.isCoopVecNV()) { + intermediate.setUseVulkanMemoryModel(); + intermediate.setUseStorageBuffer(); + + if (!publicType.typeParameters || !publicType.typeParameters->arraySizes || publicType.typeParameters->arraySizes->getNumDims() != 1) { + error(loc, "expected two type parameters", identifier.c_str(), ""); + } else if (publicType.typeParameters->arraySizes->getDimSize(0) <= 0) { + error(loc, "expected positive number of components", identifier.c_str(), ""); + } + } else if (type.isTensorARM()) { + intermediate.setUseStorageBuffer(); + + if (!publicType.typeParameters || publicType.typeParameters->arraySizes->getNumDims() != 1) { + error(loc, "expected two type parameters", identifier.c_str(), ""); + } + if (publicType.typeParameters) { + if (publicType.typeParameters->basicType != EbtBool && + publicType.typeParameters->basicType != EbtInt8 && + publicType.typeParameters->basicType != EbtInt16 && + publicType.typeParameters->basicType != EbtInt && + publicType.typeParameters->basicType != EbtInt64 && + publicType.typeParameters->basicType != EbtUint8 && + publicType.typeParameters->basicType != EbtUint16 && + publicType.typeParameters->basicType != EbtUint && + publicType.typeParameters->basicType != EbtUint64 && + publicType.typeParameters->basicType != EbtFloat16 && + publicType.typeParameters->basicType != EbtFloat && + publicType.typeParameters->basicType != EbtDouble) { + error(loc, "expected bool, integer or floating point type parameter", identifier.c_str(), ""); + } + + } + } else { + if (publicType.typeParameters && publicType.typeParameters->arraySizes->getNumDims() != 0) { + error(loc, "unexpected type parameters", identifier.c_str(), ""); + } + } + + if (voidErrorCheck(loc, identifier, type.getBasicType())) + return nullptr; + + if (initializer) + rValueErrorCheck(loc, "initializer", initializer); + else + nonInitConstCheck(loc, identifier, type); + + samplerCheck(loc, type, identifier, initializer); + transparentOpaqueCheck(loc, type, identifier); + atomicUintCheck(loc, type, identifier); + accStructCheck(loc, type, identifier); + hitObjectNVCheck(loc, type, identifier); + hitObjectEXTCheck(loc, type, identifier); + checkAndResizeMeshViewDim(loc, type, /*isBlockMember*/ false); + if (type.getQualifier().storage == EvqConst && type.containsReference()) { + error(loc, "variables with reference type can't have qualifier 'const'", "qualifier", ""); + } + + if (type.getQualifier().storage != EvqUniform && type.getQualifier().storage != EvqBuffer) { + if (type.contains16BitFloat()) + requireFloat16Arithmetic(loc, "qualifier", "float16 types can only be in uniform block or buffer storage"); + if (type.contains16BitInt()) + requireInt16Arithmetic(loc, "qualifier", "(u)int16 types can only be in uniform block or buffer storage"); + if (type.contains8BitInt()) + requireInt8Arithmetic(loc, "qualifier", "(u)int8 types can only be in uniform block or buffer storage"); + } + if (type.getBasicType() == EbtBFloat16 && + (type.getQualifier().storage == EvqVaryingIn || type.getQualifier().storage == EvqVaryingOut)) + error(loc, "qualifier", "bfloat16 types not allowed as input/output", ""); + + if ((type.getBasicType() == EbtFloatE5M2 || type.getBasicType() == EbtFloatE4M3) && + (type.getQualifier().storage == EvqVaryingIn || type.getQualifier().storage == EvqVaryingOut)) + error(loc, "qualifier", "fp8 types not allowed as input/output", ""); + + if (type.getQualifier().storage == EvqtaskPayloadSharedEXT) + intermediate.addTaskPayloadEXTCount(); + if (type.getQualifier().storage == EvqShared && type.containsCoopMat()) + error(loc, "qualifier", "Cooperative matrix types must not be used in shared memory", ""); + + if (profile == EEsProfile) { + if (type.getQualifier().isPipeInput() && type.getBasicType() == EbtStruct) { + if (type.getQualifier().isArrayedIo(language)) { + TType perVertexType(type, 0); + if (perVertexType.containsArray() && perVertexType.containsBuiltIn() == false) { + error(loc, "A per vertex structure containing an array is not allowed as input in ES", type.getTypeName().c_str(), ""); + } + } + else if (type.containsArray() && type.containsBuiltIn() == false) { + error(loc, "A structure containing an array is not allowed as input in ES", type.getTypeName().c_str(), ""); + } + if (type.containsStructure()) + error(loc, "A structure containing an struct is not allowed as input in ES", type.getTypeName().c_str(), ""); + } + } + + if (identifier != "gl_FragCoord" && (publicType.shaderQualifiers.originUpperLeft || publicType.shaderQualifiers.pixelCenterInteger)) + error(loc, "can only apply origin_upper_left and pixel_center_origin to gl_FragCoord", "layout qualifier", ""); + if (identifier != "gl_FragDepth" && publicType.shaderQualifiers.getDepth() != EldNone) + error(loc, "can only apply depth layout to gl_FragDepth", "layout qualifier", ""); + if (identifier != "gl_FragStencilRefARB" && publicType.shaderQualifiers.getStencil() != ElsNone) + error(loc, "can only apply depth layout to gl_FragStencilRefARB", "layout qualifier", ""); + + // Check for redeclaration of built-ins and/or attempting to declare a reserved name + TSymbol* symbol = redeclareBuiltinVariable(loc, identifier, type.getQualifier(), publicType.shaderQualifiers); + if (symbol == nullptr) + reservedErrorCheck(loc, identifier); + + if (symbol == nullptr && spvVersion.vulkan > 0 && spvVersion.vulkanRelaxed) { + bool remapped = vkRelaxedRemapUniformVariable(loc, identifier, publicType, arraySizes, initializer, type); + + if (remapped) { + return nullptr; + } + } + + inheritGlobalDefaults(type.getQualifier()); + + // Declare the variable + if (type.isArray()) { + // Check that implicit sizing is only where allowed. + arraySizesCheck(loc, type.getQualifier(), type.getArraySizes(), initializer, false); + + if (! arrayQualifierError(loc, type.getQualifier()) && ! arrayError(loc, type)) + declareArray(loc, identifier, type, symbol); + + if (initializer) { + profileRequires(loc, ENoProfile, 120, E_GL_3DL_array_objects, "initializer"); + profileRequires(loc, EEsProfile, 300, nullptr, "initializer"); + } + } else { + // non-array case + if (symbol == nullptr) + symbol = declareNonArray(loc, identifier, type); + else if (type != symbol->getType()) + error(loc, "cannot change the type of", "redeclaration", symbol->getName().c_str()); + } + + if (symbol == nullptr) + return nullptr; + + // Deal with initializer + TIntermNode* initNode = nullptr; + if (symbol != nullptr && initializer) { + TVariable* variable = symbol->getAsVariable(); + if (! variable) { + error(loc, "initializer requires a variable, not a member", identifier.c_str(), ""); + return nullptr; + } + initNode = executeInitializer(loc, initializer, variable); + } + + // look for errors in layout qualifier use + layoutObjectCheck(loc, *symbol); + + // fix up + fixOffset(loc, *symbol); + + // TODO: The decl AST is turned on based on debug info right now. We should expose it as an explicit option. + if (intermediate.getDebugInfo()) { + TVariable* variable = symbol->getAsVariable(); + if (variable) { + auto decl = new TIntermVariableDecl(intermediate.addSymbol(*variable, loc), initNode); + decl->setLoc(loc); + return decl; + } + else { + // We ignore builtins redeclarations + return nullptr; + } + } + else { + return initNode; + } +} + +// Pick up global defaults from the provide global defaults into dst. +void TParseContext::inheritGlobalDefaults(TQualifier& dst) const +{ + if (dst.storage == EvqVaryingOut) { + if (! dst.hasStream() && language == EShLangGeometry) + dst.layoutStream = globalOutputDefaults.layoutStream; + if (! dst.hasXfbBuffer()) + dst.layoutXfbBuffer = globalOutputDefaults.layoutXfbBuffer; + } +} + +// +// Make an internal-only variable whose name is for debug purposes only +// and won't be searched for. Callers will only use the return value to use +// the variable, not the name to look it up. It is okay if the name +// is the same as other names; there won't be any conflict. +// +TVariable* TParseContext::makeInternalVariable(const char* name, const TType& type) const +{ + TString* nameString = NewPoolTString(name); + TVariable* variable = new TVariable(nameString, type); + symbolTable.makeInternalVariable(*variable); + + return variable; +} + +// +// Declare a non-array variable, the main point being there is no redeclaration +// for resizing allowed. +// +// Return the successfully declared variable. +// +TVariable* TParseContext::declareNonArray(const TSourceLoc& loc, const TString& identifier, const TType& type) +{ + // make a new variable + TVariable* variable = new TVariable(&identifier, type); + + ioArrayCheck(loc, type, identifier); + + // add variable to symbol table + if (symbolTable.insert(*variable)) { + if (symbolTable.atGlobalLevel()) + trackLinkage(*variable); + return variable; + } + + error(loc, "redefinition", variable->getName().c_str(), ""); + return nullptr; +} + +// +// Handle all types of initializers from the grammar. +// +// Returning nullptr just means there is no code to execute to handle the +// initializer, which will, for example, be the case for constant initializers. +// +TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyped* initializer, TVariable* variable) +{ + // A null initializer is an aggregate that hasn't had an op assigned yet + // (still EOpNull, no relation to nullInit), and has no children. + bool nullInit = initializer->getAsAggregate() && initializer->getAsAggregate()->getOp() == EOpNull && + initializer->getAsAggregate()->getSequence().size() == 0; + + // + // Identifier must be of type constant, a global, or a temporary, and + // starting at version 120, desktop allows uniforms to have initializers. + // + TStorageQualifier qualifier = variable->getType().getQualifier().storage; + if (! (qualifier == EvqTemporary || qualifier == EvqGlobal || qualifier == EvqConst || + (qualifier == EvqUniform && !isEsProfile() && version >= 120))) { + if (qualifier == EvqShared) { + // GL_EXT_null_initializer allows this for shared, if it's a null initializer + if (nullInit) { + const char* feature = "initialization with shared qualifier"; + profileRequires(loc, EEsProfile, 0, E_GL_EXT_null_initializer, feature); + profileRequires(loc, ~EEsProfile, 0, E_GL_EXT_null_initializer, feature); + } else { + error(loc, "initializer can only be a null initializer ('{}')", "shared", ""); + } + } else { + error(loc, " cannot initialize this type of qualifier ", + variable->getType().getStorageQualifierString(), ""); + return nullptr; + } + } + + if (nullInit) { + // only some types can be null initialized + if (variable->getType().containsUnsizedArray()) { + error(loc, "null initializers can't size unsized arrays", "{}", ""); + return nullptr; + } + if (variable->getType().containsOpaque()) { + error(loc, "null initializers can't be used on opaque values", "{}", ""); + return nullptr; + } + variable->getWritableType().getQualifier().setNullInit(); + return nullptr; + } + + arrayObjectCheck(loc, variable->getType(), "array initializer"); + + // + // If the initializer was from braces { ... }, we convert the whole subtree to a + // constructor-style subtree, allowing the rest of the code to operate + // identically for both kinds of initializers. + // + // Type can't be deduced from the initializer list, so a skeletal type to + // follow has to be passed in. Constness and specialization-constness + // should be deduced bottom up, not dictated by the skeletal type. + // + TType skeletalType; + skeletalType.shallowCopy(variable->getType()); + skeletalType.getQualifier().makeTemporary(); + initializer = convertInitializerList(loc, skeletalType, initializer); + if (! initializer) { + // error recovery; don't leave const without constant values + if (qualifier == EvqConst) + variable->getWritableType().getQualifier().makeTemporary(); + return nullptr; + } + + // Fix outer arrayness if variable is unsized, getting size from the initializer + if (initializer->getType().isSizedArray() && variable->getType().isUnsizedArray()) + variable->getWritableType().changeOuterArraySize(initializer->getType().getOuterArraySize()); + + // Inner arrayness can also get set by an initializer + if (initializer->getType().isArrayOfArrays() && variable->getType().isArrayOfArrays() && + initializer->getType().getArraySizes()->getNumDims() == + variable->getType().getArraySizes()->getNumDims()) { + // adopt unsized sizes from the initializer's sizes + for (int d = 1; d < variable->getType().getArraySizes()->getNumDims(); ++d) { + if (variable->getType().getArraySizes()->getDimSize(d) == UnsizedArraySize) { + variable->getWritableType().getArraySizes()->setDimSize(d, + initializer->getType().getArraySizes()->getDimSize(d)); + } + } + } + + // Uniforms require a compile-time constant initializer + if (qualifier == EvqUniform && ! initializer->getType().getQualifier().isFrontEndConstant()) { + error(loc, "uniform initializers must be constant", "=", "'%s'", + variable->getType().getCompleteString(intermediate.getEnhancedMsgs()).c_str()); + variable->getWritableType().getQualifier().makeTemporary(); + return nullptr; + } + // Global consts require a constant initializer (specialization constant is okay) + if (qualifier == EvqConst && symbolTable.atGlobalLevel() && ! initializer->getType().getQualifier().isConstant()) { + error(loc, "global const initializers must be constant", "=", "'%s'", + variable->getType().getCompleteString(intermediate.getEnhancedMsgs()).c_str()); + variable->getWritableType().getQualifier().makeTemporary(); + return nullptr; + } + + // Const variables require a constant initializer, depending on version + if (qualifier == EvqConst) { + if (! initializer->getType().getQualifier().isConstant()) { + const char* initFeature = "non-constant initializer"; + requireProfile(loc, ~EEsProfile, initFeature); + profileRequires(loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); + variable->getWritableType().getQualifier().storage = EvqConstReadOnly; + qualifier = EvqConstReadOnly; + } + } else { + // Non-const global variables in ES need a const initializer. + // + // "In declarations of global variables with no storage qualifier or with a const + // qualifier any initializer must be a constant expression." + if (symbolTable.atGlobalLevel() && ! initializer->getType().getQualifier().isConstant()) { + const char* initFeature = + "non-constant global initializer (needs GL_EXT_shader_non_constant_global_initializers)"; + if (isEsProfile()) { + if (relaxedErrors() && ! extensionTurnedOn(E_GL_EXT_shader_non_constant_global_initializers)) + warn(loc, "not allowed in this version", initFeature, ""); + else + profileRequires(loc, EEsProfile, 0, E_GL_EXT_shader_non_constant_global_initializers, initFeature); + } + } + } + + if (qualifier == EvqConst || qualifier == EvqUniform) { + // Compile-time tagging of the variable with its constant value... + + initializer = intermediate.addConversion(EOpAssign, variable->getType(), initializer); + if (! initializer || ! initializer->getType().getQualifier().isConstant() || + variable->getType() != initializer->getType()) { + error(loc, "non-matching or non-convertible constant type for const initializer", + variable->getType().getStorageQualifierString(), ""); + variable->getWritableType().getQualifier().makeTemporary(); + return nullptr; + } + + // We either have a folded constant in getAsConstantUnion, or we have to use + // the initializer's subtree in the AST to represent the computation of a + // specialization constant. + assert(initializer->getAsConstantUnion() || initializer->getType().getQualifier().isSpecConstant()); + if (initializer->getAsConstantUnion()) + variable->setConstArray(initializer->getAsConstantUnion()->getConstArray()); + else { + // It's a specialization constant. + variable->getWritableType().getQualifier().makeSpecConstant(); + + // Keep the subtree that computes the specialization constant with the variable. + // Later, a symbol node will adopt the subtree from the variable. + variable->setConstSubtree(initializer); + } + } else { + // normal assigning of a value to a variable... + specializationCheck(loc, initializer->getType(), "initializer"); + TIntermSymbol* intermSymbol = intermediate.addSymbol(*variable, loc); + TIntermTyped* initNode = intermediate.addAssign(EOpAssign, intermSymbol, initializer, loc); + if (! initNode) + assignError(loc, "=", intermSymbol->getCompleteString(intermediate.getEnhancedMsgs()), initializer->getCompleteString(intermediate.getEnhancedMsgs())); + + return initNode; + } + + return nullptr; +} + +// +// Reprocess any initializer-list (the "{ ... }" syntax) parts of the +// initializer. +// +// Need to hierarchically assign correct types and implicit +// conversions. Will do this mimicking the same process used for +// creating a constructor-style initializer, ensuring we get the +// same form. However, it has to in parallel walk the 'type' +// passed in, as type cannot be deduced from an initializer list. +// +TIntermTyped* TParseContext::convertInitializerList(const TSourceLoc& loc, const TType& type, TIntermTyped* initializer) +{ + // Will operate recursively. Once a subtree is found that is constructor style, + // everything below it is already good: Only the "top part" of the initializer + // can be an initializer list, where "top part" can extend for several (or all) levels. + + // see if we have bottomed out in the tree within the initializer-list part + TIntermAggregate* initList = initializer->getAsAggregate(); + if (! initList || initList->getOp() != EOpNull) + return initializer; + + // Of the initializer-list set of nodes, need to process bottom up, + // so recurse deep, then process on the way up. + + // Go down the tree here... + if (type.isArray()) { + // The type's array might be unsized, which could be okay, so base sizes on the size of the aggregate. + // Later on, initializer execution code will deal with array size logic. + TType arrayType; + arrayType.shallowCopy(type); // sharing struct stuff is fine + arrayType.copyArraySizes(*type.getArraySizes()); // but get a fresh copy of the array information, to edit below + + // edit array sizes to fill in unsized dimensions + arrayType.changeOuterArraySize((int)initList->getSequence().size()); + TIntermTyped* firstInit = initList->getSequence()[0]->getAsTyped(); + if (arrayType.isArrayOfArrays() && firstInit->getType().isArray() && + arrayType.getArraySizes()->getNumDims() == firstInit->getType().getArraySizes()->getNumDims() + 1) { + for (int d = 1; d < arrayType.getArraySizes()->getNumDims(); ++d) { + if (arrayType.getArraySizes()->getDimSize(d) == UnsizedArraySize) + arrayType.getArraySizes()->setDimSize(d, firstInit->getType().getArraySizes()->getDimSize(d - 1)); + } + } + + TType elementType(arrayType, 0); // dereferenced type + for (size_t i = 0; i < initList->getSequence().size(); ++i) { + initList->getSequence()[i] = convertInitializerList(loc, elementType, initList->getSequence()[i]->getAsTyped()); + if (initList->getSequence()[i] == nullptr) + return nullptr; + } + + return addConstructor(loc, initList, arrayType); + } else if (type.isStruct()) { + if (type.getStruct()->size() != initList->getSequence().size()) { + error(loc, "wrong number of structure members", "initializer list", ""); + return nullptr; + } + for (size_t i = 0; i < type.getStruct()->size(); ++i) { + initList->getSequence()[i] = convertInitializerList(loc, *(*type.getStruct())[i].type, initList->getSequence()[i]->getAsTyped()); + if (initList->getSequence()[i] == nullptr) + return nullptr; + } + } else if (type.isMatrix()) { + if (type.getMatrixCols() != (int)initList->getSequence().size()) { + error(loc, "wrong number of matrix columns:", "initializer list", type.getCompleteString(intermediate.getEnhancedMsgs()).c_str()); + return nullptr; + } + TType vectorType(type, 0); // dereferenced type + for (int i = 0; i < type.getMatrixCols(); ++i) { + initList->getSequence()[i] = convertInitializerList(loc, vectorType, initList->getSequence()[i]->getAsTyped()); + if (initList->getSequence()[i] == nullptr) + return nullptr; + } + } else if (type.isVector()) { + if (type.getVectorSize() != (int)initList->getSequence().size()) { + error(loc, "wrong vector size (or rows in a matrix column):", "initializer list", type.getCompleteString(intermediate.getEnhancedMsgs()).c_str()); + return nullptr; + } + TBasicType destType = type.getBasicType(); + for (int i = 0; i < type.getVectorSize(); ++i) { + TBasicType initType = initList->getSequence()[i]->getAsTyped()->getBasicType(); + if (destType != initType && !intermediate.canImplicitlyPromote(initType, destType)) { + error(loc, "type mismatch in initializer list", "initializer list", type.getCompleteString(intermediate.getEnhancedMsgs()).c_str()); + return nullptr; + } + + } + } else { + error(loc, "unexpected initializer-list type:", "initializer list", type.getCompleteString(intermediate.getEnhancedMsgs()).c_str()); + return nullptr; + } + + // Now that the subtree is processed, process this node as if the + // initializer list is a set of arguments to a constructor. + TIntermNode* emulatedConstructorArguments; + if (initList->getSequence().size() == 1) + emulatedConstructorArguments = initList->getSequence()[0]; + else + emulatedConstructorArguments = initList; + return addConstructor(loc, emulatedConstructorArguments, type); +} + +// +// Test for the correctness of the parameters passed to various constructor functions +// and also convert them to the right data type, if allowed and required. +// +// 'node' is what to construct from. +// 'type' is what type to construct. +// +// Returns nullptr for an error or the constructed node (aggregate or typed) for no error. +// +TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* node, const TType& type) +{ + if (node == nullptr || node->getAsTyped() == nullptr) + return nullptr; + rValueErrorCheck(loc, "constructor", node->getAsTyped()); + + TIntermAggregate* aggrNode = node->getAsAggregate(); + TOperator op = intermediate.mapTypeToConstructorOp(type); + + // Combined texture-sampler constructors are completely semantic checked + // in constructorTextureSamplerError() + if (op == EOpConstructTextureSampler) { + if (aggrNode != nullptr) { + if (aggrNode->getSequence()[1]->getAsTyped()->getType().getSampler().shadow) { + // Transfer depth into the texture (SPIR-V image) type, as a hint + // for tools to know this texture/image is a depth image. + aggrNode->getSequence()[0]->getAsTyped()->getWritableType().getSampler().shadow = true; + } + return intermediate.setAggregateOperator(aggrNode, op, type, loc); + } + } + + TTypeList::const_iterator memberTypes; + if (op == EOpConstructStruct) + memberTypes = type.getStruct()->begin(); + + TType elementType; + if (type.isArray()) { + TType dereferenced(type, 0); + elementType.shallowCopy(dereferenced); + } else + elementType.shallowCopy(type); + + bool singleArg; + if (aggrNode) { + if (aggrNode->getOp() != EOpNull) + singleArg = true; + else + singleArg = false; + } else + singleArg = true; + + TIntermTyped *newNode; + if (singleArg) { + // If structure constructor or array constructor is being called + // for only one parameter inside the structure, we need to call constructAggregate function once. + if (type.isArray()) + newNode = constructAggregate(node, elementType, 1, node->getLoc()); + else if (op == EOpConstructStruct) + newNode = constructAggregate(node, *(*memberTypes).type, 1, node->getLoc()); + else + newNode = constructBuiltIn(type, op, node->getAsTyped(), node->getLoc(), false); + + if (newNode && (type.isArray() || op == EOpConstructStruct)) + newNode = intermediate.setAggregateOperator(newNode, EOpConstructStruct, type, loc); + + return newNode; + } + + // + // Handle list of arguments. + // + TIntermSequence &sequenceVector = aggrNode->getSequence(); // Stores the information about the parameter to the constructor + // if the structure constructor contains more than one parameter, then construct + // each parameter + + int paramCount = 0; // keeps track of the constructor parameter number being checked + + // We don't know "top down" whether type is a specialization constant, + // but a const becomes a specialization constant if any of its children are. + bool hasSpecConst = false; + bool isConstConstructor = true; + + // for each parameter to the constructor call, check to see if the right type is passed or convert them + // to the right type if possible (and allowed). + // for structure constructors, just check if the right type is passed, no conversion is allowed. + for (TIntermSequence::iterator p = sequenceVector.begin(); + p != sequenceVector.end(); p++, paramCount++) { + if (type.isArray()) + newNode = constructAggregate(*p, elementType, paramCount+1, node->getLoc()); + else if (op == EOpConstructStruct) + newNode = constructAggregate(*p, *(memberTypes[paramCount]).type, paramCount+1, node->getLoc()); + else + newNode = constructBuiltIn(type, op, (*p)->getAsTyped(), node->getLoc(), true); + + if (newNode) { + *p = newNode; + if (!newNode->getType().getQualifier().isConstant()) + isConstConstructor = false; + if (newNode->getType().getQualifier().isSpecConstant()) + hasSpecConst = true; + } else + return nullptr; + } + + TIntermTyped* ret_node = intermediate.setAggregateOperator(aggrNode, op, type, loc); + + const char *specConstantCompositeExt[] = { E_GL_EXT_spec_constant_composites }; + if (checkExtensionsRequested(loc, 1, specConstantCompositeExt, "spec constant aggregate constructor")) { + if (isConstConstructor && hasSpecConst) { + ret_node->getWritableType().getQualifier().makeSpecConstant(); + } + } + + TIntermAggregate *agg_node = ret_node->getAsAggregate(); + if (agg_node && (agg_node->isVector() || agg_node->isArray() || agg_node->isMatrix())) + agg_node->updatePrecision(); + + return ret_node; +} + +// Function for constructor implementation. Calls addUnaryMath with appropriate EOp value +// for the parameter to the constructor (passed to this function). Essentially, it converts +// the parameter types correctly. If a constructor expects an int (like ivec2) and is passed a +// float, then float is converted to int. +// +// Returns nullptr for an error or the constructed node. +// +TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, TIntermTyped* node, const TSourceLoc& loc, + bool subset) +{ + // If we are changing a matrix in both domain of basic type and to a non matrix, + // do the shape change first (by default, below, basic type is changed before shape). + // This avoids requesting a matrix of a new type that is going to be discarded anyway. + // TODO: This could be generalized to more type combinations, but that would require + // more extensive testing and full algorithm rework. For now, the need to do two changes makes + // the recursive call work, and avoids the most egregious case of creating integer matrices. + if (node->getType().isMatrix() && (type.isScalar() || type.isVector()) && + type.isFloatingDomain() != node->getType().isFloatingDomain()) { + TType transitionType(node->getBasicType(), glslang::EvqTemporary, type.getVectorSize(), 0, 0, node->isVector()); + TOperator transitionOp = intermediate.mapTypeToConstructorOp(transitionType); + node = constructBuiltIn(transitionType, transitionOp, node, loc, false); + } + + TIntermTyped* newNode; + TOperator basicOp; + + // + // First, convert types as needed. + // + switch (op) { + case EOpConstructVec2: + case EOpConstructVec3: + case EOpConstructVec4: + case EOpConstructMat2x2: + case EOpConstructMat2x3: + case EOpConstructMat2x4: + case EOpConstructMat3x2: + case EOpConstructMat3x3: + case EOpConstructMat3x4: + case EOpConstructMat4x2: + case EOpConstructMat4x3: + case EOpConstructMat4x4: + case EOpConstructFloat: + basicOp = EOpConstructFloat; + break; + + case EOpConstructIVec2: + case EOpConstructIVec3: + case EOpConstructIVec4: + case EOpConstructInt: + basicOp = EOpConstructInt; + break; + + case EOpConstructUVec2: + if (node->getType().getBasicType() == EbtReference) { + requireExtensions(loc, 1, &E_GL_EXT_buffer_reference_uvec2, "reference conversion to uvec2"); + TIntermTyped* newNode = intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConvPtrToUvec2, true, node, + type); + return newNode; + } else if (node->getType().getBasicType() == EbtSampler) { + requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "sampler conversion to uvec2"); + // force the basic type of the constructor param to uvec2, otherwise spv builder will + // report some errors + TIntermTyped* newSrcNode = intermediate.createConversion(EbtUint, node); + newSrcNode->getAsTyped()->getWritableType().setVectorSize(2); + + TIntermTyped* newNode = + intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConstructUVec2, false, newSrcNode, type); + return newNode; + } + [[fallthrough]]; + case EOpConstructUVec3: + case EOpConstructUVec4: + case EOpConstructUint: + basicOp = EOpConstructUint; + break; + + case EOpConstructBVec2: + case EOpConstructBVec3: + case EOpConstructBVec4: + case EOpConstructBool: + basicOp = EOpConstructBool; + break; + case EOpConstructTextureSampler: + if ((node->getType().getBasicType() == EbtUint || node->getType().getBasicType() == EbtInt) && + node->getType().getVectorSize() == 2) { + requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "ivec2/uvec2 convert to texture handle"); + // No matter ivec2 or uvec2, Set EOpPackUint2x32 just to generate an opBitcast op code + TIntermTyped* newNode = + intermediate.addBuiltInFunctionCall(node->getLoc(), EOpPackUint2x32, true, node, type); + return newNode; + } + [[fallthrough]]; + case EOpConstructDVec2: + case EOpConstructDVec3: + case EOpConstructDVec4: + case EOpConstructDMat2x2: + case EOpConstructDMat2x3: + case EOpConstructDMat2x4: + case EOpConstructDMat3x2: + case EOpConstructDMat3x3: + case EOpConstructDMat3x4: + case EOpConstructDMat4x2: + case EOpConstructDMat4x3: + case EOpConstructDMat4x4: + case EOpConstructDouble: + basicOp = EOpConstructDouble; + break; + + case EOpConstructF16Vec2: + case EOpConstructF16Vec3: + case EOpConstructF16Vec4: + case EOpConstructF16Mat2x2: + case EOpConstructF16Mat2x3: + case EOpConstructF16Mat2x4: + case EOpConstructF16Mat3x2: + case EOpConstructF16Mat3x3: + case EOpConstructF16Mat3x4: + case EOpConstructF16Mat4x2: + case EOpConstructF16Mat4x3: + case EOpConstructF16Mat4x4: + case EOpConstructFloat16: + basicOp = EOpConstructFloat16; + // 8/16-bit storage extensions don't support direct constructing composites of 8/16-bit types, + // so construct a 32-bit type and convert + // and do not generate any conversion if it is an identity conversion, i.e. float16_t( var) + if (!intermediate.getArithemeticFloat16Enabled() && (node->getBasicType() != EbtFloat16)) { + TType tempType(EbtFloat, EvqTemporary, type.getVectorSize()); + newNode = node; + if (tempType != newNode->getType()) { + TOperator aggregateOp; + if (op == EOpConstructFloat16) + aggregateOp = EOpConstructFloat; + else + aggregateOp = (TOperator)(EOpConstructVec2 + op - EOpConstructF16Vec2); + newNode = intermediate.setAggregateOperator(newNode, aggregateOp, tempType, node->getLoc()); + } + newNode = intermediate.addConversion(EbtFloat16, newNode); + return newNode; + } + break; + + case EOpConstructBF16Vec2: + case EOpConstructBF16Vec3: + case EOpConstructBF16Vec4: + case EOpConstructBFloat16: + basicOp = EOpConstructBFloat16; + break; + + case EOpConstructFloatE5M2Vec2: + case EOpConstructFloatE5M2Vec3: + case EOpConstructFloatE5M2Vec4: + case EOpConstructFloatE5M2: + basicOp = EOpConstructFloatE5M2; + break; + + case EOpConstructFloatE4M3Vec2: + case EOpConstructFloatE4M3Vec3: + case EOpConstructFloatE4M3Vec4: + case EOpConstructFloatE4M3: + basicOp = EOpConstructFloatE4M3; + break; + + case EOpConstructI8Vec2: + case EOpConstructI8Vec3: + case EOpConstructI8Vec4: + case EOpConstructInt8: + basicOp = EOpConstructInt8; + // 8/16-bit storage extensions don't support direct constructing composites of 8/16-bit types, + // so construct a 32-bit type and convert + // and do not generate any conversion if it is an identity conversion, i.e. int8_t( var) + if (!intermediate.getArithemeticInt8Enabled() && (node->getBasicType() != EbtInt8)) { + TType tempType(EbtInt, EvqTemporary, type.getVectorSize()); + newNode = node; + if (tempType != newNode->getType()) { + TOperator aggregateOp; + if (op == EOpConstructInt8) + aggregateOp = EOpConstructInt; + else + aggregateOp = (TOperator)(EOpConstructIVec2 + op - EOpConstructI8Vec2); + newNode = intermediate.setAggregateOperator(newNode, aggregateOp, tempType, node->getLoc()); + } + newNode = intermediate.addConversion(EbtInt8, newNode); + return newNode; + } + break; + + case EOpConstructU8Vec2: + case EOpConstructU8Vec3: + case EOpConstructU8Vec4: + case EOpConstructUint8: + basicOp = EOpConstructUint8; + // 8/16-bit storage extensions don't support direct constructing composites of 8/16-bit types, + // so construct a 32-bit type and convert + // and do not generate any conversion if it is an identity conversion, i.e. uint8_t( var) + if (!intermediate.getArithemeticInt8Enabled() && (node->getBasicType() != EbtUint8)) { + TType tempType(EbtUint, EvqTemporary, type.getVectorSize()); + newNode = node; + if (tempType != newNode->getType()) { + TOperator aggregateOp; + if (op == EOpConstructUint8) + aggregateOp = EOpConstructUint; + else + aggregateOp = (TOperator)(EOpConstructUVec2 + op - EOpConstructU8Vec2); + newNode = intermediate.setAggregateOperator(newNode, aggregateOp, tempType, node->getLoc()); + } + newNode = intermediate.addConversion(EbtUint8, newNode); + return newNode; + } + break; + + case EOpConstructI16Vec2: + case EOpConstructI16Vec3: + case EOpConstructI16Vec4: + case EOpConstructInt16: + basicOp = EOpConstructInt16; + // 8/16-bit storage extensions don't support direct constructing composites of 8/16-bit types, + // so construct a 32-bit type and convert + // and do not generate any conversion if it is an identity conversion, i.e. int16_t( var) + if (!intermediate.getArithemeticInt16Enabled() && (node->getBasicType() != EbtInt16)) { + TType tempType(EbtInt, EvqTemporary, type.getVectorSize()); + newNode = node; + if (tempType != newNode->getType()) { + TOperator aggregateOp; + if (op == EOpConstructInt16) + aggregateOp = EOpConstructInt; + else + aggregateOp = (TOperator)(EOpConstructIVec2 + op - EOpConstructI16Vec2); + newNode = intermediate.setAggregateOperator(newNode, aggregateOp, tempType, node->getLoc()); + } + newNode = intermediate.addConversion(EbtInt16, newNode); + return newNode; + } + break; + + case EOpConstructU16Vec2: + case EOpConstructU16Vec3: + case EOpConstructU16Vec4: + case EOpConstructUint16: + basicOp = EOpConstructUint16; + // 8/16-bit storage extensions don't support direct constructing composites of 8/16-bit types, + // so construct a 32-bit type and convert + // and do not generate any conversion if it is an identity conversion, i.e. uint16_t( var) + if (!intermediate.getArithemeticInt16Enabled() && (node->getBasicType() != EbtUint16)) { + TType tempType(EbtUint, EvqTemporary, type.getVectorSize()); + newNode = node; + if (tempType != newNode->getType()) { + TOperator aggregateOp; + if (op == EOpConstructUint16) + aggregateOp = EOpConstructUint; + else + aggregateOp = (TOperator)(EOpConstructUVec2 + op - EOpConstructU16Vec2); + newNode = intermediate.setAggregateOperator(newNode, aggregateOp, tempType, node->getLoc()); + } + newNode = intermediate.addConversion(EbtUint16, newNode); + return newNode; + } + break; + + case EOpConstructI64Vec2: + case EOpConstructI64Vec3: + case EOpConstructI64Vec4: + case EOpConstructInt64: + basicOp = EOpConstructInt64; + break; + + case EOpConstructUint64: + if (type.isScalar() && node->getType().isReference()) { + TIntermTyped* newNode = intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConvPtrToUint64, true, node, type); + return newNode; + } + [[fallthrough]]; + case EOpConstructU64Vec2: + case EOpConstructU64Vec3: + case EOpConstructU64Vec4: + basicOp = EOpConstructUint64; + break; + + case EOpConstructNonuniform: + // Make a nonuniform copy of node + newNode = intermediate.addBuiltInFunctionCall(node->getLoc(), EOpCopyObject, true, node, type); + return newNode; + + case EOpConstructReference: + // construct reference from reference + if (node->getType().isReference()) { + newNode = intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConstructReference, true, node, type); + return newNode; + // construct reference from uint64 + } else if (node->getType().isScalar() && node->getType().getBasicType() == EbtUint64) { + TIntermTyped* newNode = intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConvUint64ToPtr, true, node, + type); + return newNode; + // construct reference from uvec2 + } else if (node->getType().isVector() && node->getType().getBasicType() == EbtUint && + node->getVectorSize() == 2) { + requireExtensions(loc, 1, &E_GL_EXT_buffer_reference_uvec2, "uvec2 conversion to reference"); + TIntermTyped* newNode = intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConvUvec2ToPtr, true, node, + type); + return newNode; + } else { + return nullptr; + } + + case EOpConstructCooperativeVectorNV: + if (!node->getType().isCoopVecNV()) { + if (type.getBasicType() != node->getType().getBasicType()) { + node = intermediate.addConversion(type.getBasicType(), node); + if (node == nullptr) + return nullptr; + } + } + if (type.getBasicType() != node->getType().getBasicType()) { + intermediate.buildConvertOp(type.getBasicType(), node->getType().getBasicType(), op); + node = intermediate.addUnaryNode(op, node, node->getLoc(), type); + return node; + } + if (subset) { + return node; + } + + node = intermediate.setAggregateOperator(node, op, type, node->getLoc()); + + return node; + + case EOpConstructCooperativeMatrixNV: + case EOpConstructCooperativeMatrixKHR: + if (node->getType() == type) { + return node; + } + if (!node->getType().isCoopMat()) { + if (type.getBasicType() != node->getType().getBasicType()) { + node = intermediate.addConversion(type.getBasicType(), node); + if (node == nullptr) + return nullptr; + } + node = intermediate.setAggregateOperator(node, op, type, node->getLoc()); + } else if (type.sameCoopMatShape(node->getType()) && !type.sameCoopMatUse(node->getType()) && + type.getBasicType() == node->getType().getBasicType()) { + node = intermediate.setAggregateOperator(node, op, type, node->getLoc()); + } else { + TOperator op = EOpConvNumeric; + + node = intermediate.addUnaryNode(op, node, node->getLoc(), type); + // If it's a (non-specialization) constant, it must be folded. + if (node->getAsUnaryNode()->getOperand()->getAsConstantUnion()) + return node->getAsUnaryNode()->getOperand()->getAsConstantUnion()->fold(op, node->getType()); + } + + return node; + + case EOpConstructAccStruct: + if ((node->getType().isScalar() && node->getType().getBasicType() == EbtUint64)) { + // construct acceleration structure from uint64 + requireExtensions(loc, Num_ray_tracing_EXTs, ray_tracing_EXTs, "uint64_t conversion to acclerationStructureEXT"); + return intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConvUint64ToAccStruct, true, node, + type); + } else if (node->getType().isVector() && node->getType().getBasicType() == EbtUint && node->getVectorSize() == 2) { + // construct acceleration structure from uint64 + requireExtensions(loc, Num_ray_tracing_EXTs, ray_tracing_EXTs, "uvec2 conversion to accelerationStructureEXT"); + return intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConvUvec2ToAccStruct, true, node, + type); + } else + return nullptr; + + default: + error(loc, "unsupported construction", "", ""); + + return nullptr; + } + newNode = intermediate.addUnaryMath(basicOp, node, node->getLoc()); + if (newNode == nullptr) { + error(loc, "can't convert", "constructor", ""); + return nullptr; + } + + // + // Now, if there still isn't an operation to do the construction, and we need one, add one. + // + + // Otherwise, skip out early. + if (subset || (newNode != node && newNode->getType() == type)) + return newNode; + + // setAggregateOperator will insert a new node for the constructor, as needed. + return intermediate.setAggregateOperator(newNode, op, type, loc); +} + +void TParseContext::makeVariadic(TFunction *F, const TSourceLoc &loc) { + if (parsingBuiltins) { + F->setVariadic(); + } else { + error(loc, "variadic argument specifier is only available for builtins", "...", ""); + } +} + +TParameter TParseContext::getParamWithDefault(const TPublicType& ty, TString* identifier, TIntermTyped* initializer, + const TSourceLoc& loc) +{ + if (!parsingBuiltins) { + error(loc, "default argument values are only available for builtins", "=", ""); + initializer = nullptr; + } + if (ty.arraySizes) { + error(loc, "array arguments cannot be default-initialized", identifier->c_str(), ""); + initializer = nullptr; + } + if (ty.basicType == EbtVoid) { + error(loc, "illegal use of type 'void'", identifier->c_str(), ""); + initializer = nullptr; + } + reservedErrorCheck(loc, *identifier); + TParameter param = {identifier, new TType(ty), initializer}; + return param; +} + +// This function tests for the type of the parameters to the structure or array constructor. Raises +// an error message if the expected type does not match the parameter passed to the constructor. +// +// Returns nullptr for an error or the input node itself if the expected and the given parameter types match. +// +TIntermTyped* TParseContext::constructAggregate(TIntermNode* node, const TType& type, int paramCount, const TSourceLoc& loc) +{ + TIntermTyped* converted = intermediate.addConversion(EOpConstructStruct, type, node->getAsTyped()); + if (! converted || converted->getType() != type) { + bool enhanced = intermediate.getEnhancedMsgs(); + error(loc, "", "constructor", "cannot convert parameter %d from '%s' to '%s'", paramCount, + node->getAsTyped()->getType().getCompleteString(enhanced).c_str(), type.getCompleteString(enhanced).c_str()); + + return nullptr; + } + + return converted; +} + +// If a memory qualifier is present in 'to', also make it present in 'from'. +void TParseContext::inheritMemoryQualifiers(const TQualifier& from, TQualifier& to) +{ + if (from.isReadOnly()) + to.readonly = from.readonly; + if (from.isWriteOnly()) + to.writeonly = from.writeonly; + if (from.coherent) + to.coherent = from.coherent; + if (from.volatil) + to.volatil = from.volatil; + if (from.nontemporal) + to.nontemporal = from.nontemporal; + if (from.restrict) + to.restrict = from.restrict; +} + +// +// Update qualifier layoutBindlessImage & layoutBindlessSampler on block member +// +void TParseContext::updateBindlessQualifier(TType& memberType) +{ + if (memberType.containsSampler()) { + if (memberType.isStruct()) { + TTypeList* typeList = memberType.getWritableStruct(); + for (unsigned int member = 0; member < typeList->size(); ++member) { + TType* subMemberType = (*typeList)[member].type; + updateBindlessQualifier(*subMemberType); + } + } + else if (memberType.getSampler().isImage()) { + intermediate.setBindlessImageMode(currentCaller, AstRefTypeLayout); + memberType.getQualifier().layoutBindlessImage = true; + } + else { + intermediate.setBindlessTextureMode(currentCaller, AstRefTypeLayout); + memberType.getQualifier().layoutBindlessSampler = true; + } + } +} + +// +// Do everything needed to add an interface block. Returns the declarator node if there's an instance declaration. +// +TIntermNode* TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, const TString* instanceName, + TArraySizes* arraySizes) +{ + if (spvVersion.vulkan > 0 && spvVersion.vulkanRelaxed) + blockStorageRemap(loc, blockName, currentBlockQualifier); + blockStageIoCheck(loc, currentBlockQualifier); + blockQualifierCheck(loc, currentBlockQualifier, instanceName != nullptr); + if (arraySizes != nullptr) { + arraySizesCheck(loc, currentBlockQualifier, arraySizes, nullptr, false); + arrayOfArrayVersionCheck(loc, arraySizes); + if (arraySizes->getNumDims() > 1) + requireProfile(loc, ~EEsProfile, "array-of-array of block"); + } + + // Inherit and check member storage qualifiers WRT to the block-level qualifier. + for (unsigned int member = 0; member < typeList.size(); ++member) { + TType& memberType = *typeList[member].type; + TQualifier& memberQualifier = memberType.getQualifier(); + const TSourceLoc& memberLoc = typeList[member].loc; + if (memberQualifier.storage != EvqTemporary && memberQualifier.storage != EvqGlobal && memberQualifier.storage != currentBlockQualifier.storage) + error(memberLoc, "member storage qualifier cannot contradict block storage qualifier", memberType.getFieldName().c_str(), ""); + memberQualifier.storage = currentBlockQualifier.storage; + globalQualifierFixCheck(memberLoc, memberQualifier); + inheritMemoryQualifiers(currentBlockQualifier, memberQualifier); + if (currentBlockQualifier.perPrimitiveNV) + memberQualifier.perPrimitiveNV = currentBlockQualifier.perPrimitiveNV; + if (currentBlockQualifier.perViewNV) + memberQualifier.perViewNV = currentBlockQualifier.perViewNV; + if (currentBlockQualifier.perTaskNV) + memberQualifier.perTaskNV = currentBlockQualifier.perTaskNV; + if (currentBlockQualifier.storage == EvqtaskPayloadSharedEXT) + memberQualifier.storage = EvqtaskPayloadSharedEXT; + if (memberQualifier.storage == EvqSpirvStorageClass) + error(memberLoc, "member cannot have a spirv_storage_class qualifier", memberType.getFieldName().c_str(), ""); + if (memberQualifier.hasSpirvDecorate() && !memberQualifier.getSpirvDecorate().decorateIds.empty()) + error(memberLoc, "member cannot have a spirv_decorate_id qualifier", memberType.getFieldName().c_str(), ""); + if ((currentBlockQualifier.storage == EvqUniform || currentBlockQualifier.storage == EvqBuffer) && (memberQualifier.isInterpolation() || memberQualifier.isAuxiliary())) + error(memberLoc, "member of uniform or buffer block cannot have an auxiliary or interpolation qualifier", memberType.getFieldName().c_str(), ""); + if (memberType.isArray()) + arraySizesCheck(memberLoc, currentBlockQualifier, memberType.getArraySizes(), nullptr, member == typeList.size() - 1); + if (memberQualifier.hasOffset()) { + if (spvVersion.spv == 0) { + profileRequires(memberLoc, ~EEsProfile, 440, E_GL_ARB_enhanced_layouts, "\"offset\" on block member"); + profileRequires(memberLoc, EEsProfile, 300, E_GL_ARB_enhanced_layouts, "\"offset\" on block member"); + } + } + + // For bindless texture, sampler can be declared as uniform/storage block member, + if (memberType.containsOpaque()) { + if (memberType.containsSampler() && extensionTurnedOn(E_GL_ARB_bindless_texture)) + updateBindlessQualifier(memberType); + else + error(memberLoc, "member of block cannot be or contain a sampler, image, or atomic_uint type", typeList[member].type->getFieldName().c_str(), ""); + } + + if (memberType.containsCoopMat()) + error(memberLoc, "member of block cannot be or contain a cooperative matrix type", typeList[member].type->getFieldName().c_str(), ""); + + if (memberType.containsCoopVec()) + error(memberLoc, "member of block cannot be or contain a cooperative vector type", typeList[member].type->getFieldName().c_str(), ""); + } + + // This might be a redeclaration of a built-in block. If so, redeclareBuiltinBlock() will + // do all the rest. + if (! symbolTable.atBuiltInLevel() && builtInName(*blockName)) { + redeclareBuiltinBlock(loc, typeList, *blockName, instanceName, arraySizes); + return nullptr; + } + + // Not a redeclaration of a built-in; check that all names are user names. + reservedErrorCheck(loc, *blockName); + if (instanceName) + reservedErrorCheck(loc, *instanceName); + for (unsigned int member = 0; member < typeList.size(); ++member) + reservedErrorCheck(typeList[member].loc, typeList[member].type->getFieldName()); + + // Make default block qualification, and adjust the member qualifications + + TQualifier defaultQualification; + switch (currentBlockQualifier.storage) { + case EvqUniform: defaultQualification = globalUniformDefaults; break; + case EvqBuffer: defaultQualification = globalBufferDefaults; break; + case EvqVaryingIn: defaultQualification = globalInputDefaults; break; + case EvqVaryingOut: defaultQualification = globalOutputDefaults; break; + case EvqShared: defaultQualification = globalSharedDefaults; break; + default: defaultQualification.clear(); break; + } + + // Special case for "push_constant uniform", which has a default of std430, + // contrary to normal uniform defaults, and can't have a default tracked for it. + if ((currentBlockQualifier.isPushConstant() && !currentBlockQualifier.hasPacking()) || + (currentBlockQualifier.isShaderRecord() && !currentBlockQualifier.hasPacking())) + currentBlockQualifier.layoutPacking = ElpStd430; + + // Special case for "taskNV in/out", which has a default of std430, + if (currentBlockQualifier.isTaskMemory() && !currentBlockQualifier.hasPacking()) + currentBlockQualifier.layoutPacking = ElpStd430; + + // fix and check for member layout qualifiers + + mergeObjectLayoutQualifiers(defaultQualification, currentBlockQualifier, true); + + // "The align qualifier can only be used on blocks or block members, and only for blocks declared with std140 or std430 layouts." + if (currentBlockQualifier.hasAlign()) { + if (defaultQualification.layoutPacking != ElpStd140 && + defaultQualification.layoutPacking != ElpStd430 && + defaultQualification.layoutPacking != ElpScalar) { + error(loc, "can only be used with std140, std430, or scalar layout packing", "align", ""); + defaultQualification.layoutAlign = -1; + } + } + + bool memberWithLocation = false; + bool memberWithoutLocation = false; + bool memberWithPerViewQualifier = false; + for (unsigned int member = 0; member < typeList.size(); ++member) { + TQualifier& memberQualifier = typeList[member].type->getQualifier(); + const TSourceLoc& memberLoc = typeList[member].loc; + if (memberQualifier.hasStream()) { + if (defaultQualification.layoutStream != memberQualifier.layoutStream) + error(memberLoc, "member cannot contradict block", "stream", ""); + } + + // "This includes a block's inheritance of the + // current global default buffer, a block member's inheritance of the block's + // buffer, and the requirement that any *xfb_buffer* declared on a block + // member must match the buffer inherited from the block." + if (memberQualifier.hasXfbBuffer()) { + if (defaultQualification.layoutXfbBuffer != memberQualifier.layoutXfbBuffer) + error(memberLoc, "member cannot contradict block (or what block inherited from global)", "xfb_buffer", ""); + } + + if (memberQualifier.hasPacking()) + error(memberLoc, "member of block cannot have a packing layout qualifier", typeList[member].type->getFieldName().c_str(), ""); + if (memberQualifier.hasLocation()) { + const char* feature = "location on block member"; + switch (currentBlockQualifier.storage) { + case EvqVaryingIn: + case EvqVaryingOut: + requireProfile(memberLoc, ECoreProfile | ECompatibilityProfile | EEsProfile, feature); + profileRequires(memberLoc, ECoreProfile | ECompatibilityProfile, 440, E_GL_ARB_enhanced_layouts, feature); + profileRequires(memberLoc, EEsProfile, 320, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, feature); + memberWithLocation = true; + break; + default: + error(memberLoc, "can only use in an in/out block", feature, ""); + break; + } + } else + memberWithoutLocation = true; + + // "The offset qualifier can only be used on block members of blocks declared with std140 or std430 layouts." + // "The align qualifier can only be used on blocks or block members, and only for blocks declared with std140 or std430 layouts." + if (memberQualifier.hasAlign() || memberQualifier.hasOffset()) { + if (defaultQualification.layoutPacking != ElpStd140 && + defaultQualification.layoutPacking != ElpStd430 && + defaultQualification.layoutPacking != ElpScalar) + error(memberLoc, "can only be used with std140, std430, or scalar layout packing", "offset/align", ""); + } + + if (memberQualifier.isPerView()) { + memberWithPerViewQualifier = true; + } + + TQualifier newMemberQualification = defaultQualification; + mergeQualifiers(memberLoc, newMemberQualification, memberQualifier, false); + memberQualifier = newMemberQualification; + } + + layoutMemberLocationArrayCheck(loc, memberWithLocation, arraySizes); + + // Ensure that the block has an XfbBuffer assigned. This is needed + // because if the block has a XfbOffset assigned, then it is + // assumed that it has implicitly assigned the current global + // XfbBuffer, and because it's members need to be assigned a + // XfbOffset if they lack it. + if (currentBlockQualifier.storage == EvqVaryingOut && globalOutputDefaults.hasXfbBuffer()) { + if (!currentBlockQualifier.hasXfbBuffer() && currentBlockQualifier.hasXfbOffset()) + currentBlockQualifier.layoutXfbBuffer = globalOutputDefaults.layoutXfbBuffer; + } + + // Process the members + fixBlockLocations(loc, currentBlockQualifier, typeList, memberWithLocation, memberWithoutLocation); + fixXfbOffsets(currentBlockQualifier, typeList); + fixBlockUniformOffsets(currentBlockQualifier, typeList); + fixBlockUniformLayoutMatrix(currentBlockQualifier, &typeList, nullptr); + fixBlockUniformLayoutPacking(currentBlockQualifier, &typeList, nullptr); + for (unsigned int member = 0; member < typeList.size(); ++member) + layoutTypeCheck(typeList[member].loc, *typeList[member].type); + + if (memberWithPerViewQualifier) { + for (unsigned int member = 0; member < typeList.size(); ++member) { + checkAndResizeMeshViewDim(typeList[member].loc, *typeList[member].type, /*isBlockMember*/ true); + } + } + + // reverse merge, so that currentBlockQualifier now has all layout information + // (can't use defaultQualification directly, it's missing other non-layout-default-class qualifiers) + mergeObjectLayoutQualifiers(currentBlockQualifier, defaultQualification, true); + + // + // Build and add the interface block as a new type named 'blockName' + // + + TType blockType(&typeList, *blockName, currentBlockQualifier); + if (arraySizes != nullptr) + blockType.transferArraySizes(arraySizes); + + if (arraySizes == nullptr) + ioArrayCheck(loc, blockType, instanceName ? *instanceName : *blockName); + if (currentBlockQualifier.hasBufferReference()) { + + if (currentBlockQualifier.storage != EvqBuffer) + error(loc, "can only be used with buffer", "buffer_reference", ""); + + // Create the block reference type. If it was forward-declared, detect that + // as a referent struct type with no members. Replace the referent type with + // blockType. + TType blockNameType(EbtReference, blockType, *blockName); + TVariable* blockNameVar = new TVariable(blockName, blockNameType, true); + if (! symbolTable.insert(*blockNameVar)) { + TSymbol* existingName = symbolTable.find(*blockName); + if (existingName->getType().isReference() && + existingName->getType().getReferentType()->getStruct() && + existingName->getType().getReferentType()->getStruct()->size() == 0 && + existingName->getType().getQualifier().storage == blockType.getQualifier().storage) { + existingName->getType().getReferentType()->deepCopy(blockType); + } else { + error(loc, "block name cannot be redefined", blockName->c_str(), ""); + } + } + if (!instanceName) { + return nullptr; + } + } else { + // + // Don't make a user-defined type out of block name; that will cause an error + // if the same block name gets reused in a different interface. + // + // "Block names have no other use within a shader + // beyond interface matching; it is a compile-time error to use a block name at global scope for anything + // other than as a block name (e.g., use of a block name for a global variable name or function name is + // currently reserved)." + // + // Use the symbol table to prevent normal reuse of the block's name, as a variable entry, + // whose type is EbtBlock, but without all the structure; that will come from the type + // the instances point to. + // + TType blockNameType(EbtBlock, blockType.getQualifier().storage); + TVariable* blockNameVar = new TVariable(blockName, blockNameType); + if (! symbolTable.insert(*blockNameVar)) { + TSymbol* existingName = symbolTable.find(*blockName); + if (existingName->getType().getBasicType() == EbtBlock) { + if (existingName->getType().getQualifier().storage == blockType.getQualifier().storage) { + error(loc, "Cannot reuse block name within the same interface:", blockName->c_str(), blockType.getStorageQualifierString()); + return nullptr; + } + } else { + error(loc, "block name cannot redefine a non-block name", blockName->c_str(), ""); + return nullptr; + } + } + } + + // Add the variable, as anonymous or named instanceName. + // Make an anonymous variable if no name was provided. + if (! instanceName) + instanceName = NewPoolTString(""); + + TVariable& variable = *new TVariable(instanceName, blockType); + if (! symbolTable.insert(variable)) { + if (*instanceName == "") + error(loc, "nameless block contains a member that already has a name at global scope", blockName->c_str(), ""); + else + error(loc, "block instance name redefinition", variable.getName().c_str(), ""); + + return nullptr; + } + + // Check for general layout qualifier errors + layoutObjectCheck(loc, variable); + + // fix up + if (isIoResizeArray(blockType)) { + ioArraySymbolResizeList.push_back(&variable); + checkIoArraysConsistency(loc, true); + } else + fixIoArraySize(loc, variable.getWritableType()); + + // Save it in the AST for linker use. + trackLinkage(variable); + + TIntermAggregate* declNode = nullptr; + if (intermediate.getDebugInfo()) { + auto blockDeclNode = new TIntermVariableDecl(intermediate.addSymbol(variable, loc), nullptr); + blockDeclNode->setLoc(loc); + + // We have to wrap the declaration with a sequence to fit the same processing logic with variables. + declNode = new TIntermAggregate(EOpSequence); + declNode->getSequence().push_back(blockDeclNode); + } + return declNode; +} + +// +// allow storage type of block to be remapped at compile time +// +void TParseContext::blockStorageRemap(const TSourceLoc&, const TString* instanceName, TQualifier& qualifier) +{ + TBlockStorageClass type = intermediate.getBlockStorageOverride(instanceName->c_str()); + if (type != EbsNone) { + qualifier.setBlockStorage(type); + } +} + +// Do all block-declaration checking regarding the combination of in/out/uniform/buffer +// with a particular stage. +void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& qualifier) +{ + const char *extsrt[2] = { E_GL_NV_ray_tracing, E_GL_EXT_ray_tracing }; + switch (qualifier.storage) { + case EvqUniform: + profileRequires(loc, EEsProfile, 300, nullptr, "uniform block"); + profileRequires(loc, ENoProfile, 140, E_GL_ARB_uniform_buffer_object, "uniform block"); + if (currentBlockQualifier.layoutPacking == ElpStd430 && ! currentBlockQualifier.isPushConstant()) + requireExtensions(loc, 1, &E_GL_EXT_scalar_block_layout, "std430 requires the buffer storage qualifier"); + break; + case EvqBuffer: + requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, "buffer block"); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_shader_storage_buffer_object, "buffer block"); + profileRequires(loc, EEsProfile, 310, nullptr, "buffer block"); + break; + case EvqVaryingIn: + profileRequires(loc, ~EEsProfile, 150, E_GL_ARB_separate_shader_objects, "input block"); + // It is a compile-time error to have an input block in a vertex shader or an output block in a fragment shader + // "Compute shaders do not permit user-defined input variables..." + requireStage(loc, (EShLanguageMask)(EShLangTessControlMask|EShLangTessEvaluationMask|EShLangGeometryMask| + EShLangFragmentMask|EShLangMeshMask), "input block"); + if (language == EShLangFragment) { + profileRequires(loc, EEsProfile, 320, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, "fragment input block"); + } else if (language == EShLangMesh && ! qualifier.isTaskMemory()) { + error(loc, "input blocks cannot be used in a mesh shader", "out", ""); + } + break; + case EvqVaryingOut: + profileRequires(loc, ~EEsProfile, 150, E_GL_ARB_separate_shader_objects, "output block"); + requireStage(loc, (EShLanguageMask)(EShLangVertexMask|EShLangTessControlMask|EShLangTessEvaluationMask| + EShLangGeometryMask|EShLangMeshMask|EShLangTaskMask), "output block"); + // ES 310 can have a block before shader_io is turned on, so skip this test for built-ins + if (language == EShLangVertex && ! parsingBuiltins) { + profileRequires(loc, EEsProfile, 320, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, "vertex output block"); + } else if (language == EShLangMesh && qualifier.isTaskMemory()) { + error(loc, "can only use on input blocks in mesh shader", "taskNV", ""); + } else if (language == EShLangTask && ! qualifier.isTaskMemory()) { + error(loc, "output blocks cannot be used in a task shader", "out", ""); + } + break; + case EvqShared: + if (spvVersion.spv > 0 && spvVersion.spv < EShTargetSpv_1_4) { + error(loc, "shared block requires at least SPIR-V 1.4", "shared block", ""); + } + profileRequires(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, 0, E_GL_EXT_shared_memory_block, "shared block"); + break; + case EvqPayload: + profileRequires(loc, ~EEsProfile, 460, 2, extsrt, "rayPayloadNV block"); + requireStage(loc, (EShLanguageMask)(EShLangRayGenMask | EShLangAnyHitMask | EShLangClosestHitMask | EShLangMissMask), + "rayPayloadNV block"); + break; + case EvqPayloadIn: + profileRequires(loc, ~EEsProfile, 460, 2, extsrt, "rayPayloadInNV block"); + requireStage(loc, (EShLanguageMask)(EShLangAnyHitMask | EShLangClosestHitMask | EShLangMissMask), + "rayPayloadInNV block"); + break; + case EvqHitAttr: + profileRequires(loc, ~EEsProfile, 460, 2, extsrt, "hitAttributeNV block"); + requireStage(loc, (EShLanguageMask)(EShLangIntersectMask | EShLangAnyHitMask | EShLangClosestHitMask), "hitAttributeNV block"); + break; + case EvqCallableData: + profileRequires(loc, ~EEsProfile, 460, 2, extsrt, "callableDataNV block"); + requireStage(loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), + "callableDataNV block"); + break; + case EvqCallableDataIn: + profileRequires(loc, ~EEsProfile, 460, 2, extsrt, "callableDataInNV block"); + requireStage(loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV block"); + break; + case EvqHitObjectAttrNV: + profileRequires(loc, ~EEsProfile, 460, E_GL_NV_shader_invocation_reorder, "hitObjectAttributeNV block"); + requireStage(loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | EShLangMissMask), "hitObjectAttributeNV block"); + break; + case EvqHitObjectAttrEXT: + profileRequires(loc, ~EEsProfile, 460, E_GL_EXT_shader_invocation_reorder, "hitObjectAttributeEXT block"); + requireStage(loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | EShLangMissMask), "hitObjectAttributeEXT block"); + break; + default: + error(loc, "only uniform, buffer, in, or out blocks are supported", blockName->c_str(), ""); + break; + } +} + +// Do all block-declaration checking regarding its qualifiers. +void TParseContext::blockQualifierCheck(const TSourceLoc& loc, const TQualifier& qualifier, bool /*instanceName*/) +{ + // The 4.5 specification says: + // + // interface-block : + // layout-qualifieropt interface-qualifier block-name { member-list } instance-nameopt ; + // + // interface-qualifier : + // in + // out + // patch in + // patch out + // uniform + // buffer + // + // Note however memory qualifiers aren't included, yet the specification also says + // + // "...memory qualifiers may also be used in the declaration of shader storage blocks..." + + if (qualifier.isInterpolation()) + error(loc, "cannot use interpolation qualifiers on an interface block", "flat/smooth/noperspective", ""); + if (qualifier.centroid) + error(loc, "cannot use centroid qualifier on an interface block", "centroid", ""); + if (qualifier.isSample()) + error(loc, "cannot use sample qualifier on an interface block", "sample", ""); + if (qualifier.invariant) + error(loc, "cannot use invariant qualifier on an interface block", "invariant", ""); + if (qualifier.isPushConstant()) + intermediate.addPushConstantCount(); + if (qualifier.isShaderRecord()) + intermediate.addShaderRecordCount(); + if (qualifier.isTaskMemory()) + intermediate.addTaskNVCount(); +} + +// +// "For a block, this process applies to the entire block, or until the first member +// is reached that has a location layout qualifier. When a block member is declared with a location +// qualifier, its location comes from that qualifier: The member's location qualifier overrides the block-level +// declaration. Subsequent members are again assigned consecutive locations, based on the newest location, +// until the next member declared with a location qualifier. The values used for locations do not have to be +// declared in increasing order." +void TParseContext::fixBlockLocations(const TSourceLoc& loc, TQualifier& qualifier, TTypeList& typeList, bool memberWithLocation, bool memberWithoutLocation) +{ + // "If a block has no block-level location layout qualifier, it is required that either all or none of its members + // have a location layout qualifier, or a compile-time error results." + if (! qualifier.hasLocation() && memberWithLocation && memberWithoutLocation) + error(loc, "either the block needs a location, or all members need a location, or no members have a location", "location", ""); + else { + if (memberWithLocation) { + // remove any block-level location and make it per *every* member + int nextLocation = 0; // by the rule above, initial value is not relevant + if (qualifier.hasAnyLocation()) { + nextLocation = qualifier.layoutLocation; + qualifier.layoutLocation = TQualifier::layoutLocationEnd; + if (qualifier.hasComponent()) { + // "It is a compile-time error to apply the *component* qualifier to a ... block" + error(loc, "cannot apply to a block", "component", ""); + } + if (qualifier.hasIndex()) { + error(loc, "cannot apply to a block", "index", ""); + } + } + for (unsigned int member = 0; member < typeList.size(); ++member) { + TQualifier& memberQualifier = typeList[member].type->getQualifier(); + const TSourceLoc& memberLoc = typeList[member].loc; + if (! memberQualifier.hasLocation()) { + if (nextLocation >= (int)TQualifier::layoutLocationEnd) + error(memberLoc, "location is too large", "location", ""); + memberQualifier.layoutLocation = nextLocation; + memberQualifier.layoutComponent = TQualifier::layoutComponentEnd; + } + nextLocation = memberQualifier.layoutLocation + intermediate.computeTypeLocationSize( + *typeList[member].type, language); + } + } + } +} + +void TParseContext::fixXfbOffsets(TQualifier& qualifier, TTypeList& typeList) +{ + // "If a block is qualified with xfb_offset, all its + // members are assigned transform feedback buffer offsets. If a block is not qualified with xfb_offset, any + // members of that block not qualified with an xfb_offset will not be assigned transform feedback buffer + // offsets." + + if (! qualifier.hasXfbBuffer() || ! qualifier.hasXfbOffset()) + return; + + int nextOffset = qualifier.layoutXfbOffset; + for (unsigned int member = 0; member < typeList.size(); ++member) { + TQualifier& memberQualifier = typeList[member].type->getQualifier(); + bool contains64BitType = false; + bool contains32BitType = false; + bool contains16BitType = false; + int memberSize = intermediate.computeTypeXfbSize(*typeList[member].type, contains64BitType, contains32BitType, contains16BitType); + // see if we need to auto-assign an offset to this member + if (! memberQualifier.hasXfbOffset()) { + // "if applied to an aggregate containing a double or 64-bit integer, the offset must also be a multiple of 8" + if (contains64BitType) + RoundToPow2(nextOffset, 8); + else if (contains32BitType) + RoundToPow2(nextOffset, 4); + else if (contains16BitType) + RoundToPow2(nextOffset, 2); + memberQualifier.layoutXfbOffset = nextOffset; + } else + nextOffset = memberQualifier.layoutXfbOffset; + nextOffset += memberSize; + } + + // The above gave all block members an offset, so we can take it off the block now, + // which will avoid double counting the offset usage. + qualifier.layoutXfbOffset = TQualifier::layoutXfbOffsetEnd; +} + +// Calculate and save the offset of each block member, using the recursively +// defined block offset rules and the user-provided offset and align. +// +// Also, compute and save the total size of the block. For the block's size, arrayness +// is not taken into account, as each element is backed by a separate buffer. +// +void TParseContext::fixBlockUniformOffsets(TQualifier& qualifier, TTypeList& typeList) +{ + if (!storageCanHaveLayoutInBlock(qualifier.storage) && !qualifier.isTaskMemory()) + return; + if (qualifier.layoutPacking != ElpStd140 && qualifier.layoutPacking != ElpStd430 && qualifier.layoutPacking != ElpScalar) + return; + + int offset = 0; + int memberSize; + for (unsigned int member = 0; member < typeList.size(); ++member) { + TQualifier& memberQualifier = typeList[member].type->getQualifier(); + const TSourceLoc& memberLoc = typeList[member].loc; + + // "When align is applied to an array, it effects only the start of the array, not the array's internal stride." + + // modify just the children's view of matrix layout, if there is one for this member + TLayoutMatrix subMatrixLayout = typeList[member].type->getQualifier().layoutMatrix; + int dummyStride; + int memberAlignment = intermediate.getMemberAlignment(*typeList[member].type, memberSize, dummyStride, qualifier.layoutPacking, + subMatrixLayout != ElmNone ? subMatrixLayout == ElmRowMajor : qualifier.layoutMatrix == ElmRowMajor); + if (memberQualifier.hasOffset()) { + // "The specified offset must be a multiple + // of the base alignment of the type of the block member it qualifies, or a compile-time error results." + if (! IsMultipleOfPow2(memberQualifier.layoutOffset, memberAlignment)) + error(memberLoc, "must be a multiple of the member's alignment", "offset", + "(layout offset = %d | member alignment = %d)", memberQualifier.layoutOffset, memberAlignment); + + // GLSL: "It is a compile-time error to specify an offset that is smaller than the offset of the previous + // member in the block or that lies within the previous member of the block" + if (spvVersion.spv == 0) { + if (memberQualifier.layoutOffset < offset) + error(memberLoc, "cannot lie in previous members", "offset", ""); + + // "The offset qualifier forces the qualified member to start at or after the specified + // integral-constant expression, which will be its byte offset from the beginning of the buffer. + // "The actual offset of a member is computed as + // follows: If offset was declared, start with that offset, otherwise start with the next available offset." + offset = std::max(offset, memberQualifier.layoutOffset); + } else { + // TODO: Vulkan: "It is a compile-time error to have any offset, explicit or assigned, + // that lies within another member of the block." + + offset = memberQualifier.layoutOffset; + } + } + + // "The actual alignment of a member will be the greater of the specified align alignment and the standard + // (e.g., std140) base alignment for the member's type." + if (memberQualifier.hasAlign()) + memberAlignment = std::max(memberAlignment, memberQualifier.layoutAlign); + + // "If the resulting offset is not a multiple of the actual alignment, + // increase it to the first offset that is a multiple of + // the actual alignment." + RoundToPow2(offset, memberAlignment); + typeList[member].type->getQualifier().layoutOffset = offset; + offset += memberSize; + } +} + +// +// Spread LayoutMatrix to uniform block member, if a uniform block member is a struct, +// we need spread LayoutMatrix to this struct member too. and keep this rule for recursive. +// +void TParseContext::fixBlockUniformLayoutMatrix(TQualifier& qualifier, TTypeList* originTypeList, + TTypeList* tmpTypeList) +{ + assert(tmpTypeList == nullptr || originTypeList->size() == tmpTypeList->size()); + for (unsigned int member = 0; member < originTypeList->size(); ++member) { + if (qualifier.layoutPacking != ElpNone) { + if (tmpTypeList == nullptr) { + if (((*originTypeList)[member].type->isMatrix() || + (*originTypeList)[member].type->getBasicType() == EbtStruct) && + (*originTypeList)[member].type->getQualifier().layoutMatrix == ElmNone) { + (*originTypeList)[member].type->getQualifier().layoutMatrix = qualifier.layoutMatrix; + } + } else { + if (((*tmpTypeList)[member].type->isMatrix() || + (*tmpTypeList)[member].type->getBasicType() == EbtStruct) && + (*tmpTypeList)[member].type->getQualifier().layoutMatrix == ElmNone) { + (*tmpTypeList)[member].type->getQualifier().layoutMatrix = qualifier.layoutMatrix; + } + } + } + + if ((*originTypeList)[member].type->getBasicType() == EbtStruct) { + TQualifier* memberQualifier = nullptr; + // block member can be declare a matrix style, so it should be update to the member's style + if ((*originTypeList)[member].type->getQualifier().layoutMatrix == ElmNone) { + memberQualifier = &qualifier; + } else { + memberQualifier = &((*originTypeList)[member].type->getQualifier()); + } + + const TType* tmpType = tmpTypeList == nullptr ? + (*originTypeList)[member].type->clone() : (*tmpTypeList)[member].type; + + fixBlockUniformLayoutMatrix(*memberQualifier, (*originTypeList)[member].type->getWritableStruct(), + tmpType->getWritableStruct()); + + const TTypeList* structure = recordStructCopy(matrixFixRecord, (*originTypeList)[member].type, tmpType); + + if (tmpTypeList == nullptr) { + (*originTypeList)[member].type->setStruct(const_cast(structure)); + } + if (tmpTypeList != nullptr) { + (*tmpTypeList)[member].type->setStruct(const_cast(structure)); + } + } + } +} + +// +// Spread LayoutPacking to matrix or aggregate block members. If a block member is a struct or +// array of struct, spread LayoutPacking recursively to its matrix or aggregate members. +// +void TParseContext::fixBlockUniformLayoutPacking(TQualifier& qualifier, TTypeList* originTypeList, + TTypeList* tmpTypeList) +{ + assert(tmpTypeList == nullptr || originTypeList->size() == tmpTypeList->size()); + for (unsigned int member = 0; member < originTypeList->size(); ++member) { + if (qualifier.layoutPacking != ElpNone) { + if (tmpTypeList == nullptr) { + if ((*originTypeList)[member].type->getQualifier().layoutPacking == ElpNone && + !(*originTypeList)[member].type->isScalarOrVector()) { + (*originTypeList)[member].type->getQualifier().layoutPacking = qualifier.layoutPacking; + } + } else { + if ((*tmpTypeList)[member].type->getQualifier().layoutPacking == ElpNone && + !(*tmpTypeList)[member].type->isScalarOrVector()) { + (*tmpTypeList)[member].type->getQualifier().layoutPacking = qualifier.layoutPacking; + } + } + } + + if ((*originTypeList)[member].type->getBasicType() == EbtStruct) { + // Deep copy the type in pool. + // Because, struct use in different block may have different layout qualifier. + // We have to new a object to distinguish between them. + const TType* tmpType = tmpTypeList == nullptr ? + (*originTypeList)[member].type->clone() : (*tmpTypeList)[member].type; + + fixBlockUniformLayoutPacking(qualifier, (*originTypeList)[member].type->getWritableStruct(), + tmpType->getWritableStruct()); + + const TTypeList* structure = recordStructCopy(packingFixRecord, (*originTypeList)[member].type, tmpType); + + if (tmpTypeList == nullptr) { + (*originTypeList)[member].type->setStruct(const_cast(structure)); + } + if (tmpTypeList != nullptr) { + (*tmpTypeList)[member].type->setStruct(const_cast(structure)); + } + } + } +} + +// For an identifier that is already declared, add more qualification to it. +void TParseContext::addQualifierToExisting(const TSourceLoc& loc, TQualifier qualifier, const TString& identifier) +{ + TSymbol* symbol = symbolTable.find(identifier); + + // A forward declaration of a block reference looks to the grammar like adding + // a qualifier to an existing symbol. Detect this and create the block reference + // type with an empty type list, which will be filled in later in + // TParseContext::declareBlock. + if (!symbol && qualifier.hasBufferReference()) { + // The layout qualifiers are ignored in forward declaration, give warning for the most probable to be seen + if (qualifier.hasBufferReferenceAlign()) { + warn(loc, "the buffer_reference_align layout is ignored when defined in forward declaration", + identifier.c_str(), ""); + } + if (qualifier.hasPacking()) { + warn(loc, "the packing layout (scalar, std430, etc) is ignored when defined in forward declaration", + identifier.c_str(), ""); + } + TTypeList typeList; + TType blockType(&typeList, identifier, qualifier); + TType blockNameType(EbtReference, blockType, identifier); + TVariable* blockNameVar = new TVariable(&identifier, blockNameType, true); + if (! symbolTable.insert(*blockNameVar)) { + error(loc, "block name cannot redefine a non-block name", blockName->c_str(), ""); + } + return; + } + + if (! symbol) { + error(loc, "identifier not previously declared", identifier.c_str(), ""); + return; + } + if (symbol->getAsFunction()) { + error(loc, "cannot re-qualify a function name", identifier.c_str(), ""); + return; + } + + if (qualifier.isAuxiliary() || + qualifier.isMemory() || + qualifier.isInterpolation() || + qualifier.hasLayout() || + qualifier.storage != EvqTemporary || + qualifier.precision != EpqNone) { + error(loc, "cannot add storage, auxiliary, memory, interpolation, layout, or precision qualifier to an existing variable", identifier.c_str(), ""); + return; + } + + // For read-only built-ins, add a new symbol for holding the modified qualifier. + // This will bring up an entire block, if a block type has to be modified (e.g., gl_Position inside a block) + if (symbol->isReadOnly()) + symbol = symbolTable.copyUp(symbol); + + if (qualifier.invariant) { + if (intermediate.inIoAccessed(identifier)) + error(loc, "cannot change qualification after use", "invariant", ""); + symbol->getWritableType().getQualifier().invariant = true; + invariantCheck(loc, symbol->getType().getQualifier()); + } else if (qualifier.isNoContraction()) { + if (intermediate.inIoAccessed(identifier)) + error(loc, "cannot change qualification after use", "precise", ""); + symbol->getWritableType().getQualifier().setNoContraction(); + } else if (qualifier.specConstant) { + symbol->getWritableType().getQualifier().makeSpecConstant(); + if (qualifier.hasSpecConstantId()) + symbol->getWritableType().getQualifier().layoutSpecConstantId = qualifier.layoutSpecConstantId; + } else + warn(loc, "unknown requalification", "", ""); +} + +void TParseContext::addQualifierToExisting(const TSourceLoc& loc, TQualifier qualifier, TIdentifierList& identifiers) +{ + for (unsigned int i = 0; i < identifiers.size(); ++i) + addQualifierToExisting(loc, qualifier, *identifiers[i]); +} + +// Make sure 'invariant' isn't being applied to a non-allowed object. +void TParseContext::invariantCheck(const TSourceLoc& loc, const TQualifier& qualifier) +{ + if (! qualifier.invariant) + return; + + bool pipeOut = qualifier.isPipeOutput(); + bool pipeIn = qualifier.isPipeInput(); + if ((version >= 300 && isEsProfile()) || (!isEsProfile() && version >= 420)) { + if (! pipeOut) + error(loc, "can only apply to an output", "invariant", ""); + } else { + if ((language == EShLangVertex && pipeIn) || (! pipeOut && ! pipeIn)) + error(loc, "can only apply to an output, or to an input in a non-vertex stage\n", "invariant", ""); + } +} + +// +// Updating default qualifier for the case of a declaration with just a qualifier, +// no type, block, or identifier. +// +void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, const TPublicType& publicType) +{ + if (publicType.shaderQualifiers.vertices != TQualifier::layoutNotSet) { + assert(language == EShLangTessControl || language == EShLangGeometry || language == EShLangMesh); + const char* id = (language == EShLangTessControl) ? "vertices" : "max_vertices"; + + if (publicType.qualifier.storage != EvqVaryingOut) + error(loc, "can only apply to 'out'", id, ""); + if (! intermediate.setVertices(publicType.shaderQualifiers.vertices)) + error(loc, "cannot change previously set layout value", id, ""); + + if (language == EShLangTessControl) + checkIoArraysConsistency(loc); + } + if (publicType.shaderQualifiers.primitives != TQualifier::layoutNotSet) { + assert(language == EShLangMesh); + const char* id = "max_primitives"; + + if (publicType.qualifier.storage != EvqVaryingOut) + error(loc, "can only apply to 'out'", id, ""); + if (! intermediate.setPrimitives(publicType.shaderQualifiers.primitives)) + error(loc, "cannot change previously set layout value", id, ""); + } + if (publicType.shaderQualifiers.invocations != TQualifier::layoutNotSet) { + if (publicType.qualifier.storage != EvqVaryingIn) + error(loc, "can only apply to 'in'", "invocations", ""); + if (! intermediate.setInvocations(publicType.shaderQualifiers.invocations)) + error(loc, "cannot change previously set layout value", "invocations", ""); + } + if (publicType.shaderQualifiers.geometry != ElgNone) { + if (publicType.qualifier.storage == EvqVaryingIn) { + switch (publicType.shaderQualifiers.geometry) { + case ElgPoints: + case ElgLines: + case ElgLinesAdjacency: + case ElgTriangles: + case ElgTrianglesAdjacency: + case ElgQuads: + case ElgIsolines: + if (language == EShLangMesh) { + error(loc, "cannot apply to input", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), ""); + break; + } + if (intermediate.setInputPrimitive(publicType.shaderQualifiers.geometry)) { + if (language == EShLangGeometry) + checkIoArraysConsistency(loc); + } else + error(loc, "cannot change previously set input primitive", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), ""); + break; + default: + error(loc, "cannot apply to input", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), ""); + } + } else if (publicType.qualifier.storage == EvqVaryingOut) { + switch (publicType.shaderQualifiers.geometry) { + case ElgLines: + case ElgTriangles: + if (language != EShLangMesh) { + error(loc, "cannot apply to 'out'", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), ""); + break; + } + [[fallthrough]]; + case ElgPoints: + case ElgLineStrip: + case ElgTriangleStrip: + if (! intermediate.setOutputPrimitive(publicType.shaderQualifiers.geometry)) + error(loc, "cannot change previously set output primitive", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), ""); + break; + default: + error(loc, "cannot apply to 'out'", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), ""); + } + } else + error(loc, "cannot apply to:", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), GetStorageQualifierString(publicType.qualifier.storage)); + } + if (publicType.shaderQualifiers.spacing != EvsNone) { + if (publicType.qualifier.storage == EvqVaryingIn) { + if (! intermediate.setVertexSpacing(publicType.shaderQualifiers.spacing)) + error(loc, "cannot change previously set vertex spacing", TQualifier::getVertexSpacingString(publicType.shaderQualifiers.spacing), ""); + } else + error(loc, "can only apply to 'in'", TQualifier::getVertexSpacingString(publicType.shaderQualifiers.spacing), ""); + } + if (publicType.shaderQualifiers.order != EvoNone) { + if (publicType.qualifier.storage == EvqVaryingIn) { + if (! intermediate.setVertexOrder(publicType.shaderQualifiers.order)) + error(loc, "cannot change previously set vertex order", TQualifier::getVertexOrderString(publicType.shaderQualifiers.order), ""); + } else + error(loc, "can only apply to 'in'", TQualifier::getVertexOrderString(publicType.shaderQualifiers.order), ""); + } + if (publicType.shaderQualifiers.pointMode) { + if (publicType.qualifier.storage == EvqVaryingIn) + intermediate.setPointMode(); + else + error(loc, "can only apply to 'in'", "point_mode", ""); + } + + for (int i = 0; i < 3; ++i) { + if (publicType.shaderQualifiers.localSizeNotDefault[i]) { + if (publicType.qualifier.storage == EvqVaryingIn) { + if (! intermediate.setLocalSize(i, publicType.shaderQualifiers.localSize[i])) + error(loc, "cannot change previously set size", "local_size", ""); + else { + int max = 0; + if (language == EShLangCompute) { + switch (i) { + case 0: max = resources.maxComputeWorkGroupSizeX; break; + case 1: max = resources.maxComputeWorkGroupSizeY; break; + case 2: max = resources.maxComputeWorkGroupSizeZ; break; + default: break; + } + if (intermediate.getLocalSize(i) > (unsigned int)max) + error(loc, "too large; see gl_MaxComputeWorkGroupSize", "local_size", ""); + } else if (language == EShLangMesh) { + switch (i) { + case 0: + max = extensionTurnedOn(E_GL_EXT_mesh_shader) ? + resources.maxMeshWorkGroupSizeX_EXT : + resources.maxMeshWorkGroupSizeX_NV; + break; + case 1: + max = extensionTurnedOn(E_GL_EXT_mesh_shader) ? + resources.maxMeshWorkGroupSizeY_EXT : + resources.maxMeshWorkGroupSizeY_NV ; + break; + case 2: + max = extensionTurnedOn(E_GL_EXT_mesh_shader) ? + resources.maxMeshWorkGroupSizeZ_EXT : + resources.maxMeshWorkGroupSizeZ_NV ; + break; + default: break; + } + if (intermediate.getLocalSize(i) > (unsigned int)max) { + TString maxsErrtring = "too large, see "; + maxsErrtring.append(extensionTurnedOn(E_GL_EXT_mesh_shader) ? + "gl_MaxMeshWorkGroupSizeEXT" : "gl_MaxMeshWorkGroupSizeNV"); + error(loc, maxsErrtring.c_str(), "local_size", ""); + } + } else if (language == EShLangTask) { + switch (i) { + case 0: + max = extensionTurnedOn(E_GL_EXT_mesh_shader) ? + resources.maxTaskWorkGroupSizeX_EXT : + resources.maxTaskWorkGroupSizeX_NV; + break; + case 1: + max = extensionTurnedOn(E_GL_EXT_mesh_shader) ? + resources.maxTaskWorkGroupSizeY_EXT: + resources.maxTaskWorkGroupSizeY_NV; + break; + case 2: + max = extensionTurnedOn(E_GL_EXT_mesh_shader) ? + resources.maxTaskWorkGroupSizeZ_EXT: + resources.maxTaskWorkGroupSizeZ_NV; + break; + default: break; + } + if (intermediate.getLocalSize(i) > (unsigned int)max) { + TString maxsErrtring = "too large, see "; + maxsErrtring.append(extensionTurnedOn(E_GL_EXT_mesh_shader) ? + "gl_MaxTaskWorkGroupSizeEXT" : "gl_MaxTaskWorkGroupSizeNV"); + error(loc, maxsErrtring.c_str(), "local_size", ""); + } + } else { + assert(0); + } + + // Fix the existing constant gl_WorkGroupSize with this new information. + TVariable* workGroupSize = getEditableVariable("gl_WorkGroupSize"); + if (workGroupSize != nullptr) + workGroupSize->getWritableConstArray()[i].setUConst(intermediate.getLocalSize(i)); + } + } else + error(loc, "can only apply to 'in'", "local_size", ""); + } + if (publicType.shaderQualifiers.localSizeSpecId[i] != TQualifier::layoutNotSet) { + if (publicType.qualifier.storage == EvqVaryingIn) { + if (! intermediate.setLocalSizeSpecId(i, publicType.shaderQualifiers.localSizeSpecId[i])) + error(loc, "cannot change previously set size", "local_size", ""); + } else + error(loc, "can only apply to 'in'", "local_size id", ""); + // Set the workgroup built-in variable as a specialization constant + TVariable* workGroupSize = getEditableVariable("gl_WorkGroupSize"); + if (workGroupSize != nullptr) + workGroupSize->getWritableType().getQualifier().specConstant = true; + } + } + + if (publicType.shaderQualifiers.earlyFragmentTests) { + if (publicType.qualifier.storage == EvqVaryingIn) + intermediate.setEarlyFragmentTests(); + else + error(loc, "can only apply to 'in'", "early_fragment_tests", ""); + } + if (publicType.shaderQualifiers.earlyAndLateFragmentTestsAMD) { + if (publicType.qualifier.storage == EvqVaryingIn) + intermediate.setEarlyAndLateFragmentTestsAMD(); + else + error(loc, "can only apply to 'in'", "early_and_late_fragment_tests_amd", ""); + } + if (publicType.shaderQualifiers.postDepthCoverage) { + if (publicType.qualifier.storage == EvqVaryingIn) + intermediate.setPostDepthCoverage(); + else + error(loc, "can only apply to 'in'", "post_coverage_coverage", ""); + } + if (publicType.shaderQualifiers.nonCoherentColorAttachmentReadEXT) { + if (publicType.qualifier.storage == EvqVaryingIn) + intermediate.setNonCoherentColorAttachmentReadEXT(); + else + error(loc, "can only apply to 'in'", "non_coherent_color_attachment_readEXT", ""); + } + if (publicType.shaderQualifiers.nonCoherentDepthAttachmentReadEXT) { + if (publicType.qualifier.storage == EvqVaryingIn) + intermediate.setNonCoherentDepthAttachmentReadEXT(); + else + error(loc, "can only apply to 'in'", "non_coherent_depth_attachment_readEXT", ""); + } + if (publicType.shaderQualifiers.nonCoherentStencilAttachmentReadEXT) { + if (publicType.qualifier.storage == EvqVaryingIn) + intermediate.setNonCoherentStencilAttachmentReadEXT(); + else + error(loc, "can only apply to 'in'", "non_coherent_stencil_attachment_readEXT", ""); + } + if (publicType.shaderQualifiers.layoutNonCoherentTileAttachmentReadQCOM) { + if (publicType.qualifier.storage == EvqVaryingIn) + intermediate.setNonCoherentTileAttachmentReadQCOM(); + else + error(loc, "can only apply to 'in'", "non_coherent_attachment_readQCOM", ""); + } + if (publicType.shaderQualifiers.hasBlendEquation()) { + if (publicType.qualifier.storage != EvqVaryingOut) + error(loc, "can only apply to 'out'", "blend equation", ""); + } + if (publicType.shaderQualifiers.interlockOrdering) { + if (publicType.qualifier.storage == EvqVaryingIn) { + if (!intermediate.setInterlockOrdering(publicType.shaderQualifiers.interlockOrdering)) + error(loc, "cannot change previously set fragment shader interlock ordering", TQualifier::getInterlockOrderingString(publicType.shaderQualifiers.interlockOrdering), ""); + } + else + error(loc, "can only apply to 'in'", TQualifier::getInterlockOrderingString(publicType.shaderQualifiers.interlockOrdering), ""); + } + + if (publicType.shaderQualifiers.layoutDerivativeGroupQuads && + publicType.shaderQualifiers.layoutDerivativeGroupLinear) { + error(loc, "cannot be both specified", "derivative_group_quadsNV and derivative_group_linearNV", ""); + } + + if (publicType.shaderQualifiers.layoutDerivativeGroupQuads) { + if (publicType.qualifier.storage == EvqVaryingIn) { + if ((intermediate.getLocalSizeSpecId(0) == TQualifier::layoutNotSet && (intermediate.getLocalSize(0) & 1)) || + (intermediate.getLocalSizeSpecId(1) == TQualifier::layoutNotSet && (intermediate.getLocalSize(1) & 1))) + error(loc, "requires local_size_x and local_size_y to be multiple of two", "derivative_group_quadsNV", ""); + else + intermediate.setLayoutDerivativeMode(LayoutDerivativeGroupQuads); + } + else + error(loc, "can only apply to 'in'", "derivative_group_quadsNV", ""); + } + if (publicType.shaderQualifiers.layoutDerivativeGroupLinear) { + if (publicType.qualifier.storage == EvqVaryingIn) { + if (intermediate.getLocalSizeSpecId(0) == TQualifier::layoutNotSet && + intermediate.getLocalSizeSpecId(1) == TQualifier::layoutNotSet && + intermediate.getLocalSizeSpecId(2) == TQualifier::layoutNotSet && + (intermediate.getLocalSize(0) * + intermediate.getLocalSize(1) * + intermediate.getLocalSize(2)) % 4 != 0) + error(loc, "requires total group size to be multiple of four", "derivative_group_linearNV", ""); + else + intermediate.setLayoutDerivativeMode(LayoutDerivativeGroupLinear); + } + else + error(loc, "can only apply to 'in'", "derivative_group_linearNV", ""); + } + // Check mesh out array sizes, once all the necessary out qualifiers are defined. + if ((language == EShLangMesh) && + (intermediate.getVertices() != TQualifier::layoutNotSet) && + (intermediate.getPrimitives() != TQualifier::layoutNotSet) && + (intermediate.getOutputPrimitive() != ElgNone)) + { + checkIoArraysConsistency(loc); + } + + if (publicType.shaderQualifiers.layoutPrimitiveCulling) { + if (publicType.qualifier.storage != EvqTemporary) + error(loc, "layout qualifier cannot have storage qualifiers", "primitive_culling", "", ""); + else { + intermediate.setLayoutPrimitiveCulling(); + } + // Exit early as further checks are not valid + return; + } + + for (int i = 0; i < 3; ++i) { + if (publicType.shaderQualifiers.layoutTileShadingRateQCOMNotDefault[i]) { + if (publicType.qualifier.storage == EvqVaryingIn) { + if (! intermediate.setTileShadingRateQCOM(i, publicType.shaderQualifiers.layoutTileShadingRateQCOM[i])) + error(loc, "cannot change previously set size", (i==0?"shading_rate_xQCOM":(i==1?"shading_rate_yQCOM":"shading_rate_zQCOM")), ""); + } else + error(loc, "can only apply to 'in'", (i==0?"shading_rate_xQCOM":(i==1?"shading_rate_yQCOM":"shading_rate_zQCOM")), ""); + } + } + + const TQualifier& qualifier = publicType.qualifier; + + if (qualifier.isAuxiliary() || + qualifier.isMemory() || + qualifier.isInterpolation() || + qualifier.precision != EpqNone) + error(loc, "cannot use auxiliary, memory, interpolation, or precision qualifier in a default qualifier declaration (declaration with no type)", "qualifier", ""); + + // "The offset qualifier can only be used on block members of blocks..." + // "The align qualifier can only be used on blocks or block members..." + if (qualifier.hasOffset() || + qualifier.hasAlign()) + error(loc, "cannot use offset or align qualifiers in a default qualifier declaration (declaration with no type)", "layout qualifier", ""); + + layoutQualifierCheck(loc, qualifier); + + switch (qualifier.storage) { + case EvqUniform: + if (qualifier.hasMatrix()) + globalUniformDefaults.layoutMatrix = qualifier.layoutMatrix; + if (qualifier.hasPacking()) + globalUniformDefaults.layoutPacking = qualifier.layoutPacking; + break; + case EvqBuffer: + if (qualifier.hasMatrix()) + globalBufferDefaults.layoutMatrix = qualifier.layoutMatrix; + if (qualifier.hasPacking()) + globalBufferDefaults.layoutPacking = qualifier.layoutPacking; + break; + case EvqVaryingIn: + break; + case EvqVaryingOut: + if (qualifier.hasStream()) + globalOutputDefaults.layoutStream = qualifier.layoutStream; + if (qualifier.hasXfbBuffer()) + globalOutputDefaults.layoutXfbBuffer = qualifier.layoutXfbBuffer; + if (globalOutputDefaults.hasXfbBuffer() && qualifier.hasXfbStride()) { + if (! intermediate.setXfbBufferStride(globalOutputDefaults.layoutXfbBuffer, qualifier.layoutXfbStride)) + error(loc, "all stride settings must match for xfb buffer", "xfb_stride", "%d", qualifier.layoutXfbBuffer); + } + break; + case EvqShared: + if (qualifier.hasMatrix()) + globalSharedDefaults.layoutMatrix = qualifier.layoutMatrix; + if (qualifier.hasPacking()) + globalSharedDefaults.layoutPacking = qualifier.layoutPacking; + break; + default: + error(loc, "default qualifier requires 'uniform', 'buffer', 'in', 'out' or 'shared' storage qualification", "", ""); + return; + } + + if (qualifier.hasBinding()) + error(loc, "cannot declare a default, include a type or full declaration", "binding", ""); + if (qualifier.hasAnyLocation()) + error(loc, "cannot declare a default, use a full declaration", "location/component/index", ""); + if (qualifier.hasXfbOffset()) + error(loc, "cannot declare a default, use a full declaration", "xfb_offset", ""); + if (qualifier.isPushConstant()) + error(loc, "cannot declare a default, can only be used on a block", "push_constant", ""); + if (qualifier.hasBufferReference()) + error(loc, "cannot declare a default, can only be used on a block", "buffer_reference", ""); + if (qualifier.hasSpecConstantId()) + error(loc, "cannot declare a default, can only be used on a scalar", "constant_id", ""); + if (qualifier.isShaderRecord()) + error(loc, "cannot declare a default, can only be used on a block", "shaderRecordNV", ""); +} + +// +// Take the sequence of statements that has been built up since the last case/default, +// put it on the list of top-level nodes for the current (inner-most) switch statement, +// and follow that by the case/default we are on now. (See switch topology comment on +// TIntermSwitch.) +// +void TParseContext::wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode) +{ + TIntermSequence* switchSequence = switchSequenceStack.back(); + + if (statements) { + if (switchSequence->size() == 0) + error(statements->getLoc(), "cannot have statements before first case/default label", "switch", ""); + statements->setOperator(EOpSequence); + switchSequence->push_back(statements); + } + if (branchNode) { + // check all previous cases for the same label (or both are 'default') + for (unsigned int s = 0; s < switchSequence->size(); ++s) { + TIntermBranch* prevBranch = (*switchSequence)[s]->getAsBranchNode(); + if (prevBranch) { + TIntermTyped* prevExpression = prevBranch->getExpression(); + TIntermTyped* newExpression = branchNode->getAsBranchNode()->getExpression(); + if (prevExpression == nullptr && newExpression == nullptr) + error(branchNode->getLoc(), "duplicate label", "default", ""); + else if (prevExpression != nullptr && + newExpression != nullptr && + prevExpression->getAsConstantUnion() && + newExpression->getAsConstantUnion() && + prevExpression->getAsConstantUnion()->getConstArray()[0].getIConst() == + newExpression->getAsConstantUnion()->getConstArray()[0].getIConst()) + error(branchNode->getLoc(), "duplicated value", "case", ""); + } + } + switchSequence->push_back(branchNode); + } +} + +// +// Turn the top-level node sequence built up of wrapupSwitchSubsequence9) +// into a switch node. +// +TIntermNode* TParseContext::addSwitch(const TSourceLoc& loc, TIntermTyped* expression, TIntermAggregate* lastStatements) +{ + profileRequires(loc, EEsProfile, 300, nullptr, "switch statements"); + profileRequires(loc, ENoProfile, 130, nullptr, "switch statements"); + + wrapupSwitchSubsequence(lastStatements, nullptr); + + if (expression == nullptr || + (expression->getBasicType() != EbtInt && expression->getBasicType() != EbtUint) || + expression->getType().isArray() || expression->getType().isMatrix() || expression->getType().isVector()) + error(loc, "condition must be a scalar integer expression", "switch", ""); + + // If there is nothing to do, drop the switch but still execute the expression + TIntermSequence* switchSequence = switchSequenceStack.back(); + if (switchSequence->size() == 0) + return expression; + + if (lastStatements == nullptr) { + // This was originally an ERRROR, because early versions of the specification said + // "it is an error to have no statement between a label and the end of the switch statement." + // The specifications were updated to remove this (being ill-defined what a "statement" was), + // so, this became a warning. However, 3.0 tests still check for the error. + if (isEsProfile() && (version <= 300 || version >= 320) && ! relaxedErrors()) + error(loc, "last case/default label not followed by statements", "switch", ""); + else if (!isEsProfile() && (version <= 430 || version >= 460)) + error(loc, "last case/default label not followed by statements", "switch", ""); + else + warn(loc, "last case/default label not followed by statements", "switch", ""); + + + // emulate a break for error recovery + lastStatements = intermediate.makeAggregate(intermediate.addBranch(EOpBreak, loc)); + lastStatements->setOperator(EOpSequence); + switchSequence->push_back(lastStatements); + } + + TIntermAggregate* body = new TIntermAggregate(EOpSequence); + body->getSequence() = *switchSequenceStack.back(); + body->setLoc(loc); + + TIntermSwitch* switchNode = new TIntermSwitch(expression, body); + switchNode->setLoc(loc); + + return switchNode; +} + +// +// When a struct used in block, and has it's own layout packing, layout matrix, +// record the origin structure of a struct to map, and Record the structure copy to the copy table, +// +const TTypeList* TParseContext::recordStructCopy(TStructRecord& record, const TType* originType, const TType* tmpType) +{ + size_t memberCount = tmpType->getStruct()->size(); + size_t originHash = 0, tmpHash = 0; + std::hash hasher; + for (size_t i = 0; i < memberCount; i++) { + size_t originMemberHash = hasher(originType->getStruct()->at(i).type->getQualifier().layoutPacking + + originType->getStruct()->at(i).type->getQualifier().layoutMatrix); + size_t tmpMemberHash = hasher(tmpType->getStruct()->at(i).type->getQualifier().layoutPacking + + tmpType->getStruct()->at(i).type->getQualifier().layoutMatrix); + originHash = hasher((originHash ^ originMemberHash) << 1); + tmpHash = hasher((tmpHash ^ tmpMemberHash) << 1); + } + const TTypeList* originStruct = originType->getStruct(); + const TTypeList* tmpStruct = tmpType->getStruct(); + if (originHash != tmpHash) { + auto fixRecords = record.find(originStruct); + if (fixRecords != record.end()) { + auto fixRecord = fixRecords->second.find(tmpHash); + if (fixRecord != fixRecords->second.end()) { + return fixRecord->second; + } else { + record[originStruct][tmpHash] = tmpStruct; + return tmpStruct; + } + } else { + record[originStruct] = std::map(); + record[originStruct][tmpHash] = tmpStruct; + return tmpStruct; + } + } + return originStruct; +} + +TLayoutFormat TParseContext::mapLegacyLayoutFormat(TLayoutFormat legacyLayoutFormat, TBasicType imageType) +{ + TLayoutFormat layoutFormat = ElfNone; + if (imageType == EbtFloat) { + switch (legacyLayoutFormat) { + case ElfSize1x16: layoutFormat = ElfR16f; break; + case ElfSize1x32: layoutFormat = ElfR32f; break; + case ElfSize2x32: layoutFormat = ElfRg32f; break; + case ElfSize4x32: layoutFormat = ElfRgba32f; break; + default: break; + } + } else if (imageType == EbtUint) { + switch (legacyLayoutFormat) { + case ElfSize1x8: layoutFormat = ElfR8ui; break; + case ElfSize1x16: layoutFormat = ElfR16ui; break; + case ElfSize1x32: layoutFormat = ElfR32ui; break; + case ElfSize2x32: layoutFormat = ElfRg32ui; break; + case ElfSize4x32: layoutFormat = ElfRgba32ui; break; + default: break; + } + } else if (imageType == EbtInt) { + switch (legacyLayoutFormat) { + case ElfSize1x8: layoutFormat = ElfR8i; break; + case ElfSize1x16: layoutFormat = ElfR16i; break; + case ElfSize1x32: layoutFormat = ElfR32i; break; + case ElfSize2x32: layoutFormat = ElfRg32i; break; + case ElfSize4x32: layoutFormat = ElfRgba32i; break; + default: break; + } + } + + return layoutFormat; +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h new file mode 100644 index 0000000000..35fdff6462 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h @@ -0,0 +1,601 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// This header defines a two-level parse-helper hierarchy, derived from +// TParseVersions: +// - TParseContextBase: sharable across multiple parsers +// - TParseContext: GLSL specific helper +// + +#ifndef _PARSER_HELPER_INCLUDED_ +#define _PARSER_HELPER_INCLUDED_ + +#include +#include + +#include "parseVersions.h" +#include "../Include/ShHandle.h" +#include "SymbolTable.h" +#include "localintermediate.h" +#include "Scan.h" +#include "attribute.h" + +namespace QtShaderTools { +namespace glslang { + +struct TPragma { + TPragma(bool o, bool d) : optimize(o), debug(d) { } + bool optimize; + bool debug; + TPragmaTable pragmaTable; +}; + +class TScanContext; +class TPpContext; + +typedef std::set TIdSetType; +typedef std::map> TStructRecord; + +// +// Sharable code (as well as what's in TParseVersions) across +// parse helpers. +// +class TParseContextBase : public TParseVersions { +public: + TParseContextBase(TSymbolTable& symbolTable, TIntermediate& interm, bool parsingBuiltins, int version, + EProfile profile, const SpvVersion& spvVersion, EShLanguage language, + TInfoSink& infoSink, bool forwardCompatible, EShMessages messages, + const TString* entryPoint = nullptr) + : TParseVersions(interm, version, profile, spvVersion, language, infoSink, forwardCompatible, messages), + scopeMangler("::"), + symbolTable(symbolTable), + statementNestingLevel(0), loopNestingLevel(0), structNestingLevel(0), blockNestingLevel(0), controlFlowNestingLevel(0), + currentFunctionType(nullptr), + postEntryPointReturn(false), + contextPragma(true, false), + beginInvocationInterlockCount(0), endInvocationInterlockCount(0), + parsingBuiltins(parsingBuiltins), scanContext(nullptr), ppContext(nullptr), + limits(resources.limits), + globalUniformBlock(nullptr), + globalUniformBinding(TQualifier::layoutBindingEnd), + globalUniformSet(TQualifier::layoutSetEnd), + atomicCounterBlockSet(TQualifier::layoutSetEnd) + { + // use storage buffer on SPIR-V 1.3 and up + if (spvVersion.spv >= EShTargetSpv_1_3) + intermediate.setUseStorageBuffer(); + + if (entryPoint != nullptr) + sourceEntryPointName = *entryPoint; + } + virtual ~TParseContextBase() { } + + virtual void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...); + virtual void C_DECL warn(const TSourceLoc&, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...); + virtual void C_DECL ppError(const TSourceLoc&, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...); + virtual void C_DECL ppWarn(const TSourceLoc&, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...); + + virtual void setLimits(const TBuiltInResource&) = 0; + + void checkIndex(const TSourceLoc&, const TType&, int64_t& index); + + EShLanguage getLanguage() const { return language; } + void setScanContext(TScanContext* c) { scanContext = c; } + TScanContext* getScanContext() const { return scanContext; } + void setPpContext(TPpContext* c) { ppContext = c; } + TPpContext* getPpContext() const { return ppContext; } + + virtual void setLineCallback(const std::function& func) { lineCallback = func; } + virtual void setExtensionCallback(const std::function& func) { extensionCallback = func; } + virtual void setVersionCallback(const std::function& func) { versionCallback = func; } + virtual void setPragmaCallback(const std::function&)>& func) { pragmaCallback = func; } + virtual void setErrorCallback(const std::function& func) { errorCallback = func; } + + virtual void reservedPpErrorCheck(const TSourceLoc&, const char* name, const char* op) = 0; + virtual bool lineContinuationCheck(const TSourceLoc&, bool endOfComment) = 0; + virtual bool lineDirectiveShouldSetNextLine() const = 0; + virtual void handlePragma(const TSourceLoc&, const TVector&) = 0; + + virtual bool parseShaderStrings(TPpContext&, TInputScanner& input, bool versionWillBeError = false) = 0; + + virtual void notifyVersion(int line, int version, const char* type_string) + { + if (versionCallback) + versionCallback(line, version, type_string); + } + virtual void notifyErrorDirective(int line, const char* error_message) + { + if (errorCallback) + errorCallback(line, error_message); + } + virtual void notifyLineDirective(int curLineNo, int newLineNo, bool hasSource, int sourceNum, const char* sourceName) + { + if (lineCallback) + lineCallback(curLineNo, newLineNo, hasSource, sourceNum, sourceName); + } + virtual void notifyExtensionDirective(int line, const char* extension, const char* behavior) + { + if (extensionCallback) + extensionCallback(line, extension, behavior); + } + + // Manage the global uniform block (default uniforms in GLSL, $Global in HLSL) + virtual void growGlobalUniformBlock(const TSourceLoc&, TType&, const TString& memberName, TTypeList* typeList = nullptr); + + // Manage global buffer (used for backing atomic counters in GLSL when using relaxed Vulkan semantics) + virtual void growAtomicCounterBlock(int binding, const TSourceLoc&, TType&, const TString& memberName, TTypeList* typeList = nullptr); + + // Potentially rename shader entry point function + void renameShaderFunction(TString*& name) const + { + // Replace the entry point name given in the shader with the real entry point name, + // if there is a substitution. + if (name != nullptr && *name == sourceEntryPointName && intermediate.getEntryPointName().size() > 0) + name = NewPoolTString(intermediate.getEntryPointName().c_str()); + } + + virtual bool lValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*); + virtual void rValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*); + + const char* const scopeMangler; + + // Basic parsing state, easily accessible to the grammar + + TSymbolTable& symbolTable; // symbol table that goes with the current language, version, and profile + TVector relaxedSymbols; + int statementNestingLevel; // 0 if outside all flow control or compound statements + int loopNestingLevel; // 0 if outside all loops + int structNestingLevel; // 0 if outside structures + int blockNestingLevel; // 0 if outside blocks + int controlFlowNestingLevel; // 0 if outside all flow control + const TType* currentFunctionType; // the return type of the function that's currently being parsed + bool functionReturnsValue; // true if a non-void function has a return + // if inside a function, true if the function is the entry point and this is after a return statement + bool postEntryPointReturn; + // case, node, case, case, node, ...; ensure only one node between cases; stack of them for nesting + TList switchSequenceStack; + // the statementNestingLevel the current switch statement is at, which must match the level of its case statements + TList switchLevel; + struct TPragma contextPragma; + int beginInvocationInterlockCount; + int endInvocationInterlockCount; + bool compileOnly = false; + +protected: + TParseContextBase(TParseContextBase&); + TParseContextBase& operator=(TParseContextBase&); + + const bool parsingBuiltins; // true if parsing built-in symbols/functions + TVector linkageSymbols; // will be transferred to 'linkage', after all editing is done, order preserving + TScanContext* scanContext; + TPpContext* ppContext; + TBuiltInResource resources; + TLimits& limits; + TString sourceEntryPointName; + + // These, if set, will be called when a line, pragma ... is preprocessed. + // They will be called with any parameters to the original directive. + std::function lineCallback; + std::function&)> pragmaCallback; + std::function versionCallback; + std::function extensionCallback; + std::function errorCallback; + + // see implementation for detail + const TFunction* selectFunction(const TVector, const TFunction&, + std::function, + std::function, + /* output */ bool& tie); + + virtual void parseSwizzleSelector(const TSourceLoc&, const TString&, int size, + TSwizzleSelectors&); + + // Manage the global uniform block (default uniforms in GLSL, $Global in HLSL) + TVariable* globalUniformBlock; // the actual block, inserted into the symbol table + unsigned int globalUniformBinding; // the block's binding number + unsigned int globalUniformSet; // the block's set number + int firstNewMember; // the index of the first member not yet inserted into the symbol table + // override this to set the language-specific name + virtual const char* getGlobalUniformBlockName() const { return ""; } + virtual void setUniformBlockDefaults(TType&) const { } + virtual void finalizeGlobalUniformBlockLayout(TVariable&) {} + + // Manage the atomic counter block (used for atomic_uints with Vulkan-Relaxed) + TMap atomicCounterBuffers; + unsigned int atomicCounterBlockSet; + TMap atomicCounterBlockFirstNewMember; + // override this to set the language-specific name + virtual const char* getAtomicCounterBlockName() const { return ""; } + virtual void setAtomicCounterBlockDefaults(TType&) const {} + virtual void setInvariant(const TSourceLoc&, const char*) {} + virtual void finalizeAtomicCounterBlockLayout(TVariable&) {} + bool isAtomicCounterBlock(const TSymbol& symbol) { + const TVariable* var = symbol.getAsVariable(); + if (!var) + return false; + const auto& at = atomicCounterBuffers.find(var->getType().getQualifier().layoutBinding); + return (at != atomicCounterBuffers.end() && (*at).second->getType() == var->getType()); + } + + virtual void outputMessage(const TSourceLoc&, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, TPrefixType prefix, + va_list args); + virtual void trackLinkage(TSymbol& symbol); + virtual void makeEditable(TSymbol*&); + virtual TVariable* getEditableVariable(const char* name); + virtual void finish(); +}; + +// +// Manage the state for when to respect precision qualifiers and when to warn about +// the defaults being different than might be expected. +// +class TPrecisionManager { +public: + TPrecisionManager() : obey(false), warn(false), explicitIntDefault(false), explicitFloatDefault(false){ } + virtual ~TPrecisionManager() {} + + void respectPrecisionQualifiers() { obey = true; } + bool respectingPrecisionQualifiers() const { return obey; } + bool shouldWarnAboutDefaults() const { return warn; } + void defaultWarningGiven() { warn = false; } + void warnAboutDefaults() { warn = true; } + void explicitIntDefaultSeen() + { + explicitIntDefault = true; + if (explicitFloatDefault) + warn = false; + } + void explicitFloatDefaultSeen() + { + explicitFloatDefault = true; + if (explicitIntDefault) + warn = false; + } + +protected: + bool obey; // respect precision qualifiers + bool warn; // need to give a warning about the defaults + bool explicitIntDefault; // user set the default for int/uint + bool explicitFloatDefault; // user set the default for float +}; + +// +// GLSL-specific parse helper. Should have GLSL in the name, but that's +// too big of a change for comparing branches at the moment, and perhaps +// impacts downstream consumers as well. +// +class TParseContext : public TParseContextBase { +public: + TParseContext(TSymbolTable&, TIntermediate&, bool parsingBuiltins, int version, EProfile, const SpvVersion& spvVersion, EShLanguage, TInfoSink&, + bool forwardCompatible = false, EShMessages messages = EShMsgDefault, + const TString* entryPoint = nullptr); + virtual ~TParseContext(); + + bool obeyPrecisionQualifiers() const { return precisionManager.respectingPrecisionQualifiers(); } + void setPrecisionDefaults(); + + void setLimits(const TBuiltInResource&) override; + bool parseShaderStrings(TPpContext&, TInputScanner& input, bool versionWillBeError = false) override; + void parserError(const char* s); // for bison's yyerror + + virtual void growGlobalUniformBlock(const TSourceLoc&, TType&, const TString& memberName, TTypeList* typeList = nullptr) override; + virtual void growAtomicCounterBlock(int binding, const TSourceLoc&, TType&, const TString& memberName, TTypeList* typeList = nullptr) override; + + void reservedErrorCheck(const TSourceLoc&, const TString&); + void reservedPpErrorCheck(const TSourceLoc&, const char* name, const char* op) override; + bool lineContinuationCheck(const TSourceLoc&, bool endOfComment) override; + bool lineDirectiveShouldSetNextLine() const override; + bool builtInName(const TString&); + + void handlePragma(const TSourceLoc&, const TVector&) override; + TIntermTyped* handleVariable(const TSourceLoc&, TSymbol* symbol, const TString* string); + TIntermTyped* handleBracketDereference(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index); + void handleIndexLimits(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index); + + void makeEditable(TSymbol*&) override; + void ioArrayCheck(const TSourceLoc&, const TType&, const TString& identifier); + bool isIoResizeArray(const TType&) const; + void fixIoArraySize(const TSourceLoc&, TType&); + void handleIoResizeArrayAccess(const TSourceLoc&, TIntermTyped* base); + void checkIoArraysConsistency(const TSourceLoc&, bool tailOnly = false); + int getIoArrayImplicitSize(const TQualifier&, TString* featureString = nullptr) const; + void checkIoArrayConsistency(const TSourceLoc&, int requiredSize, const char* feature, TType&, const TString&); + + TIntermTyped* handleBinaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* left, TIntermTyped* right); + TIntermTyped* handleUnaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* childNode); + TIntermTyped* handleDotDereference(const TSourceLoc&, TIntermTyped* base, const TString& field); + TIntermTyped* handleDotSwizzle(const TSourceLoc&, TIntermTyped* base, const TString& field); + void blockMemberExtensionCheck(const TSourceLoc&, const TIntermTyped* base, int member, const TString& memberName); + TFunction* handleFunctionDeclarator(const TSourceLoc&, TFunction& function, bool prototype); + TIntermAggregate* handleFunctionDefinition(const TSourceLoc&, TFunction&); + TIntermTyped* handleFunctionCall(const TSourceLoc&, TFunction*, TIntermNode*); + TIntermTyped* handleBuiltInFunctionCall(TSourceLoc, TIntermNode* arguments, const TFunction& function); + void computeBuiltinPrecisions(TIntermTyped&, const TFunction&); + TIntermNode* handleReturnValue(const TSourceLoc&, TIntermTyped*); + void checkLocation(const TSourceLoc&, TOperator); + TIntermTyped* handleLengthMethod(const TSourceLoc&, TFunction*, TIntermNode*); + void addInputArgumentConversions(const TFunction&, TIntermNode*&) const; + TIntermTyped* addOutputArgumentConversions(const TFunction&, TIntermAggregate&) const; + TIntermTyped* addAssign(const TSourceLoc&, TOperator op, TIntermTyped* left, TIntermTyped* right); + void builtInOpCheck(const TSourceLoc&, const TFunction&, TIntermOperator&); + void nonOpBuiltInCheck(const TSourceLoc&, const TFunction&, TIntermAggregate&); + void userFunctionCallCheck(const TSourceLoc&, TIntermAggregate&); + void samplerConstructorLocationCheck(const TSourceLoc&, const char* token, TIntermNode*); + TFunction* handleConstructorCall(const TSourceLoc&, const TPublicType&); + void handlePrecisionQualifier(const TSourceLoc&, TQualifier&, TPrecisionQualifier); + void checkPrecisionQualifier(const TSourceLoc&, TPrecisionQualifier); + void memorySemanticsCheck(const TSourceLoc&, const TFunction&, const TIntermOperator& callNode); + + TIntermTyped* vkRelaxedRemapFunctionCall(const TSourceLoc&, TFunction*, TIntermNode*); + // returns true if the variable was remapped to something else + bool vkRelaxedRemapUniformVariable(const TSourceLoc&, TString&, const TPublicType&, TArraySizes*, TIntermTyped*, TType&); + void vkRelaxedRemapUniformMembers(const TSourceLoc&, const TPublicType&, const TType&, const TString&); + void vkRelaxedRemapFunctionParameter(TFunction*, TParameter&, std::vector* newParams = nullptr); + TIntermNode* vkRelaxedRemapFunctionArgument(const TSourceLoc&, TFunction*, TIntermTyped*); + TIntermTyped* vkRelaxedRemapDotDereference(const TSourceLoc&, TIntermTyped&, const TType&, const TString&); + + void assignError(const TSourceLoc&, const char* op, TString left, TString right); + void unaryOpError(const TSourceLoc&, const char* op, TString operand); + void binaryOpError(const TSourceLoc&, const char* op, TString left, TString right); + void variableCheck(TIntermTyped*& nodePtr); + bool lValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*) override; + void rValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*) override; + void constantValueCheck(TIntermTyped* node, const char* token); + void integerCheck(const TIntermTyped* node, const char* token); + void arrayIndexCheck(const TIntermTyped* node, const char* token); + void globalCheck(const TSourceLoc&, const char* token); + bool constructorError(const TSourceLoc&, TIntermNode*, TFunction&, TOperator, TType&); + bool constructorTextureSamplerError(const TSourceLoc&, const TFunction&); + void arraySizeCheck(const TSourceLoc&, TIntermTyped* expr, TArraySize&, const char *sizeType, const bool isTypeParameter = false); + bool arrayQualifierError(const TSourceLoc&, const TQualifier&); + bool arrayError(const TSourceLoc&, const TType&); + void arraySizeRequiredCheck(const TSourceLoc&, const TArraySizes&); + void structArrayCheck(const TSourceLoc&, const TType& structure); + void arraySizesCheck(const TSourceLoc&, const TQualifier&, TArraySizes*, const TIntermTyped* initializer, bool lastMember); + void arrayOfArrayVersionCheck(const TSourceLoc&, const TArraySizes*); + bool voidErrorCheck(const TSourceLoc&, const TString&, TBasicType); + void boolCheck(const TSourceLoc&, const TIntermTyped*); + void boolCheck(const TSourceLoc&, const TPublicType&); + void samplerCheck(const TSourceLoc&, const TType&, const TString& identifier, TIntermTyped* initializer); + void atomicUintCheck(const TSourceLoc&, const TType&, const TString& identifier); + void accStructCheck(const TSourceLoc & loc, const TType & type, const TString & identifier); + void hitObjectEXTCheck(const TSourceLoc& loc, const TType& type, const TString& identifier); + void hitObjectNVCheck(const TSourceLoc & loc, const TType & type, const TString & identifier); + void transparentOpaqueCheck(const TSourceLoc&, const TType&, const TString& identifier); + void memberQualifierCheck(glslang::TPublicType&); + void globalQualifierFixCheck(const TSourceLoc&, TQualifier&, bool isMemberCheck = false, const TPublicType* publicType = nullptr); + void globalQualifierTypeCheck(const TSourceLoc&, const TQualifier&, const TPublicType&); + bool structQualifierErrorCheck(const TSourceLoc&, const TPublicType& pType); + void mergeQualifiers(const TSourceLoc&, TQualifier& dst, const TQualifier& src, bool force); + void setDefaultPrecision(const TSourceLoc&, TPublicType&, TPrecisionQualifier); + int computeSamplerTypeIndex(TSampler&); + TPrecisionQualifier getDefaultPrecision(TPublicType&); + void precisionQualifierCheck(const TSourceLoc&, TBasicType, TQualifier&, bool hasTypeParameter); + void parameterTypeCheck(const TSourceLoc&, TStorageQualifier qualifier, const TType& type); + bool containsFieldWithBasicType(const TType& type ,TBasicType basicType); + TSymbol* redeclareBuiltinVariable(const TSourceLoc&, const TString&, const TQualifier&, const TShaderQualifiers&); + void redeclareBuiltinBlock(const TSourceLoc&, TTypeList& typeList, const TString& blockName, const TString* instanceName, TArraySizes* arraySizes); + void paramCheckFixStorage(const TSourceLoc&, const TStorageQualifier&, TType& type); + void paramCheckFix(const TSourceLoc&, const TQualifier&, TType& type); + void nestedBlockCheck(const TSourceLoc&); + void nestedStructCheck(const TSourceLoc&); + void arrayObjectCheck(const TSourceLoc&, const TType&, const char* op); + void opaqueCheck(const TSourceLoc&, const TType&, const char* op); + void referenceCheck(const TSourceLoc&, const TType&, const char* op); + void storage16BitAssignmentCheck(const TSourceLoc&, const TType&, const char* op); + void specializationCheck(const TSourceLoc&, const TType&, const char* op); + void structTypeCheck(const TSourceLoc&, TPublicType&); + void inductiveLoopCheck(const TSourceLoc&, TIntermNode* init, TIntermLoop* loop); + void arrayLimitCheck(const TSourceLoc&, const TString&, int size); + void limitCheck(const TSourceLoc&, int value, const char* limit, const char* feature); + void typeParametersCheck(const TSourceLoc&, const TPublicType&); + + void inductiveLoopBodyCheck(TIntermNode*, long long loopIndexId, TSymbolTable&); + void constantIndexExpressionCheck(TIntermNode*); + + void setLayoutQualifier(const TSourceLoc&, TPublicType&, TString&); + void setLayoutQualifier(const TSourceLoc&, TPublicType&, TString&, const TIntermTyped*); + void mergeObjectLayoutQualifiers(TQualifier& dest, const TQualifier& src, bool inheritOnly); + void layoutObjectCheck(const TSourceLoc&, const TSymbol&); + void layoutMemberLocationArrayCheck(const TSourceLoc&, bool memberWithLocation, TArraySizes* arraySizes); + void layoutTypeCheck(const TSourceLoc&, const TType&); + void layoutQualifierCheck(const TSourceLoc&, const TQualifier&); + void checkNoShaderLayouts(const TSourceLoc&, const TShaderQualifiers&); + void fixOffset(const TSourceLoc&, TSymbol&); + + const TFunction* findFunction(const TSourceLoc& loc, const TFunction& call, bool& builtIn); + const TFunction* findFunctionExact(const TSourceLoc& loc, const TFunction& call, bool& builtIn); + const TFunction* findFunction120(const TSourceLoc& loc, const TFunction& call, bool& builtIn); + const TFunction* findFunction400(const TSourceLoc& loc, const TFunction& call, bool& builtIn); + const TFunction* findFunctionExplicitTypes(const TSourceLoc& loc, const TFunction& call, bool& builtIn); + void declareTypeDefaults(const TSourceLoc&, const TPublicType&); + TIntermNode* declareVariable(const TSourceLoc&, TString& identifier, const TPublicType&, TArraySizes* typeArray = nullptr, TIntermTyped* initializer = nullptr); + TIntermTyped* addConstructor(const TSourceLoc&, TIntermNode*, const TType&); + TIntermTyped* constructAggregate(TIntermNode*, const TType&, int, const TSourceLoc&); + TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset); + void makeVariadic(TFunction *F, const TSourceLoc &loc); + TParameter getParamWithDefault(const TPublicType& ty, TString* identifier, TIntermTyped* initializer, + const TSourceLoc& loc); + void inheritMemoryQualifiers(const TQualifier& from, TQualifier& to); + TIntermNode* declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = nullptr, TArraySizes* arraySizes = nullptr); + void blockStorageRemap(const TSourceLoc&, const TString*, TQualifier&); + void blockStageIoCheck(const TSourceLoc&, const TQualifier&); + void blockQualifierCheck(const TSourceLoc&, const TQualifier&, bool instanceName); + void fixBlockLocations(const TSourceLoc&, TQualifier&, TTypeList&, bool memberWithLocation, bool memberWithoutLocation); + void fixXfbOffsets(TQualifier&, TTypeList&); + void fixBlockUniformOffsets(TQualifier&, TTypeList&); + void fixBlockUniformLayoutMatrix(TQualifier&, TTypeList*, TTypeList*); + void fixBlockUniformLayoutPacking(TQualifier&, TTypeList*, TTypeList*); + void addQualifierToExisting(const TSourceLoc&, TQualifier, const TString& identifier); + void addQualifierToExisting(const TSourceLoc&, TQualifier, TIdentifierList&); + void invariantCheck(const TSourceLoc&, const TQualifier&); + void updateStandaloneQualifierDefaults(const TSourceLoc&, const TPublicType&); + void updateBindlessQualifier(TType& memberType); + void wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode); + TIntermNode* addSwitch(const TSourceLoc&, TIntermTyped* expression, TIntermAggregate* body); + const TTypeList* recordStructCopy(TStructRecord&, const TType*, const TType*); + TLayoutFormat mapLegacyLayoutFormat(TLayoutFormat legacyLayoutFormat, TBasicType imageType); + + TAttributeType attributeFromName(const TString& name) const; + TAttributes* makeAttributes(const TString& identifier) const; + TAttributes* makeAttributes(const TString& identifier, TIntermNode* node) const; + TAttributes* mergeAttributes(TAttributes*, TAttributes*) const; + + // Determine selection control from attributes + void handleSelectionAttributes(const TAttributes& attributes, TIntermNode*); + void handleSwitchAttributes(const TAttributes& attributes, TIntermNode*); + // Determine loop control from attributes + void handleLoopAttributes(const TAttributes& attributes, TIntermNode*); + // Function attributes + void handleFunctionAttributes(const TSourceLoc&, const TAttributes&); + + // GL_EXT_spirv_intrinsics + TSpirvRequirement* makeSpirvRequirement(const TSourceLoc& loc, const TString& name, + const TIntermAggregate* extensions, const TIntermAggregate* capabilities); + TSpirvRequirement* mergeSpirvRequirements(const TSourceLoc& loc, TSpirvRequirement* spirvReq1, + TSpirvRequirement* spirvReq2); + TSpirvTypeParameters* makeSpirvTypeParameters(const TSourceLoc& loc, const TIntermConstantUnion* constant); + TSpirvTypeParameters* makeSpirvTypeParameters(const TSourceLoc& loc, const TPublicType& type); + TSpirvTypeParameters* mergeSpirvTypeParameters(TSpirvTypeParameters* spirvTypeParams1, + TSpirvTypeParameters* spirvTypeParams2); + TSpirvInstruction* makeSpirvInstruction(const TSourceLoc& loc, const TString& name, const TString& value); + TSpirvInstruction* makeSpirvInstruction(const TSourceLoc& loc, const TString& name, int value); + TSpirvInstruction* mergeSpirvInstruction(const TSourceLoc& loc, TSpirvInstruction* spirvInst1, + TSpirvInstruction* spirvInst2); + void checkAndResizeMeshViewDim(const TSourceLoc&, TType&, bool isBlockMember); + +protected: + void nonInitConstCheck(const TSourceLoc&, TString& identifier, TType& type); + void inheritGlobalDefaults(TQualifier& dst) const; + TVariable* makeInternalVariable(const char* name, const TType&) const; + TVariable* declareNonArray(const TSourceLoc&, const TString& identifier, const TType&); + void declareArray(const TSourceLoc&, const TString& identifier, const TType&, TSymbol*&); + void checkRuntimeSizable(const TSourceLoc&, const TIntermTyped&); + bool isRuntimeLength(const TIntermTyped&) const; + TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable); + TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer); + void finish() override; + void handleCoopMat2FunctionCall(const TSourceLoc& loc, const TFunction* fnCandidate, TIntermTyped* result, TIntermNode* arguments); + void handleVector2CoopMatConversionCall(const TSourceLoc& loc, const TFunction* fnCandidate, TIntermTyped* &result, TIntermNode* arguments); + + virtual const char* getGlobalUniformBlockName() const override; + virtual void finalizeGlobalUniformBlockLayout(TVariable&) override; + virtual void setUniformBlockDefaults(TType& block) const override; + + virtual const char* getAtomicCounterBlockName() const override; + virtual void finalizeAtomicCounterBlockLayout(TVariable&) override; + virtual void setAtomicCounterBlockDefaults(TType& block) const override; + virtual void setInvariant(const TSourceLoc& loc, const char* builtin) override; + +public: + // + // Generally, bison productions, the scanner, and the PP need read/write access to these; just give them direct access + // + + // Current state of parsing + bool inMain; // if inside a function, true if the function is main + const TString* blockName; + TQualifier currentBlockQualifier; + TPrecisionQualifier defaultPrecision[EbtNumTypes]; + TBuiltInResource resources; + TLimits& limits; + +protected: + TParseContext(TParseContext&); + TParseContext& operator=(TParseContext&); + + static const int maxSamplerIndex = EsdNumDims * (EbtNumTypes * (2 * 2 * 2 * 2 * 2)); // see computeSamplerTypeIndex() + TPrecisionQualifier defaultSamplerPrecision[maxSamplerIndex]; + TPrecisionManager precisionManager; + TQualifier globalBufferDefaults; + TQualifier globalUniformDefaults; + TQualifier globalInputDefaults; + TQualifier globalOutputDefaults; + TQualifier globalSharedDefaults; + TString currentCaller; // name of last function body entered (not valid when at global scope) + int* atomicUintOffsets; // to become an array of the right size to hold an offset per binding point + bool anyIndexLimits; + TIdSetType inductiveLoopIds; + TVector needsIndexLimitationChecking; + TStructRecord matrixFixRecord; + TStructRecord packingFixRecord; + + // + // Geometry shader input arrays: + // - array sizing is based on input primitive and/or explicit size + // + // Tessellation control output arrays: + // - array sizing is based on output layout(vertices=...) and/or explicit size + // + // Both: + // - array sizing is retroactive + // - built-in block redeclarations interact with this + // + // Design: + // - use a per-context "resize-list", a list of symbols whose array sizes + // can be fixed + // + // - the resize-list starts empty at beginning of user-shader compilation, it does + // not have built-ins in it + // + // - on built-in array use: copyUp() symbol and add it to the resize-list + // + // - on user array declaration: add it to the resize-list + // + // - on block redeclaration: copyUp() symbol and add it to the resize-list + // * note, that appropriately gives an error if redeclaring a block that + // was already used and hence already copied-up + // + // - on seeing a layout declaration that sizes the array, fix everything in the + // resize-list, giving errors for mismatch + // + // - on seeing an array size declaration, give errors on mismatch between it and previous + // array-sizing declarations + // + TVector ioArraySymbolResizeList; +}; + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // _PARSER_HELPER_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp new file mode 100644 index 0000000000..70aac51764 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp @@ -0,0 +1,308 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "../Include/Common.h" +#include "../Include/PoolAlloc.h" + +// Mostly here for target that do not support threads such as WASI. +#ifdef DISABLE_THREAD_SUPPORT +#define THREAD_LOCAL +#else +#define THREAD_LOCAL thread_local +#endif + +namespace QtShaderTools { +namespace glslang { + +namespace { +THREAD_LOCAL TPoolAllocator* threadPoolAllocator = nullptr; + +TPoolAllocator* GetDefaultThreadPoolAllocator() +{ + THREAD_LOCAL TPoolAllocator defaultAllocator; + return &defaultAllocator; +} +} // anonymous namespace + +// Return the thread-specific current pool. +TPoolAllocator& GetThreadPoolAllocator() +{ + return *(threadPoolAllocator ? threadPoolAllocator : GetDefaultThreadPoolAllocator()); +} + +// Set the thread-specific current pool. +void SetThreadPoolAllocator(TPoolAllocator* poolAllocator) +{ + threadPoolAllocator = poolAllocator; +} + +// +// Implement the functionality of the TPoolAllocator class, which +// is documented in PoolAlloc.h. +// +TPoolAllocator::TPoolAllocator(int growthIncrement, int allocationAlignment) : + pageSize(growthIncrement), + alignment(allocationAlignment), + freeList(nullptr), + inUseList(nullptr), + numCalls(0) +{ + // + // Don't allow page sizes we know are smaller than all common + // OS page sizes. + // + if (pageSize < 4*1024) + pageSize = 4*1024; + + // + // A large currentPageOffset indicates a new page needs to + // be obtained to allocate memory. + // + currentPageOffset = pageSize; + + // + // Adjust alignment to be at least pointer aligned and + // power of 2. + // + size_t minAlign = sizeof(void*); + alignment &= ~(minAlign - 1); + if (alignment < minAlign) + alignment = minAlign; + size_t a = 1; + while (a < alignment) + a <<= 1; + alignment = a; + alignmentMask = a - 1; + + // + // Align header skip + // + headerSkip = minAlign; + if (headerSkip < sizeof(tHeader)) { + headerSkip = (sizeof(tHeader) + alignmentMask) & ~alignmentMask; + } + + push(); +} + +TPoolAllocator::~TPoolAllocator() +{ + while (inUseList) { + tHeader* next = inUseList->nextPage; + inUseList->~tHeader(); + delete [] reinterpret_cast(inUseList); + inUseList = next; + } + + // + // Always delete the free list memory - it can't be being + // (correctly) referenced, whether the pool allocator was + // global or not. We should not check the guard blocks + // here, because we did it already when the block was + // placed into the free list. + // + while (freeList) { + tHeader* next = freeList->nextPage; + delete [] reinterpret_cast(freeList); + freeList = next; + } +} + +// +// Check a single guard block for damage +// +#ifdef GUARD_BLOCKS +void TAllocation::checkGuardBlock(unsigned char* blockMem, unsigned char val, const char* locText) const +#else +void TAllocation::checkGuardBlock(unsigned char*, unsigned char, const char*) const +#endif +{ +#ifdef GUARD_BLOCKS + for (size_t x = 0; x < guardBlockSize; x++) { + if (blockMem[x] != val) { + const int maxSize = 80; + char assertMsg[maxSize]; + + // We don't print the assert message. It's here just to be helpful. + snprintf(assertMsg, maxSize, "PoolAlloc: Damage %s %zu byte allocation at 0x%p\n", + locText, size, data()); + assert(0 && "PoolAlloc: Damage in guard block"); + } + } +#else + assert(guardBlockSize == 0); +#endif +} + +void TPoolAllocator::push() +{ + tAllocState state = { currentPageOffset, inUseList }; + + stack.push_back(state); + + // + // Indicate there is no current page to allocate from. + // + currentPageOffset = pageSize; +} + +// +// Do a mass-deallocation of all the individual allocations +// that have occurred since the last push(), or since the +// last pop(), or since the object's creation. +// +// The deallocated pages are saved for future allocations. +// +void TPoolAllocator::pop() +{ + if (stack.size() < 1) + return; + + tHeader* page = stack.back().page; + currentPageOffset = stack.back().offset; + + while (inUseList != page) { + tHeader* nextInUse = inUseList->nextPage; + size_t pageCount = inUseList->pageCount; + + // This technically ends the lifetime of the header as C++ object, + // but we will still control the memory and reuse it. + inUseList->~tHeader(); // currently, just a debug allocation checker + + if (pageCount > 1) { + delete [] reinterpret_cast(inUseList); + } else { + inUseList->nextPage = freeList; + freeList = inUseList; + } + inUseList = nextInUse; + } + + stack.pop_back(); +} + +// +// Do a mass-deallocation of all the individual allocations +// that have occurred. +// +void TPoolAllocator::popAll() +{ + while (stack.size() > 0) + pop(); +} + +void* TPoolAllocator::allocate(size_t numBytes) +{ + // If we are using guard blocks, all allocations are bracketed by + // them: [guardblock][allocation][guardblock]. numBytes is how + // much memory the caller asked for. allocationSize is the total + // size including guard blocks. In release build, + // guardBlockSize=0 and this all gets optimized away. + size_t allocationSize = TAllocation::allocationSize(numBytes); + + // + // Just keep some interesting statistics. + // + ++numCalls; + totalBytes += numBytes; + + // + // Do the allocation, most likely case first, for efficiency. + // This step could be moved to be inline sometime. + // + if (currentPageOffset + allocationSize <= pageSize) { + // + // Safe to allocate from currentPageOffset. + // + unsigned char* memory = reinterpret_cast(inUseList) + currentPageOffset; + currentPageOffset += allocationSize; + currentPageOffset = (currentPageOffset + alignmentMask) & ~alignmentMask; + + return initializeAllocation(inUseList, memory, numBytes); + } + + if (allocationSize + headerSkip > pageSize) { + // + // Do a multi-page allocation. Don't mix these with the others. + // The OS is efficient and allocating and free-ing multiple pages. + // + size_t numBytesToAlloc = allocationSize + headerSkip; + tHeader* memory = reinterpret_cast(::new char[numBytesToAlloc]); + if (memory == nullptr) + return nullptr; + + // Use placement-new to initialize header + new(memory) tHeader(inUseList, (numBytesToAlloc + pageSize - 1) / pageSize); + inUseList = memory; + + currentPageOffset = pageSize; // make next allocation come from a new page + + // No guard blocks for multi-page allocations (yet) + return reinterpret_cast(reinterpret_cast(memory) + headerSkip); + } + + // + // Need a simple page to allocate from. + // + tHeader* memory; + if (freeList) { + memory = freeList; + freeList = freeList->nextPage; + } else { + memory = reinterpret_cast(::new char[pageSize]); + if (memory == nullptr) + return nullptr; + } + + // Use placement-new to initialize header + new(memory) tHeader(inUseList, 1); + inUseList = memory; + + unsigned char* ret = reinterpret_cast(inUseList) + headerSkip; + currentPageOffset = (headerSkip + allocationSize + alignmentMask) & ~alignmentMask; + + return initializeAllocation(inUseList, ret, numBytes); +} + +// +// Check all allocations in a list for damage by calling check on each. +// +void TAllocation::checkAllocList() const +{ + for (const TAllocation* alloc = this; alloc != nullptr; alloc = alloc->prevAlloc) + alloc->check(); +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.cpp new file mode 100644 index 0000000000..ceae0e322c --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.cpp @@ -0,0 +1,126 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "../Include/intermediate.h" +#include "RemoveTree.h" + +namespace QtShaderTools { +namespace glslang { + +// +// Code to recursively delete the intermediate tree. +// +struct TRemoveTraverser : TIntermTraverser { + TRemoveTraverser() : TIntermTraverser(false, false, true, false, true) {} + + virtual void visitSymbol(TIntermSymbol* node) + { + delete node; + } + + virtual bool visitBinary(TVisit /* visit*/ , TIntermBinary* node) + { + delete node; + + return true; + } + + virtual bool visitUnary(TVisit /* visit */, TIntermUnary* node) + { + delete node; + + return true; + } + + virtual bool visitAggregate(TVisit /* visit*/ , TIntermAggregate* node) + { + delete node; + + return true; + } + + virtual bool visitSelection(TVisit /* visit*/ , TIntermSelection* node) + { + delete node; + + return true; + } + + virtual bool visitSwitch(TVisit /* visit*/ , TIntermSwitch* node) + { + delete node; + + return true; + } + + virtual void visitConstantUnion(TIntermConstantUnion* node) + { + delete node; + } + + virtual bool visitLoop(TVisit /* visit*/ , TIntermLoop* node) + { + delete node; + + return true; + } + + virtual bool visitBranch(TVisit /* visit*/ , TIntermBranch* node) + { + delete node; + + return true; + } + + virtual bool visitVariableDecl(TVisit /* visit */, TIntermVariableDecl* decl) + { + delete decl; + return true; + } +}; + +// +// Entry point. +// +void RemoveAllTreeNodes(TIntermNode* root) +{ + TRemoveTraverser it; + + root->traverse(&it); +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.h new file mode 100644 index 0000000000..33b53d5d4f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.h @@ -0,0 +1,43 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#pragma once + +namespace QtShaderTools { +namespace glslang { + +void RemoveAllTreeNodes(TIntermNode*); + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp new file mode 100644 index 0000000000..5736e91617 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp @@ -0,0 +1,2143 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. +// Copyright (C) 2020 Google, Inc. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// GLSL scanning, leveraging the scanning done by the preprocessor. +// + +#include +#include +#include + +#include "../Include/Types.h" +#include "SymbolTable.h" +#include "ParseHelper.h" +#include "attribute.h" +#include "glslang_tab.cpp.h" +#include "ScanContext.h" +#include "Scan.h" + +// preprocessor includes +#include "preprocessor/PpContext.h" +#include "preprocessor/PpTokens.h" + +namespace QtShaderTools { +// Required to avoid missing prototype warnings for some compilers +int yylex(YYSTYPE*, QtShaderTools::glslang::TParseContext&); + +namespace glslang { + +// read past any white space +void TInputScanner::consumeWhiteSpace(bool& foundNonSpaceTab) +{ + int c = peek(); // don't accidentally consume anything other than whitespace + while (c == ' ' || c == '\t' || c == '\r' || c == '\n') { + if (c == '\r' || c == '\n') + foundNonSpaceTab = true; + get(); + c = peek(); + } +} + +// return true if a comment was actually consumed +bool TInputScanner::consumeComment() +{ + if (peek() != '/') + return false; + + get(); // consume the '/' + int c = peek(); + if (c == '/') { + + // a '//' style comment + get(); // consume the second '/' + c = get(); + do { + while (c != EndOfInput && c != '\\' && c != '\r' && c != '\n') + c = get(); + + if (c == EndOfInput || c == '\r' || c == '\n') { + while (c == '\r' || c == '\n') + c = get(); + + // we reached the end of the comment + break; + } else { + // it's a '\', so we need to keep going, after skipping what's escaped + + // read the skipped character + c = get(); + + // if it's a two-character newline, skip both characters + if (c == '\r' && peek() == '\n') + get(); + c = get(); + } + } while (true); + + // put back the last non-comment character + if (c != EndOfInput) + unget(); + + return true; + } else if (c == '*') { + + // a '/*' style comment + get(); // consume the '*' + c = get(); + do { + while (c != EndOfInput && c != '*') + c = get(); + if (c == '*') { + c = get(); + if (c == '/') + break; // end of comment + // not end of comment + } else // end of input + break; + } while (true); + + return true; + } else { + // it's not a comment, put the '/' back + unget(); + + return false; + } +} + +// skip whitespace, then skip a comment, rinse, repeat +void TInputScanner::consumeWhitespaceComment(bool& foundNonSpaceTab) +{ + do { + consumeWhiteSpace(foundNonSpaceTab); + + // if not starting a comment now, then done + int c = peek(); + if (c != '/' || c == EndOfInput) + return; + + // skip potential comment + foundNonSpaceTab = true; + if (! consumeComment()) + return; + + } while (true); +} + +// Returns true if there was non-white space (e.g., a comment, newline) before the #version +// or no #version was found; otherwise, returns false. There is no error case, it always +// succeeds, but will leave version == 0 if no #version was found. +// +// Sets notFirstToken based on whether tokens (beyond white space and comments) +// appeared before the #version. +// +// N.B. does not attempt to leave input in any particular known state. The assumption +// is that scanning will start anew, following the rules for the chosen version/profile, +// and with a corresponding parsing context. +// +bool TInputScanner::scanVersion(int& version, EProfile& profile, bool& notFirstToken) +{ + // This function doesn't have to get all the semantics correct, + // just find the #version if there is a correct one present. + // The preprocessor will have the responsibility of getting all the semantics right. + + bool versionNotFirst = false; // means not first WRT comments and white space, nothing more + notFirstToken = false; // means not first WRT to real tokens + version = 0; // means not found + profile = ENoProfile; + + bool foundNonSpaceTab = false; + bool lookingInMiddle = false; + int c; + do { + if (lookingInMiddle) { + notFirstToken = true; + // make forward progress by finishing off the current line plus extra new lines + if (peek() != '\n' && peek() != '\r') { + do { + c = get(); + } while (c != EndOfInput && c != '\n' && c != '\r'); + } + while (peek() == '\n' || peek() == '\r') + get(); + if (peek() == EndOfInput) + return true; + } + lookingInMiddle = true; + + // Nominal start, skipping the desktop allowed comments and white space, but tracking if + // something else was found for ES: + consumeWhitespaceComment(foundNonSpaceTab); + if (foundNonSpaceTab) + versionNotFirst = true; + + // "#" + if (get() != '#') { + versionNotFirst = true; + continue; + } + + // whitespace + do { + c = get(); + } while (c == ' ' || c == '\t'); + + // "version" + if ( c != 'v' || + get() != 'e' || + get() != 'r' || + get() != 's' || + get() != 'i' || + get() != 'o' || + get() != 'n') { + versionNotFirst = true; + continue; + } + + // whitespace + do { + c = get(); + } while (c == ' ' || c == '\t'); + + // version number + while (c >= '0' && c <= '9') { + version = 10 * version + (c - '0'); + c = get(); + } + if (version == 0) { + versionNotFirst = true; + continue; + } + + // whitespace + while (c == ' ' || c == '\t') + c = get(); + + // profile + const int maxProfileLength = 13; // not including any 0 + char profileString[maxProfileLength]; + int profileLength; + for (profileLength = 0; profileLength < maxProfileLength; ++profileLength) { + if (c == EndOfInput || c == ' ' || c == '\t' || c == '\n' || c == '\r') + break; + profileString[profileLength] = (char)c; + c = get(); + } + if (c != EndOfInput && c != ' ' && c != '\t' && c != '\n' && c != '\r') { + versionNotFirst = true; + continue; + } + + if (profileLength == 2 && strncmp(profileString, "es", profileLength) == 0) + profile = EEsProfile; + else if (profileLength == 4 && strncmp(profileString, "core", profileLength) == 0) + profile = ECoreProfile; + else if (profileLength == 13 && strncmp(profileString, "compatibility", profileLength) == 0) + profile = ECompatibilityProfile; + + return versionNotFirst; + } while (true); +} + +// Fill this in when doing glslang-level scanning, to hand back to the parser. +class TParserToken { +public: + explicit TParserToken(YYSTYPE& b) : sType(b) { } + + YYSTYPE& sType; +protected: + TParserToken(TParserToken&); + TParserToken& operator=(TParserToken&); +}; + +} // end namespace glslang + +// This is the function the glslang parser (i.e., bison) calls to get its next token +int yylex(YYSTYPE* glslangTokenDesc, glslang::TParseContext& parseContext) +{ + glslang::TParserToken token(*glslangTokenDesc); + + return parseContext.getScanContext()->tokenize(parseContext.getPpContext(), token); +} + +namespace { + +struct str_eq +{ + bool operator()(const char* lhs, const char* rhs) const + { + return strcmp(lhs, rhs) == 0; + } +}; + +struct str_hash +{ + size_t operator()(const char* str) const + { + // djb2 + unsigned long hash = 5381; + int c; + + while ((c = *str++) != 0) + hash = ((hash << 5) + hash) + c; + + return hash; + } +}; + +// A single global usable by all threads, by all versions, by all languages. +const std::unordered_map KeywordMap { + {"const",CONST}, + {"uniform",UNIFORM}, + {"tileImageEXT",TILEIMAGEEXT}, + {"buffer",BUFFER}, + {"in",IN}, + {"out",OUT}, + {"smooth",SMOOTH}, + {"flat",FLAT}, + {"centroid",CENTROID}, + {"invariant",INVARIANT}, + {"packed",PACKED}, + {"resource",RESOURCE}, + {"inout",INOUT}, + {"struct",STRUCT}, + {"break",BREAK}, + {"continue",CONTINUE}, + {"do",DO}, + {"for",FOR}, + {"while",WHILE}, + {"switch",SWITCH}, + {"case",CASE}, + {"default",DEFAULT}, + {"if",IF}, + {"else",ELSE}, + {"discard",DISCARD}, + {"terminateInvocation",TERMINATE_INVOCATION}, + {"terminateRayEXT",TERMINATE_RAY}, + {"ignoreIntersectionEXT",IGNORE_INTERSECTION}, + {"return",RETURN}, + {"void",VOID}, + {"bool",BOOL}, + {"float",FLOAT}, + {"int",INT}, + {"bvec2",BVEC2}, + {"bvec3",BVEC3}, + {"bvec4",BVEC4}, + {"vec2",VEC2}, + {"vec3",VEC3}, + {"vec4",VEC4}, + {"ivec2",IVEC2}, + {"ivec3",IVEC3}, + {"ivec4",IVEC4}, + {"mat2",MAT2}, + {"mat3",MAT3}, + {"mat4",MAT4}, + {"true",BOOLCONSTANT}, + {"false",BOOLCONSTANT}, + {"layout",LAYOUT}, + {"shared",SHARED}, + {"highp",HIGH_PRECISION}, + {"mediump",MEDIUM_PRECISION}, + {"lowp",LOW_PRECISION}, + {"superp",SUPERP}, + {"precision",PRECISION}, + {"mat2x2",MAT2X2}, + {"mat2x3",MAT2X3}, + {"mat2x4",MAT2X4}, + {"mat3x2",MAT3X2}, + {"mat3x3",MAT3X3}, + {"mat3x4",MAT3X4}, + {"mat4x2",MAT4X2}, + {"mat4x3",MAT4X3}, + {"mat4x4",MAT4X4}, + {"uint",UINT}, + {"uvec2",UVEC2}, + {"uvec3",UVEC3}, + {"uvec4",UVEC4}, + + {"nonuniformEXT",NONUNIFORM}, + {"demote",DEMOTE}, + {"attribute",ATTRIBUTE}, + {"varying",VARYING}, + {"noperspective",NOPERSPECTIVE}, + {"coherent",COHERENT}, + {"devicecoherent",DEVICECOHERENT}, + {"queuefamilycoherent",QUEUEFAMILYCOHERENT}, + {"workgroupcoherent",WORKGROUPCOHERENT}, + {"subgroupcoherent",SUBGROUPCOHERENT}, + {"shadercallcoherent",SHADERCALLCOHERENT}, + {"nonprivate",NONPRIVATE}, + {"restrict",RESTRICT}, + {"readonly",READONLY}, + {"writeonly",WRITEONLY}, + {"atomic_uint",ATOMIC_UINT}, + {"volatile",VOLATILE}, + {"nontemporal",NONTEMPORAL}, + {"patch",PATCH}, + {"sample",SAMPLE}, + {"subroutine",SUBROUTINE}, + {"dmat2",DMAT2}, + {"dmat3",DMAT3}, + {"dmat4",DMAT4}, + {"dmat2x2",DMAT2X2}, + {"dmat2x3",DMAT2X3}, + {"dmat2x4",DMAT2X4}, + {"dmat3x2",DMAT3X2}, + {"dmat3x3",DMAT3X3}, + {"dmat3x4",DMAT3X4}, + {"dmat4x2",DMAT4X2}, + {"dmat4x3",DMAT4X3}, + {"dmat4x4",DMAT4X4}, + {"image1D",IMAGE1D}, + {"iimage1D",IIMAGE1D}, + {"uimage1D",UIMAGE1D}, + {"image2D",IMAGE2D}, + {"iimage2D",IIMAGE2D}, + {"uimage2D",UIMAGE2D}, + {"image3D",IMAGE3D}, + {"iimage3D",IIMAGE3D}, + {"uimage3D",UIMAGE3D}, + {"image2DRect",IMAGE2DRECT}, + {"iimage2DRect",IIMAGE2DRECT}, + {"uimage2DRect",UIMAGE2DRECT}, + {"imageCube",IMAGECUBE}, + {"iimageCube",IIMAGECUBE}, + {"uimageCube",UIMAGECUBE}, + {"imageBuffer",IMAGEBUFFER}, + {"iimageBuffer",IIMAGEBUFFER}, + {"uimageBuffer",UIMAGEBUFFER}, + {"image1DArray",IMAGE1DARRAY}, + {"iimage1DArray",IIMAGE1DARRAY}, + {"uimage1DArray",UIMAGE1DARRAY}, + {"image2DArray",IMAGE2DARRAY}, + {"iimage2DArray",IIMAGE2DARRAY}, + {"uimage2DArray",UIMAGE2DARRAY}, + {"imageCubeArray",IMAGECUBEARRAY}, + {"iimageCubeArray",IIMAGECUBEARRAY}, + {"uimageCubeArray",UIMAGECUBEARRAY}, + {"image2DMS",IMAGE2DMS}, + {"iimage2DMS",IIMAGE2DMS}, + {"uimage2DMS",UIMAGE2DMS}, + {"image2DMSArray",IMAGE2DMSARRAY}, + {"iimage2DMSArray",IIMAGE2DMSARRAY}, + {"uimage2DMSArray",UIMAGE2DMSARRAY}, + {"i64image1D",I64IMAGE1D}, + {"u64image1D",U64IMAGE1D}, + {"i64image2D",I64IMAGE2D}, + {"u64image2D",U64IMAGE2D}, + {"i64image3D",I64IMAGE3D}, + {"u64image3D",U64IMAGE3D}, + {"i64image2DRect",I64IMAGE2DRECT}, + {"u64image2DRect",U64IMAGE2DRECT}, + {"i64imageCube",I64IMAGECUBE}, + {"u64imageCube",U64IMAGECUBE}, + {"i64imageBuffer",I64IMAGEBUFFER}, + {"u64imageBuffer",U64IMAGEBUFFER}, + {"i64image1DArray",I64IMAGE1DARRAY}, + {"u64image1DArray",U64IMAGE1DARRAY}, + {"i64image2DArray",I64IMAGE2DARRAY}, + {"u64image2DArray",U64IMAGE2DARRAY}, + {"i64imageCubeArray",I64IMAGECUBEARRAY}, + {"u64imageCubeArray",U64IMAGECUBEARRAY}, + {"i64image2DMS",I64IMAGE2DMS}, + {"u64image2DMS",U64IMAGE2DMS}, + {"i64image2DMSArray",I64IMAGE2DMSARRAY}, + {"u64image2DMSArray",U64IMAGE2DMSARRAY}, + {"double",DOUBLE}, + {"dvec2",DVEC2}, + {"dvec3",DVEC3}, + {"dvec4",DVEC4}, + {"int64_t",INT64_T}, + {"uint64_t",UINT64_T}, + {"i64vec2",I64VEC2}, + {"i64vec3",I64VEC3}, + {"i64vec4",I64VEC4}, + {"u64vec2",U64VEC2}, + {"u64vec3",U64VEC3}, + {"u64vec4",U64VEC4}, + + // GL_EXT_shader_explicit_arithmetic_types + {"int8_t",INT8_T}, + {"i8vec2",I8VEC2}, + {"i8vec3",I8VEC3}, + {"i8vec4",I8VEC4}, + {"uint8_t",UINT8_T}, + {"u8vec2",U8VEC2}, + {"u8vec3",U8VEC3}, + {"u8vec4",U8VEC4}, + + {"int16_t",INT16_T}, + {"i16vec2",I16VEC2}, + {"i16vec3",I16VEC3}, + {"i16vec4",I16VEC4}, + {"uint16_t",UINT16_T}, + {"u16vec2",U16VEC2}, + {"u16vec3",U16VEC3}, + {"u16vec4",U16VEC4}, + + {"int32_t",INT32_T}, + {"i32vec2",I32VEC2}, + {"i32vec3",I32VEC3}, + {"i32vec4",I32VEC4}, + {"uint32_t",UINT32_T}, + {"u32vec2",U32VEC2}, + {"u32vec3",U32VEC3}, + {"u32vec4",U32VEC4}, + + {"float16_t",FLOAT16_T}, + {"f16vec2",F16VEC2}, + {"f16vec3",F16VEC3}, + {"f16vec4",F16VEC4}, + {"f16mat2",F16MAT2}, + {"f16mat3",F16MAT3}, + {"f16mat4",F16MAT4}, + {"f16mat2x2",F16MAT2X2}, + {"f16mat2x3",F16MAT2X3}, + {"f16mat2x4",F16MAT2X4}, + {"f16mat3x2",F16MAT3X2}, + {"f16mat3x3",F16MAT3X3}, + {"f16mat3x4",F16MAT3X4}, + {"f16mat4x2",F16MAT4X2}, + {"f16mat4x3",F16MAT4X3}, + {"f16mat4x4",F16MAT4X4}, + + {"bfloat16_t",BFLOAT16_T}, + {"bf16vec2",BF16VEC2}, + {"bf16vec3",BF16VEC3}, + {"bf16vec4",BF16VEC4}, + + {"floate5m2_t",FLOATE5M2_T}, + {"fe5m2vec2",FE5M2VEC2}, + {"fe5m2vec3",FE5M2VEC3}, + {"fe5m2vec4",FE5M2VEC4}, + + {"floate4m3_t",FLOATE4M3_T}, + {"fe4m3vec2",FE4M3VEC2}, + {"fe4m3vec3",FE4M3VEC3}, + {"fe4m3vec4",FE4M3VEC4}, + + {"float32_t",FLOAT32_T}, + {"f32vec2",F32VEC2}, + {"f32vec3",F32VEC3}, + {"f32vec4",F32VEC4}, + {"f32mat2",F32MAT2}, + {"f32mat3",F32MAT3}, + {"f32mat4",F32MAT4}, + {"f32mat2x2",F32MAT2X2}, + {"f32mat2x3",F32MAT2X3}, + {"f32mat2x4",F32MAT2X4}, + {"f32mat3x2",F32MAT3X2}, + {"f32mat3x3",F32MAT3X3}, + {"f32mat3x4",F32MAT3X4}, + {"f32mat4x2",F32MAT4X2}, + {"f32mat4x3",F32MAT4X3}, + {"f32mat4x4",F32MAT4X4}, + {"float64_t",FLOAT64_T}, + {"f64vec2",F64VEC2}, + {"f64vec3",F64VEC3}, + {"f64vec4",F64VEC4}, + {"f64mat2",F64MAT2}, + {"f64mat3",F64MAT3}, + {"f64mat4",F64MAT4}, + {"f64mat2x2",F64MAT2X2}, + {"f64mat2x3",F64MAT2X3}, + {"f64mat2x4",F64MAT2X4}, + {"f64mat3x2",F64MAT3X2}, + {"f64mat3x3",F64MAT3X3}, + {"f64mat3x4",F64MAT3X4}, + {"f64mat4x2",F64MAT4X2}, + {"f64mat4x3",F64MAT4X3}, + {"f64mat4x4",F64MAT4X4}, + + // GL_EXT_spirv_intrinsics + {"spirv_instruction",SPIRV_INSTRUCTION}, + {"spirv_execution_mode",SPIRV_EXECUTION_MODE}, + {"spirv_execution_mode_id",SPIRV_EXECUTION_MODE_ID}, + {"spirv_decorate",SPIRV_DECORATE}, + {"spirv_decorate_id",SPIRV_DECORATE_ID}, + {"spirv_decorate_string",SPIRV_DECORATE_STRING}, + {"spirv_type",SPIRV_TYPE}, + {"spirv_storage_class",SPIRV_STORAGE_CLASS}, + {"spirv_by_reference",SPIRV_BY_REFERENCE}, + {"spirv_literal",SPIRV_LITERAL}, + + {"sampler2D",SAMPLER2D}, + {"samplerCube",SAMPLERCUBE}, + {"samplerCubeShadow",SAMPLERCUBESHADOW}, + {"sampler2DArray",SAMPLER2DARRAY}, + {"sampler2DArrayShadow",SAMPLER2DARRAYSHADOW}, + {"isampler2D",ISAMPLER2D}, + {"isampler3D",ISAMPLER3D}, + {"isamplerCube",ISAMPLERCUBE}, + {"isampler2DArray",ISAMPLER2DARRAY}, + {"usampler2D",USAMPLER2D}, + {"usampler3D",USAMPLER3D}, + {"usamplerCube",USAMPLERCUBE}, + {"usampler2DArray",USAMPLER2DARRAY}, + {"sampler3D",SAMPLER3D}, + {"sampler2DShadow",SAMPLER2DSHADOW}, + + {"texture2D",TEXTURE2D}, + {"textureCube",TEXTURECUBE}, + {"texture2DArray",TEXTURE2DARRAY}, + {"itexture2D",ITEXTURE2D}, + {"itexture3D",ITEXTURE3D}, + {"itextureCube",ITEXTURECUBE}, + {"itexture2DArray",ITEXTURE2DARRAY}, + {"utexture2D",UTEXTURE2D}, + {"utexture3D",UTEXTURE3D}, + {"utextureCube",UTEXTURECUBE}, + {"utexture2DArray",UTEXTURE2DARRAY}, + {"texture3D",TEXTURE3D}, + + {"sampler",SAMPLER}, + {"samplerShadow",SAMPLERSHADOW}, + + {"textureCubeArray",TEXTURECUBEARRAY}, + {"itextureCubeArray",ITEXTURECUBEARRAY}, + {"utextureCubeArray",UTEXTURECUBEARRAY}, + {"samplerCubeArray",SAMPLERCUBEARRAY}, + {"samplerCubeArrayShadow",SAMPLERCUBEARRAYSHADOW}, + {"isamplerCubeArray",ISAMPLERCUBEARRAY}, + {"usamplerCubeArray",USAMPLERCUBEARRAY}, + {"sampler1DArrayShadow",SAMPLER1DARRAYSHADOW}, + {"isampler1DArray",ISAMPLER1DARRAY}, + {"usampler1D",USAMPLER1D}, + {"isampler1D",ISAMPLER1D}, + {"usampler1DArray",USAMPLER1DARRAY}, + {"samplerBuffer",SAMPLERBUFFER}, + {"isampler2DRect",ISAMPLER2DRECT}, + {"usampler2DRect",USAMPLER2DRECT}, + {"isamplerBuffer",ISAMPLERBUFFER}, + {"usamplerBuffer",USAMPLERBUFFER}, + {"sampler2DMS",SAMPLER2DMS}, + {"isampler2DMS",ISAMPLER2DMS}, + {"usampler2DMS",USAMPLER2DMS}, + {"sampler2DMSArray",SAMPLER2DMSARRAY}, + {"isampler2DMSArray",ISAMPLER2DMSARRAY}, + {"usampler2DMSArray",USAMPLER2DMSARRAY}, + {"sampler1D",SAMPLER1D}, + {"sampler1DShadow",SAMPLER1DSHADOW}, + {"sampler2DRect",SAMPLER2DRECT}, + {"sampler2DRectShadow",SAMPLER2DRECTSHADOW}, + {"sampler1DArray",SAMPLER1DARRAY}, + + {"samplerExternalOES", SAMPLEREXTERNALOES}, // GL_OES_EGL_image_external + {"__samplerExternal2DY2YEXT", SAMPLEREXTERNAL2DY2YEXT}, // GL_EXT_YUV_target + + {"itexture1DArray",ITEXTURE1DARRAY}, + {"utexture1D",UTEXTURE1D}, + {"itexture1D",ITEXTURE1D}, + {"utexture1DArray",UTEXTURE1DARRAY}, + {"textureBuffer",TEXTUREBUFFER}, + {"itexture2DRect",ITEXTURE2DRECT}, + {"utexture2DRect",UTEXTURE2DRECT}, + {"itextureBuffer",ITEXTUREBUFFER}, + {"utextureBuffer",UTEXTUREBUFFER}, + {"texture2DMS",TEXTURE2DMS}, + {"itexture2DMS",ITEXTURE2DMS}, + {"utexture2DMS",UTEXTURE2DMS}, + {"texture2DMSArray",TEXTURE2DMSARRAY}, + {"itexture2DMSArray",ITEXTURE2DMSARRAY}, + {"utexture2DMSArray",UTEXTURE2DMSARRAY}, + {"texture1D",TEXTURE1D}, + {"texture2DRect",TEXTURE2DRECT}, + {"texture1DArray",TEXTURE1DARRAY}, + + {"attachmentEXT",ATTACHMENTEXT}, + {"iattachmentEXT",IATTACHMENTEXT}, + {"uattachmentEXT",UATTACHMENTEXT}, + + {"subpassInput",SUBPASSINPUT}, + {"subpassInputMS",SUBPASSINPUTMS}, + {"isubpassInput",ISUBPASSINPUT}, + {"isubpassInputMS",ISUBPASSINPUTMS}, + {"usubpassInput",USUBPASSINPUT}, + {"usubpassInputMS",USUBPASSINPUTMS}, + + {"f16sampler1D",F16SAMPLER1D}, + {"f16sampler2D",F16SAMPLER2D}, + {"f16sampler3D",F16SAMPLER3D}, + {"f16sampler2DRect",F16SAMPLER2DRECT}, + {"f16samplerCube",F16SAMPLERCUBE}, + {"f16sampler1DArray",F16SAMPLER1DARRAY}, + {"f16sampler2DArray",F16SAMPLER2DARRAY}, + {"f16samplerCubeArray",F16SAMPLERCUBEARRAY}, + {"f16samplerBuffer",F16SAMPLERBUFFER}, + {"f16sampler2DMS",F16SAMPLER2DMS}, + {"f16sampler2DMSArray",F16SAMPLER2DMSARRAY}, + {"f16sampler1DShadow",F16SAMPLER1DSHADOW}, + {"f16sampler2DShadow",F16SAMPLER2DSHADOW}, + {"f16sampler2DRectShadow",F16SAMPLER2DRECTSHADOW}, + {"f16samplerCubeShadow",F16SAMPLERCUBESHADOW}, + {"f16sampler1DArrayShadow",F16SAMPLER1DARRAYSHADOW}, + {"f16sampler2DArrayShadow",F16SAMPLER2DARRAYSHADOW}, + {"f16samplerCubeArrayShadow",F16SAMPLERCUBEARRAYSHADOW}, + + {"f16image1D",F16IMAGE1D}, + {"f16image2D",F16IMAGE2D}, + {"f16image3D",F16IMAGE3D}, + {"f16image2DRect",F16IMAGE2DRECT}, + {"f16imageCube",F16IMAGECUBE}, + {"f16image1DArray",F16IMAGE1DARRAY}, + {"f16image2DArray",F16IMAGE2DARRAY}, + {"f16imageCubeArray",F16IMAGECUBEARRAY}, + {"f16imageBuffer",F16IMAGEBUFFER}, + {"f16image2DMS",F16IMAGE2DMS}, + {"f16image2DMSArray",F16IMAGE2DMSARRAY}, + + {"f16texture1D",F16TEXTURE1D}, + {"f16texture2D",F16TEXTURE2D}, + {"f16texture3D",F16TEXTURE3D}, + {"f16texture2DRect",F16TEXTURE2DRECT}, + {"f16textureCube",F16TEXTURECUBE}, + {"f16texture1DArray",F16TEXTURE1DARRAY}, + {"f16texture2DArray",F16TEXTURE2DARRAY}, + {"f16textureCubeArray",F16TEXTURECUBEARRAY}, + {"f16textureBuffer",F16TEXTUREBUFFER}, + {"f16texture2DMS",F16TEXTURE2DMS}, + {"f16texture2DMSArray",F16TEXTURE2DMSARRAY}, + + {"f16subpassInput",F16SUBPASSINPUT}, + {"f16subpassInputMS",F16SUBPASSINPUTMS}, + {"__explicitInterpAMD",EXPLICITINTERPAMD}, + {"pervertexNV",PERVERTEXNV}, + {"pervertexEXT",PERVERTEXEXT}, + {"precise",PRECISE}, + + {"rayPayloadNV",PAYLOADNV}, + {"rayPayloadEXT",PAYLOADEXT}, + {"rayPayloadInNV",PAYLOADINNV}, + {"rayPayloadInEXT",PAYLOADINEXT}, + {"hitAttributeNV",HITATTRNV}, + {"hitAttributeEXT",HITATTREXT}, + {"callableDataNV",CALLDATANV}, + {"callableDataEXT",CALLDATAEXT}, + {"callableDataInNV",CALLDATAINNV}, + {"callableDataInEXT",CALLDATAINEXT}, + {"accelerationStructureNV",ACCSTRUCTNV}, + {"accelerationStructureEXT",ACCSTRUCTEXT}, + {"rayQueryEXT",RAYQUERYEXT}, + {"perprimitiveNV",PERPRIMITIVENV}, + {"perviewNV",PERVIEWNV}, + {"taskNV",PERTASKNV}, + {"perprimitiveEXT",PERPRIMITIVEEXT}, + {"taskPayloadSharedEXT",TASKPAYLOADWORKGROUPEXT}, + + {"fcoopmatNV",FCOOPMATNV}, + {"icoopmatNV",ICOOPMATNV}, + {"ucoopmatNV",UCOOPMATNV}, + + {"coopmat",COOPMAT}, + + {"hitObjectNV",HITOBJECTNV}, + {"hitObjectAttributeNV",HITOBJECTATTRNV}, + + {"tensorARM",TENSORARM}, + + {"hitObjectEXT",HITOBJECTEXT}, + {"hitObjectAttributeEXT",HITOBJECTATTREXT}, + + {"__function",FUNCTION}, + {"tensorLayoutNV",TENSORLAYOUTNV}, + {"tensorViewNV",TENSORVIEWNV}, + + {"coopvecNV",COOPVECNV}, +}; +const std::unordered_set ReservedSet { + "common", + "partition", + "active", + "asm", + "class", + "union", + "enum", + "typedef", + "template", + "this", + "goto", + "inline", + "noinline", + "public", + "static", + "extern", + "external", + "interface", + "long", + "short", + "half", + "fixed", + "unsigned", + "input", + "output", + "hvec2", + "hvec3", + "hvec4", + "fvec2", + "fvec3", + "fvec4", + "sampler3DRect", + "filter", + "sizeof", + "cast", + "namespace", + "using", +}; + +} + +namespace glslang { + +// Called by yylex to get the next token. +// Returning 0 implies end of input. +int TScanContext::tokenize(TPpContext* pp, TParserToken& token) +{ + do { + parserToken = &token; + TPpToken ppToken; + int token = pp->tokenize(ppToken); + if (token == EndOfInput) + return 0; + + tokenText = ppToken.name; + loc = ppToken.loc; + parserToken->sType.lex.loc = loc; + switch (token) { + case ';': afterType = false; afterBuffer = false; inDeclaratorList = false; afterDeclarator = false; angleBracketDepth = 0; squareBracketDepth = 0; parenDepth = 0; return SEMICOLON; + case ',': + // If we just processed a declarator (identifier after a type), this comma + // indicates that we're in a declarator list. Note that 'afterDeclarator' is + // only set when we are not inside a template parameter list, array expression, + // or function parameter list. + if (afterDeclarator) { + inDeclaratorList = true; + } + afterType = false; + afterDeclarator = false; + return COMMA; + case ':': return COLON; + case '=': afterType = false; inDeclaratorList = false; afterDeclarator = false; return EQUAL; + case '(': afterType = false; inDeclaratorList = false; afterDeclarator = false; parenDepth++; return LEFT_PAREN; + case ')': afterType = false; inDeclaratorList = false; afterDeclarator = false; if (parenDepth > 0) parenDepth--; return RIGHT_PAREN; + case '.': field = true; return DOT; + case '!': return BANG; + case '-': return DASH; + case '~': return TILDE; + case '+': return PLUS; + case '*': return STAR; + case '/': return SLASH; + case '%': return PERCENT; + case '<': angleBracketDepth++; return LEFT_ANGLE; + case '>': if (angleBracketDepth > 0) angleBracketDepth--; return RIGHT_ANGLE; + case '|': return VERTICAL_BAR; + case '^': return CARET; + case '&': return AMPERSAND; + case '?': return QUESTION; + case '[': squareBracketDepth++; return LEFT_BRACKET; + case ']': if (squareBracketDepth > 0) squareBracketDepth--; return RIGHT_BRACKET; + case '{': afterStruct = false; afterBuffer = false; inDeclaratorList = false; afterDeclarator = false; angleBracketDepth = 0; squareBracketDepth = 0; parenDepth = 0; return LEFT_BRACE; + case '}': inDeclaratorList = false; afterDeclarator = false; angleBracketDepth = 0; squareBracketDepth = 0; parenDepth = 0; return RIGHT_BRACE; + case '\\': + parseContext.error(loc, "illegal use of escape character", "\\", ""); + break; + + case PPAtomAddAssign: return ADD_ASSIGN; + case PPAtomSubAssign: return SUB_ASSIGN; + case PPAtomMulAssign: return MUL_ASSIGN; + case PPAtomDivAssign: return DIV_ASSIGN; + case PPAtomModAssign: return MOD_ASSIGN; + + case PpAtomRight: return RIGHT_OP; + case PpAtomLeft: return LEFT_OP; + + case PpAtomRightAssign: return RIGHT_ASSIGN; + case PpAtomLeftAssign: return LEFT_ASSIGN; + case PpAtomAndAssign: return AND_ASSIGN; + case PpAtomOrAssign: return OR_ASSIGN; + case PpAtomXorAssign: return XOR_ASSIGN; + + case PpAtomAnd: return AND_OP; + case PpAtomOr: return OR_OP; + case PpAtomXor: return XOR_OP; + + case PpAtomEQ: return EQ_OP; + case PpAtomGE: return GE_OP; + case PpAtomNE: return NE_OP; + case PpAtomLE: return LE_OP; + + case PpAtomDecrement: return DEC_OP; + case PpAtomIncrement: return INC_OP; + + case PpAtomColonColon: + parseContext.error(loc, "not supported", "::", ""); + break; + + case PpAtomConstString: parserToken->sType.lex.string = NewPoolTString(tokenText); return STRING_LITERAL; + case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT; + case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT; + case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT; + case PpAtomConstInt16: parserToken->sType.lex.i = ppToken.ival; return INT16CONSTANT; + case PpAtomConstUint16: parserToken->sType.lex.i = ppToken.ival; return UINT16CONSTANT; + case PpAtomConstInt64: parserToken->sType.lex.i64 = ppToken.i64val; return INT64CONSTANT; + case PpAtomConstUint64: parserToken->sType.lex.i64 = ppToken.i64val; return UINT64CONSTANT; + case PpAtomConstDouble: parserToken->sType.lex.d = ppToken.dval; return DOUBLECONSTANT; + case PpAtomConstFloat16: parserToken->sType.lex.d = ppToken.dval; return FLOAT16CONSTANT; + case PpAtomIdentifier: + { + int token = tokenizeIdentifier(); + field = false; + return token; + } + + case EndOfInput: return 0; + + default: + char buf[2]; + buf[0] = (char)token; + buf[1] = 0; + parseContext.error(loc, "unexpected token", buf, ""); + break; + } + } while (true); +} + +int TScanContext::tokenizeIdentifier() +{ + if (ReservedSet.find(tokenText) != ReservedSet.end()) + return reservedWord(); + + auto it = KeywordMap.find(tokenText); + if (it == KeywordMap.end()) { + // Should have an identifier of some sort + return identifierOrType(); + } + keyword = it->second; + + switch (keyword) { + case CONST: + case UNIFORM: + case TILEIMAGEEXT: + case IN: + case OUT: + case INOUT: + case BREAK: + case CONTINUE: + case DO: + case FOR: + case WHILE: + case IF: + case ELSE: + case DISCARD: + case RETURN: + case CASE: + return keyword; + + case TERMINATE_INVOCATION: + if (!parseContext.extensionTurnedOn(E_GL_EXT_terminate_invocation)) + return identifierOrType(); + return keyword; + + case TERMINATE_RAY: + case IGNORE_INTERSECTION: + if (!parseContext.extensionTurnedOn(E_GL_EXT_ray_tracing)) + return identifierOrType(); + return keyword; + + case BUFFER: + afterBuffer = true; + if ((parseContext.isEsProfile() && parseContext.version < 310) || + (!parseContext.isEsProfile() && (parseContext.version < 430 && + !parseContext.extensionTurnedOn(E_GL_ARB_shader_storage_buffer_object)))) + return identifierOrType(); + return keyword; + + case STRUCT: + afterStruct = true; + return keyword; + + case SWITCH: + case DEFAULT: + if ((parseContext.isEsProfile() && parseContext.version < 300) || + (!parseContext.isEsProfile() && parseContext.version < 130)) + reservedWord(); + return keyword; + + case VOID: + case BOOL: + case FLOAT: + case INT: + case BVEC2: + case BVEC3: + case BVEC4: + case VEC2: + case VEC3: + case VEC4: + case IVEC2: + case IVEC3: + case IVEC4: + case MAT2: + case MAT3: + case MAT4: + case SAMPLER2D: + case SAMPLERCUBE: + afterType = true; + return keyword; + + case BOOLCONSTANT: + if (strcmp("true", tokenText) == 0) + parserToken->sType.lex.b = true; + else + parserToken->sType.lex.b = false; + return keyword; + + case SMOOTH: + if ((parseContext.isEsProfile() && parseContext.version < 300) || + (!parseContext.isEsProfile() && parseContext.version < 130)) + return identifierOrType(); + return keyword; + case FLAT: + if (parseContext.isEsProfile() && parseContext.version < 300) + reservedWord(); + else if (!parseContext.isEsProfile() && parseContext.version < 130) + return identifierOrType(); + return keyword; + case CENTROID: + if (parseContext.version < 120) + return identifierOrType(); + return keyword; + case INVARIANT: + if (!parseContext.isEsProfile() && parseContext.version < 120) + return identifierOrType(); + return keyword; + case PACKED: + if ((parseContext.isEsProfile() && parseContext.version < 300) || + (!parseContext.isEsProfile() && parseContext.version < 140)) + return reservedWord(); + return identifierOrType(); + + case RESOURCE: + { + bool reserved = (parseContext.isEsProfile() && parseContext.version >= 300) || + (!parseContext.isEsProfile() && parseContext.version >= 420); + return identifierOrReserved(reserved); + } + case SUPERP: + { + bool reserved = parseContext.isEsProfile() || parseContext.version >= 130; + return identifierOrReserved(reserved); + } + + case NOPERSPECTIVE: + if (parseContext.extensionTurnedOn(E_GL_NV_shader_noperspective_interpolation)) + return keyword; + return es30ReservedFromGLSL(130); + + case NONUNIFORM: + if (parseContext.extensionTurnedOn(E_GL_EXT_nonuniform_qualifier)) + return keyword; + else + return identifierOrType(); + case ATTRIBUTE: + case VARYING: + if (parseContext.isEsProfile() && parseContext.version >= 300) + reservedWord(); + return keyword; + case PAYLOADNV: + case PAYLOADINNV: + case HITATTRNV: + case CALLDATANV: + case CALLDATAINNV: + case ACCSTRUCTNV: + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_NV_ray_tracing)) + return keyword; + return identifierOrType(); + case ACCSTRUCTEXT: + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_ray_tracing) || + parseContext.extensionTurnedOn(E_GL_EXT_ray_query) || + parseContext.extensionTurnedOn(E_GL_NV_displacement_micromap)) + return keyword; + return identifierOrType(); + case PAYLOADEXT: + case PAYLOADINEXT: + case HITATTREXT: + case CALLDATAEXT: + case CALLDATAINEXT: + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_ray_tracing) || + parseContext.extensionTurnedOn(E_GL_EXT_ray_query)) + return keyword; + return identifierOrType(); + case RAYQUERYEXT: + if (parseContext.symbolTable.atBuiltInLevel() || + (!parseContext.isEsProfile() && parseContext.version >= 460 + && parseContext.extensionTurnedOn(E_GL_EXT_ray_query))) + return keyword; + return identifierOrType(); + case ATOMIC_UINT: + if ((parseContext.isEsProfile() && parseContext.version >= 310) || + parseContext.extensionTurnedOn(E_GL_ARB_shader_atomic_counters)) + return keyword; + return es30ReservedFromGLSL(420); + + case COHERENT: + case DEVICECOHERENT: + case QUEUEFAMILYCOHERENT: + case WORKGROUPCOHERENT: + case SUBGROUPCOHERENT: + case SHADERCALLCOHERENT: + case NONPRIVATE: + case RESTRICT: + case READONLY: + case WRITEONLY: + if (parseContext.isEsProfile() && parseContext.version >= 310) + return keyword; + return es30ReservedFromGLSL(parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store) ? 130 : 420); + case VOLATILE: + if (parseContext.isEsProfile() && parseContext.version >= 310) + return keyword; + if (! parseContext.symbolTable.atBuiltInLevel() && (parseContext.isEsProfile() || + (parseContext.version < 420 && ! parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store)))) + reservedWord(); + return keyword; + case NONTEMPORAL: + if (parseContext.symbolTable.atBuiltInLevel()) + return keyword; + if (parseContext.extensionTurnedOn(E_GL_EXT_nontemporal_keyword)) { + if (!parseContext.intermediate.usingVulkanMemoryModel()) + parseContext.warn(loc, "Nontemporal without the Vulkan Memory Model is ignored", tokenText, ""); + return keyword; + } + return identifierOrType(); + case PATCH: + if (parseContext.symbolTable.atBuiltInLevel() || + (parseContext.isEsProfile() && + (parseContext.version >= 320 || + parseContext.extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader))) || + (!parseContext.isEsProfile() && parseContext.extensionTurnedOn(E_GL_ARB_tessellation_shader))) + return keyword; + + return es30ReservedFromGLSL(400); + + case SAMPLE: + { + const int numLayoutExts = 3; + const char* layoutExts[numLayoutExts] = {E_GL_OES_shader_multisample_interpolation, E_GL_ARB_gpu_shader5, + E_GL_NV_gpu_shader5}; + if ((parseContext.isEsProfile() && parseContext.version >= 320) || + parseContext.extensionsTurnedOn(numLayoutExts, layoutExts)) + return keyword; + return es30ReservedFromGLSL(400); + } + case SUBROUTINE: + return es30ReservedFromGLSL(400); + + case SHARED: + if ((parseContext.isEsProfile() && parseContext.version < 300) || + (!parseContext.isEsProfile() && parseContext.version < 140)) + return identifierOrType(); + return keyword; + case LAYOUT: + { + const int numLayoutExts = 2; + const char* layoutExts[numLayoutExts] = { E_GL_ARB_shading_language_420pack, + E_GL_ARB_explicit_attrib_location }; + if ((parseContext.isEsProfile() && parseContext.version < 300) || + (!parseContext.isEsProfile() && parseContext.version < 140 && + ! parseContext.extensionsTurnedOn(numLayoutExts, layoutExts))) + return identifierOrType(); + return keyword; + } + + case HIGH_PRECISION: + case MEDIUM_PRECISION: + case LOW_PRECISION: + case PRECISION: + return precisionKeyword(); + + case MAT2X2: + case MAT2X3: + case MAT2X4: + case MAT3X2: + case MAT3X3: + case MAT3X4: + case MAT4X2: + case MAT4X3: + case MAT4X4: + return matNxM(); + + case DMAT2: + case DMAT3: + case DMAT4: + case DMAT2X2: + case DMAT2X3: + case DMAT2X4: + case DMAT3X2: + case DMAT3X3: + case DMAT3X4: + case DMAT4X2: + case DMAT4X3: + case DMAT4X4: + return dMat(); + + case IMAGE1D: + case IIMAGE1D: + case UIMAGE1D: + case IMAGE1DARRAY: + case IIMAGE1DARRAY: + case UIMAGE1DARRAY: + case IMAGE2DRECT: + case IIMAGE2DRECT: + case UIMAGE2DRECT: + afterType = true; + return firstGenerationImage(false); + + case I64IMAGE1D: + case U64IMAGE1D: + case I64IMAGE1DARRAY: + case U64IMAGE1DARRAY: + case I64IMAGE2DRECT: + case U64IMAGE2DRECT: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_shader_image_int64)) { + return firstGenerationImage(false); + } + return identifierOrType(); + + case IMAGEBUFFER: + case IIMAGEBUFFER: + case UIMAGEBUFFER: + afterType = true; + if ((parseContext.isEsProfile() && parseContext.version >= 320) || + parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer)) + return keyword; + return firstGenerationImage(false); + + case I64IMAGEBUFFER: + case U64IMAGEBUFFER: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_shader_image_int64)) { + if ((parseContext.isEsProfile() && parseContext.version >= 320) || + parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer)) + return keyword; + return firstGenerationImage(false); + } + return identifierOrType(); + + case IMAGE2D: + case IIMAGE2D: + case UIMAGE2D: + case IMAGE3D: + case IIMAGE3D: + case UIMAGE3D: + case IMAGECUBE: + case IIMAGECUBE: + case UIMAGECUBE: + case IMAGE2DARRAY: + case IIMAGE2DARRAY: + case UIMAGE2DARRAY: + afterType = true; + return firstGenerationImage(true); + + case I64IMAGE2D: + case U64IMAGE2D: + case I64IMAGE3D: + case U64IMAGE3D: + case I64IMAGECUBE: + case U64IMAGECUBE: + case I64IMAGE2DARRAY: + case U64IMAGE2DARRAY: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_shader_image_int64)) + return firstGenerationImage(true); + return identifierOrType(); + + case IMAGECUBEARRAY: + case IIMAGECUBEARRAY: + case UIMAGECUBEARRAY: + afterType = true; + if ((parseContext.isEsProfile() && parseContext.version >= 320) || + parseContext.extensionsTurnedOn(Num_AEP_texture_cube_map_array, AEP_texture_cube_map_array)) + return keyword; + return secondGenerationImage(); + + case I64IMAGECUBEARRAY: + case U64IMAGECUBEARRAY: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_shader_image_int64)) { + if ((parseContext.isEsProfile() && parseContext.version >= 320) || + parseContext.extensionsTurnedOn(Num_AEP_texture_cube_map_array, AEP_texture_cube_map_array)) + return keyword; + return secondGenerationImage(); + } + return identifierOrType(); + + case IMAGE2DMS: + case IIMAGE2DMS: + case UIMAGE2DMS: + case IMAGE2DMSARRAY: + case IIMAGE2DMSARRAY: + case UIMAGE2DMSARRAY: + afterType = true; + return secondGenerationImage(); + + case I64IMAGE2DMS: + case U64IMAGE2DMS: + case I64IMAGE2DMSARRAY: + case U64IMAGE2DMSARRAY: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_shader_image_int64)) { + return secondGenerationImage(); + } + return identifierOrType(); + + case DOUBLE: + case DVEC2: + case DVEC3: + case DVEC4: + afterType = true; + if (parseContext.isEsProfile() || parseContext.version < 150 || + (!parseContext.symbolTable.atBuiltInLevel() && + (parseContext.version < 400 && !parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_fp64) && + (parseContext.version < 410 && !parseContext.extensionTurnedOn(E_GL_ARB_vertex_attrib_64bit))))) + reservedWord(); + return keyword; + + case INT64_T: + case UINT64_T: + case I64VEC2: + case I64VEC3: + case I64VEC4: + case U64VEC2: + case U64VEC3: + case U64VEC4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_int64) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_NV_gpu_shader5) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int64)) + return keyword; + return identifierOrType(); + + case INT8_T: + case UINT8_T: + case I8VEC2: + case I8VEC3: + case I8VEC4: + case U8VEC2: + case U8VEC3: + case U8VEC4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_8bit_storage) || + parseContext.extensionTurnedOn(E_GL_NV_gpu_shader5) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int8)) + return keyword; + return identifierOrType(); + + case INT16_T: + case UINT16_T: + case I16VEC2: + case I16VEC3: + case I16VEC4: + case U16VEC2: + case U16VEC3: + case U16VEC4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_int16) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_16bit_storage) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_NV_gpu_shader5) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int16)) + return keyword; + return identifierOrType(); + case INT32_T: + case UINT32_T: + case I32VEC2: + case I32VEC3: + case I32VEC4: + case U32VEC2: + case U32VEC3: + case U32VEC4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_NV_gpu_shader5) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int32)) + return keyword; + return identifierOrType(); + case FLOAT32_T: + case F32VEC2: + case F32VEC3: + case F32VEC4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_NV_gpu_shader5) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float32)) + return keyword; + return identifierOrType(); + case F32MAT2: + case F32MAT3: + case F32MAT4: + case F32MAT2X2: + case F32MAT2X3: + case F32MAT2X4: + case F32MAT3X2: + case F32MAT3X3: + case F32MAT3X4: + case F32MAT4X2: + case F32MAT4X3: + case F32MAT4X4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float32)) + return keyword; + return identifierOrType(); + + case FLOAT64_T: + case F64VEC2: + case F64VEC3: + case F64VEC4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + (parseContext.extensionTurnedOn(E_GL_NV_gpu_shader5) && + parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_fp64)) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float64)) + return keyword; + return identifierOrType(); + case F64MAT2: + case F64MAT3: + case F64MAT4: + case F64MAT2X2: + case F64MAT2X3: + case F64MAT2X4: + case F64MAT3X2: + case F64MAT3X3: + case F64MAT3X4: + case F64MAT4X2: + case F64MAT4X3: + case F64MAT4X4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float64)) + return keyword; + return identifierOrType(); + + case FLOAT16_T: + case F16VEC2: + case F16VEC3: + case F16VEC4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_16bit_storage) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_NV_gpu_shader5) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float16)) + return keyword; + + return identifierOrType(); + + case F16MAT2: + case F16MAT3: + case F16MAT4: + case F16MAT2X2: + case F16MAT2X3: + case F16MAT2X4: + case F16MAT3X2: + case F16MAT3X3: + case F16MAT3X4: + case F16MAT4X2: + case F16MAT4X3: + case F16MAT4X4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float16)) + return keyword; + + return identifierOrType(); + + case BFLOAT16_T: + case BF16VEC2: + case BF16VEC3: + case BF16VEC4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_bfloat16)) + return keyword; + + return identifierOrType(); + + case FLOATE5M2_T: + case FE5M2VEC2: + case FE5M2VEC3: + case FE5M2VEC4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_float_e5m2)) + return keyword; + + return identifierOrType(); + + case FLOATE4M3_T: + case FE4M3VEC2: + case FE4M3VEC3: + case FE4M3VEC4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_float_e4m3)) + return keyword; + + return identifierOrType(); + + case SAMPLERCUBEARRAY: + case SAMPLERCUBEARRAYSHADOW: + case ISAMPLERCUBEARRAY: + case USAMPLERCUBEARRAY: + afterType = true; + if ((parseContext.isEsProfile() && parseContext.version >= 320) || + parseContext.extensionsTurnedOn(Num_AEP_texture_cube_map_array, AEP_texture_cube_map_array)) + return keyword; + if (parseContext.isEsProfile() || (parseContext.version < 400 && + ! parseContext.extensionTurnedOn(E_GL_ARB_texture_cube_map_array) + && ! parseContext.extensionsTurnedOn(Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5))) + reservedWord(); + return keyword; + + case TEXTURECUBEARRAY: + case ITEXTURECUBEARRAY: + case UTEXTURECUBEARRAY: + if (parseContext.spvVersion.vulkan > 0) + return keyword; + else + return identifierOrType(); + + case UINT: + case UVEC2: + case UVEC3: + case UVEC4: + case SAMPLERCUBESHADOW: + case SAMPLER2DARRAY: + case SAMPLER2DARRAYSHADOW: + case ISAMPLER2D: + case ISAMPLER3D: + case ISAMPLERCUBE: + case ISAMPLER2DARRAY: + case USAMPLER2D: + case USAMPLER3D: + case USAMPLERCUBE: + case USAMPLER2DARRAY: + afterType = true; + if (keyword == SAMPLER2DARRAY || keyword == SAMPLER2DARRAYSHADOW) { + if (!parseContext.isEsProfile() && + (parseContext.extensionTurnedOn(E_GL_EXT_texture_array) || parseContext.symbolTable.atBuiltInLevel())) { + return keyword; + } + } + return nonreservedKeyword(300, 130); + + case SAMPLER3D: + afterType = true; + if (parseContext.isEsProfile() && parseContext.version < 300) { + if (!parseContext.extensionTurnedOn(E_GL_OES_texture_3D)) + reservedWord(); + } + return keyword; + + case SAMPLER2DSHADOW: + afterType = true; + if (parseContext.isEsProfile() && parseContext.version < 300) { + if (!parseContext.extensionTurnedOn(E_GL_EXT_shadow_samplers)) + reservedWord(); + } + return keyword; + + case TEXTURE2D: + case TEXTURECUBE: + case TEXTURE2DARRAY: + case ITEXTURE2D: + case ITEXTURE3D: + case ITEXTURECUBE: + case ITEXTURE2DARRAY: + case UTEXTURE2D: + case UTEXTURE3D: + case UTEXTURECUBE: + case UTEXTURE2DARRAY: + case TEXTURE3D: + case SAMPLER: + case SAMPLERSHADOW: + if (parseContext.spvVersion.vulkan > 0) + return keyword; + else + return identifierOrType(); + + case ISAMPLER1D: + case ISAMPLER1DARRAY: + case SAMPLER1DARRAYSHADOW: + case USAMPLER1D: + case USAMPLER1DARRAY: + afterType = true; + if (keyword == SAMPLER1DARRAYSHADOW) { + if (!parseContext.isEsProfile() && + (parseContext.extensionTurnedOn(E_GL_EXT_texture_array) || parseContext.symbolTable.atBuiltInLevel())) { + return keyword; + } + } + return es30ReservedFromGLSL(130); + case ISAMPLER2DRECT: + case USAMPLER2DRECT: + afterType = true; + return es30ReservedFromGLSL(140); + + case SAMPLERBUFFER: + afterType = true; + if ((parseContext.isEsProfile() && parseContext.version >= 320) || + parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer)) + return keyword; + return es30ReservedFromGLSL(130); + + case ISAMPLERBUFFER: + case USAMPLERBUFFER: + afterType = true; + if ((parseContext.isEsProfile() && parseContext.version >= 320) || + parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer)) + return keyword; + return es30ReservedFromGLSL(140); + + case SAMPLER2DMS: + case ISAMPLER2DMS: + case USAMPLER2DMS: + afterType = true; + if (parseContext.isEsProfile() && parseContext.version >= 310) + return keyword; + if (!parseContext.isEsProfile() && (parseContext.version > 140 || + (parseContext.version == 140 && parseContext.extensionsTurnedOn(1, &E_GL_ARB_texture_multisample)))) + return keyword; + return es30ReservedFromGLSL(150); + + case SAMPLER2DMSARRAY: + case ISAMPLER2DMSARRAY: + case USAMPLER2DMSARRAY: + afterType = true; + if ((parseContext.isEsProfile() && parseContext.version >= 320) || + parseContext.extensionsTurnedOn(1, &E_GL_OES_texture_storage_multisample_2d_array)) + return keyword; + if (!parseContext.isEsProfile() && (parseContext.version > 140 || + (parseContext.version == 140 && parseContext.extensionsTurnedOn(1, &E_GL_ARB_texture_multisample)))) + return keyword; + return es30ReservedFromGLSL(150); + + case SAMPLER1D: + case SAMPLER1DSHADOW: + afterType = true; + if (parseContext.isEsProfile()) + reservedWord(); + return keyword; + + case SAMPLER2DRECT: + case SAMPLER2DRECTSHADOW: + afterType = true; + if (parseContext.isEsProfile()) + reservedWord(); + else if (parseContext.version < 140 && ! parseContext.symbolTable.atBuiltInLevel() && ! parseContext.extensionTurnedOn(E_GL_ARB_texture_rectangle)) { + if (parseContext.relaxedErrors()) + parseContext.requireExtensions(loc, 1, &E_GL_ARB_texture_rectangle, "texture-rectangle sampler keyword"); + else + reservedWord(); + } + return keyword; + + case SAMPLER1DARRAY: + afterType = true; + if (parseContext.isEsProfile() && parseContext.version == 300) + reservedWord(); + else if ((parseContext.isEsProfile() && parseContext.version < 300) || + ((!parseContext.isEsProfile() && parseContext.version < 130) && + !parseContext.symbolTable.atBuiltInLevel() && + !parseContext.extensionTurnedOn(E_GL_EXT_texture_array))) + return identifierOrType(); + return keyword; + + case SAMPLEREXTERNALOES: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_OES_EGL_image_external) || + parseContext.extensionTurnedOn(E_GL_OES_EGL_image_external_essl3)) + return keyword; + return identifierOrType(); + + case SAMPLEREXTERNAL2DY2YEXT: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_YUV_target)) + return keyword; + return identifierOrType(); + + case ITEXTURE1DARRAY: + case UTEXTURE1D: + case ITEXTURE1D: + case UTEXTURE1DARRAY: + case TEXTUREBUFFER: + case ITEXTURE2DRECT: + case UTEXTURE2DRECT: + case ITEXTUREBUFFER: + case UTEXTUREBUFFER: + case TEXTURE2DMS: + case ITEXTURE2DMS: + case UTEXTURE2DMS: + case TEXTURE2DMSARRAY: + case ITEXTURE2DMSARRAY: + case UTEXTURE2DMSARRAY: + case TEXTURE1D: + case TEXTURE2DRECT: + case TEXTURE1DARRAY: + if (parseContext.spvVersion.vulkan > 0) + return keyword; + else + return identifierOrType(); + + case SUBPASSINPUT: + case SUBPASSINPUTMS: + case ISUBPASSINPUT: + case ISUBPASSINPUTMS: + case USUBPASSINPUT: + case USUBPASSINPUTMS: + case ATTACHMENTEXT: + case IATTACHMENTEXT: + case UATTACHMENTEXT: + if (parseContext.spvVersion.vulkan > 0) + return keyword; + else + return identifierOrType(); + + case F16SAMPLER1D: + case F16SAMPLER2D: + case F16SAMPLER3D: + case F16SAMPLER2DRECT: + case F16SAMPLERCUBE: + case F16SAMPLER1DARRAY: + case F16SAMPLER2DARRAY: + case F16SAMPLERCUBEARRAY: + case F16SAMPLERBUFFER: + case F16SAMPLER2DMS: + case F16SAMPLER2DMSARRAY: + case F16SAMPLER1DSHADOW: + case F16SAMPLER2DSHADOW: + case F16SAMPLER1DARRAYSHADOW: + case F16SAMPLER2DARRAYSHADOW: + case F16SAMPLER2DRECTSHADOW: + case F16SAMPLERCUBESHADOW: + case F16SAMPLERCUBEARRAYSHADOW: + + case F16IMAGE1D: + case F16IMAGE2D: + case F16IMAGE3D: + case F16IMAGE2DRECT: + case F16IMAGECUBE: + case F16IMAGE1DARRAY: + case F16IMAGE2DARRAY: + case F16IMAGECUBEARRAY: + case F16IMAGEBUFFER: + case F16IMAGE2DMS: + case F16IMAGE2DMSARRAY: + + case F16TEXTURE1D: + case F16TEXTURE2D: + case F16TEXTURE3D: + case F16TEXTURE2DRECT: + case F16TEXTURECUBE: + case F16TEXTURE1DARRAY: + case F16TEXTURE2DARRAY: + case F16TEXTURECUBEARRAY: + case F16TEXTUREBUFFER: + case F16TEXTURE2DMS: + case F16TEXTURE2DMSARRAY: + + case F16SUBPASSINPUT: + case F16SUBPASSINPUTMS: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float_fetch)) + return keyword; + return identifierOrType(); + + case EXPLICITINTERPAMD: + if (parseContext.extensionTurnedOn(E_GL_AMD_shader_explicit_vertex_parameter)) + return keyword; + return identifierOrType(); + + case PERVERTEXNV: + if ((!parseContext.isEsProfile() && parseContext.version >= 450) || + parseContext.extensionTurnedOn(E_GL_NV_fragment_shader_barycentric)) + return keyword; + return identifierOrType(); + + case PERVERTEXEXT: + if ((!parseContext.isEsProfile() && parseContext.version >= 450) || + parseContext.extensionTurnedOn(E_GL_EXT_fragment_shader_barycentric)) + return keyword; + return identifierOrType(); + + case PRECISE: + if ((parseContext.isEsProfile() && + (parseContext.version >= 320 || parseContext.extensionsTurnedOn(Num_AEP_gpu_shader5, AEP_gpu_shader5))) || + (!parseContext.isEsProfile() && + (parseContext.version >= 400 + || parseContext.extensionsTurnedOn(Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5)))) + return keyword; + if (parseContext.isEsProfile() && parseContext.version == 310) { + reservedWord(); + return keyword; + } + return identifierOrType(); + + case PERPRIMITIVENV: + case PERVIEWNV: + case PERTASKNV: + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_NV_mesh_shader)) + return keyword; + return identifierOrType(); + + case PERPRIMITIVEEXT: + case TASKPAYLOADWORKGROUPEXT: + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_mesh_shader)) + return keyword; + return identifierOrType(); + + case FCOOPMATNV: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_NV_cooperative_matrix)) + return keyword; + return identifierOrType(); + + case UCOOPMATNV: + case ICOOPMATNV: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_NV_integer_cooperative_matrix)) + return keyword; + return identifierOrType(); + case TENSORARM: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_ARM_tensors)) + return keyword; + return identifierOrType(); + + case COOPMAT: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_KHR_cooperative_matrix)) + return keyword; + return identifierOrType(); + + case COOPVECNV: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_NV_cooperative_vector)) + return keyword; + return identifierOrType(); + + case DEMOTE: + if (parseContext.extensionTurnedOn(E_GL_EXT_demote_to_helper_invocation)) + return keyword; + else + return identifierOrType(); + + case SPIRV_INSTRUCTION: + case SPIRV_EXECUTION_MODE: + case SPIRV_EXECUTION_MODE_ID: + case SPIRV_DECORATE: + case SPIRV_DECORATE_ID: + case SPIRV_DECORATE_STRING: + case SPIRV_TYPE: + case SPIRV_STORAGE_CLASS: + case SPIRV_BY_REFERENCE: + case SPIRV_LITERAL: + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) + return keyword; + return identifierOrType(); + + case HITOBJECTNV: + if (parseContext.symbolTable.atBuiltInLevel() || + (!parseContext.isEsProfile() && parseContext.version >= 460 + && parseContext.extensionTurnedOn(E_GL_NV_shader_invocation_reorder))) + return keyword; + return identifierOrType(); + + case HITOBJECTEXT: + if (parseContext.symbolTable.atBuiltInLevel() || + (!parseContext.isEsProfile() && parseContext.version >= 460 + && parseContext.extensionTurnedOn(E_GL_EXT_shader_invocation_reorder))) + return keyword; + return identifierOrType(); + + case HITOBJECTATTRNV: + if (parseContext.symbolTable.atBuiltInLevel() || + (!parseContext.isEsProfile() && parseContext.version >= 460 + && parseContext.extensionTurnedOn(E_GL_NV_shader_invocation_reorder))) + return keyword; + return identifierOrType(); + + case HITOBJECTATTREXT: + if (parseContext.symbolTable.atBuiltInLevel() || + (!parseContext.isEsProfile() && parseContext.version >= 460 + && parseContext.extensionTurnedOn(E_GL_EXT_shader_invocation_reorder))) + return keyword; + return identifierOrType(); + + case FUNCTION: + case TENSORLAYOUTNV: + case TENSORVIEWNV: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_NV_cooperative_matrix2)) + return keyword; + return identifierOrType(); + + default: + parseContext.infoSink.info.message(EPrefixInternalError, "Unknown glslang keyword", loc); + return 0; + } +} + +int TScanContext::identifierOrType() +{ + parserToken->sType.lex.string = NewPoolTString(tokenText); + if (field) + return IDENTIFIER; + + // If we see an identifier right after a type, this might be a declarator. + // But not in template parameters (inside angle brackets), array expressions (inside square brackets), + // or function parameters (inside parentheses) + if (afterType && angleBracketDepth == 0 && squareBracketDepth == 0 && parenDepth == 0) { + afterDeclarator = true; + afterType = false; + return IDENTIFIER; + } + + parserToken->sType.lex.symbol = parseContext.symbolTable.find(*parserToken->sType.lex.string); + if ((afterType == false && afterStruct == false) && parserToken->sType.lex.symbol != nullptr) { + if (const TVariable* variable = parserToken->sType.lex.symbol->getAsVariable()) { + if (variable->isUserType() && + // treat redeclaration of forward-declared buffer/uniform reference as an identifier + !(variable->getType().isReference() && afterBuffer)) { + + // If we're in a declarator list (like "float a, B;"), treat struct names as IDENTIFIER + // to fix GitHub issue #3931 + if (inDeclaratorList) { + return IDENTIFIER; + } + + afterType = true; + return TYPE_NAME; + } + } + } + + return IDENTIFIER; +} + +// Give an error for use of a reserved symbol. +// However, allow built-in declarations to use reserved words, to allow +// extension support before the extension is enabled. +int TScanContext::reservedWord() +{ + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.error(loc, "Reserved word.", tokenText, "", ""); + + return 0; +} + +int TScanContext::identifierOrReserved(bool reserved) +{ + if (reserved) { + reservedWord(); + + return 0; + } + + if (parseContext.isForwardCompatible()) + parseContext.warn(loc, "using future reserved keyword", tokenText, ""); + + return identifierOrType(); +} + +// For keywords that suddenly showed up on non-ES (not previously reserved) +// but then got reserved by ES 3.0. +int TScanContext::es30ReservedFromGLSL(int version) +{ + if (parseContext.symbolTable.atBuiltInLevel()) + return keyword; + + if ((parseContext.isEsProfile() && parseContext.version < 300) || + (!parseContext.isEsProfile() && parseContext.version < version)) { + if (parseContext.isForwardCompatible()) + parseContext.warn(loc, "future reserved word in ES 300 and keyword in GLSL", tokenText, ""); + + return identifierOrType(); + } else if (parseContext.isEsProfile() && parseContext.version >= 300) + reservedWord(); + + return keyword; +} + +// For a keyword that was never reserved, until it suddenly +// showed up, both in an es version and a non-ES version. +int TScanContext::nonreservedKeyword(int esVersion, int nonEsVersion) +{ + if ((parseContext.isEsProfile() && parseContext.version < esVersion) || + (!parseContext.isEsProfile() && parseContext.version < nonEsVersion)) { + if (parseContext.isForwardCompatible()) + parseContext.warn(loc, "using future keyword", tokenText, ""); + + return identifierOrType(); + } + + return keyword; +} + +int TScanContext::precisionKeyword() +{ + if (parseContext.isEsProfile() || parseContext.version >= 130) + return keyword; + + if (parseContext.isForwardCompatible()) + parseContext.warn(loc, "using ES precision qualifier keyword", tokenText, ""); + + return identifierOrType(); +} + +int TScanContext::matNxM() +{ + afterType = true; + + if (parseContext.version > 110) + return keyword; + + if (parseContext.isForwardCompatible()) + parseContext.warn(loc, "using future non-square matrix type keyword", tokenText, ""); + + return identifierOrType(); +} + +int TScanContext::dMat() +{ + afterType = true; + + if (parseContext.isEsProfile() && parseContext.version >= 300) { + reservedWord(); + + return keyword; + } + + if (!parseContext.isEsProfile() && (parseContext.version >= 400 || + parseContext.symbolTable.atBuiltInLevel() || + (parseContext.version >= 150 && parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_fp64)) || + (parseContext.version >= 150 && parseContext.extensionTurnedOn(E_GL_ARB_vertex_attrib_64bit) + && parseContext.language == EShLangVertex))) + return keyword; + + if (parseContext.isForwardCompatible()) + parseContext.warn(loc, "using future type keyword", tokenText, ""); + + return identifierOrType(); +} + +int TScanContext::firstGenerationImage(bool inEs310) +{ + if (parseContext.symbolTable.atBuiltInLevel() || + (!parseContext.isEsProfile() && (parseContext.version >= 420 || + parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store))) || + (inEs310 && parseContext.isEsProfile() && parseContext.version >= 310)) + return keyword; + + if ((parseContext.isEsProfile() && parseContext.version >= 300) || + (!parseContext.isEsProfile() && parseContext.version >= 130)) { + reservedWord(); + + return keyword; + } + + if (parseContext.isForwardCompatible()) + parseContext.warn(loc, "using future type keyword", tokenText, ""); + + return identifierOrType(); +} + +int TScanContext::secondGenerationImage() +{ + if (parseContext.isEsProfile() && parseContext.version >= 310) { + reservedWord(); + return keyword; + } + + if (parseContext.symbolTable.atBuiltInLevel() || + (!parseContext.isEsProfile() && + (parseContext.version >= 420 || parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store)))) + return keyword; + + if (parseContext.isForwardCompatible()) + parseContext.warn(loc, "using future type keyword", tokenText, ""); + + return identifierOrType(); +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Scan.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Scan.h new file mode 100644 index 0000000000..44be90510c --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Scan.h @@ -0,0 +1,278 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +#ifndef _GLSLANG_SCAN_INCLUDED_ +#define _GLSLANG_SCAN_INCLUDED_ + +#include "Versions.h" + +namespace QtShaderTools { +namespace glslang { + +// Use a global end-of-input character, so no translation is needed across +// layers of encapsulation. Characters are all 8 bit, and positive, so there is +// no aliasing of character 255 onto -1, for example. +const int EndOfInput = -1; + +// +// A character scanner that seamlessly, on read-only strings, reads across an +// array of strings without assuming null termination. +// +class TInputScanner { +public: + TInputScanner(int n, const char* const s[], size_t L[], const char* const* names = nullptr, + int b = 0, int f = 0, bool single = false) : + numSources(n), + // up to this point, common usage is "char*", but now we need positive 8-bit characters + sources(reinterpret_cast(s)), + lengths(L), currentSource(0), currentChar(0), stringBias(b), finale(f), singleLogical(single), + endOfFileReached(false) + { + loc = new TSourceLoc[numSources]; + for (int i = 0; i < numSources; ++i) { + loc[i].init(i - stringBias); + } + if (names != nullptr) { + for (int i = 0; i < numSources; ++i) + loc[i].name = names[i] != nullptr ? NewPoolTString(names[i]) : nullptr; + } + loc[currentSource].line = 1; + logicalSourceLoc.init(1); + logicalSourceLoc.name = loc[0].name; + } + + virtual ~TInputScanner() + { + delete [] loc; + } + + // retrieve the next character and advance one character + int get() + { + int ret = peek(); + if (ret == EndOfInput) + return ret; + ++loc[currentSource].column; + ++logicalSourceLoc.column; + if (ret == '\n') { + ++loc[currentSource].line; + ++logicalSourceLoc.line; + logicalSourceLoc.column = 0; + loc[currentSource].column = 0; + } + advance(); + + return ret; + } + + // retrieve the next character, no advance + int peek() + { + if (currentSource >= numSources) { + endOfFileReached = true; + return EndOfInput; + } + // Make sure we do not read off the end of a string. + // N.B. Sources can have a length of 0. + int sourceToRead = currentSource; + size_t charToRead = currentChar; + while(charToRead >= lengths[sourceToRead]) { + charToRead = 0; + sourceToRead += 1; + if (sourceToRead >= numSources) { + return EndOfInput; + } + } + + // Here, we care about making negative valued characters positive + return sources[sourceToRead][charToRead]; + } + + // go back one character + void unget() + { + // Do not roll back once we've reached the end of the file. + if (endOfFileReached) + return; + + if (currentChar > 0) { + --currentChar; + --loc[currentSource].column; + --logicalSourceLoc.column; + if (loc[currentSource].column < 0) { + // We've moved back past a new line. Find the + // previous newline (or start of the file) to compute + // the column count on the now current line. + size_t chIndex = currentChar; + while (chIndex > 0) { + if (sources[currentSource][chIndex] == '\n') { + break; + } + --chIndex; + } + logicalSourceLoc.column = (int)(currentChar - chIndex); + loc[currentSource].column = (int)(currentChar - chIndex); + } + } else { + do { + --currentSource; + } while (currentSource > 0 && lengths[currentSource] == 0); + if (lengths[currentSource] == 0) { + // set to 0 if we've backed up to the start of an empty string + currentChar = 0; + } else + currentChar = lengths[currentSource] - 1; + } + if (peek() == '\n') { + --loc[currentSource].line; + --logicalSourceLoc.line; + } + } + + // for #line override + void setLine(int newLine) + { + logicalSourceLoc.line = newLine; + loc[getLastValidSourceIndex()].line = newLine; + } + + // for #line override in filename based parsing + void setFile(const char* filename) + { + TString* fn_tstr = NewPoolTString(filename); + logicalSourceLoc.name = fn_tstr; + loc[getLastValidSourceIndex()].name = fn_tstr; + } + + void setFile(const char* filename, int i) + { + TString* fn_tstr = NewPoolTString(filename); + if (i == getLastValidSourceIndex()) { + logicalSourceLoc.name = fn_tstr; + } + loc[i].name = fn_tstr; + } + + void setString(int newString) + { + logicalSourceLoc.string = newString; + loc[getLastValidSourceIndex()].string = newString; + logicalSourceLoc.name = nullptr; + loc[getLastValidSourceIndex()].name = nullptr; + } + + // for #include content indentation + void setColumn(int col) + { + logicalSourceLoc.column = col; + loc[getLastValidSourceIndex()].column = col; + } + + void setEndOfInput() + { + endOfFileReached = true; + currentSource = numSources; + } + + bool atEndOfInput() const { return endOfFileReached; } + + const TSourceLoc& getSourceLoc() const + { + if (singleLogical) { + return logicalSourceLoc; + } else { + return loc[std::max(0, std::min(currentSource, numSources - finale - 1))]; + } + } + // Returns the index (starting from 0) of the most recent valid source string we are reading from. + int getLastValidSourceIndex() const { return std::min(currentSource, numSources - 1); } + + void consumeWhiteSpace(bool& foundNonSpaceTab); + bool consumeComment(); + void consumeWhitespaceComment(bool& foundNonSpaceTab); + bool scanVersion(int& version, EProfile& profile, bool& notFirstToken); + +protected: + + // advance one character + void advance() + { + ++currentChar; + if (currentChar >= lengths[currentSource]) { + ++currentSource; + if (currentSource < numSources) { + loc[currentSource].string = loc[currentSource - 1].string + 1; + loc[currentSource].line = 1; + loc[currentSource].column = 0; + } + while (currentSource < numSources && lengths[currentSource] == 0) { + ++currentSource; + if (currentSource < numSources) { + loc[currentSource].string = loc[currentSource - 1].string + 1; + loc[currentSource].line = 1; + loc[currentSource].column = 0; + } + } + currentChar = 0; + } + } + + int numSources; // number of strings in source + const unsigned char* const *sources; // array of strings; must be converted to positive values on use, to avoid aliasing with -1 as EndOfInput + const size_t *lengths; // length of each string + int currentSource; + size_t currentChar; + + // This is for reporting what string/line an error occurred on, and can be overridden by #line. + // It remembers the last state of each source string as it is left for the next one, so unget() + // can restore that state. + TSourceLoc* loc; // an array + + int stringBias; // the first string that is the user's string number 0 + int finale; // number of internal strings after user's last string + + TSourceLoc logicalSourceLoc; + bool singleLogical; // treats the strings as a single logical string. + // locations will be reported from the first string. + + // Set to true once peek() returns EndOfFile, so that we won't roll back + // once we've reached EndOfFile. + bool endOfFileReached; +}; + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // _GLSLANG_SCAN_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/ScanContext.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/ScanContext.h new file mode 100644 index 0000000000..277b46b50c --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/ScanContext.h @@ -0,0 +1,100 @@ +// +// Copyright (C) 2013 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// This holds context specific to the GLSL scanner, which +// sits between the preprocessor scanner and parser. +// + +#pragma once + +#include "ParseHelper.h" + +namespace QtShaderTools { +namespace glslang { + +class TPpContext; +class TPpToken; +class TParserToken; + +class TScanContext { +public: + explicit TScanContext(TParseContextBase& pc) : + parseContext(pc), + afterType(false), afterStruct(false), + field(false), afterBuffer(false), inDeclaratorList(false), afterDeclarator(false), angleBracketDepth(0), squareBracketDepth(0), parenDepth(0) { } + virtual ~TScanContext() { } + + static void fillInKeywordMap(); + static void deleteKeywordMap(); + + int tokenize(TPpContext*, TParserToken&); + +protected: + TScanContext(TScanContext&); + TScanContext& operator=(TScanContext&); + + int tokenizeIdentifier(); + int identifierOrType(); + int reservedWord(); + int identifierOrReserved(bool reserved); + int es30ReservedFromGLSL(int version); + int nonreservedKeyword(int esVersion, int nonEsVersion); + int precisionKeyword(); + int matNxM(); + int dMat(); + int firstGenerationImage(bool inEs310); + int secondGenerationImage(); + + TParseContextBase& parseContext; + bool afterType; // true if we've recognized a type, so can only be looking for an identifier + bool afterStruct; // true if we've recognized the STRUCT keyword, so can only be looking for an identifier + bool field; // true if we're on a field, right after a '.' + bool afterBuffer; // true if we've recognized the BUFFER keyword + bool inDeclaratorList; // true if we detected we're in a declarator list like "float a, b;" + bool afterDeclarator; // true if we just saw an identifier after a type (potential declarator) + int angleBracketDepth; // track nesting level of < > to detect template parameters + int squareBracketDepth; // track nesting level of [ ] to detect array expressions + int parenDepth; // track nesting level of ( ) to detect function parameters + TSourceLoc loc; + TParserToken* parserToken; + TPpToken* ppToken; + + const char* tokenText; + int keyword; +}; + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp new file mode 100644 index 0000000000..78725c96da --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp @@ -0,0 +1,2259 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013-2016 LunarG, Inc. +// Copyright (C) 2015-2020 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// Implement the top-level of interface to the compiler/linker, +// as defined in ShaderLang.h +// This is the platform independent interface between an OGL driver +// and the shading language compiler/linker. +// +#include +#include +#include +#include +#include +#include "SymbolTable.h" +#include "ParseHelper.h" +#include "Scan.h" +#include "ScanContext.h" + +#ifdef ENABLE_HLSL +#include "../HLSL/hlslParseHelper.h" +#include "../HLSL/hlslParseables.h" +#include "../HLSL/hlslScanContext.h" +#endif + +#include "../Include/ShHandle.h" + +#include "preprocessor/PpContext.h" + +#define SH_EXPORTING +#include "../Public/ShaderLang.h" +#include "reflection.h" +#include "iomapper.h" +#include "Initialize.h" + +// TODO: this really shouldn't be here, it is only because of the trial addition +// of printing pre-processed tokens, which requires knowing the string literal +// token to print ", but none of that seems appropriate for this file. +#include "preprocessor/PpTokens.h" + +// Build-time generated includes +#include "glslang/build_info.h" + +namespace { // anonymous namespace for file-local functions and symbols + +// Total number of successful initializers of glslang: a refcount +// Shared global; access should be protected by a global mutex/critical section. +int NumberOfClients = 0; + +// global initialization lock +#ifndef DISABLE_THREAD_SUPPORT +std::mutex init_lock; +#endif + + +using namespace QtShaderTools; +using namespace glslang; + +// Create a language specific version of parseables. +TBuiltInParseables* CreateBuiltInParseables(TInfoSink& infoSink, EShSource source) +{ + switch (source) { + case EShSourceGlsl: return new TBuiltIns(); // GLSL builtIns +#ifdef ENABLE_HLSL + case EShSourceHlsl: return new TBuiltInParseablesHlsl(); // HLSL intrinsics +#endif + + default: + infoSink.info.message(EPrefixInternalError, "Unable to determine source language"); + return nullptr; + } +} + +// Create a language specific version of a parse context. +TParseContextBase* CreateParseContext(TSymbolTable& symbolTable, TIntermediate& intermediate, + int version, EProfile profile, EShSource source, + EShLanguage language, TInfoSink& infoSink, + SpvVersion spvVersion, bool forwardCompatible, EShMessages messages, + bool parsingBuiltIns, std::string sourceEntryPointName = "") +{ + switch (source) { + case EShSourceGlsl: { + if (sourceEntryPointName.size() == 0) + intermediate.setEntryPointName("main"); + TString entryPoint = sourceEntryPointName.c_str(); + return new TParseContext(symbolTable, intermediate, parsingBuiltIns, version, profile, spvVersion, + language, infoSink, forwardCompatible, messages, &entryPoint); + } +#ifdef ENABLE_HLSL + case EShSourceHlsl: + return new HlslParseContext(symbolTable, intermediate, parsingBuiltIns, version, profile, spvVersion, + language, infoSink, sourceEntryPointName.c_str(), forwardCompatible, messages); +#endif + default: + infoSink.info.message(EPrefixInternalError, "Unable to determine source language"); + return nullptr; + } +} + +// Local mapping functions for making arrays of symbol tables.... + +const int VersionCount = 17; // index range in MapVersionToIndex + +int MapVersionToIndex(int version) +{ + int index = 0; + + switch (version) { + case 100: index = 0; break; + case 110: index = 1; break; + case 120: index = 2; break; + case 130: index = 3; break; + case 140: index = 4; break; + case 150: index = 5; break; + case 300: index = 6; break; + case 330: index = 7; break; + case 400: index = 8; break; + case 410: index = 9; break; + case 420: index = 10; break; + case 430: index = 11; break; + case 440: index = 12; break; + case 310: index = 13; break; + case 450: index = 14; break; + case 500: index = 0; break; // HLSL + case 320: index = 15; break; + case 460: index = 16; break; + default: assert(0); break; + } + + assert(index < VersionCount); + + return index; +} + +const int SpvVersionCount = 4; // index range in MapSpvVersionToIndex + +int MapSpvVersionToIndex(const SpvVersion& spvVersion) +{ + int index = 0; + + if (spvVersion.openGl > 0) + index = 1; + else if (spvVersion.vulkan > 0) { + if (!spvVersion.vulkanRelaxed) + index = 2; + else + index = 3; + } + + assert(index < SpvVersionCount); + + return index; +} + +const int ProfileCount = 4; // index range in MapProfileToIndex + +int MapProfileToIndex(EProfile profile) +{ + int index = 0; + + switch (profile) { + case ENoProfile: index = 0; break; + case ECoreProfile: index = 1; break; + case ECompatibilityProfile: index = 2; break; + case EEsProfile: index = 3; break; + default: break; + } + + assert(index < ProfileCount); + + return index; +} + +const int SourceCount = 2; + +int MapSourceToIndex(EShSource source) +{ + int index = 0; + + switch (source) { + case EShSourceGlsl: index = 0; break; + case EShSourceHlsl: index = 1; break; + default: break; + } + + assert(index < SourceCount); + + return index; +} + +// only one of these needed for non-ES; ES needs 2 for different precision defaults of built-ins +enum EPrecisionClass { + EPcGeneral, + EPcFragment, + EPcCount +}; + +// A process-global symbol table per version per profile for built-ins common +// to multiple stages (languages), and a process-global symbol table per version +// per profile per stage for built-ins unique to each stage. They will be sparsely +// populated, so they will only be generated as needed. +// +// Each has a different set of built-ins, and we want to preserve that from +// compile to compile. +// +TSymbolTable* CommonSymbolTable[VersionCount][SpvVersionCount][ProfileCount][SourceCount][EPcCount] = {}; +TSymbolTable* SharedSymbolTables[VersionCount][SpvVersionCount][ProfileCount][SourceCount][EShLangCount] = {}; + +TPoolAllocator* PerProcessGPA = nullptr; + +// +// Parse and add to the given symbol table the content of the given shader string. +// +bool InitializeSymbolTable(const TString& builtIns, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, + EShSource source, TInfoSink& infoSink, TSymbolTable& symbolTable) +{ + TIntermediate intermediate(language, version, profile); + + intermediate.setSource(source); + + std::unique_ptr parseContext(CreateParseContext(symbolTable, intermediate, version, profile, source, + language, infoSink, spvVersion, true, EShMsgDefault, + true)); + + TShader::ForbidIncluder includer; + TPpContext ppContext(*parseContext, "", includer); + TScanContext scanContext(*parseContext); + parseContext->setScanContext(&scanContext); + parseContext->setPpContext(&ppContext); + + // + // Push the symbol table to give it an initial scope. This + // push should not have a corresponding pop, so that built-ins + // are preserved, and the test for an empty table fails. + // + + symbolTable.push(); + + const char* builtInShaders[2]; + size_t builtInLengths[2]; + builtInShaders[0] = builtIns.c_str(); + builtInLengths[0] = builtIns.size(); + + if (builtInLengths[0] == 0) + return true; + + TInputScanner input(1, builtInShaders, builtInLengths); + if (! parseContext->parseShaderStrings(ppContext, input) != 0) { + infoSink.info.message(EPrefixInternalError, "Unable to parse built-ins"); + printf("Unable to parse built-ins\n%s\n", infoSink.info.c_str()); + printf("%s\n", builtInShaders[0]); + + return false; + } + + return true; +} + +int CommonIndex(EProfile profile, EShLanguage language) +{ + return (profile == EEsProfile && language == EShLangFragment) ? EPcFragment : EPcGeneral; +} + +// +// To initialize per-stage shared tables, with the common table already complete. +// +bool InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int version, EProfile profile, const SpvVersion& spvVersion, + EShLanguage language, EShSource source, TInfoSink& infoSink, TSymbolTable** commonTable, + TSymbolTable** symbolTables) +{ + (*symbolTables[language]).adoptLevels(*commonTable[CommonIndex(profile, language)]); + if (!InitializeSymbolTable(builtInParseables.getStageString(language), version, profile, spvVersion, language, source, + infoSink, *symbolTables[language])) + return false; + builtInParseables.identifyBuiltIns(version, profile, spvVersion, language, *symbolTables[language]); + if (profile == EEsProfile && version >= 300) + (*symbolTables[language]).setNoBuiltInRedeclarations(); + if (version == 110) + (*symbolTables[language]).setSeparateNameSpaces(); + + return true; +} + +// +// Initialize the full set of shareable symbol tables; +// The common (cross-stage) and those shareable per-stage. +// +bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile, const SpvVersion& spvVersion, EShSource source) +{ + bool success = true; + std::unique_ptr builtInParseables(CreateBuiltInParseables(infoSink, source)); + + if (builtInParseables == nullptr) + return false; + + builtInParseables->initialize(version, profile, spvVersion); + + // do the common tables + success &= InitializeSymbolTable(builtInParseables->getCommonString(), version, profile, spvVersion, EShLangVertex, source, + infoSink, *commonTable[EPcGeneral]); + if (profile == EEsProfile) + success &= InitializeSymbolTable(builtInParseables->getCommonString(), version, profile, spvVersion, EShLangFragment, source, + infoSink, *commonTable[EPcFragment]); + + // do the per-stage tables + + // always have vertex and fragment + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangVertex, source, + infoSink, commonTable, symbolTables); + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangFragment, source, + infoSink, commonTable, symbolTables); + + // check for tessellation + if ((profile != EEsProfile && version >= 150) || + (profile == EEsProfile && version >= 310)) { + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTessControl, source, + infoSink, commonTable, symbolTables); + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTessEvaluation, source, + infoSink, commonTable, symbolTables); + } + + // check for geometry + if ((profile != EEsProfile && version >= 150) || + (profile == EEsProfile && version >= 310)) + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangGeometry, source, + infoSink, commonTable, symbolTables); + + // check for compute + if ((profile != EEsProfile && version >= 420) || + (profile == EEsProfile && version >= 310)) + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangCompute, source, + infoSink, commonTable, symbolTables); + + // check for ray tracing stages + if (profile != EEsProfile && version >= 450) { + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangRayGen, source, + infoSink, commonTable, symbolTables); + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangIntersect, source, + infoSink, commonTable, symbolTables); + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangAnyHit, source, + infoSink, commonTable, symbolTables); + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangClosestHit, source, + infoSink, commonTable, symbolTables); + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangMiss, source, + infoSink, commonTable, symbolTables); + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangCallable, source, + infoSink, commonTable, symbolTables); + } + + // check for mesh + if ((profile != EEsProfile && version >= 450) || + (profile == EEsProfile && version >= 320)) + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangMesh, source, + infoSink, commonTable, symbolTables); + + // check for task + if ((profile != EEsProfile && version >= 450) || + (profile == EEsProfile && version >= 320)) + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTask, source, + infoSink, commonTable, symbolTables); + + return success; +} + +bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& infoSink, TSymbolTable& symbolTable, int version, + EProfile profile, const SpvVersion& spvVersion, EShLanguage language, EShSource source) +{ + std::unique_ptr builtInParseables(CreateBuiltInParseables(infoSink, source)); + + if (builtInParseables == nullptr) + return false; + + builtInParseables->initialize(*resources, version, profile, spvVersion, language); + if (!InitializeSymbolTable(builtInParseables->getCommonString(), version, profile, spvVersion, language, source, infoSink, symbolTable)) + return false; + builtInParseables->identifyBuiltIns(version, profile, spvVersion, language, symbolTable, *resources); + + return true; +} + +// +// To do this on the fly, we want to leave the current state of our thread's +// pool allocator intact, so: +// - Switch to a new pool for parsing the built-ins +// - Do the parsing, which builds the symbol table, using the new pool +// - Switch to the process-global pool to save a copy of the resulting symbol table +// - Free up the new pool used to parse the built-ins +// - Switch back to the original thread's pool +// +// This only gets done the first time any thread needs a particular symbol table +// (lazy evaluation). +// +bool SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& spvVersion, EShSource source) +{ + TInfoSink infoSink; + bool success; + + // Make sure only one thread tries to do this at a time +#ifndef DISABLE_THREAD_SUPPORT + const std::lock_guard lock(init_lock); +#endif + + // See if it's already been done for this version/profile combination + int versionIndex = MapVersionToIndex(version); + int spvVersionIndex = MapSpvVersionToIndex(spvVersion); + int profileIndex = MapProfileToIndex(profile); + int sourceIndex = MapSourceToIndex(source); + if (CommonSymbolTable[versionIndex][spvVersionIndex][profileIndex][sourceIndex][EPcGeneral]) { + return true; + } + + // Switch to a new pool + TPoolAllocator& previousAllocator = GetThreadPoolAllocator(); + TPoolAllocator* builtInPoolAllocator = new TPoolAllocator; + SetThreadPoolAllocator(builtInPoolAllocator); + + // Dynamically allocate the local symbol tables so we can control when they are deallocated WRT when the pool is popped. + TSymbolTable* commonTable[EPcCount]; + TSymbolTable* stageTables[EShLangCount]; + for (int precClass = 0; precClass < EPcCount; ++precClass) + commonTable[precClass] = new TSymbolTable; + for (int stage = 0; stage < EShLangCount; ++stage) + stageTables[stage] = new TSymbolTable; + + // Generate the local symbol tables using the new pool + if (!InitializeSymbolTables(infoSink, commonTable, stageTables, version, profile, spvVersion, source)) { + success = false; + goto cleanup; + } + + // Switch to the process-global pool + SetThreadPoolAllocator(PerProcessGPA); + + // Copy the local symbol tables from the new pool to the global tables using the process-global pool + for (int precClass = 0; precClass < EPcCount; ++precClass) { + if (! commonTable[precClass]->isEmpty()) { + CommonSymbolTable[versionIndex][spvVersionIndex][profileIndex][sourceIndex][precClass] = new TSymbolTable; + CommonSymbolTable[versionIndex][spvVersionIndex][profileIndex][sourceIndex][precClass]->copyTable(*commonTable[precClass]); + CommonSymbolTable[versionIndex][spvVersionIndex][profileIndex][sourceIndex][precClass]->readOnly(); + } + } + for (int stage = 0; stage < EShLangCount; ++stage) { + if (! stageTables[stage]->isEmpty()) { + SharedSymbolTables[versionIndex][spvVersionIndex][profileIndex][sourceIndex][stage] = new TSymbolTable; + SharedSymbolTables[versionIndex][spvVersionIndex][profileIndex][sourceIndex][stage]->adoptLevels(*CommonSymbolTable + [versionIndex][spvVersionIndex][profileIndex][sourceIndex][CommonIndex(profile, (EShLanguage)stage)]); + SharedSymbolTables[versionIndex][spvVersionIndex][profileIndex][sourceIndex][stage]->copyTable(*stageTables[stage]); + SharedSymbolTables[versionIndex][spvVersionIndex][profileIndex][sourceIndex][stage]->readOnly(); + } + } + success = true; + +cleanup: + // Clean up the local tables before deleting the pool they used. + for (int precClass = 0; precClass < EPcCount; ++precClass) + delete commonTable[precClass]; + for (int stage = 0; stage < EShLangCount; ++stage) + delete stageTables[stage]; + + delete builtInPoolAllocator; + SetThreadPoolAllocator(&previousAllocator); + + return success; +} + +// Function to Print all builtins +void DumpBuiltinSymbolTable(TInfoSink& infoSink, const TSymbolTable& symbolTable) +{ + infoSink.debug << "BuiltinSymbolTable {\n"; + + symbolTable.dump(infoSink, true); + + infoSink.debug << "}\n"; +} + +// Return true if the shader was correctly specified for version/profile/stage. +bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNotFirst, int defaultVersion, + EShSource source, int& version, EProfile& profile, const SpvVersion& spvVersion) +{ + const int FirstProfileVersion = 150; + bool correct = true; + + if (source == EShSourceHlsl) { + version = 500; // shader model; currently a characteristic of glslang, not the input + profile = ECoreProfile; // allow doubles in prototype parsing + return correct; + } + + // Get a version... + if (version == 0) { + version = defaultVersion; + // infoSink.info.message(EPrefixWarning, "#version: statement missing; use #version on first line of shader"); + } + + // Get a good profile... + if (profile == ENoProfile) { + if (version == 300 || version == 310 || version == 320) { + correct = false; + infoSink.info.message(EPrefixError, "#version: versions 300, 310, and 320 require specifying the 'es' profile"); + profile = EEsProfile; + } else if (version == 100) + profile = EEsProfile; + else if (version >= FirstProfileVersion) + profile = ECoreProfile; + else + profile = ENoProfile; + } else { + // a profile was provided... + if (version < 150) { + correct = false; + infoSink.info.message(EPrefixError, "#version: versions before 150 do not allow a profile token"); + if (version == 100) + profile = EEsProfile; + else + profile = ENoProfile; + } else if (version == 300 || version == 310 || version == 320) { + if (profile != EEsProfile) { + correct = false; + infoSink.info.message(EPrefixError, "#version: versions 300, 310, and 320 support only the es profile"); + } + profile = EEsProfile; + } else { + if (profile == EEsProfile) { + correct = false; + infoSink.info.message(EPrefixError, "#version: only version 300, 310, and 320 support the es profile"); + if (version >= FirstProfileVersion) + profile = ECoreProfile; + else + profile = ENoProfile; + } + // else: typical desktop case... e.g., "#version 410 core" + } + } + + // Fix version... + switch (version) { + // ES versions + case 100: break; + case 300: break; + case 310: break; + case 320: break; + + // desktop versions + case 110: break; + case 120: break; + case 130: break; + case 140: break; + case 150: break; + case 330: break; + case 400: break; + case 410: break; + case 420: break; + case 430: break; + case 440: break; + case 450: break; + case 460: break; + + // unknown version + default: + correct = false; + infoSink.info.message(EPrefixError, "version not supported"); + if (profile == EEsProfile) + version = 310; + else { + version = 450; + profile = ECoreProfile; + } + break; + } + + // Correct for stage type... + switch (stage) { + case EShLangGeometry: + if ((profile == EEsProfile && version < 310) || + (profile != EEsProfile && version < 150)) { + correct = false; + infoSink.info.message(EPrefixError, "#version: geometry shaders require es profile with version 310 or non-es profile with version 150 or above"); + version = (profile == EEsProfile) ? 310 : 150; + if (profile == EEsProfile || profile == ENoProfile) + profile = ECoreProfile; + } + break; + case EShLangTessControl: + case EShLangTessEvaluation: + if ((profile == EEsProfile && version < 310) || + (profile != EEsProfile && version < 150)) { + correct = false; + infoSink.info.message(EPrefixError, "#version: tessellation shaders require es profile with version 310 or non-es profile with version 150 or above"); + version = (profile == EEsProfile) ? 310 : 400; // 150 supports the extension, correction is to 400 which does not + if (profile == EEsProfile || profile == ENoProfile) + profile = ECoreProfile; + } + break; + case EShLangCompute: + if ((profile == EEsProfile && version < 310) || + (profile != EEsProfile && version < 420)) { + correct = false; + infoSink.info.message(EPrefixError, "#version: compute shaders require es profile with version 310 or above, or non-es profile with version 420 or above"); + version = profile == EEsProfile ? 310 : 420; + } + break; + case EShLangRayGen: + case EShLangIntersect: + case EShLangAnyHit: + case EShLangClosestHit: + case EShLangMiss: + case EShLangCallable: + if (profile == EEsProfile || version < 460) { + correct = false; + infoSink.info.message(EPrefixError, "#version: ray tracing shaders require non-es profile with version 460 or above"); + version = 460; + } + break; + case EShLangMesh: + case EShLangTask: + if ((profile == EEsProfile && version < 320) || + (profile != EEsProfile && version < 450)) { + correct = false; + infoSink.info.message(EPrefixError, "#version: mesh/task shaders require es profile with version 320 or above, or non-es profile with version 450 or above"); + version = profile == EEsProfile ? 320 : 450; + } + break; + default: + break; + } + + if (profile == EEsProfile && version >= 300 && versionNotFirst) { + correct = false; + infoSink.info.message(EPrefixError, "#version: statement must appear first in es-profile shader; before comments or newlines"); + } + + // Check for SPIR-V compatibility + if (spvVersion.spv != 0) { + switch (profile) { + case EEsProfile: + if (version < 310) { + correct = false; + infoSink.info.message(EPrefixError, "#version: ES shaders for SPIR-V require version 310 or higher"); + version = 310; + } + break; + case ECompatibilityProfile: + infoSink.info.message(EPrefixError, "#version: compilation for SPIR-V does not support the compatibility profile"); + break; + default: + if (spvVersion.vulkan > 0 && version < 140) { + correct = false; + infoSink.info.message(EPrefixError, "#version: Desktop shaders for Vulkan SPIR-V require version 140 or higher"); + version = 140; + } + if (spvVersion.openGl >= 100 && version < 330) { + correct = false; + infoSink.info.message(EPrefixError, "#version: Desktop shaders for OpenGL SPIR-V require version 330 or higher"); + version = 330; + } + break; + } + } + + return correct; +} + +// There are multiple paths in for setting environment stuff. +// TEnvironment takes precedence, for what it sets, so sort all this out. +// Ideally, the internal code could be made to use TEnvironment, but for +// now, translate it to the historically used parameters. +void TranslateEnvironment(const TEnvironment* environment, EShMessages& messages, EShSource& source, + EShLanguage& stage, SpvVersion& spvVersion) +{ + // Set up environmental defaults, first ignoring 'environment'. + if (messages & EShMsgSpvRules) + spvVersion.spv = EShTargetSpv_1_0; + if (messages & EShMsgVulkanRules) { + spvVersion.vulkan = EShTargetVulkan_1_0; + spvVersion.vulkanGlsl = 100; + } else if (spvVersion.spv != 0) + spvVersion.openGl = 100; + + // Now, override, based on any content set in 'environment'. + // 'environment' must be cleared to ESh*None settings when items + // are not being set. + if (environment != nullptr) { + // input language + if (environment->input.languageFamily != EShSourceNone) { + stage = environment->input.stage; + switch (environment->input.dialect) { + case EShClientNone: + break; + case EShClientVulkan: + spvVersion.vulkanGlsl = environment->input.dialectVersion; + spvVersion.vulkanRelaxed = environment->input.vulkanRulesRelaxed; + break; + case EShClientOpenGL: + spvVersion.openGl = environment->input.dialectVersion; + break; + case EShClientCount: + assert(0); + break; + } + switch (environment->input.languageFamily) { + case EShSourceNone: + break; + case EShSourceGlsl: + source = EShSourceGlsl; + messages = static_cast(messages & ~EShMsgReadHlsl); + break; + case EShSourceHlsl: + source = EShSourceHlsl; + messages = static_cast(messages | EShMsgReadHlsl); + break; + case EShSourceCount: + assert(0); + break; + } + } + + // client + switch (environment->client.client) { + case EShClientVulkan: + spvVersion.vulkan = environment->client.version; + break; + default: + break; + } + + // generated code + switch (environment->target.language) { + case EshTargetSpv: + spvVersion.spv = environment->target.version; + break; + default: + break; + } + } +} + +// Most processes are recorded when set in the intermediate representation, +// These are the few that are not. +void RecordProcesses(TIntermediate& intermediate, EShMessages messages, const std::string& sourceEntryPointName) +{ + if ((messages & EShMsgRelaxedErrors) != 0) + intermediate.addProcess("relaxed-errors"); + if ((messages & EShMsgSuppressWarnings) != 0) + intermediate.addProcess("suppress-warnings"); + if ((messages & EShMsgKeepUncalled) != 0) + intermediate.addProcess("keep-uncalled"); + if (sourceEntryPointName.size() > 0) { + intermediate.addProcess("source-entrypoint"); + intermediate.addProcessArgument(sourceEntryPointName); + } +} + +// This is the common setup and cleanup code for PreprocessDeferred and +// CompileDeferred. +// It takes any callable with a signature of +// bool (TParseContextBase& parseContext, TPpContext& ppContext, +// TInputScanner& input, bool versionWillBeError, +// TSymbolTable& , TIntermediate& , +// EShOptimizationLevel , EShMessages ); +// Which returns false if a failure was detected and true otherwise. +// +template +bool ProcessDeferred( + TCompiler* compiler, + const char* const shaderStrings[], + const int numStrings, + const int* inputLengths, + const char* const stringNames[], + const char* customPreamble, + const EShOptimizationLevel optLevel, + const TBuiltInResource* resources, + int defaultVersion, // use 100 for ES environment, 110 for desktop; this is the GLSL version, not SPIR-V or Vulkan + EProfile defaultProfile, + // set version/profile to defaultVersion/defaultProfile regardless of the #version + // directive in the source code + bool forceDefaultVersionAndProfile, + int overrideVersion, // overrides version specified by #version or default version + bool forwardCompatible, // give errors for use of deprecated features + EShMessages messages, // warnings/errors/AST; things to print out + TIntermediate& intermediate, // returned tree, etc. + ProcessingContext& processingContext, + bool requireNonempty, + TShader::Includer& includer, + const std::string sourceEntryPointName = "", + const TEnvironment* environment = nullptr, // optional way of fully setting all versions, overriding the above + bool compileOnly = false) +{ + // This must be undone (.pop()) by the caller, after it finishes consuming the created tree. + GetThreadPoolAllocator().push(); + + if (numStrings == 0) + return true; + + // Move to length-based strings, rather than null-terminated strings. + // Also, add strings to include the preamble and to ensure the shader is not null, + // which lets the grammar accept what was a null (post preprocessing) shader. + // + // Shader will look like + // string 0: system preamble + // string 1: custom preamble + // string 2...numStrings+1: user's shader + // string numStrings+2: "int;" + const int numPre = 2; + const int numPost = requireNonempty? 1 : 0; + const int numTotal = numPre + numStrings + numPost; + std::unique_ptr lengths(new size_t[numTotal]); + std::unique_ptr strings(new const char*[numTotal]); + std::unique_ptr names(new const char*[numTotal]); + for (int s = 0; s < numStrings; ++s) { + strings[s + numPre] = shaderStrings[s]; + if (inputLengths == nullptr || inputLengths[s] < 0) + lengths[s + numPre] = strlen(shaderStrings[s]); + else + lengths[s + numPre] = inputLengths[s]; + } + if (stringNames != nullptr) { + for (int s = 0; s < numStrings; ++s) + names[s + numPre] = stringNames[s]; + } else { + for (int s = 0; s < numStrings; ++s) + names[s + numPre] = nullptr; + } + + // Get all the stages, languages, clients, and other environment + // stuff sorted out. + EShSource sourceGuess = (messages & EShMsgReadHlsl) != 0 ? EShSourceHlsl : EShSourceGlsl; + SpvVersion spvVersion; + EShLanguage stage = compiler->getLanguage(); + TranslateEnvironment(environment, messages, sourceGuess, stage, spvVersion); +#ifdef ENABLE_HLSL + EShSource source = sourceGuess; + if (environment != nullptr && environment->target.hlslFunctionality1) + intermediate.setHlslFunctionality1(); +#else + const EShSource source = EShSourceGlsl; +#endif + // First, without using the preprocessor or parser, find the #version, so we know what + // symbol tables, processing rules, etc. to set up. This does not need the extra strings + // outlined above, just the user shader, after the system and user preambles. + glslang::TInputScanner userInput(numStrings, &strings[numPre], &lengths[numPre]); + int version = 0; + EProfile profile = ENoProfile; + bool versionNotFirstToken = false; + bool versionNotFirst = (source == EShSourceHlsl) + ? true + : userInput.scanVersion(version, profile, versionNotFirstToken); + bool versionNotFound = version == 0; + if (forceDefaultVersionAndProfile && source == EShSourceGlsl) { + if (! (messages & EShMsgSuppressWarnings) && ! versionNotFound && + (version != defaultVersion || profile != defaultProfile)) { + compiler->infoSink.info << "Warning, (version, profile) forced to be (" + << defaultVersion << ", " << ProfileName(defaultProfile) + << "), while in source code it is (" + << version << ", " << ProfileName(profile) << ")\n"; + } + + if (versionNotFound) { + versionNotFirstToken = false; + versionNotFirst = false; + versionNotFound = false; + } + version = defaultVersion; + profile = defaultProfile; + } + if (source == EShSourceGlsl && overrideVersion != 0) { + version = overrideVersion; + } + + bool goodVersion = DeduceVersionProfile(compiler->infoSink, stage, + versionNotFirst, defaultVersion, source, version, profile, spvVersion); + bool versionWillBeError = (versionNotFound || (profile == EEsProfile && version >= 300 && versionNotFirst)); + bool warnVersionNotFirst = false; + if (! versionWillBeError && versionNotFirstToken) { + if (messages & EShMsgRelaxedErrors) + warnVersionNotFirst = true; + else + versionWillBeError = true; + } + + intermediate.setSource(source); + intermediate.setVersion(version); + intermediate.setProfile(profile); + intermediate.setSpv(spvVersion); + RecordProcesses(intermediate, messages, sourceEntryPointName); + if (spvVersion.vulkan > 0) + intermediate.setOriginUpperLeft(); +#ifdef ENABLE_HLSL + if ((messages & EShMsgHlslOffsets) || source == EShSourceHlsl) + intermediate.setHlslOffsets(); +#endif + if (messages & EShMsgDebugInfo) { + intermediate.setSourceFile(names[numPre]); + for (int s = 0; s < numStrings; ++s) { + // The string may not be null-terminated, so make sure we provide + // the length along with the string. + intermediate.addSourceText(strings[numPre + s], lengths[numPre + s]); + } + } + if (!SetupBuiltinSymbolTable(version, profile, spvVersion, source)) { + return false; + } + + TSymbolTable* cachedTable = SharedSymbolTables[MapVersionToIndex(version)] + [MapSpvVersionToIndex(spvVersion)] + [MapProfileToIndex(profile)] + [MapSourceToIndex(source)] + [stage]; + + // Dynamically allocate the symbol table so we can control when it is deallocated WRT the pool. + std::unique_ptr symbolTable(new TSymbolTable); + if (cachedTable) + symbolTable->adoptLevels(*cachedTable); + + if (intermediate.getUniqueId() != 0) + symbolTable->overwriteUniqueId(intermediate.getUniqueId()); + + // Add built-in symbols that are potentially context dependent; + // they get popped again further down. + if (! AddContextSpecificSymbols(resources, compiler->infoSink, *symbolTable, version, profile, spvVersion, + stage, source)) { + return false; + } + + if (messages & EShMsgBuiltinSymbolTable) + DumpBuiltinSymbolTable(compiler->infoSink, *symbolTable); + + // + // Now we can process the full shader under proper symbols and rules. + // + + std::unique_ptr parseContext(CreateParseContext(*symbolTable, intermediate, version, profile, source, + stage, compiler->infoSink, + spvVersion, forwardCompatible, messages, false, sourceEntryPointName)); + parseContext->compileOnly = compileOnly; + TPpContext ppContext(*parseContext, names[numPre] ? names[numPre] : "", includer); + + // only GLSL (bison triggered, really) needs an externally set scan context + glslang::TScanContext scanContext(*parseContext); + if (source == EShSourceGlsl) + parseContext->setScanContext(&scanContext); + + parseContext->setPpContext(&ppContext); + parseContext->setLimits(*resources); + if (! goodVersion) + parseContext->addError(); + if (warnVersionNotFirst) { + TSourceLoc loc; + loc.init(); + parseContext->warn(loc, "Illegal to have non-comment, non-whitespace tokens before #version", "#version", ""); + } + + parseContext->initializeExtensionBehavior(); + + // Fill in the strings as outlined above. + std::string preamble; + parseContext->getPreamble(preamble); + strings[0] = preamble.c_str(); + lengths[0] = strlen(strings[0]); + names[0] = nullptr; + strings[1] = customPreamble; + lengths[1] = strlen(strings[1]); + names[1] = nullptr; + assert(2 == numPre); + if (requireNonempty) { + const int postIndex = numStrings + numPre; + strings[postIndex] = "\n int;"; + lengths[postIndex] = strlen(strings[numStrings + numPre]); + names[postIndex] = nullptr; + } + TInputScanner fullInput(numStrings + numPre + numPost, strings.get(), lengths.get(), names.get(), numPre, numPost); + + // Push a new symbol allocation scope that will get used for the shader's globals. + symbolTable->push(); + + bool success = processingContext(*parseContext, ppContext, fullInput, + versionWillBeError, *symbolTable, + intermediate, optLevel, messages); + intermediate.setUniqueId(symbolTable->getMaxSymbolId()); + return success; +} + +// Responsible for keeping track of the most recent source string and line in +// the preprocessor and outputting newlines appropriately if the source string +// or line changes. +class SourceLineSynchronizer { +public: + SourceLineSynchronizer(const std::function& lastSourceIndex, + std::string* output) + : getLastSourceIndex(lastSourceIndex), output(output), lastSource(-1), lastLine(0) {} +// SourceLineSynchronizer(const SourceLineSynchronizer&) = delete; +// SourceLineSynchronizer& operator=(const SourceLineSynchronizer&) = delete; + + // Sets the internally tracked source string index to that of the most + // recently read token. If we switched to a new source string, returns + // true and inserts a newline. Otherwise, returns false and outputs nothing. + bool syncToMostRecentString() { + if (getLastSourceIndex() != lastSource) { + // After switching to a new source string, we need to reset lastLine + // because line number resets every time a new source string is + // used. We also need to output a newline to separate the output + // from the previous source string (if there is one). + if (lastSource != -1 || lastLine != 0) + *output += '\n'; + lastSource = getLastSourceIndex(); + lastLine = -1; + return true; + } + return false; + } + + // Calls syncToMostRecentString() and then sets the internally tracked line + // number to tokenLine. If we switched to a new line, returns true and inserts + // newlines appropriately. Otherwise, returns false and outputs nothing. + bool syncToLine(int tokenLine) { + syncToMostRecentString(); + const bool newLineStarted = lastLine < tokenLine; + for (; lastLine < tokenLine; ++lastLine) { + if (lastLine > 0) *output += '\n'; + } + return newLineStarted; + } + + // Sets the internally tracked line number to newLineNum. + void setLineNum(int newLineNum) { lastLine = newLineNum; } + +private: + SourceLineSynchronizer& operator=(const SourceLineSynchronizer&); + + // A function for getting the index of the last valid source string we've + // read tokens from. + const std::function getLastSourceIndex; + // output string for newlines. + std::string* output; + // lastSource is the source string index (starting from 0) of the last token + // processed. It is tracked in order for newlines to be inserted when a new + // source string starts. -1 means we haven't started processing any source + // string. + int lastSource; + // lastLine is the line number (starting from 1) of the last token processed. + // It is tracked in order for newlines to be inserted when a token appears + // on a new line. 0 means we haven't started processing any line in the + // current source string. + int lastLine; +}; + +// DoPreprocessing is a valid ProcessingContext template argument, +// which only performs the preprocessing step of compilation. +// It places the result in the "string" argument to its constructor. +// +// This is not an officially supported or fully working path. +struct DoPreprocessing { + explicit DoPreprocessing(std::string* string): outputString(string) {} + bool operator()(TParseContextBase& parseContext, TPpContext& ppContext, + TInputScanner& input, bool versionWillBeError, + TSymbolTable&, TIntermediate&, + EShOptimizationLevel, EShMessages) + { + // This is a list of tokens that do not require a space before or after. + static const std::string noNeededSpaceBeforeTokens = ";)[].,"; + static const std::string noNeededSpaceAfterTokens = ".(["; + glslang::TPpToken ppToken; + + parseContext.setScanner(&input); + ppContext.setInput(input, versionWillBeError); + + std::string outputBuffer; + SourceLineSynchronizer lineSync( + std::bind(&TInputScanner::getLastValidSourceIndex, &input), &outputBuffer); + + parseContext.setExtensionCallback([&lineSync, &outputBuffer]( + int line, const char* extension, const char* behavior) { + lineSync.syncToLine(line); + outputBuffer += "#extension "; + outputBuffer += extension; + outputBuffer += " : "; + outputBuffer += behavior; + }); + + parseContext.setLineCallback([&lineSync, &outputBuffer, &parseContext]( + int curLineNum, int newLineNum, bool hasSource, int sourceNum, const char* sourceName) { + // SourceNum is the number of the source-string that is being parsed. + lineSync.syncToLine(curLineNum); + outputBuffer += "#line "; + outputBuffer += std::to_string(newLineNum); + if (hasSource) { + outputBuffer += ' '; + if (sourceName != nullptr) { + outputBuffer += '\"'; + outputBuffer += sourceName; + outputBuffer += '\"'; + } else { + outputBuffer += std::to_string(sourceNum); + } + } + if (parseContext.lineDirectiveShouldSetNextLine()) { + // newLineNum is the new line number for the line following the #line + // directive. So the new line number for the current line is + newLineNum -= 1; + } + outputBuffer += '\n'; + // And we are at the next line of the #line directive now. + lineSync.setLineNum(newLineNum + 1); + }); + + parseContext.setVersionCallback( + [&lineSync, &outputBuffer](int line, int version, const char* str) { + lineSync.syncToLine(line); + outputBuffer += "#version "; + outputBuffer += std::to_string(version); + if (str) { + outputBuffer += ' '; + outputBuffer += str; + } + }); + + parseContext.setPragmaCallback([&lineSync, &outputBuffer]( + int line, const glslang::TVector& ops) { + lineSync.syncToLine(line); + outputBuffer += "#pragma "; + for(size_t i = 0; i < ops.size(); ++i) { + outputBuffer += ops[i].c_str(); + } + }); + + parseContext.setErrorCallback([&lineSync, &outputBuffer]( + int line, const char* errorMessage) { + lineSync.syncToLine(line); + outputBuffer += "#error "; + outputBuffer += errorMessage; + }); + + int lastToken = EndOfInput; // lastToken records the last token processed. + std::string lastTokenName; + do { + int token = ppContext.tokenize(ppToken); + if (token == EndOfInput) + break; + + bool isNewString = lineSync.syncToMostRecentString(); + bool isNewLine = lineSync.syncToLine(ppToken.loc.line); + + if (isNewLine) { + // Don't emit whitespace onto empty lines. + // Copy any whitespace characters at the start of a line + // from the input to the output. + outputBuffer += std::string(ppToken.loc.column - 1, ' '); + } + + // Output a space in between tokens, but not at the start of a line, + // and also not around special tokens. This helps with readability + // and consistency. + if (!isNewString && !isNewLine && lastToken != EndOfInput) { + // left parenthesis need a leading space, except it is in a function-call-like context. + // examples: `for (xxx)`, `a * (b + c)`, `vec(2.0)`, `foo(x, y, z)` + if (token == '(') { + if (lastToken != PpAtomIdentifier || + lastTokenName == "if" || + lastTokenName == "for" || + lastTokenName == "while" || + lastTokenName == "switch") + outputBuffer += ' '; + } else if ((noNeededSpaceBeforeTokens.find((char)token) == std::string::npos) && + (noNeededSpaceAfterTokens.find((char)lastToken) == std::string::npos)) { + outputBuffer += ' '; + } + } + if (token == PpAtomIdentifier) + lastTokenName = ppToken.name; + lastToken = token; + if (token == PpAtomConstString) + outputBuffer += "\""; + outputBuffer += ppToken.name; + if (token == PpAtomConstString) + outputBuffer += "\""; + } while (true); + outputBuffer += '\n'; + *outputString = std::move(outputBuffer); + + bool success = true; + if (parseContext.getNumErrors() > 0) { + success = false; + parseContext.infoSink.info.prefix(EPrefixError); + parseContext.infoSink.info << parseContext.getNumErrors() << " compilation errors. No code generated.\n\n"; + } + return success; + } + std::string* outputString; +}; + +// DoFullParse is a valid ProcessingConext template argument for fully +// parsing the shader. It populates the "intermediate" with the AST. +struct DoFullParse{ + bool operator()(TParseContextBase& parseContext, TPpContext& ppContext, + TInputScanner& fullInput, bool versionWillBeError, + TSymbolTable&, TIntermediate& intermediate, + EShOptimizationLevel optLevel, EShMessages messages) + { + bool success = true; + // Parse the full shader. + if (! parseContext.parseShaderStrings(ppContext, fullInput, versionWillBeError)) + success = false; + + if (success && intermediate.getTreeRoot()) { + if (optLevel == EShOptNoGeneration) + parseContext.infoSink.info.message(EPrefixNone, "No errors. No code generation or linking was requested."); + else + success = intermediate.postProcess(intermediate.getTreeRoot(), parseContext.getLanguage()); + } else if (! success) { + parseContext.infoSink.info.prefix(EPrefixError); + parseContext.infoSink.info << parseContext.getNumErrors() << " compilation errors. No code generated.\n\n"; + } + + if (messages & EShMsgAST) + intermediate.output(parseContext.infoSink, true); + + return success; + } +}; + +// Take a single compilation unit, and run the preprocessor on it. +// Return: True if there were no issues found in preprocessing, +// False if during preprocessing any unknown version, pragmas or +// extensions were found. +// +// NOTE: Doing just preprocessing to obtain a correct preprocessed shader string +// is not an officially supported or fully working path. +bool PreprocessDeferred( + TCompiler* compiler, + const char* const shaderStrings[], + const int numStrings, + const int* inputLengths, + const char* const stringNames[], + const char* preamble, + const EShOptimizationLevel optLevel, + const TBuiltInResource* resources, + int defaultVersion, // use 100 for ES environment, 110 for desktop + EProfile defaultProfile, + bool forceDefaultVersionAndProfile, + int overrideVersion, // use 0 if not overriding GLSL version + bool forwardCompatible, // give errors for use of deprecated features + EShMessages messages, // warnings/errors/AST; things to print out + TShader::Includer& includer, + TIntermediate& intermediate, // returned tree, etc. + std::string* outputString, + TEnvironment* environment = nullptr) +{ + DoPreprocessing parser(outputString); + return ProcessDeferred(compiler, shaderStrings, numStrings, inputLengths, stringNames, + preamble, optLevel, resources, defaultVersion, + defaultProfile, forceDefaultVersionAndProfile, overrideVersion, + forwardCompatible, messages, intermediate, parser, + false, includer, "", environment); +} + +// +// do a partial compile on the given strings for a single compilation unit +// for a potential deferred link into a single stage (and deferred full compile of that +// stage through machine-dependent compilation). +// +// all preprocessing, parsing, semantic checks, etc. for a single compilation unit +// are done here. +// +// return: the tree and other information is filled into the intermediate argument, +// and true is returned by the function for success. +// +bool CompileDeferred( + TCompiler* compiler, + const char* const shaderStrings[], + const int numStrings, + const int* inputLengths, + const char* const stringNames[], + const char* preamble, + const EShOptimizationLevel optLevel, + const TBuiltInResource* resources, + int defaultVersion, // use 100 for ES environment, 110 for desktop + EProfile defaultProfile, + bool forceDefaultVersionAndProfile, + int overrideVersion, // use 0 if not overriding GLSL version + bool forwardCompatible, // give errors for use of deprecated features + EShMessages messages, // warnings/errors/AST; things to print out + TIntermediate& intermediate,// returned tree, etc. + TShader::Includer& includer, + const std::string sourceEntryPointName = "", + TEnvironment* environment = nullptr, + bool compileOnly = false) +{ + DoFullParse parser; + return ProcessDeferred(compiler, shaderStrings, numStrings, inputLengths, stringNames, + preamble, optLevel, resources, defaultVersion, + defaultProfile, forceDefaultVersionAndProfile, overrideVersion, + forwardCompatible, messages, intermediate, parser, + true, includer, sourceEntryPointName, environment, compileOnly); +} + +} // end anonymous namespace for local functions + +// +// ShInitialize() should be called exactly once per process, not per thread. +// +int ShInitialize_Qt() +{ +#ifndef DISABLE_THREAD_SUPPORT + const std::lock_guard lock(init_lock); +#endif + ++NumberOfClients; + + if (PerProcessGPA == nullptr) + PerProcessGPA = new TPoolAllocator(); + + return 1; +} + +// +// Driver calls these to create and destroy compiler/linker +// objects. +// + +ShHandle ShConstructCompiler_Qt(const EShLanguage language, int debugOptions) +{ + TShHandleBase* base = static_cast(ConstructCompiler(language, 0)); + + return reinterpret_cast(base); +} + +ShHandle ShConstructLinker_Qt(const EShExecutable executable, int debugOptions) +{ + TShHandleBase* base = static_cast(ConstructLinker(executable, 0)); + + return reinterpret_cast(base); +} + +ShHandle ShConstructUniformMap_Qt() +{ + TShHandleBase* base = static_cast(ConstructUniformMap()); + + return reinterpret_cast(base); +} + +void ShDestruct_Qt(ShHandle handle) +{ + if (handle == nullptr) + return; + + TShHandleBase* base = static_cast(handle); + + if (base->getAsCompiler()) + DeleteCompiler(base->getAsCompiler()); + else if (base->getAsLinker()) + DeleteLinker(base->getAsLinker()); + else if (base->getAsUniformMap()) + DeleteUniformMap(base->getAsUniformMap()); +} + +// +// Cleanup symbol tables +// +int ShFinalize_Qt() +{ +#ifndef DISABLE_THREAD_SUPPORT + const std::lock_guard lock(init_lock); +#endif + --NumberOfClients; + assert(NumberOfClients >= 0); + if (NumberOfClients > 0) + return 1; + + for (int version = 0; version < VersionCount; ++version) { + for (int spvVersion = 0; spvVersion < SpvVersionCount; ++spvVersion) { + for (int p = 0; p < ProfileCount; ++p) { + for (int source = 0; source < SourceCount; ++source) { + for (int stage = 0; stage < EShLangCount; ++stage) { + delete SharedSymbolTables[version][spvVersion][p][source][stage]; + SharedSymbolTables[version][spvVersion][p][source][stage] = nullptr; + } + } + } + } + } + + for (int version = 0; version < VersionCount; ++version) { + for (int spvVersion = 0; spvVersion < SpvVersionCount; ++spvVersion) { + for (int p = 0; p < ProfileCount; ++p) { + for (int source = 0; source < SourceCount; ++source) { + for (int pc = 0; pc < EPcCount; ++pc) { + delete CommonSymbolTable[version][spvVersion][p][source][pc]; + CommonSymbolTable[version][spvVersion][p][source][pc] = nullptr; + } + } + } + } + } + + if (PerProcessGPA != nullptr) { + delete PerProcessGPA; + PerProcessGPA = nullptr; + } + + return 1; +} + +// +// Do a full compile on the given strings for a single compilation unit +// forming a complete stage. The result of the machine dependent compilation +// is left in the provided compile object. +// +// Return: The return value is really boolean, indicating +// success (1) or failure (0). +// +int ShCompile_Qt( + const ShHandle handle, + const char* const shaderStrings[], + const int numStrings, + const int* inputLengths, + const EShOptimizationLevel optLevel, + const TBuiltInResource* resources, + int /*debugOptions*/, + int defaultVersion, // use 100 for ES environment, 110 for desktop + bool forwardCompatible, // give errors for use of deprecated features + EShMessages messages, // warnings/errors/AST; things to print out, + const char *shaderFileName // the filename + ) +{ + // Map the generic handle to the C++ object + if (handle == nullptr) + return 0; + + TShHandleBase* base = reinterpret_cast(handle); + TCompiler* compiler = base->getAsCompiler(); + if (compiler == nullptr) + return 0; + + SetThreadPoolAllocator(compiler->getPool()); + + compiler->infoSink.info.erase(); + compiler->infoSink.debug.erase(); + compiler->infoSink.info.setShaderFileName(shaderFileName); + compiler->infoSink.debug.setShaderFileName(shaderFileName); + + + TIntermediate intermediate(compiler->getLanguage()); + TShader::ForbidIncluder includer; + bool success = CompileDeferred(compiler, shaderStrings, numStrings, inputLengths, nullptr, + "", optLevel, resources, defaultVersion, ENoProfile, false, 0, + forwardCompatible, messages, intermediate, includer); + + // + // Call the machine dependent compiler + // + if (success && intermediate.getTreeRoot() && optLevel != EShOptNoGeneration) + success = compiler->compile(intermediate.getTreeRoot(), intermediate.getVersion(), intermediate.getProfile()); + + intermediate.removeTree(); + + // Throw away all the temporary memory used by the compilation process. + // The push was done in the CompileDeferred() call above. + GetThreadPoolAllocator().pop(); + + return success ? 1 : 0; +} + +// +// Link the given compile objects. +// +// Return: The return value of is really boolean, indicating +// success or failure. +// +int ShLinkExt_Qt( + const ShHandle linkHandle, + const ShHandle compHandles[], + const int numHandles) +{ + if (linkHandle == nullptr || numHandles == 0) + return 0; + + THandleList cObjects; + + for (int i = 0; i < numHandles; ++i) { + if (compHandles[i] == nullptr) + return 0; + TShHandleBase* base = reinterpret_cast(compHandles[i]); + if (base->getAsLinker()) { + cObjects.push_back(base->getAsLinker()); + } + if (base->getAsCompiler()) + cObjects.push_back(base->getAsCompiler()); + + if (cObjects[i] == nullptr) + return 0; + } + + TShHandleBase* base = reinterpret_cast(linkHandle); + TLinker* linker = static_cast(base->getAsLinker()); + + if (linker == nullptr) + return 0; + + SetThreadPoolAllocator(linker->getPool()); + linker->infoSink.info.erase(); + + for (int i = 0; i < numHandles; ++i) { + if (cObjects[i]->getAsCompiler()) { + if (! cObjects[i]->getAsCompiler()->linkable()) { + linker->infoSink.info.message(EPrefixError, "Not all shaders have valid object code."); + return 0; + } + } + } + + bool ret = linker->link(cObjects); + + return ret ? 1 : 0; +} + +// +// ShSetEncrpytionMethod is a place-holder for specifying +// how source code is encrypted. +// +void ShSetEncryptionMethod_Qt(ShHandle handle) +{ + if (handle == nullptr) + return; +} + +// +// Return any compiler/linker/uniformmap log of messages for the application. +// +const char* ShGetInfoLog_Qt(const ShHandle handle) +{ + if (handle == nullptr) + return nullptr; + + TShHandleBase* base = static_cast(handle); + TInfoSink* infoSink; + + if (base->getAsCompiler()) + infoSink = &(base->getAsCompiler()->getInfoSink()); + else if (base->getAsLinker()) + infoSink = &(base->getAsLinker()->getInfoSink()); + else + return nullptr; + + infoSink->info << infoSink->debug.c_str(); + return infoSink->info.c_str(); +} + +// +// Return the resulting binary code from the link process. Structure +// is machine dependent. +// +const void* ShGetExecutable_Qt(const ShHandle handle) +{ + if (handle == nullptr) + return nullptr; + + TShHandleBase* base = reinterpret_cast(handle); + + TLinker* linker = static_cast(base->getAsLinker()); + if (linker == nullptr) + return nullptr; + + return linker->getObjectCode(); +} + +// +// Let the linker know where the application said it's attributes are bound. +// The linker does not use these values, they are remapped by the ICD or +// hardware. It just needs them to know what's aliased. +// +// Return: The return value of is really boolean, indicating +// success or failure. +// +int ShSetVirtualAttributeBindings_Qt(const ShHandle handle, const ShBindingTable* table) +{ + if (handle == nullptr) + return 0; + + TShHandleBase* base = reinterpret_cast(handle); + TLinker* linker = static_cast(base->getAsLinker()); + + if (linker == nullptr) + return 0; + + linker->setAppAttributeBindings(table); + + return 1; +} + +// +// Let the linker know where the predefined attributes have to live. +// +int ShSetFixedAttributeBindings_Qt(const ShHandle handle, const ShBindingTable* table) +{ + if (handle == nullptr) + return 0; + + TShHandleBase* base = reinterpret_cast(handle); + TLinker* linker = static_cast(base->getAsLinker()); + + if (linker == nullptr) + return 0; + + linker->setFixedAttributeBindings(table); + return 1; +} + +// +// Some attribute locations are off-limits to the linker... +// +int ShExcludeAttributes_Qt(const ShHandle handle, int *attributes, int count) +{ + if (handle == nullptr) + return 0; + + TShHandleBase* base = reinterpret_cast(handle); + TLinker* linker = static_cast(base->getAsLinker()); + if (linker == nullptr) + return 0; + + linker->setExcludedAttributes(attributes, count); + + return 1; +} + +// +// Return the index for OpenGL to use for knowing where a uniform lives. +// +// Return: The return value of is really boolean, indicating +// success or failure. +// +int ShGetUniformLocation_Qt(const ShHandle handle, const char* name) +{ + if (handle == nullptr) + return -1; + + TShHandleBase* base = reinterpret_cast(handle); + TUniformMap* uniformMap= base->getAsUniformMap(); + if (uniformMap == nullptr) + return -1; + + return uniformMap->getLocation(name); +} + +//////////////////////////////////////////////////////////////////////////////////////////// +// +// Deferred-Lowering C++ Interface +// ----------------------------------- +// +// Below is a new alternate C++ interface that might potentially replace the above +// opaque handle-based interface. +// +// See more detailed comment in ShaderLang.h +// + +namespace QtShaderTools { +namespace glslang { + +Version GetVersion() +{ + Version version; + version.major = GLSLANG_VERSION_MAJOR; + version.minor = GLSLANG_VERSION_MINOR; + version.patch = GLSLANG_VERSION_PATCH; + version.flavor = GLSLANG_VERSION_FLAVOR; + return version; +} + +#define QUOTE(s) #s +#define STR(n) QUOTE(n) + +const char* GetEsslVersionString() +{ + return "OpenGL ES GLSL 3.20 glslang Khronos. " STR(GLSLANG_VERSION_MAJOR) "." STR(GLSLANG_VERSION_MINOR) "." STR( + GLSLANG_VERSION_PATCH) GLSLANG_VERSION_FLAVOR; +} + +const char* GetGlslVersionString() +{ + return "4.60 glslang Khronos. " STR(GLSLANG_VERSION_MAJOR) "." STR(GLSLANG_VERSION_MINOR) "." STR( + GLSLANG_VERSION_PATCH) GLSLANG_VERSION_FLAVOR; +} + +int GetKhronosToolId() +{ + return 8; +} + +bool InitializeProcess() +{ + return ShInitialize_Qt() != 0; +} + +void FinalizeProcess() +{ + ShFinalize_Qt(); +} + +class TDeferredCompiler : public TCompiler { +public: + TDeferredCompiler(EShLanguage s, TInfoSink& i) : TCompiler(s, i) { } + virtual bool compile(TIntermNode*, int = 0, EProfile = ENoProfile) { return true; } +}; + +TIoMapper* GetGlslIoMapper() { + return static_cast(new TGlslIoMapper()); +} + +TShader::TShader(EShLanguage s) + : stage(s), lengths(nullptr), stringNames(nullptr), preamble(""), overrideVersion(0) +{ + pool = new TPoolAllocator; + infoSink = new TInfoSink; + compiler = new TDeferredCompiler(stage, *infoSink); + intermediate = new TIntermediate(s); + + // clear environment (avoid constructors in them for use in a C interface) + environment.input.languageFamily = EShSourceNone; + environment.input.dialect = EShClientNone; + environment.input.vulkanRulesRelaxed = false; + environment.client.client = EShClientNone; + environment.target.language = EShTargetNone; + environment.target.hlslFunctionality1 = false; +} + +TShader::~TShader() +{ + delete infoSink; + delete compiler; + delete intermediate; + delete pool; +} + +void TShader::setStrings(const char* const* s, int n) +{ + strings = s; + numStrings = n; + lengths = nullptr; +} + +void TShader::setStringsWithLengths(const char* const* s, const int* l, int n) +{ + strings = s; + numStrings = n; + lengths = l; +} + +void TShader::setStringsWithLengthsAndNames( + const char* const* s, const int* l, const char* const* names, int n) +{ + strings = s; + numStrings = n; + lengths = l; + stringNames = names; +} + +void TShader::setEntryPoint(const char* entryPoint) +{ + intermediate->setEntryPointName(entryPoint); +} + +void TShader::setSourceEntryPoint(const char* name) +{ + sourceEntryPointName = name; +} + +// Log initial settings and transforms. +// See comment for class TProcesses. +void TShader::addProcesses(const std::vector& p) +{ + intermediate->addProcesses(p); +} + +void TShader::setUniqueId(unsigned long long id) +{ + intermediate->setUniqueId(id); +} + +void TShader::setOverrideVersion(int version) +{ + overrideVersion = version; +} + +void TShader::setDebugInfo(bool debugInfo) { intermediate->setDebugInfo(debugInfo); } +void TShader::setInvertY(bool invert) { intermediate->setInvertY(invert); } +void TShader::setDxPositionW(bool invert) { intermediate->setDxPositionW(invert); } +void TShader::setEnhancedMsgs() { intermediate->setEnhancedMsgs(); } +void TShader::setNanMinMaxClamp(bool useNonNan) { intermediate->setNanMinMaxClamp(useNonNan); } + +// Set binding base for given resource type +void TShader::setShiftBinding(TResourceType res, unsigned int base) { + intermediate->setShiftBinding(res, base); +} + +// Set binding base for given resource type for a given binding set. +void TShader::setShiftBindingForSet(TResourceType res, unsigned int base, unsigned int set) { + intermediate->setShiftBindingForSet(res, base, set); +} + +// Set binding base for sampler types +void TShader::setShiftSamplerBinding(unsigned int base) { setShiftBinding(EResSampler, base); } +// Set binding base for texture types (SRV) +void TShader::setShiftTextureBinding(unsigned int base) { setShiftBinding(EResTexture, base); } +// Set binding base for image types +void TShader::setShiftImageBinding(unsigned int base) { setShiftBinding(EResImage, base); } +// Set binding base for uniform buffer objects (CBV) +void TShader::setShiftUboBinding(unsigned int base) { setShiftBinding(EResUbo, base); } +// Synonym for setShiftUboBinding, to match HLSL language. +void TShader::setShiftCbufferBinding(unsigned int base) { setShiftBinding(EResUbo, base); } +// Set binding base for UAV (unordered access view) +void TShader::setShiftUavBinding(unsigned int base) { setShiftBinding(EResUav, base); } +// Set binding base for SSBOs +void TShader::setShiftSsboBinding(unsigned int base) { setShiftBinding(EResSsbo, base); } +// Enables binding automapping using TIoMapper +void TShader::setAutoMapBindings(bool map) { intermediate->setAutoMapBindings(map); } +// Enables position.Y output negation in vertex shader + +// Fragile: currently within one stage: simple auto-assignment of location +void TShader::setAutoMapLocations(bool map) { intermediate->setAutoMapLocations(map); } +void TShader::addUniformLocationOverride(const char* name, int loc) +{ + intermediate->addUniformLocationOverride(name, loc); +} +void TShader::setUniformLocationBase(int base) +{ + intermediate->setUniformLocationBase(base); +} +void TShader::setNoStorageFormat(bool useUnknownFormat) { intermediate->setNoStorageFormat(useUnknownFormat); } +void TShader::setResourceSetBinding(const std::vector& base) { intermediate->setResourceSetBinding(base); } +void TShader::setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { intermediate->setTextureSamplerTransformMode(mode); } + +void TShader::addBlockStorageOverride(const char* nameStr, TBlockStorageClass backing) { intermediate->addBlockStorageOverride(nameStr, backing); } + +void TShader::setGlobalUniformBlockName(const char* name) { intermediate->setGlobalUniformBlockName(name); } +void TShader::setGlobalUniformSet(unsigned int set) { intermediate->setGlobalUniformSet(set); } +void TShader::setGlobalUniformBinding(unsigned int binding) { intermediate->setGlobalUniformBinding(binding); } + +void TShader::setAtomicCounterBlockName(const char* name) { intermediate->setAtomicCounterBlockName(name); } +void TShader::setAtomicCounterBlockSet(unsigned int set) { intermediate->setAtomicCounterBlockSet(set); } + +void TShader::addSourceText(const char* text, size_t len) { intermediate->addSourceText(text, len); } +void TShader::setSourceFile(const char* file) { intermediate->setSourceFile(file); } + +#ifdef ENABLE_HLSL +// See comment above TDefaultHlslIoMapper in iomapper.cpp: +void TShader::setHlslIoMapping(bool hlslIoMap) { intermediate->setHlslIoMapping(hlslIoMap); } +void TShader::setFlattenUniformArrays(bool flatten) { intermediate->setFlattenUniformArrays(flatten); } +#endif + +// +// Turn the shader strings into a parse tree in the TIntermediate. +// +// Returns true for success. +// +bool TShader::parse(const TBuiltInResource* builtInResources, int defaultVersion, EProfile defaultProfile, bool forceDefaultVersionAndProfile, + bool forwardCompatible, EShMessages messages, Includer& includer) +{ + SetThreadPoolAllocator(pool); + + if (! preamble) + preamble = ""; + + return CompileDeferred(compiler, strings, numStrings, lengths, stringNames, + preamble, EShOptNone, builtInResources, defaultVersion, + defaultProfile, forceDefaultVersionAndProfile, overrideVersion, + forwardCompatible, messages, *intermediate, includer, sourceEntryPointName, + &environment, compileOnly); +} + +// Fill in a string with the result of preprocessing ShaderStrings +// Returns true if all extensions, pragmas and version strings were valid. +// +// NOTE: Doing just preprocessing to obtain a correct preprocessed shader string +// is not an officially supported or fully working path. +bool TShader::preprocess(const TBuiltInResource* builtInResources, + int defaultVersion, EProfile defaultProfile, + bool forceDefaultVersionAndProfile, + bool forwardCompatible, EShMessages message, + std::string* output_string, + Includer& includer) +{ + SetThreadPoolAllocator(pool); + + if (! preamble) + preamble = ""; + + return PreprocessDeferred(compiler, strings, numStrings, lengths, stringNames, preamble, + EShOptNone, builtInResources, defaultVersion, + defaultProfile, forceDefaultVersionAndProfile, overrideVersion, + forwardCompatible, message, includer, *intermediate, output_string, + &environment); +} + +const char* TShader::getInfoLog() +{ + return infoSink->info.c_str(); +} + +const char* TShader::getInfoDebugLog() +{ + return infoSink->debug.c_str(); +} + +TProgram::TProgram() : reflection(nullptr), linked(false) +{ + pool = new TPoolAllocator; + infoSink = new TInfoSink; + for (int s = 0; s < EShLangCount; ++s) { + intermediate[s] = nullptr; + newedIntermediate[s] = false; + } +} + +TProgram::~TProgram() +{ + delete infoSink; + delete reflection; + + for (int s = 0; s < EShLangCount; ++s) + if (newedIntermediate[s]) + delete intermediate[s]; + + delete pool; +} + +// +// Merge the compilation units within each stage into a single TIntermediate. +// All starting compilation units need to be the result of calling TShader::parse(). +// +// Return true for success. +// +bool TProgram::link(EShMessages messages) +{ + if (linked) + return false; + linked = true; + + bool error = false; + + SetThreadPoolAllocator(pool); + + for (int s = 0; s < EShLangCount; ++s) { + if (! linkStage((EShLanguage)s, messages)) + error = true; + } + + if (!error) { + if (! crossStageCheck(messages)) + error = true; + } + + if (messages & EShMsgAST) { + for (int s = 0; s < EShLangCount; ++s) { + if (intermediate[s] == nullptr) + continue; + intermediate[s]->output(*infoSink, true); + } + } + + return ! error; +} + +// +// Merge the compilation units within the given stage into a single TIntermediate. +// +// Return true for success. +// +bool TProgram::linkStage(EShLanguage stage, EShMessages messages) +{ + if (stages[stage].size() == 0) + return true; + + int numEsShaders = 0, numNonEsShaders = 0; + for (auto it = stages[stage].begin(); it != stages[stage].end(); ++it) { + if ((*it)->intermediate->getProfile() == EEsProfile) { + numEsShaders++; + } else { + numNonEsShaders++; + } + } + + if (numEsShaders > 0 && numNonEsShaders > 0) { + infoSink->info.message(EPrefixError, "Cannot mix ES profile with non-ES profile shaders"); + return false; + } else if (numEsShaders > 1) { + infoSink->info.message(EPrefixError, "Cannot attach multiple ES shaders of the same type to a single program"); + return false; + } + + // + // Be efficient for the common single compilation unit per stage case, + // reusing it's TIntermediate instead of merging into a new one. + // + TIntermediate *firstIntermediate = stages[stage].front()->intermediate; + if (stages[stage].size() == 1) + intermediate[stage] = firstIntermediate; + else { + intermediate[stage] = new TIntermediate(stage, + firstIntermediate->getVersion(), + firstIntermediate->getProfile()); + intermediate[stage]->setLimits(firstIntermediate->getLimits()); + if (firstIntermediate->getEnhancedMsgs()) + intermediate[stage]->setEnhancedMsgs(); + + // The new TIntermediate must use the same origin as the original TIntermediates. + // Otherwise linking will fail due to different coordinate systems. + if (firstIntermediate->getOriginUpperLeft()) { + intermediate[stage]->setOriginUpperLeft(); + } + intermediate[stage]->setSpv(firstIntermediate->getSpv()); + + newedIntermediate[stage] = true; + } + + if (messages & EShMsgAST) + infoSink->info << "\nLinked " << StageName(stage) << " stage:\n\n"; + + if (stages[stage].size() > 1) { + std::list::const_iterator it; + for (it = stages[stage].begin(); it != stages[stage].end(); ++it) + intermediate[stage]->merge(*infoSink, *(*it)->intermediate); + } + intermediate[stage]->finalCheck(*infoSink, (messages & EShMsgKeepUncalled) != 0); + + return intermediate[stage]->getNumErrors() == 0; +} + +// +// Check that there are no errors in linker objects accross stages +// +// Return true if no errors. +// +bool TProgram::crossStageCheck(EShMessages messages) { + + // make temporary intermediates to hold the linkage symbols for each linking interface + // while we do the checks + // Independent interfaces are: + // all uniform variables and blocks + // all buffer blocks + // all in/out on a stage boundary + + TVector activeStages; + for (int s = 0; s < EShLangCount; ++s) { + if (intermediate[s]) + activeStages.push_back(intermediate[s]); + } + + class TFinalLinkTraverser : public TIntermTraverser { + public: + TFinalLinkTraverser() { } + virtual ~TFinalLinkTraverser() { } + + virtual void visitSymbol(TIntermSymbol* symbol) + { + // Implicitly size arrays. + // If an unsized array is left as unsized, it effectively + // becomes run-time sized. + symbol->getWritableType().adoptImplicitArraySizes(false); + } + } finalLinkTraverser; + + // no extra linking if there is only one stage + if (! (activeStages.size() > 1)) { + if (activeStages.size() == 1 && activeStages[0]->getTreeRoot()) { + activeStages[0]->getTreeRoot()->traverse(&finalLinkTraverser); + } + return true; + } + + // setup temporary tree to hold unfirom objects from different stages + TIntermediate* firstIntermediate = activeStages.front(); + TIntermediate uniforms(EShLangCount, + firstIntermediate->getVersion(), + firstIntermediate->getProfile()); + uniforms.setSpv(firstIntermediate->getSpv()); + + TIntermAggregate uniformObjects(EOpLinkerObjects); + TIntermAggregate root(EOpSequence); + root.getSequence().push_back(&uniformObjects); + uniforms.setTreeRoot(&root); + + bool error = false; + + // merge uniforms from all stages into a single intermediate + for (unsigned int i = 0; i < activeStages.size(); ++i) { + uniforms.mergeUniformObjects(*infoSink, *activeStages[i]); + } + error |= uniforms.getNumErrors() != 0; + + // update implicit array sizes across shader stages + for (unsigned int i = 0; i < activeStages.size(); ++i) { + activeStages[i]->mergeImplicitArraySizes(*infoSink, uniforms); + activeStages[i]->getTreeRoot()->traverse(&finalLinkTraverser); + } + + // copy final definition of global block back into each stage + for (unsigned int i = 0; i < activeStages.size(); ++i) { + // We only want to merge into already existing global uniform blocks. + // A stage that doesn't already know about the global doesn't care about it's content. + // Otherwise we end up pointing to the same object between different stages + // and that will break binding/set remappings + bool mergeExistingOnly = true; + activeStages[i]->mergeGlobalUniformBlocks(*infoSink, uniforms, mergeExistingOnly); + } + + // compare cross stage symbols for each stage boundary + for (unsigned int i = 1; i < activeStages.size(); ++i) { + activeStages[i - 1]->checkStageIO(*infoSink, *activeStages[i], messages); + error |= (activeStages[i - 1]->getNumErrors() != 0 || activeStages[i]->getNumErrors() != 0); + } + + // if requested, optimize cross stage IO + if (messages & EShMsgLinkTimeOptimization) { + for (unsigned int i = 1; i < activeStages.size(); ++i) { + activeStages[i - 1]->optimizeStageIO(*infoSink, *activeStages[i]); + } + } + + return !error; +} + +const char* TProgram::getInfoLog() +{ + return infoSink->info.c_str(); +} + +const char* TProgram::getInfoDebugLog() +{ + return infoSink->debug.c_str(); +} + +// +// Reflection implementation. +// + +unsigned int TObjectReflection::layoutLocation() const { return type->getQualifier().layoutLocation; } + +bool TProgram::buildReflection(int opts) +{ + if (! linked || reflection != nullptr) + return false; + + SetThreadPoolAllocator(pool); + + int firstStage = EShLangVertex, lastStage = EShLangFragment; + + if (opts & EShReflectionIntermediateIO) { + // if we're reflecting intermediate I/O, determine the first and last stage linked and use those as the + // boundaries for which stages generate pipeline inputs/outputs + firstStage = EShLangCount; + lastStage = 0; + for (int s = 0; s < EShLangCount; ++s) { + if (intermediate[s]) { + firstStage = std::min(firstStage, s); + lastStage = std::max(lastStage, s); + } + } + } + + reflection = new TReflection((EShReflectionOptions)opts, (EShLanguage)firstStage, (EShLanguage)lastStage); + + for (int s = 0; s < EShLangCount; ++s) { + if (intermediate[s]) { + if (! reflection->addStage((EShLanguage)s, *intermediate[s])) + return false; + } + } + + return true; +} + +unsigned TProgram::getLocalSize(int dim) const { return reflection->getLocalSize(dim); } +unsigned TProgram::getTileShadingRateQCOM(int dim) const { return reflection->getTileShadingRateQCOM(dim); } +int TProgram::getReflectionIndex(const char* name) const { return reflection->getIndex(name); } +int TProgram::getReflectionPipeIOIndex(const char* name, const bool inOrOut) const + { return reflection->getPipeIOIndex(name, inOrOut); } + +int TProgram::getNumUniformVariables() const { return reflection->getNumUniforms(); } +const TObjectReflection& TProgram::getUniform(int index) const { return reflection->getUniform(index); } +int TProgram::getNumUniformBlocks() const { return reflection->getNumUniformBlocks(); } +const TObjectReflection& TProgram::getUniformBlock(int index) const { return reflection->getUniformBlock(index); } +int TProgram::getNumPipeInputs() const { return reflection->getNumPipeInputs(); } +const TObjectReflection& TProgram::getPipeInput(int index) const { return reflection->getPipeInput(index); } +int TProgram::getNumPipeOutputs() const { return reflection->getNumPipeOutputs(); } +const TObjectReflection& TProgram::getPipeOutput(int index) const { return reflection->getPipeOutput(index); } +int TProgram::getNumBufferVariables() const { return reflection->getNumBufferVariables(); } +const TObjectReflection& TProgram::getBufferVariable(int index) const { return reflection->getBufferVariable(index); } +int TProgram::getNumBufferBlocks() const { return reflection->getNumStorageBuffers(); } +const TObjectReflection& TProgram::getBufferBlock(int index) const { return reflection->getStorageBufferBlock(index); } +int TProgram::getNumAtomicCounters() const { return reflection->getNumAtomicCounters(); } +const TObjectReflection& TProgram::getAtomicCounter(int index) const { return reflection->getAtomicCounter(index); } +void TProgram::dumpReflection() { if (reflection != nullptr) reflection->dump(); } + +TIoMapResolver* TProgram::getGlslIoResolver(EShLanguage stage) { + auto *intermediate = getIntermediate(stage); + if (!intermediate) + return NULL; + return static_cast(new TDefaultGlslIoResolver(*intermediate)); +} +// +// I/O mapping implementation. +// +bool TProgram::mapIO(TIoMapResolver* pResolver, TIoMapper* pIoMapper) +{ + if (! linked) + return false; + + SetThreadPoolAllocator(pool); + + TIoMapper* ioMapper = nullptr; + TIoMapper defaultIOMapper; + if (pIoMapper == nullptr) + ioMapper = &defaultIOMapper; + else + ioMapper = pIoMapper; + for (int s = 0; s < EShLangCount; ++s) { + if (intermediate[s]) { + if (! ioMapper->addStage((EShLanguage)s, *intermediate[s], *infoSink, pResolver)) + return false; + } + } + + return ioMapper->doMap(pResolver, *infoSink); +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp new file mode 100644 index 0000000000..f7069a5bc7 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp @@ -0,0 +1,362 @@ +// +// Copyright(C) 2021 Advanced Micro Devices, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// GL_EXT_spirv_intrinsics +// +#include "../Include/intermediate.h" +#include "../Include/SpirvIntrinsics.h" +#include "../Include/Types.h" +#include "ParseHelper.h" + +namespace QtShaderTools { +namespace glslang { + +bool TSpirvTypeParameter::operator==(const TSpirvTypeParameter& rhs) const +{ + if (getAsConstant() != nullptr) + return getAsConstant()->getConstArray() == rhs.getAsConstant()->getConstArray(); + + assert(getAsType() != nullptr); + return *getAsType() == *rhs.getAsType(); +} + +// +// Handle SPIR-V requirements +// +TSpirvRequirement* TParseContext::makeSpirvRequirement(const TSourceLoc& loc, const TString& name, + const TIntermAggregate* extensions, + const TIntermAggregate* capabilities) +{ + TSpirvRequirement* spirvReq = new TSpirvRequirement; + + if (name == "extensions") { + assert(extensions); + for (auto extension : extensions->getSequence()) { + assert(extension->getAsConstantUnion()); + spirvReq->extensions.insert(*extension->getAsConstantUnion()->getConstArray()[0].getSConst()); + } + } else if (name == "capabilities") { + assert(capabilities); + for (auto capability : capabilities->getSequence()) { + assert(capability->getAsConstantUnion()); + spirvReq->capabilities.insert(capability->getAsConstantUnion()->getConstArray()[0].getIConst()); + } + } else + error(loc, "unknown SPIR-V requirement", name.c_str(), ""); + + return spirvReq; +} + +TSpirvRequirement* TParseContext::mergeSpirvRequirements(const TSourceLoc& loc, TSpirvRequirement* spirvReq1, + TSpirvRequirement* spirvReq2) +{ + // Merge the second SPIR-V requirement to the first one + if (!spirvReq2->extensions.empty()) { + if (spirvReq1->extensions.empty()) + spirvReq1->extensions = spirvReq2->extensions; + else + error(loc, "too many SPIR-V requirements", "extensions", ""); + } + + if (!spirvReq2->capabilities.empty()) { + if (spirvReq1->capabilities.empty()) + spirvReq1->capabilities = spirvReq2->capabilities; + else + error(loc, "too many SPIR-V requirements", "capabilities", ""); + } + + return spirvReq1; +} + +void TIntermediate::insertSpirvRequirement(const TSpirvRequirement* spirvReq) +{ + if (!spirvRequirement) + spirvRequirement = new TSpirvRequirement; + + for (auto extension : spirvReq->extensions) + spirvRequirement->extensions.insert(extension); + + for (auto capability : spirvReq->capabilities) + spirvRequirement->capabilities.insert(capability); +} + +// +// Handle SPIR-V execution modes +// +void TIntermediate::insertSpirvExecutionMode(int executionMode, const TIntermAggregate* args) +{ + if (!spirvExecutionMode) + spirvExecutionMode = new TSpirvExecutionMode; + + TVector extraOperands; + if (args) { + for (auto arg : args->getSequence()) { + auto extraOperand = arg->getAsConstantUnion(); + assert(extraOperand != nullptr); + extraOperands.push_back(extraOperand); + } + } + spirvExecutionMode->modes[executionMode] = extraOperands; +} + +void TIntermediate::insertSpirvExecutionModeId(int executionMode, const TIntermAggregate* args) +{ + if (!spirvExecutionMode) + spirvExecutionMode = new TSpirvExecutionMode; + + assert(args); + TVector extraOperands; + + for (auto arg : args->getSequence()) { + auto extraOperand = arg->getAsTyped(); + assert(extraOperand != nullptr && extraOperand->getQualifier().isConstant()); + extraOperands.push_back(extraOperand); + } + spirvExecutionMode->modeIds[executionMode] = extraOperands; +} + +// +// Handle SPIR-V decorate qualifiers +// +void TQualifier::setSpirvDecorate(int decoration, const TIntermAggregate* args) +{ + if (!spirvDecorate) + spirvDecorate = new TSpirvDecorate; + + TVector extraOperands; + if (args) { + for (auto arg : args->getSequence()) { + auto extraOperand = arg->getAsConstantUnion(); + assert(extraOperand != nullptr); + extraOperands.push_back(extraOperand); + } + } + spirvDecorate->decorates[decoration] = extraOperands; +} + +void TQualifier::setSpirvDecorateId(int decoration, const TIntermAggregate* args) +{ + if (!spirvDecorate) + spirvDecorate = new TSpirvDecorate; + + assert(args); + TVector extraOperands; + for (auto arg : args->getSequence()) { + auto extraOperand = arg->getAsTyped(); + assert(extraOperand != nullptr); + extraOperands.push_back(extraOperand); + } + spirvDecorate->decorateIds[decoration] = extraOperands; +} + +void TQualifier::setSpirvDecorateString(int decoration, const TIntermAggregate* args) +{ + if (!spirvDecorate) + spirvDecorate = new TSpirvDecorate; + + assert(args); + TVector extraOperands; + for (auto arg : args->getSequence()) { + auto extraOperand = arg->getAsConstantUnion(); + assert(extraOperand != nullptr); + extraOperands.push_back(extraOperand); + } + spirvDecorate->decorateStrings[decoration] = extraOperands; +} + +TString TQualifier::getSpirvDecorateQualifierString() const +{ + assert(spirvDecorate); + + TString qualifierString; + + const auto appendFloat = [&](float f) { qualifierString.append(std::to_string(f).c_str()); }; + const auto appendInt = [&](int i) { qualifierString.append(std::to_string(i).c_str()); }; + const auto appendUint = [&](unsigned int u) { qualifierString.append(std::to_string(u).c_str()); }; + const auto appendBool = [&](bool b) { qualifierString.append(std::to_string(b).c_str()); }; + const auto appendStr = [&](const char* s) { qualifierString.append(s); }; + + const auto appendDecorate = [&](const TIntermTyped* constant) { + if (constant->getAsConstantUnion()) { + auto& constArray = constant->getAsConstantUnion()->getConstArray(); + if (constant->getBasicType() == EbtFloat) { + float value = static_cast(constArray[0].getDConst()); + appendFloat(value); + } else if (constant->getBasicType() == EbtInt) { + int value = constArray[0].getIConst(); + appendInt(value); + } else if (constant->getBasicType() == EbtUint) { + unsigned value = constArray[0].getUConst(); + appendUint(value); + } else if (constant->getBasicType() == EbtBool) { + bool value = constArray[0].getBConst(); + appendBool(value); + } else if (constant->getBasicType() == EbtString) { + const TString* value = constArray[0].getSConst(); + appendStr(value->c_str()); + } else + assert(0); + } else { + assert(constant->getAsSymbolNode()); + appendStr(constant->getAsSymbolNode()->getName().c_str()); + } + }; + + for (auto& decorate : spirvDecorate->decorates) { + appendStr("spirv_decorate("); + appendInt(decorate.first); + for (auto extraOperand : decorate.second) { + appendStr(", "); + appendDecorate(extraOperand); + } + appendStr(") "); + } + + for (auto& decorateId : spirvDecorate->decorateIds) { + appendStr("spirv_decorate_id("); + appendInt(decorateId.first); + for (auto extraOperand : decorateId.second) { + appendStr(", "); + appendDecorate(extraOperand); + } + appendStr(") "); + } + + for (auto& decorateString : spirvDecorate->decorateStrings) { + appendStr("spirv_decorate_string("); + appendInt(decorateString.first); + for (auto extraOperand : decorateString.second) { + appendStr(", "); + appendDecorate(extraOperand); + } + appendStr(") "); + } + + return qualifierString; +} + +// +// Handle SPIR-V type specifiers +// +void TPublicType::setSpirvType(const TSpirvInstruction& spirvInst, const TSpirvTypeParameters* typeParams) +{ + if (!spirvType) + spirvType = new TSpirvType; + + basicType = EbtSpirvType; + spirvType->spirvInst = spirvInst; + if (typeParams) + spirvType->typeParams = *typeParams; +} + +TSpirvTypeParameters* TParseContext::makeSpirvTypeParameters(const TSourceLoc& loc, const TIntermConstantUnion* constant) +{ + TSpirvTypeParameters* spirvTypeParams = new TSpirvTypeParameters; + if (constant->getBasicType() != EbtFloat && + constant->getBasicType() != EbtInt && + constant->getBasicType() != EbtUint && + constant->getBasicType() != EbtBool && + constant->getBasicType() != EbtString) + error(loc, "this type not allowed", constant->getType().getBasicString(), ""); + else + spirvTypeParams->push_back(TSpirvTypeParameter(constant)); + + return spirvTypeParams; +} + +TSpirvTypeParameters* TParseContext::makeSpirvTypeParameters(const TSourceLoc& /* loc */, + const TPublicType& type) +{ + TSpirvTypeParameters* spirvTypeParams = new TSpirvTypeParameters; + spirvTypeParams->push_back(TSpirvTypeParameter(new TType(type))); + return spirvTypeParams; +} + +TSpirvTypeParameters* TParseContext::mergeSpirvTypeParameters(TSpirvTypeParameters* spirvTypeParams1, TSpirvTypeParameters* spirvTypeParams2) +{ + // Merge SPIR-V type parameters of the second one to the first one + for (const auto& spirvTypeParam : *spirvTypeParams2) + spirvTypeParams1->push_back(spirvTypeParam); + return spirvTypeParams1; +} + +// +// Handle SPIR-V instruction qualifiers +// +TSpirvInstruction* TParseContext::makeSpirvInstruction(const TSourceLoc& loc, const TString& name, const TString& value) +{ + TSpirvInstruction* spirvInst = new TSpirvInstruction; + if (name == "set") + spirvInst->set = value; + else + error(loc, "unknown SPIR-V instruction qualifier", name.c_str(), ""); + + return spirvInst; +} + +TSpirvInstruction* TParseContext::makeSpirvInstruction(const TSourceLoc& loc, const TString& name, int value) +{ + TSpirvInstruction* spirvInstuction = new TSpirvInstruction; + if (name == "id") + spirvInstuction->id = value; + else + error(loc, "unknown SPIR-V instruction qualifier", name.c_str(), ""); + + return spirvInstuction; +} + +TSpirvInstruction* TParseContext::mergeSpirvInstruction(const TSourceLoc& loc, TSpirvInstruction* spirvInst1, TSpirvInstruction* spirvInst2) +{ + // Merge qualifiers of the second SPIR-V instruction to those of the first one + if (!spirvInst2->set.empty()) { + if (spirvInst1->set.empty()) + spirvInst1->set = spirvInst2->set; + else + error(loc, "too many SPIR-V instruction qualifiers", "spirv_instruction", "(set)"); + } + + if (spirvInst2->id != -1) { + if (spirvInst1->id == -1) + spirvInst1->id = spirvInst2->id; + else + error(loc, "too many SPIR-V instruction qualifiers", "spirv_instruction", "(id)"); + } + + return spirvInst1; +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp new file mode 100644 index 0000000000..ce00a61dae --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp @@ -0,0 +1,527 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. +// Copyright (C) 2015-2018 Google, Inc. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// Symbol table for parsing. Most functionality and main ideas +// are documented in the header file. +// + +#include "SymbolTable.h" + +namespace QtShaderTools { +namespace glslang { + +// +// TType helper function needs a place to live. +// + +// +// Recursively generate mangled names. +// +void TType::buildMangledName(TString& mangledName) const +{ + if (isTensorARM()) + mangledName += 'T'; + else if (isMatrix()) + mangledName += 'm'; + else if (isVector()) + mangledName += 'v'; + + if (isCoopVecNV()) + mangledName += "coopvec"; + + switch (basicType) { + case EbtFloat: mangledName += 'f'; break; + case EbtInt: mangledName += 'i'; break; + case EbtUint: mangledName += 'u'; break; + case EbtBool: mangledName += 'b'; break; + case EbtDouble: mangledName += 'd'; break; + case EbtFloat16: mangledName += "f16"; break; + case EbtBFloat16: mangledName += "bf16"; break; + case EbtFloatE5M2: mangledName += "fe5m2"; break; + case EbtFloatE4M3: mangledName += "fe4m3"; break; + case EbtInt8: mangledName += "i8"; break; + case EbtUint8: mangledName += "u8"; break; + case EbtInt16: mangledName += "i16"; break; + case EbtUint16: mangledName += "u16"; break; + case EbtInt64: mangledName += "i64"; break; + case EbtUint64: mangledName += "u64"; break; + case EbtAtomicUint: mangledName += "au"; break; + case EbtAccStruct: mangledName += "as"; break; + case EbtRayQuery: mangledName += "rq"; break; + case EbtSpirvType: mangledName += "spv-t"; break; + case EbtHitObjectNV: mangledName += "ho"; break; + case EbtHitObjectEXT: mangledName += "ho"; break; + case EbtTensorLayoutNV: mangledName += "tl"; break; + case EbtTensorViewNV: mangledName += "tv"; break; + case EbtSampler: + switch (sampler.type) { + case EbtFloat16: mangledName += "f16"; break; + case EbtInt: mangledName += "i"; break; + case EbtUint: mangledName += "u"; break; + case EbtInt64: mangledName += "i64"; break; + case EbtUint64: mangledName += "u64"; break; + default: break; // some compilers want this + } + if (sampler.isImageClass()) + mangledName += "I"; // a normal image or subpass + else if (sampler.isPureSampler()) + mangledName += "p"; // a "pure" sampler + else if (!sampler.isCombined()) + mangledName += "t"; // a "pure" texture + else + mangledName += "s"; // traditional combined sampler + if (sampler.isArrayed()) + mangledName += "A"; + if (sampler.isShadow()) + mangledName += "S"; + if (sampler.isExternal()) + mangledName += "E"; + if (sampler.isYuv()) + mangledName += "Y"; + switch (sampler.dim) { + case Esd2D: mangledName += "2"; break; + case Esd3D: mangledName += "3"; break; + case EsdCube: mangledName += "C"; break; + case Esd1D: mangledName += "1"; break; + case EsdRect: mangledName += "R2"; break; + case EsdBuffer: mangledName += "B"; break; + case EsdSubpass: mangledName += "P"; break; + default: break; // some compilers want this + } + +#ifdef ENABLE_HLSL + if (sampler.hasReturnStruct()) { + // Name mangle for sampler return struct uses struct table index. + mangledName += "-tx-struct"; + + char text[16]; // plenty enough space for the small integers. + snprintf(text, sizeof(text), "%u-", sampler.getStructReturnIndex()); + mangledName += text; + } else { + switch (sampler.getVectorSize()) { + case 1: mangledName += "1"; break; + case 2: mangledName += "2"; break; + case 3: mangledName += "3"; break; + case 4: break; // default to prior name mangle behavior + } + } +#endif + + if (sampler.isMultiSample()) + mangledName += "M"; + break; + case EbtStruct: + case EbtBlock: + if (basicType == EbtStruct) + mangledName += "struct-"; + else + mangledName += "block-"; + if (typeName) + mangledName += *typeName; + for (unsigned int i = 0; i < structure->size(); ++i) { + if ((*structure)[i].type->getBasicType() == EbtVoid) + continue; + mangledName += '-'; + (*structure)[i].type->buildMangledName(mangledName); + } + break; + default: + break; + } + + if (getVectorSize() > 0) + mangledName += static_cast('0' + getVectorSize()); + else { + mangledName += static_cast('0' + getMatrixCols()); + mangledName += static_cast('0' + getMatrixRows()); + } + + if (typeParameters) { + const int maxSize = 11; + char buf[maxSize]; + for (int i = 0; i < typeParameters->arraySizes->getNumDims(); ++i) { + if (typeParameters->arraySizes->getDimNode(i)) { + if (typeParameters->arraySizes->getDimNode(i)->getAsSymbolNode()) + snprintf(buf, maxSize, "s%lld", typeParameters->arraySizes->getDimNode(i)->getAsSymbolNode()->getId()); + else + snprintf(buf, maxSize, "s%p", typeParameters->arraySizes->getDimNode(i)); + } else + snprintf(buf, maxSize, "%d", typeParameters->arraySizes->getDimSize(i)); + mangledName += '<'; + mangledName += buf; + mangledName += '>'; + } + } + + if (arraySizes) { + const int maxSize = 11; + char buf[maxSize]; + for (int i = 0; i < arraySizes->getNumDims(); ++i) { + if (arraySizes->getDimNode(i)) { + if (arraySizes->getDimNode(i)->getAsSymbolNode()) + snprintf(buf, maxSize, "s%lld", arraySizes->getDimNode(i)->getAsSymbolNode()->getId()); + else + snprintf(buf, maxSize, "s%p", (void*)(arraySizes->getDimNode(i))); + } else + snprintf(buf, maxSize, "%d", arraySizes->getDimSize(i)); + mangledName += '['; + mangledName += buf; + mangledName += ']'; + } + } +} + +// +// Dump functions. +// + +void TSymbol::dumpExtensions(TInfoSink& infoSink) const +{ + int numExtensions = getNumExtensions(); + if (numExtensions) { + infoSink.debug << " <"; + + for (int i = 0; i < numExtensions; i++) + infoSink.debug << getExtensions()[i] << ","; + + infoSink.debug << ">"; + } +} + +void TVariable::dump(TInfoSink& infoSink, bool complete) const +{ + if (complete) { + infoSink.debug << getName().c_str() << ": " << type.getCompleteString(); + dumpExtensions(infoSink); + } else { + infoSink.debug << getName().c_str() << ": " << type.getStorageQualifierString() << " " + << type.getBasicTypeString(); + + if (type.isArray()) + infoSink.debug << "[0]"; + } + + infoSink.debug << "\n"; +} + +void TFunction::dump(TInfoSink& infoSink, bool complete) const +{ + if (complete) { + infoSink.debug << getName().c_str() << ": " << returnType.getCompleteString() << " " << getName().c_str() + << "("; + + int numParams = getParamCount(); + for (int i = 0; i < numParams; i++) { + const TParameter ¶m = parameters[i]; + infoSink.debug << param.type->getCompleteString() << " " + << (param.type->isStruct() ? "of " + param.type->getTypeName() + " " : "") + << (param.name ? *param.name : "") << (i < numParams - 1 ? "," : ""); + } + + infoSink.debug << ")"; + dumpExtensions(infoSink); + } else { + infoSink.debug << getName().c_str() << ": " << returnType.getBasicTypeString() << " " + << getMangledName().c_str() << "n"; + } + + infoSink.debug << "\n"; +} + +void TAnonMember::dump(TInfoSink& TInfoSink, bool) const +{ + TInfoSink.debug << "anonymous member " << getMemberNumber() << " of " << getAnonContainer().getName().c_str() + << "\n"; +} + +void TSymbolTableLevel::dump(TInfoSink& infoSink, bool complete) const +{ + tLevel::const_iterator it; + for (it = level.begin(); it != level.end(); ++it) + (*it).second->dump(infoSink, complete); +} + +void TSymbolTable::dump(TInfoSink& infoSink, bool complete) const +{ + for (int level = currentLevel(); level >= 0; --level) { + infoSink.debug << "LEVEL " << level << "\n"; + table[level]->dump(infoSink, complete); + } +} + +// +// Functions have buried pointers to delete. +// +TFunction::~TFunction() +{ + for (TParamList::iterator i = parameters.begin(); i != parameters.end(); ++i) + delete (*i).type; +} + +// +// Symbol table levels are a map of pointers to symbols that have to be deleted. +// +TSymbolTableLevel::~TSymbolTableLevel() +{ + for (tLevel::iterator it = level.begin(); it != level.end(); ++it) { + const TString& name = it->first; + auto retargetIter = std::find_if(retargetedSymbols.begin(), retargetedSymbols.end(), + [&name](const std::pair& i) { return i.first == name; }); + if (retargetIter == retargetedSymbols.end()) + delete (*it).second; + } + + + delete [] defaultPrecision; +} + +// +// Change all function entries in the table with the non-mangled name +// to be related to the provided built-in operation. +// +void TSymbolTableLevel::relateToOperator(const char* name, TOperator op) +{ + tLevel::const_iterator candidate = level.lower_bound(name); + while (candidate != level.end()) { + const TString& candidateName = (*candidate).first; + TString::size_type parenAt = candidateName.find_first_of('('); + if (parenAt != candidateName.npos && candidateName.compare(0, parenAt, name) == 0) { + TFunction* function = (*candidate).second->getAsFunction(); + function->relateToOperator(op); + } else + break; + ++candidate; + } +} + +// Make all function overloads of the given name require an extension(s). +// Should only be used for a version/profile that actually needs the extension(s). +void TSymbolTableLevel::setFunctionExtensions(const char* name, int num, const char* const extensions[]) +{ + tLevel::const_iterator candidate = level.lower_bound(name); + while (candidate != level.end()) { + const TString& candidateName = (*candidate).first; + TString::size_type parenAt = candidateName.find_first_of('('); + if (parenAt != candidateName.npos && candidateName.compare(0, parenAt, name) == 0) { + TSymbol* symbol = candidate->second; + symbol->setExtensions(num, extensions); + } else + break; + ++candidate; + } +} + +// Call the callback function to determine the required extensions +void TSymbolTableLevel::setFunctionExtensionsCallback(const char* name, std::function(const char *)> const &func) +{ + tLevel::const_iterator candidate = level.lower_bound(name); + while (candidate != level.end()) { + const TString& candidateName = (*candidate).first; + TString::size_type parenAt = candidateName.find_first_of('('); + if (parenAt != candidateName.npos && candidateName.compare(0, parenAt, name) == 0) { + TSymbol* symbol = candidate->second; + + auto exts = func(candidateName.c_str()); + symbol->setExtensions(exts.size(), exts.data()); + } else + break; + ++candidate; + } +} + +// Make a single function require an extension(s). i.e., this will only set the extensions for the symbol that matches 'name' exactly. +// This is different from setFunctionExtensions, which uses std::map::lower_bound to effectively set all symbols that start with 'name'. +// Should only be used for a version/profile that actually needs the extension(s). +void TSymbolTableLevel::setSingleFunctionExtensions(const char* name, int num, const char* const extensions[]) +{ + if (auto candidate = level.find(name); candidate != level.end()) { + candidate->second->setExtensions(num, extensions); + } +} + +// +// Make all symbols in this table level read only. +// +void TSymbolTableLevel::readOnly() +{ + for (tLevel::iterator it = level.begin(); it != level.end(); ++it) + (*it).second->makeReadOnly(); +} + +// +// Copy a symbol, but the copy is writable; call readOnly() afterward if that's not desired. +// +TSymbol::TSymbol(const TSymbol& copyOf) +{ + name = NewPoolTString(copyOf.name->c_str()); + mangledName = NewPoolTString(copyOf.mangledName->c_str()); + uniqueId = copyOf.uniqueId; + writable = true; +} + +TVariable::TVariable(const TVariable& copyOf) : TSymbol(copyOf) +{ + type.deepCopy(copyOf.type); + userType = copyOf.userType; + + // we don't support specialization-constant subtrees in cloned tables, only extensions + constSubtree = nullptr; + extensions = nullptr; + memberExtensions = nullptr; + if (copyOf.getNumExtensions() > 0) + setExtensions(copyOf.getNumExtensions(), copyOf.getExtensions()); + if (copyOf.hasMemberExtensions()) { + for (int m = 0; m < (int)copyOf.type.getStruct()->size(); ++m) { + if (copyOf.getNumMemberExtensions(m) > 0) + setMemberExtensions(m, copyOf.getNumMemberExtensions(m), copyOf.getMemberExtensions(m)); + } + } + + if (! copyOf.constArray.empty()) { + assert(! copyOf.type.isStruct()); + TConstUnionArray newArray(copyOf.constArray, 0, copyOf.constArray.size()); + constArray = newArray; + } +} + +TVariable* TVariable::clone() const +{ + TVariable *variable = new TVariable(*this); + + return variable; +} + +TFunction::TFunction(const TFunction& copyOf) : TSymbol(copyOf) +{ + for (unsigned int i = 0; i < copyOf.parameters.size(); ++i) { + TParameter param{}; + parameters.push_back(param); + (void)parameters.back().copyParam(copyOf.parameters[i]); + } + + extensions = nullptr; + if (copyOf.getNumExtensions() > 0) + setExtensions(copyOf.getNumExtensions(), copyOf.getExtensions()); + returnType.deepCopy(copyOf.returnType); + mangledName = copyOf.mangledName; + op = copyOf.op; + defined = copyOf.defined; + prototyped = copyOf.prototyped; + implicitThis = copyOf.implicitThis; + variadic = copyOf.variadic; + illegalImplicitThis = copyOf.illegalImplicitThis; + defaultParamCount = copyOf.defaultParamCount; + spirvInst = copyOf.spirvInst; +} + +TFunction* TFunction::clone() const +{ + TFunction *function = new TFunction(*this); + + return function; +} + +TAnonMember* TAnonMember::clone() const +{ + // Anonymous members of a given block should be cloned at a higher level, + // where they can all be assured to still end up pointing to a single + // copy of the original container. + assert(0); + + return nullptr; +} + +TSymbolTableLevel* TSymbolTableLevel::clone() const +{ + TSymbolTableLevel *symTableLevel = new TSymbolTableLevel(); + symTableLevel->anonId = anonId; + symTableLevel->thisLevel = thisLevel; + symTableLevel->retargetedSymbols.clear(); + for (auto &s : retargetedSymbols) { + symTableLevel->retargetedSymbols.push_back({s.first, s.second}); + } + std::vector containerCopied(anonId, false); + tLevel::const_iterator iter; + for (iter = level.begin(); iter != level.end(); ++iter) { + const TAnonMember* anon = iter->second->getAsAnonMember(); + if (anon) { + // Insert all the anonymous members of this same container at once, + // avoid inserting the remaining members in the future, once this has been done, + // allowing them to all be part of the same new container. + if (! containerCopied[anon->getAnonId()]) { + TVariable* container = anon->getAnonContainer().clone(); + container->changeName(NewPoolTString("")); + // insert the container and all its members + symTableLevel->insert(*container, false); + containerCopied[anon->getAnonId()] = true; + } + } else { + const TString& name = iter->first; + auto retargetIter = std::find_if(retargetedSymbols.begin(), retargetedSymbols.end(), + [&name](const std::pair& i) { return i.first == name; }); + if (retargetIter != retargetedSymbols.end()) + continue; + symTableLevel->insert(*iter->second->clone(), false); + } + } + // Now point retargeted symbols to the newly created versions of them + for (auto &s : retargetedSymbols) { + TSymbol* sym = symTableLevel->find(s.second); + if (!sym) + continue; + symTableLevel->insert(s.first, sym); + } + + return symTableLevel; +} + +void TSymbolTable::copyTable(const TSymbolTable& copyOf) +{ + assert(adoptedLevels == copyOf.adoptedLevels); + + uniqueId = copyOf.uniqueId; + noBuiltInRedeclarations = copyOf.noBuiltInRedeclarations; + separateNameSpaces = copyOf.separateNameSpaces; + for (unsigned int i = copyOf.adoptedLevels; i < copyOf.table.size(); ++i) + table.push_back(copyOf.table[i]->clone()); +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h new file mode 100644 index 0000000000..f76c71ee16 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h @@ -0,0 +1,997 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef _SYMBOL_TABLE_INCLUDED_ +#define _SYMBOL_TABLE_INCLUDED_ + +// +// Symbol table for parsing. Has these design characteristics: +// +// * Same symbol table can be used to compile many shaders, to preserve +// effort of creating and loading with the large numbers of built-in +// symbols. +// +// --> This requires a copy mechanism, so initial pools used to create +// the shared information can be popped. Done through "clone" +// methods. +// +// * Name mangling will be used to give each function a unique name +// so that symbol table lookups are never ambiguous. This allows +// a simpler symbol table structure. +// +// * Pushing and popping of scope, so symbol table will really be a stack +// of symbol tables. Searched from the top, with new inserts going into +// the top. +// +// * Constants: Compile time constant symbols will keep their values +// in the symbol table. The parser can substitute constants at parse +// time, including doing constant folding and constant propagation. +// +// * No temporaries: Temporaries made from operations (+, --, .xy, etc.) +// are tracked in the intermediate representation, not the symbol table. +// + +#include "../Include/Common.h" +#include "../Include/intermediate.h" +#include "../Include/InfoSink.h" +#include +#include + +namespace QtShaderTools { +namespace glslang { + +// +// Symbol base class. (Can build functions or variables out of these...) +// + +class TVariable; +class TFunction; +class TAnonMember; + +typedef TVector TExtensionList; + +class TSymbol { +public: + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + explicit TSymbol(const TString *n, const TString *mn) : name(n), mangledName(mn), uniqueId(0), extensions(nullptr), writable(true) { } + explicit TSymbol(const TString *n) : TSymbol(n, n) { } + virtual TSymbol* clone() const = 0; + virtual ~TSymbol() { } // rely on all symbol owned memory coming from the pool + + virtual const TString& getName() const { return *name; } + virtual void changeName(const TString* newName) { name = newName; } + virtual void addPrefix(const char* prefix) + { + TString newName(prefix); + newName.append(*name); + changeName(NewPoolTString(newName.c_str())); + } + virtual const TString& getMangledName() const { return *mangledName; } + virtual TFunction* getAsFunction() { return nullptr; } + virtual const TFunction* getAsFunction() const { return nullptr; } + virtual TVariable* getAsVariable() { return nullptr; } + virtual const TVariable* getAsVariable() const { return nullptr; } + virtual const TAnonMember* getAsAnonMember() const { return nullptr; } + virtual const TType& getType() const = 0; + virtual TType& getWritableType() = 0; + virtual void setUniqueId(long long id) { uniqueId = id; } + virtual long long getUniqueId() const { return uniqueId; } + virtual void setExtensions(int numExts, const char* const exts[]) + { + assert(extensions == nullptr); + assert(numExts > 0); + extensions = NewPoolObject(extensions); + for (int e = 0; e < numExts; ++e) + extensions->push_back(exts[e]); + } + virtual int getNumExtensions() const { return extensions == nullptr ? 0 : (int)extensions->size(); } + virtual const char** getExtensions() const { return extensions->data(); } + + virtual void dump(TInfoSink& infoSink, bool complete = false) const = 0; + void dumpExtensions(TInfoSink& infoSink) const; + + virtual bool isReadOnly() const { return ! writable; } + virtual void makeReadOnly() { writable = false; } + +protected: + explicit TSymbol(const TSymbol&); + TSymbol& operator=(const TSymbol&); + + const TString *name; + const TString *mangledName; + unsigned long long uniqueId; // For cross-scope comparing during code generation + + // For tracking what extensions must be present + // (don't use if correct version/profile is present). + TExtensionList* extensions; // an array of pointers to existing constant char strings + + // + // N.B.: Non-const functions that will be generally used should assert on this, + // to avoid overwriting shared symbol-table information. + // + bool writable; +}; + +// +// Variable class, meaning a symbol that's not a function. +// +// There could be a separate class hierarchy for Constant variables; +// Only one of int, bool, or float, (or none) is correct for +// any particular use, but it's easy to do this way, and doesn't +// seem worth having separate classes, and "getConst" can't simply return +// different values for different types polymorphically, so this is +// just simple and pragmatic. +// +class TVariable : public TSymbol { +public: + TVariable(const TString *name, const TType& t, bool uT = false ) + : TVariable(name, name, t, uT) {} + TVariable(const TString *name, const TString *mangledName, const TType& t, bool uT = false ) + : TSymbol(name, mangledName), + userType(uT), + constSubtree(nullptr), + memberExtensions(nullptr), + anonId(-1) + { type.shallowCopy(t); } + virtual TVariable* clone() const; + virtual ~TVariable() { } + + virtual TVariable* getAsVariable() { return this; } + virtual const TVariable* getAsVariable() const { return this; } + virtual const TType& getType() const { return type; } + virtual TType& getWritableType() { assert(writable); return type; } + virtual bool isUserType() const { return userType; } + virtual const TConstUnionArray& getConstArray() const { return constArray; } + virtual TConstUnionArray& getWritableConstArray() { assert(writable); return constArray; } + virtual void setConstArray(const TConstUnionArray& array) { constArray = array; } + virtual void setConstSubtree(TIntermTyped* subtree) { constSubtree = subtree; } + virtual TIntermTyped* getConstSubtree() const { return constSubtree; } + virtual void setAnonId(int i) { anonId = i; } + virtual int getAnonId() const { return anonId; } + + virtual void setMemberExtensions(int member, int numExts, const char* const exts[]) + { + assert(type.isStruct()); + assert(numExts > 0); + if (memberExtensions == nullptr) { + memberExtensions = NewPoolObject(memberExtensions); + memberExtensions->resize(type.getStruct()->size()); + } + for (int e = 0; e < numExts; ++e) + (*memberExtensions)[member].push_back(exts[e]); + } + virtual bool hasMemberExtensions() const { return memberExtensions != nullptr; } + virtual int getNumMemberExtensions(int member) const + { + return memberExtensions == nullptr ? 0 : (int)(*memberExtensions)[member].size(); + } + virtual const char** getMemberExtensions(int member) const { return (*memberExtensions)[member].data(); } + + virtual void dump(TInfoSink& infoSink, bool complete = false) const; + +protected: + explicit TVariable(const TVariable&); + TVariable& operator=(const TVariable&); + + TType type; + bool userType; + + // we are assuming that Pool Allocator will free the memory allocated to unionArray + // when this object is destroyed + + TConstUnionArray constArray; // for compile-time constant value + TIntermTyped* constSubtree; // for specialization constant computation + TVector* memberExtensions; // per-member extension list, allocated only when needed + int anonId; // the ID used for anonymous blocks: TODO: see if uniqueId could serve a dual purpose +}; + +// +// The function sub-class of symbols and the parser will need to +// share this definition of a function parameter. +// +struct TParameter { + TString *name; + TType* type; + TIntermTyped* defaultValue; + TParameter& copyParam(const TParameter& param) + { + if (param.name) + name = NewPoolTString(param.name->c_str()); + else + name = nullptr; + type = param.type->clone(); + defaultValue = param.defaultValue; + if (defaultValue) { + // The defaultValue of a builtin is created in a TPoolAllocator that no longer exists + // when parsing the user program, so make a deep copy. + if (const auto *constUnion = defaultValue->getAsConstantUnion()) { + defaultValue = new TIntermConstantUnion(*constUnion->getConstArray().clone(), constUnion->getType()); + } + } + return *this; + } + TBuiltInVariable getDeclaredBuiltIn() const { return type->getQualifier().declaredBuiltIn; } +}; + +// +// The function sub-class of a symbol. +// +class TFunction : public TSymbol { +public: + explicit TFunction(TOperator o) : + TSymbol(nullptr), + op(o), + defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), variadic(false), defaultParamCount(0) { } + TFunction(const TString *name, const TType& retType, TOperator tOp = EOpNull) : + TSymbol(name), + mangledName(*name + '('), + op(tOp), + defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), variadic(false), defaultParamCount(0), + linkType(ELinkNone) + { + returnType.shallowCopy(retType); + declaredBuiltIn = retType.getQualifier().builtIn; + } + virtual TFunction* clone() const override; + virtual ~TFunction(); + + virtual TFunction* getAsFunction() override { return this; } + virtual const TFunction* getAsFunction() const override { return this; } + + // Install 'p' as the (non-'this') last parameter. + // Non-'this' parameters are reflected in both the list of parameters and the + // mangled name. + virtual void addParameter(TParameter& p) + { + assert(writable); + assert(!variadic && "cannot add more parameters if function is marked variadic"); + parameters.push_back(p); + p.type->appendMangledName(mangledName); + + if (p.defaultValue != nullptr) + defaultParamCount++; + } + + // Install 'this' as the first parameter. + // 'this' is reflected in the list of parameters, but not the mangled name. + virtual void addThisParameter(TType& type, const char* name) + { + TParameter p = { NewPoolTString(name), new TType, nullptr }; + p.type->shallowCopy(type); + parameters.insert(parameters.begin(), p); + } + + virtual void addPrefix(const char* prefix) override + { + TSymbol::addPrefix(prefix); + mangledName.insert(0, prefix); + } + + virtual void removePrefix(const TString& prefix) + { + assert(mangledName.compare(0, prefix.size(), prefix) == 0); + mangledName.erase(0, prefix.size()); + } + + virtual const TString& getMangledName() const override { return mangledName; } + virtual const TType& getType() const override { return returnType; } + virtual TBuiltInVariable getDeclaredBuiltInType() const { return declaredBuiltIn; } + virtual TType& getWritableType() override { return returnType; } + virtual void relateToOperator(TOperator o) { assert(writable); op = o; } + virtual TOperator getBuiltInOp() const { return op; } + virtual void setDefined() { assert(writable); defined = true; } + virtual bool isDefined() const { return defined; } + virtual void setPrototyped() { assert(writable); prototyped = true; } + virtual bool isPrototyped() const { return prototyped; } + virtual void setImplicitThis() { assert(writable); implicitThis = true; } + virtual bool hasImplicitThis() const { return implicitThis; } + virtual void setIllegalImplicitThis() { assert(writable); illegalImplicitThis = true; } + virtual bool hasIllegalImplicitThis() const { return illegalImplicitThis; } + virtual void setVariadic() { + assert(writable); + assert(!variadic && "function was already marked variadic"); + variadic = true; + mangledName += 'z'; + } + virtual bool isVariadic() const { return variadic; } + + // Return total number of parameters + virtual int getParamCount() const { return static_cast(parameters.size()); } + // Return number of parameters with default values. + virtual int getDefaultParamCount() const { return defaultParamCount; } + // Return number of fixed parameters (without default values) + virtual int getFixedParamCount() const { return getParamCount() - getDefaultParamCount(); } + + virtual TParameter& operator[](int i) { assert(writable); return parameters[i]; } + virtual const TParameter& operator[](int i) const { return parameters[i]; } + const TQualifier& getQualifier() const { return returnType.getQualifier(); } + + virtual void setSpirvInstruction(const TSpirvInstruction& inst) + { + relateToOperator(EOpSpirvInst); + spirvInst = inst; + } + virtual const TSpirvInstruction& getSpirvInstruction() const { return spirvInst; } + + virtual void dump(TInfoSink& infoSink, bool complete = false) const override; + + void setExport() { linkType = ELinkExport; } + TLinkType getLinkType() const { return linkType; } + +protected: + explicit TFunction(const TFunction&); + TFunction& operator=(const TFunction&); + + typedef TVector TParamList; + TParamList parameters; + TType returnType; + TBuiltInVariable declaredBuiltIn; + + TString mangledName; + TOperator op; + bool defined; + bool prototyped; + bool implicitThis; // True if this function is allowed to see all members of 'this' + bool illegalImplicitThis; // True if this function is not supposed to have access to dynamic members of 'this', + // even if it finds member variables in the symbol table. + // This is important for a static member function that has member variables in scope, + // but is not allowed to use them, or see hidden symbols instead. + bool variadic; + int defaultParamCount; + + TSpirvInstruction spirvInst; // SPIR-V instruction qualifiers + TLinkType linkType; +}; + +// +// Members of anonymous blocks are a kind of TSymbol. They are not hidden in +// the symbol table behind a container; rather they are visible and point to +// their anonymous container. (The anonymous container is found through the +// member, not the other way around.) +// +class TAnonMember : public TSymbol { +public: + TAnonMember(const TString* n, unsigned int m, TVariable& a, int an) : TSymbol(n), anonContainer(a), memberNumber(m), anonId(an) { } + virtual TAnonMember* clone() const override; + virtual ~TAnonMember() { } + + virtual const TAnonMember* getAsAnonMember() const override { return this; } + virtual const TVariable& getAnonContainer() const { return anonContainer; } + virtual unsigned int getMemberNumber() const { return memberNumber; } + + virtual const TType& getType() const override + { + const TTypeList& types = *anonContainer.getType().getStruct(); + return *types[memberNumber].type; + } + + virtual TType& getWritableType() override + { + assert(writable); + const TTypeList& types = *anonContainer.getType().getStruct(); + return *types[memberNumber].type; + } + + virtual void setExtensions(int numExts, const char* const exts[]) override + { + anonContainer.setMemberExtensions(memberNumber, numExts, exts); + } + virtual int getNumExtensions() const override { return anonContainer.getNumMemberExtensions(memberNumber); } + virtual const char** getExtensions() const override { return anonContainer.getMemberExtensions(memberNumber); } + + virtual int getAnonId() const { return anonId; } + virtual void dump(TInfoSink& infoSink, bool complete = false) const override; + +protected: + explicit TAnonMember(const TAnonMember&); + TAnonMember& operator=(const TAnonMember&); + + TVariable& anonContainer; + unsigned int memberNumber; + int anonId; +}; + +class TSymbolTableLevel { +public: + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + TSymbolTableLevel() : defaultPrecision(nullptr), anonId(0), thisLevel(false) { } + ~TSymbolTableLevel(); + + bool insert(const TString& name, TSymbol* symbol) { + return level.insert(tLevelPair(name, symbol)).second; + } + + bool insert(TSymbol& symbol, bool separateNameSpaces, const TString& forcedKeyName = TString()) + { + // + // returning true means symbol was added to the table with no semantic errors + // + const TString& name = symbol.getName(); + if (forcedKeyName.length()) { + return level.insert(tLevelPair(forcedKeyName, &symbol)).second; + } + else if (name == "") { + symbol.getAsVariable()->setAnonId(anonId++); + // An empty name means an anonymous container, exposing its members to the external scope. + // Give it a name and insert its members in the symbol table, pointing to the container. + char buf[20]; + snprintf(buf, 20, "%s%d", AnonymousPrefix, symbol.getAsVariable()->getAnonId()); + symbol.changeName(NewPoolTString(buf)); + + return insertAnonymousMembers(symbol, 0); + } else { + // Check for redefinition errors: + // - STL itself will tell us if there is a direct name collision, with name mangling, at this level + // - additionally, check for function-redefining-variable name collisions + const TString& insertName = symbol.getMangledName(); + if (symbol.getAsFunction()) { + // make sure there isn't a variable of this name + if (! separateNameSpaces && level.find(name) != level.end()) + return false; + + // insert, and whatever happens is okay + level.insert(tLevelPair(insertName, &symbol)); + + return true; + } else + return level.insert(tLevelPair(insertName, &symbol)).second; + } + } + + // Add more members to an already inserted aggregate object + bool amend(TSymbol& symbol, int firstNewMember) + { + // See insert() for comments on basic explanation of insert. + // This operates similarly, but more simply. + // Only supporting amend of anonymous blocks so far. + if (IsAnonymous(symbol.getName())) + return insertAnonymousMembers(symbol, firstNewMember); + else + return false; + } + + bool insertAnonymousMembers(TSymbol& symbol, int firstMember) + { + const TTypeList& types = *symbol.getAsVariable()->getType().getStruct(); + for (unsigned int m = firstMember; m < types.size(); ++m) { + TAnonMember* member = new TAnonMember(&types[m].type->getFieldName(), m, *symbol.getAsVariable(), symbol.getAsVariable()->getAnonId()); + if (! level.insert(tLevelPair(member->getMangledName(), member)).second) + return false; + } + + return true; + } + + void retargetSymbol(const TString& from, const TString& to) { + tLevel::const_iterator fromIt = level.find(from); + tLevel::const_iterator toIt = level.find(to); + if (fromIt == level.end() || toIt == level.end()) + return; + delete fromIt->second; + level[from] = toIt->second; + retargetedSymbols.push_back({from, to}); + } + + void collectRetargetedSymbols(std::unordered_multimap &out) const { + for (const auto &[fromName, toName] : retargetedSymbols) + out.insert({std::string{toName}, std::string{fromName}}); + } + + TSymbol* find(const TString& name) const + { + tLevel::const_iterator it = level.find(name); + if (it == level.end()) + return nullptr; + else + return (*it).second; + } + + void findFunctionNameList(const TString& name, TVector& list) + { + size_t parenAt = name.find_first_of('('); + TString base(name, 0, parenAt + 1); + + tLevel::const_iterator begin = level.lower_bound(base); + base[parenAt] = ')'; // assume ')' is lexically after '(' + tLevel::const_iterator end = level.upper_bound(base); + for (tLevel::const_iterator it = begin; it != end; ++it) + list.push_back(it->second->getAsFunction()); + } + + // See if there is already a function in the table having the given non-function-style name. + bool hasFunctionName(const TString& name) const + { + tLevel::const_iterator candidate = level.lower_bound(name); + if (candidate != level.end()) { + const TString& candidateName = (*candidate).first; + TString::size_type parenAt = candidateName.find_first_of('('); + if (parenAt != candidateName.npos && candidateName.compare(0, parenAt, name) == 0) + + return true; + } + + return false; + } + + // See if there is a variable at this level having the given non-function-style name. + // Return true if name is found, and set variable to true if the name was a variable. + bool findFunctionVariableName(const TString& name, bool& variable) const + { + tLevel::const_iterator candidate = level.lower_bound(name); + if (candidate != level.end()) { + const TString& candidateName = (*candidate).first; + TString::size_type parenAt = candidateName.find_first_of('('); + if (parenAt == candidateName.npos) { + // not a mangled name + if (candidateName == name) { + // found a variable name match + variable = true; + return true; + } + } else { + // a mangled name + if (candidateName.compare(0, parenAt, name) == 0) { + // found a function name match + variable = false; + return true; + } + } + } + + return false; + } + + // Use this to do a lazy 'push' of precision defaults the first time + // a precision statement is seen in a new scope. Leave it at 0 for + // when no push was needed. Thus, it is not the current defaults, + // it is what to restore the defaults to when popping a level. + void setPreviousDefaultPrecisions(const TPrecisionQualifier *p) + { + // can call multiple times at one scope, will only latch on first call, + // as we're tracking the previous scope's values, not the current values + if (defaultPrecision != nullptr) + return; + + defaultPrecision = new TPrecisionQualifier[EbtNumTypes]; + for (int t = 0; t < EbtNumTypes; ++t) + defaultPrecision[t] = p[t]; + } + + void getPreviousDefaultPrecisions(TPrecisionQualifier *p) + { + // can be called for table level pops that didn't set the + // defaults + if (defaultPrecision == nullptr || p == nullptr) + return; + + for (int t = 0; t < EbtNumTypes; ++t) + p[t] = defaultPrecision[t]; + } + + void relateToOperator(const char* name, TOperator op); + void setFunctionExtensions(const char* name, int num, const char* const extensions[]); + void setFunctionExtensionsCallback(const char* name, std::function(const char *)> const &func); + void setSingleFunctionExtensions(const char* name, int num, const char* const extensions[]); + void dump(TInfoSink& infoSink, bool complete = false) const; + TSymbolTableLevel* clone() const; + void readOnly(); + + void setThisLevel() { thisLevel = true; } + bool isThisLevel() const { return thisLevel; } + +protected: + explicit TSymbolTableLevel(TSymbolTableLevel&); + TSymbolTableLevel& operator=(TSymbolTableLevel&); + + typedef std::map, pool_allocator > > tLevel; + typedef const tLevel::value_type tLevelPair; + typedef std::pair tInsertResult; + + tLevel level; // named mappings + TPrecisionQualifier *defaultPrecision; + // pair + TVector> retargetedSymbols; + int anonId; + bool thisLevel; // True if this level of the symbol table is a structure scope containing member function + // that are supposed to see anonymous access to member variables. +}; + +class TSymbolTable { +public: + TSymbolTable() : uniqueId(0), noBuiltInRedeclarations(false), separateNameSpaces(false), adoptedLevels(0) + { + // + // This symbol table cannot be used until push() is called. + // + } + ~TSymbolTable() + { + // this can be called explicitly; safest to code it so it can be called multiple times + + // don't deallocate levels passed in from elsewhere + while (table.size() > adoptedLevels) + pop(nullptr); + } + + void adoptLevels(TSymbolTable& symTable) + { + for (unsigned int level = 0; level < symTable.table.size(); ++level) { + table.push_back(symTable.table[level]); + ++adoptedLevels; + } + uniqueId = symTable.uniqueId; + noBuiltInRedeclarations = symTable.noBuiltInRedeclarations; + separateNameSpaces = symTable.separateNameSpaces; + } + + // + // While level adopting is generic, the methods below enact a the following + // convention for levels: + // 0: common built-ins shared across all stages, all compiles, only one copy for all symbol tables + // 1: per-stage built-ins, shared across all compiles, but a different copy per stage + // 2: built-ins specific to a compile, like resources that are context-dependent, or redeclared built-ins + // 3: user-shader globals + // +protected: + static const uint32_t LevelFlagBitOffset = 56; + static constexpr int builtinLevel = 2; + static constexpr int globalLevel = 3; + static bool isSharedLevel(int level) { return level <= 1; } // exclude all per-compile levels + static bool isBuiltInLevel(int level) { return level <= builtinLevel; } // exclude user globals + static bool isGlobalLevel(int level) { return level <= globalLevel; } // include user globals +public: + bool isEmpty() { return table.size() == 0; } + bool atBuiltInLevel() { return isBuiltInLevel(currentLevel()); } + bool atGlobalLevel() { return isGlobalLevel(currentLevel()); } + static bool isBuiltInSymbol(long long uniqueId) { + int level = static_cast(uniqueId >> LevelFlagBitOffset); + return isBuiltInLevel(level); + } + static constexpr uint64_t uniqueIdMask = (1LL << LevelFlagBitOffset) - 1; + static const uint32_t MaxLevelInUniqueID = 127; + void setNoBuiltInRedeclarations() { noBuiltInRedeclarations = true; } + void setSeparateNameSpaces() { separateNameSpaces = true; } + + void push() + { + table.push_back(new TSymbolTableLevel); + updateUniqueIdLevelFlag(); + } + + // Make a new symbol-table level to represent the scope introduced by a structure + // containing member functions, such that the member functions can find anonymous + // references to member variables. + // + // 'thisSymbol' should have a name of "" to trigger anonymous structure-member + // symbol finds. + void pushThis(TSymbol& thisSymbol) + { + assert(thisSymbol.getName().size() == 0); + table.push_back(new TSymbolTableLevel); + updateUniqueIdLevelFlag(); + table.back()->setThisLevel(); + insert(thisSymbol); + } + + void pop(TPrecisionQualifier *p) + { + table[currentLevel()]->getPreviousDefaultPrecisions(p); + delete table.back(); + table.pop_back(); + updateUniqueIdLevelFlag(); + } + + // + // Insert a visible symbol into the symbol table so it can + // be found later by name. + // + // Returns false if the was a name collision. + // + bool insert(TSymbol& symbol) + { + symbol.setUniqueId(++uniqueId); + + // make sure there isn't a function of this variable name + if (! separateNameSpaces && ! symbol.getAsFunction() && table[currentLevel()]->hasFunctionName(symbol.getName())) + return false; + + // check for not overloading or redefining a built-in function + if (noBuiltInRedeclarations) { + if (atGlobalLevel() && currentLevel() > 0) { + if (table[0]->hasFunctionName(symbol.getName())) + return false; + if (currentLevel() > 1 && table[1]->hasFunctionName(symbol.getName())) + return false; + } + } + + return table[currentLevel()]->insert(symbol, separateNameSpaces); + } + + // Add more members to an already inserted aggregate object + bool amend(TSymbol& symbol, int firstNewMember) + { + // See insert() for comments on basic explanation of insert. + // This operates similarly, but more simply. + return table[currentLevel()]->amend(symbol, firstNewMember); + } + + // Update the level info in symbol's unique ID to current level + void amendSymbolIdLevel(TSymbol& symbol) + { + // clamp level to avoid overflow + uint64_t level = (uint32_t)currentLevel() > MaxLevelInUniqueID ? MaxLevelInUniqueID : currentLevel(); + uint64_t symbolId = symbol.getUniqueId(); + symbolId &= uniqueIdMask; + symbolId |= (level << LevelFlagBitOffset); + symbol.setUniqueId(symbolId); + } + // + // To allocate an internal temporary, which will need to be uniquely + // identified by the consumer of the AST, but never need to + // found by doing a symbol table search by name, hence allowed an + // arbitrary name in the symbol with no worry of collision. + // + void makeInternalVariable(TSymbol& symbol) + { + symbol.setUniqueId(++uniqueId); + } + + // + // Copy a variable or anonymous member's structure from a shared level so that + // it can be added (soon after return) to the symbol table where it can be + // modified without impacting other users of the shared table. + // + TSymbol* copyUpDeferredInsert(TSymbol* shared) + { + if (shared->getAsVariable()) { + TSymbol* copy = shared->clone(); + copy->setUniqueId(shared->getUniqueId()); + return copy; + } else { + const TAnonMember* anon = shared->getAsAnonMember(); + assert(anon); + TVariable* container = anon->getAnonContainer().clone(); + container->changeName(NewPoolTString("")); + container->setUniqueId(anon->getAnonContainer().getUniqueId()); + return container; + } + } + + TSymbol* copyUp(TSymbol* shared) + { + TSymbol* copy = copyUpDeferredInsert(shared); + table[globalLevel]->insert(*copy, separateNameSpaces); + if (shared->getAsVariable()) + return copy; + else { + // return the copy of the anonymous member + return table[globalLevel]->find(shared->getName()); + } + } + + // Normal find of a symbol, that can optionally say whether the symbol was found + // at a built-in level or the current top-scope level. + TSymbol* find(const TString& name, bool* builtIn = nullptr, bool* currentScope = nullptr, int* thisDepthP = nullptr) + { + int level = currentLevel(); + TSymbol* symbol; + int thisDepth = 0; + do { + if (table[level]->isThisLevel()) + ++thisDepth; + symbol = table[level]->find(name); + --level; + } while (symbol == nullptr && level >= 0); + level++; + if (builtIn) + *builtIn = isBuiltInLevel(level); + if (currentScope) + *currentScope = isGlobalLevel(currentLevel()) || level == currentLevel(); // consider shared levels as "current scope" WRT user globals + if (thisDepthP != nullptr) { + if (! table[level]->isThisLevel()) + thisDepth = 0; + *thisDepthP = thisDepth; + } + + return symbol; + } + + void retargetSymbol(const TString& from, const TString& to) { + int level = currentLevel(); + table[level]->retargetSymbol(from, to); + } + + std::unordered_multimap collectBuiltinAlias() { + std::unordered_multimap allRetargets; + for (int level = 0; level <= std::min(currentLevel(), builtinLevel); ++level) + table[level]->collectRetargetedSymbols(allRetargets); + + return allRetargets; + } + + // Find of a symbol that returns how many layers deep of nested + // structures-with-member-functions ('this' scopes) deep the symbol was + // found in. + TSymbol* find(const TString& name, int& thisDepth) + { + int level = currentLevel(); + TSymbol* symbol; + thisDepth = 0; + do { + if (table[level]->isThisLevel()) + ++thisDepth; + symbol = table[level]->find(name); + --level; + } while (symbol == nullptr && level >= 0); + + if (! table[level + 1]->isThisLevel()) + thisDepth = 0; + + return symbol; + } + + bool isFunctionNameVariable(const TString& name) const + { + if (separateNameSpaces) + return false; + + int level = currentLevel(); + do { + bool variable; + bool found = table[level]->findFunctionVariableName(name, variable); + if (found) + return variable; + --level; + } while (level >= 0); + + return false; + } + + void findFunctionNameList(const TString& name, TVector& list, bool& builtIn) + { + // For user levels, return the set found in the first scope with a match + builtIn = false; + int level = currentLevel(); + do { + table[level]->findFunctionNameList(name, list); + --level; + } while (list.empty() && level >= globalLevel); + + if (! list.empty()) + return; + + // Gather across all built-in levels; they don't hide each other + builtIn = true; + do { + table[level]->findFunctionNameList(name, list); + --level; + } while (level >= 0); + } + + void relateToOperator(const char* name, TOperator op) + { + for (unsigned int level = 0; level < table.size(); ++level) + table[level]->relateToOperator(name, op); + } + + void setFunctionExtensions(const char* name, int num, const char* const extensions[]) + { + for (unsigned int level = 0; level < table.size(); ++level) + table[level]->setFunctionExtensions(name, num, extensions); + } + + void setFunctionExtensionsCallback(const char* name, std::function(const char *)> const &func) + { + for (unsigned int level = 0; level < table.size(); ++level) + table[level]->setFunctionExtensionsCallback(name, func); + } + + void setSingleFunctionExtensions(const char* name, int num, const char* const extensions[]) + { + for (unsigned int level = 0; level < table.size(); ++level) + table[level]->setSingleFunctionExtensions(name, num, extensions); + } + + void setVariableExtensions(const char* name, int numExts, const char* const extensions[]) + { + TSymbol* symbol = find(TString(name)); + if (symbol == nullptr) + return; + + symbol->setExtensions(numExts, extensions); + } + + void setVariableExtensions(const char* blockName, const char* name, int numExts, const char* const extensions[]) + { + TSymbol* symbol = find(TString(blockName)); + if (symbol == nullptr) + return; + TVariable* variable = symbol->getAsVariable(); + assert(variable != nullptr); + + const TTypeList& structure = *variable->getAsVariable()->getType().getStruct(); + for (int member = 0; member < (int)structure.size(); ++member) { + if (structure[member].type->getFieldName().compare(name) == 0) { + variable->setMemberExtensions(member, numExts, extensions); + return; + } + } + } + + long long getMaxSymbolId() { return uniqueId; } + void dump(TInfoSink& infoSink, bool complete = false) const; + void copyTable(const TSymbolTable& copyOf); + + void setPreviousDefaultPrecisions(TPrecisionQualifier *p) { table[currentLevel()]->setPreviousDefaultPrecisions(p); } + + void readOnly() + { + for (unsigned int level = 0; level < table.size(); ++level) + table[level]->readOnly(); + } + + // Add current level in the high-bits of unique id + void updateUniqueIdLevelFlag() { + // clamp level to avoid overflow + uint64_t level = (uint32_t)currentLevel() > MaxLevelInUniqueID ? MaxLevelInUniqueID : currentLevel(); + uniqueId &= uniqueIdMask; + uniqueId |= (level << LevelFlagBitOffset); + } + + void overwriteUniqueId(long long id) + { + uniqueId = id; + updateUniqueIdLevelFlag(); + } + +protected: + TSymbolTable(TSymbolTable&); + TSymbolTable& operator=(TSymbolTableLevel&); + + int currentLevel() const { return static_cast(table.size()) - 1; } + std::vector table; + long long uniqueId; // for unique identification in code generation + bool noBuiltInRedeclarations; + bool separateNameSpaces; + unsigned int adoptedLevels; +}; + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // _SYMBOL_TABLE_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp new file mode 100644 index 0000000000..c8433e25ae --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp @@ -0,0 +1,1557 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017, 2022-2024 Arm Limited. +// Copyright (C) 2015-2020 Google, Inc. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// Help manage multiple profiles, versions, extensions etc. +// +// These don't return error codes, as the presumption is parsing will +// always continue as if the tested feature were enabled, and thus there +// is no error recovery needed. +// + +// +// HOW TO add a feature enabled by an extension. +// +// To add a new hypothetical "Feature F" to the front end, where an extension +// "XXX_extension_X" can be used to enable the feature, do the following. +// +// OVERVIEW: Specific features are what are error-checked for, not +// extensions: A specific Feature F might be enabled by an extension, or a +// particular version in a particular profile, or a stage, or combinations, etc. +// +// The basic mechanism is to use the following to "declare" all the things that +// enable/disable Feature F, in a code path that implements Feature F: +// +// requireProfile() +// profileRequires() +// requireStage() +// checkDeprecated() +// requireNotRemoved() +// requireExtensions() +// extensionRequires() +// +// Typically, only the first two calls are needed. They go into a code path that +// implements Feature F, and will log the proper error/warning messages. Parsing +// will then always continue as if the tested feature was enabled. +// +// There is typically no if-testing or conditional parsing, just insertion of the calls above. +// However, if symbols specific to the extension are added (step 5), they will +// only be added under tests that the minimum version and profile are present. +// +// 1) Add a symbol name for the extension string at the bottom of Versions.h: +// +// const char* const XXX_extension_X = "XXX_extension_X"; +// +// 2) Add extension initialization to TParseVersions::initializeExtensionBehavior(), +// the first function below and optionally a entry to extensionData for additional +// error checks: +// +// extensionBehavior[XXX_extension_X] = EBhDisable; +// (Optional) exts[] = {XXX_extension_X, EShTargetSpv_1_4} +// +// 3) Add any preprocessor directives etc. in the next function, TParseVersions::getPreamble(): +// +// "#define XXX_extension_X 1\n" +// +// The new-line is important, as that ends preprocess tokens. +// +// 4) Insert a profile check in the feature's path (unless all profiles support the feature, +// for some version level). That is, call requireProfile() to constrain the profiles, e.g.: +// +// // ... in a path specific to Feature F... +// requireProfile(loc, +// ECoreProfile | ECompatibilityProfile, +// "Feature F"); +// +// 5) For each profile that supports the feature, insert version/extension checks: +// +// The mostly likely scenario is that Feature F can only be used with a +// particular profile if XXX_extension_X is present or the version is +// high enough that the core specification already incorporated it. +// +// // following the requireProfile() call... +// profileRequires(loc, +// ECoreProfile | ECompatibilityProfile, +// 420, // 0 if no version incorporated the feature into the core spec. +// XXX_extension_X, // can be a list of extensions that all add the feature +// "Feature F Description"); +// +// This allows the feature if either A) one of the extensions is enabled or +// B) the version is high enough. If no version yet incorporates the feature +// into core, pass in 0. +// +// This can be called multiple times, if different profiles support the +// feature starting at different version numbers or with different +// extensions. +// +// This must be called for each profile allowed by the initial call to requireProfile(). +// +// Profiles are all masks, which can be "or"-ed together. +// +// ENoProfile +// ECoreProfile +// ECompatibilityProfile +// EEsProfile +// +// The ENoProfile profile is only for desktop, before profiles showed up in version 150; +// All other #version with no profile default to either es or core, and so have profiles. +// +// You can select all but a particular profile using ~. The following basically means "desktop": +// +// ~EEsProfile +// +// 6) If built-in symbols are added by the extension, add them in Initialize.cpp: Their use +// will be automatically error checked against the extensions enabled at that moment. +// see the comment at the top of Initialize.cpp for where to put them. Establish them at +// the earliest release that supports the extension. Then, tag them with the +// set of extensions that both enable them and are necessary, given the version of the symbol +// table. (There is a different symbol table for each version.) +// +// 7) If the extension has additional requirements like minimum SPIR-V version required, add them +// to extensionRequires() + +#include "parseVersions.h" +#include "localintermediate.h" + +namespace QtShaderTools { +namespace glslang { + +// +// Initialize all extensions, almost always to 'disable', as once their features +// are incorporated into a core version, their features are supported through allowing that +// core version, not through a pseudo-enablement of the extension. +// +void TParseVersions::initializeExtensionBehavior() +{ + typedef struct { + const char *const extensionName; + EShTargetLanguageVersion minSpvVersion; + } extensionData; + + const extensionData exts[] = { {E_GL_EXT_ray_tracing, EShTargetSpv_1_4}, + {E_GL_NV_ray_tracing_motion_blur, EShTargetSpv_1_4}, + {E_GL_EXT_mesh_shader, EShTargetSpv_1_4}, + {E_GL_NV_cooperative_matrix2, EShTargetSpv_1_6} + }; + + for (size_t ii = 0; ii < sizeof(exts) / sizeof(exts[0]); ii++) { + // Add only extensions which require > spv1.0 to save space in map + if (exts[ii].minSpvVersion > EShTargetSpv_1_0) { + extensionMinSpv[exts[ii].extensionName] = exts[ii].minSpvVersion; + } + } + + extensionBehavior[E_GL_OES_texture_3D] = EBhDisable; + extensionBehavior[E_GL_OES_standard_derivatives] = EBhDisable; + extensionBehavior[E_GL_EXT_frag_depth] = EBhDisable; + extensionBehavior[E_GL_OES_EGL_image_external] = EBhDisable; + extensionBehavior[E_GL_OES_EGL_image_external_essl3] = EBhDisable; + extensionBehavior[E_GL_EXT_YUV_target] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_texture_lod] = EBhDisable; + extensionBehavior[E_GL_EXT_shadow_samplers] = EBhDisable; + extensionBehavior[E_GL_ARB_texture_rectangle] = EBhDisable; + extensionBehavior[E_GL_3DL_array_objects] = EBhDisable; + extensionBehavior[E_GL_ARB_shading_language_420pack] = EBhDisable; + extensionBehavior[E_GL_ARB_texture_gather] = EBhDisable; + extensionBehavior[E_GL_ARB_gpu_shader5] = EBhDisable; + extensionBehavior[E_GL_ARB_separate_shader_objects] = EBhDisable; + extensionBehavior[E_GL_ARB_compute_shader] = EBhDisable; + extensionBehavior[E_GL_ARB_tessellation_shader] = EBhDisable; + extensionBehavior[E_GL_ARB_enhanced_layouts] = EBhDisable; + extensionBehavior[E_GL_ARB_texture_cube_map_array] = EBhDisable; + extensionBehavior[E_GL_ARB_texture_multisample] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_texture_lod] = EBhDisable; + extensionBehavior[E_GL_ARB_explicit_attrib_location] = EBhDisable; + extensionBehavior[E_GL_ARB_explicit_uniform_location] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_image_load_store] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_atomic_counters] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_atomic_counter_ops] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_draw_parameters] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_group_vote] = EBhDisable; + extensionBehavior[E_GL_ARB_derivative_control] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_texture_image_samples] = EBhDisable; + extensionBehavior[E_GL_ARB_viewport_array] = EBhDisable; + extensionBehavior[E_GL_ARB_gpu_shader_int64] = EBhDisable; + extensionBehavior[E_GL_ARB_gpu_shader_fp64] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_ballot] = EBhDisable; + extensionBehavior[E_GL_ARB_sparse_texture2] = EBhDisable; + extensionBehavior[E_GL_ARB_sparse_texture_clamp] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_stencil_export] = EBhDisable; +// extensionBehavior[E_GL_ARB_cull_distance] = EBhDisable; // present for 4.5, but need extension control over block members + extensionBehavior[E_GL_ARB_post_depth_coverage] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_viewport_layer_array] = EBhDisable; + extensionBehavior[E_GL_ARB_fragment_shader_interlock] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_clock] = EBhDisable; + extensionBehavior[E_GL_ARB_uniform_buffer_object] = EBhDisable; + extensionBehavior[E_GL_ARB_sample_shading] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_bit_encoding] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_image_size] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_storage_buffer_object] = EBhDisable; + extensionBehavior[E_GL_ARB_shading_language_packing] = EBhDisable; + extensionBehavior[E_GL_ARB_texture_query_lod] = EBhDisable; + extensionBehavior[E_GL_ARB_vertex_attrib_64bit] = EBhDisable; + extensionBehavior[E_GL_NV_gpu_shader5] = EBhDisable; + extensionBehavior[E_GL_ARB_draw_instanced] = EBhDisable; + extensionBehavior[E_GL_ARB_bindless_texture] = EBhDisable; + extensionBehavior[E_GL_ARB_fragment_coord_conventions] = EBhDisable; + extensionBehavior[E_GL_ARB_conservative_depth] = EBhDisable; + + + extensionBehavior[E_GL_KHR_shader_subgroup_basic] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_vote] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_arithmetic] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_ballot] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_shuffle] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_shuffle_relative] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_rotate] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_clustered] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_quad] = EBhDisable; + extensionBehavior[E_GL_KHR_memory_scope_semantics] = EBhDisable; + + extensionBehavior[E_GL_EXT_shader_atomic_int64] = EBhDisable; + + extensionBehavior[E_GL_EXT_shader_non_constant_global_initializers] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_image_load_formatted] = EBhDisable; + extensionBehavior[E_GL_EXT_post_depth_coverage] = EBhDisable; + extensionBehavior[E_GL_EXT_control_flow_attributes] = EBhDisable; + extensionBehavior[E_GL_EXT_nonuniform_qualifier] = EBhDisable; + extensionBehavior[E_GL_EXT_samplerless_texture_functions] = EBhDisable; + extensionBehavior[E_GL_EXT_scalar_block_layout] = EBhDisable; + extensionBehavior[E_GL_EXT_fragment_invocation_density] = EBhDisable; + extensionBehavior[E_GL_EXT_buffer_reference] = EBhDisable; + extensionBehavior[E_GL_EXT_buffer_reference2] = EBhDisable; + extensionBehavior[E_GL_EXT_buffer_reference_uvec2] = EBhDisable; + extensionBehavior[E_GL_EXT_demote_to_helper_invocation] = EBhDisable; + extensionBehavior[E_GL_EXT_debug_printf] = EBhDisable; + + extensionBehavior[E_GL_EXT_shader_16bit_storage] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_8bit_storage] = EBhDisable; + extensionBehavior[E_GL_EXT_subgroup_uniform_control_flow] = EBhDisable; + extensionBehavior[E_GL_EXT_maximal_reconvergence] = EBhDisable; + + extensionBehavior[E_GL_EXT_fragment_shader_barycentric] = EBhDisable; + extensionBehavior[E_GL_EXT_expect_assume] = EBhDisable; + + extensionBehavior[E_GL_EXT_control_flow_attributes2] = EBhDisable; + extensionBehavior[E_GL_EXT_spec_constant_composites] = EBhDisable; + + extensionBehavior[E_GL_KHR_cooperative_matrix] = EBhDisable; + extensionBehavior[E_GL_NV_cooperative_vector] = EBhDisable; + + // #line and #include + extensionBehavior[E_GL_GOOGLE_cpp_style_line_directive] = EBhDisable; + extensionBehavior[E_GL_GOOGLE_include_directive] = EBhDisable; + extensionBehavior[E_GL_ARB_shading_language_include] = EBhDisable; + + extensionBehavior[E_GL_AMD_shader_ballot] = EBhDisable; + extensionBehavior[E_GL_AMD_shader_trinary_minmax] = EBhDisable; + extensionBehavior[E_GL_AMD_shader_explicit_vertex_parameter] = EBhDisable; + extensionBehavior[E_GL_AMD_gcn_shader] = EBhDisable; + extensionBehavior[E_GL_AMD_gpu_shader_half_float] = EBhDisable; + extensionBehavior[E_GL_AMD_texture_gather_bias_lod] = EBhDisable; + extensionBehavior[E_GL_AMD_gpu_shader_int16] = EBhDisable; + extensionBehavior[E_GL_AMD_shader_image_load_store_lod] = EBhDisable; + extensionBehavior[E_GL_AMD_shader_fragment_mask] = EBhDisable; + extensionBehavior[E_GL_AMD_gpu_shader_half_float_fetch] = EBhDisable; + extensionBehavior[E_GL_AMD_shader_early_and_late_fragment_tests] = EBhDisable; + + extensionBehavior[E_GL_INTEL_shader_integer_functions2] = EBhDisable; + + extensionBehavior[E_GL_NV_sample_mask_override_coverage] = EBhDisable; + extensionBehavior[E_SPV_NV_geometry_shader_passthrough] = EBhDisable; + extensionBehavior[E_GL_NV_viewport_array2] = EBhDisable; + extensionBehavior[E_GL_NV_stereo_view_rendering] = EBhDisable; + extensionBehavior[E_GL_NVX_multiview_per_view_attributes] = EBhDisable; + extensionBehavior[E_GL_NV_shader_atomic_int64] = EBhDisable; + extensionBehavior[E_GL_NV_conservative_raster_underestimation] = EBhDisable; + extensionBehavior[E_GL_NV_shader_noperspective_interpolation] = EBhDisable; + extensionBehavior[E_GL_NV_shader_subgroup_partitioned] = EBhDisable; + extensionBehavior[E_GL_NV_shading_rate_image] = EBhDisable; + extensionBehavior[E_GL_NV_ray_tracing] = EBhDisable; + extensionBehavior[E_GL_NV_ray_tracing_motion_blur] = EBhDisable; + extensionBehavior[E_GL_NV_fragment_shader_barycentric] = EBhDisable; + extensionBehavior[E_GL_NV_compute_shader_derivatives] = EBhDisable; + extensionBehavior[E_GL_NV_shader_texture_footprint] = EBhDisable; + extensionBehavior[E_GL_NV_mesh_shader] = EBhDisable; + extensionBehavior[E_GL_NV_cooperative_matrix] = EBhDisable; + extensionBehavior[E_GL_NV_shader_sm_builtins] = EBhDisable; + extensionBehavior[E_GL_NV_integer_cooperative_matrix] = EBhDisable; + extensionBehavior[E_GL_NV_shader_invocation_reorder] = EBhDisable; + extensionBehavior[E_GL_NV_displacement_micromap] = EBhDisable; + extensionBehavior[E_GL_NV_shader_atomic_fp16_vector] = EBhDisable; + extensionBehavior[E_GL_NV_cooperative_matrix2] = EBhDisable; + extensionBehavior[E_GL_NV_cluster_acceleration_structure] = EBhDisable; + extensionBehavior[E_GL_NV_linear_swept_spheres] = EBhDisable; + + // ARM + extensionBehavior[E_GL_ARM_shader_core_builtins] = EBhDisable; + extensionBehavior[E_GL_ARM_tensors] = EBhDisable; + + // QCOM + extensionBehavior[E_GL_QCOM_image_processing] = EBhDisable; + extensionBehavior[E_GL_QCOM_image_processing2] = EBhDisable; + extensionBehavior[E_GL_QCOM_tile_shading] = EBhDisable; + extensionBehavior[E_GL_QCOM_cooperative_matrix_conversion] = EBhDisable; + + // AEP + extensionBehavior[E_GL_ANDROID_extension_pack_es31a] = EBhDisable; + extensionBehavior[E_GL_KHR_blend_equation_advanced] = EBhDisable; + extensionBehavior[E_GL_OES_sample_variables] = EBhDisable; + extensionBehavior[E_GL_OES_shader_image_atomic] = EBhDisable; + extensionBehavior[E_GL_OES_shader_multisample_interpolation] = EBhDisable; + extensionBehavior[E_GL_OES_texture_storage_multisample_2d_array] = EBhDisable; + extensionBehavior[E_GL_EXT_geometry_shader] = EBhDisable; + extensionBehavior[E_GL_EXT_geometry_point_size] = EBhDisable; + extensionBehavior[E_GL_EXT_gpu_shader5] = EBhDisable; + extensionBehavior[E_GL_EXT_primitive_bounding_box] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_io_blocks] = EBhDisable; + extensionBehavior[E_GL_EXT_tessellation_shader] = EBhDisable; + extensionBehavior[E_GL_EXT_tessellation_point_size] = EBhDisable; + extensionBehavior[E_GL_EXT_texture_buffer] = EBhDisable; + extensionBehavior[E_GL_EXT_texture_cube_map_array] = EBhDisable; + extensionBehavior[E_GL_EXT_null_initializer] = EBhDisable; + + // OES matching AEP + extensionBehavior[E_GL_OES_geometry_shader] = EBhDisable; + extensionBehavior[E_GL_OES_geometry_point_size] = EBhDisable; + extensionBehavior[E_GL_OES_gpu_shader5] = EBhDisable; + extensionBehavior[E_GL_OES_primitive_bounding_box] = EBhDisable; + extensionBehavior[E_GL_OES_shader_io_blocks] = EBhDisable; + extensionBehavior[E_GL_OES_tessellation_shader] = EBhDisable; + extensionBehavior[E_GL_OES_tessellation_point_size] = EBhDisable; + extensionBehavior[E_GL_OES_texture_buffer] = EBhDisable; + extensionBehavior[E_GL_OES_texture_cube_map_array] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_integer_mix] = EBhDisable; + + // EXT extensions + extensionBehavior[E_GL_EXT_device_group] = EBhDisable; + extensionBehavior[E_GL_EXT_multiview] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_realtime_clock] = EBhDisable; + extensionBehavior[E_GL_EXT_ray_tracing] = EBhDisable; + extensionBehavior[E_GL_EXT_ray_query] = EBhDisable; + extensionBehavior[E_GL_EXT_ray_flags_primitive_culling] = EBhDisable; + extensionBehavior[E_GL_EXT_ray_cull_mask] = EBhDisable; + extensionBehavior[E_GL_EXT_blend_func_extended] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_implicit_conversions] = EBhDisable; + extensionBehavior[E_GL_EXT_fragment_shading_rate] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_image_int64] = EBhDisable; + extensionBehavior[E_GL_EXT_terminate_invocation] = EBhDisable; + extensionBehavior[E_GL_EXT_shared_memory_block] = EBhDisable; + extensionBehavior[E_GL_EXT_spirv_intrinsics] = EBhDisable; + extensionBehavior[E_GL_EXT_mesh_shader] = EBhDisable; + extensionBehavior[E_GL_EXT_opacity_micromap] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_quad_control] = EBhDisable; + extensionBehavior[E_GL_EXT_ray_tracing_position_fetch] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_tile_image] = EBhDisable; + extensionBehavior[E_GL_EXT_texture_shadow_lod] = EBhDisable; + extensionBehavior[E_GL_EXT_draw_instanced] = EBhDisable; + extensionBehavior[E_GL_EXT_texture_array] = EBhDisable; + extensionBehavior[E_GL_EXT_texture_offset_non_const] = EBhDisable; + extensionBehavior[E_GL_EXT_nontemporal_keyword] = EBhDisable; + extensionBehavior[E_GL_EXT_bfloat16] = EBhDisable; + extensionBehavior[E_GL_EXT_float_e4m3] = EBhDisable; + extensionBehavior[E_GL_EXT_float_e5m2] = EBhDisable; + extensionBehavior[E_GL_EXT_uniform_buffer_unsized_array] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_64bit_indexing] = EBhDisable; + extensionBehavior[E_GL_EXT_conservative_depth] = EBhDisable; + + // OVR extensions + extensionBehavior[E_GL_OVR_multiview] = EBhDisable; + extensionBehavior[E_GL_OVR_multiview2] = EBhDisable; + + // explicit types + extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_int8] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_int16] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_int32] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_int64] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_float16] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_float32] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_float64] = EBhDisable; + + // subgroup extended types + extensionBehavior[E_GL_EXT_shader_subgroup_extended_types_int8] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_subgroup_extended_types_int16] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_subgroup_extended_types_int64] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_subgroup_extended_types_float16] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_atomic_float] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_atomic_float2] = EBhDisable; + + extensionBehavior[E_GL_EXT_integer_dot_product] = EBhDisable; + + extensionBehavior[E_GL_EXT_shader_invocation_reorder] = EBhDisable; + + // Record extensions not for spv. + spvUnsupportedExt.push_back(E_GL_ARB_bindless_texture); +} + +// Get code that is not part of a shared symbol table, is specific to this shader, +// or needed by the preprocessor (which does not use a shared symbol table). +void TParseVersions::getPreamble(std::string& preamble) +{ + if (isEsProfile()) { + preamble = + "#define GL_ES 1\n" + "#define GL_FRAGMENT_PRECISION_HIGH 1\n" + "#define GL_OES_texture_3D 1\n" + "#define GL_OES_standard_derivatives 1\n" + "#define GL_EXT_frag_depth 1\n" + "#define GL_OES_EGL_image_external 1\n" + "#define GL_OES_EGL_image_external_essl3 1\n" + "#define GL_EXT_YUV_target 1\n" + "#define GL_EXT_shader_texture_lod 1\n" + "#define GL_EXT_shadow_samplers 1\n" + "#define GL_EXT_fragment_shading_rate 1\n" + "#define GL_EXT_conservative_depth 1\n" + + // AEP + "#define GL_ANDROID_extension_pack_es31a 1\n" + "#define GL_OES_sample_variables 1\n" + "#define GL_OES_shader_image_atomic 1\n" + "#define GL_OES_shader_multisample_interpolation 1\n" + "#define GL_OES_texture_storage_multisample_2d_array 1\n" + "#define GL_EXT_geometry_shader 1\n" + "#define GL_EXT_geometry_point_size 1\n" + "#define GL_EXT_gpu_shader5 1\n" + "#define GL_EXT_primitive_bounding_box 1\n" + "#define GL_EXT_shader_io_blocks 1\n" + "#define GL_EXT_tessellation_shader 1\n" + "#define GL_EXT_tessellation_point_size 1\n" + "#define GL_EXT_texture_buffer 1\n" + "#define GL_EXT_texture_cube_map_array 1\n" + "#define GL_EXT_shader_implicit_conversions 1\n" + "#define GL_EXT_shader_integer_mix 1\n" + "#define GL_EXT_blend_func_extended 1\n" + + // OES matching AEP + "#define GL_OES_geometry_shader 1\n" + "#define GL_OES_geometry_point_size 1\n" + "#define GL_OES_gpu_shader5 1\n" + "#define GL_OES_primitive_bounding_box 1\n" + "#define GL_OES_shader_io_blocks 1\n" + "#define GL_OES_tessellation_shader 1\n" + "#define GL_OES_tessellation_point_size 1\n" + "#define GL_OES_texture_buffer 1\n" + "#define GL_OES_texture_cube_map_array 1\n" + "#define GL_EXT_shader_non_constant_global_initializers 1\n" + + "#define GL_QCOM_image_processing 1\n" + "#define GL_QCOM_image_processing2 1\n" + "#define GL_QCOM_tile_shading 1\n" + "#define GL_QCOM_cooperative_matrix_conversion 1\n" + ; + + if (version >= 300) { + preamble += "#define GL_NV_shader_noperspective_interpolation 1\n"; + } + if (version >= 310) { + preamble += "#define GL_EXT_null_initializer 1\n"; + preamble += "#define GL_EXT_subgroup_uniform_control_flow 1\n"; + preamble += "#define GL_EXT_maximal_reconvergence 1\n"; + } + + } else { // !isEsProfile() + preamble = + "#define GL_ARB_texture_rectangle 1\n" + "#define GL_ARB_shading_language_420pack 1\n" + "#define GL_ARB_texture_gather 1\n" + "#define GL_ARB_gpu_shader5 1\n" + "#define GL_ARB_separate_shader_objects 1\n" + "#define GL_ARB_compute_shader 1\n" + "#define GL_ARB_tessellation_shader 1\n" + "#define GL_ARB_enhanced_layouts 1\n" + "#define GL_ARB_texture_cube_map_array 1\n" + "#define GL_ARB_texture_multisample 1\n" + "#define GL_ARB_shader_texture_lod 1\n" + "#define GL_ARB_explicit_attrib_location 1\n" + "#define GL_ARB_explicit_uniform_location 1\n" + "#define GL_ARB_shader_image_load_store 1\n" + "#define GL_ARB_shader_atomic_counters 1\n" + "#define GL_ARB_shader_draw_parameters 1\n" + "#define GL_ARB_shader_group_vote 1\n" + "#define GL_ARB_derivative_control 1\n" + "#define GL_ARB_shader_texture_image_samples 1\n" + "#define GL_ARB_viewport_array 1\n" + "#define GL_ARB_gpu_shader_int64 1\n" + "#define GL_ARB_gpu_shader_fp64 1\n" + "#define GL_ARB_shader_ballot 1\n" + "#define GL_ARB_sparse_texture2 1\n" + "#define GL_ARB_sparse_texture_clamp 1\n" + "#define GL_ARB_shader_stencil_export 1\n" + "#define GL_ARB_sample_shading 1\n" + "#define GL_ARB_shader_image_size 1\n" + "#define GL_ARB_shading_language_packing 1\n" +// "#define GL_ARB_cull_distance 1\n" // present for 4.5, but need extension control over block members + "#define GL_ARB_post_depth_coverage 1\n" + "#define GL_ARB_fragment_shader_interlock 1\n" + "#define GL_ARB_uniform_buffer_object 1\n" + "#define GL_ARB_shader_bit_encoding 1\n" + "#define GL_ARB_shader_storage_buffer_object 1\n" + "#define GL_ARB_texture_query_lod 1\n" + "#define GL_ARB_vertex_attrib_64bit 1\n" + "#define GL_NV_gpu_shader5 1\n" + "#define GL_ARB_draw_instanced 1\n" + "#define GL_ARB_fragment_coord_conventions 1\n" + "#define GL_ARB_conservative_depth 1\n" + + "#define GL_EXT_shader_non_constant_global_initializers 1\n" + "#define GL_EXT_shader_image_load_formatted 1\n" + "#define GL_EXT_post_depth_coverage 1\n" + "#define GL_EXT_control_flow_attributes 1\n" + "#define GL_EXT_nonuniform_qualifier 1\n" + "#define GL_EXT_shader_16bit_storage 1\n" + "#define GL_EXT_shader_8bit_storage 1\n" + "#define GL_EXT_samplerless_texture_functions 1\n" + "#define GL_EXT_scalar_block_layout 1\n" + "#define GL_EXT_fragment_invocation_density 1\n" + "#define GL_EXT_buffer_reference 1\n" + "#define GL_EXT_buffer_reference2 1\n" + "#define GL_EXT_buffer_reference_uvec2 1\n" + "#define GL_EXT_demote_to_helper_invocation 1\n" + "#define GL_EXT_debug_printf 1\n" + "#define GL_EXT_fragment_shading_rate 1\n" + "#define GL_EXT_shared_memory_block 1\n" + "#define GL_EXT_shader_integer_mix 1\n" + "#define GL_EXT_spec_constant_composites 1\n" + + // GL_KHR_shader_subgroup + "#define GL_KHR_shader_subgroup_basic 1\n" + "#define GL_KHR_shader_subgroup_vote 1\n" + "#define GL_KHR_shader_subgroup_arithmetic 1\n" + "#define GL_KHR_shader_subgroup_ballot 1\n" + "#define GL_KHR_shader_subgroup_shuffle 1\n" + "#define GL_KHR_shader_subgroup_shuffle_relative 1\n" + "#define GL_KHR_shader_subgroup_clustered 1\n" + "#define GL_KHR_shader_subgroup_quad 1\n" + + "#define GL_KHR_cooperative_matrix 1\n" + + "#define GL_EXT_shader_image_int64 1\n" + "#define GL_EXT_shader_atomic_int64 1\n" + "#define GL_EXT_shader_realtime_clock 1\n" + "#define GL_EXT_ray_tracing 1\n" + "#define GL_EXT_ray_query 1\n" + "#define GL_EXT_ray_flags_primitive_culling 1\n" + "#define GL_EXT_ray_cull_mask 1\n" + "#define GL_EXT_ray_tracing_position_fetch 1\n" + "#define GL_EXT_spirv_intrinsics 1\n" + "#define GL_EXT_mesh_shader 1\n" + + "#define GL_AMD_shader_ballot 1\n" + "#define GL_AMD_shader_trinary_minmax 1\n" + "#define GL_AMD_shader_explicit_vertex_parameter 1\n" + "#define GL_AMD_gcn_shader 1\n" + "#define GL_AMD_gpu_shader_half_float 1\n" + "#define GL_AMD_texture_gather_bias_lod 1\n" + "#define GL_AMD_gpu_shader_int16 1\n" + "#define GL_AMD_shader_image_load_store_lod 1\n" + "#define GL_AMD_shader_fragment_mask 1\n" + "#define GL_AMD_gpu_shader_half_float_fetch 1\n" + + "#define GL_INTEL_shader_integer_functions2 1\n" + + "#define GL_NV_sample_mask_override_coverage 1\n" + "#define GL_NV_geometry_shader_passthrough 1\n" + "#define GL_NV_viewport_array2 1\n" + "#define GL_NV_shader_atomic_int64 1\n" + "#define GL_NV_conservative_raster_underestimation 1\n" + "#define GL_NV_shader_subgroup_partitioned 1\n" + "#define GL_NV_shading_rate_image 1\n" + "#define GL_NV_ray_tracing 1\n" + "#define GL_NV_ray_tracing_motion_blur 1\n" + "#define GL_NV_fragment_shader_barycentric 1\n" + "#define GL_NV_compute_shader_derivatives 1\n" + "#define GL_NV_shader_texture_footprint 1\n" + "#define GL_NV_mesh_shader 1\n" + "#define GL_NV_cooperative_matrix 1\n" + "#define GL_NV_integer_cooperative_matrix 1\n" + "#define GL_NV_shader_invocation_reorder 1\n" + "#define GL_NV_cooperative_matrix2 1\n" + + "#define GL_QCOM_image_processing 1\n" + "#define GL_QCOM_image_processing2 1\n" + "#define GL_QCOM_tile_shading 1\n" + "#define GL_QCOM_cooperative_matrix_conversion 1\n" + + "#define GL_EXT_shader_explicit_arithmetic_types 1\n" + "#define GL_EXT_shader_explicit_arithmetic_types_int8 1\n" + "#define GL_EXT_shader_explicit_arithmetic_types_int16 1\n" + "#define GL_EXT_shader_explicit_arithmetic_types_int32 1\n" + "#define GL_EXT_shader_explicit_arithmetic_types_int64 1\n" + "#define GL_EXT_shader_explicit_arithmetic_types_float16 1\n" + "#define GL_EXT_shader_explicit_arithmetic_types_float32 1\n" + "#define GL_EXT_shader_explicit_arithmetic_types_float64 1\n" + + "#define GL_EXT_shader_subgroup_extended_types_int8 1\n" + "#define GL_EXT_shader_subgroup_extended_types_int16 1\n" + "#define GL_EXT_shader_subgroup_extended_types_int64 1\n" + "#define GL_EXT_shader_subgroup_extended_types_float16 1\n" + + "#define GL_EXT_shader_atomic_float 1\n" + "#define GL_EXT_shader_atomic_float2 1\n" + + "#define GL_EXT_fragment_shader_barycentric 1\n" + "#define GL_EXT_shader_quad_control 1\n" + "#define GL_EXT_texture_array 1\n" + + "#define GL_EXT_control_flow_attributes2 1\n" + + "#define GL_EXT_integer_dot_product 1\n" + "#define GL_EXT_bfloat16 1\n" + "#define GL_EXT_float_e5m2 1\n" + "#define GL_EXT_float_e4m3 1\n" + "#define GL_EXT_uniform_buffer_unsized_array 1\n" + "#define GL_EXT_shader_64bit_indexing 1\n" + + "#define GL_EXT_shader_invocation_reorder 1\n" + ; + + if (spvVersion.spv == 0) { + preamble += "#define GL_ARB_bindless_texture 1\n"; + } + + if (version >= 150) { + // define GL_core_profile and GL_compatibility_profile + preamble += "#define GL_core_profile 1\n"; + + if (profile == ECompatibilityProfile) + preamble += "#define GL_compatibility_profile 1\n"; + } + if (version >= 140) { + preamble += "#define GL_EXT_null_initializer 1\n"; + preamble += "#define GL_EXT_subgroup_uniform_control_flow 1\n"; + preamble += "#define GL_EXT_maximal_reconvergence 1\n"; + } + if (version >= 130) { + preamble +="#define GL_FRAGMENT_PRECISION_HIGH 1\n"; + } + } + + if ((!isEsProfile() && version >= 140) || + (isEsProfile() && version >= 310)) { + preamble += + "#define GL_EXT_device_group 1\n" + "#define GL_EXT_multiview 1\n" + "#define GL_NV_shader_sm_builtins 1\n" + ; + } + + if ((!isEsProfile() && version >= 130) || + (isEsProfile() && version >= 300)) { + preamble += "#define GL_EXT_texture_offset_non_const 1\n"; + } + + if (version >= 300 /* both ES and non-ES */) { + preamble += + "#define GL_OVR_multiview 1\n" + "#define GL_OVR_multiview2 1\n" + ; + } + + // #line and #include + preamble += + "#define GL_GOOGLE_cpp_style_line_directive 1\n" + "#define GL_GOOGLE_include_directive 1\n" + "#define GL_KHR_blend_equation_advanced 1\n" + ; + + // other general extensions + preamble += + "#define GL_EXT_terminate_invocation 1\n" + ; + + // #define VULKAN XXXX + const int numberBufSize = 12; + char numberBuf[numberBufSize]; + if (spvVersion.vulkanGlsl > 0) { + preamble += "#define VULKAN "; + snprintf(numberBuf, numberBufSize, "%d", spvVersion.vulkanGlsl); + preamble += numberBuf; + preamble += "\n"; + } + + // #define GL_SPIRV XXXX + if (spvVersion.openGl > 0) { + preamble += "#define GL_SPIRV "; + snprintf(numberBuf, numberBufSize, "%d", spvVersion.openGl); + preamble += numberBuf; + preamble += "\n"; + } + + // GL_EXT_spirv_intrinsics + if (!isEsProfile()) { + switch (language) { + case EShLangVertex: preamble += "#define GL_VERTEX_SHADER 1 \n"; break; + case EShLangTessControl: preamble += "#define GL_TESSELLATION_CONTROL_SHADER 1 \n"; break; + case EShLangTessEvaluation: preamble += "#define GL_TESSELLATION_EVALUATION_SHADER 1 \n"; break; + case EShLangGeometry: preamble += "#define GL_GEOMETRY_SHADER 1 \n"; break; + case EShLangFragment: preamble += "#define GL_FRAGMENT_SHADER 1 \n"; break; + case EShLangCompute: preamble += "#define GL_COMPUTE_SHADER 1 \n"; break; + case EShLangRayGen: preamble += "#define GL_RAY_GENERATION_SHADER_EXT 1 \n"; break; + case EShLangIntersect: preamble += "#define GL_INTERSECTION_SHADER_EXT 1 \n"; break; + case EShLangAnyHit: preamble += "#define GL_ANY_HIT_SHADER_EXT 1 \n"; break; + case EShLangClosestHit: preamble += "#define GL_CLOSEST_HIT_SHADER_EXT 1 \n"; break; + case EShLangMiss: preamble += "#define GL_MISS_SHADER_EXT 1 \n"; break; + case EShLangCallable: preamble += "#define GL_CALLABLE_SHADER_EXT 1 \n"; break; + case EShLangTask: preamble += "#define GL_TASK_SHADER_NV 1 \n"; break; + case EShLangMesh: preamble += "#define GL_MESH_SHADER_NV 1 \n"; break; + default: break; + } + } +} + +// +// Map from stage enum to externally readable text name. +// +const char* StageName(EShLanguage stage) +{ + switch(stage) { + case EShLangVertex: return "vertex"; + case EShLangFragment: return "fragment"; + case EShLangCompute: return "compute"; + case EShLangTessControl: return "tessellation control"; + case EShLangTessEvaluation: return "tessellation evaluation"; + case EShLangGeometry: return "geometry"; + case EShLangRayGen: return "ray-generation"; + case EShLangIntersect: return "intersection"; + case EShLangAnyHit: return "any-hit"; + case EShLangClosestHit: return "closest-hit"; + case EShLangMiss: return "miss"; + case EShLangCallable: return "callable"; + case EShLangMesh: return "mesh"; + case EShLangTask: return "task"; + default: return "unknown stage"; + } +} + +// +// When to use requireStage() +// +// If only some stages support a feature. +// +// Operation: If the current stage is not present, give an error message. +// +void TParseVersions::requireStage(const TSourceLoc& loc, EShLanguageMask languageMask, const char* featureDesc) +{ + if (((1 << language) & languageMask) == 0) + error(loc, "not supported in this stage:", featureDesc, StageName(language)); +} + +// If only one stage supports a feature, this can be called. But, all supporting stages +// must be specified with one call. +void TParseVersions::requireStage(const TSourceLoc& loc, EShLanguage stage, const char* featureDesc) +{ + requireStage(loc, static_cast(1 << stage), featureDesc); +} + +// +// When to use requireProfile(): +// +// Use if only some profiles support a feature. However, if within a profile the feature +// is version or extension specific, follow this call with calls to profileRequires(). +// +// Operation: If the current profile is not one of the profileMask, +// give an error message. +// +void TParseVersions::requireProfile(const TSourceLoc& loc, int profileMask, const char* featureDesc) +{ + if (! (profile & profileMask)) + error(loc, "not supported with this profile:", featureDesc, ProfileName(profile)); +} + +// +// When to use profileRequires(): +// +// If a set of profiles have the same requirements for what version or extensions +// are needed to support a feature. +// +// It must be called for each profile that needs protection. Use requireProfile() first +// to reduce that set of profiles. +// +// Operation: Will issue warnings/errors based on the current profile, version, and extension +// behaviors. It only checks extensions when the current profile is one of the profileMask. +// +// A minVersion of 0 means no version of the profileMask support this in core, +// the extension must be present. +// + +// entry point that takes multiple extensions +void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, int numExtensions, + const char* const extensions[], const char* featureDesc) +{ + if (profile & profileMask) { + bool okay = minVersion > 0 && version >= minVersion; + for (int i = 0; i < numExtensions; ++i) { + switch (getExtensionBehavior(extensions[i])) { + case EBhWarn: + infoSink.info.message(EPrefixWarning, ("extension " + TString(extensions[i]) + " is being used for " + featureDesc).c_str(), loc, messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); + [[fallthrough]]; + case EBhRequire: + case EBhEnable: + okay = true; + break; + default: break; // some compilers want this + } + } + if (! okay) + error(loc, "not supported for this version or the enabled extensions", featureDesc, ""); + } +} + +// entry point for the above that takes a single extension +void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, const char* extension, + const char* featureDesc) +{ + profileRequires(loc, profileMask, minVersion, extension ? 1 : 0, &extension, featureDesc); +} + +void TParseVersions::unimplemented(const TSourceLoc& loc, const char* featureDesc) +{ + error(loc, "feature not yet implemented", featureDesc, ""); +} + +// +// Within a set of profiles, see if a feature is deprecated and give an error or warning based on whether +// a future compatibility context is being use. +// +void TParseVersions::checkDeprecated(const TSourceLoc& loc, int profileMask, int depVersion, const char* featureDesc) +{ + if (profile & profileMask) { + if (version >= depVersion) { + if (forwardCompatible) + error(loc, "deprecated, may be removed in future release", featureDesc, ""); + else if (! suppressWarnings()) + infoSink.info.message(EPrefixWarning, (TString(featureDesc) + " deprecated in version " + + String(depVersion) + "; may be removed in future release").c_str(), + loc, messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); + } + } +} + +// +// Within a set of profiles, see if a feature has now been removed and if so, give an error. +// The version argument is the first version no longer having the feature. +// +void TParseVersions::requireNotRemoved(const TSourceLoc& loc, int profileMask, int removedVersion, const char* featureDesc) +{ + if (profile & profileMask) { + if (version >= removedVersion) { + const int maxSize = 60; + char buf[maxSize]; + snprintf(buf, maxSize, "%s profile; removed in version %d", ProfileName(profile), removedVersion); + error(loc, "no longer supported in", featureDesc, buf); + } + } +} + +// Returns true if at least one of the extensions in the extensions parameter is requested. Otherwise, returns false. +// Warns appropriately if the requested behavior of an extension is "warn". +bool TParseVersions::checkExtensionsRequested(const TSourceLoc& loc, int numExtensions, const char* const extensions[], const char* featureDesc) +{ + // First, see if any of the extensions are enabled + for (int i = 0; i < numExtensions; ++i) { + TExtensionBehavior behavior = getExtensionBehavior(extensions[i]); + if (behavior == EBhEnable || behavior == EBhRequire) + return true; + } + + // See if any extensions want to give a warning on use; give warnings for all such extensions + bool warned = false; + for (int i = 0; i < numExtensions; ++i) { + TExtensionBehavior behavior = getExtensionBehavior(extensions[i]); + if (behavior == EBhDisable && relaxedErrors()) { + infoSink.info.message(EPrefixWarning, "The following extension must be enabled to use this feature:", loc, + messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); + behavior = EBhWarn; + } + if (behavior == EBhWarn) { + infoSink.info.message(EPrefixWarning, + ("extension " + TString(extensions[i]) + " is being used for " + featureDesc).c_str(), + loc, messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); + warned = true; + } + } + if (warned) + return true; + return false; +} + +// +// Use when there are no profile/version to check, it's just an error if one of the +// extensions is not present. +// +void TParseVersions::requireExtensions(const TSourceLoc& loc, int numExtensions, const char* const extensions[], + const char* featureDesc) +{ + if (checkExtensionsRequested(loc, numExtensions, extensions, featureDesc)) + return; + + // If we get this far, give errors explaining what extensions are needed + if (numExtensions == 1) + error(loc, "required extension not requested:", featureDesc, extensions[0]); + else { + error(loc, "required extension not requested:", featureDesc, "Possible extensions include:"); + for (int i = 0; i < numExtensions; ++i) + infoSink.info.message(EPrefixNone, extensions[i]); + } +} + +// +// Use by preprocessor when there are no profile/version to check, it's just an error if one of the +// extensions is not present. +// +void TParseVersions::ppRequireExtensions(const TSourceLoc& loc, int numExtensions, const char* const extensions[], + const char* featureDesc) +{ + if (checkExtensionsRequested(loc, numExtensions, extensions, featureDesc)) + return; + + // If we get this far, give errors explaining what extensions are needed + if (numExtensions == 1) + ppError(loc, "required extension not requested:", featureDesc, extensions[0]); + else { + ppError(loc, "required extension not requested:", featureDesc, "Possible extensions include:"); + for (int i = 0; i < numExtensions; ++i) + infoSink.info.message(EPrefixNone, extensions[i]); + } +} + +TExtensionBehavior TParseVersions::getExtensionBehavior(const char* extension) +{ + auto iter = extensionBehavior.find(TString(extension)); + if (iter == extensionBehavior.end()) + return EBhMissing; + else + return iter->second; +} + +// Returns true if the given extension is set to enable, require, or warn. +bool TParseVersions::extensionTurnedOn(const char* const extension) +{ + switch (getExtensionBehavior(extension)) { + case EBhEnable: + case EBhRequire: + case EBhWarn: + return true; + default: + break; + } + return false; +} +// See if any of the extensions are set to enable, require, or warn. +bool TParseVersions::extensionsTurnedOn(int numExtensions, const char* const extensions[]) +{ + for (int i = 0; i < numExtensions; ++i) { + if (extensionTurnedOn(extensions[i])) + return true; + } + return false; +} + +// +// Change the current state of an extension's behavior. +// +void TParseVersions::updateExtensionBehavior(int line, const char* extension, const char* behaviorString) +{ + // Translate from text string of extension's behavior to an enum. + TExtensionBehavior behavior = EBhDisable; + if (! strcmp("require", behaviorString)) + behavior = EBhRequire; + else if (! strcmp("enable", behaviorString)) + behavior = EBhEnable; + else if (! strcmp("disable", behaviorString)) + behavior = EBhDisable; + else if (! strcmp("warn", behaviorString)) + behavior = EBhWarn; + else { + error(getCurrentLoc(), "behavior not supported:", "#extension", behaviorString); + return; + } + bool on = behavior != EBhDisable; + + // check if extension is used with correct shader stage + checkExtensionStage(getCurrentLoc(), extension); + + // check if extension has additional requirements + extensionRequires(getCurrentLoc(), extension, behaviorString); + + // update the requested extension + updateExtensionBehavior(extension, behavior); + + // see if need to propagate to implicitly modified things + if (strcmp(extension, "GL_ANDROID_extension_pack_es31a") == 0) { + // to everything in AEP + updateExtensionBehavior(line, "GL_KHR_blend_equation_advanced", behaviorString); + updateExtensionBehavior(line, "GL_OES_sample_variables", behaviorString); + updateExtensionBehavior(line, "GL_OES_shader_image_atomic", behaviorString); + updateExtensionBehavior(line, "GL_OES_shader_multisample_interpolation", behaviorString); + updateExtensionBehavior(line, "GL_OES_texture_storage_multisample_2d_array", behaviorString); + updateExtensionBehavior(line, "GL_EXT_geometry_shader", behaviorString); + updateExtensionBehavior(line, "GL_EXT_gpu_shader5", behaviorString); + updateExtensionBehavior(line, "GL_EXT_primitive_bounding_box", behaviorString); + updateExtensionBehavior(line, "GL_EXT_shader_io_blocks", behaviorString); + updateExtensionBehavior(line, "GL_EXT_tessellation_shader", behaviorString); + updateExtensionBehavior(line, "GL_EXT_texture_buffer", behaviorString); + updateExtensionBehavior(line, "GL_EXT_texture_cube_map_array", behaviorString); + } + // geometry to io_blocks + else if (strcmp(extension, "GL_EXT_geometry_shader") == 0) + updateExtensionBehavior(line, "GL_EXT_shader_io_blocks", behaviorString); + else if (strcmp(extension, "GL_OES_geometry_shader") == 0) + updateExtensionBehavior(line, "GL_OES_shader_io_blocks", behaviorString); + // tessellation to io_blocks + else if (strcmp(extension, "GL_EXT_tessellation_shader") == 0) + updateExtensionBehavior(line, "GL_EXT_shader_io_blocks", behaviorString); + else if (strcmp(extension, "GL_OES_tessellation_shader") == 0) + updateExtensionBehavior(line, "GL_OES_shader_io_blocks", behaviorString); + else if (strcmp(extension, "GL_GOOGLE_include_directive") == 0) + updateExtensionBehavior(line, "GL_GOOGLE_cpp_style_line_directive", behaviorString); + else if (strcmp(extension, "GL_ARB_shading_language_include") == 0) + updateExtensionBehavior(line, "GL_GOOGLE_cpp_style_line_directive", behaviorString); + // subgroup_* to subgroup_basic + else if (strcmp(extension, "GL_KHR_shader_subgroup_vote") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_KHR_shader_subgroup_arithmetic") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_KHR_shader_subgroup_ballot") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_KHR_shader_subgroup_shuffle") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_KHR_shader_subgroup_shuffle_relative") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_KHR_shader_subgroup_clustered") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_KHR_shader_subgroup_quad") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_NV_shader_subgroup_partitioned") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_EXT_buffer_reference2") == 0 || + strcmp(extension, "GL_EXT_buffer_reference_uvec2") == 0) + updateExtensionBehavior(line, "GL_EXT_buffer_reference", behaviorString); + else if (strcmp(extension, "GL_NV_integer_cooperative_matrix") == 0) + updateExtensionBehavior(line, "GL_NV_cooperative_matrix", behaviorString); + else if (strcmp(extension, "GL_NV_cooperative_matrix2") == 0) + updateExtensionBehavior(line, "GL_KHR_cooperative_matrix", behaviorString); + // subgroup extended types to explicit types + else if (strcmp(extension, "GL_EXT_shader_subgroup_extended_types_int8") == 0) + updateExtensionBehavior(line, "GL_EXT_shader_explicit_arithmetic_types_int8", behaviorString); + else if (strcmp(extension, "GL_EXT_shader_subgroup_extended_types_int16") == 0) + updateExtensionBehavior(line, "GL_EXT_shader_explicit_arithmetic_types_int16", behaviorString); + else if (strcmp(extension, "GL_EXT_shader_subgroup_extended_types_int64") == 0) + updateExtensionBehavior(line, "GL_EXT_shader_explicit_arithmetic_types_int64", behaviorString); + else if (strcmp(extension, "GL_EXT_shader_subgroup_extended_types_float16") == 0) + updateExtensionBehavior(line, "GL_EXT_shader_explicit_arithmetic_types_float16", behaviorString); + + // see if we need to update the numeric features + else if (strcmp(extension, "GL_EXT_shader_explicit_arithmetic_types") == 0) + intermediate.updateNumericFeature(TNumericFeatures::shader_explicit_arithmetic_types, on); + else if (strcmp(extension, "GL_EXT_shader_explicit_arithmetic_types_int8") == 0) + intermediate.updateNumericFeature(TNumericFeatures::shader_explicit_arithmetic_types_int8, on); + else if (strcmp(extension, "GL_EXT_shader_explicit_arithmetic_types_int16") == 0) + intermediate.updateNumericFeature(TNumericFeatures::shader_explicit_arithmetic_types_int16, on); + else if (strcmp(extension, "GL_EXT_shader_explicit_arithmetic_types_int32") == 0) + intermediate.updateNumericFeature(TNumericFeatures::shader_explicit_arithmetic_types_int32, on); + else if (strcmp(extension, "GL_EXT_shader_explicit_arithmetic_types_int64") == 0) + intermediate.updateNumericFeature(TNumericFeatures::shader_explicit_arithmetic_types_int64, on); + else if (strcmp(extension, "GL_EXT_shader_explicit_arithmetic_types_float16") == 0) + intermediate.updateNumericFeature(TNumericFeatures::shader_explicit_arithmetic_types_float16, on); + else if (strcmp(extension, "GL_EXT_shader_explicit_arithmetic_types_float32") == 0) + intermediate.updateNumericFeature(TNumericFeatures::shader_explicit_arithmetic_types_float32, on); + else if (strcmp(extension, "GL_EXT_shader_explicit_arithmetic_types_float64") == 0) + intermediate.updateNumericFeature(TNumericFeatures::shader_explicit_arithmetic_types_float64, on); + else if (strcmp(extension, "GL_EXT_shader_implicit_conversions") == 0) + intermediate.updateNumericFeature(TNumericFeatures::shader_implicit_conversions, on); + else if (strcmp(extension, "GL_ARB_gpu_shader_fp64") == 0) + intermediate.updateNumericFeature(TNumericFeatures::gpu_shader_fp64, on); + else if (strcmp(extension, "GL_AMD_gpu_shader_int16") == 0) + intermediate.updateNumericFeature(TNumericFeatures::gpu_shader_int16, on); + else if (strcmp(extension, "GL_AMD_gpu_shader_half_float") == 0) + intermediate.updateNumericFeature(TNumericFeatures::gpu_shader_half_float, on); + else if (strcmp(extension, "GL_NV_gpu_shader5") == 0) { + intermediate.updateNumericFeature(TNumericFeatures::nv_gpu_shader5_types, on); + } +} + +void TParseVersions::updateExtensionBehavior(const char* extension, TExtensionBehavior behavior) +{ + // Update the current behavior + if (strcmp(extension, "all") == 0) { + // special case for the 'all' extension; apply it to every extension present + if (behavior == EBhRequire || behavior == EBhEnable) { + error(getCurrentLoc(), "extension 'all' cannot have 'require' or 'enable' behavior", "#extension", ""); + return; + } else { + for (auto iter = extensionBehavior.begin(); iter != extensionBehavior.end(); ++iter) + iter->second = behavior; + } + } else { + // Do the update for this single extension + auto iter = extensionBehavior.find(TString(extension)); + if (iter == extensionBehavior.end()) { + switch (behavior) { + case EBhRequire: + error(getCurrentLoc(), "extension not supported:", "#extension", extension); + break; + case EBhEnable: + case EBhWarn: + case EBhDisable: + warn(getCurrentLoc(), "extension not supported:", "#extension", extension); + break; + default: + assert(0 && "unexpected behavior"); + } + + return; + } else { + if (iter->second == EBhDisablePartial) + warn(getCurrentLoc(), "extension is only partially supported:", "#extension", extension); + if (behavior != EBhDisable) + intermediate.addRequestedExtension(extension); + iter->second = behavior; + } + } +} + +// Check if extension is used with correct shader stage. +void TParseVersions::checkExtensionStage(const TSourceLoc& loc, const char * const extension) +{ + // GL_NV_mesh_shader extension is only allowed in task/mesh shaders + if (strcmp(extension, "GL_NV_mesh_shader") == 0) { + requireStage(loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask | EShLangFragmentMask), + "#extension GL_NV_mesh_shader"); + profileRequires(loc, ECoreProfile, 450, nullptr, "#extension GL_NV_mesh_shader"); + profileRequires(loc, EEsProfile, 320, nullptr, "#extension GL_NV_mesh_shader"); + if (extensionTurnedOn(E_GL_EXT_mesh_shader)) { + error(loc, "GL_EXT_mesh_shader is already turned on, and not allowed with", "#extension", extension); + } + } + else if (strcmp(extension, "GL_EXT_mesh_shader") == 0) { + requireStage(loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask | EShLangFragmentMask), + "#extension GL_EXT_mesh_shader"); + profileRequires(loc, ECoreProfile, 450, nullptr, "#extension GL_EXT_mesh_shader"); + profileRequires(loc, EEsProfile, 320, nullptr, "#extension GL_EXT_mesh_shader"); + if (extensionTurnedOn(E_GL_NV_mesh_shader)) { + error(loc, "GL_NV_mesh_shader is already turned on, and not allowed with", "#extension", extension); + } + } +} + +// Check if extension has additional requirements +void TParseVersions::extensionRequires(const TSourceLoc &loc, const char * const extension, const char *behaviorString) +{ + bool isEnabled = false; + if (!strcmp("require", behaviorString)) + isEnabled = true; + else if (!strcmp("enable", behaviorString)) + isEnabled = true; + + if (isEnabled) { + unsigned int minSpvVersion = 0; + auto iter = extensionMinSpv.find(TString(extension)); + if (iter != extensionMinSpv.end()) + minSpvVersion = iter->second; + requireSpv(loc, extension, minSpvVersion); + } + + if (spvVersion.spv != 0){ + for (auto ext : spvUnsupportedExt){ + if (strcmp(extension, ext.c_str()) == 0) + error(loc, "not allowed when using generating SPIR-V codes", extension, ""); + } + } +} + +// Call for any operation needing full GLSL integer data-type support. +void TParseVersions::fullIntegerCheck(const TSourceLoc& loc, const char* op) +{ + profileRequires(loc, ENoProfile, 130, nullptr, op); + profileRequires(loc, EEsProfile, 300, nullptr, op); +} + +// Call for any operation needing GLSL double data-type support. +void TParseVersions::doubleCheck(const TSourceLoc& loc, const char* op) +{ + + //requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); + if (language == EShLangVertex) { + const char* const f64_Extensions[] = {E_GL_ARB_gpu_shader_fp64, E_GL_ARB_vertex_attrib_64bit}; + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 400, 2, f64_Extensions, op); + } else + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader_fp64, op); +} + +// Call for any operation needing GLSL float16 data-type support. +void TParseVersions::float16Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = { + E_GL_AMD_gpu_shader_half_float, + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_float16}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + +bool TParseVersions::float16Arithmetic() +{ + const char* const extensions[] = { + E_GL_AMD_gpu_shader_half_float, + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_NV_gpu_shader5, + E_GL_EXT_shader_explicit_arithmetic_types_float16}; + return extensionsTurnedOn(sizeof(extensions)/sizeof(extensions[0]), extensions); +} + +bool TParseVersions::int16Arithmetic() +{ + const char* const extensions[] = { + E_GL_AMD_gpu_shader_int16, + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_NV_gpu_shader5, + E_GL_EXT_shader_explicit_arithmetic_types_int16}; + return extensionsTurnedOn(sizeof(extensions)/sizeof(extensions[0]), extensions); +} + +bool TParseVersions::int8Arithmetic() +{ + const char* const extensions[] = { + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_NV_gpu_shader5, + E_GL_EXT_shader_explicit_arithmetic_types_int8}; + return extensionsTurnedOn(sizeof(extensions)/sizeof(extensions[0]), extensions); +} + +void TParseVersions::requireFloat16Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc) +{ + TString combined; + combined = op; + combined += ": "; + combined += featureDesc; + + const char* const extensions[] = { + E_GL_AMD_gpu_shader_half_float, + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_NV_gpu_shader5, + E_GL_EXT_shader_explicit_arithmetic_types_float16}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, combined.c_str()); +} + +void TParseVersions::requireInt16Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc) +{ + TString combined; + combined = op; + combined += ": "; + combined += featureDesc; + + const char* const extensions[] = { + E_GL_AMD_gpu_shader_int16, + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_NV_gpu_shader5, + E_GL_EXT_shader_explicit_arithmetic_types_int16}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, combined.c_str()); +} + +void TParseVersions::requireInt8Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc) +{ + TString combined; + combined = op; + combined += ": "; + combined += featureDesc; + + const char* const extensions[] = { + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_NV_gpu_shader5, + E_GL_EXT_shader_explicit_arithmetic_types_int8}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, combined.c_str()); +} + +void TParseVersions::float16ScalarVectorCheck(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = { + E_GL_AMD_gpu_shader_half_float, + E_GL_EXT_shader_16bit_storage, + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_NV_gpu_shader5, + E_GL_EXT_shader_explicit_arithmetic_types_float16}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + +void TParseVersions::bfloat16ScalarVectorCheck(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = { + E_GL_EXT_bfloat16, + }; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + +void TParseVersions::floate5m2ScalarVectorCheck(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = { + E_GL_EXT_float_e5m2, + }; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + +void TParseVersions::floate4m3ScalarVectorCheck(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = { + E_GL_EXT_float_e4m3, + }; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + +// Call for any operation needing GLSL float32 data-type support. +void TParseVersions::explicitFloat32Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = {E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_NV_gpu_shader5, + E_GL_EXT_shader_explicit_arithmetic_types_float32}; + requireExtensions(loc, sizeof(extensions) / sizeof(extensions[0]), extensions, op); + } +} + +// Call for any operation needing GLSL float64 data-type support. +void TParseVersions::explicitFloat64Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = {E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_NV_gpu_shader5, + E_GL_EXT_shader_explicit_arithmetic_types_float64}; + requireExtensions(loc, sizeof(extensions) / sizeof(extensions[0]), extensions, op); + requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); + if(extensionTurnedOn(E_GL_ARB_gpu_shader_fp64) && extensionTurnedOn(E_GL_NV_gpu_shader5)) + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 150, nullptr, op); + else + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 400, nullptr, op); + } +} + +// Call for any operation needing GLSL explicit int8 data-type support. +void TParseVersions::explicitInt8Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (! builtIn) { + const char* const extensions[2] = {E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_int8}; + requireExtensions(loc, 2, extensions, op); + } +} + +// Call for any operation needing GLSL float16 opaque-type support +void TParseVersions::float16OpaqueCheck(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (! builtIn) { + requireExtensions(loc, 1, &E_GL_AMD_gpu_shader_half_float_fetch, op); + requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 400, nullptr, op); + } +} + +// Call for any operation needing GLSL explicit int16 data-type support. +void TParseVersions::explicitInt16Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (! builtIn) { + const char* const extensions[] = { + E_GL_AMD_gpu_shader_int16, + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_int16}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + +void TParseVersions::int16ScalarVectorCheck(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (! builtIn) { + const char* const extensions[] = { + E_GL_AMD_gpu_shader_int16, + E_GL_EXT_shader_16bit_storage, + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_NV_gpu_shader5, + E_GL_EXT_shader_explicit_arithmetic_types_int16}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + +void TParseVersions::int8ScalarVectorCheck(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (! builtIn) { + const char* const extensions[] = { + E_GL_EXT_shader_8bit_storage, + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_NV_gpu_shader5, + E_GL_EXT_shader_explicit_arithmetic_types_int8}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + +// Call for any operation needing GLSL explicit int32 data-type support. +void TParseVersions::explicitInt32Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (! builtIn) { + const char* const extensions[] = {E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_NV_gpu_shader5, + E_GL_EXT_shader_explicit_arithmetic_types_int32}; + requireExtensions(loc, sizeof(extensions) / sizeof(extensions[0]), extensions, op); + } +} + +// Call for any operation needing GLSL 64-bit integer data-type support. +void TParseVersions::int64Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (! builtIn) { + const char* const extensions[] = {E_GL_ARB_gpu_shader_int64, + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_NV_gpu_shader5, + E_GL_EXT_shader_explicit_arithmetic_types_int64}; + requireExtensions(loc, sizeof(extensions) / sizeof(extensions[0]), extensions, op); + requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); + if (extensionTurnedOn(E_GL_NV_gpu_shader5)) + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 150, nullptr, op); + else + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 400, nullptr, op); + } +} + +void TParseVersions::fcoopmatCheckNV(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = {E_GL_NV_cooperative_matrix}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + +void TParseVersions::intcoopmatCheckNV(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = {E_GL_NV_integer_cooperative_matrix}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + +void TParseVersions::coopmatCheck(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = {E_GL_KHR_cooperative_matrix}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + +void TParseVersions::coopmatConverisonCheckQCOM(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = {E_GL_KHR_cooperative_matrix}; + requireExtensions(loc, sizeof(extensions) / sizeof(extensions[0]), extensions, op); + } +} + +void TParseVersions::tensorLayoutViewCheck(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = {E_GL_NV_cooperative_matrix2}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + +void TParseVersions::coopvecCheck(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = {E_GL_NV_cooperative_vector}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + +void TParseVersions::intattachmentCheck(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = {E_GL_QCOM_tile_shading}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + +void TParseVersions::tensorCheckARM(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = {E_GL_ARM_tensors}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + +// Call for any operation removed because SPIR-V is in use. +void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op) +{ + if (spvVersion.spv != 0) + error(loc, "not allowed when generating SPIR-V", op, ""); +} + +// Call for any operation removed because Vulkan SPIR-V is being generated. +void TParseVersions::vulkanRemoved(const TSourceLoc& loc, const char* op) +{ + if (spvVersion.vulkan > 0 && !spvVersion.vulkanRelaxed) + error(loc, "not allowed when using GLSL for Vulkan", op, ""); +} + +// Call for any operation that requires Vulkan. +void TParseVersions::requireVulkan(const TSourceLoc& loc, const char* op) +{ + if (spvVersion.vulkan == 0) + error(loc, "only allowed when using GLSL for Vulkan", op, ""); +} + +// Call for any operation that requires SPIR-V. +void TParseVersions::requireSpv(const TSourceLoc& loc, const char* op) +{ + if (spvVersion.spv == 0) + error(loc, "only allowed when generating SPIR-V", op, ""); +} +void TParseVersions::requireSpv(const TSourceLoc& loc, const char *op, unsigned int version) +{ + if (spvVersion.spv < version) + error(loc, "not supported for current targeted SPIR-V version", op, ""); +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Versions.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Versions.h new file mode 100644 index 0000000000..dc3e8d9ba2 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/Versions.h @@ -0,0 +1,413 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017, 2022-2024 Arm Limited. +// Copyright (C) 2015-2018 Google, Inc. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +// Modifications Copyright (C) 2024 Valve Corporation. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef _VERSIONS_INCLUDED_ +#define _VERSIONS_INCLUDED_ + +#define LAST_ELEMENT_MARKER(x) x + +// +// Help manage multiple profiles, versions, extensions etc. +// + +// +// Profiles are set up for masking operations, so queries can be done on multiple +// profiles at the same time. +// +// Don't maintain an ordinal set of enums (0,1,2,3...) to avoid all possible +// defects from mixing the two different forms. +// +typedef enum : unsigned { + EBadProfile = 0, + ENoProfile = (1 << 0), // only for desktop, before profiles showed up + ECoreProfile = (1 << 1), + ECompatibilityProfile = (1 << 2), + EEsProfile = (1 << 3), + LAST_ELEMENT_MARKER(EProfileCount), +} EProfile; + +namespace QtShaderTools { +namespace glslang { + +// +// Map from profile enum to externally readable text name. +// +inline const char* ProfileName(EProfile profile) +{ + switch (profile) { + case ENoProfile: return "none"; + case ECoreProfile: return "core"; + case ECompatibilityProfile: return "compatibility"; + case EEsProfile: return "es"; + default: return "unknown profile"; + } +} + +// +// What source rules, validation rules, target language, etc. are needed or +// desired for SPIR-V? +// +// 0 means a target or rule set is not enabled (ignore rules from that entity). +// Non-0 means to apply semantic rules arising from that version of its rule set. +// The union of all requested rule sets will be applied. +// +struct SpvVersion { + SpvVersion() : spv(0), vulkanGlsl(0), vulkan(0), openGl(0), vulkanRelaxed(false) {} + unsigned int spv; // the version of SPIR-V to target, as defined by "word 1" of the SPIR-V binary header + int vulkanGlsl; // the version of GLSL semantics for Vulkan, from GL_KHR_vulkan_glsl, for "#define VULKAN XXX" + int vulkan; // the version of Vulkan, for which SPIR-V execution environment rules to use + int openGl; // the version of GLSL semantics for OpenGL, from GL_ARB_gl_spirv, for "#define GL_SPIRV XXX" + bool vulkanRelaxed; // relax changes to GLSL for Vulkan, allowing some GL-specific to be compiled to Vulkan SPIR-V target +}; + +// +// The behaviors from the GLSL "#extension extension_name : behavior" +// +typedef enum { + EBhMissing = 0, + EBhRequire, + EBhEnable, + EBhWarn, + EBhDisable, + EBhDisablePartial // use as initial state of an extension that is only partially implemented +} TExtensionBehavior; + +// +// Symbolic names for extensions. Strings may be directly used when calling the +// functions, but better to have the compiler do spelling checks. +// +const char* const E_GL_OES_texture_3D = "GL_OES_texture_3D"; +const char* const E_GL_OES_standard_derivatives = "GL_OES_standard_derivatives"; +const char* const E_GL_EXT_frag_depth = "GL_EXT_frag_depth"; +const char* const E_GL_OES_EGL_image_external = "GL_OES_EGL_image_external"; +const char* const E_GL_OES_EGL_image_external_essl3 = "GL_OES_EGL_image_external_essl3"; +const char* const E_GL_EXT_YUV_target = "GL_EXT_YUV_target"; +const char* const E_GL_EXT_shader_texture_lod = "GL_EXT_shader_texture_lod"; +const char* const E_GL_EXT_shadow_samplers = "GL_EXT_shadow_samplers"; + +const char* const E_GL_ARB_texture_rectangle = "GL_ARB_texture_rectangle"; +const char* const E_GL_3DL_array_objects = "GL_3DL_array_objects"; +const char* const E_GL_ARB_shading_language_420pack = "GL_ARB_shading_language_420pack"; +const char* const E_GL_ARB_texture_gather = "GL_ARB_texture_gather"; +const char* const E_GL_ARB_gpu_shader5 = "GL_ARB_gpu_shader5"; +const char* const E_GL_ARB_separate_shader_objects = "GL_ARB_separate_shader_objects"; +const char* const E_GL_ARB_compute_shader = "GL_ARB_compute_shader"; +const char* const E_GL_ARB_tessellation_shader = "GL_ARB_tessellation_shader"; +const char* const E_GL_ARB_enhanced_layouts = "GL_ARB_enhanced_layouts"; +const char* const E_GL_ARB_texture_cube_map_array = "GL_ARB_texture_cube_map_array"; +const char* const E_GL_ARB_texture_multisample = "GL_ARB_texture_multisample"; +const char* const E_GL_ARB_shader_texture_lod = "GL_ARB_shader_texture_lod"; +const char* const E_GL_ARB_explicit_attrib_location = "GL_ARB_explicit_attrib_location"; +const char* const E_GL_ARB_explicit_uniform_location = "GL_ARB_explicit_uniform_location"; +const char* const E_GL_ARB_shader_image_load_store = "GL_ARB_shader_image_load_store"; +const char* const E_GL_ARB_shader_atomic_counters = "GL_ARB_shader_atomic_counters"; +const char* const E_GL_ARB_shader_atomic_counter_ops = "GL_ARB_shader_atomic_counter_ops"; +const char* const E_GL_ARB_shader_draw_parameters = "GL_ARB_shader_draw_parameters"; +const char* const E_GL_ARB_shader_group_vote = "GL_ARB_shader_group_vote"; +const char* const E_GL_ARB_derivative_control = "GL_ARB_derivative_control"; +const char* const E_GL_ARB_shader_texture_image_samples = "GL_ARB_shader_texture_image_samples"; +const char* const E_GL_ARB_viewport_array = "GL_ARB_viewport_array"; +const char* const E_GL_ARB_gpu_shader_int64 = "GL_ARB_gpu_shader_int64"; +const char* const E_GL_ARB_gpu_shader_fp64 = "GL_ARB_gpu_shader_fp64"; +const char* const E_GL_ARB_shader_ballot = "GL_ARB_shader_ballot"; +const char* const E_GL_ARB_sparse_texture2 = "GL_ARB_sparse_texture2"; +const char* const E_GL_ARB_sparse_texture_clamp = "GL_ARB_sparse_texture_clamp"; +const char* const E_GL_ARB_shader_stencil_export = "GL_ARB_shader_stencil_export"; +// const char* const E_GL_ARB_cull_distance = "GL_ARB_cull_distance"; // present for 4.5, but need extension control over block members +const char* const E_GL_ARB_post_depth_coverage = "GL_ARB_post_depth_coverage"; +const char* const E_GL_ARB_shader_viewport_layer_array = "GL_ARB_shader_viewport_layer_array"; +const char* const E_GL_ARB_fragment_shader_interlock = "GL_ARB_fragment_shader_interlock"; +const char* const E_GL_ARB_shader_clock = "GL_ARB_shader_clock"; +const char* const E_GL_ARB_uniform_buffer_object = "GL_ARB_uniform_buffer_object"; +const char* const E_GL_ARB_sample_shading = "GL_ARB_sample_shading"; +const char* const E_GL_ARB_shader_bit_encoding = "GL_ARB_shader_bit_encoding"; +const char* const E_GL_ARB_shader_image_size = "GL_ARB_shader_image_size"; +const char* const E_GL_ARB_shader_storage_buffer_object = "GL_ARB_shader_storage_buffer_object"; +const char* const E_GL_ARB_shading_language_packing = "GL_ARB_shading_language_packing"; +const char* const E_GL_ARB_texture_query_lod = "GL_ARB_texture_query_lod"; +const char* const E_GL_ARB_vertex_attrib_64bit = "GL_ARB_vertex_attrib_64bit"; +const char* const E_GL_ARB_draw_instanced = "GL_ARB_draw_instanced"; +const char* const E_GL_ARB_fragment_coord_conventions = "GL_ARB_fragment_coord_conventions"; +const char* const E_GL_ARB_bindless_texture = "GL_ARB_bindless_texture"; +const char* const E_GL_ARB_conservative_depth = "GL_ARB_conservative_depth"; + +const char* const E_GL_KHR_shader_subgroup_basic = "GL_KHR_shader_subgroup_basic"; +const char* const E_GL_KHR_shader_subgroup_vote = "GL_KHR_shader_subgroup_vote"; +const char* const E_GL_KHR_shader_subgroup_arithmetic = "GL_KHR_shader_subgroup_arithmetic"; +const char* const E_GL_KHR_shader_subgroup_ballot = "GL_KHR_shader_subgroup_ballot"; +const char* const E_GL_KHR_shader_subgroup_shuffle = "GL_KHR_shader_subgroup_shuffle"; +const char* const E_GL_KHR_shader_subgroup_shuffle_relative = "GL_KHR_shader_subgroup_shuffle_relative"; +const char* const E_GL_KHR_shader_subgroup_rotate = "GL_KHR_shader_subgroup_rotate"; +const char* const E_GL_KHR_shader_subgroup_clustered = "GL_KHR_shader_subgroup_clustered"; +const char* const E_GL_KHR_shader_subgroup_quad = "GL_KHR_shader_subgroup_quad"; +const char* const E_GL_KHR_memory_scope_semantics = "GL_KHR_memory_scope_semantics"; +const char* const E_GL_KHR_cooperative_matrix = "GL_KHR_cooperative_matrix"; + +const char* const E_GL_EXT_shader_atomic_int64 = "GL_EXT_shader_atomic_int64"; + +const char* const E_GL_EXT_shader_non_constant_global_initializers = "GL_EXT_shader_non_constant_global_initializers"; +const char* const E_GL_EXT_shader_image_load_formatted = "GL_EXT_shader_image_load_formatted"; + +const char* const E_GL_EXT_shader_16bit_storage = "GL_EXT_shader_16bit_storage"; +const char* const E_GL_EXT_shader_8bit_storage = "GL_EXT_shader_8bit_storage"; + + +// EXT extensions +const char* const E_GL_EXT_device_group = "GL_EXT_device_group"; +const char* const E_GL_EXT_multiview = "GL_EXT_multiview"; +const char* const E_GL_EXT_post_depth_coverage = "GL_EXT_post_depth_coverage"; +const char* const E_GL_EXT_control_flow_attributes = "GL_EXT_control_flow_attributes"; +const char* const E_GL_EXT_nonuniform_qualifier = "GL_EXT_nonuniform_qualifier"; +const char* const E_GL_EXT_samplerless_texture_functions = "GL_EXT_samplerless_texture_functions"; +const char* const E_GL_EXT_scalar_block_layout = "GL_EXT_scalar_block_layout"; +const char* const E_GL_EXT_fragment_invocation_density = "GL_EXT_fragment_invocation_density"; +const char* const E_GL_EXT_buffer_reference = "GL_EXT_buffer_reference"; +const char* const E_GL_EXT_buffer_reference2 = "GL_EXT_buffer_reference2"; +const char* const E_GL_EXT_buffer_reference_uvec2 = "GL_EXT_buffer_reference_uvec2"; +const char* const E_GL_EXT_demote_to_helper_invocation = "GL_EXT_demote_to_helper_invocation"; +const char* const E_GL_EXT_shader_realtime_clock = "GL_EXT_shader_realtime_clock"; +const char* const E_GL_EXT_debug_printf = "GL_EXT_debug_printf"; +const char* const E_GL_EXT_ray_tracing = "GL_EXT_ray_tracing"; +const char* const E_GL_EXT_ray_query = "GL_EXT_ray_query"; +const char* const E_GL_EXT_ray_flags_primitive_culling = "GL_EXT_ray_flags_primitive_culling"; +const char* const E_GL_EXT_ray_cull_mask = "GL_EXT_ray_cull_mask"; +const char* const E_GL_EXT_blend_func_extended = "GL_EXT_blend_func_extended"; +const char* const E_GL_EXT_shader_implicit_conversions = "GL_EXT_shader_implicit_conversions"; +const char* const E_GL_EXT_fragment_shading_rate = "GL_EXT_fragment_shading_rate"; +const char* const E_GL_EXT_shader_image_int64 = "GL_EXT_shader_image_int64"; +const char* const E_GL_EXT_null_initializer = "GL_EXT_null_initializer"; +const char* const E_GL_EXT_shared_memory_block = "GL_EXT_shared_memory_block"; +const char* const E_GL_EXT_subgroup_uniform_control_flow = "GL_EXT_subgroup_uniform_control_flow"; +const char* const E_GL_EXT_spirv_intrinsics = "GL_EXT_spirv_intrinsics"; +const char* const E_GL_EXT_fragment_shader_barycentric = "GL_EXT_fragment_shader_barycentric"; +const char* const E_GL_EXT_mesh_shader = "GL_EXT_mesh_shader"; +const char* const E_GL_EXT_opacity_micromap = "GL_EXT_opacity_micromap"; +const char* const E_GL_EXT_shader_quad_control = "GL_EXT_shader_quad_control"; +const char* const E_GL_EXT_draw_instanced = "GL_EXT_draw_instanced"; +const char* const E_GL_EXT_texture_array = "GL_EXT_texture_array"; +const char* const E_GL_EXT_maximal_reconvergence = "GL_EXT_maximal_reconvergence"; +const char* const E_GL_EXT_expect_assume = "GL_EXT_expect_assume"; +const char* const E_GL_EXT_control_flow_attributes2 = "GL_EXT_control_flow_attributes2"; +const char* const E_GL_EXT_spec_constant_composites = "GL_EXT_spec_constant_composites"; +const char* const E_GL_EXT_texture_offset_non_const = "GL_EXT_texture_offset_non_const"; +const char* const E_GL_EXT_nontemporal_keyword = "GL_EXT_nontemporal_keyword"; +const char* const E_GL_EXT_uniform_buffer_unsized_array = "GL_EXT_uniform_buffer_unsized_array"; +const char* const E_GL_EXT_conservative_depth = "GL_EXT_conservative_depth"; + +// Arrays of extensions for the above viewportEXTs duplications + +const char* const post_depth_coverageEXTs[] = { E_GL_ARB_post_depth_coverage, E_GL_EXT_post_depth_coverage }; +const int Num_post_depth_coverageEXTs = sizeof(post_depth_coverageEXTs) / sizeof(post_depth_coverageEXTs[0]); + +// Array of extensions to cover both extensions providing ray tracing capabilities. +const char* const ray_tracing_EXTs[] = { E_GL_EXT_ray_query, E_GL_EXT_ray_tracing }; +const int Num_ray_tracing_EXTs = sizeof(ray_tracing_EXTs) / sizeof(ray_tracing_EXTs[0]); + +// OVR extensions +const char* const E_GL_OVR_multiview = "GL_OVR_multiview"; +const char* const E_GL_OVR_multiview2 = "GL_OVR_multiview2"; + +const char* const OVR_multiview_EXTs[] = { E_GL_OVR_multiview, E_GL_OVR_multiview2 }; +const int Num_OVR_multiview_EXTs = sizeof(OVR_multiview_EXTs) / sizeof(OVR_multiview_EXTs[0]); + +// #line and #include +const char* const E_GL_GOOGLE_cpp_style_line_directive = "GL_GOOGLE_cpp_style_line_directive"; +const char* const E_GL_GOOGLE_include_directive = "GL_GOOGLE_include_directive"; +const char* const E_GL_ARB_shading_language_include = "GL_ARB_shading_language_include"; + +const char* const E_GL_AMD_shader_ballot = "GL_AMD_shader_ballot"; +const char* const E_GL_AMD_shader_trinary_minmax = "GL_AMD_shader_trinary_minmax"; +const char* const E_GL_AMD_shader_explicit_vertex_parameter = "GL_AMD_shader_explicit_vertex_parameter"; +const char* const E_GL_AMD_gcn_shader = "GL_AMD_gcn_shader"; +const char* const E_GL_AMD_gpu_shader_half_float = "GL_AMD_gpu_shader_half_float"; +const char* const E_GL_AMD_texture_gather_bias_lod = "GL_AMD_texture_gather_bias_lod"; +const char* const E_GL_AMD_gpu_shader_int16 = "GL_AMD_gpu_shader_int16"; +const char* const E_GL_AMD_shader_image_load_store_lod = "GL_AMD_shader_image_load_store_lod"; +const char* const E_GL_AMD_shader_fragment_mask = "GL_AMD_shader_fragment_mask"; +const char* const E_GL_AMD_gpu_shader_half_float_fetch = "GL_AMD_gpu_shader_half_float_fetch"; +const char* const E_GL_AMD_shader_early_and_late_fragment_tests = "GL_AMD_shader_early_and_late_fragment_tests"; + +const char* const E_GL_INTEL_shader_integer_functions2 = "GL_INTEL_shader_integer_functions2"; + +const char* const E_GL_NV_sample_mask_override_coverage = "GL_NV_sample_mask_override_coverage"; +const char* const E_SPV_NV_geometry_shader_passthrough = "GL_NV_geometry_shader_passthrough"; +const char* const E_GL_NV_viewport_array2 = "GL_NV_viewport_array2"; +const char* const E_GL_NV_stereo_view_rendering = "GL_NV_stereo_view_rendering"; +const char* const E_GL_NVX_multiview_per_view_attributes = "GL_NVX_multiview_per_view_attributes"; +const char* const E_GL_NV_shader_atomic_int64 = "GL_NV_shader_atomic_int64"; +const char* const E_GL_NV_conservative_raster_underestimation = "GL_NV_conservative_raster_underestimation"; +const char* const E_GL_NV_shader_noperspective_interpolation = "GL_NV_shader_noperspective_interpolation"; +const char* const E_GL_NV_shader_subgroup_partitioned = "GL_NV_shader_subgroup_partitioned"; +const char* const E_GL_NV_shading_rate_image = "GL_NV_shading_rate_image"; +const char* const E_GL_NV_ray_tracing = "GL_NV_ray_tracing"; +const char* const E_GL_NV_ray_tracing_motion_blur = "GL_NV_ray_tracing_motion_blur"; +const char* const E_GL_NV_fragment_shader_barycentric = "GL_NV_fragment_shader_barycentric"; +const char* const E_GL_NV_compute_shader_derivatives = "GL_NV_compute_shader_derivatives"; +const char* const E_GL_NV_shader_texture_footprint = "GL_NV_shader_texture_footprint"; +const char* const E_GL_NV_mesh_shader = "GL_NV_mesh_shader"; +const char* const E_GL_NV_cooperative_matrix = "GL_NV_cooperative_matrix"; +const char* const E_GL_NV_shader_sm_builtins = "GL_NV_shader_sm_builtins"; +const char* const E_GL_NV_integer_cooperative_matrix = "GL_NV_integer_cooperative_matrix"; +const char* const E_GL_NV_shader_invocation_reorder = "GL_NV_shader_invocation_reorder"; +const char* const E_GL_EXT_ray_tracing_position_fetch = "GL_EXT_ray_tracing_position_fetch"; +const char* const E_GL_NV_displacement_micromap = "GL_NV_displacement_micromap"; +const char* const E_GL_NV_shader_atomic_fp16_vector = "GL_NV_shader_atomic_fp16_vector"; +const char* const E_GL_NV_cooperative_matrix2 = "GL_NV_cooperative_matrix2"; +const char* const E_GL_NV_cooperative_vector = "GL_NV_cooperative_vector"; +const char* const E_GL_NV_cluster_acceleration_structure = "GL_NV_cluster_acceleration_structure"; +const char* const E_GL_NV_linear_swept_spheres = "GL_NV_linear_swept_spheres"; +const char* const E_GL_NV_gpu_shader5 = "GL_NV_gpu_shader5"; + +// ARM +const char* const E_GL_ARM_shader_core_builtins = "GL_ARM_shader_core_builtins"; +const char* const E_GL_ARM_tensors = "GL_ARM_tensors"; + +// Arrays of extensions for the above viewportEXTs duplications + +const char* const viewportEXTs[] = { E_GL_ARB_shader_viewport_layer_array, E_GL_NV_viewport_array2 }; +const int Num_viewportEXTs = sizeof(viewportEXTs) / sizeof(viewportEXTs[0]); + + +const char* const E_GL_QCOM_image_processing = "GL_QCOM_image_processing"; +const char* const E_GL_QCOM_image_processing2 = "GL_QCOM_image_processing2"; +const char* const E_GL_QCOM_tile_shading = "GL_QCOM_tile_shading"; +const char* const E_GL_QCOM_cooperative_matrix_conversion = "GL_QCOM_cooperative_matrix_conversion"; + +// AEP +const char* const E_GL_ANDROID_extension_pack_es31a = "GL_ANDROID_extension_pack_es31a"; +const char* const E_GL_KHR_blend_equation_advanced = "GL_KHR_blend_equation_advanced"; +const char* const E_GL_OES_sample_variables = "GL_OES_sample_variables"; +const char* const E_GL_OES_shader_image_atomic = "GL_OES_shader_image_atomic"; +const char* const E_GL_OES_shader_multisample_interpolation = "GL_OES_shader_multisample_interpolation"; +const char* const E_GL_OES_texture_storage_multisample_2d_array = "GL_OES_texture_storage_multisample_2d_array"; +const char* const E_GL_EXT_geometry_shader = "GL_EXT_geometry_shader"; +const char* const E_GL_EXT_geometry_point_size = "GL_EXT_geometry_point_size"; +const char* const E_GL_EXT_gpu_shader5 = "GL_EXT_gpu_shader5"; +const char* const E_GL_EXT_primitive_bounding_box = "GL_EXT_primitive_bounding_box"; +const char* const E_GL_EXT_shader_io_blocks = "GL_EXT_shader_io_blocks"; +const char* const E_GL_EXT_tessellation_shader = "GL_EXT_tessellation_shader"; +const char* const E_GL_EXT_tessellation_point_size = "GL_EXT_tessellation_point_size"; +const char* const E_GL_EXT_texture_buffer = "GL_EXT_texture_buffer"; +const char* const E_GL_EXT_texture_cube_map_array = "GL_EXT_texture_cube_map_array"; +const char* const E_GL_EXT_shader_integer_mix = "GL_EXT_shader_integer_mix"; + +// OES matching AEP +const char* const E_GL_OES_geometry_shader = "GL_OES_geometry_shader"; +const char* const E_GL_OES_geometry_point_size = "GL_OES_geometry_point_size"; +const char* const E_GL_OES_gpu_shader5 = "GL_OES_gpu_shader5"; +const char* const E_GL_OES_primitive_bounding_box = "GL_OES_primitive_bounding_box"; +const char* const E_GL_OES_shader_io_blocks = "GL_OES_shader_io_blocks"; +const char* const E_GL_OES_tessellation_shader = "GL_OES_tessellation_shader"; +const char* const E_GL_OES_tessellation_point_size = "GL_OES_tessellation_point_size"; +const char* const E_GL_OES_texture_buffer = "GL_OES_texture_buffer"; +const char* const E_GL_OES_texture_cube_map_array = "GL_OES_texture_cube_map_array"; + +// EXT +const char* const E_GL_EXT_shader_explicit_arithmetic_types = "GL_EXT_shader_explicit_arithmetic_types"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_int8 = "GL_EXT_shader_explicit_arithmetic_types_int8"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_int16 = "GL_EXT_shader_explicit_arithmetic_types_int16"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_int32 = "GL_EXT_shader_explicit_arithmetic_types_int32"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_int64 = "GL_EXT_shader_explicit_arithmetic_types_int64"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_float16 = "GL_EXT_shader_explicit_arithmetic_types_float16"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_float32 = "GL_EXT_shader_explicit_arithmetic_types_float32"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_float64 = "GL_EXT_shader_explicit_arithmetic_types_float64"; + +const char* const E_GL_EXT_shader_subgroup_extended_types_int8 = "GL_EXT_shader_subgroup_extended_types_int8"; +const char* const E_GL_EXT_shader_subgroup_extended_types_int16 = "GL_EXT_shader_subgroup_extended_types_int16"; +const char* const E_GL_EXT_shader_subgroup_extended_types_int64 = "GL_EXT_shader_subgroup_extended_types_int64"; +const char* const E_GL_EXT_shader_subgroup_extended_types_float16 = "GL_EXT_shader_subgroup_extended_types_float16"; +const char* const E_GL_EXT_terminate_invocation = "GL_EXT_terminate_invocation"; + +const char* const E_GL_EXT_shader_atomic_float = "GL_EXT_shader_atomic_float"; +const char* const E_GL_EXT_shader_atomic_float2 = "GL_EXT_shader_atomic_float2"; + +const char* const E_GL_EXT_shader_tile_image = "GL_EXT_shader_tile_image"; + +const char* const E_GL_EXT_texture_shadow_lod = "GL_EXT_texture_shadow_lod"; + +const char* const E_GL_EXT_integer_dot_product = "GL_EXT_integer_dot_product"; + +const char* const E_GL_EXT_bfloat16 = "GL_EXT_bfloat16"; +const char* const E_GL_EXT_float_e5m2 = "GL_EXT_float_e5m2"; +const char* const E_GL_EXT_float_e4m3 = "GL_EXT_float_e4m3"; + +const char* const E_GL_EXT_shader_64bit_indexing = "GL_EXT_shader_64bit_indexing"; + +const char* const E_GL_EXT_shader_invocation_reorder = "GL_EXT_shader_invocation_reorder"; + +// Arrays of extensions for the above AEP duplications + +const char* const AEP_geometry_shader[] = { E_GL_EXT_geometry_shader, E_GL_OES_geometry_shader }; +const int Num_AEP_geometry_shader = sizeof(AEP_geometry_shader)/sizeof(AEP_geometry_shader[0]); + +const char* const AEP_geometry_point_size[] = { E_GL_EXT_geometry_point_size, E_GL_OES_geometry_point_size }; +const int Num_AEP_geometry_point_size = sizeof(AEP_geometry_point_size)/sizeof(AEP_geometry_point_size[0]); + +const char* const AEP_gpu_shader5[] = { E_GL_EXT_gpu_shader5, E_GL_OES_gpu_shader5 }; +const int Num_AEP_gpu_shader5 = sizeof(AEP_gpu_shader5)/sizeof(AEP_gpu_shader5[0]); + +const char* const AEP_core_gpu_shader5[] = { E_GL_ARB_gpu_shader5, E_GL_NV_gpu_shader5}; +const int Num_AEP_core_gpu_shader5 = sizeof(AEP_core_gpu_shader5)/sizeof(AEP_core_gpu_shader5[0]); + +const char* const AEP_primitive_bounding_box[] = { E_GL_EXT_primitive_bounding_box, E_GL_OES_primitive_bounding_box }; +const int Num_AEP_primitive_bounding_box = sizeof(AEP_primitive_bounding_box)/sizeof(AEP_primitive_bounding_box[0]); + +const char* const AEP_shader_io_blocks[] = { E_GL_EXT_shader_io_blocks, E_GL_OES_shader_io_blocks }; +const int Num_AEP_shader_io_blocks = sizeof(AEP_shader_io_blocks)/sizeof(AEP_shader_io_blocks[0]); + +const char* const AEP_tessellation_shader[] = { E_GL_EXT_tessellation_shader, E_GL_OES_tessellation_shader }; +const int Num_AEP_tessellation_shader = sizeof(AEP_tessellation_shader)/sizeof(AEP_tessellation_shader[0]); + +const char* const AEP_tessellation_point_size[] = { E_GL_EXT_tessellation_point_size, E_GL_OES_tessellation_point_size }; +const int Num_AEP_tessellation_point_size = sizeof(AEP_tessellation_point_size)/sizeof(AEP_tessellation_point_size[0]); + +const char* const AEP_texture_buffer[] = { E_GL_EXT_texture_buffer, E_GL_OES_texture_buffer }; +const int Num_AEP_texture_buffer = sizeof(AEP_texture_buffer)/sizeof(AEP_texture_buffer[0]); + +const char* const AEP_texture_cube_map_array[] = { E_GL_EXT_texture_cube_map_array, E_GL_OES_texture_cube_map_array }; +const int Num_AEP_texture_cube_map_array = sizeof(AEP_texture_cube_map_array)/sizeof(AEP_texture_cube_map_array[0]); + +const char* const AEP_mesh_shader[] = { E_GL_NV_mesh_shader, E_GL_EXT_mesh_shader }; +const int Num_AEP_mesh_shader = sizeof(AEP_mesh_shader)/sizeof(AEP_mesh_shader[0]); + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // _VERSIONS_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/attribute.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/attribute.cpp new file mode 100644 index 0000000000..a73370a6f0 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/attribute.cpp @@ -0,0 +1,378 @@ +// +// Copyright (C) 2017 LunarG, Inc. +// Copyright (C) 2018 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "attribute.h" +#include "../Include/intermediate.h" +#include "ParseHelper.h" + +namespace QtShaderTools { +namespace glslang { + +// extract integers out of attribute arguments stored in attribute aggregate +bool TAttributeArgs::getInt(int& value, int argNum) const +{ + const TConstUnion* intConst = getConstUnion(EbtInt, argNum); + + if (intConst == nullptr) + return false; + + value = intConst->getIConst(); + return true; +} + + +// extract strings out of attribute arguments stored in attribute aggregate. +// convert to lower case if converToLower is true (for case-insensitive compare convenience) +bool TAttributeArgs::getString(TString& value, int argNum, bool convertToLower) const +{ + const TConstUnion* stringConst = getConstUnion(EbtString, argNum); + + if (stringConst == nullptr) + return false; + + value = *stringConst->getSConst(); + + // Convenience. + if (convertToLower) + std::transform(value.begin(), value.end(), value.begin(), ::tolower); + + return true; +} + +// How many arguments were supplied? +int TAttributeArgs::size() const +{ + return args == nullptr ? 0 : (int)args->getSequence().size(); +} + +// Helper to get attribute const union. Returns nullptr on failure. +const TConstUnion* TAttributeArgs::getConstUnion(TBasicType basicType, int argNum) const +{ + if (args == nullptr) + return nullptr; + + if (argNum >= (int)args->getSequence().size()) + return nullptr; + + if (args->getSequence()[argNum]->getAsConstantUnion() == nullptr) + return nullptr; + + const TConstUnion* constVal = &args->getSequence()[argNum]->getAsConstantUnion()->getConstArray()[0]; + if (constVal == nullptr || constVal->getType() != basicType) + return nullptr; + + return constVal; +} + +// Implementation of TParseContext parts of attributes +TAttributeType TParseContext::attributeFromName(const TString& name) const +{ + if (name == "branch" || name == "dont_flatten") + return EatBranch; + else if (name == "flatten") + return EatFlatten; + else if (name == "unroll") + return EatUnroll; + else if (name == "loop" || name == "dont_unroll") + return EatLoop; + else if (name == "dependency_infinite") + return EatDependencyInfinite; + else if (name == "dependency_length") + return EatDependencyLength; + else if (name == "min_iterations") + return EatMinIterations; + else if (name == "max_iterations") + return EatMaxIterations; + else if (name == "iteration_multiple") + return EatIterationMultiple; + else if (name == "peel_count") + return EatPeelCount; + else if (name == "partial_count") + return EatPartialCount; + else if (name == "subgroup_uniform_control_flow") + return EatSubgroupUniformControlFlow; + else if (name == "export") + return EatExport; + else if (name == "maximally_reconverges") + return EatMaximallyReconverges; + else + return EatNone; +} + +// Make an initial leaf for the grammar from a no-argument attribute +TAttributes* TParseContext::makeAttributes(const TString& identifier) const +{ + TAttributes *attributes = nullptr; + attributes = NewPoolObject(attributes); + TAttributeArgs args = { attributeFromName(identifier), nullptr }; + attributes->push_back(args); + return attributes; +} + +// Make an initial leaf for the grammar from a one-argument attribute +TAttributes* TParseContext::makeAttributes(const TString& identifier, TIntermNode* node) const +{ + TAttributes *attributes = nullptr; + attributes = NewPoolObject(attributes); + + // for now, node is always a simple single expression, but other code expects + // a list, so make it so + TIntermAggregate* agg = intermediate.makeAggregate(node); + TAttributeArgs args = { attributeFromName(identifier), agg }; + attributes->push_back(args); + return attributes; +} + +// Merge two sets of attributes into a single set. +// The second argument is destructively consumed. +TAttributes* TParseContext::mergeAttributes(TAttributes* attr1, TAttributes* attr2) const +{ + attr1->splice(attr1->end(), *attr2); + return attr1; +} + +// +// Selection attributes +// +void TParseContext::handleSelectionAttributes(const TAttributes& attributes, TIntermNode* node) +{ + TIntermSelection* selection = node->getAsSelectionNode(); + if (selection == nullptr) + return; + + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + if (it->size() > 0) { + warn(node->getLoc(), "attribute with arguments not recognized, skipping", "", ""); + continue; + } + + switch (it->name) { + case EatFlatten: + selection->setFlatten(); + break; + case EatBranch: + selection->setDontFlatten(); + break; + default: + warn(node->getLoc(), "attribute does not apply to a selection", "", ""); + break; + } + } +} + +// +// Switch attributes +// +void TParseContext::handleSwitchAttributes(const TAttributes& attributes, TIntermNode* node) +{ + TIntermSwitch* selection = node->getAsSwitchNode(); + if (selection == nullptr) + return; + + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + if (it->size() > 0) { + warn(node->getLoc(), "attribute with arguments not recognized, skipping", "", ""); + continue; + } + + switch (it->name) { + case EatFlatten: + selection->setFlatten(); + break; + case EatBranch: + selection->setDontFlatten(); + break; + default: + warn(node->getLoc(), "attribute does not apply to a switch", "", ""); + break; + } + } +} + +// +// Loop attributes +// +void TParseContext::handleLoopAttributes(const TAttributes& attributes, TIntermNode* node) +{ + TIntermLoop* loop = node->getAsLoopNode(); + if (loop == nullptr) { + // the actual loop might be part of a sequence + TIntermAggregate* agg = node->getAsAggregate(); + if (agg == nullptr) + return; + for (auto it = agg->getSequence().begin(); it != agg->getSequence().end(); ++it) { + loop = (*it)->getAsLoopNode(); + if (loop != nullptr) + break; + } + if (loop == nullptr) + return; + } + + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + + const auto noArgument = [&](const char* feature) { + if (it->size() > 0) { + warn(node->getLoc(), "expected no arguments", feature, ""); + return false; + } + return true; + }; + + const auto positiveSignedArgument = [&](const char* feature, int& value) { + if (it->size() == 1 && it->getInt(value)) { + if (value <= 0) { + error(node->getLoc(), "must be positive", feature, ""); + return false; + } + } else { + warn(node->getLoc(), "expected a single integer argument", feature, ""); + return false; + } + return true; + }; + + const auto unsignedArgument = [&](const char* feature, unsigned int& uiValue) { + int value; + if (!(it->size() == 1 && it->getInt(value))) { + warn(node->getLoc(), "expected a single integer argument", feature, ""); + return false; + } + uiValue = (unsigned int)value; + return true; + }; + + const auto positiveUnsignedArgument = [&](const char* feature, unsigned int& uiValue) { + int value; + if (it->size() == 1 && it->getInt(value)) { + if (value == 0) { + error(node->getLoc(), "must be greater than or equal to 1", feature, ""); + return false; + } + } else { + warn(node->getLoc(), "expected a single integer argument", feature, ""); + return false; + } + uiValue = (unsigned int)value; + return true; + }; + + const auto spirv14 = [&](const char* feature) { + if (spvVersion.spv > 0 && spvVersion.spv < EShTargetSpv_1_4) + warn(node->getLoc(), "attribute requires a SPIR-V 1.4 target-env", feature, ""); + }; + + int value = 0; + unsigned uiValue = 0; + switch (it->name) { + case EatUnroll: + if (noArgument("unroll")) + loop->setUnroll(); + break; + case EatLoop: + if (noArgument("dont_unroll")) + loop->setDontUnroll(); + break; + case EatDependencyInfinite: + if (noArgument("dependency_infinite")) + loop->setLoopDependency(TIntermLoop::dependencyInfinite); + break; + case EatDependencyLength: + if (positiveSignedArgument("dependency_length", value)) + loop->setLoopDependency(value); + break; + case EatMinIterations: + spirv14("min_iterations"); + if (unsignedArgument("min_iterations", uiValue)) + loop->setMinIterations(uiValue); + break; + case EatMaxIterations: + spirv14("max_iterations"); + if (unsignedArgument("max_iterations", uiValue)) + loop->setMaxIterations(uiValue); + break; + case EatIterationMultiple: + spirv14("iteration_multiple"); + if (positiveUnsignedArgument("iteration_multiple", uiValue)) + loop->setIterationMultiple(uiValue); + break; + case EatPeelCount: + spirv14("peel_count"); + if (unsignedArgument("peel_count", uiValue)) + loop->setPeelCount(uiValue); + break; + case EatPartialCount: + spirv14("partial_count"); + if (unsignedArgument("partial_count", uiValue)) + loop->setPartialCount(uiValue); + break; + default: + warn(node->getLoc(), "attribute does not apply to a loop", "", ""); + break; + } + } +} + + +// +// Function attributes +// +void TParseContext::handleFunctionAttributes(const TSourceLoc& loc, const TAttributes& attributes) +{ + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + if (it->size() > 0) { + warn(loc, "attribute with arguments not recognized, skipping", "", ""); + continue; + } + + switch (it->name) { + case EatSubgroupUniformControlFlow: + requireExtensions(loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); + intermediate.setSubgroupUniformControlFlow(); + break; + case EatMaximallyReconverges: + requireExtensions(loc, 1, &E_GL_EXT_maximal_reconvergence, "attribute"); + intermediate.setMaximallyReconverges(); + break; + default: + warn(loc, "attribute does not apply to a function", "", ""); + break; + } + } +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/attribute.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/attribute.h new file mode 100644 index 0000000000..9bc8c43968 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/attribute.h @@ -0,0 +1,154 @@ +// +// Copyright (C) 2017 LunarG, Inc. +// Copyright (C) 2018 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef _ATTRIBUTE_INCLUDED_ +#define _ATTRIBUTE_INCLUDED_ + +#include "../Include/Common.h" +#include "../Include/ConstantUnion.h" + +namespace QtShaderTools { +namespace glslang { + + enum TAttributeType { + EatNone, + EatAllow_uav_condition, + EatBranch, + EatCall, + EatDomain, + EatEarlyDepthStencil, + EatFastOpt, + EatFlatten, + EatForceCase, + EatInstance, + EatMaxTessFactor, + EatNumThreads, + EatMaxVertexCount, + EatOutputControlPoints, + EatOutputTopology, + EatPartitioning, + EatPatchConstantFunc, + EatPatchSize, + EatUnroll, + EatLoop, + EatBinding, + EatGlobalBinding, + EatLocation, + EatInputAttachment, + EatBuiltIn, + EatPushConstant, + EatConstantId, + EatDependencyInfinite, + EatDependencyLength, + EatMinIterations, + EatMaxIterations, + EatIterationMultiple, + EatPeelCount, + EatPartialCount, + EatFormatRgba32f, + EatFormatRgba16f, + EatFormatR32f, + EatFormatRgba8, + EatFormatRgba8Snorm, + EatFormatRg32f, + EatFormatRg16f, + EatFormatR11fG11fB10f, + EatFormatR16f, + EatFormatRgba16, + EatFormatRgb10A2, + EatFormatRg16, + EatFormatRg8, + EatFormatR16, + EatFormatR8, + EatFormatRgba16Snorm, + EatFormatRg16Snorm, + EatFormatRg8Snorm, + EatFormatR16Snorm, + EatFormatR8Snorm, + EatFormatRgba32i, + EatFormatRgba16i, + EatFormatRgba8i, + EatFormatR32i, + EatFormatRg32i, + EatFormatRg16i, + EatFormatRg8i, + EatFormatR16i, + EatFormatR8i, + EatFormatRgba32ui, + EatFormatRgba16ui, + EatFormatRgba8ui, + EatFormatR32ui, + EatFormatRgb10a2ui, + EatFormatRg32ui, + EatFormatRg16ui, + EatFormatRg8ui, + EatFormatR16ui, + EatFormatR8ui, + EatFormatUnknown, + EatNonWritable, + EatNonReadable, + EatSubgroupUniformControlFlow, + EatExport, + EatMaximallyReconverges, + }; + + class TIntermAggregate; + + struct TAttributeArgs { + TAttributeType name; + const TIntermAggregate* args; + + // Obtain attribute as integer + // Return false if it cannot be obtained + bool getInt(int& value, int argNum = 0) const; + + // Obtain attribute as string, with optional to-lower transform + // Return false if it cannot be obtained + bool getString(TString& value, int argNum = 0, bool convertToLower = true) const; + + // How many arguments were provided to the attribute? + int size() const; + + protected: + const TConstUnion* getConstUnion(TBasicType basicType, int argNum) const; + }; + + typedef TList TAttributes; + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // _ATTRIBUTE_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/gl_types.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/gl_types.h new file mode 100644 index 0000000000..d6c939374a --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/gl_types.h @@ -0,0 +1,218 @@ +/* +** Copyright (c) 2013 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#pragma once + +#define GL_FLOAT 0x1406 +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 + +#define GL_DOUBLE 0x140A +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE + +#define GL_INT 0x1404 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 + +#define GL_UNSIGNED_INT 0x1405 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 + +#define GL_INT64_ARB 0x140E +#define GL_INT64_VEC2_ARB 0x8FE9 +#define GL_INT64_VEC3_ARB 0x8FEA +#define GL_INT64_VEC4_ARB 0x8FEB + +#define GL_UNSIGNED_INT64_ARB 0x140F +#define GL_UNSIGNED_INT64_VEC2_ARB 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_ARB 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_ARB 0x8FF7 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 + +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 + +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 + +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A + +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_MAT2x3 0x8F49 +#define GL_DOUBLE_MAT2x4 0x8F4A +#define GL_DOUBLE_MAT3x2 0x8F4B +#define GL_DOUBLE_MAT3x4 0x8F4C +#define GL_DOUBLE_MAT4x2 0x8F4D +#define GL_DOUBLE_MAT4x3 0x8F4E + +// Those constants are borrowed from extension NV_gpu_shader5 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB + +#define GL_FLOAT16_MAT2_AMD 0x91C5 +#define GL_FLOAT16_MAT3_AMD 0x91C6 +#define GL_FLOAT16_MAT4_AMD 0x91C7 +#define GL_FLOAT16_MAT2x3_AMD 0x91C8 +#define GL_FLOAT16_MAT2x4_AMD 0x91C9 +#define GL_FLOAT16_MAT3x2_AMD 0x91CA +#define GL_FLOAT16_MAT3x4_AMD 0x91CB +#define GL_FLOAT16_MAT4x2_AMD 0x91CC +#define GL_FLOAT16_MAT4x3_AMD 0x91CD + +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D + +#define GL_FLOAT16_SAMPLER_1D_AMD 0x91CE +#define GL_FLOAT16_SAMPLER_2D_AMD 0x91CF +#define GL_FLOAT16_SAMPLER_3D_AMD 0x91D0 +#define GL_FLOAT16_SAMPLER_CUBE_AMD 0x91D1 +#define GL_FLOAT16_SAMPLER_2D_RECT_AMD 0x91D2 +#define GL_FLOAT16_SAMPLER_1D_ARRAY_AMD 0x91D3 +#define GL_FLOAT16_SAMPLER_2D_ARRAY_AMD 0x91D4 +#define GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_AMD 0x91D5 +#define GL_FLOAT16_SAMPLER_BUFFER_AMD 0x91D6 +#define GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_AMD 0x91D7 +#define GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_ARRAY_AMD 0x91D8 + +#define GL_FLOAT16_SAMPLER_1D_SHADOW_AMD 0x91D9 +#define GL_FLOAT16_SAMPLER_2D_SHADOW_AMD 0x91DA +#define GL_FLOAT16_SAMPLER_2D_RECT_SHADOW_AMD 0x91DB +#define GL_FLOAT16_SAMPLER_1D_ARRAY_SHADOW_AMD 0x91DC +#define GL_FLOAT16_SAMPLER_2D_ARRAY_SHADOW_AMD 0x91DD +#define GL_FLOAT16_SAMPLER_CUBE_SHADOW_AMD 0x91DE +#define GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_SHADOW_AMD 0x91DF + +#define GL_FLOAT16_IMAGE_1D_AMD 0x91E0 +#define GL_FLOAT16_IMAGE_2D_AMD 0x91E1 +#define GL_FLOAT16_IMAGE_3D_AMD 0x91E2 +#define GL_FLOAT16_IMAGE_2D_RECT_AMD 0x91E3 +#define GL_FLOAT16_IMAGE_CUBE_AMD 0x91E4 +#define GL_FLOAT16_IMAGE_1D_ARRAY_AMD 0x91E5 +#define GL_FLOAT16_IMAGE_2D_ARRAY_AMD 0x91E6 +#define GL_FLOAT16_IMAGE_CUBE_MAP_ARRAY_AMD 0x91E7 +#define GL_FLOAT16_IMAGE_BUFFER_AMD 0x91E8 +#define GL_FLOAT16_IMAGE_2D_MULTISAMPLE_AMD 0x91E9 +#define GL_FLOAT16_IMAGE_2D_MULTISAMPLE_ARRAY_AMD 0x91EA + +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E + +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A + +#define GL_IMAGE_1D 0x904C +#define GL_IMAGE_2D 0x904D +#define GL_IMAGE_3D 0x904E +#define GL_IMAGE_2D_RECT 0x904F +#define GL_IMAGE_CUBE 0x9050 +#define GL_IMAGE_BUFFER 0x9051 +#define GL_IMAGE_1D_ARRAY 0x9052 +#define GL_IMAGE_2D_ARRAY 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 +#define GL_INT_IMAGE_1D 0x9057 +#define GL_INT_IMAGE_2D 0x9058 +#define GL_INT_IMAGE_3D 0x9059 +#define GL_INT_IMAGE_2D_RECT 0x905A +#define GL_INT_IMAGE_CUBE 0x905B +#define GL_INT_IMAGE_BUFFER 0x905C +#define GL_INT_IMAGE_1D_ARRAY 0x905D +#define GL_INT_IMAGE_2D_ARRAY 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C + +#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/glslang.y b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/glslang.y new file mode 100644 index 0000000000..9758048dfc --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/glslang.y @@ -0,0 +1,4583 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. +// Copyright (C) 2015-2019 Google, Inc. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +/** + * This is bison grammar and productions for parsing all versions of the + * GLSL shading languages. + */ +%{ + +/* Based on: +ANSI C Yacc grammar + +In 1985, Jeff Lee published his Yacc grammar (which is accompanied by a +matching Lex specification) for the April 30, 1985 draft version of the +ANSI C standard. Tom Stockfisch reposted it to net.sources in 1987; that +original, as mentioned in the answer to question 17.25 of the comp.lang.c +FAQ, can be ftp'ed from ftp.uu.net, file usenet/net.sources/ansi.c.grammar.Z. + +I intend to keep this version as close to the current C Standard grammar as +possible; please let me know if you discover discrepancies. + +Jutta Degener, 1995 +*/ + +#include "SymbolTable.h" +#include "ParseHelper.h" +#include "../Public/ShaderLang.h" +#include "attribute.h" + +using namespace glslang; + +%} + +%define parse.error verbose + +%union { + struct { + glslang::TSourceLoc loc; + union { + glslang::TString *string; + int i; + unsigned int u; + long long i64; + unsigned long long u64; + bool b; + double d; + }; + glslang::TSymbol* symbol; + } lex; + struct { + glslang::TSourceLoc loc; + glslang::TOperator op; + union { + TIntermNode* intermNode; + glslang::TIntermNodePair nodePair; + glslang::TIntermTyped* intermTypedNode; + glslang::TAttributes* attributes; + glslang::TSpirvRequirement* spirvReq; + glslang::TSpirvInstruction* spirvInst; + glslang::TSpirvTypeParameters* spirvTypeParams; + }; + union { + glslang::TPublicType type; + glslang::TFunction* function; + glslang::TParameter param; + glslang::TTypeLoc typeLine; + glslang::TTypeList* typeList; + glslang::TArraySizes* arraySizes; + glslang::TIdentifierList* identifierList; + }; + glslang::TTypeParameters* typeParameters; + } interm; +} + +%{ + +#define parseContext (*pParseContext) +#define yyerror(context, msg) context->parserError(msg) + +extern int yylex(YYSTYPE*, TParseContext&); + +%} + +%parse-param {glslang::TParseContext* pParseContext} +%lex-param {parseContext} +%pure-parser // enable thread safety +%expect 1 // One shift reduce conflict because of if | else + +%token CONST BOOL INT UINT FLOAT +%token BVEC2 BVEC3 BVEC4 +%token IVEC2 IVEC3 IVEC4 +%token UVEC2 UVEC3 UVEC4 +%token VEC2 VEC3 VEC4 +%token MAT2 MAT3 MAT4 +%token MAT2X2 MAT2X3 MAT2X4 +%token MAT3X2 MAT3X3 MAT3X4 +%token MAT4X2 MAT4X3 MAT4X4 + +// combined image/sampler +%token SAMPLER2D SAMPLER3D SAMPLERCUBE SAMPLER2DSHADOW +%token SAMPLERCUBESHADOW SAMPLER2DARRAY +%token SAMPLER2DARRAYSHADOW ISAMPLER2D ISAMPLER3D ISAMPLERCUBE +%token ISAMPLER2DARRAY USAMPLER2D USAMPLER3D +%token USAMPLERCUBE USAMPLER2DARRAY + +// separate image/sampler +%token SAMPLER SAMPLERSHADOW +%token TEXTURE2D TEXTURE3D TEXTURECUBE TEXTURE2DARRAY +%token ITEXTURE2D ITEXTURE3D ITEXTURECUBE ITEXTURE2DARRAY +%token UTEXTURE2D UTEXTURE3D UTEXTURECUBE UTEXTURE2DARRAY + +%token ATTRIBUTE VARYING +%token FLOATE5M2_T FLOATE4M3_T BFLOAT16_T FLOAT16_T FLOAT32_T DOUBLE FLOAT64_T +%token INT64_T UINT64_T INT32_T UINT32_T INT16_T UINT16_T INT8_T UINT8_T +%token I64VEC2 I64VEC3 I64VEC4 +%token U64VEC2 U64VEC3 U64VEC4 +%token I32VEC2 I32VEC3 I32VEC4 +%token U32VEC2 U32VEC3 U32VEC4 +%token I16VEC2 I16VEC3 I16VEC4 +%token U16VEC2 U16VEC3 U16VEC4 +%token I8VEC2 I8VEC3 I8VEC4 +%token U8VEC2 U8VEC3 U8VEC4 +%token DVEC2 DVEC3 DVEC4 DMAT2 DMAT3 DMAT4 +%token BF16VEC2 BF16VEC3 BF16VEC4 +%token FE5M2VEC2 FE5M2VEC3 FE5M2VEC4 +%token FE4M3VEC2 FE4M3VEC3 FE4M3VEC4 +%token F16VEC2 F16VEC3 F16VEC4 F16MAT2 F16MAT3 F16MAT4 +%token F32VEC2 F32VEC3 F32VEC4 F32MAT2 F32MAT3 F32MAT4 +%token F64VEC2 F64VEC3 F64VEC4 F64MAT2 F64MAT3 F64MAT4 +%token DMAT2X2 DMAT2X3 DMAT2X4 +%token DMAT3X2 DMAT3X3 DMAT3X4 +%token DMAT4X2 DMAT4X3 DMAT4X4 +%token F16MAT2X2 F16MAT2X3 F16MAT2X4 +%token F16MAT3X2 F16MAT3X3 F16MAT3X4 +%token F16MAT4X2 F16MAT4X3 F16MAT4X4 +%token F32MAT2X2 F32MAT2X3 F32MAT2X4 +%token F32MAT3X2 F32MAT3X3 F32MAT3X4 +%token F32MAT4X2 F32MAT4X3 F32MAT4X4 +%token F64MAT2X2 F64MAT2X3 F64MAT2X4 +%token F64MAT3X2 F64MAT3X3 F64MAT3X4 +%token F64MAT4X2 F64MAT4X3 F64MAT4X4 +%token ATOMIC_UINT +%token ACCSTRUCTNV +%token ACCSTRUCTEXT +%token RAYQUERYEXT +%token FCOOPMATNV ICOOPMATNV UCOOPMATNV +%token COOPMAT +%token COOPVECNV +%token HITOBJECTNV HITOBJECTATTRNV HITOBJECTEXT HITOBJECTATTREXT +%token TENSORLAYOUTNV TENSORVIEWNV +%token TENSORARM + +// combined image/sampler +%token SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW +%token ISAMPLERCUBEARRAY USAMPLERCUBEARRAY +%token SAMPLER1D SAMPLER1DARRAY SAMPLER1DARRAYSHADOW ISAMPLER1D SAMPLER1DSHADOW +%token SAMPLER2DRECT SAMPLER2DRECTSHADOW ISAMPLER2DRECT USAMPLER2DRECT +%token SAMPLERBUFFER ISAMPLERBUFFER USAMPLERBUFFER +%token SAMPLER2DMS ISAMPLER2DMS USAMPLER2DMS +%token SAMPLER2DMSARRAY ISAMPLER2DMSARRAY USAMPLER2DMSARRAY +%token SAMPLEREXTERNALOES +%token SAMPLEREXTERNAL2DY2YEXT +%token ISAMPLER1DARRAY USAMPLER1D USAMPLER1DARRAY +%token F16SAMPLER1D F16SAMPLER2D F16SAMPLER3D F16SAMPLER2DRECT F16SAMPLERCUBE +%token F16SAMPLER1DARRAY F16SAMPLER2DARRAY F16SAMPLERCUBEARRAY +%token F16SAMPLERBUFFER F16SAMPLER2DMS F16SAMPLER2DMSARRAY +%token F16SAMPLER1DSHADOW F16SAMPLER2DSHADOW F16SAMPLER1DARRAYSHADOW F16SAMPLER2DARRAYSHADOW +%token F16SAMPLER2DRECTSHADOW F16SAMPLERCUBESHADOW F16SAMPLERCUBEARRAYSHADOW + +// images +%token IMAGE1D IIMAGE1D UIMAGE1D IMAGE2D IIMAGE2D +%token UIMAGE2D IMAGE3D IIMAGE3D UIMAGE3D +%token IMAGE2DRECT IIMAGE2DRECT UIMAGE2DRECT +%token IMAGECUBE IIMAGECUBE UIMAGECUBE +%token IMAGEBUFFER IIMAGEBUFFER UIMAGEBUFFER +%token IMAGE1DARRAY IIMAGE1DARRAY UIMAGE1DARRAY +%token IMAGE2DARRAY IIMAGE2DARRAY UIMAGE2DARRAY +%token IMAGECUBEARRAY IIMAGECUBEARRAY UIMAGECUBEARRAY +%token IMAGE2DMS IIMAGE2DMS UIMAGE2DMS +%token IMAGE2DMSARRAY IIMAGE2DMSARRAY UIMAGE2DMSARRAY + +%token F16IMAGE1D F16IMAGE2D F16IMAGE3D F16IMAGE2DRECT +%token F16IMAGECUBE F16IMAGE1DARRAY F16IMAGE2DARRAY F16IMAGECUBEARRAY +%token F16IMAGEBUFFER F16IMAGE2DMS F16IMAGE2DMSARRAY + +%token I64IMAGE1D U64IMAGE1D +%token I64IMAGE2D U64IMAGE2D +%token I64IMAGE3D U64IMAGE3D +%token I64IMAGE2DRECT U64IMAGE2DRECT +%token I64IMAGECUBE U64IMAGECUBE +%token I64IMAGEBUFFER U64IMAGEBUFFER +%token I64IMAGE1DARRAY U64IMAGE1DARRAY +%token I64IMAGE2DARRAY U64IMAGE2DARRAY +%token I64IMAGECUBEARRAY U64IMAGECUBEARRAY +%token I64IMAGE2DMS U64IMAGE2DMS +%token I64IMAGE2DMSARRAY U64IMAGE2DMSARRAY + +// texture without sampler +%token TEXTURECUBEARRAY ITEXTURECUBEARRAY UTEXTURECUBEARRAY +%token TEXTURE1D ITEXTURE1D UTEXTURE1D +%token TEXTURE1DARRAY ITEXTURE1DARRAY UTEXTURE1DARRAY +%token TEXTURE2DRECT ITEXTURE2DRECT UTEXTURE2DRECT +%token TEXTUREBUFFER ITEXTUREBUFFER UTEXTUREBUFFER +%token TEXTURE2DMS ITEXTURE2DMS UTEXTURE2DMS +%token TEXTURE2DMSARRAY ITEXTURE2DMSARRAY UTEXTURE2DMSARRAY + +%token F16TEXTURE1D F16TEXTURE2D F16TEXTURE3D F16TEXTURE2DRECT F16TEXTURECUBE +%token F16TEXTURE1DARRAY F16TEXTURE2DARRAY F16TEXTURECUBEARRAY +%token F16TEXTUREBUFFER F16TEXTURE2DMS F16TEXTURE2DMSARRAY + +// input attachments +%token SUBPASSINPUT SUBPASSINPUTMS ISUBPASSINPUT ISUBPASSINPUTMS USUBPASSINPUT USUBPASSINPUTMS +%token F16SUBPASSINPUT F16SUBPASSINPUTMS + +// spirv intrinsics +%token SPIRV_INSTRUCTION SPIRV_EXECUTION_MODE SPIRV_EXECUTION_MODE_ID +%token SPIRV_DECORATE SPIRV_DECORATE_ID SPIRV_DECORATE_STRING +%token SPIRV_TYPE SPIRV_STORAGE_CLASS SPIRV_BY_REFERENCE SPIRV_LITERAL +%token ATTACHMENTEXT IATTACHMENTEXT UATTACHMENTEXT + +%token LEFT_OP RIGHT_OP +%token INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP +%token AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN +%token MOD_ASSIGN LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN XOR_ASSIGN OR_ASSIGN +%token SUB_ASSIGN +%token STRING_LITERAL + +%token LEFT_PAREN RIGHT_PAREN LEFT_BRACKET RIGHT_BRACKET LEFT_BRACE RIGHT_BRACE DOT +%token COMMA COLON EQUAL SEMICOLON BANG DASH TILDE PLUS STAR SLASH PERCENT +%token LEFT_ANGLE RIGHT_ANGLE VERTICAL_BAR CARET AMPERSAND QUESTION + +%token INVARIANT +%token HIGH_PRECISION MEDIUM_PRECISION LOW_PRECISION PRECISION +%token PACKED RESOURCE SUPERP + +%token FLOATCONSTANT INTCONSTANT UINTCONSTANT BOOLCONSTANT +%token IDENTIFIER TYPE_NAME +%token CENTROID IN OUT INOUT +%token STRUCT VOID WHILE +%token BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT +%token TERMINATE_INVOCATION +%token TERMINATE_RAY IGNORE_INTERSECTION +%token UNIFORM SHARED BUFFER TILEIMAGEEXT +%token FLAT SMOOTH LAYOUT + +%token DOUBLECONSTANT INT16CONSTANT UINT16CONSTANT FLOAT16CONSTANT INT32CONSTANT UINT32CONSTANT +%token INT64CONSTANT UINT64CONSTANT +%token SUBROUTINE DEMOTE FUNCTION +%token PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV +%token PAYLOADEXT PAYLOADINEXT HITATTREXT CALLDATAEXT CALLDATAINEXT +%token PATCH SAMPLE NONUNIFORM +%token COHERENT VOLATILE RESTRICT READONLY WRITEONLY NONTEMPORAL DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT +%token SUBGROUPCOHERENT NONPRIVATE SHADERCALLCOHERENT +%token NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXEXT PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV PERPRIMITIVEEXT TASKPAYLOADWORKGROUPEXT +%token PRECISE + +%type assignment_operator unary_operator +%type variable_identifier primary_expression postfix_expression +%type expression integer_expression assignment_expression +%type unary_expression multiplicative_expression additive_expression +%type relational_expression equality_expression +%type conditional_expression constant_expression +%type logical_or_expression logical_xor_expression logical_and_expression +%type shift_expression and_expression exclusive_or_expression inclusive_or_expression +%type function_call initializer +%type condition conditionopt + +%type translation_unit function_definition +%type statement simple_statement +%type statement_list switch_statement_list compound_statement +%type declaration_statement selection_statement selection_statement_nonattributed expression_statement +%type switch_statement switch_statement_nonattributed case_label +%type declaration external_declaration +%type for_init_statement compound_statement_no_new_scope +%type selection_rest_statement for_rest_statement +%type iteration_statement iteration_statement_nonattributed jump_statement statement_no_new_scope statement_scoped +%type single_declaration init_declarator_list + +%type parameter_declaration parameter_declarator parameter_type_specifier + +%type array_specifier +%type invariant_qualifier interpolation_qualifier storage_qualifier precision_qualifier +%type layout_qualifier layout_qualifier_id_list layout_qualifier_id + +%type type_parameter_specifier +%type type_parameter_specifier_opt +%type type_parameter_specifier_list + +%type type_qualifier fully_specified_type type_specifier +%type single_type_qualifier +%type type_specifier_nonarray +%type struct_specifier +%type struct_declarator +%type struct_declarator_list struct_declaration struct_declaration_list +%type block_structure +%type function_header function_declarator +%type function_header_with_parameters +%type function_call_header_with_parameters function_call_header_no_parameters function_call_generic function_prototype +%type function_call_or_method function_identifier function_call_header + +%type identifier_list + +%type precise_qualifier non_uniform_qualifier +%type type_name_list +%type attribute attribute_list single_attribute +%type demote_statement +%type initializer_list +%type spirv_requirements_list spirv_requirements_parameter +%type spirv_extension_list spirv_capability_list +%type spirv_execution_mode_qualifier +%type spirv_execution_mode_parameter_list spirv_execution_mode_parameter spirv_execution_mode_id_parameter_list +%type spirv_storage_class_qualifier +%type spirv_decorate_qualifier +%type spirv_decorate_parameter_list spirv_decorate_parameter +%type spirv_decorate_id_parameter_list spirv_decorate_id_parameter +%type spirv_decorate_string_parameter_list +%type spirv_type_specifier +%type spirv_type_parameter_list spirv_type_parameter +%type spirv_instruction_qualifier +%type spirv_instruction_qualifier_list spirv_instruction_qualifier_id + +%start translation_unit +%% + +variable_identifier + : IDENTIFIER { + $$ = parseContext.handleVariable($1.loc, $1.symbol, $1.string); + } + ; + +primary_expression + : variable_identifier { + $$ = $1; + } + | LEFT_PAREN expression RIGHT_PAREN { + $$ = $2; + if ($$->getAsConstantUnion()) + $$->getAsConstantUnion()->setExpression(); + } + | FLOATCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true); + } + | INTCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true); + } + | UINTCONSTANT { + parseContext.fullIntegerCheck($1.loc, "unsigned literal"); + $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true); + } + | BOOLCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true); + } + | STRING_LITERAL { + $$ = parseContext.intermediate.addConstantUnion($1.string, $1.loc, true); + } + | INT32CONSTANT { + parseContext.explicitInt32Check($1.loc, "32-bit signed literal"); + $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true); + } + | UINT32CONSTANT { + parseContext.explicitInt32Check($1.loc, "32-bit signed literal"); + $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true); + } + | INT64CONSTANT { + parseContext.int64Check($1.loc, "64-bit integer literal"); + $$ = parseContext.intermediate.addConstantUnion($1.i64, $1.loc, true); + } + | UINT64CONSTANT { + parseContext.int64Check($1.loc, "64-bit unsigned integer literal"); + $$ = parseContext.intermediate.addConstantUnion($1.u64, $1.loc, true); + } + | INT16CONSTANT { + parseContext.explicitInt16Check($1.loc, "16-bit integer literal"); + $$ = parseContext.intermediate.addConstantUnion((short)$1.i, $1.loc, true); + } + | UINT16CONSTANT { + parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer literal"); + $$ = parseContext.intermediate.addConstantUnion((unsigned short)$1.u, $1.loc, true); + } + | DOUBLECONSTANT { + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double literal"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double literal"); + $$ = parseContext.intermediate.addConstantUnion($1.d, EbtDouble, $1.loc, true); + } + | FLOAT16CONSTANT { + parseContext.float16Check($1.loc, "half float literal"); + $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat16, $1.loc, true); + } + ; + +postfix_expression + : primary_expression { + $$ = $1; + } + | postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET { + $$ = parseContext.handleBracketDereference($2.loc, $1, $3); + } + | function_call { + $$ = $1; + } + | postfix_expression DOT IDENTIFIER { + $$ = parseContext.handleDotDereference($3.loc, $1, *$3.string); + } + | postfix_expression INC_OP { + parseContext.variableCheck($1); + parseContext.lValueErrorCheck($2.loc, "++", $1); + $$ = parseContext.handleUnaryMath($2.loc, "++", EOpPostIncrement, $1); + } + | postfix_expression DEC_OP { + parseContext.variableCheck($1); + parseContext.lValueErrorCheck($2.loc, "--", $1); + $$ = parseContext.handleUnaryMath($2.loc, "--", EOpPostDecrement, $1); + } + ; + +integer_expression + : expression { + parseContext.arrayIndexCheck($1, "[]"); + $$ = $1; + } + ; + +function_call + : function_call_or_method { + $$ = parseContext.handleFunctionCall($1.loc, $1.function, $1.intermNode); + delete $1.function; + } + ; + +function_call_or_method + : function_call_generic { + $$ = $1; + } + ; + +function_call_generic + : function_call_header_with_parameters RIGHT_PAREN { + $$ = $1; + $$.loc = $2.loc; + } + | function_call_header_no_parameters RIGHT_PAREN { + $$ = $1; + $$.loc = $2.loc; + } + ; + +function_call_header_no_parameters + : function_call_header VOID { + $$ = $1; + } + | function_call_header { + $$ = $1; + } + ; + +function_call_header_with_parameters + : function_call_header assignment_expression { + if (parseContext.spvVersion.vulkan > 0 + && parseContext.spvVersion.vulkanRelaxed + && $2->getType().containsOpaque()) + { + $$.intermNode = parseContext.vkRelaxedRemapFunctionArgument($$.loc, $1.function, $2); + $$.function = $1.function; + } + else + { + TParameter param = { 0, new TType, {} }; + param.type->shallowCopy($2->getType()); + + $1.function->addParameter(param); + $$.function = $1.function; + $$.intermNode = $2; + } + } + | function_call_header_with_parameters COMMA assignment_expression { + if (parseContext.spvVersion.vulkan > 0 + && parseContext.spvVersion.vulkanRelaxed + && $3->getType().containsOpaque()) + { + TIntermNode* remappedNode = parseContext.vkRelaxedRemapFunctionArgument($2.loc, $1.function, $3); + if (remappedNode == $3) + $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, $3, $2.loc); + else + $$.intermNode = parseContext.intermediate.mergeAggregate($1.intermNode, remappedNode, $2.loc); + $$.function = $1.function; + } + else + { + TParameter param = { 0, new TType, {} }; + param.type->shallowCopy($3->getType()); + + $1.function->addParameter(param); + $$.function = $1.function; + $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, $3, $2.loc); + } + } + ; + +function_call_header + : function_identifier LEFT_PAREN { + $$ = $1; + } + ; + +// Grammar Note: Constructors look like functions, but are recognized as types. + +function_identifier + : type_specifier { + // Constructor + $$.intermNode = 0; + $$.function = parseContext.handleConstructorCall($1.loc, $1); + } + | postfix_expression { + // + // Should be a method or subroutine call, but we haven't recognized the arguments yet. + // + $$.function = 0; + $$.intermNode = 0; + + TIntermMethod* method = $1->getAsMethodNode(); + if (method) { + $$.function = new TFunction(&method->getMethodName(), method->getType(), EOpArrayLength); + $$.intermNode = method->getObject(); + } else { + TIntermSymbol* symbol = $1->getAsSymbolNode(); + if (symbol) { + parseContext.reservedErrorCheck(symbol->getLoc(), symbol->getName()); + TFunction *function = new TFunction(&symbol->getName(), TType(EbtVoid)); + $$.function = function; + } else + parseContext.error($1->getLoc(), "function call, method, or subroutine call expected", "", ""); + } + + if ($$.function == 0) { + // error recover + TString* empty = NewPoolTString(""); + $$.function = new TFunction(empty, TType(EbtVoid), EOpNull); + } + } + | non_uniform_qualifier { + // Constructor + $$.intermNode = 0; + $$.function = parseContext.handleConstructorCall($1.loc, $1); + } + ; + +unary_expression + : postfix_expression { + parseContext.variableCheck($1); + $$ = $1; + if (TIntermMethod* method = $1->getAsMethodNode()) + parseContext.error($1->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), ""); + } + | INC_OP unary_expression { + parseContext.lValueErrorCheck($1.loc, "++", $2); + $$ = parseContext.handleUnaryMath($1.loc, "++", EOpPreIncrement, $2); + } + | DEC_OP unary_expression { + parseContext.lValueErrorCheck($1.loc, "--", $2); + $$ = parseContext.handleUnaryMath($1.loc, "--", EOpPreDecrement, $2); + } + | unary_operator unary_expression { + if ($1.op != EOpNull) { + char errorOp[2] = {0, 0}; + switch($1.op) { + case EOpNegative: errorOp[0] = '-'; break; + case EOpLogicalNot: errorOp[0] = '!'; break; + case EOpBitwiseNot: errorOp[0] = '~'; break; + default: break; // some compilers want this + } + $$ = parseContext.handleUnaryMath($1.loc, errorOp, $1.op, $2); + } else { + $$ = $2; + if ($$->getAsConstantUnion()) + $$->getAsConstantUnion()->setExpression(); + } + } + ; +// Grammar Note: No traditional style type casts. + +unary_operator + : PLUS { $$.loc = $1.loc; $$.op = EOpNull; } + | DASH { $$.loc = $1.loc; $$.op = EOpNegative; } + | BANG { $$.loc = $1.loc; $$.op = EOpLogicalNot; } + | TILDE { $$.loc = $1.loc; $$.op = EOpBitwiseNot; + parseContext.fullIntegerCheck($1.loc, "bitwise not"); } + ; +// Grammar Note: No '*' or '&' unary ops. Pointers are not supported. + +multiplicative_expression + : unary_expression { $$ = $1; } + | multiplicative_expression STAR unary_expression { + $$ = parseContext.handleBinaryMath($2.loc, "*", EOpMul, $1, $3); + if ($$ == 0) + $$ = $1; + } + | multiplicative_expression SLASH unary_expression { + $$ = parseContext.handleBinaryMath($2.loc, "/", EOpDiv, $1, $3); + if ($$ == 0) + $$ = $1; + } + | multiplicative_expression PERCENT unary_expression { + parseContext.fullIntegerCheck($2.loc, "%"); + $$ = parseContext.handleBinaryMath($2.loc, "%", EOpMod, $1, $3); + if ($$ == 0) + $$ = $1; + } + ; + +additive_expression + : multiplicative_expression { $$ = $1; } + | additive_expression PLUS multiplicative_expression { + $$ = parseContext.handleBinaryMath($2.loc, "+", EOpAdd, $1, $3); + if ($$ == 0) + $$ = $1; + } + | additive_expression DASH multiplicative_expression { + $$ = parseContext.handleBinaryMath($2.loc, "-", EOpSub, $1, $3); + if ($$ == 0) + $$ = $1; + } + ; + +shift_expression + : additive_expression { $$ = $1; } + | shift_expression LEFT_OP additive_expression { + parseContext.fullIntegerCheck($2.loc, "bit shift left"); + $$ = parseContext.handleBinaryMath($2.loc, "<<", EOpLeftShift, $1, $3); + if ($$ == 0) + $$ = $1; + } + | shift_expression RIGHT_OP additive_expression { + parseContext.fullIntegerCheck($2.loc, "bit shift right"); + $$ = parseContext.handleBinaryMath($2.loc, ">>", EOpRightShift, $1, $3); + if ($$ == 0) + $$ = $1; + } + ; + +relational_expression + : shift_expression { $$ = $1; } + | relational_expression LEFT_ANGLE shift_expression { + $$ = parseContext.handleBinaryMath($2.loc, "<", EOpLessThan, $1, $3); + if ($$ == 0) + $$ = parseContext.intermediate.addConstantUnion(false, $2.loc); + } + | relational_expression RIGHT_ANGLE shift_expression { + $$ = parseContext.handleBinaryMath($2.loc, ">", EOpGreaterThan, $1, $3); + if ($$ == 0) + $$ = parseContext.intermediate.addConstantUnion(false, $2.loc); + } + | relational_expression LE_OP shift_expression { + $$ = parseContext.handleBinaryMath($2.loc, "<=", EOpLessThanEqual, $1, $3); + if ($$ == 0) + $$ = parseContext.intermediate.addConstantUnion(false, $2.loc); + } + | relational_expression GE_OP shift_expression { + $$ = parseContext.handleBinaryMath($2.loc, ">=", EOpGreaterThanEqual, $1, $3); + if ($$ == 0) + $$ = parseContext.intermediate.addConstantUnion(false, $2.loc); + } + ; + +equality_expression + : relational_expression { $$ = $1; } + | equality_expression EQ_OP relational_expression { + parseContext.arrayObjectCheck($2.loc, $1->getType(), "array comparison"); + parseContext.opaqueCheck($2.loc, $1->getType(), "=="); + parseContext.specializationCheck($2.loc, $1->getType(), "=="); + parseContext.referenceCheck($2.loc, $1->getType(), "=="); + $$ = parseContext.handleBinaryMath($2.loc, "==", EOpEqual, $1, $3); + if ($$ == 0) + $$ = parseContext.intermediate.addConstantUnion(false, $2.loc); + } + | equality_expression NE_OP relational_expression { + parseContext.arrayObjectCheck($2.loc, $1->getType(), "array comparison"); + parseContext.opaqueCheck($2.loc, $1->getType(), "!="); + parseContext.specializationCheck($2.loc, $1->getType(), "!="); + parseContext.referenceCheck($2.loc, $1->getType(), "!="); + $$ = parseContext.handleBinaryMath($2.loc, "!=", EOpNotEqual, $1, $3); + if ($$ == 0) + $$ = parseContext.intermediate.addConstantUnion(false, $2.loc); + } + ; + +and_expression + : equality_expression { $$ = $1; } + | and_expression AMPERSAND equality_expression { + parseContext.fullIntegerCheck($2.loc, "bitwise and"); + $$ = parseContext.handleBinaryMath($2.loc, "&", EOpAnd, $1, $3); + if ($$ == 0) + $$ = $1; + } + ; + +exclusive_or_expression + : and_expression { $$ = $1; } + | exclusive_or_expression CARET and_expression { + parseContext.fullIntegerCheck($2.loc, "bitwise exclusive or"); + $$ = parseContext.handleBinaryMath($2.loc, "^", EOpExclusiveOr, $1, $3); + if ($$ == 0) + $$ = $1; + } + ; + +inclusive_or_expression + : exclusive_or_expression { $$ = $1; } + | inclusive_or_expression VERTICAL_BAR exclusive_or_expression { + parseContext.fullIntegerCheck($2.loc, "bitwise inclusive or"); + $$ = parseContext.handleBinaryMath($2.loc, "|", EOpInclusiveOr, $1, $3); + if ($$ == 0) + $$ = $1; + } + ; + +logical_and_expression + : inclusive_or_expression { $$ = $1; } + | logical_and_expression AND_OP inclusive_or_expression { + $$ = parseContext.handleBinaryMath($2.loc, "&&", EOpLogicalAnd, $1, $3); + if ($$ == 0) + $$ = parseContext.intermediate.addConstantUnion(false, $2.loc); + } + ; + +logical_xor_expression + : logical_and_expression { $$ = $1; } + | logical_xor_expression XOR_OP logical_and_expression { + $$ = parseContext.handleBinaryMath($2.loc, "^^", EOpLogicalXor, $1, $3); + if ($$ == 0) + $$ = parseContext.intermediate.addConstantUnion(false, $2.loc); + } + ; + +logical_or_expression + : logical_xor_expression { $$ = $1; } + | logical_or_expression OR_OP logical_xor_expression { + $$ = parseContext.handleBinaryMath($2.loc, "||", EOpLogicalOr, $1, $3); + if ($$ == 0) + $$ = parseContext.intermediate.addConstantUnion(false, $2.loc); + } + ; + +conditional_expression + : logical_or_expression { $$ = $1; } + | logical_or_expression QUESTION { + ++parseContext.controlFlowNestingLevel; + } + expression COLON assignment_expression { + --parseContext.controlFlowNestingLevel; + parseContext.boolCheck($2.loc, $1); + parseContext.rValueErrorCheck($2.loc, "?", $1); + parseContext.rValueErrorCheck($5.loc, ":", $4); + parseContext.rValueErrorCheck($5.loc, ":", $6); + $$ = parseContext.intermediate.addSelection($1, $4, $6, $2.loc); + if ($$ == 0) { + parseContext.binaryOpError($2.loc, ":", $4->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), $6->getCompleteString(parseContext.intermediate.getEnhancedMsgs())); + $$ = $6; + } + } + ; + +assignment_expression + : conditional_expression { $$ = $1; } + | unary_expression assignment_operator assignment_expression { + parseContext.arrayObjectCheck($2.loc, $1->getType(), "array assignment"); + parseContext.opaqueCheck($2.loc, $1->getType(), "="); + parseContext.storage16BitAssignmentCheck($2.loc, $1->getType(), "="); + parseContext.specializationCheck($2.loc, $1->getType(), "="); + parseContext.lValueErrorCheck($2.loc, "assign", $1); + parseContext.rValueErrorCheck($2.loc, "assign", $3); + $$ = parseContext.addAssign($2.loc, $2.op, $1, $3); + if ($$ == 0) { + parseContext.assignError($2.loc, "assign", $1->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), $3->getCompleteString(parseContext.intermediate.getEnhancedMsgs())); + $$ = $1; + } + } + ; + +assignment_operator + : EQUAL { + $$.loc = $1.loc; + $$.op = EOpAssign; + } + | MUL_ASSIGN { + $$.loc = $1.loc; + $$.op = EOpMulAssign; + } + | DIV_ASSIGN { + $$.loc = $1.loc; + $$.op = EOpDivAssign; + } + | MOD_ASSIGN { + parseContext.fullIntegerCheck($1.loc, "%="); + $$.loc = $1.loc; + $$.op = EOpModAssign; + } + | ADD_ASSIGN { + $$.loc = $1.loc; + $$.op = EOpAddAssign; + } + | SUB_ASSIGN { + $$.loc = $1.loc; + $$.op = EOpSubAssign; + } + | LEFT_ASSIGN { + parseContext.fullIntegerCheck($1.loc, "bit-shift left assign"); + $$.loc = $1.loc; $$.op = EOpLeftShiftAssign; + } + | RIGHT_ASSIGN { + parseContext.fullIntegerCheck($1.loc, "bit-shift right assign"); + $$.loc = $1.loc; $$.op = EOpRightShiftAssign; + } + | AND_ASSIGN { + parseContext.fullIntegerCheck($1.loc, "bitwise-and assign"); + $$.loc = $1.loc; $$.op = EOpAndAssign; + } + | XOR_ASSIGN { + parseContext.fullIntegerCheck($1.loc, "bitwise-xor assign"); + $$.loc = $1.loc; $$.op = EOpExclusiveOrAssign; + } + | OR_ASSIGN { + parseContext.fullIntegerCheck($1.loc, "bitwise-or assign"); + $$.loc = $1.loc; $$.op = EOpInclusiveOrAssign; + } + ; + +expression + : assignment_expression { + $$ = $1; + } + | expression COMMA assignment_expression { + parseContext.samplerConstructorLocationCheck($2.loc, ",", $3); + $$ = parseContext.intermediate.addComma($1, $3, $2.loc); + if ($$ == 0) { + parseContext.binaryOpError($2.loc, ",", $1->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), $3->getCompleteString(parseContext.intermediate.getEnhancedMsgs())); + $$ = $3; + } + } + ; + +constant_expression + : conditional_expression { + parseContext.constantValueCheck($1, ""); + $$ = $1; + } + ; + +declaration + : function_prototype SEMICOLON { + parseContext.handleFunctionDeclarator($1.loc, *$1.function, true /* prototype */); + $$ = 0; + // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature + } + | spirv_instruction_qualifier function_prototype SEMICOLON { + parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V instruction qualifier"); + $2.function->setSpirvInstruction(*$1); // Attach SPIR-V intruction qualifier + parseContext.handleFunctionDeclarator($2.loc, *$2.function, true /* prototype */); + $$ = 0; + // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature + } + | spirv_execution_mode_qualifier SEMICOLON { + parseContext.globalCheck($2.loc, "SPIR-V execution mode qualifier"); + parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V execution mode qualifier"); + $$ = 0; + } + | init_declarator_list SEMICOLON { + if ($1.intermNode && $1.intermNode->getAsAggregate()) + $1.intermNode->getAsAggregate()->setOperator(EOpSequence); + $$ = $1.intermNode; + } + | PRECISION precision_qualifier type_specifier SEMICOLON { + parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "precision statement"); + // lazy setting of the previous scope's defaults, has effect only the first time it is called in a particular scope + parseContext.symbolTable.setPreviousDefaultPrecisions(&parseContext.defaultPrecision[0]); + parseContext.setDefaultPrecision($1.loc, $3, $2.qualifier.precision); + $$ = 0; + } + | block_structure SEMICOLON { + $$ = parseContext.declareBlock($1.loc, *$1.typeList); + } + | block_structure IDENTIFIER SEMICOLON { + $$ = parseContext.declareBlock($1.loc, *$1.typeList, $2.string); + } + | block_structure IDENTIFIER array_specifier SEMICOLON { + $$ = parseContext.declareBlock($1.loc, *$1.typeList, $2.string, $3.arraySizes); + } + | type_qualifier SEMICOLON { + parseContext.globalQualifierFixCheck($1.loc, $1.qualifier); + parseContext.updateStandaloneQualifierDefaults($1.loc, $1); + $$ = 0; + } + | type_qualifier identifier_list SEMICOLON { + parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers); + parseContext.addQualifierToExisting($1.loc, $1.qualifier, *$2); + $$ = 0; + } + ; + +block_structure + : type_qualifier IDENTIFIER LEFT_BRACE { parseContext.nestedBlockCheck($1.loc); } struct_declaration_list RIGHT_BRACE { + --parseContext.blockNestingLevel; + parseContext.blockName = $2.string; + parseContext.globalQualifierFixCheck($1.loc, $1.qualifier); + parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers); + parseContext.currentBlockQualifier = $1.qualifier; + $$.loc = $1.loc; + $$.typeList = $5; + } + +identifier_list + : IDENTIFIER { + $$ = new TIdentifierList; + $$->push_back($1.string); + } + | identifier_list COMMA IDENTIFIER { + $$ = $1; + $$->push_back($3.string); + } + ; + +function_prototype + : function_declarator RIGHT_PAREN { + $$.function = $1; + if (parseContext.compileOnly) $$.function->setExport(); + $$.loc = $2.loc; + } + | function_declarator RIGHT_PAREN attribute { + $$.function = $1; + if (parseContext.compileOnly) $$.function->setExport(); + $$.loc = $2.loc; + const char * extensions[2] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence }; + parseContext.requireExtensions($2.loc, 2, extensions, "attribute"); + parseContext.handleFunctionAttributes($2.loc, *$3); + } + | attribute function_declarator RIGHT_PAREN { + $$.function = $2; + if (parseContext.compileOnly) $$.function->setExport(); + $$.loc = $3.loc; + const char * extensions[2] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence }; + parseContext.requireExtensions($3.loc, 2, extensions, "attribute"); + parseContext.handleFunctionAttributes($3.loc, *$1); + } + | attribute function_declarator RIGHT_PAREN attribute { + $$.function = $2; + if (parseContext.compileOnly) $$.function->setExport(); + $$.loc = $3.loc; + const char * extensions[2] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence }; + parseContext.requireExtensions($3.loc, 2, extensions, "attribute"); + parseContext.handleFunctionAttributes($3.loc, *$1); + parseContext.handleFunctionAttributes($3.loc, *$4); + } + ; + +function_declarator + : function_header { + $$ = $1; + } + | function_header_with_parameters { + $$ = $1; + } + ; + + +function_header_with_parameters + : function_header parameter_declaration { + // Add the parameter + $$ = $1; + if ($2.param.type->getBasicType() != EbtVoid) + { + if (!(parseContext.spvVersion.vulkan > 0 && parseContext.spvVersion.vulkanRelaxed)) + $1->addParameter($2.param); + else + parseContext.vkRelaxedRemapFunctionParameter($1, $2.param); + } + else + delete $2.param.type; + } + | function_header_with_parameters COMMA parameter_declaration { + // + // Only first parameter of one-parameter functions can be void + // The check for named parameters not being void is done in parameter_declarator + // + if ($3.param.type->getBasicType() == EbtVoid) { + // + // This parameter > first is void + // + parseContext.error($2.loc, "cannot be an argument type except for '(void)'", "void", ""); + delete $3.param.type; + } else { + // Add the parameter + $$ = $1; + if (!(parseContext.spvVersion.vulkan > 0 && parseContext.spvVersion.vulkanRelaxed)) + $1->addParameter($3.param); + else + parseContext.vkRelaxedRemapFunctionParameter($1, $3.param); + } + } + | function_header_with_parameters COMMA DOT DOT DOT { + $$ = $1; + parseContext.makeVariadic($1, $3.loc); + } + ; + +function_header + : fully_specified_type IDENTIFIER LEFT_PAREN { + if ($1.qualifier.storage != EvqGlobal && $1.qualifier.storage != EvqTemporary) { + parseContext.error($2.loc, "no qualifiers allowed for function return", + GetStorageQualifierString($1.qualifier.storage), ""); + } + if ($1.arraySizes) + parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes); + + // Add the function as a prototype after parsing it (we do not support recursion) + TFunction *function; + TType type($1); + + // Potentially rename shader entry point function. No-op most of the time. + parseContext.renameShaderFunction($2.string); + + // Make the function + function = new TFunction($2.string, type); + $$ = function; + } + ; + +parameter_declarator + // Type + name + : type_specifier IDENTIFIER { + if ($1.arraySizes) { + parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type"); + parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes); + } + if ($1.basicType == EbtVoid) { + parseContext.error($2.loc, "illegal use of type 'void'", $2.string->c_str(), ""); + } + parseContext.reservedErrorCheck($2.loc, *$2.string); + + TParameter param = {$2.string, new TType($1), {}}; + $$.loc = $2.loc; + $$.param = param; + } + | type_specifier IDENTIFIER array_specifier { + if ($1.arraySizes) { + parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type"); + parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes); + } + TType* type = new TType($1); + type->transferArraySizes($3.arraySizes); + type->copyArrayInnerSizes($1.arraySizes); + + parseContext.arrayOfArrayVersionCheck($2.loc, type->getArraySizes()); + parseContext.arraySizeRequiredCheck($3.loc, *$3.arraySizes); + parseContext.reservedErrorCheck($2.loc, *$2.string); + + TParameter param = { $2.string, type, {} }; + + $$.loc = $2.loc; + $$.param = param; + } + | type_specifier IDENTIFIER EQUAL initializer { + TParameter param = parseContext.getParamWithDefault($1, $2.string, $4, $3.loc); + $$.loc = $2.loc; + $$.param = param; + } + ; + +parameter_declaration + // + // With name + // + : type_qualifier parameter_declarator { + $$ = $2; + if ($1.qualifier.precision != EpqNone) + $$.param.type->getQualifier().precision = $1.qualifier.precision; + parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->hasTypeParameter()); + + parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers); + parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type); + parseContext.paramCheckFix($1.loc, $1.qualifier, *$$.param.type); + + } + | parameter_declarator { + $$ = $1; + + parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type); + parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type); + parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->hasTypeParameter()); + } + // + // Without name + // + | type_qualifier parameter_type_specifier { + $$ = $2; + if ($1.qualifier.precision != EpqNone) + $$.param.type->getQualifier().precision = $1.qualifier.precision; + parseContext.precisionQualifierCheck($1.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->hasTypeParameter()); + + parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers); + parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type); + parseContext.paramCheckFix($1.loc, $1.qualifier, *$$.param.type); + } + | parameter_type_specifier { + $$ = $1; + + parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type); + parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type); + parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->hasTypeParameter()); + } + ; + +parameter_type_specifier + : type_specifier { + TParameter param = { 0, new TType($1), {} }; + $$.param = param; + if ($1.arraySizes) + parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes); + } + ; + +init_declarator_list + : single_declaration { + $$ = $1; + } + | init_declarator_list COMMA IDENTIFIER { + $$ = $1; + TIntermNode* declNode = parseContext.declareVariable($3.loc, *$3.string, $1.type); + $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, declNode, $3.loc); + } + | init_declarator_list COMMA IDENTIFIER array_specifier { + $$ = $1; + TIntermNode* declNode = parseContext.declareVariable($3.loc, *$3.string, $1.type, $4.arraySizes); + $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, declNode, $3.loc); + } + | init_declarator_list COMMA IDENTIFIER array_specifier EQUAL initializer { + $$.type = $1.type; + TIntermNode* declNode = parseContext.declareVariable($3.loc, *$3.string, $1.type, $4.arraySizes, $6); + $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, declNode, $5.loc); + } + | init_declarator_list COMMA IDENTIFIER EQUAL initializer { + $$.type = $1.type; + TIntermNode* declNode = parseContext.declareVariable($3.loc, *$3.string, $1.type, 0, $5); + $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, declNode, $4.loc); + } + ; + +single_declaration + : fully_specified_type { + $$.type = $1; + $$.intermNode = 0; + parseContext.declareTypeDefaults($$.loc, $$.type); + } + | fully_specified_type IDENTIFIER { + $$.type = $1; + TIntermNode* declNode = parseContext.declareVariable($2.loc, *$2.string, $1); + $$.intermNode = parseContext.intermediate.growAggregate(nullptr, declNode, $2.loc); + + } + | fully_specified_type IDENTIFIER array_specifier { + $$.type = $1; + TIntermNode* declNode = parseContext.declareVariable($2.loc, *$2.string, $1, $3.arraySizes); + $$.intermNode = parseContext.intermediate.growAggregate(nullptr, declNode, $2.loc); + } + | fully_specified_type IDENTIFIER array_specifier EQUAL initializer { + $$.type = $1; + TIntermNode* declNode = parseContext.declareVariable($2.loc, *$2.string, $1, $3.arraySizes, $5); + $$.intermNode = parseContext.intermediate.growAggregate(nullptr, declNode, $2.loc); + } + | fully_specified_type IDENTIFIER EQUAL initializer { + $$.type = $1; + TIntermNode* declNode = parseContext.declareVariable($2.loc, *$2.string, $1, 0, $4); + $$.intermNode = parseContext.intermediate.growAggregate(nullptr, declNode, $2.loc); + } + +// Grammar Note: No 'enum', or 'typedef'. + +fully_specified_type + : type_specifier { + $$ = $1; + + parseContext.globalQualifierTypeCheck($1.loc, $1.qualifier, $$); + if ($1.arraySizes) { + parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type"); + } + parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier, $$.hasTypeParameter()); + } + | type_qualifier type_specifier { + parseContext.globalQualifierFixCheck($1.loc, $1.qualifier, false, &$2); + parseContext.globalQualifierTypeCheck($1.loc, $1.qualifier, $2); + + if ($2.arraySizes) { + parseContext.profileRequires($2.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires($2.loc, EEsProfile, 300, 0, "arrayed type"); + } + + if ($2.arraySizes && parseContext.arrayQualifierError($2.loc, $1.qualifier)) + $2.arraySizes = nullptr; + + parseContext.checkNoShaderLayouts($2.loc, $1.shaderQualifiers); + $2.shaderQualifiers.merge($1.shaderQualifiers); + parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true); + parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier, $2.hasTypeParameter()); + + $$ = $2; + + if (! $$.qualifier.isInterpolation() && + ((parseContext.language == EShLangVertex && $$.qualifier.storage == EvqVaryingOut) || + (parseContext.language == EShLangFragment && $$.qualifier.storage == EvqVaryingIn))) + $$.qualifier.smooth = true; + } + ; + +invariant_qualifier + : INVARIANT { + parseContext.globalCheck($1.loc, "invariant"); + parseContext.profileRequires($$.loc, ENoProfile, 120, 0, "invariant"); + $$.init($1.loc); + $$.qualifier.invariant = true; + } + ; + +interpolation_qualifier + : SMOOTH { + parseContext.globalCheck($1.loc, "smooth"); + parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "smooth"); + parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "smooth"); + $$.init($1.loc); + $$.qualifier.smooth = true; + } + | FLAT { + parseContext.globalCheck($1.loc, "flat"); + parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "flat"); + parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "flat"); + $$.init($1.loc); + $$.qualifier.flat = true; + } + | NOPERSPECTIVE { + parseContext.globalCheck($1.loc, "noperspective"); + parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective"); + parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "noperspective"); + $$.init($1.loc); + $$.qualifier.nopersp = true; + } + | EXPLICITINTERPAMD { + parseContext.globalCheck($1.loc, "__explicitInterpAMD"); + parseContext.profileRequires($1.loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); + parseContext.profileRequires($1.loc, ECompatibilityProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); + $$.init($1.loc); + $$.qualifier.explicitInterp = true; + } + | PERVERTEXNV { + parseContext.globalCheck($1.loc, "pervertexNV"); + parseContext.profileRequires($1.loc, ECoreProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric"); + parseContext.profileRequires($1.loc, ECompatibilityProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric"); + parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric"); + $$.init($1.loc); + $$.qualifier.pervertexNV = true; + } + | PERVERTEXEXT { + parseContext.globalCheck($1.loc, "pervertexEXT"); + parseContext.profileRequires($1.loc, ECoreProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric"); + parseContext.profileRequires($1.loc, ECompatibilityProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric"); + parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric"); + $$.init($1.loc); + $$.qualifier.pervertexEXT = true; + } + | PERPRIMITIVENV { + // No need for profile version or extension check. Shader stage already checks both. + parseContext.globalCheck($1.loc, "perprimitiveNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshMask), "perprimitiveNV"); + // Fragment shader stage doesn't check for extension. So we explicitly add below extension check. + if (parseContext.language == EShLangFragment) + parseContext.requireExtensions($1.loc, 1, &E_GL_NV_mesh_shader, "perprimitiveNV"); + $$.init($1.loc); + $$.qualifier.perPrimitiveNV = true; + } + | PERPRIMITIVEEXT { + // No need for profile version or extension check. Shader stage already checks both. + parseContext.globalCheck($1.loc, "perprimitiveEXT"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshMask), "perprimitiveEXT"); + // Fragment shader stage doesn't check for extension. So we explicitly add below extension check. + if (parseContext.language == EShLangFragment) + parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_mesh_shader, "perprimitiveEXT"); + $$.init($1.loc); + $$.qualifier.perPrimitiveNV = true; + } + | PERVIEWNV { + // No need for profile version or extension check. Shader stage already checks both. + parseContext.globalCheck($1.loc, "perviewNV"); + parseContext.requireStage($1.loc, EShLangMesh, "perviewNV"); + $$.init($1.loc); + $$.qualifier.perViewNV = true; + } + | PERTASKNV { + // No need for profile version or extension check. Shader stage already checks both. + parseContext.globalCheck($1.loc, "taskNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask), "taskNV"); + $$.init($1.loc); + $$.qualifier.perTaskNV = true; + } + ; + +layout_qualifier + : LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN { + $$ = $3; + } + ; + +layout_qualifier_id_list + : layout_qualifier_id { + $$ = $1; + } + | layout_qualifier_id_list COMMA layout_qualifier_id { + $$ = $1; + $$.shaderQualifiers.merge($3.shaderQualifiers); + parseContext.mergeObjectLayoutQualifiers($$.qualifier, $3.qualifier, false); + } + +layout_qualifier_id + : IDENTIFIER { + $$.init($1.loc); + parseContext.setLayoutQualifier($1.loc, $$, *$1.string); + } + | IDENTIFIER EQUAL constant_expression { + $$.init($1.loc); + parseContext.setLayoutQualifier($1.loc, $$, *$1.string, $3); + } + | SHARED { // because "shared" is both an identifier and a keyword + $$.init($1.loc); + TString strShared("shared"); + parseContext.setLayoutQualifier($1.loc, $$, strShared); + } + ; + +precise_qualifier + : PRECISE { + parseContext.profileRequires($$.loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise"); + parseContext.profileRequires($1.loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise"); + $$.init($1.loc); + $$.qualifier.noContraction = true; + } + ; + +type_qualifier + : single_type_qualifier { + $$ = $1; + } + | type_qualifier single_type_qualifier { + $$ = $1; + if ($$.basicType == EbtVoid) + $$.basicType = $2.basicType; + + $$.shaderQualifiers.merge($2.shaderQualifiers); + parseContext.mergeQualifiers($$.loc, $$.qualifier, $2.qualifier, false); + } + ; + +single_type_qualifier + : storage_qualifier { + $$ = $1; + } + | layout_qualifier { + $$ = $1; + } + | precision_qualifier { + parseContext.checkPrecisionQualifier($1.loc, $1.qualifier.precision); + $$ = $1; + } + | interpolation_qualifier { + // allow inheritance of storage qualifier from block declaration + $$ = $1; + } + | invariant_qualifier { + // allow inheritance of storage qualifier from block declaration + $$ = $1; + } + | precise_qualifier { + // allow inheritance of storage qualifier from block declaration + $$ = $1; + } + | non_uniform_qualifier { + $$ = $1; + } + | spirv_storage_class_qualifier { + parseContext.globalCheck($1.loc, "spirv_storage_class"); + parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V storage class qualifier"); + $$ = $1; + } + | spirv_decorate_qualifier { + parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V decorate qualifier"); + $$ = $1; + } + | SPIRV_BY_REFERENCE { + parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_reference"); + $$.init($1.loc); + $$.qualifier.setSpirvByReference(); + } + | SPIRV_LITERAL { + parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_literal"); + $$.init($1.loc); + $$.qualifier.setSpirvLiteral(); + } + ; + +storage_qualifier + : CONST { + $$.init($1.loc); + $$.qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant + } + | INOUT { + parseContext.globalCheck($1.loc, "inout"); + $$.init($1.loc); + $$.qualifier.storage = EvqInOut; + } + | IN { + parseContext.globalCheck($1.loc, "in"); + $$.init($1.loc); + // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later + $$.qualifier.storage = EvqIn; + } + | OUT { + parseContext.globalCheck($1.loc, "out"); + $$.init($1.loc); + // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later + $$.qualifier.storage = EvqOut; + } + | CENTROID { + parseContext.profileRequires($1.loc, ENoProfile, 120, 0, "centroid"); + parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "centroid"); + parseContext.globalCheck($1.loc, "centroid"); + $$.init($1.loc); + $$.qualifier.centroid = true; + } + | UNIFORM { + parseContext.globalCheck($1.loc, "uniform"); + $$.init($1.loc); + $$.qualifier.storage = EvqUniform; + } + | TILEIMAGEEXT { + parseContext.globalCheck($1.loc, "tileImageEXT"); + $$.init($1.loc); + $$.qualifier.storage = EvqTileImageEXT; + } + | SHARED { + parseContext.globalCheck($1.loc, "shared"); + parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); + parseContext.profileRequires($1.loc, EEsProfile, 310, 0, "shared"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangComputeMask | EShLangMeshMask | EShLangTaskMask), "shared"); + $$.init($1.loc); + $$.qualifier.storage = EvqShared; + } + | BUFFER { + parseContext.globalCheck($1.loc, "buffer"); + $$.init($1.loc); + $$.qualifier.storage = EvqBuffer; + } + | ATTRIBUTE { + parseContext.requireStage($1.loc, EShLangVertex, "attribute"); + parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "attribute"); + parseContext.checkDeprecated($1.loc, ENoProfile, 130, "attribute"); + parseContext.requireNotRemoved($1.loc, ECoreProfile, 420, "attribute"); + parseContext.requireNotRemoved($1.loc, EEsProfile, 300, "attribute"); + + parseContext.globalCheck($1.loc, "attribute"); + + $$.init($1.loc); + $$.qualifier.storage = EvqVaryingIn; + } + | VARYING { + parseContext.checkDeprecated($1.loc, ENoProfile, 130, "varying"); + parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "varying"); + parseContext.requireNotRemoved($1.loc, ECoreProfile, 420, "varying"); + parseContext.requireNotRemoved($1.loc, EEsProfile, 300, "varying"); + + parseContext.globalCheck($1.loc, "varying"); + + $$.init($1.loc); + if (parseContext.language == EShLangVertex) + $$.qualifier.storage = EvqVaryingOut; + else + $$.qualifier.storage = EvqVaryingIn; + } + | PATCH { + parseContext.globalCheck($1.loc, "patch"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch"); + $$.init($1.loc); + $$.qualifier.patch = true; + } + | SAMPLE { + parseContext.globalCheck($1.loc, "sample"); + $$.init($1.loc); + $$.qualifier.sample = true; + } + | HITATTRNV { + parseContext.globalCheck($1.loc, "hitAttributeNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask + | EShLangAnyHitMask), "hitAttributeNV"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "hitAttributeNV"); + $$.init($1.loc); + $$.qualifier.storage = EvqHitAttr; + } + | HITOBJECTATTRNV { + parseContext.globalCheck($1.loc, "hitAttributeNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask + | EShLangMissMask), "hitObjectAttributeNV"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_shader_invocation_reorder, "hitObjectAttributeNV"); + $$.init($1.loc); + $$.qualifier.storage = EvqHitObjectAttrNV; + } + | HITOBJECTATTREXT { + parseContext.globalCheck($1.loc, "hitAttributeEXT"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask + | EShLangMissMask), "hitObjectAttributeEXT"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_shader_invocation_reorder, "hitObjectAttributeEXT"); + $$.init($1.loc); + $$.qualifier.storage = EvqHitObjectAttrEXT; + } + | HITATTREXT { + parseContext.globalCheck($1.loc, "hitAttributeEXT"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask + | EShLangAnyHitMask), "hitAttributeEXT"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "hitAttributeNV"); + $$.init($1.loc); + $$.qualifier.storage = EvqHitAttr; + } + | PAYLOADNV { + parseContext.globalCheck($1.loc, "rayPayloadNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadNV"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadNV"); + $$.init($1.loc); + $$.qualifier.storage = EvqPayload; + } + | PAYLOADEXT { + parseContext.globalCheck($1.loc, "rayPayloadEXT"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadEXT"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "rayPayloadEXT"); + $$.init($1.loc); + $$.qualifier.storage = EvqPayload; + } + | PAYLOADINNV { + parseContext.globalCheck($1.loc, "rayPayloadInNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadInNV"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadInNV"); + $$.init($1.loc); + $$.qualifier.storage = EvqPayloadIn; + } + | PAYLOADINEXT { + parseContext.globalCheck($1.loc, "rayPayloadInEXT"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadInEXT"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "rayPayloadInEXT"); + $$.init($1.loc); + $$.qualifier.storage = EvqPayloadIn; + } + | CALLDATANV { + parseContext.globalCheck($1.loc, "callableDataNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | + EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataNV"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataNV"); + $$.init($1.loc); + $$.qualifier.storage = EvqCallableData; + } + | CALLDATAEXT { + parseContext.globalCheck($1.loc, "callableDataEXT"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | + EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataEXT"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "callableDataEXT"); + $$.init($1.loc); + $$.qualifier.storage = EvqCallableData; + } + | CALLDATAINNV { + parseContext.globalCheck($1.loc, "callableDataInNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataInNV"); + $$.init($1.loc); + $$.qualifier.storage = EvqCallableDataIn; + } + | CALLDATAINEXT { + parseContext.globalCheck($1.loc, "callableDataInEXT"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInEXT"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "callableDataInEXT"); + $$.init($1.loc); + $$.qualifier.storage = EvqCallableDataIn; + } + | COHERENT { + $$.init($1.loc); + $$.qualifier.coherent = true; + } + | DEVICECOHERENT { + $$.init($1.loc); + parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "devicecoherent"); + $$.qualifier.devicecoherent = true; + } + | QUEUEFAMILYCOHERENT { + $$.init($1.loc); + parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "queuefamilycoherent"); + $$.qualifier.queuefamilycoherent = true; + } + | WORKGROUPCOHERENT { + $$.init($1.loc); + parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "workgroupcoherent"); + $$.qualifier.workgroupcoherent = true; + } + | SUBGROUPCOHERENT { + $$.init($1.loc); + parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "subgroupcoherent"); + $$.qualifier.subgroupcoherent = true; + } + | NONPRIVATE { + $$.init($1.loc); + parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "nonprivate"); + $$.qualifier.nonprivate = true; + } + | SHADERCALLCOHERENT { + $$.init($1.loc); + parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_ray_tracing, "shadercallcoherent"); + $$.qualifier.shadercallcoherent = true; + } + | VOLATILE { + $$.init($1.loc); + $$.qualifier.volatil = true; + } + | RESTRICT { + $$.init($1.loc); + $$.qualifier.restrict = true; + } + | READONLY { + $$.init($1.loc); + $$.qualifier.readonly = true; + } + | WRITEONLY { + $$.init($1.loc); + $$.qualifier.writeonly = true; + } + | NONTEMPORAL { + $$.init($1.loc); + $$.qualifier.nontemporal = true; + } + | SUBROUTINE { + parseContext.spvRemoved($1.loc, "subroutine"); + parseContext.globalCheck($1.loc, "subroutine"); + parseContext.unimplemented($1.loc, "subroutine"); + $$.init($1.loc); + } + | SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN { + parseContext.spvRemoved($1.loc, "subroutine"); + parseContext.globalCheck($1.loc, "subroutine"); + parseContext.unimplemented($1.loc, "subroutine"); + $$.init($1.loc); + } + | TASKPAYLOADWORKGROUPEXT { + // No need for profile version or extension check. Shader stage already checks both. + parseContext.globalCheck($1.loc, "taskPayloadSharedEXT"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask), "taskPayloadSharedEXT "); + $$.init($1.loc); + $$.qualifier.storage = EvqtaskPayloadSharedEXT; + } + ; + +non_uniform_qualifier + : NONUNIFORM { + $$.init($1.loc); + $$.qualifier.nonUniform = true; + } + ; + +type_name_list + : IDENTIFIER { + // TODO + } + | type_name_list COMMA IDENTIFIER { + // TODO: 4.0 semantics: subroutines + // 1) make sure each identifier is a type declared earlier with SUBROUTINE + // 2) save all of the identifiers for future comparison with the declared function + } + ; + +type_specifier + : type_specifier_nonarray type_parameter_specifier_opt { + $$ = $1; + $$.qualifier.precision = parseContext.getDefaultPrecision($$); + $$.typeParameters = $2; + parseContext.typeParametersCheck($1.loc, $$); + + } + | type_specifier_nonarray type_parameter_specifier_opt array_specifier { + parseContext.arrayOfArrayVersionCheck($3.loc, $3.arraySizes); + $$ = $1; + $$.qualifier.precision = parseContext.getDefaultPrecision($$); + $$.typeParameters = $2; + $$.arraySizes = $3.arraySizes; + parseContext.typeParametersCheck($1.loc, $$); + } + ; + +array_specifier + : LEFT_BRACKET RIGHT_BRACKET { + $$.loc = $1.loc; + $$.arraySizes = new TArraySizes; + $$.arraySizes->addInnerSize(); + } + | LEFT_BRACKET conditional_expression RIGHT_BRACKET { + $$.loc = $1.loc; + $$.arraySizes = new TArraySizes; + + TArraySize size; + parseContext.arraySizeCheck($2->getLoc(), $2, size, "array size"); + $$.arraySizes->addInnerSize(size); + } + | array_specifier LEFT_BRACKET RIGHT_BRACKET { + $$ = $1; + $$.arraySizes->addInnerSize(); + } + | array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET { + $$ = $1; + + TArraySize size; + parseContext.arraySizeCheck($3->getLoc(), $3, size, "array size"); + $$.arraySizes->addInnerSize(size); + } + ; + +type_parameter_specifier_opt + : type_parameter_specifier { + $$ = $1; + } + | /* May be null */ { + $$ = 0; + } + ; + +type_parameter_specifier + : LEFT_ANGLE type_parameter_specifier_list RIGHT_ANGLE { + $$ = $2; + } + ; + +type_parameter_specifier_list + : type_specifier { + $$ = new TTypeParameters; + $$->arraySizes = new TArraySizes; + $$->spirvType = $1.spirvType; + $$->basicType = $1.basicType; + } + | unary_expression { + $$ = new TTypeParameters; + $$->arraySizes = new TArraySizes; + + TArraySize size; + parseContext.arraySizeCheck($1->getLoc(), $1, size, "type parameter", true); + $$->arraySizes->addInnerSize(size); + } + | type_parameter_specifier_list COMMA unary_expression { + $$ = $1; + + TArraySize size; + parseContext.arraySizeCheck($3->getLoc(), $3, size, "type parameter", true); + $$->arraySizes->addInnerSize(size); + } + ; + +type_specifier_nonarray + : VOID { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtVoid; + } + | FLOAT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + } + | INT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt; + } + | UINT { + parseContext.fullIntegerCheck($1.loc, "unsigned integer"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint; + } + | BOOL { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtBool; + } + | VEC2 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setVector(2); + } + | VEC3 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setVector(3); + } + | VEC4 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setVector(4); + } + | BVEC2 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtBool; + $$.setVector(2); + } + | BVEC3 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtBool; + $$.setVector(3); + } + | BVEC4 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtBool; + $$.setVector(4); + } + | IVEC2 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt; + $$.setVector(2); + } + | IVEC3 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt; + $$.setVector(3); + } + | IVEC4 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt; + $$.setVector(4); + } + | UVEC2 { + parseContext.fullIntegerCheck($1.loc, "unsigned integer vector"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint; + $$.setVector(2); + } + | UVEC3 { + parseContext.fullIntegerCheck($1.loc, "unsigned integer vector"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint; + $$.setVector(3); + } + | UVEC4 { + parseContext.fullIntegerCheck($1.loc, "unsigned integer vector"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint; + $$.setVector(4); + } + | MAT2 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(2, 2); + } + | MAT3 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(3, 3); + } + | MAT4 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(4, 4); + } + | MAT2X2 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(2, 2); + } + | MAT2X3 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(2, 3); + } + | MAT2X4 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(2, 4); + } + | MAT3X2 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(3, 2); + } + | MAT3X3 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(3, 3); + } + | MAT3X4 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(3, 4); + } + | MAT4X2 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(4, 2); + } + | MAT4X3 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(4, 3); + } + | MAT4X4 { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(4, 4); + } + | DOUBLE { + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + } + | BFLOAT16_T { + parseContext.bfloat16ScalarVectorCheck($1.loc, "bfloat16_t", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtBFloat16; + } + | FLOATE5M2_T { + parseContext.floate5m2ScalarVectorCheck($1.loc, "floate5m2_t", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloatE5M2; + } + | FLOATE4M3_T { + parseContext.floate4m3ScalarVectorCheck($1.loc, "floate4m3_t", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloatE4M3; + } + | FLOAT16_T { + parseContext.float16ScalarVectorCheck($1.loc, "float16_t", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat16; + } + | FLOAT32_T { + parseContext.explicitFloat32Check($1.loc, "float32_t", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + } + | FLOAT64_T { + parseContext.explicitFloat64Check($1.loc, "float64_t", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + } + | INT8_T { + parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt8; + } + | UINT8_T { + parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint8; + } + | INT16_T { + parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt16; + } + | UINT16_T { + parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint16; + } + | INT32_T { + parseContext.explicitInt32Check($1.loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt; + } + | UINT32_T { + parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint; + } + | INT64_T { + parseContext.int64Check($1.loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt64; + } + | UINT64_T { + parseContext.int64Check($1.loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint64; + } + | DVEC2 { + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double vector"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setVector(2); + } + | DVEC3 { + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double vector"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setVector(3); + } + | DVEC4 { + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double vector"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setVector(4); + } + | BF16VEC2 { + parseContext.bfloat16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtBFloat16; + $$.setVector(2); + } + | BF16VEC3 { + parseContext.bfloat16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtBFloat16; + $$.setVector(3); + } + | BF16VEC4 { + parseContext.bfloat16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtBFloat16; + $$.setVector(4); + } + | FE5M2VEC2 { + parseContext.floate5m2ScalarVectorCheck($1.loc, "fe5m2 vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloatE5M2; + $$.setVector(2); + } + | FE5M2VEC3 { + parseContext.floate5m2ScalarVectorCheck($1.loc, "fe5m2 vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloatE5M2; + $$.setVector(3); + } + | FE5M2VEC4 { + parseContext.floate5m2ScalarVectorCheck($1.loc, "fe5m2 vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloatE5M2; + $$.setVector(4); + } + | FE4M3VEC2 { + parseContext.floate4m3ScalarVectorCheck($1.loc, "fe4m3 vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloatE4M3; + $$.setVector(2); + } + | FE4M3VEC3 { + parseContext.floate4m3ScalarVectorCheck($1.loc, "fe4m3 vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloatE4M3; + $$.setVector(3); + } + | FE4M3VEC4 { + parseContext.floate4m3ScalarVectorCheck($1.loc, "fe4m3 vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloatE4M3; + $$.setVector(4); + } + | F16VEC2 { + parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat16; + $$.setVector(2); + } + | F16VEC3 { + parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat16; + $$.setVector(3); + } + | F16VEC4 { + parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat16; + $$.setVector(4); + } + | F32VEC2 { + parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setVector(2); + } + | F32VEC3 { + parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setVector(3); + } + | F32VEC4 { + parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setVector(4); + } + | F64VEC2 { + parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setVector(2); + } + | F64VEC3 { + parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setVector(3); + } + | F64VEC4 { + parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setVector(4); + } + | I8VEC2 { + parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt8; + $$.setVector(2); + } + | I8VEC3 { + parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt8; + $$.setVector(3); + } + | I8VEC4 { + parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt8; + $$.setVector(4); + } + | I16VEC2 { + parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt16; + $$.setVector(2); + } + | I16VEC3 { + parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt16; + $$.setVector(3); + } + | I16VEC4 { + parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt16; + $$.setVector(4); + } + | I32VEC2 { + parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt; + $$.setVector(2); + } + | I32VEC3 { + parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt; + $$.setVector(3); + } + | I32VEC4 { + parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt; + $$.setVector(4); + } + | I64VEC2 { + parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt64; + $$.setVector(2); + } + | I64VEC3 { + parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt64; + $$.setVector(3); + } + | I64VEC4 { + parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt64; + $$.setVector(4); + } + | U8VEC2 { + parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint8; + $$.setVector(2); + } + | U8VEC3 { + parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint8; + $$.setVector(3); + } + | U8VEC4 { + parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint8; + $$.setVector(4); + } + | U16VEC2 { + parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint16; + $$.setVector(2); + } + | U16VEC3 { + parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint16; + $$.setVector(3); + } + | U16VEC4 { + parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint16; + $$.setVector(4); + } + | U32VEC2 { + parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint; + $$.setVector(2); + } + | U32VEC3 { + parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint; + $$.setVector(3); + } + | U32VEC4 { + parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint; + $$.setVector(4); + } + | U64VEC2 { + parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint64; + $$.setVector(2); + } + | U64VEC3 { + parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint64; + $$.setVector(3); + } + | U64VEC4 { + parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint64; + $$.setVector(4); + } + | DMAT2 { + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(2, 2); + } + | DMAT3 { + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(3, 3); + } + | DMAT4 { + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(4, 4); + } + | DMAT2X2 { + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(2, 2); + } + | DMAT2X3 { + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(2, 3); + } + | DMAT2X4 { + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(2, 4); + } + | DMAT3X2 { + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(3, 2); + } + | DMAT3X3 { + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(3, 3); + } + | DMAT3X4 { + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(3, 4); + } + | DMAT4X2 { + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(4, 2); + } + | DMAT4X3 { + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(4, 3); + } + | DMAT4X4 { + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(4, 4); + } + | F16MAT2 { + parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat16; + $$.setMatrix(2, 2); + } + | F16MAT3 { + parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat16; + $$.setMatrix(3, 3); + } + | F16MAT4 { + parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat16; + $$.setMatrix(4, 4); + } + | F16MAT2X2 { + parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat16; + $$.setMatrix(2, 2); + } + | F16MAT2X3 { + parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat16; + $$.setMatrix(2, 3); + } + | F16MAT2X4 { + parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat16; + $$.setMatrix(2, 4); + } + | F16MAT3X2 { + parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat16; + $$.setMatrix(3, 2); + } + | F16MAT3X3 { + parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat16; + $$.setMatrix(3, 3); + } + | F16MAT3X4 { + parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat16; + $$.setMatrix(3, 4); + } + | F16MAT4X2 { + parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat16; + $$.setMatrix(4, 2); + } + | F16MAT4X3 { + parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat16; + $$.setMatrix(4, 3); + } + | F16MAT4X4 { + parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat16; + $$.setMatrix(4, 4); + } + | F32MAT2 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(2, 2); + } + | F32MAT3 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(3, 3); + } + | F32MAT4 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(4, 4); + } + | F32MAT2X2 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(2, 2); + } + | F32MAT2X3 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(2, 3); + } + | F32MAT2X4 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(2, 4); + } + | F32MAT3X2 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(3, 2); + } + | F32MAT3X3 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(3, 3); + } + | F32MAT3X4 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(3, 4); + } + | F32MAT4X2 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(4, 2); + } + | F32MAT4X3 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(4, 3); + } + | F32MAT4X4 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(4, 4); + } + | F64MAT2 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(2, 2); + } + | F64MAT3 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(3, 3); + } + | F64MAT4 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(4, 4); + } + | F64MAT2X2 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(2, 2); + } + | F64MAT2X3 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(2, 3); + } + | F64MAT2X4 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(2, 4); + } + | F64MAT3X2 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(3, 2); + } + | F64MAT3X3 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(3, 3); + } + | F64MAT3X4 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(3, 4); + } + | F64MAT4X2 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(4, 2); + } + | F64MAT4X3 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(4, 3); + } + | F64MAT4X4 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(4, 4); + } + | ACCSTRUCTNV { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtAccStruct; + } + | ACCSTRUCTEXT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtAccStruct; + } + | RAYQUERYEXT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtRayQuery; + } + | ATOMIC_UINT { + parseContext.vulkanRemoved($1.loc, "atomic counter types"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtAtomicUint; + } + | SAMPLER1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd1D); + } + | SAMPLER2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd2D); + } + | SAMPLER3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd3D); + } + | SAMPLERCUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, EsdCube); + } + | SAMPLER2DSHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd2D, false, true); + } + | SAMPLERCUBESHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, EsdCube, false, true); + } + | SAMPLER2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd2D, true); + } + | SAMPLER2DARRAYSHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd2D, true, true); + } + | SAMPLER1DSHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd1D, false, true); + } + | SAMPLER1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd1D, true); + } + | SAMPLER1DARRAYSHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd1D, true, true); + } + | SAMPLERCUBEARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, EsdCube, true); + } + | SAMPLERCUBEARRAYSHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, EsdCube, true, true); + } + | F16SAMPLER1D { + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd1D); + } + | F16SAMPLER2D { + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd2D); + } + | F16SAMPLER3D { + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd3D); + } + | F16SAMPLERCUBE { + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdCube); + } + | F16SAMPLER1DSHADOW { + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd1D, false, true); + } + | F16SAMPLER2DSHADOW { + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd2D, false, true); + } + | F16SAMPLERCUBESHADOW { + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdCube, false, true); + } + | F16SAMPLER1DARRAY { + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd1D, true); + } + | F16SAMPLER2DARRAY { + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd2D, true); + } + | F16SAMPLER1DARRAYSHADOW { + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd1D, true, true); + } + | F16SAMPLER2DARRAYSHADOW { + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd2D, true, true); + } + | F16SAMPLERCUBEARRAY { + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdCube, true); + } + | F16SAMPLERCUBEARRAYSHADOW { + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdCube, true, true); + } + | ISAMPLER1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtInt, Esd1D); + } + | ISAMPLER2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtInt, Esd2D); + } + | ISAMPLER3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtInt, Esd3D); + } + | ISAMPLERCUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtInt, EsdCube); + } + | ISAMPLER2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtInt, Esd2D, true); + } + | USAMPLER2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtUint, Esd2D); + } + | USAMPLER3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtUint, Esd3D); + } + | USAMPLERCUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtUint, EsdCube); + } + | ISAMPLER1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtInt, Esd1D, true); + } + | ISAMPLERCUBEARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtInt, EsdCube, true); + } + | USAMPLER1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtUint, Esd1D); + } + | USAMPLER1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtUint, Esd1D, true); + } + | USAMPLERCUBEARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtUint, EsdCube, true); + } + | TEXTURECUBEARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, EsdCube, true); + } + | ITEXTURECUBEARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, EsdCube, true); + } + | UTEXTURECUBEARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, EsdCube, true); + } + | USAMPLER2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtUint, Esd2D, true); + } + | TEXTURE2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd2D); + } + | TEXTURE3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd3D); + } + | TEXTURE2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd2D, true); + } + | TEXTURECUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, EsdCube); + } + | ITEXTURE2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd2D); + } + | ITEXTURE3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd3D); + } + | ITEXTURECUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, EsdCube); + } + | ITEXTURE2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd2D, true); + } + | UTEXTURE2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd2D); + } + | UTEXTURE3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd3D); + } + | UTEXTURECUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, EsdCube); + } + | UTEXTURE2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd2D, true); + } + | SAMPLER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setPureSampler(false); + } + | SAMPLERSHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setPureSampler(true); + } + | SAMPLER2DRECT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, EsdRect); + } + | SAMPLER2DRECTSHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, EsdRect, false, true); + } + | F16SAMPLER2DRECT { + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdRect); + } + | F16SAMPLER2DRECTSHADOW { + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdRect, false, true); + } + | ISAMPLER2DRECT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtInt, EsdRect); + } + | USAMPLER2DRECT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtUint, EsdRect); + } + | SAMPLERBUFFER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, EsdBuffer); + } + | F16SAMPLERBUFFER { + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdBuffer); + } + | ISAMPLERBUFFER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtInt, EsdBuffer); + } + | USAMPLERBUFFER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtUint, EsdBuffer); + } + | SAMPLER2DMS { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd2D, false, false, true); + } + | F16SAMPLER2DMS { + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd2D, false, false, true); + } + | ISAMPLER2DMS { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtInt, Esd2D, false, false, true); + } + | USAMPLER2DMS { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtUint, Esd2D, false, false, true); + } + | SAMPLER2DMSARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd2D, true, false, true); + } + | F16SAMPLER2DMSARRAY { + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd2D, true, false, true); + } + | ISAMPLER2DMSARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtInt, Esd2D, true, false, true); + } + | USAMPLER2DMSARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtUint, Esd2D, true, false, true); + } + | TEXTURE1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd1D); + } + | F16TEXTURE1D { + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd1D); + } + | F16TEXTURE2D { + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd2D); + } + | F16TEXTURE3D { + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd3D); + } + | F16TEXTURECUBE { + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, EsdCube); + } + | TEXTURE1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd1D, true); + } + | F16TEXTURE1DARRAY { + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd1D, true); + } + | F16TEXTURE2DARRAY { + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd2D, true); + } + | F16TEXTURECUBEARRAY { + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, EsdCube, true); + } + | ITEXTURE1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd1D); + } + | ITEXTURE1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd1D, true); + } + | UTEXTURE1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd1D); + } + | UTEXTURE1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd1D, true); + } + | TEXTURE2DRECT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, EsdRect); + } + | F16TEXTURE2DRECT { + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, EsdRect); + } + | ITEXTURE2DRECT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, EsdRect); + } + | UTEXTURE2DRECT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, EsdRect); + } + | TEXTUREBUFFER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, EsdBuffer); + } + | F16TEXTUREBUFFER { + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, EsdBuffer); + } + | ITEXTUREBUFFER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, EsdBuffer); + } + | UTEXTUREBUFFER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, EsdBuffer); + } + | TEXTURE2DMS { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd2D, false, false, true); + } + | F16TEXTURE2DMS { + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd2D, false, false, true); + } + | ITEXTURE2DMS { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd2D, false, false, true); + } + | UTEXTURE2DMS { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd2D, false, false, true); + } + | TEXTURE2DMSARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd2D, true, false, true); + } + | F16TEXTURE2DMSARRAY { + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd2D, true, false, true); + } + | ITEXTURE2DMSARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd2D, true, false, true); + } + | UTEXTURE2DMSARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd2D, true, false, true); + } + | IMAGE1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat, Esd1D); + } + | F16IMAGE1D { + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd1D); + } + | IIMAGE1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt, Esd1D); + } + | UIMAGE1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint, Esd1D); + } + | IMAGE2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat, Esd2D); + } + | F16IMAGE2D { + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd2D); + } + | IIMAGE2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt, Esd2D); + } + | UIMAGE2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint, Esd2D); + } + | IMAGE3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat, Esd3D); + } + | F16IMAGE3D { + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd3D); + } + | IIMAGE3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt, Esd3D); + } + | UIMAGE3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint, Esd3D); + } + | IMAGE2DRECT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat, EsdRect); + } + | F16IMAGE2DRECT { + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, EsdRect); + } + | IIMAGE2DRECT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt, EsdRect); + } + | UIMAGE2DRECT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint, EsdRect); + } + | IMAGECUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat, EsdCube); + } + | F16IMAGECUBE { + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, EsdCube); + } + | IIMAGECUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt, EsdCube); + } + | UIMAGECUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint, EsdCube); + } + | IMAGEBUFFER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat, EsdBuffer); + } + | F16IMAGEBUFFER { + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, EsdBuffer); + } + | IIMAGEBUFFER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt, EsdBuffer); + } + | UIMAGEBUFFER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint, EsdBuffer); + } + | IMAGE1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat, Esd1D, true); + } + | F16IMAGE1DARRAY { + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd1D, true); + } + | IIMAGE1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt, Esd1D, true); + } + | UIMAGE1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint, Esd1D, true); + } + | IMAGE2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat, Esd2D, true); + } + | F16IMAGE2DARRAY { + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd2D, true); + } + | IIMAGE2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt, Esd2D, true); + } + | UIMAGE2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint, Esd2D, true); + } + | IMAGECUBEARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat, EsdCube, true); + } + | F16IMAGECUBEARRAY { + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, EsdCube, true); + } + | IIMAGECUBEARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt, EsdCube, true); + } + | UIMAGECUBEARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint, EsdCube, true); + } + | IMAGE2DMS { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat, Esd2D, false, false, true); + } + | F16IMAGE2DMS { + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd2D, false, false, true); + } + | IIMAGE2DMS { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt, Esd2D, false, false, true); + } + | UIMAGE2DMS { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint, Esd2D, false, false, true); + } + | IMAGE2DMSARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat, Esd2D, true, false, true); + } + | F16IMAGE2DMSARRAY { + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd2D, true, false, true); + } + | IIMAGE2DMSARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt, Esd2D, true, false, true); + } + | UIMAGE2DMSARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint, Esd2D, true, false, true); + } + | I64IMAGE1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt64, Esd1D); + } + | U64IMAGE1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint64, Esd1D); + } + | I64IMAGE2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt64, Esd2D); + } + | U64IMAGE2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint64, Esd2D); + } + | I64IMAGE3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt64, Esd3D); + } + | U64IMAGE3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint64, Esd3D); + } + | I64IMAGE2DRECT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt64, EsdRect); + } + | U64IMAGE2DRECT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint64, EsdRect); + } + | I64IMAGECUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt64, EsdCube); + } + | U64IMAGECUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint64, EsdCube); + } + | I64IMAGEBUFFER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt64, EsdBuffer); + } + | U64IMAGEBUFFER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint64, EsdBuffer); + } + | I64IMAGE1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt64, Esd1D, true); + } + | U64IMAGE1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint64, Esd1D, true); + } + | I64IMAGE2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt64, Esd2D, true); + } + | U64IMAGE2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint64, Esd2D, true); + } + | I64IMAGECUBEARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt64, EsdCube, true); + } + | U64IMAGECUBEARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint64, EsdCube, true); + } + | I64IMAGE2DMS { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt64, Esd2D, false, false, true); + } + | U64IMAGE2DMS { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint64, Esd2D, false, false, true); + } + | I64IMAGE2DMSARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtInt64, Esd2D, true, false, true); + } + | U64IMAGE2DMSARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtUint64, Esd2D, true, false, true); + } + | SAMPLEREXTERNALOES { // GL_OES_EGL_image_external + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd2D); + $$.sampler.external = true; + } + | SAMPLEREXTERNAL2DY2YEXT { // GL_EXT_YUV_target + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd2D); + $$.sampler.yuv = true; + } + | ATTACHMENTEXT { + parseContext.requireStage($1.loc, EShLangFragment, "attachmentEXT input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setAttachmentEXT(EbtFloat); + } + | IATTACHMENTEXT { + parseContext.requireStage($1.loc, EShLangFragment, "attachmentEXT input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setAttachmentEXT(EbtInt); + } + | UATTACHMENTEXT { + parseContext.requireStage($1.loc, EShLangFragment, "attachmentEXT input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setAttachmentEXT(EbtUint); + } + | SUBPASSINPUT { + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtFloat); + } + | SUBPASSINPUTMS { + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtFloat, true); + } + | F16SUBPASSINPUT { + parseContext.float16OpaqueCheck($1.loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtFloat16); + } + | F16SUBPASSINPUTMS { + parseContext.float16OpaqueCheck($1.loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtFloat16, true); + } + | ISUBPASSINPUT { + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtInt); + } + | ISUBPASSINPUTMS { + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtInt, true); + } + | USUBPASSINPUT { + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtUint); + } + | USUBPASSINPUTMS { + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtUint, true); + } + | FCOOPMATNV { + parseContext.fcoopmatCheckNV($1.loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.coopmatNV = true; + $$.coopmatKHR = false; + } + | ICOOPMATNV { + parseContext.intcoopmatCheckNV($1.loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt; + $$.coopmatNV = true; + $$.coopmatKHR = false; + } + | UCOOPMATNV { + parseContext.intcoopmatCheckNV($1.loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint; + $$.coopmatNV = true; + $$.coopmatKHR = false; + } + | COOPMAT { + parseContext.coopmatCheck($1.loc, "coopmat", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtCoopmat; + $$.coopmatNV = false; + $$.coopmatKHR = true; + } + | TENSORLAYOUTNV { + parseContext.tensorLayoutViewCheck($1.loc, "tensorLayoutNV", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtTensorLayoutNV; + } + | TENSORVIEWNV { + parseContext.tensorLayoutViewCheck($1.loc, "tensorViewNV", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtTensorViewNV; + } + | FUNCTION { + $$.init($1.loc); + $$.basicType = EbtFunction; + } + | COOPVECNV { + parseContext.coopvecCheck($1.loc, "coopvecNV", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtCoopvecNV; + $$.coopvecNV = true; + } + | TENSORARM { + parseContext.tensorCheckARM($1.loc, "tensorARM", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.tensorRankARM = 1; // placeholder value + $$.basicType = EbtTensorARM; + } + | spirv_type_specifier { + parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier"); + $$ = $1; + } + | HITOBJECTNV { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtHitObjectNV; + } + | HITOBJECTEXT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtHitObjectEXT; + } + | struct_specifier { + $$ = $1; + $$.qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + parseContext.structTypeCheck($$.loc, $$); + } + | TYPE_NAME { + // + // This is for user defined type names. The lexical phase looked up the + // type. + // + if (const TVariable* variable = ($1.symbol)->getAsVariable()) { + const TType& structure = variable->getType(); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtStruct; + $$.userDef = &structure; + } else + parseContext.error($1.loc, "expected type name", $1.string->c_str(), ""); + } + ; + +precision_qualifier + : HIGH_PRECISION { + parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "highp precision qualifier"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.handlePrecisionQualifier($1.loc, $$.qualifier, EpqHigh); + } + | MEDIUM_PRECISION { + parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "mediump precision qualifier"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.handlePrecisionQualifier($1.loc, $$.qualifier, EpqMedium); + } + | LOW_PRECISION { + parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "lowp precision qualifier"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.handlePrecisionQualifier($1.loc, $$.qualifier, EpqLow); + } + ; + +struct_specifier + : STRUCT IDENTIFIER LEFT_BRACE { parseContext.nestedStructCheck($1.loc); } struct_declaration_list RIGHT_BRACE { + + TType* structure = new TType($5, *$2.string); + parseContext.structArrayCheck($2.loc, *structure); + + TVariable* userTypeDef = new TVariable($2.string, *structure, true); + if (! parseContext.symbolTable.insert(*userTypeDef)) + parseContext.error($2.loc, "redefinition", $2.string->c_str(), "struct"); + else if (parseContext.spvVersion.vulkanRelaxed + && structure->containsOpaque()) + parseContext.relaxedSymbols.push_back(structure->getTypeName()); + + $$.init($1.loc); + $$.basicType = EbtStruct; + $$.userDef = structure; + --parseContext.structNestingLevel; + } + | STRUCT LEFT_BRACE { parseContext.nestedStructCheck($1.loc); } struct_declaration_list RIGHT_BRACE { + TType* structure = new TType($4, TString("")); + $$.init($1.loc); + $$.basicType = EbtStruct; + $$.userDef = structure; + --parseContext.structNestingLevel; + } + ; + +struct_declaration_list + : struct_declaration { + $$ = $1; + } + | struct_declaration_list struct_declaration { + $$ = $1; + for (unsigned int i = 0; i < $2->size(); ++i) { + for (unsigned int j = 0; j < $$->size(); ++j) { + if ((*$$)[j].type->getFieldName() == (*$2)[i].type->getFieldName()) + parseContext.error((*$2)[i].loc, "duplicate member name:", "", (*$2)[i].type->getFieldName().c_str()); + } + $$->push_back((*$2)[i]); + } + } + ; + +struct_declaration + : type_specifier struct_declarator_list SEMICOLON { + if ($1.arraySizes) { + parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type"); + if (parseContext.isEsProfile()) + parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes); + } + + $$ = $2; + + parseContext.voidErrorCheck($1.loc, (*$2)[0].type->getFieldName(), $1.basicType); + parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier, $1.hasTypeParameter()); + + for (unsigned int i = 0; i < $$->size(); ++i) { + TType type($1); + type.setFieldName((*$$)[i].type->getFieldName()); + type.transferArraySizes((*$$)[i].type->getArraySizes()); + type.copyArrayInnerSizes($1.arraySizes); + parseContext.arrayOfArrayVersionCheck((*$$)[i].loc, type.getArraySizes()); + (*$$)[i].type->shallowCopy(type); + } + } + | type_qualifier type_specifier struct_declarator_list SEMICOLON { + if ($2.arraySizes) { + parseContext.profileRequires($2.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires($2.loc, EEsProfile, 300, 0, "arrayed type"); + if (parseContext.isEsProfile()) + parseContext.arraySizeRequiredCheck($2.loc, *$2.arraySizes); + } + + $$ = $3; + + parseContext.memberQualifierCheck($1); + parseContext.voidErrorCheck($2.loc, (*$3)[0].type->getFieldName(), $2.basicType); + parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true); + parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier, $2.hasTypeParameter()); + + for (unsigned int i = 0; i < $$->size(); ++i) { + TType type($2); + type.setFieldName((*$$)[i].type->getFieldName()); + type.transferArraySizes((*$$)[i].type->getArraySizes()); + type.copyArrayInnerSizes($2.arraySizes); + parseContext.arrayOfArrayVersionCheck((*$$)[i].loc, type.getArraySizes()); + (*$$)[i].type->shallowCopy(type); + } + } + ; + +struct_declarator_list + : struct_declarator { + $$ = new TTypeList; + $$->push_back($1); + } + | struct_declarator_list COMMA struct_declarator { + $$->push_back($3); + } + ; + +struct_declarator + : IDENTIFIER { + $$.type = new TType(EbtVoid); + $$.loc = $1.loc; + $$.type->setFieldName(*$1.string); + } + | IDENTIFIER array_specifier { + parseContext.arrayOfArrayVersionCheck($1.loc, $2.arraySizes); + + $$.type = new TType(EbtVoid); + $$.loc = $1.loc; + $$.type->setFieldName(*$1.string); + $$.type->transferArraySizes($2.arraySizes); + } + ; + +initializer + : assignment_expression { + $$ = $1; + } + | LEFT_BRACE initializer_list RIGHT_BRACE { + const char* initFeature = "{ } style initializers"; + parseContext.requireProfile($1.loc, ~EEsProfile, initFeature); + parseContext.profileRequires($1.loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); + $$ = $2; + } + | LEFT_BRACE initializer_list COMMA RIGHT_BRACE { + const char* initFeature = "{ } style initializers"; + parseContext.requireProfile($1.loc, ~EEsProfile, initFeature); + parseContext.profileRequires($1.loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); + $$ = $2; + } + | LEFT_BRACE RIGHT_BRACE { + const char* initFeature = "empty { } initializer"; + parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_EXT_null_initializer, initFeature); + parseContext.profileRequires($1.loc, ~EEsProfile, 0, E_GL_EXT_null_initializer, initFeature); + $$ = parseContext.intermediate.makeAggregate($1.loc); + } + ; + +initializer_list + : initializer { + $$ = parseContext.intermediate.growAggregate(0, $1, $1->getLoc()); + } + | initializer_list COMMA initializer { + $$ = parseContext.intermediate.growAggregate($1, $3); + } + ; + +declaration_statement + : declaration { $$ = $1; } + ; + +statement + : compound_statement { $$ = $1; } + | simple_statement { $$ = $1; } + ; + +// Grammar Note: labeled statements for switch statements only; 'goto' is not supported. + +simple_statement + : declaration_statement { $$ = $1; } + | expression_statement { $$ = $1; } + | selection_statement { $$ = $1; } + | switch_statement { $$ = $1; } + | case_label { $$ = $1; } + | iteration_statement { $$ = $1; } + | jump_statement { $$ = $1; } + | demote_statement { $$ = $1; } + ; + +demote_statement + : DEMOTE SEMICOLON { + parseContext.requireStage($1.loc, EShLangFragment, "demote"); + parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_demote_to_helper_invocation, "demote"); + $$ = parseContext.intermediate.addBranch(EOpDemote, $1.loc); + } + ; + +compound_statement + : LEFT_BRACE RIGHT_BRACE { $$ = 0; } + | LEFT_BRACE { + parseContext.symbolTable.push(); + ++parseContext.statementNestingLevel; + } + statement_list { + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + --parseContext.statementNestingLevel; + } + RIGHT_BRACE { + if ($3 && $3->getAsAggregate()) { + $3->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence); + $3->getAsAggregate()->setEndLoc($5.loc); + } + $$ = $3; + } + ; + +statement_no_new_scope + : compound_statement_no_new_scope { $$ = $1; } + | simple_statement { $$ = $1; } + ; + +statement_scoped + : { + ++parseContext.controlFlowNestingLevel; + } + compound_statement { + --parseContext.controlFlowNestingLevel; + $$ = $2; + } + | { + parseContext.symbolTable.push(); + ++parseContext.statementNestingLevel; + ++parseContext.controlFlowNestingLevel; + } + simple_statement { + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + --parseContext.statementNestingLevel; + --parseContext.controlFlowNestingLevel; + $$ = $2; + } + +compound_statement_no_new_scope + // Statement that doesn't create a new scope, for selection_statement, iteration_statement + : LEFT_BRACE RIGHT_BRACE { + $$ = 0; + } + | LEFT_BRACE statement_list RIGHT_BRACE { + if ($2 && $2->getAsAggregate()) { + $2->getAsAggregate()->setOperator(EOpSequence); + $2->getAsAggregate()->setEndLoc($3.loc); + } + $$ = $2; + } + ; + +statement_list + : statement { + $$ = parseContext.intermediate.makeAggregate($1); + if ($1 && $1->getAsBranchNode() && ($1->getAsBranchNode()->getFlowOp() == EOpCase || + $1->getAsBranchNode()->getFlowOp() == EOpDefault)) { + parseContext.wrapupSwitchSubsequence(0, $1); + $$ = 0; // start a fresh subsequence for what's after this case + } + } + | statement_list statement { + if ($2 && $2->getAsBranchNode() && ($2->getAsBranchNode()->getFlowOp() == EOpCase || + $2->getAsBranchNode()->getFlowOp() == EOpDefault)) { + parseContext.wrapupSwitchSubsequence($1 ? $1->getAsAggregate() : 0, $2); + $$ = 0; // start a fresh subsequence for what's after this case + } else + $$ = parseContext.intermediate.growAggregate($1, $2); + } + ; + +expression_statement + : SEMICOLON { $$ = 0; } + | expression SEMICOLON { $$ = static_cast($1); } + ; + +selection_statement + : selection_statement_nonattributed { + $$ = $1; + } + | attribute selection_statement_nonattributed { + parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); + parseContext.handleSelectionAttributes(*$1, $2); + $$ = $2; + } + +selection_statement_nonattributed + : IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement { + parseContext.boolCheck($1.loc, $3); + $$ = parseContext.intermediate.addSelection($3, $5, $1.loc); + } + ; + +selection_rest_statement + : statement_scoped ELSE statement_scoped { + $$.node1 = $1; + $$.node2 = $3; + } + | statement_scoped { + $$.node1 = $1; + $$.node2 = 0; + } + ; + +condition + // In 1996 c++ draft, conditions can include single declarations + : expression { + $$ = $1; + parseContext.boolCheck($1->getLoc(), $1); + } + | fully_specified_type IDENTIFIER EQUAL initializer { + parseContext.boolCheck($2.loc, $1); + + TType type($1); + $$ = parseContext.declareVariable($2.loc, *$2.string, $1, 0, $4); + } + ; + +switch_statement + : switch_statement_nonattributed { + $$ = $1; + } + | attribute switch_statement_nonattributed { + parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); + parseContext.handleSwitchAttributes(*$1, $2); + $$ = $2; + } + +switch_statement_nonattributed + : SWITCH LEFT_PAREN expression RIGHT_PAREN { + // start new switch sequence on the switch stack + ++parseContext.controlFlowNestingLevel; + ++parseContext.statementNestingLevel; + parseContext.switchSequenceStack.push_back(new TIntermSequence); + parseContext.switchLevel.push_back(parseContext.statementNestingLevel); + parseContext.symbolTable.push(); + } + LEFT_BRACE switch_statement_list RIGHT_BRACE { + $$ = parseContext.addSwitch($1.loc, $3, $7 ? $7->getAsAggregate() : 0); + delete parseContext.switchSequenceStack.back(); + parseContext.switchSequenceStack.pop_back(); + parseContext.switchLevel.pop_back(); + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + --parseContext.statementNestingLevel; + --parseContext.controlFlowNestingLevel; + } + ; + +switch_statement_list + : /* nothing */ { + $$ = 0; + } + | statement_list { + $$ = $1; + } + ; + +case_label + : CASE expression COLON { + $$ = 0; + if (parseContext.switchLevel.size() == 0) + parseContext.error($1.loc, "cannot appear outside switch statement", "case", ""); + else if (parseContext.switchLevel.back() != parseContext.statementNestingLevel) + parseContext.error($1.loc, "cannot be nested inside control flow", "case", ""); + else { + parseContext.constantValueCheck($2, "case"); + parseContext.integerCheck($2, "case"); + $$ = parseContext.intermediate.addBranch(EOpCase, $2, $1.loc); + } + } + | DEFAULT COLON { + $$ = 0; + if (parseContext.switchLevel.size() == 0) + parseContext.error($1.loc, "cannot appear outside switch statement", "default", ""); + else if (parseContext.switchLevel.back() != parseContext.statementNestingLevel) + parseContext.error($1.loc, "cannot be nested inside control flow", "default", ""); + else + $$ = parseContext.intermediate.addBranch(EOpDefault, $1.loc); + } + ; + +iteration_statement + : iteration_statement_nonattributed { + $$ = $1; + } + | attribute iteration_statement_nonattributed { + const char * extensions[2] = { E_GL_EXT_control_flow_attributes, E_GL_EXT_control_flow_attributes2 }; + parseContext.requireExtensions($2->getLoc(), 2, extensions, "attribute"); + parseContext.handleLoopAttributes(*$1, $2); + $$ = $2; + } + +iteration_statement_nonattributed + : WHILE LEFT_PAREN { + if (! parseContext.limits.whileLoops) + parseContext.error($1.loc, "while loops not available", "limitation", ""); + parseContext.symbolTable.push(); + ++parseContext.loopNestingLevel; + ++parseContext.statementNestingLevel; + ++parseContext.controlFlowNestingLevel; + } + condition RIGHT_PAREN statement_no_new_scope { + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + $$ = parseContext.intermediate.addLoop($6, $4, 0, true, $1.loc); + if (parseContext.intermediate.getDebugInfo()) { + $$ = parseContext.intermediate.makeAggregate($$, $1.loc); + $$->getAsAggregate()->setOperator(EOpScope); + } + --parseContext.loopNestingLevel; + --parseContext.statementNestingLevel; + --parseContext.controlFlowNestingLevel; + } + | DO { + parseContext.symbolTable.push(); + ++parseContext.loopNestingLevel; + ++parseContext.statementNestingLevel; + ++parseContext.controlFlowNestingLevel; + } + statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON { + if (! parseContext.limits.whileLoops) + parseContext.error($1.loc, "do-while loops not available", "limitation", ""); + + parseContext.boolCheck($8.loc, $6); + + $$ = parseContext.intermediate.addLoop($3, $6, 0, false, $4.loc); + if (parseContext.intermediate.getDebugInfo()) { + $$ = parseContext.intermediate.makeAggregate($$, $4.loc); + $$->getAsAggregate()->setOperator(EOpScope); + } + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + --parseContext.loopNestingLevel; + --parseContext.statementNestingLevel; + --parseContext.controlFlowNestingLevel; + } + | FOR LEFT_PAREN { + parseContext.symbolTable.push(); + ++parseContext.loopNestingLevel; + ++parseContext.statementNestingLevel; + ++parseContext.controlFlowNestingLevel; + } + for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope { + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + $$ = parseContext.intermediate.makeAggregate($4, $2.loc); + TIntermLoop* forLoop = parseContext.intermediate.addLoop($7, reinterpret_cast($5.node1), reinterpret_cast($5.node2), true, $1.loc); + if (! parseContext.limits.nonInductiveForLoops) + parseContext.inductiveLoopCheck($1.loc, $4, forLoop); + $$ = parseContext.intermediate.growAggregate($$, forLoop, $1.loc); + $$->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence); + --parseContext.loopNestingLevel; + --parseContext.statementNestingLevel; + --parseContext.controlFlowNestingLevel; + } + ; + +for_init_statement + : expression_statement { + $$ = $1; + } + | declaration_statement { + $$ = $1; + } + ; + +conditionopt + : condition { + $$ = $1; + } + | /* May be null */ { + $$ = 0; + } + ; + +for_rest_statement + : conditionopt SEMICOLON { + $$.node1 = $1; + $$.node2 = 0; + } + | conditionopt SEMICOLON expression { + $$.node1 = $1; + $$.node2 = $3; + } + ; + +jump_statement + : CONTINUE SEMICOLON { + if (parseContext.loopNestingLevel <= 0) + parseContext.error($1.loc, "continue statement only allowed in loops", "", ""); + $$ = parseContext.intermediate.addBranch(EOpContinue, $1.loc); + } + | BREAK SEMICOLON { + if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0) + parseContext.error($1.loc, "break statement only allowed in switch and loops", "", ""); + $$ = parseContext.intermediate.addBranch(EOpBreak, $1.loc); + } + | RETURN SEMICOLON { + $$ = parseContext.intermediate.addBranch(EOpReturn, $1.loc); + if (parseContext.currentFunctionType->getBasicType() != EbtVoid) + parseContext.error($1.loc, "non-void function must return a value", "return", ""); + if (parseContext.inMain) + parseContext.postEntryPointReturn = true; + } + | RETURN expression SEMICOLON { + $$ = parseContext.handleReturnValue($1.loc, $2); + } + | DISCARD SEMICOLON { + parseContext.requireStage($1.loc, EShLangFragment, "discard"); + $$ = parseContext.intermediate.addBranch(EOpKill, $1.loc); + } + | TERMINATE_INVOCATION SEMICOLON { + parseContext.requireStage($1.loc, EShLangFragment, "terminateInvocation"); + $$ = parseContext.intermediate.addBranch(EOpTerminateInvocation, $1.loc); + } + | TERMINATE_RAY SEMICOLON { + parseContext.requireStage($1.loc, EShLangAnyHit, "terminateRayEXT"); + $$ = parseContext.intermediate.addBranch(EOpTerminateRayKHR, $1.loc); + } + | IGNORE_INTERSECTION SEMICOLON { + parseContext.requireStage($1.loc, EShLangAnyHit, "ignoreIntersectionEXT"); + $$ = parseContext.intermediate.addBranch(EOpIgnoreIntersectionKHR, $1.loc); + } + ; + +// Grammar Note: No 'goto'. Gotos are not supported. + +translation_unit + : external_declaration { + $$ = $1; + parseContext.intermediate.setTreeRoot($$); + } + | translation_unit external_declaration { + if ($2 != nullptr) { + $$ = parseContext.intermediate.growAggregate($1, $2); + parseContext.intermediate.setTreeRoot($$); + } + } + ; + +external_declaration + : function_definition { + $$ = $1; + } + | declaration { + $$ = $1; + } + | SEMICOLON { + parseContext.requireProfile($1.loc, ~EEsProfile, "extraneous semicolon"); + parseContext.profileRequires($1.loc, ~EEsProfile, 460, nullptr, "extraneous semicolon"); + $$ = nullptr; + } + ; + +function_definition + : function_prototype { + $1.function = parseContext.handleFunctionDeclarator($1.loc, *$1.function, false /* not prototype */); + $1.intermNode = parseContext.handleFunctionDefinition($1.loc, *$1.function); + + // For ES 100 only, according to ES shading language 100 spec: A function + // body has a scope nested inside the function's definition. + if (parseContext.profile == EEsProfile && parseContext.version == 100) + { + parseContext.symbolTable.push(); + ++parseContext.statementNestingLevel; + } + } + compound_statement_no_new_scope { + // May be best done as post process phase on intermediate code + if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) + parseContext.error($1.loc, "function does not return a value:", "", $1.function->getName().c_str()); + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + $$ = parseContext.intermediate.growAggregate($1.intermNode, $3); + $$->getAsAggregate()->setLinkType($1.function->getLinkType()); + parseContext.intermediate.setAggregateOperator($$, EOpFunction, $1.function->getType(), $1.loc); + $$->getAsAggregate()->setName($1.function->getMangledName().c_str()); + + // store the pragma information for debug and optimize and other vendor specific + // information. This information can be queried from the parse tree + $$->getAsAggregate()->setOptimize(parseContext.contextPragma.optimize); + $$->getAsAggregate()->setDebug(parseContext.contextPragma.debug); + $$->getAsAggregate()->setPragmaTable(parseContext.contextPragma.pragmaTable); + + // Set currentFunctionType to empty pointer when goes outside of the function + parseContext.currentFunctionType = nullptr; + + // For ES 100 only, according to ES shading language 100 spec: A function + // body has a scope nested inside the function's definition. + if (parseContext.profile == EEsProfile && parseContext.version == 100) + { + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + --parseContext.statementNestingLevel; + } + } + ; + +attribute + : LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET { + $$ = $3; + } + +attribute_list + : single_attribute { + $$ = $1; + } + | attribute_list COMMA single_attribute { + $$ = parseContext.mergeAttributes($1, $3); + } + +single_attribute + : IDENTIFIER { + $$ = parseContext.makeAttributes(*$1.string); + } + | IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN { + $$ = parseContext.makeAttributes(*$1.string, $3); + } + +spirv_requirements_list + : spirv_requirements_parameter { + $$ = $1; + } + | spirv_requirements_list COMMA spirv_requirements_parameter { + $$ = parseContext.mergeSpirvRequirements($2.loc, $1, $3); + } + +spirv_requirements_parameter + : IDENTIFIER EQUAL LEFT_BRACKET spirv_extension_list RIGHT_BRACKET { + $$ = parseContext.makeSpirvRequirement($2.loc, *$1.string, $4->getAsAggregate(), nullptr); + } + | IDENTIFIER EQUAL LEFT_BRACKET spirv_capability_list RIGHT_BRACKET { + $$ = parseContext.makeSpirvRequirement($2.loc, *$1.string, nullptr, $4->getAsAggregate()); + } + +spirv_extension_list + : STRING_LITERAL { + $$ = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion($1.string, $1.loc, true)); + } + | spirv_extension_list COMMA STRING_LITERAL { + $$ = parseContext.intermediate.growAggregate($1, parseContext.intermediate.addConstantUnion($3.string, $3.loc, true)); + } + +spirv_capability_list + : INTCONSTANT { + $$ = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion($1.i, $1.loc, true)); + } + | spirv_capability_list COMMA INTCONSTANT { + $$ = parseContext.intermediate.growAggregate($1, parseContext.intermediate.addConstantUnion($3.i, $3.loc, true)); + } + +spirv_execution_mode_qualifier + : SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT RIGHT_PAREN { + parseContext.intermediate.insertSpirvExecutionMode($3.i); + $$ = 0; + } + | SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN { + parseContext.intermediate.insertSpirvRequirement($3); + parseContext.intermediate.insertSpirvExecutionMode($5.i); + $$ = 0; + } + | SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN { + parseContext.intermediate.insertSpirvExecutionMode($3.i, $5->getAsAggregate()); + $$ = 0; + } + | SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN { + parseContext.intermediate.insertSpirvRequirement($3); + parseContext.intermediate.insertSpirvExecutionMode($5.i, $7->getAsAggregate()); + $$ = 0; + } + | SPIRV_EXECUTION_MODE_ID LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN { + parseContext.intermediate.insertSpirvExecutionModeId($3.i, $5->getAsAggregate()); + $$ = 0; + } + | SPIRV_EXECUTION_MODE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN { + parseContext.intermediate.insertSpirvRequirement($3); + parseContext.intermediate.insertSpirvExecutionModeId($5.i, $7->getAsAggregate()); + $$ = 0; + } + +spirv_execution_mode_parameter_list + : spirv_execution_mode_parameter { + $$ = parseContext.intermediate.makeAggregate($1); + } + | spirv_execution_mode_parameter_list COMMA spirv_execution_mode_parameter { + $$ = parseContext.intermediate.growAggregate($1, $3); + } + +spirv_execution_mode_parameter + : FLOATCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true); + } + | INTCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true); + } + | UINTCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true); + } + | BOOLCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true); + } + | STRING_LITERAL { + $$ = parseContext.intermediate.addConstantUnion($1.string, $1.loc, true); + } + +spirv_execution_mode_id_parameter_list + : constant_expression { + if ($1->getBasicType() != EbtFloat && + $1->getBasicType() != EbtInt && + $1->getBasicType() != EbtUint && + $1->getBasicType() != EbtBool && + $1->getBasicType() != EbtString) + parseContext.error($1->getLoc(), "this type not allowed", $1->getType().getBasicString(), ""); + $$ = parseContext.intermediate.makeAggregate($1); + } + | spirv_execution_mode_id_parameter_list COMMA constant_expression { + if ($3->getBasicType() != EbtFloat && + $3->getBasicType() != EbtInt && + $3->getBasicType() != EbtUint && + $3->getBasicType() != EbtBool && + $3->getBasicType() != EbtString) + parseContext.error($3->getLoc(), "this type not allowed", $3->getType().getBasicString(), ""); + $$ = parseContext.intermediate.growAggregate($1, $3); + } + +spirv_storage_class_qualifier + : SPIRV_STORAGE_CLASS LEFT_PAREN INTCONSTANT RIGHT_PAREN { + $$.init($1.loc); + $$.qualifier.storage = EvqSpirvStorageClass; + $$.qualifier.spirvStorageClass = $3.i; + } + | SPIRV_STORAGE_CLASS LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN { + $$.init($1.loc); + parseContext.intermediate.insertSpirvRequirement($3); + $$.qualifier.storage = EvqSpirvStorageClass; + $$.qualifier.spirvStorageClass = $5.i; + } + +spirv_decorate_qualifier + : SPIRV_DECORATE LEFT_PAREN INTCONSTANT RIGHT_PAREN{ + $$.init($1.loc); + $$.qualifier.setSpirvDecorate($3.i); + } + | SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN{ + $$.init($1.loc); + parseContext.intermediate.insertSpirvRequirement($3); + $$.qualifier.setSpirvDecorate($5.i); + } + | SPIRV_DECORATE LEFT_PAREN INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN { + $$.init($1.loc); + $$.qualifier.setSpirvDecorate($3.i, $5->getAsAggregate()); + } + | SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN { + $$.init($1.loc); + parseContext.intermediate.insertSpirvRequirement($3); + $$.qualifier.setSpirvDecorate($5.i, $7->getAsAggregate()); + } + | SPIRV_DECORATE_ID LEFT_PAREN INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN { + $$.init($1.loc); + $$.qualifier.setSpirvDecorateId($3.i, $5->getAsAggregate()); + } + | SPIRV_DECORATE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN { + $$.init($1.loc); + parseContext.intermediate.insertSpirvRequirement($3); + $$.qualifier.setSpirvDecorateId($5.i, $7->getAsAggregate()); + } + | SPIRV_DECORATE_STRING LEFT_PAREN INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN { + $$.init($1.loc); + $$.qualifier.setSpirvDecorateString($3.i, $5->getAsAggregate()); + } + | SPIRV_DECORATE_STRING LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN { + $$.init($1.loc); + parseContext.intermediate.insertSpirvRequirement($3); + $$.qualifier.setSpirvDecorateString($5.i, $7->getAsAggregate()); + } + +spirv_decorate_parameter_list + : spirv_decorate_parameter { + $$ = parseContext.intermediate.makeAggregate($1); + } + | spirv_decorate_parameter_list COMMA spirv_decorate_parameter { + $$ = parseContext.intermediate.growAggregate($1, $3); + } + +spirv_decorate_parameter + : FLOATCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true); + } + | INTCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true); + } + | UINTCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true); + } + | BOOLCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true); + } + +spirv_decorate_id_parameter_list + : spirv_decorate_id_parameter { + $$ = parseContext.intermediate.makeAggregate($1); + } + | spirv_decorate_id_parameter_list COMMA spirv_decorate_id_parameter { + $$ = parseContext.intermediate.growAggregate($1, $3); + } + +spirv_decorate_id_parameter + : variable_identifier { + if ($1->getAsConstantUnion() || $1->getAsSymbolNode()) + $$ = $1; + else + parseContext.error($1->getLoc(), "only allow constants or variables which are not elements of a composite", "", ""); + } + | FLOATCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true); + } + | INTCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true); + } + | UINTCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true); + } + | BOOLCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true); + } + +spirv_decorate_string_parameter_list + : STRING_LITERAL { + $$ = parseContext.intermediate.makeAggregate( + parseContext.intermediate.addConstantUnion($1.string, $1.loc, true)); + } + | spirv_decorate_string_parameter_list COMMA STRING_LITERAL { + $$ = parseContext.intermediate.growAggregate($1, parseContext.intermediate.addConstantUnion($3.string, $3.loc, true)); + } + +spirv_type_specifier + : SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.setSpirvType(*$3, $5); + } + | SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.intermediate.insertSpirvRequirement($3); + $$.setSpirvType(*$5, $7); + } + | SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.setSpirvType(*$3); + } + | SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.intermediate.insertSpirvRequirement($3); + $$.setSpirvType(*$5); + } + +spirv_type_parameter_list + : spirv_type_parameter { + $$ = $1; + } + | spirv_type_parameter_list COMMA spirv_type_parameter { + $$ = parseContext.mergeSpirvTypeParameters($1, $3); + } + +spirv_type_parameter + : constant_expression { + $$ = parseContext.makeSpirvTypeParameters($1->getLoc(), $1->getAsConstantUnion()); + } + | type_specifier_nonarray { + $$ = parseContext.makeSpirvTypeParameters($1.loc, $1); + } + +spirv_instruction_qualifier + : SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN { + $$ = $3; + } + | SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN { + parseContext.intermediate.insertSpirvRequirement($3); + $$ = $5; + } + +spirv_instruction_qualifier_list + : spirv_instruction_qualifier_id { + $$ = $1; + } + | spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id { + $$ = parseContext.mergeSpirvInstruction($2.loc, $1, $3); + } + +spirv_instruction_qualifier_id + : IDENTIFIER EQUAL STRING_LITERAL { + $$ = parseContext.makeSpirvInstruction($2.loc, *$1.string, *$3.string); + } + | IDENTIFIER EQUAL INTCONSTANT { + $$ = parseContext.makeSpirvInstruction($2.loc, *$1.string, $3.i); + } + +%% diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp new file mode 100644 index 0000000000..bd5e7a2ecd --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp @@ -0,0 +1,13163 @@ +/* A Bison parser, made by GNU Bison 3.8.2. */ + +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output, and Bison version. */ +#define YYBISON 30802 + +/* Bison version string. */ +#define YYBISON_VERSION "3.8.2" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 1 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + + + + +/* First part of user prologue. */ +#line 44 "MachineIndependent/glslang.y" + + +/* Based on: +ANSI C Yacc grammar + +In 1985, Jeff Lee published his Yacc grammar (which is accompanied by a +matching Lex specification) for the April 30, 1985 draft version of the +ANSI C standard. Tom Stockfisch reposted it to net.sources in 1987; that +original, as mentioned in the answer to question 17.25 of the comp.lang.c +FAQ, can be ftp'ed from ftp.uu.net, file usenet/net.sources/ansi.c.grammar.Z. + +I intend to keep this version as close to the current C Standard grammar as +possible; please let me know if you discover discrepancies. + +Jutta Degener, 1995 +*/ + +#include "SymbolTable.h" +#include "ParseHelper.h" +#include "../Public/ShaderLang.h" +#include "attribute.h" + +using namespace QtShaderTools; +using namespace glslang; + +#line 97 "MachineIndependent/glslang_tab.cpp" + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +#include "glslang_tab.cpp.h" +/* Symbol kind. */ +enum yysymbol_kind_t +{ + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_CONST = 3, /* CONST */ + YYSYMBOL_BOOL = 4, /* BOOL */ + YYSYMBOL_INT = 5, /* INT */ + YYSYMBOL_UINT = 6, /* UINT */ + YYSYMBOL_FLOAT = 7, /* FLOAT */ + YYSYMBOL_BVEC2 = 8, /* BVEC2 */ + YYSYMBOL_BVEC3 = 9, /* BVEC3 */ + YYSYMBOL_BVEC4 = 10, /* BVEC4 */ + YYSYMBOL_IVEC2 = 11, /* IVEC2 */ + YYSYMBOL_IVEC3 = 12, /* IVEC3 */ + YYSYMBOL_IVEC4 = 13, /* IVEC4 */ + YYSYMBOL_UVEC2 = 14, /* UVEC2 */ + YYSYMBOL_UVEC3 = 15, /* UVEC3 */ + YYSYMBOL_UVEC4 = 16, /* UVEC4 */ + YYSYMBOL_VEC2 = 17, /* VEC2 */ + YYSYMBOL_VEC3 = 18, /* VEC3 */ + YYSYMBOL_VEC4 = 19, /* VEC4 */ + YYSYMBOL_MAT2 = 20, /* MAT2 */ + YYSYMBOL_MAT3 = 21, /* MAT3 */ + YYSYMBOL_MAT4 = 22, /* MAT4 */ + YYSYMBOL_MAT2X2 = 23, /* MAT2X2 */ + YYSYMBOL_MAT2X3 = 24, /* MAT2X3 */ + YYSYMBOL_MAT2X4 = 25, /* MAT2X4 */ + YYSYMBOL_MAT3X2 = 26, /* MAT3X2 */ + YYSYMBOL_MAT3X3 = 27, /* MAT3X3 */ + YYSYMBOL_MAT3X4 = 28, /* MAT3X4 */ + YYSYMBOL_MAT4X2 = 29, /* MAT4X2 */ + YYSYMBOL_MAT4X3 = 30, /* MAT4X3 */ + YYSYMBOL_MAT4X4 = 31, /* MAT4X4 */ + YYSYMBOL_SAMPLER2D = 32, /* SAMPLER2D */ + YYSYMBOL_SAMPLER3D = 33, /* SAMPLER3D */ + YYSYMBOL_SAMPLERCUBE = 34, /* SAMPLERCUBE */ + YYSYMBOL_SAMPLER2DSHADOW = 35, /* SAMPLER2DSHADOW */ + YYSYMBOL_SAMPLERCUBESHADOW = 36, /* SAMPLERCUBESHADOW */ + YYSYMBOL_SAMPLER2DARRAY = 37, /* SAMPLER2DARRAY */ + YYSYMBOL_SAMPLER2DARRAYSHADOW = 38, /* SAMPLER2DARRAYSHADOW */ + YYSYMBOL_ISAMPLER2D = 39, /* ISAMPLER2D */ + YYSYMBOL_ISAMPLER3D = 40, /* ISAMPLER3D */ + YYSYMBOL_ISAMPLERCUBE = 41, /* ISAMPLERCUBE */ + YYSYMBOL_ISAMPLER2DARRAY = 42, /* ISAMPLER2DARRAY */ + YYSYMBOL_USAMPLER2D = 43, /* USAMPLER2D */ + YYSYMBOL_USAMPLER3D = 44, /* USAMPLER3D */ + YYSYMBOL_USAMPLERCUBE = 45, /* USAMPLERCUBE */ + YYSYMBOL_USAMPLER2DARRAY = 46, /* USAMPLER2DARRAY */ + YYSYMBOL_SAMPLER = 47, /* SAMPLER */ + YYSYMBOL_SAMPLERSHADOW = 48, /* SAMPLERSHADOW */ + YYSYMBOL_TEXTURE2D = 49, /* TEXTURE2D */ + YYSYMBOL_TEXTURE3D = 50, /* TEXTURE3D */ + YYSYMBOL_TEXTURECUBE = 51, /* TEXTURECUBE */ + YYSYMBOL_TEXTURE2DARRAY = 52, /* TEXTURE2DARRAY */ + YYSYMBOL_ITEXTURE2D = 53, /* ITEXTURE2D */ + YYSYMBOL_ITEXTURE3D = 54, /* ITEXTURE3D */ + YYSYMBOL_ITEXTURECUBE = 55, /* ITEXTURECUBE */ + YYSYMBOL_ITEXTURE2DARRAY = 56, /* ITEXTURE2DARRAY */ + YYSYMBOL_UTEXTURE2D = 57, /* UTEXTURE2D */ + YYSYMBOL_UTEXTURE3D = 58, /* UTEXTURE3D */ + YYSYMBOL_UTEXTURECUBE = 59, /* UTEXTURECUBE */ + YYSYMBOL_UTEXTURE2DARRAY = 60, /* UTEXTURE2DARRAY */ + YYSYMBOL_ATTRIBUTE = 61, /* ATTRIBUTE */ + YYSYMBOL_VARYING = 62, /* VARYING */ + YYSYMBOL_FLOATE5M2_T = 63, /* FLOATE5M2_T */ + YYSYMBOL_FLOATE4M3_T = 64, /* FLOATE4M3_T */ + YYSYMBOL_BFLOAT16_T = 65, /* BFLOAT16_T */ + YYSYMBOL_FLOAT16_T = 66, /* FLOAT16_T */ + YYSYMBOL_FLOAT32_T = 67, /* FLOAT32_T */ + YYSYMBOL_DOUBLE = 68, /* DOUBLE */ + YYSYMBOL_FLOAT64_T = 69, /* FLOAT64_T */ + YYSYMBOL_INT64_T = 70, /* INT64_T */ + YYSYMBOL_UINT64_T = 71, /* UINT64_T */ + YYSYMBOL_INT32_T = 72, /* INT32_T */ + YYSYMBOL_UINT32_T = 73, /* UINT32_T */ + YYSYMBOL_INT16_T = 74, /* INT16_T */ + YYSYMBOL_UINT16_T = 75, /* UINT16_T */ + YYSYMBOL_INT8_T = 76, /* INT8_T */ + YYSYMBOL_UINT8_T = 77, /* UINT8_T */ + YYSYMBOL_I64VEC2 = 78, /* I64VEC2 */ + YYSYMBOL_I64VEC3 = 79, /* I64VEC3 */ + YYSYMBOL_I64VEC4 = 80, /* I64VEC4 */ + YYSYMBOL_U64VEC2 = 81, /* U64VEC2 */ + YYSYMBOL_U64VEC3 = 82, /* U64VEC3 */ + YYSYMBOL_U64VEC4 = 83, /* U64VEC4 */ + YYSYMBOL_I32VEC2 = 84, /* I32VEC2 */ + YYSYMBOL_I32VEC3 = 85, /* I32VEC3 */ + YYSYMBOL_I32VEC4 = 86, /* I32VEC4 */ + YYSYMBOL_U32VEC2 = 87, /* U32VEC2 */ + YYSYMBOL_U32VEC3 = 88, /* U32VEC3 */ + YYSYMBOL_U32VEC4 = 89, /* U32VEC4 */ + YYSYMBOL_I16VEC2 = 90, /* I16VEC2 */ + YYSYMBOL_I16VEC3 = 91, /* I16VEC3 */ + YYSYMBOL_I16VEC4 = 92, /* I16VEC4 */ + YYSYMBOL_U16VEC2 = 93, /* U16VEC2 */ + YYSYMBOL_U16VEC3 = 94, /* U16VEC3 */ + YYSYMBOL_U16VEC4 = 95, /* U16VEC4 */ + YYSYMBOL_I8VEC2 = 96, /* I8VEC2 */ + YYSYMBOL_I8VEC3 = 97, /* I8VEC3 */ + YYSYMBOL_I8VEC4 = 98, /* I8VEC4 */ + YYSYMBOL_U8VEC2 = 99, /* U8VEC2 */ + YYSYMBOL_U8VEC3 = 100, /* U8VEC3 */ + YYSYMBOL_U8VEC4 = 101, /* U8VEC4 */ + YYSYMBOL_DVEC2 = 102, /* DVEC2 */ + YYSYMBOL_DVEC3 = 103, /* DVEC3 */ + YYSYMBOL_DVEC4 = 104, /* DVEC4 */ + YYSYMBOL_DMAT2 = 105, /* DMAT2 */ + YYSYMBOL_DMAT3 = 106, /* DMAT3 */ + YYSYMBOL_DMAT4 = 107, /* DMAT4 */ + YYSYMBOL_BF16VEC2 = 108, /* BF16VEC2 */ + YYSYMBOL_BF16VEC3 = 109, /* BF16VEC3 */ + YYSYMBOL_BF16VEC4 = 110, /* BF16VEC4 */ + YYSYMBOL_FE5M2VEC2 = 111, /* FE5M2VEC2 */ + YYSYMBOL_FE5M2VEC3 = 112, /* FE5M2VEC3 */ + YYSYMBOL_FE5M2VEC4 = 113, /* FE5M2VEC4 */ + YYSYMBOL_FE4M3VEC2 = 114, /* FE4M3VEC2 */ + YYSYMBOL_FE4M3VEC3 = 115, /* FE4M3VEC3 */ + YYSYMBOL_FE4M3VEC4 = 116, /* FE4M3VEC4 */ + YYSYMBOL_F16VEC2 = 117, /* F16VEC2 */ + YYSYMBOL_F16VEC3 = 118, /* F16VEC3 */ + YYSYMBOL_F16VEC4 = 119, /* F16VEC4 */ + YYSYMBOL_F16MAT2 = 120, /* F16MAT2 */ + YYSYMBOL_F16MAT3 = 121, /* F16MAT3 */ + YYSYMBOL_F16MAT4 = 122, /* F16MAT4 */ + YYSYMBOL_F32VEC2 = 123, /* F32VEC2 */ + YYSYMBOL_F32VEC3 = 124, /* F32VEC3 */ + YYSYMBOL_F32VEC4 = 125, /* F32VEC4 */ + YYSYMBOL_F32MAT2 = 126, /* F32MAT2 */ + YYSYMBOL_F32MAT3 = 127, /* F32MAT3 */ + YYSYMBOL_F32MAT4 = 128, /* F32MAT4 */ + YYSYMBOL_F64VEC2 = 129, /* F64VEC2 */ + YYSYMBOL_F64VEC3 = 130, /* F64VEC3 */ + YYSYMBOL_F64VEC4 = 131, /* F64VEC4 */ + YYSYMBOL_F64MAT2 = 132, /* F64MAT2 */ + YYSYMBOL_F64MAT3 = 133, /* F64MAT3 */ + YYSYMBOL_F64MAT4 = 134, /* F64MAT4 */ + YYSYMBOL_DMAT2X2 = 135, /* DMAT2X2 */ + YYSYMBOL_DMAT2X3 = 136, /* DMAT2X3 */ + YYSYMBOL_DMAT2X4 = 137, /* DMAT2X4 */ + YYSYMBOL_DMAT3X2 = 138, /* DMAT3X2 */ + YYSYMBOL_DMAT3X3 = 139, /* DMAT3X3 */ + YYSYMBOL_DMAT3X4 = 140, /* DMAT3X4 */ + YYSYMBOL_DMAT4X2 = 141, /* DMAT4X2 */ + YYSYMBOL_DMAT4X3 = 142, /* DMAT4X3 */ + YYSYMBOL_DMAT4X4 = 143, /* DMAT4X4 */ + YYSYMBOL_F16MAT2X2 = 144, /* F16MAT2X2 */ + YYSYMBOL_F16MAT2X3 = 145, /* F16MAT2X3 */ + YYSYMBOL_F16MAT2X4 = 146, /* F16MAT2X4 */ + YYSYMBOL_F16MAT3X2 = 147, /* F16MAT3X2 */ + YYSYMBOL_F16MAT3X3 = 148, /* F16MAT3X3 */ + YYSYMBOL_F16MAT3X4 = 149, /* F16MAT3X4 */ + YYSYMBOL_F16MAT4X2 = 150, /* F16MAT4X2 */ + YYSYMBOL_F16MAT4X3 = 151, /* F16MAT4X3 */ + YYSYMBOL_F16MAT4X4 = 152, /* F16MAT4X4 */ + YYSYMBOL_F32MAT2X2 = 153, /* F32MAT2X2 */ + YYSYMBOL_F32MAT2X3 = 154, /* F32MAT2X3 */ + YYSYMBOL_F32MAT2X4 = 155, /* F32MAT2X4 */ + YYSYMBOL_F32MAT3X2 = 156, /* F32MAT3X2 */ + YYSYMBOL_F32MAT3X3 = 157, /* F32MAT3X3 */ + YYSYMBOL_F32MAT3X4 = 158, /* F32MAT3X4 */ + YYSYMBOL_F32MAT4X2 = 159, /* F32MAT4X2 */ + YYSYMBOL_F32MAT4X3 = 160, /* F32MAT4X3 */ + YYSYMBOL_F32MAT4X4 = 161, /* F32MAT4X4 */ + YYSYMBOL_F64MAT2X2 = 162, /* F64MAT2X2 */ + YYSYMBOL_F64MAT2X3 = 163, /* F64MAT2X3 */ + YYSYMBOL_F64MAT2X4 = 164, /* F64MAT2X4 */ + YYSYMBOL_F64MAT3X2 = 165, /* F64MAT3X2 */ + YYSYMBOL_F64MAT3X3 = 166, /* F64MAT3X3 */ + YYSYMBOL_F64MAT3X4 = 167, /* F64MAT3X4 */ + YYSYMBOL_F64MAT4X2 = 168, /* F64MAT4X2 */ + YYSYMBOL_F64MAT4X3 = 169, /* F64MAT4X3 */ + YYSYMBOL_F64MAT4X4 = 170, /* F64MAT4X4 */ + YYSYMBOL_ATOMIC_UINT = 171, /* ATOMIC_UINT */ + YYSYMBOL_ACCSTRUCTNV = 172, /* ACCSTRUCTNV */ + YYSYMBOL_ACCSTRUCTEXT = 173, /* ACCSTRUCTEXT */ + YYSYMBOL_RAYQUERYEXT = 174, /* RAYQUERYEXT */ + YYSYMBOL_FCOOPMATNV = 175, /* FCOOPMATNV */ + YYSYMBOL_ICOOPMATNV = 176, /* ICOOPMATNV */ + YYSYMBOL_UCOOPMATNV = 177, /* UCOOPMATNV */ + YYSYMBOL_COOPMAT = 178, /* COOPMAT */ + YYSYMBOL_COOPVECNV = 179, /* COOPVECNV */ + YYSYMBOL_HITOBJECTNV = 180, /* HITOBJECTNV */ + YYSYMBOL_HITOBJECTATTRNV = 181, /* HITOBJECTATTRNV */ + YYSYMBOL_HITOBJECTEXT = 182, /* HITOBJECTEXT */ + YYSYMBOL_HITOBJECTATTREXT = 183, /* HITOBJECTATTREXT */ + YYSYMBOL_TENSORLAYOUTNV = 184, /* TENSORLAYOUTNV */ + YYSYMBOL_TENSORVIEWNV = 185, /* TENSORVIEWNV */ + YYSYMBOL_TENSORARM = 186, /* TENSORARM */ + YYSYMBOL_SAMPLERCUBEARRAY = 187, /* SAMPLERCUBEARRAY */ + YYSYMBOL_SAMPLERCUBEARRAYSHADOW = 188, /* SAMPLERCUBEARRAYSHADOW */ + YYSYMBOL_ISAMPLERCUBEARRAY = 189, /* ISAMPLERCUBEARRAY */ + YYSYMBOL_USAMPLERCUBEARRAY = 190, /* USAMPLERCUBEARRAY */ + YYSYMBOL_SAMPLER1D = 191, /* SAMPLER1D */ + YYSYMBOL_SAMPLER1DARRAY = 192, /* SAMPLER1DARRAY */ + YYSYMBOL_SAMPLER1DARRAYSHADOW = 193, /* SAMPLER1DARRAYSHADOW */ + YYSYMBOL_ISAMPLER1D = 194, /* ISAMPLER1D */ + YYSYMBOL_SAMPLER1DSHADOW = 195, /* SAMPLER1DSHADOW */ + YYSYMBOL_SAMPLER2DRECT = 196, /* SAMPLER2DRECT */ + YYSYMBOL_SAMPLER2DRECTSHADOW = 197, /* SAMPLER2DRECTSHADOW */ + YYSYMBOL_ISAMPLER2DRECT = 198, /* ISAMPLER2DRECT */ + YYSYMBOL_USAMPLER2DRECT = 199, /* USAMPLER2DRECT */ + YYSYMBOL_SAMPLERBUFFER = 200, /* SAMPLERBUFFER */ + YYSYMBOL_ISAMPLERBUFFER = 201, /* ISAMPLERBUFFER */ + YYSYMBOL_USAMPLERBUFFER = 202, /* USAMPLERBUFFER */ + YYSYMBOL_SAMPLER2DMS = 203, /* SAMPLER2DMS */ + YYSYMBOL_ISAMPLER2DMS = 204, /* ISAMPLER2DMS */ + YYSYMBOL_USAMPLER2DMS = 205, /* USAMPLER2DMS */ + YYSYMBOL_SAMPLER2DMSARRAY = 206, /* SAMPLER2DMSARRAY */ + YYSYMBOL_ISAMPLER2DMSARRAY = 207, /* ISAMPLER2DMSARRAY */ + YYSYMBOL_USAMPLER2DMSARRAY = 208, /* USAMPLER2DMSARRAY */ + YYSYMBOL_SAMPLEREXTERNALOES = 209, /* SAMPLEREXTERNALOES */ + YYSYMBOL_SAMPLEREXTERNAL2DY2YEXT = 210, /* SAMPLEREXTERNAL2DY2YEXT */ + YYSYMBOL_ISAMPLER1DARRAY = 211, /* ISAMPLER1DARRAY */ + YYSYMBOL_USAMPLER1D = 212, /* USAMPLER1D */ + YYSYMBOL_USAMPLER1DARRAY = 213, /* USAMPLER1DARRAY */ + YYSYMBOL_F16SAMPLER1D = 214, /* F16SAMPLER1D */ + YYSYMBOL_F16SAMPLER2D = 215, /* F16SAMPLER2D */ + YYSYMBOL_F16SAMPLER3D = 216, /* F16SAMPLER3D */ + YYSYMBOL_F16SAMPLER2DRECT = 217, /* F16SAMPLER2DRECT */ + YYSYMBOL_F16SAMPLERCUBE = 218, /* F16SAMPLERCUBE */ + YYSYMBOL_F16SAMPLER1DARRAY = 219, /* F16SAMPLER1DARRAY */ + YYSYMBOL_F16SAMPLER2DARRAY = 220, /* F16SAMPLER2DARRAY */ + YYSYMBOL_F16SAMPLERCUBEARRAY = 221, /* F16SAMPLERCUBEARRAY */ + YYSYMBOL_F16SAMPLERBUFFER = 222, /* F16SAMPLERBUFFER */ + YYSYMBOL_F16SAMPLER2DMS = 223, /* F16SAMPLER2DMS */ + YYSYMBOL_F16SAMPLER2DMSARRAY = 224, /* F16SAMPLER2DMSARRAY */ + YYSYMBOL_F16SAMPLER1DSHADOW = 225, /* F16SAMPLER1DSHADOW */ + YYSYMBOL_F16SAMPLER2DSHADOW = 226, /* F16SAMPLER2DSHADOW */ + YYSYMBOL_F16SAMPLER1DARRAYSHADOW = 227, /* F16SAMPLER1DARRAYSHADOW */ + YYSYMBOL_F16SAMPLER2DARRAYSHADOW = 228, /* F16SAMPLER2DARRAYSHADOW */ + YYSYMBOL_F16SAMPLER2DRECTSHADOW = 229, /* F16SAMPLER2DRECTSHADOW */ + YYSYMBOL_F16SAMPLERCUBESHADOW = 230, /* F16SAMPLERCUBESHADOW */ + YYSYMBOL_F16SAMPLERCUBEARRAYSHADOW = 231, /* F16SAMPLERCUBEARRAYSHADOW */ + YYSYMBOL_IMAGE1D = 232, /* IMAGE1D */ + YYSYMBOL_IIMAGE1D = 233, /* IIMAGE1D */ + YYSYMBOL_UIMAGE1D = 234, /* UIMAGE1D */ + YYSYMBOL_IMAGE2D = 235, /* IMAGE2D */ + YYSYMBOL_IIMAGE2D = 236, /* IIMAGE2D */ + YYSYMBOL_UIMAGE2D = 237, /* UIMAGE2D */ + YYSYMBOL_IMAGE3D = 238, /* IMAGE3D */ + YYSYMBOL_IIMAGE3D = 239, /* IIMAGE3D */ + YYSYMBOL_UIMAGE3D = 240, /* UIMAGE3D */ + YYSYMBOL_IMAGE2DRECT = 241, /* IMAGE2DRECT */ + YYSYMBOL_IIMAGE2DRECT = 242, /* IIMAGE2DRECT */ + YYSYMBOL_UIMAGE2DRECT = 243, /* UIMAGE2DRECT */ + YYSYMBOL_IMAGECUBE = 244, /* IMAGECUBE */ + YYSYMBOL_IIMAGECUBE = 245, /* IIMAGECUBE */ + YYSYMBOL_UIMAGECUBE = 246, /* UIMAGECUBE */ + YYSYMBOL_IMAGEBUFFER = 247, /* IMAGEBUFFER */ + YYSYMBOL_IIMAGEBUFFER = 248, /* IIMAGEBUFFER */ + YYSYMBOL_UIMAGEBUFFER = 249, /* UIMAGEBUFFER */ + YYSYMBOL_IMAGE1DARRAY = 250, /* IMAGE1DARRAY */ + YYSYMBOL_IIMAGE1DARRAY = 251, /* IIMAGE1DARRAY */ + YYSYMBOL_UIMAGE1DARRAY = 252, /* UIMAGE1DARRAY */ + YYSYMBOL_IMAGE2DARRAY = 253, /* IMAGE2DARRAY */ + YYSYMBOL_IIMAGE2DARRAY = 254, /* IIMAGE2DARRAY */ + YYSYMBOL_UIMAGE2DARRAY = 255, /* UIMAGE2DARRAY */ + YYSYMBOL_IMAGECUBEARRAY = 256, /* IMAGECUBEARRAY */ + YYSYMBOL_IIMAGECUBEARRAY = 257, /* IIMAGECUBEARRAY */ + YYSYMBOL_UIMAGECUBEARRAY = 258, /* UIMAGECUBEARRAY */ + YYSYMBOL_IMAGE2DMS = 259, /* IMAGE2DMS */ + YYSYMBOL_IIMAGE2DMS = 260, /* IIMAGE2DMS */ + YYSYMBOL_UIMAGE2DMS = 261, /* UIMAGE2DMS */ + YYSYMBOL_IMAGE2DMSARRAY = 262, /* IMAGE2DMSARRAY */ + YYSYMBOL_IIMAGE2DMSARRAY = 263, /* IIMAGE2DMSARRAY */ + YYSYMBOL_UIMAGE2DMSARRAY = 264, /* UIMAGE2DMSARRAY */ + YYSYMBOL_F16IMAGE1D = 265, /* F16IMAGE1D */ + YYSYMBOL_F16IMAGE2D = 266, /* F16IMAGE2D */ + YYSYMBOL_F16IMAGE3D = 267, /* F16IMAGE3D */ + YYSYMBOL_F16IMAGE2DRECT = 268, /* F16IMAGE2DRECT */ + YYSYMBOL_F16IMAGECUBE = 269, /* F16IMAGECUBE */ + YYSYMBOL_F16IMAGE1DARRAY = 270, /* F16IMAGE1DARRAY */ + YYSYMBOL_F16IMAGE2DARRAY = 271, /* F16IMAGE2DARRAY */ + YYSYMBOL_F16IMAGECUBEARRAY = 272, /* F16IMAGECUBEARRAY */ + YYSYMBOL_F16IMAGEBUFFER = 273, /* F16IMAGEBUFFER */ + YYSYMBOL_F16IMAGE2DMS = 274, /* F16IMAGE2DMS */ + YYSYMBOL_F16IMAGE2DMSARRAY = 275, /* F16IMAGE2DMSARRAY */ + YYSYMBOL_I64IMAGE1D = 276, /* I64IMAGE1D */ + YYSYMBOL_U64IMAGE1D = 277, /* U64IMAGE1D */ + YYSYMBOL_I64IMAGE2D = 278, /* I64IMAGE2D */ + YYSYMBOL_U64IMAGE2D = 279, /* U64IMAGE2D */ + YYSYMBOL_I64IMAGE3D = 280, /* I64IMAGE3D */ + YYSYMBOL_U64IMAGE3D = 281, /* U64IMAGE3D */ + YYSYMBOL_I64IMAGE2DRECT = 282, /* I64IMAGE2DRECT */ + YYSYMBOL_U64IMAGE2DRECT = 283, /* U64IMAGE2DRECT */ + YYSYMBOL_I64IMAGECUBE = 284, /* I64IMAGECUBE */ + YYSYMBOL_U64IMAGECUBE = 285, /* U64IMAGECUBE */ + YYSYMBOL_I64IMAGEBUFFER = 286, /* I64IMAGEBUFFER */ + YYSYMBOL_U64IMAGEBUFFER = 287, /* U64IMAGEBUFFER */ + YYSYMBOL_I64IMAGE1DARRAY = 288, /* I64IMAGE1DARRAY */ + YYSYMBOL_U64IMAGE1DARRAY = 289, /* U64IMAGE1DARRAY */ + YYSYMBOL_I64IMAGE2DARRAY = 290, /* I64IMAGE2DARRAY */ + YYSYMBOL_U64IMAGE2DARRAY = 291, /* U64IMAGE2DARRAY */ + YYSYMBOL_I64IMAGECUBEARRAY = 292, /* I64IMAGECUBEARRAY */ + YYSYMBOL_U64IMAGECUBEARRAY = 293, /* U64IMAGECUBEARRAY */ + YYSYMBOL_I64IMAGE2DMS = 294, /* I64IMAGE2DMS */ + YYSYMBOL_U64IMAGE2DMS = 295, /* U64IMAGE2DMS */ + YYSYMBOL_I64IMAGE2DMSARRAY = 296, /* I64IMAGE2DMSARRAY */ + YYSYMBOL_U64IMAGE2DMSARRAY = 297, /* U64IMAGE2DMSARRAY */ + YYSYMBOL_TEXTURECUBEARRAY = 298, /* TEXTURECUBEARRAY */ + YYSYMBOL_ITEXTURECUBEARRAY = 299, /* ITEXTURECUBEARRAY */ + YYSYMBOL_UTEXTURECUBEARRAY = 300, /* UTEXTURECUBEARRAY */ + YYSYMBOL_TEXTURE1D = 301, /* TEXTURE1D */ + YYSYMBOL_ITEXTURE1D = 302, /* ITEXTURE1D */ + YYSYMBOL_UTEXTURE1D = 303, /* UTEXTURE1D */ + YYSYMBOL_TEXTURE1DARRAY = 304, /* TEXTURE1DARRAY */ + YYSYMBOL_ITEXTURE1DARRAY = 305, /* ITEXTURE1DARRAY */ + YYSYMBOL_UTEXTURE1DARRAY = 306, /* UTEXTURE1DARRAY */ + YYSYMBOL_TEXTURE2DRECT = 307, /* TEXTURE2DRECT */ + YYSYMBOL_ITEXTURE2DRECT = 308, /* ITEXTURE2DRECT */ + YYSYMBOL_UTEXTURE2DRECT = 309, /* UTEXTURE2DRECT */ + YYSYMBOL_TEXTUREBUFFER = 310, /* TEXTUREBUFFER */ + YYSYMBOL_ITEXTUREBUFFER = 311, /* ITEXTUREBUFFER */ + YYSYMBOL_UTEXTUREBUFFER = 312, /* UTEXTUREBUFFER */ + YYSYMBOL_TEXTURE2DMS = 313, /* TEXTURE2DMS */ + YYSYMBOL_ITEXTURE2DMS = 314, /* ITEXTURE2DMS */ + YYSYMBOL_UTEXTURE2DMS = 315, /* UTEXTURE2DMS */ + YYSYMBOL_TEXTURE2DMSARRAY = 316, /* TEXTURE2DMSARRAY */ + YYSYMBOL_ITEXTURE2DMSARRAY = 317, /* ITEXTURE2DMSARRAY */ + YYSYMBOL_UTEXTURE2DMSARRAY = 318, /* UTEXTURE2DMSARRAY */ + YYSYMBOL_F16TEXTURE1D = 319, /* F16TEXTURE1D */ + YYSYMBOL_F16TEXTURE2D = 320, /* F16TEXTURE2D */ + YYSYMBOL_F16TEXTURE3D = 321, /* F16TEXTURE3D */ + YYSYMBOL_F16TEXTURE2DRECT = 322, /* F16TEXTURE2DRECT */ + YYSYMBOL_F16TEXTURECUBE = 323, /* F16TEXTURECUBE */ + YYSYMBOL_F16TEXTURE1DARRAY = 324, /* F16TEXTURE1DARRAY */ + YYSYMBOL_F16TEXTURE2DARRAY = 325, /* F16TEXTURE2DARRAY */ + YYSYMBOL_F16TEXTURECUBEARRAY = 326, /* F16TEXTURECUBEARRAY */ + YYSYMBOL_F16TEXTUREBUFFER = 327, /* F16TEXTUREBUFFER */ + YYSYMBOL_F16TEXTURE2DMS = 328, /* F16TEXTURE2DMS */ + YYSYMBOL_F16TEXTURE2DMSARRAY = 329, /* F16TEXTURE2DMSARRAY */ + YYSYMBOL_SUBPASSINPUT = 330, /* SUBPASSINPUT */ + YYSYMBOL_SUBPASSINPUTMS = 331, /* SUBPASSINPUTMS */ + YYSYMBOL_ISUBPASSINPUT = 332, /* ISUBPASSINPUT */ + YYSYMBOL_ISUBPASSINPUTMS = 333, /* ISUBPASSINPUTMS */ + YYSYMBOL_USUBPASSINPUT = 334, /* USUBPASSINPUT */ + YYSYMBOL_USUBPASSINPUTMS = 335, /* USUBPASSINPUTMS */ + YYSYMBOL_F16SUBPASSINPUT = 336, /* F16SUBPASSINPUT */ + YYSYMBOL_F16SUBPASSINPUTMS = 337, /* F16SUBPASSINPUTMS */ + YYSYMBOL_SPIRV_INSTRUCTION = 338, /* SPIRV_INSTRUCTION */ + YYSYMBOL_SPIRV_EXECUTION_MODE = 339, /* SPIRV_EXECUTION_MODE */ + YYSYMBOL_SPIRV_EXECUTION_MODE_ID = 340, /* SPIRV_EXECUTION_MODE_ID */ + YYSYMBOL_SPIRV_DECORATE = 341, /* SPIRV_DECORATE */ + YYSYMBOL_SPIRV_DECORATE_ID = 342, /* SPIRV_DECORATE_ID */ + YYSYMBOL_SPIRV_DECORATE_STRING = 343, /* SPIRV_DECORATE_STRING */ + YYSYMBOL_SPIRV_TYPE = 344, /* SPIRV_TYPE */ + YYSYMBOL_SPIRV_STORAGE_CLASS = 345, /* SPIRV_STORAGE_CLASS */ + YYSYMBOL_SPIRV_BY_REFERENCE = 346, /* SPIRV_BY_REFERENCE */ + YYSYMBOL_SPIRV_LITERAL = 347, /* SPIRV_LITERAL */ + YYSYMBOL_ATTACHMENTEXT = 348, /* ATTACHMENTEXT */ + YYSYMBOL_IATTACHMENTEXT = 349, /* IATTACHMENTEXT */ + YYSYMBOL_UATTACHMENTEXT = 350, /* UATTACHMENTEXT */ + YYSYMBOL_LEFT_OP = 351, /* LEFT_OP */ + YYSYMBOL_RIGHT_OP = 352, /* RIGHT_OP */ + YYSYMBOL_INC_OP = 353, /* INC_OP */ + YYSYMBOL_DEC_OP = 354, /* DEC_OP */ + YYSYMBOL_LE_OP = 355, /* LE_OP */ + YYSYMBOL_GE_OP = 356, /* GE_OP */ + YYSYMBOL_EQ_OP = 357, /* EQ_OP */ + YYSYMBOL_NE_OP = 358, /* NE_OP */ + YYSYMBOL_AND_OP = 359, /* AND_OP */ + YYSYMBOL_OR_OP = 360, /* OR_OP */ + YYSYMBOL_XOR_OP = 361, /* XOR_OP */ + YYSYMBOL_MUL_ASSIGN = 362, /* MUL_ASSIGN */ + YYSYMBOL_DIV_ASSIGN = 363, /* DIV_ASSIGN */ + YYSYMBOL_ADD_ASSIGN = 364, /* ADD_ASSIGN */ + YYSYMBOL_MOD_ASSIGN = 365, /* MOD_ASSIGN */ + YYSYMBOL_LEFT_ASSIGN = 366, /* LEFT_ASSIGN */ + YYSYMBOL_RIGHT_ASSIGN = 367, /* RIGHT_ASSIGN */ + YYSYMBOL_AND_ASSIGN = 368, /* AND_ASSIGN */ + YYSYMBOL_XOR_ASSIGN = 369, /* XOR_ASSIGN */ + YYSYMBOL_OR_ASSIGN = 370, /* OR_ASSIGN */ + YYSYMBOL_SUB_ASSIGN = 371, /* SUB_ASSIGN */ + YYSYMBOL_STRING_LITERAL = 372, /* STRING_LITERAL */ + YYSYMBOL_LEFT_PAREN = 373, /* LEFT_PAREN */ + YYSYMBOL_RIGHT_PAREN = 374, /* RIGHT_PAREN */ + YYSYMBOL_LEFT_BRACKET = 375, /* LEFT_BRACKET */ + YYSYMBOL_RIGHT_BRACKET = 376, /* RIGHT_BRACKET */ + YYSYMBOL_LEFT_BRACE = 377, /* LEFT_BRACE */ + YYSYMBOL_RIGHT_BRACE = 378, /* RIGHT_BRACE */ + YYSYMBOL_DOT = 379, /* DOT */ + YYSYMBOL_COMMA = 380, /* COMMA */ + YYSYMBOL_COLON = 381, /* COLON */ + YYSYMBOL_EQUAL = 382, /* EQUAL */ + YYSYMBOL_SEMICOLON = 383, /* SEMICOLON */ + YYSYMBOL_BANG = 384, /* BANG */ + YYSYMBOL_DASH = 385, /* DASH */ + YYSYMBOL_TILDE = 386, /* TILDE */ + YYSYMBOL_PLUS = 387, /* PLUS */ + YYSYMBOL_STAR = 388, /* STAR */ + YYSYMBOL_SLASH = 389, /* SLASH */ + YYSYMBOL_PERCENT = 390, /* PERCENT */ + YYSYMBOL_LEFT_ANGLE = 391, /* LEFT_ANGLE */ + YYSYMBOL_RIGHT_ANGLE = 392, /* RIGHT_ANGLE */ + YYSYMBOL_VERTICAL_BAR = 393, /* VERTICAL_BAR */ + YYSYMBOL_CARET = 394, /* CARET */ + YYSYMBOL_AMPERSAND = 395, /* AMPERSAND */ + YYSYMBOL_QUESTION = 396, /* QUESTION */ + YYSYMBOL_INVARIANT = 397, /* INVARIANT */ + YYSYMBOL_HIGH_PRECISION = 398, /* HIGH_PRECISION */ + YYSYMBOL_MEDIUM_PRECISION = 399, /* MEDIUM_PRECISION */ + YYSYMBOL_LOW_PRECISION = 400, /* LOW_PRECISION */ + YYSYMBOL_PRECISION = 401, /* PRECISION */ + YYSYMBOL_PACKED = 402, /* PACKED */ + YYSYMBOL_RESOURCE = 403, /* RESOURCE */ + YYSYMBOL_SUPERP = 404, /* SUPERP */ + YYSYMBOL_FLOATCONSTANT = 405, /* FLOATCONSTANT */ + YYSYMBOL_INTCONSTANT = 406, /* INTCONSTANT */ + YYSYMBOL_UINTCONSTANT = 407, /* UINTCONSTANT */ + YYSYMBOL_BOOLCONSTANT = 408, /* BOOLCONSTANT */ + YYSYMBOL_IDENTIFIER = 409, /* IDENTIFIER */ + YYSYMBOL_TYPE_NAME = 410, /* TYPE_NAME */ + YYSYMBOL_CENTROID = 411, /* CENTROID */ + YYSYMBOL_IN = 412, /* IN */ + YYSYMBOL_OUT = 413, /* OUT */ + YYSYMBOL_INOUT = 414, /* INOUT */ + YYSYMBOL_STRUCT = 415, /* STRUCT */ + YYSYMBOL_VOID = 416, /* VOID */ + YYSYMBOL_WHILE = 417, /* WHILE */ + YYSYMBOL_BREAK = 418, /* BREAK */ + YYSYMBOL_CONTINUE = 419, /* CONTINUE */ + YYSYMBOL_DO = 420, /* DO */ + YYSYMBOL_ELSE = 421, /* ELSE */ + YYSYMBOL_FOR = 422, /* FOR */ + YYSYMBOL_IF = 423, /* IF */ + YYSYMBOL_DISCARD = 424, /* DISCARD */ + YYSYMBOL_RETURN = 425, /* RETURN */ + YYSYMBOL_SWITCH = 426, /* SWITCH */ + YYSYMBOL_CASE = 427, /* CASE */ + YYSYMBOL_DEFAULT = 428, /* DEFAULT */ + YYSYMBOL_TERMINATE_INVOCATION = 429, /* TERMINATE_INVOCATION */ + YYSYMBOL_TERMINATE_RAY = 430, /* TERMINATE_RAY */ + YYSYMBOL_IGNORE_INTERSECTION = 431, /* IGNORE_INTERSECTION */ + YYSYMBOL_UNIFORM = 432, /* UNIFORM */ + YYSYMBOL_SHARED = 433, /* SHARED */ + YYSYMBOL_BUFFER = 434, /* BUFFER */ + YYSYMBOL_TILEIMAGEEXT = 435, /* TILEIMAGEEXT */ + YYSYMBOL_FLAT = 436, /* FLAT */ + YYSYMBOL_SMOOTH = 437, /* SMOOTH */ + YYSYMBOL_LAYOUT = 438, /* LAYOUT */ + YYSYMBOL_DOUBLECONSTANT = 439, /* DOUBLECONSTANT */ + YYSYMBOL_INT16CONSTANT = 440, /* INT16CONSTANT */ + YYSYMBOL_UINT16CONSTANT = 441, /* UINT16CONSTANT */ + YYSYMBOL_FLOAT16CONSTANT = 442, /* FLOAT16CONSTANT */ + YYSYMBOL_INT32CONSTANT = 443, /* INT32CONSTANT */ + YYSYMBOL_UINT32CONSTANT = 444, /* UINT32CONSTANT */ + YYSYMBOL_INT64CONSTANT = 445, /* INT64CONSTANT */ + YYSYMBOL_UINT64CONSTANT = 446, /* UINT64CONSTANT */ + YYSYMBOL_SUBROUTINE = 447, /* SUBROUTINE */ + YYSYMBOL_DEMOTE = 448, /* DEMOTE */ + YYSYMBOL_FUNCTION = 449, /* FUNCTION */ + YYSYMBOL_PAYLOADNV = 450, /* PAYLOADNV */ + YYSYMBOL_PAYLOADINNV = 451, /* PAYLOADINNV */ + YYSYMBOL_HITATTRNV = 452, /* HITATTRNV */ + YYSYMBOL_CALLDATANV = 453, /* CALLDATANV */ + YYSYMBOL_CALLDATAINNV = 454, /* CALLDATAINNV */ + YYSYMBOL_PAYLOADEXT = 455, /* PAYLOADEXT */ + YYSYMBOL_PAYLOADINEXT = 456, /* PAYLOADINEXT */ + YYSYMBOL_HITATTREXT = 457, /* HITATTREXT */ + YYSYMBOL_CALLDATAEXT = 458, /* CALLDATAEXT */ + YYSYMBOL_CALLDATAINEXT = 459, /* CALLDATAINEXT */ + YYSYMBOL_PATCH = 460, /* PATCH */ + YYSYMBOL_SAMPLE = 461, /* SAMPLE */ + YYSYMBOL_NONUNIFORM = 462, /* NONUNIFORM */ + YYSYMBOL_COHERENT = 463, /* COHERENT */ + YYSYMBOL_VOLATILE = 464, /* VOLATILE */ + YYSYMBOL_RESTRICT = 465, /* RESTRICT */ + YYSYMBOL_READONLY = 466, /* READONLY */ + YYSYMBOL_WRITEONLY = 467, /* WRITEONLY */ + YYSYMBOL_NONTEMPORAL = 468, /* NONTEMPORAL */ + YYSYMBOL_DEVICECOHERENT = 469, /* DEVICECOHERENT */ + YYSYMBOL_QUEUEFAMILYCOHERENT = 470, /* QUEUEFAMILYCOHERENT */ + YYSYMBOL_WORKGROUPCOHERENT = 471, /* WORKGROUPCOHERENT */ + YYSYMBOL_SUBGROUPCOHERENT = 472, /* SUBGROUPCOHERENT */ + YYSYMBOL_NONPRIVATE = 473, /* NONPRIVATE */ + YYSYMBOL_SHADERCALLCOHERENT = 474, /* SHADERCALLCOHERENT */ + YYSYMBOL_NOPERSPECTIVE = 475, /* NOPERSPECTIVE */ + YYSYMBOL_EXPLICITINTERPAMD = 476, /* EXPLICITINTERPAMD */ + YYSYMBOL_PERVERTEXEXT = 477, /* PERVERTEXEXT */ + YYSYMBOL_PERVERTEXNV = 478, /* PERVERTEXNV */ + YYSYMBOL_PERPRIMITIVENV = 479, /* PERPRIMITIVENV */ + YYSYMBOL_PERVIEWNV = 480, /* PERVIEWNV */ + YYSYMBOL_PERTASKNV = 481, /* PERTASKNV */ + YYSYMBOL_PERPRIMITIVEEXT = 482, /* PERPRIMITIVEEXT */ + YYSYMBOL_TASKPAYLOADWORKGROUPEXT = 483, /* TASKPAYLOADWORKGROUPEXT */ + YYSYMBOL_PRECISE = 484, /* PRECISE */ + YYSYMBOL_YYACCEPT = 485, /* $accept */ + YYSYMBOL_variable_identifier = 486, /* variable_identifier */ + YYSYMBOL_primary_expression = 487, /* primary_expression */ + YYSYMBOL_postfix_expression = 488, /* postfix_expression */ + YYSYMBOL_integer_expression = 489, /* integer_expression */ + YYSYMBOL_function_call = 490, /* function_call */ + YYSYMBOL_function_call_or_method = 491, /* function_call_or_method */ + YYSYMBOL_function_call_generic = 492, /* function_call_generic */ + YYSYMBOL_function_call_header_no_parameters = 493, /* function_call_header_no_parameters */ + YYSYMBOL_function_call_header_with_parameters = 494, /* function_call_header_with_parameters */ + YYSYMBOL_function_call_header = 495, /* function_call_header */ + YYSYMBOL_function_identifier = 496, /* function_identifier */ + YYSYMBOL_unary_expression = 497, /* unary_expression */ + YYSYMBOL_unary_operator = 498, /* unary_operator */ + YYSYMBOL_multiplicative_expression = 499, /* multiplicative_expression */ + YYSYMBOL_additive_expression = 500, /* additive_expression */ + YYSYMBOL_shift_expression = 501, /* shift_expression */ + YYSYMBOL_relational_expression = 502, /* relational_expression */ + YYSYMBOL_equality_expression = 503, /* equality_expression */ + YYSYMBOL_and_expression = 504, /* and_expression */ + YYSYMBOL_exclusive_or_expression = 505, /* exclusive_or_expression */ + YYSYMBOL_inclusive_or_expression = 506, /* inclusive_or_expression */ + YYSYMBOL_logical_and_expression = 507, /* logical_and_expression */ + YYSYMBOL_logical_xor_expression = 508, /* logical_xor_expression */ + YYSYMBOL_logical_or_expression = 509, /* logical_or_expression */ + YYSYMBOL_conditional_expression = 510, /* conditional_expression */ + YYSYMBOL_511_1 = 511, /* $@1 */ + YYSYMBOL_assignment_expression = 512, /* assignment_expression */ + YYSYMBOL_assignment_operator = 513, /* assignment_operator */ + YYSYMBOL_expression = 514, /* expression */ + YYSYMBOL_constant_expression = 515, /* constant_expression */ + YYSYMBOL_declaration = 516, /* declaration */ + YYSYMBOL_block_structure = 517, /* block_structure */ + YYSYMBOL_518_2 = 518, /* $@2 */ + YYSYMBOL_identifier_list = 519, /* identifier_list */ + YYSYMBOL_function_prototype = 520, /* function_prototype */ + YYSYMBOL_function_declarator = 521, /* function_declarator */ + YYSYMBOL_function_header_with_parameters = 522, /* function_header_with_parameters */ + YYSYMBOL_function_header = 523, /* function_header */ + YYSYMBOL_parameter_declarator = 524, /* parameter_declarator */ + YYSYMBOL_parameter_declaration = 525, /* parameter_declaration */ + YYSYMBOL_parameter_type_specifier = 526, /* parameter_type_specifier */ + YYSYMBOL_init_declarator_list = 527, /* init_declarator_list */ + YYSYMBOL_single_declaration = 528, /* single_declaration */ + YYSYMBOL_fully_specified_type = 529, /* fully_specified_type */ + YYSYMBOL_invariant_qualifier = 530, /* invariant_qualifier */ + YYSYMBOL_interpolation_qualifier = 531, /* interpolation_qualifier */ + YYSYMBOL_layout_qualifier = 532, /* layout_qualifier */ + YYSYMBOL_layout_qualifier_id_list = 533, /* layout_qualifier_id_list */ + YYSYMBOL_layout_qualifier_id = 534, /* layout_qualifier_id */ + YYSYMBOL_precise_qualifier = 535, /* precise_qualifier */ + YYSYMBOL_type_qualifier = 536, /* type_qualifier */ + YYSYMBOL_single_type_qualifier = 537, /* single_type_qualifier */ + YYSYMBOL_storage_qualifier = 538, /* storage_qualifier */ + YYSYMBOL_non_uniform_qualifier = 539, /* non_uniform_qualifier */ + YYSYMBOL_type_name_list = 540, /* type_name_list */ + YYSYMBOL_type_specifier = 541, /* type_specifier */ + YYSYMBOL_array_specifier = 542, /* array_specifier */ + YYSYMBOL_type_parameter_specifier_opt = 543, /* type_parameter_specifier_opt */ + YYSYMBOL_type_parameter_specifier = 544, /* type_parameter_specifier */ + YYSYMBOL_type_parameter_specifier_list = 545, /* type_parameter_specifier_list */ + YYSYMBOL_type_specifier_nonarray = 546, /* type_specifier_nonarray */ + YYSYMBOL_precision_qualifier = 547, /* precision_qualifier */ + YYSYMBOL_struct_specifier = 548, /* struct_specifier */ + YYSYMBOL_549_3 = 549, /* $@3 */ + YYSYMBOL_550_4 = 550, /* $@4 */ + YYSYMBOL_struct_declaration_list = 551, /* struct_declaration_list */ + YYSYMBOL_struct_declaration = 552, /* struct_declaration */ + YYSYMBOL_struct_declarator_list = 553, /* struct_declarator_list */ + YYSYMBOL_struct_declarator = 554, /* struct_declarator */ + YYSYMBOL_initializer = 555, /* initializer */ + YYSYMBOL_initializer_list = 556, /* initializer_list */ + YYSYMBOL_declaration_statement = 557, /* declaration_statement */ + YYSYMBOL_statement = 558, /* statement */ + YYSYMBOL_simple_statement = 559, /* simple_statement */ + YYSYMBOL_demote_statement = 560, /* demote_statement */ + YYSYMBOL_compound_statement = 561, /* compound_statement */ + YYSYMBOL_562_5 = 562, /* $@5 */ + YYSYMBOL_563_6 = 563, /* $@6 */ + YYSYMBOL_statement_no_new_scope = 564, /* statement_no_new_scope */ + YYSYMBOL_statement_scoped = 565, /* statement_scoped */ + YYSYMBOL_566_7 = 566, /* $@7 */ + YYSYMBOL_567_8 = 567, /* $@8 */ + YYSYMBOL_compound_statement_no_new_scope = 568, /* compound_statement_no_new_scope */ + YYSYMBOL_statement_list = 569, /* statement_list */ + YYSYMBOL_expression_statement = 570, /* expression_statement */ + YYSYMBOL_selection_statement = 571, /* selection_statement */ + YYSYMBOL_selection_statement_nonattributed = 572, /* selection_statement_nonattributed */ + YYSYMBOL_selection_rest_statement = 573, /* selection_rest_statement */ + YYSYMBOL_condition = 574, /* condition */ + YYSYMBOL_switch_statement = 575, /* switch_statement */ + YYSYMBOL_switch_statement_nonattributed = 576, /* switch_statement_nonattributed */ + YYSYMBOL_577_9 = 577, /* $@9 */ + YYSYMBOL_switch_statement_list = 578, /* switch_statement_list */ + YYSYMBOL_case_label = 579, /* case_label */ + YYSYMBOL_iteration_statement = 580, /* iteration_statement */ + YYSYMBOL_iteration_statement_nonattributed = 581, /* iteration_statement_nonattributed */ + YYSYMBOL_582_10 = 582, /* $@10 */ + YYSYMBOL_583_11 = 583, /* $@11 */ + YYSYMBOL_584_12 = 584, /* $@12 */ + YYSYMBOL_for_init_statement = 585, /* for_init_statement */ + YYSYMBOL_conditionopt = 586, /* conditionopt */ + YYSYMBOL_for_rest_statement = 587, /* for_rest_statement */ + YYSYMBOL_jump_statement = 588, /* jump_statement */ + YYSYMBOL_translation_unit = 589, /* translation_unit */ + YYSYMBOL_external_declaration = 590, /* external_declaration */ + YYSYMBOL_function_definition = 591, /* function_definition */ + YYSYMBOL_592_13 = 592, /* $@13 */ + YYSYMBOL_attribute = 593, /* attribute */ + YYSYMBOL_attribute_list = 594, /* attribute_list */ + YYSYMBOL_single_attribute = 595, /* single_attribute */ + YYSYMBOL_spirv_requirements_list = 596, /* spirv_requirements_list */ + YYSYMBOL_spirv_requirements_parameter = 597, /* spirv_requirements_parameter */ + YYSYMBOL_spirv_extension_list = 598, /* spirv_extension_list */ + YYSYMBOL_spirv_capability_list = 599, /* spirv_capability_list */ + YYSYMBOL_spirv_execution_mode_qualifier = 600, /* spirv_execution_mode_qualifier */ + YYSYMBOL_spirv_execution_mode_parameter_list = 601, /* spirv_execution_mode_parameter_list */ + YYSYMBOL_spirv_execution_mode_parameter = 602, /* spirv_execution_mode_parameter */ + YYSYMBOL_spirv_execution_mode_id_parameter_list = 603, /* spirv_execution_mode_id_parameter_list */ + YYSYMBOL_spirv_storage_class_qualifier = 604, /* spirv_storage_class_qualifier */ + YYSYMBOL_spirv_decorate_qualifier = 605, /* spirv_decorate_qualifier */ + YYSYMBOL_spirv_decorate_parameter_list = 606, /* spirv_decorate_parameter_list */ + YYSYMBOL_spirv_decorate_parameter = 607, /* spirv_decorate_parameter */ + YYSYMBOL_spirv_decorate_id_parameter_list = 608, /* spirv_decorate_id_parameter_list */ + YYSYMBOL_spirv_decorate_id_parameter = 609, /* spirv_decorate_id_parameter */ + YYSYMBOL_spirv_decorate_string_parameter_list = 610, /* spirv_decorate_string_parameter_list */ + YYSYMBOL_spirv_type_specifier = 611, /* spirv_type_specifier */ + YYSYMBOL_spirv_type_parameter_list = 612, /* spirv_type_parameter_list */ + YYSYMBOL_spirv_type_parameter = 613, /* spirv_type_parameter */ + YYSYMBOL_spirv_instruction_qualifier = 614, /* spirv_instruction_qualifier */ + YYSYMBOL_spirv_instruction_qualifier_list = 615, /* spirv_instruction_qualifier_list */ + YYSYMBOL_spirv_instruction_qualifier_id = 616 /* spirv_instruction_qualifier_id */ +}; +typedef enum yysymbol_kind_t yysymbol_kind_t; + + +/* Second part of user prologue. */ +#line 111 "MachineIndependent/glslang.y" + + +#define parseContext (*pParseContext) +#define yyerror(context, msg) context->parserError(msg) + +namespace QtShaderTools { +extern int yylex(YYSTYPE*, TParseContext&); +} // QtShaderTools + +#line 756 "MachineIndependent/glslang_tab.cpp" + + +#ifdef short +# undef short +#endif + +/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure + and (if available) are included + so that the code can choose integer types of a good width. */ + +#ifndef __PTRDIFF_MAX__ +# include /* INFRINGES ON USER NAME SPACE */ +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_STDINT_H +# endif +#endif + +/* Narrow types that promote to a signed type and that can represent a + signed or unsigned integer of at least N bits. In tables they can + save space and decrease cache pressure. Promoting to a signed type + helps avoid bugs in integer arithmetic. */ + +#ifdef __INT_LEAST8_MAX__ +typedef __INT_LEAST8_TYPE__ yytype_int8; +#elif defined YY_STDINT_H +typedef int_least8_t yytype_int8; +#else +typedef signed char yytype_int8; +#endif + +#ifdef __INT_LEAST16_MAX__ +typedef __INT_LEAST16_TYPE__ yytype_int16; +#elif defined YY_STDINT_H +typedef int_least16_t yytype_int16; +#else +typedef short yytype_int16; +#endif + +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + . */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 +#endif + +#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST8_TYPE__ yytype_uint8; +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST8_MAX <= INT_MAX) +typedef uint_least8_t yytype_uint8; +#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX +typedef unsigned char yytype_uint8; +#else +typedef short yytype_uint8; +#endif + +#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST16_TYPE__ yytype_uint16; +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST16_MAX <= INT_MAX) +typedef uint_least16_t yytype_uint16; +#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX +typedef unsigned short yytype_uint16; +#else +typedef int yytype_uint16; +#endif + +#ifndef YYPTRDIFF_T +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ +# define YYPTRDIFF_T __PTRDIFF_TYPE__ +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ +# elif defined PTRDIFF_MAX +# ifndef ptrdiff_t +# include /* INFRINGES ON USER NAME SPACE */ +# endif +# define YYPTRDIFF_T ptrdiff_t +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX +# else +# define YYPTRDIFF_T long +# define YYPTRDIFF_MAXIMUM LONG_MAX +# endif +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned +# endif +#endif + +#define YYSIZE_MAXIMUM \ + YY_CAST (YYPTRDIFF_T, \ + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) + +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + + +/* Stored state numbers (used for stacks). */ +typedef yytype_int16 yy_state_t; + +/* State numbers in computations. */ +typedef int yy_state_fast_t; + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif +#endif + + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) +#else +# define YY_USE(E) /* empty */ +#endif + +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + + +#define YY_ASSERT(E) ((void) (0 && (E))) + +#if 1 + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* 1 */ + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yy_state_t yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +# define YYCOPY_NEEDED 1 + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYPTRDIFF_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ + } \ + while (0) + +#endif + +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYPTRDIFF_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 473 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 13744 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 485 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 132 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 721 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 968 + +/* YYMAXUTOK -- Last valid token kind. */ +#define YYMAXUTOK 739 + + +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex. */ +static const yytype_int16 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484 +}; + +#if YYDEBUG +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_int16 yyrline[] = +{ + 0, 362, 362, 368, 371, 376, 379, 382, 386, 389, + 392, 396, 400, 404, 408, 412, 416, 422, 429, 432, + 435, 438, 441, 446, 454, 461, 468, 474, 478, 485, + 488, 494, 512, 537, 545, 550, 577, 585, 591, 595, + 599, 619, 620, 621, 622, 628, 629, 634, 639, 648, + 649, 654, 662, 663, 669, 678, 679, 684, 689, 694, + 702, 703, 712, 724, 725, 734, 735, 744, 745, 754, + 755, 763, 764, 772, 773, 781, 782, 782, 800, 801, + 817, 821, 825, 829, 834, 838, 842, 846, 850, 854, + 858, 865, 868, 879, 886, 891, 898, 903, 908, 915, + 918, 921, 924, 929, 937, 937, 948, 952, 959, 964, + 972, 980, 992, 995, 1002, 1015, 1035, 1042, 1065, 1080, + 1099, 1110, 1121, 1131, 1141, 1151, 1160, 1163, 1168, 1173, + 1178, 1186, 1191, 1197, 1202, 1207, 1216, 1226, 1253, 1262, + 1269, 1276, 1283, 1290, 1298, 1306, 1316, 1326, 1333, 1343, + 1349, 1352, 1359, 1363, 1367, 1375, 1384, 1387, 1398, 1401, + 1404, 1408, 1412, 1416, 1420, 1423, 1428, 1432, 1437, 1445, + 1449, 1454, 1460, 1466, 1473, 1478, 1483, 1491, 1496, 1508, + 1522, 1528, 1533, 1541, 1549, 1557, 1565, 1573, 1581, 1589, + 1597, 1605, 1613, 1620, 1627, 1631, 1636, 1641, 1646, 1651, + 1656, 1661, 1665, 1669, 1673, 1677, 1681, 1687, 1693, 1703, + 1710, 1713, 1721, 1728, 1739, 1744, 1752, 1756, 1766, 1769, + 1775, 1781, 1787, 1795, 1805, 1809, 1813, 1817, 1822, 1826, + 1831, 1836, 1841, 1846, 1851, 1856, 1861, 1866, 1871, 1877, + 1883, 1889, 1894, 1899, 1904, 1909, 1914, 1919, 1924, 1929, + 1934, 1939, 1944, 1949, 1956, 1961, 1966, 1971, 1976, 1981, + 1986, 1991, 1996, 2001, 2006, 2011, 2016, 2021, 2026, 2034, + 2042, 2050, 2056, 2062, 2068, 2074, 2080, 2086, 2092, 2098, + 2104, 2110, 2116, 2122, 2128, 2134, 2140, 2146, 2152, 2158, + 2164, 2170, 2176, 2182, 2188, 2194, 2200, 2206, 2212, 2218, + 2224, 2230, 2236, 2242, 2248, 2254, 2260, 2266, 2272, 2278, + 2284, 2290, 2296, 2302, 2310, 2318, 2326, 2334, 2342, 2350, + 2358, 2366, 2374, 2382, 2390, 2398, 2404, 2410, 2416, 2422, + 2428, 2434, 2440, 2446, 2452, 2458, 2464, 2470, 2476, 2482, + 2488, 2494, 2500, 2506, 2512, 2518, 2524, 2530, 2536, 2542, + 2548, 2554, 2560, 2566, 2572, 2578, 2584, 2590, 2596, 2602, + 2608, 2614, 2618, 2622, 2626, 2631, 2636, 2641, 2646, 2651, + 2656, 2661, 2666, 2671, 2676, 2681, 2686, 2691, 2696, 2702, + 2708, 2714, 2720, 2726, 2732, 2738, 2744, 2750, 2756, 2762, + 2768, 2774, 2779, 2784, 2789, 2794, 2799, 2804, 2809, 2814, + 2819, 2824, 2829, 2834, 2839, 2844, 2849, 2854, 2859, 2864, + 2869, 2874, 2879, 2884, 2889, 2894, 2899, 2904, 2909, 2914, + 2919, 2924, 2929, 2934, 2939, 2945, 2951, 2956, 2961, 2966, + 2972, 2977, 2982, 2987, 2993, 2998, 3003, 3008, 3014, 3019, + 3024, 3029, 3035, 3041, 3047, 3053, 3058, 3064, 3070, 3076, + 3081, 3086, 3091, 3096, 3101, 3107, 3112, 3117, 3122, 3128, + 3133, 3138, 3143, 3149, 3154, 3159, 3164, 3170, 3175, 3180, + 3185, 3191, 3196, 3201, 3206, 3212, 3217, 3222, 3227, 3233, + 3238, 3243, 3248, 3254, 3259, 3264, 3269, 3275, 3280, 3285, + 3290, 3296, 3301, 3306, 3311, 3317, 3322, 3327, 3332, 3338, + 3343, 3348, 3353, 3359, 3364, 3369, 3374, 3380, 3385, 3390, + 3395, 3401, 3406, 3411, 3416, 3421, 3426, 3431, 3436, 3441, + 3446, 3451, 3456, 3461, 3466, 3471, 3476, 3481, 3486, 3491, + 3496, 3501, 3506, 3511, 3516, 3521, 3527, 3533, 3539, 3545, + 3551, 3557, 3563, 3570, 3577, 3583, 3589, 3595, 3601, 3608, + 3615, 3622, 3629, 3634, 3639, 3643, 3649, 3655, 3659, 3663, + 3667, 3672, 3688, 3693, 3698, 3706, 3706, 3723, 3723, 3733, + 3736, 3749, 3771, 3798, 3802, 3808, 3813, 3824, 3827, 3833, + 3839, 3848, 3851, 3857, 3861, 3862, 3868, 3869, 3870, 3871, + 3872, 3873, 3874, 3875, 3879, 3887, 3888, 3892, 3888, 3906, + 3907, 3911, 3911, 3918, 3918, 3932, 3935, 3945, 3953, 3964, + 3965, 3969, 3972, 3979, 3986, 3990, 3998, 4002, 4011, 4014, + 4021, 4021, 4041, 4044, 4050, 4062, 4074, 4077, 4085, 4085, + 4104, 4104, 4126, 4126, 4147, 4150, 4156, 4159, 4165, 4169, + 4176, 4181, 4186, 4193, 4196, 4200, 4204, 4208, 4217, 4221, + 4230, 4233, 4236, 4244, 4244, 4286, 4291, 4294, 4299, 4302, + 4307, 4310, 4315, 4318, 4323, 4326, 4331, 4334, 4339, 4343, + 4348, 4352, 4357, 4361, 4368, 4371, 4376, 4379, 4382, 4385, + 4388, 4393, 4402, 4413, 4418, 4426, 4430, 4435, 4439, 4444, + 4448, 4453, 4457, 4464, 4467, 4472, 4475, 4478, 4481, 4486, + 4489, 4494, 4500, 4503, 4506, 4509, 4514, 4518, 4523, 4527, + 4532, 4536, 4543, 4546, 4551, 4554, 4559, 4562, 4568, 4571, + 4576, 4579 +}; +#endif + +/** Accessing symbol of state STATE. */ +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) + +#if 1 +/* The user-facing name of the symbol whose (internal) number is + YYSYMBOL. No bounds checking. */ +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; + +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "\"end of file\"", "error", "\"invalid token\"", "CONST", "BOOL", "INT", + "UINT", "FLOAT", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3", "IVEC4", + "UVEC2", "UVEC3", "UVEC4", "VEC2", "VEC3", "VEC4", "MAT2", "MAT3", + "MAT4", "MAT2X2", "MAT2X3", "MAT2X4", "MAT3X2", "MAT3X3", "MAT3X4", + "MAT4X2", "MAT4X3", "MAT4X4", "SAMPLER2D", "SAMPLER3D", "SAMPLERCUBE", + "SAMPLER2DSHADOW", "SAMPLERCUBESHADOW", "SAMPLER2DARRAY", + "SAMPLER2DARRAYSHADOW", "ISAMPLER2D", "ISAMPLER3D", "ISAMPLERCUBE", + "ISAMPLER2DARRAY", "USAMPLER2D", "USAMPLER3D", "USAMPLERCUBE", + "USAMPLER2DARRAY", "SAMPLER", "SAMPLERSHADOW", "TEXTURE2D", "TEXTURE3D", + "TEXTURECUBE", "TEXTURE2DARRAY", "ITEXTURE2D", "ITEXTURE3D", + "ITEXTURECUBE", "ITEXTURE2DARRAY", "UTEXTURE2D", "UTEXTURE3D", + "UTEXTURECUBE", "UTEXTURE2DARRAY", "ATTRIBUTE", "VARYING", "FLOATE5M2_T", + "FLOATE4M3_T", "BFLOAT16_T", "FLOAT16_T", "FLOAT32_T", "DOUBLE", + "FLOAT64_T", "INT64_T", "UINT64_T", "INT32_T", "UINT32_T", "INT16_T", + "UINT16_T", "INT8_T", "UINT8_T", "I64VEC2", "I64VEC3", "I64VEC4", + "U64VEC2", "U64VEC3", "U64VEC4", "I32VEC2", "I32VEC3", "I32VEC4", + "U32VEC2", "U32VEC3", "U32VEC4", "I16VEC2", "I16VEC3", "I16VEC4", + "U16VEC2", "U16VEC3", "U16VEC4", "I8VEC2", "I8VEC3", "I8VEC4", "U8VEC2", + "U8VEC3", "U8VEC4", "DVEC2", "DVEC3", "DVEC4", "DMAT2", "DMAT3", "DMAT4", + "BF16VEC2", "BF16VEC3", "BF16VEC4", "FE5M2VEC2", "FE5M2VEC3", + "FE5M2VEC4", "FE4M3VEC2", "FE4M3VEC3", "FE4M3VEC4", "F16VEC2", "F16VEC3", + "F16VEC4", "F16MAT2", "F16MAT3", "F16MAT4", "F32VEC2", "F32VEC3", + "F32VEC4", "F32MAT2", "F32MAT3", "F32MAT4", "F64VEC2", "F64VEC3", + "F64VEC4", "F64MAT2", "F64MAT3", "F64MAT4", "DMAT2X2", "DMAT2X3", + "DMAT2X4", "DMAT3X2", "DMAT3X3", "DMAT3X4", "DMAT4X2", "DMAT4X3", + "DMAT4X4", "F16MAT2X2", "F16MAT2X3", "F16MAT2X4", "F16MAT3X2", + "F16MAT3X3", "F16MAT3X4", "F16MAT4X2", "F16MAT4X3", "F16MAT4X4", + "F32MAT2X2", "F32MAT2X3", "F32MAT2X4", "F32MAT3X2", "F32MAT3X3", + "F32MAT3X4", "F32MAT4X2", "F32MAT4X3", "F32MAT4X4", "F64MAT2X2", + "F64MAT2X3", "F64MAT2X4", "F64MAT3X2", "F64MAT3X3", "F64MAT3X4", + "F64MAT4X2", "F64MAT4X3", "F64MAT4X4", "ATOMIC_UINT", "ACCSTRUCTNV", + "ACCSTRUCTEXT", "RAYQUERYEXT", "FCOOPMATNV", "ICOOPMATNV", "UCOOPMATNV", + "COOPMAT", "COOPVECNV", "HITOBJECTNV", "HITOBJECTATTRNV", "HITOBJECTEXT", + "HITOBJECTATTREXT", "TENSORLAYOUTNV", "TENSORVIEWNV", "TENSORARM", + "SAMPLERCUBEARRAY", "SAMPLERCUBEARRAYSHADOW", "ISAMPLERCUBEARRAY", + "USAMPLERCUBEARRAY", "SAMPLER1D", "SAMPLER1DARRAY", + "SAMPLER1DARRAYSHADOW", "ISAMPLER1D", "SAMPLER1DSHADOW", "SAMPLER2DRECT", + "SAMPLER2DRECTSHADOW", "ISAMPLER2DRECT", "USAMPLER2DRECT", + "SAMPLERBUFFER", "ISAMPLERBUFFER", "USAMPLERBUFFER", "SAMPLER2DMS", + "ISAMPLER2DMS", "USAMPLER2DMS", "SAMPLER2DMSARRAY", "ISAMPLER2DMSARRAY", + "USAMPLER2DMSARRAY", "SAMPLEREXTERNALOES", "SAMPLEREXTERNAL2DY2YEXT", + "ISAMPLER1DARRAY", "USAMPLER1D", "USAMPLER1DARRAY", "F16SAMPLER1D", + "F16SAMPLER2D", "F16SAMPLER3D", "F16SAMPLER2DRECT", "F16SAMPLERCUBE", + "F16SAMPLER1DARRAY", "F16SAMPLER2DARRAY", "F16SAMPLERCUBEARRAY", + "F16SAMPLERBUFFER", "F16SAMPLER2DMS", "F16SAMPLER2DMSARRAY", + "F16SAMPLER1DSHADOW", "F16SAMPLER2DSHADOW", "F16SAMPLER1DARRAYSHADOW", + "F16SAMPLER2DARRAYSHADOW", "F16SAMPLER2DRECTSHADOW", + "F16SAMPLERCUBESHADOW", "F16SAMPLERCUBEARRAYSHADOW", "IMAGE1D", + "IIMAGE1D", "UIMAGE1D", "IMAGE2D", "IIMAGE2D", "UIMAGE2D", "IMAGE3D", + "IIMAGE3D", "UIMAGE3D", "IMAGE2DRECT", "IIMAGE2DRECT", "UIMAGE2DRECT", + "IMAGECUBE", "IIMAGECUBE", "UIMAGECUBE", "IMAGEBUFFER", "IIMAGEBUFFER", + "UIMAGEBUFFER", "IMAGE1DARRAY", "IIMAGE1DARRAY", "UIMAGE1DARRAY", + "IMAGE2DARRAY", "IIMAGE2DARRAY", "UIMAGE2DARRAY", "IMAGECUBEARRAY", + "IIMAGECUBEARRAY", "UIMAGECUBEARRAY", "IMAGE2DMS", "IIMAGE2DMS", + "UIMAGE2DMS", "IMAGE2DMSARRAY", "IIMAGE2DMSARRAY", "UIMAGE2DMSARRAY", + "F16IMAGE1D", "F16IMAGE2D", "F16IMAGE3D", "F16IMAGE2DRECT", + "F16IMAGECUBE", "F16IMAGE1DARRAY", "F16IMAGE2DARRAY", + "F16IMAGECUBEARRAY", "F16IMAGEBUFFER", "F16IMAGE2DMS", + "F16IMAGE2DMSARRAY", "I64IMAGE1D", "U64IMAGE1D", "I64IMAGE2D", + "U64IMAGE2D", "I64IMAGE3D", "U64IMAGE3D", "I64IMAGE2DRECT", + "U64IMAGE2DRECT", "I64IMAGECUBE", "U64IMAGECUBE", "I64IMAGEBUFFER", + "U64IMAGEBUFFER", "I64IMAGE1DARRAY", "U64IMAGE1DARRAY", + "I64IMAGE2DARRAY", "U64IMAGE2DARRAY", "I64IMAGECUBEARRAY", + "U64IMAGECUBEARRAY", "I64IMAGE2DMS", "U64IMAGE2DMS", "I64IMAGE2DMSARRAY", + "U64IMAGE2DMSARRAY", "TEXTURECUBEARRAY", "ITEXTURECUBEARRAY", + "UTEXTURECUBEARRAY", "TEXTURE1D", "ITEXTURE1D", "UTEXTURE1D", + "TEXTURE1DARRAY", "ITEXTURE1DARRAY", "UTEXTURE1DARRAY", "TEXTURE2DRECT", + "ITEXTURE2DRECT", "UTEXTURE2DRECT", "TEXTUREBUFFER", "ITEXTUREBUFFER", + "UTEXTUREBUFFER", "TEXTURE2DMS", "ITEXTURE2DMS", "UTEXTURE2DMS", + "TEXTURE2DMSARRAY", "ITEXTURE2DMSARRAY", "UTEXTURE2DMSARRAY", + "F16TEXTURE1D", "F16TEXTURE2D", "F16TEXTURE3D", "F16TEXTURE2DRECT", + "F16TEXTURECUBE", "F16TEXTURE1DARRAY", "F16TEXTURE2DARRAY", + "F16TEXTURECUBEARRAY", "F16TEXTUREBUFFER", "F16TEXTURE2DMS", + "F16TEXTURE2DMSARRAY", "SUBPASSINPUT", "SUBPASSINPUTMS", "ISUBPASSINPUT", + "ISUBPASSINPUTMS", "USUBPASSINPUT", "USUBPASSINPUTMS", "F16SUBPASSINPUT", + "F16SUBPASSINPUTMS", "SPIRV_INSTRUCTION", "SPIRV_EXECUTION_MODE", + "SPIRV_EXECUTION_MODE_ID", "SPIRV_DECORATE", "SPIRV_DECORATE_ID", + "SPIRV_DECORATE_STRING", "SPIRV_TYPE", "SPIRV_STORAGE_CLASS", + "SPIRV_BY_REFERENCE", "SPIRV_LITERAL", "ATTACHMENTEXT", "IATTACHMENTEXT", + "UATTACHMENTEXT", "LEFT_OP", "RIGHT_OP", "INC_OP", "DEC_OP", "LE_OP", + "GE_OP", "EQ_OP", "NE_OP", "AND_OP", "OR_OP", "XOR_OP", "MUL_ASSIGN", + "DIV_ASSIGN", "ADD_ASSIGN", "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", + "AND_ASSIGN", "XOR_ASSIGN", "OR_ASSIGN", "SUB_ASSIGN", "STRING_LITERAL", + "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET", "RIGHT_BRACKET", + "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON", "EQUAL", + "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH", "PERCENT", + "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET", "AMPERSAND", + "QUESTION", "INVARIANT", "HIGH_PRECISION", "MEDIUM_PRECISION", + "LOW_PRECISION", "PRECISION", "PACKED", "RESOURCE", "SUPERP", + "FLOATCONSTANT", "INTCONSTANT", "UINTCONSTANT", "BOOLCONSTANT", + "IDENTIFIER", "TYPE_NAME", "CENTROID", "IN", "OUT", "INOUT", "STRUCT", + "VOID", "WHILE", "BREAK", "CONTINUE", "DO", "ELSE", "FOR", "IF", + "DISCARD", "RETURN", "SWITCH", "CASE", "DEFAULT", "TERMINATE_INVOCATION", + "TERMINATE_RAY", "IGNORE_INTERSECTION", "UNIFORM", "SHARED", "BUFFER", + "TILEIMAGEEXT", "FLAT", "SMOOTH", "LAYOUT", "DOUBLECONSTANT", + "INT16CONSTANT", "UINT16CONSTANT", "FLOAT16CONSTANT", "INT32CONSTANT", + "UINT32CONSTANT", "INT64CONSTANT", "UINT64CONSTANT", "SUBROUTINE", + "DEMOTE", "FUNCTION", "PAYLOADNV", "PAYLOADINNV", "HITATTRNV", + "CALLDATANV", "CALLDATAINNV", "PAYLOADEXT", "PAYLOADINEXT", "HITATTREXT", + "CALLDATAEXT", "CALLDATAINEXT", "PATCH", "SAMPLE", "NONUNIFORM", + "COHERENT", "VOLATILE", "RESTRICT", "READONLY", "WRITEONLY", + "NONTEMPORAL", "DEVICECOHERENT", "QUEUEFAMILYCOHERENT", + "WORKGROUPCOHERENT", "SUBGROUPCOHERENT", "NONPRIVATE", + "SHADERCALLCOHERENT", "NOPERSPECTIVE", "EXPLICITINTERPAMD", + "PERVERTEXEXT", "PERVERTEXNV", "PERPRIMITIVENV", "PERVIEWNV", + "PERTASKNV", "PERPRIMITIVEEXT", "TASKPAYLOADWORKGROUPEXT", "PRECISE", + "$accept", "variable_identifier", "primary_expression", + "postfix_expression", "integer_expression", "function_call", + "function_call_or_method", "function_call_generic", + "function_call_header_no_parameters", + "function_call_header_with_parameters", "function_call_header", + "function_identifier", "unary_expression", "unary_operator", + "multiplicative_expression", "additive_expression", "shift_expression", + "relational_expression", "equality_expression", "and_expression", + "exclusive_or_expression", "inclusive_or_expression", + "logical_and_expression", "logical_xor_expression", + "logical_or_expression", "conditional_expression", "$@1", + "assignment_expression", "assignment_operator", "expression", + "constant_expression", "declaration", "block_structure", "$@2", + "identifier_list", "function_prototype", "function_declarator", + "function_header_with_parameters", "function_header", + "parameter_declarator", "parameter_declaration", + "parameter_type_specifier", "init_declarator_list", "single_declaration", + "fully_specified_type", "invariant_qualifier", "interpolation_qualifier", + "layout_qualifier", "layout_qualifier_id_list", "layout_qualifier_id", + "precise_qualifier", "type_qualifier", "single_type_qualifier", + "storage_qualifier", "non_uniform_qualifier", "type_name_list", + "type_specifier", "array_specifier", "type_parameter_specifier_opt", + "type_parameter_specifier", "type_parameter_specifier_list", + "type_specifier_nonarray", "precision_qualifier", "struct_specifier", + "$@3", "$@4", "struct_declaration_list", "struct_declaration", + "struct_declarator_list", "struct_declarator", "initializer", + "initializer_list", "declaration_statement", "statement", + "simple_statement", "demote_statement", "compound_statement", "$@5", + "$@6", "statement_no_new_scope", "statement_scoped", "$@7", "$@8", + "compound_statement_no_new_scope", "statement_list", + "expression_statement", "selection_statement", + "selection_statement_nonattributed", "selection_rest_statement", + "condition", "switch_statement", "switch_statement_nonattributed", "$@9", + "switch_statement_list", "case_label", "iteration_statement", + "iteration_statement_nonattributed", "$@10", "$@11", "$@12", + "for_init_statement", "conditionopt", "for_rest_statement", + "jump_statement", "translation_unit", "external_declaration", + "function_definition", "$@13", "attribute", "attribute_list", + "single_attribute", "spirv_requirements_list", + "spirv_requirements_parameter", "spirv_extension_list", + "spirv_capability_list", "spirv_execution_mode_qualifier", + "spirv_execution_mode_parameter_list", "spirv_execution_mode_parameter", + "spirv_execution_mode_id_parameter_list", + "spirv_storage_class_qualifier", "spirv_decorate_qualifier", + "spirv_decorate_parameter_list", "spirv_decorate_parameter", + "spirv_decorate_id_parameter_list", "spirv_decorate_id_parameter", + "spirv_decorate_string_parameter_list", "spirv_type_specifier", + "spirv_type_parameter_list", "spirv_type_parameter", + "spirv_instruction_qualifier", "spirv_instruction_qualifier_list", + "spirv_instruction_qualifier_id", YY_NULLPTR +}; + +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) +{ + return yytname[yysymbol]; +} +#endif + +#define YYPACT_NINF (-894) + +#define yypact_value_is_default(Yyn) \ + ((Yyn) == YYPACT_NINF) + +#define YYTABLE_NINF (-716) + +#define yytable_value_is_error(Yyn) \ + 0 + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = +{ + 4827, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -305, -284, -273, -250, + -220, -203, -187, -131, -894, -894, -894, -894, -894, -227, + -894, -894, -894, -894, -894, -59, -894, -894, -894, -894, + -894, -328, -894, -894, -894, -894, -894, -894, -894, -102, + -100, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -342, -217, + -319, -177, 8683, -225, -894, -153, -894, -894, -894, -894, + 5791, -894, -894, -894, -894, -106, -894, -894, 971, -894, + -894, 8683, -92, -894, -894, -894, 6273, -128, -219, -156, + -155, -127, -123, -128, -119, -75, 13295, -894, -68, -369, + -64, -894, -330, -894, -41, -22, 6755, -894, -894, -894, + 8683, -55, -54, -894, -285, -894, -21, -140, -894, -894, + 11918, -18, -894, -894, -894, -16, -50, 8683, -894, -23, + -20, -19, -894, -318, -894, -259, -17, -14, -13, -12, + -231, -11, -10, -9, -8, -7, -5, -230, 6, -4, + 8, -322, -894, -1, 8683, -894, -3, -894, -228, -894, + -894, -212, 10082, -894, -323, 1453, -894, -894, -15, -894, + -894, -894, -281, -256, -894, 10541, -255, -894, -46, -894, + 11918, 11918, -894, 11918, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -316, -894, -894, -894, 10, -209, 12377, + 12, -894, 11918, -894, 13, -294, 3, -22, 14, -894, + -341, -128, -894, -6, -894, -329, 15, -117, 11918, -110, + -894, -139, -109, -148, -108, 16, -104, -128, -894, 12836, + -894, -103, 11918, 17, -75, -894, 8683, -2, 7237, -894, + 8683, 11918, -894, -369, -894, 1, -894, -894, -126, -251, + -234, -320, -130, 7, 11, 21, 30, 31, -321, 18, + -894, 11000, -894, 19, -894, -894, 22, 23, 25, -894, + 27, 28, 32, 11459, 43, 11918, 37, 36, 39, 40, + 41, -257, -894, -894, -136, -894, -217, 53, 13, -894, + -894, -894, -894, -894, 1935, -894, -894, -894, -894, -894, + -894, -894, -894, -894, 5309, 48, 10541, 3, 10541, -243, + 9164, -894, -894, 10541, 8683, -894, -894, -894, -207, -894, + -894, 11918, 26, -894, -894, 11918, 68, -894, -894, -894, + 11918, -894, -894, -894, -326, -894, -894, -200, 61, -894, + -894, -894, -894, -894, -894, -199, -894, -196, -894, -894, + -195, 24, -894, -894, -894, -894, -192, -894, -175, -894, + -894, -894, -894, -894, -174, -894, 64, -894, -173, 67, + -170, 61, -894, -289, -166, -894, 74, 76, -894, -894, + -2, -18, -73, -894, -894, -894, 7719, -894, -894, -894, + 11918, 11918, 11918, 11918, 11918, 11918, 11918, 11918, 11918, 11918, + 11918, 11918, 11918, 11918, 11918, 11918, 11918, 11918, 11918, -894, + -894, -894, 20, -894, 2417, -894, -894, -894, 2417, -894, + 11918, -894, -894, -72, 11918, -38, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, 11918, 11918, -894, -894, -894, -894, -894, -894, + -894, -894, -894, 10541, -894, -894, -132, -894, 8201, -894, + 77, 72, -894, -894, -894, -894, -894, -277, -235, -894, + -324, -894, -329, -894, -329, -894, 11918, 11918, -894, -139, + -894, -139, -894, -148, -148, -894, 82, 16, -894, 12836, + -894, 11918, -894, -894, -45, 3, -2, -894, -894, -894, + -894, -894, -126, -126, -251, -251, -234, -234, -234, -234, + -320, -320, -130, 7, 11, 21, 30, 31, 11918, -894, + 2417, 4345, -26, 3863, -163, -894, -162, -894, -894, -894, + -894, -894, 9623, -894, -894, -894, 83, -894, 52, -894, + -161, -894, -159, -894, -158, -894, -154, -894, -151, -150, + -894, -894, -894, -33, 81, 72, 54, 87, 89, -894, + -894, 4345, 90, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, 11918, -894, 84, 2899, 11918, -894, + 85, 97, 55, 96, 3381, -894, 98, -894, 10541, -894, + -894, -894, -149, 11918, 2899, 90, -894, -894, 2417, -894, + 91, 72, -894, -894, 2417, 86, -894, -894 +}; + +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_int16 yydefact[] = +{ + 0, 169, 228, 226, 227, 225, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 229, 230, 231, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 366, 367, 368, 369, 370, 371, 372, 392, 393, 394, + 395, 396, 397, 398, 407, 420, 421, 408, 409, 411, + 410, 412, 413, 414, 415, 416, 417, 418, 419, 178, + 179, 255, 256, 254, 257, 258, 253, 259, 266, 267, + 264, 265, 262, 263, 260, 261, 298, 299, 300, 310, + 311, 312, 295, 296, 297, 307, 308, 309, 292, 293, + 294, 304, 305, 306, 289, 290, 291, 301, 302, 303, + 268, 269, 270, 313, 314, 315, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 325, 326, + 327, 283, 284, 285, 337, 338, 339, 286, 287, 288, + 349, 350, 351, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 364, + 361, 362, 363, 548, 549, 550, 551, 555, 558, 183, + 559, 184, 552, 553, 556, 376, 377, 400, 403, 365, + 374, 375, 391, 373, 422, 423, 426, 427, 428, 430, + 431, 432, 434, 435, 436, 438, 439, 535, 536, 399, + 401, 402, 378, 379, 380, 424, 381, 385, 386, 389, + 429, 433, 437, 382, 383, 387, 388, 425, 384, 390, + 469, 471, 472, 473, 475, 476, 477, 479, 480, 481, + 483, 484, 485, 487, 488, 489, 491, 492, 493, 495, + 496, 497, 499, 500, 501, 503, 504, 505, 507, 508, + 509, 511, 512, 470, 474, 478, 482, 486, 494, 498, + 502, 490, 506, 510, 513, 514, 515, 516, 517, 518, + 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, + 529, 530, 531, 532, 533, 534, 404, 405, 406, 440, + 449, 451, 445, 450, 452, 453, 455, 456, 457, 459, + 460, 461, 463, 464, 465, 467, 468, 441, 442, 443, + 454, 444, 446, 447, 448, 458, 462, 466, 540, 541, + 544, 545, 546, 547, 542, 543, 0, 0, 0, 0, + 0, 0, 0, 0, 167, 168, 537, 538, 539, 0, + 652, 138, 562, 563, 564, 0, 561, 173, 171, 172, + 170, 0, 224, 174, 176, 177, 175, 140, 139, 0, + 206, 554, 186, 188, 182, 190, 192, 187, 189, 185, + 191, 193, 180, 181, 209, 194, 201, 202, 203, 204, + 205, 195, 196, 197, 198, 199, 200, 141, 142, 144, + 143, 145, 147, 148, 146, 208, 155, 651, 0, 653, + 0, 113, 112, 0, 126, 131, 162, 161, 159, 163, + 0, 156, 158, 164, 136, 219, 160, 560, 0, 648, + 650, 0, 0, 165, 166, 557, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 567, 0, 0, + 0, 99, 0, 94, 0, 108, 0, 122, 114, 124, + 0, 125, 0, 97, 132, 102, 106, 0, 157, 137, + 0, 212, 218, 1, 649, 0, 0, 0, 96, 0, + 0, 0, 660, 0, 718, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 658, 0, 656, 0, 0, 565, 152, 154, 0, 150, + 210, 0, 0, 100, 0, 0, 654, 109, 0, 115, + 121, 123, 118, 127, 117, 0, 133, 104, 0, 103, + 0, 0, 9, 0, 43, 42, 44, 41, 5, 6, + 7, 8, 2, 16, 14, 15, 17, 10, 11, 12, + 13, 3, 18, 37, 20, 25, 26, 0, 0, 30, + 0, 222, 0, 36, 221, 0, 213, 110, 0, 95, + 0, 0, 716, 0, 668, 0, 0, 0, 0, 0, + 685, 0, 0, 0, 0, 0, 0, 0, 710, 0, + 683, 0, 0, 0, 0, 98, 0, 0, 0, 569, + 0, 0, 149, 0, 207, 0, 214, 45, 49, 52, + 55, 60, 63, 65, 67, 69, 71, 73, 75, 0, + 34, 0, 101, 596, 605, 609, 0, 0, 0, 630, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 45, 78, 91, 0, 583, 0, 164, 136, 586, + 607, 585, 593, 584, 0, 587, 588, 611, 589, 618, + 590, 591, 626, 592, 0, 0, 0, 119, 0, 128, + 0, 577, 135, 0, 0, 107, 38, 39, 0, 22, + 23, 0, 0, 28, 27, 0, 224, 31, 33, 40, + 0, 220, 111, 720, 0, 721, 661, 0, 0, 719, + 680, 676, 677, 678, 679, 0, 674, 0, 93, 681, + 0, 0, 695, 696, 697, 698, 0, 693, 0, 702, + 703, 704, 705, 701, 0, 699, 0, 706, 0, 0, + 0, 2, 714, 219, 0, 712, 0, 0, 655, 657, + 0, 575, 0, 573, 568, 570, 0, 153, 151, 211, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, + 215, 216, 0, 595, 0, 628, 641, 640, 0, 632, + 0, 644, 642, 0, 0, 0, 625, 645, 646, 647, + 594, 81, 82, 84, 83, 86, 87, 88, 89, 90, + 85, 80, 0, 0, 610, 606, 608, 612, 619, 627, + 116, 120, 130, 0, 580, 581, 0, 134, 0, 4, + 0, 24, 21, 32, 223, 664, 666, 0, 0, 717, + 0, 670, 0, 669, 0, 672, 0, 0, 687, 0, + 686, 0, 689, 0, 0, 691, 0, 0, 711, 0, + 708, 0, 684, 659, 0, 576, 0, 571, 566, 46, + 47, 48, 51, 50, 53, 54, 58, 59, 56, 57, + 61, 62, 64, 66, 68, 70, 72, 74, 0, 217, + 597, 0, 0, 0, 0, 643, 0, 624, 79, 92, + 129, 578, 0, 105, 19, 662, 0, 663, 0, 675, + 0, 682, 0, 694, 0, 700, 0, 707, 0, 0, + 713, 572, 574, 0, 0, 616, 0, 0, 0, 635, + 634, 637, 603, 620, 579, 582, 665, 667, 671, 673, + 688, 690, 692, 709, 0, 598, 0, 0, 0, 636, + 0, 0, 615, 0, 0, 613, 0, 77, 0, 600, + 629, 599, 0, 638, 0, 603, 602, 604, 622, 617, + 0, 639, 633, 614, 623, 0, 631, 621 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -894, -569, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -438, -894, -521, -406, -522, -410, -283, -286, + -282, -287, -280, -279, -894, -505, -894, -509, -894, -504, + -559, 4, -894, -894, -894, 5, -419, -894, -894, 33, + 29, 34, -894, -894, -430, -894, -894, -894, -894, -122, + -894, -409, -394, -894, 9, -894, 0, -453, -894, -894, + -894, -579, 127, -894, -894, -894, -570, -577, -252, -372, + -653, -894, -393, -631, -893, -894, -451, -894, -894, -459, + -458, -894, -894, 42, -749, -385, -894, -165, -894, -421, + -894, -157, -894, -894, -894, -894, -147, -894, -894, -894, + -894, -894, -894, -894, -894, 73, -894, -894, 2, -894, + -91, -246, -449, -894, -894, -894, -332, -327, -331, -894, + -894, -333, -325, -335, -317, -337, -894, -338, -315, -894, + -415, -565 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + 0, 551, 552, 553, 820, 554, 555, 556, 557, 558, + 559, 560, 641, 562, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 642, 878, 643, 802, 644, + 732, 645, 408, 674, 467, 646, 410, 411, 412, 457, + 458, 459, 413, 414, 415, 416, 417, 418, 508, 509, + 419, 420, 421, 422, 563, 511, 620, 514, 471, 472, + 565, 425, 426, 427, 600, 504, 598, 599, 742, 743, + 672, 816, 649, 650, 651, 652, 653, 774, 914, 950, + 942, 943, 944, 951, 654, 655, 656, 657, 945, 917, + 658, 659, 946, 965, 660, 661, 662, 881, 778, 883, + 921, 940, 941, 663, 428, 429, 430, 454, 664, 501, + 502, 481, 482, 827, 828, 432, 705, 706, 710, 433, + 434, 716, 717, 724, 725, 728, 435, 734, 735, 436, + 483, 484 +}; + +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_int16 yytable[] = +{ + 424, 476, 431, 460, 407, 409, 476, 619, 699, 423, + 733, 526, 475, 811, 723, 812, 671, 815, 566, 709, + 817, 745, 477, 806, 699, 880, 468, 477, 497, 678, + 746, 693, 561, 737, 694, 757, 758, 679, 680, 768, + 506, 451, 747, 700, 949, 512, 825, 460, 693, 447, + 687, 957, 621, 513, 593, 455, 572, -35, 594, 681, + 622, 949, 573, 682, 507, 695, 468, 452, 437, 667, + 669, 759, 760, 708, 607, 769, 701, 702, 703, 704, + 826, 448, 695, 468, 708, -715, 690, 708, 524, 438, + 512, -715, 676, 677, 512, 596, 708, 525, 691, 895, + 439, 666, 470, 896, 818, 791, 792, 793, 794, 795, + 796, 797, 798, 799, 800, 574, 772, 755, 756, 512, + 621, 575, 696, 440, 689, 801, 668, 673, 696, 783, + 696, 785, 621, 696, 753, 696, 754, 696, 696, 813, + 607, 897, 696, 580, 588, 898, 602, 882, 445, 581, + 589, 607, 603, 441, 607, 462, 697, 671, 463, 671, + 890, 671, 604, 607, 671, 684, 453, 819, 605, 745, + 442, 685, 730, 803, 829, 831, 823, 821, 833, 835, + 573, 832, 838, 607, 834, 836, 443, 485, 839, 596, + 486, 596, 487, 489, 491, 493, 495, 496, 499, 840, + 842, 845, 468, 456, 848, 841, 843, 846, 850, 964, + 849, 922, 923, 928, 851, 929, 930, 803, 803, 832, + 931, 836, 839, 932, 933, 960, 843, 761, 762, 846, + 851, 803, 862, 863, 476, 866, 867, 868, 869, 925, + 528, 745, 444, 529, 803, 475, 891, 804, 892, 806, + 488, 490, 824, 486, 486, 477, 464, 719, 720, 721, + 722, 542, 750, 751, 752, 596, 712, 713, 714, 715, + 733, 449, 733, 450, 723, 723, 884, 901, 709, 492, + 886, 480, 486, 494, 699, 470, 486, 498, 855, 707, + 486, 478, 486, 888, 889, 959, 711, 718, 726, 486, + 486, 486, 729, 736, 671, 486, 486, 856, 803, 505, + 857, 885, 859, 860, 861, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, 607, 607, + 607, 708, 708, 806, 500, 856, 515, 596, 911, 352, + 353, 354, 803, 887, 708, 510, 708, 803, 934, 864, + 865, 870, 871, 349, 522, 523, 527, 512, 567, 568, + 569, 571, 570, 675, 665, 576, 577, 578, 579, 582, + 583, 584, 585, 586, 913, 587, 591, 915, 621, 601, + 590, 592, 595, 671, 683, 688, -34, 524, 727, 766, + 694, 918, 767, 738, 770, 775, 879, 773, 607, 607, + 779, 780, 763, 698, 837, 764, 776, 741, 777, 596, + 749, 607, 461, 607, 765, 781, 784, 915, 786, 787, + 469, 423, 788, 789, 790, 947, -36, 810, 424, 423, + 431, 424, 407, 409, 952, 822, 424, 423, 431, 671, + 423, 479, -29, 830, 844, 423, 503, 847, 852, 961, + 853, 916, 803, 894, 907, 926, 461, 517, 927, 935, + 461, 937, 938, 936, 967, 423, 948, -601, 953, 423, + 564, 954, 477, 623, 966, 958, 955, 469, 873, 875, + 872, 748, 446, 874, 912, 519, 423, 876, 854, 877, + 919, 916, 956, 520, 521, 962, 516, 963, 920, 807, + 939, 474, 900, 739, 597, 899, 902, 808, 904, 906, + 908, 909, 477, 423, 903, 648, 0, 809, 0, 0, + 0, 0, 0, 0, 647, 0, 905, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 692, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 740, 0, 597, 0, + 597, 0, 0, 0, 0, 423, 0, 423, 0, 423, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 648, 0, 0, 0, 0, 0, + 0, 0, 0, 647, 424, 0, 0, 0, 0, 0, + 0, 0, 0, 423, 597, 0, 0, 0, 0, 0, + 0, 0, 0, 423, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 597, 0, 0, 0, + 0, 0, 0, 0, 0, 423, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 648, 0, 0, 0, 648, 0, + 0, 0, 0, 647, 0, 0, 0, 647, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, + 0, 0, 0, 0, 0, 0, 0, 423, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 648, 648, 0, 648, 0, 431, 0, 0, 0, 647, + 647, 0, 647, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 648, 0, 0, 0, 0, 0, 0, 0, 0, + 647, 0, 0, 0, 0, 0, 0, 648, 0, 0, + 0, 0, 0, 0, 648, 0, 647, 0, 0, 0, + 0, 0, 0, 647, 648, 0, 0, 0, 648, 0, + 0, 0, 0, 647, 648, 0, 0, 647, 0, 0, + 0, 473, 0, 647, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + 347, 348, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 349, 0, 0, 0, + 0, 0, 0, 0, 350, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 351, 352, + 353, 354, 355, 0, 0, 0, 0, 0, 0, 0, + 0, 356, 357, 358, 359, 360, 361, 362, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 363, 364, 365, 366, 367, 368, 369, + 0, 0, 0, 0, 0, 0, 0, 0, 370, 0, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 0, 0, 530, 531, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 532, 533, 0, 349, 0, + 623, 624, 0, 0, 0, 0, 625, 534, 535, 536, + 537, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 351, 352, 353, 354, 355, 0, 0, 0, 538, 539, + 540, 541, 542, 356, 357, 358, 359, 360, 361, 362, + 626, 627, 628, 629, 0, 630, 631, 632, 633, 634, + 635, 636, 637, 638, 639, 363, 364, 365, 366, 367, + 368, 369, 543, 544, 545, 546, 547, 548, 549, 550, + 370, 640, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 1, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 0, 0, 530, 531, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 532, 533, 0, + 349, 0, 623, 805, 0, 0, 0, 0, 625, 534, + 535, 536, 537, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 351, 352, 353, 354, 355, 0, 0, 0, + 538, 539, 540, 541, 542, 356, 357, 358, 359, 360, + 361, 362, 626, 627, 628, 629, 0, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 363, 364, 365, + 366, 367, 368, 369, 543, 544, 545, 546, 547, 548, + 549, 550, 370, 640, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 0, 0, + 530, 531, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 532, + 533, 0, 349, 0, 623, 0, 0, 0, 0, 0, + 625, 534, 535, 536, 537, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 351, 352, 353, 354, 355, 0, + 0, 0, 538, 539, 540, 541, 542, 356, 357, 358, + 359, 360, 361, 362, 626, 627, 628, 629, 0, 630, + 631, 632, 633, 634, 635, 636, 637, 638, 639, 363, + 364, 365, 366, 367, 368, 369, 543, 544, 545, 546, + 547, 548, 549, 550, 370, 640, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 0, 0, 530, 531, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 532, 533, 0, 349, 0, 515, 0, 0, 0, + 0, 0, 625, 534, 535, 536, 537, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 351, 352, 353, 354, + 355, 0, 0, 0, 538, 539, 540, 541, 542, 356, + 357, 358, 359, 360, 361, 362, 626, 627, 628, 629, + 0, 630, 631, 632, 633, 634, 635, 636, 637, 638, + 639, 363, 364, 365, 366, 367, 368, 369, 543, 544, + 545, 546, 547, 548, 549, 550, 370, 640, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + 347, 348, 0, 0, 530, 531, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 532, 533, 0, 349, 0, 0, 0, + 0, 0, 0, 0, 625, 534, 535, 536, 537, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 351, 352, + 353, 354, 355, 0, 0, 0, 538, 539, 540, 541, + 542, 356, 357, 358, 359, 360, 361, 362, 626, 627, + 628, 629, 0, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 363, 364, 365, 366, 367, 368, 369, + 543, 544, 545, 546, 547, 548, 549, 550, 370, 640, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 0, 0, 530, 531, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 532, 533, 0, 349, 0, + 0, 0, 0, 0, 0, 0, 625, 534, 535, 536, + 537, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 351, 352, 353, 354, 355, 0, 0, 0, 538, 539, + 540, 541, 542, 356, 357, 358, 359, 360, 361, 362, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 363, 364, 365, 366, 367, + 368, 369, 543, 544, 545, 546, 547, 548, 549, 550, + 370, 0, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 1, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 0, 0, 0, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 0, 0, 530, 531, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 532, 533, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 534, + 535, 536, 537, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 351, 352, 353, 354, 0, 0, 0, 0, + 538, 539, 540, 541, 542, 356, 357, 358, 359, 360, + 361, 362, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 363, 364, 365, + 366, 367, 368, 369, 543, 544, 545, 546, 547, 548, + 549, 550, 370, 0, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 349, 0, 0, 0, 0, 0, 0, 0, + 350, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 351, 352, 353, 354, 355, 0, + 0, 0, 0, 0, 0, 0, 0, 356, 357, 358, + 359, 360, 361, 362, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 363, + 364, 365, 366, 367, 368, 369, 0, 0, 0, 0, + 0, 0, 0, 0, 370, 0, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 0, 0, 0, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 351, 352, 353, 354, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 356, + 357, 358, 359, 360, 361, 362, 626, 0, 0, 629, + 0, 630, 631, 0, 0, 634, 0, 0, 0, 0, + 0, 363, 364, 365, 366, 367, 368, 369, 0, 0, + 0, 0, 0, 0, 0, 0, 370, 0, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 0, + 0, 0, 339, 340, 341, 342, 343, 344, 345, 346, + 347, 348, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 465, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 351, 352, + 353, 354, 0, 0, 0, 0, 0, 0, 0, 0, + 466, 356, 357, 358, 359, 360, 361, 362, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 363, 364, 365, 366, 367, 368, 369, + 0, 0, 0, 0, 0, 0, 0, 0, 370, 0, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 0, 0, 0, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 349, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 351, 352, 353, 354, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 356, 357, 358, 359, 360, 361, 362, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 363, 364, 365, 366, 367, + 368, 369, 0, 0, 0, 0, 0, 0, 0, 0, + 370, 0, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 1, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 0, 0, 0, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 518, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 351, 352, 353, 354, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 356, 357, 358, 359, 360, + 361, 362, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 363, 364, 365, + 366, 367, 368, 369, 0, 0, 0, 0, 0, 0, + 0, 0, 370, 0, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 0, 0, 0, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 744, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 351, 352, 353, 354, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 356, 357, 358, + 359, 360, 361, 362, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 363, + 364, 365, 366, 367, 368, 369, 0, 0, 0, 0, + 0, 0, 0, 0, 370, 0, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 0, 0, 0, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 858, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 351, 352, 353, 354, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 356, + 357, 358, 359, 360, 361, 362, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 363, 364, 365, 366, 367, 368, 369, 0, 0, + 0, 0, 0, 0, 0, 0, 370, 0, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 0, + 0, 0, 339, 340, 341, 342, 343, 344, 345, 346, + 347, 348, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 893, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 351, 352, + 353, 354, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 356, 357, 358, 359, 360, 361, 362, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 363, 364, 365, 366, 367, 368, 369, + 0, 0, 0, 0, 0, 0, 0, 0, 370, 0, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 0, 0, 0, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 351, 352, 353, 354, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 356, 357, 358, 359, 360, 361, 362, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 363, 364, 365, 366, 367, + 368, 369, 0, 0, 0, 0, 0, 0, 0, 0, + 370, 0, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 0, 0, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 0, 180, 0, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 0, 0, 0, 0, 0, 0, 342, 0, + 0, 0, 346, 347, 348, 0, 0, 530, 531, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 532, 533, 0, 0, + 0, 670, 814, 0, 0, 0, 0, 0, 534, 535, + 536, 537, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 538, + 539, 540, 541, 542, 356, 0, 0, 0, 0, 361, + 362, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 543, 544, 545, 546, 547, 548, 549, + 550, 0, 0, 371, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 384, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 0, 180, 0, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 0, 0, 0, 0, 0, 0, 342, 0, 0, + 0, 346, 347, 348, 0, 0, 530, 531, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 532, 533, 0, 0, 0, + 670, 924, 0, 0, 0, 0, 0, 534, 535, 536, + 537, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 538, 539, + 540, 541, 542, 356, 0, 0, 0, 0, 361, 362, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 543, 544, 545, 546, 547, 548, 549, 550, + 0, 0, 371, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 384, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 0, 0, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 0, 180, 0, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 0, 0, 0, 0, 0, 0, 342, 0, 0, 0, + 346, 347, 348, 0, 0, 530, 531, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 532, 533, 0, 0, 606, 0, + 0, 0, 0, 0, 0, 0, 534, 535, 536, 537, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 538, 539, 540, + 541, 542, 356, 0, 0, 0, 0, 361, 362, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 543, 544, 545, 546, 547, 548, 549, 550, 0, + 0, 371, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 384, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 0, 0, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 0, 180, 0, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 0, + 0, 0, 0, 0, 0, 342, 0, 0, 0, 346, + 347, 348, 0, 0, 530, 531, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 532, 533, 0, 0, 0, 670, 0, + 0, 0, 0, 0, 0, 534, 535, 536, 537, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 538, 539, 540, 541, + 542, 356, 0, 0, 0, 0, 361, 362, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 543, 544, 545, 546, 547, 548, 549, 550, 0, 0, + 371, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 384, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 0, 0, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 0, 180, 0, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, 329, 330, 331, 332, 333, 334, 335, 0, 0, + 0, 0, 0, 0, 342, 0, 0, 0, 346, 347, + 348, 0, 0, 530, 531, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 532, 533, 0, 0, 771, 0, 0, 0, + 0, 0, 0, 0, 534, 535, 536, 537, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 538, 539, 540, 541, 542, + 356, 0, 0, 0, 0, 361, 362, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 543, + 544, 545, 546, 547, 548, 549, 550, 0, 0, 371, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 384, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 0, 0, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 0, 180, 0, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 0, 0, 0, + 0, 0, 0, 342, 0, 0, 0, 346, 347, 348, + 0, 0, 530, 531, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 532, 533, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 782, 534, 535, 536, 537, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 538, 539, 540, 541, 542, 356, + 0, 0, 0, 0, 361, 362, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 543, 544, + 545, 546, 547, 548, 549, 550, 0, 0, 371, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 384, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, + 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 0, + 180, 0, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 0, 0, 0, 0, + 0, 0, 342, 0, 0, 0, 346, 347, 348, 0, + 0, 530, 531, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 532, 533, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 534, 535, 536, 537, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 538, 539, 540, 541, 542, 356, 0, + 0, 0, 0, 361, 362, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 543, 544, 545, + 546, 547, 548, 549, 550, 0, 0, 371, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 384, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 0, 0, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 0, 180, + 0, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 0, 0, 0, 0, 0, + 0, 342, 0, 0, 0, 346, 347, 348, 0, 0, + 530, 531, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 532, + 533, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 534, 535, 536, 537, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 538, 539, 540, 541, 542, 356, 0, 0, + 0, 0, 361, 686, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 543, 544, 545, 546, + 547, 548, 549, 550, 0, 0, 371, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 384, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 0, 0, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 0, 180, 0, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, + 332, 333, 334, 335, 0, 0, 0, 0, 0, 0, + 342, 0, 0, 0, 346, 347, 348, 0, 0, 530, + 531, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 532, 533, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 534, 535, 536, 537, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 538, 539, 540, 541, 731, 356, 0, 0, 0, + 0, 361, 362, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 543, 544, 545, 546, 547, + 548, 549, 550, 0, 0, 371, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 384, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 0, 0, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 0, 180, 0, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 0, 0, 0, 0, 0, 0, 342, + 0, 0, 0, 346, 347, 348, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 356, 0, 0, 0, 0, + 361, 362, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 371 +}; + +static const yytype_int16 yycheck[] = +{ + 0, 431, 0, 412, 0, 0, 436, 512, 573, 0, + 589, 464, 431, 666, 583, 668, 525, 670, 471, 578, + 673, 598, 431, 654, 589, 774, 420, 436, 443, 533, + 600, 372, 470, 592, 375, 355, 356, 353, 354, 360, + 409, 383, 601, 372, 937, 375, 372, 456, 372, 377, + 559, 944, 375, 383, 376, 374, 374, 373, 380, 375, + 383, 954, 380, 379, 433, 406, 460, 409, 373, 522, + 523, 391, 392, 578, 512, 396, 405, 406, 407, 408, + 406, 409, 406, 477, 589, 374, 380, 592, 373, 373, + 375, 380, 530, 531, 375, 504, 601, 382, 392, 376, + 373, 382, 391, 380, 674, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 374, 621, 351, 352, 375, + 375, 380, 571, 373, 562, 382, 382, 382, 577, 633, + 579, 635, 375, 582, 385, 584, 387, 586, 587, 382, + 578, 376, 591, 374, 374, 380, 374, 778, 375, 380, + 380, 589, 380, 373, 592, 380, 571, 666, 383, 668, + 813, 670, 374, 601, 673, 374, 383, 374, 380, 746, + 373, 380, 587, 380, 374, 374, 685, 681, 374, 374, + 380, 380, 374, 621, 380, 380, 373, 406, 380, 598, + 409, 600, 438, 439, 440, 441, 442, 443, 444, 374, + 374, 374, 596, 380, 374, 380, 380, 380, 374, 958, + 380, 374, 374, 374, 380, 374, 374, 380, 380, 380, + 374, 380, 380, 374, 374, 374, 380, 357, 358, 380, + 380, 380, 753, 754, 664, 757, 758, 759, 760, 892, + 380, 818, 373, 383, 380, 664, 378, 383, 380, 880, + 406, 406, 690, 409, 409, 664, 409, 405, 406, 407, + 408, 409, 388, 389, 390, 674, 405, 406, 407, 408, + 849, 373, 851, 373, 843, 844, 780, 836, 837, 406, + 784, 409, 409, 406, 849, 391, 409, 406, 741, 406, + 409, 383, 409, 802, 803, 948, 406, 406, 406, 409, + 409, 409, 406, 406, 813, 409, 409, 380, 380, 377, + 383, 383, 750, 751, 752, 753, 754, 755, 756, 757, + 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, + 768, 836, 837, 964, 409, 380, 377, 746, 383, 398, + 399, 400, 380, 381, 849, 409, 851, 380, 381, 755, + 756, 761, 762, 375, 409, 409, 377, 375, 374, 409, + 383, 380, 382, 409, 379, 382, 380, 380, 380, 380, + 380, 380, 380, 380, 878, 380, 380, 881, 375, 382, + 374, 373, 383, 892, 374, 373, 373, 373, 372, 359, + 375, 417, 361, 376, 376, 373, 376, 378, 836, 837, + 373, 373, 395, 409, 380, 394, 383, 409, 383, 818, + 409, 849, 412, 851, 393, 383, 373, 921, 381, 383, + 420, 412, 383, 383, 383, 934, 373, 379, 428, 420, + 428, 431, 428, 428, 938, 409, 436, 428, 436, 948, + 431, 436, 374, 382, 380, 436, 446, 380, 374, 953, + 374, 881, 380, 376, 372, 372, 456, 455, 406, 378, + 460, 374, 373, 409, 378, 456, 382, 377, 383, 460, + 470, 374, 881, 377, 383, 377, 421, 477, 764, 766, + 763, 603, 355, 765, 856, 456, 477, 767, 740, 768, + 883, 921, 943, 460, 460, 954, 454, 955, 883, 664, + 921, 428, 834, 594, 504, 832, 837, 664, 841, 844, + 847, 849, 921, 504, 839, 515, -1, 664, -1, -1, + -1, -1, -1, -1, 515, -1, 843, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 851, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 567, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 596, -1, 598, -1, + 600, -1, -1, -1, -1, 596, -1, 598, -1, 600, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 654, -1, -1, -1, -1, -1, + -1, -1, -1, 654, 664, -1, -1, -1, -1, -1, + -1, -1, -1, 664, 674, -1, -1, -1, -1, -1, + -1, -1, -1, 674, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 746, -1, -1, -1, + -1, -1, -1, -1, -1, 746, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 774, -1, -1, -1, 778, -1, + -1, -1, -1, 774, -1, -1, -1, 778, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 818, -1, + -1, -1, -1, -1, -1, -1, -1, 818, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 880, 881, -1, 883, -1, 883, -1, -1, -1, 880, + 881, -1, 883, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 921, -1, -1, -1, -1, -1, -1, -1, -1, + 921, -1, -1, -1, -1, -1, -1, 937, -1, -1, + -1, -1, -1, -1, 944, -1, 937, -1, -1, -1, + -1, -1, -1, 944, 954, -1, -1, -1, 958, -1, + -1, -1, -1, 954, 964, -1, -1, 958, -1, -1, + -1, 0, -1, 964, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 375, -1, -1, -1, + -1, -1, -1, -1, 383, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, + 399, 400, 401, -1, -1, -1, -1, -1, -1, -1, + -1, 410, 411, 412, 413, 414, 415, 416, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 432, 433, 434, 435, 436, 437, 438, + -1, -1, -1, -1, -1, -1, -1, -1, 447, -1, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, + 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, + 479, 480, 481, 482, 483, 484, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + 347, 348, 349, 350, -1, -1, 353, 354, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 372, 373, -1, 375, -1, + 377, 378, -1, -1, -1, -1, 383, 384, 385, 386, + 387, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 397, 398, 399, 400, 401, -1, -1, -1, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, + 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, -1, -1, 353, 354, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 372, 373, -1, + 375, -1, 377, 378, -1, -1, -1, -1, 383, 384, + 385, 386, 387, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 397, 398, 399, 400, 401, -1, -1, -1, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, -1, -1, + 353, 354, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 372, + 373, -1, 375, -1, 377, -1, -1, -1, -1, -1, + 383, 384, 385, 386, 387, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 397, 398, 399, 400, 401, -1, + -1, -1, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, -1, 422, + 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + -1, -1, 353, 354, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 372, 373, -1, 375, -1, 377, -1, -1, -1, + -1, -1, 383, 384, 385, 386, 387, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 397, 398, 399, 400, + 401, -1, -1, -1, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, + -1, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, -1, -1, 353, 354, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 372, 373, -1, 375, -1, -1, -1, + -1, -1, -1, -1, 383, 384, 385, 386, 387, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, + 399, 400, 401, -1, -1, -1, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, + 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, + 479, 480, 481, 482, 483, 484, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + 347, 348, 349, 350, -1, -1, 353, 354, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 372, 373, -1, 375, -1, + -1, -1, -1, -1, -1, -1, 383, 384, 385, 386, + 387, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 397, 398, 399, 400, 401, -1, -1, -1, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + 447, -1, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, + 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, -1, -1, -1, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, -1, -1, 353, 354, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 372, 373, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 384, + 385, 386, 387, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 397, 398, 399, 400, -1, -1, -1, -1, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 432, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 447, -1, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 375, -1, -1, -1, -1, -1, -1, -1, + 383, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 397, 398, 399, 400, 401, -1, + -1, -1, -1, -1, -1, -1, -1, 410, 411, 412, + 413, 414, 415, 416, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 432, + 433, 434, 435, 436, 437, 438, -1, -1, -1, -1, + -1, -1, -1, -1, 447, -1, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, -1, -1, -1, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 397, 398, 399, 400, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 410, + 411, 412, 413, 414, 415, 416, 417, -1, -1, 420, + -1, 422, 423, -1, -1, 426, -1, -1, -1, -1, + -1, 432, 433, 434, 435, 436, 437, 438, -1, -1, + -1, -1, -1, -1, -1, -1, 447, -1, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, -1, + -1, -1, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 383, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, + 399, 400, -1, -1, -1, -1, -1, -1, -1, -1, + 409, 410, 411, 412, 413, 414, 415, 416, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 432, 433, 434, 435, 436, 437, 438, + -1, -1, -1, -1, -1, -1, -1, -1, 447, -1, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, + 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, + 479, 480, 481, 482, 483, 484, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, -1, -1, -1, 341, 342, 343, 344, 345, 346, + 347, 348, 349, 350, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 375, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 397, 398, 399, 400, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 410, 411, 412, 413, 414, 415, 416, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 432, 433, 434, 435, 436, + 437, 438, -1, -1, -1, -1, -1, -1, -1, -1, + 447, -1, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, + 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, -1, -1, -1, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 379, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 397, 398, 399, 400, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 410, 411, 412, 413, 414, + 415, 416, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 432, 433, 434, + 435, 436, 437, 438, -1, -1, -1, -1, -1, -1, + -1, -1, 447, -1, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, -1, -1, -1, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 378, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 397, 398, 399, 400, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 410, 411, 412, + 413, 414, 415, 416, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 432, + 433, 434, 435, 436, 437, 438, -1, -1, -1, -1, + -1, -1, -1, -1, 447, -1, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, -1, -1, -1, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 378, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 397, 398, 399, 400, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 410, + 411, 412, 413, 414, 415, 416, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 432, 433, 434, 435, 436, 437, 438, -1, -1, + -1, -1, -1, -1, -1, -1, 447, -1, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, -1, + -1, -1, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 378, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, + 399, 400, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 410, 411, 412, 413, 414, 415, 416, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 432, 433, 434, 435, 436, 437, 438, + -1, -1, -1, -1, -1, -1, -1, -1, 447, -1, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, + 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, + 479, 480, 481, 482, 483, 484, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, -1, -1, -1, 341, 342, 343, 344, 345, 346, + 347, 348, 349, 350, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 397, 398, 399, 400, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 410, 411, 412, 413, 414, 415, 416, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 432, 433, 434, 435, 436, + 437, 438, -1, -1, -1, -1, -1, -1, -1, -1, + 447, -1, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, + 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, -1, -1, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, -1, 182, -1, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, -1, -1, -1, -1, -1, -1, 344, -1, + -1, -1, 348, 349, 350, -1, -1, 353, 354, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 372, 373, -1, -1, + -1, 377, 378, -1, -1, -1, -1, -1, 384, 385, + 386, 387, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 405, + 406, 407, 408, 409, 410, -1, -1, -1, -1, 415, + 416, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 439, 440, 441, 442, 443, 444, 445, + 446, -1, -1, 449, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 462, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, -1, -1, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, -1, 182, -1, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, -1, -1, -1, -1, -1, -1, 344, -1, -1, + -1, 348, 349, 350, -1, -1, 353, 354, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 372, 373, -1, -1, -1, + 377, 378, -1, -1, -1, -1, -1, 384, 385, 386, + 387, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 405, 406, + 407, 408, 409, 410, -1, -1, -1, -1, 415, 416, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 439, 440, 441, 442, 443, 444, 445, 446, + -1, -1, 449, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 462, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, -1, -1, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, -1, 182, -1, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + -1, -1, -1, -1, -1, -1, 344, -1, -1, -1, + 348, 349, 350, -1, -1, 353, 354, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 372, 373, -1, -1, 376, -1, + -1, -1, -1, -1, -1, -1, 384, 385, 386, 387, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 405, 406, 407, + 408, 409, 410, -1, -1, -1, -1, 415, 416, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 439, 440, 441, 442, 443, 444, 445, 446, -1, + -1, 449, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 462, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, -1, -1, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, -1, 182, -1, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, -1, + -1, -1, -1, -1, -1, 344, -1, -1, -1, 348, + 349, 350, -1, -1, 353, 354, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 372, 373, -1, -1, -1, 377, -1, + -1, -1, -1, -1, -1, 384, 385, 386, 387, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 405, 406, 407, 408, + 409, 410, -1, -1, -1, -1, 415, 416, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 462, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, -1, -1, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, -1, 182, -1, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, -1, -1, + -1, -1, -1, -1, 344, -1, -1, -1, 348, 349, + 350, -1, -1, 353, 354, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 372, 373, -1, -1, 376, -1, -1, -1, + -1, -1, -1, -1, 384, 385, 386, 387, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 405, 406, 407, 408, 409, + 410, -1, -1, -1, -1, 415, 416, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 439, + 440, 441, 442, 443, 444, 445, 446, -1, -1, 449, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 462, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + -1, -1, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + -1, 182, -1, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, -1, -1, -1, + -1, -1, -1, 344, -1, -1, -1, 348, 349, 350, + -1, -1, 353, 354, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 372, 373, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 383, 384, 385, 386, 387, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 405, 406, 407, 408, 409, 410, + -1, -1, -1, -1, 415, 416, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 439, 440, + 441, 442, 443, 444, 445, 446, -1, -1, 449, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 462, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, + -1, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, -1, + 182, -1, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, + 332, 333, 334, 335, 336, 337, -1, -1, -1, -1, + -1, -1, 344, -1, -1, -1, 348, 349, 350, -1, + -1, 353, 354, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 372, 373, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 384, 385, 386, 387, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 405, 406, 407, 408, 409, 410, -1, + -1, -1, -1, 415, 416, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 439, 440, 441, + 442, 443, 444, 445, 446, -1, -1, 449, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 462, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, -1, -1, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, -1, 182, + -1, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, -1, -1, -1, -1, -1, + -1, 344, -1, -1, -1, 348, 349, 350, -1, -1, + 353, 354, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 372, + 373, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 384, 385, 386, 387, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 405, 406, 407, 408, 409, 410, -1, -1, + -1, -1, 415, 416, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 439, 440, 441, 442, + 443, 444, 445, 446, -1, -1, 449, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 462, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, -1, -1, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, -1, 182, -1, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, -1, -1, -1, -1, -1, -1, + 344, -1, -1, -1, 348, 349, 350, -1, -1, 353, + 354, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 372, 373, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 384, 385, 386, 387, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 405, 406, 407, 408, 409, 410, -1, -1, -1, + -1, 415, 416, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 439, 440, 441, 442, 443, + 444, 445, 446, -1, -1, 449, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 462, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, -1, -1, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, -1, 182, -1, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, -1, -1, -1, -1, -1, -1, 344, + -1, -1, -1, 348, 349, 350, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 410, -1, -1, -1, -1, + 415, 416, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 449 +}; + +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ +static const yytype_int16 yystos[] = +{ + 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, + 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 375, + 383, 397, 398, 399, 400, 401, 410, 411, 412, 413, + 414, 415, 416, 432, 433, 434, 435, 436, 437, 438, + 447, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, + 478, 479, 480, 481, 482, 483, 484, 516, 517, 520, + 521, 522, 523, 527, 528, 529, 530, 531, 532, 535, + 536, 537, 538, 539, 541, 546, 547, 548, 589, 590, + 591, 593, 600, 604, 605, 611, 614, 373, 373, 373, + 373, 373, 373, 373, 373, 375, 547, 377, 409, 373, + 373, 383, 409, 383, 592, 374, 380, 524, 525, 526, + 536, 541, 380, 383, 409, 383, 409, 519, 537, 541, + 391, 543, 544, 0, 590, 521, 529, 536, 383, 520, + 409, 596, 597, 615, 616, 406, 409, 596, 406, 596, + 406, 596, 406, 596, 406, 596, 596, 615, 406, 596, + 409, 594, 595, 541, 550, 377, 409, 433, 533, 534, + 409, 540, 375, 383, 542, 377, 568, 593, 379, 525, + 524, 526, 409, 409, 373, 382, 542, 377, 380, 383, + 353, 354, 372, 373, 384, 385, 386, 387, 405, 406, + 407, 408, 409, 439, 440, 441, 442, 443, 444, 445, + 446, 486, 487, 488, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 539, 541, 545, 542, 374, 409, 383, + 382, 380, 374, 380, 374, 380, 382, 380, 380, 380, + 374, 380, 380, 380, 380, 380, 380, 380, 374, 380, + 374, 380, 373, 376, 380, 383, 536, 541, 551, 552, + 549, 382, 374, 380, 374, 380, 376, 497, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 541, 375, 383, 377, 378, 383, 417, 418, 419, 420, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, + 448, 497, 510, 512, 514, 516, 520, 539, 541, 557, + 558, 559, 560, 561, 569, 570, 571, 572, 575, 576, + 579, 580, 581, 588, 593, 379, 382, 542, 382, 542, + 377, 512, 555, 382, 518, 409, 497, 497, 514, 353, + 354, 375, 379, 374, 374, 380, 416, 512, 373, 497, + 380, 392, 593, 372, 375, 406, 597, 615, 409, 616, + 372, 405, 406, 407, 408, 601, 602, 406, 510, 515, + 603, 406, 405, 406, 407, 408, 606, 607, 406, 405, + 406, 407, 408, 486, 608, 609, 406, 372, 610, 406, + 615, 409, 515, 546, 612, 613, 406, 515, 376, 595, + 541, 409, 553, 554, 378, 552, 551, 515, 534, 409, + 388, 389, 390, 385, 387, 351, 352, 355, 356, 391, + 392, 357, 358, 395, 394, 393, 359, 361, 360, 396, + 376, 376, 510, 378, 562, 373, 383, 383, 583, 373, + 373, 383, 383, 514, 373, 514, 381, 383, 383, 383, + 383, 362, 363, 364, 365, 366, 367, 368, 369, 370, + 371, 382, 513, 380, 383, 378, 558, 572, 576, 581, + 379, 555, 555, 382, 378, 555, 556, 555, 551, 374, + 489, 514, 409, 512, 497, 372, 406, 598, 599, 374, + 382, 374, 380, 374, 380, 374, 380, 380, 374, 380, + 374, 380, 374, 380, 380, 374, 380, 380, 374, 380, + 374, 380, 374, 374, 553, 542, 380, 383, 378, 497, + 497, 497, 499, 499, 500, 500, 501, 501, 501, 501, + 502, 502, 503, 504, 505, 506, 507, 508, 511, 376, + 569, 582, 558, 584, 514, 383, 514, 381, 512, 512, + 555, 378, 380, 378, 376, 376, 380, 376, 380, 602, + 601, 515, 603, 607, 606, 609, 608, 372, 610, 612, + 613, 383, 554, 514, 563, 514, 529, 574, 417, 557, + 570, 585, 374, 374, 378, 555, 372, 406, 374, 374, + 374, 374, 374, 374, 381, 378, 409, 374, 373, 574, + 586, 587, 565, 566, 567, 573, 577, 512, 382, 559, + 564, 568, 514, 383, 374, 421, 561, 559, 377, 555, + 374, 514, 564, 565, 569, 578, 383, 378 +}; + +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ +static const yytype_int16 yyr1[] = +{ + 0, 485, 486, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 488, 488, + 488, 488, 488, 488, 489, 490, 491, 492, 492, 493, + 493, 494, 494, 495, 496, 496, 496, 497, 497, 497, + 497, 498, 498, 498, 498, 499, 499, 499, 499, 500, + 500, 500, 501, 501, 501, 502, 502, 502, 502, 502, + 503, 503, 503, 504, 504, 505, 505, 506, 506, 507, + 507, 508, 508, 509, 509, 510, 511, 510, 512, 512, + 513, 513, 513, 513, 513, 513, 513, 513, 513, 513, + 513, 514, 514, 515, 516, 516, 516, 516, 516, 516, + 516, 516, 516, 516, 518, 517, 519, 519, 520, 520, + 520, 520, 521, 521, 522, 522, 522, 523, 524, 524, + 524, 525, 525, 525, 525, 526, 527, 527, 527, 527, + 527, 528, 528, 528, 528, 528, 529, 529, 530, 531, + 531, 531, 531, 531, 531, 531, 531, 531, 531, 532, + 533, 533, 534, 534, 534, 535, 536, 536, 537, 537, + 537, 537, 537, 537, 537, 537, 537, 537, 537, 538, + 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, + 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, + 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, + 538, 538, 538, 538, 538, 538, 538, 538, 538, 539, + 540, 540, 541, 541, 542, 542, 542, 542, 543, 543, + 544, 545, 545, 545, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 547, 547, 547, 549, 548, 550, 548, 551, + 551, 552, 552, 553, 553, 554, 554, 555, 555, 555, + 555, 556, 556, 557, 558, 558, 559, 559, 559, 559, + 559, 559, 559, 559, 560, 561, 562, 563, 561, 564, + 564, 566, 565, 567, 565, 568, 568, 569, 569, 570, + 570, 571, 571, 572, 573, 573, 574, 574, 575, 575, + 577, 576, 578, 578, 579, 579, 580, 580, 582, 581, + 583, 581, 584, 581, 585, 585, 586, 586, 587, 587, + 588, 588, 588, 588, 588, 588, 588, 588, 589, 589, + 590, 590, 590, 592, 591, 593, 594, 594, 595, 595, + 596, 596, 597, 597, 598, 598, 599, 599, 600, 600, + 600, 600, 600, 600, 601, 601, 602, 602, 602, 602, + 602, 603, 603, 604, 604, 605, 605, 605, 605, 605, + 605, 605, 605, 606, 606, 607, 607, 607, 607, 608, + 608, 609, 609, 609, 609, 609, 610, 610, 611, 611, + 611, 611, 612, 612, 613, 613, 614, 614, 615, 615, + 616, 616 +}; + +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr2[] = +{ + 0, 2, 1, 1, 3, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, + 1, 3, 2, 2, 1, 1, 1, 2, 2, 2, + 1, 2, 3, 2, 1, 1, 1, 1, 2, 2, + 2, 1, 1, 1, 1, 1, 3, 3, 3, 1, + 3, 3, 1, 3, 3, 1, 3, 3, 3, 3, + 1, 3, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 3, 1, 0, 6, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 3, 1, 2, 3, 2, 2, 4, 2, + 3, 4, 2, 3, 0, 6, 1, 3, 2, 3, + 3, 4, 1, 1, 2, 3, 5, 3, 2, 3, + 4, 2, 1, 2, 1, 1, 1, 3, 4, 6, + 5, 1, 2, 3, 5, 4, 1, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, + 1, 3, 1, 3, 1, 1, 1, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, + 1, 3, 2, 3, 2, 3, 3, 4, 1, 0, + 3, 1, 1, 3, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 6, 0, 5, 1, + 2, 3, 4, 1, 3, 1, 2, 1, 3, 4, + 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 2, 0, 0, 5, 1, + 1, 0, 2, 0, 2, 2, 3, 1, 2, 1, + 2, 1, 2, 5, 3, 1, 1, 4, 1, 2, + 0, 8, 0, 1, 3, 2, 1, 2, 0, 6, + 0, 8, 0, 7, 1, 1, 1, 0, 2, 3, + 2, 2, 2, 3, 2, 2, 2, 2, 1, 2, + 1, 1, 1, 0, 3, 5, 1, 3, 1, 4, + 1, 3, 5, 5, 1, 3, 1, 3, 4, 6, + 6, 8, 6, 8, 1, 3, 1, 1, 1, 1, + 1, 1, 3, 4, 6, 4, 6, 6, 8, 6, + 8, 6, 8, 1, 3, 1, 1, 1, 1, 1, + 3, 1, 1, 1, 1, 1, 1, 3, 6, 8, + 4, 6, 1, 3, 1, 1, 4, 6, 1, 3, + 3, 3 +}; + + +enum { YYENOMEM = -2 }; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab + + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (pParseContext, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) + +/* Backward compatibility with an undocumented macro. + Use YYerror or YYUNDEF. */ +#define YYERRCODE YYUNDEF + + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + + + + +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Kind, Value, pParseContext); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/ + +static void +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, glslang::TParseContext* pParseContext) +{ + FILE *yyoutput = yyo; + YY_USE (yyoutput); + YY_USE (pParseContext); + if (!yyvaluep) + return; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/ + +static void +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, glslang::TParseContext* pParseContext) +{ + YYFPRINTF (yyo, "%s %s (", + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); + + yy_symbol_value_print (yyo, yykind, yyvaluep, pParseContext); + YYFPRINTF (yyo, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +static void +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +static void +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, + int yyrule, glslang::TParseContext* pParseContext) +{ + int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)], pParseContext); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule, pParseContext); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + +/* Context of a parse error. */ +typedef struct +{ + yy_state_t *yyssp; + yysymbol_kind_t yytoken; +} yypcontext_t; + +/* Put in YYARG at most YYARGN of the expected tokens given the + current YYCTX, and return the number of tokens stored in YYARG. If + YYARG is null, return the number of expected tokens (guaranteed to + be less than YYNTOKENS). Return YYENOMEM on memory exhaustion. + Return 0 if there are more than YYARGN expected tokens, yet fill + YYARG up to YYARGN. */ +static int +yypcontext_expected_tokens (const yypcontext_t *yyctx, + yysymbol_kind_t yyarg[], int yyargn) +{ + /* Actual size of YYARG. */ + int yycount = 0; + int yyn = yypact[+*yyctx->yyssp]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (!yyarg) + ++yycount; + else if (yycount == yyargn) + return 0; + else + yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx); + } + } + if (yyarg && yycount == 0 && 0 < yyargn) + yyarg[0] = YYSYMBOL_YYEMPTY; + return yycount; +} + + + + +#ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) +# else +/* Return the length of YYSTR. */ +static YYPTRDIFF_T +yystrlen (const char *yystr) +{ + YYPTRDIFF_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +#endif + +#ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +yystpcpy (char *yydest, const char *yysrc) +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +#endif + +#ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYPTRDIFF_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYPTRDIFF_T yyn = 0; + char const *yyp = yystr; + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + else + goto append; + + append: + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (yyres) + return yystpcpy (yyres, yystr) - yyres; + else + return yystrlen (yystr); +} +#endif + + +static int +yy_syntax_error_arguments (const yypcontext_t *yyctx, + yysymbol_kind_t yyarg[], int yyargn) +{ + /* Actual size of YYARG. */ + int yycount = 0; + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yyctx->yytoken != YYSYMBOL_YYEMPTY) + { + int yyn; + if (yyarg) + yyarg[yycount] = yyctx->yytoken; + ++yycount; + yyn = yypcontext_expected_tokens (yyctx, + yyarg ? yyarg + 1 : yyarg, yyargn - 1); + if (yyn == YYENOMEM) + return YYENOMEM; + else + yycount += yyn; + } + return yycount; +} + +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, + const yypcontext_t *yyctx) +{ + enum { YYARGS_MAX = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat: reported tokens (one for the "unexpected", + one per "expected"). */ + yysymbol_kind_t yyarg[YYARGS_MAX]; + /* Cumulated lengths of YYARG. */ + YYPTRDIFF_T yysize = 0; + + /* Actual size of YYARG. */ + int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX); + if (yycount == YYENOMEM) + return YYENOMEM; + + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + default: /* Avoid compiler warnings. */ + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +#undef YYCASE_ + } + + /* Compute error message size. Don't count the "%s"s, but reserve + room for the terminator. */ + yysize = yystrlen (yyformat) - 2 * yycount + 1; + { + int yyi; + for (yyi = 0; yyi < yycount; ++yyi) + { + YYPTRDIFF_T yysize1 + = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]); + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else + return YYENOMEM; + } + } + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return -1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]); + yyformat += 2; + } + else + { + ++yyp; + ++yyformat; + } + } + return 0; +} + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +static void +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep, glslang::TParseContext* pParseContext) +{ + YY_USE (yyvaluep); + YY_USE (pParseContext); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + + + + + +/*----------. +| yyparse. | +`----------*/ + +namespace QtShaderTools { + +int +yyparse (glslang::TParseContext* pParseContext) +{ +/* Lookahead token kind. */ +int yychar; + + +/* The semantic value of the lookahead symbol. */ +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); + + /* Number of syntax errors so far. */ + int yynerrs = 0; + + yy_state_fast_t yystate = 0; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus = 0; + + /* Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* Their size. */ + YYPTRDIFF_T yystacksize = YYINITDEPTH; + + /* The state stack: array, bottom, top. */ + yy_state_t yyssa[YYINITDEPTH]; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; + + /* The semantic value stack: array, bottom, top. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; + + int yyn; + /* The return value of yyparse. */ + int yyresult; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yychar = YYEMPTY; /* Cause a token to be read. */ + + goto yysetstate; + + +/*------------------------------------------------------------. +| yynewstate -- push a new state, which is found in yystate. | +`------------------------------------------------------------*/ +yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + +/*--------------------------------------------------------------------. +| yysetstate -- set current state (the top of the stack) to yystate. | +`--------------------------------------------------------------------*/ +yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + YY_IGNORE_USELESS_CAST_BEGIN + *yyssp = YY_CAST (yy_state_t, yystate); + YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (yyss, yyssp); + + if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + YYNOMEM; +#else + { + /* Get the current used size of the three stacks, in elements. */ + YYPTRDIFF_T yysize = yyssp - yyss + 1; + +# if defined yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + yy_state_t *yyss1 = yyss; + YYSTYPE *yyvs1 = yyvs; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * YYSIZEOF (*yyssp), + &yyvs1, yysize * YYSIZEOF (*yyvsp), + &yystacksize); + yyss = yyss1; + yyvs = yyvs1; + } +# else /* defined YYSTACK_RELOCATE */ + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + YYNOMEM; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yy_state_t *yyss1 = yyss; + union yyalloc *yyptr = + YY_CAST (union yyalloc *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); + if (! yyptr) + YYNOMEM; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YY_IGNORE_USELESS_CAST_BEGIN + YYDPRINTF ((stderr, "Stack size increased to %ld\n", + YY_CAST (long, yystacksize))); + YY_IGNORE_USELESS_CAST_END + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token\n")); + yychar = yylex (&yylval, parseContext); + } + + if (yychar <= YYEOF) + { + yychar = YYEOF; + yytoken = YYSYMBOL_YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else if (yychar == YYerror) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = YYUNDEF; + yytoken = YYSYMBOL_YYerror; + goto yyerrlab1; + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + /* Discard the shifted token. */ + yychar = YYEMPTY; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: /* variable_identifier: IDENTIFIER */ +#line 362 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[0].lex).loc, (yyvsp[0].lex).symbol, (yyvsp[0].lex).string); + } +#line 5457 "MachineIndependent/glslang_tab.cpp" + break; + + case 3: /* primary_expression: variable_identifier */ +#line 368 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } +#line 5465 "MachineIndependent/glslang_tab.cpp" + break; + + case 4: /* primary_expression: LEFT_PAREN expression RIGHT_PAREN */ +#line 371 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); + if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) + (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); + } +#line 5475 "MachineIndependent/glslang_tab.cpp" + break; + + case 5: /* primary_expression: FLOATCONSTANT */ +#line 376 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); + } +#line 5483 "MachineIndependent/glslang_tab.cpp" + break; + + case 6: /* primary_expression: INTCONSTANT */ +#line 379 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); + } +#line 5491 "MachineIndependent/glslang_tab.cpp" + break; + + case 7: /* primary_expression: UINTCONSTANT */ +#line 382 "MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); + } +#line 5500 "MachineIndependent/glslang_tab.cpp" + break; + + case 8: /* primary_expression: BOOLCONSTANT */ +#line 386 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); + } +#line 5508 "MachineIndependent/glslang_tab.cpp" + break; + + case 9: /* primary_expression: STRING_LITERAL */ +#line 389 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true); + } +#line 5516 "MachineIndependent/glslang_tab.cpp" + break; + + case 10: /* primary_expression: INT32CONSTANT */ +#line 392 "MachineIndependent/glslang.y" + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); + } +#line 5525 "MachineIndependent/glslang_tab.cpp" + break; + + case 11: /* primary_expression: UINT32CONSTANT */ +#line 396 "MachineIndependent/glslang.y" + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); + } +#line 5534 "MachineIndependent/glslang_tab.cpp" + break; + + case 12: /* primary_expression: INT64CONSTANT */ +#line 400 "MachineIndependent/glslang.y" + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i64, (yyvsp[0].lex).loc, true); + } +#line 5543 "MachineIndependent/glslang_tab.cpp" + break; + + case 13: /* primary_expression: UINT64CONSTANT */ +#line 404 "MachineIndependent/glslang.y" + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u64, (yyvsp[0].lex).loc, true); + } +#line 5552 "MachineIndependent/glslang_tab.cpp" + break; + + case 14: /* primary_expression: INT16CONSTANT */ +#line 408 "MachineIndependent/glslang.y" + { + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit integer literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((short)(yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); + } +#line 5561 "MachineIndependent/glslang_tab.cpp" + break; + + case 15: /* primary_expression: UINT16CONSTANT */ +#line 412 "MachineIndependent/glslang.y" + { + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((unsigned short)(yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); + } +#line 5570 "MachineIndependent/glslang_tab.cpp" + break; + + case 16: /* primary_expression: DOUBLECONSTANT */ +#line 416 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double literal"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtDouble, (yyvsp[0].lex).loc, true); + } +#line 5581 "MachineIndependent/glslang_tab.cpp" + break; + + case 17: /* primary_expression: FLOAT16CONSTANT */ +#line 422 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat16, (yyvsp[0].lex).loc, true); + } +#line 5590 "MachineIndependent/glslang_tab.cpp" + break; + + case 18: /* postfix_expression: primary_expression */ +#line 429 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } +#line 5598 "MachineIndependent/glslang_tab.cpp" + break; + + case 19: /* postfix_expression: postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET */ +#line 432 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[-2].lex).loc, (yyvsp[-3].interm.intermTypedNode), (yyvsp[-1].interm.intermTypedNode)); + } +#line 5606 "MachineIndependent/glslang_tab.cpp" + break; + + case 20: /* postfix_expression: function_call */ +#line 435 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } +#line 5614 "MachineIndependent/glslang_tab.cpp" + break; + + case 21: /* postfix_expression: postfix_expression DOT IDENTIFIER */ +#line 438 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode), *(yyvsp[0].lex).string); + } +#line 5622 "MachineIndependent/glslang_tab.cpp" + break; + + case 22: /* postfix_expression: postfix_expression INC_OP */ +#line 441 "MachineIndependent/glslang.y" + { + parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); + parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "++", (yyvsp[-1].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "++", EOpPostIncrement, (yyvsp[-1].interm.intermTypedNode)); + } +#line 5632 "MachineIndependent/glslang_tab.cpp" + break; + + case 23: /* postfix_expression: postfix_expression DEC_OP */ +#line 446 "MachineIndependent/glslang.y" + { + parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); + parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "--", (yyvsp[-1].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "--", EOpPostDecrement, (yyvsp[-1].interm.intermTypedNode)); + } +#line 5642 "MachineIndependent/glslang_tab.cpp" + break; + + case 24: /* integer_expression: expression */ +#line 454 "MachineIndependent/glslang.y" + { + parseContext.arrayIndexCheck((yyvsp[0].interm.intermTypedNode), "[]"); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } +#line 5651 "MachineIndependent/glslang_tab.cpp" + break; + + case 25: /* function_call: function_call_or_method */ +#line 461 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleFunctionCall((yyvsp[0].interm).loc, (yyvsp[0].interm).function, (yyvsp[0].interm).intermNode); + delete (yyvsp[0].interm).function; + } +#line 5660 "MachineIndependent/glslang_tab.cpp" + break; + + case 26: /* function_call_or_method: function_call_generic */ +#line 468 "MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[0].interm); + } +#line 5668 "MachineIndependent/glslang_tab.cpp" + break; + + case 27: /* function_call_generic: function_call_header_with_parameters RIGHT_PAREN */ +#line 474 "MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[-1].interm); + (yyval.interm).loc = (yyvsp[0].lex).loc; + } +#line 5677 "MachineIndependent/glslang_tab.cpp" + break; + + case 28: /* function_call_generic: function_call_header_no_parameters RIGHT_PAREN */ +#line 478 "MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[-1].interm); + (yyval.interm).loc = (yyvsp[0].lex).loc; + } +#line 5686 "MachineIndependent/glslang_tab.cpp" + break; + + case 29: /* function_call_header_no_parameters: function_call_header VOID */ +#line 485 "MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[-1].interm); + } +#line 5694 "MachineIndependent/glslang_tab.cpp" + break; + + case 30: /* function_call_header_no_parameters: function_call_header */ +#line 488 "MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[0].interm); + } +#line 5702 "MachineIndependent/glslang_tab.cpp" + break; + + case 31: /* function_call_header_with_parameters: function_call_header assignment_expression */ +#line 494 "MachineIndependent/glslang.y" + { + if (parseContext.spvVersion.vulkan > 0 + && parseContext.spvVersion.vulkanRelaxed + && (yyvsp[0].interm.intermTypedNode)->getType().containsOpaque()) + { + (yyval.interm).intermNode = parseContext.vkRelaxedRemapFunctionArgument((yyval.interm).loc, (yyvsp[-1].interm).function, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).function = (yyvsp[-1].interm).function; + } + else + { + TParameter param = { 0, new TType, {} }; + param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); + + (yyvsp[-1].interm).function->addParameter(param); + (yyval.interm).function = (yyvsp[-1].interm).function; + (yyval.interm).intermNode = (yyvsp[0].interm.intermTypedNode); + } + } +#line 5725 "MachineIndependent/glslang_tab.cpp" + break; + + case 32: /* function_call_header_with_parameters: function_call_header_with_parameters COMMA assignment_expression */ +#line 512 "MachineIndependent/glslang.y" + { + if (parseContext.spvVersion.vulkan > 0 + && parseContext.spvVersion.vulkanRelaxed + && (yyvsp[0].interm.intermTypedNode)->getType().containsOpaque()) + { + TIntermNode* remappedNode = parseContext.vkRelaxedRemapFunctionArgument((yyvsp[-1].lex).loc, (yyvsp[-2].interm).function, (yyvsp[0].interm.intermTypedNode)); + if (remappedNode == (yyvsp[0].interm.intermTypedNode)) + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); + else + (yyval.interm).intermNode = parseContext.intermediate.mergeAggregate((yyvsp[-2].interm).intermNode, remappedNode, (yyvsp[-1].lex).loc); + (yyval.interm).function = (yyvsp[-2].interm).function; + } + else + { + TParameter param = { 0, new TType, {} }; + param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); + + (yyvsp[-2].interm).function->addParameter(param); + (yyval.interm).function = (yyvsp[-2].interm).function; + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); + } + } +#line 5752 "MachineIndependent/glslang_tab.cpp" + break; + + case 33: /* function_call_header: function_identifier LEFT_PAREN */ +#line 537 "MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[-1].interm); + } +#line 5760 "MachineIndependent/glslang_tab.cpp" + break; + + case 34: /* function_identifier: type_specifier */ +#line 545 "MachineIndependent/glslang.y" + { + // Constructor + (yyval.interm).intermNode = 0; + (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); + } +#line 5770 "MachineIndependent/glslang_tab.cpp" + break; + + case 35: /* function_identifier: postfix_expression */ +#line 550 "MachineIndependent/glslang.y" + { + // + // Should be a method or subroutine call, but we haven't recognized the arguments yet. + // + (yyval.interm).function = 0; + (yyval.interm).intermNode = 0; + + TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode(); + if (method) { + (yyval.interm).function = new TFunction(&method->getMethodName(), method->getType(), EOpArrayLength); + (yyval.interm).intermNode = method->getObject(); + } else { + TIntermSymbol* symbol = (yyvsp[0].interm.intermTypedNode)->getAsSymbolNode(); + if (symbol) { + parseContext.reservedErrorCheck(symbol->getLoc(), symbol->getName()); + TFunction *function = new TFunction(&symbol->getName(), TType(EbtVoid)); + (yyval.interm).function = function; + } else + parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "function call, method, or subroutine call expected", "", ""); + } + + if ((yyval.interm).function == 0) { + // error recover + TString* empty = NewPoolTString(""); + (yyval.interm).function = new TFunction(empty, TType(EbtVoid), EOpNull); + } + } +#line 5802 "MachineIndependent/glslang_tab.cpp" + break; + + case 36: /* function_identifier: non_uniform_qualifier */ +#line 577 "MachineIndependent/glslang.y" + { + // Constructor + (yyval.interm).intermNode = 0; + (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); + } +#line 5812 "MachineIndependent/glslang_tab.cpp" + break; + + case 37: /* unary_expression: postfix_expression */ +#line 585 "MachineIndependent/glslang.y" + { + parseContext.variableCheck((yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + if (TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode()) + parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), ""); + } +#line 5823 "MachineIndependent/glslang_tab.cpp" + break; + + case 38: /* unary_expression: INC_OP unary_expression */ +#line 591 "MachineIndependent/glslang.y" + { + parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "++", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "++", EOpPreIncrement, (yyvsp[0].interm.intermTypedNode)); + } +#line 5832 "MachineIndependent/glslang_tab.cpp" + break; + + case 39: /* unary_expression: DEC_OP unary_expression */ +#line 595 "MachineIndependent/glslang.y" + { + parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "--", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "--", EOpPreDecrement, (yyvsp[0].interm.intermTypedNode)); + } +#line 5841 "MachineIndependent/glslang_tab.cpp" + break; + + case 40: /* unary_expression: unary_operator unary_expression */ +#line 599 "MachineIndependent/glslang.y" + { + if ((yyvsp[-1].interm).op != EOpNull) { + char errorOp[2] = {0, 0}; + switch((yyvsp[-1].interm).op) { + case EOpNegative: errorOp[0] = '-'; break; + case EOpLogicalNot: errorOp[0] = '!'; break; + case EOpBitwiseNot: errorOp[0] = '~'; break; + default: break; // some compilers want this + } + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].interm).loc, errorOp, (yyvsp[-1].interm).op, (yyvsp[0].interm.intermTypedNode)); + } else { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) + (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); + } + } +#line 5862 "MachineIndependent/glslang_tab.cpp" + break; + + case 41: /* unary_operator: PLUS */ +#line 619 "MachineIndependent/glslang.y" + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } +#line 5868 "MachineIndependent/glslang_tab.cpp" + break; + + case 42: /* unary_operator: DASH */ +#line 620 "MachineIndependent/glslang.y" + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNegative; } +#line 5874 "MachineIndependent/glslang_tab.cpp" + break; + + case 43: /* unary_operator: BANG */ +#line 621 "MachineIndependent/glslang.y" + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLogicalNot; } +#line 5880 "MachineIndependent/glslang_tab.cpp" + break; + + case 44: /* unary_operator: TILDE */ +#line 622 "MachineIndependent/glslang.y" + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpBitwiseNot; + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise not"); } +#line 5887 "MachineIndependent/glslang_tab.cpp" + break; + + case 45: /* multiplicative_expression: unary_expression */ +#line 628 "MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 5893 "MachineIndependent/glslang_tab.cpp" + break; + + case 46: /* multiplicative_expression: multiplicative_expression STAR unary_expression */ +#line 629 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "*", EOpMul, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 5903 "MachineIndependent/glslang_tab.cpp" + break; + + case 47: /* multiplicative_expression: multiplicative_expression SLASH unary_expression */ +#line 634 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "/", EOpDiv, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 5913 "MachineIndependent/glslang_tab.cpp" + break; + + case 48: /* multiplicative_expression: multiplicative_expression PERCENT unary_expression */ +#line 639 "MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "%"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "%", EOpMod, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 5924 "MachineIndependent/glslang_tab.cpp" + break; + + case 49: /* additive_expression: multiplicative_expression */ +#line 648 "MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 5930 "MachineIndependent/glslang_tab.cpp" + break; + + case 50: /* additive_expression: additive_expression PLUS multiplicative_expression */ +#line 649 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "+", EOpAdd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 5940 "MachineIndependent/glslang_tab.cpp" + break; + + case 51: /* additive_expression: additive_expression DASH multiplicative_expression */ +#line 654 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "-", EOpSub, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 5950 "MachineIndependent/glslang_tab.cpp" + break; + + case 52: /* shift_expression: additive_expression */ +#line 662 "MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 5956 "MachineIndependent/glslang_tab.cpp" + break; + + case 53: /* shift_expression: shift_expression LEFT_OP additive_expression */ +#line 663 "MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift left"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<<", EOpLeftShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 5967 "MachineIndependent/glslang_tab.cpp" + break; + + case 54: /* shift_expression: shift_expression RIGHT_OP additive_expression */ +#line 669 "MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift right"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">>", EOpRightShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 5978 "MachineIndependent/glslang_tab.cpp" + break; + + case 55: /* relational_expression: shift_expression */ +#line 678 "MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 5984 "MachineIndependent/glslang_tab.cpp" + break; + + case 56: /* relational_expression: relational_expression LEFT_ANGLE shift_expression */ +#line 679 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<", EOpLessThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 5994 "MachineIndependent/glslang_tab.cpp" + break; + + case 57: /* relational_expression: relational_expression RIGHT_ANGLE shift_expression */ +#line 684 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">", EOpGreaterThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 6004 "MachineIndependent/glslang_tab.cpp" + break; + + case 58: /* relational_expression: relational_expression LE_OP shift_expression */ +#line 689 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<=", EOpLessThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 6014 "MachineIndependent/glslang_tab.cpp" + break; + + case 59: /* relational_expression: relational_expression GE_OP shift_expression */ +#line 694 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 6024 "MachineIndependent/glslang_tab.cpp" + break; + + case 60: /* equality_expression: relational_expression */ +#line 702 "MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 6030 "MachineIndependent/glslang_tab.cpp" + break; + + case 61: /* equality_expression: equality_expression EQ_OP relational_expression */ +#line 703 "MachineIndependent/glslang.y" + { + parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); + parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); + parseContext.specializationCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); + parseContext.referenceCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "==", EOpEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 6044 "MachineIndependent/glslang_tab.cpp" + break; + + case 62: /* equality_expression: equality_expression NE_OP relational_expression */ +#line 712 "MachineIndependent/glslang.y" + { + parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); + parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); + parseContext.specializationCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); + parseContext.referenceCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "!=", EOpNotEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 6058 "MachineIndependent/glslang_tab.cpp" + break; + + case 63: /* and_expression: equality_expression */ +#line 724 "MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 6064 "MachineIndependent/glslang_tab.cpp" + break; + + case 64: /* and_expression: and_expression AMPERSAND equality_expression */ +#line 725 "MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise and"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&", EOpAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 6075 "MachineIndependent/glslang_tab.cpp" + break; + + case 65: /* exclusive_or_expression: and_expression */ +#line 734 "MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 6081 "MachineIndependent/glslang_tab.cpp" + break; + + case 66: /* exclusive_or_expression: exclusive_or_expression CARET and_expression */ +#line 735 "MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise exclusive or"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^", EOpExclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 6092 "MachineIndependent/glslang_tab.cpp" + break; + + case 67: /* inclusive_or_expression: exclusive_or_expression */ +#line 744 "MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 6098 "MachineIndependent/glslang_tab.cpp" + break; + + case 68: /* inclusive_or_expression: inclusive_or_expression VERTICAL_BAR exclusive_or_expression */ +#line 745 "MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise inclusive or"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "|", EOpInclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 6109 "MachineIndependent/glslang_tab.cpp" + break; + + case 69: /* logical_and_expression: inclusive_or_expression */ +#line 754 "MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 6115 "MachineIndependent/glslang_tab.cpp" + break; + + case 70: /* logical_and_expression: logical_and_expression AND_OP inclusive_or_expression */ +#line 755 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&&", EOpLogicalAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 6125 "MachineIndependent/glslang_tab.cpp" + break; + + case 71: /* logical_xor_expression: logical_and_expression */ +#line 763 "MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 6131 "MachineIndependent/glslang_tab.cpp" + break; + + case 72: /* logical_xor_expression: logical_xor_expression XOR_OP logical_and_expression */ +#line 764 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^^", EOpLogicalXor, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 6141 "MachineIndependent/glslang_tab.cpp" + break; + + case 73: /* logical_or_expression: logical_xor_expression */ +#line 772 "MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 6147 "MachineIndependent/glslang_tab.cpp" + break; + + case 74: /* logical_or_expression: logical_or_expression OR_OP logical_xor_expression */ +#line 773 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "||", EOpLogicalOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 6157 "MachineIndependent/glslang_tab.cpp" + break; + + case 75: /* conditional_expression: logical_or_expression */ +#line 781 "MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 6163 "MachineIndependent/glslang_tab.cpp" + break; + + case 76: /* $@1: %empty */ +#line 782 "MachineIndependent/glslang.y" + { + ++parseContext.controlFlowNestingLevel; + } +#line 6171 "MachineIndependent/glslang_tab.cpp" + break; + + case 77: /* conditional_expression: logical_or_expression QUESTION $@1 expression COLON assignment_expression */ +#line 785 "MachineIndependent/glslang.y" + { + --parseContext.controlFlowNestingLevel; + parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-5].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-4].lex).loc, "?", (yyvsp[-5].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-1].lex).loc, ":", (yyvsp[-2].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-1].lex).loc, ":", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addSelection((yyvsp[-5].interm.intermTypedNode), (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-4].lex).loc); + if ((yyval.interm.intermTypedNode) == 0) { + parseContext.binaryOpError((yyvsp[-4].lex).loc, ":", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), (yyvsp[0].interm.intermTypedNode)->getCompleteString(parseContext.intermediate.getEnhancedMsgs())); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } + } +#line 6188 "MachineIndependent/glslang_tab.cpp" + break; + + case 78: /* assignment_expression: conditional_expression */ +#line 800 "MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 6194 "MachineIndependent/glslang_tab.cpp" + break; + + case 79: /* assignment_expression: unary_expression assignment_operator assignment_expression */ +#line 801 "MachineIndependent/glslang.y" + { + parseContext.arrayObjectCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array assignment"); + parseContext.opaqueCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); + parseContext.storage16BitAssignmentCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); + parseContext.specializationCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); + parseContext.lValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.addAssign((yyvsp[-1].interm).loc, (yyvsp[-1].interm).op, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) { + parseContext.assignError((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), (yyvsp[0].interm.intermTypedNode)->getCompleteString(parseContext.intermediate.getEnhancedMsgs())); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } + } +#line 6212 "MachineIndependent/glslang_tab.cpp" + break; + + case 80: /* assignment_operator: EQUAL */ +#line 817 "MachineIndependent/glslang.y" + { + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpAssign; + } +#line 6221 "MachineIndependent/glslang_tab.cpp" + break; + + case 81: /* assignment_operator: MUL_ASSIGN */ +#line 821 "MachineIndependent/glslang.y" + { + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpMulAssign; + } +#line 6230 "MachineIndependent/glslang_tab.cpp" + break; + + case 82: /* assignment_operator: DIV_ASSIGN */ +#line 825 "MachineIndependent/glslang.y" + { + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpDivAssign; + } +#line 6239 "MachineIndependent/glslang_tab.cpp" + break; + + case 83: /* assignment_operator: MOD_ASSIGN */ +#line 829 "MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "%="); + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpModAssign; + } +#line 6249 "MachineIndependent/glslang_tab.cpp" + break; + + case 84: /* assignment_operator: ADD_ASSIGN */ +#line 834 "MachineIndependent/glslang.y" + { + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpAddAssign; + } +#line 6258 "MachineIndependent/glslang_tab.cpp" + break; + + case 85: /* assignment_operator: SUB_ASSIGN */ +#line 838 "MachineIndependent/glslang.y" + { + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpSubAssign; + } +#line 6267 "MachineIndependent/glslang_tab.cpp" + break; + + case 86: /* assignment_operator: LEFT_ASSIGN */ +#line 842 "MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift left assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; + } +#line 6276 "MachineIndependent/glslang_tab.cpp" + break; + + case 87: /* assignment_operator: RIGHT_ASSIGN */ +#line 846 "MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift right assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpRightShiftAssign; + } +#line 6285 "MachineIndependent/glslang_tab.cpp" + break; + + case 88: /* assignment_operator: AND_ASSIGN */ +#line 850 "MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-and assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAndAssign; + } +#line 6294 "MachineIndependent/glslang_tab.cpp" + break; + + case 89: /* assignment_operator: XOR_ASSIGN */ +#line 854 "MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-xor assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; + } +#line 6303 "MachineIndependent/glslang_tab.cpp" + break; + + case 90: /* assignment_operator: OR_ASSIGN */ +#line 858 "MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-or assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; + } +#line 6312 "MachineIndependent/glslang_tab.cpp" + break; + + case 91: /* expression: assignment_expression */ +#line 865 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } +#line 6320 "MachineIndependent/glslang_tab.cpp" + break; + + case 92: /* expression: expression COMMA assignment_expression */ +#line 868 "MachineIndependent/glslang.y" + { + parseContext.samplerConstructorLocationCheck((yyvsp[-1].lex).loc, ",", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addComma((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); + if ((yyval.interm.intermTypedNode) == 0) { + parseContext.binaryOpError((yyvsp[-1].lex).loc, ",", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), (yyvsp[0].interm.intermTypedNode)->getCompleteString(parseContext.intermediate.getEnhancedMsgs())); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } + } +#line 6333 "MachineIndependent/glslang_tab.cpp" + break; + + case 93: /* constant_expression: conditional_expression */ +#line 879 "MachineIndependent/glslang.y" + { + parseContext.constantValueCheck((yyvsp[0].interm.intermTypedNode), ""); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } +#line 6342 "MachineIndependent/glslang_tab.cpp" + break; + + case 94: /* declaration: function_prototype SEMICOLON */ +#line 886 "MachineIndependent/glslang.y" + { + parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */); + (yyval.interm.intermNode) = 0; + // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature + } +#line 6352 "MachineIndependent/glslang_tab.cpp" + break; + + case 95: /* declaration: spirv_instruction_qualifier function_prototype SEMICOLON */ +#line 891 "MachineIndependent/glslang.y" + { + parseContext.requireExtensions((yyvsp[-1].interm).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V instruction qualifier"); + (yyvsp[-1].interm).function->setSpirvInstruction(*(yyvsp[-2].interm.spirvInst)); // Attach SPIR-V intruction qualifier + parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */); + (yyval.interm.intermNode) = 0; + // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature + } +#line 6364 "MachineIndependent/glslang_tab.cpp" + break; + + case 96: /* declaration: spirv_execution_mode_qualifier SEMICOLON */ +#line 898 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "SPIR-V execution mode qualifier"); + parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V execution mode qualifier"); + (yyval.interm.intermNode) = 0; + } +#line 6374 "MachineIndependent/glslang_tab.cpp" + break; + + case 97: /* declaration: init_declarator_list SEMICOLON */ +#line 903 "MachineIndependent/glslang.y" + { + if ((yyvsp[-1].interm).intermNode && (yyvsp[-1].interm).intermNode->getAsAggregate()) + (yyvsp[-1].interm).intermNode->getAsAggregate()->setOperator(EOpSequence); + (yyval.interm.intermNode) = (yyvsp[-1].interm).intermNode; + } +#line 6384 "MachineIndependent/glslang_tab.cpp" + break; + + case 98: /* declaration: PRECISION precision_qualifier type_specifier SEMICOLON */ +#line 908 "MachineIndependent/glslang.y" + { + parseContext.profileRequires((yyvsp[-3].lex).loc, ENoProfile, 130, 0, "precision statement"); + // lazy setting of the previous scope's defaults, has effect only the first time it is called in a particular scope + parseContext.symbolTable.setPreviousDefaultPrecisions(&parseContext.defaultPrecision[0]); + parseContext.setDefaultPrecision((yyvsp[-3].lex).loc, (yyvsp[-1].interm.type), (yyvsp[-2].interm.type).qualifier.precision); + (yyval.interm.intermNode) = 0; + } +#line 6396 "MachineIndependent/glslang_tab.cpp" + break; + + case 99: /* declaration: block_structure SEMICOLON */ +#line 915 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList); + } +#line 6404 "MachineIndependent/glslang_tab.cpp" + break; + + case 100: /* declaration: block_structure IDENTIFIER SEMICOLON */ +#line 918 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string); + } +#line 6412 "MachineIndependent/glslang_tab.cpp" + break; + + case 101: /* declaration: block_structure IDENTIFIER array_specifier SEMICOLON */ +#line 921 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes); + } +#line 6420 "MachineIndependent/glslang_tab.cpp" + break; + + case 102: /* declaration: type_qualifier SEMICOLON */ +#line 924 "MachineIndependent/glslang.y" + { + parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); + parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type)); + (yyval.interm.intermNode) = 0; + } +#line 6430 "MachineIndependent/glslang_tab.cpp" + break; + + case 103: /* declaration: type_qualifier identifier_list SEMICOLON */ +#line 929 "MachineIndependent/glslang.y" + { + parseContext.checkNoShaderLayouts((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).shaderQualifiers); + parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].interm.identifierList)); + (yyval.interm.intermNode) = 0; + } +#line 6440 "MachineIndependent/glslang_tab.cpp" + break; + + case 104: /* $@2: %empty */ +#line 937 "MachineIndependent/glslang.y" + { parseContext.nestedBlockCheck((yyvsp[-2].interm.type).loc); } +#line 6446 "MachineIndependent/glslang_tab.cpp" + break; + + case 105: /* block_structure: type_qualifier IDENTIFIER LEFT_BRACE $@2 struct_declaration_list RIGHT_BRACE */ +#line 937 "MachineIndependent/glslang.y" + { + --parseContext.blockNestingLevel; + parseContext.blockName = (yyvsp[-4].lex).string; + parseContext.globalQualifierFixCheck((yyvsp[-5].interm.type).loc, (yyvsp[-5].interm.type).qualifier); + parseContext.checkNoShaderLayouts((yyvsp[-5].interm.type).loc, (yyvsp[-5].interm.type).shaderQualifiers); + parseContext.currentBlockQualifier = (yyvsp[-5].interm.type).qualifier; + (yyval.interm).loc = (yyvsp[-5].interm.type).loc; + (yyval.interm).typeList = (yyvsp[-1].interm.typeList); + } +#line 6460 "MachineIndependent/glslang_tab.cpp" + break; + + case 106: /* identifier_list: IDENTIFIER */ +#line 948 "MachineIndependent/glslang.y" + { + (yyval.interm.identifierList) = new TIdentifierList; + (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); + } +#line 6469 "MachineIndependent/glslang_tab.cpp" + break; + + case 107: /* identifier_list: identifier_list COMMA IDENTIFIER */ +#line 952 "MachineIndependent/glslang.y" + { + (yyval.interm.identifierList) = (yyvsp[-2].interm.identifierList); + (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); + } +#line 6478 "MachineIndependent/glslang_tab.cpp" + break; + + case 108: /* function_prototype: function_declarator RIGHT_PAREN */ +#line 959 "MachineIndependent/glslang.y" + { + (yyval.interm).function = (yyvsp[-1].interm.function); + if (parseContext.compileOnly) (yyval.interm).function->setExport(); + (yyval.interm).loc = (yyvsp[0].lex).loc; + } +#line 6488 "MachineIndependent/glslang_tab.cpp" + break; + + case 109: /* function_prototype: function_declarator RIGHT_PAREN attribute */ +#line 964 "MachineIndependent/glslang.y" + { + (yyval.interm).function = (yyvsp[-2].interm.function); + if (parseContext.compileOnly) (yyval.interm).function->setExport(); + (yyval.interm).loc = (yyvsp[-1].lex).loc; + const char * extensions[2] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence }; + parseContext.requireExtensions((yyvsp[-1].lex).loc, 2, extensions, "attribute"); + parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes)); + } +#line 6501 "MachineIndependent/glslang_tab.cpp" + break; + + case 110: /* function_prototype: attribute function_declarator RIGHT_PAREN */ +#line 972 "MachineIndependent/glslang.y" + { + (yyval.interm).function = (yyvsp[-1].interm.function); + if (parseContext.compileOnly) (yyval.interm).function->setExport(); + (yyval.interm).loc = (yyvsp[0].lex).loc; + const char * extensions[2] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence }; + parseContext.requireExtensions((yyvsp[0].lex).loc, 2, extensions, "attribute"); + parseContext.handleFunctionAttributes((yyvsp[0].lex).loc, *(yyvsp[-2].interm.attributes)); + } +#line 6514 "MachineIndependent/glslang_tab.cpp" + break; + + case 111: /* function_prototype: attribute function_declarator RIGHT_PAREN attribute */ +#line 980 "MachineIndependent/glslang.y" + { + (yyval.interm).function = (yyvsp[-2].interm.function); + if (parseContext.compileOnly) (yyval.interm).function->setExport(); + (yyval.interm).loc = (yyvsp[-1].lex).loc; + const char * extensions[2] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence }; + parseContext.requireExtensions((yyvsp[-1].lex).loc, 2, extensions, "attribute"); + parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[-3].interm.attributes)); + parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes)); + } +#line 6528 "MachineIndependent/glslang_tab.cpp" + break; + + case 112: /* function_declarator: function_header */ +#line 992 "MachineIndependent/glslang.y" + { + (yyval.interm.function) = (yyvsp[0].interm.function); + } +#line 6536 "MachineIndependent/glslang_tab.cpp" + break; + + case 113: /* function_declarator: function_header_with_parameters */ +#line 995 "MachineIndependent/glslang.y" + { + (yyval.interm.function) = (yyvsp[0].interm.function); + } +#line 6544 "MachineIndependent/glslang_tab.cpp" + break; + + case 114: /* function_header_with_parameters: function_header parameter_declaration */ +#line 1002 "MachineIndependent/glslang.y" + { + // Add the parameter + (yyval.interm.function) = (yyvsp[-1].interm.function); + if ((yyvsp[0].interm).param.type->getBasicType() != EbtVoid) + { + if (!(parseContext.spvVersion.vulkan > 0 && parseContext.spvVersion.vulkanRelaxed)) + (yyvsp[-1].interm.function)->addParameter((yyvsp[0].interm).param); + else + parseContext.vkRelaxedRemapFunctionParameter((yyvsp[-1].interm.function), (yyvsp[0].interm).param); + } + else + delete (yyvsp[0].interm).param.type; + } +#line 6562 "MachineIndependent/glslang_tab.cpp" + break; + + case 115: /* function_header_with_parameters: function_header_with_parameters COMMA parameter_declaration */ +#line 1015 "MachineIndependent/glslang.y" + { + // + // Only first parameter of one-parameter functions can be void + // The check for named parameters not being void is done in parameter_declarator + // + if ((yyvsp[0].interm).param.type->getBasicType() == EbtVoid) { + // + // This parameter > first is void + // + parseContext.error((yyvsp[-1].lex).loc, "cannot be an argument type except for '(void)'", "void", ""); + delete (yyvsp[0].interm).param.type; + } else { + // Add the parameter + (yyval.interm.function) = (yyvsp[-2].interm.function); + if (!(parseContext.spvVersion.vulkan > 0 && parseContext.spvVersion.vulkanRelaxed)) + (yyvsp[-2].interm.function)->addParameter((yyvsp[0].interm).param); + else + parseContext.vkRelaxedRemapFunctionParameter((yyvsp[-2].interm.function), (yyvsp[0].interm).param); + } + } +#line 6587 "MachineIndependent/glslang_tab.cpp" + break; + + case 116: /* function_header_with_parameters: function_header_with_parameters COMMA DOT DOT DOT */ +#line 1035 "MachineIndependent/glslang.y" + { + (yyval.interm.function) = (yyvsp[-4].interm.function); + parseContext.makeVariadic((yyvsp[-4].interm.function), (yyvsp[-2].lex).loc); + } +#line 6596 "MachineIndependent/glslang_tab.cpp" + break; + + case 117: /* function_header: fully_specified_type IDENTIFIER LEFT_PAREN */ +#line 1042 "MachineIndependent/glslang.y" + { + if ((yyvsp[-2].interm.type).qualifier.storage != EvqGlobal && (yyvsp[-2].interm.type).qualifier.storage != EvqTemporary) { + parseContext.error((yyvsp[-1].lex).loc, "no qualifiers allowed for function return", + GetStorageQualifierString((yyvsp[-2].interm.type).qualifier.storage), ""); + } + if ((yyvsp[-2].interm.type).arraySizes) + parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); + + // Add the function as a prototype after parsing it (we do not support recursion) + TFunction *function; + TType type((yyvsp[-2].interm.type)); + + // Potentially rename shader entry point function. No-op most of the time. + parseContext.renameShaderFunction((yyvsp[-1].lex).string); + + // Make the function + function = new TFunction((yyvsp[-1].lex).string, type); + (yyval.interm.function) = function; + } +#line 6620 "MachineIndependent/glslang_tab.cpp" + break; + + case 118: /* parameter_declarator: type_specifier IDENTIFIER */ +#line 1065 "MachineIndependent/glslang.y" + { + if ((yyvsp[-1].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[-1].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[-1].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + parseContext.arraySizeRequiredCheck((yyvsp[-1].interm.type).loc, *(yyvsp[-1].interm.type).arraySizes); + } + if ((yyvsp[-1].interm.type).basicType == EbtVoid) { + parseContext.error((yyvsp[0].lex).loc, "illegal use of type 'void'", (yyvsp[0].lex).string->c_str(), ""); + } + parseContext.reservedErrorCheck((yyvsp[0].lex).loc, *(yyvsp[0].lex).string); + + TParameter param = {(yyvsp[0].lex).string, new TType((yyvsp[-1].interm.type)), {}}; + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).param = param; + } +#line 6640 "MachineIndependent/glslang_tab.cpp" + break; + + case 119: /* parameter_declarator: type_specifier IDENTIFIER array_specifier */ +#line 1080 "MachineIndependent/glslang.y" + { + if ((yyvsp[-2].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); + } + TType* type = new TType((yyvsp[-2].interm.type)); + type->transferArraySizes((yyvsp[0].interm).arraySizes); + type->copyArrayInnerSizes((yyvsp[-2].interm.type).arraySizes); + + parseContext.arrayOfArrayVersionCheck((yyvsp[-1].lex).loc, type->getArraySizes()); + parseContext.arraySizeRequiredCheck((yyvsp[0].interm).loc, *(yyvsp[0].interm).arraySizes); + parseContext.reservedErrorCheck((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string); + + TParameter param = { (yyvsp[-1].lex).string, type, {} }; + + (yyval.interm).loc = (yyvsp[-1].lex).loc; + (yyval.interm).param = param; + } +#line 6664 "MachineIndependent/glslang_tab.cpp" + break; + + case 120: /* parameter_declarator: type_specifier IDENTIFIER EQUAL initializer */ +#line 1099 "MachineIndependent/glslang.y" + { + TParameter param = parseContext.getParamWithDefault((yyvsp[-3].interm.type), (yyvsp[-2].lex).string, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); + (yyval.interm).loc = (yyvsp[-2].lex).loc; + (yyval.interm).param = param; + } +#line 6674 "MachineIndependent/glslang_tab.cpp" + break; + + case 121: /* parameter_declaration: type_qualifier parameter_declarator */ +#line 1110 "MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[0].interm); + if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) + (yyval.interm).param.type->getQualifier().precision = (yyvsp[-1].interm.type).qualifier.precision; + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier(), (yyval.interm).param.type->hasTypeParameter()); + + parseContext.checkNoShaderLayouts((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); + parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); + + } +#line 6690 "MachineIndependent/glslang_tab.cpp" + break; + + case 122: /* parameter_declaration: parameter_declarator */ +#line 1121 "MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[0].interm); + + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, EvqIn, *(yyvsp[0].interm).param.type); + parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier(), (yyval.interm).param.type->hasTypeParameter()); + } +#line 6702 "MachineIndependent/glslang_tab.cpp" + break; + + case 123: /* parameter_declaration: type_qualifier parameter_type_specifier */ +#line 1131 "MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[0].interm); + if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) + (yyval.interm).param.type->getQualifier().precision = (yyvsp[-1].interm.type).qualifier.precision; + parseContext.precisionQualifierCheck((yyvsp[-1].interm.type).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier(), (yyval.interm).param.type->hasTypeParameter()); + + parseContext.checkNoShaderLayouts((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); + parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); + } +#line 6717 "MachineIndependent/glslang_tab.cpp" + break; + + case 124: /* parameter_declaration: parameter_type_specifier */ +#line 1141 "MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[0].interm); + + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, EvqIn, *(yyvsp[0].interm).param.type); + parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier(), (yyval.interm).param.type->hasTypeParameter()); + } +#line 6729 "MachineIndependent/glslang_tab.cpp" + break; + + case 125: /* parameter_type_specifier: type_specifier */ +#line 1151 "MachineIndependent/glslang.y" + { + TParameter param = { 0, new TType((yyvsp[0].interm.type)), {} }; + (yyval.interm).param = param; + if ((yyvsp[0].interm.type).arraySizes) + parseContext.arraySizeRequiredCheck((yyvsp[0].interm.type).loc, *(yyvsp[0].interm.type).arraySizes); + } +#line 6740 "MachineIndependent/glslang_tab.cpp" + break; + + case 126: /* init_declarator_list: single_declaration */ +#line 1160 "MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[0].interm); + } +#line 6748 "MachineIndependent/glslang_tab.cpp" + break; + + case 127: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER */ +#line 1163 "MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[-2].interm); + TIntermNode* declNode = parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-2].interm).type); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, declNode, (yyvsp[0].lex).loc); + } +#line 6758 "MachineIndependent/glslang_tab.cpp" + break; + + case 128: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER array_specifier */ +#line 1168 "MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[-3].interm); + TIntermNode* declNode = parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-3].interm).type, (yyvsp[0].interm).arraySizes); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-3].interm).intermNode, declNode, (yyvsp[-1].lex).loc); + } +#line 6768 "MachineIndependent/glslang_tab.cpp" + break; + + case 129: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER array_specifier EQUAL initializer */ +#line 1173 "MachineIndependent/glslang.y" + { + (yyval.interm).type = (yyvsp[-5].interm).type; + TIntermNode* declNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-5].interm).type, (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-5].interm).intermNode, declNode, (yyvsp[-1].lex).loc); + } +#line 6778 "MachineIndependent/glslang_tab.cpp" + break; + + case 130: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER EQUAL initializer */ +#line 1178 "MachineIndependent/glslang.y" + { + (yyval.interm).type = (yyvsp[-4].interm).type; + TIntermNode* declNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, 0, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-4].interm).intermNode, declNode, (yyvsp[-1].lex).loc); + } +#line 6788 "MachineIndependent/glslang_tab.cpp" + break; + + case 131: /* single_declaration: fully_specified_type */ +#line 1186 "MachineIndependent/glslang.y" + { + (yyval.interm).type = (yyvsp[0].interm.type); + (yyval.interm).intermNode = 0; + parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); + } +#line 6798 "MachineIndependent/glslang_tab.cpp" + break; + + case 132: /* single_declaration: fully_specified_type IDENTIFIER */ +#line 1191 "MachineIndependent/glslang.y" + { + (yyval.interm).type = (yyvsp[-1].interm.type); + TIntermNode* declNode = parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate(nullptr, declNode, (yyvsp[0].lex).loc); + + } +#line 6809 "MachineIndependent/glslang_tab.cpp" + break; + + case 133: /* single_declaration: fully_specified_type IDENTIFIER array_specifier */ +#line 1197 "MachineIndependent/glslang.y" + { + (yyval.interm).type = (yyvsp[-2].interm.type); + TIntermNode* declNode = parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-2].interm.type), (yyvsp[0].interm).arraySizes); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate(nullptr, declNode, (yyvsp[-1].lex).loc); + } +#line 6819 "MachineIndependent/glslang_tab.cpp" + break; + + case 134: /* single_declaration: fully_specified_type IDENTIFIER array_specifier EQUAL initializer */ +#line 1202 "MachineIndependent/glslang.y" + { + (yyval.interm).type = (yyvsp[-4].interm.type); + TIntermNode* declNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-4].interm.type), (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate(nullptr, declNode, (yyvsp[-3].lex).loc); + } +#line 6829 "MachineIndependent/glslang_tab.cpp" + break; + + case 135: /* single_declaration: fully_specified_type IDENTIFIER EQUAL initializer */ +#line 1207 "MachineIndependent/glslang.y" + { + (yyval.interm).type = (yyvsp[-3].interm.type); + TIntermNode* declNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate(nullptr, declNode, (yyvsp[-2].lex).loc); + } +#line 6839 "MachineIndependent/glslang_tab.cpp" + break; + + case 136: /* fully_specified_type: type_specifier */ +#line 1216 "MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[0].interm.type); + + parseContext.globalQualifierTypeCheck((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier, (yyval.interm.type)); + if ((yyvsp[0].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[0].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[0].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + } + parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier, (yyval.interm.type).hasTypeParameter()); + } +#line 6854 "MachineIndependent/glslang_tab.cpp" + break; + + case 137: /* fully_specified_type: type_qualifier type_specifier */ +#line 1226 "MachineIndependent/glslang.y" + { + parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, false, &(yyvsp[0].interm.type)); + parseContext.globalQualifierTypeCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, (yyvsp[0].interm.type)); + + if ((yyvsp[0].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[0].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[0].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + } + + if ((yyvsp[0].interm.type).arraySizes && parseContext.arrayQualifierError((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).qualifier)) + (yyvsp[0].interm.type).arraySizes = nullptr; + + parseContext.checkNoShaderLayouts((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); + (yyvsp[0].interm.type).shaderQualifiers.merge((yyvsp[-1].interm.type).shaderQualifiers); + parseContext.mergeQualifiers((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier, (yyvsp[-1].interm.type).qualifier, true); + parseContext.precisionQualifierCheck((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).basicType, (yyvsp[0].interm.type).qualifier, (yyvsp[0].interm.type).hasTypeParameter()); + + (yyval.interm.type) = (yyvsp[0].interm.type); + + if (! (yyval.interm.type).qualifier.isInterpolation() && + ((parseContext.language == EShLangVertex && (yyval.interm.type).qualifier.storage == EvqVaryingOut) || + (parseContext.language == EShLangFragment && (yyval.interm.type).qualifier.storage == EvqVaryingIn))) + (yyval.interm.type).qualifier.smooth = true; + } +#line 6883 "MachineIndependent/glslang_tab.cpp" + break; + + case 138: /* invariant_qualifier: INVARIANT */ +#line 1253 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "invariant"); + parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, 0, "invariant"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.invariant = true; + } +#line 6894 "MachineIndependent/glslang_tab.cpp" + break; + + case 139: /* interpolation_qualifier: SMOOTH */ +#line 1262 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "smooth"); + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "smooth"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "smooth"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.smooth = true; + } +#line 6906 "MachineIndependent/glslang_tab.cpp" + break; + + case 140: /* interpolation_qualifier: FLAT */ +#line 1269 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "flat"); + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "flat"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "flat"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.flat = true; + } +#line 6918 "MachineIndependent/glslang_tab.cpp" + break; + + case 141: /* interpolation_qualifier: NOPERSPECTIVE */ +#line 1276 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "noperspective"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective"); + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "noperspective"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.nopersp = true; + } +#line 6930 "MachineIndependent/glslang_tab.cpp" + break; + + case 142: /* interpolation_qualifier: EXPLICITINTERPAMD */ +#line 1283 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "__explicitInterpAMD"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECompatibilityProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.explicitInterp = true; + } +#line 6942 "MachineIndependent/glslang_tab.cpp" + break; + + case 143: /* interpolation_qualifier: PERVERTEXNV */ +#line 1290 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "pervertexNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECompatibilityProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.pervertexNV = true; + } +#line 6955 "MachineIndependent/glslang_tab.cpp" + break; + + case 144: /* interpolation_qualifier: PERVERTEXEXT */ +#line 1298 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "pervertexEXT"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECompatibilityProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.pervertexEXT = true; + } +#line 6968 "MachineIndependent/glslang_tab.cpp" + break; + + case 145: /* interpolation_qualifier: PERPRIMITIVENV */ +#line 1306 "MachineIndependent/glslang.y" + { + // No need for profile version or extension check. Shader stage already checks both. + parseContext.globalCheck((yyvsp[0].lex).loc, "perprimitiveNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshMask), "perprimitiveNV"); + // Fragment shader stage doesn't check for extension. So we explicitly add below extension check. + if (parseContext.language == EShLangFragment) + parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_NV_mesh_shader, "perprimitiveNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.perPrimitiveNV = true; + } +#line 6983 "MachineIndependent/glslang_tab.cpp" + break; + + case 146: /* interpolation_qualifier: PERPRIMITIVEEXT */ +#line 1316 "MachineIndependent/glslang.y" + { + // No need for profile version or extension check. Shader stage already checks both. + parseContext.globalCheck((yyvsp[0].lex).loc, "perprimitiveEXT"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshMask), "perprimitiveEXT"); + // Fragment shader stage doesn't check for extension. So we explicitly add below extension check. + if (parseContext.language == EShLangFragment) + parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_mesh_shader, "perprimitiveEXT"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.perPrimitiveNV = true; + } +#line 6998 "MachineIndependent/glslang_tab.cpp" + break; + + case 147: /* interpolation_qualifier: PERVIEWNV */ +#line 1326 "MachineIndependent/glslang.y" + { + // No need for profile version or extension check. Shader stage already checks both. + parseContext.globalCheck((yyvsp[0].lex).loc, "perviewNV"); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangMesh, "perviewNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.perViewNV = true; + } +#line 7010 "MachineIndependent/glslang_tab.cpp" + break; + + case 148: /* interpolation_qualifier: PERTASKNV */ +#line 1333 "MachineIndependent/glslang.y" + { + // No need for profile version or extension check. Shader stage already checks both. + parseContext.globalCheck((yyvsp[0].lex).loc, "taskNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask), "taskNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.perTaskNV = true; + } +#line 7022 "MachineIndependent/glslang_tab.cpp" + break; + + case 149: /* layout_qualifier: LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN */ +#line 1343 "MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[-1].interm.type); + } +#line 7030 "MachineIndependent/glslang_tab.cpp" + break; + + case 150: /* layout_qualifier_id_list: layout_qualifier_id */ +#line 1349 "MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 7038 "MachineIndependent/glslang_tab.cpp" + break; + + case 151: /* layout_qualifier_id_list: layout_qualifier_id_list COMMA layout_qualifier_id */ +#line 1352 "MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[-2].interm.type); + (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); + parseContext.mergeObjectLayoutQualifiers((yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); + } +#line 7048 "MachineIndependent/glslang_tab.cpp" + break; + + case 152: /* layout_qualifier_id: IDENTIFIER */ +#line 1359 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), *(yyvsp[0].lex).string); + } +#line 7057 "MachineIndependent/glslang_tab.cpp" + break; + + case 153: /* layout_qualifier_id: IDENTIFIER EQUAL constant_expression */ +#line 1363 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[-2].lex).loc); + parseContext.setLayoutQualifier((yyvsp[-2].lex).loc, (yyval.interm.type), *(yyvsp[-2].lex).string, (yyvsp[0].interm.intermTypedNode)); + } +#line 7066 "MachineIndependent/glslang_tab.cpp" + break; + + case 154: /* layout_qualifier_id: SHARED */ +#line 1367 "MachineIndependent/glslang.y" + { // because "shared" is both an identifier and a keyword + (yyval.interm.type).init((yyvsp[0].lex).loc); + TString strShared("shared"); + parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), strShared); + } +#line 7076 "MachineIndependent/glslang_tab.cpp" + break; + + case 155: /* precise_qualifier: PRECISE */ +#line 1375 "MachineIndependent/glslang.y" + { + parseContext.profileRequires((yyval.interm.type).loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.noContraction = true; + } +#line 7087 "MachineIndependent/glslang_tab.cpp" + break; + + case 156: /* type_qualifier: single_type_qualifier */ +#line 1384 "MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 7095 "MachineIndependent/glslang_tab.cpp" + break; + + case 157: /* type_qualifier: type_qualifier single_type_qualifier */ +#line 1387 "MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[-1].interm.type); + if ((yyval.interm.type).basicType == EbtVoid) + (yyval.interm.type).basicType = (yyvsp[0].interm.type).basicType; + + (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); + parseContext.mergeQualifiers((yyval.interm.type).loc, (yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); + } +#line 7108 "MachineIndependent/glslang_tab.cpp" + break; + + case 158: /* single_type_qualifier: storage_qualifier */ +#line 1398 "MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 7116 "MachineIndependent/glslang_tab.cpp" + break; + + case 159: /* single_type_qualifier: layout_qualifier */ +#line 1401 "MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 7124 "MachineIndependent/glslang_tab.cpp" + break; + + case 160: /* single_type_qualifier: precision_qualifier */ +#line 1404 "MachineIndependent/glslang.y" + { + parseContext.checkPrecisionQualifier((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier.precision); + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 7133 "MachineIndependent/glslang_tab.cpp" + break; + + case 161: /* single_type_qualifier: interpolation_qualifier */ +#line 1408 "MachineIndependent/glslang.y" + { + // allow inheritance of storage qualifier from block declaration + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 7142 "MachineIndependent/glslang_tab.cpp" + break; + + case 162: /* single_type_qualifier: invariant_qualifier */ +#line 1412 "MachineIndependent/glslang.y" + { + // allow inheritance of storage qualifier from block declaration + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 7151 "MachineIndependent/glslang_tab.cpp" + break; + + case 163: /* single_type_qualifier: precise_qualifier */ +#line 1416 "MachineIndependent/glslang.y" + { + // allow inheritance of storage qualifier from block declaration + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 7160 "MachineIndependent/glslang_tab.cpp" + break; + + case 164: /* single_type_qualifier: non_uniform_qualifier */ +#line 1420 "MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 7168 "MachineIndependent/glslang_tab.cpp" + break; + + case 165: /* single_type_qualifier: spirv_storage_class_qualifier */ +#line 1423 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].interm.type).loc, "spirv_storage_class"); + parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V storage class qualifier"); + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 7178 "MachineIndependent/glslang_tab.cpp" + break; + + case 166: /* single_type_qualifier: spirv_decorate_qualifier */ +#line 1428 "MachineIndependent/glslang.y" + { + parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V decorate qualifier"); + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 7187 "MachineIndependent/glslang_tab.cpp" + break; + + case 167: /* single_type_qualifier: SPIRV_BY_REFERENCE */ +#line 1432 "MachineIndependent/glslang.y" + { + parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_reference"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.setSpirvByReference(); + } +#line 7197 "MachineIndependent/glslang_tab.cpp" + break; + + case 168: /* single_type_qualifier: SPIRV_LITERAL */ +#line 1437 "MachineIndependent/glslang.y" + { + parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_literal"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.setSpirvLiteral(); + } +#line 7207 "MachineIndependent/glslang_tab.cpp" + break; + + case 169: /* storage_qualifier: CONST */ +#line 1445 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant + } +#line 7216 "MachineIndependent/glslang_tab.cpp" + break; + + case 170: /* storage_qualifier: INOUT */ +#line 1449 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "inout"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqInOut; + } +#line 7226 "MachineIndependent/glslang_tab.cpp" + break; + + case 171: /* storage_qualifier: IN */ +#line 1454 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "in"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later + (yyval.interm.type).qualifier.storage = EvqIn; + } +#line 7237 "MachineIndependent/glslang_tab.cpp" + break; + + case 172: /* storage_qualifier: OUT */ +#line 1460 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "out"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later + (yyval.interm.type).qualifier.storage = EvqOut; + } +#line 7248 "MachineIndependent/glslang_tab.cpp" + break; + + case 173: /* storage_qualifier: CENTROID */ +#line 1466 "MachineIndependent/glslang.y" + { + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 120, 0, "centroid"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "centroid"); + parseContext.globalCheck((yyvsp[0].lex).loc, "centroid"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.centroid = true; + } +#line 7260 "MachineIndependent/glslang_tab.cpp" + break; + + case 174: /* storage_qualifier: UNIFORM */ +#line 1473 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "uniform"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqUniform; + } +#line 7270 "MachineIndependent/glslang_tab.cpp" + break; + + case 175: /* storage_qualifier: TILEIMAGEEXT */ +#line 1478 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "tileImageEXT"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqTileImageEXT; + } +#line 7280 "MachineIndependent/glslang_tab.cpp" + break; + + case 176: /* storage_qualifier: SHARED */ +#line 1483 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "shared"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 310, 0, "shared"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangComputeMask | EShLangMeshMask | EShLangTaskMask), "shared"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqShared; + } +#line 7293 "MachineIndependent/glslang_tab.cpp" + break; + + case 177: /* storage_qualifier: BUFFER */ +#line 1491 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "buffer"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqBuffer; + } +#line 7303 "MachineIndependent/glslang_tab.cpp" + break; + + case 178: /* storage_qualifier: ATTRIBUTE */ +#line 1496 "MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[0].lex).loc, EShLangVertex, "attribute"); + parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "attribute"); + parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "attribute"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, ECoreProfile, 420, "attribute"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, EEsProfile, 300, "attribute"); + + parseContext.globalCheck((yyvsp[0].lex).loc, "attribute"); + + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqVaryingIn; + } +#line 7320 "MachineIndependent/glslang_tab.cpp" + break; + + case 179: /* storage_qualifier: VARYING */ +#line 1508 "MachineIndependent/glslang.y" + { + parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "varying"); + parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "varying"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, ECoreProfile, 420, "varying"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, EEsProfile, 300, "varying"); + + parseContext.globalCheck((yyvsp[0].lex).loc, "varying"); + + (yyval.interm.type).init((yyvsp[0].lex).loc); + if (parseContext.language == EShLangVertex) + (yyval.interm.type).qualifier.storage = EvqVaryingOut; + else + (yyval.interm.type).qualifier.storage = EvqVaryingIn; + } +#line 7339 "MachineIndependent/glslang_tab.cpp" + break; + + case 180: /* storage_qualifier: PATCH */ +#line 1522 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "patch"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.patch = true; + } +#line 7350 "MachineIndependent/glslang_tab.cpp" + break; + + case 181: /* storage_qualifier: SAMPLE */ +#line 1528 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "sample"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.sample = true; + } +#line 7360 "MachineIndependent/glslang_tab.cpp" + break; + + case 182: /* storage_qualifier: HITATTRNV */ +#line 1533 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask + | EShLangAnyHitMask), "hitAttributeNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "hitAttributeNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqHitAttr; + } +#line 7373 "MachineIndependent/glslang_tab.cpp" + break; + + case 183: /* storage_qualifier: HITOBJECTATTRNV */ +#line 1541 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask + | EShLangMissMask), "hitObjectAttributeNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_shader_invocation_reorder, "hitObjectAttributeNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqHitObjectAttrNV; + } +#line 7386 "MachineIndependent/glslang_tab.cpp" + break; + + case 184: /* storage_qualifier: HITOBJECTATTREXT */ +#line 1549 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeEXT"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask + | EShLangMissMask), "hitObjectAttributeEXT"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_EXT_shader_invocation_reorder, "hitObjectAttributeEXT"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqHitObjectAttrEXT; + } +#line 7399 "MachineIndependent/glslang_tab.cpp" + break; + + case 185: /* storage_qualifier: HITATTREXT */ +#line 1557 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeEXT"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask + | EShLangAnyHitMask), "hitAttributeEXT"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "hitAttributeNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqHitAttr; + } +#line 7412 "MachineIndependent/glslang_tab.cpp" + break; + + case 186: /* storage_qualifier: PAYLOADNV */ +#line 1565 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqPayload; + } +#line 7425 "MachineIndependent/glslang_tab.cpp" + break; + + case 187: /* storage_qualifier: PAYLOADEXT */ +#line 1573 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadEXT"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadEXT"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "rayPayloadEXT"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqPayload; + } +#line 7438 "MachineIndependent/glslang_tab.cpp" + break; + + case 188: /* storage_qualifier: PAYLOADINNV */ +#line 1581 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadInNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadInNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqPayloadIn; + } +#line 7451 "MachineIndependent/glslang_tab.cpp" + break; + + case 189: /* storage_qualifier: PAYLOADINEXT */ +#line 1589 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInEXT"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadInEXT"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "rayPayloadInEXT"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqPayloadIn; + } +#line 7464 "MachineIndependent/glslang_tab.cpp" + break; + + case 190: /* storage_qualifier: CALLDATANV */ +#line 1597 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | + EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqCallableData; + } +#line 7477 "MachineIndependent/glslang_tab.cpp" + break; + + case 191: /* storage_qualifier: CALLDATAEXT */ +#line 1605 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataEXT"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | + EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataEXT"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "callableDataEXT"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqCallableData; + } +#line 7490 "MachineIndependent/glslang_tab.cpp" + break; + + case 192: /* storage_qualifier: CALLDATAINNV */ +#line 1613 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataInNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqCallableDataIn; + } +#line 7502 "MachineIndependent/glslang_tab.cpp" + break; + + case 193: /* storage_qualifier: CALLDATAINEXT */ +#line 1620 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInEXT"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInEXT"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "callableDataInEXT"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqCallableDataIn; + } +#line 7514 "MachineIndependent/glslang_tab.cpp" + break; + + case 194: /* storage_qualifier: COHERENT */ +#line 1627 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.coherent = true; + } +#line 7523 "MachineIndependent/glslang_tab.cpp" + break; + + case 195: /* storage_qualifier: DEVICECOHERENT */ +#line 1631 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "devicecoherent"); + (yyval.interm.type).qualifier.devicecoherent = true; + } +#line 7533 "MachineIndependent/glslang_tab.cpp" + break; + + case 196: /* storage_qualifier: QUEUEFAMILYCOHERENT */ +#line 1636 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "queuefamilycoherent"); + (yyval.interm.type).qualifier.queuefamilycoherent = true; + } +#line 7543 "MachineIndependent/glslang_tab.cpp" + break; + + case 197: /* storage_qualifier: WORKGROUPCOHERENT */ +#line 1641 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "workgroupcoherent"); + (yyval.interm.type).qualifier.workgroupcoherent = true; + } +#line 7553 "MachineIndependent/glslang_tab.cpp" + break; + + case 198: /* storage_qualifier: SUBGROUPCOHERENT */ +#line 1646 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "subgroupcoherent"); + (yyval.interm.type).qualifier.subgroupcoherent = true; + } +#line 7563 "MachineIndependent/glslang_tab.cpp" + break; + + case 199: /* storage_qualifier: NONPRIVATE */ +#line 1651 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "nonprivate"); + (yyval.interm.type).qualifier.nonprivate = true; + } +#line 7573 "MachineIndependent/glslang_tab.cpp" + break; + + case 200: /* storage_qualifier: SHADERCALLCOHERENT */ +#line 1656 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_ray_tracing, "shadercallcoherent"); + (yyval.interm.type).qualifier.shadercallcoherent = true; + } +#line 7583 "MachineIndependent/glslang_tab.cpp" + break; + + case 201: /* storage_qualifier: VOLATILE */ +#line 1661 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.volatil = true; + } +#line 7592 "MachineIndependent/glslang_tab.cpp" + break; + + case 202: /* storage_qualifier: RESTRICT */ +#line 1665 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.restrict = true; + } +#line 7601 "MachineIndependent/glslang_tab.cpp" + break; + + case 203: /* storage_qualifier: READONLY */ +#line 1669 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.readonly = true; + } +#line 7610 "MachineIndependent/glslang_tab.cpp" + break; + + case 204: /* storage_qualifier: WRITEONLY */ +#line 1673 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.writeonly = true; + } +#line 7619 "MachineIndependent/glslang_tab.cpp" + break; + + case 205: /* storage_qualifier: NONTEMPORAL */ +#line 1677 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.nontemporal = true; + } +#line 7628 "MachineIndependent/glslang_tab.cpp" + break; + + case 206: /* storage_qualifier: SUBROUTINE */ +#line 1681 "MachineIndependent/glslang.y" + { + parseContext.spvRemoved((yyvsp[0].lex).loc, "subroutine"); + parseContext.globalCheck((yyvsp[0].lex).loc, "subroutine"); + parseContext.unimplemented((yyvsp[0].lex).loc, "subroutine"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + } +#line 7639 "MachineIndependent/glslang_tab.cpp" + break; + + case 207: /* storage_qualifier: SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN */ +#line 1687 "MachineIndependent/glslang.y" + { + parseContext.spvRemoved((yyvsp[-3].lex).loc, "subroutine"); + parseContext.globalCheck((yyvsp[-3].lex).loc, "subroutine"); + parseContext.unimplemented((yyvsp[-3].lex).loc, "subroutine"); + (yyval.interm.type).init((yyvsp[-3].lex).loc); + } +#line 7650 "MachineIndependent/glslang_tab.cpp" + break; + + case 208: /* storage_qualifier: TASKPAYLOADWORKGROUPEXT */ +#line 1693 "MachineIndependent/glslang.y" + { + // No need for profile version or extension check. Shader stage already checks both. + parseContext.globalCheck((yyvsp[0].lex).loc, "taskPayloadSharedEXT"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask), "taskPayloadSharedEXT "); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqtaskPayloadSharedEXT; + } +#line 7662 "MachineIndependent/glslang_tab.cpp" + break; + + case 209: /* non_uniform_qualifier: NONUNIFORM */ +#line 1703 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.nonUniform = true; + } +#line 7671 "MachineIndependent/glslang_tab.cpp" + break; + + case 210: /* type_name_list: IDENTIFIER */ +#line 1710 "MachineIndependent/glslang.y" + { + // TODO + } +#line 7679 "MachineIndependent/glslang_tab.cpp" + break; + + case 211: /* type_name_list: type_name_list COMMA IDENTIFIER */ +#line 1713 "MachineIndependent/glslang.y" + { + // TODO: 4.0 semantics: subroutines + // 1) make sure each identifier is a type declared earlier with SUBROUTINE + // 2) save all of the identifiers for future comparison with the declared function + } +#line 7689 "MachineIndependent/glslang_tab.cpp" + break; + + case 212: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt */ +#line 1721 "MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[-1].interm.type); + (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); + (yyval.interm.type).typeParameters = (yyvsp[0].interm.typeParameters); + parseContext.typeParametersCheck((yyvsp[-1].interm.type).loc, (yyval.interm.type)); + + } +#line 7701 "MachineIndependent/glslang_tab.cpp" + break; + + case 213: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt array_specifier */ +#line 1728 "MachineIndependent/glslang.y" + { + parseContext.arrayOfArrayVersionCheck((yyvsp[0].interm).loc, (yyvsp[0].interm).arraySizes); + (yyval.interm.type) = (yyvsp[-2].interm.type); + (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); + (yyval.interm.type).typeParameters = (yyvsp[-1].interm.typeParameters); + (yyval.interm.type).arraySizes = (yyvsp[0].interm).arraySizes; + parseContext.typeParametersCheck((yyvsp[-2].interm.type).loc, (yyval.interm.type)); + } +#line 7714 "MachineIndependent/glslang_tab.cpp" + break; + + case 214: /* array_specifier: LEFT_BRACKET RIGHT_BRACKET */ +#line 1739 "MachineIndependent/glslang.y" + { + (yyval.interm).loc = (yyvsp[-1].lex).loc; + (yyval.interm).arraySizes = new TArraySizes; + (yyval.interm).arraySizes->addInnerSize(); + } +#line 7724 "MachineIndependent/glslang_tab.cpp" + break; + + case 215: /* array_specifier: LEFT_BRACKET conditional_expression RIGHT_BRACKET */ +#line 1744 "MachineIndependent/glslang.y" + { + (yyval.interm).loc = (yyvsp[-2].lex).loc; + (yyval.interm).arraySizes = new TArraySizes; + + TArraySize size; + parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size, "array size"); + (yyval.interm).arraySizes->addInnerSize(size); + } +#line 7737 "MachineIndependent/glslang_tab.cpp" + break; + + case 216: /* array_specifier: array_specifier LEFT_BRACKET RIGHT_BRACKET */ +#line 1752 "MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[-2].interm); + (yyval.interm).arraySizes->addInnerSize(); + } +#line 7746 "MachineIndependent/glslang_tab.cpp" + break; + + case 217: /* array_specifier: array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET */ +#line 1756 "MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[-3].interm); + + TArraySize size; + parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size, "array size"); + (yyval.interm).arraySizes->addInnerSize(size); + } +#line 7758 "MachineIndependent/glslang_tab.cpp" + break; + + case 218: /* type_parameter_specifier_opt: type_parameter_specifier */ +#line 1766 "MachineIndependent/glslang.y" + { + (yyval.interm.typeParameters) = (yyvsp[0].interm.typeParameters); + } +#line 7766 "MachineIndependent/glslang_tab.cpp" + break; + + case 219: /* type_parameter_specifier_opt: %empty */ +#line 1769 "MachineIndependent/glslang.y" + { + (yyval.interm.typeParameters) = 0; + } +#line 7774 "MachineIndependent/glslang_tab.cpp" + break; + + case 220: /* type_parameter_specifier: LEFT_ANGLE type_parameter_specifier_list RIGHT_ANGLE */ +#line 1775 "MachineIndependent/glslang.y" + { + (yyval.interm.typeParameters) = (yyvsp[-1].interm.typeParameters); + } +#line 7782 "MachineIndependent/glslang_tab.cpp" + break; + + case 221: /* type_parameter_specifier_list: type_specifier */ +#line 1781 "MachineIndependent/glslang.y" + { + (yyval.interm.typeParameters) = new TTypeParameters; + (yyval.interm.typeParameters)->arraySizes = new TArraySizes; + (yyval.interm.typeParameters)->spirvType = (yyvsp[0].interm.type).spirvType; + (yyval.interm.typeParameters)->basicType = (yyvsp[0].interm.type).basicType; + } +#line 7793 "MachineIndependent/glslang_tab.cpp" + break; + + case 222: /* type_parameter_specifier_list: unary_expression */ +#line 1787 "MachineIndependent/glslang.y" + { + (yyval.interm.typeParameters) = new TTypeParameters; + (yyval.interm.typeParameters)->arraySizes = new TArraySizes; + + TArraySize size; + parseContext.arraySizeCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode), size, "type parameter", true); + (yyval.interm.typeParameters)->arraySizes->addInnerSize(size); + } +#line 7806 "MachineIndependent/glslang_tab.cpp" + break; + + case 223: /* type_parameter_specifier_list: type_parameter_specifier_list COMMA unary_expression */ +#line 1795 "MachineIndependent/glslang.y" + { + (yyval.interm.typeParameters) = (yyvsp[-2].interm.typeParameters); + + TArraySize size; + parseContext.arraySizeCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode), size, "type parameter", true); + (yyval.interm.typeParameters)->arraySizes->addInnerSize(size); + } +#line 7818 "MachineIndependent/glslang_tab.cpp" + break; + + case 224: /* type_specifier_nonarray: VOID */ +#line 1805 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtVoid; + } +#line 7827 "MachineIndependent/glslang_tab.cpp" + break; + + case 225: /* type_specifier_nonarray: FLOAT */ +#line 1809 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + } +#line 7836 "MachineIndependent/glslang_tab.cpp" + break; + + case 226: /* type_specifier_nonarray: INT */ +#line 1813 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + } +#line 7845 "MachineIndependent/glslang_tab.cpp" + break; + + case 227: /* type_specifier_nonarray: UINT */ +#line 1817 "MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + } +#line 7855 "MachineIndependent/glslang_tab.cpp" + break; + + case 228: /* type_specifier_nonarray: BOOL */ +#line 1822 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + } +#line 7864 "MachineIndependent/glslang_tab.cpp" + break; + + case 229: /* type_specifier_nonarray: VEC2 */ +#line 1826 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(2); + } +#line 7874 "MachineIndependent/glslang_tab.cpp" + break; + + case 230: /* type_specifier_nonarray: VEC3 */ +#line 1831 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(3); + } +#line 7884 "MachineIndependent/glslang_tab.cpp" + break; + + case 231: /* type_specifier_nonarray: VEC4 */ +#line 1836 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(4); + } +#line 7894 "MachineIndependent/glslang_tab.cpp" + break; + + case 232: /* type_specifier_nonarray: BVEC2 */ +#line 1841 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(2); + } +#line 7904 "MachineIndependent/glslang_tab.cpp" + break; + + case 233: /* type_specifier_nonarray: BVEC3 */ +#line 1846 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(3); + } +#line 7914 "MachineIndependent/glslang_tab.cpp" + break; + + case 234: /* type_specifier_nonarray: BVEC4 */ +#line 1851 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(4); + } +#line 7924 "MachineIndependent/glslang_tab.cpp" + break; + + case 235: /* type_specifier_nonarray: IVEC2 */ +#line 1856 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(2); + } +#line 7934 "MachineIndependent/glslang_tab.cpp" + break; + + case 236: /* type_specifier_nonarray: IVEC3 */ +#line 1861 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(3); + } +#line 7944 "MachineIndependent/glslang_tab.cpp" + break; + + case 237: /* type_specifier_nonarray: IVEC4 */ +#line 1866 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(4); + } +#line 7954 "MachineIndependent/glslang_tab.cpp" + break; + + case 238: /* type_specifier_nonarray: UVEC2 */ +#line 1871 "MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(2); + } +#line 7965 "MachineIndependent/glslang_tab.cpp" + break; + + case 239: /* type_specifier_nonarray: UVEC3 */ +#line 1877 "MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(3); + } +#line 7976 "MachineIndependent/glslang_tab.cpp" + break; + + case 240: /* type_specifier_nonarray: UVEC4 */ +#line 1883 "MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(4); + } +#line 7987 "MachineIndependent/glslang_tab.cpp" + break; + + case 241: /* type_specifier_nonarray: MAT2 */ +#line 1889 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 2); + } +#line 7997 "MachineIndependent/glslang_tab.cpp" + break; + + case 242: /* type_specifier_nonarray: MAT3 */ +#line 1894 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 3); + } +#line 8007 "MachineIndependent/glslang_tab.cpp" + break; + + case 243: /* type_specifier_nonarray: MAT4 */ +#line 1899 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 4); + } +#line 8017 "MachineIndependent/glslang_tab.cpp" + break; + + case 244: /* type_specifier_nonarray: MAT2X2 */ +#line 1904 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 2); + } +#line 8027 "MachineIndependent/glslang_tab.cpp" + break; + + case 245: /* type_specifier_nonarray: MAT2X3 */ +#line 1909 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 3); + } +#line 8037 "MachineIndependent/glslang_tab.cpp" + break; + + case 246: /* type_specifier_nonarray: MAT2X4 */ +#line 1914 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 4); + } +#line 8047 "MachineIndependent/glslang_tab.cpp" + break; + + case 247: /* type_specifier_nonarray: MAT3X2 */ +#line 1919 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 2); + } +#line 8057 "MachineIndependent/glslang_tab.cpp" + break; + + case 248: /* type_specifier_nonarray: MAT3X3 */ +#line 1924 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 3); + } +#line 8067 "MachineIndependent/glslang_tab.cpp" + break; + + case 249: /* type_specifier_nonarray: MAT3X4 */ +#line 1929 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 4); + } +#line 8077 "MachineIndependent/glslang_tab.cpp" + break; + + case 250: /* type_specifier_nonarray: MAT4X2 */ +#line 1934 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 2); + } +#line 8087 "MachineIndependent/glslang_tab.cpp" + break; + + case 251: /* type_specifier_nonarray: MAT4X3 */ +#line 1939 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 3); + } +#line 8097 "MachineIndependent/glslang_tab.cpp" + break; + + case 252: /* type_specifier_nonarray: MAT4X4 */ +#line 1944 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 4); + } +#line 8107 "MachineIndependent/glslang_tab.cpp" + break; + + case 253: /* type_specifier_nonarray: DOUBLE */ +#line 1949 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + } +#line 8119 "MachineIndependent/glslang_tab.cpp" + break; + + case 254: /* type_specifier_nonarray: BFLOAT16_T */ +#line 1956 "MachineIndependent/glslang.y" + { + parseContext.bfloat16ScalarVectorCheck((yyvsp[0].lex).loc, "bfloat16_t", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBFloat16; + } +#line 8129 "MachineIndependent/glslang_tab.cpp" + break; + + case 255: /* type_specifier_nonarray: FLOATE5M2_T */ +#line 1961 "MachineIndependent/glslang.y" + { + parseContext.floate5m2ScalarVectorCheck((yyvsp[0].lex).loc, "floate5m2_t", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloatE5M2; + } +#line 8139 "MachineIndependent/glslang_tab.cpp" + break; + + case 256: /* type_specifier_nonarray: FLOATE4M3_T */ +#line 1966 "MachineIndependent/glslang.y" + { + parseContext.floate4m3ScalarVectorCheck((yyvsp[0].lex).loc, "floate4m3_t", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloatE4M3; + } +#line 8149 "MachineIndependent/glslang_tab.cpp" + break; + + case 257: /* type_specifier_nonarray: FLOAT16_T */ +#line 1971 "MachineIndependent/glslang.y" + { + parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "float16_t", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + } +#line 8159 "MachineIndependent/glslang_tab.cpp" + break; + + case 258: /* type_specifier_nonarray: FLOAT32_T */ +#line 1976 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + } +#line 8169 "MachineIndependent/glslang_tab.cpp" + break; + + case 259: /* type_specifier_nonarray: FLOAT64_T */ +#line 1981 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + } +#line 8179 "MachineIndependent/glslang_tab.cpp" + break; + + case 260: /* type_specifier_nonarray: INT8_T */ +#line 1986 "MachineIndependent/glslang.y" + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + } +#line 8189 "MachineIndependent/glslang_tab.cpp" + break; + + case 261: /* type_specifier_nonarray: UINT8_T */ +#line 1991 "MachineIndependent/glslang.y" + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint8; + } +#line 8199 "MachineIndependent/glslang_tab.cpp" + break; + + case 262: /* type_specifier_nonarray: INT16_T */ +#line 1996 "MachineIndependent/glslang.y" + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + } +#line 8209 "MachineIndependent/glslang_tab.cpp" + break; + + case 263: /* type_specifier_nonarray: UINT16_T */ +#line 2001 "MachineIndependent/glslang.y" + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + } +#line 8219 "MachineIndependent/glslang_tab.cpp" + break; + + case 264: /* type_specifier_nonarray: INT32_T */ +#line 2006 "MachineIndependent/glslang.y" + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + } +#line 8229 "MachineIndependent/glslang_tab.cpp" + break; + + case 265: /* type_specifier_nonarray: UINT32_T */ +#line 2011 "MachineIndependent/glslang.y" + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + } +#line 8239 "MachineIndependent/glslang_tab.cpp" + break; + + case 266: /* type_specifier_nonarray: INT64_T */ +#line 2016 "MachineIndependent/glslang.y" + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + } +#line 8249 "MachineIndependent/glslang_tab.cpp" + break; + + case 267: /* type_specifier_nonarray: UINT64_T */ +#line 2021 "MachineIndependent/glslang.y" + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint64; + } +#line 8259 "MachineIndependent/glslang_tab.cpp" + break; + + case 268: /* type_specifier_nonarray: DVEC2 */ +#line 2026 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(2); + } +#line 8272 "MachineIndependent/glslang_tab.cpp" + break; + + case 269: /* type_specifier_nonarray: DVEC3 */ +#line 2034 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(3); + } +#line 8285 "MachineIndependent/glslang_tab.cpp" + break; + + case 270: /* type_specifier_nonarray: DVEC4 */ +#line 2042 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(4); + } +#line 8298 "MachineIndependent/glslang_tab.cpp" + break; + + case 271: /* type_specifier_nonarray: BF16VEC2 */ +#line 2050 "MachineIndependent/glslang.y" + { + parseContext.bfloat16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBFloat16; + (yyval.interm.type).setVector(2); + } +#line 8309 "MachineIndependent/glslang_tab.cpp" + break; + + case 272: /* type_specifier_nonarray: BF16VEC3 */ +#line 2056 "MachineIndependent/glslang.y" + { + parseContext.bfloat16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBFloat16; + (yyval.interm.type).setVector(3); + } +#line 8320 "MachineIndependent/glslang_tab.cpp" + break; + + case 273: /* type_specifier_nonarray: BF16VEC4 */ +#line 2062 "MachineIndependent/glslang.y" + { + parseContext.bfloat16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBFloat16; + (yyval.interm.type).setVector(4); + } +#line 8331 "MachineIndependent/glslang_tab.cpp" + break; + + case 274: /* type_specifier_nonarray: FE5M2VEC2 */ +#line 2068 "MachineIndependent/glslang.y" + { + parseContext.floate5m2ScalarVectorCheck((yyvsp[0].lex).loc, "fe5m2 vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloatE5M2; + (yyval.interm.type).setVector(2); + } +#line 8342 "MachineIndependent/glslang_tab.cpp" + break; + + case 275: /* type_specifier_nonarray: FE5M2VEC3 */ +#line 2074 "MachineIndependent/glslang.y" + { + parseContext.floate5m2ScalarVectorCheck((yyvsp[0].lex).loc, "fe5m2 vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloatE5M2; + (yyval.interm.type).setVector(3); + } +#line 8353 "MachineIndependent/glslang_tab.cpp" + break; + + case 276: /* type_specifier_nonarray: FE5M2VEC4 */ +#line 2080 "MachineIndependent/glslang.y" + { + parseContext.floate5m2ScalarVectorCheck((yyvsp[0].lex).loc, "fe5m2 vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloatE5M2; + (yyval.interm.type).setVector(4); + } +#line 8364 "MachineIndependent/glslang_tab.cpp" + break; + + case 277: /* type_specifier_nonarray: FE4M3VEC2 */ +#line 2086 "MachineIndependent/glslang.y" + { + parseContext.floate4m3ScalarVectorCheck((yyvsp[0].lex).loc, "fe4m3 vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloatE4M3; + (yyval.interm.type).setVector(2); + } +#line 8375 "MachineIndependent/glslang_tab.cpp" + break; + + case 278: /* type_specifier_nonarray: FE4M3VEC3 */ +#line 2092 "MachineIndependent/glslang.y" + { + parseContext.floate4m3ScalarVectorCheck((yyvsp[0].lex).loc, "fe4m3 vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloatE4M3; + (yyval.interm.type).setVector(3); + } +#line 8386 "MachineIndependent/glslang_tab.cpp" + break; + + case 279: /* type_specifier_nonarray: FE4M3VEC4 */ +#line 2098 "MachineIndependent/glslang.y" + { + parseContext.floate4m3ScalarVectorCheck((yyvsp[0].lex).loc, "fe4m3 vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloatE4M3; + (yyval.interm.type).setVector(4); + } +#line 8397 "MachineIndependent/glslang_tab.cpp" + break; + + case 280: /* type_specifier_nonarray: F16VEC2 */ +#line 2104 "MachineIndependent/glslang.y" + { + parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(2); + } +#line 8408 "MachineIndependent/glslang_tab.cpp" + break; + + case 281: /* type_specifier_nonarray: F16VEC3 */ +#line 2110 "MachineIndependent/glslang.y" + { + parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(3); + } +#line 8419 "MachineIndependent/glslang_tab.cpp" + break; + + case 282: /* type_specifier_nonarray: F16VEC4 */ +#line 2116 "MachineIndependent/glslang.y" + { + parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(4); + } +#line 8430 "MachineIndependent/glslang_tab.cpp" + break; + + case 283: /* type_specifier_nonarray: F32VEC2 */ +#line 2122 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(2); + } +#line 8441 "MachineIndependent/glslang_tab.cpp" + break; + + case 284: /* type_specifier_nonarray: F32VEC3 */ +#line 2128 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(3); + } +#line 8452 "MachineIndependent/glslang_tab.cpp" + break; + + case 285: /* type_specifier_nonarray: F32VEC4 */ +#line 2134 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(4); + } +#line 8463 "MachineIndependent/glslang_tab.cpp" + break; + + case 286: /* type_specifier_nonarray: F64VEC2 */ +#line 2140 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(2); + } +#line 8474 "MachineIndependent/glslang_tab.cpp" + break; + + case 287: /* type_specifier_nonarray: F64VEC3 */ +#line 2146 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(3); + } +#line 8485 "MachineIndependent/glslang_tab.cpp" + break; + + case 288: /* type_specifier_nonarray: F64VEC4 */ +#line 2152 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(4); + } +#line 8496 "MachineIndependent/glslang_tab.cpp" + break; + + case 289: /* type_specifier_nonarray: I8VEC2 */ +#line 2158 "MachineIndependent/glslang.y" + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(2); + } +#line 8507 "MachineIndependent/glslang_tab.cpp" + break; + + case 290: /* type_specifier_nonarray: I8VEC3 */ +#line 2164 "MachineIndependent/glslang.y" + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(3); + } +#line 8518 "MachineIndependent/glslang_tab.cpp" + break; + + case 291: /* type_specifier_nonarray: I8VEC4 */ +#line 2170 "MachineIndependent/glslang.y" + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(4); + } +#line 8529 "MachineIndependent/glslang_tab.cpp" + break; + + case 292: /* type_specifier_nonarray: I16VEC2 */ +#line 2176 "MachineIndependent/glslang.y" + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(2); + } +#line 8540 "MachineIndependent/glslang_tab.cpp" + break; + + case 293: /* type_specifier_nonarray: I16VEC3 */ +#line 2182 "MachineIndependent/glslang.y" + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(3); + } +#line 8551 "MachineIndependent/glslang_tab.cpp" + break; + + case 294: /* type_specifier_nonarray: I16VEC4 */ +#line 2188 "MachineIndependent/glslang.y" + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(4); + } +#line 8562 "MachineIndependent/glslang_tab.cpp" + break; + + case 295: /* type_specifier_nonarray: I32VEC2 */ +#line 2194 "MachineIndependent/glslang.y" + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(2); + } +#line 8573 "MachineIndependent/glslang_tab.cpp" + break; + + case 296: /* type_specifier_nonarray: I32VEC3 */ +#line 2200 "MachineIndependent/glslang.y" + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(3); + } +#line 8584 "MachineIndependent/glslang_tab.cpp" + break; + + case 297: /* type_specifier_nonarray: I32VEC4 */ +#line 2206 "MachineIndependent/glslang.y" + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(4); + } +#line 8595 "MachineIndependent/glslang_tab.cpp" + break; + + case 298: /* type_specifier_nonarray: I64VEC2 */ +#line 2212 "MachineIndependent/glslang.y" + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(2); + } +#line 8606 "MachineIndependent/glslang_tab.cpp" + break; + + case 299: /* type_specifier_nonarray: I64VEC3 */ +#line 2218 "MachineIndependent/glslang.y" + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(3); + } +#line 8617 "MachineIndependent/glslang_tab.cpp" + break; + + case 300: /* type_specifier_nonarray: I64VEC4 */ +#line 2224 "MachineIndependent/glslang.y" + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(4); + } +#line 8628 "MachineIndependent/glslang_tab.cpp" + break; + + case 301: /* type_specifier_nonarray: U8VEC2 */ +#line 2230 "MachineIndependent/glslang.y" + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint8; + (yyval.interm.type).setVector(2); + } +#line 8639 "MachineIndependent/glslang_tab.cpp" + break; + + case 302: /* type_specifier_nonarray: U8VEC3 */ +#line 2236 "MachineIndependent/glslang.y" + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint8; + (yyval.interm.type).setVector(3); + } +#line 8650 "MachineIndependent/glslang_tab.cpp" + break; + + case 303: /* type_specifier_nonarray: U8VEC4 */ +#line 2242 "MachineIndependent/glslang.y" + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint8; + (yyval.interm.type).setVector(4); + } +#line 8661 "MachineIndependent/glslang_tab.cpp" + break; + + case 304: /* type_specifier_nonarray: U16VEC2 */ +#line 2248 "MachineIndependent/glslang.y" + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(2); + } +#line 8672 "MachineIndependent/glslang_tab.cpp" + break; + + case 305: /* type_specifier_nonarray: U16VEC3 */ +#line 2254 "MachineIndependent/glslang.y" + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(3); + } +#line 8683 "MachineIndependent/glslang_tab.cpp" + break; + + case 306: /* type_specifier_nonarray: U16VEC4 */ +#line 2260 "MachineIndependent/glslang.y" + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(4); + } +#line 8694 "MachineIndependent/glslang_tab.cpp" + break; + + case 307: /* type_specifier_nonarray: U32VEC2 */ +#line 2266 "MachineIndependent/glslang.y" + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(2); + } +#line 8705 "MachineIndependent/glslang_tab.cpp" + break; + + case 308: /* type_specifier_nonarray: U32VEC3 */ +#line 2272 "MachineIndependent/glslang.y" + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(3); + } +#line 8716 "MachineIndependent/glslang_tab.cpp" + break; + + case 309: /* type_specifier_nonarray: U32VEC4 */ +#line 2278 "MachineIndependent/glslang.y" + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(4); + } +#line 8727 "MachineIndependent/glslang_tab.cpp" + break; + + case 310: /* type_specifier_nonarray: U64VEC2 */ +#line 2284 "MachineIndependent/glslang.y" + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint64; + (yyval.interm.type).setVector(2); + } +#line 8738 "MachineIndependent/glslang_tab.cpp" + break; + + case 311: /* type_specifier_nonarray: U64VEC3 */ +#line 2290 "MachineIndependent/glslang.y" + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint64; + (yyval.interm.type).setVector(3); + } +#line 8749 "MachineIndependent/glslang_tab.cpp" + break; + + case 312: /* type_specifier_nonarray: U64VEC4 */ +#line 2296 "MachineIndependent/glslang.y" + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint64; + (yyval.interm.type).setVector(4); + } +#line 8760 "MachineIndependent/glslang_tab.cpp" + break; + + case 313: /* type_specifier_nonarray: DMAT2 */ +#line 2302 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 2); + } +#line 8773 "MachineIndependent/glslang_tab.cpp" + break; + + case 314: /* type_specifier_nonarray: DMAT3 */ +#line 2310 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 3); + } +#line 8786 "MachineIndependent/glslang_tab.cpp" + break; + + case 315: /* type_specifier_nonarray: DMAT4 */ +#line 2318 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 4); + } +#line 8799 "MachineIndependent/glslang_tab.cpp" + break; + + case 316: /* type_specifier_nonarray: DMAT2X2 */ +#line 2326 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 2); + } +#line 8812 "MachineIndependent/glslang_tab.cpp" + break; + + case 317: /* type_specifier_nonarray: DMAT2X3 */ +#line 2334 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 3); + } +#line 8825 "MachineIndependent/glslang_tab.cpp" + break; + + case 318: /* type_specifier_nonarray: DMAT2X4 */ +#line 2342 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 4); + } +#line 8838 "MachineIndependent/glslang_tab.cpp" + break; + + case 319: /* type_specifier_nonarray: DMAT3X2 */ +#line 2350 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 2); + } +#line 8851 "MachineIndependent/glslang_tab.cpp" + break; + + case 320: /* type_specifier_nonarray: DMAT3X3 */ +#line 2358 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 3); + } +#line 8864 "MachineIndependent/glslang_tab.cpp" + break; + + case 321: /* type_specifier_nonarray: DMAT3X4 */ +#line 2366 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 4); + } +#line 8877 "MachineIndependent/glslang_tab.cpp" + break; + + case 322: /* type_specifier_nonarray: DMAT4X2 */ +#line 2374 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 2); + } +#line 8890 "MachineIndependent/glslang_tab.cpp" + break; + + case 323: /* type_specifier_nonarray: DMAT4X3 */ +#line 2382 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 3); + } +#line 8903 "MachineIndependent/glslang_tab.cpp" + break; + + case 324: /* type_specifier_nonarray: DMAT4X4 */ +#line 2390 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 4); + } +#line 8916 "MachineIndependent/glslang_tab.cpp" + break; + + case 325: /* type_specifier_nonarray: F16MAT2 */ +#line 2398 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(2, 2); + } +#line 8927 "MachineIndependent/glslang_tab.cpp" + break; + + case 326: /* type_specifier_nonarray: F16MAT3 */ +#line 2404 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(3, 3); + } +#line 8938 "MachineIndependent/glslang_tab.cpp" + break; + + case 327: /* type_specifier_nonarray: F16MAT4 */ +#line 2410 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(4, 4); + } +#line 8949 "MachineIndependent/glslang_tab.cpp" + break; + + case 328: /* type_specifier_nonarray: F16MAT2X2 */ +#line 2416 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(2, 2); + } +#line 8960 "MachineIndependent/glslang_tab.cpp" + break; + + case 329: /* type_specifier_nonarray: F16MAT2X3 */ +#line 2422 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(2, 3); + } +#line 8971 "MachineIndependent/glslang_tab.cpp" + break; + + case 330: /* type_specifier_nonarray: F16MAT2X4 */ +#line 2428 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(2, 4); + } +#line 8982 "MachineIndependent/glslang_tab.cpp" + break; + + case 331: /* type_specifier_nonarray: F16MAT3X2 */ +#line 2434 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(3, 2); + } +#line 8993 "MachineIndependent/glslang_tab.cpp" + break; + + case 332: /* type_specifier_nonarray: F16MAT3X3 */ +#line 2440 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(3, 3); + } +#line 9004 "MachineIndependent/glslang_tab.cpp" + break; + + case 333: /* type_specifier_nonarray: F16MAT3X4 */ +#line 2446 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(3, 4); + } +#line 9015 "MachineIndependent/glslang_tab.cpp" + break; + + case 334: /* type_specifier_nonarray: F16MAT4X2 */ +#line 2452 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(4, 2); + } +#line 9026 "MachineIndependent/glslang_tab.cpp" + break; + + case 335: /* type_specifier_nonarray: F16MAT4X3 */ +#line 2458 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(4, 3); + } +#line 9037 "MachineIndependent/glslang_tab.cpp" + break; + + case 336: /* type_specifier_nonarray: F16MAT4X4 */ +#line 2464 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(4, 4); + } +#line 9048 "MachineIndependent/glslang_tab.cpp" + break; + + case 337: /* type_specifier_nonarray: F32MAT2 */ +#line 2470 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 2); + } +#line 9059 "MachineIndependent/glslang_tab.cpp" + break; + + case 338: /* type_specifier_nonarray: F32MAT3 */ +#line 2476 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 3); + } +#line 9070 "MachineIndependent/glslang_tab.cpp" + break; + + case 339: /* type_specifier_nonarray: F32MAT4 */ +#line 2482 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 4); + } +#line 9081 "MachineIndependent/glslang_tab.cpp" + break; + + case 340: /* type_specifier_nonarray: F32MAT2X2 */ +#line 2488 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 2); + } +#line 9092 "MachineIndependent/glslang_tab.cpp" + break; + + case 341: /* type_specifier_nonarray: F32MAT2X3 */ +#line 2494 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 3); + } +#line 9103 "MachineIndependent/glslang_tab.cpp" + break; + + case 342: /* type_specifier_nonarray: F32MAT2X4 */ +#line 2500 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 4); + } +#line 9114 "MachineIndependent/glslang_tab.cpp" + break; + + case 343: /* type_specifier_nonarray: F32MAT3X2 */ +#line 2506 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 2); + } +#line 9125 "MachineIndependent/glslang_tab.cpp" + break; + + case 344: /* type_specifier_nonarray: F32MAT3X3 */ +#line 2512 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 3); + } +#line 9136 "MachineIndependent/glslang_tab.cpp" + break; + + case 345: /* type_specifier_nonarray: F32MAT3X4 */ +#line 2518 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 4); + } +#line 9147 "MachineIndependent/glslang_tab.cpp" + break; + + case 346: /* type_specifier_nonarray: F32MAT4X2 */ +#line 2524 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 2); + } +#line 9158 "MachineIndependent/glslang_tab.cpp" + break; + + case 347: /* type_specifier_nonarray: F32MAT4X3 */ +#line 2530 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 3); + } +#line 9169 "MachineIndependent/glslang_tab.cpp" + break; + + case 348: /* type_specifier_nonarray: F32MAT4X4 */ +#line 2536 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 4); + } +#line 9180 "MachineIndependent/glslang_tab.cpp" + break; + + case 349: /* type_specifier_nonarray: F64MAT2 */ +#line 2542 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 2); + } +#line 9191 "MachineIndependent/glslang_tab.cpp" + break; + + case 350: /* type_specifier_nonarray: F64MAT3 */ +#line 2548 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 3); + } +#line 9202 "MachineIndependent/glslang_tab.cpp" + break; + + case 351: /* type_specifier_nonarray: F64MAT4 */ +#line 2554 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 4); + } +#line 9213 "MachineIndependent/glslang_tab.cpp" + break; + + case 352: /* type_specifier_nonarray: F64MAT2X2 */ +#line 2560 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 2); + } +#line 9224 "MachineIndependent/glslang_tab.cpp" + break; + + case 353: /* type_specifier_nonarray: F64MAT2X3 */ +#line 2566 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 3); + } +#line 9235 "MachineIndependent/glslang_tab.cpp" + break; + + case 354: /* type_specifier_nonarray: F64MAT2X4 */ +#line 2572 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 4); + } +#line 9246 "MachineIndependent/glslang_tab.cpp" + break; + + case 355: /* type_specifier_nonarray: F64MAT3X2 */ +#line 2578 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 2); + } +#line 9257 "MachineIndependent/glslang_tab.cpp" + break; + + case 356: /* type_specifier_nonarray: F64MAT3X3 */ +#line 2584 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 3); + } +#line 9268 "MachineIndependent/glslang_tab.cpp" + break; + + case 357: /* type_specifier_nonarray: F64MAT3X4 */ +#line 2590 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 4); + } +#line 9279 "MachineIndependent/glslang_tab.cpp" + break; + + case 358: /* type_specifier_nonarray: F64MAT4X2 */ +#line 2596 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 2); + } +#line 9290 "MachineIndependent/glslang_tab.cpp" + break; + + case 359: /* type_specifier_nonarray: F64MAT4X3 */ +#line 2602 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 3); + } +#line 9301 "MachineIndependent/glslang_tab.cpp" + break; + + case 360: /* type_specifier_nonarray: F64MAT4X4 */ +#line 2608 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 4); + } +#line 9312 "MachineIndependent/glslang_tab.cpp" + break; + + case 361: /* type_specifier_nonarray: ACCSTRUCTNV */ +#line 2614 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtAccStruct; + } +#line 9321 "MachineIndependent/glslang_tab.cpp" + break; + + case 362: /* type_specifier_nonarray: ACCSTRUCTEXT */ +#line 2618 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtAccStruct; + } +#line 9330 "MachineIndependent/glslang_tab.cpp" + break; + + case 363: /* type_specifier_nonarray: RAYQUERYEXT */ +#line 2622 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtRayQuery; + } +#line 9339 "MachineIndependent/glslang_tab.cpp" + break; + + case 364: /* type_specifier_nonarray: ATOMIC_UINT */ +#line 2626 "MachineIndependent/glslang.y" + { + parseContext.vulkanRemoved((yyvsp[0].lex).loc, "atomic counter types"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtAtomicUint; + } +#line 9349 "MachineIndependent/glslang_tab.cpp" + break; + + case 365: /* type_specifier_nonarray: SAMPLER1D */ +#line 2631 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd1D); + } +#line 9359 "MachineIndependent/glslang_tab.cpp" + break; + + case 366: /* type_specifier_nonarray: SAMPLER2D */ +#line 2636 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D); + } +#line 9369 "MachineIndependent/glslang_tab.cpp" + break; + + case 367: /* type_specifier_nonarray: SAMPLER3D */ +#line 2641 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd3D); + } +#line 9379 "MachineIndependent/glslang_tab.cpp" + break; + + case 368: /* type_specifier_nonarray: SAMPLERCUBE */ +#line 2646 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdCube); + } +#line 9389 "MachineIndependent/glslang_tab.cpp" + break; + + case 369: /* type_specifier_nonarray: SAMPLER2DSHADOW */ +#line 2651 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, true); + } +#line 9399 "MachineIndependent/glslang_tab.cpp" + break; + + case 370: /* type_specifier_nonarray: SAMPLERCUBESHADOW */ +#line 2656 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdCube, false, true); + } +#line 9409 "MachineIndependent/glslang_tab.cpp" + break; + + case 371: /* type_specifier_nonarray: SAMPLER2DARRAY */ +#line 2661 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true); + } +#line 9419 "MachineIndependent/glslang_tab.cpp" + break; + + case 372: /* type_specifier_nonarray: SAMPLER2DARRAYSHADOW */ +#line 2666 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true); + } +#line 9429 "MachineIndependent/glslang_tab.cpp" + break; + + case 373: /* type_specifier_nonarray: SAMPLER1DSHADOW */ +#line 2671 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true); + } +#line 9439 "MachineIndependent/glslang_tab.cpp" + break; + + case 374: /* type_specifier_nonarray: SAMPLER1DARRAY */ +#line 2676 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true); + } +#line 9449 "MachineIndependent/glslang_tab.cpp" + break; + + case 375: /* type_specifier_nonarray: SAMPLER1DARRAYSHADOW */ +#line 2681 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true); + } +#line 9459 "MachineIndependent/glslang_tab.cpp" + break; + + case 376: /* type_specifier_nonarray: SAMPLERCUBEARRAY */ +#line 2686 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true); + } +#line 9469 "MachineIndependent/glslang_tab.cpp" + break; + + case 377: /* type_specifier_nonarray: SAMPLERCUBEARRAYSHADOW */ +#line 2691 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true, true); + } +#line 9479 "MachineIndependent/glslang_tab.cpp" + break; + + case 378: /* type_specifier_nonarray: F16SAMPLER1D */ +#line 2696 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd1D); + } +#line 9490 "MachineIndependent/glslang_tab.cpp" + break; + + case 379: /* type_specifier_nonarray: F16SAMPLER2D */ +#line 2702 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd2D); + } +#line 9501 "MachineIndependent/glslang_tab.cpp" + break; + + case 380: /* type_specifier_nonarray: F16SAMPLER3D */ +#line 2708 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd3D); + } +#line 9512 "MachineIndependent/glslang_tab.cpp" + break; + + case 381: /* type_specifier_nonarray: F16SAMPLERCUBE */ +#line 2714 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, EsdCube); + } +#line 9523 "MachineIndependent/glslang_tab.cpp" + break; + + case 382: /* type_specifier_nonarray: F16SAMPLER1DSHADOW */ +#line 2720 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, false, true); + } +#line 9534 "MachineIndependent/glslang_tab.cpp" + break; + + case 383: /* type_specifier_nonarray: F16SAMPLER2DSHADOW */ +#line 2726 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, true); + } +#line 9545 "MachineIndependent/glslang_tab.cpp" + break; + + case 384: /* type_specifier_nonarray: F16SAMPLERCUBESHADOW */ +#line 2732 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, false, true); + } +#line 9556 "MachineIndependent/glslang_tab.cpp" + break; + + case 385: /* type_specifier_nonarray: F16SAMPLER1DARRAY */ +#line 2738 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true); + } +#line 9567 "MachineIndependent/glslang_tab.cpp" + break; + + case 386: /* type_specifier_nonarray: F16SAMPLER2DARRAY */ +#line 2744 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true); + } +#line 9578 "MachineIndependent/glslang_tab.cpp" + break; + + case 387: /* type_specifier_nonarray: F16SAMPLER1DARRAYSHADOW */ +#line 2750 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true, true); + } +#line 9589 "MachineIndependent/glslang_tab.cpp" + break; + + case 388: /* type_specifier_nonarray: F16SAMPLER2DARRAYSHADOW */ +#line 2756 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, true); + } +#line 9600 "MachineIndependent/glslang_tab.cpp" + break; + + case 389: /* type_specifier_nonarray: F16SAMPLERCUBEARRAY */ +#line 2762 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true); + } +#line 9611 "MachineIndependent/glslang_tab.cpp" + break; + + case 390: /* type_specifier_nonarray: F16SAMPLERCUBEARRAYSHADOW */ +#line 2768 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true, true); + } +#line 9622 "MachineIndependent/glslang_tab.cpp" + break; + + case 391: /* type_specifier_nonarray: ISAMPLER1D */ +#line 2774 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd1D); + } +#line 9632 "MachineIndependent/glslang_tab.cpp" + break; + + case 392: /* type_specifier_nonarray: ISAMPLER2D */ +#line 2779 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd2D); + } +#line 9642 "MachineIndependent/glslang_tab.cpp" + break; + + case 393: /* type_specifier_nonarray: ISAMPLER3D */ +#line 2784 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd3D); + } +#line 9652 "MachineIndependent/glslang_tab.cpp" + break; + + case 394: /* type_specifier_nonarray: ISAMPLERCUBE */ +#line 2789 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, EsdCube); + } +#line 9662 "MachineIndependent/glslang_tab.cpp" + break; + + case 395: /* type_specifier_nonarray: ISAMPLER2DARRAY */ +#line 2794 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd2D, true); + } +#line 9672 "MachineIndependent/glslang_tab.cpp" + break; + + case 396: /* type_specifier_nonarray: USAMPLER2D */ +#line 2799 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd2D); + } +#line 9682 "MachineIndependent/glslang_tab.cpp" + break; + + case 397: /* type_specifier_nonarray: USAMPLER3D */ +#line 2804 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd3D); + } +#line 9692 "MachineIndependent/glslang_tab.cpp" + break; + + case 398: /* type_specifier_nonarray: USAMPLERCUBE */ +#line 2809 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, EsdCube); + } +#line 9702 "MachineIndependent/glslang_tab.cpp" + break; + + case 399: /* type_specifier_nonarray: ISAMPLER1DARRAY */ +#line 2814 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd1D, true); + } +#line 9712 "MachineIndependent/glslang_tab.cpp" + break; + + case 400: /* type_specifier_nonarray: ISAMPLERCUBEARRAY */ +#line 2819 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, EsdCube, true); + } +#line 9722 "MachineIndependent/glslang_tab.cpp" + break; + + case 401: /* type_specifier_nonarray: USAMPLER1D */ +#line 2824 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd1D); + } +#line 9732 "MachineIndependent/glslang_tab.cpp" + break; + + case 402: /* type_specifier_nonarray: USAMPLER1DARRAY */ +#line 2829 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd1D, true); + } +#line 9742 "MachineIndependent/glslang_tab.cpp" + break; + + case 403: /* type_specifier_nonarray: USAMPLERCUBEARRAY */ +#line 2834 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, EsdCube, true); + } +#line 9752 "MachineIndependent/glslang_tab.cpp" + break; + + case 404: /* type_specifier_nonarray: TEXTURECUBEARRAY */ +#line 2839 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true); + } +#line 9762 "MachineIndependent/glslang_tab.cpp" + break; + + case 405: /* type_specifier_nonarray: ITEXTURECUBEARRAY */ +#line 2844 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true); + } +#line 9772 "MachineIndependent/glslang_tab.cpp" + break; + + case 406: /* type_specifier_nonarray: UTEXTURECUBEARRAY */ +#line 2849 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true); + } +#line 9782 "MachineIndependent/glslang_tab.cpp" + break; + + case 407: /* type_specifier_nonarray: USAMPLER2DARRAY */ +#line 2854 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd2D, true); + } +#line 9792 "MachineIndependent/glslang_tab.cpp" + break; + + case 408: /* type_specifier_nonarray: TEXTURE2D */ +#line 2859 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D); + } +#line 9802 "MachineIndependent/glslang_tab.cpp" + break; + + case 409: /* type_specifier_nonarray: TEXTURE3D */ +#line 2864 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D); + } +#line 9812 "MachineIndependent/glslang_tab.cpp" + break; + + case 410: /* type_specifier_nonarray: TEXTURE2DARRAY */ +#line 2869 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true); + } +#line 9822 "MachineIndependent/glslang_tab.cpp" + break; + + case 411: /* type_specifier_nonarray: TEXTURECUBE */ +#line 2874 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube); + } +#line 9832 "MachineIndependent/glslang_tab.cpp" + break; + + case 412: /* type_specifier_nonarray: ITEXTURE2D */ +#line 2879 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D); + } +#line 9842 "MachineIndependent/glslang_tab.cpp" + break; + + case 413: /* type_specifier_nonarray: ITEXTURE3D */ +#line 2884 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D); + } +#line 9852 "MachineIndependent/glslang_tab.cpp" + break; + + case 414: /* type_specifier_nonarray: ITEXTURECUBE */ +#line 2889 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube); + } +#line 9862 "MachineIndependent/glslang_tab.cpp" + break; + + case 415: /* type_specifier_nonarray: ITEXTURE2DARRAY */ +#line 2894 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true); + } +#line 9872 "MachineIndependent/glslang_tab.cpp" + break; + + case 416: /* type_specifier_nonarray: UTEXTURE2D */ +#line 2899 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D); + } +#line 9882 "MachineIndependent/glslang_tab.cpp" + break; + + case 417: /* type_specifier_nonarray: UTEXTURE3D */ +#line 2904 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D); + } +#line 9892 "MachineIndependent/glslang_tab.cpp" + break; + + case 418: /* type_specifier_nonarray: UTEXTURECUBE */ +#line 2909 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube); + } +#line 9902 "MachineIndependent/glslang_tab.cpp" + break; + + case 419: /* type_specifier_nonarray: UTEXTURE2DARRAY */ +#line 2914 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true); + } +#line 9912 "MachineIndependent/glslang_tab.cpp" + break; + + case 420: /* type_specifier_nonarray: SAMPLER */ +#line 2919 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setPureSampler(false); + } +#line 9922 "MachineIndependent/glslang_tab.cpp" + break; + + case 421: /* type_specifier_nonarray: SAMPLERSHADOW */ +#line 2924 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setPureSampler(true); + } +#line 9932 "MachineIndependent/glslang_tab.cpp" + break; + + case 422: /* type_specifier_nonarray: SAMPLER2DRECT */ +#line 2929 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdRect); + } +#line 9942 "MachineIndependent/glslang_tab.cpp" + break; + + case 423: /* type_specifier_nonarray: SAMPLER2DRECTSHADOW */ +#line 2934 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true); + } +#line 9952 "MachineIndependent/glslang_tab.cpp" + break; + + case 424: /* type_specifier_nonarray: F16SAMPLER2DRECT */ +#line 2939 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, EsdRect); + } +#line 9963 "MachineIndependent/glslang_tab.cpp" + break; + + case 425: /* type_specifier_nonarray: F16SAMPLER2DRECTSHADOW */ +#line 2945 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, EsdRect, false, true); + } +#line 9974 "MachineIndependent/glslang_tab.cpp" + break; + + case 426: /* type_specifier_nonarray: ISAMPLER2DRECT */ +#line 2951 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, EsdRect); + } +#line 9984 "MachineIndependent/glslang_tab.cpp" + break; + + case 427: /* type_specifier_nonarray: USAMPLER2DRECT */ +#line 2956 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, EsdRect); + } +#line 9994 "MachineIndependent/glslang_tab.cpp" + break; + + case 428: /* type_specifier_nonarray: SAMPLERBUFFER */ +#line 2961 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer); + } +#line 10004 "MachineIndependent/glslang_tab.cpp" + break; + + case 429: /* type_specifier_nonarray: F16SAMPLERBUFFER */ +#line 2966 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, EsdBuffer); + } +#line 10015 "MachineIndependent/glslang_tab.cpp" + break; + + case 430: /* type_specifier_nonarray: ISAMPLERBUFFER */ +#line 2972 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, EsdBuffer); + } +#line 10025 "MachineIndependent/glslang_tab.cpp" + break; + + case 431: /* type_specifier_nonarray: USAMPLERBUFFER */ +#line 2977 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, EsdBuffer); + } +#line 10035 "MachineIndependent/glslang_tab.cpp" + break; + + case 432: /* type_specifier_nonarray: SAMPLER2DMS */ +#line 2982 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true); + } +#line 10045 "MachineIndependent/glslang_tab.cpp" + break; + + case 433: /* type_specifier_nonarray: F16SAMPLER2DMS */ +#line 2987 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, false, true); + } +#line 10056 "MachineIndependent/glslang_tab.cpp" + break; + + case 434: /* type_specifier_nonarray: ISAMPLER2DMS */ +#line 2993 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true); + } +#line 10066 "MachineIndependent/glslang_tab.cpp" + break; + + case 435: /* type_specifier_nonarray: USAMPLER2DMS */ +#line 2998 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true); + } +#line 10076 "MachineIndependent/glslang_tab.cpp" + break; + + case 436: /* type_specifier_nonarray: SAMPLER2DMSARRAY */ +#line 3003 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true); + } +#line 10086 "MachineIndependent/glslang_tab.cpp" + break; + + case 437: /* type_specifier_nonarray: F16SAMPLER2DMSARRAY */ +#line 3008 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, false, true); + } +#line 10097 "MachineIndependent/glslang_tab.cpp" + break; + + case 438: /* type_specifier_nonarray: ISAMPLER2DMSARRAY */ +#line 3014 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true); + } +#line 10107 "MachineIndependent/glslang_tab.cpp" + break; + + case 439: /* type_specifier_nonarray: USAMPLER2DMSARRAY */ +#line 3019 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true); + } +#line 10117 "MachineIndependent/glslang_tab.cpp" + break; + + case 440: /* type_specifier_nonarray: TEXTURE1D */ +#line 3024 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D); + } +#line 10127 "MachineIndependent/glslang_tab.cpp" + break; + + case 441: /* type_specifier_nonarray: F16TEXTURE1D */ +#line 3029 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D); + } +#line 10138 "MachineIndependent/glslang_tab.cpp" + break; + + case 442: /* type_specifier_nonarray: F16TEXTURE2D */ +#line 3035 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D); + } +#line 10149 "MachineIndependent/glslang_tab.cpp" + break; + + case 443: /* type_specifier_nonarray: F16TEXTURE3D */ +#line 3041 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd3D); + } +#line 10160 "MachineIndependent/glslang_tab.cpp" + break; + + case 444: /* type_specifier_nonarray: F16TEXTURECUBE */ +#line 3047 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube); + } +#line 10171 "MachineIndependent/glslang_tab.cpp" + break; + + case 445: /* type_specifier_nonarray: TEXTURE1DARRAY */ +#line 3053 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true); + } +#line 10181 "MachineIndependent/glslang_tab.cpp" + break; + + case 446: /* type_specifier_nonarray: F16TEXTURE1DARRAY */ +#line 3058 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D, true); + } +#line 10192 "MachineIndependent/glslang_tab.cpp" + break; + + case 447: /* type_specifier_nonarray: F16TEXTURE2DARRAY */ +#line 3064 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true); + } +#line 10203 "MachineIndependent/glslang_tab.cpp" + break; + + case 448: /* type_specifier_nonarray: F16TEXTURECUBEARRAY */ +#line 3070 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube, true); + } +#line 10214 "MachineIndependent/glslang_tab.cpp" + break; + + case 449: /* type_specifier_nonarray: ITEXTURE1D */ +#line 3076 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D); + } +#line 10224 "MachineIndependent/glslang_tab.cpp" + break; + + case 450: /* type_specifier_nonarray: ITEXTURE1DARRAY */ +#line 3081 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true); + } +#line 10234 "MachineIndependent/glslang_tab.cpp" + break; + + case 451: /* type_specifier_nonarray: UTEXTURE1D */ +#line 3086 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D); + } +#line 10244 "MachineIndependent/glslang_tab.cpp" + break; + + case 452: /* type_specifier_nonarray: UTEXTURE1DARRAY */ +#line 3091 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true); + } +#line 10254 "MachineIndependent/glslang_tab.cpp" + break; + + case 453: /* type_specifier_nonarray: TEXTURE2DRECT */ +#line 3096 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdRect); + } +#line 10264 "MachineIndependent/glslang_tab.cpp" + break; + + case 454: /* type_specifier_nonarray: F16TEXTURE2DRECT */ +#line 3101 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdRect); + } +#line 10275 "MachineIndependent/glslang_tab.cpp" + break; + + case 455: /* type_specifier_nonarray: ITEXTURE2DRECT */ +#line 3107 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, EsdRect); + } +#line 10285 "MachineIndependent/glslang_tab.cpp" + break; + + case 456: /* type_specifier_nonarray: UTEXTURE2DRECT */ +#line 3112 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, EsdRect); + } +#line 10295 "MachineIndependent/glslang_tab.cpp" + break; + + case 457: /* type_specifier_nonarray: TEXTUREBUFFER */ +#line 3117 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdBuffer); + } +#line 10305 "MachineIndependent/glslang_tab.cpp" + break; + + case 458: /* type_specifier_nonarray: F16TEXTUREBUFFER */ +#line 3122 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdBuffer); + } +#line 10316 "MachineIndependent/glslang_tab.cpp" + break; + + case 459: /* type_specifier_nonarray: ITEXTUREBUFFER */ +#line 3128 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, EsdBuffer); + } +#line 10326 "MachineIndependent/glslang_tab.cpp" + break; + + case 460: /* type_specifier_nonarray: UTEXTUREBUFFER */ +#line 3133 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, EsdBuffer); + } +#line 10336 "MachineIndependent/glslang_tab.cpp" + break; + + case 461: /* type_specifier_nonarray: TEXTURE2DMS */ +#line 3138 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, false, false, true); + } +#line 10346 "MachineIndependent/glslang_tab.cpp" + break; + + case 462: /* type_specifier_nonarray: F16TEXTURE2DMS */ +#line 3143 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, false, false, true); + } +#line 10357 "MachineIndependent/glslang_tab.cpp" + break; + + case 463: /* type_specifier_nonarray: ITEXTURE2DMS */ +#line 3149 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, false, false, true); + } +#line 10367 "MachineIndependent/glslang_tab.cpp" + break; + + case 464: /* type_specifier_nonarray: UTEXTURE2DMS */ +#line 3154 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, false, false, true); + } +#line 10377 "MachineIndependent/glslang_tab.cpp" + break; + + case 465: /* type_specifier_nonarray: TEXTURE2DMSARRAY */ +#line 3159 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true, false, true); + } +#line 10387 "MachineIndependent/glslang_tab.cpp" + break; + + case 466: /* type_specifier_nonarray: F16TEXTURE2DMSARRAY */ +#line 3164 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true, false, true); + } +#line 10398 "MachineIndependent/glslang_tab.cpp" + break; + + case 467: /* type_specifier_nonarray: ITEXTURE2DMSARRAY */ +#line 3170 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true, false, true); + } +#line 10408 "MachineIndependent/glslang_tab.cpp" + break; + + case 468: /* type_specifier_nonarray: UTEXTURE2DMSARRAY */ +#line 3175 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true, false, true); + } +#line 10418 "MachineIndependent/glslang_tab.cpp" + break; + + case 469: /* type_specifier_nonarray: IMAGE1D */ +#line 3180 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D); + } +#line 10428 "MachineIndependent/glslang_tab.cpp" + break; + + case 470: /* type_specifier_nonarray: F16IMAGE1D */ +#line 3185 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D); + } +#line 10439 "MachineIndependent/glslang_tab.cpp" + break; + + case 471: /* type_specifier_nonarray: IIMAGE1D */ +#line 3191 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, Esd1D); + } +#line 10449 "MachineIndependent/glslang_tab.cpp" + break; + + case 472: /* type_specifier_nonarray: UIMAGE1D */ +#line 3196 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd1D); + } +#line 10459 "MachineIndependent/glslang_tab.cpp" + break; + + case 473: /* type_specifier_nonarray: IMAGE2D */ +#line 3201 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D); + } +#line 10469 "MachineIndependent/glslang_tab.cpp" + break; + + case 474: /* type_specifier_nonarray: F16IMAGE2D */ +#line 3206 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D); + } +#line 10480 "MachineIndependent/glslang_tab.cpp" + break; + + case 475: /* type_specifier_nonarray: IIMAGE2D */ +#line 3212 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D); + } +#line 10490 "MachineIndependent/glslang_tab.cpp" + break; + + case 476: /* type_specifier_nonarray: UIMAGE2D */ +#line 3217 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D); + } +#line 10500 "MachineIndependent/glslang_tab.cpp" + break; + + case 477: /* type_specifier_nonarray: IMAGE3D */ +#line 3222 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, Esd3D); + } +#line 10510 "MachineIndependent/glslang_tab.cpp" + break; + + case 478: /* type_specifier_nonarray: F16IMAGE3D */ +#line 3227 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd3D); + } +#line 10521 "MachineIndependent/glslang_tab.cpp" + break; + + case 479: /* type_specifier_nonarray: IIMAGE3D */ +#line 3233 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, Esd3D); + } +#line 10531 "MachineIndependent/glslang_tab.cpp" + break; + + case 480: /* type_specifier_nonarray: UIMAGE3D */ +#line 3238 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd3D); + } +#line 10541 "MachineIndependent/glslang_tab.cpp" + break; + + case 481: /* type_specifier_nonarray: IMAGE2DRECT */ +#line 3243 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, EsdRect); + } +#line 10551 "MachineIndependent/glslang_tab.cpp" + break; + + case 482: /* type_specifier_nonarray: F16IMAGE2DRECT */ +#line 3248 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, EsdRect); + } +#line 10562 "MachineIndependent/glslang_tab.cpp" + break; + + case 483: /* type_specifier_nonarray: IIMAGE2DRECT */ +#line 3254 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, EsdRect); + } +#line 10572 "MachineIndependent/glslang_tab.cpp" + break; + + case 484: /* type_specifier_nonarray: UIMAGE2DRECT */ +#line 3259 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, EsdRect); + } +#line 10582 "MachineIndependent/glslang_tab.cpp" + break; + + case 485: /* type_specifier_nonarray: IMAGECUBE */ +#line 3264 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube); + } +#line 10592 "MachineIndependent/glslang_tab.cpp" + break; + + case 486: /* type_specifier_nonarray: F16IMAGECUBE */ +#line 3269 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube); + } +#line 10603 "MachineIndependent/glslang_tab.cpp" + break; + + case 487: /* type_specifier_nonarray: IIMAGECUBE */ +#line 3275 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, EsdCube); + } +#line 10613 "MachineIndependent/glslang_tab.cpp" + break; + + case 488: /* type_specifier_nonarray: UIMAGECUBE */ +#line 3280 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, EsdCube); + } +#line 10623 "MachineIndependent/glslang_tab.cpp" + break; + + case 489: /* type_specifier_nonarray: IMAGEBUFFER */ +#line 3285 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, EsdBuffer); + } +#line 10633 "MachineIndependent/glslang_tab.cpp" + break; + + case 490: /* type_specifier_nonarray: F16IMAGEBUFFER */ +#line 3290 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, EsdBuffer); + } +#line 10644 "MachineIndependent/glslang_tab.cpp" + break; + + case 491: /* type_specifier_nonarray: IIMAGEBUFFER */ +#line 3296 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, EsdBuffer); + } +#line 10654 "MachineIndependent/glslang_tab.cpp" + break; + + case 492: /* type_specifier_nonarray: UIMAGEBUFFER */ +#line 3301 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, EsdBuffer); + } +#line 10664 "MachineIndependent/glslang_tab.cpp" + break; + + case 493: /* type_specifier_nonarray: IMAGE1DARRAY */ +#line 3306 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D, true); + } +#line 10674 "MachineIndependent/glslang_tab.cpp" + break; + + case 494: /* type_specifier_nonarray: F16IMAGE1DARRAY */ +#line 3311 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D, true); + } +#line 10685 "MachineIndependent/glslang_tab.cpp" + break; + + case 495: /* type_specifier_nonarray: IIMAGE1DARRAY */ +#line 3317 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, Esd1D, true); + } +#line 10695 "MachineIndependent/glslang_tab.cpp" + break; + + case 496: /* type_specifier_nonarray: UIMAGE1DARRAY */ +#line 3322 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd1D, true); + } +#line 10705 "MachineIndependent/glslang_tab.cpp" + break; + + case 497: /* type_specifier_nonarray: IMAGE2DARRAY */ +#line 3327 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true); + } +#line 10715 "MachineIndependent/glslang_tab.cpp" + break; + + case 498: /* type_specifier_nonarray: F16IMAGE2DARRAY */ +#line 3332 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true); + } +#line 10726 "MachineIndependent/glslang_tab.cpp" + break; + + case 499: /* type_specifier_nonarray: IIMAGE2DARRAY */ +#line 3338 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true); + } +#line 10736 "MachineIndependent/glslang_tab.cpp" + break; + + case 500: /* type_specifier_nonarray: UIMAGE2DARRAY */ +#line 3343 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true); + } +#line 10746 "MachineIndependent/glslang_tab.cpp" + break; + + case 501: /* type_specifier_nonarray: IMAGECUBEARRAY */ +#line 3348 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube, true); + } +#line 10756 "MachineIndependent/glslang_tab.cpp" + break; + + case 502: /* type_specifier_nonarray: F16IMAGECUBEARRAY */ +#line 3353 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube, true); + } +#line 10767 "MachineIndependent/glslang_tab.cpp" + break; + + case 503: /* type_specifier_nonarray: IIMAGECUBEARRAY */ +#line 3359 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, EsdCube, true); + } +#line 10777 "MachineIndependent/glslang_tab.cpp" + break; + + case 504: /* type_specifier_nonarray: UIMAGECUBEARRAY */ +#line 3364 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, EsdCube, true); + } +#line 10787 "MachineIndependent/glslang_tab.cpp" + break; + + case 505: /* type_specifier_nonarray: IMAGE2DMS */ +#line 3369 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, false, false, true); + } +#line 10797 "MachineIndependent/glslang_tab.cpp" + break; + + case 506: /* type_specifier_nonarray: F16IMAGE2DMS */ +#line 3374 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, false, false, true); + } +#line 10808 "MachineIndependent/glslang_tab.cpp" + break; + + case 507: /* type_specifier_nonarray: IIMAGE2DMS */ +#line 3380 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, false, false, true); + } +#line 10818 "MachineIndependent/glslang_tab.cpp" + break; + + case 508: /* type_specifier_nonarray: UIMAGE2DMS */ +#line 3385 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, false, false, true); + } +#line 10828 "MachineIndependent/glslang_tab.cpp" + break; + + case 509: /* type_specifier_nonarray: IMAGE2DMSARRAY */ +#line 3390 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true, false, true); + } +#line 10838 "MachineIndependent/glslang_tab.cpp" + break; + + case 510: /* type_specifier_nonarray: F16IMAGE2DMSARRAY */ +#line 3395 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true, false, true); + } +#line 10849 "MachineIndependent/glslang_tab.cpp" + break; + + case 511: /* type_specifier_nonarray: IIMAGE2DMSARRAY */ +#line 3401 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true, false, true); + } +#line 10859 "MachineIndependent/glslang_tab.cpp" + break; + + case 512: /* type_specifier_nonarray: UIMAGE2DMSARRAY */ +#line 3406 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true, false, true); + } +#line 10869 "MachineIndependent/glslang_tab.cpp" + break; + + case 513: /* type_specifier_nonarray: I64IMAGE1D */ +#line 3411 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt64, Esd1D); + } +#line 10879 "MachineIndependent/glslang_tab.cpp" + break; + + case 514: /* type_specifier_nonarray: U64IMAGE1D */ +#line 3416 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint64, Esd1D); + } +#line 10889 "MachineIndependent/glslang_tab.cpp" + break; + + case 515: /* type_specifier_nonarray: I64IMAGE2D */ +#line 3421 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D); + } +#line 10899 "MachineIndependent/glslang_tab.cpp" + break; + + case 516: /* type_specifier_nonarray: U64IMAGE2D */ +#line 3426 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D); + } +#line 10909 "MachineIndependent/glslang_tab.cpp" + break; + + case 517: /* type_specifier_nonarray: I64IMAGE3D */ +#line 3431 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt64, Esd3D); + } +#line 10919 "MachineIndependent/glslang_tab.cpp" + break; + + case 518: /* type_specifier_nonarray: U64IMAGE3D */ +#line 3436 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint64, Esd3D); + } +#line 10929 "MachineIndependent/glslang_tab.cpp" + break; + + case 519: /* type_specifier_nonarray: I64IMAGE2DRECT */ +#line 3441 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt64, EsdRect); + } +#line 10939 "MachineIndependent/glslang_tab.cpp" + break; + + case 520: /* type_specifier_nonarray: U64IMAGE2DRECT */ +#line 3446 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint64, EsdRect); + } +#line 10949 "MachineIndependent/glslang_tab.cpp" + break; + + case 521: /* type_specifier_nonarray: I64IMAGECUBE */ +#line 3451 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt64, EsdCube); + } +#line 10959 "MachineIndependent/glslang_tab.cpp" + break; + + case 522: /* type_specifier_nonarray: U64IMAGECUBE */ +#line 3456 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint64, EsdCube); + } +#line 10969 "MachineIndependent/glslang_tab.cpp" + break; + + case 523: /* type_specifier_nonarray: I64IMAGEBUFFER */ +#line 3461 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt64, EsdBuffer); + } +#line 10979 "MachineIndependent/glslang_tab.cpp" + break; + + case 524: /* type_specifier_nonarray: U64IMAGEBUFFER */ +#line 3466 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint64, EsdBuffer); + } +#line 10989 "MachineIndependent/glslang_tab.cpp" + break; + + case 525: /* type_specifier_nonarray: I64IMAGE1DARRAY */ +#line 3471 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt64, Esd1D, true); + } +#line 10999 "MachineIndependent/glslang_tab.cpp" + break; + + case 526: /* type_specifier_nonarray: U64IMAGE1DARRAY */ +#line 3476 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint64, Esd1D, true); + } +#line 11009 "MachineIndependent/glslang_tab.cpp" + break; + + case 527: /* type_specifier_nonarray: I64IMAGE2DARRAY */ +#line 3481 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, true); + } +#line 11019 "MachineIndependent/glslang_tab.cpp" + break; + + case 528: /* type_specifier_nonarray: U64IMAGE2DARRAY */ +#line 3486 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, true); + } +#line 11029 "MachineIndependent/glslang_tab.cpp" + break; + + case 529: /* type_specifier_nonarray: I64IMAGECUBEARRAY */ +#line 3491 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt64, EsdCube, true); + } +#line 11039 "MachineIndependent/glslang_tab.cpp" + break; + + case 530: /* type_specifier_nonarray: U64IMAGECUBEARRAY */ +#line 3496 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint64, EsdCube, true); + } +#line 11049 "MachineIndependent/glslang_tab.cpp" + break; + + case 531: /* type_specifier_nonarray: I64IMAGE2DMS */ +#line 3501 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, false, false, true); + } +#line 11059 "MachineIndependent/glslang_tab.cpp" + break; + + case 532: /* type_specifier_nonarray: U64IMAGE2DMS */ +#line 3506 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, false, false, true); + } +#line 11069 "MachineIndependent/glslang_tab.cpp" + break; + + case 533: /* type_specifier_nonarray: I64IMAGE2DMSARRAY */ +#line 3511 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, true, false, true); + } +#line 11079 "MachineIndependent/glslang_tab.cpp" + break; + + case 534: /* type_specifier_nonarray: U64IMAGE2DMSARRAY */ +#line 3516 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, true, false, true); + } +#line 11089 "MachineIndependent/glslang_tab.cpp" + break; + + case 535: /* type_specifier_nonarray: SAMPLEREXTERNALOES */ +#line 3521 "MachineIndependent/glslang.y" + { // GL_OES_EGL_image_external + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D); + (yyval.interm.type).sampler.external = true; + } +#line 11100 "MachineIndependent/glslang_tab.cpp" + break; + + case 536: /* type_specifier_nonarray: SAMPLEREXTERNAL2DY2YEXT */ +#line 3527 "MachineIndependent/glslang.y" + { // GL_EXT_YUV_target + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D); + (yyval.interm.type).sampler.yuv = true; + } +#line 11111 "MachineIndependent/glslang_tab.cpp" + break; + + case 537: /* type_specifier_nonarray: ATTACHMENTEXT */ +#line 3533 "MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "attachmentEXT input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setAttachmentEXT(EbtFloat); + } +#line 11122 "MachineIndependent/glslang_tab.cpp" + break; + + case 538: /* type_specifier_nonarray: IATTACHMENTEXT */ +#line 3539 "MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "attachmentEXT input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setAttachmentEXT(EbtInt); + } +#line 11133 "MachineIndependent/glslang_tab.cpp" + break; + + case 539: /* type_specifier_nonarray: UATTACHMENTEXT */ +#line 3545 "MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "attachmentEXT input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setAttachmentEXT(EbtUint); + } +#line 11144 "MachineIndependent/glslang_tab.cpp" + break; + + case 540: /* type_specifier_nonarray: SUBPASSINPUT */ +#line 3551 "MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setSubpass(EbtFloat); + } +#line 11155 "MachineIndependent/glslang_tab.cpp" + break; + + case 541: /* type_specifier_nonarray: SUBPASSINPUTMS */ +#line 3557 "MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setSubpass(EbtFloat, true); + } +#line 11166 "MachineIndependent/glslang_tab.cpp" + break; + + case 542: /* type_specifier_nonarray: F16SUBPASSINPUT */ +#line 3563 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setSubpass(EbtFloat16); + } +#line 11178 "MachineIndependent/glslang_tab.cpp" + break; + + case 543: /* type_specifier_nonarray: F16SUBPASSINPUTMS */ +#line 3570 "MachineIndependent/glslang.y" + { + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setSubpass(EbtFloat16, true); + } +#line 11190 "MachineIndependent/glslang_tab.cpp" + break; + + case 544: /* type_specifier_nonarray: ISUBPASSINPUT */ +#line 3577 "MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setSubpass(EbtInt); + } +#line 11201 "MachineIndependent/glslang_tab.cpp" + break; + + case 545: /* type_specifier_nonarray: ISUBPASSINPUTMS */ +#line 3583 "MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setSubpass(EbtInt, true); + } +#line 11212 "MachineIndependent/glslang_tab.cpp" + break; + + case 546: /* type_specifier_nonarray: USUBPASSINPUT */ +#line 3589 "MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setSubpass(EbtUint); + } +#line 11223 "MachineIndependent/glslang_tab.cpp" + break; + + case 547: /* type_specifier_nonarray: USUBPASSINPUTMS */ +#line 3595 "MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setSubpass(EbtUint, true); + } +#line 11234 "MachineIndependent/glslang_tab.cpp" + break; + + case 548: /* type_specifier_nonarray: FCOOPMATNV */ +#line 3601 "MachineIndependent/glslang.y" + { + parseContext.fcoopmatCheckNV((yyvsp[0].lex).loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).coopmatNV = true; + (yyval.interm.type).coopmatKHR = false; + } +#line 11246 "MachineIndependent/glslang_tab.cpp" + break; + + case 549: /* type_specifier_nonarray: ICOOPMATNV */ +#line 3608 "MachineIndependent/glslang.y" + { + parseContext.intcoopmatCheckNV((yyvsp[0].lex).loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).coopmatNV = true; + (yyval.interm.type).coopmatKHR = false; + } +#line 11258 "MachineIndependent/glslang_tab.cpp" + break; + + case 550: /* type_specifier_nonarray: UCOOPMATNV */ +#line 3615 "MachineIndependent/glslang.y" + { + parseContext.intcoopmatCheckNV((yyvsp[0].lex).loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).coopmatNV = true; + (yyval.interm.type).coopmatKHR = false; + } +#line 11270 "MachineIndependent/glslang_tab.cpp" + break; + + case 551: /* type_specifier_nonarray: COOPMAT */ +#line 3622 "MachineIndependent/glslang.y" + { + parseContext.coopmatCheck((yyvsp[0].lex).loc, "coopmat", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtCoopmat; + (yyval.interm.type).coopmatNV = false; + (yyval.interm.type).coopmatKHR = true; + } +#line 11282 "MachineIndependent/glslang_tab.cpp" + break; + + case 552: /* type_specifier_nonarray: TENSORLAYOUTNV */ +#line 3629 "MachineIndependent/glslang.y" + { + parseContext.tensorLayoutViewCheck((yyvsp[0].lex).loc, "tensorLayoutNV", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtTensorLayoutNV; + } +#line 11292 "MachineIndependent/glslang_tab.cpp" + break; + + case 553: /* type_specifier_nonarray: TENSORVIEWNV */ +#line 3634 "MachineIndependent/glslang.y" + { + parseContext.tensorLayoutViewCheck((yyvsp[0].lex).loc, "tensorViewNV", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtTensorViewNV; + } +#line 11302 "MachineIndependent/glslang_tab.cpp" + break; + + case 554: /* type_specifier_nonarray: FUNCTION */ +#line 3639 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).basicType = EbtFunction; + } +#line 11311 "MachineIndependent/glslang_tab.cpp" + break; + + case 555: /* type_specifier_nonarray: COOPVECNV */ +#line 3643 "MachineIndependent/glslang.y" + { + parseContext.coopvecCheck((yyvsp[0].lex).loc, "coopvecNV", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtCoopvecNV; + (yyval.interm.type).coopvecNV = true; + } +#line 11322 "MachineIndependent/glslang_tab.cpp" + break; + + case 556: /* type_specifier_nonarray: TENSORARM */ +#line 3649 "MachineIndependent/glslang.y" + { + parseContext.tensorCheckARM((yyvsp[0].lex).loc, "tensorARM", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).tensorRankARM = 1; // placeholder value + (yyval.interm.type).basicType = EbtTensorARM; + } +#line 11333 "MachineIndependent/glslang_tab.cpp" + break; + + case 557: /* type_specifier_nonarray: spirv_type_specifier */ +#line 3655 "MachineIndependent/glslang.y" + { + parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier"); + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 11342 "MachineIndependent/glslang_tab.cpp" + break; + + case 558: /* type_specifier_nonarray: HITOBJECTNV */ +#line 3659 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtHitObjectNV; + } +#line 11351 "MachineIndependent/glslang_tab.cpp" + break; + + case 559: /* type_specifier_nonarray: HITOBJECTEXT */ +#line 3663 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtHitObjectEXT; + } +#line 11360 "MachineIndependent/glslang_tab.cpp" + break; + + case 560: /* type_specifier_nonarray: struct_specifier */ +#line 3667 "MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[0].interm.type); + (yyval.interm.type).qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + parseContext.structTypeCheck((yyval.interm.type).loc, (yyval.interm.type)); + } +#line 11370 "MachineIndependent/glslang_tab.cpp" + break; + + case 561: /* type_specifier_nonarray: TYPE_NAME */ +#line 3672 "MachineIndependent/glslang.y" + { + // + // This is for user defined type names. The lexical phase looked up the + // type. + // + if (const TVariable* variable = ((yyvsp[0].lex).symbol)->getAsVariable()) { + const TType& structure = variable->getType(); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtStruct; + (yyval.interm.type).userDef = &structure; + } else + parseContext.error((yyvsp[0].lex).loc, "expected type name", (yyvsp[0].lex).string->c_str(), ""); + } +#line 11388 "MachineIndependent/glslang_tab.cpp" + break; + + case 562: /* precision_qualifier: HIGH_PRECISION */ +#line 3688 "MachineIndependent/glslang.y" + { + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "highp precision qualifier"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqHigh); + } +#line 11398 "MachineIndependent/glslang_tab.cpp" + break; + + case 563: /* precision_qualifier: MEDIUM_PRECISION */ +#line 3693 "MachineIndependent/glslang.y" + { + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "mediump precision qualifier"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqMedium); + } +#line 11408 "MachineIndependent/glslang_tab.cpp" + break; + + case 564: /* precision_qualifier: LOW_PRECISION */ +#line 3698 "MachineIndependent/glslang.y" + { + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "lowp precision qualifier"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqLow); + } +#line 11418 "MachineIndependent/glslang_tab.cpp" + break; + + case 565: /* $@3: %empty */ +#line 3706 "MachineIndependent/glslang.y" + { parseContext.nestedStructCheck((yyvsp[-2].lex).loc); } +#line 11424 "MachineIndependent/glslang_tab.cpp" + break; + + case 566: /* struct_specifier: STRUCT IDENTIFIER LEFT_BRACE $@3 struct_declaration_list RIGHT_BRACE */ +#line 3706 "MachineIndependent/glslang.y" + { + + TType* structure = new TType((yyvsp[-1].interm.typeList), *(yyvsp[-4].lex).string); + parseContext.structArrayCheck((yyvsp[-4].lex).loc, *structure); + + TVariable* userTypeDef = new TVariable((yyvsp[-4].lex).string, *structure, true); + if (! parseContext.symbolTable.insert(*userTypeDef)) + parseContext.error((yyvsp[-4].lex).loc, "redefinition", (yyvsp[-4].lex).string->c_str(), "struct"); + else if (parseContext.spvVersion.vulkanRelaxed + && structure->containsOpaque()) + parseContext.relaxedSymbols.push_back(structure->getTypeName()); + + (yyval.interm.type).init((yyvsp[-5].lex).loc); + (yyval.interm.type).basicType = EbtStruct; + (yyval.interm.type).userDef = structure; + --parseContext.structNestingLevel; + } +#line 11446 "MachineIndependent/glslang_tab.cpp" + break; + + case 567: /* $@4: %empty */ +#line 3723 "MachineIndependent/glslang.y" + { parseContext.nestedStructCheck((yyvsp[-1].lex).loc); } +#line 11452 "MachineIndependent/glslang_tab.cpp" + break; + + case 568: /* struct_specifier: STRUCT LEFT_BRACE $@4 struct_declaration_list RIGHT_BRACE */ +#line 3723 "MachineIndependent/glslang.y" + { + TType* structure = new TType((yyvsp[-1].interm.typeList), TString("")); + (yyval.interm.type).init((yyvsp[-4].lex).loc); + (yyval.interm.type).basicType = EbtStruct; + (yyval.interm.type).userDef = structure; + --parseContext.structNestingLevel; + } +#line 11464 "MachineIndependent/glslang_tab.cpp" + break; + + case 569: /* struct_declaration_list: struct_declaration */ +#line 3733 "MachineIndependent/glslang.y" + { + (yyval.interm.typeList) = (yyvsp[0].interm.typeList); + } +#line 11472 "MachineIndependent/glslang_tab.cpp" + break; + + case 570: /* struct_declaration_list: struct_declaration_list struct_declaration */ +#line 3736 "MachineIndependent/glslang.y" + { + (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); + for (unsigned int i = 0; i < (yyvsp[0].interm.typeList)->size(); ++i) { + for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) { + if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[0].interm.typeList))[i].type->getFieldName()) + parseContext.error((*(yyvsp[0].interm.typeList))[i].loc, "duplicate member name:", "", (*(yyvsp[0].interm.typeList))[i].type->getFieldName().c_str()); + } + (yyval.interm.typeList)->push_back((*(yyvsp[0].interm.typeList))[i]); + } + } +#line 11487 "MachineIndependent/glslang_tab.cpp" + break; + + case 571: /* struct_declaration: type_specifier struct_declarator_list SEMICOLON */ +#line 3749 "MachineIndependent/glslang.y" + { + if ((yyvsp[-2].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + if (parseContext.isEsProfile()) + parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); + } + + (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); + + parseContext.voidErrorCheck((yyvsp[-2].interm.type).loc, (*(yyvsp[-1].interm.typeList))[0].type->getFieldName(), (yyvsp[-2].interm.type).basicType); + parseContext.precisionQualifierCheck((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).basicType, (yyvsp[-2].interm.type).qualifier, (yyvsp[-2].interm.type).hasTypeParameter()); + + for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { + TType type((yyvsp[-2].interm.type)); + type.setFieldName((*(yyval.interm.typeList))[i].type->getFieldName()); + type.transferArraySizes((*(yyval.interm.typeList))[i].type->getArraySizes()); + type.copyArrayInnerSizes((yyvsp[-2].interm.type).arraySizes); + parseContext.arrayOfArrayVersionCheck((*(yyval.interm.typeList))[i].loc, type.getArraySizes()); + (*(yyval.interm.typeList))[i].type->shallowCopy(type); + } + } +#line 11514 "MachineIndependent/glslang_tab.cpp" + break; + + case 572: /* struct_declaration: type_qualifier type_specifier struct_declarator_list SEMICOLON */ +#line 3771 "MachineIndependent/glslang.y" + { + if ((yyvsp[-2].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + if (parseContext.isEsProfile()) + parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); + } + + (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); + + parseContext.memberQualifierCheck((yyvsp[-3].interm.type)); + parseContext.voidErrorCheck((yyvsp[-2].interm.type).loc, (*(yyvsp[-1].interm.typeList))[0].type->getFieldName(), (yyvsp[-2].interm.type).basicType); + parseContext.mergeQualifiers((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, (yyvsp[-3].interm.type).qualifier, true); + parseContext.precisionQualifierCheck((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).basicType, (yyvsp[-2].interm.type).qualifier, (yyvsp[-2].interm.type).hasTypeParameter()); + + for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { + TType type((yyvsp[-2].interm.type)); + type.setFieldName((*(yyval.interm.typeList))[i].type->getFieldName()); + type.transferArraySizes((*(yyval.interm.typeList))[i].type->getArraySizes()); + type.copyArrayInnerSizes((yyvsp[-2].interm.type).arraySizes); + parseContext.arrayOfArrayVersionCheck((*(yyval.interm.typeList))[i].loc, type.getArraySizes()); + (*(yyval.interm.typeList))[i].type->shallowCopy(type); + } + } +#line 11543 "MachineIndependent/glslang_tab.cpp" + break; + + case 573: /* struct_declarator_list: struct_declarator */ +#line 3798 "MachineIndependent/glslang.y" + { + (yyval.interm.typeList) = new TTypeList; + (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); + } +#line 11552 "MachineIndependent/glslang_tab.cpp" + break; + + case 574: /* struct_declarator_list: struct_declarator_list COMMA struct_declarator */ +#line 3802 "MachineIndependent/glslang.y" + { + (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); + } +#line 11560 "MachineIndependent/glslang_tab.cpp" + break; + + case 575: /* struct_declarator: IDENTIFIER */ +#line 3808 "MachineIndependent/glslang.y" + { + (yyval.interm.typeLine).type = new TType(EbtVoid); + (yyval.interm.typeLine).loc = (yyvsp[0].lex).loc; + (yyval.interm.typeLine).type->setFieldName(*(yyvsp[0].lex).string); + } +#line 11570 "MachineIndependent/glslang_tab.cpp" + break; + + case 576: /* struct_declarator: IDENTIFIER array_specifier */ +#line 3813 "MachineIndependent/glslang.y" + { + parseContext.arrayOfArrayVersionCheck((yyvsp[-1].lex).loc, (yyvsp[0].interm).arraySizes); + + (yyval.interm.typeLine).type = new TType(EbtVoid); + (yyval.interm.typeLine).loc = (yyvsp[-1].lex).loc; + (yyval.interm.typeLine).type->setFieldName(*(yyvsp[-1].lex).string); + (yyval.interm.typeLine).type->transferArraySizes((yyvsp[0].interm).arraySizes); + } +#line 11583 "MachineIndependent/glslang_tab.cpp" + break; + + case 577: /* initializer: assignment_expression */ +#line 3824 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } +#line 11591 "MachineIndependent/glslang_tab.cpp" + break; + + case 578: /* initializer: LEFT_BRACE initializer_list RIGHT_BRACE */ +#line 3827 "MachineIndependent/glslang.y" + { + const char* initFeature = "{ } style initializers"; + parseContext.requireProfile((yyvsp[-2].lex).loc, ~EEsProfile, initFeature); + parseContext.profileRequires((yyvsp[-2].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); + (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); + } +#line 11602 "MachineIndependent/glslang_tab.cpp" + break; + + case 579: /* initializer: LEFT_BRACE initializer_list COMMA RIGHT_BRACE */ +#line 3833 "MachineIndependent/glslang.y" + { + const char* initFeature = "{ } style initializers"; + parseContext.requireProfile((yyvsp[-3].lex).loc, ~EEsProfile, initFeature); + parseContext.profileRequires((yyvsp[-3].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 11613 "MachineIndependent/glslang_tab.cpp" + break; + + case 580: /* initializer: LEFT_BRACE RIGHT_BRACE */ +#line 3839 "MachineIndependent/glslang.y" + { + const char* initFeature = "empty { } initializer"; + parseContext.profileRequires((yyvsp[-1].lex).loc, EEsProfile, 0, E_GL_EXT_null_initializer, initFeature); + parseContext.profileRequires((yyvsp[-1].lex).loc, ~EEsProfile, 0, E_GL_EXT_null_initializer, initFeature); + (yyval.interm.intermTypedNode) = parseContext.intermediate.makeAggregate((yyvsp[-1].lex).loc); + } +#line 11624 "MachineIndependent/glslang_tab.cpp" + break; + + case 581: /* initializer_list: initializer */ +#line 3848 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc()); + } +#line 11632 "MachineIndependent/glslang_tab.cpp" + break; + + case 582: /* initializer_list: initializer_list COMMA initializer */ +#line 3851 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + } +#line 11640 "MachineIndependent/glslang_tab.cpp" + break; + + case 583: /* declaration_statement: declaration */ +#line 3857 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11646 "MachineIndependent/glslang_tab.cpp" + break; + + case 584: /* statement: compound_statement */ +#line 3861 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11652 "MachineIndependent/glslang_tab.cpp" + break; + + case 585: /* statement: simple_statement */ +#line 3862 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11658 "MachineIndependent/glslang_tab.cpp" + break; + + case 586: /* simple_statement: declaration_statement */ +#line 3868 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11664 "MachineIndependent/glslang_tab.cpp" + break; + + case 587: /* simple_statement: expression_statement */ +#line 3869 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11670 "MachineIndependent/glslang_tab.cpp" + break; + + case 588: /* simple_statement: selection_statement */ +#line 3870 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11676 "MachineIndependent/glslang_tab.cpp" + break; + + case 589: /* simple_statement: switch_statement */ +#line 3871 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11682 "MachineIndependent/glslang_tab.cpp" + break; + + case 590: /* simple_statement: case_label */ +#line 3872 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11688 "MachineIndependent/glslang_tab.cpp" + break; + + case 591: /* simple_statement: iteration_statement */ +#line 3873 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11694 "MachineIndependent/glslang_tab.cpp" + break; + + case 592: /* simple_statement: jump_statement */ +#line 3874 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11700 "MachineIndependent/glslang_tab.cpp" + break; + + case 593: /* simple_statement: demote_statement */ +#line 3875 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11706 "MachineIndependent/glslang_tab.cpp" + break; + + case 594: /* demote_statement: DEMOTE SEMICOLON */ +#line 3879 "MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "demote"); + parseContext.requireExtensions((yyvsp[-1].lex).loc, 1, &E_GL_EXT_demote_to_helper_invocation, "demote"); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDemote, (yyvsp[-1].lex).loc); + } +#line 11716 "MachineIndependent/glslang_tab.cpp" + break; + + case 595: /* compound_statement: LEFT_BRACE RIGHT_BRACE */ +#line 3887 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = 0; } +#line 11722 "MachineIndependent/glslang_tab.cpp" + break; + + case 596: /* $@5: %empty */ +#line 3888 "MachineIndependent/glslang.y" + { + parseContext.symbolTable.push(); + ++parseContext.statementNestingLevel; + } +#line 11731 "MachineIndependent/glslang_tab.cpp" + break; + + case 597: /* $@6: %empty */ +#line 3892 "MachineIndependent/glslang.y" + { + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + --parseContext.statementNestingLevel; + } +#line 11740 "MachineIndependent/glslang_tab.cpp" + break; + + case 598: /* compound_statement: LEFT_BRACE $@5 statement_list $@6 RIGHT_BRACE */ +#line 3896 "MachineIndependent/glslang.y" + { + if ((yyvsp[-2].interm.intermNode) && (yyvsp[-2].interm.intermNode)->getAsAggregate()) { + (yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence); + (yyvsp[-2].interm.intermNode)->getAsAggregate()->setEndLoc((yyvsp[0].lex).loc); + } + (yyval.interm.intermNode) = (yyvsp[-2].interm.intermNode); + } +#line 11752 "MachineIndependent/glslang_tab.cpp" + break; + + case 599: /* statement_no_new_scope: compound_statement_no_new_scope */ +#line 3906 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11758 "MachineIndependent/glslang_tab.cpp" + break; + + case 600: /* statement_no_new_scope: simple_statement */ +#line 3907 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11764 "MachineIndependent/glslang_tab.cpp" + break; + + case 601: /* $@7: %empty */ +#line 3911 "MachineIndependent/glslang.y" + { + ++parseContext.controlFlowNestingLevel; + } +#line 11772 "MachineIndependent/glslang_tab.cpp" + break; + + case 602: /* statement_scoped: $@7 compound_statement */ +#line 3914 "MachineIndependent/glslang.y" + { + --parseContext.controlFlowNestingLevel; + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 11781 "MachineIndependent/glslang_tab.cpp" + break; + + case 603: /* $@8: %empty */ +#line 3918 "MachineIndependent/glslang.y" + { + parseContext.symbolTable.push(); + ++parseContext.statementNestingLevel; + ++parseContext.controlFlowNestingLevel; + } +#line 11791 "MachineIndependent/glslang_tab.cpp" + break; + + case 604: /* statement_scoped: $@8 simple_statement */ +#line 3923 "MachineIndependent/glslang.y" + { + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + --parseContext.statementNestingLevel; + --parseContext.controlFlowNestingLevel; + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 11802 "MachineIndependent/glslang_tab.cpp" + break; + + case 605: /* compound_statement_no_new_scope: LEFT_BRACE RIGHT_BRACE */ +#line 3932 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = 0; + } +#line 11810 "MachineIndependent/glslang_tab.cpp" + break; + + case 606: /* compound_statement_no_new_scope: LEFT_BRACE statement_list RIGHT_BRACE */ +#line 3935 "MachineIndependent/glslang.y" + { + if ((yyvsp[-1].interm.intermNode) && (yyvsp[-1].interm.intermNode)->getAsAggregate()) { + (yyvsp[-1].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); + (yyvsp[-1].interm.intermNode)->getAsAggregate()->setEndLoc((yyvsp[0].lex).loc); + } + (yyval.interm.intermNode) = (yyvsp[-1].interm.intermNode); + } +#line 11822 "MachineIndependent/glslang_tab.cpp" + break; + + case 607: /* statement_list: statement */ +#line 3945 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); + if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || + (yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { + parseContext.wrapupSwitchSubsequence(0, (yyvsp[0].interm.intermNode)); + (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case + } + } +#line 11835 "MachineIndependent/glslang_tab.cpp" + break; + + case 608: /* statement_list: statement_list statement */ +#line 3953 "MachineIndependent/glslang.y" + { + if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || + (yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { + parseContext.wrapupSwitchSubsequence((yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : 0, (yyvsp[0].interm.intermNode)); + (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case + } else + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); + } +#line 11848 "MachineIndependent/glslang_tab.cpp" + break; + + case 609: /* expression_statement: SEMICOLON */ +#line 3964 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = 0; } +#line 11854 "MachineIndependent/glslang_tab.cpp" + break; + + case 610: /* expression_statement: expression SEMICOLON */ +#line 3965 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = static_cast((yyvsp[-1].interm.intermTypedNode)); } +#line 11860 "MachineIndependent/glslang_tab.cpp" + break; + + case 611: /* selection_statement: selection_statement_nonattributed */ +#line 3969 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 11868 "MachineIndependent/glslang_tab.cpp" + break; + + case 612: /* selection_statement: attribute selection_statement_nonattributed */ +#line 3972 "MachineIndependent/glslang.y" + { + parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); + parseContext.handleSelectionAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 11878 "MachineIndependent/glslang_tab.cpp" + break; + + case 613: /* selection_statement_nonattributed: IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement */ +#line 3979 "MachineIndependent/glslang.y" + { + parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-2].interm.intermTypedNode)); + (yyval.interm.intermNode) = parseContext.intermediate.addSelection((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.nodePair), (yyvsp[-4].lex).loc); + } +#line 11887 "MachineIndependent/glslang_tab.cpp" + break; + + case 614: /* selection_rest_statement: statement_scoped ELSE statement_scoped */ +#line 3986 "MachineIndependent/glslang.y" + { + (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode); + (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermNode); + } +#line 11896 "MachineIndependent/glslang_tab.cpp" + break; + + case 615: /* selection_rest_statement: statement_scoped */ +#line 3990 "MachineIndependent/glslang.y" + { + (yyval.interm.nodePair).node1 = (yyvsp[0].interm.intermNode); + (yyval.interm.nodePair).node2 = 0; + } +#line 11905 "MachineIndependent/glslang_tab.cpp" + break; + + case 616: /* condition: expression */ +#line 3998 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermTypedNode); + parseContext.boolCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)); + } +#line 11914 "MachineIndependent/glslang_tab.cpp" + break; + + case 617: /* condition: fully_specified_type IDENTIFIER EQUAL initializer */ +#line 4002 "MachineIndependent/glslang.y" + { + parseContext.boolCheck((yyvsp[-2].lex).loc, (yyvsp[-3].interm.type)); + + TType type((yyvsp[-3].interm.type)); + (yyval.interm.intermNode) = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); + } +#line 11925 "MachineIndependent/glslang_tab.cpp" + break; + + case 618: /* switch_statement: switch_statement_nonattributed */ +#line 4011 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 11933 "MachineIndependent/glslang_tab.cpp" + break; + + case 619: /* switch_statement: attribute switch_statement_nonattributed */ +#line 4014 "MachineIndependent/glslang.y" + { + parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); + parseContext.handleSwitchAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 11943 "MachineIndependent/glslang_tab.cpp" + break; + + case 620: /* $@9: %empty */ +#line 4021 "MachineIndependent/glslang.y" + { + // start new switch sequence on the switch stack + ++parseContext.controlFlowNestingLevel; + ++parseContext.statementNestingLevel; + parseContext.switchSequenceStack.push_back(new TIntermSequence); + parseContext.switchLevel.push_back(parseContext.statementNestingLevel); + parseContext.symbolTable.push(); + } +#line 11956 "MachineIndependent/glslang_tab.cpp" + break; + + case 621: /* switch_statement_nonattributed: SWITCH LEFT_PAREN expression RIGHT_PAREN $@9 LEFT_BRACE switch_statement_list RIGHT_BRACE */ +#line 4029 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.addSwitch((yyvsp[-7].lex).loc, (yyvsp[-5].interm.intermTypedNode), (yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : 0); + delete parseContext.switchSequenceStack.back(); + parseContext.switchSequenceStack.pop_back(); + parseContext.switchLevel.pop_back(); + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + --parseContext.statementNestingLevel; + --parseContext.controlFlowNestingLevel; + } +#line 11970 "MachineIndependent/glslang_tab.cpp" + break; + + case 622: /* switch_statement_list: %empty */ +#line 4041 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = 0; + } +#line 11978 "MachineIndependent/glslang_tab.cpp" + break; + + case 623: /* switch_statement_list: statement_list */ +#line 4044 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 11986 "MachineIndependent/glslang_tab.cpp" + break; + + case 624: /* case_label: CASE expression COLON */ +#line 4050 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = 0; + if (parseContext.switchLevel.size() == 0) + parseContext.error((yyvsp[-2].lex).loc, "cannot appear outside switch statement", "case", ""); + else if (parseContext.switchLevel.back() != parseContext.statementNestingLevel) + parseContext.error((yyvsp[-2].lex).loc, "cannot be nested inside control flow", "case", ""); + else { + parseContext.constantValueCheck((yyvsp[-1].interm.intermTypedNode), "case"); + parseContext.integerCheck((yyvsp[-1].interm.intermTypedNode), "case"); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpCase, (yyvsp[-1].interm.intermTypedNode), (yyvsp[-2].lex).loc); + } + } +#line 12003 "MachineIndependent/glslang_tab.cpp" + break; + + case 625: /* case_label: DEFAULT COLON */ +#line 4062 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = 0; + if (parseContext.switchLevel.size() == 0) + parseContext.error((yyvsp[-1].lex).loc, "cannot appear outside switch statement", "default", ""); + else if (parseContext.switchLevel.back() != parseContext.statementNestingLevel) + parseContext.error((yyvsp[-1].lex).loc, "cannot be nested inside control flow", "default", ""); + else + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDefault, (yyvsp[-1].lex).loc); + } +#line 12017 "MachineIndependent/glslang_tab.cpp" + break; + + case 626: /* iteration_statement: iteration_statement_nonattributed */ +#line 4074 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 12025 "MachineIndependent/glslang_tab.cpp" + break; + + case 627: /* iteration_statement: attribute iteration_statement_nonattributed */ +#line 4077 "MachineIndependent/glslang.y" + { + const char * extensions[2] = { E_GL_EXT_control_flow_attributes, E_GL_EXT_control_flow_attributes2 }; + parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 2, extensions, "attribute"); + parseContext.handleLoopAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 12036 "MachineIndependent/glslang_tab.cpp" + break; + + case 628: /* $@10: %empty */ +#line 4085 "MachineIndependent/glslang.y" + { + if (! parseContext.limits.whileLoops) + parseContext.error((yyvsp[-1].lex).loc, "while loops not available", "limitation", ""); + parseContext.symbolTable.push(); + ++parseContext.loopNestingLevel; + ++parseContext.statementNestingLevel; + ++parseContext.controlFlowNestingLevel; + } +#line 12049 "MachineIndependent/glslang_tab.cpp" + break; + + case 629: /* iteration_statement_nonattributed: WHILE LEFT_PAREN $@10 condition RIGHT_PAREN statement_no_new_scope */ +#line 4093 "MachineIndependent/glslang.y" + { + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), (yyvsp[-2].interm.intermNode), 0, true, (yyvsp[-5].lex).loc); + if (parseContext.intermediate.getDebugInfo()) { + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyval.interm.intermNode), (yyvsp[-5].lex).loc); + (yyval.interm.intermNode)->getAsAggregate()->setOperator(EOpScope); + } + --parseContext.loopNestingLevel; + --parseContext.statementNestingLevel; + --parseContext.controlFlowNestingLevel; + } +#line 12065 "MachineIndependent/glslang_tab.cpp" + break; + + case 630: /* $@11: %empty */ +#line 4104 "MachineIndependent/glslang.y" + { + parseContext.symbolTable.push(); + ++parseContext.loopNestingLevel; + ++parseContext.statementNestingLevel; + ++parseContext.controlFlowNestingLevel; + } +#line 12076 "MachineIndependent/glslang_tab.cpp" + break; + + case 631: /* iteration_statement_nonattributed: DO $@11 statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON */ +#line 4110 "MachineIndependent/glslang.y" + { + if (! parseContext.limits.whileLoops) + parseContext.error((yyvsp[-7].lex).loc, "do-while loops not available", "limitation", ""); + + parseContext.boolCheck((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode)); + + (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[-5].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), 0, false, (yyvsp[-4].lex).loc); + if (parseContext.intermediate.getDebugInfo()) { + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyval.interm.intermNode), (yyvsp[-4].lex).loc); + (yyval.interm.intermNode)->getAsAggregate()->setOperator(EOpScope); + } + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + --parseContext.loopNestingLevel; + --parseContext.statementNestingLevel; + --parseContext.controlFlowNestingLevel; + } +#line 12097 "MachineIndependent/glslang_tab.cpp" + break; + + case 632: /* $@12: %empty */ +#line 4126 "MachineIndependent/glslang.y" + { + parseContext.symbolTable.push(); + ++parseContext.loopNestingLevel; + ++parseContext.statementNestingLevel; + ++parseContext.controlFlowNestingLevel; + } +#line 12108 "MachineIndependent/glslang_tab.cpp" + break; + + case 633: /* iteration_statement_nonattributed: FOR LEFT_PAREN $@12 for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope */ +#line 4132 "MachineIndependent/glslang.y" + { + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[-3].interm.intermNode), (yyvsp[-5].lex).loc); + TIntermLoop* forLoop = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), reinterpret_cast((yyvsp[-2].interm.nodePair).node1), reinterpret_cast((yyvsp[-2].interm.nodePair).node2), true, (yyvsp[-6].lex).loc); + if (! parseContext.limits.nonInductiveForLoops) + parseContext.inductiveLoopCheck((yyvsp[-6].lex).loc, (yyvsp[-3].interm.intermNode), forLoop); + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyval.interm.intermNode), forLoop, (yyvsp[-6].lex).loc); + (yyval.interm.intermNode)->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence); + --parseContext.loopNestingLevel; + --parseContext.statementNestingLevel; + --parseContext.controlFlowNestingLevel; + } +#line 12125 "MachineIndependent/glslang_tab.cpp" + break; + + case 634: /* for_init_statement: expression_statement */ +#line 4147 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 12133 "MachineIndependent/glslang_tab.cpp" + break; + + case 635: /* for_init_statement: declaration_statement */ +#line 4150 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 12141 "MachineIndependent/glslang_tab.cpp" + break; + + case 636: /* conditionopt: condition */ +#line 4156 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 12149 "MachineIndependent/glslang_tab.cpp" + break; + + case 637: /* conditionopt: %empty */ +#line 4159 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = 0; + } +#line 12157 "MachineIndependent/glslang_tab.cpp" + break; + + case 638: /* for_rest_statement: conditionopt SEMICOLON */ +#line 4165 "MachineIndependent/glslang.y" + { + (yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermNode); + (yyval.interm.nodePair).node2 = 0; + } +#line 12166 "MachineIndependent/glslang_tab.cpp" + break; + + case 639: /* for_rest_statement: conditionopt SEMICOLON expression */ +#line 4169 "MachineIndependent/glslang.y" + { + (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode); + (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermTypedNode); + } +#line 12175 "MachineIndependent/glslang_tab.cpp" + break; + + case 640: /* jump_statement: CONTINUE SEMICOLON */ +#line 4176 "MachineIndependent/glslang.y" + { + if (parseContext.loopNestingLevel <= 0) + parseContext.error((yyvsp[-1].lex).loc, "continue statement only allowed in loops", "", ""); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpContinue, (yyvsp[-1].lex).loc); + } +#line 12185 "MachineIndependent/glslang_tab.cpp" + break; + + case 641: /* jump_statement: BREAK SEMICOLON */ +#line 4181 "MachineIndependent/glslang.y" + { + if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0) + parseContext.error((yyvsp[-1].lex).loc, "break statement only allowed in switch and loops", "", ""); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpBreak, (yyvsp[-1].lex).loc); + } +#line 12195 "MachineIndependent/glslang_tab.cpp" + break; + + case 642: /* jump_statement: RETURN SEMICOLON */ +#line 4186 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-1].lex).loc); + if (parseContext.currentFunctionType->getBasicType() != EbtVoid) + parseContext.error((yyvsp[-1].lex).loc, "non-void function must return a value", "return", ""); + if (parseContext.inMain) + parseContext.postEntryPointReturn = true; + } +#line 12207 "MachineIndependent/glslang_tab.cpp" + break; + + case 643: /* jump_statement: RETURN expression SEMICOLON */ +#line 4193 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.handleReturnValue((yyvsp[-2].lex).loc, (yyvsp[-1].interm.intermTypedNode)); + } +#line 12215 "MachineIndependent/glslang_tab.cpp" + break; + + case 644: /* jump_statement: DISCARD SEMICOLON */ +#line 4196 "MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "discard"); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[-1].lex).loc); + } +#line 12224 "MachineIndependent/glslang_tab.cpp" + break; + + case 645: /* jump_statement: TERMINATE_INVOCATION SEMICOLON */ +#line 4200 "MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "terminateInvocation"); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpTerminateInvocation, (yyvsp[-1].lex).loc); + } +#line 12233 "MachineIndependent/glslang_tab.cpp" + break; + + case 646: /* jump_statement: TERMINATE_RAY SEMICOLON */ +#line 4204 "MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[-1].lex).loc, EShLangAnyHit, "terminateRayEXT"); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpTerminateRayKHR, (yyvsp[-1].lex).loc); + } +#line 12242 "MachineIndependent/glslang_tab.cpp" + break; + + case 647: /* jump_statement: IGNORE_INTERSECTION SEMICOLON */ +#line 4208 "MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[-1].lex).loc, EShLangAnyHit, "ignoreIntersectionEXT"); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpIgnoreIntersectionKHR, (yyvsp[-1].lex).loc); + } +#line 12251 "MachineIndependent/glslang_tab.cpp" + break; + + case 648: /* translation_unit: external_declaration */ +#line 4217 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); + } +#line 12260 "MachineIndependent/glslang_tab.cpp" + break; + + case 649: /* translation_unit: translation_unit external_declaration */ +#line 4221 "MachineIndependent/glslang.y" + { + if ((yyvsp[0].interm.intermNode) != nullptr) { + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); + parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); + } + } +#line 12271 "MachineIndependent/glslang_tab.cpp" + break; + + case 650: /* external_declaration: function_definition */ +#line 4230 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 12279 "MachineIndependent/glslang_tab.cpp" + break; + + case 651: /* external_declaration: declaration */ +#line 4233 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 12287 "MachineIndependent/glslang_tab.cpp" + break; + + case 652: /* external_declaration: SEMICOLON */ +#line 4236 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "extraneous semicolon"); + parseContext.profileRequires((yyvsp[0].lex).loc, ~EEsProfile, 460, nullptr, "extraneous semicolon"); + (yyval.interm.intermNode) = nullptr; + } +#line 12297 "MachineIndependent/glslang_tab.cpp" + break; + + case 653: /* $@13: %empty */ +#line 4244 "MachineIndependent/glslang.y" + { + (yyvsp[0].interm).function = parseContext.handleFunctionDeclarator((yyvsp[0].interm).loc, *(yyvsp[0].interm).function, false /* not prototype */); + (yyvsp[0].interm).intermNode = parseContext.handleFunctionDefinition((yyvsp[0].interm).loc, *(yyvsp[0].interm).function); + + // For ES 100 only, according to ES shading language 100 spec: A function + // body has a scope nested inside the function's definition. + if (parseContext.profile == EEsProfile && parseContext.version == 100) + { + parseContext.symbolTable.push(); + ++parseContext.statementNestingLevel; + } + } +#line 12314 "MachineIndependent/glslang_tab.cpp" + break; + + case 654: /* function_definition: function_prototype $@13 compound_statement_no_new_scope */ +#line 4256 "MachineIndependent/glslang.y" + { + // May be best done as post process phase on intermediate code + if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) + parseContext.error((yyvsp[-2].interm).loc, "function does not return a value:", "", (yyvsp[-2].interm).function->getName().c_str()); + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermNode)); + (yyval.interm.intermNode)->getAsAggregate()->setLinkType((yyvsp[-2].interm).function->getLinkType()); + parseContext.intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[-2].interm).function->getType(), (yyvsp[-2].interm).loc); + (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[-2].interm).function->getMangledName().c_str()); + + // store the pragma information for debug and optimize and other vendor specific + // information. This information can be queried from the parse tree + (yyval.interm.intermNode)->getAsAggregate()->setOptimize(parseContext.contextPragma.optimize); + (yyval.interm.intermNode)->getAsAggregate()->setDebug(parseContext.contextPragma.debug); + (yyval.interm.intermNode)->getAsAggregate()->setPragmaTable(parseContext.contextPragma.pragmaTable); + + // Set currentFunctionType to empty pointer when goes outside of the function + parseContext.currentFunctionType = nullptr; + + // For ES 100 only, according to ES shading language 100 spec: A function + // body has a scope nested inside the function's definition. + if (parseContext.profile == EEsProfile && parseContext.version == 100) + { + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + --parseContext.statementNestingLevel; + } + } +#line 12346 "MachineIndependent/glslang_tab.cpp" + break; + + case 655: /* attribute: LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET */ +#line 4286 "MachineIndependent/glslang.y" + { + (yyval.interm.attributes) = (yyvsp[-2].interm.attributes); + } +#line 12354 "MachineIndependent/glslang_tab.cpp" + break; + + case 656: /* attribute_list: single_attribute */ +#line 4291 "MachineIndependent/glslang.y" + { + (yyval.interm.attributes) = (yyvsp[0].interm.attributes); + } +#line 12362 "MachineIndependent/glslang_tab.cpp" + break; + + case 657: /* attribute_list: attribute_list COMMA single_attribute */ +#line 4294 "MachineIndependent/glslang.y" + { + (yyval.interm.attributes) = parseContext.mergeAttributes((yyvsp[-2].interm.attributes), (yyvsp[0].interm.attributes)); + } +#line 12370 "MachineIndependent/glslang_tab.cpp" + break; + + case 658: /* single_attribute: IDENTIFIER */ +#line 4299 "MachineIndependent/glslang.y" + { + (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[0].lex).string); + } +#line 12378 "MachineIndependent/glslang_tab.cpp" + break; + + case 659: /* single_attribute: IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN */ +#line 4302 "MachineIndependent/glslang.y" + { + (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[-3].lex).string, (yyvsp[-1].interm.intermTypedNode)); + } +#line 12386 "MachineIndependent/glslang_tab.cpp" + break; + + case 660: /* spirv_requirements_list: spirv_requirements_parameter */ +#line 4307 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvReq) = (yyvsp[0].interm.spirvReq); + } +#line 12394 "MachineIndependent/glslang_tab.cpp" + break; + + case 661: /* spirv_requirements_list: spirv_requirements_list COMMA spirv_requirements_parameter */ +#line 4310 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvReq) = parseContext.mergeSpirvRequirements((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvReq), (yyvsp[0].interm.spirvReq)); + } +#line 12402 "MachineIndependent/glslang_tab.cpp" + break; + + case 662: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_extension_list RIGHT_BRACKET */ +#line 4315 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, (yyvsp[-1].interm.intermNode)->getAsAggregate(), nullptr); + } +#line 12410 "MachineIndependent/glslang_tab.cpp" + break; + + case 663: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_capability_list RIGHT_BRACKET */ +#line 4318 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, nullptr, (yyvsp[-1].interm.intermNode)->getAsAggregate()); + } +#line 12418 "MachineIndependent/glslang_tab.cpp" + break; + + case 664: /* spirv_extension_list: STRING_LITERAL */ +#line 4323 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); + } +#line 12426 "MachineIndependent/glslang_tab.cpp" + break; + + case 665: /* spirv_extension_list: spirv_extension_list COMMA STRING_LITERAL */ +#line 4326 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); + } +#line 12434 "MachineIndependent/glslang_tab.cpp" + break; + + case 666: /* spirv_capability_list: INTCONSTANT */ +#line 4331 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true)); + } +#line 12442 "MachineIndependent/glslang_tab.cpp" + break; + + case 667: /* spirv_capability_list: spirv_capability_list COMMA INTCONSTANT */ +#line 4334 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true)); + } +#line 12450 "MachineIndependent/glslang_tab.cpp" + break; + + case 668: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ +#line 4339 "MachineIndependent/glslang.y" + { + parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i); + (yyval.interm.intermNode) = 0; + } +#line 12459 "MachineIndependent/glslang_tab.cpp" + break; + + case 669: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ +#line 4343 "MachineIndependent/glslang.y" + { + parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); + parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i); + (yyval.interm.intermNode) = 0; + } +#line 12469 "MachineIndependent/glslang_tab.cpp" + break; + + case 670: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ +#line 4348 "MachineIndependent/glslang.y" + { + parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); + (yyval.interm.intermNode) = 0; + } +#line 12478 "MachineIndependent/glslang_tab.cpp" + break; + + case 671: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ +#line 4352 "MachineIndependent/glslang.y" + { + parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); + parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); + (yyval.interm.intermNode) = 0; + } +#line 12488 "MachineIndependent/glslang_tab.cpp" + break; + + case 672: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ +#line 4357 "MachineIndependent/glslang.y" + { + parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); + (yyval.interm.intermNode) = 0; + } +#line 12497 "MachineIndependent/glslang_tab.cpp" + break; + + case 673: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ +#line 4361 "MachineIndependent/glslang.y" + { + parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); + parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); + (yyval.interm.intermNode) = 0; + } +#line 12507 "MachineIndependent/glslang_tab.cpp" + break; + + case 674: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter */ +#line 4368 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); + } +#line 12515 "MachineIndependent/glslang_tab.cpp" + break; + + case 675: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter_list COMMA spirv_execution_mode_parameter */ +#line 4371 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); + } +#line 12523 "MachineIndependent/glslang_tab.cpp" + break; + + case 676: /* spirv_execution_mode_parameter: FLOATCONSTANT */ +#line 4376 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); + } +#line 12531 "MachineIndependent/glslang_tab.cpp" + break; + + case 677: /* spirv_execution_mode_parameter: INTCONSTANT */ +#line 4379 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); + } +#line 12539 "MachineIndependent/glslang_tab.cpp" + break; + + case 678: /* spirv_execution_mode_parameter: UINTCONSTANT */ +#line 4382 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); + } +#line 12547 "MachineIndependent/glslang_tab.cpp" + break; + + case 679: /* spirv_execution_mode_parameter: BOOLCONSTANT */ +#line 4385 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); + } +#line 12555 "MachineIndependent/glslang_tab.cpp" + break; + + case 680: /* spirv_execution_mode_parameter: STRING_LITERAL */ +#line 4388 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true); + } +#line 12563 "MachineIndependent/glslang_tab.cpp" + break; + + case 681: /* spirv_execution_mode_id_parameter_list: constant_expression */ +#line 4393 "MachineIndependent/glslang.y" + { + if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && + (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && + (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtUint && + (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtBool && + (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtString) + parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "this type not allowed", (yyvsp[0].interm.intermTypedNode)->getType().getBasicString(), ""); + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermTypedNode)); + } +#line 12577 "MachineIndependent/glslang_tab.cpp" + break; + + case 682: /* spirv_execution_mode_id_parameter_list: spirv_execution_mode_id_parameter_list COMMA constant_expression */ +#line 4402 "MachineIndependent/glslang.y" + { + if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && + (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && + (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtUint && + (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtBool && + (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtString) + parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "this type not allowed", (yyvsp[0].interm.intermTypedNode)->getType().getBasicString(), ""); + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermTypedNode)); + } +#line 12591 "MachineIndependent/glslang_tab.cpp" + break; + + case 683: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN INTCONSTANT RIGHT_PAREN */ +#line 4413 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[-3].lex).loc); + (yyval.interm.type).qualifier.storage = EvqSpirvStorageClass; + (yyval.interm.type).qualifier.spirvStorageClass = (yyvsp[-1].lex).i; + } +#line 12601 "MachineIndependent/glslang_tab.cpp" + break; + + case 684: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ +#line 4418 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[-5].lex).loc); + parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); + (yyval.interm.type).qualifier.storage = EvqSpirvStorageClass; + (yyval.interm.type).qualifier.spirvStorageClass = (yyvsp[-1].lex).i; + } +#line 12612 "MachineIndependent/glslang_tab.cpp" + break; + + case 685: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ +#line 4426 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[-3].lex).loc); + (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-1].lex).i); + } +#line 12621 "MachineIndependent/glslang_tab.cpp" + break; + + case 686: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ +#line 4430 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[-5].lex).loc); + parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); + (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-1].lex).i); + } +#line 12631 "MachineIndependent/glslang_tab.cpp" + break; + + case 687: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ +#line 4435 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[-5].lex).loc); + (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); + } +#line 12640 "MachineIndependent/glslang_tab.cpp" + break; + + case 688: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ +#line 4439 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[-7].lex).loc); + parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); + (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); + } +#line 12650 "MachineIndependent/glslang_tab.cpp" + break; + + case 689: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ +#line 4444 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[-5].lex).loc); + (yyval.interm.type).qualifier.setSpirvDecorateId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); + } +#line 12659 "MachineIndependent/glslang_tab.cpp" + break; + + case 690: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ +#line 4448 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[-7].lex).loc); + parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); + (yyval.interm.type).qualifier.setSpirvDecorateId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); + } +#line 12669 "MachineIndependent/glslang_tab.cpp" + break; + + case 691: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ +#line 4453 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[-5].lex).loc); + (yyval.interm.type).qualifier.setSpirvDecorateString((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); + } +#line 12678 "MachineIndependent/glslang_tab.cpp" + break; + + case 692: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ +#line 4457 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[-7].lex).loc); + parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); + (yyval.interm.type).qualifier.setSpirvDecorateString((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); + } +#line 12688 "MachineIndependent/glslang_tab.cpp" + break; + + case 693: /* spirv_decorate_parameter_list: spirv_decorate_parameter */ +#line 4464 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); + } +#line 12696 "MachineIndependent/glslang_tab.cpp" + break; + + case 694: /* spirv_decorate_parameter_list: spirv_decorate_parameter_list COMMA spirv_decorate_parameter */ +#line 4467 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); + } +#line 12704 "MachineIndependent/glslang_tab.cpp" + break; + + case 695: /* spirv_decorate_parameter: FLOATCONSTANT */ +#line 4472 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); + } +#line 12712 "MachineIndependent/glslang_tab.cpp" + break; + + case 696: /* spirv_decorate_parameter: INTCONSTANT */ +#line 4475 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); + } +#line 12720 "MachineIndependent/glslang_tab.cpp" + break; + + case 697: /* spirv_decorate_parameter: UINTCONSTANT */ +#line 4478 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); + } +#line 12728 "MachineIndependent/glslang_tab.cpp" + break; + + case 698: /* spirv_decorate_parameter: BOOLCONSTANT */ +#line 4481 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); + } +#line 12736 "MachineIndependent/glslang_tab.cpp" + break; + + case 699: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter */ +#line 4486 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); + } +#line 12744 "MachineIndependent/glslang_tab.cpp" + break; + + case 700: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter_list COMMA spirv_decorate_id_parameter */ +#line 4489 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); + } +#line 12752 "MachineIndependent/glslang_tab.cpp" + break; + + case 701: /* spirv_decorate_id_parameter: variable_identifier */ +#line 4494 "MachineIndependent/glslang.y" + { + if ((yyvsp[0].interm.intermTypedNode)->getAsConstantUnion() || (yyvsp[0].interm.intermTypedNode)->getAsSymbolNode()) + (yyval.interm.intermNode) = (yyvsp[0].interm.intermTypedNode); + else + parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "only allow constants or variables which are not elements of a composite", "", ""); + } +#line 12763 "MachineIndependent/glslang_tab.cpp" + break; + + case 702: /* spirv_decorate_id_parameter: FLOATCONSTANT */ +#line 4500 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); + } +#line 12771 "MachineIndependent/glslang_tab.cpp" + break; + + case 703: /* spirv_decorate_id_parameter: INTCONSTANT */ +#line 4503 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); + } +#line 12779 "MachineIndependent/glslang_tab.cpp" + break; + + case 704: /* spirv_decorate_id_parameter: UINTCONSTANT */ +#line 4506 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); + } +#line 12787 "MachineIndependent/glslang_tab.cpp" + break; + + case 705: /* spirv_decorate_id_parameter: BOOLCONSTANT */ +#line 4509 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); + } +#line 12795 "MachineIndependent/glslang_tab.cpp" + break; + + case 706: /* spirv_decorate_string_parameter_list: STRING_LITERAL */ +#line 4514 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate( + parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); + } +#line 12804 "MachineIndependent/glslang_tab.cpp" + break; + + case 707: /* spirv_decorate_string_parameter_list: spirv_decorate_string_parameter_list COMMA STRING_LITERAL */ +#line 4518 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); + } +#line 12812 "MachineIndependent/glslang_tab.cpp" + break; + + case 708: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ +#line 4523 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[-5].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).setSpirvType(*(yyvsp[-3].interm.spirvInst), (yyvsp[-1].interm.spirvTypeParams)); + } +#line 12821 "MachineIndependent/glslang_tab.cpp" + break; + + case 709: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ +#line 4527 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[-7].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); + (yyval.interm.type).setSpirvType(*(yyvsp[-3].interm.spirvInst), (yyvsp[-1].interm.spirvTypeParams)); + } +#line 12831 "MachineIndependent/glslang_tab.cpp" + break; + + case 710: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4532 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[-3].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).setSpirvType(*(yyvsp[-1].interm.spirvInst)); + } +#line 12840 "MachineIndependent/glslang_tab.cpp" + break; + + case 711: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4536 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[-5].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); + (yyval.interm.type).setSpirvType(*(yyvsp[-1].interm.spirvInst)); + } +#line 12850 "MachineIndependent/glslang_tab.cpp" + break; + + case 712: /* spirv_type_parameter_list: spirv_type_parameter */ +#line 4543 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvTypeParams) = (yyvsp[0].interm.spirvTypeParams); + } +#line 12858 "MachineIndependent/glslang_tab.cpp" + break; + + case 713: /* spirv_type_parameter_list: spirv_type_parameter_list COMMA spirv_type_parameter */ +#line 4546 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvTypeParams) = parseContext.mergeSpirvTypeParameters((yyvsp[-2].interm.spirvTypeParams), (yyvsp[0].interm.spirvTypeParams)); + } +#line 12866 "MachineIndependent/glslang_tab.cpp" + break; + + case 714: /* spirv_type_parameter: constant_expression */ +#line 4551 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvTypeParams) = parseContext.makeSpirvTypeParameters((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)->getAsConstantUnion()); + } +#line 12874 "MachineIndependent/glslang_tab.cpp" + break; + + case 715: /* spirv_type_parameter: type_specifier_nonarray */ +#line 4554 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvTypeParams) = parseContext.makeSpirvTypeParameters((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); + } +#line 12882 "MachineIndependent/glslang_tab.cpp" + break; + + case 716: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4559 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); + } +#line 12890 "MachineIndependent/glslang_tab.cpp" + break; + + case 717: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4562 "MachineIndependent/glslang.y" + { + parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); + (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); + } +#line 12899 "MachineIndependent/glslang_tab.cpp" + break; + + case 718: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_id */ +#line 4568 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvInst) = (yyvsp[0].interm.spirvInst); + } +#line 12907 "MachineIndependent/glslang_tab.cpp" + break; + + case 719: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id */ +#line 4571 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvInst) = parseContext.mergeSpirvInstruction((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvInst), (yyvsp[0].interm.spirvInst)); + } +#line 12915 "MachineIndependent/glslang_tab.cpp" + break; + + case 720: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL STRING_LITERAL */ +#line 4576 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, *(yyvsp[0].lex).string); + } +#line 12923 "MachineIndependent/glslang_tab.cpp" + break; + + case 721: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL INTCONSTANT */ +#line 4579 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[0].lex).i); + } +#line 12931 "MachineIndependent/glslang_tab.cpp" + break; + + +#line 12935 "MachineIndependent/glslang_tab.cpp" + + default: break; + } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + + *++yyvsp = yyval; + + /* Now 'shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + { + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); + } + + goto yynewstate; + + +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ +yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; + { + yypcontext_t yyctx + = {yyssp, yytoken}; + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == -1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = YY_CAST (char *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); + if (yymsg) + { + yysyntax_error_status + = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); + yymsgp = yymsg; + } + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = YYENOMEM; + } + } + yyerror (pParseContext, yymsgp); + if (yysyntax_error_status == YYENOMEM) + YYNOMEM; + } + } + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval, pParseContext); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; + ++yynerrs; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + /* Pop stack until we find a state that shifts the error token. */ + for (;;) + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + YY_ACCESSING_SYMBOL (yystate), yyvsp, pParseContext); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturnlab; + + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturnlab; + + +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ +yyexhaustedlab: + yyerror (pParseContext, YY_("memory exhausted")); + yyresult = 2; + goto yyreturnlab; + + +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: + if (yychar != YYEMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, pParseContext); + } + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, pParseContext); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + return yyresult; +} + +} // QtShaderTools + +#line 4583 "MachineIndependent/glslang.y" diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h new file mode 100644 index 0000000000..98da6fd341 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h @@ -0,0 +1,604 @@ +/* A Bison parser, made by GNU Bison 3.8.2. */ + +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + +#ifndef YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED +# define YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif +#if YYDEBUG +extern int yydebug; +#endif +#ifdef __VXWORKS__ +#define BOOL ANOTHER_BOOL // VxWorks has typedef BOOL +#endif + +/* Token kinds. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + YYEMPTY = -2, + YYEOF = 0, /* "end of file" */ + YYerror = 256, /* error */ + YYUNDEF = 257, /* "invalid token" */ + CONST = 258, /* CONST */ + BOOL = 259, /* BOOL */ + INT = 260, /* INT */ + UINT = 261, /* UINT */ + FLOAT = 262, /* FLOAT */ + BVEC2 = 263, /* BVEC2 */ + BVEC3 = 264, /* BVEC3 */ + BVEC4 = 265, /* BVEC4 */ + IVEC2 = 266, /* IVEC2 */ + IVEC3 = 267, /* IVEC3 */ + IVEC4 = 268, /* IVEC4 */ + UVEC2 = 269, /* UVEC2 */ + UVEC3 = 270, /* UVEC3 */ + UVEC4 = 271, /* UVEC4 */ + VEC2 = 272, /* VEC2 */ + VEC3 = 273, /* VEC3 */ + VEC4 = 274, /* VEC4 */ + MAT2 = 275, /* MAT2 */ + MAT3 = 276, /* MAT3 */ + MAT4 = 277, /* MAT4 */ + MAT2X2 = 278, /* MAT2X2 */ + MAT2X3 = 279, /* MAT2X3 */ + MAT2X4 = 280, /* MAT2X4 */ + MAT3X2 = 281, /* MAT3X2 */ + MAT3X3 = 282, /* MAT3X3 */ + MAT3X4 = 283, /* MAT3X4 */ + MAT4X2 = 284, /* MAT4X2 */ + MAT4X3 = 285, /* MAT4X3 */ + MAT4X4 = 286, /* MAT4X4 */ + SAMPLER2D = 287, /* SAMPLER2D */ + SAMPLER3D = 288, /* SAMPLER3D */ + SAMPLERCUBE = 289, /* SAMPLERCUBE */ + SAMPLER2DSHADOW = 290, /* SAMPLER2DSHADOW */ + SAMPLERCUBESHADOW = 291, /* SAMPLERCUBESHADOW */ + SAMPLER2DARRAY = 292, /* SAMPLER2DARRAY */ + SAMPLER2DARRAYSHADOW = 293, /* SAMPLER2DARRAYSHADOW */ + ISAMPLER2D = 294, /* ISAMPLER2D */ + ISAMPLER3D = 295, /* ISAMPLER3D */ + ISAMPLERCUBE = 296, /* ISAMPLERCUBE */ + ISAMPLER2DARRAY = 297, /* ISAMPLER2DARRAY */ + USAMPLER2D = 298, /* USAMPLER2D */ + USAMPLER3D = 299, /* USAMPLER3D */ + USAMPLERCUBE = 300, /* USAMPLERCUBE */ + USAMPLER2DARRAY = 301, /* USAMPLER2DARRAY */ + SAMPLER = 302, /* SAMPLER */ + SAMPLERSHADOW = 303, /* SAMPLERSHADOW */ + TEXTURE2D = 304, /* TEXTURE2D */ + TEXTURE3D = 305, /* TEXTURE3D */ + TEXTURECUBE = 306, /* TEXTURECUBE */ + TEXTURE2DARRAY = 307, /* TEXTURE2DARRAY */ + ITEXTURE2D = 308, /* ITEXTURE2D */ + ITEXTURE3D = 309, /* ITEXTURE3D */ + ITEXTURECUBE = 310, /* ITEXTURECUBE */ + ITEXTURE2DARRAY = 311, /* ITEXTURE2DARRAY */ + UTEXTURE2D = 312, /* UTEXTURE2D */ + UTEXTURE3D = 313, /* UTEXTURE3D */ + UTEXTURECUBE = 314, /* UTEXTURECUBE */ + UTEXTURE2DARRAY = 315, /* UTEXTURE2DARRAY */ + ATTRIBUTE = 316, /* ATTRIBUTE */ + VARYING = 317, /* VARYING */ + FLOATE5M2_T = 318, /* FLOATE5M2_T */ + FLOATE4M3_T = 319, /* FLOATE4M3_T */ + BFLOAT16_T = 320, /* BFLOAT16_T */ + FLOAT16_T = 321, /* FLOAT16_T */ + FLOAT32_T = 322, /* FLOAT32_T */ + DOUBLE = 323, /* DOUBLE */ + FLOAT64_T = 324, /* FLOAT64_T */ + INT64_T = 325, /* INT64_T */ + UINT64_T = 326, /* UINT64_T */ + INT32_T = 327, /* INT32_T */ + UINT32_T = 328, /* UINT32_T */ + INT16_T = 329, /* INT16_T */ + UINT16_T = 330, /* UINT16_T */ + INT8_T = 331, /* INT8_T */ + UINT8_T = 332, /* UINT8_T */ + I64VEC2 = 333, /* I64VEC2 */ + I64VEC3 = 334, /* I64VEC3 */ + I64VEC4 = 335, /* I64VEC4 */ + U64VEC2 = 336, /* U64VEC2 */ + U64VEC3 = 337, /* U64VEC3 */ + U64VEC4 = 338, /* U64VEC4 */ + I32VEC2 = 339, /* I32VEC2 */ + I32VEC3 = 340, /* I32VEC3 */ + I32VEC4 = 341, /* I32VEC4 */ + U32VEC2 = 342, /* U32VEC2 */ + U32VEC3 = 343, /* U32VEC3 */ + U32VEC4 = 344, /* U32VEC4 */ + I16VEC2 = 345, /* I16VEC2 */ + I16VEC3 = 346, /* I16VEC3 */ + I16VEC4 = 347, /* I16VEC4 */ + U16VEC2 = 348, /* U16VEC2 */ + U16VEC3 = 349, /* U16VEC3 */ + U16VEC4 = 350, /* U16VEC4 */ + I8VEC2 = 351, /* I8VEC2 */ + I8VEC3 = 352, /* I8VEC3 */ + I8VEC4 = 353, /* I8VEC4 */ + U8VEC2 = 354, /* U8VEC2 */ + U8VEC3 = 355, /* U8VEC3 */ + U8VEC4 = 356, /* U8VEC4 */ + DVEC2 = 357, /* DVEC2 */ + DVEC3 = 358, /* DVEC3 */ + DVEC4 = 359, /* DVEC4 */ + DMAT2 = 360, /* DMAT2 */ + DMAT3 = 361, /* DMAT3 */ + DMAT4 = 362, /* DMAT4 */ + BF16VEC2 = 363, /* BF16VEC2 */ + BF16VEC3 = 364, /* BF16VEC3 */ + BF16VEC4 = 365, /* BF16VEC4 */ + FE5M2VEC2 = 366, /* FE5M2VEC2 */ + FE5M2VEC3 = 367, /* FE5M2VEC3 */ + FE5M2VEC4 = 368, /* FE5M2VEC4 */ + FE4M3VEC2 = 369, /* FE4M3VEC2 */ + FE4M3VEC3 = 370, /* FE4M3VEC3 */ + FE4M3VEC4 = 371, /* FE4M3VEC4 */ + F16VEC2 = 372, /* F16VEC2 */ + F16VEC3 = 373, /* F16VEC3 */ + F16VEC4 = 374, /* F16VEC4 */ + F16MAT2 = 375, /* F16MAT2 */ + F16MAT3 = 376, /* F16MAT3 */ + F16MAT4 = 377, /* F16MAT4 */ + F32VEC2 = 378, /* F32VEC2 */ + F32VEC3 = 379, /* F32VEC3 */ + F32VEC4 = 380, /* F32VEC4 */ + F32MAT2 = 381, /* F32MAT2 */ + F32MAT3 = 382, /* F32MAT3 */ + F32MAT4 = 383, /* F32MAT4 */ + F64VEC2 = 384, /* F64VEC2 */ + F64VEC3 = 385, /* F64VEC3 */ + F64VEC4 = 386, /* F64VEC4 */ + F64MAT2 = 387, /* F64MAT2 */ + F64MAT3 = 388, /* F64MAT3 */ + F64MAT4 = 389, /* F64MAT4 */ + DMAT2X2 = 390, /* DMAT2X2 */ + DMAT2X3 = 391, /* DMAT2X3 */ + DMAT2X4 = 392, /* DMAT2X4 */ + DMAT3X2 = 393, /* DMAT3X2 */ + DMAT3X3 = 394, /* DMAT3X3 */ + DMAT3X4 = 395, /* DMAT3X4 */ + DMAT4X2 = 396, /* DMAT4X2 */ + DMAT4X3 = 397, /* DMAT4X3 */ + DMAT4X4 = 398, /* DMAT4X4 */ + F16MAT2X2 = 399, /* F16MAT2X2 */ + F16MAT2X3 = 400, /* F16MAT2X3 */ + F16MAT2X4 = 401, /* F16MAT2X4 */ + F16MAT3X2 = 402, /* F16MAT3X2 */ + F16MAT3X3 = 403, /* F16MAT3X3 */ + F16MAT3X4 = 404, /* F16MAT3X4 */ + F16MAT4X2 = 405, /* F16MAT4X2 */ + F16MAT4X3 = 406, /* F16MAT4X3 */ + F16MAT4X4 = 407, /* F16MAT4X4 */ + F32MAT2X2 = 408, /* F32MAT2X2 */ + F32MAT2X3 = 409, /* F32MAT2X3 */ + F32MAT2X4 = 410, /* F32MAT2X4 */ + F32MAT3X2 = 411, /* F32MAT3X2 */ + F32MAT3X3 = 412, /* F32MAT3X3 */ + F32MAT3X4 = 413, /* F32MAT3X4 */ + F32MAT4X2 = 414, /* F32MAT4X2 */ + F32MAT4X3 = 415, /* F32MAT4X3 */ + F32MAT4X4 = 416, /* F32MAT4X4 */ + F64MAT2X2 = 417, /* F64MAT2X2 */ + F64MAT2X3 = 418, /* F64MAT2X3 */ + F64MAT2X4 = 419, /* F64MAT2X4 */ + F64MAT3X2 = 420, /* F64MAT3X2 */ + F64MAT3X3 = 421, /* F64MAT3X3 */ + F64MAT3X4 = 422, /* F64MAT3X4 */ + F64MAT4X2 = 423, /* F64MAT4X2 */ + F64MAT4X3 = 424, /* F64MAT4X3 */ + F64MAT4X4 = 425, /* F64MAT4X4 */ + ATOMIC_UINT = 426, /* ATOMIC_UINT */ + ACCSTRUCTNV = 427, /* ACCSTRUCTNV */ + ACCSTRUCTEXT = 428, /* ACCSTRUCTEXT */ + RAYQUERYEXT = 429, /* RAYQUERYEXT */ + FCOOPMATNV = 430, /* FCOOPMATNV */ + ICOOPMATNV = 431, /* ICOOPMATNV */ + UCOOPMATNV = 432, /* UCOOPMATNV */ + COOPMAT = 433, /* COOPMAT */ + COOPVECNV = 434, /* COOPVECNV */ + HITOBJECTNV = 435, /* HITOBJECTNV */ + HITOBJECTATTRNV = 436, /* HITOBJECTATTRNV */ + HITOBJECTEXT = 437, /* HITOBJECTEXT */ + HITOBJECTATTREXT = 438, /* HITOBJECTATTREXT */ + TENSORLAYOUTNV = 439, /* TENSORLAYOUTNV */ + TENSORVIEWNV = 440, /* TENSORVIEWNV */ + TENSORARM = 441, /* TENSORARM */ + SAMPLERCUBEARRAY = 442, /* SAMPLERCUBEARRAY */ + SAMPLERCUBEARRAYSHADOW = 443, /* SAMPLERCUBEARRAYSHADOW */ + ISAMPLERCUBEARRAY = 444, /* ISAMPLERCUBEARRAY */ + USAMPLERCUBEARRAY = 445, /* USAMPLERCUBEARRAY */ + SAMPLER1D = 446, /* SAMPLER1D */ + SAMPLER1DARRAY = 447, /* SAMPLER1DARRAY */ + SAMPLER1DARRAYSHADOW = 448, /* SAMPLER1DARRAYSHADOW */ + ISAMPLER1D = 449, /* ISAMPLER1D */ + SAMPLER1DSHADOW = 450, /* SAMPLER1DSHADOW */ + SAMPLER2DRECT = 451, /* SAMPLER2DRECT */ + SAMPLER2DRECTSHADOW = 452, /* SAMPLER2DRECTSHADOW */ + ISAMPLER2DRECT = 453, /* ISAMPLER2DRECT */ + USAMPLER2DRECT = 454, /* USAMPLER2DRECT */ + SAMPLERBUFFER = 455, /* SAMPLERBUFFER */ + ISAMPLERBUFFER = 456, /* ISAMPLERBUFFER */ + USAMPLERBUFFER = 457, /* USAMPLERBUFFER */ + SAMPLER2DMS = 458, /* SAMPLER2DMS */ + ISAMPLER2DMS = 459, /* ISAMPLER2DMS */ + USAMPLER2DMS = 460, /* USAMPLER2DMS */ + SAMPLER2DMSARRAY = 461, /* SAMPLER2DMSARRAY */ + ISAMPLER2DMSARRAY = 462, /* ISAMPLER2DMSARRAY */ + USAMPLER2DMSARRAY = 463, /* USAMPLER2DMSARRAY */ + SAMPLEREXTERNALOES = 464, /* SAMPLEREXTERNALOES */ + SAMPLEREXTERNAL2DY2YEXT = 465, /* SAMPLEREXTERNAL2DY2YEXT */ + ISAMPLER1DARRAY = 466, /* ISAMPLER1DARRAY */ + USAMPLER1D = 467, /* USAMPLER1D */ + USAMPLER1DARRAY = 468, /* USAMPLER1DARRAY */ + F16SAMPLER1D = 469, /* F16SAMPLER1D */ + F16SAMPLER2D = 470, /* F16SAMPLER2D */ + F16SAMPLER3D = 471, /* F16SAMPLER3D */ + F16SAMPLER2DRECT = 472, /* F16SAMPLER2DRECT */ + F16SAMPLERCUBE = 473, /* F16SAMPLERCUBE */ + F16SAMPLER1DARRAY = 474, /* F16SAMPLER1DARRAY */ + F16SAMPLER2DARRAY = 475, /* F16SAMPLER2DARRAY */ + F16SAMPLERCUBEARRAY = 476, /* F16SAMPLERCUBEARRAY */ + F16SAMPLERBUFFER = 477, /* F16SAMPLERBUFFER */ + F16SAMPLER2DMS = 478, /* F16SAMPLER2DMS */ + F16SAMPLER2DMSARRAY = 479, /* F16SAMPLER2DMSARRAY */ + F16SAMPLER1DSHADOW = 480, /* F16SAMPLER1DSHADOW */ + F16SAMPLER2DSHADOW = 481, /* F16SAMPLER2DSHADOW */ + F16SAMPLER1DARRAYSHADOW = 482, /* F16SAMPLER1DARRAYSHADOW */ + F16SAMPLER2DARRAYSHADOW = 483, /* F16SAMPLER2DARRAYSHADOW */ + F16SAMPLER2DRECTSHADOW = 484, /* F16SAMPLER2DRECTSHADOW */ + F16SAMPLERCUBESHADOW = 485, /* F16SAMPLERCUBESHADOW */ + F16SAMPLERCUBEARRAYSHADOW = 486, /* F16SAMPLERCUBEARRAYSHADOW */ + IMAGE1D = 487, /* IMAGE1D */ + IIMAGE1D = 488, /* IIMAGE1D */ + UIMAGE1D = 489, /* UIMAGE1D */ + IMAGE2D = 490, /* IMAGE2D */ + IIMAGE2D = 491, /* IIMAGE2D */ + UIMAGE2D = 492, /* UIMAGE2D */ + IMAGE3D = 493, /* IMAGE3D */ + IIMAGE3D = 494, /* IIMAGE3D */ + UIMAGE3D = 495, /* UIMAGE3D */ + IMAGE2DRECT = 496, /* IMAGE2DRECT */ + IIMAGE2DRECT = 497, /* IIMAGE2DRECT */ + UIMAGE2DRECT = 498, /* UIMAGE2DRECT */ + IMAGECUBE = 499, /* IMAGECUBE */ + IIMAGECUBE = 500, /* IIMAGECUBE */ + UIMAGECUBE = 501, /* UIMAGECUBE */ + IMAGEBUFFER = 502, /* IMAGEBUFFER */ + IIMAGEBUFFER = 503, /* IIMAGEBUFFER */ + UIMAGEBUFFER = 504, /* UIMAGEBUFFER */ + IMAGE1DARRAY = 505, /* IMAGE1DARRAY */ + IIMAGE1DARRAY = 506, /* IIMAGE1DARRAY */ + UIMAGE1DARRAY = 507, /* UIMAGE1DARRAY */ + IMAGE2DARRAY = 508, /* IMAGE2DARRAY */ + IIMAGE2DARRAY = 509, /* IIMAGE2DARRAY */ + UIMAGE2DARRAY = 510, /* UIMAGE2DARRAY */ + IMAGECUBEARRAY = 511, /* IMAGECUBEARRAY */ + IIMAGECUBEARRAY = 512, /* IIMAGECUBEARRAY */ + UIMAGECUBEARRAY = 513, /* UIMAGECUBEARRAY */ + IMAGE2DMS = 514, /* IMAGE2DMS */ + IIMAGE2DMS = 515, /* IIMAGE2DMS */ + UIMAGE2DMS = 516, /* UIMAGE2DMS */ + IMAGE2DMSARRAY = 517, /* IMAGE2DMSARRAY */ + IIMAGE2DMSARRAY = 518, /* IIMAGE2DMSARRAY */ + UIMAGE2DMSARRAY = 519, /* UIMAGE2DMSARRAY */ + F16IMAGE1D = 520, /* F16IMAGE1D */ + F16IMAGE2D = 521, /* F16IMAGE2D */ + F16IMAGE3D = 522, /* F16IMAGE3D */ + F16IMAGE2DRECT = 523, /* F16IMAGE2DRECT */ + F16IMAGECUBE = 524, /* F16IMAGECUBE */ + F16IMAGE1DARRAY = 525, /* F16IMAGE1DARRAY */ + F16IMAGE2DARRAY = 526, /* F16IMAGE2DARRAY */ + F16IMAGECUBEARRAY = 527, /* F16IMAGECUBEARRAY */ + F16IMAGEBUFFER = 528, /* F16IMAGEBUFFER */ + F16IMAGE2DMS = 529, /* F16IMAGE2DMS */ + F16IMAGE2DMSARRAY = 530, /* F16IMAGE2DMSARRAY */ + I64IMAGE1D = 531, /* I64IMAGE1D */ + U64IMAGE1D = 532, /* U64IMAGE1D */ + I64IMAGE2D = 533, /* I64IMAGE2D */ + U64IMAGE2D = 534, /* U64IMAGE2D */ + I64IMAGE3D = 535, /* I64IMAGE3D */ + U64IMAGE3D = 536, /* U64IMAGE3D */ + I64IMAGE2DRECT = 537, /* I64IMAGE2DRECT */ + U64IMAGE2DRECT = 538, /* U64IMAGE2DRECT */ + I64IMAGECUBE = 539, /* I64IMAGECUBE */ + U64IMAGECUBE = 540, /* U64IMAGECUBE */ + I64IMAGEBUFFER = 541, /* I64IMAGEBUFFER */ + U64IMAGEBUFFER = 542, /* U64IMAGEBUFFER */ + I64IMAGE1DARRAY = 543, /* I64IMAGE1DARRAY */ + U64IMAGE1DARRAY = 544, /* U64IMAGE1DARRAY */ + I64IMAGE2DARRAY = 545, /* I64IMAGE2DARRAY */ + U64IMAGE2DARRAY = 546, /* U64IMAGE2DARRAY */ + I64IMAGECUBEARRAY = 547, /* I64IMAGECUBEARRAY */ + U64IMAGECUBEARRAY = 548, /* U64IMAGECUBEARRAY */ + I64IMAGE2DMS = 549, /* I64IMAGE2DMS */ + U64IMAGE2DMS = 550, /* U64IMAGE2DMS */ + I64IMAGE2DMSARRAY = 551, /* I64IMAGE2DMSARRAY */ + U64IMAGE2DMSARRAY = 552, /* U64IMAGE2DMSARRAY */ + TEXTURECUBEARRAY = 553, /* TEXTURECUBEARRAY */ + ITEXTURECUBEARRAY = 554, /* ITEXTURECUBEARRAY */ + UTEXTURECUBEARRAY = 555, /* UTEXTURECUBEARRAY */ + TEXTURE1D = 556, /* TEXTURE1D */ + ITEXTURE1D = 557, /* ITEXTURE1D */ + UTEXTURE1D = 558, /* UTEXTURE1D */ + TEXTURE1DARRAY = 559, /* TEXTURE1DARRAY */ + ITEXTURE1DARRAY = 560, /* ITEXTURE1DARRAY */ + UTEXTURE1DARRAY = 561, /* UTEXTURE1DARRAY */ + TEXTURE2DRECT = 562, /* TEXTURE2DRECT */ + ITEXTURE2DRECT = 563, /* ITEXTURE2DRECT */ + UTEXTURE2DRECT = 564, /* UTEXTURE2DRECT */ + TEXTUREBUFFER = 565, /* TEXTUREBUFFER */ + ITEXTUREBUFFER = 566, /* ITEXTUREBUFFER */ + UTEXTUREBUFFER = 567, /* UTEXTUREBUFFER */ + TEXTURE2DMS = 568, /* TEXTURE2DMS */ + ITEXTURE2DMS = 569, /* ITEXTURE2DMS */ + UTEXTURE2DMS = 570, /* UTEXTURE2DMS */ + TEXTURE2DMSARRAY = 571, /* TEXTURE2DMSARRAY */ + ITEXTURE2DMSARRAY = 572, /* ITEXTURE2DMSARRAY */ + UTEXTURE2DMSARRAY = 573, /* UTEXTURE2DMSARRAY */ + F16TEXTURE1D = 574, /* F16TEXTURE1D */ + F16TEXTURE2D = 575, /* F16TEXTURE2D */ + F16TEXTURE3D = 576, /* F16TEXTURE3D */ + F16TEXTURE2DRECT = 577, /* F16TEXTURE2DRECT */ + F16TEXTURECUBE = 578, /* F16TEXTURECUBE */ + F16TEXTURE1DARRAY = 579, /* F16TEXTURE1DARRAY */ + F16TEXTURE2DARRAY = 580, /* F16TEXTURE2DARRAY */ + F16TEXTURECUBEARRAY = 581, /* F16TEXTURECUBEARRAY */ + F16TEXTUREBUFFER = 582, /* F16TEXTUREBUFFER */ + F16TEXTURE2DMS = 583, /* F16TEXTURE2DMS */ + F16TEXTURE2DMSARRAY = 584, /* F16TEXTURE2DMSARRAY */ + SUBPASSINPUT = 585, /* SUBPASSINPUT */ + SUBPASSINPUTMS = 586, /* SUBPASSINPUTMS */ + ISUBPASSINPUT = 587, /* ISUBPASSINPUT */ + ISUBPASSINPUTMS = 588, /* ISUBPASSINPUTMS */ + USUBPASSINPUT = 589, /* USUBPASSINPUT */ + USUBPASSINPUTMS = 590, /* USUBPASSINPUTMS */ + F16SUBPASSINPUT = 591, /* F16SUBPASSINPUT */ + F16SUBPASSINPUTMS = 592, /* F16SUBPASSINPUTMS */ + SPIRV_INSTRUCTION = 593, /* SPIRV_INSTRUCTION */ + SPIRV_EXECUTION_MODE = 594, /* SPIRV_EXECUTION_MODE */ + SPIRV_EXECUTION_MODE_ID = 595, /* SPIRV_EXECUTION_MODE_ID */ + SPIRV_DECORATE = 596, /* SPIRV_DECORATE */ + SPIRV_DECORATE_ID = 597, /* SPIRV_DECORATE_ID */ + SPIRV_DECORATE_STRING = 598, /* SPIRV_DECORATE_STRING */ + SPIRV_TYPE = 599, /* SPIRV_TYPE */ + SPIRV_STORAGE_CLASS = 600, /* SPIRV_STORAGE_CLASS */ + SPIRV_BY_REFERENCE = 601, /* SPIRV_BY_REFERENCE */ + SPIRV_LITERAL = 602, /* SPIRV_LITERAL */ + ATTACHMENTEXT = 603, /* ATTACHMENTEXT */ + IATTACHMENTEXT = 604, /* IATTACHMENTEXT */ + UATTACHMENTEXT = 605, /* UATTACHMENTEXT */ + LEFT_OP = 606, /* LEFT_OP */ + RIGHT_OP = 607, /* RIGHT_OP */ + INC_OP = 608, /* INC_OP */ + DEC_OP = 609, /* DEC_OP */ + LE_OP = 610, /* LE_OP */ + GE_OP = 611, /* GE_OP */ + EQ_OP = 612, /* EQ_OP */ + NE_OP = 613, /* NE_OP */ + AND_OP = 614, /* AND_OP */ + OR_OP = 615, /* OR_OP */ + XOR_OP = 616, /* XOR_OP */ + MUL_ASSIGN = 617, /* MUL_ASSIGN */ + DIV_ASSIGN = 618, /* DIV_ASSIGN */ + ADD_ASSIGN = 619, /* ADD_ASSIGN */ + MOD_ASSIGN = 620, /* MOD_ASSIGN */ + LEFT_ASSIGN = 621, /* LEFT_ASSIGN */ + RIGHT_ASSIGN = 622, /* RIGHT_ASSIGN */ + AND_ASSIGN = 623, /* AND_ASSIGN */ + XOR_ASSIGN = 624, /* XOR_ASSIGN */ + OR_ASSIGN = 625, /* OR_ASSIGN */ + SUB_ASSIGN = 626, /* SUB_ASSIGN */ + STRING_LITERAL = 627, /* STRING_LITERAL */ + LEFT_PAREN = 628, /* LEFT_PAREN */ + RIGHT_PAREN = 629, /* RIGHT_PAREN */ + LEFT_BRACKET = 630, /* LEFT_BRACKET */ + RIGHT_BRACKET = 631, /* RIGHT_BRACKET */ + LEFT_BRACE = 632, /* LEFT_BRACE */ + RIGHT_BRACE = 633, /* RIGHT_BRACE */ + DOT = 634, /* DOT */ + COMMA = 635, /* COMMA */ + COLON = 636, /* COLON */ + EQUAL = 637, /* EQUAL */ + SEMICOLON = 638, /* SEMICOLON */ + BANG = 639, /* BANG */ + DASH = 640, /* DASH */ + TILDE = 641, /* TILDE */ + PLUS = 642, /* PLUS */ + STAR = 643, /* STAR */ + SLASH = 644, /* SLASH */ + PERCENT = 645, /* PERCENT */ + LEFT_ANGLE = 646, /* LEFT_ANGLE */ + RIGHT_ANGLE = 647, /* RIGHT_ANGLE */ + VERTICAL_BAR = 648, /* VERTICAL_BAR */ + CARET = 649, /* CARET */ + AMPERSAND = 650, /* AMPERSAND */ + QUESTION = 651, /* QUESTION */ + INVARIANT = 652, /* INVARIANT */ + HIGH_PRECISION = 653, /* HIGH_PRECISION */ + MEDIUM_PRECISION = 654, /* MEDIUM_PRECISION */ + LOW_PRECISION = 655, /* LOW_PRECISION */ + PRECISION = 656, /* PRECISION */ + PACKED = 657, /* PACKED */ + RESOURCE = 658, /* RESOURCE */ + SUPERP = 659, /* SUPERP */ + FLOATCONSTANT = 660, /* FLOATCONSTANT */ + INTCONSTANT = 661, /* INTCONSTANT */ + UINTCONSTANT = 662, /* UINTCONSTANT */ + BOOLCONSTANT = 663, /* BOOLCONSTANT */ + IDENTIFIER = 664, /* IDENTIFIER */ + TYPE_NAME = 665, /* TYPE_NAME */ + CENTROID = 666, /* CENTROID */ + IN = 667, /* IN */ + OUT = 668, /* OUT */ + INOUT = 669, /* INOUT */ + STRUCT = 670, /* STRUCT */ + VOID = 671, /* VOID */ + WHILE = 672, /* WHILE */ + BREAK = 673, /* BREAK */ + CONTINUE = 674, /* CONTINUE */ + DO = 675, /* DO */ + ELSE = 676, /* ELSE */ + FOR = 677, /* FOR */ + IF = 678, /* IF */ + DISCARD = 679, /* DISCARD */ + RETURN = 680, /* RETURN */ + SWITCH = 681, /* SWITCH */ + CASE = 682, /* CASE */ + DEFAULT = 683, /* DEFAULT */ + TERMINATE_INVOCATION = 684, /* TERMINATE_INVOCATION */ + TERMINATE_RAY = 685, /* TERMINATE_RAY */ + IGNORE_INTERSECTION = 686, /* IGNORE_INTERSECTION */ + UNIFORM = 687, /* UNIFORM */ + SHARED = 688, /* SHARED */ + BUFFER = 689, /* BUFFER */ + TILEIMAGEEXT = 690, /* TILEIMAGEEXT */ + FLAT = 691, /* FLAT */ + SMOOTH = 692, /* SMOOTH */ + LAYOUT = 693, /* LAYOUT */ + DOUBLECONSTANT = 694, /* DOUBLECONSTANT */ + INT16CONSTANT = 695, /* INT16CONSTANT */ + UINT16CONSTANT = 696, /* UINT16CONSTANT */ + FLOAT16CONSTANT = 697, /* FLOAT16CONSTANT */ + INT32CONSTANT = 698, /* INT32CONSTANT */ + UINT32CONSTANT = 699, /* UINT32CONSTANT */ + INT64CONSTANT = 700, /* INT64CONSTANT */ + UINT64CONSTANT = 701, /* UINT64CONSTANT */ + SUBROUTINE = 702, /* SUBROUTINE */ + DEMOTE = 703, /* DEMOTE */ + FUNCTION = 704, /* FUNCTION */ + PAYLOADNV = 705, /* PAYLOADNV */ + PAYLOADINNV = 706, /* PAYLOADINNV */ + HITATTRNV = 707, /* HITATTRNV */ + CALLDATANV = 708, /* CALLDATANV */ + CALLDATAINNV = 709, /* CALLDATAINNV */ + PAYLOADEXT = 710, /* PAYLOADEXT */ + PAYLOADINEXT = 711, /* PAYLOADINEXT */ + HITATTREXT = 712, /* HITATTREXT */ + CALLDATAEXT = 713, /* CALLDATAEXT */ + CALLDATAINEXT = 714, /* CALLDATAINEXT */ + PATCH = 715, /* PATCH */ + SAMPLE = 716, /* SAMPLE */ + NONUNIFORM = 717, /* NONUNIFORM */ + COHERENT = 718, /* COHERENT */ + VOLATILE = 719, /* VOLATILE */ + RESTRICT = 720, /* RESTRICT */ + READONLY = 721, /* READONLY */ + WRITEONLY = 722, /* WRITEONLY */ + NONTEMPORAL = 723, /* NONTEMPORAL */ + DEVICECOHERENT = 724, /* DEVICECOHERENT */ + QUEUEFAMILYCOHERENT = 725, /* QUEUEFAMILYCOHERENT */ + WORKGROUPCOHERENT = 726, /* WORKGROUPCOHERENT */ + SUBGROUPCOHERENT = 727, /* SUBGROUPCOHERENT */ + NONPRIVATE = 728, /* NONPRIVATE */ + SHADERCALLCOHERENT = 729, /* SHADERCALLCOHERENT */ + NOPERSPECTIVE = 730, /* NOPERSPECTIVE */ + EXPLICITINTERPAMD = 731, /* EXPLICITINTERPAMD */ + PERVERTEXEXT = 732, /* PERVERTEXEXT */ + PERVERTEXNV = 733, /* PERVERTEXNV */ + PERPRIMITIVENV = 734, /* PERPRIMITIVENV */ + PERVIEWNV = 735, /* PERVIEWNV */ + PERTASKNV = 736, /* PERTASKNV */ + PERPRIMITIVEEXT = 737, /* PERPRIMITIVEEXT */ + TASKPAYLOADWORKGROUPEXT = 738, /* TASKPAYLOADWORKGROUPEXT */ + PRECISE = 739 /* PRECISE */ + }; + typedef enum yytokentype yytoken_kind_t; +#endif + +namespace QtShaderTools { +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +union YYSTYPE +{ +#line 72 "MachineIndependent/glslang.y" + + struct { + glslang::TSourceLoc loc; + union { + glslang::TString *string; + int i; + unsigned int u; + long long i64; + unsigned long long u64; + bool b; + double d; + }; + glslang::TSymbol* symbol; + } lex; + struct { + glslang::TSourceLoc loc; + glslang::TOperator op; + union { + TIntermNode* intermNode; + glslang::TIntermNodePair nodePair; + glslang::TIntermTyped* intermTypedNode; + glslang::TAttributes* attributes; + glslang::TSpirvRequirement* spirvReq; + glslang::TSpirvInstruction* spirvInst; + glslang::TSpirvTypeParameters* spirvTypeParams; + }; + union { + glslang::TPublicType type; + glslang::TFunction* function; + glslang::TParameter param; + glslang::TTypeLoc typeLine; + glslang::TTypeList* typeList; + glslang::TArraySizes* arraySizes; + glslang::TIdentifierList* identifierList; + }; + glslang::TTypeParameters* typeParameters; + } interm; + +#line 587 "MachineIndependent/glslang_tab.cpp.h" + +}; +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + + + + +int yyparse (QtShaderTools::glslang::TParseContext* pParseContext); +} // namespace QtShaderTools + +#endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp new file mode 100644 index 0000000000..fe21d99329 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp @@ -0,0 +1,1540 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2016 LunarG, Inc. +// Copyright (C) 2017, 2022-2024 Arm Limited. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "localintermediate.h" +#include "../Include/InfoSink.h" + +#ifdef _MSC_VER +#include +#else +#include +#endif +#include + + +namespace QtShaderTools { +namespace glslang { + +// +// Two purposes: +// 1. Show an example of how to iterate tree. Functions can +// also directly call Traverse() on children themselves to +// have finer grained control over the process than shown here. +// See the last function for how to get started. +// 2. Print out a text based description of the tree. +// + +// +// Use this class to carry along data from node to node in +// the traversal +// +class TOutputTraverser : public TIntermTraverser { +public: + TOutputTraverser(TInfoSink& i) : infoSink(i), extraOutput(NoExtraOutput) { } + + enum EExtraOutput { + NoExtraOutput, + BinaryDoubleOutput + }; + void setDoubleOutput(EExtraOutput extra) { extraOutput = extra; } + + virtual bool visitBinary(TVisit, TIntermBinary* node); + virtual bool visitUnary(TVisit, TIntermUnary* node); + virtual bool visitAggregate(TVisit, TIntermAggregate* node); + virtual bool visitSelection(TVisit, TIntermSelection* node); + virtual void visitConstantUnion(TIntermConstantUnion* node); + virtual void visitSymbol(TIntermSymbol* node); + virtual bool visitLoop(TVisit, TIntermLoop* node); + virtual bool visitBranch(TVisit, TIntermBranch* node); + virtual bool visitSwitch(TVisit, TIntermSwitch* node); + virtual bool visitVariableDecl(TVisit, TIntermVariableDecl* node); + + TInfoSink& infoSink; +protected: + TOutputTraverser(TOutputTraverser&); + TOutputTraverser& operator=(TOutputTraverser&); + + EExtraOutput extraOutput; +}; + +// +// Helper functions for printing, not part of traversing. +// + +static void OutputTreeText(TInfoSink& infoSink, const TIntermNode* node, const int depth) +{ + int i; + + infoSink.debug << node->getLoc().string << ":"; + if (node->getLoc().line) + infoSink.debug << node->getLoc().line; + else + infoSink.debug << "? "; + + for (i = 0; i < depth; ++i) + infoSink.debug << " "; +} + +// +// The rest of the file are the traversal functions. The last one +// is the one that starts the traversal. +// +// Return true from interior nodes to have the external traversal +// continue on to children. If you process children yourself, +// return false. +// + +bool TOutputTraverser::visitBinary(TVisit /* visit */, TIntermBinary* node) +{ + TInfoSink& out = infoSink; + + OutputTreeText(out, node, depth); + + switch (node->getOp()) { + case EOpAssign: out.debug << "move second child to first child"; break; + case EOpAddAssign: out.debug << "add second child into first child"; break; + case EOpSubAssign: out.debug << "subtract second child into first child"; break; + case EOpMulAssign: out.debug << "multiply second child into first child"; break; + case EOpVectorTimesMatrixAssign: out.debug << "matrix mult second child into first child"; break; + case EOpVectorTimesScalarAssign: out.debug << "vector scale second child into first child"; break; + case EOpMatrixTimesScalarAssign: out.debug << "matrix scale second child into first child"; break; + case EOpMatrixTimesMatrixAssign: out.debug << "matrix mult second child into first child"; break; + case EOpDivAssign: out.debug << "divide second child into first child"; break; + case EOpModAssign: out.debug << "mod second child into first child"; break; + case EOpAndAssign: out.debug << "and second child into first child"; break; + case EOpInclusiveOrAssign: out.debug << "or second child into first child"; break; + case EOpExclusiveOrAssign: out.debug << "exclusive or second child into first child"; break; + case EOpLeftShiftAssign: out.debug << "left shift second child into first child"; break; + case EOpRightShiftAssign: out.debug << "right shift second child into first child"; break; + + case EOpIndexDirect: out.debug << "direct index"; break; + case EOpIndexIndirect: out.debug << "indirect index"; break; + case EOpIndexDirectStruct: + { + bool reference = node->getLeft()->getType().isReference(); + const TTypeList *members = reference ? node->getLeft()->getType().getReferentType()->getStruct() : node->getLeft()->getType().getStruct(); + out.debug << (*members)[node->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst()].type->getFieldName(); + out.debug << ": direct index for structure"; break; + } + case EOpVectorSwizzle: out.debug << "vector swizzle"; break; + case EOpMatrixSwizzle: out.debug << "matrix swizzle"; break; + + case EOpAdd: out.debug << "add"; break; + case EOpSub: out.debug << "subtract"; break; + case EOpMul: out.debug << "component-wise multiply"; break; + case EOpDiv: out.debug << "divide"; break; + case EOpMod: out.debug << "mod"; break; + case EOpRightShift: out.debug << "right-shift"; break; + case EOpLeftShift: out.debug << "left-shift"; break; + case EOpAnd: out.debug << "bitwise and"; break; + case EOpInclusiveOr: out.debug << "inclusive-or"; break; + case EOpExclusiveOr: out.debug << "exclusive-or"; break; + case EOpEqual: out.debug << "Compare Equal"; break; + case EOpNotEqual: out.debug << "Compare Not Equal"; break; + case EOpLessThan: out.debug << "Compare Less Than"; break; + case EOpGreaterThan: out.debug << "Compare Greater Than"; break; + case EOpLessThanEqual: out.debug << "Compare Less Than or Equal"; break; + case EOpGreaterThanEqual: out.debug << "Compare Greater Than or Equal"; break; + case EOpVectorEqual: out.debug << "Equal"; break; + case EOpVectorNotEqual: out.debug << "NotEqual"; break; + + case EOpVectorTimesScalar: out.debug << "vector-scale"; break; + case EOpVectorTimesMatrix: out.debug << "vector-times-matrix"; break; + case EOpMatrixTimesVector: out.debug << "matrix-times-vector"; break; + case EOpMatrixTimesScalar: out.debug << "matrix-scale"; break; + case EOpMatrixTimesMatrix: out.debug << "matrix-multiply"; break; + + case EOpLogicalOr: out.debug << "logical-or"; break; + case EOpLogicalXor: out.debug << "logical-xor"; break; + case EOpLogicalAnd: out.debug << "logical-and"; break; + + case EOpAbsDifference: out.debug << "absoluteDifference"; break; + case EOpAddSaturate: out.debug << "addSaturate"; break; + case EOpSubSaturate: out.debug << "subtractSaturate"; break; + case EOpAverage: out.debug << "average"; break; + case EOpAverageRounded: out.debug << "averageRounded"; break; + case EOpMul32x16: out.debug << "multiply32x16"; break; + + default: out.debug << ""; + } + + out.debug << " (" << node->getCompleteString() << ")"; + + out.debug << "\n"; + + return true; +} + +bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) +{ + TInfoSink& out = infoSink; + + OutputTreeText(out, node, depth); + + if (IsOpNumericConv(node->getAsOperator()->getOp())) { + out.debug << "Convert " << TType::getBasicString(node->getOperand()->getType().getBasicType()) << " to " << TType::getBasicString(node->getType().getBasicType()); + out.debug << " (" << node->getCompleteString() << ")"; + out.debug << "\n"; + return true; + } + + switch (node->getOp()) { + case EOpNegative: out.debug << "Negate value"; break; + case EOpVectorLogicalNot: + case EOpLogicalNot: out.debug << "Negate conditional"; break; + case EOpBitwiseNot: out.debug << "Bitwise not"; break; + + case EOpPostIncrement: out.debug << "Post-Increment"; break; + case EOpPostDecrement: out.debug << "Post-Decrement"; break; + case EOpPreIncrement: out.debug << "Pre-Increment"; break; + case EOpPreDecrement: out.debug << "Pre-Decrement"; break; + case EOpCopyObject: out.debug << "copy object"; break; + + case EOpConvUint64ToPtr: out.debug << "Convert uint64_t to pointer"; break; + case EOpConvPtrToUint64: out.debug << "Convert pointer to uint64_t"; break; + + case EOpConvUint64ToAccStruct: out.debug << "Convert uint64_t to acceleration structure"; break; + case EOpConvUvec2ToAccStruct: out.debug << "Convert uvec2 to acceleration strucuture "; break; + + case EOpRadians: out.debug << "radians"; break; + case EOpDegrees: out.debug << "degrees"; break; + case EOpSin: out.debug << "sine"; break; + case EOpCos: out.debug << "cosine"; break; + case EOpTan: out.debug << "tangent"; break; + case EOpAsin: out.debug << "arc sine"; break; + case EOpAcos: out.debug << "arc cosine"; break; + case EOpAtan: out.debug << "arc tangent"; break; + case EOpSinh: out.debug << "hyp. sine"; break; + case EOpCosh: out.debug << "hyp. cosine"; break; + case EOpTanh: out.debug << "hyp. tangent"; break; + case EOpAsinh: out.debug << "arc hyp. sine"; break; + case EOpAcosh: out.debug << "arc hyp. cosine"; break; + case EOpAtanh: out.debug << "arc hyp. tangent"; break; + + case EOpExp: out.debug << "exp"; break; + case EOpLog: out.debug << "log"; break; + case EOpExp2: out.debug << "exp2"; break; + case EOpLog2: out.debug << "log2"; break; + case EOpSqrt: out.debug << "sqrt"; break; + case EOpInverseSqrt: out.debug << "inverse sqrt"; break; + + case EOpAbs: out.debug << "Absolute value"; break; + case EOpSign: out.debug << "Sign"; break; + case EOpFloor: out.debug << "Floor"; break; + case EOpTrunc: out.debug << "trunc"; break; + case EOpRound: out.debug << "round"; break; + case EOpRoundEven: out.debug << "roundEven"; break; + case EOpCeil: out.debug << "Ceiling"; break; + case EOpFract: out.debug << "Fraction"; break; + + case EOpIsNan: out.debug << "isnan"; break; + case EOpIsInf: out.debug << "isinf"; break; + + case EOpFloatBitsToInt: out.debug << "floatBitsToInt"; break; + case EOpFloatBitsToUint:out.debug << "floatBitsToUint"; break; + case EOpIntBitsToFloat: out.debug << "intBitsToFloat"; break; + case EOpUintBitsToFloat:out.debug << "uintBitsToFloat"; break; + case EOpDoubleBitsToInt64: out.debug << "doubleBitsToInt64"; break; + case EOpDoubleBitsToUint64: out.debug << "doubleBitsToUint64"; break; + case EOpInt64BitsToDouble: out.debug << "int64BitsToDouble"; break; + case EOpUint64BitsToDouble: out.debug << "uint64BitsToDouble"; break; + case EOpFloat16BitsToInt16: out.debug << "float16BitsToInt16"; break; + case EOpFloat16BitsToUint16: out.debug << "float16BitsToUint16"; break; + case EOpInt16BitsToFloat16: out.debug << "int16BitsToFloat16"; break; + case EOpUint16BitsToFloat16: out.debug << "uint16BitsToFloat16"; break; + + case EOpPackSnorm2x16: out.debug << "packSnorm2x16"; break; + case EOpUnpackSnorm2x16:out.debug << "unpackSnorm2x16"; break; + case EOpPackUnorm2x16: out.debug << "packUnorm2x16"; break; + case EOpUnpackUnorm2x16:out.debug << "unpackUnorm2x16"; break; + case EOpPackHalf2x16: out.debug << "packHalf2x16"; break; + case EOpUnpackHalf2x16: out.debug << "unpackHalf2x16"; break; + case EOpPack16: out.debug << "pack16"; break; + case EOpPack32: out.debug << "pack32"; break; + case EOpPack64: out.debug << "pack64"; break; + case EOpUnpack32: out.debug << "unpack32"; break; + case EOpUnpack16: out.debug << "unpack16"; break; + case EOpUnpack8: out.debug << "unpack8"; break; + + case EOpPackSnorm4x8: out.debug << "PackSnorm4x8"; break; + case EOpUnpackSnorm4x8: out.debug << "UnpackSnorm4x8"; break; + case EOpPackUnorm4x8: out.debug << "PackUnorm4x8"; break; + case EOpUnpackUnorm4x8: out.debug << "UnpackUnorm4x8"; break; + case EOpPackDouble2x32: out.debug << "PackDouble2x32"; break; + case EOpUnpackDouble2x32: out.debug << "UnpackDouble2x32"; break; + + case EOpPackInt2x32: out.debug << "packInt2x32"; break; + case EOpUnpackInt2x32: out.debug << "unpackInt2x32"; break; + case EOpPackUint2x32: out.debug << "packUint2x32"; break; + case EOpUnpackUint2x32: out.debug << "unpackUint2x32"; break; + + case EOpPackInt2x16: out.debug << "packInt2x16"; break; + case EOpUnpackInt2x16: out.debug << "unpackInt2x16"; break; + case EOpPackUint2x16: out.debug << "packUint2x16"; break; + case EOpUnpackUint2x16: out.debug << "unpackUint2x16"; break; + + case EOpPackInt4x16: out.debug << "packInt4x16"; break; + case EOpUnpackInt4x16: out.debug << "unpackInt4x16"; break; + case EOpPackUint4x16: out.debug << "packUint4x16"; break; + case EOpUnpackUint4x16: out.debug << "unpackUint4x16"; break; + case EOpPackFloat2x16: out.debug << "packFloat2x16"; break; + case EOpUnpackFloat2x16: out.debug << "unpackFloat2x16"; break; + + case EOpLength: out.debug << "length"; break; + case EOpNormalize: out.debug << "normalize"; break; + case EOpDPdx: out.debug << "dPdx"; break; + case EOpDPdy: out.debug << "dPdy"; break; + case EOpFwidth: out.debug << "fwidth"; break; + case EOpDPdxFine: out.debug << "dPdxFine"; break; + case EOpDPdyFine: out.debug << "dPdyFine"; break; + case EOpFwidthFine: out.debug << "fwidthFine"; break; + case EOpDPdxCoarse: out.debug << "dPdxCoarse"; break; + case EOpDPdyCoarse: out.debug << "dPdyCoarse"; break; + case EOpFwidthCoarse: out.debug << "fwidthCoarse"; break; + + case EOpInterpolateAtCentroid: out.debug << "interpolateAtCentroid"; break; + + case EOpDeterminant: out.debug << "determinant"; break; + case EOpMatrixInverse: out.debug << "inverse"; break; + case EOpTranspose: out.debug << "transpose"; break; + + case EOpAny: out.debug << "any"; break; + case EOpAll: out.debug << "all"; break; + + case EOpArrayLength: out.debug << "array length"; break; + + case EOpEmitStreamVertex: out.debug << "EmitStreamVertex"; break; + case EOpEndStreamPrimitive: out.debug << "EndStreamPrimitive"; break; + + case EOpAtomicCounterIncrement: out.debug << "AtomicCounterIncrement";break; + case EOpAtomicCounterDecrement: out.debug << "AtomicCounterDecrement";break; + case EOpAtomicCounter: out.debug << "AtomicCounter"; break; + + case EOpTextureQuerySize: out.debug << "textureSize"; break; + case EOpTextureQueryLod: out.debug << "textureQueryLod"; break; + case EOpTextureQueryLevels: out.debug << "textureQueryLevels"; break; + case EOpTextureQuerySamples: out.debug << "textureSamples"; break; + case EOpImageQuerySize: out.debug << "imageQuerySize"; break; + case EOpImageQuerySamples: out.debug << "imageQuerySamples"; break; + case EOpImageLoad: out.debug << "imageLoad"; break; + + case EOpBitFieldReverse: out.debug << "bitFieldReverse"; break; + case EOpBitCount: out.debug << "bitCount"; break; + case EOpFindLSB: out.debug << "findLSB"; break; + case EOpFindMSB: out.debug << "findMSB"; break; + + case EOpCountLeadingZeros: out.debug << "countLeadingZeros"; break; + case EOpCountTrailingZeros: out.debug << "countTrailingZeros"; break; + + case EOpNoise: out.debug << "noise"; break; + + case EOpBallot: out.debug << "ballot"; break; + case EOpReadFirstInvocation: out.debug << "readFirstInvocation"; break; + + case EOpAnyInvocation: out.debug << "anyInvocation"; break; + case EOpAllInvocations: out.debug << "allInvocations"; break; + case EOpAllInvocationsEqual: out.debug << "allInvocationsEqual"; break; + + case EOpSubgroupElect: out.debug << "subgroupElect"; break; + case EOpSubgroupAll: out.debug << "subgroupAll"; break; + case EOpSubgroupAny: out.debug << "subgroupAny"; break; + case EOpSubgroupAllEqual: out.debug << "subgroupAllEqual"; break; + case EOpSubgroupBroadcast: out.debug << "subgroupBroadcast"; break; + case EOpSubgroupBroadcastFirst: out.debug << "subgroupBroadcastFirst"; break; + case EOpSubgroupBallot: out.debug << "subgroupBallot"; break; + case EOpSubgroupInverseBallot: out.debug << "subgroupInverseBallot"; break; + case EOpSubgroupBallotBitExtract: out.debug << "subgroupBallotBitExtract"; break; + case EOpSubgroupBallotBitCount: out.debug << "subgroupBallotBitCount"; break; + case EOpSubgroupBallotInclusiveBitCount: out.debug << "subgroupBallotInclusiveBitCount"; break; + case EOpSubgroupBallotExclusiveBitCount: out.debug << "subgroupBallotExclusiveBitCount"; break; + case EOpSubgroupBallotFindLSB: out.debug << "subgroupBallotFindLSB"; break; + case EOpSubgroupBallotFindMSB: out.debug << "subgroupBallotFindMSB"; break; + case EOpSubgroupShuffle: out.debug << "subgroupShuffle"; break; + case EOpSubgroupShuffleXor: out.debug << "subgroupShuffleXor"; break; + case EOpSubgroupShuffleUp: out.debug << "subgroupShuffleUp"; break; + case EOpSubgroupShuffleDown: out.debug << "subgroupShuffleDown"; break; + case EOpSubgroupRotate: out.debug << "subgroupRotate"; break; + case EOpSubgroupClusteredRotate: out.debug << "subgroupClusteredRotate"; break; + case EOpSubgroupAdd: out.debug << "subgroupAdd"; break; + case EOpSubgroupMul: out.debug << "subgroupMul"; break; + case EOpSubgroupMin: out.debug << "subgroupMin"; break; + case EOpSubgroupMax: out.debug << "subgroupMax"; break; + case EOpSubgroupAnd: out.debug << "subgroupAnd"; break; + case EOpSubgroupOr: out.debug << "subgroupOr"; break; + case EOpSubgroupXor: out.debug << "subgroupXor"; break; + case EOpSubgroupInclusiveAdd: out.debug << "subgroupInclusiveAdd"; break; + case EOpSubgroupInclusiveMul: out.debug << "subgroupInclusiveMul"; break; + case EOpSubgroupInclusiveMin: out.debug << "subgroupInclusiveMin"; break; + case EOpSubgroupInclusiveMax: out.debug << "subgroupInclusiveMax"; break; + case EOpSubgroupInclusiveAnd: out.debug << "subgroupInclusiveAnd"; break; + case EOpSubgroupInclusiveOr: out.debug << "subgroupInclusiveOr"; break; + case EOpSubgroupInclusiveXor: out.debug << "subgroupInclusiveXor"; break; + case EOpSubgroupExclusiveAdd: out.debug << "subgroupExclusiveAdd"; break; + case EOpSubgroupExclusiveMul: out.debug << "subgroupExclusiveMul"; break; + case EOpSubgroupExclusiveMin: out.debug << "subgroupExclusiveMin"; break; + case EOpSubgroupExclusiveMax: out.debug << "subgroupExclusiveMax"; break; + case EOpSubgroupExclusiveAnd: out.debug << "subgroupExclusiveAnd"; break; + case EOpSubgroupExclusiveOr: out.debug << "subgroupExclusiveOr"; break; + case EOpSubgroupExclusiveXor: out.debug << "subgroupExclusiveXor"; break; + case EOpSubgroupClusteredAdd: out.debug << "subgroupClusteredAdd"; break; + case EOpSubgroupClusteredMul: out.debug << "subgroupClusteredMul"; break; + case EOpSubgroupClusteredMin: out.debug << "subgroupClusteredMin"; break; + case EOpSubgroupClusteredMax: out.debug << "subgroupClusteredMax"; break; + case EOpSubgroupClusteredAnd: out.debug << "subgroupClusteredAnd"; break; + case EOpSubgroupClusteredOr: out.debug << "subgroupClusteredOr"; break; + case EOpSubgroupClusteredXor: out.debug << "subgroupClusteredXor"; break; + case EOpSubgroupQuadBroadcast: out.debug << "subgroupQuadBroadcast"; break; + case EOpSubgroupQuadSwapHorizontal: out.debug << "subgroupQuadSwapHorizontal"; break; + case EOpSubgroupQuadSwapVertical: out.debug << "subgroupQuadSwapVertical"; break; + case EOpSubgroupQuadSwapDiagonal: out.debug << "subgroupQuadSwapDiagonal"; break; + case EOpSubgroupQuadAll: out.debug << "subgroupQuadAll"; break; + case EOpSubgroupQuadAny: out.debug << "subgroupQuadAny"; break; + + case EOpSubgroupPartition: out.debug << "subgroupPartitionNV"; break; + case EOpSubgroupPartitionedAdd: out.debug << "subgroupPartitionedAddNV"; break; + case EOpSubgroupPartitionedMul: out.debug << "subgroupPartitionedMulNV"; break; + case EOpSubgroupPartitionedMin: out.debug << "subgroupPartitionedMinNV"; break; + case EOpSubgroupPartitionedMax: out.debug << "subgroupPartitionedMaxNV"; break; + case EOpSubgroupPartitionedAnd: out.debug << "subgroupPartitionedAndNV"; break; + case EOpSubgroupPartitionedOr: out.debug << "subgroupPartitionedOrNV"; break; + case EOpSubgroupPartitionedXor: out.debug << "subgroupPartitionedXorNV"; break; + case EOpSubgroupPartitionedInclusiveAdd: out.debug << "subgroupPartitionedInclusiveAddNV"; break; + case EOpSubgroupPartitionedInclusiveMul: out.debug << "subgroupPartitionedInclusiveMulNV"; break; + case EOpSubgroupPartitionedInclusiveMin: out.debug << "subgroupPartitionedInclusiveMinNV"; break; + case EOpSubgroupPartitionedInclusiveMax: out.debug << "subgroupPartitionedInclusiveMaxNV"; break; + case EOpSubgroupPartitionedInclusiveAnd: out.debug << "subgroupPartitionedInclusiveAndNV"; break; + case EOpSubgroupPartitionedInclusiveOr: out.debug << "subgroupPartitionedInclusiveOrNV"; break; + case EOpSubgroupPartitionedInclusiveXor: out.debug << "subgroupPartitionedInclusiveXorNV"; break; + case EOpSubgroupPartitionedExclusiveAdd: out.debug << "subgroupPartitionedExclusiveAddNV"; break; + case EOpSubgroupPartitionedExclusiveMul: out.debug << "subgroupPartitionedExclusiveMulNV"; break; + case EOpSubgroupPartitionedExclusiveMin: out.debug << "subgroupPartitionedExclusiveMinNV"; break; + case EOpSubgroupPartitionedExclusiveMax: out.debug << "subgroupPartitionedExclusiveMaxNV"; break; + case EOpSubgroupPartitionedExclusiveAnd: out.debug << "subgroupPartitionedExclusiveAndNV"; break; + case EOpSubgroupPartitionedExclusiveOr: out.debug << "subgroupPartitionedExclusiveOrNV"; break; + case EOpSubgroupPartitionedExclusiveXor: out.debug << "subgroupPartitionedExclusiveXorNV"; break; + + case EOpClip: out.debug << "clip"; break; + case EOpIsFinite: out.debug << "isfinite"; break; + case EOpLog10: out.debug << "log10"; break; + case EOpRcp: out.debug << "rcp"; break; + case EOpSaturate: out.debug << "saturate"; break; + + case EOpSparseTexelsResident: out.debug << "sparseTexelsResident"; break; + + case EOpMinInvocations: out.debug << "minInvocations"; break; + case EOpMaxInvocations: out.debug << "maxInvocations"; break; + case EOpAddInvocations: out.debug << "addInvocations"; break; + case EOpMinInvocationsNonUniform: out.debug << "minInvocationsNonUniform"; break; + case EOpMaxInvocationsNonUniform: out.debug << "maxInvocationsNonUniform"; break; + case EOpAddInvocationsNonUniform: out.debug << "addInvocationsNonUniform"; break; + + case EOpMinInvocationsInclusiveScan: out.debug << "minInvocationsInclusiveScan"; break; + case EOpMaxInvocationsInclusiveScan: out.debug << "maxInvocationsInclusiveScan"; break; + case EOpAddInvocationsInclusiveScan: out.debug << "addInvocationsInclusiveScan"; break; + case EOpMinInvocationsInclusiveScanNonUniform: out.debug << "minInvocationsInclusiveScanNonUniform"; break; + case EOpMaxInvocationsInclusiveScanNonUniform: out.debug << "maxInvocationsInclusiveScanNonUniform"; break; + case EOpAddInvocationsInclusiveScanNonUniform: out.debug << "addInvocationsInclusiveScanNonUniform"; break; + + case EOpMinInvocationsExclusiveScan: out.debug << "minInvocationsExclusiveScan"; break; + case EOpMaxInvocationsExclusiveScan: out.debug << "maxInvocationsExclusiveScan"; break; + case EOpAddInvocationsExclusiveScan: out.debug << "addInvocationsExclusiveScan"; break; + case EOpMinInvocationsExclusiveScanNonUniform: out.debug << "minInvocationsExclusiveScanNonUniform"; break; + case EOpMaxInvocationsExclusiveScanNonUniform: out.debug << "maxInvocationsExclusiveScanNonUniform"; break; + case EOpAddInvocationsExclusiveScanNonUniform: out.debug << "addInvocationsExclusiveScanNonUniform"; break; + + case EOpMbcnt: out.debug << "mbcnt"; break; + + case EOpFragmentMaskFetch: out.debug << "fragmentMaskFetchAMD"; break; + case EOpFragmentFetch: out.debug << "fragmentFetchAMD"; break; + + case EOpCubeFaceIndex: out.debug << "cubeFaceIndex"; break; + case EOpCubeFaceCoord: out.debug << "cubeFaceCoord"; break; + + case EOpSubpassLoad: out.debug << "subpassLoad"; break; + case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break; + + case EOpColorAttachmentReadEXT: out.debug << "colorAttachmentReadEXT"; break; + + case EOpConstructReference: out.debug << "Construct reference type"; break; + + case EOpDeclare: out.debug << "Declare"; break; + + case EOpSpirvInst: out.debug << "spirv_instruction"; break; + + case EOpCreateTensorLayoutNV: out.debug << "createTensorLayoutNV"; break; + case EOpTensorLayoutSetBlockSizeNV: out.debug << "setTensorLayoutBlockSizeNV"; break; + case EOpTensorLayoutSetDimensionNV: out.debug << "setTensorLayoutDimensionNV"; break; + case EOpTensorLayoutSetStrideNV: out.debug << "setTensorLayoutStrideNV"; break; + case EOpTensorLayoutSliceNV: out.debug << "sliceTensorLayoutNV"; break; + case EOpTensorLayoutSetClampValueNV: out.debug << "setTensorLayoutClampValueNV"; break; + case EOpCreateTensorViewNV: out.debug << "createTensorViewNV"; break; + case EOpTensorViewSetDimensionNV: out.debug << "setTensorViewDimensionsNV"; break; + case EOpTensorViewSetStrideNV: out.debug << "setTensorViewStrideNV"; break; + case EOpTensorViewSetClipNV: out.debug << "setTensorViewClipNV"; break; + + default: out.debug.message(EPrefixError, "Bad unary op"); + } + + out.debug << " (" << node->getCompleteString() << ")"; + + out.debug << "\n"; + + return true; +} + +bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node) +{ + TInfoSink& out = infoSink; + + if (node->getOp() == EOpNull) { + out.debug.message(EPrefixError, "node is still EOpNull!"); + return true; + } + + OutputTreeText(out, node, depth); + + switch (node->getOp()) { + case EOpSequence: out.debug << "Sequence\n"; return true; + case EOpScope: out.debug << "Scope\n"; return true; + case EOpLinkerObjects: out.debug << "Linker Objects\n"; return true; + case EOpComma: out.debug << "Comma"; break; + case EOpFunction: out.debug << "Function Definition: " << node->getName(); break; + case EOpFunctionCall: out.debug << "Function Call: " << node->getName(); break; + case EOpParameters: out.debug << "Function Parameters: "; break; + + case EOpConstructFloat: out.debug << "Construct float"; break; + case EOpConstructDouble:out.debug << "Construct double"; break; + + case EOpConstructVec2: out.debug << "Construct vec2"; break; + case EOpConstructVec3: out.debug << "Construct vec3"; break; + case EOpConstructVec4: out.debug << "Construct vec4"; break; + case EOpConstructDVec2: out.debug << "Construct dvec2"; break; + case EOpConstructDVec3: out.debug << "Construct dvec3"; break; + case EOpConstructDVec4: out.debug << "Construct dvec4"; break; + case EOpConstructBool: out.debug << "Construct bool"; break; + case EOpConstructBVec2: out.debug << "Construct bvec2"; break; + case EOpConstructBVec3: out.debug << "Construct bvec3"; break; + case EOpConstructBVec4: out.debug << "Construct bvec4"; break; + case EOpConstructInt8: out.debug << "Construct int8_t"; break; + case EOpConstructI8Vec2: out.debug << "Construct i8vec2"; break; + case EOpConstructI8Vec3: out.debug << "Construct i8vec3"; break; + case EOpConstructI8Vec4: out.debug << "Construct i8vec4"; break; + case EOpConstructInt: out.debug << "Construct int"; break; + case EOpConstructIVec2: out.debug << "Construct ivec2"; break; + case EOpConstructIVec3: out.debug << "Construct ivec3"; break; + case EOpConstructIVec4: out.debug << "Construct ivec4"; break; + case EOpConstructUint8: out.debug << "Construct uint8_t"; break; + case EOpConstructU8Vec2: out.debug << "Construct u8vec2"; break; + case EOpConstructU8Vec3: out.debug << "Construct u8vec3"; break; + case EOpConstructU8Vec4: out.debug << "Construct u8vec4"; break; + case EOpConstructUint: out.debug << "Construct uint"; break; + case EOpConstructUVec2: out.debug << "Construct uvec2"; break; + case EOpConstructUVec3: out.debug << "Construct uvec3"; break; + case EOpConstructUVec4: out.debug << "Construct uvec4"; break; + case EOpConstructInt64: out.debug << "Construct int64"; break; + case EOpConstructI64Vec2: out.debug << "Construct i64vec2"; break; + case EOpConstructI64Vec3: out.debug << "Construct i64vec3"; break; + case EOpConstructI64Vec4: out.debug << "Construct i64vec4"; break; + case EOpConstructUint64: out.debug << "Construct uint64"; break; + case EOpConstructU64Vec2: out.debug << "Construct u64vec2"; break; + case EOpConstructU64Vec3: out.debug << "Construct u64vec3"; break; + case EOpConstructU64Vec4: out.debug << "Construct u64vec4"; break; + case EOpConstructInt16: out.debug << "Construct int16_t"; break; + case EOpConstructI16Vec2: out.debug << "Construct i16vec2"; break; + case EOpConstructI16Vec3: out.debug << "Construct i16vec3"; break; + case EOpConstructI16Vec4: out.debug << "Construct i16vec4"; break; + case EOpConstructUint16: out.debug << "Construct uint16_t"; break; + case EOpConstructU16Vec2: out.debug << "Construct u16vec2"; break; + case EOpConstructU16Vec3: out.debug << "Construct u16vec3"; break; + case EOpConstructU16Vec4: out.debug << "Construct u16vec4"; break; + case EOpConstructMat2x2: out.debug << "Construct mat2"; break; + case EOpConstructMat2x3: out.debug << "Construct mat2x3"; break; + case EOpConstructMat2x4: out.debug << "Construct mat2x4"; break; + case EOpConstructMat3x2: out.debug << "Construct mat3x2"; break; + case EOpConstructMat3x3: out.debug << "Construct mat3"; break; + case EOpConstructMat3x4: out.debug << "Construct mat3x4"; break; + case EOpConstructMat4x2: out.debug << "Construct mat4x2"; break; + case EOpConstructMat4x3: out.debug << "Construct mat4x3"; break; + case EOpConstructMat4x4: out.debug << "Construct mat4"; break; + case EOpConstructDMat2x2: out.debug << "Construct dmat2"; break; + case EOpConstructDMat2x3: out.debug << "Construct dmat2x3"; break; + case EOpConstructDMat2x4: out.debug << "Construct dmat2x4"; break; + case EOpConstructDMat3x2: out.debug << "Construct dmat3x2"; break; + case EOpConstructDMat3x3: out.debug << "Construct dmat3"; break; + case EOpConstructDMat3x4: out.debug << "Construct dmat3x4"; break; + case EOpConstructDMat4x2: out.debug << "Construct dmat4x2"; break; + case EOpConstructDMat4x3: out.debug << "Construct dmat4x3"; break; + case EOpConstructDMat4x4: out.debug << "Construct dmat4"; break; + case EOpConstructIMat2x2: out.debug << "Construct imat2"; break; + case EOpConstructIMat2x3: out.debug << "Construct imat2x3"; break; + case EOpConstructIMat2x4: out.debug << "Construct imat2x4"; break; + case EOpConstructIMat3x2: out.debug << "Construct imat3x2"; break; + case EOpConstructIMat3x3: out.debug << "Construct imat3"; break; + case EOpConstructIMat3x4: out.debug << "Construct imat3x4"; break; + case EOpConstructIMat4x2: out.debug << "Construct imat4x2"; break; + case EOpConstructIMat4x3: out.debug << "Construct imat4x3"; break; + case EOpConstructIMat4x4: out.debug << "Construct imat4"; break; + case EOpConstructUMat2x2: out.debug << "Construct umat2"; break; + case EOpConstructUMat2x3: out.debug << "Construct umat2x3"; break; + case EOpConstructUMat2x4: out.debug << "Construct umat2x4"; break; + case EOpConstructUMat3x2: out.debug << "Construct umat3x2"; break; + case EOpConstructUMat3x3: out.debug << "Construct umat3"; break; + case EOpConstructUMat3x4: out.debug << "Construct umat3x4"; break; + case EOpConstructUMat4x2: out.debug << "Construct umat4x2"; break; + case EOpConstructUMat4x3: out.debug << "Construct umat4x3"; break; + case EOpConstructUMat4x4: out.debug << "Construct umat4"; break; + case EOpConstructBMat2x2: out.debug << "Construct bmat2"; break; + case EOpConstructBMat2x3: out.debug << "Construct bmat2x3"; break; + case EOpConstructBMat2x4: out.debug << "Construct bmat2x4"; break; + case EOpConstructBMat3x2: out.debug << "Construct bmat3x2"; break; + case EOpConstructBMat3x3: out.debug << "Construct bmat3"; break; + case EOpConstructBMat3x4: out.debug << "Construct bmat3x4"; break; + case EOpConstructBMat4x2: out.debug << "Construct bmat4x2"; break; + case EOpConstructBMat4x3: out.debug << "Construct bmat4x3"; break; + case EOpConstructBMat4x4: out.debug << "Construct bmat4"; break; + case EOpConstructBFloat16: out.debug << "Construct bfloat16_t"; break; + case EOpConstructBF16Vec2: out.debug << "Construct bf16vec2"; break; + case EOpConstructBF16Vec3: out.debug << "Construct bf16vec3"; break; + case EOpConstructBF16Vec4: out.debug << "Construct bf16vec4"; break; + case EOpConstructFloatE5M2: out.debug << "Construct floate5m2_t"; break; + case EOpConstructFloatE5M2Vec2: out.debug << "Construct fe5m2vec2"; break; + case EOpConstructFloatE5M2Vec3: out.debug << "Construct fe5m2vec3"; break; + case EOpConstructFloatE5M2Vec4: out.debug << "Construct fe5m2vec4"; break; + case EOpConstructFloatE4M3: out.debug << "Construct floate4m3_t"; break; + case EOpConstructFloatE4M3Vec2: out.debug << "Construct fe4m3vec2"; break; + case EOpConstructFloatE4M3Vec3: out.debug << "Construct fe4m3vec3"; break; + case EOpConstructFloatE4M3Vec4: out.debug << "Construct fe4m3vec4"; break; + case EOpConstructFloat16: out.debug << "Construct float16_t"; break; + case EOpConstructF16Vec2: out.debug << "Construct f16vec2"; break; + case EOpConstructF16Vec3: out.debug << "Construct f16vec3"; break; + case EOpConstructF16Vec4: out.debug << "Construct f16vec4"; break; + case EOpConstructF16Mat2x2: out.debug << "Construct f16mat2"; break; + case EOpConstructF16Mat2x3: out.debug << "Construct f16mat2x3"; break; + case EOpConstructF16Mat2x4: out.debug << "Construct f16mat2x4"; break; + case EOpConstructF16Mat3x2: out.debug << "Construct f16mat3x2"; break; + case EOpConstructF16Mat3x3: out.debug << "Construct f16mat3"; break; + case EOpConstructF16Mat3x4: out.debug << "Construct f16mat3x4"; break; + case EOpConstructF16Mat4x2: out.debug << "Construct f16mat4x2"; break; + case EOpConstructF16Mat4x3: out.debug << "Construct f16mat4x3"; break; + case EOpConstructF16Mat4x4: out.debug << "Construct f16mat4"; break; + case EOpConstructStruct: out.debug << "Construct structure"; break; + case EOpConstructTextureSampler: out.debug << "Construct combined texture-sampler"; break; + case EOpConstructReference: out.debug << "Construct reference"; break; + case EOpConstructCooperativeMatrixNV: out.debug << "Construct cooperative matrix NV"; break; + case EOpConstructCooperativeMatrixKHR: out.debug << "Construct cooperative matrix KHR"; break; + case EOpConstructCooperativeVectorNV: out.debug << "Construct cooperative vector NV"; break; + case EOpConstructAccStruct: out.debug << "Construct acceleration structure"; break; + + case EOpBitCastArrayQCOM: out.debug << "Bitcast To Array QCOM"; break; + case EOpExtractSubArrayQCOM: out.debug << "Extract Subarray QCOM"; break; + case EOpCompositeConstructCoopMatQCOM: out.debug << "Construct Cooperative Matrix QCOM"; break; + case EOpCompositeExtractCoopMatQCOM: out.debug << "Extract Cooperative Matrix QCOM"; break; + + case EOpLessThan: out.debug << "Compare Less Than"; break; + case EOpGreaterThan: out.debug << "Compare Greater Than"; break; + case EOpLessThanEqual: out.debug << "Compare Less Than or Equal"; break; + case EOpGreaterThanEqual: out.debug << "Compare Greater Than or Equal"; break; + case EOpVectorEqual: out.debug << "Equal"; break; + case EOpVectorNotEqual: out.debug << "NotEqual"; break; + + case EOpMod: out.debug << "mod"; break; + case EOpModf: out.debug << "modf"; break; + case EOpPow: out.debug << "pow"; break; + + case EOpAtan: out.debug << "arc tangent"; break; + + case EOpMin: out.debug << "min"; break; + case EOpMax: out.debug << "max"; break; + case EOpClamp: out.debug << "clamp"; break; + case EOpMix: out.debug << "mix"; break; + case EOpStep: out.debug << "step"; break; + case EOpSmoothStep: out.debug << "smoothstep"; break; + + case EOpDistance: out.debug << "distance"; break; + case EOpDot: out.debug << "dot-product"; break; + case EOpDotPackedEXT: out.debug << "dot-product-packed";break; + case EOpDotAccSatEXT: out.debug << "dot-product-accumulate-saturate";break; + case EOpDotPackedAccSatEXT: out.debug << "dot-product-packed-accumulate-saturate";break; + case EOpCross: out.debug << "cross-product"; break; + case EOpFaceForward: out.debug << "face-forward"; break; + case EOpReflect: out.debug << "reflect"; break; + case EOpRefract: out.debug << "refract"; break; + case EOpMul: out.debug << "component-wise multiply"; break; + case EOpOuterProduct: out.debug << "outer product"; break; + + case EOpEmitVertex: out.debug << "EmitVertex"; break; + case EOpEndPrimitive: out.debug << "EndPrimitive"; break; + + case EOpBarrier: out.debug << "Barrier"; break; + case EOpMemoryBarrier: out.debug << "MemoryBarrier"; break; + case EOpMemoryBarrierAtomicCounter: out.debug << "MemoryBarrierAtomicCounter"; break; + case EOpMemoryBarrierBuffer: out.debug << "MemoryBarrierBuffer"; break; + case EOpMemoryBarrierImage: out.debug << "MemoryBarrierImage"; break; + case EOpMemoryBarrierShared: out.debug << "MemoryBarrierShared"; break; + case EOpGroupMemoryBarrier: out.debug << "GroupMemoryBarrier"; break; + + case EOpReadInvocation: out.debug << "readInvocation"; break; + + case EOpSwizzleInvocations: out.debug << "swizzleInvocations"; break; + case EOpSwizzleInvocationsMasked: out.debug << "swizzleInvocationsMasked"; break; + case EOpWriteInvocation: out.debug << "writeInvocation"; break; + + case EOpMin3: out.debug << "min3"; break; + case EOpMax3: out.debug << "max3"; break; + case EOpMid3: out.debug << "mid3"; break; + case EOpTime: out.debug << "time"; break; + + case EOpAtomicAdd: out.debug << "AtomicAdd"; break; + case EOpAtomicSubtract: out.debug << "AtomicSubtract"; break; + case EOpAtomicMin: out.debug << "AtomicMin"; break; + case EOpAtomicMax: out.debug << "AtomicMax"; break; + case EOpAtomicAnd: out.debug << "AtomicAnd"; break; + case EOpAtomicOr: out.debug << "AtomicOr"; break; + case EOpAtomicXor: out.debug << "AtomicXor"; break; + case EOpAtomicExchange: out.debug << "AtomicExchange"; break; + case EOpAtomicCompSwap: out.debug << "AtomicCompSwap"; break; + case EOpAtomicLoad: out.debug << "AtomicLoad"; break; + case EOpAtomicStore: out.debug << "AtomicStore"; break; + + case EOpAtomicCounterAdd: out.debug << "AtomicCounterAdd"; break; + case EOpAtomicCounterSubtract: out.debug << "AtomicCounterSubtract"; break; + case EOpAtomicCounterMin: out.debug << "AtomicCounterMin"; break; + case EOpAtomicCounterMax: out.debug << "AtomicCounterMax"; break; + case EOpAtomicCounterAnd: out.debug << "AtomicCounterAnd"; break; + case EOpAtomicCounterOr: out.debug << "AtomicCounterOr"; break; + case EOpAtomicCounterXor: out.debug << "AtomicCounterXor"; break; + case EOpAtomicCounterExchange: out.debug << "AtomicCounterExchange"; break; + case EOpAtomicCounterCompSwap: out.debug << "AtomicCounterCompSwap"; break; + + case EOpImageQuerySize: out.debug << "imageQuerySize"; break; + case EOpImageQuerySamples: out.debug << "imageQuerySamples"; break; + case EOpImageLoad: out.debug << "imageLoad"; break; + case EOpImageStore: out.debug << "imageStore"; break; + case EOpImageAtomicAdd: out.debug << "imageAtomicAdd"; break; + case EOpImageAtomicMin: out.debug << "imageAtomicMin"; break; + case EOpImageAtomicMax: out.debug << "imageAtomicMax"; break; + case EOpImageAtomicAnd: out.debug << "imageAtomicAnd"; break; + case EOpImageAtomicOr: out.debug << "imageAtomicOr"; break; + case EOpImageAtomicXor: out.debug << "imageAtomicXor"; break; + case EOpImageAtomicExchange: out.debug << "imageAtomicExchange"; break; + case EOpImageAtomicCompSwap: out.debug << "imageAtomicCompSwap"; break; + case EOpImageAtomicLoad: out.debug << "imageAtomicLoad"; break; + case EOpImageAtomicStore: out.debug << "imageAtomicStore"; break; + case EOpImageLoadLod: out.debug << "imageLoadLod"; break; + case EOpImageStoreLod: out.debug << "imageStoreLod"; break; + + case EOpTextureQuerySize: out.debug << "textureSize"; break; + case EOpTextureQueryLod: out.debug << "textureQueryLod"; break; + case EOpTextureQueryLevels: out.debug << "textureQueryLevels"; break; + case EOpTextureQuerySamples: out.debug << "textureSamples"; break; + case EOpTexture: out.debug << "texture"; break; + case EOpTextureProj: out.debug << "textureProj"; break; + case EOpTextureLod: out.debug << "textureLod"; break; + case EOpTextureOffset: out.debug << "textureOffset"; break; + case EOpTextureFetch: out.debug << "textureFetch"; break; + case EOpTextureFetchOffset: out.debug << "textureFetchOffset"; break; + case EOpTextureProjOffset: out.debug << "textureProjOffset"; break; + case EOpTextureLodOffset: out.debug << "textureLodOffset"; break; + case EOpTextureProjLod: out.debug << "textureProjLod"; break; + case EOpTextureProjLodOffset: out.debug << "textureProjLodOffset"; break; + case EOpTextureGrad: out.debug << "textureGrad"; break; + case EOpTextureGradOffset: out.debug << "textureGradOffset"; break; + case EOpTextureProjGrad: out.debug << "textureProjGrad"; break; + case EOpTextureProjGradOffset: out.debug << "textureProjGradOffset"; break; + case EOpTextureGather: out.debug << "textureGather"; break; + case EOpTextureGatherOffset: out.debug << "textureGatherOffset"; break; + case EOpTextureGatherOffsets: out.debug << "textureGatherOffsets"; break; + case EOpTextureClamp: out.debug << "textureClamp"; break; + case EOpTextureOffsetClamp: out.debug << "textureOffsetClamp"; break; + case EOpTextureGradClamp: out.debug << "textureGradClamp"; break; + case EOpTextureGradOffsetClamp: out.debug << "textureGradOffsetClamp"; break; + case EOpTextureGatherLod: out.debug << "textureGatherLod"; break; + case EOpTextureGatherLodOffset: out.debug << "textureGatherLodOffset"; break; + case EOpTextureGatherLodOffsets: out.debug << "textureGatherLodOffsets"; break; + + case EOpSparseTexture: out.debug << "sparseTexture"; break; + case EOpSparseTextureOffset: out.debug << "sparseTextureOffset"; break; + case EOpSparseTextureLod: out.debug << "sparseTextureLod"; break; + case EOpSparseTextureLodOffset: out.debug << "sparseTextureLodOffset"; break; + case EOpSparseTextureFetch: out.debug << "sparseTexelFetch"; break; + case EOpSparseTextureFetchOffset: out.debug << "sparseTexelFetchOffset"; break; + case EOpSparseTextureGrad: out.debug << "sparseTextureGrad"; break; + case EOpSparseTextureGradOffset: out.debug << "sparseTextureGradOffset"; break; + case EOpSparseTextureGather: out.debug << "sparseTextureGather"; break; + case EOpSparseTextureGatherOffset: out.debug << "sparseTextureGatherOffset"; break; + case EOpSparseTextureGatherOffsets: out.debug << "sparseTextureGatherOffsets"; break; + case EOpSparseImageLoad: out.debug << "sparseImageLoad"; break; + case EOpSparseTextureClamp: out.debug << "sparseTextureClamp"; break; + case EOpSparseTextureOffsetClamp: out.debug << "sparseTextureOffsetClamp"; break; + case EOpSparseTextureGradClamp: out.debug << "sparseTextureGradClamp"; break; + case EOpSparseTextureGradOffsetClamp: out.debug << "sparseTextureGradOffsetClam"; break; + case EOpSparseTextureGatherLod: out.debug << "sparseTextureGatherLod"; break; + case EOpSparseTextureGatherLodOffset: out.debug << "sparseTextureGatherLodOffset"; break; + case EOpSparseTextureGatherLodOffsets: out.debug << "sparseTextureGatherLodOffsets"; break; + case EOpSparseImageLoadLod: out.debug << "sparseImageLoadLod"; break; + case EOpImageSampleFootprintNV: out.debug << "imageSampleFootprintNV"; break; + case EOpImageSampleFootprintClampNV: out.debug << "imageSampleFootprintClampNV"; break; + case EOpImageSampleFootprintLodNV: out.debug << "imageSampleFootprintLodNV"; break; + case EOpImageSampleFootprintGradNV: out.debug << "imageSampleFootprintGradNV"; break; + case EOpImageSampleFootprintGradClampNV: out.debug << "mageSampleFootprintGradClampNV"; break; + case EOpAddCarry: out.debug << "addCarry"; break; + case EOpSubBorrow: out.debug << "subBorrow"; break; + case EOpUMulExtended: out.debug << "uMulExtended"; break; + case EOpIMulExtended: out.debug << "iMulExtended"; break; + case EOpBitfieldExtract: out.debug << "bitfieldExtract"; break; + case EOpBitfieldInsert: out.debug << "bitfieldInsert"; break; + + case EOpFma: out.debug << "fma"; break; + case EOpFrexp: out.debug << "frexp"; break; + case EOpLdexp: out.debug << "ldexp"; break; + + case EOpInterpolateAtSample: out.debug << "interpolateAtSample"; break; + case EOpInterpolateAtOffset: out.debug << "interpolateAtOffset"; break; + case EOpInterpolateAtVertex: out.debug << "interpolateAtVertex"; break; + + case EOpSinCos: out.debug << "sincos"; break; + case EOpGenMul: out.debug << "mul"; break; + + case EOpAllMemoryBarrierWithGroupSync: out.debug << "AllMemoryBarrierWithGroupSync"; break; + case EOpDeviceMemoryBarrier: out.debug << "DeviceMemoryBarrier"; break; + case EOpDeviceMemoryBarrierWithGroupSync: out.debug << "DeviceMemoryBarrierWithGroupSync"; break; + case EOpWorkgroupMemoryBarrier: out.debug << "WorkgroupMemoryBarrier"; break; + case EOpWorkgroupMemoryBarrierWithGroupSync: out.debug << "WorkgroupMemoryBarrierWithGroupSync"; break; + + case EOpSubgroupBarrier: out.debug << "subgroupBarrier"; break; + case EOpSubgroupMemoryBarrier: out.debug << "subgroupMemoryBarrier"; break; + case EOpSubgroupMemoryBarrierBuffer: out.debug << "subgroupMemoryBarrierBuffer"; break; + case EOpSubgroupMemoryBarrierImage: out.debug << "subgroupMemoryBarrierImage"; break; + case EOpSubgroupMemoryBarrierShared: out.debug << "subgroupMemoryBarrierShared"; break; + case EOpSubgroupElect: out.debug << "subgroupElect"; break; + case EOpSubgroupAll: out.debug << "subgroupAll"; break; + case EOpSubgroupAny: out.debug << "subgroupAny"; break; + case EOpSubgroupAllEqual: out.debug << "subgroupAllEqual"; break; + case EOpSubgroupBroadcast: out.debug << "subgroupBroadcast"; break; + case EOpSubgroupBroadcastFirst: out.debug << "subgroupBroadcastFirst"; break; + case EOpSubgroupBallot: out.debug << "subgroupBallot"; break; + case EOpSubgroupInverseBallot: out.debug << "subgroupInverseBallot"; break; + case EOpSubgroupBallotBitExtract: out.debug << "subgroupBallotBitExtract"; break; + case EOpSubgroupBallotBitCount: out.debug << "subgroupBallotBitCount"; break; + case EOpSubgroupBallotInclusiveBitCount: out.debug << "subgroupBallotInclusiveBitCount"; break; + case EOpSubgroupBallotExclusiveBitCount: out.debug << "subgroupBallotExclusiveBitCount"; break; + case EOpSubgroupBallotFindLSB: out.debug << "subgroupBallotFindLSB"; break; + case EOpSubgroupBallotFindMSB: out.debug << "subgroupBallotFindMSB"; break; + case EOpSubgroupShuffle: out.debug << "subgroupShuffle"; break; + case EOpSubgroupShuffleXor: out.debug << "subgroupShuffleXor"; break; + case EOpSubgroupShuffleUp: out.debug << "subgroupShuffleUp"; break; + case EOpSubgroupShuffleDown: out.debug << "subgroupShuffleDown"; break; + case EOpSubgroupRotate: out.debug << "subgroupRotate"; break; + case EOpSubgroupClusteredRotate: out.debug << "subgroupClusteredRotate"; break; + case EOpSubgroupAdd: out.debug << "subgroupAdd"; break; + case EOpSubgroupMul: out.debug << "subgroupMul"; break; + case EOpSubgroupMin: out.debug << "subgroupMin"; break; + case EOpSubgroupMax: out.debug << "subgroupMax"; break; + case EOpSubgroupAnd: out.debug << "subgroupAnd"; break; + case EOpSubgroupOr: out.debug << "subgroupOr"; break; + case EOpSubgroupXor: out.debug << "subgroupXor"; break; + case EOpSubgroupInclusiveAdd: out.debug << "subgroupInclusiveAdd"; break; + case EOpSubgroupInclusiveMul: out.debug << "subgroupInclusiveMul"; break; + case EOpSubgroupInclusiveMin: out.debug << "subgroupInclusiveMin"; break; + case EOpSubgroupInclusiveMax: out.debug << "subgroupInclusiveMax"; break; + case EOpSubgroupInclusiveAnd: out.debug << "subgroupInclusiveAnd"; break; + case EOpSubgroupInclusiveOr: out.debug << "subgroupInclusiveOr"; break; + case EOpSubgroupInclusiveXor: out.debug << "subgroupInclusiveXor"; break; + case EOpSubgroupExclusiveAdd: out.debug << "subgroupExclusiveAdd"; break; + case EOpSubgroupExclusiveMul: out.debug << "subgroupExclusiveMul"; break; + case EOpSubgroupExclusiveMin: out.debug << "subgroupExclusiveMin"; break; + case EOpSubgroupExclusiveMax: out.debug << "subgroupExclusiveMax"; break; + case EOpSubgroupExclusiveAnd: out.debug << "subgroupExclusiveAnd"; break; + case EOpSubgroupExclusiveOr: out.debug << "subgroupExclusiveOr"; break; + case EOpSubgroupExclusiveXor: out.debug << "subgroupExclusiveXor"; break; + case EOpSubgroupClusteredAdd: out.debug << "subgroupClusteredAdd"; break; + case EOpSubgroupClusteredMul: out.debug << "subgroupClusteredMul"; break; + case EOpSubgroupClusteredMin: out.debug << "subgroupClusteredMin"; break; + case EOpSubgroupClusteredMax: out.debug << "subgroupClusteredMax"; break; + case EOpSubgroupClusteredAnd: out.debug << "subgroupClusteredAnd"; break; + case EOpSubgroupClusteredOr: out.debug << "subgroupClusteredOr"; break; + case EOpSubgroupClusteredXor: out.debug << "subgroupClusteredXor"; break; + case EOpSubgroupQuadBroadcast: out.debug << "subgroupQuadBroadcast"; break; + case EOpSubgroupQuadSwapHorizontal: out.debug << "subgroupQuadSwapHorizontal"; break; + case EOpSubgroupQuadSwapVertical: out.debug << "subgroupQuadSwapVertical"; break; + case EOpSubgroupQuadSwapDiagonal: out.debug << "subgroupQuadSwapDiagonal"; break; + case EOpSubgroupQuadAll: out.debug << "subgroupQuadAll"; break; + case EOpSubgroupQuadAny: out.debug << "subgroupQuadAny"; break; + + case EOpSubgroupPartition: out.debug << "subgroupPartitionNV"; break; + case EOpSubgroupPartitionedAdd: out.debug << "subgroupPartitionedAddNV"; break; + case EOpSubgroupPartitionedMul: out.debug << "subgroupPartitionedMulNV"; break; + case EOpSubgroupPartitionedMin: out.debug << "subgroupPartitionedMinNV"; break; + case EOpSubgroupPartitionedMax: out.debug << "subgroupPartitionedMaxNV"; break; + case EOpSubgroupPartitionedAnd: out.debug << "subgroupPartitionedAndNV"; break; + case EOpSubgroupPartitionedOr: out.debug << "subgroupPartitionedOrNV"; break; + case EOpSubgroupPartitionedXor: out.debug << "subgroupPartitionedXorNV"; break; + case EOpSubgroupPartitionedInclusiveAdd: out.debug << "subgroupPartitionedInclusiveAddNV"; break; + case EOpSubgroupPartitionedInclusiveMul: out.debug << "subgroupPartitionedInclusiveMulNV"; break; + case EOpSubgroupPartitionedInclusiveMin: out.debug << "subgroupPartitionedInclusiveMinNV"; break; + case EOpSubgroupPartitionedInclusiveMax: out.debug << "subgroupPartitionedInclusiveMaxNV"; break; + case EOpSubgroupPartitionedInclusiveAnd: out.debug << "subgroupPartitionedInclusiveAndNV"; break; + case EOpSubgroupPartitionedInclusiveOr: out.debug << "subgroupPartitionedInclusiveOrNV"; break; + case EOpSubgroupPartitionedInclusiveXor: out.debug << "subgroupPartitionedInclusiveXorNV"; break; + case EOpSubgroupPartitionedExclusiveAdd: out.debug << "subgroupPartitionedExclusiveAddNV"; break; + case EOpSubgroupPartitionedExclusiveMul: out.debug << "subgroupPartitionedExclusiveMulNV"; break; + case EOpSubgroupPartitionedExclusiveMin: out.debug << "subgroupPartitionedExclusiveMinNV"; break; + case EOpSubgroupPartitionedExclusiveMax: out.debug << "subgroupPartitionedExclusiveMaxNV"; break; + case EOpSubgroupPartitionedExclusiveAnd: out.debug << "subgroupPartitionedExclusiveAndNV"; break; + case EOpSubgroupPartitionedExclusiveOr: out.debug << "subgroupPartitionedExclusiveOrNV"; break; + case EOpSubgroupPartitionedExclusiveXor: out.debug << "subgroupPartitionedExclusiveXorNV"; break; + + case EOpSubpassLoad: out.debug << "subpassLoad"; break; + case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break; + + case EOpColorAttachmentReadEXT: out.debug << "colorAttachmentReadEXT"; break; + + case EOpTraceNV: out.debug << "traceNV"; break; + case EOpTraceRayMotionNV: out.debug << "traceRayMotionNV"; break; + case EOpTraceKHR: out.debug << "traceRayKHR"; break; + case EOpReportIntersection: out.debug << "reportIntersectionNV"; break; + case EOpIgnoreIntersectionNV: out.debug << "ignoreIntersectionNV"; break; + case EOpIgnoreIntersectionKHR: out.debug << "ignoreIntersectionKHR"; break; + case EOpTerminateRayNV: out.debug << "terminateRayNV"; break; + case EOpTerminateRayKHR: out.debug << "terminateRayKHR"; break; + case EOpExecuteCallableNV: out.debug << "executeCallableNV"; break; + case EOpExecuteCallableKHR: out.debug << "executeCallableKHR"; break; + case EOpWritePackedPrimitiveIndices4x8NV: out.debug << "writePackedPrimitiveIndices4x8NV"; break; + case EOpEmitMeshTasksEXT: out.debug << "EmitMeshTasksEXT"; break; + case EOpSetMeshOutputsEXT: out.debug << "SetMeshOutputsEXT"; break; + + case EOpRayQueryInitialize: out.debug << "rayQueryInitializeEXT"; break; + case EOpRayQueryTerminate: out.debug << "rayQueryTerminateEXT"; break; + case EOpRayQueryGenerateIntersection: out.debug << "rayQueryGenerateIntersectionEXT"; break; + case EOpRayQueryConfirmIntersection: out.debug << "rayQueryConfirmIntersectionEXT"; break; + case EOpRayQueryProceed: out.debug << "rayQueryProceedEXT"; break; + case EOpRayQueryGetIntersectionType: out.debug << "rayQueryGetIntersectionTypeEXT"; break; + case EOpRayQueryGetRayTMin: out.debug << "rayQueryGetRayTMinEXT"; break; + case EOpRayQueryGetRayFlags: out.debug << "rayQueryGetRayFlagsEXT"; break; + case EOpRayQueryGetIntersectionT: out.debug << "rayQueryGetIntersectionTEXT"; break; + case EOpRayQueryGetIntersectionInstanceCustomIndex: out.debug << "rayQueryGetIntersectionInstanceCustomIndexEXT"; break; + case EOpRayQueryGetIntersectionInstanceId: out.debug << "rayQueryGetIntersectionInstanceIdEXT"; break; + case EOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffset: out.debug << "rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT"; break; + case EOpRayQueryGetIntersectionGeometryIndex: out.debug << "rayQueryGetIntersectionGeometryIndexEXT"; break; + case EOpRayQueryGetIntersectionPrimitiveIndex: out.debug << "rayQueryGetIntersectionPrimitiveIndexEXT"; break; + case EOpRayQueryGetIntersectionBarycentrics: out.debug << "rayQueryGetIntersectionBarycentricsEXT"; break; + case EOpRayQueryGetIntersectionFrontFace: out.debug << "rayQueryGetIntersectionFrontFaceEXT"; break; + case EOpRayQueryGetIntersectionCandidateAABBOpaque: out.debug << "rayQueryGetIntersectionCandidateAABBOpaqueEXT"; break; + case EOpRayQueryGetIntersectionObjectRayDirection: out.debug << "rayQueryGetIntersectionObjectRayDirectionEXT"; break; + case EOpRayQueryGetIntersectionObjectRayOrigin: out.debug << "rayQueryGetIntersectionObjectRayOriginEXT"; break; + case EOpRayQueryGetWorldRayDirection: out.debug << "rayQueryGetWorldRayDirectionEXT"; break; + case EOpRayQueryGetWorldRayOrigin: out.debug << "rayQueryGetWorldRayOriginEXT"; break; + case EOpRayQueryGetIntersectionObjectToWorld: out.debug << "rayQueryGetIntersectionObjectToWorldEXT"; break; + case EOpRayQueryGetIntersectionWorldToObject: out.debug << "rayQueryGetIntersectionWorldToObjectEXT"; break; + case EOpRayQueryGetIntersectionTriangleVertexPositionsEXT: out.debug << "rayQueryGetIntersectionTriangleVertexPositionsEXT"; break; + case EOpRayQueryGetIntersectionClusterIdNV: out.debug << "rayQueryGetIntersectionClusterIdNV"; break; + case EOpRayQueryGetIntersectionSpherePositionNV: out.debug << "rayQueryGetIntersectionSpherePositionNV"; break; + case EOpRayQueryGetIntersectionSphereRadiusNV: out.debug << "rayQueryGetIntersectionSphereRadiusNV"; break; + case EOpRayQueryGetIntersectionLSSHitValueNV: out.debug << "rayQueryGetIntersectionLSSHitValueNV"; break; + case EOpRayQueryGetIntersectionLSSPositionsNV: out.debug << "rayQueryGetIntersectionLSSPositionsNV"; break; + case EOpRayQueryGetIntersectionLSSRadiiNV: out.debug << "rayQueryGetIntersectionLSSRadiiNV"; break; + case EOpRayQueryIsSphereHitNV: out.debug << "rayQueryIsSphereHitNV"; break; + case EOpRayQueryIsLSSHitNV: out.debug << "rayQueryIsLSSHitNV"; break; + + case EOpCooperativeMatrixLoad: out.debug << "Load cooperative matrix KHR"; break; + case EOpCooperativeMatrixStore: out.debug << "Store cooperative matrix KHR"; break; + case EOpCooperativeMatrixMulAdd: out.debug << "MulAdd cooperative matrices KHR"; break; + case EOpCooperativeMatrixLoadNV: out.debug << "Load cooperative matrix NV"; break; + case EOpCooperativeMatrixStoreNV: out.debug << "Store cooperative matrix NV"; break; + case EOpCooperativeMatrixLoadTensorNV: out.debug << "Load cooperative matrix tensor NV"; break; + case EOpCooperativeMatrixStoreTensorNV: out.debug << "Store cooperative matrix tensor NV"; break; + case EOpCooperativeMatrixMulAddNV: out.debug << "MulAdd cooperative matrices NV"; break; + case EOpCooperativeMatrixReduceNV: out.debug << "Reduce cooperative matrices"; break; + case EOpCooperativeMatrixPerElementOpNV: out.debug << "cooperative matrix per element op"; break; + case EOpCooperativeMatrixTransposeNV: out.debug << "Transpose cooperative matrix"; break; + + case EOpCooperativeVectorMatMulNV: out.debug << "Cooperative vector matrix multiply NV"; break; + case EOpCooperativeVectorMatMulAddNV: out.debug << "Cooperative vector matrix multiply add NV"; break; + case EOpCooperativeVectorLoadNV: out.debug << "Load cooperative vector NV"; break; + case EOpCooperativeVectorStoreNV: out.debug << "Store cooperative vector NV"; break; + case EOpCooperativeVectorOuterProductAccumulateNV: out.debug << "Cooperative vector outer product accumulate NV"; break; + case EOpCooperativeVectorReduceSumAccumulateNV: out.debug << "Cooperative vector reduce sum accumulate NV"; break; + + case EOpTensorReadARM: out.debug << "Read from tensor"; break; + case EOpTensorWriteARM: out.debug << "Write to tensor"; break; + case EOpTensorSizeARM: out.debug << "Get tensor size"; break; + + case EOpIsHelperInvocation: out.debug << "IsHelperInvocation"; break; + case EOpDebugPrintf: out.debug << "Debug printf"; break; + + case EOpHitObjectTraceRayNV: out.debug << "HitObjectTraceRayNV"; break; + case EOpHitObjectTraceRayMotionNV: out.debug << "HitObjectTraceRayMotionNV"; break; + case EOpHitObjectRecordHitNV: out.debug << "HitObjectRecordHitNV"; break; + case EOpHitObjectRecordHitMotionNV: out.debug << "HitObjectRecordHitMotionNV"; break; + case EOpHitObjectRecordHitWithIndexNV: out.debug << "HitObjectRecordHitWithIndexNV"; break; + case EOpHitObjectRecordHitWithIndexMotionNV: out.debug << "HitObjectRecordHitWithIndexMotionNV"; break; + case EOpHitObjectRecordMissNV: out.debug << "HitObjectRecordMissNV"; break; + case EOpHitObjectRecordMissMotionNV: out.debug << "HitObjectRecordMissMotionNV"; break; + case EOpHitObjectRecordEmptyNV: out.debug << "HitObjectRecordEmptyNV"; break; + case EOpHitObjectExecuteShaderNV: out.debug << "HitObjectExecuteShaderNV"; break; + case EOpHitObjectIsEmptyNV: out.debug << "HitObjectIsEmptyNV"; break; + case EOpHitObjectIsMissNV: out.debug << "HitObjectIsMissNV"; break; + case EOpHitObjectIsHitNV: out.debug << "HitObjectIsHitNV"; break; + case EOpHitObjectGetRayTMinNV: out.debug << "HitObjectGetRayTMinNV"; break; + case EOpHitObjectGetRayTMaxNV: out.debug << "HitObjectGetRayTMaxNV"; break; + case EOpHitObjectGetObjectRayOriginNV: out.debug << "HitObjectGetObjectRayOriginNV"; break; + case EOpHitObjectGetObjectRayDirectionNV: out.debug << "HitObjectGetObjectRayDirectionNV"; break; + case EOpHitObjectGetWorldRayOriginNV: out.debug << "HitObjectGetWorldRayOriginNV"; break; + case EOpHitObjectGetWorldRayDirectionNV: out.debug << "HitObjectGetWorldRayDirectionNV"; break; + case EOpHitObjectGetObjectToWorldNV: out.debug << "HitObjectGetObjectToWorldNV"; break; + case EOpHitObjectGetWorldToObjectNV: out.debug << "HitObjectGetWorldToObjectNV"; break; + case EOpHitObjectGetInstanceCustomIndexNV: out.debug<< "HitObjectGetInstanceCustomIndexNV"; break; + case EOpHitObjectGetInstanceIdNV: out.debug << "HitObjectGetInstaneIdNV"; break; + case EOpHitObjectGetGeometryIndexNV: out.debug << "HitObjectGetGeometryIndexNV"; break; + case EOpHitObjectGetPrimitiveIndexNV: out.debug << "HitObjectGetPrimitiveIndexNV"; break; + case EOpHitObjectGetHitKindNV: out.debug << "HitObjectGetHitKindNV"; break; + case EOpHitObjectGetAttributesNV: out.debug << "HitObjectGetAttributesNV"; break; + case EOpHitObjectGetCurrentTimeNV: out.debug << "HitObjectGetCurrentTimeNV"; break; + case EOpHitObjectGetShaderBindingTableRecordIndexNV: out.debug << "HitObjectGetShaderBindingTableRecordIndexNV"; break; + case EOpHitObjectGetShaderRecordBufferHandleNV: out.debug << "HitObjectReadShaderRecordBufferHandleNV"; break; + case EOpHitObjectGetClusterIdNV: out.debug << "HitObjectGetClusterIdNV"; break; + case EOpReorderThreadNV: out.debug << "ReorderThreadNV"; break; + case EOpFetchMicroTriangleVertexPositionNV: out.debug << "MicroTriangleVertexPositionNV"; break; + case EOpFetchMicroTriangleVertexBarycentricNV: out.debug << "MicroTriangleVertexBarycentricNV"; break; + case EOpHitObjectGetSpherePositionNV: out.debug << "HitObjectGetSpherePositionNV"; break; + case EOpHitObjectGetSphereRadiusNV: out.debug << "HitObjectGetSphereRadiusNV"; break; + case EOpHitObjectGetLSSPositionsNV: out.debug << "HitObjectGetLSSPositionsNV"; break; + case EOpHitObjectGetLSSRadiiNV: out.debug << "HitObjectGetLSSRadiiNV"; break; + case EOpHitObjectIsSphereHitNV: out.debug << "HitObjectIsSphereHitNV"; break; + case EOpHitObjectIsLSSHitNV: out.debug << "HitObjectIsLSSHitNV"; break; + + case EOpSpirvInst: out.debug << "spirv_instruction"; break; + case EOpStencilAttachmentReadEXT: out.debug << "stencilAttachmentReadEXT"; break; + case EOpDepthAttachmentReadEXT: out.debug << "depthAttachmentReadEXT"; break; + + case EOpCreateTensorLayoutNV: out.debug << "createTensorLayout"; break; + case EOpTensorLayoutSetBlockSizeNV: out.debug << "setBlockSize"; break; + case EOpTensorLayoutSetDimensionNV: out.debug << "setDimension"; break; + case EOpTensorLayoutSetStrideNV: out.debug << "setStride"; break; + case EOpTensorLayoutSliceNV: out.debug << "slice"; break; + case EOpTensorLayoutSetClampValueNV: out.debug << "setClampValue"; break; + case EOpCreateTensorViewNV: out.debug << "createTensorView"; break; + case EOpTensorViewSetDimensionNV: out.debug << "setTensorViewDimensions"; break; + case EOpTensorViewSetStrideNV: out.debug << "setTensorViewStride"; break; + case EOpTensorViewSetClipNV: out.debug << "clipTensorView"; break; + + default: out.debug.message(EPrefixError, "Bad aggregation op"); + } + + if (node->getOp() != EOpSequence && node->getOp() != EOpScope && node->getOp() != EOpParameters) + out.debug << " (" << node->getCompleteString() << ")"; + + out.debug << "\n"; + + return true; +} + +bool TOutputTraverser::visitSelection(TVisit /* visit */, TIntermSelection* node) +{ + TInfoSink& out = infoSink; + + OutputTreeText(out, node, depth); + + out.debug << "Test condition and select"; + out.debug << " (" << node->getCompleteString() << ")"; + + if (node->getShortCircuit() == false) + out.debug << ": no shortcircuit"; + if (node->getFlatten()) + out.debug << ": Flatten"; + if (node->getDontFlatten()) + out.debug << ": DontFlatten"; + out.debug << "\n"; + + ++depth; + + OutputTreeText(out, node, depth); + out.debug << "Condition\n"; + node->getCondition()->traverse(this); + + OutputTreeText(out, node, depth); + if (node->getTrueBlock()) { + out.debug << "true case\n"; + node->getTrueBlock()->traverse(this); + } else + out.debug << "true case is null\n"; + + if (node->getFalseBlock()) { + OutputTreeText(out, node, depth); + out.debug << "false case\n"; + node->getFalseBlock()->traverse(this); + } + + --depth; + + return false; +} + +// Print infinities and NaNs, and numbers in a portable way. +// Goals: +// - portable (across IEEE 754 platforms) +// - shows all possible IEEE values +// - shows simple numbers in a simple way, e.g., no leading/trailing 0s +// - shows all digits, no premature rounding +static void OutputDouble(TInfoSink& out, double value, TOutputTraverser::EExtraOutput extra) +{ + if (std::isinf(value)) { + if (value < 0) + out.debug << "-1.#INF"; + else + out.debug << "+1.#INF"; + } else if (std::isnan(value)) + out.debug << "1.#IND"; + else { + const int maxSize = 340; + char buf[maxSize]; + const char* format = "%f"; + if (fabs(value) > 0.0 && (fabs(value) < 1e-5 || fabs(value) > 1e12)) + format = "%-.13e"; + int len = snprintf(buf, maxSize, format, value); + assert(len < maxSize); + + // remove a leading zero in the 100s slot in exponent; it is not portable + // pattern: XX...XXXe+0XX or XX...XXXe-0XX + if (len > 5) { + if (buf[len-5] == 'e' && (buf[len-4] == '+' || buf[len-4] == '-') && buf[len-3] == '0') { + buf[len-3] = buf[len-2]; + buf[len-2] = buf[len-1]; + buf[len-1] = '\0'; + } + } + + out.debug << buf; + + switch (extra) { + case TOutputTraverser::BinaryDoubleOutput: + { + uint64_t b; + static_assert(sizeof(b) == sizeof(value), "sizeof(uint64_t) != sizeof(double)"); + memcpy(&b, &value, sizeof(b)); + + out.debug << " : "; + for (size_t i = 0; i < 8 * sizeof(value); ++i, ++b) { + out.debug << ((b & 0x8000000000000000) != 0 ? "1" : "0"); + b <<= 1; + } + break; + } + default: + break; + } + } +} + +static void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const TConstUnionArray& constUnion, + TOutputTraverser::EExtraOutput extra, int depth) +{ + int size = node->getType().computeNumComponents(); + + for (int i = 0; i < size; i++) { + OutputTreeText(out, node, depth); + switch (constUnion[i].getType()) { + case EbtBool: + if (constUnion[i].getBConst()) + out.debug << "true"; + else + out.debug << "false"; + + out.debug << " (" << "const bool" << ")"; + + out.debug << "\n"; + break; + case EbtFloat: + case EbtDouble: + case EbtFloat16: + case EbtBFloat16: + case EbtFloatE5M2: + case EbtFloatE4M3: + OutputDouble(out, constUnion[i].getDConst(), extra); + out.debug << "\n"; + break; + case EbtInt8: + { + const int maxSize = 300; + char buf[maxSize]; + snprintf(buf, maxSize, "%d (%s)", constUnion[i].getI8Const(), "const int8_t"); + + out.debug << buf << "\n"; + } + break; + case EbtUint8: + { + const int maxSize = 300; + char buf[maxSize]; + snprintf(buf, maxSize, "%u (%s)", constUnion[i].getU8Const(), "const uint8_t"); + + out.debug << buf << "\n"; + } + break; + case EbtInt16: + { + const int maxSize = 300; + char buf[maxSize]; + snprintf(buf, maxSize, "%d (%s)", constUnion[i].getI16Const(), "const int16_t"); + + out.debug << buf << "\n"; + } + break; + case EbtUint16: + { + const int maxSize = 300; + char buf[maxSize]; + snprintf(buf, maxSize, "%u (%s)", constUnion[i].getU16Const(), "const uint16_t"); + + out.debug << buf << "\n"; + } + break; + case EbtInt: + { + const int maxSize = 300; + char buf[maxSize]; + snprintf(buf, maxSize, "%d (%s)", constUnion[i].getIConst(), "const int"); + + out.debug << buf << "\n"; + } + break; + case EbtUint: + { + const int maxSize = 300; + char buf[maxSize]; + snprintf(buf, maxSize, "%u (%s)", constUnion[i].getUConst(), "const uint"); + + out.debug << buf << "\n"; + } + break; + case EbtInt64: + { + const int maxSize = 300; + char buf[maxSize]; + snprintf(buf, maxSize, "%lld (%s)", constUnion[i].getI64Const(), "const int64_t"); + + out.debug << buf << "\n"; + } + break; + case EbtUint64: + { + const int maxSize = 300; + char buf[maxSize]; + snprintf(buf, maxSize, "%llu (%s)", constUnion[i].getU64Const(), "const uint64_t"); + + out.debug << buf << "\n"; + } + break; + case EbtString: + out.debug << "\"" << constUnion[i].getSConst()->c_str() << "\"\n"; + break; + default: + out.info.message(EPrefixInternalError, "Unknown constant", node->getLoc()); + break; + } + } +} + +void TOutputTraverser::visitConstantUnion(TIntermConstantUnion* node) +{ + OutputTreeText(infoSink, node, depth); + infoSink.debug << "Constant:\n"; + + OutputConstantUnion(infoSink, node, node->getConstArray(), extraOutput, depth + 1); +} + +void TOutputTraverser::visitSymbol(TIntermSymbol* node) +{ + OutputTreeText(infoSink, node, depth); + + infoSink.debug << "'" << node->getName() << "' (" << node->getCompleteString() << ")\n"; + + if (! node->getConstArray().empty()) + OutputConstantUnion(infoSink, node, node->getConstArray(), extraOutput, depth + 1); + else if (node->getConstSubtree()) { + incrementDepth(node); + node->getConstSubtree()->traverse(this); + decrementDepth(); + } +} + +bool TOutputTraverser::visitLoop(TVisit /* visit */, TIntermLoop* node) +{ + TInfoSink& out = infoSink; + + OutputTreeText(out, node, depth); + + out.debug << "Loop with condition "; + if (! node->testFirst()) + out.debug << "not "; + out.debug << "tested first"; + + if (node->getUnroll()) + out.debug << ": Unroll"; + if (node->getDontUnroll()) + out.debug << ": DontUnroll"; + if (node->getLoopDependency()) { + out.debug << ": Dependency "; + out.debug << node->getLoopDependency(); + } + out.debug << "\n"; + + ++depth; + + OutputTreeText(infoSink, node, depth); + if (node->getTest()) { + out.debug << "Loop Condition\n"; + node->getTest()->traverse(this); + } else + out.debug << "No loop condition\n"; + + OutputTreeText(infoSink, node, depth); + if (node->getBody()) { + out.debug << "Loop Body\n"; + node->getBody()->traverse(this); + } else + out.debug << "No loop body\n"; + + if (node->getTerminal()) { + OutputTreeText(infoSink, node, depth); + out.debug << "Loop Terminal Expression\n"; + node->getTerminal()->traverse(this); + } + + --depth; + + return false; +} + +bool TOutputTraverser::visitBranch(TVisit /* visit*/, TIntermBranch* node) +{ + TInfoSink& out = infoSink; + + OutputTreeText(out, node, depth); + + switch (node->getFlowOp()) { + case EOpKill: out.debug << "Branch: Kill"; break; + case EOpTerminateInvocation: out.debug << "Branch: TerminateInvocation"; break; + case EOpIgnoreIntersectionKHR: out.debug << "Branch: IgnoreIntersectionKHR"; break; + case EOpTerminateRayKHR: out.debug << "Branch: TerminateRayKHR"; break; + case EOpBreak: out.debug << "Branch: Break"; break; + case EOpContinue: out.debug << "Branch: Continue"; break; + case EOpReturn: out.debug << "Branch: Return"; break; + case EOpCase: out.debug << "case: "; break; + case EOpDemote: out.debug << "Demote"; break; + case EOpDefault: out.debug << "default: "; break; + default: out.debug << "Branch: Unknown Branch"; break; + } + + if (node->getExpression()) { + out.debug << " with expression\n"; + ++depth; + node->getExpression()->traverse(this); + --depth; + } else + out.debug << "\n"; + + return false; +} + +bool TOutputTraverser::visitSwitch(TVisit /* visit */, TIntermSwitch* node) +{ + TInfoSink& out = infoSink; + + OutputTreeText(out, node, depth); + out.debug << "switch"; + + if (node->getFlatten()) + out.debug << ": Flatten"; + if (node->getDontFlatten()) + out.debug << ": DontFlatten"; + out.debug << "\n"; + + OutputTreeText(out, node, depth); + out.debug << "condition\n"; + ++depth; + node->getCondition()->traverse(this); + + --depth; + OutputTreeText(out, node, depth); + out.debug << "body\n"; + ++depth; + node->getBody()->traverse(this); + + --depth; + + return false; +} + +bool TOutputTraverser::visitVariableDecl(TVisit /* visit */, TIntermVariableDecl* node) +{ + TInfoSink& out = infoSink; + + OutputTreeText(out, node, depth); + + out.debug << "VarDecl: " << node->getDeclSymbol()->getName() << '\n'; + return true; +} + +// +// This function is the one to call externally to start the traversal. +// Individual functions can be initialized to 0 to skip processing of that +// type of node. It's children will still be processed. +// +void TIntermediate::output(TInfoSink& infoSink, bool tree) +{ + infoSink.debug << "Shader version: " << version << "\n"; + if (requestedExtensions.size() > 0) { + for (auto extIt = requestedExtensions.begin(); extIt != requestedExtensions.end(); ++extIt) + infoSink.debug << "Requested " << *extIt << "\n"; + } + + if (xfbMode) + infoSink.debug << "in xfb mode\n"; + + if (getSubgroupUniformControlFlow()) + infoSink.debug << "subgroup_uniform_control_flow\n"; + + if (getMaximallyReconverges()) + infoSink.debug << "maximally_reconverges\n"; + + switch (language) { + case EShLangVertex: + break; + + case EShLangTessControl: + infoSink.debug << "vertices = " << vertices << "\n"; + + if (inputPrimitive != ElgNone) + infoSink.debug << "input primitive = " << TQualifier::getGeometryString(inputPrimitive) << "\n"; + if (vertexSpacing != EvsNone) + infoSink.debug << "vertex spacing = " << TQualifier::getVertexSpacingString(vertexSpacing) << "\n"; + if (vertexOrder != EvoNone) + infoSink.debug << "triangle order = " << TQualifier::getVertexOrderString(vertexOrder) << "\n"; + break; + + case EShLangTessEvaluation: + infoSink.debug << "input primitive = " << TQualifier::getGeometryString(inputPrimitive) << "\n"; + infoSink.debug << "vertex spacing = " << TQualifier::getVertexSpacingString(vertexSpacing) << "\n"; + infoSink.debug << "triangle order = " << TQualifier::getVertexOrderString(vertexOrder) << "\n"; + if (pointMode) + infoSink.debug << "using point mode\n"; + break; + + case EShLangGeometry: + infoSink.debug << "invocations = " << invocations << "\n"; + infoSink.debug << "max_vertices = " << vertices << "\n"; + infoSink.debug << "input primitive = " << TQualifier::getGeometryString(inputPrimitive) << "\n"; + infoSink.debug << "output primitive = " << TQualifier::getGeometryString(outputPrimitive) << "\n"; + break; + + case EShLangFragment: + if (pixelCenterInteger) + infoSink.debug << "gl_FragCoord pixel center is integer\n"; + if (originUpperLeft) + infoSink.debug << "gl_FragCoord origin is upper left\n"; + if (earlyFragmentTests) + infoSink.debug << "using early_fragment_tests\n"; + if (postDepthCoverage) + infoSink.debug << "using post_depth_coverage\n"; + if (nonCoherentColorAttachmentReadEXT) + infoSink.debug << "using non_coherent_color_attachment_readEXT\n"; + if (nonCoherentDepthAttachmentReadEXT) + infoSink.debug << "using non_coherent_depth_attachment_readEXT\n"; + if (nonCoherentStencilAttachmentReadEXT) + infoSink.debug << "using non_coherent_stencil_attachment_readEXT\n"; + if (nonCoherentTileAttachmentReadQCOM) + infoSink.debug << "using non_coherent_attachment_readQCOM\n"; + if (depthLayout != EldNone) + infoSink.debug << "using " << TQualifier::getLayoutDepthString(depthLayout) << "\n"; + if (blendEquations != 0) { + infoSink.debug << "using"; + // blendEquations is a mask, decode it + for (TBlendEquationShift be = (TBlendEquationShift)0; be < EBlendCount; be = (TBlendEquationShift)(be + 1)) { + if (blendEquations & (1 << be)) + infoSink.debug << " " << TQualifier::getBlendEquationString(be); + } + infoSink.debug << "\n"; + } + if (interlockOrdering != EioNone) + infoSink.debug << "interlock ordering = " << TQualifier::getInterlockOrderingString(interlockOrdering) << "\n"; + break; + + case EShLangMesh: + infoSink.debug << "max_vertices = " << vertices << "\n"; + infoSink.debug << "max_primitives = " << primitives << "\n"; + infoSink.debug << "output primitive = " << TQualifier::getGeometryString(outputPrimitive) << "\n"; + [[fallthrough]]; + case EShLangTask: + // Fall through + case EShLangCompute: + infoSink.debug << "local_size = (" << localSize[0] << ", " << localSize[1] << ", " << localSize[2] << ")\n"; + { + if (localSizeSpecId[0] != TQualifier::layoutNotSet || + localSizeSpecId[1] != TQualifier::layoutNotSet || + localSizeSpecId[2] != TQualifier::layoutNotSet) { + infoSink.debug << "local_size ids = (" << + localSizeSpecId[0] << ", " << + localSizeSpecId[1] << ", " << + localSizeSpecId[2] << ")\n"; + } + } + if (nonCoherentTileAttachmentReadQCOM) + infoSink.debug << "using non_coherent_attachment_readQCOM\n"; + if (isTileShadingRateQCOMSet()) { + infoSink.debug << "shading_rateQCOM = (" << tileShadingRateQCOM[0] << ", " + << tileShadingRateQCOM[1] << ", " + << tileShadingRateQCOM[2] << ")\n"; + } + break; + + default: + break; + } + + if (treeRoot == nullptr || ! tree) + return; + + TOutputTraverser it(infoSink); + if (getBinaryDoubleOutput()) + it.setDoubleOutput(TOutputTraverser::BinaryDoubleOutput); + treeRoot->traverse(&it); +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp new file mode 100644 index 0000000000..add3d1a9d3 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp @@ -0,0 +1,1878 @@ +// +// Copyright (C) 2016-2017 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "../Include/Common.h" +#include "../Include/InfoSink.h" +#include "../Include/Types.h" + +#include "gl_types.h" +#include "iomapper.h" +#include "LiveTraverser.h" +#include "SymbolTable.h" + +// +// Map IO bindings. +// +// High-level algorithm for one stage: +// +// 1. Traverse all code (live+dead) to find the explicitly provided bindings. +// +// 2. Traverse (just) the live code to determine which non-provided bindings +// require auto-numbering. We do not auto-number dead ones. +// +// 3. Traverse all the code to apply the bindings: +// a. explicitly given bindings are offset according to their type +// b. implicit live bindings are auto-numbered into the holes, using +// any open binding slot. +// c. implicit dead bindings are left un-bound. +// + +namespace QtShaderTools { +namespace glslang { + +struct TVarEntryInfo { + long long id; + TIntermSymbol* symbol; + bool live; + TLayoutPacking upgradedToPushConstantPacking; // ElpNone means it hasn't been upgraded + int newBinding; + int newSet; + int newLocation; + int newComponent; + int newIndex; + EShLanguage stage; + + void clearNewAssignments() { + upgradedToPushConstantPacking = ElpNone; + newBinding = -1; + newSet = -1; + newLocation = -1; + newComponent = -1; + newIndex = -1; + } + + struct TOrderById { + inline bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r) { return l.id < r.id; } + }; + + struct TOrderByPriority { + // ordering: + // 1) has both binding and set + // 2) has binding but no set + // 3) has no binding but set + // 4) has no binding and no set + inline bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r) { + const TQualifier& lq = l.symbol->getQualifier(); + const TQualifier& rq = r.symbol->getQualifier(); + + // simple rules: + // has binding gives 2 points + // has set gives 1 point + // who has the most points is more important. + int lPoints = (lq.hasBinding() ? 2 : 0) + (lq.hasSet() ? 1 : 0); + int rPoints = (rq.hasBinding() ? 2 : 0) + (rq.hasSet() ? 1 : 0); + + if (lPoints == rPoints) + return l.id < r.id; + return lPoints > rPoints; + } + }; + + struct TOrderByPriorityAndLive { + // ordering: + // 1) do live variables first + // 2) has both binding and set + // 3) has binding but no set + // 4) has no binding but set + // 5) has no binding and no set + inline bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r) { + + const TQualifier& lq = l.symbol->getQualifier(); + const TQualifier& rq = r.symbol->getQualifier(); + + // simple rules: + // has binding gives 2 points + // has set gives 1 point + // who has the most points is more important. + int lPoints = (lq.hasBinding() ? 2 : 0) + (lq.hasSet() ? 1 : 0); + int rPoints = (rq.hasBinding() ? 2 : 0) + (rq.hasSet() ? 1 : 0); + + if (l.live != r.live) + return l.live > r.live; + + if (lPoints != rPoints) + return lPoints > rPoints; + + return l.id < r.id; + } + }; +}; + +// override function "operator=", if a vector being sort, +// when use vc++, the sort function will call : +// pair& operator=(const pair<_Other1, _Other2>& _Right) +// { +// first = _Right.first; +// second = _Right.second; +// return (*this); +// } +// that will make a const type handing on left. +// override this function can avoid a compiler error. +// In the future, if the vc++ compiler can handle such a situation, +// this part of the code will be removed. +struct TVarLivePair : std::pair { + TVarLivePair(const std::pair& _Right) : pair(_Right.first, _Right.second) {} + TVarLivePair& operator=(const TVarLivePair& _Right) { + const_cast(first) = _Right.first; + second = _Right.second; + return (*this); + } + TVarLivePair(const TVarLivePair& src) : pair(src) { } +}; +typedef std::vector TVarLiveVector; + + +class TVarGatherTraverser : public TLiveTraverser { +public: + TVarGatherTraverser(const TIntermediate& i, bool traverseDeadCode, TVarLiveMap& inList, TVarLiveMap& outList, TVarLiveMap& uniformList) + : TLiveTraverser(i, traverseDeadCode, true, true, false, false) + , inputList(inList) + , outputList(outList) + , uniformList(uniformList) + { + } + + virtual void visitSymbol(TIntermSymbol* base) + { + TVarLiveMap* target = nullptr; + if (base->getQualifier().storage == EvqVaryingIn) + target = &inputList; + else if (base->getQualifier().storage == EvqVaryingOut) + target = &outputList; + else if (base->getQualifier().isUniformOrBuffer() && !base->getQualifier().isPushConstant() && !base->getQualifier().isShaderRecord()) + target = &uniformList; + // If a global is being visited, then we should also traverse it incase it's evaluation + // ends up visiting inputs we want to tag as live + else if (base->getQualifier().storage == EvqGlobal) + addGlobalReference(base->getAccessName()); + + if (target) { + TVarEntryInfo ent = {base->getId(), base, ! traverseAll, {}, {}, {}, {}, {}, {}, {}}; + ent.stage = intermediate.getStage(); + TVarLiveMap::iterator at = target->find( + ent.symbol->getAccessName()); // std::lower_bound(target->begin(), target->end(), ent, TVarEntryInfo::TOrderById()); + if (at != target->end() && at->second.id == ent.id) + at->second.live = at->second.live || ! traverseAll; // update live state + else + (*target)[ent.symbol->getAccessName()] = ent; + } + } + +private: + TVarLiveMap& inputList; + TVarLiveMap& outputList; + TVarLiveMap& uniformList; +}; + +class TVarSetTraverser : public TLiveTraverser +{ +public: + TVarSetTraverser(const TIntermediate& i, const TVarLiveMap& inList, const TVarLiveMap& outList, const TVarLiveMap& uniformList) + : TLiveTraverser(i, true, true, true, false, true) + , inputList(inList) + , outputList(outList) + , uniformList(uniformList) + { + } + + virtual void visitSymbol(TIntermSymbol* base) { + const TVarLiveMap* source; + if (base->getQualifier().storage == EvqVaryingIn) + source = &inputList; + else if (base->getQualifier().storage == EvqVaryingOut) + source = &outputList; + else if (base->getQualifier().isUniformOrBuffer()) + source = &uniformList; + else + return; + + TVarEntryInfo ent = { base->getId(), {}, {}, {}, {}, {}, {}, {}, {}, {} }; + // Fix a defect, when block has no instance name, we need to find its block name + TVarLiveMap::const_iterator at = source->find(base->getAccessName()); + if (at == source->end()) + return; + + if (at->second.id != ent.id) + return; + + if (at->second.newBinding != -1) + base->getWritableType().getQualifier().layoutBinding = at->second.newBinding; + if (at->second.newSet != -1) + base->getWritableType().getQualifier().layoutSet = at->second.newSet; + if (at->second.newLocation != -1) + base->getWritableType().getQualifier().layoutLocation = at->second.newLocation; + if (at->second.newComponent != -1) + base->getWritableType().getQualifier().layoutComponent = at->second.newComponent; + if (at->second.newIndex != -1) + base->getWritableType().getQualifier().layoutIndex = at->second.newIndex; + if (at->second.upgradedToPushConstantPacking != ElpNone) { + base->getWritableType().getQualifier().layoutPushConstant = true; + base->getWritableType().getQualifier().setBlockStorage(EbsPushConstant); + base->getWritableType().getQualifier().layoutPacking = at->second.upgradedToPushConstantPacking; + } + } + + private: + const TVarLiveMap& inputList; + const TVarLiveMap& outputList; + const TVarLiveMap& uniformList; +}; + +struct TNotifyUniformAdaptor +{ + EShLanguage stage; + TIoMapResolver& resolver; + inline TNotifyUniformAdaptor(EShLanguage s, TIoMapResolver& r) + : stage(s) + , resolver(r) + { + } + + inline void operator()(std::pair& entKey) + { + resolver.notifyBinding(stage, entKey.second); + } + +private: + TNotifyUniformAdaptor& operator=(TNotifyUniformAdaptor&) = delete; +}; + +struct TNotifyInOutAdaptor +{ + EShLanguage stage; + TIoMapResolver& resolver; + inline TNotifyInOutAdaptor(EShLanguage s, TIoMapResolver& r) + : stage(s) + , resolver(r) + { + } + + inline void operator()(std::pair& entKey) + { + resolver.notifyInOut(entKey.second.stage, entKey.second); + } + +private: + TNotifyInOutAdaptor& operator=(TNotifyInOutAdaptor&) = delete; +}; + +struct TResolverUniformAdaptor { + TResolverUniformAdaptor(EShLanguage s, TIoMapResolver& r, TVarLiveMap* uniform[EShLangCount], TInfoSink& i, bool& e) + : stage(s) + , resolver(r) + , infoSink(i) + , error(e) + { + memcpy(uniformVarMap, uniform, EShLangCount * (sizeof(TVarLiveMap*))); + } + + inline void operator()(std::pair& entKey) { + TVarEntryInfo& ent = entKey.second; + ent.clearNewAssignments(); + const bool isValid = resolver.validateBinding(stage, ent); + if (isValid) { + resolver.resolveSet(ent.stage, ent); + resolver.resolveBinding(ent.stage, ent); + resolver.resolveUniformLocation(ent.stage, ent); + + if (ent.newBinding != -1) { + if (ent.newBinding >= int(TQualifier::layoutBindingEnd)) { + TString err = "mapped binding out of range: " + entKey.first; + + infoSink.info.message(EPrefixInternalError, err.c_str()); + error = true; + } + + if (ent.symbol->getQualifier().hasBinding()) { + for (uint32_t idx = EShLangVertex; idx < EShLangCount; ++idx) { + if (idx == ent.stage || uniformVarMap[idx] == nullptr) + continue; + auto entKey2 = uniformVarMap[idx]->find(entKey.first); + if (entKey2 != uniformVarMap[idx]->end()) { + entKey2->second.newBinding = ent.newBinding; + } + } + } + } + if (ent.newSet != -1) { + if (ent.newSet >= int(TQualifier::layoutSetEnd)) { + TString err = "mapped set out of range: " + entKey.first; + + infoSink.info.message(EPrefixInternalError, err.c_str()); + error = true; + } + if (ent.symbol->getQualifier().hasSet()) { + for (uint32_t idx = EShLangVertex; idx < EShLangCount; ++idx) { + if ((idx == stage) || (uniformVarMap[idx] == nullptr)) + continue; + auto entKey2 = uniformVarMap[idx]->find(entKey.first); + if (entKey2 != uniformVarMap[idx]->end()) { + entKey2->second.newSet = ent.newSet; + } + } + } + } + } else { + TString errorMsg = "Invalid binding: " + entKey.first; + infoSink.info.message(EPrefixInternalError, errorMsg.c_str()); + error = true; + } + } + + inline void setStage(EShLanguage s) { stage = s; } + + EShLanguage stage; + TIoMapResolver& resolver; + TInfoSink& infoSink; + bool& error; + TVarLiveMap* uniformVarMap[EShLangCount]; +private: + TResolverUniformAdaptor& operator=(TResolverUniformAdaptor&) = delete; +}; + +struct TResolverInOutAdaptor { + TResolverInOutAdaptor(EShLanguage s, TIoMapResolver& r, TInfoSink& i, bool& e) + : stage(s) + , resolver(r) + , infoSink(i) + , error(e) + { + } + + inline void operator()(std::pair& entKey) + { + TVarEntryInfo& ent = entKey.second; + ent.clearNewAssignments(); + const bool isValid = resolver.validateInOut(ent.stage, ent); + if (isValid) { + resolver.resolveInOutLocation(stage, ent); + resolver.resolveInOutComponent(stage, ent); + resolver.resolveInOutIndex(stage, ent); + } else { + TString errorMsg; + if (ent.symbol->getType().getQualifier().semanticName != nullptr) { + errorMsg = "Invalid shader In/Out variable semantic: "; + errorMsg += ent.symbol->getType().getQualifier().semanticName; + } else { + errorMsg = "Invalid shader In/Out variable: "; + errorMsg += ent.symbol->getName(); + } + infoSink.info.message(EPrefixInternalError, errorMsg.c_str()); + error = true; + } + } + + inline void setStage(EShLanguage s) { stage = s; } + + EShLanguage stage; + TIoMapResolver& resolver; + TInfoSink& infoSink; + bool& error; + +private: + TResolverInOutAdaptor& operator=(TResolverInOutAdaptor&) = delete; +}; + +// The class is used for reserving explicit uniform locations and ubo/ssbo/opaque bindings +// xxTODO: maybe this logic should be moved into the resolver's "validateInOut" and "validateUniform" + +struct TSymbolValidater +{ + TSymbolValidater(TIoMapResolver& r, TInfoSink& i, TVarLiveMap* in[EShLangCount], TVarLiveMap* out[EShLangCount], + TVarLiveMap* uniform[EShLangCount], bool& hadError, EProfile profile, int version) + : resolver(r) + , infoSink(i) + , hadError(hadError) + , profile(profile) + , version(version) + { + memcpy(inVarMaps, in, EShLangCount * (sizeof(TVarLiveMap*))); + memcpy(outVarMaps, out, EShLangCount * (sizeof(TVarLiveMap*))); + memcpy(uniformVarMap, uniform, EShLangCount * (sizeof(TVarLiveMap*))); + + std::map anonymousMemberMap; + std::vector usedUniformLocation; + std::vector usedUniformName; + usedUniformLocation.clear(); + usedUniformName.clear(); + for (int i = 0; i < EShLangCount; i++) { + if (uniformVarMap[i]) { + for (auto uniformVar : *uniformVarMap[i]) + { + TIntermSymbol* pSymbol = uniformVar.second.symbol; + TQualifier qualifier = uniformVar.second.symbol->getQualifier(); + TString symbolName = pSymbol->getAccessName(); + + // All the uniform needs multi-stage location check (block/default) + int uniformLocation = qualifier.layoutLocation; + + if (uniformLocation != TQualifier::layoutLocationEnd) { + // Total size of current uniform, could be block, struct or other types. + int size = TIntermediate::computeTypeUniformLocationSize(pSymbol->getType()); + + TRange locationRange(uniformLocation, uniformLocation + size - 1); + + // Combine location and component ranges + int overlapLocation = -1; + bool diffLocation = false; + + // Check for collisions, except for vertex inputs on desktop targeting OpenGL + overlapLocation = checkLocationOverlap(locationRange, usedUniformLocation, symbolName, usedUniformName, diffLocation); + + // Overlap locations of uniforms, regardless of components (multi stages) + if (overlapLocation == -1) { + usedUniformLocation.push_back(locationRange); + usedUniformName.push_back(symbolName); + } + else if (overlapLocation >= 0) { + if (diffLocation == true) { + TString err = ("Uniform location should be equal for same uniforms: " +std::to_string(overlapLocation)).c_str(); + infoSink.info.message(EPrefixInternalError, err.c_str()); + hadError = true; + break; + } + else { + TString err = ("Uniform location overlaps across stages: " + std::to_string(overlapLocation)).c_str(); + infoSink.info.message(EPrefixInternalError, err.c_str()); + hadError = true; + break; + } + } + } + + if ((uniformVar.second.symbol->getBasicType() == EbtBlock) && + IsAnonymous(uniformVar.second.symbol->getName())) + { + auto blockType = uniformVar.second.symbol->getType().getStruct(); + for (size_t memberIdx = 0; memberIdx < blockType->size(); ++memberIdx) { + auto memberName = (*blockType)[memberIdx].type->getFieldName(); + if (anonymousMemberMap.find(memberName) != anonymousMemberMap.end()) + { + if (anonymousMemberMap[memberName] != uniformVar.second.symbol->getType().getTypeName()) + { + TString err = "Invalid block member name: " + memberName; + infoSink.info.message(EPrefixInternalError, err.c_str()); + hadError = true; + break; + } + } + else + { + anonymousMemberMap[memberName] = uniformVar.second.symbol->getType().getTypeName(); + } + } + } + if (hadError) + break; + } + } + } + } + + // In case we need to new an intermediate, which costs too much + int checkLocationOverlap(const TRange& locationRange, std::vector& usedUniformLocation, const TString symbolName, std::vector& usedUniformName, bool& diffLocation) + { + for (size_t r = 0; r < usedUniformLocation.size(); ++r) { + if (usedUniformName[r] == symbolName) { + diffLocation = true; + return (usedUniformLocation[r].start == locationRange.start && + usedUniformLocation[r].last == locationRange.last) + ? -2 : std::max(locationRange.start, usedUniformLocation[r].start); + } + if (locationRange.overlap(usedUniformLocation[r])) { + // there is a collision; pick one + return std::max(locationRange.start, usedUniformLocation[r].start); + } + } + + return -1; // no collision + } + + inline void operator()(std::pair& entKey) { + TVarEntryInfo& ent1 = entKey.second; + TIntermSymbol* base = ent1.symbol; + const TType& type = ent1.symbol->getType(); + const TString& name = entKey.first; + TString mangleName1, mangleName2; + EShLanguage stage = ent1.stage; + EShLanguage preStage, currentStage, nextStage; + + preStage = EShLangCount; + for (int i = stage - 1; i >= 0; i--) { + if (inVarMaps[i] != nullptr) { + preStage = static_cast(i); + break; + } + } + currentStage = stage; + nextStage = EShLangCount; + for (int i = stage + 1; i < EShLangCount; i++) { + if (inVarMaps[i] != nullptr) { + nextStage = static_cast(i); + break; + } + } + + if (type.getQualifier().isArrayedIo(stage)) { + TType subType(type, 0); + subType.appendMangledName(mangleName1); + } else { + type.appendMangledName(mangleName1); + } + + + // basic checking that symbols match + // more extensive checking in the link stage + if (base->getQualifier().storage == EvqVaryingIn) { + // validate stage in; + if (preStage == EShLangCount) + return; + if (TSymbolTable::isBuiltInSymbol(base->getId())) + return; + if (outVarMaps[preStage] != nullptr) { + auto ent2 = outVarMaps[preStage]->find(name); + uint32_t location = base->getType().getQualifier().layoutLocation; + if (ent2 == outVarMaps[preStage]->end() && + location != glslang::TQualifier::layoutLocationEnd) { + for (auto var = outVarMaps[preStage]->begin(); var != ent2; var++) { + if (var->second.symbol->getType().getQualifier().layoutLocation == location) { + ent2 = var; + break; + } + } + } + if (ent2 != outVarMaps[preStage]->end()) { + auto& type1 = base->getType(); + auto& type2 = ent2->second.symbol->getType(); + hadError = hadError || typeCheck(&type1, &type2, name.c_str(), false); + if (ent2->second.symbol->getType().getQualifier().isArrayedIo(preStage)) { + TType subType(ent2->second.symbol->getType(), 0); + subType.appendMangledName(mangleName2); + } else { + ent2->second.symbol->getType().appendMangledName(mangleName2); + } + + if (mangleName1 == mangleName2) { + // For ES 3.0 only, other versions have no such restrictions + // According to ES 3.0 spec: The type and presence of the interpolation qualifiers and + // storage qualifiers of variables with the same name declared in all linked shaders must + // match, otherwise the link command will fail. + if (profile == EEsProfile && version == 300) { + // Don't need to check smooth qualifier, as it uses the default interpolation mode + if (ent1.stage == EShLangFragment && type1.isBuiltIn() == false) { + if (type1.getQualifier().flat != type2.getQualifier().flat || + type1.getQualifier().nopersp != type2.getQualifier().nopersp) { + TString err = "Interpolation qualifier mismatch : " + entKey.first; + infoSink.info.message(EPrefixInternalError, err.c_str()); + hadError = true; + } + } + } + return; + } + else { + // Deal with input/output pairs where one is a block member but the other is loose, + // e.g. with ARB_separate_shader_objects + if (type1.getBasicType() == EbtBlock && + type1.isStruct() && !type2.isStruct()) { + // Iterate through block members tracking layout + glslang::TString name; + type1.getStruct()->begin()->type->appendMangledName(name); + if (name == mangleName2 + && type1.getQualifier().layoutLocation == type2.getQualifier().layoutLocation) return; + } + if (type2.getBasicType() == EbtBlock && + type2.isStruct() && !type1.isStruct()) { + // Iterate through block members tracking layout + glslang::TString name; + type2.getStruct()->begin()->type->appendMangledName(name); + if (name == mangleName1 + && type1.getQualifier().layoutLocation == type2.getQualifier().layoutLocation) return; + } + TString err = "Invalid In/Out variable type : " + entKey.first; + infoSink.info.message(EPrefixInternalError, err.c_str()); + hadError = true; + } + } + else if (!base->getType().isBuiltIn()) { + // According to spec: A link error is generated if any statically referenced input variable + // or block does not have a matching output + if (profile == EEsProfile && ent1.live) { + hadError = true; + TString errorStr = name + ": not been declare as a output variable in pre shader stage."; + infoSink.info.message(EPrefixError, errorStr.c_str()); + } + } + return; + } + } else if (base->getQualifier().storage == EvqVaryingOut) { + // validate stage out; + if (nextStage == EShLangCount) + return; + if (TSymbolTable::isBuiltInSymbol(base->getId())) + return; + if (inVarMaps[nextStage] != nullptr) { + auto ent2 = inVarMaps[nextStage]->find(name); + if (ent2 != inVarMaps[nextStage]->end()) { + if (ent2->second.symbol->getType().getQualifier().isArrayedIo(nextStage)) { + TType subType(ent2->second.symbol->getType(), 0); + subType.appendMangledName(mangleName2); + } else { + ent2->second.symbol->getType().appendMangledName(mangleName2); + } + if (mangleName1 == mangleName2) + return; + else { + TString err = "Invalid In/Out variable type : " + entKey.first; + infoSink.info.message(EPrefixInternalError, err.c_str()); + hadError = true; + } + } + return; + } + } else if (base->getQualifier().isUniformOrBuffer() && !base->getQualifier().isPushConstant()) { + // validate uniform type; + for (int i = 0; i < EShLangCount; i++) { + if (i != currentStage && outVarMaps[i] != nullptr) { + auto ent2 = uniformVarMap[i]->find(name); + if (ent2 != uniformVarMap[i]->end()) { + ent2->second.symbol->getType().appendMangledName(mangleName2); + if (mangleName1 != mangleName2) { + ent2->second.symbol->getType().sameElementType(type); + TString err = "Invalid Uniform variable type : " + entKey.first; + infoSink.info.message(EPrefixInternalError, err.c_str()); + hadError = true; + } + mangleName2.clear(); + + // validate instance name of blocks + if (hadError == false && + base->getType().getBasicType() == EbtBlock && + IsAnonymous(base->getName()) != IsAnonymous(ent2->second.symbol->getName())) { + TString err = "Matched uniform block names must also either all be lacking " + "an instance name or all having an instance name: " + entKey.first; + infoSink.info.message(EPrefixInternalError, err.c_str()); + hadError = true; + } + + // validate uniform block member qualifier and member names + auto& type1 = base->getType(); + auto& type2 = ent2->second.symbol->getType(); + if (hadError == false && base->getType().getBasicType() == EbtBlock) { + hadError = hadError || typeCheck(&type1, &type2, name.c_str(), true); + } + else { + hadError = hadError || typeCheck(&type1, &type2, name.c_str(), false); + } + } + else if (base->getBasicType() == EbtBlock) + { + if (IsAnonymous(base->getName())) + { + // The name of anonymous block member can't same with default uniform variable. + auto blockType1 = base->getType().getStruct(); + for (size_t memberIdx = 0; memberIdx < blockType1->size(); ++memberIdx) { + auto memberName = (*blockType1)[memberIdx].type->getFieldName(); + if (uniformVarMap[i]->find(memberName) != uniformVarMap[i]->end()) + { + TString err = "Invalid Uniform variable name : " + memberName; + infoSink.info.message(EPrefixInternalError, err.c_str()); + hadError = true; + break; + } + } + } + } + } + } + } + } + + TVarLiveMap *inVarMaps[EShLangCount], *outVarMaps[EShLangCount], *uniformVarMap[EShLangCount]; + + // Use for mark current shader stage for resolver + TIoMapResolver& resolver; + TInfoSink& infoSink; + bool& hadError; + EProfile profile; + int version; + +private: + TSymbolValidater& operator=(TSymbolValidater&) = delete; + + bool qualifierCheck(const TType* const type1, const TType* const type2, const std::string& name, bool isBlock) + { + bool hasError = false; + const TQualifier& qualifier1 = type1->getQualifier(); + const TQualifier& qualifier2 = type2->getQualifier(); + + if (((isBlock == false) && + (type1->getQualifier().storage == EvqUniform && type2->getQualifier().storage == EvqUniform)) || + (type1->getQualifier().storage == EvqGlobal && type2->getQualifier().storage == EvqGlobal)) { + if (qualifier1.precision != qualifier2.precision) { + hasError = true; + std::string errorStr = name + ": have precision conflict cross stage."; + infoSink.info.message(EPrefixError, errorStr.c_str()); + } + if (qualifier1.hasFormat() && qualifier2.hasFormat()) { + if (qualifier1.layoutFormat != qualifier2.layoutFormat) { + hasError = true; + std::string errorStr = name + ": have layout format conflict cross stage."; + infoSink.info.message(EPrefixError, errorStr.c_str()); + } + + } + } + + if (isBlock == true) { + if (qualifier1.layoutPacking != qualifier2.layoutPacking) { + hasError = true; + std::string errorStr = name + ": have layoutPacking conflict cross stage."; + infoSink.info.message(EPrefixError, errorStr.c_str()); + } + if (qualifier1.layoutMatrix != qualifier2.layoutMatrix) { + hasError = true; + std::string errorStr = name + ": have layoutMatrix conflict cross stage."; + infoSink.info.message(EPrefixError, errorStr.c_str()); + } + if (qualifier1.layoutOffset != qualifier2.layoutOffset) { + hasError = true; + std::string errorStr = name + ": have layoutOffset conflict cross stage."; + infoSink.info.message(EPrefixError, errorStr.c_str()); + } + if (qualifier1.layoutAlign != qualifier2.layoutAlign) { + hasError = true; + std::string errorStr = name + ": have layoutAlign conflict cross stage."; + infoSink.info.message(EPrefixError, errorStr.c_str()); + } + } + + return hasError; + } + + bool typeCheck(const TType* const type1, const TType* const type2, const std::string& name, bool isBlock) + { + bool hasError = false; + if (!(type1->isStruct() && type2->isStruct())) { + hasError = hasError || qualifierCheck(type1, type2, name, isBlock); + } + else { + if (type1->getBasicType() == EbtBlock && type2->getBasicType() == EbtBlock) + isBlock = true; + const TTypeList* typeList1 = type1->getStruct(); + const TTypeList* typeList2 = type2->getStruct(); + + std::string newName = name; + size_t memberCount = typeList1->size(); + size_t index2 = 0; + for (size_t index = 0; index < memberCount; index++, index2++) { + // Skip inactive member + if (typeList1->at(index).type->getBasicType() == EbtVoid) + continue; + while (index2 < typeList2->size() && typeList2->at(index2).type->getBasicType() == EbtVoid) { + ++index2; + } + + // TypeList1 has more members in list + if (index2 == typeList2->size()) { + std::string errorStr = name + ": struct mismatch."; + infoSink.info.message(EPrefixError, errorStr.c_str()); + hasError = true; + break; + } + + if (typeList1->at(index).type->getFieldName() != typeList2->at(index2).type->getFieldName()) { + std::string errorStr = name + ": member name mismatch."; + infoSink.info.message(EPrefixError, errorStr.c_str()); + hasError = true; + } + else { + newName = typeList1->at(index).type->getFieldName().c_str(); + } + hasError = hasError || typeCheck(typeList1->at(index).type, typeList2->at(index2).type, newName, isBlock); + } + + while (index2 < typeList2->size()) + { + // TypeList2 has more members + if (typeList2->at(index2).type->getBasicType() != EbtVoid) { + std::string errorStr = name + ": struct mismatch."; + infoSink.info.message(EPrefixError, errorStr.c_str()); + hasError = true; + break; + } + ++index2; + } + } + return hasError; + } +}; + +struct TSlotCollector { + TSlotCollector(TIoMapResolver& r, TInfoSink& i) : resolver(r), infoSink(i) { } + + inline void operator()(std::pair& entKey) { + resolver.reserverStorageSlot(entKey.second, infoSink); + resolver.reserverResourceSlot(entKey.second, infoSink); + } + TIoMapResolver& resolver; + TInfoSink& infoSink; + +private: + TSlotCollector& operator=(TSlotCollector&) = delete; +}; + +TDefaultIoResolverBase::TDefaultIoResolverBase(const TIntermediate& intermediate) + : referenceIntermediate(intermediate) + , nextUniformLocation(intermediate.getUniformLocationBase()) + , nextInputLocation(0) + , nextOutputLocation(0) +{ + memset(stageMask, false, sizeof(bool) * (EShLangCount + 1)); + memset(stageIntermediates, 0, sizeof(TIntermediate*) * (EShLangCount)); + stageIntermediates[intermediate.getStage()] = &intermediate; +} + +int TDefaultIoResolverBase::getBaseBinding(EShLanguage stage, TResourceType res, unsigned int set) const { + return stageIntermediates[stage] ? selectBaseBinding(stageIntermediates[stage]->getShiftBinding(res), stageIntermediates[stage]->getShiftBindingForSet(res, set)) + : selectBaseBinding(referenceIntermediate.getShiftBinding(res), referenceIntermediate.getShiftBindingForSet(res, set)); +} + +const std::vector& TDefaultIoResolverBase::getResourceSetBinding(EShLanguage stage) const { + return stageIntermediates[stage] ? stageIntermediates[stage]->getResourceSetBinding() + : referenceIntermediate.getResourceSetBinding(); +} + +bool TDefaultIoResolverBase::doAutoBindingMapping() const { return referenceIntermediate.getAutoMapBindings(); } + +bool TDefaultIoResolverBase::doAutoLocationMapping() const { return referenceIntermediate.getAutoMapLocations(); } + +TDefaultIoResolverBase::TSlotSet::iterator TDefaultIoResolverBase::findSlot(int set, int slot) { + return std::lower_bound(slots[set].begin(), slots[set].end(), slot); +} + +bool TDefaultIoResolverBase::checkEmpty(int set, int slot) { + TSlotSet::iterator at = findSlot(set, slot); + return ! (at != slots[set].end() && *at == slot); +} + +int TDefaultIoResolverBase::reserveSlot(int set, int slot, int size) { + TSlotSet::iterator at = findSlot(set, slot); + // tolerate aliasing, by not double-recording aliases + // (policy about appropriateness of the alias is higher up) + for (int i = 0; i < size; i++) { + if (at == slots[set].end() || *at != slot + i) + at = slots[set].insert(at, slot + i); + ++at; + } + return slot; +} + +int TDefaultIoResolverBase::getFreeSlot(int set, int base, int size) { + TSlotSet::iterator at = findSlot(set, base); + if (at == slots[set].end()) + return reserveSlot(set, base, size); + // look for a big enough gap + for (; at != slots[set].end(); ++at) { + if (*at - base >= size) + break; + base = *at + 1; + } + return reserveSlot(set, base, size); +} + +int TDefaultIoResolverBase::resolveSet(EShLanguage stage, TVarEntryInfo& ent) { + const TType& type = ent.symbol->getType(); + if (type.getQualifier().hasSet()) { + return ent.newSet = type.getQualifier().layoutSet; + } + // If a command line or API option requested a single descriptor set, use that (if not overrided by spaceN) + if (getResourceSetBinding(stage).size() == 1) { + return ent.newSet = atoi(getResourceSetBinding(stage)[0].c_str()); + } + return ent.newSet = 0; +} + +int TDefaultIoResolverBase::resolveUniformLocation(EShLanguage /*stage*/, TVarEntryInfo& ent) { + const TType& type = ent.symbol->getType(); + const char* name = ent.symbol->getAccessName().c_str(); + // kick out of not doing this + if (! doAutoLocationMapping()) { + return ent.newLocation = -1; + } + // no locations added if already present, a built-in variable, a block, or an opaque + if (type.getQualifier().hasLocation() || type.isBuiltIn() || type.getBasicType() == EbtBlock || + type.isAtomic() || type.isSpirvType() || (type.containsOpaque() && referenceIntermediate.getSpv().openGl == 0)) { + return ent.newLocation = -1; + } + // no locations on blocks of built-in variables + if (type.isStruct()) { + if (type.getStruct()->size() < 1) { + return ent.newLocation = -1; + } + if ((*type.getStruct())[0].type->isBuiltIn()) { + return ent.newLocation = -1; + } + } + int location = referenceIntermediate.getUniformLocationOverride(name); + if (location != -1) { + return ent.newLocation = location; + } + location = nextUniformLocation; + nextUniformLocation += TIntermediate::computeTypeUniformLocationSize(type); + return ent.newLocation = location; +} + +int TDefaultIoResolverBase::resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) { + const TType& type = ent.symbol->getType(); + // kick out of not doing this + if (! doAutoLocationMapping()) { + return ent.newLocation = -1; + } + + // no locations added if already present, a built-in variable, or a variable with SPIR-V decorate + if (type.getQualifier().hasLocation() || type.isBuiltIn() || type.getQualifier().hasSpirvDecorate()) { + return ent.newLocation = -1; + } + + // no locations on blocks of built-in variables + if (type.isStruct()) { + if (type.getStruct()->size() < 1) { + return ent.newLocation = -1; + } + if ((*type.getStruct())[0].type->isBuiltIn()) { + return ent.newLocation = -1; + } + } + // point to the right input or output location counter + int& nextLocation = type.getQualifier().isPipeInput() ? nextInputLocation : nextOutputLocation; + // Placeholder. This does not do proper cross-stage lining up, nor + // work with mixed location/no-location declarations. + int location = nextLocation; + int typeLocationSize; + // Don’t take into account the outer-most array if the stage’s + // interface is automatically an array. + typeLocationSize = computeTypeLocationSize(type, stage); + nextLocation += typeLocationSize; + return ent.newLocation = location; +} + +int TDefaultIoResolverBase::resolveInOutComponent(EShLanguage /*stage*/, TVarEntryInfo& ent) { + return ent.newComponent = -1; +} + +int TDefaultIoResolverBase::resolveInOutIndex(EShLanguage /*stage*/, TVarEntryInfo& ent) { return ent.newIndex = -1; } + +uint32_t TDefaultIoResolverBase::computeTypeLocationSize(const TType& type, EShLanguage stage) { + int typeLocationSize; + // Don’t take into account the outer-most array if the stage’s + // interface is automatically an array. + if (type.getQualifier().isArrayedIo(stage)) { + TType elementType(type, 0); + typeLocationSize = TIntermediate::computeTypeLocationSize(elementType, stage); + } else { + typeLocationSize = TIntermediate::computeTypeLocationSize(type, stage); + } + return typeLocationSize; +} + +//TDefaultGlslIoResolver +TResourceType TDefaultGlslIoResolver::getResourceType(const glslang::TType& type) { + assert(isValidGlslType(type)); + if (isImageType(type)) { + return EResImage; + } + if (isTextureType(type)) { + return EResTexture; + } + if (isSsboType(type)) { + return EResSsbo; + } + if (isSamplerType(type)) { + return EResSampler; + } + if (isUboType(type)) { + return EResUbo; + } + if (isCombinedSamplerType(type)) { + return EResCombinedSampler; + } + if (isAsType(type)) { + return EResAs; + } + if (isTensorType(type)) { + return EResTensor; + } + return EResCount; +} + +TDefaultGlslIoResolver::TDefaultGlslIoResolver(const TIntermediate& intermediate) + : TDefaultIoResolverBase(intermediate) + , preStage(EShLangCount) + , currentStage(EShLangCount) +{ } + +int TDefaultGlslIoResolver::resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) { + const TType& type = ent.symbol->getType(); + const TString& name = ent.symbol->getAccessName(); + if (currentStage != stage) { + preStage = currentStage; + currentStage = stage; + } + // kick out if not doing this + if (! doAutoLocationMapping()) { + return ent.newLocation = -1; + } + // expand the location to each element if the symbol is a struct or array + if (type.getQualifier().hasLocation()) { + return ent.newLocation = type.getQualifier().layoutLocation; + } + // no locations added if already present, a built-in variable, or a variable with SPIR-V decorate + if (type.isBuiltIn() || type.getQualifier().hasSpirvDecorate()) { + return ent.newLocation = -1; + } + // no locations on blocks of built-in variables + if (type.isStruct()) { + if (type.getStruct()->size() < 1) { + return ent.newLocation = -1; + } + if ((*type.getStruct())[0].type->isBuiltIn()) { + return ent.newLocation = -1; + } + } + int typeLocationSize = computeTypeLocationSize(type, stage); + int location = type.getQualifier().layoutLocation; + bool hasLocation = false; + EShLanguage keyStage(EShLangCount); + TStorageQualifier storage; + storage = EvqInOut; + if (type.getQualifier().isPipeInput()) { + // If this symbol is a input, search pre stage's out + keyStage = preStage; + } + if (type.getQualifier().isPipeOutput()) { + // If this symbol is a output, search next stage's in + keyStage = currentStage; + } + // The in/out in current stage is not declared with location, but it is possible declared + // with explicit location in other stages, find the storageSlotMap firstly to check whether + // the in/out has location + int resourceKey = buildStorageKey(keyStage, storage); + if (! storageSlotMap[resourceKey].empty()) { + TVarSlotMap::iterator iter = storageSlotMap[resourceKey].find(name); + if (iter != storageSlotMap[resourceKey].end()) { + // If interface resource be found, set it has location and this symbol's new location + // equal the symbol's explicit location declaration in pre or next stage. + // + // vs: out vec4 a; + // fs: layout(..., location = 3,...) in vec4 a; + hasLocation = true; + location = iter->second; + // if we want deal like that: + // vs: layout(location=4) out vec4 a; + // out vec4 b; + // + // fs: in vec4 a; + // layout(location = 4) in vec4 b; + // we need retraverse the map. + } + if (! hasLocation) { + // If interface resource note found, It's mean the location in two stage are both implicit declarat. + // So we should find a new slot for this interface. + // + // vs: out vec4 a; + // fs: in vec4 a; + location = getFreeSlot(resourceKey, 0, typeLocationSize); + storageSlotMap[resourceKey][name] = location; + } + } else { + // the first interface declarated in a program. + TVarSlotMap varSlotMap; + location = getFreeSlot(resourceKey, 0, typeLocationSize); + varSlotMap[name] = location; + storageSlotMap[resourceKey] = varSlotMap; + } + //Update location + return ent.newLocation = location; +} + +int TDefaultGlslIoResolver::resolveUniformLocation(EShLanguage /*stage*/, TVarEntryInfo& ent) { + const TType& type = ent.symbol->getType(); + const TString& name = ent.symbol->getAccessName(); + // kick out of not doing this + if (! doAutoLocationMapping()) { + return ent.newLocation = -1; + } + // expand the location to each element if the symbol is a struct or array + if (type.getQualifier().hasLocation() && (type.isStruct() || type.isArray())) { + return ent.newLocation = type.getQualifier().layoutLocation; + } else { + // no locations added if already present, a built-in variable, a block, or an opaque + if (type.getQualifier().hasLocation() || type.isBuiltIn() || type.getBasicType() == EbtBlock || + type.isAtomic() || type.isSpirvType() || + (type.containsOpaque() && referenceIntermediate.getSpv().openGl == 0)) { + return ent.newLocation = -1; + } + // no locations on blocks of built-in variables + if (type.isStruct()) { + if (type.getStruct()->size() < 1) { + return ent.newLocation = -1; + } + if ((*type.getStruct())[0].type->isBuiltIn()) { + return ent.newLocation = -1; + } + } + } + int location = referenceIntermediate.getUniformLocationOverride(name.c_str()); + if (location != -1) { + return ent.newLocation = location; + } + + int size = TIntermediate::computeTypeUniformLocationSize(type); + + // The uniform in current stage is not declared with location, but it is possible declared + // with explicit location in other stages, find the storageSlotMap firstly to check whether + // the uniform has location + bool hasLocation = false; + int resourceKey = buildStorageKey(EShLangCount, EvqUniform); + TVarSlotMap& slotMap = storageSlotMap[resourceKey]; + // Check dose shader program has uniform resource + if (! slotMap.empty()) { + // If uniform resource not empty, try find a same name uniform + TVarSlotMap::iterator iter = slotMap.find(name); + if (iter != slotMap.end()) { + // If uniform resource be found, set it has location and this symbol's new location + // equal the uniform's explicit location declaration in other stage. + // + // vs: uniform vec4 a; + // fs: layout(..., location = 3,...) uniform vec4 a; + hasLocation = true; + location = iter->second; + } + if (! hasLocation) { + // No explicit location declaration in other stage. + // So we should find a new slot for this uniform. + // + // vs: uniform vec4 a; + // fs: uniform vec4 a; + location = getFreeSlot(resourceKey, 0, computeTypeLocationSize(type, currentStage)); + storageSlotMap[resourceKey][name] = location; + } + } else { + // the first uniform declaration in a program. + TVarSlotMap varSlotMap; + location = getFreeSlot(resourceKey, 0, size); + varSlotMap[name] = location; + storageSlotMap[resourceKey] = varSlotMap; + } + return ent.newLocation = location; +} + +int TDefaultGlslIoResolver::resolveBinding(EShLanguage stage, TVarEntryInfo& ent) { + const TType& type = ent.symbol->getType(); + const TString& name = ent.symbol->getAccessName(); + // On OpenGL arrays of opaque types take a separate binding for each element + int numBindings = referenceIntermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1; + TResourceType resource = getResourceType(type); + // don't need to handle uniform symbol, it will be handled in resolveUniformLocation + if (resource == EResUbo && type.getBasicType() != EbtBlock) { + return ent.newBinding = -1; + } + // There is no 'set' qualifier in OpenGL shading language, each resource has its own + // binding name space, so remap the 'set' to resource type which make each resource + // binding is valid from 0 to MAX_XXRESOURCE_BINDINGS + int set = referenceIntermediate.getSpv().openGl != 0 ? resource : ent.newSet; + int resourceKey = set; + if (resource < EResCount) { + if (type.getQualifier().hasBinding()) { + int newBinding = reserveSlot(resourceKey, getBaseBinding(stage, resource, set) + type.getQualifier().layoutBinding, numBindings); + return ent.newBinding = newBinding; + + } else { + // The resource in current stage is not declared with binding, but it is possible declared + // with explicit binding in other stages, find the resourceSlotMap firstly to check whether + // the resource has binding, don't need to allocate if it already has a binding + bool hasBinding = false; + ent.newBinding = -1; // leave as -1 if it isn't set below + + if (! resourceSlotMap[resourceKey].empty()) { + TVarSlotMap::iterator iter = resourceSlotMap[resourceKey].find(name); + if (iter != resourceSlotMap[resourceKey].end()) { + hasBinding = true; + ent.newBinding = iter->second; + } + } + if (!hasBinding && (ent.live && doAutoBindingMapping())) { + // find free slot, the caller did make sure it passes all vars with binding + // first and now all are passed that do not have a binding and needs one + int binding = getFreeSlot(resourceKey, getBaseBinding(stage, resource, set), numBindings); + resourceSlotMap[resourceKey][name] = binding; + ent.newBinding = binding; + } + return ent.newBinding; + } + } + return ent.newBinding = -1; +} + +void TDefaultGlslIoResolver::beginResolve(EShLanguage stage) { + // reset stage state + if (stage == EShLangCount) + preStage = currentStage = stage; + // update stage state + else if (currentStage != stage) { + preStage = currentStage; + currentStage = stage; + } +} + +void TDefaultGlslIoResolver::endResolve(EShLanguage /*stage*/) { + // TODO nothing +} + +void TDefaultGlslIoResolver::beginCollect(EShLanguage stage) { + // reset stage state + if (stage == EShLangCount) + preStage = currentStage = stage; + // update stage state + else if (currentStage != stage) { + preStage = currentStage; + currentStage = stage; + } +} + +void TDefaultGlslIoResolver::endCollect(EShLanguage /*stage*/) { + // TODO nothing +} + +void TDefaultGlslIoResolver::reserverStorageSlot(TVarEntryInfo& ent, TInfoSink& infoSink) { + const TType& type = ent.symbol->getType(); + const TString& name = ent.symbol->getAccessName(); + TStorageQualifier storage = type.getQualifier().storage; + EShLanguage stage(EShLangCount); + switch (storage) { + case EvqUniform: + if (type.getBasicType() != EbtBlock && type.getQualifier().hasLocation()) { + // + // Reserve the slots for the uniforms who has explicit location + int storageKey = buildStorageKey(EShLangCount, EvqUniform); + int location = type.getQualifier().layoutLocation; + TVarSlotMap& varSlotMap = storageSlotMap[storageKey]; + TVarSlotMap::iterator iter = varSlotMap.find(name); + if (iter == varSlotMap.end()) { + int numLocations = TIntermediate::computeTypeUniformLocationSize(type); + reserveSlot(storageKey, location, numLocations); + varSlotMap[name] = location; + } else { + // Allocate location by name for OpenGL driver, so the uniform in different + // stages should be declared with the same location + if (iter->second != location) { + TString errorMsg = "Invalid location: " + name; + infoSink.info.message(EPrefixInternalError, errorMsg.c_str()); + hasError = true; + } + } + } + break; + case EvqVaryingIn: + case EvqVaryingOut: + // + // Reserve the slots for the inout who has explicit location + if (type.getQualifier().hasLocation()) { + stage = storage == EvqVaryingIn ? preStage : stage; + stage = storage == EvqVaryingOut ? currentStage : stage; + int storageKey = buildStorageKey(stage, EvqInOut); + int location = type.getQualifier().layoutLocation; + TVarSlotMap& varSlotMap = storageSlotMap[storageKey]; + TVarSlotMap::iterator iter = varSlotMap.find(name); + if (iter == varSlotMap.end()) { + int numLocations = TIntermediate::computeTypeUniformLocationSize(type); + reserveSlot(storageKey, location, numLocations); + varSlotMap[name] = location; + } else { + // Allocate location by name for OpenGL driver, so the uniform in different + // stages should be declared with the same location + if (iter->second != location) { + TString errorMsg = "Invalid location: " + name; + infoSink.info.message(EPrefixInternalError, errorMsg.c_str()); + hasError = true; + } + } + } + break; + default: + break; + } +} + +void TDefaultGlslIoResolver::reserverResourceSlot(TVarEntryInfo& ent, TInfoSink& infoSink) { + const TType& type = ent.symbol->getType(); + const TString& name = ent.symbol->getAccessName(); + TResourceType resource = getResourceType(type); + int set = referenceIntermediate.getSpv().openGl != 0 ? resource : resolveSet(ent.stage, ent); + int resourceKey = set; + + if (type.getQualifier().hasBinding()) { + TVarSlotMap& varSlotMap = resourceSlotMap[resourceKey]; + TVarSlotMap::iterator iter = varSlotMap.find(name); + int binding = type.getQualifier().layoutBinding + getBaseBinding(ent.stage, resource, set); + + if (iter == varSlotMap.end()) { + // Reserve the slots for the ubo, ssbo and opaques who has explicit binding + int numBindings = referenceIntermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1; + varSlotMap[name] = binding; + reserveSlot(resourceKey, binding, numBindings); + } else { + // Allocate binding by name for OpenGL driver, so the resource in different + // stages should be declared with the same binding + if (iter->second != binding) { + TString errorMsg = "Invalid binding: " + name; + infoSink.info.message(EPrefixInternalError, errorMsg.c_str()); + hasError = true; + } + } + } +} + +//TDefaultGlslIoResolver end + +/* + * Basic implementation of glslang::TIoMapResolver that replaces the + * previous offset behavior. + * It does the same, uses the offsets for the corresponding uniform + * types. Also respects the EOptionAutoMapBindings flag and binds + * them if needed. + */ +/* + * Default resolver + */ +struct TDefaultIoResolver : public TDefaultIoResolverBase { + TDefaultIoResolver(const TIntermediate& intermediate) : TDefaultIoResolverBase(intermediate) { } + + bool validateBinding(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; } + + TResourceType getResourceType(const glslang::TType& type) override { + assert(isValidGlslType(type)); + if (isImageType(type)) { + return EResImage; + } + if (isTextureType(type)) { + return EResTexture; + } + if (isSsboType(type)) { + return EResSsbo; + } + if (isSamplerType(type)) { + return EResSampler; + } + if (isUboType(type)) { + return EResUbo; + } + if (isCombinedSamplerType(type)) { + return EResCombinedSampler; + } + if (isAsType(type)) { + return EResAs; + } + if (isTensorType(type)) { + return EResTensor; + } + return EResCount; + } + + int resolveBinding(EShLanguage stage, TVarEntryInfo& ent) override { + const TType& type = ent.symbol->getType(); + const int set = getLayoutSet(type); + // On OpenGL arrays of opaque types take a seperate binding for each element + int numBindings = referenceIntermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1; + TResourceType resource = getResourceType(type); + if (resource < EResCount) { + if (type.getQualifier().hasBinding()) { + return ent.newBinding = reserveSlot( + set, getBaseBinding(stage, resource, set) + type.getQualifier().layoutBinding, numBindings); + } else if (ent.live && doAutoBindingMapping()) { + // find free slot, the caller did make sure it passes all vars with binding + // first and now all are passed that do not have a binding and needs one + return ent.newBinding = getFreeSlot(set, getBaseBinding(stage, resource, set), numBindings); + } + } + return ent.newBinding = -1; + } +}; + +#ifdef ENABLE_HLSL +/******************************************************************************** +The following IO resolver maps types in HLSL register space, as follows: + +t - for shader resource views (SRV) + TEXTURE1D + TEXTURE1DARRAY + TEXTURE2D + TEXTURE2DARRAY + TEXTURE3D + TEXTURECUBE + TEXTURECUBEARRAY + TEXTURE2DMS + TEXTURE2DMSARRAY + STRUCTUREDBUFFER + BYTEADDRESSBUFFER + BUFFER + TBUFFER + +s - for samplers + SAMPLER + SAMPLER1D + SAMPLER2D + SAMPLER3D + SAMPLERCUBE + SAMPLERSTATE + SAMPLERCOMPARISONSTATE + +u - for unordered access views (UAV) + RWBYTEADDRESSBUFFER + RWSTRUCTUREDBUFFER + APPENDSTRUCTUREDBUFFER + CONSUMESTRUCTUREDBUFFER + RWBUFFER + RWTEXTURE1D + RWTEXTURE1DARRAY + RWTEXTURE2D + RWTEXTURE2DARRAY + RWTEXTURE3D + +b - for constant buffer views (CBV) + CBUFFER + CONSTANTBUFFER + ********************************************************************************/ +struct TDefaultHlslIoResolver : public TDefaultIoResolverBase { + TDefaultHlslIoResolver(const TIntermediate& intermediate) : TDefaultIoResolverBase(intermediate) { } + + bool validateBinding(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; } + + TResourceType getResourceType(const glslang::TType& type) override { + if (isUavType(type)) { + return EResUav; + } + if (isSrvType(type)) { + return EResTexture; + } + if (isSamplerType(type)) { + return EResSampler; + } + if (isUboType(type)) { + return EResUbo; + } + // no support for combined samplers in HLSL + if (isAsType(type)) { + return EResAs; + } + // no support for tensors in HLSL + return EResCount; + } + + int resolveBinding(EShLanguage stage, TVarEntryInfo& ent) override { + const TType& type = ent.symbol->getType(); + const int set = getLayoutSet(type); + TResourceType resource = getResourceType(type); + if (resource < EResCount) { + if (type.getQualifier().hasBinding()) { + return ent.newBinding = reserveSlot(set, getBaseBinding(stage, resource, set) + type.getQualifier().layoutBinding); + } else if (ent.live && doAutoBindingMapping()) { + // find free slot, the caller did make sure it passes all vars with binding + // first and now all are passed that do not have a binding and needs one + return ent.newBinding = getFreeSlot(set, getBaseBinding(stage, resource, set)); + } + } + return ent.newBinding = -1; + } +}; +#endif + +// Map I/O variables to provided offsets, and make bindings for +// unbound but live variables. +// +// Returns false if the input is too malformed to do this. +bool TIoMapper::addStage(EShLanguage stage, TIntermediate& intermediate, TInfoSink& infoSink, TIoMapResolver* resolver) { + bool somethingToDo = ! intermediate.getResourceSetBinding().empty() || intermediate.getAutoMapBindings() || + intermediate.getAutoMapLocations(); + // Restrict the stricter condition to further check 'somethingToDo' only if 'somethingToDo' has not been set, reduce + // unnecessary or insignificant for-loop operation after 'somethingToDo' have been true. + for (int res = 0; (res < EResCount && !somethingToDo); ++res) { + somethingToDo = somethingToDo || (intermediate.getShiftBinding(TResourceType(res)) != 0) || + intermediate.hasShiftBindingForSet(TResourceType(res)); + } + if (! somethingToDo && resolver == nullptr) + return true; + if (intermediate.getNumEntryPoints() != 1 || intermediate.isRecursive()) + return false; + TIntermNode* root = intermediate.getTreeRoot(); + if (root == nullptr) + return false; + // if no resolver is provided, use the default resolver with the given shifts and auto map settings + TDefaultIoResolver defaultResolver(intermediate); +#ifdef ENABLE_HLSL + TDefaultHlslIoResolver defaultHlslResolver(intermediate); + if (resolver == nullptr) { + // TODO: use a passed in IO mapper for this + if (intermediate.usingHlslIoMapping()) + resolver = &defaultHlslResolver; + else + resolver = &defaultResolver; + } +#else + resolver = &defaultResolver; +#endif + resolver->addStage(stage, intermediate); + + TVarLiveMap inVarMap, outVarMap, uniformVarMap; + TVarLiveVector inVector, outVector, uniformVector; + TVarGatherTraverser iter_binding_all(intermediate, true, inVarMap, outVarMap, uniformVarMap); + TVarGatherTraverser iter_binding_live(intermediate, false, inVarMap, outVarMap, uniformVarMap); + root->traverse(&iter_binding_all); + iter_binding_live.pushFunction(intermediate.getEntryPointMangledName().c_str()); + while (! iter_binding_live.destinations.empty()) { + TIntermNode* destination = iter_binding_live.destinations.back(); + iter_binding_live.destinations.pop_back(); + destination->traverse(&iter_binding_live); + } + + // sort entries by priority. see TVarEntryInfo::TOrderByPriority for info. + for (auto& var : inVarMap) { inVector.push_back(var); } + std::sort(inVector.begin(), inVector.end(), [](const TVarLivePair& p1, const TVarLivePair& p2) -> bool { + return TVarEntryInfo::TOrderByPriority()(p1.second, p2.second); + }); + for (auto& var : outVarMap) { outVector.push_back(var); } + std::sort(outVector.begin(), outVector.end(), [](const TVarLivePair& p1, const TVarLivePair& p2) -> bool { + return TVarEntryInfo::TOrderByPriority()(p1.second, p2.second); + }); + for (auto& var : uniformVarMap) { uniformVector.push_back(var); } + std::sort(uniformVector.begin(), uniformVector.end(), [](const TVarLivePair& p1, const TVarLivePair& p2) -> bool { + return TVarEntryInfo::TOrderByPriority()(p1.second, p2.second); + }); + bool hadError = false; + TVarLiveMap* dummyUniformVarMap[EShLangCount] = {}; + TNotifyInOutAdaptor inOutNotify(stage, *resolver); + TNotifyUniformAdaptor uniformNotify(stage, *resolver); + TResolverUniformAdaptor uniformResolve(stage, *resolver, dummyUniformVarMap, infoSink, hadError); + TResolverInOutAdaptor inOutResolve(stage, *resolver, infoSink, hadError); + resolver->beginNotifications(stage); + std::for_each(inVector.begin(), inVector.end(), inOutNotify); + std::for_each(outVector.begin(), outVector.end(), inOutNotify); + std::for_each(uniformVector.begin(), uniformVector.end(), uniformNotify); + resolver->endNotifications(stage); + resolver->beginResolve(stage); + for (auto& var : inVector) { inOutResolve(var); } + std::for_each(inVector.begin(), inVector.end(), [&inVarMap](TVarLivePair p) { + auto at = inVarMap.find(p.second.symbol->getAccessName()); + if (at != inVarMap.end() && p.second.id == at->second.id) + at->second = p.second; + }); + for (auto& var : outVector) { inOutResolve(var); } + std::for_each(outVector.begin(), outVector.end(), [&outVarMap](TVarLivePair p) { + auto at = outVarMap.find(p.second.symbol->getAccessName()); + if (at != outVarMap.end() && p.second.id == at->second.id) + at->second = p.second; + }); + std::for_each(uniformVector.begin(), uniformVector.end(), uniformResolve); + std::for_each(uniformVector.begin(), uniformVector.end(), [&uniformVarMap](TVarLivePair p) { + auto at = uniformVarMap.find(p.second.symbol->getAccessName()); + if (at != uniformVarMap.end() && p.second.id == at->second.id) + at->second = p.second; + }); + resolver->endResolve(stage); + if (!hadError) { + TVarSetTraverser iter_iomap(intermediate, inVarMap, outVarMap, uniformVarMap); + root->traverse(&iter_iomap); + } + return !hadError; +} + +TGlslIoMapper::TGlslIoMapper() { + memset(inVarMaps, 0, sizeof(TVarLiveMap*) * EShLangCount); + memset(outVarMaps, 0, sizeof(TVarLiveMap*) * EShLangCount); + memset(uniformVarMap, 0, sizeof(TVarLiveMap*) * EShLangCount); + memset(intermediates, 0, sizeof(TIntermediate*) * EShLangCount); + profile = ENoProfile; + version = 0; + autoPushConstantMaxSize = 128; + autoPushConstantBlockPacking = ElpStd430; +} + +TGlslIoMapper::~TGlslIoMapper() { + for (size_t stage = 0; stage < EShLangCount; stage++) { + if (inVarMaps[stage] != nullptr) { + delete inVarMaps[stage]; + inVarMaps[stage] = nullptr; + } + if (outVarMaps[stage] != nullptr) { + delete outVarMaps[stage]; + outVarMaps[stage] = nullptr; + } + if (uniformVarMap[stage] != nullptr) { + delete uniformVarMap[stage]; + uniformVarMap[stage] = nullptr; + } + if (intermediates[stage] != nullptr) + intermediates[stage] = nullptr; + } +} + +// Map I/O variables to provided offsets, and make bindings for +// unbound but live variables. +// +// Returns false if the input is too malformed to do this. +bool TGlslIoMapper::addStage(EShLanguage stage, TIntermediate& intermediate, TInfoSink& infoSink, TIoMapResolver* resolver) { + bool somethingToDo = !intermediate.getResourceSetBinding().empty() || + intermediate.getAutoMapBindings() || + intermediate.getAutoMapLocations(); + + // Profile and version are use for symbol validate. + profile = intermediate.getProfile(); + version = intermediate.getVersion(); + + // Restrict the stricter condition to further check 'somethingToDo' only if 'somethingToDo' has not been set, reduce + // unnecessary or insignificant for-loop operation after 'somethingToDo' have been true. + for (int res = 0; (res < EResCount && !somethingToDo); ++res) { + somethingToDo = somethingToDo || (intermediate.getShiftBinding(TResourceType(res)) != 0) || + intermediate.hasShiftBindingForSet(TResourceType(res)); + } + if (! somethingToDo && resolver == nullptr) { + return true; + } + if (intermediate.getNumEntryPoints() != 1 || intermediate.isRecursive()) { + return false; + } + TIntermNode* root = intermediate.getTreeRoot(); + if (root == nullptr) { + return false; + } + // if no resolver is provided, use the default resolver with the given shifts and auto map settings + TDefaultGlslIoResolver defaultResolver(intermediate); +#ifdef ENABLE_HLSL + TDefaultHlslIoResolver defaultHlslResolver(intermediate); + if (resolver == nullptr) { + // TODO: use a passed in IO mapper for this + if (intermediate.usingHlslIoMapping()) + resolver = &defaultHlslResolver; + else + resolver = &defaultResolver; + } +#else + if (resolver == nullptr) { + resolver = &defaultResolver; + } +#endif + resolver->addStage(stage, intermediate); + inVarMaps[stage] = new TVarLiveMap(); outVarMaps[stage] = new TVarLiveMap(); uniformVarMap[stage] = new TVarLiveMap(); + TVarGatherTraverser iter_binding_all(intermediate, true, *inVarMaps[stage], *outVarMaps[stage], + *uniformVarMap[stage]); + TVarGatherTraverser iter_binding_live(intermediate, false, *inVarMaps[stage], *outVarMaps[stage], + *uniformVarMap[stage]); + root->traverse(&iter_binding_all); + iter_binding_live.pushFunction(intermediate.getEntryPointMangledName().c_str()); + while (! iter_binding_live.destinations.empty()) { + TIntermNode* destination = iter_binding_live.destinations.back(); + iter_binding_live.destinations.pop_back(); + destination->traverse(&iter_binding_live); + } + + TNotifyInOutAdaptor inOutNotify(stage, *resolver); + TNotifyUniformAdaptor uniformNotify(stage, *resolver); + // Resolve current stage input symbol location with previous stage output here, + // uniform symbol, ubo, ssbo and opaque symbols are per-program resource, + // will resolve uniform symbol location and ubo/ssbo/opaque binding in doMap() + resolver->beginNotifications(stage); + std::for_each(inVarMaps[stage]->begin(), inVarMaps[stage]->end(), inOutNotify); + std::for_each(outVarMaps[stage]->begin(), outVarMaps[stage]->end(), inOutNotify); + std::for_each(uniformVarMap[stage]->begin(), uniformVarMap[stage]->end(), uniformNotify); + resolver->endNotifications(stage); + TSlotCollector slotCollector(*resolver, infoSink); + resolver->beginCollect(stage); + std::for_each(inVarMaps[stage]->begin(), inVarMaps[stage]->end(), slotCollector); + std::for_each(outVarMaps[stage]->begin(), outVarMaps[stage]->end(), slotCollector); + std::for_each(uniformVarMap[stage]->begin(), uniformVarMap[stage]->end(), slotCollector); + resolver->endCollect(stage); + intermediates[stage] = &intermediate; + return !hadError; +} + +bool TGlslIoMapper::doMap(TIoMapResolver* resolver, TInfoSink& infoSink) { + resolver->endResolve(EShLangCount); + if (!hadError) { + //Resolve uniform location, ubo/ssbo/opaque bindings across stages + TResolverUniformAdaptor uniformResolve(EShLangCount, *resolver, uniformVarMap, infoSink, hadError); + TResolverInOutAdaptor inOutResolve(EShLangCount, *resolver, infoSink, hadError); + TSymbolValidater symbolValidater(*resolver, infoSink, inVarMaps, + outVarMaps, uniformVarMap, hadError, profile, version); + + TVarLiveVector inVectors[EShLangCount]; + TVarLiveVector outVectors[EShLangCount]; + TVarLiveVector uniformVector; + + resolver->beginResolve(EShLangCount); + for (int stage = EShLangVertex; stage < EShLangCount; stage++) { + if (inVarMaps[stage] != nullptr) { + inOutResolve.setStage(EShLanguage(stage)); + + // copy vars into a sorted list + std::for_each(inVarMaps[stage]->begin(), inVarMaps[stage]->end(), + [&inVectors, stage](TVarLivePair p) { inVectors[stage].push_back(p); }); + std::sort(inVectors[stage].begin(), inVectors[stage].end(), + [](const TVarLivePair& p1, const TVarLivePair& p2) -> bool { + return TVarEntryInfo::TOrderByPriority()(p1.second, p2.second); + }); + + std::for_each(outVarMaps[stage]->begin(), outVarMaps[stage]->end(), + [&outVectors, stage](TVarLivePair p) { outVectors[stage].push_back(p); }); + std::sort(outVectors[stage].begin(), outVectors[stage].end(), + [](const TVarLivePair& p1, const TVarLivePair& p2) -> bool { + return TVarEntryInfo::TOrderByPriority()(p1.second, p2.second); + }); + + for (auto& var : inVectors[stage]) { symbolValidater(var); } + for (auto& var : inVectors[stage]) { inOutResolve(var); } + for (auto& var : outVectors[stage]) { symbolValidater(var); } + for (auto& var : outVectors[stage]) { inOutResolve(var); } + + // copy results back into maps + std::for_each(inVectors[stage].begin(), inVectors[stage].end(), + [this, stage](TVarLivePair p) { + auto at = inVarMaps[stage]->find(p.first); + if (at != inVarMaps[stage]->end()) + at->second = p.second; + }); + + std::for_each(outVectors[stage].begin(), outVectors[stage].end(), + [this, stage](TVarLivePair p) { + auto at = outVarMaps[stage]->find(p.first); + if (at != outVarMaps[stage]->end()) + at->second = p.second; + }); + + } + if (uniformVarMap[stage] != nullptr) { + uniformResolve.setStage(EShLanguage(stage)); + for (auto& var : *(uniformVarMap[stage])) { uniformVector.push_back(var); } + } + } + std::sort(uniformVector.begin(), uniformVector.end(), [](const TVarLivePair& p1, const TVarLivePair& p2) -> bool { + return TVarEntryInfo::TOrderByPriorityAndLive()(p1.second, p2.second); + }); + for (auto& var : uniformVector) { symbolValidater(var); } + for (auto& var : uniformVector) { uniformResolve(var); } + std::sort(uniformVector.begin(), uniformVector.end(), [](const TVarLivePair& p1, const TVarLivePair& p2) -> bool { + return TVarEntryInfo::TOrderByPriority()(p1.second, p2.second); + }); + resolver->endResolve(EShLangCount); + if (autoPushConstantBlockName.length()) { + bool upgraded = false; + for (size_t stage = 0; stage < EShLangCount; stage++) { + if (intermediates[stage] != nullptr) { + TVarLiveMap** pUniformVarMap = uniformResolve.uniformVarMap; + auto at = pUniformVarMap[stage]->find(autoPushConstantBlockName); + if (at == pUniformVarMap[stage]->end()) + continue; + TQualifier& qualifier = at->second.symbol->getQualifier(); + if (!qualifier.isUniform()) + continue; + TType& t = at->second.symbol->getWritableType(); + int size, stride; + TIntermediate::getBaseAlignment(t, size, stride, autoPushConstantBlockPacking, + qualifier.layoutMatrix == ElmRowMajor); + if (size <= int(autoPushConstantMaxSize)) { + qualifier.setBlockStorage(EbsPushConstant); + qualifier.layoutPacking = autoPushConstantBlockPacking; + // Push constants don't have set/binding etc. decorations, remove those. + qualifier.layoutSet = TQualifier::layoutSetEnd; + at->second.clearNewAssignments(); + + upgraded = true; + } + } + } + // If it's been upgraded to push_constant, then set the flag so when its traversed + // in the next for loop, all references to this symbol will get their flag changed. + // so it doesn't get a set/binding assigned to it. + if (upgraded) { + std::for_each(uniformVector.begin(), uniformVector.end(), + [this](TVarLivePair& p) { + if (p.first == autoPushConstantBlockName) { + p.second.upgradedToPushConstantPacking = autoPushConstantBlockPacking; + p.second.newSet = TQualifier::layoutSetEnd; + } + }); + } + } + for (size_t stage = 0; stage < EShLangCount; stage++) { + if (intermediates[stage] != nullptr) { + // traverse each stage, set new location to each input/output and unifom symbol, set new binding to + // ubo, ssbo and opaque symbols. Assign push_constant upgrades as well. + TVarLiveMap** pUniformVarMap = uniformResolve.uniformVarMap; + std::for_each(uniformVector.begin(), uniformVector.end(), [pUniformVarMap, stage](TVarLivePair p) { + auto at = pUniformVarMap[stage]->find(p.second.symbol->getAccessName()); + if (at != pUniformVarMap[stage]->end() && at->second.id == p.second.id){ + if (p.second.upgradedToPushConstantPacking != ElpNone) { + at->second.upgradedToPushConstantPacking = p.second.upgradedToPushConstantPacking; + } else { + int resolvedBinding = at->second.newBinding; + at->second = p.second; + if (resolvedBinding > 0) + at->second.newBinding = resolvedBinding; + } + } + }); + TVarSetTraverser iter_iomap(*intermediates[stage], *inVarMaps[stage], *outVarMaps[stage], + *uniformResolve.uniformVarMap[stage]); + intermediates[stage]->getTreeRoot()->traverse(&iter_iomap); + } + } + return !hadError; + } else { + return false; + } +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.h new file mode 100644 index 0000000000..d356f886c7 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.h @@ -0,0 +1,243 @@ +// +// Copyright (C) 2016 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef _IOMAPPER_INCLUDED +#define _IOMAPPER_INCLUDED + +#include +#include +#include +// +// A reflection database and its interface, consistent with the OpenGL API reflection queries. +// + +namespace QtShaderTools { +class TInfoSink; + +namespace glslang { + +class TIntermediate; +struct TVarEntryInfo; +// Base class for shared TIoMapResolver services, used by several derivations. +struct TDefaultIoResolverBase : public glslang::TIoMapResolver { +public: + TDefaultIoResolverBase(const TIntermediate& intermediate); + typedef std::vector TSlotSet; + typedef std::unordered_map TSlotSetMap; + + // grow the reflection stage by stage + void notifyBinding(EShLanguage, TVarEntryInfo& /*ent*/) override {} + void notifyInOut(EShLanguage, TVarEntryInfo& /*ent*/) override {} + void beginNotifications(EShLanguage) override {} + void endNotifications(EShLanguage) override {} + void beginResolve(EShLanguage) override {} + void endResolve(EShLanguage) override {} + void beginCollect(EShLanguage) override {} + void endCollect(EShLanguage) override {} + void reserverResourceSlot(TVarEntryInfo& /*ent*/, TInfoSink& /*infoSink*/) override {} + void reserverStorageSlot(TVarEntryInfo& /*ent*/, TInfoSink& /*infoSink*/) override {} + int getBaseBinding(EShLanguage stage, TResourceType res, unsigned int set) const; + const std::vector& getResourceSetBinding(EShLanguage stage) const; + virtual TResourceType getResourceType(const glslang::TType& type) = 0; + bool doAutoBindingMapping() const; + bool doAutoLocationMapping() const; + TSlotSet::iterator findSlot(int set, int slot); + bool checkEmpty(int set, int slot); + bool validateInOut(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; } + int reserveSlot(int set, int slot, int size = 1); + int getFreeSlot(int set, int base, int size = 1); + int resolveSet(EShLanguage /*stage*/, TVarEntryInfo& ent) override; + int resolveUniformLocation(EShLanguage /*stage*/, TVarEntryInfo& ent) override; + int resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) override; + int resolveInOutComponent(EShLanguage /*stage*/, TVarEntryInfo& ent) override; + int resolveInOutIndex(EShLanguage /*stage*/, TVarEntryInfo& ent) override; + void addStage(EShLanguage stage, TIntermediate& stageIntermediate) override { + if (stage < EShLangCount) { + stageMask[stage] = true; + stageIntermediates[stage] = &stageIntermediate; + } + } + uint32_t computeTypeLocationSize(const TType& type, EShLanguage stage); + + TSlotSetMap slots; + bool hasError = false; + +protected: + TDefaultIoResolverBase(TDefaultIoResolverBase&); + TDefaultIoResolverBase& operator=(TDefaultIoResolverBase&); + const TIntermediate& referenceIntermediate; + int nextUniformLocation; + int nextInputLocation; + int nextOutputLocation; + bool stageMask[EShLangCount + 1]; + const TIntermediate* stageIntermediates[EShLangCount]; + + // Return descriptor set specific base if there is one, and the generic base otherwise. + int selectBaseBinding(int base, int descriptorSetBase) const { + return descriptorSetBase != -1 ? descriptorSetBase : base; + } + + static int getLayoutSet(const glslang::TType& type) { + if (type.getQualifier().hasSet()) + return type.getQualifier().layoutSet; + else + return 0; + } + + static bool isSamplerType(const glslang::TType& type) { + return type.getBasicType() == glslang::EbtSampler && type.getSampler().isPureSampler(); + } + + static bool isTextureType(const glslang::TType& type) { + return (type.getBasicType() == glslang::EbtSampler && !type.getSampler().isCombined() && + (type.getSampler().isTexture() || type.getSampler().isSubpass())); + } + + static bool isUboType(const glslang::TType& type) { + return type.getQualifier().storage == EvqUniform && type.isStruct(); + } + + static bool isImageType(const glslang::TType& type) { + return type.getBasicType() == glslang::EbtSampler && type.getSampler().isImage(); + } + + static bool isSsboType(const glslang::TType& type) { + return type.getQualifier().storage == EvqBuffer; + } + + static bool isCombinedSamplerType(const glslang::TType& type) { + return type.getBasicType() == glslang::EbtSampler && type.getSampler().isCombined(); + } + + static bool isAsType(const glslang::TType& type) { + return type.getBasicType() == glslang::EbtAccStruct; + } + + static bool isTensorType(const glslang::TType& type) { + return type.isTensorARM(); + } + + static bool isValidGlslType(const glslang::TType& type) { + // at most one must be true + return (isSamplerType(type) + isTextureType(type) + isUboType(type) + isImageType(type) + + isSsboType(type) + isCombinedSamplerType(type) + isAsType(type) + isTensorType(type)) <= 1; + } + + // Return true if this is a SRV (shader resource view) type: + static bool isSrvType(const glslang::TType& type) { + return isTextureType(type) || type.getQualifier().storage == EvqBuffer; + } + + // Return true if this is a UAV (unordered access view) type: + static bool isUavType(const glslang::TType& type) { + if (type.getQualifier().isReadOnly()) + return false; + return (type.getBasicType() == glslang::EbtSampler && type.getSampler().isImage()) || + (type.getQualifier().storage == EvqBuffer); + } +}; + +// Default I/O resolver for OpenGL +struct TDefaultGlslIoResolver : public TDefaultIoResolverBase { +public: + typedef std::map TVarSlotMap; // + typedef std::map TSlotMap; // + TDefaultGlslIoResolver(const TIntermediate& intermediate); + bool validateBinding(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; } + TResourceType getResourceType(const glslang::TType& type) override; + int resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) override; + int resolveUniformLocation(EShLanguage /*stage*/, TVarEntryInfo& ent) override; + int resolveBinding(EShLanguage /*stage*/, TVarEntryInfo& ent) override; + void beginResolve(EShLanguage /*stage*/) override; + void endResolve(EShLanguage stage) override; + void beginCollect(EShLanguage) override; + void endCollect(EShLanguage) override; + void reserverStorageSlot(TVarEntryInfo& ent, TInfoSink& infoSink) override; + void reserverResourceSlot(TVarEntryInfo& ent, TInfoSink& infoSink) override; + // in/out symbol and uniform symbol are stored in the same resourceSlotMap, the storage key is used to identify each type of symbol. + // We use stage and storage qualifier to construct a storage key. it can help us identify the same storage resource used in different stage. + // if a resource is a program resource and we don't need know it usage stage, we can use same stage to build storage key. + // Note: both stage and type must less then 0xffff. + int buildStorageKey(EShLanguage stage, TStorageQualifier type) { + assert(static_cast(stage) <= 0x0000ffff && static_cast(type) <= 0x0000ffff); + return (stage << 16) | type; + } + +protected: + // Use for mark pre stage, to get more interface symbol information. + EShLanguage preStage; + // Use for mark current shader stage for resolver + EShLanguage currentStage; + // Slot map for storage resource(location of uniform and interface symbol) It's a program share slot + TSlotMap resourceSlotMap; + // Slot map for other resource(image, ubo, ssbo), It's a program share slot. + TSlotMap storageSlotMap; +}; + +typedef std::map TVarLiveMap; + +// I/O mapper for GLSL +class TGlslIoMapper : public TIoMapper { +public: + TGlslIoMapper(); + virtual ~TGlslIoMapper(); + // If set, the uniform block with the given name will be changed to be backed by + // push_constant if it's size is <= maxSize + bool setAutoPushConstantBlock(const char* name, unsigned int maxSize, TLayoutPacking packing) override { + autoPushConstantBlockName = name; + autoPushConstantMaxSize = maxSize; + autoPushConstantBlockPacking = packing; + return true; + } + // grow the reflection stage by stage + bool addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*) override; + bool doMap(TIoMapResolver*, TInfoSink&) override; + TIntermediate* intermediates[EShLangCount]; + bool hadError = false; + EProfile profile; + int version; + +private: + TString autoPushConstantBlockName; + unsigned int autoPushConstantMaxSize; + TLayoutPacking autoPushConstantBlockPacking; + TVarLiveMap *inVarMaps[EShLangCount], *outVarMaps[EShLangCount], + *uniformVarMap[EShLangCount]; +}; + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // _IOMAPPER_INCLUDED diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/limits.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/limits.cpp new file mode 100644 index 0000000000..aba6bdf853 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/limits.cpp @@ -0,0 +1,200 @@ +// +// Copyright (C) 2013 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// Do sub tree walks for +// 1) inductive loop bodies to see if the inductive variable is modified +// 2) array-index expressions to see if they are "constant-index-expression" +// +// These are per Appendix A of ES 2.0: +// +// "Within the body of the loop, the loop index is not statically assigned to nor is it used as the +// argument to a function out or inout parameter." +// +// "The following are constant-index-expressions: +// - Constant expressions +// - Loop indices as defined in section 4 +// - Expressions composed of both of the above" +// +// N.B.: assuming the last rule excludes function calls +// + +#include "ParseHelper.h" + +namespace QtShaderTools { +namespace glslang { + +// +// The inductive loop-body traverser. +// +// Just look at things that might modify the loop index. +// + +class TInductiveTraverser : public TIntermTraverser { +public: + TInductiveTraverser(long long id, TSymbolTable& st) + : loopId(id), symbolTable(st), bad(false) { } + + virtual bool visitBinary(TVisit, TIntermBinary* node); + virtual bool visitUnary(TVisit, TIntermUnary* node); + virtual bool visitAggregate(TVisit, TIntermAggregate* node); + + long long loopId; // unique ID of the symbol that's the loop inductive variable + TSymbolTable& symbolTable; + bool bad; + TSourceLoc badLoc; + +protected: + TInductiveTraverser(TInductiveTraverser&); + TInductiveTraverser& operator=(TInductiveTraverser&); +}; + +// check binary operations for those modifying the loop index +bool TInductiveTraverser::visitBinary(TVisit /* visit */, TIntermBinary* node) +{ + if (node->modifiesState() && node->getLeft()->getAsSymbolNode() && + node->getLeft()->getAsSymbolNode()->getId() == loopId) { + bad = true; + badLoc = node->getLoc(); + } + + return true; +} + +// check unary operations for those modifying the loop index +bool TInductiveTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) +{ + if (node->modifiesState() && node->getOperand()->getAsSymbolNode() && + node->getOperand()->getAsSymbolNode()->getId() == loopId) { + bad = true; + badLoc = node->getLoc(); + } + + return true; +} + +// check function calls for arguments modifying the loop index +bool TInductiveTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node) +{ + if (node->getOp() == EOpFunctionCall) { + // see if an out or inout argument is the loop index + const TIntermSequence& args = node->getSequence(); + for (int i = 0; i < (int)args.size(); ++i) { + if (args[i]->getAsSymbolNode() && args[i]->getAsSymbolNode()->getId() == loopId) { + TSymbol* function = symbolTable.find(node->getName()); + const TType* type = (*function->getAsFunction())[i].type; + if (type->getQualifier().storage == EvqOut || + type->getQualifier().storage == EvqInOut) { + bad = true; + badLoc = node->getLoc(); + } + } + } + } + + return true; +} + +// +// External function to call for loop check. +// +void TParseContext::inductiveLoopBodyCheck(TIntermNode* body, long long loopId, TSymbolTable& symbolTable) +{ + TInductiveTraverser it(loopId, symbolTable); + + if (body == nullptr) + return; + + body->traverse(&it); + + if (it.bad) + error(it.badLoc, "inductive loop index modified", "limitations", ""); +} + +// +// The "constant-index-expression" tranverser. +// +// Just look at things that can form an index. +// + +class TIndexTraverser : public TIntermTraverser { +public: + TIndexTraverser(const TIdSetType& ids) : inductiveLoopIds(ids), bad(false) { } + virtual void visitSymbol(TIntermSymbol* symbol); + virtual bool visitAggregate(TVisit, TIntermAggregate* node); + const TIdSetType& inductiveLoopIds; + bool bad; + TSourceLoc badLoc; + +protected: + TIndexTraverser(TIndexTraverser&); + TIndexTraverser& operator=(TIndexTraverser&); +}; + +// make sure symbols are inductive-loop indexes +void TIndexTraverser::visitSymbol(TIntermSymbol* symbol) +{ + if (inductiveLoopIds.find(symbol->getId()) == inductiveLoopIds.end()) { + bad = true; + badLoc = symbol->getLoc(); + } +} + +// check for function calls, assuming they are bad; spec. doesn't really say +bool TIndexTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node) +{ + if (node->getOp() == EOpFunctionCall) { + bad = true; + badLoc = node->getLoc(); + } + + return true; +} + +// +// External function to call for loop check. +// +void TParseContext::constantIndexExpressionCheck(TIntermNode* index) +{ + TIndexTraverser it(inductiveLoopIds); + + index->traverse(&it); + + if (it.bad) + error(it.badLoc, "Non-constant-index-expression", "limitations", ""); +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp new file mode 100644 index 0000000000..15a1005da9 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp @@ -0,0 +1,2768 @@ +// +// Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. +// Copyright (C) 2015-2018 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// Do link-time merging and validation of intermediate representations. +// +// Basic model is that during compilation, each compilation unit (shader) is +// compiled into one TIntermediate instance. Then, at link time, multiple +// units for the same stage can be merged together, which can generate errors. +// Then, after all merging, a single instance of TIntermediate represents +// the whole stage. A final error check can be done on the resulting stage, +// even if no merging was done (i.e., the stage was only one compilation unit). +// + +#include "glslang/Public/ShaderLang.h" +#include "localintermediate.h" +#include "../Include/InfoSink.h" +#include "SymbolTable.h" +#include "LiveTraverser.h" + +namespace QtShaderTools { +namespace glslang { + +// +// Link-time error emitter. +// +void TIntermediate::error(TInfoSink& infoSink, const TSourceLoc* loc, EShMessages messages, const char* message, + EShLanguage unitStage) +{ + infoSink.info.prefix(EPrefixError); + if (loc) + infoSink.info.location(*loc, messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); + if (unitStage == EShLangCount) + infoSink.info << "Linking " << StageName(language) << " stage: " << message << "\n"; + else if (language == EShLangCount) + infoSink.info << "Linking " << StageName(unitStage) << " stage: " << message << "\n"; + else + infoSink.info << "Linking " << StageName(language) << " and " << StageName(unitStage) << " stages: " << message << "\n"; + + ++numErrors; +} + +// Link-time warning. +void TIntermediate::warn(TInfoSink& infoSink, const TSourceLoc* loc, EShMessages messages, const char* message, + EShLanguage unitStage) +{ + infoSink.info.prefix(EPrefixWarning); + if (loc) + infoSink.info.location(*loc, messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); + if (unitStage == EShLangCount) + infoSink.info << "Linking " << StageName(language) << " stage: " << message << "\n"; + else if (language == EShLangCount) + infoSink.info << "Linking " << StageName(unitStage) << " stage: " << message << "\n"; + else + infoSink.info << "Linking " << StageName(language) << " and " << StageName(unitStage) << " stages: " << message << "\n"; +} + +// TODO: 4.4 offset/align: "Two blocks linked together in the same program with the same block +// name must have the exact same set of members qualified with offset and their integral-constant +// expression values must be the same, or a link-time error results." + +// +// Merge the information from 'unit' into 'this' +// +void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit) +{ + mergeCallGraphs(infoSink, unit); + mergeModes(infoSink, unit); + mergeTrees(infoSink, unit); +} + +// +// check that link objects between stages +// +void TIntermediate::mergeUniformObjects(TInfoSink& infoSink, TIntermediate& unit) { + if (unit.treeRoot == nullptr || treeRoot == nullptr) + return; + + // Get the linker-object lists + TIntermSequence& linkerObjects = findLinkerObjects()->getSequence(); + TIntermSequence unitLinkerObjects = unit.findLinkerObjects()->getSequence(); + + // filter unitLinkerObjects to only contain uniforms + auto end = std::remove_if(unitLinkerObjects.begin(), unitLinkerObjects.end(), + [](TIntermNode* node) {return node->getAsSymbolNode()->getQualifier().storage != EvqUniform && + node->getAsSymbolNode()->getQualifier().storage != EvqBuffer; }); + unitLinkerObjects.resize(end - unitLinkerObjects.begin()); + + // merge uniforms and do error checking + bool mergeExistingOnly = false; + mergeGlobalUniformBlocks(infoSink, unit, mergeExistingOnly); + mergeLinkerObjects(infoSink, linkerObjects, unitLinkerObjects, unit.getStage()); +} + +static inline bool isSameInterface(TIntermSymbol* symbol, TIntermSymbol* unitSymbol) { + EShLanguage stage = symbol->getStage(); + EShLanguage unitStage = unitSymbol->getStage(); + return // 1) same stage and same shader interface + (stage == unitStage && symbol->getType().getShaderInterface() == unitSymbol->getType().getShaderInterface()) || + // 2) accross stages and both are uniform or buffer + (symbol->getQualifier().storage == EvqUniform && unitSymbol->getQualifier().storage == EvqUniform) || + (symbol->getQualifier().storage == EvqBuffer && unitSymbol->getQualifier().storage == EvqBuffer) || + // 3) in/out matched across stage boundary + (stage < unitStage && symbol->getQualifier().storage == EvqVaryingOut && unitSymbol->getQualifier().storage == EvqVaryingIn) || + (unitStage < stage && symbol->getQualifier().storage == EvqVaryingIn && unitSymbol->getQualifier().storage == EvqVaryingOut); +} + +static bool isSameSymbol(TIntermSymbol* symbol1, TIntermSymbol* symbol2) { + // If they are both blocks in the same shader interface, + // match by the block-name, not the identifier name. + if (symbol1->getType().getBasicType() == EbtBlock && symbol2->getType().getBasicType() == EbtBlock) { + if (isSameInterface(symbol1, symbol2)) { + return symbol1->getType().getTypeName() == symbol2->getType().getTypeName(); + } + } else if (symbol1->getName() == symbol2->getName()) + return true; + return false; +} + +// +// merge implicit array sizes for uniform/buffer objects +// +void TIntermediate::mergeImplicitArraySizes(TInfoSink&, TIntermediate& unit) { + if (unit.treeRoot == nullptr || treeRoot == nullptr) + return; + + // Get the linker-object lists + TIntermSequence& linkerObjects = findLinkerObjects()->getSequence(); + TIntermSequence unitLinkerObjects = unit.findLinkerObjects()->getSequence(); + + // filter unitLinkerObjects to only contain uniforms + auto end = std::remove_if(unitLinkerObjects.begin(), unitLinkerObjects.end(), + [](TIntermNode* node) {return node->getAsSymbolNode()->getQualifier().storage != EvqUniform && + node->getAsSymbolNode()->getQualifier().storage != EvqBuffer; }); + unitLinkerObjects.resize(end - unitLinkerObjects.begin()); + + std::size_t initialNumLinkerObjects = linkerObjects.size(); + for (unsigned int unitLinkObj = 0; unitLinkObj < unitLinkerObjects.size(); ++unitLinkObj) { + for (std::size_t linkObj = 0; linkObj < initialNumLinkerObjects; ++linkObj) { + TIntermSymbol* symbol = linkerObjects[linkObj]->getAsSymbolNode(); + TIntermSymbol* unitSymbol = unitLinkerObjects[unitLinkObj]->getAsSymbolNode(); + assert(symbol && unitSymbol); + + if (isSameSymbol(symbol, unitSymbol)) { + // Update implicit array sizes + mergeImplicitArraySizes(symbol->getWritableType(), unitSymbol->getType()); + } + } + } +} + +// +// do error checking on the shader boundary in / out vars +// +void TIntermediate::checkStageIO(TInfoSink& infoSink, TIntermediate& unit, EShMessages messages) { + if (unit.treeRoot == nullptr || treeRoot == nullptr) + return; + + // Get copies of the linker-object lists + TIntermSequence linkerObjects = findLinkerObjects()->getSequence(); + TIntermSequence unitLinkerObjects = unit.findLinkerObjects()->getSequence(); + + // filter linkerObjects to only contain out variables + auto end = std::remove_if(linkerObjects.begin(), linkerObjects.end(), + [](TIntermNode* node) {return node->getAsSymbolNode()->getQualifier().storage != EvqVaryingOut; }); + linkerObjects.resize(end - linkerObjects.begin()); + + // filter unitLinkerObjects to only contain in variables + auto unitEnd = std::remove_if(unitLinkerObjects.begin(), unitLinkerObjects.end(), + [](TIntermNode* node) {return node->getAsSymbolNode()->getQualifier().storage != EvqVaryingIn; }); + unitLinkerObjects.resize(unitEnd - unitLinkerObjects.begin()); + + // do matching and error checking + mergeLinkerObjects(infoSink, linkerObjects, unitLinkerObjects, unit.getStage()); + + if ((messages & EShMsgValidateCrossStageIO) == 0) + return; + + // The OpenGL Shading Language, Version 4.60.8 (https://registry.khronos.org/OpenGL/specs/gl/GLSLangSpec.4.60.pdf) + // 4.3.4 Input Variables + // Only the input variables that are statically read need to be written by the previous stage; it is + // allowed to have superfluous declarations of input variables. This is shown in the following table. + // +------------------------------------------------------------------------------------------------+ + // | Treatment of Mismatched Input | Consuming Shader (input variables) | + // | Variables |---------------------------------------------------------| + // | | No | Declared but no | Declared and Static Use | + // | | Declaration | Static Use | | + // |--------------------------------------+-------------+-----------------+-------------------------| + // | Generating Shader | No Declaration | Allowed | Allowed | Link-Time Error | + // | (output variables) |-----------------+-------------+-----------------+-------------------------| + // | | Declared but no | Allowed | Allowed | Allowed (values are | + // | | Static Use | | | undefined) | + // | |-----------------+-------------+-----------------+-------------------------| + // | | Declared and | Allowed | Allowed | Allowed (values are | + // | | Static Use | | | potentially undefined) | + // +------------------------------------------------------------------------------------------------+ + // Consumption errors are based on static use only. Compilation may generate a warning, but not an + // error, for any dynamic use the compiler can deduce that might cause consumption of undefined values. + + // TODO: implement support for geometry passthrough + if (getGeoPassthroughEXT()) { + unit.warn(infoSink, "GL_NV_geometry_shader_passthrough is enabled, skipping cross-stage IO validation", + getStage()); + return; + } + + class TIOTraverser : public TLiveTraverser { + public: + TIOTraverser(TIntermediate& i, bool all, TIntermSequence& sequence, TStorageQualifier storage) + : TLiveTraverser(i, all, true, false, false), sequence(sequence), storage(storage) + { + } + + virtual void visitSymbol(TIntermSymbol* symbol) + { + if (symbol->getQualifier().storage == storage) + sequence.push_back(symbol); + } + + private: + TIntermSequence& sequence; + TStorageQualifier storage; + }; + + // live symbols only + TIntermSequence unitLiveInputs; + + TIOTraverser unitTraverser(unit, false, unitLiveInputs, EvqVaryingIn); + unitTraverser.pushFunction(unit.getEntryPointMangledName().c_str()); + while (! unitTraverser.destinations.empty()) { + TIntermNode* destination = unitTraverser.destinations.back(); + unitTraverser.destinations.pop_back(); + destination->traverse(&unitTraverser); + } + + // all symbols + TIntermSequence allOutputs; + + TIOTraverser traverser(*this, true, allOutputs, EvqVaryingOut); + getTreeRoot()->traverse(&traverser); + + std::unordered_set outputLocations; + for (auto& output : allOutputs) { + if (output->getAsSymbolNode()->getBasicType() == EbtBlock) { + int lastLocation = -1; + if (output->getAsSymbolNode()->getQualifier().hasLocation()) + lastLocation = output->getAsSymbolNode()->getQualifier().layoutLocation; + const TTypeList* members = output->getAsSymbolNode()->getType().getStruct(); + for (auto& member : *members) { + int location = lastLocation; + if (member.type->getQualifier().hasLocation()) + location = member.type->getQualifier().layoutLocation; + if (location != -1) { + int locationSize = TIntermediate::computeTypeLocationSize(*member.type, getStage()); + for (int i = 0; i < locationSize; ++i) + outputLocations.insert(location + i); + lastLocation = location + locationSize; + } + } + } else { + int locationSize = TIntermediate::computeTypeLocationSize(output->getAsSymbolNode()->getType(), getStage()); + for (int i = 0; i < locationSize; ++i) + outputLocations.insert(output->getAsSymbolNode()->getQualifier().layoutLocation + i); + } + } + + // remove unitStage inputs with matching outputs in the current stage + auto liveEnd = std::remove_if( + unitLiveInputs.begin(), unitLiveInputs.end(), [this, &allOutputs, &outputLocations](TIntermNode* input) { + // ignore built-ins + if (input->getAsSymbolNode()->getAccessName().compare(0, 3, "gl_") == 0) + return true; + // try to match by location + if (input->getAsSymbolNode()->getQualifier().hasLocation() && + outputLocations.find(input->getAsSymbolNode()->getQualifier().layoutLocation) != outputLocations.end()) + return true; + if (input->getAsSymbolNode()->getBasicType() == EbtBlock) { + int lastLocation = -1; + if (input->getAsSymbolNode()->getQualifier().hasLocation()) + lastLocation = input->getAsSymbolNode()->getQualifier().layoutLocation; + const TTypeList* members = input->getAsSymbolNode()->getType().getStruct(); + for (auto& member : *members) { + int location = lastLocation; + if (member.type->getQualifier().hasLocation()) + location = member.type->getQualifier().layoutLocation; + if (location != -1) { + int locationSize = TIntermediate::computeTypeLocationSize(*member.type, getStage()); + for (int i = 0; i < locationSize; ++i) + if (outputLocations.find(location + i) != outputLocations.end()) + return true; + lastLocation = location + locationSize; + } + } + } + // otherwise, try to match by name + return std::any_of(allOutputs.begin(), allOutputs.end(), [input](TIntermNode* output) { + return output->getAsSymbolNode()->getAccessName() == input->getAsSymbolNode()->getAccessName(); + }); + }); + unitLiveInputs.resize(liveEnd - unitLiveInputs.begin()); + + // check remaining loose unitStage inputs for a matching output block member + liveEnd = std::remove_if(unitLiveInputs.begin(), unitLiveInputs.end(), [&allOutputs](TIntermNode* input) { + return std::any_of(allOutputs.begin(), allOutputs.end(), [input](TIntermNode* output) { + if (output->getAsSymbolNode()->getBasicType() != EbtBlock) + return false; + const TTypeList* members = output->getAsSymbolNode()->getType().getStruct(); + return std::any_of(members->begin(), members->end(), [input](TTypeLoc type) { + return type.type->getFieldName() == input->getAsSymbolNode()->getName(); + }); + }); + }); + unitLiveInputs.resize(liveEnd - unitLiveInputs.begin()); + + // finally, check remaining unitStage block inputs for a matching loose output + liveEnd = std::remove_if( + unitLiveInputs.begin(), unitLiveInputs.end(), [&allOutputs](TIntermNode* input) { + if (input->getAsSymbolNode()->getBasicType() != EbtBlock) + return false; + // liveness isn't tracked per member so finding any one live member is the best we can do + const TTypeList* members = input->getAsSymbolNode()->getType().getStruct(); + return std::any_of(members->begin(), members->end(), [allOutputs](TTypeLoc type) { + return std::any_of(allOutputs.begin(), allOutputs.end(), [&type](TIntermNode* output) { + return type.type->getFieldName() == output->getAsSymbolNode()->getName(); + }); + }); + }); + unitLiveInputs.resize(liveEnd - unitLiveInputs.begin()); + + // any remaining unitStage inputs have no matching output + std::for_each(unitLiveInputs.begin(), unitLiveInputs.end(), [&](TIntermNode* input) { + unit.error(infoSink, &input->getLoc(), messages, + "Preceding stage has no matching declaration for statically used input:", getStage()); + infoSink.info << " " + << input->getAsSymbolNode()->getType().getCompleteString( + true, true, false, true, input->getAsSymbolNode()->getAccessName()) + << "\n"; + }); + + // TODO: warn about statically read inputs with outputs declared but not written to +} + +void TIntermediate::optimizeStageIO(TInfoSink&, TIntermediate& unit) +{ + // don't do any input/output demotion on compute, raytracing, or task/mesh stages + // TODO: support task/mesh + if (getStage() > EShLangFragment || unit.getStage() > EShLangFragment) { + return; + } + + class TIOTraverser : public TLiveTraverser { + public: + TIOTraverser(TIntermediate& i, bool all, TIntermSequence& sequence, TStorageQualifier storage) + : TLiveTraverser(i, all, true, false, false), sequence(sequence), storage(storage) + { + } + + virtual void visitSymbol(TIntermSymbol* symbol) + { + if (symbol->getQualifier().storage == storage) { + sequence.push_back(symbol); + } + } + + private: + TIntermSequence& sequence; + TStorageQualifier storage; + }; + + // live symbols only + TIntermSequence unitLiveInputs; + + TIOTraverser unitTraverser(unit, false, unitLiveInputs, EvqVaryingIn); + unitTraverser.pushFunction(unit.getEntryPointMangledName().c_str()); + while (! unitTraverser.destinations.empty()) { + TIntermNode* destination = unitTraverser.destinations.back(); + unitTraverser.destinations.pop_back(); + destination->traverse(&unitTraverser); + } + + TIntermSequence allOutputs; + TIntermSequence unitAllInputs; + + TIOTraverser allTraverser(*this, true, allOutputs, EvqVaryingOut); + getTreeRoot()->traverse(&allTraverser); + + TIOTraverser unitAllTraverser(unit, true, unitAllInputs, EvqVaryingIn); + unit.getTreeRoot()->traverse(&unitAllTraverser); + + // find outputs not consumed by the next stage + std::for_each(allOutputs.begin(), allOutputs.end(), [&unitLiveInputs, &unitAllInputs](TIntermNode* output) { + // don't do anything to builtins + if (output->getAsSymbolNode()->getAccessName().compare(0, 3, "gl_") == 0) + return; + + // don't demote block outputs (for now) + if (output->getAsSymbolNode()->getBasicType() == EbtBlock) + return; + + // check if the (loose) output has a matching loose input + auto isMatchingInput = [output](TIntermNode* input) { + return output->getAsSymbolNode()->getAccessName() == input->getAsSymbolNode()->getAccessName(); + }; + + // check if the (loose) output has a matching block member input + auto isMatchingInputBlockMember = [output](TIntermNode* input) { + // ignore loose inputs + if (input->getAsSymbolNode()->getBasicType() != EbtBlock) + return false; + + // don't demote loose outputs with matching input block members + auto isMatchingBlockMember = [output](TTypeLoc type) { + return type.type->getFieldName() == output->getAsSymbolNode()->getName(); + }; + const TTypeList* members = input->getAsSymbolNode()->getType().getStruct(); + return std::any_of(members->begin(), members->end(), isMatchingBlockMember); + }; + + // determine if the input/output pair should be demoted + // do the faster (and more likely) loose-loose check first + if (std::none_of(unitLiveInputs.begin(), unitLiveInputs.end(), isMatchingInput) && + std::none_of(unitAllInputs.begin(), unitAllInputs.end(), isMatchingInputBlockMember)) { + // demote any input matching the output + auto demoteMatchingInputs = [output](TIntermNode* input) { + if (output->getAsSymbolNode()->getAccessName() == input->getAsSymbolNode()->getAccessName()) { + // demote input to a plain variable + TIntermSymbol* symbol = input->getAsSymbolNode(); + symbol->getQualifier().storage = EvqGlobal; + symbol->getQualifier().clearInterstage(); + symbol->getQualifier().clearLayout(); + } + }; + + // demote all matching outputs to a plain variable + TIntermSymbol* symbol = output->getAsSymbolNode(); + symbol->getQualifier().storage = EvqGlobal; + symbol->getQualifier().clearInterstage(); + symbol->getQualifier().clearLayout(); + std::for_each(unitAllInputs.begin(), unitAllInputs.end(), demoteMatchingInputs); + } + }); +} + +void TIntermediate::mergeCallGraphs(TInfoSink& infoSink, TIntermediate& unit) +{ + if (unit.getNumEntryPoints() > 0) { + if (getNumEntryPoints() > 0) + error(infoSink, "can't handle multiple entry points per stage"); + else { + entryPointName = unit.getEntryPointName(); + entryPointMangledName = unit.getEntryPointMangledName(); + } + } + numEntryPoints += unit.getNumEntryPoints(); + + callGraph.insert(callGraph.end(), unit.callGraph.begin(), unit.callGraph.end()); +} + +#define MERGE_MAX(member) member = std::max(member, unit.member) +#define MERGE_TRUE(member) if (unit.member) member = unit.member; + +void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit) +{ + if (language != unit.language) + error(infoSink, "stages must match when linking into a single stage"); + + if (getSource() == EShSourceNone) + setSource(unit.getSource()); + if (getSource() != unit.getSource()) + error(infoSink, "can't link compilation units from different source languages"); + + if (treeRoot == nullptr) { + profile = unit.profile; + version = unit.version; + requestedExtensions = unit.requestedExtensions; + } else { + if ((isEsProfile()) != (unit.isEsProfile())) + error(infoSink, "Cannot cross link ES and desktop profiles"); + else if (unit.profile == ECompatibilityProfile) + profile = ECompatibilityProfile; + version = std::max(version, unit.version); + requestedExtensions.insert(unit.requestedExtensions.begin(), unit.requestedExtensions.end()); + } + + MERGE_MAX(spvVersion.spv); + MERGE_MAX(spvVersion.vulkanGlsl); + MERGE_MAX(spvVersion.vulkan); + MERGE_MAX(spvVersion.openGl); + MERGE_TRUE(spvVersion.vulkanRelaxed); + + numErrors += unit.getNumErrors(); + // Only one push_constant is allowed, mergeLinkerObjects() will ensure the push_constant + // is the same for all units. + if (numPushConstants > 1 || unit.numPushConstants > 1) + error(infoSink, "Only one push_constant block is allowed per stage"); + numPushConstants = std::min(numPushConstants + unit.numPushConstants, 1); + + if (unit.invocations != TQualifier::layoutNotSet) { + if (invocations == TQualifier::layoutNotSet) + invocations = unit.invocations; + else if (invocations != unit.invocations) + error(infoSink, "number of invocations must match between compilation units"); + } + + // The GLSL specification requires that at least one compilation unit + // must declare the vertices layout, but not all units need to do so. + // However, all declarations must match. + if (vertices == TQualifier::layoutNotSet) + vertices = unit.vertices; + else if (unit.vertices != TQualifier::layoutNotSet && vertices != unit.vertices) { + if (language == EShLangGeometry || language == EShLangMesh) + error(infoSink, "Contradictory layout max_vertices values"); + else if (language == EShLangTessControl) + error(infoSink, "Contradictory layout vertices values"); + else + assert(0); + } + + // The mesh shader extension requires that at least one compilation unit + // must declare the max_primitives layout, but not all units need to do so. + // However, all declarations must match. + if (primitives == TQualifier::layoutNotSet) + primitives = unit.primitives; + else if (unit.primitives != TQualifier::layoutNotSet && primitives != unit.primitives) { + if (language == EShLangMesh) + error(infoSink, "Contradictory layout max_primitives values"); + else + assert(0); + } + + // The GLSL specification requires that at least one compilation unit + // must declare the input primitive layout, but not all units need to do so. + // However, all declarations must match. + if (inputPrimitive == ElgNone) + inputPrimitive = unit.inputPrimitive; + else if (unit.inputPrimitive != ElgNone && inputPrimitive != unit.inputPrimitive) + error(infoSink, "Contradictory input layout primitives"); + + // The GLSL specification requires that at least one compilation unit + // must declare the output primitive layout, but not all units need to do so. + // However, all declarations must match. + if (outputPrimitive == ElgNone) + outputPrimitive = unit.outputPrimitive; + else if (unit.outputPrimitive != ElgNone && outputPrimitive != unit.outputPrimitive) + error(infoSink, "Contradictory output layout primitives"); + + if (originUpperLeft != unit.originUpperLeft || pixelCenterInteger != unit.pixelCenterInteger) + error(infoSink, "gl_FragCoord redeclarations must match across shaders"); + + // The GLSL specification requires that at least one compilation unit + // must declare the vertex spacing layout, but not all units need to do so. + // However, all declarations must match. + if (vertexSpacing == EvsNone) + vertexSpacing = unit.vertexSpacing; + else if (unit.vertexSpacing != EvsNone && vertexSpacing != unit.vertexSpacing) + error(infoSink, "Contradictory input vertex spacing"); + + // The GLSL specification requires that at least one compilation unit + // must declare the triangle ordering layout, but not all units need to do so. + // However, all declarations must match. + if (vertexOrder == EvoNone) + vertexOrder = unit.vertexOrder; + else if (unit.vertexOrder != EvoNone && vertexOrder != unit.vertexOrder) + error(infoSink, "Contradictory triangle ordering"); + + MERGE_TRUE(pointMode); + + for (int i = 0; i < 3; ++i) { + // The GLSL specification requires that all workgroup size declarations must match + // but not all units have to declare the layout. + if (unit.localSizeNotDefault[i]) { + if (!localSizeNotDefault[i]) { + localSize[i] = unit.localSize[i]; + localSizeNotDefault[i] = true; + } + else if (localSize[i] != unit.localSize[i]) + error(infoSink, "Contradictory local size"); + } + + // The GLSL specification requires that all workgroup size specialization + // ids declarations must match, but not all units have to declare the layout. + if (localSizeSpecId[i] == TQualifier::layoutNotSet) + localSizeSpecId[i] = unit.localSizeSpecId[i]; + else if (unit.localSizeSpecId[i] != TQualifier::layoutNotSet && localSizeSpecId[i] != unit.localSizeSpecId[i]) + error(infoSink, "Contradictory local size specialization ids"); + } + + MERGE_TRUE(earlyFragmentTests); + MERGE_TRUE(postDepthCoverage); + MERGE_TRUE(nonCoherentColorAttachmentReadEXT); + MERGE_TRUE(nonCoherentDepthAttachmentReadEXT); + MERGE_TRUE(nonCoherentStencilAttachmentReadEXT); + MERGE_TRUE(nonCoherentTileAttachmentReadQCOM); + + // The GLSL specification requires that all depth layout redeclarations must match, + // but not all units have to declare the layout. + if (depthLayout == EldNone) + depthLayout = unit.depthLayout; + else if (unit.depthLayout != EldNone && depthLayout != unit.depthLayout) + error(infoSink, "Contradictory depth layouts"); + + MERGE_TRUE(depthReplacing); + MERGE_TRUE(hlslFunctionality1); + + blendEquations |= unit.blendEquations; + + MERGE_TRUE(xfbMode); + + for (size_t b = 0; b < xfbBuffers.size(); ++b) { + // The GLSL specification requires that all xfb_stride declarations for + // the same buffer must match, but not all units have to declare the layout. + if (xfbBuffers[b].stride == TQualifier::layoutXfbStrideEnd) + xfbBuffers[b].stride = unit.xfbBuffers[b].stride; + else if (unit.xfbBuffers[b].stride != TQualifier::layoutXfbStrideEnd && xfbBuffers[b].stride != unit.xfbBuffers[b].stride) + error(infoSink, "Contradictory xfb_stride"); + xfbBuffers[b].implicitStride = std::max(xfbBuffers[b].implicitStride, unit.xfbBuffers[b].implicitStride); + if (unit.xfbBuffers[b].contains64BitType) + xfbBuffers[b].contains64BitType = true; + if (unit.xfbBuffers[b].contains32BitType) + xfbBuffers[b].contains32BitType = true; + if (unit.xfbBuffers[b].contains16BitType) + xfbBuffers[b].contains16BitType = true; + // TODO: 4.4 link: enhanced layouts: compare ranges + } + + MERGE_TRUE(multiStream); + MERGE_TRUE(layoutOverrideCoverage); + MERGE_TRUE(geoPassthroughEXT); + + for (unsigned int i = 0; i < unit.shiftBinding.size(); ++i) { + if (unit.shiftBinding[i] > 0) + setShiftBinding((TResourceType)i, unit.shiftBinding[i]); + } + + for (unsigned int i = 0; i < unit.shiftBindingForSet.size(); ++i) { + for (auto it = unit.shiftBindingForSet[i].begin(); it != unit.shiftBindingForSet[i].end(); ++it) + setShiftBindingForSet((TResourceType)i, it->second, it->first); + } + + resourceSetBinding.insert(resourceSetBinding.end(), unit.resourceSetBinding.begin(), unit.resourceSetBinding.end()); + + MERGE_TRUE(autoMapBindings); + MERGE_TRUE(autoMapLocations); + MERGE_TRUE(invertY); + MERGE_TRUE(dxPositionW); + MERGE_TRUE(debugInfo); + MERGE_TRUE(flattenUniformArrays); + MERGE_TRUE(useUnknownFormat); + MERGE_TRUE(hlslOffsets); + MERGE_TRUE(useStorageBuffer); + MERGE_TRUE(invariantAll); + MERGE_TRUE(hlslIoMapping); + + // TODO: sourceFile + // TODO: sourceText + // TODO: processes + + MERGE_TRUE(needToLegalize); + MERGE_TRUE(binaryDoubleOutput); + MERGE_TRUE(usePhysicalStorageBuffer); +} + +// +// Merge the 'unit' AST into 'this' AST. +// That includes rationalizing the unique IDs, which were set up independently, +// and might have overlaps that are not the same symbol, or might have different +// IDs for what should be the same shared symbol. +// +void TIntermediate::mergeTrees(TInfoSink& infoSink, TIntermediate& unit) +{ + if (unit.treeRoot == nullptr) + return; + + if (treeRoot == nullptr) { + treeRoot = unit.treeRoot; + return; + } + + // Getting this far means we have two existing trees to merge... + numShaderRecordBlocks += unit.numShaderRecordBlocks; + numTaskNVBlocks += unit.numTaskNVBlocks; + + // Get the top-level globals of each unit + TIntermSequence& globals = treeRoot->getAsAggregate()->getSequence(); + TIntermSequence& unitGlobals = unit.treeRoot->getAsAggregate()->getSequence(); + + // Get the linker-object lists + TIntermSequence& linkerObjects = findLinkerObjects()->getSequence(); + const TIntermSequence& unitLinkerObjects = unit.findLinkerObjects()->getSequence(); + + // Map by global name to unique ID to rationalize the same object having + // differing IDs in different trees. + TIdMaps idMaps; + long long idShift; + seedIdMap(idMaps, idShift); + remapIds(idMaps, idShift + 1, unit); + + mergeBodies(infoSink, globals, unitGlobals); + bool mergeExistingOnly = false; + mergeGlobalUniformBlocks(infoSink, unit, mergeExistingOnly); + mergeLinkerObjects(infoSink, linkerObjects, unitLinkerObjects, unit.getStage()); + ioAccessed.insert(unit.ioAccessed.begin(), unit.ioAccessed.end()); +} + +static const TString& getNameForIdMap(TIntermSymbol* symbol) +{ + TShaderInterface si = symbol->getType().getShaderInterface(); + if (si == EsiNone) + return symbol->getName(); + else + return symbol->getType().getTypeName(); +} + + + +// Traverser that seeds an ID map with all built-ins, and tracks the +// maximum ID used, currently using (maximum ID + 1) as new symbol id shift seed. +// Level id will keep same after shifting. +// (It would be nice to put this in a function, but that causes warnings +// on having no bodies for the copy-constructor/operator=.) +class TBuiltInIdTraverser : public TIntermTraverser { +public: + TBuiltInIdTraverser(TIdMaps& idMaps) : idMaps(idMaps), idShift(0) { } + // If it's a built in, add it to the map. + virtual void visitSymbol(TIntermSymbol* symbol) + { + const TQualifier& qualifier = symbol->getType().getQualifier(); + if (qualifier.builtIn != EbvNone) { + TShaderInterface si = symbol->getType().getShaderInterface(); + idMaps[si][getNameForIdMap(symbol)] = symbol->getId(); + } + idShift = (symbol->getId() & ~TSymbolTable::uniqueIdMask) | + std::max(idShift & TSymbolTable::uniqueIdMask, + symbol->getId() & TSymbolTable::uniqueIdMask); + } + long long getIdShift() const { return idShift; } +protected: + TBuiltInIdTraverser(TBuiltInIdTraverser&); + TBuiltInIdTraverser& operator=(TBuiltInIdTraverser&); + TIdMaps& idMaps; + long long idShift; +}; + +// Traverser that seeds an ID map with non-builtins. +// (It would be nice to put this in a function, but that causes warnings +// on having no bodies for the copy-constructor/operator=.) +class TUserIdTraverser : public TIntermTraverser { +public: + TUserIdTraverser(TIdMaps& idMaps) : idMaps(idMaps) { } + // If its a non-built-in global, add it to the map. + virtual void visitSymbol(TIntermSymbol* symbol) + { + const TQualifier& qualifier = symbol->getType().getQualifier(); + if (qualifier.builtIn == EbvNone) { + TShaderInterface si = symbol->getType().getShaderInterface(); + idMaps[si][getNameForIdMap(symbol)] = symbol->getId(); + } + } + +protected: + TUserIdTraverser(TUserIdTraverser&); + TUserIdTraverser& operator=(TUserIdTraverser&); + TIdMaps& idMaps; // over biggest id +}; + +// Initialize the the ID map with what we know of 'this' AST. +void TIntermediate::seedIdMap(TIdMaps& idMaps, long long& idShift) +{ + // all built-ins everywhere need to align on IDs and contribute to the max ID + TBuiltInIdTraverser builtInIdTraverser(idMaps); + treeRoot->traverse(&builtInIdTraverser); + idShift = builtInIdTraverser.getIdShift() & TSymbolTable::uniqueIdMask; + + // user variables in the linker object list need to align on ids + TUserIdTraverser userIdTraverser(idMaps); + findLinkerObjects()->traverse(&userIdTraverser); +} + +// Traverser to map an AST ID to what was known from the seeding AST. +// (It would be nice to put this in a function, but that causes warnings +// on having no bodies for the copy-constructor/operator=.) +class TRemapIdTraverser : public TIntermTraverser { +public: + TRemapIdTraverser(const TIdMaps& idMaps, long long idShift) : idMaps(idMaps), idShift(idShift) { } + // Do the mapping: + // - if the same symbol, adopt the 'this' ID + // - otherwise, ensure a unique ID by shifting to a new space + virtual void visitSymbol(TIntermSymbol* symbol) + { + const TQualifier& qualifier = symbol->getType().getQualifier(); + bool remapped = false; + if (qualifier.isLinkable() || qualifier.builtIn != EbvNone) { + TShaderInterface si = symbol->getType().getShaderInterface(); + auto it = idMaps[si].find(getNameForIdMap(symbol)); + if (it != idMaps[si].end()) { + uint64_t id = (symbol->getId() & ~TSymbolTable::uniqueIdMask) | + (it->second & TSymbolTable::uniqueIdMask); + symbol->changeId(id); + remapped = true; + } + } + if (!remapped) + symbol->changeId(symbol->getId() + idShift); + } +protected: + TRemapIdTraverser(TRemapIdTraverser&); + TRemapIdTraverser& operator=(TRemapIdTraverser&); + const TIdMaps& idMaps; + long long idShift; +}; + +void TIntermediate::remapIds(const TIdMaps& idMaps, long long idShift, TIntermediate& unit) +{ + // Remap all IDs to either share or be unique, as dictated by the idMap and idShift. + TRemapIdTraverser idTraverser(idMaps, idShift); + unit.getTreeRoot()->traverse(&idTraverser); +} + +// +// Merge the function bodies and global-level initializers from unitGlobals into globals. +// Will error check duplication of function bodies for the same signature. +// +void TIntermediate::mergeBodies(TInfoSink& infoSink, TIntermSequence& globals, const TIntermSequence& unitGlobals) +{ + // TODO: link-time performance: Processing in alphabetical order will be faster + + // Error check the global objects, not including the linker objects + for (unsigned int child = 0; child < globals.size() - 1; ++child) { + for (unsigned int unitChild = 0; unitChild < unitGlobals.size() - 1; ++unitChild) { + TIntermAggregate* body = globals[child]->getAsAggregate(); + TIntermAggregate* unitBody = unitGlobals[unitChild]->getAsAggregate(); + if (body && unitBody && body->getOp() == EOpFunction && unitBody->getOp() == EOpFunction && body->getName() == unitBody->getName()) { + error(infoSink, "Multiple function bodies in multiple compilation units for the same signature in the same stage:"); + infoSink.info << " " << globals[child]->getAsAggregate()->getName() << "\n"; + } + } + } + + // Merge the global objects, just in front of the linker objects + globals.insert(globals.end() - 1, unitGlobals.begin(), unitGlobals.end() - 1); +} + +// +// Global Unfiform block stores any default uniforms (i.e. uniforms without a block) +// If two linked stages declare the same member, they are meant to be the same uniform +// and need to be in the same block +// merge the members of different stages to allow them to be linked properly +// as a single block +// +void TIntermediate::mergeGlobalUniformBlocks(TInfoSink& infoSink, TIntermediate& unit, bool mergeExistingOnly) +{ + TIntermSequence& linkerObjects = findLinkerObjects()->getSequence(); + TIntermSequence& unitLinkerObjects = unit.findLinkerObjects()->getSequence(); + + // build lists of default blocks from the intermediates + TIntermSequence defaultBlocks; + TIntermSequence unitDefaultBlocks; + + auto filter = [](TIntermSequence& list, TIntermNode* node) { + if (node->getAsSymbolNode()->getQualifier().defaultBlock) { + list.push_back(node); + } + }; + + std::for_each(linkerObjects.begin(), linkerObjects.end(), + [&defaultBlocks, &filter](TIntermNode* node) { + filter(defaultBlocks, node); + }); + std::for_each(unitLinkerObjects.begin(), unitLinkerObjects.end(), + [&unitDefaultBlocks, &filter](TIntermNode* node) { + filter(unitDefaultBlocks, node); + }); + + auto itUnitBlock = unitDefaultBlocks.begin(); + for (; itUnitBlock != unitDefaultBlocks.end(); itUnitBlock++) { + + bool add = !mergeExistingOnly; + auto itBlock = defaultBlocks.begin(); + + for (; itBlock != defaultBlocks.end(); itBlock++) { + TIntermSymbol* block = (*itBlock)->getAsSymbolNode(); + TIntermSymbol* unitBlock = (*itUnitBlock)->getAsSymbolNode(); + + assert(block && unitBlock); + + // if the two default blocks match, then merge their definitions + if (block->getType().getTypeName() == unitBlock->getType().getTypeName() && + block->getQualifier().storage == unitBlock->getQualifier().storage) { + add = false; + mergeBlockDefinitions(infoSink, block, unitBlock, &unit); + } + } + if (add) { + // push back on original list; won't change the size of the list we're iterating over + linkerObjects.push_back(*itUnitBlock); + } + } +} + +void TIntermediate::mergeBlockDefinitions(TInfoSink& infoSink, TIntermSymbol* block, TIntermSymbol* unitBlock, TIntermediate* unit) { + + if (block->getType().getTypeName() != unitBlock->getType().getTypeName() || + block->getType().getBasicType() != unitBlock->getType().getBasicType() || + block->getQualifier().storage != unitBlock->getQualifier().storage || + block->getQualifier().layoutSet != unitBlock->getQualifier().layoutSet) { + // different block names likely means different blocks + return; + } + + // merge the struct + // order of declarations doesn't matter and they matched based on member name + TTypeList* memberList = block->getType().getWritableStruct(); + TTypeList* unitMemberList = unitBlock->getType().getWritableStruct(); + + // keep track of which members have changed position + // so we don't have to search the array again + std::map memberIndexUpdates; + + size_t memberListStartSize = memberList->size(); + for (unsigned int i = 0; i < unitMemberList->size(); ++i) { + bool merge = true; + for (unsigned int j = 0; j < memberListStartSize; ++j) { + if ((*memberList)[j].type->getFieldName() == (*unitMemberList)[i].type->getFieldName()) { + merge = false; + const TType* memberType = (*memberList)[j].type; + const TType* unitMemberType = (*unitMemberList)[i].type; + + // compare types + // don't need as many checks as when merging symbols, since + // initializers and most qualifiers are stripped when the member is moved into the block + if ((*memberType) != (*unitMemberType)) { + error(infoSink, "Types must match:", unitBlock->getStage()); + infoSink.info << " " << memberType->getFieldName() << ": "; + infoSink.info << "\"" << memberType->getCompleteString() << "\" in stage " << StageName(block->getStage()) << " versus "; + infoSink.info << "\"" << unitMemberType->getCompleteString() << "\" in stage " << StageName(unitBlock->getStage()) << "\n"; + } + + memberIndexUpdates[i] = j; + } + } + if (merge) { + memberList->push_back((*unitMemberList)[i]); + memberIndexUpdates[i] = (unsigned int)memberList->size() - 1; + } + } + + // update symbol node in unit tree, + // and other nodes that may reference it + class TMergeBlockTraverser : public TIntermTraverser { + public: + TMergeBlockTraverser(const TIntermSymbol* newSym) + : newSymbol(newSym), newType(nullptr), unit(nullptr), memberIndexUpdates(nullptr) + { + } + TMergeBlockTraverser(const TIntermSymbol* newSym, const glslang::TType* unitType, glslang::TIntermediate* unit, + const std::map* memberIdxUpdates) + : TIntermTraverser(false, true), newSymbol(newSym), newType(unitType), unit(unit), memberIndexUpdates(memberIdxUpdates) + { + } + virtual ~TMergeBlockTraverser() {} + + const TIntermSymbol* newSymbol; + const glslang::TType* newType; // shallow copy of the new type + glslang::TIntermediate* unit; // intermediate that is being updated + const std::map* memberIndexUpdates; + + virtual void visitSymbol(TIntermSymbol* symbol) + { + if (newSymbol->getAccessName() == symbol->getAccessName() && + newSymbol->getQualifier().getBlockStorage() == symbol->getQualifier().getBlockStorage()) { + // Each symbol node may have a local copy of the block structure. + // Update those structures to match the new one post-merge + *(symbol->getWritableType().getWritableStruct()) = *(newSymbol->getType().getStruct()); + } + } + + virtual bool visitBinary(TVisit, glslang::TIntermBinary* node) + { + if (!unit || !newType || !memberIndexUpdates || memberIndexUpdates->empty()) + return true; + + if (node->getOp() == EOpIndexDirectStruct && node->getLeft()->getType() == *newType) { + // this is a dereference to a member of the block since the + // member list changed, need to update this to point to the + // right index + assert(node->getRight()->getAsConstantUnion()); + + glslang::TIntermConstantUnion* constNode = node->getRight()->getAsConstantUnion(); + unsigned int memberIdx = constNode->getConstArray()[0].getUConst(); + unsigned int newIdx = memberIndexUpdates->at(memberIdx); + TIntermTyped* newConstNode = unit->addConstantUnion(newIdx, node->getRight()->getLoc()); + + node->setRight(newConstNode); + delete constNode; + + return true; + } + return true; + } + }; + + // 'this' may have symbols that are using the old block structure, so traverse the tree to update those + // in 'visitSymbol' + TMergeBlockTraverser finalLinkTraverser(block); + getTreeRoot()->traverse(&finalLinkTraverser); + + // The 'unit' intermediate needs the block structures update, but also structure entry indices + // may have changed from the old block to the new one that it was merged into, so update those + // in 'visitBinary' + TType newType; + newType.shallowCopy(block->getType()); + TMergeBlockTraverser unitFinalLinkTraverser(block, &newType, unit, &memberIndexUpdates); + unit->getTreeRoot()->traverse(&unitFinalLinkTraverser); + + // update the member list + (*unitMemberList) = (*memberList); +} + +// +// Merge the linker objects from unitLinkerObjects into linkerObjects. +// Duplication is expected and filtered out, but contradictions are an error. +// +void TIntermediate::mergeLinkerObjects(TInfoSink& infoSink, TIntermSequence& linkerObjects, const TIntermSequence& unitLinkerObjects, EShLanguage unitStage) +{ + // Error check and merge the linker objects (duplicates should not be created) + std::size_t initialNumLinkerObjects = linkerObjects.size(); + for (unsigned int unitLinkObj = 0; unitLinkObj < unitLinkerObjects.size(); ++unitLinkObj) { + bool merge = true; + for (std::size_t linkObj = 0; linkObj < initialNumLinkerObjects; ++linkObj) { + TIntermSymbol* symbol = linkerObjects[linkObj]->getAsSymbolNode(); + TIntermSymbol* unitSymbol = unitLinkerObjects[unitLinkObj]->getAsSymbolNode(); + assert(symbol && unitSymbol); + + if (isSameSymbol(symbol, unitSymbol)) { + // filter out copy + merge = false; + + // but if one has an initializer and the other does not, update + // the initializer + if (symbol->getConstArray().empty() && ! unitSymbol->getConstArray().empty()) + symbol->setConstArray(unitSymbol->getConstArray()); + + // Similarly for binding + if (! symbol->getQualifier().hasBinding() && unitSymbol->getQualifier().hasBinding()) + symbol->getQualifier().layoutBinding = unitSymbol->getQualifier().layoutBinding; + + // Similarly for location + if (!symbol->getQualifier().hasLocation() && unitSymbol->getQualifier().hasLocation()) { + symbol->getQualifier().layoutLocation = unitSymbol->getQualifier().layoutLocation; + } + + // Update implicit array sizes + if (symbol->getWritableType().isImplicitlySizedArray() && unitSymbol->getType().isImplicitlySizedArray()) { + if (unitSymbol->getType().getImplicitArraySize() > symbol->getType().getImplicitArraySize()){ + symbol->getWritableType().updateImplicitArraySize(unitSymbol->getType().getImplicitArraySize()); + } + } + else if (symbol->getWritableType().isImplicitlySizedArray() && unitSymbol->getType().isSizedArray()) { + if (symbol->getWritableType().getImplicitArraySize() > unitSymbol->getType().getOuterArraySize()) + error(infoSink, "Implicit size of unsized array doesn't match same symbol among multiple shaders.", unitStage); + } + else if (unitSymbol->getType().isImplicitlySizedArray() && symbol->getWritableType().isSizedArray()) { + if (unitSymbol->getType().getImplicitArraySize() > symbol->getWritableType().getOuterArraySize()) + error(infoSink, "Implicit size of unsized array doesn't match same symbol among multiple shaders.", unitStage); + } + + if (symbol->getType().isStruct() && unitSymbol->getType().isStruct() && + symbol->getType().getStruct()->size() == unitSymbol->getType().getStruct()->size()) { + for (int i = 0; i < (int)symbol->getType().getStruct()->size(); ++i) { + auto& type = (*symbol->getWritableType().getStruct())[i]; + auto& unitType = (*unitSymbol->getWritableType().getStruct())[i]; + + if (type.type->isImplicitlySizedArray() && unitType.type->isImplicitlySizedArray()) { + if (unitType.type->getImplicitArraySize() > type.type->getImplicitArraySize()) + type.type->updateImplicitArraySize(unitType.type->getImplicitArraySize()); + } + else if (type.type->isImplicitlySizedArray() && unitType.type->isSizedArray()) { + if (type.type->getImplicitArraySize() > unitType.type->getOuterArraySize()) + error(infoSink, "Implicit size of unsized array doesn't match same symbol among multiple shaders.", unitStage); + } + else if (type.type->isSizedArray() && unitType.type->isImplicitlySizedArray()) { + if (type.type->getOuterArraySize() < unitType.type->getImplicitArraySize()) + error(infoSink, "Implicit size of unsized array doesn't match same symbol among multiple shaders.", unitStage); + } + } + } + + // Update implicit array sizes + mergeImplicitArraySizes(symbol->getWritableType(), unitSymbol->getType()); + + // Check for consistent types/qualification/initializers etc. + mergeErrorCheck(infoSink, *symbol, *unitSymbol); + } + // If different symbols, verify they arn't push_constant since there can only be one per stage + else if (symbol->getQualifier().isPushConstant() && unitSymbol->getQualifier().isPushConstant() && getStage() == unitStage) + error(infoSink, "Only one push_constant block is allowed per stage"); + } + + // Check conflicts between preset primitives and sizes of I/O variables among multiple geometry shaders + if (language == EShLangGeometry && unitStage == EShLangGeometry) + { + TIntermSymbol* unitSymbol = unitLinkerObjects[unitLinkObj]->getAsSymbolNode(); + if (unitSymbol->isArray() && unitSymbol->getQualifier().storage == EvqVaryingIn && unitSymbol->getQualifier().builtIn == EbvNone) + if ((unitSymbol->getArraySizes()->isImplicitlySized() && + unitSymbol->getArraySizes()->getImplicitSize() != TQualifier::mapGeometryToSize(getInputPrimitive())) || + (! unitSymbol->getArraySizes()->isImplicitlySized() && + unitSymbol->getArraySizes()->getDimSize(0) != TQualifier::mapGeometryToSize(getInputPrimitive()))) + error(infoSink, "Not all array sizes match across all geometry shaders in the program"); + } + + if (merge) { + linkerObjects.push_back(unitLinkerObjects[unitLinkObj]); + + // for anonymous blocks, check that their members don't conflict with other names + if (unitLinkerObjects[unitLinkObj]->getAsSymbolNode()->getBasicType() == EbtBlock && + IsAnonymous(unitLinkerObjects[unitLinkObj]->getAsSymbolNode()->getName())) { + for (std::size_t linkObj = 0; linkObj < initialNumLinkerObjects; ++linkObj) { + TIntermSymbol* symbol = linkerObjects[linkObj]->getAsSymbolNode(); + TIntermSymbol* unitSymbol = unitLinkerObjects[unitLinkObj]->getAsSymbolNode(); + assert(symbol && unitSymbol); + + auto checkName = [this, unitSymbol, &infoSink](const TString& name) { + for (unsigned int i = 0; i < unitSymbol->getType().getStruct()->size(); ++i) { + if (name == (*unitSymbol->getType().getStruct())[i].type->getFieldName() + && !((*unitSymbol->getType().getStruct())[i].type->getQualifier().hasLocation() + || unitSymbol->getType().getQualifier().hasLocation()) + ) { + error(infoSink, "Anonymous member name used for global variable or other anonymous member: "); + infoSink.info << (*unitSymbol->getType().getStruct())[i].type->getCompleteString() << "\n"; + } + } + }; + + if (isSameInterface(symbol, unitSymbol)) { + checkName(symbol->getName()); + + // check members of other anonymous blocks + if (symbol->getBasicType() == EbtBlock && IsAnonymous(symbol->getName())) { + for (unsigned int i = 0; i < symbol->getType().getStruct()->size(); ++i) { + checkName((*symbol->getType().getStruct())[i].type->getFieldName()); + } + } + } + } + } + } + } +} + +// TODO 4.5 link functionality: cull distance array size checking + +// Recursively merge the implicit array sizes through the objects' respective type trees. +void TIntermediate::mergeImplicitArraySizes(TType& type, const TType& unitType) +{ + if (type.isUnsizedArray()) { + if (unitType.isUnsizedArray()) { + type.updateImplicitArraySize(unitType.getImplicitArraySize()); + if (unitType.isArrayVariablyIndexed()) + type.setArrayVariablyIndexed(); + } else if (unitType.isSizedArray()) + type.changeOuterArraySize(unitType.getOuterArraySize()); + } + + // Type mismatches are caught and reported after this, just be careful for now. + if (! type.isStruct() || ! unitType.isStruct() || type.getStruct()->size() != unitType.getStruct()->size()) + return; + + for (int i = 0; i < (int)type.getStruct()->size(); ++i) + mergeImplicitArraySizes(*(*type.getStruct())[i].type, *(*unitType.getStruct())[i].type); +} + +// +// Compare two global objects from two compilation units and see if they match +// well enough. Rules can be different for intra- vs. cross-stage matching. +// +// This function only does one of intra- or cross-stage matching per call. +// +void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& symbol, const TIntermSymbol& unitSymbol) +{ + EShLanguage stage = symbol.getStage(); + EShLanguage unitStage = unitSymbol.getStage(); + bool crossStage = stage != unitStage; + bool writeTypeComparison = false; + bool errorReported = false; + bool printQualifiers = false; + bool printPrecision = false; + bool printType = false; + + // Types have to match + { + // but, we make an exception if one is an implicit array and the other is sized + // or if the array sizes differ because of the extra array dimension on some in/out boundaries + bool arraysMatch = false; + if (isIoResizeArray(symbol.getType(), stage) || isIoResizeArray(unitSymbol.getType(), unitStage)) { + // if the arrays have an extra dimension because of the stage. + // compare dimensions while ignoring the outer dimension + unsigned int firstDim = isIoResizeArray(symbol.getType(), stage) ? 1 : 0; + unsigned int numDim = symbol.getArraySizes() + ? symbol.getArraySizes()->getNumDims() : 0; + unsigned int unitFirstDim = isIoResizeArray(unitSymbol.getType(), unitStage) ? 1 : 0; + unsigned int unitNumDim = unitSymbol.getArraySizes() + ? unitSymbol.getArraySizes()->getNumDims() : 0; + arraysMatch = (numDim - firstDim) == (unitNumDim - unitFirstDim); + // check that array sizes match as well + for (unsigned int i = 0; i < (numDim - firstDim) && arraysMatch; i++) { + if (symbol.getArraySizes()->getDimSize(firstDim + i) != + unitSymbol.getArraySizes()->getDimSize(unitFirstDim + i)) { + arraysMatch = false; + break; + } + } + } + else { + arraysMatch = symbol.getType().sameArrayness(unitSymbol.getType()) || + (symbol.getType().isArray() && unitSymbol.getType().isArray() && + (symbol.getType().isImplicitlySizedArray() || unitSymbol.getType().isImplicitlySizedArray() || + symbol.getType().isUnsizedArray() || unitSymbol.getType().isUnsizedArray())); + } + + int lpidx = -1; + int rpidx = -1; + if (!symbol.getType().sameElementType(unitSymbol.getType(), &lpidx, &rpidx)) { + if (lpidx >= 0 && rpidx >= 0) { + error(infoSink, "Member names and types must match:", unitStage); + infoSink.info << " Block: " << symbol.getType().getTypeName() << "\n"; + infoSink.info << " " << StageName(stage) << " stage: \"" + << (*symbol.getType().getStruct())[lpidx].type->getCompleteString(true, false, false, true, + (*symbol.getType().getStruct())[lpidx].type->getFieldName()) << "\"\n"; + infoSink.info << " " << StageName(unitStage) << " stage: \"" + << (*unitSymbol.getType().getStruct())[rpidx].type->getCompleteString(true, false, false, true, + (*unitSymbol.getType().getStruct())[rpidx].type->getFieldName()) << "\"\n"; + errorReported = true; + } else if (lpidx >= 0 && rpidx == -1) { + TString errmsg = StageName(stage); + errmsg.append(" block member has no corresponding member in ").append(StageName(unitStage)).append(" block:"); + error(infoSink, errmsg.c_str(), unitStage); + infoSink.info << " " << StageName(stage) << " stage: Block: " << symbol.getType().getTypeName() << ", Member: " + << (*symbol.getType().getStruct())[lpidx].type->getFieldName() << "\n"; + infoSink.info << " " << StageName(unitStage) << " stage: Block: " << unitSymbol.getType().getTypeName() << ", Member: n/a \n"; + errorReported = true; + } else if (lpidx == -1 && rpidx >= 0) { + TString errmsg = StageName(unitStage); + errmsg.append(" block member has no corresponding member in ").append(StageName(stage)).append(" block:"); + error(infoSink, errmsg.c_str(), unitStage); + infoSink.info << " " << StageName(unitStage) << " stage: Block: " << unitSymbol.getType().getTypeName() << ", Member: " + << (*unitSymbol.getType().getStruct())[rpidx].type->getFieldName() << "\n"; + infoSink.info << " " << StageName(stage) << " stage: Block: " << symbol.getType().getTypeName() << ", Member: n/a \n"; + errorReported = true; + } else { + error(infoSink, "Types must match:", unitStage); + writeTypeComparison = true; + printType = true; + } + } else if (!arraysMatch) { + error(infoSink, "Array sizes must be compatible:", unitStage); + writeTypeComparison = true; + printType = true; + } else if (!symbol.getType().sameTypeParameters(unitSymbol.getType())) { + error(infoSink, "Type parameters must match:", unitStage); + writeTypeComparison = true; + printType = true; + } + } + + // Interface block member-wise layout qualifiers have to match + if (symbol.getType().getBasicType() == EbtBlock && unitSymbol.getType().getBasicType() == EbtBlock && + symbol.getType().getStruct() && unitSymbol.getType().getStruct() && + symbol.getType().sameStructType(unitSymbol.getType())) { + unsigned int li = 0; + unsigned int ri = 0; + while (li < symbol.getType().getStruct()->size() && ri < unitSymbol.getType().getStruct()->size()) { + if ((*symbol.getType().getStruct())[li].type->hiddenMember()) { + ++li; + continue; + } + if ((*unitSymbol.getType().getStruct())[ri].type->hiddenMember()) { + ++ri; + continue; + } + const TQualifier& qualifier = (*symbol.getType().getStruct())[li].type->getQualifier(); + const TQualifier & unitQualifier = (*unitSymbol.getType().getStruct())[ri].type->getQualifier(); + bool layoutQualifierError = false; + if (qualifier.layoutMatrix != unitQualifier.layoutMatrix) { + error(infoSink, "Interface block member layout matrix qualifier must match:", unitStage); + layoutQualifierError = true; + } + if (qualifier.layoutOffset != unitQualifier.layoutOffset) { + error(infoSink, "Interface block member layout offset qualifier must match:", unitStage); + layoutQualifierError = true; + } + if (qualifier.layoutAlign != unitQualifier.layoutAlign) { + error(infoSink, "Interface block member layout align qualifier must match:", unitStage); + layoutQualifierError = true; + } + if (qualifier.layoutLocation != unitQualifier.layoutLocation) { + error(infoSink, "Interface block member layout location qualifier must match:", unitStage); + layoutQualifierError = true; + } + if (qualifier.layoutComponent != unitQualifier.layoutComponent) { + error(infoSink, "Interface block member layout component qualifier must match:", unitStage); + layoutQualifierError = true; + } + if (layoutQualifierError) { + infoSink.info << " " << StageName(stage) << " stage: Block: " << symbol.getType().getTypeName() << ", Member: " + << (*symbol.getType().getStruct())[li].type->getFieldName() << " \"" + << (*symbol.getType().getStruct())[li].type->getCompleteString(true, true, false, false) << "\"\n"; + infoSink.info << " " << StageName(unitStage) << " stage: Block: " << unitSymbol.getType().getTypeName() << ", Member: " + << (*unitSymbol.getType().getStruct())[ri].type->getFieldName() << " \"" + << (*unitSymbol.getType().getStruct())[ri].type->getCompleteString(true, true, false, false) << "\"\n"; + errorReported = true; + } + ++li; + ++ri; + } + } + + bool isInOut = crossStage && + ((symbol.getQualifier().storage == EvqVaryingIn && unitSymbol.getQualifier().storage == EvqVaryingOut) || + (symbol.getQualifier().storage == EvqVaryingOut && unitSymbol.getQualifier().storage == EvqVaryingIn)); + + // Qualifiers have to (almost) match + // Storage... + if (!isInOut && symbol.getQualifier().storage != unitSymbol.getQualifier().storage) { + error(infoSink, "Storage qualifiers must match:", unitStage); + writeTypeComparison = true; + printQualifiers = true; + } + + // Uniform and buffer blocks must either both have an instance name, or + // must both be anonymous. The names don't need to match though. + if (symbol.getQualifier().isUniformOrBuffer() && + (IsAnonymous(symbol.getName()) != IsAnonymous(unitSymbol.getName()))) { + error(infoSink, "Matched Uniform or Storage blocks must all be anonymous," + " or all be named:", unitStage); + writeTypeComparison = true; + } + + if (symbol.getQualifier().storage == unitSymbol.getQualifier().storage && + (IsAnonymous(symbol.getName()) != IsAnonymous(unitSymbol.getName()) || + (!IsAnonymous(symbol.getName()) && symbol.getName() != unitSymbol.getName()))) { + warn(infoSink, "Matched shader interfaces are using different instance names.", unitStage); + writeTypeComparison = true; + } + + // Precision... + if (!isInOut && symbol.getQualifier().precision != unitSymbol.getQualifier().precision) { + error(infoSink, "Precision qualifiers must match:", unitStage); + writeTypeComparison = true; + printPrecision = true; + } + + // Invariance... + if (! crossStage && symbol.getQualifier().invariant != unitSymbol.getQualifier().invariant) { + error(infoSink, "Presence of invariant qualifier must match:", unitStage); + writeTypeComparison = true; + printQualifiers = true; + } + + // Precise... + if (! crossStage && symbol.getQualifier().isNoContraction() != unitSymbol.getQualifier().isNoContraction()) { + error(infoSink, "Presence of precise qualifier must match:", unitStage); + writeTypeComparison = true; + printPrecision = true; + } + + // Auxiliary and interpolation... + // "interpolation qualification (e.g., flat) and auxiliary qualification (e.g. centroid) may differ. + // These mismatches are allowed between any pair of stages ... + // those provided in the fragment shader supersede those provided in previous stages." + if (!crossStage && + (symbol.getQualifier().centroid != unitSymbol.getQualifier().centroid || + symbol.getQualifier().smooth != unitSymbol.getQualifier().smooth || + symbol.getQualifier().flat != unitSymbol.getQualifier().flat || + symbol.getQualifier().isSample()!= unitSymbol.getQualifier().isSample() || + symbol.getQualifier().isPatch() != unitSymbol.getQualifier().isPatch() || + symbol.getQualifier().isNonPerspective() != unitSymbol.getQualifier().isNonPerspective())) { + error(infoSink, "Interpolation and auxiliary storage qualifiers must match:", unitStage); + writeTypeComparison = true; + printQualifiers = true; + } + + // Memory... + bool memoryQualifierError = false; + if (symbol.getQualifier().coherent != unitSymbol.getQualifier().coherent) { + error(infoSink, "Memory coherent qualifier must match:", unitStage); + memoryQualifierError = true; + } + if (symbol.getQualifier().devicecoherent != unitSymbol.getQualifier().devicecoherent) { + error(infoSink, "Memory devicecoherent qualifier must match:", unitStage); + memoryQualifierError = true; + } + if (symbol.getQualifier().queuefamilycoherent != unitSymbol.getQualifier().queuefamilycoherent) { + error(infoSink, "Memory queuefamilycoherent qualifier must match:", unitStage); + memoryQualifierError = true; + } + if (symbol.getQualifier().workgroupcoherent != unitSymbol.getQualifier().workgroupcoherent) { + error(infoSink, "Memory workgroupcoherent qualifier must match:", unitStage); + memoryQualifierError = true; + } + if (symbol.getQualifier().subgroupcoherent != unitSymbol.getQualifier().subgroupcoherent) { + error(infoSink, "Memory subgroupcoherent qualifier must match:", unitStage); + memoryQualifierError = true; + } + if (symbol.getQualifier().shadercallcoherent != unitSymbol.getQualifier().shadercallcoherent) { + error(infoSink, "Memory shadercallcoherent qualifier must match:", unitStage); + memoryQualifierError = true; + } + if (symbol.getQualifier().nonprivate != unitSymbol.getQualifier().nonprivate) { + error(infoSink, "Memory nonprivate qualifier must match:", unitStage); + memoryQualifierError = true; + } + if (symbol.getQualifier().volatil != unitSymbol.getQualifier().volatil) { + error(infoSink, "Memory volatil qualifier must match:", unitStage); + memoryQualifierError = true; + } + if (symbol.getQualifier().nontemporal != unitSymbol.getQualifier().nontemporal) { + error(infoSink, "Memory nontemporal qualifier must match:", unitStage); + memoryQualifierError = true; + } + if (symbol.getQualifier().restrict != unitSymbol.getQualifier().restrict) { + error(infoSink, "Memory restrict qualifier must match:", unitStage); + memoryQualifierError = true; + } + if (symbol.getQualifier().readonly != unitSymbol.getQualifier().readonly) { + error(infoSink, "Memory readonly qualifier must match:", unitStage); + memoryQualifierError = true; + } + if (symbol.getQualifier().writeonly != unitSymbol.getQualifier().writeonly) { + error(infoSink, "Memory writeonly qualifier must match:", unitStage); + memoryQualifierError = true; + } + if (memoryQualifierError) { + writeTypeComparison = true; + printQualifiers = true; + } + + // Layouts... + // TODO: 4.4 enhanced layouts: Generalize to include offset/align: current spec + // requires separate user-supplied offset from actual computed offset, but + // current implementation only has one offset. + bool layoutQualifierError = false; + if (symbol.getQualifier().layoutMatrix != unitSymbol.getQualifier().layoutMatrix) { + error(infoSink, "Layout matrix qualifier must match:", unitStage); + layoutQualifierError = true; + } + if (symbol.getQualifier().layoutPacking != unitSymbol.getQualifier().layoutPacking) { + error(infoSink, "Layout packing qualifier must match:", unitStage); + layoutQualifierError = true; + } + if (symbol.getQualifier().hasLocation() && unitSymbol.getQualifier().hasLocation() && symbol.getQualifier().layoutLocation != unitSymbol.getQualifier().layoutLocation) { + error(infoSink, "Layout location qualifier must match:", unitStage); + layoutQualifierError = true; + } + if (symbol.getQualifier().layoutComponent != unitSymbol.getQualifier().layoutComponent) { + error(infoSink, "Layout component qualifier must match:", unitStage); + layoutQualifierError = true; + } + if (symbol.getQualifier().layoutIndex != unitSymbol.getQualifier().layoutIndex) { + error(infoSink, "Layout index qualifier must match:", unitStage); + layoutQualifierError = true; + } + if (symbol.getQualifier().hasBinding() && unitSymbol.getQualifier().hasBinding() && symbol.getQualifier().layoutBinding != unitSymbol.getQualifier().layoutBinding) { + error(infoSink, "Layout binding qualifier must match:", unitStage); + layoutQualifierError = true; + } + if (symbol.getQualifier().hasBinding() && (symbol.getQualifier().layoutOffset != unitSymbol.getQualifier().layoutOffset)) { + error(infoSink, "Layout offset qualifier must match:", unitStage); + layoutQualifierError = true; + } + if (layoutQualifierError) { + writeTypeComparison = true; + printQualifiers = true; + } + + // Initializers have to match, if both are present, and if we don't already know the types don't match + if (! writeTypeComparison && ! errorReported) { + if (! symbol.getConstArray().empty() && ! unitSymbol.getConstArray().empty()) { + if (symbol.getConstArray() != unitSymbol.getConstArray()) { + error(infoSink, "Initializers must match:", unitStage); + infoSink.info << " " << symbol.getName() << "\n"; + } + } + } + + if (writeTypeComparison) { + if (symbol.getType().getBasicType() == EbtBlock && unitSymbol.getType().getBasicType() == EbtBlock && + symbol.getType().getStruct() && unitSymbol.getType().getStruct()) { + if (printType) { + infoSink.info << " " << StageName(stage) << " stage: \"" << symbol.getType().getCompleteString(true, printQualifiers, printPrecision, + printType, symbol.getName(), symbol.getType().getTypeName()) << "\"\n"; + infoSink.info << " " << StageName(unitStage) << " stage: \"" << unitSymbol.getType().getCompleteString(true, printQualifiers, printPrecision, + printType, unitSymbol.getName(), unitSymbol.getType().getTypeName()) << "\"\n"; + } else { + infoSink.info << " " << StageName(stage) << " stage: Block: " << symbol.getType().getTypeName() << " Instance: " << symbol.getName() + << ": \"" << symbol.getType().getCompleteString(true, printQualifiers, printPrecision, printType) << "\"\n"; + infoSink.info << " " << StageName(unitStage) << " stage: Block: " << unitSymbol.getType().getTypeName() << " Instance: " << unitSymbol.getName() + << ": \"" << unitSymbol.getType().getCompleteString(true, printQualifiers, printPrecision, printType) << "\"\n"; + } + } else { + if (printType) { + infoSink.info << " " << StageName(stage) << " stage: \"" + << symbol.getType().getCompleteString(true, printQualifiers, printPrecision, printType, symbol.getName()) << "\"\n"; + infoSink.info << " " << StageName(unitStage) << " stage: \"" + << unitSymbol.getType().getCompleteString(true, printQualifiers, printPrecision, printType, unitSymbol.getName()) << "\"\n"; + } else { + infoSink.info << " " << StageName(stage) << " stage: " << symbol.getName() << " \"" + << symbol.getType().getCompleteString(true, printQualifiers, printPrecision, printType) << "\"\n"; + infoSink.info << " " << StageName(unitStage) << " stage: " << unitSymbol.getName() << " \"" + << unitSymbol.getType().getCompleteString(true, printQualifiers, printPrecision, printType) << "\"\n"; + } + } + } +} + +void TIntermediate::sharedBlockCheck(TInfoSink& infoSink) +{ + bool has_shared_block = false; + bool has_shared_non_block = false; + TIntermSequence& linkObjects = findLinkerObjects()->getSequence(); + for (size_t i = 0; i < linkObjects.size(); ++i) { + const TType& type = linkObjects[i]->getAsTyped()->getType(); + const TQualifier& qualifier = type.getQualifier(); + if (qualifier.storage == glslang::EvqShared) { + if (type.getBasicType() == glslang::EbtBlock) + has_shared_block = true; + else + has_shared_non_block = true; + } + } + if (has_shared_block && has_shared_non_block) + error(infoSink, "cannot mix use of shared variables inside and outside blocks"); +} + +// +// Do final link-time error checking of a complete (merged) intermediate representation. +// (Much error checking was done during merging). +// +// Also, lock in defaults of things not set. +// Defer adopting implicit array sizes to later, after all stages are merged. +// +void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled) +{ + if (getTreeRoot() == nullptr) + return; + + if (numEntryPoints < 1) { + if (getSource() == EShSourceGlsl) + error(infoSink, "Missing entry point: Each stage requires one entry point"); + else + warn(infoSink, "Entry point not found"); + } + + // recursion and missing body checking + checkCallGraphCycles(infoSink); + checkCallGraphBodies(infoSink, keepUncalled); + + // overlap/alias/missing I/O, etc. + inOutLocationCheck(infoSink); + + if (getNumPushConstants() > 1) + error(infoSink, "Only one push_constant block is allowed per stage"); + + // invocations + if (invocations == TQualifier::layoutNotSet) + invocations = 1; + + if (inIoAccessed("gl_ClipDistance") && inIoAccessed("gl_ClipVertex")) + error(infoSink, "Can only use one of gl_ClipDistance or gl_ClipVertex (gl_ClipDistance is preferred)"); + if (inIoAccessed("gl_CullDistance") && inIoAccessed("gl_ClipVertex")) + error(infoSink, "Can only use one of gl_CullDistance or gl_ClipVertex (gl_ClipDistance is preferred)"); + + if (userOutputUsed() && (inIoAccessed("gl_FragColor") || inIoAccessed("gl_FragData"))) + error(infoSink, "Cannot use gl_FragColor or gl_FragData when using user-defined outputs"); + if (inIoAccessed("gl_FragColor") && inIoAccessed("gl_FragData")) + error(infoSink, "Cannot use both gl_FragColor and gl_FragData"); + + for (size_t b = 0; b < xfbBuffers.size(); ++b) { + if (xfbBuffers[b].contains64BitType) + RoundToPow2(xfbBuffers[b].implicitStride, 8); + else if (xfbBuffers[b].contains32BitType) + RoundToPow2(xfbBuffers[b].implicitStride, 4); + else if (xfbBuffers[b].contains16BitType) + RoundToPow2(xfbBuffers[b].implicitStride, 2); + + // "It is a compile-time or link-time error to have + // any xfb_offset that overflows xfb_stride, whether stated on declarations before or after the xfb_stride, or + // in different compilation units. While xfb_stride can be declared multiple times for the same buffer, it is a + // compile-time or link-time error to have different values specified for the stride for the same buffer." + if (xfbBuffers[b].stride != TQualifier::layoutXfbStrideEnd && xfbBuffers[b].implicitStride > xfbBuffers[b].stride) { + error(infoSink, "xfb_stride is too small to hold all buffer entries:"); + infoSink.info.prefix(EPrefixError); + infoSink.info << " xfb_buffer " << (unsigned int)b << ", xfb_stride " << xfbBuffers[b].stride << ", minimum stride needed: " << xfbBuffers[b].implicitStride << "\n"; + } + if (xfbBuffers[b].stride == TQualifier::layoutXfbStrideEnd) + xfbBuffers[b].stride = xfbBuffers[b].implicitStride; + + // "If the buffer is capturing any + // outputs with double-precision or 64-bit integer components, the stride must be a multiple of 8, otherwise it must be a + // multiple of 4, or a compile-time or link-time error results." + if (xfbBuffers[b].contains64BitType && ! IsMultipleOfPow2(xfbBuffers[b].stride, 8)) { + error(infoSink, "xfb_stride must be multiple of 8 for buffer holding a double or 64-bit integer:"); + infoSink.info.prefix(EPrefixError); + infoSink.info << " xfb_buffer " << (unsigned int)b << ", xfb_stride " << xfbBuffers[b].stride << "\n"; + } else if (xfbBuffers[b].contains32BitType && ! IsMultipleOfPow2(xfbBuffers[b].stride, 4)) { + error(infoSink, "xfb_stride must be multiple of 4:"); + infoSink.info.prefix(EPrefixError); + infoSink.info << " xfb_buffer " << (unsigned int)b << ", xfb_stride " << xfbBuffers[b].stride << "\n"; + } + // "If the buffer is capturing any + // outputs with half-precision or 16-bit integer components, the stride must be a multiple of 2" + else if (xfbBuffers[b].contains16BitType && ! IsMultipleOfPow2(xfbBuffers[b].stride, 2)) { + error(infoSink, "xfb_stride must be multiple of 2 for buffer holding a half float or 16-bit integer:"); + infoSink.info.prefix(EPrefixError); + infoSink.info << " xfb_buffer " << (unsigned int)b << ", xfb_stride " << xfbBuffers[b].stride << "\n"; + } + + // "The resulting stride (implicit or explicit), when divided by 4, must be less than or equal to the + // implementation-dependent constant gl_MaxTransformFeedbackInterleavedComponents." + if (xfbBuffers[b].stride > (unsigned int)(4 * resources->maxTransformFeedbackInterleavedComponents)) { + error(infoSink, "xfb_stride is too large:"); + infoSink.info.prefix(EPrefixError); + infoSink.info << " xfb_buffer " << (unsigned int)b << ", components (1/4 stride) needed are " << xfbBuffers[b].stride/4 << ", gl_MaxTransformFeedbackInterleavedComponents is " << resources->maxTransformFeedbackInterleavedComponents << "\n"; + } + } + + switch (language) { + case EShLangVertex: + break; + case EShLangTessControl: + if (vertices == TQualifier::layoutNotSet) + error(infoSink, "At least one shader must specify an output layout(vertices=...)"); + break; + case EShLangTessEvaluation: + if (getSource() == EShSourceGlsl) { + if (inputPrimitive == ElgNone) + error(infoSink, "At least one shader must specify an input layout primitive"); + if (vertexSpacing == EvsNone) + vertexSpacing = EvsEqual; + if (vertexOrder == EvoNone) + vertexOrder = EvoCcw; + } + break; + case EShLangGeometry: + if (inputPrimitive == ElgNone) + error(infoSink, "At least one shader must specify an input layout primitive"); + if (outputPrimitive == ElgNone) + error(infoSink, "At least one shader must specify an output layout primitive"); + if (vertices == TQualifier::layoutNotSet) + error(infoSink, "At least one shader must specify a layout(max_vertices = value)"); + break; + case EShLangFragment: + // for GL_ARB_post_depth_coverage, EarlyFragmentTest is set automatically in + // ParseHelper.cpp. So if we reach here, this must be GL_EXT_post_depth_coverage + // requiring explicit early_fragment_tests + if (getPostDepthCoverage() && !getEarlyFragmentTests()) + error(infoSink, "post_depth_coverage requires early_fragment_tests"); + break; + case EShLangCompute: + sharedBlockCheck(infoSink); + break; + case EShLangRayGen: + case EShLangIntersect: + case EShLangAnyHit: + case EShLangClosestHit: + case EShLangMiss: + case EShLangCallable: + if (numShaderRecordBlocks > 1) + error(infoSink, "Only one shaderRecordNV buffer block is allowed per stage"); + break; + case EShLangMesh: + // NV_mesh_shader doesn't allow use of both single-view and per-view builtins. + if (inIoAccessed("gl_Position") && inIoAccessed("gl_PositionPerViewNV")) + error(infoSink, "Can only use one of gl_Position or gl_PositionPerViewNV"); + if (inIoAccessed("gl_ClipDistance") && inIoAccessed("gl_ClipDistancePerViewNV")) + error(infoSink, "Can only use one of gl_ClipDistance or gl_ClipDistancePerViewNV"); + if (inIoAccessed("gl_CullDistance") && inIoAccessed("gl_CullDistancePerViewNV")) + error(infoSink, "Can only use one of gl_CullDistance or gl_CullDistancePerViewNV"); + if (inIoAccessed("gl_Layer") && inIoAccessed("gl_LayerPerViewNV")) + error(infoSink, "Can only use one of gl_Layer or gl_LayerPerViewNV"); + if (inIoAccessed("gl_ViewportMask") && inIoAccessed("gl_ViewportMaskPerViewNV")) + error(infoSink, "Can only use one of gl_ViewportMask or gl_ViewportMaskPerViewNV"); + if (outputPrimitive == ElgNone) + error(infoSink, "At least one shader must specify an output layout primitive"); + if (vertices == TQualifier::layoutNotSet) + error(infoSink, "At least one shader must specify a layout(max_vertices = value)"); + if (primitives == TQualifier::layoutNotSet) + error(infoSink, "At least one shader must specify a layout(max_primitives = value)"); + [[fallthrough]]; + case EShLangTask: + if (numTaskNVBlocks > 1) + error(infoSink, "Only one taskNV interface block is allowed per shader"); + if (numTaskEXTPayloads > 1) + error(infoSink, "Only single variable of type taskPayloadSharedEXT is allowed per shader"); + sharedBlockCheck(infoSink); + break; + default: + error(infoSink, "Unknown Stage."); + break; + } +} + +// +// See if the call graph contains any static recursion, which is disallowed +// by the specification. +// +void TIntermediate::checkCallGraphCycles(TInfoSink& infoSink) +{ + // Clear fields we'll use for this. + for (TGraph::iterator call = callGraph.begin(); call != callGraph.end(); ++call) { + call->visited = false; + call->currentPath = false; + call->errorGiven = false; + } + + // + // Loop, looking for a new connected subgraph. One subgraph is handled per loop iteration. + // + + TCall* newRoot; + do { + // See if we have unvisited parts of the graph. + newRoot = nullptr; + for (TGraph::iterator call = callGraph.begin(); call != callGraph.end(); ++call) { + if (! call->visited) { + newRoot = &(*call); + break; + } + } + + // If not, we are done. + if (! newRoot) + break; + + // Otherwise, we found a new subgraph, process it: + // See what all can be reached by this new root, and if any of + // that is recursive. This is done by depth-first traversals, seeing + // if a new call is found that was already in the currentPath (a back edge), + // thereby detecting recursion. + std::list stack; + newRoot->currentPath = true; // currentPath will be true iff it is on the stack + stack.push_back(newRoot); + while (! stack.empty()) { + // get a caller + TCall* call = stack.back(); + + // Add to the stack just one callee. + // This algorithm always terminates, because only !visited and !currentPath causes a push + // and all pushes change currentPath to true, and all pops change visited to true. + TGraph::iterator child = callGraph.begin(); + for (; child != callGraph.end(); ++child) { + + // If we already visited this node, its whole subgraph has already been processed, so skip it. + if (child->visited) + continue; + + if (call->callee == child->caller) { + if (child->currentPath) { + // Then, we found a back edge + if (! child->errorGiven) { + error(infoSink, "Recursion detected:"); + infoSink.info << " " << call->callee << " calling " << child->callee << "\n"; + child->errorGiven = true; + recursive = true; + } + } else { + child->currentPath = true; + stack.push_back(&(*child)); + break; + } + } + } + if (child == callGraph.end()) { + // no more callees, we bottomed out, never look at this node again + stack.back()->currentPath = false; + stack.back()->visited = true; + stack.pop_back(); + } + } // end while, meaning nothing left to process in this subtree + + } while (newRoot); // redundant loop check; should always exit via the 'break' above +} + +// +// See which functions are reachable from the entry point and which have bodies. +// Reachable ones with missing bodies are errors. +// Unreachable bodies are dead code. +// +void TIntermediate::checkCallGraphBodies(TInfoSink& infoSink, bool keepUncalled) +{ + // Clear fields we'll use for this. + for (TGraph::iterator call = callGraph.begin(); call != callGraph.end(); ++call) { + call->visited = false; + call->calleeBodyPosition = -1; + } + + // The top level of the AST includes function definitions (bodies). + // Compare these to function calls in the call graph. + // We'll end up knowing which have bodies, and if so, + // how to map the call-graph node to the location in the AST. + TIntermSequence &functionSequence = getTreeRoot()->getAsAggregate()->getSequence(); + std::vector reachable(functionSequence.size(), true); // so that non-functions are reachable + for (int f = 0; f < (int)functionSequence.size(); ++f) { + glslang::TIntermAggregate* node = functionSequence[f]->getAsAggregate(); + if (node && (node->getOp() == glslang::EOpFunction)) { + if (node->getName().compare(getEntryPointMangledName().c_str()) != 0) + reachable[f] = false; // so that function bodies are unreachable, until proven otherwise + for (TGraph::iterator call = callGraph.begin(); call != callGraph.end(); ++call) { + if (call->callee == node->getName()) + call->calleeBodyPosition = f; + } + } + } + + // Start call-graph traversal by visiting the entry point nodes. + for (TGraph::iterator call = callGraph.begin(); call != callGraph.end(); ++call) { + if (call->caller.compare(getEntryPointMangledName().c_str()) == 0) + call->visited = true; + } + + // Propagate 'visited' through the call-graph to every part of the graph it + // can reach (seeded with the entry-point setting above). + bool changed; + do { + changed = false; + for (auto call1 = callGraph.begin(); call1 != callGraph.end(); ++call1) { + if (call1->visited) { + for (TGraph::iterator call2 = callGraph.begin(); call2 != callGraph.end(); ++call2) { + if (! call2->visited) { + if (call1->callee == call2->caller) { + changed = true; + call2->visited = true; + } + } + } + } + } + } while (changed); + + // Any call-graph node set to visited but without a callee body is an error. + for (TGraph::iterator call = callGraph.begin(); call != callGraph.end(); ++call) { + if (call->visited) { + if (call->calleeBodyPosition == -1) { + error(infoSink, "No function definition (body) found: "); + infoSink.info << " " << call->callee << "\n"; + } else + reachable[call->calleeBodyPosition] = true; + } + } + + // Bodies in the AST not reached by the call graph are dead; + // clear them out, since they can't be reached and also can't + // be translated further due to possibility of being ill defined. + if (! keepUncalled) { + for (int f = 0; f < (int)functionSequence.size(); ++f) { + if (! reachable[f]) + { + resetTopLevelUncalledStatus(functionSequence[f]->getAsAggregate()->getName()); + functionSequence[f] = nullptr; + } + } + functionSequence.erase(std::remove(functionSequence.begin(), functionSequence.end(), nullptr), functionSequence.end()); + } +} + +// +// Satisfy rules for location qualifiers on inputs and outputs +// +void TIntermediate::inOutLocationCheck(TInfoSink& infoSink) +{ + // ES 3.0 requires all outputs to have location qualifiers if there is more than one output + bool fragOutWithNoLocation = false; + int numFragOut = 0; + + // TODO: linker functionality: location collision checking + + TIntermSequence& linkObjects = findLinkerObjects()->getSequence(); + for (size_t i = 0; i < linkObjects.size(); ++i) { + const TType& type = linkObjects[i]->getAsTyped()->getType(); + const TQualifier& qualifier = type.getQualifier(); + if (language == EShLangFragment) { + if (qualifier.storage == EvqVaryingOut && qualifier.builtIn == EbvNone) { + ++numFragOut; + if (!qualifier.hasAnyLocation()) + fragOutWithNoLocation = true; + } + } + } + + if (isEsProfile()) { + if (numFragOut > 1 && fragOutWithNoLocation) + error(infoSink, "when more than one fragment shader output, all must have location qualifiers"); + } +} + +TIntermAggregate* TIntermediate::findLinkerObjects() const +{ + // Get the top-level globals + TIntermSequence& globals = treeRoot->getAsAggregate()->getSequence(); + + // Get the last member of the sequences, expected to be the linker-object lists + assert(globals.back()->getAsAggregate()->getOp() == EOpLinkerObjects); + + return globals.back()->getAsAggregate(); +} + +// See if a variable was both a user-declared output and used. +// Note: the spec discusses writing to one, but this looks at read or write, which +// is more useful, and perhaps the spec should be changed to reflect that. +bool TIntermediate::userOutputUsed() const +{ + const TIntermSequence& linkerObjects = findLinkerObjects()->getSequence(); + + bool found = false; + for (size_t i = 0; i < linkerObjects.size(); ++i) { + const TIntermSymbol& symbolNode = *linkerObjects[i]->getAsSymbolNode(); + if (symbolNode.getQualifier().storage == EvqVaryingOut && + symbolNode.getName().compare(0, 3, "gl_") != 0 && + inIoAccessed(symbolNode.getName())) { + found = true; + break; + } + } + + return found; +} + +// Accumulate locations used for inputs, outputs, and uniforms, payload, callable data, and tileImageEXT +// and check for collisions as the accumulation is done. +// +// Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value. +// +// typeCollision is set to true if there is no direct collision, but the types in the same location +// are different. +// +int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& type, bool& typeCollision) +{ + typeCollision = false; + + int set; + if (qualifier.isPipeInput()) + set = 0; + else if (qualifier.isPipeOutput()) + set = 1; + else if (qualifier.storage == EvqUniform) + set = 2; + else if (qualifier.storage == EvqBuffer) + set = 3; + else if (qualifier.storage == EvqTileImageEXT) + set = 4; + else if (qualifier.isAnyPayload()) + set = 0; + else if (qualifier.isAnyCallable()) + set = 1; + else if (qualifier.isHitObjectAttrNV()) + set = 2; + else if (qualifier.isHitObjectAttrEXT()) + set = 2; + else + return -1; + + int size; + if (qualifier.isAnyPayload() || qualifier.isAnyCallable()) { + size = 1; + } else if (qualifier.isUniformOrBuffer() || qualifier.isTaskMemory()) { + if (type.isSizedArray()) + size = type.getCumulativeArraySize(); + else + size = 1; + } else { + // Strip off the outer array dimension for those having an extra one. + if (type.isArray() && qualifier.isArrayedIo(language)) { + TType elementType(type, 0); + size = computeTypeLocationSize(elementType, language); + } else + size = computeTypeLocationSize(type, language); + } + + // Locations, and components within locations. + // + // Almost always, dealing with components means a single location is involved. + // The exception is a dvec3. From the spec: + // + // "A dvec3 will consume all four components of the first location and components 0 and 1 of + // the second location. This leaves components 2 and 3 available for other component-qualified + // declarations." + // + // That means, without ever mentioning a component, a component range + // for a different location gets specified, if it's not a vertex shader input. (!) + // (A vertex shader input will show using only one location, even for a dvec3/4.) + // + // So, for the case of dvec3, we need two independent ioRanges. + // + // For raytracing IO (payloads and callabledata) each declaration occupies a single + // slot irrespective of type. + int collision = -1; // no collision + if (qualifier.isAnyPayload() || qualifier.isAnyCallable() || qualifier.isHitObjectAttrNV() || qualifier.isHitObjectAttrEXT()) { + TRange range(qualifier.layoutLocation, qualifier.layoutLocation); + collision = checkLocationRT(set, qualifier.layoutLocation); + if (collision < 0) + usedIoRT[set].push_back(range); + return collision; + } + if (size == 2 && type.getBasicType() == EbtDouble && type.getVectorSize() == 3 && + (qualifier.isPipeInput() || qualifier.isPipeOutput())) { + // Dealing with dvec3 in/out split across two locations. + // Need two io-ranges. + // The case where the dvec3 doesn't start at component 0 was previously caught as overflow. + + // First range: + TRange locationRange(qualifier.layoutLocation, qualifier.layoutLocation); + TRange componentRange(0, 3); + TIoRange range(locationRange, componentRange, type.getBasicType(), 0, qualifier.centroid, qualifier.smooth, qualifier.flat, qualifier.sample, qualifier.patch); + + // check for collisions + collision = checkLocationRange(set, range, type, typeCollision); + if (collision < 0) { + usedIo[set].push_back(range); + + // Second range: + TRange locationRange2(qualifier.layoutLocation + 1, qualifier.layoutLocation + 1); + TRange componentRange2(0, 1); + TIoRange range2(locationRange2, componentRange2, type.getBasicType(), 0, qualifier.centroid, qualifier.smooth, qualifier.flat, qualifier.sample, qualifier.patch); + + // check for collisions + collision = checkLocationRange(set, range2, type, typeCollision); + if (collision < 0) + usedIo[set].push_back(range2); + } + return collision; + } + + // Not a dvec3 in/out split across two locations, generic path. + // Need a single IO-range block. + + TRange locationRange(qualifier.layoutLocation, qualifier.layoutLocation + size - 1); + TRange componentRange(0, 3); + if (qualifier.hasComponent() || type.getVectorSize() > 0) { + int consumedComponents = type.getVectorSize() * (type.getBasicType() == EbtDouble ? 2 : 1); + if (qualifier.hasComponent()) + componentRange.start = qualifier.layoutComponent; + componentRange.last = componentRange.start + consumedComponents - 1; + } + + // combine location and component ranges + TBasicType basicTy = type.getBasicType(); + if (basicTy == EbtSampler && type.getSampler().isAttachmentEXT()) + basicTy = type.getSampler().type; + TIoRange range(locationRange, componentRange, basicTy, qualifier.hasIndex() ? qualifier.getIndex() : 0, qualifier.centroid, qualifier.smooth, qualifier.flat, qualifier.sample, qualifier.patch); + + // check for collisions, except for vertex inputs on desktop targeting OpenGL + if (! (!isEsProfile() && language == EShLangVertex && qualifier.isPipeInput()) || spvVersion.vulkan > 0) + collision = checkLocationRange(set, range, type, typeCollision); + + if (collision < 0) + usedIo[set].push_back(range); + + return collision; +} + +// Check that two types can be stored in different components in the same location. +// They must be the same type, except signed/unsigned integers are considered compatible. +static bool checkCompatibleTypes(TBasicType t1, TBasicType t2) { + if (t1 != t2) { + if ((t1 == EbtInt8 && t2 == EbtUint8) || + (t2 == EbtInt8 && t1 == EbtUint8) || + (t1 == EbtInt16 && t2 == EbtUint16) || + (t2 == EbtInt16 && t1 == EbtUint16)|| + (t1 == EbtInt && t2 == EbtUint) || + (t2 == EbtInt && t1 == EbtUint)|| + (t1 == EbtInt64 && t2 == EbtUint64) || + (t2 == EbtInt64 && t1 == EbtUint64)) { + return true; + } + } + return t1 == t2; +} + +// Compare a new (the passed in) 'range' against the existing set, and see +// if there are any collisions. +// +// Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value. +// +int TIntermediate::checkLocationRange(int set, const TIoRange& range, const TType& type, bool& typeCollision) +{ + for (size_t r = 0; r < usedIo[set].size(); ++r) { + if (range.overlap(usedIo[set][r])) { + // there is a collision; pick one + return std::max(range.location.start, usedIo[set][r].location.start); + } else if (range.location.overlap(usedIo[set][r].location) && + (!checkCompatibleTypes(type.getBasicType(), usedIo[set][r].basicType) || + type.getQualifier().centroid != usedIo[set][r].centroid || + type.getQualifier().smooth != usedIo[set][r].smooth || + type.getQualifier().flat != usedIo[set][r].flat || + type.getQualifier().sample != usedIo[set][r].sample || + type.getQualifier().patch != usedIo[set][r].patch)) { + // aliased-type mismatch + typeCollision = true; + return std::max(range.location.start, usedIo[set][r].location.start); + } + } + + // check typeCollision between tileImageEXT and out + if (set == 4 || set == 1) { + // if the set is "tileImageEXT", check against "out" and vice versa + int againstSet = (set == 4) ? 1 : 4; + for (size_t r = 0; r < usedIo[againstSet].size(); ++r) { + if (range.location.overlap(usedIo[againstSet][r].location) && type.getBasicType() != usedIo[againstSet][r].basicType) { + // aliased-type mismatch + typeCollision = true; + return std::max(range.location.start, usedIo[againstSet][r].location.start); + } + } + } + + return -1; // no collision +} + +int TIntermediate::checkLocationRT(int set, int location) { + TRange range(location, location); + for (size_t r = 0; r < usedIoRT[set].size(); ++r) { + if (range.overlap(usedIoRT[set][r])) { + return range.start; + } + } + return -1; // no collision +} + +// Accumulate bindings and offsets, and check for collisions +// as the accumulation is done. +// +// Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value. +// +int TIntermediate::addUsedOffsets(int binding, int offset, int numOffsets) +{ + TRange bindingRange(binding, binding); + TRange offsetRange(offset, offset + numOffsets - 1); + TOffsetRange range(bindingRange, offsetRange); + + // check for collisions, except for vertex inputs on desktop + for (size_t r = 0; r < usedAtomics.size(); ++r) { + if (range.overlap(usedAtomics[r])) { + // there is a collision; pick one + return std::max(offset, usedAtomics[r].offset.start); + } + } + + usedAtomics.push_back(range); + + return -1; // no collision +} + +// Accumulate used constant_id values. +// +// Return false is one was already used. +bool TIntermediate::addUsedConstantId(int id) +{ + if (usedConstantId.find(id) != usedConstantId.end()) + return false; + + usedConstantId.insert(id); + + return true; +} + +// Recursively figure out how many locations are used up by an input or output type. +// Return the size of type, as measured by "locations". +int TIntermediate::computeTypeLocationSize(const TType& type, EShLanguage stage) +{ + // "If the declared input is an array of size n and each element takes m locations, it will be assigned m * n + // consecutive locations..." + if (type.isArray()) { + // TODO: perf: this can be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness + // TODO: are there valid cases of having an unsized array with a location? If so, running this code too early. + TType elementType(type, 0); + if (type.isSizedArray() && !type.getQualifier().isPerView()) + return type.getOuterArraySize() * computeTypeLocationSize(elementType, stage); + else { + // unset perViewNV attributes for arrayed per-view outputs: "perviewNV vec4 v[MAX_VIEWS][3];" + elementType.getQualifier().perViewNV = false; + return computeTypeLocationSize(elementType, stage); + } + } + + // "The locations consumed by block and structure members are determined by applying the rules above + // recursively..." + if (type.isStruct()) { + int size = 0; + for (int member = 0; member < (int)type.getStruct()->size(); ++member) { + TType memberType(type, member); + size += computeTypeLocationSize(memberType, stage); + } + return size; + } + + // ES: "If a shader input is any scalar or vector type, it will consume a single location." + + // Desktop: "If a vertex shader input is any scalar or vector type, it will consume a single location. If a non-vertex + // shader input is a scalar or vector type other than dvec3 or dvec4, it will consume a single location, while + // types dvec3 or dvec4 will consume two consecutive locations. Inputs of type double and dvec2 will + // consume only a single location, in all stages." + if (type.isScalar()) + return 1; + if (type.isVector()) { + if (stage == EShLangVertex && type.getQualifier().isPipeInput()) + return 1; + if (type.getBasicType() == EbtDouble && type.getVectorSize() > 2) + return 2; + else + return 1; + } + + // "If the declared input is an n x m single- or double-precision matrix, ... + // The number of locations assigned for each matrix will be the same as + // for an n-element array of m-component vectors..." + if (type.isMatrix()) { + TType columnType(type, 0); + return type.getMatrixCols() * computeTypeLocationSize(columnType, stage); + } + + assert(0); + return 1; +} + +// Same as computeTypeLocationSize but for uniforms +int TIntermediate::computeTypeUniformLocationSize(const TType& type) +{ + // "Individual elements of a uniform array are assigned + // consecutive locations with the first element taking location + // location." + if (type.isArray()) { + // TODO: perf: this can be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness + TType elementType(type, 0); + if (type.isSizedArray()) { + return type.getOuterArraySize() * computeTypeUniformLocationSize(elementType); + } else { + // TODO: are there valid cases of having an implicitly-sized array with a location? If so, running this code too early. + return computeTypeUniformLocationSize(elementType); + } + } + + // "Each subsequent inner-most member or element gets incremental + // locations for the entire structure or array." + if (type.isStruct()) { + int size = 0; + for (int member = 0; member < (int)type.getStruct()->size(); ++member) { + TType memberType(type, member); + size += computeTypeUniformLocationSize(memberType); + } + return size; + } + + return 1; +} + +// Accumulate xfb buffer ranges and check for collisions as the accumulation is done. +// +// Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value. +// +int TIntermediate::addXfbBufferOffset(const TType& type) +{ + const TQualifier& qualifier = type.getQualifier(); + + assert(qualifier.hasXfbOffset() && qualifier.hasXfbBuffer()); + TXfbBuffer& buffer = xfbBuffers[qualifier.layoutXfbBuffer]; + + // compute the range + unsigned int size = computeTypeXfbSize(type, buffer.contains64BitType, buffer.contains32BitType, buffer.contains16BitType); + buffer.implicitStride = std::max(buffer.implicitStride, qualifier.layoutXfbOffset + size); + TRange range(qualifier.layoutXfbOffset, qualifier.layoutXfbOffset + size - 1); + + // check for collisions + for (size_t r = 0; r < buffer.ranges.size(); ++r) { + if (range.overlap(buffer.ranges[r])) { + // there is a collision; pick an example to return + return std::max(range.start, buffer.ranges[r].start); + } + } + + buffer.ranges.push_back(range); + + return -1; // no collision +} + +// Recursively figure out how many bytes of xfb buffer are used by the given type. +// Return the size of type, in bytes. +// Sets contains64BitType to true if the type contains a 64-bit data type. +// Sets contains32BitType to true if the type contains a 32-bit data type. +// Sets contains16BitType to true if the type contains a 16-bit data type. +// N.B. Caller must set contains64BitType, contains32BitType, and contains16BitType to false before calling. +unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains64BitType, bool& contains32BitType, bool& contains16BitType) const +{ + // "...if applied to an aggregate containing a double or 64-bit integer, the offset must also be a multiple of 8, + // and the space taken in the buffer will be a multiple of 8. + // ...within the qualified entity, subsequent components are each + // assigned, in order, to the next available offset aligned to a multiple of + // that component's size. Aggregate types are flattened down to the component + // level to get this sequence of components." + + if (type.isSizedArray()) { + // TODO: perf: this can be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness + // Unsized array use to xfb should be a compile error. + TType elementType(type, 0); + return type.getOuterArraySize() * computeTypeXfbSize(elementType, contains64BitType, contains16BitType, contains16BitType); + } + + if (type.isStruct()) { + unsigned int size = 0; + bool structContains64BitType = false; + bool structContains32BitType = false; + bool structContains16BitType = false; + for (int member = 0; member < (int)type.getStruct()->size(); ++member) { + TType memberType(type, member); + // "... if applied to + // an aggregate containing a double or 64-bit integer, the offset must also be a multiple of 8, + // and the space taken in the buffer will be a multiple of 8." + bool memberContains64BitType = false; + bool memberContains32BitType = false; + bool memberContains16BitType = false; + int memberSize = computeTypeXfbSize(memberType, memberContains64BitType, memberContains32BitType, memberContains16BitType); + if (memberContains64BitType) { + structContains64BitType = true; + RoundToPow2(size, 8); + } else if (memberContains32BitType) { + structContains32BitType = true; + RoundToPow2(size, 4); + } else if (memberContains16BitType) { + structContains16BitType = true; + RoundToPow2(size, 2); + } + size += memberSize; + } + + if (structContains64BitType) { + contains64BitType = true; + RoundToPow2(size, 8); + } else if (structContains32BitType) { + contains32BitType = true; + RoundToPow2(size, 4); + } else if (structContains16BitType) { + contains16BitType = true; + RoundToPow2(size, 2); + } + return size; + } + + int numComponents {0}; + if (type.isScalar()) + numComponents = 1; + else if (type.isVector()) + numComponents = type.getVectorSize(); + else if (type.isMatrix()) + numComponents = type.getMatrixCols() * type.getMatrixRows(); + else { + assert(0); + numComponents = 1; + } + + if (type.getBasicType() == EbtDouble || type.getBasicType() == EbtInt64 || type.getBasicType() == EbtUint64) { + contains64BitType = true; + return 8 * numComponents; + } else if (type.getBasicType() == EbtFloat16 || type.getBasicType() == EbtInt16 || type.getBasicType() == EbtUint16) { + contains16BitType = true; + return 2 * numComponents; + } else if (type.getBasicType() == EbtInt8 || type.getBasicType() == EbtUint8) + return numComponents; + else { + contains32BitType = true; + return 4 * numComponents; + } +} + +const int baseAlignmentVec4Std140 = 16; + +// Return the size and alignment of a component of the given type. +// The size is returned in the 'size' parameter +// Return value is the alignment.. +int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size) +{ + switch (type.getBasicType()) { + case EbtInt64: + case EbtUint64: + case EbtDouble: size = 8; return 8; + case EbtFloat16: size = 2; return 2; + case EbtBFloat16: size = 2; return 2; + case EbtFloatE5M2: + case EbtFloatE4M3: + case EbtInt8: + case EbtUint8: size = 1; return 1; + case EbtInt16: + case EbtUint16: size = 2; return 2; + case EbtReference: size = 8; return 8; + case EbtSampler: + { + if (type.isBindlessImage() || type.isBindlessTexture()) { + size = 8; return 8; + } + else { + size = 4; return 4; + } + } + default: size = 4; return 4; + } +} + +// Implement base-alignment and size rules from section 7.6.2.2 Standard Uniform Block Layout +// Operates recursively. +// +// If std140 is true, it does the rounding up to vec4 size required by std140, +// otherwise it does not, yielding std430 rules. +// +// The size is returned in the 'size' parameter +// +// The stride is only non-0 for arrays or matrices, and is the stride of the +// top-level object nested within the type. E.g., for an array of matrices, +// it is the distances needed between matrices, despite the rules saying the +// stride comes from the flattening down to vectors. +// +// Return value is the alignment of the type. +int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, TLayoutPacking layoutPacking, bool rowMajor) +{ + int alignment; + + bool std140 = layoutPacking == glslang::ElpStd140; + // When using the std140 storage layout, structures will be laid out in buffer + // storage with its members stored in monotonically increasing order based on their + // location in the declaration. A structure and each structure member have a base + // offset and a base alignment, from which an aligned offset is computed by rounding + // the base offset up to a multiple of the base alignment. The base offset of the first + // member of a structure is taken from the aligned offset of the structure itself. The + // base offset of all other structure members is derived by taking the offset of the + // last basic machine unit consumed by the previous member and adding one. Each + // structure member is stored in memory at its aligned offset. The members of a top- + // level uniform block are laid out in buffer storage by treating the uniform block as + // a structure with a base offset of zero. + // + // 1. If the member is a scalar consuming N basic machine units, the base alignment is N. + // + // 2. If the member is a two- or four-component vector with components consuming N basic + // machine units, the base alignment is 2N or 4N, respectively. + // + // 3. If the member is a three-component vector with components consuming N + // basic machine units, the base alignment is 4N. + // + // 4. If the member is an array of scalars or vectors, the base alignment and array + // stride are set to match the base alignment of a single array element, according + // to rules (1), (2), and (3), and rounded up to the base alignment of a vec4. The + // array may have padding at the end; the base offset of the member following + // the array is rounded up to the next multiple of the base alignment. + // + // 5. If the member is a column-major matrix with C columns and R rows, the + // matrix is stored identically to an array of C column vectors with R + // components each, according to rule (4). + // + // 6. If the member is an array of S column-major matrices with C columns and + // R rows, the matrix is stored identically to a row of S X C column vectors + // with R components each, according to rule (4). + // + // 7. If the member is a row-major matrix with C columns and R rows, the matrix + // is stored identically to an array of R row vectors with C components each, + // according to rule (4). + // + // 8. If the member is an array of S row-major matrices with C columns and R + // rows, the matrix is stored identically to a row of S X R row vectors with C + // components each, according to rule (4). + // + // 9. If the member is a structure, the base alignment of the structure is N , where + // N is the largest base alignment value of any of its members, and rounded + // up to the base alignment of a vec4. The individual members of this substructure + // are then assigned offsets by applying this set of rules recursively, + // where the base offset of the first member of the sub-structure is equal to the + // aligned offset of the structure. The structure may have padding at the end; + // the base offset of the member following the sub-structure is rounded up to + // the next multiple of the base alignment of the structure. + // + // 10. If the member is an array of S structures, the S elements of the array are laid + // out in order, according to rule (9). + // + // Assuming, for rule 10: The stride is the same as the size of an element. + + stride = 0; + int dummyStride; + + // rules 4, 6, 8, and 10 + if (type.isArray()) { + // TODO: perf: this might be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness + TType derefType(type, 0); + alignment = getBaseAlignment(derefType, size, dummyStride, layoutPacking, rowMajor); + if (std140) + alignment = std::max(baseAlignmentVec4Std140, alignment); + RoundToPow2(size, alignment); + stride = size; // uses full matrix size for stride of an array of matrices (not quite what rule 6/8, but what's expected) + // uses the assumption for rule 10 in the comment above + // use one element to represent the last member of SSBO which is unsized array + int arraySize = (type.isUnsizedArray() && (type.getOuterArraySize() == 0)) ? 1 : type.getOuterArraySize(); + size = stride * arraySize; + return alignment; + } + + // rule 9 + if (type.getBasicType() == EbtStruct || type.getBasicType() == EbtBlock) { + const TTypeList& memberList = *type.getStruct(); + + size = 0; + int maxAlignment = std140 ? baseAlignmentVec4Std140 : 0; + for (size_t m = 0; m < memberList.size(); ++m) { + int memberSize; + // modify just the children's view of matrix layout, if there is one for this member + TLayoutMatrix subMatrixLayout = memberList[m].type->getQualifier().layoutMatrix; + int memberAlignment = getBaseAlignment(*memberList[m].type, memberSize, dummyStride, layoutPacking, + (subMatrixLayout != ElmNone) ? (subMatrixLayout == ElmRowMajor) : rowMajor); + maxAlignment = std::max(maxAlignment, memberAlignment); + RoundToPow2(size, memberAlignment); + size += memberSize; + } + + // The structure may have padding at the end; the base offset of + // the member following the sub-structure is rounded up to the next + // multiple of the base alignment of the structure. + RoundToPow2(size, maxAlignment); + + return maxAlignment; + } + + // rule 1 + if (type.isScalar()) + return getBaseAlignmentScalar(type, size); + + // rules 2 and 3 + if (type.isVector()) { + int scalarAlign = getBaseAlignmentScalar(type, size); + switch (type.getVectorSize()) { + case 1: // HLSL has this, GLSL does not + return scalarAlign; + case 2: + size *= 2; + return 2 * scalarAlign; + default: + size *= type.getVectorSize(); + return 4 * scalarAlign; + } + } + + // rules 5 and 7 + if (type.isMatrix()) { + // rule 5: deref to row, not to column, meaning the size of vector is num columns instead of num rows + TType derefType(type, 0, rowMajor); + + alignment = getBaseAlignment(derefType, size, dummyStride, layoutPacking, rowMajor); + if (std140) + alignment = std::max(baseAlignmentVec4Std140, alignment); + RoundToPow2(size, alignment); + stride = size; // use intra-matrix stride for stride of a just a matrix + if (rowMajor) + size = stride * type.getMatrixRows(); + else + size = stride * type.getMatrixCols(); + + return alignment; + } + + assert(0); // all cases should be covered above + size = baseAlignmentVec4Std140; + return baseAlignmentVec4Std140; +} + +// To aid the basic HLSL rule about crossing vec4 boundaries. +bool TIntermediate::improperStraddle(const TType& type, int size, int offset, bool vectorLike) +{ + if (! vectorLike || type.isArray()) + return false; + + return size <= 16 ? offset / 16 != (offset + size - 1) / 16 + : offset % 16 != 0; +} + +int TIntermediate::getScalarAlignment(const TType& type, int& size, int& stride, bool rowMajor) +{ + int alignment; + + stride = 0; + int dummyStride; + + if (type.isArray()) { + TType derefType(type, 0); + alignment = getScalarAlignment(derefType, size, dummyStride, rowMajor); + + stride = size; + RoundToPow2(stride, alignment); + + size = stride * (type.getOuterArraySize() - 1) + size; + return alignment; + } + + if (type.getBasicType() == EbtStruct) { + const TTypeList& memberList = *type.getStruct(); + + size = 0; + int maxAlignment = 0; + for (size_t m = 0; m < memberList.size(); ++m) { + int memberSize; + // modify just the children's view of matrix layout, if there is one for this member + TLayoutMatrix subMatrixLayout = memberList[m].type->getQualifier().layoutMatrix; + int memberAlignment = getScalarAlignment(*memberList[m].type, memberSize, dummyStride, + (subMatrixLayout != ElmNone) ? (subMatrixLayout == ElmRowMajor) : rowMajor); + maxAlignment = std::max(maxAlignment, memberAlignment); + RoundToPow2(size, memberAlignment); + size += memberSize; + } + + return maxAlignment; + } + + if (type.isScalar()) + return getBaseAlignmentScalar(type, size); + + if (type.isVector()) { + int scalarAlign = getBaseAlignmentScalar(type, size); + + size *= type.getVectorSize(); + return scalarAlign; + } + + if (type.isMatrix()) { + TType derefType(type, 0, rowMajor); + + alignment = getScalarAlignment(derefType, size, dummyStride, rowMajor); + + stride = size; // use intra-matrix stride for stride of a just a matrix + if (rowMajor) + size = stride * type.getMatrixRows(); + else + size = stride * type.getMatrixCols(); + + return alignment; + } + + assert(0); // all cases should be covered above + size = 1; + return 1; +} + +int TIntermediate::getMemberAlignment(const TType& type, int& size, int& stride, TLayoutPacking layoutPacking, bool rowMajor) +{ + if (layoutPacking == glslang::ElpScalar) { + return getScalarAlignment(type, size, stride, rowMajor); + } else { + return getBaseAlignment(type, size, stride, layoutPacking, rowMajor); + } +} + +// shared calculation by getOffset and getOffsets +void TIntermediate::updateOffset(const TType& parentType, const TType& memberType, int& offset, int& memberSize) +{ + int dummyStride; + + // modify just the children's view of matrix layout, if there is one for this member + TLayoutMatrix subMatrixLayout = memberType.getQualifier().layoutMatrix; + int memberAlignment = getMemberAlignment(memberType, memberSize, dummyStride, + parentType.getQualifier().layoutPacking, + subMatrixLayout != ElmNone + ? subMatrixLayout == ElmRowMajor + : parentType.getQualifier().layoutMatrix == ElmRowMajor); + RoundToPow2(offset, memberAlignment); +} + +// Lookup or calculate the offset of a block member, using the recursively +// defined block offset rules. +int TIntermediate::getOffset(const TType& type, int index) +{ + const TTypeList& memberList = *type.getStruct(); + + // Don't calculate offset if one is present, it could be user supplied + // and different than what would be calculated. That is, this is faster, + // but not just an optimization. + if (memberList[index].type->getQualifier().hasOffset()) + return memberList[index].type->getQualifier().layoutOffset; + + int memberSize = 0; + int offset = 0; + for (int m = 0; m <= index; ++m) { + updateOffset(type, *memberList[m].type, offset, memberSize); + + if (m < index) + offset += memberSize; + } + + return offset; +} + +// Calculate the block data size. +// Block arrayness is not taken into account, each element is backed by a separate buffer. +int TIntermediate::getBlockSize(const TType& blockType) +{ + const TTypeList& memberList = *blockType.getStruct(); + int lastIndex = (int)memberList.size() - 1; + int lastOffset = getOffset(blockType, lastIndex); + + int lastMemberSize; + int dummyStride; + getMemberAlignment(*memberList[lastIndex].type, lastMemberSize, dummyStride, + blockType.getQualifier().layoutPacking, + blockType.getQualifier().layoutMatrix == ElmRowMajor); + + return lastOffset + lastMemberSize; +} + +int TIntermediate::computeBufferReferenceTypeSize(const TType& type) +{ + assert(type.isReference()); + int size = getBlockSize(*type.getReferentType()); + + int align = type.getBufferReferenceAlignment(); + + if (align) { + size = (size + align - 1) & ~(align-1); + } + + return size; +} + +bool TIntermediate::isIoResizeArray(const TType& type, EShLanguage language) { + return type.isArray() && + ((language == EShLangGeometry && type.getQualifier().storage == EvqVaryingIn) || + (language == EShLangTessControl && (type.getQualifier().storage == EvqVaryingIn || type.getQualifier().storage == EvqVaryingOut) && + ! type.getQualifier().patch) || + (language == EShLangTessEvaluation && type.getQualifier().storage == EvqVaryingIn) || + (language == EShLangFragment && type.getQualifier().storage == EvqVaryingIn && + (type.getQualifier().pervertexNV || type.getQualifier().pervertexEXT)) || + (language == EShLangMesh && type.getQualifier().storage == EvqVaryingOut && + !type.getQualifier().perTaskNV)); +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h new file mode 100644 index 0000000000..4d8db9b7af --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h @@ -0,0 +1,1360 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. +// Copyright (C) 2015-2018 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef _LOCAL_INTERMEDIATE_INCLUDED_ +#define _LOCAL_INTERMEDIATE_INCLUDED_ + +#include "../Include/intermediate.h" +#include "../Public/ShaderLang.h" +#include "Versions.h" + +#include +#include +#include +#include +#include +#include +#include + +namespace QtShaderTools { +class TInfoSink; + +namespace glslang { + +struct TMatrixSelector { + int coord1; // stay agnostic about column/row; this is parse order + int coord2; +}; + +typedef int TVectorSelector; + +const int MaxSwizzleSelectors = 4; + +template +class TSwizzleSelectors { +public: + TSwizzleSelectors() : size_(0) { } + + void push_back(selectorType comp) + { + if (size_ < MaxSwizzleSelectors) + components[size_++] = comp; + } + void resize(int s) + { + assert(s <= size_); + size_ = s; + } + int size() const { return size_; } + selectorType operator[](int i) const + { + assert(i < MaxSwizzleSelectors); + return components[i]; + } + +private: + int size_; + selectorType components[MaxSwizzleSelectors]; +}; + +// +// Some helper structures for TIntermediate. Their contents are encapsulated +// by TIntermediate. +// + +// Used for call-graph algorithms for detecting recursion, missing bodies, and dead bodies. +// A "call" is a pair: . +// There can be duplicates. General assumption is the list is small. +struct TCall { + TCall(const TString& pCaller, const TString& pCallee) + : caller(pCaller), callee(pCallee), visited(false), currentPath(false), errorGiven(false) { } + TString caller; + TString callee; + bool visited; + bool currentPath; + bool errorGiven; + int calleeBodyPosition; +}; + +// A generic 1-D range. +struct TRange { + TRange(int start, int last) : start(start), last(last) { } + bool overlap(const TRange& rhs) const + { + return last >= rhs.start && start <= rhs.last; + } + int start; + int last; +}; + +// An IO range is a 3-D rectangle; the set of (location, component, index) triples all lying +// within the same location range, component range, and index value. Locations don't alias unless +// all other dimensions of their range overlap. +struct TIoRange { + TIoRange(TRange location, TRange component, TBasicType basicType, int index, bool centroid, bool smooth, bool flat, bool sample, bool patch) + : location(location), component(component), basicType(basicType), index(index), centroid(centroid), smooth(smooth), flat(flat), sample(sample), patch(patch) + { + } + bool overlap(const TIoRange& rhs) const + { + return location.overlap(rhs.location) && component.overlap(rhs.component) && index == rhs.index; + } + TRange location; + TRange component; + TBasicType basicType; + int index; + bool centroid; + bool smooth; + bool flat; + bool sample; + bool patch; +}; + +// An offset range is a 2-D rectangle; the set of (binding, offset) pairs all lying +// within the same binding and offset range. +struct TOffsetRange { + TOffsetRange(TRange binding, TRange offset) + : binding(binding), offset(offset) { } + bool overlap(const TOffsetRange& rhs) const + { + return binding.overlap(rhs.binding) && offset.overlap(rhs.offset); + } + TRange binding; + TRange offset; +}; + +// Things that need to be tracked per xfb buffer. +struct TXfbBuffer { + TXfbBuffer() : stride(TQualifier::layoutXfbStrideEnd), implicitStride(0), contains64BitType(false), + contains32BitType(false), contains16BitType(false) { } + std::vector ranges; // byte offsets that have already been assigned + unsigned int stride; + unsigned int implicitStride; + bool contains64BitType; + bool contains32BitType; + bool contains16BitType; +}; + +// Track a set of strings describing how the module was processed. +// This includes command line options, transforms, etc., ideally inclusive enough +// to reproduce the steps used to transform the input source to the output. +// E.g., see SPIR-V OpModuleProcessed. +// Each "process" or "transform" uses is expressed in the form: +// process arg0 arg1 arg2 ... +// process arg0 arg1 arg2 ... +// where everything is textual, and there can be zero or more arguments +class TProcesses { +public: + TProcesses() {} + ~TProcesses() {} + + void addProcess(const char* process) + { + processes.push_back(process); + } + void addProcess(const std::string& process) + { + processes.push_back(process); + } + void addArgument(int arg) + { + processes.back().append(" "); + std::string argString = std::to_string(arg); + processes.back().append(argString); + } + void addArgument(const char* arg) + { + processes.back().append(" "); + processes.back().append(arg); + } + void addArgument(const std::string& arg) + { + processes.back().append(" "); + processes.back().append(arg); + } + void addIfNonZero(const char* process, int value) + { + if (value != 0) { + addProcess(process); + addArgument(value); + } + } + + const std::vector& getProcesses() const { return processes; } + +private: + std::vector processes; +}; + +class TSymbolTable; +class TSymbol; +class TVariable; + +// +// Texture and Sampler transformation mode. +// +enum ComputeDerivativeMode { + LayoutDerivativeNone, // default layout as SPV_NV_compute_shader_derivatives not enabled + LayoutDerivativeGroupQuads, // derivative_group_quadsNV + LayoutDerivativeGroupLinear, // derivative_group_linearNV +}; + +// +// Status type on AST level. Some uncalled status or functions would be reset in call graph. +// Currently we will keep status set by explicitly declared layout or variable decl. +// +enum AstRefType { + AstRefTypeVar, // Status set by variable decl + AstRefTypeFunc, // Status set by function decl + AstRefTypeLayout, // Status set by layout decl +}; + +class TIdMaps { +public: + TMap& operator[](long long i) { return maps[i]; } + const TMap& operator[](long long i) const { return maps[i]; } +private: + TMap maps[EsiCount]; +}; + +class TNumericFeatures { +public: + TNumericFeatures() : features(0) { } + TNumericFeatures(const TNumericFeatures&) = delete; + TNumericFeatures& operator=(const TNumericFeatures&) = delete; + typedef enum : unsigned int { + shader_explicit_arithmetic_types = 1 << 0, + shader_explicit_arithmetic_types_int8 = 1 << 1, + shader_explicit_arithmetic_types_int16 = 1 << 2, + shader_explicit_arithmetic_types_int32 = 1 << 3, + shader_explicit_arithmetic_types_int64 = 1 << 4, + shader_explicit_arithmetic_types_float16 = 1 << 5, + shader_explicit_arithmetic_types_float32 = 1 << 6, + shader_explicit_arithmetic_types_float64 = 1 << 7, + shader_implicit_conversions = 1 << 8, + gpu_shader_fp64 = 1 << 9, + gpu_shader_int16 = 1 << 10, + gpu_shader_half_float = 1 << 11, + nv_gpu_shader5_types = 1 << 12, + } feature; + void insert(feature f) { features |= f; } + void erase(feature f) { features &= ~f; } + bool contains(feature f) const { return (features & f) != 0; } +private: + unsigned int features; +}; + +// MustBeAssigned wraps a T, asserting that it has been assigned with +// operator =() before attempting to read with operator T() or operator ->(). +// Used to catch cases where fields are read before they have been assigned. +template +class MustBeAssigned +{ +public: + MustBeAssigned() = default; + MustBeAssigned(const T& v) : value(v) {} + operator const T&() const { assert(isSet); return value; } + const T* operator ->() const { assert(isSet); return &value; } + MustBeAssigned& operator = (const T& v) { value = v; isSet = true; return *this; } +private: + T value; + bool isSet = false; +}; + +// +// Set of helper functions to help parse and build the tree. +// +class TIntermediate { +public: + explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) : + language(l), + profile(p), version(v), + treeRoot(nullptr), + resources(TBuiltInResource{}), + numEntryPoints(0), numErrors(0), numPushConstants(0), recursive(false), + invertY(false), + dxPositionW(false), + enhancedMsgs(false), + debugInfo(false), + useStorageBuffer(false), + invariantAll(false), + nanMinMaxClamp(false), + depthReplacing(false), + stencilReplacing(false), + uniqueId(0), + globalUniformBlockName(""), + atomicCounterBlockName(""), + globalUniformBlockSet(TQualifier::layoutSetEnd), + globalUniformBlockBinding(TQualifier::layoutBindingEnd), + atomicCounterBlockSet(TQualifier::layoutSetEnd), + implicitThisName("@this"), implicitCounterName("@count"), + source(EShSourceNone), + useVulkanMemoryModel(false), + invocations(TQualifier::layoutNotSet), vertices(TQualifier::layoutNotSet), + inputPrimitive(ElgNone), outputPrimitive(ElgNone), + pixelCenterInteger(false), originUpperLeft(false),texCoordBuiltinRedeclared(false), + vertexSpacing(EvsNone), vertexOrder(EvoNone), interlockOrdering(EioNone), pointMode(false), earlyFragmentTests(false), + postDepthCoverage(false), earlyAndLateFragmentTestsAMD(false), + nonCoherentColorAttachmentReadEXT(false), + nonCoherentDepthAttachmentReadEXT(false), + nonCoherentStencilAttachmentReadEXT(false), + depthLayout(EldNone), + stencilLayout(ElsNone), + hlslFunctionality1(false), + blendEquations(0), xfbMode(false), multiStream(false), + layoutOverrideCoverage(false), + geoPassthroughEXT(false), + numShaderRecordBlocks(0), + computeDerivativeMode(LayoutDerivativeNone), + primitives(TQualifier::layoutNotSet), + numTaskNVBlocks(0), + layoutPrimitiveCulling(false), + numTaskEXTPayloads(0), + nonCoherentTileAttachmentReadQCOM(false), + autoMapBindings(false), + autoMapLocations(false), + flattenUniformArrays(false), + useUnknownFormat(false), + hlslOffsets(false), + hlslIoMapping(false), + useVariablePointers(false), + textureSamplerTransformMode(EShTexSampTransKeep), + needToLegalize(false), + binaryDoubleOutput(false), + subgroupUniformControlFlow(false), + maximallyReconverges(false), + usePhysicalStorageBuffer(false), + spirvRequirement(nullptr), + spirvExecutionMode(nullptr), + uniformLocationBase(0), + quadDerivMode(false), reqFullQuadsMode(false) + { + localSize[0] = 1; + localSize[1] = 1; + localSize[2] = 1; + localSizeNotDefault[0] = false; + localSizeNotDefault[1] = false; + localSizeNotDefault[2] = false; + localSizeSpecId[0] = TQualifier::layoutNotSet; + localSizeSpecId[1] = TQualifier::layoutNotSet; + localSizeSpecId[2] = TQualifier::layoutNotSet; + xfbBuffers.resize(TQualifier::layoutXfbBufferEnd); + tileShadingRateQCOM[0] = 0; + tileShadingRateQCOM[1] = 0; + tileShadingRateQCOM[2] = 0; + tileShadingRateQCOMNotDefault[0] = false; + tileShadingRateQCOMNotDefault[1] = false; + tileShadingRateQCOMNotDefault[2] = false; + shiftBinding.fill(0); + } + + void setVersion(int v) + { + version = v; + } + void setProfile(EProfile p) + { + profile = p; + } + + int getVersion() const { return version; } + EProfile getProfile() const { return profile; } + void setSpv(const SpvVersion& s) + { + spvVersion = s; + + // client processes + if (spvVersion.vulkan > 0) + processes.addProcess("client vulkan100"); + if (spvVersion.openGl > 0) + processes.addProcess("client opengl100"); + + // target SPV + switch (spvVersion.spv) { + case 0: + break; + case EShTargetSpv_1_0: + break; + case EShTargetSpv_1_1: + processes.addProcess("target-env spirv1.1"); + break; + case EShTargetSpv_1_2: + processes.addProcess("target-env spirv1.2"); + break; + case EShTargetSpv_1_3: + processes.addProcess("target-env spirv1.3"); + break; + case EShTargetSpv_1_4: + processes.addProcess("target-env spirv1.4"); + break; + case EShTargetSpv_1_5: + processes.addProcess("target-env spirv1.5"); + break; + case EShTargetSpv_1_6: + processes.addProcess("target-env spirv1.6"); + break; + default: + processes.addProcess("target-env spirvUnknown"); + break; + } + + // target-environment processes + switch (spvVersion.vulkan) { + case 0: + break; + case EShTargetVulkan_1_0: + processes.addProcess("target-env vulkan1.0"); + break; + case EShTargetVulkan_1_1: + processes.addProcess("target-env vulkan1.1"); + break; + case EShTargetVulkan_1_2: + processes.addProcess("target-env vulkan1.2"); + break; + case EShTargetVulkan_1_3: + processes.addProcess("target-env vulkan1.3"); + break; + case EShTargetVulkan_1_4: + processes.addProcess("target-env vulkan1.4"); + break; + default: + processes.addProcess("target-env vulkanUnknown"); + break; + } + if (spvVersion.openGl > 0) + processes.addProcess("target-env opengl"); + } + const SpvVersion& getSpv() const { return spvVersion; } + EShLanguage getStage() const { return language; } + void addRequestedExtension(const char* extension) { requestedExtensions.insert(extension); } + const std::set& getRequestedExtensions() const { return requestedExtensions; } + bool isRayTracingStage() const { + return language >= EShLangRayGen && language <= EShLangCallableNV; + } + + void setTreeRoot(TIntermNode* r) { treeRoot = r; } + TIntermNode* getTreeRoot() const { return treeRoot; } + void incrementEntryPointCount() { ++numEntryPoints; } + int getNumEntryPoints() const { return numEntryPoints; } + int getNumErrors() const { return numErrors; } + void addPushConstantCount() { ++numPushConstants; } + void setLimits(const TBuiltInResource& r) { resources = r; } + const TBuiltInResource& getLimits() const { return resources; } + + bool postProcess(TIntermNode*, EShLanguage); + void removeTree(); + + void setEntryPointName(const char* ep) + { + entryPointName = ep; + processes.addProcess("entry-point"); + processes.addArgument(entryPointName); + } + void setEntryPointMangledName(const char* ep) { entryPointMangledName = ep; } + const std::string& getEntryPointName() const { return entryPointName; } + const std::string& getEntryPointMangledName() const { return entryPointMangledName; } + + void setDebugInfo(bool debuginfo) + { + debugInfo = debuginfo; + } + bool getDebugInfo() const { return debugInfo; } + + void setInvertY(bool invert) + { + invertY = invert; + if (invertY) + processes.addProcess("invert-y"); + } + bool getInvertY() const { return invertY; } + + void setDxPositionW(bool dxPosW) + { + dxPositionW = dxPosW; + if (dxPositionW) + processes.addProcess("dx-position-w"); + } + bool getDxPositionW() const { return dxPositionW; } + + void setEnhancedMsgs() + { + enhancedMsgs = true; + } + bool getEnhancedMsgs() const { return enhancedMsgs && getSource() == EShSourceGlsl; } + +#ifdef ENABLE_HLSL + void setSource(EShSource s) { source = s; } + EShSource getSource() const { return source; } +#else + void setSource(EShSource s) { assert(s == EShSourceGlsl); (void)s; } + EShSource getSource() const { return EShSourceGlsl; } +#endif + + bool isRecursive() const { return recursive; } + + TIntermSymbol* addSymbol(const TVariable&); + TIntermSymbol* addSymbol(const TVariable&, const TSourceLoc&); + TIntermSymbol* addSymbol(const TType&, const TSourceLoc&); + TIntermSymbol* addSymbol(const TIntermSymbol&); + TIntermTyped* addConversion(TOperator, const TType&, TIntermTyped*); + std::tuple addPairConversion(TOperator op, TIntermTyped* node0, TIntermTyped* node1); + TIntermTyped* addUniShapeConversion(TOperator, const TType&, TIntermTyped*); + TIntermTyped* addConversion(TBasicType convertTo, TIntermTyped* node) const; + void addBiShapeConversion(TOperator, TIntermTyped*& lhsNode, TIntermTyped*& rhsNode); + TIntermTyped* addShapeConversion(const TType&, TIntermTyped*); + TIntermTyped* addBinaryMath(TOperator, TIntermTyped* left, TIntermTyped* right, const TSourceLoc&); + TIntermTyped* addAssign(TOperator op, TIntermTyped* left, TIntermTyped* right, const TSourceLoc&); + TIntermTyped* addIndex(TOperator op, TIntermTyped* base, TIntermTyped* index, const TSourceLoc&); + TIntermTyped* addUnaryMath(TOperator, TIntermTyped* child, const TSourceLoc&); + TIntermTyped* addBuiltInFunctionCall(const TSourceLoc& line, TOperator, bool unary, TIntermNode*, const TType& returnType); + bool canImplicitlyPromote(TBasicType from, TBasicType to, TOperator op = EOpNull) const; + bool isIntegralPromotion(TBasicType from, TBasicType to) const; + bool isFPPromotion(TBasicType from, TBasicType to) const; + bool isIntegralConversion(TBasicType from, TBasicType to) const; + bool isFPConversion(TBasicType from, TBasicType to) const; + bool isFPIntegralConversion(TBasicType from, TBasicType to) const; + TOperator mapTypeToConstructorOp(const TType&) const; + TIntermAggregate* growAggregate(TIntermNode* left, TIntermNode* right); + TIntermAggregate* growAggregate(TIntermNode* left, TIntermNode* right, const TSourceLoc&); + TIntermAggregate* mergeAggregate(TIntermNode* left, TIntermNode* right); + TIntermAggregate* mergeAggregate(TIntermNode* left, TIntermNode* right, const TSourceLoc&); + TIntermAggregate* makeAggregate(TIntermNode* node); + TIntermAggregate* makeAggregate(TIntermNode* node, const TSourceLoc&); + TIntermAggregate* makeAggregate(const TSourceLoc&); + TIntermTyped* setAggregateOperator(TIntermNode*, TOperator, const TType& type, const TSourceLoc&); + bool areAllChildConst(TIntermAggregate* aggrNode); + TIntermSelection* addSelection(TIntermTyped* cond, TIntermNodePair code, const TSourceLoc&); + TIntermTyped* addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, const TSourceLoc&); + TIntermTyped* addComma(TIntermTyped* left, TIntermTyped* right, const TSourceLoc&); + TIntermTyped* addMethod(TIntermTyped*, const TType&, const TString*, const TSourceLoc&); + TIntermConstantUnion* addConstantUnion(const TConstUnionArray&, const TType&, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(signed char, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(unsigned char, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(signed short, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(unsigned short, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(int, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(unsigned int, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(long long, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(unsigned long long, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(bool, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(double, TBasicType, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(const TString*, const TSourceLoc&, bool literal = false) const; + TIntermTyped* promoteConstantUnion(TBasicType, TIntermConstantUnion*) const; + bool parseConstTree(TIntermNode*, TConstUnionArray, TOperator, const TType&, bool singleConstantParam = false); + TIntermLoop* addLoop(TIntermNode*, TIntermNode*, TIntermTyped*, bool testFirst, const TSourceLoc&); + TIntermAggregate* addForLoop(TIntermNode*, TIntermNode*, TIntermNode*, TIntermTyped*, bool testFirst, + const TSourceLoc&, TIntermLoop*&); + TIntermBranch* addBranch(TOperator, const TSourceLoc&); + TIntermBranch* addBranch(TOperator, TIntermTyped*, const TSourceLoc&); + template TIntermTyped* addSwizzle(TSwizzleSelectors&, const TSourceLoc&); + + // Low level functions to add nodes (no conversions or other higher level transformations) + // If a type is provided, the node's type will be set to it. + TIntermBinary* addBinaryNode(TOperator op, TIntermTyped* left, TIntermTyped* right, const TSourceLoc&) const; + TIntermBinary* addBinaryNode(TOperator op, TIntermTyped* left, TIntermTyped* right, const TSourceLoc&, + const TType&) const; + TIntermUnary* addUnaryNode(TOperator op, TIntermTyped* child, const TSourceLoc&) const; + TIntermUnary* addUnaryNode(TOperator op, TIntermTyped* child, const TSourceLoc&, const TType&) const; + + // Constant folding (in Constant.cpp) + TIntermTyped* fold(TIntermAggregate* aggrNode); + TIntermTyped* foldConstructor(TIntermAggregate* aggrNode); + TIntermTyped* foldDereference(TIntermTyped* node, int index, const TSourceLoc&); + TIntermTyped* foldSwizzle(TIntermTyped* node, TSwizzleSelectors& fields, const TSourceLoc&); + + // Tree ops + static const TIntermTyped* traverseLValueBase(const TIntermTyped*, bool swizzleOkay, bool bufferReferenceOk = false, + std::function proc = {}); + + // Linkage related + void addSymbolLinkageNodes(TIntermAggregate*& linkage, EShLanguage, TSymbolTable&); + void addSymbolLinkageNode(TIntermAggregate*& linkage, const TSymbol&); + TIntermAggregate* findLinkerObjects() const; + + void setGlobalUniformBlockName(const char* name) { globalUniformBlockName = std::string(name); } + const char* getGlobalUniformBlockName() const { return globalUniformBlockName.c_str(); } + void setGlobalUniformSet(unsigned int set) { globalUniformBlockSet = set; } + unsigned int getGlobalUniformSet() const { return globalUniformBlockSet; } + void setGlobalUniformBinding(unsigned int binding) { globalUniformBlockBinding = binding; } + unsigned int getGlobalUniformBinding() const { return globalUniformBlockBinding; } + + void setAtomicCounterBlockName(const char* name) { atomicCounterBlockName = std::string(name); } + const char* getAtomicCounterBlockName() const { return atomicCounterBlockName.c_str(); } + void setAtomicCounterBlockSet(unsigned int set) { atomicCounterBlockSet = set; } + unsigned int getAtomicCounterBlockSet() const { return atomicCounterBlockSet; } + + + void setUseStorageBuffer() { useStorageBuffer = true; } + bool usingStorageBuffer() const { return useStorageBuffer; } + void setInvariantAll() { invariantAll = true; } + bool isInvariantAll() const { return invariantAll; } + void setDepthReplacing() { depthReplacing = true; } + bool isDepthReplacing() const { return depthReplacing; } + void setStencilReplacing() { stencilReplacing = true; } + bool isStencilReplacing() const { return stencilReplacing; } + bool setLocalSize(int dim, int size) + { + if (localSizeNotDefault[dim]) + return size == localSize[dim]; + localSizeNotDefault[dim] = true; + localSize[dim] = size; + return true; + } + unsigned int getLocalSize(int dim) const { return localSize[dim]; } + bool isLocalSizeSet() const + { + // Return true if any component has been set (i.e. any component is not default). + return localSizeNotDefault[0] || localSizeNotDefault[1] || localSizeNotDefault[2]; + } + bool setLocalSizeSpecId(int dim, int id) + { + if (localSizeSpecId[dim] != TQualifier::layoutNotSet) + return id == localSizeSpecId[dim]; + localSizeSpecId[dim] = id; + return true; + } + int getLocalSizeSpecId(int dim) const { return localSizeSpecId[dim]; } + bool isLocalSizeSpecialized() const + { + // Return true if any component has been specialized. + return localSizeSpecId[0] != TQualifier::layoutNotSet || + localSizeSpecId[1] != TQualifier::layoutNotSet || + localSizeSpecId[2] != TQualifier::layoutNotSet; + } + void output(TInfoSink&, bool tree); + + bool isEsProfile() const { return profile == EEsProfile; } + + bool setTileShadingRateQCOM(int dim, int size) + { + if (tileShadingRateQCOMNotDefault[dim]) + return size == tileShadingRateQCOM[dim]; + tileShadingRateQCOMNotDefault[dim] = true; + tileShadingRateQCOM[dim] = size; + return true; + } + unsigned int getTileShadingRateQCOM(int dim) const { return tileShadingRateQCOM[dim]; } + bool isTileShadingRateQCOMSet() const + { + // Return true if any component has been set (i.e. any component is not default). + return tileShadingRateQCOMNotDefault[0] || tileShadingRateQCOMNotDefault[1] || tileShadingRateQCOMNotDefault[2]; + } + + void setShiftBinding(TResourceType res, unsigned int shift) + { + shiftBinding[res] = shift; + + const char* name = getResourceName(res); + if (name != nullptr) + processes.addIfNonZero(name, shift); + } + + unsigned int getShiftBinding(TResourceType res) const { return shiftBinding[res]; } + + void setShiftBindingForSet(TResourceType res, unsigned int shift, unsigned int set) + { + if (shift == 0) // ignore if there's no shift: it's a no-op. + return; + + shiftBindingForSet[res][set] = shift; + + const char* name = getResourceName(res); + if (name != nullptr) { + processes.addProcess(name); + processes.addArgument(shift); + processes.addArgument(set); + } + } + + int getShiftBindingForSet(TResourceType res, unsigned int set) const + { + const auto shift = shiftBindingForSet[res].find(set); + return shift == shiftBindingForSet[res].end() ? -1 : shift->second; + } + bool hasShiftBindingForSet(TResourceType res) const { return !shiftBindingForSet[res].empty(); } + + void setResourceSetBinding(const std::vector& shift) + { + resourceSetBinding = shift; + if (shift.size() > 0) { + processes.addProcess("resource-set-binding"); + for (int s = 0; s < (int)shift.size(); ++s) + processes.addArgument(shift[s]); + } + } + const std::vector& getResourceSetBinding() const { return resourceSetBinding; } + void setAutoMapBindings(bool map) + { + autoMapBindings = map; + if (autoMapBindings) + processes.addProcess("auto-map-bindings"); + } + bool getAutoMapBindings() const { return autoMapBindings; } + void setAutoMapLocations(bool map) + { + autoMapLocations = map; + if (autoMapLocations) + processes.addProcess("auto-map-locations"); + } + bool getAutoMapLocations() const { return autoMapLocations; } + +#ifdef ENABLE_HLSL + void setFlattenUniformArrays(bool flatten) + { + flattenUniformArrays = flatten; + if (flattenUniformArrays) + processes.addProcess("flatten-uniform-arrays"); + } + bool getFlattenUniformArrays() const { return flattenUniformArrays; } +#endif + void setNoStorageFormat(bool b) + { + useUnknownFormat = b; + if (useUnknownFormat) + processes.addProcess("no-storage-format"); + } + bool getNoStorageFormat() const { return useUnknownFormat; } + void setUseVulkanMemoryModel() + { + useVulkanMemoryModel = true; + processes.addProcess("use-vulkan-memory-model"); + } + bool usingVulkanMemoryModel() const { return useVulkanMemoryModel; } + void setUsePhysicalStorageBuffer() + { + usePhysicalStorageBuffer = true; + } + bool usingPhysicalStorageBuffer() const { return usePhysicalStorageBuffer; } + void setReplicatedComposites() + { + useReplicatedComposites = true; + } + bool usingReplicatedComposites() const { return useReplicatedComposites; } + void setPromoteUint32Indices() + { + promoteUint32Indices = true; + } + bool usingPromoteUint32Indices() const { return promoteUint32Indices; } + void setShader64BitIndexing() + { + shader64BitIndexing = true; + } + bool usingShader64BitIndexing() const { return shader64BitIndexing; } + void setUseVariablePointers() + { + useVariablePointers = true; + processes.addProcess("use-variable-pointers"); + } + // Set the global flag for bindless texture + void setBindlessTextureMode(const TString& currentCaller, AstRefType type) + { + // When type is not func, currentCaller should be "" (empty string) + bindlessTextureModeCaller[currentCaller] = type; + } + + // Get the global flag for bindless texture + bool getBindlessTextureMode() const + { + return (bindlessTextureModeCaller.size() > 0); + } + + // Set the global flag for bindless image + void setBindlessImageMode(const TString& currentCaller, AstRefType type) + { + // When type is not func, currentCaller should be "" (empty string) + bindlessImageModeCaller[currentCaller] = type; + } + + // Get the global flag for bindless image + bool getBindlessImageMode() const + { + return (bindlessImageModeCaller.size() > 0); + } + + // Get the global flag for bindless texture + bool resetTopLevelUncalledStatus(const TString& deadCaller) + { + // For reflection collection purpose, currently uniform layout setting and some + // flags introduced by variables (IO, global, etc,.) won't be reset here. + // Remove each global status (AST top level) introduced by uncalled functions. + // If a status is set by several functions, keep those which in call graph. + bool result = false; + + // For two types of bindless mode flag, we would only reset which is set by an uncalled function. + // If one status flag's key in caller vec is empty, it should be come from a non-function setting. + if (!bindlessTextureModeCaller.empty()) { + auto caller = bindlessTextureModeCaller.find(deadCaller); + if (caller != bindlessTextureModeCaller.end() && bindlessTextureModeCaller[deadCaller] == AstRefTypeFunc) { + bindlessTextureModeCaller.erase(caller); + result = true; + } + } + if (!bindlessImageModeCaller.empty()) { + auto caller = bindlessImageModeCaller.find(deadCaller); + if (caller != bindlessImageModeCaller.end() && bindlessImageModeCaller[deadCaller] == AstRefTypeFunc) { + bindlessImageModeCaller.erase(caller); + result = true; + } + } + return result; + } + + bool getBindlessMode() const + { + return getBindlessTextureMode() || getBindlessImageMode(); + } + + bool usingVariablePointers() const { return useVariablePointers; } + +#ifdef ENABLE_HLSL + template T addCounterBufferName(const T& name) const { return name + implicitCounterName; } + bool hasCounterBufferName(const TString& name) const { + size_t len = strlen(implicitCounterName); + return name.size() > len && + name.compare(name.size() - len, len, implicitCounterName) == 0; + } +#endif + + void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { textureSamplerTransformMode = mode; } + int getNumPushConstants() const { return numPushConstants; } + void addShaderRecordCount() { ++numShaderRecordBlocks; } + void addTaskNVCount() { ++numTaskNVBlocks; } + void addTaskPayloadEXTCount() { ++numTaskEXTPayloads; } + + bool setInvocations(int i) + { + if (invocations != TQualifier::layoutNotSet) + return invocations == i; + invocations = i; + return true; + } + int getInvocations() const { return invocations; } + bool setVertices(int m) + { + if (vertices != TQualifier::layoutNotSet) + return vertices == m; + vertices = m; + return true; + } + int getVertices() const { return vertices; } + bool setInputPrimitive(TLayoutGeometry p) + { + if (inputPrimitive != ElgNone) + return inputPrimitive == p; + inputPrimitive = p; + return true; + } + TLayoutGeometry getInputPrimitive() const { return inputPrimitive; } + bool setVertexSpacing(TVertexSpacing s) + { + if (vertexSpacing != EvsNone) + return vertexSpacing == s; + vertexSpacing = s; + return true; + } + TVertexSpacing getVertexSpacing() const { return vertexSpacing; } + bool setVertexOrder(TVertexOrder o) + { + if (vertexOrder != EvoNone) + return vertexOrder == o; + vertexOrder = o; + return true; + } + TVertexOrder getVertexOrder() const { return vertexOrder; } + void setPointMode() { pointMode = true; } + bool getPointMode() const { return pointMode; } + + bool setInterlockOrdering(TInterlockOrdering o) + { + if (interlockOrdering != EioNone) + return interlockOrdering == o; + interlockOrdering = o; + return true; + } + TInterlockOrdering getInterlockOrdering() const { return interlockOrdering; } + + void setXfbMode() { xfbMode = true; } + bool getXfbMode() const { return xfbMode; } + void setQuadDerivMode(bool mode = true) { quadDerivMode = mode; } + bool getQuadDerivMode() const { return quadDerivMode; } + void setReqFullQuadsMode(bool mode = true) { reqFullQuadsMode = mode; } + bool getReqFullQuadsMode() const { return reqFullQuadsMode; } + void setMultiStream() { multiStream = true; } + bool isMultiStream() const { return multiStream; } + bool setOutputPrimitive(TLayoutGeometry p) + { + if (outputPrimitive != ElgNone) + return outputPrimitive == p; + outputPrimitive = p; + return true; + } + TLayoutGeometry getOutputPrimitive() const { return outputPrimitive; } + void setNonCoherentColorAttachmentReadEXT() { nonCoherentColorAttachmentReadEXT = true; } + bool getNonCoherentColorAttachmentReadEXT() const { return nonCoherentColorAttachmentReadEXT; } + void setNonCoherentDepthAttachmentReadEXT() { nonCoherentDepthAttachmentReadEXT = true; } + bool getNonCoherentDepthAttachmentReadEXT() const { return nonCoherentDepthAttachmentReadEXT; } + void setNonCoherentStencilAttachmentReadEXT() { nonCoherentStencilAttachmentReadEXT = true; } + bool getNonCoherentStencilAttachmentReadEXT() const { return nonCoherentStencilAttachmentReadEXT; } + void setNonCoherentTileAttachmentReadQCOM() { nonCoherentTileAttachmentReadQCOM = true; } + bool getNonCoherentTileAttachmentReadQCOM() const { return nonCoherentTileAttachmentReadQCOM; } + void setPostDepthCoverage() { postDepthCoverage = true; } + bool getPostDepthCoverage() const { return postDepthCoverage; } + void setEarlyFragmentTests() { earlyFragmentTests = true; } + void setEarlyAndLateFragmentTestsAMD() { earlyAndLateFragmentTestsAMD = true; } + bool getEarlyFragmentTests() const { return earlyFragmentTests; } + bool getEarlyAndLateFragmentTestsAMD() const { return earlyAndLateFragmentTestsAMD; } + bool setDepth(TLayoutDepth d) + { + if (depthLayout != EldNone) + return depthLayout == d; + depthLayout = d; + return true; + } + bool setStencil(TLayoutStencil s) + { + if (stencilLayout != ElsNone) + return stencilLayout == s; + stencilLayout = s; + return true; + } + TLayoutDepth getDepth() const { return depthLayout; } + TLayoutStencil getStencil() const { return stencilLayout; } + void setOriginUpperLeft() { originUpperLeft = true; } + bool getOriginUpperLeft() const { return originUpperLeft; } + void setPixelCenterInteger() { pixelCenterInteger = true; } + bool getPixelCenterInteger() const { return pixelCenterInteger; } + void setTexCoordRedeclared() { texCoordBuiltinRedeclared = true; } + bool getTexCoordRedeclared() const { return texCoordBuiltinRedeclared; } + void addBlendEquation(TBlendEquationShift b) { blendEquations |= (1 << b); } + unsigned int getBlendEquations() const { return blendEquations; } + bool setXfbBufferStride(int buffer, unsigned stride) + { + if (xfbBuffers[buffer].stride != TQualifier::layoutXfbStrideEnd) + return xfbBuffers[buffer].stride == stride; + xfbBuffers[buffer].stride = stride; + return true; + } + unsigned getXfbStride(int buffer) const { return xfbBuffers[buffer].stride; } + int addXfbBufferOffset(const TType&); + unsigned int computeTypeXfbSize(const TType&, bool& contains64BitType, bool& contains32BitType, bool& contains16BitType) const; + unsigned int computeTypeXfbSize(const TType&, bool& contains64BitType) const; + void setLayoutOverrideCoverage() { layoutOverrideCoverage = true; } + bool getLayoutOverrideCoverage() const { return layoutOverrideCoverage; } + void setGeoPassthroughEXT() { geoPassthroughEXT = true; } + bool getGeoPassthroughEXT() const { return geoPassthroughEXT; } + void setLayoutDerivativeMode(ComputeDerivativeMode mode) { computeDerivativeMode = mode; } + bool hasLayoutDerivativeModeNone() const { return computeDerivativeMode != LayoutDerivativeNone; } + ComputeDerivativeMode getLayoutDerivativeModeNone() const { return computeDerivativeMode; } + void setLayoutPrimitiveCulling() { layoutPrimitiveCulling = true; } + bool getLayoutPrimitiveCulling() const { return layoutPrimitiveCulling; } + bool setPrimitives(int m) + { + if (primitives != TQualifier::layoutNotSet) + return primitives == m; + primitives = m; + return true; + } + int getPrimitives() const { return primitives; } + const char* addSemanticName(const TString& name) + { + return semanticNameSet.insert(name).first->c_str(); + } + void addUniformLocationOverride(const char* nameStr, int location) + { + std::string name = nameStr; + uniformLocationOverrides[name] = location; + } + + int getUniformLocationOverride(const char* nameStr) const + { + std::string name = nameStr; + auto pos = uniformLocationOverrides.find(name); + if (pos == uniformLocationOverrides.end()) + return -1; + else + return pos->second; + } + + void setUniformLocationBase(int base) { uniformLocationBase = base; } + int getUniformLocationBase() const { return uniformLocationBase; } + + void setNeedsLegalization() { needToLegalize = true; } + bool needsLegalization() const { return needToLegalize; } + + void setBinaryDoubleOutput() { binaryDoubleOutput = true; } + bool getBinaryDoubleOutput() { return binaryDoubleOutput; } + + void setSubgroupUniformControlFlow() { subgroupUniformControlFlow = true; } + bool getSubgroupUniformControlFlow() const { return subgroupUniformControlFlow; } + + void setMaximallyReconverges() { maximallyReconverges = true; } + bool getMaximallyReconverges() const { return maximallyReconverges; } + + // GL_EXT_spirv_intrinsics + void insertSpirvRequirement(const TSpirvRequirement* spirvReq); + bool hasSpirvRequirement() const { return spirvRequirement != nullptr; } + const TSpirvRequirement& getSpirvRequirement() const { return *spirvRequirement; } + void insertSpirvExecutionMode(int executionMode, const TIntermAggregate* args = nullptr); + void insertSpirvExecutionModeId(int executionMode, const TIntermAggregate* args); + bool hasSpirvExecutionMode() const { return spirvExecutionMode != nullptr; } + const TSpirvExecutionMode& getSpirvExecutionMode() const { return *spirvExecutionMode; } + + void addBlockStorageOverride(const char* nameStr, TBlockStorageClass backing) + { + std::string name(nameStr); + blockBackingOverrides[name] = backing; + } + TBlockStorageClass getBlockStorageOverride(const char* nameStr) const + { + std::string name = nameStr; + auto pos = blockBackingOverrides.find(name); + if (pos == blockBackingOverrides.end()) + return EbsNone; + else + return pos->second; + } +#ifdef ENABLE_HLSL + void setHlslFunctionality1() { hlslFunctionality1 = true; } + bool getHlslFunctionality1() const { return hlslFunctionality1; } + void setHlslOffsets() + { + hlslOffsets = true; + if (hlslOffsets) + processes.addProcess("hlsl-offsets"); + } + bool usingHlslOffsets() const { return hlslOffsets; } + void setHlslIoMapping(bool b) + { + hlslIoMapping = b; + if (hlslIoMapping) + processes.addProcess("hlsl-iomap"); + } + bool usingHlslIoMapping() { return hlslIoMapping; } +#else + bool getHlslFunctionality1() const { return false; } + bool usingHlslOffsets() const { return false; } + bool usingHlslIoMapping() { return false; } +#endif + + bool usingScalarBlockLayout() const { + return IsRequestedExtension(E_GL_EXT_scalar_block_layout); + } + + bool usingTextureOffsetNonConst() const { + return IsRequestedExtension(E_GL_EXT_texture_offset_non_const); + } + + bool IsRequestedExtension(const char* extension) const + { + return (requestedExtensions.find(extension) != requestedExtensions.end()); + } + + void addToCallGraph(TInfoSink&, const TString& caller, const TString& callee); + void merge(TInfoSink&, TIntermediate&); + void finalCheck(TInfoSink&, bool keepUncalled); + + void mergeGlobalUniformBlocks(TInfoSink& infoSink, TIntermediate& unit, bool mergeExistingOnly); + void mergeUniformObjects(TInfoSink& infoSink, TIntermediate& unit); + void mergeImplicitArraySizes(TInfoSink& infoSink, TIntermediate& unit); + void checkStageIO(TInfoSink&, TIntermediate&, EShMessages); + void optimizeStageIO(TInfoSink&, TIntermediate&); + + bool buildConvertOp(TBasicType dst, TBasicType src, TOperator& convertOp) const; + TIntermTyped* createConversion(TBasicType convertTo, TIntermTyped* node) const; + + void addIoAccessed(const TString& name) { ioAccessed.insert(name); } + bool inIoAccessed(const TString& name) const { return ioAccessed.find(name) != ioAccessed.end(); } + + int addUsedLocation(const TQualifier&, const TType&, bool& typeCollision); + int checkLocationRange(int set, const TIoRange& range, const TType&, bool& typeCollision); + int checkLocationRT(int set, int location); + int addUsedOffsets(int binding, int offset, int numOffsets); + bool addUsedConstantId(int id); + GLSLANG_EXPORT_FOR_TESTS + static int computeTypeLocationSize(const TType&, EShLanguage); + static int computeTypeUniformLocationSize(const TType&); + + static int getBaseAlignmentScalar(const TType&, int& size); + static int getBaseAlignment(const TType&, int& size, int& stride, TLayoutPacking layoutPacking, bool rowMajor); + static int getScalarAlignment(const TType&, int& size, int& stride, bool rowMajor); + static int getMemberAlignment(const TType&, int& size, int& stride, TLayoutPacking layoutPacking, bool rowMajor); + static bool improperStraddle(const TType& type, int size, int offset, bool vectorLike); + static void updateOffset(const TType& parentType, const TType& memberType, int& offset, int& memberSize); + static int getOffset(const TType& type, int index); + static int getBlockSize(const TType& blockType); + static int computeBufferReferenceTypeSize(const TType&); + static bool isIoResizeArray(const TType& type, EShLanguage language); + + bool promote(TIntermOperator*); + void setNanMinMaxClamp(bool setting) { nanMinMaxClamp = setting; } + bool getNanMinMaxClamp() const { return nanMinMaxClamp; } + + void setSourceFile(const char* file) { if (file != nullptr) sourceFile = file; } + const std::string& getSourceFile() const { return sourceFile; } + void addSourceText(const char* text, size_t len) { sourceText.append(text, len); } + const std::string& getSourceText() const { return sourceText; } + const std::map& getIncludeText() const { return includeText; } + void addIncludeText(const char* name, const char* text, size_t len) { includeText[name].assign(text,len); } + void addProcesses(const std::vector& p) + { + for (int i = 0; i < (int)p.size(); ++i) + processes.addProcess(p[i]); + } + void addProcess(const std::string& process) { processes.addProcess(process); } + void addProcessArgument(const std::string& arg) { processes.addArgument(arg); } + const std::vector& getProcesses() const { return processes.getProcesses(); } + unsigned long long getUniqueId() const { return uniqueId; } + void setUniqueId(unsigned long long id) { uniqueId = id; } + + // Certain explicit conversions are allowed conditionally + bool getArithemeticInt8Enabled() const { + return numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types) || + numericFeatures.contains(TNumericFeatures::nv_gpu_shader5_types) || + numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types_int8); + } + bool getArithemeticInt16Enabled() const { + return numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types) || + numericFeatures.contains(TNumericFeatures::gpu_shader_int16) || + numericFeatures.contains(TNumericFeatures::nv_gpu_shader5_types) || + numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types_int16); + } + + bool getArithemeticFloat16Enabled() const { + return numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types) || + numericFeatures.contains(TNumericFeatures::gpu_shader_half_float) || + numericFeatures.contains(TNumericFeatures::nv_gpu_shader5_types) || + numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types_float16); + } + void updateNumericFeature(TNumericFeatures::feature f, bool on) + { on ? numericFeatures.insert(f) : numericFeatures.erase(f); } + + void setBuiltinAliasLookup(std::unordered_multimap symbolMap) { + builtinAliasLookup = std::move(symbolMap); + } + const std::unordered_multimap& getBuiltinAliasLookup() const { + return builtinAliasLookup; + } + +protected: + TIntermSymbol* addSymbol(long long Id, const TString&, const TString&, const TType&, const TConstUnionArray&, TIntermTyped* subtree, const TSourceLoc&); + void error(TInfoSink& infoSink, const TSourceLoc* loc, EShMessages messages, const char*, EShLanguage unitStage = EShLangCount); + void error(TInfoSink& infoSink, const char* message, EShLanguage unitStage = EShLangCount) { + error(infoSink, nullptr, EShMsgDefault, message, unitStage); + } + void warn(TInfoSink& infoSink, const TSourceLoc* loc, EShMessages, const char*, EShLanguage unitStage = EShLangCount); + void warn(TInfoSink& infoSink, const char* message, EShLanguage unitStage = EShLangCount) { + warn(infoSink, nullptr, EShMsgDefault, message, unitStage); + } + void mergeCallGraphs(TInfoSink&, TIntermediate&); + void mergeModes(TInfoSink&, TIntermediate&); + void mergeTrees(TInfoSink&, TIntermediate&); + void seedIdMap(TIdMaps& idMaps, long long& IdShift); + void remapIds(const TIdMaps& idMaps, long long idShift, TIntermediate&); + void mergeBodies(TInfoSink&, TIntermSequence& globals, const TIntermSequence& unitGlobals); + void mergeLinkerObjects(TInfoSink&, TIntermSequence& linkerObjects, const TIntermSequence& unitLinkerObjects, EShLanguage); + void mergeBlockDefinitions(TInfoSink&, TIntermSymbol* block, TIntermSymbol* unitBlock, TIntermediate* unitRoot); + void mergeImplicitArraySizes(TType&, const TType&); + void mergeErrorCheck(TInfoSink&, const TIntermSymbol&, const TIntermSymbol&); + void checkCallGraphCycles(TInfoSink&); + void checkCallGraphBodies(TInfoSink&, bool keepUncalled); + void inOutLocationCheck(TInfoSink&); + void sharedBlockCheck(TInfoSink&); + bool userOutputUsed() const; + bool isSpecializationOperation(const TIntermOperator&) const; + bool isNonuniformPropagating(TOperator) const; + bool promoteUnary(TIntermUnary&); + bool promoteBinary(TIntermBinary&); + void addSymbolLinkageNode(TIntermAggregate*& linkage, TSymbolTable&, const TString&); + bool promoteAggregate(TIntermAggregate&); + void pushSelector(TIntermSequence&, const TVectorSelector&, const TSourceLoc&); + void pushSelector(TIntermSequence&, const TMatrixSelector&, const TSourceLoc&); + bool specConstantPropagates(const TIntermTyped&, const TIntermTyped&); + void performTextureUpgradeAndSamplerRemovalTransformation(TIntermNode* root); + bool isConversionAllowed(TOperator op, TIntermTyped* node) const; + std::tuple getConversionDestinationType(TBasicType type0, TBasicType type1, TOperator op) const; + + static const char* getResourceName(TResourceType); + + const EShLanguage language; // stage, known at construction time + std::string entryPointName; + std::string entryPointMangledName; + typedef std::list TGraph; + TGraph callGraph; + + EProfile profile; // source profile + int version; // source version + SpvVersion spvVersion; + TIntermNode* treeRoot; + std::set requestedExtensions; // cumulation of all enabled or required extensions; not connected to what subset of the shader used them + MustBeAssigned resources; + int numEntryPoints; + int numErrors; + int numPushConstants; + bool recursive; + bool invertY; + bool dxPositionW; + bool enhancedMsgs; + bool debugInfo; + bool useStorageBuffer; + bool invariantAll; + bool nanMinMaxClamp; // true if desiring min/max/clamp to favor non-NaN over NaN + bool depthReplacing; + bool stencilReplacing; + int localSize[3]; + bool localSizeNotDefault[3]; + int localSizeSpecId[3]; + unsigned long long uniqueId; + + std::string globalUniformBlockName; + std::string atomicCounterBlockName; + unsigned int globalUniformBlockSet; + unsigned int globalUniformBlockBinding; + unsigned int atomicCounterBlockSet; + +public: + const char* const implicitThisName; + const char* const implicitCounterName; +protected: + EShSource source; // source language, known a bit later + bool useVulkanMemoryModel; + int invocations; + int vertices; + TLayoutGeometry inputPrimitive; + TLayoutGeometry outputPrimitive; + bool pixelCenterInteger; + bool originUpperLeft; + bool texCoordBuiltinRedeclared; + TVertexSpacing vertexSpacing; + TVertexOrder vertexOrder; + TInterlockOrdering interlockOrdering; + bool pointMode; + bool earlyFragmentTests; + bool postDepthCoverage; + bool earlyAndLateFragmentTestsAMD; + bool nonCoherentColorAttachmentReadEXT; + bool nonCoherentDepthAttachmentReadEXT; + bool nonCoherentStencilAttachmentReadEXT; + TLayoutDepth depthLayout; + TLayoutStencil stencilLayout; + bool hlslFunctionality1; + int blendEquations; // an 'or'ing of masks of shifts of TBlendEquationShift + bool xfbMode; + std::vector xfbBuffers; // all the data we need to track per xfb buffer + bool multiStream; + bool layoutOverrideCoverage; + bool geoPassthroughEXT; + int numShaderRecordBlocks; + ComputeDerivativeMode computeDerivativeMode; + int primitives; + int numTaskNVBlocks; + bool layoutPrimitiveCulling; + int numTaskEXTPayloads; + + bool nonCoherentTileAttachmentReadQCOM; + int tileShadingRateQCOM[3]; + bool tileShadingRateQCOMNotDefault[3]; + + // Base shift values + std::array shiftBinding; + + // Per-descriptor-set shift values + std::array, EResCount> shiftBindingForSet; + + std::vector resourceSetBinding; + bool autoMapBindings; + bool autoMapLocations; + bool flattenUniformArrays; + bool useUnknownFormat; + bool hlslOffsets; + bool hlslIoMapping; + bool useVariablePointers; + + std::set semanticNameSet; + + EShTextureSamplerTransformMode textureSamplerTransformMode; + + bool needToLegalize; + bool binaryDoubleOutput; + bool subgroupUniformControlFlow; + bool maximallyReconverges; + bool usePhysicalStorageBuffer; + bool useReplicatedComposites { false }; + bool promoteUint32Indices { false }; + bool shader64BitIndexing { false }; + + TSpirvRequirement* spirvRequirement; + TSpirvExecutionMode* spirvExecutionMode; + std::map bindlessTextureModeCaller; + std::map bindlessImageModeCaller; + std::unordered_map uniformLocationOverrides; + int uniformLocationBase; + bool quadDerivMode; + bool reqFullQuadsMode; + TNumericFeatures numericFeatures; + std::unordered_map blockBackingOverrides; + + std::unordered_set usedConstantId; // specialization constant ids used + std::vector usedAtomics; // sets of bindings used by atomic counters + std::vector usedIo[5]; // sets of used locations, one for each of in, out, uniform, and buffers + std::vector usedIoRT[4]; // sets of used location, one for rayPayload/rayPayloadIN, + // one for callableData/callableDataIn, one for hitObjectAttributeNV and + // one for shaderrecordhitobjectNV + // set of names of statically read/written I/O that might need extra checking + std::set ioAccessed; + + // source code of shader, useful as part of debug information + std::string sourceFile; + std::string sourceText; + + // Included text. First string is a name, second is the included text + std::map includeText; + + // Maps from canonical symbol name to alias symbol names + std::unordered_multimap builtinAliasLookup; + + // for OpModuleProcessed, or equivalent + TProcesses processes; + +private: + void operator=(TIntermediate&); // prevent assignments +}; + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // _LOCAL_INTERMEDIATE_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp new file mode 100644 index 0000000000..81dfbef2c8 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp @@ -0,0 +1,215 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// Traverse a tree of constants to create a single folded constant. +// It should only be used when the whole tree is known to be constant. +// + +#include "ParseHelper.h" + +namespace QtShaderTools { +namespace glslang { + +class TConstTraverser : public TIntermTraverser { +public: + TConstTraverser(const TConstUnionArray& cUnion, bool singleConstParam, TOperator constructType, const TType& t) + : unionArray(cUnion), type(t), + constructorType(constructType), singleConstantParam(singleConstParam), error(false), isMatrix(false), + matrixCols(0), matrixRows(0) { index = 0; tOp = EOpNull; } + + virtual void visitConstantUnion(TIntermConstantUnion* node); + virtual bool visitAggregate(TVisit, TIntermAggregate* node); + + int index; + TConstUnionArray unionArray; + TOperator tOp; + const TType& type; + TOperator constructorType; + bool singleConstantParam; + bool error; + int size; // size of the constructor ( 4 for vec4) + bool isMatrix; + int matrixCols; + int matrixRows; + +protected: + TConstTraverser(TConstTraverser&); + TConstTraverser& operator=(TConstTraverser&); +}; + +bool TConstTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node) +{ + if (! node->isConstructor() && node->getOp() != EOpComma) { + error = true; + + return false; + } + + bool flag = node->getSequence().size() == 1 && node->getSequence()[0]->getAsTyped()->getAsConstantUnion(); + if (flag) { + singleConstantParam = true; + constructorType = node->getOp(); + size = node->getType().computeNumComponents(); + + if (node->getType().isMatrix()) { + isMatrix = true; + matrixCols = node->getType().getMatrixCols(); + matrixRows = node->getType().getMatrixRows(); + } + } + + for (TIntermSequence::iterator p = node->getSequence().begin(); + p != node->getSequence().end(); p++) { + + if (node->getOp() == EOpComma) + index = 0; + + (*p)->traverse(this); + } + if (flag) + { + singleConstantParam = false; + constructorType = EOpNull; + size = 0; + isMatrix = false; + matrixCols = 0; + matrixRows = 0; + } + + return false; +} + +void TConstTraverser::visitConstantUnion(TIntermConstantUnion* node) +{ + TConstUnionArray leftUnionArray(unionArray); + int instanceSize = type.computeNumComponents(); + + if (index >= instanceSize) + return; + + if (! singleConstantParam) { + int rightUnionSize = node->getType().computeNumComponents(); + + const TConstUnionArray& rightUnionArray = node->getConstArray(); + for (int i = 0; i < rightUnionSize; i++) { + if (index >= instanceSize) + return; + leftUnionArray[index] = rightUnionArray[i]; + + index++; + } + } else { + int endIndex = index + size; + const TConstUnionArray& rightUnionArray = node->getConstArray(); + if (! isMatrix) { + int count = 0; + int nodeComps = node->getType().computeNumComponents(); + for (int i = index; i < endIndex; i++) { + if (i >= instanceSize) + return; + + leftUnionArray[i] = rightUnionArray[count]; + + (index)++; + + if (nodeComps > 1) + count++; + } + } else { + // constructing a matrix, but from what? + if (node->isMatrix()) { + // Matrix from a matrix; this has the outer matrix, node is the argument matrix. + // Traverse the outer, potentially bigger matrix, fill in missing pieces with the + // identity matrix. + for (int c = 0; c < matrixCols; ++c) { + for (int r = 0; r < matrixRows; ++r) { + int targetOffset = index + c * matrixRows + r; + if (r < node->getType().getMatrixRows() && c < node->getType().getMatrixCols()) { + int srcOffset = c * node->getType().getMatrixRows() + r; + leftUnionArray[targetOffset] = rightUnionArray[srcOffset]; + } else if (r == c) + leftUnionArray[targetOffset].setDConst(1.0); + else + leftUnionArray[targetOffset].setDConst(0.0); + } + } + } else { + // matrix from vector or scalar + int nodeComps = node->getType().computeNumComponents(); + if (nodeComps == 1) { + for (int c = 0; c < matrixCols; ++c) { + for (int r = 0; r < matrixRows; ++r) { + if (r == c) + leftUnionArray[index] = rightUnionArray[0]; + else + leftUnionArray[index].setDConst(0.0); + index++; + } + } + } else { + int count = 0; + for (int i = index; i < endIndex; i++) { + if (i >= instanceSize) + return; + + // construct the matrix in column-major order, from + // the components provided, in order + leftUnionArray[i] = rightUnionArray[count]; + + index++; + count++; + } + } + } + } + } +} + +bool TIntermediate::parseConstTree(TIntermNode* root, TConstUnionArray unionArray, TOperator constructorType, const TType& t, bool singleConstantParam) +{ + if (root == nullptr) + return false; + + TConstTraverser it(unionArray, singleConstantParam, constructorType, t); + + root->traverse(&it); + if (it.error) + return true; + else + return false; +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h new file mode 100644 index 0000000000..2cb6ed042d --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h @@ -0,0 +1,196 @@ +// +// Copyright (C) 2015-2018 Google, Inc. +// Copyright (C) 2017 ARM Limited. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// This is implemented in Versions.cpp + +#ifndef _PARSE_VERSIONS_INCLUDED_ +#define _PARSE_VERSIONS_INCLUDED_ + +#include "../Public/ShaderLang.h" +#include "../Include/InfoSink.h" +#include "Scan.h" + +#include + +namespace QtShaderTools { +namespace glslang { + +// +// Base class for parse helpers. +// This just has version-related information and checking. +// This class should be sufficient for preprocessing. +// +class TParseVersions { +public: + TParseVersions(TIntermediate& interm, int version, EProfile profile, + const SpvVersion& spvVersion, EShLanguage language, TInfoSink& infoSink, + bool forwardCompatible, EShMessages messages) + : + forwardCompatible(forwardCompatible), + profile(profile), + infoSink(infoSink), version(version), + language(language), + spvVersion(spvVersion), + intermediate(interm), messages(messages), numErrors(0), currentScanner(nullptr) { } + virtual ~TParseVersions() { } + void requireStage(const TSourceLoc&, EShLanguageMask, const char* featureDesc); + void requireStage(const TSourceLoc&, EShLanguage, const char* featureDesc); + + bool forwardCompatible; // true if errors are to be given for use of deprecated features + EProfile profile; // the declared profile in the shader (core by default) + bool isEsProfile() const { return profile == EEsProfile; } + void requireProfile(const TSourceLoc& loc, int profileMask, const char* featureDesc); + void profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, int numExtensions, + const char* const extensions[], const char* featureDesc); + void profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, const char* extension, + const char* featureDesc); + virtual void initializeExtensionBehavior(); + virtual void checkDeprecated(const TSourceLoc&, int queryProfiles, int depVersion, const char* featureDesc); + virtual void requireNotRemoved(const TSourceLoc&, int queryProfiles, int removedVersion, const char* featureDesc); + virtual void requireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[], + const char* featureDesc); + virtual void ppRequireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[], + const char* featureDesc); + template + constexpr void ppRequireExtensions(const TSourceLoc& loc, Container extensions, const char* featureDesc) { + ppRequireExtensions(loc, static_cast(extensions.size()), extensions.data(), featureDesc); + } + + virtual TExtensionBehavior getExtensionBehavior(const char*); + virtual bool extensionTurnedOn(const char* const extension); + virtual bool extensionsTurnedOn(int numExtensions, const char* const extensions[]); + virtual void updateExtensionBehavior(int line, const char* const extension, const char* behavior); + virtual void updateExtensionBehavior(const char* const extension, TExtensionBehavior); + virtual bool checkExtensionsRequested(const TSourceLoc&, int numExtensions, const char* const extensions[], + const char* featureDesc); + virtual void checkExtensionStage(const TSourceLoc&, const char* const extension); + virtual void extensionRequires(const TSourceLoc&, const char* const extension, const char* behavior); + virtual void fullIntegerCheck(const TSourceLoc&, const char* op); + + virtual void unimplemented(const TSourceLoc&, const char* featureDesc); + virtual void doubleCheck(const TSourceLoc&, const char* op); + virtual void float16Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void float16ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void bfloat16ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void floate5m2ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void floate4m3ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false); + virtual bool float16Arithmetic(); + virtual void requireFloat16Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc); + virtual void int16ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false); + virtual bool int16Arithmetic(); + virtual void requireInt16Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc); + virtual void int8ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false); + virtual bool int8Arithmetic(); + virtual void requireInt8Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc); + virtual void float16OpaqueCheck(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void int64Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void explicitInt8Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void explicitInt16Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void explicitInt32Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void explicitFloat32Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void explicitFloat64Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void fcoopmatCheckNV(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void intcoopmatCheckNV(const TSourceLoc&, const char *op, bool builtIn = false); + virtual void coopmatCheck(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void coopmatConverisonCheckQCOM(const TSourceLoc& loc, const char* op, bool builtIn = false); + virtual void tensorLayoutViewCheck(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void coopvecCheck(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void intattachmentCheck(const TSourceLoc&, const char *op, bool builtIn = false); + virtual void tensorCheckARM(const TSourceLoc&, const char *op, bool builtIn = false); + bool relaxedErrors() const { return (messages & EShMsgRelaxedErrors) != 0; } + bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; } + bool isForwardCompatible() const { return forwardCompatible; } + + virtual void spvRemoved(const TSourceLoc&, const char* op); + virtual void vulkanRemoved(const TSourceLoc&, const char* op); + virtual void requireVulkan(const TSourceLoc&, const char* op); + virtual void requireSpv(const TSourceLoc&, const char* op); + virtual void requireSpv(const TSourceLoc&, const char *op, unsigned int version); + + virtual void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...) = 0; + virtual void C_DECL warn(const TSourceLoc&, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...) = 0; + virtual void C_DECL ppError(const TSourceLoc&, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...) = 0; + virtual void C_DECL ppWarn(const TSourceLoc&, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...) = 0; + + void addError() { ++numErrors; } + int getNumErrors() const { return numErrors; } + + void setScanner(TInputScanner* scanner) { currentScanner = scanner; } + TInputScanner* getScanner() const { return currentScanner; } + const TSourceLoc& getCurrentLoc() const { return currentScanner->getSourceLoc(); } + void setCurrentLine(int line) { currentScanner->setLine(line); } + void setCurrentColumn(int col) { currentScanner->setColumn(col); } + void setCurrentSourceName(const char* name) { currentScanner->setFile(name); } + void setCurrentString(int string) { currentScanner->setString(string); } + + void getPreamble(std::string&); +#ifdef ENABLE_HLSL + bool isReadingHLSL() const { return (messages & EShMsgReadHlsl) == EShMsgReadHlsl; } + bool hlslEnable16BitTypes() const { return (messages & EShMsgHlslEnable16BitTypes) != 0; } + bool hlslDX9Compatible() const { return (messages & EShMsgHlslDX9Compatible) != 0; } +#else + bool isReadingHLSL() const { return false; } +#endif + + TInfoSink& infoSink; + + // compilation mode + int version; // version, updated by #version in the shader + EShLanguage language; // really the stage + SpvVersion spvVersion; + TIntermediate& intermediate; // helper for making and hooking up pieces of the parse tree + +protected: + TMap extensionBehavior; // for each extension string, what its current behavior is + TMap extensionMinSpv; // for each extension string, store minimum spirv required + TVector spvUnsupportedExt; // for extensions reserved for spv usage. + EShMessages messages; // errors/warnings/rule-sets + int numErrors; // number of compile-time errors encountered + TInputScanner* currentScanner; + +private: + explicit TParseVersions(const TParseVersions&); + TParseVersions& operator=(const TParseVersions&); +}; + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // _PARSE_VERSIONS_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/pch.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/pch.h new file mode 100644 index 0000000000..6ea3761ea1 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/pch.h @@ -0,0 +1,49 @@ +#ifndef _PCH_H +#define _PCH_H +// +// Copyright (C) 2018 The Khronos Group Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +#include +#include +#include +#include +#include +#include +#include +#include +#include "SymbolTable.h" +#include "ParseHelper.h" +#include "Scan.h" +#include "ScanContext.h" + +#endif /* _PCH_H */ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp new file mode 100755 index 0000000000..0915b74853 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp @@ -0,0 +1,1396 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +/****************************************************************************\ +Copyright (c) 2002, NVIDIA Corporation. + +NVIDIA Corporation("NVIDIA") supplies this software to you in +consideration of your agreement to the following terms, and your use, +installation, modification or redistribution of this NVIDIA software +constitutes acceptance of these terms. If you do not agree with these +terms, please do not use, install, modify or redistribute this NVIDIA +software. + +In consideration of your agreement to abide by the following terms, and +subject to these terms, NVIDIA grants you a personal, non-exclusive +license, under NVIDIA's copyrights in this original NVIDIA software (the +"NVIDIA Software"), to use, reproduce, modify and redistribute the +NVIDIA Software, with or without modifications, in source and/or binary +forms; provided that if you redistribute the NVIDIA Software, you must +retain the copyright notice of NVIDIA, this notice and the following +text and disclaimers in all such redistributions of the NVIDIA Software. +Neither the name, trademarks, service marks nor logos of NVIDIA +Corporation may be used to endorse or promote products derived from the +NVIDIA Software without specific prior written permission from NVIDIA. +Except as expressly stated in this notice, no other rights or licenses +express or implied, are granted by NVIDIA herein, including but not +limited to any patent rights that may be infringed by your derivative +works or by other works in which the NVIDIA Software may be +incorporated. No hardware is licensed hereunder. + +THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, +INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER +PRODUCTS. + +IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, +INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY +OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE +NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, +TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF +NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\****************************************************************************/ + +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS +#endif + +#include +#include +#include +#include +#include + +#include "PpContext.h" +#include "PpTokens.h" + +namespace QtShaderTools { +namespace glslang { + +// Handle #define +int TPpContext::CPPdefine(TPpToken* ppToken) +{ + MacroSymbol mac; + + // get the macro name + int token = scanToken(ppToken); + if (token != PpAtomIdentifier) { + parseContext.ppError(ppToken->loc, "must be followed by macro name", "#define", ""); + return token; + } + if (ppToken->loc.string >= 0) { + // We are in user code; check for reserved name use: + parseContext.reservedPpErrorCheck(ppToken->loc, ppToken->name, "#define"); + } + + // save the macro name + const int defAtom = atomStrings.getAddAtom(ppToken->name); + TSourceLoc defineLoc = ppToken->loc; // because ppToken might go to the next line before we report errors + + // gather parameters to the macro, between (...) + token = scanToken(ppToken); + if (token == '(' && !ppToken->space) { + mac.functionLike = 1; + do { + token = scanToken(ppToken); + if (mac.args.size() == 0 && token == ')') + break; + if (token != PpAtomIdentifier) { + parseContext.ppError(ppToken->loc, "bad argument", "#define", ""); + + return token; + } + const int argAtom = atomStrings.getAddAtom(ppToken->name); + + // check for duplication of parameter name + bool duplicate = false; + for (size_t a = 0; a < mac.args.size(); ++a) { + if (mac.args[a] == argAtom) { + parseContext.ppError(ppToken->loc, "duplicate macro parameter", "#define", ""); + duplicate = true; + break; + } + } + if (! duplicate) + mac.args.push_back(argAtom); + token = scanToken(ppToken); + } while (token == ','); + if (token != ')') { + parseContext.ppError(ppToken->loc, "missing parenthesis", "#define", ""); + + return token; + } + + token = scanToken(ppToken); + } else if (token != '\n' && token != EndOfInput && !ppToken->space) { + parseContext.ppWarn(ppToken->loc, "missing space after macro name", "#define", ""); + + return token; + } + + int pendingPoundSymbols = 0; + TPpToken savePound; + // record the definition of the macro + while (token != '\n' && token != EndOfInput) { + if (token == '#') { + pendingPoundSymbols++; + if (pendingPoundSymbols == 0) { + savePound = *ppToken; + } + } else if (pendingPoundSymbols == 0) { + mac.body.putToken(token, ppToken); + } else if (pendingPoundSymbols == 1) { + // A single #: stringify + parseContext.requireProfile(ppToken->loc, ~EEsProfile, "stringify (#)"); + parseContext.profileRequires(ppToken->loc, ~EEsProfile, 130, nullptr, "stringify (#)"); + bool isArg = false; + if (token == PpAtomIdentifier) { + for (int i = (int)mac.args.size() - 1; i >= 0; i--) { + if (strcmp(atomStrings.getString(mac.args[i]), ppToken->name) == 0) { + isArg = true; + break; + } + } + } + if (!isArg) { + parseContext.ppError(ppToken->loc, "'#' is not followed by a macro parameter.", "#", ""); + return token; + } + mac.body.putToken(tStringifyLevelInput::PUSH, ppToken); + mac.body.putToken(token, ppToken); + mac.body.putToken(tStringifyLevelInput::POP, ppToken); + pendingPoundSymbols = 0; + } else if (pendingPoundSymbols % 2 == 0) { + // Any number of pastes '##' in a row: idempotent, just becomes one paste + parseContext.requireProfile(ppToken->loc, ~EEsProfile, "token pasting (##)"); + parseContext.profileRequires(ppToken->loc, ~EEsProfile, 130, nullptr, "token pasting (##)"); + for (int i = 0; i < pendingPoundSymbols / 2; i++) { + mac.body.putToken(PpAtomPaste, &savePound); + } + mac.body.putToken(token, ppToken); + pendingPoundSymbols = 0; + } else { + // An odd number of '#' i.e., mix of paste and stringify: does not give valid preprocessing token + parseContext.ppError(ppToken->loc, "Illegal sequence of paste (##) and stringify (#).", "#", ""); + return token; + } + + token = scanToken(ppToken); + } + if (pendingPoundSymbols != 0) { + parseContext.ppError(ppToken->loc, "Macro ended with incomplete '#' paste/stringify operators", "#", ""); + } + + // check for duplicate definition + MacroSymbol* existing = lookupMacroDef(defAtom); + if (existing != nullptr) { + if (! existing->undef) { + // Already defined -- need to make sure they are identical: + // "Two replacement lists are identical if and only if the + // preprocessing tokens in both have the same number, + // ordering, spelling, and white-space separation, where all + // white-space separations are considered identical." + if (existing->functionLike != mac.functionLike) { + parseContext.ppError(defineLoc, "Macro redefined; function-like versus object-like:", "#define", + atomStrings.getString(defAtom)); + } else if (existing->args.size() != mac.args.size()) { + parseContext.ppError(defineLoc, "Macro redefined; different number of arguments:", "#define", + atomStrings.getString(defAtom)); + } else { + if (existing->args != mac.args) { + parseContext.ppError(defineLoc, "Macro redefined; different argument names:", "#define", + atomStrings.getString(defAtom)); + } + // set up to compare the two + existing->body.reset(); + mac.body.reset(); + int newToken; + bool firstToken = true; + do { + int oldToken; + TPpToken oldPpToken; + TPpToken newPpToken; + oldToken = existing->body.getToken(parseContext, &oldPpToken); + newToken = mac.body.getToken(parseContext, &newPpToken); + // for the first token, preceding spaces don't matter + if (firstToken) { + newPpToken.space = oldPpToken.space; + firstToken = false; + } + if (oldToken != newToken || oldPpToken != newPpToken) { + parseContext.ppError(defineLoc, "Macro redefined; different substitutions:", "#define", + atomStrings.getString(defAtom)); + break; + } + } while (newToken != EndOfInput); + } + } + *existing = mac; + } else + addMacroDef(defAtom, mac); + + return '\n'; +} + +// Handle #undef +int TPpContext::CPPundef(TPpToken* ppToken) +{ + int token = scanToken(ppToken); + if (token != PpAtomIdentifier) { + parseContext.ppError(ppToken->loc, "must be followed by macro name", "#undef", ""); + + return token; + } + + parseContext.reservedPpErrorCheck(ppToken->loc, ppToken->name, "#undef"); + + MacroSymbol* macro = lookupMacroDef(atomStrings.getAtom(ppToken->name)); + if (macro != nullptr) + macro->undef = 1; + token = scanToken(ppToken); + if (token != '\n') + parseContext.ppError(ppToken->loc, "can only be followed by a single macro name", "#undef", ""); + + return token; +} + +// Handle #else +/* Skip forward to appropriate spot. This is used both +** to skip to a #endif after seeing an #else, AND to skip to a #else, +** #elif, or #endif after a #if/#ifdef/#ifndef/#elif test was false. +*/ +int TPpContext::CPPelse(int matchelse, TPpToken* ppToken) +{ + inElseSkip = true; + int depth = 0; + int token = scanToken(ppToken); + + while (token != EndOfInput) { + if (token != '#') { + while (token != '\n' && token != EndOfInput) + token = scanToken(ppToken); + + if (token == EndOfInput) + return token; + + token = scanToken(ppToken); + continue; + } + + if ((token = scanToken(ppToken)) != PpAtomIdentifier) + continue; + + int nextAtom = atomStrings.getAtom(ppToken->name); + if (nextAtom == PpAtomIf || nextAtom == PpAtomIfdef || nextAtom == PpAtomIfndef) { + depth++; + if (ifdepth >= maxIfNesting || elsetracker >= maxIfNesting) { + parseContext.ppError(ppToken->loc, "maximum nesting depth exceeded", "#if/#ifdef/#ifndef", ""); + return EndOfInput; + } else { + ifdepth++; + elsetracker++; + } + } else if (nextAtom == PpAtomEndif) { + token = extraTokenCheck(nextAtom, ppToken, scanToken(ppToken)); + elseSeen[elsetracker] = false; + --elsetracker; + if (depth == 0) { + // found the #endif we are looking for + if (ifdepth > 0) + --ifdepth; + break; + } + --depth; + --ifdepth; + } else if (matchelse && depth == 0) { + if (nextAtom == PpAtomElse) { + elseSeen[elsetracker] = true; + token = extraTokenCheck(nextAtom, ppToken, scanToken(ppToken)); + // found the #else we are looking for + break; + } else if (nextAtom == PpAtomElif) { + if (elseSeen[elsetracker]) + parseContext.ppError(ppToken->loc, "#elif after #else", "#elif", ""); + /* we decrement ifdepth here, because CPPif will increment + * it and we really want to leave it alone */ + if (ifdepth > 0) { + --ifdepth; + elseSeen[elsetracker] = false; + --elsetracker; + } + inElseSkip = false; + return CPPif(ppToken); + } + } else if (nextAtom == PpAtomElse) { + if (elseSeen[elsetracker]) + parseContext.ppError(ppToken->loc, "#else after #else", "#else", ""); + else + elseSeen[elsetracker] = true; + token = extraTokenCheck(nextAtom, ppToken, scanToken(ppToken)); + } else if (nextAtom == PpAtomElif) { + if (elseSeen[elsetracker]) + parseContext.ppError(ppToken->loc, "#elif after #else", "#elif", ""); + } + } + + inElseSkip = false; + return token; +} + +// Call when there should be no more tokens left on a line. +int TPpContext::extraTokenCheck(int contextAtom, TPpToken* ppToken, int token) +{ + if (token != '\n' && token != EndOfInput) { + static const char* message = "unexpected tokens following directive"; + + const char* label; + if (contextAtom == PpAtomElse) + label = "#else"; + else if (contextAtom == PpAtomElif) + label = "#elif"; + else if (contextAtom == PpAtomEndif) + label = "#endif"; + else if (contextAtom == PpAtomIf) + label = "#if"; + else if (contextAtom == PpAtomLine) + label = "#line"; + else + label = ""; + + if (parseContext.relaxedErrors()) + parseContext.ppWarn(ppToken->loc, message, label, ""); + else + parseContext.ppError(ppToken->loc, message, label, ""); + + while (token != '\n' && token != EndOfInput) + token = scanToken(ppToken); + } + + return token; +} + +enum eval_prec { + MIN_PRECEDENCE, + COND, LOGOR, LOGAND, OR, XOR, AND, EQUAL, RELATION, SHIFT, ADD, MUL, UNARY, + MAX_PRECEDENCE +}; + +namespace { + + int op_logor(int a, int b) { return a || b; } + int op_logand(int a, int b) { return a && b; } + int op_or(int a, int b) { return a | b; } + int op_xor(int a, int b) { return a ^ b; } + int op_and(int a, int b) { return a & b; } + int op_eq(int a, int b) { return a == b; } + int op_ne(int a, int b) { return a != b; } + int op_ge(int a, int b) { return a >= b; } + int op_le(int a, int b) { return a <= b; } + int op_gt(int a, int b) { return a > b; } + int op_lt(int a, int b) { return a < b; } + int op_shl(int a, int b) { return a << b; } + int op_shr(int a, int b) { return a >> b; } + int op_add(int a, int b) { return a + b; } + int op_sub(int a, int b) { return a - b; } + int op_mul(int a, int b) { return a * b; } + int op_div(int a, int b) { return a == INT_MIN && b == -1 ? 0 : a / b; } + int op_mod(int a, int b) { return a == INT_MIN && b == -1 ? 0 : a % b; } + int op_pos(int a) { return a; } + int op_neg(int a) { return a == INT_MIN ? INT_MIN : -a; } + int op_cmpl(int a) { return ~a; } + int op_not(int a) { return !a; } + +struct TBinop { + int token, precedence, (*op)(int, int); +} binop[] = { + { PpAtomOr, LOGOR, op_logor }, + { PpAtomAnd, LOGAND, op_logand }, + { '|', OR, op_or }, + { '^', XOR, op_xor }, + { '&', AND, op_and }, + { PpAtomEQ, EQUAL, op_eq }, + { PpAtomNE, EQUAL, op_ne }, + { '>', RELATION, op_gt }, + { PpAtomGE, RELATION, op_ge }, + { '<', RELATION, op_lt }, + { PpAtomLE, RELATION, op_le }, + { PpAtomLeft, SHIFT, op_shl }, + { PpAtomRight, SHIFT, op_shr }, + { '+', ADD, op_add }, + { '-', ADD, op_sub }, + { '*', MUL, op_mul }, + { '/', MUL, op_div }, + { '%', MUL, op_mod }, +}; + +struct TUnop { + int token, (*op)(int); +} unop[] = { + { '+', op_pos }, + { '-', op_neg }, + { '~', op_cmpl }, + { '!', op_not }, +}; + +} // anonymous namespace + +#define NUM_ELEMENTS(A) (sizeof(A) / sizeof(A[0])) + +int TPpContext::eval(int token, int precedence, bool shortCircuit, int& res, bool& err, TPpToken* ppToken) +{ + TSourceLoc loc = ppToken->loc; // because we sometimes read the newline before reporting the error + if (token == PpAtomIdentifier) { + if (strcmp("defined", ppToken->name) == 0) { + if (! parseContext.isReadingHLSL() && isMacroInput()) { + if (parseContext.relaxedErrors()) + parseContext.ppWarn(ppToken->loc, "nonportable when expanded from macros for preprocessor expression", + "defined", ""); + else + parseContext.ppError(ppToken->loc, "cannot use in preprocessor expression when expanded from macros", + "defined", ""); + } + bool needclose = 0; + token = scanToken(ppToken); + if (token == '(') { + needclose = true; + token = scanToken(ppToken); + } + if (token != PpAtomIdentifier) { + parseContext.ppError(loc, "incorrect directive, expected identifier", "preprocessor evaluation", ""); + err = true; + res = 0; + + return token; + } + + MacroSymbol* macro = lookupMacroDef(atomStrings.getAtom(ppToken->name)); + res = macro != nullptr ? !macro->undef : 0; + token = scanToken(ppToken); + if (needclose) { + if (token != ')') { + parseContext.ppError(loc, "expected ')'", "preprocessor evaluation", ""); + err = true; + res = 0; + + return token; + } + token = scanToken(ppToken); + } + } else { + token = tokenPaste(token, *ppToken); + token = evalToToken(token, shortCircuit, res, err, ppToken); + return eval(token, precedence, shortCircuit, res, err, ppToken); + } + } else if (token == PpAtomConstInt) { + res = ppToken->ival; + token = scanToken(ppToken); + } else if (token == '(') { + token = scanToken(ppToken); + token = eval(token, MIN_PRECEDENCE, shortCircuit, res, err, ppToken); + if (! err) { + if (token != ')') { + parseContext.ppError(loc, "expected ')'", "preprocessor evaluation", ""); + err = true; + res = 0; + + return token; + } + token = scanToken(ppToken); + } + } else { + int op = NUM_ELEMENTS(unop) - 1; + for (; op >= 0; op--) { + if (unop[op].token == token) + break; + } + if (op >= 0) { + token = scanToken(ppToken); + token = eval(token, UNARY, shortCircuit, res, err, ppToken); + res = unop[op].op(res); + } else { + parseContext.ppError(loc, "bad expression", "preprocessor evaluation", ""); + err = true; + res = 0; + + return token; + } + } + + token = evalToToken(token, shortCircuit, res, err, ppToken); + + // Perform evaluation of binary operation, if there is one, otherwise we are done. + while (! err) { + if (token == ')' || token == '\n') + break; + int op; + for (op = NUM_ELEMENTS(binop) - 1; op >= 0; op--) { + if (binop[op].token == token) + break; + } + if (op < 0 || binop[op].precedence <= precedence) + break; + int leftSide = res; + + // Setup short-circuiting, needed for ES, unless already in a short circuit. + // (Once in a short-circuit, can't turn off again, until that whole subexpression is done. + if (! shortCircuit) { + if ((token == PpAtomOr && leftSide == 1) || + (token == PpAtomAnd && leftSide == 0)) + shortCircuit = true; + } + + token = scanToken(ppToken); + token = eval(token, binop[op].precedence, shortCircuit, res, err, ppToken); + + if (binop[op].op == op_div || binop[op].op == op_mod) { + if (res == 0) { + parseContext.ppError(loc, "division by 0", "preprocessor evaluation", ""); + res = 1; + } + } + res = binop[op].op(leftSide, res); + } + + return token; +} + +// Expand macros, skipping empty expansions, to get to the first real token in those expansions. +int TPpContext::evalToToken(int token, bool shortCircuit, int& res, bool& err, TPpToken* ppToken) +{ + while (token == PpAtomIdentifier && strcmp("defined", ppToken->name) != 0) { + switch (MacroExpand(ppToken, true, false)) { + case MacroExpandNotStarted: + case MacroExpandError: + parseContext.ppError(ppToken->loc, "can't evaluate expression", "preprocessor evaluation", ""); + err = true; + res = 0; + break; + case MacroExpandStarted: + break; + case MacroExpandUndef: + if (! shortCircuit && parseContext.isEsProfile()) { + const char* message = "undefined macro in expression not allowed in es profile"; + if (parseContext.relaxedErrors()) + parseContext.ppWarn(ppToken->loc, message, "preprocessor evaluation", ppToken->name); + else + parseContext.ppError(ppToken->loc, message, "preprocessor evaluation", ppToken->name); + } + break; + } + token = scanToken(ppToken); + if (err) + break; + } + + return token; +} + +// Handle #if +int TPpContext::CPPif(TPpToken* ppToken) +{ + int token = scanToken(ppToken); + if (ifdepth >= maxIfNesting || elsetracker >= maxIfNesting) { + parseContext.ppError(ppToken->loc, "maximum nesting depth exceeded", "#if", ""); + return EndOfInput; + } else { + elsetracker++; + ifdepth++; + } + int res = 0; + bool err = false; + token = eval(token, MIN_PRECEDENCE, false, res, err, ppToken); + token = extraTokenCheck(PpAtomIf, ppToken, token); + if (!res && !err) + token = CPPelse(1, ppToken); + + return token; +} + +// Handle #ifdef +int TPpContext::CPPifdef(int defined, TPpToken* ppToken) +{ + int token = scanToken(ppToken); + if (ifdepth > maxIfNesting || elsetracker > maxIfNesting) { + parseContext.ppError(ppToken->loc, "maximum nesting depth exceeded", "#ifdef", ""); + return EndOfInput; + } else { + elsetracker++; + ifdepth++; + } + + if (token != PpAtomIdentifier) { + if (defined) + parseContext.ppError(ppToken->loc, "must be followed by macro name", "#ifdef", ""); + else + parseContext.ppError(ppToken->loc, "must be followed by macro name", "#ifndef", ""); + } else { + MacroSymbol* macro = lookupMacroDef(atomStrings.getAtom(ppToken->name)); + token = scanToken(ppToken); + if (token != '\n') { + parseContext.ppError(ppToken->loc, "unexpected tokens following #ifdef directive - expected a newline", "#ifdef", ""); + while (token != '\n' && token != EndOfInput) + token = scanToken(ppToken); + } + if (((macro != nullptr && !macro->undef) ? 1 : 0) != defined) + token = CPPelse(1, ppToken); + } + + return token; +} + +// Handle #include ... +// TODO: Handle macro expansions for the header name +int TPpContext::CPPinclude(TPpToken* ppToken) +{ + const TSourceLoc directiveLoc = ppToken->loc; + bool startWithLocalSearch = true; // to additionally include the extra "" paths + int token; + + // Find the first non-whitespace char after #include + int ch = getChar(); + while (ch == ' ' || ch == '\t') { + ch = getChar(); + } + if (ch == '<') { + // style + startWithLocalSearch = false; + token = scanHeaderName(ppToken, '>'); + } else if (ch == '"') { + // "header-name" style + token = scanHeaderName(ppToken, '"'); + } else { + // unexpected, get the full token to generate the error + ungetChar(); + token = scanToken(ppToken); + } + + if (token != PpAtomConstString) { + parseContext.ppError(directiveLoc, "must be followed by a header name", "#include", ""); + return token; + } + + // Make a copy of the name because it will be overwritten by the next token scan. + const std::string filename = ppToken->name; + + // See if the directive was well formed + token = scanToken(ppToken); + if (token != '\n') { + if (token == EndOfInput) + parseContext.ppError(ppToken->loc, "expected newline after header name:", "#include", "%s", filename.c_str()); + else + parseContext.ppError(ppToken->loc, "extra content after header name:", "#include", "%s", filename.c_str()); + return token; + } + + // Process well-formed directive + + // Find the inclusion, first look in "Local" ("") paths, if requested, + // otherwise, only search the "System" (<>) paths. + TShader::Includer::IncludeResult* res = nullptr; + if (startWithLocalSearch) + res = includer.includeLocal(filename.c_str(), currentSourceFile.c_str(), includeStack.size() + 1); + if (res == nullptr || res->headerName.empty()) { + includer.releaseInclude(res); + res = includer.includeSystem(filename.c_str(), currentSourceFile.c_str(), includeStack.size() + 1); + } + + // Process the results + if (res != nullptr && !res->headerName.empty()) { + if (res->headerData != nullptr && res->headerLength > 0) { + // path for processing one or more tokens from an included header, hand off 'res' + const bool forNextLine = parseContext.lineDirectiveShouldSetNextLine(); + std::ostringstream prologue; + std::ostringstream epilogue; + prologue << "#line " << forNextLine << " " << "\"" << res->headerName << "\"\n"; + epilogue << (res->headerData[res->headerLength - 1] == '\n'? "" : "\n") << + "#line " << directiveLoc.line + forNextLine << " " << directiveLoc.getStringNameOrNum() << "\n"; + pushInput(new TokenizableIncludeFile(directiveLoc, prologue.str(), res, epilogue.str(), this)); + parseContext.intermediate.addIncludeText(res->headerName.c_str(), res->headerData, res->headerLength); + // There's no "current" location anymore. + parseContext.setCurrentColumn(0); + } else { + // things are okay, but there is nothing to process + includer.releaseInclude(res); + } + } else { + // error path, clean up + std::string message = + res != nullptr ? std::string(res->headerData, res->headerLength) + : std::string("Could not process include directive"); + parseContext.ppError(directiveLoc, message.c_str(), "#include", "for header name: %s", filename.c_str()); + includer.releaseInclude(res); + } + + return token; +} + +// Handle #line +int TPpContext::CPPline(TPpToken* ppToken) +{ + // "#line must have, after macro substitution, one of the following forms: + // "#line line + // "#line line source-string-number" + + int token = scanToken(ppToken); + const TSourceLoc directiveLoc = ppToken->loc; + if (token == '\n') { + parseContext.ppError(ppToken->loc, "must by followed by an integral literal", "#line", ""); + return token; + } + + int lineRes = 0; // Line number after macro expansion. + int lineToken = 0; + bool hasFile = false; + int fileRes = 0; // Source file number after macro expansion. + const char* sourceName = nullptr; // Optional source file name. + bool lineErr = false; + bool fileErr = false; + disableEscapeSequences = true; + token = eval(token, MIN_PRECEDENCE, false, lineRes, lineErr, ppToken); + disableEscapeSequences = false; + if (! lineErr) { + lineToken = lineRes; + if (token == '\n') + ++lineRes; + + if (parseContext.lineDirectiveShouldSetNextLine()) + --lineRes; + parseContext.setCurrentLine(lineRes); + + if (token != '\n') { + if (token == PpAtomConstString) { + parseContext.ppRequireExtensions(directiveLoc, 1, &E_GL_GOOGLE_cpp_style_line_directive, "filename-based #line"); + // We need to save a copy of the string instead of pointing + // to the name field of the token since the name field + // will likely be overwritten by the next token scan. + sourceName = atomStrings.getString(atomStrings.getAddAtom(ppToken->name)); + parseContext.setCurrentSourceName(sourceName); + hasFile = true; + token = scanToken(ppToken); + } else { + token = eval(token, MIN_PRECEDENCE, false, fileRes, fileErr, ppToken); + if (! fileErr) { + parseContext.setCurrentString(fileRes); + hasFile = true; + } + } + } + } + if (!fileErr && !lineErr) { + parseContext.notifyLineDirective(directiveLoc.line, lineToken, hasFile, fileRes, sourceName); + } + token = extraTokenCheck(PpAtomLine, ppToken, token); + + return token; +} + +// Handle #error +int TPpContext::CPPerror(TPpToken* ppToken) +{ + disableEscapeSequences = true; + int token = scanToken(ppToken); + disableEscapeSequences = false; + std::string message; + TSourceLoc loc = ppToken->loc; + + while (token != '\n' && token != EndOfInput) { + if (token == PpAtomConstInt16 || token == PpAtomConstUint16 || + token == PpAtomConstInt || token == PpAtomConstUint || + token == PpAtomConstInt64 || token == PpAtomConstUint64 || + token == PpAtomConstFloat16 || + token == PpAtomConstFloat || token == PpAtomConstDouble) { + message.append(ppToken->name); + } else if (token == PpAtomIdentifier || token == PpAtomConstString) { + message.append(ppToken->name); + } else { + message.append(atomStrings.getString(token)); + } + message.append(" "); + token = scanToken(ppToken); + } + parseContext.notifyErrorDirective(loc.line, message.c_str()); + // store this msg into the shader's information log..set the Compile Error flag!!!! + parseContext.ppError(loc, message.c_str(), "#error", ""); + + return '\n'; +} + +// Handle #pragma +int TPpContext::CPPpragma(TPpToken* ppToken) +{ + char SrcStrName[2]; + TVector tokens; + + TSourceLoc loc = ppToken->loc; // because we go to the next line before processing + int token = scanToken(ppToken); + while (token != '\n' && token != EndOfInput) { + switch (token) { + case PpAtomIdentifier: + case PpAtomConstInt: + case PpAtomConstUint: + case PpAtomConstInt64: + case PpAtomConstUint64: + case PpAtomConstInt16: + case PpAtomConstUint16: + case PpAtomConstFloat: + case PpAtomConstDouble: + case PpAtomConstFloat16: + tokens.push_back(ppToken->name); + break; + default: + SrcStrName[0] = (char)token; + SrcStrName[1] = '\0'; + tokens.push_back(SrcStrName); + } + token = scanToken(ppToken); + } + + if (token == EndOfInput) + parseContext.ppError(loc, "directive must end with a newline", "#pragma", ""); + else + parseContext.handlePragma(loc, tokens); + + return token; +} + +// #version: This is just for error checking: the version and profile are decided before preprocessing starts +int TPpContext::CPPversion(TPpToken* ppToken) +{ + int token = scanToken(ppToken); + + if (errorOnVersion || versionSeen) { + if (parseContext.isReadingHLSL()) + parseContext.ppError(ppToken->loc, "invalid preprocessor command", "#version", ""); + else + parseContext.ppError(ppToken->loc, "must occur first in shader", "#version", ""); + } + versionSeen = true; + + if (token == '\n') { + parseContext.ppError(ppToken->loc, "must be followed by version number", "#version", ""); + + return token; + } + + if (token != PpAtomConstInt) + parseContext.ppError(ppToken->loc, "must be followed by version number", "#version", ""); + + ppToken->ival = atoi(ppToken->name); + int versionNumber = ppToken->ival; + int line = ppToken->loc.line; + token = scanToken(ppToken); + + if (token == '\n') { + parseContext.notifyVersion(line, versionNumber, nullptr); + return token; + } else { + int profileAtom = atomStrings.getAtom(ppToken->name); + if (profileAtom != PpAtomCore && + profileAtom != PpAtomCompatibility && + profileAtom != PpAtomEs) + parseContext.ppError(ppToken->loc, "bad profile name; use es, core, or compatibility", "#version", ""); + parseContext.notifyVersion(line, versionNumber, ppToken->name); + token = scanToken(ppToken); + + if (token == '\n') + return token; + else + parseContext.ppError(ppToken->loc, "bad tokens following profile -- expected newline", "#version", ""); + } + + return token; +} + +// Handle #extension +int TPpContext::CPPextension(TPpToken* ppToken) +{ + int line = ppToken->loc.line; + int token = scanToken(ppToken); + char extensionName[MaxTokenLength + 1]; + + if (token=='\n') { + parseContext.ppError(ppToken->loc, "extension name not specified", "#extension", ""); + return token; + } + + if (token != PpAtomIdentifier) + parseContext.ppError(ppToken->loc, "extension name expected", "#extension", ""); + + snprintf(extensionName, sizeof(extensionName), "%s", ppToken->name); + + token = scanToken(ppToken); + if (token != ':') { + parseContext.ppError(ppToken->loc, "':' missing after extension name", "#extension", ""); + return token; + } + + token = scanToken(ppToken); + if (token != PpAtomIdentifier) { + parseContext.ppError(ppToken->loc, "behavior for extension not specified", "#extension", ""); + return token; + } + + parseContext.updateExtensionBehavior(line, extensionName, ppToken->name); + parseContext.notifyExtensionDirective(line, extensionName, ppToken->name); + + token = scanToken(ppToken); + if (token == '\n') + return token; + else + parseContext.ppError(ppToken->loc, "extra tokens -- expected newline", "#extension",""); + + return token; +} + +int TPpContext::readCPPline(TPpToken* ppToken) +{ + int token = scanToken(ppToken); + + if (token == PpAtomIdentifier) { + switch (atomStrings.getAtom(ppToken->name)) { + case PpAtomDefine: + token = CPPdefine(ppToken); + break; + case PpAtomElse: + if (elseSeen[elsetracker]) + parseContext.ppError(ppToken->loc, "#else after #else", "#else", ""); + elseSeen[elsetracker] = true; + if (ifdepth == 0) + parseContext.ppError(ppToken->loc, "mismatched statements", "#else", ""); + token = extraTokenCheck(PpAtomElse, ppToken, scanToken(ppToken)); + token = CPPelse(0, ppToken); + break; + case PpAtomElif: + if (ifdepth == 0) + parseContext.ppError(ppToken->loc, "mismatched statements", "#elif", ""); + if (elseSeen[elsetracker]) + parseContext.ppError(ppToken->loc, "#elif after #else", "#elif", ""); + // this token is really a dont care, but we still need to eat the tokens + token = scanToken(ppToken); + while (token != '\n' && token != EndOfInput) + token = scanToken(ppToken); + token = CPPelse(0, ppToken); + break; + case PpAtomEndif: + if (ifdepth == 0) + parseContext.ppError(ppToken->loc, "mismatched statements", "#endif", ""); + else { + elseSeen[elsetracker] = false; + --elsetracker; + --ifdepth; + } + token = extraTokenCheck(PpAtomEndif, ppToken, scanToken(ppToken)); + break; + case PpAtomIf: + token = CPPif(ppToken); + break; + case PpAtomIfdef: + token = CPPifdef(1, ppToken); + break; + case PpAtomIfndef: + token = CPPifdef(0, ppToken); + break; + case PpAtomLine: + token = CPPline(ppToken); + break; + case PpAtomInclude: + if(!parseContext.isReadingHLSL()) { + const std::array exts = { E_GL_GOOGLE_include_directive, E_GL_ARB_shading_language_include }; + parseContext.ppRequireExtensions(ppToken->loc, exts, "#include"); + } + token = CPPinclude(ppToken); + break; + case PpAtomPragma: + token = CPPpragma(ppToken); + break; + case PpAtomUndef: + token = CPPundef(ppToken); + break; + case PpAtomError: + token = CPPerror(ppToken); + break; + case PpAtomVersion: + token = CPPversion(ppToken); + break; + case PpAtomExtension: + token = CPPextension(ppToken); + break; + default: + parseContext.ppError(ppToken->loc, "invalid directive:", "#", ppToken->name); + break; + } + } else if (token != '\n' && token != EndOfInput) + parseContext.ppError(ppToken->loc, "invalid directive", "#", ""); + + while (token != '\n' && token != EndOfInput) + token = scanToken(ppToken); + + return token; +} + +// Context-dependent parsing of a #include . +// Assumes no macro expansions etc. are being done; the name is just on the current input. +// Always creates a name and returns PpAtomicConstString, unless we run out of input. +int TPpContext::scanHeaderName(TPpToken* ppToken, char delimit) +{ + bool tooLong = false; + + if (inputStack.empty()) + return EndOfInput; + + int len = 0; + ppToken->name[0] = '\0'; + do { + int ch = inputStack.back()->getch(); + + // done yet? + if (ch == delimit) { + ppToken->name[len] = '\0'; + if (tooLong) + parseContext.ppError(ppToken->loc, "header name too long", "", ""); + return PpAtomConstString; + } else if (ch == EndOfInput) + return EndOfInput; + + // found a character to expand the name with + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + else + tooLong = true; + } while (true); +} + +// Macro-expand a macro argument 'arg' to create 'expandedArg'. +// Does not replace 'arg'. +// Returns nullptr if no expanded argument is created. +TPpContext::TokenStream* TPpContext::PrescanMacroArg(TokenStream& arg, TPpToken* ppToken, bool newLineOkay) +{ + // expand the argument + TokenStream* expandedArg = new TokenStream; + pushInput(new tMarkerInput(this)); + pushTokenStreamInput(arg); + int token; + while ((token = scanToken(ppToken)) != tMarkerInput::marker && token != EndOfInput) { + token = tokenPaste(token, *ppToken); + if (token == PpAtomIdentifier) { + switch (MacroExpand(ppToken, false, newLineOkay)) { + case MacroExpandNotStarted: + break; + case MacroExpandError: + // toss the rest of the pushed-input argument by scanning until tMarkerInput + while ((token = scanToken(ppToken)) != tMarkerInput::marker && token != EndOfInput) + ; + break; + case MacroExpandStarted: + case MacroExpandUndef: + continue; + } + } + if (token == tMarkerInput::marker || token == EndOfInput) + break; + expandedArg->putToken(token, ppToken); + } + + if (token != tMarkerInput::marker) { + // Error, or MacroExpand ate the marker, so had bad input, recover + delete expandedArg; + expandedArg = nullptr; + } + + return expandedArg; +} + +// +// Return the next token for a macro expansion, handling macro arguments, +// whose semantics are dependent on being adjacent to ##. +// +int TPpContext::tMacroInput::scan(TPpToken* ppToken) +{ + int token; + do { + token = mac->body.getToken(pp->parseContext, ppToken); + } while (token == ' '); // handle white space in macro + + // Hash operators basically turn off a round of macro substitution + // (the round done on the argument before the round done on the RHS of the + // macro definition): + // + // "A parameter in the replacement list, unless preceded by a # or ## + // preprocessing token or followed by a ## preprocessing token (see below), + // is replaced by the corresponding argument after all macros contained + // therein have been expanded." + // + // "If, in the replacement list, a parameter is immediately preceded or + // followed by a ## preprocessing token, the parameter is replaced by the + // corresponding argument's preprocessing token sequence." + + bool pasting = false; + if (postpaste) { + // don't expand next token + pasting = true; + postpaste = false; + } + + if (prepaste) { + // already know we should be on a ##, verify + assert(token == PpAtomPaste); + prepaste = false; + postpaste = true; + } + + // see if are preceding a ## + if (mac->body.peekTokenizedPasting(false)) { + prepaste = true; + pasting = true; + } + + + // TODO: preprocessor: properly handle whitespace (or lack of it) between tokens when expanding + if (token == PpAtomIdentifier) { + int i; + for (i = (int)mac->args.size() - 1; i >= 0; i--) + if (strcmp(pp->atomStrings.getString(mac->args[i]), ppToken->name) == 0) + break; + if (i >= 0) { + TokenStream* arg = expandedArgs[i]; + bool expanded = !!arg && !pasting; + // HLSL does expand macros before concatenation + if (arg == nullptr || (pasting && !pp->parseContext.isReadingHLSL()) ) { + arg = args[i]; + } + pp->pushTokenStreamInput(*arg, prepaste, expanded); + + return pp->scanToken(ppToken); + } + } + + if (token == EndOfInput) + mac->busy = 0; + + return token; +} + +// return a textual zero, for scanning a macro that was never defined +int TPpContext::tZeroInput::scan(TPpToken* ppToken) +{ + if (done) + return EndOfInput; + + ppToken->name[0] = '0'; + ppToken->name[1] = 0; + ppToken->ival = 0; + ppToken->space = false; + done = true; + + return PpAtomConstInt; +} + +// +// Check a token to see if it is a macro that should be expanded: +// - If it is, and defined, push a tInput that will produce the appropriate +// expansion and return MacroExpandStarted. +// - If it is, but undefined, and expandUndef is requested, push a tInput +// that will expand to 0 and return MacroExpandUndef. +// - Otherwise, there is no expansion, and there are two cases: +// * It might be okay there is no expansion, and no specific error was +// detected. Returns MacroExpandNotStarted. +// * The expansion was started, but could not be completed, due to an error +// that cannot be recovered from. Returns MacroExpandError. +// +MacroExpandResult TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOkay) +{ + ppToken->space = false; + int macroAtom = atomStrings.getAtom(ppToken->name); + if (ppToken->fullyExpanded) + return MacroExpandNotStarted; + + switch (macroAtom) { + case PpAtomLineMacro: + // Arguments which are macro have been replaced in the first stage. + if (ppToken->ival == 0) + ppToken->ival = parseContext.getCurrentLoc().line; + snprintf(ppToken->name, sizeof(ppToken->name), "%d", ppToken->ival); + UngetToken(PpAtomConstInt, ppToken); + return MacroExpandStarted; + + case PpAtomFileMacro: { + if (parseContext.getCurrentLoc().name) + parseContext.ppRequireExtensions(ppToken->loc, 1, &E_GL_GOOGLE_cpp_style_line_directive, "filename-based __FILE__"); + ppToken->ival = parseContext.getCurrentLoc().string; + snprintf(ppToken->name, sizeof(ppToken->name), "%s", ppToken->loc.getStringNameOrNum().c_str()); + UngetToken(PpAtomConstInt, ppToken); + return MacroExpandStarted; + } + + case PpAtomVersionMacro: + ppToken->ival = parseContext.version; + snprintf(ppToken->name, sizeof(ppToken->name), "%d", ppToken->ival); + UngetToken(PpAtomConstInt, ppToken); + return MacroExpandStarted; + + default: + break; + } + + MacroSymbol* macro = macroAtom == 0 ? nullptr : lookupMacroDef(macroAtom); + + // no recursive expansions + if (macro != nullptr && macro->busy) { + ppToken->fullyExpanded = true; + return MacroExpandNotStarted; + } + + // not expanding undefined macros + if ((macro == nullptr || macro->undef) && ! expandUndef) + return MacroExpandNotStarted; + + // 0 is the value of an undefined macro + if ((macro == nullptr || macro->undef) && expandUndef) { + pushInput(new tZeroInput(this)); + return MacroExpandUndef; + } + + tMacroInput *in = new tMacroInput(this); + + TSourceLoc loc = ppToken->loc; // in case we go to the next line before discovering the error + in->mac = macro; + if (macro->functionLike) { + // We don't know yet if this will be a successful call of a + // function-like macro; need to look for a '(', but without trashing + // the passed in ppToken, until we know we are no longer speculative. + TPpToken parenToken; + int token = scanToken(&parenToken); + if (newLineOkay) { + while (token == '\n') + token = scanToken(&parenToken); + } + if (token != '(') { + // Function-like macro called with object-like syntax: okay, don't expand. + // (We ate exactly one token that might not be white space; put it back. + UngetToken(token, &parenToken); + delete in; + return MacroExpandNotStarted; + } + in->args.resize(in->mac->args.size()); + for (size_t i = 0; i < in->mac->args.size(); i++) + in->args[i] = new TokenStream; + in->expandedArgs.resize(in->mac->args.size()); + for (size_t i = 0; i < in->mac->args.size(); i++) + in->expandedArgs[i] = nullptr; + size_t arg = 0; + bool tokenRecorded = false; + do { + TVector nestStack; + while (true) { + token = scanToken(ppToken); + if (token == EndOfInput || token == tMarkerInput::marker) { + parseContext.ppError(loc, "End of input in macro", "macro expansion", atomStrings.getString(macroAtom)); + delete in; + return MacroExpandError; + } + if (token == '\n') { + if (! newLineOkay) { + parseContext.ppError(loc, "End of line in macro substitution:", "macro expansion", atomStrings.getString(macroAtom)); + delete in; + return MacroExpandError; + } + continue; + } + if (token == '#') { + parseContext.ppError(ppToken->loc, "unexpected '#'", "macro expansion", atomStrings.getString(macroAtom)); + delete in; + return MacroExpandError; + } + if (in->mac->args.size() == 0 && token != ')') + break; + if (nestStack.size() == 0 && (token == ',' || token == ')')) + break; + if (token == '(') + nestStack.push_back(')'); + else if (token == '{' && parseContext.isReadingHLSL()) + nestStack.push_back('}'); + else if (nestStack.size() > 0 && token == nestStack.back()) + nestStack.pop_back(); + + //Macro replacement list is expanded in the last stage. + if (atomStrings.getAtom(ppToken->name) == PpAtomLineMacro) + ppToken->ival = parseContext.getCurrentLoc().line; + + in->args[arg]->putToken(token, ppToken); + tokenRecorded = true; + } + // end of single argument scan + + if (token == ')') { + // closing paren of call + if (in->mac->args.size() == 1 && !tokenRecorded) + break; + arg++; + break; + } + arg++; + } while (arg < in->mac->args.size()); + // end of all arguments scan + + if (arg < in->mac->args.size()) + parseContext.ppError(loc, "Too few args in Macro", "macro expansion", atomStrings.getString(macroAtom)); + else if (token != ')') { + // Error recover code; find end of call, if possible + int depth = 0; + while (token != EndOfInput && (depth > 0 || token != ')')) { + if (token == ')' || token == '}') + depth--; + token = scanToken(ppToken); + if (token == '(' || token == '{') + depth++; + } + + if (token == EndOfInput) { + parseContext.ppError(loc, "End of input in macro", "macro expansion", atomStrings.getString(macroAtom)); + delete in; + return MacroExpandError; + } + parseContext.ppError(loc, "Too many args in macro", "macro expansion", atomStrings.getString(macroAtom)); + } + + // We need both expanded and non-expanded forms of the argument, for whether or + // not token pasting will be applied later when the argument is consumed next to ##. + for (size_t i = 0; i < in->mac->args.size(); i++) + in->expandedArgs[i] = PrescanMacroArg(*in->args[i], ppToken, newLineOkay); + } + + pushInput(in); + macro->busy = 1; + macro->body.reset(); + + return MacroExpandStarted; +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp new file mode 100644 index 0000000000..219291335e --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp @@ -0,0 +1,184 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +/****************************************************************************\ +Copyright (c) 2002, NVIDIA Corporation. + +NVIDIA Corporation("NVIDIA") supplies this software to you in +consideration of your agreement to the following terms, and your use, +installation, modification or redistribution of this NVIDIA software +constitutes acceptance of these terms. If you do not agree with these +terms, please do not use, install, modify or redistribute this NVIDIA +software. + +In consideration of your agreement to abide by the following terms, and +subject to these terms, NVIDIA grants you a personal, non-exclusive +license, under NVIDIA's copyrights in this original NVIDIA software (the +"NVIDIA Software"), to use, reproduce, modify and redistribute the +NVIDIA Software, with or without modifications, in source and/or binary +forms; provided that if you redistribute the NVIDIA Software, you must +retain the copyright notice of NVIDIA, this notice and the following +text and disclaimers in all such redistributions of the NVIDIA Software. +Neither the name, trademarks, service marks nor logos of NVIDIA +Corporation may be used to endorse or promote products derived from the +NVIDIA Software without specific prior written permission from NVIDIA. +Except as expressly stated in this notice, no other rights or licenses +express or implied, are granted by NVIDIA herein, including but not +limited to any patent rights that may be infringed by your derivative +works or by other works in which the NVIDIA Software may be +incorporated. No hardware is licensed hereunder. + +THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, +INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER +PRODUCTS. + +IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, +INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY +OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE +NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, +TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF +NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\****************************************************************************/ + +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS +#endif + +#include +#include +#include + +#include "PpContext.h" +#include "PpTokens.h" + +namespace { + +using namespace QtShaderTools; +using namespace glslang; + +const struct { + int val; + const char* str; +} tokens[] = { + + { PPAtomAddAssign, "+=" }, + { PPAtomSubAssign, "-=" }, + { PPAtomMulAssign, "*=" }, + { PPAtomDivAssign, "/=" }, + { PPAtomModAssign, "%=" }, + + { PpAtomRight, ">>" }, + { PpAtomLeft, "<<" }, + { PpAtomAnd, "&&" }, + { PpAtomOr, "||" }, + { PpAtomXor, "^^" }, + + { PpAtomRightAssign, ">>=" }, + { PpAtomLeftAssign, "<<=" }, + { PpAtomAndAssign, "&=" }, + { PpAtomOrAssign, "|=" }, + { PpAtomXorAssign, "^=" }, + + { PpAtomEQ, "==" }, + { PpAtomNE, "!=" }, + { PpAtomGE, ">=" }, + { PpAtomLE, "<=" }, + + { PpAtomDecrement, "--" }, + { PpAtomIncrement, "++" }, + + { PpAtomColonColon, "::" }, + + { PpAtomDefine, "define" }, + { PpAtomUndef, "undef" }, + { PpAtomIf, "if" }, + { PpAtomElif, "elif" }, + { PpAtomElse, "else" }, + { PpAtomEndif, "endif" }, + { PpAtomIfdef, "ifdef" }, + { PpAtomIfndef, "ifndef" }, + { PpAtomLine, "line" }, + { PpAtomPragma, "pragma" }, + { PpAtomError, "error" }, + + { PpAtomVersion, "version" }, + { PpAtomCore, "core" }, + { PpAtomCompatibility, "compatibility" }, + { PpAtomEs, "es" }, + { PpAtomExtension, "extension" }, + + { PpAtomLineMacro, "__LINE__" }, + { PpAtomFileMacro, "__FILE__" }, + { PpAtomVersionMacro, "__VERSION__" }, + + { PpAtomInclude, "include" }, +}; + +} // end anonymous namespace + +namespace QtShaderTools { +namespace glslang { + +// +// Initialize the atom table. +// +TStringAtomMap::TStringAtomMap() +{ + badToken.assign(""); + + // Add single character tokens to the atom table: + const char* s = "~!%^&*()-+=|,.<>/?;:[]{}#\\"; + char t[2]; + + t[1] = '\0'; + while (*s) { + t[0] = *s; + addAtomFixed(t, s[0]); + s++; + } + + // Add multiple character scanner tokens : + for (size_t ii = 0; ii < sizeof(tokens)/sizeof(tokens[0]); ii++) + addAtomFixed(tokens[ii].str, tokens[ii].val); + + nextAtom = PpAtomLast; +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp new file mode 100644 index 0000000000..0bdadfb674 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp @@ -0,0 +1,123 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +/****************************************************************************\ +Copyright (c) 2002, NVIDIA Corporation. + +NVIDIA Corporation("NVIDIA") supplies this software to you in +consideration of your agreement to the following terms, and your use, +installation, modification or redistribution of this NVIDIA software +constitutes acceptance of these terms. If you do not agree with these +terms, please do not use, install, modify or redistribute this NVIDIA +software. + +In consideration of your agreement to abide by the following terms, and +subject to these terms, NVIDIA grants you a personal, non-exclusive +license, under NVIDIA's copyrights in this original NVIDIA software (the +"NVIDIA Software"), to use, reproduce, modify and redistribute the +NVIDIA Software, with or without modifications, in source and/or binary +forms; provided that if you redistribute the NVIDIA Software, you must +retain the copyright notice of NVIDIA, this notice and the following +text and disclaimers in all such redistributions of the NVIDIA Software. +Neither the name, trademarks, service marks nor logos of NVIDIA +Corporation may be used to endorse or promote products derived from the +NVIDIA Software without specific prior written permission from NVIDIA. +Except as expressly stated in this notice, no other rights or licenses +express or implied, are granted by NVIDIA herein, including but not +limited to any patent rights that may be infringed by your derivative +works or by other works in which the NVIDIA Software may be +incorporated. No hardware is licensed hereunder. + +THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, +INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER +PRODUCTS. + +IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, +INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY +OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE +NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, +TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF +NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\****************************************************************************/ + +#include +#include + +#include "PpContext.h" + +namespace QtShaderTools { +namespace glslang { + +TPpContext::TPpContext(TParseContextBase& pc, const std::string& rootFileName, TShader::Includer& inclr) : + preamble(nullptr), strings(nullptr), previous_token('\n'), parseContext(pc), includer(inclr), inComment(false), + rootFileName(rootFileName), + currentSourceFile(rootFileName), + disableEscapeSequences(false), + inElseSkip(false) +{ + ifdepth = 0; + for (elsetracker = 0; elsetracker < maxIfNesting; elsetracker++) + elseSeen[elsetracker] = false; + elsetracker = 0; + + strtodStream.imbue(std::locale::classic()); +} + +TPpContext::~TPpContext() +{ + delete [] preamble; + + // free up the inputStack + while (! inputStack.empty()) + popInput(); +} + +void TPpContext::setInput(TInputScanner& input, bool versionWillBeError) +{ + assert(inputStack.size() == 0); + + pushInput(new tStringInput(this, input)); + + errorOnVersion = versionWillBeError; + versionSeen = false; +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h new file mode 100644 index 0000000000..40fdcea0d3 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h @@ -0,0 +1,759 @@ +// +// Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +/****************************************************************************\ +Copyright (c) 2002, NVIDIA Corporation. + +NVIDIA Corporation("NVIDIA") supplies this software to you in +consideration of your agreement to the following terms, and your use, +installation, modification or redistribution of this NVIDIA software +constitutes acceptance of these terms. If you do not agree with these +terms, please do not use, install, modify or redistribute this NVIDIA +software. + +In consideration of your agreement to abide by the following terms, and +subject to these terms, NVIDIA grants you a personal, non-exclusive +license, under NVIDIA's copyrights in this original NVIDIA software (the +"NVIDIA Software"), to use, reproduce, modify and redistribute the +NVIDIA Software, with or without modifications, in source and/or binary +forms; provided that if you redistribute the NVIDIA Software, you must +retain the copyright notice of NVIDIA, this notice and the following +text and disclaimers in all such redistributions of the NVIDIA Software. +Neither the name, trademarks, service marks nor logos of NVIDIA +Corporation may be used to endorse or promote products derived from the +NVIDIA Software without specific prior written permission from NVIDIA. +Except as expressly stated in this notice, no other rights or licenses +express or implied, are granted by NVIDIA herein, including but not +limited to any patent rights that may be infringed by your derivative +works or by other works in which the NVIDIA Software may be +incorporated. No hardware is licensed hereunder. + +THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, +INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER +PRODUCTS. + +IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, +INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY +OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE +NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, +TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF +NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\****************************************************************************/ + +#ifndef PPCONTEXT_H +#define PPCONTEXT_H + +#include +#include +#include + +#include "../ParseHelper.h" +#include "PpTokens.h" + +namespace QtShaderTools { +namespace glslang { + +class TPpToken { +public: + TPpToken() { clear(); } + void clear() + { + space = false; + i64val = 0; + loc.init(); + name[0] = 0; + fullyExpanded = false; + } + + // Used for comparing macro definitions, so checks what is relevant for that. + bool operator==(const TPpToken& right) const + { + return space == right.space && + ival == right.ival && dval == right.dval && i64val == right.i64val && + strncmp(name, right.name, MaxTokenLength) == 0; + } + bool operator!=(const TPpToken& right) const { return ! operator==(right); } + + TSourceLoc loc; + // True if a space (for white space or a removed comment) should also be + // recognized, in front of the token returned: + bool space; + + bool fullyExpanded; + // Numeric value of the token: + union { + int ival; + double dval; + long long i64val; + }; + // Text string of the token: + char name[MaxTokenLength + 1]; +}; + +class TStringAtomMap { +// +// Implementation is in PpAtom.cpp +// +// Maintain a bi-directional mapping between relevant preprocessor strings and +// "atoms" which a unique integers (small, contiguous, not hash-like) per string. +// +public: + TStringAtomMap(); + + // Map string -> atom. + // Return 0 if no existing string. + int getAtom(const char* s) const + { + auto it = atomMap.find(s); + return it == atomMap.end() ? 0 : it->second; + } + + // Map a new or existing string -> atom, inventing a new atom if necessary. + int getAddAtom(const char* s) + { + int atom = getAtom(s); + if (atom == 0) { + atom = nextAtom++; + addAtomFixed(s, atom); + } + return atom; + } + + // Map atom -> string. + const char* getString(int atom) const { return stringMap[atom]->c_str(); } + +protected: + TStringAtomMap(TStringAtomMap&); + TStringAtomMap& operator=(TStringAtomMap&); + + TUnorderedMap atomMap; + TVector stringMap; // these point into the TString in atomMap + int nextAtom; + + // Bad source characters can lead to bad atoms, so gracefully handle those by + // pre-filling the table with them (to avoid if tests later). + TString badToken; + + // Add bi-directional mappings: + // - string -> atom + // - atom -> string + void addAtomFixed(const char* s, int atom) + { + auto it = atomMap.insert(std::pair(s, atom)).first; + if (stringMap.size() < (size_t)atom + 1) + stringMap.resize(atom + 100, &badToken); + stringMap[atom] = &it->first; + } +}; + +class TInputScanner; + +enum MacroExpandResult { + MacroExpandNotStarted, // macro not expanded, which might not be an error + MacroExpandError, // a clear error occurred while expanding, no expansion + MacroExpandStarted, // macro expansion process has started + MacroExpandUndef // macro is undefined and will be expanded +}; + +// This class is the result of turning a huge pile of C code communicating through globals +// into a class. This was done to allowing instancing to attain thread safety. +// Don't expect too much in terms of OO design. +class TPpContext { +public: + TPpContext(TParseContextBase&, const std::string& rootFileName, TShader::Includer&); + virtual ~TPpContext(); + + void setPreamble(const char* preamble, size_t length); + + int tokenize(TPpToken& ppToken); + int tokenPaste(int token, TPpToken&); + + class tInput { + public: + tInput(TPpContext* p) : done(false), pp(p) { } + virtual ~tInput() { } + + virtual int scan(TPpToken*) = 0; + virtual int getch() = 0; + virtual void ungetch() = 0; + virtual bool peekPasting() { return false; } // true when about to see ## + virtual bool peekContinuedPasting(int) { return false; } // true when non-spaced tokens can paste + virtual bool endOfReplacementList() { return false; } // true when at the end of a macro replacement list (RHS of #define) + virtual bool isMacroInput() { return false; } + virtual bool isStringInput() { return false; } + + // Will be called when we start reading tokens from this instance + virtual void notifyActivated() {} + // Will be called when we do not read tokens from this instance anymore + virtual void notifyDeleted() {} + protected: + bool done; + TPpContext* pp; + }; + + void setInput(TInputScanner& input, bool versionWillBeError); + + void pushInput(tInput* in) + { + inputStack.push_back(in); + in->notifyActivated(); + } + void popInput() + { + inputStack.back()->notifyDeleted(); + delete inputStack.back(); + inputStack.pop_back(); + } + + // + // From PpTokens.cpp + // + + // Capture the needed parts of a token stream for macro recording/playback. + class TokenStream { + public: + // Manage a stream of these 'Token', which capture the relevant parts + // of a TPpToken, plus its atom. + class Token { + public: + Token(int atom, const TPpToken& ppToken) : + atom(atom), + space(ppToken.space), + i64val(ppToken.i64val), + name(ppToken.name) { } + int get(TPpToken& ppToken) + { + ppToken.clear(); + ppToken.space = space; + ppToken.i64val = i64val; + snprintf(ppToken.name, sizeof(ppToken.name), "%s", name.c_str()); + return atom; + } + bool isAtom(int a) const { return atom == a; } + int getAtom() const { return atom; } + bool nonSpaced() const { return !space; } + protected: + Token() {} + int atom; + bool space; // did a space precede the token? + long long i64val; + TString name; + }; + + TokenStream() : currentPos(0) { } + + void putToken(int token, TPpToken* ppToken); + bool peekToken(int atom) { return !atEnd() && stream[currentPos].isAtom(atom); } + bool peekContinuedPasting(int atom) + { + // This is basically necessary because, for example, the PP + // tokenizer only accepts valid numeric-literals plus suffixes, so + // separates numeric-literals plus bad suffix into two tokens, which + // should get both pasted together as one token when token pasting. + // + // The following code is a bit more generalized than the above example. + if (!atEnd() && atom == PpAtomIdentifier && stream[currentPos].nonSpaced()) { + switch(stream[currentPos].getAtom()) { + case PpAtomConstInt: + case PpAtomConstUint: + case PpAtomConstInt64: + case PpAtomConstUint64: + case PpAtomConstInt16: + case PpAtomConstUint16: + case PpAtomConstFloat: + case PpAtomConstDouble: + case PpAtomConstFloat16: + case PpAtomConstString: + case PpAtomIdentifier: + return true; + default: + break; + } + } + + return false; + } + int getToken(TParseContextBase&, TPpToken*); + bool atEnd() { return currentPos >= stream.size(); } + bool peekTokenizedPasting(bool lastTokenPastes); + void reset() { currentPos = 0; } + + protected: + TVector stream; + size_t currentPos; + }; + + // + // From Pp.cpp + // + + struct MacroSymbol { + MacroSymbol() : functionLike(0), busy(0), undef(0) { } + TVector args; + TokenStream body; + unsigned functionLike : 1; // 0 means object-like, 1 means function-like + unsigned busy : 1; + unsigned undef : 1; + }; + + typedef TMap TSymbolMap; + TSymbolMap macroDefs; // map atoms to macro definitions + MacroSymbol* lookupMacroDef(int atom) + { + auto existingMacroIt = macroDefs.find(atom); + return (existingMacroIt == macroDefs.end()) ? nullptr : &(existingMacroIt->second); + } + void addMacroDef(int atom, MacroSymbol& macroDef) { macroDefs[atom] = macroDef; } + +protected: + TPpContext(TPpContext&); + TPpContext& operator=(TPpContext&); + + TStringAtomMap atomStrings; + char* preamble; // string to parse, all before line 1 of string 0, it is 0 if no preamble + int preambleLength; + char** strings; // official strings of shader, starting a string 0 line 1 + size_t* lengths; + int numStrings; // how many official strings there are + int currentString; // which string we're currently parsing (-1 for preamble) + + // Scanner data: + int previous_token; + TParseContextBase& parseContext; + std::vector lastLineTokens; + std::vector lastLineTokenLocs; + // Get the next token from *stack* of input sources, popping input sources + // that are out of tokens, down until an input source is found that has a token. + // Return EndOfInput when there are no more tokens to be found by doing this. + int scanToken(TPpToken* ppToken) + { + int token = EndOfInput; + + while (! inputStack.empty()) { + token = inputStack.back()->scan(ppToken); + if (token != EndOfInput || inputStack.empty()) + break; + popInput(); + } + if (!inputStack.empty() && inputStack.back()->isStringInput() && !inElseSkip) { + if (token == '\n') { + lastLineTokens.clear(); + lastLineTokenLocs.clear(); + } else { + lastLineTokens.push_back(token); + lastLineTokenLocs.push_back(ppToken->loc); + } + } + return token; + } + int getChar() { return inputStack.back()->getch(); } + void ungetChar() { inputStack.back()->ungetch(); } + bool peekPasting() { return !inputStack.empty() && inputStack.back()->peekPasting(); } + bool peekContinuedPasting(int a) + { + return !inputStack.empty() && inputStack.back()->peekContinuedPasting(a); + } + bool endOfReplacementList() { return inputStack.empty() || inputStack.back()->endOfReplacementList(); } + bool isMacroInput() { return inputStack.size() > 0 && inputStack.back()->isMacroInput(); } + + static const int maxIfNesting = 65; + + int ifdepth; // current #if-#else-#endif nesting in the cpp.c file (pre-processor) + bool elseSeen[maxIfNesting]; // Keep a track of whether an else has been seen at a particular depth + int elsetracker; // #if-#else and #endif constructs...Counter. + + class tMacroInput : public tInput { + public: + tMacroInput(TPpContext* pp) : tInput(pp), prepaste(false), postpaste(false) { } + virtual ~tMacroInput() + { + for (size_t i = 0; i < args.size(); ++i) + delete args[i]; + for (size_t i = 0; i < expandedArgs.size(); ++i) + delete expandedArgs[i]; + } + + virtual int scan(TPpToken*) override; + virtual int getch() override { assert(0); return EndOfInput; } + virtual void ungetch() override { assert(0); } + bool peekPasting() override { return prepaste; } + bool peekContinuedPasting(int a) override { return mac->body.peekContinuedPasting(a); } + bool endOfReplacementList() override { return mac->body.atEnd(); } + bool isMacroInput() override { return true; } + + MacroSymbol *mac; + TVector args; + TVector expandedArgs; + + protected: + bool prepaste; // true if we are just before ## + bool postpaste; // true if we are right after ## + }; + + class tMarkerInput : public tInput { + public: + tMarkerInput(TPpContext* pp) : tInput(pp) { } + virtual int scan(TPpToken*) override + { + if (done) + return EndOfInput; + done = true; + + return marker; + } + virtual int getch() override { assert(0); return EndOfInput; } + virtual void ungetch() override { assert(0); } + static const int marker = -3; + }; + + class tStringifyLevelInput : public tInput { + int what; + tStringifyLevelInput(TPpContext* pp) : tInput(pp) { } + public: + static tStringifyLevelInput popMarker(TPpContext* pp) + { + tStringifyLevelInput sl(pp); + sl.what = POP; + return sl; + } + + static tStringifyLevelInput pushMarker(TPpContext* pp) + { + tStringifyLevelInput sl(pp); + sl.what = PUSH; + return sl; + } + + int scan(TPpToken*) override + { + if (done) + return EndOfInput; + done = true; + + return what; + } + virtual int getch() override { assert(0); return EndOfInput; } + virtual void ungetch() override { assert(0); } + static const int PUSH = -4; + static const int POP = -5; + }; + + class tZeroInput : public tInput { + public: + tZeroInput(TPpContext* pp) : tInput(pp) { } + virtual int scan(TPpToken*) override; + virtual int getch() override { assert(0); return EndOfInput; } + virtual void ungetch() override { assert(0); } + }; + + std::vector inputStack; + bool errorOnVersion; + bool versionSeen; + + // + // from Pp.cpp + // + + // Used to obtain #include content. + TShader::Includer& includer; + + int CPPdefine(TPpToken * ppToken); + int CPPundef(TPpToken * ppToken); + int CPPelse(int matchelse, TPpToken * ppToken); + int extraTokenCheck(int atom, TPpToken* ppToken, int token); + int eval(int token, int precedence, bool shortCircuit, int& res, bool& err, TPpToken * ppToken); + int evalToToken(int token, bool shortCircuit, int& res, bool& err, TPpToken * ppToken); + int CPPif (TPpToken * ppToken); + int CPPifdef(int defined, TPpToken * ppToken); + int CPPinclude(TPpToken * ppToken); + int CPPline(TPpToken * ppToken); + int CPPerror(TPpToken * ppToken); + int CPPpragma(TPpToken * ppToken); + int CPPversion(TPpToken * ppToken); + int CPPextension(TPpToken * ppToken); + int readCPPline(TPpToken * ppToken); + int scanHeaderName(TPpToken* ppToken, char delimit); + TokenStream* PrescanMacroArg(TokenStream&, TPpToken*, bool newLineOkay); + MacroExpandResult MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOkay); + + // + // From PpTokens.cpp + // + void pushTokenStreamInput(TokenStream&, bool pasting = false, bool expanded = false); + void UngetToken(int token, TPpToken*); + + class tTokenInput : public tInput { + public: + tTokenInput(TPpContext* pp, TokenStream* t, bool prepasting, bool expanded) : + tInput(pp), + tokens(t), + lastTokenPastes(prepasting), + preExpanded(expanded) { } + virtual int scan(TPpToken *ppToken) override { + int token = tokens->getToken(pp->parseContext, ppToken); + ppToken->fullyExpanded = preExpanded; + if (tokens->atEnd() && token == PpAtomIdentifier) { + int macroAtom = pp->atomStrings.getAtom(ppToken->name); + MacroSymbol* macro = macroAtom == 0 ? nullptr : pp->lookupMacroDef(macroAtom); + if (macro && macro->functionLike) + ppToken->fullyExpanded = false; + } + return token; + } + virtual int getch() override { assert(0); return EndOfInput; } + virtual void ungetch() override { assert(0); } + virtual bool peekPasting() override { return tokens->peekTokenizedPasting(lastTokenPastes); } + bool peekContinuedPasting(int a) override { return tokens->peekContinuedPasting(a); } + protected: + TokenStream* tokens; + bool lastTokenPastes; // true if the last token in the input is to be pasted, rather than consumed as a token + bool preExpanded; + }; + + class tUngotTokenInput : public tInput { + public: + tUngotTokenInput(TPpContext* pp, int t, TPpToken* p) : tInput(pp), token(t), lval(*p) { } + virtual int scan(TPpToken *) override; + virtual int getch() override { assert(0); return EndOfInput; } + virtual void ungetch() override { assert(0); } + protected: + int token; + TPpToken lval; + }; + + // + // From PpScanner.cpp + // + class tStringInput : public tInput { + public: + tStringInput(TPpContext* pp, TInputScanner& i) : tInput(pp), input(&i) { } + virtual int scan(TPpToken*) override; + bool isStringInput() override { return true; } + // Scanner used to get source stream characters. + // - Escaped newlines are handled here, invisibly to the caller. + // - All forms of newline are handled, and turned into just a '\n'. + int getch() override + { + int ch = input->get(); + + if (ch == '\\') { + // Move past escaped newlines, as many as sequentially exist + do { + if (input->peek() == '\r' || input->peek() == '\n') { + bool allowed = pp->parseContext.lineContinuationCheck(input->getSourceLoc(), pp->inComment); + if (! allowed && pp->inComment) + return '\\'; + + // escape one newline now + ch = input->get(); + int nextch = input->get(); + if (ch == '\r' && nextch == '\n') + ch = input->get(); + else + ch = nextch; + } else + return '\\'; + } while (ch == '\\'); + } + + // handle any non-escaped newline + if (ch == '\r' || ch == '\n') { + if (ch == '\r' && input->peek() == '\n') + input->get(); + return '\n'; + } + + return ch; + } + + // Scanner used to backup the source stream characters. Newlines are + // handled here, invisibly to the caller, meaning have to undo exactly + // what getch() above does (e.g., don't leave things in the middle of a + // sequence of escaped newlines). + void ungetch() override + { + input->unget(); + + do { + int ch = input->peek(); + if (ch == '\r' || ch == '\n') { + if (ch == '\n') { + // correct for two-character newline + input->unget(); + if (input->peek() != '\r') + input->get(); + } + // now in front of a complete newline, move past an escape character + input->unget(); + if (input->peek() == '\\') + input->unget(); + else { + input->get(); + break; + } + } else + break; + } while (true); + } + + protected: + TInputScanner* input; + }; + + // Holds a reference to included file data, as well as a + // prologue and an epilogue string. This can be scanned using the tInput + // interface and acts as a single source string. + class TokenizableIncludeFile : public tInput { + public: + // Copies prologue and epilogue. The includedFile must remain valid + // until this TokenizableIncludeFile is no longer used. + TokenizableIncludeFile(const TSourceLoc& startLoc, + const std::string& prologue, + TShader::Includer::IncludeResult* includedFile, + const std::string& epilogue, + TPpContext* pp) + : tInput(pp), + prologue_(prologue), + epilogue_(epilogue), + includedFile_(includedFile), + scanner(3, strings, lengths, nullptr, 0, 0, true), + prevScanner(nullptr), + stringInput(pp, scanner) + { + strings[0] = prologue_.data(); + strings[1] = includedFile_->headerData; + strings[2] = epilogue_.data(); + + lengths[0] = prologue_.size(); + lengths[1] = includedFile_->headerLength; + lengths[2] = epilogue_.size(); + + scanner.setLine(startLoc.line); + scanner.setString(startLoc.string); + + scanner.setFile(startLoc.getFilenameStr(), 0); + scanner.setFile(startLoc.getFilenameStr(), 1); + scanner.setFile(startLoc.getFilenameStr(), 2); + } + + // tInput methods: + int scan(TPpToken* t) override { return stringInput.scan(t); } + int getch() override { return stringInput.getch(); } + void ungetch() override { stringInput.ungetch(); } + + void notifyActivated() override + { + prevScanner = pp->parseContext.getScanner(); + pp->parseContext.setScanner(&scanner); + pp->push_include(includedFile_); + } + + void notifyDeleted() override + { + pp->parseContext.setScanner(prevScanner); + pp->pop_include(); + } + + private: + TokenizableIncludeFile& operator=(const TokenizableIncludeFile&); + + // Stores the prologue for this string. + const std::string prologue_; + + // Stores the epilogue for this string. + const std::string epilogue_; + + // Points to the IncludeResult that this TokenizableIncludeFile represents. + TShader::Includer::IncludeResult* includedFile_; + + // Will point to prologue_, includedFile_->headerData and epilogue_ + // This is passed to scanner constructor. + // These do not own the storage and it must remain valid until this + // object has been destroyed. + const char* strings[3]; + // Length of str_, passed to scanner constructor. + size_t lengths[3]; + // Scans over str_. + TInputScanner scanner; + // The previous effective scanner before the scanner in this instance + // has been activated. + TInputScanner* prevScanner; + // Delegate object implementing the tInput interface. + tStringInput stringInput; + }; + + int ScanFromString(char* s); + void missingEndifCheck(); + int lFloatConst(int len, int ch, TPpToken* ppToken); + int characterLiteral(TPpToken* ppToken); + + void push_include(TShader::Includer::IncludeResult* result) + { + currentSourceFile = result->headerName; + includeStack.push(result); + } + + void pop_include() + { + TShader::Includer::IncludeResult* include = includeStack.top(); + includeStack.pop(); + includer.releaseInclude(include); + if (includeStack.empty()) { + currentSourceFile = rootFileName; + } else { + currentSourceFile = includeStack.top()->headerName; + } + } + + bool inComment; + std::string rootFileName; + std::stack includeStack; + std::string currentSourceFile; + + std::istringstream strtodStream; + bool disableEscapeSequences; + // True if we're skipping a section enclosed by #if/#ifdef/#elif/#else which was evaluated to + // be inactive, e.g. #if 0 + bool inElseSkip; +}; + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // PPCONTEXT_H diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp new file mode 100755 index 0000000000..bc860d63c9 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp @@ -0,0 +1,1443 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. +// Copyright (C) 2015-2018 Google, Inc. +// Copyright (c) 2023, Mobica Limited +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +/****************************************************************************\ +Copyright (c) 2002, NVIDIA Corporation. + +NVIDIA Corporation("NVIDIA") supplies this software to you in +consideration of your agreement to the following terms, and your use, +installation, modification or redistribution of this NVIDIA software +constitutes acceptance of these terms. If you do not agree with these +terms, please do not use, install, modify or redistribute this NVIDIA +software. + +In consideration of your agreement to abide by the following terms, and +subject to these terms, NVIDIA grants you a personal, non-exclusive +license, under NVIDIA's copyrights in this original NVIDIA software (the +"NVIDIA Software"), to use, reproduce, modify and redistribute the +NVIDIA Software, with or without modifications, in source and/or binary +forms; provided that if you redistribute the NVIDIA Software, you must +retain the copyright notice of NVIDIA, this notice and the following +text and disclaimers in all such redistributions of the NVIDIA Software. +Neither the name, trademarks, service marks nor logos of NVIDIA +Corporation may be used to endorse or promote products derived from the +NVIDIA Software without specific prior written permission from NVIDIA. +Except as expressly stated in this notice, no other rights or licenses +express or implied, are granted by NVIDIA herein, including but not +limited to any patent rights that may be infringed by your derivative +works or by other works in which the NVIDIA Software may be +incorporated. No hardware is licensed hereunder. + +THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, +INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER +PRODUCTS. + +IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, +INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY +OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE +NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, +TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF +NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\****************************************************************************/ + +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS +#endif + +#include +#include + +#include "PpContext.h" +#include "PpTokens.h" +#include "../Scan.h" + +namespace QtShaderTools { +namespace glslang { + +/////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////// Floating point constants: ///////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////// + +// Scan a single- or double-precision floating point constant. +// Assumes that the scanner has seen at least one digit, +// followed by either a decimal '.' or the letter 'e', or a +// precision ending (e.g., F or LF). +// +// This is technically not correct, as the preprocessor should just +// accept the numeric literal along with whatever suffix it has, but +// currently, it stops on seeing a bad suffix, treating that as the +// next token. This effects things like token pasting, where it is +// relevant how many tokens something was broken into. +// +// See peekContinuedPasting(). +int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken) +{ + const auto saveName = [&](int ch) { + if (len <= MaxTokenLength) + ppToken->name[len++] = static_cast(ch); + }; + + // find the range of non-zero digits before the decimal point + int startNonZero = 0; + while (startNonZero < len && ppToken->name[startNonZero] == '0') + ++startNonZero; + int endNonZero = len; + while (endNonZero > startNonZero && ppToken->name[endNonZero-1] == '0') + --endNonZero; + int numWholeNumberDigits = endNonZero - startNonZero; + + // accumulate the range's value + bool fastPath = numWholeNumberDigits <= 15; // when the number gets too complex, set to false + unsigned long long wholeNumber = 0; + if (fastPath) { + for (int i = startNonZero; i < endNonZero; ++i) + wholeNumber = wholeNumber * 10 + (ppToken->name[i] - '0'); + } + int decimalShift = len - endNonZero; + + // Decimal point: + bool hasDecimalOrExponent = false; + if (ch == '.') { + hasDecimalOrExponent = true; + saveName(ch); + ch = getChar(); + int firstDecimal = len; + +#ifdef ENABLE_HLSL + // 1.#INF or -1.#INF + if (ch == '#' && (ifdepth > 0 || parseContext.intermediate.getSource() == EShSourceHlsl)) { + if ((len < 2) || + (len == 2 && ppToken->name[0] != '1') || + (len == 3 && ppToken->name[1] != '1' && !(ppToken->name[0] == '-' || ppToken->name[0] == '+')) || + (len > 3)) + parseContext.ppError(ppToken->loc, "unexpected use of", "#", ""); + else { + // we have 1.# or -1.# or +1.#, check for 'INF' + if ((ch = getChar()) != 'I' || + (ch = getChar()) != 'N' || + (ch = getChar()) != 'F') + parseContext.ppError(ppToken->loc, "expected 'INF'", "#", ""); + else { + // we have [+-].#INF, and we are targeting IEEE 754, so wrap it up: + saveName('I'); + saveName('N'); + saveName('F'); + ppToken->name[len] = '\0'; + if (ppToken->name[0] == '-') + ppToken->i64val = 0xfff0000000000000; // -Infinity + else + ppToken->i64val = 0x7ff0000000000000; // +Infinity + return PpAtomConstFloat; + } + } + } +#endif + + // Consume leading-zero digits after the decimal point + while (ch == '0') { + saveName(ch); + ch = getChar(); + } + int startNonZeroDecimal = len; + int endNonZeroDecimal = len; + + // Consume remaining digits, up to the exponent + while (ch >= '0' && ch <= '9') { + saveName(ch); + if (ch != '0') + endNonZeroDecimal = len; + ch = getChar(); + } + + // Compute accumulation up to the last non-zero digit + if (endNonZeroDecimal > startNonZeroDecimal) { + numWholeNumberDigits += endNonZeroDecimal - endNonZero - 1; // don't include the "." + if (numWholeNumberDigits > 15) + fastPath = false; + if (fastPath) { + for (int i = endNonZero; i < endNonZeroDecimal; ++i) { + if (ppToken->name[i] != '.') + wholeNumber = wholeNumber * 10 + (ppToken->name[i] - '0'); + } + } + decimalShift = firstDecimal - endNonZeroDecimal; + } + } + + // Exponent: + bool negativeExponent = false; + double exponentValue = 0.0; + int exponent = 0; + { + if (ch == 'e' || ch == 'E') { + hasDecimalOrExponent = true; + saveName(ch); + ch = getChar(); + if (ch == '+' || ch == '-') { + negativeExponent = ch == '-'; + saveName(ch); + ch = getChar(); + } + if (ch >= '0' && ch <= '9') { + while (ch >= '0' && ch <= '9') { + if (exponent < 500) { + exponent = exponent * 10 + (ch - '0'); + } + saveName(ch); + ch = getChar(); + } + } else { + parseContext.ppError(ppToken->loc, "bad character in float exponent", "", ""); + } + } + + // Compensate for location of decimal + if (negativeExponent) + exponent -= decimalShift; + else { + exponent += decimalShift; + if (exponent < 0) { + negativeExponent = true; + exponent = -exponent; + } + } + if (exponent > 22) + fastPath = false; + + if (fastPath) { + // Compute the floating-point value of the exponent + exponentValue = 1.0; + if (exponent > 0) { + double expFactor = 10; + while (exponent > 0) { + if (exponent & 0x1) + exponentValue *= expFactor; + expFactor *= expFactor; + exponent >>= 1; + } + } + } + } + + // Suffix: + bool isDouble = false; + bool isFloat16 = false; + if (ch == 'l' || ch == 'L') { + if (ifdepth == 0 && parseContext.intermediate.getSource() == EShSourceGlsl) + parseContext.doubleCheck(ppToken->loc, "double floating-point suffix"); + if (ifdepth == 0 && !hasDecimalOrExponent) + parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", ""); + if (parseContext.intermediate.getSource() == EShSourceGlsl) { + int ch2 = getChar(); + if (ch2 != 'f' && ch2 != 'F') { + ungetChar(); + ungetChar(); + } else { + saveName(ch); + saveName(ch2); + isDouble = true; + } + } else if (parseContext.intermediate.getSource() == EShSourceHlsl) { + saveName(ch); + isDouble = true; + } + } else if (ch == 'h' || ch == 'H') { + if (ifdepth == 0 && parseContext.intermediate.getSource() == EShSourceGlsl) + parseContext.float16Check(ppToken->loc, "half floating-point suffix"); + if (ifdepth == 0 && !hasDecimalOrExponent) + parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", ""); + if (parseContext.intermediate.getSource() == EShSourceGlsl) { + int ch2 = getChar(); + if (ch2 != 'f' && ch2 != 'F') { + ungetChar(); + ungetChar(); + } else { + saveName(ch); + saveName(ch2); + isFloat16 = true; + } + } else if (parseContext.intermediate.getSource() == EShSourceHlsl) { + saveName(ch); + isFloat16 = true; + } + } else + if (ch == 'f' || ch == 'F') { + if (ifdepth == 0) + parseContext.profileRequires(ppToken->loc, EEsProfile, 300, nullptr, "floating-point suffix"); + if (ifdepth == 0 && !parseContext.relaxedErrors()) + parseContext.profileRequires(ppToken->loc, ~EEsProfile, 120, nullptr, "floating-point suffix"); + if (ifdepth == 0 && !hasDecimalOrExponent) + parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", ""); + saveName(ch); + } else + ungetChar(); + + // Patch up the name and length for overflow + + if (len > MaxTokenLength) { + len = MaxTokenLength; + parseContext.ppError(ppToken->loc, "float literal too long", "", ""); + } + ppToken->name[len] = '\0'; + + // Compute the numerical value + if (fastPath) { + // compute the floating-point value of the exponent + if (exponentValue == 0.0) + ppToken->dval = (double)wholeNumber; + else if (negativeExponent) + ppToken->dval = (double)wholeNumber / exponentValue; + else + ppToken->dval = (double)wholeNumber * exponentValue; + } else { + // slow path + ppToken->dval = 0.0; + + // remove suffix + TString numstr(ppToken->name); + if (numstr.back() == 'f' || numstr.back() == 'F') + numstr.pop_back(); + if (numstr.back() == 'h' || numstr.back() == 'H') + numstr.pop_back(); + if (numstr.back() == 'l' || numstr.back() == 'L') + numstr.pop_back(); + + // use platform library + strtodStream.clear(); + strtodStream.str(numstr.c_str()); + strtodStream >> ppToken->dval; + if (strtodStream.fail()) { + // Assume failure combined with a large exponent was overflow, in + // an attempt to set INF. + if (!negativeExponent && exponent + numWholeNumberDigits > 300) + ppToken->i64val = 0x7ff0000000000000; // +Infinity + // Assume failure combined with a small exponent was overflow. + if (negativeExponent && exponent + numWholeNumberDigits > 300) + ppToken->dval = 0.0; + // Unknown reason for failure. Theory is that either + // - the 0.0 is still there, or + // - something reasonable was written that is better than 0.0 + } + } + + // Return the right token type + if (isDouble) + return PpAtomConstDouble; + else if (isFloat16) + return PpAtomConstFloat16; + else + return PpAtomConstFloat; +} + +// Recognize a character literal. +// +// The first ' has already been accepted, read the rest, through the closing '. +// +// Always returns PpAtomConstInt. +// +int TPpContext::characterLiteral(TPpToken* ppToken) +{ + ppToken->name[0] = 0; + ppToken->ival = 0; + + if (parseContext.intermediate.getSource() != EShSourceHlsl) { + // illegal, except in macro definition, for which case we report the character + return '\''; + } + + int ch = getChar(); + switch (ch) { + case '\'': + // As empty sequence: '' + parseContext.ppError(ppToken->loc, "unexpected", "\'", ""); + return PpAtomConstInt; + case '\\': + // As escape sequence: '\XXX' + switch (ch = getChar()) { + case 'a': + ppToken->ival = 7; + break; + case 'b': + ppToken->ival = 8; + break; + case 't': + ppToken->ival = 9; + break; + case 'n': + ppToken->ival = 10; + break; + case 'v': + ppToken->ival = 11; + break; + case 'f': + ppToken->ival = 12; + break; + case 'r': + ppToken->ival = 13; + break; + case 'x': + case '0': + parseContext.ppError(ppToken->loc, "octal and hex sequences not supported", "\\", ""); + break; + default: + // This catches '\'', '\"', '\?', etc. + // Also, things like '\C' mean the same thing as 'C' + // (after the above cases are filtered out). + ppToken->ival = ch; + break; + } + break; + default: + ppToken->ival = ch; + break; + } + ppToken->name[0] = (char)ppToken->ival; + ppToken->name[1] = '\0'; + ch = getChar(); + if (ch != '\'') { + parseContext.ppError(ppToken->loc, "expected", "\'", ""); + // Look ahead for a closing ' + do { + ch = getChar(); + } while (ch != '\'' && ch != EndOfInput && ch != '\n'); + } + + return PpAtomConstInt; +} + +// +// Scanner used to tokenize source stream. +// +// N.B. Invalid numeric suffixes are not consumed.// +// This is technically not correct, as the preprocessor should just +// accept the numeric literal along with whatever suffix it has, but +// currently, it stops on seeing a bad suffix, treating that as the +// next token. This effects things like token pasting, where it is +// relevant how many tokens something was broken into. +// See peekContinuedPasting(). +// +int TPpContext::tStringInput::scan(TPpToken* ppToken) +{ + int AlreadyComplained = 0; + int len = 0; + int ch = 0; + int ii = 0; + unsigned long long ival = 0; + const auto floatingPointChar = [&](int ch) { return ch == '.' || ch == 'e' || ch == 'E' || + ch == 'f' || ch == 'F' || + ch == 'h' || ch == 'H'; }; + + static const char* const Int64_Extensions[] = { + E_GL_ARB_gpu_shader_int64, + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_NV_gpu_shader5, + E_GL_EXT_shader_explicit_arithmetic_types_int64 }; + static const int Num_Int64_Extensions = sizeof(Int64_Extensions) / sizeof(Int64_Extensions[0]); + + static const char* const Int16_Extensions[] = { + E_GL_AMD_gpu_shader_int16, + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_int16 }; + static const int Num_Int16_Extensions = sizeof(Int16_Extensions) / sizeof(Int16_Extensions[0]); + + ppToken->clear(); + ch = getch(); + for (;;) { + while (ch == ' ' || ch == '\t') { + ppToken->space = true; + ch = getch(); + } + + ppToken->loc = pp->parseContext.getCurrentLoc(); + len = 0; + switch (ch) { + default: + // Single character token, including EndOfInput, '#' and '\' (escaped newlines are handled at a lower level, so this is just a '\' token) + if (ch > PpAtomMaxSingle) + ch = PpAtomBadToken; + return ch; + + case 'A': case 'B': case 'C': case 'D': case 'E': + case 'F': case 'G': case 'H': case 'I': case 'J': + case 'K': case 'L': case 'M': case 'N': case 'O': + case 'P': case 'Q': case 'R': case 'S': case 'T': + case 'U': case 'V': case 'W': case 'X': case 'Y': + case 'Z': case '_': + case 'a': case 'b': case 'c': case 'd': case 'e': + case 'f': case 'g': case 'h': case 'i': case 'j': + case 'k': case 'l': case 'm': case 'n': case 'o': + case 'p': case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'y': + case 'z': + do { + if (len < MaxTokenLength) { + ppToken->name[len++] = (char)ch; + ch = getch(); + } else { + if (! AlreadyComplained) { + pp->parseContext.ppError(ppToken->loc, "name too long", "", ""); + AlreadyComplained = 1; + } + ch = getch(); + } + } while ((ch >= 'a' && ch <= 'z') || + (ch >= 'A' && ch <= 'Z') || + (ch >= '0' && ch <= '9') || + ch == '_'); + + // line continuation with no token before or after makes len == 0, and need to start over skipping white space, etc. + if (len == 0) + continue; + + ppToken->name[len] = '\0'; + ungetch(); + return PpAtomIdentifier; + case '0': + ppToken->name[len++] = (char)ch; + ch = getch(); + if (ch == 'x' || ch == 'X') { + // must be hexadecimal + + bool isUnsigned = false; + bool isInt64 = false; + bool isInt16 = false; + ppToken->name[len++] = (char)ch; + ch = getch(); + if ((ch >= '0' && ch <= '9') || + (ch >= 'A' && ch <= 'F') || + (ch >= 'a' && ch <= 'f')) { + + ival = 0; + do { + if (len < MaxTokenLength && ival <= 0x7fffffffffffffffull) { + ppToken->name[len++] = (char)ch; + if (ch >= '0' && ch <= '9') { + ii = ch - '0'; + } else if (ch >= 'A' && ch <= 'F') { + ii = ch - 'A' + 10; + } else if (ch >= 'a' && ch <= 'f') { + ii = ch - 'a' + 10; + } else + pp->parseContext.ppError(ppToken->loc, "bad digit in hexadecimal literal", "", ""); + ival = (ival << 4) | ii; + } else { + if (! AlreadyComplained) { + if(len < MaxTokenLength) + pp->parseContext.ppError(ppToken->loc, "hexadecimal literal too big", "", ""); + else + pp->parseContext.ppError(ppToken->loc, "hexadecimal literal too long", "", ""); + AlreadyComplained = 1; + } + ival = 0xffffffffffffffffull; + } + ch = getch(); + } while ((ch >= '0' && ch <= '9') || + (ch >= 'A' && ch <= 'F') || + (ch >= 'a' && ch <= 'f')); + } else { + pp->parseContext.ppError(ppToken->loc, "bad digit in hexadecimal literal", "", ""); + } + if (ch == 'u' || ch == 'U') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + isUnsigned = true; + + int nextCh = getch(); + if (nextCh == 'l' || nextCh == 'L') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt64 = true; + } else + ungetch(); + + nextCh = getch(); + if ((nextCh == 's' || nextCh == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt16 = true; + } else + ungetch(); + } else if (ch == 'l' || ch == 'L') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + isInt64 = true; + } else if ((ch == 's' || ch == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + isInt16 = true; + } else + ungetch(); + ppToken->name[len] = '\0'; + + if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (pp->ifdepth == 0) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "64-bit hexadecimal literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int64_Extensions, Int64_Extensions, "64-bit hexadecimal literal"); + } + ppToken->i64val = ival; + return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; + } else if (isInt16) { + if (pp->ifdepth == 0) { + if (pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "16-bit hexadecimal literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int16_Extensions, Int16_Extensions, "16-bit hexadecimal literal"); + } + } + ppToken->ival = (int)ival; + return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16; + } else { + if (ival > 0xffffffffu && !AlreadyComplained) + pp->parseContext.ppError(ppToken->loc, "hexadecimal literal too big", "", ""); + ppToken->ival = (int)ival; + return isUnsigned ? PpAtomConstUint : PpAtomConstInt; + } + } else if ((ch == 'b' || ch == 'B') && pp->parseContext.intermediate.getSource() == EShSourceHlsl) { + // must be binary + bool isUnsigned = false; + bool isInt64 = false; + bool isInt16 = false; + ppToken->name[len++] = (char)ch; + ch = getch(); + + // Check value + if ((ch == '0' || ch == '1')) + { + ival = 0; + do { + if (len < MaxTokenLength && ival <= 0x7fffffffffffffffull) { + ppToken->name[len++] = (char)ch; + if (ch == '0' || ch == '1') { + ii = ch - '0'; + } else { + pp->parseContext.ppError(ppToken->loc, "bad digit in binary literal", "", ""); + } + ival = (ival << 1) | ii; + } + else + { + if (! AlreadyComplained) { + if(len < MaxTokenLength) + pp->parseContext.ppError(ppToken->loc, "binary literal too big", "", ""); + else + pp->parseContext.ppError(ppToken->loc, "binary literal too long", "", ""); + AlreadyComplained = 1; + } + ival = 0xffffffffffffffffull; + } + ch = getch(); + } while (ch == '0' || ch == '1'); + } + else + { + pp->parseContext.ppError(ppToken->loc, "bad digit in binary literal", "", ""); + } + + // check type + if (ch == 'u' || ch == 'U') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + isUnsigned = true; + + int nextCh = getch(); + if (nextCh == 'l' || nextCh == 'L') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt64 = true; + } else + ungetch(); + + nextCh = getch(); + if ((nextCh == 's' || nextCh == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt16 = true; + } else + ungetch(); + } else if (ch == 'l' || ch == 'L') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + isInt64 = true; + } else if ((ch == 's' || ch == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + isInt16 = true; + } else { + ungetch(); + } + ppToken->name[len] = '\0'; + + // Assign value + if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (pp->ifdepth == 0) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "64-bit binary literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int64_Extensions, Int64_Extensions, "64-bit binary literal"); + } + ppToken->i64val = ival; + return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; + } else if (isInt16) { + if (pp->ifdepth == 0) { + if (pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "16-bit binary literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int16_Extensions, Int16_Extensions, "16-bit binary literal"); + } + } + ppToken->ival = (int)ival; + return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16; + } else { + ppToken->ival = (int)ival; + return isUnsigned ? PpAtomConstUint : PpAtomConstInt; + } + } else { + // could be octal integer or floating point, speculative pursue octal until it must be floating point + + bool isUnsigned = false; + bool isInt64 = false; + bool isInt16 = false; + bool octalOverflow = false; + bool nonOctal = false; + ival = 0; + + // see how much octal-like stuff we can read + while (ch >= '0' && ch <= '7') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + else if (! AlreadyComplained) { + pp->parseContext.ppError(ppToken->loc, "numeric literal too long", "", ""); + AlreadyComplained = 1; + } + if (ival <= 0x1fffffffffffffffull) { + ii = ch - '0'; + ival = (ival << 3) | ii; + } else + octalOverflow = true; + ch = getch(); + } + + // could be part of a float... + if (ch == '8' || ch == '9') { + nonOctal = true; + do { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + else if (! AlreadyComplained) { + pp->parseContext.ppError(ppToken->loc, "numeric literal too long", "", ""); + AlreadyComplained = 1; + } + ch = getch(); + } while (ch >= '0' && ch <= '9'); + } + if (floatingPointChar(ch)) + return pp->lFloatConst(len, ch, ppToken); + + // wasn't a float, so must be octal... + if (nonOctal) + pp->parseContext.ppError(ppToken->loc, "octal literal digit too large", "", ""); + + if (ch == 'u' || ch == 'U') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + isUnsigned = true; + + int nextCh = getch(); + if (nextCh == 'l' || nextCh == 'L') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt64 = true; + } else + ungetch(); + + nextCh = getch(); + if ((nextCh == 's' || nextCh == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt16 = true; + } else + ungetch(); + } else if (ch == 'l' || ch == 'L') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + isInt64 = true; + } else if ((ch == 's' || ch == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + isInt16 = true; + } else + ungetch(); + ppToken->name[len] = '\0'; + + if (!isInt64 && ival > 0xffffffffu) + octalOverflow = true; + + if (octalOverflow) + pp->parseContext.ppError(ppToken->loc, "octal literal too big", "", ""); + + if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (pp->ifdepth == 0) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "64-bit octal literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int64_Extensions, Int64_Extensions, "64-bit octal literal"); + } + ppToken->i64val = ival; + return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; + } else if (isInt16) { + if (pp->ifdepth == 0) { + if (pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "16-bit octal literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int16_Extensions, Int16_Extensions, "16-bit octal literal"); + } + } + ppToken->ival = (int)ival; + return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16; + } else { + ppToken->ival = (int)ival; + return isUnsigned ? PpAtomConstUint : PpAtomConstInt; + } + } + break; + case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + // can't be hexadecimal or octal, is either decimal or floating point + + do { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + else if (! AlreadyComplained) { + pp->parseContext.ppError(ppToken->loc, "numeric literal too long", "", ""); + AlreadyComplained = 1; + } + ch = getch(); + } while (ch >= '0' && ch <= '9'); + if (floatingPointChar(ch)) + return pp->lFloatConst(len, ch, ppToken); + else { + // Finish handling signed and unsigned integers + int numericLen = len; + bool isUnsigned = false; + bool isInt64 = false; + bool isInt16 = false; + if (ch == 'u' || ch == 'U') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + isUnsigned = true; + + int nextCh = getch(); + if (nextCh == 'l' || nextCh == 'L') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt64 = true; + } else + ungetch(); + + nextCh = getch(); + if ((nextCh == 's' || nextCh == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt16 = true; + } else + ungetch(); + } else if (ch == 'l' || ch == 'L') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + isInt64 = true; + } else if ((ch == 's' || ch == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + isInt16 = true; + } else + ungetch(); + + ppToken->name[len] = '\0'; + ival = 0; + const unsigned oneTenthMaxInt = 0xFFFFFFFFu / 10; + const unsigned remainderMaxInt = 0xFFFFFFFFu - 10 * oneTenthMaxInt; + const unsigned long long oneTenthMaxInt64 = 0xFFFFFFFFFFFFFFFFull / 10; + const unsigned long long remainderMaxInt64 = 0xFFFFFFFFFFFFFFFFull - 10 * oneTenthMaxInt64; + const unsigned short oneTenthMaxInt16 = 0xFFFFu / 10; + const unsigned short remainderMaxInt16 = 0xFFFFu - 10 * oneTenthMaxInt16; + for (int i = 0; i < numericLen; i++) { + ch = ppToken->name[i] - '0'; + bool overflow = false; + if (isInt64) + overflow = (ival > oneTenthMaxInt64 || (ival == oneTenthMaxInt64 && (unsigned long long)ch > remainderMaxInt64)); + else if (isInt16) + overflow = (ival > oneTenthMaxInt16 || (ival == oneTenthMaxInt16 && (unsigned short)ch > remainderMaxInt16)); + else + overflow = (ival > oneTenthMaxInt || (ival == oneTenthMaxInt && (unsigned)ch > remainderMaxInt)); + if (overflow) { + pp->parseContext.ppError(ppToken->loc, "numeric literal too big", "", ""); + ival = 0xFFFFFFFFFFFFFFFFull; + break; + } else + ival = ival * 10 + ch; + } + + if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (pp->ifdepth == 0) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "64-bit literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int64_Extensions, Int64_Extensions, "64-bit literal"); + } + ppToken->i64val = ival; + return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; + } else if (isInt16) { + if (pp->ifdepth == 0 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "16-bit literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int16_Extensions, Int16_Extensions, "16-bit literal"); + } + ppToken->ival = (int)ival; + return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16; + } else { + ppToken->ival = (int)ival; + return isUnsigned ? PpAtomConstUint : PpAtomConstInt; + } + } + break; + case '-': + ch = getch(); + if (ch == '-') { + return PpAtomDecrement; + } else if (ch == '=') { + return PPAtomSubAssign; + } else { + ungetch(); + return '-'; + } + case '+': + ch = getch(); + if (ch == '+') { + return PpAtomIncrement; + } else if (ch == '=') { + return PPAtomAddAssign; + } else { + ungetch(); + return '+'; + } + case '*': + ch = getch(); + if (ch == '=') { + return PPAtomMulAssign; + } else { + ungetch(); + return '*'; + } + case '%': + ch = getch(); + if (ch == '=') { + return PPAtomModAssign; + } else { + ungetch(); + return '%'; + } + case '^': + ch = getch(); + if (ch == '^') { + return PpAtomXor; + } else { + if (ch == '=') + return PpAtomXorAssign; + else{ + ungetch(); + return '^'; + } + } + + case '=': + ch = getch(); + if (ch == '=') { + return PpAtomEQ; + } else { + ungetch(); + return '='; + } + case '!': + ch = getch(); + if (ch == '=') { + return PpAtomNE; + } else { + ungetch(); + return '!'; + } + case '|': + ch = getch(); + if (ch == '|') { + return PpAtomOr; + } else if (ch == '=') { + return PpAtomOrAssign; + } else { + ungetch(); + return '|'; + } + case '&': + ch = getch(); + if (ch == '&') { + return PpAtomAnd; + } else if (ch == '=') { + return PpAtomAndAssign; + } else { + ungetch(); + return '&'; + } + case '<': + ch = getch(); + if (ch == '<') { + ch = getch(); + if (ch == '=') + return PpAtomLeftAssign; + else { + ungetch(); + return PpAtomLeft; + } + } else if (ch == '=') { + return PpAtomLE; + } else { + ungetch(); + return '<'; + } + case '>': + ch = getch(); + if (ch == '>') { + ch = getch(); + if (ch == '=') + return PpAtomRightAssign; + else { + ungetch(); + return PpAtomRight; + } + } else if (ch == '=') { + return PpAtomGE; + } else { + ungetch(); + return '>'; + } + case '.': + ch = getch(); + if (ch >= '0' && ch <= '9') { + ungetch(); + return pp->lFloatConst(0, '.', ppToken); + } else { + ungetch(); + return '.'; + } + case '/': + ch = getch(); + if (ch == '/') { + pp->inComment = true; + do { + ch = getch(); + } while (ch != '\n' && ch != EndOfInput); + ppToken->space = true; + pp->inComment = false; + + return ch; + } else if (ch == '*') { + ch = getch(); + do { + while (ch != '*') { + if (ch == EndOfInput) { + pp->parseContext.ppError(ppToken->loc, "End of input in comment", "comment", ""); + return ch; + } + ch = getch(); + } + ch = getch(); + if (ch == EndOfInput) { + pp->parseContext.ppError(ppToken->loc, "End of input in comment", "comment", ""); + return ch; + } + } while (ch != '/'); + ppToken->space = true; + // loop again to get the next token... + break; + } else if (ch == '=') { + return PPAtomDivAssign; + } else { + ungetch(); + return '/'; + } + break; + case '\'': + return pp->characterLiteral(ppToken); + case '"': + // #include uses scanHeaderName() to ignore these escape sequences. + ch = getch(); + while (ch != '"' && ch != '\n' && ch != EndOfInput) { + if (len < MaxTokenLength) { + if (ch == '\\' && !pp->disableEscapeSequences) { + int nextCh = getch(); + switch (nextCh) { + case '\'': ch = 0x27; break; + case '"': ch = 0x22; break; + case '?': ch = 0x3f; break; + case '\\': ch = 0x5c; break; + case 'a': ch = 0x07; break; + case 'b': ch = 0x08; break; + case 'f': ch = 0x0c; break; + case 'n': ch = 0x0a; break; + case 'r': ch = 0x0d; break; + case 't': ch = 0x09; break; + case 'v': ch = 0x0b; break; + case 'x': + // Hex value, arbitrary number of characters. Terminated by the first + // non-hex digit + { + int numDigits = 0; + ch = 0; + while (true) { + nextCh = getch(); + if (nextCh >= '0' && nextCh <= '9') + nextCh -= '0'; + else if (nextCh >= 'A' && nextCh <= 'F') + nextCh -= 'A' - 10; + else if (nextCh >= 'a' && nextCh <= 'f') + nextCh -= 'a' - 10; + else { + ungetch(); + break; + } + numDigits++; + ch = ch * 0x10 + nextCh; + } + if (numDigits == 0) { + pp->parseContext.ppError(ppToken->loc, "Expected hex value in escape sequence", "string", ""); + } + break; + } + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + // Octal value, up to three octal digits + { + int numDigits = 1; + ch = nextCh - '0'; + while (numDigits < 3) { + nextCh = getch(); + if (nextCh >= '0' && nextCh <= '7') + nextCh -= '0'; + else { + ungetch(); + break; + } + numDigits++; + ch = ch * 8 + nextCh; + } + break; + } + default: + pp->parseContext.ppError(ppToken->loc, "Invalid escape sequence", "string", ""); + break; + } + } + ppToken->name[len] = (char)ch; + len++; + ch = getch(); + } else + break; + }; + ppToken->name[len] = '\0'; + if (ch != '"') { + ungetch(); + pp->parseContext.ppError(ppToken->loc, "End of line in string", "string", ""); + } + return PpAtomConstString; + case ':': + ch = getch(); + if (ch == ':') + return PpAtomColonColon; + ungetch(); + return ':'; + } + + ch = getch(); + } +} + +// +// The main functional entry point into the preprocessor, which will +// scan the source strings to figure out and return the next processing token. +// +// Return the token, or EndOfInput when no more tokens. +// +int TPpContext::tokenize(TPpToken& ppToken) +{ + int stringifyDepth = 0; + TPpToken stringifiedToken; // Tokens are appended to this as they come in + for (;;) { + int token = scanToken(&ppToken); + + // Handle token-pasting logic + token = tokenPaste(token, ppToken); + + if (token == EndOfInput) { + missingEndifCheck(); + return EndOfInput; + } + if (token == '#') { + if (previous_token == '\n') { + token = readCPPline(&ppToken); + if (token == EndOfInput) { + missingEndifCheck(); + return EndOfInput; + } + continue; + } else { + parseContext.ppError(ppToken.loc, "preprocessor directive cannot be preceded by another token", "#", ""); + return EndOfInput; + } + } + previous_token = token; + + if (token == '\n') + continue; + + if (token == tStringifyLevelInput::PUSH) { + stringifyDepth++; + continue; + } + if (token == tStringifyLevelInput::POP) { + assert(stringifyDepth > 0); + stringifyDepth--; + if (stringifyDepth == 0) { + snprintf(ppToken.name, sizeof(ppToken.name), "%s", stringifiedToken.name); + return PpAtomConstString; + } + continue; + } + + // expand macros + if (token == PpAtomIdentifier) { + switch (MacroExpand(&ppToken, false, true)) { + case MacroExpandNotStarted: + break; + case MacroExpandError: + return EndOfInput; + case MacroExpandStarted: + case MacroExpandUndef: + continue; + } + } + + bool needStringSupport = ifdepth == 0 && (token == PpAtomConstString || stringifyDepth > 0); + if (needStringSupport && parseContext.intermediate.getSource() != EShSourceHlsl) { + // HLSL allows string literals. + // GLSL allows string literals with GL_EXT_debug_printf. + const char* const string_literal_EXTs[] = { E_GL_EXT_debug_printf, E_GL_EXT_spirv_intrinsics }; + parseContext.requireExtensions(ppToken.loc, 2, string_literal_EXTs, "string literal"); + if (!parseContext.extensionTurnedOn(E_GL_EXT_debug_printf) && + !parseContext.extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) { + continue; + } + } + + switch (token) { + case PpAtomConstString: + break; + case PpAtomIdentifier: + case PpAtomConstInt: + case PpAtomConstUint: + case PpAtomConstFloat: + case PpAtomConstInt64: + case PpAtomConstUint64: + case PpAtomConstInt16: + case PpAtomConstUint16: + case PpAtomConstDouble: + case PpAtomConstFloat16: + if (ppToken.name[0] == '\0') + continue; + break; + case '\'': + parseContext.ppError(ppToken.loc, "character literals not supported", "\'", ""); + continue; + default: + snprintf(ppToken.name, sizeof(ppToken.name), "%s", atomStrings.getString(token)); + break; + } + if (stringifyDepth > 0) { + size_t existingLen = strlen(stringifiedToken.name); + char* dst = stringifiedToken.name + existingLen; + // stringify_depth would determine how many layers of \\\"\\\" are needed, if we wanted to. + if (ppToken.space) { + snprintf(dst, sizeof(stringifiedToken.name) - existingLen - 1, " %s", ppToken.name); + } else { + snprintf(dst, sizeof(stringifiedToken.name) - existingLen, "%s", ppToken.name); + } + continue; + } + + return token; + } +} + +// +// Do all token-pasting related combining of two pasted tokens when getting a +// stream of tokens from a replacement list. Degenerates to no processing if a +// replacement list is not the source of the token stream. +// +int TPpContext::tokenPaste(int token, TPpToken& ppToken) +{ + // starting with ## is illegal, skip to next token + if (token == PpAtomPaste) { + parseContext.ppError(ppToken.loc, "unexpected location", "##", ""); + return scanToken(&ppToken); + } + + int resultToken = token; // "foo" pasted with "35" is an identifier, not a number + + // ## can be chained, process all in the chain at once + while (peekPasting()) { + TPpToken pastedPpToken; + + // next token has to be ## + token = scanToken(&pastedPpToken); + assert(token == PpAtomPaste); + + // This covers end of macro expansion + if (endOfReplacementList()) { + // this should be unreachable, incomplete #/## sequences are caught at macro parsing time. + parseContext.ppError(ppToken.loc, "unexpected location; end of replacement list", "##", ""); + break; + } + + // Get the token(s) after the ##. + // Because of "space" semantics, and prior tokenization, what + // appeared a single token, e.g. "3A", might have been tokenized + // into two tokens "3" and "A", but the "A" will have 'space' set to + // false. Accumulate all of these to recreate the original lexical + // appearing token. + do { + token = scanToken(&pastedPpToken); + + // This covers end of argument expansion + if (token == tMarkerInput::marker) { + parseContext.ppError(ppToken.loc, "unexpected location; end of argument", "##", ""); + return resultToken; + } + + // get the token text + switch (resultToken) { + case PpAtomIdentifier: + // already have the correct text in token.names + break; + case '=': + case '!': + case '-': + case '~': + case '+': + case '*': + case '/': + case '%': + case '<': + case '>': + case '|': + case '^': + case '&': + case PpAtomRight: + case PpAtomLeft: + case PpAtomAnd: + case PpAtomOr: + case PpAtomXor: + snprintf(ppToken.name, sizeof(ppToken.name), "%s", atomStrings.getString(resultToken)); + snprintf(pastedPpToken.name, sizeof(pastedPpToken.name), "%s", atomStrings.getString(token)); + break; + default: + parseContext.ppError(ppToken.loc, "not supported for these tokens", "##", ""); + return resultToken; + } + + // combine the tokens + if (strlen(ppToken.name) + strlen(pastedPpToken.name) > MaxTokenLength) { + parseContext.ppError(ppToken.loc, "combined tokens are too long", "##", ""); + return resultToken; + } + snprintf(&ppToken.name[0] + strlen(ppToken.name), sizeof(ppToken.name) - strlen(ppToken.name), + "%s", pastedPpToken.name); + + // correct the kind of token we are making, if needed (identifiers stay identifiers) + if (resultToken != PpAtomIdentifier) { + int newToken = atomStrings.getAtom(ppToken.name); + if (newToken > 0) + resultToken = newToken; + else + parseContext.ppError(ppToken.loc, "combined token is invalid", "##", ""); + } + } while (peekContinuedPasting(resultToken)); + } + + return resultToken; +} + +// Checks if we've seen balanced #if...#endif +void TPpContext::missingEndifCheck() +{ + if (ifdepth > 0) + parseContext.ppError(parseContext.getCurrentLoc(), "missing #endif", "", ""); +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp new file mode 100755 index 0000000000..a7cbae283f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp @@ -0,0 +1,187 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +/****************************************************************************\ +Copyright (c) 2002, NVIDIA Corporation. + +NVIDIA Corporation("NVIDIA") supplies this software to you in +consideration of your agreement to the following terms, and your use, +installation, modification or redistribution of this NVIDIA software +constitutes acceptance of these terms. If you do not agree with these +terms, please do not use, install, modify or redistribute this NVIDIA +software. + +In consideration of your agreement to abide by the following terms, and +subject to these terms, NVIDIA grants you a personal, non-exclusive +license, under NVIDIA's copyrights in this original NVIDIA software (the +"NVIDIA Software"), to use, reproduce, modify and redistribute the +NVIDIA Software, with or without modifications, in source and/or binary +forms; provided that if you redistribute the NVIDIA Software, you must +retain the copyright notice of NVIDIA, this notice and the following +text and disclaimers in all such redistributions of the NVIDIA Software. +Neither the name, trademarks, service marks nor logos of NVIDIA +Corporation may be used to endorse or promote products derived from the +NVIDIA Software without specific prior written permission from NVIDIA. +Except as expressly stated in this notice, no other rights or licenses +express or implied, are granted by NVIDIA herein, including but not +limited to any patent rights that may be infringed by your derivative +works or by other works in which the NVIDIA Software may be +incorporated. No hardware is licensed hereunder. + +THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, +INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER +PRODUCTS. + +IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, +INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY +OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE +NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, +TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF +NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\****************************************************************************/ + +// +// For recording and playing back the stream of tokens in a macro definition. +// + +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS +#endif + +#include +#include +#include +#include + +#include "PpContext.h" +#include "PpTokens.h" + +namespace QtShaderTools { +namespace glslang { + +// Add a token (including backing string) to the end of a macro +// token stream, for later playback. +void TPpContext::TokenStream::putToken(int atom, TPpToken* ppToken) +{ + TokenStream::Token streamToken(atom, *ppToken); + stream.push_back(streamToken); +} + +// Read the next token from a macro token stream. +int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken* ppToken) +{ + if (atEnd()) + return EndOfInput; + + int atom = stream[currentPos++].get(*ppToken); + ppToken->loc = parseContext.getCurrentLoc(); + + return atom; +} + +// We are pasting if +// 1. we are preceding a pasting operator within this stream +// or +// 2. the entire macro is preceding a pasting operator (lastTokenPastes) +// and we are also on the last token +bool TPpContext::TokenStream::peekTokenizedPasting(bool lastTokenPastes) +{ + // 1. preceding ##? + + size_t savePos = currentPos; + // skip white space + while (peekToken(' ')) + ++currentPos; + if (peekToken(PpAtomPaste)) { + currentPos = savePos; + return true; + } + + // 2. last token and we've been told after this there will be a ## + + if (! lastTokenPastes) { + currentPos = savePos; + return false; + } + // Getting here means the last token will be pasted, after this + + // Are we at the last non-whitespace token? + savePos = currentPos; + bool moreTokens = false; + do { + if (atEnd()) + break; + if (!peekToken(' ')) { + moreTokens = true; + break; + } + ++currentPos; + } while (true); + currentPos = savePos; + + return !moreTokens; +} + +void TPpContext::pushTokenStreamInput(TokenStream& ts, bool prepasting, bool expanded) +{ + pushInput(new tTokenInput(this, &ts, prepasting, expanded)); + ts.reset(); +} + +int TPpContext::tUngotTokenInput::scan(TPpToken* ppToken) +{ + if (done) + return EndOfInput; + + int ret = token; + *ppToken = lval; + done = true; + + return ret; +} + +void TPpContext::UngetToken(int token, TPpToken* ppToken) +{ + pushInput(new tUngotTokenInput(this, token, ppToken)); +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h new file mode 100644 index 0000000000..31bbc08736 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h @@ -0,0 +1,181 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +/****************************************************************************\ +Copyright (c) 2002, NVIDIA Corporation. + +NVIDIA Corporation("NVIDIA") supplies this software to you in +consideration of your agreement to the following terms, and your use, +installation, modification or redistribution of this NVIDIA software +constitutes acceptance of these terms. If you do not agree with these +terms, please do not use, install, modify or redistribute this NVIDIA +software. + +In consideration of your agreement to abide by the following terms, and +subject to these terms, NVIDIA grants you a personal, non-exclusive +license, under NVIDIA's copyrights in this original NVIDIA software (the +"NVIDIA Software"), to use, reproduce, modify and redistribute the +NVIDIA Software, with or without modifications, in source and/or binary +forms; provided that if you redistribute the NVIDIA Software, you must +retain the copyright notice of NVIDIA, this notice and the following +text and disclaimers in all such redistributions of the NVIDIA Software. +Neither the name, trademarks, service marks nor logos of NVIDIA +Corporation may be used to endorse or promote products derived from the +NVIDIA Software without specific prior written permission from NVIDIA. +Except as expressly stated in this notice, no other rights or licenses +express or implied, are granted by NVIDIA herein, including but not +limited to any patent rights that may be infringed by your derivative +works or by other works in which the NVIDIA Software may be +incorporated. No hardware is licensed hereunder. + +THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, +INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER +PRODUCTS. + +IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, +INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY +OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE +NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, +TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF +NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\****************************************************************************/ + +#ifndef PARSER_H +#define PARSER_H + +namespace QtShaderTools { +namespace glslang { + +// Multi-character tokens +enum EFixedAtoms { + // single character tokens get their own char value as their token; start here for multi-character tokens + PpAtomMaxSingle = 127, + + // replace bad character tokens with this, to avoid accidental aliasing with the below + PpAtomBadToken, + + // Operators + + PPAtomAddAssign, + PPAtomSubAssign, + PPAtomMulAssign, + PPAtomDivAssign, + PPAtomModAssign, + + PpAtomRight, + PpAtomLeft, + + PpAtomRightAssign, + PpAtomLeftAssign, + PpAtomAndAssign, + PpAtomOrAssign, + PpAtomXorAssign, + + PpAtomAnd, + PpAtomOr, + PpAtomXor, + + PpAtomEQ, + PpAtomNE, + PpAtomGE, + PpAtomLE, + + PpAtomDecrement, + PpAtomIncrement, + + PpAtomColonColon, + + PpAtomPaste, + + // Constants + + PpAtomConstInt, + PpAtomConstUint, + PpAtomConstInt64, + PpAtomConstUint64, + PpAtomConstInt16, + PpAtomConstUint16, + PpAtomConstFloat, + PpAtomConstDouble, + PpAtomConstFloat16, + PpAtomConstString, + + // Identifiers + PpAtomIdentifier, + + // preprocessor "keywords" + + PpAtomDefine, + PpAtomUndef, + + PpAtomIf, + PpAtomIfdef, + PpAtomIfndef, + PpAtomElse, + PpAtomElif, + PpAtomEndif, + + PpAtomLine, + PpAtomPragma, + PpAtomError, + + // #version ... + PpAtomVersion, + PpAtomCore, + PpAtomCompatibility, + PpAtomEs, + + // #extension + PpAtomExtension, + + // __LINE__, __FILE__, __VERSION__ + + PpAtomLineMacro, + PpAtomFileMacro, + PpAtomVersionMacro, + + // #include + PpAtomInclude, + + PpAtomLast, +}; + +} // end namespace glslang +} // namespace QtShaderTools + +#endif /* not PARSER_H */ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp new file mode 100644 index 0000000000..a6a551d4f0 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp @@ -0,0 +1,871 @@ +// +// Copyright (C) 2015-2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// +// Visit the nodes in the glslang intermediate tree representation to +// propagate the 'noContraction' qualifier. +// + +#include "propagateNoContraction.h" + +#include +#include +#include +#include +#include + +#include "localintermediate.h" +namespace QtShaderTools { +namespace { + +// Use a string to hold the access chain information, as in most cases the +// access chain is short and may contain only one element, which is the symbol +// ID. +// Example: struct {float a; float b;} s; +// Object s.a will be represented with: /0 +// Object s.b will be represented with: /1 +// Object s will be represented with: +// For members of vector, matrix and arrays, they will be represented with the +// same symbol ID of their container symbol objects. This is because their +// preciseness is always the same as their container symbol objects. +typedef std::string ObjectAccessChain; + +// The delimiter used in the ObjectAccessChain string to separate symbol ID and +// different level of struct indices. +const char ObjectAccesschainDelimiter = '/'; + +// Mapping from Symbol IDs of symbol nodes, to their defining operation +// nodes. +typedef std::unordered_multimap NodeMapping; +// Mapping from object nodes to their access chain info string. +typedef std::unordered_map AccessChainMapping; + +// Set of object IDs. +typedef std::unordered_set ObjectAccesschainSet; +// Set of return branch nodes. +typedef std::unordered_set ReturnBranchNodeSet; + +// A helper function to tell whether a node is 'noContraction'. Returns true if +// the node has 'noContraction' qualifier, otherwise false. +bool isPreciseObjectNode(glslang::TIntermTyped* node) +{ + return node->getType().getQualifier().isNoContraction(); +} + +// Returns true if the opcode is a dereferencing one. +bool isDereferenceOperation(glslang::TOperator op) +{ + switch (op) { + case glslang::EOpIndexDirect: + case glslang::EOpIndexDirectStruct: + case glslang::EOpIndexIndirect: + case glslang::EOpVectorSwizzle: + case glslang::EOpMatrixSwizzle: + return true; + default: + return false; + } +} + +// Returns true if the opcode leads to an assignment operation. +bool isAssignOperation(glslang::TOperator op) +{ + switch (op) { + case glslang::EOpAssign: + case glslang::EOpAddAssign: + case glslang::EOpSubAssign: + case glslang::EOpMulAssign: + case glslang::EOpVectorTimesMatrixAssign: + case glslang::EOpVectorTimesScalarAssign: + case glslang::EOpMatrixTimesScalarAssign: + case glslang::EOpMatrixTimesMatrixAssign: + case glslang::EOpDivAssign: + case glslang::EOpModAssign: + case glslang::EOpAndAssign: + case glslang::EOpLeftShiftAssign: + case glslang::EOpRightShiftAssign: + case glslang::EOpInclusiveOrAssign: + case glslang::EOpExclusiveOrAssign: + + case glslang::EOpPostIncrement: + case glslang::EOpPostDecrement: + case glslang::EOpPreIncrement: + case glslang::EOpPreDecrement: + return true; + default: + return false; + } +} + +// A helper function to get the unsigned int from a given constant union node. +// Note the node should only hold a uint scalar. +unsigned getStructIndexFromConstantUnion(glslang::TIntermTyped* node) +{ + assert(node->getAsConstantUnion() && node->getAsConstantUnion()->isScalar()); + unsigned struct_dereference_index = node->getAsConstantUnion()->getConstArray()[0].getUConst(); + return struct_dereference_index; +} + +// A helper function to generate symbol_label. +ObjectAccessChain generateSymbolLabel(glslang::TIntermSymbol* node) +{ + ObjectAccessChain symbol_id = + std::to_string(node->getId()) + "(" + node->getName().c_str() + ")"; + return symbol_id; +} + +// Returns true if the operation is an arithmetic operation and valid for +// the 'NoContraction' decoration. +bool isArithmeticOperation(glslang::TOperator op) +{ + switch (op) { + case glslang::EOpAddAssign: + case glslang::EOpSubAssign: + case glslang::EOpMulAssign: + case glslang::EOpVectorTimesMatrixAssign: + case glslang::EOpVectorTimesScalarAssign: + case glslang::EOpMatrixTimesScalarAssign: + case glslang::EOpMatrixTimesMatrixAssign: + case glslang::EOpDivAssign: + case glslang::EOpModAssign: + + case glslang::EOpNegative: + + case glslang::EOpAdd: + case glslang::EOpSub: + case glslang::EOpMul: + case glslang::EOpDiv: + case glslang::EOpMod: + + case glslang::EOpVectorTimesScalar: + case glslang::EOpVectorTimesMatrix: + case glslang::EOpMatrixTimesVector: + case glslang::EOpMatrixTimesScalar: + case glslang::EOpMatrixTimesMatrix: + + case glslang::EOpDot: + case glslang::EOpDotPackedEXT: + case glslang::EOpDotAccSatEXT: + case glslang::EOpDotPackedAccSatEXT: + + case glslang::EOpPostIncrement: + case glslang::EOpPostDecrement: + case glslang::EOpPreIncrement: + case glslang::EOpPreDecrement: + return true; + default: + return false; + } +} + +// A helper class to help manage the populating_initial_no_contraction_ flag. +template class StateSettingGuard { +public: + StateSettingGuard(T* state_ptr, T new_state_value) + : state_ptr_(state_ptr), previous_state_(*state_ptr) + { + *state_ptr = new_state_value; + } + StateSettingGuard(T* state_ptr) : state_ptr_(state_ptr), previous_state_(*state_ptr) {} + void setState(T new_state_value) { *state_ptr_ = new_state_value; } + ~StateSettingGuard() { *state_ptr_ = previous_state_; } + +private: + T* state_ptr_; + T previous_state_; +}; + +// A helper function to get the front element from a given ObjectAccessChain +ObjectAccessChain getFrontElement(const ObjectAccessChain& chain) +{ + size_t pos_delimiter = chain.find(ObjectAccesschainDelimiter); + return pos_delimiter == std::string::npos ? chain : chain.substr(0, pos_delimiter); +} + +// A helper function to get the access chain starting from the second element. +ObjectAccessChain subAccessChainFromSecondElement(const ObjectAccessChain& chain) +{ + size_t pos_delimiter = chain.find(ObjectAccesschainDelimiter); + return pos_delimiter == std::string::npos ? "" : chain.substr(pos_delimiter + 1); +} + +// A helper function to get the access chain after removing a given prefix. +ObjectAccessChain getSubAccessChainAfterPrefix(const ObjectAccessChain& chain, + const ObjectAccessChain& prefix) +{ + size_t pos = chain.find(prefix); + if (pos != 0) + return chain; + return chain.substr(prefix.length() + sizeof(ObjectAccesschainDelimiter)); +} + +// +// A traverser which traverses the whole AST and populates: +// 1) A mapping from symbol nodes' IDs to their defining operation nodes. +// 2) A set of access chains of the initial precise object nodes. +// +class TSymbolDefinitionCollectingTraverser : public glslang::TIntermTraverser { +public: + TSymbolDefinitionCollectingTraverser(NodeMapping* symbol_definition_mapping, + AccessChainMapping* accesschain_mapping, + ObjectAccesschainSet* precise_objects, + ReturnBranchNodeSet* precise_return_nodes); + + bool visitUnary(glslang::TVisit, glslang::TIntermUnary*) override; + bool visitBinary(glslang::TVisit, glslang::TIntermBinary*) override; + void visitSymbol(glslang::TIntermSymbol*) override; + bool visitAggregate(glslang::TVisit, glslang::TIntermAggregate*) override; + bool visitBranch(glslang::TVisit, glslang::TIntermBranch*) override; + +protected: + TSymbolDefinitionCollectingTraverser& operator=(const TSymbolDefinitionCollectingTraverser&); + + // The mapping from symbol node IDs to their defining nodes. This should be + // populated along traversing the AST. + NodeMapping& symbol_definition_mapping_; + // The set of symbol node IDs for precise symbol nodes, the ones marked as + // 'noContraction'. + ObjectAccesschainSet& precise_objects_; + // The set of precise return nodes. + ReturnBranchNodeSet& precise_return_nodes_; + // A temporary cache of the symbol node whose defining node is to be found + // currently along traversing the AST. + ObjectAccessChain current_object_; + // A map from object node to its access chain. This traverser stores + // the built access chains into this map for each object node it has + // visited. + AccessChainMapping& accesschain_mapping_; + // The pointer to the Function Definition node, so we can get the + // preciseness of the return expression from it when we traverse the + // return branch node. + glslang::TIntermAggregate* current_function_definition_node_; +}; + +TSymbolDefinitionCollectingTraverser::TSymbolDefinitionCollectingTraverser( + NodeMapping* symbol_definition_mapping, AccessChainMapping* accesschain_mapping, + ObjectAccesschainSet* precise_objects, + std::unordered_set* precise_return_nodes) + : TIntermTraverser(true, false, false), symbol_definition_mapping_(*symbol_definition_mapping), + precise_objects_(*precise_objects), precise_return_nodes_(*precise_return_nodes), + current_object_(), accesschain_mapping_(*accesschain_mapping), + current_function_definition_node_(nullptr) {} + +// Visits a symbol node, set the current_object_ to the +// current node symbol ID, and record a mapping from this node to the current +// current_object_, which is the just obtained symbol +// ID. +void TSymbolDefinitionCollectingTraverser::visitSymbol(glslang::TIntermSymbol* node) +{ + current_object_ = generateSymbolLabel(node); + accesschain_mapping_[node] = current_object_; +} + +// Visits an aggregate node, traverses all of its children. +bool TSymbolDefinitionCollectingTraverser::visitAggregate(glslang::TVisit, + glslang::TIntermAggregate* node) +{ + // This aggregate node might be a function definition node, in which case we need to + // cache this node, so we can get the preciseness information of the return value + // of this function later. + StateSettingGuard current_function_definition_node_setting_guard( + ¤t_function_definition_node_); + if (node->getOp() == glslang::EOpFunction) { + // This is function definition node, we need to cache this node so that we can + // get the preciseness of the return value later. + current_function_definition_node_setting_guard.setState(node); + } + // Traverse the items in the sequence. + glslang::TIntermSequence& seq = node->getSequence(); + for (int i = 0; i < (int)seq.size(); ++i) { + current_object_.clear(); + seq[i]->traverse(this); + } + return false; +} + +bool TSymbolDefinitionCollectingTraverser::visitBranch(glslang::TVisit, + glslang::TIntermBranch* node) +{ + if (node->getFlowOp() == glslang::EOpReturn && node->getExpression() && + current_function_definition_node_ && + current_function_definition_node_->getType().getQualifier().noContraction) { + // This node is a return node with an expression, and its function has a + // precise return value. We need to find the involved objects in its + // expression and add them to the set of initial precise objects. + precise_return_nodes_.insert(node); + node->getExpression()->traverse(this); + } + return false; +} + +// Visits a unary node. This might be an implicit assignment like i++, i--. etc. +bool TSymbolDefinitionCollectingTraverser::visitUnary(glslang::TVisit /* visit */, + glslang::TIntermUnary* node) +{ + current_object_.clear(); + node->getOperand()->traverse(this); + if (isAssignOperation(node->getOp())) { + // We should always be able to get an access chain of the operand node. + assert(!current_object_.empty()); + + // If the operand node object is 'precise', we collect its access chain + // for the initial set of 'precise' objects. + if (isPreciseObjectNode(node->getOperand())) { + // The operand node is an 'precise' object node, add its + // access chain to the set of 'precise' objects. This is to collect + // the initial set of 'precise' objects. + precise_objects_.insert(current_object_); + } + // Gets the symbol ID from the object's access chain. + ObjectAccessChain id_symbol = getFrontElement(current_object_); + // Add a mapping from the symbol ID to this assignment operation node. + symbol_definition_mapping_.insert(std::make_pair(id_symbol, node)); + } + // A unary node is not a dereference node, so we clear the access chain which + // is under construction. + current_object_.clear(); + return false; +} + +// Visits a binary node and updates the mapping from symbol IDs to the definition +// nodes. Also collects the access chains for the initial precise objects. +bool TSymbolDefinitionCollectingTraverser::visitBinary(glslang::TVisit /* visit */, + glslang::TIntermBinary* node) +{ + // Traverses the left node to build the access chain info for the object. + current_object_.clear(); + node->getLeft()->traverse(this); + + if (isAssignOperation(node->getOp())) { + // We should always be able to get an access chain for the left node. + assert(!current_object_.empty()); + + // If the left node object is 'precise', it is an initial precise object + // specified in the shader source. Adds it to the initial work list to + // process later. + if (isPreciseObjectNode(node->getLeft())) { + // The left node is an 'precise' object node, add its access chain to + // the set of 'precise' objects. This is to collect the initial set + // of 'precise' objects. + precise_objects_.insert(current_object_); + } + // Gets the symbol ID from the object access chain, which should be the + // first element recorded in the access chain. + ObjectAccessChain id_symbol = getFrontElement(current_object_); + // Adds a mapping from the symbol ID to this assignment operation node. + symbol_definition_mapping_.insert(std::make_pair(id_symbol, node)); + + // Traverses the right node, there may be other 'assignment' + // operations in the right. + current_object_.clear(); + node->getRight()->traverse(this); + + } else if (isDereferenceOperation(node->getOp())) { + // The left node (parent node) is a struct type object. We need to + // record the access chain information of the current node into its + // object id. + if (node->getOp() == glslang::EOpIndexDirectStruct) { + unsigned struct_dereference_index = getStructIndexFromConstantUnion(node->getRight()); + current_object_.push_back(ObjectAccesschainDelimiter); + current_object_.append(std::to_string(struct_dereference_index)); + } + accesschain_mapping_[node] = current_object_; + + // For a dereference node, there is no need to traverse the right child + // node as the right node should always be an integer type object. + + } else { + // For other binary nodes, still traverse the right node. + current_object_.clear(); + node->getRight()->traverse(this); + } + return false; +} + +// Traverses the AST and returns a tuple of four members: +// 1) a mapping from symbol IDs to the definition nodes (aka. assignment nodes) of these symbols. +// 2) a mapping from object nodes in the AST to the access chains of these objects. +// 3) a set of access chains of precise objects. +// 4) a set of return nodes with precise expressions. +std::tuple +getSymbolToDefinitionMappingAndPreciseSymbolIDs(const glslang::TIntermediate& intermediate) +{ + auto result_tuple = std::make_tuple(NodeMapping(), AccessChainMapping(), ObjectAccesschainSet(), + ReturnBranchNodeSet()); + + TIntermNode* root = intermediate.getTreeRoot(); + if (root == nullptr) + return result_tuple; + + NodeMapping& symbol_definition_mapping = std::get<0>(result_tuple); + AccessChainMapping& accesschain_mapping = std::get<1>(result_tuple); + ObjectAccesschainSet& precise_objects = std::get<2>(result_tuple); + ReturnBranchNodeSet& precise_return_nodes = std::get<3>(result_tuple); + + // Traverses the AST and populate the results. + TSymbolDefinitionCollectingTraverser collector(&symbol_definition_mapping, &accesschain_mapping, + &precise_objects, &precise_return_nodes); + root->traverse(&collector); + + return result_tuple; +} + +// +// A traverser that determine whether the left node (or operand node for unary +// node) of an assignment node is 'precise', containing 'precise' or not, +// according to the access chain a given precise object which share the same +// symbol as the left node. +// +// Post-orderly traverses the left node subtree of an binary assignment node and: +// +// 1) Propagates the 'precise' from the left object nodes to this object node. +// +// 2) Builds object access chain along the traversal, and also compares with +// the access chain of the given 'precise' object along with the traversal to +// tell if the node to be defined is 'precise' or not. +// +class TNoContractionAssigneeCheckingTraverser : public glslang::TIntermTraverser { + + enum DecisionStatus { + // The object node to be assigned to may contain 'precise' objects and also not 'precise' objects. + Mixed = 0, + // The object node to be assigned to is either a 'precise' object or a struct objects whose members are all 'precise'. + Precise = 1, + // The object node to be assigned to is not a 'precise' object. + NotPreicse = 2, + }; + +public: + TNoContractionAssigneeCheckingTraverser(const AccessChainMapping& accesschain_mapping) + : TIntermTraverser(true, false, false), accesschain_mapping_(accesschain_mapping), + precise_object_(nullptr) {} + + // Checks the preciseness of a given assignment node with a precise object + // represented as access chain. The precise object shares the same symbol + // with the assignee of the given assignment node. Return a tuple of two: + // + // 1) The preciseness of the assignee node of this assignment node. True + // if the assignee contains 'precise' objects or is 'precise', false if + // the assignee is not 'precise' according to the access chain of the given + // precise object. + // + // 2) The incremental access chain from the assignee node to its nested + // 'precise' object, according to the access chain of the given precise + // object. This incremental access chain can be empty, which means the + // assignee is 'precise'. Otherwise it shows the path to the nested + // precise object. + std::tuple + getPrecisenessAndRemainedAccessChain(glslang::TIntermOperator* node, + const ObjectAccessChain& precise_object) + { + assert(isAssignOperation(node->getOp())); + precise_object_ = &precise_object; + ObjectAccessChain assignee_object; + if (glslang::TIntermBinary* BN = node->getAsBinaryNode()) { + // This is a binary assignment node, we need to check the + // preciseness of the left node. + assert(accesschain_mapping_.count(BN->getLeft())); + // The left node (assignee node) is an object node, traverse the + // node to let the 'precise' of nesting objects being transfered to + // nested objects. + BN->getLeft()->traverse(this); + // After traversing the left node, if the left node is 'precise', + // we can conclude this assignment should propagate 'precise'. + if (isPreciseObjectNode(BN->getLeft())) { + return make_tuple(true, ObjectAccessChain()); + } + // If the preciseness of the left node (assignee node) can not + // be determined by now, we need to compare the access chain string + // of the assignee object with the given precise object. + assignee_object = accesschain_mapping_.at(BN->getLeft()); + + } else if (glslang::TIntermUnary* UN = node->getAsUnaryNode()) { + // This is a unary assignment node, we need to check the + // preciseness of the operand node. For unary assignment node, the + // operand node should always be an object node. + assert(accesschain_mapping_.count(UN->getOperand())); + // Traverse the operand node to let the 'precise' being propagated + // from lower nodes to upper nodes. + UN->getOperand()->traverse(this); + // After traversing the operand node, if the operand node is + // 'precise', this assignment should propagate 'precise'. + if (isPreciseObjectNode(UN->getOperand())) { + return make_tuple(true, ObjectAccessChain()); + } + // If the preciseness of the operand node (assignee node) can not + // be determined by now, we need to compare the access chain string + // of the assignee object with the given precise object. + assignee_object = accesschain_mapping_.at(UN->getOperand()); + } else { + // Not a binary or unary node, should not happen. + assert(false); + } + + // Compare the access chain string of the assignee node with the given + // precise object to determine if this assignment should propagate + // 'precise'. + if (assignee_object.find(precise_object) == 0) { + // The access chain string of the given precise object is a prefix + // of assignee's access chain string. The assignee should be + // 'precise'. + return make_tuple(true, ObjectAccessChain()); + } else if (precise_object.find(assignee_object) == 0) { + // The assignee's access chain string is a prefix of the given + // precise object, the assignee object contains 'precise' object, + // and we need to pass the remained access chain to the object nodes + // in the right. + return make_tuple(true, getSubAccessChainAfterPrefix(precise_object, assignee_object)); + } else { + // The access chain strings do not match, the assignee object can + // not be labeled as 'precise' according to the given precise + // object. + return make_tuple(false, ObjectAccessChain()); + } + } + +protected: + TNoContractionAssigneeCheckingTraverser& operator=(const TNoContractionAssigneeCheckingTraverser&); + + bool visitBinary(glslang::TVisit, glslang::TIntermBinary* node) override; + void visitSymbol(glslang::TIntermSymbol* node) override; + + // A map from object nodes to their access chain string (used as object ID). + const AccessChainMapping& accesschain_mapping_; + // A given precise object, represented in it access chain string. This + // precise object is used to be compared with the assignee node to tell if + // the assignee node is 'precise', contains 'precise' object or not + // 'precise'. + const ObjectAccessChain* precise_object_; +}; + +// Visits a binary node. If the node is an object node, it must be a dereference +// node. In such cases, if the left node is 'precise', this node should also be +// 'precise'. +bool TNoContractionAssigneeCheckingTraverser::visitBinary(glslang::TVisit, + glslang::TIntermBinary* node) +{ + // Traverses the left so that we transfer the 'precise' from nesting object + // to its nested object. + node->getLeft()->traverse(this); + // If this binary node is an object node, we should have it in the + // accesschain_mapping_. + if (accesschain_mapping_.count(node)) { + // A binary object node must be a dereference node. + assert(isDereferenceOperation(node->getOp())); + // If the left node is 'precise', this node should also be precise, + // otherwise, compare with the given precise_object_. If the + // access chain of this node matches with the given precise_object_, + // this node should be marked as 'precise'. + if (isPreciseObjectNode(node->getLeft())) { + node->getWritableType().getQualifier().noContraction = true; + } else if (accesschain_mapping_.at(node) == *precise_object_) { + node->getWritableType().getQualifier().noContraction = true; + } + } + return false; +} + +// Visits a symbol node, if the symbol node ID (its access chain string) matches +// with the given precise object, this node should be 'precise'. +void TNoContractionAssigneeCheckingTraverser::visitSymbol(glslang::TIntermSymbol* node) +{ + // A symbol node should always be an object node, and should have been added + // to the map from object nodes to their access chain strings. + assert(accesschain_mapping_.count(node)); + if (accesschain_mapping_.at(node) == *precise_object_) { + node->getWritableType().getQualifier().noContraction = true; + } +} + +// +// A traverser that only traverses the right side of binary assignment nodes +// and the operand node of unary assignment nodes. +// +// 1) Marks arithmetic operations as 'NoContraction'. +// +// 2) Find the object which should be marked as 'precise' in the right and +// update the 'precise' object work list. +// +class TNoContractionPropagator : public glslang::TIntermTraverser { +public: + TNoContractionPropagator(ObjectAccesschainSet* precise_objects, + const AccessChainMapping& accesschain_mapping) + : TIntermTraverser(true, false, false), + precise_objects_(*precise_objects), added_precise_object_ids_(), + remained_accesschain_(), accesschain_mapping_(accesschain_mapping) {} + + // Propagates 'precise' in the right nodes of a given assignment node with + // access chain record from the assignee node to a 'precise' object it + // contains. + void + propagateNoContractionInOneExpression(glslang::TIntermTyped* defining_node, + const ObjectAccessChain& assignee_remained_accesschain) + { + remained_accesschain_ = assignee_remained_accesschain; + if (glslang::TIntermBinary* BN = defining_node->getAsBinaryNode()) { + assert(isAssignOperation(BN->getOp())); + BN->getRight()->traverse(this); + if (isArithmeticOperation(BN->getOp())) { + BN->getWritableType().getQualifier().noContraction = true; + } + } else if (glslang::TIntermUnary* UN = defining_node->getAsUnaryNode()) { + assert(isAssignOperation(UN->getOp())); + UN->getOperand()->traverse(this); + if (isArithmeticOperation(UN->getOp())) { + UN->getWritableType().getQualifier().noContraction = true; + } + } + } + + // Propagates 'precise' in a given precise return node. + void propagateNoContractionInReturnNode(glslang::TIntermBranch* return_node) + { + remained_accesschain_ = ""; + assert(return_node->getFlowOp() == glslang::EOpReturn && return_node->getExpression()); + return_node->getExpression()->traverse(this); + } + +protected: + TNoContractionPropagator& operator=(const TNoContractionPropagator&); + + // Visits an aggregate node. The node can be a initializer list, in which + // case we need to find the 'precise' or 'precise' containing object node + // with the access chain record. In other cases, just need to traverse all + // the children nodes. + bool visitAggregate(glslang::TVisit, glslang::TIntermAggregate* node) override + { + if (!remained_accesschain_.empty() && node->getOp() == glslang::EOpConstructStruct) { + // This is a struct initializer node, and the remained + // access chain is not empty, we need to refer to the + // assignee_remained_access_chain_ to find the nested + // 'precise' object. And we don't need to visit other nodes in this + // aggregate node. + + // Gets the struct dereference index that leads to 'precise' object. + ObjectAccessChain precise_accesschain_index_str = + getFrontElement(remained_accesschain_); + unsigned precise_accesschain_index = (unsigned)strtoul(precise_accesschain_index_str.c_str(), nullptr, 10); + // Gets the node pointed by the access chain index extracted before. + glslang::TIntermTyped* potential_precise_node = + node->getSequence()[precise_accesschain_index]->getAsTyped(); + assert(potential_precise_node); + // Pop the front access chain index from the path, and visit the nested node. + { + ObjectAccessChain next_level_accesschain = + subAccessChainFromSecondElement(remained_accesschain_); + StateSettingGuard setup_remained_accesschain_for_next_level( + &remained_accesschain_, next_level_accesschain); + potential_precise_node->traverse(this); + } + return false; + } + return true; + } + + // Visits a binary node. A binary node can be an object node, e.g. a dereference node. + // As only the top object nodes in the right side of an assignment needs to be visited + // and added to 'precise' work list, this traverser won't visit the children nodes of + // an object node. If the binary node does not represent an object node, it should + // go on to traverse its children nodes and if it is an arithmetic operation node, this + // operation should be marked as 'noContraction'. + bool visitBinary(glslang::TVisit, glslang::TIntermBinary* node) override + { + if (isDereferenceOperation(node->getOp())) { + // This binary node is an object node. Need to update the precise + // object set with the access chain of this node + remained + // access chain . + ObjectAccessChain new_precise_accesschain = accesschain_mapping_.at(node); + if (remained_accesschain_.empty()) { + node->getWritableType().getQualifier().noContraction = true; + } else { + new_precise_accesschain += ObjectAccesschainDelimiter + remained_accesschain_; + } + // Cache the access chain as added precise object, so we won't add the + // same object to the work list again. + if (!added_precise_object_ids_.count(new_precise_accesschain)) { + precise_objects_.insert(new_precise_accesschain); + added_precise_object_ids_.insert(new_precise_accesschain); + } + // Only the upper-most object nodes should be visited, so do not + // visit children of this object node. + return false; + } + // If this is an arithmetic operation, marks this node as 'noContraction'. + if (isArithmeticOperation(node->getOp()) && node->getBasicType() != glslang::EbtInt) { + node->getWritableType().getQualifier().noContraction = true; + } + // As this node is not an object node, need to traverse the children nodes. + return true; + } + + // Visits a unary node. A unary node can not be an object node. If the operation + // is an arithmetic operation, need to mark this node as 'noContraction'. + bool visitUnary(glslang::TVisit /* visit */, glslang::TIntermUnary* node) override + { + // If this is an arithmetic operation, marks this with 'noContraction' + if (isArithmeticOperation(node->getOp())) { + node->getWritableType().getQualifier().noContraction = true; + } + return true; + } + + // Visits a symbol node. A symbol node is always an object node. So we + // should always be able to find its in our collected mapping from object + // nodes to access chains. As an object node, a symbol node can be either + // 'precise' or containing 'precise' objects according to unused + // access chain information we have when we visit this node. + void visitSymbol(glslang::TIntermSymbol* node) override + { + // Symbol nodes are object nodes and should always have an + // access chain collected before matches with it. + assert(accesschain_mapping_.count(node)); + ObjectAccessChain new_precise_accesschain = accesschain_mapping_.at(node); + // If the unused access chain is empty, this symbol node should be + // marked as 'precise'. Otherwise, the unused access chain should be + // appended to the symbol ID to build a new access chain which points to + // the nested 'precise' object in this symbol object. + if (remained_accesschain_.empty()) { + node->getWritableType().getQualifier().noContraction = true; + } else { + new_precise_accesschain += ObjectAccesschainDelimiter + remained_accesschain_; + } + // Add the new 'precise' access chain to the work list and make sure we + // don't visit it again. + if (!added_precise_object_ids_.count(new_precise_accesschain)) { + precise_objects_.insert(new_precise_accesschain); + added_precise_object_ids_.insert(new_precise_accesschain); + } + } + + // A set of precise objects, represented as access chains. + ObjectAccesschainSet& precise_objects_; + // Visited symbol nodes, should not revisit these nodes. + ObjectAccesschainSet added_precise_object_ids_; + // The left node of an assignment operation might be an parent of 'precise' objects. + // This means the left node might not be an 'precise' object node, but it may contains + // 'precise' qualifier which should be propagated to the corresponding child node in + // the right. So we need the path from the left node to its nested 'precise' node to + // tell us how to find the corresponding 'precise' node in the right. + ObjectAccessChain remained_accesschain_; + // A map from node pointers to their access chains. + const AccessChainMapping& accesschain_mapping_; +}; +} + +namespace glslang { + +void PropagateNoContraction(const glslang::TIntermediate& intermediate) +{ + // First, traverses the AST, records symbols with their defining operations + // and collects the initial set of precise symbols (symbol nodes that marked + // as 'noContraction') and precise return nodes. + auto mappings_and_precise_objects = + getSymbolToDefinitionMappingAndPreciseSymbolIDs(intermediate); + + // The mapping of symbol node IDs to their defining nodes. This enables us + // to get the defining node directly from a given symbol ID without + // traversing the tree again. + NodeMapping& symbol_definition_mapping = std::get<0>(mappings_and_precise_objects); + + // The mapping of object nodes to their access chains recorded. + AccessChainMapping& accesschain_mapping = std::get<1>(mappings_and_precise_objects); + + // The initial set of 'precise' objects which are represented as the + // access chain toward them. + ObjectAccesschainSet& precise_object_accesschains = std::get<2>(mappings_and_precise_objects); + + // The set of 'precise' return nodes. + ReturnBranchNodeSet& precise_return_nodes = std::get<3>(mappings_and_precise_objects); + + // Second, uses the initial set of precise objects as a work list, pops an + // access chain, extract the symbol ID from it. Then: + // 1) Check the assignee object, see if it is 'precise' object node or + // contains 'precise' object. Obtain the incremental access chain from the + // assignee node to its nested 'precise' node (if any). + // 2) If the assignee object node is 'precise' or it contains 'precise' + // objects, traverses the right side of the assignment operation + // expression to mark arithmetic operations as 'noContration' and update + // 'precise' access chain work list with new found object nodes. + // Repeat above steps until the work list is empty. + TNoContractionAssigneeCheckingTraverser checker(accesschain_mapping); + TNoContractionPropagator propagator(&precise_object_accesschains, accesschain_mapping); + + // We have two initial precise work lists to handle: + // 1) precise return nodes + // 2) precise object access chains + // We should process the precise return nodes first and the involved + // objects in the return expression should be added to the precise object + // access chain set. + while (!precise_return_nodes.empty()) { + glslang::TIntermBranch* precise_return_node = *precise_return_nodes.begin(); + propagator.propagateNoContractionInReturnNode(precise_return_node); + precise_return_nodes.erase(precise_return_node); + } + + while (!precise_object_accesschains.empty()) { + // Get the access chain of a precise object from the work list. + ObjectAccessChain precise_object_accesschain = *precise_object_accesschains.begin(); + // Get the symbol id from the access chain. + ObjectAccessChain symbol_id = getFrontElement(precise_object_accesschain); + // Get all the defining nodes of that symbol ID. + std::pair range = + symbol_definition_mapping.equal_range(symbol_id); + // Visits all the assignment nodes of that symbol ID and + // 1) Check if the assignee node is 'precise' or contains 'precise' + // objects. + // 2) Propagate the 'precise' to the top layer object nodes + // in the right side of the assignment operation, update the 'precise' + // work list with new access chains representing the new 'precise' + // objects, and mark arithmetic operations as 'noContraction'. + for (NodeMapping::iterator defining_node_iter = range.first; + defining_node_iter != range.second; defining_node_iter++) { + TIntermOperator* defining_node = defining_node_iter->second; + // Check the assignee node. + auto checker_result = checker.getPrecisenessAndRemainedAccessChain( + defining_node, precise_object_accesschain); + bool& contain_precise = std::get<0>(checker_result); + ObjectAccessChain& remained_accesschain = std::get<1>(checker_result); + // If the assignee node is 'precise' or contains 'precise', propagate the + // 'precise' to the right. Otherwise just skip this assignment node. + if (contain_precise) { + propagator.propagateNoContractionInOneExpression(defining_node, + remained_accesschain); + } + } + // Remove the last processed 'precise' object from the work list. + precise_object_accesschains.erase(precise_object_accesschain); + } +} +} +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.h new file mode 100644 index 0000000000..3721850d19 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.h @@ -0,0 +1,58 @@ +// +// Copyright (C) 2015-2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// +// Visit the nodes in the glslang intermediate tree representation to +// propagate 'noContraction' qualifier. +// + +#pragma once + +#include "../Include/intermediate.h" + +namespace QtShaderTools { +namespace glslang { + +// Propagates the 'precise' qualifier for objects (objects marked with +// 'noContraction' qualifier) from the shader source specified 'precise' +// variables to all the involved objects, and add 'noContraction' qualifier for +// the involved arithmetic operations. +// Note that the same qualifier: 'noContraction' is used in both object nodes +// and arithmetic operation nodes, but has different meaning. For object nodes, +// 'noContraction' means the object is 'precise'; and for arithmetic operation +// nodes, it means the operation should not be contracted. +void PropagateNoContraction(const glslang::TIntermediate& intermediate); + +} +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp new file mode 100644 index 0000000000..b6e70fb455 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp @@ -0,0 +1,1298 @@ +// +// Copyright (C) 2013-2016 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "../Include/Common.h" +#include "reflection.h" +#include "LiveTraverser.h" +#include "localintermediate.h" + +#include "gl_types.h" + +// +// Grow the reflection database through a friend traverser class of TReflection and a +// collection of functions to do a liveness traversal that note what uniforms are used +// in semantically non-dead code. +// +// Can be used multiple times, once per stage, to grow a program reflection. +// +// High-level algorithm for one stage: +// +// 1. Put the entry point on the list of live functions. +// +// 2. Traverse any live function, while skipping if-tests with a compile-time constant +// condition of false, and while adding any encountered function calls to the live +// function list. +// +// Repeat until the live function list is empty. +// +// 3. Add any encountered uniform variables and blocks to the reflection database. +// +// Can be attempted with a failed link, but will return false if recursion had been detected, or +// there wasn't exactly one entry point. +// + +namespace QtShaderTools { +namespace glslang { + +// +// The traverser: mostly pass through, except +// - processing binary nodes to see if they are dereferences of an aggregates to track +// - processing symbol nodes to see if they are non-aggregate objects to track +// +// This ignores semantically dead code by using TLiveTraverser. +// +// This is in the glslang namespace directly so it can be a friend of TReflection. +// + +class TReflectionTraverser : public TIntermTraverser { +public: + TReflectionTraverser(const TIntermediate& i, TReflection& r) : + TIntermTraverser(), intermediate(i), reflection(r), updateStageMasks(true) { } + + virtual bool visitBinary(TVisit, TIntermBinary* node); + virtual void visitSymbol(TIntermSymbol* base); + + // Add a simple reference to a uniform variable to the uniform database, no dereference involved. + // However, no dereference doesn't mean simple... it could be a complex aggregate. + void addUniform(const TIntermSymbol& base) + { + if (processedDerefs.find(&base) == processedDerefs.end()) { + processedDerefs.insert(&base); + + int blockIndex = -1; + int offset = -1; + TList derefs; + TString baseName = base.getName(); + + if (base.getType().getBasicType() == EbtBlock) { + offset = 0; + bool anonymous = IsAnonymous(baseName); + const TString& blockName = base.getType().getTypeName(); + + if (!anonymous) + baseName = blockName; + else + baseName = ""; + + blockIndex = addBlockName(blockName, base.getType(), intermediate.getBlockSize(base.getType())); + } + + // Use a degenerate (empty) set of dereferences to immediately put as at the end of + // the dereference change expected by blowUpActiveAggregate. + blowUpActiveAggregate(base.getType(), baseName, derefs, derefs.end(), offset, blockIndex, 0, -1, 0, + base.getQualifier().storage, updateStageMasks); + } + } + + void addPipeIOVariable(const TIntermSymbol& base) + { + if (processedDerefs.find(&base) == processedDerefs.end()) { + processedDerefs.insert(&base); + + const TString &name = base.getName(); + const TType &type = base.getType(); + const bool input = base.getQualifier().isPipeInput(); + + TReflection::TMapIndexToReflection &ioItems = + input ? reflection.indexToPipeInput : reflection.indexToPipeOutput; + + + TReflection::TNameToIndex &ioMapper = + input ? reflection.pipeInNameToIndex : reflection.pipeOutNameToIndex; + + if (reflection.options & EShReflectionUnwrapIOBlocks) { + bool anonymous = IsAnonymous(name); + + TString baseName; + if (type.getBasicType() == EbtBlock) { + baseName = anonymous ? TString() : type.getTypeName(); + } else { + baseName = anonymous ? TString() : name; + } + + // by convention if this is an arrayed block we ignore the array in the reflection + if (type.isArray() && type.getBasicType() == EbtBlock) { + blowUpIOAggregate(input, baseName, TType(type, 0)); + } else { + blowUpIOAggregate(input, baseName, type); + } + } else { + TReflection::TNameToIndex::const_iterator it = ioMapper.find(name.c_str()); + if (it == ioMapper.end()) { + // seperate pipe i/o params from uniforms and blocks + // in is only for input in first stage as out is only for last stage. check traverse in call stack. + ioMapper[name.c_str()] = static_cast(ioItems.size()); + ioItems.push_back( + TObjectReflection(name.c_str(), type, 0, mapToGlType(type), mapToGlArraySize(type), 0)); + EShLanguageMask& stages = ioItems.back().stages; + stages = static_cast(stages | 1 << intermediate.getStage()); + } else { + EShLanguageMask& stages = ioItems[it->second].stages; + stages = static_cast(stages | 1 << intermediate.getStage()); + } + } + } + } + + // Lookup or calculate the offset of all block members at once, using the recursively + // defined block offset rules. + void getOffsets(const TType& type, TVector& offsets) + { + const TTypeList& memberList = *type.getStruct(); + int memberSize = 0; + int offset = 0; + + for (size_t m = 0; m < offsets.size(); ++m) { + // if the user supplied an offset, snap to it now + if (memberList[m].type->getQualifier().hasOffset()) + offset = memberList[m].type->getQualifier().layoutOffset; + + // calculate the offset of the next member and align the current offset to this member + intermediate.updateOffset(type, *memberList[m].type, offset, memberSize); + + // save the offset of this member + offsets[m] = offset; + + // update for the next member + offset += memberSize; + } + } + + // Calculate the stride of an array type + int getArrayStride(const TType& baseType, const TType& type) + { + int dummySize; + int stride; + + // consider blocks to have 0 stride, so that all offsets are relative to the start of their block + if (type.getBasicType() == EbtBlock) + return 0; + + TLayoutMatrix subMatrixLayout = type.getQualifier().layoutMatrix; + intermediate.getMemberAlignment(type, dummySize, stride, + baseType.getQualifier().layoutPacking, + subMatrixLayout != ElmNone + ? subMatrixLayout == ElmRowMajor + : baseType.getQualifier().layoutMatrix == ElmRowMajor); + + return stride; + } + + // count the total number of leaf members from iterating out of a block type + int countAggregateMembers(const TType& parentType) + { + if (! parentType.isStruct()) + return 1; + + const bool strictArraySuffix = (reflection.options & EShReflectionStrictArraySuffix); + + bool blockParent = (parentType.getBasicType() == EbtBlock && parentType.getQualifier().storage == EvqBuffer); + + const TTypeList &memberList = *parentType.getStruct(); + + int ret = 0; + + for (size_t i = 0; i < memberList.size(); i++) + { + const TType &memberType = *memberList[i].type; + int numMembers = countAggregateMembers(memberType); + // for sized arrays of structs, apply logic to expand out the same as we would below in + // blowUpActiveAggregate + if (memberType.isArray() && ! memberType.getArraySizes()->hasUnsized() && memberType.isStruct()) { + if (! strictArraySuffix || ! blockParent) + numMembers *= memberType.getArraySizes()->getCumulativeSize(); + } + ret += numMembers; + } + + return ret; + } + + // Traverse the provided deref chain, including the base, and + // - build a full reflection-granularity name, array size, etc. entry out of it, if it goes down to that granularity + // - recursively expand any variable array index in the middle of that traversal + // - recursively expand what's left at the end if the deref chain did not reach down to reflection granularity + // + // arraySize tracks, just for the final dereference in the chain, if there was a specific known size. + // A value of 0 for arraySize will mean to use the full array's size. + void blowUpActiveAggregate(const TType& baseType, const TString& baseName, const TList& derefs, + TList::const_iterator deref, int offset, int blockIndex, int arraySize, + int topLevelArraySize, int topLevelArrayStride, TStorageQualifier baseStorage, bool active) + { + // when strictArraySuffix is enabled, we closely follow the rules from ARB_program_interface_query. + // Broadly: + // * arrays-of-structs always have a [x] suffix. + // * with array-of-struct variables in the root of a buffer block, only ever return [0]. + // * otherwise, array suffixes are added whenever we iterate, even if that means expanding out an array. + const bool strictArraySuffix = (reflection.options & EShReflectionStrictArraySuffix); + + // is this variable inside a buffer block. This flag is set back to false after we iterate inside the first array element. + bool blockParent = (baseType.getBasicType() == EbtBlock && baseType.getQualifier().storage == EvqBuffer); + + // process the part of the dereference chain that was explicit in the shader + TString name = baseName; + const TType* terminalType = &baseType; + for (; deref != derefs.end(); ++deref) { + TIntermBinary* visitNode = *deref; + terminalType = &visitNode->getType(); + int index; + switch (visitNode->getOp()) { + case EOpIndexIndirect: { + int stride = getArrayStride(baseType, visitNode->getLeft()->getType()); + + if (topLevelArrayStride == 0) + topLevelArrayStride = stride; + + // Visit all the indices of this array, and for each one add on the remaining dereferencing + for (int i = 0; i < std::max(visitNode->getLeft()->getType().getOuterArraySize(), 1); ++i) { + TString newBaseName = name; + if (terminalType->getBasicType() == EbtBlock) {} + else if (strictArraySuffix && blockParent) + newBaseName.append(TString("[0]")); + else if (strictArraySuffix || baseType.getBasicType() != EbtBlock) + newBaseName.append(TString("[") + String(i) + "]"); + TList::const_iterator nextDeref = deref; + ++nextDeref; + blowUpActiveAggregate(*terminalType, newBaseName, derefs, nextDeref, offset, blockIndex, arraySize, + topLevelArraySize, topLevelArrayStride, baseStorage, active); + + if (offset >= 0) + offset += stride; + } + + // it was all completed in the recursive calls above + return; + } + case EOpIndexDirect: { + int stride = getArrayStride(baseType, visitNode->getLeft()->getType()); + + index = visitNode->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); + if (terminalType->getBasicType() == EbtBlock) {} + else if (strictArraySuffix && blockParent) + name.append(TString("[0]")); + else if (strictArraySuffix || baseType.getBasicType() != EbtBlock) { + name.append(TString("[") + String(index) + "]"); + + if (offset >= 0) + offset += stride * index; + } + + if (topLevelArrayStride == 0) + topLevelArrayStride = stride; + + // expand top-level arrays in blocks with [0] suffix + if (topLevelArrayStride != 0 && visitNode->getLeft()->getType().isArray()) { + blockParent = false; + } + break; + } + case EOpIndexDirectStruct: + index = visitNode->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); + if (offset >= 0) + offset += intermediate.getOffset(visitNode->getLeft()->getType(), index); + if (name.size() > 0) + name.append("."); + name.append((*visitNode->getLeft()->getType().getStruct())[index].type->getFieldName()); + + // expand non top-level arrays with [x] suffix + if (visitNode->getLeft()->getType().getBasicType() != EbtBlock && terminalType->isArray()) + { + blockParent = false; + } + break; + default: + break; + } + } + + // if the terminalType is still too coarse a granularity, this is still an aggregate to expand, expand it... + if (! isReflectionGranularity(*terminalType)) { + // the base offset of this node, that children are relative to + int baseOffset = offset; + + if (terminalType->isArray()) { + // Visit all the indices of this array, and for each one, + // fully explode the remaining aggregate to dereference + + int stride = 0; + if (offset >= 0) + stride = getArrayStride(baseType, *terminalType); + + int arrayIterateSize = std::max(terminalType->getOuterArraySize(), 1); + + // for top-level arrays in blocks, only expand [0] to avoid explosion of items + if ((strictArraySuffix && blockParent) || + ((topLevelArraySize == arrayIterateSize) && (topLevelArrayStride == 0))) { + arrayIterateSize = 1; + } + + if (topLevelArrayStride == 0) + topLevelArrayStride = stride; + + for (int i = 0; i < arrayIterateSize; ++i) { + TString newBaseName = name; + if (terminalType->getBasicType() != EbtBlock) + newBaseName.append(TString("[") + String(i) + "]"); + TType derefType(*terminalType, 0); + if (offset >= 0) + offset = baseOffset + stride * i; + + blowUpActiveAggregate(derefType, newBaseName, derefs, derefs.end(), offset, blockIndex, 0, + topLevelArraySize, topLevelArrayStride, baseStorage, active); + } + } else { + // Visit all members of this aggregate, and for each one, + // fully explode the remaining aggregate to dereference + const TTypeList& typeList = *terminalType->getStruct(); + + TVector memberOffsets; + + if (baseOffset >= 0) { + memberOffsets.resize(typeList.size()); + getOffsets(*terminalType, memberOffsets); + } + + for (int i = 0; i < (int)typeList.size(); ++i) { + TString newBaseName = name; + if (newBaseName.size() > 0) + newBaseName.append("."); + newBaseName.append(typeList[i].type->getFieldName()); + TType derefType(*terminalType, i); + if (offset >= 0) + offset = baseOffset + memberOffsets[i]; + + int arrayStride = topLevelArrayStride; + if (terminalType->getBasicType() == EbtBlock && terminalType->getQualifier().storage == EvqBuffer && + derefType.isArray()) { + arrayStride = getArrayStride(baseType, derefType); + } + + if (topLevelArraySize == -1 && arrayStride == 0 && blockParent) + topLevelArraySize = 1; + + if (strictArraySuffix && blockParent) { + // if this member is an array, store the top-level array stride but start the explosion from + // the inner struct type. + if (derefType.isArray() && derefType.isStruct()) { + newBaseName.append("[0]"); + auto dimSize = derefType.isUnsizedArray() ? 0 : derefType.getArraySizes()->getDimSize(0); + blowUpActiveAggregate(TType(derefType, 0), newBaseName, derefs, derefs.end(), memberOffsets[i], + blockIndex, 0, dimSize, arrayStride, terminalType->getQualifier().storage, false); + } + else if (derefType.isArray()) { + auto dimSize = derefType.isUnsizedArray() ? 0 : derefType.getArraySizes()->getDimSize(0); + blowUpActiveAggregate(derefType, newBaseName, derefs, derefs.end(), memberOffsets[i], blockIndex, + 0, dimSize, 0, terminalType->getQualifier().storage, false); + } + else { + blowUpActiveAggregate(derefType, newBaseName, derefs, derefs.end(), memberOffsets[i], blockIndex, + 0, 1, 0, terminalType->getQualifier().storage, false); + } + } else { + blowUpActiveAggregate(derefType, newBaseName, derefs, derefs.end(), offset, blockIndex, 0, + topLevelArraySize, arrayStride, baseStorage, active); + } + } + } + + // it was all completed in the recursive calls above + return; + } + + if ((reflection.options & EShReflectionBasicArraySuffix) && terminalType->isArray()) { + name.append(TString("[0]")); + } + + // Finally, add a full string to the reflection database, and update the array size if necessary. + // If the dereferenced entity to record is an array, compute the size and update the maximum size. + + // there might not be a final array dereference, it could have been copied as an array object + if (arraySize == 0) + arraySize = mapToGlArraySize(*terminalType); + + TReflection::TMapIndexToReflection& variables = reflection.GetVariableMapForStorage(baseStorage); + + TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(name.c_str()); + if (it == reflection.nameToIndex.end()) { + int uniformIndex = (int)variables.size(); + reflection.nameToIndex[name.c_str()] = uniformIndex; + variables.push_back(TObjectReflection(name.c_str(), *terminalType, offset, mapToGlType(*terminalType), + arraySize, blockIndex)); + if (terminalType->isArray()) { + variables.back().arrayStride = getArrayStride(baseType, *terminalType); + if (topLevelArrayStride == 0) + topLevelArrayStride = variables.back().arrayStride; + } + + if ((reflection.options & EShReflectionSeparateBuffers) && terminalType->isAtomic()) + reflection.atomicCounterUniformIndices.push_back(uniformIndex); + + variables.back().topLevelArraySize = topLevelArraySize; + variables.back().topLevelArrayStride = topLevelArrayStride; + + if ((reflection.options & EShReflectionAllBlockVariables) && active) { + EShLanguageMask& stages = variables.back().stages; + stages = static_cast(stages | 1 << intermediate.getStage()); + } + } else { + if (arraySize > 1) { + int& reflectedArraySize = variables[it->second].size; + reflectedArraySize = std::max(arraySize, reflectedArraySize); + } + + if ((reflection.options & EShReflectionAllBlockVariables) && active) { + EShLanguageMask& stages = variables[it->second].stages; + stages = static_cast(stages | 1 << intermediate.getStage()); + } + } + } + + // similar to blowUpActiveAggregate, but with simpler rules and no dereferences to follow. + void blowUpIOAggregate(bool input, const TString &baseName, const TType &type) + { + TString name = baseName; + + // if the type is still too coarse a granularity, this is still an aggregate to expand, expand it... + if (! isReflectionGranularity(type)) { + if (type.isArray()) { + // Visit all the indices of this array, and for each one, + // fully explode the remaining aggregate to dereference + for (int i = 0; i < std::max(type.getOuterArraySize(), 1); ++i) { + TString newBaseName = name; + newBaseName.append(TString("[") + String(i) + "]"); + TType derefType(type, 0); + + blowUpIOAggregate(input, newBaseName, derefType); + } + } else { + // Visit all members of this aggregate, and for each one, + // fully explode the remaining aggregate to dereference + const TTypeList& typeList = *type.getStruct(); + + for (int i = 0; i < (int)typeList.size(); ++i) { + TString newBaseName = name; + if (newBaseName.size() > 0) + newBaseName.append("."); + newBaseName.append(typeList[i].type->getFieldName()); + TType derefType(type, i); + + blowUpIOAggregate(input, newBaseName, derefType); + } + } + + // it was all completed in the recursive calls above + return; + } + + if ((reflection.options & EShReflectionBasicArraySuffix) && type.isArray()) { + name.append(TString("[0]")); + } + + TReflection::TMapIndexToReflection &ioItems = + input ? reflection.indexToPipeInput : reflection.indexToPipeOutput; + + std::string namespacedName = input ? "in " : "out "; + namespacedName += name.c_str(); + + TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(namespacedName); + if (it == reflection.nameToIndex.end()) { + reflection.nameToIndex[namespacedName] = (int)ioItems.size(); + ioItems.push_back( + TObjectReflection(name.c_str(), type, 0, mapToGlType(type), mapToGlArraySize(type), 0)); + + EShLanguageMask& stages = ioItems.back().stages; + stages = static_cast(stages | 1 << intermediate.getStage()); + } else { + EShLanguageMask& stages = ioItems[it->second].stages; + stages = static_cast(stages | 1 << intermediate.getStage()); + } + } + + // Add a uniform dereference where blocks/struct/arrays are involved in the access. + // Handles the situation where the left node is at the correct or too coarse a + // granularity for reflection. (That is, further dereferences up the tree will be + // skipped.) Earlier dereferences, down the tree, will be handled + // at the same time, and logged to prevent reprocessing as the tree is traversed. + // + // Note: Other things like the following must be caught elsewhere: + // - a simple non-array, non-struct variable (no dereference even conceivable) + // - an aggregrate consumed en masse, without a dereference + // + // So, this code is for cases like + // - a struct/block dereferencing a member (whether the member is array or not) + // - an array of struct + // - structs/arrays containing the above + // + void addDereferencedUniform(TIntermBinary* topNode) + { + // See if too fine-grained to process (wait to get further down the tree) + const TType& leftType = topNode->getLeft()->getType(); + if ((leftType.isVector() || leftType.isMatrix()) && ! leftType.isArray()) + return; + + // We have an array or structure or block dereference, see if it's a uniform + // based dereference (if not, skip it). + TIntermSymbol* base = findBase(topNode); + if (! base || ! base->getQualifier().isUniformOrBuffer()) + return; + + // See if we've already processed this (e.g., in the middle of something + // we did earlier), and if so skip it + if (processedDerefs.find(topNode) != processedDerefs.end()) + return; + + // Process this uniform dereference + + int offset = -1; + int blockIndex = -1; + bool anonymous = false; + + // See if we need to record the block itself + bool block = base->getBasicType() == EbtBlock; + if (block) { + offset = 0; + anonymous = IsAnonymous(base->getName()); + + const TString& blockName = base->getType().getTypeName(); + TString baseName; + + if (! anonymous) + baseName = blockName; + + blockIndex = addBlockName(blockName, base->getType(), intermediate.getBlockSize(base->getType())); + + if (reflection.options & EShReflectionAllBlockVariables) { + // Use a degenerate (empty) set of dereferences to immediately put as at the end of + // the dereference change expected by blowUpActiveAggregate. + TList derefs; + + // otherwise - if we're not using strict array suffix rules, or this isn't a block so we are + // expanding root arrays anyway, just start the iteration from the base block type. + blowUpActiveAggregate(base->getType(), baseName, derefs, derefs.end(), 0, blockIndex, 0, -1, 0, + base->getQualifier().storage, false); + } + } + + // Process the dereference chain, backward, accumulating the pieces for later forward traversal. + // If the topNode is a reflection-granularity-array dereference, don't include that last dereference. + TList derefs; + for (TIntermBinary* visitNode = topNode; visitNode; visitNode = visitNode->getLeft()->getAsBinaryNode()) { + if (isReflectionGranularity(visitNode->getLeft()->getType())) + continue; + + derefs.push_front(visitNode); + processedDerefs.insert(visitNode); + } + processedDerefs.insert(base); + + // See if we have a specific array size to stick to while enumerating the explosion of the aggregate + int arraySize = 0; + if (isReflectionGranularity(topNode->getLeft()->getType()) && topNode->getLeft()->isArray()) { + if (topNode->getOp() == EOpIndexDirect) + arraySize = topNode->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst() + 1; + } + + // Put the dereference chain together, forward + TString baseName; + if (! anonymous) { + if (block) + baseName = base->getType().getTypeName(); + else + baseName = base->getName(); + } + blowUpActiveAggregate(base->getType(), baseName, derefs, derefs.begin(), offset, blockIndex, arraySize, -1, 0, + base->getQualifier().storage, true); + } + + int addBlockName(const TString& name, const TType& type, int size) + { + int blockIndex = 0; + if (type.isArray()) { + TType derefType(type, 0); + for (int e = 0; e < type.getOuterArraySize(); ++e) { + int memberBlockIndex = addBlockName(name + "[" + String(e) + "]", derefType, size); + if (e == 0) + blockIndex = memberBlockIndex; + } + } else { + TReflection::TMapIndexToReflection& blocks = reflection.GetBlockMapForStorage(type.getQualifier().storage); + + TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(name.c_str()); + if (reflection.nameToIndex.find(name.c_str()) == reflection.nameToIndex.end()) { + blockIndex = (int)blocks.size(); + reflection.nameToIndex[name.c_str()] = blockIndex; + blocks.push_back(TObjectReflection(name.c_str(), type, -1, -1, size, blockIndex)); + + blocks.back().numMembers = countAggregateMembers(type); + + if (updateStageMasks) { + EShLanguageMask& stages = blocks.back().stages; + stages = static_cast(stages | 1 << intermediate.getStage()); + } + } + else { + blockIndex = it->second; + if (updateStageMasks) { + EShLanguageMask& stages = blocks[blockIndex].stages; + stages = static_cast(stages | 1 << intermediate.getStage()); + } + } + } + + return blockIndex; + } + + // Are we at a level in a dereference chain at which individual active uniform queries are made? + bool isReflectionGranularity(const TType& type) + { + return type.getBasicType() != EbtBlock && type.getBasicType() != EbtStruct && !type.isArrayOfArrays(); + } + + // For a binary operation indexing into an aggregate, chase down the base of the aggregate. + // Return nullptr if the topology does not fit this situation. + TIntermSymbol* findBase(const TIntermBinary* node) + { + TIntermSymbol *base = node->getLeft()->getAsSymbolNode(); + if (base) + return base; + TIntermBinary* left = node->getLeft()->getAsBinaryNode(); + if (! left) + return nullptr; + + return findBase(left); + } + + // + // Translate a glslang sampler type into the GL API #define number. + // + int mapSamplerToGlType(TSampler sampler) + { + if (! sampler.image) { + // a sampler... + switch (sampler.type) { + case EbtFloat: + switch ((int)sampler.dim) { + case Esd1D: + if (sampler.shadow) + return sampler.arrayed ? GL_SAMPLER_1D_ARRAY_SHADOW : GL_SAMPLER_1D_SHADOW; + else + return sampler.arrayed ? GL_SAMPLER_1D_ARRAY : GL_SAMPLER_1D; + case Esd2D: + if (sampler.ms) { + return sampler.arrayed ? GL_SAMPLER_2D_MULTISAMPLE_ARRAY : GL_SAMPLER_2D_MULTISAMPLE; + } else { + if (sampler.shadow) + return sampler.arrayed ? GL_SAMPLER_2D_ARRAY_SHADOW : GL_SAMPLER_2D_SHADOW; + else + return sampler.arrayed ? GL_SAMPLER_2D_ARRAY : GL_SAMPLER_2D; + } + case Esd3D: + return GL_SAMPLER_3D; + case EsdCube: + if (sampler.shadow) + return sampler.arrayed ? GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW : GL_SAMPLER_CUBE_SHADOW; + else + return sampler.arrayed ? GL_SAMPLER_CUBE_MAP_ARRAY : GL_SAMPLER_CUBE; + case EsdRect: + return sampler.shadow ? GL_SAMPLER_2D_RECT_SHADOW : GL_SAMPLER_2D_RECT; + case EsdBuffer: + return GL_SAMPLER_BUFFER; + default: + return 0; + } + case EbtFloat16: + switch ((int)sampler.dim) { + case Esd1D: + if (sampler.shadow) + return sampler.arrayed ? GL_FLOAT16_SAMPLER_1D_ARRAY_SHADOW_AMD : GL_FLOAT16_SAMPLER_1D_SHADOW_AMD; + else + return sampler.arrayed ? GL_FLOAT16_SAMPLER_1D_ARRAY_AMD : GL_FLOAT16_SAMPLER_1D_AMD; + case Esd2D: + if (sampler.ms) { + return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_ARRAY_AMD : GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_AMD; + } else { + if (sampler.shadow) + return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_ARRAY_SHADOW_AMD : GL_FLOAT16_SAMPLER_2D_SHADOW_AMD; + else + return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_ARRAY_AMD : GL_FLOAT16_SAMPLER_2D_AMD; + } + case Esd3D: + return GL_FLOAT16_SAMPLER_3D_AMD; + case EsdCube: + if (sampler.shadow) + return sampler.arrayed ? GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_SHADOW_AMD : GL_FLOAT16_SAMPLER_CUBE_SHADOW_AMD; + else + return sampler.arrayed ? GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_AMD : GL_FLOAT16_SAMPLER_CUBE_AMD; + case EsdRect: + return sampler.shadow ? GL_FLOAT16_SAMPLER_2D_RECT_SHADOW_AMD : GL_FLOAT16_SAMPLER_2D_RECT_AMD; + case EsdBuffer: + return GL_FLOAT16_SAMPLER_BUFFER_AMD; + default: + return 0; + } + case EbtInt: + switch ((int)sampler.dim) { + case Esd1D: + return sampler.arrayed ? GL_INT_SAMPLER_1D_ARRAY : GL_INT_SAMPLER_1D; + case Esd2D: + if (sampler.ms) + return sampler.arrayed ? GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY + : GL_INT_SAMPLER_2D_MULTISAMPLE; + else + return sampler.arrayed ? GL_INT_SAMPLER_2D_ARRAY : GL_INT_SAMPLER_2D; + case Esd3D: + return GL_INT_SAMPLER_3D; + case EsdCube: + return sampler.arrayed ? GL_INT_SAMPLER_CUBE_MAP_ARRAY : GL_INT_SAMPLER_CUBE; + case EsdRect: + return GL_INT_SAMPLER_2D_RECT; + case EsdBuffer: + return GL_INT_SAMPLER_BUFFER; + default: + return 0; + } + case EbtUint: + switch ((int)sampler.dim) { + case Esd1D: + return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_1D_ARRAY : GL_UNSIGNED_INT_SAMPLER_1D; + case Esd2D: + if (sampler.ms) + return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY + : GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE; + else + return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_2D_ARRAY : GL_UNSIGNED_INT_SAMPLER_2D; + case Esd3D: + return GL_UNSIGNED_INT_SAMPLER_3D; + case EsdCube: + return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY : GL_UNSIGNED_INT_SAMPLER_CUBE; + case EsdRect: + return GL_UNSIGNED_INT_SAMPLER_2D_RECT; + case EsdBuffer: + return GL_UNSIGNED_INT_SAMPLER_BUFFER; + default: + return 0; + } + default: + return 0; + } + } else { + // an image... + switch (sampler.type) { + case EbtFloat: + switch ((int)sampler.dim) { + case Esd1D: + return sampler.arrayed ? GL_IMAGE_1D_ARRAY : GL_IMAGE_1D; + case Esd2D: + if (sampler.ms) + return sampler.arrayed ? GL_IMAGE_2D_MULTISAMPLE_ARRAY : GL_IMAGE_2D_MULTISAMPLE; + else + return sampler.arrayed ? GL_IMAGE_2D_ARRAY : GL_IMAGE_2D; + case Esd3D: + return GL_IMAGE_3D; + case EsdCube: + return sampler.arrayed ? GL_IMAGE_CUBE_MAP_ARRAY : GL_IMAGE_CUBE; + case EsdRect: + return GL_IMAGE_2D_RECT; + case EsdBuffer: + return GL_IMAGE_BUFFER; + default: + return 0; + } + case EbtFloat16: + switch ((int)sampler.dim) { + case Esd1D: + return sampler.arrayed ? GL_FLOAT16_IMAGE_1D_ARRAY_AMD : GL_FLOAT16_IMAGE_1D_AMD; + case Esd2D: + if (sampler.ms) + return sampler.arrayed ? GL_FLOAT16_IMAGE_2D_MULTISAMPLE_ARRAY_AMD : GL_FLOAT16_IMAGE_2D_MULTISAMPLE_AMD; + else + return sampler.arrayed ? GL_FLOAT16_IMAGE_2D_ARRAY_AMD : GL_FLOAT16_IMAGE_2D_AMD; + case Esd3D: + return GL_FLOAT16_IMAGE_3D_AMD; + case EsdCube: + return sampler.arrayed ? GL_FLOAT16_IMAGE_CUBE_MAP_ARRAY_AMD : GL_FLOAT16_IMAGE_CUBE_AMD; + case EsdRect: + return GL_FLOAT16_IMAGE_2D_RECT_AMD; + case EsdBuffer: + return GL_FLOAT16_IMAGE_BUFFER_AMD; + default: + return 0; + } + case EbtInt: + switch ((int)sampler.dim) { + case Esd1D: + return sampler.arrayed ? GL_INT_IMAGE_1D_ARRAY : GL_INT_IMAGE_1D; + case Esd2D: + if (sampler.ms) + return sampler.arrayed ? GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY : GL_INT_IMAGE_2D_MULTISAMPLE; + else + return sampler.arrayed ? GL_INT_IMAGE_2D_ARRAY : GL_INT_IMAGE_2D; + case Esd3D: + return GL_INT_IMAGE_3D; + case EsdCube: + return sampler.arrayed ? GL_INT_IMAGE_CUBE_MAP_ARRAY : GL_INT_IMAGE_CUBE; + case EsdRect: + return GL_INT_IMAGE_2D_RECT; + case EsdBuffer: + return GL_INT_IMAGE_BUFFER; + default: + return 0; + } + case EbtUint: + switch ((int)sampler.dim) { + case Esd1D: + return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_1D_ARRAY : GL_UNSIGNED_INT_IMAGE_1D; + case Esd2D: + if (sampler.ms) + return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY + : GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE; + else + return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_2D_ARRAY : GL_UNSIGNED_INT_IMAGE_2D; + case Esd3D: + return GL_UNSIGNED_INT_IMAGE_3D; + case EsdCube: + return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY : GL_UNSIGNED_INT_IMAGE_CUBE; + case EsdRect: + return GL_UNSIGNED_INT_IMAGE_2D_RECT; + case EsdBuffer: + return GL_UNSIGNED_INT_IMAGE_BUFFER; + default: + return 0; + } + default: + return 0; + } + } + } + + // + // Translate a glslang type into the GL API #define number. + // Ignores arrayness. + // + int mapToGlType(const TType& type) + { + switch (type.getBasicType()) { + case EbtSampler: + return mapSamplerToGlType(type.getSampler()); + case EbtStruct: + case EbtBlock: + case EbtVoid: + return 0; + default: + break; + } + + if (type.isVector()) { + int offset = type.getVectorSize() - 2; + switch (type.getBasicType()) { + case EbtFloat: return GL_FLOAT_VEC2 + offset; + case EbtDouble: return GL_DOUBLE_VEC2 + offset; + case EbtFloat16: return GL_FLOAT16_VEC2_NV + offset; + case EbtInt: return GL_INT_VEC2 + offset; + case EbtUint: return GL_UNSIGNED_INT_VEC2 + offset; + case EbtInt64: return GL_INT64_VEC2_ARB + offset; + case EbtUint64: return GL_UNSIGNED_INT64_VEC2_ARB + offset; + case EbtBool: return GL_BOOL_VEC2 + offset; + case EbtAtomicUint: return GL_UNSIGNED_INT_ATOMIC_COUNTER + offset; + default: return 0; + } + } + if (type.isMatrix()) { + switch (type.getBasicType()) { + case EbtFloat: + switch (type.getMatrixCols()) { + case 2: + switch (type.getMatrixRows()) { + case 2: return GL_FLOAT_MAT2; + case 3: return GL_FLOAT_MAT2x3; + case 4: return GL_FLOAT_MAT2x4; + default: return 0; + } + case 3: + switch (type.getMatrixRows()) { + case 2: return GL_FLOAT_MAT3x2; + case 3: return GL_FLOAT_MAT3; + case 4: return GL_FLOAT_MAT3x4; + default: return 0; + } + case 4: + switch (type.getMatrixRows()) { + case 2: return GL_FLOAT_MAT4x2; + case 3: return GL_FLOAT_MAT4x3; + case 4: return GL_FLOAT_MAT4; + default: return 0; + } + default: return 0; + } + case EbtDouble: + switch (type.getMatrixCols()) { + case 2: + switch (type.getMatrixRows()) { + case 2: return GL_DOUBLE_MAT2; + case 3: return GL_DOUBLE_MAT2x3; + case 4: return GL_DOUBLE_MAT2x4; + default: return 0; + } + case 3: + switch (type.getMatrixRows()) { + case 2: return GL_DOUBLE_MAT3x2; + case 3: return GL_DOUBLE_MAT3; + case 4: return GL_DOUBLE_MAT3x4; + default: return 0; + } + case 4: + switch (type.getMatrixRows()) { + case 2: return GL_DOUBLE_MAT4x2; + case 3: return GL_DOUBLE_MAT4x3; + case 4: return GL_DOUBLE_MAT4; + default: return 0; + } + default: return 0; + } + case EbtFloat16: + switch (type.getMatrixCols()) { + case 2: + switch (type.getMatrixRows()) { + case 2: return GL_FLOAT16_MAT2_AMD; + case 3: return GL_FLOAT16_MAT2x3_AMD; + case 4: return GL_FLOAT16_MAT2x4_AMD; + default: return 0; + } + case 3: + switch (type.getMatrixRows()) { + case 2: return GL_FLOAT16_MAT3x2_AMD; + case 3: return GL_FLOAT16_MAT3_AMD; + case 4: return GL_FLOAT16_MAT3x4_AMD; + default: return 0; + } + case 4: + switch (type.getMatrixRows()) { + case 2: return GL_FLOAT16_MAT4x2_AMD; + case 3: return GL_FLOAT16_MAT4x3_AMD; + case 4: return GL_FLOAT16_MAT4_AMD; + default: return 0; + } + default: return 0; + } + default: + return 0; + } + } + if (type.getVectorSize() == 1) { + switch (type.getBasicType()) { + case EbtFloat: return GL_FLOAT; + case EbtDouble: return GL_DOUBLE; + case EbtFloat16: return GL_FLOAT16_NV; + case EbtInt: return GL_INT; + case EbtUint: return GL_UNSIGNED_INT; + case EbtInt64: return GL_INT64_ARB; + case EbtUint64: return GL_UNSIGNED_INT64_ARB; + case EbtBool: return GL_BOOL; + case EbtAtomicUint: return GL_UNSIGNED_INT_ATOMIC_COUNTER; + default: return 0; + } + } + + return 0; + } + + int mapToGlArraySize(const TType& type) + { + return type.isArray() ? type.getOuterArraySize() : 1; + } + + const TIntermediate& intermediate; + TReflection& reflection; + std::set processedDerefs; + bool updateStageMasks; + +protected: + TReflectionTraverser(TReflectionTraverser&); + TReflectionTraverser& operator=(TReflectionTraverser&); +}; + +// +// Implement the traversal functions of interest. +// + +// To catch dereferenced aggregates that must be reflected. +// This catches them at the highest level possible in the tree. +bool TReflectionTraverser::visitBinary(TVisit /* visit */, TIntermBinary* node) +{ + switch (node->getOp()) { + case EOpIndexDirect: + case EOpIndexIndirect: + case EOpIndexDirectStruct: + addDereferencedUniform(node); + break; + default: + break; + } + + // still need to visit everything below, which could contain sub-expressions + // containing different uniforms + return true; +} + +// To reflect non-dereferenced objects. +void TReflectionTraverser::visitSymbol(TIntermSymbol* base) +{ + if (base->getQualifier().storage == EvqUniform) { + if (base->getBasicType() == EbtBlock) { + if (reflection.options & EShReflectionSharedStd140UBO) { + addUniform(*base); + } + } else { + addUniform(*base); + } + } + + // #TODO add std140/layout active rules for ssbo, same with ubo. + // Storage buffer blocks will be collected and expanding in this part. + if((reflection.options & EShReflectionSharedStd140SSBO) && + (base->getQualifier().storage == EvqBuffer && base->getBasicType() == EbtBlock && + (base->getQualifier().layoutPacking == ElpStd140 || base->getQualifier().layoutPacking == ElpShared))) + addUniform(*base); + + if ((intermediate.getStage() == reflection.firstStage && base->getQualifier().isPipeInput()) || + (intermediate.getStage() == reflection.lastStage && base->getQualifier().isPipeOutput())) + addPipeIOVariable(*base); +} + +// +// Implement TObjectReflection methods. +// + +TObjectReflection::TObjectReflection(const std::string &pName, const TType &pType, int pOffset, int pGLDefineType, + int pSize, int pIndex) + : name(pName), offset(pOffset), glDefineType(pGLDefineType), size(pSize), index(pIndex), counterIndex(-1), + numMembers(-1), arrayStride(0), topLevelArrayStride(0), stages(EShLanguageMask(0)), type(pType.clone()) +{ +} + +int TObjectReflection::getBinding() const +{ + if (type == nullptr || !type->getQualifier().hasBinding()) + return -1; + return type->getQualifier().layoutBinding; +} + +void TObjectReflection::dump() const +{ + printf("%s: offset %d, type %x, size %d, index %d, binding %d, stages %d", name.c_str(), offset, glDefineType, size, + index, getBinding(), stages); + + if (counterIndex != -1) + printf(", counter %d", counterIndex); + + if (numMembers != -1) + printf(", numMembers %d", numMembers); + + if (arrayStride != 0) + printf(", arrayStride %d", arrayStride); + + if (topLevelArrayStride != 0) + printf(", topLevelArrayStride %d", topLevelArrayStride); + + printf("\n"); +} + +// +// Implement TReflection methods. +// + +// Track any required attribute reflection, such as compute shader numthreads. +// +void TReflection::buildAttributeReflection(EShLanguage stage, const TIntermediate& intermediate) +{ + if (stage == EShLangCompute) { + // Remember thread dimensions + for (int dim=0; dim<3; ++dim) { + localSize[dim] = intermediate.getLocalSize(dim); + tileShadingRateQCOM[dim] = intermediate.getTileShadingRateQCOM(dim); + } + } +} + +// build counter block index associations for buffers +void TReflection::buildCounterIndices(const TIntermediate& intermediate) +{ +#ifdef ENABLE_HLSL + // search for ones that have counters + for (int i = 0; i < int(indexToUniformBlock.size()); ++i) { + const TString counterName(intermediate.addCounterBufferName(indexToUniformBlock[i].name).c_str()); + const int index = getIndex(counterName); + + if (index >= 0) + indexToUniformBlock[i].counterIndex = index; + } +#else + (void)intermediate; +#endif +} + +// build Shader Stages mask for all uniforms +void TReflection::buildUniformStageMask(const TIntermediate& intermediate) +{ + if (options & EShReflectionAllBlockVariables) + return; + + for (int i = 0; i < int(indexToUniform.size()); ++i) { + indexToUniform[i].stages = static_cast(indexToUniform[i].stages | 1 << intermediate.getStage()); + } + + for (int i = 0; i < int(indexToBufferVariable.size()); ++i) { + indexToBufferVariable[i].stages = + static_cast(indexToBufferVariable[i].stages | 1 << intermediate.getStage()); + } +} + +// Merge live symbols from 'intermediate' into the existing reflection database. +// +// Returns false if the input is too malformed to do this. +bool TReflection::addStage(EShLanguage stage, const TIntermediate& intermediate) +{ + if (intermediate.getTreeRoot() == nullptr || + intermediate.getNumEntryPoints() != 1 || + intermediate.isRecursive()) + return false; + + buildAttributeReflection(stage, intermediate); + + TReflectionTraverser it(intermediate, *this); + + for (auto& sequnence : intermediate.getTreeRoot()->getAsAggregate()->getSequence()) { + if (sequnence->getAsAggregate() != nullptr) { + if (sequnence->getAsAggregate()->getOp() == glslang::EOpLinkerObjects) { + it.updateStageMasks = false; + TIntermAggregate* linkerObjects = sequnence->getAsAggregate(); + for (auto& sequnence : linkerObjects->getSequence()) { + auto pNode = sequnence->getAsSymbolNode(); + if (pNode != nullptr) { + if ((pNode->getQualifier().storage == EvqUniform && + (options & EShReflectionSharedStd140UBO)) || + (pNode->getQualifier().storage == EvqBuffer && + (options & EShReflectionSharedStd140SSBO))) { + // collect std140 and shared uniform block form AST + if ((pNode->getBasicType() == EbtBlock) && + ((pNode->getQualifier().layoutPacking == ElpStd140) || + (pNode->getQualifier().layoutPacking == ElpShared))) { + pNode->traverse(&it); + } + } + else if ((options & EShReflectionAllIOVariables) && + (pNode->getQualifier().isPipeInput() || pNode->getQualifier().isPipeOutput())) + { + pNode->traverse(&it); + } + } + } + } else { + // This traverser will travers all function in AST. + // If we want reflect uncalled function, we need set linke message EShMsgKeepUncalled. + // When EShMsgKeepUncalled been set to true, all function will be keep in AST, even it is a uncalled function. + // This will keep some uniform variables in reflection, if those uniform variables is used in these uncalled function. + // + // If we just want reflect only live node, we can use a default link message or set EShMsgKeepUncalled false. + // When linke message not been set EShMsgKeepUncalled, linker won't keep uncalled function in AST. + // So, travers all function node can equivalent to travers live function. + it.updateStageMasks = true; + sequnence->getAsAggregate()->traverse(&it); + } + } + } + it.updateStageMasks = true; + + buildCounterIndices(intermediate); + buildUniformStageMask(intermediate); + + return true; +} + +void TReflection::dump() +{ + printf("Uniform reflection:\n"); + for (size_t i = 0; i < indexToUniform.size(); ++i) + indexToUniform[i].dump(); + printf("\n"); + + printf("Uniform block reflection:\n"); + for (size_t i = 0; i < indexToUniformBlock.size(); ++i) + indexToUniformBlock[i].dump(); + printf("\n"); + + printf("Buffer variable reflection:\n"); + for (size_t i = 0; i < indexToBufferVariable.size(); ++i) + indexToBufferVariable[i].dump(); + printf("\n"); + + printf("Buffer block reflection:\n"); + for (size_t i = 0; i < indexToBufferBlock.size(); ++i) + indexToBufferBlock[i].dump(); + printf("\n"); + + printf("Pipeline input reflection:\n"); + for (size_t i = 0; i < indexToPipeInput.size(); ++i) + indexToPipeInput[i].dump(); + printf("\n"); + + printf("Pipeline output reflection:\n"); + for (size_t i = 0; i < indexToPipeOutput.size(); ++i) + indexToPipeOutput[i].dump(); + printf("\n"); + + static const char* axis[] = { "X", "Y", "Z" }; + if (getLocalSize(0) > 1) { + for (int dim=0; dim<3; ++dim) + if (getLocalSize(dim) > 1) + printf("Local size %s: %u\n", axis[dim], getLocalSize(dim)); + + printf("\n"); + } + + if (getTileShadingRateQCOM(0) > 1 || getTileShadingRateQCOM(1) > 1) { + for (int dim=0; dim<3; ++dim) + printf("Tile shading rate QCOM %s: %u\n", axis[dim], getTileShadingRateQCOM(dim)); + printf("\n"); + } + + // printf("Live names\n"); + // for (TNameToIndex::const_iterator it = nameToIndex.begin(); it != nameToIndex.end(); ++it) + // printf("%s: %d\n", it->first.c_str(), it->second); + // printf("\n"); +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/reflection.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/reflection.h new file mode 100644 index 0000000000..984433039e --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/reflection.h @@ -0,0 +1,228 @@ +// +// Copyright (C) 2013-2016 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef _REFLECTION_INCLUDED +#define _REFLECTION_INCLUDED + +#include "../Public/ShaderLang.h" +#include "../Include/BaseTypes.h" +#include "../Include/visibility.h" +#include +#include + +// +// A reflection database and its interface, consistent with the OpenGL API reflection queries. +// + +namespace QtShaderTools { +namespace glslang { + +class TIntermediate; +class TIntermAggregate; +class TReflectionTraverser; + +// The full reflection database +class TReflection { +public: + TReflection(EShReflectionOptions opts, EShLanguage first, EShLanguage last) + : options(opts), firstStage(first), lastStage(last), badReflection(TObjectReflection::badReflection()) + { + for (int dim=0; dim<3; ++dim) { + localSize[dim] = 0; + tileShadingRateQCOM[dim] = 0; + } + } + + virtual ~TReflection() {} + + // grow the reflection stage by stage + GLSLANG_EXPORT_FOR_TESTS + bool addStage(EShLanguage, const TIntermediate&); + + // for mapping a uniform index to a uniform object's description + int getNumUniforms() { return (int)indexToUniform.size(); } + const TObjectReflection& getUniform(int i) const + { + if (i >= 0 && i < (int)indexToUniform.size()) + return indexToUniform[i]; + else + return badReflection; + } + + // for mapping a block index to the block's description + int getNumUniformBlocks() const { return (int)indexToUniformBlock.size(); } + const TObjectReflection& getUniformBlock(int i) const + { + if (i >= 0 && i < (int)indexToUniformBlock.size()) + return indexToUniformBlock[i]; + else + return badReflection; + } + + // for mapping an pipeline input index to the input's description + int getNumPipeInputs() { return (int)indexToPipeInput.size(); } + const TObjectReflection& getPipeInput(int i) const + { + if (i >= 0 && i < (int)indexToPipeInput.size()) + return indexToPipeInput[i]; + else + return badReflection; + } + + // for mapping an pipeline output index to the output's description + int getNumPipeOutputs() { return (int)indexToPipeOutput.size(); } + const TObjectReflection& getPipeOutput(int i) const + { + if (i >= 0 && i < (int)indexToPipeOutput.size()) + return indexToPipeOutput[i]; + else + return badReflection; + } + + // for mapping from an atomic counter to the uniform index + int getNumAtomicCounters() const { return (int)atomicCounterUniformIndices.size(); } + const TObjectReflection& getAtomicCounter(int i) const + { + if (i >= 0 && i < (int)atomicCounterUniformIndices.size()) + return getUniform(atomicCounterUniformIndices[i]); + else + return badReflection; + } + + // for mapping a buffer variable index to a buffer variable object's description + int getNumBufferVariables() { return (int)indexToBufferVariable.size(); } + const TObjectReflection& getBufferVariable(int i) const + { + if (i >= 0 && i < (int)indexToBufferVariable.size()) + return indexToBufferVariable[i]; + else + return badReflection; + } + + // for mapping a storage block index to the storage block's description + int getNumStorageBuffers() const { return (int)indexToBufferBlock.size(); } + const TObjectReflection& getStorageBufferBlock(int i) const + { + if (i >= 0 && i < (int)indexToBufferBlock.size()) + return indexToBufferBlock[i]; + else + return badReflection; + } + + // for mapping any name to its index (block names, uniform names and input/output names) + int getIndex(const char* name) const + { + TNameToIndex::const_iterator it = nameToIndex.find(name); + if (it == nameToIndex.end()) + return -1; + else + return it->second; + } + + // see getIndex(const char*) + int getIndex(const TString& name) const { return getIndex(name.c_str()); } + + + // for mapping any name to its index (only pipe input/output names) + int getPipeIOIndex(const char* name, const bool inOrOut) const + { + TNameToIndex::const_iterator it = inOrOut ? pipeInNameToIndex.find(name) : pipeOutNameToIndex.find(name); + if (it == (inOrOut ? pipeInNameToIndex.end() : pipeOutNameToIndex.end())) + return -1; + else + return it->second; + } + + // see gePipeIOIndex(const char*, const bool) + int getPipeIOIndex(const TString& name, const bool inOrOut) const { return getPipeIOIndex(name.c_str(), inOrOut); } + + // Thread local size + unsigned getLocalSize(int dim) const { return dim <= 2 ? localSize[dim] : 0; } + + // Tile shading rate QCOM + unsigned getTileShadingRateQCOM(int dim) const { return dim <= 2 ? tileShadingRateQCOM[dim] : 0; } + + void dump(); + +protected: + friend class glslang::TReflectionTraverser; + + void buildCounterIndices(const TIntermediate&); + void buildUniformStageMask(const TIntermediate& intermediate); + void buildAttributeReflection(EShLanguage, const TIntermediate&); + + // Need a TString hash: typedef std::unordered_map TNameToIndex; + typedef std::map TNameToIndex; + typedef std::vector TMapIndexToReflection; + typedef std::vector TIndices; + + TMapIndexToReflection& GetBlockMapForStorage(TStorageQualifier storage) + { + if ((options & EShReflectionSeparateBuffers) && storage == EvqBuffer) + return indexToBufferBlock; + return indexToUniformBlock; + } + TMapIndexToReflection& GetVariableMapForStorage(TStorageQualifier storage) + { + if ((options & EShReflectionSeparateBuffers) && storage == EvqBuffer) + return indexToBufferVariable; + return indexToUniform; + } + + EShReflectionOptions options; + + EShLanguage firstStage; + EShLanguage lastStage; + + TObjectReflection badReflection; // return for queries of -1 or generally out of range; has expected descriptions with in it for this + TNameToIndex nameToIndex; // maps names to indexes; can hold all types of data: uniform/buffer and which function names have been processed + TNameToIndex pipeInNameToIndex; // maps pipe in names to indexes, this is a fix to seperate pipe I/O from uniforms and buffers. + TNameToIndex pipeOutNameToIndex; // maps pipe out names to indexes, this is a fix to seperate pipe I/O from uniforms and buffers. + TMapIndexToReflection indexToUniform; + TMapIndexToReflection indexToUniformBlock; + TMapIndexToReflection indexToBufferVariable; + TMapIndexToReflection indexToBufferBlock; + TMapIndexToReflection indexToPipeInput; + TMapIndexToReflection indexToPipeOutput; + TIndices atomicCounterUniformIndices; + + unsigned int localSize[3]; + unsigned int tileShadingRateQCOM[3]; +}; + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // _REFLECTION_INCLUDED diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/span.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/span.h new file mode 100644 index 0000000000..bd705fead1 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/MachineIndependent/span.h @@ -0,0 +1,92 @@ +#pragma once + +// +// Copyright (C) 2023 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// Partial implementation of std::span for C++11 +// Replace with std::span if repo standard is bumped to C++20 +// +// This code was copied from https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/main/layers/containers/custom_containers.h +template +class span { + public: + using pointer = T *; + using const_pointer = T const *; + using iterator = pointer; + using const_iterator = const_pointer; + + span() = default; + span(pointer start, size_t n) : data_(start), count_(n) {} + template + span(Iterator start, Iterator end) : data_(&(*start)), count_(end - start) {} + template + span(Container &c) : data_(c.data()), count_(c.size()) {} + + iterator begin() { return data_; } + const_iterator begin() const { return data_; } + + iterator end() { return data_ + count_; } + const_iterator end() const { return data_ + count_; } + + T &operator[](int i) { return data_[i]; } + const T &operator[](int i) const { return data_[i]; } + + T &front() { return *data_; } + const T &front() const { return *data_; } + + T &back() { return *(data_ + (count_ - 1)); } + const T &back() const { return *(data_ + (count_ - 1)); } + + size_t size() const { return count_; } + bool empty() const { return count_ == 0; } + + pointer data() { return data_; } + const_pointer data() const { return data_; } + + private: + pointer data_ = {}; + size_t count_ = 0; +}; + +// +// Allow type inference that using the constructor doesn't allow in C++11 +template +span make_span(T *begin, size_t count) { + return span(begin, count); +} +template +span make_span(T *begin, T *end) { + return make_span(begin, end); +} diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp new file mode 100644 index 0000000000..a18b5cb9a5 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp @@ -0,0 +1,64 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// +// This file contains the Linux-specific functions +// +#include "../osinclude.h" + +#include + +#if !defined(__Fuchsia__) && !defined(__ghs__) +#include +#endif + +namespace QtShaderTools { +namespace glslang { + +// #define DUMP_COUNTERS + +void OS_DumpMemoryCounters() +{ +#ifdef DUMP_COUNTERS + struct rusage usage; + + if (getrusage(RUSAGE_SELF, &usage) == 0) + printf("Working set size: %ld\n", usage.ru_maxrss * 1024); +#else + printf("Recompile with DUMP_COUNTERS defined to see counters.\n"); +#endif +} + +} // end namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/OSDependent/Windows/main.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/OSDependent/Windows/main.cpp new file mode 100644 index 0000000000..0bcde7b660 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/OSDependent/Windows/main.cpp @@ -0,0 +1,74 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "InitializeDll.h" + +#define STRICT +#define VC_EXTRALEAN 1 +#include +#include + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + switch (fdwReason) + { + case DLL_PROCESS_ATTACH: + + if (! glslang::InitProcess()) + return FALSE; + break; + case DLL_THREAD_ATTACH: + + if (! glslang::InitThread()) + return FALSE; + break; + + case DLL_THREAD_DETACH: + + if (! glslang::DetachThread()) + return FALSE; + break; + + case DLL_PROCESS_DETACH: + + glslang::DetachProcess(); + break; + + default: + assert(0 && "DllMain(): Reason for calling DLL Main is unknown"); + return FALSE; + } + + return TRUE; +} diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp new file mode 100644 index 0000000000..b4fe844100 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp @@ -0,0 +1,69 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "../osinclude.h" + +#define STRICT +#define VC_EXTRALEAN 1 +#include +#include +#include +#include + +// +// This file contains the Window-OS-specific functions +// + +#if !(defined(_WIN32) || defined(_WIN64)) +#error Trying to build a windows specific file in a non windows build. +#endif + +namespace QtShaderTools { +namespace glslang { + +//#define DUMP_COUNTERS + +void OS_DumpMemoryCounters() +{ +#ifdef DUMP_COUNTERS + PROCESS_MEMORY_COUNTERS counters; + GetProcessMemoryInfo(GetCurrentProcess(), &counters, sizeof(counters)); + printf("Working set size: %d\n", counters.WorkingSetSize); +#else + printf("Recompile with DUMP_COUNTERS defined to see counters.\n"); +#endif +} + +} // namespace glslang +} // namespace QtShaderTools diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/OSDependent/osinclude.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/OSDependent/osinclude.h new file mode 100644 index 0000000000..2d5d8c9dd6 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/OSDependent/osinclude.h @@ -0,0 +1,47 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef __OSINCLUDE_H +#define __OSINCLUDE_H + +#include "../Include/visibility.h" +namespace QtShaderTools { +namespace glslang { + +GLSLANG_EXPORT void OS_DumpMemoryCounters(); + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // __OSINCLUDE_H diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Public/ResourceLimits.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Public/ResourceLimits.h new file mode 100644 index 0000000000..3dba0cb83b --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Public/ResourceLimits.h @@ -0,0 +1,62 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_ +#define _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_ + +#include + +#include "../Include/ResourceLimits.h" +#include "../Include/visibility.h" + +namespace QtShaderTools { + +// Return pointer to user-writable Resource to pass through API in +// future-proof way. +GLSLANG_EXPORT extern TBuiltInResource* GetResources(); + +// These are the default resources for TBuiltInResources, used for both +// - parsing this string for the case where the user didn't supply one, +// - dumping out a template for user construction of a config file. +GLSLANG_EXPORT extern const TBuiltInResource* GetDefaultResources(); + +// Returns the DefaultTBuiltInResource as a human-readable string. +GLSLANG_EXPORT std::string GetDefaultTBuiltInResourceString(); + +// Decodes the resource limits from |config| to |resources|. +GLSLANG_EXPORT void DecodeResourceLimits(TBuiltInResource* resources, char* config); + +} + +#endif // _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Public/ShaderLang.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Public/ShaderLang.h new file mode 100755 index 0000000000..8dad2258ae --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Public/ShaderLang.h @@ -0,0 +1,1024 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013-2016 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +#ifndef _COMPILER_INTERFACE_INCLUDED_ +#define _COMPILER_INTERFACE_INCLUDED_ + +#include "../Include/ResourceLimits.h" +#include "../Include/visibility.h" +#include "../MachineIndependent/Versions.h" + +#include +#include + +#ifdef _WIN32 + #define C_DECL __cdecl +#else + #define C_DECL +#endif + +// +// This is the platform independent interface between an OGL driver +// and the shading language compiler/linker. +// + +#ifdef __cplusplus + extern "C" { +#endif + +// +// Call before doing any other compiler/linker operations. +// +// (Call once per process, not once per thread.) +// +GLSLANG_EXPORT int ShInitialize_Qt(); + +// +// Call this at process shutdown to clean up memory. +// +GLSLANG_EXPORT int ShFinalize_Qt(); + +// +// Types of languages the compiler can consume. +// +typedef enum { + EShLangVertex, + EShLangTessControl, + EShLangTessEvaluation, + EShLangGeometry, + EShLangFragment, + EShLangCompute, + EShLangRayGen, + EShLangRayGenNV = EShLangRayGen, + EShLangIntersect, + EShLangIntersectNV = EShLangIntersect, + EShLangAnyHit, + EShLangAnyHitNV = EShLangAnyHit, + EShLangClosestHit, + EShLangClosestHitNV = EShLangClosestHit, + EShLangMiss, + EShLangMissNV = EShLangMiss, + EShLangCallable, + EShLangCallableNV = EShLangCallable, + EShLangTask, + EShLangTaskNV = EShLangTask, + EShLangMesh, + EShLangMeshNV = EShLangMesh, + LAST_ELEMENT_MARKER(EShLangCount), +} EShLanguage; // would be better as stage, but this is ancient now + +typedef enum : unsigned { + EShLangVertexMask = (1 << EShLangVertex), + EShLangTessControlMask = (1 << EShLangTessControl), + EShLangTessEvaluationMask = (1 << EShLangTessEvaluation), + EShLangGeometryMask = (1 << EShLangGeometry), + EShLangFragmentMask = (1 << EShLangFragment), + EShLangComputeMask = (1 << EShLangCompute), + EShLangRayGenMask = (1 << EShLangRayGen), + EShLangRayGenNVMask = EShLangRayGenMask, + EShLangIntersectMask = (1 << EShLangIntersect), + EShLangIntersectNVMask = EShLangIntersectMask, + EShLangAnyHitMask = (1 << EShLangAnyHit), + EShLangAnyHitNVMask = EShLangAnyHitMask, + EShLangClosestHitMask = (1 << EShLangClosestHit), + EShLangClosestHitNVMask = EShLangClosestHitMask, + EShLangMissMask = (1 << EShLangMiss), + EShLangMissNVMask = EShLangMissMask, + EShLangCallableMask = (1 << EShLangCallable), + EShLangCallableNVMask = EShLangCallableMask, + EShLangTaskMask = (1 << EShLangTask), + EShLangTaskNVMask = EShLangTaskMask, + EShLangMeshMask = (1 << EShLangMesh), + EShLangMeshNVMask = EShLangMeshMask, + LAST_ELEMENT_MARKER(EShLanguageMaskCount), +} EShLanguageMask; + +#ifdef __cplusplus + } +#endif + +namespace QtShaderTools { +namespace glslang { + +class TType; + +typedef enum { + EShSourceNone, + EShSourceGlsl, // GLSL, includes ESSL (OpenGL ES GLSL) + EShSourceHlsl, // HLSL + LAST_ELEMENT_MARKER(EShSourceCount), +} EShSource; // if EShLanguage were EShStage, this could be EShLanguage instead + +typedef enum { + EShClientNone, // use when there is no client, e.g. for validation + EShClientVulkan, // as GLSL dialect, specifies KHR_vulkan_glsl extension + EShClientOpenGL, // as GLSL dialect, specifies ARB_gl_spirv extension + LAST_ELEMENT_MARKER(EShClientCount), +} EShClient; + +typedef enum { + EShTargetNone, + EShTargetSpv, // SPIR-V (preferred spelling) + EshTargetSpv = EShTargetSpv, // legacy spelling + LAST_ELEMENT_MARKER(EShTargetCount), +} EShTargetLanguage; + +typedef enum { + EShTargetVulkan_1_0 = (1 << 22), // Vulkan 1.0 + EShTargetVulkan_1_1 = (1 << 22) | (1 << 12), // Vulkan 1.1 + EShTargetVulkan_1_2 = (1 << 22) | (2 << 12), // Vulkan 1.2 + EShTargetVulkan_1_3 = (1 << 22) | (3 << 12), // Vulkan 1.3 + EShTargetVulkan_1_4 = (1 << 22) | (4 << 12), // Vulkan 1.4 + EShTargetOpenGL_450 = 450, // OpenGL + LAST_ELEMENT_MARKER(EShTargetClientVersionCount = 6), +} EShTargetClientVersion; + +typedef EShTargetClientVersion EshTargetClientVersion; + +typedef enum { + EShTargetSpv_1_0 = (1 << 16), // SPIR-V 1.0 + EShTargetSpv_1_1 = (1 << 16) | (1 << 8), // SPIR-V 1.1 + EShTargetSpv_1_2 = (1 << 16) | (2 << 8), // SPIR-V 1.2 + EShTargetSpv_1_3 = (1 << 16) | (3 << 8), // SPIR-V 1.3 + EShTargetSpv_1_4 = (1 << 16) | (4 << 8), // SPIR-V 1.4 + EShTargetSpv_1_5 = (1 << 16) | (5 << 8), // SPIR-V 1.5 + EShTargetSpv_1_6 = (1 << 16) | (6 << 8), // SPIR-V 1.6 + LAST_ELEMENT_MARKER(EShTargetLanguageVersionCount = 7), +} EShTargetLanguageVersion; + +// +// Following are a series of helper enums for managing layouts and qualifiers, +// used for TPublicType, TType, others. +// + +enum TLayoutPacking { + ElpNone, + ElpShared, // default, but different than saying nothing + ElpStd140, + ElpStd430, + ElpPacked, + ElpScalar, + ElpCount // If expanding, see bitfield width below +}; + +struct TInputLanguage { + EShSource languageFamily; // redundant information with other input, this one overrides when not EShSourceNone + EShLanguage stage; // redundant information with other input, this one overrides when not EShSourceNone + EShClient dialect; + int dialectVersion; // version of client's language definition, not the client (when not EShClientNone) + bool vulkanRulesRelaxed; +}; + +struct TClient { + EShClient client; + EShTargetClientVersion version; // version of client itself (not the client's input dialect) +}; + +struct TTarget { + EShTargetLanguage language; + EShTargetLanguageVersion version; // version to target, if SPIR-V, defined by "word 1" of the SPIR-V header + bool hlslFunctionality1; // can target hlsl_functionality1 extension(s) +}; + +// All source/client/target versions and settings. +// Can override previous methods of setting, when items are set here. +// Expected to grow, as more are added, rather than growing parameter lists. +struct TEnvironment { + TInputLanguage input; // definition of the input language + TClient client; // what client is the overall compilation being done for? + TTarget target; // what to generate +}; + +GLSLANG_EXPORT const char* StageName(EShLanguage); + +} // end namespace glslang +} // namespace QtShaderTools + +#ifdef __cplusplus + extern "C" { +#endif + +// +// Types of output the linker will create. +// +typedef enum { + EShExVertexFragment, + EShExFragment +} EShExecutable; + +// +// Optimization level for the compiler. +// +typedef enum { + EShOptNoGeneration, + EShOptNone, + EShOptSimple, // Optimizations that can be done quickly + EShOptFull, // Optimizations that will take more time + LAST_ELEMENT_MARKER(EshOptLevelCount), +} EShOptimizationLevel; + +// +// Texture and Sampler transformation mode. +// +typedef enum { + EShTexSampTransKeep, // keep textures and samplers as is (default) + EShTexSampTransUpgradeTextureRemoveSampler, // change texture w/o embeded sampler into sampled texture and throw away all samplers + LAST_ELEMENT_MARKER(EShTexSampTransCount), +} EShTextureSamplerTransformMode; + +// +// Message choices for what errors and warnings are given. +// +enum EShMessages : unsigned { + EShMsgDefault = 0, // default is to give all required errors and extra warnings + EShMsgRelaxedErrors = (1 << 0), // be liberal in accepting input + EShMsgSuppressWarnings = (1 << 1), // suppress all warnings, except those required by the specification + EShMsgAST = (1 << 2), // print the AST intermediate representation + EShMsgSpvRules = (1 << 3), // issue messages for SPIR-V generation + EShMsgVulkanRules = (1 << 4), // issue messages for Vulkan-requirements of GLSL for SPIR-V + EShMsgOnlyPreprocessor = (1 << 5), // only print out errors produced by the preprocessor + EShMsgReadHlsl = (1 << 6), // use HLSL parsing rules and semantics + EShMsgCascadingErrors = (1 << 7), // get cascading errors; risks error-recovery issues, instead of an early exit + EShMsgKeepUncalled = (1 << 8), // for testing, don't eliminate uncalled functions + EShMsgHlslOffsets = (1 << 9), // allow block offsets to follow HLSL rules instead of GLSL rules + EShMsgDebugInfo = (1 << 10), // save debug information + EShMsgHlslEnable16BitTypes = (1 << 11), // enable use of 16-bit types in SPIR-V for HLSL + EShMsgHlslLegalization = (1 << 12), // enable HLSL Legalization messages + EShMsgHlslDX9Compatible = (1 << 13), // enable HLSL DX9 compatible mode (for samplers and semantics) + EShMsgBuiltinSymbolTable = (1 << 14), // print the builtin symbol table + EShMsgEnhanced = (1 << 15), // enhanced message readability + EShMsgAbsolutePath = (1 << 16), // Output Absolute path for messages + EShMsgDisplayErrorColumn = (1 << 17), // Display error message column aswell as line + EShMsgLinkTimeOptimization = (1 << 18), // perform cross-stage optimizations during linking + EShMsgValidateCrossStageIO = (1 << 19), // validate shader inputs have matching outputs in previous stage + LAST_ELEMENT_MARKER(EShMsgCount), +}; + +// +// Options for building reflection +// +typedef enum { + EShReflectionDefault = 0, // default is original behaviour before options were added + EShReflectionStrictArraySuffix = (1 << 0), // reflection will follow stricter rules for array-of-structs suffixes + EShReflectionBasicArraySuffix = (1 << 1), // arrays of basic types will be appended with [0] as in GL reflection + EShReflectionIntermediateIO = (1 << 2), // reflect inputs and outputs to program, even with no vertex shader + EShReflectionSeparateBuffers = (1 << 3), // buffer variables and buffer blocks are reflected separately + EShReflectionAllBlockVariables = (1 << 4), // reflect all variables in blocks, even if they are inactive + EShReflectionUnwrapIOBlocks = (1 << 5), // unwrap input/output blocks the same as with uniform blocks + EShReflectionAllIOVariables = (1 << 6), // reflect all input/output variables, even if they are inactive + EShReflectionSharedStd140SSBO = (1 << 7), // Apply std140/shared rules for ubo to ssbo + EShReflectionSharedStd140UBO = (1 << 8), // Apply std140/shared rules for ubo to ssbo + LAST_ELEMENT_MARKER(EShReflectionCount), +} EShReflectionOptions; + +// +// Build a table for bindings. This can be used for locating +// attributes, uniforms, globals, etc., as needed. +// +typedef struct { + const char* name; + int binding; +} ShBinding; + +typedef struct { + int numBindings; + ShBinding* bindings; // array of bindings +} ShBindingTable; + +// +// ShHandle held by but opaque to the driver. It is allocated, +// managed, and de-allocated by the compiler/linker. Its contents +// are defined by and used by the compiler and linker. For example, +// symbol table information and object code passed from the compiler +// to the linker can be stored where ShHandle points. +// +// If handle creation fails, 0 will be returned. +// +typedef void* ShHandle; + +// +// Driver calls these to create and destroy compiler/linker +// objects. +// +GLSLANG_EXPORT ShHandle ShConstructCompiler_Qt(const EShLanguage, int /*debugOptions unused*/); // one per shader +GLSLANG_EXPORT ShHandle ShConstructLinker_Qt(const EShExecutable, int /*debugOptions unused*/); // one per shader pair +GLSLANG_EXPORT ShHandle ShConstructUniformMap_Qt(); // one per uniform namespace (currently entire program object) +GLSLANG_EXPORT void ShDestruct_Qt(ShHandle); + +// +// The return value of ShCompile is boolean, non-zero indicating +// success. +// +// The info-log should be written by ShCompile into +// ShHandle, so it can answer future queries. +// +GLSLANG_EXPORT int ShCompile_Qt(const ShHandle, const char* const shaderStrings[], const int numStrings, + const int* lengths, const EShOptimizationLevel, const TBuiltInResource* resources, + int, // debugOptions unused + int defaultVersion = 110, // use 100 for ES environment, overridden by #version in shader + bool forwardCompatible = false, // give errors for use of deprecated features + EShMessages messages = EShMsgDefault, // warnings and errors + const char* fileName = nullptr +); + +GLSLANG_EXPORT int ShLinkExt_Qt( + const ShHandle, // linker object + const ShHandle h[], // compiler objects to link together + const int numHandles); + +// +// ShSetEncrpytionMethod is a place-holder for specifying +// how source code is encrypted. +// +GLSLANG_EXPORT void ShSetEncryptionMethod_Qt(ShHandle); + +// +// All the following return 0 if the information is not +// available in the object passed down, or the object is bad. +// +GLSLANG_EXPORT const char* ShGetInfoLog_Qt(const ShHandle); +GLSLANG_EXPORT const void* ShGetExecutable_Qt(const ShHandle); +GLSLANG_EXPORT int ShSetVirtualAttributeBindings_Qt(const ShHandle, const ShBindingTable*); // to detect user aliasing +GLSLANG_EXPORT int ShSetFixedAttributeBindings_Qt(const ShHandle, const ShBindingTable*); // to force any physical mappings +// +// Tell the linker to never assign a vertex attribute to this list of physical attributes +// +GLSLANG_EXPORT int ShExcludeAttributes_Qt(const ShHandle, int *attributes, int count); + +// +// Returns the location ID of the named uniform. +// Returns -1 if error. +// +GLSLANG_EXPORT int ShGetUniformLocation_Qt(const ShHandle uniformMap, const char* name); + +#ifdef __cplusplus + } // end extern "C" +#endif + +//////////////////////////////////////////////////////////////////////////////////////////// +// +// Deferred-Lowering C++ Interface +// ----------------------------------- +// +// Below is a new alternate C++ interface, which deprecates the above +// opaque handle-based interface. +// +// The below is further designed to handle multiple compilation units per stage, where +// the intermediate results, including the parse tree, are preserved until link time, +// rather than the above interface which is designed to have each compilation unit +// lowered at compile time. In the above model, linking occurs on the lowered results, +// whereas in this model intra-stage linking can occur at the parse tree +// (treeRoot in TIntermediate) level, and then a full stage can be lowered. +// + +#include +#include +#include + +namespace QtShaderTools { +class TCompiler; +class TInfoSink; + +namespace glslang { + +struct Version { + int major; + int minor; + int patch; + const char* flavor; +}; + +GLSLANG_EXPORT Version GetVersion(); +GLSLANG_EXPORT const char* GetEsslVersionString(); +GLSLANG_EXPORT const char* GetGlslVersionString(); +GLSLANG_EXPORT int GetKhronosToolId(); + +class TIntermediate; +class TProgram; +class TPoolAllocator; +class TIoMapResolver; + +// Call this exactly once per process before using anything else +GLSLANG_EXPORT bool InitializeProcess(); + +// Call once per process to tear down everything +GLSLANG_EXPORT void FinalizeProcess(); + +// Resource type for IO resolver +enum TResourceType { + EResSampler, + EResTexture, + EResImage, + EResUbo, + EResSsbo, + EResUav, + EResCombinedSampler, + EResAs, + EResTensor, + EResCount +}; + +enum TBlockStorageClass +{ + EbsUniform = 0, + EbsStorageBuffer, + EbsPushConstant, + EbsNone, // not a uniform or buffer variable + EbsCount, +}; + +// Make one TShader per shader that you will link into a program. Then +// - provide the shader through setStrings() or setStringsWithLengths() +// - optionally call setEnv*(), see below for more detail +// - optionally use setPreamble() to set a special shader string that will be +// processed before all others but won't affect the validity of #version +// - optionally call addProcesses() for each setting/transform, +// see comment for class TProcesses +// - call parse(): source language and target environment must be selected +// either by correct setting of EShMessages sent to parse(), or by +// explicitly calling setEnv*() +// - query the info logs +// +// N.B.: Does not yet support having the same TShader instance being linked into +// multiple programs. +// +// N.B.: Destruct a linked program *before* destructing the shaders linked into it. +// +class GLSLANG_EXPORT TShader { +public: + explicit TShader(EShLanguage); + virtual ~TShader(); + void setStrings(const char* const* s, int n); + void setStringsWithLengths( + const char* const* s, const int* l, int n); + void setStringsWithLengthsAndNames( + const char* const* s, const int* l, const char* const* names, int n); + void setPreamble(const char* s) { preamble = s; } + void setEntryPoint(const char* entryPoint); + void setSourceEntryPoint(const char* sourceEntryPointName); + void addProcesses(const std::vector&); + void setUniqueId(unsigned long long id); + void setOverrideVersion(int version); + void setDebugInfo(bool debugInfo); + + // IO resolver binding data: see comments in ShaderLang.cpp + void setShiftBinding(TResourceType res, unsigned int base); + void setShiftSamplerBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftTextureBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftImageBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftUboBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftUavBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftCbufferBinding(unsigned int base); // synonym for setShiftUboBinding + void setShiftSsboBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftBindingForSet(TResourceType res, unsigned int base, unsigned int set); + void setResourceSetBinding(const std::vector& base); + void setAutoMapBindings(bool map); + void setAutoMapLocations(bool map); + void addUniformLocationOverride(const char* name, int loc); + void setUniformLocationBase(int base); + void setInvertY(bool invert); + void setDxPositionW(bool dxPosW); + void setEnhancedMsgs(); +#ifdef ENABLE_HLSL + void setHlslIoMapping(bool hlslIoMap); + void setFlattenUniformArrays(bool flatten); +#endif + void setNoStorageFormat(bool useUnknownFormat); + void setNanMinMaxClamp(bool nanMinMaxClamp); + void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode); + void addBlockStorageOverride(const char* nameStr, glslang::TBlockStorageClass backing); + + void setGlobalUniformBlockName(const char* name); + void setAtomicCounterBlockName(const char* name); + void setGlobalUniformSet(unsigned int set); + void setGlobalUniformBinding(unsigned int binding); + void setAtomicCounterBlockSet(unsigned int set); + void setAtomicCounterBlockBinding(unsigned int binding); + + void addSourceText(const char* text, size_t len); + void setSourceFile(const char* file); + + // For setting up the environment (cleared to nothingness in the constructor). + // These must be called so that parsing is done for the right source language and + // target environment, either indirectly through TranslateEnvironment() based on + // EShMessages et. al., or directly by the user. + // + // setEnvInput: The input source language and stage. If generating code for a + // specific client, the input client semantics to use and the + // version of that client's input semantics to use, otherwise + // use EShClientNone and version of 0, e.g. for validation mode. + // Note 'version' does not describe the target environment, + // just the version of the source dialect to compile under. + // For example, to choose the Vulkan dialect of GLSL defined by + // version 100 of the KHR_vulkan_glsl extension: lang = EShSourceGlsl, + // dialect = EShClientVulkan, and version = 100. + // + // See the definitions of TEnvironment, EShSource, EShLanguage, + // and EShClient for choices and more detail. + // + // setEnvClient: The client that will be hosting the execution, and its version. + // Note 'version' is not the version of the languages involved, but + // the version of the client environment. + // Use EShClientNone and version of 0 if there is no client, e.g. + // for validation mode. + // + // See EShTargetClientVersion for choices. + // + // setEnvTarget: The language to translate to when generating code, and that + // language's version. + // Use EShTargetNone and version of 0 if there is no client, e.g. + // for validation mode. + // + void setEnvInput(EShSource lang, EShLanguage envStage, EShClient client, int version) + { + environment.input.languageFamily = lang; + environment.input.stage = envStage; + environment.input.dialect = client; + environment.input.dialectVersion = version; + } + void setEnvClient(EShClient client, EShTargetClientVersion version) + { + environment.client.client = client; + environment.client.version = version; + } + void setEnvTarget(EShTargetLanguage lang, EShTargetLanguageVersion version) + { + environment.target.language = lang; + environment.target.version = version; + } + + void getStrings(const char* const* &s, int& n) { s = strings; n = numStrings; } + +#ifdef ENABLE_HLSL + void setEnvTargetHlslFunctionality1() { environment.target.hlslFunctionality1 = true; } + bool getEnvTargetHlslFunctionality1() const { return environment.target.hlslFunctionality1; } +#else + bool getEnvTargetHlslFunctionality1() const { return false; } +#endif + + void setEnvInputVulkanRulesRelaxed() { environment.input.vulkanRulesRelaxed = true; } + bool getEnvInputVulkanRulesRelaxed() const { return environment.input.vulkanRulesRelaxed; } + + void setCompileOnly() { compileOnly = true; } + bool getCompileOnly() const { return compileOnly; } + + // Interface to #include handlers. + // + // To support #include, a client of Glslang does the following: + // 1. Call setStringsWithNames to set the source strings and associated + // names. For example, the names could be the names of the files + // containing the shader sources. + // 2. Call parse with an Includer. + // + // When the Glslang parser encounters an #include directive, it calls + // the Includer's include method with the requested include name + // together with the current string name. The returned IncludeResult + // contains the fully resolved name of the included source, together + // with the source text that should replace the #include directive + // in the source stream. After parsing that source, Glslang will + // release the IncludeResult object. + class Includer { + public: + // An IncludeResult contains the resolved name and content of a source + // inclusion. + struct IncludeResult { + IncludeResult(const std::string& headerName, const char* const headerData, const size_t headerLength, void* userData) : + headerName(headerName), headerData(headerData), headerLength(headerLength), userData(userData) { } + // For a successful inclusion, the fully resolved name of the requested + // include. For example, in a file system-based includer, full resolution + // should convert a relative path name into an absolute path name. + // For a failed inclusion, this is an empty string. + const std::string headerName; + // The content and byte length of the requested inclusion. The + // Includer producing this IncludeResult retains ownership of the + // storage. + // For a failed inclusion, the header + // field points to a string containing error details. + const char* const headerData; + const size_t headerLength; + // Include resolver's context. + void* userData; + protected: + IncludeResult& operator=(const IncludeResult&); + IncludeResult(); + }; + + // For both include methods below: + // + // Resolves an inclusion request by name, current source name, + // and include depth. + // On success, returns an IncludeResult containing the resolved name + // and content of the include. + // On failure, returns a nullptr, or an IncludeResult + // with an empty string for the headerName and error details in the + // header field. + // The Includer retains ownership of the contents + // of the returned IncludeResult value, and those contents must + // remain valid until the releaseInclude method is called on that + // IncludeResult object. + // + // Note "local" vs. "system" is not an "either/or": "local" is an + // extra thing to do over "system". Both might get called, as per + // the C++ specification. + + // For the "system" or <>-style includes; search the "system" paths. + virtual IncludeResult* includeSystem(const char* /*headerName*/, + const char* /*includerName*/, + size_t /*inclusionDepth*/) { return nullptr; } + + // For the "local"-only aspect of a "" include. Should not search in the + // "system" paths, because on returning a failure, the parser will + // call includeSystem() to look in the "system" locations. + virtual IncludeResult* includeLocal(const char* /*headerName*/, + const char* /*includerName*/, + size_t /*inclusionDepth*/) { return nullptr; } + + // Signals that the parser will no longer use the contents of the + // specified IncludeResult. + virtual void releaseInclude(IncludeResult*) = 0; + virtual ~Includer() {} + }; + + // Fail all Includer searches + class ForbidIncluder : public Includer { + public: + virtual void releaseInclude(IncludeResult*) override { } + }; + + bool parse( + const TBuiltInResource*, int defaultVersion, EProfile defaultProfile, + bool forceDefaultVersionAndProfile, bool forwardCompatible, + EShMessages, Includer&); + + bool parse(const TBuiltInResource* res, int defaultVersion, EProfile defaultProfile, bool forceDefaultVersionAndProfile, + bool forwardCompatible, EShMessages messages) + { + TShader::ForbidIncluder includer; + return parse(res, defaultVersion, defaultProfile, forceDefaultVersionAndProfile, forwardCompatible, messages, includer); + } + + // Equivalent to parse() without a default profile and without forcing defaults. + bool parse(const TBuiltInResource* builtInResources, int defaultVersion, bool forwardCompatible, EShMessages messages) + { + return parse(builtInResources, defaultVersion, ENoProfile, false, forwardCompatible, messages); + } + + bool parse(const TBuiltInResource* builtInResources, int defaultVersion, bool forwardCompatible, EShMessages messages, + Includer& includer) + { + return parse(builtInResources, defaultVersion, ENoProfile, false, forwardCompatible, messages, includer); + } + + // NOTE: Doing just preprocessing to obtain a correct preprocessed shader string + // is not an officially supported or fully working path. + bool preprocess( + const TBuiltInResource* builtInResources, int defaultVersion, + EProfile defaultProfile, bool forceDefaultVersionAndProfile, + bool forwardCompatible, EShMessages message, std::string* outputString, + Includer& includer); + + const char* getInfoLog(); + const char* getInfoDebugLog(); + EShLanguage getStage() const { return stage; } + TIntermediate* getIntermediate() const { return intermediate; } + +protected: + TPoolAllocator* pool; + EShLanguage stage; + TCompiler* compiler; + TIntermediate* intermediate; + TInfoSink* infoSink; + // strings and lengths follow the standard for glShaderSource: + // strings is an array of numStrings pointers to string data. + // lengths can be null, but if not it is an array of numStrings + // integers containing the length of the associated strings. + // if lengths is null or lengths[n] < 0 the associated strings[n] is + // assumed to be null-terminated. + // stringNames is the optional names for all the strings. If stringNames + // is null, then none of the strings has name. If a certain element in + // stringNames is null, then the corresponding string does not have name. + const char* const* strings; // explicit code to compile, see previous comment + const int* lengths; + const char* const* stringNames; + int numStrings; // size of the above arrays + const char* preamble; // string of implicit code to compile before the explicitly provided code + + // a function in the source string can be renamed FROM this TO the name given in setEntryPoint. + std::string sourceEntryPointName; + + // overrides #version in shader source or default version if #version isn't present + int overrideVersion; + + TEnvironment environment; + + // Indicates this shader is meant to be used without linking + bool compileOnly = false; + + friend class TProgram; + +private: + TShader& operator=(TShader&); +}; + +// +// A reflection database and its interface, consistent with the OpenGL API reflection queries. +// + +// Data needed for just a single object at the granularity exchanged by the reflection API +class GLSLANG_EXPORT TObjectReflection { +public: + TObjectReflection(const std::string& pName, const TType& pType, int pOffset, int pGLDefineType, int pSize, int pIndex); + + const TType* getType() const { return type; } + int getBinding() const; + void dump() const; + static TObjectReflection badReflection() { return TObjectReflection(); } + + unsigned int layoutLocation() const; + + std::string name; + int offset; + int glDefineType; + int size; // data size in bytes for a block, array size for a (non-block) object that's an array + int index; + int counterIndex; + int numMembers; + int arrayStride; // stride of an array variable + int topLevelArraySize; // size of the top-level variable in a storage buffer member + int topLevelArrayStride; // stride of the top-level variable in a storage buffer member + EShLanguageMask stages; + +protected: + TObjectReflection() + : offset(-1), glDefineType(-1), size(-1), index(-1), counterIndex(-1), numMembers(-1), arrayStride(0), + topLevelArrayStride(0), stages(EShLanguageMask(0)), type(nullptr) + { + } + + const TType* type; +}; + +class TReflection; +class TIoMapper; +struct TVarEntryInfo; + +// Allows to customize the binding layout after linking. +// All used uniform variables will invoke at least validateBinding. +// If validateBinding returned true then the other resolveBinding, +// resolveSet, and resolveLocation are invoked to resolve the binding +// and descriptor set index respectively. +// +// Invocations happen in a particular order: +// 1) all shader inputs +// 2) all shader outputs +// 3) all uniforms with binding and set already defined +// 4) all uniforms with binding but no set defined +// 5) all uniforms with set but no binding defined +// 6) all uniforms with no binding and no set defined +// +// mapIO will use this resolver in two phases. The first +// phase is a notification phase, calling the corresponging +// notifiy callbacks, this phase ends with a call to endNotifications. +// Phase two starts directly after the call to endNotifications +// and calls all other callbacks to validate and to get the +// bindings, sets, locations, component and color indices. +// +// NOTE: that still limit checks are applied to bindings and sets +// and may result in an error. +class GLSLANG_EXPORT TIoMapResolver { +public: + virtual ~TIoMapResolver() {} + + // Should return true if the resulting/current binding would be okay. + // Basic idea is to do aliasing binding checks with this. + virtual bool validateBinding(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return a value >= 0 if the current binding should be overridden. + // Return -1 if the current binding (including no binding) should be kept. + virtual int resolveBinding(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return a value >= 0 if the current set should be overridden. + // Return -1 if the current set (including no set) should be kept. + virtual int resolveSet(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return a value >= 0 if the current location should be overridden. + // Return -1 if the current location (including no location) should be kept. + virtual int resolveUniformLocation(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return true if the resulting/current setup would be okay. + // Basic idea is to do aliasing checks and reject invalid semantic names. + virtual bool validateInOut(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return a value >= 0 if the current location should be overridden. + // Return -1 if the current location (including no location) should be kept. + virtual int resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return a value >= 0 if the current component index should be overridden. + // Return -1 if the current component index (including no index) should be kept. + virtual int resolveInOutComponent(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return a value >= 0 if the current color index should be overridden. + // Return -1 if the current color index (including no index) should be kept. + virtual int resolveInOutIndex(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Notification of a uniform variable + virtual void notifyBinding(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Notification of a in or out variable + virtual void notifyInOut(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Called by mapIO when it starts its notify pass for the given stage + virtual void beginNotifications(EShLanguage stage) = 0; + // Called by mapIO when it has finished the notify pass + virtual void endNotifications(EShLanguage stage) = 0; + // Called by mipIO when it starts its resolve pass for the given stage + virtual void beginResolve(EShLanguage stage) = 0; + // Called by mapIO when it has finished the resolve pass + virtual void endResolve(EShLanguage stage) = 0; + // Called by mapIO when it starts its symbol collect for teh given stage + virtual void beginCollect(EShLanguage stage) = 0; + // Called by mapIO when it has finished the symbol collect + virtual void endCollect(EShLanguage stage) = 0; + // Called by TSlotCollector to resolve storage locations or bindings + virtual void reserverStorageSlot(TVarEntryInfo& ent, TInfoSink& infoSink) = 0; + // Called by TSlotCollector to resolve resource locations or bindings + virtual void reserverResourceSlot(TVarEntryInfo& ent, TInfoSink& infoSink) = 0; + // Called by mapIO.addStage to set shader stage mask to mark a stage be added to this pipeline + virtual void addStage(EShLanguage stage, TIntermediate& stageIntermediate) = 0; +}; + +// I/O mapper +class TIoMapper { +public: + TIoMapper() {} + virtual ~TIoMapper() {} + // grow the reflection stage by stage + bool virtual addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*); + bool virtual doMap(TIoMapResolver*, TInfoSink&) { return true; } + bool virtual setAutoPushConstantBlock(const char*, unsigned int, TLayoutPacking) { return false; } +}; + +// Get the default GLSL IO mapper +GLSLANG_EXPORT TIoMapper* GetGlslIoMapper(); + +// Make one TProgram per set of shaders that will get linked together. Add all +// the shaders that are to be linked together. After calling shader.parse() +// for all shaders, call link(). +// +// N.B.: Destruct a linked program *before* destructing the shaders linked into it. +// +class GLSLANG_EXPORT TProgram { +public: + TProgram(); + virtual ~TProgram(); + void addShader(TShader* shader) { stages[shader->stage].push_back(shader); } + std::list& getShaders(EShLanguage stage) { return stages[stage]; } + // Link Validation interface + bool link(EShMessages); + const char* getInfoLog(); + const char* getInfoDebugLog(); + + TIntermediate* getIntermediate(EShLanguage stage) const { return intermediate[stage]; } + + // Reflection Interface + + // call first, to do liveness analysis, index mapping, etc.; returns false on failure + bool buildReflection(int opts = EShReflectionDefault); + unsigned getLocalSize(int dim) const; // return dim'th local size + unsigned getTileShadingRateQCOM(int dim) const; // return dim'th tile shading rate QCOM + int getReflectionIndex(const char *name) const; + int getReflectionPipeIOIndex(const char* name, const bool inOrOut) const; + int getNumUniformVariables() const; + const TObjectReflection& getUniform(int index) const; + int getNumUniformBlocks() const; + const TObjectReflection& getUniformBlock(int index) const; + int getNumPipeInputs() const; + const TObjectReflection& getPipeInput(int index) const; + int getNumPipeOutputs() const; + const TObjectReflection& getPipeOutput(int index) const; + int getNumBufferVariables() const; + const TObjectReflection& getBufferVariable(int index) const; + int getNumBufferBlocks() const; + const TObjectReflection& getBufferBlock(int index) const; + int getNumAtomicCounters() const; + const TObjectReflection& getAtomicCounter(int index) const; + + // Legacy Reflection Interface - expressed in terms of above interface + + // can be used for glGetProgramiv(GL_ACTIVE_UNIFORMS) + int getNumLiveUniformVariables() const { return getNumUniformVariables(); } + + // can be used for glGetProgramiv(GL_ACTIVE_UNIFORM_BLOCKS) + int getNumLiveUniformBlocks() const { return getNumUniformBlocks(); } + + // can be used for glGetProgramiv(GL_ACTIVE_ATTRIBUTES) + int getNumLiveAttributes() const { return getNumPipeInputs(); } + + // can be used for glGetUniformIndices() + int getUniformIndex(const char *name) const { return getReflectionIndex(name); } + + int getPipeIOIndex(const char *name, const bool inOrOut) const + { return getReflectionPipeIOIndex(name, inOrOut); } + + // can be used for "name" part of glGetActiveUniform() + const char *getUniformName(int index) const { return getUniform(index).name.c_str(); } + + // returns the binding number + int getUniformBinding(int index) const { return getUniform(index).getBinding(); } + + // returns Shaders Stages where a Uniform is present + EShLanguageMask getUniformStages(int index) const { return getUniform(index).stages; } + + // can be used for glGetActiveUniformsiv(GL_UNIFORM_BLOCK_INDEX) + int getUniformBlockIndex(int index) const { return getUniform(index).index; } + + // can be used for glGetActiveUniformsiv(GL_UNIFORM_TYPE) + int getUniformType(int index) const { return getUniform(index).glDefineType; } + + // can be used for glGetActiveUniformsiv(GL_UNIFORM_OFFSET) + int getUniformBufferOffset(int index) const { return getUniform(index).offset; } + + // can be used for glGetActiveUniformsiv(GL_UNIFORM_SIZE) + int getUniformArraySize(int index) const { return getUniform(index).size; } + + // returns a TType* + const TType *getUniformTType(int index) const { return getUniform(index).getType(); } + + // can be used for glGetActiveUniformBlockName() + const char *getUniformBlockName(int index) const { return getUniformBlock(index).name.c_str(); } + + // can be used for glGetActiveUniformBlockiv(UNIFORM_BLOCK_DATA_SIZE) + int getUniformBlockSize(int index) const { return getUniformBlock(index).size; } + + // returns the block binding number + int getUniformBlockBinding(int index) const { return getUniformBlock(index).getBinding(); } + + // returns block index of associated counter. + int getUniformBlockCounterIndex(int index) const { return getUniformBlock(index).counterIndex; } + + // returns a TType* + const TType *getUniformBlockTType(int index) const { return getUniformBlock(index).getType(); } + + // can be used for glGetActiveAttrib() + const char *getAttributeName(int index) const { return getPipeInput(index).name.c_str(); } + + // can be used for glGetActiveAttrib() + int getAttributeType(int index) const { return getPipeInput(index).glDefineType; } + + // returns a TType* + const TType *getAttributeTType(int index) const { return getPipeInput(index).getType(); } + + void dumpReflection(); + + // Get the IO resolver to use for mapIO + TIoMapResolver* getGlslIoResolver(EShLanguage stage); + + // I/O mapping: apply base offsets and map live unbound variables + // If resolver is not provided it uses the previous approach + // and respects auto assignment and offsets. + bool mapIO(TIoMapResolver* pResolver = nullptr, TIoMapper* pIoMapper = nullptr); + +protected: + bool linkStage(EShLanguage, EShMessages); + bool crossStageCheck(EShMessages); + + TPoolAllocator* pool; + std::list stages[EShLangCount]; + TIntermediate* intermediate[EShLangCount]; + bool newedIntermediate[EShLangCount]; // track which intermediate were "new" versus reusing a singleton unit in a stage + TInfoSink* infoSink; + TReflection* reflection; + bool linked; + +private: + TProgram(TProgram&); + TProgram& operator=(TProgram&); +}; + +} // end namespace glslang +} // namespace QtShaderTools + +#endif // _COMPILER_INTERFACE_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Public/resource_limits_c.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Public/resource_limits_c.h new file mode 100644 index 0000000000..4ad052b0ba --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/Public/resource_limits_c.h @@ -0,0 +1,58 @@ +/** +BSD 2-Clause License + +Copyright (c) 2020, Travis Fort +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +#ifndef _STAND_ALONE_RESOURCE_LIMITS_C_INCLUDED_ +#define _STAND_ALONE_RESOURCE_LIMITS_C_INCLUDED_ + +#include "../Include/glslang_c_interface.h" +#include "../Include/visibility.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// Returns a struct that can be use to create custom resource values. +GLSLANG_EXPORT glslang_resource_t* glslang_resource(void); + +// These are the default resources for TBuiltInResources, used for both +// - parsing this string for the case where the user didn't supply one, +// - dumping out a template for user construction of a config file. +GLSLANG_EXPORT const glslang_resource_t* glslang_default_resource(void); + +// Returns the DefaultTBuiltInResource as a human-readable string. +// NOTE: User is responsible for freeing this string. +GLSLANG_EXPORT const char* glslang_default_resource_string(void); + +// Decodes the resource limits from |config| to |resources|. +GLSLANG_EXPORT void glslang_decode_resource_limits(glslang_resource_t* resources, char* config); + +#ifdef __cplusplus +} +#endif + +#endif // _STAND_ALONE_RESOURCE_LIMITS_C_INCLUDED_ diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/ResourceLimits/ResourceLimits.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/ResourceLimits/ResourceLimits.cpp new file mode 100644 index 0000000000..a8b7bf69ec --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/ResourceLimits/ResourceLimits.cpp @@ -0,0 +1,546 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include +#include + +#include "glslang/Public/ResourceLimits.h" + +namespace QtShaderTools { +static TBuiltInResource Resources; + +static const TBuiltInResource DefaultTBuiltInResource = { + /* .MaxLights = */ 32, + /* .MaxClipPlanes = */ 6, + /* .MaxTextureUnits = */ 32, + /* .MaxTextureCoords = */ 32, + /* .MaxVertexAttribs = */ 64, + /* .MaxVertexUniformComponents = */ 4096, + /* .MaxVaryingFloats = */ 64, + /* .MaxVertexTextureImageUnits = */ 32, + /* .MaxCombinedTextureImageUnits = */ 80, + /* .MaxTextureImageUnits = */ 32, + /* .MaxFragmentUniformComponents = */ 4096, + /* .MaxDrawBuffers = */ 32, + /* .MaxVertexUniformVectors = */ 128, + /* .MaxVaryingVectors = */ 8, + /* .MaxFragmentUniformVectors = */ 16, + /* .MaxVertexOutputVectors = */ 16, + /* .MaxFragmentInputVectors = */ 15, + /* .MinProgramTexelOffset = */ -8, + /* .MaxProgramTexelOffset = */ 7, + /* .MaxClipDistances = */ 8, + /* .MaxComputeWorkGroupCountX = */ 65535, + /* .MaxComputeWorkGroupCountY = */ 65535, + /* .MaxComputeWorkGroupCountZ = */ 65535, + /* .MaxComputeWorkGroupSizeX = */ 1024, + /* .MaxComputeWorkGroupSizeY = */ 1024, + /* .MaxComputeWorkGroupSizeZ = */ 64, + /* .MaxComputeUniformComponents = */ 1024, + /* .MaxComputeTextureImageUnits = */ 16, + /* .MaxComputeImageUniforms = */ 8, + /* .MaxComputeAtomicCounters = */ 8, + /* .MaxComputeAtomicCounterBuffers = */ 1, + /* .MaxVaryingComponents = */ 60, + /* .MaxVertexOutputComponents = */ 64, + /* .MaxGeometryInputComponents = */ 64, + /* .MaxGeometryOutputComponents = */ 128, + /* .MaxFragmentInputComponents = */ 128, + /* .MaxImageUnits = */ 8, + /* .MaxCombinedImageUnitsAndFragmentOutputs = */ 8, + /* .MaxCombinedShaderOutputResources = */ 8, + /* .MaxImageSamples = */ 0, + /* .MaxVertexImageUniforms = */ 0, + /* .MaxTessControlImageUniforms = */ 0, + /* .MaxTessEvaluationImageUniforms = */ 0, + /* .MaxGeometryImageUniforms = */ 0, + /* .MaxFragmentImageUniforms = */ 8, + /* .MaxCombinedImageUniforms = */ 8, + /* .MaxGeometryTextureImageUnits = */ 16, + /* .MaxGeometryOutputVertices = */ 256, + /* .MaxGeometryTotalOutputComponents = */ 1024, + /* .MaxGeometryUniformComponents = */ 1024, + /* .MaxGeometryVaryingComponents = */ 64, + /* .MaxTessControlInputComponents = */ 128, + /* .MaxTessControlOutputComponents = */ 128, + /* .MaxTessControlTextureImageUnits = */ 16, + /* .MaxTessControlUniformComponents = */ 1024, + /* .MaxTessControlTotalOutputComponents = */ 4096, + /* .MaxTessEvaluationInputComponents = */ 128, + /* .MaxTessEvaluationOutputComponents = */ 128, + /* .MaxTessEvaluationTextureImageUnits = */ 16, + /* .MaxTessEvaluationUniformComponents = */ 1024, + /* .MaxTessPatchComponents = */ 120, + /* .MaxPatchVertices = */ 32, + /* .MaxTessGenLevel = */ 64, + /* .MaxViewports = */ 16, + /* .MaxVertexAtomicCounters = */ 0, + /* .MaxTessControlAtomicCounters = */ 0, + /* .MaxTessEvaluationAtomicCounters = */ 0, + /* .MaxGeometryAtomicCounters = */ 0, + /* .MaxFragmentAtomicCounters = */ 8, + /* .MaxCombinedAtomicCounters = */ 8, + /* .MaxAtomicCounterBindings = */ 1, + /* .MaxVertexAtomicCounterBuffers = */ 0, + /* .MaxTessControlAtomicCounterBuffers = */ 0, + /* .MaxTessEvaluationAtomicCounterBuffers = */ 0, + /* .MaxGeometryAtomicCounterBuffers = */ 0, + /* .MaxFragmentAtomicCounterBuffers = */ 1, + /* .MaxCombinedAtomicCounterBuffers = */ 1, + /* .MaxAtomicCounterBufferSize = */ 16384, + /* .MaxTransformFeedbackBuffers = */ 4, + /* .MaxTransformFeedbackInterleavedComponents = */ 64, + /* .MaxCullDistances = */ 8, + /* .MaxCombinedClipAndCullDistances = */ 8, + /* .MaxSamples = */ 4, + /* .maxMeshOutputVerticesNV = */ 256, + /* .maxMeshOutputPrimitivesNV = */ 512, + /* .maxMeshWorkGroupSizeX_NV = */ 32, + /* .maxMeshWorkGroupSizeY_NV = */ 1, + /* .maxMeshWorkGroupSizeZ_NV = */ 1, + /* .maxTaskWorkGroupSizeX_NV = */ 32, + /* .maxTaskWorkGroupSizeY_NV = */ 1, + /* .maxTaskWorkGroupSizeZ_NV = */ 1, + /* .maxMeshViewCountNV = */ 4, + /* .maxMeshOutputVerticesEXT = */ 256, + /* .maxMeshOutputPrimitivesEXT = */ 256, + /* .maxMeshWorkGroupSizeX_EXT = */ 128, + /* .maxMeshWorkGroupSizeY_EXT = */ 128, + /* .maxMeshWorkGroupSizeZ_EXT = */ 128, + /* .maxTaskWorkGroupSizeX_EXT = */ 128, + /* .maxTaskWorkGroupSizeY_EXT = */ 128, + /* .maxTaskWorkGroupSizeZ_EXT = */ 128, + /* .maxMeshViewCountEXT = */ 4, + /* .maxDualSourceDrawBuffersEXT = */ 1, + + /* .limits = */ { + /* .nonInductiveForLoops = */ 1, + /* .whileLoops = */ 1, + /* .doWhileLoops = */ 1, + /* .generalUniformIndexing = */ 1, + /* .generalAttributeMatrixVectorIndexing = */ 1, + /* .generalVaryingIndexing = */ 1, + /* .generalSamplerIndexing = */ 1, + /* .generalVariableIndexing = */ 1, + /* .generalConstantMatrixVectorIndexing = */ 1, + }}; + +std::string GetDefaultTBuiltInResourceString() +{ + std::ostringstream ostream; + + ostream << "MaxLights " << DefaultTBuiltInResource.maxLights << "\n" + << "MaxClipPlanes " << DefaultTBuiltInResource.maxClipPlanes << "\n" + << "MaxTextureUnits " << DefaultTBuiltInResource.maxTextureUnits << "\n" + << "MaxTextureCoords " << DefaultTBuiltInResource.maxTextureCoords << "\n" + << "MaxVertexAttribs " << DefaultTBuiltInResource.maxVertexAttribs << "\n" + << "MaxVertexUniformComponents " << DefaultTBuiltInResource.maxVertexUniformComponents << "\n" + << "MaxVaryingFloats " << DefaultTBuiltInResource.maxVaryingFloats << "\n" + << "MaxVertexTextureImageUnits " << DefaultTBuiltInResource.maxVertexTextureImageUnits << "\n" + << "MaxCombinedTextureImageUnits " << DefaultTBuiltInResource.maxCombinedTextureImageUnits << "\n" + << "MaxTextureImageUnits " << DefaultTBuiltInResource.maxTextureImageUnits << "\n" + << "MaxFragmentUniformComponents " << DefaultTBuiltInResource.maxFragmentUniformComponents << "\n" + << "MaxDrawBuffers " << DefaultTBuiltInResource.maxDrawBuffers << "\n" + << "MaxVertexUniformVectors " << DefaultTBuiltInResource.maxVertexUniformVectors << "\n" + << "MaxVaryingVectors " << DefaultTBuiltInResource.maxVaryingVectors << "\n" + << "MaxFragmentUniformVectors " << DefaultTBuiltInResource.maxFragmentUniformVectors << "\n" + << "MaxVertexOutputVectors " << DefaultTBuiltInResource.maxVertexOutputVectors << "\n" + << "MaxFragmentInputVectors " << DefaultTBuiltInResource.maxFragmentInputVectors << "\n" + << "MinProgramTexelOffset " << DefaultTBuiltInResource.minProgramTexelOffset << "\n" + << "MaxProgramTexelOffset " << DefaultTBuiltInResource.maxProgramTexelOffset << "\n" + << "MaxClipDistances " << DefaultTBuiltInResource.maxClipDistances << "\n" + << "MaxComputeWorkGroupCountX " << DefaultTBuiltInResource.maxComputeWorkGroupCountX << "\n" + << "MaxComputeWorkGroupCountY " << DefaultTBuiltInResource.maxComputeWorkGroupCountY << "\n" + << "MaxComputeWorkGroupCountZ " << DefaultTBuiltInResource.maxComputeWorkGroupCountZ << "\n" + << "MaxComputeWorkGroupSizeX " << DefaultTBuiltInResource.maxComputeWorkGroupSizeX << "\n" + << "MaxComputeWorkGroupSizeY " << DefaultTBuiltInResource.maxComputeWorkGroupSizeY << "\n" + << "MaxComputeWorkGroupSizeZ " << DefaultTBuiltInResource.maxComputeWorkGroupSizeZ << "\n" + << "MaxComputeUniformComponents " << DefaultTBuiltInResource.maxComputeUniformComponents << "\n" + << "MaxComputeTextureImageUnits " << DefaultTBuiltInResource.maxComputeTextureImageUnits << "\n" + << "MaxComputeImageUniforms " << DefaultTBuiltInResource.maxComputeImageUniforms << "\n" + << "MaxComputeAtomicCounters " << DefaultTBuiltInResource.maxComputeAtomicCounters << "\n" + << "MaxComputeAtomicCounterBuffers " << DefaultTBuiltInResource.maxComputeAtomicCounterBuffers << "\n" + << "MaxVaryingComponents " << DefaultTBuiltInResource.maxVaryingComponents << "\n" + << "MaxVertexOutputComponents " << DefaultTBuiltInResource.maxVertexOutputComponents << "\n" + << "MaxGeometryInputComponents " << DefaultTBuiltInResource.maxGeometryInputComponents << "\n" + << "MaxGeometryOutputComponents " << DefaultTBuiltInResource.maxGeometryOutputComponents << "\n" + << "MaxFragmentInputComponents " << DefaultTBuiltInResource.maxFragmentInputComponents << "\n" + << "MaxImageUnits " << DefaultTBuiltInResource.maxImageUnits << "\n" + << "MaxCombinedImageUnitsAndFragmentOutputs " << DefaultTBuiltInResource.maxCombinedImageUnitsAndFragmentOutputs << "\n" + << "MaxCombinedShaderOutputResources " << DefaultTBuiltInResource.maxCombinedShaderOutputResources << "\n" + << "MaxImageSamples " << DefaultTBuiltInResource.maxImageSamples << "\n" + << "MaxVertexImageUniforms " << DefaultTBuiltInResource.maxVertexImageUniforms << "\n" + << "MaxTessControlImageUniforms " << DefaultTBuiltInResource.maxTessControlImageUniforms << "\n" + << "MaxTessEvaluationImageUniforms " << DefaultTBuiltInResource.maxTessEvaluationImageUniforms << "\n" + << "MaxGeometryImageUniforms " << DefaultTBuiltInResource.maxGeometryImageUniforms << "\n" + << "MaxFragmentImageUniforms " << DefaultTBuiltInResource.maxFragmentImageUniforms << "\n" + << "MaxCombinedImageUniforms " << DefaultTBuiltInResource.maxCombinedImageUniforms << "\n" + << "MaxGeometryTextureImageUnits " << DefaultTBuiltInResource.maxGeometryTextureImageUnits << "\n" + << "MaxGeometryOutputVertices " << DefaultTBuiltInResource.maxGeometryOutputVertices << "\n" + << "MaxGeometryTotalOutputComponents " << DefaultTBuiltInResource.maxGeometryTotalOutputComponents << "\n" + << "MaxGeometryUniformComponents " << DefaultTBuiltInResource.maxGeometryUniformComponents << "\n" + << "MaxGeometryVaryingComponents " << DefaultTBuiltInResource.maxGeometryVaryingComponents << "\n" + << "MaxTessControlInputComponents " << DefaultTBuiltInResource.maxTessControlInputComponents << "\n" + << "MaxTessControlOutputComponents " << DefaultTBuiltInResource.maxTessControlOutputComponents << "\n" + << "MaxTessControlTextureImageUnits " << DefaultTBuiltInResource.maxTessControlTextureImageUnits << "\n" + << "MaxTessControlUniformComponents " << DefaultTBuiltInResource.maxTessControlUniformComponents << "\n" + << "MaxTessControlTotalOutputComponents " << DefaultTBuiltInResource.maxTessControlTotalOutputComponents << "\n" + << "MaxTessEvaluationInputComponents " << DefaultTBuiltInResource.maxTessEvaluationInputComponents << "\n" + << "MaxTessEvaluationOutputComponents " << DefaultTBuiltInResource.maxTessEvaluationOutputComponents << "\n" + << "MaxTessEvaluationTextureImageUnits " << DefaultTBuiltInResource.maxTessEvaluationTextureImageUnits << "\n" + << "MaxTessEvaluationUniformComponents " << DefaultTBuiltInResource.maxTessEvaluationUniformComponents << "\n" + << "MaxTessPatchComponents " << DefaultTBuiltInResource.maxTessPatchComponents << "\n" + << "MaxPatchVertices " << DefaultTBuiltInResource.maxPatchVertices << "\n" + << "MaxTessGenLevel " << DefaultTBuiltInResource.maxTessGenLevel << "\n" + << "MaxViewports " << DefaultTBuiltInResource.maxViewports << "\n" + << "MaxVertexAtomicCounters " << DefaultTBuiltInResource.maxVertexAtomicCounters << "\n" + << "MaxTessControlAtomicCounters " << DefaultTBuiltInResource.maxTessControlAtomicCounters << "\n" + << "MaxTessEvaluationAtomicCounters " << DefaultTBuiltInResource.maxTessEvaluationAtomicCounters << "\n" + << "MaxGeometryAtomicCounters " << DefaultTBuiltInResource.maxGeometryAtomicCounters << "\n" + << "MaxFragmentAtomicCounters " << DefaultTBuiltInResource.maxFragmentAtomicCounters << "\n" + << "MaxCombinedAtomicCounters " << DefaultTBuiltInResource.maxCombinedAtomicCounters << "\n" + << "MaxAtomicCounterBindings " << DefaultTBuiltInResource.maxAtomicCounterBindings << "\n" + << "MaxVertexAtomicCounterBuffers " << DefaultTBuiltInResource.maxVertexAtomicCounterBuffers << "\n" + << "MaxTessControlAtomicCounterBuffers " << DefaultTBuiltInResource.maxTessControlAtomicCounterBuffers << "\n" + << "MaxTessEvaluationAtomicCounterBuffers " << DefaultTBuiltInResource.maxTessEvaluationAtomicCounterBuffers << "\n" + << "MaxGeometryAtomicCounterBuffers " << DefaultTBuiltInResource.maxGeometryAtomicCounterBuffers << "\n" + << "MaxFragmentAtomicCounterBuffers " << DefaultTBuiltInResource.maxFragmentAtomicCounterBuffers << "\n" + << "MaxCombinedAtomicCounterBuffers " << DefaultTBuiltInResource.maxCombinedAtomicCounterBuffers << "\n" + << "MaxAtomicCounterBufferSize " << DefaultTBuiltInResource.maxAtomicCounterBufferSize << "\n" + << "MaxTransformFeedbackBuffers " << DefaultTBuiltInResource.maxTransformFeedbackBuffers << "\n" + << "MaxTransformFeedbackInterleavedComponents " << DefaultTBuiltInResource.maxTransformFeedbackInterleavedComponents << "\n" + << "MaxCullDistances " << DefaultTBuiltInResource.maxCullDistances << "\n" + << "MaxCombinedClipAndCullDistances " << DefaultTBuiltInResource.maxCombinedClipAndCullDistances << "\n" + << "MaxSamples " << DefaultTBuiltInResource.maxSamples << "\n" + << "MaxMeshOutputVerticesNV " << DefaultTBuiltInResource.maxMeshOutputVerticesNV << "\n" + << "MaxMeshOutputPrimitivesNV " << DefaultTBuiltInResource.maxMeshOutputPrimitivesNV << "\n" + << "MaxMeshWorkGroupSizeX_NV " << DefaultTBuiltInResource.maxMeshWorkGroupSizeX_NV << "\n" + << "MaxMeshWorkGroupSizeY_NV " << DefaultTBuiltInResource.maxMeshWorkGroupSizeY_NV << "\n" + << "MaxMeshWorkGroupSizeZ_NV " << DefaultTBuiltInResource.maxMeshWorkGroupSizeZ_NV << "\n" + << "MaxTaskWorkGroupSizeX_NV " << DefaultTBuiltInResource.maxTaskWorkGroupSizeX_NV << "\n" + << "MaxTaskWorkGroupSizeY_NV " << DefaultTBuiltInResource.maxTaskWorkGroupSizeY_NV << "\n" + << "MaxTaskWorkGroupSizeZ_NV " << DefaultTBuiltInResource.maxTaskWorkGroupSizeZ_NV << "\n" + << "MaxMeshViewCountNV " << DefaultTBuiltInResource.maxMeshViewCountNV << "\n" + << "MaxMeshOutputVerticesEXT " << DefaultTBuiltInResource.maxMeshOutputVerticesEXT << "\n" + << "MaxMeshOutputPrimitivesEXT " << DefaultTBuiltInResource.maxMeshOutputPrimitivesEXT << "\n" + << "MaxMeshWorkGroupSizeX_EXT " << DefaultTBuiltInResource.maxMeshWorkGroupSizeX_EXT << "\n" + << "MaxMeshWorkGroupSizeY_EXT " << DefaultTBuiltInResource.maxMeshWorkGroupSizeY_EXT << "\n" + << "MaxMeshWorkGroupSizeZ_EXT " << DefaultTBuiltInResource.maxMeshWorkGroupSizeZ_EXT << "\n" + << "MaxTaskWorkGroupSizeX_EXT " << DefaultTBuiltInResource.maxTaskWorkGroupSizeX_EXT << "\n" + << "MaxTaskWorkGroupSizeY_EXT " << DefaultTBuiltInResource.maxTaskWorkGroupSizeY_EXT << "\n" + << "MaxTaskWorkGroupSizeZ_EXT " << DefaultTBuiltInResource.maxTaskWorkGroupSizeZ_EXT << "\n" + << "MaxMeshViewCountEXT " << DefaultTBuiltInResource.maxMeshViewCountEXT << "\n" + << "MaxDualSourceDrawBuffersEXT " << DefaultTBuiltInResource.maxDualSourceDrawBuffersEXT << "\n" + << "nonInductiveForLoops " << DefaultTBuiltInResource.limits.nonInductiveForLoops << "\n" + << "whileLoops " << DefaultTBuiltInResource.limits.whileLoops << "\n" + << "doWhileLoops " << DefaultTBuiltInResource.limits.doWhileLoops << "\n" + << "generalUniformIndexing " << DefaultTBuiltInResource.limits.generalUniformIndexing << "\n" + << "generalAttributeMatrixVectorIndexing " << DefaultTBuiltInResource.limits.generalAttributeMatrixVectorIndexing << "\n" + << "generalVaryingIndexing " << DefaultTBuiltInResource.limits.generalVaryingIndexing << "\n" + << "generalSamplerIndexing " << DefaultTBuiltInResource.limits.generalSamplerIndexing << "\n" + << "generalVariableIndexing " << DefaultTBuiltInResource.limits.generalVariableIndexing << "\n" + << "generalConstantMatrixVectorIndexing " << DefaultTBuiltInResource.limits.generalConstantMatrixVectorIndexing << "\n" + ; + + return ostream.str(); +} + +void DecodeResourceLimits(TBuiltInResource* resources, char* config) +{ + static const char* delims = " \t\n\r"; + + size_t pos = 0; + std::string configStr(config); + + while ((pos = configStr.find_first_not_of(delims, pos)) != std::string::npos) { + const size_t token_s = pos; + const size_t token_e = configStr.find_first_of(delims, token_s); + const size_t value_s = configStr.find_first_not_of(delims, token_e); + const size_t value_e = configStr.find_first_of(delims, value_s); + pos = value_e; + + // Faster to use compare(), but prefering readability. + const std::string tokenStr = configStr.substr(token_s, token_e-token_s); + const std::string valueStr = configStr.substr(value_s, value_e-value_s); + + if (value_s == std::string::npos || ! (valueStr[0] == '-' || isdigit(valueStr[0]))) { + printf("Error: '%s' bad .conf file. Each name must be followed by one number.\n", + valueStr.c_str()); + return; + } + + const int value = std::atoi(valueStr.c_str()); + + if (tokenStr == "MaxLights") + resources->maxLights = value; + else if (tokenStr == "MaxClipPlanes") + resources->maxClipPlanes = value; + else if (tokenStr == "MaxTextureUnits") + resources->maxTextureUnits = value; + else if (tokenStr == "MaxTextureCoords") + resources->maxTextureCoords = value; + else if (tokenStr == "MaxVertexAttribs") + resources->maxVertexAttribs = value; + else if (tokenStr == "MaxVertexUniformComponents") + resources->maxVertexUniformComponents = value; + else if (tokenStr == "MaxVaryingFloats") + resources->maxVaryingFloats = value; + else if (tokenStr == "MaxVertexTextureImageUnits") + resources->maxVertexTextureImageUnits = value; + else if (tokenStr == "MaxCombinedTextureImageUnits") + resources->maxCombinedTextureImageUnits = value; + else if (tokenStr == "MaxTextureImageUnits") + resources->maxTextureImageUnits = value; + else if (tokenStr == "MaxFragmentUniformComponents") + resources->maxFragmentUniformComponents = value; + else if (tokenStr == "MaxDrawBuffers") + resources->maxDrawBuffers = value; + else if (tokenStr == "MaxVertexUniformVectors") + resources->maxVertexUniformVectors = value; + else if (tokenStr == "MaxVaryingVectors") + resources->maxVaryingVectors = value; + else if (tokenStr == "MaxFragmentUniformVectors") + resources->maxFragmentUniformVectors = value; + else if (tokenStr == "MaxVertexOutputVectors") + resources->maxVertexOutputVectors = value; + else if (tokenStr == "MaxFragmentInputVectors") + resources->maxFragmentInputVectors = value; + else if (tokenStr == "MinProgramTexelOffset") + resources->minProgramTexelOffset = value; + else if (tokenStr == "MaxProgramTexelOffset") + resources->maxProgramTexelOffset = value; + else if (tokenStr == "MaxClipDistances") + resources->maxClipDistances = value; + else if (tokenStr == "MaxComputeWorkGroupCountX") + resources->maxComputeWorkGroupCountX = value; + else if (tokenStr == "MaxComputeWorkGroupCountY") + resources->maxComputeWorkGroupCountY = value; + else if (tokenStr == "MaxComputeWorkGroupCountZ") + resources->maxComputeWorkGroupCountZ = value; + else if (tokenStr == "MaxComputeWorkGroupSizeX") + resources->maxComputeWorkGroupSizeX = value; + else if (tokenStr == "MaxComputeWorkGroupSizeY") + resources->maxComputeWorkGroupSizeY = value; + else if (tokenStr == "MaxComputeWorkGroupSizeZ") + resources->maxComputeWorkGroupSizeZ = value; + else if (tokenStr == "MaxComputeUniformComponents") + resources->maxComputeUniformComponents = value; + else if (tokenStr == "MaxComputeTextureImageUnits") + resources->maxComputeTextureImageUnits = value; + else if (tokenStr == "MaxComputeImageUniforms") + resources->maxComputeImageUniforms = value; + else if (tokenStr == "MaxComputeAtomicCounters") + resources->maxComputeAtomicCounters = value; + else if (tokenStr == "MaxComputeAtomicCounterBuffers") + resources->maxComputeAtomicCounterBuffers = value; + else if (tokenStr == "MaxVaryingComponents") + resources->maxVaryingComponents = value; + else if (tokenStr == "MaxVertexOutputComponents") + resources->maxVertexOutputComponents = value; + else if (tokenStr == "MaxGeometryInputComponents") + resources->maxGeometryInputComponents = value; + else if (tokenStr == "MaxGeometryOutputComponents") + resources->maxGeometryOutputComponents = value; + else if (tokenStr == "MaxFragmentInputComponents") + resources->maxFragmentInputComponents = value; + else if (tokenStr == "MaxImageUnits") + resources->maxImageUnits = value; + else if (tokenStr == "MaxCombinedImageUnitsAndFragmentOutputs") + resources->maxCombinedImageUnitsAndFragmentOutputs = value; + else if (tokenStr == "MaxCombinedShaderOutputResources") + resources->maxCombinedShaderOutputResources = value; + else if (tokenStr == "MaxImageSamples") + resources->maxImageSamples = value; + else if (tokenStr == "MaxVertexImageUniforms") + resources->maxVertexImageUniforms = value; + else if (tokenStr == "MaxTessControlImageUniforms") + resources->maxTessControlImageUniforms = value; + else if (tokenStr == "MaxTessEvaluationImageUniforms") + resources->maxTessEvaluationImageUniforms = value; + else if (tokenStr == "MaxGeometryImageUniforms") + resources->maxGeometryImageUniforms = value; + else if (tokenStr == "MaxFragmentImageUniforms") + resources->maxFragmentImageUniforms = value; + else if (tokenStr == "MaxCombinedImageUniforms") + resources->maxCombinedImageUniforms = value; + else if (tokenStr == "MaxGeometryTextureImageUnits") + resources->maxGeometryTextureImageUnits = value; + else if (tokenStr == "MaxGeometryOutputVertices") + resources->maxGeometryOutputVertices = value; + else if (tokenStr == "MaxGeometryTotalOutputComponents") + resources->maxGeometryTotalOutputComponents = value; + else if (tokenStr == "MaxGeometryUniformComponents") + resources->maxGeometryUniformComponents = value; + else if (tokenStr == "MaxGeometryVaryingComponents") + resources->maxGeometryVaryingComponents = value; + else if (tokenStr == "MaxTessControlInputComponents") + resources->maxTessControlInputComponents = value; + else if (tokenStr == "MaxTessControlOutputComponents") + resources->maxTessControlOutputComponents = value; + else if (tokenStr == "MaxTessControlTextureImageUnits") + resources->maxTessControlTextureImageUnits = value; + else if (tokenStr == "MaxTessControlUniformComponents") + resources->maxTessControlUniformComponents = value; + else if (tokenStr == "MaxTessControlTotalOutputComponents") + resources->maxTessControlTotalOutputComponents = value; + else if (tokenStr == "MaxTessEvaluationInputComponents") + resources->maxTessEvaluationInputComponents = value; + else if (tokenStr == "MaxTessEvaluationOutputComponents") + resources->maxTessEvaluationOutputComponents = value; + else if (tokenStr == "MaxTessEvaluationTextureImageUnits") + resources->maxTessEvaluationTextureImageUnits = value; + else if (tokenStr == "MaxTessEvaluationUniformComponents") + resources->maxTessEvaluationUniformComponents = value; + else if (tokenStr == "MaxTessPatchComponents") + resources->maxTessPatchComponents = value; + else if (tokenStr == "MaxPatchVertices") + resources->maxPatchVertices = value; + else if (tokenStr == "MaxTessGenLevel") + resources->maxTessGenLevel = value; + else if (tokenStr == "MaxViewports") + resources->maxViewports = value; + else if (tokenStr == "MaxVertexAtomicCounters") + resources->maxVertexAtomicCounters = value; + else if (tokenStr == "MaxTessControlAtomicCounters") + resources->maxTessControlAtomicCounters = value; + else if (tokenStr == "MaxTessEvaluationAtomicCounters") + resources->maxTessEvaluationAtomicCounters = value; + else if (tokenStr == "MaxGeometryAtomicCounters") + resources->maxGeometryAtomicCounters = value; + else if (tokenStr == "MaxFragmentAtomicCounters") + resources->maxFragmentAtomicCounters = value; + else if (tokenStr == "MaxCombinedAtomicCounters") + resources->maxCombinedAtomicCounters = value; + else if (tokenStr == "MaxAtomicCounterBindings") + resources->maxAtomicCounterBindings = value; + else if (tokenStr == "MaxVertexAtomicCounterBuffers") + resources->maxVertexAtomicCounterBuffers = value; + else if (tokenStr == "MaxTessControlAtomicCounterBuffers") + resources->maxTessControlAtomicCounterBuffers = value; + else if (tokenStr == "MaxTessEvaluationAtomicCounterBuffers") + resources->maxTessEvaluationAtomicCounterBuffers = value; + else if (tokenStr == "MaxGeometryAtomicCounterBuffers") + resources->maxGeometryAtomicCounterBuffers = value; + else if (tokenStr == "MaxFragmentAtomicCounterBuffers") + resources->maxFragmentAtomicCounterBuffers = value; + else if (tokenStr == "MaxCombinedAtomicCounterBuffers") + resources->maxCombinedAtomicCounterBuffers = value; + else if (tokenStr == "MaxAtomicCounterBufferSize") + resources->maxAtomicCounterBufferSize = value; + else if (tokenStr == "MaxTransformFeedbackBuffers") + resources->maxTransformFeedbackBuffers = value; + else if (tokenStr == "MaxTransformFeedbackInterleavedComponents") + resources->maxTransformFeedbackInterleavedComponents = value; + else if (tokenStr == "MaxCullDistances") + resources->maxCullDistances = value; + else if (tokenStr == "MaxCombinedClipAndCullDistances") + resources->maxCombinedClipAndCullDistances = value; + else if (tokenStr == "MaxSamples") + resources->maxSamples = value; + else if (tokenStr == "MaxMeshOutputVerticesNV") + resources->maxMeshOutputVerticesNV = value; + else if (tokenStr == "MaxMeshOutputPrimitivesNV") + resources->maxMeshOutputPrimitivesNV = value; + else if (tokenStr == "MaxMeshWorkGroupSizeX_NV") + resources->maxMeshWorkGroupSizeX_NV = value; + else if (tokenStr == "MaxMeshWorkGroupSizeY_NV") + resources->maxMeshWorkGroupSizeY_NV = value; + else if (tokenStr == "MaxMeshWorkGroupSizeZ_NV") + resources->maxMeshWorkGroupSizeZ_NV = value; + else if (tokenStr == "MaxTaskWorkGroupSizeX_NV") + resources->maxTaskWorkGroupSizeX_NV = value; + else if (tokenStr == "MaxTaskWorkGroupSizeY_NV") + resources->maxTaskWorkGroupSizeY_NV = value; + else if (tokenStr == "MaxTaskWorkGroupSizeZ_NV") + resources->maxTaskWorkGroupSizeZ_NV = value; + else if (tokenStr == "MaxMeshViewCountNV") + resources->maxMeshViewCountNV = value; + else if (tokenStr == "MaxMeshOutputVerticesEXT") + resources->maxMeshOutputVerticesEXT = value; + else if (tokenStr == "MaxMeshOutputPrimitivesEXT") + resources->maxMeshOutputPrimitivesEXT = value; + else if (tokenStr == "MaxMeshWorkGroupSizeX_EXT") + resources->maxMeshWorkGroupSizeX_EXT = value; + else if (tokenStr == "MaxMeshWorkGroupSizeY_EXT") + resources->maxMeshWorkGroupSizeY_EXT = value; + else if (tokenStr == "MaxMeshWorkGroupSizeZ_EXT") + resources->maxMeshWorkGroupSizeZ_EXT = value; + else if (tokenStr == "MaxTaskWorkGroupSizeX_EXT") + resources->maxTaskWorkGroupSizeX_EXT = value; + else if (tokenStr == "MaxTaskWorkGroupSizeY_EXT") + resources->maxTaskWorkGroupSizeY_EXT = value; + else if (tokenStr == "MaxTaskWorkGroupSizeZ_EXT") + resources->maxTaskWorkGroupSizeZ_EXT = value; + else if (tokenStr == "MaxMeshViewCountEXT") + resources->maxMeshViewCountEXT = value; + else if (tokenStr == "MaxDualSourceDrawBuffersEXT") + resources->maxDualSourceDrawBuffersEXT = value; + else if (tokenStr == "nonInductiveForLoops") + resources->limits.nonInductiveForLoops = (value != 0); + else if (tokenStr == "whileLoops") + resources->limits.whileLoops = (value != 0); + else if (tokenStr == "doWhileLoops") + resources->limits.doWhileLoops = (value != 0); + else if (tokenStr == "generalUniformIndexing") + resources->limits.generalUniformIndexing = (value != 0); + else if (tokenStr == "generalAttributeMatrixVectorIndexing") + resources->limits.generalAttributeMatrixVectorIndexing = (value != 0); + else if (tokenStr == "generalVaryingIndexing") + resources->limits.generalVaryingIndexing = (value != 0); + else if (tokenStr == "generalSamplerIndexing") + resources->limits.generalSamplerIndexing = (value != 0); + else if (tokenStr == "generalVariableIndexing") + resources->limits.generalVariableIndexing = (value != 0); + else if (tokenStr == "generalConstantMatrixVectorIndexing") + resources->limits.generalConstantMatrixVectorIndexing = (value != 0); + else + printf("Warning: unrecognized limit (%s) in configuration file.\n", tokenStr.c_str()); + + } +} + +TBuiltInResource* GetResources() +{ + return &Resources; +} + +const TBuiltInResource* GetDefaultResources() +{ + return &DefaultTBuiltInResource; +} + +} // namespace QtShaderTools + diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/ResourceLimits/resource_limits_c.cpp b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/ResourceLimits/resource_limits_c.cpp new file mode 100644 index 0000000000..64b5308460 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/ResourceLimits/resource_limits_c.cpp @@ -0,0 +1,56 @@ +/** +BSD 2-Clause License + +Copyright (c) 2020, Travis Fort +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +#include "glslang/Public/resource_limits_c.h" +#include "glslang/Public/ResourceLimits.h" +#include +#include +#include + +glslang_resource_t* glslang_resource(void) +{ + return reinterpret_cast(GetResources()); +} + +const glslang_resource_t* glslang_default_resource(void) +{ + return reinterpret_cast(GetDefaultResources()); +} + +const char* glslang_default_resource_string(void) +{ + std::string cpp_str = GetDefaultTBuiltInResourceString(); + char* c_str = (char*)malloc(cpp_str.length() + 1); + strncpy(c_str, cpp_str.c_str(), cpp_str.length() + 1); + return c_str; +} + +void glslang_decode_resource_limits(glslang_resource_t* resources, char* config) +{ + DecodeResourceLimits(reinterpret_cast(resources), config); +} diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/build_info.h b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/build_info.h new file mode 100644 index 0000000000..f987f12166 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/build_info.h @@ -0,0 +1,62 @@ +// Copyright (C) 2020 The Khronos Group Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of The Khronos Group Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef GLSLANG_BUILD_INFO +#define GLSLANG_BUILD_INFO + +#define GLSLANG_VERSION_MAJOR 13 +#define GLSLANG_VERSION_MINOR 0 +#define GLSLANG_VERSION_PATCH 0 +#define GLSLANG_VERSION_FLAVOR "" + +#define GLSLANG_VERSION_GREATER_THAN(major, minor, patch) \ + (((major) > GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \ + (((minor) > GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \ + ((patch) > GLSLANG_VERSION_PATCH))))) + +#define GLSLANG_VERSION_GREATER_OR_EQUAL_TO(major, minor, patch) \ + (((major) > GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \ + (((minor) > GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \ + ((patch) >= GLSLANG_VERSION_PATCH))))) + +#define GLSLANG_VERSION_LESS_THAN(major, minor, patch) \ + (((major) < GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \ + (((minor) < GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \ + ((patch) < GLSLANG_VERSION_PATCH))))) + +#define GLSLANG_VERSION_LESS_OR_EQUAL_TO(major, minor, patch) \ + (((major) < GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \ + (((minor) < GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \ + ((patch) <= GLSLANG_VERSION_PATCH))))) + +#endif // GLSLANG_BUILD_INFO diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/updateGrammar b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/updateGrammar new file mode 100755 index 0000000000..a15dc24b30 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/glslang/updateGrammar @@ -0,0 +1,36 @@ +#!/bin/sh + +# Copyright (C) 2020 The Khronos Group Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# Neither the name of The Khronos Group Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +bison --defines=MachineIndependent/glslang_tab.cpp.h -t MachineIndependent/glslang.y -o MachineIndependent/glslang_tab.cpp diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/qt_attribution.json b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/qt_attribution.json new file mode 100644 index 0000000000..3a1362eeb2 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/glslang/qt_attribution.json @@ -0,0 +1,20 @@ +[ + { + "Id": "glslang", + "Name": "glslang", + "QDocModule": "qtshadertools", + "Description": "An OpenGL and OpenGL ES shader front end and validator.", + "QtUsage": "Compile GLSL to SPIR-V.", + + "Homepage": "https://github.com/KhronosGroup/glslang", + "PURL": [ + "pkg:github/KhronosGroup/glslang@$" + ], + "Comment": "No relevant CPE found", + "Version": "16.1.0", + "License": "BSD 3-Clause \"New\" or \"Revised\" License, and MIT Khronos - old variant, and Apache License 2.0, and GNU General Public License v3.0 or later with Bison exception 2.2, and AML glslang variant License", + "LicenseId": "BSD-3-Clause AND LicenseRef-MIT-Khronos-old AND Apache-2.0 AND GPL-3.0-or-later WITH Bison-exception-2.2 AND AML-glslang", + "LicenseFile": "LICENSE.txt", + "CopyrightFile": "COPYRIGHT.txt" + } +] diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/patches/SPIRV-Cross/0001-SPIRV-Cross-Fix-build-on-INTEGRITY-and-QNX.patch b/local/recipes/qt/qtshadertools/source/src/3rdparty/patches/SPIRV-Cross/0001-SPIRV-Cross-Fix-build-on-INTEGRITY-and-QNX.patch new file mode 100644 index 0000000000..3d22437515 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/patches/SPIRV-Cross/0001-SPIRV-Cross-Fix-build-on-INTEGRITY-and-QNX.patch @@ -0,0 +1,37 @@ +From edd047c552ad2e4b701dd38bc44eb6a0e732bfce Mon Sep 17 00:00:00 2001 +From: Laszlo Agocs +Date: Fri, 25 Aug 2023 15:24:33 +0200 +Subject: [PATCH] SPIRV-Cross: Fix build on INTEGRITY and QNX + +Change-Id: I0fe75761952e64bba9a559ae9e78b9c94f1dec93 +--- + src/3rdparty/SPIRV-Cross/spirv_glsl.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/3rdparty/SPIRV-Cross/spirv_glsl.cpp b/src/3rdparty/SPIRV-Cross/spirv_glsl.cpp +index 690bc9d..9d57d6d 100644 +--- a/src/3rdparty/SPIRV-Cross/spirv_glsl.cpp ++++ b/src/3rdparty/SPIRV-Cross/spirv_glsl.cpp +@@ -33,8 +33,10 @@ + #include + + #ifndef _WIN32 ++#ifndef __ghs__ + #include + #endif ++#endif + #include + + using namespace spv; +@@ -177,7 +179,7 @@ void CompilerGLSL::init() + const struct lconv *conv = localeconv(); + if (conv && conv->decimal_point) + current_locale_radix_character = *conv->decimal_point; +-#elif defined(__ANDROID__) && __ANDROID_API__ < 26 ++#elif defined(__ANDROID__) && __ANDROID_API__ < 26 || defined(__ghs__) || defined(__QNXNTO__) + // nl_langinfo is not supported on this platform, fall back to the worse alternative. + const struct lconv *conv = localeconv(); + if (conv && conv->decimal_point) +-- +2.36.1.windows.1 + diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/patches/SPIRV-Cross/0003-Use-localeconv-for-VxWorks-instead-of-unavailable-nl_langinfo.patch b/local/recipes/qt/qtshadertools/source/src/3rdparty/patches/SPIRV-Cross/0003-Use-localeconv-for-VxWorks-instead-of-unavailable-nl_langinfo.patch new file mode 100644 index 0000000000..c63746b33b --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/patches/SPIRV-Cross/0003-Use-localeconv-for-VxWorks-instead-of-unavailable-nl_langinfo.patch @@ -0,0 +1,22 @@ +From 38ded2f53221fc51d6802746820c06d5f1d7c21c Mon Sep 17 00:00:00 2001 +From: Krzysztof Sommerfeld +Date: Thu, 10 Aug 2023 10:49:45 +0200 +Subject: [PATCH] Use localeconv for VxWorks instead of unavailable nl_langinfo + +Task-number: QTBUG-115777 +Change-Id: I4bb5c22b35928813aee9524706632f7db6995dca +--- + +diff --git a/src/3rdparty/SPIRV-Cross/spirv_glsl.cpp b/src/3rdparty/SPIRV-Cross/spirv_glsl.cpp +index dc5aeb3..5dd601c 100644 +--- a/src/3rdparty/SPIRV-Cross/spirv_glsl.cpp ++++ b/src/3rdparty/SPIRV-Cross/spirv_glsl.cpp +@@ -178,7 +178,7 @@ + const struct lconv *conv = localeconv(); + if (conv && conv->decimal_point) + current_locale_radix_character = *conv->decimal_point; +-#elif defined(__ANDROID__) && __ANDROID_API__ < 26 || defined(__ghs__) || defined(__QNXNTO__) ++#elif defined(__ANDROID__) && __ANDROID_API__ < 26 || defined(__ghs__) || defined(__QNXNTO__) || defined(__VXWORKS__) + // nl_langinfo is not supported on this platform, fall back to the worse alternative. + const struct lconv *conv = localeconv(); + if (conv && conv->decimal_point) diff --git a/local/recipes/qt/qtshadertools/source/src/3rdparty/patches/glslang/0001-Patch-glslang-16.0.1-and-restore-SPVRemapper.patch b/local/recipes/qt/qtshadertools/source/src/3rdparty/patches/glslang/0001-Patch-glslang-16.0.1-and-restore-SPVRemapper.patch new file mode 100644 index 0000000000..3af33967ea --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/3rdparty/patches/glslang/0001-Patch-glslang-16.0.1-and-restore-SPVRemapper.patch @@ -0,0 +1,3586 @@ +From b293a533c7eef030c00b7745ee9ad67eb8b33b05 Mon Sep 17 00:00:00 2001 +From: Laszlo Agocs +Date: Fri, 30 Jan 2026 12:40:05 +0100 +Subject: [PATCH] Patch glslang 16.0.1 and restore SPVRemapper + +Namespacing for INTEGRITY. +Include condition changes for INTEGRITY. +C++ filesystem usage for QNX. +Restore a SPVRemapper ported to spirv.hpp11. +--- + src/3rdparty/glslang/SPIRV/GlslangToSpv.cpp | 4 + + src/3rdparty/glslang/SPIRV/GlslangToSpv.h | 4 +- + src/3rdparty/glslang/SPIRV/SPVRemapper.cpp | 1559 +++++++++++++++++ + src/3rdparty/glslang/SPIRV/SPVRemapper.h | 300 ++++ + src/3rdparty/glslang/SPIRV/SpvTools.cpp | 2 + + src/3rdparty/glslang/SPIRV/SpvTools.h | 2 + + .../glslang/GenericCodeGen/CodeGen.cpp | 2 + + .../glslang/glslang/GenericCodeGen/Link.cpp | 3 + + .../glslang/glslang/Include/BaseTypes.h | 2 + + src/3rdparty/glslang/glslang/Include/Common.h | 10 +- + .../glslang/glslang/Include/ConstantUnion.h | 2 + + .../glslang/glslang/Include/InfoSink.h | 27 +- + .../glslang/Include/InitializeGlobals.h | 2 + + .../glslang/glslang/Include/PoolAlloc.h | 2 + + .../glslang/glslang/Include/ShHandle.h | 4 + + .../glslang/glslang/Include/SpirvIntrinsics.h | 2 + + src/3rdparty/glslang/glslang/Include/Types.h | 6 + + src/3rdparty/glslang/glslang/Include/arrays.h | 2 + + .../glslang/glslang/Include/intermediate.h | 2 + + .../glslang/MachineIndependent/Constant.cpp | 3 + + .../glslang/MachineIndependent/InfoSink.cpp | 2 + + .../glslang/MachineIndependent/Initialize.cpp | 2 + + .../glslang/MachineIndependent/Initialize.h | 2 + + .../MachineIndependent/IntermTraverse.cpp | 2 + + .../MachineIndependent/Intermediate.cpp | 2 + + .../MachineIndependent/LiveTraverser.h | 2 + + .../MachineIndependent/ParseContextBase.cpp | 4 +- + .../MachineIndependent/ParseHelper.cpp | 3 + + .../glslang/MachineIndependent/ParseHelper.h | 2 + + .../glslang/MachineIndependent/PoolAlloc.cpp | 2 + + .../glslang/MachineIndependent/RemoveTree.cpp | 2 + + .../glslang/MachineIndependent/RemoveTree.h | 2 + + .../glslang/MachineIndependent/Scan.cpp | 4 +- + .../glslang/glslang/MachineIndependent/Scan.h | 2 + + .../glslang/MachineIndependent/ScanContext.h | 2 + + .../glslang/MachineIndependent/ShaderLang.cpp | 37 +- + .../MachineIndependent/SpirvIntrinsics.cpp | 2 + + .../MachineIndependent/SymbolTable.cpp | 2 + + .../glslang/MachineIndependent/SymbolTable.h | 5 +- + .../glslang/MachineIndependent/Versions.cpp | 2 + + .../glslang/MachineIndependent/Versions.h | 2 + + .../glslang/MachineIndependent/attribute.cpp | 2 + + .../glslang/MachineIndependent/attribute.h | 2 + + .../MachineIndependent/glslang_tab.cpp | 10 +- + .../MachineIndependent/glslang_tab.cpp.h | 8 +- + .../glslang/MachineIndependent/intermOut.cpp | 2 + + .../glslang/MachineIndependent/iomapper.cpp | 2 + + .../glslang/MachineIndependent/iomapper.h | 2 + + .../glslang/MachineIndependent/limits.cpp | 2 + + .../MachineIndependent/linkValidate.cpp | 2 + + .../MachineIndependent/localintermediate.h | 2 + + .../glslang/MachineIndependent/parseConst.cpp | 2 + + .../MachineIndependent/parseVersions.h | 2 + + .../MachineIndependent/preprocessor/Pp.cpp | 2 + + .../preprocessor/PpAtom.cpp | 3 + + .../preprocessor/PpContext.cpp | 2 + + .../preprocessor/PpContext.h | 2 + + .../preprocessor/PpScanner.cpp | 2 + + .../preprocessor/PpTokens.cpp | 2 + + .../preprocessor/PpTokens.h | 2 + + .../propagateNoContraction.cpp | 2 + + .../propagateNoContraction.h | 4 +- + .../glslang/MachineIndependent/reflection.cpp | 2 + + .../glslang/MachineIndependent/reflection.h | 2 + + .../glslang/OSDependent/Unix/ossource.cpp | 4 +- + .../glslang/OSDependent/Windows/ossource.cpp | 2 + + .../glslang/glslang/OSDependent/osinclude.h | 2 + + .../glslang/glslang/Public/ResourceLimits.h | 4 + + .../glslang/glslang/Public/ShaderLang.h | 42 +- + .../glslang/ResourceLimits/ResourceLimits.cpp | 4 + + 70 files changed, 2088 insertions(+), 58 deletions(-) + create mode 100644 src/3rdparty/glslang/SPIRV/SPVRemapper.cpp + create mode 100644 src/3rdparty/glslang/SPIRV/SPVRemapper.h + +diff --git a/src/3rdparty/glslang/SPIRV/GlslangToSpv.cpp b/src/3rdparty/glslang/SPIRV/GlslangToSpv.cpp +index 1a5c40c..12c5484 100644 +--- a/src/3rdparty/glslang/SPIRV/GlslangToSpv.cpp ++++ b/src/3rdparty/glslang/SPIRV/GlslangToSpv.cpp +@@ -116,6 +116,8 @@ struct OpDecorations { + + } // namespace + ++using namespace QtShaderTools; ++ + // + // The main holder of information for translating glslang to SPIR-V. + // +@@ -11433,6 +11435,7 @@ spv::Id TGlslangToSpvTraverser::getExtBuiltins(const char* name) + + } // end anonymous namespace + ++namespace QtShaderTools { + namespace glslang { + + void GetSpirvVersion(std::string& version) +@@ -11569,3 +11572,4 @@ void GlslangToSpv(const TIntermediate& intermediate, std::vector& + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/SPIRV/GlslangToSpv.h b/src/3rdparty/glslang/SPIRV/GlslangToSpv.h +index 9fb4f3f..1bbe3b3 100644 +--- a/src/3rdparty/glslang/SPIRV/GlslangToSpv.h ++++ b/src/3rdparty/glslang/SPIRV/GlslangToSpv.h +@@ -41,6 +41,7 @@ + #include "Logger.h" + #include "glslang/Include/visibility.h" + ++namespace QtShaderTools { + namespace glslang { + class TIntermediate; + +@@ -66,4 +67,5 @@ GLSLANG_EXPORT void GlslangToSpv(const glslang::TIntermediate& intermediate, std + GLSLANG_EXPORT bool OutputSpvBin(const std::vector& spirv, const char* baseName); + GLSLANG_EXPORT bool OutputSpvHex(const std::vector& spirv, const char* baseName, const char* varName); + +-} ++} // namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/SPIRV/SPVRemapper.cpp b/src/3rdparty/glslang/SPIRV/SPVRemapper.cpp +new file mode 100644 +index 0000000..3f10201 +--- /dev/null ++++ b/src/3rdparty/glslang/SPIRV/SPVRemapper.cpp +@@ -0,0 +1,1559 @@ ++// ++// Copyright (C) 2015 LunarG, Inc. ++// ++// All rights reserved. ++// ++// Redistribution and use in source and binary forms, with or without ++// modification, are permitted provided that the following conditions ++// are met: ++// ++// Redistributions of source code must retain the above copyright ++// notice, this list of conditions and the following disclaimer. ++// ++// Redistributions in binary form must reproduce the above ++// copyright notice, this list of conditions and the following ++// disclaimer in the documentation and/or other materials provided ++// with the distribution. ++// ++// Neither the name of 3Dlabs Inc. Ltd. nor the names of its ++// contributors may be used to endorse or promote products derived ++// from this software without specific prior written permission. ++// ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ++// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ++// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ++// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, ++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, ++// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; ++// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ++// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ++// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++// POSSIBILITY OF SUCH DAMAGE. ++// ++ ++#include "SPVRemapper.h" ++#include "doc.h" ++ ++#include ++#include ++ ++namespace spv { ++ ++ // By default, just abort on error. Can be overridden via RegisterErrorHandler ++ spirvbin_t::errorfn_t spirvbin_t::errorHandler = [](const std::string&) { exit(5); }; ++ // By default, eat log messages. Can be overridden via RegisterLogHandler ++ spirvbin_t::logfn_t spirvbin_t::logHandler = [](const std::string&) { }; ++ ++ // This can be overridden to provide other message behavior if needed ++ void spirvbin_t::msg(int minVerbosity, int indent, const std::string& txt) const ++ { ++ if (verbose >= minVerbosity) ++ logHandler(std::string(indent, ' ') + txt); ++ } ++ ++ // hash opcode, with special handling for OpExtInst ++ std::uint32_t spirvbin_t::asOpCodeHash(unsigned word) ++ { ++ const spv::Op opCode = asOpCode(word); ++ ++ std::uint32_t offset = 0; ++ ++ switch (opCode) { ++ case spv::Op::OpExtInst: ++ offset += asId(word + 4); break; ++ default: ++ break; ++ } ++ ++ return std::uint32_t(opCode) * 19 + offset; // 19 = small prime ++ } ++ ++ spirvbin_t::range_t spirvbin_t::literalRange(spv::Op opCode) const ++ { ++ static const int maxCount = 1<<30; ++ ++ switch (opCode) { ++ case spv::Op::OpTypeFloat: // fall through... ++ case spv::Op::OpTypePointer: return range_t(2, 3); ++ case spv::Op::OpTypeInt: return range_t(2, 4); ++ // TODO: case spv::OpTypeImage: ++ // TODO: case spv::OpTypeSampledImage: ++ case spv::Op::OpTypeSampler: return range_t(3, 8); ++ case spv::Op::OpTypeVector: // fall through ++ case spv::Op::OpTypeMatrix: // ... ++ case spv::Op::OpTypePipe: return range_t(3, 4); ++ case spv::Op::OpConstant: return range_t(3, maxCount); ++ default: return range_t(0, 0); ++ } ++ } ++ ++ spirvbin_t::range_t spirvbin_t::typeRange(spv::Op opCode) const ++ { ++ static const int maxCount = 1<<30; ++ ++ if (isConstOp(opCode)) ++ return range_t(1, 2); ++ ++ switch (opCode) { ++ case spv::Op::OpTypeVector: // fall through ++ case spv::Op::OpTypeMatrix: // ... ++ case spv::Op::OpTypeSampler: // ... ++ case spv::Op::OpTypeArray: // ... ++ case spv::Op::OpTypeRuntimeArray: // ... ++ case spv::Op::OpTypePipe: return range_t(2, 3); ++ case spv::Op::OpTypeStruct: // fall through ++ case spv::Op::OpTypeFunction: return range_t(2, maxCount); ++ case spv::Op::OpTypePointer: return range_t(3, 4); ++ default: return range_t(0, 0); ++ } ++ } ++ ++ spirvbin_t::range_t spirvbin_t::constRange(spv::Op opCode) const ++ { ++ static const int maxCount = 1<<30; ++ ++ switch (opCode) { ++ case spv::Op::OpTypeArray: // fall through... ++ case spv::Op::OpTypeRuntimeArray: return range_t(3, 4); ++ case spv::Op::OpConstantComposite: return range_t(3, maxCount); ++ default: return range_t(0, 0); ++ } ++ } ++ ++ // Return the size of a type in 32-bit words. This currently only ++ // handles ints and floats, and is only invoked by queries which must be ++ // integer types. If ever needed, it can be generalized. ++ unsigned spirvbin_t::typeSizeInWords(spv::Id id) const ++ { ++ const unsigned typeStart = idPos(id); ++ const spv::Op opCode = asOpCode(typeStart); ++ ++ if (errorLatch) ++ return 0; ++ ++ switch (opCode) { ++ case spv::Op::OpTypeInt: // fall through... ++ case spv::Op::OpTypeFloat: return (spv[typeStart+2]+31)/32; ++ default: ++ return 0; ++ } ++ } ++ ++ // Looks up the type of a given const or variable ID, and ++ // returns its size in 32-bit words. ++ unsigned spirvbin_t::idTypeSizeInWords(spv::Id id) const ++ { ++ const auto tid_it = idTypeSizeMap.find(id); ++ if (tid_it == idTypeSizeMap.end()) { ++ error("type size for ID not found"); ++ return 0; ++ } ++ ++ return tid_it->second; ++ } ++ ++ // Is this an opcode we should remove when using --strip? ++ bool spirvbin_t::isStripOp(spv::Op opCode, unsigned start) const ++ { ++ switch (opCode) { ++ case spv::Op::OpSource: ++ case spv::Op::OpSourceExtension: ++ case spv::Op::OpName: ++ case spv::Op::OpMemberName: ++ case spv::Op::OpLine : ++ { ++ const std::string name = literalString(start + 2); ++ ++ std::vector::const_iterator it; ++ for (it = stripWhiteList.begin(); it < stripWhiteList.end(); it++) ++ { ++ if (name.find(*it) != std::string::npos) { ++ return false; ++ } ++ } ++ ++ return true; ++ } ++ default : ++ return false; ++ } ++ } ++ ++ // Return true if this opcode is flow control ++ bool spirvbin_t::isFlowCtrl(spv::Op opCode) const ++ { ++ switch (opCode) { ++ case spv::Op::OpBranchConditional: ++ case spv::Op::OpBranch: ++ case spv::Op::OpSwitch: ++ case spv::Op::OpLoopMerge: ++ case spv::Op::OpSelectionMerge: ++ case spv::Op::OpLabel: ++ case spv::Op::OpFunction: ++ case spv::Op::OpFunctionEnd: return true; ++ default: return false; ++ } ++ } ++ ++ // Return true if this opcode defines a type ++ bool spirvbin_t::isTypeOp(spv::Op opCode) const ++ { ++ switch (opCode) { ++ case spv::Op::OpTypeVoid: ++ case spv::Op::OpTypeBool: ++ case spv::Op::OpTypeInt: ++ case spv::Op::OpTypeFloat: ++ case spv::Op::OpTypeVector: ++ case spv::Op::OpTypeMatrix: ++ case spv::Op::OpTypeImage: ++ case spv::Op::OpTypeSampler: ++ case spv::Op::OpTypeArray: ++ case spv::Op::OpTypeRuntimeArray: ++ case spv::Op::OpTypeStruct: ++ case spv::Op::OpTypeOpaque: ++ case spv::Op::OpTypePointer: ++ case spv::Op::OpTypeFunction: ++ case spv::Op::OpTypeEvent: ++ case spv::Op::OpTypeDeviceEvent: ++ case spv::Op::OpTypeReserveId: ++ case spv::Op::OpTypeQueue: ++ case spv::Op::OpTypeSampledImage: ++ case spv::Op::OpTypePipe: return true; ++ default: return false; ++ } ++ } ++ ++ // Return true if this opcode defines a constant ++ bool spirvbin_t::isConstOp(spv::Op opCode) const ++ { ++ switch (opCode) { ++ case spv::Op::OpConstantSampler: ++ error("unimplemented constant type"); ++ return true; ++ ++ case spv::Op::OpConstantNull: ++ case spv::Op::OpConstantTrue: ++ case spv::Op::OpConstantFalse: ++ case spv::Op::OpConstantComposite: ++ case spv::Op::OpConstant: ++ return true; ++ ++ default: ++ return false; ++ } ++ } ++ ++ const auto inst_fn_nop = [](spv::Op, unsigned) { return false; }; ++ const auto op_fn_nop = [](spv::Id&) { }; ++ ++ // g++ doesn't like these defined in the class proper in an anonymous namespace. ++ // Dunno why. Also MSVC doesn't like the constexpr keyword. Also dunno why. ++ // Defining them externally seems to please both compilers, so, here they are. ++ const spv::Id spirvbin_t::unmapped = spv::Id(-10000); ++ const spv::Id spirvbin_t::unused = spv::Id(-10001); ++ const int spirvbin_t::header_size = 5; ++ ++ spv::Id spirvbin_t::nextUnusedId(spv::Id id) ++ { ++ while (isNewIdMapped(id)) // search for an unused ID ++ ++id; ++ ++ return id; ++ } ++ ++ spv::Id spirvbin_t::localId(spv::Id id, spv::Id newId) ++ { ++ //assert(id != spv::NoResult && newId != spv::NoResult); ++ ++ if (id > bound()) { ++ error(std::string("ID out of range: ") + std::to_string(id)); ++ return spirvbin_t::unused; ++ } ++ ++ if (id >= idMapL.size()) ++ idMapL.resize(id+1, unused); ++ ++ if (newId != unmapped && newId != unused) { ++ if (isOldIdUnused(id)) { ++ error(std::string("ID unused in module: ") + std::to_string(id)); ++ return spirvbin_t::unused; ++ } ++ ++ if (!isOldIdUnmapped(id)) { ++ error(std::string("ID already mapped: ") + std::to_string(id) + " -> " ++ + std::to_string(localId(id))); ++ ++ return spirvbin_t::unused; ++ } ++ ++ if (isNewIdMapped(newId)) { ++ error(std::string("ID already used in module: ") + std::to_string(newId)); ++ return spirvbin_t::unused; ++ } ++ ++ msg(4, 4, std::string("map: ") + std::to_string(id) + " -> " + std::to_string(newId)); ++ setMapped(newId); ++ largestNewId = std::max(largestNewId, newId); ++ } ++ ++ return idMapL[id] = newId; ++ } ++ ++ // Parse a literal string from the SPIR binary and return it as an std::string ++ // Due to C++11 RValue references, this doesn't copy the result string. ++ std::string spirvbin_t::literalString(unsigned word) const ++ { ++ std::string literal; ++ const spirword_t * pos = spv.data() + word; ++ ++ literal.reserve(16); ++ ++ do { ++ spirword_t word = *pos; ++ for (int i = 0; i < 4; i++) { ++ char c = word & 0xff; ++ if (c == '\0') ++ return literal; ++ literal += c; ++ word >>= 8; ++ } ++ pos++; ++ } while (true); ++ } ++ ++ void spirvbin_t::applyMap() ++ { ++ msg(3, 2, std::string("Applying map: ")); ++ ++ // Map local IDs through the ID map ++ process(inst_fn_nop, // ignore instructions ++ [this](spv::Id& id) { ++ id = localId(id); ++ ++ if (errorLatch) ++ return; ++ ++ assert(id != unused && id != unmapped); ++ } ++ ); ++ } ++ ++ // Find free IDs for anything we haven't mapped ++ void spirvbin_t::mapRemainder() ++ { ++ msg(3, 2, std::string("Remapping remainder: ")); ++ ++ spv::Id unusedId = 1; // can't use 0: that's NoResult ++ spirword_t maxBound = 0; ++ ++ for (spv::Id id = 0; id < idMapL.size(); ++id) { ++ if (isOldIdUnused(id)) ++ continue; ++ ++ // Find a new mapping for any used but unmapped IDs ++ if (isOldIdUnmapped(id)) { ++ localId(id, unusedId = nextUnusedId(unusedId)); ++ if (errorLatch) ++ return; ++ } ++ ++ if (isOldIdUnmapped(id)) { ++ error(std::string("old ID not mapped: ") + std::to_string(id)); ++ return; ++ } ++ ++ // Track max bound ++ maxBound = std::max(maxBound, localId(id) + 1); ++ ++ if (errorLatch) ++ return; ++ } ++ ++ bound(maxBound); // reset header ID bound to as big as it now needs to be ++ } ++ ++ // Mark debug instructions for stripping ++ void spirvbin_t::stripDebug() ++ { ++ // Strip instructions in the stripOp set: debug info. ++ process( ++ [&](spv::Op opCode, unsigned start) { ++ // remember opcodes we want to strip later ++ if (isStripOp(opCode, start)) ++ stripInst(start); ++ return true; ++ }, ++ op_fn_nop); ++ } ++ ++ // Mark instructions that refer to now-removed IDs for stripping ++ void spirvbin_t::stripDeadRefs() ++ { ++ process( ++ [&](spv::Op opCode, unsigned start) { ++ // strip opcodes pointing to removed data ++ switch (opCode) { ++ case spv::Op::OpName: ++ case spv::Op::OpMemberName: ++ case spv::Op::OpDecorate: ++ case spv::Op::OpMemberDecorate: ++ if (idPosR.find(asId(start+1)) == idPosR.end()) ++ stripInst(start); ++ break; ++ default: ++ break; // leave it alone ++ } ++ ++ return true; ++ }, ++ op_fn_nop); ++ ++ strip(); ++ } ++ ++ // Update local maps of ID, type, etc positions ++ void spirvbin_t::buildLocalMaps() ++ { ++ msg(2, 2, std::string("build local maps: ")); ++ ++ mapped.clear(); ++ idMapL.clear(); ++// preserve nameMap, so we don't clear that. ++ fnPos.clear(); ++ fnCalls.clear(); ++ typeConstPos.clear(); ++ idPosR.clear(); ++ entryPoint = spv::NoResult; ++ largestNewId = 0; ++ ++ idMapL.resize(bound(), unused); ++ ++ int fnStart = 0; ++ spv::Id fnRes = spv::NoResult; ++ ++ // build local Id and name maps ++ process( ++ [&](spv::Op opCode, unsigned start) { ++ unsigned word = start+1; ++ spv::Id typeId = spv::NoResult; ++ ++ if (spv::InstructionDesc[std::uint32_t(opCode)].hasType()) ++ typeId = asId(word++); ++ ++ // If there's a result ID, remember the size of its type ++ if (spv::InstructionDesc[std::uint32_t(opCode)].hasResult()) { ++ const spv::Id resultId = asId(word++); ++ idPosR[resultId] = start; ++ ++ if (typeId != spv::NoResult) { ++ const unsigned idTypeSize = typeSizeInWords(typeId); ++ ++ if (errorLatch) ++ return false; ++ ++ if (idTypeSize != 0) ++ idTypeSizeMap[resultId] = idTypeSize; ++ } ++ } ++ ++ if (opCode == spv::Op::OpName) { ++ const spv::Id target = asId(start+1); ++ const std::string name = literalString(start+2); ++ nameMap[name] = target; ++ ++ } else if (opCode == spv::Op::OpFunctionCall) { ++ ++fnCalls[asId(start + 3)]; ++ } else if (opCode == spv::Op::OpEntryPoint) { ++ entryPoint = asId(start + 2); ++ } else if (opCode == spv::Op::OpFunction) { ++ if (fnStart != 0) { ++ error("nested function found"); ++ return false; ++ } ++ ++ fnStart = start; ++ fnRes = asId(start + 2); ++ } else if (opCode == spv::Op::OpFunctionEnd) { ++ assert(fnRes != spv::NoResult); ++ if (fnStart == 0) { ++ error("function end without function start"); ++ return false; ++ } ++ ++ fnPos[fnRes] = range_t(fnStart, start + asWordCount(start)); ++ fnStart = 0; ++ } else if (isConstOp(opCode)) { ++ if (errorLatch) ++ return false; ++ ++ assert(asId(start + 2) != spv::NoResult); ++ typeConstPos.insert(start); ++ } else if (isTypeOp(opCode)) { ++ assert(asId(start + 1) != spv::NoResult); ++ typeConstPos.insert(start); ++ } ++ ++ return false; ++ }, ++ ++ [this](spv::Id& id) { localId(id, unmapped); } ++ ); ++ } ++ ++ // Validate the SPIR header ++ void spirvbin_t::validate() const ++ { ++ msg(2, 2, std::string("validating: ")); ++ ++ if (spv.size() < header_size) { ++ error("file too short: "); ++ return; ++ } ++ ++ if (magic() != spv::MagicNumber) { ++ error("bad magic number"); ++ return; ++ } ++ ++ // field 1 = version ++ // field 2 = generator magic ++ // field 3 = result bound ++ ++ if (schemaNum() != 0) { ++ error("bad schema, must be 0"); ++ return; ++ } ++ } ++ ++ int spirvbin_t::processInstruction(unsigned word, instfn_t instFn, idfn_t idFn) ++ { ++ const auto instructionStart = word; ++ const unsigned wordCount = asWordCount(instructionStart); ++ const int nextInst = word++ + wordCount; ++ spv::Op opCode = asOpCode(instructionStart); ++ ++ if (nextInst > int(spv.size())) { ++ error("spir instruction terminated too early"); ++ return -1; ++ } ++ ++ // Base for computing number of operands; will be updated as more is learned ++ unsigned numOperands = wordCount - 1; ++ ++ if (instFn(opCode, instructionStart)) ++ return nextInst; ++ ++ // Read type and result ID from instruction desc table ++ if (spv::InstructionDesc[std::uint32_t(opCode)].hasType()) { ++ idFn(asId(word++)); ++ --numOperands; ++ } ++ ++ if (spv::InstructionDesc[std::uint32_t(opCode)].hasResult()) { ++ idFn(asId(word++)); ++ --numOperands; ++ } ++ ++ // Extended instructions: currently, assume everything is an ID. ++ // TODO: add whatever data we need for exceptions to that ++ if (opCode == spv::Op::OpExtInst) { ++ ++ idFn(asId(word)); // Instruction set is an ID that also needs to be mapped ++ ++ word += 2; // instruction set, and instruction from set ++ numOperands -= 2; ++ ++ for (unsigned op=0; op < numOperands; ++op) ++ idFn(asId(word++)); // ID ++ ++ return nextInst; ++ } ++ ++ // Circular buffer so we can look back at previous unmapped values during the mapping pass. ++ static const unsigned idBufferSize = 4; ++ spv::Id idBuffer[idBufferSize]; ++ unsigned idBufferPos = 0; ++ ++ // Store IDs from instruction in our map ++ for (int op = 0; numOperands > 0; ++op, --numOperands) { ++ // SpecConstantOp is special: it includes the operands of another opcode which is ++ // given as a literal in the 3rd word. We will switch over to pretending that the ++ // opcode being processed is the literal opcode value of the SpecConstantOp. See the ++ // SPIRV spec for details. This way we will handle IDs and literals as appropriate for ++ // the embedded op. ++ if (opCode == spv::Op::OpSpecConstantOp) { ++ if (op == 0) { ++ opCode = asOpCode(word++); // this is the opcode embedded in the SpecConstantOp. ++ --numOperands; ++ } ++ } ++ ++ switch (spv::InstructionDesc[std::uint32_t(opCode)].operands.getClass(op)) { ++ case spv::OperandId: ++ case spv::OperandScope: ++ case spv::OperandMemorySemantics: ++ idBuffer[idBufferPos] = asId(word); ++ idBufferPos = (idBufferPos + 1) % idBufferSize; ++ idFn(asId(word++)); ++ break; ++ ++ case spv::OperandVariableIds: ++ for (unsigned i = 0; i < numOperands; ++i) ++ idFn(asId(word++)); ++ return nextInst; ++ ++ case spv::OperandVariableLiterals: ++ // for clarity ++ // if (opCode == spv::OpDecorate && asDecoration(word - 1) == spv::DecorationBuiltIn) { ++ // ++word; ++ // --numOperands; ++ // } ++ // word += numOperands; ++ return nextInst; ++ ++ case spv::OperandVariableLiteralId: { ++ if (opCode == spv::Op::OpSwitch) { ++ // word-2 is the position of the selector ID. OpSwitch Literals match its type. ++ // In case the IDs are currently being remapped, we get the word[-2] ID from ++ // the circular idBuffer. ++ const unsigned literalSizePos = (idBufferPos+idBufferSize-2) % idBufferSize; ++ const unsigned literalSize = idTypeSizeInWords(idBuffer[literalSizePos]); ++ const unsigned numLiteralIdPairs = (nextInst-word) / (1+literalSize); ++ ++ if (errorLatch) ++ return -1; ++ ++ for (unsigned arg=0; arg instPos; ++ instPos.reserve(unsigned(spv.size()) / 16); // initial estimate; can grow if needed. ++ ++ // Build local table of instruction start positions ++ process( ++ [&](spv::Op, unsigned start) { instPos.push_back(start); return true; }, ++ op_fn_nop); ++ ++ if (errorLatch) ++ return; ++ ++ // Window size for context-sensitive canonicalization values ++ // Empirical best size from a single data set. TODO: Would be a good tunable. ++ // We essentially perform a little convolution around each instruction, ++ // to capture the flavor of nearby code, to hopefully match to similar ++ // code in other modules. ++ static const unsigned windowSize = 2; ++ ++ for (unsigned entry = 0; entry < unsigned(instPos.size()); ++entry) { ++ const unsigned start = instPos[entry]; ++ const spv::Op opCode = asOpCode(start); ++ ++ if (opCode == spv::Op::OpFunction) ++ fnId = asId(start + 2); ++ ++ if (opCode == spv::Op::OpFunctionEnd) ++ fnId = spv::NoResult; ++ ++ if (fnId != spv::NoResult) { // if inside a function ++ if (spv::InstructionDesc[std::uint32_t(opCode)].hasResult()) { ++ const unsigned word = start + (spv::InstructionDesc[std::uint32_t(opCode)].hasType() ? 2 : 1); ++ const spv::Id resId = asId(word); ++ std::uint32_t hashval = fnId * 17; // small prime ++ ++ for (unsigned i = entry-1; i >= entry-windowSize; --i) { ++ if (asOpCode(instPos[i]) == spv::Op::OpFunction) ++ break; ++ hashval = hashval * 30103 + asOpCodeHash(instPos[i]); // 30103 = semiarbitrary prime ++ } ++ ++ for (unsigned i = entry; i <= entry + windowSize; ++i) { ++ if (asOpCode(instPos[i]) == spv::Op::OpFunctionEnd) ++ break; ++ hashval = hashval * 30103 + asOpCodeHash(instPos[i]); // 30103 = semiarbitrary prime ++ } ++ ++ if (isOldIdUnmapped(resId)) { ++ localId(resId, nextUnusedId(hashval % softTypeIdLimit + firstMappedID)); ++ if (errorLatch) ++ return; ++ } ++ ++ } ++ } ++ } ++ ++ spv::Op thisOpCode(spv::Op::OpNop); ++ std::unordered_map opCounter; ++ int idCounter(0); ++ fnId = spv::NoResult; ++ ++ process( ++ [&](spv::Op opCode, unsigned start) { ++ switch (opCode) { ++ case spv::Op::OpFunction: ++ // Reset counters at each function ++ idCounter = 0; ++ opCounter.clear(); ++ fnId = asId(start + 2); ++ break; ++ ++ case spv::Op::OpImageSampleImplicitLod: ++ case spv::Op::OpImageSampleExplicitLod: ++ case spv::Op::OpImageSampleDrefImplicitLod: ++ case spv::Op::OpImageSampleDrefExplicitLod: ++ case spv::Op::OpImageSampleProjImplicitLod: ++ case spv::Op::OpImageSampleProjExplicitLod: ++ case spv::Op::OpImageSampleProjDrefImplicitLod: ++ case spv::Op::OpImageSampleProjDrefExplicitLod: ++ case spv::Op::OpDot: ++ case spv::Op::OpCompositeExtract: ++ case spv::Op::OpCompositeInsert: ++ case spv::Op::OpVectorShuffle: ++ case spv::Op::OpLabel: ++ case spv::Op::OpVariable: ++ ++ case spv::Op::OpAccessChain: ++ case spv::Op::OpLoad: ++ case spv::Op::OpStore: ++ case spv::Op::OpCompositeConstruct: ++ case spv::Op::OpFunctionCall: ++ ++opCounter[std::uint32_t(opCode)]; ++ idCounter = 0; ++ thisOpCode = opCode; ++ break; ++ default: ++ thisOpCode = spv::Op::OpNop; ++ } ++ ++ return false; ++ }, ++ ++ [&](spv::Id& id) { ++ if (thisOpCode != spv::Op::OpNop) { ++ ++idCounter; ++ const std::uint32_t hashval = ++ // Explicitly cast operands to unsigned int to avoid integer ++ // promotion to signed int followed by integer overflow, ++ // which would result in undefined behavior. ++ static_cast(opCounter[std::uint32_t(thisOpCode)]) ++ * std::uint32_t(thisOpCode) ++ * 50047 ++ + idCounter ++ + static_cast(fnId) * 117; ++ ++ if (isOldIdUnmapped(id)) ++ localId(id, nextUnusedId(hashval % softTypeIdLimit + firstMappedID)); ++ } ++ }); ++ } ++ ++ // EXPERIMENTAL: forward IO and uniform load/stores into operands ++ // This produces invalid Schema-0 SPIRV ++ void spirvbin_t::forwardLoadStores() ++ { ++ idset_t fnLocalVars; // set of function local vars ++ idmap_t idMap; // Map of load result IDs to what they load ++ ++ // EXPERIMENTAL: Forward input and access chain loads into consumptions ++ process( ++ [&](spv::Op opCode, unsigned start) { ++ // Add inputs and uniforms to the map ++ if ((opCode == spv::Op::OpVariable && asWordCount(start) == 4) && ++ (spv[start+3] == std::uint32_t(spv::StorageClass::Uniform) || ++ spv[start+3] == std::uint32_t(spv::StorageClass::UniformConstant) || ++ spv[start+3] == std::uint32_t(spv::StorageClass::Input))) ++ fnLocalVars.insert(asId(start+2)); ++ ++ if (opCode == spv::Op::OpAccessChain && fnLocalVars.count(asId(start+3)) > 0) ++ fnLocalVars.insert(asId(start+2)); ++ ++ if (opCode == spv::Op::OpLoad && fnLocalVars.count(asId(start+3)) > 0) { ++ idMap[asId(start+2)] = asId(start+3); ++ stripInst(start); ++ } ++ ++ return false; ++ }, ++ ++ [&](spv::Id& id) { if (idMap.find(id) != idMap.end()) id = idMap[id]; } ++ ); ++ ++ if (errorLatch) ++ return; ++ ++ // EXPERIMENTAL: Implicit output stores ++ fnLocalVars.clear(); ++ idMap.clear(); ++ ++ process( ++ [&](spv::Op opCode, unsigned start) { ++ // Add inputs and uniforms to the map ++ if ((opCode == spv::Op::OpVariable && asWordCount(start) == 4) && ++ (spv[start+3] == std::uint32_t(spv::StorageClass::Output))) ++ fnLocalVars.insert(asId(start+2)); ++ ++ if (opCode == spv::Op::OpStore && fnLocalVars.count(asId(start+1)) > 0) { ++ idMap[asId(start+2)] = asId(start+1); ++ stripInst(start); ++ } ++ ++ return false; ++ }, ++ op_fn_nop); ++ ++ if (errorLatch) ++ return; ++ ++ process( ++ inst_fn_nop, ++ [&](spv::Id& id) { if (idMap.find(id) != idMap.end()) id = idMap[id]; } ++ ); ++ ++ if (errorLatch) ++ return; ++ ++ strip(); // strip out data we decided to eliminate ++ } ++ ++ // optimize loads and stores ++ void spirvbin_t::optLoadStore() ++ { ++ idset_t fnLocalVars; // candidates for removal (only locals) ++ idmap_t idMap; // Map of load result IDs to what they load ++ blockmap_t blockMap; // Map of IDs to blocks they first appear in ++ int blockNum = 0; // block count, to avoid crossing flow control ++ ++ // Find all the function local pointers stored at most once, and not via access chains ++ process( ++ [&](spv::Op opCode, unsigned start) { ++ const int wordCount = asWordCount(start); ++ ++ // Count blocks, so we can avoid crossing flow control ++ if (isFlowCtrl(opCode)) ++ ++blockNum; ++ ++ // Add local variables to the map ++ if ((opCode == spv::Op::OpVariable && spv[start+3] == std::uint32_t(spv::StorageClass::Function) && asWordCount(start) == 4)) { ++ fnLocalVars.insert(asId(start+2)); ++ return true; ++ } ++ ++ // Ignore process vars referenced via access chain ++ if ((opCode == spv::Op::OpAccessChain || opCode == spv::Op::OpInBoundsAccessChain) && fnLocalVars.count(asId(start+3)) > 0) { ++ fnLocalVars.erase(asId(start+3)); ++ idMap.erase(asId(start+3)); ++ return true; ++ } ++ ++ if (opCode == spv::Op::OpLoad && fnLocalVars.count(asId(start+3)) > 0) { ++ const spv::Id varId = asId(start+3); ++ ++ // Avoid loads before stores ++ if (idMap.find(varId) == idMap.end()) { ++ fnLocalVars.erase(varId); ++ idMap.erase(varId); ++ } ++ ++ // don't do for volatile references ++ if (wordCount > 4 && (spv[start+4] & std::uint32_t(spv::MemoryAccessMask::Volatile))) { ++ fnLocalVars.erase(varId); ++ idMap.erase(varId); ++ } ++ ++ // Handle flow control ++ if (blockMap.find(varId) == blockMap.end()) { ++ blockMap[varId] = blockNum; // track block we found it in. ++ } else if (blockMap[varId] != blockNum) { ++ fnLocalVars.erase(varId); // Ignore if crosses flow control ++ idMap.erase(varId); ++ } ++ ++ return true; ++ } ++ ++ if (opCode == spv::Op::OpStore && fnLocalVars.count(asId(start+1)) > 0) { ++ const spv::Id varId = asId(start+1); ++ ++ if (idMap.find(varId) == idMap.end()) { ++ idMap[varId] = asId(start+2); ++ } else { ++ // Remove if it has more than one store to the same pointer ++ fnLocalVars.erase(varId); ++ idMap.erase(varId); ++ } ++ ++ // don't do for volatile references ++ if (wordCount > 3 && (spv[start+3] & std::uint32_t(spv::MemoryAccessMask::Volatile))) { ++ fnLocalVars.erase(asId(start+3)); ++ idMap.erase(asId(start+3)); ++ } ++ ++ // Handle flow control ++ if (blockMap.find(varId) == blockMap.end()) { ++ blockMap[varId] = blockNum; // track block we found it in. ++ } else if (blockMap[varId] != blockNum) { ++ fnLocalVars.erase(varId); // Ignore if crosses flow control ++ idMap.erase(varId); ++ } ++ ++ return true; ++ } ++ ++ return false; ++ }, ++ ++ // If local var id used anywhere else, don't eliminate ++ [&](spv::Id& id) { ++ if (fnLocalVars.count(id) > 0) { ++ fnLocalVars.erase(id); ++ idMap.erase(id); ++ } ++ } ++ ); ++ ++ if (errorLatch) ++ return; ++ ++ process( ++ [&](spv::Op opCode, unsigned start) { ++ if (opCode == spv::Op::OpLoad && fnLocalVars.count(asId(start+3)) > 0) ++ idMap[asId(start+2)] = idMap[asId(start+3)]; ++ return false; ++ }, ++ op_fn_nop); ++ ++ if (errorLatch) ++ return; ++ ++ // Chase replacements to their origins, in case there is a chain such as: ++ // 2 = store 1 ++ // 3 = load 2 ++ // 4 = store 3 ++ // 5 = load 4 ++ // We want to replace uses of 5 with 1. ++ for (const auto& idPair : idMap) { ++ spv::Id id = idPair.first; ++ while (idMap.find(id) != idMap.end()) // Chase to end of chain ++ id = idMap[id]; ++ ++ idMap[idPair.first] = id; // replace with final result ++ } ++ ++ // Remove the load/store/variables for the ones we've discovered ++ process( ++ [&](spv::Op opCode, unsigned start) { ++ if ((opCode == spv::Op::OpLoad && fnLocalVars.count(asId(start+3)) > 0) || ++ (opCode == spv::Op::OpStore && fnLocalVars.count(asId(start+1)) > 0) || ++ (opCode == spv::Op::OpVariable && fnLocalVars.count(asId(start+2)) > 0)) { ++ ++ stripInst(start); ++ return true; ++ } ++ ++ return false; ++ }, ++ ++ [&](spv::Id& id) { ++ if (idMap.find(id) != idMap.end()) id = idMap[id]; ++ } ++ ); ++ ++ if (errorLatch) ++ return; ++ ++ strip(); // strip out data we decided to eliminate ++ } ++ ++ // remove bodies of uncalled functions ++ void spirvbin_t::dceFuncs() ++ { ++ msg(3, 2, std::string("Removing Dead Functions: ")); ++ ++ // TODO: There are more efficient ways to do this. ++ bool changed = true; ++ ++ while (changed) { ++ changed = false; ++ ++ for (auto fn = fnPos.begin(); fn != fnPos.end(); ) { ++ if (fn->first == entryPoint) { // don't DCE away the entry point! ++ ++fn; ++ continue; ++ } ++ ++ const auto call_it = fnCalls.find(fn->first); ++ ++ if (call_it == fnCalls.end() || call_it->second == 0) { ++ changed = true; ++ stripRange.push_back(fn->second); ++ ++ // decrease counts of called functions ++ process( ++ [&](spv::Op opCode, unsigned start) { ++ if (opCode == spv::Op::OpFunctionCall) { ++ const auto call_it = fnCalls.find(asId(start + 3)); ++ if (call_it != fnCalls.end()) { ++ if (--call_it->second <= 0) ++ fnCalls.erase(call_it); ++ } ++ } ++ ++ return true; ++ }, ++ op_fn_nop, ++ fn->second.first, ++ fn->second.second); ++ ++ if (errorLatch) ++ return; ++ ++ fn = fnPos.erase(fn); ++ } else ++fn; ++ } ++ } ++ } ++ ++ // remove unused function variables + decorations ++ void spirvbin_t::dceVars() ++ { ++ msg(3, 2, std::string("DCE Vars: ")); ++ ++ std::unordered_map varUseCount; ++ ++ // Count function variable use ++ process( ++ [&](spv::Op opCode, unsigned start) { ++ if (opCode == spv::Op::OpVariable) { ++ ++varUseCount[asId(start+2)]; ++ return true; ++ } else if (opCode == spv::Op::OpEntryPoint) { ++ const int wordCount = asWordCount(start); ++ for (int i = 4; i < wordCount; i++) { ++ ++varUseCount[asId(start+i)]; ++ } ++ return true; ++ } else ++ return false; ++ }, ++ ++ [&](spv::Id& id) { if (varUseCount[id]) ++varUseCount[id]; } ++ ); ++ ++ if (errorLatch) ++ return; ++ ++ // Remove single-use function variables + associated decorations and names ++ process( ++ [&](spv::Op opCode, unsigned start) { ++ spv::Id id = spv::NoResult; ++ if (opCode == spv::Op::OpVariable) ++ id = asId(start+2); ++ if (opCode == spv::Op::OpDecorate || opCode == spv::Op::OpName) ++ id = asId(start+1); ++ ++ if (id != spv::NoResult && varUseCount[id] == 1) ++ stripInst(start); ++ ++ return true; ++ }, ++ op_fn_nop); ++ } ++ ++ // remove unused types ++ void spirvbin_t::dceTypes() ++ { ++ std::vector isType(bound(), false); ++ ++ // for speed, make O(1) way to get to type query (map is log(n)) ++ for (const auto typeStart : typeConstPos) ++ isType[asTypeConstId(typeStart)] = true; ++ ++ std::unordered_map typeUseCount; ++ ++ // This is not the most efficient algorithm, but this is an offline tool, and ++ // it's easy to write this way. Can be improved opportunistically if needed. ++ bool changed = true; ++ while (changed) { ++ changed = false; ++ strip(); ++ typeUseCount.clear(); ++ ++ // Count total type usage ++ process(inst_fn_nop, ++ [&](spv::Id& id) { if (isType[id]) ++typeUseCount[id]; } ++ ); ++ ++ if (errorLatch) ++ return; ++ ++ // Remove single reference types ++ for (const auto typeStart : typeConstPos) { ++ const spv::Id typeId = asTypeConstId(typeStart); ++ if (typeUseCount[typeId] == 1) { ++ changed = true; ++ --typeUseCount[typeId]; ++ stripInst(typeStart); ++ } ++ } ++ ++ if (errorLatch) ++ return; ++ } ++ } ++ ++#ifdef NOTDEF ++ bool spirvbin_t::matchType(const spirvbin_t::globaltypes_t& globalTypes, spv::Id lt, spv::Id gt) const ++ { ++ // Find the local type id "lt" and global type id "gt" ++ const auto lt_it = typeConstPosR.find(lt); ++ if (lt_it == typeConstPosR.end()) ++ return false; ++ ++ const auto typeStart = lt_it->second; ++ ++ // Search for entry in global table ++ const auto gtype = globalTypes.find(gt); ++ if (gtype == globalTypes.end()) ++ return false; ++ ++ const auto& gdata = gtype->second; ++ ++ // local wordcount and opcode ++ const int wordCount = asWordCount(typeStart); ++ const spv::Op opCode = asOpCode(typeStart); ++ ++ // no type match if opcodes don't match, or operand count doesn't match ++ if (opCode != opOpCode(gdata[0]) || wordCount != opWordCount(gdata[0])) ++ return false; ++ ++ const unsigned numOperands = wordCount - 2; // all types have a result ++ ++ const auto cmpIdRange = [&](range_t range) { ++ for (int x=range.first; xsecond; ++ } ++ ++ // Hash types to canonical values. This can return ID collisions (it's a bit ++ // inevitable): it's up to the caller to handle that gracefully. ++ std::uint32_t spirvbin_t::hashType(unsigned typeStart) const ++ { ++ const unsigned wordCount = asWordCount(typeStart); ++ const spv::Op opCode = asOpCode(typeStart); ++ ++ switch (opCode) { ++ case spv::Op::OpTypeVoid: return 0; ++ case spv::Op::OpTypeBool: return 1; ++ case spv::Op::OpTypeInt: return 3 + (spv[typeStart+3]); ++ case spv::Op::OpTypeFloat: return 5; ++ case spv::Op::OpTypeVector: ++ return 6 + hashType(idPos(spv[typeStart+2])) * (spv[typeStart+3] - 1); ++ case spv::Op::OpTypeMatrix: ++ return 30 + hashType(idPos(spv[typeStart+2])) * (spv[typeStart+3] - 1); ++ case spv::Op::OpTypeImage: ++ return 120 + hashType(idPos(spv[typeStart+2])) + ++ spv[typeStart+3] + // dimensionality ++ spv[typeStart+4] * 8 * 16 + // depth ++ spv[typeStart+5] * 4 * 16 + // arrayed ++ spv[typeStart+6] * 2 * 16 + // multisampled ++ spv[typeStart+7] * 1 * 16; // format ++ case spv::Op::OpTypeSampler: ++ return 500; ++ case spv::Op::OpTypeSampledImage: ++ return 502; ++ case spv::Op::OpTypeArray: ++ return 501 + hashType(idPos(spv[typeStart+2])) * spv[typeStart+3]; ++ case spv::Op::OpTypeRuntimeArray: ++ return 5000 + hashType(idPos(spv[typeStart+2])); ++ case spv::Op::OpTypeStruct: ++ { ++ std::uint32_t hash = 10000; ++ for (unsigned w=2; w < wordCount; ++w) ++ hash += w * hashType(idPos(spv[typeStart+w])); ++ return hash; ++ } ++ ++ case spv::Op::OpTypeOpaque: return 6000 + spv[typeStart+2]; ++ case spv::Op::OpTypePointer: return 100000 + hashType(idPos(spv[typeStart+3])); ++ case spv::Op::OpTypeFunction: ++ { ++ std::uint32_t hash = 200000; ++ for (unsigned w=2; w < wordCount; ++w) ++ hash += w * hashType(idPos(spv[typeStart+w])); ++ return hash; ++ } ++ ++ case spv::Op::OpTypeEvent: return 300000; ++ case spv::Op::OpTypeDeviceEvent: return 300001; ++ case spv::Op::OpTypeReserveId: return 300002; ++ case spv::Op::OpTypeQueue: return 300003; ++ case spv::Op::OpTypePipe: return 300004; ++ case spv::Op::OpConstantTrue: return 300007; ++ case spv::Op::OpConstantFalse: return 300008; ++ case spv::Op::OpConstantComposite: ++ { ++ std::uint32_t hash = 300011 + hashType(idPos(spv[typeStart+1])); ++ for (unsigned w=3; w < wordCount; ++w) ++ hash += w * hashType(idPos(spv[typeStart+w])); ++ return hash; ++ } ++ case spv::Op::OpConstant: ++ { ++ std::uint32_t hash = 400011 + hashType(idPos(spv[typeStart+1])); ++ for (unsigned w=3; w < wordCount; ++w) ++ hash += w * spv[typeStart+w]; ++ return hash; ++ } ++ case spv::Op::OpConstantNull: ++ { ++ std::uint32_t hash = 500009 + hashType(idPos(spv[typeStart+1])); ++ return hash; ++ } ++ case spv::Op::OpConstantSampler: ++ { ++ std::uint32_t hash = 600011 + hashType(idPos(spv[typeStart+1])); ++ for (unsigned w=3; w < wordCount; ++w) ++ hash += w * spv[typeStart+w]; ++ return hash; ++ } ++ ++ default: ++ error("unknown type opcode"); ++ return 0; ++ } ++ } ++ ++ void spirvbin_t::mapTypeConst() ++ { ++ globaltypes_t globalTypeMap; ++ ++ msg(3, 2, std::string("Remapping Consts & Types: ")); ++ ++ static const std::uint32_t softTypeIdLimit = 3011; // small prime. TODO: get from options ++ static const std::uint32_t firstMappedID = 8; // offset into ID space ++ ++ for (auto& typeStart : typeConstPos) { ++ const spv::Id resId = asTypeConstId(typeStart); ++ const std::uint32_t hashval = hashType(typeStart); ++ ++ if (errorLatch) ++ return; ++ ++ if (isOldIdUnmapped(resId)) { ++ localId(resId, nextUnusedId(hashval % softTypeIdLimit + firstMappedID)); ++ if (errorLatch) ++ return; ++ } ++ } ++ } ++ ++ // Strip a single binary by removing ranges given in stripRange ++ void spirvbin_t::strip() ++ { ++ if (stripRange.empty()) // nothing to do ++ return; ++ ++ // Sort strip ranges in order of traversal ++ std::sort(stripRange.begin(), stripRange.end()); ++ ++ // Allocate a new binary big enough to hold old binary ++ // We'll step this iterator through the strip ranges as we go through the binary ++ auto strip_it = stripRange.begin(); ++ ++ int strippedPos = 0; ++ for (unsigned word = 0; word < unsigned(spv.size()); ++word) { ++ while (strip_it != stripRange.end() && word >= strip_it->second) ++ ++strip_it; ++ ++ if (strip_it == stripRange.end() || word < strip_it->first || word >= strip_it->second) ++ spv[strippedPos++] = spv[word]; ++ } ++ ++ spv.resize(strippedPos); ++ stripRange.clear(); ++ ++ buildLocalMaps(); ++ } ++ ++ // Strip a single binary by removing ranges given in stripRange ++ void spirvbin_t::remap(std::uint32_t opts) ++ { ++ options = opts; ++ ++ // Set up opcode tables from SpvDoc ++ spv::Parameterize(); ++ ++ validate(); // validate header ++ buildLocalMaps(); // build ID maps ++ ++ msg(3, 4, std::string("ID bound: ") + std::to_string(bound())); ++ ++ if (options & STRIP) stripDebug(); ++ if (errorLatch) return; ++ ++ strip(); // strip out data we decided to eliminate ++ if (errorLatch) return; ++ ++ if (options & OPT_LOADSTORE) optLoadStore(); ++ if (errorLatch) return; ++ ++ if (options & OPT_FWD_LS) forwardLoadStores(); ++ if (errorLatch) return; ++ ++ if (options & DCE_FUNCS) dceFuncs(); ++ if (errorLatch) return; ++ ++ if (options & DCE_VARS) dceVars(); ++ if (errorLatch) return; ++ ++ if (options & DCE_TYPES) dceTypes(); ++ if (errorLatch) return; ++ ++ strip(); // strip out data we decided to eliminate ++ if (errorLatch) return; ++ ++ stripDeadRefs(); // remove references to things we DCEed ++ if (errorLatch) return; ++ ++ // after the last strip, we must clean any debug info referring to now-deleted data ++ ++ if (options & MAP_TYPES) mapTypeConst(); ++ if (errorLatch) return; ++ ++ if (options & MAP_NAMES) mapNames(); ++ if (errorLatch) return; ++ ++ if (options & MAP_FUNCS) mapFnBodies(); ++ if (errorLatch) return; ++ ++ if (options & MAP_ALL) { ++ mapRemainder(); // map any unmapped IDs ++ if (errorLatch) return; ++ ++ applyMap(); // Now remap each shader to the new IDs we've come up with ++ if (errorLatch) return; ++ } ++ } ++ ++ // remap from a memory image ++ void spirvbin_t::remap(std::vector& in_spv, const std::vector& whiteListStrings, ++ std::uint32_t opts) ++ { ++ stripWhiteList = whiteListStrings; ++ spv.swap(in_spv); ++ remap(opts); ++ spv.swap(in_spv); ++ } ++ ++ // remap from a memory image - legacy interface without white list ++ void spirvbin_t::remap(std::vector& in_spv, std::uint32_t opts) ++ { ++ stripWhiteList.clear(); ++ spv.swap(in_spv); ++ remap(opts); ++ spv.swap(in_spv); ++ } ++ ++} // namespace SPV ++ +diff --git a/src/3rdparty/glslang/SPIRV/SPVRemapper.h b/src/3rdparty/glslang/SPIRV/SPVRemapper.h +new file mode 100644 +index 0000000..d4c2295 +--- /dev/null ++++ b/src/3rdparty/glslang/SPIRV/SPVRemapper.h +@@ -0,0 +1,300 @@ ++// ++// Copyright (C) 2015 LunarG, Inc. ++// ++// All rights reserved. ++// ++// Redistribution and use in source and binary forms, with or without ++// modification, are permitted provided that the following conditions ++// are met: ++// ++// Redistributions of source code must retain the above copyright ++// notice, this list of conditions and the following disclaimer. ++// ++// Redistributions in binary form must reproduce the above ++// copyright notice, this list of conditions and the following ++// disclaimer in the documentation and/or other materials provided ++// with the distribution. ++// ++// Neither the name of 3Dlabs Inc. Ltd. nor the names of its ++// contributors may be used to endorse or promote products derived ++// from this software without specific prior written permission. ++// ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ++// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ++// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ++// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, ++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, ++// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; ++// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ++// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ++// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++// POSSIBILITY OF SUCH DAMAGE. ++// ++ ++#ifndef SPIRVREMAPPER_H ++#define SPIRVREMAPPER_H ++ ++#include ++#include ++#include ++#include ++ ++#ifdef GLSLANG_IS_SHARED_LIBRARY ++ #ifdef _WIN32 ++ #ifdef GLSLANG_EXPORTING ++ #define GLSLANG_EXPORT __declspec(dllexport) ++ #else ++ #define GLSLANG_EXPORT __declspec(dllimport) ++ #endif ++ #elif __GNUC__ >= 4 ++ #define GLSLANG_EXPORT __attribute__((visibility("default"))) ++ #endif ++#endif // GLSLANG_IS_SHARED_LIBRARY ++#ifndef GLSLANG_EXPORT ++#define GLSLANG_EXPORT ++#endif ++ ++namespace spv { ++ ++class spirvbin_base_t ++{ ++public: ++ enum Options { ++ NONE = 0, ++ STRIP = (1<<0), ++ MAP_TYPES = (1<<1), ++ MAP_NAMES = (1<<2), ++ MAP_FUNCS = (1<<3), ++ DCE_FUNCS = (1<<4), ++ DCE_VARS = (1<<5), ++ DCE_TYPES = (1<<6), ++ OPT_LOADSTORE = (1<<7), ++ OPT_FWD_LS = (1<<8), // EXPERIMENTAL: PRODUCES INVALID SCHEMA-0 SPIRV ++ MAP_ALL = (MAP_TYPES | MAP_NAMES | MAP_FUNCS), ++ DCE_ALL = (DCE_FUNCS | DCE_VARS | DCE_TYPES), ++ OPT_ALL = (OPT_LOADSTORE), ++ ++ ALL_BUT_STRIP = (MAP_ALL | DCE_ALL | OPT_ALL), ++ DO_EVERYTHING = (STRIP | ALL_BUT_STRIP) ++ }; ++}; ++ ++} // namespace SPV ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "spirv.hpp11" ++ ++namespace spv { ++ ++static inline constexpr Id NoResult = 0; ++ ++// class to hold SPIR-V binary data for remapping, DCE, and debug stripping ++class GLSLANG_EXPORT spirvbin_t : public spirvbin_base_t ++{ ++public: ++ spirvbin_t(int verbose = 0) : entryPoint(spv::NoResult), largestNewId(0), verbose(verbose), errorLatch(false) ++ { } ++ ++ virtual ~spirvbin_t() { } ++ ++ // remap on an existing binary in memory ++ void remap(std::vector& spv, const std::vector& whiteListStrings, ++ std::uint32_t opts = DO_EVERYTHING); ++ ++ // remap on an existing binary in memory - legacy interface without white list ++ void remap(std::vector& spv, std::uint32_t opts = DO_EVERYTHING); ++ ++ // Type for error/log handler functions ++ typedef std::function errorfn_t; ++ typedef std::function logfn_t; ++ ++ // Register error/log handling functions (can be lambda fn / functor / etc) ++ static void registerErrorHandler(errorfn_t handler) { errorHandler = handler; } ++ static void registerLogHandler(logfn_t handler) { logHandler = handler; } ++ ++protected: ++ // This can be overridden to provide other message behavior if needed ++ virtual void msg(int minVerbosity, int indent, const std::string& txt) const; ++ ++private: ++ // Local to global, or global to local ID map ++ typedef std::unordered_map idmap_t; ++ typedef std::unordered_set idset_t; ++ typedef std::unordered_map blockmap_t; ++ ++ void remap(std::uint32_t opts = DO_EVERYTHING); ++ ++ // Map of names to IDs ++ typedef std::unordered_map namemap_t; ++ ++ typedef std::uint32_t spirword_t; ++ ++ typedef std::pair range_t; ++ typedef std::function idfn_t; ++ typedef std::function instfn_t; ++ ++ // Special Values for ID map: ++ static const spv::Id unmapped; // unchanged from default value ++ static const spv::Id unused; // unused ID ++ static const int header_size; // SPIR header = 5 words ++ ++ class id_iterator_t; ++ ++ // For mapping type entries between different shaders ++ typedef std::vector typeentry_t; ++ typedef std::map globaltypes_t; ++ ++ // A set that preserves position order, and a reverse map ++ typedef std::set posmap_t; ++ typedef std::unordered_map posmap_rev_t; ++ ++ // Maps and ID to the size of its base type, if known. ++ typedef std::unordered_map typesize_map_t; ++ ++ // handle error ++ void error(const std::string& txt) const { errorLatch = true; errorHandler(txt); } ++ ++ bool isConstOp(spv::Op opCode) const; ++ bool isTypeOp(spv::Op opCode) const; ++ bool isStripOp(spv::Op opCode) const; ++ bool isFlowCtrl(spv::Op opCode) const; ++ range_t literalRange(spv::Op opCode) const; ++ range_t typeRange(spv::Op opCode) const; ++ range_t constRange(spv::Op opCode) const; ++ unsigned typeSizeInWords(spv::Id id) const; ++ unsigned idTypeSizeInWords(spv::Id id) const; ++ ++ bool isStripOp(spv::Op opCode, unsigned start) const; ++ ++ spv::Id& asId(unsigned word) { return spv[word]; } ++ const spv::Id& asId(unsigned word) const { return spv[word]; } ++ spv::Op asOpCode(unsigned word) const { return opOpCode(spv[word]); } ++ std::uint32_t asOpCodeHash(unsigned word); ++ spv::Decoration asDecoration(unsigned word) const { return spv::Decoration(spv[word]); } ++ unsigned asWordCount(unsigned word) const { return opWordCount(spv[word]); } ++ spv::Id asTypeConstId(unsigned word) const { return asId(word + (isTypeOp(asOpCode(word)) ? 1 : 2)); } ++ unsigned idPos(spv::Id id) const; ++ ++ static unsigned opWordCount(spirword_t data) { return data >> spv::WordCountShift; } ++ static spv::Op opOpCode(spirword_t data) { return spv::Op(data & spv::OpCodeMask); } ++ ++ // Header access & set methods ++ spirword_t magic() const { return spv[0]; } // return magic number ++ spirword_t bound() const { return spv[3]; } // return Id bound from header ++ spirword_t bound(spirword_t b) { return spv[3] = b; } ++ spirword_t genmagic() const { return spv[2]; } // generator magic ++ spirword_t genmagic(spirword_t m) { return spv[2] = m; } ++ spirword_t schemaNum() const { return spv[4]; } // schema number from header ++ ++ // Mapping fns: get ++ spv::Id localId(spv::Id id) const { return idMapL[id]; } ++ ++ // Mapping fns: set ++ inline spv::Id localId(spv::Id id, spv::Id newId); ++ void countIds(spv::Id id); ++ ++ // Return next unused new local ID. ++ // NOTE: boost::dynamic_bitset would be more efficient due to find_next(), ++ // which std::vector doens't have. ++ inline spv::Id nextUnusedId(spv::Id id); ++ ++ void buildLocalMaps(); ++ std::string literalString(unsigned word) const; // Return literal as a std::string ++ int literalStringWords(const std::string& str) const { return (int(str.size())+4)/4; } ++ ++ bool isNewIdMapped(spv::Id newId) const { return isMapped(newId); } ++ bool isOldIdUnmapped(spv::Id oldId) const { return localId(oldId) == unmapped; } ++ bool isOldIdUnused(spv::Id oldId) const { return localId(oldId) == unused; } ++ bool isOldIdMapped(spv::Id oldId) const { return !isOldIdUnused(oldId) && !isOldIdUnmapped(oldId); } ++ bool isFunction(spv::Id oldId) const { return fnPos.find(oldId) != fnPos.end(); } ++ ++ // bool matchType(const globaltypes_t& globalTypes, spv::Id lt, spv::Id gt) const; ++ // spv::Id findType(const globaltypes_t& globalTypes, spv::Id lt) const; ++ std::uint32_t hashType(unsigned typeStart) const; ++ ++ spirvbin_t& process(instfn_t, idfn_t, unsigned begin = 0, unsigned end = 0); ++ int processInstruction(unsigned word, instfn_t, idfn_t); ++ ++ void validate() const; ++ void mapTypeConst(); ++ void mapFnBodies(); ++ void optLoadStore(); ++ void dceFuncs(); ++ void dceVars(); ++ void dceTypes(); ++ void mapNames(); ++ void foldIds(); // fold IDs to smallest space ++ void forwardLoadStores(); // load store forwarding (EXPERIMENTAL) ++ void offsetIds(); // create relative offset IDs ++ ++ void applyMap(); // remap per local name map ++ void mapRemainder(); // map any IDs we haven't touched yet ++ void stripDebug(); // strip all debug info ++ void stripDeadRefs(); // strips debug info for now-dead references after DCE ++ void strip(); // remove debug symbols ++ ++ std::vector spv; // SPIR words ++ ++ std::vector stripWhiteList; ++ ++ namemap_t nameMap; // ID names from OpName ++ ++ // Since we want to also do binary ops, we can't use std::vector. we could use ++ // boost::dynamic_bitset, but we're trying to avoid a boost dependency. ++ typedef std::uint64_t bits_t; ++ std::vector mapped; // which new IDs have been mapped ++ static const int mBits = sizeof(bits_t) * 4; ++ ++ bool isMapped(spv::Id id) const { return id < maxMappedId() && ((mapped[id/mBits] & (1LL<<(id%mBits))) != 0); } ++ void setMapped(spv::Id id) { resizeMapped(id); mapped[id/mBits] |= (1LL<<(id%mBits)); } ++ void resizeMapped(spv::Id id) { if (id >= maxMappedId()) mapped.resize(id/mBits+1, 0); } ++ size_t maxMappedId() const { return mapped.size() * mBits; } ++ ++ // Add a strip range for a given instruction starting at 'start' ++ // Note: avoiding brace initializers to please older versions os MSVC. ++ void stripInst(unsigned start) { stripRange.push_back(range_t(start, start + asWordCount(start))); } ++ ++ // Function start and end. use unordered_map because we'll have ++ // many fewer functions than IDs. ++ std::unordered_map fnPos; ++ ++ // Which functions are called, anywhere in the module, with a call count ++ std::unordered_map fnCalls; ++ ++ posmap_t typeConstPos; // word positions that define types & consts (ordered) ++ posmap_rev_t idPosR; // reverse map from IDs to positions ++ typesize_map_t idTypeSizeMap; // maps each ID to its type size, if known. ++ ++ std::vector idMapL; // ID {M}ap from {L}ocal to {G}lobal IDs ++ ++ spv::Id entryPoint; // module entry point ++ spv::Id largestNewId; // biggest new ID we have mapped anything to ++ ++ // Sections of the binary to strip, given as [begin,end) ++ std::vector stripRange; ++ ++ // processing options: ++ std::uint32_t options; ++ int verbose; // verbosity level ++ ++ // Error latch: this is set if the error handler is ever executed. It would be better to ++ // use a try/catch block and throw, but that's not desired for certain environments, so ++ // this is the alternative. ++ mutable bool errorLatch; ++ ++ static errorfn_t errorHandler; ++ static logfn_t logHandler; ++}; ++ ++} // namespace SPV ++ ++#endif // SPIRVREMAPPER_H +diff --git a/src/3rdparty/glslang/SPIRV/SpvTools.cpp b/src/3rdparty/glslang/SPIRV/SpvTools.cpp +index d1b411f..0951133 100644 +--- a/src/3rdparty/glslang/SPIRV/SpvTools.cpp ++++ b/src/3rdparty/glslang/SPIRV/SpvTools.cpp +@@ -46,6 +46,7 @@ + #include "spirv-tools/optimizer.hpp" + #include "glslang/MachineIndependent/localintermediate.h" + ++namespace QtShaderTools { + namespace glslang { + + // Translate glslang's view of target versioning to what SPIRV-Tools uses. +@@ -313,5 +314,6 @@ void SpirvToolsStripDebugInfo(const glslang::TIntermediate& intermediate, + } + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif +diff --git a/src/3rdparty/glslang/SPIRV/SpvTools.h b/src/3rdparty/glslang/SPIRV/SpvTools.h +index 4558572..6178296 100644 +--- a/src/3rdparty/glslang/SPIRV/SpvTools.h ++++ b/src/3rdparty/glslang/SPIRV/SpvTools.h +@@ -53,6 +53,7 @@ + #include "GlslangToSpv.h" + #include "Logger.h" + ++namespace QtShaderTools { + namespace glslang { + + #if ENABLE_OPT +@@ -105,5 +106,6 @@ GLSLANG_EXPORT void SpirvToolsStripDebugInfo(const glslang::TIntermediate& inter + #endif + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // GLSLANG_SPV_TOOLS_H +diff --git a/src/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp b/src/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp +index 1ef2449..7c6297e 100644 +--- a/src/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp ++++ b/src/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp +@@ -36,6 +36,7 @@ + #include "../Include/ShHandle.h" + #include "../MachineIndependent/Versions.h" + ++namespace QtShaderTools { + // + // Here is where real machine specific high-level data would be defined. + // +@@ -70,3 +71,4 @@ bool TGenericCompiler::compile(TIntermNode* /*root*/, int /*version*/, EProfile + + return haveValidObjectCode; + } ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp b/src/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp +index 5df39b8..9b96f05 100644 +--- a/src/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp ++++ b/src/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp +@@ -39,6 +39,7 @@ + #include "../Include/Common.h" + #include "../Include/ShHandle.h" + ++namespace QtShaderTools { + // + // Actual link object, derived from the shader handle base classes. + // +@@ -85,3 +86,5 @@ void DeleteBindingList(TShHandleBase* bindingList) + { + delete bindingList; + } ++ ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/Include/BaseTypes.h b/src/3rdparty/glslang/glslang/Include/BaseTypes.h +index 3678afe..d50fc86 100644 +--- a/src/3rdparty/glslang/glslang/Include/BaseTypes.h ++++ b/src/3rdparty/glslang/glslang/Include/BaseTypes.h +@@ -39,6 +39,7 @@ + #ifndef _BASICTYPES_INCLUDED_ + #define _BASICTYPES_INCLUDED_ + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -678,5 +679,6 @@ __inline int getTypeRank(TBasicType type) + } + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // _BASICTYPES_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/Include/Common.h b/src/3rdparty/glslang/glslang/Include/Common.h +index 0c14260..cc2934f 100644 +--- a/src/3rdparty/glslang/glslang/Include/Common.h ++++ b/src/3rdparty/glslang/glslang/Include/Common.h +@@ -95,7 +95,7 @@ std::string to_string(const T& val) { + #endif + + // Allow compilation to WASI which does not support threads yet. +-#ifdef __wasi__ ++#ifdef __wasi__ + #define DISABLE_THREAD_SUPPORT + #endif + +@@ -114,6 +114,7 @@ std::string to_string(const T& val) { + void operator delete[](void*) { } \ + void operator delete[](void *, void *) { } + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -123,12 +124,13 @@ namespace glslang { + typedef std::basic_string , TStringAllocator> TString; + + } // end namespace glslang ++} // namespace QtShaderTools + + // Repackage the std::hash for use by unordered map/set with a TString key. + namespace std { + +- template<> struct hash { +- std::size_t operator()(const glslang::TString& s) const ++ template<> struct hash { ++ std::size_t operator()(const QtShaderTools::glslang::TString& s) const + { + const unsigned _FNV_offset_basis = 2166136261U; + const unsigned _FNV_prime = 16777619U; +@@ -146,6 +148,7 @@ namespace std { + }; + } + ++namespace QtShaderTools { + namespace glslang { + + inline TString* NewPoolTString(const char* s) +@@ -303,5 +306,6 @@ template int IntLog2(T n) + } + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // _COMMON_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/Include/ConstantUnion.h b/src/3rdparty/glslang/glslang/Include/ConstantUnion.h +index bf6b8a8..bfaa478 100644 +--- a/src/3rdparty/glslang/glslang/Include/ConstantUnion.h ++++ b/src/3rdparty/glslang/glslang/Include/ConstantUnion.h +@@ -41,6 +41,7 @@ + #include "../Include/Common.h" + #include "../Include/BaseTypes.h" + ++namespace QtShaderTools { + namespace glslang { + + class TConstUnion { +@@ -945,5 +946,6 @@ protected: + }; + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // _CONSTANT_UNION_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/Include/InfoSink.h b/src/3rdparty/glslang/glslang/Include/InfoSink.h +index 2629339..0ed7d59 100644 +--- a/src/3rdparty/glslang/glslang/Include/InfoSink.h ++++ b/src/3rdparty/glslang/glslang/Include/InfoSink.h +@@ -36,9 +36,13 @@ + #define _INFOSINK_INCLUDED_ + + #include "../Include/Common.h" +-#include ++ ++// QNX says no ++//#include ++ + #include + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -104,16 +108,16 @@ public: + snprintf(locText, maxSize, ":%d", loc.line); + } + +- if(loc.getFilename() == nullptr && shaderFileName != nullptr && absolute) { +- append(std::filesystem::absolute(shaderFileName).string()); +- } else { +- std::string location = loc.getStringNameOrNum(false); +- if (absolute) { +- append(std::filesystem::absolute(location).string()); +- } else { +- append(location); +- } +- } ++ // if(loc.getFilename() == nullptr && shaderFileName != nullptr && absolute) { ++ // append(std::filesystem::absolute(shaderFileName).string()); ++ // } else { ++ // std::string location = loc.getStringNameOrNum(false); ++ // if (absolute) { ++ // append(std::filesystem::absolute(location).string()); ++ // } else { ++ // append(location); ++ // } ++ // } + + append(locText); + append(": "); +@@ -164,5 +168,6 @@ public: + glslang::TInfoSinkBase info; + glslang::TInfoSinkBase debug; + }; ++} // namespace QtShaderTools + + #endif // _INFOSINK_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/Include/InitializeGlobals.h b/src/3rdparty/glslang/glslang/Include/InitializeGlobals.h +index b7fdd7a..d196bad 100644 +--- a/src/3rdparty/glslang/glslang/Include/InitializeGlobals.h ++++ b/src/3rdparty/glslang/glslang/Include/InitializeGlobals.h +@@ -35,10 +35,12 @@ + #ifndef __INITIALIZE_GLOBALS_INCLUDED_ + #define __INITIALIZE_GLOBALS_INCLUDED_ + ++namespace QtShaderTools { + namespace glslang { + + inline bool InitializePoolIndex() { return true; } // DEPRECATED: No need to call + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // __INITIALIZE_GLOBALS_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/Include/PoolAlloc.h b/src/3rdparty/glslang/glslang/Include/PoolAlloc.h +index 6b6dfd6..4cf64b8 100644 +--- a/src/3rdparty/glslang/glslang/Include/PoolAlloc.h ++++ b/src/3rdparty/glslang/glslang/Include/PoolAlloc.h +@@ -67,6 +67,7 @@ + #include + #include + ++namespace QtShaderTools { + namespace glslang { + + // If we are using guard blocks, we must track each individual +@@ -323,5 +324,6 @@ protected: + }; + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // _POOLALLOC_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/Include/ShHandle.h b/src/3rdparty/glslang/glslang/Include/ShHandle.h +index dee47c0..edc9b18 100644 +--- a/src/3rdparty/glslang/glslang/Include/ShHandle.h ++++ b/src/3rdparty/glslang/glslang/Include/ShHandle.h +@@ -47,6 +47,8 @@ + #include "../MachineIndependent/Versions.h" + #include "InfoSink.h" + ++namespace QtShaderTools { ++ + class TCompiler; + class TLinker; + class TUniformMap; +@@ -173,4 +175,6 @@ void DeleteCompiler(TCompiler*); + + void DeleteUniformMap(TUniformMap*); + ++} //namespace QtShaderTools ++ + #endif // _SHHANDLE_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/Include/SpirvIntrinsics.h b/src/3rdparty/glslang/glslang/Include/SpirvIntrinsics.h +index 0082a4d..1b01536 100644 +--- a/src/3rdparty/glslang/glslang/Include/SpirvIntrinsics.h ++++ b/src/3rdparty/glslang/glslang/Include/SpirvIntrinsics.h +@@ -41,6 +41,7 @@ + #include "Common.h" + #include + ++namespace QtShaderTools { + namespace glslang { + + class TIntermTyped; +@@ -138,3 +139,4 @@ struct TSpirvType { + }; + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/Include/Types.h b/src/3rdparty/glslang/glslang/Include/Types.h +index d3124ac..2676d23 100644 +--- a/src/3rdparty/glslang/glslang/Include/Types.h ++++ b/src/3rdparty/glslang/glslang/Include/Types.h +@@ -48,6 +48,11 @@ + + #include + ++#ifdef restrict ++#undef restrict ++#endif ++ ++namespace QtShaderTools { + namespace glslang { + + class TIntermAggregate; +@@ -3084,5 +3089,6 @@ protected: + }; + + } // end namespace glslang ++} // end namespace QtShaderTools + + #endif // _TYPES_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/Include/arrays.h b/src/3rdparty/glslang/glslang/Include/arrays.h +index 261af68..e16c3a3 100644 +--- a/src/3rdparty/glslang/glslang/Include/arrays.h ++++ b/src/3rdparty/glslang/glslang/Include/arrays.h +@@ -43,6 +43,7 @@ + + #include + ++namespace QtShaderTools { + namespace glslang { + + // This is used to mean there is no size yet (unsized), it is waiting to get a size from somewhere else. +@@ -369,5 +370,6 @@ protected: + }; + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // _ARRAYS_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/Include/intermediate.h b/src/3rdparty/glslang/glslang/Include/intermediate.h +index 9e520de..7518b24 100644 +--- a/src/3rdparty/glslang/glslang/Include/intermediate.h ++++ b/src/3rdparty/glslang/glslang/Include/intermediate.h +@@ -52,6 +52,7 @@ + #include "Types.h" + #include "ConstantUnion.h" + ++namespace QtShaderTools { + namespace glslang { + + class TIntermediate; +@@ -1905,5 +1906,6 @@ inline bool SameSpecializationConstants(TIntermTyped* node1, TIntermTyped* node2 + } + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // __INTERMEDIATE_H +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp +index d6528b7..c00b7f4 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp +@@ -44,6 +44,7 @@ + + namespace { + ++using namespace QtShaderTools; + using namespace glslang; + + const double pi = 3.1415926535897932384626433832795; +@@ -51,6 +52,7 @@ const double pi = 3.1415926535897932384626433832795; + } // end anonymous namespace + + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -1305,3 +1307,4 @@ TIntermTyped* TIntermediate::foldSwizzle(TIntermTyped* node, TSwizzleSelectors + ++namespace QtShaderTools { + namespace glslang { + + void TInfoSinkBase::append(const char* s) +@@ -111,3 +112,4 @@ void TInfoSinkBase::append(const TString& t) + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp +index 34bc529..be5ca66 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp +@@ -56,6 +56,7 @@ + #include "Initialize.h" + #include "span.h" + ++namespace QtShaderTools { + namespace glslang { + + // TODO: ARB_Compatability: do full extension support +@@ -11549,3 +11550,4 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.h b/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.h +index 42c32dd..73fb5a5 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.h ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.h +@@ -43,6 +43,7 @@ + #include "SymbolTable.h" + #include "Versions.h" + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -111,5 +112,6 @@ protected: + // Using PureOperatorBuiltins=false is deprecated. + constexpr bool PureOperatorBuiltins = true; + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // _INITIALIZE_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/IntermTraverse.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/IntermTraverse.cpp +index 447e8cb..f1b8704 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/IntermTraverse.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/IntermTraverse.cpp +@@ -37,6 +37,7 @@ + + #include "../Include/intermediate.h" + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -338,3 +339,4 @@ void TIntermVariableDecl::traverse(TIntermTraverser *it) + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp +index 90410f0..862ec69 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp +@@ -50,6 +50,7 @@ + #include + #include + ++namespace QtShaderTools { + namespace glslang { + + //////////////////////////////////////////////////////////////////////////// +@@ -3923,3 +3924,4 @@ const char* TIntermediate::getResourceName(TResourceType res) + + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/LiveTraverser.h b/src/3rdparty/glslang/glslang/MachineIndependent/LiveTraverser.h +index 76ccfec..d1b4e7f 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/LiveTraverser.h ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/LiveTraverser.h +@@ -44,6 +44,7 @@ + #include + #include + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -207,3 +208,4 @@ private: + }; + + } // namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp +index 45ada17..9f7eecd 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp +@@ -40,8 +40,9 @@ + + #include "ParseHelper.h" + +-extern int yyparse(glslang::TParseContext*); ++extern int yyparse(QtShaderTools::glslang::TParseContext*); + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -769,3 +770,4 @@ void TParseContextBase::finish() + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp +index 8f1a381..71aee42 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp +@@ -48,6 +48,8 @@ + #include "Versions.h" + #include "preprocessor/PpContext.h" + ++namespace QtShaderTools { ++ + extern int yyparse(glslang::TParseContext*); + + namespace glslang { +@@ -11466,3 +11468,4 @@ TLayoutFormat TParseContext::mapLegacyLayoutFormat(TLayoutFormat legacyLayoutFor + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h b/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h +index bf5cab2..35fdff6 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h +@@ -55,6 +55,7 @@ + #include "Scan.h" + #include "attribute.h" + ++namespace QtShaderTools { + namespace glslang { + + struct TPragma { +@@ -595,5 +596,6 @@ protected: + }; + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // _PARSER_HELPER_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp +index 93a3b0d..70aac51 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp +@@ -42,6 +42,7 @@ + #define THREAD_LOCAL thread_local + #endif + ++namespace QtShaderTools { + namespace glslang { + + namespace { +@@ -304,3 +305,4 @@ void TAllocation::checkAllocList() const + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.cpp +index 29baf1f..ceae0e3 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.cpp +@@ -37,6 +37,7 @@ + #include "../Include/intermediate.h" + #include "RemoveTree.h" + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -122,3 +123,4 @@ void RemoveAllTreeNodes(TIntermNode* root) + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.h b/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.h +index 1ed0156..33b53d5 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.h ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.h +@@ -34,8 +34,10 @@ + + #pragma once + ++namespace QtShaderTools { + namespace glslang { + + void RemoveAllTreeNodes(TIntermNode*); + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp +index 8a08a3c..5736e91 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp +@@ -57,8 +57,9 @@ + #include "preprocessor/PpContext.h" + #include "preprocessor/PpTokens.h" + ++namespace QtShaderTools { + // Required to avoid missing prototype warnings for some compilers +-int yylex(YYSTYPE*, glslang::TParseContext&); ++int yylex(YYSTYPE*, QtShaderTools::glslang::TParseContext&); + + namespace glslang { + +@@ -2139,3 +2140,4 @@ int TScanContext::secondGenerationImage() + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/Scan.h b/src/3rdparty/glslang/glslang/MachineIndependent/Scan.h +index 24b75cf..44be905 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/Scan.h ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/Scan.h +@@ -38,6 +38,7 @@ + + #include "Versions.h" + ++namespace QtShaderTools { + namespace glslang { + + // Use a global end-of-input character, so no translation is needed across +@@ -272,5 +273,6 @@ protected: + }; + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // _GLSLANG_SCAN_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/ScanContext.h b/src/3rdparty/glslang/glslang/MachineIndependent/ScanContext.h +index ce2145e..277b46b 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/ScanContext.h ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/ScanContext.h +@@ -42,6 +42,7 @@ + + #include "ParseHelper.h" + ++namespace QtShaderTools { + namespace glslang { + + class TPpContext; +@@ -96,3 +97,4 @@ protected: + }; + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp +index 62d7253..78725c9 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp +@@ -87,6 +87,7 @@ std::mutex init_lock; + #endif + + ++using namespace QtShaderTools; + using namespace glslang; + + // Create a language specific version of parseables. +@@ -1330,7 +1331,7 @@ bool CompileDeferred( + // + // ShInitialize() should be called exactly once per process, not per thread. + // +-int ShInitialize() ++int ShInitialize_Qt() + { + #ifndef DISABLE_THREAD_SUPPORT + const std::lock_guard lock(init_lock); +@@ -1348,28 +1349,28 @@ int ShInitialize() + // objects. + // + +-ShHandle ShConstructCompiler(const EShLanguage language, int /*debugOptions unused*/) ++ShHandle ShConstructCompiler_Qt(const EShLanguage language, int debugOptions) + { + TShHandleBase* base = static_cast(ConstructCompiler(language, 0)); + + return reinterpret_cast(base); + } + +-ShHandle ShConstructLinker(const EShExecutable executable, int /*debugOptions unused*/) ++ShHandle ShConstructLinker_Qt(const EShExecutable executable, int debugOptions) + { + TShHandleBase* base = static_cast(ConstructLinker(executable, 0)); + + return reinterpret_cast(base); + } + +-ShHandle ShConstructUniformMap() ++ShHandle ShConstructUniformMap_Qt() + { + TShHandleBase* base = static_cast(ConstructUniformMap()); + + return reinterpret_cast(base); + } + +-void ShDestruct(ShHandle handle) ++void ShDestruct_Qt(ShHandle handle) + { + if (handle == nullptr) + return; +@@ -1387,7 +1388,7 @@ void ShDestruct(ShHandle handle) + // + // Cleanup symbol tables + // +-int ShFinalize() ++int ShFinalize_Qt() + { + #ifndef DISABLE_THREAD_SUPPORT + const std::lock_guard lock(init_lock); +@@ -1439,7 +1440,7 @@ int ShFinalize() + // Return: The return value is really boolean, indicating + // success (1) or failure (0). + // +-int ShCompile( ++int ShCompile_Qt( + const ShHandle handle, + const char* const shaderStrings[], + const int numStrings, +@@ -1497,7 +1498,7 @@ int ShCompile( + // Return: The return value of is really boolean, indicating + // success or failure. + // +-int ShLinkExt( ++int ShLinkExt_Qt( + const ShHandle linkHandle, + const ShHandle compHandles[], + const int numHandles) +@@ -1548,7 +1549,7 @@ int ShLinkExt( + // ShSetEncrpytionMethod is a place-holder for specifying + // how source code is encrypted. + // +-void ShSetEncryptionMethod(ShHandle handle) ++void ShSetEncryptionMethod_Qt(ShHandle handle) + { + if (handle == nullptr) + return; +@@ -1557,7 +1558,7 @@ void ShSetEncryptionMethod(ShHandle handle) + // + // Return any compiler/linker/uniformmap log of messages for the application. + // +-const char* ShGetInfoLog(const ShHandle handle) ++const char* ShGetInfoLog_Qt(const ShHandle handle) + { + if (handle == nullptr) + return nullptr; +@@ -1580,7 +1581,7 @@ const char* ShGetInfoLog(const ShHandle handle) + // Return the resulting binary code from the link process. Structure + // is machine dependent. + // +-const void* ShGetExecutable(const ShHandle handle) ++const void* ShGetExecutable_Qt(const ShHandle handle) + { + if (handle == nullptr) + return nullptr; +@@ -1602,7 +1603,7 @@ const void* ShGetExecutable(const ShHandle handle) + // Return: The return value of is really boolean, indicating + // success or failure. + // +-int ShSetVirtualAttributeBindings(const ShHandle handle, const ShBindingTable* table) ++int ShSetVirtualAttributeBindings_Qt(const ShHandle handle, const ShBindingTable* table) + { + if (handle == nullptr) + return 0; +@@ -1621,7 +1622,7 @@ int ShSetVirtualAttributeBindings(const ShHandle handle, const ShBindingTable* t + // + // Let the linker know where the predefined attributes have to live. + // +-int ShSetFixedAttributeBindings(const ShHandle handle, const ShBindingTable* table) ++int ShSetFixedAttributeBindings_Qt(const ShHandle handle, const ShBindingTable* table) + { + if (handle == nullptr) + return 0; +@@ -1639,7 +1640,7 @@ int ShSetFixedAttributeBindings(const ShHandle handle, const ShBindingTable* tab + // + // Some attribute locations are off-limits to the linker... + // +-int ShExcludeAttributes(const ShHandle handle, int *attributes, int count) ++int ShExcludeAttributes_Qt(const ShHandle handle, int *attributes, int count) + { + if (handle == nullptr) + return 0; +@@ -1660,7 +1661,7 @@ int ShExcludeAttributes(const ShHandle handle, int *attributes, int count) + // Return: The return value of is really boolean, indicating + // success or failure. + // +-int ShGetUniformLocation(const ShHandle handle, const char* name) ++int ShGetUniformLocation_Qt(const ShHandle handle, const char* name) + { + if (handle == nullptr) + return -1; +@@ -1684,6 +1685,7 @@ int ShGetUniformLocation(const ShHandle handle, const char* name) + // See more detailed comment in ShaderLang.h + // + ++namespace QtShaderTools { + namespace glslang { + + Version GetVersion() +@@ -1718,12 +1720,12 @@ int GetKhronosToolId() + + bool InitializeProcess() + { +- return ShInitialize() != 0; ++ return ShInitialize_Qt() != 0; + } + + void FinalizeProcess() + { +- ShFinalize(); ++ ShFinalize_Qt(); + } + + class TDeferredCompiler : public TCompiler { +@@ -2254,3 +2256,4 @@ bool TProgram::mapIO(TIoMapResolver* pResolver, TIoMapper* pIoMapper) + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp +index 1d08797..f7069a5 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp +@@ -41,6 +41,7 @@ + #include "../Include/Types.h" + #include "ParseHelper.h" + ++namespace QtShaderTools { + namespace glslang { + + bool TSpirvTypeParameter::operator==(const TSpirvTypeParameter& rhs) const +@@ -358,3 +359,4 @@ TSpirvInstruction* TParseContext::mergeSpirvInstruction(const TSourceLoc& loc, T + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp +index fd8a690..ce00a61 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp +@@ -44,6 +44,7 @@ + + #include "SymbolTable.h" + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -523,3 +524,4 @@ void TSymbolTable::copyTable(const TSymbolTable& copyOf) + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h b/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h +index 9161927..f76c71e 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h +@@ -68,10 +68,10 @@ + #include "../Include/Common.h" + #include "../Include/intermediate.h" + #include "../Include/InfoSink.h" +- ++#include + #include +-#include + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -992,5 +992,6 @@ protected: + }; + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // _SYMBOL_TABLE_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp +index e8ce150..c8433e2 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp +@@ -149,6 +149,7 @@ + #include "parseVersions.h" + #include "localintermediate.h" + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -1553,3 +1554,4 @@ void TParseVersions::requireSpv(const TSourceLoc& loc, const char *op, unsigned + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/Versions.h b/src/3rdparty/glslang/glslang/MachineIndependent/Versions.h +index 48a7c5b..dc3e8d9 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/Versions.h ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/Versions.h +@@ -63,6 +63,7 @@ typedef enum : unsigned { + LAST_ELEMENT_MARKER(EProfileCount), + } EProfile; + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -407,5 +408,6 @@ const char* const AEP_mesh_shader[] = { E_GL_NV_mesh_shader, E_GL_EXT_mesh_shade + const int Num_AEP_mesh_shader = sizeof(AEP_mesh_shader)/sizeof(AEP_mesh_shader[0]); + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // _VERSIONS_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/attribute.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/attribute.cpp +index 19e8faa..a73370a 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/attribute.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/attribute.cpp +@@ -38,6 +38,7 @@ + #include "../Include/intermediate.h" + #include "ParseHelper.h" + ++namespace QtShaderTools { + namespace glslang { + + // extract integers out of attribute arguments stored in attribute aggregate +@@ -374,3 +375,4 @@ void TParseContext::handleFunctionAttributes(const TSourceLoc& loc, const TAttri + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/attribute.h b/src/3rdparty/glslang/glslang/MachineIndependent/attribute.h +index 3b480c6..9bc8c43 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/attribute.h ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/attribute.h +@@ -40,6 +40,7 @@ + #include "../Include/Common.h" + #include "../Include/ConstantUnion.h" + ++namespace QtShaderTools { + namespace glslang { + + enum TAttributeType { +@@ -148,5 +149,6 @@ namespace glslang { + typedef TList TAttributes; + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // _ATTRIBUTE_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp +index f0ec8c6..bd5e7a2 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp +@@ -90,9 +90,9 @@ Jutta Degener, 1995 + #include "../Public/ShaderLang.h" + #include "attribute.h" + ++using namespace QtShaderTools; + using namespace glslang; + +- + #line 97 "MachineIndependent/glslang_tab.cpp" + + # ifndef YY_CAST +@@ -749,8 +749,9 @@ typedef enum yysymbol_kind_t yysymbol_kind_t; + #define parseContext (*pParseContext) + #define yyerror(context, msg) context->parserError(msg) + ++namespace QtShaderTools { + extern int yylex(YYSTYPE*, TParseContext&); +- ++} // QtShaderTools + + #line 756 "MachineIndependent/glslang_tab.cpp" + +@@ -5190,6 +5191,8 @@ yydestruct (const char *yymsg, + | yyparse. | + `----------*/ + ++namespace QtShaderTools { ++ + int + yyparse (glslang::TParseContext* pParseContext) + { +@@ -13155,5 +13158,6 @@ yyreturnlab: + return yyresult; + } + +-#line 4583 "MachineIndependent/glslang.y" ++} // QtShaderTools + ++#line 4583 "MachineIndependent/glslang.y" +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h b/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h +index f90f704..98da6fd 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h +@@ -44,6 +44,9 @@ + #if YYDEBUG + extern int yydebug; + #endif ++#ifdef __VXWORKS__ ++#define BOOL ANOTHER_BOOL // VxWorks has typedef BOOL ++#endif + + /* Token kinds. */ + #ifndef YYTOKENTYPE +@@ -540,6 +543,7 @@ extern int yydebug; + typedef enum yytokentype yytoken_kind_t; + #endif + ++namespace QtShaderTools { + /* Value type. */ + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED + union YYSTYPE +@@ -594,7 +598,7 @@ typedef union YYSTYPE YYSTYPE; + + + +-int yyparse (glslang::TParseContext* pParseContext); +- ++int yyparse (QtShaderTools::glslang::TParseContext* pParseContext); ++} // namespace QtShaderTools + + #endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */ +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp +index 572652d..fe21d99 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp +@@ -47,6 +47,7 @@ + #include + + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -1536,3 +1537,4 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree) + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp +index 00acd83..add3d1a 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp +@@ -59,6 +59,7 @@ + // c. implicit dead bindings are left un-bound. + // + ++namespace QtShaderTools { + namespace glslang { + + struct TVarEntryInfo { +@@ -1874,3 +1875,4 @@ bool TGlslIoMapper::doMap(TIoMapResolver* resolver, TInfoSink& infoSink) { + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.h b/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.h +index de0a0d7..d356f88 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.h ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.h +@@ -43,6 +43,7 @@ + // A reflection database and its interface, consistent with the OpenGL API reflection queries. + // + ++namespace QtShaderTools { + class TInfoSink; + + namespace glslang { +@@ -237,5 +238,6 @@ private: + }; + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // _IOMAPPER_INCLUDED +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/limits.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/limits.cpp +index 4404bec..aba6bdf 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/limits.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/limits.cpp +@@ -53,6 +53,7 @@ + + #include "ParseHelper.h" + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -196,3 +197,4 @@ void TParseContext::constantIndexExpressionCheck(TIntermNode* index) + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp +index f4983c7..15a1005 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp +@@ -52,6 +52,7 @@ + #include "SymbolTable.h" + #include "LiveTraverser.h" + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -2764,3 +2765,4 @@ bool TIntermediate::isIoResizeArray(const TType& type, EShLanguage language) { + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h b/src/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h +index ce57ce4..4d8db9b 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h +@@ -51,6 +51,7 @@ + #include + #include + ++namespace QtShaderTools { + class TInfoSink; + + namespace glslang { +@@ -1354,5 +1355,6 @@ private: + }; + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // _LOCAL_INTERMEDIATE_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp +index 8350972..81dfbef 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp +@@ -39,6 +39,7 @@ + + #include "ParseHelper.h" + ++namespace QtShaderTools { + namespace glslang { + + class TConstTraverser : public TIntermTraverser { +@@ -211,3 +212,4 @@ bool TIntermediate::parseConstTree(TIntermNode* root, TConstUnionArray unionArra + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h b/src/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h +index 81f5f59..2cb6ed0 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h +@@ -45,6 +45,7 @@ + + #include + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -190,5 +191,6 @@ private: + }; + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // _PARSE_VERSIONS_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp +index 9027036..0915b74 100755 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp +@@ -90,6 +90,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include "PpContext.h" + #include "PpTokens.h" + ++namespace QtShaderTools { + namespace glslang { + + // Handle #define +@@ -1392,3 +1393,4 @@ MacroExpandResult TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, b + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp +index 06c2333..2192913 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp +@@ -89,6 +89,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + namespace { + ++using namespace QtShaderTools; + using namespace glslang; + + const struct { +@@ -151,6 +152,7 @@ const struct { + + } // end anonymous namespace + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -179,3 +181,4 @@ TStringAtomMap::TStringAtomMap() + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp +index f27204b..0bdadfb 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp +@@ -82,6 +82,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + #include "PpContext.h" + ++namespace QtShaderTools { + namespace glslang { + + TPpContext::TPpContext(TParseContextBase& pc, const std::string& rootFileName, TShader::Includer& inclr) : +@@ -119,3 +120,4 @@ void TPpContext::setInput(TInputScanner& input, bool versionWillBeError) + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h +index 582d119..40fdcea 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h +@@ -86,6 +86,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include "../ParseHelper.h" + #include "PpTokens.h" + ++namespace QtShaderTools { + namespace glslang { + + class TPpToken { +@@ -753,5 +754,6 @@ protected: + }; + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // PPCONTEXT_H +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp +index a252295..bc860d6 100755 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp +@@ -91,6 +91,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include "PpTokens.h" + #include "../Scan.h" + ++namespace QtShaderTools { + namespace glslang { + + /////////////////////////////////////////////////////////////////////////////////////////////// +@@ -1439,3 +1440,4 @@ void TPpContext::missingEndifCheck() + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp +index 472df78..a7cbae2 100755 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp +@@ -94,6 +94,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include "PpContext.h" + #include "PpTokens.h" + ++namespace QtShaderTools { + namespace glslang { + + // Add a token (including backing string) to the end of a macro +@@ -183,3 +184,4 @@ void TPpContext::UngetToken(int token, TPpToken* ppToken) + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h +index 7b0f815..31bbc08 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h +@@ -78,6 +78,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #ifndef PARSER_H + #define PARSER_H + ++namespace QtShaderTools { + namespace glslang { + + // Multi-character tokens +@@ -175,5 +176,6 @@ enum EFixedAtoms { + }; + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif /* not PARSER_H */ +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp +index 600541f..a6a551d 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp +@@ -46,6 +46,7 @@ + #include + + #include "localintermediate.h" ++namespace QtShaderTools { + namespace { + + // Use a string to hold the access chain information, as in most cases the +@@ -867,3 +868,4 @@ void PropagateNoContraction(const glslang::TIntermediate& intermediate) + } + } + } ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.h b/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.h +index d849be8..3721850 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.h ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.h +@@ -41,6 +41,7 @@ + + #include "../Include/intermediate.h" + ++namespace QtShaderTools { + namespace glslang { + + // Propagates the 'precise' qualifier for objects (objects marked with +@@ -53,4 +54,5 @@ namespace glslang { + // nodes, it means the operation should not be contracted. + void PropagateNoContraction(const glslang::TIntermediate& intermediate); + +-} // end namespace glslang ++} ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp +index 3afbe3d..b6e70fb 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp +@@ -63,6 +63,7 @@ + // there wasn't exactly one entry point. + // + ++namespace QtShaderTools { + namespace glslang { + + // +@@ -1294,3 +1295,4 @@ void TReflection::dump() + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/reflection.h b/src/3rdparty/glslang/glslang/MachineIndependent/reflection.h +index dccb991..9844330 100644 +--- a/src/3rdparty/glslang/glslang/MachineIndependent/reflection.h ++++ b/src/3rdparty/glslang/glslang/MachineIndependent/reflection.h +@@ -46,6 +46,7 @@ + // A reflection database and its interface, consistent with the OpenGL API reflection queries. + // + ++namespace QtShaderTools { + namespace glslang { + + class TIntermediate; +@@ -222,5 +223,6 @@ protected: + }; + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // _REFLECTION_INCLUDED +diff --git a/src/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp b/src/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp +index fbb51f7..a18b5cb 100644 +--- a/src/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp ++++ b/src/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp +@@ -39,10 +39,11 @@ + + #include + +-#if !defined(__Fuchsia__) ++#if !defined(__Fuchsia__) && !defined(__ghs__) + #include + #endif + ++namespace QtShaderTools { + namespace glslang { + + // #define DUMP_COUNTERS +@@ -60,3 +61,4 @@ void OS_DumpMemoryCounters() + } + + } // end namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp b/src/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp +index d7f89f7..b4fe844 100644 +--- a/src/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp ++++ b/src/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp +@@ -49,6 +49,7 @@ + #error Trying to build a windows specific file in a non windows build. + #endif + ++namespace QtShaderTools { + namespace glslang { + + //#define DUMP_COUNTERS +@@ -65,3 +66,4 @@ void OS_DumpMemoryCounters() + } + + } // namespace glslang ++} // namespace QtShaderTools +diff --git a/src/3rdparty/glslang/glslang/OSDependent/osinclude.h b/src/3rdparty/glslang/glslang/OSDependent/osinclude.h +index da1c4f6..2d5d8c9 100644 +--- a/src/3rdparty/glslang/glslang/OSDependent/osinclude.h ++++ b/src/3rdparty/glslang/glslang/OSDependent/osinclude.h +@@ -36,10 +36,12 @@ + #define __OSINCLUDE_H + + #include "../Include/visibility.h" ++namespace QtShaderTools { + namespace glslang { + + GLSLANG_EXPORT void OS_DumpMemoryCounters(); + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // __OSINCLUDE_H +diff --git a/src/3rdparty/glslang/glslang/Public/ResourceLimits.h b/src/3rdparty/glslang/glslang/Public/ResourceLimits.h +index 8245e12..3dba0cb 100644 +--- a/src/3rdparty/glslang/glslang/Public/ResourceLimits.h ++++ b/src/3rdparty/glslang/glslang/Public/ResourceLimits.h +@@ -40,6 +40,8 @@ + #include "../Include/ResourceLimits.h" + #include "../Include/visibility.h" + ++namespace QtShaderTools { ++ + // Return pointer to user-writable Resource to pass through API in + // future-proof way. + GLSLANG_EXPORT extern TBuiltInResource* GetResources(); +@@ -55,4 +57,6 @@ GLSLANG_EXPORT std::string GetDefaultTBuiltInResourceString(); + // Decodes the resource limits from |config| to |resources|. + GLSLANG_EXPORT void DecodeResourceLimits(TBuiltInResource* resources, char* config); + ++} ++ + #endif // _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/Public/ShaderLang.h b/src/3rdparty/glslang/glslang/Public/ShaderLang.h +index 8ca4ed9..8dad225 100755 +--- a/src/3rdparty/glslang/glslang/Public/ShaderLang.h ++++ b/src/3rdparty/glslang/glslang/Public/ShaderLang.h +@@ -64,12 +64,12 @@ + // + // (Call once per process, not once per thread.) + // +-GLSLANG_EXPORT int ShInitialize(); ++GLSLANG_EXPORT int ShInitialize_Qt(); + + // + // Call this at process shutdown to clean up memory. + // +-GLSLANG_EXPORT int ShFinalize(); ++GLSLANG_EXPORT int ShFinalize_Qt(); + + // + // Types of languages the compiler can consume. +@@ -126,6 +126,11 @@ typedef enum : unsigned { + LAST_ELEMENT_MARKER(EShLanguageMaskCount), + } EShLanguageMask; + ++#ifdef __cplusplus ++ } ++#endif ++ ++namespace QtShaderTools { + namespace glslang { + + class TType; +@@ -220,6 +225,11 @@ struct TEnvironment { + GLSLANG_EXPORT const char* StageName(EShLanguage); + + } // end namespace glslang ++} // namespace QtShaderTools ++ ++#ifdef __cplusplus ++ extern "C" { ++#endif + + // + // Types of output the linker will create. +@@ -323,10 +333,10 @@ typedef void* ShHandle; + // Driver calls these to create and destroy compiler/linker + // objects. + // +-GLSLANG_EXPORT ShHandle ShConstructCompiler(const EShLanguage, int /*debugOptions unused*/); // one per shader +-GLSLANG_EXPORT ShHandle ShConstructLinker(const EShExecutable, int /*debugOptions unused*/); // one per shader pair +-GLSLANG_EXPORT ShHandle ShConstructUniformMap(); // one per uniform namespace (currently entire program object) +-GLSLANG_EXPORT void ShDestruct(ShHandle); ++GLSLANG_EXPORT ShHandle ShConstructCompiler_Qt(const EShLanguage, int /*debugOptions unused*/); // one per shader ++GLSLANG_EXPORT ShHandle ShConstructLinker_Qt(const EShExecutable, int /*debugOptions unused*/); // one per shader pair ++GLSLANG_EXPORT ShHandle ShConstructUniformMap_Qt(); // one per uniform namespace (currently entire program object) ++GLSLANG_EXPORT void ShDestruct_Qt(ShHandle); + + // + // The return value of ShCompile is boolean, non-zero indicating +@@ -335,7 +345,7 @@ GLSLANG_EXPORT void ShDestruct(ShHandle); + // The info-log should be written by ShCompile into + // ShHandle, so it can answer future queries. + // +-GLSLANG_EXPORT int ShCompile(const ShHandle, const char* const shaderStrings[], const int numStrings, ++GLSLANG_EXPORT int ShCompile_Qt(const ShHandle, const char* const shaderStrings[], const int numStrings, + const int* lengths, const EShOptimizationLevel, const TBuiltInResource* resources, + int, // debugOptions unused + int defaultVersion = 110, // use 100 for ES environment, overridden by #version in shader +@@ -344,7 +354,7 @@ GLSLANG_EXPORT int ShCompile(const ShHandle, const char* const shaderStrings[], + const char* fileName = nullptr + ); + +-GLSLANG_EXPORT int ShLinkExt( ++GLSLANG_EXPORT int ShLinkExt_Qt( + const ShHandle, // linker object + const ShHandle h[], // compiler objects to link together + const int numHandles); +@@ -353,26 +363,26 @@ GLSLANG_EXPORT int ShLinkExt( + // ShSetEncrpytionMethod is a place-holder for specifying + // how source code is encrypted. + // +-GLSLANG_EXPORT void ShSetEncryptionMethod(ShHandle); ++GLSLANG_EXPORT void ShSetEncryptionMethod_Qt(ShHandle); + + // + // All the following return 0 if the information is not + // available in the object passed down, or the object is bad. + // +-GLSLANG_EXPORT const char* ShGetInfoLog(const ShHandle); +-GLSLANG_EXPORT const void* ShGetExecutable(const ShHandle); +-GLSLANG_EXPORT int ShSetVirtualAttributeBindings(const ShHandle, const ShBindingTable*); // to detect user aliasing +-GLSLANG_EXPORT int ShSetFixedAttributeBindings(const ShHandle, const ShBindingTable*); // to force any physical mappings ++GLSLANG_EXPORT const char* ShGetInfoLog_Qt(const ShHandle); ++GLSLANG_EXPORT const void* ShGetExecutable_Qt(const ShHandle); ++GLSLANG_EXPORT int ShSetVirtualAttributeBindings_Qt(const ShHandle, const ShBindingTable*); // to detect user aliasing ++GLSLANG_EXPORT int ShSetFixedAttributeBindings_Qt(const ShHandle, const ShBindingTable*); // to force any physical mappings + // + // Tell the linker to never assign a vertex attribute to this list of physical attributes + // +-GLSLANG_EXPORT int ShExcludeAttributes(const ShHandle, int *attributes, int count); ++GLSLANG_EXPORT int ShExcludeAttributes_Qt(const ShHandle, int *attributes, int count); + + // + // Returns the location ID of the named uniform. + // Returns -1 if error. + // +-GLSLANG_EXPORT int ShGetUniformLocation(const ShHandle uniformMap, const char* name); ++GLSLANG_EXPORT int ShGetUniformLocation_Qt(const ShHandle uniformMap, const char* name); + + #ifdef __cplusplus + } // end extern "C" +@@ -398,6 +408,7 @@ GLSLANG_EXPORT int ShGetUniformLocation(const ShHandle uniformMap, const char* n + #include + #include + ++namespace QtShaderTools { + class TCompiler; + class TInfoSink; + +@@ -1008,5 +1019,6 @@ private: + }; + + } // end namespace glslang ++} // namespace QtShaderTools + + #endif // _COMPILER_INTERFACE_INCLUDED_ +diff --git a/src/3rdparty/glslang/glslang/ResourceLimits/ResourceLimits.cpp b/src/3rdparty/glslang/glslang/ResourceLimits/ResourceLimits.cpp +index 79a1b3a..a8b7bf6 100644 +--- a/src/3rdparty/glslang/glslang/ResourceLimits/ResourceLimits.cpp ++++ b/src/3rdparty/glslang/glslang/ResourceLimits/ResourceLimits.cpp +@@ -39,6 +39,7 @@ + + #include "glslang/Public/ResourceLimits.h" + ++namespace QtShaderTools { + static TBuiltInResource Resources; + + static const TBuiltInResource DefaultTBuiltInResource = { +@@ -540,3 +541,6 @@ const TBuiltInResource* GetDefaultResources() + { + return &DefaultTBuiltInResource; + } ++ ++} // namespace QtShaderTools ++ +-- +2.36.1.windows.1 + diff --git a/local/recipes/qt/qtshadertools/source/src/CMakeLists.txt b/local/recipes/qt/qtshadertools/source/src/CMakeLists.txt new file mode 100644 index 0000000000..cb0e25d7d9 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/CMakeLists.txt @@ -0,0 +1,8 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# Generated from src.pro. + +add_subdirectory(glslang) +add_subdirectory(SPIRV-Cross) +add_subdirectory(shadertools) diff --git a/local/recipes/qt/qtshadertools/source/src/SPIRV-Cross/CMakeLists.txt b/local/recipes/qt/qtshadertools/source/src/SPIRV-Cross/CMakeLists.txt new file mode 100644 index 0000000000..4f2e7d25b6 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/SPIRV-Cross/CMakeLists.txt @@ -0,0 +1,35 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# Generated from SPIRV-Cross.pro. + +##################################################################### +## BundledSpirv_Cross Generic Library: +##################################################################### + +qt_internal_add_3rdparty_library(BundledSpirv_Cross + QMAKE_LIB_NAME spirv_cross + SKIP_AUTOMOC + STATIC + EXCEPTIONS + SOURCES + ../3rdparty/SPIRV-Cross/spirv_cfg.cpp + ../3rdparty/SPIRV-Cross/spirv_cpp.cpp + ../3rdparty/SPIRV-Cross/spirv_cross.cpp + ../3rdparty/SPIRV-Cross/spirv_cross_c.cpp + ../3rdparty/SPIRV-Cross/spirv_cross_parsed_ir.cpp + ../3rdparty/SPIRV-Cross/spirv_cross_util.cpp + ../3rdparty/SPIRV-Cross/spirv_glsl.cpp + ../3rdparty/SPIRV-Cross/spirv_hlsl.cpp + ../3rdparty/SPIRV-Cross/spirv_msl.cpp + ../3rdparty/SPIRV-Cross/spirv_parser.cpp + ../3rdparty/SPIRV-Cross/spirv_reflect.cpp + DEFINES + SPIRV_CROSS_C_API_GLSL=1 + SPIRV_CROSS_C_API_HLSL=1 + SPIRV_CROSS_C_API_MSL=1 + ATTRIBUTION_FILE_DIR_PATHS + ../3rdparty/SPIRV-Cross +) +qt_disable_warnings(BundledSpirv_Cross) +qt_set_symbol_visibility_hidden(BundledSpirv_Cross) diff --git a/local/recipes/qt/qtshadertools/source/src/glslang/CMakeLists.txt b/local/recipes/qt/qtshadertools/source/src/glslang/CMakeLists.txt new file mode 100644 index 0000000000..b3b1250e8e --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/glslang/CMakeLists.txt @@ -0,0 +1,164 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# Generated from glslang.pro. + +##################################################################### +## BundledGlslang_Spirv Generic Library: +##################################################################### + +qt_internal_add_3rdparty_library(BundledGlslang_Spirv + QMAKE_LIB_NAME glslang_spirv + STATIC + SKIP_AUTOMOC + SOURCES + ../3rdparty/glslang/SPIRV/GlslangToSpv.cpp + ../3rdparty/glslang/SPIRV/InReadableOrder.cpp + ../3rdparty/glslang/SPIRV/Logger.cpp + ../3rdparty/glslang/SPIRV/SPVRemapper.cpp + ../3rdparty/glslang/SPIRV/SpvBuilder.cpp + ../3rdparty/glslang/SPIRV/SpvPostProcess.cpp + ../3rdparty/glslang/SPIRV/SpvTools.cpp + ../3rdparty/glslang/SPIRV/disassemble.cpp + ../3rdparty/glslang/SPIRV/doc.cpp + INCLUDE_DIRECTORIES + ../3rdparty/glslang + PUBLIC_LIBRARIES + # Remove: core + # Remove: gui + ATTRIBUTION_FILE_DIR_PATHS + ../3rdparty/glslang +) +qt_disable_warnings(BundledGlslang_Spirv) +qt_set_symbol_visibility_hidden(BundledGlslang_Spirv) + +## Scopes: +##################################################################### + +qt_internal_extend_target(BundledGlslang_Spirv CONDITION WIN32 + DEFINES + GLSLANG_OSINCLUDE_WIN32 +) + +qt_internal_extend_target(BundledGlslang_Spirv CONDITION UNIX + DEFINES + GLSLANG_OSINCLUDE_UNIX +) +##################################################################### +## BundledGlslang_Osdependent Generic Library: +##################################################################### + +# special case begin +if(WIN32) + set(GLSLANG_OSDEP_PATH ../3rdparty/glslang/glslang/OSDependent/Windows) +elseif(UNIX) + set(GLSLANG_OSDEP_PATH ../3rdparty/glslang/glslang/OSDependent/Unix) +endif() +# special case end + +qt_internal_add_3rdparty_library(BundledGlslang_Osdependent + QMAKE_LIB_NAME glslang_osdependent + STATIC + SKIP_AUTOMOC + SOURCES + ${GLSLANG_OSDEP_PATH}/ossource.cpp # special case + INCLUDE_DIRECTORIES + ../3rdparty/glslang + PUBLIC_LIBRARIES + # Remove: core + # Remove: gui + ATTRIBUTION_FILE_DIR_PATHS + ../3rdparty/glslang +) +qt_disable_warnings(BundledGlslang_Osdependent) +qt_set_symbol_visibility_hidden(BundledGlslang_Osdependent) + +## Scopes: +##################################################################### + +qt_internal_extend_target(BundledGlslang_Osdependent CONDITION WIN32 + DEFINES + GLSLANG_OSINCLUDE_WIN32 +) + +#### Keys ignored in scope 7:.:.:glslang-osdependent.pro:WIN32: +# GLSLANG_OSDEP_PATH = "$$GLSLANG_PATH/glslang/OSDependent/Windows" + +qt_internal_extend_target(BundledGlslang_Osdependent CONDITION UNIX + DEFINES + GLSLANG_OSINCLUDE_UNIX +) + +#### Keys ignored in scope 8:.:.:glslang-osdependent.pro:UNIX: +# GLSLANG_OSDEP_PATH = "$$GLSLANG_PATH/glslang/OSDependent/Unix" + +qt_internal_extend_target(BundledGlslang_Osdependent CONDITION LINUX + PUBLIC_LIBRARIES + pthread +) + +##################################################################### +## BundledGlslang_Glslang Generic Library: +##################################################################### + +qt_internal_add_3rdparty_library(BundledGlslang_Glslang + QMAKE_LIB_NAME glslang_glslang + STATIC + SKIP_AUTOMOC + SOURCES + ../3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp + ../3rdparty/glslang/glslang/GenericCodeGen/Link.cpp + ../3rdparty/glslang/glslang/MachineIndependent/Constant.cpp + ../3rdparty/glslang/glslang/MachineIndependent/InfoSink.cpp + ../3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp + ../3rdparty/glslang/glslang/MachineIndependent/IntermTraverse.cpp + ../3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp + ../3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp + ../3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp + ../3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp + ../3rdparty/glslang/glslang/MachineIndependent/RemoveTree.cpp + ../3rdparty/glslang/glslang/MachineIndependent/Scan.cpp + ../3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp + ../3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp + ../3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp + ../3rdparty/glslang/glslang/MachineIndependent/Versions.cpp + ../3rdparty/glslang/glslang/MachineIndependent/attribute.cpp + ../3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp + ../3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp + ../3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp + ../3rdparty/glslang/glslang/MachineIndependent/limits.cpp + ../3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp + ../3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp + ../3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp + ../3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp + ../3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp + ../3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp + ../3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp + ../3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp + ../3rdparty/glslang/glslang/MachineIndependent/reflection.cpp + ../3rdparty/glslang/glslang/ResourceLimits/ResourceLimits.cpp + INCLUDE_DIRECTORIES + ../3rdparty/glslang + PUBLIC_LIBRARIES + # Remove: core + # Remove: gui + ATTRIBUTION_FILE_DIR_PATHS + ../3rdparty/glslang +) +qt_disable_warnings(BundledGlslang_Glslang) +qt_set_symbol_visibility_hidden(BundledGlslang_Glslang) + +set_target_properties(BundledGlslang_Glslang PROPERTIES UNITY_BUILD OFF) + +## Scopes: +##################################################################### + +qt_internal_extend_target(BundledGlslang_Glslang CONDITION WIN32 + DEFINES + GLSLANG_OSINCLUDE_WIN32 +) + +qt_internal_extend_target(BundledGlslang_Glslang CONDITION UNIX + DEFINES + GLSLANG_OSINCLUDE_UNIX +) diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/CMakeLists.txt b/local/recipes/qt/qtshadertools/source/src/shadertools/CMakeLists.txt new file mode 100644 index 0000000000..04371a5a38 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/CMakeLists.txt @@ -0,0 +1,53 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# Generated from shadertools.pro. + +##################################################################### +## ShaderTools Module: +##################################################################### + +qt_internal_add_module(ShaderTools + EXCEPTIONS + SOURCES + qshaderbaker.cpp qshaderbaker.h + qshaderrewriter.cpp qshaderrewriter_p.h + qspirvcompiler.cpp qspirvcompiler_p.h + qspirvshader.cpp qspirvshader_p.h + qspirvshaderremap.cpp qspirvshaderremap_p.h + qtshadertoolsglobal.h + qtshadertoolsglobal_p.h + DEFINES + QT_BUILD_SHADERTOOLS_LIB + INCLUDE_DIRECTORIES + ../3rdparty/SPIRV-Cross + ../3rdparty/glslang + LIBRARIES + Qt::GuiPrivate +# special case begin + Qt::BundledSpirv_Cross + Qt::BundledGlslang_Glslang + Qt::BundledGlslang_Spirv + Qt::BundledGlslang_Osdependent +# special case end + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + PRIVATE_MODULE_INTERFACE + Qt::GuiPrivate + RHI_HEADER_FILTERS + "(^|/)qshaderbaker\\.h$" +) + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:shadertools.pro:NOT EXISTS _ss_[QT_HOST_DATA]/.qmake.cache: +# LIBLOC = "$$shadowed($$dirname _QMAKE_CONF_)" "/lib" + +#### Keys ignored in scope 3:.:.:shadertools.pro:else: +# LIBLOC = "$$[QT_HOST_LIBS]" +qt_internal_add_docs(ShaderTools + doc/qtshadertools.qdocconf +) + diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/doc/images/shaderconditioning.png b/local/recipes/qt/qtshadertools/source/src/shadertools/doc/images/shaderconditioning.png new file mode 100644 index 0000000000..c8f6e78819 Binary files /dev/null and b/local/recipes/qt/qtshadertools/source/src/shadertools/doc/images/shaderconditioning.png differ diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/doc/qtshadertools.qdocconf b/local/recipes/qt/qtshadertools/source/src/shadertools/doc/qtshadertools.qdocconf new file mode 100644 index 0000000000..baf161ad9c --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/doc/qtshadertools.qdocconf @@ -0,0 +1,40 @@ +include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) + +project = QtShaderTools +description = Qt Shader Tools Reference Documentation +version = $QT_VERSION + +qhp.projects = QtShaderTools + +qhp.QtShaderTools.file = qtshadertools.qhp +qhp.QtShaderTools.namespace = org.qt-project.qtshadertools.$QT_VERSION_TAG +qhp.QtShaderTools.virtualFolder = qtshadertools +qhp.QtShaderTools.indexTitle = Qt Shader Tools +qhp.QtShaderTools.indexRoot = + +qhp.QtShaderTools.subprojects = manual +qhp.QtShaderTools.subprojects.manual.title = Qt Shader Tools +qhp.QtShaderTools.subprojects.manual.indexTitle = Qt Shader Tools module topics +qhp.QtShaderTools.subprojects.manual.type = manual + +tagfile = ../../../doc/qtshadertools/qtshadertools.tags + +depends += qtdoc qtcmake qmake qtcore qtgui qtquick + +headerdirs += .. + +sourcedirs += .. + +exampledirs += snippets + +imagedirs += images + +navigation.landingpage = "Qt Shader Tools" +# Autogenerate navigation linking based on "Qt Shader Tools module topics": +navigation.toctitles = "Qt Shader Tools module topics" +navigation.toctitles.inclusive = false + +macro.cmakeoptionsince = "\n\nThis option was introduced in Qt \1.\n\n" + +# Allow zero warnings when testing documentation in CI +warninglimit = 0 diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/doc/snippets/color.frag b/local/recipes/qt/qtshadertools/source/src/shadertools/doc/snippets/color.frag new file mode 100644 index 0000000000..ad9d953d02 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/doc/snippets/color.frag @@ -0,0 +1,16 @@ +//! [0] +#version 440 + +layout(location = 0) in vec3 v_color; +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; + float opacity; +}; + +void main() +{ + fragColor = vec4(v_color * opacity, opacity); +} +//! [0] diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/doc/snippets/color.vert b/local/recipes/qt/qtshadertools/source/src/shadertools/doc/snippets/color.vert new file mode 100644 index 0000000000..0010e55561 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/doc/snippets/color.vert @@ -0,0 +1,18 @@ +//! [0] +#version 440 + +layout(location = 0) in vec4 position; +layout(location = 1) in vec3 color; +layout(location = 0) out vec3 v_color; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; + float opacity; +}; + +void main() +{ + v_color = color; + gl_Position = mvp * position; +} +//! [0] diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/doc/src/qtshadertools-build.qdoc b/local/recipes/qt/qtshadertools/source/src/shadertools/doc/src/qtshadertools-build.qdoc new file mode 100644 index 0000000000..e6ac74bb38 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/doc/src/qtshadertools-build.qdoc @@ -0,0 +1,406 @@ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \title Qt Shader Tools Build System Integration + \page qtshadertools-build.html + \ingroup cmake-commands-qtshadertools + \summary {Compiles shaders and adds them to a Qt resource} + + \section1 Introduction + + The \l{Qt Shader Tools} module provides a CMake macro file that provides + useful functions applications can take into use in their \c{CMakeLists.txt}. + + When using the \c{qt6_add_shaders} function, the \l{QSB Manual}{qsb} tool + will get invoked automatically by the build system, and the resulting + \c{.qsb} files get added to the resource system implicitly. + + \section1 First Example + + Let's look at a simple example. Assume that we have a Qt Quick application + that wants to provides its own wobble effect via \l ShaderEffect. The + fragment shader is implemented in \c{wobble.frag}. The ShaderEffect item's + fragmentShader property refers to \c{wobble.frag.qsb}. How do we ensure this + .qsb file gets generated at build time? + + \badcode +... +project(exampleapp LANGUAGES CXX) +... +find_package(Qt6 COMPONENTS ShaderTools) +... +qt6_add_executable(exampleapp + main.cpp +) +... +qt6_add_resources(exampleapp "exampleapp" + PREFIX + "/" + FILES + "main.qml" +) + +qt6_add_shaders(exampleapp "exampleapp_shaders" + PREFIX + "/" + FILES + "wobble.frag" +) +\endcode + + The above is sufficient to enable the application to access + \c{:/wobble.frag.qsb} at run time. The original Vulkan-style GLSL source + code (wobble.frag) is not included in the application's executable and does + not need to be shipped. If there are errors in the shader code, the \c + glslang compiler messages are printed at build time and the build + fails. When changing the shader source file, the changes are picked up + automatically in the next build, like they would for C++ and other source + files. + + The key is the \c qt6_add_shaders function, which shares similarity with \c + qt6_add_resources. Without specifying further parameters, the function will + lead to running qsb with a reasonable set of default arguments that are + suitable for fragment shaders when targeting Vulkan, Metal, Direct 3D, and + OpenGL or OpenGL ES. + + \note Watch out for the \c find_package line. It is important to include the + \c find_package for \c ShaderTools, otherwise \c qt6_add_shaders will not be + available. + + \note The target that is passed as the first argument of the + \c qt6_add_shaders function must exist before the function is called. + + \note Multiple \c qt6_add_shaders calls are supported. In complex + applications it is not unlikely that different sets of shaders need + different settings. The name after the project (\c{"exampleapp_shaders"} in + the above example) has to be unique for each call. + + \section1 Configuration + + By default \c qt6_add_shaders invokes \l{QSB Manual}{qsb} as follows: + \badcode + qsb --glsl "100 es,120,150" --hlsl 50 --msl 12 -o .qsb + \endcode + + This means that the resulting package will contain SPIR-V (for Vulkan 1.0), + GLSL ES 100 (for OpenGL ES 2.0 and newer), GLSL 120 (for non-core profile + OpenGL contexts), GLSL 150 (for core profile OpenGL contexts), HLSL source + for Shader Model 5.0 (for Direct3D 11.1), and Metal Shading Language 1.2 + source (for Metal). + + This is a good set of defaults for Qt Quick, and creates applications that + are highly portable to a wide variety of systems. These defaults are not + always suitable however. If the shader uses functions or constructs that do + not have an equivalent in these targets, the process, and so the build, will + fail. If that is the case, the targets will need to be adjusted, and this + also means that the application's minimum system requirements get adjusted + implicitly. As an example, take the \c textureLod GLSL function that is only + available with OpenGL ES 3.0 and up (meaning GLSL ES 300 or higher). When + requesting GLSL \c{300 es} instead of \c{100 es}, the build will succeed, but + the resulting application will now require OpenGL ES 3.0 or higher and will + not be compatible with OpenGL ES 2.0 based systems. + + On WebAssembly \c qt6_add_shaders invokes \l{QSB Manual}{qsb} as follows: + \badcode + qsb --glsl "100 es, 300 es" .qsb + \endcode + + This generates shaders compatible with WebGL 1 and WebGL 2. + + \section2 Shader type + + The type of shader is deduced from the file extension. Thus, the extension + must be one of the following: + + \list + \li \c .vert - for vertex shaders + \li \c .tesc - for tessellation control shaders + \li \c .tese - for tessellation evaluation shaders + \li \c .frag - for fragment (pixel) shaders + \li \c .comp - for compute shaders + \endlist + + \note Tessellation control and evaluation shaders are not currently + supported with Direct 3D (HLSL). A possible workaround to this is to + manually create hull and domain shaders and inject them via the + \l{Substituting Hand-Crafted Shaders}{file subsitution syntax} in the \c + FILES section. + + \section2 Targets + + The following keywords are available: + + \list + + \li \c GLSL - Requests generating source code for the given list of GLSL + versions. Watch out that the list follows the comma-separated \c qsb + syntax. For example, a compute shader will want to specify \c{"310 es,430"} + here as the defaults are not suitable for it. + + \li \c NOGLSL - This argument-less keyword disables generating GLSL + source. Suitable for applications that do not wish to function with OpenGL + at all. + + \li \c HLSL - Requests generating source code for the given list of HLSL + (shader model) versions. The \c qsb tool follows GLSL-style version numbers + and therefore \c 50 corresponds to Shader Model 5.0, \c 51 is 5.1. + + \li \c NOHLSL - This argument-less keyword disables generating HLSL + source. Suitable for applications that do not wish to function with Direct 3D + at all. + + \li \c MSL - Requests generating source code for the given version of the + Metal Shading Language. \c 12 corresponds to 1.2, \c 20 to 2.0. + + \li \c NOMSL - This argument-less keyword disables generating MSL + source. Suitable for applications that do not wish to function with Metal at + all. + + \endlist + + The most commonly overridden setting is \c GLSL. For example, if the + application's shaders use OpenGL 3.x features, it will likely want to + specify something higher than \c{100 es} or \c{120}: + + \badcode + qt_add_shaders(exampleapp "res_gl3shaders" + GLSL "300es,330" + PREFIX + "/shaders" + FILES + shaders/ssao.vert + shaders/ssao.frag + shaders/skybox.vert + shaders/skybox.frag + ) + \endcode + + \note The space before the \c es suffix is optional. + + \section2 Tessellation + + \list + + \li \c TESSELLATION - This argument-less keyword indicates that the shaders + are used in a pipeline that uses tessellation. This is relevant only when + there are vertex shaders listed and Metal shader generation is not + disabled. See \l{Tessellation Example}{this snippet} for an example. + \cmakeoptionsince 6.5 + + \li \c TESSELLATION_VERTEX_COUNT - This option takes a number which + indicates the output vertex count from the tessellation control stage. + Specifying this is mandatory for tessellation evaluation shaders used with + Metal. The default value is 3. If it does not match the tessellation + control stage, the generated MSL code will not function as expected. + \cmakeoptionsince 6.5 + + \li \c TESSELLATION_MODE - This option specifies the tessellation mode. It + can take one of two values: \c{"triangles"} or \c{"quads"}. The default + value is \c triangles. The option must be specified when a tessellation + control shader is in the \c FILES list. It must match the tessellation + evaluation stage. + \cmakeoptionsince 6.5 + + \endlist + + \section2 Multiview + + \list + + \li \c VIEW_COUNT - This option specifies the number of views a vertex + shader is used with. When working with multiview (GL_OVR_multiview2, + VK_KHR_multiview, D3D12 view instancing, etc.), always specify the correct + VIEW_COUNT with a value >= 2 for the relevant shaders in order to enable + generating correct GLSL shader code. Note however that setting VIEW_COUNT + should be avoided for vertex shaders that do not rely on multiview, since + setting the value effectively makes the generated GLSL code + multiview-dependent. To overcome this, group the vertex shaders accordingly + into multiple qt_add_shaders() calls. Setting \c VIEW_COUNT automatically + injects a preprocessor define, \c{QSHADER_VIEW_COUNT}, with the same value + into the shader source code. In addition, the \c{#extension GL_EXT_multiview + : require} line is injected automatically in vertex shaders when a view + count of 2 or greater is set. Note that for multiview the minimum GLSL + version is \c 330 and \c{300 es}. For HLSL, the minimum version is \c 61. + Applications are advised to set up the language targets accordingly (or to + newer versions). \cmakeoptionsince 6.7 + + \li \c MULTIVIEW - Requests generating \b both a non-multiview and a view + count 2 set of shaders. This is effectively a convenience for manually + creating two qt_add_shaders() calls with the appropriate + GLSL/HLSL/MSL/VIEW_COUNT arguments. This option is meant mainly for Qt's own + use, but applications can use it too as long as the implicit settings for + the multiview variants are sufficient for the application's shaders; these + are: GLSL 330,300es HLSL 61 MSL 12. VIEW_COUNT is set to 2 for the multiview + variants. The multiview variants are stored in files with a \c{.mv2qsb} + suffix added (in addition to \c{.qsb}). + \cmakeoptionsince 6.8 + + \endlist + + \section2 Qt Quick specifics + + \list + + \li \c BATCHABLE - Specifying this single, argument-less keyword is + essential for vertex shaders that are used with Qt Quick, either in a \l + ShaderEffect or in a \l QSGMaterialShader. It has no effect for fragment or + compute shaders, and different types can safely be included in the same list + since the keyword is taken into account only for the \c{.vert} + files. Equivalent to the \c{-b} argument of \l{QSB Manual}{qsb}. + + \li \c ZORDER_LOC - When \c BATCHABLE is specified, an additional vertex input + is injected with location \c 7 by default. This keyword is used to change this + location to another value. This becomes relevant if the vertex shader has many + inputs and 7 is in use and would clash. + + \endlist + + \section2 Invoking external tools + + \list + + \li \c PRECOMPILE - Equivalent to the \c{-c} or \c{-t} options of \l{QSB + Manual}{qsb}, depending on the platform. When building on Windows, this + leads to invoking \c fxc from the Windows SDK to do the first phase of + compilation (HLSL source to DXBC bytecode) at build time instead of at run + time. The resulting \c{.qsb} file will only include the compilation results + (the intermediate shader format), not the original shader source code. + + \li \c OPTIMIZED - Invokes \c spirv-opt (which must be available from the + Vulkan SDK or elsewhere) to perform optimizations on the SPIR-V + bytecode. Equivalent to the \c{-O} argument of \l{QSB Manual}{qsb}. + + \endlist + + \section2 Other settings + + \list + + \li \c DEFINES - Defines macros that are active during shader + compilation. Equivalent to the \c{-D} argument of \l{QSB Manual}{qsb}. The + list has the form of \c{"name1=value1;name2=value2"}. Alternatively, just + like \c FILES, the list can be separated by newlines. + + \li \c OUTPUTS - When the name of the generated .qsb file needs to be + different from the source, for example because one shader file serves as the + source for multiple .qsb files due to differentiating via \c DEFINES, this + list can contain an entry for each item in \c FILES, specifying a file name + typically ending in \c{.qsb}. The specified name is then passed in the + \c{-o} argument to qsb instead of just appending \c{.qsb} to the source file + name. + + \li \c ORIGINAL_FILES - When the .qsb file should depend on a shader source + file that is different from \c FILES, specify \c ORIGINAL_FILES and an entry + for each item in \c FILES. When present, it changes the behavior in two + ways: A \c{--orig-file} argument is passed to qsb, leading to writing the + filename from \c ORGINAL_FILES into the CMake dependency files instead of + the corresponding input filename from \c FILES. Also, the + add_custom_command() that triggers invoking qsb will pass the filename from + \c ORIGINAL_FILES to its DEPENDS clause. This is useful when the files + passed to qt_add_shaders() are intermediate, generate assets, and the final + .qsb files should rather depend on the original shader source files, which + qt_add_shaders() would know nothing about without \c ORIGINAL_FILES. + + \li \c DEBUGINFO - Enables generating full debug information for SPIR-V, + thus enabling tools like \l{https://renderdoc.org/}{RenderDoc} to display + the full source when inspecting a pipeline or when performing vertex or + fragment debugging. Equivalent to the \c{-g} argument of \l{QSB + Manual}{qsb}. Also has an effect for Direct 3D in case the \c PRECOMPILE + keyword has been specified, as \c fxc is then instructed to include debug + information in the generated intermediate bytecode. + + \li \c QUIET - Suppresses debug and warning output from qsb. Only fatal + errors are printed. + + \li \c OUTPUT_TARGETS - When using qt_add_shaders with static libraries, + one or more special targets will be generated. Should you wish to perform + additional processing on these targets pass a value to the OUTPUT_TARGETS + parameter. + + \li \c MEDIUMP - Requests defaulting to medium precision for floats in GLSL + ES fragment shaders. Ignored for any other targets, including (non-ES) GLSL. + + \endlist + + \section1 Substituting Hand-Crafted Shaders + + The CMake integration also supports specifying replacements for + given versions of the shader in the resulting .qsb file. This in + effect is equivalent to running \l{QSB Manual}{qsb} with the + \c{-r} command-line option. + + This is enabled by the following special syntax in the FILES list: + + \badcode + FILES + "shaders/externalsampler.frag@glsl,100es,shaders/externalsampler_gles.frag" + \endcode + + The filename can be followed by any number of @-separated + replacement specifications. Each of these specifies the shading + language, the version, and the file from which the data is to be + read separated by commas. See the \l{QSB Manual} for details. + + \section2 Tessellation Example + + Take a graphics pipeline consisting of four stages, the vertex stage with + the shader \c{vertex.vert}, the tessellation control stage with the shader + \c{tess.tesc}, the tessellation evaluation stage with the shader + \c{tess.tese}, and the fragment stage with the shader \c{fragment.frag}. + + To build a fully portable application that is able to function with any of + Vulkan, OpenGL, Metal, and Direct 3D, there are two main things to take + care of: The HLSL versions of the tessellation shaders must be created + manually and then injected. Whereas with Metal, the appropriate keyword + must be specified. + + First, the vertex and fragment shaders are listed. In order to support + Metal, the \c TESSELLATION keyword is added. This enables special + processing and translation for \c{vertex.vert} when generating the Metal + shader code. For OpenGL, we restrict the GLSL language version since + tessellation support is only available in newer OpenGL versions. + + \badcode + qt6_add_shaders(project "shaders_tessellation_part1" + PREFIX + "/shaders" + GLSL + "410,320es" + TESSELLATION + FILES + "vertex.vert" + "fragment.frag" + ) + \endcode + + Second, the tessellation shaders are listed in a separate qt6_add_shaders() + call. This is due to the \c NOHLSL keyword. The vertex and fragment shaders + should still get translated to HLSL as usual, so keeping all four shaders + in one single qt6_add_shaders() call is not feasible. For Metal, some + tessellation settings (output vertex count, mode) are specified since these + will need to be known upfront, unlike with Vulkan and OpenGL. + + \badcode + qt6_add_shaders(project "shaders_tessellation_part2" + PREFIX + "/shaders" + NOHLSL + GLSL + "410,320es" + TESSELLATION_VERTEX_COUNT + 3 + TESSELLATION_MODE + "triangles" + FILES + "tess.tesc@hlsl,50,tess_hull.hlsl" + "tess.tese@hlsl,50,tess_domain.hlsl" + ) + \endcode + + \note Manually writing hull and domain HLSL shaders is recommended for + advanced users only. Certain constructs, such as constant buffers, will + need special care so that all resource interfaces and layouts stay + compatible with the SPIR-V/GLSL/MSL shaders. + +*/ diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/doc/src/qtshadertools-index.qdoc b/local/recipes/qt/qtshadertools/source/src/shadertools/doc/src/qtshadertools-index.qdoc new file mode 100644 index 0000000000..193cd3c315 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/doc/src/qtshadertools-index.qdoc @@ -0,0 +1,60 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! +\title Qt Shader Tools +\page qtshadertools-index.html + +The Qt Shader Tools module builds on the SPIR-V Open Source Ecosystem as +described at \l{https://www.khronos.org/spir/}{the Khronos SPIR-V web site}. + +The main components of the Qt shader conditioning system are: + +\list +\li the \c qsb command-line tool +\li CMake integration for the \c qsb tool +\li QShader (part of the QtGui module) +\li QShaderBaker (part of this module, the library equivalent of the \c qsb +tool) +\endlist + +\section1 Articles and Guides + +\list + \li \l {Qt Shader Tools Overview} + \li \l {QSB Manual} + \li \l {Qt Shader Tools Build System Integration} (CMake) +\endlist + +\section2 C++ API + +\generatelist classesbymodule QtShaderTools + +\note Applications and libraries should avoid using the C++ API directly, unless +they have a good reason to do so. Rather, prefer relying on offline +pre-processing by invoking the \c qsb command-line tool at build time via CMake, +or manually if invoking via CMake is not feasible. The \c qsb tool uses +QShaderBaker and writes the serialized version of the generated QShader into a +file. The usage of the C++ API should be restricted to cases where run time +processing and translation cannot be avoided, and the performance implications +are understood. An example of this are applications that work with user-provided +or dynamically generated shader source strings. + +\section1 Licenses and Attributions + +Qt Shader Tools runtime library is available under commercial licenses from +\l{The Qt Company}. In addition, it is available under free software licenses. +Since Qt 6.3, these free software licenses are \l{GNU Lesser General Public +License, version 3}, or the \l{GNU General Public License, version 2}. + +The \c qsb command-line tool is available under commercial licenses from +\l{The Qt Company}. In addition, it is available under the \l {GNU General +Public License, version 3}. + +See \l{Qt Licensing} for further details. + +Furthermore, Qt Shader Tools in \QtVersion may contain third party +modules under following permissive licenses: + +\annotatedlist attributions-qtshadertools +*/ diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/doc/src/qtshadertools-overview.qdoc b/local/recipes/qt/qtshadertools/source/src/shadertools/doc/src/qtshadertools-overview.qdoc new file mode 100644 index 0000000000..7c580e050e --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/doc/src/qtshadertools-overview.qdoc @@ -0,0 +1,107 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page qtshadertools-overview.html + \title Qt Shader Tools Overview + \brief Provides insight into the Qt Shader Tools module. + \ingroup explanation + + The Qt Shader Tools module builds on the SPIR-V Open Source Ecosystem as + described at \l{https://www.khronos.org/spir/}{the Khronos SPIR-V web site}. + For compiling into SPIR-V, + \l{https://github.com/KhronosGroup/glslang}{glslang} is used, while + translating and reflecting is done via + \l{https://github.com/KhronosGroup/SPIRV-Cross}{SPIRV-Cross}. + + For shader code to be written once in Qt applications and libraries, all + shaders are expected to be written in a single language, which is then + compiled into SPIR-V. This shading language is Vulkan-compatible GLSL at the + moment. This is different from what the OpenGL-style GLSL Qt 5.x expects. + See the + \l{https://github.com/KhronosGroup/GLSL/blob/master/extensions/khr/GL_KHR_vulkan_glsl.txt} + {GL_KHR_vulkan_glslspecification} for an overview of the differences. + + Source code for other shading languages, such as GLSL, HLSL, and the Metal + Shading Language, is then generated from translating the SPIR-V bytecode, + together with reflection information (inputs, outputs, shader resources). + For GLSL in particular, this also involves generating multiple variants, + meaning source code suitable for different GLSL versions, such as GLSL ES + 100, GLSL ES 300, and GLSL 120 and 150. This is then packed into + serializable QShader container objects, typically stored on disk as \c{.qsb} + files. The Qt Rendering Hardware Interface consumes QShader instances + directly, picking the shader source or bytecode that is best suited for the + graphics API used at run time. A QShader object is typically deserialized + from \c{.qsb} files shipped with the application or Qt itself in the Qt + Resource System. + + Some platforms provide the option of compiling shader source code to an + intermediate format similar to SPIR-V. This involves running + platform-specific tools. With Direct 3D, the \c qsb tool provides the option + to invoke + \l{https://docs.microsoft.com/en-us/windows/win32/direct3dtools/fxc}{the fxc + tool from the Windows SDK} once the HLSL source code has been generated. It + then replaces the HLSL source code with the \c DXBC binary generated by \c + fxc. This can have a positive effect on applications' runtime performance + since they no longer need to do the first phase of compilation (HLSL source + to DXBC) themselves. For macOS and iOS, the + \l{https://developer.apple.com/documentation/metal/libraries/building_a_library_with_metal_s_command-line_tools?language=objc}{XCode + SDK provides similar tools}. The downside of this approach is that running + these tools is only possible on their respective platforms. Therefore, this + is best suited for use in combination with qsb's CMake integration since + doing shader conditioning at application build time implicitly comes with + the knowledge needed about the target platform and what platform-specific + tools can be invoked. + + The following diagram describes the steps that happen during an invocation + of the \c qsb tool: + + \image shaderconditioning.png + + The main components of the Qt shader conditioning system are: + + \list + \li the \c qsb command-line tool + \li CMake integration for the \c qsb tool + \li QShader (part of the QtGui module) + \li QShaderBaker (part of this module, the library equivalent of the \c qsb + tool) + \endlist + + \section1 Typical Usage with Qt Quick + + Application developers typically work with custom shader code in Qt Quick + scenes that have one of the following: + + \list + \li \l ShaderEffect items + \li \l QQuickItem subclasses that use scene graph nodes in combination + with custom materials built by subclassing \l QSGMaterial. + \endlist + + For example, consider the following QML snippet: + + \qml + ShaderEffect { + width: 100; height: 100 + fragmentShader: "myeffect.frag.qsb" + } + \endqml + + Here the \l{ShaderEffect::fragmentShader}{fragmentShader} URL refers to a + \c{.qsb} file relative to the \c{.qml} file's location. The application is + expected to ship \c{myeffect.frag.qsb} next to the \c{.qml} file. To generate + that file from the Vulkan-style GLSL source (which itself does not need to be + shipped with the application), the application must use the \c qsb tool either + directly or via CMake. + + \section1 Typical Usage with Qt Quick 3D + + Qt Quick 3D uses the Shader Tools module directly to perform shader conditioning + at run time. In addition, it provides solutions for pre-generating shaders for + materials at build time, in case a runtime dependency to shader compilers and + other tools is not seen ideal. In either case, developers don't need to work + directly with the \c qsb tool since it's encapsulated by the Qt Quick 3D's own + framework and tools. + +*/ diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/doc/src/qtshadertools-qsb.qdoc b/local/recipes/qt/qtshadertools/source/src/shadertools/doc/src/qtshadertools-qsb.qdoc new file mode 100644 index 0000000000..ccc20568c7 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/doc/src/qtshadertools-qsb.qdoc @@ -0,0 +1,779 @@ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \title QSB Manual + \page qtshadertools-qsb.html + + \c qsb is a command-line tool provided by the \l{Qt Shader Tools} + module. It integrates third-party libraries such as + \l{https://github.com/KhronosGroup/glslang}{glslang} and + \l{https://github.com/KhronosGroup/SPIRV-Cross}{SPIRV-Cross}, + optionally invokes external tools, such as, \c fxc or \c + spirv-opt, and generates \c{.qsb} files. Additionally, it can be + used to inspect the contents of a \c{.qsb} package. + + \badcode +Usage: qsb [options] file +Qt Shader Baker (using QShader from Qt 6.10.0) + +Options: + -?, -h, --help Displays help on commandline options. + --help-all Displays help, including generic Qt options. + -v, --version Displays version information. + -b, --batchable Also generates rewritten vertex shader for Qt + Quick scene graph batching. + --zorder-loc The extra vertex input location when rewriting + for batching. Defaults to 7. + --glsl Comma separated list of GLSL versions to + generate. (for example, "100 es,120,330") + --hlsl Comma separated list of HLSL (Shader Model) + versions to generate. F.ex. 50 is 5.0, 51 is 5.1. + --msl Comma separated list of Metal Shading Language + versions to generate. F.ex. 12 is 1.2, 20 is 2.0. + --qt6 Equivalent to --glsl "100 es,120,150" --hlsl 50 + --msl 12. This set is commonly used with shaders + for Qt Quick materials and effects. + --msltess Indicates that a vertex shader is going to be + used in a pipeline with tessellation. Mandatory + for vertex shaders planned to be used with + tessellation when targeting Metal (--msl). + --tess-vertex-count The output vertex count from the tessellation + control stage. Mandatory for tessellation + evaluation shaders planned to be used with Metal. + The default value is 3. If it does not match the + tess.control stage, the generated MSL code will + not function as expected. + --tess-mode The tessellation mode: triangles or quads. + Mandatory for tessellation control shaders + planned to be used with Metal. The default value + is triangles. Isolines are not supported with + Metal. If it does not match the tess.evaluation + stage, the generated MSL code will not function + as expected. + --view-count The number of views the shader is used with. + num_views must be >= 2. Mandatory when multiview + rendering is used (gl_ViewIndex). Set only for + vertex shaders that really do rely on multiview + (as the resulting asset is tied to num_views). + Can be set for fragment shaders too, to get + QSHADER_VIEW_COUNT auto-defined. (useful for + ensuring uniform buffer layouts) + -g Generate full debug info for SPIR-V and DXBC + -O Invoke spirv-opt (external tool) to optimize + SPIR-V for performance. + -o, --output Output file for the shader pack. + --orig-file Filename to be be used for dependency tracking + instead of . + --qsbversion QSB version to use for the output file. By + default the latest version is automatically used, + use only to bake compatibility versions. F.ex. 64 + is Qt 6.4. + -c, --fxc In combination with --hlsl invokes fxc (SM + 5.0/5.1) or dxc (SM 6.0+) to store DXBC or DXIL + instead of HLSL. + -t, --metallib In combination with --msl builds a Metal library + with xcrun metal(lib) and stores that instead of + the source. Suitable only when targeting macOS, + not iOS. + -T, --metallib-ios In combination with --msl builds a Metal library + with xcrun metal(lib) and stores that instead of + the source. Suitable only when targeting iOS, not + macOS. + -D, --define Define macro. This argument can be specified + multiple times. + -p, --per-target Enable per-target compilation. (instead of + source->SPIRV->targets, do source->SPIRV->target + separately for each target) + -d, --dump Switches to dump mode. Input file is expected to + be a shader pack. + -x, --extract Switches to extract mode. Input file is expected + to be a shader pack. Result is written to the + output specified by -o. Pass -b to choose the + batchable variant. + =reflect|spirv,|glsl,|... + -r, --replace Switches to replace mode. Replaces the specified + shader in the shader pack with the contents of a + file. This argument can be specified multiple + times. Pass -b to choose the batchable variant. + Also supports adding a shader for a + target/variant that was not present before. + =, where + =spirv,|glsl,|... + -e, --erase Switches to erase mode. Removes the specified + shader from the shader pack. Pass -b to choose + the batchable variant. + =spirv,|glsl,|... + -s, --silent Enables silent mode. Only fatal errors will be + printed. + --mediump Default to medium precision for floats in + fragment shaders instead of high. GLSL ES only; + ignored for everything else, including GLSL. + --depfile Enables generating the depfile for the input + shaders, using the #include statements. + +Arguments: + file Vulkan GLSL source file to compile. The file + extension determines the shader stage, and can be + one of .vert, .tesc, .tese, .geom, .frag, .comp. + Note: Tessellation control/evaluation is not + supported with HLSL, instead use -r to inject + handcrafted hull/domain shaders. Some targets may + need special arguments to be set, e.g. MSL + tessellation will likely need --msltess, + --tess-vertex-count, --tess-mode, depending on + the stage. Geometry shaders are not supported + with Metal. + \endcode + + \section1 Modes of Operation + + There are five major modes of operation: + + \list + + \li \c{.qsb} file generation. + + \li \c{.qsb} file inspection. For example, \c{qsb -d + myshader.frag.qsb} will print the reflection metadata (in JSON + form) and the included shaders. + + \li Extraction mode. This allows writing a given shader from an + existing \c{.qsb} file into a separate file. For example, \c{qsb + -x spirv,100 -o myshader.spv myshader.frag.qsb} writes the SPIR-V + binary into \c myshader.spv. + + \li Replace mode. This allows replacing the contents of one or more shaders + within the \c{.qsb} file with content read from the specified files. This + way handcrafted shader code can be injected into the \c{.qsb} package. + + \li Erase mode. This removes the specified shader variant from the \c{.qsb} + file. + + \endlist + + \section1 Example + + Take the following fragment shader: + \badcode + #version 440 + + layout(location = 0) in vec2 v_texcoord; + layout(location = 0) out vec4 fragColor; + layout(binding = 1) uniform sampler2D tex; + + layout(std140, binding = 0) uniform buf { + float uAlpha; + }; + + void main() + { + vec4 c = texture(tex, v_texcoord); + fragColor = vec4(c.rgb, uAlpha); + } + \endcode + + Executing \c{qsb -o shader.frag.qsb shader.frag} results in generating \c + shader.frag.qsb. Inspecting this file with \c{qsb -d shader.frag.qsb} gives + us: + + \badcode +Stage: Fragment +QSB_VERSION: 5 +Has 1 shaders: + Shader 0: SPIR-V 100 [Standard] + +Reflection info: { + "combinedImageSamplers": [ + { + "binding": 1, + "name": "tex", + "set": 0, + "type": "sampler2D" + } + ], + "inputs": [ + { + "location": 0, + "name": "v_texcoord", + "type": "vec2" + } + ], + "localSize": [ + 0, + 0, + 0 + ], + "outputs": [ + { + "location": 0, + "name": "fragColor", + "type": "vec4" + } + ], + "uniformBlocks": [ + { + "binding": 0, + "blockName": "buf", + "members": [ + { + "name": "uAlpha", + "offset": 0, + "size": 4, + "type": "float" + } + ], + "set": 0, + "size": 4, + "structName": "_27" + } + ] +} + + +Shader 0: SPIR-V 100 [Standard] +Entry point: main +Contents: +Binary of 864 bytes + \endcode + + By default only SPIR-V is generated, so an application using this shader + package would only be functional with Vulkan. Let's make it more useful: + + \badcode + qsb --glsl "100 es,120,150" --hlsl 50 --msl 12 -o shader.frag.qsb shader.frag + \endcode + + This leads to generating a shader package that makes it suitable for OpenGL, + Direct 3D, and Metal as well. The features used in this shader are basic, + and even GLSL ES 100 (the shading language of OpenGL ES 2.0) is suitable. + + Inspecting the result shows: + + \badcode +Stage: Fragment +QSB_VERSION: 5 +Has 6 shaders: + Shader 0: GLSL 120 [Standard] + Shader 1: HLSL 50 [Standard] + Shader 2: GLSL 100 es [Standard] + Shader 3: MSL 12 [Standard] + Shader 4: SPIR-V 100 [Standard] + Shader 5: GLSL 150 [Standard] + +Reflection info: { + ... +} + + +Shader 0: GLSL 120 [Standard] +Entry point: main +Contents: +#version 120 + +struct buf +{ + float uAlpha; +}; + +uniform buf _27; + +uniform sampler2D tex; + +varying vec2 v_texcoord; + +void main() +{ + vec4 c = texture2D(tex, v_texcoord); + gl_FragData[0] = vec4(c.xyz, _27.uAlpha); +} + +************************************ + +Shader 1: HLSL 50 [Standard] +Entry point: main +Native resource binding map: +0 -> [0, -1] +1 -> [0, 0] +Contents: +cbuffer buf : register(b0) +{ + float _27_uAlpha : packoffset(c0); +}; + +Texture2D tex : register(t0); +SamplerState _tex_sampler : register(s0); + +static float2 v_texcoord; +static float4 fragColor; + +struct SPIRV_Cross_Input +{ + float2 v_texcoord : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float4 fragColor : SV_Target0; +}; + +void frag_main() +{ + float4 c = tex.Sample(_tex_sampler, v_texcoord); + fragColor = float4(c.xyz, _27_uAlpha); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + v_texcoord = stage_input.v_texcoord; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.fragColor = fragColor; + return stage_output; +} + +************************************ + +... + +Shader 3: MSL 12 [Standard] +Entry point: main0 +Native resource binding map: +0 -> [0, -1] +1 -> [0, 0] +Contents: +#include +#include + +using namespace metal; + +struct buf +{ + float uAlpha; +}; + +struct main0_out +{ + float4 fragColor [[color(0)]]; +}; + +struct main0_in +{ + float2 v_texcoord [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], constant buf& _27 [[buffer(0)]], texture2d tex [[texture(0)]], sampler texSmplr [[sampler(0)]]) +{ + main0_out out = {}; + float4 c = tex.sample(texSmplr, in.v_texcoord); + out.fragColor = float4(c.xyz, _27.uAlpha); + return out; +} + +************************************ + +... + \endcode + + This package can now be used by Qt Quick with all supported graphics APIs: + Vulkan, Direct 3D, Metal, OpenGL, and OpenGL ES. At run time the appropriate + shader is picked up automatically by the Qt Rendering Hardware Interface + that sits underneath Qt Quick and Qt Quick 3D. + + Besides translating the SPIR-V bytecode back to higher level source code, + the system takes care of additional problems, such as ensuring correct + mapping of SPIR-V binding numbers onto native resources. For example, with + HLSL we saw a section like this above: + +\badcode +Native resource binding map: + 0 -> [0, -1] + 1 -> [0, 0] +\endcode + + Internally, this allows mapping a SPIR-V style binding point \c 0 to the + HLSL register \c b0 and binding \c 1 to \c t0 and \c s0. This helps making + the differences in resource bindings between the various shading languages + transparent to the users of the Rendering Hardware Interface, and allows + everything in Qt to operate with Vulkan/SPIR-V style binding points as they + are specified in the original Vulkan-style GLSL source code. + + \section1 Shader Types + + The type of shader is deduced from the input file extension. Thus, the + extension must be one of the following: + + \list + \li \c .vert - for vertex shaders + \li \c .tesc - for tessellation control shaders + \li \c .tese - for tessellation evaluation shaders + \li \c .geom - for geometry shaders + \li \c .frag - for fragment (pixel) shaders + \li \c .comp - for compute shaders + \endlist + + \note Tessellation control and evaluation shaders are not currently + supported with Direct 3D (HLSL). + + \section1 Shading Languages and Versions + + SPIR-V 1.0 is always generated. What gets generated in addition depends on + the command-line arguments \c{--glsl}, \c{--hlsl}, and \c{--msl}. + + These parameters are all followed by a comma-separated list. The list must + include GLSL-style version numbers, with an optional suffix (\c{es}, + indicating GLSL ES). The space between the suffix and the version is + optional (not having the space can help avoiding the need for quoting). + + For example, Qt Quick's built-in materials (the shaders backing items, such + as \l Image, \l Text, \l Rectangle) all prepare their shaders with \c{--glsl + "100 es,120,150" --hlsl 50 --msl 12}. This makes them compatible with OpenGL + ES 2.0 and higher, OpenGL 2.1 and higher, and OpenGL core profile contexts + of version 3.2 and higher. + + If the shader uses functions or constructs that do not have an equivalent in + the specified targets, \c qsb will fail. If that is the case, the targets + will need to be adjusted, and this also means that the application's minimum + system requirements get adjusted implicitly. As an example, take the \c + textureLod GLSL function that is only available with OpenGL ES 3.0 and up + (meaning GLSL ES 300 or higher). When requesting GLSL \c{300 es} instead of + \c{100 es}, \c qsb will succeed, but the application using that \c{.qsb} + file will now require OpenGL ES 3.0 or higher and will not be compatible + with OpenGL ES 2.0 based systems. + + Another obvious example of this is compute shaders: \c{.comp} shaders will + need to specify \c{--glsl 310es,430} as compute shaders are only available + with OpenGL ES 3.1 or newer and OpenGL 4.3 or newer. + + Adjusting the shader model version for HLSL, or the Metal Shading Language + version is expected to be needed rarely. Shader Model 5.0 (\c{--hlsl 50}) and + MSL 1.2 (\c{--msl 12}) will typically be sufficient. + + \section1 Qt Quick Scene Graph Batching + + The Qt Quick Scene Graph's renderer supports batching of geometry to reduce + the number of draw calls. See \l{Qt Quick Scene Graph}{the Scene Graph + pages} for details. This relies on injecting code to the vertex shader's + main() function. In Qt 5.x this happened at run time, by modifying the + supplied GLSL vertex shader code. In Qt 6 that is not an option. Instead, + batchable variants of vertex shaders can be built by the \c qsb tool. This + is requested by the \c{-b} argument. When the input is not a vertex shader + with \c{.vert} extension, it has no effect. For vertex shaders, however, it + will lead to generating two versions for each target. Qt Quick will then + automatically pick the right variant (standard or batchable) at run time. + + \note Applications do not have to concern themselves with the details of + batching. They must simply ensure that \c{-b} (or the equivalent \c + BATCHABLE keyword if using the \l{Qt Shader Tools Build System + Integration}{CMake integration}) is specified when processing the vertex + shaders. This is relevant only for Qt Quick shaders used with \l + ShaderEffect or \l QSGMaterialShader. + + Take the following example vertex shader: + \badcode +#version 440 +layout(location = 0) in vec4 position; +layout(location = 1) in vec2 texcoord; +layout(location = 0) out vec2 v_texcoord; +layout(std140, binding = 0) uniform buf { + mat4 mvp; +} ubuf; + +void main() +{ + v_texcoord = texcoord; + gl_Position = ubuf.mvp * position; +} + \endcode + + Running \c {qsb -b --glsl 330 -o example.vert.qsb example.vert} leads to: + +\badcode +Stage: Vertex +QSB_VERSION: 5 +Has 4 shaders: + Shader 0: GLSL 330 [Standard] + Shader 1: GLSL 330 [Batchable] + Shader 2: SPIR-V 100 [Standard] + Shader 3: SPIR-V 100 [Batchable] + +Reflection info: { + ... +\endcode + + Note how all target languages and versions now exist in two variants: + Standard and a slightly modified Batchable. + + \section1 Invoking External Tools + + \c qsb can invoke certain external tools. These fall into two categories: + tools for performing optimizations on the shader bytecode (SPIR-V), and + platform-specific tools to perform the first phase of shader compilation, + from source to some intermediate bytecode format. + + These are enabled by the following command-line options: + + \list + + \li \c{-O} - invokes \c spirv-opt as a post-processing step on the SPIR-V + binary. The \c{.qsb} file will include the optimized version. This assumes + that \c spirv-opt is available on the system (for example, from the Vulkan + SDK) and ready to be invoked. + + \li \c{-c} or \c{--fxc} - invokes \c{fxc.exe}, the Direct 3D shader + compiler. The resulting \c DXBC (DirectX Byte Code) data is what gets + stored in the \c{.qsb} file instead of HLSL. Qt will automatically pick it + up at run time, so it is up to the \c{.qsb} file's creator to decide what to + include, HLSL source or the intermediate format. Whenever possible, prefer + the latter since it eliminates the need for parsing an HLSL source at run + time, leading to potentially significant performance gains upon graphics + pipeline creation. The downside is that this argument can only be used when + \c qsb runs on Windows. + + \li \c{-t} or \c{--metallib} - invokves the appropriate XCode Metal tools to + generate a .metallib file and includes that in the \c{.qsb} package instead + of the MSL source code. This option is only available when \c qsb is running + on macOS. + + \endlist + + \section1 Other Options + + \list + + \li \c{-D} - defines a macro. This allows using #ifdef and similar in the + GLSL source code. + + \li \c{-g} - enables generating full debug information for SPIR-V, thus + enabling tools like \l{https://renderdoc.org/}{RenderDoc} to display the + full source when inspecting a pipeline or when performing vertex or fragment + debugging. Also has an effect for Direct 3D when \c{-c} is specified, + because \c fxc is then instructed to include debug information in the + generated intermediate bytecode. + + \li \c{--mediump} - requests defaulting to medium precision for floats in + GLSL ES fragment shaders. Ignored for any other targets, including (non-ES) + GLSL, and for non-fragment shaders. + + \li \c{--orig-file} - specifies the filename that is used instead of the + input source file when generating dependency files for CMake (--depfiles). + This is useful when the file passed to qsb is an intermediate, generated + shader source file. For dependency tracking purposes however, it is often + the original file that needs to be used. + + \endlist + + \section1 Tessellation + + \list + + \li \c{--msltess} - Indicates that the vertex shader is used in a pipeline + that includes tessellation stages. Has no effect for other types of + shaders, and when MSL shader generation is not enabled. If not specified, + the vertex shader will not be functional on Metal in combination with + tessellation. + + \li \c{--tess-vertex-count } - Specifies the output vertex count + from the tessellation control stage. Specifying this is mandatory for + tessellation evaluation shaders used with Metal. The default value is 3. If + it does not match the tessellation control stage, the generated MSL code + will not function as expected. + + \li \c{--tess-mode } - This option specifies the tessellation mode. + It can take one of two values: \c triangles or \c quads. The default value + is \c triangles. Specifying this is mandatory for tessellation control + shaders used with Metal. The value must match the tessellation evaluation + stage, otherwise the generated MSL code will not function as expected. + + \endlist + + \section1 Multiview + + Take the following vertex shader. It is written as Vulkan-compatible GLSL, + enabling the \c{GL_EXT_multiview} extension to make using \c{gl_ViewIndex} + legal. + +\badcode +#version 440 +#extension GL_EXT_multiview : require + +layout(location = 0) in vec4 pos; +layout(std140, binding = 0) uniform buf +{ + mat4 mvp[2]; +}; + +void main() +{ + gl_Position = mvp[gl_ViewIndex] * pos; +} +\endcode + + \note In practice the #extension GL_EXT_multiview line will not be needed + in the source code passed to \c qsb, because passing the + \c{--view-count} argument described below automatically injects that line + into the shader source code before compiling to SPIR-V. + + For Vulkan this works as-is, as long as Vulkan 1.1 is supported at runtime. + See + \l{https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_multiview.html}{VK_KHR_multiview} + for details. + + To generate a HLSL vertex shader from the above for Direct 3D 12 (see + \l{https://microsoft.github.io/DirectX-Specs/d3d/ViewInstancing.html}{view + instancing} for details), the minimum shader model version is 6.1, meaning + \c qsb will fail when specifying e.g. \c{--hlsl 50}. Use at least \c{--hlsl + 61} when processing a multiview vertex shader. Multiview is not supported + with Direct 3D 11. + + For OpenGL, additional metadata is needed: + + \list + + \li \c{--view-count} - When transpiling above shader (after compiling to + SPIR-V) to OpenGL-compatible GLSL source code, it is not enough to map + \c{gl_ViewIndex} to \c{gl_ViewID_OVR}, but the number of views needs to be + declared in the shader as well. Passing a value of 2 to the \c{--view-count} + argument results in injecting a \c{layout(num_views = 2) in;} statement into + the generated GLSL source code, thus making it a valid (OpenGL) GLSL shader. + See + \l{https://registry.khronos.org/OpenGL/extensions/OVR/OVR_multiview.txt}{GL_OVR_multiview} + for details and note that the generated GLSL shaders also require + \l{https://registry.khronos.org/OpenGL/extensions/OVR/OVR_multiview2.txt}{GL_OVR_multiview2} + to be supported at runtime since that is what is going to be required by the + \c{#extension} directive in the generated shader source code. + + \endlist + + When targeting OpenGL (ES) with such a vertex shader, the generated GLSL + version (\c{--glsl}) must be at least \c 330 or \c{300 es}. The former is + not something that is enforced by \c qsb or QShaderBaker, but in practice + OpenGL implementations are known to reject such shaders if the GLSL version + is 150 or smaller. Hence it is recommended to pass \c{--glsl 330,300es} + when conditioning vertex shaders enabling GL_EXT_multiview. + + Specifying \c{--view-count} automatically generates and injects a + preprocessor define: + \c{#define QSHADER_VIEW_COUNT n} where \c n is the number of views. + When the view count is not provided, the define is not set at all. + This allows writing code such as the following, and allows using the same + source file for all view count-specific variants of the shader. + +\badcode +layout(std140, binding = 0) uniform buf { +#if QSHADER_VIEW_COUNT >= 2 + mat4 matrix[QSHADER_VIEW_COUNT]; +#else + mat4 matrix; +#endif + float opacity; +}; +\endcode + + In addition, the \c{#extension GL_EXT_multiview : require} line is generated + automatically in vertex shaders whenever a view count of 2 or greater is + set. This reduces the number of extra lines needed to be added for multiview + support in a vertex shader. + + Setting the view count can be relevant with other types of shaders as well. + For example, when sharing a uniform buffer between the vertex and fragment + shader, and both shaders have to ensure the same buffer layout, it can be + useful to be able to write \c{#if QSHADER_VIEW_COUNT >= 2} in both source + files. That can be ensured by specifying \c{--view-count} for both when + invoking \c qsb. + + \note Directly relying on the \c{gl_ViewIndex} keyword in a non-vertex + stage, for example in a fragment shader, is not portable at the moment and + should be avoided. + + \section1 Working with GLSL Features Specific to OpenGL + + It can sometimes be necessary to use shading language constructs that are + specific to OpenGL and GLSL, and are not applicable to other shading + languages, intermediate formats, and graphics APIs. + + The prime examples of this are the external textures and samplers of OpenGL + ES. Implementing video playback or showing a camera viewfinder may involve, + depending on the platform, working with OpenGL texture objects that are not + meant to be used as regular 2D textures, but are rather usable, with a + limited feature set, via the + \l{https://www.khronos.org/registry/OpenGL/extensions/OES/OES_EGL_image_external.txt}{GL_TEXTURE_EXTERNAL_OES} + binding point in the OpenGL API and the \c{samplerExternalOES} sampler type + in shaders. The latter presents a potential showstopper when using the + SPIR-V based shader pipeline of Qt: running such a shader through qsb will + result in a failure due to \c{samplerExternalOES} not being accepted as a + valid type due to not being mappable to SPIR-V and other target shading + languages. + + To overcome this, qsb offers the option to replace the contents of any given + shader variant in a .qsb file with user-provided data that is read from a + file, fully replacing the original qsb-generated shader source or byte code. + + Take the following fragment shader. Note the type of \c tex. What if the + type needs to be \c samplerExternalOES when running with OpenGL ES? + +\badcode +#version 440 + +layout(location = 0) in vec2 texCoord; +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf { + float opacity; +} ubuf; + +layout(binding = 1) uniform sampler2D tex; + +void main() +{ + fragColor = texture(tex, texCoord).rgba * ubuf.opacity; +} +\endcode + + Just changing the type of samplerExternalOES is not feasible. That leads to + compilation errors right away. + + There is a simple solution, however: writing a separate, pure OpenGL ES + targeted version of the shader, and injecting it into the .qsb file. The + following shader is only compatible with GLSL ES and cannot be run through + qsb. However, we know that it can be processed by OpenGL ES at run time. + +\badcode +precision highp float; +#extension GL_OES_EGL_image_external : require +varying vec2 texCoord; + +struct buf +{ + float opacity; +}; + +uniform buf ubuf; +uniform samplerExternalOES tex; + +void main() +{ + gl_FragColor = texture2D(tex, texCoord).rgba * ubuf.opacity; +} +\endcode + + Let's call this \c{shader_gles.frag}. Once \c{qsb --glsl 100es -o + shader.frag.qsb shader.frag} completes, giving us a (half-ready) .qsb file, + we can do \c{qsb -r glsl,100es,shader_gles.frag shader.frag.qsb} to update + \c{shader.frag.qsb} by substituting the shader for GLSL 100 es with + the contents of the specified file (\c{shader_gles.frag}). Now + \c{shader.frag.qsb} is ready to be used at run time with OpenGL ES. + + \note Pay attention to keeping the interface between the shader and the + application unchanged. Always inspect the qsb-generated GLSL code first, + either by printing the .qsb file contents via \c{-d} option, or by + extracting the GLSL ES 100 shader by running \c{qsb -x glsl,100es -o + gles_shader.frag shader.frag.qsb}. The struct, struct member, and uniform + names must not differ in the manually injected version either. + + \note The ability to place data from arbitrary files into the .qsb package + can also be used to inject handcrafted hull and domain HLSL shaders, in + order to make tessellation-based graphics pipelines functional with Direct + 3D as well. + +*/ diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/doc/src/qtshadertools-toc.qdoc b/local/recipes/qt/qtshadertools/source/src/shadertools/doc/src/qtshadertools-toc.qdoc new file mode 100644 index 0000000000..28a0ff52e1 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/doc/src/qtshadertools-toc.qdoc @@ -0,0 +1,17 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page qtshadertools-toc.html + \title Qt Shader Tools module topics + + The following list has links to all the individual topics (HTML files) + in the Qt Shader Tools module. + + \list + \li \l {Qt Shader Tools Overview}{Overview} + \li \l {QSB Manual} + \li \l {Qt Shader Tools Build System Integration}{Build System Integration} + \endlist + +*/ diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/qshaderbaker.cpp b/local/recipes/qt/qtshadertools/source/src/shadertools/qshaderbaker.cpp new file mode 100644 index 0000000000..bc36461649 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/qshaderbaker.cpp @@ -0,0 +1,871 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:critical reason:data-parser + + +#include "qshaderbaker.h" +#include "qspirvcompiler_p.h" +#include "qspirvshader_p.h" +#include +#include +#include + +QT_BEGIN_NAMESPACE + +/*! + \class QShaderBaker + \inmodule QtShaderTools + \since 6.6 + + \brief Compiles a GLSL/Vulkan shader into SPIR-V, translates into other + shading languages, and gathers reflection metadata. + + \warning QShaderBaker, just like the QRhi family of classes in the Qt Gui + module, including QShader and QShaderDescription, offers limited + compatibility guarantees. There are no source or binary compatibility + guarantees for these classes, meaning the API is only guaranteed to work + with the Qt version the application was developed against. Source + incompatible changes are however aimed to be kept at a minimum and will only + be made in minor releases (6.7, 6.8, and so on). To use this class in an + application, link to \c{Qt::ShaderToolsPrivate} (if using CMake), and + include the headers with the \c rhi prefix, for example + \c{#include }. + + QShaderBaker takes a graphics (vertex, fragment, etc.) or compute shader, + and produces multiple - either source or bytecode - variants of it, + together with reflection information. The results are represented by a + QShader instance, which also provides simple and fast serialization + and deserialization. + + \note Applications and libraries are recommended to avoid using this class + directly. Rather, all Qt users are encouraged to rely on offline compilation + by invoking the \c qsb command-line tool at build time via CMake. The \c qsb + tool uses QShaderBaker and writes the serialized version of the generated + QShader into a file. The usage of this class should be restricted to cases + where run time compilation cannot be avoided, such as when working with + user-provided or dynamically generated shader source strings. + + The input format is always assumed to be Vulkan-flavored GLSL at the + moment. See the + \l{https://github.com/KhronosGroup/GLSL/blob/master/extensions/khr/GL_KHR_vulkan_glsl.txt}{GL_KHR_vulkan_glsl + specification} for an overview, keeping in mind that the Qt Shader Tools + module is meant to be used in combination with the QRhi classes from Qt + Rendering Hardware Interface module, and therefore a number of concepts and + constructs (push constants, storage buffers, subpasses, etc.) are not + applicable at the moment. Additional options may be introduced in the + future, for example, by enabling + \l{https://docs.microsoft.com/en-us/windows/desktop/direct3dhlsl/dx-graphics-hlsl}{HLSL} + as a source format, once HLSL to SPIR-V compilation is deemed suitable. + + The reflection metadata is retrievable from the resulting QShader by + calling QShader::description(). This is essential when having to + discover what set of vertex inputs and shader resources a shader expects, + and what the layouts of those are, as many modern graphics APIs offer no + built-in shader reflection capabilities. + + \section2 Typical Workflow + + Let's assume an application has a vertex and fragment shader like the following: + + Vertex shader: + \snippet color.vert 0 + + Fragment shader: + \snippet color.frag 0 + + To get QShader instances that can be passed as-is to a + QRhiGraphicsPipeline, there are two options: doing the shader pack + generation off line, or at run time. + + The former involves running the \c qsb tool: + + \badcode + qsb --glsl "100 es,120" --hlsl 50 --msl 12 color.vert -o color.vert.qsb + qsb --glsl "100 es,120" --hlsl 50 --msl 12 color.frag -o color.frag.qsb + \endcode + + The example uses the translation targets as appropriate for QRhi. This + means GLSL/ES 100, GLSL 120, HLSL Shader Model 5.0, and Metal Shading + Language 1.2. + + Note how the command line options correspond to what can be specified via + setGeneratedShaders(). Once the resulting files are available, they can be + shipped with the application (typically embedded into the executable the + the Qt Resource System), and can be loaded and passed to + QShader::fromSerialized() at run time. + + While not shown here, \c qsb can do more: it is also able to invoke \c fxc + on Windows or the appropriate XCode tools on macOS to compile the generated + HLSL or Metal shader code into bytecode and include the compiled versions + in the QShader. After a baked shader pack is written into a file, its + contents can be examined by running \c{qsb -d} on it. Run \c qsb with + \c{--help} for more information. + + The alternative approach is to perform the same at run time. This involves + creating a QShaderBaker instance, calling setSourceFileName(), and then + setting up the translation targets via setGeneratedShaders(): + + \badcode + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs) }); + targets.append({ QShader::SpirvShader, QShaderVersion(120) }); + targets.append({ QShader::HlslShader, QShaderVersion(50) }); + targets.append({ QShader::MslShader, QShaderVersion(12) }); + baker.setGeneratedShaders(targets); + QShader shaders = baker.bake(); + if (!shaders.isValid()) + qWarning() << baker.errorMessage(); + \endcode + + \sa QShader + */ + +struct QShaderBakerPrivate +{ + bool readFile(const QString &fn); + std::pair compile(); + QByteArray perTargetDefines(const QShaderBaker::GeneratedShader &key); + + QString sourceFileName; + QByteArray source; + QShader::Stage stage; + QList reqVersions; + QList variants; + QByteArray preamble; + int batchLoc = 7; + bool perTargetEnabled = false; + bool breakOnShaderTranslationError = true; + QSpirvShader::TessellationInfo tessInfo; + QSpirvShader::MultiViewInfo multiViewInfo; + QShaderBaker::SpirvOptions spirvOptions; + QShaderBaker::GlslOptions glslOptions; + QSpirvCompiler compiler; + QString errorMessage; +}; + +bool QShaderBakerPrivate::readFile(const QString &fn) +{ + QFile f(fn); + if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) { + qWarning("QShaderBaker: Failed to open %s", qPrintable(fn)); + return false; + } + source = f.readAll(); + + // Remove UTF-8 BOM, if present. glslang fails otherwise, since the BOM is + // removed in glslangValidator (the command-line frontend), not in the + // compiler itself. Replicate that here. + if (source.size() >= 3) { + const unsigned char *p = reinterpret_cast(source.constData()); + if (p[0] == 0xEF && p[1] == 0xBB && p[2] == 0xBF) + source.remove(0, 3); + } + + sourceFileName = fn; + return true; +} + +/*! + Constructs a new QShaderBaker. + */ +QShaderBaker::QShaderBaker() + : d(new QShaderBakerPrivate) +{ +} + +/*! + Destructor. + */ +QShaderBaker::~QShaderBaker() +{ + delete d; +} + +/*! + Sets the name of the shader source file to \a fileName. This is the file + that will be read when calling bake(). The shader stage is deduced + automatically from the file extension. When this is not desired or not + possible, use the overload with the stage argument instead. + + The supported file extensions are: + \list + \li \c{.vert} - vertex shader + \li \c{.frag} - fragment (pixel) shader + \li \c{.tesc} - tessellation control (hull) shader + \li \c{.tese} - tessellation evaluation (domain) shader + \li \c{.geom} - geometry shader + \li \c{.comp} - compute shader + \endlist + + \warning \a fileName is expected to contain trusted content. Application + developers are advised to carefully consider the potential implications + before passing in user-provided source files that are not part of the + application. + */ +void QShaderBaker::setSourceFileName(const QString &fileName) +{ + if (!d->readFile(fileName)) + return; + + const QString suffix = QFileInfo(fileName).suffix(); + if (suffix == QStringLiteral("vert")) { + d->stage = QShader::VertexStage; + } else if (suffix == QStringLiteral("frag")) { + d->stage = QShader::FragmentStage; + } else if (suffix == QStringLiteral("tesc")) { + d->stage = QShader::TessellationControlStage; + } else if (suffix == QStringLiteral("tese")) { + d->stage = QShader::TessellationEvaluationStage; + } else if (suffix == QStringLiteral("geom")) { + d->stage = QShader::GeometryStage; + } else if (suffix == QStringLiteral("comp")) { + d->stage = QShader::ComputeStage; + } else { + qWarning("QShaderBaker: Unknown shader stage, defaulting to vertex"); + d->stage = QShader::VertexStage; + } +} + +/*! + Sets the name of the shader source file to \a fileName. This is the file + that will be read when calling bake(). The shader stage is specified by \a + stage. + + \warning \a fileName is expected to contain trusted content. Application + developers are advised to carefully consider the potential implications + before passing in user-provided source files that are not part of the + application. + */ +void QShaderBaker::setSourceFileName(const QString &fileName, QShader::Stage stage) +{ + if (d->readFile(fileName)) + d->stage = stage; +} + +/*! + Sets the source \a device. This allows using any QIODevice instead of just + files. \a stage specifies the shader stage, while the optional \a fileName + contains a filename that is used in the error messages. + + \warning \a device is expected to contain trusted content. Application + developers are advised to carefully consider the potential implications + before passing in user-provided data from sources that are not under the + application's control. + */ +void QShaderBaker::setSourceDevice(QIODevice *device, QShader::Stage stage, const QString &fileName) +{ + setSourceString(device->readAll(), stage, fileName); +} + +/*! + Sets the input shader \a sourceString. \a stage specified the shader stage, + while the optional \a fileName contains a filename that is used in the + error messages. + + \warning \a sourceString is expected to contain trusted content. Application + developers are advised to carefully consider the potential implications + before passing in user-provided data from sources that are not under the + application's control. + */ +void QShaderBaker::setSourceString(const QByteArray &sourceString, QShader::Stage stage, const QString &fileName) +{ + d->sourceFileName = fileName; // for error messages, include handling, etc. + d->source = sourceString; + d->stage = stage; +} + +/*! + \typedef QShaderBaker::GeneratedShader + + Synonym for std::pair. +*/ + +/*! + Specifies what kind of shaders to compile or translate to. Nothing is + generated by default so calling this function before bake() is mandatory + + \note when this function is not called or \a v is empty or contains only invalid + entries, the resulting QShader will be empty and thus invalid. + + For example, the minimal possible baking target is SPIR-V, without any + additional translations to other languages. To request this, do: + + \badcode + baker.setGeneratedShaders({ QShader::SpirvShader, QShaderVersion(100) }); + \endcode + + \note QShaderBaker only handles the SPIR-V and human-readable source + targets. Further compilation into API-specific intermediate formats, such + as QShader::DxbcShader or QShader::MetalLibShader is implemented by the + \c qsb command-line tool, and is not part of the QShaderBaker runtime API. + */ +void QShaderBaker::setGeneratedShaders(const QList &v) +{ + d->reqVersions = v; +} + +/*! + Specifies which shader variants are generated. Each shader version can have + multiple variants in the resulting QShader. + + In most cases \a v contains a single entry, QShader::StandardShader. + + \note when no variants are set, the resulting QShader will be empty and + thus invalid. + */ +void QShaderBaker::setGeneratedShaderVariants(const QList &v) +{ + d->variants = v; +} + +/*! + Specifies a custom \a preamble that is processed before the normal shader + code. + + This is more than just prepending to the source string: the validity of the + GLSL version directive, which is required to be placed before everything + else, is not affected. Line numbers in the reported error messages also + remain unchanged, ignoring the contents given in the \a preamble. + + One use case for preambles is to transparently insert dynamically generated + \c{#define} statements. + */ +void QShaderBaker::setPreamble(const QByteArray &preamble) +{ + d->preamble = preamble; +} + +/*! + When generating a QShader::BatchableVertexShader variant, \a location + specifies the input location for the inserted vertex input. The value is by + default 7 and needs to be overridden only if the vertex shader already uses + input location 7. + */ +void QShaderBaker::setBatchableVertexShaderExtraInputLocation(int location) +{ + d->batchLoc = location; +} + +/*! + Sets per-target compilation to \a enable. By default this is disabled, + meaning that the Vulkan/GLSL source is compiled to SPIR-V once per variant. + (so once by default, twice if it is a vertex shader and the Batchable + variant as requested as well). The resulting SPIR-V is then translated to + the various target languages (GLSL, HLSL, MSL). + + In per-target compilation mode, there is a separate GLSL to SPIR-V + compilation step for each target, meaning for each GLSL/HLSL/MSL version + requested via setGeneratedShaders(). The input source is the same, but with + target-specific preprocessor defines inserted. This is significantly more + time consuming, but allows applications to provide a single shader and use + \c{#ifdef} blocks to differentiate. When this mode is disabled, the only + way to achieve the same is to provide multiple versions of the shader file, + process each separately, ship {.qsb} files for each, and choose the right + file based on run time logic. + + The following macros will be automatically defined in this mode. Note that + the macros are always tied to shading languages, not graphics APIs. + + \list + + \li \c{QSHADER_SPIRV} - defined when targeting SPIR-V (to be consumed, + typically, by Vulkan). + + \li \c{QSHADER_SPIRV_VERSION} - the targeted SPIR-V version number, such as + \c 100. + + \li \c{QSHADER_GLSL} - defined when targeting GLSL or GLSL ES (to be + consumed, typically, by OpenGL or OpenGL ES) + + \li \c{QSHADER_GLSL_VERSION} - the targeted GLSL or GLSL ES version number, + such as \c 100, \c 300, or \c 330. + + \li \c{QSHADER_GLSL_ES} - defined only when targeting GLSL ES + + \li \c{QSHADER_HLSL} - defined when targeting HLSL (to be consumed, + typically, by Direct 3D) + + \li \c{QSHADER_HLSL_VERSION} - the targeted HLSL shader model version, such + as \c 50 + + \li \c{QSHADER_MSL} - defined when targeting the Metal Shading Language (to + be consumed, typically, by Metal) + + \li \c{QSHADER_MSL_VERSION} - the targeted MSL version, such as \c 12 or + \c 20. + + \endlist + + This allows writing shader code like the following. + + \badcode + #if QSHADER_HLSL || QSHADER_MSL + vec2 uv = vec2(uv_coord.x, 1.0 - uv_coord.y); + #else + vec2 uv = uv_coord; + #endif + \endcode + + \note Version numbers follow the GLSL-inspired QShaderVersion syntax and + thus are a single integer always. + + \note There is only one QShaderDescription per QShader, no matter how many + individual targets there are. Therefore members of uniform blocks, vertex + inputs, etc. must not be made conditional using the macros described above. + + \warning Be aware of the differences between the concepts of graphics APIs + and shading languages. QShaderBaker and the related tools work strictly + with the concept of shading languages, ignoring how the results are + consumed afterwards. Therefore, if the higher layers in the Qt graphics + stack one day start using SPIR-V also for an API other than Vulkan, the + assumption that QSHADER_SPIRV implies Vulkan will no longer hold. + */ +void QShaderBaker::setPerTargetCompilation(bool enable) +{ + d->perTargetEnabled = enable; +} + +/*! + Controls the behavior when shader translation (from SPIR-V to + GLSL/HLSL/MSL) fails. By default this setting is true, which will cause + bake() to return with an error if a requested shader cannot be generated. + If that is not desired, and the intention is to generate what we can but + silently skip the rest, then set \a enable to false. + + Targeting multiple GLSL versions can lead to errors when a feature is not + translatable to a given version. For example, attempting to translate a + shader using textureSize() to GLSL ES 100 would fail the entire bake() call + with the error message "textureSize is not supported in ESSL 100". If it is + acceptable to not have a GLSL ES 100 shader in the result, even though it + was requested, then setting this flag to false makes bake() to succeed. + */ +void QShaderBaker::setBreakOnShaderTranslationError(bool enable) +{ + d->breakOnShaderTranslationError = enable; +} + +/*! + When generating MSL shader code for a tessellation control shader, the + tessellation \a mode (triangles or quads) must be known upfront. In GLSL + this is declared in the tessellation evaluation shader typically, but for + Metal it must be known also when generating the compute shader from the + tessellation control shader. + + When not set, the default is triangles. + */ +void QShaderBaker::setTessellationMode(QShaderDescription::TessellationMode mode) +{ + d->tessInfo.infoForTesc.mode = mode; +} + +/*! + When generating MSL shader code for a tessellation evaluation shader, the + output vertex \a count of the tessellation control shader must be known + upfront. in GLSL this would be declared in the tessellation control shader + typically, but for Metal it must be known also when generating the vertex + shader from the teselation evaluation shader. + + When not set, the default value is 3. + */ +void QShaderBaker::setTessellationOutputVertexCount(int count) +{ + d->tessInfo.infoForTese.vertexCount = count; +} + +/*! + When transpiling shaders using multiview (e.g. a vertex shader using + gl_ViewIndex for a renderer relying on GL_OVR_multiview2, VK_KHR_multiview, + etc.), for some of the targets it is necessary to declare the number of + views in the shader. This is not done in the Vulkan-style GLSL code, and is + not relevant for targets such as SPIR-V or HLSL, but is required for OpenGL + and GLSL, and so the value has to be provided as additional metadata. + + By default the value is 0, which disables injecting the \c{num_views} + statement. Setting 1 is not useful since that is the default \c{num_views} + regardless. Therefore \a count should be >= 2 to make an effect. When set + to, for example, 2, the generated GLSL shader will contain a + \c{layout(num_views = 2) in;} statement. + + Setting a \a count of 2 or greater also injects some preprocessor + statements: + \c{QSHADER_VIEW_COUNT} is set to \a count, whereas the + \c GL_EXT_multiview extension is enabled automatically. Therefore, setting + the appropriate + \a count can be relevant with other types of shaders as well, e.g. when + sharing a uniform buffer between the vertex and fragment shader and both + shaders have to be able to write something like + \c{#if QSHADER_VIEW_COUNT >= 2}. + + \since 6.7 + */ +void QShaderBaker::setMultiViewCount(int count) +{ + d->multiViewInfo.viewCount = count >= 2 ? count : 0; +} + +/*! + \enum QShaderBaker::SpirvOption + \value GenerateFullDebugInfo Generate and store additional debug information in the SPIR-V binary. + \value StripDebugAndVarInfo Strip all debug and variable name information from the SPIR-V binary. + */ + +/*! + Sets additional \a options for the generated SPIR-V binary. + By default no flags are set. + */ +void QShaderBaker::setSpirvOptions(SpirvOptions options) +{ + d->spirvOptions = options; +} + +/*! + \enum QShaderBaker::GlslOption + \value GlslEsFragDefaultFloatPrecisionMedium Emit \c{precision mediump float;} in fragment shaders for GLSL ES. + */ + +/*! + Sets additional \a options for the generated GLSL and GLSL ES sources. + By default no flags are set. + \since 6.9 + */ +void QShaderBaker::setGlslOptions(GlslOptions options) +{ + d->glslOptions = options; +} + +#ifndef Q_OS_INTEGRITY // QTBUG-145990 +inline size_t qHash(const QShaderBaker::GeneratedShader &k, size_t seed = 0) +{ + return qHash(k.first, seed) ^ k.second.version(); +} +#endif + +std::pair QShaderBakerPrivate::compile() +{ + QSpirvCompiler::Flags flags; + if (spirvOptions.testFlag(QShaderBaker::SpirvOption::GenerateFullDebugInfo)) + flags |= QSpirvCompiler::FullDebugInfo; + + compiler.setFlags(flags); + const QByteArray spirvBin = compiler.compileToSpirv(); + if (spirvBin.isEmpty()) { + errorMessage = compiler.errorMessage(); + return {}; + } + QByteArray batchableSpirvBin; + if (stage == QShader::VertexStage && variants.contains(QShader::BatchableVertexShader)) { + compiler.setFlags(flags | QSpirvCompiler::RewriteToMakeBatchableForSG); + compiler.setSGBatchingVertexInputLocation(batchLoc); + batchableSpirvBin = compiler.compileToSpirv(); + if (batchableSpirvBin.isEmpty()) { + errorMessage = compiler.errorMessage(); + return {}; + } + } + return { spirvBin, batchableSpirvBin }; +} + +QByteArray QShaderBakerPrivate::perTargetDefines(const QShaderBaker::GeneratedShader &key) +{ + QByteArray preamble; + switch (key.first) { + case QShader::SpirvShader: + preamble += QByteArrayLiteral("\n#define QSHADER_SPIRV 1\n#define QSHADER_SPIRV_VERSION "); + preamble += QByteArray::number(key.second.version()); + preamble += QByteArrayLiteral("\n"); + break; + case QShader::GlslShader: + preamble += QByteArrayLiteral("\n#define QSHADER_GLSL 1\n#define QSHADER_GLSL_VERSION "); + preamble += QByteArray::number(key.second.version()); + if (key.second.flags().testFlag(QShaderVersion::GlslEs)) + preamble += QByteArrayLiteral("\n#define QSHADER_GLSL_ES 1"); + preamble += QByteArrayLiteral("\n"); + break; + case QShader::HlslShader: + preamble += QByteArrayLiteral("\n#define QSHADER_HLSL 1\n#define QSHADER_HLSL_VERSION "); + preamble += QByteArray::number(key.second.version()); + preamble += QByteArrayLiteral("\n"); + break; + case QShader::MslShader: + preamble += QByteArrayLiteral("\n#define QSHADER_MSL 1\n#define QSHADER_MSL_VERSION "); + preamble += QByteArray::number(key.second.version()); + preamble += QByteArrayLiteral("\n"); + break; + default: + Q_UNREACHABLE(); + } + return preamble; +} + +/*! + Runs the compilation and translation process. + + \return a QShader instance. To check if the process was successful, + call QShader::isValid(). When that indicates \c false, call + errorMessage() to retrieve the log. + + This is an expensive operation. When calling this from applications, it can + be advisable to do it on a separate thread. + + \note QShaderBaker instances are reusable: after calling bake(), the same + instance can be used with different inputs again. However, a QShaderBaker + instance should only be used on one single thread during its lifetime. + */ +QShader QShaderBaker::bake() +{ + d->errorMessage.clear(); + + if (d->source.isEmpty()) { + d->errorMessage = QLatin1String("QShaderBaker: No source specified"); + return QShader(); + } + + d->compiler.setSourceString(d->source, d->stage, d->sourceFileName); + + // Normally one entry, for QShader::SpirvShader only. However, in + // compile-per-target mode there is a separate SPIR-V binary generated for + // each target (so for each GLSL/HLSL/MSL version requested). + QHash spirv; + QHash batchableSpirv; + const auto compileSpirvAndBatchable = [this, &spirv, &batchableSpirv](const GeneratedShader &key) { + const std::pair bin = d->compile(); + if (bin.first.isEmpty()) + return false; + spirv.insert(key, bin.first); + if (!bin.second.isEmpty()) + batchableSpirv.insert(key, bin.second); + return true; + }; + + QByteArray preamble = d->preamble; + if (d->multiViewInfo.viewCount >= 2) { + if (d->stage == QShader::VertexStage) + preamble += QByteArrayLiteral("\n#extension GL_EXT_multiview : require\n"); + preamble += QByteArrayLiteral("\n#define QSHADER_VIEW_COUNT "); + preamble += QByteArray::number(d->multiViewInfo.viewCount); + preamble += QByteArrayLiteral("\n"); + } + + if (!d->perTargetEnabled) { + d->compiler.setPreamble(preamble); + if (!compileSpirvAndBatchable({ QShader::SpirvShader, {} })) + return QShader(); + } else { + // per-target compilation. the value here comes from the varying + // preamble (and so preprocessor defines) + for (GeneratedShader req: d->reqVersions) { + d->compiler.setPreamble(preamble + d->perTargetDefines(req)); + if (!compileSpirvAndBatchable(req)) + return QShader(); + } + } + + // Now spirv, and, if in use, batchableSpirv, contain at least one, + // optionally more SPIR-V binaries. + Q_ASSERT(!spirv.isEmpty() && (d->perTargetEnabled || spirv.size() == 1)); + + QShader bs; + bs.setStage(d->stage); + + QSpirvShader spirvShader; + QSpirvShader batchableSpirvShader; + // The QShaderDescription can be different for variants (we just have a + // hardcoded rule to pick one), but cannot differ for targets (in + // per-target mode, hence we can just pick the first SPIR-V binary and + // generate the reflection data based on that) + spirvShader.setSpirvBinary(spirv.constKeyValueBegin()->second, d->stage); + if (batchableSpirv.isEmpty()) { + bs.setDescription(spirvShader.shaderDescription()); + } else { + batchableSpirvShader.setSpirvBinary(batchableSpirv.constKeyValueBegin()->second, d->stage); + // prefer the batchable's reflection info with _qt_order and such present + bs.setDescription(batchableSpirvShader.shaderDescription()); + } + + for (const GeneratedShader &req: d->reqVersions) { + for (const QShader::Variant &v : d->variants) { + if (d->stage != QShader::VertexStage) { + if (v == QShader::BatchableVertexShader + || v == QShader::UInt32IndexedVertexAsComputeShader + || v == QShader::UInt16IndexedVertexAsComputeShader + || v == QShader::NonIndexedVertexAsComputeShader) + { + continue; + } + } + if (req.first != QShader::MslShader && req.first != QShader::MetalLibShader) { + if (v == QShader::UInt32IndexedVertexAsComputeShader + || v == QShader::UInt16IndexedVertexAsComputeShader + || v == QShader::NonIndexedVertexAsComputeShader) + { + continue; + } + } + + QSpirvShader *currentSpirvShader = nullptr; + if (d->perTargetEnabled) { + // This is expensive too, in addition to the multiple + // compilation rounds, but opting in to per-target mode is a + // careful, conscious choice (hopefully), so it's fine. + if (v == QShader::BatchableVertexShader) + batchableSpirvShader.setSpirvBinary(batchableSpirv[req], d->stage); + else + spirvShader.setSpirvBinary(spirv[req], d->stage); + } + if (v == QShader::BatchableVertexShader) + currentSpirvShader = &batchableSpirvShader; + else + currentSpirvShader = &spirvShader; + Q_ASSERT(currentSpirvShader); + Q_ASSERT(!currentSpirvShader->spirvBinary().isEmpty()); + const QShaderKey key(req.first, req.second, v); + QShaderCode shader; + shader.setEntryPoint(QByteArrayLiteral("main")); + switch (req.first) { + case QShader::SpirvShader: + if (d->spirvOptions.testFlag(QShaderBaker::SpirvOption::StripDebugAndVarInfo)) { + QString errorMsg; + const QByteArray strippedSpirv = currentSpirvShader->remappedSpirvBinary(QSpirvShader::RemapFlag::StripOnly, &errorMsg); + if (strippedSpirv.isEmpty()) { + d->errorMessage = errorMsg; + return QShader(); + } + shader.setShader(strippedSpirv); + } else { + shader.setShader(currentSpirvShader->spirvBinary()); + } + break; + case QShader::GlslShader: + { + QSpirvShader::GlslFlags flags; + if (req.second.flags().testFlag(QShaderVersion::GlslEs)) { + flags |= QSpirvShader::GlslFlag::GlslEs; + if (d->glslOptions.testFlag(GlslOption::GlslEsFragDefaultFloatPrecisionMedium)) + flags |= QSpirvShader::GlslFlag::EsFragDefaultFloatPrecisionMedium; + } + QVector separateToCombinedImageSamplerMappings; + shader.setShader(currentSpirvShader->translateToGLSL(req.second.version(), + flags, + d->stage, + d->multiViewInfo, + &separateToCombinedImageSamplerMappings)); + if (shader.shader().isEmpty()) { + if (d->breakOnShaderTranslationError) { + d->errorMessage = currentSpirvShader->translationErrorMessage(); + return QShader(); + } else { + d->errorMessage += QLatin1String(" ") + currentSpirvShader->translationErrorMessage(); + continue; + } + } + if (!separateToCombinedImageSamplerMappings.isEmpty()) { + const QShaderDescription desc = bs.description(); + QVector separateImages = desc.separateImages(); + QVector separateSamplers = desc.separateSamplers(); + QShader::SeparateToCombinedImageSamplerMappingList result; + for (const QSpirvShader::SeparateToCombinedImageSamplerMapping &mapping : separateToCombinedImageSamplerMappings) { + int textureBinding = -1; + int samplerBinding = -1; + for (int i = 0, count = separateImages.size(); i < count; ++i) { + if (separateImages[i].name == mapping.textureName) { + textureBinding = separateImages[i].binding; + break; + } + } + for (int i = 0, count = separateSamplers.size(); i < count; ++i) { + if (separateSamplers[i].name == mapping.samplerName) { + samplerBinding = separateSamplers[i].binding; + break; + } + } + result.append({ mapping.combinedSamplerName, textureBinding, samplerBinding }); + } + bs.setSeparateToCombinedImageSamplerMappingList(key, result); + } + } + break; + case QShader::HlslShader: + { + QShader::NativeResourceBindingMap nativeBindings; + shader.setShader(currentSpirvShader->translateToHLSL(req.second.version(), &nativeBindings)); + if (shader.shader().isEmpty()) { + if (d->breakOnShaderTranslationError) { + d->errorMessage = currentSpirvShader->translationErrorMessage(); + return QShader(); + } else { + d->errorMessage += QLatin1String(" ") + currentSpirvShader->translationErrorMessage(); + continue; + } + } + bs.setResourceBindingMap(key, nativeBindings); + } + break; + case QShader::MslShader: + { + QShader::NativeResourceBindingMap nativeBindings; + QShader::NativeShaderInfo shaderInfo; + QSpirvShader::MslFlags flags; + if (d->stage == QShader::VertexStage) { + switch (v) { + case QShader::UInt16IndexedVertexAsComputeShader: + flags |= QSpirvShader::MslFlag::VertexAsCompute; + flags |= QSpirvShader::MslFlag::WithUInt16Index; + break; + case QShader::UInt32IndexedVertexAsComputeShader: + flags |= QSpirvShader::MslFlag::VertexAsCompute; + flags |= QSpirvShader::MslFlag::WithUInt32Index; + break; + case QShader::NonIndexedVertexAsComputeShader: + flags |= QSpirvShader::MslFlag::VertexAsCompute; + break; + default: + break; + } + } + shader.setShader(currentSpirvShader->translateToMSL(req.second.version(), + flags, + d->stage, + &nativeBindings, + &shaderInfo, + d->multiViewInfo, + d->tessInfo)); + if (shader.shader().isEmpty()) { + if (d->breakOnShaderTranslationError) { + d->errorMessage = currentSpirvShader->translationErrorMessage(); + return QShader(); + } else { + d->errorMessage += QLatin1String(" ") + currentSpirvShader->translationErrorMessage(); + continue; + } + } + shader.setEntryPoint(QByteArrayLiteral("main0")); + bs.setResourceBindingMap(key, nativeBindings); + bs.setNativeShaderInfo(key, shaderInfo); + } + break; + default: + Q_UNREACHABLE(); + } + bs.setShader(key, shader); + } + } + + return bs; +} + +/*! + \return the error message from the last bake() run, or an empty string if + there was no error. + + \note Errors include file read errors, compilation, and translation + failures. Not requesting any targets or variants does not count as an error + even though the resulting QShader is invalid. + */ +QString QShaderBaker::errorMessage() const +{ + return d->errorMessage; +} + +QT_END_NAMESPACE diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/qshaderbaker.h b/local/recipes/qt/qtshadertools/source/src/shadertools/qshaderbaker.h new file mode 100644 index 0000000000..1e759481d7 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/qshaderbaker.h @@ -0,0 +1,81 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant reason:default + + +#ifndef QSHADERBAKER_H +#define QSHADERBAKER_H + +// +// W A R N I N G +// ------------- +// +// This file is part of the RHI API, with limited compatibility guarantees. +// Usage of this API may make your code source and binary incompatible with +// future versions of Qt. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +struct QShaderBakerPrivate; +class QIODevice; + +class Q_SHADERTOOLS_EXPORT QShaderBaker +{ +public: + enum class SpirvOption { + GenerateFullDebugInfo = 0x01, + StripDebugAndVarInfo = 0x02 + }; + Q_DECLARE_FLAGS(SpirvOptions, SpirvOption) + + enum class GlslOption { + GlslEsFragDefaultFloatPrecisionMedium = 0x01 + }; + Q_DECLARE_FLAGS(GlslOptions, GlslOption) + + QShaderBaker(); + ~QShaderBaker(); + + void setSourceFileName(const QString &fileName); + void setSourceFileName(const QString &fileName, QShader::Stage stage); + + void setSourceDevice(QIODevice *device, QShader::Stage stage, + const QString &fileName = QString()); + + void setSourceString(const QByteArray &sourceString, QShader::Stage stage, + const QString &fileName = QString()); + + using GeneratedShader = std::pair; + void setGeneratedShaders(const QList &v); + void setGeneratedShaderVariants(const QList &v); + + void setPreamble(const QByteArray &preamble); + void setBatchableVertexShaderExtraInputLocation(int location); + void setPerTargetCompilation(bool enable); + void setBreakOnShaderTranslationError(bool enable); + void setTessellationMode(QShaderDescription::TessellationMode mode); + void setTessellationOutputVertexCount(int count); + void setMultiViewCount(int count); + + void setSpirvOptions(SpirvOptions options); + void setGlslOptions(GlslOptions options); + + QShader bake(); + + QString errorMessage() const; + +private: + Q_DISABLE_COPY(QShaderBaker) + QShaderBakerPrivate *d = nullptr; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(QShaderBaker::SpirvOptions) +Q_DECLARE_OPERATORS_FOR_FLAGS(QShaderBaker::GlslOptions) + +QT_END_NAMESPACE + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/qshaderrewriter.cpp b/local/recipes/qt/qtshadertools/source/src/shadertools/qshaderrewriter.cpp new file mode 100644 index 0000000000..9496ccd151 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/qshaderrewriter.cpp @@ -0,0 +1,200 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant reason:default + + +#include "qshaderrewriter_p.h" +#include + +QT_BEGIN_NAMESPACE + +namespace QShaderRewriter { + +struct Tokenizer { + + enum Token { + Token_Void, + Token_OpenBrace, + Token_CloseBrace, + Token_SemiColon, + Token_Identifier, + Token_Unspecified, + + Token_EOF + }; + + static const char *NAMES[]; + + void initialize(const QByteArray &input); + Token next(); + + const char *pos; + const char *identifier; +}; + +const char *Tokenizer::NAMES[] = { + "Void", + "OpenBrace", + "CloseBrace", + "SemiColon", + "Identifier", + "Unspecified", + "EOF" +}; + +void Tokenizer::initialize(const QByteArray &input) +{ + pos = input.constData(); + identifier = pos; +} + +Tokenizer::Token Tokenizer::next() +{ + while (*pos != 0) { + char c = *pos++; + switch (c) { + case 0: + return Token_EOF; + + case '/': + if (*pos == '/') { + // '//' comment + ++pos; + while (*pos != 0 && *pos != '\n') ++pos; + if (*pos != 0) ++pos; // skip the newline + + } else if (*pos == '*') { + // /* */ comment + ++pos; + while (*pos != 0 && *pos != '*' && pos[1] != '/') ++pos; + if (*pos != 0) pos += 2; + } + break; + + case '#': { + while (*pos != 0) { + if (*pos == '\n') { + ++pos; + break; + } else if (*pos == '\\') { + ++pos; + while (*pos != 0 && (*pos == ' ' || *pos == '\t')) + ++pos; + if (*pos != 0 && (*pos == '\n' || (*pos == '\r' && pos[1] == '\n'))) + pos+=2; + } else { + ++pos; + } + } + break; + } + + case ';': return Token_SemiColon; + case '{': return Token_OpenBrace; + case '}': return Token_CloseBrace; + + case ' ': + case '\n': + case '\r': break; + + case 'v': { + if (*pos == 'o' && pos[1] == 'i' && pos[2] == 'd') { + pos += 3; + return Token_Void; + } + Q_FALLTHROUGH(); + } + default: + // Identifier... + if ((c >= 'a' && c <= 'z' ) || (c >= 'A' && c <= 'Z' ) || c == '_') { + identifier = pos - 1; + while (*pos != 0 && ((*pos >= 'a' && *pos <= 'z') + || (*pos >= 'A' && *pos <= 'Z') + || *pos == '_' + || (*pos >= '0' && *pos <= '9'))) { + ++pos; + } + return Token_Identifier; + } else { + return Token_Unspecified; + } + } + } + + return Token_EOF; +} + +void debugTokenizer(const QByteArray &input) +{ + Tokenizer tok; + tok.initialize(input); + Tokenizer::Token t = tok.next(); + while (t != Tokenizer::Token_EOF) { + if (t == Tokenizer::Token_Identifier) + qDebug() << Tokenizer::NAMES[t] << QByteArray::fromRawData(tok.identifier, tok.pos - tok.identifier); + else + qDebug() << Tokenizer::NAMES[t]; + + t = tok.next(); + } +} + +QByteArray addZAdjustment(const QByteArray &input, int vertexInputLocation) +{ + Tokenizer tok; + tok.initialize(input); + + Tokenizer::Token lt = tok.next(); + Tokenizer::Token t = tok.next(); + + // First find "void main() { ... " + const char* voidPos = input.constData(); + while (t != Tokenizer::Token_EOF) { + if (lt == Tokenizer::Token_Void && t == Tokenizer::Token_Identifier) { + if (qstrncmp("main", tok.identifier, 4) == 0) + break; + } + voidPos = tok.pos - 4; + lt = t; + t = tok.next(); + } + + QByteArray result; + result.reserve(1024); + result += QByteArray::fromRawData(input.constData(), voidPos - input.constData()); + + result += QByteArrayLiteral("layout(location = "); + result += QByteArray::number(vertexInputLocation); + result += QByteArrayLiteral(") in float _qt_order;\n"); + + // Find first brace '{' + while (t != Tokenizer::Token_EOF && t != Tokenizer::Token_OpenBrace) t = tok.next(); + int braceDepth = 1; + t = tok.next(); + + // Find matching brace and insert our code there... + while (t != Tokenizer::Token_EOF) { + switch (t) { + case Tokenizer::Token_CloseBrace: + braceDepth--; + if (braceDepth == 0) { + result += QByteArray::fromRawData(voidPos, tok.pos - 1 - voidPos); + result += QByteArrayLiteral(" gl_Position.z = _qt_order * gl_Position.w;\n"); + result += QByteArray(tok.pos - 1); + return result; + } + break; + case Tokenizer::Token_OpenBrace: + ++braceDepth; + break; + default: + break; + } + t = tok.next(); + } + return QByteArray(); +} + +} // namespace + +QT_END_NAMESPACE diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/qshaderrewriter_p.h b/local/recipes/qt/qtshadertools/source/src/shadertools/qshaderrewriter_p.h new file mode 100644 index 0000000000..8038f7911c --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/qshaderrewriter_p.h @@ -0,0 +1,32 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant reason:default + + +#ifndef QSHADERREWRITER_P_H +#define QSHADERREWRITER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of a number of Qt sources files. This header file may change from +// version to version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +namespace QShaderRewriter { +void debugTokenizer(const QByteArray &input); +QByteArray addZAdjustment(const QByteArray &input, int vertexInputLocation); +} + +QT_END_NAMESPACE + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/qspirvcompiler.cpp b/local/recipes/qt/qtshadertools/source/src/shadertools/qspirvcompiler.cpp new file mode 100644 index 0000000000..c7d52c5581 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/qspirvcompiler.cpp @@ -0,0 +1,289 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant reason:default + + +#include "qspirvcompiler_p.h" +#include "qshaderrewriter_p.h" +#include +#include + +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-override") +#include +#include +#include +QT_WARNING_POP + +//#define TOKENIZER_DEBUG + +QT_BEGIN_NAMESPACE + +struct QSpirvCompilerPrivate +{ + bool readFile(const QString &fn); + bool compile(); + + QString sourceFileName; + QByteArray source; + QByteArray batchableSource; + EShLanguage stage = EShLangVertex; + QSpirvCompiler::Flags flags; + QByteArray preamble; + int batchAttrLoc = 7; + QByteArray spirv; + QString log; +}; + +bool QSpirvCompilerPrivate::readFile(const QString &fn) +{ + QFile f(fn); + if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) { + qWarning("QSpirvCompiler: Failed to open %s", qPrintable(fn)); + return false; + } + source = f.readAll(); + batchableSource.clear(); + sourceFileName = fn; + f.close(); + return true; +} + +using namespace QtShaderTools; + +class Includer : public glslang::TShader::Includer +{ +public: + IncludeResult *includeLocal(const char *headerName, + const char *includerName, + size_t inclusionDepth) override + { + Q_UNUSED(inclusionDepth); + return readFile(headerName, includerName); + } + + IncludeResult *includeSystem(const char *headerName, + const char *includerName, + size_t inclusionDepth) override + { + Q_UNUSED(inclusionDepth); + return readFile(headerName, includerName); + } + + void releaseInclude(IncludeResult *result) override + { + if (result) { + delete static_cast(result->userData); + delete result; + } + } + +private: + IncludeResult *readFile(const char *headerName, const char *includerName); +}; + +glslang::TShader::Includer::IncludeResult *Includer::readFile(const char *headerName, const char *includerName) +{ + // Just treat the included name as relative to the includer: + // Take the path from the includer, append the included name, remove redundancies. + // This should work also for qrc (source filenames with qrc:/ or :/ prefix). + + QString includer = QString::fromUtf8(includerName); + if (includer.isEmpty()) + includer = QLatin1String("."); + QString included = QFileInfo(includer).canonicalPath() + QLatin1Char('/') + QString::fromUtf8(headerName); + included = QFileInfo(included).canonicalFilePath(); + if (included.isEmpty()) { + qWarning("QSpirvCompiler: Failed to find include file %s", headerName); + return nullptr; + } + QFile f(included); + if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) { + qWarning("QSpirvCompiler: Failed to read include file %s", qPrintable(included)); + return nullptr; + } + + QByteArray *data = new QByteArray; + *data = f.readAll(); + return new IncludeResult(included.toStdString(), data->constData(), data->size(), data); +} + +class GlobalInit +{ +public: + GlobalInit() { glslang::InitializeProcess(); } + ~GlobalInit() { glslang::FinalizeProcess(); } +}; + +bool QSpirvCompilerPrivate::compile() +{ + log.clear(); + + const bool useBatchable = (stage == EShLangVertex && flags.testFlag(QSpirvCompiler::RewriteToMakeBatchableForSG)); + const QByteArray *actualSource = useBatchable ? &batchableSource : &source; + if (actualSource->isEmpty()) + return false; + + static GlobalInit globalInit; + + glslang::TShader shader(stage); + const QByteArray fn = sourceFileName.toUtf8(); + const char *fnStr = fn.constData(); + const char *srcStr = actualSource->constData(); + const int size = actualSource->size(); + shader.setStringsWithLengthsAndNames(&srcStr, &size, &fnStr, 1); + if (!preamble.isEmpty()) { + // Line numbers in errors and #version are not affected by having a + // preamble, which is just what we need. + shader.setPreamble(preamble.constData()); + } + + shader.setEnvInput(glslang::EShSourceGlsl, stage, glslang::EShClientVulkan, 100); + shader.setEnvClient(glslang::EShClientVulkan, glslang::EShTargetVulkan_1_0); + shader.setEnvTarget(glslang::EshTargetSpv, glslang::EShTargetSpv_1_0); + + int messages = EShMsgDefault; + if (flags.testFlag(QSpirvCompiler::FullDebugInfo)) // embed source + messages |= EShMsgDebugInfo; + + Includer includer; + if (!shader.parse(QtShaderTools::GetDefaultResources(), 100, false, EShMessages(messages), includer)) { + qWarning("QSpirvCompiler: Failed to parse shader"); + log = QString::fromUtf8(shader.getInfoLog()).trimmed(); + return false; + } + + glslang::TProgram program; + program.addShader(&shader); + if (!program.link(EShMsgDefault)) { + qWarning("QSpirvCompiler: Link failed"); + log = QString::fromUtf8(shader.getInfoLog()).trimmed(); + return false; + } + + // The only interesting option here is the debug info, optimizations and + // such do not happen at this level. + glslang::SpvOptions options; + options.generateDebugInfo = flags.testFlag(QSpirvCompiler::FullDebugInfo); + + std::vector spv; + glslang::GlslangToSpv(*program.getIntermediate(stage), spv, &options); + if (!spv.size()) { + qWarning("Failed to generate SPIR-V"); + return false; + } + + spirv.resize(int(spv.size() * 4)); + memcpy(spirv.data(), spv.data(), spirv.size()); + + return true; +} + +QSpirvCompiler::QSpirvCompiler() + : d(new QSpirvCompilerPrivate) +{ +} + +QSpirvCompiler::~QSpirvCompiler() +{ + delete d; +} + +void QSpirvCompiler::setSourceFileName(const QString &fileName) +{ + if (!d->readFile(fileName)) + return; + + const QString suffix = QFileInfo(fileName).suffix(); + if (suffix == QStringLiteral("vert")) { + d->stage = EShLangVertex; + } else if (suffix == QStringLiteral("frag")) { + d->stage = EShLangFragment; + } else if (suffix == QStringLiteral("tesc")) { + d->stage = EShLangTessControl; + } else if (suffix == QStringLiteral("tese")) { + d->stage = EShLangTessEvaluation; + } else if (suffix == QStringLiteral("geom")) { + d->stage = EShLangGeometry; + } else if (suffix == QStringLiteral("comp")) { + d->stage = EShLangCompute; + } else { + qWarning("QSpirvCompiler: Unknown shader stage, defaulting to vertex"); + d->stage = EShLangVertex; + } +} + +static inline EShLanguage mapShaderStage(QShader::Stage stage) +{ + switch (stage) { + case QShader::VertexStage: + return EShLangVertex; + case QShader::TessellationControlStage: + return EShLangTessControl; + case QShader::TessellationEvaluationStage: + return EShLangTessEvaluation; + case QShader::GeometryStage: + return EShLangGeometry; + case QShader::FragmentStage: + return EShLangFragment; + case QShader::ComputeStage: + return EShLangCompute; + default: + return EShLangVertex; + } +} + +void QSpirvCompiler::setSourceFileName(const QString &fileName, QShader::Stage stage) +{ + if (!d->readFile(fileName)) + return; + + d->stage = mapShaderStage(stage); +} + +void QSpirvCompiler::setSourceDevice(QIODevice *device, QShader::Stage stage, const QString &fileName) +{ + setSourceString(device->readAll(), stage, fileName); +} + +void QSpirvCompiler::setSourceString(const QByteArray &sourceString, QShader::Stage stage, const QString &fileName) +{ + d->sourceFileName = fileName; // for error messages, include handling, etc. + d->source = sourceString; + d->batchableSource.clear(); + d->stage = mapShaderStage(stage); +} + +void QSpirvCompiler::setFlags(Flags flags) +{ + d->flags = flags; +} + +void QSpirvCompiler::setPreamble(const QByteArray &preamble) +{ + d->preamble = preamble; +} + +void QSpirvCompiler::setSGBatchingVertexInputLocation(int location) +{ + d->batchAttrLoc = location; +} + +QByteArray QSpirvCompiler::compileToSpirv() +{ +#ifdef TOKENIZER_DEBUG + QShaderRewriter::debugTokenizer(d->source); +#endif + + if (d->stage == EShLangVertex && d->flags.testFlag(RewriteToMakeBatchableForSG) && d->batchableSource.isEmpty()) + d->batchableSource = QShaderRewriter::addZAdjustment(d->source, d->batchAttrLoc); + + return d->compile() ? d->spirv : QByteArray(); +} + +QString QSpirvCompiler::errorMessage() const +{ + return d->log; +} + +QT_END_NAMESPACE diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/qspirvcompiler_p.h b/local/recipes/qt/qtshadertools/source/src/shadertools/qspirvcompiler_p.h new file mode 100644 index 0000000000..9772f993cf --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/qspirvcompiler_p.h @@ -0,0 +1,61 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant reason:default + + +#ifndef QSPIRVCOMPILER_P_H +#define QSPIRVCOMPILER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of a number of Qt sources files. This header file may change from +// version to version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +struct QSpirvCompilerPrivate; +class QIODevice; + +class Q_SHADERTOOLS_EXPORT QSpirvCompiler +{ +public: + QSpirvCompiler(); + ~QSpirvCompiler(); + + enum Flag { + RewriteToMakeBatchableForSG = 0x01, + FullDebugInfo = 0x02 + }; + Q_DECLARE_FLAGS(Flags, Flag) + + void setSourceFileName(const QString &fileName); + void setSourceFileName(const QString &fileName, QShader::Stage stage); + void setSourceDevice(QIODevice *device, QShader::Stage stage, const QString &fileName = QString()); + void setSourceString(const QByteArray &sourceString, QShader::Stage stage, const QString &fileName = QString()); + void setFlags(Flags flags); + void setPreamble(const QByteArray &preamble); + void setSGBatchingVertexInputLocation(int location); + + QByteArray compileToSpirv(); + QString errorMessage() const; + +private: + Q_DISABLE_COPY(QSpirvCompiler) + QSpirvCompilerPrivate *d = nullptr; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(QSpirvCompiler::Flags) + +QT_END_NAMESPACE + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/qspirvshader.cpp b/local/recipes/qt/qtshadertools/source/src/shadertools/qspirvshader.cpp new file mode 100644 index 0000000000..49f14c707a --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/qspirvshader.cpp @@ -0,0 +1,1091 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant reason:default + + +#include "qspirvshader_p.h" +#include "qspirvshaderremap_p.h" +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +struct QSpirvShaderPrivate +{ + ~QSpirvShaderPrivate(); + + void createCompiler(spvc_backend backend); + void reflect(); + + QShaderDescription::InOutVariable inOutVar(const spvc_reflected_resource &r); + QShaderDescription::BlockVariable blockVar(spvc_type_id typeId, uint32_t memberIdx); + + QShader::Stage stage; + QByteArray ir; + QShaderDescription shaderDescription; + + spvc_context ctx = nullptr; + spvc_compiler glslGen = nullptr; + spvc_compiler hlslGen = nullptr; + spvc_compiler mslGen = nullptr; + + QString spirvCrossErrorMsg; +}; + +QSpirvShaderPrivate::~QSpirvShaderPrivate() +{ + spvc_context_destroy(ctx); +} + +void QSpirvShaderPrivate::createCompiler(spvc_backend backend) +{ + if (!ctx) { + if (spvc_context_create(&ctx) != SPVC_SUCCESS) { + qWarning("Failed to create SPIRV-Cross context"); + return; + } + } + + const SpvId *spirv = reinterpret_cast(ir.constData()); + size_t wordCount = size_t(ir.size()) / sizeof(SpvId); + spvc_parsed_ir parsedIr; + if (spvc_context_parse_spirv(ctx, spirv, wordCount, &parsedIr) != SPVC_SUCCESS) { + qWarning("Failed to parse SPIR-V: %s", spvc_context_get_last_error_string(ctx)); + return; + } + + spvc_compiler *outCompiler = nullptr; + switch (backend) { + case SPVC_BACKEND_GLSL: + outCompiler = &glslGen; + break; + case SPVC_BACKEND_HLSL: + outCompiler = &hlslGen; + break; + case SPVC_BACKEND_MSL: + outCompiler = &mslGen; + break; + default: + return; + } + + if (spvc_context_create_compiler(ctx, backend, parsedIr, + SPVC_CAPTURE_MODE_TAKE_OWNERSHIP, outCompiler) != SPVC_SUCCESS) + { + qWarning("Failed to create SPIRV-Cross compiler: %s", spvc_context_get_last_error_string(ctx)); + return; + } +} + +static QShaderDescription::VariableType matVarType(const spvc_type &t, QShaderDescription::VariableType compType) +{ + const unsigned vecsize = spvc_type_get_vector_size(t); + switch (spvc_type_get_columns(t)) { + case 2: + return QShaderDescription::VariableType(compType + 4 + (vecsize == 3 ? 1 : vecsize == 4 ? 2 : 0)); + case 3: + return QShaderDescription::VariableType(compType + 7 + (vecsize == 2 ? 1 : vecsize == 4 ? 2 : 0)); + case 4: + return QShaderDescription::VariableType(compType + 10 + (vecsize == 2 ? 1 : vecsize == 3 ? 2 : 0)); + default: + return QShaderDescription::Unknown; + } +} + +static QShaderDescription::VariableType vecVarType(const spvc_type &t, QShaderDescription::VariableType compType) +{ + switch (spvc_type_get_vector_size(t)) { + case 1: + return compType; + case 2: + return QShaderDescription::VariableType(compType + 1); + case 3: + return QShaderDescription::VariableType(compType + 2); + case 4: + return QShaderDescription::VariableType(compType + 3); + default: + return QShaderDescription::Unknown; + } +} + +static QShaderDescription::VariableType sampledImageVarType(const spvc_type &t) +{ + switch (spvc_type_get_image_dimension(t)) { + case SpvDim1D: + return spvc_type_get_image_arrayed(t) ? QShaderDescription::Sampler1DArray + : QShaderDescription::Sampler1D; + case SpvDim2D: + return spvc_type_get_image_arrayed(t) + ? (spvc_type_get_image_multisampled(t) ? QShaderDescription::Sampler2DMSArray + : QShaderDescription::Sampler2DArray) + : (spvc_type_get_image_multisampled(t) ? QShaderDescription::Sampler2DMS + : QShaderDescription::Sampler2D); + case SpvDim3D: + return spvc_type_get_image_arrayed(t) ? QShaderDescription::Sampler3DArray + : QShaderDescription::Sampler3D; + case SpvDimCube: + return spvc_type_get_image_arrayed(t) ? QShaderDescription::SamplerCubeArray + : QShaderDescription::SamplerCube; + case SpvDimRect: + return QShaderDescription::SamplerRect; + case SpvDimBuffer: + return QShaderDescription::SamplerBuffer; + default: + return QShaderDescription::Unknown; + } +} + +static QShaderDescription::VariableType imageVarType(const spvc_type &t) +{ + switch (spvc_type_get_image_dimension(t)) { + case SpvDim1D: + return spvc_type_get_image_arrayed(t) ? QShaderDescription::Image1DArray + : QShaderDescription::Image1D; + case SpvDim2D: + return spvc_type_get_image_arrayed(t) + ? (spvc_type_get_image_multisampled(t) ? QShaderDescription::Image2DMSArray + : QShaderDescription::Image2DArray) + : (spvc_type_get_image_multisampled(t) ? QShaderDescription::Image2DMS + : QShaderDescription::Image2D); + case SpvDim3D: + return spvc_type_get_image_arrayed(t) ? QShaderDescription::Image3DArray + : QShaderDescription::Image3D; + case SpvDimCube: + return spvc_type_get_image_arrayed(t) ? QShaderDescription::ImageCubeArray + : QShaderDescription::ImageCube; + case SpvDimRect: + return QShaderDescription::ImageRect; + case SpvDimBuffer: + return QShaderDescription::ImageBuffer; + default: + return QShaderDescription::Unknown; + } +} + +static QShaderDescription::VariableType varType(const spvc_type &t) +{ + QShaderDescription::VariableType vt = QShaderDescription::Unknown; + const spvc_basetype basetype = spvc_type_get_basetype(t); + switch (basetype) { + case SPVC_BASETYPE_FP32: + vt = spvc_type_get_columns(t) > 1 ? matVarType(t, QShaderDescription::Float) + : vecVarType(t, QShaderDescription::Float); + break; + case SPVC_BASETYPE_FP64: + vt = spvc_type_get_columns(t) > 1 ? matVarType(t, QShaderDescription::Double) + : vecVarType(t, QShaderDescription::Double); + break; + case SPVC_BASETYPE_UINT32: + vt = vecVarType(t, QShaderDescription::Uint); + break; + case SPVC_BASETYPE_INT32: + vt = vecVarType(t, QShaderDescription::Int); + break; + case SPVC_BASETYPE_BOOLEAN: + vt = vecVarType(t, QShaderDescription::Uint); + break; + case SPVC_BASETYPE_SAMPLED_IMAGE: + vt = sampledImageVarType(t); + break; + case SPVC_BASETYPE_IMAGE: + vt = imageVarType(t); + break; + case SPVC_BASETYPE_SAMPLER: + vt = QShaderDescription::Sampler; + break; + case SPVC_BASETYPE_STRUCT: + vt = QShaderDescription::Struct; + break; + default: + // can encounter types we do not (yet) handle, return Unknown for those + qWarning("Unsupported base type %d", basetype); + break; + } + return vt; +} + +QShaderDescription::InOutVariable QSpirvShaderPrivate::inOutVar(const spvc_reflected_resource &r) +{ + QShaderDescription::InOutVariable v; + v.name = r.name; + + spvc_type baseTypeHandle = spvc_compiler_get_type_handle(glslGen, r.base_type_id); + v.type = varType(baseTypeHandle); + + spvc_type typeHandle = spvc_compiler_get_type_handle(glslGen, r.type_id); + for (unsigned i = 0, dimCount = spvc_type_get_num_array_dimensions(typeHandle); i < dimCount; ++i) + v.arrayDims.append(int(spvc_type_get_array_dimension(typeHandle, i))); + + if (spvc_compiler_has_decoration(glslGen, r.id, SpvDecorationLocation)) + v.location = spvc_compiler_get_decoration(glslGen, r.id, SpvDecorationLocation); + + if (spvc_compiler_has_decoration(glslGen, r.id, SpvDecorationBinding)) + v.binding = spvc_compiler_get_decoration(glslGen, r.id, SpvDecorationBinding); + + if (spvc_compiler_has_decoration(glslGen, r.id, SpvDecorationDescriptorSet)) + v.descriptorSet = spvc_compiler_get_decoration(glslGen, r.id, SpvDecorationDescriptorSet); + + if (spvc_compiler_has_decoration(glslGen, r.id, SpvDecorationPatch)) + v.perPatch = spvc_compiler_get_decoration(glslGen, r.id, SpvDecorationPatch); + + if (spvc_type_get_basetype(baseTypeHandle) == SPVC_BASETYPE_IMAGE) { + v.imageFormat = QShaderDescription::ImageFormat(spvc_type_get_image_storage_format(baseTypeHandle)); + + v.imageFlags.setFlag(QShaderDescription::ImageFlag::WriteOnlyImage, + spvc_compiler_has_decoration(glslGen, r.id, SpvDecorationNonReadable)); + + v.imageFlags.setFlag(QShaderDescription::ImageFlag::ReadOnlyImage, + spvc_compiler_has_decoration(glslGen, r.id, SpvDecorationNonWritable)); + } + + if (v.type == QShaderDescription::Struct) { + const unsigned count = spvc_type_get_num_member_types(baseTypeHandle); + const spvc_type_id id = spvc_type_get_base_type_id(baseTypeHandle); + + for (unsigned idx = 0; idx < count; ++idx) { + v.structMembers.append(blockVar(id, idx)); + v.perPatch |= bool(spvc_compiler_has_member_decoration(glslGen, id, idx, SpvDecorationPatch)); + } + } + + return v; +} + +QShaderDescription::BlockVariable QSpirvShaderPrivate::blockVar(spvc_type_id typeId, uint32_t memberIdx) +{ + QShaderDescription::BlockVariable v; + v.name = spvc_compiler_get_member_name(glslGen, typeId, memberIdx); + + spvc_type t = spvc_compiler_get_type_handle(glslGen, typeId); + spvc_type_id memberTypeId = spvc_type_get_member_type(t, memberIdx); + spvc_type memberType = spvc_compiler_get_type_handle(glslGen, memberTypeId); + v.type = varType(memberType); + v.offset = -1; + + unsigned offset = 0; + if (spvc_compiler_type_struct_member_offset(glslGen, t, memberIdx, &offset) == SPVC_SUCCESS) + v.offset = int(offset); + + size_t size = 0; + if (spvc_compiler_get_declared_struct_member_size(glslGen, t, memberIdx, &size) == SPVC_SUCCESS) + v.size = int(size); + + for (unsigned i = 0, dimCount = spvc_type_get_num_array_dimensions(memberType); i < dimCount; ++i) + v.arrayDims.append(int(spvc_type_get_array_dimension(memberType, i))); + + if (spvc_compiler_has_member_decoration(glslGen, typeId, memberIdx, SpvDecorationArrayStride)) { + unsigned stride = 0; + if (spvc_compiler_type_struct_member_array_stride(glslGen, t, memberIdx, &stride) == SPVC_SUCCESS) + v.arrayStride = int(stride); + } + + if (spvc_compiler_has_member_decoration(glslGen, typeId, memberIdx, SpvDecorationMatrixStride)) { + unsigned stride = 0; + if (spvc_compiler_type_struct_member_matrix_stride(glslGen, t, memberIdx, &stride) == SPVC_SUCCESS) + v.matrixStride = int(stride); + } + + if (spvc_compiler_has_member_decoration(glslGen, typeId, memberIdx, SpvDecorationRowMajor)) + v.matrixIsRowMajor = true; + + if (v.type == QShaderDescription::Struct) { + unsigned count = spvc_type_get_num_member_types(memberType); + for (unsigned idx = 0; idx < count; ++idx) + v.structMembers.append(blockVar(spvc_type_get_base_type_id(memberType), idx)); + } + + return v; +} + +void QSpirvShaderPrivate::reflect() +{ + if (!glslGen) + return; + + shaderDescription = QShaderDescription(); + QShaderDescriptionPrivate *dd = QShaderDescriptionPrivate::get(&shaderDescription); + + dd->localSize[0] = spvc_compiler_get_execution_mode_argument_by_index(glslGen, SpvExecutionModeLocalSize, 0); + dd->localSize[1] = spvc_compiler_get_execution_mode_argument_by_index(glslGen, SpvExecutionModeLocalSize, 1); + dd->localSize[2] = spvc_compiler_get_execution_mode_argument_by_index(glslGen, SpvExecutionModeLocalSize, 2); + + dd->tessOutVertCount = spvc_compiler_get_execution_mode_argument(glslGen, SpvExecutionModeOutputVertices); + dd->tessMode = QShaderDescription::UnknownTessellationMode; + dd->tessWind = QShaderDescription::UnknownTessellationWindingOrder; + dd->tessPart = QShaderDescription::UnknownTessellationPartitioning; + + const SpvExecutionMode *execModes = nullptr; + size_t execModeCount = 0; + if (spvc_compiler_get_execution_modes(glslGen, &execModes, &execModeCount) != SPVC_SUCCESS) { + qWarning("Failed to get shader execution modes: %s", spvc_context_get_last_error_string(ctx)); + return; + } + for (size_t i = 0; i < execModeCount; ++i) { + switch (execModes[i]) { + case SpvExecutionModeTriangles: + dd->tessMode = QShaderDescription::TrianglesTessellationMode; + break; + case SpvExecutionModeQuads: + dd->tessMode = QShaderDescription::QuadTessellationMode; + break; + case SpvExecutionModeIsolines: + qWarning("Isoline execution mode used for tessellation," + " this is not portable and may not work as expected."); + dd->tessMode = QShaderDescription::IsolineTessellationMode; + break; + case SpvExecutionModeSpacingEqual: + dd->tessPart = QShaderDescription::EqualTessellationPartitioning; + break; + case SpvExecutionModeSpacingFractionalEven: + dd->tessPart = QShaderDescription::FractionalEvenTessellationPartitioning; + break; + case SpvExecutionModeSpacingFractionalOdd: + dd->tessPart = QShaderDescription::FractionalOddTessellationPartitioning; + break; + case SpvExecutionModeVertexOrderCw: + dd->tessWind = QShaderDescription::CwTessellationWindingOrder; + break; + case SpvExecutionModeVertexOrderCcw : + dd->tessWind = QShaderDescription::CcwTessellationWindingOrder; + break; + default: + break; + } + } + + // For builtin inputs/outputs (think of things like gl_Position (or + // gl_out[].gl_Position), gl_InvocationID, gl_TessLevelOuter, etc.) we only + // want the ones that are active (really read or written). + spvc_compiler_update_active_builtins(glslGen); + + spvc_resources resources; + if (spvc_compiler_create_shader_resources(glslGen, &resources) != SPVC_SUCCESS) { + qWarning("Failed to get shader resources: %s", spvc_context_get_last_error_string(ctx)); + return; + } + + const spvc_reflected_resource *resourceList = nullptr; + const spvc_reflected_builtin_resource *builtinResourceList = nullptr; + size_t resourceListCount = 0; + + if (spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_STAGE_INPUT, + &resourceList, &resourceListCount) == SPVC_SUCCESS) + { + for (size_t i = 0; i < resourceListCount; ++i) { + const QShaderDescription::InOutVariable v = inOutVar(resourceList[i]); + if (v.type != QShaderDescription::Unknown) + dd->inVars.append(v); + } + } + + if (spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_STAGE_OUTPUT, + &resourceList, &resourceListCount) == SPVC_SUCCESS) + { + for (size_t i = 0; i < resourceListCount; ++i) { + const QShaderDescription::InOutVariable v = inOutVar(resourceList[i]); + if (v.type != QShaderDescription::Unknown) + dd->outVars.append(v); + } + } + + if (spvc_resources_get_builtin_resource_list_for_type(resources, SPVC_BUILTIN_RESOURCE_TYPE_STAGE_INPUT, + &builtinResourceList, &resourceListCount) == SPVC_SUCCESS) + { + for (size_t i = 0; i < resourceListCount; ++i) { + if (spvc_compiler_has_active_builtin(glslGen, builtinResourceList[i].builtin, SpvStorageClassInput)) { + QShaderDescription::BuiltinVariable v; + v.type = QShaderDescription::BuiltinType(builtinResourceList[i].builtin); + + spvc_type type = spvc_compiler_get_type_handle( + glslGen, builtinResourceList[i].value_type_id); + v.varType = varType(type); + + for (unsigned i = 0, dimCount = spvc_type_get_num_array_dimensions(type); + i < dimCount; ++i) + v.arrayDims.append(int(spvc_type_get_array_dimension(type, i))); + + dd->inBuiltins.append(v); + } + } + std::sort(dd->inBuiltins.begin(), dd->inBuiltins.end(), + [](const QShaderDescription::BuiltinVariable &a, const QShaderDescription::BuiltinVariable &b) + { + return a.type < b.type; + }); + } + + if (spvc_resources_get_builtin_resource_list_for_type(resources, SPVC_BUILTIN_RESOURCE_TYPE_STAGE_OUTPUT, + &builtinResourceList, &resourceListCount) == SPVC_SUCCESS) + { + for (size_t i = 0; i < resourceListCount; ++i) { + if (spvc_compiler_has_active_builtin(glslGen, builtinResourceList[i].builtin, SpvStorageClassOutput)) { + QShaderDescription::BuiltinVariable v; + v.type = QShaderDescription::BuiltinType(builtinResourceList[i].builtin); + + spvc_type type = spvc_compiler_get_type_handle( + glslGen, builtinResourceList[i].value_type_id); + v.varType = varType(type); + + for (unsigned i = 0, dimCount = spvc_type_get_num_array_dimensions(type); + i < dimCount; ++i) + v.arrayDims.append(int(spvc_type_get_array_dimension(type, i))); + + dd->outBuiltins.append(v); + } + } + std::sort(dd->outBuiltins.begin(), dd->outBuiltins.end(), + [](const QShaderDescription::BuiltinVariable &a, const QShaderDescription::BuiltinVariable &b) + { + return a.type < b.type; + }); + } + + // uniform blocks map to either a uniform buffer or a plain struct + if (spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_UNIFORM_BUFFER, + &resourceList, &resourceListCount) == SPVC_SUCCESS) + { + for (size_t i = 0; i < resourceListCount; ++i) { + const spvc_reflected_resource &r(resourceList[i]); + spvc_type t = spvc_compiler_get_type_handle(glslGen, r.base_type_id); + QShaderDescription::UniformBlock block; + block.blockName = r.name; + + // the simple case: + // layout(...) uniform blk { T v; } inst; + // gives us blockName "blk" and structName "inst" because + // in GLSL without uniform blocks this ends up being + // struct blk { T v; }; uniform blk inst; + // or, where real UBs are used, for instance Metal: + // struct blk { T v; }; constant blk& inst [[buffer(N)]] + block.structName = spvc_compiler_get_name(glslGen, r.id); + + // the annoying case: + // layout(...) uniform blk { T v; }; + // here structName is empty and the generated code (when no uniform + // blocks) uses _ID as a fallback name: + // struct blk { T v; }; uniform blk _ID; + // or, with real uniform buffers, f.ex. Metal: + // struct blk { T v; }; constant blk& _ID [[buffer(N)]] + // Let's make sure the fallback name is filled in correctly. + if (block.structName.isEmpty()) { + // The catch (matters only when uniform blocks are not used in + // the output) is that ID is per-shader and so may differ + // between shaders, meaning that having the same uniform block + // in a vertex and fragment shader will lead to each stage + // having its own set of uniforms corresponding to the ub + // members (ofc, inactive uniforms may get optimized out by the + // compiler, so the duplication then is only there for members + // used in both stages). Not much we can do about that here, + // though. The GL backend of QRhi can deal with this. + block.structName = QByteArrayLiteral("_") + QByteArray::number(r.id); + } + + size_t size = 0; + spvc_compiler_get_declared_struct_size(glslGen, t, &size); + block.size = int(size); + if (spvc_compiler_has_decoration(glslGen, r.id, SpvDecorationBinding)) + block.binding = int(spvc_compiler_get_decoration(glslGen, r.id, SpvDecorationBinding)); + if (spvc_compiler_has_decoration(glslGen, r.id, SpvDecorationDescriptorSet)) + block.descriptorSet = int(spvc_compiler_get_decoration(glslGen, r.id, SpvDecorationDescriptorSet)); + + unsigned count = spvc_type_get_num_member_types(t); + for (unsigned idx = 0; idx < count; ++idx) { + const QShaderDescription::BlockVariable v = blockVar(r.base_type_id, idx); + if (v.type != QShaderDescription::Unknown) + block.members.append(v); + } + + dd->uniformBlocks.append(block); + } + } + + // push constant blocks map to a plain GLSL struct regardless of version + if (spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_PUSH_CONSTANT, + &resourceList, &resourceListCount) == SPVC_SUCCESS) + { + for (size_t i = 0; i < resourceListCount; ++i) { + const spvc_reflected_resource &r(resourceList[i]); + spvc_type t = spvc_compiler_get_type_handle(glslGen, r.base_type_id); + QShaderDescription::PushConstantBlock block; + block.name = spvc_compiler_get_name(glslGen, r.id); + size_t size = 0; + spvc_compiler_get_declared_struct_size(glslGen, t, &size); + block.size = int(size); + unsigned count = spvc_type_get_num_member_types(t); + for (unsigned idx = 0; idx < count; ++idx) { + const QShaderDescription::BlockVariable v = blockVar(r.base_type_id, idx); + if (v.type != QShaderDescription::Unknown) + block.members.append(v); + } + dd->pushConstantBlocks.append(block); + } + } + + if (spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_STORAGE_BUFFER, + &resourceList, &resourceListCount) == SPVC_SUCCESS) + { + for (size_t i = 0; i < resourceListCount; ++i) { + const spvc_reflected_resource &r(resourceList[i]); + spvc_type t = spvc_compiler_get_type_handle(glslGen, r.base_type_id); + QShaderDescription::StorageBlock block; + block.blockName = r.name; + block.instanceName = spvc_compiler_get_name(glslGen, r.id); + size_t size = 0; + spvc_compiler_get_declared_struct_size(glslGen, t, &size); + block.knownSize = int(size); + if (spvc_compiler_has_decoration(glslGen, r.id, SpvDecorationBinding)) + block.binding = int(spvc_compiler_get_decoration(glslGen, r.id, SpvDecorationBinding)); + if (spvc_compiler_has_decoration(glslGen, r.id, SpvDecorationDescriptorSet)) + block.descriptorSet = int(spvc_compiler_get_decoration(glslGen, r.id, SpvDecorationDescriptorSet)); + size_t offset0 = 0; + spvc_compiler_get_declared_struct_size_runtime_array(glslGen, t, 0, &offset0); + size_t offset1 = 0; + spvc_compiler_get_declared_struct_size_runtime_array(glslGen, t, 1, &offset1); + block.runtimeArrayStride = int(offset1 - offset0); + const SpvDecoration *decorations; + spvc_compiler_get_buffer_block_decorations(glslGen, r.id, &decorations, &size); + for (uint i = 0; i < size; ++i) { + switch (decorations[i]) { + case SpvDecorationCoherent: + block.qualifierFlags.setFlag(QShaderDescription::QualifierCoherent); + break; + case SpvDecorationVolatile: + block.qualifierFlags.setFlag(QShaderDescription::QualifierVolatile); + break; + case SpvDecorationRestrict: + block.qualifierFlags.setFlag(QShaderDescription::QualifierRestrict); + break; + case SpvDecorationNonWritable: + block.qualifierFlags.setFlag(QShaderDescription::QualifierReadOnly); + break; + case SpvDecorationNonReadable: + block.qualifierFlags.setFlag(QShaderDescription::QualifierWriteOnly); + break; + default: + break; + } + } + unsigned count = spvc_type_get_num_member_types(t); + for (unsigned idx = 0; idx < count; ++idx) { + const QShaderDescription::BlockVariable v = blockVar(r.base_type_id, idx); + if (v.type != QShaderDescription::Unknown) + block.members.append(v); + } + dd->storageBlocks.append(block); + } + } + + if (spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_SAMPLED_IMAGE, + &resourceList, &resourceListCount) == SPVC_SUCCESS) + { + for (size_t i = 0; i < resourceListCount; ++i) { + const spvc_reflected_resource &r(resourceList[i]); + const QShaderDescription::InOutVariable v = inOutVar(r); + if (v.type != QShaderDescription::Unknown) + dd->combinedImageSamplers.append(v); + } + } + + if (spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_SEPARATE_IMAGE, + &resourceList, &resourceListCount) == SPVC_SUCCESS) + { + for (size_t i = 0; i < resourceListCount; ++i) { + const spvc_reflected_resource &r(resourceList[i]); + const QShaderDescription::InOutVariable v = inOutVar(r); + if (v.type != QShaderDescription::Unknown) + dd->separateImages.append(v); + } + } + + if (spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_SEPARATE_SAMPLERS, + &resourceList, &resourceListCount) == SPVC_SUCCESS) + { + for (size_t i = 0; i < resourceListCount; ++i) { + const spvc_reflected_resource &r(resourceList[i]); + const QShaderDescription::InOutVariable v = inOutVar(r); + if (v.type != QShaderDescription::Unknown) + dd->separateSamplers.append(v); + } + } + + if (spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_STORAGE_IMAGE, + &resourceList, &resourceListCount) == SPVC_SUCCESS) + { + for (size_t i = 0; i < resourceListCount; ++i) { + const spvc_reflected_resource &r(resourceList[i]); + const QShaderDescription::InOutVariable v = inOutVar(r); + if (v.type != QShaderDescription::Unknown) + dd->storageImages.append(v); + } + } +} + +QSpirvShader::QSpirvShader() + : d(new QSpirvShaderPrivate) +{ +} + +QSpirvShader::~QSpirvShader() +{ + delete d; +} + +void QSpirvShader::setSpirvBinary(const QByteArray &spirv, QShader::Stage stage) +{ + d->stage = stage; + d->ir = spirv; + d->createCompiler(SPVC_BACKEND_GLSL); + d->reflect(); +} + +QShaderDescription QSpirvShader::shaderDescription() const +{ + return d->shaderDescription; +} + +QByteArray QSpirvShader::spirvBinary() const +{ + return d->ir; +} + +QByteArray QSpirvShader::remappedSpirvBinary(RemapFlags flags, QString *errorMessage) const +{ + QSpirvShaderRemapper remapper; + QByteArray result = remapper.remap(d->ir, flags); + if (errorMessage) + *errorMessage = remapper.errorMessage(); + return result; +} + +QByteArray QSpirvShader::translateToGLSL(int version, + GlslFlags flags, + QShader::Stage stage, + const MultiViewInfo &multiViewInfo, + QVector *separateToCombinedImageSamplerMappings) const +{ + d->spirvCrossErrorMsg.clear(); + + d->createCompiler(SPVC_BACKEND_GLSL); + if (!d->glslGen) + return QByteArray(); + + spvc_compiler_options options = nullptr; + if (spvc_compiler_create_compiler_options(d->glslGen, &options) != SPVC_SUCCESS) + return QByteArray(); + + spvc_compiler_options_set_uint(options, SPVC_COMPILER_OPTION_GLSL_VERSION, + version); + spvc_compiler_options_set_bool(options, SPVC_COMPILER_OPTION_GLSL_ES, + flags.testFlag(GlslFlag::GlslEs)); + spvc_compiler_options_set_bool(options, SPVC_COMPILER_OPTION_FIXUP_DEPTH_CONVENTION, + flags.testFlag(GlslFlag::FixClipSpace)); + spvc_compiler_options_set_bool(options, SPVC_COMPILER_OPTION_GLSL_ES_DEFAULT_FLOAT_PRECISION_HIGHP, + !flags.testFlag(GlslFlag::EsFragDefaultFloatPrecisionMedium)); + // The gl backend of QRhi is not prepared for UBOs atm. Have a uniform (heh) + // behavior regardless of the GLSL version. + spvc_compiler_options_set_bool(options, SPVC_COMPILER_OPTION_GLSL_EMIT_UNIFORM_BUFFER_AS_PLAIN_UNIFORMS, + true); + // Do not emit binding qualifiers for samplers (and for uniform blocks, but + // those we just disabled above). + spvc_compiler_options_set_bool(options, SPVC_COMPILER_OPTION_GLSL_ENABLE_420PACK_EXTENSION, + false); + + if (stage == QShader::VertexStage && multiViewInfo.viewCount > 1) { + spvc_compiler_options_set_uint(options, SPVC_COMPILER_OPTION_GLSL_OVR_MULTIVIEW_VIEW_COUNT, + uint(multiViewInfo.viewCount)); + } + + spvc_compiler_install_compiler_options(d->glslGen, options); + + // Let's say the shader has these separate imagers and samplers: + // layout(binding = 2) uniform texture2D sepTex; + // layout(binding = 3) uniform sampler sepSampler; + // layout(binding = 4) uniform sampler sepSampler2; + // where sepTex is used with both samplers in the shader. + // For OpenGL this is mapped to "combined image samplers", i.e. the + // traditional sampler2Ds with arbitrary names: + // uniform sampler2D _39; + // uniform sampler2D _41; + // This mapping (2+3 -> "_39", 2+4 -> "_41") needs to be exposed to the caller. + if (spvc_compiler_build_combined_image_samplers(d->glslGen) != SPVC_SUCCESS) { + d->spirvCrossErrorMsg = QString::fromUtf8(spvc_context_get_last_error_string(d->ctx)); + return QByteArray(); + } + if (separateToCombinedImageSamplerMappings) { + const spvc_combined_image_sampler *combinedImageSamplerMappings = nullptr; + size_t numCombinedImageSamplerMappings = 0; + if (spvc_compiler_get_combined_image_samplers(d->glslGen, + &combinedImageSamplerMappings, + &numCombinedImageSamplerMappings) == SPVC_SUCCESS) + { + for (size_t i = 0; i < numCombinedImageSamplerMappings; ++i) { + const spvc_combined_image_sampler *mapping = &combinedImageSamplerMappings[i]; + QByteArray combinedName = spvc_compiler_get_name(d->glslGen, mapping->combined_id); + if (combinedName.isEmpty()) + combinedName = QByteArrayLiteral("_") + QByteArray::number(mapping->combined_id); + QByteArray textureName = spvc_compiler_get_name(d->glslGen, mapping->image_id); + QByteArray samplerName = spvc_compiler_get_name(d->glslGen, mapping->sampler_id); + separateToCombinedImageSamplerMappings->append({ textureName, samplerName, combinedName }); + } + } + } + + const char *result = nullptr; + if (spvc_compiler_compile(d->glslGen, &result) != SPVC_SUCCESS) { + d->spirvCrossErrorMsg = QString::fromUtf8(spvc_context_get_last_error_string(d->ctx)); + return QByteArray(); + } + + // We used to fix up the result to complement GL_ARB_shading_language_420pack + // with GL_ARB_separate_shader_objects to make Mesa happy, but the 420pack + // is never relied on now so no need to do anything here. + return result; +} + +QByteArray QSpirvShader::translateToHLSL(int version, QShader::NativeResourceBindingMap *nativeBindings) const +{ + d->spirvCrossErrorMsg.clear(); + + d->createCompiler(SPVC_BACKEND_HLSL); + if (!d->hlslGen) + return QByteArray(); + + spvc_compiler_options options = nullptr; + if (spvc_compiler_create_compiler_options(d->hlslGen, &options) != SPVC_SUCCESS) + return QByteArray(); + spvc_compiler_options_set_uint(options, SPVC_COMPILER_OPTION_HLSL_SHADER_MODEL, + version); + spvc_compiler_options_set_bool(options, SPVC_COMPILER_OPTION_HLSL_POINT_SIZE_COMPAT, + true); + spvc_compiler_options_set_bool(options, SPVC_COMPILER_OPTION_HLSL_POINT_COORD_COMPAT, + true); + spvc_compiler_options_set_bool(options, SPVC_COMPILER_OPTION_HLSL_FORCE_STORAGE_BUFFER_AS_UAV, + true); + spvc_compiler_install_compiler_options(d->hlslGen, options); + + // D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT is 16, so we cannot have combined + // image/sampler bindings above 15. Problem is, the (SPIR-V) binding + // namespace is common with uniform buffers and other resources, and so + // having many uniform buffers and samplers can push the sampler binding to + // above 15 even when there are less than 16 samplers in total. So cannot + // just rely on SPIRV-Cross setting registers t and s for + // the SRV and sampler for each combined image/sampler. Instead, we want + // t and s where slot is 0-based, with its own namespace, and + // is then exposed in the native resource binding map so QRhi can map + // between (SPIR-V) bindings and D3D sampler slots. + const SpvExecutionModel stage = spvc_compiler_get_execution_model(d->hlslGen); + int regBinding = 0; // SRVs and samplers + for (const QShaderDescription::InOutVariable &var : d->shaderDescription.combinedImageSamplers()) { + spvc_hlsl_resource_binding bindingMapping; + bindingMapping.stage = stage; // will be per-stage but we have a per-shader NativeResourceBindingMap so it's ok + bindingMapping.desc_set = var.descriptorSet; + bindingMapping.binding = var.binding; + bindingMapping.srv.register_space = 0; + bindingMapping.srv.register_binding = regBinding; // t0, t1, ... + bindingMapping.sampler.register_space = 0; + bindingMapping.sampler.register_binding = regBinding; // s0, s1, ... + spvc_compiler_hlsl_add_resource_binding(d->hlslGen, &bindingMapping); + nativeBindings->insert(var.binding, { regBinding, regBinding }); + regBinding += var.arrayDims.isEmpty() ? 1 : var.arrayDims.first(); + } + // In fact, with separate images and samplers added to the mix, the manual + // mapping specification is essential so that the HLSL nicely uses t0, t1, + // t2, ... and s0, s1, s2, ... for all the images and samplers incl. both + // combined and separate. + int firstSeparateImageReg = regBinding; + for (const QShaderDescription::InOutVariable &var : d->shaderDescription.separateImages()) { + spvc_hlsl_resource_binding bindingMapping; + bindingMapping.stage = stage; + bindingMapping.desc_set = var.descriptorSet; + bindingMapping.binding = var.binding; + bindingMapping.srv.register_space = 0; + bindingMapping.srv.register_binding = regBinding; // tN, tN+1, ..., where N is the next reg after the combined image sampler ones + spvc_compiler_hlsl_add_resource_binding(d->hlslGen, &bindingMapping); + nativeBindings->insert(var.binding, { regBinding, -1 }); + regBinding += var.arrayDims.isEmpty() ? 1 : var.arrayDims.first(); + } + regBinding = firstSeparateImageReg; + for (const QShaderDescription::InOutVariable &var : d->shaderDescription.separateSamplers()) { + spvc_hlsl_resource_binding bindingMapping; + bindingMapping.stage = stage; + bindingMapping.desc_set = var.descriptorSet; + bindingMapping.binding = var.binding; + bindingMapping.sampler.register_space = 0; + bindingMapping.sampler.register_binding = regBinding; // sN, sN+1, ..., where N is the next reg after the combined image sampler ones + spvc_compiler_hlsl_add_resource_binding(d->hlslGen, &bindingMapping); + nativeBindings->insert(var.binding, { regBinding, -1 }); + regBinding += var.arrayDims.isEmpty() ? 1 : var.arrayDims.first(); + } + + regBinding = 0; // CBVs + for (const QShaderDescription::UniformBlock &blk : d->shaderDescription.uniformBlocks()) { + spvc_hlsl_resource_binding bindingMapping; + bindingMapping.stage = stage; + bindingMapping.desc_set = blk.descriptorSet; + bindingMapping.binding = blk.binding; + bindingMapping.cbv.register_space = 0; + bindingMapping.cbv.register_binding = regBinding; // b0, b1, ... + spvc_compiler_hlsl_add_resource_binding(d->hlslGen, &bindingMapping); + nativeBindings->insert(blk.binding, { regBinding, -1 }); + regBinding += 1; + } + + // UAV registers live in the same name space as outputs, so they must be bound + // to at least outputVariables.size(). + regBinding = d->shaderDescription.outputVariables().size(); + for (const QShaderDescription::StorageBlock &blk : d->shaderDescription.storageBlocks()) { + // readonly is also mapped to UAV due to FORCE_STORAGE_BUFFER_AS_UAV. (would be an SRV by default) + spvc_hlsl_resource_binding bindingMapping; + bindingMapping.stage = stage; + bindingMapping.desc_set = blk.descriptorSet; + bindingMapping.binding = blk.binding; + bindingMapping.uav.register_space = 0; + bindingMapping.uav.register_binding = regBinding; // u0, u1, ... + spvc_compiler_hlsl_add_resource_binding(d->hlslGen, &bindingMapping); + nativeBindings->insert(blk.binding, { regBinding, -1 }); + regBinding += 1; + } + for (const QShaderDescription::InOutVariable &var : d->shaderDescription.storageImages()) { + spvc_hlsl_resource_binding bindingMapping; + bindingMapping.stage = stage; + bindingMapping.desc_set = var.descriptorSet; + bindingMapping.binding = var.binding; + bindingMapping.uav.register_space = 0; + bindingMapping.uav.register_binding = regBinding; // u0, u1, ... + spvc_compiler_hlsl_add_resource_binding(d->hlslGen, &bindingMapping); + nativeBindings->insert(var.binding, { regBinding, -1 }); + regBinding += 1; + } + + const char *result = nullptr; + if (spvc_compiler_compile(d->hlslGen, &result) != SPVC_SUCCESS) { + d->spirvCrossErrorMsg = QString::fromUtf8(spvc_context_get_last_error_string(d->ctx)); + return QByteArray(); + } + + return QByteArray(result); +} + +QByteArray QSpirvShader::translateToMSL(int version, + MslFlags flags, + QShader::Stage stage, + QShader::NativeResourceBindingMap *nativeBindings, + QShader::NativeShaderInfo *shaderInfo, + const MultiViewInfo &multiViewInfo, + const TessellationInfo &tessInfo) const +{ + d->spirvCrossErrorMsg.clear(); + + d->createCompiler(SPVC_BACKEND_MSL); + if (!d->mslGen) + return QByteArray(); + + spvc_compiler_options options = nullptr; + if (spvc_compiler_create_compiler_options(d->mslGen, &options) != SPVC_SUCCESS) + return QByteArray(); + + spvc_compiler_options_set_uint(options, SPVC_COMPILER_OPTION_MSL_VERSION, + SPVC_MAKE_MSL_VERSION(version / 10, version % 10, 0)); + + if (flags.testFlag(MslFlag::VertexAsCompute)) { + spvc_compiler_options_set_bool(options, SPVC_COMPILER_OPTION_MSL_VERTEX_FOR_TESSELLATION, 1); + spvc_compiler_options_set_bool(options, SPVC_COMPILER_OPTION_MSL_CAPTURE_OUTPUT_TO_BUFFER, 1); + spvc_compiler_options_set_bool(options, SPVC_COMPILER_OPTION_MSL_DISABLE_RASTERIZATION, 1); + + spvc_msl_index_type indexType = SPVC_MSL_INDEX_TYPE_NONE; + if (flags.testFlag(MslFlag::WithUInt16Index)) + indexType = SPVC_MSL_INDEX_TYPE_UINT16; + else if (flags.testFlag(MslFlag::WithUInt32Index)) + indexType = SPVC_MSL_INDEX_TYPE_UINT32; + spvc_compiler_options_set_uint(options, SPVC_COMPILER_OPTION_MSL_VERTEX_INDEX_TYPE, indexType); + } + + // for tessellation; matches the defaults; not sure how to query so just set them + uint spvIndicesBufferIndex = 21; + uint spvInBufferIndex = 22; + uint spvTessLevelBufferIndex = 26; + uint spvPatchOutBufferIndex = 27; + uint spvOutBufferIndex = 28; + uint spvIndirectParamsBufferIndex = 29; + + spvc_compiler_options_set_uint(options, SPVC_COMPILER_OPTION_MSL_SHADER_INDEX_BUFFER_INDEX, spvIndicesBufferIndex); + spvc_compiler_options_set_uint(options, SPVC_COMPILER_OPTION_MSL_SHADER_INPUT_BUFFER_INDEX, spvInBufferIndex); + spvc_compiler_options_set_uint(options, SPVC_COMPILER_OPTION_MSL_SHADER_TESS_FACTOR_OUTPUT_BUFFER_INDEX, spvTessLevelBufferIndex); + spvc_compiler_options_set_uint(options, SPVC_COMPILER_OPTION_MSL_SHADER_PATCH_OUTPUT_BUFFER_INDEX, spvPatchOutBufferIndex); + spvc_compiler_options_set_uint(options, SPVC_COMPILER_OPTION_MSL_SHADER_OUTPUT_BUFFER_INDEX, spvOutBufferIndex); + spvc_compiler_options_set_uint(options, SPVC_COMPILER_OPTION_MSL_INDIRECT_PARAMS_BUFFER_INDEX, spvIndirectParamsBufferIndex); + + // for buffer size buffer; matches defaults + uint spvBufferSizeBufferIndex = 25; + spvc_compiler_options_set_uint(options, SPVC_COMPILER_OPTION_MSL_BUFFER_SIZE_BUFFER_INDEX, spvBufferSizeBufferIndex); + + if (stage == QShader::TessellationControlStage) { + // required to get the kind of tess.control inputs we need + spvc_compiler_options_set_bool(options, SPVC_COMPILER_OPTION_MSL_MULTI_PATCH_WORKGROUP, 1); + + // the execution mode needs to be known (e.g. to switch between + // MTLTriangleTessellationFactorsHalf and MTLQuadTessellationFactorsHalf) + SpvExecutionMode execMode = SpvExecutionModeTriangles; + switch (tessInfo.infoForTesc.mode) { + case QShaderDescription::QuadTessellationMode: + execMode = SpvExecutionModeQuads; + break; + case QShaderDescription::IsolineTessellationMode: + d->spirvCrossErrorMsg = QLatin1String("Isoline tessellation mode is not supported with Metal"); + return QByteArray(); + default: + break; + } + spvc_compiler_set_execution_mode(d->mslGen, execMode); + } + + if (stage == QShader::TessellationEvaluationStage) + spvc_compiler_set_execution_mode_with_arguments(d->mslGen, SpvExecutionModeOutputVertices, uint(tessInfo.infoForTese.vertexCount), 0, 0); + + uint spvViewMaskBufferIndex = 24; + const bool isMultiView = stage == QShader::VertexStage && multiViewInfo.viewCount > 1; + if (isMultiView) { + spvc_compiler_options_set_bool(options, SPVC_COMPILER_OPTION_MSL_MULTIVIEW, 1); + spvc_compiler_options_set_bool(options, SPVC_COMPILER_OPTION_MSL_MULTIVIEW_LAYERED_RENDERING, 1); + spvc_compiler_options_set_uint(options, SPVC_COMPILER_OPTION_MSL_VIEW_MASK_BUFFER_INDEX, spvViewMaskBufferIndex); + } + + // leave platform set to macOS, it won't matter in practice (hopefully) + spvc_compiler_install_compiler_options(d->mslGen, options); + + const char *result = nullptr; + if (spvc_compiler_compile(d->mslGen, &result) != SPVC_SUCCESS) { + d->spirvCrossErrorMsg = QString::fromUtf8(spvc_context_get_last_error_string(d->ctx)); + return QByteArray(); + } + + if (nativeBindings) { + spvc_resources resources; + if (spvc_compiler_create_shader_resources(d->mslGen, &resources) == SPVC_SUCCESS) { + const spvc_reflected_resource *resourceList = nullptr; + size_t resourceListCount = 0; + // A nativeBinding of -1 means unused. This also fits + // *_get_automatic_resource_binding() which returns uint32_t(-1) + // when there is no binding, which can happen when the uniform + // block, sampler, etc. is not actively used in the shader. The map + // must always be complete, including a (binding -> -1) mapping for + // inactive resources as well. The second value of the pair is only + // relevant for combined image samplers, and is -1 otherwise. + if (spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_UNIFORM_BUFFER, + &resourceList, &resourceListCount) == SPVC_SUCCESS) + { + for (size_t i = 0; i < resourceListCount; ++i) { + unsigned binding = spvc_compiler_get_decoration(d->mslGen, resourceList[i].id, SpvDecorationBinding); + unsigned nativeBinding = spvc_compiler_msl_get_automatic_resource_binding(d->mslGen, resourceList[i].id); + nativeBindings->insert(int(binding), { int(nativeBinding), -1 }); + } + } + if (spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_STORAGE_BUFFER, + &resourceList, &resourceListCount) == SPVC_SUCCESS) + { + for (size_t i = 0; i < resourceListCount; ++i) { + unsigned binding = spvc_compiler_get_decoration(d->mslGen, resourceList[i].id, SpvDecorationBinding); + unsigned nativeBinding = spvc_compiler_msl_get_automatic_resource_binding(d->mslGen, resourceList[i].id); + nativeBindings->insert(int(binding), { int(nativeBinding), -1 }); + } + } + if (spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_SAMPLED_IMAGE, + &resourceList, &resourceListCount) == SPVC_SUCCESS) + { + for (size_t i = 0; i < resourceListCount; ++i) { + unsigned binding = spvc_compiler_get_decoration(d->mslGen, resourceList[i].id, SpvDecorationBinding); + unsigned nativeTextureBinding = spvc_compiler_msl_get_automatic_resource_binding(d->mslGen, resourceList[i].id); + unsigned nativeSamplerBinding = spvc_compiler_msl_get_automatic_resource_binding_secondary(d->mslGen, resourceList[i].id); + nativeBindings->insert(int(binding), { int(nativeTextureBinding), int(nativeSamplerBinding) }); + } + } + if (spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_SEPARATE_IMAGE, + &resourceList, &resourceListCount) == SPVC_SUCCESS) + { + for (size_t i = 0; i < resourceListCount; ++i) { + unsigned binding = spvc_compiler_get_decoration(d->mslGen, resourceList[i].id, SpvDecorationBinding); + unsigned nativeTextureBinding = spvc_compiler_msl_get_automatic_resource_binding(d->mslGen, resourceList[i].id); + nativeBindings->insert(int(binding), { int(nativeTextureBinding), -1 }); + } + } + if (spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_SEPARATE_SAMPLERS, + &resourceList, &resourceListCount) == SPVC_SUCCESS) + { + for (size_t i = 0; i < resourceListCount; ++i) { + unsigned binding = spvc_compiler_get_decoration(d->mslGen, resourceList[i].id, SpvDecorationBinding); + unsigned nativeSamplerBinding = spvc_compiler_msl_get_automatic_resource_binding(d->mslGen, resourceList[i].id); + nativeBindings->insert(int(binding), { int(nativeSamplerBinding), -1 }); + } + } + if (spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_SAMPLED_IMAGE, + &resourceList, &resourceListCount) == SPVC_SUCCESS) + { + for (size_t i = 0; i < resourceListCount; ++i) { + unsigned binding = spvc_compiler_get_decoration(d->mslGen, resourceList[i].id, SpvDecorationBinding); + unsigned nativeTextureBinding = spvc_compiler_msl_get_automatic_resource_binding(d->mslGen, resourceList[i].id); + unsigned nativeSamplerBinding = spvc_compiler_msl_get_automatic_resource_binding_secondary(d->mslGen, resourceList[i].id); + nativeBindings->insert(int(binding), { int(nativeTextureBinding), int(nativeSamplerBinding) }); + } + } + if (spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_STORAGE_IMAGE, + &resourceList, &resourceListCount) == SPVC_SUCCESS) + { + for (size_t i = 0; i < resourceListCount; ++i) { + unsigned binding = spvc_compiler_get_decoration(d->mslGen, resourceList[i].id, SpvDecorationBinding); + unsigned nativeBinding = spvc_compiler_msl_get_automatic_resource_binding(d->mslGen, resourceList[i].id); + nativeBindings->insert(int(binding), { int(nativeBinding), -1 }); + } + } + } + } + + if (spvc_compiler_msl_needs_swizzle_buffer(d->mslGen)) + qWarning("Translated Metal shader needs swizzle buffer, this is unexpected"); + + if (spvc_compiler_msl_needs_buffer_size_buffer(d->mslGen)) + shaderInfo->extraBufferBindings[QShaderPrivate::MslBufferSizeBufferBinding] = spvBufferSizeBufferIndex; + + if (isMultiView) + shaderInfo->extraBufferBindings[QShaderPrivate::MslMultiViewMaskBufferBinding] = spvViewMaskBufferIndex; + + // (Aim to) only store extraBufferBindings entries for things that really + // are present, because the presence of a key can already trigger certain + // behavior during rendering. (e.g. generating and exposing the + // corresponding implicit buffer) + switch (spvc_compiler_get_execution_model(d->mslGen)) { + case SpvExecutionModelVertex: + if (flags.testFlag(MslFlag::VertexAsCompute)) { + if (spvc_compiler_msl_needs_output_buffer(d->mslGen)) + shaderInfo->extraBufferBindings[QShaderPrivate::MslTessVertTescOutputBufferBinding] = spvOutBufferIndex; + if (flags.testFlag(MslFlag::WithUInt16Index) || flags.testFlag(MslFlag::WithUInt32Index)) { + // not given that this buffer is really used in the code, + // depends on e.g. the usage of gl_VertexIndex, but not sure how + // to tell that here + shaderInfo->extraBufferBindings[QShaderPrivate::MslTessVertIndicesBufferBinding] = spvIndicesBufferIndex; + } + } + break; + case SpvExecutionModelTessellationControl: + shaderInfo->extraBufferBindings[QShaderPrivate::MslTessTescInputBufferBinding] = spvInBufferIndex; + shaderInfo->extraBufferBindings[QShaderPrivate::MslTessTescTessLevelBufferBinding] = spvTessLevelBufferIndex; + shaderInfo->extraBufferBindings[QShaderPrivate::MslTessTescParamsBufferBinding] = spvIndirectParamsBufferIndex; + if (spvc_compiler_msl_needs_output_buffer(d->mslGen)) + shaderInfo->extraBufferBindings[QShaderPrivate::MslTessVertTescOutputBufferBinding] = spvOutBufferIndex; + if (spvc_compiler_msl_needs_patch_output_buffer(d->mslGen)) + shaderInfo->extraBufferBindings[QShaderPrivate::MslTessTescPatchOutputBufferBinding] = spvPatchOutBufferIndex; + break; + default: + break; + } + + return QByteArray(result); +} + +QString QSpirvShader::translationErrorMessage() const +{ + return d->spirvCrossErrorMsg; +} + +QT_END_NAMESPACE diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/qspirvshader_p.h b/local/recipes/qt/qtshadertools/source/src/shadertools/qspirvshader_p.h new file mode 100644 index 0000000000..cbae4f9d2f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/qspirvshader_p.h @@ -0,0 +1,110 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant reason:default + + +#ifndef QSPIRVSHADER_P_H +#define QSPIRVSHADER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of a number of Qt sources files. This header file may change from +// version to version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +struct QSpirvShaderPrivate; + +class Q_SHADERTOOLS_EXPORT QSpirvShader +{ +public: + enum class GlslFlag { + GlslEs = 0x01, + FixClipSpace = 0x02, + EsFragDefaultFloatPrecisionMedium = 0x04 + }; + Q_DECLARE_FLAGS(GlslFlags, GlslFlag) + + enum class MslFlag { + VertexAsCompute = 0x01, + WithUInt16Index = 0x02, + WithUInt32Index = 0x04 + }; + Q_DECLARE_FLAGS(MslFlags, MslFlag) + + enum class RemapFlag { + StripOnly = 0x01 + }; + Q_DECLARE_FLAGS(RemapFlags, RemapFlag) + + QSpirvShader(); + ~QSpirvShader(); + + void setSpirvBinary(const QByteArray &spirv, QShader::Stage stage); + + QShaderDescription shaderDescription() const; + + QByteArray spirvBinary() const; + QByteArray remappedSpirvBinary(RemapFlags flags = RemapFlags(), QString *errorMessage = nullptr) const; + + struct SeparateToCombinedImageSamplerMapping { + QByteArray textureName; + QByteArray samplerName; + QByteArray combinedSamplerName; + }; + + struct TessellationInfo { + // The tess.evaluation shader will likely declaer something like layout(triangles, fractional_odd_spacing, ccw) in; + // For Metal we need to know the tessellation mode (triangles) when generating the translated tess.control shader. + struct { + QShaderDescription::TessellationMode mode = QShaderDescription::TrianglesTessellationMode; + } infoForTesc; + // The tess.control shader will likely declare something like layout(vertices = 3) out; + // For Metal we need to know this value (3) when generating the translated tess.eval. shader. + struct { + int vertexCount = 3; + } infoForTese; + }; + + struct MultiViewInfo { + // layout(num_views = viewCount) in; see GL_OVR_multiview + int viewCount = 0; + }; + + QByteArray translateToGLSL(int version, + GlslFlags flags, + QShader::Stage stage, + const MultiViewInfo &multiViewInfo, + QVector *separateToCombinedImageSamplerMappings) const; + QByteArray translateToHLSL(int version, + QShader::NativeResourceBindingMap *nativeBindings) const; + QByteArray translateToMSL(int version, + MslFlags flags, + QShader::Stage stage, + QShader::NativeResourceBindingMap *nativeBindings, + QShader::NativeShaderInfo *shaderInfo, + const MultiViewInfo &multiViewInfo, + const TessellationInfo &tessInfo) const; + QString translationErrorMessage() const; + +private: + Q_DISABLE_COPY(QSpirvShader) + QSpirvShaderPrivate *d = nullptr; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(QSpirvShader::GlslFlags) +Q_DECLARE_OPERATORS_FOR_FLAGS(QSpirvShader::MslFlags) +Q_DECLARE_OPERATORS_FOR_FLAGS(QSpirvShader::RemapFlags) + +QT_END_NAMESPACE + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/qspirvshaderremap.cpp b/local/recipes/qt/qtshadertools/source/src/shadertools/qspirvshaderremap.cpp new file mode 100644 index 0000000000..48106a8166 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/qspirvshaderremap.cpp @@ -0,0 +1,49 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant reason:default + + +#include "qspirvshaderremap_p.h" + +#include + +QT_BEGIN_NAMESPACE + +void QSpirvShaderRemapper::remapErrorHandler(const std::string &s) +{ + if (!remapErrorMsg.isEmpty()) + remapErrorMsg.append(QLatin1Char('\n')); + remapErrorMsg.append(QString::fromStdString(s)); +} + +void QSpirvShaderRemapper::remapLogHandler(const std::string &) +{ +} + +QByteArray QSpirvShaderRemapper::remap(const QByteArray &ir, QSpirvShader::RemapFlags flags) +{ + if (ir.isEmpty()) + return QByteArray(); + + remapErrorMsg.clear(); + + spv::spirvbin_t b; + b.registerErrorHandler(std::bind(&QSpirvShaderRemapper::remapErrorHandler, this, std::placeholders::_1)); + b.registerLogHandler(std::bind(&QSpirvShaderRemapper::remapLogHandler, this, std::placeholders::_1)); + + const uint32_t opts = flags.testFlag(QSpirvShader::RemapFlag::StripOnly) ? spv::spirvbin_t::STRIP + : spv::spirvbin_t::DO_EVERYTHING; + + std::vector v; + v.resize(ir.size() / 4); + memcpy(v.data(), ir.constData(), v.size() * 4); + + b.remap(v, opts); + + if (!remapErrorMsg.isEmpty()) + return QByteArray(); + + return QByteArray(reinterpret_cast(v.data()), int(v.size()) * 4); +} + +QT_END_NAMESPACE diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/qspirvshaderremap_p.h b/local/recipes/qt/qtshadertools/source/src/shadertools/qspirvshaderremap_p.h new file mode 100644 index 0000000000..dfefd40b54 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/qspirvshaderremap_p.h @@ -0,0 +1,40 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant reason:default + + +#ifndef QSPIRVSHADERREMAP_P_H +#define QSPIRVSHADERREMAP_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of a number of Qt sources files. This header file may change from +// version to version without notice, or even be removed. +// +// We mean it. +// + +#include +#include "qspirvshader_p.h" + +QT_BEGIN_NAMESPACE + +class Q_SHADERTOOLS_EXPORT QSpirvShaderRemapper +{ +public: + QByteArray remap(const QByteArray &ir, QSpirvShader::RemapFlags flags); + QString errorMessage() const { return remapErrorMsg; } + +private: + void remapErrorHandler(const std::string &s); + void remapLogHandler(const std::string &s); + + QString remapErrorMsg; +}; + +QT_END_NAMESPACE + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/qtshadertoolsglobal.h b/local/recipes/qt/qtshadertools/source/src/shadertools/qtshadertoolsglobal.h new file mode 100644 index 0000000000..ef454540c7 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/qtshadertoolsglobal.h @@ -0,0 +1,16 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant reason:default + + +#ifndef QTSHADERTOOLSGLOBAL_H +#define QTSHADERTOOLSGLOBAL_H + +#include +#include + +#ifdef Q_QDOC +#define Q_SHADERTOOLS_EXPORT +#endif + +#endif diff --git a/local/recipes/qt/qtshadertools/source/src/shadertools/qtshadertoolsglobal_p.h b/local/recipes/qt/qtshadertools/source/src/shadertools/qtshadertoolsglobal_p.h new file mode 100644 index 0000000000..92ba1dc304 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/src/shadertools/qtshadertoolsglobal_p.h @@ -0,0 +1,23 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant reason:default + + +#ifndef QTSHADERTOOLSGLOBAL_P_H +#define QTSHADERTOOLSGLOBAL_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qtshadertoolsglobal.h" +#include + +#endif diff --git a/local/recipes/qt/qtshadertools/source/tests/CMakeLists.txt b/local/recipes/qt/qtshadertools/source/tests/CMakeLists.txt new file mode 100644 index 0000000000..800bc265b0 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# Generated from tests.pro. + +if(QT_BUILD_STANDALONE_TESTS) + # Add qt_find_package calls for extra dependencies that need to be found when building + # the standalone tests here. +endif() +qt_build_tests() diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/CMakeLists.txt b/local/recipes/qt/qtshadertools/source/tests/auto/CMakeLists.txt new file mode 100644 index 0000000000..1471daa07a --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/CMakeLists.txt @@ -0,0 +1,16 @@ +# For now, don't built auto tests when QT_BUILD_MINIMAL_STATIC_TEST +# is specified and the build is targeting iOS. QT_BUILD_MINIMAL_STATIC_TEST is used in our CI. +# Regular non-cmake build tests shouldn't be built because the CI will try to run them and fail +# due to missing simulator support. +if(IOS AND QT_BUILD_MINIMAL_STATIC_TESTS) + return() +endif() + +add_subdirectory(qshaderbaker) +add_subdirectory(buildtimeqsb) + +_qt_internal_check_depfile_support(has_depfile_support) +if(has_depfile_support AND NOT CMAKE_CROSSCOMPILING) + # The test is disabled for cross-compiling platforms since we cannot embed the test results. + add_subdirectory(qsbdepfiles) +endif() diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/CMakeLists.txt b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/CMakeLists.txt new file mode 100644 index 0000000000..c76a56161a --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/CMakeLists.txt @@ -0,0 +1,192 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_buildtimeqsb LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + +qt_internal_add_test(tst_buildtimeqsb + SOURCES + tst_buildtimeqsb.cpp + LIBRARIES + Qt::Gui + Qt::GuiPrivate + Qt::ShaderToolsPrivate +) + +qt6_add_shaders(tst_buildtimeqsb "shaders" + PREFIX + "/test" + FILES + "color.vert" + "color.frag" +) + +qt6_add_shaders(tst_buildtimeqsb "shaders_precompile" + PRECOMPILE + PREFIX + "/test" + FILES + "color.vert" + "color.frag" + OUTPUTS + "color_precomp.vert.qsb" + "color_precomp.frag.qsb" +) + +qt6_add_shaders(tst_buildtimeqsb "shaders_in_subdir" + PREFIX + "/some/prefix" + FILES + "subdir/texture.vert" + "subdir/texture.frag" +) + +qt6_add_shaders(tst_buildtimeqsb "shaders_in_subdir_with_outputs_as_alias" + PREFIX + "/some/prefix" + FILES + "subdir/texture.vert" + "subdir/texture.frag" + OUTPUTS + "alias_texture.vert.qsb" + "x/y/z/alias_texture.frag.qsb" +) + +qt6_add_shaders(tst_buildtimeqsb "shaders_in_subdir_with_base" + BATCHABLE + PREFIX + "/base_test" + BASE + "subdir" + FILES + "subdir/texture2.vert" +) + +qt6_add_shaders(tst_buildtimeqsb "shaders_custom_targets_and_names" + PREFIX + "/test" + GLSL + "300es,330" + NOHLSL + NOMSL + FILES + "color.vert" + "color.frag" + OUTPUTS + "color_1.vert.qsb" + "color_1.frag.qsb" +) + +qt6_add_shaders(tst_buildtimeqsb "shaders_custom_targets_and_names_batchable" + PREFIX + "/test" + BATCHABLE + GLSL + "300es,330" + NOHLSL + NOMSL + FILES + "color.vert" + "color.frag" + OUTPUTS + "color_1b.vert.qsb" + "color_1b.frag.qsb" +) + +qt6_add_shaders(tst_buildtimeqsb "shaders_with_defines" + PREFIX + "/" + DEFINES + "MY_DEFINE" + "ANOTHER_DEFINE" + FILES + "subdir/test/texture_def.frag" +) + +qt6_add_shaders(tst_buildtimeqsb "shaders_with_replacements" + PREFIX + "/test" + FILES + "color.vert@glsl,100es,replacements/r1.vert@spirv,100,replacements/r2.spv@hlsl,50,replacements/r3.vert" + "color.frag@msl,12,replacements/r4.frag" + OUTPUTS + "color_repl.vert.qsb" + "x/color_repl.frag.qsb" +) + +qt6_add_shaders(tst_buildtimeqsb "shaders_tessellation_part1" + PREFIX + "/test" + GLSL + "410,320es" + TESSELLATION + FILES + "tess.vert" + "tess.frag" +) + +qt6_add_shaders(tst_buildtimeqsb "shaders_tessellation_part2" + PREFIX + "/test" + NOHLSL + GLSL + "410,320es" + TESSELLATION + TESSELLATION_VERTEX_COUNT + 3 + TESSELLATION_MODE + "triangles" + FILES + "tess.tesc@hlsl,50,tess_hull.hlsl" + "tess.tese@hlsl,50,tess_domain.hlsl" +) + +qt6_add_shaders(tst_buildtimeqsb "shaders_multiview" + PREFIX + "/test" + GLSL + "330,300es" + HLSL + 61 + MSL + 12 + VIEW_COUNT + 2 + FILES + "color_multiview.vert" + "color.frag" + OUTPUTS + "color_multiview.vert.qsb" + "color_multiview.frag.qsb" +) + +qt6_add_shaders(tst_buildtimeqsb "shaders_multiview_auto" + PREFIX + "/test" + MULTIVIEW + FILES + "color_multiview_def.vert" + "color.frag" + OUTPUTS + "color_multiview_def.vert.qsb" + "color_multiview_def.frag.qsb" +) + +qt6_add_shaders(tst_buildtimeqsb "shaders_with_original_filename" + PRECOMPILE + PREFIX + "/test" + FILES + "color.vert" + "color.frag" + OUTPUTS + "color_99.vert.qsb" + "color_99.frag.qsb" + ORIGINAL_FILES + # evil + "subdir/texture.vert" + "subdir/texture.frag" +) diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/color.frag b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/color.frag new file mode 100644 index 0000000000..375587662f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/color.frag @@ -0,0 +1,10 @@ +#version 440 + +layout(location = 0) in vec3 v_color; + +layout(location = 0) out vec4 fragColor; + +void main() +{ + fragColor = vec4(v_color, 1.0); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/color.vert b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/color.vert new file mode 100644 index 0000000000..e876f290e7 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/color.vert @@ -0,0 +1,16 @@ +#version 440 + +layout(location = 0) in vec4 position; +layout(location = 1) in vec3 color; + +layout(location = 0) out vec3 v_color; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; +}; + +void main() +{ + v_color = color; + gl_Position = mvp * position; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/color_multiview.vert b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/color_multiview.vert new file mode 100644 index 0000000000..197ce56f09 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/color_multiview.vert @@ -0,0 +1,17 @@ +#version 440 +#extension GL_EXT_multiview : require + +layout(location = 0) in vec4 position; +layout(location = 1) in vec3 color; + +layout(location = 0) out vec3 v_color; + +layout(std140, binding = 0) uniform buf { + mat4 mvp[2]; +}; + +void main() +{ + v_color = color; + gl_Position = mvp[gl_ViewIndex] * position; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/color_multiview_def.vert b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/color_multiview_def.vert new file mode 100644 index 0000000000..45565c818b --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/color_multiview_def.vert @@ -0,0 +1,25 @@ +#version 440 +#extension GL_EXT_multiview : require + +layout(location = 0) in vec4 position; +layout(location = 1) in vec3 color; + +layout(location = 0) out vec3 v_color; + +layout(std140, binding = 0) uniform buf { +#if QSHADER_VIEW_COUNT >= 2 + mat4 mvp[QSHADER_VIEW_COUNT]; +#else + mat4 mvp; +#endif +}; + +void main() +{ + v_color = color; +#if QSHADER_VIEW_COUNT >= 2 + gl_Position = mvp[gl_ViewIndex] * position; +#else + gl_Position = mvp * position; +#endif +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/replacements/r1.vert b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/replacements/r1.vert new file mode 100644 index 0000000000..2ba568c048 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/replacements/r1.vert @@ -0,0 +1 @@ +Test r1 diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/replacements/r2.spv b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/replacements/r2.spv new file mode 100644 index 0000000000..de50014318 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/replacements/r2.spv @@ -0,0 +1 @@ +Not very valid SPIR-V diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/replacements/r3.vert b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/replacements/r3.vert new file mode 100644 index 0000000000..3ba3f7f41f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/replacements/r3.vert @@ -0,0 +1 @@ +Test r3 diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/replacements/r4.frag b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/replacements/r4.frag new file mode 100644 index 0000000000..342d410433 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/replacements/r4.frag @@ -0,0 +1 @@ +Test r4 diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/subdir/test/texture_def.frag b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/subdir/test/texture_def.frag new file mode 100644 index 0000000000..744b7f91ea --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/subdir/test/texture_def.frag @@ -0,0 +1,14 @@ +#version 440 + +#ifdef MY_DEFINE +#ifdef ANOTHER_DEFINE +layout(location = 0) in vec2 v_texcoord; +layout(location = 0) out vec4 fragColor; +layout(binding = 1) uniform sampler2D tex; +#endif +#endif // else breaks compilation + +void main() +{ + fragColor = texture(tex, v_texcoord); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/subdir/texture.frag b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/subdir/texture.frag new file mode 100644 index 0000000000..e6021fe905 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/subdir/texture.frag @@ -0,0 +1,12 @@ +#version 440 + +layout(location = 0) in vec2 v_texcoord; + +layout(location = 0) out vec4 fragColor; + +layout(binding = 1) uniform sampler2D tex; + +void main() +{ + fragColor = texture(tex, v_texcoord); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/subdir/texture.vert b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/subdir/texture.vert new file mode 100644 index 0000000000..636b4b169a --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/subdir/texture.vert @@ -0,0 +1,16 @@ +#version 440 + +layout(location = 0) in vec4 position; +layout(location = 1) in vec2 texcoord; + +layout(location = 0) out vec2 v_texcoord; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; +}; + +void main() +{ + v_texcoord = texcoord; + gl_Position = mvp * position; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/subdir/texture2.vert b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/subdir/texture2.vert new file mode 100644 index 0000000000..636b4b169a --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/subdir/texture2.vert @@ -0,0 +1,16 @@ +#version 440 + +layout(location = 0) in vec4 position; +layout(location = 1) in vec2 texcoord; + +layout(location = 0) out vec2 v_texcoord; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; +}; + +void main() +{ + v_texcoord = texcoord; + gl_Position = mvp * position; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tess.frag b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tess.frag new file mode 100644 index 0000000000..375587662f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tess.frag @@ -0,0 +1,10 @@ +#version 440 + +layout(location = 0) in vec3 v_color; + +layout(location = 0) out vec4 fragColor; + +void main() +{ + fragColor = vec4(v_color, 1.0); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tess.tesc b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tess.tesc new file mode 100644 index 0000000000..54937967fa --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tess.tesc @@ -0,0 +1,27 @@ +#version 440 + +layout(vertices = 3) out; + +layout(location = 0) in vec3 inColor[]; + +layout(location = 0) out vec3 outColor[]; + +// these serve no purpose, just exist to test per-patch outputs +layout(location = 1) patch out vec3 stuff; +layout(location = 2) patch out float more_stuff; + +void main() +{ + if (gl_InvocationID == 0) { + gl_TessLevelOuter[0] = 4.0; + gl_TessLevelOuter[1] = 4.0; + gl_TessLevelOuter[2] = 4.0; + + gl_TessLevelInner[0] = 4.0; + } + + gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position; + outColor[gl_InvocationID] = inColor[gl_InvocationID]; + stuff = vec3(1.0); + more_stuff = 1.0; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tess.tese b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tess.tese new file mode 100644 index 0000000000..c50230f852 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tess.tese @@ -0,0 +1,27 @@ +#version 440 + +layout(triangles, fractional_odd_spacing, ccw) in; + +layout(location = 0) in vec3 inColor[]; + +layout(location = 0) out vec3 outColor; + +// these serve no purpose, just exist to test per-patch outputs +layout(location = 1) patch in vec3 stuff; +layout(location = 2) patch in float more_stuff; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; + float time; + float amplitude; +}; + +void main() +{ + vec4 pos = (gl_TessCoord.x * gl_in[0].gl_Position) + (gl_TessCoord.y * gl_in[1].gl_Position) + (gl_TessCoord.z * gl_in[2].gl_Position); + gl_Position = mvp * pos; + gl_Position.x += sin(time + pos.y) * amplitude; + outColor = gl_TessCoord.x * inColor[0] + gl_TessCoord.y * inColor[1] + gl_TessCoord.z * inColor[2] + // these are all 1.0, just here to exercise the shader generation and the runtime pipeline setup + * stuff.x * more_stuff * (gl_TessLevelOuter[0] / 4.0) * (gl_TessLevelInner[0] / 4.0); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tess.vert b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tess.vert new file mode 100644 index 0000000000..3838d2f3bb --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tess.vert @@ -0,0 +1,12 @@ +#version 440 + +layout(location = 0) in vec3 position; +layout(location = 1) in vec3 color; + +layout(location = 0) out vec3 v_color; + +void main() +{ + gl_Position = vec4(position, 1.0); + v_color = color; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tess_domain.hlsl b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tess_domain.hlsl new file mode 100644 index 0000000000..a9697d32cf --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tess_domain.hlsl @@ -0,0 +1,38 @@ +struct Input +{ + float edges[3] : SV_TessFactor; + float inside : SV_InsideTessFactor; +}; + +struct PatchInput +{ + float3 position : POSITION; + float3 color : COLOR; +}; + +struct PixelInput +{ + float3 color : TEXCOORD0; + float4 position : SV_POSITION; +}; + +cbuffer buf : register(b0) +{ + row_major float4x4 mvp : packoffset(c0); + float time : packoffset(c4); + float amplitude : packoffset(c4.y); +}; + +[domain("tri")] +PixelInput main(Input input, float3 uvwCoord : SV_DomainLocation, const OutputPatch patch) +{ + PixelInput output; + + float3 vertexPosition = uvwCoord.x * patch[0].position + uvwCoord.y * patch[1].position + uvwCoord.z * patch[2].position; + output.position = mul(float4(vertexPosition, 1.0f), mvp); + output.position.x += sin(time + vertexPosition.y) * amplitude; + + output.color = uvwCoord.x * patch[0].color + uvwCoord.y * patch[1].color + uvwCoord.z * patch[2].color; + + return output; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tess_hull.hlsl b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tess_hull.hlsl new file mode 100644 index 0000000000..3d09307159 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tess_hull.hlsl @@ -0,0 +1,40 @@ +struct Input +{ + float3 color : TEXCOORD0; + float4 position : SV_Position; +}; + +struct Output +{ + float3 position : POSITION; + float3 color : COLOR; +}; + +struct ConstantData +{ + float edges[3] : SV_TessFactor; + float inside : SV_InsideTessFactor; +}; + +ConstantData patchConstFunc(InputPatch ip, uint PatchID : SV_PrimitiveID ) +{ + ConstantData d; + d.edges[0] = 4.0; + d.edges[1] = 4.0; + d.edges[2] = 4.0; + d.inside = 4.0; + return d; +} + +[domain("tri")] +[partitioning("integer")] +[outputtopology("triangle_cw")] +[outputcontrolpoints(3)] +[patchconstantfunc("patchConstFunc")] +Output main(InputPatch patch, uint pointId : SV_OutputControlPointID, uint patchId : SV_PrimitiveID) +{ + Output output; + output.position = patch[pointId].position; + output.color = patch[pointId].color; + return output; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tst_buildtimeqsb.cpp b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tst_buildtimeqsb.cpp new file mode 100644 index 0000000000..261bf8d042 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/buildtimeqsb/tst_buildtimeqsb.cpp @@ -0,0 +1,292 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include +#include +#include +#include + +class tst_BuildTimeQsb : public QObject +{ + Q_OBJECT + +private slots: + void defaultAddShaders(); + void customTargets(); + void withDefines(); + void replacements(); + void createPipeline(); + void tessellation(); + void multiviewSimple(); + void multiviewAutomatic(); +}; + +static QShader getShader(const QString &name) +{ + QFile f(name); + if (f.open(QIODevice::ReadOnly)) + return QShader::fromSerialized(f.readAll()); + + return QShader(); +} + +static const int defaultShaderCount = 6; +static const QShaderKey defaultShaderKeys[defaultShaderCount] = { + QShaderKey(QShader::SpirvShader, QShaderVersion(100)), + QShaderKey(QShader::HlslShader, QShaderVersion(50)), + QShaderKey(QShader::MslShader, QShaderVersion(12)), + QShaderKey(QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs)), + QShaderKey(QShader::GlslShader, QShaderVersion(120)), + QShaderKey(QShader::GlslShader, QShaderVersion(150)), +}; + +void tst_BuildTimeQsb::defaultAddShaders() +{ + // "shaders" + QShader color_vert = getShader(QLatin1String(":/test/color.vert.qsb")); + QVERIFY(color_vert.isValid()); + QCOMPARE(color_vert.availableShaders().size(), defaultShaderCount); + for (int i = 0; i < defaultShaderCount; ++i) + QVERIFY(color_vert.availableShaders().contains(defaultShaderKeys[i])); + + QShader color_frag = getShader(QLatin1String(":/test/color.frag.qsb")); + QVERIFY(color_frag.isValid()); + QCOMPARE(color_frag.availableShaders().size(), defaultShaderCount); + for (int i = 0; i < defaultShaderCount; ++i) + QVERIFY(color_frag.availableShaders().contains(defaultShaderKeys[i])); + + // "shaders_precompile" + QShader color_vert_pre = getShader(QLatin1String(":/test/color_precomp.vert.qsb")); + QVERIFY(color_vert_pre.isValid()); + QCOMPARE(color_vert_pre.availableShaders().size(), defaultShaderCount); + + QShader color_frag_pre = getShader(QLatin1String(":/test/color_precomp.frag.qsb")); + QVERIFY(color_frag_pre.isValid()); + QCOMPARE(color_frag_pre.availableShaders().size(), defaultShaderCount); + + // "shaders_in_subdir" + QShader texture_vert = getShader(QLatin1String(":/some/prefix/subdir/texture.vert.qsb")); + QVERIFY(texture_vert.isValid()); + QCOMPARE(texture_vert.availableShaders().size(), defaultShaderCount); + for (int i = 0; i < defaultShaderCount; ++i) + QVERIFY(texture_vert.availableShaders().contains(defaultShaderKeys[i])); + + QShader texture_frag = getShader(QLatin1String(":/some/prefix/subdir/texture.frag.qsb")); + QVERIFY(texture_frag.isValid()); + QCOMPARE(texture_frag.availableShaders().size(), defaultShaderCount); + for (int i = 0; i < defaultShaderCount; ++i) + QVERIFY(texture_frag.availableShaders().contains(defaultShaderKeys[i])); + + // "shaders_in_subdir_with_outputs_as_alias" + QShader alias_texture_vert = getShader(QLatin1String(":/some/prefix/alias_texture.vert.qsb")); + QVERIFY(alias_texture_vert.isValid()); + QCOMPARE(alias_texture_vert.availableShaders().size(), defaultShaderCount); + for (int i = 0; i < defaultShaderCount; ++i) + QVERIFY(alias_texture_vert.availableShaders().contains(defaultShaderKeys[i])); + + QShader alias_texture_frag = getShader(QLatin1String(":/some/prefix/x/y/z/alias_texture.frag.qsb")); + QVERIFY(alias_texture_frag.isValid()); + QCOMPARE(alias_texture_frag.availableShaders().size(), defaultShaderCount); + for (int i = 0; i < defaultShaderCount; ++i) + QVERIFY(alias_texture_frag.availableShaders().contains(defaultShaderKeys[i])); + + // "shaders_in_subdir_with_base" + QShader texture2_vert = getShader(QLatin1String(":/base_test/texture2.vert.qsb")); + QVERIFY(texture2_vert.isValid()); + QCOMPARE(texture2_vert.availableShaders().size(), defaultShaderCount * 2); // batchable +} + +void tst_BuildTimeQsb::customTargets() +{ + QShader color_vert = getShader(QLatin1String(":/test/color_1.vert.qsb")); + QVERIFY(color_vert.isValid()); + QCOMPARE(color_vert.availableShaders().size(), 3); + QVERIFY(color_vert.availableShaders().contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100)))); + QVERIFY(color_vert.availableShaders().contains(QShaderKey(QShader::GlslShader, QShaderVersion(300, QShaderVersion::GlslEs)))); + QVERIFY(color_vert.availableShaders().contains(QShaderKey(QShader::GlslShader, QShaderVersion(330)))); + + QShader color_frag = getShader(QLatin1String(":/test/color_1.frag.qsb")); + QVERIFY(color_frag.isValid()); + QCOMPARE(color_frag.availableShaders().size(), 3); + QVERIFY(color_frag.availableShaders().contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100)))); + QVERIFY(color_frag.availableShaders().contains(QShaderKey(QShader::GlslShader, QShaderVersion(300, QShaderVersion::GlslEs)))); + QVERIFY(color_frag.availableShaders().contains(QShaderKey(QShader::GlslShader, QShaderVersion(330)))); + + QShader bat_color_vert = getShader(QLatin1String(":/test/color_1b.vert.qsb")); + QVERIFY(bat_color_vert.isValid()); + QCOMPARE(bat_color_vert.availableShaders().size(), 6); + QVERIFY(bat_color_vert.availableShaders().contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100)))); + QVERIFY(bat_color_vert.availableShaders().contains(QShaderKey(QShader::GlslShader, QShaderVersion(300, QShaderVersion::GlslEs)))); + QVERIFY(bat_color_vert.availableShaders().contains(QShaderKey(QShader::GlslShader, QShaderVersion(330)))); + QVERIFY(bat_color_vert.availableShaders().contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100), QShader::BatchableVertexShader))); + QVERIFY(bat_color_vert.availableShaders().contains(QShaderKey(QShader::GlslShader, QShaderVersion(300, QShaderVersion::GlslEs), QShader::BatchableVertexShader))); + QVERIFY(bat_color_vert.availableShaders().contains(QShaderKey(QShader::GlslShader, QShaderVersion(330), QShader::BatchableVertexShader))); + + QShader bat_color_frag = getShader(QLatin1String(":/test/color_1b.frag.qsb")); + QVERIFY(bat_color_frag.isValid()); + QCOMPARE(bat_color_frag.availableShaders().size(), 3); // batchable applies to vertex shaders only + QVERIFY(bat_color_frag.availableShaders().contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100)))); + QVERIFY(bat_color_frag.availableShaders().contains(QShaderKey(QShader::GlslShader, QShaderVersion(300, QShaderVersion::GlslEs)))); + QVERIFY(bat_color_frag.availableShaders().contains(QShaderKey(QShader::GlslShader, QShaderVersion(330)))); +} + +void tst_BuildTimeQsb::withDefines() +{ + QShader s = getShader(QLatin1String(":/subdir/test/texture_def.frag.qsb")); + QVERIFY(s.isValid()); + QCOMPARE(s.availableShaders().size(), defaultShaderCount); + for (int i = 0; i < defaultShaderCount; ++i) + QVERIFY(s.availableShaders().contains(defaultShaderKeys[i])); +} + +void tst_BuildTimeQsb::replacements() +{ + QShader s = getShader(QLatin1String(":/test/color_repl.vert.qsb")); + QVERIFY(s.isValid()); + QCOMPARE(s.availableShaders().size(), defaultShaderCount); + for (int i = 0; i < defaultShaderCount; ++i) + QVERIFY(s.availableShaders().contains(defaultShaderKeys[i])); + + QByteArray src = s.shader(QShaderKey(QShader::SpirvShader, QShaderVersion(100))).shader(); + QVERIFY(!src.isEmpty()); + QCOMPARE(src.left(21), QByteArrayLiteral("Not very valid SPIR-V")); + + src = s.shader(QShaderKey(QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs))).shader(); + QVERIFY(!src.isEmpty()); + QCOMPARE(src.left(7), QByteArrayLiteral("Test r1")); + + src = s.shader(QShaderKey(QShader::HlslShader, QShaderVersion(50))).shader(); + QVERIFY(!src.isEmpty()); + QCOMPARE(src.left(7), QByteArrayLiteral("Test r3")); + + s = getShader(QLatin1String(":/test/x/color_repl.frag.qsb")); + QVERIFY(s.isValid()); + QCOMPARE(s.availableShaders().size(), defaultShaderCount); + for (int i = 0; i < defaultShaderCount; ++i) + QVERIFY(s.availableShaders().contains(defaultShaderKeys[i])); + + src = s.shader(QShaderKey(QShader::MslShader, QShaderVersion(12))).shader(); + QVERIFY(!src.isEmpty()); + QCOMPARE(src.left(7), QByteArrayLiteral("Test r4")); +} + +void tst_BuildTimeQsb::createPipeline() +{ + // this focuses on loading up a vertex and fragment shader from .qsb files + // that were generated with PRECOMPILE, and may be relevant mainly for D3D + // and Metal where the flag may have an actual effect (not guaranteed), so + // test only those + +#if defined(Q_OS_MACOS) || defined(Q_OS_IOS) || defined(Q_OS_WIN) + +#if defined(Q_OS_MACOS) || defined(Q_OS_IOS) + QRhiMetalInitParams initParams; + QRhi::Implementation backend = QRhi::Metal; +#elif defined(Q_OS_WIN) + QRhiD3D11InitParams initParams; + QRhi::Implementation backend = QRhi::D3D11; +#endif + + QScopedPointer rhi(QRhi::create(backend, &initParams, {}, nullptr)); + if (!rhi) + QSKIP("Failed to create QRhi, skipping pipeline creation test"); + + qDebug() << rhi->driverInfo(); + + QScopedPointer texture(rhi->newTexture(QRhiTexture::RGBA8, QSize(256, 256), 1, QRhiTexture::RenderTarget)); + QVERIFY(texture->create()); + QScopedPointer rt(rhi->newTextureRenderTarget({ texture.data() })); + QScopedPointer rpDesc(rt->newCompatibleRenderPassDescriptor()); + rt->setRenderPassDescriptor(rpDesc.data()); + QVERIFY(rt->create()); + + QScopedPointer srb(rhi->newShaderResourceBindings()); + QVERIFY(srb->create()); + + QRhiVertexInputLayout inputLayout; + inputLayout.setBindings({ { 6 * sizeof(float) } }); + inputLayout.setAttributes({ { 0, 0, QRhiVertexInputAttribute::Float3, 0 }, + { 0, 1, QRhiVertexInputAttribute::Float3, 3 * sizeof(float) } + }); + + QShader color_vert_pre = getShader(QLatin1String(":/test/color_precomp.vert.qsb")); + QVERIFY(color_vert_pre.isValid()); + QShader color_frag_pre = getShader(QLatin1String(":/test/color_precomp.frag.qsb")); + QVERIFY(color_frag_pre.isValid()); + QScopedPointer pipeline; + pipeline.reset(rhi->newGraphicsPipeline()); + pipeline->setShaderStages({ { QRhiShaderStage::Vertex, color_vert_pre }, { QRhiShaderStage::Fragment, color_frag_pre } }); + pipeline->setVertexInputLayout(inputLayout); + pipeline->setShaderResourceBindings(srb.data()); + pipeline->setRenderPassDescriptor(rpDesc.data()); + QVERIFY(pipeline->create()); + +#else + QSKIP("Skipping pipeline creation test on this platform"); +#endif +} + +void tst_BuildTimeQsb::tessellation() +{ + QShader s = getShader(QLatin1String(":/test/tess.vert.qsb")); + QVERIFY(s.isValid()); + QCOMPARE(s.availableShaders().size(), 8); // SPIR-V, 2xGLSL, HLSL, 4xMSL + + s = getShader(QLatin1String(":/test/tess.tesc.qsb")); + QVERIFY(s.isValid()); + QCOMPARE(s.availableShaders().size(), 5); // SPIR-V, 2xGLSL, HLSL, MSL + + s = getShader(QLatin1String(":/test/tess.tese.qsb")); + QVERIFY(s.isValid()); + QCOMPARE(s.availableShaders().size(), 5); // SPIR-V, 2xGLSL, HLSL, MSL + + s = getShader(QLatin1String(":/test/tess.frag.qsb")); + QVERIFY(s.isValid()); + QCOMPARE(s.availableShaders().size(), 5); // SPIR-V, 2xGLSL, HLSL, MSL +} + +void tst_BuildTimeQsb::multiviewSimple() +{ + QShader s = getShader(QLatin1String(":/test/color_multiview.vert.qsb")); + QVERIFY(s.isValid()); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::GlslShader, QShaderVersion(330)))); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::HlslShader, QShaderVersion(61)))); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::MslShader, QShaderVersion(12)))); + + s = getShader(QLatin1String(":/test/color_multiview.frag.qsb")); + QVERIFY(s.isValid()); +} + +void tst_BuildTimeQsb::multiviewAutomatic() +{ + // these are the non-multiview versions + QShader s = getShader(QLatin1String(":/test/color_multiview_def.vert.qsb")); + QVERIFY(s.isValid()); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::GlslShader, QShaderVersion(120)))); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::HlslShader, QShaderVersion(50)))); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::MslShader, QShaderVersion(12)))); + + s = getShader(QLatin1String(":/test/color_multiview_def.frag.qsb")); + QVERIFY(s.isValid()); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::GlslShader, QShaderVersion(120)))); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::HlslShader, QShaderVersion(50)))); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::MslShader, QShaderVersion(12)))); + + // the view count 2 versions with the special suffix + s = getShader(QLatin1String(":/test/color_multiview_def.vert.qsb.mv2qsb")); + QVERIFY(s.isValid()); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100)))); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::GlslShader, QShaderVersion(330)))); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::HlslShader, QShaderVersion(61)))); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::MslShader, QShaderVersion(21)))); + + s = getShader(QLatin1String(":/test/color_multiview_def.frag.qsb.mv2qsb")); + QVERIFY(s.isValid()); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100)))); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::GlslShader, QShaderVersion(330)))); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::HlslShader, QShaderVersion(61)))); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::MslShader, QShaderVersion(21)))); +} + +#include +QTEST_MAIN(tst_BuildTimeQsb) diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/CMakeLists.txt b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/CMakeLists.txt new file mode 100644 index 0000000000..5875504282 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/CMakeLists.txt @@ -0,0 +1,52 @@ +# Copyright (C) 2024 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qsbdepfiles LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + +qt_internal_add_test(tst_qsbdepfiles + SOURCES + tst_qsbdepfiles.cpp +) + +qt_add_shaders(tst_qsbdepfiles + "shaders" + PRECOMPILE + OPTIMIZED + PREFIX + "/" + FILES + "shaders/tst.frag" + "shaders/tstinclude.frag" + "shaders/tstincluderelative.frag" + "shaders/tstincludewhitespaces.frag" + "shaders/tstincludecomment.frag" +) + +set(data_base_dir "${CMAKE_CURRENT_BINARY_DIR}/data") + +configure_file("data/tst.frag.qsb.d.in" + "${data_base_dir}/tst.frag.qsb.d" NEWLINE_STYLE LF) +configure_file("data/tstinclude.frag.qsb.d.in" + "${data_base_dir}/tstinclude.frag.qsb.d" NEWLINE_STYLE LF) +configure_file("data/tstincluderelative.frag.qsb.d.in" + "${data_base_dir}/tstincluderelative.frag.qsb.d" NEWLINE_STYLE LF) +configure_file("data/tstincludewhitespaces.frag.qsb.d.in" + "${data_base_dir}/tstincludewhitespaces.frag.qsb.d" NEWLINE_STYLE LF) +configure_file("data/tstincludecomment.frag.qsb.d.in" + "${data_base_dir}/tstincludecomment.frag.qsb.d" NEWLINE_STYLE LF) + +qt_add_resources(tst_qsbdepfiles "tst_qsbdepfiles_data" + PREFIX "/data" + BASE "${data_base_dir}" + FILES + "${data_base_dir}/tst.frag.qsb.d" + "${data_base_dir}/tstinclude.frag.qsb.d" + "${data_base_dir}/tstincluderelative.frag.qsb.d" + "${data_base_dir}/tstincludewhitespaces.frag.qsb.d" + "${data_base_dir}/tstincludecomment.frag.qsb.d" +) + diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/data/tst.frag.qsb.d.in b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/data/tst.frag.qsb.d.in new file mode 100644 index 0000000000..309c6c4261 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/data/tst.frag.qsb.d.in @@ -0,0 +1,2 @@ +@CMAKE_CURRENT_BINARY_DIR@/.qsb/shaders/tst.frag.qsb: \ + @CMAKE_CURRENT_SOURCE_DIR@/shaders/tst.frag diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/data/tstinclude.frag.qsb.d.in b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/data/tstinclude.frag.qsb.d.in new file mode 100644 index 0000000000..2276315afa --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/data/tstinclude.frag.qsb.d.in @@ -0,0 +1,3 @@ +@CMAKE_CURRENT_BINARY_DIR@/.qsb/shaders/tstinclude.frag.qsb: \ + @CMAKE_CURRENT_SOURCE_DIR@/shaders/tstinclude.frag \ + @CMAKE_CURRENT_SOURCE_DIR@/shaders/common.glsl diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/data/tstincludecomment.frag.qsb.d.in b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/data/tstincludecomment.frag.qsb.d.in new file mode 100644 index 0000000000..d28642feaf --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/data/tstincludecomment.frag.qsb.d.in @@ -0,0 +1,4 @@ +@CMAKE_CURRENT_BINARY_DIR@/.qsb/shaders/tstincludecomment.frag.qsb: \ + @CMAKE_CURRENT_SOURCE_DIR@/shaders/tstincludecomment.frag \ + @CMAKE_CURRENT_SOURCE_DIR@/shaders/common.glsl \ + @CMAKE_CURRENT_SOURCE_DIR@/shaders/inner/common2.glsl diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/data/tstincluderelative.frag.qsb.d.in b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/data/tstincluderelative.frag.qsb.d.in new file mode 100644 index 0000000000..f0946422ca --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/data/tstincluderelative.frag.qsb.d.in @@ -0,0 +1,4 @@ +@CMAKE_CURRENT_BINARY_DIR@/.qsb/shaders/tstincluderelative.frag.qsb: \ + @CMAKE_CURRENT_SOURCE_DIR@/shaders/tstincluderelative.frag \ + @CMAKE_CURRENT_SOURCE_DIR@/shaders/common.glsl \ + @CMAKE_CURRENT_SOURCE_DIR@/shaders/inner/common2.glsl diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/data/tstincludewhitespaces.frag.qsb.d.in b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/data/tstincludewhitespaces.frag.qsb.d.in new file mode 100644 index 0000000000..1a84e3e2e7 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/data/tstincludewhitespaces.frag.qsb.d.in @@ -0,0 +1,3 @@ +@CMAKE_CURRENT_BINARY_DIR@/.qsb/shaders/tstincludewhitespaces.frag.qsb: \ + @CMAKE_CURRENT_SOURCE_DIR@/shaders/tstincludewhitespaces.frag \ + @CMAKE_CURRENT_SOURCE_DIR@/shaders/common.glsl diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/common.glsl b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/common.glsl new file mode 100644 index 0000000000..a471529a53 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/common.glsl @@ -0,0 +1,8 @@ +#ifndef COMMON_GLSL +#define COMMON_GLSL + +vec4 getColor() +{ + return vec4(1.0, 0.0, 0.0, 1.0); +} +#endif diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/inner/common2.glsl b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/inner/common2.glsl new file mode 100644 index 0000000000..fd8c28d396 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/inner/common2.glsl @@ -0,0 +1,7 @@ +#ifndef COMMON2_GLSL +#define COMMON2_GLSL +vec4 getColor2() +{ + return vec4(1.0, 0.0, 0.0, 1.0); +} +#endif diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/tst.frag b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/tst.frag new file mode 100644 index 0000000000..a8abe1b908 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/tst.frag @@ -0,0 +1,7 @@ +#version 440 + +layout(location = 0) out vec4 fragColor; + +void main() { + fragColor = vec4(1.0, 0.0, 0.0, 1.0); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/tstinclude.frag b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/tstinclude.frag new file mode 100644 index 0000000000..43052c4ea4 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/tstinclude.frag @@ -0,0 +1,11 @@ +#version 440 +#extension GL_GOOGLE_include_directive : enable + +#include "common.glsl" +#include "common.glsl" + +layout(location = 0) out vec4 fragColor; + +void main() { + fragColor = getColor(); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/tstincludecomment.frag b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/tstincludecomment.frag new file mode 100644 index 0000000000..2e7520ea06 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/tstincludecomment.frag @@ -0,0 +1,12 @@ +#version 440 +#extension GL_GOOGLE_include_directive : enable + +#include "common.glsl" // The followup comment +#include "inner/common2.glsl" // The followup comment with " +// #include "common.glsl" commented line + +layout(location = 0) out vec4 fragColor; + +void main() { + fragColor = getColor(); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/tstincluderelative.frag b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/tstincluderelative.frag new file mode 100644 index 0000000000..7278bdf846 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/tstincluderelative.frag @@ -0,0 +1,12 @@ +#version 440 +#extension GL_GOOGLE_include_directive : enable + +#include "common.glsl" +#include "inner/common2.glsl" + +layout(location = 0) out vec4 fragColor; + +void main() { + fragColor = getColor(); + fragColor = getColor2(); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/tstincludewhitespaces.frag b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/tstincludewhitespaces.frag new file mode 100644 index 0000000000..fe07fd253e --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/shaders/tstincludewhitespaces.frag @@ -0,0 +1,10 @@ +#version 440 +#extension GL_GOOGLE_include_directive : enable + +# include "common.glsl" + +layout(location = 0) out vec4 fragColor; + +void main() { + fragColor = vec4(1.0, 0.0, 0.0, 1.0); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/tst_qsbdepfiles.cpp b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/tst_qsbdepfiles.cpp new file mode 100644 index 0000000000..b723e3ab45 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qsbdepfiles/tst_qsbdepfiles.cpp @@ -0,0 +1,48 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only +#include +#include + +using namespace Qt::StringLiterals; + +class tst_qsbdepfiles : public QObject +{ + Q_OBJECT +private: + void init(); +private slots: + void Depfiles_data(); + void Depfiles(); +}; + +void tst_qsbdepfiles::Depfiles_data() +{ + QTest::addColumn("filename"); + + QTest::newRow("WithoutInclude") << "tst.frag.qsb.d"_L1; + QTest::newRow("WithInclude") << "tstinclude.frag.qsb.d"_L1; + QTest::newRow("WithWhitespaces") << "tstincludewhitespaces.frag.qsb.d"_L1; + QTest::newRow("WithRelativeInclude") << "tstincluderelative.frag.qsb.d"_L1; + QTest::newRow("WithComment") << "tstincludecomment.frag.qsb.d"_L1; +} + +void tst_qsbdepfiles::Depfiles() +{ + QFETCH(const QLatin1String, filename); + QString resultFilePath = QFINDTESTDATA(QString(".qsb/shaders/%1").arg(filename)); + QString expectedFilePath = QString(":/data/%1").arg(filename); + + QFile resultFile(resultFilePath); + QFile expectedFile(expectedFilePath); + + QVERIFY(resultFile.open(QFile::ReadOnly)); + QVERIFY(expectedFile.open(QFile::ReadOnly)); + + // We chop the one byte from expectedFile because of CMake issue. + // See https://gitlab.kitware.com/cmake/cmake/-/issues/25164 + QVERIFY(resultFile.readAll() == expectedFile.readAll().chopped(1)); +} + +QTEST_MAIN(tst_qsbdepfiles) + +#include "tst_qsbdepfiles.moc" diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/CMakeLists.txt b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/CMakeLists.txt new file mode 100644 index 0000000000..227124004f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/CMakeLists.txt @@ -0,0 +1,36 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# Generated from qshaderbaker.pro. + +##################################################################### +## tst_qshaderbaker Test: +##################################################################### + +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qshaderbaker LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + +qt_internal_add_test(tst_qshaderbaker + SOURCES + tst_qshaderbaker.cpp + LIBRARIES + Qt::Gui + Qt::GuiPrivate + Qt::ShaderToolsPrivate +) + +# Resources: +set(qshaderbaker_resource_files + "data" +) + +qt_internal_add_resource(tst_qshaderbaker "qshaderbaker" + PREFIX + "/" + FILES + ${qshaderbaker_resource_files} +) + diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/array_of_struct_in_ubuf.frag b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/array_of_struct_in_ubuf.frag new file mode 100644 index 0000000000..85b15bf840 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/array_of_struct_in_ubuf.frag @@ -0,0 +1,51 @@ +#version 440 + +layout(location = 0) in vec3 vECVertNormal; +layout(location = 1) in vec3 vECVertPos; +layout(location = 2) flat in vec3 vDiffuseAdjust; + +#define MAX_LIGHTS 10 + +struct Light { + // padding1, 2, and 3 ensures it stays translatable to HLSL with packoffset in the top-level block + + vec3 ECLightPosition; + float padding1; + vec3 attenuation; + float padding2; + vec3 color; + float padding3; + float intensity; + float specularExp; +}; + +layout(std140, binding = 1) uniform buf { + vec3 ECCameraPosition; + vec3 ka; + vec3 kd; + vec3 ks; + Light lights[MAX_LIGHTS]; + int numLights; + layout(row_major) mat3 mm; +} ubuf; + +layout(location = 0) out vec4 fragColor; + +void main() +{ + vec3 unnormL = ubuf.lights[0].ECLightPosition - vECVertPos; + float dist = length(unnormL); + float att = 1.0 / (ubuf.lights[0].attenuation.x + ubuf.lights[0].attenuation.y * dist + ubuf.lights[0].attenuation.z * dist * dist); + + vec3 N = normalize(vECVertNormal); + vec3 L = normalize(unnormL); + float NL = max(0.0, dot(N, L)); + vec3 dColor = att * ubuf.lights[0].intensity * ubuf.lights[0].color * NL; + + vec3 R = reflect(-L, N); + vec3 V = normalize(ubuf.ECCameraPosition - vECVertPos); + float RV = max(0.0, dot(R, V)); + vec3 sColor = att * ubuf.lights[0].intensity * ubuf.lights[0].color * pow(RV, ubuf.lights[0].specularExp); + + fragColor = vec4(ubuf.ka + (ubuf.kd + vDiffuseAdjust) * dColor + ubuf.ks * sColor, 1.0); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/arrays_of_samplers.frag b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/arrays_of_samplers.frag new file mode 100644 index 0000000000..d120c09f9e --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/arrays_of_samplers.frag @@ -0,0 +1,23 @@ +#version 440 + +layout(location = 0) in vec2 v_texcoord; + +layout(location = 0) out vec4 fragColor; + +layout(binding = 4) uniform sampler2D tex1; +layout(binding = 8) uniform sampler2D shadowMaps[4]; // array of textures +layout(binding = 9) uniform samplerCube shadowCubes[4]; // array of cubemap textures +layout(binding = 10) uniform sampler2DArray texArr; // texture array + +void main() +{ + fragColor = texture(tex1, v_texcoord) * texture(texArr, vec3(v_texcoord, 0.0)) + * texture(shadowMaps[0], v_texcoord) + * texture(shadowMaps[1], v_texcoord) + * texture(shadowMaps[2], v_texcoord) + * texture(shadowMaps[3], v_texcoord) + * texture(shadowCubes[0], vec3(v_texcoord, 0.0)) + * texture(shadowCubes[1], vec3(v_texcoord, 0.0)) + * texture(shadowCubes[2], vec3(v_texcoord, 0.0)) + * texture(shadowCubes[3], vec3(v_texcoord, 0.0)); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/color.frag b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/color.frag new file mode 100644 index 0000000000..62ff1b0f55 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/color.frag @@ -0,0 +1,14 @@ +#version 440 + +layout(location = 0) in vec3 v_color; +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; + float opacity; +} ubuf; + +void main() +{ + fragColor = vec4(v_color * ubuf.opacity, ubuf.opacity); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/color.vert b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/color.vert new file mode 100644 index 0000000000..c92f71b9e1 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/color.vert @@ -0,0 +1,18 @@ +#version 440 + +layout(location = 0) in vec4 position; +layout(location = 1) in vec3 color; +layout(location = 0) out vec3 v_color; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; + float opacity; +} ubuf; + +out gl_PerVertex { vec4 gl_Position; }; + +void main() +{ + v_color = color; + gl_Position = ubuf.mvp * position; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/color_glsl_only.vert b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/color_glsl_only.vert new file mode 100644 index 0000000000..a9945abe73 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/color_glsl_only.vert @@ -0,0 +1,26 @@ +#version 440 + +layout(location = 0) in vec4 position; +layout(location = 1) in vec3 color; +layout(location = 0) out vec3 v_color; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; + float opacity; +} ubuf; + +out gl_PerVertex { vec4 gl_Position; }; + +void main() +{ +#if QSHADER_SPIRV || QSHADER_HLSL || QSHADER_MSL + wrong +#endif + +#if QSHADER_GLSL && !QSHADER_GLSL_ES && (QSHADER_GLSL_VERSION == 330 || QSHADER_GLSL_VERSION == 440) + v_color = color; + gl_Position = ubuf.mvp * position; +#else + something is broken +#endif +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/color_hlsl_msl_only.vert b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/color_hlsl_msl_only.vert new file mode 100644 index 0000000000..4678133cdb --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/color_hlsl_msl_only.vert @@ -0,0 +1,32 @@ +#version 440 + +layout(location = 0) in vec4 position; +layout(location = 1) in vec3 color; +layout(location = 0) out vec3 v_color; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; + float opacity; +} ubuf; + +out gl_PerVertex { vec4 gl_Position; }; + +void main() +{ +#if QSHADER_SPIRV || QSHADER_GLSL || QSHADER_GLSL_ES + wrong +#endif + +#if QSHADER_HLSL || QSHADER_MSL + +#if QSHADER_HLSL_VERSION == 50 || QSHADER_MSL_VERSION == 12 + v_color = color; + gl_Position = ubuf.mvp * position; +#else + version macros broken +#endif + +#else + something is broken +#endif +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/color_pertarget.vert b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/color_pertarget.vert new file mode 100644 index 0000000000..b58b71f46a --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/color_pertarget.vert @@ -0,0 +1,33 @@ +#version 440 + +layout(location = 0) in vec4 position; +layout(location = 1) in vec3 color; +layout(location = 0) out vec3 v_color; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; + float opacity; +} ubuf; + +out gl_PerVertex { vec4 gl_Position; }; + +void main() +{ +// ensure that the manually defined macro still works +#ifdef MY_MACRO +#if MY_VALUE == 321 + v_color = color; +#else + broken MY_VALUE +#endif +#else + broken MY_MACRO +#endif + +// fail in non-per-target mode +#if !defined(QSHADER_SPIRV) && !defined(QSHADER_GLSL) && !defined(QSHADER_HLSL) && !defined(QSHADER_MSL) + macros not present?! +#endif + + gl_Position = ubuf.mvp * position; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/color_spirv_only.vert b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/color_spirv_only.vert new file mode 100644 index 0000000000..29c7b3b2b7 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/color_spirv_only.vert @@ -0,0 +1,22 @@ +#version 440 + +layout(location = 0) in vec4 position; +layout(location = 1) in vec3 color; +layout(location = 0) out vec3 v_color; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; + float opacity; +} ubuf; + +out gl_PerVertex { vec4 gl_Position; }; + +void main() +{ +#if QSHADER_SPIRV && QSHADER_SPIRV_VERSION >= 100 + v_color = color; + gl_Position = ubuf.mvp * position; +#else + something is broken +#endif +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/combined_and_separate_samplers.frag b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/combined_and_separate_samplers.frag new file mode 100644 index 0000000000..368e851bb4 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/combined_and_separate_samplers.frag @@ -0,0 +1,17 @@ +#version 440 + +layout(location = 0) in vec2 v_texcoord; + +layout(location = 0) out vec4 fragColor; + +layout(binding = 1) uniform sampler2D combinedTexSampler; +layout(binding = 2) uniform texture2D sepTex; +layout(binding = 3) uniform sampler sepSampler; +layout(binding = 4) uniform sampler sepSampler2; + +void main() +{ + fragColor = texture(sampler2D(sepTex, sepSampler), v_texcoord); + fragColor *= texture(sampler2D(sepTex, sepSampler2), v_texcoord); + fragColor *= texture(combinedTexSampler, v_texcoord); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/defines.frag b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/defines.frag new file mode 100644 index 0000000000..8bdd794f9b --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/defines.frag @@ -0,0 +1,28 @@ +#version 440 + +layout(location = 0) in vec3 v_color; +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; +#if OPACITY_SIZE == 1 + float opacity; +#elif OPACITY_SIZE == 2 + vec2 opacity; +#elif OPACITY_SIZE == 3 + vec3 opacity; +#else + vec4 opacity; +#endif +} ubuf; + +#ifdef DO_NOT_BREAK +void main() +#endif +{ +#if OPACITY_SIZE == 1 + fragColor = vec4(v_color * ubuf.opacity, ubuf.opacity); +#else + fragColor = vec4(v_color * ubuf.opacity.r, ubuf.opacity.r); +#endif +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/error.vert b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/error.vert new file mode 100644 index 0000000000..3d2097bd15 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/error.vert @@ -0,0 +1,18 @@ +#version 440 + +layout(location = 0) in vec4 position; +layout(location = 1) in vec3 color; +layout(location = 0) out vec3 v_color; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; + float opacity; +} ubuf; + +out gl_PerVertex { vec4 gl_Position; }; + +void main() +{ + v_color = cgrepijrgrewolor; + gl_Position = ubuf.mvp * position; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/hlsl_cbuf_error.frag b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/hlsl_cbuf_error.frag new file mode 100644 index 0000000000..ba59ffa0ff --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/hlsl_cbuf_error.frag @@ -0,0 +1,47 @@ +#version 440 + +layout(location = 0) in vec3 vECVertNormal; +layout(location = 1) in vec3 vECVertPos; +layout(location = 2) flat in vec3 vDiffuseAdjust; + +#define MAX_LIGHTS 10 + +struct Light { + vec3 ECLightPosition; + vec3 attenuation; + vec3 color; + float intensity; + float specularExp; + // this is not translatable to HLSL +}; + +layout(std140, binding = 1) uniform buf { + vec3 ECCameraPosition; + vec3 ka; + vec3 kd; + vec3 ks; + Light lights[MAX_LIGHTS]; + int numLights; + layout(row_major) mat3 mm; +} ubuf; + +layout(location = 0) out vec4 fragColor; + +void main() +{ + vec3 unnormL = ubuf.lights[0].ECLightPosition - vECVertPos; + float dist = length(unnormL); + float att = 1.0 / (ubuf.lights[0].attenuation.x + ubuf.lights[0].attenuation.y * dist + ubuf.lights[0].attenuation.z * dist * dist); + + vec3 N = normalize(vECVertNormal); + vec3 L = normalize(unnormL); + float NL = max(0.0, dot(N, L)); + vec3 dColor = att * ubuf.lights[0].intensity * ubuf.lights[0].color * NL; + + vec3 R = reflect(-L, N); + vec3 V = normalize(ubuf.ECCameraPosition - vECVertPos); + float RV = max(0.0, dot(R, V)); + vec3 sColor = att * ubuf.lights[0].intensity * ubuf.lights[0].color * pow(RV, ubuf.lights[0].specularExp); + + fragColor = vec4(ubuf.ka + (ubuf.kd + vDiffuseAdjust) * dColor + ubuf.ks * sColor, 1.0); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/imageloadstore.comp b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/imageloadstore.comp new file mode 100644 index 0000000000..6ff6966ceb --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/imageloadstore.comp @@ -0,0 +1,20 @@ +#version 440 + +layout ( local_size_x = 1, local_size_y = 1, local_size_z = 1 ) in; + +layout ( r32f, binding = 0 ) uniform image2D image; +layout ( r32f, binding = 1 ) writeonly uniform image2D imageWriteOnly; +layout ( r32f, binding = 2 ) readonly uniform image2D imageReadOnly; +layout ( r32f, binding = 3 ) readonly writeonly uniform image2D imageReadOnlyWriteOnly; + +void main() +{ + imageLoad(image, ivec2(gl_GlobalInvocationID.xy)); + imageStore(image, ivec2(gl_GlobalInvocationID.xy), vec4(0)); + + imageStore(imageWriteOnly, ivec2(gl_GlobalInvocationID.xy), vec4(0)); + + imageLoad(imageReadOnly, ivec2(gl_GlobalInvocationID.xy)); + + imageSize(imageReadOnlyWriteOnly); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/manyresources.frag b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/manyresources.frag new file mode 100644 index 0000000000..3f399fe1e4 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/manyresources.frag @@ -0,0 +1,35 @@ +#version 440 + +layout(location = 0) in vec2 v_texcoord; + +layout(location = 0) out vec4 fragColor; + +layout(binding = 1) uniform sampler2D tex; +layout(binding = 2) uniform sampler2D tex2; +layout(binding = 3) uniform sampler2D tex3; + +layout (binding = 4, rgba8) uniform readonly image2D image0; +layout (binding = 5, rgba8) uniform writeonly image2D image1; + +layout(std140, binding = 10) buffer storageBuf { + vec4 whatever; +} buf; + +layout(std140, binding = 11) uniform buf { + mat4 mvp; +} ubuf; + +layout(std140, binding = 12) uniform buf2 { + float f; +} ubuf2; + +void main() +{ + vec4 c = texture(tex, v_texcoord) * texture(tex2, v_texcoord) * texture(tex3, v_texcoord); + c = ubuf.mvp * c; + c *= ubuf2.f; + c *= buf.whatever; + c += imageLoad(image0, ivec2(0, 0)); + imageStore(image1, ivec2(0, 0), c); + fragColor = c; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/multiview_simple.vert b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/multiview_simple.vert new file mode 100644 index 0000000000..7d2310408e --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/multiview_simple.vert @@ -0,0 +1,14 @@ +#version 440 +#extension GL_EXT_multiview : require + +layout(location = 0) in vec4 pos; + +layout(std140, binding = 0) uniform buf +{ + mat4 mvp[2]; +}; + +void main() +{ + gl_Position = mvp[gl_ViewIndex] * pos; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/sgtexture.frag b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/sgtexture.frag new file mode 100644 index 0000000000..f94d39edbe --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/sgtexture.frag @@ -0,0 +1,17 @@ +#version 440 + +layout(location = 0) in vec2 qt_TexCoord; +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf { + mat4 qt_Matrix; + float opacity; +} ubuf; + +layout(binding = 1) uniform sampler2D qt_Texture; +layout(binding = 2) uniform sampler2D t1; + +void main() +{ + fragColor = texture(qt_Texture, qt_TexCoord) * ubuf.opacity * texture(t1, qt_TexCoord); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/storagebuffer.comp b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/storagebuffer.comp new file mode 100644 index 0000000000..dd3a5ec478 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/storagebuffer.comp @@ -0,0 +1,55 @@ +#version 440 + +layout ( local_size_x = 1, local_size_y = 1, local_size_z = 1 ) in; + +layout ( std430, binding = 0) buffer Buffer430 +{ + float _float[]; +}buffer430; + +layout ( std140, binding = 1 ) coherent buffer Buffer140 +{ + float _float[]; +}buffer140; + +layout ( std430, binding = 2 ) volatile writeonly buffer BufferWriteOnly430 +{ + vec2 _vec2[]; +}bufferWriteOnly430; + +layout ( std140, binding = 3 ) restrict writeonly buffer BufferWriteOnly140 +{ + vec2 _vec2[]; +}bufferWriteOnly140; + +layout ( std430, binding = 4 ) readonly buffer BufferReadOnly430 +{ + vec3 _vec3[]; +}bufferReadOnly430; + +layout ( std140, binding = 5 ) coherent readonly buffer BufferReadOnly140 +{ + vec3 _vec3[]; +}bufferReadOnly140; + +layout ( std430, binding = 6 ) volatile readonly writeonly buffer BufferReadOnlyWriteOnly430 +{ + vec4 _vec4[]; +}bufferReadOnlyWriteOnly430; + +layout ( std140, binding = 7 ) restrict readonly writeonly buffer BufferReadOnlyWriteOnly140 +{ + vec4 _vec4[]; +}bufferReadOnlyWriteOnly140; + +void main() +{ + buffer430._float[0] = 0.0f; + buffer140._float[1] = 1.0f; + bufferWriteOnly430._vec2[0] = vec2(2.0f, 3.0f); + bufferWriteOnly140._vec2[0] = vec2(4.0f, 5.0f); + vec3 a = bufferReadOnly430._vec3[0]; + vec3 b = bufferReadOnly140._vec3[0]; + int c = bufferReadOnlyWriteOnly430._vec4.length(); + int d = bufferReadOnlyWriteOnly140._vec4.length(); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/tess.tesc b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/tess.tesc new file mode 100644 index 0000000000..54937967fa --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/tess.tesc @@ -0,0 +1,27 @@ +#version 440 + +layout(vertices = 3) out; + +layout(location = 0) in vec3 inColor[]; + +layout(location = 0) out vec3 outColor[]; + +// these serve no purpose, just exist to test per-patch outputs +layout(location = 1) patch out vec3 stuff; +layout(location = 2) patch out float more_stuff; + +void main() +{ + if (gl_InvocationID == 0) { + gl_TessLevelOuter[0] = 4.0; + gl_TessLevelOuter[1] = 4.0; + gl_TessLevelOuter[2] = 4.0; + + gl_TessLevelInner[0] = 4.0; + } + + gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position; + outColor[gl_InvocationID] = inColor[gl_InvocationID]; + stuff = vec3(1.0); + more_stuff = 1.0; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/tess.tese b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/tess.tese new file mode 100644 index 0000000000..9cee6c2275 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/tess.tese @@ -0,0 +1,26 @@ +#version 440 + +layout(triangles, fractional_odd_spacing, ccw) in; + +layout(location = 0) in vec3 inColor[]; + +layout(location = 0) out vec3 outColor; + +// these serve no purpose, just exist to test per-patch outputs +layout(location = 1) patch in vec3 stuff; +layout(location = 2) patch in float more_stuff; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; + float time; + float amplitude; +}; + +void main() +{ + gl_Position = mvp * ((gl_TessCoord.x * gl_in[0].gl_Position) + (gl_TessCoord.y * gl_in[1].gl_Position) + (gl_TessCoord.z * gl_in[2].gl_Position)); + gl_Position.x += sin(time + gl_Position.y) * amplitude; + outColor = gl_TessCoord.x * inColor[0] + gl_TessCoord.y * inColor[1] + gl_TessCoord.z * inColor[2] + // these are all 1.0, just here to exercise the shader generation and the runtime pipeline setup + * stuff.x * more_stuff * (gl_TessLevelOuter[0] / 4.0) * (gl_TessLevelInner[0] / 4.0); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/texturesize.frag b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/texturesize.frag new file mode 100644 index 0000000000..ec388496c1 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/texturesize.frag @@ -0,0 +1,12 @@ +#version 440 + +layout(location = 0) in vec2 v_texcoord; +layout(location = 0) out vec4 fragColor; +layout(binding = 0) uniform sampler2D tex; + +void main() +{ + vec2 size = vec2(textureSize(tex, 0)); + vec2 d = vec2(1.0 / size.x, 1.0 / size.y); + fragColor = texture(tex, v_texcoord + d); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/voxelize.geom b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/voxelize.geom new file mode 100644 index 0000000000..ddd08c2117 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/data/voxelize.geom @@ -0,0 +1,42 @@ +#version 440 + +layout(triangles) in; +layout(triangle_strip, max_vertices = 3) out; + +layout(location = 0) in vec2 v_texCoord[]; +layout(location = 1) in vec3 v_worldPos[]; +layout(location = 2) in vec3 v_normal[]; + +layout(location = 0) out vec2 g_texCoord; +layout(location = 1) out vec3 g_worldPos; +layout(location = 2) out vec3 g_normal; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; + mat4 modelMatrix; + vec3 voxelSpaceSize; +}; + +void main() +{ + const vec3 planeNormal = cross(v_worldPos[1] - v_worldPos[0], v_worldPos[2] - v_worldPos[0]); + const vec3 p = abs(planeNormal); + + for (uint i = 0; i < 3; ++i) { + g_texCoord = v_texCoord[i]; + g_worldPos = v_worldPos[i]; + g_normal = v_normal[i]; + + const vec3 pos = g_worldPos / voxelSpaceSize; + if (p.z > p.x && p.z > p.y) + gl_Position = vec4(pos.x, pos.y, 0.0, 1.0); + else if (p.x > p.y && p.x > p.z) + gl_Position = vec4(pos.y, pos.z, 0.0, 1.0); + else + gl_Position = vec4(pos.x, pos.z, 0.0, 1.0); + + EmitVertex(); + } + + EndPrimitive(); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/tst_qshaderbaker.cpp b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/tst_qshaderbaker.cpp new file mode 100644 index 0000000000..8644a14bd2 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/auto/qshaderbaker/tst_qshaderbaker.cpp @@ -0,0 +1,1478 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include +#include +#include +#include +#include + +class tst_QShaderBaker : public QObject +{ + Q_OBJECT + +private slots: + void initTestCase(); + void cleanup(); + void emptyCompile(); + void noFileCompile(); + void noTargetsCompile(); + void noVariantsCompile(); + void simpleCompile(); + void simpleCompileNoSpirvSpecified(); + void simpleCompileCheckResults(); + void simpleCompileFromDevice(); + void simpleCompileFromString(); + void multiCompile(); + void reuse(); + void compileError(); + void translateError(); + void genVariants(); + void defines(); + void reflectArrayOfStructInBlock(); + void reflectCombinedImageSampler(); + void mslNativeBindingMap(); + void hlslNativeBindingMap(); + void reflectArraysOfSamplers(); + void perTargetCompileMode(); + void serializeDeserialize(); + void spirvOptions(); + void separateImagesAndSamplers(); + void tessellationForMetalVertCompile(); + void tessellationCompile(); + void tessellationCompileWithChangedTessArgs(); + void dontBreakOnTranslationError(); + void storageImageFlags(); + void storageBufferRuntimeArrayStride(); + void storageBufferQualifiers(); + void multiview(); + void mediump(); + void geometryShader(); +}; + +void tst_QShaderBaker::initTestCase() +{ +} + +void tst_QShaderBaker::cleanup() +{ +} + +void tst_QShaderBaker::emptyCompile() +{ + QShaderBaker baker; + QShader s = baker.bake(); + QVERIFY(!s.isValid()); + QVERIFY(!baker.errorMessage().isEmpty()); + qDebug() << baker.errorMessage(); +} + +void tst_QShaderBaker::noFileCompile() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/nonexistant.vert")); + QShader s = baker.bake(); + QVERIFY(!s.isValid()); + QVERIFY(!baker.errorMessage().isEmpty()); + qDebug() << baker.errorMessage(); +} + +void tst_QShaderBaker::noTargetsCompile() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/color.vert")); + QShader s = baker.bake(); + // an empty shader pack is invalid + QVERIFY(!s.isValid()); + // not an error from the baker's point of view however + QVERIFY(baker.errorMessage().isEmpty()); +} + +void tst_QShaderBaker::noVariantsCompile() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/color.vert")); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + // an empty shader pack is invalid + QVERIFY(!s.isValid()); + // not an error from the baker's point of view however + QVERIFY(baker.errorMessage().isEmpty()); +} + +void tst_QShaderBaker::simpleCompile() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/color.vert")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 1); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100)))); +} + +void tst_QShaderBaker::simpleCompileNoSpirvSpecified() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/color.vert")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::GlslShader, QShaderVersion(330) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 1); + QVERIFY(s.availableShaders().contains(QShaderKey(QShader::GlslShader, QShaderVersion(330)))); + QVERIFY(s.shader(s.availableShaders().first()).shader().contains(QByteArrayLiteral("#version 330"))); +} + +void tst_QShaderBaker::simpleCompileCheckResults() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/color.vert")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 1); + + const QShaderCode shader = s.shader(QShaderKey(QShader::SpirvShader, + QShaderVersion(100))); + QVERIFY(!shader.shader().isEmpty()); + QCOMPARE(shader.entryPoint(), QByteArrayLiteral("main")); + + const QShaderDescription desc = s.description(); + QVERIFY(desc.isValid()); + QCOMPARE(desc.inputVariables().size(), 2); + for (const QShaderDescription::InOutVariable &v : desc.inputVariables()) { + switch (v.location) { + case 0: + QCOMPARE(v.name, QByteArrayLiteral("position")); + QCOMPARE(v.type, QShaderDescription::Vec4); + break; + case 1: + QCOMPARE(v.name, QByteArrayLiteral("color")); + QCOMPARE(v.type, QShaderDescription::Vec3); + break; + default: + QFAIL(qPrintable(QStringLiteral("Unexpected location value: %1").arg(v.location))); + break; + } + } + QCOMPARE(desc.outputVariables().size(), 1); + for (const QShaderDescription::InOutVariable &v : desc.outputVariables()) { + switch (v.location) { + case 0: + QCOMPARE(v.name, QByteArrayLiteral("v_color")); + QCOMPARE(v.type, QShaderDescription::Vec3); + break; + default: + QFAIL(qPrintable(QStringLiteral("Unexpected location value: %1").arg(v.location))); + break; + } + } + QCOMPARE(desc.uniformBlocks().size(), 1); + const QShaderDescription::UniformBlock blk = desc.uniformBlocks().first(); + QCOMPARE(blk.blockName, QByteArrayLiteral("buf")); + QCOMPARE(blk.structName, QByteArrayLiteral("ubuf")); + QCOMPARE(blk.size, 68); + QCOMPARE(blk.binding, 0); + QCOMPARE(blk.descriptorSet, 0); + QCOMPARE(blk.members.size(), 2); + for (int i = 0; i < blk.members.size(); ++i) { + const QShaderDescription::BlockVariable v = blk.members[i]; + switch (i) { + case 0: + QCOMPARE(v.offset, 0); + QCOMPARE(v.size, 64); + QCOMPARE(v.name, QByteArrayLiteral("mvp")); + QCOMPARE(v.type, QShaderDescription::Mat4); + QCOMPARE(v.matrixStride, 16); + break; + case 1: + QCOMPARE(v.offset, 64); + QCOMPARE(v.size, 4); + QCOMPARE(v.name, QByteArrayLiteral("opacity")); + QCOMPARE(v.type, QShaderDescription::Float); + break; + default: + QFAIL(qPrintable(QStringLiteral("Too many blocks").arg(blk.members.size()))); + break; + } + } +} + +void tst_QShaderBaker::simpleCompileFromDevice() +{ + QFile f(QLatin1String(":/data/color.vert")); + QVERIFY(f.open(QIODevice::ReadOnly | QIODevice::Text)); + + QShaderBaker baker; + baker.setSourceDevice(&f, QShader::VertexStage); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 1); +} + +void tst_QShaderBaker::simpleCompileFromString() +{ + QFile f(QLatin1String(":/data/color.vert")); + QVERIFY(f.open(QIODevice::ReadOnly | QIODevice::Text)); + const QByteArray contents = f.readAll(); + f.close(); + QVERIFY(!contents.isEmpty()); + + QShaderBaker baker; + baker.setSourceString(contents, QShader::VertexStage); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 1); +} + +void tst_QShaderBaker::multiCompile() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/color.vert")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs) }); + targets.append({ QShader::GlslShader, QShaderVersion(120) }); + targets.append({ QShader::HlslShader, QShaderVersion(50) }); + targets.append({ QShader::MslShader, QShaderVersion(12) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 5); + + for (const QShaderBaker::GeneratedShader &genShader : targets) { + const QShaderKey key(genShader.first, genShader.second); + const QShaderCode shader = s.shader(key); + QVERIFY(!shader.shader().isEmpty()); + if (genShader.first != QShader::MslShader) + QCOMPARE(shader.entryPoint(), QByteArrayLiteral("main")); + } +} + +void tst_QShaderBaker::reuse() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/color.vert")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 1); + + baker.setSourceFileName(QLatin1String(":/data/color.frag")); + targets.clear(); + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs) }); + targets.append({ QShader::GlslShader, QShaderVersion(120) }); + targets.append({ QShader::HlslShader, QShaderVersion(50) }); + targets.append({ QShader::MslShader, QShaderVersion(12) }); + baker.setGeneratedShaders(targets); + s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 5); +} + +void tst_QShaderBaker::compileError() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/error.vert")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(!s.isValid()); + QVERIFY(!baker.errorMessage().isEmpty()); + qDebug() << baker.errorMessage(); +} + +void tst_QShaderBaker::translateError() +{ + // assume the shader here fails in SPIRV-Cross with "cbuffer cannot be expressed with either HLSL packing layout or packoffset" + // + // This has been improved in SPIRV-Cross, presumably by 0ac65a353e94e9756e8b89fa74e953c482a915e0, so skip this test. + QSKIP("Not applicable with updated SPIRV-Cross"); + + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/hlsl_cbuf_error.frag")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::HlslShader, QShaderVersion(50) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(!s.isValid()); + QVERIFY(!baker.errorMessage().isEmpty()); + qDebug() << baker.errorMessage(); +} + +void tst_QShaderBaker::genVariants() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/color.vert")); + baker.setGeneratedShaderVariants({ + QShader::StandardShader, + QShader::BatchableVertexShader + }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs) }); + targets.append({ QShader::GlslShader, QShaderVersion(330) }); + targets.append({ QShader::GlslShader, QShaderVersion(120) }); + targets.append({ QShader::HlslShader, QShaderVersion(50) }); + targets.append({ QShader::MslShader, QShaderVersion(12) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 2 * 6); + + int batchableVariantCount = 0; + int batchableGlslVariantCount = 0; + for (const QShaderKey &key : s.availableShaders()) { + if (key.sourceVariant() == QShader::BatchableVertexShader) { + ++batchableVariantCount; + if (key.source() == QShader::GlslShader) { + ++batchableGlslVariantCount; + const QByteArray src = s.shader(key).shader(); + QVERIFY(src.contains(QByteArrayLiteral("_qt_order * "))); + } + } else { + if (key.source() == QShader::GlslShader) { + // make sure it did not get rewritten + const QByteArray src = s.shader(key).shader(); + QVERIFY(!src.contains(QByteArrayLiteral("_qt_order * "))); + } + } + } + QCOMPARE(batchableVariantCount, 6); + QCOMPARE(batchableGlslVariantCount, 3); +} + +void tst_QShaderBaker::defines() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/defines.frag")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + baker.setGeneratedShaders({ { QShader::SpirvShader, QShaderVersion(100) } }); + QShader s = baker.bake(); + QVERIFY(!s.isValid()); + QVERIFY(!baker.errorMessage().isEmpty()); + qDebug() << baker.errorMessage(); + + QByteArray preamble; + preamble = QByteArrayLiteral("#define DO_NOT_BREAK\n"); + baker.setPreamble(preamble); + s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + + QShaderDescription desc = s.description(); + QCOMPARE(desc.uniformBlocks().size(), 1); + QShaderDescription::UniformBlock blk = desc.uniformBlocks().first(); + QCOMPARE(blk.members.size(), 2); + bool opacity_ok = false; + for (int i = 0; i < blk.members.size(); ++i) { + const QShaderDescription::BlockVariable v = blk.members[i]; + if (v.name == QByteArrayLiteral("opacity")) { + opacity_ok = v.type == QShaderDescription::Vec4; + break; + } + } + QVERIFY(opacity_ok); + + preamble += QByteArrayLiteral("#define OPACITY_SIZE 1\n"); + baker.setPreamble(preamble); + s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + + desc = s.description(); + blk = desc.uniformBlocks().first(); + opacity_ok = false; + for (int i = 0; i < blk.members.size(); ++i) { + const QShaderDescription::BlockVariable v = blk.members[i]; + if (v.name == QByteArrayLiteral("opacity")) { + opacity_ok = v.type == QShaderDescription::Float; + break; + } + } + QVERIFY(opacity_ok); +} + +void tst_QShaderBaker::reflectArrayOfStructInBlock() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/array_of_struct_in_ubuf.frag")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs) }); + targets.append({ QShader::GlslShader, QShaderVersion(120) }); + targets.append({ QShader::GlslShader, QShaderVersion(150) }); + targets.append({ QShader::HlslShader, QShaderVersion(50) }); + targets.append({ QShader::MslShader, QShaderVersion(12) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + + QShaderDescription desc = s.description(); + + QCOMPARE(desc.inputVariables().size(), 3); + QCOMPARE(desc.outputVariables().size(), 1); + QCOMPARE(desc.uniformBlocks().size(), 1); + + const QList inputs = desc.inputVariables(); + for (const auto &var : inputs) { + switch (var.location) { + case 0: + QCOMPARE(var.name, QByteArrayLiteral("vECVertNormal")); + QCOMPARE(var.type, QShaderDescription::Vec3); + break; + case 1: + QCOMPARE(var.name, QByteArrayLiteral("vECVertPos")); + QCOMPARE(var.type, QShaderDescription::Vec3); + break; + case 2: + QCOMPARE(var.name, QByteArrayLiteral("vDiffuseAdjust")); + QCOMPARE(var.type, QShaderDescription::Vec3); + break; + default: + QFAIL(qPrintable(QStringLiteral("Unexpected input variable: %1").arg(var.location))); + return; + } + } + + const QList outputs = desc.outputVariables(); + QCOMPARE(outputs.first().location, 0); + QCOMPARE(outputs.first().name, QByteArrayLiteral("fragColor")); + QCOMPARE(outputs.first().type, QShaderDescription::Vec4); + + const QList ublocks = desc.uniformBlocks(); + const QShaderDescription::UniformBlock ub = ublocks.first(); + QCOMPARE(ub.binding, 1); + QCOMPARE(ub.blockName, QByteArrayLiteral("buf")); + QCOMPARE(ub.structName, QByteArrayLiteral("ubuf")); + QCOMPARE(ub.size, 768); + QCOMPARE(ub.members.size(), 7); + + for (const QShaderDescription::BlockVariable &var : ub.members) { + if (var.name == QByteArrayLiteral("ECCameraPosition")) { + QCOMPARE(var.offset, 0); + QCOMPARE(var.size, 12); + QCOMPARE(var.type, QShaderDescription::Vec3); + } else if (var.name == QByteArrayLiteral("ka")) { + QCOMPARE(var.offset, 16); + QCOMPARE(var.size, 12); + QCOMPARE(var.type, QShaderDescription::Vec3); + } else if (var.name == QByteArrayLiteral("kd")) { + QCOMPARE(var.offset, 32); + QCOMPARE(var.size, 12); + QCOMPARE(var.type, QShaderDescription::Vec3); + } else if (var.name == QByteArrayLiteral("ks")) { + QCOMPARE(var.offset, 48); + QCOMPARE(var.size, 12); + QCOMPARE(var.type, QShaderDescription::Vec3); + } else if (var.name == QByteArrayLiteral("numLights")) { + QCOMPARE(var.offset, 704); + QCOMPARE(var.size, 4); + QCOMPARE(var.type, QShaderDescription::Int); + } else if (var.name == QByteArrayLiteral("mm")) { + QCOMPARE(var.offset, 720); + QCOMPARE(var.size, 48); + QCOMPARE(var.type, QShaderDescription::Mat3); + QCOMPARE(var.matrixStride, 16); + QCOMPARE(var.matrixIsRowMajor, true); + } else if (var.name == QByteArrayLiteral("lights")) { + QCOMPARE(var.offset, 64); + QCOMPARE(var.size, 640); + QCOMPARE(var.type, QShaderDescription::Struct); + QCOMPARE(var.arrayDims, QList() << 10); + QCOMPARE(var.structMembers.size(), 8); + for (const QShaderDescription::BlockVariable &structVar : var.structMembers) { + if (structVar.name == QByteArrayLiteral("ECLightPosition")) { + QCOMPARE(structVar.offset, 0); + QCOMPARE(structVar.size, 12); + QCOMPARE(structVar.type, QShaderDescription::Vec3); + } else if (structVar.name == QByteArrayLiteral("attenuation")) { + QCOMPARE(structVar.offset, 16); + QCOMPARE(structVar.size, 12); + QCOMPARE(structVar.type, QShaderDescription::Vec3); + } else if (structVar.name == QByteArrayLiteral("color")) { + QCOMPARE(structVar.offset, 32); + QCOMPARE(structVar.size, 12); + QCOMPARE(structVar.type, QShaderDescription::Vec3); + } else if (structVar.name == QByteArrayLiteral("intensity")) { + QCOMPARE(structVar.offset, 48); + QCOMPARE(structVar.size, 4); + QCOMPARE(structVar.type, QShaderDescription::Float); + } else if (structVar.name == QByteArrayLiteral("specularExp")) { + QCOMPARE(structVar.offset, 52); + QCOMPARE(structVar.size, 4); + QCOMPARE(structVar.type, QShaderDescription::Float); + } else if (structVar.name == QByteArrayLiteral("padding1")) { + QCOMPARE(structVar.offset, 12); + QCOMPARE(structVar.size, 4); + QCOMPARE(structVar.type, QShaderDescription::Float); + } else if (structVar.name == QByteArrayLiteral("padding2")) { + QCOMPARE(structVar.offset, 28); + QCOMPARE(structVar.size, 4); + QCOMPARE(structVar.type, QShaderDescription::Float); + } else if (structVar.name == QByteArrayLiteral("padding3")) { + QCOMPARE(structVar.offset, 44); + QCOMPARE(structVar.size, 4); + QCOMPARE(structVar.type, QShaderDescription::Float); + } else { + QFAIL(qPrintable( + QStringLiteral( + "Unexpected member in 'lights' struct in uniform block: %1") + .arg(structVar.name))); + } + } + } else { + QFAIL(qPrintable(QStringLiteral("Unexpected uniform block member: %1").arg(var.name))); + } + } +} + +void tst_QShaderBaker::reflectCombinedImageSampler() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/sgtexture.frag")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs) }); + targets.append({ QShader::GlslShader, QShaderVersion(120) }); + targets.append({ QShader::GlslShader, QShaderVersion(150) }); + targets.append({ QShader::HlslShader, QShaderVersion(50) }); + targets.append({ QShader::MslShader, QShaderVersion(12) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + + QShaderDescription desc = s.description(); + QCOMPARE(desc.inputVariables().size(), 1); + QCOMPARE(desc.outputVariables().size(), 1); + QCOMPARE(desc.uniformBlocks().size(), 1); + QCOMPARE(desc.combinedImageSamplers().size(), 2); + + auto inputVar = desc.inputVariables().first(); + QCOMPARE(inputVar.location, 0); + QCOMPARE(inputVar.name, QByteArrayLiteral("qt_TexCoord")); + QCOMPARE(inputVar.type, QShaderDescription::Vec2); + + auto outputVar = desc.outputVariables().first(); + QCOMPARE(outputVar.location, 0); + QCOMPARE(outputVar.name, QByteArrayLiteral("fragColor")); + QCOMPARE(outputVar.type, QShaderDescription::Vec4); + + auto block = desc.uniformBlocks().first(); + QCOMPARE(block.binding, 0); + QCOMPARE(block.size, 68); + QCOMPARE(block.blockName, QByteArrayLiteral("buf")); + QCOMPARE(block.structName, QByteArrayLiteral("ubuf")); + QCOMPARE(block.members.size(), 2); + for (int i = 0; i < block.members.size(); ++i) { + const QShaderDescription::BlockVariable &blockVar(block.members[i]); + switch (i) { + case 0: + QCOMPARE(blockVar.name, QByteArrayLiteral("qt_Matrix")); + QCOMPARE(blockVar.offset, 0); + QCOMPARE(blockVar.size, 64); + QCOMPARE(blockVar.type, QShaderDescription::Mat4); + QCOMPARE(blockVar.matrixStride, 16); + QCOMPARE(blockVar.matrixIsRowMajor, false); + break; + case 1: + QCOMPARE(blockVar.name, QByteArrayLiteral("opacity")); + QCOMPARE(blockVar.offset, 64); + QCOMPARE(blockVar.size, 4); + QCOMPARE(blockVar.type, QShaderDescription::Float); + break; + default: + break; + } + } + + for (const QShaderDescription::InOutVariable &imSampVar : desc.combinedImageSamplers()) { + switch (imSampVar.binding) { + case 1: + QCOMPARE(imSampVar.name, QByteArrayLiteral("qt_Texture")); + QCOMPARE(imSampVar.type, QShaderDescription::Sampler2D); + break; + case 2: + QCOMPARE(imSampVar.name, QByteArrayLiteral("t1")); + QCOMPARE(imSampVar.type, QShaderDescription::Sampler2D); + break; + default: + QFAIL(qPrintable(QStringLiteral("Unexpected combined image sampler: %1") + .arg(imSampVar.binding))); + return; + } + } +} + +void tst_QShaderBaker::mslNativeBindingMap() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/sgtexture.frag")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs) }); + targets.append({ QShader::GlslShader, QShaderVersion(120) }); + targets.append({ QShader::GlslShader, QShaderVersion(150) }); + targets.append({ QShader::HlslShader, QShaderVersion(50) }); + targets.append({ QShader::MslShader, QShaderVersion(12) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + + const QShaderKey mslShaderKey(QShader::MslShader, QShaderVersion(12)); + QVERIFY(!s.nativeResourceBindingMap(mslShaderKey).isEmpty()); + + QShader::NativeResourceBindingMap nativeBindingMap = s.nativeResourceBindingMap(mslShaderKey); + QCOMPARE(nativeBindingMap.size(), 3); + QVERIFY(nativeBindingMap.contains(0)); // uniform block + QVERIFY(nativeBindingMap.contains(1)); // combined image sampler, maps to a texture and sampler in MSL + QVERIFY(nativeBindingMap.contains(2)); // same + + // MSL has per-resource namespaces + std::pair nativeBindingPair = nativeBindingMap.value(0); + QCOMPARE(nativeBindingPair.first, 0); // uniform buffer + + nativeBindingPair = nativeBindingMap.value(1); + QCOMPARE(nativeBindingPair.first, 0); // texture + QCOMPARE(nativeBindingPair.second, 0); // sampler + + nativeBindingPair = nativeBindingMap.value(2); + QCOMPARE(nativeBindingPair.first, 1); // texture + QCOMPARE(nativeBindingPair.second, 1); // sampler + + baker.setSourceFileName(QLatin1String(":/data/manyresources.frag")); + targets.clear(); + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::MslShader, QShaderVersion(12) }); + baker.setGeneratedShaders(targets); + s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + + nativeBindingMap = s.nativeResourceBindingMap(mslShaderKey); + QCOMPARE(nativeBindingMap.size(), 8); + + // rather won't compare with exact values, do not make assumptions, just + // make sure there is a valid value for each since all resources are used + // in the shader code + QVERIFY(nativeBindingMap.value(1).first != -1); + QVERIFY(nativeBindingMap.value(2).first != -1); + QVERIFY(nativeBindingMap.value(3).first != -1); + QVERIFY(nativeBindingMap.value(4).first != -1); + QVERIFY(nativeBindingMap.value(5).first != -1); + QVERIFY(nativeBindingMap.value(10).first != -1); + QVERIFY(nativeBindingMap.value(11).first != -1); + QVERIFY(nativeBindingMap.value(12).first != -1); +} + +void tst_QShaderBaker::hlslNativeBindingMap() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/manyresources.frag")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::HlslShader, QShaderVersion(50) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + + const QShaderKey shaderKey(QShader::HlslShader, QShaderVersion(50)); + QShader::NativeResourceBindingMap nativeBindingMap = s.nativeResourceBindingMap(shaderKey); + QCOMPARE(nativeBindingMap.size(), 8); + + // do not assume anything about the ordering, so verify that we have valid + // values, not the register binding values themselves + + // combined image samplers + QVERIFY(nativeBindingMap.value(1).first != -1); + QVERIFY(nativeBindingMap.value(1).second == nativeBindingMap.value(1).first); + QVERIFY(nativeBindingMap.value(2).first != -1); + QVERIFY(nativeBindingMap.value(2).second == nativeBindingMap.value(2).first); + QVERIFY(nativeBindingMap.value(3).first != -1); + QVERIFY(nativeBindingMap.value(3).second == nativeBindingMap.value(3).first); + + QVERIFY(nativeBindingMap.value(1).first != nativeBindingMap.value(2).first); + QVERIFY(nativeBindingMap.value(1).first != nativeBindingMap.value(3).first); + + // storage images + QVERIFY(nativeBindingMap.value(4).first != -1); + QVERIFY(nativeBindingMap.value(5).first != -1); + QVERIFY(nativeBindingMap.value(4).first != nativeBindingMap.value(5).first); + + // storage buffer + QVERIFY(nativeBindingMap.value(10).first != -1); + + // uniform buffers + QVERIFY(nativeBindingMap.value(11).first != -1); + QVERIFY(nativeBindingMap.value(12).first != -1); + QVERIFY(nativeBindingMap.value(11).first != nativeBindingMap.value(12).first); +} + +void tst_QShaderBaker::reflectArraysOfSamplers() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/arrays_of_samplers.frag")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs) }); + targets.append({ QShader::GlslShader, QShaderVersion(120) }); + targets.append({ QShader::GlslShader, QShaderVersion(150) }); + targets.append({ QShader::HlslShader, QShaderVersion(50) }); + targets.append({ QShader::MslShader, QShaderVersion(20) }); // arrays of textures needs MSL 2.0 + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(baker.errorMessage().isEmpty()); + QVERIFY(s.isValid()); + + QShaderDescription desc = s.description(); + + QCOMPARE(desc.inputVariables().size(), 1); + QCOMPARE(desc.outputVariables().size(), 1); + QCOMPARE(desc.combinedImageSamplers().size(), 4); + + for (const QShaderDescription::InOutVariable &var : desc.combinedImageSamplers()) { + switch (var.binding) { + case 4: + QCOMPARE(var.type, QShaderDescription::Sampler2D); + QVERIFY(var.arrayDims.isEmpty()); + break; + case 8: + QCOMPARE(var.type, QShaderDescription::Sampler2D); + QCOMPARE(var.arrayDims.size(), 1); + QCOMPARE(var.arrayDims.first(), 4); + break; + case 9: + QCOMPARE(var.type, QShaderDescription::SamplerCube); + QCOMPARE(var.arrayDims.size(), 1); + QCOMPARE(var.arrayDims.first(), 4); + break; + case 10: + QCOMPARE(var.type, QShaderDescription::Sampler2DArray); + QVERIFY(var.arrayDims.isEmpty()); + break; + default: + QFAIL(qPrintable(QStringLiteral("Wrong binding value: %1").arg(var.binding))); + } + } +} + +void tst_QShaderBaker::perTargetCompileMode() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/color_pertarget.vert")); + baker.setGeneratedShaderVariants({ + QShader::StandardShader, + QShader::BatchableVertexShader + }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs) }); + targets.append({ QShader::GlslShader, QShaderVersion(330) }); + targets.append({ QShader::GlslShader, QShaderVersion(120) }); + targets.append({ QShader::HlslShader, QShaderVersion(50) }); + targets.append({ QShader::MslShader, QShaderVersion(12) }); + baker.setGeneratedShaders(targets); + + baker.setPreamble(QByteArrayLiteral("#define MY_VALUE 321\n#define MY_MACRO\n")); + + baker.setPerTargetCompilation(true); + + QShader s = baker.bake(); + if (!s.isValid()) + qDebug() << baker.errorMessage(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 2 * 6); + + int batchableVariantCount = 0; + int batchableGlslVariantCount = 0; + for (const QShaderKey &key : s.availableShaders()) { + if (key.sourceVariant() == QShader::BatchableVertexShader) { + ++batchableVariantCount; + if (key.source() == QShader::GlslShader) { + ++batchableGlslVariantCount; + const QByteArray src = s.shader(key).shader(); + QVERIFY(src.contains(QByteArrayLiteral("_qt_order * "))); + } + } else { + if (key.source() == QShader::GlslShader) { + // make sure it did not get rewritten + const QByteArray src = s.shader(key).shader(); + QVERIFY(!src.contains(QByteArrayLiteral("_qt_order * "))); + } + } + } + QCOMPARE(batchableVariantCount, 6); + QCOMPARE(batchableGlslVariantCount, 3); + + // now compile something that succeeds only if the QSHADER_SPIRV macros are + // present as expected + baker.setSourceFileName(QLatin1String(":/data/color_spirv_only.vert")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + targets.clear(); + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + baker.setGeneratedShaders(targets); + baker.setPreamble(QByteArray()); + s = baker.bake(); + if (!s.isValid()) + qDebug() << baker.errorMessage(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 1); + + // now something similar, with GLSL. This will mean no QSHADER_SPIRV, + // QSHADER_HLSL, QSHADER_MSL are defined (and is an error if they are) + baker.setSourceFileName(QLatin1String(":/data/color_glsl_only.vert")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + targets.clear(); + targets.append({ QShader::GlslShader, QShaderVersion(330) }); + targets.append({ QShader::GlslShader, QShaderVersion(440) }); + baker.setGeneratedShaders(targets); + s = baker.bake(); + if (!s.isValid()) + qDebug() << baker.errorMessage(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 2); + + // HLSL 5.0 + MSL 1.2 (fails with others) + baker.setSourceFileName(QLatin1String(":/data/color_hlsl_msl_only.vert")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + targets.clear(); + targets.append({ QShader::HlslShader, QShaderVersion(50) }); + targets.append({ QShader::MslShader, QShaderVersion(12) }); + baker.setGeneratedShaders(targets); + s = baker.bake(); + if (!s.isValid()) + qDebug() << baker.errorMessage(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 2); +} + +void tst_QShaderBaker::serializeDeserialize() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/color.vert")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs) }); + targets.append({ QShader::GlslShader, QShaderVersion(120) }); + targets.append({ QShader::HlslShader, QShaderVersion(50) }); + targets.append({ QShader::MslShader, QShaderVersion(12) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 5); + + QByteArray data = s.serialized(); + QVERIFY(!data.isEmpty()); + + QShader s2; + QVERIFY(!s2.isValid()); + s2 = QShader::fromSerialized(data); + QVERIFY(s2.isValid()); + QCOMPARE(s, s2); +} + +void tst_QShaderBaker::spirvOptions() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/color.vert")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + baker.setGeneratedShaders(targets); + + // no options specified (no full debug info, no strip) + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 1); + const QShaderKey key(QShader::SpirvShader, QShaderVersion(100)); + QVERIFY(s.availableShaders().contains(key)); + QCOMPARE(s.shader(key).entryPoint(), "main"); + QByteArray bin = s.shader(key).shader(); + + // full debug info + baker.setSpirvOptions(QShaderBaker::SpirvOption::GenerateFullDebugInfo); + s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 1); + QCOMPARE(s.shader(key).entryPoint(), "main"); + QByteArray debugBin = s.shader(key).shader(); + + QVERIFY(bin != debugBin); + QVERIFY(debugBin.size() > bin.size()); + + // strip all (variable names, etc.) + baker.setSpirvOptions(QShaderBaker::SpirvOption::StripDebugAndVarInfo); + s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 1); + QCOMPARE(s.shader(key).entryPoint(), "main"); + QByteArray strippedBin = s.shader(key).shader(); + + QVERIFY(strippedBin != debugBin); + QVERIFY(debugBin.size() > strippedBin.size()); + QVERIFY(strippedBin != bin); + QVERIFY(bin.size() > strippedBin.size()); +} + +void tst_QShaderBaker::separateImagesAndSamplers() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/combined_and_separate_samplers.frag")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs) }); + targets.append({ QShader::GlslShader, QShaderVersion(330) }); + targets.append({ QShader::HlslShader, QShaderVersion(50) }); + targets.append({ QShader::MslShader, QShaderVersion(12) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + + for (QShaderKey shaderKey : { + QShaderKey(QShader::HlslShader, QShaderVersion(50)), + QShaderKey(QShader::MslShader, QShaderVersion(12)) }) + { + QShader::NativeResourceBindingMap nativeBindingMap = s.nativeResourceBindingMap(shaderKey); + QCOMPARE(nativeBindingMap.size(), 4); + + // binding 1 is a combined image sampler + QVERIFY(nativeBindingMap.value(1).first != -1); + QVERIFY(nativeBindingMap.value(1).second != -1); + + // binding 2 is a separate image + QVERIFY(nativeBindingMap.value(2).first != -1); + // presumably binding 1 got t0, then this is probably t1, the point is that they should be something different + QVERIFY(nativeBindingMap.value(2).first != nativeBindingMap.value(1).first); + + // binding 3 is a separate sampler + QVERIFY(nativeBindingMap.value(3).first != -1); + + // binding 4 as well + QVERIFY(nativeBindingMap.value(4).first != -1); + QVERIFY(nativeBindingMap.value(4).first != nativeBindingMap.value(3).first); + + QVERIFY(s.separateToCombinedImageSamplerMappingList(shaderKey).isEmpty()); + } + + // Now onto to the real special deal here: OpenGL. That has its own mapping + // table because SPIRV-Cross auto-generates a "combined image sampler" + // (e.g. a sampler2D) for each separate texture+sampler combination. + for (QShaderKey shaderKey : { + QShaderKey(QShader::GlslShader, QShaderVersion(330)), + QShaderKey(QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs)) }) + { + QShader::SeparateToCombinedImageSamplerMappingList list = s.separateToCombinedImageSamplerMappingList(shaderKey); + QCOMPARE(list.size(), 2); + for (int i = 0; i < list.size(); ++i) { + int tbinding = list.at(i).textureBinding; + int sbinding = list.at(i).samplerBinding; + QCOMPARE(tbinding, 2); + QVERIFY(sbinding == 3 || sbinding == 4); + QByteArray combinedName = list.at(i).combinedSamplerName; + QVERIFY(!combinedName.isEmpty()); + } + + QVERIFY(s.nativeResourceBindingMap(shaderKey).isEmpty()); + } +} + +void tst_QShaderBaker::tessellationForMetalVertCompile() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/color.vert")); + baker.setGeneratedShaderVariants({ QShader::StandardShader, + QShader::NonIndexedVertexAsComputeShader, + QShader::UInt16IndexedVertexAsComputeShader, + QShader::UInt32IndexedVertexAsComputeShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::GlslShader, QShaderVersion(430) }); + targets.append({ QShader::MslShader, QShaderVersion(12) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QVERIFY(s.stage() == QShader::VertexStage); + + QCOMPARE(s.availableShaders().size(), 6); + QVERIFY(!s.shader(QShaderKey(QShader::MslShader, QShaderVersion(12), QShader::NonIndexedVertexAsComputeShader)).shader().isEmpty()); + QVERIFY(!s.shader(QShaderKey(QShader::MslShader, QShaderVersion(12), QShader::UInt16IndexedVertexAsComputeShader)).shader().isEmpty()); + QVERIFY(!s.shader(QShaderKey(QShader::MslShader, QShaderVersion(12), QShader::UInt32IndexedVertexAsComputeShader)).shader().isEmpty()); + + QShaderDescription desc = s.description(); + QCOMPARE(desc.outputBuiltinVariables().size(), 1); + QCOMPARE(desc.outputBuiltinVariables()[0].type, QShaderDescription::PositionBuiltin); + + QShader::NativeShaderInfo info = s.nativeShaderInfo(QShaderKey(QShader::MslShader, QShaderVersion(12), QShader::NonIndexedVertexAsComputeShader)); + QCOMPARE(info.extraBufferBindings.size(), 1); + QVERIFY(info.extraBufferBindings.value(QShaderPrivate::MslTessVertTescOutputBufferBinding, -1) >= 0); + + info = s.nativeShaderInfo(QShaderKey(QShader::MslShader, QShaderVersion(12), QShader::UInt32IndexedVertexAsComputeShader)); + QCOMPARE(info.extraBufferBindings.size(), 2); + const int outVertBufIndex = info.extraBufferBindings.value(QShaderPrivate::MslTessVertTescOutputBufferBinding, -1); + QVERIFY(outVertBufIndex >= 0); + QVERIFY(info.extraBufferBindings.value(QShaderPrivate::MslTessVertIndicesBufferBinding, -1) >= 0); + QVERIFY(info.extraBufferBindings.value(QShaderPrivate::MslTessVertIndicesBufferBinding, -1) != outVertBufIndex); +} + +void tst_QShaderBaker::tessellationCompile() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/tess.tesc")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::GlslShader, QShaderVersion(430) }); + targets.append({ QShader::MslShader, QShaderVersion(12) }); + baker.setGeneratedShaders(targets); + baker.setTessellationMode(QShaderDescription::TrianglesTessellationMode); + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(s.stage() == QShader::TessellationControlStage); + QVERIFY(baker.errorMessage().isEmpty()); + + QCOMPARE(s.availableShaders().size(), 3); + QShaderDescription desc = s.description(); + // builtins are expected to be stored sorted by type + QCOMPARE(desc.inputBuiltinVariables()[0].type, QShaderDescription::PositionBuiltin); + QCOMPARE(desc.inputBuiltinVariables()[1].type, QShaderDescription::InvocationIdBuiltin); + QCOMPARE(desc.outputBuiltinVariables()[0].type, QShaderDescription::PositionBuiltin); + QCOMPARE(desc.outputBuiltinVariables()[1].type, QShaderDescription::TessLevelOuterBuiltin); + QCOMPARE(desc.outputBuiltinVariables()[2].type, QShaderDescription::TessLevelInnerBuiltin); + + QCOMPARE(desc.tessellationOutputVertexCount(), uint(3)); + + QCOMPARE(desc.outputVariables().size(), 3); + for (const QShaderDescription::InOutVariable &v : desc.outputVariables()) { + switch (v.location) { + case 0: + QCOMPARE(v.name, QByteArrayLiteral("outColor")); + QCOMPARE(v.type, QShaderDescription::Vec3); + QCOMPARE(v.perPatch, false); + break; + case 1: + QCOMPARE(v.name, QByteArrayLiteral("stuff")); + QCOMPARE(v.type, QShaderDescription::Vec3); + QCOMPARE(v.perPatch, true); + break; + case 2: + QCOMPARE(v.name, QByteArrayLiteral("more_stuff")); + QCOMPARE(v.type, QShaderDescription::Float); + QCOMPARE(v.perPatch, true); + break; + default: + QFAIL(qPrintable(QStringLiteral("Bad location: %1").arg(v.location))); + break; + } + } + + QVERIFY(s.shader(QShaderKey(QShader::MslShader, QShaderVersion(12))).shader().contains(QByteArrayLiteral("MTLTriangleTessellationFactorsHalf"))); + + QCOMPARE(s.nativeShaderInfo(QShaderKey(QShader::MslShader, QShaderVersion(12))).extraBufferBindings.size(), 5); + + baker.setSourceFileName(QLatin1String(":/data/tess.tese")); + baker.setGeneratedShaders(targets); + baker.setTessellationOutputVertexCount(3); + s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(s.stage() == QShader::TessellationEvaluationStage); + QVERIFY(baker.errorMessage().isEmpty()); + + QCOMPARE(s.availableShaders().size(), 3); + desc = s.description(); + QCOMPARE(desc.inputBuiltinVariables()[0].type, QShaderDescription::PositionBuiltin); + QCOMPARE(desc.inputBuiltinVariables()[1].type, QShaderDescription::TessLevelOuterBuiltin); + QCOMPARE(desc.inputBuiltinVariables()[2].type, QShaderDescription::TessLevelInnerBuiltin); + QCOMPARE(desc.inputBuiltinVariables()[3].type, QShaderDescription::TessCoordBuiltin); + + QCOMPARE(desc.tessellationMode(), QShaderDescription::TrianglesTessellationMode); + QCOMPARE(desc.tessellationWindingOrder(), QShaderDescription::CcwTessellationWindingOrder); + QCOMPARE(desc.tessellationPartitioning(), QShaderDescription::FractionalOddTessellationPartitioning); + + QCOMPARE(desc.inputVariables().size(), 3); + for (const QShaderDescription::InOutVariable &v : desc.inputVariables()) { + switch (v.location) { + case 0: + QCOMPARE(v.name, QByteArrayLiteral("inColor")); + QCOMPARE(v.type, QShaderDescription::Vec3); + QCOMPARE(v.perPatch, false); + break; + case 1: + QCOMPARE(v.name, QByteArrayLiteral("stuff")); + QCOMPARE(v.type, QShaderDescription::Vec3); + QCOMPARE(v.perPatch, true); + break; + case 2: + QCOMPARE(v.name, QByteArrayLiteral("more_stuff")); + QCOMPARE(v.type, QShaderDescription::Float); + QCOMPARE(v.perPatch, true); + break; + default: + QFAIL(qPrintable(QStringLiteral("Bad location: %1").arg(v.location))); + break; + } + } + + // the uniform buffer binding -> Metal buffer index mapping + QCOMPARE(s.nativeResourceBindingMap(QShaderKey(QShader::MslShader, QShaderVersion(12))).size(), 1); + QCOMPARE(s.nativeResourceBindingMap(QShaderKey(QShader::MslShader, QShaderVersion(12))).value(0), std::make_pair(0, -1)); + + QVERIFY(s.shader(QShaderKey(QShader::MslShader, QShaderVersion(12))).shader().contains(QByteArrayLiteral("[[ patch(triangle, 3) ]]"))); +} + +void tst_QShaderBaker::tessellationCompileWithChangedTessArgs() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/tess.tesc")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::MslShader, QShaderVersion(12) }); + baker.setGeneratedShaders(targets); + + // not what the .tese would say but let's pretend + baker.setTessellationMode(QShaderDescription::QuadTessellationMode); + + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + + QVERIFY(s.shader(QShaderKey(QShader::MslShader, QShaderVersion(12))).shader().contains(QByteArrayLiteral("MTLQuadTessellationFactorsHalf"))); + + baker.setSourceFileName(QLatin1String(":/data/tess.tese")); + baker.setGeneratedShaders(targets); + + baker.setTessellationOutputVertexCount(13); + + s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(s.stage() == QShader::TessellationEvaluationStage); + QVERIFY(baker.errorMessage().isEmpty()); + + QVERIFY(s.shader(QShaderKey(QShader::MslShader, QShaderVersion(12))).shader().contains(QByteArrayLiteral("[[ patch(triangle, 13) ]]"))); +} + +void tst_QShaderBaker::dontBreakOnTranslationError() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/texturesize.frag")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + + QVector targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::GlslShader, QShaderVersion(300, QShaderVersion::GlslEs) }); + targets.append({ QShader::GlslShader, QShaderVersion(120) }); + targets.append({ QShader::HlslShader, QShaderVersion(50) }); + targets.append({ QShader::MslShader, QShaderVersion(12) }); + baker.setGeneratedShaders(targets); + + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QCOMPARE(s.availableShaders().size(), 5); + QVERIFY(baker.errorMessage().isEmpty()); + + // now add a problematic target (no textureSize() in GLSL ES 100) + targets.append({ QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs) }); + baker.setGeneratedShaders(targets); + + QVERIFY(!baker.bake().isValid()); + QVERIFY(!baker.errorMessage().isEmpty()); + + // now make it succeed by skipping the failing targets + baker.setBreakOnShaderTranslationError(false); + s = baker.bake(); + QVERIFY(s.isValid()); + + // somewhat undocumented but the error message still contains the + // SPIRV-Cross error message about GLSL ES 100 even though the + // baking succeeded + QVERIFY(!baker.errorMessage().isEmpty()); + + QCOMPARE(s.availableShaders().size(), 5); +} + + +void tst_QShaderBaker::storageImageFlags() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/imageloadstore.comp")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + + QVector targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + baker.setGeneratedShaders(targets); + + QShader s = baker.bake(); + QVERIFY(s.isValid()); + + QCOMPARE(s.description().storageImages().size(), 4); + + QCOMPARE(s.description().storageImages().at(0).binding, 0); + QCOMPARE(s.description().storageImages().at(0).imageFlags, QShaderDescription::ImageFlags()); + + QCOMPARE(s.description().storageImages().at(1).binding, 1); + QCOMPARE(s.description().storageImages().at(1).imageFlags, + QShaderDescription::ImageFlags(QShaderDescription::ImageFlag::WriteOnlyImage)); + + QCOMPARE(s.description().storageImages().at(2).binding, 2); + QCOMPARE(s.description().storageImages().at(2).imageFlags, + QShaderDescription::ImageFlags(QShaderDescription::ImageFlag::ReadOnlyImage)); + + QCOMPARE(s.description().storageImages().at(3).binding, 3); + QCOMPARE(s.description().storageImages().at(3).imageFlags, + QShaderDescription::ImageFlags(QShaderDescription::ImageFlag::ReadOnlyImage + | QShaderDescription::ImageFlag::WriteOnlyImage)); +} + +void tst_QShaderBaker::storageBufferRuntimeArrayStride() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/storagebuffer.comp")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + + QVector targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + baker.setGeneratedShaders(targets); + + QShader s = baker.bake(); + QVERIFY(s.isValid()); + + QCOMPARE(s.description().storageBlocks().size(), 8); + + QCOMPARE(s.description().storageBlocks().at(0).binding, 0); + QCOMPARE(s.description().storageBlocks().at(0).runtimeArrayStride, 4); + + QCOMPARE(s.description().storageBlocks().at(1).binding, 1); + QCOMPARE(s.description().storageBlocks().at(1).runtimeArrayStride, 16); + + QCOMPARE(s.description().storageBlocks().at(2).binding, 2); + QCOMPARE(s.description().storageBlocks().at(2).runtimeArrayStride, 8); + + QCOMPARE(s.description().storageBlocks().at(3).binding, 3); + QCOMPARE(s.description().storageBlocks().at(3).runtimeArrayStride, 16); + + QCOMPARE(s.description().storageBlocks().at(4).binding, 4); + QCOMPARE(s.description().storageBlocks().at(4).runtimeArrayStride, 16); + + QCOMPARE(s.description().storageBlocks().at(5).binding, 5); + QCOMPARE(s.description().storageBlocks().at(5).runtimeArrayStride, 16); + + QCOMPARE(s.description().storageBlocks().at(6).binding, 6); + QCOMPARE(s.description().storageBlocks().at(6).runtimeArrayStride, 16); + + QCOMPARE(s.description().storageBlocks().at(7).binding, 7); + QCOMPARE(s.description().storageBlocks().at(7).runtimeArrayStride, 16); +} + +void tst_QShaderBaker::storageBufferQualifiers() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/storagebuffer.comp")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + + QVector targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + baker.setGeneratedShaders(targets); + + QShader s = baker.bake(); + QVERIFY(s.isValid()); + + // GLSL 4.60 Specification - Section 4.10 Memory Qualifiers: + // Since the external source reading or writing a volatile variable may be another shader + // invocation, variables declared as volatile are automatically treated as coherent. + + QCOMPARE(s.description().storageBlocks().size(), 8); + + QCOMPARE(s.description().storageBlocks().at(0).binding, 0); + QCOMPARE(s.description().storageBlocks().at(0).qualifierFlags, + QShaderDescription::QualifierFlags()); + + QCOMPARE(s.description().storageBlocks().at(1).binding, 1); + QCOMPARE(s.description().storageBlocks().at(1).qualifierFlags, + QShaderDescription::QualifierFlags(QShaderDescription::QualifierCoherent)); + + QCOMPARE(s.description().storageBlocks().at(2).binding, 2); + QCOMPARE(s.description().storageBlocks().at(2).qualifierFlags, + QShaderDescription::QualifierFlags(QShaderDescription::QualifierWriteOnly + | QShaderDescription::QualifierVolatile + | QShaderDescription::QualifierCoherent)); + + QCOMPARE(s.description().storageBlocks().at(3).binding, 3); + QCOMPARE(s.description().storageBlocks().at(3).qualifierFlags, + QShaderDescription::QualifierFlags(QShaderDescription::QualifierWriteOnly + | QShaderDescription::QualifierRestrict)); + + QCOMPARE(s.description().storageBlocks().at(4).binding, 4); + QCOMPARE(s.description().storageBlocks().at(4).qualifierFlags, + QShaderDescription::QualifierFlags(QShaderDescription::QualifierReadOnly)); + + QCOMPARE(s.description().storageBlocks().at(5).binding, 5); + QCOMPARE(s.description().storageBlocks().at(5).qualifierFlags, + QShaderDescription::QualifierFlags(QShaderDescription::QualifierReadOnly + | QShaderDescription::QualifierCoherent)); + + QCOMPARE(s.description().storageBlocks().at(6).binding, 6); + QCOMPARE(s.description().storageBlocks().at(6).qualifierFlags, + QShaderDescription::QualifierFlags(QShaderDescription::QualifierWriteOnly + | QShaderDescription::QualifierReadOnly + | QShaderDescription::QualifierVolatile + | QShaderDescription::QualifierCoherent)); + + QCOMPARE(s.description().storageBlocks().at(7).binding, 7); + QCOMPARE(s.description().storageBlocks().at(7).qualifierFlags, + QShaderDescription::QualifierFlags(QShaderDescription::QualifierWriteOnly + | QShaderDescription::QualifierReadOnly + | QShaderDescription::QualifierRestrict)); +} + +void tst_QShaderBaker::multiview() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/multiview_simple.vert")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + + QVector targets; + // SPV_KHR_multiview + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + // SV_ViewID is in shader model 6.1 + targets.append({ QShader::HlslShader, QShaderVersion(61) }); + // GL_OVR_multiview(2) is written for OpenGL 3.0 / OpenGL ES 3.0 and newer, just pick + // some GLSL versions accordingly for the test + targets.append({ QShader::GlslShader, QShaderVersion(150) }); + targets.append({ QShader::GlslShader, QShaderVersion(300, QShaderVersion::GlslEs) }); + baker.setGeneratedShaders(targets); + + // should fail due to GLSL + QShader s = baker.bake(); + QVERIFY(!s.isValid()); + QVERIFY(!baker.errorMessage().isEmpty()); + qDebug() << baker.errorMessage(); + + // now provide num_views and it should succeed + baker.setMultiViewCount(2); + s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); +} + +void tst_QShaderBaker::mediump() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/color.vert")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs) }); + targets.append({ QShader::GlslShader, QShaderVersion(120) }); + targets.append({ QShader::HlslShader, QShaderVersion(50) }); + targets.append({ QShader::MslShader, QShaderVersion(12) }); + + baker.setGlslOptions(QShaderBaker::GlslOption::GlslEsFragDefaultFloatPrecisionMedium); + + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 5); + QShaderCode shader = s.shader(QShaderKey(QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs))); + QVERIFY(!shader.shader().isEmpty()); + QVERIFY(!shader.shader().contains("precision ")); // no effect for vertex shaders + + baker.setSourceFileName(QLatin1String(":/data/color.frag")); + + s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 5); + shader = s.shader(QShaderKey(QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs))); + QVERIFY(!shader.shader().isEmpty()); + QVERIFY(shader.shader().contains("precision mediump float;")); + + // back to defaults + baker.setGlslOptions({}); + s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 5); + shader = s.shader(QShaderKey(QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs))); + QVERIFY(!shader.shader().isEmpty()); + QVERIFY(shader.shader().contains("precision highp float;")); +} + +void tst_QShaderBaker::geometryShader() +{ + QShaderBaker baker; + baker.setSourceFileName(QLatin1String(":/data/voxelize.geom")); + baker.setGeneratedShaderVariants({ QShader::StandardShader }); + QList targets; + targets.append({ QShader::SpirvShader, QShaderVersion(100) }); + targets.append({ QShader::GlslShader, QShaderVersion(410) }); + targets.append({ QShader::GlslShader, QShaderVersion(320, QShaderVersion::GlslEs) }); + targets.append({ QShader::HlslShader, QShaderVersion(50) }); + baker.setGeneratedShaders(targets); + QShader s = baker.bake(); + QVERIFY(s.isValid()); + QVERIFY(s.stage() == QShader::GeometryStage); + QVERIFY(baker.errorMessage().isEmpty()); + QCOMPARE(s.availableShaders().size(), 4); +} + + +#include +QTEST_MAIN(tst_QShaderBaker) diff --git a/local/recipes/qt/qtshadertools/source/tests/manual/qmlappshadermacro/CMakeLists.txt b/local/recipes/qt/qtshadertools/source/tests/manual/qmlappshadermacro/CMakeLists.txt new file mode 100644 index 0000000000..e357bc1602 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/manual/qmlappshadermacro/CMakeLists.txt @@ -0,0 +1,45 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) +project(contextinfo LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 COMPONENTS ShaderTools) + +qt6_add_executable(qmlappshadermacro + main.cpp +) +target_link_libraries(qmlappshadermacro PUBLIC + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +set(qmlappshadermacro_resource_files + "main.qml" +) + +qt6_add_resources(qmlappshadermacro "qmlappshadermacro" + PREFIX + "/" + FILES + ${qmlappshadermacro_resource_files} +) + +qt6_add_shaders(qmlappshadermacro "qmlappshadermacro_shaders" + PREFIX + "/" + FILES + "wobble.frag" +) diff --git a/local/recipes/qt/qtshadertools/source/tests/manual/qmlappshadermacro/main.cpp b/local/recipes/qt/qtshadertools/source/tests/manual/qmlappshadermacro/main.cpp new file mode 100644 index 0000000000..46aabea72c --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/manual/qmlappshadermacro/main.cpp @@ -0,0 +1,23 @@ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include +#include + +int main(int argc, char *argv[]) +{ + qputenv("QSG_INFO", "1"); + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QGuiApplication app(argc, argv); + + QQuickView view; + view.setColor(Qt::black); + view.setResizeMode(QQuickView::SizeRootObjectToView); + view.resize(1280, 720); + view.setSource(QUrl("qrc:/main.qml")); + view.show(); + + int r = app.exec(); + + return r; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/manual/qmlappshadermacro/main.qml b/local/recipes/qt/qtshadertools/source/tests/manual/qmlappshadermacro/main.qml new file mode 100644 index 0000000000..214377efbe --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/manual/qmlappshadermacro/main.qml @@ -0,0 +1,54 @@ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import QtQuick 2.15 + +Item { + Text { + color: "#ffffff" + style: Text.Outline + styleColor: "#606060" + font.pixelSize: 28 + property int api: GraphicsInfo.api + text: { + if (GraphicsInfo.api === GraphicsInfo.OpenGLRhi) + "OpenGL on QRhi"; + else if (GraphicsInfo.api === GraphicsInfo.Direct3D11Rhi) + "D3D11 on QRhi"; + else if (GraphicsInfo.api === GraphicsInfo.VulkanRhi) + "Vulkan on QRhi"; + else if (GraphicsInfo.api === GraphicsInfo.MetalRhi) + "Metal on QRhi"; + else if (GraphicsInfo.api === GraphicsInfo.Null) + "Null on QRhi"; + else + "Unknown API"; + } + } + + Text { + id: srcItem + text: "Hello world" + anchors.centerIn: parent + color: "red" + font.pixelSize: 40 + } + + ShaderEffectSource { + id: src + sourceItem: srcItem + anchors.fill: srcItem + hideSource: true + visible: false + } + + ShaderEffect { + anchors.fill: src + property variant source: src + property real amplitude: 0.04 + property real frequency: 5 + property real time: 0 + NumberAnimation on time { from: 0; to: Math.PI * 2; duration: 600; loops: -1 } + fragmentShader: "wobble.frag.qsb" + } +} diff --git a/local/recipes/qt/qtshadertools/source/tests/manual/qmlappshadermacro/wobble.frag b/local/recipes/qt/qtshadertools/source/tests/manual/qmlappshadermacro/wobble.frag new file mode 100644 index 0000000000..a34481c2f2 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/manual/qmlappshadermacro/wobble.frag @@ -0,0 +1,20 @@ +#version 440 + +layout(location = 0) in vec2 qt_TexCoord0; +layout(location = 0) out vec4 fragColor; + +layout(binding = 1) uniform sampler2D source; + +layout(std140, binding = 0) uniform buf { + mat4 qt_Matrix; + float qt_Opacity; + float amplitude; + float frequency; + float time; +} ubuf; + +void main() +{ + vec2 p = sin(ubuf.time + ubuf.frequency * qt_TexCoord0); + fragColor = texture(source, qt_TexCoord0 + ubuf.amplitude * vec2(p.y, -p.x)) * ubuf.qt_Opacity; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/array.frag b/local/recipes/qt/qtshadertools/source/tests/playground/array.frag new file mode 100644 index 0000000000..ef3df3d1a3 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/array.frag @@ -0,0 +1,49 @@ +#version 440 + +layout(location = 0) in vec3 vECVertNormal; +layout(location = 1) in vec3 vECVertPos; +layout(location = 2) flat in vec3 vDiffuseAdjust; + +#define MAX_LIGHTS 10 + +struct Light { + vec3 ECLightPosition; + vec3 attenuation; + vec3 color; + float intensity; + float specularExp; + // two dummies so that it stays translatable to HLSL with packoffset in the top-level block + float __dummy0; + float __dummy1; +}; + +layout(std140, binding = 1) uniform buf { + vec3 ECCameraPosition; + vec3 ka; + vec3 kd; + vec3 ks; + Light lights[MAX_LIGHTS]; + int numLights; + layout(row_major) mat3 mm; +} ubuf; + +layout(location = 0) out vec4 fragColor; + +void main() +{ + vec3 unnormL = ubuf.lights[0].ECLightPosition - vECVertPos; + float dist = length(unnormL); + float att = 1.0 / (ubuf.lights[0].attenuation.x + ubuf.lights[0].attenuation.y * dist + ubuf.lights[0].attenuation.z * dist * dist); + + vec3 N = normalize(vECVertNormal); + vec3 L = normalize(unnormL); + float NL = max(0.0, dot(N, L)); + vec3 dColor = att * ubuf.lights[0].intensity * ubuf.lights[0].color * NL; + + vec3 R = reflect(-L, N); + vec3 V = normalize(ubuf.ECCameraPosition - vECVertPos); + float RV = max(0.0, dot(R, V)); + vec3 sColor = att * ubuf.lights[0].intensity * ubuf.lights[0].color * pow(RV, ubuf.lights[0].specularExp); + + fragColor = vec4(ubuf.ka + (ubuf.kd + vDiffuseAdjust) * dColor + ubuf.ks * sColor, 1.0); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/arrays_of_samplers.frag b/local/recipes/qt/qtshadertools/source/tests/playground/arrays_of_samplers.frag new file mode 100644 index 0000000000..e6bcdbcb0c --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/arrays_of_samplers.frag @@ -0,0 +1,23 @@ +#version 440 + +layout(location = 0) in vec2 v_texcoord; + +layout(location = 0) out vec4 fragColor; + +layout(binding = 4) uniform sampler2D tex1; +layout(binding = 8) uniform sampler2D shadowMaps[4]; +layout(binding = 9) uniform samplerCube shadowCubes[4]; +layout(binding = 10) uniform sampler2D tex2; + +void main() +{ + fragColor = texture(tex1, v_texcoord) * texture(tex2, v_texcoord) + * texture(shadowMaps[0], v_texcoord) + * texture(shadowMaps[1], v_texcoord) + * texture(shadowMaps[2], v_texcoord) + * texture(shadowMaps[3], v_texcoord) + * texture(shadowCubes[0], vec3(v_texcoord, 0.0)) + * texture(shadowCubes[1], vec3(v_texcoord, 0.0)) + * texture(shadowCubes[2], vec3(v_texcoord, 0.0)) + * texture(shadowCubes[3], vec3(v_texcoord, 0.0)); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/cbuf.frag b/local/recipes/qt/qtshadertools/source/tests/playground/cbuf.frag new file mode 100644 index 0000000000..009144392f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/cbuf.frag @@ -0,0 +1,21 @@ +#version 440 + +layout(location = 0) in vec3 vECVertNormal; +layout(location = 1) in vec3 vECVertPos; + +layout(std140, binding = 1) uniform buf { + vec3 v; + float f; +} ubuf; + +layout(std140, binding = 2) uniform buf2 { + float f; + vec3 v; +} ubuf2; + +layout(location = 0) out vec4 fragColor; + +void main() +{ + fragColor = vec4(ubuf.v, ubuf.f); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/cbuf_without_inst.frag b/local/recipes/qt/qtshadertools/source/tests/playground/cbuf_without_inst.frag new file mode 100644 index 0000000000..de92e6893e --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/cbuf_without_inst.frag @@ -0,0 +1,17 @@ +#version 440 + +layout(std140, binding = 0) uniform buf1 { + vec3 v; + float f; +} ubuf1; + +layout(std140, binding = 1) uniform buf2 { + float f2; +}; // no instance name + +layout(location = 0) out vec4 fragColor; + +void main() +{ + fragColor = vec4(ubuf1.v, ubuf1.f + f2); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/color.frag b/local/recipes/qt/qtshadertools/source/tests/playground/color.frag new file mode 100644 index 0000000000..375587662f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/color.frag @@ -0,0 +1,10 @@ +#version 440 + +layout(location = 0) in vec3 v_color; + +layout(location = 0) out vec4 fragColor; + +void main() +{ + fragColor = vec4(v_color, 1.0); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/color.vert b/local/recipes/qt/qtshadertools/source/tests/playground/color.vert new file mode 100644 index 0000000000..02492c0e65 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/color.vert @@ -0,0 +1,18 @@ +#version 440 + +layout(location = 0) in vec4 position; +layout(location = 1) in vec3 color; + +layout(location = 0) out vec3 v_color; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; +} ubuf; + +out gl_PerVertex { vec4 gl_Position; }; + +void main() +{ + v_color = color; + gl_Position = ubuf.mvp * position; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/color_pc.frag b/local/recipes/qt/qtshadertools/source/tests/playground/color_pc.frag new file mode 100644 index 0000000000..3b04955963 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/color_pc.frag @@ -0,0 +1,12 @@ +#version 440 + +layout(push_constant) uniform PC { + layout(offset = 64) vec3 color; +} pc; + +layout(location = 0) out vec4 fragColor; + +void main() +{ + fragColor = vec4(pc.color, 1.0); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/color_pc.vert b/local/recipes/qt/qtshadertools/source/tests/playground/color_pc.vert new file mode 100644 index 0000000000..19bf815819 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/color_pc.vert @@ -0,0 +1,14 @@ +#version 440 + +layout(location = 0) in vec4 position; + +out gl_PerVertex { vec4 gl_Position; }; + +layout(push_constant) uniform PC { + mat4 mvp; +} pc; + +void main() +{ + gl_Position = pc.mvp * position; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/color_phong.frag b/local/recipes/qt/qtshadertools/source/tests/playground/color_phong.frag new file mode 100644 index 0000000000..8b0c715f3b --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/color_phong.frag @@ -0,0 +1,39 @@ +#version 440 + +layout(location = 0) in vec3 vECVertNormal; +layout(location = 1) in vec3 vECVertPos; +layout(location = 2) flat in vec3 vDiffuseAdjust; + +layout(std140, binding = 1) uniform buf { + vec3 ECCameraPosition; + vec3 ka; + vec3 kd; + vec3 ks; + // Have one light only for now. + vec3 ECLightPosition; + vec3 attenuation; + vec3 color; + float intensity; + float specularExp; +} ubuf; + +layout(location = 0) out vec4 fragColor; + +void main() +{ + vec3 unnormL = ubuf.ECLightPosition - vECVertPos; + float dist = length(unnormL); + float att = 1.0 / (ubuf.attenuation.x + ubuf.attenuation.y * dist + ubuf.attenuation.z * dist * dist); + + vec3 N = normalize(vECVertNormal); + vec3 L = normalize(unnormL); + float NL = max(0.0, dot(N, L)); + vec3 dColor = att * ubuf.intensity * ubuf.color * NL; + + vec3 R = reflect(-L, N); + vec3 V = normalize(ubuf.ECCameraPosition - vECVertPos); + float RV = max(0.0, dot(R, V)); + vec3 sColor = att * ubuf.intensity * ubuf.color * pow(RV, ubuf.specularExp); + + fragColor = vec4(ubuf.ka + (ubuf.kd + vDiffuseAdjust) * dColor + ubuf.ks * sColor, 1.0); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/color_phong.vert b/local/recipes/qt/qtshadertools/source/tests/playground/color_phong.vert new file mode 100644 index 0000000000..a1d1552685 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/color_phong.vert @@ -0,0 +1,32 @@ +#version 440 + +layout(location = 0) in vec4 position; +layout(location = 1) in vec3 normal; + +// Instanced attributes to variate the translation of the model and the diffuse +// color of the material. +layout(location = 2) in vec3 instTranslate; +layout(location = 3) in vec3 instDiffuseAdjust; + +out gl_PerVertex { vec4 gl_Position; }; +layout(location = 0) out vec3 vECVertNormal; +layout(location = 1) out vec3 vECVertPos; +layout(location = 2) flat out vec3 vDiffuseAdjust; + +layout(std140, binding = 0) uniform buf { + mat4 vp; + mat4 model; + mat3 modelNormal; +} ubuf; + +void main() +{ + vECVertNormal = normalize(ubuf.modelNormal * normal); + mat4 t = mat4(1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + instTranslate.x, instTranslate.y, instTranslate.z, 1); + vECVertPos = vec3(t * ubuf.model * position); + vDiffuseAdjust = instDiffuseAdjust; + gl_Position = ubuf.vp * t * ubuf.model * position; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/comp_buffer.comp b/local/recipes/qt/qtshadertools/source/tests/playground/comp_buffer.comp new file mode 100644 index 0000000000..4a7e0ce5e0 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/comp_buffer.comp @@ -0,0 +1,26 @@ +#version 440 + +layout (local_size_x = 256) in; + +struct Stuff { + vec2 a; + vec2 b; +}; + +layout(std140, binding = 0) buffer StuffSsbo +{ + vec4 whatever; + Stuff stuff[]; +} buf; + +void main() +{ + uint index = gl_GlobalInvocationID.x; + vec2 a = buf.stuff[index].a; + vec2 b = buf.stuff[index].b; + + a.x += 1.0; + buf.stuff[index].a = a; + b.y += 1.0; + buf.stuff[index].b = b; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/comp_image.comp b/local/recipes/qt/qtshadertools/source/tests/playground/comp_image.comp new file mode 100644 index 0000000000..a4aa01eeb7 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/comp_image.comp @@ -0,0 +1,12 @@ +#version 440 + +layout (local_size_x = 16, local_size_y = 16) in; + +layout (binding = 0, rgba8) uniform readonly image2D inputImage; +layout (binding = 1, rgba8) uniform writeonly image2D resultImage; + +void main() +{ + vec4 c = imageLoad(inputImage, ivec2(gl_GlobalInvocationID.x, gl_GlobalInvocationID.y)); + imageStore(resultImage, ivec2(gl_GlobalInvocationID.xy), c); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/externalsampler.frag b/local/recipes/qt/qtshadertools/source/tests/playground/externalsampler.frag new file mode 100644 index 0000000000..1e02fe3326 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/externalsampler.frag @@ -0,0 +1,10 @@ +#version 440 + +layout(location = 0) in vec2 textureCoords; +layout(location = 0) out vec4 fragColor; +layout(binding = 1) uniform sampler2D frameTexture; + +void main() +{ + fragColor = texture(frameTexture, textureCoords).bgra; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/externalsampler.vert b/local/recipes/qt/qtshadertools/source/tests/playground/externalsampler.vert new file mode 100644 index 0000000000..5420e20e00 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/externalsampler.vert @@ -0,0 +1,15 @@ +#version 440 + +layout(location = 0) in vec4 vertexCoordsArray; +layout(location = 1) in vec2 textureCoordArray; +layout(location = 0) out vec2 textureCoords; + +layout(std140, binding = 0) uniform buf { + mat4 texMatrix; +}; + +void main() +{ + gl_Position = vertexCoordsArray; + textureCoords = (texMatrix * vec4(textureCoordArray, 0.0, 1.0)).xy; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/externalsampler_gles.frag b/local/recipes/qt/qtshadertools/source/tests/playground/externalsampler_gles.frag new file mode 100644 index 0000000000..1bb8f19e79 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/externalsampler_gles.frag @@ -0,0 +1,9 @@ +#extension GL_OES_EGL_image_external : require + +varying highp vec2 textureCoords; +uniform samplerExternalOES frameTexture; + +void main() +{ + gl_FragColor = texture2D(frameTexture, textureCoords).bgra; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/fragcolor.inc b/local/recipes/qt/qtshadertools/source/tests/playground/fragcolor.inc new file mode 100644 index 0000000000..26ca2168de --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/fragcolor.inc @@ -0,0 +1 @@ + fragColor = vec4(v_color, 1.0); diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/hlsl_cbuf_error.frag b/local/recipes/qt/qtshadertools/source/tests/playground/hlsl_cbuf_error.frag new file mode 100644 index 0000000000..ba59ffa0ff --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/hlsl_cbuf_error.frag @@ -0,0 +1,47 @@ +#version 440 + +layout(location = 0) in vec3 vECVertNormal; +layout(location = 1) in vec3 vECVertPos; +layout(location = 2) flat in vec3 vDiffuseAdjust; + +#define MAX_LIGHTS 10 + +struct Light { + vec3 ECLightPosition; + vec3 attenuation; + vec3 color; + float intensity; + float specularExp; + // this is not translatable to HLSL +}; + +layout(std140, binding = 1) uniform buf { + vec3 ECCameraPosition; + vec3 ka; + vec3 kd; + vec3 ks; + Light lights[MAX_LIGHTS]; + int numLights; + layout(row_major) mat3 mm; +} ubuf; + +layout(location = 0) out vec4 fragColor; + +void main() +{ + vec3 unnormL = ubuf.lights[0].ECLightPosition - vECVertPos; + float dist = length(unnormL); + float att = 1.0 / (ubuf.lights[0].attenuation.x + ubuf.lights[0].attenuation.y * dist + ubuf.lights[0].attenuation.z * dist * dist); + + vec3 N = normalize(vECVertNormal); + vec3 L = normalize(unnormL); + float NL = max(0.0, dot(N, L)); + vec3 dColor = att * ubuf.lights[0].intensity * ubuf.lights[0].color * NL; + + vec3 R = reflect(-L, N); + vec3 V = normalize(ubuf.ECCameraPosition - vECVertPos); + float RV = max(0.0, dot(R, V)); + vec3 sColor = att * ubuf.lights[0].intensity * ubuf.lights[0].color * pow(RV, ubuf.lights[0].specularExp); + + fragColor = vec4(ubuf.ka + (ubuf.kd + vDiffuseAdjust) * dColor + ubuf.ks * sColor, 1.0); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/includetest.frag b/local/recipes/qt/qtshadertools/source/tests/playground/includetest.frag new file mode 100644 index 0000000000..99dceae1c1 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/includetest.frag @@ -0,0 +1,10 @@ +#version 440 +#extension GL_GOOGLE_include_directive : enable + +layout(location = 0) in vec3 v_color; +layout(location = 0) out vec4 fragColor; + +void main() +{ +#include "fragcolor.inc" +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/manyresources.frag b/local/recipes/qt/qtshadertools/source/tests/playground/manyresources.frag new file mode 100644 index 0000000000..3f399fe1e4 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/manyresources.frag @@ -0,0 +1,35 @@ +#version 440 + +layout(location = 0) in vec2 v_texcoord; + +layout(location = 0) out vec4 fragColor; + +layout(binding = 1) uniform sampler2D tex; +layout(binding = 2) uniform sampler2D tex2; +layout(binding = 3) uniform sampler2D tex3; + +layout (binding = 4, rgba8) uniform readonly image2D image0; +layout (binding = 5, rgba8) uniform writeonly image2D image1; + +layout(std140, binding = 10) buffer storageBuf { + vec4 whatever; +} buf; + +layout(std140, binding = 11) uniform buf { + mat4 mvp; +} ubuf; + +layout(std140, binding = 12) uniform buf2 { + float f; +} ubuf2; + +void main() +{ + vec4 c = texture(tex, v_texcoord) * texture(tex2, v_texcoord) * texture(tex3, v_texcoord); + c = ubuf.mvp * c; + c *= ubuf2.f; + c *= buf.whatever; + c += imageLoad(image0, ivec2(0, 0)); + imageStore(image1, ivec2(0, 0), c); + fragColor = c; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/multiple_sets.frag b/local/recipes/qt/qtshadertools/source/tests/playground/multiple_sets.frag new file mode 100644 index 0000000000..389253eea0 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/multiple_sets.frag @@ -0,0 +1,21 @@ +#version 440 + +layout(location = 0) in vec2 v_texcoord; + +layout(location = 0) out vec4 fragColor; + +layout(binding = 0) uniform sampler2D tex; +layout(std140, binding = 1) uniform buf { + vec4 color; +}; + +layout(set = 1, binding = 0) uniform sampler2D tex2; +layout(std140, set = 1, binding = 1) uniform buf2 { + vec4 color2; +}; +layout(set = 1, binding = 2) uniform sampler2D tex3; + +void main() +{ + fragColor = texture(tex, v_texcoord) * texture(tex2, v_texcoord) * color * color2 * texture(tex3, v_texcoord); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/multiview.frag b/local/recipes/qt/qtshadertools/source/tests/playground/multiview.frag new file mode 100644 index 0000000000..a20adcc22e --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/multiview.frag @@ -0,0 +1,17 @@ +#version 440 + +layout(location = 0) out vec4 fragColor; + +void main() +{ + // qsb on a fragment shader with --view-count should still work, even if it + // does not actually enable GL_EXT_multiview. (mainly due to OpenGL / + // SPIRV-Cross (?) issues due to only supporting gl_ViewIndex and co. in + // vertex shaders) It defines QSHADER_VIEW_COUNT however. +#if QSHADER_VIEW_COUNT < 2 + error, needs --view-count=2, or something is broken +#endif + // Should this (using gl_ViewIndex) work or not? + //fragColor = vec4(gl_ViewIndex, 0.0, 0.0, 1.0); + fragColor = vec4(1.0); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/multiview.vert b/local/recipes/qt/qtshadertools/source/tests/playground/multiview.vert new file mode 100644 index 0000000000..d19df6e723 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/multiview.vert @@ -0,0 +1,25 @@ +#version 440 +#extension GL_EXT_multiview : require + +// For HLSL, Shader Model 6.1 or higher is needed to transpile this. +// +// For OpenGL we'd need layout(num_views = 2) in; but that's not a thing with +// Vulkan so will rather rely on QShaderBaker/qsb passing the view count to +// SPIRV-Cross which then inserts the num_views line to the OpenGL-targeted GLSL +// code. To do this, run qsb with --view-count 2 +// +// Metal is currently unknown. It probably needs some additional options in the +// shader pipeline. Running with --msl 12 succeeds but the generated MSL code is +// not multiview-capable. To be investigated. + +layout(location = 0) in vec4 pos; + +layout(std140, binding = 0) uniform buf +{ + mat4 mvp[2]; +}; + +void main() +{ + gl_Position = mvp[gl_ViewIndex] * pos; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/preamble.frag b/local/recipes/qt/qtshadertools/source/tests/playground/preamble.frag new file mode 100644 index 0000000000..f7b30ef383 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/preamble.frag @@ -0,0 +1,17 @@ +#version 440 + +layout(location = 0) in vec2 v_texcoord; +layout(location = 0) out vec4 fragColor; + +// must be compiled with -DMAKE_IT_WORK -DYES_REALLY=99 + +#ifdef MAKE_IT_WORK +#if YES_REALLY > 98 +layout(binding = 1) uniform sampler2D tex; +#endif +#endif + +void main() +{ + fragColor = texture(tex, v_texcoord); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/sampler_arrays.frag b/local/recipes/qt/qtshadertools/source/tests/playground/sampler_arrays.frag new file mode 100644 index 0000000000..4c4240da59 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/sampler_arrays.frag @@ -0,0 +1,23 @@ +#version 440 + +layout(location = 0) in vec2 v_texcoord; + +layout(location = 0) out vec4 fragColor; + +layout(binding = 4) uniform sampler2D tex1; +layout(binding = 8) uniform sampler2DArray shadowMaps; +layout(binding = 9) uniform samplerCubeArray shadowCubes; +layout(binding = 10) uniform sampler2D tex2; + +void main() +{ + fragColor = texture(tex1, v_texcoord) * texture(tex2, v_texcoord) + * texture(shadowMaps, vec3(v_texcoord, 0.0)) + * texture(shadowMaps, vec3(v_texcoord, 1.0)) + * texture(shadowMaps, vec3(v_texcoord, 2.0)) + * texture(shadowMaps, vec3(v_texcoord, 3.0)) + * texture(shadowCubes, vec4(v_texcoord, 0.0, 0.0)) + * texture(shadowCubes, vec4(v_texcoord, 0.0, 1.0)) + * texture(shadowCubes, vec4(v_texcoord, 0.0, 2.0)) + * texture(shadowCubes, vec4(v_texcoord, 0.0, 3.0)); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/per_patch_output.tesc b/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/per_patch_output.tesc new file mode 100644 index 0000000000..688eca50c8 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/per_patch_output.tesc @@ -0,0 +1,23 @@ +#version 440 + +layout(vertices = 3) out; + +layout(location = 0) in vec3 inColor[]; + +layout(location = 0) patch out vec3 stuff; +layout(location = 1) patch out float more_stuff; + +void main() +{ + if (gl_InvocationID == 0) { + gl_TessLevelOuter[0] = 4.0; + gl_TessLevelOuter[1] = 4.0; + gl_TessLevelOuter[2] = 4.0; + + gl_TessLevelInner[0] = 4.0; + } + + gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position; + stuff = vec3(1.0); + more_stuff = stuff.x + 0.5; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/per_patch_output.tese b/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/per_patch_output.tese new file mode 100644 index 0000000000..97cfe7a529 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/per_patch_output.tese @@ -0,0 +1,23 @@ +#version 440 + +layout(triangles, fractional_odd_spacing, ccw) in; + +layout(location = 0) in vec3 inColor[]; + +layout(location = 1) patch in vec3 stuff; +layout(location = 2) patch in float more_stuff; + +layout(location = 0) out vec3 outColor; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; + float time; + float amplitude; +}; + +void main() +{ + gl_Position = mvp * ((gl_TessCoord.x * gl_in[0].gl_Position) + (gl_TessCoord.y * gl_in[1].gl_Position) + (gl_TessCoord.z * gl_in[2].gl_Position)); + gl_Position.x += sin(time + gl_Position.y) * amplitude * more_stuff * stuff.y; + outColor = gl_TessCoord.x * inColor[0] + gl_TessCoord.y * inColor[1] + gl_TessCoord.z * inColor[2]; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/test.frag b/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/test.frag new file mode 100644 index 0000000000..375587662f --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/test.frag @@ -0,0 +1,10 @@ +#version 440 + +layout(location = 0) in vec3 v_color; + +layout(location = 0) out vec4 fragColor; + +void main() +{ + fragColor = vec4(v_color, 1.0); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/test.tesc b/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/test.tesc new file mode 100644 index 0000000000..9cbf9c12c7 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/test.tesc @@ -0,0 +1,21 @@ +#version 440 + +layout(vertices = 3) out; + +layout(location = 0) in vec3 inColor[]; + +layout(location = 0) out vec3 outColor[]; + +void main() +{ + if (gl_InvocationID == 0) { + gl_TessLevelOuter[0] = 4.0; + gl_TessLevelOuter[1] = 4.0; + gl_TessLevelOuter[2] = 4.0; + + gl_TessLevelInner[0] = 4.0; + } + + gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position; + outColor[gl_InvocationID] = inColor[gl_InvocationID]; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/test.tese b/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/test.tese new file mode 100644 index 0000000000..c82344af8e --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/test.tese @@ -0,0 +1,20 @@ +#version 440 + +layout(triangles, fractional_odd_spacing, ccw) in; + +layout(location = 0) in vec3 inColor[]; + +layout(location = 0) out vec3 outColor; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; + float time; + float amplitude; +}; + +void main() +{ + gl_Position = mvp * ((gl_TessCoord.x * gl_in[0].gl_Position) + (gl_TessCoord.y * gl_in[1].gl_Position) + (gl_TessCoord.z * gl_in[2].gl_Position)); + gl_Position.x += sin(time + gl_Position.y) * amplitude; + outColor = gl_TessCoord.x * inColor[0] + gl_TessCoord.y * inColor[1] + gl_TessCoord.z * inColor[2]; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/test.vert b/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/test.vert new file mode 100644 index 0000000000..3838d2f3bb --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/test.vert @@ -0,0 +1,12 @@ +#version 440 + +layout(location = 0) in vec3 position; +layout(location = 1) in vec3 color; + +layout(location = 0) out vec3 v_color; + +void main() +{ + gl_Position = vec4(position, 1.0); + v_color = color; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/vs_with_gl_vertex_index.vert b/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/vs_with_gl_vertex_index.vert new file mode 100644 index 0000000000..624f2bcb26 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/tessellation/vs_with_gl_vertex_index.vert @@ -0,0 +1,210 @@ +#version 440 + +layout(std140, binding = 0) uniform buf { + mat4 qt_modelMatrix; + mat4 qt_viewMatrix; + mat4 qt_projectionMatrix; +#ifdef QSSG_PARTICLES_ENABLE_VERTEX_LIGHTING + // ParticleLightData struct + vec4 qt_pointLightPosition[4]; + vec4 qt_pointLightConstantAtt; + vec4 qt_pointLightLinearAtt; + vec4 qt_pointLightQuadAtt; + vec4 qt_pointLightColor[4]; + vec4 qt_spotLightPosition[4]; + vec4 qt_spotLightConstantAtt; + vec4 qt_spotLightLinearAtt; + vec4 qt_spotLightQuadAtt; + vec4 qt_spotLightColor[4]; + vec4 qt_spotLightDirection[4]; + vec4 qt_spotLightConeAngle; + vec4 qt_spotLightInnerConeAngle; +#endif + vec4 qt_spriteConfig; + vec3 qt_light_ambient_total; + vec2 qt_oneOverParticleImageSize; + uint qt_countPerSlice; + uint qt_lineSegmentCount; + float qt_billboard; + float qt_opacity; + float qt_alphaFade; + float qt_sizeModifier; + float qt_texcoordScale; +#ifdef QSSG_PARTICLES_ENABLE_VERTEX_LIGHTING + bool qt_pointLights; + bool qt_spotLights; +#endif +} ubuf; + +#ifdef QSSG_PARTICLES_ENABLE_VERTEX_LIGHTING +/* Simplified lighting for particles + * + * Treat particles as points -> do not take normal into account + * -> directional lights become ambient + * -> point lights only account for attenuation + * -> spotlights only account for attenuation and spot angles + */ +vec4 qt_attenuate4(in vec4 dist, in vec4 catt, in vec4 latt, in vec4 qatt) +{ + vec4 factors = catt + dist * latt + dist * dist * qatt; + return vec4(1.0) / factors; +} +vec3 qt_calcPointLights(in vec3 position) +{ + vec4 lengths = vec4(length(position - ubuf.qt_pointLightPosition[0].xyz), + length(position - ubuf.qt_pointLightPosition[1].xyz), + length(position - ubuf.qt_pointLightPosition[2].xyz), + length(position - ubuf.qt_pointLightPosition[3].xyz)); + vec4 attenuations = qt_attenuate4(lengths, ubuf.qt_pointLightConstantAtt, ubuf.qt_pointLightLinearAtt, ubuf.qt_pointLightQuadAtt); + + return ubuf.qt_pointLightColor[0].rgb * attenuations.x + ubuf.qt_pointLightColor[1].rgb * attenuations.y + ubuf.qt_pointLightColor[2].rgb * attenuations.z + ubuf.qt_pointLightColor[3].rgb * attenuations.w; +} +vec3 qt_calcSpotLights(in vec3 position) +{ + vec3 lightVector0 = position - ubuf.qt_spotLightPosition[0].xyz; + vec3 lightVector1 = position - ubuf.qt_spotLightPosition[1].xyz; + vec3 lightVector2 = position - ubuf.qt_spotLightPosition[2].xyz; + vec3 lightVector3 = position - ubuf.qt_spotLightPosition[3].xyz; + vec4 lengths = vec4(length(lightVector0), length(lightVector1), length(lightVector2), length(lightVector3)); + vec4 attenuations = qt_attenuate4(lengths, ubuf.qt_spotLightConstantAtt, ubuf.qt_spotLightLinearAtt, ubuf.qt_spotLightQuadAtt); + vec4 spots = vec4(acos(dot(normalize(lightVector0), normalize(ubuf.qt_spotLightDirection[0].xyz))), + acos(dot(normalize(lightVector1), normalize(ubuf.qt_spotLightDirection[1].xyz))), + acos(dot(normalize(lightVector2), normalize(ubuf.qt_spotLightDirection[2].xyz))), + acos(dot(normalize(lightVector3), normalize(ubuf.qt_spotLightDirection[3].xyz)))); + vec4 cones = vec4(1.0 - smoothstep(ubuf.qt_spotLightInnerConeAngle, ubuf.qt_spotLightConeAngle, spots)); + attenuations *= cones; + return ubuf.qt_spotLightColor[0].rgb * attenuations.x + ubuf.qt_spotLightColor[1].rgb * attenuations.y + ubuf.qt_spotLightColor[2].rgb * attenuations.z + ubuf.qt_spotLightColor[3].rgb * attenuations.w; +} +vec3 qt_calcLightColor(in vec3 position) +{ + vec3 color = vec3(0.0); + + if (ubuf.qt_pointLights) + color += qt_calcPointLights(position); + if (ubuf.qt_spotLights) + color += qt_calcSpotLights(position); + return color + ubuf.qt_light_ambient_total; +} +#endif // QSSG_PARTICLES_ENABLE_VERTEX_LIGHTING + +layout(binding = 2) uniform sampler2D qt_particleTexture; + +out gl_PerVertex { + vec4 gl_Position; +}; + +const uint particleSize = 4; + +struct Particle +{ + vec3 position; + float size; + vec4 color; + vec3 binormal; + float animationFrame; + float age; + float segmentLength; + vec2 unusedPadding; +}; + +vec2 qt_indexToUV(in uint index) +{ + uint v = index / ubuf.qt_countPerSlice; + uint u = index - ubuf.qt_countPerSlice * v; + return (vec2(u * particleSize, v) + vec2(0.5)) * ubuf.qt_oneOverParticleImageSize; +} + +Particle qt_loadParticle(in uint index) +{ + Particle p; + vec2 offset = qt_indexToUV(index); + vec4 p0 = texture(qt_particleTexture, offset); + vec4 p1 = texture(qt_particleTexture, vec2(offset.x + ubuf.qt_oneOverParticleImageSize.x, offset.y)); + vec4 p2 = texture(qt_particleTexture, vec2(offset.x + 2.0 * ubuf.qt_oneOverParticleImageSize.x, offset.y)); + vec4 p3 = texture(qt_particleTexture, vec2(offset.x + 3.0 * ubuf.qt_oneOverParticleImageSize.x, offset.y)); + + p.position = p0.xyz; + p.size = p0.w; + p.color = p1; + p.binormal = p2.xyz; + p.animationFrame = p2.w; + p.age = p3.x; + p.segmentLength = p3.y; + return p; +} + +mat3 qt_fromEulerRotation(in vec3 rotation) +{ + float a = cos(rotation.x); + float b = sin(rotation.x); + float c = cos(rotation.y); + float d = sin(rotation.y); + float e = cos(rotation.z); + float f = sin(rotation.z); + mat3 ret; + float bd = b*d; + float ad = a*d; + ret[0][0] = c * e; + ret[0][1] = -c * f; + ret[0][2] = d; + ret[1][0] = bd*e + a*f; + ret[1][1] = a*e - bd*f; + ret[1][2] = -b*c; + ret[2][0] = b*f - ad*e; + ret[2][1] = ad*f + b*e; + ret[2][2] = a*c; + return ret; +} + +float qt_ageToSpriteFactor(in float age) +{ + // Age should be [0, 1], but just in case take the fraction + return fract(age); +} + +float qt_calcAlphaFade(in uint segmentIndex) +{ + return pow(ubuf.qt_alphaFade, float(segmentIndex)); +} + +float qt_calcSizeFactor(in uint segmentIndex) +{ + return pow(ubuf.qt_sizeModifier, float(segmentIndex)); +} + +layout(location = 0) out vec4 color; +layout(location = 1) out vec2 spriteData; +layout(location = 2) out vec2 texcoord; + +void main() +{ + uint segmentIndex = gl_VertexIndex / 2; + uint particleIndex = segmentIndex + gl_InstanceIndex * ubuf.qt_lineSegmentCount; + + Particle p = qt_loadParticle(particleIndex); + + float side = float(mod(gl_VertexIndex, 2)) - 0.5; + float size = p.size * qt_calcSizeFactor(segmentIndex); + vec3 o = p.binormal * side * size; + vec4 worldPos = ubuf.qt_modelMatrix * vec4(p.position + (1.0 - ubuf.qt_billboard) * o, 1.0); + vec4 viewPos = ubuf.qt_viewMatrix * worldPos; + vec3 viewBN = (transpose(inverse(ubuf.qt_viewMatrix * ubuf.qt_modelMatrix)) * vec4(p.binormal, 0.0)).xyz; + viewBN.z = 0; + viewBN = normalize(viewBN) * side * size; + viewPos = viewPos + vec4(viewBN, 0.0) * ubuf.qt_billboard; + texcoord.x = p.segmentLength * ubuf.qt_texcoordScale; + texcoord.y = float(mod(gl_VertexIndex, 2)); + color = p.color; +#ifdef QSSG_PARTICLES_ENABLE_VERTEX_LIGHTING + color.rgb *= qt_calcLightColor(worldPos.xyz); +#endif + color.a *= ubuf.qt_opacity * qt_calcAlphaFade(segmentIndex); + gl_Position = ubuf.qt_projectionMatrix * viewPos; +#ifdef QSSG_PARTICLES_ENABLE_MAPPED + spriteData.x = qt_ageToSpriteFactor(p.age); +#endif +#ifdef QSSG_PARTICLES_ENABLE_ANIMATED + spriteData.y = p.animationFrame; +#endif +} + diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/testexternalsampler.bat b/local/recipes/qt/qtshadertools/source/tests/playground/testexternalsampler.bat new file mode 100644 index 0000000000..b362a7b0d9 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/testexternalsampler.bat @@ -0,0 +1,3 @@ +qsb --glsl 100es -o externalsampler.vert.qsb externalsampler.vert +qsb --glsl 100es -o externalsampler.frag.qsb externalsampler.frag +qsb -r glsl,100es,externalsampler_gles.frag externalsampler.frag.qsb diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/texture.frag b/local/recipes/qt/qtshadertools/source/tests/playground/texture.frag new file mode 100644 index 0000000000..e6021fe905 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/texture.frag @@ -0,0 +1,12 @@ +#version 440 + +layout(location = 0) in vec2 v_texcoord; + +layout(location = 0) out vec4 fragColor; + +layout(binding = 1) uniform sampler2D tex; + +void main() +{ + fragColor = texture(tex, v_texcoord); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/texture.vert b/local/recipes/qt/qtshadertools/source/tests/playground/texture.vert new file mode 100644 index 0000000000..de486cb772 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/texture.vert @@ -0,0 +1,18 @@ +#version 440 + +layout(location = 0) in vec4 position; +layout(location = 1) in vec2 texcoord; + +layout(location = 0) out vec2 v_texcoord; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; +} ubuf; + +out gl_PerVertex { vec4 gl_Position; }; + +void main() +{ + v_texcoord = texcoord; + gl_Position = ubuf.mvp * position; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/texture_sep.frag b/local/recipes/qt/qtshadertools/source/tests/playground/texture_sep.frag new file mode 100644 index 0000000000..aa86137830 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/texture_sep.frag @@ -0,0 +1,20 @@ +#version 440 + +layout(location = 0) in vec2 v_texcoord; + +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf { + float f; +}; + +layout(binding = 1) uniform texture2D sepTex; +layout(binding = 2) uniform sampler sepSampler; +layout(binding = 3) uniform sampler sepSampler2; + +void main() +{ + fragColor = texture(sampler2D(sepTex, sepSampler), v_texcoord); + fragColor *= texture(sampler2D(sepTex, sepSampler2), v_texcoord); + fragColor.a *= f; +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/texture_sep_arr.frag b/local/recipes/qt/qtshadertools/source/tests/playground/texture_sep_arr.frag new file mode 100644 index 0000000000..32b9d734ce --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/texture_sep_arr.frag @@ -0,0 +1,14 @@ +#version 440 + +layout(location = 0) in vec2 v_texcoord; + +layout(location = 0) out vec4 fragColor; + +layout(binding = 1) uniform texture2D sepTex[2]; +layout(binding = 2) uniform sampler sepSampler; + +void main() +{ + fragColor = texture(sampler2D(sepTex[0], sepSampler), v_texcoord); + fragColor *= texture(sampler2D(sepTex[1], sepSampler), v_texcoord); +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/visualize.geom b/local/recipes/qt/qtshadertools/source/tests/playground/visualize.geom new file mode 100644 index 0000000000..b013820307 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/visualize.geom @@ -0,0 +1,46 @@ +#version 440 + +layout(points) in; +layout(triangle_strip, max_vertices = 14) out; + +layout(location = 0) in vec4 v_position[]; +layout(location = 1) in vec4 v_color[]; + +layout(location = 0) out vec4 g_color; + +layout(std140, binding = 1) uniform buf { + mat4 viewProjection; + vec3 voxelSpaceSize; + uint voxelGridSize; +}; + +// 14 vertices, triangle strip, 0..1 +// See GPU Gems 3 Chapter 6 +vec3 createCube(uint vertex_id) +{ + uint x = (0x287A >> vertex_id) & 1; + uint y = (0x02AF >> vertex_id) & 1; + uint z = (0x31E3 >> vertex_id) & 1; + return vec3(uvec3(x, y, z)); +} + +void main() +{ + if (v_color[0].a > 0.0) { + for (uint i = 0; i < 14; ++i) { + g_color = v_color[0]; + gl_Position = v_position[0]; + gl_Position.xyz = (gl_Position.xyz / float(voxelGridSize)) * 2.0 - 1; // -1..1 + gl_Position.xyz *= voxelGridSize; // -64..64 + gl_Position.xyz += (createCube(i) - vec3(0.5)) * 2.0; + + vec3 worldSpaceUnitsPerVoxel = voxelSpaceSize / float(voxelGridSize); + gl_Position.xyz *= worldSpaceUnitsPerVoxel; + + gl_Position = viewProjection * vec4(gl_Position.xyz, 1.0); + + EmitVertex(); + } + EndPrimitive(); + } +} diff --git a/local/recipes/qt/qtshadertools/source/tests/playground/voxelize.geom b/local/recipes/qt/qtshadertools/source/tests/playground/voxelize.geom new file mode 100644 index 0000000000..ddd08c2117 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tests/playground/voxelize.geom @@ -0,0 +1,42 @@ +#version 440 + +layout(triangles) in; +layout(triangle_strip, max_vertices = 3) out; + +layout(location = 0) in vec2 v_texCoord[]; +layout(location = 1) in vec3 v_worldPos[]; +layout(location = 2) in vec3 v_normal[]; + +layout(location = 0) out vec2 g_texCoord; +layout(location = 1) out vec3 g_worldPos; +layout(location = 2) out vec3 g_normal; + +layout(std140, binding = 0) uniform buf { + mat4 mvp; + mat4 modelMatrix; + vec3 voxelSpaceSize; +}; + +void main() +{ + const vec3 planeNormal = cross(v_worldPos[1] - v_worldPos[0], v_worldPos[2] - v_worldPos[0]); + const vec3 p = abs(planeNormal); + + for (uint i = 0; i < 3; ++i) { + g_texCoord = v_texCoord[i]; + g_worldPos = v_worldPos[i]; + g_normal = v_normal[i]; + + const vec3 pos = g_worldPos / voxelSpaceSize; + if (p.z > p.x && p.z > p.y) + gl_Position = vec4(pos.x, pos.y, 0.0, 1.0); + else if (p.x > p.y && p.x > p.z) + gl_Position = vec4(pos.y, pos.z, 0.0, 1.0); + else + gl_Position = vec4(pos.x, pos.z, 0.0, 1.0); + + EmitVertex(); + } + + EndPrimitive(); +} diff --git a/local/recipes/qt/qtshadertools/source/tools/CMakeLists.txt b/local/recipes/qt/qtshadertools/source/tools/CMakeLists.txt new file mode 100644 index 0000000000..1645d5b641 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tools/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# Generated from tools.pro. + +add_subdirectory(qsb) diff --git a/local/recipes/qt/qtshadertools/source/tools/qsb/CMakeLists.txt b/local/recipes/qt/qtshadertools/source/tools/qsb/CMakeLists.txt new file mode 100644 index 0000000000..334fb0aa01 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tools/qsb/CMakeLists.txt @@ -0,0 +1,28 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# Generated from qsb.pro. + +##################################################################### +## qsb Tool: +##################################################################### + +qt_get_tool_target_name(target_name qsb) +qt_internal_add_tool(${target_name} + TOOLS_TARGET # special case + ShaderTools # special case + SOURCES + qsb.cpp + LIBRARIES + Qt::Gui + Qt::GuiPrivate + Qt::ShaderToolsPrivate + EXTRA_CMAKE_FILES + "${CMAKE_CURRENT_SOURCE_DIR}/${QT_CMAKE_EXPORT_NAMESPACE}ShaderToolsMacros.cmake" + EXTRA_CMAKE_INCLUDES + "${QT_CMAKE_EXPORT_NAMESPACE}ShaderToolsMacros.cmake" +) +qt_internal_return_unless_building_tools() + +#### Keys ignored in scope 1:.:.:qsb.pro:: +# _REQUIREMENTS = "qtConfig(process)" diff --git a/local/recipes/qt/qtshadertools/source/tools/qsb/Qt6ShaderToolsMacros.cmake b/local/recipes/qt/qtshadertools/source/tools/qsb/Qt6ShaderToolsMacros.cmake new file mode 100644 index 0000000000..27350c85bf --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tools/qsb/Qt6ShaderToolsMacros.cmake @@ -0,0 +1,405 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# Invokes qsb on each file in FILES. Extensions must be .vert, .frag, or .comp. +# The resulting .qsb files are added as resources under PREFIX. +# target and resourcename are like for qt6_add_resources. +# +# By default generates SPIR-V, GLSL (100 es, 120, 150), HLSL (shader model 5.0) and MSL (Metal 1.2). +# Configuring qsb: +# Specify OUTPUTS as a list with a matching element for each entry in FILES to override the resulting .qsb name. +# This makes sense when the desired name is different from the .vert/.frag source file name. (e.g. when DEFINES are involved) +# Specify GLSL, HLSL, MSL to override the versions to generate. +# Note: follows qsb and GLSL-style version syntax, e.g. "300 es,330". +# Specify NOGLSL, NOHLSL, or NOMSL to skip generating a given language. +# SPIR-V is always generated. +# Specify PRECOMPILE to trigger invoking native tools where applicable. +# F.ex. with HLSL enabled it passes -c to qsb which in turn runs fxc to store DXBC instead of HLSL. +# Specify BATCHABLE to enable generating batchable vertex shader variants. +# Mandatory for vertex shaders that are used with Qt Quick (2D) in materials or ShaderEffect. +# Specify ZORDER_LOC to change the vertex input location used by the rewriter when preparing for +# Qt Quick batching. The default is 7, which is sufficient as long as the vertex shader only +# uses locations 0-6. +# Specify PERTARGETCOMPILE to compile to SPIR-V and translate separately per output language version. +# Slow, but allows ifdefing based on QSHADER_[_VERSION] macros. +# Specify DEFINES with a "name1=value1;name2=value2" (or newline separated, like FILES) list to set custom macros for glslang. +# Specify DEBUGINFO to enable generating full debug info where applicable (e.g. SPIR-V). +# Specify OPTIMIZED to enable optimizing for performance where applicable. +# For SPIR-V this involves invoking spirv-opt from SPIRV-Tools / the Vulkan SDK. +# Specify QUIET to suppress all debug and warning prints from qsb. +# Specify OUTPUT_TARGETS to get the special generated targets when using a static library. +# This might be useful to perform additional processing on these targets. +# Specify TESSELLATION to indicate the shaders are used in a tessellation pipeline. +# Relevant in practice when Metal shaders are enabled and there are vertex shaders in the FILES list. +# Specify TESSELLATION_VERTEX_COUNT to set the output vertex count from the tessellation control stage. +# Mandatory when a tessellation evaluation shader is in the FILES list. Must match the tess.control stage. +# Specify TESSELLATION_MODE to choose the tessellation mode: "triangles" or "quads". +# Mandatory when a tessellation control shader is in the FILES list. Must match the tess.eval. stage. +# Specify VIEW_COUNT to indicate the number of views the vertex shader is going to be used with. +# Relevant for GL_OVR_multiview which an OpenGL GLSL vertex shader can only use if num_views is +# declared in the shader. Not used for Vulkan (SPIR-V) and D3D12 (HLSL 6.1+), but should be set +# regardless whenever GLSL is enabled for a multiview vertex shader. +# Specify MULTIVIEW (and no VIEW_COUNT) to automatically generate non-multiview and multiview (view count 2) +# versions. For the multiview versions the shading languages and versions are set automatically. +# Thus this is a simple drop-in option for existing qt_add_shaders() calls to get multiview versions +# generated. The additional, multiview qsb files will have a suffix of .mv2qsb. +# Specify MEDIUMP to inject "precision mediump float;" into GLSL ES fragment shaders instead of highp. +# Specify ORIGINAL_FILES with matching elements for each entry in FILES to use the given filename +# for dependency tracking (for DEPENDS and depfiles). +# +# The actual file name in the resource system is either :/PREFIX/FILES[i]-BASE+".qsb" or :/PREFIX/OUTPUTS[i] +# +# The entries in FILES can contain @ separated replacement specifications after the filename. +# Example: FILES "wobble.frag@glsl,100es,my_custom_shader_for_gles.frag@spirv,100,my_custom_spirv_binary.spv" +# triggers an additional call to qsb in replace mode (only after the .qsb file is built by the initial run): +# qsb -r glsl,100es,my_custom_shader_for_gles.frag -r spirv,100,my_custom_spirv_binary.spv wobble.frag.qsb +# +# NB! Most of this is documented in qtshadertools-build.qdoc. Changes without updating the documentation +# are not allowed. +# +# Example: +# qt6_add_shaders(testapp "testapp_shaders" +# BATCHABLE +# PRECOMPILE +# PREFIX +# "/shaders" +# FILES +# color.vert +# color.frag +# ) +# This leads to :/shaders/color.vert.qsb and :/shaders/color.frag.qsb being available in the application. +# +function(_qt_internal_add_shaders_impl target resourcename) + cmake_parse_arguments( + arg + "BATCHABLE;PRECOMPILE;PERTARGETCOMPILE;NOGLSL;NOHLSL;NOMSL;DEBUGINFO;OPTIMIZED;SILENT;QUIET;TESSELLATION;MULTIVIEW;MEDIUMP;_QT_INTERNAL" + "PREFIX;BASE;GLSL;HLSL;MSL;OUTPUT_TARGETS;TESSELLATION_VERTEX_COUNT;TESSELLATION_MODE;ZORDER_LOC;VIEW_COUNT" + "FILES;ORIGINAL_FILES;OUTPUTS;DEFINES" + ${ARGN} + ) + + _qt_internal_check_depfile_support(has_depfile_support) + + math(EXPR file_index "0") + foreach(file_and_replacements IN LISTS arg_FILES) + string(REPLACE "@" ";" file_and_replacement_list "${file_and_replacements}") + list(GET file_and_replacement_list 0 file) + list(LENGTH file_and_replacement_list replacement_count_plus_one) + set(qsb_replace_args "") + if(replacement_count_plus_one GREATER 1) + math(EXPR replacement_count "${replacement_count_plus_one}-1") + foreach(replacement_idx RANGE 1 ${replacement_count}) + list(GET file_and_replacement_list ${replacement_idx} replacement) + # Get a list, f.ex. "glsl;100es;some/where/shader.frag" so that we can + # adjust the filename (3rd component) to be absolute. + string(REPLACE "," ";" replacement_list "${replacement}") + list(GET replacement_list 2 replace_source_file) + get_filename_component(absolute_replace_source_file ${replace_source_file} ABSOLUTE) + list(REMOVE_AT replacement_list 2) + list(APPEND replacement_list "${absolute_replace_source_file}") + list(JOIN replacement_list "," qsb_replace_spec) + list(APPEND qsb_replace_args "-r") + list(APPEND qsb_replace_args "${qsb_replace_spec}") + endforeach() + endif() + + _qt_internal_expose_source_file_to_ide(${target} ${file}) + set(output_file "${file}.qsb") + if(arg_OUTPUTS) + list(GET arg_OUTPUTS ${file_index} output_file) + elseif(arg_BASE) + get_filename_component(abs_base "${arg_BASE}" ABSOLUTE) + get_filename_component(abs_output_file "${output_file}" ABSOLUTE) + file(RELATIVE_PATH output_file "${abs_base}" "${abs_output_file}") + endif() + set(qsb_result "${CMAKE_CURRENT_BINARY_DIR}/.qsb/${output_file}") + get_filename_component(file_absolute ${file} ABSOLUTE) + set(original_file "${file_absolute}") + if(arg_ORIGINAL_FILES) + list(GET arg_ORIGINAL_FILES ${file_index} original_file_as_specified) + get_filename_component(original_file ${original_file_as_specified} ABSOLUTE) + endif() + + if (NOT arg_SILENT AND NOT arg_QUIET) + message("${file} -> ${output_file} exposed as :${arg_PREFIX}/${output_file}") + endif() + + set(qsb_args "") + + # GL_OVR_multiview works best starting with these GLSL versions + set(multiview_glsl "330,300es") + + if (NOT arg_NOGLSL) + if (arg_GLSL) + set(glsl_versions "${arg_GLSL}") + if (glsl_versions MATCHES "4[0-9]0|3[12]0") + set(multiview_glsl ${arg_GLSL}) + endif() + elseif(EMSCRIPTEN) + set(glsl_versions "100es,300es") + else() + set(glsl_versions "100es,120,150") # both 'es' and ' es' are accepted by qsb + endif() + list(APPEND qsb_args "--glsl") + list(APPEND qsb_args "${glsl_versions}") + endif() + + if (NOT arg_NOHLSL AND NOT EMSCRIPTEN) + if (arg_HLSL) + set(shader_model_versions "${arg_HLSL}") + else() + set(shader_model_versions 50) + endif() + list(APPEND qsb_args "--hlsl") + list(APPEND qsb_args "${shader_model_versions}") + endif() + + if (NOT arg_NOMSL AND NOT EMSCRIPTEN) + if (arg_MSL) + set(metal_lang_versions "${arg_MSL}") + else() + set(metal_lang_versions 12) + endif() + list(APPEND qsb_args "--msl") + list(APPEND qsb_args "${metal_lang_versions}") + endif() + + if (arg_VIEW_COUNT) + list(APPEND qsb_args "--view-count") + list(APPEND qsb_args "${arg_VIEW_COUNT}") + endif() + + # Values that are reused in the optional extra run for automatic + # multiview variant generation go to qsb_common_args. + set(qsb_common_args "") + + if (arg_BATCHABLE) + list(APPEND qsb_common_args "-b") + endif() + + if (arg_PRECOMPILE) + if (WIN32 AND NOT arg_NOHLSL) + list(APPEND qsb_common_args "-c") + endif() + endif() + + if (arg_PERTARGETCOMPILE) + list(APPEND qsb_common_args "-p") + endif() + + if (arg_DEBUGINFO) + list(APPEND qsb_common_args "-g") + endif() + + if (arg_OPTIMIZED) + list(APPEND qsb_common_args "-O") + endif() + + if (arg_TESSELLATION) + list(APPEND qsb_common_args "--msltess") + endif() + + if (arg_TESSELLATION_VERTEX_COUNT) + list(APPEND qsb_common_args "--tess-vertex-count") + list(APPEND qsb_common_args "${arg_TESSELLATION_VERTEX_COUNT}") + endif() + + if (arg_TESSELLATION_MODE) + list(APPEND qsb_common_args "--tess-mode") + list(APPEND qsb_common_args "${arg_TESSELLATION_MODE}") + endif() + + if (arg_ZORDER_LOC) + list(APPEND qsb_common_args "--zorder-loc") + list(APPEND qsb_common_args "${arg_ZORDER_LOC}") + endif() + + if (arg_SILENT) + list(APPEND qsb_common_args "-s") + endif() + + foreach(qsb_def IN LISTS arg_DEFINES) + list(APPEND qsb_common_args "-D") + list(APPEND qsb_common_args "${qsb_def}") + endforeach() + + if (arg_MEDIUMP) + list(APPEND qsb_common_args "--mediump") + endif() + + if(arg_ORIGINAL_FILES) + list(APPEND qsb_common_args "--orig-file") + list(APPEND qsb_common_args "${original_file}") + endif() + + list(APPEND qsb_args "${qsb_common_args}") + + list(APPEND qsb_args "-o") + list(APPEND qsb_args "${qsb_result}") + + if(has_depfile_support) + set(depfile "${qsb_result}.d") + list(APPEND qsb_args "--depfile" "${depfile}") + set(depfile_extra_args DEPFILE "${depfile}") + else() + set(depfile_extra_args "") + endif() + + list(APPEND qsb_args "${file_absolute}") + + if (qsb_replace_args) + list(APPEND qsb_replace_args "${qsb_result}") + if (arg_SILENT) + list(APPEND qsb_replace_args "-s") + endif() + add_custom_command( + OUTPUT + ${qsb_result} + COMMAND + ${QT_CMAKE_EXPORT_NAMESPACE}::qsb ${qsb_args} + COMMAND + ${QT_CMAKE_EXPORT_NAMESPACE}::qsb ${qsb_replace_args} + DEPENDS + "${file_absolute}" + "${original_file}" + ${QT_CMAKE_EXPORT_NAMESPACE}::qsb + ${depfile_extra_args} + VERBATIM + ) + else() + add_custom_command( + OUTPUT + ${qsb_result} + COMMAND + ${QT_CMAKE_EXPORT_NAMESPACE}::qsb ${qsb_args} + DEPENDS + "${file_absolute}" + "${original_file}" + ${QT_CMAKE_EXPORT_NAMESPACE}::qsb + ${depfile_extra_args} + VERBATIM + ) + endif() + + list(APPEND qsb_files "${qsb_result}") + set_source_files_properties("${qsb_result}" PROPERTIES QT_RESOURCE_ALIAS "${output_file}") + + if (arg_MULTIVIEW) + # Reuse qsb_common_args, but use fixed shading language targets and view count. + # Add a pre-defined suffix to the output filename. + set(qsb_multiview2_result "${CMAKE_CURRENT_BINARY_DIR}/.qsb/${output_file}.mv2qsb") + set(qsb_multiview2_args "") + list(APPEND qsb_multiview2_args "--glsl") + list(APPEND qsb_multiview2_args "${multiview_glsl}") + # view instancing needs Shader Model 6.1 + list(APPEND qsb_multiview2_args "--hlsl") + list(APPEND qsb_multiview2_args "61") + list(APPEND qsb_multiview2_args "--msl") + list(APPEND qsb_multiview2_args "21") + list(APPEND qsb_multiview2_args "--view-count") + list(APPEND qsb_multiview2_args "2") + list(APPEND qsb_multiview2_args "${qsb_common_args}") + list(APPEND qsb_multiview2_args "-o") + list(APPEND qsb_multiview2_args "${qsb_multiview2_result}") + list(APPEND qsb_multiview2_args "${file_absolute}") + + if(has_depfile_support) + set(depfile "${qsb_multiview2_result}.d") + list(APPEND qsb_multiview2_args "--depfile" "${depfile}") + set(depfile_extra_args DEPFILE "${depfile}") + else() + set(depfile_extra_args "") + endif() + + add_custom_command( + OUTPUT + ${qsb_multiview2_result} + COMMAND + ${QT_CMAKE_EXPORT_NAMESPACE}::qsb ${qsb_multiview2_args} + DEPENDS + "${file_absolute}" + "${original_file}" + ${QT_CMAKE_EXPORT_NAMESPACE}::qsb + ${depfile_extra_args} + VERBATIM + ) + list(APPEND qsb_files "${qsb_multiview2_result}") + set_source_files_properties("${qsb_multiview2_result}" PROPERTIES QT_RESOURCE_ALIAS "${output_file}.mv2qsb") + endif() + + math(EXPR file_index "${file_index}+1") + endforeach() + + if(CMAKE_GENERATOR STREQUAL "Xcode") + # Save the target responsible for driving the build of the custom command + # into an internal source file property. It will be added as a dependency for targets + # created by _qt_internal_process_resource, to avoid the Xcode issue of not allowing + # multiple targets depending on the output, without having a common target ancestor. + set(common_ancestor_target qsb_${target}_${resourcename}) + + if(NOT TARGET ${common_ancestor_target}) + add_custom_target(${common_ancestor_target} SOURCES "${qsb_files}") + else() + set_property(TARGET ${common_ancestor_target} APPEND PROPERTY SOURCES ${qsb_files}) + endif() + + set(scope_args) + if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.18") + set(scope_args TARGET_DIRECTORY ${target}) + endif() + set_source_files_properties(${qsb_files} ${scope_args} PROPERTIES + _qt_resource_target_dependency "${common_ancestor_target}" + ) + endif() + + if (arg__QT_INTERNAL) + qt_internal_add_resource(${target} ${resourcename} + PREFIX + "${arg_PREFIX}" + OUTPUT_TARGETS + output_targets + FILES + "${qsb_files}" + ) + else() + qt6_add_resources(${target} ${resourcename} + PREFIX + "${arg_PREFIX}" + OUTPUT_TARGETS + output_targets + FILES + "${qsb_files}" + ) + endif() + + if(arg_OUTPUT_TARGETS) + set(${arg_OUTPUT_TARGETS} "${output_targets}" PARENT_SCOPE) + endif() +endfunction() + +function(qt6_add_shaders) + _qt_internal_add_shaders_impl(${ARGV}) + cmake_parse_arguments(PARSE_ARGV 1 arg "" "OUTPUT_TARGETS" "") + if (arg_OUTPUT_TARGETS) + set(${arg_OUTPUT_TARGETS} ${${arg_OUTPUT_TARGETS}} PARENT_SCOPE) + endif() +endfunction() + +if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) + function(qt_add_shaders) + qt6_add_shaders(${ARGV}) + cmake_parse_arguments(PARSE_ARGV 1 arg "" "OUTPUT_TARGETS" "") + if (arg_OUTPUT_TARGETS) + set(${arg_OUTPUT_TARGETS} ${${arg_OUTPUT_TARGETS}} PARENT_SCOPE) + endif() + endfunction() +endif() + +# for use by Qt modules that need qt_internal_add_resource +function(qt_internal_add_shaders) + _qt_internal_add_shaders_impl(${ARGV} _QT_INTERNAL) + cmake_parse_arguments(PARSE_ARGV 1 arg "" "OUTPUT_TARGETS" "") + if (arg_OUTPUT_TARGETS) + set(${arg_OUTPUT_TARGETS} ${${arg_OUTPUT_TARGETS}} PARENT_SCOPE) + endif() +endfunction() diff --git a/local/recipes/qt/qtshadertools/source/tools/qsb/qsb.cpp b/local/recipes/qt/qtshadertools/source/tools/qsb/qsb.cpp new file mode 100644 index 0000000000..352359d0f2 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tools/qsb/qsb.cpp @@ -0,0 +1,1071 @@ +// Copyright (C) 2019 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if QT_CONFIG(process) +#include +#endif + +#include +#include + +// All qDebug must be guarded by !silent. For qWarnings, only the most +// fatal ones should be unconditional; warnings from external tool +// invocations must be guarded with !silent. +static bool silent = false; + +using namespace Qt::StringLiterals; + +enum class FileType +{ + Binary, + Text +}; + +static void printError(const char *msg, ...) +{ + va_list arglist; + va_start(arglist, msg); + vfprintf(stderr, msg, arglist); + fputs("\n", stderr); + va_end(arglist); +} + +static bool writeToFile(const QByteArray &buf, const QString &filename, FileType fileType) +{ + QDir().mkpath(QFileInfo(filename).path()); + QFile f(filename); + QIODevice::OpenMode flags = QIODevice::WriteOnly | QIODevice::Truncate; + if (fileType == FileType::Text) + flags |= QIODevice::Text; + if (!f.open(flags)) { + printError("Failed to open %s for writing", qPrintable(filename)); + return false; + } + f.write(buf); + return true; +} + +static QByteArray readFile(const QString &filename, FileType fileType) +{ + QFile f(filename); + QIODevice::OpenMode flags = QIODevice::ReadOnly; + if (fileType == FileType::Text) + flags |= QIODevice::Text; + if (!f.open(flags)) { + printError("Failed to open %s", qPrintable(filename)); + return QByteArray(); + } + return f.readAll(); +} + +static QString writeTemp(const QTemporaryDir &tempDir, const QString &filename, const QShaderCode &s, FileType fileType) +{ + const QString fullPath = tempDir.path() + QLatin1String("/") + filename; + if (writeToFile(s.shader(), fullPath, fileType)) + return fullPath; + else + return QString(); +} + +static bool runProcess(const QString &binary, const QStringList &arguments, + QByteArray *output, QByteArray *errorOutput) +{ +#if QT_CONFIG(process) + QProcess p; + p.start(binary, arguments); + const QString cmd = binary + QLatin1Char(' ') + arguments.join(QLatin1Char(' ')); + if (!silent) + qDebug("%s", qPrintable(cmd)); + if (!p.waitForStarted()) { + if (!silent) + printError("Failed to run %s: %s", qPrintable(cmd), qPrintable(p.errorString())); + return false; + } + if (!p.waitForFinished()) { + if (!silent) + printError("%s timed out", qPrintable(cmd)); + return false; + } + + if (p.exitStatus() == QProcess::CrashExit) { + if (!silent) + printError("%s crashed", qPrintable(cmd)); + return false; + } + + *output = p.readAllStandardOutput(); + *errorOutput = p.readAllStandardError(); + + if (p.exitCode() != 0) { + if (!silent) + printError("%s returned non-zero error code %d", qPrintable(cmd), p.exitCode()); + return false; + } + + return true; +#else + Q_UNUSED(binary); + Q_UNUSED(arguments); + Q_UNUSED(output); + *errorOutput = QByteArrayLiteral("QProcess not supported on this platform"); + return false; +#endif +} + +static QString stageStr(QShader::Stage stage) +{ + switch (stage) { + case QShader::VertexStage: + return QStringLiteral("Vertex"); + case QShader::TessellationControlStage: + return QStringLiteral("TessellationControl"); + case QShader::TessellationEvaluationStage: + return QStringLiteral("TessellationEvaluation"); + case QShader::GeometryStage: + return QStringLiteral("Geometry"); + case QShader::FragmentStage: + return QStringLiteral("Fragment"); + case QShader::ComputeStage: + return QStringLiteral("Compute"); + default: + Q_UNREACHABLE(); + } +} + +static QString sourceStr(QShader::Source source) +{ + switch (source) { + case QShader::SpirvShader: + return QStringLiteral("SPIR-V"); + case QShader::GlslShader: + return QStringLiteral("GLSL"); + case QShader::HlslShader: + return QStringLiteral("HLSL"); + case QShader::DxbcShader: + return QStringLiteral("DXBC"); + case QShader::MslShader: + return QStringLiteral("MSL"); + case QShader::DxilShader: + return QStringLiteral("DXIL"); + case QShader::MetalLibShader: + return QStringLiteral("metallib"); + case QShader::WgslShader: + return QStringLiteral("WGSL"); + default: + Q_UNREACHABLE(); + } +} + +static QString sourceVersionStr(const QShaderVersion &v) +{ + QString s = v.version() ? QString::number(v.version()) : QString(); + if (v.flags().testFlag(QShaderVersion::GlslEs)) + s += QLatin1String(" es"); + + return s; +} + +static QString sourceVariantStr(const QShader::Variant &v) +{ + switch (v) { + case QShader::StandardShader: + return QLatin1String("Standard"); + case QShader::BatchableVertexShader: + return QLatin1String("Batchable"); + case QShader::UInt32IndexedVertexAsComputeShader: + return QLatin1String("UInt32IndexedVertexAsCompute"); + case QShader::UInt16IndexedVertexAsComputeShader: + return QLatin1String("UInt16IndexedVertexAsCompute"); + case QShader::NonIndexedVertexAsComputeShader: + return QLatin1String("NonIndexedVertexAsCompute"); + default: + Q_UNREACHABLE(); + } +} + +static void dump(const QShader &bs) +{ + QTextStream ts(stdout); + ts << "Stage: " << stageStr(bs.stage()) << "\n"; + ts << "QSB_VERSION: " << QShaderPrivate::get(&bs)->qsbVersion << "\n"; + const QList keys = bs.availableShaders(); + ts << "Has " << keys.size() << " shaders:\n"; + for (int i = 0; i < keys.size(); ++i) { + ts << " Shader " << i << ": " << sourceStr(keys[i].source()) + << " " << sourceVersionStr(keys[i].sourceVersion()) + << " [" << sourceVariantStr(keys[i].sourceVariant()) << "]\n"; + } + ts << "\n"; + ts << "Reflection info: " << bs.description().toJson() << "\n\n"; + for (int i = 0; i < keys.size(); ++i) { + ts << "Shader " << i << ": " << sourceStr(keys[i].source()) + << " " << sourceVersionStr(keys[i].sourceVersion()) + << " [" << sourceVariantStr(keys[i].sourceVariant()) << "]\n"; + QShaderCode shader = bs.shader(keys[i]); + if (!shader.entryPoint().isEmpty()) + ts << "Entry point: " << shader.entryPoint() << "\n"; + QShader::NativeResourceBindingMap nativeResMap = bs.nativeResourceBindingMap(keys[i]); + if (!nativeResMap.isEmpty()) { + ts << "Native resource binding map:\n"; + for (auto mapIt = nativeResMap.cbegin(), mapItEnd = nativeResMap.cend(); mapIt != mapItEnd; ++mapIt) + ts << mapIt.key() << " -> [" << mapIt.value().first << ", " << mapIt.value().second << "]\n"; + } + QShader::SeparateToCombinedImageSamplerMappingList samplerMapList = bs.separateToCombinedImageSamplerMappingList(keys[i]); + if (!samplerMapList.isEmpty()) { + ts << "Mapping table for auto-generated combined image samplers:\n"; + for (auto listIt = samplerMapList.cbegin(), listItEnd = samplerMapList.cend(); listIt != listItEnd; ++listIt) + ts << "\"" << listIt->combinedSamplerName << "\" -> [" << listIt->textureBinding << ", " << listIt->samplerBinding << "]\n"; + } + QShader::NativeShaderInfo shaderInfo = bs.nativeShaderInfo(keys[i]); + if (shaderInfo.flags) + ts << "Native shader info flags: " << shaderInfo.flags << "\n"; + if (!shaderInfo.extraBufferBindings.isEmpty()) { + ts << "Native shader extra buffer bindings:\n"; + for (auto mapIt = shaderInfo.extraBufferBindings.cbegin(), mapItEnd = shaderInfo.extraBufferBindings.cend(); + mapIt != mapItEnd; ++mapIt) + { + static struct { + QShaderPrivate::MslNativeShaderInfoExtraBufferBindings key; + const char *str; + } ebbNames[] = { + { QShaderPrivate::MslTessVertIndicesBufferBinding, "tessellation(vert)-index-buffer-binding" }, + { QShaderPrivate::MslTessVertTescOutputBufferBinding, "tessellation(vert/tesc)-output-buffer-binding" }, + { QShaderPrivate::MslTessTescTessLevelBufferBinding, "tessellation(tesc)-level-buffer-binding" }, + { QShaderPrivate::MslTessTescPatchOutputBufferBinding, "tessellation(tesc)-patch-output-buffer-binding" }, + { QShaderPrivate::MslTessTescParamsBufferBinding, "tessellation(tesc)-params-buffer-binding" }, + { QShaderPrivate::MslTessTescInputBufferBinding, "tessellation(tesc)-input-buffer-binding" }, + { QShaderPrivate::MslBufferSizeBufferBinding, "buffer-size-buffer-binding" }, + { QShaderPrivate::MslMultiViewMaskBufferBinding, "view-mask-buffer-binding" } + }; + bool known = false; + for (size_t i = 0; i < sizeof(ebbNames) / sizeof(ebbNames[0]); ++i) { + if (ebbNames[i].key == mapIt.key()) { + ts << "[" << ebbNames[i].str << "] = " << mapIt.value() << "\n"; + known = true; + break; + } + } + if (!known) + ts << "[" << mapIt.key() << "] = " << mapIt.value() << "\n"; + } + } + + ts << "Contents:\n"; + switch (keys[i].source()) { + case QShader::SpirvShader: + case QShader::DxbcShader: + case QShader::DxilShader: + case QShader::MetalLibShader: + ts << "Binary of " << shader.shader().size() << " bytes\n\n"; + break; + default: + ts << shader.shader() << "\n"; + break; + } + ts << "\n************************************\n\n"; + } +} + +static QShaderKey shaderKeyFromWhatSpec(const QString &what, QShader::Variant variant) +{ + const QStringList typeAndVersion = what.split(QLatin1Char(','), Qt::SkipEmptyParts); + if (typeAndVersion.size() < 2) + return {}; + + QShader::Source src; + if (typeAndVersion[0] == QLatin1String("spirv")) + src = QShader::SpirvShader; + else if (typeAndVersion[0] == QLatin1String("glsl")) + src = QShader::GlslShader; + else if (typeAndVersion[0] == QLatin1String("hlsl")) + src = QShader::HlslShader; + else if (typeAndVersion[0] == QLatin1String("msl")) + src = QShader::MslShader; + else if (typeAndVersion[0] == QLatin1String("dxbc")) + src = QShader::DxbcShader; + else if (typeAndVersion[0] == QLatin1String("dxil")) + src = QShader::DxilShader; + else if (typeAndVersion[0] == QLatin1String("metallib")) + src = QShader::MetalLibShader; + else if (typeAndVersion[0] == QLatin1String("wgsl")) + src = QShader::WgslShader; + else + return {}; + + QShaderVersion::Flags flags; + QString version = typeAndVersion[1]; + if (version.endsWith(QLatin1String(" es"))) { + version = version.left(version.size() - 3); + flags |= QShaderVersion::GlslEs; + } else if (version.endsWith(QLatin1String("es"))) { + version = version.left(version.size() - 2); + flags |= QShaderVersion::GlslEs; + } + const int ver = version.toInt(); + + return { src, { ver, flags }, variant }; +} + +static bool extract(const QShader &bs, const QString &what, QShader::Variant variant, const QString &outfn) +{ + if (what == QLatin1String("reflect")) { + const QByteArray reflect = bs.description().toJson(); + if (!writeToFile(reflect, outfn, FileType::Text)) + return false; + if (!silent) + qDebug("Reflection data written to %s", qPrintable(outfn)); + return true; + } + + const QShaderKey key = shaderKeyFromWhatSpec(what, variant); + const QShaderCode code = bs.shader(key); + if (code.shader().isEmpty()) + return false; + if (!writeToFile(code.shader(), outfn, FileType::Binary)) + return false; + if (!silent) { + qDebug("%s %d%s code (variant %s) written to %s. Entry point is '%s'.", + qPrintable(sourceStr(key.source())), + key.sourceVersion().version(), + key.sourceVersion().flags().testFlag(QShaderVersion::GlslEs) ? " es" : "", + qPrintable(sourceVariantStr(key.sourceVariant())), + qPrintable(outfn), code.entryPoint().constData()); + } + return true; +} + +static bool addOrReplace(const QShader &shaderPack, + const QStringList &whatList, + QShader::Variant variant, + const QString &outfn, + QShader::SerializedFormatVersion qsbVersion) +{ + QShader workShaderPack = shaderPack; + for (const QString &what : whatList) { + const QStringList spec = what.split(QLatin1Char(','), Qt::SkipEmptyParts); + if (spec.size() < 3) { + printError("Invalid replace spec '%s'", qPrintable(what)); + return false; + } + + const QShaderKey key = shaderKeyFromWhatSpec(what, variant); + const QString fn = spec[2]; + + const QByteArray buf = readFile(fn, FileType::Binary); + if (buf.isEmpty()) + return false; + + // Does not matter if 'key' was present before or not, we support both + // replacing and adding using the same qsb -r ... syntax. + + const QShaderCode code(buf, QByteArrayLiteral("main")); + workShaderPack.setShader(key, code); + + if (!silent) { + qDebug("Replaced %s %d%s (variant %s) with %s. Entry point is 'main'.", + qPrintable(sourceStr(key.source())), + key.sourceVersion().version(), + key.sourceVersion().flags().testFlag(QShaderVersion::GlslEs) ? " es" : "", + qPrintable(sourceVariantStr(key.sourceVariant())), + qPrintable(fn)); + } + } + return writeToFile(workShaderPack.serialized(qsbVersion), outfn, FileType::Binary); +} + +static bool remove(const QShader &shaderPack, + const QStringList &whatList, + QShader::Variant variant, + const QString &outfn, + QShader::SerializedFormatVersion qsbVersion) +{ + QShader workShaderPack = shaderPack; + for (const QString &what : whatList) { + const QShaderKey key = shaderKeyFromWhatSpec(what, variant); + if (!workShaderPack.availableShaders().contains(key)) + continue; + workShaderPack.removeShader(key); + if (!silent) { + qDebug("Removed %s %d%s (variant %s).", + qPrintable(sourceStr(key.source())), + key.sourceVersion().version(), + key.sourceVersion().flags().testFlag(QShaderVersion::GlslEs) ? " es" : "", + qPrintable(sourceVariantStr(key.sourceVariant()))); + } + } + return writeToFile(workShaderPack.serialized(qsbVersion), outfn, FileType::Binary); +} + +static QByteArray fxcProfile(const QShader &bs, const QShaderKey &k) +{ + QByteArray t; + + switch (bs.stage()) { + case QShader::VertexStage: + t += QByteArrayLiteral("vs_"); + break; + case QShader::TessellationControlStage: + t += QByteArrayLiteral("hs_"); + break; + case QShader::TessellationEvaluationStage: + t += QByteArrayLiteral("ds_"); + break; + case QShader::GeometryStage: + t += QByteArrayLiteral("gs_"); + break; + case QShader::FragmentStage: + t += QByteArrayLiteral("ps_"); + break; + case QShader::ComputeStage: + t += QByteArrayLiteral("cs_"); + break; + default: + break; + } + + const int major = k.sourceVersion().version() / 10; + const int minor = k.sourceVersion().version() % 10; + t += QByteArray::number(major); + t += '_'; + t += QByteArray::number(minor); + + return t; +} + +static void replaceShaderContents(QShader *shaderPack, + const QShaderKey &originalKey, + QShader::Source newType, + const QByteArray &contents, + const QByteArray &entryPoint) +{ + QShaderKey newKey = originalKey; + newKey.setSource(newType); + QShaderCode shader(contents, entryPoint); + shaderPack->setShader(newKey, shader); + if (newKey != originalKey) { + shaderPack->setResourceBindingMap(newKey, shaderPack->nativeResourceBindingMap(originalKey)); + shaderPack->removeResourceBindingMap(originalKey); + shaderPack->setSeparateToCombinedImageSamplerMappingList(newKey, shaderPack->separateToCombinedImageSamplerMappingList(originalKey)); + shaderPack->removeSeparateToCombinedImageSamplerMappingList(originalKey); + shaderPack->removeShader(originalKey); + } +} + +static bool generateDepfile(QFile &depfile, const QString &inputFilename, const QString &originalInputFilename, + const QString &outputFilename) +{ + constexpr QByteArrayView includeKeyword("include"); + // Assume that the minimalistic include statment should look as following: #include "x" + constexpr qsizetype minIncludeStatementSize = includeKeyword.size() + 5; + + QFile inputFile(inputFilename); + if (!inputFile.open(QFile::ReadOnly)) { + printError("Unable to open input file: '%s'", qPrintable(inputFilename)); + return false; + } + depfile.write(outputFilename.toUtf8()); + depfile.write(": \\\n "_ba); + depfile.write(originalInputFilename.toUtf8()); + enum { ParseHash, ParseInclude, ParseFilename } parserState = ParseHash; + + QSet knownDeps; + QByteArray outputBuffer; + while (!inputFile.atEnd()) { + QByteArray line = inputFile.readLine(); + if (line.size() < minIncludeStatementSize) + continue; + + parserState = ParseHash; + for (auto it = line.constBegin(); it < line.constEnd(); ++it) { + const auto c = *it; + if (c == '\t' || c == ' ') + continue; + + if (parserState == ParseHash) { + // Looking for # + if (c == '#') + parserState = ParseInclude; + else + break; + } else if (parserState == ParseInclude) { + // Looking for 'include' + if (includeKeyword == QByteArrayView(it, includeKeyword.size())) + parserState = ParseFilename; + else + break; + it += includeKeyword.size(); + } else if (parserState == ParseFilename) { + // Looking for wrapping quotes + QString includeString = QString::fromUtf8(QByteArrayView(it, line.constEnd())); + QChar quoteCounterpart; + if (includeString.front() == '<') { + quoteCounterpart = '>'; + } else if (includeString.front() == '"') { + quoteCounterpart = '"'; + } else { + qWarning("Unrecognised include statement: '%s'", qPrintable(includeString)); + break; + } + + const auto filenameBegin = 1; + const auto filenameEnd = includeString.indexOf(quoteCounterpart, filenameBegin); + if (filenameEnd > filenameBegin) { + QString filename = + includeString.sliced(filenameBegin, filenameEnd - filenameBegin); + QFileInfo info(QFileInfo(inputFilename).absolutePath() + '/' + filename); + + if (info.exists()) { + QString filePath = info.absoluteFilePath(); + if (!knownDeps.contains(filePath)) { + outputBuffer.append(" \\\n "_ba + filePath.toUtf8()); + knownDeps.insert(filePath); + } + } else { + qWarning("File '%s' included in '%s' doesn't exist. Skip adding " + "dependency.", + qPrintable(filename), qPrintable(inputFilename)); + } + } + break; + } + } + } + + if (!outputBuffer.isEmpty()) + depfile.write(outputBuffer); + return true; +} + +int main(int argc, char **argv) +{ + QCoreApplication app(argc, argv); + + QCommandLineParser cmdLineParser; + const QString appDesc = QString::asprintf("Qt Shader Baker (using QShader from Qt %s)", qVersion()); + cmdLineParser.setApplicationDescription(appDesc); + app.setApplicationVersion(QLatin1String(QT_VERSION_STR)); + cmdLineParser.addHelpOption(); + cmdLineParser.addVersionOption(); + cmdLineParser.addPositionalArgument(QLatin1String("file"), + QObject::tr("Vulkan GLSL source file to compile. The file extension determines the shader stage, and can be one of " + ".vert, .tesc, .tese, .geom, .frag, .comp. " + "Note: Tessellation control/evaluation is not supported with HLSL, instead use -r to inject handcrafted hull/domain shaders. " + "Some targets may need special arguments to be set, e.g. MSL tessellation will likely need --msltess, --tess-vertex-count, --tess-mode, depending on the stage. " + "Geometry shaders are not supported with Metal." + ), + QObject::tr("file")); + QCommandLineOption batchableOption({ "b", "batchable" }, QObject::tr("Also generates rewritten vertex shader for Qt Quick scene graph batching.")); + cmdLineParser.addOption(batchableOption); + QCommandLineOption batchLocOption("zorder-loc", + QObject::tr("The extra vertex input location when rewriting for batching. Defaults to 7."), + QObject::tr("location")); + cmdLineParser.addOption(batchLocOption); + QCommandLineOption glslOption("glsl", + QObject::tr("Comma separated list of GLSL versions to generate. (for example, \"100 es,120,330\")"), + QObject::tr("versions")); + cmdLineParser.addOption(glslOption); + QCommandLineOption hlslOption("hlsl", + QObject::tr("Comma separated list of HLSL (Shader Model) versions to generate. F.ex. 50 is 5.0, 51 is 5.1."), + QObject::tr("versions")); + cmdLineParser.addOption(hlslOption); + QCommandLineOption mslOption("msl", + QObject::tr("Comma separated list of Metal Shading Language versions to generate. F.ex. 12 is 1.2, 20 is 2.0."), + QObject::tr("versions")); + cmdLineParser.addOption(mslOption); + QCommandLineOption shortcutDefaultOption("qt6", QObject::tr("Equivalent to --glsl \"100 es,120,150\" --hlsl 50 --msl 12. " + "This set is commonly used with shaders for Qt Quick materials and effects.")); + cmdLineParser.addOption(shortcutDefaultOption); + QCommandLineOption tessOption("msltess", QObject::tr("Indicates that a vertex shader is going to be used in a pipeline with tessellation. " + "Mandatory for vertex shaders planned to be used with tessellation when targeting Metal (--msl).")); + cmdLineParser.addOption(tessOption); + QCommandLineOption tessVertCountOption("tess-vertex-count", QObject::tr("The output vertex count from the tessellation control stage. " + "Mandatory for tessellation evaluation shaders planned to be used with Metal. " + "The default value is 3. " + "If it does not match the tess.control stage, the generated MSL code will not function as expected."), + QObject::tr("count")); + cmdLineParser.addOption(tessVertCountOption); + QCommandLineOption tessModeOption("tess-mode", QObject::tr("The tessellation mode: triangles or quads. Mandatory for tessellation control shaders planned to be used with Metal. " + "The default value is triangles. Isolines are not supported with Metal. " + "If it does not match the tess.evaluation stage, the generated MSL code will not function as expected."), + QObject::tr("mode")); + cmdLineParser.addOption(tessModeOption); + QCommandLineOption multiViewCountOption("view-count", QObject::tr("The number of views the shader is used with. num_views must be >= 2. " + "Mandatory when multiview rendering is used (gl_ViewIndex). " + "Set only for vertex shaders that really do rely on multiview (as the resulting asset is tied to num_views). " + "Can be set for fragment shaders too, to get QSHADER_VIEW_COUNT auto-defined. (useful for ensuring uniform buffer layouts)"), + QObject::tr("num_views")); + cmdLineParser.addOption(multiViewCountOption); + QCommandLineOption debugInfoOption("g", QObject::tr("Generate full debug info for SPIR-V and DXBC")); + cmdLineParser.addOption(debugInfoOption); + QCommandLineOption spirvOptOption("O", QObject::tr("Invoke spirv-opt (external tool) to optimize SPIR-V for performance.")); + cmdLineParser.addOption(spirvOptOption); + QCommandLineOption outputOption({ "o", "output" }, + QObject::tr("Output file for the shader pack."), + QObject::tr("filename")); + cmdLineParser.addOption(outputOption); + QCommandLineOption origFnOption("orig-file", + QObject::tr("Filename to be be used for dependency tracking instead of ."), + QObject::tr("filename")); + cmdLineParser.addOption(origFnOption); + QCommandLineOption qsbVersionOption("qsbversion", + QObject::tr("QSB version to use for the output file. By default the latest version is automatically used, " + "use only to bake compatibility versions. F.ex. 64 is Qt 6.4."), + QObject::tr("version")); + cmdLineParser.addOption(qsbVersionOption); + QCommandLineOption fxcOption({ "c", "fxc" }, QObject::tr("In combination with --hlsl invokes fxc (SM 5.0/5.1) or dxc (SM 6.0+) to store DXBC or DXIL instead of HLSL.")); + cmdLineParser.addOption(fxcOption); + QCommandLineOption mtllibOption({ "t", "metallib" }, + QObject::tr("In combination with --msl builds a Metal library with xcrun metal(lib) and stores that instead of the source. " + "Suitable only when targeting macOS, not iOS.")); + cmdLineParser.addOption(mtllibOption); + QCommandLineOption mtllibIosOption({ "T", "metallib-ios" }, + QObject::tr("In combination with --msl builds a Metal library with xcrun metal(lib) and stores that instead of the source. " + "Suitable only when targeting iOS, not macOS.")); + cmdLineParser.addOption(mtllibIosOption); + QCommandLineOption defineOption({ "D", "define" }, QObject::tr("Define macro. This argument can be specified multiple times."), QObject::tr("name[=value]")); + cmdLineParser.addOption(defineOption); + QCommandLineOption perTargetCompileOption({ "p", "per-target" }, QObject::tr("Enable per-target compilation. (instead of source->SPIRV->targets, do " + "source->SPIRV->target separately for each target)")); + cmdLineParser.addOption(perTargetCompileOption); + QCommandLineOption dumpOption({ "d", "dump" }, QObject::tr("Switches to dump mode. Input file is expected to be a shader pack.")); + cmdLineParser.addOption(dumpOption); + QCommandLineOption extractOption({ "x", "extract" }, QObject::tr("Switches to extract mode. Input file is expected to be a shader pack. " + "Result is written to the output specified by -o. " + "Pass -b to choose the batchable variant. " + "=reflect|spirv,|glsl,|..."), + QObject::tr("what")); + cmdLineParser.addOption(extractOption); + QCommandLineOption replaceOption({ "r", "replace" }, + QObject::tr("Switches to replace mode. Replaces the specified shader in the shader pack with the contents of a file. " + "This argument can be specified multiple times. " + "Pass -b to choose the batchable variant. " + "Also supports adding a shader for a target/variant that was not present before. " + "=, where =spirv,|glsl,|..."), + QObject::tr("what")); + cmdLineParser.addOption(replaceOption); + QCommandLineOption eraseOption({ "e", "erase" }, + QObject::tr("Switches to erase mode. Removes the specified shader from the shader pack. " + "Pass -b to choose the batchable variant. " + "=spirv,|glsl,|..."), + QObject::tr("what")); + cmdLineParser.addOption(eraseOption); + QCommandLineOption silentOption({ "s", "silent" }, QObject::tr("Enables silent mode. Only fatal errors will be printed.")); + cmdLineParser.addOption(silentOption); + + QCommandLineOption depfileOption("depfile", + QObject::tr("Enables generating the depfile for the input " + "shaders, using the #include statements."), + QObject::tr("depfile")); + + QCommandLineOption mediumpOption("mediump", QObject::tr("Default to medium precision for floats in fragment shaders instead of high. " + "GLSL ES only; ignored for everything else, including GLSL.")); + cmdLineParser.addOption(mediumpOption); + + cmdLineParser.addOption(depfileOption); + + cmdLineParser.process(app); + + if (cmdLineParser.positionalArguments().isEmpty()) { + cmdLineParser.showHelp(); + return 0; + } + + silent = cmdLineParser.isSet(silentOption); + + QShaderBaker baker; + + QFile depfile; + if (const QString depfilePath = cmdLineParser.value(depfileOption); !depfilePath.isEmpty()) { + QDir().mkpath(QFileInfo(depfilePath).path()); + depfile.setFileName(depfilePath); + if (!depfile.open(QFile::WriteOnly | QFile::Truncate)) { + printError("Unable to create DEPFILE: '%s'", qPrintable(depfilePath)); + return 1; + } + } + + const bool depfileRequired = depfile.isOpen(); + + for (const QString &fn : cmdLineParser.positionalArguments()) { + auto qsbVersion = QShader::SerializedFormatVersion::Latest; + if (cmdLineParser.isSet(qsbVersionOption)) { + const QString qsbVersionString = cmdLineParser.value(qsbVersionOption); + if (qsbVersionString == QStringLiteral("64")) { + qsbVersion = QShader::SerializedFormatVersion::Qt_6_4; + } else if (qsbVersionString == QStringLiteral("65")) { + qsbVersion = QShader::SerializedFormatVersion::Qt_6_5; + } else if (qsbVersionString.toLower() != QStringLiteral("latest")) { + printError("Unknown Qt qsb version: %s", qPrintable(qsbVersionString)); + printError("Available versions: 64, 65, latest"); + return 1; + } + } + + if (cmdLineParser.isSet(dumpOption) + || cmdLineParser.isSet(extractOption) + || cmdLineParser.isSet(replaceOption) + || cmdLineParser.isSet(eraseOption)) + { + QByteArray buf = readFile(fn, FileType::Binary); + if (!buf.isEmpty()) { + QShader bs = QShader::fromSerialized(buf); + if (bs.isValid()) { + const bool batchable = cmdLineParser.isSet(batchableOption); + const QShader::Variant variant = batchable ? QShader::BatchableVertexShader : QShader::StandardShader; + if (cmdLineParser.isSet(dumpOption)) { + dump(bs); + } else if (cmdLineParser.isSet(extractOption)) { + if (cmdLineParser.isSet(outputOption)) { + if (!extract(bs, cmdLineParser.value(extractOption), variant, cmdLineParser.value(outputOption))) + return 1; + } else { + printError("No output file specified"); + } + } else if (cmdLineParser.isSet(replaceOption)) { + if (!addOrReplace(bs, cmdLineParser.values(replaceOption), variant, fn, qsbVersion)) + return 1; + } else if (cmdLineParser.isSet(eraseOption)) { + if (!remove(bs, cmdLineParser.values(eraseOption), variant, fn, qsbVersion)) + return 1; + } + } else { + printError("Failed to deserialize %s (or the shader pack is empty)", qPrintable(fn)); + } + } + continue; + } + + if (depfileRequired) { + QString originalFilename = fn; + if (cmdLineParser.isSet(origFnOption)) + originalFilename = cmdLineParser.value(origFnOption); + if (!generateDepfile(depfile, fn, originalFilename, cmdLineParser.value(outputOption))) + return 1; + } + + baker.setSourceFileName(fn); + + baker.setPerTargetCompilation(cmdLineParser.isSet(perTargetCompileOption)); + + QShaderBaker::SpirvOptions spirvOptions; + // We either want full debug info, or none at all (so no variable names + // either - that too can be stripped after the SPIRV-Cross stage). + if (cmdLineParser.isSet(debugInfoOption)) + spirvOptions |= QShaderBaker::SpirvOption::GenerateFullDebugInfo; + else + spirvOptions |= QShaderBaker::SpirvOption::StripDebugAndVarInfo; + + baker.setSpirvOptions(spirvOptions); + + QShaderBaker::GlslOptions glslOptions; + if (cmdLineParser.isSet(mediumpOption)) + glslOptions |= QShaderBaker::GlslOption::GlslEsFragDefaultFloatPrecisionMedium; + + baker.setGlslOptions(glslOptions); + + QList variants; + variants << QShader::StandardShader; + if (cmdLineParser.isSet(batchableOption)) { + variants << QShader::BatchableVertexShader; + if (cmdLineParser.isSet(batchLocOption)) + baker.setBatchableVertexShaderExtraInputLocation(cmdLineParser.value(batchLocOption).toInt()); + } + if (cmdLineParser.isSet(tessOption)) { + variants << QShader::UInt16IndexedVertexAsComputeShader + << QShader::UInt32IndexedVertexAsComputeShader + << QShader::NonIndexedVertexAsComputeShader; + } + + if (cmdLineParser.isSet(tessModeOption)) { + const QString tessModeStr = cmdLineParser.value(tessModeOption).toLower(); + if (tessModeStr == QLatin1String("triangles")) + baker.setTessellationMode(QShaderDescription::TrianglesTessellationMode); + else if (tessModeStr == QLatin1String("quads")) + baker.setTessellationMode(QShaderDescription::QuadTessellationMode); + else + qWarning("Unknown tessellation mode '%s'", qPrintable(tessModeStr)); + } + + if (cmdLineParser.isSet(tessVertCountOption)) + baker.setTessellationOutputVertexCount(cmdLineParser.value(tessVertCountOption).toInt()); + + if (cmdLineParser.isSet(multiViewCountOption)) + baker.setMultiViewCount(cmdLineParser.value(multiViewCountOption).toInt()); + + baker.setGeneratedShaderVariants(variants); + + QList genShaders; + + genShaders << std::make_pair(QShader::SpirvShader, QShaderVersion(100)); + + if (cmdLineParser.isSet(glslOption)) { + const QStringList versions = cmdLineParser.value(glslOption).trimmed().split(','); + for (QString version : versions) { + QShaderVersion::Flags flags; + if (version.endsWith(QLatin1String(" es"))) { + version = version.left(version.size() - 3); + flags |= QShaderVersion::GlslEs; + } else if (version.endsWith(QLatin1String("es"))) { + version = version.left(version.size() - 2); + flags |= QShaderVersion::GlslEs; + } + bool ok = false; + int v = version.toInt(&ok); + if (ok) + genShaders << std::make_pair(QShader::GlslShader, QShaderVersion(v, flags)); + else + printError("Ignoring invalid GLSL version %s", qPrintable(version)); + } + } + + if (cmdLineParser.isSet(hlslOption)) { + const QStringList versions = cmdLineParser.value(hlslOption).trimmed().split(','); + for (QString version : versions) { + bool ok = false; + int v = version.toInt(&ok); + if (ok) { + genShaders << std::make_pair(QShader::HlslShader, QShaderVersion(v)); + } else { + printError("Ignoring invalid HLSL (Shader Model) version %s", + qPrintable(version)); + } + } + } + + if (cmdLineParser.isSet(mslOption)) { + const QStringList versions = cmdLineParser.value(mslOption).trimmed().split(','); + for (QString version : versions) { + bool ok = false; + int v = version.toInt(&ok); + if (ok) + genShaders << std::make_pair(QShader::MslShader, QShaderVersion(v)); + else + printError("Ignoring invalid MSL version %s", qPrintable(version)); + } + } + + if (cmdLineParser.isSet(shortcutDefaultOption)) { + for (const QShaderBaker::GeneratedShader &genShaderEntry : + { + std::make_pair(QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs)), + std::make_pair(QShader::GlslShader, QShaderVersion(120)), + std::make_pair(QShader::GlslShader, QShaderVersion(150)), + std::make_pair(QShader::HlslShader, QShaderVersion(50)), + std::make_pair(QShader::MslShader, QShaderVersion(12)) + }) + { + if (!genShaders.contains(genShaderEntry)) + genShaders << genShaderEntry; + } + } + + baker.setGeneratedShaders(genShaders); + + if (cmdLineParser.isSet(defineOption)) { + QByteArray preamble; + const QStringList defines = cmdLineParser.values(defineOption); + for (const QString &def : defines) { + const QStringList defs = def.split(QLatin1Char('='), Qt::SkipEmptyParts); + if (!defs.isEmpty()) { + preamble.append("#define"); + for (const QString &s : defs) { + preamble.append(' '); + preamble.append(s.toUtf8()); + } + preamble.append('\n'); + } + } + baker.setPreamble(preamble); + } + + QShader bs = baker.bake(); + if (!bs.isValid()) { + printError("Shader baking failed: %s", qPrintable(baker.errorMessage())); + return 1; + } + + // post processing: run spirv-opt when requested for each entry with + // type SpirvShader and replace the contents. Not having spirv-opt + // available must not be a fatal error, skip it if the process fails. + if (cmdLineParser.isSet(spirvOptOption)) { + QTemporaryDir tempDir; + if (!tempDir.isValid()) { + printError("Failed to create temporary directory"); + return 1; + } + auto skeys = bs.availableShaders(); + for (QShaderKey &k : skeys) { + if (k.source() == QShader::SpirvShader) { + QShaderCode s = bs.shader(k); + + const QString tmpIn = writeTemp(tempDir, QLatin1String("qsb_spv_temp"), s, FileType::Binary); + const QString tmpOut = tempDir.path() + QLatin1String("/qsb_spv_temp_out"); + if (tmpIn.isEmpty()) + break; + + const QStringList arguments({ + QLatin1String("-O"), + QDir::toNativeSeparators(tmpIn), + QLatin1String("-o"), QDir::toNativeSeparators(tmpOut) + }); + QByteArray output; + QByteArray errorOutput; + bool success = runProcess(QLatin1String("spirv-opt"), arguments, &output, &errorOutput); + if (success) { + const QByteArray bytecode = readFile(tmpOut, FileType::Binary); + if (!bytecode.isEmpty()) + replaceShaderContents(&bs, k, QShader::SpirvShader, bytecode, s.entryPoint()); + } else { + if ((!output.isEmpty() || !errorOutput.isEmpty()) && !silent) { + printError("%s\n%s", + qPrintable(output.constData()), + qPrintable(errorOutput.constData())); + } + } + } + } + } + + // post processing: run fxc/dxc when requested for each entry with type + // HlslShader and add a new entry with type DxbcShader/DxilShader and remove the + // original HlslShader entry + if (cmdLineParser.isSet(fxcOption)) { + QTemporaryDir tempDir; + if (!tempDir.isValid()) { + printError("Failed to create temporary directory"); + return 1; + } + auto skeys = bs.availableShaders(); + for (QShaderKey &k : skeys) { + if (k.source() == QShader::HlslShader) { + // For Shader Model 6.0 and higher, use dxc, fxc will not compile that anymore. + const bool useDxc = k.sourceVersion().version() >= 60; + QShaderCode s = bs.shader(k); + + const QString tmpIn = writeTemp(tempDir, QLatin1String("qsb_hlsl_temp"), s, FileType::Text); + const QString tmpOut = tempDir.path() + QLatin1String("/qsb_hlsl_temp_out"); + if (tmpIn.isEmpty()) + break; + + const QByteArray typeArg = fxcProfile(bs, k); + QStringList arguments({ + QLatin1String("/nologo"), + QLatin1String("/E"), QString::fromLocal8Bit(s.entryPoint()), + QLatin1String("/T"), QString::fromLocal8Bit(typeArg), + QLatin1String("/Fo"), QDir::toNativeSeparators(tmpOut) + }); + if (cmdLineParser.isSet(debugInfoOption)) + arguments << QLatin1String("/Od") << QLatin1String("/Zi"); + arguments.append(QDir::toNativeSeparators(tmpIn)); + QByteArray output; + QByteArray errorOutput; + const QString compilerName = useDxc ? QLatin1String("dxc") : QLatin1String("fxc"); + bool success = runProcess(compilerName, arguments, &output, &errorOutput); + if (success) { + const QByteArray bytecode = readFile(tmpOut, FileType::Binary); + if (!bytecode.isEmpty()) { + const QShader::Source bytecodeType = useDxc ? QShader::DxilShader : QShader::DxbcShader; + replaceShaderContents(&bs, k, bytecodeType, bytecode, s.entryPoint()); + } + } else { + if ((!output.isEmpty() || !errorOutput.isEmpty()) && !silent) { + printError("%s\n%s", + qPrintable(output.constData()), + qPrintable(errorOutput.constData())); + } + } + } + } + } + + // post processing: run xcrun metal and metallib when requested for + // each entry with type MslShader and add a new entry with type + // MetalLibShader and remove the original MslShader entry + if (cmdLineParser.isSet(mtllibOption) || cmdLineParser.isSet(mtllibIosOption)) { + const bool isIos = cmdLineParser.isSet(mtllibIosOption); + QTemporaryDir tempDir; + if (!tempDir.isValid()) { + printError("Failed to create temporary directory"); + return 1; + } + auto skeys = bs.availableShaders(); + for (const QShaderKey &k : skeys) { + if (k.source() == QShader::MslShader) { + QShaderCode s = bs.shader(k); + + // having the .metal file extension may matter for the external tools here, so use that + const QString tmpIn = writeTemp(tempDir, QLatin1String("qsb_msl_temp.metal"), s, FileType::Text); + const QString tmpInterm = tempDir.path() + QLatin1String("/qsb_msl_temp_air"); + const QString tmpOut = tempDir.path() + QLatin1String("/qsb_msl_temp_out"); + if (tmpIn.isEmpty()) + break; + + const QString binary = QLatin1String("xcrun"); + const QStringList baseArguments = { + QLatin1String("-sdk"), + isIos ? QLatin1String("iphoneos") : QLatin1String("macosx") + }; + QStringList arguments = baseArguments; + const QString langVerFmt = QLatin1String("-std=%1-metal%2.%3"); + const QString langPlatform = isIos ? QLatin1String("ios") : QLatin1String("macos"); + const int langMajor = k.sourceVersion().version() / 10; + const int langMinor = k.sourceVersion().version() % 10; + const QString langVer = langVerFmt.arg(langPlatform).arg(langMajor).arg(langMinor); + arguments.append({ + QLatin1String("metal"), + QLatin1String("-c"), + langVer, + QDir::toNativeSeparators(tmpIn), + QLatin1String("-o"), + QDir::toNativeSeparators(tmpInterm) + }); + QByteArray output; + QByteArray errorOutput; + bool success = runProcess(binary, arguments, &output, &errorOutput); + if (success) { + arguments = baseArguments; + arguments.append({QLatin1String("metallib"), QDir::toNativeSeparators(tmpInterm), + QLatin1String("-o"), QDir::toNativeSeparators(tmpOut)}); + output.clear(); + errorOutput.clear(); + success = runProcess(binary, arguments, &output, &errorOutput); + if (success) { + const QByteArray bytecode = readFile(tmpOut, FileType::Binary); + if (!bytecode.isEmpty()) + replaceShaderContents(&bs, k, QShader::MetalLibShader, bytecode, s.entryPoint()); + } else { + if ((!output.isEmpty() || !errorOutput.isEmpty()) && !silent) { + printError("%s\n%s", + qPrintable(output.constData()), + qPrintable(errorOutput.constData())); + } + } + } else { + if ((!output.isEmpty() || !errorOutput.isEmpty()) && !silent) { + printError("%s\n%s", + qPrintable(output.constData()), + qPrintable(errorOutput.constData())); + } + } + } + } + } + + if (cmdLineParser.isSet(outputOption)) + writeToFile(bs.serialized(qsbVersion), cmdLineParser.value(outputOption), FileType::Binary); + } + + return 0; +} diff --git a/local/recipes/qt/qtshadertools/source/tools/qsb/qsb.pro b/local/recipes/qt/qtshadertools/source/tools/qsb/qsb.pro new file mode 100644 index 0000000000..371f4f7cf0 --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tools/qsb/qsb.pro @@ -0,0 +1,7 @@ +SOURCES += qsb.cpp + +QT += shadertools-private gui-private + +requires(qtConfig(process)) + +load(qt_tool) diff --git a/local/recipes/qt/qtshadertools/source/tools/tools.pro b/local/recipes/qt/qtshadertools/source/tools/tools.pro new file mode 100644 index 0000000000..267dc9876b --- /dev/null +++ b/local/recipes/qt/qtshadertools/source/tools/tools.pro @@ -0,0 +1,2 @@ +TEMPLATE = subdirs +SUBDIRS += qsb diff --git a/local/recipes/qt/qtsvg/source/tests/baseline/data/bugs/dasharray.svg b/local/recipes/qt/qtsvg/source/tests/baseline/data/bugs/dasharray.svg new file mode 100644 index 0000000000..dbc0b41907 --- /dev/null +++ b/local/recipes/qt/qtsvg/source/tests/baseline/data/bugs/dasharray.svg @@ -0,0 +1,21 @@ + + + invalid dasharray: + + + one length of dashes: + + surplus comma after first dash and gap: + + negative value after first dash and gap: + + alternating lengths of dashes: + + + small float dashes: + + missing separator after first dash and gap: + + alternating small float dashes: + + diff --git a/local/recipes/qt/qtsvg/source/tests/baseline/data/bugs/folderShadow.svg b/local/recipes/qt/qtsvg/source/tests/baseline/data/bugs/folderShadow.svg new file mode 100644 index 0000000000..15b0c6b7a4 --- /dev/null +++ b/local/recipes/qt/qtsvg/source/tests/baseline/data/bugs/folderShadow.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/local/recipes/qt/qtsvg/source/tests/baseline/data/bugs/zeroStrokeWidthPath.svg b/local/recipes/qt/qtsvg/source/tests/baseline/data/bugs/zeroStrokeWidthPath.svg new file mode 100644 index 0000000000..0c63238f35 --- /dev/null +++ b/local/recipes/qt/qtsvg/source/tests/baseline/data/bugs/zeroStrokeWidthPath.svg @@ -0,0 +1,4 @@ + + Strokes with zero width are not rendered + + \ No newline at end of file diff --git a/local/recipes/system/cpufreqd/Cargo.toml b/local/recipes/system/cpufreqd/Cargo.toml index b763430211..e50c61e067 100644 --- a/local/recipes/system/cpufreqd/Cargo.toml +++ b/local/recipes/system/cpufreqd/Cargo.toml @@ -8,5 +8,5 @@ name = "cpufreqd" path = "src/main.rs" [dependencies] -redox_syscall = "0.7" +redox_syscall = { path = "../../../../local/sources/syscall" } log = "0.4" diff --git a/local/recipes/system/cpufreqd/source/Cargo.toml b/local/recipes/system/cpufreqd/source/Cargo.toml index 20b90b5cf3..12a62bfab4 100644 --- a/local/recipes/system/cpufreqd/source/Cargo.toml +++ b/local/recipes/system/cpufreqd/source/Cargo.toml @@ -8,5 +8,8 @@ name = "cpufreqd" path = "src/main.rs" [dependencies] -redox_syscall = "0.8" +redox_syscall = { path = "../../../../../local/sources/syscall" } log = "0.4" + +[patch.crates-io] +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/system/devfsd/source/Cargo.toml b/local/recipes/system/devfsd/source/Cargo.toml index dd431b131f..136c7be576 100644 --- a/local/recipes/system/devfsd/source/Cargo.toml +++ b/local/recipes/system/devfsd/source/Cargo.toml @@ -8,7 +8,11 @@ name = "devfsd" path = "src/main.rs" [dependencies] -libredox = { version = "=0.1.16", features = ["call", "std"] } -redox-scheme = "0.11" -syscall = { package = "redox_syscall", version = "0.7", features = ["std"] } +libredox = { path = "../../../../../local/sources/libredox", features = ["call", "std"] } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +syscall = { path = "../../../../../local/sources/syscall", package = "redox_syscall", features = ["std"] } log = "0.4" + +[patch.crates-io] +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/system/diskd/source/Cargo.toml b/local/recipes/system/diskd/source/Cargo.toml index 04fec7d3f6..84a614ed9c 100644 --- a/local/recipes/system/diskd/source/Cargo.toml +++ b/local/recipes/system/diskd/source/Cargo.toml @@ -10,11 +10,15 @@ name = "diskd" path = "src/main.rs" [dependencies] -redox-scheme = "0.11" -libredox = { version = "=0.1.16", features = ["call", "std"] } -syscall = { package = "redox_syscall", version = "0.7", features = ["std"] } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +libredox = { path = "../../../../../local/sources/libredox", features = ["call", "std"] } +syscall = { path = "../../../../../local/sources/syscall", package = "redox_syscall", features = ["std"] } log = "0.4" [profile.release] opt-level = 3 lto = true + +[patch.crates-io] +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/system/driver-manager/Cargo.toml b/local/recipes/system/driver-manager/Cargo.toml index bea61f138f..415b8b28a0 100644 --- a/local/recipes/system/driver-manager/Cargo.toml +++ b/local/recipes/system/driver-manager/Cargo.toml @@ -12,7 +12,7 @@ path = "src/main.rs" redox-driver-core = { path = "../../drivers/redox-driver-core" } redox-driver-pci = { path = "../../drivers/redox-driver-pci" } pcid_interface = { path = "../../../../local/sources/base/drivers/pcid", package = "pcid" } -redox_syscall = "0.7" +redox_syscall = { path = "../../../../local/sources/syscall" } log = "0.4" toml = "0.8" serde = { version = "1", features = ["derive"] } diff --git a/local/recipes/system/driver-manager/source/Cargo.toml b/local/recipes/system/driver-manager/source/Cargo.toml index 1b11aa3207..58077f495f 100644 --- a/local/recipes/system/driver-manager/source/Cargo.toml +++ b/local/recipes/system/driver-manager/source/Cargo.toml @@ -12,11 +12,12 @@ path = "src/main.rs" redox-driver-core = { path = "../../../drivers/redox-driver-core/source" } redox-driver-pci = { path = "../../../drivers/redox-driver-pci/source" } pcid_interface = { path = "../../../../../local/sources/base/drivers/pcid", package = "pcid" } -redox-scheme = "=0.11.1" +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } log = "0.4" toml = "0.8" serde = { version = "1", features = ["derive"] } [patch.crates-io] redox_syscall = { path = "../../../../../local/sources/syscall" } -libredox = { path = "../../../../../local/sources/libredox" } \ No newline at end of file +libredox = { path = "../../../../../local/sources/libredox" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } \ No newline at end of file diff --git a/local/recipes/system/driver-params/Cargo.toml b/local/recipes/system/driver-params/Cargo.toml index da57f4248a..e596776120 100644 --- a/local/recipes/system/driver-params/Cargo.toml +++ b/local/recipes/system/driver-params/Cargo.toml @@ -8,7 +8,7 @@ name = "driver-params" path = "src/main.rs" [dependencies] -redox_syscall = "0.7" -redox-scheme = "0.11" -libredox = "0.1" +redox_syscall = { path = "../../../../local/sources/syscall" } +redox-scheme = { path = "../../../../local/sources/redox-scheme" } +libredox = { path = "../../../../local/sources/libredox" } log = "0.4" diff --git a/local/recipes/system/driver-params/source/Cargo.toml b/local/recipes/system/driver-params/source/Cargo.toml index ff0db90f22..c1f11575bc 100644 --- a/local/recipes/system/driver-params/source/Cargo.toml +++ b/local/recipes/system/driver-params/source/Cargo.toml @@ -8,7 +8,12 @@ name = "driver-params" path = "src/main.rs" [dependencies] -redox_syscall = "0.8" -redox-scheme = "0.11" -libredox = "0.1" +redox_syscall = { path = "../../../../../local/sources/syscall" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +libredox = { path = "../../../../../local/sources/libredox" } log = "0.4" + +[patch.crates-io] +libredox = { path = "../../../../../local/sources/libredox" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/system/evdevd/source/Cargo.toml b/local/recipes/system/evdevd/source/Cargo.toml index 236798e907..97520676e9 100644 --- a/local/recipes/system/evdevd/source/Cargo.toml +++ b/local/recipes/system/evdevd/source/Cargo.toml @@ -4,8 +4,8 @@ version = "0.2.5" edition = "2021" [dependencies] -redox-scheme = "0.11" -syscall = { package = "redox_syscall", version = "0.8" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +syscall = { path = "../../../../../local/sources/syscall", package = "redox_syscall" } log = { version = "0.4", features = ["std"] } thiserror = "2" orbclient = { version = "0.3", default-features = false } @@ -14,3 +14,7 @@ orbclient = { version = "0.3", default-features = false } redox_event = "0.4" [workspace] + +[patch.crates-io] +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/system/firmware-loader/source/Cargo.toml b/local/recipes/system/firmware-loader/source/Cargo.toml index caf3dba266..506db92e22 100644 --- a/local/recipes/system/firmware-loader/source/Cargo.toml +++ b/local/recipes/system/firmware-loader/source/Cargo.toml @@ -5,10 +5,15 @@ edition = "2021" [dependencies] libc = "0.2" -syscall = { package = "redox_syscall", version = "0.8", features = ["std"] } -redox_scheme = { package = "redox-scheme", version = "0.11" } -libredox = "0.1" +syscall = { path = "../../../../../local/sources/syscall", package = "redox_syscall", features = ["std"] } +redox_scheme = { path = "../../../../../local/sources/redox-scheme", package = "redox-scheme" } +libredox = { path = "../../../../../local/sources/libredox" } log = { version = "0.4", features = ["std"] } sha2 = "0.10" thiserror = "2" toml = "0.8" + +[patch.crates-io] +libredox = { path = "../../../../../local/sources/libredox" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/system/hwrngd/Cargo.toml b/local/recipes/system/hwrngd/Cargo.toml index 87ce93a87e..c733fb323c 100644 --- a/local/recipes/system/hwrngd/Cargo.toml +++ b/local/recipes/system/hwrngd/Cargo.toml @@ -8,7 +8,7 @@ name = "hwrngd" path = "source/src/main.rs" [dependencies] -libredox = { version = "0.1", features = ["call", "std"] } +libredox = { path = "../../../../local/sources/libredox", features = ["call", "std"] } log = { version = "0.4", features = ["std"] } -redox-scheme = "0.11" -syscall = { package = "redox_syscall", version = "0.7", features = ["std"] } +redox-scheme = { path = "../../../../local/sources/redox-scheme" } +syscall = { path = "../../../../local/sources/syscall", package = "redox_syscall", features = ["std"] } \ No newline at end of file diff --git a/local/recipes/system/hwrngd/source/Cargo.toml b/local/recipes/system/hwrngd/source/Cargo.toml index cfb942b24b..0a8306e796 100644 --- a/local/recipes/system/hwrngd/source/Cargo.toml +++ b/local/recipes/system/hwrngd/source/Cargo.toml @@ -8,7 +8,10 @@ name = "hwrngd" path = "src/main.rs" [dependencies] -libredox = { version = "0.1", features = ["call", "std"] } +libredox = { path = "../../../../../local/sources/libredox", features = ["call", "std"] } log = { version = "0.4", features = ["std"] } -redox-scheme = "0.11" -syscall = { package = "redox_syscall", version = "0.8", features = ["std"] } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +syscall = { path = "../../../../../local/sources/syscall", package = "redox_syscall", features = ["std"] } +[patch.crates-io] +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/system/iommu/source/Cargo.toml b/local/recipes/system/iommu/source/Cargo.toml index d3ed540a48..c5ce4f797d 100644 --- a/local/recipes/system/iommu/source/Cargo.toml +++ b/local/recipes/system/iommu/source/Cargo.toml @@ -5,9 +5,11 @@ edition = "2021" [dependencies] redox-driver-sys = { version = "0.2", path = "../../../drivers/redox-driver-sys/source" } -redox-scheme = "0.11" -syscall = { package = "redox_syscall", version = "0.8" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +syscall = { path = "../../../../../local/sources/syscall", package = "redox_syscall" } log = { version = "0.4", features = ["std"] } [patch.crates-io] redox-driver-sys = { path = "../../../drivers/redox-driver-sys/source" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/system/redbear-accessibility/source/Cargo.toml b/local/recipes/system/redbear-accessibility/source/Cargo.toml index 6f1110854b..64b2cf8345 100644 --- a/local/recipes/system/redbear-accessibility/source/Cargo.toml +++ b/local/recipes/system/redbear-accessibility/source/Cargo.toml @@ -4,5 +4,8 @@ version = "0.2.5" edition = "2021" [dependencies] -redox-scheme = "0.1" -syscall = { package = "redox_syscall", version = "0.4" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +syscall = { path = "../../../../../local/sources/syscall", package = "redox_syscall" } +[patch.crates-io] +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/system/redbear-acmd/source/Cargo.toml b/local/recipes/system/redbear-acmd/source/Cargo.toml index d406dcbcd1..6098a3c498 100644 --- a/local/recipes/system/redbear-acmd/source/Cargo.toml +++ b/local/recipes/system/redbear-acmd/source/Cargo.toml @@ -9,4 +9,6 @@ path = "src/main.rs" [dependencies] log = "0.4" -redox_syscall = "0.8" +redox_syscall = { path = "../../../../../local/sources/syscall" } +[patch.crates-io] +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/system/redbear-btctl/source/Cargo.toml b/local/recipes/system/redbear-btctl/source/Cargo.toml index 1af5abcaad..a36ba36aa5 100644 --- a/local/recipes/system/redbear-btctl/source/Cargo.toml +++ b/local/recipes/system/redbear-btctl/source/Cargo.toml @@ -9,7 +9,10 @@ path = "src/main.rs" [dependencies] libc = "0.2" -libredox = { version = "0.1", features = ["call", "std"] } +libredox = { path = "../../../../../local/sources/libredox", features = ["call", "std"] } log = { version = "0.4", features = ["std"] } -redox-scheme = "0.11" -syscall = { package = "redox_syscall", version = "0.8", features = ["std"] } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +syscall = { path = "../../../../../local/sources/syscall", package = "redox_syscall", features = ["std"] } +[patch.crates-io] +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/system/redbear-hwutils/source/Cargo.toml b/local/recipes/system/redbear-hwutils/source/Cargo.toml index 4a63cabbf4..4f943995ff 100644 --- a/local/recipes/system/redbear-hwutils/source/Cargo.toml +++ b/local/recipes/system/redbear-hwutils/source/Cargo.toml @@ -145,5 +145,8 @@ serde = { version = "1", features = ["derive"] } serde_json = "1" orbclient = "0.3" redox-driver-sys = { path = "../../../drivers/redox-driver-sys/source" } -libredox = "0.1" -syscall = { package = "redox_syscall", version = "0.8", features = ["std"] } +libredox = { path = "../../../../../local/sources/libredox" } +syscall = { path = "../../../../../local/sources/syscall", package = "redox_syscall", features = ["std"] } +[patch.crates-io] +libredox = { path = "../../../../../local/sources/libredox" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/system/redbear-ime/source/Cargo.toml b/local/recipes/system/redbear-ime/source/Cargo.toml index cfb622928e..28a5defff9 100644 --- a/local/recipes/system/redbear-ime/source/Cargo.toml +++ b/local/recipes/system/redbear-ime/source/Cargo.toml @@ -4,5 +4,8 @@ version = "0.2.5" edition = "2021" [dependencies] -redox-scheme = "0.1" -syscall = { package = "redox_syscall", version = "0.4" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +syscall = { path = "../../../../../local/sources/syscall", package = "redox_syscall" } +[patch.crates-io] +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/system/redbear-keymapd/source/Cargo.toml b/local/recipes/system/redbear-keymapd/source/Cargo.toml index f4d37c164c..f2ca6d78d6 100644 --- a/local/recipes/system/redbear-keymapd/source/Cargo.toml +++ b/local/recipes/system/redbear-keymapd/source/Cargo.toml @@ -6,9 +6,8 @@ edition = "2021" [dependencies] serde = { version = "1", features = ["derive"] } serde_json = "1" -redox-scheme = "0.1" -syscall = { package = "redox_syscall", version = "0.4" } - +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +syscall = { path = "../../../../../local/sources/syscall", package = "redox_syscall" } [lib] name = "keymapd" path = "src/lib.rs" @@ -16,3 +15,7 @@ path = "src/lib.rs" [[bin]] name = "redbear-keymapd" path = "src/main.rs" + +[patch.crates-io] +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/system/redbear-sessiond/source/Cargo.toml b/local/recipes/system/redbear-sessiond/source/Cargo.toml index b9a04204fd..73ba3cd1f7 100644 --- a/local/recipes/system/redbear-sessiond/source/Cargo.toml +++ b/local/recipes/system/redbear-sessiond/source/Cargo.toml @@ -12,9 +12,8 @@ zbus = { version = "5", default-features = false, features = ["tokio"] } tokio = { version = "1", features = ["full"] } serde = { version = "1", features = ["derive"] } serde_json = "1" -libredox = "0.1" -redox-syscall = { package = "redox_syscall", version = "0.8" } - +libredox = { path = "../../../../../local/sources/libredox" } +redox-syscall = { path = "../../../../../local/sources/syscall", package = "redox_syscall" } # Patch tokio to recover from transient EBADF/EINVAL on Redox's scheme:event # epoll. Without this, redbear-sessiond panics during early-boot scheme # churn. The patch lives at local/patches/tokio/P0-epoll-redox-recovery.patch @@ -23,3 +22,5 @@ redox-syscall = { package = "redox_syscall", version = "0.8" } # epoll scheme is stabilized to never return EBADF/EINVAL under normal use). [patch.crates-io] tokio = { path = "../../../../../local/patches/tokio/vendored" } +libredox = { path = "../../../../../local/sources/libredox" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/system/redbear-traceroute/source/Cargo.toml b/local/recipes/system/redbear-traceroute/source/Cargo.toml index bd6ac1f060..b2805f972c 100644 --- a/local/recipes/system/redbear-traceroute/source/Cargo.toml +++ b/local/recipes/system/redbear-traceroute/source/Cargo.toml @@ -16,5 +16,8 @@ anyhow = "1" [target.'cfg(target_os = "redox")'.dependencies] libc = "0.2" -libredox = "0.1" -syscall = { package = "redox_syscall", version = "0.8", features = ["std"] } +libredox = { path = "../../../../../local/sources/libredox" } +syscall = { path = "../../../../../local/sources/syscall", package = "redox_syscall", features = ["std"] } +[patch.crates-io] +libredox = { path = "../../../../../local/sources/libredox" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/system/redbear-wifictl/source/Cargo.toml b/local/recipes/system/redbear-wifictl/source/Cargo.toml index 3f149211db..7f2a2b244a 100644 --- a/local/recipes/system/redbear-wifictl/source/Cargo.toml +++ b/local/recipes/system/redbear-wifictl/source/Cargo.toml @@ -13,12 +13,16 @@ dbus-nm = ["dep:zbus"] [dependencies] libc = "0.2" -libredox = { version = "0.1", features = ["call", "std"] } +libredox = { path = "../../../../../local/sources/libredox", features = ["call", "std"] } log = { version = "0.4", features = ["std"] } -redox-scheme = "0.11" -syscall = { package = "redox_syscall", version = "0.8", features = ["std"] } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +syscall = { path = "../../../../../local/sources/syscall", package = "redox_syscall", features = ["std"] } redox-driver-sys = { path = "../../../drivers/redox-driver-sys/source" } zbus = { version = "5", default-features = false, features = ["tokio"], optional = true } [target.'cfg(target_os = "redox")'.dependencies] redox-driver-sys = { path = "../../../drivers/redox-driver-sys/source", features = ["redox"] } + +[patch.crates-io] +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/system/thermald/Cargo.toml b/local/recipes/system/thermald/Cargo.toml index d6a2e8a328..05fed5e8ab 100644 --- a/local/recipes/system/thermald/Cargo.toml +++ b/local/recipes/system/thermald/Cargo.toml @@ -9,7 +9,7 @@ path = "source/src/main.rs" [dependencies] libc = "0.2" -libredox = { version = "0.1", features = ["call", "std"] } +libredox = { path = "../../../../local/sources/libredox", features = ["call", "std"] } log = { version = "0.4", features = ["std"] } -redox-scheme = "0.11" -syscall = { package = "redox_syscall", version = "0.7", features = ["std"] } +redox-scheme = { path = "../../../../local/sources/redox-scheme" } +syscall = { path = "../../../../local/sources/syscall", package = "redox_syscall", features = ["std"] } \ No newline at end of file diff --git a/local/recipes/system/thermald/source/Cargo.toml b/local/recipes/system/thermald/source/Cargo.toml index 99b2ef73d7..a9fd406c81 100644 --- a/local/recipes/system/thermald/source/Cargo.toml +++ b/local/recipes/system/thermald/source/Cargo.toml @@ -9,7 +9,10 @@ path = "src/main.rs" [dependencies] libc = "0.2" -libredox = { version = "0.1", features = ["call", "std"] } +libredox = { path = "../../../../../local/sources/libredox", features = ["call", "std"] } log = { version = "0.4", features = ["std"] } -redox-scheme = "0.11" -syscall = { package = "redox_syscall", version = "0.8", features = ["std"] } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +syscall = { path = "../../../../../local/sources/syscall", package = "redox_syscall", features = ["std"] } +[patch.crates-io] +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/system/udev-shim/source/Cargo.toml b/local/recipes/system/udev-shim/source/Cargo.toml index e0ee626f2f..9e5584b9de 100644 --- a/local/recipes/system/udev-shim/source/Cargo.toml +++ b/local/recipes/system/udev-shim/source/Cargo.toml @@ -5,9 +5,14 @@ edition = "2021" [dependencies] libc = "0.2" -libredox = "0.1" -redox-scheme = "0.11" -syscall = { package = "redox_syscall", version = "0.8", features = ["std"] } +libredox = { path = "../../../../../local/sources/libredox" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +syscall = { path = "../../../../../local/sources/syscall", package = "redox_syscall", features = ["std"] } log = { version = "0.4", features = ["std"] } thiserror = "2" redbear-hwutils = { path = "../../redbear-hwutils/source" } + +[patch.crates-io] +libredox = { path = "../../../../../local/sources/libredox" } +redox-scheme = { path = "../../../../../local/sources/redox-scheme" } +redox_syscall = { path = "../../../../../local/sources/syscall" } diff --git a/local/recipes/tools/diffutils/source/.tarball-version b/local/recipes/tools/diffutils/source/.tarball-version new file mode 100644 index 0000000000..d70c8f8d89 --- /dev/null +++ b/local/recipes/tools/diffutils/source/.tarball-version @@ -0,0 +1 @@ +3.6 diff --git a/local/recipes/tools/diffutils/source/ABOUT-NLS b/local/recipes/tools/diffutils/source/ABOUT-NLS new file mode 100644 index 0000000000..b1de1b6832 --- /dev/null +++ b/local/recipes/tools/diffutils/source/ABOUT-NLS @@ -0,0 +1,1282 @@ +1 Notes on the Free Translation Project +*************************************** + +Free software is going international! The Free Translation Project is +a way to get maintainers of free software, translators, and users all +together, so that free software will gradually become able to speak many +languages. A few packages already provide translations for their +messages. + + If you found this `ABOUT-NLS' file inside a distribution, you may +assume that the distributed package does use GNU `gettext' internally, +itself available at your nearest GNU archive site. But you do _not_ +need to install GNU `gettext' prior to configuring, installing or using +this package with messages translated. + + Installers will find here some useful hints. These notes also +explain how users should proceed for getting the programs to use the +available translations. They tell how people wanting to contribute and +work on translations can contact the appropriate team. + +1.1 INSTALL Matters +=================== + +Some packages are "localizable" when properly installed; the programs +they contain can be made to speak your own native language. Most such +packages use GNU `gettext'. Other packages have their own ways to +internationalization, predating GNU `gettext'. + + By default, this package will be installed to allow translation of +messages. It will automatically detect whether the system already +provides the GNU `gettext' functions. Installers may use special +options at configuration time for changing the default behaviour. The +command: + + ./configure --disable-nls + +will _totally_ disable translation of messages. + + When you already have GNU `gettext' installed on your system and run +configure without an option for your new package, `configure' will +probably detect the previously built and installed `libintl' library +and will decide to use it. If not, you may have to to use the +`--with-libintl-prefix' option to tell `configure' where to look for it. + + Internationalized packages usually have many `po/LL.po' files, where +LL gives an ISO 639 two-letter code identifying the language. Unless +translations have been forbidden at `configure' time by using the +`--disable-nls' switch, all available translations are installed +together with the package. However, the environment variable `LINGUAS' +may be set, prior to configuration, to limit the installed set. +`LINGUAS' should then contain a space separated list of two-letter +codes, stating which languages are allowed. + +1.2 Using This Package +====================== + +As a user, if your language has been installed for this package, you +only have to set the `LANG' environment variable to the appropriate +`LL_CC' combination. If you happen to have the `LC_ALL' or some other +`LC_xxx' environment variables set, you should unset them before +setting `LANG', otherwise the setting of `LANG' will not have the +desired effect. Here `LL' is an ISO 639 two-letter language code, and +`CC' is an ISO 3166 two-letter country code. For example, let's +suppose that you speak German and live in Germany. At the shell +prompt, merely execute `setenv LANG de_DE' (in `csh'), +`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). +This can be done from your `.login' or `.profile' file, once and for +all. + + You might think that the country code specification is redundant. +But in fact, some languages have dialects in different countries. For +example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The +country code serves to distinguish the dialects. + + The locale naming convention of `LL_CC', with `LL' denoting the +language and `CC' denoting the country, is the one use on systems based +on GNU libc. On other systems, some variations of this scheme are +used, such as `LL' or `LL_CC.ENCODING'. You can get the list of +locales supported by your system for your language by running the +command `locale -a | grep '^LL''. + + Not all programs have translations for all languages. By default, an +English message is shown in place of a nonexistent translation. If you +understand other languages, you can set up a priority list of languages. +This is done through a different environment variable, called +`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' +for the purpose of message handling, but you still need to have `LANG' +set to the primary language; this is required by other parts of the +system libraries. For example, some Swedish users who would rather +read translations in German than English for when Swedish is not +available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. + + Special advice for Norwegian users: The language code for Norwegian +bokma*l changed from `no' to `nb' recently (in 2003). During the +transition period, while some message catalogs for this language are +installed under `nb' and some older ones under `no', it's recommended +for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and +older translations are used. + + In the `LANGUAGE' environment variable, but not in the `LANG' +environment variable, `LL_CC' combinations can be abbreviated as `LL' +to denote the language's main dialect. For example, `de' is equivalent +to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' +(Portuguese as spoken in Portugal) in this context. + +1.3 Translating Teams +===================== + +For the Free Translation Project to be a success, we need interested +people who like their own language and write it well, and who are also +able to synergize with other translators speaking the same language. +Each translation team has its own mailing list. The up-to-date list of +teams can be found at the Free Translation Project's homepage, +`http://translationproject.org/', in the "Teams" area. + + If you'd like to volunteer to _work_ at translating messages, you +should become a member of the translating team for your own language. +The subscribing address is _not_ the same as the list itself, it has +`-request' appended. For example, speakers of Swedish can send a +message to `sv-request@li.org', having this message body: + + subscribe + + Keep in mind that team members are expected to participate +_actively_ in translations, or at solving translational difficulties, +rather than merely lurking around. If your team does not exist yet and +you want to start one, or if you are unsure about what to do or how to +get started, please write to `coordinator@translationproject.org' to +reach the coordinator for all translator teams. + + The English team is special. It works at improving and uniformizing +the terminology in use. Proven linguistic skills are praised more than +programming skills, here. + +1.4 Available Packages +====================== + +Languages are not equally supported in all packages. The following +matrix shows the current state of internationalization, as of June +2010. The matrix shows, in regard of each package, for which languages +PO files have been submitted to translation coordination, with a +translation percentage of at least 50%. + + Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca + +--------------------------------------------------+ + a2ps | [] [] | + aegis | | + ant-phone | | + anubis | | + aspell | [] [] | + bash | | + bfd | | + bibshelf | [] | + binutils | | + bison | | + bison-runtime | [] | + bluez-pin | [] [] | + bombono-dvd | | + buzztard | | + cflow | | + clisp | | + coreutils | [] [] | + cpio | | + cppi | | + cpplib | [] | + cryptsetup | | + dfarc | | + dialog | [] [] | + dico | | + diffutils | [] | + dink | | + doodle | | + e2fsprogs | [] | + enscript | [] | + exif | | + fetchmail | [] | + findutils | [] | + flex | [] | + freedink | | + gas | | + gawk | [] [] | + gcal | [] | + gcc | | + gettext-examples | [] [] [] [] | + gettext-runtime | [] [] | + gettext-tools | [] [] | + gip | [] | + gjay | | + gliv | [] | + glunarclock | [] [] | + gnubiff | | + gnucash | [] | + gnuedu | | + gnulib | | + gnunet | | + gnunet-gtk | | + gnutls | | + gold | | + gpe-aerial | | + gpe-beam | | + gpe-bluetooth | | + gpe-calendar | | + gpe-clock | [] | + gpe-conf | | + gpe-contacts | | + gpe-edit | | + gpe-filemanager | | + gpe-go | | + gpe-login | | + gpe-ownerinfo | [] | + gpe-package | | + gpe-sketchbook | | + gpe-su | [] | + gpe-taskmanager | [] | + gpe-timesheet | [] | + gpe-today | [] | + gpe-todo | | + gphoto2 | | + gprof | [] | + gpsdrive | | + gramadoir | | + grep | | + grub | [] [] | + gsasl | | + gss | | + gst-plugins-bad | [] | + gst-plugins-base | [] | + gst-plugins-good | [] | + gst-plugins-ugly | [] | + gstreamer | [] [] [] | + gtick | | + gtkam | [] | + gtkorphan | [] | + gtkspell | [] [] [] | + gutenprint | | + hello | [] | + help2man | | + hylafax | | + idutils | | + indent | [] [] | + iso_15924 | | + iso_3166 | [] [] [] [] [] [] [] | + iso_3166_2 | | + iso_4217 | | + iso_639 | [] [] [] [] | + iso_639_3 | | + jwhois | | + kbd | | + keytouch | [] | + keytouch-editor | | + keytouch-keyboa... | [] | + klavaro | [] | + latrine | | + ld | [] | + leafpad | [] [] | + libc | [] [] | + libexif | () | + libextractor | | + libgnutls | | + libgpewidget | | + libgpg-error | | + libgphoto2 | | + libgphoto2_port | | + libgsasl | | + libiconv | [] | + libidn | | + lifelines | | + liferea | [] [] | + lilypond | | + linkdr | [] | + lordsawar | | + lprng | | + lynx | [] | + m4 | | + mailfromd | | + mailutils | | + make | | + man-db | | + man-db-manpages | | + minicom | | + mkisofs | | + myserver | | + nano | [] [] | + opcodes | | + parted | | + pies | | + popt | | + psmisc | | + pspp | [] | + pwdutils | | + radius | [] | + recode | [] [] | + rosegarden | | + rpm | | + rush | | + sarg | | + screem | | + scrollkeeper | [] [] [] | + sed | [] [] | + sharutils | [] [] | + shishi | | + skencil | | + solfege | | + solfege-manual | | + soundtracker | | + sp | | + sysstat | | + tar | [] | + texinfo | | + tin | | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | [] | + vice | | + vmm | | + vorbis-tools | | + wastesedge | | + wdiff | | + wget | [] [] | + wyslij-po | | + xchat | [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] | + +--------------------------------------------------+ + af am an ar as ast az be be@latin bg bn_IN bs ca + 6 0 1 2 3 19 1 10 3 28 3 1 38 + + crh cs da de el en en_GB en_ZA eo es et eu fa + +-------------------------------------------------+ + a2ps | [] [] [] [] [] [] [] | + aegis | [] [] [] | + ant-phone | [] () | + anubis | [] [] | + aspell | [] [] [] [] [] | + bash | [] [] [] | + bfd | [] | + bibshelf | [] [] [] | + binutils | [] | + bison | [] [] | + bison-runtime | [] [] [] [] | + bluez-pin | [] [] [] [] [] [] | + bombono-dvd | [] | + buzztard | [] [] [] | + cflow | [] [] | + clisp | [] [] [] [] | + coreutils | [] [] [] [] | + cpio | | + cppi | | + cpplib | [] [] [] | + cryptsetup | [] | + dfarc | [] [] [] | + dialog | [] [] [] [] [] | + dico | | + diffutils | [] [] [] [] [] [] | + dink | [] [] [] | + doodle | [] | + e2fsprogs | [] [] [] | + enscript | [] [] [] | + exif | () [] [] | + fetchmail | [] [] () [] [] [] | + findutils | [] [] [] | + flex | [] [] | + freedink | [] [] [] | + gas | [] | + gawk | [] [] [] | + gcal | [] | + gcc | [] [] | + gettext-examples | [] [] [] [] | + gettext-runtime | [] [] [] [] | + gettext-tools | [] [] [] | + gip | [] [] [] [] | + gjay | [] | + gliv | [] [] [] | + glunarclock | [] [] | + gnubiff | () | + gnucash | [] () () () () | + gnuedu | [] [] | + gnulib | [] [] | + gnunet | | + gnunet-gtk | [] | + gnutls | [] [] | + gold | [] | + gpe-aerial | [] [] [] [] | + gpe-beam | [] [] [] [] | + gpe-bluetooth | [] [] | + gpe-calendar | [] | + gpe-clock | [] [] [] [] | + gpe-conf | [] [] [] | + gpe-contacts | [] [] [] | + gpe-edit | [] [] | + gpe-filemanager | [] [] [] | + gpe-go | [] [] [] [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] [] [] | + gpe-package | [] [] [] | + gpe-sketchbook | [] [] [] [] | + gpe-su | [] [] [] [] | + gpe-taskmanager | [] [] [] [] | + gpe-timesheet | [] [] [] [] | + gpe-today | [] [] [] [] | + gpe-todo | [] [] [] | + gphoto2 | [] [] () [] [] [] | + gprof | [] [] [] | + gpsdrive | [] [] [] | + gramadoir | [] [] [] | + grep | [] | + grub | [] [] | + gsasl | [] | + gss | | + gst-plugins-bad | [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] | + gtick | [] () [] | + gtkam | [] [] () [] [] | + gtkorphan | [] [] [] [] | + gtkspell | [] [] [] [] [] [] [] | + gutenprint | [] [] [] | + hello | [] [] [] [] | + help2man | [] | + hylafax | [] [] | + idutils | [] [] | + indent | [] [] [] [] [] [] [] | + iso_15924 | [] () [] [] | + iso_3166 | [] [] [] [] () [] [] [] () | + iso_3166_2 | () | + iso_4217 | [] [] [] () [] [] | + iso_639 | [] [] [] [] () [] [] | + iso_639_3 | [] | + jwhois | [] | + kbd | [] [] [] [] [] | + keytouch | [] [] | + keytouch-editor | [] [] | + keytouch-keyboa... | [] | + klavaro | [] [] [] [] | + latrine | [] () | + ld | [] [] | + leafpad | [] [] [] [] [] [] | + libc | [] [] [] [] | + libexif | [] [] () | + libextractor | | + libgnutls | [] | + libgpewidget | [] [] | + libgpg-error | [] [] | + libgphoto2 | [] () | + libgphoto2_port | [] () [] | + libgsasl | | + libiconv | [] [] [] [] [] | + libidn | [] [] [] | + lifelines | [] () | + liferea | [] [] [] [] [] | + lilypond | [] [] [] | + linkdr | [] [] [] | + lordsawar | [] | + lprng | | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailfromd | | + mailutils | [] | + make | [] [] [] | + man-db | | + man-db-manpages | | + minicom | [] [] [] [] | + mkisofs | | + myserver | | + nano | [] [] [] | + opcodes | [] [] | + parted | [] [] | + pies | | + popt | [] [] [] [] [] | + psmisc | [] [] [] | + pspp | [] | + pwdutils | [] | + radius | [] | + recode | [] [] [] [] [] [] | + rosegarden | () () () | + rpm | [] [] [] | + rush | | + sarg | | + screem | | + scrollkeeper | [] [] [] [] [] | + sed | [] [] [] [] [] [] | + sharutils | [] [] [] [] | + shishi | | + skencil | [] () [] | + solfege | [] [] [] | + solfege-manual | [] [] | + soundtracker | [] [] [] | + sp | [] | + sysstat | [] [] [] | + tar | [] [] [] [] | + texinfo | [] [] [] | + tin | [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | [] [] [] [] | + vice | () () | + vmm | [] | + vorbis-tools | [] [] | + wastesedge | [] | + wdiff | [] [] | + wget | [] [] [] | + wyslij-po | | + xchat | [] [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] [] [] | + +-------------------------------------------------+ + crh cs da de el en en_GB en_ZA eo es et eu fa + 5 64 105 117 18 1 8 0 28 89 18 19 0 + + fi fr ga gl gu he hi hr hu hy id is it ja ka kn + +----------------------------------------------------+ + a2ps | [] [] [] [] | + aegis | [] [] | + ant-phone | [] [] | + anubis | [] [] [] [] | + aspell | [] [] [] [] | + bash | [] [] [] [] | + bfd | [] [] [] | + bibshelf | [] [] [] [] [] | + binutils | [] [] [] | + bison | [] [] [] [] | + bison-runtime | [] [] [] [] [] [] | + bluez-pin | [] [] [] [] [] [] [] [] | + bombono-dvd | [] | + buzztard | [] | + cflow | [] [] [] | + clisp | [] | + coreutils | [] [] [] [] [] | + cpio | [] [] [] [] | + cppi | [] [] | + cpplib | [] [] [] | + cryptsetup | [] [] [] | + dfarc | [] [] [] | + dialog | [] [] [] [] [] [] [] | + dico | | + diffutils | [] [] [] [] [] [] [] [] [] | + dink | [] | + doodle | [] [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] | + exif | [] [] [] [] [] [] | + fetchmail | [] [] [] [] | + findutils | [] [] [] [] [] [] | + flex | [] [] [] | + freedink | [] [] [] | + gas | [] [] | + gawk | [] [] [] [] () [] | + gcal | [] | + gcc | [] | + gettext-examples | [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] | + gettext-tools | [] [] [] [] | + gip | [] [] [] [] [] [] | + gjay | [] | + gliv | [] () | + glunarclock | [] [] [] [] | + gnubiff | () [] () | + gnucash | () () () () () [] | + gnuedu | [] [] | + gnulib | [] [] [] [] [] [] | + gnunet | | + gnunet-gtk | [] | + gnutls | [] [] | + gold | [] [] | + gpe-aerial | [] [] [] | + gpe-beam | [] [] [] [] | + gpe-bluetooth | [] [] [] [] | + gpe-calendar | [] [] | + gpe-clock | [] [] [] [] [] | + gpe-conf | [] [] [] [] | + gpe-contacts | [] [] [] [] | + gpe-edit | [] [] [] | + gpe-filemanager | [] [] [] [] | + gpe-go | [] [] [] [] [] | + gpe-login | [] [] [] | + gpe-ownerinfo | [] [] [] [] [] | + gpe-package | [] [] [] | + gpe-sketchbook | [] [] [] [] | + gpe-su | [] [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] | + gpe-timesheet | [] [] [] [] [] | + gpe-today | [] [] [] [] [] [] [] | + gpe-todo | [] [] [] | + gphoto2 | [] [] [] [] [] [] | + gprof | [] [] [] [] | + gpsdrive | [] [] [] | + gramadoir | [] [] [] | + grep | [] [] | + grub | [] [] [] [] | + gsasl | [] [] [] [] [] | + gss | [] [] [] [] [] | + gst-plugins-bad | [] [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] | + gtick | [] [] [] [] [] | + gtkam | [] [] [] [] [] | + gtkorphan | [] [] [] | + gtkspell | [] [] [] [] [] [] [] [] [] | + gutenprint | [] [] [] [] | + hello | [] [] [] | + help2man | [] [] | + hylafax | [] | + idutils | [] [] [] [] [] [] | + indent | [] [] [] [] [] [] [] [] | + iso_15924 | [] () [] [] | + iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] | + iso_3166_2 | () [] [] [] | + iso_4217 | [] () [] [] [] [] | + iso_639 | [] () [] [] [] [] [] [] [] | + iso_639_3 | () [] [] | + jwhois | [] [] [] [] [] | + kbd | [] [] | + keytouch | [] [] [] [] [] [] | + keytouch-editor | [] [] [] [] [] | + keytouch-keyboa... | [] [] [] [] [] | + klavaro | [] [] | + latrine | [] [] [] | + ld | [] [] [] [] | + leafpad | [] [] [] [] [] [] [] () | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | | + libgnutls | [] [] | + libgpewidget | [] [] [] [] | + libgpg-error | [] [] | + libgphoto2 | [] [] [] | + libgphoto2_port | [] [] [] | + libgsasl | [] [] [] [] [] | + libiconv | [] [] [] [] [] [] | + libidn | [] [] [] [] | + lifelines | () | + liferea | [] [] [] [] | + lilypond | [] [] | + linkdr | [] [] [] [] [] | + lordsawar | | + lprng | [] | + lynx | [] [] [] [] [] | + m4 | [] [] [] [] [] [] | + mailfromd | | + mailutils | [] [] | + make | [] [] [] [] [] [] [] [] [] | + man-db | [] [] | + man-db-manpages | [] | + minicom | [] [] [] [] [] | + mkisofs | [] [] [] [] | + myserver | | + nano | [] [] [] [] [] [] | + opcodes | [] [] [] [] | + parted | [] [] [] [] | + pies | | + popt | [] [] [] [] [] [] [] [] [] | + psmisc | [] [] [] | + pspp | | + pwdutils | [] [] | + radius | [] [] | + recode | [] [] [] [] [] [] [] [] | + rosegarden | () () () () () | + rpm | [] [] | + rush | | + sarg | [] | + screem | [] [] | + scrollkeeper | [] [] [] [] | + sed | [] [] [] [] [] [] [] [] | + sharutils | [] [] [] [] [] [] [] | + shishi | [] | + skencil | [] | + solfege | [] [] [] [] | + solfege-manual | [] [] | + soundtracker | [] [] | + sp | [] () | + sysstat | [] [] [] [] [] | + tar | [] [] [] [] [] [] [] | + texinfo | [] [] [] [] | + tin | [] | + unicode-han-tra... | | + unicode-transla... | [] [] | + util-linux-ng | [] [] [] [] [] [] | + vice | () () () | + vmm | [] | + vorbis-tools | [] | + wastesedge | () () | + wdiff | [] | + wget | [] [] [] [] [] [] [] [] | + wyslij-po | [] [] [] | + xchat | [] [] [] [] [] [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] [] | + +----------------------------------------------------+ + fi fr ga gl gu he hi hr hu hy id is it ja ka kn + 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4 + + ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne + +-----------------------------------------------+ + a2ps | [] | + aegis | | + ant-phone | | + anubis | [] [] | + aspell | [] | + bash | | + bfd | | + bibshelf | [] [] | + binutils | | + bison | [] | + bison-runtime | [] [] [] [] [] | + bluez-pin | [] [] [] [] [] | + bombono-dvd | | + buzztard | | + cflow | | + clisp | | + coreutils | [] | + cpio | | + cppi | | + cpplib | | + cryptsetup | | + dfarc | [] | + dialog | [] [] [] [] [] | + dico | | + diffutils | [] [] | + dink | | + doodle | | + e2fsprogs | | + enscript | | + exif | [] | + fetchmail | | + findutils | | + flex | | + freedink | [] | + gas | | + gawk | | + gcal | | + gcc | | + gettext-examples | [] [] [] [] | + gettext-runtime | [] | + gettext-tools | [] | + gip | [] [] | + gjay | | + gliv | | + glunarclock | [] | + gnubiff | | + gnucash | () () () () | + gnuedu | | + gnulib | | + gnunet | | + gnunet-gtk | | + gnutls | [] | + gold | | + gpe-aerial | [] | + gpe-beam | [] | + gpe-bluetooth | [] [] | + gpe-calendar | [] | + gpe-clock | [] [] [] [] [] | + gpe-conf | [] [] | + gpe-contacts | [] [] | + gpe-edit | [] | + gpe-filemanager | [] [] | + gpe-go | [] [] [] | + gpe-login | [] | + gpe-ownerinfo | [] [] | + gpe-package | [] [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] [] | + gpe-timesheet | [] [] | + gpe-today | [] [] [] [] | + gpe-todo | [] [] | + gphoto2 | | + gprof | [] | + gpsdrive | | + gramadoir | | + grep | | + grub | | + gsasl | | + gss | | + gst-plugins-bad | [] [] [] [] | + gst-plugins-base | [] [] | + gst-plugins-good | [] [] | + gst-plugins-ugly | [] [] [] [] [] | + gstreamer | | + gtick | | + gtkam | [] | + gtkorphan | [] [] | + gtkspell | [] [] [] [] [] [] [] | + gutenprint | | + hello | [] [] [] | + help2man | | + hylafax | | + idutils | | + indent | | + iso_15924 | [] [] | + iso_3166 | [] [] () [] [] [] [] [] | + iso_3166_2 | | + iso_4217 | [] [] | + iso_639 | [] [] | + iso_639_3 | [] | + jwhois | [] | + kbd | | + keytouch | [] | + keytouch-editor | [] | + keytouch-keyboa... | [] | + klavaro | [] | + latrine | [] | + ld | | + leafpad | [] [] [] | + libc | [] | + libexif | | + libextractor | | + libgnutls | [] | + libgpewidget | [] [] | + libgpg-error | | + libgphoto2 | | + libgphoto2_port | | + libgsasl | | + libiconv | | + libidn | | + lifelines | | + liferea | | + lilypond | | + linkdr | | + lordsawar | | + lprng | | + lynx | | + m4 | | + mailfromd | | + mailutils | | + make | [] | + man-db | | + man-db-manpages | | + minicom | [] | + mkisofs | | + myserver | | + nano | [] [] | + opcodes | | + parted | | + pies | | + popt | [] [] [] | + psmisc | | + pspp | | + pwdutils | | + radius | | + recode | | + rosegarden | | + rpm | | + rush | | + sarg | | + screem | | + scrollkeeper | [] [] | + sed | | + sharutils | | + shishi | | + skencil | | + solfege | [] | + solfege-manual | | + soundtracker | | + sp | | + sysstat | [] | + tar | [] | + texinfo | [] | + tin | | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | | + vice | | + vmm | | + vorbis-tools | | + wastesedge | | + wdiff | | + wget | [] | + wyslij-po | | + xchat | [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] | + +-----------------------------------------------+ + ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne + 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1 + + nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr + +---------------------------------------------------+ + a2ps | [] [] [] [] [] [] [] [] | + aegis | [] [] [] | + ant-phone | [] [] | + anubis | [] [] [] | + aspell | [] [] [] [] [] | + bash | [] [] | + bfd | [] | + bibshelf | [] [] | + binutils | [] [] | + bison | [] [] [] | + bison-runtime | [] [] [] [] [] [] [] | + bluez-pin | [] [] [] [] [] [] [] [] | + bombono-dvd | [] () | + buzztard | [] [] | + cflow | [] | + clisp | [] [] | + coreutils | [] [] [] [] [] [] | + cpio | [] [] [] | + cppi | [] | + cpplib | [] | + cryptsetup | [] | + dfarc | [] | + dialog | [] [] [] [] | + dico | [] | + diffutils | [] [] [] [] [] [] | + dink | () | + doodle | [] [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] [] | + exif | [] [] [] () [] | + fetchmail | [] [] [] [] | + findutils | [] [] [] [] [] | + flex | [] [] [] [] [] | + freedink | [] [] | + gas | | + gawk | [] [] [] [] | + gcal | | + gcc | [] | + gettext-examples | [] [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] [] [] [] | + gettext-tools | [] [] [] [] [] [] | + gip | [] [] [] [] [] | + gjay | | + gliv | [] [] [] [] [] [] | + glunarclock | [] [] [] [] [] | + gnubiff | [] () | + gnucash | [] () () () | + gnuedu | [] | + gnulib | [] [] [] [] | + gnunet | | + gnunet-gtk | | + gnutls | [] [] | + gold | | + gpe-aerial | [] [] [] [] [] [] [] | + gpe-beam | [] [] [] [] [] [] [] | + gpe-bluetooth | [] [] | + gpe-calendar | [] [] [] [] | + gpe-clock | [] [] [] [] [] [] [] [] | + gpe-conf | [] [] [] [] [] [] [] | + gpe-contacts | [] [] [] [] [] | + gpe-edit | [] [] [] | + gpe-filemanager | [] [] [] | + gpe-go | [] [] [] [] [] [] [] [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] [] [] [] [] [] [] | + gpe-package | [] [] | + gpe-sketchbook | [] [] [] [] [] [] [] | + gpe-su | [] [] [] [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] [] [] [] | + gpe-timesheet | [] [] [] [] [] [] [] [] | + gpe-today | [] [] [] [] [] [] [] [] | + gpe-todo | [] [] [] [] [] | + gphoto2 | [] [] [] [] [] [] [] [] | + gprof | [] [] [] | + gpsdrive | [] [] | + gramadoir | [] [] | + grep | [] [] [] [] | + grub | [] [] [] | + gsasl | [] [] [] [] | + gss | [] [] [] | + gst-plugins-bad | [] [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] | + gtick | [] [] [] | + gtkam | [] [] [] [] [] [] | + gtkorphan | [] | + gtkspell | [] [] [] [] [] [] [] [] [] [] | + gutenprint | [] [] | + hello | [] [] [] [] | + help2man | [] [] | + hylafax | [] | + idutils | [] [] [] [] [] | + indent | [] [] [] [] [] [] [] | + iso_15924 | [] [] [] [] | + iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] | + iso_3166_2 | [] [] [] | + iso_4217 | [] [] [] [] [] [] [] [] | + iso_639 | [] [] [] [] [] [] [] [] [] | + iso_639_3 | [] [] | + jwhois | [] [] [] [] | + kbd | [] [] [] | + keytouch | [] [] [] | + keytouch-editor | [] [] [] | + keytouch-keyboa... | [] [] [] | + klavaro | [] [] | + latrine | [] [] | + ld | | + leafpad | [] [] [] [] [] [] [] [] [] | + libc | [] [] [] [] | + libexif | [] [] () [] | + libextractor | | + libgnutls | [] [] | + libgpewidget | [] [] [] | + libgpg-error | [] [] | + libgphoto2 | [] [] | + libgphoto2_port | [] [] [] [] [] | + libgsasl | [] [] [] [] [] | + libiconv | [] [] [] [] [] | + libidn | [] [] | + lifelines | [] [] | + liferea | [] [] [] [] [] () () [] | + lilypond | [] | + linkdr | [] [] [] | + lordsawar | | + lprng | [] | + lynx | [] [] [] | + m4 | [] [] [] [] [] | + mailfromd | [] | + mailutils | [] | + make | [] [] [] [] | + man-db | [] [] [] | + man-db-manpages | [] [] [] | + minicom | [] [] [] [] | + mkisofs | [] [] [] | + myserver | | + nano | [] [] [] [] | + opcodes | [] [] | + parted | [] [] [] [] | + pies | [] | + popt | [] [] [] [] | + psmisc | [] [] [] | + pspp | [] [] | + pwdutils | [] | + radius | [] [] [] | + recode | [] [] [] [] [] [] [] [] | + rosegarden | () () | + rpm | [] [] [] | + rush | [] [] | + sarg | | + screem | | + scrollkeeper | [] [] [] [] [] [] [] [] | + sed | [] [] [] [] [] [] [] [] [] | + sharutils | [] [] [] [] | + shishi | [] | + skencil | [] [] | + solfege | [] [] [] [] | + solfege-manual | [] [] [] | + soundtracker | [] | + sp | | + sysstat | [] [] [] [] | + tar | [] [] [] [] | + texinfo | [] [] [] [] | + tin | [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | [] [] [] [] [] | + vice | [] | + vmm | [] | + vorbis-tools | [] [] | + wastesedge | [] | + wdiff | [] [] | + wget | [] [] [] [] [] [] [] | + wyslij-po | [] [] [] | + xchat | [] [] [] [] [] [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] | + +---------------------------------------------------+ + nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr + 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37 + + sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW + +---------------------------------------------------+ + a2ps | [] [] [] [] [] | 27 + aegis | [] | 9 + ant-phone | [] [] [] [] | 9 + anubis | [] [] [] [] | 15 + aspell | [] [] [] | 20 + bash | [] [] [] | 12 + bfd | [] | 6 + bibshelf | [] [] [] | 16 + binutils | [] [] | 8 + bison | [] [] | 12 + bison-runtime | [] [] [] [] [] [] | 29 + bluez-pin | [] [] [] [] [] [] [] [] | 37 + bombono-dvd | [] | 4 + buzztard | [] | 7 + cflow | [] [] [] | 9 + clisp | | 10 + coreutils | [] [] [] [] | 22 + cpio | [] [] [] [] [] [] | 13 + cppi | [] [] | 5 + cpplib | [] [] [] [] [] [] | 14 + cryptsetup | [] [] | 7 + dfarc | [] | 9 + dialog | [] [] [] [] [] [] [] | 30 + dico | [] | 2 + diffutils | [] [] [] [] [] [] | 30 + dink | | 4 + doodle | [] [] | 7 + e2fsprogs | [] [] [] | 11 + enscript | [] [] [] [] | 17 + exif | [] [] [] | 16 + fetchmail | [] [] [] | 17 + findutils | [] [] [] [] [] | 20 + flex | [] [] [] [] | 15 + freedink | [] | 10 + gas | [] | 4 + gawk | [] [] [] [] | 18 + gcal | [] [] | 5 + gcc | [] [] [] | 7 + gettext-examples | [] [] [] [] [] [] [] | 34 + gettext-runtime | [] [] [] [] [] [] [] | 29 + gettext-tools | [] [] [] [] [] [] | 22 + gip | [] [] [] [] | 22 + gjay | [] | 3 + gliv | [] [] [] | 14 + glunarclock | [] [] [] [] [] | 19 + gnubiff | [] [] | 4 + gnucash | () [] () [] () | 10 + gnuedu | [] [] | 7 + gnulib | [] [] [] [] | 16 + gnunet | [] | 1 + gnunet-gtk | [] [] [] | 5 + gnutls | [] [] [] | 10 + gold | [] | 4 + gpe-aerial | [] [] [] | 18 + gpe-beam | [] [] [] | 19 + gpe-bluetooth | [] [] [] | 13 + gpe-calendar | [] [] [] [] | 12 + gpe-clock | [] [] [] [] [] | 28 + gpe-conf | [] [] [] [] | 20 + gpe-contacts | [] [] [] | 17 + gpe-edit | [] [] [] | 12 + gpe-filemanager | [] [] [] [] | 16 + gpe-go | [] [] [] [] [] | 25 + gpe-login | [] [] [] | 11 + gpe-ownerinfo | [] [] [] [] [] | 25 + gpe-package | [] [] [] | 13 + gpe-sketchbook | [] [] [] | 20 + gpe-su | [] [] [] [] [] | 30 + gpe-taskmanager | [] [] [] [] [] | 29 + gpe-timesheet | [] [] [] [] [] | 25 + gpe-today | [] [] [] [] [] [] | 30 + gpe-todo | [] [] [] [] | 17 + gphoto2 | [] [] [] [] [] | 24 + gprof | [] [] [] | 15 + gpsdrive | [] [] [] | 11 + gramadoir | [] [] [] | 11 + grep | [] [] [] | 10 + grub | [] [] [] | 14 + gsasl | [] [] [] [] | 14 + gss | [] [] [] | 11 + gst-plugins-bad | [] [] [] [] | 26 + gst-plugins-base | [] [] [] [] [] | 24 + gst-plugins-good | [] [] [] [] | 24 + gst-plugins-ugly | [] [] [] [] [] | 29 + gstreamer | [] [] [] [] | 22 + gtick | [] [] [] | 13 + gtkam | [] [] [] | 20 + gtkorphan | [] [] [] | 14 + gtkspell | [] [] [] [] [] [] [] [] [] | 45 + gutenprint | [] | 10 + hello | [] [] [] [] [] [] | 21 + help2man | [] [] | 7 + hylafax | [] | 5 + idutils | [] [] [] [] | 17 + indent | [] [] [] [] [] [] | 30 + iso_15924 | () [] () [] [] | 16 + iso_3166 | [] [] () [] [] () [] [] [] () | 53 + iso_3166_2 | () [] () [] | 9 + iso_4217 | [] () [] [] () [] [] | 26 + iso_639 | [] [] [] () [] () [] [] [] [] | 38 + iso_639_3 | [] () | 8 + jwhois | [] [] [] [] [] | 16 + kbd | [] [] [] [] [] | 15 + keytouch | [] [] [] | 16 + keytouch-editor | [] [] [] | 14 + keytouch-keyboa... | [] [] [] | 14 + klavaro | [] | 11 + latrine | [] [] [] | 10 + ld | [] [] [] [] | 11 + leafpad | [] [] [] [] [] [] | 33 + libc | [] [] [] [] [] | 21 + libexif | [] () | 7 + libextractor | [] | 1 + libgnutls | [] [] [] | 9 + libgpewidget | [] [] [] | 14 + libgpg-error | [] [] [] | 9 + libgphoto2 | [] [] | 8 + libgphoto2_port | [] [] [] [] | 14 + libgsasl | [] [] [] | 13 + libiconv | [] [] [] [] | 21 + libidn | () [] [] | 11 + lifelines | [] | 4 + liferea | [] [] [] | 21 + lilypond | [] | 7 + linkdr | [] [] [] [] [] | 17 + lordsawar | | 1 + lprng | [] | 3 + lynx | [] [] [] [] | 17 + m4 | [] [] [] [] | 19 + mailfromd | [] [] | 3 + mailutils | [] | 5 + make | [] [] [] [] | 21 + man-db | [] [] [] | 8 + man-db-manpages | | 4 + minicom | [] [] | 16 + mkisofs | [] [] | 9 + myserver | | 0 + nano | [] [] [] [] | 21 + opcodes | [] [] [] | 11 + parted | [] [] [] [] [] | 15 + pies | [] [] | 3 + popt | [] [] [] [] [] [] | 27 + psmisc | [] [] | 11 + pspp | | 4 + pwdutils | [] [] | 6 + radius | [] [] | 9 + recode | [] [] [] [] | 28 + rosegarden | () | 0 + rpm | [] [] [] | 11 + rush | [] [] | 4 + sarg | | 1 + screem | [] | 3 + scrollkeeper | [] [] [] [] [] | 27 + sed | [] [] [] [] [] | 30 + sharutils | [] [] [] [] [] | 22 + shishi | [] | 3 + skencil | [] [] | 7 + solfege | [] [] [] [] | 16 + solfege-manual | [] | 8 + soundtracker | [] [] [] | 9 + sp | [] | 3 + sysstat | [] [] | 15 + tar | [] [] [] [] [] [] | 23 + texinfo | [] [] [] [] [] | 17 + tin | | 4 + unicode-han-tra... | | 0 + unicode-transla... | | 2 + util-linux-ng | [] [] [] [] | 20 + vice | () () | 1 + vmm | [] | 4 + vorbis-tools | [] | 6 + wastesedge | | 2 + wdiff | [] [] | 7 + wget | [] [] [] [] [] | 26 + wyslij-po | [] [] | 8 + xchat | [] [] [] [] [] [] | 36 + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63 + xkeyboard-config | [] [] [] | 22 + +---------------------------------------------------+ + 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW + 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618 + + Some counters in the preceding matrix are higher than the number of +visible blocks let us expect. This is because a few extra PO files are +used for implementing regional variants of languages, or language +dialects. + + For a PO file in the matrix above to be effective, the package to +which it applies should also have been internationalized and +distributed as such by its maintainer. There might be an observable +lag between the mere existence a PO file and its wide availability in a +distribution. + + If June 2010 seems to be old, you may fetch a more recent copy of +this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date +matrix with full percentage details can be found at +`http://translationproject.org/extra/matrix.html'. + +1.5 Using `gettext' in new packages +=================================== + +If you are writing a freely available program and want to +internationalize it you are welcome to use GNU `gettext' in your +package. Of course you have to respect the GNU Library General Public +License which covers the use of the GNU `gettext' library. This means +in particular that even non-free programs can use `libintl' as a shared +library, whereas only free software can use `libintl' as a static +library or use modified versions of `libintl'. + + Once the sources are changed appropriately and the setup can handle +the use of `gettext' the only thing missing are the translations. The +Free Translation Project is also available for packages which are not +developed inside the GNU project. Therefore the information given above +applies also for every other Free Software Project. Contact +`coordinator@translationproject.org' to make the `.pot' files available +to the translation teams. + diff --git a/local/recipes/tools/diffutils/source/AUTHORS b/local/recipes/tools/diffutils/source/AUTHORS new file mode 100644 index 0000000000..c19d1c8582 --- /dev/null +++ b/local/recipes/tools/diffutils/source/AUTHORS @@ -0,0 +1,51 @@ +GNU diff was written by Paul Eggert, Mike Haertel, David Hayes, +Richard Stallman, and Len Tower. + +GNU diff3 was written by Randy Smith. + +GNU sdiff was written by Thomas Lord. + +GNU cmp was written by Torbjorn Granlund and David MacKenzie. + +The diffutils manual was written by David MacKenzie, Paul Eggert, and +Richard Stallman. Parts are adapted by from a manual page written by +Larry Wall, with his permission. + +Many other people have contributed to GNU diffutils, including Wayne +Davison, Patrick D'Cruze, F. Thomas May, Greg McGary, Chip Rosenthal, +and Eli Zaretskii. + +The following contributions warranted legal paper exchanges with the +Free Software Foundation. Also see the files ChangeLog and THANKS. + +Leonard H. Tower Jr. +Torbjorn Granlund +Mike Haertel +David S. Hayes +Randall Smith +Richard Stallman +F. Thomas May +Wayne Davison +Paul R. Eggert +Chip Rosenthal +Wayne Davison +Patrick D'Cruze +Eli Zaretskii + + +Copyright (C) 2001, 2006, 2009-2013, 2015-2017 Free Software Foundation, Inc. + +This file is part of GNU diffutils. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/local/recipes/tools/diffutils/source/COPYING b/local/recipes/tools/diffutils/source/COPYING new file mode 100644 index 0000000000..94a9ed024d --- /dev/null +++ b/local/recipes/tools/diffutils/source/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/local/recipes/tools/diffutils/source/ChangeLog b/local/recipes/tools/diffutils/source/ChangeLog new file mode 100644 index 0000000000..bbd4867165 --- /dev/null +++ b/local/recipes/tools/diffutils/source/ChangeLog @@ -0,0 +1,2115 @@ +2017-05-21 Jim Meyering + + version 3.6 + * NEWS: Record release date. + +2017-05-19 Jim Meyering + + gnulib: update to latest + +2017-05-18 Jim Meyering + + maint: update to work with GCC7's -Werror=implicit-fallthrough= + * src/system.h (FALLTHROUGH): Define. + Use new FALLTHROUGH macro in place of comments + * src/cmp.c: FIXME + * src/diff3.c: FIXME + * src/ifdef.c: FIXME + * src/sdiff.c: FIXME + * src/side.c: FIXME + * src/util.c: FIXME + + gnulib: update to latest + +2017-05-09 Jim Meyering + + tests: new-file: closed-stdin: also ensure stdout was empty + * tests/new-file: Also require that "out" be empty. + +2017-05-06 Jim Meyering + + maint: stop using @acronym{...} in texinfo sources + * doc/diffutils.texi: Remove all uses of @acronym{...}, + per recommendation by Karl Berry. + * cfg.mk (local-checks-to-skip): Remove exemption, enabling + the @acronym{-prohibiting syntax-check rule. + +2017-05-05 Paul Eggert + + cmp: improve EOF diagnostic + This improves on yesterday's change, following up on a + remark by Jim Meyering (Bug#22816#21). + * doc/diffutils.texi (Invoking cmp, cmp Options): Follow POSIX more + closely in the documentation of the information appended to the EOF + diagnostic. + * src/cmp.c (cmp): Be more specific about the shorter file's length + and fix some off-by-1 issues in reporting line counts. + * tests/cmp: Adjust to match new behavior. + Don't assume internal details about stdio buffering. + +2017-05-04 Benno Schulenberg + + diff: describe each --help option with a single string + * src/diff.c: To ease translating, fuse four description pieces + into two whole ones. Also reword and rewrap one of them to fit + within eighty characters. + +2017-05-04 Paul Eggert + + cmp: report prefix length when one file is shorter + Requested by Dan Jacobson (Bug#22816). + * NEWS: + * doc/diffutils.texi (Invoking cmp, cmp Options): Document this. + * src/cmp.c (cmp): Implement it. + * tests/Makefile.am (TESTS): Add cmp. + * tests/cmp: New file. + +2017-05-02 Jim Meyering + + tests: add test for latest fix + * NEWS (Bug fixes): Describe it. + * tests/invalid-re: New test for just-fixed bug. + * tests/Makefile.am (TESTS): Add it. + + gnulib: update to latest + +2017-04-27 Paul Eggert + + diff: don't crash if regexp is invalid + Problem reported by Marcel Böhme in: + http://lists.gnu.org/archive/html/bug-diffutils/2017-04/msg00002.html + * src/diff.c (add_regexp): Exit if re_compile_pattern fails. + +2017-03-24 julama + + tests: avoid false failure for unreadable /proc/cmdline + * tests/brief-vs-stat-zero-kernel-lies: Use "test -r" rather than + just "test -f". This avoids a false test failure on a linux system + with grsecurity and its GRKERNSEC_PROC_USER option enabled, for which + /proc/cmdline is unreadable. Reported in https://bugs.gnu.org/26155 + +2017-02-01 Jim Meyering + + tests: avoid false failure with some shells on debian, freebsd + * tests/colors: Move the TERM=dumb setting into the code run by + "returns_", since some shells do not propagate envvar setting through + to a use of a function like this. That would cause this test to fail + because results were colorized when they should not have been. + Reported by Nelson Beebe. + +2017-01-31 Jim Meyering + + maint: add "introduced in 3.4" in latest NEWS entry + * NEWS: Update. Also, thanks to Nelson Beebe for reporting this. + + diff: avoid UMR with ---presume-output-tty + * src/diff.c (main): Always define presume_output_tty. + Otherwise, it would be read uninitialized. + Introduced in v3.3-45-g17e2698 + * NEWS (Bug fixes): Mention it. + + gnulib: update to latest; and update bootstrap and init.sh + + maint: change "time stamp" to "timestamp" globally + This avoids a new syntax-check failure. + * ChangeLog-2008: Perform that change. + * doc/diffutils.texi: Likewise. + * NEWS: Likewise. + * cfg.mk: Update the old news hash accordingly. + +2017-01-01 Jim Meyering + + maint: update gnulib and copyright dates for 2017 + * gnulib: Update to latest. + * all files: Run "make update-copyright". + +2016-11-08 Jim Meyering + + tests: use "returns_" rather than explicit comparison with "$?" + * tests/colors: Use "returns_ 1" rather than testing $? = 1 + * tests/basic: Likewise. + * tests/binary: Likewise. + * tests/filename-quoting: Likewise. + * tests/function-line-vs-leading-space: Likewise. + * tests/ignore-matching-lines: Likewise. + * tests/label-vs-func: Likewise. + * tests/new-file: Likewise. + * tests/no-dereference: Likewise. + * tests/no-newline-at-eof: Likewise. + * tests/stdin: Likewise. + +2016-10-25 Paul Eggert + + diff: fix big performance degradation in 3.4 + * NEWS, doc/diffutils.texi (Overview): Document this. + * src/analyze.c (diff_2_files): Restore too_expensive heuristic, + but this time with a floor that is 16 times the old floor. This + should fix Bug#16848, by generating good-quality output for its + test case, while not introducing Bug#24715, by running nearly as + fast as diff-3.3 for that test case. + + build: update gnulib submodule to latest + +2016-10-16 Jim Meyering + + maint: use die rather than error + Use "die (N, ..." rather than "error (N, ..." whenever N is a nonzero + constant. That lets the compiler know that control never goes beyond + that point, and thus makes unnecessary the occasional following + "abort ();" or "break;" statement we have historically added to inform + static analysis tools of this aspect of "error" semantics. + * src/die.h: New file. + * src/Makefile.am (noinst_HEADERS): Add it. + * src/cmp.c: Use die in place of error whenever the first + argument is a nonzero constant. Also remove any immediately- + following call to abort, and include "die.h". + * src/diff.c: Likewise. + * src/diff3.c: Likewise. + * src/sdiff.c: Likewise. + * src/util.c: Likewise. + +2016-10-02 Jim Meyering + + gnulib: update to latest + + build: avoid GCC 7's new warnings + * src/util.c (get_funky_string): Adjust comment so that GCC 7's + -Wimplicit-fallthrough recognizes it. + * src/diff3.c (main): Cast boolean MERGE to "int" to avoid this: + diff3.c:341:25: error: '~' on a boolean expression \ + [-Werror=bool-operation] + +2016-08-30 Jim Meyering + + gnulib: update to latest + +2016-08-29 Jim Meyering + + gnulib: update to latest, to port to upcoming GCC 7 + This fixes compilation errors when using gcc-7-to-be that were + due to missing backslashes in gnulib's intprops.h and an API + change in functions like __builtin_add_overflow. This ports + to GCC 7's newer built-in overflow-checking functions. + +2016-08-28 Paul Eggert + + diff: don't assume ptrdiff_t <= long long int + * src/system.h (printint, pI): Port to (theoretical) platforms + where ptrdiff_t is wider than long long int (Bug#24311). + +2016-08-27 Paul Eggert + + diff: port line numbers to mingw64 + Problem reported by Peter Rosin (Bug#24311). + * src/system.h (printint, pI): New typedef and macro. + All uses of 'long int' and "%l" in printf format replaced by + 'printint' and "%"pI respectively. + * src/ifdef.c (do_printf_spec): Don't assume pI is length 1. + +2016-08-20 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 3.5 + * NEWS: Record release date. + +2016-08-16 Jim Meyering + + build: arrange to build with -fno-common, when possible + * configure.ac (WERROR_CFLAGS): Add -fno-common, when possible. + This would have prevented the duplicate definition of + presume_output_tty that was fixed in v3.4-10-gc2dc91f. + +2016-08-16 Hanno Böck + + diff: avoid duplicate definition of presume_output_tty + * src/util.c (presume_output_tty): Remove this definition. + The other is in diff.h. Reported in https://bugs.gnu.org/24248 + +2016-08-14 Jim Meyering + + gnulib: update to latest + + tests: diff3: work around missing seq on some systems + * tests/diff3 (seq): Provide a seq replacement function, + since at least AIX, SunOS 5.10, OpenBSD-5.8 lack it. + Reported by Assaf Gordon in https://bugs.gnu.org/24227#8 + +2016-08-13 Jim Meyering + + diff3: fix leaks, for real + * src/diff3.c (struct diff_block)[lint]: Add member, n2. + (free_diff_block, next_to_n2): New functions. + * tests/diff3: Add more test coverage. + + maint: require that commit messages be of a certain form + * bootstrap.conf (bootstrap_epilogue): Merge from coreutils, so that + a local commit hook will now help enforce consistent commit messages. + * Makefile.am (check-git-hook-script-sync): New rule, largely copied + from coreutils. + * scripts/git-hooks/commit-msg: New file, from coreutils, but + with adapted list of program names. + * scripts/git-hooks/applypatch-msg: New file, from git. + * scripts/git-hooks/pre-applypatch: Likewise. + * scripts/git-hooks/pre-commit: Likewise. + +2016-08-13 Bastian Beischer + + diff3: fix heap use-after-free; add minimal diff3 test coverage + Commit v3.3-42-g3b74a90, "FIXME: src/diff3: plug a leak" added an + invalid use of free, leading to use-after-free in nearly any invocation + of diff3. Revert that commit. + * NEWS (Bug fixes): Mention it. + * tests/diff3: New file, to add minimal test coverage. + * tests/Makefile.am (TESTS): Add it. + Reported by Bastian Beischer in http://bugs.gnu.org/24210 + +2016-08-13 Jim Meyering + + build: ignore texinfo build artifacts + * .gitignore: Ignore texinfo artifacts in doc/. + + maint: diff3: remove an unreachable statement + * src/diff3.c (main): Remove unreachable "return" after exit from main. + +2016-08-08 Jim Meyering + + diff: disable colorization for TERM=dumb + * src/diff.c (main): With --color or --color=auto, when TERM is + "dumb", disable colorization. Suggested by Daniel Colascione. + * NEWS (Bug fixes): Mention it. + * tests/colors: Add a test that would fail without this change, + yet passes with it. + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 3.4 + * NEWS: Record release date. + +2016-08-06 Jim Meyering + + gnulib: update to latest + + tests: tweak built_programs definition + * tests/Makefile.am (built_programs): Adjust to work around what + may be a problem due to interaction between Solaris 10's /bin/sh + and an old version of GNU make. Reported by Dagobert Michelsen + in https https://bugs.gnu.org/24137. + +2016-08-02 Jim Meyering + + gnulib: update to latest + + tests: skip a /proc/self-dependent test on the Hurd + * tests/brief-vs-stat-zero-kernel-lies: The Hurd's /proc/self + is not useful, so detect that and skip the test that requires it. + Reported by Assaf Gordon in https://debbugs.gnu.org/24121#29 + +2016-08-01 Jim Meyering + + tests/colors: fix portability problem with touch --date + * tests/colors (epoch): Don't use GNU touch's --date=$epoch option. + Use the portable -t 197001010000.00. + Reported by Assaf Gordon in https://debbugs.gnu.org/24121#8 + + build: Solaris 9: avoid link failure due to isblank use + * bootstrap.conf (gnulib_modules): Add isblank, to avoid a link + error on Solaris 9 Sparc. Reported by Dagobert Michelsen. + + test: improve test infrastructure + * tests/envvar-check: New file, copied from grep, with the addition + of the EDITOR and GREP_OPTIONS envvar names. + * tests/Makefile.am (EXTRA_DIST): Add it. + (TESTS_ENVIRONMENT): Revamp, to be more like that of grep. + +2016-07-31 Jim Meyering + + maint: remove gl/lib/reg*.c.diff; no longer needed + * gl/lib/regcomp.c.diff: Remove file, now that gnulib's + regcomp.c compiles regex.c with -Wno-unused-parameter. + * gl/lib/regex_internal.c.diff: This file induced a change to ensure + that the "Idx" type was unsigned and to remove a few "VAR < 0" + comparisons. These days, it is probably fine to stay in sync with + gnulib/glibc's copies + of these files, so remove these patches, too. + * gl/lib/regexec.c.diff: Likewise. + Prompted by a report by Assaf Gordon and a suggestion from Paul Eggert. + + tests: colors: fix a portability problem and work around a shell bug + * tests/colors (e): Fix a portability bug: use printf '\033' + rather than '\e' to generate the required byte sequence, since + for some shells (at least dash 0.5.8), the latter doesn't work. + Work around a shell bug whereby "local tab=$(printf '\t')" + would result in an empty value for "$tab": hoist each "tab" + definition up/out of its function to global scope. + Reported by Assaf Gordon in http://debbugs.gnu.org/24116#8 + +2016-07-23 Jim Meyering + + gnulib: update to latest; and tests/init.sh + * gnulib: Update to latest. + * init.sh: Update from gnulib. + +2016-05-30 Jim Meyering + + maint: arrange for "make distcheck" to work with unreleased automake + * dist-check.mk (my-distcheck): Remove all .deps directories + before performing the recursive comparison. + +2016-05-24 Glenn Morris + + doc: fix a reference to emacs' emerge node + * doc/diffutils.texi (Interactive Merging): Correct a reference to + emacs' emerge node: s/emerge/Emerge/. + This addresses http://debbugs.gnu.org/23613 + +2016-04-30 Jim Meyering + + maint: arrange for better URLs in generated announcement message + * cfg.mk (url_dir_list): Define. I had been correcting the generated + URLs by hand, just before the announcement. This is better. + +2016-03-15 Jim Meyering + + maint: don't ignore gitlog-to-changelog failure + * Makefile.am (gen-ChangeLog): Don't ignore failure of + gitlog-to-changelog. This syncs to coreutils' copy of this rule. + +2016-03-06 Giuseppe Scrivano + + diff: --color: fix an infinite recursion bug + * src/diff.h (presume_output_tty): New extern variable. + * src/diff.c (PRESUME_OUTPUT_TTY_OPTION): New enum. + (group_format_option): Add '-presume-output-tty'. + (main): Handle PRESUME_OUTPUT_TTY_OPTION. + * src/util.c: New variable `presume_output_tty'. + (check_color_output): Handle presume_output_tty. + (set_color_context): Call process_signals only when color_context is + not RESET_CONTEXT. + * tests/colors: Check that diff doesn't crash when interrupted + in the middle of a color sequence. + + Reported by Gisle Vanem in http://debbugs.gnu.org/22067 + +2016-01-31 Jim Meyering + + maint: update prereq version of gettext + * configure.ac: Increase designated gettext version to 0.19.2 + * bootstrap.conf (buildreq): Likewise. + Remove now-unnecessary code to remove gettext-provided files. + + gnulib: update to latest + +2016-01-01 Jim Meyering + + FIXME: src/diff3: plug a leak + +2016-01-01 Jim Meyering + + maint: update copyright year, bootstrap, init.sh + Run "make update-copyright" and then... + + * gnulib: Update to latest. + * tests/init.sh: Update from gnulib. + * bootstrap: Likewise. + +2015-12-06 Jim Meyering + + diff --brief no longer mistakenly reports diff. with 0-sized /proc/ files + Normally, it is safe to assume two regular files are different when + their st_size values are different. However, that assumption may + be invalid if either value is zero, as happens with files on Linux + /proc and /sys file systems. Since skipping this optimization will + usually cost very little (one read syscall, to read zero bytes), + it is fine to accommodate those unusual files. + * src/analyze.c (diff_2_files): Do not assume regular files differ + just because their st_size values differ when one or more is 0. + * src/diff.c (compare_files): Likewise. + * tests/brief-vs-proc-stat-zero: New test. + * tests/Makefile.am: Add it. + * NEWS (Bug fixes): Describe it. + Reported by Stephan Müller in http://debbugs.gnu.org/21942 + + tests: arrange to print any skipped-test explanation to tty, too + I noticed that when a test was skipped, the reason was not printed. + This fixes it. In coreutils, this variable is set in init.cfg, + but there is no point in putting the definition so far from the + code that chooses the file descriptor number in tests/Makefile.am. + * tests/Makefile.am (TESTS_ENVIRONMENT) [stderr_fileno_]: Define + here (to 9), right next to the companion "9>&2". + +2015-11-29 Jim Meyering + + build: add gperf to the list of required programs + * bootstrap.conf (buildreq): Add gperf to the list. + Reported by Stephan Müller in http://debbugs.gnu.org/21945 + +2015-11-29 Giuseppe Scrivano + + tests: Add tests for --color and --palette + * tests/colors: New file. + * tests/Makefile.am (TESTS): Add colors. + + doc: mention --color and --palette in NEWS + + diff: add --palette + * bootstrap (gnulib_modules): Add 'argmatch'. + * doc/diffutils.texi: Add documentation for --palette + * src/diff.h (set_color_palette): New prototype. + * src/diff.c (set_color_palette): New function. + (color_palette): New variable. + * src/utils.c: Include "argmatch.h". + (struct bin_str): New struct. + (struct color_ext_type): New struct. + (color_indicator): New array. + (indicator_name): New array. + (indicator_no): New enum. + (parse_state): New enum. + (put_indicator): New function. + (get_funky_string): New function. Copied from coreutils ls. + (parse_diff_color): New function. Copied from coreutils ls + "parse_ls_color" function. + (set_color_context): Use put_indicator instead of directly + outputting the sequence. + * po/POTFILES.in: Add 'lib/argmatch.c' + + diff: add support for --color + * doc/diffutils.texi (diff Options): Add documentation for --color. + Copied from coreutils ls --color. + * src/context.c (pr_unidiff_hunk): Set the color context. + (print_context_header): Likewise. + (pr_context_hunk): Likewise. + * src/diff.h (enum colors_style): New enum to record when to use colors. + (colors_style): New variable to memorize the argument value. + (set_color_context): Add function definition. + * src/diff.c: : Define COLOR_OPTION. + (specify_colors_style): New function. + (longopts): Add --color. + (main): Handle --color argument. + (option_help_msgid): Add usage string for --color. + * src/normal.c (print_normal_hunk): Set the color context. + * src/side.c (print_1sdiff_line): Likewise. + * src/util.c (print_1_line_nl): New function. + (print_1_line): Make it a wrapper of 'print_1_line_nl'. + (colors_enabled): New boolean variable. + (begin_output): Call check_color_output once the output file is + configured. + (output_1_line): Periodically call `process_signals'. + (caught_signals): New sigset_t. + (colors_enabled): New boolean variable. + (interrupt_signal): New sig_atomic_t. + (stop_signal_count): New sig_atomic_t. + (check_color_output): New function. + (install_signal_handlers): Likewise. Copied from coreutils ls. + (process_signals): Likewise. Copied from coreutils ls. + (set_color_context): New function. + (sighandler): Likewise. Copied from coreutils ls. + (stophandler): Likewise. Copied from coreutils ls. + +2015-09-24 Andreas Grünbacher + + diff: Improve help text of option --label + * src/diff.c (option_help_msgid): Improve help text of option --label. + +2015-09-01 Jim Meyering + + build: correct man-page generation rule + The PATH was set incorrectly, so that the diff used by + help2man was the one from $PATH, rather than the just-built + one. + * man/Makefile.am (bin_dir): New variable, to... + (dist_man1_MANS): ...prepend ../src to PATH, not just "..". + Also, add a test to ensure that each $(bin_dir)/$$base is + executable, so this doesn't happen again. + In http://debbugs.gnu.org/21023, Rodrigo Valiña + Gutiérrez reported that diff.1 from the diffutils-3.3 tarball + contained no description of the then-new --no-dereference option. + +2015-07-10 Jim Meyering + + doc: --no-dereference: improve wording/description + * doc/diffutils.texi (Comparing Directories): Correct grammar. + (diff Options) [--no-dereference]: Say a little more. + +2015-01-01 Jim Meyering + + maint: update copyright year ranges to include 2015; update gnulib + +2014-12-12 KO Myung-Hun + + diff: skip test if seek is not possible on OS/2 kLIBC + This fixes the problem that 'diff - file' and 'cat file | diff - file' + fail due to a seek failure with a message 'diff.exe: -: Invalid seek', + because seek does not work on stdin and a pipe on OS/2 kLIBC. + + * src/io.c (sip): Set skip_test to true if seek is not possible on + OS/2 kLIBC. + +2014-12-09 Jim Meyering + + gnulib: update to latest + +2014-12-09 KO Myung-Hun + + build: double-quote use of $PATH + * man/Makefile.am (dist_man1_MANS): On OS/2, PATH_SEPARATOR is ';', + but unquoted, that is interpreted as the shell's statement + terminator. Quote it. + +2014-10-27 Paul Eggert + + diff: fix integer overflow problem with --tabsize + Reported by Tobias Stoeckmann in: http://bugs.gnu.org/18857 + * src/diff.c (main): Don't overflow if INTMAX_MAX / 2 < tabsize. + * tests/bignum: New file, to test for this bug. + * tests/Makefile.am (TESTS): Add it. + +2014-09-03 Paul Eggert + + doc: mention diff -B fix in NEWS + + diff: fix bug with diff -B and incomplete lines + Reported by Navin Kabra via Eric Blake in: + http://bugs.gnu.org/18402 + * src/util.c (analyze_hunk): Don't mishandle incomplete + lines at end of file. + * tests/no-newline-at-eof: Test for the bug. + + diff: fix performance bug with prefix computation + * src/io.c (find_identical_ends): Fix performance bug: + the test for when the prefix was needed messed up by + the 2002-02-28 integer-overflow fixes, causing performance to be + worse than it needed to be. + +2014-08-23 Jim Meyering + + gnulib: update to latest, as well as bootstrap + + maint: update copyright year range in texinfo documentation + * doc/diffutils.texi: Update copyright. + +2014-04-15 Jim Meyering + + maint: update bug-reporting address + * README: Change bug-gnu-utils@... to bug-diffutils@gnu.org. + * doc/diffutils.texi: Likewise. + Reported by Jamie Landeg Jones. + +2014-03-26 Paul Eggert + + diff: fix two "..." typos in --help output + * src/diff.c (option_help_msgid): Remove two "..." typos (Bug#17102). + +2014-03-25 Paul Eggert + + doc: improve documentation about reading and stdin + See Bug#17075. + * doc/diffutils.texi (Comparison): Say that files need not be read. + (Invoking diff): Remove confusing remark about 'diff - -'. + It's not that useful, and it's not portable anyway. + +2014-02-24 Paul Eggert + + diff, sdiff: minor integer overflow fixes + * src/context.c (find_hunk): + Simplify, now that 2 * context + 1 cannot overflow. + * src/diff.c (main): + * src/sdiff.c (interact): + Don't rely on undefined behavior on signed integer overflow. + * src/diff.c (main): Don't let contexts exceed CONTEXT_MAX. + * src/system.h (CONTEXT_MAX): New macro. + + diff: fix bug with -I and overlapping hunks + Problem reported by Vincent Lefevre in . + * src/context.c (find_hunk): Threshold is CONTEXT only if + the second change is ignorable. + * tests/ignore-matching-lines: New test. + * tests/Makefile.am (TESTS): Add it. + +2014-02-23 Paul Eggert + + diff: remove TOO_EXPENSIVE heuristic + Problem reported by Vincent Lefevre in . + The simplest solution is to remove the TOO_EXPENSIVE heuristic + that I added to GNU diff in 1993. Although appropriate for + circa-1993 hardware, these days the heuristic seems to be more + trouble than it's worth. + * NEWS: Document this. + * doc/diffutils.texi (Overview): Modernize citations. + Remove mention of TOO_EXPENSIVE heuristic. + * src/analyze.c (diff_2_files): Adjust to TOO_EXPENSIVE-related + API changes in gnulib's diffseq module. + + build: update gnulib submodule to latest + +2014-01-31 Paul Eggert + + diff: exit with status 1, not 2, when binary files differ + Problem reported by Vincent Lefevre in . + * NEWS: + * doc/diffutils.texi (Binary, Invoking diff): Document this. + * src/analyze.c (briefly_report): Return void, not int. + All uses changed. Do not futz with exit status. Simplify. + * tests/binary: Adjust to match new behavior. + +2013-09-26 Paul Eggert + + build: omit -Wsuggest-attribute=pure for lib + * configure.ac (WARN_CFLAGS): Omit -Wsuggest-attribute=pure + when compiling the lib subdirectory. Reported for Fedora 19 + by Eric Blake in . + +2013-08-22 Paul Eggert + + cmp, diff, sdiff: tune by using rawmemchr + On my platform (AMD Phenom II X4 910e, Fedora 17 x86-64), this sped up + 'cmp -n 8GiB /dev/full /dev/zero' by a factor of 3.8, and + 'cmp -sn 8GiB /dev/full /dev/zero' by a factor of 1.8. + * bootstrap.conf (gnulib_modules): Add rawmemchr. + * src/cmp.c (cmp): Optimize the common case where buffers are the same, + by using count_newlines rather than block_compare_and_count. + (block_compare_and_count): Remove. + (count_newlines): New function. + * src/cmp.c (count_newlines): + * src/io.c (prepare_text): + * src/sdiff.c (lf_copy, lf_skip, lf_snarf): + Use rawmemchr instead of memchr, for speed. + +2013-08-12 Paul Eggert + + cmp: tune 'cmp a b' for GCC x86 + Performance problem reported by David Balažic in: + http://lists.gnu.org/archive/html/bug-diffutils/2013-08/msg00013.html + * src/system.h (word): Make it size_t, not uintmax_t. + This sped up plain cmp 90% on my tests (GCC 4.8.1, x86). + +2013-07-06 Paul Eggert + + build: update gnulib submodule to latest + +2013-05-06 Stefano Lattarini + + build: enable 'subdir-objects' automake option + The future major Automake version (2.0, ETA at least one year from now) + might enable that option unconditionally, so better get prepared in due + time. + + * configure.ac (AM_INIT_AUTOMAKE): Adjust. + (AM_PROG_CC_C_O): New, required by Automake up to 1.13.x when the + 'subdir-objects' is in use. + +2013-04-28 Paul Eggert + + build: update gnulib submodule to latest + +2013-04-03 Paul Eggert + + diff: fix bug with Asian file names + Problem reported by Errembault Philippe in: + http://lists.gnu.org/archive/html/bug-diffutils/2013-03/msg00012.html + * NEWS: Document this. + * src/dir.c (compare_names): Fall back on file_name_cmp if + compare_collated returns 0, unless ignoring file name case. + (diff_dirs): Don't bother with the O(N**2) stuff unless ignoring + file name case. + * tests/Makefile.am (TESTS): Add strcoll-0-names. + * tests/strcoll-0-names: New file. + + diff: remove unnecessary decl + * src/dir.c (compare_names_for_qsort): Remove declaration. + Not needed now that we assume C89. + + diff: tune compare_names_for_qsort + * src/dir.c (compare_collated): New function. + (compare_names): Use it. + (compare_names_for_qsort): Use it. This is a bit more efficient + as it can avoid a double invocation of file_name_cmp when + file_name_cmp returns zero. + +2013-03-30 Jim Meyering + + doc: mention new option, --no-dereference in 3.3's NEWS + * NEWS (New feeatures): Update 3.3's news to mention --no-dereference. + Reported by Denis Excoffier. + * Makefile.am (old_NEWS_hash): Update, since this modifies old, and + normally-immutable NEWS. + +2013-03-26 Paul Eggert + + tests: port to Solaris 10 /bin/sh + * tests/Makefile.am (TESTS_ENVIRONMENT): + Use "FOO=val; export FOO" rather than "export FOO=val", + as the latter form doesn't work with Solaris /bin/sh. + Problem found when trying to run "make check" on Solaris 10. + +2013-03-24 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 3.3 + * NEWS: Record release date. + +2013-03-23 Paul Eggert + + doc: fix menu typo + * doc/diffutils.texi (Comparing Three Files): Fix out-of-order menu. + Bug caught by Texinfo 5.0. + + maint: update build procedure to recent gettext etc. + * bootstrap.conf (gnulib_modules): Add vararrays. + (needed_gnulib_files, unnecessary_gettext_files): New vars. + (bootstrap_post_import_hook): New function, to implement these vars. + (excluded_files): Remove; 'bootstrap' no longer supports this. + Its function is now performed by unnecessary_gettext_files. + (buildreq): Update automake to 1.12.2, to avoid CVE-2012-3386. + * configure.ac (AM_GNU_GETTEXT_VERSION): Bump from 0.17 to 0.18.2, + to lessen the probability that we'll have outlandishly old files + during a build. + * m4/vararrays.m4: Remove from repository, as we now use the + gnulib version. + +2013-03-21 Jim Meyering + + build: update gnulib to latest and adapt; update bootstrap, too + Blindly updating to the latest from gnulib, bootstrap would + fail due to failure of our local patches to apply. Hence, + these first two updates. + * gl/lib/regex_internal.c.diff: Update offsets, so this patch + applies to the latest from gnulib. + * gl/lib/regex_internal.h.diff: Remove file. No longer needed. + * bootstrap: Update from gnulib. + +2013-01-06 Paul Eggert + + tests: port to hosts lacking fmt, make -C + * tests/Makefile.am (built_programs): Don't assume fmt works. + Don't rely on 'make -C', either. + + maint: update .gitignore for recent gnulib + * .gitignore: Add tests/*.trs and several *.h and *.sed files in lib, + +2013-01-04 Jim Meyering + + build: update gnulib submodule to latest + + maint: update all copyright year number ranges + Run "make update-copyright". + +2012-10-23 Eric Blake + + build: default to --enable-gcc-warnings in a git tree + Anyone building from cloned sources can be assumed to have a new + enough environment, such that enabling gcc warnings by default will + be useful. Tarballs still default to no warnings, and the default + can still be overridden with --disable-gcc-warnings. + * configure.ac (gl_gcc_warnings): Set default based on environment. + +2012-10-03 Paul Eggert + + * doc/diffutils.texi (cmp Options): Document -l format better. + +2012-09-10 Jim Meyering + + maint: use xasprintf in place of xmalloc+sprintf + * bootstrap.conf (gnulib_modules): Add gnulib's xvasprintf module. + * src/util.c: Include "xvasprintf.h". + (begin_output): Use xasprintf in place of xmalloc+sprintf. + +2012-09-10 Andreas Gruenbacher + + diff: encode file names with special characters + * src/util.c (c_escape_char): New function. + (c_escape): New function. + (begin_output): Escape file names when needed. + * src/context.c (print_context_header): New names parameter. + (print_context_label): New name parameter. + * src/diff.h (print_context_header): Change prototype. + * tests/filename-quoting: New file. + * NEWS: Document this change. + +2012-08-30 Paul Eggert + + diff: silence GCC warning instead of slowing down + * src/dir.c (find_dir_file_pathname): Use 'IF_LINT (volatile)' to + silence the gcc warning, rather than using 'volatile', as the + warning appears to be bogus. + +2012-08-28 Jim Meyering + + diff: avoid possible longjmp-triggered misbehavior + * src/dir.c (find_dir_file_pathname): gcc 4.8.0 20120825 reported + that a local variable's value might be clobbered. Declare "match" + to be volatile. + + build: update gnulib, bootstrap and init.sh to latest + + maint: avoid new syntax-check failure due to @xref use + * doc/diffutils.texi: Change several "; @xref{..." to ". @xref{...", + since @xref should start a sentence. + +2012-05-15 Paul Eggert + + maint: remove ms subdirectory + diffutils is now designed to build with Cygwin or MinGW. + The old DJGPP stuff probably doesn't work anyway. + * Makefile.am (SUBDIRS): Remove ms. + * NEWS: Document this. + * configure.ac (AC_CONFIG_FILES): Remove ms/Makefile. + * ms/Makefile.am, ms/README, ms/config.bat, ms/config.sed: + * ms/config.site: Remove. + +2012-05-14 Paul Eggert + + maint: update bootstrap from gnulib + * bootstrap: Update from gnulib. + + main: port subcommands to mingw + Problem reported by Eli Zaretskii in + . + Approach suggested by Bruno Haible as option (4) in + . + * bootstrap.conf (gnulib_modules): Add system-quote. + * src/diff3.c, src/sdiff.c, src/util.c: + Include , not . + * src/diff3.c (read_diff): + * src/sdiff.c (main, edit): + * src/util.c (begin_output): + Use system_quote_argv, for portability to Mingw. + * src/sdiff.c (NUM_SIGS, handler_index_of_SIGINT): Now enum + values, not macros; this is cleaner and avoids a GCC warning if + !HAVE_WORKING_VFORK. + * src/util.c (begin_output) [! HAVE_WORKING_FORK]: Do not use -f, + for consistency with the HAVE_WORKING_FORK code. + + maint: update bootstrap from gnulib + * bootstrap: Update from gnulib. + + maint: m4/gnulib-cache.m4 is not under version control + This is like what coreutils does, and suppresses 'git status' chatter. + * .gitignore: Add /m4/gnulib-cache.m4. + + Use binary mode when testing for binary files. + This reverts the 2006-01-05 change and modernizes to the current API. + Idea suggested by Eli Zaretskii in: + http://lists.gnu.org/archive/html/bug-gnu-utils/2012-05/msg00066.html + * src/cmp.c (main): + * src/diff.c (main, compare_files): + Use set_binary_mode rather than SET_BINARY. + * src/diff.c (compare_files): Omit unnecessary use of O_BINARY. + * src/io.c (sip): Sample unknown files in binary mode, to see + whether they are binary. + (read_files): Read binary files in binary mode. + + build: update gnulib submodule to latest + +2012-05-13 Stefano Lattarini + + build: omit obsolete AM_PROG_CC_STDC macro + The Automake-provided macro 'AM_PROG_CC_STDC' has been superseded by + the Autoconf-provided one 'AC_PROG_CC' since October 2002, and will + be removed in the next major automake version. + * configure.ac (AM_PROG_CC_STDC): Drop it. + +2012-05-05 Jim Meyering + + diff: fix a typo that was always disabling the same_special_file macro + * src/system.h (same_special_file): Correct cpp guard expression: + s/HAVE_ST_RDEV/HAVE_STRUCT_STAT_ST_RDEV/. Reported by Eli Zaretskii. + +2012-04-17 Jim Meyering + + maint: update bootstrap from gnulib + * bootstrap: Update from gnulib. + +2012-03-07 Eric Blake + + usage: improve wording of --ignore-matching-lines + * src/diff.c (option_help_msgid): Tweak wording. + +2012-03-04 Paul Eggert + + doc: explain -I RE better in --help output + * src/diff.c, src/sdiff.c (option_help_msgid): For -I RE, + change "whose lines all match" to "all whose lines match" to avoid + unintended interpretation. Reported by Danijel Tasov in + . + +2012-02-12 Paul Eggert + + sdiff: remove dependency on sigprocmask + * bootstrap.conf (gnulib_modules): Remove sigprocmask. + * src/sdiff.c (temporary_file): No need to invoke sigprocmask + here, since the signal handler merely sets a flag. + +2012-02-04 Paul Eggert + + diff: -N, --unidirectional-new-file now compare to "-" too + * NEWS: Document this. + * doc/diffutils.texi (Comparing Directories): Likewise. + Also, document that these options work at the top level. + * src/diff.c (compare_files): Treat EBADF like ENOENT, to handle + the case where "-" is closed. Allow the other file to be + STDIN_FILENO, in case it's "-". + * tests/Makefile.am (TESTS): Add new-file. + * tests/new-file: New file. + +2012-01-25 Paul Eggert + + maint: quote 'like this' or "like this", not `like this' + This is in response to a recent change in the GNU coding standards, + which now suggest quoting 'like this' or "like this", instead of + `like this' or ``like this''. + * HACKING, NEWS, README, README-hacking, TODO, doc/diagmeet.note: + * doc/diffutils.texi, ms/config.bat, ms/config.site: + * src/analyze.c, src/cmp.c, src/context.c, src/diff.c: + * src/diff.h, src/diff3.c, src/dir.c, src/ifdef.c, src/io.c: + * src/sdiff.c, src/side.c, src/system.h, src/util.c: + * tests/help-version: + Quote 'like this' or "like this" in commentary. + * cfg.mk (old_NEWS_hash): Adjust to reflect new NEWS quoting. + * man/help2man: Update to 1.40.4 version, with quoting fixed as above. + * po/en.po: Remove translation involving `, as it's no longer needed. + * src/cmp.c (try_help, specify_ignore_initial, usage, main): + * src/diff.c (main, try_help, option_help_msgid, specify_value) + (compare_files): + * src/diff3.c (main, try_help, option_help_msgid, usage) + (read_diff): + * src/dir.c (compare_names): + * src/sdiff.c (try_help, usage, check_child_status, main): + * src/util.c (finish_output): + * tests/help-version: + Quote 'like this' in output. + + build: update gnulib submodule to latest + +2012-01-12 Jim Meyering + + build: accommodate newer bootstrap from gnulib + * bootstrap.conf (gnulib_tool_option_extras): Add both --symlink + and --makefile-name=gnulib.mk. Also remove now-obsolete $bt/ prefix. + * bootstrap: Update from gnulib. + * tests/init.sh: Update from gnulib. + * lib/Makefile.am: Initialize numerous variables, so that + generated code in gnulib.mk may use += to append to them. + + maint: avoid new syntax-check failure + * src/diff.c (compare_files): Use STREQ, not strcmp. + +2012-01-08 Bruno Haible + + New option --no-dereference. + * src/diff.h (no_dereference_symlinks): New variable. + * src/diff.c: Include xreadlink.h. + (longopts): Add --no-dereference option. + (main): Accept --no-dereference option. + (option_help_msgid): Mention the --no-dereference option. + (compare_files): If no_dereference_symlinks is true, use lstat() + instead of stat(). Compare symbolic links by comparing their values. + * bootstrap.conf (gnulib_modules): Add lstat, stat, xreadlink. + * doc/diffutils.texi (Comparing Directories, diff Options): Mention the + --no-dereference option. + * tests/no-dereference: New file. + * tests/Makefile.am (TESTS): Add it. + +2012-01-01 Jim Meyering + + maint: update all copyright year number ranges + Run "make update-copyright". + +2011-12-14 Jim Meyering + + build: update to latest gnulib and adapt + * tests/binary: Reverse arguments to compare to avoid failure of + new syntax-check rule. + * configure.ac: Use -Wno-format-nonliteral. + Mark functions as pure of const, per recommendations enabled by + new gcc -W options. Use _GL_ATTRIBUTE_PURE and _GL_ATTRIBUTE_CONST. + * lib/cmpbuf.h (buffer_lcm, block_compare): + Apply pure and/or const attributes. + * src/cmp.c (block_compare): Likewise. + * src/context.c (find_hunk): Likewise. + * src/diff.h (lines_differ): Likewise. + * src/diff3.c (skipwhite): Likewise. + * src/dir.c (dir_loop): Likewise. + * src/util.c (find_change, find_reverse_change): Likewise. + (translate_line_number): Likewise. + + build: stop distributing gzip'd releases; xz is enough + * configure.ac (AM_INIT_AUTOMAKE): Add no-dist-gzip. + +2011-11-29 Jim Meyering + + tests: use "compare exp out", not "compare out exp" + Likewise, when an empty file is expected, use "compare /dev/null out", + not "compare out /dev/null". I.e., specify the expected/desired contents + via the first file name. Prompted by a suggestion from Bruno Haible + in http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4020/focus=29154 + + Run these commands: + + git grep -l -E 'compare [^ ]+ exp' \ + |xargs perl -pi -e 's/\b(compare) (\S+) (exp\S*)/$1 $3 $2/' + git grep -l -E 'compare [^ ]+ /dev/null' \ + |xargs perl -pi -e 's,\b(compare) (\S+) (/dev/null),$1 $3 $2,' + + But manually convert this one: + + -compare out exp-$(echo $opt|tr ' ' _) + +compare exp-$(echo $opt|tr ' ' _) out + + and avoid an inappropriate change to cfg.mk. + +2011-10-12 Stefano Lattarini + + tests: use more portable fd redirection in TESTS_ENVIRONMENT + * tests/Makefile.am (TESTS_ENVIRONMENT): Redirection with `exec 9>&2' + is not portable to various Korn shells, and to (at least) HP-UX 11 + /bin/sh. Use a more portable idiom. + See http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/22488 for + lots of discussion. + +2011-10-11 Stefano Lattarini + + tests: make test runner a script, not a shell function + All the test scripts in the diffutils testsuite are shell scripts, + so the current definition of TESTS_ENVIRONMENT, which adaptively + run tests using either perl or the shell depending on their kind, + is an overkill. + + Moreover, this change is required in order for the testsuite to + continue to work with the new testsuite harness that is planned + to be introduced in Automake 1.12 (which, as of the writing date, + is still under development and in late alpha state). + + See also related discussion on bug-coreutils: + + + * tests/Makefile.am (TESTS_ENVIRONMENT): Remove definition of the + `shell_or_perl_' shell function, which is not required anymore. + (LOG_COMPILER): New, define to `$(SHELL)'. + * tests/binary: Make executable. + * tests/colliding-file-names: Likewise. + * tests/excess-slash: Likewise. + * tests/no-newline-at-eof: Likewise. + +2011-10-04 Claudio Bley + + portability: use SET_BINARY rather than xfreopen (NULL, ... + * src/diff.c: Include binary-io.h, not xfreopen.h. + (main): Use SET_BINARY (...) rather than xfreopen (NULL, X, ...), + because the latter doesn't work on MinGW and crashes using MSVC. + * src/cmp.c (main): Likewise. + +2011-10-04 Jim Meyering + + build: update gnulib submodule to latest + +2011-09-02 Jim Meyering + + post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 3.2 + * NEWS: Record release date. + + build: update bootstrap and tests/init.sh from gnulib + * bootstrap: Update from gnulib. + * tests/init.sh: Likewise. + + build: update gnulib submodule to latest + +2011-09-01 Jim Meyering + + doc: diffutils' texi-derived doc may now be in debian's "main" section + * NEWS (Packaging): Mention the "no front/back-cover" change. + +2011-08-14 Jim Meyering + + maint: avoid new "make sytnax-check" failure. + * src/diff.h (find_dir_file_pathname): Mark declaration with "extern" + keyword, in order to placate the tight-scope syntax check. + +2011-08-14 Paul Eggert + + * src/io.c (find_and_hash_each_line): Refactor for brevity. + +2011-08-14 Roland McGrath + + diff, sdiff: new option --ignore-trailing-space (-Z) + Derived from Roland McGrath's patch (dated June 2004!) in: + http://lists.gnu.org/archive/html/bug-gnu-utils/2004-07/msg00000.html + * NEWS: + * doc/diffutils.texi (White Space, Blank Lines) + (sdiff Option Summary, diff Options, sdiff Options): Document -Z. + * src/diff.h (IGNORE_TRAILING_SPACE) + (IGNORE_TAB_EXPANSION_AND_TRAILING_SPACE): New constants, for -Z. + * src/diff.c (shortopts, longopts, main, option_help_msgid): + * src/sdiff.c (longopts, option_help_msgid, main): + * src/io.c (find_and_hash_each_line): + * src/util.c (lines_differ, analyze_hunk): Support -Z. + +2011-08-13 Paul Eggert + + * bootstrap.conf (gnulib_modules): Remove timegm. + This fixes a problem noted by Andreas Schwab in: + http://lists.gnu.org/archive/html/bug-diffutils/2011-08/msg00035.html + +2011-08-13 Tim Waugh + + diff: --ignore-file-name-case now applies at top level too + Derived from Tim Waugh's patch in: + http://lists.gnu.org/archive/html/bug-diffutils/2011-08/msg00034.html + * NEWS, doc/diffutils.texi (diff Options): Document this. + * src/diff.c (compare_files): Implement this, by using + find_dir_file_pathname. + * src/diff.h (find_dir_file_pathname): New decl. + * src/dir.c: Include filenamecat.h. + (find_dir_file_pathname): New function. + +2011-08-13 Paul Eggert + + * .gitignore: Add lib/unistr, lib/unused-parameter.h. + +2011-08-10 Jim Meyering + + post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 3.1 + * NEWS: Record release date. + + build: use largefile module and update to latest gnulib + * configure.ac: Remove AC_SYS_LARGEFILE, subsumed by ... + * bootstrap.conf (gnulib_modules): ...this. Use largefile module. + * gnulib: Update to latest. + +2011-08-08 Santiago Vila + + doc: insert comma in --help line for --ignore-space-change (-b) + * src/diff.c (option_help_msgid): Insert omitted comma between + "-b" and "--ignore-space-change". (tiny change) + +2011-08-04 Jim Meyering + + doc: relax restriction on front-cover and back-cover texts + * doc/diffutils.texi (copying): Relax restriction on front-cover + and back-cover texts (just as m4 did here: + http://git.savannah.gnu.org/cgit/m4.git/commit?id=ee1e92ec). + Reported by Santiago Vila. Fix suggested by Eric Blake. + +2011-08-03 Jim Meyering + + tests: update init.sh from gnulib + * tests/init.sh: Update from gnulib. + + build: update gnulib submodule to latest + +2011-07-03 Jim Meyering + + maint: remove inclusion of unused header, for "make syntax-check" + * src/diff3.c: Don't include . Not used. + * src/context.c: Likewise. + +2011-06-19 Jim Meyering + + build: don't require perl when building from a tarball + But do ensure -- in all other circumstances -- that the man/*.1 + files are rebuilt whenever the version number changes. + * configure.ac (SRC_VERSION_C): Define. + * man/Makefile.am (dist_man1_MANS): Rename from $(man1_MANS), + so that we distribute those pesky man/*.1 files. + (EXTRA_DIST): Reflect name change. + (MAINTAINERCLEANFILES): Define this, not DISTCLEANFILES, + now that these generated files are distributed. + ($(dist_man1_MANS)): Depend on $(SRC_VERSION_C), so we get the + full dependency when not building from a tarball. + +2011-06-13 Jim Meyering + + doc: do not distribute generated man/*.1 man files + * man/help2man: New file. + * man/Makefile.am: Use $(srcdir)/help2man. + Convert $(dist_man1_MANS) to $(man1_MANS), to tell automake + not to distribute the generated man/*.1 files. Now they're + generated at build-from-tarball time. + ($(man1_MANS)): Depend on version.c, so that man pages are + regenerated whenever the version string changes. + + build: ccache works better without embedded version strings + * src/Makefile.am: Generate version.c and version.h and put the + new symbol in a tiny library to be used by each program. + (LDADD): Add the new library. + * src/cmp.c (main): Use Version, not PACKAGE_VERSION, so the .o + file does not change with each commit-derived version increment. + * src/diff.c (main): Likewise. + * src/diff3.c (main): Likewise. + * src/sdiff.c (main): Likewise. + * src/system.h: Include "version.h". + * .gitignore: Add version.[ch] + +2011-06-12 Jim Meyering + + doc: ensure each program has a man/*.x file: add "SEE ALSO" references + * man/cmp.x: New file. + * man/diff3.x: New file. + * man/sdiff.x: New file. + * man/diff.x: Add xrefs to the other three programs, and to patch. + * man/Makefile.am (EXTRA_DIST): List new files. + (cmp.1, diff3.1, sdiff.1): Depend on each .x file. + + doc: rename diff.texi to diffutils.texi + This makes the .texi basename the same as the package name, + which is consistent with most other GNU packages. + * doc/diffutils.texi: Rename from... + * doc/diff.texi: ...removed. + * doc/Makefile.am (info_TEXINFOS): Reflect name change. + (diffutils_TEXINFOS): Likewise. + * cfg.mk (gendocs_options_): Remove this customization. It is no + longer needed, now that the .texi name matches that of the package. + * man/Makefile.am ($(dist_man1_MANS)): Remove now-unnecessary sed + filter. + * README: Update references to diffutils.texi etc. here, too. + * .gitignore: Update here, too. + Suggested by Karl Berry. + +2011-06-08 Karl Berry + + cmp, diff, diff3, sdiff: edit and align --help text. + * cmp.c (option_help_msgid, usage), + * diff.c (option_help_msgid, usage), + * diff3.c (option_help_msgid, usage), + * sdiff.c (option_help_msgid, usage): align descriptions in the --help + output and slightly edit content. + +2011-05-27 Paul Eggert + + diff: don't use locales after local-specific sorting fails + * src/dir.c (compare_names): Don't invoke strcasecmp if + locale-specific sorting fails, because POSIX.1-2008 says strcasecmp + has unspecified behavior outside the POSIX locale. See: + http://lists.gnu.org/archive/html/bug-diffutils/2011-05/msg00008.html + + bootstrap: Avoid multithreading. + * bootstrap.conf (gnulib_tool_option_extras): + Add "--avoid=localename --avoid=lock", because we don't want to + bring in the multithreading code that recent gnulib changes would + otherwise bring in. + (excluded_files): Remove m4/lock.m4; no longer needed, now that + we use --avoid=lock. + + build: update gnulib submodule to latest + +2011-05-23 Karl Berry + + maint: update README-hacking + * README-hacking: Update a la coreutils for git, etc. + +2011-05-23 Jim Meyering + + maint: update gnulib to latest with accompanying tight-scope tweaks + * cfg.mk: Include $(srcdir)/dist-check.mk using "-include", + to accommodate the new sc_tight_scope rule. + (_gl_TS_extern): Define, to tell gnulib's tight_scope rule that + headers here mark externs with "XTERN". + * gnulib: Update to latest. + +2011-05-18 Jim Meyering + + maint: use gnulib's new readme-release module + * bootstrap.conf (gnulib_modules): Add readme-release. + (bootstrap_epilogue): Add the recommended perl one-liner. + * README-release: Remove file; it is now generated from gnulib. + * .gitignore: Add it. + + build: update gnulib submodule to latest + + maint: prepare for the tight-scope check + * src/diff.h: Mark function declarations with "extern" in + preparation for the tight-scope check. + (ignore_white_space): Separate enum decl from declaration + of this variable. + * src/Makefile.am (diff_SOURCES): Move diff.h from here to ... + (noinst_HEADERS): ...here. + For convenience, since the tight-scope rule uses $(noinst_HEADERS). + + maint: don't use now-removed gnulib "exit" module + * bootstrap.conf (gnulib_modules): Remove "exit" module. + It no longer exists. + +2011-03-26 Jim Meyering + + build: update gnulib submodule to latest + + * .x-sc_space_tab: Remove file. Instead, ... + * cfg.mk (exclude_file_name_regexp--sc_space_tab): ...define this. + + maint: fix typo in unused rule + * cfg.mk (config-save): Fix typo: add leading "_" in variable name. + +2011-03-18 Jim Meyering + + doc: add a reference to wdiff(1) from diff.1 + * man/diff.x: New file, to add "SEE ALSO" reference to wdiff(1). + * man/Makefile.am (diff.1): Depend on diff.x. + ($(dist_man1_MANS)): Tell help2man to include diff.x. + (EXTRA_DIST): Add diff.x. + Suggestion from Dan Jacobson in http://bugs.debian.org/613319 + +2011-03-18 Eric Blake + + docs: info should mention -L + * doc/diff.texi (diff Options): Document -L. + + docs: diff --help should mention -L + * src/diff.c (option_help_msgid): Document -L. + +2011-02-15 Jim Meyering + + doc: speak of the --test (-a) option, not "the -a or --test option" + Convert using this command: + perl -pi -e \ + 's/(\@option{-.}) or (\@option{--.*?}) option/$2 ($1) option/' \ + doc/diff.texi + Then convert some more with this: + perl -pi -e \ + 's/the (\@option{-.}) or (\@option{--.*?})$/the $2 ($1)/' \ + doc/diff.texi + Then convert more manually. + + Suggested by Dan Jacobson + +2011-01-24 Jim Meyering + + maint: remove all uses of vfork: use fork instead + Our use of vfork now provokes warnings from gcc-4.6.0. + Also, vfork is no longer even specified by POSIX.1-2008. + * src/diff3.c (read_diff): Change each use of vfork to "fork". + Remove #ifdef'd code. + * src/util.c (begin_output, finish_output): Likewise. + * src/sdiff.c (cleanup, main, edit): Likewise. + (handler_index_of_SIGPIPE): Remove now-unused definition. + * src/system.h: Don't include . + (vfork): Remove definition. + * ms/config.site: Remove reference to vfork cache variable. + + tests: avoid newer but less-portable tail option syntax + * tests/function-line-vs-leading-space: Use sed -n '3,$p' rather than + tail -n+3. Older versions of tail do not accept that newer syntax. + Reported by Sudhakara Peram. + + tests: fix an erroneous test + On most systems, like-named files were compared, by luck. + However, on others, different-named files would be compared + since their names were being treated as equal -- but they had + different content, so the test would fail. + * tests/colliding-file-names: Use different sets of file names + in d1 and d2 so that they cannot accidentally match. + Put the same line in each test file. This is required + when files named e.g., abc and ABC are compared. + This test was failing on a NixOS 86_64-darwin system. + + build: update gnulib submodule to latest + + tests: fix typo that silently disabled all tests + * tests/Makefile.am (TESTS): Fix typo: s/jESTS/TESTS/ + +2011-01-23 Jim Meyering + + build: update gnulib submodule to latest + + maint: avoid new syntax-check failure + * src/diff.c (specify_value): Use !STREQ(...), not strcmp(...) != 0. + * src/diff3.c (main): Likewise. + +2011-01-03 Jim Meyering + + maint: update copyright year ranges to include 2011 + Run "make update-copyright", so "make syntax-check" works in 2011. + + build: update gnulib submodule to latest + +2010-12-16 Paul Eggert + + bootstrap: adjust to recent gnulib changes + * bootstrap.conf (excluded_files): Do not exclude m4/size_max.m4 + and m4/xsize.m4 when using an external gettext, since they are + now needed by other gnulib modules. + +2010-12-16 Jim Meyering + + doc: add contributor guidelines: HACKING + * HACKING: New file, copied 99% from the one in grep's repository. + +2010-10-09 Jim Meyering + + maint: describe policy on copyright year number ranges + * README: Mention coreutils' long-standing policy on use of M-N + ranges in copyright year lists. Requested by Richard Stallman. + +2010-09-04 Jim Meyering + + maint: adjust init.sh use to conform + * tests/help-version: Use one line: "${srcdir=.}/init.sh"; ... + * tests/basic: Likewise. + * tests/binary: Likewise. + * tests/colliding-file-names: Likewise. + * tests/excess-slash: Likewise. + * tests/function-line-vs-leading-space: Likewise. + * tests/help-version: Likewise. + * tests/label-vs-func: Likewise. + * tests/no-newline-at-eof: Likewise. + * tests/stdin: Likewise. + + maint: avoid shadowing warning + * src/dir.c (diff_dirs): Rename shadowed local cmp to "c". + +2010-09-03 Jim Meyering + + build: use gettext-h, not gettext + * bootstrap.conf (gnulib_modules): Use gettext-h, not gettext. + The latter is overkill for a package that uses + AM_GNU_GETTEXT([external]... + + build: update build/test tools from gnulib + * bootstrap: Update from gnulib. + * tests/init.sh: Likewise. + + build: update gnulib submodule to latest + +2010-08-14 Jim Meyering + + diff -r: avoid printing excess slashes in concatenated file names + * bootstrap.conf (gnulib_modules): Add filenamecat. + * src/diff.c: Include "filenamecat.h". + (compare_files): Use file_name_concat, rather than dir_file_pathname. + * src/util.c (dir_file_pathname): Remove now-unused function. + * src/diff.h: Remove its declaration. + * tests/excess-slash: New script to test for this. + * tests/Makefile.am (TESTS): Add it. + Forwarded by Santiago Vila from , + reported by Jari Aalto. + +2010-08-12 Paul Eggert + + diff: avoid spurious diffs when two distinct dir entries compare equal + Problem reported by Christoph Anton Mitterer in: + http://lists.gnu.org/archive/html/bug-diffutils/2010-08/msg00000.html + + * NEWS: Mention this bug fix. + * src/dir.c (compare_names_for_qsort): Fall back on file_name_cmp + if two distinct entries in the same directory compare equal. + (diff_dirs): Prefer a file_name_cmp match when available. + * tests/Makefile.am (TESTS): New test colliding-file-names. + * tests/colliding-file-names: New file. + +2010-05-09 Jim Meyering + + build: update gnulib submodule to latest + + build: don't define macros that gnulib provides + * bootstrap.conf (gnulib_modules): Add signal, stdint. + * lib/cmpbuf.c (SA_RESTART, SA_INTERRUPT): Remove definitions. + (SIZE_MAX, PTRDIFF_MAX): Likewise. + Include . + * src/system.h (WEXITSTATUS, WIFEXITED): Remove definitions. + (SA_RESTART, SA_INTERRUPT): Likewise. + + build: rely on gnulib's sigprocmask module + * src/sdiff.c: Remove #if-!HAVE_SIGPROCMASK-guarded code. + * bootstrap.conf (gnulib_modules): Add sigprocmask. + +2010-05-04 Jim Meyering + + doc: README-release: don't mention To:, Cc:, etc announcement headers, + now that those are supplied automatically via gnulib's maint.mk. + * README-release: sync with coreutils. + + maint: teach web-doc-generating code how to do its job + * cfg.mk (gendocs_options): Define, so that gendocs.sh knows + the name of our texinfo source file. + * gnulib: Update to latest, for new gnu-web-doc-update and maint.mk. + +2010-05-03 Jim Meyering + + doc: update release procedure + * README-release: Rearrange slightly: post the announcement to + Savannah first, so you can include a link to that post in the email. + Sync a few details from coreutils' README-release. + + post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 3.0 + * NEWS: Record release date. + + build: update gnulib submodule to latest + +2010-04-30 Jim Meyering + + build: use gnulib's sys_wait module + * bootstrap.conf (gnulib_modules): Use gnulib's sys_wait module, + now that we assume its presence. + + build: update gnulib submodule to latest + * bootstrap: Also update from gnulib. + * tests/init.sh: Likewise + + maint: remove now-useless #if HAVE_HEADER_H guards + * src/system.h: Include unconditionally, + now that gnulib guarantees its presence. + * lib/cmpbuf.c: Likewise for and . + +2010-04-16 Jim Meyering + + tests: use original no-newline-at-eof test, but with -U1, not -U2 + * tests/no-newline-at-eof: Revert to the smaller test, but with + -U1 rather than -U2, since that actually triggers the bug. + +2010-04-16 Paul Eggert + + Followon improvements for the fix for Debian bug 577832. + * src/io.c (find_and_hash_each_line): Omit the inserted newline in + a simpler way. + * tests/no-newline-at-eof: Fix the test case so that it rejects + the old, buggy behavior. + +2010-04-16 Jim Meyering + + build: update gnulib submodule to latest + + tests: test for the no-newline-at-EOF bug + * tests/no-newline-at-eof: New file. + * tests/Makefile.am (TESTS): Add it. + +2010-04-16 Jim Meyering + + diff: fix a regression when at least one input lacks a newline-at-EOF, + and the final hunk plus context-length aligns exactly with the end + of the newline-lacking file. Diff would fail to output the required + "\ No newline at end of file" line, thus rendering the output invalid. + This bug appears to have been introduced by 2006-05-07 + commit 58d0483b, "(find_identical_ends): Fix huge performance bug...", + at least to the extent that reverting that change fixes the bug. + Considering the stated effect of that change and lack of metrics, + reverting it is not an option, so here we take a more direct approach. + + Given these inputs, + + printf '\n1'>a; printf '\n0\n\n1'>b + + and running diff like this: + + ./diff -U1 a b + + for input file "b", the pointer, files[1].linbuf[4][-1], to + the last byte on the final line was mistakenly pointing at the + sentinel newline at EOF, rather than at the preceding byte. + + (gdb) p files[1].linbuf[4][-1] + $3 = 10 '\n' + + Thus, this test in the final print_1_line call: + + if ((!line_flag || line_flag[0]) && limit[-1] != '\n') + fprintf (out, "\n\\ %s\n", _("No newline at end of file")); + + would fail, because limit[-1] (which is files[1].linbuf[4][-1]) + was mistakenly '\n', rather than the desired '1'. + + My first thought was simply to adjust the final linbuf[line] setting, + at the end of io.c's find_and_hash_each_line function function: + + if (p == bufend) + - break; + + { + + if (current->missing_newline) + + --linbuf[line]; + + break; + + } + + But that would make diff misbehave with this input + (same as above, but with a newline appended to "a"), + + printf '\n1\n'>a; printf '\n0\n\n1'>b + ./diff -U1 a b + + due to the block (100 lines above) that is triggered in that case + (but not in the both-files-missing-newline case): + + if (p == bufend + && current->missing_newline + && ROBUST_OUTPUT_STYLE (output_style)) + { + /* This line is incomplete. If this is significant, + put the line into buckets[-1]. */ + if (ignore_white_space < IGNORE_SPACE_CHANGE) + bucket = &buckets[-1]; + + /* Omit the inserted newline when computing linbuf later. */ + p--; + bufend = suffix_begin = p; + } + + Note how "p" is decremented and "bufend" adjusted. + When that happens, we certainly don't want to decrement + "bufend" yet again. + + Since there is no other way to determine at the end whether "bufend" + was already decremented, add a new variable to serve as witness. + + * NEWS (Bug fixes): Mention it. + Reported by Timo Juhani Lindfors in http://bugs.debian.org/577832. + Forwarded by Santiago Vila. + +2010-04-16 Jim Meyering + + tests: update init.sh from gnulib + * tests/init.sh: Update from gnulib. + +2010-04-08 Jim Meyering + + build: include cfg.mk and dist-check.mk in the distribution tarball + * Makefile.am (EXTRA_DIST): Add cfg.mk and dist-check.mk. + + maint: update to latest gnulib + * cfg.mk (sc_cross_check_PATH_usage_in_tests): Remove rule, + now that it's in gnulib's maint.mk. + * gnulib: Update to latest. + +2010-04-07 Jim Meyering + + tests: make new PATH-crosschecking syntax-check tighter + * cfg.mk (sc_cross_check_PATH_usage_in_tests): Use grep's -x (match + entire line) option with -F. + + tests: pull latest help-version from gzip + * tests/help-version: Update from gzip. + * Makefile.am (TESTS_ENVIRONMENT): Export VERSION, + as required for this new help-version script. + + tests: add syntax-check rule to verify that tests use proper PATH + * cfg.mk (sc_cross_check_PATH_usage_in_tests): New rule, that is + useful only in conjunction with the help-version script. + + tests: use path_prepend_ consistently; remove unnecessary VERBOSE check + * tests/basic: Likewise. + * tests/binary: Likewise. + * tests/function-line-vs-leading-space: Likewise. + * tests/label-vs-func: Likewise. + * tests/stdin: Likewise. + +2010-04-06 Eric Blake + + maint: ignore generated files + * .gitignore: Ignore recent gnulib additions. + + maint: update to latest bootstrap + * bootstrap: Copy from gnulib/build-aux. + +2010-04-05 Jim Meyering + + tests: get latest init.sh from gnulib + * tests/init.sh: Update from gnulib. + + build: update gnulib submodule to latest; adapt + * cfg.mk (local-checks-to-skip): Add new sc_texinfo_acronym, to skip it. + + diff -F/-p: don't depend on locale-specific white-space definition + * src/context.c: Include "c-ctype.h". + Use c_isspace, not isspace. + +2010-03-18 Jim Meyering + + tests: exercise new behavior of -F RE + * tests/function-line-vs-leading-space: New file. + * tests/Makefile.am (TESTS): Add it. + +2010-03-18 Yannick Moy + + with -F or -p, emit better function lines: no leading white space + * src/diff.c (print_context_function): For languages like Ada + that allow local functions and procedures, the plain context + function line may start with enough blank characters that the + function name does not get completely printed in the 40 + characters limit. This patch solves this problem by removing + these useless initial blank characters. + * NEWS (Changes in behavior): Mention this change. + +2010-03-17 Jim Meyering + + build: don't require a specific version of help2man + * bootstrap.conf (buildreq): Bootstrap can't deal with it, + perhaps because the command name contains a digit. + + build: make bootstrap ensure that help2man is available + * bootstrap.conf (buildreq): Add help2man. + +2010-02-23 Jim Meyering + + tests: test for the "Binary files A and B differ" diagnostic + * tests/binary: New script. + * tests/Makefile.am (TESTS): Add it. + + revert 2002 change that removed "Binary " from "files A and B differ" + With this change, "printf '\0'|diff - /dev/null" now prints + "Binary files - and /dev/null differ" once again. + This reverts 2002-06-28 commit a352f0980, + "(briefly_report): Don't say "Binary files differ", ...". + * src/analyze.c (briefly_report): Do include the "Binary " prefix + in the diagnostic, when !brief. + * NEWS (Changes in behavior): Mention the diagnostic change. + Reported by Andreas Hoenen in http://bugs.debian.org/570064. + +2010-02-14 Juan Manuel Guerrero + + avoid compilation failure on systems lacking both fork and vfork + * src/sdiff.c [!HAVE_WORKING_FORK && !HAVE_WORKING_VFORK] (main): + Pass the right number of arguments to shell_quote_copy. + * src/util.c [!HAVE_WORKING_FORK && !HAVE_WORKING_VFORK] (begin_output): + Likewise. + +2010-02-11 Jim Meyering + + post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.9 + * NEWS: Record release date. + + doc: document the release procedure + * README-release: New file. + +2010-02-10 Jim Meyering + + maint: change use of "|" to more maintainable "||" (no semantic change) + * src/analyze.c (diff_2_files): Using the "||" operator happens to + be equivalent to using "|" in this case. It is also clearer and + less prone to inadvertent bug introduction, in case the variable, + "changes" were ever to take on a value not in {0,1}. + Patch by Tim Waugh, via Mike Frysinger. + + portability: avoid "diff - ..." failure at least on *BSD and Solaris + The new "stdin" test was failing on many types of systems. + * src/diff.c (compare_files): Guard use of xfreopen (NULL, "rb", ... + also with O_BINARY, so as to avoid this unnecessary call on + systems where it's not needed (on some it fails with "Bad address". + +2010-02-09 Jim Meyering + + tests: honor VERBOSE + * tests/basic: Enable "set -x" if $VERBOSE. + * tests/help-version: Likewise. + * tests/label-vs-func: Likewise. + * tests/stdin: Likewise. + +2010-02-04 Jim Meyering + + build: update gnulib submodule to latest + + sync with gnulib + * gl/lib/regcomp.c.diff: Adjust to apply to the latest in gnulib. + * gnulib: Update submodule to latest. + +2010-02-04 Jim Meyering + + build: do not override gnulib-provided AM_CFLAGS options + Avoid a warning from automake: + lib/Makefile.am:23: AM_CFLAGS multiply defined in condition TRUE ... + lib/gnulib.mk:30: ... `AM_CFLAGS' previously defined here + lib/Makefile.am:18: `lib/gnulib.mk' included from here + + * lib/Makefile.am (AM_CFLAGS): Append $(WARN_CFLAGS) and + $(WERROR_CFLAGS), i.e., use "+=", not "=". + This was introduced via 2009-12-17 commit e58efa5b + "build: enable warnings and -Werror.", + but fortunately is not a bug, because the definition + it would have overridden was always empty. + +2010-01-17 Jim Meyering + + maint: add to .gitignore + * .gitignore: Ignore more. + +2010-01-15 Jim Meyering + + doc: add to TODO + * TODO: Add an item, suggested by Dan Jacobson. + +2010-01-13 Jim Meyering + + tests: ensure that an argument of "-" is treated as standard input + * tests/stdin: New test. + * tests/Makefile.am (TESTS): Add it. + +2010-01-10 Jim Meyering + + tests: now "make distcheck" runs more tests, incl. syntax-check + * cfg.mk: Include dist-check.mk, from coreutils. + * Makefile.am (distcheck-hook): Define rule, to hook to... + * dist-check.mk: New file. + +2010-01-09 Jim Meyering + + build: update gnulib to latest, for fixed syntax-check rule + + maint: record updated NEWS hash + * cfg.mk (old_NEWS_hash): Update to account for GFDL change. + + build: update gnulib submodule to latest + + tests: add a test of basic functionality + * tests/basic: Start adding tests. + * tests/Makefile.am (TESTS): Add it. + + maint: udpate GFDL license to 1.3 + * doc/diff.texi: Update to use GFDL version 1.3. + +2010-01-04 Eric Blake + + build: allow compilation on cygwin + * src/Makefile.am (cmp_LDADD): Move LIBICONV... + (LDADD): ...into global flags, since all programs need it. + +2010-01-03 Jim Meyering + + maint: record update-copyright options for this package + * cfg.mk: Next time, just run "make update-copyright". + + tests: prepend ../src, not "." to PATH + * tests/help-version: Correct PATH. + +2010-01-01 Jim Meyering + + maint: update all FSF copyright year lists to include 2010 + Use this command: + git ls-files |grep -vE '^(\..*|COPYING|gnulib)$' |xargs \ + env UPDATE_COPYRIGHT_USE_INTERVALS=1 build-aux/update-copyright + +2009-12-31 Jim Meyering + + maint: newer gnulib; don't hard-code my GPG key ID + * cfg.mk (gpg_key_ID): Remove definition, now that maint.mk automates it. + * gnulib: Update to latest. + + tests: exercise diff -p's function-name matching + * tests/label-vs-func: New file. + * tests/Makefile.am (TESTS): Add label-vs-func. + Reported by Simon Arlott + http://article.gmane.org/gmane.linux.kernel.janitors/14260 + + tests: use gnulib's init.sh + * tests/Makefile.am (EXTRA_DIST): Add init.sh. + Remove test-lib.sh. + * tests/init.sh: New file. + * tests/test-lib.sh: Remove file. + * tests/help-version: Use init.sh, not test-lib.sh. + +2009-11-28 Jim Meyering + + maint: don't let trailing spaces in diffs perturb make syntax-check + * .x-sc_space_tab: New file. + +2009-11-22 Jim Meyering + + build: enable warnings and -Werror. + * src/Makefile.am (AM_CFLAGS): Enable warnings and -Werror. + Set to this: $(WARN_CFLAGS) $(WERROR_CFLAGS) + * lib/Makefile.am (AM_CFLAGS): Similarly, but use this: + $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) + * configure.ac (GNULIB_WARN_CFLAGS): Don't turn off -Wuninitialized. + + build: avoid a warning from gnulib's sh-quote.c + * gl/lib/sh-quote.c.diff: New file, to avoid a warning. + + maint: avoid warnings via patched versions of gnulib's regex functions + * gl/lib/regcomp.c.diff: New file. + * gl/lib/regex_internal.c.diff: Likewise. + * gl/lib/regex_internal.h.diff: Likewise. + * gl/lib/regexec.c.diff: Likewise. + + build: update gnulib submodule to latest + +2009-11-20 Eric Blake + + build: ignore more files + * .gitignore: Add config.cache, *.exe. + +2009-11-20 Eric Blake + + build: fix test run on cygwin + This, plus a gnulib update for xalloc-die-tests, are necessary + for make check to pass on cygwin. + + * tests/Makefile.am (built_programs): Ignore $(EXEEXT). + * src/Makefile.am (paths.h): Add missing dependency. + +2009-11-20 Jim Meyering + + maint: remove vestiges of nanosleep + * src/Makefile.am (LDADD): Remove $(LIB_NANOSLEEP), now + that we no longer use the nanosleep module. + Spotted by Eric Blake. + + maint: don't pull in gnulib's nanosleep unnecessarily + * bootstrap.conf (gnulib_modules): Remove nanosleep. Not needed. + Spotted by Eric Blake. + + maint: cfg.mk: remove factored-out ftp host/dir definitions + * cfg.mk (gnu_ftp_host-alpha, gnu_ftp_host-beta gnu_ftp_host-stable): + (gnu_rel_host, url_dir_list): Remove definitions. The defaults, + now provided by maint.mk, are the same. + * gnulib: Update for latest, including those maint.mk additions. + + build: link with now-required libraries + * src/Makefile.am (LDADD): Add gnulib-required libraries. + (cmp_LDADD): Add $(LIBICONV), for cmp's use of proper_name_utf8. + + maint: lib/xfreopen.c contains translatable strings + * po/POTFILES.in: Add lib/xfreopen.c. + + maint: remove hard-coded macro definitions provided by intprops.h + * lib/cmpbuf.c: Include "intprops.h" rather than open-coding macros + like TYPE_SIGNED and TYPE_MINIMUM. + + maint: add gnulib's announce-gen module + * bootstrap.conf (gnulib_modules): Add announce-gen + + build: suppress warnings about bindtextdomain and textdomain + * src/system.h (bindtextdomain, textdomain) [!ENABLE_NLS]: Define away. + + build: use more gnulib modules + * bootstrap.conf (gnulib_modules): Add mktime, nanosleep, strptime + and timegm. + + use xfreopen rather than freopen + * src/cmp.c: Include "xfreopen.h". + Use xfreopen in place of freopen. + * src/diff.c Likewise, and... + (main): Set exit_failure to EXIT_TROUBLE, rather than to 2. + * src/diff3.c: Likewise. + * bootstrap.conf (gnulib_modules): Add xfreopen. + + build: enable many warnings + * configure.ac: Add support for --enable-gcc-warnings. + * bootstrap.conf (gnulib_modules): Add manywarnings. + * Makefile.am (AM_CFLAGS): Add $(WARN_CFLAGS) $(WERROR_CFLAGS) + + build: update gnulib submodule to latest + + maint: add an assertion to suppress clang-detected warning + The clang static analyzer reported that a NULL parent could be + dereferenced. However, that cannot happen, because for all callers, + the parameter, parent, is always non-NULL at that point. + * src/diff.c: Include . + Assert that parent is not NULL. + + maint: remove dead assignment from diff3.c + * src/diff3.c (make_3way_diff): Remove dead assignment. + +2009-11-17 Jim Meyering + + build: update gnulib submodule to latest + + maint: hide build commands behind $(AM_V_GEN) + * src/Makefile.am (paths.h): Use $(AM_V_GEN), and split a long line. + * man/Makefile.am ($(dist_man1_MANS)): Use $(AM_V_GEN) here, too. + +2009-11-16 Jim Meyering + + build: let automake generate better man-installation rules + * man/Makefile.am (dist_man1_MANS): Rename from dist_man_MANS, + to enable better automake-generated installation rules. + + admin: ignore all of gnulib-tests + * .gitignore: Add gnulib-tests + +2009-11-16 Eric Blake + + build: avoid link failure when libsigsegv is used + * src/Makefile.am (LDADD): Link against LIBSIGSEGV. + +2009-11-16 Jim Meyering + + maint: define/use PROGRAM_NAME and AUTHORS; use propername module + * bootstrap.conf (gnulib_modules): Add propername. + * src/cmp.c (PROGRAM_NAME, AUTHORS): Define. + (main): Use them in use of version_etc. + * src/diff.c (PROGRAM_NAME, AUTHORS, main): Likewise. + * src/diff3.c (PROGRAM_NAME, AUTHORS, main): Likewise. + * src/sdiff.c (PROGRAM_NAME, AUTHORS, main): Likewise. + * src/system.h: Include "propername.h". + + maint: no longer define *_FILENO constants + * src/system.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): + Remove definitions. Now guaranteed by gnulib. + + maint: bug-diffutils@gnu.org is the new bug-reporting address + * configure.ac (AC_INIT): Use bug-diffutils@..., not bug-gnu-utils + as the bug-reporting address. + * NEWS (Administrivia): Mention this. + * src/cmp.c (usage): Remove hard-coded address. + Instead, use gnulib's emit_bug_reporting_address function. + * src/diff.c (usage, option_help_msgid): Likewise. + * src/diff3.c (usage): Likewise. + * src/sdiff.c (usage): Likewise. + + sdiff, diff3: exec diff, not $(bindir)/diff + * src/Makefile.am (paths.h): Emit a definition of DEFAULT_DIFF_PROGRAM + that is simply "diff" (or whatever $(transform) would convert that to, + e.g., "gdiff"). This makes it so that tests can work without first + installing diff, and so that the binaries do not hard-code $(prefix). + * NEWS (Changes in behavior): Mention this. + +2009-11-14 Jim Meyering + + tests: add the first script; hook up gnulib-tests + * configure.ac (AC_CONFIG_FILES): Add tests/Makefile and + gnulib-tests/Makefile. + * tests/help-version: New file, from coreutils. + * tests/test-lib.sh: Likewise. + * tests/Makefile.am: New file, from gzip. + * Makefile.am (SUBDIRS): Add tests and gnulib-tests. + * tests/t-local.sh: New, empty(for now) file. + +2009-11-13 Jim Meyering + + build: require gettext-0.17 + * configure.ac: Require gettext-0.17; it was released two years ago. + + build: correct gettext configure-time support + * configure.ac: Use AM_GNU_GETTEXT([external], [need-ngettext]), + rather than AM_GNU_GETTEXT([external], [need-formatstring-macros]). + Reported by Martin Jacobs in + http://thread.gmane.org/gmane.comp.parsers.bison.bugs/3181 + +2009-11-12 Jim Meyering + + build: generalize autoheader check + * bootstrap: Look for AC_CONFIG_HEADER as well as AC_CONFIG_HEADERS. + +2009-11-11 Jim Meyering + + maint: use a git submodule for gnulib + * .gitmodules: New file, to track gnulib. + * gnulib: New file, created by running this: + git submodule add git://git.sv.gnu.org/gnulib.git gnulib + + maint: tell git what it can ignore + * .gitignore: Ignore generated files. diff --git a/local/recipes/tools/diffutils/source/ChangeLog-2008 b/local/recipes/tools/diffutils/source/ChangeLog-2008 new file mode 100644 index 0000000000..714c354da9 --- /dev/null +++ b/local/recipes/tools/diffutils/source/ChangeLog-2008 @@ -0,0 +1,4273 @@ +2008-01-30 Paul Eggert + + * doc/diff.texi: Update Back-Cover text to reflect new GNU wording. + +2008-01-24 Paul Eggert + + * src/side.c [!HAVE_MBRTOWC]: Supply defns for mbstate_t and mbrtowc. + Problem reported by Bruno Haible. + +2008-01-23 Paul Eggert + + * src/side.c (print_half_line): Don't convert to unsigned char + unnecessarily. + + Don't mishandle multibyte characters in side-by-side format. + Problem reported by Erik Karlsson in + . + * bootstrap.conf (gnulib_modules): Add wcwidth. + * src/side.c: Include . + (print_half_line): Compute number of bytes and print widths of + multibyte characters. Inspired by an alternative solution from + Bruno Haible in + . + +2007-12-04 Paul Eggert + + * NEWS: New diff option --suppress-blank-empty (no longer -u default). + * doc/diff.texi (Detailed Unified): Trailing spaces are no longer + omitted. + (Trailing Blanks): New section. + (diff Options) Mention new option. + * src/diff.h (suppress_blank_entry): New decl. + * src/context.c (pr_unidiff_hunk): Support --suppress-blank-empty. + * src/util.c (print_1_line): Likewise. + * src/diff.c (longopts, main, option_help_msgid): Likewise. + (SUPPRESS_BLANK_EMPTY_OPTION): New constant. + + * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS after gl_EARLY, + since gnulib now requires this order. + + * bootstrap: Import from gnulib. + +2007-08-17 Paul Eggert + + Break out diffseq.h into a separate file, so that gettext can use + this code. Idea and code from Bruno Haible. + * bootstrap.conf (gnulib_modules): Add diffseq. + * src/analyze.c (xvec, yvec, fdiag, bdiag, too_expensive, SNAKE_LIMIT): + (struct partition, diag, compareseq): Remove; now in diffseq.h. + (ELEMENT, EQUAL, OFFSET, EXTRA_CONTEXT_FIELDS, NOTE_DELETE, NOTE_INSERT): + (USE_HEURISTIC): New macros. + Include "diffseq.h". + (diff_2_files): Rewrite to use new diffseq.h interface. + + * bootstrap: Import from gnulib. + +2007-08-15 Paul Eggert + + * src/diff.c (compare_files): Use last_component rather than base_name, + adjusting to gnulib API change. This avoids a memory leak. + * src/sdiff.c (expand_name): Likewise. + * src/util.c (dir_file_pathname): Likewise. + + * doc/diff.texi (Copying This Manual): Adjust to new fdl.texi layout. + +2007-07-19 Paul Eggert + + * doc/diff.texi (White Space): Note that newline always ends a line, + so -w doesn't ignore newline-related changes. Problem reported by + David Kastrup. + + * COPYING: New file. + * AUTHORS: Update from GPLv2 to GPLv3. + * Makefile.am: Likewise. + * NEWS: Likewise. + * README: Likewise. + * README-hacking: Likewise. + * bootstrap: Likewise. + * bootstrap.conf: Likewise. + * configure.ac: Likewise. + * exgettext: Likewise. + * doc/Makefile.am: Likewise. + * lib/Makefile.am: Likewise. + * lib/cmpbuf.c: Likewise. + * lib/cmpbuf.h: Likewise. + * lib/prepargs.c: Likewise. + * m4/vararrays.m4: Likewise. + * man/Makefile.am: Likewise. + * ms/Makefile.am: Likewise. + * ms/README: Likewise. + * ms/config.bat: Likewise. + * ms/config.sed: Likewise. + * ms/config.site: Likewise. + * po/POTFILES.in: Likewise. + * src/Makefile.am: Likewise. + * src/analyze.c: Likewise. + * src/cmp.c: Likewise. + * src/context.c: Likewise. + * src/diff.c: Likewise. + * src/diff.h: Likewise. + * src/diff3.c: Likewise. + * src/dir.c: Likewise. + * src/ed.c: Likewise. + * src/io.c: Likewise. + * src/normal.c: Likewise. + * src/sdiff.c: Likewise. + * src/system.h: Likewise. + * src/util.c: Likewise. + + * src/ifdef.c: Fix typo: "GNU DIFF General Public License" should be + "GNU General Public License". Reported by Erich Guenther. + * src/side.c: Likewise. + +2007-06-18 Paul Eggert + + * bootstrap.conf (gnulib_modules): Add inttypes. + * src/context.c (print_context_label): Don't assume that time_t + fits in long int, since it doesn't in FreeBSD/arm. Problem + reported by Xin Li in + . + +2007-06-06 Paul Eggert + + * NEWS: Mention new sdiff aliases 1 and 2 for l and r. + * doc/diff.texi (Merge Commands): Likewise. + * src/sdiff.c (give_help): Give help for them. + (edit): Support them. + +2007-04-11 Paul Eggert + + * doc/diff.texi (Detailed diff3 Normal): "range is a singleton" -> + "there is only one line", for clarity. Suggested by Jerry Peek. + +2007-04-04 Paul Eggert + + * TODO: Mention possible sdiff improvement. + + * bootstrap: Sync from gnulib. + * src/cmp.c: Don't include exit.h; no longer needed. + * src/diff.c: Likewise. + * src/sdiff.c: Likewise. + * src/dir.c: Don't include strcase.h; no longer needed. + * README-alpha: Remove, replacing with: + * README-hacking: New file, taken from coreutils with some changes. + The rename is required by the change to 'bootstrap'. + +2006-11-15 Paul Eggert + + * src/analyze.c (build_reverse_script): Fix typo in comment. + Problem and fix reported by Daniel Hipschman. + +2006-11-14 Paul Eggert + + Don't assume SIGPIPE exists, and that sigblock and sigsetmask + exist if sigprocmask does not. Problem reported by Paul Edwards + for MVS 3.8. + * configure.ac (sigblock): Check whether this function is + available, if sigprocmask is not. + * src/sdiff.c (sigs): Omit SIGPIPE if it's not defined. + Put SIGINT last; all uses changed. + (handler_index_of_SIGPIPE): Omit if SIGPIPE is not defined. + (sigblock, sigsetmask) [!HAVE_SIGBLOCK]: New macros. + (sigprocmask): Don't dump core if O is null. + +2006-11-04 Paul Eggert + + * src/sdiff.c (sigprocmask) [! HAVE_SIGPROCMASK]: Cast 2nd arg to + sigset_t *, since it might be a literal 0. Problem reported by + Paul Edwards for MVS 3.8. + +2006-09-05 Paul Eggert + + * NEWS: diff -u no longer outputs trailing white space unless the + input data has it. Suggested by Jim Meyering. + * doc/diff.texi (Detailed Unified): Document this. + * src/context.c (pr_unidiff_hunk): Implement this. + + Modernize bootstrap procedure to match current gnulib. + * bootstrap: Sync with coreutils bootstrap, except check that + the directory build-aux exists before trying to copy to it. + * bootstrap.conf: New file. + (gnulib_modules): Add config-h, dup2, extensions, fcntl, fdl, + stat-macros, unistd. + * configure.ac: Invoke gl_EARLY and gl_INIT rather than + GNULIB_AUTOCONF_SNIPPET. + (AC_CONFIG_HEADER): Rename config.h to lib/config.h. + (AC_CHECK_HEADERS_ONCE): Don't check for fcntl.h, locale.h, + sys/file.h, unistd.h. We now use the fcntl and unistd modules, + and locale.h can be assumed for any C89 compiler. + (DIFFUTILS_PREREQUISITES): Remove. No longer needed now that + we use the stdint module. + (AC_CHECK_FUNCS_ONCE): Remove dup2, which is no longer needed + now that we use the dup2 module. + (AM_GNU_GETTEXT): Use need-formatstring-macros, and ... + (AM_GNU_GETTEXT_VERSION): specify version 0.15 instead of 0.14.5, + to be consistent with coreutils. + * lib/Makefile.am (noinst_LIBRARIES): + (lib_SOURCES, libdiffutils_a_LIBADD): + (libdiffutils_a_DEPENDENCIES, BUILT_SOURCES, EXTRA_DIST): + (MOSTLYCLEANFILES): Remove; now computed automatically. + (noinst_HEADERS, libdiffutils_a_SOURCES): Just append + our special files now. + * lib/cmpbuf.c: Include config.h unconditionally, since we + no longer define HAVE_CONFIG_H. + * lib/prepargs.c: Likewise. + * src/Makefile.am (LDADD): Use $(LIBINTL), not @LIBINTL@. + (diff_LDADD): Use $(LIB_CLOCK_GETTIME), not @LIB_CLOCK_GETTIME@. + * src/dir.c (dir_read): Use _D_EXACT_NAMLEN, not NAMELEN. + * src/system.h (volatile): Remove, since we assume C89 or better. + Include stat-macros.h. + (S_IRWXU, S_IRWXG, S_IRWXO, S_IRUSR, S_IWUSR): + Remove, since we now use stat-macros.h. + (SEEK_SET, SEEK_CUR): Remove, since we assume C89 or better. + Include unistd.h unconditionally, since we use unistd. + Likewise for fcntl.h. + (dup2): Remove, since we now use dup2. + (O_RDONLY, O_RWDR, O_BINARY): Remove, since we now use + fcntl. + Include dirent.h unconditionally. + (NAMLEN): Remove, replacing with.... + (_D_EXACT_NAMLEN): New macro. + Include inttypes.h unconditionally. + (PTRDIFF_MAX, SIZE_MAX, UINTMAX_MAX, strtoumax): Remove, since + we now use inttypes. + Include locale.h unconditionally. + (setlocale): Remove, since we now assume locale.h. + +2006-09-04 Jim Meyering + + * src/context.c (print_context_function): Do not print + trailing white space in a context header. + +2006-05-09 Paul Eggert + + * src/cmp.c (cmp): The previous fix wasn't quite right either, as + it mishandled 'cmp A B >/dev/null' when A is shorter than B and + differs before A's end-of-file, by outputting a bogus EOF message. + Also, it was inefficient if A and B were large. + +2006-05-07 Jim Meyering (tiny change) + + Fix bug introduced in 2006-03-09 change: + cmp always exits successfully, when stdout is redirected to /dev/null. + * src/cmp.c (cmp): When there's a difference, arrange to return nonzero + also when comparison_type is the new (from 2006-03-09) type_no_stdout. + +2006-05-07 Paul Eggert + + * src/context.c (pr_context_hunk, pr_unidiff_hunk): + Prefer fputs or fputc to fprintf, since it's a tad more efficient + with unlocked-IO on glibc. Long ago we avoided fputs to + work around an ancient SunOS bug, but that's no longer relevant. + * src/diff3.c (output_diff3, dotlines, undotlines): + (output_diff3_edscript, output_diff3_merge): Likewise. + This also avoids a gcc -Wformat-security warning reported + by Jim Meyering. + * src/ed.c (print_ed_hunk, print_forward_ed_hunk, print_rcs_hunk): + Likewise. + * src/normal.c (print_normal_hunk): Likewise. + +2006-05-06 Paul Eggert + + * src/io.c (find_identical_ends): Fix huge performance bug that I + introduced in the 2001-11-25 change: the code to remove the + identical suffix also looked at the trailing sentinel, which meant + the common suffix length was always incorrectly calculated to be + zero. Problem and fix reported by Daniel Hipschman. Instead of + his fix, revert to the pre-2001 code. + + * doc/diff.texi: Switch from GFDL 1.1 to 1.2. + +2006-03-13 Paul Eggert + + * src/system.h (PARAMS, PROTOTYPES): Remove; no longer needed. + (IF_LINT): New macro, to pacify GCC. + * src/analyze.c (diag, compareseq): Use IF_LINT. + * src/cmp.c (cmp): Likewise. + * src/diff3.c (process_diff): Likewise. Also, prefer NULL to 0. + * src/ifdef.c (do_printf_spec, scan_char_literal): Likewise. + * src/sdiff.c (edit): Likewise. + +2006-03-09 Paul Eggert + + * src/cmp.c (type_no_stdout): New constant. + (main): Use it to avoid bug when the "EOF on foo" message is + generated and stdout is /dev/null. + Problem reported by Vincent Lefevre (Debian bug 356083). + +2006-01-04 Paul Eggert + + * README-alpha: Describe CVS access better, using the README-alpha + from GNU tar. + * AUTHORS: Simplify list by removing legalisms. + * THANKS: Add Larry Wall, who contributed to manual. Update email + addresses. + * Makefile.am (SUBDIRS): Remove m4. Put lib first, then other + source files, so documentation can rely on programs being built. + * bootstrap: Import changes from Bison bootstrap. Add gettext, + gettime, sh-quote, stat-time, verify, version-etc-fsf modules. + Remove posixver module. Retrieve doc/fdl.texi from gnulib. + Handle gettext.m4 like glibc21.m4. Don't remove po/en.po. + * configure.ac (AC_PREREQ): Bump to 2.59. + (AC_INIT): Bump version to 2.8.7-cvs. + (AC_CONFIG_AUX_DIR): Change from config to build-aux. + Prefer AC_CHECK_HEADERS_ONCE to AC_CHECK_HEADERS + and AC_CHECK_FUNCS_ONCE to AC_CHECK_FUNCS. + Remove jm_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T, + AC_STRUCT_ST_MTIM_NSEC. + (DIFFUTILS_PREREQUISITES): New macro. Call it. + (REGEX_MALLOC): Remove; no longer needed. + (AM_GNU_GETTEXT_VERSION): Now 0.14.15. + (AM_GNU_GETTEXT): Call. + (LIB_CLOCK_GETTIME): Remove; bootstrap now does that. + (AC_FUNC_SETMODE_DOS): Remove. + (AC_CONFIG_FILES): Remove m4/Makefile. + * doc/diff.texi: Use @- at end of lines that should end in white space, + so that Emacs doesn't remove the white space. + (diff Options): "diff -NUM" is a pure extension to POSIX, so support + it unconditionally. + * lib/Makefile.am (noinst_HEADERS): Remove quotesys.h. + (lib_SOURCES): Remove quotesys.c. + (DISTCLEANFILES): Remove. + (EXTRA_DIST): Remove setmode.h, waitpid.c. + * lib/cmpbuf.c (block_read): Reword to avoid gcc -W warning. + * lib/setmode.c, lib/setmode.h: Remove. + * m4/setmode.m4, m4/gnu-source.m4, m4/Makefile.am.in: Remove. + * m4/jm-glibc-io.m4: Remove. + * src/cmp.c: Don't include . + (specify_ignore_initial): Reword to avoid gcc -W warnings. + (main): Use freopen instead of setmode, since freopen is in POSIX. + * src/context.c: Revert most 2004-09-01 changes. Then: + (TIMESPEC_NS): Remove. All uses replaced by + get_stat_mtime_ns. + Include stat-time.h, strftime.h. + (nstrtime): Remove decl. + * src/diff.c: Revert most 2004-09-01 changes. Then: + Don't include , , . + Include , , . + All uses of quotesys replaced by sh-quote. + (main, compare_files): + Use freopen instead of setmode, since freopen is in POSIX. + (main): Don't complain about "diff -NUM'. + (main, set_mtime_to_now): + Adjust to stat-time.h macros when accessing nanoseconds. + * src/diff3.c: Include sh-quote.h rather than quotesys. All uses + changed. + * src/dir.c (dir_read): excluded_filename renamed to + excluded_file_name. + * src/io.c: Don't include . + (sip, read_files): Remove binary file stuff, leaving a FIXME behind. + A DOS expert needs to look at this. + * src/diff.c: Include sh-quote.h rather than quotesys.h. + All uses changed. + * src/system.h: Include verify.h. + (verify): Remove. All uses changed to verify.h version. + Include . + (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove. Now uses + intprops.h versions. + (O_BINARY): New defns, taken from coreutils. + * src/util.c: Include sh-quote.h rather than quotesys.h. + All uses changed. + +2004-09-01 Paul Eggert + + * src/diff.c (recursive, new_file, unidirectional_new_file): + (report_identical_files): + Move into struct diffopt. All uses changed. + (exclude_options, compare_files, specify_style, check_stdout): + New arg OPT. All uses changed. + (GDIFF_MAIN): Remove. All uses removed. + (function_regexp_list, ignore_regexp_list): No longer static; now + locals in 'main'. + (main): Set opt.function_regexp, opt.ignore_regexp if using regexps; + all other code now tests these pointers rather than inspecting fastmap + internals. + New local OPT to hold former statics; initialize it. + (init_regexp_list): New function, used by main. + (summarize_regexp_list): Now returns struct re_pattern_buffer *, and + assumes reglist->regexps is not NULL. All uses changed. + + * src/context.c (find_function_last_search): Move into struct diffopt. + All uses changed. + (pr_context_label, pr_context_header, + print_context_script, find_function, find_hunk, mark_ignorable, + pr_context_hunk, pr_unidiff_hunk): New arg OPT. All uses changed. + (print_context_number_range, + print_unidiff_number_range): New arg OUT. All uses changed. + +2004-07-19 Stepan Kasal + + * src/ed.c (print_ed_hunk): Optimize the case where an insert's + last line is a single-dot line. + +2004-06-30 Paul Eggert + + * lib/setmode.c: + Don't include , since setmode.h now does this. + Include setmode.h first, to catch interface errors. + Assume HAVE_SETMODE_DOS is defined. + + * lib/setmode.h: Include stdbool.h. + +2004-04-26 Paul Eggert + + * bootstrap: Don't remove po/en.po. + +2004-04-13 Paul Eggert + + * NEWS, configure.ac (AC_INIT): Version 2.8.7. + * configure.ac (AM_GNU_GETTEXT_VERSION): Add. + (XGETTEXT): Restore from pre-2004-04-12 version. This fixes + a bug that lost many msgids in doc/diffutils.pot. + * bootstrap: New file. + * exgettext: Don't generate a temporary file, as this runs afoul + of "make distcheck" which operates with read-only directories. + * Makefile.am (EXTRA_DIST): Add bootstrap. + Remove config/config.rpath as it is deduced automatically these days. + +2004-04-12 Paul Eggert + + * NEWS, configure.ac (AC_INIT): Version 2.8.6. + + * NEWS: Add news for 2.8.4, 2.8.6. + + * README: Move copyright notice to end. Defer to "configure + --help" for special "configure" options. Suggest latest libiconv. + Update version numbers of Autoconf etc. to current. + + * configure.ac: Quote various arguments better. + (AC_CONFIG_MACRO_DIR): Add call, specifying "m4". + (AC_CONFIG_HEADER): Replaces AM_CONFIG_HEADER. + (gl_USE_SYSTEM_EXTENSIONS): Replaces AC_GNU_SOURCE. + (AC_ISC_POSIX): Remove; nobody ports to ancient ISC any more. + (AC_PROG_CPP, AC_PROG_INSTALL, AC_C_INLINE, + AC_HEADER_STDBOOL, AC_HEADER_STDC, AM_GNU_GETTEXT, XGETTEXT, + AC_HEADER_STAT, AC_FUNC_VPRINTF, jm_FUNC_GLIBC_UNLOCKED_IO, + jm_FUNC_GNU_STRFTIME, jm_FUNC_MALLOC, jm_FUNC_REALLOC, + jm_PREREQ_C_STACK, jm_PREREQ_ERROR, jm_PREREQ_HARD_LOCALE, + jm_PREREQ_QUOTEARG, jm_PREREQ_REGEX, AC_FUNC_FNMATCH_GNU, jm_AC_DOS): + Remove; not needed here, as our files don't use them directly + or we rely on gnulib modules. + (AC_C_CONST): Remove; we assume C89 now. + (AC_CHECK_HEADERS): Remove libintl.h, limits.h, stdlib.h, string.h, + time.h. + (AC_CHECK_TYPE): Remove ptrdiff_t, ssize_t. + (AC_CHECK_FUNCS): Remove diraccess, strchr, strerror, tmpnam). + (AC_REPLACE_FUNCS): Remove memchr, mkstemp, strcasecmp. + (GNULIB_AUTOCONF_SNIPPET): Add call. This replaces much of + the above. + (AC_CONFIG_FILES): Remove lib/posix/Makefile. + (AC_CONFIG_COMMANDS): Remove. + + * doc/diff.texi (dircategory): Change to "Text creation and + manipulation" from "GNU packages". + (Translations): New node. + (Overview): Improve quality of algorithm citations. + (Binary): -q doesn't exactly cause diff to assume files are binary. + (Normal): Place after Side by Side, since it's less important. + (Detailed Context, Detailed Unified, Detailed ed, + Detailed if-then-else, diff3 Hunks, Detailed diff3 Normal): + Place at end of menu. + (Detailed Unified): Mention that fractional timestamps are + omitted on hosts that don't support them. + Mention what happens when hunks contain just one line. + (Line Group Formats, Reject Names): Fix duplicate-word typos. + (Comparing Directories): Trailing white space and empty lines are + ignored in the -X file. + (diff Options): Add --strip-trailing-cr. + (Projects): gnu -> gvc@gnu.org. + + * lib/Makefile.am (SUBDIRS): Remove. + (EXTRA_DIST, noinst_HEADERS): Remove most entries. + (libdiffutils_a_SOURCES): Now just lib_SOURCES. + (lib_SOURCES): New macro. + (DISTCLEANFILES, MOSTLYCLEANFILES): Set to empty now. + (gnulib.mk): Include: this does most of the work eliminated + by the above changes. + + * lib/inttostr.c (inttostr): Protect i < 0 by compile-time + test intended to suppress compiler warnings. + * lib/inttostr.h: Include limits.h unilaterally. + (CHAR_BIT): Remove. + (PARAMS): Remove; all uses changed. + * lib/setmode.c (__attribute__): New macro. + (set_binary_mode): Define only if HAVE_SETMODE_DOS. + Otherwise define a dummy static char, as C89 requires + that we define something. + * lib/setmode.h (set_binary_mode): Return true, not 1. + + * src/analyze.c, src/context.c, src/diff.c, src/io.c, src/util.c: + Do not include regex.h, as diff.h does this now. + + * src/cmp.c: Sort includes. Include , . + (specify_comparison_type): Don't report an error if the comparison + type has already been specified the same way as this one. + + * src/cmp.c (usage): Mention exit status. + * src/diff.c (option_help_msgid): Likewise. + * src/diff3.c (usage): Likewise. + * src/sdiff.c (usage): Likewise. + + * src/cmp.c (main): Adjust to latest gnulib c_stack_action + calling conventions. + * src/diff.c (main): Likewise. + * src/diff3.c (main): Likewise. + * src/sdiff.c (main): Likewise. + + * src/cmp.c (main): Adjust to latest version_etc calling conventions. + * src/diff.c (main): Likewise. + * src/diff3.c (main): Likewise. + * src/sdiff.c (main): Likewise. + + * src/diff.c: Include . + (binary): Define to true if not declared. + (longopts): Set tabsize flag to 1. + (main): Don't output nanoseconds if platform lacks them. + Don't treat files as binary if !binary. + (set_mtime_to_now): Use 0, not NULL. + (compare_files): Mark files as nonexistent if it looks like + 'patch' created inaccessible regular empty files to denote + nonexistent backups. Don't compare such files. + Clear st_* members of status of nonexistent file. + Remove now-unnecessary tests. + + * src/diff.h: Include regex.h, unlocked-io.h. + (struct file_data.changed): Now char *, not bool *, to save + space on hosts where bool takes more space than char. + All uses changed. + + * src/diff3.c: Include unlocked-io.h. + (strip_trailing_cr): New var. + (STRIP_TRAILING_CR_OPTION): New enum. + (longopts, main, option_help_msgid, read_diff): + Add --strip-trailing-cr support. + (read_diff): Exit with status 126 (not 127) if errno != ENOENT + after failed execvp in child. Report this in parent. + + * src/dir.c: Include . + (failed_locale_specific_sorting): Renamed from failed_strcoll. + All uses changed. + (compare_names): Don't invoke strcasecmp first thing when + ignore_file_name_case; if locale_specific_sorting, we should + just use that. + + * src/ifdef.c (next_line): Remove; replace with... + (next_line0, next_line1): New vars. + (print_ifdef_script, print_ifdef_hunk): + Use them to fix line-number computation bug. + + * src/io.c (find_and_hash_each_line): Don't convert char * + to unsigned char *; just leave pointers as char *. This + lessens the number of potentially-dangerous casts. + * src/util.c (lines_differ): Likewise. + + * src/sdiff.c: Include , . + (check_child_status): Renamed from ck_editor_status, and + accept a new arg MAX_OK_STATUS. All callers changed. + Handle status 126/127 as per POSIX. + (edit): Likewise. + (main): Likewise. Fix getopt typo: -E wasn't supported. + + * src/system.h (S_IRWXU, S_IRWXG, S_IRWXO): Define if not defined. + (S_IXUSR, S_IXGRP, S_IXOTH): Remove. + Include unconditionally, since we can assume C89 now. + Likewise for , . + (getenv, EXIT_SUCCESS, EXIT_FAILURE, SSIZE_MAX, strchr, strrchr, + memcmp, memcpy): Remove decl; no longer needed. + (strcasecoll, strcasecmp): Define if not built in. + (CTYPE_DOMAIN, ISPRINT, ISSPACE, TOLOWER, _tolower, errno): Remove; + we now assume C89 or better. All uses changed. + Include unconditionally now, since gnulib supports it + if the C compiler doesn't. All boolean uses of 0 and 1 now + changed to false and true. + (lin_is_printable_as_long_int): Renamed from lin_is_printable_as_long. + + * src/util.c (begin_output): Fix bug: 0 wasn't cast to char * arg, + which led to undefined behavior on 64-bit hosts. + Use more-standard test for exit status 126 versus 127. + (finish_output): Likewise. + (analyze_hunk): Do not cast bool to int. + +2004-03-15 Paul Eggert + + * src/cmp.c (main): Don't consider two files with the same name to + be the same, if their initial skip values differ. This fixes a + bug reported by Hideki Iwamoto in + . + +2004-03-11 Paul Eggert + + * src/analyze.c (diag): Return void, not lin, since the return + value wasn't needed. All callers changed. + (diag, diff_2_files): + Use 'true' and 'false' instead of '1' and '0', when appropriate. + (compareseq): Use lin const * local variables instead of lin *. + Don't bother checking diag's return value. + (shift_boundaries, build_reverse_script, build_script, diff_2_files): + Use char arrays, not bool arrays, since + sizeof (bool) might be greater than 1. + +2004-02-09 Paul Eggert + + * m4/setmode.m4 (AC_FUNC_SETMODE_DOS): AC_LIBOBJ(setmode) if + we would return true. + +2002-10-14 Paul Eggert + + * src/Makefile.am (diff3.$(OBJEXT), diff.$(OBJEXT), + sdiff.$(OBJEXT)): Rename from (misspelled) diff3.$(OBJECT), + diff.$(OBJECT), sdiff.$(OBJECT). Patch by Paul D. Smith in + . + Bug reported by Chris Bainbridge. + +2002-10-13 Paul Eggert + + * src/Makefile.am (MOSTLYCLEANFILES): Add paths.ht. + (paths.h): Send output to paths.ht first, and then rename to + paths.h at the end. This avoids problems if the disk is full. + It also works around what appears to be a bug with GNU make -j + (3.79.1); see . + +2002-06-27 Paul Eggert + + * NEWS, configure.ac (AC_INIT): Version 2.8.4. + + * config/config.sub: Sync with latest version maintained in other + packages. + + * lib/file-type.h: Protect against double inclusion. Detect + whether has been included. Fix from Jim Meyering. + + * src/analyze.c (briefly_report): Don't say "Binary files differ", + since one of the files may not be a binary file. + Bug reported by Dan Jacobson. + +2002-06-22 Paul Eggert + + * lib/c-stack.c (segv_handler, c_stack_action) [! defined + SA_SIGINFO]: Do not assume SA_SIGINFO behavior. + Bug reported by Jim Meyering on NetBSD 1.5.2. + +2002-06-16 Paul Eggert + + * NEWS, configure.ac (AC_INIT): Version 2.8.3. + + * config/depcomp, config/missing, README: Update to automake 1.6.2. + + * po/LINGUAS: Add en_US. + * po/en_US.po: New file. + * po/POTFILES.in: Remove lib/freesoft.c. + Add lib/file-type.c, lib/version-etc.c, lib/xmalloc.c. + +2002-06-15 Paul Eggert + + * doc/diff.texi (Special Files): Document behavior of symlink + loops. + + * lib/Makefile.am (noinst_HEADERS): Remove freesoft.h. + Add version-etc.h. + (libdiffutils_a_SOURCES): Remove freesoft.c. Add version-etc.c. + * lib/freesoft.c, lib/freesoft.h: Remove. + * lib/version-etc.h (PARAMS): Remove; we now assume C89 at least. + + * lib/version-etc.h (version_etc): Remove package and version args. + (version_etc_copyright): Remove. + * lib/version-etc.c: Likewise. + Do not include unlocked-io.h; no longer needed. + Include gettext.h rather than libinto.h. + (_): Define unconditionally. + (version_etc): Adjust wording to match current GNU coding standards. + Translate "(C)" if possible. + + * lib/version-etc.c, lib/version-etc.h: New files, taken from + fileutils. + + * src/Makefile.am (cmp_SOURCES, diff3_SOURCES, sdiff_SOURCES, + diff_SOURCES): Remove version.c. + (MAINTAINERCLEANFILES, $(srcdir)/version.c): Remove. + + * src/cmp.c: Include version-etc.h, not freesoft.h. + (copyright_notice): Remove. + (main): Use version_etc to print version. + * src/diff.c, src/diff3.c, src/sdiff.c: Likewise. + + * src/cmp.c (version_string): Remove decl. + * src/diff.h, src/diff3.c, src/sdiff.c: Likewise. + +2002-06-11 Paul Eggert + + * lib/fnmatch.c, lib/fnmatch_loop.c (WIDE_CHAR_SUPPORT): + New macro. Use it uniformly instead of + (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H). + It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1 + reported by Vin Shelton. + * m4/fnmatch.m4 (_AC_LIBOBJ_FNMATCH): Check for btowc. + + * NEWS, configure.ac (AC_INIT): Version 2.8.2. + + * ABOUT-NLS, config/config.guess, config/config.sub, + config/depcomp, config/texinfo.tex, lib/posix/regex.h, + m4/c-bs-a.m4, m4/gettext.m4, m4/gnu-source.m4, m4/lib-link.m4, + m4/malloc.m4: + Update to recent version (maintained in other packages). + * m4/prereq.m4 (jm_PREREQ_EXCLUSIVE): AC_FUNC_FNMATCH_GNU + no longer takes a lib. + + * README: Incorporate contents from INSTALLME. + * INSTALLME: Remove. + * Makefile.am (EXTRA_DIST): Remove INSTALLME. + + * configure.ac (AC_GNU_SOURCE): Move up, so that it affects + later compilations properly. + (DEFAULT_DIFF_PROGRAM, AC_TYPE_SIGNAL): Remove. + (jm_AC_TYPE_INTMAX_T): Add. + (AC_FUNC_FNMATCH_GNU): Use this, instead of AC_FUNC_FNMATCH. + (AC_CONFIG_LINKS): regex.hin renamed from regex_.h. + + * doc/diff.texi: Reword "@option{-f} and @option{--foo}" to + "@option{-f} or @option{--foo}". + Use @acronym instead of @sc where appropriate. + (Specified Lines): Renamed from Specified Folding. + (Comparison, Blank Lines): + Clarify wordings for Blank Lines and Specified Lines nodes. + (Binary): Mention --verbose and --print-bytes. + (Tabs, sdiff Option Summary, diff Options): + New option --tabsize=COLUMNS. + + * lib/Makefile.am (EXTRA_DIST): Add fnmatch_loop.c. + (noinst_HEADERS): fnmatch_.h renamed from fnmatch.hin. + regex_.h renamed from regex.hin. + Add file-type.h. + (libdiffutils_a_SOURCES): Add file-type.c. + (DISTCLEANFILES): Remove fnmatch.hno, regex.hno. + + * lib/c-stack.c (__attribute__): New macro. + (EOVERFLOW): Define if not defined. + (stack_t): Define to struct sigaltstack if not defined or declared. + Include , if available. + Include if DEBUG. + Do not include or . + (c_stack_die): Remove info and context args. All uses changed. + (segv_action): Likewise. + (alternate_signal_stack): Change uintmax_t to long, to ease porting. + (get_stack_location, min_address_from_argv, max_address_from_argv, + null_action): New functions. + (stack_base, stack_size): New vars. + (segv_handler): context arg may not be used. + Use global stack_base, stack_size if + ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC. + Add debug code. + Invoke die (rather than segv_action) to exit. + (c_stack_action): Accept new argv arg, and simpler handler arg. + All uses changed. Move code into new functions above. + Allow null action. + [! (defined SA_ONSTACK && defined _SC_PAGESIZE)]: Assume all segvs + are stack overflows. + (main) [DEBUG]: Describe what output should be like. + + * lib/c-stack.h (siginfo_t, c_stack_die): Remove decl. + + * lib/file-type.c, lib/file-type.h: New files. These contain code + that was in src/diff.c, but is now librarified and spiffed up a + bit. Jim Meyering suggested this. + + * lib/fnmatch.c (alloca, __builtin_expect): Define for non-GCC hosts. + : Include only if HAVE_STRINGS_H. + : Include if we include stdlib.h. + Do not comment out all code if ! HAVE_FNMATCH_GNU. + (getenv): Do not declare if HAVE_DECL_GETENV. + (__strchrnul, __wcschrnul): Remove; not used. + (MEMPCPY): Use mempcpy if not _LIBC; use memcpy if neither _LIBC + nor HAVE_MEMPCPY. + (FOLD) [HANDLE_MULTIBYTE]: Do not pass wide char to ISUPPER. + (STRLEN, STRCAT, MEMPCPY) [HANDLE_MULTIBYTE && !defined _LIBC]: + Use wcslen rather than __wcslen, and likewise for wcscat, wmempcpy. + (MEMPCPY) [HANDLE_MULTIBYTE]: Use wmempcpy if not _LIBC; use wmemcpy + if neither _LIBC nor HAVE_WMEMPCPY. + * lib/fnmatch_.h (__const): Do not define to empty, as this breaks + Sun cc. The code doesn't work with K&R anyway. + * lib/fnmatch_loop.c (struct patternlist.str): Size 1, not 0, + as C89 requires this. + (NEW_PATTERN): Use offsetof, not sizeof, since str now has size 1. + * lib/fnmatch_.h: Import from glibc fnmatch.h. + * lib/fnmatch.c, lib/fnmatch_loop.c: Import from glibc. + + * lib/posixver.c: Include posixver.h. + + * lib/regex_.h: Renamed from lib/regex.hin. + + * m4/c-stack.m4 (jm_PREREQ_C_STACK): Do not AC_REQUIRE + jm_AC_TYPE_UINTMAX_T and do not use uintmax_t. + Check for sys/resource.h, uccontext.h. + Check for decls and existence of getcontext, sigaltstack. + Check for stack_t. + + * m4/codeset.m4, m4/glibc21.m4, m4/lcmessage.m4: Remove. + + * m4/fnmatch.m4: Update to latest Autoconf CVS for AC_FUNC_FNMATCH_GNU. + * m4/gnu-source.m4: Likewise, for AC_GNU_SOURCE (renamed from + AC__GNU_SOURCE). + + * m4/mbstate_t.m4 (AC_TYPE_MBSTATE_T): Renamed from AC_MBSTATE_T. + All uses changed. Upgrade to recent Autoconf CVS. + + * m4/stdbool.m4 (AC_HEADER_STDBOOL): Do not cast pointer to + bool in integer constant expression; C99 does not allow it. + Reported by Bruno Haible. + + * po/LINGUAS: Add hu, pt_BR. + * po/hu.po, po/pt_BR.po: New files. + + * src/Makefile.am (noinst_HEADERS): Remove diff.h. + (DEFS): Remove. + (diff_sources): Add diff.h. + (MOSTLYCLEANFILES): New macro. + (cmp.$(OBJEXT) diff3.$(OBJECT) diff.$(OBJECT) sdiff.$(OBJECT)): Depend + on paths.h. + (paths.h): New rule. + + * src/analyze.c, src/cmp.c, src/diff.c, src/diff3.c, src/io.c, + src/sdiff.c: Include . + + * src/cmp.c: Include paths.h. + (copyright_notice): Renamed from copyright_string. + Now a msgid, so that copyright symbol can be translated. + All uses changed. + * src/diff.c, src/diff3.c, src/sdiff.c: Likewise. + + * src/diff.c: Include posixver.h. + (TABSIZE_OPTION): New constant. + (main): Allow widths up to SIZE_MAX. + (filetype): Move to lib/file-type.c and rename to file_type. + All uses changed. + + * src/diff.c (longopts, main, usage): New option --tabsize=COLUMNS. + * src/io.c (find_and_hash_each_line): Likewise. + + * src/diff.h (TAB_WIDTH): Remove. + (tabsize): New decl. + (sdiff_half_width, sdiff_column2_offset): Now size_t rather than + unsigned int. + + * src/diff3.c (skipwhite, readnum): New functions. + (process_diff_control): Use them. + (SKIPWHITE, READNUM): Remove. + (read_diff): Don't worry about errno == ENOEXEC. + + * src/sdiff.c (catchsig, signal_handler, initial_action): Signal + handlers return void, not RETSIGTYPE, since we no longer support + K&R. + (TABSIZE_OPTION): New constant. + (longopts, usage, main): New option --tabsize=COLUMNS. + (cleanup): New arg signo. All uses changed. + (ck_editor_status, main, edit): Don't worry about ENOEXEC. + + * src/side.c (tab_from_to, print_half_line, print_1sdiff_line): + New option --tabsize=COLUMNS. + + * src/system.h (S_ISBLK, S_ISCHR, S_ISDIR, S_ISFIFO, S_ISREG, + S_ISSOCK): Remove; now in lib/file-type.h. + + * src/util.c (finish_output): Check for ENOEXEC. + (lines_differ, output_1_line): New option --tabsize=COLUMNS. + (analyze_hunk): If -b or -w is also specified, -B now considers + lines to be empty if they contain only white space. + +2002-04-05 Paul Eggert + + * NEWS, configure.ac (AC_INIT): Version 2.8.1. + + * configure.ac (AC_HEADER_STDBOOL): Add. + (AC_CHECK_HEADERS): Remove stdbool.h. + * m4/stdbool.m4: New file. + * m4/prereq.m4 (jm_PREREQ_EXCLUDE): + Use AC_HEADER_STDBOOL rather than AC_CHECK_HEADERS(stdbool.h). + (jm_PREREQ_HASH): Likewise. + + * src/system.h (SSIZE_MAX): Define if limits.h doesn't. + + * src/analyze.c (diff_2_files): Assign PTRDIFF_MAX - 1 to a + size_t variable, just in case there's a problem with ptrdiff_t + versus size_t. + + * lib/cmpbuf.c (errno): Remove decl; K&R C is no longer supported. + Include limits.h. + (SIZE_MAX, SSIZE_MAX): Define if standard headers don't. + (MIN): New macro. + (block_read): Do not attempt to read more than SSIZE_MAX bytes, as the + resulting behavior is implementation-defined. Work around bug in + Tru64 5.1, which can't read more than INT_MAX bytes at a time. + * src/cmp.c (cmp): Use block_read instead of read, to work + around Tru64 5.1 bug. + * src/diff3.c (read_diff): Likewise. + * src/diff3.c: Include cmpbuf.h. + + * THANKS: Add Ulrich Drepper. + + * INSTALLME: Mention GNU texinfo. + + * doc/diff.texi: + Use new @copying directive. + Put @contents first, not last, since Texinfo now suggests this. + Fix bug in -w documentation noted by Karl Berry. + Mention links for speedup. + New node "Speedups" for future speedups. + Just say "Index", not "Concept Index". + +2002-03-26 Paul Eggert + + * src/Makefile.am: + (INCLUDES): Remove this obsolete macro, replacing it with: + (AM_CPPFLAGS): New macro. + +2002-03-26 Albert Chin-A-Young + + * src/Makefile.am (datadir): Remove, as it conflicts with --datadir. + +2002-03-26 Paul Eggert + + * doc/diff.texi (dircategory GNU packages): Fix typo: a "* " was + missing before the menu entry. Bug diagnosed by Adam Heath. + Also, put this dircategory after the Individual utilities dircategory, + to work around a compatibility problem with Debian install-info. + +2002-03-24 Eli Zaretskii + + * src/io.c (sip): Do not mishandle buffered count when reverting + to text mode. + +2002-03-23 Paul Eggert + + * NEWS, configure.ac (AC_INIT): Version 2.8. + * configure.ac (AC_PREREQ): 2.53. + * INSTALLME: Upgrade to gettext 0.11.1 and help2man 1.27. + + * doc/diff.texi: Upgrade the description of `patch' to GNU patch + 2.5.4, and revamp the documentation accordingly. + + * src/diff.c (main): Fix typo that prevented diff -y from working. + Bug reported by Mitsuru Chinen. + +2002-03-15 Paul Eggert + + * lib/c-stack.c (c_stack_die) [!HAVE_SIGINFO_T]: Don't use info. + Bug reported by Eli Zaretskii. + +2002-03-15 Eli Zaretskii + + * ms/config.sed: Tweak editing of install-info-am target. + +2002-03-12 Paul Eggert + + * NEWS, configure.ac (AC_INIT): Version 2.7.10. + + * NEWS: cmp -l -s and cmp -s -l are not allowed. + Deprecate diff -h, -H, -L, -P, --inhibit-hunk-merge. + + * configure.ac (jm_PREREQ_HARD_LOCALE): Add. + (AM_INIT_AUTOMAKE): Do not distribute shar file. + + * doc/diff.texi (Overview): byte != character. + (Detailed Context, Detailed Unified, Alternate Names, diff Options): + Do not document diff -L. + (Comparing Directories, Making Patches, diff Options): + Do not document diff -P. + (diff Performance, sdiff Option Summary, diff Options, sdiff Options): + Do not document diff -H. + (diff Performance, diff Options): Do not document --horizon-lines. + (cmp Options): Prefer -b to -c. + (cmp Options, diff Options, diff3 Options, patch Options, + sdiff Options): Put short options next to the similar long options. + Document --help, and use the same wording for --verbose. + (diff3 Options): Fix typo in description of -E, which used wrongly used + "-e" instead of "-E". + + * lib/hard-locale.c (alloca): Remove. + Include stdlib.h if available, for malloc. + (hard_locale): Use malloc, not alloca, so that we need not worry about + alloca issues. Test for storage allocation failure. + + * m4/prereq.m4 (jm_PREREQ): Add jm_PREREQ_HARD_LOCALE. + (jm_PREREQ_HARD_LOCALE): New macro. + + * src/cmp.c (specify_comparison_type): New function. + (check_stdout): "indices and codes" -> "byte numbers and values" + (main): Detect clashing options. + (cmp): Use "byte" rather than "char" if a translation for "byte" + is available, even when in the POSIX locale. + + * src/diff.c (option_help_msgid): Do not document -L, -P, + --horizon-lines, --inhibit-hunk-merge, -H. + * src/diff.h: -L -> --label + +2002-03-11 Paul Eggert + + * NEWS, configure.ac (AC_INIT): Version 2.7.9. + + * INSTALLME: Update to autoconf 2.53, automake 1.6, help2man + 1.25 with patch. + + * configure.ac (AC_INIT): + Change package name from diff to diffutils. + (AM_INIT_AUTOMAKE): Use new form, with option gnits, + rather than old from that duplicated AC_INIT. + (AM_MISSING_PROG): Add help2man. + (REGEX_MALLOC): Define. + (AC_CONFIG_FILES): Add man/Makefile. + + * Makefile.am (AUTOMAKE_OPTIONS): Remove. + * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove. + * lib/Makefile.am (AUTOMAKE_OPTIONS): Likewise. + * ms/Makefile.am (AUTOMAKE_OPTIONS): Likewise. + * src/Makefile.am (AUTOMAKE_OPTIONS): Likewise. + + * lib/c-stack.c: Include + (ENOTSUP): Define if errno.h doesn't. + (SA_NODEFER, SA_ONSTACK, SA_RESETHAND, SA_SIGINFO, SIGSTKSZ, + _SC_PAGESIZE, ALTERNATE_STACK_SIZE, stack_t, sigaltstack): + Remove; we now assume them all when + HAVE_XSI_STACK_OVERFLOW_HEURISTIC, so we don't need + substitutes. + (): Include only if HAVE_XSI_STACK_OVERFLOW_HEURISTIC. + (alternate_signal_stack): Now of size SIGSTKSZ. + (segv_handler): Simplify, under the assumption that + HAVE_XSI_STACK_OVERFLOW_HEURISTIC is nonzero. + (c_stack_action): Likewise. + (exit_failure) [DEBUG]: Initialize to 0, not 1. + (recurse, main) [DEBUG]: Remove main args. + + * m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Change + wording of message. Do not check for stdbool.h or ucontext.h, + or for ucontext_t or sigaction or sigaltstack. + + * po/LINGUAS: Add zh_TW. + + * Makefile.am (SUBDIRS): Add man. + * man/Makefile.am: New file. + * src/cmp.c (usage): Reword for help2man. + * src/diff.c (option_help_msgid): Likewise. + * src/diff3.c (option_help_msgid, usage): Likewise. + * src/sdiff3.c (option_help_msgid, usage): Likewise. + Reword for help2man. + + * THANKS: Add email address for Tower. + + * config/config.guess, config/config.sub, config/depcomp, + config/install-sh, config/mdate-sh, config/missing, + config/mkinstalldirs, config/texinfo.tex: Update + to recent version (maintained in other packages). + +2002-03-04 Bruno Haible + + * m4/gettext.m4 (AM_GNU_GETTEXT): Set LIBINTL and LTLIBINTL to empty if + no preinstalled GNU gettext was found. + +2002-03-02 Eli Zaretskii + + * ms/config.sed: Tweak editing of install-info-am and + uninstall-info-am targets, to include 8+3-butchered names of Info + files. + +2002-02-28 Paul Eggert + + * NEWS, configure.ac (AC_INIT, AM_INIT_AUTOMAKE): Version 2.7.8. + + * doc/diff.texi: Add vr index. + Update copyright to 2002. + (Standards conformance): New chapter. + (Binary): Differing binary files are trouble unless the user asked for + brief output. + (Detailed Context): Prefer ISO timestamp format in discussion. + (Detailed Unified, Pagination): Likewise. + (Less Context): Likewise. Also use short option. + (Alternate Names): Separate option from arg. + (Making Patches): Mention -U 2. + (diff Options): Deprecate -LINES, as POSIX 1003.1-2001 does not + allow it. + + * INSTALLME: Update advice for Solaris installation problems. + We no longer use a test version of gettext. + Autoconf test version updated from 2.52f to 2.52h. + POSIX 1003.1-2001 patch for Automake. + + * configure.ac (AC__GNU_SOURCE): Add this, + replacing AH_VERBATIM of _GNU_SOURCE. + (tempname): Use AC_LIBOBJS, not LIBOBJS=, as now required by autoconf. + (jm_PREREQ_C_STACK): Add. + (AC_CONFIG_FILES): Remove intl/Makefile. + (AM_GNU_GETTEXT): Add external arg, from gettext 0.11. + + * lib/c-stack.c, lib/c-stack.h, lib/exitfail.c, lib/exitfail.h, + lib/posixver.c, lib/posixver.h, m4/c-stack.m4, m4/gnu-source.m4, + po/cs.po, po/ja.po: New files. + + * intl/ChangeLog, intl/Makefile.in, intl/VERSION, + intl/bindtextdom.c, intl/config.charset, intl/dcgettext.c, + intl/dcigettext.c, intl/dcngettext.c, intl/dgettext.c, + intl/dngettext.c, intl/explodename.c, intl/finddomain.c, + intl/gettext.c, intl/gettextP.h, intl/gmo.h, intl/hash-string.h, + intl/intl-compat.c, intl/l10nflist.c, intl/libgnuintl.h, + intl/loadinfo.h, intl/loadmsgcat.c, intl/localcharset.c, + intl/locale.alias, intl/localealias.c, intl/localename.c, + intl/ngettext.c, intl/os2compat.c, intl/os2compat.h, intl/osdep.c, + intl/plural-eval.c, intl/plural-exp.c, intl/plural-exp.h, + intl/plural.c, intl/plural.y, intl/ref-add.sin, intl/ref-del.sin, + intl/textdomain.c, m4/isc-posix.m4, m4/libtool.m4: Remove. + + * ABOUT-NLS: Update to Gettext 0.11. + + * Makefile.am (SUBDIRS): Remove intl. + + * config/config.guess, config/config.rpath, config/config.sub, + config/texinfo.tex, config/depcomp, config/texinfo.tex, + lib/tempname.c: Update to latest version from other packages. + + * lib/xalloc.h (xalloc_exit_failure): Remove; subsumed by exit_failure. + * lib/xmalloc.c: Include exitfail.h. + (xalloc_exit_failure): Remove; subsumed by exit_failure. + All uses changed. + + * lib/Makefile.am (noinst_HEADERS): Add c-stack.h, exitfail.h. + (libdiffutils_a_SOURCES): Add c-stack.c, exitfail.c, quotesys.c. + (INCLUDES): Remove. + + * lib/cmpbuf.h (buffer_lcm): New arg LCM_MAX. + * lib/cmpbuf.c: Include errno.h. + (errno): Declare if !STDC_HEADERS. + Include signal.h. + (SA_RESTART): Define if not already defined. + Include . + (PTRDIFF_MAX): Define if not already defined. + (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Likewise. + (block_read): Accommodate ancient AIX hosts that set errno to EINTR + after uncaught SIGCONT. + (buffer_lcm): Return a reasonable size if the multiple is too large. + New arg LCM_MAX. All callers changed. + + * lib/hard-locale.c: Include "hard-locale.h". + (hard_locale): Ignore ENABLE_NLS, since we want to operate on + locales other than LC_MESSAGES. + + * m4/prereq.m4 (jm_PREREQ): Add jm_PREREQ_POSIXVER. + (jm_PREREQ_POSIXVER): New macro. + + * m4/setmode.m4 (AC_FUNC_SETMODE_DOS): + Check for fcntl.h and unistd.h unconditionally. + Suggested by Bruno Haible. + + * po/LINGUAS: Add cs, ja. + * po/POTFILES.in: Add lib/c-stack.c, src/dir.c. + + * src/Makefile.am (datadir): @DATADIRNAME@ -> share. + (INCLUDES): Remove intl. + (LDADD): Change INTLLIBS to LIBINTL. + No longer need to link libdiffutils.a twice. + + * src/analyze.c (diff_2_files): + Avoid arithmetic overflow in buffer size calculation. + + * src/cmp.c: Include c-stack.h, exitfail.h. + (hard_locale_LC_MESSAGES): Depend on ENABLE_NLS. + (try_help, check_stdout, main, cmp): 2 -> EXIT_TROUBLE. + (main): Check for stack overflow. + 0 -> EXIT_SUCCESS. + 1 -> EXIT_FAILURE. + (cmp): Likewise. + Accommodate ancient AIX hosts that set errno to + EINTR after uncaught SIGCONT. + + * src/context.c (pr_context_hunk): + Do not dump core if an enormous context causes an + arithmetic overflow. + (pr_unidiff_hunk): Likewise. + (find_hunk): Likewise. + + * src/diff.h: unsigned -> unsigned int. + * src/diff.c: Include c-stack.h, exitfail.h. + Do not include signal.h. + (specify_style, specify_value): Bring these routines back, as POSIX + requires that the order of options not matter. + (shortopts): New constant. + (group_format_option, line_format_option): New constants. + (main): 0 -> EXIT_SUCCESS, 1 -> EXIT_FAILURE, 2 -> EXIT_TROUBLE. + Ensure that order of options does not matter. + Check for stack overflow. + If contexts overflow, substitute LIN_MAX, as that's good enough. + If multiple contexts are specified, use their maximum. + -c is equivalent to -C 3 now, instead of having an implicit context; + likewise for -u and -U 3. + Use specify_style and specify_value. + (SIGCHLD): Do not define; now done in a header. + Use new style timestamp format for -u / -U. + Reject numeric-string options if operating in POSIX 1003.1-2001 mode. + Avoid overflow problems with tab width. + Simplify from-file and to-file code. + (usage): Do not mention obsolete options. + (filetype): Do not mention whether a file is executable. + Add typed memory objects. + (compare_files): 0 -> EXIT_SUCCESS, 1 -> EXIT_FAILURE, 2 -> + EXIT_TROUBLE. + + * src/diff3.c: Include c-stack.h, exitfail.h. + (ALLOCATE): Remove. All uses changed to xmalloc, or to xmalloc plus + an overflow check. + (myread): Remove. + (main): Check for stack overflow. + 0 -> EXIT_SUCCESS, 1 -> EXIT_FAIULRE, 2 -> EXIT_TROUBLE. + (try_help): Likewise. + (process_diff): Check for integer overflow, to avoid core dumps. + 2 -> EXIT_TROUBLE. + (read_diff): Exit with status 126 if the file is not executable, + for compatibility with POSIX 1003.1-2001. + Accommodate ancient AIX hosts that set errno to EINTR after uncaught + SIGCONT. + Check for integer overflow to avoid core dumps. + (fatal, perror_with_exit): 2 -> EXIT_TROUBLE. + + * src/dir.c (dir_read): + Ignore st_size of directories: POSIX says it's garbage. + Check for integer overflow to avoid core dumps. + (diff_dirs): 0 -> EXIT_SUCCESS, 2 -> EXIT_TROUBLE. + + * src/ifdef.c: Include . + (format_group, print_ifdef_lines): Avoid core dumps with bad formats. + (do_printf_spec): Avoid alloca. + + * src/io.c (sip): + Avoid integer overflow and core dumps if buffer alignments are + preposterously incompatible. + (slurp): Do not dump core if the file is growing as we read it. + If a regular file grows, keep reading until we catch up with its EOF. + (find_and_hash_each_line): Check for integer overflow to avoid cores. + (GUESS_LINES): Remove. + (guess_lines): New function. Avoid integer overflow. + (find_identical_ends): Use it. + Avoid integer overflow and possible core dumps. + + * src/sdiff.c: Include c-stack.h, exitfail.h. Do not include signal.h. + 0 -> EXIT_SUCCESS, 1 -> EXIT_FAILURE, 2 -> EXIT_TROUBLE. + (ck_editor_status): New function. + (main): Check for stack overflow. + Adopt POSIX convention for subsidiary programs not found. + (diffarg): Check for integer overflow to avoid core dumps. + (trapsigs): Remove SA_INTERRUPT special case; now done by header. + (SIGCHLD): Likewise. + (edit): Adopt POSIX convention for subsidiary programs not found. + + * src/side.c: unsigned -> unsigned int. + + * src/system.h: Don't use alloca or include . + unsigned -> unsigned int + (EXIT_SUCCESS, EXIT_FAILURE, EXIT_TROUBLE): Define if not defined. + Include signal.h. + (SA_RESTART): Define if not defined. + (SIGCHLD): Likewise. + + * src/util.c: 2 -> EXIT_TROUBLE. + Adopt POSIX convention for ENOEXEC and exit status 126. + unsigned -> unsigned int + +2002-01-24 Paul Eggert + + * NEWS, configure.ac (AC_INIT, AM_INIT_AUTOMAKE): Version 2.7.7. + + * intl/plural.c: Regenerate with Bison 1.31. + + * ABOUT-NLS, intl/*: Update to Gettext 0.11-pre5++. + * INSTALL: Update to Autoconf 2.52f. + + * INSTALLME: New file. + * Makefile.am (EXTRA_DIST): Add config/config.rpath, INSTALLME. + (DISTCLEANFILES): Remove. + * NEWS: Reformat for imminent 2.8 release. + * README: Mention INSTALLME. + * README-alpha: Move most of contents to INSTALLME. + * THANKS: Add Bruno Haible, Jim Meyering, and Eli Zaretskii. + + * config: New subdirectory, containing the following files from .: + config.guess, config.sub, depcomp, missing, install-sh, mkinstalldirs. + Move the following files here from doc: texinfo.tex, mdate-sh. + * config/config.guess, config/config.sub, config/texinfo.tex: + Update to latest version from FSF. + * config/config.rpath: New file, from Gettext 0.11-pre5++. + + * configure.ac (AC_INIT): Use new 3-arg form. + (AC_CONFIG_SRCDIR): Specify src/diff.c here, not in AC_INIT. + (ALL_LINGUAS): Remove: now in po/LINGUAS as per Gettext 0.11. + (AC_CONFIG_AUX_DIR): New macro invocation. + + * lib/Makefile.am (noinst_HEADERS): Add gettext.h. + * lib/gettext.h: New file, from Gettext 0.11-pre5++. + * lib/prepargs.c: Include . Reported by Bruno Haible. + + * m4/codeset.m4, m4/gettext.m4, glibc21.m4, iconv.m4, isc-posix.m4, + lcmessage.m4, progtest.m4: Upgrade to Gettext 0.11-pre5++. + * m4/lib-ld.m4, m4/lib-link.m4, m4/lib-prefix.m4: New files, from + Gettext 0.11-pre5++. + + * po/LINGUAS: New file. + * po/Makefile.in.in: Upgrade to Gettext 0.11-pre5++. + * po/Makevars, po/Rules-quot, po/boldquot.sed: New files, + from Gettext 0.11-pre5++. + + * src/cmp.c (copyright_string): Update to 2002. + * src/diff.c (copyright_string): Likewise. + * src/diff3.c (copyright_string): Likewise. + * src/sdiff.c (copyright_string): Likewise. + + * src/cmp.c (specify_ignore_initial): Renamed from + parse_ignore_initial, with different signature, to take the + maximum of multiple options rather than the last one. + All uses changed. + + * src/cmp.c (bytes, specify_ignore_initial, cmp): Use UINTMAX_MAX + instead of (uintmax_t) -1, to avoid warnings on some compilers. + * src/io.c (file_block_read): Likewise, for SIZE_MAX. + + * src/cmp.c (usage): Reformat messages to ease translation. + * src/diff3.c (usage): Likewise. + * src/sdiff.c (usage): Likewise. + + * src/cmp.c (main): Two files with the same name are identical + only if the same offset is specified. + (block_compare_and_count): Avoid cast to unsigned char. + + * src/diff3.c (main): Remove unused variable. + + * src/dir.c: Include + (struct dirdata): New member nnames. + (locale_specific_sorting, failed_strcoll): New vars. + (dir_read): Renamed from dir_sort. Don't sort the dir. + Set new nnames member of struct dirdata. All callers changed. + (compare_names): Don't check for errno after strcasecmp. + Use strcoll only if locale_specific_sorting is nonzero. + If strcoll fails, longjmp out rather than returning a value + that might result in an invalid comparison function that might + make qsort dump core. + (diff_dirs): Sort the directory ourselves. Use setjmp to recover + from strcoll failure, falling back on native byte comparison. + Make local variables volatile if they need to preserve their value + after setjmp/longjmp. + + * src/sdiff.c (handler_index_of_SIGINT, handler_index_of_SIGPIPE): + New macros. + (main): Do not confuse signal numbers with their indices. + Bug reported by Bruno Haible. + (edit): Cat lin to long before printing with %ld, since lin might + be narrow than long. + + * src/system.h (UINTMAX_MAX): New macro. + Include gettext.h, not libgettext.h. + (N_): Do not wrap arg in parentheses. Fix from Bruno Haible. + + * src/util.c (finish_output): Ensure that werrno is initialized. + (lines_differ): Have an explicit do-nothing case for + IGNORE_NO_WHITE_SPACE, to pacify gcc -Wall. + +2001-12-29 Eli Zaretskii + + * src/sdiff.c (interact): After extracting rlen from the editor + command, test for a terminating null character, not for a newline. + + * ms/config.bat: Allow longer source directory names without + overflowing the line length limits. Create the cache in the + build directory, not in the source directory + * ms/config.sed: Fix AC_CONFIG_LINKS for when symlinks are + unavailable. + +2001-12-23 Paul Eggert + + * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.6. + + * configure.ac (ALL_LINGUAS): Add tr. + + * src/util.c (begin_output): + Have child exit with status 127 rather than reporting + failure on its own. Set errno to 0 before invoking popen. + (finish_output): Report errno on pclose failure. + Distinguish between subsidiary program not found, and failure. + + * src/sdiff.c (not_found, execdiff): Remove. + (DIFF_PROGRAM_OPTION): New constant. + (longopts, option_help_msgid, main): Add --diff-program=PROGRAM. + (check_stdout): New function. + (main): Remove DIFF_PROGRAM. Check stdout after printing version. + Use check_stdout after printing help. Use execvp/perror_fatail rather + than execdiff. Set errno to 0 before invoking popen. + Check for pclose failure properly. + (main, edit): If child exec fails, exit with 127 rather than trying to + print diagnostic. + Distinguish between subsidiary program failing and not being found. + (edit): Handle signals the same way, regardless of whether we're using + system or fork+exec. Check for system returning -1. + + * src/diff3.c (DIFF_PROGRAM_OPTION, HELP_OPTION): New constants. + (longopts, main): Use them. + (longopts, main, option_help_msgid): New option --diff-option=PROGRAM. + (main): Remove DIFF_PROGRAM support. + Check stdout after printing version. + (check_stdout): Report errno info if fclose fails. + (read_diff): Have child exit with status 127 when program is not found, + rather than trying to have the child report failure. Check for + pclose returning -1. + + * src/diff.c (DEFAULT_WIDTH): Remove. + (main): Use 130 instead of DEFAULT_WIDTH, since it's not really + builder-settable. Do not prepend DIFF_OPTIONS. + (check-stdout): If fclose (stdout) fails, print errno info. + (option_help_msgid): Default context is 3, not 2. + (usage): Work even if ptrdiff_t is wider than int. + + * doc/diff.texi (diff Options): Remove DIFF_OPTIONS. + (Invoking diff3, Invoking sdiff): Remove DIFF_PROGRAM. + (diff3 Options, sdiff Options): Add --diff-program. + + * src/cmp.c (valid_suffixes): + Add '0', to support suffixes like "MB" and "MiB". + (check_stdout): Don't assume that the translations of "write failed" + and of "standard output" lack '%'. + (main): Check stdout after printing version. + + * lib/setmode.c: [HAVE_FCNTL_H && HAVE_SETMODE_DOS]: Include . + [!HAVE_SETMODE_DOS]: Do not include . + (set_binary_mode): Return mode (not 1) if fd is a tty. + Do not assume that O_TEXT is zero. + + * doc/diff.texi (cmp Options): + In byte counts, a plain suffix (without any integer) + is assumed to modify the integer 1. Index terms like "kibibyte". + Document plain "k". + + (Reporting Bugs): Mention bug-report archive and test version + location. Ask for "diff --version" in bug reports. + +2001-12-13 Paul Eggert + + * src/diff.c (DEFAULT_WIDTH): Remove; couldn't be changed without + also changing option_help_msgid. All uses replaced with 130. + + * lib/setmode.c: Include fcntl.h and unistd.h only if + HAVE_SETMODE_DOS. + (setmode): Assume a file is binary unless the mode is O_TEXT. + * ms/README: Fix minor typos. + +2001-12-13 Eli Zaretskii + + * ms/README: New file. + + * lib/setmode.c (set_binary_mode) [HAVE_SETMODE_DOS]: Don't assume + O_TEXT has a zero value. If FD is a terminal device, do nothing + and return MODE, thus pretending that it was already in the + requested MODE. + [HAVE_FCNTL_H]: Include fcntl.h (needed for O_BINARY). + + * ms/config.sed: Remove the split prevention of config.status. + Fix Sed commands for converting absolute file names into + top_srcdir-relative ones. + + * ms/config.bat: Fix typos. + +2001-12-12 Neal H Walfield + + * diff.c (option_help_msgid): Correct the default context width + from 2 to 3. + +2001-12-11 Paul Eggert + + * m4/Makefile.am.in: Remove jm-glibc-io.m4 + + * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.5. + + * configure.ac (PR_PROGRAM): Use AC_DEFINE_UNQUOTED, so that + $PR_PROGRAM is expanded by sh. + (ptrdiff_t, ssize_t): Use AC_CHECK_TYPE with a default of int, + not AC_CHECK_TYPES. + (jm_AC_DOS, AC_FUNC_SETMODE_DOS): New macros. + (AC_CONFIG_FILES): Add ms/Makefile. + + * doc/diff.texi: Add --no-ignore-file-name-case. + File name case sensitivity now affects file name exclusion. + Fix typos. + + * src/util.c: Include dirname.h. + (dir_file_pathname): Use base_name rather than file_name_lastdirchar. + + * src/system.h (S_IXUSR, S_IXGRP, S_IXOTH): New macros. + Include rather than rolling it ourselves. + (file_name_lastdirchar, HAVE_SETMODE, set_binary_mode): Remove. + + * src/sdiff.c: Include . + (expand_name): Use base_name rather than file_name_lastdirchar, for + portability to DOS. + (main): Initialize xalloc_exit_failure before possibly invoking + any memory allocator. + + * src/io.c: Include setmode.h. + + * src/diff3.c (main): + Initialize xalloc_exit_failure before possibly invoking any memory + allocator. + + * src/diff.c: Include dirname.h, setmode.h. + + (main): Later values and/or styles now silently override earlier. + (specify_value, specify_style): Likewise. All callers changed. + Remove. + (binary, main, option_help_msgid, compare_files): + HAVE_SETMODE -> HAVE_SETMODE_DOS. + (NO_IGNORE_FILE_NAME_CASE_OPTION): New constant. + (longopts, main, option_help_msgid): Support it. + (exclude_options): New function. + (main): Use it. Initialize xalloc_exit_failure before potentially + allocating memory. + + (filetype): Distinguish executable files from others, as POSIX + suggests. + + (compare_files): Use base_name instead of file_name_lastdirchar. + + * src/cmp.c: Include , . + (hard_locale_LC_MESSAGES): New macro. + (sprintc): Remove int width arg; it's now the caller's responsibility + to pad. All callers changed. + (stat_buf): New static var; was formerly a local var in 'main'. + (valid_suffixes): Add 'K', for 'KiB'. + (option_help_msgid): Don't confuse bytes with characters. + (main): Set xalloc_exit_failure before invoking anything that might + allocate memory. Fix bug: -n was incorrectly ignored when optimizing + the case of regular files with different lengths. + (cmp): Use an index column wide enough to store this comparison's + indexes. In locales other than the POSIX locale, say "byte" + rather than "char". + + * ms/config.bat: pc -> ms + + * ms/Makefile.am, m4/setmode.m4, lib/setmode.c, lib/setmode.h: + New file. + + * lib/Makefile.am (noinst_HEADERS): Add dirname.h, setmode.h. + (libdiffutils_a_SOURCES): Add basename.c, setmode.c. + + * Makefile.am (SUBDIRS): Add ms. + +2001-12-10 Paul Eggert + + * m4/fnmatch.m4: Test for FNM_CASEFOLD. + +2001-12-03 Paul Eggert + + * lib/posix/regex.h: Fix copyright notice. + +2001-12-03 Paul Eggert + + * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.4. + + * diff.texi (direntry, Overview, Comparison, Binary, Invoking cmp): + Use "byte" rather than "character" when talking about cmp, since + it compares bytes, not character. + (Invoking cmp): New trailing operands FROM-SKIP and TO-SKIP. + -i or --ignore-initial now accepts FROM-SKIP:TO-SKIP. + New option -n or --bytes. + Count operands now may be in octal or hex, and may be followed by a + size multiplier. + + * configure.ac (DEFAULT_DIFF_PROGRAM): + Define to "diff", not "$bindir/diff" (which didn't work anyway). + (AC_CHECK_MEMBERS): Add struct stat.st_blksize, struct stat.st_rdev. + (AC_STRUCT_ST_BLKSIZE, AC_STRUCT_ST_RDEV): Remove; obsolescent. + (AC_FUNC_FORK): Use this, instead of obsolescent AC_FUNC_VFORK. + (AC_CONFIG_FILES, AC_CONFIG_COMMANDS): Add. + (AC_OUTPUT): Remove args; they were obsolescent. + + * util.c (setup_output, begin_output, finish_output): + HAVE_FORK -> HAVE_WORKING_FORK || HAVE_WORKING_VFORK. + * sdiff.c (diffpid, cleanup, main, edit): Likewise. + * diff3.c (read_diff): Likewise. + + * system.h (STAT_BLOCKSIZE): + Use HAVE_STRUCT_STAT_ST_BLKSIZE, not HAVE_ST_BLKSIZE. + (vfork): New macro. + (HAVE_FORK): Remove. + (set_binary_mode): New macro. + + * sdiff.c (main): HAVE_VFORK -> HAVE_WORKING_VFORK. + (edit): Reopen the temporary file after the editor has run, in case + the editor operates by unlinking the old file and linking a new one. + (P_tmpdir): Rename from PVT_tmpdir; this fixes a typo. + All uses changed. + + * io.c (sip, read_files): + Remove tests for HAVE_SETMODE; use set_binary_mode + instead of setmode. + (sip): Fix typo in backward lseek when reverting to text mode. + + * config.site, config.sed, config.bat: New file. + + * Makefile.am (EXTRA_DIST): Add xstrtol.c. + (noinst_HEADERS): Add xstrtol.h. + (libdiffutils_a_SOURCES): Add xstrtoumax.c. + + * cmp.c: : Include. + (ignore_initial): Now an array with 2 elements. All uses changed. + (bytes): New var. + (HELP_OPTION): New constant. + (long_options, main): Use it. + (long_options, option_help_msgid, main, cmp): + Add support for -n or --bytes. + (parse_ignore_initial): New function. + (option_help_msgid, main): Add -i M:N. + (usage, main): Add two optional trailing operands, a la BSD. + (main): setmode -> set_binary_mode. + (cmp): Report byte number of what we've seen, not of the entire file. + This is to be consistent with the line number, which is always relative + with what we've seen. + +2001-12-02 Paul Eggert + + * diff.c (main, compare_files): setmode -> set_binary_mode. + + * xstrtol.c (__xstrtol): Don't accept 'Ki'; require 'KiB'. + + * xstrtol.c (__xstrtol): Add support for IEC 60027-2. + +2001-11-25 Paul Eggert + + * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.3. + + * README-alpha: New file. + + * src/Makefile.am (INCLUDES): Add -I../lib, for regex.h. + + * configure.ac: + Don't set LIB_CLOCK_GETTIME to 'none required'; set it to + the empty string instead. + + * lib/Makefile.am (EXTRA_DIST): Add strtoimax.c, strtol.c. + + * Makefile.am (SUBDIRS): Put intl before lib, so that libintl.h exists. + + * lib/Makefile.am (noinst_HEADERS): Add unlocked-io.h. + + * configure.ac (__EXTENSIONS__): New define, for the unlocked macros. + + * README: Add copyright notice. + Remove stuff that doesn't apply any more. + + * doc/diff.texi: offsets -> indices for cmp + + * src/cmp.c (option_help_msgid): offsets -> indices + + * src/diff.c (option_help_msgid): + Don't mention --binary on POSIX hosts. + + * src/sdiff.c (STRIP_TRAILING_CR_OPTION): New constant. + (longopts, option_help_msgid, main): Add -E, --ignore-tab-expansion, + --strip-trailing-cr. + + * doc/diff.texi: Change direcategory from Utilities to GNU Packages. + Add individual utilities. + Switch to Free Documentation License. + @code -> @command + @samp -> @option + GNU -> @sc{gnu} + Expand tabs to spaces, except when in an example that actually + uses tabs. + Prefer @node with just one arg. + Document -E or --ignore-tab-expansion, --strip-trailing-cr, + --ignore-file-name-case. + Regular expressions are now grep style, not Emacs style. + cmp's -c or --print-chars option is now -b or --print-bytes. + Time stamps now depend on LC_TIME. + -p now implies ^[[:alpha:]$_]. + Flags now include ' and 0. + cmp -i is an alias for --ignore-initial + Document --from-file, --to-file. + Document DIFF_OPTIONS. + + * configure.ac (AC_CHECK_FUNCS): Add gettimeofday, clock_gettime. + (LIB_CLOCK_GETTIME): New subst. + + * src/system.h: Assume C89 or better. + (_GNU_SOURCE): Remove; config.h now defines it. + (alloca): Declare like coreutils does it. + (verify, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, O_RDWR, + S_IRUSR, S_IWUSR): New macros. + (STAT_BLOCKSIZE): Parenthesize definiens. + : Include if HAVE_INTTYPES_H. + (CHAR_MAX, INT_MAX): Remove. + (PTRDIFF_MAX, SIZE_MAX): New macros. + (strtoumax): New decl. + Include stddef.h. + (bzero): Remove. + (bindtextdomain, textdomain, N_): New macros. + (ISPRINT, ISSPACE): Remove ifndef wrappers. + (ISUPPER, ISDIGIT): Remove. + (TOLOWER): New macro. + (MIN): Renamed from min; all callers changed. + (MAX): Likewise, from max. + (lin): New type. + (LIN_MAX): New macro. + (file_name_cmp): Renamed from filename_cmp. All callers changed. + (file_name_lastdirchar): Renamed from file_name_lastdirchar. + All callers changed. + (could_be_mvfs_stat_bug, could_be_nfs_stat_bug, + dev_may_have_duplicate_ino): Remove. + (HAVE_SETMODE, NULL_DEVICE): New macros. + (same_file): Do not check attributes. + (same_file_attributes): New macro. + + * src/util.c: Assume C89 or better. + int -> bool for booleans. + int -> lin for line numbers. + int -> size_t for sizes. + Use angle-brackets when including quotesys.h. + Include error.h, regex.h, xalloc.h. + (message5): sizeof -> offsetof + (begin_output): Invoke pr without -f. + (lines_differ): Renamed from line_cmp, and return bool not 3-way int. + All callers changed. + Add support for IGNORE_TAB_EXPANSION. + (change_letter): Now an array rather than a function. All + callers changed. + (translate_range): Translate line numbers to long, not lin, + for convenience with printf. + (analyze_hunk): Return enum changes instead of a count of + inserts and deletes. All callers changed. + (zalloc): New function. + + * src/side.c: Assume C89 or better. + int -> bool for booleans. + int -> lin for line numbers. + + * src/sdiff.c: Assume C89 or better. + int -> bool for booleans. + int -> lin for line numbers. + Use angle-brackets when including getopt.h, quotesys.h. + Include error.h, freesoft.h, stdio.h, xalloc.h. + (copyright_string): Use only most recent year. + (authorship_msgid, option_help_msgid): Wrap in N_(). + + (tmpname): Now volatile. + (tmpmade): Remove. + (tmp): New var. + (private_tempnam, exists, letters): Remove. + (temporary_file): New function. + (edit): Use it. + (interact): Use strtoumax, not atoi. + + * src/normal.c: Assume C89 or better. + int -> lin for line numbers. + + * src/io.c: Assume C89 or better. + int -> bool for booleans. + int -> lin for line numbers. + int -> size_t for sizes. + Use angle-brackets when including cmpbuf.h. + Include regex.h, xalloc.h. + (word): Remove; now done in system.h. + (hash_value): New type; use it instead of 'unsigned' for hash values. + (file_block_read): New function. + (sip, slurp): Use it. Now static. + (sip): Ensure block size is a multiple of word size. Clear eof flag. + (slurp): Use xalloc_die to report memory exhaustion. + (find_and_hash_each_line): Use TOLOWER instead of _tolower. + Add support for IGNORE_TAB_EXPANSION. + (prepare_text_end): Strip trailing CR if requested. + (find_identical_ends): Prepare the text only once, + if they're duplicates. + Let the compiler take advantage more of the fact that the buffers are + word-aligned. + (primes): Remove. + (prime_offset): New var. + (read_var): Use prime_offset instead of primes. + Use zalloc instead of xmalloc + bzero. + + * src/ifdef.c: Assume C89 or better. + int -> lin for line numbers. + (format_group): Use strtoumax to parse line numbers. + (format_group, print_ifdef_lines): Use do_printf_spec to + handle printf specs. + (groups_letter_value): Don't use _tolower; it's locale-dependent. + (do_printf_spec): Renamed from scan_printf_spec; now does the printing. + + * src/ed.c: Assume C89 or better. + int -> lin for line numbers (or 'long' when that's more convenient). + (print_ed_hunk): Fix bug when handling double-dot inserts. + + * src/dir.c: Assume C89 or better. + int -> bool for booleans. + Include error.h, exclude.h, xalloc.h. + + (dir_sort): Return 0 on error, 1 on success. All callers changed. + compare_names -> compare_names_for_qsort. + + (compare_names): Try strcasecmp if ignore_file_name_case. Then try + strcoll. Use file_name_cmp only as a last resort. Warn about + strcasecmp or strcoll failure. + (compare_names_for_qsort): New function. + + (diff_dirs): Use compare_names rather than filename_cmp. + + * src/diff3.c: Assume C89 or better. + int -> bool for booleans. + int -> lin for line numbers. + Use angle-brackets when including getopt.h, quotesys.h. + Include error.h, freesoft.h, inttostr.h, xalloc.h. + (copyright_string): Use only most recent year. + (authorship_msgid, option_help_msgid): Wrap in N_(). + + Rename the following variables for consistency with user-visible + option spellings. All uses changed. + (text): Renamed from always_text. + (initial_tab): Renamed from tab_align_flag. + + (horizon_lines): Remove. Remove all uses. + + (main): Invoke bindtextdomain and textdomain after setlocale. + Rename "DIFF" to "DIFF_PROGRAM". + + Try to compare file0 to file1, because this is where changes are + expected to come from. Diffing between these pairs of files is more + likely to avoid phantom changes from file0 to file1. + However, use file2 as the common file if this is a 3-way diff, + for backward compatibility. Suggested by Karl Tomlinson. + + (create_diff3_block): Use xcalloc instead of malloc + bzero. + + (INT_STRLEN_BOUND): Remove; now in system.h. + + (read_diff): Always use --horizon-lines=100 rather than trying + to guess it. + Do not pass --inhibit-hunk-merge. + Minimum chunk size is 1, not 8KiB. + Use xalloc_die to report memory exhaustion. + (undotlines): Use long for start, not int. + + * src/diff.h: Assume C89 or better. + int -> bool for booleans. + int -> lin for line numbers. + Don't include regex.h. + (enum changes): New enum. + (enum line_class): Remove; subsumed by enum changes. + (enum output_style): New constant OUTPUT_UNSPECIFIED. + + (ignore_space_change_flag, ignore_all_space_flag): Remove. + (ignore_white_space): New decl, subsuming the above two. All + uses changed. + + Rename the following decls for consistency with user-visible + option spellings. All uses changed. + (text): Renamed from always_text_flag. + (ignore_blank_lines): Renamed from ignore_blank_lines_flag. + (ignore_case): Renamed from ignore_case_flag. + (brief): Renamed from no_details_flag. + (initial_tab): Renamed from tab_align_flag. + (expand_tabs): Renamed from tab_expand_flag. + (starting_file): Renamed from dir_start_file. + (paginate): Renamed from paginate_flag. + (sdiff_merge_assist): Renamed from sdiff_help_sdiff. + (left_column): Renamed from sdiff_left_only. + (suppress_common_lines): Renamed from sdiff_skip_common_lines. + (speed_large_files): Renamed from heuristic. + (minimal): Renamed from no_discards. + + (inhibit_hunk_merge): Remove. + + (strip_trailing_cr, excluded, time_format): New decls. + + (files_can_be_treated_as_binary): Renamed from ignore_some_changes. + + (group_format, line_format): Now char const *[], not char *[]. + + (struct file_data): Buffer is now word*, not char*, as it's always + aligned and this can help the compiler. buffered_chars -> buffered + (since it's a byte count, not a char count). All uses changed. + New member `eof'. + + (FILE_BUFFER): New macro. + + (excluded_filename, error, free_software_msgid): Remove decls; now in + other .h files. + + (sip, slurp): Remove decls. + (file_block_read): New decl. + (change_letter): Now an array, not a function. + (lines_differ): Renamed from line_cmp. + (analyze_hunk): Now returns enum changes rather than two change counts. + + * src/Makefile.am (diff_LDADD): New symbol. + + * src/diff.c: Assume C89 or better. + int -> bool for booleans. + long -> off_t for line numbers. + Use angle-brackets when including getopt.h, fnmatch.h, quotesys.h. + Include error.h, exclude.h, freesoft.h, hard-locale.h, prepargs.h, + regex.h, signal.h, xalloc.h. + (copyright_string): Use only most recent year. + (authorship_msgid, option_help_msgid): Wrap in N_(). + + Rename the following variables for consistency with user-visible + option spellings. All uses changed. + (binary): Renamed from binary_flag. + (new_file): Renamed from entire_new_file_flag. + (unidirectional_new_file): Renamed from unidirectional_new_file_flag. + (report_identical_files): Renamed from print_file_same_flag. + + (numeric_arg): Remove. + + (exclude, exclude_alloc, exclude_count, excluded_filename, add_exclude, + add_exclude_file): + Remove; now done by exclude.h. + + (BINARY_OPTION, FROM_FILE_OPTION, HELP_OPTION, HORIZON_LINES_OPTION, + IGNORE_FILE_NAME_CASE_OPTION, INHIBIT_HUNK_MERGE_OPTION, + LEFT_COLUMN_OPTION, LINE_FORMAT_OPTION, NORMAL_OPTION, + SDIFF_MERGE_ASSIST_OPTION, STRIP_TRAILING_CR_OPTION, + SUPPRESS_COMMON_LINES_OPTION, TO_FILE_OPTION, + UNCHANGED_LINE_FORMAT_OPTION, OLD_LINE_FORMAT_OPTION, + NEW_LINE_FORMAT_OPTION, UNCHANGED_GROUP_FORMAT_OPTION, + OLD_GROUP_FORMAT_OPTION, NEW_GROUP_FORMAT_OPTION, + CHANGED_GROUP_FORMAT_OPTION): New constants. + (longopts, main): Use them. + + (longopts, main, option_help_msgid): Add -E, --from-file, --to-file. + + (main): Invoke bindtextdomain and textdomain after setlocale. + Use grep syntax, not Emacs, for regular expressions. + Use exclude.h, not our own functions. + Use ISO 8601 time format in hard locales. + Prepend DIFF_OPTIONS. + Don't update ignore_some_changes. + Use strtoumax instead of numeric_arg. + Use specify_value when appropriate. + error -> try_help when appropriate. + -p now means ^[[:alpha:]$_], not ^[_a-zA-Z$]. + Ignore --inhibit-hunk-merge. + Prefer changed group formats to unchanged ones. + Remove now-unnecessary casts. + Set files_can_be_treated_as_binary. + + (specify_value): Renamed from specify_format. All uses changed. + + (specify_style): Default is now unspecified, not normal. All + uses changed. + + (set_mtime_to_now): New function. + (compare_files): Use it. Use memset, not bzero. + Set stdin mtime to current time even when stdin is not a regular file. + Check for same file attributes, as well as for same file. + Use files_can_be_treated_as_binary. + "write failed" -> "standard output on output failure. + + * src/context.c: Assume C89 or better. + int -> lin for line numbers. + Include inttostr.h, regex.h. + (TIMESPEC_NS): New macro. + (nstrftime): New decl. + (print_context_label): Use nstrftime and time_format to format times. + Print numeric timestamp value if localtime fails. + (print_context_function): New function. + (pr_context_hunk, pr_unidiff_hunk): Use it. + (find_function): Use size_t for sizes, not int. + + * src/cmp.c: Assume C89 or better. + int -> bool for booleans. + long -> off_t for line numbers. + Use angle-brackets when including cmpbuf.h, getopt.h. + Include error.h, freesoft.h, inttostr.h, xalloc.h. + (copyright_string): Use only most recent year. + (authorship_msgid): Wrap in N_(). + (buffer): Now word*, not char*. All uses changed. + (word): Remove macro; now in system.h. + (long_options, option_help_msgid, main): -c --print-chars -> + -b --print-bytes + (check_stdout): "write failed" -> "standard output" + (option_help_msgid): Wrap in N_(). + (main): Invoke bindtextdomain and textdomain after setlocale. + Use strtoumax instead of doing the work ourselves. + Check for same_file_attributes as well as same_file. + (cmp): Use ssize_t for read returns, not size_t. + Do not assume that size_t is not narrower than int. + Do not assume that line numbers fit in 'long'. + (block_compare_and_count, block_compare): + Compiler now checks that buffers are word-aligned. + (block_compare_and_count): Count sizes with size_t, not long. + (sprintc): byte arg is unsigned char, not unsigned. + + * src/analyze.c: Assume C89 or better. + int -> lin for line numbers. + int -> bool for booleans. + unsigned int -> size_t for sizes. + Use angle-brackets when including cmpbuf.h. + Include error.h, regex.h, xalloc.h. + (discard_confusing_lines, diff_2_files): Use zalloc rather + than xalloc+bzero. + (discard_confusing_lines): unsigned int -> lin for values that + are really line numbers. + (shift_boundaries): Do not inhibit hunk merges. + (build_reverse_script, build_script, diff_2_files): Use |, not ||. + (diff_2_files): no_details_flag & ~ignore_some_changes -> + files_can_be_treated_as_binary. Esure that buffer size is a multiple + of sizeof (word). Use file_block_read to read buffers. + (diff_2_files): Abort if output style is not one of the + expected styles. + +2001-11-23 Paul Eggert + + * src/Makefile.am, m4/vararrays.m4: New file. + + * m4/prereq.m4 (jm_PREREQ_READUTMP): + Remove, as it gives autoheader the willies. + + * m4/README, lib/prepargs.h, lib/prepargs.c, lib/offtostr.c, + lib/umaxtostr.c, lib/inttostr.c, lib/inttostr.h, + lib/imaxtostr.c, lib/freesoft.h: New files. + + * lib/freesoft.c: Include config.h, freesoft.h rather than diff.h. + (free_software_msgid): Wrap contents in N_. + + * lib/cmpbuf.h: Use prototypes instead of old-style functions. + + * lib/cmpbuf.c: + Don't include system.h; instead, include config.h, unistd.h. + Use prototypes instead of old-style functions. + (block_read): Don't assume that int is no wider than size_t. + + * lib/Makefile.am, po/POTFILES.in: New file. + +2001-11-22 Paul Eggert + + * pc/config.h: + Define filename_cmp as an object-like macro, not as a function-like + macro. + + * exgettext: Always operate in the C locale. + Set AWK using a method that works even with broken shells. + + * doc/Makefile.am: New file. + + * configure.ac (AC_INIT): + Use src/diff.c, not diff.h, as the source files got removed. + (AM_CONFIG_HEADER): Switch from AC_CONFIG_HEADER. + (AC_ARG_PROGRAM, AC_MINIX): Remove. + + (AC_PREREQ, AM_INIT_AUTOMAKE, ALL_LINGUAS, AC_PROG_AWK, + AM_PROG_CC_STDC, AC_PROG_RANLIB, AC_C_INLINE, AC_C_VARARRAYS, + DEFAULT_DIFF_PROGRAM, DEFAULT_EDITOR_PROGRAM, + AC_STRUCT_ST_MTIM_NSEC): Add. + + (PR_PROGRAM): AC_DEFINE. + + (AC_SYS_LARGEFILE): Use instead of our homebrew version. + + (_GNU_SOURCE): Define if not defined. + + (AC_CHECK_HEADERS): Add stdbool.h, unistd.h. + (AC_CHECK_TYPES): Add ptrdiff_t, uintmax_t. + (AM_GNU_GETTEXT, XGETTEXT): Add. + + (WITH_MVFS_STAT_BUG, WITH_NFS_STAT_BUG): Remove. + (HAVE_MEMCHR): Remove. + (AC_CHECK_FUNCS): Add diraccess. + (AC_REPLACE_FUNCS): Add memchr, waitpid. + (jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_GNU_STRFTIME, jm_FUNC_MALLOC, + jm_FUNC_REALLOC, jm_PREREQ_ERROR, jm_PREREQ_QUOTEARG, jm_PREREQ_REGEX, + jm_PREREQ_TEMPNAME, jm_AC_PREREQ_XSTRTOUMAX, AC_FUNC_FNMATCH): Add. + (fnmatch.h, regex.h): Do not create these files unless we're using + our own fnmatch and regex. + + (AC_OUTPUT): Add doc/Makefile, intl/Makefile, lib/Makefile, + lib/posix/Makefile, m4/Makefile, po/Makefile.in, src/Makefile. + + * Makefile.am: New file. + + * po/en_GB.po: Don't translate "program" to "programme". + +2001-11-20 Paul Eggert + + * m4/prereq.m4: New file. + +2001-03-16 Paul Eggert + + * lib/tempname.c (uint64_t): + Define if not defined, and if UINT64_MAX is not defined. + +2001-02-26 Paul Eggert + + * lib/tempname.c: glibc 1.32 + +2001-02-17 Paul Eggert + + * m4/Makefile.am.in: GNU fileutils 4.1 + +2001-01-09 Paul Eggert + + * lib/tempname.c (struct_stat64): New macro. + (direxists, __gen_tempname): Use it. This avoids a portability problem + with Solaris 8. + + * lib/tempname.c (): Include if HAVE_CONFIG_H. + (, , ): + Include only if STDC_HEADERS || _LIBC. + (): Include only if HAVE_FCNTL_H || _LIBC. + (): Include only if HAVE_UNISTD_H || _LIBC. + (): Include only if HAVE_SYS_TIME_H || _LIBC. + (__set_errno): Define this macro if doesn't. + (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE): + Define these macros if doesn't. + (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR): + Define these macros if + doesn't. Ignore S_ISDIR if STAT_MACROS_BROKEN. + (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64, + __xstat64): Define if not _LIBC. + (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC). + (__gen_tempname): Invoke gettimeofday only if HAVE_GETTIMEOFDAY + || _LIBC; otherwise, fall back on plain "time". + Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600. + + * lib/mkstemp.c (__GT_FILE): Define to zero if not defined. + +2000-10-25 Paul Eggert + + * lib/hard-locale.c: New file. + +2000-02-05 Paul Eggert + + * exgettext: From GCC repository + +1999-07-06 Paul Eggert + + * lib/mkstemp.c: glibc 2.2 + +1998-12-11 Paul Eggert + + * src/sdiff.c (lf_snarf): + Fix bug when help line wrapped around the input buffer. + +1998-09-15 Paul Eggert + + * diff.texi: Add @dircategory and @direntry. + +1998-09-14 Paul Eggert + + * Makefile.in (VERSION): Version 2.7.2. + (DEFAULT_DIFF_PROGRAM): Renamed from DIFF_PROGRAM. + (PR_PROGRAM): All `configure' to define it. + (srcs): Add $(diffutils_srcs), freesoft.c, quotearg.c instead of + quote.c, quotearg.h. + (distfiles): Add acconfig.h, message/*. + (all): Depend on $(destfiles), not info. + (version.c): Parenthesize `GNU diffutils'. + (common_o): Add freesoft.o + (diff_o): quote.o -> quotearg.o + (diff3_o, sdiff_o): Likewise. + (diff.dvi): Depend on version.texi. + (diff.o diff3.o quotearg.o sdiff.o util.o): + New dependency on quotearg.h + (diff3.o): DIFF_PROGRAM -> DEFAULT_DIFF_PROGRAM. + (sdiff.o): Likewise. + (messages.po): Remove. + (message/msgid.po, message/template.po): New rules. + (maintainer-clean): Renamed from realclean. + (install): Install from source directory, if applicable. + Invoke install-info if needed. + (install-strip): New rule. + (check): Set DIFF. + (stamp-h.in): Don't put the date into the timestamp. + (D_dirs): Add $D/message. + ($D.tar.gz): Compress with gzip -9. + Don't use ln to create distribution; it doesn't work with symlinks. + (srcs, distfiles, diff_o, diff3_o, sdiff_o): Rename quotearg.c to + quotesys.c and quotearg.h to quotesys.h. + + * configure.in (AC_PATH_PROG): Add PR_PROGRAM. + If available, prefer support for large files unless the user specified + one of the CPPFLAGS, LDFLAGS, or LIBS variables. + (AC_STRUCT_ST_RDEV): Add. + (HAVE_ST_FSTYPE_STRING): Add. + (--with-mvfs-stat-bug, --with-nfs-stat-bug): New options. + (HAVE_MEMCHR): New macro. + (AC_CHECK_FUNCS): Add sicprocmask. + + * diff.h (XTERN): Renamed from EXTERN. + (struct filedata): Remove dir_p arg. + (struct comparison): New type. + (diff_2_files, diff_dirs)" Ise ot/ + (error): Add printf attribute if applicable. + (free_software_msgid): New decl. + (pr_program): New decl. + (fatal): Add noreturn attribute. + (pfatal_with_name): Likewise. + + * system.h (__attribute__): New macro. + (getenv): Don't declare if HAVE_STDLIB_H. + (CHAR_MAX): New macro. + (): New include. + (): Include before . + (could_be_mvfs_stat_bug, could_be_nfs_stat_bug, + dev_may_have_duplicate_ino, same_special_file): New macros. + (same_file): Use them. + + * cmp.c (authorship_msgid): New var. + (free_software_msgid): New decl. + (error): Now has printf attribute. + (try_help): Likewise. + (long_options): Don't assume ASCII. + (try_help): Now accepts operand arg. + (main): Check for -1, not EOF, when calling getopt_long. + Report --ignore-initial value when complaining about it. + Output copyright and free software info with -v. + Don't assume ASCII. + Report last operand when one is missing. + Report text of extra operand. + Move block_read into cmpbuf.c. + + * diff.c (authorship_msgid): New var. + (quotesys.h): Include. + (ck_atoi): Remove. + (function_regexp_list, ignore_regexp_list): Now static. + (binary_flag): Renamed from binary_I_O. + (entire_new_file_flag, unidirectional_new_file_flag, + print_file_same_flag): Now static. + (numeric_arg): Renamed from ck_atoi. + New argument specifying the argument type. + (longopts, main): Don't assume ASCII. + (longopts): Remove old aliases --file-label, --entire-new-file, + --ascii, --print. + (main): Check for -1, not EOF, when calling getopt_long. + Use numeric_arg to report errors. + Report error if -l specified but pagination is not supported. + Report error if -S is specified twice with conflicting values. + Have --version conform to the new GNU standards. + Add new --from-file, --to-file, --inhibit-hun,-merge options. + Make the horizon at least as large as the context. + Add casts to pacify gcc -Wall. + (try_help): Add operand arg. + (option_help_msgid): Doc fix to match above. + (usage): Indent option_help_msgid. + (compare_files): Now takes struct comparison + instead of two directory names and a depth. + (NONEXISTENT, UNOPENED, ERRNO_ENCODE, ERRNO_DECODE): + New macros. + (DIR_P): New macro. + Report error if fflush does. + + * cmpbuf.c (block_read): Moved here from cmp.c. + + * cmpbuf.h (block_read): New decl. + + * io.c (cmpbuf.h): Include. + (slurp): Check for arithmetic overflow when computing buffer size. + + * dir.c (diff_dirs): Check for recursive directory loop. + Arg is now struct comparison const *. + (dir_loop): New function + + * analyze.c (no_discards): Remove. + (inhibit): Remove. + (shift_boundaries): Don't inhibit. If inhibit_hunk_merge is nonzero, + don't merge hunks. + (briefly_report): Now returns 2 if trouble, CHANGES otherwise. + (diff_2_files): Now takes struct comparison. If briefly_report reports + trouble, pass it on to caller. + + * side.c (print_half_line): Add brackets to pacify GCC -Wall. + + * sdiff.c (quotesys.h): Include. + (DIFF_PROGRAM, DEFAULT_EDITOR_PROGRAM): Remove. + (free_software_msgid, editor_program, not_found): New vars. + (diffbin, edbin): Remove. + (editor_program): Renamed from edbin. + (edit, interact): Now take extra string arg. + (exiterr, fatal, perror_fatal, try_help): Add noreturn attribute. + (sigset_t, sigemptyset, sigmask, sigaddset, SIG_BLOCK, SIG_SETMASK): + (sigprocmask): New macros, if !HAVE_SIGPROCMASK. + (error): Now has printf attribute. + (longopts, main): Don't assume ASCII. + (try_help): New operand arg. + (usage): Conform to new GNU standards. + (main): Set static vars for editor and diff program. + Compare getopt_long result to -1, not EOF. + -v conforms to new GNU standard. + Complain better about extra and missing operands. + If HAVE_VFORK, block SIGINT and SIGPIPE in the parent, since when + the child munges its handlers it may somp on the parent. + Pass rname to intract. + Translate not-found message before forking. + (give_help): Just output it all at once. + (edit): New args lname, lline, rname, rline. + (edit): New command 'd'. + (interact): New args lname, rname. + + * util.c (quotesys.h): Include. + (PR_PROGRAM): New macro. + (pfatal_with_name): Abort if error returns. + (fatal): Likewise. + (print_message_queue): Free message chain after printing. + (currently_recursive): Renamed from current_depth, and now a boolean. + (begin_output): Report error if fflush does. + Avoid stdio and gettext in child. + + * diff3.c (quotesys.h): Include. + (free_software_msgid): New decl. + (RANGE_START, RANGE_END): Renamed from START and END. + (fatal, perror_with_exit, try_help): Add noreturn attribute. + (error): Add printf attribute. + (diff_program): Now a ptr, not an array. + Initialize to DEFAULT_DIFF_PROGRAM instead of DIFF_PROGRAM. + (longopts, main): Don't assume ASCII. + (main): Use DIFF environment var to specify name of diff program. + Compare getopt_long result to -1, not EOF. + -v now reports version according to new GNU standard. + Report spelling of extra operand, or last operand before missing one. + (try_help): Now takes operand arg. + (option_help_ms): Fix typo: missing comma. + (usage): Update as per current GNU standards. + (environ): Remove decl. + (read_diff): Invoke diff with --inhibit-hunk-merge. + Translate `not found' message before forking. + Quote name of diff program. + Pass horizon lines. + `memory exhausted' -> `Memory exhausted' + + * pc/makefile (%.exe): Remove. + (pc-clean): Remove *.exe + * pc/makefile.sed (DEFAULT_DIFF_PROGRAM): Renamed from DIFF_PROGRAM. + When editing mkinstalldirs rule, look for exec_prefix and prefix. + Add .exe when installing files. + * pc/emx/config.h (same_file): Add. + * pc/config.h (same_file): Remove. + * pc/djgpp/config.h: Adjust to latest patch from eliz. + * pc/djgpp/makefile.sed: Don't alter PROGRAMS. + * pc/pc.c: Update FSF address. + (quote_system_arg): Renamed from system_quote_arg. + + * README: Add --with-mvfs-stat-bug, --with-nfs-stat-bug. + + * getmsgids: Add copyright date and update FSF address. + + * diff.texi: Document recent changes. + The patch doc still corresponds to patch 2.2, unfortunately. + Update GNU bug reporting address. Omit Larry Wall's address; + it's obsolete and he's busy with perl. + + * context.c: Fix spacing. + + * NEWS: Mention --from-file=FILE, --to-file=FILE, ed. + + * acconfig.h, freesoft.c, message/de.po, message/en_UK.po, + message/es.po, message/fr.po, message/pl.po, message/sv.po: + New files. + + * ed.c: Remove `#if 0'ed code. + + * normal.c, waitpid.c: Update FSF address. + +1998-03-15 Paul Eggert + + * quotesys.c: Renamed from quotearg.c. + + * quotesys.h: Renamed from quotearg.h + (__QUOTESYS_P): Renamed from __QUOTEARG_P. + +1997-05-05 Paul Eggert + + * quotesys.c, quotesys.h: New file. + +Mon Nov 14 05:10:56 1994 Paul Eggert + + Add internationalization support. + Several messages have been changed slightly, + to make them more consistent and easier to translate. + All strings that are messages are passed through gettext once before + being used, so that they can be localized. + Each function and macro whose first parameter is a gettext msgid + has had its first parameter's name changed so it ends in `msgid'. + All arrays of msgids have had their names changed to end in `msgid'. + `getmsgids' uses this to determine which strings are msgids. + + * pc/COPYING, pc/INSTALL, pc/config.h, + pc/djgpp/config.h, pc/djgpp/makefile.sed, + pc/emx/config.h, pc/emx/diff.def, pc/emx/gnuregex.def, + pc/emx/makefile.sed, + pc/makefile, pc/makefile.sed, pc/pc.c: New files, for PC support. + + * getmsgids: New file. + + * Makefile.in (PACKAGE, VERSION, diffutils_srcs, D): New vars. + (version.c, version.texi, messages.po): New files. + messages.po is built automatically from source files and `getmsgids'. + (distfiles): Add them, pc/*, and getmsgids. + (diff.info): Now depends on version.texi. + (realclean): Clean messages.po, version.*. + (dist): Just build $D.tar.gz. + ($D.tar.gz): New file, takes over old `dist' function. + Don't assume $(distfiles) are all in same directory. + + * configure.in (AC_CHECK_HEADERS): Add libintl.h, locale.h. + (AC_CHECK_LIB): Check for -lintl. + + * analyze.c (briefly_report): Rewrite `message (A?"B":"C")' as + `if (A) message ("B") : message ("C")'; this is for getmsgids. + (briefly_report, diff_2_files): For label, use file_label if set. + * diff.c (compare_files): Likewise. + + * system.h (gettext): Declare; use a stub if ! HAVE_LIBINTL_H. + (setlocale): Declare; use a stub if ! HAVE_LOCALE_H. + + * cmp.c, diff.c, diff3.c, sdiff.c (main): + Invoke setlocale first thing, to tell library we're internationalized. + (option_help_msgid): New constant. + (usage): Use it, so message is translated one option at a time. + * sdiff (help_msgid, give_help): Likewise. + + * cmp.c (sprintc): Renamed from `printc'. + Now outputs to a buffer instead of stdout. + (cmp): Use new sprintc; it's easier to internationalize. + + * diff.c (main): -D FOO now outputs `/* ! FOO */ instead of + `/* not FOO */'. + + * sdiff.c (version_string): Fix decl typo: `const' was missing. + (trapsigs): Ignore sigaction failure, to be compatible with `signal'. + + * util.c (struct msg, message5, print_message_queue): + Allocate just one block of memory to save a message. + +Wed Nov 9 17:42:44 1994 Paul Eggert + + * sdiff.c (trapsigs): Don't check signal return value, since it's + bogus under djgpp. + +Mon Oct 31 07:27:27 1994 Paul Eggert + + * Makefile.in (srcs, diff_o, diff3_o, sdiff_o): + New files quote.c, quote.o. + + * diff.h (function_regexp, ignore_regexp): Replace lists of compiled + regexps with these single compiled regexps. All users changed. + (regexp_list,function_regexp_list,ignore_regexp_list): Move to diff.c. + * diff.c (add_regexp): Build one big regexp instead of a regexp list. + (summarize_regexp_list): New function. + (regexp_list): Redesigned struct; moved here from diff.h. + (function_regexp_list, ignore_regexp_list): Likewise, for vars. + + * context.c (find_function): Simplify interface: + don't return size of function line. All callers changed. + (print_context_script, find_function): INT_MAX now denotes no + previous match; this is simpler than `- file->prefix_lines - 1'. + + * diff3.c (read_diff): Quote arguments with system_quote_arg. + * sdiff.c (main): Use system_quote_arg to compute command. + * diff.c (option_list): Quote options with system_quote_arg. + * util.c (begin_output): Use system_quote_arg to compute command. + + * util.c (pr_program): New var. + (analyze_hunk): Fix off-by-1 line length bug. + Match with one big regexp instead of a list of regexps. + Use new `trivial_length' local instead of comparing first byte to `\n'. + Help the compiler with linbuf local vars. + + * system.h (system_quote_arg): + New function; replaces SYSTEM_QUOTE_ARG macro. + +Sat Oct 15 20:09:12 1994 Paul Eggert + + * system.h (_tolower): Define if not already defined. + * io.c (find_and_hash_each_line): Change tolower to _tolower; this + speeds up diff -i considerably on some hosts (e.g. Solaris 2.3). + * util.c (line_cmp): Likewise. + * ifdef.c (groups_letter_value): Likewise. + + * diff.h (ignore_some_line_changes): Remove. All users changed. + * io.c (find_and_hash_each_line): Don't invoke line_cmp if the length + differs and -i is in force. Don't assume ISSPACE ('\n') is nonzero. + + * diff.h (xmalloc_exit_failure): New variable. + All `main' programs set this variable at the start. + xmalloc and xrealloc are now taken from GNU library. + * cmp.c (main): Align buffer size to word size; some mallocs care. + * io.c (slurp): Likewise. + * diff.c (add_exclude): Can now assume xrealloc (0, ...) works. + (add_regexp): Free storage on failure. Allocate storage all at one go. + * system.h (malloc, realloc): Remove unused declarations. + * diff3.c, sdiff.c, util.c (xmalloc, xrealloc): Remove. + * sdiff.c (diffarg): Take advantage of cleaner xrealloc semantics. + + * io.c (ROL): Use sizeof to make it more generic. + + * Makefile.in (common_o): New variable. + Link error.o and xmalloc.o into all programs. + (check): Depend on $(PROGRAMS). + + * diff.h (error): Change to GNU library standard. All callers changed. + * diff3.c (main): Use strerror (EISDIR) instead of "Is a directory". + (fatal, perror_with_exit): Use `error'. + * util.c (perror_with_name, fatal): Use GNU `error'. + (error): Remove. + +Wed Oct 12 17:04:40 1994 David J. MacKenzie (djm@duality.gnu.ai.mit.edu) + + * cmp.c (main): Set xmalloc_exit_failure. + +Sat Oct 1 05:24:19 1994 Paul Eggert + + * Version 2.7 released. + + * configure.in (AC_HEADER_SYS_WAIT): Add. + (AC_CHECK_HEADERS): Remove sys/wait.h. + (AC_CHECK_FUNCS): Add tmpnam. + * system.h (, WEXITSTATUS): Use simpler scheme + now that HAVE_SYS_WAIT_H is not set on hosts + that are incompatible with Posix applications. + + * util.c (dir_file_pathname): Use filename_lastdirchar not strrchr. + * sdiff.c (expand_name): Likewise. + (private_tempnam): Use tmpnam if HAVE_TMPNAM; this simplifies porting. + (exists, letters): Omit if HAVE_TMPNAM. + + * diff3.c (read_diff): If STAT_BLOCKSIZE yields zero, + adjust it to a more reasonable value. + +Sat Sep 24 20:36:40 1994 Paul Eggert + + * sdiff.c (exists, private_tempname): Adopt latest GNU libc algorithm. + (private_tempnam): Specialize for sdiff to avoid portability problems. + +Thu Sep 22 16:47:00 1994 Paul Eggert + + * configure.in (AC_ARG_PROGRAM): Added. + (AC_OUTPUT): Add [date > stamp-h]. + + * Makefile.in (DEFAULT_EDITOR_PROGRAM, DIFF_PROGRAM, LIBOBJS, + NULL_DEVICE, PR_PROGRAM, PROGRAMS): New variables. + (check, stamp-h.in, cmp.o, util.o): New targets. + (edit_program_name): New variable; replaces old binprefix method. + (install, uninstall): Use it. + (binprefix): Removed. + (distfiles): Add stamp-h.in. + (clean): Clean stamp-h. + (config.hin, config.h): Use timestamp files. + (cmp_o): Add $(LIBOBJS). + (install): Install info files from srcdir if they're not in `.'. + + * cmp.c, io.c (word): Don't define if already defined. + + * comp.c (main): Use setmode, not open(..., O_BINARY); this gets stdin. + Use NULL_DEVICE instead of "/dev/null". + (cmp): Use %lu instead of %ld when it is more likely to be right. + + * diff.h (PR_FILE_NAME): Rename to PR_PROGRAM and move to Makefile.in, + util.c. + + * diff3.c (main): Give proper diagnostic if too many labels were given. + (read_diff): Use SYSTEM_QUOTE_ARG. + + * system.h: : Include if HAVE_STRING_H, too. + : Include here. All includers changed. + (CTYPE_DOMAIN, ISDIGIT, ISPRINT, ISSPACE, ISUPPER): New macros that + work around common problems. + (O_BINARY): Remove. + (SYSTEM_QUOTE_ARG): New macros. + + * diff.c: Add comment. + + * util.c (PR_PROGRAM): Moved here from diff.h. + (begin_output): Use SYSTEM_QUOTE_ARG. + + * io.c (read_files): Set mode to binary before returning 1. + + * sdiff.c (TMPDIR_ENV): New macro. + (DEFAULT_EDITOR_PROGRAM): Renamed from DEFAULT_EDITOR for consistency. + (expand_name): Change `isdir' to `is_dir' to avoid theoretical ctype + namespace contamination. + (main): Use SYSTEM_QUOTE_ARG. + (private_tempnam): Don't access "/tmp" directly; use PVT_tmpdir. + +Tue Sep 13 18:46:43 1994 Paul Eggert + + * configure.in (AC_FUNC_MEMCHR): Remove. Autoconf didn't adopt this, + since we need not worry about an old experimental library + where memchr didn't work. + (AC_FUNC_MEMCMP): Not needed, since we only test for equality. + (AC_REPLACE_FUNCS): Add test for memchr. + (AC_CHECK_FUNCS): Check for memchr, not memcpy, since it'll be cached. + (AC_CHECK_HEADERS): Add string.h; regex.c uses on some old hosts. + + * system.h (memcmp): Define in terms of bcmp. + Use HAVE_MEMCHR to test for all mem* routines. + + * Makefile.in (srcs): Remove memcmp.c. + We use bcmp if memcmp doesn't work, since we only test for equality. + +Mon Sep 12 15:52:22 1994 Paul Eggert + + * configure.in (AC_CONFIG_HEADER): Rename config.h.in to config.hin. + (AC_ISC_POSIX, AC_MINIX): Go back to these old names for Autoconf 2. + (AC_CHECK_HEADERS): Remove now-redundant check for . + (AC_CHECK_FUNCS): Check for strchr. + (AC_FUNC_MEMCHR, AC_FUNC_MEMCMP, AC_CHECK_FUNCS): Use special-purpose + macros when suitable. + * memcmp.c: New file. + * Makefile.in (CPPFLAGS, DEFS, CFLAGS, LDFLAGS, prefix, exec_prefix): + Default to autoconf-specified strings. + (COMPILE): Use the defaults. + (srcs): Add memcmp.c. + (distfiles): Rename config.h.in->config.hin, install.sh->install-sh. + (Makefile, config.h, config.hin, config.status): Rework for + compatibility with Autoconf 2. + * io.c (binary_file_p): Assume non-broken memchr. + * memchr.c: Assume compiler understands void *; otherwise + we don't match GCC's internal declaration of memchr. + * system.h: Use more modern autoconf approach to standard C headers. + * version.c: Include , not "config.h". + + * diff.c, diff.h (ignore_some_line_changes): + New variable; replaces `length_varies'. + (line_end_char): Replace with '\n'; it wasn't being used consistently. + + * io.c (find_and_hash_each_line): Fix inconsistencies with -b -w -i and + incomplete lines. Put incomplete lines into their own bucket. + This means line_cmp no longer needs line length arguments, + and equivalence classes' line lengths no longer need to include \n. + Invoke line_cmp only if ignore_some_line_changes. + (prepare_text_end): -B no longer ignores missing newlines. + (read_files): Allocate another bucket for incomplete lines. + + * util.c (line_cmp): Now takes just two arguments. No longer + optimizes for common case of exact equality; the caller does that + optimization now. The caller is changed accordingly. + Optimize for the common case of mostly equality. + Use isupper+tolower instead of islower+toupper, for consistency. + + * waitpid.c (waitpid): Fix typo with internal scoping. + +Thu Sep 8 08:23:15 1994 Paul Eggert + + * configure.in: Revamp for Autoconf 2. + * memchr.c, waitpid.c: New source files for substitute functions. + * Makefile.in (diff_o, diff3_o, sdiff_o): Add $(LIBOBJS). + (srcs): Add memchr.c, waitpid.c. + (distfiles): Add install.sh, memchr.c, waitpid.c, install.sh. + * system.h: Use Autoconf 2 style HAVE_DIRENT_H etc. macros for dirs. + * dir.c (dir_sort): Prefer NAMLEN (p) to strlen (p->d_name). + Change VOID_CLOSEDIR to CLOSEDIR_VOID for Autoconf 2. + * sdiff.c, util.c (memchr, waitpid): Remove; use new substitutes. + * diff3.c (read_diff): Use new waitpid substitute. + + * cmp.c, diff.c, diff3.c, sdiff.c (check_stdout, try_help): New fns. + (usage): Just print more detailed usage message; let caller exit. + * diff.c (option_help): New variable. + (filetype): Add Posix.1b file types. + +Fri Sep 2 16:01:49 1994 Paul Eggert + + * configure.in: Switch to new autoconf names. Add sys/file.h test. + * Makefile.in (distclean): Clean config.cache, config.log + (used by new autoconf). + + * diff.c, diff3.c, (main), sdiff.c (trapsigs): If we'll have children, + make sure SIGCHLD isn't ignored. + + * diff3.c (DIFF_CHUNK_SIZE): Removed. Get size from STAT_BLOCKSIZE. + (INT_STRLEN_BOUND): New macro. + + * ifdef.c (format_group, groups_letter_value): + Use * instead of [] in prototypes. + + * system.h: Include only if HAVE_SYS_FILE_H. + (S_IXGRP, S_IXOTH, S_IXUSR): Remove unused macros. + + * util.c (begin_output): Check fdopen result. + + The following changes simplify porting to non-Posix environments. + * cmp.c, diff.c, diff3.c, sdiff.c, (main): Call initialize_main first. + * diff.c (binary_I_O): New variable for --binary option. + (main, usage, compare_files): Support --binary option. + (compare_files): Use filename_lastdirchar to find last + directory char in a file name. + * cmp.c (main), diff.c (compare_files), dir.c (compare_names, + diff_dirs): Use filename_cmp to compare file names. + Use same_file to determine whether two files are the same. + * context.c (print_context_label): Check whether ctime yields 0. + * diff3.c (read_diff), sdiff.c (cleanup, main, waitpid), + util.c (begin_output): Use popen+pclose if !HAVE_FORK. + * io.c (sip): If HAVE_SETMODE, test for binary files in O_BINARY mode. + * sdiff.c (ck_fdopen): Function removed. + (edit): Use system if !HAVE_FORK. + (execdiff): Now assumes caller has pushed all args, plus trailing 0. + All callers changed. + (private_tempnam): Try TMP if TMPDIR isn't defined. + Fit temporary filenames into 8.3 limit. + * system.h (STAT_BLOCKSIZE): Don't define if already defined. + (min, max): Undef if already defined. + (filename_cmp, filename_lastdirchar, HAVE_FORK, HAVE_SETMODE, + initialize_main, O_BINARY, same_file): New macros. + +Fri Jun 17 11:23:53 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) + + * Makefile.in (info, dvi, diff.dvi): New targets. + (clean): Remove TeX output files. + +Fri Jun 17 05:37:52 1994 Paul Eggert (eggert@twinsun.com) + + * cmp.c, io.c (word): Change from typedef to #define, to avoid + collision with Unicos 8.0 , which also typedefs `word'. + +Thu Apr 15 00:53:01 1994 Paul Eggert (eggert@twinsun.com) + + * diff3.c (scan_diff_line), util.c (print_number_range): Don't + rely on promotion to make the old-style parameter type agree + with the prototype parameter type; this doesn't work on + Apollos running bsd4.3. + +Mon Jan 3 02:05:51 1994 Paul Eggert (eggert@twinsun.com) + + * Makefile.in (LDFLAGS): Remove -g. Change all link commands + to use both $(CFLAGS) and $(LDFLAGS). + +Mon Dec 13 12:23:27 1993 Paul Eggert (eggert@twinsun.com) + + * system.h: Don't assume dirent.h exists just because + _POSIX_VERSION is defined. + +Fri Dec 3 18:39:39 1993 Paul Eggert (eggert@twinsun.com) + + * diff.c (main): allow -pu. + +Tue Nov 23 03:51:08 1993 Paul Eggert (eggert@twinsun.com) + + * Makefile.in (distclean): Remove config.h. + +Wed Nov 10 00:28:27 1993 Paul Eggert (eggert@twinsun.com) + + * Version 2.6 released. + + * analyze.c (too_expensive): New variable, for heuristic to + limit the worst-case cost to O(N**1.5 log N) at the price of + producing suboptimal output for large inputs with many differences. + (diff_2_files): Initialize it. + (struct partition): New type. + (SNAKE_LIMIT): New macro; merely documents already-used number 20. + (diag): New `minimal' arg; all callers changed. Put results into + struct partition. Apply `too_expensive' heuristic. Tune. + (compareseq): New `minimal' arg; all callers changed. Tune. + (shift_boundaries): Improve heuristic to also coalesce adjacent runs + of changes more often. + + * diff.c (long_options, main, usage): Add `--help'. + (main): Send version number to stdout, not stderr. + (usage): Send usage to stdout, not stderr. + (compare_files): Initialize `inf' properly. + + * io.c (word): Change to `int'; it makes a big difference on x86. + (sip, slurp): Put off allocating room to hold the whole file until we + have to read the whole file. This wins if the file turns out + to be binary. + + * util.c (xmalloc, xrealloc): "virtual memory" -> "memory" + (primes): Omit large primes if INT_MAX is small. + + * sdiff.c (usage): Send usage to stdout, not stderr. + (long_options, main, usage): Add `--help'. + (main): Send version number to stdout, not stderr. Exit afterwards. + + * diff3.c (usage): Send usage to stdout, not stderr. + (long_options, main, usage): Add `--help'. + (read_diff): Detect integer overflow in buffer size calculations. + + * cmp.c (word): New type. All uses of `long' for + word-at-a-time comparisons changed to `word'. + (long_options, main, usage): Add `--help'. + (usage): Send usage to stdout, not stderr. + (main): Add `-v'. Send version number to stdout, not stderr. + + * configure.in (AC_HAVE_HEADERS): Add unistd.h; remove AC_UNISTD_H. + +Mon Sep 27 07:20:24 1993 Paul Eggert (eggert@twinsun.com) + + * diff.c (add_exclude_file): Cast memchr to (char *) + to suppress bogus warnings on some nonstandard hosts. + + * Makefile.in (cmp): Add version.o. + + * analyze.c (diff_2_files): Work around memcmp bug with size=0. + + * cmp.c (main, usage, version_string): Add --version option. + + * system.h (malloc, realloc): Declare only if !HAVE_STDLIB_H. + (memchr): Declare only if !HAVE_MEMCHR. These changes are + needed to keep some nonstandard hosts happy. + + * util.c (memchr): Make first arg char const * + to match standard. + (xmalloc, xrealloc): Cast malloc, realloc + to (VOID *) to suppress bogus warnings on some nonstandard hosts. + + * diff3.c (xmalloc, xrealloc): Cast malloc, realloc + to (VOID *) to suppress bogus warnings on some nonstandard hosts. + + * sdiff.c (xmalloc, xrealloc): Cast malloc, realloc + to (VOID *) to suppress bogus warnings on some nonstandard hosts. + (lf_copy, lf_skip, lf_snarf): Cast memchr to (char *) + to suppress bogus warnings on some nonstandard hosts. + (memchr): Make first arg char const * + to match standard. + +Mon Sep 27 00:23:37 1993 Paul Eggert (eggert@twinsun.com) + + * Version 2.5 released. + + * analyze.c (diff_2_files): Work around memcmp bug with size=0. + + * cmp.c (main, usage, version_string): Add --version option. + * Makefile.in (cmp): Add version.o. + + * diff.c (add_exclude_file): Cast memchr to (char *) + to suppress bogus warnings on some nonstandard hosts. + * sdiff.c (lf_copy, lf_skip, lf_snarf): Likewise. + + * diff3.c, sdiff.c, util.c (xmalloc, xrealloc): Cast malloc, realloc + to (VOID *) to suppress bogus warnings on some nonstandard hosts. + + * sdiff.c, util.c (memchr): Make first arg char const * + to match standard. + + * system.h (malloc, realloc): Declare only if !HAVE_STDLIB_H. + (memchr): Declare only if !HAVE_MEMCHR. These changes are + needed to keep some nonstandard hosts happy. + + * xmalloc.c: Include always; some nonstandard hosts + need it for size_t even if STDC_HEADERS. + +Sat Sep 18 01:33:07 1993 Paul Eggert (eggert@twinsun.com) + + * configure.in (AC_STAT_MACROS_BROKEN): Add. + * system.h (S_IS{BLK,CHR,DIR,FIFO,REG,SOCK}): Fix defns if + STAT_MACROS_BROKEN. + + * Makefile.in (diff3, sdiff, cmp): Do not link $(ALLOCA). + + * analyze.c (discard_confusing_lines): Make defn static, like decl. + * sdiff.c (xmalloc): Likewise. + + * ifdef.c (format_group): Ensure isdigit argument isn't < 0. + + * side.c (print_half_line): Use isprint, since some hosts lack isgraph. + * util.c (output_1_line): Likewise. Ensure its argument isn't < 0. + (xmalloc, xrealloc): Remove needless casts. + + * system.h (volatile, const): + Define these before including any system headers, + so that they're used consistently in all system includes. + (getenv, malloc, realloc): Declare even if HAVE_STDLIB_H, since some + s don't declare them. + (memchr): Likewise for . + + * cmp.c, diff3.c, diff.h, sdiff.c: Include "system.h" first. + * diff.c: Remove redundant "system.h" inclusion. + + * diff3.c (xmalloc): Now static. + (xmalloc, realloc): Remove needless casts. + (READNUM): Ensure isdigit argument isn't negative. + +Wed Sep 14 07:14:15 1993 Paul Eggert (eggert@twinsun.com) + + * Version 2.4 released. + + * ifdef.c (scan_char_literal): New function, for new %c'x' and + %c'\ooo' format specs. + (format_group, print_ifdef_lines): Use it. Remove %0 format spec. + + * cmp.c (cmp): Don't try to read past end of file; this doesn't + work on ttys. + + * system.h, version.c: #include , not "config.h", to allow + configuring in a separate directory when the source directory has + already been configured. + * Makefile.in (COMPILE): New defn, with proper -I options so that + `#include ' works. + (.c.o, diff3.o, sdiff.o): Use it. + +Mon Sep 13 06:45:43 1993 Paul Eggert (eggert@twinsun.com) + + * diff.c (main, longopts): Add --line-format=FORMAT option. + (specify_format): Args no longer const pointers. All callers changed. + + * ifdef.c: Add support for %?c, %(A=B?T:E), PRINTF_SPECn formats. + (struct group): New struct. + (print_ifdef_lines): Use it to simplify argument passing. + Remove the convention that last arg -1 signifies that the lines + from file 2 are the same as the lines from file 1; this + convention no longer works, now that line numbers might be + printed out, since the line numbers may differ. + Add first FILE * argument to output to. All callers changed. + Use a faster test for the single-fwrite optimization. + (format_group, scan_printf_spec, groups_letter_value): New functions. + + * diff.h (group_format, line_format): No longer const pointers. + (format_ifdef): 1st arg is no longer const pointer. + + * configure.in: Configure HAVE_LIMITS_H, HAVE_STDLIB_H. + * system.h , , : + Include only if HAVE_LIMITS_H etc. + + * system.h (memcmp, memcpy, strchr, strrchr, struct dirent): Prefer + these standard names to the traditional names (bcmp, bcpy, index, + rindex, struct direct). All callers changed. + + * system.h (PARAMS, VOID): + Define earlier so that malloc decl can use VOID. + (STAT_BLOCKSIZE): Simplify ersatz defn; just use 8K. + +Fri Sep 3 00:21:02 1993 Paul Eggert (eggert@twinsun.com) + + * diff.c (compare_files): Two files with the same name must be + the same file; avoid a needless `stat' in that case. + +Fri Aug 27 06:59:03 1993 Paul Eggert (eggert@twinsun.com) + + * Pervasive changes for portability to 64-bit hosts: + Add prototypes to function declarations. + Use size_t, not int, when needed. + + * Other pervasive changes: + Use `const' more often. + Use STD{IN,OUT,ERR}_FILENO instead of [012]. + Use 0, not NULL, for portability to broken hosts. + + * Makefile.in: (srcs, objs, distfiles, cmp): New files cmpbuf.[ch]. + (distfiles): New files config.h.in, mkinstalldirs. + (.c.o): Add -DHAVE_CONFIG_H. + + * analyze.c: (diag): Pacify `gcc -Wall' with a useless assignment. + (diff_2_files): Use l.c.m., not max, of files' buffer sizes. + + * cmp.c: Make globals static when possible. + + (file): Now a 2-element array; replaces `file1' and `file2'. + (file_desc, buffer): Likewise, for file[12]_desc and buf[12]. + (main): Likewise, for stat_buf[12]. Index these variables with `i'. + + (ignore_initial): New var. + (long_options): Now const. Add `--ignore-initial'. + (usage): Sort options and add `--ignore-initial'. + (main, cmp): Add `--ignore-initial' support. + + (main): `cmp - -' now succeeds. + When comparing standard input to a file, and using a shortcut (e.g. + looking at file sizes or inode numbers), take the lseek offset into + account before deciding whether the files are identical. + Avoid mentioning `dev_t', `ino_t' for portability to nonstandard hosts. + Use l.c.m. of files' buffer sizes, not 8 * 1024. + ferror (stdout) does not imply errno has a useful value. + If 2nd file is "-", treat it first, in case stdin is closed. + + (cmp): Always compute `char_number', `smaller' for speed and simplicity. + Say `cmp: EOF on input', not `/usr/gnu/bin/cmp: EOF on input', + as per Posix.2. + + (block_compare_and_count): Increment line_number argument. + Remove end_char argument; it's always '\n'. All callers changed. + Do not assume sizeof(long) == 4; this isn't true on some 64-bit hosts. + (block_compare): Minimize differences with block_compare_and_count. + + (block_read): Coalesce `bp += nread's. + + (printc): Remove `FILE *' arg; output to stdout. All callers changed. + + * configure.in: Configure HAVE_SIGACTION, RETSIGTYPE, HAVE_VPRINTF. + Configure into config.h. + + * context.c (print_context_label): + Standard input's st_mtime is no longer a special case + here, since `compare_files' now sets it to the current time. + + * diff.c (usage): Sort options. + (filetype): New function. + (compare_files): Set stdin's st_mtime to be the current time. + Leave its name "-" instead of changing it to "Standard Input"; + to test whether a file is stdin, we must compare its name to "-" instead + of its desc to 0, since if it's closed other file descs may be 0. + When comparing standard input to a file, and using a shortcut (e.g. + looking at file sizes or inode numbers), take the lseek offset into + account before deciding whether the files are identical. + Pretend that nonexistent files have the same filetype as existing files. + Rename `errorcount' to `failed', since it's boolean. + In directory comparisons, if a file is neither a regular file nor a + directory, just print its type and the other file's type. + + * diff.h (Is_space, textchar): Remove. + (struct msg, msg_chain, msg_chain_end): Move to util.c. + (VOID): Move to system.h. + (line_cmp, version_string, change_letter, print_number_range, + find_change): New decls. + + * diff.texi: + whitespace -> white space. It now stands for whatever isspace yields. + Add --ignore-initial. + + * diff3.c (VOID): Move to system.h. + (version_string): Now char[]. + (usage): Sort options. + (process_diff): Pacify `gcc -Wall' with a useless assignment. + (read_diff): pid is of type pid_t, not int. Use waitpid if available. + (output_diff3): Simplify test for `\ No newline at end of file' message. + + * dir.c (struct dirdata): Rename `files' to `names' to avoid confusion + with external struct file_data `files'. + + * io.c (line_cmp): Move declaration to diff.h. + (textchar): Remove. + (find_and_hash_each_line): Use locale's definition of white space + instead of using one hardwired defn for -b and another for -w. + + * normal.c (change_letter, print_number_range, find_change): + Move decls to diff.h. + (print_normal_hunk): Now static. + + * sdiff.c (SEEK_SET): Move to system.h. + (version_string): Now char[], not char*. + (private_tempnam): Remove hardcoded limit on temporary file names. + (exiterr, perror_fatal, main): When exiting because of a signal, + exit with that signal's status. + (lf_refill, main, skip_white, edit, interact): Check for signal. + (ignore_SIGINT): Renamed from `ignore_signals'. + (NUM_SIGS, initial_handler): New macros. + (initial_action, signal_received, sigs_trapped): New vars. + (catchsig, trapsigs): Use sigaction if possible, since this closes the + windows of vulnerability that `signal' has. Use RETSIGTYPE not void. + When a signal comes in, just set a global variable; this is safer. + (checksigs, untrapsig): New functions. + (edit): Pacify `gcc -Wall' with a useless assignment. + Respond to each empty line with help, not to every other empty line. + (private_tempnam): Remove hardcoded limit on temporary file name length. + Don't assume sizeof (pid_t) <= sizeof (int). + + * system.h: (S_IXOTH, S_IXGRP, S_IXUSR, + SEEK_SET, SEEK_CUR, + STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): + New macros, if system doesn't define them. + (volatile): Don't define if already defined. + (PARAMS): New macro. + (VOID): Move here from diff.h. + + * util.c (struct msg, msg_chain, msg_chain_end): Moved here from diff.h. + (message5): New function. + (pr_pid): New var. + (begin_output): Allocate `name' more precisely. + Put child pid into pr_pid, so that we can wait for it later. + Don't check execl's return value, since any return must be an error. + (finish_output): Detect and report output errors. + Use waitpid if available. Check pr exit status. + (line_cmp): Use locale's definition of white space + instead of using one hardwired defn for -b and another for -w. + (analyze_cmp): Avoid double negation with `! nontrivial'. + Pacify `gcc -Wall' be rewriting for-loop into do-while-loop. + (dir_file_pathname): New function. + + * version.c (version_string): Now char[], not char*. + +Thu Jul 29 20:44:30 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + + * Makefile.in (config.status): Run config.status --recheck, not + configure, to get the right args passed. + +Thu Jul 22 10:46:30 1993 Paul Eggert (eggert@twinsun.com) + + * Makefile.in (dist): Replace `if [ ! TEST ]; then ACTION; fi' + with `[ TEST ] || ACTION || exit' so that the containing for-loop exits + with proper status for `make'. + +Thu Jul 8 19:47:22 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * Makefile.in (installdirs): New target. + (install): Use it. + (Makefile, config.status, configure): New targets. + +Sat Jun 5 23:10:40 1993 Paul Eggert (eggert@twinsun.com) + + * Makefile.in (dist): Switch from .z to .gz. + +Wed May 26 17:16:02 1993 Paul Eggert (eggert@twinsun.com) + + * diff.c (main): Cast args to compare_files, for traditional C. + * side.c (print_sdiff_common_lines, print_sdiff_hunk): Likewise. + * analyze.c, diff3.c, sdiff.c, util.c: Don't assume NULL is defined + properly. + +Tue May 25 14:54:05 1993 Paul Eggert (eggert@twinsun.com) + + * analyze.c (diff_2_files): With -q, do not report that files differ + if all their differences are ignored. + (briefly_report): New function. + * diff.h (ignore_some_changes): New variable. + * diff.c (compare_files): Don't use the file size shortcut if + ignore_some_changes is nonzero, since the file size may differ + merely due to ignored changes. + (main): Set ignore_some_changes if we might ignore some changes. + Remove unsystematic assignment of 0 to static vars. + * io.c (read_files): New argument PRETEND_BINARY says whether to + pretend the files are binary. + + * diff3.c (tab_align_flag): New variable, for new -T option. + (main, usage, output_diff3): Add support for -T. + +Sun May 23 15:25:29 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * dir.c (dir_sort): Always init `data' to avoid GCC warning. + +Sat May 22 15:35:02 1993 Paul Eggert (eggert@twinsun.com) + + * Makefile.in (dist): Change name of package from diff to diffutils. + Don't bother to build .Z dist; .z suffices. + +Fri May 21 16:35:22 1993 Paul Eggert (eggert@twinsun.com) + + * diff.c: Include "system.h" to get memchr declaration. + * system.h (memchr): Declare if !HAVE_MEMCHR, not if + !HAVE_MEMCHR && !STDC_HEADERS. + +Wed May 19 17:43:55 1993 Paul Eggert (eggert@twinsun.com) + + * Version 2.3 released. + +Fri Apr 23 17:18:44 1993 Paul Eggert (eggert@twinsun.com) + + * io.c (find_identical_ends): Do not discard the last HORIZON_LINES + lines of the prefix, or the first HORIZON_LINES lines of the suffix. + * diff.c (main, longopts, usage): Add --horizon-lines option. + * diff3.c (main, process_diff, read_diff): Invoke second diff + with --horizon-lines determined by the first diff. + * diff.h, diff3.c (horizon_lines): New variable. + +Mon Mar 22 16:16:00 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * system.h [HAVE_STRING_H || STDC_HEADERS] (bcopy, bcmp, bzero): + Don't define if already defined. + +Fri Mar 5 00:20:16 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * diff.c (main): Use NULL in arg to compare_files. + +Thu Feb 25 15:26:01 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * system.h: Declare memchr #if !HAVE_MEMCHR && !STDC_HEADERS, + not #if !HAVE_MEMCHR || !STDC_HEADERS. + +Mon Feb 22 15:04:46 1993 Richard Stallman (rms@geech.gnu.ai.mit.edu) + + * io.c (find_identical_ends): Move complicated arg outside GUESS_LINES. + +Mon Feb 22 12:56:12 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Makefile.in (.c.o): Add -I$(srcdir); put $(CFLAGS) last before $<. + +Sat Feb 20 19:18:56 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * io.c (binary_file_p): Return zero if file size is zero. + +Fri Feb 19 17:31:32 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * Version 2.2 released. + + * system.h [HAVE_STRING_H || STDC_HEADERS] (index, rindex): Don't + define if already defined. + +Wed Feb 17 17:08:00 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Makefile.in (srcs): Remove limits.h. + +Thu Feb 11 03:36:00 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * diff3.c (xmalloc): No longer static. + + * sdiff.c (edit): Allocate buf dynamically. + + * dir.c (dir_sort): Handle VOID_CLOSEDIR. + +Wed Feb 10 00:15:54 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * limits.h: File deleted (should never have been there). + +Tue Feb 9 03:53:22 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * Makefile.in (.c.o, diff3.o, sdiff.o): Put $(CFLAGS) last. + +Wed Feb 3 15:42:10 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * system.h: Don't #define const; let configure do it. + +Mon Feb 1 02:13:23 1993 Paul Eggert (eggert@hal.gnu.ai.mit.edu) + + * Version 2.1 released. + + * Makefile.in (dist): Survive ln failures. Create .tar.z + (gzipped tar) file as well as .tar.Z (compressed tar) file. + +Fri Jan 8 22:31:41 1993 Paul Eggert (eggert@twinsun.com) + + * side.c (print_half_line): When the input position falls + outside the column, do not output a tab even if the output + position still falls within the column. + +Mon Dec 21 13:54:36 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * Makefile.in (.c.o): Add -I. + +Fri Dec 18 14:08:20 1992 Paul Eggert (eggert@twinsun.com) + + * configure.in: Add HAVE_FCNTL_H, since system.h uses it. + +Tue Nov 24 10:06:48 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * Makefile.in: Note change from USG to HAVE_STRING_H. + +Mon Nov 23 18:44:00 1992 Paul Eggert (eggert@twinsun.com) + + * io.c (find_and_hash_each_line): When running out of lines, + double the number of allocated lines, instead of just doubling + that number minus the prefix lines. This is more likely to + avoid the need for further memory allocation. + +Wed Nov 18 20:40:28 1992 Paul Eggert (eggert@twinsun.com) + + * dir.c (dir_sort): Plug memory leak: space holding directory + contents was not being reclaimed. Get directory size from + struct file_data for initial guess at memory needed. + Detect errors when reading and closing directory. + (diff_dirs): Pass struct file_data to dir_sort. Finish plugging leak. + * diff.c (compare_files): Pass struct file_data to diff_dirs. + + * io.c (find_and_hash_each_line): Don't assume alloc_lines is + nonzero when allocating more lines. + +Thu Nov 12 16:02:18 1992 Paul Eggert (eggert@twinsun.com) + + * diff.c (main): Add `-U lines' as an alias for `--unified=lines'. + + * diff3.c (usage): Add third --label option in example. + + * util.c (analyze_hunk): Fix test for ignoring blank lines. + + * configure.in, system.h: Avoid USG; use HAVE_TIME_H etc. instead. + +Mon Nov 9 05:13:25 1992 Paul Eggert (eggert@twinsun.com) + + * diff3.c (main, usage): Add -A or --show-all. + -m now defaults to -A, not -E. Allow up to three -L options. + (output_diff3_edscript, output_diff3_merge): + Remove spurious differences between these two functions. + Output ||||||| for -A. Distinguish between conflicts and overlaps. + (dotlines, undotlines): New functions that output `Ns', not `N,Ns'. + (output_diff3_edscript, output_diff3_merge): Use them. + + * io.c (find_identical_ends): shift_boundaries needs an extra + identical line at the end, not at the beginning. + + * sdiff.c (edit): execvp wants char **, not const char **. + +Mon Oct 19 04:39:32 1992 Paul Eggert (eggert@twinsun.com) + + * context.c (print_context_script, find_function): Context + line numbers start with - file->prefix_lines, not 0. + + * io.c (binary_file_p): Undo last change; it was a library bug. + +Sun Oct 18 00:17:29 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * io.c (binary_file_p): Consider empty file as non-binary. + +Mon Oct 5 05:18:46 1992 Paul Eggert (eggert@twinsun.com) + + * diff3.c (main, make_3way_diff, using_to_diff3_block): Don't + report bogus differences (for one of -mexEX3) just because the + file0-file1 diffs don't line up with the file0-file2 diffs. + (This is entirely possible since we don't use diff's -n + option.) Always compare file1 to file2, so that diff3 sees + those changes directly. Typically, file2 is now the common + file, not file0. + (output_diff3_merge): The input file is file 0, not the common file. + + (FC, FO): New macros; they replace FILE1, FILE0 for two-way diffs, + to distinguish them from three-way diffs. + + * diff3.c (using_to_diff3_block): Fold repeated code into loops. + + * diff3.c (make_3way_diff, process_diff): Have the *_end + variable point to the next field to be changed, not to the last + object allocated; this saves an if-then-else. + + * diff3.c (process_diff): Use D_NUMLINES instead of its definiens. + + * diff3.c: Make fns and vars static unless they must be external. + +Wed Sep 30 09:21:59 1992 Paul Eggert (eggert@twinsun.com) + + * analyze.c (diff_2_files): OUTPUT_IFDEF is now robust. + * diff.h (ROBUST_OUTPUT_STYLE): Likewise. + (default_line_format): Remove. All refs removed. + + * ifdef.c (print_ifdef_lines): Add %L. Optimize %l\n even if user + specified it, as opposed to its being the default. + +Tue Sep 29 19:01:28 1992 Paul Eggert (eggert@twinsun.com) + + * diff.c (longopts, main): --{old,new,unchanged,changed}--group-format + are new options, so that -D is no longer overloaded. Set + no_diff_means_no_output if --unchanged-{line,group}-format allows it. + * diff.h (enum line_class): New type. + (group_format, line_format): Use it to regularize option flags. + All refs changed. + + * ifdef.c (format_ifdef, print_ifdef_lines): %n is no longer a format. + +Mon Sep 28 04:51:42 1992 Paul Eggert (eggert@twinsun.com) + + * diff.c (main, usage): Replace --line-prefix with the more general + --{old,new,unchanged}-line-format options. + * ifdef.c (format_ifdef, print_ifdef_lines): Likewise. + * diff.h (line_format): Renamed from line_prefix. All refs changed. + * diff.h, ifdef.c (default_line_format): New variable. + * util.c (output_1_line): New function. + (print_1_line): Use it. + + * ifdef.c: (format_ifdef, print_ifdef_lines): Add %0 format. + +Sun Sep 27 05:38:13 1992 Paul Eggert (eggert@twinsun.com) + + * diff.c (main): Add -E or --line-prefix option. Add -D'=xxx' + for common lines. Change default -D< format from copy of -D> + format to to -D<%<; similarly for default -D> format. + * diff.h (common_format, line_prefix): New variables. + * ifdef.c (format_ifdef): New function. + (print_ifdef_script, print_ifdef_hunk, print_ifdef_lines): + Use it for -D'=xxx', -E. + + * context.c (find_hunk): Glue together two non-ignorable changes that + are exactly CONTEXT * 2 lines apart. This shortens output, removes + a behavioral discontinuity at CONTEXT = 0, and is more compatible + with traditional diff. + + * io.c (find_identical_ends): Slurp stdin at most once. + + * util.c (print_line_line): line_flag is const char *. + +Thu Sep 24 15:18:07 1992 Paul Eggert (eggert@twinsun.com) + + * ifdef.c (print_ifdef_lines): New function, which fwrites a sequence + of lines all at once for speed. + (print_ifdef_script, print_ifdef_hunk): Use it. + +Thu Sep 24 05:54:14 1992 Paul Eggert (eggert@twinsun.com) + + * diff.c (main): Support new -D options for if-then-else formats. + (specify_format): New function. + * diff.h (ifndef_format, ifdef_format, ifnelse_format): New variables. + * ifdef.c (print_ifdef_hunk): Use the new variables instead of + a hardwired format. + + * side.c (print_1sdiff_line): Represent incomplete lines on output. + (print_sdiff_script): Likewise. Don't print 'q' at end, + since that doesn't work with incomplete lines. + * sdiff.c (interact): Don't assume diff output ends with 'q' line. + * diff.h (ROBUST_OUTPUT_STYLE): OUTPUT_SDIFF is now robust. + + * sdiff.c (lf_copy, lf_snarf): Use memchr instead of index, + to avoid dumping core when files contain null characters. + (memchr): New function (if memchr is missing). + + * io.c (sip): New arg SKIP_TEST to skip test for binary file. + (read_files): Don't bother testing second file if first is binary. + +Thu Sep 17 21:17:49 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * system.h [!USG && !_POSIX_VERSION]: Protect from conflicting + prototype for wait in sys/wait.h. + +Wed Sep 16 12:32:18 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * Makefile.in: Include binprefix in -DDIFF_PROGRAM. + +Tue Sep 15 14:27:25 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * Version 2.0. + +Sat Sep 12 01:31:19 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * util.c, diff.h, system.h [!HAVE_MEMCHR]: Don't use void * + and const when declaring memchr replacement. Declare memchr + if !STDC_HEADERS && !USG. + +Thu Sep 10 15:17:32 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * Makefile.in (uninstall): New target. + + * diff.c (excluded_filename): Use fnmatch, not wildmat. + (usage): Document -x, -X, --exclude, --exclude-from. + Makefile.in: Use fnmatch.c, not wildmat.c. + +Sun Sep 6 23:46:25 1992 Paul Eggert (eggert@twinsun.com) + + * configure.in: Add HAVE_MEMCHR. + * diff.h, util.c: Use it instead of MEMCHR_MISSING. + +Sun Sep 6 07:25:49 1992 Paul Eggert (eggert@twinsun.com) + + * diff.h: (struct line_def): Replace this 3-word struct with char *. + This uses less memory, particularly for large files with short lines. + (struct file_data): New member linbuf_base counts number of lines + in common prefix that are not recorded in linbuf; + this uses less memory if files are identical or differ only at end. + New member buffered_lines counts possibly differing lines. + New member valid_lines counts valid data. + New member alloc_lines - linbuf_base replaces old linbufsize. + linbuf[0] now always points at first differing line. + Remove unused members ltran, suffix_lines. + Add const where appropriate. + (Is_space): New macro, for consistent definition of `white space'. + (excluded_filename, memchr, sip, slurp): New declarations. + * ed.c (print_ed_hunk): Adjust to diff.h's struct changes. + * context.c (pr_context_hunk): Likewise. + * ifdef.c (print_ifdef_script): Likewise. + * side.c (print_sdiff_script, print_half_line): Likewise. + * util.c (analyze_hunk, line_cmp, print_1_line): Likewise. + + * analyze.c (shift_boundaries): Remove unneeded variable `end' and + unnecessary comparisons of `preceding' and `other_preceding' against 0. + (diff_2_files): When comparing files byte-by-byte for equality, + don't slurp them all in at once; just compare them a buffer at a time. + This can win big if they differ early on. + Move some code to compare_files to enable this change. + Use only one buffer for stdin with `diff - -'. + (discard_confusing_lines, diff_2_files): Coalesce malloc/free calls. + (build_script): Remove obsolete OUTPUT_RCS code. + + * diff.c (add_exclude, add_exclude_file, excluded_filename): New fns. + (main): Use them for the new --exclude and --exclude-from options. + (compare_files): Don't open a file unless it must be read. + Treat `diff file file' and `diff file dir' similarly. + Move some code here from diff_2_files to enable this. + Simplify file vs dir warning. + + * dir.c (dir_sort): Support new --exclude* options. + + * io.c (struct equivclass): Put hash code and line length here instead + of struct line_def, so that they can be shared. + (find_and_hash_each_line): Compute equivalence class as we go, + instead of doing it in a separate pass; this thrashes memory less. + Make buckets realloc-able, since we can't preallocate them. + Record one more line start than there are lines, so that we can compute + any line's length by subtracting its start from the next line's, + instead of storing the length explicitly. This saves memory. + Move prefix-handling code to find_identical_ends; + this wins with large prefixes. + Use Is_space, not is_space, for consistent treatment of white space. + (prepare_text_end): New function. + (find_identical_ends): Move slurping here, so it's only done when + needed. Work even if the buffers are the same (because of `diff - -'). + Compare prefixes a word at a time for speed. + (find_equiv_class): Delete; now done by find_and_hash_each_line. + (read_files): Don't slurp unless needed. + find_equiv_class's work is now folded into find_and_hash_each_line. + Don't copy stdin buffer if `diff - -'. + Check for running out of primes. + (sip, slurp): Split first part of `slurp' into another function `sip'. + `sip' sets things up and perhaps reads the first ST_BLKSIZE buffer to + see whether the file is binary; `slurp' now just finishes the job. + This lets diff_2_files compare binary files lazily. + Allocate a one-word sentinel to allow word-at-a-time prefix comparison. + Count prefix lines only if needed, only count the first file's prefix. + Don't bother to count suffix lines; it's never needed. + Set up linbuf[0] to point at first differing line. + (binary_file_p): Change test for binary files: + if it has a null byte in its first buffer, it's binary. + (primes): Add more primes. + + * util.c (line_cmp): Use bcmp for speed. + Use Is_space, not is_space, for consistent treatment of white space. + (translate_line_number): Internal line numbers now count from 0 + starting after the prefix. + (memchr): New function (if memchr is missing). + + * Makefile.in: Document HAVE_ST_BLKSIZE. Link with wildmat.o. + * system.h (STAT_BLOCKSIZE): New macro based on HAVE_ST_BLKSIZE. + * configure.in: Add AC_ST_BLKSIZE. + * wildmat.c: New file. + +Fri Sep 4 01:28:51 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * sdiff.c (xmalloc): Renamed from ck_malloc. Callers changed. + +Thu Sep 3 15:28:59 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * diff.h: Don't declare free, index, rindex. + +Tue Aug 11 22:18:06 1992 John Gilmore (gnu at cygnus.com) + + * io.c (binary_file_p): Use heuristic to avoid declaring info + files as binary files. Allow about 1.5% non-printing + characters (in info's case, ^_). + +Tue Jul 7 01:09:26 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * diff.h: Replace function_regexp and ignore_regexp with lists + of compiled regexps. + * analyze.c, context.c, util.c: Test whether the lists, not + the old variables, are empty. + * util.c (analyze_hunk), context.c (find_function): Compare + lines with the lists of regexps. + * diff.c (add_regexp): New function. + (main): Use it. + + * diff3: Add -v --version option. + * Makefile.in: Link with version.o. + + * system.h: New file. + * diff.h, cmp.c, diff3.c, sdiff.c: Use it. + + * diff.h, diff3.c: Include string.h or strings.h, as appropriate. + Declare malloc and realloc. + + * diff3.c (perror_with_exit): Include program name in message. + + * diff3.c: Lowercase error messages for GNU standards. + + * sdiff.c [USG || STDC_HEADERS]: Define bcopy in terms of memcpy. + + * sdiff.c: Use the version number from version.c. + * Makefile.in: Link with version.o. + + * cmp.c error.c xmalloc.c: New files from textutils. + * Makefile.in: Add rules for them. + + * diff.c (longopts): --unidirectional-new-file is like -P, not -N. + Rename --file-label to --label (leave old name, but undocumented). + + * sdiff.c, diff.c (usage): Condense messages and fix some errors. + + * diff3.c (main, usage): Add long-named options. + +Fri Jul 3 14:31:18 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * diff.h, diff3.c, sdiff.c: Change FOO_MISSING macros to HAVE_FOO. + +Thu Jun 25 16:59:47 1992 David J. MacKenzie (djm@apple-gunkies.gnu.ai.mit.edu) + + * diff.c: --reversed-ed -> --forward-ed. + +Wed Feb 26 12:17:32 1992 Paul Eggert (eggert@yata.uucp) + + * analyze.c, diff.c, diff.h, io.c: For -y, compare even if same file. + +Fri Feb 14 22:46:38 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * io.c, diff3.c, analyze.c: Add extra parentheses. + +Sun Feb 9 00:22:42 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * diff.h (unidirectional_new_file_flag): New variable. + * diff.c (main): Set that for -P. + (compare_files): Support -P, somewhat like -N. + (longopts): Support long name for -P. + +Sat Jan 4 20:10:34 1992 Paul Eggert (eggert at yata.uucp) + + * Makefile.in: Distribute diff.info-* too. + + * README, sdiff.c: version number now matches version.c. + + * configure: Fix and document vfork test. + + * ifdef.c: Don't dump core if `diff -Dx f f'. + +Mon Dec 23 23:36:08 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * diff.h, diff3.c, sdiff.c: Change POSIX ifdefs to + HAVE_UNISTD_H and _POSIX_VERSION. + +Wed Dec 18 17:00:31 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * Makefile.in (srcs): Add sdiff.c. + (tapefiles): Add diff.texi and diff.info. + + * diff.h, diff3.c, sdiff.c: Use HAVE_VFORK_H instead of + VFORK_HEADER and VFORK_WORKS. + +Tue Dec 17 00:02:59 1991 Paul Eggert (eggert at yata.uucp) + + * Makefile.in (all): Add diff.info, sdiff. + + * configure, diff.c, sdiff.c: + Prefix long options with `--', not `+'. + * diff.c: Regularize option names. + + * configure: Fix check for vfork. + * configure, diff.c, diff.h, diff3.c, sdiff.c: + Use Posix definitions when possible. + + * context.c: Align context with tab if -T is given. Tune. + * diff.c, diff.h, side.c: Calculate column widths so that tabs line up. + * io.c: Add distinction between white space and printing chars. + * side.c: Don't expand tabs unless -t is given. + * side.c, util.c: Tab expansion now knows about '\b', '\f', '\r', '\v'. + * util.c: -w skips all white space. Remove lint. Tune. + + * sdiff.c: Support many more diff options, e.g. `-', `sdiff file dir'. + Ignore interrupts while the subsidiary editor is in control. + Clean up temporary file and kill subsidiary diff if interrupted. + Ensure subsidiary diff doesn't ignore SIGPIPE. + Don't get confused while waiting for two subprocesses. + Don't let buffers overflow. Check for I/O errors. + Convert to GNU style. Tune. + + * sdiff.c, util.c: Don't lose errno. + Don't confuse sdiff with messages like `Binary files differ'. + * sdiff.c, side.c: Don't assume that common lines are identical. + Simplify --sdiff-merge-assist format. + +Mon Sep 16 16:42:01 1991 Tom Lord (lord at churchy.gnu.ai.mit.edu) + + * Makefile.in, sdiff.c: introduced sdiff front end to diff. + + * Makefile.in, analyze.c, diff.c, diff.h, io.c, side.c: Added + sdiff-style output format to diff. + +Mon Aug 26 16:44:55 1991 David J. MacKenzie (djm at pogo.gnu.ai.mit.edu) + + * Makefile.in, configure: Only put $< in Makefile if using VPATH, + because older makes don't understand it. + +Fri Aug 2 12:22:30 1991 David J. MacKenzie (djm at apple-gunkies) + + * configure: Create config.status. Remove it and Makefile if + interrupted while creating them. + +Thu Aug 1 22:24:31 1991 David J. MacKenzie (djm at apple-gunkies) + + * configure: Check for +srcdir etc. arg and look for + Makefile.in in that directory. Set VPATH if srcdir is not `.'. + * Makefile.in: Get rid of $(archpfx). + +Tue Jul 30 21:28:44 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) + + * Makefile.in (prefix): Renamed from DESTDIR. + +Wed Jul 24 23:08:56 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * diff.h, diff3.c: Rearrange ifdefs to use POSIX, + STDC_HEADERS, VFORK_MISSING, DIRENT. This way it works on + more systems that aren't pure USG or BSD. + Don't not define const if __GNUC__ is defined -- that would + break with -traditional. + * configure: Check for those features. + +Wed Jul 10 01:39:23 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * configure, Makefile.in: $(INSTALLPROG) -> $(INSTALL). + +Sat Jul 6 16:39:04 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) + + * Replace Makefile with configure and Makefile.in. + Update README with current compilation instructions. + +Sat Jul 6 14:03:29 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) + + * util.c (setup_output): Just save the args for later use. + (begin_output): Do the real work, with the values that were saved. + It's safe to call begin_output more than once. + Print the special headers for context format here. + * analyze.c (diff_2_files): Don't print special headers here. + * context.c (pr_context_hunk, pr_unidiff_hunk): Call begin_output. + * ed.c (print_ed_hunk, print_forward_ed_hunk, print_rcs_hunk): + * normal.c (print_normal_hunk): Likewise. + * ifdef.c (print_ifdef_hunk): Likewise. + * util.c (finish_output): Don't die if begin_output was not called. + +Thu Jun 20 23:10:01 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) + + * Makefile: Add TAGS, distclean, and realclean targets. + Set SHELL. + +Tue Apr 30 13:54:36 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) + + * diff.h (TRUE, FALSE): Undefine these before defining. + +Thu Mar 14 18:27:27 1991 Richard Stallman (rms@mole.ai.mit.edu) + + * Makefile (objs): Include $(ALLOCA). + +Sat Mar 9 22:34:03 1991 Richard Stallman (rms at mole.ai.mit.edu) + + * diff.h: Include regex.h. + +Thu Feb 28 18:59:53 1991 Richard Stallman (rms at mole.ai.mit.edu) + + * Makefile (diff3): Link with GNU getopt. + +Sat Feb 23 12:49:43 1991 Richard Stallman (rms at mole.ai.mit.edu) + + * io.c (find_equiv_class): Make hash code unsigned before mod. + + * diff.h (files): Add EXTERN. + +Sun Jan 13 21:33:01 1991 Richard Stallman (rms at mole.ai.mit.edu) + + * diff.c: +print option renamed +paginate. Remove +all-text. + +Mon Jan 7 06:18:01 1991 David J. MacKenzie (djm at geech.ai.mit.edu) + + * Makefile (dist): New target, replacing diff.tar and + diff.tar.Z, to encode version number in distribution directory + and tar file names. + +Sun Jan 6 18:42:23 1991 Michael I Bushnell (mib at geech.ai.mit.edu) + + * Version 1.15 released. + + * version.c: Updated from 1.15 alpha to 1.15 + + * context.c (print_context_number_range, + print_unidiff_number_range): Don't print N,M when N=M, print + just N instead. + + * README: Updated for version 1.15. + Makefile: Updated for version 1.15. + + * diff3.c (main): Don't get confused if one of the arguments + is a directory. + + * diff.c (compare_files): Don't get confused if comparing + standard input to a directory; print error instead. + + * analyze.c (diff_2_files), context.c (print_context_header, + print_context_script), diff.c (main), diff.h (enum + output_style): Tread unidiff as an output style in its own + right. This also generates an error when both -u and -c are + given. + + * diff.c (main): Better error messages when regexps are bad. + + * diff.c (compare_files): Don't assume stdin is opened. + + * diff3.c (read_diff): Don't assume things about the order of + descriptor assignment and closes. + + * util.c (setup_output): Don't assume things about the order + of descriptor assignment and closes. + + * diff.c (compare_files): Set a flag so that closes don't + happen more than once. + + * diff.c (main): Don't just flush stdout, do a close. That + way on broken systems we can still get errors. + +Mon Dec 24 16:24:17 1990 Richard Stallman (rms at mole.ai.mit.edu) + + * diff.c (usage): Use = for args of long options. + +Mon Dec 17 18:19:20 1990 Michael I Bushnell (mib at geech.ai.mit.edu) + + * context.c (print_context_label): Labels were interchanged badly. + + * context.c (pr_unidiff_hunk): Changes to deal with files + ending in incomplete lines. + * util.c (print_1_line): Other half of the changes. + +Mon Dec 3 14:23:55 1990 Richard Stallman (rms at mole.ai.mit.edu) + + * diff.c (longopts, usage): unidiff => unified. + +Wed Nov 7 17:13:08 1990 Richard Stallman (rms at mole.ai.mit.edu) + + * analyze.c (diff_2_files): No warnings about newlines for -D. + + * diff.c (pr_unidiff_hunk): Remove ref to output_patch_flag. + +Tue Oct 23 23:19:18 1990 Richard Stallman (rms at mole.ai.mit.edu) + + * diff.c (compare_files): For -D, compare even args are same file. + * analyze.c (diff_2_files): Likewise. + Also, output even if files have no differences. + + * analyze.c (diff_2_files): Print missing newline messages last. + Return 2 if a newline is missing. + Print them even if files end with identical text. + +Mon Oct 22 19:40:09 1990 Richard Stallman (rms at mole.ai.mit.edu) + + * diff.c (usage): Return 2. + +Wed Oct 10 20:54:04 1990 Richard Stallman (rms at mole.ai.mit.edu) + + * diff.c (longopts): Add +new-files. + +Sun Sep 23 22:49:29 1990 Richard Stallman (rms at mole.ai.mit.edu) + + * context.c (print_context_script): Handle unidiff_flag. + (print_context_header): Likewise. + (print_unidiff_number_range, pr_unidiff_hunk): New functions. + * diff.c (longopts): Add element for +unidiff. + (main): Handle +unidiff and -u. + (usage): Mention them. + +Wed Sep 5 16:33:22 1990 Richard Stallman (rms at mole.ai.mit.edu) + + * io.c (find_and_hash_each_line): Deal with missing final newline + after buffering necessary context lines. + +Sat Sep 1 16:32:32 1990 Richard Stallman (rms at mole.ai.mit.edu) + + * io.c (find_identical_ends): ROBUST_OUTPUT_FORMAT test was backward. + +Thu Aug 23 17:17:20 1990 Richard Stallman (rms at mole.ai.mit.edu) + + * diff3.c (WIFEXITED): Undef it if WEXITSTATUS is not defined. + * context.c (find_function): Don't try to return values. + +Wed Aug 22 11:54:39 1990 Richard Stallman (rms at mole.ai.mit.edu) + + * diff.h (O_RDONLY): Define if not defined. + +Tue Aug 21 13:49:26 1990 Richard Stallman (rms at mole.ai.mit.edu) + + * Handle -L option. + * context.c (print_context_label): New function. + (print_context_header): Use that. + * diff.c (main): Recognize the option. + (usage): Updated. + * diff.h (file_label): New variable. + * diff3.c (main): Recognize -L instead of -t. + + * diff3.c (main): Support -m without other option. + + * diff3.c (WEXITSTATUS, WIFEXITED): Define whenever not defined. + + * diff3.c (bcopy, index, rindex): Delete definitions; not used. + (D_LINENUM, D_LINELEN): Likewise. + (struct diff_block): lengths includes newlines. + (struct diff3_block): Likewise. + (always_text, merge): New variables. + (read_diff): Return address of end, not size read. Calls changed. + Pass -a to diff if given to diff3. + current_chunk_size now an int. Detect error in `pipe'. + Check for incomplete line of output here. + (scan_diff_line): Don't make scan_ptr + 2 before knowing it is valid. + No need to check validity of diff output here. + Include newline in length of line. + (main): Compute rev_mapping here. Handle -a and -m. + Error message if excess -t operands. Error for incompatible options. + Error if `-' given more than once. + Fix error storing in tag_strings. + (output_diff3): REV_MAPPING is now an arg. Call changed. + Change syntax of "missing newline" message. + Expect length of line to include newline. + (output_diff3_edscript): Return just 0 or 1. + REV_MAPPING is now an arg. Call changed. + (output_diff3_merge): New function. + (process_diff): Better error message for bad diff format. + (fatal, perror_with_exit): Return status 2. + + * analyze.c (diff_2_files): Report missing newline in either + or both files, if not robust output style. + + * util.c (setup_output): Detect error from pipe. + No need to close stdin. + + * util.c (print_1_line): Change format of missing-newline msg. + Change if statements to switch. + + * io.c (slurp): Don't mention differences in final newline if -B. + + * io.c (binary_file_p): Use ISO char set as criterion, not ASCII. + + * io.c (find_identical_ends): Increase value of BEG0 by 1. + Other changes in backwards scan to avoid decrementing pointers + before start of array, and set LINES properly. + + * diff.h (ROBUST_OUTPUT_STYLE): New macro. + * io.c (find_identical_ends, find_and_hash_each_line): Use that macro. + + * diff.h (dup2): Don't define if XENIX. + + * diff.c (main): Check for write error at end. + + * context.c (find_function): Don't return a value. + Use argument FILE rather than global files. + + * analyze.c: Add external function declarations. + * analyze.c (build_script): Turn off explicit check for final newline. + + * analyze.c (discard_confusing_lines): Make integers unsigned. + +Tue Jul 31 21:37:16 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * io.c (find_and_hash_each_line): Correct the criterion + for leaving out the newline from the end of the line. + +Tue May 29 21:28:16 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * dir.c (diff_dirs): Free things only if nonzero. + +Mon Apr 16 18:31:05 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * diff.h (NDIR_IN_SYS): New macro controls location of ndir.h. + + * diff3.c (xmalloc, xrealloc): Don't die if size == 0 returns 0. + +Sun Mar 25 15:58:42 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * analyze.c (discard_confusing_lines): + `many' wasn't being used; use it. + Canceling provisionals near start of run must handle already + canceled provisionals. + Canceling subruns of provisionals was canceling last nonprovisional. + +Sat Mar 24 14:02:51 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * analyze.c (discard_confusing_lines): + Threshold for line occurring many times scales by square root + of total lines. + Within each run, cancel any long subrun of provisionals. + Don't update `provisional' while canceling provisionals. + In big outer loop, handle provisional and nonprovisional separately. + +Thu Mar 22 16:35:33 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * analyze.c (discard_confusing_lines): + The first loops to discard provisionals from ends failed to step. + In second such loops, keep discarding all consecutive provisionals. + Increase threshold for stopping discarding, and also check for + consecutive nondiscardables as separate threshold. + +Fri Mar 16 00:33:08 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * diff3.c (read_diff): Pass -- as first arg to diff. + + * diff3.c: Include wait.h or define equivalent macros. + (read_diff): Don't use stdio printing error in the inferior. + Remember the pid and wait for it. Report failing status. + Report failure of vfork. + +Sun Mar 11 17:10:32 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * diff3.c (main): Accept -t options and pass to output_diff3_edscript. + (usage): Mention -t. + (read_diff): Use vfork. + (vfork): Don't use it on Sparc. + + * diff.h (vfork): Don't use it on Sparc. + +Tue Mar 6 22:37:20 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * diff3.c (dup2): Don't define on Xenix. + + * Makefile: Comments for Xenix. + +Thu Mar 1 17:19:23 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * analyze.c (diff_2_files): `message' requires three args. + +Fri Feb 23 10:56:50 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * diff.h, util.c, diff3.c: Change 'void *' to 'VOID *', with + VOID defined as void if __STDC__, char if not. + +Sun Feb 18 20:31:58 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * Makefile: Add rules for getopt.c, getopt1.c, getopt.h. + + * getopt.c, getopt.h, getopt1.c: New files. + + * main.c (main, usage): Add long options. + + * analyze.c (shift_boundaries): Remove unused var 'j_end'. + +Thu Feb 8 02:43:16 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * GNUmakefile: include ../Makerules before Makefile. + +Fri Feb 2 23:21:38 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * analyze.c (diff_2_files): If -B or -I, don't return 1 + if all changes were ignored. + +Wed Jan 24 20:43:57 1990 Richard Stallman (rms at albert.ai.mit.edu) + + * diff3.c (fatal): Output to stderr. + +Thu Jan 11 00:25:56 1990 David J. MacKenzie (djm at hobbes.ai.mit.edu) + + * diff.c (usage): Mention -v. + +Wed Jan 10 16:06:38 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * diff3.c (output_diff3_edscript): Return number of overlaps. + (main): If have overlaps, exit with status 1. + +Sun Dec 24 10:29:20 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * io.c (find_equiv_class): Fix typo that came from changing init of B + to an assignment. + + * version.c: New file. + * diff.c (main): -v prints version number. + + * io.c (binary_file_p): Null char implies binary file. + +Fri Nov 17 23:44:55 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * util.c (print_1_line): Fix off by 1 error. + +Thu Nov 16 13:51:10 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * util.c (xcalloc): Function deleted. + + * io.c (slurp): Null-terminate the buffer. + + * io.c (read_files): Delete unused vars. + + * io.c (find_equiv_class): Don't index by N if too low. + + * dir.c (dir_sort): Delete the extra declaration of compare_names. + + * diff.h: Don't declare xcalloc. Declare some other functions. + + * analyze.c (shift_boundaries): + Test for END at end of range before indexing by it. + Fix misspelling of `preceding' in var names. + +Sat Nov 11 14:04:16 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * diff3.c (using_to_diff3_block): Delete unused vars. + (make_3way_diff, process_diff_control, read_diff, output_diff3): Likewise. + +Mon Nov 6 18:15:50 EST 1989 Jay Fenlason (hack@ai.mit.edu) + + * README Fix typo. + +Fri Nov 3 15:27:47 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * diff.c (usage): Mention -D. + + * ifdef.c (print_ifdef_hunk): Write comments on #else and #endif. + +Sun Oct 29 16:41:07 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * diff.c (compare_files): Don't fflush for identical files. + +Wed Oct 25 17:57:12 1989 Randy Smith (randy at apple-gunkies.ai.mit.edu) + + * diff3.c (using_to_diff3_block): When defaulting lines from + FILE0, only copy up to just under the *lowest* line mentioned + in the next diff. + + * diff3.c (fatal): Add \n to error messages. + +Wed Oct 25 15:05:49 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * Makefile (tapefiles): Add ChangeLog. + +Tue Oct 3 00:51:17 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * diff3.c (process_diff, create_diff3_block): Init ->next field. + +Fri Sep 29 08:16:45 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * util.c (line_cmp): Alter end char of line 2, not line 1. + +Wed Sep 20 00:12:37 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * Makefile (diff.tar): Expect ln to fail on some files; + copy them with cp. + +Mon Sep 18 02:54:29 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * Handle -D option: + * io.c (find_and_hash_each_line): Keep all lines of 1st file. + * diff.c (main): Handle -D option. + (compare_files): Reject -D if files spec'd are directories. + * analyze.c (diff_2_files): Handle OUTPUT_IFDEF case. + +Fri Sep 1 20:15:50 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * diff.c (option_list): Rename arg VECTOR as OPTIONVEC. + +Mon Aug 28 17:58:27 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * diff.c (compare_files): Clear entire inf[i].stat. + +Wed Aug 23 17:48:47 1989 Richard Stallman (rms at apple-gunkies.ai.mit.edu) + + * io.c (find_identical_ends): Sign was backward + determining where to bound the scan for the suffix. + +Wed Aug 16 12:49:16 1989 Richard Stallman (rms at hobbes.ai.mit.edu) + + * analyze.c (diff_2_files): If -q, treat all files as binary. + * diff.c (main): Detect -q, record in no_details_flag. + +Sun Jul 30 23:12:00 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * diff.c (usage): New function. + (main): Call it. + +Wed Jul 26 02:02:19 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * diff.c (main): Make -C imply -c. + +Thu Jul 20 17:57:51 1989 Chris Hanson (cph at kleph) + + * io.c (find_and_hash_each_line): Bug fix in context handling, + introduced by last change. + +Fri Jul 14 17:39:20 1989 Chris Hanson (cph at kleph) + + * analyze.c: To make RCS work correctly on files that don't + necessarily end in newline, introduce some changes that cause + diffs to be sensitive to missing final newline. Because + non-RCS modes don't want to be affected by these changes, they + are conditional on `output_style == OUTPUT_RCS'. + (diff_2_files) [OUTPUT_RCS]: Suppress the "File X missing + newline" message. + (build_script) [OUTPUT_RCS]: Cause the last line to compare as + different if exactly one of the files is missing its final + newline. + + * io.c (find_and_hash_each_line): Bug fix in + ignore_space_change mode. Change line's length to include the + newline. For OUTPUT_RCS, decrement last line's length if + there is no final newline. + (find_identical_ends) [OUTPUT_RCS]: If one of the files is + missing a final newline, make sure it's not included in either + the prefix or suffix. + + * util.c (print_1_line): Change line output routine to account + for line length including the newline. + +Tue Jun 27 02:35:28 1989 Roland McGrath (roland at hobbes.ai.mit.edu) + + * Makefile: Inserted $(archpfx) where appropriate. + +Wed May 17 20:18:43 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * diff3.c [USG]: Include fcntl.h. + + * diff.h [USG]: New compilation flags HAVE_NDIR, HAVE_DIRECT. + +Wed Apr 26 15:35:57 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * dir.c (diff_dirs): Two new args, NONEX1 and NONEX2, say to pretend + nonex dirs are empty. + (dir_sort): New arg NONEX, likewise. + * diff.c (compare_files): Pass those args. + Sometimes call diff_dirs if subdir exists in just one place. + +Wed Apr 12 01:10:27 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * io.c (find_identical_ends): Set END0 *after* last char + during backward scan for suffix. + +Sat Apr 8 15:49:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * diff3.c (using_to_diff3_block): Now find high marks in files 1 + and 2 through mapping off of the last difference instead of the + first. + + * diff3.c: Many trivial changes to spelling inside comments. + +Fri Feb 24 12:38:03 1989 Randall Smith (randy at gluteus.ai.mit.edu) + + * util.c, normal.c, io.c, ed.c, dir.c, diff.h, diff.c, context.c, + analyze.c, Makefile: Changed copyright header to conform with new + GNU General Public license. + * diff3.c: Changed copyright header to conform with new GNU + General Public license. + * COPYING: Made a hard link to /gp/rms/COPYING. + +Fri Feb 24 10:01:58 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * io.c (slurp): Leave 2 chars space at end of buffer, not one. + (find_identical_ends): Special case if either file is empty; + don't try to make a sentinel since could crash. + +Wed Feb 15 14:24:48 1989 Jay Fenlason (hack at apple-gunkies.ai.mit.edu) + + * diff3.c (message) Re-wrote routine to avoid using alloca() + +Wed Feb 15 06:19:14 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * io.c (find_identical_ends): Delete the variable `bytes'. + +Sun Feb 12 11:50:36 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * io.c (slurp): ->bufsize is nominal amount we have room for; + add room for sentinel when calling xmalloc or xrealloc. + + * io.c (find_identical_ends): Do need overrun check in finding suffix. + +Fri Feb 10 01:28:15 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * diff.c (main): -C now takes arg to specify context length. + Now -p to show C function name--Damned IEEE! + Fatal error if context length spec'd twice. + + * ed.c (print_ed_hunk): Now special treatment only for lines containing + precisely a dot and nothing else. Output `..', end the insert, + substitute that one line, then resume the insert if nec. + + * io.c (find_and_hash_lines): When backing up over starting context, + don't move past buffer-beg. + + * io.c (find_identical_ends): Use sentinels to make the loops faster. + If files are identical, skip the 2nd loop and return quickly. + (slurp): Leave 1 char extra space after each buffer. + + * analyze.c (diff_2_files): Mention difference in final newlines. + +Wed Jan 25 22:44:44 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * dir.c (diff_dirs): Use * when calling fcn ptr variable. + +Sat Dec 17 14:12:06 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * Makefile: New vars INSTALL and LIBS used in some rules; + provide default defns plus commented-put defns for sysV. + +Thu Nov 17 16:42:53 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * dir.c (dir_sort): Open-trouble not fatal; just say # files is -1. + (diff_dirs): If dir_sort does that, give up and return 2. + + * diff.c (compare_files): Don't open directories. + Don't close them specially either. + Cross-propagate inf[i].dir_p sooner. + +Sun Nov 13 11:19:36 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * diff.h: Declare index, rindex. + + * diff.c (compare_files): If comparing foodir with b/f, + use foodir/f, not foodir/b/f. + + * diff.c (compare_files): Don't print "are identical" msg for 2 dirs. + Status now 1 if one file is a dir and the other isn't, etc. + +Thu Nov 3 16:30:24 1988 Randall Smith (randy at gluteus.ai.mit.edu) + + * Makefile: Added a define for diff3 to define DIFF_PROGRAM. + + * util.c: Added hack to make sure that perror was not called with + a null pointer. + + * diff.c: Changed S_IFDIR to S_IFMT in masking type of file bits + out. + + * diff3.c: Included USG compatibility defines. + + * diff.h: Moved sys/file.h into #else USG section (not needed or + wanted on System V). + + * ed.c, analyze.c, context.c: Shortened names to 12 characters for + the sake of System V (too simple not to do). + + + ----- + + Copyright (C) 1988-1994, 1997-2002, 2004, 2006, 2009-2013, 2015-2017 + Free Software Foundation, Inc. + + Copying and distribution of this file, with or without + modification, are permitted provided the copyright notice and this + notice are preserved. diff --git a/local/recipes/tools/diffutils/source/GNUmakefile b/local/recipes/tools/diffutils/source/GNUmakefile new file mode 100644 index 0000000000..a2f81118e5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/GNUmakefile @@ -0,0 +1,127 @@ +# Having a separate GNUmakefile lets me 'include' the dynamically +# generated rules created via cfg.mk (package-local configuration) +# as well as maint.mk (generic maintainer rules). +# This makefile is used only if you run GNU Make. +# It is necessary if you want to build targets usually of interest +# only to the maintainer. + +# Copyright (C) 2001, 2003, 2006-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# If the user runs GNU make but has not yet run ./configure, +# give them a diagnostic. +_gl-Makefile := $(wildcard [M]akefile) +ifneq ($(_gl-Makefile),) + +# Make tar archive easier to reproduce. +export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner + +# Allow the user to add to this in the Makefile. +ALL_RECURSIVE_TARGETS = + +include Makefile + +# Some projects override e.g., _autoreconf here. +-include $(srcdir)/cfg.mk + +# Allow cfg.mk to override these. +_build-aux ?= build-aux +_autoreconf ?= autoreconf -v + +include $(srcdir)/maint.mk + +# Ensure that $(VERSION) is up to date for dist-related targets, but not +# for others: rerunning autoreconf and recompiling everything isn't cheap. +_have-git-version-gen := \ + $(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes) +ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL)) + _is-dist-target ?= $(filter-out %clean, \ + $(filter maintainer-% dist% alpha beta stable,$(MAKECMDGOALS))) + _is-install-target ?= $(filter-out %check, $(filter install%,$(MAKECMDGOALS))) + ifneq (,$(_is-dist-target)$(_is-install-target)) + _curr-ver := $(shell cd $(srcdir) \ + && $(_build-aux)/git-version-gen \ + .tarball-version \ + $(git-version-gen-tag-sed-script)) + ifneq ($(_curr-ver),$(VERSION)) + ifeq ($(_curr-ver),UNKNOWN) + $(info WARNING: unable to verify if $(VERSION) is the correct version) + else + ifneq (,$(_is-install-target)) + # GNU Coding Standards state that 'make install' should not cause + # recompilation after 'make all'. But as long as changing the version + # string alters config.h, the cost of having 'make all' always have an + # up-to-date version is prohibitive. So, as a compromise, we merely + # warn when installing a version string that is out of date; the user + # should run 'autoreconf' (or something like 'make distcheck') to + # fix the version, 'make all' to propagate it, then 'make install'. + $(info WARNING: version string $(VERSION) is out of date;) + $(info run '$(MAKE) _version' to fix it) + else + $(info INFO: running autoreconf for new version string: $(_curr-ver)) +GNUmakefile: _version + touch GNUmakefile + endif + endif + endif + endif +endif + +.PHONY: _version +_version: + cd $(srcdir) && rm -rf autom4te.cache .version && $(_autoreconf) + $(MAKE) $(AM_MAKEFLAGS) Makefile + +else + +.DEFAULT_GOAL := abort-due-to-no-makefile +srcdir = . + +# The package can override .DEFAULT_GOAL to run actions like autoreconf. +-include ./cfg.mk + +# Allow cfg.mk to override these. +_build-aux ?= build-aux +_autoreconf ?= autoreconf -v + +include ./maint.mk + +ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile) +$(MAKECMDGOALS): abort-due-to-no-makefile +endif + +abort-due-to-no-makefile: + @echo There seems to be no Makefile in this directory. 1>&2 + @echo "You must run ./configure before running 'make'." 1>&2 + @exit 1 + +endif + +# Tell version 3.79 and up of GNU make to not build goals in this +# directory in parallel, in case someone tries to build multiple +# targets, and one of them can cause a recursive target to be invoked. + +# Only set this if Automake doesn't provide it. +AM_RECURSIVE_TARGETS ?= $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) \ + dist distcheck tags ctags + +ALL_RECURSIVE_TARGETS += $(AM_RECURSIVE_TARGETS) + +ifneq ($(word 2, $(MAKECMDGOALS)), ) +ifneq ($(filter $(ALL_RECURSIVE_TARGETS), $(MAKECMDGOALS)), ) +.NOTPARALLEL: +endif +endif diff --git a/local/recipes/tools/diffutils/source/INSTALL b/local/recipes/tools/diffutils/source/INSTALL new file mode 100644 index 0000000000..8865734f81 --- /dev/null +++ b/local/recipes/tools/diffutils/source/INSTALL @@ -0,0 +1,368 @@ +Installation Instructions +************************* + + Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software +Foundation, Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell command './configure && make && make install' +should configure, build, and install this package. The following +more-detailed instructions are generic; see the 'README' file for +instructions specific to this package. Some packages provide this +'INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The 'configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a 'Makefile' in each directory of the package. +It may also create one or more '.h' files containing system-dependent +definitions. Finally, it creates a shell script 'config.status' that +you can run in the future to recreate the current configuration, and a +file 'config.log' containing compiler output (useful mainly for +debugging 'configure'). + + It can also use an optional file (typically called 'config.cache' and +enabled with '--cache-file=config.cache' or simply '-C') that saves the +results of its tests to speed up reconfiguring. Caching is disabled by +default to prevent problems with accidental use of stale cache files. + + If you need to do unusual things to compile the package, please try +to figure out how 'configure' could check whether to do them, and mail +diffs or instructions to the address given in the 'README' so they can +be considered for the next release. If you are using the cache, and at +some point 'config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file 'configure.ac' (or 'configure.in') is used to create +'configure' by a program called 'autoconf'. You need 'configure.ac' if +you want to change it or regenerate 'configure' using a newer version of +'autoconf'. + + The simplest way to compile this package is: + + 1. 'cd' to the directory containing the package's source code and type + './configure' to configure the package for your system. + + Running 'configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type 'make' to compile the package. + + 3. Optionally, type 'make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type 'make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the 'make install' phase executed with root + privileges. + + 5. Optionally, type 'make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior 'make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing 'make clean'. To also remove the + files that 'configure' created (so you can compile the package for + a different kind of computer), type 'make distclean'. There is + also a 'make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type 'make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide 'make + distcheck', which can by used by developers to test that all other + targets like 'make install' and 'make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the 'configure' script does not know about. Run './configure --help' +for details on some of the pertinent environment variables. + + You can give 'configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here is +an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU 'make'. 'cd' to the +directory where you want the object files and executables to go and run +the 'configure' script. 'configure' automatically checks for the source +code in the directory that 'configure' is in and in '..'. This is known +as a "VPATH" build. + + With a non-GNU 'make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use 'make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple '-arch' options to the +compiler but only a single '-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the 'lipo' tool if you have problems. + +Installation Names +================== + + By default, 'make install' installs the package's commands under +'/usr/local/bin', include files under '/usr/local/include', etc. You +can specify an installation prefix other than '/usr/local' by giving +'configure' the option '--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option '--exec-prefix=PREFIX' to 'configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like '--bindir=DIR' to specify different values for particular +kinds of files. Run 'configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the default +for these options is expressed in terms of '${prefix}', so that +specifying just '--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to 'configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +'make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, 'make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +'${prefix}'. Any directories that were specified during 'configure', +but not in terms of '${prefix}', must each be overridden at install time +for the entire installation to be relocated. The approach of makefile +variable overrides for each directory variable is required by the GNU +Coding Standards, and ideally causes no recompilation. However, some +platforms have known limitations with the semantics of shared libraries +that end up requiring recompilation when using this method, particularly +noticeable in packages that use GNU Libtool. + + The second method involves providing the 'DESTDIR' variable. For +example, 'make install DESTDIR=/alternate/directory' will prepend +'/alternate/directory' before all installation names. The approach of +'DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of '${prefix}' +at 'configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving 'configure' the +option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. + + Some packages pay attention to '--enable-FEATURE' options to +'configure', where FEATURE indicates an optional part of the package. +They may also pay attention to '--with-PACKAGE' options, where PACKAGE +is something like 'gnu-as' or 'x' (for the X Window System). The +'README' should mention any '--enable-' and '--with-' options that the +package recognizes. + + For packages that use the X Window System, 'configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the 'configure' options '--x-includes=DIR' and +'--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of 'make' will be. For these packages, running './configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with 'make V=1'; while running './configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with 'make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC +is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + HP-UX 'make' updates targets which have the same time stamps as their +prerequisites, which makes it generally unusable when shipped generated +files such as 'configure' are involved. Use GNU 'make' instead. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its '' header file. The option '-nodtk' can be used as a +workaround. If GNU CC is not installed, it is therefore recommended to +try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put '/usr/ucb' early in your 'PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in '/usr/bin'. So, if you need '/usr/ucb' +in your 'PATH', put it _after_ '/usr/bin'. + + On Haiku, software installed for all users goes in '/boot/common', +not '/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features 'configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, 'configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +'--build=TYPE' option. TYPE can either be a short name for the system +type, such as 'sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file 'config.sub' for the possible values of each field. If +'config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option '--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with '--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for 'configure' scripts to share, +you can create a site shell script called 'config.site' that gives +default values for variables like 'CC', 'cache_file', and 'prefix'. +'configure' looks for 'PREFIX/share/config.site' if it exists, then +'PREFIX/etc/config.site' if it exists. Or, you can set the +'CONFIG_SITE' environment variable to the location of the site script. +A warning: not all 'configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to 'configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the 'configure' command line, using 'VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified 'gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an +Autoconf limitation. Until the limitation is lifted, you can use this +workaround: + + CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash + +'configure' Invocation +====================== + + 'configure' recognizes the following options to control how it +operates. + +'--help' +'-h' + Print a summary of all of the options to 'configure', and exit. + +'--help=short' +'--help=recursive' + Print a summary of the options unique to this package's + 'configure', and exit. The 'short' variant lists options used only + in the top level, while the 'recursive' variant lists options also + present in any nested packages. + +'--version' +'-V' + Print the version of Autoconf used to generate the 'configure' + script, and exit. + +'--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally 'config.cache'. FILE defaults to '/dev/null' to + disable caching. + +'--config-cache' +'-C' + Alias for '--cache-file=config.cache'. + +'--quiet' +'--silent' +'-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to '/dev/null' (any error + messages will still be shown). + +'--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + 'configure' can determine that directory automatically. + +'--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: for + more details, including other options available for fine-tuning the + installation locations. + +'--no-create' +'-n' + Run the configure checks, but stop before creating any output + files. + +'configure' also accepts some other, not widely useful, options. Run +'configure --help' for more details. diff --git a/local/recipes/tools/diffutils/source/Makefile.am b/local/recipes/tools/diffutils/source/Makefile.am new file mode 100644 index 0000000000..eacce96a1e --- /dev/null +++ b/local/recipes/tools/diffutils/source/Makefile.am @@ -0,0 +1,58 @@ +# Main Automakefile for GNU diffutils. + +# Copyright (C) 2001-2002, 2004, 2006, 2009-2013, 2015-2017 Free Software +# Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +ALL_RECURSIVE_TARGETS = + +EXTRA_DIST = bootstrap exgettext ChangeLog-2008 cfg.mk dist-check.mk +SUBDIRS = lib src tests doc man po gnulib-tests + +ACLOCAL_AMFLAGS = -I m4 +AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) + +# Arrange so that .tarball-version appears only in the distribution +# tarball, and never in a checked-out repository. +dist-hook: gen-ChangeLog + $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version + +gen_start_date = '2009-11-11 15:00' +.PHONY: gen-ChangeLog +gen-ChangeLog: + $(AM_V_GEN)if test -d .git; then \ + $(top_srcdir)/build-aux/gitlog-to-changelog \ + --since=$(gen_start_date) > $(distdir)/cl-t && \ + { rm -f $(distdir)/ChangeLog && \ + mv $(distdir)/cl-t $(distdir)/ChangeLog; } \ + fi + +ALL_RECURSIVE_TARGETS += distcheck-hook +distcheck-hook: + $(MAKE) my-distcheck + +# Some of our git hook scripts are supposed to be identical to git's samples. +# See if they are still in sync. +.PHONY: check-git-hook-script-sync +check-git-hook-script-sync: + @fail=0; \ + t=$$(mktemp -d) \ + && cd $$t && git init -q && cd .git/hooks \ + && for i in pre-commit pre-applypatch applypatch-msg; do \ + diff -u $(abs_top_srcdir)/scripts/git-hooks/$$i $$i.sample \ + || fail=1; \ + done; \ + rm -rf $$t; \ + test $$fail = 0 diff --git a/local/recipes/tools/diffutils/source/Makefile.in b/local/recipes/tools/diffutils/source/Makefile.in new file mode 100644 index 0000000000..dc847e9b28 --- /dev/null +++ b/local/recipes/tools/diffutils/source/Makefile.in @@ -0,0 +1,1812 @@ +# Makefile.in generated by automake 1.18.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2025 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Main Automakefile for GNU diffutils. + +# Copyright (C) 2001-2002, 2004, 2006, 2009-2013, 2015-2017 Free Software +# Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +am__rm_f = rm -f $(am__rm_f_notfound) +am__rm_rf = rm -rf $(am__rm_f_notfound) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ + $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \ + $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/btowc.m4 \ + $(top_srcdir)/m4/builtin-expect.m4 $(top_srcdir)/m4/c-stack.m4 \ + $(top_srcdir)/m4/clock_time.m4 $(top_srcdir)/m4/close.m4 \ + $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \ + $(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/ctype.m4 \ + $(top_srcdir)/m4/dirname.m4 \ + $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/extensions.m4 \ + $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fcntl-o.m4 \ + $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/filenamecat.m4 \ + $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \ + $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpieee.m4 \ + $(top_srcdir)/m4/freopen.m4 $(top_srcdir)/m4/fstat.m4 \ + $(top_srcdir)/m4/ftruncate.m4 $(top_srcdir)/m4/getcwd.m4 \ + $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/getpagesize.m4 \ + $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnu-make.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 \ + $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \ + $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \ + $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttostr.m4 \ + $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \ + $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \ + $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/iswblank.m4 \ + $(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ + $(top_srcdir)/m4/libunistring-base.m4 \ + $(top_srcdir)/m4/limits-h.m4 $(top_srcdir)/m4/localcharset.m4 \ + $(top_srcdir)/m4/locale-fr.m4 $(top_srcdir)/m4/locale-ja.m4 \ + $(top_srcdir)/m4/locale-tr.m4 $(top_srcdir)/m4/locale-zh.m4 \ + $(top_srcdir)/m4/locale_h.m4 $(top_srcdir)/m4/localeconv.m4 \ + $(top_srcdir)/m4/localtime-buffer.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ + $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/mbchar.m4 \ + $(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbslen.m4 \ + $(top_srcdir)/m4/mbsrtowcs.m4 $(top_srcdir)/m4/mbstate_t.m4 \ + $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \ + $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mkstemp.m4 \ + $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/mmap-anon.m4 \ + $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \ + $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \ + $(top_srcdir)/m4/nanosleep.m4 $(top_srcdir)/m4/netinet_in_h.m4 \ + $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \ + $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ + $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \ + $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/regex.m4 \ + $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/setlocale.m4 \ + $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/signalblocking.m4 \ + $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/socketlib.m4 \ + $(top_srcdir)/m4/sockets.m4 $(top_srcdir)/m4/socklen.m4 \ + $(top_srcdir)/m4/sockpfaf.m4 $(top_srcdir)/m4/ssize_t.m4 \ + $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \ + $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \ + $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/strcase.m4 $(top_srcdir)/m4/strerror.m4 \ + $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/strftime.m4 \ + $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strings_h.m4 \ + $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ + $(top_srcdir)/m4/strptime.m4 $(top_srcdir)/m4/strtoull.m4 \ + $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/symlink.m4 \ + $(top_srcdir)/m4/sys_ioctl_h.m4 \ + $(top_srcdir)/m4/sys_select_h.m4 \ + $(top_srcdir)/m4/sys_socket_h.m4 \ + $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ + $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \ + $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \ + $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \ + $(top_srcdir)/m4/time_rz.m4 $(top_srcdir)/m4/timegm.m4 \ + $(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \ + $(top_srcdir)/m4/tzset.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vararrays.m4 \ + $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vasprintf.m4 \ + $(top_srcdir)/m4/version-etc.m4 \ + $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \ + $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ + $(top_srcdir)/m4/wctomb.m4 $(top_srcdir)/m4/wctype_h.m4 \ + $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \ + $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xstrtol.m4 \ + $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/lib/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir distdir-am dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/build-aux/compile \ + $(top_srcdir)/build-aux/config.guess \ + $(top_srcdir)/build-aux/config.rpath \ + $(top_srcdir)/build-aux/config.sub \ + $(top_srcdir)/build-aux/install-sh \ + $(top_srcdir)/build-aux/missing ABOUT-NLS AUTHORS COPYING \ + ChangeLog INSTALL NEWS README THANKS TODO build-aux/ar-lib \ + build-aux/compile build-aux/config.guess \ + build-aux/config.rpath build-aux/config.sub build-aux/depcomp \ + build-aux/install-sh build-aux/mdate-sh build-aux/missing \ + build-aux/texinfo.tex +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -700 -exec chmod u+rwx {} ';' \ + ; rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +GZIP_ENV = -9 +DIST_ARCHIVES = $(distdir).tar.xz +DIST_TARGETS = dist-xz +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = \ + find . \( -type f -a \! \ + \( -name .nfs* -o -name .smb* -o -name .__afs* \) \) -print +pkglibexecdir = @pkglibexecdir@ +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_INCLUDE = @CONFIG_INCLUDE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ +EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ +ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ +ENOLINK_VALUE = @ENOLINK_VALUE@ +EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ +EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ +ERRNO_H = @ERRNO_H@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FLOAT_H = @FLOAT_H@ +FNMATCH_H = @FNMATCH_H@ +GETOPT_CDEFS_H = @GETOPT_CDEFS_H@ +GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIBC21 = @GLIBC21@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ +GNULIB_CHDIR = @GNULIB_CHDIR@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_CTIME = @GNULIB_CTIME@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ +GNULIB_DUP = @GNULIB_DUP@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_DUP3 = @GNULIB_DUP3@ +GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ +GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ +GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ +GNULIB_FCNTL = @GNULIB_FCNTL@ +GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ +GNULIB_FDOPEN = @GNULIB_FDOPEN@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FFS = @GNULIB_FFS@ +GNULIB_FFSL = @GNULIB_FFSL@ +GNULIB_FFSLL = @GNULIB_FFSLL@ +GNULIB_FGETC = @GNULIB_FGETC@ +GNULIB_FGETS = @GNULIB_FGETS@ +GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPURGE = @GNULIB_FPURGE@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ +GNULIB_FREAD = @GNULIB_FREAD@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ +GNULIB_FSCANF = @GNULIB_FSCANF@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSTAT = @GNULIB_FSTAT@ +GNULIB_FSTATAT = @GNULIB_FSTATAT@ +GNULIB_FSYNC = @GNULIB_FSYNC@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETC = @GNULIB_GETC@ +GNULIB_GETCHAR = @GNULIB_GETCHAR@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ +GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ +GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ +GNULIB_GRANTPT = @GNULIB_GRANTPT@ +GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ +GNULIB_ICONV = @GNULIB_ICONV@ +GNULIB_IMAXABS = @GNULIB_IMAXABS@ +GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ +GNULIB_IOCTL = @GNULIB_IOCTL@ +GNULIB_ISATTY = @GNULIB_ISATTY@ +GNULIB_ISBLANK = @GNULIB_ISBLANK@ +GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ +GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LINKAT = @GNULIB_LINKAT@ +GNULIB_LISTEN = @GNULIB_LISTEN@ +GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ +GNULIB_LOCALTIME = @GNULIB_LOCALTIME@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MBTOWC = @GNULIB_MBTOWC@ +GNULIB_MEMCHR = @GNULIB_MEMCHR@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKFIFO = @GNULIB_MKFIFO@ +GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ +GNULIB_MKNOD = @GNULIB_MKNOD@ +GNULIB_MKNODAT = @GNULIB_MKNODAT@ +GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ +GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ +GNULIB_MKTIME = @GNULIB_MKTIME@ +GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ +GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ +GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_OPENAT = @GNULIB_OPENAT@ +GNULIB_OVERRIDES_STRUCT_STAT = @GNULIB_OVERRIDES_STRUCT_STAT@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ +GNULIB_PCLOSE = @GNULIB_PCLOSE@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PIPE = @GNULIB_PIPE@ +GNULIB_PIPE2 = @GNULIB_PIPE2@ +GNULIB_POPEN = @GNULIB_POPEN@ +GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ +GNULIB_PREAD = @GNULIB_PREAD@ +GNULIB_PRINTF = @GNULIB_PRINTF@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PSELECT = @GNULIB_PSELECT@ +GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ +GNULIB_PTSNAME = @GNULIB_PTSNAME@ +GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ +GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ +GNULIB_RAISE = @GNULIB_RAISE@ +GNULIB_RANDOM = @GNULIB_RANDOM@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ +GNULIB_READ = @GNULIB_READ@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_READLINKAT = @GNULIB_READLINKAT@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_REALPATH = @GNULIB_REALPATH@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ +GNULIB_REMOVE = @GNULIB_REMOVE@ +GNULIB_RENAME = @GNULIB_RENAME@ +GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ +GNULIB_RMDIR = @GNULIB_RMDIR@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SCANF = @GNULIB_SCANF@ +GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ +GNULIB_SELECT = @GNULIB_SELECT@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ +GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ +GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ +GNULIB_SIGACTION = @GNULIB_SIGACTION@ +GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ +GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STAT = @GNULIB_STAT@ +GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ +GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ +GNULIB_STRFTIME = @GNULIB_STRFTIME@ +GNULIB_STRNCAT = @GNULIB_STRNCAT@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRPTIME = @GNULIB_STRPTIME@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ +GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ +GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ +GNULIB_SYMLINK = @GNULIB_SYMLINK@ +GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ +GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ +GNULIB_TIMEGM = @GNULIB_TIMEGM@ +GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ +GNULIB_TMPFILE = @GNULIB_TMPFILE@ +GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ +GNULIB_TRUNCATE = @GNULIB_TRUNCATE@ +GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ +GNULIB_TZSET = @GNULIB_TZSET@ +GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ +GNULIB_UNLINK = @GNULIB_UNLINK@ +GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ +GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ +GNULIB_USLEEP = @GNULIB_USLEEP@ +GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VFSCANF = @GNULIB_VFSCANF@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSCANF = @GNULIB_VSCANF@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WAITPID = @GNULIB_WAITPID@ +GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@ +GNULIB_WCPCPY = @GNULIB_WCPCPY@ +GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ +GNULIB_WCSCAT = @GNULIB_WCSCAT@ +GNULIB_WCSCHR = @GNULIB_WCSCHR@ +GNULIB_WCSCMP = @GNULIB_WCSCMP@ +GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ +GNULIB_WCSCPY = @GNULIB_WCSCPY@ +GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ +GNULIB_WCSDUP = @GNULIB_WCSDUP@ +GNULIB_WCSFTIME = @GNULIB_WCSFTIME@ +GNULIB_WCSLEN = @GNULIB_WCSLEN@ +GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ +GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ +GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ +GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ +GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ +GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCSSPN = @GNULIB_WCSSPN@ +GNULIB_WCSSTR = @GNULIB_WCSSTR@ +GNULIB_WCSTOK = @GNULIB_WCSTOK@ +GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ +GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ +GNULIB_WCTOB = @GNULIB_WCTOB@ +GNULIB_WCTOMB = @GNULIB_WCTOMB@ +GNULIB_WCTRANS = @GNULIB_WCTRANS@ +GNULIB_WCTYPE = @GNULIB_WCTYPE@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ +GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ +GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ +GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ +GNULIB_WMEMSET = @GNULIB_WMEMSET@ +GNULIB_WRITE = @GNULIB_WRITE@ +GNULIB__EXIT = @GNULIB__EXIT@ +HAVE_ACCEPT4 = @HAVE_ACCEPT4@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ +HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ +HAVE_CHOWN = @HAVE_CHOWN@ +HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ +HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ +HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ +HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ +HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ +HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ +HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ +HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_DUP3 = @HAVE_DUP3@ +HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_FACCESSAT = @HAVE_FACCESSAT@ +HAVE_FCHDIR = @HAVE_FCHDIR@ +HAVE_FCHMODAT = @HAVE_FCHMODAT@ +HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FCNTL = @HAVE_FCNTL@ +HAVE_FDATASYNC = @HAVE_FDATASYNC@ +HAVE_FEATURES_H = @HAVE_FEATURES_H@ +HAVE_FFS = @HAVE_FFS@ +HAVE_FFSL = @HAVE_FFSL@ +HAVE_FFSLL = @HAVE_FFSLL@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSTATAT = @HAVE_FSTATAT@ +HAVE_FSYNC = @HAVE_FSYNC@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_FUTIMENS = @HAVE_FUTIMENS@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETGROUPS = @HAVE_GETGROUPS@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ +HAVE_GETLOGIN = @HAVE_GETLOGIN@ +HAVE_GETOPT_H = @HAVE_GETOPT_H@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ +HAVE_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISBLANK = @HAVE_ISBLANK@ +HAVE_ISWBLANK = @HAVE_ISWBLANK@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ +HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ +HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ +HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ +HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LCHOWN = @HAVE_LCHOWN@ +HAVE_LIBSIGSEGV = @HAVE_LIBSIGSEGV@ +HAVE_LINK = @HAVE_LINK@ +HAVE_LINKAT = @HAVE_LINKAT@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSLEN = @HAVE_MBSLEN@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ +HAVE_MEMCHR = @HAVE_MEMCHR@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDIRAT = @HAVE_MKDIRAT@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_MKFIFO = @HAVE_MKFIFO@ +HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ +HAVE_MKNOD = @HAVE_MKNOD@ +HAVE_MKNODAT = @HAVE_MKNODAT@ +HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ +HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ +HAVE_MKSTEMP = @HAVE_MKSTEMP@ +HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ +HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ +HAVE_OPENAT = @HAVE_OPENAT@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_PCLOSE = @HAVE_PCLOSE@ +HAVE_PIPE = @HAVE_PIPE@ +HAVE_PIPE2 = @HAVE_PIPE2@ +HAVE_POPEN = @HAVE_POPEN@ +HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ +HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_PREAD = @HAVE_PREAD@ +HAVE_PSELECT = @HAVE_PSELECT@ +HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ +HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ +HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ +HAVE_RAISE = @HAVE_RAISE@ +HAVE_RANDOM = @HAVE_RANDOM@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_READLINKAT = @HAVE_READLINKAT@ +HAVE_REALPATH = @HAVE_REALPATH@ +HAVE_RENAMEAT = @HAVE_RENAMEAT@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ +HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SIGACTION = @HAVE_SIGACTION@ +HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ +HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ +HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ +HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ +HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_SIGSET_T = @HAVE_SIGSET_T@ +HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STPCPY = @HAVE_STPCPY@ +HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ +HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRINGS_H = @HAVE_STRINGS_H@ +HAVE_STRPBRK = @HAVE_STRPBRK@ +HAVE_STRPTIME = @HAVE_STRPTIME@ +HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ +HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ +HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ +HAVE_SYMLINK = @HAVE_SYMLINK@ +HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@ +HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ +HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ +HAVE_TRUNCATE = @HAVE_TRUNCATE@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ +HAVE_TZSET = @HAVE_TZSET@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNLINKAT = @HAVE_UNLINKAT@ +HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_USLEEP = @HAVE_USLEEP@ +HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCHAR_T = @HAVE_WCHAR_T@ +HAVE_WCPCPY = @HAVE_WCPCPY@ +HAVE_WCPNCPY = @HAVE_WCPNCPY@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ +HAVE_WCSCAT = @HAVE_WCSCAT@ +HAVE_WCSCHR = @HAVE_WCSCHR@ +HAVE_WCSCMP = @HAVE_WCSCMP@ +HAVE_WCSCOLL = @HAVE_WCSCOLL@ +HAVE_WCSCPY = @HAVE_WCSCPY@ +HAVE_WCSCSPN = @HAVE_WCSCSPN@ +HAVE_WCSDUP = @HAVE_WCSDUP@ +HAVE_WCSFTIME = @HAVE_WCSFTIME@ +HAVE_WCSLEN = @HAVE_WCSLEN@ +HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ +HAVE_WCSNCAT = @HAVE_WCSNCAT@ +HAVE_WCSNCMP = @HAVE_WCSNCMP@ +HAVE_WCSNCPY = @HAVE_WCSNCPY@ +HAVE_WCSNLEN = @HAVE_WCSNLEN@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSPBRK = @HAVE_WCSPBRK@ +HAVE_WCSRCHR = @HAVE_WCSRCHR@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ +HAVE_WCSSPN = @HAVE_WCSSPN@ +HAVE_WCSSTR = @HAVE_WCSSTR@ +HAVE_WCSTOK = @HAVE_WCSTOK@ +HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ +HAVE_WCSXFRM = @HAVE_WCSXFRM@ +HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE_WMEMCHR = @HAVE_WMEMCHR@ +HAVE_WMEMCMP = @HAVE_WMEMCMP@ +HAVE_WMEMCPY = @HAVE_WMEMCPY@ +HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ +HAVE_WMEMSET = @HAVE_WMEMSET@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ +HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ +HAVE__BOOL = @HAVE__BOOL@ +HAVE__EXIT = @HAVE__EXIT@ +HELP2MAN = @HELP2MAN@ +ICONV_CONST = @ICONV_CONST@ +ICONV_H = @ICONV_H@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ +INET_PTON_LIB = @INET_PTON_LIB@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ +INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBCSTACK = @LIBCSTACK@ +LIBDIFFUTILS_LIBDEPS = @LIBDIFFUTILS_LIBDEPS@ +LIBDIFFUTILS_LTLIBDEPS = @LIBDIFFUTILS_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSIGSEGV = @LIBSIGSEGV@ +LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@ +LIBSOCKET = @LIBSOCKET@ +LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ +LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@ +LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@ +LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIB_NANOSLEEP = @LIB_NANOSLEEP@ +LIB_SELECT = @LIB_SELECT@ +LIMITS_H = @LIMITS_H@ +LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ +LTLIBCSTACK = @LTLIBCSTACK@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBSIGSEGV = @LTLIBSIGSEGV@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ +NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@ +NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ +NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ +NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@ +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ +NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ +NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ +NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ +NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ +NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ +NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ +NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@ +NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@ +NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ +NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ +NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ +NEXT_CTYPE_H = @NEXT_CTYPE_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_ICONV_H = @NEXT_ICONV_H@ +NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ +NEXT_LOCALE_H = @NEXT_LOCALE_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ +NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_STDARG_H = @NEXT_STDARG_H@ +NEXT_STDDEF_H = @NEXT_STDDEF_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ +NEXT_STDIO_H = @NEXT_STDIO_H@ +NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRINGS_H = @NEXT_STRINGS_H@ +NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@ +NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@ +NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ +NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ +NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ +NEXT_TIME_H = @NEXT_TIME_H@ +NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ +NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSUB = @POSUB@ +PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ +PR_PROGRAM = @PR_PROGRAM@ +PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ +REPLACE_CALLOC = @REPLACE_CALLOC@ +REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_CTIME = @REPLACE_CTIME@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ +REPLACE_DUP = @REPLACE_DUP@ +REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ +REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FCNTL = @REPLACE_FCNTL@ +REPLACE_FDOPEN = @REPLACE_FDOPEN@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FSTAT = @REPLACE_FSTAT@ +REPLACE_FSTATAT = @REPLACE_FSTATAT@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ +REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETDELIM = @REPLACE_GETDELIM@ +REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ +REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@ +REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_GMTIME = @REPLACE_GMTIME@ +REPLACE_ICONV = @REPLACE_ICONV@ +REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@ +REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@ +REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ +REPLACE_INET_PTON = @REPLACE_INET_PTON@ +REPLACE_IOCTL = @REPLACE_IOCTL@ +REPLACE_ISATTY = @REPLACE_ISATTY@ +REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ +REPLACE_ITOLD = @REPLACE_ITOLD@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LINK = @REPLACE_LINK@ +REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ +REPLACE_LOCALTIME = @REPLACE_LOCALTIME@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MALLOC = @REPLACE_MALLOC@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MBTOWC = @REPLACE_MBTOWC@ +REPLACE_MEMCHR = @REPLACE_MEMCHR@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKDIR = @REPLACE_MKDIR@ +REPLACE_MKFIFO = @REPLACE_MKFIFO@ +REPLACE_MKNOD = @REPLACE_MKNOD@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_MKTIME = @REPLACE_MKTIME@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ +REPLACE_NULL = @REPLACE_NULL@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ +REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POPEN = @REPLACE_POPEN@ +REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PSELECT = @REPLACE_PSELECT@ +REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ +REPLACE_PTSNAME = @REPLACE_PTSNAME@ +REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ +REPLACE_RAISE = @REPLACE_RAISE@ +REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ +REPLACE_READ = @REPLACE_READ@ +REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ +REPLACE_REALLOC = @REPLACE_REALLOC@ +REPLACE_REALPATH = @REPLACE_REALPATH@ +REPLACE_REMOVE = @REPLACE_REMOVE@ +REPLACE_RENAME = @REPLACE_RENAME@ +REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ +REPLACE_RMDIR = @REPLACE_RMDIR@ +REPLACE_SELECT = @REPLACE_SELECT@ +REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ +REPLACE_SLEEP = @REPLACE_SLEEP@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STAT = @REPLACE_STAT@ +REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ +REPLACE_STPNCPY = @REPLACE_STPNCPY@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ +REPLACE_STRDUP = @REPLACE_STRDUP@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ +REPLACE_STRFTIME = @REPLACE_STRFTIME@ +REPLACE_STRNCAT = @REPLACE_STRNCAT@ +REPLACE_STRNDUP = @REPLACE_STRNDUP@ +REPLACE_STRNLEN = @REPLACE_STRNLEN@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ +REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ +REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ +REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ +REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ +REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TMPFILE = @REPLACE_TMPFILE@ +REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ +REPLACE_TRUNCATE = @REPLACE_TRUNCATE@ +REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ +REPLACE_TZSET = @REPLACE_TZSET@ +REPLACE_UNLINK = @REPLACE_UNLINK@ +REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ +REPLACE_UNSETENV = @REPLACE_UNSETENV@ +REPLACE_USLEEP = @REPLACE_USLEEP@ +REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSFTIME = @REPLACE_WCSFTIME@ +REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ +REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCTOMB = @REPLACE_WCTOMB@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SRC_VERSION_C = @SRC_VERSION_C@ +STDALIGN_H = @STDALIGN_H@ +STDARG_H = @STDARG_H@ +STDBOOL_H = @STDBOOL_H@ +STDDEF_H = @STDDEF_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@ +SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ +UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ +UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WERROR_CFLAGS = @WERROR_CFLAGS@ +WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ +WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@ +WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_aux_dir = @abs_aux_dir@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__rm_f_notfound = @am__rm_f_notfound@ +am__tar = @am__tar@ +am__untar = @am__untar@ +am__xargs_n = @am__xargs_n@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ +gltests_WITNESS = @gltests_WITNESS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +lispdir = @lispdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +ALL_RECURSIVE_TARGETS = distcheck-hook +EXTRA_DIST = bootstrap exgettext ChangeLog-2008 cfg.mk dist-check.mk +SUBDIRS = lib src tests doc man po gnulib-tests +ACLOCAL_AMFLAGS = -I m4 +AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) +gen_start_date = '2009-11-11 15:00' +all: all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + $(am__remove_distdir) + $(AM_V_at)$(MKDIR_P) "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-bzip3: distdir + tardir=$(distdir) && $(am__tar) | bzip3 -c >$(distdir).tar.bz3 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + eval GZIP= gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.bz3*) \ + bzip3 -dc $(distdir).tar.bz3 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + eval GZIP= gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -$(am__rm_f) $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-bzip3 dist-gzip dist-hook dist-lzip dist-shar dist-tarZ \ + dist-xz dist-zip dist-zstd distcheck distclean \ + distclean-generic distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ + tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# Arrange so that .tarball-version appears only in the distribution +# tarball, and never in a checked-out repository. +dist-hook: gen-ChangeLog + $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version +.PHONY: gen-ChangeLog +gen-ChangeLog: + $(AM_V_GEN)if test -d .git; then \ + $(top_srcdir)/build-aux/gitlog-to-changelog \ + --since=$(gen_start_date) > $(distdir)/cl-t && \ + { rm -f $(distdir)/ChangeLog && \ + mv $(distdir)/cl-t $(distdir)/ChangeLog; } \ + fi +distcheck-hook: + $(MAKE) my-distcheck + +# Some of our git hook scripts are supposed to be identical to git's samples. +# See if they are still in sync. +.PHONY: check-git-hook-script-sync +check-git-hook-script-sync: + @fail=0; \ + t=$$(mktemp -d) \ + && cd $$t && git init -q && cd .git/hooks \ + && for i in pre-commit pre-applypatch applypatch-msg; do \ + diff -u $(abs_top_srcdir)/scripts/git-hooks/$$i $$i.sample \ + || fail=1; \ + done; \ + rm -rf $$t; \ + test $$fail = 0 + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: + +# Tell GNU make to disable its built-in pattern rules. +%:: %,v +%:: RCS/%,v +%:: RCS/% +%:: s.% +%:: SCCS/s.% diff --git a/local/recipes/tools/diffutils/source/NEWS b/local/recipes/tools/diffutils/source/NEWS new file mode 100644 index 0000000000..c22d9a52c1 --- /dev/null +++ b/local/recipes/tools/diffutils/source/NEWS @@ -0,0 +1,423 @@ +GNU diffutils NEWS -*- outline -*- + +* Noteworthy changes in release 3.6 (2017-05-21) [stable] + +** New features + + When one file is a prefix of the other, cmp now appends the shorter + file's size to the EOF diagnostic. + +** Bug fixes + + Using an invalid regular expression with --ignore-matching-lines=RE (-I) + no longer causes stack overflow. Before, with an invocation like the + following, diff would diagnose the error, but would still proceed to + blow the stack: diff -Ia -I\\ <(echo) <(echo b) + [bug introduced in 2.9] + + diff no longer mishandles line numbers exceeding 2**31 on Mingw-w64. + + the ---presume-output-tty (ostensibly test-only) option would cause + diff --color to read an uninitialized variable + [bug introduced in 3.4] + +** Performance changes + + diff's default algorithm has been tweaked to deal better with larger + files, reversing some of the changes made in diffutils-3.4. + + +* Noteworthy changes in release 3.5 (2016-08-20) [stable] + +** Bug fixes + + diff3 no longer malfunctions due to use-after-free + [bug introduced in 3.4] + + diff --color no longer colorizes when TERM=dumb + + +* Noteworthy changes in release 3.4 (2016-08-08) [stable] + +** New features + + diff accepts two new options --color and --palette to generate + and configure colored output. --color takes an optional argument + specifying when to colorize a line: --color=always, --color=auto, + --color=never. --palette is used to configure which colors are used. + +** Bug fixes + + When binary files differ, diff now exits with status 1 as POSIX requires. + Formerly it exited with status 2. + + Unless the --ignore-file-name-case option is used, diff now + considers file names to be equal only if they are byte-for-byte + equivalent. This fixes a bug where diff in an English locale might + consider two Asian file names to be the same merely because they + contain no English characters. + + diff -B no longer generates incorrect output if the two inputs + each end with a one-byte incomplete line. + + diff --brief no longer reports a difference for unusual identical files. + For example, when comparing a file like /proc/cmdline (for which the linux + kernel reports st_size of 0 even though it is not an empty file) to a + copy of that file's contents residing on a "normal" file system: + $ f=/proc/cmdline; cp $f k; diff --brief $f k + Files /proc/cmdline and k differ + +** Performance changes + + diff's default algorithm has been adjusted to output higher-quality + results at somewhat greater computational cost, as CPUs have gotten + faster since the algorithm was last tweaked in diffutils-2.6 (1993). + + +* Noteworthy changes in release 3.3 (2013-03-24) [stable] + +** New features + + diff accepts a new option, --no-dereference. With this option, symbolic + links are treated specially: as a separate type of file that can compare + equal only to another symbolic link with the same value. For example, + with --no-dereference, two symbolic links compare equal when they have + the same value, even when that value does not reference a readable file. + + --new-file (-N) and --unidirectional-new-file now allow comparisons to "-". + A standard input that's closed acts like a nonexistent file. + + A file name containing spaces, double quotes, backslashes or control + characters is now encoded in a diff header as a double-quoted C string + literal. The escape sequences \\, \", \a, \b, \f, \n, \r, \t, \v and + \ooo (a three-digit octal number between 0 and 255) are used. + +** Packaging + + diffutils is now designed to build with Cygwin or MinGW rather than DJGPP. + The ms subdirectory has been removed. + + +* Noteworthy changes in release 3.2 (2011-09-02) [stable] + +** Changes in behavior + + --ignore-file-name-case now applies at the top level too. + For example, "diff dir inIt" might compare "dir/Init" to "inIt". + +** New features + + diff and sdiff have a new option --ignore-trailing-space (-Z). + +** Packaging + + The texinfo documentation no longer specifies "front-cover" or "back-cover" + texts, so that it may now be included in Debian's "main" section. + + +* Noteworthy changes in release 3.1 (2011-08-10) [stable] + +** Bug fixes + + diff no longer reports spurious differences merely because two entries + in the same directory have names that compare equal in the current + locale, or compare equal because --ignore-file-name-case was given. + +* Noteworthy changes in release 3.0 (2010-05-03) [stable] + +** Bug fixes + + diff once again prints the required "\ No newline at end of file" line + when at least one input lacks a newline-at-EOF and the final hunk plus + context-length aligns exactly with the end of the newline-lacking file. + [bug introduced between 2.8.7 and 2.9] + +** Changes in behavior + + In context-style diffs, diff prints a portion of a preceding "function" + line for each hunk, with --show-function-line=RE (-F) or + --show-c-function (-p). Now, it trims leading blanks from such lines + before extracting a prefix. This is useful especially when a function + line is so far indented that the name itself would be truncated or not + included in the limited-width substring that diff appends. + + diff once again reports a difference with the diagnostic + "Binary files A and B differ" when at least one of the files + appears to be binary. From 2.8.4 through diffutils-2.9, it printed + "Files A and B differ". + + +* Noteworthy changes in release 2.9 (2010-02-11) [stable] + +** New features + + New diff option --suppress-blank-empty. + + Bring back support for 'diff -NUM', where NUM is a number, + even when conforming to POSIX 1003.1-2001. This change reverts to + the behavior of GNU diff 2.7 and earlier. This is a change only + when conforming to POSIX 1003.1-2001; there is no effect when + conforming to older POSIX versions. + + This change is in response to decisions taken in the January 2005 + Austin Group standardization meeting. For more details, please see + "Utility Syntax Guidelines" in the Minutes of the January 2005 + Meeting . + + sdiff now understands '1' and '2' as synonyms for 'l' and 'r'. + +** Changes in behavior + + sdiff and diff3 now invoke diff, not $(bindir)/diff + +** Administrivia + + New discussion and bug-reporting address: bug-diffutils@gnu.org + + updated gnulib support + + +* Noteworthy changes in release 2.8.7 (2004-04-13) [stable] + + Version 2.8.7 contains no user-visible changes. + +User-visible changes in version 2.8.6: + +* New diff3 option --strip-trailing-cr. + +* With -N and -P, inaccessible empty regular files (the kind of files + that 'patch' creates to indicate nonexistent backups) are now + treated as nonexistent when they are in the 'backup' file position. + +* If multiple SKIP values are given to cmp, e.g., 'cmp -i 10 -i 20', + cmp now uses the maximal value instead of the last one. + +* diff now omits the ".000000000" on hosts that do not support + fractional timestamps. + +Version 2.8.5 was not publicly released. + +User-visible changes in version 2.8.4: + +* Diff now simply prints "Files A and B differ" instead of "Binary + files A and B differ". The message is output if either A or B + appears to be a binary file, and the old wording was misleading + because it implied that both files are binary, which is not + necessarily the case. + +User-visible changes in version 2.8.3: + +* New locale: en_US. + +User-visible changes in version 2.8.2: + +* New diff and sdiff option: + --tabsize=COLUMNS +* If --ignore-space-change or --ignore-all-space is also specified, + --ignore-blank-lines now considers lines to be empty if they contain + only white space. +* More platforms now handle multibyte characters correctly when + excluding files by name (diff -x and -X). +* New locales: hu, pt_BR. + +User-visible changes in version 2.8.1: + +* Documentation fixes. + +User-visible changes in version 2.8: + +* cmp and diff now conform to POSIX 1003.1-2001 (IEEE Std 1003.1-2001) + if the underlying system conforms to POSIX and if the _POSIX2_VERSION + environment variable is set to 200112. Conformance removes support + for 'diff -NUM', where NUM is a number. Use -C NUM or -U NUM instead. +* cmp now supports trailing operands SKIP1 and SKIP2, like BSD cmp. +* cmp -i or --ignore-initial now accepts SKIP1:SKIP2 option value. +* New cmp option: -n or --bytes. +* cmp's old -c or --print-chars option has been renamed; + use -b or --print-bytes instead. +* cmp now outputs "byte" rather than "char" outside the POSIX locale. +* cmp -l's index column width now adjusts to fit larger (or smaller) files. +* cmp -l -s and cmp -s -l are not allowed. Use cmp -s or cmp -l instead. +* diff uses ISO 8601 style timestamps for output times (e.g. "2001-11-23 + 16:44:36.875702460 -0800") unless in the C or POSIX locale and the + -c style is specified. +* diff's -I and -F options use the regexp syntax of grep, not of Emacs. +* diff now accepts multiple context arguments, and uses their maximum value. +* New diff and sdiff options: + -E --ignore-tab-expansion + --strip-trailing-cr +* New diff options: + --from-file=FILE, --to-file=FILE + --ignore-file-name-case + --no-ignore-file-name-case +* New diff3 and sdiff option: + --diff-program=PROGRAM +* The following diff options are still accepted, but are no longer documented. + They may be withdrawn in future releases. + -h (omit; it has no effect) + -H (use --speed-large-files instead) + -L (use --label instead) + -P (use --unidirectional-new-file instead) + --inhibit-hunk-merge (omit; it has no effect) +* Recursive diffs now sort file names according to the LC_COLLATE locale + category if possible, instead of using native byte comparison. +* Recursive diffs now detect and report directory loops. +* Diff printf specs can now use the "0" and "'" flags. +* The new sdiff interactive command 'ed' precedes each version with a header. +* On 64-bit hosts, files larger than 2 GB can be compared. +* Some internationalization support has been added, but multibyte locales + are still not completely supported yet. +* Some diagnostics have been reworded slightly for consistency. + Also, 'diff -D FOO' now outputs '/* ! FOO */' instead of '/* not FOO */'. +* The 'patch' part of the manual now describes 'patch' version 2.5.4. +* Man pages are now distributed and installed. +* There is support for DJGPP; see the 'ms' subdirectory and the files + m4/dos.m4 and */setmode.*. + + +User-visible changes in version 2.7: + +* New diff option: --binary (useful only on non-POSIX hosts) +* diff -b and -w now ignore line incompleteness; -B no longer does this. +* cmp -c now uses locale to decide which output characters to quote. +* Help and version messages are reorganized. + + +User-visible changes in version 2.6: + +* New cmp, diff, diff3, sdiff option: --help +* A new heuristic for diff greatly reduces the time needed to compare + large input files that contain many differences. +* Partly as a result, GNU diff's output is not exactly the same as before. + Usually it is a bit smaller, but sometimes it is a bit larger. + + +User-visible changes in version 2.5: + +* New cmp option: -v --version + + +User-visible changes in version 2.4: + +* New cmp option: --ignore-initial=BYTES +* New diff3 option: -T --initial-tab +* New diff option: --line-format=FORMAT +* New diff group format specifications: + [eflmnEFLMN] + A printf spec followed by one of the following letters + causes the integer corresponding to that letter to be + printed according to the printf specification. + E.g. '%5df' prints the number of the first line in the + group in the old file using the "%5d" format. + e: line number just before the group in old file; equals f - 1 + f: first line number in group in the old file + l: last line number in group in the old file + m: line number just after the group in old file; equals l + 1 + n: number of lines in group in the old file; equals l - f + 1 + E, F, L, M, N: likewise, for lines in the new file + %(A=B?T:E) + If A equals B then T else E. A and B are each either a decimal + constant or a single letter interpreted as above. T and E are + arbitrary format strings. This format spec is equivalent to T if + A's value equals B's; otherwise it is equivalent to E. For + example, '%(N=0?no:%dN) line%(N=1?:s)' is equivalent to 'no lines' + if N (the number of lines in the group in the new file) is 0, + to '1 line' if N is 1, and to '%dN lines' otherwise. + %c'C' + where C is a single character, stands for the character C. C may not + be a backslash or an apostrophe. E.g. %c':' stands for a colon. + %c'\O' + where O is a string of 1, 2, or 3 octal digits, stands for the + character with octal code O. E.g. %c'\0' stands for a null character. +* New diff line format specifications: + n + The line number, printed with . + E.g. '%5dn' prints the line number with a "%5d" format. + %c'C' + %c'\O' + The character C, or with octal code O, as above. +* Supported s have the same meaning as with printf, but must + match the extended regular expression %-*[0-9]*(\.[0-9]*)?[doxX]. +* The format spec %0 introduced in version 2.1 has been removed, since it + is incompatible with printf specs like %02d. To represent a null char, + use %c'\0' instead. +* cmp and diff now conform to POSIX 1003.2-1992 (ISO/IEC 9945-2:1993) + if the underlying system conforms to POSIX: + - Some messages' wordings are changed in minor ways. + - "White space" is now whatever C's 'isspace' says it is. + - When comparing directories, if 'diff' finds a file that is not a regular + file or a directory, it reports the file's type instead of diffing it. + (As usual, it follows symbolic links first.) + - When signaled, sdiff exits with the signal's status, not with status 2. +* Now portable to hosts where int, long, pointer, etc. are not all the same + size. +* 'cmp - -' now works like 'diff - -'. + + +User-visible changes in version 2.3: + +* New diff option: --horizon-lines=lines + + +User-visible changes in version 2.1: + +* New diff options: + --{old,new,unchanged}-line-format='format' + --{old,new,unchanged,changed}-group-format='format' + -U +* New diff3 option: + -A --show-all +* diff3 -m now defaults to -A, not -E. +* diff3 now takes up to three -L or --label options, not just two. + If just two options are given, they refer to the first two input files, + not the first and third input files. +* sdiff and diff -y handle incomplete lines. + + +User-visible changes in version 2.0: + +* Add sdiff and cmp programs. +* Add Texinfo documentation. +* Add configure script. +* Improve diff performance. +* New diff options: +-x --exclude +-X --exclude-from +-P --unidirectional-new-file +-W --width +-y --side-by-side +--left-column +--sdiff-merge-assist +--suppress-common-lines +* diff options renamed: +--label renamed from --file-label +--forward-ed renamed from --reversed-ed +--paginate renamed from --print +--entire-new-file renamed from --entire-new-files +--new-file renamed from --new-files +--all-text removed +* New diff3 options: +-v --version +* Add long-named equivalents for other diff3 options. +* diff options -F (--show-function-line) and -I (--ignore-matching-lines) + can now be given more than once. + + + +Copyright (C) 1993-1994, 1998, 2001-2002, 2004, 2006, 2009-2013, 2015-2017 Free +Software Foundation, Inc. + +This file is part of GNU Diffutils. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/local/recipes/tools/diffutils/source/README b/local/recipes/tools/diffutils/source/README new file mode 100644 index 0000000000..665a6b11a6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/README @@ -0,0 +1,64 @@ +README for GNU DIFF + +This directory contains the GNU diff, diff3, sdiff, and cmp utilities. +Their features are a superset of the Unix features and they are +significantly faster. + +Please see the file COPYING for copying conditions. + +Please see the file doc/version.texi for version information. + +Please see the file doc/diffutils.texi (or doc/diffutils.info) for +documentation that can be printed with TeX, or read with the 'info' +program or with Emacs's 'M-x info'. Brief man pages are in man/*, +but they are no substitute for the documentation. + +Please see the file ABOUT-NLS for notes about translations. + +Please see the file INSTALL for generic compilation and installation +instructions. Briefly, you can run "./configure; make install". The +command "./configure --help" lists the supported --enable and --with +options. + +If you have a problem with internationalization, you might be able to +work around it as described in ABOUT-NLS by invoking './configure +--disable-nls'. Many of the problems arise from dynamic linking +issues on non-GNU platforms (e.g. with the iconv library). Such +problems tend to be shared by other GNU applications on these +platforms, and can usually be fixed by carefully tweaking your non-GNU +installation. If you have an older version of libiconv, please +upgrade to the latest one; see . If +the problem seems isolated to diffutils, though, please report a bug. + +This program requires a Standard C compiler (C89 or later). If you +have a nonstandard compiler, please install GCC first. + +If you make changes to the source code, you may need appropriate +versions of GNU build tools to regenerate the intermediate files. The +following versions were used to generate the intermediate files in +this distribution: + +* Autoconf 2.59 +* Automake 1.8.3 +* gettext 0.14.1 +* help2man 1.33 +* Texinfo 4.7 + +For any copyright year range specified as YYYY-ZZZZ in this package +note that the range specifies every single year in that closed interval. + +Please report bugs to . + +----- + +Copyright (C) 1992, 1998, 2001-2002, 2004, 2009-2013, 2015-2017 Free Software +Foundation, Inc. + +This file is part of GNU Diffutils. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with no Front-Cover Texts, and with no Back-Cover +Texts. A copy of the license is included in the "GNU Free +Documentation License" file as part of this distribution. diff --git a/local/recipes/tools/diffutils/source/THANKS b/local/recipes/tools/diffutils/source/THANKS new file mode 100644 index 0000000000..a96b68df77 --- /dev/null +++ b/local/recipes/tools/diffutils/source/THANKS @@ -0,0 +1,23 @@ +Thanks to all the following for their contributions to GNU diffutils: + +Thomas Bushnell, BSG +Wayne Davison +Ulrich Drepper +Paul Eggert +Jay Fenlason +John Gilmore +Torbjorn Granlund +Mike Haertel +Bruno Haible +Chris Hanson +Jim Kingdon +Tom Lord +David J. MacKenzie +Roland McGrath +Jim Meyering +Gene Myers +Randy Smith +Richard Stallman +Leonard H. Tower Jr. +Larry Wall +Eli Zaretskii diff --git a/local/recipes/tools/diffutils/source/TODO b/local/recipes/tools/diffutils/source/TODO new file mode 100644 index 0000000000..5132de8e8e --- /dev/null +++ b/local/recipes/tools/diffutils/source/TODO @@ -0,0 +1,9 @@ +Add --include option (opposite of --exclude). + +Look into sdiff improvement here: +http://www.pkix.net/~chuck/sdiff2.diff + +Propagate stderr from subprocess so that diff3 does +a better job of explaining _why_: + > $ diff3 /bin/sh /bin/false /bin/mv + > diff3: subsidiary program 'diff' failed (exit status 2) diff --git a/local/recipes/tools/diffutils/source/aclocal.m4 b/local/recipes/tools/diffutils/source/aclocal.m4 new file mode 100644 index 0000000000..9d65461c3d --- /dev/null +++ b/local/recipes/tools/diffutils/source/aclocal.m4 @@ -0,0 +1,1512 @@ +# generated automatically by aclocal 1.18.1 -*- Autoconf -*- + +# Copyright (C) 1996-2025 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],, +[m4_warning([this file was generated for autoconf 2.72. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.18' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.18.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.18.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thus: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_IF_OPTION([tar-v7], [_AM_PROG_TAR([v7])], + [_AM_PROG_TAR([ustar])])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + +AC_REQUIRE([_AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +AC_REQUIRE([_AM_PROG_RM_F]) +AC_REQUIRE([_AM_PROG_XARGS_N]) + +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. +AC_DEFUN([AM_MAKE_INCLUDE], +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + # aligned with autoconf, so not including core; see bug#72225. + rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \ + conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \ + conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2022-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_RM_F +# --------------- +# Check whether 'rm -f' without any arguments works. +# https://bugs.gnu.org/10828 +AC_DEFUN([_AM_PROG_RM_F], +[am__rm_f_notfound= +AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""']) +AC_SUBST(am__rm_f_notfound) +]) + +# Copyright (C) 2001-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SLEEP_FRACTIONAL_SECONDS +# ---------------------------- +AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl +AC_CACHE_CHECK([whether sleep supports fractional seconds], + am_cv_sleep_fractional_seconds, [dnl +AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes], + [am_cv_sleep_fractional_seconds=no]) +])]) + +# _AM_FILESYSTEM_TIMESTAMP_RESOLUTION +# ----------------------------------- +# Determine the filesystem's resolution for file modification +# timestamps. The coarsest we know of is FAT, with a resolution +# of only two seconds, even with the most recent "exFAT" extensions. +# The finest (e.g. ext4 with large inodes, XFS, ZFS) is one +# nanosecond, matching clock_gettime. However, it is probably not +# possible to delay execution of a shell script for less than one +# millisecond, due to process creation overhead and scheduling +# granularity, so we don't check for anything finer than that. (See below.) +AC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl +AC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS]) +AC_CACHE_CHECK([filesystem timestamp resolution], + am_cv_filesystem_timestamp_resolution, [dnl +# Default to the worst case. +am_cv_filesystem_timestamp_resolution=2 + +# Only try to go finer than 1 sec if sleep can do it. +# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, +# - 1 sec is not much of a win compared to 2 sec, and +# - it takes 2 seconds to perform the test whether 1 sec works. +# +# Instead, just use the default 2s on platforms that have 1s resolution, +# accept the extra 1s delay when using $sleep in the Automake tests, in +# exchange for not incurring the 2s delay for running the test for all +# packages. +# +am_try_resolutions= +if test "$am_cv_sleep_fractional_seconds" = yes; then + # Even a millisecond often causes a bunch of false positives, + # so just try a hundredth of a second. The time saved between .001 and + # .01 is not terribly consequential. + am_try_resolutions="0.01 0.1 $am_try_resolutions" +fi + +# In order to catch current-generation FAT out, we must *modify* files +# that already exist; the *creation* timestamp is finer. Use names +# that make ls -t sort them differently when they have equal +# timestamps than when they have distinct timestamps, keeping +# in mind that ls -t prints the *newest* file first. +rm -f conftest.ts? +: > conftest.ts1 +: > conftest.ts2 +: > conftest.ts3 + +# Make sure ls -t actually works. Do 'set' in a subshell so we don't +# clobber the current shell's arguments. (Outer-level square brackets +# are removed by m4; they're present so that m4 does not expand +# ; be careful, easy to get confused.) +if ( + set X `[ls -t conftest.ts[12]]` && + { + test "$[]*" != "X conftest.ts1 conftest.ts2" || + test "$[]*" != "X conftest.ts2 conftest.ts1"; + } +); then :; else + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + _AS_ECHO_UNQUOTED( + ["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""], + [AS_MESSAGE_LOG_FD]) + AC_MSG_FAILURE([ls -t produces unexpected output. +Make sure there is not a broken ls alias in your environment.]) +fi + +for am_try_res in $am_try_resolutions; do + # Any one fine-grained sleep might happen to cross the boundary + # between two values of a coarser actual resolution, but if we do + # two fine-grained sleeps in a row, at least one of them will fall + # entirely within a coarse interval. + echo alpha > conftest.ts1 + sleep $am_try_res + echo beta > conftest.ts2 + sleep $am_try_res + echo gamma > conftest.ts3 + + # We assume that 'ls -t' will make use of high-resolution + # timestamps if the operating system supports them at all. + if (set X `ls -t conftest.ts?` && + test "$[]2" = conftest.ts3 && + test "$[]3" = conftest.ts2 && + test "$[]4" = conftest.ts1); then + # + # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, + # because we don't need to test make. + make_ok=true + if test $am_try_res != 1; then + # But if we've succeeded so far with a subsecond resolution, we + # have one more thing to check: make. It can happen that + # everything else supports the subsecond mtimes, but make doesn't; + # notably on macOS, which ships make 3.81 from 2006 (the last one + # released under GPLv2). https://bugs.gnu.org/68808 + # + # We test $MAKE if it is defined in the environment, else "make". + # It might get overridden later, but our hope is that in practice + # it does not matter: it is the system "make" which is (by far) + # the most likely to be broken, whereas if the user overrides it, + # probably they did so with a better, or at least not worse, make. + # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html + # + # Create a Makefile (real tab character here): + rm -f conftest.mk + echo 'conftest.ts1: conftest.ts2' >conftest.mk + echo ' touch conftest.ts2' >>conftest.mk + # + # Now, running + # touch conftest.ts1; touch conftest.ts2; make + # should touch ts1 because ts2 is newer. This could happen by luck, + # but most often, it will fail if make's support is insufficient. So + # test for several consecutive successes. + # + # (We reuse conftest.ts[12] because we still want to modify existing + # files, not create new ones, per above.) + n=0 + make=${MAKE-make} + until test $n -eq 3; do + echo one > conftest.ts1 + sleep $am_try_res + echo two > conftest.ts2 # ts2 should now be newer than ts1 + if $make -f conftest.mk | grep 'up to date' >/dev/null; then + make_ok=false + break # out of $n loop + fi + n=`expr $n + 1` + done + fi + # + if $make_ok; then + # Everything we know to check worked out, so call this resolution good. + am_cv_filesystem_timestamp_resolution=$am_try_res + break # out of $am_try_res loop + fi + # Otherwise, we'll go on to check the next resolution. + fi +done +rm -f conftest.ts? +# (end _am_filesystem_timestamp_resolution) +])]) + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION]) +# This check should not be cached, as it may vary across builds of +# different projects. +AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_RESULT([no]) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_RESULT([no]) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +am_build_env_is_sane=no +am_has_slept=no +rm -f conftest.file +for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[]*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + test "$[]2" = conftest.file + ); then + am_build_env_is_sane=yes + break + fi + # Just in case. + sleep "$am_cv_filesystem_timestamp_resolution" + am_has_slept=yes +done + +AC_MSG_RESULT([$am_build_env_is_sane]) +if test "$am_build_env_is_sane" = no; then + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi + +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl + ( sleep "$am_cv_filesystem_timestamp_resolution" ) & + am_sleep_pid=$! +]) +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SILENT_RULES +# ---------------- +# Enable less verbose build rules support. +AC_DEFUN([_AM_SILENT_RULES], +[AM_DEFAULT_VERBOSITY=1 +AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls +dnl to AM_SILENT_RULES to change the default value. +AC_CONFIG_COMMANDS_PRE([dnl +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; +esac +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +])dnl +]) + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or +# empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_REQUIRE([_AM_SILENT_RULES]) +AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])m4_newline +dnl We intentionally force a newline after the assignment, since a) nothing +dnl good can come of more text following, and b) that was the behavior +dnl before 1.17. See https://bugs.gnu.org/72267. +]) + +# Copyright (C) 2001-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test x$am_uid = xunknown; then + AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work]) + elif test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test x$gm_gid = xunknown; then + AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work]) + elif test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +# Copyright (C) 2022-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_XARGS_N +# ---------------- +# Check whether 'xargs -n' works. It should work everywhere, so the fallback +# is not optimized at all as we never expect to use it. +AC_DEFUN([_AM_PROG_XARGS_N], +[AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl +AS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 +3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])]) +AS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl + am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }' +])dnl +AC_SUBST(am__xargs_n) +]) + +m4_include([m4/00gnulib.m4]) +m4_include([m4/absolute-header.m4]) +m4_include([m4/alloca.m4]) +m4_include([m4/arpa_inet_h.m4]) +m4_include([m4/btowc.m4]) +m4_include([m4/builtin-expect.m4]) +m4_include([m4/c-stack.m4]) +m4_include([m4/clock_time.m4]) +m4_include([m4/close.m4]) +m4_include([m4/codeset.m4]) +m4_include([m4/config-h.m4]) +m4_include([m4/configmake.m4]) +m4_include([m4/ctype.m4]) +m4_include([m4/dirname.m4]) +m4_include([m4/double-slash-root.m4]) +m4_include([m4/dup2.m4]) +m4_include([m4/eealloc.m4]) +m4_include([m4/environ.m4]) +m4_include([m4/errno_h.m4]) +m4_include([m4/error.m4]) +m4_include([m4/exponentd.m4]) +m4_include([m4/extensions.m4]) +m4_include([m4/extern-inline.m4]) +m4_include([m4/fcntl-o.m4]) +m4_include([m4/fcntl.m4]) +m4_include([m4/fcntl_h.m4]) +m4_include([m4/fdopen.m4]) +m4_include([m4/filenamecat.m4]) +m4_include([m4/flexmember.m4]) +m4_include([m4/float_h.m4]) +m4_include([m4/fnmatch.m4]) +m4_include([m4/fpieee.m4]) +m4_include([m4/freopen.m4]) +m4_include([m4/fstat.m4]) +m4_include([m4/ftruncate.m4]) +m4_include([m4/getcwd.m4]) +m4_include([m4/getdtablesize.m4]) +m4_include([m4/getopt.m4]) +m4_include([m4/getpagesize.m4]) +m4_include([m4/getprogname.m4]) +m4_include([m4/gettext.m4]) +m4_include([m4/gettime.m4]) +m4_include([m4/gettimeofday.m4]) +m4_include([m4/glibc21.m4]) +m4_include([m4/gnu-make.m4]) +m4_include([m4/gnulib-common.m4]) +m4_include([m4/gnulib-comp.m4]) +m4_include([m4/hard-locale.m4]) +m4_include([m4/iconv.m4]) +m4_include([m4/iconv_h.m4]) +m4_include([m4/iconv_open.m4]) +m4_include([m4/include_next.m4]) +m4_include([m4/inet_pton.m4]) +m4_include([m4/inline.m4]) +m4_include([m4/intlmacosx.m4]) +m4_include([m4/intmax_t.m4]) +m4_include([m4/inttostr.m4]) +m4_include([m4/inttypes-pri.m4]) +m4_include([m4/inttypes.m4]) +m4_include([m4/inttypes_h.m4]) +m4_include([m4/ioctl.m4]) +m4_include([m4/isblank.m4]) +m4_include([m4/iswblank.m4]) +m4_include([m4/langinfo_h.m4]) +m4_include([m4/largefile.m4]) +m4_include([m4/lib-ld.m4]) +m4_include([m4/lib-link.m4]) +m4_include([m4/lib-prefix.m4]) +m4_include([m4/libsigsegv.m4]) +m4_include([m4/libunistring-base.m4]) +m4_include([m4/limits-h.m4]) +m4_include([m4/localcharset.m4]) +m4_include([m4/locale-fr.m4]) +m4_include([m4/locale-ja.m4]) +m4_include([m4/locale-tr.m4]) +m4_include([m4/locale-zh.m4]) +m4_include([m4/locale_h.m4]) +m4_include([m4/localeconv.m4]) +m4_include([m4/localtime-buffer.m4]) +m4_include([m4/longlong.m4]) +m4_include([m4/lstat.m4]) +m4_include([m4/malloc.m4]) +m4_include([m4/malloca.m4]) +m4_include([m4/manywarnings.m4]) +m4_include([m4/mbchar.m4]) +m4_include([m4/mbiter.m4]) +m4_include([m4/mbrtowc.m4]) +m4_include([m4/mbsinit.m4]) +m4_include([m4/mbslen.m4]) +m4_include([m4/mbsrtowcs.m4]) +m4_include([m4/mbstate_t.m4]) +m4_include([m4/mbtowc.m4]) +m4_include([m4/memchr.m4]) +m4_include([m4/minmax.m4]) +m4_include([m4/mkstemp.m4]) +m4_include([m4/mktime.m4]) +m4_include([m4/mmap-anon.m4]) +m4_include([m4/mode_t.m4]) +m4_include([m4/msvc-inval.m4]) +m4_include([m4/msvc-nothrow.m4]) +m4_include([m4/multiarch.m4]) +m4_include([m4/nanosleep.m4]) +m4_include([m4/netinet_in_h.m4]) +m4_include([m4/nl_langinfo.m4]) +m4_include([m4/nls.m4]) +m4_include([m4/nocrash.m4]) +m4_include([m4/off_t.m4]) +m4_include([m4/open.m4]) +m4_include([m4/pathmax.m4]) +m4_include([m4/perror.m4]) +m4_include([m4/pipe.m4]) +m4_include([m4/po.m4]) +m4_include([m4/printf.m4]) +m4_include([m4/progtest.m4]) +m4_include([m4/putenv.m4]) +m4_include([m4/quote.m4]) +m4_include([m4/quotearg.m4]) +m4_include([m4/raise.m4]) +m4_include([m4/rawmemchr.m4]) +m4_include([m4/readlink.m4]) +m4_include([m4/regex.m4]) +m4_include([m4/secure_getenv.m4]) +m4_include([m4/select.m4]) +m4_include([m4/setenv.m4]) +m4_include([m4/setlocale.m4]) +m4_include([m4/sigaction.m4]) +m4_include([m4/signal_h.m4]) +m4_include([m4/signalblocking.m4]) +m4_include([m4/size_max.m4]) +m4_include([m4/sleep.m4]) +m4_include([m4/snprintf.m4]) +m4_include([m4/socketlib.m4]) +m4_include([m4/sockets.m4]) +m4_include([m4/socklen.m4]) +m4_include([m4/sockpfaf.m4]) +m4_include([m4/ssize_t.m4]) +m4_include([m4/stat-time.m4]) +m4_include([m4/stat.m4]) +m4_include([m4/stdalign.m4]) +m4_include([m4/stdarg.m4]) +m4_include([m4/stdbool.m4]) +m4_include([m4/stddef_h.m4]) +m4_include([m4/stdint.m4]) +m4_include([m4/stdint_h.m4]) +m4_include([m4/stdio_h.m4]) +m4_include([m4/stdlib_h.m4]) +m4_include([m4/strcase.m4]) +m4_include([m4/strerror.m4]) +m4_include([m4/strerror_r.m4]) +m4_include([m4/strftime.m4]) +m4_include([m4/string_h.m4]) +m4_include([m4/strings_h.m4]) +m4_include([m4/strndup.m4]) +m4_include([m4/strnlen.m4]) +m4_include([m4/strptime.m4]) +m4_include([m4/strtoull.m4]) +m4_include([m4/strtoumax.m4]) +m4_include([m4/symlink.m4]) +m4_include([m4/sys_ioctl_h.m4]) +m4_include([m4/sys_select_h.m4]) +m4_include([m4/sys_socket_h.m4]) +m4_include([m4/sys_stat_h.m4]) +m4_include([m4/sys_time_h.m4]) +m4_include([m4/sys_types_h.m4]) +m4_include([m4/sys_uio_h.m4]) +m4_include([m4/sys_wait_h.m4]) +m4_include([m4/tempname.m4]) +m4_include([m4/time_h.m4]) +m4_include([m4/time_r.m4]) +m4_include([m4/time_rz.m4]) +m4_include([m4/timegm.m4]) +m4_include([m4/timespec.m4]) +m4_include([m4/tm_gmtoff.m4]) +m4_include([m4/tzset.m4]) +m4_include([m4/unistd_h.m4]) +m4_include([m4/unlocked-io.m4]) +m4_include([m4/vararrays.m4]) +m4_include([m4/vasnprintf.m4]) +m4_include([m4/vasprintf.m4]) +m4_include([m4/version-etc.m4]) +m4_include([m4/warn-on-use.m4]) +m4_include([m4/warnings.m4]) +m4_include([m4/wchar_h.m4]) +m4_include([m4/wchar_t.m4]) +m4_include([m4/wcrtomb.m4]) +m4_include([m4/wctob.m4]) +m4_include([m4/wctomb.m4]) +m4_include([m4/wctype_h.m4]) +m4_include([m4/wcwidth.m4]) +m4_include([m4/wint_t.m4]) +m4_include([m4/xalloc.m4]) +m4_include([m4/xsize.m4]) +m4_include([m4/xstrndup.m4]) +m4_include([m4/xstrtol.m4]) +m4_include([m4/xvasprintf.m4]) diff --git a/local/recipes/tools/diffutils/source/autom4te.cache/output.0 b/local/recipes/tools/diffutils/source/autom4te.cache/output.0 new file mode 100644 index 0000000000..e3b823c73b --- /dev/null +++ b/local/recipes/tools/diffutils/source/autom4te.cache/output.0 @@ -0,0 +1,43075 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.72 for GNU diffutils 3.6. +@%:@ +@%:@ Report bugs to . +@%:@ +@%:@ +@%:@ Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, +@%:@ Inc. +@%:@ +@%:@ +@%:@ This configure script is free software; the Free Software Foundation +@%:@ gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else case e in @%:@( + e) case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as 'sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed 'exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else case e in @%:@( + e) case \`(set -o) 2>/dev/null\` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : + +else case e in @%:@( + e) exitcode=1; echo positional parameters were not saved. ;; +esac +fi +test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null +then : + as_have_required=yes +else case e in @%:@( + e) as_have_required=no ;; +esac +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : + +else case e in @%:@( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + case $as_dir in @%:@( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$as_shell as_have_required=yes + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : + break 2 +fi +fi + done;; + esac + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else case e in @%:@( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi ;; +esac +fi + + + if test "x$CONFIG_SHELL" != x +then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed 'exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and +$0: bug-diffutils@gnu.org about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do have one." + fi + exit 1 +fi ;; +esac +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else case e in @%:@( + e) as_fn_append () + { + eval $1=\$$1\$2 + } ;; +esac +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else case e in @%:@( + e) as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } ;; +esac +fi # as_fn_arith + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + t clear + :clear + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_@&t@echo='printf %s\n' +as_@&t@echo_n='printf %s' + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated + +# Sed expression to map a string onto a valid variable name. +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='GNU diffutils' +PACKAGE_TARNAME='diffutils' +PACKAGE_VERSION='3.6' +PACKAGE_STRING='GNU diffutils 3.6' +PACKAGE_BUGREPORT='bug-diffutils@gnu.org' +PACKAGE_URL='https://www.gnu.org/software/diffutils/' + +ac_unique_file="src/diff.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_STDIO_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_c_list= +ac_func_c_list= +gl_fnmatch_required=POSIX +gl_getopt_required=POSIX +gt_needs= +enable_year2038=no +ac_subst_vars='gltests_LTLIBOBJS +gltests_LIBOBJS +gl_LTLIBOBJS +gl_LIBOBJS +CONFIG_INCLUDE +am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIB@&t@OBJS +POSUB +INTLLIBS +INTL_MACOSX_LIBS +XGETTEXT_EXTRA_OPTIONS +MSGMERGE +XGETTEXT_015 +XGETTEXT +GMSGFMT_015 +MSGFMT_015 +GMSGFMT +MSGFMT +GETTEXT_MACRO_VERSION +USE_NLS +SRC_VERSION_C +PR_PROGRAM +GNULIB_WARN_CFLAGS +WARN_CFLAGS +WERROR_CFLAGS +LIBTESTS_LIBDEPS +LIBDIFFUTILS_LTLIBDEPS +LIBDIFFUTILS_LIBDEPS +abs_aux_dir +HAVE_SYS_UIO_H +NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H +NEXT_SYS_UIO_H +NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H +NEXT_SYS_IOCTL_H +HAVE_SYS_IOCTL_H +GL_GENERATE_STDALIGN_H_FALSE +GL_GENERATE_STDALIGN_H_TRUE +STDALIGN_H +GL_GENERATE_NETINET_IN_H_FALSE +GL_GENERATE_NETINET_IN_H_TRUE +NETINET_IN_H +HAVE_NETINET_IN_H +NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H +NEXT_NETINET_IN_H +LIB_NANOSLEEP +LIB_SELECT +LIBSOCKET +HAVE_SYS_SELECT_H +NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H +NEXT_SYS_SELECT_H +REPLACE_SELECT +REPLACE_PSELECT +HAVE_PSELECT +GNULIB_SELECT +GNULIB_PSELECT +INET_PTON_LIB +LOCALE_TR_UTF8 +NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H +NEXT_ARPA_INET_H +HAVE_ARPA_INET_H +REPLACE_INET_PTON +REPLACE_INET_NTOP +HAVE_DECL_INET_PTON +HAVE_DECL_INET_NTOP +GNULIB_INET_PTON +GNULIB_INET_NTOP +HAVE_WS2TCPIP_H +HAVE_SYS_SOCKET_H +NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H +NEXT_SYS_SOCKET_H +HAVE_ACCEPT4 +HAVE_SA_FAMILY_T +HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY +HAVE_STRUCT_SOCKADDR_STORAGE +GNULIB_ACCEPT4 +GNULIB_SHUTDOWN +GNULIB_SETSOCKOPT +GNULIB_SENDTO +GNULIB_RECVFROM +GNULIB_SEND +GNULIB_RECV +GNULIB_LISTEN +GNULIB_GETSOCKOPT +GNULIB_GETSOCKNAME +GNULIB_GETPEERNAME +GNULIB_BIND +GNULIB_ACCEPT +GNULIB_CONNECT +GNULIB_SOCKET +gltests_WITNESS +NEXT_AS_FIRST_DIRECTIVE_WCHAR_H +NEXT_WCHAR_H +HAVE_FEATURES_H +LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE +LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE +LIBUNISTRING_UNIWIDTH_H +LIBUNISTRING_UNITYPES_H +LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE +LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE +LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE +LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE +LIBUNISTRING_UNISTR_H +HAVE_UNISTD_H +NEXT_AS_FIRST_DIRECTIVE_UNISTD_H +NEXT_UNISTD_H +UNISTD_H_DEFINES_STRUCT_TIMESPEC +PTHREAD_H_DEFINES_STRUCT_TIMESPEC +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC +TIME_H_DEFINES_STRUCT_TIMESPEC +NEXT_AS_FIRST_DIRECTIVE_TIME_H +NEXT_TIME_H +NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H +NEXT_SYS_WAIT_H +GNULIB_WAITPID +WINDOWS_STAT_INODES +WINDOWS_64_BIT_OFF_T +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H +NEXT_SYS_TYPES_H +HAVE_STRINGS_H +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H +NEXT_STRINGS_H +NEXT_AS_FIRST_DIRECTIVE_STRING_H +NEXT_STRING_H +HAVE_DECL_STRNCASECMP +HAVE_STRCASECMP +HAVE_FFS +GNULIB_FFS +NEXT_AS_FIRST_DIRECTIVE_STDLIB_H +NEXT_STDLIB_H +NEXT_AS_FIRST_DIRECTIVE_STDIO_H +NEXT_STDIO_H +HAVE__BOOL +GL_GENERATE_STDBOOL_H_FALSE +GL_GENERATE_STDBOOL_H_TRUE +STDBOOL_H +GL_GENERATE_STDARG_H_FALSE +GL_GENERATE_STDARG_H_TRUE +STDARG_H +NEXT_AS_FIRST_DIRECTIVE_STDARG_H +NEXT_STDARG_H +NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H +NEXT_SIGNAL_H +REPLACE_RAISE +REPLACE_PTHREAD_SIGMASK +HAVE_SIGHANDLER_T +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T +HAVE_STRUCT_SIGACTION_SA_SIGACTION +HAVE_SIGACTION +HAVE_SIGINFO_T +HAVE_SIGSET_T +HAVE_RAISE +HAVE_PTHREAD_SIGMASK +HAVE_POSIX_SIGNALBLOCKING +GNULIB_SIGACTION +GNULIB_SIGPROCMASK +GNULIB_SIGNAL_H_SIGPIPE +GNULIB_RAISE +GNULIB_PTHREAD_SIGMASK +UNDEFINE_STRTOK_R +REPLACE_STRTOK_R +REPLACE_STRSIGNAL +REPLACE_STRNLEN +REPLACE_STRNDUP +REPLACE_STRNCAT +REPLACE_STRERROR_R +REPLACE_STRERROR +REPLACE_STRCHRNUL +REPLACE_STRCASESTR +REPLACE_STRSTR +REPLACE_STRDUP +REPLACE_STPNCPY +REPLACE_MEMMEM +REPLACE_MEMCHR +HAVE_STRVERSCMP +HAVE_DECL_STRSIGNAL +HAVE_DECL_STRERROR_R +HAVE_DECL_STRTOK_R +HAVE_STRCASESTR +HAVE_STRSEP +HAVE_STRPBRK +HAVE_DECL_STRNLEN +HAVE_DECL_STRNDUP +HAVE_DECL_STRDUP +HAVE_STRCHRNUL +HAVE_STPNCPY +HAVE_STPCPY +HAVE_RAWMEMCHR +HAVE_DECL_MEMRCHR +HAVE_MEMPCPY +HAVE_DECL_MEMMEM +HAVE_MEMCHR +HAVE_FFSLL +HAVE_FFSL +HAVE_MBSLEN +GNULIB_STRVERSCMP +GNULIB_STRSIGNAL +GNULIB_STRERROR_R +GNULIB_STRERROR +GNULIB_MBSTOK_R +GNULIB_MBSSEP +GNULIB_MBSSPN +GNULIB_MBSPBRK +GNULIB_MBSCSPN +GNULIB_MBSCASESTR +GNULIB_MBSPCASECMP +GNULIB_MBSNCASECMP +GNULIB_MBSCASECMP +GNULIB_MBSSTR +GNULIB_MBSRCHR +GNULIB_MBSCHR +GNULIB_MBSNLEN +GNULIB_MBSLEN +GNULIB_STRTOK_R +GNULIB_STRCASESTR +GNULIB_STRSTR +GNULIB_STRSEP +GNULIB_STRPBRK +GNULIB_STRNLEN +GNULIB_STRNDUP +GNULIB_STRNCAT +GNULIB_STRDUP +GNULIB_STRCHRNUL +GNULIB_STPNCPY +GNULIB_STPCPY +GNULIB_RAWMEMCHR +GNULIB_MEMRCHR +GNULIB_MEMPCPY +GNULIB_MEMMEM +GNULIB_MEMCHR +GNULIB_FFSLL +GNULIB_FFSL +LOCALE_FR_UTF8 +LOCALE_ZH_CN +LOCALE_JA +REPLACE_WCTOMB +REPLACE_UNSETENV +REPLACE_STRTOD +REPLACE_SETENV +REPLACE_REALPATH +REPLACE_REALLOC +REPLACE_RANDOM_R +REPLACE_QSORT_R +REPLACE_PUTENV +REPLACE_PTSNAME_R +REPLACE_PTSNAME +REPLACE_MKSTEMP +REPLACE_MBTOWC +REPLACE_MALLOC +REPLACE_CANONICALIZE_FILE_NAME +REPLACE_CALLOC +HAVE_DECL_UNSETENV +HAVE_UNLOCKPT +HAVE_SYS_LOADAVG_H +HAVE_STRUCT_RANDOM_DATA +HAVE_STRTOULL +HAVE_STRTOLL +HAVE_STRTOD +HAVE_DECL_SETENV +HAVE_SETENV +HAVE_SECURE_GETENV +HAVE_RPMATCH +HAVE_REALPATH +HAVE_RANDOM_R +HAVE_RANDOM_H +HAVE_RANDOM +HAVE_QSORT_R +HAVE_PTSNAME_R +HAVE_PTSNAME +HAVE_POSIX_OPENPT +HAVE_MKSTEMPS +HAVE_MKSTEMP +HAVE_MKOSTEMPS +HAVE_MKOSTEMP +HAVE_MKDTEMP +HAVE_GRANTPT +HAVE_GETSUBOPT +HAVE_DECL_GETLOADAVG +HAVE_CANONICALIZE_FILE_NAME +HAVE_ATOLL +HAVE__EXIT +GNULIB_WCTOMB +GNULIB_UNSETENV +GNULIB_UNLOCKPT +GNULIB_SYSTEM_POSIX +GNULIB_STRTOULL +GNULIB_STRTOLL +GNULIB_STRTOD +GNULIB_SETENV +GNULIB_SECURE_GETENV +GNULIB_RPMATCH +GNULIB_REALPATH +GNULIB_REALLOC_POSIX +GNULIB_RANDOM_R +GNULIB_RANDOM +GNULIB_QSORT_R +GNULIB_PUTENV +GNULIB_PTSNAME_R +GNULIB_PTSNAME +GNULIB_POSIX_OPENPT +GNULIB_MKSTEMPS +GNULIB_MKSTEMP +GNULIB_MKOSTEMPS +GNULIB_MKOSTEMP +GNULIB_MKDTEMP +GNULIB_MBTOWC +GNULIB_MALLOC_POSIX +GNULIB_GRANTPT +GNULIB_GETSUBOPT +GNULIB_GETLOADAVG +GNULIB_CANONICALIZE_FILE_NAME +GNULIB_CALLOC_POSIX +GNULIB_ATOLL +GNULIB__EXIT +SED +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H +NEXT_LOCALE_H +HAVE_XLOCALE_H +NEXT_AS_FIRST_DIRECTIVE_STDDEF_H +NEXT_STDDEF_H +GL_GENERATE_STDDEF_H_FALSE +GL_GENERATE_STDDEF_H_TRUE +STDDEF_H +HAVE_WCHAR_T +HAVE_MAX_ALIGN_T +REPLACE_NULL +REPLACE_STRUCT_LCONV +REPLACE_DUPLOCALE +REPLACE_SETLOCALE +REPLACE_LOCALECONV +HAVE_DUPLOCALE +GNULIB_DUPLOCALE +GNULIB_SETLOCALE +GNULIB_LOCALECONV +LOCALCHARSET_TESTS_ENVIRONMENT +GLIBC21 +HAVE_LANGINFO_YESEXPR +HAVE_LANGINFO_ERA +HAVE_LANGINFO_T_FMT_AMPM +HAVE_LANGINFO_CODESET +HAVE_LANGINFO_H +NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H +NEXT_LANGINFO_H +REPLACE_NL_LANGINFO +HAVE_NL_LANGINFO +GNULIB_NL_LANGINFO +REPLACE_TOWLOWER +REPLACE_ISWCNTRL +HAVE_WCTYPE_H +NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H +NEXT_WCTYPE_H +HAVE_CRTDEFS_H +HAVE_WINT_T +HAVE_ISWCNTRL +REPLACE_ISWBLANK +HAVE_WCTRANS_T +HAVE_WCTYPE_T +HAVE_ISWBLANK +GNULIB_TOWCTRANS +GNULIB_WCTRANS +GNULIB_ISWCTYPE +GNULIB_WCTYPE +GNULIB_ISWBLANK +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H +NEXT_INTTYPES_H +UINT64_MAX_EQ_ULONG_MAX +UINT32_MAX_LT_UINTMAX_MAX +PRIPTR_PREFIX +PRI_MACROS_BROKEN +INT64_MAX_EQ_LONG_MAX +INT32_MAX_LT_INTMAX_MAX +REPLACE_STRTOUMAX +REPLACE_STRTOIMAX +HAVE_DECL_STRTOUMAX +HAVE_DECL_STRTOIMAX +HAVE_DECL_IMAXDIV +HAVE_DECL_IMAXABS +GNULIB_STRTOUMAX +GNULIB_STRTOIMAX +GNULIB_IMAXDIV +GNULIB_IMAXABS +GL_GENERATE_STDINT_H_FALSE +GL_GENERATE_STDINT_H_TRUE +STDINT_H +HAVE_SYS_INTTYPES_H +HAVE_SYS_BITYPES_H +HAVE_C99_STDINT_H +WINT_T_SUFFIX +WCHAR_T_SUFFIX +SIG_ATOMIC_T_SUFFIX +SIZE_T_SUFFIX +PTRDIFF_T_SUFFIX +HAVE_SIGNED_WINT_T +HAVE_SIGNED_WCHAR_T +HAVE_SIGNED_SIG_ATOMIC_T +BITSIZEOF_WINT_T +BITSIZEOF_WCHAR_T +BITSIZEOF_SIG_ATOMIC_T +BITSIZEOF_SIZE_T +BITSIZEOF_PTRDIFF_T +APPLE_UNIVERSAL_BUILD +HAVE_STDINT_H +NEXT_AS_FIRST_DIRECTIVE_STDINT_H +NEXT_STDINT_H +HAVE_SYS_TYPES_H +HAVE_INTTYPES_H +HAVE_WCHAR_H +HAVE_UNSIGNED_LONG_LONG_INT +HAVE_LONG_LONG_INT +GNULIB_OVERRIDES_WINT_T +GL_GENERATE_LIMITS_H_FALSE +GL_GENERATE_LIMITS_H_TRUE +LIMITS_H +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H +NEXT_LIMITS_H +NEXT_AS_FIRST_DIRECTIVE_ICONV_H +NEXT_ICONV_H +GL_GENERATE_ICONV_H_FALSE +GL_GENERATE_ICONV_H_TRUE +ICONV_H +REPLACE_ICONV_UTF +REPLACE_ICONV_OPEN +REPLACE_ICONV +ICONV_CONST +GNULIB_ICONV +LTLIBICONV +LIBICONV +GNU_MAKE_FALSE +GNU_MAKE_TRUE +REPLACE_LOCALTIME +REPLACE_GMTIME +REPLACE_TZSET +REPLACE_TIMEGM +REPLACE_STRFTIME +REPLACE_NANOSLEEP +REPLACE_MKTIME +REPLACE_LOCALTIME_R +REPLACE_CTIME +HAVE_TIMEZONE_T +HAVE_TZSET +HAVE_TIMEGM +HAVE_STRPTIME +HAVE_NANOSLEEP +HAVE_DECL_LOCALTIME_R +GNULIB_TZSET +GNULIB_TIME_RZ +GNULIB_TIME_R +GNULIB_TIMEGM +GNULIB_STRPTIME +GNULIB_STRFTIME +GNULIB_NANOSLEEP +GNULIB_LOCALTIME +GNULIB_MKTIME +GNULIB_CTIME +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H +NEXT_SYS_TIME_H +REPLACE_STRUCT_TIMEVAL +REPLACE_GETTIMEOFDAY +HAVE_SYS_TIME_H +HAVE_STRUCT_TIMEVAL +HAVE_GETTIMEOFDAY +GNULIB_GETTIMEOFDAY +LTLIBINTL +LIBINTL +GNULIB_GL_UNISTD_H_GETOPT +GETOPT_CDEFS_H +GETOPT_H +HAVE_SYS_CDEFS_H +HAVE_GETOPT_H +NEXT_AS_FIRST_DIRECTIVE_GETOPT_H +NEXT_GETOPT_H +WINDOWS_64_BIT_ST_SIZE +WINDOWS_STAT_TIMESPEC +NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H +NEXT_SYS_STAT_H +REPLACE_UTIMENSAT +REPLACE_STAT +REPLACE_MKNOD +REPLACE_MKFIFO +REPLACE_MKDIR +REPLACE_LSTAT +REPLACE_FUTIMENS +REPLACE_FSTATAT +REPLACE_FSTAT +HAVE_UTIMENSAT +HAVE_MKNODAT +HAVE_MKNOD +HAVE_MKFIFOAT +HAVE_MKFIFO +HAVE_MKDIRAT +HAVE_LSTAT +HAVE_LCHMOD +HAVE_FUTIMENS +HAVE_FSTATAT +HAVE_FCHMODAT +GNULIB_OVERRIDES_STRUCT_STAT +GNULIB_UTIMENSAT +GNULIB_STAT +GNULIB_MKNODAT +GNULIB_MKNOD +GNULIB_MKFIFOAT +GNULIB_MKFIFO +GNULIB_MKDIRAT +GNULIB_LSTAT +GNULIB_LCHMOD +GNULIB_FUTIMENS +GNULIB_FSTATAT +GNULIB_FSTAT +GNULIB_FCHMODAT +REPLACE_VSPRINTF +REPLACE_VSNPRINTF +REPLACE_VPRINTF +REPLACE_VFPRINTF +REPLACE_VDPRINTF +REPLACE_VASPRINTF +REPLACE_TMPFILE +REPLACE_STDIO_WRITE_FUNCS +REPLACE_STDIO_READ_FUNCS +REPLACE_SPRINTF +REPLACE_SNPRINTF +REPLACE_RENAMEAT +REPLACE_RENAME +REPLACE_REMOVE +REPLACE_PRINTF +REPLACE_POPEN +REPLACE_PERROR +REPLACE_OBSTACK_PRINTF +REPLACE_GETLINE +REPLACE_GETDELIM +REPLACE_FTELLO +REPLACE_FTELL +REPLACE_FSEEKO +REPLACE_FSEEK +REPLACE_FREOPEN +REPLACE_FPURGE +REPLACE_FPRINTF +REPLACE_FOPEN +REPLACE_FFLUSH +REPLACE_FDOPEN +REPLACE_FCLOSE +REPLACE_DPRINTF +HAVE_VDPRINTF +HAVE_VASPRINTF +HAVE_RENAMEAT +HAVE_POPEN +HAVE_PCLOSE +HAVE_FTELLO +HAVE_FSEEKO +HAVE_DPRINTF +HAVE_DECL_VSNPRINTF +HAVE_DECL_SNPRINTF +HAVE_DECL_OBSTACK_PRINTF +HAVE_DECL_GETLINE +HAVE_DECL_GETDELIM +HAVE_DECL_FTELLO +HAVE_DECL_FSEEKO +HAVE_DECL_FPURGE +GNULIB_VSPRINTF_POSIX +GNULIB_VSNPRINTF +GNULIB_VPRINTF_POSIX +GNULIB_VPRINTF +GNULIB_VFPRINTF_POSIX +GNULIB_VFPRINTF +GNULIB_VDPRINTF +GNULIB_VSCANF +GNULIB_VFSCANF +GNULIB_VASPRINTF +GNULIB_TMPFILE +GNULIB_STDIO_H_SIGPIPE +GNULIB_STDIO_H_NONBLOCKING +GNULIB_SPRINTF_POSIX +GNULIB_SNPRINTF +GNULIB_SCANF +GNULIB_RENAMEAT +GNULIB_RENAME +GNULIB_REMOVE +GNULIB_PUTS +GNULIB_PUTCHAR +GNULIB_PUTC +GNULIB_PRINTF_POSIX +GNULIB_PRINTF +GNULIB_POPEN +GNULIB_PERROR +GNULIB_PCLOSE +GNULIB_OBSTACK_PRINTF_POSIX +GNULIB_OBSTACK_PRINTF +GNULIB_GETLINE +GNULIB_GETDELIM +GNULIB_GETCHAR +GNULIB_GETC +GNULIB_FWRITE +GNULIB_FTELLO +GNULIB_FTELL +GNULIB_FSEEKO +GNULIB_FSEEK +GNULIB_FSCANF +GNULIB_FREOPEN +GNULIB_FREAD +GNULIB_FPUTS +GNULIB_FPUTC +GNULIB_FPURGE +GNULIB_FPRINTF_POSIX +GNULIB_FPRINTF +GNULIB_FOPEN +GNULIB_FGETS +GNULIB_FGETC +GNULIB_FFLUSH +GNULIB_FDOPEN +GNULIB_FCLOSE +GNULIB_DPRINTF +GL_GENERATE_FNMATCH_H_FALSE +GL_GENERATE_FNMATCH_H_TRUE +FNMATCH_H +REPLACE_ITOLD +GL_GENERATE_FLOAT_H_FALSE +GL_GENERATE_FLOAT_H_TRUE +FLOAT_H +NEXT_AS_FIRST_DIRECTIVE_FLOAT_H +NEXT_FLOAT_H +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H +NEXT_FCNTL_H +REPLACE_OPENAT +REPLACE_OPEN +REPLACE_FCNTL +HAVE_OPENAT +HAVE_FCNTL +GNULIB_OPENAT +GNULIB_OPEN +GNULIB_NONBLOCKING +GNULIB_FCNTL +EOVERFLOW_VALUE +EOVERFLOW_HIDDEN +ENOLINK_VALUE +ENOLINK_HIDDEN +EMULTIHOP_VALUE +EMULTIHOP_HIDDEN +GL_GENERATE_ERRNO_H_FALSE +GL_GENERATE_ERRNO_H_TRUE +ERRNO_H +NEXT_AS_FIRST_DIRECTIVE_ERRNO_H +NEXT_ERRNO_H +NEXT_AS_FIRST_DIRECTIVE_CTYPE_H +NEXT_CTYPE_H +PRAGMA_COLUMNS +PRAGMA_SYSTEM_HEADER +INCLUDE_NEXT_AS_FIRST_DIRECTIVE +INCLUDE_NEXT +HAVE_ISBLANK +GNULIB_ISBLANK +pkglibexecdir +lispdir +HAVE_WINSOCK2_H +REPLACE_IOCTL +SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS +SYS_IOCTL_H_HAVE_WINSOCK2_H +GNULIB_IOCTL +HAVE_MSVC_INVALID_PARAMETER_HANDLER +UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS +UNISTD_H_HAVE_WINSOCK2_H +REPLACE_WRITE +REPLACE_USLEEP +REPLACE_UNLINKAT +REPLACE_UNLINK +REPLACE_TTYNAME_R +REPLACE_TRUNCATE +REPLACE_SYMLINKAT +REPLACE_SYMLINK +REPLACE_SLEEP +REPLACE_RMDIR +REPLACE_READLINKAT +REPLACE_READLINK +REPLACE_READ +REPLACE_PWRITE +REPLACE_PREAD +REPLACE_LSEEK +REPLACE_LINKAT +REPLACE_LINK +REPLACE_LCHOWN +REPLACE_ISATTY +REPLACE_GETPAGESIZE +REPLACE_GETGROUPS +REPLACE_GETLOGIN_R +REPLACE_GETDTABLESIZE +REPLACE_GETDOMAINNAME +REPLACE_GETCWD +REPLACE_FTRUNCATE +REPLACE_FCHOWNAT +REPLACE_DUP2 +REPLACE_DUP +REPLACE_CLOSE +REPLACE_CHOWN +HAVE_SYS_PARAM_H +HAVE_OS_H +HAVE_DECL_TTYNAME_R +HAVE_DECL_SETHOSTNAME +HAVE_DECL_GETUSERSHELL +HAVE_DECL_GETPAGESIZE +HAVE_DECL_GETLOGIN_R +HAVE_DECL_GETLOGIN +HAVE_DECL_GETDOMAINNAME +HAVE_DECL_FDATASYNC +HAVE_DECL_FCHDIR +HAVE_DECL_ENVIRON +HAVE_USLEEP +HAVE_UNLINKAT +HAVE_TRUNCATE +HAVE_SYMLINKAT +HAVE_SYMLINK +HAVE_SLEEP +HAVE_SETHOSTNAME +HAVE_READLINKAT +HAVE_READLINK +HAVE_PWRITE +HAVE_PREAD +HAVE_PIPE2 +HAVE_PIPE +HAVE_LINKAT +HAVE_LINK +HAVE_LCHOWN +HAVE_GROUP_MEMBER +HAVE_GETPAGESIZE +HAVE_GETLOGIN +HAVE_GETHOSTNAME +HAVE_GETGROUPS +HAVE_GETDTABLESIZE +HAVE_FTRUNCATE +HAVE_FSYNC +HAVE_FDATASYNC +HAVE_FCHOWNAT +HAVE_FCHDIR +HAVE_FACCESSAT +HAVE_EUIDACCESS +HAVE_DUP3 +HAVE_DUP2 +HAVE_CHOWN +GNULIB_WRITE +GNULIB_USLEEP +GNULIB_UNLINKAT +GNULIB_UNLINK +GNULIB_UNISTD_H_SIGPIPE +GNULIB_UNISTD_H_NONBLOCKING +GNULIB_TTYNAME_R +GNULIB_TRUNCATE +GNULIB_SYMLINKAT +GNULIB_SYMLINK +GNULIB_SLEEP +GNULIB_SETHOSTNAME +GNULIB_RMDIR +GNULIB_READLINKAT +GNULIB_READLINK +GNULIB_READ +GNULIB_PWRITE +GNULIB_PREAD +GNULIB_PIPE2 +GNULIB_PIPE +GNULIB_LSEEK +GNULIB_LINKAT +GNULIB_LINK +GNULIB_LCHOWN +GNULIB_ISATTY +GNULIB_GROUP_MEMBER +GNULIB_GETUSERSHELL +GNULIB_GETPAGESIZE +GNULIB_GETLOGIN_R +GNULIB_GETLOGIN +GNULIB_GETHOSTNAME +GNULIB_GETGROUPS +GNULIB_GETDTABLESIZE +GNULIB_GETDOMAINNAME +GNULIB_GETCWD +GNULIB_FTRUNCATE +GNULIB_FSYNC +GNULIB_FDATASYNC +GNULIB_FCHOWNAT +GNULIB_FCHDIR +GNULIB_FACCESSAT +GNULIB_EUIDACCESS +GNULIB_ENVIRON +GNULIB_DUP3 +GNULIB_DUP2 +GNULIB_DUP +GNULIB_CLOSE +GNULIB_CHOWN +GNULIB_CHDIR +LIB_CLOCK_GETTIME +LTLIBCSTACK +LIBCSTACK +LIBSIGSEGV_PREFIX +LTLIBSIGSEGV +LIBSIGSEGV +HAVE_LIBSIGSEGV +LOCALE_FR +REPLACE_WCSFTIME +REPLACE_WCSWIDTH +REPLACE_WCWIDTH +REPLACE_WCSNRTOMBS +REPLACE_WCSRTOMBS +REPLACE_WCRTOMB +REPLACE_MBSNRTOWCS +REPLACE_MBSRTOWCS +REPLACE_MBRLEN +REPLACE_MBRTOWC +REPLACE_MBSINIT +REPLACE_WCTOB +REPLACE_BTOWC +REPLACE_MBSTATE_T +HAVE_DECL_WCWIDTH +HAVE_DECL_WCTOB +HAVE_WCSFTIME +HAVE_WCSWIDTH +HAVE_WCSTOK +HAVE_WCSSTR +HAVE_WCSPBRK +HAVE_WCSSPN +HAVE_WCSCSPN +HAVE_WCSRCHR +HAVE_WCSCHR +HAVE_WCSDUP +HAVE_WCSXFRM +HAVE_WCSCOLL +HAVE_WCSNCASECMP +HAVE_WCSCASECMP +HAVE_WCSNCMP +HAVE_WCSCMP +HAVE_WCSNCAT +HAVE_WCSCAT +HAVE_WCPNCPY +HAVE_WCSNCPY +HAVE_WCPCPY +HAVE_WCSCPY +HAVE_WCSNLEN +HAVE_WCSLEN +HAVE_WMEMSET +HAVE_WMEMMOVE +HAVE_WMEMCPY +HAVE_WMEMCMP +HAVE_WMEMCHR +HAVE_WCSNRTOMBS +HAVE_WCSRTOMBS +HAVE_WCRTOMB +HAVE_MBSNRTOWCS +HAVE_MBSRTOWCS +HAVE_MBRLEN +HAVE_MBRTOWC +HAVE_MBSINIT +HAVE_BTOWC +GNULIB_WCSFTIME +GNULIB_WCSWIDTH +GNULIB_WCSTOK +GNULIB_WCSSTR +GNULIB_WCSPBRK +GNULIB_WCSSPN +GNULIB_WCSCSPN +GNULIB_WCSRCHR +GNULIB_WCSCHR +GNULIB_WCSDUP +GNULIB_WCSXFRM +GNULIB_WCSCOLL +GNULIB_WCSNCASECMP +GNULIB_WCSCASECMP +GNULIB_WCSNCMP +GNULIB_WCSCMP +GNULIB_WCSNCAT +GNULIB_WCSCAT +GNULIB_WCPNCPY +GNULIB_WCSNCPY +GNULIB_WCPCPY +GNULIB_WCSCPY +GNULIB_WCSNLEN +GNULIB_WCSLEN +GNULIB_WMEMSET +GNULIB_WMEMMOVE +GNULIB_WMEMCPY +GNULIB_WMEMCMP +GNULIB_WMEMCHR +GNULIB_WCWIDTH +GNULIB_WCSNRTOMBS +GNULIB_WCSRTOMBS +GNULIB_WCRTOMB +GNULIB_MBSNRTOWCS +GNULIB_MBSRTOWCS +GNULIB_MBRLEN +GNULIB_MBRTOWC +GNULIB_MBSINIT +GNULIB_WCTOB +GNULIB_BTOWC +GL_GENERATE_ALLOCA_H_FALSE +GL_GENERATE_ALLOCA_H_TRUE +ALLOCA_H +ALLOCA +GL_COND_LIBTOOL_FALSE +GL_COND_LIBTOOL_TRUE +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +ARFLAGS +AR +CPP +RANLIB +HELP2MAN +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__xargs_n +am__rm_f_notfound +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +CSCOPE +ETAGS +CTAGS +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +enable_largefile +with_gnu_ld +enable_rpath +with_libsigsegv_prefix +with_libiconv_prefix +with_included_regex +with_packager +with_packager_version +with_packager_bug_reports +enable_gcc_warnings +enable_nls +with_libintl_prefix +enable_year2038 +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: '$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +'configure' configures GNU diffutils 3.6 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print 'checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for '--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or '..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + @<:@@S|@ac_default_prefix@:>@ + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + @<:@PREFIX@:>@ + +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/diffutils@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of GNU diffutils 3.6:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --disable-largefile omit support for large files + --disable-rpath do not hardcode runtime library paths + --enable-gcc-warnings turn on lots of GCC warnings (for developers) + --disable-nls do not use Native Language Support + --enable-year2038 support timestamps after 2038 + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ + --with-libsigsegv-prefix[=DIR] search for libsigsegv in DIR/include and DIR/lib + --without-libsigsegv-prefix don't search for libsigsegv in includedir and libdir + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib + --without-libiconv-prefix don't search for libiconv in includedir and libdir + --without-included-regex + don't compile regex; this is the default on systems + with recent-enough versions of the GNU C Library + (use with caution on other systems). + --with-packager String identifying the packager of this software + --with-packager-version Packager-specific version information + --with-packager-bug-reports + Packager info for bug reports (URL/e-mail/...) + --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib + --without-libintl-prefix don't search for libintl in includedir and libdir + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by 'configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +GNU diffutils home page: . +General help using GNU software: . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +GNU diffutils configure 3.6 +generated by GNU Autoconf 2.72 + +Copyright (C) 2023 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +@%:@ ac_fn_c_try_compile LINENO +@%:@ -------------------------- +@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else case e in @%:@( + e) printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_compile + +@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists and can be compiled using the include files in +@%:@ INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else case e in @%:@( + e) eval "$3=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_header_compile + +@%:@ ac_fn_c_try_cpp LINENO +@%:@ ---------------------- +@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else case e in @%:@( + e) printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_cpp + +@%:@ ac_fn_c_check_type LINENO TYPE VAR INCLUDES +@%:@ ------------------------------------------- +@%:@ Tests whether TYPE exists after having included INCLUDES, setting cache +@%:@ variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in @%:@( + e) eval "$3=yes" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_type + +@%:@ ac_fn_c_try_link LINENO +@%:@ ----------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else case e in @%:@( + e) printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_link + +@%:@ ac_fn_c_try_run LINENO +@%:@ ---------------------- +@%:@ Try to run conftest.@S|@ac_ext, and return whether this succeeded. Assumes that +@%:@ executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else case e in @%:@( + e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status ;; +esac +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_run + +@%:@ ac_fn_c_check_func LINENO FUNC VAR +@%:@ ---------------------------------- +@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (void); below. */ + +#include +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (void); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main (void) +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$3=yes" +else case e in @%:@( + e) eval "$3=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_func + +@%:@ ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +@%:@ ------------------------------------------------------------------ +@%:@ Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +@%:@ accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else case e in @%:@( + e) eval "$3=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_check_decl + +@%:@ ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +@%:@ -------------------------------------------- +@%:@ Tries to find the compile-time value of EXPR in a program that includes +@%:@ INCLUDES, setting VAR accordingly. Returns whether the value could be +@%:@ computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array @<:@1 - 2 * !(($2) >= 0)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array @<:@1 - 2 * !(($2) <= $ac_mid)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid; break +else case e in @%:@( + e) as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array @<:@1 - 2 * !(($2) < 0)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array @<:@1 - 2 * !(($2) >= $ac_mid)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=$ac_mid; break +else case e in @%:@( + e) as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else case e in @%:@( + e) ac_lo= ac_hi= ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array @<:@1 - 2 * !(($2) <= $ac_mid)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid +else case e in @%:@( + e) as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +done +case $ac_lo in @%:@(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval (void) { return $2; } +static unsigned long int ulongval (void) { return $2; } +@%:@include +@%:@include +int +main (void) +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + echo >>conftest.val; read $3 &5 +printf %s "checking for $2.$3... " >&6; } +if eval test \${$4+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$4=yes" +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$4=yes" +else case e in @%:@( + e) eval "$4=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$4 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_member +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?@<:@ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by GNU diffutils $as_me 3.6, which was +generated by GNU Autoconf 2.72. Invocation command line was + + $ $0$ac_configure_args_raw + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + { + echo + + printf "%s\n" "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + printf "%s\n" "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + printf "%s\n" "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + printf "%s\n" "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +printf "%s\n" "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +printf "%s\n" "@%:@define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +printf "%s\n" "@%:@define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +printf "%s\n" "@%:@define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +printf "%s\n" "@%:@define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +printf "%s\n" "@%:@define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +printf "%s\n" "@%:@define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + ac_site_files="$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" +else + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +fi + +for ac_site_file in $ac_site_files +do + case $ac_site_file in @%:@( + */*) : + ;; @%:@( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See 'config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif + +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (char **p, int i) +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +/* Does the compiler advertise C99 conformance? */ +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +// See if C++-style comments work. + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); +extern void free (void *); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +/* Does the compiler advertise C11 conformance? */ +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +as_fn_append ac_func_c_list " btowc HAVE_BTOWC" +as_fn_append ac_func_c_list " setrlimit HAVE_SETRLIMIT" +as_fn_append ac_header_c_list " ucontext.h ucontext_h HAVE_UCONTEXT_H" +as_fn_append ac_func_c_list " sigaltstack HAVE_SIGALTSTACK" +as_fn_append ac_func_c_list " readlinkat HAVE_READLINKAT" +as_fn_append ac_func_c_list " _set_invalid_parameter_handler HAVE__SET_INVALID_PARAMETER_HANDLER" +as_fn_append ac_header_c_list " sys/socket.h sys_socket_h HAVE_SYS_SOCKET_H" +as_fn_append ac_func_c_list " fcntl HAVE_FCNTL" +as_fn_append ac_func_c_list " symlink HAVE_SYMLINK" +as_fn_append ac_func_c_list " mempcpy HAVE_MEMPCPY" +as_fn_append ac_func_c_list " isblank HAVE_ISBLANK" +as_fn_append ac_func_c_list " iswctype HAVE_ISWCTYPE" +as_fn_append ac_func_c_list " mbsrtowcs HAVE_MBSRTOWCS" +as_fn_append ac_func_c_list " wmemchr HAVE_WMEMCHR" +as_fn_append ac_func_c_list " wmemcpy HAVE_WMEMCPY" +as_fn_append ac_func_c_list " wmempcpy HAVE_WMEMPCPY" +as_fn_append ac_header_c_list " wctype.h wctype_h HAVE_WCTYPE_H" +gl_fnmatch_required=GNU +as_fn_append ac_func_c_list " getdtablesize HAVE_GETDTABLESIZE" +gl_getopt_required=GNU +as_fn_append ac_header_c_list " getopt.h getopt_h HAVE_GETOPT_H" +as_fn_append ac_header_c_list " sys/cdefs.h sys_cdefs_h HAVE_SYS_CDEFS_H" +as_fn_append ac_func_c_list " getprogname HAVE_GETPROGNAME" +as_fn_append ac_func_c_list " getexecname HAVE_GETEXECNAME" +as_fn_append ac_func_c_list " gettimeofday HAVE_GETTIMEOFDAY" +as_fn_append ac_func_c_list " nanotime HAVE_NANOTIME" +as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H" +as_fn_append ac_header_c_list " iconv.h iconv_h HAVE_ICONV_H" +as_fn_append ac_header_c_list " limits.h limits_h HAVE_LIMITS_H" +as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H" +as_fn_append ac_func_c_list " iswcntrl HAVE_ISWCNTRL" +as_fn_append ac_header_c_list " crtdefs.h crtdefs_h HAVE_CRTDEFS_H" +as_fn_append ac_func_c_list " iswblank HAVE_ISWBLANK" +as_fn_append ac_header_c_list " langinfo.h langinfo_h HAVE_LANGINFO_H" +as_fn_append ac_header_c_list " xlocale.h xlocale_h HAVE_XLOCALE_H" +as_fn_append ac_func_c_list " lstat HAVE_LSTAT" +as_fn_append ac_func_c_list " mbsinit HAVE_MBSINIT" +as_fn_append ac_func_c_list " mbrtowc HAVE_MBRTOWC" +as_fn_append ac_func_c_list " mbslen HAVE_MBSLEN" +as_fn_append ac_header_c_list " sys/mman.h sys_mman_h HAVE_SYS_MMAN_H" +as_fn_append ac_func_c_list " mprotect HAVE_MPROTECT" +as_fn_append ac_func_c_list " mkstemp HAVE_MKSTEMP" +as_fn_append ac_func_c_list " tzset HAVE_TZSET" +as_fn_append ac_func_c_list " nl_langinfo HAVE_NL_LANGINFO" +as_fn_append ac_header_c_list " sys/param.h sys_param_h HAVE_SYS_PARAM_H" +as_fn_append ac_func_c_list " readlink HAVE_READLINK" +as_fn_append ac_header_c_list " malloc.h malloc_h HAVE_MALLOC_H" +as_fn_append ac_func_c_list " secure_getenv HAVE_SECURE_GETENV" +as_fn_append ac_func_c_list " getuid HAVE_GETUID" +as_fn_append ac_func_c_list " geteuid HAVE_GETEUID" +as_fn_append ac_func_c_list " getgid HAVE_GETGID" +as_fn_append ac_func_c_list " getegid HAVE_GETEGID" +as_fn_append ac_func_c_list " setenv HAVE_SETENV" +as_fn_append ac_func_c_list " sigaction HAVE_SIGACTION" +as_fn_append ac_func_c_list " siginterrupt HAVE_SIGINTERRUPT" +as_fn_append ac_func_c_list " strerror_r HAVE_STRERROR_R" +as_fn_append ac_func_c_list " __xpg_strerror_r HAVE___XPG_STRERROR_R" +as_fn_append ac_func_c_list " strndup HAVE_STRNDUP" +as_fn_append ac_func_c_list " strptime HAVE_STRPTIME" +as_fn_append ac_func_c_list " strtoumax HAVE_STRTOUMAX" +as_fn_append ac_header_c_list " sys/wait.h sys_wait_h HAVE_SYS_WAIT_H" +as_fn_append ac_func_c_list " localtime_r HAVE_LOCALTIME_R" +as_fn_append ac_func_c_list " timegm HAVE_TIMEGM" +as_fn_append ac_func_c_list " vasnprintf HAVE_VASNPRINTF" +as_fn_append ac_header_c_list " features.h features_h HAVE_FEATURES_H" +as_fn_append ac_func_c_list " snprintf HAVE_SNPRINTF" +as_fn_append ac_func_c_list " wcrtomb HAVE_WCRTOMB" +as_fn_append ac_func_c_list " wcwidth HAVE_WCWIDTH" +as_fn_append ac_header_c_list " arpa/inet.h arpa_inet_h HAVE_ARPA_INET_H" +as_fn_append ac_func_c_list " ftruncate HAVE_FTRUNCATE" +as_fn_append ac_header_c_list " netdb.h netdb_h HAVE_NETDB_H" +as_fn_append ac_header_c_list " netinet/in.h netinet_in_h HAVE_NETINET_IN_H" +as_fn_append ac_func_c_list " newlocale HAVE_NEWLOCALE" +as_fn_append ac_header_c_list " sys/select.h sys_select_h HAVE_SYS_SELECT_H" +as_fn_append ac_func_c_list " pipe HAVE_PIPE" +as_fn_append ac_func_c_list " sleep HAVE_SLEEP" +as_fn_append ac_func_c_list " catgets HAVE_CATGETS" +as_fn_append ac_header_c_list " sys/ioctl.h sys_ioctl_h HAVE_SYS_IOCTL_H" +as_fn_append ac_func_c_list " shutdown HAVE_SHUTDOWN" +as_fn_append ac_header_c_list " sys/uio.h sys_uio_h HAVE_SYS_UIO_H" +as_fn_append ac_func_c_list " wctob HAVE_WCTOB" +as_fn_append ac_func_c_list " sigprocmask HAVE_SIGPROCMASK" +as_fn_append ac_func_c_list " strcasecoll HAVE_STRCASECOLL" +as_fn_append ac_func_c_list " stricoll HAVE_STRICOLL" +as_fn_append ac_header_c_list " vfork.h vfork_h HAVE_VFORK_H" +as_fn_append ac_func_c_list " fork HAVE_FORK" +as_fn_append ac_func_c_list " vfork HAVE_VFORK" +gt_needs="$gt_needs need-ngettext" + +# Auxiliary files required by this configure script. +ac_aux_files="config.rpath config.guess config.sub compile missing install-sh" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}/build-aux" + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else case e in @%:@( + e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; +esac +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_@&t@config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_@&t@config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_@&t@configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + +am__api_version='1.18' + + + + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in @%:@(( + ./ | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + ;; +esac +fi + if test ${ac_cv_path_install+y}; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether sleep supports fractional seconds" >&5 +printf %s "checking whether sleep supports fractional seconds... " >&6; } +if test ${am_cv_sleep_fractional_seconds+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if sleep 0.001 2>/dev/null +then : + am_cv_sleep_fractional_seconds=yes +else case e in @%:@( + e) am_cv_sleep_fractional_seconds=no ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_sleep_fractional_seconds" >&5 +printf "%s\n" "$am_cv_sleep_fractional_seconds" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking filesystem timestamp resolution" >&5 +printf %s "checking filesystem timestamp resolution... " >&6; } +if test ${am_cv_filesystem_timestamp_resolution+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # Default to the worst case. +am_cv_filesystem_timestamp_resolution=2 + +# Only try to go finer than 1 sec if sleep can do it. +# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, +# - 1 sec is not much of a win compared to 2 sec, and +# - it takes 2 seconds to perform the test whether 1 sec works. +# +# Instead, just use the default 2s on platforms that have 1s resolution, +# accept the extra 1s delay when using $sleep in the Automake tests, in +# exchange for not incurring the 2s delay for running the test for all +# packages. +# +am_try_resolutions= +if test "$am_cv_sleep_fractional_seconds" = yes; then + # Even a millisecond often causes a bunch of false positives, + # so just try a hundredth of a second. The time saved between .001 and + # .01 is not terribly consequential. + am_try_resolutions="0.01 0.1 $am_try_resolutions" +fi + +# In order to catch current-generation FAT out, we must *modify* files +# that already exist; the *creation* timestamp is finer. Use names +# that make ls -t sort them differently when they have equal +# timestamps than when they have distinct timestamps, keeping +# in mind that ls -t prints the *newest* file first. +rm -f conftest.ts? +: > conftest.ts1 +: > conftest.ts2 +: > conftest.ts3 + +# Make sure ls -t actually works. Do 'set' in a subshell so we don't +# clobber the current shell's arguments. (Outer-level square brackets +# are removed by m4; they're present so that m4 does not expand +# ; be careful, easy to get confused.) +if ( + set X `ls -t conftest.ts[12]` && + { + test "$*" != "X conftest.ts1 conftest.ts2" || + test "$*" != "X conftest.ts2 conftest.ts1"; + } +); then :; else + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + printf "%s\n" ""Bad output from ls -t: \"`ls -t conftest.ts[12]`\""" >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "ls -t produces unexpected output. +Make sure there is not a broken ls alias in your environment. +See 'config.log' for more details" "$LINENO" 5; } +fi + +for am_try_res in $am_try_resolutions; do + # Any one fine-grained sleep might happen to cross the boundary + # between two values of a coarser actual resolution, but if we do + # two fine-grained sleeps in a row, at least one of them will fall + # entirely within a coarse interval. + echo alpha > conftest.ts1 + sleep $am_try_res + echo beta > conftest.ts2 + sleep $am_try_res + echo gamma > conftest.ts3 + + # We assume that 'ls -t' will make use of high-resolution + # timestamps if the operating system supports them at all. + if (set X `ls -t conftest.ts?` && + test "$2" = conftest.ts3 && + test "$3" = conftest.ts2 && + test "$4" = conftest.ts1); then + # + # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, + # because we don't need to test make. + make_ok=true + if test $am_try_res != 1; then + # But if we've succeeded so far with a subsecond resolution, we + # have one more thing to check: make. It can happen that + # everything else supports the subsecond mtimes, but make doesn't; + # notably on macOS, which ships make 3.81 from 2006 (the last one + # released under GPLv2). https://bugs.gnu.org/68808 + # + # We test $MAKE if it is defined in the environment, else "make". + # It might get overridden later, but our hope is that in practice + # it does not matter: it is the system "make" which is (by far) + # the most likely to be broken, whereas if the user overrides it, + # probably they did so with a better, or at least not worse, make. + # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html + # + # Create a Makefile (real tab character here): + rm -f conftest.mk + echo 'conftest.ts1: conftest.ts2' >conftest.mk + echo ' touch conftest.ts2' >>conftest.mk + # + # Now, running + # touch conftest.ts1; touch conftest.ts2; make + # should touch ts1 because ts2 is newer. This could happen by luck, + # but most often, it will fail if make's support is insufficient. So + # test for several consecutive successes. + # + # (We reuse conftest.ts[12] because we still want to modify existing + # files, not create new ones, per above.) + n=0 + make=${MAKE-make} + until test $n -eq 3; do + echo one > conftest.ts1 + sleep $am_try_res + echo two > conftest.ts2 # ts2 should now be newer than ts1 + if $make -f conftest.mk | grep 'up to date' >/dev/null; then + make_ok=false + break # out of $n loop + fi + n=`expr $n + 1` + done + fi + # + if $make_ok; then + # Everything we know to check worked out, so call this resolution good. + am_cv_filesystem_timestamp_resolution=$am_try_res + break # out of $am_try_res loop + fi + # Otherwise, we'll go on to check the next resolution. + fi +done +rm -f conftest.ts? +# (end _am_filesystem_timestamp_resolution) + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_filesystem_timestamp_resolution" >&5 +printf "%s\n" "$am_cv_filesystem_timestamp_resolution" >&6; } + +# This check should not be cached, as it may vary across builds of +# different projects. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +am_build_env_is_sane=no +am_has_slept=no +rm -f conftest.file +for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + test "$2" = conftest.file + ); then + am_build_env_is_sane=yes + break + fi + # Just in case. + sleep "$am_cv_filesystem_timestamp_resolution" + am_has_slept=yes +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_build_env_is_sane" >&5 +printf "%s\n" "$am_build_env_is_sane" >&6; } +if test "$am_build_env_is_sane" = no; then + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi + +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1 +then : + +else case e in @%:@( + e) ( sleep "$am_cv_filesystem_timestamp_resolution" ) & + am_sleep_pid=$! + ;; +esac +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was 's,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + *'BusyBox '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + ;; +esac +fi + + test -d ./--version && rmdir ./--version + if test ${ac_cv_path_mkdir+y}; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use plain mkdir -p, + # in the hope it doesn't have the bugs of ancient mkdir. + MKDIR_P='mkdir -p' + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make ;; +esac +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +AM_DEFAULT_VERBOSITY=1 +@%:@ Check whether --enable-silent-rules was given. +if test ${enable_silent_rules+y} +then : + enableval=$enable_silent_rules; +fi + +am_make=${MAKE-make} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if printf "%s\n" 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } +AM_BACKSLASH='\' + +am__rm_f_notfound= +if (rm -f && rm -fr && rm -rf) 2>/dev/null +then : + +else case e in @%:@( + e) am__rm_f_notfound='""' ;; +esac +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking xargs -n works" >&5 +printf %s "checking xargs -n works... " >&6; } +if test ${am_cv_xargs_n_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 +3" +then : + am_cv_xargs_n_works=yes +else case e in @%:@( + e) am_cv_xargs_n_works=no ;; +esac +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_xargs_n_works" >&5 +printf "%s\n" "$am_cv_xargs_n_works" >&6; } +if test "$am_cv_xargs_n_works" = yes +then : + am__xargs_n='xargs -n' +else case e in @%:@( + e) am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "" "$am__xargs_n_arg"; done; }' + ;; +esac +fi + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='diffutils' + VERSION='3.6' + + +printf "%s\n" "@%:@define PACKAGE \"$PACKAGE\"" >>confdefs.h + + +printf "%s\n" "@%:@define VERSION \"$VERSION\"" >>confdefs.h + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar plaintar pax cpio none' + +# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 +printf %s "checking whether UID '$am_uid' is supported by ustar format... " >&6; } + if test x$am_uid = xunknown; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&5 +printf "%s\n" "$as_me: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&2;} + elif test $am_uid -le $am_max_uid; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + _am_tools=none + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 +printf %s "checking whether GID '$am_gid' is supported by ustar format... " >&6; } + if test x$gm_gid = xunknown; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&5 +printf "%s\n" "$as_me: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&2;} + elif test $am_gid -le $am_max_gid; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + _am_tools=none + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 +printf %s "checking how to create a ustar tar archive... " >&6; } + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_ustar-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + { echo "$as_me:$LINENO: $_am_tar --version" >&5 + ($_am_tar --version) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && break + done + am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x ustar -w "$$tardir"' + am__tar_='pax -L -x ustar -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H ustar -L' + am__tar_='find "$tardir" -print | cpio -o -H ustar -L' + am__untar='cpio -i -H ustar -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_ustar}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 + (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + rm -rf conftest.dir + if test -s conftest.tar; then + { echo "$as_me:$LINENO: $am__untar &5 + ($am__untar &5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 + (cat conftest.dir/file) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + if test ${am_cv_prog_tar_ustar+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) am_cv_prog_tar_ustar=$_am_tool ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 +printf "%s\n" "$am_cv_prog_tar_ustar" >&6; } + + + + + +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + + + + + + + +AM_DEFAULT_VERBOSITY=0 + + # make --enable-silent-rules the default. + +ac_config_headers="$ac_config_headers lib/config.h:lib/config.hin" + + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $@%:@ != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See 'config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. +# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an '-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else case e in @%:@( + e) ac_file='' ;; +esac +fi +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See 'config.log' for more details" "$LINENO" 5; } +else case e in @%:@( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else case e in @%:@( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See 'config.log' for more details" "$LINENO" 5; } ;; +esac +fi +rm -f conftest conftest$ac_cv_exeext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main (void) +{ +FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else case e in @%:@( + e) printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See 'config.log' for more details" "$LINENO" 5; } ;; +esac +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else case e in @%:@( + e) ac_compiler_gnu=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else case e in @%:@( + e) CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in @%:@( + e) ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in @%:@( + e) if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in @%:@( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in @%:@( + e) if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in @%:@( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in @%:@( + e) if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in @%:@( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 ;; +esac +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + # aligned with autoconf, so not including core; see bug#72225. + rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \ + conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \ + conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM + unset am_i ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in @%:@( + '0:this is the am__doit target') : + case $s in @%:@( + BSD) : + am__include='.include' am__quote='"' ;; @%:@( + *) : + am__include='include' am__quote='' ;; +esac ;; @%:@( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } + +@%:@ Check whether --enable-dependency-tracking was given. +if test ${enable_dependency_tracking+y} +then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thus: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + + +HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"} + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "@%:@define STDC_HEADERS 1" >>confdefs.h + +fi + + ac_fn_c_check_header_compile "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes +then : + MINIX=yes +else case e in @%:@( + e) MINIX= ;; +esac +fi + + if test "$MINIX" = yes; then + +printf "%s\n" "@%:@define _POSIX_SOURCE 1" >>confdefs.h + + +printf "%s\n" "@%:@define _POSIX_1_SOURCE 2" >>confdefs.h + + +printf "%s\n" "@%:@define _MINIX 1" >>confdefs.h + + +printf "%s\n" "@%:@define _NETBSD_SOURCE 1" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test ${ac_cv_safe_to_define___extensions__+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_safe_to_define___extensions__=yes +else case e in @%:@( + e) ac_cv_safe_to_define___extensions__=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + printf "%s\n" "@%:@define __EXTENSIONS__ 1" >>confdefs.h + + printf "%s\n" "@%:@define _ALL_SOURCE 1" >>confdefs.h + + printf "%s\n" "@%:@define _DARWIN_C_SOURCE 1" >>confdefs.h + + printf "%s\n" "@%:@define _GNU_SOURCE 1" >>confdefs.h + + printf "%s\n" "@%:@define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h + + printf "%s\n" "@%:@define _TANDEM_SOURCE 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 +printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } +if test ${ac_cv_should_define__xopen_source+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_should_define__xopen_source=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define _XOPEN_SOURCE 500 + #include + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_should_define__xopen_source=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 +printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } + test $ac_cv_should_define__xopen_source = yes && + printf "%s\n" "@%:@define _XOPEN_SOURCE 500" >>confdefs.h + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else case e in @%:@( + e) # Broken: fails on valid input. +continue ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else case e in @%:@( + e) # Passes both tests. +ac_preproc_ok=: +break ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + break +fi + + done + ac_cv_prog_CPP=$CPP + ;; +esac +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else case e in @%:@( + e) # Broken: fails on valid input. +continue ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else case e in @%:@( + e) # Passes both tests. +ac_preproc_ok=: +break ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + +else case e in @%:@( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See 'config.log' for more details" "$LINENO" 5; } ;; +esac +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5 +printf %s "checking for egrep -e... " >&6; } +if test ${ac_cv_path_EGREP_TRADITIONAL+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in @%:@( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +@%:@( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + : + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + + if test "$ac_cv_path_EGREP_TRADITIONAL" +then : + ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E" +else case e in @%:@( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in @%:@( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +@%:@( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + ;; +esac +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5 +printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; } + EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5 +printf %s "checking for Minix Amsterdam compiler... " >&6; } +if test ${gl_cv_c_amsterdam_compiler+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __ACK__ +Amsterdam +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "Amsterdam" >/dev/null 2>&1 +then : + gl_cv_c_amsterdam_compiler=yes +else case e in @%:@( + e) gl_cv_c_amsterdam_compiler=no ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5 +printf "%s\n" "$gl_cv_c_amsterdam_compiler" >&6; } + + if test $gl_cv_c_amsterdam_compiler = yes; then + if test -z "$AR"; then + AR='cc -c.a' + fi + if test -z "$ARFLAGS"; then + ARFLAGS='-o' + fi + else + : + fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="ar" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + + if test -z "$ARFLAGS"; then + ARFLAGS='cr' + fi + + + + if test -z "$RANLIB"; then + if test $gl_cv_c_amsterdam_compiler = yes; then + RANLIB=':' + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + fi + fi + + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + + + + # IEEE behaviour is the default on all CPUs except Alpha and SH + # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 + # and the GCC 4.1.2 manual). + case "$host_cpu" in + alpha*) + # On Alpha systems, a compiler option provides the behaviour. + # See the ieee(3) manual page, also available at + # + if test -n "$GCC"; then + # GCC has the option -mieee. + # For full IEEE compliance (rarely needed), use option -mieee-with-inexact. + CPPFLAGS="$CPPFLAGS -mieee" + else + # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact. + # For full IEEE compliance (rarely needed), use option -ieee_with_inexact. + CPPFLAGS="$CPPFLAGS -ieee" + fi + ;; + sh*) + if test -n "$GCC"; then + # GCC has the option -mieee. + CPPFLAGS="$CPPFLAGS -mieee" + fi + ;; + esac + +@%:@ Check whether --enable-largefile was given. +if test ${enable_largefile+y} +then : + enableval=$enable_largefile; +fi +if test "$enable_largefile,$enable_year2038" != no,no +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable large file support" >&5 +printf %s "checking for $CC option to enable large file support... " >&6; } +if test ${ac_cv_sys_largefile_opts+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_save_CC="$CC" + ac_opt_found=no + for ac_opt in "none needed" "-D_FILE_OFFSET_BITS=64" "-D_LARGE_FILES=1" "-n32"; do + if test x"$ac_opt" != x"none needed" +then : + CC="$ac_save_CC $ac_opt" +fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +@%:@ifndef FTYPE +@%:@ define FTYPE off_t +@%:@endif + /* Check that FTYPE can represent 2**63 - 1 correctly. + We can't simply define LARGE_FTYPE to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +@%:@define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31)) + int FTYPE_is_large[(LARGE_FTYPE % 2147483629 == 721 + && LARGE_FTYPE % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_opt" = x"none needed" +then : + # GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t. + CC="$CC -DFTYPE=ino_t" + if ac_fn_c_try_compile "$LINENO" +then : + +else case e in @%:@( + e) CC="$CC -D_FILE_OFFSET_BITS=64" + if ac_fn_c_try_compile "$LINENO" +then : + ac_opt='-D_FILE_OFFSET_BITS=64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam +fi + ac_cv_sys_largefile_opts=$ac_opt + ac_opt_found=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test $ac_opt_found = no || break + done + CC="$ac_save_CC" + + + if test $ac_opt_found != yes; then + case $host_os in @%:@( + mingw* | windows*) : + ac_cv_sys_largefile_opts="supported through gnulib" + ac_opt_found=yes + ;; @%:@( + *) : + ;; +esac + fi + + test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected" ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_opts" >&5 +printf "%s\n" "$ac_cv_sys_largefile_opts" >&6; } + +ac_have_largefile=yes +case $ac_cv_sys_largefile_opts in @%:@( + "none needed") : + ;; @%:@( + "supported through gnulib") : + ;; @%:@( + "support not detected") : + ac_have_largefile=no ;; @%:@( + "-D_FILE_OFFSET_BITS=64") : + +printf "%s\n" "@%:@define _FILE_OFFSET_BITS 64" >>confdefs.h + ;; @%:@( + "-D_LARGE_FILES=1") : + +printf "%s\n" "@%:@define _LARGE_FILES 1" >>confdefs.h + ;; @%:@( + "-n32") : + CC="$CC -n32" ;; @%:@( + *) : + as_fn_error $? "internal error: bad value for \$ac_cv_sys_largefile_opts" "$LINENO" 5 ;; +esac + +if test "$enable_year2038" != no +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option for timestamps after 2038" >&5 +printf %s "checking for $CC option for timestamps after 2038... " >&6; } +if test ${ac_cv_sys_year2038_opts+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_save_CPPFLAGS="$CPPFLAGS" + ac_opt_found=no + for ac_opt in "none needed" "-D_TIME_BITS=64" "-D__MINGW_USE_VC2005_COMPAT" "-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT"; do + if test x"$ac_opt" != x"none needed" +then : + CPPFLAGS="$ac_save_CPPFLAGS $ac_opt" +fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + /* Check that time_t can represent 2**32 - 1 correctly. */ + #define LARGE_TIME_T \\ + ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30))) + int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535 + && LARGE_TIME_T % 65537 == 0) + ? 1 : -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_year2038_opts="$ac_opt" + ac_opt_found=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test $ac_opt_found = no || break + done + CPPFLAGS="$ac_save_CPPFLAGS" + test $ac_opt_found = yes || ac_cv_sys_year2038_opts="support not detected" ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_year2038_opts" >&5 +printf "%s\n" "$ac_cv_sys_year2038_opts" >&6; } + +ac_have_year2038=yes +case $ac_cv_sys_year2038_opts in @%:@( + "none needed") : + ;; @%:@( + "support not detected") : + ac_have_year2038=no ;; @%:@( + "-D_TIME_BITS=64") : + +printf "%s\n" "@%:@define _TIME_BITS 64" >>confdefs.h + ;; @%:@( + "-D__MINGW_USE_VC2005_COMPAT") : + +printf "%s\n" "@%:@define __MINGW_USE_VC2005_COMPAT 1" >>confdefs.h + ;; @%:@( + "-U_USE_32_BIT_TIME_T"*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "the 'time_t' type is currently forced to be 32-bit. It +will stop working after mid-January 2038. Remove +_USE_32BIT_TIME_T from the compiler flags. +See 'config.log' for more details" "$LINENO" 5; } ;; @%:@( + *) : + as_fn_error $? "internal error: bad value for \$ac_cv_sys_year2038_opts" "$LINENO" 5 ;; +esac + +fi + +fi + + + + # Pre-early section. + + + + + # Code from module absolute-header: + # Code from module accept: + # Code from module accept-tests: + # Code from module alloca: + # Code from module alloca-opt: + # Code from module alloca-opt-tests: + # Code from module allocator: + # Code from module announce-gen: + # Code from module areadlink: + # Code from module areadlink-tests: + # Code from module argmatch: + # Code from module argmatch-tests: + # Code from module arpa_inet: + # Code from module arpa_inet-tests: + # Code from module assure: + # Code from module binary-io: + # Code from module binary-io-tests: + # Code from module bind: + # Code from module bind-tests: + # Code from module bitrotate: + # Code from module bitrotate-tests: + # Code from module btowc: + # Code from module btowc-tests: + # Code from module builtin-expect: + # Code from module c-ctype: + # Code from module c-ctype-tests: + # Code from module c-stack: + # Code from module c-stack-tests: + # Code from module c-strcase: + # Code from module c-strcase-tests: + # Code from module c-strcaseeq: + # Code from module careadlinkat: + # Code from module clock-time: + # Code from module close: + # Code from module close-tests: + # Code from module config-h: + # Code from module configmake: + # Code from module connect: + # Code from module connect-tests: + # Code from module ctype: + # Code from module ctype-tests: + # Code from module diffseq: + # Code from module dirname: + # Code from module dirname-lgpl: + # Code from module dirname-tests: + # Code from module do-release-commit-and-tag: + # Code from module dosname: + # Code from module double-slash-root: + # Code from module dtotimespec: + # Code from module dup2: + # Code from module dup2-tests: + # Code from module environ: + # Code from module environ-tests: + # Code from module errno: + # Code from module errno-tests: + # Code from module error: + # Code from module exclude: + # Code from module exclude-tests: + # Code from module exitfail: + # Code from module extensions: + # Code from module extern-inline: + # Code from module fcntl: + # Code from module fcntl-h: + # Code from module fcntl-h-tests: + # Code from module fcntl-tests: + # Code from module fd-hook: + # Code from module fdl: + # Code from module fdopen: + # Code from module fdopen-tests: + # Code from module fgetc-tests: + # Code from module file-type: + # Code from module filename: + # Code from module filenamecat: + # Code from module filenamecat-lgpl: + # Code from module filenamecat-tests: + # Code from module flexmember: + # Code from module float: + # Code from module float-tests: + # Code from module fnmatch: + # Code from module fnmatch-gnu: + # Code from module fnmatch-tests: + # Code from module fpieee: + + # Code from module fpucw: + # Code from module fputc-tests: + # Code from module fread-tests: + # Code from module freopen: + # Code from module freopen-safer: + # Code from module freopen-safer-tests: + # Code from module freopen-tests: + # Code from module fstat: + # Code from module fstat-tests: + # Code from module ftruncate: + # Code from module ftruncate-tests: + # Code from module fwrite-tests: + # Code from module gendocs: + # Code from module getcwd-lgpl: + # Code from module getcwd-lgpl-tests: + # Code from module getdtablesize: + # Code from module getdtablesize-tests: + # Code from module getopt: + # Code from module getopt-gnu: + # Code from module getopt-gnu-tests: + # Code from module getopt-posix: + # Code from module getopt-posix-tests: + # Code from module getpagesize: + # Code from module getprogname: + # Code from module getprogname-tests: + # Code from module gettext-h: + # Code from module gettime: + # Code from module gettimeofday: + # Code from module gettimeofday-tests: + # Code from module git-version-gen: + # Code from module gitlog-to-changelog: + # Code from module gnu-make: + # Code from module gnu-web-doc-update: + # Code from module gnumakefile: + # Code from module gnupload: + # Code from module gperf: + # Code from module hard-locale: + # Code from module hash: + # Code from module hash-pjw: + # Code from module hash-tests: + # Code from module havelib: + # Code from module iconv: + # Code from module iconv-h: + # Code from module iconv-h-tests: + # Code from module iconv-tests: + # Code from module iconv_open: + # Code from module ignore-value: + # Code from module ignore-value-tests: + # Code from module include_next: + # Code from module inet_pton: + # Code from module inet_pton-tests: + # Code from module inline: + # Code from module intprops: + # Code from module intprops-tests: + # Code from module inttostr: + # Code from module inttostr-tests: + # Code from module inttypes: + # Code from module inttypes-incomplete: + # Code from module inttypes-tests: + # Code from module ioctl: + # Code from module ioctl-tests: + # Code from module isblank: + # Code from module isblank-tests: + # Code from module iswblank: + # Code from module iswblank-tests: + # Code from module langinfo: + # Code from module langinfo-tests: + # Code from module largefile: + + # Code from module libsigsegv: + # Code from module limits-h: + # Code from module limits-h-tests: + # Code from module listen: + # Code from module listen-tests: + # Code from module localcharset: + # Code from module locale: + # Code from module locale-tests: + # Code from module localeconv: + # Code from module localeconv-tests: + # Code from module localtime-buffer: + # Code from module lstat: + # Code from module lstat-tests: + # Code from module maintainer-makefile: + # Code from module malloc-posix: + # Code from module malloca: + # Code from module malloca-tests: + # Code from module manywarnings: + # Code from module mbchar: + # Code from module mbiter: + # Code from module mbrtowc: + # Code from module mbrtowc-tests: + # Code from module mbscasecmp: + # Code from module mbscasecmp-tests: + # Code from module mbsinit: + # Code from module mbsinit-tests: + # Code from module mbslen: + # Code from module mbsrtowcs: + # Code from module mbsrtowcs-tests: + # Code from module mbsstr: + # Code from module mbsstr-tests: + # Code from module mbtowc: + # Code from module mbuiter: + # Code from module memchr: + # Code from module memchr-tests: + # Code from module minmax: + # Code from module mkstemp: + # Code from module mktime: + # Code from module mktime-internal: + # Code from module msvc-inval: + # Code from module msvc-nothrow: + # Code from module multiarch: + # Code from module nanosleep: + # Code from module nanosleep-tests: + # Code from module netinet_in: + # Code from module netinet_in-tests: + # Code from module nl_langinfo: + # Code from module nl_langinfo-tests: + # Code from module nocrash: + # Code from module open: + # Code from module open-tests: + # Code from module pathmax: + # Code from module pathmax-tests: + # Code from module perror: + # Code from module perror-tests: + # Code from module pipe-posix: + # Code from module pipe-posix-tests: + # Code from module progname: + # Code from module propername: + # Code from module putenv: + # Code from module quote: + # Code from module quotearg: + # Code from module quotearg-simple: + # Code from module quotearg-simple-tests: + # Code from module raise: + # Code from module raise-tests: + # Code from module rawmemchr: + # Code from module rawmemchr-tests: + # Code from module readlink: + # Code from module readlink-tests: + # Code from module readme-release: + # Code from module regex: + # Code from module regex-tests: + # Code from module same-inode: + # Code from module secure_getenv: + # Code from module select: + # Code from module select-tests: + # Code from module setenv: + # Code from module setenv-tests: + # Code from module setlocale: + # Code from module setlocale-tests: + # Code from module setsockopt: + # Code from module setsockopt-tests: + # Code from module sh-quote: + # Code from module sh-quote-tests: + # Code from module sigaction: + # Code from module sigaction-tests: + # Code from module signal: + # Code from module signal-h: + # Code from module signal-h-tests: + # Code from module sigprocmask: + # Code from module sigprocmask-tests: + # Code from module size_max: + # Code from module sleep: + # Code from module sleep-tests: + # Code from module snippet/_Noreturn: + # Code from module snippet/arg-nonnull: + # Code from module snippet/c++defs: + # Code from module snippet/unused-parameter: + # Code from module snippet/warn-on-use: + # Code from module snprintf: + # Code from module snprintf-tests: + # Code from module socket: + # Code from module socketlib: + # Code from module sockets: + # Code from module sockets-tests: + # Code from module socklen: + # Code from module ssize_t: + # Code from module stat: + # Code from module stat-macros: + # Code from module stat-tests: + # Code from module stat-time: + # Code from module stat-time-tests: + # Code from module stdalign: + # Code from module stdalign-tests: + # Code from module stdarg: + + + + # Code from module stdbool: + # Code from module stdbool-tests: + # Code from module stddef: + # Code from module stddef-tests: + # Code from module stdint: + # Code from module stdint-tests: + # Code from module stdio: + # Code from module stdio-tests: + # Code from module stdlib: + # Code from module stdlib-tests: + # Code from module strcase: + # Code from module streq: + # Code from module strerror: + # Code from module strerror-override: + # Code from module strerror-tests: + # Code from module strerror_r-posix: + # Code from module strerror_r-posix-tests: + # Code from module strftime: + # Code from module strftime-tests: + # Code from module striconv: + # Code from module striconv-tests: + # Code from module string: + # Code from module string-tests: + # Code from module strings: + # Code from module strings-tests: + # Code from module strndup: + # Code from module strnlen: + # Code from module strnlen-tests: + # Code from module strnlen1: + # Code from module strptime: + # Code from module strtoull: + # Code from module strtoull-tests: + # Code from module strtoumax: + # Code from module strtoumax-tests: + # Code from module symlink: + # Code from module symlink-tests: + # Code from module sys_ioctl: + # Code from module sys_ioctl-tests: + # Code from module sys_select: + # Code from module sys_select-tests: + # Code from module sys_socket: + # Code from module sys_socket-tests: + # Code from module sys_stat: + # Code from module sys_stat-tests: + # Code from module sys_time: + # Code from module sys_time-tests: + # Code from module sys_types: + # Code from module sys_types-tests: + # Code from module sys_uio: + # Code from module sys_uio-tests: + # Code from module sys_wait: + # Code from module sys_wait-tests: + # Code from module system-quote: + # Code from module tempname: + # Code from module test-framework-sh: + # Code from module test-framework-sh-tests: + # Code from module time: + # Code from module time-tests: + # Code from module time_r: + # Code from module time_rz: + # Code from module timegm: + # Code from module timespec: + # Code from module timespec-add: + # Code from module timespec-sub: + # Code from module timespec-tests: + # Code from module trim: + # Code from module tzset: + # Code from module unistd: + # Code from module unistd-tests: + # Code from module unistr/base: + # Code from module unistr/u8-mbtoucr: + # Code from module unistr/u8-mbtoucr-tests: + # Code from module unistr/u8-uctomb: + # Code from module unistr/u8-uctomb-tests: + # Code from module unitypes: + # Code from module uniwidth/base: + # Code from module uniwidth/width: + # Code from module uniwidth/width-tests: + # Code from module unlocked-io: + # Code from module unsetenv: + # Code from module unsetenv-tests: + # Code from module update-copyright: + # Code from module update-copyright-tests: + # Code from module useless-if-before-free: + # Code from module vararrays: + # Code from module vasnprintf: + # Code from module vasnprintf-tests: + # Code from module vasprintf: + # Code from module vasprintf-tests: + # Code from module vc-list-files: + # Code from module vc-list-files-tests: + # Code from module verify: + # Code from module verify-tests: + # Code from module version-etc: + # Code from module version-etc-fsf: + # Code from module version-etc-tests: + # Code from module warnings: + # Code from module wchar: + # Code from module wchar-tests: + # Code from module wcrtomb: + # Code from module wcrtomb-tests: + # Code from module wctob: + # Code from module wctomb: + # Code from module wctype-h: + # Code from module wctype-h-tests: + # Code from module wcwidth: + # Code from module wcwidth-tests: + # Code from module xalloc: + # Code from module xalloc-die: + # Code from module xalloc-die-tests: + # Code from module xalloc-oversized: + # Code from module xfreopen: + # Code from module xreadlink: + # Code from module xsize: + # Code from module xstriconv: + # Code from module xstrndup: + # Code from module xstrtol: + # Code from module xstrtol-tests: + # Code from module xstrtoumax: + # Code from module xstrtoumax-tests: + # Code from module xvasprintf: + # Code from module xvasprintf-tests: + + + + + + + + LIBC_FATAL_STDERR_=1 + export LIBC_FATAL_STDERR_ + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define size_t unsigned int" >>confdefs.h + ;; +esac +fi + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +printf %s "checking for working alloca.h... " >&6; } +if test ${ac_cv_working_alloca_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main (void) +{ +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_working_alloca_h=yes +else case e in @%:@( + e) ac_cv_working_alloca_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +printf "%s\n" "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then + +printf "%s\n" "@%:@define HAVE_ALLOCA_H 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +printf %s "checking for alloca... " >&6; } +if test ${ac_cv_func_alloca_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_func_alloca_works=$ac_cv_working_alloca_h +if test "$ac_cv_func_alloca_works" != yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#ifndef alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _MSC_VER +# include +# define alloca _alloca +# else +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +# endif +#endif + +int +main (void) +{ +char *p = (char *) alloca (1); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_func_alloca_works=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +printf "%s\n" "$ac_cv_func_alloca_works" >&6; } + +if test $ac_cv_func_alloca_works = yes; then + +printf "%s\n" "@%:@define HAVE_ALLOCA 1" >>confdefs.h + +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + + + + + +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext + +printf "%s\n" "@%:@define C_ALLOCA 1" >>confdefs.h + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +printf %s "checking stack direction for C alloca... " >&6; } +if test ${ac_cv_c_stack_direction+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + ac_cv_c_stack_direction=0 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction (int *addr, int depth) +{ + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; +} + +int +main (int argc, char **argv) +{ + return find_stack_direction (0, argc + !argv + 20) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_stack_direction=1 +else case e in @%:@( + e) ac_cv_c_stack_direction=-1 ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +printf "%s\n" "$ac_cv_c_stack_direction" >&6; } +printf "%s\n" "@%:@define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h + + +fi + + + GNULIB_BTOWC=0; + GNULIB_WCTOB=0; + GNULIB_MBSINIT=0; + GNULIB_MBRTOWC=0; + GNULIB_MBRLEN=0; + GNULIB_MBSRTOWCS=0; + GNULIB_MBSNRTOWCS=0; + GNULIB_WCRTOMB=0; + GNULIB_WCSRTOMBS=0; + GNULIB_WCSNRTOMBS=0; + GNULIB_WCWIDTH=0; + GNULIB_WMEMCHR=0; + GNULIB_WMEMCMP=0; + GNULIB_WMEMCPY=0; + GNULIB_WMEMMOVE=0; + GNULIB_WMEMSET=0; + GNULIB_WCSLEN=0; + GNULIB_WCSNLEN=0; + GNULIB_WCSCPY=0; + GNULIB_WCPCPY=0; + GNULIB_WCSNCPY=0; + GNULIB_WCPNCPY=0; + GNULIB_WCSCAT=0; + GNULIB_WCSNCAT=0; + GNULIB_WCSCMP=0; + GNULIB_WCSNCMP=0; + GNULIB_WCSCASECMP=0; + GNULIB_WCSNCASECMP=0; + GNULIB_WCSCOLL=0; + GNULIB_WCSXFRM=0; + GNULIB_WCSDUP=0; + GNULIB_WCSCHR=0; + GNULIB_WCSRCHR=0; + GNULIB_WCSCSPN=0; + GNULIB_WCSSPN=0; + GNULIB_WCSPBRK=0; + GNULIB_WCSSTR=0; + GNULIB_WCSTOK=0; + GNULIB_WCSWIDTH=0; + GNULIB_WCSFTIME=0; + HAVE_BTOWC=1; + HAVE_MBSINIT=1; + HAVE_MBRTOWC=1; + HAVE_MBRLEN=1; + HAVE_MBSRTOWCS=1; + HAVE_MBSNRTOWCS=1; + HAVE_WCRTOMB=1; + HAVE_WCSRTOMBS=1; + HAVE_WCSNRTOMBS=1; + HAVE_WMEMCHR=1; + HAVE_WMEMCMP=1; + HAVE_WMEMCPY=1; + HAVE_WMEMMOVE=1; + HAVE_WMEMSET=1; + HAVE_WCSLEN=1; + HAVE_WCSNLEN=1; + HAVE_WCSCPY=1; + HAVE_WCPCPY=1; + HAVE_WCSNCPY=1; + HAVE_WCPNCPY=1; + HAVE_WCSCAT=1; + HAVE_WCSNCAT=1; + HAVE_WCSCMP=1; + HAVE_WCSNCMP=1; + HAVE_WCSCASECMP=1; + HAVE_WCSNCASECMP=1; + HAVE_WCSCOLL=1; + HAVE_WCSXFRM=1; + HAVE_WCSDUP=1; + HAVE_WCSCHR=1; + HAVE_WCSRCHR=1; + HAVE_WCSCSPN=1; + HAVE_WCSSPN=1; + HAVE_WCSPBRK=1; + HAVE_WCSSTR=1; + HAVE_WCSTOK=1; + HAVE_WCSWIDTH=1; + HAVE_WCSFTIME=1; + HAVE_DECL_WCTOB=1; + HAVE_DECL_WCWIDTH=1; + REPLACE_MBSTATE_T=0; + REPLACE_BTOWC=0; + REPLACE_WCTOB=0; + REPLACE_MBSINIT=0; + REPLACE_MBRTOWC=0; + REPLACE_MBRLEN=0; + REPLACE_MBSRTOWCS=0; + REPLACE_MBSNRTOWCS=0; + REPLACE_WCRTOMB=0; + REPLACE_WCSRTOMBS=0; + REPLACE_WCSNRTOMBS=0; + REPLACE_WCWIDTH=0; + REPLACE_WCSWIDTH=0; + REPLACE_WCSFTIME=0; + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether uses 'inline' correctly" >&5 +printf %s "checking whether uses 'inline' correctly... " >&6; } +if test ${gl_cv_header_wchar_h_correct_inline+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gl_cv_header_wchar_h_correct_inline=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +extern int zero (void); +int main () { return zero(); } + +_ACEOF + save_ac_compile="$ac_compile" + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int zero (void) { return 0; } + +_ACEOF + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then + : + else + gl_cv_header_wchar_h_correct_inline=no + fi + fi + fi + ac_compile="$save_ac_compile" + rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5 +printf "%s\n" "$gl_cv_header_wchar_h_correct_inline" >&6; } + if test $gl_cv_header_wchar_h_correct_inline = no; then + as_fn_error $? " cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). +This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in +C99 mode. You have four options: + - Add the flag -fgnu89-inline to CC and reconfigure, or + - Fix your include files, using parts of + , or + - Use a gcc version older than 4.3, or + - Don't use the flags -std=c99 or -std=gnu99. +Configuration aborted." "$LINENO" 5 + fi + +ac_func= +for ac_item in $ac_func_c_list +do + if test $ac_func; then + ac_fn_c_check_func "$LINENO" $ac_func ac_cv_func_$ac_func + if eval test \"x\$ac_cv_func_$ac_func\" = xyes; then + echo "#define $ac_item 1" >> confdefs.h + fi + ac_func= + else + ac_func=$ac_item + fi +done + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 +printf %s "checking for nl_langinfo and CODESET... " >&6; } +if test ${am_cv_langinfo_codeset+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +char* cs = nl_langinfo(CODESET); return !cs; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_langinfo_codeset=yes +else case e in @%:@( + e) am_cv_langinfo_codeset=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 +printf "%s\n" "$am_cv_langinfo_codeset" >&6; } + if test $am_cv_langinfo_codeset = yes; then + +printf "%s\n" "@%:@define HAVE_LANGINFO_CODESET 1" >>confdefs.h + + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + + + + + + case "$host_os" in + sunos4* | freebsd* | dragonfly* | openbsd* | mirbsd* | netbsd* | kfreebsd* | knetbsd*) # BSD systems + FAULT_YIELDS_SIGBUS=1 ;; + hpux*) # HP-UX + FAULT_YIELDS_SIGBUS=1 ;; + macos* | darwin*) # Mac OS X + FAULT_YIELDS_SIGBUS=1 ;; + gnu*) # Hurd + FAULT_YIELDS_SIGBUS=1 ;; + *) + FAULT_YIELDS_SIGBUS=0 ;; + esac + +printf "%s\n" "@%:@define FAULT_YIELDS_SIGBUS $FAULT_YIELDS_SIGBUS" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working C stack overflow detection" >&5 +printf %s "checking for working C stack overflow detection... " >&6; } +if test ${ac_cv_sys_stack_overflow_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + ac_cv_sys_stack_overflow_works=cross-compiling +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #if HAVE_SETRLIMIT + # include + # include + # include + #endif + #ifndef SIGSTKSZ + # define SIGSTKSZ 16384 + #endif + + static union + { + char buffer[2 * SIGSTKSZ]; + long double ld; + long u; + void *p; + } alternate_signal_stack; + + static void + segv_handler (int signo) + { + _exit (0); + } + + static int + c_stack_action () + { + stack_t st; + struct sigaction act; + int r; + + st.ss_flags = 0; + /* Use the midpoint to avoid Irix sigaltstack bug. */ + st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; + st.ss_size = SIGSTKSZ; + r = sigaltstack (&st, 0); + if (r != 0) + return 1; + + sigemptyset (&act.sa_mask); + act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND; + act.sa_handler = segv_handler; + #if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, 0) < 0) + return 2; + #endif + if (sigaction (SIGSEGV, &act, 0) < 0) + return 3; + return 0; + } + static volatile int * + recurse_1 (volatile int n, volatile int *p) + { + if (n >= 0) + *recurse_1 (n + 1, p) += n; + return p; + } + static int + recurse (volatile int n) + { + int sum = 0; + return *recurse_1 (n, &sum); + } + int + main () + { + int result; + #if HAVE_SETRLIMIT && defined RLIMIT_STACK + /* Before starting the endless recursion, try to be friendly + to the user's machine. On some Linux 2.2.x systems, there + is no stack limit for user processes at all. We don't want + to kill such systems. */ + struct rlimit rl; + rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */ + setrlimit (RLIMIT_STACK, &rl); + #endif + + result = c_stack_action (); + if (result != 0) + return result; + return recurse (0); + } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_sys_stack_overflow_works=yes +else case e in @%:@( + e) ac_cv_sys_stack_overflow_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_stack_overflow_works" >&5 +printf "%s\n" "$ac_cv_sys_stack_overflow_works" >&6; } + + if test $ac_cv_sys_stack_overflow_works = yes; then + +printf "%s\n" "@%:@define HAVE_STACK_OVERFLOW_HANDLING 1" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for correct stack_t interpretation" >&5 +printf %s "checking for correct stack_t interpretation... " >&6; } +if test ${gl_cv_sigaltstack_low_base+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + gl_cv_sigaltstack_low_base=cross-compiling +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#include +#include +#if HAVE_SYS_SIGNAL_H +# include +#endif +#ifndef SIGSTKSZ +# define SIGSTKSZ 16384 +#endif +volatile char *stack_lower_bound; +volatile char *stack_upper_bound; +static void check_stack_location (volatile char *addr) +{ + if (addr >= stack_lower_bound && addr <= stack_upper_bound) + exit (0); + else + exit (1); +} +static void stackoverflow_handler (int sig) +{ + char dummy; + check_stack_location (&dummy); +} +int main () +{ + char mystack[2 * SIGSTKSZ]; + stack_t altstack; + struct sigaction action; + /* Install the alternate stack. */ + altstack.ss_sp = mystack + SIGSTKSZ; + altstack.ss_size = SIGSTKSZ; + stack_lower_bound = (char *) altstack.ss_sp; + stack_upper_bound = (char *) altstack.ss_sp + altstack.ss_size - 1; + altstack.ss_flags = 0; /* no SS_DISABLE */ + if (sigaltstack (&altstack, NULL) < 0) + exit (2); + /* Install the SIGSEGV handler. */ + sigemptyset (&action.sa_mask); + action.sa_handler = &stackoverflow_handler; + action.sa_flags = SA_ONSTACK; + if (sigaction (SIGSEGV, &action, (struct sigaction *) NULL) < 0) + exit(3); + /* Provoke a SIGSEGV. */ + raise (SIGSEGV); + exit (4); +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_sigaltstack_low_base=yes +else case e in @%:@( + e) gl_cv_sigaltstack_low_base=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sigaltstack_low_base" >&5 +printf "%s\n" "$gl_cv_sigaltstack_low_base" >&6; } + if test "$gl_cv_sigaltstack_low_base" = no; then + +printf "%s\n" "@%:@define SIGALTSTACK_SS_REVERSED 1" >>confdefs.h + + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for precise C stack overflow detection" >&5 +printf %s "checking for precise C stack overflow detection... " >&6; } +if test ${ac_cv_sys_xsi_stack_overflow_heuristic+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #if HAVE_UCONTEXT_H + # include + #endif + #if HAVE_SETRLIMIT + # include + # include + # include + #endif + #ifndef SIGSTKSZ + # define SIGSTKSZ 16384 + #endif + + static union + { + char buffer[2 * SIGSTKSZ]; + long double ld; + long u; + void *p; + } alternate_signal_stack; + + #if STACK_DIRECTION + # define find_stack_direction(ptr) STACK_DIRECTION + #else + static int + find_stack_direction (char const *addr) + { + char dummy; + return (! addr ? find_stack_direction (&dummy) + : addr < &dummy ? 1 : -1); + } + #endif + + static void + segv_handler (int signo, siginfo_t *info, void *context) + { + if (0 < info->si_code) + { + /* For XSI heuristics to work, we need uc_stack to describe + the interrupted stack (as on Solaris), and not the + currently executing stack (as on Linux). */ + ucontext_t const *user_context = context; + char const *stack_min = user_context->uc_stack.ss_sp; + size_t stack_size = user_context->uc_stack.ss_size; + char const *faulting_address = info->si_addr; + size_t s = faulting_address - stack_min; + size_t page_size = sysconf (_SC_PAGESIZE); + if (find_stack_direction (0) < 0) + s += page_size; + if (s < stack_size + page_size) + _exit (0); + _exit (4); + } + _exit (5); + } + + static int + c_stack_action () + { + stack_t st; + struct sigaction act; + int r; + + st.ss_flags = 0; + /* Use the midpoint to avoid Irix sigaltstack bug. */ + st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; + st.ss_size = SIGSTKSZ; + r = sigaltstack (&st, 0); + if (r != 0) + return 1; + + sigemptyset (&act.sa_mask); + act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO; + act.sa_sigaction = segv_handler; + #if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, 0) < 0) + return 2; + #endif + if (sigaction (SIGSEGV, &act, 0) < 0) + return 3; + return 0; + } + static volatile int * + recurse_1 (volatile int n, volatile int *p) + { + if (n >= 0) + *recurse_1 (n + 1, p) += n; + return p; + } + static int + recurse (volatile int n) + { + int sum = 0; + return *recurse_1 (n, &sum); + } + int + main () + { + int result; + #if HAVE_SETRLIMIT && defined RLIMIT_STACK + /* Before starting the endless recursion, try to be friendly + to the user's machine. On some Linux 2.2.x systems, there + is no stack limit for user processes at all. We don't want + to kill such systems. */ + struct rlimit rl; + rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */ + setrlimit (RLIMIT_STACK, &rl); + #endif + + result = c_stack_action (); + if (result != 0) + return result; + return recurse (0); + } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_sys_xsi_stack_overflow_heuristic=yes +else case e in @%:@( + e) ac_cv_sys_xsi_stack_overflow_heuristic=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_xsi_stack_overflow_heuristic" >&5 +printf "%s\n" "$ac_cv_sys_xsi_stack_overflow_heuristic" >&6; } + + if test $ac_cv_sys_xsi_stack_overflow_heuristic = yes; then + +printf "%s\n" "@%:@define HAVE_XSI_STACK_OVERFLOW_HEURISTIC 1" >>confdefs.h + + fi + fi + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + + +@%:@ Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else case e in @%:@( + e) with_gnu_ld=no ;; +esac +fi + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld" >&5 +printf %s "checking for ld... " >&6; } +elif test "$GCC" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } +elif test "$with_gnu_ld" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test -n "$LD"; then + # Let the user override the test with a path. + : +else + if test ${acl_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + acl_cv_path_LD= # Final result of this test + ac_prog=ld # Program to search in $PATH + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + acl_output=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $acl_output in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` + while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do + acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` + done + # Got the pathname. No search in PATH is needed. + acl_cv_path_LD="$acl_output" + ac_prog= + ;; + "") + # If it fails, then pretend we aren't using GCC. + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac + fi + if test -n "$ac_prog"; then + # Search for $ac_prog in $PATH. + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$acl_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 conftest.$ac_ext +/* end confdefs.h. */ +#if defined __powerpc64__ || defined _ARCH_PPC64 + yes + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + # The compiler produces 64-bit code. Add option '-b64' so that the + # linker groks 64-bit object files. + case "$acl_cv_path_LD " in + *" -b64 "*) ;; + *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;; + esac + +fi +rm -rf conftest* + + ;; + esac + ;; +esac +fi + + LD="$acl_cv_path_LD" +fi +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${acl_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +printf "%s\n" "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +printf %s "checking for shared library run path origin... " >&6; } +if test ${acl_cv_rpath+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +printf "%s\n" "$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + @%:@ Check whether --enable-rpath was given. +if test ${enable_rpath+y} +then : + enableval=$enable_rpath; : +else case e in @%:@( + e) enable_rpath=yes ;; +esac +fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5 +printf %s "checking for the common suffixes of directories in the library search path... " >&6; } +if test ${acl_cv_libdirstems+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) acl_libdirstem=lib + acl_libdirstem2= + case "$host_os" in + solaris*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 +printf %s "checking for 64-bit host... " >&6; } +if test ${gl_cv_solaris_64bit+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _LP64 +sixtyfour bits +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "sixtyfour bits" >/dev/null 2>&1 +then : + gl_cv_solaris_64bit=yes +else case e in @%:@( + e) gl_cv_solaris_64bit=no ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 +printf "%s\n" "$gl_cv_solaris_64bit" >&6; } + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; + esac + fi + ;; + *) + searchpath=`(if test -f /usr/bin/gcc \ + && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \ + LC_ALL=C /usr/bin/gcc -print-search-dirs; \ + else \ + LC_ALL=C $CC -print-search-dirs; \ + fi) 2>/dev/null \ + | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_libdirstems" >&5 +printf "%s\n" "$acl_cv_libdirstems" >&6; } + # Decompose acl_cv_libdirstems into acl_libdirstem and acl_libdirstem2. + acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` + acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e '/,/s/.*,//'` + + + + + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +@%:@ Check whether --with-libsigsegv-prefix was given. +if test ${with_libsigsegv_prefix+y} +then : + withval=$with_libsigsegv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBSIGSEGV= + LTLIBSIGSEGV= + INCSIGSEGV= + LIBSIGSEGV_PREFIX= + HAVE_LIBSIGSEGV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='sigsegv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_a" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCSIGSEGV="${INCSIGSEGV}${INCSIGSEGV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$dep" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$dep" + ;; + esac + done + fi + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-R$found_dir" + done + fi + + + + + + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCSIGSEGV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsigsegv" >&5 +printf %s "checking for libsigsegv... " >&6; } +if test ${ac_cv_libsigsegv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + ac_save_LIBS="$LIBS" + case " $LIBSIGSEGV" in + *" -l"*) LIBS="$LIBS $LIBSIGSEGV" ;; + *) LIBS="$LIBSIGSEGV $LIBS" ;; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +sigsegv_deinstall_handler(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libsigsegv=yes +else case e in @%:@( + e) ac_cv_libsigsegv='no, consider installing GNU libsigsegv' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libsigsegv" >&5 +printf "%s\n" "$ac_cv_libsigsegv" >&6; } + if test "$ac_cv_libsigsegv" = yes; then + HAVE_LIBSIGSEGV=yes + +printf "%s\n" "@%:@define HAVE_LIBSIGSEGV 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libsigsegv" >&5 +printf %s "checking how to link with libsigsegv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBSIGSEGV" >&5 +printf "%s\n" "$LIBSIGSEGV" >&6; } + else + HAVE_LIBSIGSEGV=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBSIGSEGV= + LTLIBSIGSEGV= + LIBSIGSEGV_PREFIX= + fi + + + + + + + + gl_cv_lib_sigsegv="$ac_cv_libsigsegv" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in @%:@( + e) # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +extern void ac_decl (int, char *); + +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else case e in @%:@( + e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; +esac +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in @%:@( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See 'config.log' for more details" "$LINENO" 5; } ;; @%:@( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; @%:@( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac + + + + GNULIB_CHDIR=0; + GNULIB_CHOWN=0; + GNULIB_CLOSE=0; + GNULIB_DUP=0; + GNULIB_DUP2=0; + GNULIB_DUP3=0; + GNULIB_ENVIRON=0; + GNULIB_EUIDACCESS=0; + GNULIB_FACCESSAT=0; + GNULIB_FCHDIR=0; + GNULIB_FCHOWNAT=0; + GNULIB_FDATASYNC=0; + GNULIB_FSYNC=0; + GNULIB_FTRUNCATE=0; + GNULIB_GETCWD=0; + GNULIB_GETDOMAINNAME=0; + GNULIB_GETDTABLESIZE=0; + GNULIB_GETGROUPS=0; + GNULIB_GETHOSTNAME=0; + GNULIB_GETLOGIN=0; + GNULIB_GETLOGIN_R=0; + GNULIB_GETPAGESIZE=0; + GNULIB_GETUSERSHELL=0; + GNULIB_GROUP_MEMBER=0; + GNULIB_ISATTY=0; + GNULIB_LCHOWN=0; + GNULIB_LINK=0; + GNULIB_LINKAT=0; + GNULIB_LSEEK=0; + GNULIB_PIPE=0; + GNULIB_PIPE2=0; + GNULIB_PREAD=0; + GNULIB_PWRITE=0; + GNULIB_READ=0; + GNULIB_READLINK=0; + GNULIB_READLINKAT=0; + GNULIB_RMDIR=0; + GNULIB_SETHOSTNAME=0; + GNULIB_SLEEP=0; + GNULIB_SYMLINK=0; + GNULIB_SYMLINKAT=0; + GNULIB_TRUNCATE=0; + GNULIB_TTYNAME_R=0; + GNULIB_UNISTD_H_NONBLOCKING=0; + GNULIB_UNISTD_H_SIGPIPE=0; + GNULIB_UNLINK=0; + GNULIB_UNLINKAT=0; + GNULIB_USLEEP=0; + GNULIB_WRITE=0; + HAVE_CHOWN=1; + HAVE_DUP2=1; + HAVE_DUP3=1; + HAVE_EUIDACCESS=1; + HAVE_FACCESSAT=1; + HAVE_FCHDIR=1; + HAVE_FCHOWNAT=1; + HAVE_FDATASYNC=1; + HAVE_FSYNC=1; + HAVE_FTRUNCATE=1; + HAVE_GETDTABLESIZE=1; + HAVE_GETGROUPS=1; + HAVE_GETHOSTNAME=1; + HAVE_GETLOGIN=1; + HAVE_GETPAGESIZE=1; + HAVE_GROUP_MEMBER=1; + HAVE_LCHOWN=1; + HAVE_LINK=1; + HAVE_LINKAT=1; + HAVE_PIPE=1; + HAVE_PIPE2=1; + HAVE_PREAD=1; + HAVE_PWRITE=1; + HAVE_READLINK=1; + HAVE_READLINKAT=1; + HAVE_SETHOSTNAME=1; + HAVE_SLEEP=1; + HAVE_SYMLINK=1; + HAVE_SYMLINKAT=1; + HAVE_TRUNCATE=1; + HAVE_UNLINKAT=1; + HAVE_USLEEP=1; + HAVE_DECL_ENVIRON=1; + HAVE_DECL_FCHDIR=1; + HAVE_DECL_FDATASYNC=1; + HAVE_DECL_GETDOMAINNAME=1; + HAVE_DECL_GETLOGIN=1; + HAVE_DECL_GETLOGIN_R=1; + HAVE_DECL_GETPAGESIZE=1; + HAVE_DECL_GETUSERSHELL=1; + HAVE_DECL_SETHOSTNAME=1; + HAVE_DECL_TTYNAME_R=1; + HAVE_OS_H=0; + HAVE_SYS_PARAM_H=0; + REPLACE_CHOWN=0; + REPLACE_CLOSE=0; + REPLACE_DUP=0; + REPLACE_DUP2=0; + REPLACE_FCHOWNAT=0; + REPLACE_FTRUNCATE=0; + REPLACE_GETCWD=0; + REPLACE_GETDOMAINNAME=0; + REPLACE_GETDTABLESIZE=0; + REPLACE_GETLOGIN_R=0; + REPLACE_GETGROUPS=0; + REPLACE_GETPAGESIZE=0; + REPLACE_ISATTY=0; + REPLACE_LCHOWN=0; + REPLACE_LINK=0; + REPLACE_LINKAT=0; + REPLACE_LSEEK=0; + REPLACE_PREAD=0; + REPLACE_PWRITE=0; + REPLACE_READ=0; + REPLACE_READLINK=0; + REPLACE_READLINKAT=0; + REPLACE_RMDIR=0; + REPLACE_SLEEP=0; + REPLACE_SYMLINK=0; + REPLACE_SYMLINKAT=0; + REPLACE_TRUNCATE=0; + REPLACE_TTYNAME_R=0; + REPLACE_UNLINK=0; + REPLACE_UNLINKAT=0; + REPLACE_USLEEP=0; + REPLACE_WRITE=0; + UNISTD_H_HAVE_WINSOCK2_H=0; + UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; + + + + + + if test $ac_cv_func__set_invalid_parameter_handler = yes; then + HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 + +printf "%s\n" "@%:@define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h + + else + HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 + fi + + + + GNULIB_IOCTL=0; + SYS_IOCTL_H_HAVE_WINSOCK2_H=0; + SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; + + REPLACE_IOCTL=0; + + + + GNULIB_ISBLANK=0; + HAVE_ISBLANK=1; + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5 +printf %s "checking whether the preprocessor supports include_next... " >&6; } +if test ${gl_cv_have_include_next+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) rm -rf conftestd1a conftestd1b conftestd2 + mkdir conftestd1a conftestd1b conftestd2 + cat < conftestd1a/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include_next +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat < conftestd1b/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include +#include_next +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat < conftestd2/conftest.h +#ifndef DEFINED_IN_CONFTESTD1 +#error "include_next test doesn't work" +#endif +#define DEFINED_IN_CONFTESTD2 +EOF + gl_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_have_include_next=yes +else case e in @%:@( + e) CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_have_include_next=buggy +else case e in @%:@( + e) gl_cv_have_include_next=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CPPFLAGS="$gl_save_CPPFLAGS" + rm -rf conftestd1a conftestd1b conftestd2 + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5 +printf "%s\n" "$gl_cv_have_include_next" >&6; } + PRAGMA_SYSTEM_HEADER= + if test $gl_cv_have_include_next = yes; then + INCLUDE_NEXT=include_next + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + if test -n "$GCC"; then + PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' + fi + else + if test $gl_cv_have_include_next = buggy; then + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + else + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include + fi + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5 +printf %s "checking whether system header files limit the line length... " >&6; } +if test ${gl_cv_pragma_columns+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __TANDEM +choke me +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "choke me" >/dev/null 2>&1 +then : + gl_cv_pragma_columns=yes +else case e in @%:@( + e) gl_cv_pragma_columns=no ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5 +printf "%s\n" "$gl_cv_pragma_columns" >&6; } + if test $gl_cv_pragma_columns = yes; then + PRAGMA_COLUMNS="#pragma COLUMNS 10000" + else + PRAGMA_COLUMNS= + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 +printf %s "checking whether // is distinct from /... " >&6; } +if test ${gl_cv_double_slash_root+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # . + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + gl_cv_double_slash_root='unknown, assuming no' ;; + esac + else + set x `ls -di / // 2>/dev/null` + if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 +printf "%s\n" "$gl_cv_double_slash_root" >&6; } + if test "$gl_cv_double_slash_root" = yes; then + +printf "%s\n" "@%:@define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h + + fi + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5 +printf %s "checking if environ is properly declared... " >&6; } + if test ${gt_cv_var_environ_declaration+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_UNISTD_H + #include + #endif + /* mingw, BeOS, Haiku declare environ in , not in . */ + #include + + extern struct { int foo; } environ; +int +main (void) +{ +environ.foo = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_var_environ_declaration=no +else case e in @%:@( + e) gt_cv_var_environ_declaration=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5 +printf "%s\n" "$gt_cv_var_environ_declaration" >&6; } + if test $gt_cv_var_environ_declaration = yes; then + +printf "%s\n" "@%:@define HAVE_ENVIRON_DECL 1" >>confdefs.h + + fi + + + if test $gt_cv_var_environ_declaration != yes; then + HAVE_DECL_ENVIRON=0 + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5 +printf %s "checking for complete errno.h... " >&6; } +if test ${gl_cv_header_errno_h_complete+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if !defined ETXTBSY +booboo +#endif +#if !defined ENOMSG +booboo +#endif +#if !defined EIDRM +booboo +#endif +#if !defined ENOLINK +booboo +#endif +#if !defined EPROTO +booboo +#endif +#if !defined EMULTIHOP +booboo +#endif +#if !defined EBADMSG +booboo +#endif +#if !defined EOVERFLOW +booboo +#endif +#if !defined ENOTSUP +booboo +#endif +#if !defined ENETRESET +booboo +#endif +#if !defined ECONNABORTED +booboo +#endif +#if !defined ESTALE +booboo +#endif +#if !defined EDQUOT +booboo +#endif +#if !defined ECANCELED +booboo +#endif +#if !defined EOWNERDEAD +booboo +#endif +#if !defined ENOTRECOVERABLE +booboo +#endif +#if !defined EILSEQ +booboo +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "booboo" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_complete=no +else case e in @%:@( + e) gl_cv_header_errno_h_complete=yes ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5 +printf "%s\n" "$gl_cv_header_errno_h_complete" >&6; } + if test $gl_cv_header_errno_h_complete = yes; then + ERRNO_H='' + else + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_errno_h='<'errno.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_errno_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'errno.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_errno_h + gl_cv_next_errno_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5 +printf "%s\n" "$gl_cv_next_errno_h" >&6; } + fi + NEXT_ERRNO_H=$gl_cv_next_errno_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'errno.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_errno_h + fi + NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive + + + + + ERRNO_H='errno.h' + fi + + if test -n "$ERRNO_H"; then + GL_GENERATE_ERRNO_H_TRUE= + GL_GENERATE_ERRNO_H_FALSE='#' +else + GL_GENERATE_ERRNO_H_TRUE='#' + GL_GENERATE_ERRNO_H_FALSE= +fi + + + if test -n "$ERRNO_H"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5 +printf %s "checking for EMULTIHOP value... " >&6; } +if test ${gl_cv_header_errno_h_EMULTIHOP+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef EMULTIHOP +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EMULTIHOP=yes +else case e in @%:@( + e) gl_cv_header_errno_h_EMULTIHOP=no ;; +esac +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EMULTIHOP = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#ifdef EMULTIHOP +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EMULTIHOP=hidden +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then + if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +" +then : + +fi + + fi + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5 +printf "%s\n" "$gl_cv_header_errno_h_EMULTIHOP" >&6; } + case $gl_cv_header_errno_h_EMULTIHOP in + yes | no) + EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE= + ;; + *) + EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP" + ;; + esac + + + fi + + + if test -n "$ERRNO_H"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5 +printf %s "checking for ENOLINK value... " >&6; } +if test ${gl_cv_header_errno_h_ENOLINK+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef ENOLINK +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_ENOLINK=yes +else case e in @%:@( + e) gl_cv_header_errno_h_ENOLINK=no ;; +esac +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_ENOLINK = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#ifdef ENOLINK +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_ENOLINK=hidden +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_ENOLINK = hidden; then + if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +" +then : + +fi + + fi + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5 +printf "%s\n" "$gl_cv_header_errno_h_ENOLINK" >&6; } + case $gl_cv_header_errno_h_ENOLINK in + yes | no) + ENOLINK_HIDDEN=0; ENOLINK_VALUE= + ;; + *) + ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK" + ;; + esac + + + fi + + + if test -n "$ERRNO_H"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5 +printf %s "checking for EOVERFLOW value... " >&6; } +if test ${gl_cv_header_errno_h_EOVERFLOW+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EOVERFLOW=yes +else case e in @%:@( + e) gl_cv_header_errno_h_EOVERFLOW=no ;; +esac +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EOVERFLOW = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EOVERFLOW=hidden +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then + if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +" +then : + +fi + + fi + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5 +printf "%s\n" "$gl_cv_header_errno_h_EOVERFLOW" >&6; } + case $gl_cv_header_errno_h_EOVERFLOW in + yes | no) + EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE= + ;; + *) + EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW" + ;; + esac + + + fi + + +ac_fn_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strerror_r" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_STRERROR_R $ac_have_decl" >>confdefs.h + + +if test $ac_cv_have_decl_strerror_r = yes; then + # For backward compatibility's sake, define HAVE_STRERROR_R. + # (We used to run AC_CHECK_FUNCS_ONCE for strerror_r, as well + # as AC_CHECK_DECLS_ONCE.) + +printf "%s\n" "@%:@define HAVE_STRERROR_R 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 +printf %s "checking whether strerror_r returns char *... " >&6; } +if test ${ac_cv_func_strerror_r_char_p+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + ac_cv_func_strerror_r_char_p=no + if test $ac_cv_have_decl_strerror_r = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main (void) +{ + + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + char *p = strerror_r (0, buf, sizeof buf); + return !p || x; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_func_strerror_r_char_p=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 +printf "%s\n" "$ac_cv_func_strerror_r_char_p" >&6; } +if test $ac_cv_func_strerror_r_char_p = yes; then + +printf "%s\n" "@%:@define STRERROR_R_CHAR_P 1" >>confdefs.h + +fi + + + XGETTEXT_EXTRA_OPTIONS= + + + + + + GNULIB_FCNTL=0; + GNULIB_NONBLOCKING=0; + GNULIB_OPEN=0; + GNULIB_OPENAT=0; + HAVE_FCNTL=1; + HAVE_OPENAT=1; + REPLACE_FCNTL=0; + REPLACE_OPEN=0; + REPLACE_OPENAT=0; + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5 +printf %s "checking for working fcntl.h... " >&6; } +if test ${gl_cv_header_working_fcntl_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + gl_cv_header_working_fcntl_h=cross-compiling +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #if HAVE_UNISTD_H + # include + #else /* on Windows with MSVC */ + # include + # include + # defined sleep(n) _sleep ((n) * 1000) + #endif + #include + #ifndef O_NOATIME + #define O_NOATIME 0 + #endif + #ifndef O_NOFOLLOW + #define O_NOFOLLOW 0 + #endif + static int const constants[] = + { + O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, + O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY + }; + +int +main (void) +{ + + int result = !constants; + #if HAVE_SYMLINK + { + static char const sym[] = "conftest.sym"; + if (symlink ("/dev/null", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + if (unlink (sym) != 0 || symlink (".", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_RDONLY | O_NOFOLLOW); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + unlink (sym); + } + #endif + { + static char const file[] = "confdefs.h"; + int fd = open (file, O_RDONLY | O_NOATIME); + if (fd < 0) + result |= 8; + else + { + struct stat st0; + if (fstat (fd, &st0) != 0) + result |= 16; + else + { + char c; + sleep (1); + if (read (fd, &c, 1) != 1) + result |= 24; + else + { + if (close (fd) != 0) + result |= 32; + else + { + struct stat st1; + if (stat (file, &st1) != 0) + result |= 40; + else + if (st0.st_atime != st1.st_atime) + result |= 64; + } + } + } + } + } + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_header_working_fcntl_h=yes +else case e in @%:@( + e) case $? in #( + 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( + 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( + 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( + *) gl_cv_header_working_fcntl_h='no';; + esac ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5 +printf "%s\n" "$gl_cv_header_working_fcntl_h" >&6; } + + case $gl_cv_header_working_fcntl_h in #( + *O_NOATIME* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + +printf "%s\n" "@%:@define HAVE_WORKING_O_NOATIME $ac_val" >>confdefs.h + + + case $gl_cv_header_working_fcntl_h in #( + *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + +printf "%s\n" "@%:@define HAVE_WORKING_O_NOFOLLOW $ac_val" >>confdefs.h + + + + ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default +" +if test "x$ac_cv_type_pid_t" = xyes +then : + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_pid_type='int' +else case e in @%:@( + e) ac_pid_type='__int64' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +printf "%s\n" "@%:@define pid_t $ac_pid_type" >>confdefs.h + + ;; +esac +fi + + +ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define mode_t int" >>confdefs.h + ;; +esac +fi + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 +printf %s "checking for mbstate_t... " >&6; } +if test ${ac_cv_type_mbstate_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int +main (void) +{ +mbstate_t x; return sizeof x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_type_mbstate_t=yes +else case e in @%:@( + e) ac_cv_type_mbstate_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5 +printf "%s\n" "$ac_cv_type_mbstate_t" >&6; } + if test $ac_cv_type_mbstate_t = yes; then + +printf "%s\n" "@%:@define HAVE_MBSTATE_T 1" >>confdefs.h + + else + +printf "%s\n" "@%:@define mbstate_t int" >>confdefs.h + + fi + + + + + + + + + + GNULIB_DPRINTF=0; + GNULIB_FCLOSE=0; + GNULIB_FDOPEN=0; + GNULIB_FFLUSH=0; + GNULIB_FGETC=0; + GNULIB_FGETS=0; + GNULIB_FOPEN=0; + GNULIB_FPRINTF=0; + GNULIB_FPRINTF_POSIX=0; + GNULIB_FPURGE=0; + GNULIB_FPUTC=0; + GNULIB_FPUTS=0; + GNULIB_FREAD=0; + GNULIB_FREOPEN=0; + GNULIB_FSCANF=0; + GNULIB_FSEEK=0; + GNULIB_FSEEKO=0; + GNULIB_FTELL=0; + GNULIB_FTELLO=0; + GNULIB_FWRITE=0; + GNULIB_GETC=0; + GNULIB_GETCHAR=0; + GNULIB_GETDELIM=0; + GNULIB_GETLINE=0; + GNULIB_OBSTACK_PRINTF=0; + GNULIB_OBSTACK_PRINTF_POSIX=0; + GNULIB_PCLOSE=0; + GNULIB_PERROR=0; + GNULIB_POPEN=0; + GNULIB_PRINTF=0; + GNULIB_PRINTF_POSIX=0; + GNULIB_PUTC=0; + GNULIB_PUTCHAR=0; + GNULIB_PUTS=0; + GNULIB_REMOVE=0; + GNULIB_RENAME=0; + GNULIB_RENAMEAT=0; + GNULIB_SCANF=0; + GNULIB_SNPRINTF=0; + GNULIB_SPRINTF_POSIX=0; + GNULIB_STDIO_H_NONBLOCKING=0; + GNULIB_STDIO_H_SIGPIPE=0; + GNULIB_TMPFILE=0; + GNULIB_VASPRINTF=0; + GNULIB_VFSCANF=0; + GNULIB_VSCANF=0; + GNULIB_VDPRINTF=0; + GNULIB_VFPRINTF=0; + GNULIB_VFPRINTF_POSIX=0; + GNULIB_VPRINTF=0; + GNULIB_VPRINTF_POSIX=0; + GNULIB_VSNPRINTF=0; + GNULIB_VSPRINTF_POSIX=0; + HAVE_DECL_FPURGE=1; + HAVE_DECL_FSEEKO=1; + HAVE_DECL_FTELLO=1; + HAVE_DECL_GETDELIM=1; + HAVE_DECL_GETLINE=1; + HAVE_DECL_OBSTACK_PRINTF=1; + HAVE_DECL_SNPRINTF=1; + HAVE_DECL_VSNPRINTF=1; + HAVE_DPRINTF=1; + HAVE_FSEEKO=1; + HAVE_FTELLO=1; + HAVE_PCLOSE=1; + HAVE_POPEN=1; + HAVE_RENAMEAT=1; + HAVE_VASPRINTF=1; + HAVE_VDPRINTF=1; + REPLACE_DPRINTF=0; + REPLACE_FCLOSE=0; + REPLACE_FDOPEN=0; + REPLACE_FFLUSH=0; + REPLACE_FOPEN=0; + REPLACE_FPRINTF=0; + REPLACE_FPURGE=0; + REPLACE_FREOPEN=0; + REPLACE_FSEEK=0; + REPLACE_FSEEKO=0; + REPLACE_FTELL=0; + REPLACE_FTELLO=0; + REPLACE_GETDELIM=0; + REPLACE_GETLINE=0; + REPLACE_OBSTACK_PRINTF=0; + REPLACE_PERROR=0; + REPLACE_POPEN=0; + REPLACE_PRINTF=0; + REPLACE_REMOVE=0; + REPLACE_RENAME=0; + REPLACE_RENAMEAT=0; + REPLACE_SNPRINTF=0; + REPLACE_SPRINTF=0; + REPLACE_STDIO_READ_FUNCS=0; + REPLACE_STDIO_WRITE_FUNCS=0; + REPLACE_TMPFILE=0; + REPLACE_VASPRINTF=0; + REPLACE_VDPRINTF=0; + REPLACE_VFPRINTF=0; + REPLACE_VPRINTF=0; + REPLACE_VSNPRINTF=0; + REPLACE_VSPRINTF=0; + + + GNULIB_FCHMODAT=0; + GNULIB_FSTAT=0; + GNULIB_FSTATAT=0; + GNULIB_FUTIMENS=0; + GNULIB_LCHMOD=0; + GNULIB_LSTAT=0; + GNULIB_MKDIRAT=0; + GNULIB_MKFIFO=0; + GNULIB_MKFIFOAT=0; + GNULIB_MKNOD=0; + GNULIB_MKNODAT=0; + GNULIB_STAT=0; + GNULIB_UTIMENSAT=0; + GNULIB_OVERRIDES_STRUCT_STAT=0; + HAVE_FCHMODAT=1; + HAVE_FSTATAT=1; + HAVE_FUTIMENS=1; + HAVE_LCHMOD=1; + HAVE_LSTAT=1; + HAVE_MKDIRAT=1; + HAVE_MKFIFO=1; + HAVE_MKFIFOAT=1; + HAVE_MKNOD=1; + HAVE_MKNODAT=1; + HAVE_UTIMENSAT=1; + REPLACE_FSTAT=0; + REPLACE_FSTATAT=0; + REPLACE_FUTIMENS=0; + REPLACE_LSTAT=0; + REPLACE_MKDIR=0; + REPLACE_MKFIFO=0; + REPLACE_MKNOD=0; + REPLACE_STAT=0; + REPLACE_UTIMENSAT=0; + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5 +printf %s "checking whether stat file-mode macros are broken... " >&6; } +if test ${ac_cv_header_stat_broken+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +#if defined S_ISBLK && defined S_IFDIR +extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; +#endif + +#if defined S_ISBLK && defined S_IFCHR +extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; +#endif + +#if defined S_ISLNK && defined S_IFREG +extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; +#endif + +#if defined S_ISSOCK && defined S_IFREG +extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_header_stat_broken=no +else case e in @%:@( + e) ac_cv_header_stat_broken=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 +printf "%s\n" "$ac_cv_header_stat_broken" >&6; } +if test $ac_cv_header_stat_broken = yes; then + +printf "%s\n" "@%:@define STAT_MACROS_BROKEN 1" >>confdefs.h + +fi + + + + case "$host_os" in + mingw*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5 +printf %s "checking for 64-bit off_t... " >&6; } +if test ${gl_cv_type_off_t_64+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_off_t_64=yes +else case e in @%:@( + e) gl_cv_type_off_t_64=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5 +printf "%s\n" "$gl_cv_type_off_t_64" >&6; } + if test $gl_cv_type_off_t_64 = no; then + WINDOWS_64_BIT_OFF_T=1 + else + WINDOWS_64_BIT_OFF_T=0 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5 +printf %s "checking for 64-bit st_size... " >&6; } +if test ${gl_cv_member_st_size_64+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + struct stat buf; + int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_member_st_size_64=yes +else case e in @%:@( + e) gl_cv_member_st_size_64=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5 +printf "%s\n" "$gl_cv_member_st_size_64" >&6; } + if test $gl_cv_member_st_size_64 = no; then + WINDOWS_64_BIT_ST_SIZE=1 + else + WINDOWS_64_BIT_ST_SIZE=0 + fi + ;; + *) + WINDOWS_64_BIT_OFF_T=0 + WINDOWS_64_BIT_ST_SIZE=0 + ;; + esac + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_stat_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_stat_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/stat.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_stat_h + gl_cv_next_sys_stat_h='"'$gl_header'"' + else + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 +printf "%s\n" "$gl_cv_next_sys_stat_h" >&6; } + fi + NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/stat.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_stat_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive + + + + + + + + + WINDOWS_STAT_TIMESPEC=0 + + + + + + + + + ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include + #include +" +if test "x$ac_cv_type_nlink_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define nlink_t int" >>confdefs.h + ;; +esac +fi + + + + for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + +ac_fn_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getdtablesize" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_GETDTABLESIZE $ac_have_decl" >>confdefs.h + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_getopt_h='<'getopt.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_getopt_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_getopt_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'getopt.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_getopt_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_getopt_h + gl_cv_next_getopt_h='"'$gl_header'"' + else + gl_cv_next_getopt_h='<'getopt.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_getopt_h" >&5 +printf "%s\n" "$gl_cv_next_getopt_h" >&6; } + fi + NEXT_GETOPT_H=$gl_cv_next_getopt_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'getopt.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_getopt_h + fi + NEXT_AS_FIRST_DIRECTIVE_GETOPT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_getopt_h = yes; then + HAVE_GETOPT_H=1 + else + HAVE_GETOPT_H=0 + fi + + + gl_replace_getopt= + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + for ac_header in getopt.h +do : + ac_fn_c_check_header_compile "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" +if test "x$ac_cv_header_getopt_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_GETOPT_H 1" >>confdefs.h + +else case e in @%:@( + e) gl_replace_getopt=yes ;; +esac +fi + +done + fi + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + + for ac_func in getopt_long_only +do : + ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only" +if test "x$ac_cv_func_getopt_long_only" = xyes +then : + printf "%s\n" "@%:@define HAVE_GETOPT_LONG_ONLY 1" >>confdefs.h + +else case e in @%:@( + e) gl_replace_getopt=yes ;; +esac +fi + +done + fi + + if test -z "$gl_replace_getopt"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getopt is POSIX compatible" >&5 +printf %s "checking whether getopt is POSIX compatible... " >&6; } +if test ${gl_cv_func_getopt_posix+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $cross_compiling = no; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See 'config.log' for more details" "$LINENO" 5; } +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char a[] = "-a"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, a, foo, bar, NULL }; + int c; + + c = getopt (4, argv, "ab"); + if (!(c == 'a')) + return 1; + c = getopt (4, argv, "ab"); + if (!(c == -1)) + return 2; + if (!(optind == 2)) + return 3; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_posix=maybe +else case e in @%:@( + e) gl_cv_func_getopt_posix=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + if test $gl_cv_func_getopt_posix = maybe; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See 'config.log' for more details" "$LINENO" 5; } +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char donald[] = "donald"; + static char p[] = "-p"; + static char billy[] = "billy"; + static char duck[] = "duck"; + static char a[] = "-a"; + static char bar[] = "bar"; + char *argv[] = { program, donald, p, billy, duck, a, bar, NULL }; + int c; + + c = getopt (7, argv, "+abp:q:"); + if (!(c == -1)) + return 4; + if (!(strcmp (argv[0], "program") == 0)) + return 5; + if (!(strcmp (argv[1], "donald") == 0)) + return 6; + if (!(strcmp (argv[2], "-p") == 0)) + return 7; + if (!(strcmp (argv[3], "billy") == 0)) + return 8; + if (!(strcmp (argv[4], "duck") == 0)) + return 9; + if (!(strcmp (argv[5], "-a") == 0)) + return 10; + if (!(strcmp (argv[6], "bar") == 0)) + return 11; + if (!(optind == 1)) + return 12; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_posix=maybe +else case e in @%:@( + e) gl_cv_func_getopt_posix=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + if test $gl_cv_func_getopt_posix = maybe; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See 'config.log' for more details" "$LINENO" 5; } +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char ab[] = "-ab"; + char *argv[3] = { program, ab, NULL }; + if (getopt (2, argv, "ab:") != 'a') + return 13; + if (getopt (2, argv, "ab:") != '?') + return 14; + if (optopt != 'b') + return 15; + if (optind != 2) + return 16; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_posix=yes +else case e in @%:@( + e) gl_cv_func_getopt_posix=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + else + case "$host_os" in + darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";; + *) gl_cv_func_getopt_posix="guessing yes";; + esac + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_posix" >&5 +printf "%s\n" "$gl_cv_func_getopt_posix" >&6; } + case "$gl_cv_func_getopt_posix" in + *no) gl_replace_getopt=yes ;; + esac + fi + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5 +printf %s "checking for working GNU getopt function... " >&6; } +if test ${gl_cv_func_getopt_gnu+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the + # optstring is necessary for programs like m4 that have POSIX-mandated + # semantics for supporting options interspersed with files. + # Also, since getopt_long is a GNU extension, we require optind=0. + # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT; + # so take care to revert to the correct (non-)export state. + gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }' + case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + +#include +#if defined __MACH__ && defined __APPLE__ +/* Avoid a crash on Mac OS X. */ +#include +#include +#include +#include +#include +#include +/* The exception port on which our thread listens. */ +static mach_port_t our_exception_port; +/* The main function of the thread listening for exceptions of type + EXC_BAD_ACCESS. */ +static void * +mach_exception_thread (void *arg) +{ + /* Buffer for a message to be received. */ + struct { + mach_msg_header_t head; + mach_msg_body_t msgh_body; + char data[1024]; + } msg; + mach_msg_return_t retval; + /* Wait for a message on the exception port. */ + retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), + our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + if (retval != MACH_MSG_SUCCESS) + abort (); + exit (1); +} +static void +nocrash_init (void) +{ + mach_port_t self = mach_task_self (); + /* Allocate a port on which the thread shall listen for exceptions. */ + if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) + == KERN_SUCCESS) { + /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ + if (mach_port_insert_right (self, our_exception_port, our_exception_port, + MACH_MSG_TYPE_MAKE_SEND) + == KERN_SUCCESS) { + /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting + for us. */ + exception_mask_t mask = EXC_MASK_BAD_ACCESS; + /* Create the thread listening on the exception port. */ + pthread_attr_t attr; + pthread_t thread; + if (pthread_attr_init (&attr) == 0 + && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 + && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { + pthread_attr_destroy (&attr); + /* Replace the exception port info for these exceptions with our own. + Note that we replace the exception port for the entire task, not only + for a particular thread. This has the effect that when our exception + port gets the message, the thread specific exception port has already + been asked, and we don't need to bother about it. + See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ + task_set_exception_ports (self, mask, our_exception_port, + EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); + } + } + } +} +#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Avoid a crash on native Windows. */ +#define WIN32_LEAN_AND_MEAN +#include +#include +static LONG WINAPI +exception_filter (EXCEPTION_POINTERS *ExceptionInfo) +{ + switch (ExceptionInfo->ExceptionRecord->ExceptionCode) + { + case EXCEPTION_ACCESS_VIOLATION: + case EXCEPTION_IN_PAGE_ERROR: + case EXCEPTION_STACK_OVERFLOW: + case EXCEPTION_GUARD_PAGE: + case EXCEPTION_PRIV_INSTRUCTION: + case EXCEPTION_ILLEGAL_INSTRUCTION: + case EXCEPTION_DATATYPE_MISALIGNMENT: + case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: + case EXCEPTION_NONCONTINUABLE_EXCEPTION: + exit (1); + } + return EXCEPTION_CONTINUE_SEARCH; +} +static void +nocrash_init (void) +{ + SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter); +} +#else +/* Avoid a crash on POSIX systems. */ +#include +#include +/* A POSIX signal handler. */ +static void +exception_handler (int sig) +{ + _exit (1); +} +static void +nocrash_init (void) +{ +#ifdef SIGSEGV + signal (SIGSEGV, exception_handler); +#endif +#ifdef SIGBUS + signal (SIGBUS, exception_handler); +#endif +} +#endif + + +int +main (void) +{ + + int result = 0; + + nocrash_init(); + + /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw, + and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5, + OSF/1 5.1, Solaris 10. */ + { + static char conftest[] = "conftest"; + static char plus[] = "-+"; + char *argv[3] = { conftest, plus, NULL }; + opterr = 0; + if (getopt (2, argv, "+a") != '?') + result |= 1; + } + /* This code succeeds on glibc 2.8, mingw, + and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11, + IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */ + { + static char program[] = "program"; + static char p[] = "-p"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, p, foo, bar, NULL }; + + optind = 1; + if (getopt (4, argv, "p::") != 'p') + result |= 2; + else if (optarg != NULL) + result |= 4; + else if (getopt (4, argv, "p::") != -1) + result |= 6; + else if (optind != 2) + result |= 8; + } + /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */ + { + static char program[] = "program"; + static char foo[] = "foo"; + static char p[] = "-p"; + char *argv[] = { program, foo, p, NULL }; + optind = 0; + if (getopt (3, argv, "-p") != 1) + result |= 16; + else if (getopt (3, argv, "-p") != 'p') + result |= 16; + } + /* This code fails on glibc 2.11. */ + { + static char program[] = "program"; + static char b[] = "-b"; + static char a[] = "-a"; + char *argv[] = { program, b, a, NULL }; + optind = opterr = 0; + if (getopt (3, argv, "+:a:b") != 'b') + result |= 32; + else if (getopt (3, argv, "+:a:b") != ':') + result |= 32; + } + /* This code dumps core on glibc 2.14. */ + { + static char program[] = "program"; + static char w[] = "-W"; + static char dummy[] = "dummy"; + char *argv[] = { program, w, dummy, NULL }; + optind = opterr = 1; + if (getopt (3, argv, "W;") != 'W') + result |= 64; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_gnu=yes +else case e in @%:@( + e) gl_cv_func_getopt_gnu=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + case $gl_had_POSIXLY_CORRECT in + exported) ;; + yes) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;}; POSIXLY_CORRECT=1 ;; + *) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;} ;; + esac + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5 +printf "%s\n" "$gl_cv_func_getopt_gnu" >&6; } + if test "$gl_cv_func_getopt_gnu" != yes; then + gl_replace_getopt=yes + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt_long function" >&5 +printf %s "checking for working GNU getopt_long function... " >&6; } +if test ${gl_cv_func_getopt_long_gnu+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + openbsd*) gl_cv_func_getopt_long_gnu="guessing no";; + *) gl_cv_func_getopt_long_gnu="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + +int +main (void) +{ +static const struct option long_options[] = + { + { "xtremely-",no_argument, NULL, 1003 }, + { "xtra", no_argument, NULL, 1001 }, + { "xtreme", no_argument, NULL, 1002 }, + { "xtremely", no_argument, NULL, 1003 }, + { NULL, 0, NULL, 0 } + }; + /* This code fails on OpenBSD 5.0. */ + { + static char program[] = "program"; + static char xtremel[] = "--xtremel"; + char *argv[] = { program, xtremel, NULL }; + int option_index; + optind = 1; opterr = 0; + if (getopt_long (2, argv, "", long_options, &option_index) != 1003) + return 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_long_gnu=yes +else case e in @%:@( + e) gl_cv_func_getopt_long_gnu=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_long_gnu" >&5 +printf "%s\n" "$gl_cv_func_getopt_long_gnu" >&6; } + case "$gl_cv_func_getopt_long_gnu" in + *yes) ;; + *) gl_replace_getopt=yes ;; + esac + fi + fi + + + + +: + + + + GNULIB_GETTIMEOFDAY=0; + HAVE_GETTIMEOFDAY=1; + HAVE_STRUCT_TIMEVAL=1; + HAVE_SYS_TIME_H=1; + REPLACE_GETTIMEOFDAY=0; + REPLACE_STRUCT_TIMEVAL=0; + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 +printf %s "checking for C/C++ restrict keyword... " >&6; } +if test ${ac_cv_c_restrict+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_c_restrict=no + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +typedef int *int_ptr; + int foo (int_ptr $ac_kw ip) { return ip[0]; } + int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ + int bar (int ip[$ac_kw]) { return ip[0]; } + +int +main (void) +{ +int s[1]; + int *$ac_kw t = s; + t[0] = 0; + return foo (t) + bar (t); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_restrict=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$ac_cv_c_restrict" != no && break + done + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 +printf "%s\n" "$ac_cv_c_restrict" >&6; } + + case $ac_cv_c_restrict in + restrict) ;; + no) printf "%s\n" "@%:@define restrict /**/" >>confdefs.h + ;; + *) printf "%s\n" "@%:@define restrict $ac_cv_c_restrict" >>confdefs.h + ;; + esac + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_time_h='<'sys/time.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_time_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_time_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/time.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_time_h + gl_cv_next_sys_time_h='"'$gl_header'"' + else + gl_cv_next_sys_time_h='<'sys/time.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5 +printf "%s\n" "$gl_cv_next_sys_time_h" >&6; } + fi + NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/time.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_time_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive + + + + + + if test $ac_cv_header_sys_time_h != yes; then + HAVE_SYS_TIME_H=0 + fi + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5 +printf %s "checking for struct timeval... " >&6; } +if test ${gl_cv_sys_struct_timeval+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_SYS_TIME_H + #include + #endif + #include + #if HAVE_WINSOCK2_H + # include + #endif + +int +main (void) +{ +static struct timeval x; x.tv_sec = x.tv_usec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timeval=yes +else case e in @%:@( + e) gl_cv_sys_struct_timeval=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5 +printf "%s\n" "$gl_cv_sys_struct_timeval" >&6; } + if test $gl_cv_sys_struct_timeval != yes; then + HAVE_STRUCT_TIMEVAL=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5 +printf %s "checking for wide-enough struct timeval.tv_sec member... " >&6; } +if test ${gl_cv_sys_struct_timeval_tv_sec+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_SYS_TIME_H + #include + #endif + #include + #if HAVE_WINSOCK2_H + # include + #endif + +int +main (void) +{ +static struct timeval x; + typedef int verify_tv_sec_type[ + sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1 + ]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timeval_tv_sec=yes +else case e in @%:@( + e) gl_cv_sys_struct_timeval_tv_sec=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5 +printf "%s\n" "$gl_cv_sys_struct_timeval_tv_sec" >&6; } + if test $gl_cv_sys_struct_timeval_tv_sec != yes; then + REPLACE_STRUCT_TIMEVAL=1 + fi + fi + + + for gl_func in gettimeofday; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if HAVE_SYS_TIME_H +# include +#endif +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + NEED_LOCALTIME_BUFFER=0 + + + GNULIB_CTIME=0; + GNULIB_MKTIME=0; + GNULIB_LOCALTIME=0; + GNULIB_NANOSLEEP=0; + GNULIB_STRFTIME=0; + GNULIB_STRPTIME=0; + GNULIB_TIMEGM=0; + GNULIB_TIME_R=0; + GNULIB_TIME_RZ=0; + GNULIB_TZSET=0; + HAVE_DECL_LOCALTIME_R=1; + HAVE_NANOSLEEP=1; + HAVE_STRPTIME=1; + HAVE_TIMEGM=1; + HAVE_TZSET=1; + HAVE_TIMEZONE_T=0; + REPLACE_CTIME=GNULIB_PORTCHECK; + REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; + REPLACE_MKTIME=GNULIB_PORTCHECK; + REPLACE_NANOSLEEP=GNULIB_PORTCHECK; + REPLACE_STRFTIME=GNULIB_PORTCHECK; + REPLACE_TIMEGM=GNULIB_PORTCHECK; + REPLACE_TZSET=GNULIB_PORTCHECK; + + : ${GNULIB_GETTIMEOFDAY=0}; + REPLACE_GMTIME=0; + REPLACE_LOCALTIME=0; + + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +@%:@ Check whether --with-libiconv-prefix was given. +if test ${with_libiconv_prefix+y} +then : + withval=$with_libiconv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBICONV= + LTLIBICONV= + INCICONV= + LIBICONV_PREFIX= + HAVE_LIBICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + + + + + + + GNULIB_ICONV=0; + ICONV_CONST=; + REPLACE_ICONV=0; + REPLACE_ICONV_OPEN=0; + REPLACE_ICONV_UTF=0; + ICONV_H=''; + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + + + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +printf %s "checking for iconv... " >&6; } +if test ${am_cv_func_iconv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +printf "%s\n" "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +printf %s "checking for working iconv... " >&6; } +if test ${am_cv_func_iconv_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + if test "$cross_compiling" = yes +then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + +int +main (void) +{ +int result = 0; + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\263"; + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + result |= 8; + iconv_close (cd_88591_to_utf8); + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + result |= 16; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + am_cv_func_iconv_works=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + test "$am_cv_func_iconv_works" = no || break + done + LIBS="$am_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +printf "%s\n" "$am_cv_func_iconv_works" >&6; } + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + +printf "%s\n" "@%:@define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +printf %s "checking how to link with libiconv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +printf "%s\n" "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 +printf %s "checking for iconv declaration... " >&6; } + if test ${am_cv_proto_iconv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + am_cv_proto_iconv_arg1="" +else case e in @%:@( + e) am_cv_proto_iconv_arg1="const" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" ;; +esac +fi + + am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: + $am_cv_proto_iconv" >&5 +printf "%s\n" " + $am_cv_proto_iconv" >&6; } + else + am_cv_proto_iconv_arg1="" + fi + +printf "%s\n" "@%:@define ICONV_CONST $am_cv_proto_iconv_arg1" >>confdefs.h + + + if test -n "$am_cv_proto_iconv_arg1"; then + ICONV_CONST="const" + fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo (void) {return 0; } +$ac_kw foo_t foo (void) {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define off_t long int" >>confdefs.h + ;; +esac +fi + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_limits_h='<'limits.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_limits_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_limits_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'limits.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_limits_h + gl_cv_next_limits_h='"'$gl_header'"' + else + gl_cv_next_limits_h='<'limits.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5 +printf "%s\n" "$gl_cv_next_limits_h" >&6; } + fi + NEXT_LIMITS_H=$gl_cv_next_limits_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'limits.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_limits_h + fi + NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether limits.h has ULLONG_WIDTH etc." >&5 +printf %s "checking whether limits.h has ULLONG_WIDTH etc.... " >&6; } +if test ${gl_cv_header_limits_width+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include + int ullw = ULLONG_WIDTH; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_limits_width=yes +else case e in @%:@( + e) gl_cv_header_limits_width=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5 +printf "%s\n" "$gl_cv_header_limits_width" >&6; } + if test "$gl_cv_header_limits_width" = yes; then + LIMITS_H= + else + LIMITS_H=limits.h + fi + + if test -n "$LIMITS_H"; then + GL_GENERATE_LIMITS_H_TRUE= + GL_GENERATE_LIMITS_H_FALSE='#' +else + GL_GENERATE_LIMITS_H_TRUE='#' + GL_GENERATE_LIMITS_H_FALSE= +fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 +printf %s "checking for wint_t... " >&6; } +if test ${gt_cv_c_wint_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include + wint_t foo = (wchar_t)'\0'; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_c_wint_t=yes +else case e in @%:@( + e) gt_cv_c_wint_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 +printf "%s\n" "$gt_cv_c_wint_t" >&6; } + if test $gt_cv_c_wint_t = yes; then + +printf "%s\n" "@%:@define HAVE_WINT_T 1" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wint_t is too small" >&5 +printf %s "checking whether wint_t is too small... " >&6; } +if test ${gl_cv_type_wint_t_too_small+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +#endif +#include + int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wint_t_too_small=no +else case e in @%:@( + e) gl_cv_type_wint_t_too_small=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_too_small" >&5 +printf "%s\n" "$gl_cv_type_wint_t_too_small" >&6; } + if test $gl_cv_type_wint_t_too_small = yes; then + GNULIB_OVERRIDES_WINT_T=1 + else + GNULIB_OVERRIDES_WINT_T=0 + fi + else + GNULIB_OVERRIDES_WINT_T=0 + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 +printf %s "checking for unsigned long long int... " >&6; } +if test ${ac_cv_type_unsigned_long_long_int+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_type_unsigned_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; +int +main (void) +{ +/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in @%:@( + e) ac_cv_type_unsigned_long_long_int=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; } + if test $ac_cv_type_unsigned_long_long_int = yes; then + +printf "%s\n" "@%:@define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h + + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 +printf %s "checking for long long int... " >&6; } +if test ${ac_cv_type_long_long_int+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_type_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_long_long_int = yes; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include + @%:@ifndef LLONG_MAX + @%:@ define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + @%:@ define LLONG_MAX (HALF - 1 + HALF) + @%:@endif +int +main (void) +{ +long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + +else case e in @%:@( + e) ac_cv_type_long_long_int=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_long_long_int" >&6; } + if test $ac_cv_type_long_long_int = yes; then + +printf "%s\n" "@%:@define HAVE_LONG_LONG_INT 1" >>confdefs.h + + fi + + + + gl_cv_c_multiarch=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + arch= + prev= + for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do + if test -n "$prev"; then + case $word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$arch" || test "$arch" = "$word"; then + arch="$word" + else + gl_cv_c_multiarch=yes + fi + ;; + esac + prev= + else + if test "x$word" = "x-arch"; then + prev=arch + fi + fi + done + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $gl_cv_c_multiarch = yes; then + APPLE_UNIVERSAL_BUILD=1 + else + APPLE_UNIVERSAL_BUILD=0 + fi + + + + + + + + + if test $ac_cv_type_long_long_int = yes; then + HAVE_LONG_LONG_INT=1 + else + HAVE_LONG_LONG_INT=0 + fi + + + if test $ac_cv_type_unsigned_long_long_int = yes; then + HAVE_UNSIGNED_LONG_LONG_INT=1 + else + HAVE_UNSIGNED_LONG_LONG_INT=0 + fi + + + + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + + + if test $ac_cv_header_inttypes_h = yes; then + HAVE_INTTYPES_H=1 + else + HAVE_INTTYPES_H=0 + fi + + + if test $ac_cv_header_sys_types_h = yes; then + HAVE_SYS_TYPES_H=1 + else + HAVE_SYS_TYPES_H=0 + fi + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdint_h='<'stdint.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_stdint_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_stdint_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdint.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdint_h + gl_cv_next_stdint_h='"'$gl_header'"' + else + gl_cv_next_stdint_h='<'stdint.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5 +printf "%s\n" "$gl_cv_next_stdint_h" >&6; } + fi + NEXT_STDINT_H=$gl_cv_next_stdint_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdint.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdint_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_stdint_h = yes; then + HAVE_STDINT_H=1 + else + HAVE_STDINT_H=0 + fi + + + if test $ac_cv_header_stdint_h = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5 +printf %s "checking whether stdint.h conforms to C99... " >&6; } +if test ${gl_cv_header_working_stdint_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gl_cv_header_working_stdint_h=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 +#include +/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ +#if !(defined WCHAR_MIN && defined WCHAR_MAX) +#error "WCHAR_MIN, WCHAR_MAX not defined in " +#endif + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + +#ifdef INT8_MAX +int8_t a1 = INT8_MAX; +int8_t a1min = INT8_MIN; +#endif +#ifdef INT16_MAX +int16_t a2 = INT16_MAX; +int16_t a2min = INT16_MIN; +#endif +#ifdef INT32_MAX +int32_t a3 = INT32_MAX; +int32_t a3min = INT32_MIN; +#endif +#ifdef INT64_MAX +int64_t a4 = INT64_MAX; +int64_t a4min = INT64_MIN; +#endif +#ifdef UINT8_MAX +uint8_t b1 = UINT8_MAX; +#else +typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; +#endif +#ifdef UINT16_MAX +uint16_t b2 = UINT16_MAX; +#endif +#ifdef UINT32_MAX +uint32_t b3 = UINT32_MAX; +#endif +#ifdef UINT64_MAX +uint64_t b4 = UINT64_MAX; +#endif +int_least8_t c1 = INT8_C (0x7f); +int_least8_t c1max = INT_LEAST8_MAX; +int_least8_t c1min = INT_LEAST8_MIN; +int_least16_t c2 = INT16_C (0x7fff); +int_least16_t c2max = INT_LEAST16_MAX; +int_least16_t c2min = INT_LEAST16_MIN; +int_least32_t c3 = INT32_C (0x7fffffff); +int_least32_t c3max = INT_LEAST32_MAX; +int_least32_t c3min = INT_LEAST32_MIN; +int_least64_t c4 = INT64_C (0x7fffffffffffffff); +int_least64_t c4max = INT_LEAST64_MAX; +int_least64_t c4min = INT_LEAST64_MIN; +uint_least8_t d1 = UINT8_C (0xff); +uint_least8_t d1max = UINT_LEAST8_MAX; +uint_least16_t d2 = UINT16_C (0xffff); +uint_least16_t d2max = UINT_LEAST16_MAX; +uint_least32_t d3 = UINT32_C (0xffffffff); +uint_least32_t d3max = UINT_LEAST32_MAX; +uint_least64_t d4 = UINT64_C (0xffffffffffffffff); +uint_least64_t d4max = UINT_LEAST64_MAX; +int_fast8_t e1 = INT_FAST8_MAX; +int_fast8_t e1min = INT_FAST8_MIN; +int_fast16_t e2 = INT_FAST16_MAX; +int_fast16_t e2min = INT_FAST16_MIN; +int_fast32_t e3 = INT_FAST32_MAX; +int_fast32_t e3min = INT_FAST32_MIN; +int_fast64_t e4 = INT_FAST64_MAX; +int_fast64_t e4min = INT_FAST64_MIN; +uint_fast8_t f1 = UINT_FAST8_MAX; +uint_fast16_t f2 = UINT_FAST16_MAX; +uint_fast32_t f3 = UINT_FAST32_MAX; +uint_fast64_t f4 = UINT_FAST64_MAX; +#ifdef INTPTR_MAX +intptr_t g = INTPTR_MAX; +intptr_t gmin = INTPTR_MIN; +#endif +#ifdef UINTPTR_MAX +uintptr_t h = UINTPTR_MAX; +#endif +intmax_t i = INTMAX_MAX; +uintmax_t j = UINTMAX_MAX; + +/* Check that SIZE_MAX has the correct type, if possible. */ +#if 201112 <= __STDC_VERSION__ +int k = _Generic (SIZE_MAX, size_t: 0); +#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) +extern size_t k; +extern __typeof__ (SIZE_MAX) k; +#endif + +#include /* for CHAR_BIT */ +#define TYPE_MINIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) +#define TYPE_MAXIMUM(t) \ + ((t) ((t) 0 < (t) -1 \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) +struct s { + int check_PTRDIFF: + PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) + && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) + ? 1 : -1; + /* Detect bug in FreeBSD 6.0 / ia64. */ + int check_SIG_ATOMIC: + SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) + && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) + ? 1 : -1; + int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; + int check_WCHAR: + WCHAR_MIN == TYPE_MINIMUM (wchar_t) + && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) + ? 1 : -1; + /* Detect bug in mingw. */ + int check_WINT: + WINT_MIN == TYPE_MINIMUM (wint_t) + && WINT_MAX == TYPE_MAXIMUM (wint_t) + ? 1 : -1; + + /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ + int check_UINT8_C: + (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; + int check_UINT16_C: + (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; + + /* Detect bugs in OpenBSD 3.9 stdint.h. */ +#ifdef UINT8_MAX + int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; +#endif +#ifdef UINT16_MAX + int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; +#endif +#ifdef UINT32_MAX + int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; +#endif +#ifdef UINT64_MAX + int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; +#endif + int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; + int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; + int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; + int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; + int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; + int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; + int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; + int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; + int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; + int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; + int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; +}; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test "$cross_compiling" = yes +then : + gl_cv_header_working_stdint_h=yes + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 +#include + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + +#include +#include +#define MVAL(macro) MVAL1(macro) +#define MVAL1(expression) #expression +static const char *macro_values[] = + { +#ifdef INT8_MAX + MVAL (INT8_MAX), +#endif +#ifdef INT16_MAX + MVAL (INT16_MAX), +#endif +#ifdef INT32_MAX + MVAL (INT32_MAX), +#endif +#ifdef INT64_MAX + MVAL (INT64_MAX), +#endif +#ifdef UINT8_MAX + MVAL (UINT8_MAX), +#endif +#ifdef UINT16_MAX + MVAL (UINT16_MAX), +#endif +#ifdef UINT32_MAX + MVAL (UINT32_MAX), +#endif +#ifdef UINT64_MAX + MVAL (UINT64_MAX), +#endif + NULL + }; + +int +main (void) +{ + + const char **mv; + for (mv = macro_values; *mv != NULL; mv++) + { + const char *value = *mv; + /* Test whether it looks like a cast expression. */ + if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 + || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 + || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 + || strncmp (value, "((int)"/*)*/, 6) == 0 + || strncmp (value, "((signed short)"/*)*/, 15) == 0 + || strncmp (value, "((signed char)"/*)*/, 14) == 0) + return mv - macro_values + 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_header_working_stdint_h=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 +printf "%s\n" "$gl_cv_header_working_stdint_h" >&6; } + fi + + HAVE_C99_STDINT_H=0 + HAVE_SYS_BITYPES_H=0 + HAVE_SYS_INTTYPES_H=0 + STDINT_H=stdint.h + if test "$gl_cv_header_working_stdint_h" = yes; then + HAVE_C99_STDINT_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h predates C++11" >&5 +printf %s "checking whether stdint.h predates C++11... " >&6; } +if test ${gl_cv_header_stdint_predates_cxx11_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gl_cv_header_stdint_predates_cxx11_h=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + +intmax_t im = INTMAX_MAX; +int32_t i32 = INT32_C (0x7fffffff); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_stdint_predates_cxx11_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_predates_cxx11_h" >&5 +printf "%s\n" "$gl_cv_header_stdint_predates_cxx11_h" >&6; } + + if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + +printf "%s\n" "@%:@define __STDC_CONSTANT_MACROS 1" >>confdefs.h + + +printf "%s\n" "@%:@define __STDC_LIMIT_MACROS 1" >>confdefs.h + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5 +printf %s "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; } +if test ${gl_cv_header_stdint_width+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gl_cv_header_stdint_width=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 + #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + int iw = UINTMAX_WIDTH; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_stdint_width=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5 +printf "%s\n" "$gl_cv_header_stdint_width" >&6; } + if test "$gl_cv_header_stdint_width" = yes; then + STDINT_H= + fi + else + ac_fn_c_check_header_compile "$LINENO" "sys/inttypes.h" "ac_cv_header_sys_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_inttypes_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_SYS_INTTYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/bitypes.h" "ac_cv_header_sys_bitypes_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_bitypes_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_SYS_BITYPES_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_sys_inttypes_h = yes; then + HAVE_SYS_INTTYPES_H=1 + fi + if test $ac_cv_header_sys_bitypes_h = yes; then + HAVE_SYS_BITYPES_H=1 + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + + for gltype in ptrdiff_t size_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +printf %s "checking for bit size of $gltype... " >&6; } +if eval test \${gl_cv_bitsizeof_${gltype}+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + +#include " +then : + +else case e in @%:@( + e) result=unknown ;; +esac +fi + + eval gl_cv_bitsizeof_${gltype}=\$result + ;; +esac +fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + printf "%s\n" "@%:@define BITSIZEOF_${GLTYPE} $result" >>confdefs.h + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +printf %s "checking for bit size of $gltype... " >&6; } +if eval test \${gl_cv_bitsizeof_${gltype}+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + +#include " +then : + +else case e in @%:@( + e) result=unknown ;; +esac +fi + + eval gl_cv_bitsizeof_${gltype}=\$result + ;; +esac +fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + printf "%s\n" "@%:@define BITSIZEOF_${GLTYPE} $result" >>confdefs.h + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 +printf %s "checking whether $gltype is signed... " >&6; } +if eval test \${gl_cv_type_${gltype}_signed+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + result=yes +else case e in @%:@( + e) result=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval gl_cv_type_${gltype}_signed=\$result + ;; +esac +fi +eval ac_res=\$gl_cv_type_${gltype}_signed + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval result=\$gl_cv_type_${gltype}_signed + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + if test "$result" = yes; then + printf "%s\n" "@%:@define HAVE_SIGNED_${GLTYPE} 1" >>confdefs.h + + eval HAVE_SIGNED_${GLTYPE}=1 + else + eval HAVE_SIGNED_${GLTYPE}=0 + fi + done + + + gl_cv_type_ptrdiff_t_signed=yes + gl_cv_type_size_t_signed=no + if test $APPLE_UNIVERSAL_BUILD = 0; then + + + for gltype in ptrdiff_t size_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +printf %s "checking for $gltype integer literal suffix... " >&6; } +if eval test \${gl_cv_type_${gltype}_suffix+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + extern $gltype foo; + extern $gltype1 foo; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval gl_cv_type_${gltype}_suffix=\$glsuf +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done ;; +esac +fi +eval ac_res=\$gl_cv_type_${gltype}_suffix + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + printf "%s\n" "@%:@define ${GLTYPE}_SUFFIX $result" >>confdefs.h + + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +printf %s "checking for $gltype integer literal suffix... " >&6; } +if eval test \${gl_cv_type_${gltype}_suffix+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + extern $gltype foo; + extern $gltype1 foo; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval gl_cv_type_${gltype}_suffix=\$glsuf +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done ;; +esac +fi +eval ac_res=\$gl_cv_type_${gltype}_suffix + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + printf "%s\n" "@%:@define ${GLTYPE}_SUFFIX $result" >>confdefs.h + + done + + + + if test $GNULIB_OVERRIDES_WINT_T = 1; then + BITSIZEOF_WINT_T=32 + fi + + fi + + LIMITS_H=limits.h + if test -n "$LIMITS_H"; then + GL_GENERATE_LIMITS_H_TRUE= + GL_GENERATE_LIMITS_H_FALSE='#' +else + GL_GENERATE_LIMITS_H_TRUE='#' + GL_GENERATE_LIMITS_H_FALSE= +fi + + + + + + + if test -n "$STDINT_H"; then + GL_GENERATE_STDINT_H_TRUE= + GL_GENERATE_STDINT_H_FALSE='#' +else + GL_GENERATE_STDINT_H_TRUE='#' + GL_GENERATE_STDINT_H_FALSE= +fi + + + + GNULIB_IMAXABS=0; + GNULIB_IMAXDIV=0; + GNULIB_STRTOIMAX=0; + GNULIB_STRTOUMAX=0; + HAVE_DECL_IMAXABS=1; + HAVE_DECL_IMAXDIV=1; + HAVE_DECL_STRTOIMAX=1; + HAVE_DECL_STRTOUMAX=1; + REPLACE_STRTOIMAX=0; + REPLACE_STRTOUMAX=0; + INT32_MAX_LT_INTMAX_MAX=1; + INT64_MAX_EQ_LONG_MAX='defined _LP64'; + PRI_MACROS_BROKEN=0; + PRIPTR_PREFIX=__PRIPTR_PREFIX; + UINT32_MAX_LT_UINTMAX_MAX=1; + UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_inttypes_h='<'inttypes.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_inttypes_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_inttypes_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'inttypes.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_inttypes_h + gl_cv_next_inttypes_h='"'$gl_header'"' + else + gl_cv_next_inttypes_h='<'inttypes.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5 +printf "%s\n" "$gl_cv_next_inttypes_h" >&6; } + fi + NEXT_INTTYPES_H=$gl_cv_next_inttypes_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'inttypes.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_inttypes_h + fi + NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive + + + + + + + + + for gl_func in imaxabs imaxdiv strtoimax strtoumax; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + ac_fn_c_check_header_compile "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_inttypes_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_INTTYPES_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_inttypes_h = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5 +printf %s "checking whether the inttypes.h PRIxNN macros are broken... " >&6; } +if test ${gt_cv_inttypes_pri_broken+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef PRId32 +char *p = PRId32; +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_inttypes_pri_broken=no +else case e in @%:@( + e) gt_cv_inttypes_pri_broken=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5 +printf "%s\n" "$gt_cv_inttypes_pri_broken" >&6; } + fi + if test "$gt_cv_inttypes_pri_broken" = yes; then + +printf "%s\n" "@%:@define PRI_MACROS_BROKEN 1" >>confdefs.h + + PRI_MACROS_BROKEN=1 + else + PRI_MACROS_BROKEN=0 + fi + + + + GNULIB_ISWBLANK=0; + GNULIB_WCTYPE=0; + GNULIB_ISWCTYPE=0; + GNULIB_WCTRANS=0; + GNULIB_TOWCTRANS=0; + HAVE_ISWBLANK=1; + HAVE_WCTYPE_T=1; + HAVE_WCTRANS_T=1; + REPLACE_ISWBLANK=0; + + + + + + if test $ac_cv_header_crtdefs_h = yes; then + HAVE_CRTDEFS_H=1 + else + HAVE_CRTDEFS_H=0 + fi + + + + + + + + if test $ac_cv_func_iswcntrl = yes; then + HAVE_ISWCNTRL=1 + else + HAVE_ISWCNTRL=0 + fi + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wctype_h='<'wctype.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_wctype_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_wctype_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wctype_h + gl_cv_next_wctype_h='"'$gl_header'"' + else + gl_cv_next_wctype_h='<'wctype.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 +printf "%s\n" "$gl_cv_next_wctype_h" >&6; } + fi + NEXT_WCTYPE_H=$gl_cv_next_wctype_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'wctype.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_wctype_h + fi + NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_wctype_h = yes; then + if test $ac_cv_func_iswcntrl = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 +printf %s "checking whether iswcntrl works... " >&6; } +if test ${gl_cv_func_iswcntrl_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #if __GNU_LIBRARY__ == 1 + Linux libc5 i18n is broken. + #endif +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_iswcntrl_works="guessing yes" +else case e in @%:@( + e) gl_cv_func_iswcntrl_works="guessing no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + int main () { return iswprint ('x') == 0; } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_iswcntrl_works=yes +else case e in @%:@( + e) gl_cv_func_iswcntrl_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 +printf "%s\n" "$gl_cv_func_iswcntrl_works" >&6; } + fi + HAVE_WCTYPE_H=1 + else + HAVE_WCTYPE_H=0 + fi + + + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + fi + + if test $REPLACE_ISWCNTRL = 1; then + REPLACE_TOWLOWER=1 + else + ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" +if test "x$ac_cv_func_towlower" = xyes +then : + printf "%s\n" "@%:@define HAVE_TOWLOWER 1" >>confdefs.h + +fi + + if test $ac_cv_func_towlower = yes; then + REPLACE_TOWLOWER=0 + else + ac_fn_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_towlower" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_TOWLOWER $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_towlower = yes; then + REPLACE_TOWLOWER=1 + else + REPLACE_TOWLOWER=0 + fi + fi + fi + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then + : + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 +printf %s "checking for wctype_t... " >&6; } +if test ${gl_cv_type_wctype_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + wctype_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctype_t=yes +else case e in @%:@( + e) gl_cv_type_wctype_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 +printf "%s\n" "$gl_cv_type_wctype_t" >&6; } + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 +printf %s "checking for wctrans_t... " >&6; } +if test ${gl_cv_type_wctrans_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + wctrans_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctrans_t=yes +else case e in @%:@( + e) gl_cv_type_wctrans_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 +printf "%s\n" "$gl_cv_type_wctrans_t" >&6; } + if test $gl_cv_type_wctrans_t = no; then + HAVE_WCTRANS_T=0 + fi + + + for gl_func in wctype iswctype wctrans towctrans ; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +# include +#endif +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + GNULIB_NL_LANGINFO=0; + HAVE_NL_LANGINFO=1; + REPLACE_NL_LANGINFO=0; + + +ac_fn_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getc_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_GETC_UNLOCKED $ac_have_decl" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library >= 2.1 or uClibc" >&5 +printf %s "checking whether we are using the GNU C Library >= 2.1 or uClibc... " >&6; } +if test ${ac_cv_gnu_library_2_1+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif +#ifdef __UCLIBC__ + Lucky user +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "Lucky" >/dev/null 2>&1 +then : + ac_cv_gnu_library_2_1=yes +else case e in @%:@( + e) ac_cv_gnu_library_2_1=no ;; +esac +fi +rm -rf conftest* + + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5 +printf "%s\n" "$ac_cv_gnu_library_2_1" >&6; } + + GLIBC21="$ac_cv_gnu_library_2_1" + + + + GNULIB_LOCALECONV=0; + GNULIB_SETLOCALE=0; + GNULIB_DUPLOCALE=0; + HAVE_DUPLOCALE=1; + REPLACE_LOCALECONV=0; + REPLACE_SETLOCALE=0; + REPLACE_DUPLOCALE=0; + REPLACE_STRUCT_LCONV=0; + + + REPLACE_NULL=0; + HAVE_MAX_ALIGN_T=1; + HAVE_WCHAR_T=1; + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 +printf %s "checking for wchar_t... " >&6; } +if test ${gt_cv_c_wchar_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + wchar_t foo = (wchar_t)'\0'; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_c_wchar_t=yes +else case e in @%:@( + e) gt_cv_c_wchar_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 +printf "%s\n" "$gt_cv_c_wchar_t" >&6; } + if test $gt_cv_c_wchar_t = yes; then + +printf "%s\n" "@%:@define HAVE_WCHAR_T 1" >>confdefs.h + + fi + + + + + STDDEF_H= + ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include + +" +if test "x$ac_cv_type_max_align_t" = xyes +then : + +else case e in @%:@( + e) HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h ;; +esac +fi + + if test $gt_cv_c_wchar_t = no; then + HAVE_WCHAR_T=0 + STDDEF_H=stddef.h + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 +printf %s "checking whether NULL can be used in arbitrary expressions... " >&6; } +if test ${gl_cv_decl_null_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int test[2 * (sizeof NULL == sizeof (void *)) -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_null_works=yes +else case e in @%:@( + e) gl_cv_decl_null_works=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 +printf "%s\n" "$gl_cv_decl_null_works" >&6; } + if test $gl_cv_decl_null_works = no; then + REPLACE_NULL=1 + STDDEF_H=stddef.h + fi + + if test -n "$STDDEF_H"; then + GL_GENERATE_STDDEF_H_TRUE= + GL_GENERATE_STDDEF_H_FALSE='#' +else + GL_GENERATE_STDDEF_H_TRUE='#' + GL_GENERATE_STDDEF_H_FALSE= +fi + + if test -n "$STDDEF_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stddef_h='<'stddef.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_stddef_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stddef.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stddef_h + gl_cv_next_stddef_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 +printf "%s\n" "$gl_cv_next_stddef_h" >&6; } + fi + NEXT_STDDEF_H=$gl_cv_next_stddef_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stddef.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stddef_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive + + + + + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 +printf %s "checking whether lstat correctly handles trailing slash... " >&6; } +if test ${gl_cv_func_lstat_dereferences_slashed_symlink+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) rm -f conftest.sym conftest.file + echo >conftest.file + if test "$cross_compiling" = yes +then : + case "$host_os" in + *-gnu*) + # Guess yes on glibc systems. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; + *) + # If we don't know, assume the worst. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ +struct stat sbuf; + if (symlink ("conftest.file", "conftest.sym") != 0) + return 1; + /* Linux will dereference the symlink and fail, as required by + POSIX. That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_lstat_dereferences_slashed_symlink=yes +else case e in @%:@( + e) gl_cv_func_lstat_dereferences_slashed_symlink=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.sym conftest.file + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5 +printf "%s\n" "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; } + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *yes) + +printf "%s\n" "@%:@define LSTAT_FOLLOWS_SLASHED_SYMLINK 1" >>confdefs.h + + ;; + esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in @%:@( +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +@%:@( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + + + GNULIB__EXIT=0; + GNULIB_ATOLL=0; + GNULIB_CALLOC_POSIX=0; + GNULIB_CANONICALIZE_FILE_NAME=0; + GNULIB_GETLOADAVG=0; + GNULIB_GETSUBOPT=0; + GNULIB_GRANTPT=0; + GNULIB_MALLOC_POSIX=0; + GNULIB_MBTOWC=0; + GNULIB_MKDTEMP=0; + GNULIB_MKOSTEMP=0; + GNULIB_MKOSTEMPS=0; + GNULIB_MKSTEMP=0; + GNULIB_MKSTEMPS=0; + GNULIB_POSIX_OPENPT=0; + GNULIB_PTSNAME=0; + GNULIB_PTSNAME_R=0; + GNULIB_PUTENV=0; + GNULIB_QSORT_R=0; + GNULIB_RANDOM=0; + GNULIB_RANDOM_R=0; + GNULIB_REALLOC_POSIX=0; + GNULIB_REALPATH=0; + GNULIB_RPMATCH=0; + GNULIB_SECURE_GETENV=0; + GNULIB_SETENV=0; + GNULIB_STRTOD=0; + GNULIB_STRTOLL=0; + GNULIB_STRTOULL=0; + GNULIB_SYSTEM_POSIX=0; + GNULIB_UNLOCKPT=0; + GNULIB_UNSETENV=0; + GNULIB_WCTOMB=0; + HAVE__EXIT=1; + HAVE_ATOLL=1; + HAVE_CANONICALIZE_FILE_NAME=1; + HAVE_DECL_GETLOADAVG=1; + HAVE_GETSUBOPT=1; + HAVE_GRANTPT=1; + HAVE_MKDTEMP=1; + HAVE_MKOSTEMP=1; + HAVE_MKOSTEMPS=1; + HAVE_MKSTEMP=1; + HAVE_MKSTEMPS=1; + HAVE_POSIX_OPENPT=1; + HAVE_PTSNAME=1; + HAVE_PTSNAME_R=1; + HAVE_QSORT_R=1; + HAVE_RANDOM=1; + HAVE_RANDOM_H=1; + HAVE_RANDOM_R=1; + HAVE_REALPATH=1; + HAVE_RPMATCH=1; + HAVE_SECURE_GETENV=1; + HAVE_SETENV=1; + HAVE_DECL_SETENV=1; + HAVE_STRTOD=1; + HAVE_STRTOLL=1; + HAVE_STRTOULL=1; + HAVE_STRUCT_RANDOM_DATA=1; + HAVE_SYS_LOADAVG_H=0; + HAVE_UNLOCKPT=1; + HAVE_DECL_UNSETENV=1; + REPLACE_CALLOC=0; + REPLACE_CANONICALIZE_FILE_NAME=0; + REPLACE_MALLOC=0; + REPLACE_MBTOWC=0; + REPLACE_MKSTEMP=0; + REPLACE_PTSNAME=0; + REPLACE_PTSNAME_R=0; + REPLACE_PUTENV=0; + REPLACE_QSORT_R=0; + REPLACE_RANDOM_R=0; + REPLACE_REALLOC=0; + REPLACE_REALPATH=0; + REPLACE_SETENV=0; + REPLACE_STRTOD=0; + REPLACE_UNSETENV=0; + REPLACE_WCTOMB=0; + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5 +printf %s "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; } +if test ${gl_cv_func_malloc_posix+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + choke me + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_malloc_posix=yes +else case e in @%:@( + e) gl_cv_func_malloc_posix=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5 +printf "%s\n" "$gl_cv_func_malloc_posix" >&6; } + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +printf %s "checking for GNU libc compatible malloc... " >&6; } +if test ${ac_cv_func_malloc_0_nonnull+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ + | hpux* | solaris* | cygwin* | mingw* | windows* | msys* ) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +void *p = malloc (0); + int result = !p; + free (p); + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_malloc_0_nonnull=yes +else case e in @%:@( + e) ac_cv_func_malloc_0_nonnull=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes +then : + gl_cv_func_malloc_0_nonnull=1 +else case e in @%:@( + e) gl_cv_func_malloc_0_nonnull=0 ;; +esac +fi + + +printf "%s\n" "@%:@define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull" >>confdefs.h + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + GNULIB_FFSL=0; + GNULIB_FFSLL=0; + GNULIB_MEMCHR=0; + GNULIB_MEMMEM=0; + GNULIB_MEMPCPY=0; + GNULIB_MEMRCHR=0; + GNULIB_RAWMEMCHR=0; + GNULIB_STPCPY=0; + GNULIB_STPNCPY=0; + GNULIB_STRCHRNUL=0; + GNULIB_STRDUP=0; + GNULIB_STRNCAT=0; + GNULIB_STRNDUP=0; + GNULIB_STRNLEN=0; + GNULIB_STRPBRK=0; + GNULIB_STRSEP=0; + GNULIB_STRSTR=0; + GNULIB_STRCASESTR=0; + GNULIB_STRTOK_R=0; + GNULIB_MBSLEN=0; + GNULIB_MBSNLEN=0; + GNULIB_MBSCHR=0; + GNULIB_MBSRCHR=0; + GNULIB_MBSSTR=0; + GNULIB_MBSCASECMP=0; + GNULIB_MBSNCASECMP=0; + GNULIB_MBSPCASECMP=0; + GNULIB_MBSCASESTR=0; + GNULIB_MBSCSPN=0; + GNULIB_MBSPBRK=0; + GNULIB_MBSSPN=0; + GNULIB_MBSSEP=0; + GNULIB_MBSTOK_R=0; + GNULIB_STRERROR=0; + GNULIB_STRERROR_R=0; + GNULIB_STRSIGNAL=0; + GNULIB_STRVERSCMP=0; + HAVE_MBSLEN=0; + HAVE_FFSL=1; + HAVE_FFSLL=1; + HAVE_MEMCHR=1; + HAVE_DECL_MEMMEM=1; + HAVE_MEMPCPY=1; + HAVE_DECL_MEMRCHR=1; + HAVE_RAWMEMCHR=1; + HAVE_STPCPY=1; + HAVE_STPNCPY=1; + HAVE_STRCHRNUL=1; + HAVE_DECL_STRDUP=1; + HAVE_DECL_STRNDUP=1; + HAVE_DECL_STRNLEN=1; + HAVE_STRPBRK=1; + HAVE_STRSEP=1; + HAVE_STRCASESTR=1; + HAVE_DECL_STRTOK_R=1; + HAVE_DECL_STRERROR_R=1; + HAVE_DECL_STRSIGNAL=1; + HAVE_STRVERSCMP=1; + REPLACE_MEMCHR=0; + REPLACE_MEMMEM=0; + REPLACE_STPNCPY=0; + REPLACE_STRDUP=0; + REPLACE_STRSTR=0; + REPLACE_STRCASESTR=0; + REPLACE_STRCHRNUL=0; + REPLACE_STRERROR=0; + REPLACE_STRERROR_R=0; + REPLACE_STRNCAT=0; + REPLACE_STRNDUP=0; + REPLACE_STRNLEN=0; + REPLACE_STRSIGNAL=0; + REPLACE_STRTOK_R=0; + UNDEFINE_STRTOK_R=0; + + + + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in @%:@( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "@%:@define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "@%:@define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + if test $HAVE_MEMCHR = 1; then + # Detect platform-specific bugs in some versions of glibc: + # memchr should not dereference anything with length 0 + # http://bugzilla.redhat.com/499689 + # memchr should not dereference overestimated length after a match + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 + # http://sourceware.org/bugzilla/show_bug.cgi?id=10162 + # Assume that memchr works on platforms that lack mprotect. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5 +printf %s "checking whether memchr works... " >&6; } +if test ${gl_cv_func_memchr_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_memchr_works="guessing no" +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_SYS_MMAN_H +# include +# include +# include +# include +# ifndef MAP_FILE +# define MAP_FILE 0 +# endif +#endif + +int +main (void) +{ + + int result = 0; + char *fence = NULL; +#if HAVE_SYS_MMAN_H && HAVE_MPROTECT +# if HAVE_MAP_ANONYMOUS + const int flags = MAP_ANONYMOUS | MAP_PRIVATE; + const int fd = -1; +# else /* !HAVE_MAP_ANONYMOUS */ + const int flags = MAP_FILE | MAP_PRIVATE; + int fd = open ("/dev/zero", O_RDONLY, 0666); + if (fd >= 0) +# endif + { + int pagesize = getpagesize (); + char *two_pages = + (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, + flags, fd, 0); + if (two_pages != (char *)(-1) + && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) + fence = two_pages + pagesize; + } +#endif + if (fence) + { + if (memchr (fence, 0, 0)) + result |= 1; + strcpy (fence - 9, "12345678"); + if (memchr (fence - 9, 0, 79) != fence - 1) + result |= 2; + if (memchr (fence - 1, 0, 3) != fence - 1) + result |= 4; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_memchr_works=yes +else case e in @%:@( + e) gl_cv_func_memchr_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5 +printf "%s\n" "$gl_cv_func_memchr_works" >&6; } + if test "$gl_cv_func_memchr_works" != yes; then + REPLACE_MEMCHR=1 + fi + fi + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether defines MIN and MAX" >&5 +printf %s "checking whether defines MIN and MAX... " >&6; } +if test ${gl_cv_minmax_in_limits_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int x = MIN (42, 17); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_minmax_in_limits_h=yes +else case e in @%:@( + e) gl_cv_minmax_in_limits_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5 +printf "%s\n" "$gl_cv_minmax_in_limits_h" >&6; } + if test $gl_cv_minmax_in_limits_h = yes; then + +printf "%s\n" "@%:@define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h + + fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether defines MIN and MAX" >&5 +printf %s "checking whether defines MIN and MAX... " >&6; } +if test ${gl_cv_minmax_in_sys_param_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int x = MIN (42, 17); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_minmax_in_sys_param_h=yes +else case e in @%:@( + e) gl_cv_minmax_in_sys_param_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5 +printf "%s\n" "$gl_cv_minmax_in_sys_param_h" >&6; } + if test $gl_cv_minmax_in_sys_param_h = yes; then + +printf "%s\n" "@%:@define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h + + fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether time_t is signed" >&5 +printf %s "checking whether time_t is signed... " >&6; } +if test ${gl_cv_time_t_is_signed+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + char time_t_signed[(time_t) -1 < 0 ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_time_t_is_signed=yes +else case e in @%:@( + e) gl_cv_time_t_is_signed=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_t_is_signed" >&5 +printf "%s\n" "$gl_cv_time_t_is_signed" >&6; } + if test $gl_cv_time_t_is_signed = yes; then + +printf "%s\n" "@%:@define TIME_T_IS_SIGNED 1" >>confdefs.h + + fi + +ac_fn_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_alarm" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_ALARM $ac_have_decl" >>confdefs.h + + + + + + + + + + if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple Mac OS X platforms. + # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode. + # But we need a configuration result that is valid in both modes. + gl_cv_func_working_mktime=no + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5 +printf %s "checking for working mktime... " >&6; } +if test ${gl_cv_func_working_mktime+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_working_mktime="guessing no" +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test program from Paul Eggert and Tony Leneis. */ +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#if HAVE_DECL_ALARM +# include +#endif + +/* Work around redefinition to rpl_putenv by other config tests. */ +#undef putenv + +static time_t time_t_max; +static time_t time_t_min; + +/* Values we'll use to set the TZ environment variable. */ +static char *tz_strings[] = { + (char *) 0, "TZ=GMT0", "TZ=JST-9", + "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" +}; +#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) + +/* Return 0 if mktime fails to convert a date in the spring-forward gap. + Based on a problem report from Andreas Jaeger. */ +static int +spring_forward_gap () +{ + /* glibc (up to about 1998-10-07) failed this test. */ + struct tm tm; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + tm.tm_year = 98; + tm.tm_mon = 3; + tm.tm_mday = 5; + tm.tm_hour = 2; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + return mktime (&tm) != (time_t) -1; +} + +static int +mktime_test1 (time_t now) +{ + struct tm *lt; + return ! (lt = localtime (&now)) || mktime (lt) == now; +} + +static int +mktime_test (time_t now) +{ + return (mktime_test1 (now) + && mktime_test1 ((time_t) (time_t_max - now)) + && mktime_test1 ((time_t) (time_t_min + now))); +} + +static int +irix_6_4_bug () +{ + /* Based on code from Ariel Faigon. */ + struct tm tm; + tm.tm_year = 96; + tm.tm_mon = 3; + tm.tm_mday = 0; + tm.tm_hour = 0; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + mktime (&tm); + return tm.tm_mon == 2 && tm.tm_mday == 31; +} + +static int +bigtime_test (int j) +{ + struct tm tm; + time_t now; + tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; + now = mktime (&tm); + if (now != (time_t) -1) + { + struct tm *lt = localtime (&now); + if (! (lt + && lt->tm_year == tm.tm_year + && lt->tm_mon == tm.tm_mon + && lt->tm_mday == tm.tm_mday + && lt->tm_hour == tm.tm_hour + && lt->tm_min == tm.tm_min + && lt->tm_sec == tm.tm_sec + && lt->tm_yday == tm.tm_yday + && lt->tm_wday == tm.tm_wday + && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) + == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) + return 0; + } + return 1; +} + +static int +year_2050_test () +{ + /* The correct answer for 2050-02-01 00:00:00 in Pacific time, + ignoring leap seconds. */ + unsigned long int answer = 2527315200UL; + + struct tm tm; + time_t t; + tm.tm_year = 2050 - 1900; + tm.tm_mon = 2 - 1; + tm.tm_mday = 1; + tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + tm.tm_isdst = -1; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + t = mktime (&tm); + + /* Check that the result is either a failure, or close enough + to the correct answer that we can assume the discrepancy is + due to leap seconds. */ + return (t == (time_t) -1 + || (0 < t && answer - 120 <= t && t <= answer + 120)); +} + +int +main () +{ + int result = 0; + time_t t, delta; + int i, j; + int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1; + +#if HAVE_DECL_ALARM + /* This test makes some buggy mktime implementations loop. + Give up after 60 seconds; a mktime slower than that + isn't worth using anyway. */ + signal (SIGALRM, SIG_DFL); + alarm (60); +#endif + + time_t_max = (! TIME_T_IS_SIGNED + ? (time_t) -1 + : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1) + * 2 + 1)); + time_t_min = (! TIME_T_IS_SIGNED + ? (time_t) 0 + : time_t_signed_magnitude + ? ~ (time_t) 0 + : ~ time_t_max); + + delta = time_t_max / 997; /* a suitable prime number */ + for (i = 0; i < N_STRINGS; i++) + { + if (tz_strings[i]) + putenv (tz_strings[i]); + + for (t = 0; t <= time_t_max - delta && (result & 1) == 0; t += delta) + if (! mktime_test (t)) + result |= 1; + if ((result & 2) == 0 + && ! (mktime_test ((time_t) 1) + && mktime_test ((time_t) (60 * 60)) + && mktime_test ((time_t) (60 * 60 * 24)))) + result |= 2; + + for (j = 1; (result & 4) == 0; j <<= 1) + { + if (! bigtime_test (j)) + result |= 4; + if (INT_MAX / 2 < j) + break; + } + if ((result & 8) == 0 && ! bigtime_test (INT_MAX)) + result |= 8; + } + if (! irix_6_4_bug ()) + result |= 16; + if (! spring_forward_gap ()) + result |= 32; + if (! year_2050_test ()) + result |= 64; + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_working_mktime=yes +else case e in @%:@( + e) gl_cv_func_working_mktime=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mktime" >&5 +printf "%s\n" "$gl_cv_func_working_mktime" >&6; } + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5 +printf %s "checking for promoted mode_t type... " >&6; } +if test ${gl_cv_promoted_mode_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_promoted_mode_t='int' +else case e in @%:@( + e) gl_cv_promoted_mode_t='mode_t' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5 +printf "%s\n" "$gl_cv_promoted_mode_t" >&6; } + +printf "%s\n" "@%:@define PROMOTED_MODE_T $gl_cv_promoted_mode_t" >>confdefs.h + + + + + GNULIB_PTHREAD_SIGMASK=0; + GNULIB_RAISE=0; + GNULIB_SIGNAL_H_SIGPIPE=0; + GNULIB_SIGPROCMASK=0; + GNULIB_SIGACTION=0; + HAVE_POSIX_SIGNALBLOCKING=1; + HAVE_PTHREAD_SIGMASK=1; + HAVE_RAISE=1; + HAVE_SIGSET_T=1; + HAVE_SIGINFO_T=1; + HAVE_SIGACTION=1; + HAVE_STRUCT_SIGACTION_SA_SIGACTION=1; + + HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1; + + HAVE_SIGHANDLER_T=1; + REPLACE_PTHREAD_SIGMASK=0; + REPLACE_RAISE=0; + + + ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" " + #include + /* Mingw defines sigset_t not in , but in . */ + #include + +" +if test "x$ac_cv_type_sigset_t" = xyes +then : + +printf "%s\n" "@%:@define HAVE_SIGSET_T 1" >>confdefs.h + +gl_cv_type_sigset_t=yes +else case e in @%:@( + e) gl_cv_type_sigset_t=no ;; +esac +fi + + if test $gl_cv_type_sigset_t != yes; then + HAVE_SIGSET_T=0 + fi + + + + + + + + +ac_fn_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_setenv" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_SETENV $ac_have_decl" >>confdefs.h + + + + + + if test $ac_cv_have_decl_setenv = no; then + HAVE_DECL_SETENV=0 + fi + + + + + + ac_fn_c_check_header_compile "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default" +if test "x$ac_cv_header_search_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_SEARCH_H 1" >>confdefs.h + +fi + + ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch" +if test "x$ac_cv_func_tsearch" = xyes +then : + printf "%s\n" "@%:@define HAVE_TSEARCH 1" >>confdefs.h + +fi + + + + +ac_fn_c_check_type "$LINENO" "uid_t" "ac_cv_type_uid_t" "$ac_includes_default" +if test "x$ac_cv_type_uid_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define uid_t int" >>confdefs.h + ;; +esac +fi + +ac_fn_c_check_type "$LINENO" "gid_t" "ac_cv_type_gid_t" "$ac_includes_default" +if test "x$ac_cv_type_gid_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define gid_t int" >>confdefs.h + ;; +esac +fi + +: + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +printf %s "checking for stdbool.h that conforms to C99... " >&6; } +if test ${ac_cv_header_stdbool_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + + #ifdef __cplusplus + typedef bool Bool; + #else + typedef _Bool Bool; + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #endif + + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + Bool q = true; + Bool *pq = &q; + bool *qq = &q; + +int +main (void) +{ + + bool e = &s; + *pq |= q; *pq |= ! q; + *qq |= q; *qq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq + !qq); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_header_stdbool_h=yes +else case e in @%:@( + e) ac_cv_header_stdbool_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } + ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes +then : + +printf "%s\n" "@%:@define HAVE__BOOL 1" >>confdefs.h + + +fi + + + + GNULIB_FFS=0; + HAVE_FFS=1; + HAVE_STRCASECMP=1; + HAVE_DECL_STRNCASECMP=1; + + + REPLACE_STRERROR_0=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5 +printf %s "checking whether strerror(0) succeeds... " >&6; } +if test ${gl_cv_func_strerror_0_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_strerror_0_works="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +int result = 0; + char *str; + errno = 0; + str = strerror (0); + if (!*str) result |= 1; + if (errno) result |= 2; + if (strstr (str, "nknown") || strstr (str, "ndefined")) + result |= 4; + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strerror_0_works=yes +else case e in @%:@( + e) gl_cv_func_strerror_0_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5 +printf "%s\n" "$gl_cv_func_strerror_0_works" >&6; } + case "$gl_cv_func_strerror_0_works" in + *yes) ;; + *) + REPLACE_STRERROR_0=1 + +printf "%s\n" "@%:@define REPLACE_STRERROR_0 1" >>confdefs.h + + ;; + esac + + + + + + + + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5 +printf %s "checking for strerror_r with POSIX signature... " >&6; } +if test ${gl_cv_func_strerror_r_posix_signature+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int strerror_r (int, char *, size_t); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_strerror_r_posix_signature=yes +else case e in @%:@( + e) gl_cv_func_strerror_r_posix_signature=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_strerror_r_posix_signature" >&6; } + if test $gl_cv_func_strerror_r_posix_signature = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5 +printf %s "checking whether strerror_r works... " >&6; } +if test ${gl_cv_func_strerror_r_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on AIX. + aix*) gl_cv_func_strerror_r_works="guessing no";; + # Guess no on HP-UX. + hpux*) gl_cv_func_strerror_r_works="guessing no";; + # Guess no on BSD variants. + *bsd*) gl_cv_func_strerror_r_works="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_strerror_r_works="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +int result = 0; + char buf[79]; + if (strerror_r (EACCES, buf, 0) < 0) + result |= 1; + errno = 0; + if (strerror_r (EACCES, buf, sizeof buf) != 0) + result |= 2; + strcpy (buf, "Unknown"); + if (strerror_r (0, buf, sizeof buf) != 0) + result |= 4; + if (errno) + result |= 8; + if (strstr (buf, "nknown") || strstr (buf, "ndefined")) + result |= 0x10; + errno = 0; + *buf = 0; + if (strerror_r (-3, buf, sizeof buf) < 0) + result |= 0x20; + if (errno) + result |= 0x40; + if (!*buf) + result |= 0x80; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strerror_r_works=yes +else case e in @%:@( + e) gl_cv_func_strerror_r_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5 +printf "%s\n" "$gl_cv_func_strerror_r_works" >&6; } + else + + if test $ac_cv_func___xpg_strerror_r = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5 +printf %s "checking whether __xpg_strerror_r works... " >&6; } +if test ${gl_cv_func_strerror_r_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_strerror_r_works="guessing no" + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + extern + #ifdef __cplusplus + "C" + #endif + int __xpg_strerror_r(int, char *, size_t); + +int +main (void) +{ +int result = 0; + char buf[256] = "^"; + char copy[256]; + char *str = strerror (-1); + strcpy (copy, str); + if (__xpg_strerror_r (-2, buf, 1) == 0) + result |= 1; + if (*buf) + result |= 2; + __xpg_strerror_r (-2, buf, 256); + if (strcmp (str, copy)) + result |= 4; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strerror_r_works=yes +else case e in @%:@( + e) gl_cv_func_strerror_r_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5 +printf "%s\n" "$gl_cv_func_strerror_r_works" >&6; } + fi + fi + fi + fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +printf %s "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if test ${ac_cv_struct_tm+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main (void) +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_struct_tm=time.h +else case e in @%:@( + e) ac_cv_struct_tm=sys/time.h ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +printf "%s\n" "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +printf "%s\n" "@%:@define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include +#include <$ac_cv_struct_tm> + +" +if test "x$ac_cv_member_struct_tm_tm_zone" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_TM_TM_ZONE 1" >>confdefs.h + + +fi + +if test "$ac_cv_member_struct_tm_tm_zone" = yes; then + +printf "%s\n" "@%:@define HAVE_TM_ZONE 1" >>confdefs.h + +else + ac_fn_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_tzname" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_TZNAME $ac_have_decl" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 +printf %s "checking for tzname... " >&6; } +if test ${ac_cv_var_tzname+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#if !HAVE_DECL_TZNAME +extern char *tzname[]; +#endif + +int +main (void) +{ +return tzname[0][0]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_var_tzname=yes +else case e in @%:@( + e) ac_cv_var_tzname=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5 +printf "%s\n" "$ac_cv_var_tzname" >&6; } + if test $ac_cv_var_tzname = yes; then + +printf "%s\n" "@%:@define HAVE_TZNAME 1" >>confdefs.h + + fi +fi + + + ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include +" +if test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes +then : + +printf "%s\n" "@%:@define HAVE_TM_GMTOFF 1" >>confdefs.h + +fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_string_h='<'string.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_string_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'string.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_string_h + gl_cv_next_string_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5 +printf "%s\n" "$gl_cv_next_string_h" >&6; } + fi + NEXT_STRING_H=$gl_cv_next_string_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'string.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_string_h + fi + NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive + + + + + + + for gl_func in ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r strerror_r strsignal strverscmp; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_strings_h='<'strings.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_strings_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_strings_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'strings.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_strings_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_strings_h + gl_cv_next_strings_h='"'$gl_header'"' + else + gl_cv_next_strings_h='<'strings.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_strings_h" >&5 +printf "%s\n" "$gl_cv_next_strings_h" >&6; } + fi + NEXT_STRINGS_H=$gl_cv_next_strings_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'strings.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_strings_h + fi + NEXT_AS_FIRST_DIRECTIVE_STRINGS_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_strings_h = yes; then + HAVE_STRINGS_H=1 + else + HAVE_STRINGS_H=0 + fi + + + + for gl_func in ffs strcasecmp strncasecmp; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Minix 3.1.8 has a bug: must be included before + . */ + #include + #include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + +ac_fn_check_decl "$LINENO" "strndup" "ac_cv_have_decl_strndup" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strndup" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_STRNDUP $ac_have_decl" >>confdefs.h + + +ac_fn_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strnlen" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_STRNLEN $ac_have_decl" >>confdefs.h + + + +ac_fn_check_decl "$LINENO" "strtoumax" "ac_cv_have_decl_strtoumax" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strtoumax" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_STRTOUMAX $ac_have_decl" >>confdefs.h + + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_types_h='<'sys/types.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_types_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/types.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_types_h + gl_cv_next_sys_types_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5 +printf "%s\n" "$gl_cv_next_sys_types_h" >&6; } + fi + NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/types.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_types_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive + + + + + + + + + + + + + WINDOWS_STAT_INODES=0 + + + + + GNULIB_WAITPID=0; + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 +printf %s "checking for struct timespec in ... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_time_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_time_h=yes +else case e in @%:@( + e) gl_cv_sys_struct_timespec_in_time_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_time_h" >&6; } + + TIME_H_DEFINES_STRUCT_TIMESPEC=0 + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 + UNISTD_H_DEFINES_STRUCT_TIMESPEC=0 + if test $gl_cv_sys_struct_timespec_in_time_h = yes; then + TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 +printf %s "checking for struct timespec in ... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_sys_time_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_sys_time_h=yes +else case e in @%:@( + e) gl_cv_sys_struct_timespec_in_sys_time_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 +printf %s "checking for struct timespec in ... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_pthread_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_pthread_h=yes +else case e in @%:@( + e) gl_cv_sys_struct_timespec_in_pthread_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 +printf %s "checking for struct timespec in ... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_unistd_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_unistd_h=yes +else case e in @%:@( + e) gl_cv_sys_struct_timespec_in_unistd_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then + UNISTD_H_DEFINES_STRUCT_TIMESPEC=1 + fi + fi + fi + fi + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_time_h='<'time.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_time_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'time.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_time_h + gl_cv_next_time_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5 +printf "%s\n" "$gl_cv_next_time_h" >&6; } + fi + NEXT_TIME_H=$gl_cv_next_time_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'time.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_time_h + fi + NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive + + + + + + + + + + + + + + +gl_libunistring_sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' + + + if test "$HAVE_LIBUNISTRING" = yes; then + LIBUNISTRING_VERSION_MAJOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_major"` + LIBUNISTRING_VERSION_MINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_minor"` + LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_subminor"` + fi + +ac_fn_check_decl "$LINENO" "clearerr_unlocked" "ac_cv_have_decl_clearerr_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_clearerr_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_CLEARERR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "feof_unlocked" "ac_cv_have_decl_feof_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_feof_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FEOF_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "ferror_unlocked" "ac_cv_have_decl_ferror_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_ferror_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FERROR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fflush_unlocked" "ac_cv_have_decl_fflush_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fflush_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FFLUSH_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fgets_unlocked" "ac_cv_have_decl_fgets_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fgets_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FGETS_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fputc_unlocked" "ac_cv_have_decl_fputc_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fputc_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FPUTC_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fputs_unlocked" "ac_cv_have_decl_fputs_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fputs_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FPUTS_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fread_unlocked" "ac_cv_have_decl_fread_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fread_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FREAD_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fwrite_unlocked" "ac_cv_have_decl_fwrite_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fwrite_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FWRITE_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "getchar_unlocked" "ac_cv_have_decl_getchar_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getchar_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_GETCHAR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "putc_unlocked" "ac_cv_have_decl_putc_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_putc_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_PUTC_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "putchar_unlocked" "ac_cv_have_decl_putchar_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_putchar_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_PUTCHAR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_unsetenv" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_UNSETENV $ac_have_decl" >>confdefs.h + + + + + + if test $ac_cv_header_features_h = yes; then + HAVE_FEATURES_H=1 + else + HAVE_FEATURES_H=0 + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5 +printf %s "checking for inttypes.h... " >&6; } +if test ${gl_cv_header_inttypes_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +uintmax_t i = (uintmax_t) -1; return !i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_inttypes_h=yes +else case e in @%:@( + e) gl_cv_header_inttypes_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_inttypes_h" >&5 +printf "%s\n" "$gl_cv_header_inttypes_h" >&6; } + if test $gl_cv_header_inttypes_h = yes; then + +printf "%s\n" "@%:@define HAVE_INTTYPES_H_WITH_UINTMAX 1" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5 +printf %s "checking for stdint.h... " >&6; } +if test ${gl_cv_header_stdint_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include +int +main (void) +{ +uintmax_t i = (uintmax_t) -1; return !i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_stdint_h=yes +else case e in @%:@( + e) gl_cv_header_stdint_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_h" >&5 +printf "%s\n" "$gl_cv_header_stdint_h" >&6; } + if test $gl_cv_header_stdint_h = yes; then + +printf "%s\n" "@%:@define HAVE_STDINT_H_WITH_UINTMAX 1" >>confdefs.h + + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5 +printf %s "checking for intmax_t... " >&6; } +if test ${gt_cv_c_intmax_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_STDINT_H_WITH_UINTMAX +#include +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include +#endif + +int +main (void) +{ +intmax_t x = -1; return !x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_c_intmax_t=yes +else case e in @%:@( + e) gt_cv_c_intmax_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_intmax_t" >&5 +printf "%s\n" "$gt_cv_c_intmax_t" >&6; } + if test $gt_cv_c_intmax_t = yes; then + +printf "%s\n" "@%:@define HAVE_INTMAX_T 1" >>confdefs.h + + else + + test $ac_cv_type_long_long_int = yes \ + && ac_type='long long' \ + || ac_type='long' + +printf "%s\n" "@%:@define intmax_t $ac_type" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5 +printf %s "checking where to find the exponent in a 'double'... " >&6; } +if test ${gl_cv_cc_double_expbit0+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined arm || defined __arm || defined __arm__ + mixed_endianness +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "mixed_endianness" >/dev/null 2>&1 +then : + gl_cv_cc_double_expbit0="unknown" +else case e in @%:@( + e) + : +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in @%:@( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in @%:@( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes +then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +unsigned short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + unsigned short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + unsigned short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + unsigned short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else case e in @%:@( + e) ac_cv_c_bigendian=yes ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi ;; +esac +fi +: + case $ac_cv_c_bigendian in #( + yes) + gl_cv_cc_double_expbit0="word 0 bit 20";; #( + no) + gl_cv_cc_double_expbit0="word 1 bit 20" ;; #( + universal) + +printf "%s\n" "@%:@define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + gl_cv_cc_double_expbit0="unknown" ;; + esac + + ;; +esac +fi +rm -rf conftest* + + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +#define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { double value; unsigned int word[NWORDS]; } memory_double; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (double x) +{ + memory_double m; + size_t i; + /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ + memset (&m, 0, sizeof (memory_double)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25); + add_to_ored_words (0.5); + add_to_ored_words (1.0); + add_to_ored_words (2.0); + add_to_ored_words (4.0); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_cc_double_expbit0=`cat conftest.out` +else case e in @%:@( + e) gl_cv_cc_double_expbit0="unknown" ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.out + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5 +printf "%s\n" "$gl_cv_cc_double_expbit0" >&6; } + case "$gl_cv_cc_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` + +printf "%s\n" "@%:@define DBL_EXPBIT0_WORD $word" >>confdefs.h + + +printf "%s\n" "@%:@define DBL_EXPBIT0_BIT $bit" >>confdefs.h + + ;; + esac + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether snprintf returns a byte count as in C99" >&5 +printf %s "checking whether snprintf returns a byte count as in C99... " >&6; } +if test ${gl_cv_func_snprintf_retval_c99+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";; + darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_retval_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";; + aix*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_retval_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_retval_c99="guessing no";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char buf[100]; +int main () +{ + strcpy (buf, "ABCDEF"); + if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7) + return 1; + if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7) + return 2; + if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7) + return 3; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_snprintf_retval_c99=yes +else case e in @%:@( + e) gl_cv_func_snprintf_retval_c99=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_retval_c99" >&5 +printf "%s\n" "$gl_cv_func_snprintf_retval_c99" >&6; } + + + + + + + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "@%:@define HAVE_SNPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strnlen" "ac_cv_func_strnlen" +if test "x$ac_cv_func_strnlen" = xyes +then : + printf "%s\n" "@%:@define HAVE_STRNLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcslen" "ac_cv_func_wcslen" +if test "x$ac_cv_func_wcslen" = xyes +then : + printf "%s\n" "@%:@define HAVE_WCSLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcsnlen" "ac_cv_func_wcsnlen" +if test "x$ac_cv_func_wcsnlen" = xyes +then : + printf "%s\n" "@%:@define HAVE_WCSNLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mbrtowc" "ac_cv_func_mbrtowc" +if test "x$ac_cv_func_mbrtowc" = xyes +then : + printf "%s\n" "@%:@define HAVE_MBRTOWC 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcrtomb" "ac_cv_func_wcrtomb" +if test "x$ac_cv_func_wcrtomb" = xyes +then : + printf "%s\n" "@%:@define HAVE_WCRTOMB 1" >>confdefs.h + +fi + + ac_fn_check_decl "$LINENO" "_snprintf" "ac_cv_have_decl__snprintf" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl__snprintf" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL__SNPRINTF $ac_have_decl" >>confdefs.h + + + + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + +printf "%s\n" "@%:@define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h + + ;; + esac + + + + + GNULIB_SOCKET=0; + GNULIB_CONNECT=0; + GNULIB_ACCEPT=0; + GNULIB_BIND=0; + GNULIB_GETPEERNAME=0; + GNULIB_GETSOCKNAME=0; + GNULIB_GETSOCKOPT=0; + GNULIB_LISTEN=0; + GNULIB_RECV=0; + GNULIB_SEND=0; + GNULIB_RECVFROM=0; + GNULIB_SENDTO=0; + GNULIB_SETSOCKOPT=0; + GNULIB_SHUTDOWN=0; + GNULIB_ACCEPT4=0; + HAVE_STRUCT_SOCKADDR_STORAGE=1; + HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1; + + HAVE_SA_FAMILY_T=1; + HAVE_ACCEPT4=1; + + + if test $ac_cv_header_sys_socket_h = no; then + ac_fn_c_check_header_compile "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" +if test "x$ac_cv_header_ws2tcpip_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WS2TCPIP_H 1" >>confdefs.h + +fi + + fi + + + + + + case "$host_os" in + osf*) + +printf "%s\n" "@%:@define _POSIX_PII_SOCKET 1" >>confdefs.h + + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether is self-contained" >&5 +printf %s "checking whether is self-contained... " >&6; } +if test ${gl_cv_header_sys_socket_h_selfcontained+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_sys_socket_h_selfcontained=yes +else case e in @%:@( + e) gl_cv_header_sys_socket_h_selfcontained=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5 +printf "%s\n" "$gl_cv_header_sys_socket_h_selfcontained" >&6; } + if test $gl_cv_header_sys_socket_h_selfcontained = yes; then + ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown" +if test "x$ac_cv_func_shutdown" = xyes +then : + printf "%s\n" "@%:@define HAVE_SHUTDOWN 1" >>confdefs.h + +fi + + if test $ac_cv_func_shutdown = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether defines the SHUT_* macros" >&5 +printf %s "checking whether defines the SHUT_* macros... " >&6; } +if test ${gl_cv_header_sys_socket_h_shut+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR }; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_sys_socket_h_shut=yes +else case e in @%:@( + e) gl_cv_header_sys_socket_h_shut=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5 +printf "%s\n" "$gl_cv_header_sys_socket_h_shut" >&6; } + if test $gl_cv_header_sys_socket_h_shut = no; then + SYS_SOCKET_H='sys/socket.h' + fi + fi + fi + # We need to check for ws2tcpip.h now. + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_socket_h='<'sys/socket.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_socket_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_socket_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/socket.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_socket_h + gl_cv_next_sys_socket_h='"'$gl_header'"' + else + gl_cv_next_sys_socket_h='<'sys/socket.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5 +printf "%s\n" "$gl_cv_next_sys_socket_h" >&6; } + fi + NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/socket.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_socket_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_sys_socket_h = yes; then + HAVE_SYS_SOCKET_H=1 + HAVE_WS2TCPIP_H=0 + else + HAVE_SYS_SOCKET_H=0 + if test $ac_cv_header_ws2tcpip_h = yes; then + HAVE_WS2TCPIP_H=1 + else + HAVE_WS2TCPIP_H=0 + fi + fi + + + + ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" " + /* sys/types.h is not needed according to POSIX, but the + sys/socket.h in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif + +" +if test "x$ac_cv_type_struct_sockaddr_storage" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h + + +fi +ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" " + /* sys/types.h is not needed according to POSIX, but the + sys/socket.h in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif + +" +if test "x$ac_cv_type_sa_family_t" = xyes +then : + +printf "%s\n" "@%:@define HAVE_SA_FAMILY_T 1" >>confdefs.h + + +fi + + if test $ac_cv_type_struct_sockaddr_storage = no; then + HAVE_STRUCT_SOCKADDR_STORAGE=0 + fi + if test $ac_cv_type_sa_family_t = no; then + HAVE_SA_FAMILY_T=0 + fi + if test $ac_cv_type_struct_sockaddr_storage != no; then + ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include + #ifdef HAVE_SYS_SOCKET_H + #include + #endif + #ifdef HAVE_WS2TCPIP_H + #include + #endif + +" +if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1" >>confdefs.h + + +else case e in @%:@( + e) HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0 ;; +esac +fi + + fi + if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \ + || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then + SYS_SOCKET_H='sys/socket.h' + fi + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + + + for gl_func in socket connect accept bind getpeername getsockname getsockopt listen recv send recvfrom sendto setsockopt shutdown accept4; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Some systems require prerequisite headers. */ +#include +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + GNULIB_INET_NTOP=0; + GNULIB_INET_PTON=0; + HAVE_DECL_INET_NTOP=1; + HAVE_DECL_INET_PTON=1; + REPLACE_INET_NTOP=0; + REPLACE_INET_PTON=0; + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5 +printf %s "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; } +if test ${gl_cv_func_getcwd_null+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_getcwd_null="guessing yes";; + # Guess yes on Cygwin. + cygwin*) gl_cv_func_getcwd_null="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_getcwd_null="guessing no";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# include +# if HAVE_UNISTD_H +# include +# else /* on Windows with MSVC */ +# include +# endif +# ifndef getcwd + char *getcwd (); +# endif + +int +main (void) +{ + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* mingw cwd does not start with '/', but getcwd does allocate. + However, mingw fails to honor non-zero size. */ +#else + if (chdir ("/") != 0) + return 1; + else + { + char *f = getcwd (NULL, 0); + if (! f) + return 2; + if (f[0] != '/') + return 3; + if (f[1] != '\0') + return 4; + free (f); + return 0; + } +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getcwd_null=yes +else case e in @%:@( + e) gl_cv_func_getcwd_null=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5 +printf "%s\n" "$gl_cv_func_getcwd_null" >&6; } + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5 +printf %s "checking for getcwd with POSIX signature... " >&6; } +if test ${gl_cv_func_getcwd_posix_signature+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +extern + #ifdef __cplusplus + "C" + #endif + char *getcwd (char *, size_t); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_getcwd_posix_signature=yes +else case e in @%:@( + e) gl_cv_func_getcwd_posix_signature=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_getcwd_posix_signature" >&6; } + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5 +printf %s "checking for IPv4 sockets... " >&6; } + if test ${gl_cv_socket_ipv4+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +int +main (void) +{ +int x = AF_INET; struct in_addr y; struct sockaddr_in z; + if (&x && &y && &z) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_socket_ipv4=yes +else case e in @%:@( + e) gl_cv_socket_ipv4=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5 +printf "%s\n" "$gl_cv_socket_ipv4" >&6; } + if test $gl_cv_socket_ipv4 = yes; then + +printf "%s\n" "@%:@define HAVE_IPV4 1" >>confdefs.h + + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5 +printf %s "checking for IPv6 sockets... " >&6; } + if test ${gl_cv_socket_ipv6+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif +int +main (void) +{ +int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; + if (&x && &y && &z) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_socket_ipv6=yes +else case e in @%:@( + e) gl_cv_socket_ipv6=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5 +printf "%s\n" "$gl_cv_socket_ipv6" >&6; } + if test $gl_cv_socket_ipv6 = yes; then + +printf "%s\n" "@%:@define HAVE_IPV6 1" >>confdefs.h + + fi + + + + GNULIB_PSELECT=0; + GNULIB_SELECT=0; + HAVE_PSELECT=1; + REPLACE_PSELECT=0; + REPLACE_SELECT=0; + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether is self-contained" >&5 +printf %s "checking whether is self-contained... " >&6; } +if test ${gl_cv_header_sys_select_h_selfcontained+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +struct timeval b; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_sys_select_h_selfcontained=yes +else case e in @%:@( + e) gl_cv_header_sys_select_h_selfcontained=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $gl_cv_header_sys_select_h_selfcontained = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +int memset; int bzero; + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + + #undef memset + #define memset nonexistent_memset + extern + #ifdef __cplusplus + "C" + #endif + void *memset (void *, int, unsigned long); + #undef bzero + #define bzero nonexistent_bzero + extern + #ifdef __cplusplus + "C" + #endif + void bzero (void *, unsigned long); + fd_set fds; + FD_ZERO (&fds); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in @%:@( + e) gl_cv_header_sys_select_h_selfcontained=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_select_h_selfcontained" >&5 +printf "%s\n" "$gl_cv_header_sys_select_h_selfcontained" >&6; } + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_select_h='<'sys/select.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_select_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_select_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/select.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_select_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_select_h + gl_cv_next_sys_select_h='"'$gl_header'"' + else + gl_cv_next_sys_select_h='<'sys/select.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_select_h" >&5 +printf "%s\n" "$gl_cv_next_sys_select_h" >&6; } + fi + NEXT_SYS_SELECT_H=$gl_cv_next_sys_select_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/select.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_select_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_sys_select_h = yes; then + HAVE_SYS_SELECT_H=1 + else + HAVE_SYS_SELECT_H=0 + fi + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + + + for gl_func in pselect select; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Some systems require prerequisite headers. */ +#include +#if !(defined __GLIBC__ && !defined __UCLIBC__) && HAVE_SYS_TIME_H +# include +#endif +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + LIBSOCKET= + if test $HAVE_WINSOCK2_H = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we need to call WSAStartup in winsock2.h and -lws2_32" >&5 +printf %s "checking if we need to call WSAStartup in winsock2.h and -lws2_32... " >&6; } +if test ${gl_cv_func_wsastartup+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_WINSOCK2_H +# include +#endif +int +main (void) +{ + + WORD wVersionRequested = MAKEWORD(1, 1); + WSADATA wsaData; + int err = WSAStartup(wVersionRequested, &wsaData); + WSACleanup (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_func_wsastartup=yes +else case e in @%:@( + e) gl_cv_func_wsastartup=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wsastartup" >&5 +printf "%s\n" "$gl_cv_func_wsastartup" >&6; } + if test "$gl_cv_func_wsastartup" = "yes"; then + +printf "%s\n" "@%:@define WINDOWS_SOCKETS 1" >>confdefs.h + + LIBSOCKET='-lws2_32' + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5 +printf %s "checking for library containing setsockopt... " >&6; } +if test ${gl_cv_lib_socket+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_cv_lib_socket= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in @%:@( + e) gl_save_LIBS="$LIBS" + LIBS="$gl_save_LIBS -lsocket" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_lib_socket="-lsocket" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$gl_cv_lib_socket"; then + LIBS="$gl_save_LIBS -lnetwork" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_lib_socket="-lnetwork" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$gl_cv_lib_socket"; then + LIBS="$gl_save_LIBS -lnet" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_lib_socket="-lnet" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + fi + LIBS="$gl_save_LIBS" + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$gl_cv_lib_socket"; then + gl_cv_lib_socket="none needed" + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_socket" >&5 +printf "%s\n" "$gl_cv_lib_socket" >&6; } + if test "$gl_cv_lib_socket" != "none needed"; then + LIBSOCKET="$gl_cv_lib_socket" + fi + fi + + + + + + + : + + + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + REPLACE_SELECT=1 + else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select supports a 0 argument" >&5 +printf %s "checking whether select supports a 0 argument... " >&6; } +if test ${gl_cv_func_select_supports0+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on Interix. + interix*) gl_cv_func_select_supports0="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_select_supports0="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_SYS_SELECT_H +#include +#endif +int main () +{ + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_supports0=yes +else case e in @%:@( + e) gl_cv_func_select_supports0=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_supports0" >&5 +printf "%s\n" "$gl_cv_func_select_supports0" >&6; } + case "$gl_cv_func_select_supports0" in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select detects invalid fds" >&5 +printf %s "checking whether select detects invalid fds... " >&6; } +if test ${gl_cv_func_select_detects_ebadf+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_select_detects_ebadf="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_SYS_SELECT_H +# include +#endif +#include +#include + +int +main (void) +{ + + fd_set set; + dup2(0, 16); + FD_ZERO(&set); + FD_SET(16, &set); + close(16); + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_detects_ebadf=yes +else case e in @%:@( + e) gl_cv_func_select_detects_ebadf=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_detects_ebadf" >&5 +printf "%s\n" "$gl_cv_func_select_detects_ebadf" >&6; } + case $gl_cv_func_select_detects_ebadf in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + fi + + LIB_SELECT="$LIBSOCKET" + if test $REPLACE_SELECT = 1; then + case "$host_os" in + mingw*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define WIN32_LEAN_AND_MEAN +#include +int +main () +{ + MsgWaitForMultipleObjects (0, NULL, 0, 0, 0); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in @%:@( + e) LIB_SELECT="$LIB_SELECT -luser32" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ;; + esac + fi + + + + + + + + + + if test $ac_cv_have_decl_strerror_r = no; then + HAVE_DECL_STRERROR_R=0 + fi + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + if test $gl_cv_func_strerror_r_posix_signature = yes; then + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR_R=1 ;; + esac + else + REPLACE_STRERROR_R=1 + fi + else + REPLACE_STRERROR_R=1 + fi + fi + + + +ac_fn_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_snprintf" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_SNPRINTF $ac_have_decl" >>confdefs.h + + + + + + + + + + if false; then + GL_COND_LIBTOOL_TRUE= + GL_COND_LIBTOOL_FALSE='#' +else + GL_COND_LIBTOOL_TRUE='#' + GL_COND_LIBTOOL_FALSE= +fi + + gl_cond_libtool=false + gl_libdeps= + gl_ltlibdeps= + gl_m4_base='m4' + + + + + + + + + + gl_source_base='lib' + + + if test $ac_cv_func_alloca_works = no; then + : + fi + + # Define an additional variable used in the Makefile substitution. + if test $ac_cv_working_alloca_h = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5 +printf %s "checking for alloca as a compiler built-in... " >&6; } +if test ${gl_cv_rpl_alloca+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined __GNUC__ || defined _AIX || defined _MSC_VER + Need own alloca +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "Need own alloca" >/dev/null 2>&1 +then : + gl_cv_rpl_alloca=yes +else case e in @%:@( + e) gl_cv_rpl_alloca=no ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5 +printf "%s\n" "$gl_cv_rpl_alloca" >&6; } + if test $gl_cv_rpl_alloca = yes; then + +printf "%s\n" "@%:@define HAVE_ALLOCA 1" >>confdefs.h + + ALLOCA_H=alloca.h + else + ALLOCA_H= + fi + else + ALLOCA_H=alloca.h + fi + + if test -n "$ALLOCA_H"; then + GL_GENERATE_ALLOCA_H_TRUE= + GL_GENERATE_ALLOCA_H_FALSE='#' +else + GL_GENERATE_ALLOCA_H_TRUE='#' + GL_GENERATE_ALLOCA_H_FALSE= +fi + + + + + + + + + if test $ac_cv_func_btowc = no; then + HAVE_BTOWC=0 + else + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether btowc(0) is correct" >&5 +printf %s "checking whether btowc(0) is correct... " >&6; } +if test ${gl_cv_func_btowc_nul+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on Cygwin. + cygwin*) gl_cv_func_btowc_nul="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_nul="guessing yes" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (btowc ('\0') != 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_btowc_nul=yes +else case e in @%:@( + e) gl_cv_func_btowc_nul=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_nul" >&5 +printf "%s\n" "$gl_cv_func_btowc_nul" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5 +printf %s "checking whether btowc(EOF) is correct... " >&6; } +if test ${gl_cv_func_btowc_eof+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on IRIX. + irix*) gl_cv_func_btowc_eof="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_eof="guessing yes" ;; + esac + if test $LOCALE_FR != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (btowc (EOF) != WEOF) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_btowc_eof=yes +else case e in @%:@( + e) gl_cv_func_btowc_eof=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5 +printf "%s\n" "$gl_cv_func_btowc_eof" >&6; } + + case "$gl_cv_func_btowc_nul" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + case "$gl_cv_func_btowc_eof" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + fi + + if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS btowc.$ac_objext" + + + : + + fi + + + + + + GNULIB_BTOWC=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_BTOWC 1" >>confdefs.h + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5 +printf %s "checking for __builtin_expect... " >&6; } +if test ${gl_cv___builtin_expect+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int + main (int argc, char **argv) + { + argc = __builtin_expect (argc, 100); + return argv[argc != 100][0]; + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv___builtin_expect=yes +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + int + main (int argc, char **argv) + { + argc = __builtin_expect (argc, 100); + return argv[argc != 100][0]; + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv___builtin_expect="in " +else case e in @%:@( + e) gl_cv___builtin_expect=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5 +printf "%s\n" "$gl_cv___builtin_expect" >&6; } + if test "$gl_cv___builtin_expect" = yes; then + printf "%s\n" "@%:@define HAVE___BUILTIN_EXPECT 1" >>confdefs.h + + elif test "$gl_cv___builtin_expect" = "in "; then + printf "%s\n" "@%:@define HAVE___BUILTIN_EXPECT 2" >>confdefs.h + + fi + + + + + + + # for STACK_DIRECTION + + + + ac_fn_check_decl "$LINENO" "sigaltstack" "ac_cv_have_decl_sigaltstack" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_sigaltstack" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_SIGALTSTACK $ac_have_decl" >>confdefs.h + + + + + ac_fn_c_check_type "$LINENO" "stack_t" "ac_cv_type_stack_t" "#include +" +if test "x$ac_cv_type_stack_t" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STACK_T 1" >>confdefs.h + + +fi + + + if test "$gl_cv_lib_sigsegv" = yes \ + && test $"ac_cv_sys_xsi_stack_overflow_heuristic" != yes ; then + LIBCSTACK=$LIBSIGSEGV + + LTLIBCSTACK=$LTLIBSIGSEGV + + fi + + + + + + + # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. + # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. + + # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* + # programs in the package would end up linked with that potentially-shared + # library, inducing unnecessary run-time overhead. + LIB_CLOCK_GETTIME= + + gl_saved_libs=$LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 +printf %s "checking for library containing clock_gettime... " >&6; } +if test ${ac_cv_search_clock_gettime+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (void); +int +main (void) +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt posix4 +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_clock_gettime=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_clock_gettime+y} +then : + break +fi +done +if test ${ac_cv_search_clock_gettime+y} +then : + +else case e in @%:@( + e) ac_cv_search_clock_gettime=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 +printf "%s\n" "$ac_cv_search_clock_gettime" >&6; } +ac_res=$ac_cv_search_clock_gettime +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ac_cv_search_clock_gettime" = "none required" || + LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime +fi + + ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" +if test "x$ac_cv_func_clock_gettime" = xyes +then : + printf "%s\n" "@%:@define HAVE_CLOCK_GETTIME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "clock_settime" "ac_cv_func_clock_settime" +if test "x$ac_cv_func_clock_settime" = xyes +then : + printf "%s\n" "@%:@define HAVE_CLOCK_SETTIME 1" >>confdefs.h + +fi + + LIBS=$gl_saved_libs + + + + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_CLOSE=1 + fi + + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then + REPLACE_CLOSE=1 + fi + + + + if test $REPLACE_CLOSE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext" + + fi + + + + + + GNULIB_CLOSE=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_CLOSE 1" >>confdefs.h + + + + + + if test "x$datarootdir" = x; then + datarootdir='${datadir}' + + fi + if test "x$docdir" = x; then + docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' + + fi + if test "x$htmldir" = x; then + htmldir='${docdir}' + + fi + if test "x$dvidir" = x; then + dvidir='${docdir}' + + fi + if test "x$pdfdir" = x; then + pdfdir='${docdir}' + + fi + if test "x$psdir" = x; then + psdir='${docdir}' + + fi + if test "x$lispdir" = x; then + lispdir='${datarootdir}/emacs/site-lisp' + + fi + if test "x$localedir" = x; then + localedir='${datarootdir}/locale' + + fi + if test "x$runstatedir" = x; then + runstatedir='${localstatedir}/run' + + fi + + pkglibexecdir='${libexecdir}/${PACKAGE}' + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_ctype_h='<'ctype.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_ctype_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'ctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_ctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_ctype_h + gl_cv_next_ctype_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_ctype_h" >&5 +printf "%s\n" "$gl_cv_next_ctype_h" >&6; } + fi + NEXT_CTYPE_H=$gl_cv_next_ctype_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'ctype.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_ctype_h + fi + NEXT_AS_FIRST_DIRECTIVE_CTYPE_H=$gl_next_as_first_directive + + + + + + + for gl_func in isblank; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + +printf "%s\n" "@%:@define GNULIB_DIRNAME 1" >>confdefs.h + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 +printf %s "checking whether // is distinct from /... " >&6; } +if test ${gl_cv_double_slash_root+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # . + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + gl_cv_double_slash_root='unknown, assuming no' ;; + esac + else + set x `ls -di / // 2>/dev/null` + if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 +printf "%s\n" "$gl_cv_double_slash_root" >&6; } + if test "$gl_cv_double_slash_root" = yes; then + +printf "%s\n" "@%:@define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h + + fi + + + + + + +printf "%s\n" "@%:@define HAVE_DUP2 1" >>confdefs.h + + + if test $HAVE_DUP2 = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5 +printf %s "checking whether dup2 works... " >&6; } +if test ${gl_cv_func_dup2_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + mingw*) # on this platform, dup2 always returns 0 for success + gl_cv_func_dup2_works="guessing no" ;; + cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 + gl_cv_func_dup2_works="guessing no" ;; + aix* | freebsd*) + # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE, + # not EBADF. + gl_cv_func_dup2_works="guessing no" ;; + haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. + gl_cv_func_dup2_works="guessing no" ;; + *-android*) # implemented using dup3(), which fails if oldfd == newfd + gl_cv_func_dup2_works="guessing no" ;; + os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd. + gl_cv_func_dup2_works="guessing no" ;; + *) gl_cv_func_dup2_works="guessing yes" ;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + #include + #include + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + +int +main (void) +{ +int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + #ifdef FD_CLOEXEC + if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) + result |= 1; + #endif + if (dup2 (1, 1) != 1) + result |= 2; + #ifdef FD_CLOEXEC + if (fcntl (1, F_GETFD) != FD_CLOEXEC) + result |= 4; + #endif + close (0); + if (dup2 (0, 0) != -1) + result |= 8; + /* Many gnulib modules require POSIX conformance of EBADF. */ + if (dup2 (2, bad_fd) == -1 && errno != EBADF) + result |= 16; + /* Flush out some cygwin core dumps. */ + if (dup2 (2, -1) != -1 || errno != EBADF) + result |= 32; + dup2 (2, 255); + dup2 (2, 256); + /* On OS/2 kLIBC, dup2() does not work on a directory fd. */ + { + int fd = open (".", O_RDONLY); + if (fd == -1) + result |= 64; + else if (dup2 (fd, fd + 1) == -1) + result |= 128; + + close (fd); + } + return result; + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_dup2_works=yes +else case e in @%:@( + e) gl_cv_func_dup2_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5 +printf "%s\n" "$gl_cv_func_dup2_works" >&6; } + case "$gl_cv_func_dup2_works" in + *yes) ;; + *) + REPLACE_DUP2=1 + ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize" +if test "x$ac_cv_func_setdtablesize" = xyes +then : + printf "%s\n" "@%:@define HAVE_SETDTABLESIZE 1" >>confdefs.h + +fi + + ;; + esac + fi + + + if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext" + + + fi + + + + + + GNULIB_DUP2=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_DUP2 1" >>confdefs.h + + + + + + + + + + GNULIB_ENVIRON=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_ENVIRON 1" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 +printf %s "checking for error_at_line... " >&6; } +if test ${ac_cv_lib_error_at_line+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +error_at_line (0, 0, "", 0, "an error occurred"); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_error_at_line=yes +else case e in @%:@( + e) ac_cv_lib_error_at_line=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 +printf "%s\n" "$ac_cv_lib_error_at_line" >&6; } + + if test $ac_cv_lib_error_at_line = no; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext" + + + + : + + fi + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error:3:c-format" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error_at_line:5:c-format" + + + + + + + + if test $ac_cv_func_fcntl = no; then + + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5 +printf %s "checking whether fcntl handles F_DUPFD correctly... " >&6; } +if test ${gl_cv_func_fcntl_f_dupfd_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case $host_os in + aix* | cygwin* | haiku*) + gl_cv_func_fcntl_f_dupfd_works="guessing no" ;; + *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + #include + #include + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + +int +main (void) +{ +int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + if (fcntl (0, F_DUPFD, -1) != -1) result |= 1; + if (errno != EINVAL) result |= 2; + if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4; + if (errno != EINVAL) result |= 8; + /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */ + { + int fd; + fd = open (".", O_RDONLY); + if (fd == -1) + result |= 16; + else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1) + result |= 32; + + close (fd); + } + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_fcntl_f_dupfd_works=yes +else case e in @%:@( + e) gl_cv_func_fcntl_f_dupfd_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5 +printf "%s\n" "$gl_cv_func_fcntl_f_dupfd_works" >&6; } + case $gl_cv_func_fcntl_f_dupfd_works in + *yes) ;; + *) + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + +printf "%s\n" "@%:@define FCNTL_DUPFD_BUGGY 1" >>confdefs.h + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5 +printf %s "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; } +if test ${gl_cv_func_fcntl_f_dupfd_cloexec+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifndef F_DUPFD_CLOEXEC +choke me +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __linux__ +/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace + it to support the semantics on older kernels that failed with EINVAL. */ +choke me +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_fcntl_f_dupfd_cloexec=yes +else case e in @%:@( + e) gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +else case e in @%:@( + e) gl_cv_func_fcntl_f_dupfd_cloexec=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5 +printf "%s\n" "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; } + if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then + + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + fi + fi + + + if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext" + + fi + + + + + + GNULIB_FCNTL=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_FCNTL 1" >>confdefs.h + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_fcntl_h='<'fcntl.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_fcntl_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'fcntl.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_fcntl_h + gl_cv_next_fcntl_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5 +printf "%s\n" "$gl_cv_next_fcntl_h" >&6; } + fi + NEXT_FCNTL_H=$gl_cv_next_fcntl_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'fcntl.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_fcntl_h + fi + NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive + + + + + + + + + + + for gl_func in fcntl openat; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + +printf "%s\n" "@%:@define GNULIB_FILENAMECAT 1" >>confdefs.h + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5 +printf %s "checking for flexible array member... " >&6; } +if test ${ac_cv_c_flexmember+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + struct m { struct m *next, **list; char name[]; }; + struct s { struct s *p; struct m *m; int n; double d[]; }; +int +main (void) +{ +int m = getchar (); + size_t nbytes = offsetof (struct s, d) + m * sizeof (double); + nbytes += sizeof (struct s) - 1; + nbytes -= nbytes % sizeof (struct s); + struct s *p = malloc (nbytes); + p->p = p; + p->m = NULL; + p->d[0] = 0.0; + return p->d != (double *) NULL; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_flexmember=yes +else case e in @%:@( + e) ac_cv_c_flexmember=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5 +printf "%s\n" "$ac_cv_c_flexmember" >&6; } + if test $ac_cv_c_flexmember = yes; then + +printf "%s\n" "@%:@define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h + + else + printf "%s\n" "@%:@define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h + + fi + + + + + FLOAT_H= + REPLACE_FLOAT_LDBL=0 + case "$host_os" in + aix* | beos* | openbsd* | mirbsd* | irix*) + FLOAT_H=float.h + ;; + freebsd*) + case "$host_cpu" in + i[34567]86 ) + FLOAT_H=float.h + ;; + x86_64 ) + # On x86_64 systems, the C compiler may still be generating + # 32-bit code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ || defined __x86_64__ || defined __amd64__ + yes + #endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + +else case e in @%:@( + e) FLOAT_H=float.h ;; +esac +fi +rm -rf conftest* + + ;; + esac + ;; + linux*) + case "$host_cpu" in + powerpc*) + FLOAT_H=float.h + ;; + esac + ;; + esac + case "$host_os" in + aix* | freebsd* | linux*) + if test -n "$FLOAT_H"; then + REPLACE_FLOAT_LDBL=1 + fi + ;; + esac + + REPLACE_ITOLD=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5 +printf %s "checking whether conversion from 'int' to 'long double' works... " >&6; } +if test ${gl_cv_func_itold_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + case "$host" in + sparc*-*-linux*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ || defined __arch64__ + yes + #endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_func_itold_works="guessing no" +else case e in @%:@( + e) gl_cv_func_itold_works="guessing yes" ;; +esac +fi +rm -rf conftest* + + ;; + *) gl_cv_func_itold_works="guessing yes" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int i = -1; +volatile long double ld; +int main () +{ + ld += i * 1.0L; + if (ld > 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_itold_works=yes +else case e in @%:@( + e) gl_cv_func_itold_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5 +printf "%s\n" "$gl_cv_func_itold_works" >&6; } + case "$gl_cv_func_itold_works" in + *no) + REPLACE_ITOLD=1 + FLOAT_H=float.h + ;; + esac + + if test -n "$FLOAT_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_float_h='<'float.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_float_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'float.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_float_h + gl_cv_next_float_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5 +printf "%s\n" "$gl_cv_next_float_h" >&6; } + fi + NEXT_FLOAT_H=$gl_cv_next_float_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'float.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_float_h + fi + NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive + + + + + fi + + if test -n "$FLOAT_H"; then + GL_GENERATE_FLOAT_H_TRUE= + GL_GENERATE_FLOAT_H_FALSE='#' +else + GL_GENERATE_FLOAT_H_TRUE='#' + GL_GENERATE_FLOAT_H_FALSE= +fi + + + + if test $REPLACE_FLOAT_LDBL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext" + + fi + if test $REPLACE_ITOLD = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext" + + fi + + + + + + FNMATCH_H= + gl_fnmatch_required_lowercase=` + echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]' + ` + gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5 +printf %s "checking for working $gl_fnmatch_required fnmatch... " >&6; } +if eval test \${$gl_fnmatch_cache_var+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test $gl_fnmatch_required = GNU; then + gl_fnmatch_gnu_start= + gl_fnmatch_gnu_end= + else + gl_fnmatch_gnu_start='#if 0' + gl_fnmatch_gnu_end='#endif' + fi + if test "$cross_compiling" = yes +then : + eval "$gl_fnmatch_cache_var=\"guessing no\"" +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + static int + y (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == 0; + } + static int + n (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == FNM_NOMATCH; + } + +int +main (void) +{ +char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]"; + char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]"; + static char const A_1[] = { 'A' - 1, 0 }; + static char const A01[] = { 'A' + 1, 0 }; + static char const a_1[] = { 'a' - 1, 0 }; + static char const a01[] = { 'a' + 1, 0 }; + static char const bs_1[] = { '\\\\' - 1, 0 }; + static char const bs01[] = { '\\\\' + 1, 0 }; + int result = 0; + if (!n ("a*", "", 0)) + return 1; + if (!y ("a*", "abc", 0)) + return 1; + if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */ + return 1; + if (!n ("d*/*1", "d/s/1", FNM_PATHNAME)) + return 2; + if (!y ("a\\\\bc", "abc", 0)) + return 3; + if (!n ("a\\\\bc", "abc", FNM_NOESCAPE)) + return 3; + if (!y ("*x", ".x", 0)) + return 4; + if (!n ("*x", ".x", FNM_PERIOD)) + return 4; + if (!y (Apat, "\\\\", 0)) + return 5; + if (!y (Apat, "A", 0)) + return 5; + if (!y (apat, "\\\\", 0)) + return 5; + if (!y (apat, "a", 0)) + return 5; + if (!(n (Apat, A_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, a_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, A01, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, a01, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, bs_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, bs_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(n (Apat, bs01, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, bs01, 0) == ('a' < '\\\\'))) + return 5; + $gl_fnmatch_gnu_start + if (!y ("xxXX", "xXxX", FNM_CASEFOLD)) + result |= 8; + if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)) + result |= 16; + if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME)) + result |= 32; + if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + $gl_fnmatch_gnu_end + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + eval "$gl_fnmatch_cache_var=yes" +else case e in @%:@( + e) eval "$gl_fnmatch_cache_var=no" ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +eval ac_res=\$$gl_fnmatch_cache_var + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\"" + if test "$gl_fnmatch_result" = yes; then + rm -f "$gl_source_base/fnmatch.h" + else + FNMATCH_H=fnmatch.h + fi + + if test -n "$FNMATCH_H"; then + GL_GENERATE_FNMATCH_H_TRUE= + GL_GENERATE_FNMATCH_H_FALSE='#' +else + GL_GENERATE_FNMATCH_H_TRUE='#' + GL_GENERATE_FNMATCH_H_FALSE= +fi + + + if test -n "$FNMATCH_H"; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" + + + +printf "%s\n" "@%:@define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch" >>confdefs.h + + + ac_fn_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_isblank" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h + + + + + fi + + + + + + if test -n "$FNMATCH_H"; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" + + + +printf "%s\n" "@%:@define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch" >>confdefs.h + + + ac_fn_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_isblank" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h + + + + + fi + + + + case "$host_os" in + mingw* | pw* | os2*) + REPLACE_FREOPEN=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether freopen works on closed fds" >&5 +printf %s "checking whether freopen works on closed fds... " >&6; } +if test ${gl_cv_func_freopen_works_on_closed+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case $host_os in + *gnu*) gl_cv_func_freopen_works_on_closed="guessing no" ;; + *) gl_cv_func_freopen_works_on_closed="guessing yes";; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +close (0); + return !(freopen ("/dev/null", "r", stdin) + && getchar () == EOF + && !ferror (stdin) && feof (stdin)); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_freopen_works_on_closed=yes +else case e in @%:@( + e) gl_cv_func_freopen_works_on_closed=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_freopen_works_on_closed" >&5 +printf "%s\n" "$gl_cv_func_freopen_works_on_closed" >&6; } + case $gl_cv_func_freopen_works_on_closed in + *no) REPLACE_FREOPEN=1;; + esac + esac + + if test $REPLACE_FREOPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS freopen.$ac_objext" + + : + fi + + + + + + GNULIB_FREOPEN=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_FREOPEN 1" >>confdefs.h + + + + + +printf "%s\n" "@%:@define GNULIB_FREOPEN_SAFER 1" >>confdefs.h + + + + + + + case "$host_os" in + mingw*) + REPLACE_FSTAT=1 + ;; + esac + + + + if test $REPLACE_FSTAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" + + + + : + + fi + + + + + + GNULIB_FSTAT=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_FSTAT 1" >>confdefs.h + + + + + + + + + if test $ac_cv_func_getdtablesize = yes && + test $ac_cv_have_decl_getdtablesize = yes; then + # Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft limit + # up to an unchangeable hard limit; all other platforms correctly + # require setrlimit before getdtablesize() can report a larger value. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5 +printf %s "checking whether getdtablesize works... " >&6; } +if test ${gl_cv_func_getdtablesize_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows + gl_cv_func_getdtablesize_works="guessing no" ;; + *) gl_cv_func_getdtablesize_works="guessing yes" ;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int size = getdtablesize(); + if (dup2 (0, getdtablesize()) != -1) + return 1; + if (size != getdtablesize()) + return 2; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getdtablesize_works=yes +else case e in @%:@( + e) gl_cv_func_getdtablesize_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5 +printf "%s\n" "$gl_cv_func_getdtablesize_works" >&6; } + case "$gl_cv_func_getdtablesize_works" in + *yes) ;; + *) REPLACE_GETDTABLESIZE=1 ;; + esac + else + HAVE_GETDTABLESIZE=0 + fi + + if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext" + + : + fi + + + + + + GNULIB_GETDTABLESIZE=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h + + + + + + + + + + + + + REPLACE_GETOPT=0 + if test -n "$gl_replace_getopt"; then + REPLACE_GETOPT=1 + fi + + if test $REPLACE_GETOPT = 1; then + + + if test $ac_cv_header_sys_cdefs_h = yes; then + HAVE_SYS_CDEFS_H=1 + else + HAVE_SYS_CDEFS_H=0 + fi + + + +printf "%s\n" "@%:@define __GETOPT_PREFIX rpl_" >>confdefs.h + + GETOPT_H=getopt.h + GETOPT_CDEFS_H=getopt-cdefs.h + + + + fi + + if test $REPLACE_GETOPT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" + + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + + + + + ac_found=0 + ac_fn_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_program_invocation_name" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + ac_found=1 +fi + + ac_fn_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + ac_found=1 +fi + + ac_fn_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl___argv" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL___ARGV $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + ac_found=1 +fi + + + # Incur the cost of this test only if none of the above worked. + if test $ac_found = 0; then + # On OpenBSD 5.1, using the global __progname variable appears to be + # the only way to implement getprogname. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5 +printf %s "checking whether __progname is defined in default libraries... " >&6; } +if test ${gl_cv_var___progname+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_cv_var___progname= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char *__progname; +int +main (void) +{ +return *__progname; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_var___progname=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5 +printf "%s\n" "$gl_cv_var___progname" >&6; } + if test "$gl_cv_var___progname" = yes; then + +printf "%s\n" "@%:@define HAVE_VAR___PROGNAME 1" >>confdefs.h + + fi + fi + + + + + + + + + + + + + + + + gl_gettimeofday_timezone=void + if test $ac_cv_func_gettimeofday != yes; then + HAVE_GETTIMEOFDAY=0 + else + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5 +printf %s "checking whether gettimeofday clobbers localtime buffer... " >&6; } +if test ${gl_cv_func_gettimeofday_clobber+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + # When cross-compiling: + case "$host_os" in + # Guess all is fine on glibc systems. + *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_gettimeofday_clobber="guessing yes" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + #include + +int +main (void) +{ + + time_t t = 0; + struct tm *lt; + struct tm saved_lt; + struct timeval tv; + lt = localtime (&t); + saved_lt = *lt; + gettimeofday (&tv, NULL); + return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_gettimeofday_clobber=no +else case e in @%:@( + e) gl_cv_func_gettimeofday_clobber=yes ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5 +printf "%s\n" "$gl_cv_func_gettimeofday_clobber" >&6; } + + case "$gl_cv_func_gettimeofday_clobber" in + *yes) + REPLACE_GETTIMEOFDAY=1 + +printf "%s\n" "@%:@define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h + + + + + NEED_LOCALTIME_BUFFER=1 + REPLACE_GMTIME=1 + REPLACE_LOCALTIME=1 + + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5 +printf %s "checking for gettimeofday with POSIX signature... " >&6; } +if test ${gl_cv_func_gettimeofday_posix_signature+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + struct timeval c; + int gettimeofday (struct timeval *restrict, void *restrict); + +int +main (void) +{ +/* glibc uses struct timezone * rather than the POSIX void * + if _GNU_SOURCE is defined. However, since the only portable + use of gettimeofday uses NULL as the second parameter, and + since the glibc definition is actually more typesafe, it is + not worth wrapping this to get a compliant signature. */ + int (*f) (struct timeval *restrict, void *restrict) + = gettimeofday; + int x = f (&c, 0); + return !(x | c.tv_sec | c.tv_usec); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_gettimeofday_posix_signature=yes +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int gettimeofday (struct timeval *restrict, struct timezone *restrict); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_gettimeofday_posix_signature=almost +else case e in @%:@( + e) gl_cv_func_gettimeofday_posix_signature=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_gettimeofday_posix_signature" >&6; } + if test $gl_cv_func_gettimeofday_posix_signature = almost; then + gl_gettimeofday_timezone='struct timezone' + elif test $gl_cv_func_gettimeofday_posix_signature != yes; then + REPLACE_GETTIMEOFDAY=1 + fi + if test $REPLACE_STRUCT_TIMEVAL = 1; then + REPLACE_GETTIMEOFDAY=1 + fi + case "$host_os" in + mingw*) REPLACE_GETTIMEOFDAY=1 ;; + esac + fi + +printf "%s\n" "@%:@define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone" >>confdefs.h + + + if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" + + : + fi + + + + + + GNULIB_GETTIMEOFDAY=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h + + + + + if ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then + GNU_MAKE_TRUE= + GNU_MAKE_FALSE='#' +else + GNU_MAKE_TRUE='#' + GNU_MAKE_FALSE= +fi + + + # Autoconf 2.61a.99 and earlier don't support linking a file only + # in VPATH builds. But since GNUmakefile is for maintainer use + # only, it does not matter if we skip the link with older autoconf. + # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH + # builds, so use a shell variable to bypass this. + GNUmakefile=GNUmakefile + ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile" + + + : + + + + + + + + GNULIB_ICONV=1 + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_iconv_h='<'iconv.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_iconv_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_iconv_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'iconv.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_iconv_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_iconv_h + gl_cv_next_iconv_h='"'$gl_header'"' + else + gl_cv_next_iconv_h='<'iconv.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_iconv_h" >&5 +printf "%s\n" "$gl_cv_next_iconv_h" >&6; } + fi + NEXT_ICONV_H=$gl_cv_next_iconv_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'iconv.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_iconv_h + fi + NEXT_AS_FIRST_DIRECTIVE_ICONV_H=$gl_next_as_first_directive + + + + + + + + + + if test "$am_cv_func_iconv" = yes; then + + + ICONV_H='iconv.h' + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__) + gnu_iconv + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "gnu_iconv" >/dev/null 2>&1 +then : + gl_func_iconv_gnu=yes +else case e in @%:@( + e) gl_func_iconv_gnu=no ;; +esac +fi +rm -rf conftest* + + if test $gl_func_iconv_gnu = no; then + iconv_flavor= + case "$host_os" in + aix*) iconv_flavor=ICONV_FLAVOR_AIX ;; + irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;; + hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;; + osf*) iconv_flavor=ICONV_FLAVOR_OSF ;; + solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;; + esac + if test -n "$iconv_flavor"; then + +printf "%s\n" "@%:@define ICONV_FLAVOR $iconv_flavor" >>confdefs.h + + + + + ICONV_H='iconv.h' + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + + + REPLACE_ICONV_OPEN=1 + + fi + fi + + fi + + if test $REPLACE_ICONV_OPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv_open.$ac_objext" + + fi + if test $REPLACE_ICONV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv_close.$ac_objext" + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler generally respects inline" >&5 +printf %s "checking whether the compiler generally respects inline... " >&6; } +if test ${gl_cv_c_inline_effective+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test $ac_cv_c_inline = no; then + gl_cv_c_inline_effective=no + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifdef __NO_INLINE__ + #error "inline is not effective" + #endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_c_inline_effective=yes +else case e in @%:@( + e) gl_cv_c_inline_effective=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_inline_effective" >&5 +printf "%s\n" "$gl_cv_c_inline_effective" >&6; } + if test $gl_cv_c_inline_effective = yes; then + +printf "%s\n" "@%:@define HAVE_INLINE 1" >>confdefs.h + + fi + + + + + : + + : + : + : + : + + + + + + + PRIPTR_PREFIX= + if test -n "$STDINT_H"; then + PRIPTR_PREFIX='"l"' + else + for glpfx in '' l ll I64; do + case $glpfx in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + I64) gltype1='__int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + extern intptr_t foo; + extern $gltype1 foo; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + PRIPTR_PREFIX='"'$glpfx'"' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test -n "$PRIPTR_PREFIX" && break + done + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5 +printf %s "checking whether INT32_MAX < INTMAX_MAX... " >&6; } +if test ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include + #if HAVE_STDINT_H + #include + #endif + + #if defined INT32_MAX && defined INTMAX_MAX + #define CONDITION (INT32_MAX < INTMAX_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (int) < sizeof (long long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes +else case e in @%:@( + e) gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5 +printf "%s\n" "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; } + if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then + INT32_MAX_LT_INTMAX_MAX=1; + else + INT32_MAX_LT_INTMAX_MAX=0; + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5 +printf %s "checking whether INT64_MAX == LONG_MAX... " >&6; } +if test ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include + #if HAVE_STDINT_H + #include + #endif + + #if defined INT64_MAX + #define CONDITION (INT64_MAX == LONG_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (long long int) == sizeof (long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes +else case e in @%:@( + e) gl_cv_test_INT64_MAX_EQ_LONG_MAX=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5 +printf "%s\n" "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; } + if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then + INT64_MAX_EQ_LONG_MAX=1; + else + INT64_MAX_EQ_LONG_MAX=0; + fi + + + else + INT64_MAX_EQ_LONG_MAX=-1 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5 +printf %s "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; } +if test ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include + #if HAVE_STDINT_H + #include + #endif + + #if defined UINT32_MAX && defined UINTMAX_MAX + #define CONDITION (UINT32_MAX < UINTMAX_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes +else case e in @%:@( + e) gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5 +printf "%s\n" "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; } + if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then + UINT32_MAX_LT_UINTMAX_MAX=1; + else + UINT32_MAX_LT_UINTMAX_MAX=0; + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5 +printf %s "checking whether UINT64_MAX == ULONG_MAX... " >&6; } +if test ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include + #if HAVE_STDINT_H + #include + #endif + + #if defined UINT64_MAX + #define CONDITION (UINT64_MAX == ULONG_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes +else case e in @%:@( + e) gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5 +printf "%s\n" "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; } + if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then + UINT64_MAX_EQ_ULONG_MAX=1; + else + UINT64_MAX_EQ_ULONG_MAX=0; + fi + + + else + UINT64_MAX_EQ_ULONG_MAX=-1 + fi + + + + + + + + + if test $ac_cv_func_isblank = no; then + HAVE_ISBLANK=0 + fi + + if test $HAVE_ISBLANK = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS isblank.$ac_objext" + + fi + + + + + + GNULIB_ISBLANK=1 + + + + + + + + + + ac_fn_check_decl "$LINENO" "iswblank" "ac_cv_have_decl_iswblank" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_iswblank" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_ISWBLANK $ac_have_decl" >>confdefs.h + + if test $ac_cv_func_iswblank = no; then + HAVE_ISWBLANK=0 + if test $ac_cv_have_decl_iswblank = yes; then + REPLACE_ISWBLANK=1 + fi + fi + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + : + fi + fi + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iswblank.$ac_objext" + + fi + fi + + + + + + GNULIB_ISWBLANK=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_ISWBLANK 1" >>confdefs.h + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_langinfo_h='<'langinfo.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_langinfo_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_langinfo_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'langinfo.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_langinfo_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_langinfo_h + gl_cv_next_langinfo_h='"'$gl_header'"' + else + gl_cv_next_langinfo_h='<'langinfo.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_langinfo_h" >&5 +printf "%s\n" "$gl_cv_next_langinfo_h" >&6; } + fi + NEXT_LANGINFO_H=$gl_cv_next_langinfo_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'langinfo.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_langinfo_h + fi + NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H=$gl_next_as_first_directive + + + + + + HAVE_LANGINFO_CODESET=0 + HAVE_LANGINFO_T_FMT_AMPM=0 + HAVE_LANGINFO_ERA=0 + HAVE_LANGINFO_YESEXPR=0 + + if test $ac_cv_header_langinfo_h = yes; then + HAVE_LANGINFO_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines CODESET" >&5 +printf %s "checking whether langinfo.h defines CODESET... " >&6; } +if test ${gl_cv_header_langinfo_codeset+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int a = CODESET; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_codeset=yes +else case e in @%:@( + e) gl_cv_header_langinfo_codeset=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_codeset" >&5 +printf "%s\n" "$gl_cv_header_langinfo_codeset" >&6; } + if test $gl_cv_header_langinfo_codeset = yes; then + HAVE_LANGINFO_CODESET=1 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines T_FMT_AMPM" >&5 +printf %s "checking whether langinfo.h defines T_FMT_AMPM... " >&6; } +if test ${gl_cv_header_langinfo_t_fmt_ampm+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int a = T_FMT_AMPM; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_t_fmt_ampm=yes +else case e in @%:@( + e) gl_cv_header_langinfo_t_fmt_ampm=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_t_fmt_ampm" >&5 +printf "%s\n" "$gl_cv_header_langinfo_t_fmt_ampm" >&6; } + if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then + HAVE_LANGINFO_T_FMT_AMPM=1 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ERA" >&5 +printf %s "checking whether langinfo.h defines ERA... " >&6; } +if test ${gl_cv_header_langinfo_era+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int a = ERA; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_era=yes +else case e in @%:@( + e) gl_cv_header_langinfo_era=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_era" >&5 +printf "%s\n" "$gl_cv_header_langinfo_era" >&6; } + if test $gl_cv_header_langinfo_era = yes; then + HAVE_LANGINFO_ERA=1 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines YESEXPR" >&5 +printf %s "checking whether langinfo.h defines YESEXPR... " >&6; } +if test ${gl_cv_header_langinfo_yesexpr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int a = YESEXPR; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_yesexpr=yes +else case e in @%:@( + e) gl_cv_header_langinfo_yesexpr=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_yesexpr" >&5 +printf "%s\n" "$gl_cv_header_langinfo_yesexpr" >&6; } + if test $gl_cv_header_langinfo_yesexpr = yes; then + HAVE_LANGINFO_YESEXPR=1 + fi + else + HAVE_LANGINFO_H=0 + fi + + + + + + + + for gl_func in nl_langinfo; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +@%:@ Check whether --with-libsigsegv-prefix was given. +if test ${with_libsigsegv_prefix+y} +then : + withval=$with_libsigsegv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBSIGSEGV= + LTLIBSIGSEGV= + INCSIGSEGV= + LIBSIGSEGV_PREFIX= + HAVE_LIBSIGSEGV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='sigsegv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_a" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCSIGSEGV="${INCSIGSEGV}${INCSIGSEGV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$dep" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$dep" + ;; + esac + done + fi + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-R$found_dir" + done + fi + + + + + + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCSIGSEGV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsigsegv" >&5 +printf %s "checking for libsigsegv... " >&6; } +if test ${ac_cv_libsigsegv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + ac_save_LIBS="$LIBS" + case " $LIBSIGSEGV" in + *" -l"*) LIBS="$LIBS $LIBSIGSEGV" ;; + *) LIBS="$LIBSIGSEGV $LIBS" ;; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +sigsegv_deinstall_handler(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libsigsegv=yes +else case e in @%:@( + e) ac_cv_libsigsegv='no, consider installing GNU libsigsegv' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libsigsegv" >&5 +printf "%s\n" "$ac_cv_libsigsegv" >&6; } + if test "$ac_cv_libsigsegv" = yes; then + HAVE_LIBSIGSEGV=yes + +printf "%s\n" "@%:@define HAVE_LIBSIGSEGV 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libsigsegv" >&5 +printf %s "checking how to link with libsigsegv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBSIGSEGV" >&5 +printf "%s\n" "$LIBSIGSEGV" >&6; } + else + HAVE_LIBSIGSEGV=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBSIGSEGV= + LTLIBSIGSEGV= + LIBSIGSEGV_PREFIX= + fi + + + + + + + + gl_cv_lib_sigsegv="$ac_cv_libsigsegv" + + + + + + + + + + + LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" + + + + + + + + + + case "$host_os" in + solaris*) + +printf "%s\n" "@%:@define _LCONV_C99 1" >>confdefs.h + + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5 +printf %s "checking whether locale.h conforms to POSIX:2001... " >&6; } +if test ${gl_cv_header_locale_h_posix2001+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int x = LC_MESSAGES; + int y = sizeof (((struct lconv *) 0)->decimal_point); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_locale_h_posix2001=yes +else case e in @%:@( + e) gl_cv_header_locale_h_posix2001=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5 +printf "%s\n" "$gl_cv_header_locale_h_posix2001" >&6; } + + + if test $ac_cv_header_xlocale_h = yes; then + HAVE_XLOCALE_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5 +printf %s "checking whether locale.h defines locale_t... " >&6; } +if test ${gl_cv_header_locale_has_locale_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + locale_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_locale_has_locale_t=yes +else case e in @%:@( + e) gl_cv_header_locale_has_locale_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5 +printf "%s\n" "$gl_cv_header_locale_has_locale_t" >&6; } + if test $gl_cv_header_locale_has_locale_t = yes; then + gl_cv_header_locale_h_needs_xlocale_h=no + else + gl_cv_header_locale_h_needs_xlocale_h=yes + fi + else + HAVE_XLOCALE_H=0 + gl_cv_header_locale_h_needs_xlocale_h=no + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5 +printf %s "checking whether struct lconv is properly defined... " >&6; } +if test ${gl_cv_sys_struct_lconv_ok+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + struct lconv l; + int x = sizeof (l.decimal_point); + int y = sizeof (l.int_p_cs_precedes); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_lconv_ok=yes +else case e in @%:@( + e) gl_cv_sys_struct_lconv_ok=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5 +printf "%s\n" "$gl_cv_sys_struct_lconv_ok" >&6; } + if test $gl_cv_sys_struct_lconv_ok = no; then + REPLACE_STRUCT_LCONV=1 + fi + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_locale_h='<'locale.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_locale_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'locale.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_locale_h + gl_cv_next_locale_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5 +printf "%s\n" "$gl_cv_next_locale_h" >&6; } + fi + NEXT_LOCALE_H=$gl_cv_next_locale_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'locale.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_locale_h + fi + NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive + + + + + + + for gl_func in setlocale duplocale; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +/* Some systems provide declarations in a non-standard header. */ +#if HAVE_XLOCALE_H +# include +#endif + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + if test $REPLACE_STRUCT_LCONV = 1; then + REPLACE_LOCALECONV=1 + fi + + if test $REPLACE_LOCALECONV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS localeconv.$ac_objext" + + + ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include +" +if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_LCONV_DECIMAL_POINT 1" >>confdefs.h + + +fi + + + fi + + + + + + GNULIB_LOCALECONV=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_LOCALECONV 1" >>confdefs.h + + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS localtime-buffer.$ac_objext" + + + + + if test $ac_cv_func_lstat = yes; then + + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *no) + REPLACE_LSTAT=1 + ;; + esac + else + HAVE_LSTAT=0 + fi + + if test $REPLACE_LSTAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext" + + : + fi + + + + + + GNULIB_LSTAT=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_LSTAT 1" >>confdefs.h + + + + + + + + + if test $gl_cv_func_malloc_posix = yes; then + +printf "%s\n" "@%:@define HAVE_MALLOC_POSIX 1" >>confdefs.h + + else + REPLACE_MALLOC=1 + fi + + if test $REPLACE_MALLOC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" + + fi + + + + + + GNULIB_MALLOC_POSIX=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h + + + + + + + + + + + + + : + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_incomplete_state=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_sanitycheck=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_mbrtowc = no; then + HAVE_MBRTOWC=0 + ac_fn_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_mbrtowc" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_MBRTOWC $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_mbrtowc = yes; then + REPLACE_MBRTOWC=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBRTOWC=1 + else + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5 +printf %s "checking whether mbrtowc handles a NULL pwc argument... " >&6; } +if test ${gl_cv_func_mbrtowc_null_arg1+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris. + solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + int result = 0; + + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "\303\237er"; + mbstate_t state; + wchar_t wc; + size_t ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 5, &state); + if (ret != 2) + result |= 1; + if (!mbsinit (&state)) + result |= 2; + + memset (&state, '\0', sizeof (mbstate_t)); + ret = mbrtowc (NULL, input, 5, &state); + if (ret != 2) /* Solaris 7 fails here: ret is -1. */ + result |= 4; + if (!mbsinit (&state)) + result |= 8; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_null_arg1=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_null_arg1=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_null_arg1" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5 +printf %s "checking whether mbrtowc handles a NULL string argument... " >&6; } +if test ${gl_cv_func_mbrtowc_null_arg2+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on OSF/1. + osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + mbstate_t state; + wchar_t wc; + int ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + mbrtowc (&wc, NULL, 5, &state); + /* Check that wc was not modified. */ + if (wc != (wchar_t) 0xBADFACE) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_null_arg2=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_null_arg2=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_null_arg2" >&6; } + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5 +printf %s "checking whether mbrtowc has a correct return value... " >&6; } +if test ${gl_cv_func_mbrtowc_retval+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on HP-UX, Solaris, native Windows. + hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_retval="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \ + || { case "$host_os" in mingw*) true;; *) false;; esac; }; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + int result = 0; + int found_some_locale = 0; + /* This fails on Solaris. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "B\303\274\303\237er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 1) + result |= 1; + } + found_some_locale = 1; + } + /* This fails on HP-UX 11.11. */ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 2) + result |= 2; + } + found_some_locale = 1; + } + /* This fails on native Windows. */ + if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) + { + char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 4; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) + { + char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 8; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_China.936") != NULL) + { + char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 16; + } + found_some_locale = 1; + } + return (found_some_locale ? result : 77); +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_retval=yes +else case e in @%:@( + e) if test $? != 77; then + gl_cv_func_mbrtowc_retval=no + fi + ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_retval" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5 +printf %s "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; } +if test ${gl_cv_func_mbrtowc_nul_retval+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris 8 and 9. + solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + /* This fails on Solaris 8 and 9. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, "", 1, &state) != 0) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_nul_retval=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_nul_retval=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_nul_retval" >&6; } + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5 +printf %s "checking whether mbrtowc works on empty input... " >&6; } +if test ${gl_cv_func_mbrtowc_empty_input+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on AIX and glibc systems. + aix* | *-gnu*) + gl_cv_func_mbrtowc_empty_input="guessing no" ;; + *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; + esac + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + static wchar_t wc; + static mbstate_t mbs; + int + main (void) + { + return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2; + } +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_empty_input=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_empty_input=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_empty_input" >&6; } + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5 +printf %s "checking whether the C locale is free of encoding errors... " >&6; } +if test ${gl_cv_C_locale_sans_EILSEQ+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_cv_C_locale_sans_EILSEQ="guessing no" + + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + +int +main (void) +{ + + int i; + char *locale = setlocale (LC_ALL, "C"); + if (! locale) + return 2; + for (i = CHAR_MIN; i <= CHAR_MAX; i++) + { + char c = i; + wchar_t wc; + mbstate_t mbs = { 0, }; + size_t ss = mbrtowc (&wc, &c, 1, &mbs); + if (1 < ss) + return 3; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_C_locale_sans_EILSEQ=yes +else case e in @%:@( + e) gl_cv_C_locale_sans_EILSEQ=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_C_locale_sans_EILSEQ" >&5 +printf "%s\n" "$gl_cv_C_locale_sans_EILSEQ" >&6; } + + case "$gl_cv_func_mbrtowc_null_arg1" in + *yes) ;; + *) +printf "%s\n" "@%:@define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_null_arg2" in + *yes) ;; + *) +printf "%s\n" "@%:@define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_retval" in + *yes) ;; + *) +printf "%s\n" "@%:@define MBRTOWC_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_nul_retval" in + *yes) ;; + *) +printf "%s\n" "@%:@define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_empty_input" in + *yes) ;; + *) +printf "%s\n" "@%:@define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case $gl_cv_C_locale_sans_EILSEQ in + *yes) ;; + *) +printf "%s\n" "@%:@define C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + fi + fi + + if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBRTOWC=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBRTOWC 1" >>confdefs.h + + + + + + + + + GNULIB_MBSCASECMP=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBSCASECMP 1" >>confdefs.h + + + + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_incomplete_state=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_sanitycheck=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_mbsinit = no; then + HAVE_MBSINIT=0 + ac_fn_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_mbsinit" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_MBSINIT $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_mbsinit = yes; then + REPLACE_MBSINIT=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSINIT=1 + else + case "$host_os" in + mingw*) REPLACE_MBSINIT=1 ;; + esac + fi + fi + + if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBSINIT=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBSINIT 1" >>confdefs.h + + + + + + + if test $ac_cv_func_mbslen = yes; then + HAVE_MBSLEN=1 + else + HAVE_MBSLEN=0 + fi + + + + + + + GNULIB_MBSLEN=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBSLEN 1" >>confdefs.h + + + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_incomplete_state=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_sanitycheck=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_mbsrtowcs = no; then + HAVE_MBSRTOWCS=0 + ac_fn_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_mbsrtowcs" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_MBSRTOWCS $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_mbsrtowcs = yes; then + REPLACE_MBSRTOWCS=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSRTOWCS=1 + else + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5 +printf %s "checking whether mbsrtowcs works... " >&6; } +if test ${gl_cv_func_mbsrtowcs_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on HP-UX, Solaris, mingw. + hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbsrtowcs_works="guessing yes" ;; + esac + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + int result = 0; + /* Test whether the function supports a NULL destination argument. + This fails on native Windows. */ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + const char input[] = "\337er"; + const char *src = input; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbsrtowcs (NULL, &src, 1, &state) != 3 + || src != input) + result |= 1; + } + /* Test whether the function works when started with a conversion state + in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + const char input[] = "B\303\274\303\237er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + result |= 2; + } + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "<\306\374\313\334\270\354>"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 4; + if (mbsrtowcs (NULL, &src, 10, &state) != 3) + result |= 4; + } + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + const char input[] = "B\250\271\201\060\211\070er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + result |= 8; + } + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbsrtowcs_works=yes +else case e in @%:@( + e) gl_cv_func_mbsrtowcs_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5 +printf "%s\n" "$gl_cv_func_mbsrtowcs_works" >&6; } + + case "$gl_cv_func_mbsrtowcs_works" in + *yes) ;; + *) REPLACE_MBSRTOWCS=1 ;; + esac + fi + fi + + if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBSRTOWCS=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h + + + + + + + + + GNULIB_MBSSTR=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBSSTR 1" >>confdefs.h + + + + + + + if false; then + REPLACE_MBTOWC=1 + fi + + if test $REPLACE_MBTOWC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbtowc.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBTOWC=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBTOWC 1" >>confdefs.h + + + + + + : + + + if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext" + + + ac_fn_c_check_header_compile "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default" +if test "x$ac_cv_header_bp_sym_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_BP_SYM_H 1" >>confdefs.h + +fi + + + fi + + + + + + GNULIB_MEMCHR=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MEMCHR 1" >>confdefs.h + + + + + + + + + + + if test $ac_cv_func_mkstemp = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working mkstemp" >&5 +printf %s "checking for working mkstemp... " >&6; } +if test ${gl_cv_func_working_mkstemp+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + mkdir conftest.mkstemp + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_working_mkstemp="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_mkstemp="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ +int result = 0; + int i; + off_t large = (off_t) 4294967295u; + if (large < 0) + large = 2147483647; + umask (0); + for (i = 0; i < 70; i++) + { + char templ[] = "conftest.mkstemp/coXXXXXX"; + int (*mkstemp_function) (char *) = mkstemp; + int fd = mkstemp_function (templ); + if (fd < 0) + result |= 1; + else + { + struct stat st; + if (lseek (fd, large, SEEK_SET) != large) + result |= 2; + if (fstat (fd, &st) < 0) + result |= 4; + else if (st.st_mode & 0077) + result |= 8; + if (close (fd)) + result |= 16; + } + } + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_working_mkstemp=yes +else case e in @%:@( + e) gl_cv_func_working_mkstemp=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -rf conftest.mkstemp + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mkstemp" >&5 +printf "%s\n" "$gl_cv_func_working_mkstemp" >&6; } + case "$gl_cv_func_working_mkstemp" in + *yes) ;; + *) + REPLACE_MKSTEMP=1 + ;; + esac + else + HAVE_MKSTEMP=0 + fi + + if test $HAVE_MKSTEMP = 0 || test $REPLACE_MKSTEMP = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mkstemp.$ac_objext" + + + + fi + + + + + + GNULIB_MKSTEMP=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MKSTEMP 1" >>confdefs.h + + + + + + + + + REPLACE_MKTIME=0 + if test "$gl_cv_func_working_mktime" != yes; then + REPLACE_MKTIME=1 + +printf "%s\n" "@%:@define NEED_MKTIME_WORKING 1" >>confdefs.h + + fi + case "$host_os" in + mingw*) + REPLACE_MKTIME=1 + +printf "%s\n" "@%:@define NEED_MKTIME_WINDOWS 1" >>confdefs.h + + ;; + esac + + if test $REPLACE_MKTIME = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext" + + : + fi + + + + + + GNULIB_MKTIME=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MKTIME 1" >>confdefs.h + + + + + + + WANT_MKTIME_INTERNAL=0 + ac_fn_c_check_func "$LINENO" "__mktime_internal" "ac_cv_func___mktime_internal" +if test "x$ac_cv_func___mktime_internal" = xyes +then : + +printf "%s\n" "@%:@define mktime_internal __mktime_internal" >>confdefs.h + + +else case e in @%:@( + e) WANT_MKTIME_INTERNAL=1 + +printf "%s\n" "@%:@define NEED_MKTIME_INTERNAL 1" >>confdefs.h + + ;; +esac +fi + + + if test $WANT_MKTIME_INTERNAL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext" + + : + fi + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext" + + fi + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext" + + fi + + +printf "%s\n" "@%:@define GNULIB_MSVC_NOTHROW 1" >>confdefs.h + + + + + + + + if test $ac_cv_func_nl_langinfo = yes; then + # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether YESEXPR works" >&5 +printf %s "checking whether YESEXPR works... " >&6; } +if test ${gl_cv_func_nl_langinfo_yesexpr_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on irix systems. + irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";; + # Guess yes elsewhere. + *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +return !*nl_langinfo(YESEXPR); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_nl_langinfo_yesexpr_works=yes +else case e in @%:@( + e) gl_cv_func_nl_langinfo_yesexpr_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nl_langinfo_yesexpr_works" >&5 +printf "%s\n" "$gl_cv_func_nl_langinfo_yesexpr_works" >&6; } + case $gl_cv_func_nl_langinfo_yesexpr_works in + *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;; + *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;; + esac + +printf "%s\n" "@%:@define FUNC_NL_LANGINFO_YESEXPR_WORKS $FUNC_NL_LANGINFO_YESEXPR_WORKS" >>confdefs.h + + if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \ + && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then + : + else + REPLACE_NL_LANGINFO=1 + +printf "%s\n" "@%:@define REPLACE_NL_LANGINFO 1" >>confdefs.h + + fi + else + HAVE_NL_LANGINFO=0 + fi + + if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS nl_langinfo.$ac_objext" + + fi + + + + + + GNULIB_NL_LANGINFO=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_NL_LANGINFO 1" >>confdefs.h + + + + + + case "$host_os" in + mingw* | pw*) + REPLACE_OPEN=1 + ;; + *) + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5 +printf %s "checking whether open recognizes a trailing slash... " >&6; } +if test ${gl_cv_func_open_slash+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + touch conftest.tmp + ln -s conftest.tmp conftest.lnk + fi + if test "$cross_compiling" = yes +then : + + case "$host_os" in + freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*) + gl_cv_func_open_slash="guessing no" ;; + *) + gl_cv_func_open_slash="guessing yes" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_UNISTD_H +# include +#endif +int main () +{ + int result = 0; +#if HAVE_LSTAT + if (open ("conftest.lnk/", O_RDONLY) != -1) + result |= 1; +#endif + if (open ("conftest.sl/", O_CREAT, 0600) >= 0) + result |= 2; + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_open_slash=yes +else case e in @%:@( + e) gl_cv_func_open_slash=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.sl conftest.tmp conftest.lnk + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5 +printf "%s\n" "$gl_cv_func_open_slash" >&6; } + case "$gl_cv_func_open_slash" in + *no) + +printf "%s\n" "@%:@define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h + + REPLACE_OPEN=1 + ;; + esac + ;; + esac + + + + if test $REPLACE_OPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext" + + + + : + + fi + + + + + + GNULIB_OPEN=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_OPEN 1" >>confdefs.h + + + + + + + ac_fn_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_program_invocation_name" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl" >>confdefs.h + + ac_fn_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl" >>confdefs.h + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"'" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"'" + + + : + + + : + + + + + ac_fn_c_check_func "$LINENO" "raise" "ac_cv_func_raise" +if test "x$ac_cv_func_raise" = xyes +then : + printf "%s\n" "@%:@define HAVE_RAISE 1" >>confdefs.h + +fi + + if test $ac_cv_func_raise = no; then + HAVE_RAISE=0 + else + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_RAISE=1 + fi + + + + + + if test $gl_cv_type_sigset_t = yes; then + ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" +if test "x$ac_cv_func_sigprocmask" = xyes +then : + gl_cv_func_sigprocmask=1 +fi + + fi + if test -z "$gl_cv_func_sigprocmask"; then + HAVE_POSIX_SIGNALBLOCKING=0 + fi + + if test $HAVE_POSIX_SIGNALBLOCKING = 0; then + : + fi + + fi + + if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS raise.$ac_objext" + + : + fi + + + + + + GNULIB_RAISE=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_RAISE 1" >>confdefs.h + + + + + + + + ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr" +if test "x$ac_cv_func_rawmemchr" = xyes +then : + printf "%s\n" "@%:@define HAVE_RAWMEMCHR 1" >>confdefs.h + +fi + + if test $ac_cv_func_rawmemchr = no; then + HAVE_RAWMEMCHR=0 + fi + + if test $HAVE_RAWMEMCHR = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext" + + : + fi + + + + + + GNULIB_RAWMEMCHR=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h + + + + + + + if test $ac_cv_func_readlink = no; then + HAVE_READLINK=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5 +printf %s "checking whether readlink signature is correct... " >&6; } +if test ${gl_cv_decl_readlink_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Cause compilation failure if original declaration has wrong type. */ + ssize_t readlink (const char *, char *, size_t); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_readlink_works=yes +else case e in @%:@( + e) gl_cv_decl_readlink_works=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5 +printf "%s\n" "$gl_cv_decl_readlink_works" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5 +printf %s "checking whether readlink handles trailing slash correctly... " >&6; } +if test ${gl_cv_func_readlink_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # We have readlink, so assume ln -s works. + ln -s conftest.no-such conftest.link + ln -s conftest.link conftest.lnk2 + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_readlink_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_readlink_works="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +char buf[20]; + return readlink ("conftest.lnk2/", buf, sizeof buf) != -1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_readlink_works=yes +else case e in @%:@( + e) gl_cv_func_readlink_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.link conftest.lnk2 ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_works" >&5 +printf "%s\n" "$gl_cv_func_readlink_works" >&6; } + case "$gl_cv_func_readlink_works" in + *yes) + if test "$gl_cv_decl_readlink_works" != yes; then + REPLACE_READLINK=1 + fi + ;; + *) + +printf "%s\n" "@%:@define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h + + REPLACE_READLINK=1 + ;; + esac + fi + + if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext" + + + : + + fi + + + + + + GNULIB_READLINK=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_READLINK 1" >>confdefs.h + + + + + +@%:@ Check whether --with-included-regex was given. +if test ${with_included_regex+y} +then : + withval=$with_included_regex; +fi + + + case $with_included_regex in #( + yes|no) ac_use_included_regex=$with_included_regex + ;; + '') + # If the system regex support is good enough that it passes the + # following run test, then default to *not* using the included regex.c. + # If cross compiling, assume the test would fail and use the included + # regex.c. + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working re_compile_pattern" >&5 +printf %s "checking for working re_compile_pattern... " >&6; } +if test ${gl_cv_func_re_compile_pattern_working+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_re_compile_pattern_working=no +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + + #include + #include + #include + + #if defined M_CHECK_ACTION || HAVE_DECL_ALARM + # include + # include + #endif + + #if HAVE_MALLOC_H + # include + #endif + + #ifdef M_CHECK_ACTION + /* Exit with distinguishable exit code. */ + static void sigabrt_no_core (int sig) { raise (SIGTERM); } + #endif + +int +main (void) +{ +int result = 0; + static struct re_pattern_buffer regex; + unsigned char folded_chars[UCHAR_MAX + 1]; + int i; + const char *s; + struct re_registers regs; + + /* Some builds of glibc go into an infinite loop on this + test. Use alarm to force death, and mallopt to avoid + malloc recursion in diagnosing the corrupted heap. */ +#if HAVE_DECL_ALARM + signal (SIGALRM, SIG_DFL); + alarm (2); +#endif +#ifdef M_CHECK_ACTION + signal (SIGABRT, sigabrt_no_core); + mallopt (M_CHECK_ACTION, 2); +#endif + + if (setlocale (LC_ALL, "en_US.UTF-8")) + { + { + /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html + This test needs valgrind to catch the bug on Debian + GNU/Linux 3.1 x86, but it might catch the bug better + on other platforms and it shouldn't hurt to try the + test here. */ + static char const pat[] = "insert into"; + static char const data[] = + "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK"; + re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE + | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else if (re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, ®s) + != -1) + result |= 1; + regfree (®ex); + } + + { + /* This test is from glibc bug 15078. + The test case is from Andreas Schwab in + . + */ + static char const pat[] = "[^x]x"; + static char const data[] = + /* */ + "\xe1\x80\x80" + "\xe1\x80\xbb" + "\xe1\x80\xbd" + "\xe1\x80\x94" + "\xe1\x80\xba" + "\xe1\x80\xaf" + "\xe1\x80\x95" + "\xe1\x80\xba" + "x"; + re_set_syntax (0); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else + { + i = re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, 0); + if (i != 0 && i != 21) + result |= 1; + } + regfree (®ex); + } + + if (! setlocale (LC_ALL, "C")) + return 1; + } + + /* This test is from glibc bug 3957, reported by Andrew Mackey. */ + re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[^x]b", 6, ®ex); + if (s) + result |= 2; + /* This should fail, but succeeds for glibc-2.5. */ + else if (re_search (®ex, "a\nb", 3, 0, 3, ®s) != -1) + result |= 2; + + /* This regular expression is from Spencer ere test number 75 + in grep-2.3. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP); + memset (®ex, 0, sizeof regex); + for (i = 0; i <= UCHAR_MAX; i++) + folded_chars[i] = i; + regex.translate = folded_chars; + s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, ®ex); + /* This should fail with _Invalid character class name_ error. */ + if (!s) + result |= 4; + + /* Ensure that [b-a] is diagnosed as invalid, when + using RE_NO_EMPTY_RANGES. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[b-a]", 6, ®ex); + if (s == 0) + result |= 8; + + /* This should succeed, but does not for glibc-2.1.3. */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("{1", 2, ®ex); + if (s) + result |= 8; + + /* The following example is derived from a problem report + against gawk from Jorge Stolfi . */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[an\371]*n", 7, ®ex); + if (s) + result |= 8; + /* This should match, but does not for glibc-2.2.1. */ + else if (re_match (®ex, "an", 2, 0, ®s) != 2) + result |= 8; + + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 8; + /* glibc-2.2.93 does not work with a negative RANGE argument. */ + else if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1) + result |= 8; + + /* The version of regex.c in older versions of gnulib + ignored RE_ICASE. Detect that problem too. */ + re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 16; + else if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0) + result |= 16; + + /* Catch a bug reported by Vin Shelton in + http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html + */ + re_set_syntax (RE_SYNTAX_POSIX_BASIC + & ~RE_CONTEXT_INVALID_DUP + & ~RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, ®ex); + if (s) + result |= 32; + + /* REG_STARTEND was added to glibc on 2004-01-15. + Reject older versions. */ + if (! REG_STARTEND) + result |= 64; + +#if 0 + /* It would be nice to reject hosts whose regoff_t values are too + narrow (including glibc on hosts with 64-bit ptrdiff_t and + 32-bit int), but we should wait until glibc implements this + feature. Otherwise, support for equivalence classes and + multibyte collation symbols would always be broken except + when compiling --without-included-regex. */ + if (sizeof (regoff_t) < sizeof (ptrdiff_t) + || sizeof (regoff_t) < sizeof (ssize_t)) + result |= 64; +#endif + + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_re_compile_pattern_working=yes +else case e in @%:@( + e) gl_cv_func_re_compile_pattern_working=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_re_compile_pattern_working" >&5 +printf "%s\n" "$gl_cv_func_re_compile_pattern_working" >&6; } + case $gl_cv_func_re_compile_pattern_working in #( + yes) ac_use_included_regex=no;; #( + no) ac_use_included_regex=yes;; + esac + ;; + *) as_fn_error $? "Invalid value for --with-included-regex: $with_included_regex" "$LINENO" 5 + ;; + esac + + if test $ac_use_included_regex = yes; then + +printf "%s\n" "@%:@define _REGEX_INCLUDE_LIMITS_H 1" >>confdefs.h + + +printf "%s\n" "@%:@define _REGEX_LARGE_OFFSETS 1" >>confdefs.h + + +printf "%s\n" "@%:@define re_syntax_options rpl_re_syntax_options" >>confdefs.h + + +printf "%s\n" "@%:@define re_set_syntax rpl_re_set_syntax" >>confdefs.h + + +printf "%s\n" "@%:@define re_compile_pattern rpl_re_compile_pattern" >>confdefs.h + + +printf "%s\n" "@%:@define re_compile_fastmap rpl_re_compile_fastmap" >>confdefs.h + + +printf "%s\n" "@%:@define re_search rpl_re_search" >>confdefs.h + + +printf "%s\n" "@%:@define re_search_2 rpl_re_search_2" >>confdefs.h + + +printf "%s\n" "@%:@define re_match rpl_re_match" >>confdefs.h + + +printf "%s\n" "@%:@define re_match_2 rpl_re_match_2" >>confdefs.h + + +printf "%s\n" "@%:@define re_set_registers rpl_re_set_registers" >>confdefs.h + + +printf "%s\n" "@%:@define re_comp rpl_re_comp" >>confdefs.h + + +printf "%s\n" "@%:@define re_exec rpl_re_exec" >>confdefs.h + + +printf "%s\n" "@%:@define regcomp rpl_regcomp" >>confdefs.h + + +printf "%s\n" "@%:@define regexec rpl_regexec" >>confdefs.h + + +printf "%s\n" "@%:@define regerror rpl_regerror" >>confdefs.h + + +printf "%s\n" "@%:@define regfree rpl_regfree" >>confdefs.h + + fi + + if test $ac_use_included_regex = yes; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS regex.$ac_objext" + + + + + + + + + ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_LIBINTL_H 1" >>confdefs.h + +fi + + + ac_fn_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_isblank" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h + + + fi + + + + + + if test $ac_cv_func_secure_getenv = no; then + HAVE_SECURE_GETENV=0 + fi + + if test $HAVE_SECURE_GETENV = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS secure_getenv.$ac_objext" + + + ac_fn_c_check_func "$LINENO" "__secure_getenv" "ac_cv_func___secure_getenv" +if test "x$ac_cv_func___secure_getenv" = xyes +then : + printf "%s\n" "@%:@define HAVE___SECURE_GETENV 1" >>confdefs.h + +fi + + if test $ac_cv_func___secure_getenv = no; then + ac_fn_c_check_func "$LINENO" "issetugid" "ac_cv_func_issetugid" +if test "x$ac_cv_func_issetugid" = xyes +then : + printf "%s\n" "@%:@define HAVE_ISSETUGID 1" >>confdefs.h + +fi + + fi + + + fi + + + + + + GNULIB_SECURE_GETENV=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SECURE_GETENV 1" >>confdefs.h + + + + + + if test $ac_cv_func_setenv = no; then + HAVE_SETENV=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5 +printf %s "checking whether setenv validates arguments... " >&6; } +if test ${gl_cv_func_setenv_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_setenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_setenv_works="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + +int +main (void) +{ + + int result = 0; + { + if (setenv ("", "", 0) != -1) + result |= 1; + else if (errno != EINVAL) + result |= 2; + } + { + if (setenv ("a", "=", 1) != 0) + result |= 4; + else if (strcmp (getenv ("a"), "=") != 0) + result |= 8; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_setenv_works=yes +else case e in @%:@( + e) gl_cv_func_setenv_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5 +printf "%s\n" "$gl_cv_func_setenv_works" >&6; } + case "$gl_cv_func_setenv_works" in + *yes) ;; + *) + REPLACE_SETENV=1 + ;; + esac + fi + + if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext" + + fi + + + + + + GNULIB_SETENV=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SETENV 1" >>confdefs.h + + + + + + + if test $ac_cv_func_sigaction = yes; then + ac_fn_c_check_member "$LINENO" "struct sigaction" "sa_sigaction" "ac_cv_member_struct_sigaction_sa_sigaction" "#include +" +if test "x$ac_cv_member_struct_sigaction_sa_sigaction" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1" >>confdefs.h + + +fi + + if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then + HAVE_STRUCT_SIGACTION_SA_SIGACTION=0 + fi + else + HAVE_SIGACTION=0 + fi + + if test $HAVE_SIGACTION = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS sigaction.$ac_objext" + + + + + + + + ac_fn_c_check_type "$LINENO" "siginfo_t" "ac_cv_type_siginfo_t" " +#include + +" +if test "x$ac_cv_type_siginfo_t" = xyes +then : + +printf "%s\n" "@%:@define HAVE_SIGINFO_T 1" >>confdefs.h + + +fi + + if test $ac_cv_type_siginfo_t = no; then + HAVE_SIGINFO_T=0 + fi + + fi + + + + + + GNULIB_SIGACTION=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SIGACTION 1" >>confdefs.h + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_signal_h='<'signal.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_signal_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'signal.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_signal_h + gl_cv_next_signal_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5 +printf "%s\n" "$gl_cv_next_signal_h" >&6; } + fi + NEXT_SIGNAL_H=$gl_cv_next_signal_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'signal.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_signal_h + fi + NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive + + + + + +# AIX declares sig_atomic_t to already include volatile, and C89 compilers +# then choke on 'volatile sig_atomic_t'. C99 requires that it compile. + ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" " +#include + +" +if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes +then : + +else case e in @%:@( + e) HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0 ;; +esac +fi + + + + + + + + ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" " +#include + +" +if test "x$ac_cv_type_sighandler_t" = xyes +then : + +else case e in @%:@( + e) HAVE_SIGHANDLER_T=0 ;; +esac +fi + + + + for gl_func in pthread_sigmask sigaction sigaddset sigdelset sigemptyset sigfillset sigismember sigpending sigprocmask; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + if test $gl_cv_type_sigset_t = yes; then + ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" +if test "x$ac_cv_func_sigprocmask" = xyes +then : + gl_cv_func_sigprocmask=1 +fi + + fi + if test -z "$gl_cv_func_sigprocmask"; then + HAVE_POSIX_SIGNALBLOCKING=0 + fi + + if test $HAVE_POSIX_SIGNALBLOCKING = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS sigprocmask.$ac_objext" + + : + fi + + + + + + GNULIB_SIGPROCMASK=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SIGPROCMASK 1" >>confdefs.h + + + + + ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_STDINT_H 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5 +printf %s "checking for SIZE_MAX... " >&6; } +if test ${gl_cv_size_max+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_cv_size_max= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_STDINT_H +#include +#endif +#ifdef SIZE_MAX +Found it +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "Found it" >/dev/null 2>&1 +then : + gl_cv_size_max=yes +fi +rm -rf conftest* + + if test -z "$gl_cv_size_max"; then + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) * CHAR_BIT - 1" "size_t_bits_minus_1" "#include +#include " +then : + +else case e in @%:@( + e) size_t_bits_minus_1= ;; +esac +fi + + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint" "#include " +then : + +else case e in @%:@( + e) fits_in_uint= ;; +esac +fi + + if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then + if test $fits_in_uint = 1; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + extern size_t foo; + extern unsigned long foo; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + fits_in_uint=0 +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $fits_in_uint = 1; then + gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" + else + gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" + fi + else + gl_cv_size_max='((size_t)~(size_t)0)' + fi + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5 +printf "%s\n" "$gl_cv_size_max" >&6; } + if test "$gl_cv_size_max" != yes; then + +printf "%s\n" "@%:@define SIZE_MAX $gl_cv_size_max" >>confdefs.h + + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 +printf %s "checking for ssize_t... " >&6; } +if test ${gt_cv_ssize_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +int x = sizeof (ssize_t *) + sizeof (ssize_t); + return !x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_ssize_t=yes +else case e in @%:@( + e) gt_cv_ssize_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5 +printf "%s\n" "$gt_cv_ssize_t" >&6; } + if test $gt_cv_ssize_t = no; then + +printf "%s\n" "@%:@define ssize_t int" >>confdefs.h + + fi + + + + + + case "$host_os" in + mingw*) + REPLACE_STAT=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5 +printf %s "checking whether stat handles trailing slashes on files... " >&6; } +if test ${gl_cv_func_stat_file_slash+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) touch conftest.tmp + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + ln -s conftest.tmp conftest.lnk + fi + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_stat_file_slash="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +int result = 0; + struct stat st; + if (!stat ("conftest.tmp/", &st)) + result |= 1; +#if HAVE_LSTAT + if (!stat ("conftest.lnk/", &st)) + result |= 2; +#endif + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_stat_file_slash=yes +else case e in @%:@( + e) gl_cv_func_stat_file_slash=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.tmp conftest.lnk ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5 +printf "%s\n" "$gl_cv_func_stat_file_slash" >&6; } + case $gl_cv_func_stat_file_slash in + *no) + REPLACE_STAT=1 + +printf "%s\n" "@%:@define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h +;; + esac + ;; + esac + + if test $REPLACE_STAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" + + + + : + + fi + + + + + + GNULIB_STAT=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STAT 1" >>confdefs.h + + + + + + + + ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1" >>confdefs.h + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5 +printf %s "checking whether struct stat.st_atim is of type struct timespec... " >&6; } +if test ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #if HAVE_SYS_TIME_H + # include + #endif + #include + struct timespec ts; + struct stat st; + +int +main (void) +{ + + st.st_atim = ts; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes +else case e in @%:@( + e) ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5 +printf "%s\n" "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; } + if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then + +printf "%s\n" "@%:@define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h + + fi +else case e in @%:@( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1" >>confdefs.h + + +else case e in @%:@( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_ATIMENSEC 1" >>confdefs.h + + +else case e in @%:@( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1" >>confdefs.h + + +fi + ;; +esac +fi + ;; +esac +fi + ;; +esac +fi + + + + + + ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1" >>confdefs.h + + +else case e in @%:@( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1" >>confdefs.h + + +else case e in @%:@( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtim.tv_nsec" "ac_cv_member_struct_stat_st_birthtim_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1" >>confdefs.h + + +fi + ;; +esac +fi + ;; +esac +fi + + + + STDARG_H='' + NEXT_STDARG_H='' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 +printf %s "checking for va_copy... " >&6; } + if test ${gl_cv_func_va_copy+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + +#ifndef va_copy +void (*func) (va_list, va_list) = va_copy; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_va_copy=yes +else case e in @%:@( + e) gl_cv_func_va_copy=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_va_copy" >&5 +printf "%s\n" "$gl_cv_func_va_copy" >&6; } + if test $gl_cv_func_va_copy = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined _AIX && !defined __GNUC__ + AIX vaccine + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "vaccine" >/dev/null 2>&1 +then : + gl_aixcc=yes +else case e in @%:@( + e) gl_aixcc=no ;; +esac +fi +rm -rf conftest* + + if test $gl_aixcc = yes; then + STDARG_H=stdarg.h + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdarg_h='<'stdarg.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_stdarg_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdarg.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdarg_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdarg_h + gl_cv_next_stdarg_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdarg_h" >&5 +printf "%s\n" "$gl_cv_next_stdarg_h" >&6; } + fi + NEXT_STDARG_H=$gl_cv_next_stdarg_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdarg.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdarg_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDARG_H=$gl_next_as_first_directive + + + + + if test "$gl_cv_next_stdarg_h" = '""'; then + gl_cv_next_stdarg_h='"///usr/include/stdarg.h"' + NEXT_STDARG_H="$gl_cv_next_stdarg_h" + fi + else + + saved_as_echo_n="$as_@&t@echo_n" + as_@&t@echo_n=':' + if test ${gl_cv_func___va_copy+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + +#ifndef __va_copy +error, bail out +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func___va_copy=yes +else case e in @%:@( + e) gl_cv_func___va_copy=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + as_@&t@echo_n="$saved_as_echo_n" + + if test $gl_cv_func___va_copy = yes; then + +printf "%s\n" "@%:@define va_copy __va_copy" >>confdefs.h + + else + + +printf "%s\n" "@%:@define va_copy gl_va_copy" >>confdefs.h + + fi + fi + fi + + if test -n "$STDARG_H"; then + GL_GENERATE_STDARG_H_TRUE= + GL_GENERATE_STDARG_H_FALSE='#' +else + GL_GENERATE_STDARG_H_TRUE='#' + GL_GENERATE_STDARG_H_FALSE= +fi + + + + + + + # Define two additional variables used in the Makefile substitution. + + if test "$ac_cv_header_stdbool_h" = yes; then + STDBOOL_H='' + else + STDBOOL_H='stdbool.h' + fi + + if test -n "$STDBOOL_H"; then + GL_GENERATE_STDBOOL_H_TRUE= + GL_GENERATE_STDBOOL_H_FALSE='#' +else + GL_GENERATE_STDBOOL_H_TRUE='#' + GL_GENERATE_STDBOOL_H_FALSE= +fi + + + if test "$ac_cv_type__Bool" = yes; then + HAVE__BOOL=1 + else + HAVE__BOOL=0 + fi + + + + + + STDDEF_H= + ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include + +" +if test "x$ac_cv_type_max_align_t" = xyes +then : + +else case e in @%:@( + e) HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h ;; +esac +fi + + if test $gt_cv_c_wchar_t = no; then + HAVE_WCHAR_T=0 + STDDEF_H=stddef.h + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 +printf %s "checking whether NULL can be used in arbitrary expressions... " >&6; } +if test ${gl_cv_decl_null_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int test[2 * (sizeof NULL == sizeof (void *)) -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_null_works=yes +else case e in @%:@( + e) gl_cv_decl_null_works=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 +printf "%s\n" "$gl_cv_decl_null_works" >&6; } + if test $gl_cv_decl_null_works = no; then + REPLACE_NULL=1 + STDDEF_H=stddef.h + fi + + if test -n "$STDDEF_H"; then + GL_GENERATE_STDDEF_H_TRUE= + GL_GENERATE_STDDEF_H_FALSE='#' +else + GL_GENERATE_STDDEF_H_TRUE='#' + GL_GENERATE_STDDEF_H_FALSE= +fi + + if test -n "$STDDEF_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stddef_h='<'stddef.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_stddef_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stddef.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stddef_h + gl_cv_next_stddef_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 +printf "%s\n" "$gl_cv_next_stddef_h" >&6; } + fi + NEXT_STDDEF_H=$gl_cv_next_stddef_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stddef.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stddef_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive + + + + + fi + + + + + printf "%s\n" "@%:@define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdio_h='<'stdio.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_stdio_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdio.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdio_h + gl_cv_next_stdio_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5 +printf "%s\n" "$gl_cv_next_stdio_h" >&6; } + fi + NEXT_STDIO_H=$gl_cv_next_stdio_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdio.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdio_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5 +printf %s "checking which flavor of printf attribute matches inttypes macros... " >&6; } +if test ${gl_cv_func_printf_attribute_flavor+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define __STDC_FORMAT_MACROS 1 + #include + #include + /* For non-mingw systems, compilation will trivially succeed. + For mingw, compilation will succeed for older mingw (system + printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */ + #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_printf_attribute_flavor=system +else case e in @%:@( + e) gl_cv_func_printf_attribute_flavor=gnu ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5 +printf "%s\n" "$gl_cv_func_printf_attribute_flavor" >&6; } + if test "$gl_cv_func_printf_attribute_flavor" = gnu; then + +printf "%s\n" "@%:@define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h + + fi + + GNULIB_FSCANF=1 + + +printf "%s\n" "@%:@define GNULIB_FSCANF 1" >>confdefs.h + + + GNULIB_SCANF=1 + + +printf "%s\n" "@%:@define GNULIB_SCANF 1" >>confdefs.h + + + GNULIB_FGETC=1 + GNULIB_GETC=1 + GNULIB_GETCHAR=1 + GNULIB_FGETS=1 + GNULIB_FREAD=1 + + + GNULIB_FPRINTF=1 + GNULIB_PRINTF=1 + GNULIB_VFPRINTF=1 + GNULIB_VPRINTF=1 + GNULIB_FPUTC=1 + GNULIB_PUTC=1 + GNULIB_PUTCHAR=1 + GNULIB_FPUTS=1 + GNULIB_PUTS=1 + GNULIB_FWRITE=1 + + + + + for gl_func in dprintf fpurge fseeko ftello getdelim getline gets pclose popen renameat snprintf tmpfile vdprintf vsnprintf; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdlib_h='<'stdlib.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_stdlib_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdlib.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdlib_h + gl_cv_next_stdlib_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5 +printf "%s\n" "$gl_cv_next_stdlib_h" >&6; } + fi + NEXT_STDLIB_H=$gl_cv_next_stdlib_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdlib.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdlib_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive + + + + + + + for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#if HAVE_SYS_LOADAVG_H +# include +#endif +#if HAVE_RANDOM_H +# include +#endif + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" +if test "x$ac_cv_func_strcasecmp" = xyes +then : + printf "%s\n" "@%:@define HAVE_STRCASECMP 1" >>confdefs.h + +fi + + if test $ac_cv_func_strcasecmp = no; then + HAVE_STRCASECMP=0 + fi + + + + ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" +if test "x$ac_cv_func_strncasecmp" = xyes +then : + printf "%s\n" "@%:@define HAVE_STRNCASECMP 1" >>confdefs.h + +fi + + if test $ac_cv_func_strncasecmp = yes; then + HAVE_STRNCASECMP=1 + else + HAVE_STRNCASECMP=0 + fi + ac_fn_check_decl "$LINENO" "strncasecmp" "ac_cv_have_decl_strncasecmp" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strncasecmp" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_STRNCASECMP $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_strncasecmp = no; then + HAVE_DECL_STRNCASECMP=0 + fi + + + if test $HAVE_STRCASECMP = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strcasecmp.$ac_objext" + + + : + + fi + if test $HAVE_STRNCASECMP = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strncasecmp.$ac_objext" + + + : + + fi + + + + + + + + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5 +printf %s "checking for working strerror function... " >&6; } +if test ${gl_cv_func_working_strerror+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_working_strerror="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_strerror="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +if (!*strerror (-2)) return 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_working_strerror=yes +else case e in @%:@( + e) gl_cv_func_working_strerror=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5 +printf "%s\n" "$gl_cv_func_working_strerror" >&6; } + case "$gl_cv_func_working_strerror" in + *yes) ;; + *) + REPLACE_STRERROR=1 + ;; + esac + + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR=1 ;; + esac + + else + REPLACE_STRERROR=1 + fi + + if test $REPLACE_STRERROR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext" + + fi + + +printf "%s\n" "@%:@define GNULIB_STRERROR 1" >>confdefs.h + + + + + + + + GNULIB_STRERROR=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STRERROR 1" >>confdefs.h + + + + + + if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext" + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + fi + + # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE. + + + + + + + +printf "%s\n" "@%:@define my_strftime nstrftime" >>confdefs.h + + + if test $gl_cond_libtool = false; then + gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV" + gl_libdeps="$gl_libdeps $LIBICONV" + fi + + + + + + + + + + + + + if test $ac_cv_have_decl_strndup = no; then + HAVE_DECL_STRNDUP=0 + fi + + if test $ac_cv_func_strndup = yes; then + HAVE_STRNDUP=1 + # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strndup" >&5 +printf %s "checking for working strndup... " >&6; } +if test ${gl_cv_func_strndup_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + + case $host_os in + aix | aix[3-6]*) gl_cv_func_strndup_works="guessing no";; + *) gl_cv_func_strndup_works="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include +int +main (void) +{ + +#if !HAVE_DECL_STRNDUP + extern + #ifdef __cplusplus + "C" + #endif + char *strndup (const char *, size_t); +#endif + int result; + char *s; + s = strndup ("some longer string", 15); + free (s); + s = strndup ("shorter string", 13); + result = s[13] != '\0'; + free (s); + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strndup_works=yes +else case e in @%:@( + e) gl_cv_func_strndup_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strndup_works" >&5 +printf "%s\n" "$gl_cv_func_strndup_works" >&6; } + case $gl_cv_func_strndup_works in + *no) REPLACE_STRNDUP=1 ;; + esac + else + HAVE_STRNDUP=0 + fi + + if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strndup.$ac_objext" + + fi + + + + + + GNULIB_STRNDUP=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STRNDUP 1" >>confdefs.h + + + + + + + + + + if test $ac_cv_have_decl_strnlen = no; then + HAVE_DECL_STRNLEN=0 + else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5 +printf %s "checking for working strnlen... " >&6; } +if test ${ac_cv_func_strnlen_working+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + # Guess no on AIX systems, yes otherwise. + case "$host_os" in + aix*) ac_cv_func_strnlen_working=no;; + *) ac_cv_func_strnlen_working=yes;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + +#define S "foobar" +#define S_LEN (sizeof S - 1) + + /* At least one implementation is buggy: that of AIX 4.3 would + give strnlen (S, 1) == 3. */ + + int i; + for (i = 0; i < S_LEN + 1; ++i) + { + int expected = i <= S_LEN ? i : S_LEN; + if (strnlen (S, i) != expected) + return 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_strnlen_working=yes +else case e in @%:@( + e) ac_cv_func_strnlen_working=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5 +printf "%s\n" "$ac_cv_func_strnlen_working" >&6; } +test $ac_cv_func_strnlen_working = no && : + + + if test $ac_cv_func_strnlen_working = no; then + REPLACE_STRNLEN=1 + fi + fi + + if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext" + + : + fi + + + + + + GNULIB_STRNLEN=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STRNLEN 1" >>confdefs.h + + + + + + + + if test $ac_cv_func_strptime != yes; then + HAVE_STRPTIME=0 + fi + + if test $HAVE_STRPTIME = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strptime.$ac_objext" + + + + : + + fi + + + + + + GNULIB_STRPTIME=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STRPTIME 1" >>confdefs.h + + + + + + + if test "$ac_cv_type_unsigned_long_long_int" = yes; then + ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull" +if test "x$ac_cv_func_strtoull" = xyes +then : + printf "%s\n" "@%:@define HAVE_STRTOULL 1" >>confdefs.h + +fi + + if test $ac_cv_func_strtoull = no; then + HAVE_STRTOULL=0 + fi + fi + + if test $HAVE_STRTOULL = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strtoull.$ac_objext" + + + : + + fi + + + + + + GNULIB_STRTOULL=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STRTOULL 1" >>confdefs.h + + + + + + + + + if test "$ac_cv_have_decl_strtoumax" = yes; then + if test "$ac_cv_func_strtoumax" != yes; then + # HP-UX 11.11 has "#define strtoimax(...) ..." but no function. + REPLACE_STRTOUMAX=1 + fi + else + HAVE_DECL_STRTOUMAX=0 + fi + + if test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strtoumax.$ac_objext" + + + ac_fn_check_decl "$LINENO" "strtoull" "ac_cv_have_decl_strtoull" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strtoull" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_STRTOULL $ac_have_decl" >>confdefs.h + + + + fi + + + + + + GNULIB_STRTOUMAX=1 + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_stat_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_stat_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/stat.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_stat_h + gl_cv_next_sys_stat_h='"'$gl_header'"' + else + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 +printf "%s\n" "$gl_cv_next_sys_stat_h" >&6; } + fi + NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/stat.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_stat_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive + + + + + + + + + WINDOWS_STAT_TIMESPEC=0 + + + + + + + + + ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include + #include +" +if test "x$ac_cv_type_nlink_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define nlink_t int" >>confdefs.h + ;; +esac +fi + + + + for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_wait_h='<'sys/wait.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_wait_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_wait_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/wait.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_wait_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_wait_h + gl_cv_next_sys_wait_h='"'$gl_header'"' + else + gl_cv_next_sys_wait_h='<'sys/wait.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_wait_h" >&5 +printf "%s\n" "$gl_cv_next_sys_wait_h" >&6; } + fi + NEXT_SYS_WAIT_H=$gl_cv_next_sys_wait_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/wait.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_wait_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H=$gl_next_as_first_directive + + + + + + + + + for gl_func in waitpid; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + : + + + + + + + + + + + + ac_fn_check_decl "$LINENO" "localtime_r" "ac_cv_have_decl_localtime_r" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_localtime_r" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_LOCALTIME_R $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_localtime_r = no; then + HAVE_DECL_LOCALTIME_R=0 + fi + + + if test $ac_cv_func_localtime_r = yes; then + HAVE_LOCALTIME_R=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5 +printf %s "checking whether localtime_r is compatible with its POSIX signature... " >&6; } +if test ${gl_cv_time_r_posix+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +/* We don't need to append 'restrict's to the argument types, + even though the POSIX signature has the 'restrict's, + since C99 says they can't affect type compatibility. */ + struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r; + if (ptr) return 0; + /* Check the return type is a pointer. + On HP-UX 10 it is 'int'. */ + *localtime_r (0, 0); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_time_r_posix=yes +else case e in @%:@( + e) gl_cv_time_r_posix=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5 +printf "%s\n" "$gl_cv_time_r_posix" >&6; } + if test $gl_cv_time_r_posix = yes; then + REPLACE_LOCALTIME_R=0 + else + REPLACE_LOCALTIME_R=1 + fi + else + HAVE_LOCALTIME_R=0 + fi + + if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext" + + + : + + fi + + + + + + GNULIB_TIME_R=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_TIME_R 1" >>confdefs.h + + + + + + + + + ac_fn_c_check_type "$LINENO" "timezone_t" "ac_cv_type_timezone_t" "#include +" +if test "x$ac_cv_type_timezone_t" = xyes +then : + +printf "%s\n" "@%:@define HAVE_TIMEZONE_T 1" >>confdefs.h + + +fi + + if test "$ac_cv_type_timezone_t" = yes; then + HAVE_TIMEZONE_T=1 + fi + + if test $HAVE_TIMEZONE_T = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS time_rz.$ac_objext" + + fi + + + + + + GNULIB_TIME_RZ=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_TIME_RZ 1" >>confdefs.h + + + + + + + REPLACE_TIMEGM=0 + + if test $ac_cv_func_timegm = yes; then + if test "$gl_cv_func_working_mktime" != yes; then + # Assume that timegm is buggy if mktime is. + REPLACE_TIMEGM=1 + fi + else + HAVE_TIMEGM=0 + fi + + if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS timegm.$ac_objext" + + + : + + fi + + + + + + GNULIB_TIMEGM=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_TIMEGM 1" >>confdefs.h + + + + : + + + + + + if test $ac_cv_func_tzset = no; then + HAVE_TZSET=0 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether tzset clobbers localtime buffer" >&5 +printf %s "checking whether tzset clobbers localtime buffer... " >&6; } +if test ${gl_cv_func_tzset_clobber+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess all is fine on glibc systems. + *-gnu*) gl_cv_func_tzset_clobber="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_tzset_clobber="guessing yes" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main () +{ + time_t t1 = 853958121; + struct tm *p, s; + putenv ("TZ=GMT0"); + p = localtime (&t1); + s = *p; + putenv ("TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"); + tzset (); + return (p->tm_year != s.tm_year + || p->tm_mon != s.tm_mon + || p->tm_mday != s.tm_mday + || p->tm_hour != s.tm_hour + || p->tm_min != s.tm_min + || p->tm_sec != s.tm_sec); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_tzset_clobber=no +else case e in @%:@( + e) gl_cv_func_tzset_clobber=yes ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_tzset_clobber" >&5 +printf "%s\n" "$gl_cv_func_tzset_clobber" >&6; } + + +printf "%s\n" "@%:@define HAVE_RUN_TZSET_TEST 1" >>confdefs.h + + + REPLACE_TZSET=0 + case "$gl_cv_func_tzset_clobber" in + *yes) + REPLACE_TZSET=1 + +printf "%s\n" "@%:@define TZSET_CLOBBERS_LOCALTIME 1" >>confdefs.h + + + + + NEED_LOCALTIME_BUFFER=1 + REPLACE_GMTIME=1 + REPLACE_LOCALTIME=1 + + ;; + esac + case "$host_os" in + mingw*) REPLACE_TZSET=1 ;; + esac + + if test $HAVE_TZSET = 0 || test $REPLACE_TZSET = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS tzset.$ac_objext" + + fi + + + + + + GNULIB_TZSET=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_TZSET 1" >>confdefs.h + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_unistd_h='<'unistd.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_unistd_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_unistd_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'unistd.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_unistd_h + gl_cv_next_unistd_h='"'$gl_header'"' + else + gl_cv_next_unistd_h='<'unistd.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5 +printf "%s\n" "$gl_cv_next_unistd_h" >&6; } + fi + NEXT_UNISTD_H=$gl_cv_next_unistd_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'unistd.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_unistd_h + fi + NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_unistd_h = yes; then + HAVE_UNISTD_H=1 + else + HAVE_UNISTD_H=0 + fi + + + + + + + + for gl_func in chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell endusershell group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite readlink readlinkat rmdir sethostname sleep symlink symlinkat truncate ttyname_r unlink unlinkat usleep; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if HAVE_UNISTD_H +# include +#endif +/* Some systems declare various items in the wrong headers. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include +# endif +#endif + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 + } + } + } + + + + + } + }; then + LIBUNISTRING_UNISTR_H='unistr.h' + else + LIBUNISTRING_UNISTR_H= + fi + + + + +printf "%s\n" "@%:@define GNULIB_UNISTR_U8_MBTOUCR 1" >>confdefs.h + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE= + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE='#' +else + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE='#' + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE= +fi + + + + +printf "%s\n" "@%:@define GNULIB_UNISTR_U8_UCTOMB 1" >>confdefs.h + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE= + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE='#' +else + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE='#' + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE= +fi + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 + } + } + } + + + + + } + }; then + LIBUNISTRING_UNITYPES_H='unitypes.h' + else + LIBUNISTRING_UNITYPES_H= + fi + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 + } + } + } + + + + + } + }; then + LIBUNISTRING_UNIWIDTH_H='uniwidth.h' + else + LIBUNISTRING_UNIWIDTH_H= + fi + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 6 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE= + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE='#' +else + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE='#' + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE= +fi + + + + +printf "%s\n" "@%:@define USE_UNLOCKED_IO 1" >>confdefs.h + + + + + + + + + + + + + + + + + + + + + + if test $ac_cv_have_decl_unsetenv = no; then + HAVE_DECL_UNSETENV=0 + fi + ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv" +if test "x$ac_cv_func_unsetenv" = xyes +then : + printf "%s\n" "@%:@define HAVE_UNSETENV 1" >>confdefs.h + +fi + + if test $ac_cv_func_unsetenv = no; then + HAVE_UNSETENV=0 + else + HAVE_UNSETENV=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5 +printf %s "checking for unsetenv() return type... " >&6; } +if test ${gt_cv_func_unsetenv_ret+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#undef _BSD +#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 */ +#include +extern +#ifdef __cplusplus +"C" +#endif +int unsetenv (const char *name); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_func_unsetenv_ret='int' +else case e in @%:@( + e) gt_cv_func_unsetenv_ret='void' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5 +printf "%s\n" "$gt_cv_func_unsetenv_ret" >&6; } + if test $gt_cv_func_unsetenv_ret = 'void'; then + +printf "%s\n" "@%:@define VOID_UNSETENV 1" >>confdefs.h + + REPLACE_UNSETENV=1 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5 +printf %s "checking whether unsetenv obeys POSIX... " >&6; } +if test ${gl_cv_func_unsetenv_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_unsetenv_works="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + extern char **environ; + +int +main (void) +{ + + char entry1[] = "a=1"; + char entry2[] = "b=2"; + char *env[] = { entry1, entry2, NULL }; + if (putenv ((char *) "a=1")) return 1; + if (putenv (entry2)) return 2; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 3; + if (!unsetenv ("") || errno != EINVAL) return 4; + entry2[0] = 'b'; + environ = env; + if (!getenv ("a")) return 5; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 6; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_unsetenv_works=yes +else case e in @%:@( + e) gl_cv_func_unsetenv_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5 +printf "%s\n" "$gl_cv_func_unsetenv_works" >&6; } + case "$gl_cv_func_unsetenv_works" in + *yes) ;; + *) + REPLACE_UNSETENV=1 + ;; + esac + fi + + if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext" + + + + + + fi + + + + + + GNULIB_UNSETENV=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_UNSETENV 1" >>confdefs.h + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for variable-length arrays" >&5 +printf %s "checking for variable-length arrays... " >&6; } +if test ${ac_cv_c_vararrays+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC_NO_VLA__ + defined + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "defined" >/dev/null 2>&1 +then : + ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined' +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test for VLA support. This test is partly inspired + from examples in the C standard. Use at least two VLA + functions to detect the GCC 3.4.3 bug described in: + http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html + */ + #ifdef __STDC_NO_VLA__ + syntax error; + #else + extern int n; + int B[100]; + int fvla (int m, int C[m][m]); + + int + simple (int count, int all[static count]) + { + return all[count - 1]; + } + + int + fvla (int m, int C[m][m]) + { + typedef int VLA[m][m]; + VLA x; + int D[m]; + static int (*q)[m] = &B; + int (*s)[n] = q; + return C && &x[0][0] == &D[0] && &D[0] == s[0]; + } + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_vararrays=yes +else case e in @%:@( + e) ac_cv_c_vararrays=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -rf conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_vararrays" >&5 +printf "%s\n" "$ac_cv_c_vararrays" >&6; } + if test "$ac_cv_c_vararrays" = yes; then + +printf "%s\n" "@%:@define HAVE_C_VARARRAYS 1" >>confdefs.h + + elif test "$ac_cv_c_vararrays" = no; then + +printf "%s\n" "@%:@define __STDC_NO_VLA__ 1" >>confdefs.h + + fi + + + + if test $ac_cv_func_vasnprintf = no; then + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + + if test $ac_cv_func_vasnprintf = yes; then + +printf "%s\n" "@%:@define REPLACE_VASNPRINTF 1" >>confdefs.h + + fi + + + + + + + + + + + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define ptrdiff_t long" >>confdefs.h + + ;; +esac +fi + + + + + + + + fi + + + ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf" +if test "x$ac_cv_func_vasprintf" = xyes +then : + printf "%s\n" "@%:@define HAVE_VASPRINTF 1" >>confdefs.h + +fi + + if test $ac_cv_func_vasprintf = no; then + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asprintf.$ac_objext" + + + if test $ac_cv_func_vasprintf = yes; then + REPLACE_VASPRINTF=1 + else + HAVE_VASPRINTF=0 + fi + + + + + + + + + fi + + + + + + + GNULIB_VASPRINTF=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_VASPRINTF 1" >>confdefs.h + + + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=asprintf:2:c-format" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=vasprintf:2:c-format" + + +@%:@ Check whether --with-packager was given. +if test ${with_packager+y} +then : + withval=$with_packager; case $withval in + yes|no) ;; + *) +printf "%s\n" "@%:@define PACKAGE_PACKAGER \"$withval\"" >>confdefs.h + ;; + esac + +fi + + + +@%:@ Check whether --with-packager-version was given. +if test ${with_packager_version+y} +then : + withval=$with_packager_version; case $withval in + yes|no) ;; + *) +printf "%s\n" "@%:@define PACKAGE_PACKAGER_VERSION \"$withval\"" >>confdefs.h + ;; + esac + +fi + + + +@%:@ Check whether --with-packager-bug-reports was given. +if test ${with_packager_bug_reports+y} +then : + withval=$with_packager_bug_reports; case $withval in + yes|no) ;; + *) +printf "%s\n" "@%:@define PACKAGE_PACKAGER_BUG_REPORTS \"$withval\"" >>confdefs.h + ;; + esac + +fi + + + if test "X$with_packager" = "X" && \ + test "X$with_packager_version$with_packager_bug_reports" != "X" + then + as_fn_error $? "The --with-packager-{bug-reports,version} options require --with-packager" "$LINENO" 5 + fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wchar_h='<'wchar.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_wchar_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_wchar_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wchar.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wchar_h + gl_cv_next_wchar_h='"'$gl_header'"' + else + gl_cv_next_wchar_h='<'wchar.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5 +printf "%s\n" "$gl_cv_next_wchar_h" >&6; } + fi + NEXT_WCHAR_H=$gl_cv_next_wchar_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'wchar.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_wchar_h + fi + NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + + + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + + + + for gl_func in btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime ; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +#endif +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_incomplete_state=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_sanitycheck=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_wcrtomb = no; then + HAVE_WCRTOMB=0 + ac_fn_check_decl "$LINENO" "wcrtomb" "ac_cv_have_decl_wcrtomb" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_wcrtomb" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_WCRTOMB $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_wcrtomb = yes; then + REPLACE_WCRTOMB=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_WCRTOMB=1 + else + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wcrtomb return value is correct" >&5 +printf %s "checking whether wcrtomb return value is correct... " >&6; } +if test ${gl_cv_func_wcrtomb_retval+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on AIX 4, OSF/1 and Solaris. + aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wcrtomb_retval="guessing yes" ;; + esac + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + int result = 0; + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 1; + } + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 2; + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 4; + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 8; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_wcrtomb_retval=yes +else case e in @%:@( + e) gl_cv_func_wcrtomb_retval=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcrtomb_retval" >&5 +printf "%s\n" "$gl_cv_func_wcrtomb_retval" >&6; } + case "$gl_cv_func_wcrtomb_retval" in + *yes) ;; + *) REPLACE_WCRTOMB=1 ;; + esac + fi + fi + + if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS wcrtomb.$ac_objext" + + + : + + fi + + + + + + GNULIB_WCRTOMB=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_WCRTOMB 1" >>confdefs.h + + + + + + + + + if test $ac_cv_func_iswcntrl = yes; then + HAVE_ISWCNTRL=1 + else + HAVE_ISWCNTRL=0 + fi + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wctype_h='<'wctype.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_wctype_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_wctype_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wctype_h + gl_cv_next_wctype_h='"'$gl_header'"' + else + gl_cv_next_wctype_h='<'wctype.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 +printf "%s\n" "$gl_cv_next_wctype_h" >&6; } + fi + NEXT_WCTYPE_H=$gl_cv_next_wctype_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'wctype.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_wctype_h + fi + NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_wctype_h = yes; then + if test $ac_cv_func_iswcntrl = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 +printf %s "checking whether iswcntrl works... " >&6; } +if test ${gl_cv_func_iswcntrl_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #if __GNU_LIBRARY__ == 1 + Linux libc5 i18n is broken. + #endif +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_iswcntrl_works="guessing yes" +else case e in @%:@( + e) gl_cv_func_iswcntrl_works="guessing no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + int main () { return iswprint ('x') == 0; } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_iswcntrl_works=yes +else case e in @%:@( + e) gl_cv_func_iswcntrl_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 +printf "%s\n" "$gl_cv_func_iswcntrl_works" >&6; } + fi + HAVE_WCTYPE_H=1 + else + HAVE_WCTYPE_H=0 + fi + + + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + fi + + if test $REPLACE_ISWCNTRL = 1; then + REPLACE_TOWLOWER=1 + else + ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" +if test "x$ac_cv_func_towlower" = xyes +then : + printf "%s\n" "@%:@define HAVE_TOWLOWER 1" >>confdefs.h + +fi + + if test $ac_cv_func_towlower = yes; then + REPLACE_TOWLOWER=0 + else + ac_fn_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_towlower" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_TOWLOWER $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_towlower = yes; then + REPLACE_TOWLOWER=1 + else + REPLACE_TOWLOWER=0 + fi + fi + fi + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then + : + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 +printf %s "checking for wctype_t... " >&6; } +if test ${gl_cv_type_wctype_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + wctype_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctype_t=yes +else case e in @%:@( + e) gl_cv_type_wctype_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 +printf "%s\n" "$gl_cv_type_wctype_t" >&6; } + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 +printf %s "checking for wctrans_t... " >&6; } +if test ${gl_cv_type_wctrans_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + wctrans_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctrans_t=yes +else case e in @%:@( + e) gl_cv_type_wctrans_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 +printf "%s\n" "$gl_cv_type_wctrans_t" >&6; } + if test $gl_cv_type_wctrans_t = no; then + HAVE_WCTRANS_T=0 + fi + + + for gl_func in wctype iswctype wctrans towctrans ; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +# include +#endif +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + ac_fn_check_decl "$LINENO" "wcwidth" "ac_cv_have_decl_wcwidth" " +/* AIX 3.2.5 declares wcwidth in . */ +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_wcwidth" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_WCWIDTH $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_wcwidth != yes; then + HAVE_DECL_WCWIDTH=0 + fi + + if test $ac_cv_func_wcwidth = yes; then + HAVE_WCWIDTH=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wcwidth works reasonably in UTF-8 locales" >&5 +printf %s "checking whether wcwidth works reasonably in UTF-8 locales... " >&6; } +if test ${gl_cv_func_wcwidth_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc and AIX 7 systems. + *-gnu* | aix[7-9]*) gl_cv_func_wcwidth_works="guessing yes";; + *) gl_cv_func_wcwidth_works="guessing no";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +/* AIX 3.2.5 declares wcwidth in . */ +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include +#if !HAVE_DECL_WCWIDTH +extern +# ifdef __cplusplus +"C" +# endif +int wcwidth (int); +#endif +int main () +{ + int result = 0; + if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL) + { + if (wcwidth (0x0301) > 0) + result |= 1; + if (wcwidth (0x05B0) > 0) + result |= 2; + if (wcwidth (0x200B) > 0) + result |= 4; + if (wcwidth (0xFF1A) == 0) + result |= 8; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_wcwidth_works=yes +else case e in @%:@( + e) gl_cv_func_wcwidth_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcwidth_works" >&5 +printf "%s\n" "$gl_cv_func_wcwidth_works" >&6; } + case "$gl_cv_func_wcwidth_works" in + *yes) ;; + *no) REPLACE_WCWIDTH=1 ;; + esac + else + HAVE_WCWIDTH=0 + fi + + if test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS wcwidth.$ac_objext" + + fi + + + + + + GNULIB_WCWIDTH=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_WCWIDTH 1" >>confdefs.h + + + + : + + + ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_STDINT_H 1" >>confdefs.h + +fi + + + + + : + + + + : + + : + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xasprintf:1:c-format" + + # End of code from modules + + + + + + + + + + gltests_libdeps= + gltests_ltlibdeps= + + + + + + + + + + gl_source_base='gnulib-tests' + gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS + + gl_module_indicator_condition=$gltests_WITNESS + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS accept.$ac_objext" + + fi + + + + + + if test "$GNULIB_ACCEPT" != 1; then + if test "$GNULIB_ACCEPT" = 0; then + GNULIB_ACCEPT=$gl_module_indicator_condition + else + GNULIB_ACCEPT="($GNULIB_ACCEPT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_ACCEPT 1" >>confdefs.h + + + + + + + + if test $ac_cv_header_arpa_inet_h = yes; then + HAVE_ARPA_INET_H=1 + else + HAVE_ARPA_INET_H=0 + fi + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_arpa_inet_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_arpa_inet_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'arpa/inet.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_arpa_inet_h + gl_cv_next_arpa_inet_h='"'$gl_header'"' + else + gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5 +printf "%s\n" "$gl_cv_next_arpa_inet_h" >&6; } + fi + NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'arpa/inet.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_arpa_inet_h + fi + NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive + + + + + + + + + for gl_func in inet_ntop inet_pton; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* On some systems, this header is not self-consistent. */ +#if !(defined __GLIBC__ || defined __UCLIBC__) +# include +#endif +#ifdef __TANDEM +# include +#endif +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS bind.$ac_objext" + + fi + + + + + + if test "$GNULIB_BIND" != 1; then + if test "$GNULIB_BIND" = 0; then + GNULIB_BIND=$gl_module_indicator_condition + else + GNULIB_BIND="($GNULIB_BIND || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_BIND 1" >>confdefs.h + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5 +printf %s "checking for a turkish Unicode locale... " >&6; } +if test ${gt_cv_locale_tr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. But BeOS does not + implement the Turkish upper-/lowercase mappings. Therefore, let this + program return 1 on BeOS. */ + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the eighth month, the second + character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f) + return 1; + /* Check whether the upper-/lowercase mappings are as expected for + Turkish. */ + if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i' + || towupper(0x0131) != 'I' || towlower ('I') != 0x0131) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=Turkish_Turkey.65001 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr.UTF-8 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + fi + fi + ;; + esac + else + gt_cv_locale_tr_utf8=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_tr_utf8" >&6; } + LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8 + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS connect.$ac_objext" + + fi + + + + + + if test "$GNULIB_CONNECT" != 1; then + if test "$GNULIB_CONNECT" = 0; then + GNULIB_CONNECT=$gl_module_indicator_condition + else + GNULIB_CONNECT="($GNULIB_CONNECT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_CONNECT 1" >>confdefs.h + + + + + + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_FDOPEN=1 + fi + + if test $REPLACE_FDOPEN = 0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fdopen sets errno" >&5 +printf %s "checking whether fdopen sets errno... " >&6; } +if test ${gl_cv_func_fdopen_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + case "$host_os" in + mingw*) gl_cv_func_fdopen_works="guessing no" ;; + *) gl_cv_func_fdopen_works="guessing yes" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +int +main (void) +{ + FILE *fp; + errno = 0; + fp = fdopen (-1, "r"); + if (fp == NULL && errno == 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_fdopen_works=yes +else case e in @%:@( + e) gl_cv_func_fdopen_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopen_works" >&5 +printf "%s\n" "$gl_cv_func_fdopen_works" >&6; } + case "$gl_cv_func_fdopen_works" in + *no) REPLACE_FDOPEN=1 ;; + esac + fi + + if test $REPLACE_FDOPEN = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS fdopen.$ac_objext" + + + fi + + + + + + if test "$GNULIB_FDOPEN" != 1; then + if test "$GNULIB_FDOPEN" = 0; then + GNULIB_FDOPEN=$gl_module_indicator_condition + else + GNULIB_FDOPEN="($GNULIB_FDOPEN || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_FDOPEN 1" >>confdefs.h + + + + + + + if test $ac_cv_func_ftruncate = yes; then + + + case "$host_os" in + mingw*) + REPLACE_FTRUNCATE=1 + ;; + esac + + else + HAVE_FTRUNCATE=0 + fi + + if test $HAVE_FTRUNCATE = 0 || test $REPLACE_FTRUNCATE = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS ftruncate.$ac_objext" + + + ac_fn_c_check_func "$LINENO" "chsize" "ac_cv_func_chsize" +if test "x$ac_cv_func_chsize" = xyes +then : + printf "%s\n" "@%:@define HAVE_CHSIZE 1" >>confdefs.h + +fi + + + fi + + + + + + if test "$GNULIB_FTRUNCATE" != 1; then + if test "$GNULIB_FTRUNCATE" = 0; then + GNULIB_FTRUNCATE=$gl_module_indicator_condition + else + GNULIB_FTRUNCATE="($GNULIB_FTRUNCATE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_FTRUNCATE 1" >>confdefs.h + + + + + + + + + case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in + *yes,yes) ;; + *) + REPLACE_GETCWD=1 + ;; + esac + + if test $REPLACE_GETCWD = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS getcwd-lgpl.$ac_objext" + + fi + + + + + + if test "$GNULIB_GETCWD" != 1; then + if test "$GNULIB_GETCWD" = 0; then + GNULIB_GETCWD=$gl_module_indicator_condition + else + GNULIB_GETCWD="($GNULIB_GETCWD || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_GETCWD 1" >>confdefs.h + + + + + + + ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = xyes +then : + printf "%s\n" "@%:@define HAVE_GETPAGESIZE 1" >>confdefs.h + +fi + + if test $ac_cv_func_getpagesize = no; then + HAVE_GETPAGESIZE=0 + ac_fn_c_check_header_compile "$LINENO" "OS.h" "ac_cv_header_OS_h" "$ac_includes_default" +if test "x$ac_cv_header_OS_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_OS_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_OS_h = yes; then + HAVE_OS_H=1 + fi + ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_SYS_PARAM_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_sys_param_h = yes; then + HAVE_SYS_PARAM_H=1 + fi + fi + case "$host_os" in + mingw*) + REPLACE_GETPAGESIZE=1 + ;; + esac + ac_fn_check_decl "$LINENO" "getpagesize" "ac_cv_have_decl_getpagesize" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getpagesize" = xyes +then : + +else case e in @%:@( + e) HAVE_DECL_GETPAGESIZE=0 ;; +esac +fi + + if test $REPLACE_GETPAGESIZE = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS getpagesize.$ac_objext" + + fi + + + + + + if test "$GNULIB_GETPAGESIZE" != 1; then + if test "$GNULIB_GETPAGESIZE" = 0; then + GNULIB_GETPAGESIZE=$gl_module_indicator_condition + else + GNULIB_GETPAGESIZE="($GNULIB_GETPAGESIZE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_GETPAGESIZE 1" >>confdefs.h + + + + + + + + + + + HAVE_INET_PTON=1 + INET_PTON_LIB= + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + if test $HAVE_WINSOCK2_H = 1; then + ac_fn_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_inet_pton" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_INET_PTON $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_inet_pton = yes; then + REPLACE_INET_PTON=1 + INET_PTON_LIB="-lws2_32" + else + HAVE_DECL_INET_PTON=0 + HAVE_INET_PTON=0 + fi + else + gl_save_LIBS=$LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing inet_pton" >&5 +printf %s "checking for library containing inet_pton... " >&6; } +if test ${ac_cv_search_inet_pton+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char inet_pton (void); +int +main (void) +{ +return inet_pton (); + ; + return 0; +} +_ACEOF +for ac_lib in '' nsl resolv +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_inet_pton=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_inet_pton+y} +then : + break +fi +done +if test ${ac_cv_search_inet_pton+y} +then : + +else case e in @%:@( + e) ac_cv_search_inet_pton=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_pton" >&5 +printf "%s\n" "$ac_cv_search_inet_pton" >&6; } +ac_res=$ac_cv_search_inet_pton +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else case e in @%:@( + e) ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton" +if test "x$ac_cv_func_inet_pton" = xyes +then : + printf "%s\n" "@%:@define HAVE_INET_PTON 1" >>confdefs.h + +fi + + if test $ac_cv_func_inet_pton = no; then + HAVE_INET_PTON=0 + fi + ;; +esac +fi + + LIBS=$gl_save_LIBS + + if test "$ac_cv_search_inet_pton" != "no" \ + && test "$ac_cv_search_inet_pton" != "none required"; then + INET_PTON_LIB="$ac_cv_search_inet_pton" + fi + + + ac_fn_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include + #if HAVE_NETDB_H + # include + #endif + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_inet_pton" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_INET_PTON $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_inet_pton = no; then + HAVE_DECL_INET_PTON=0 + fi + fi + + + if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS inet_pton.$ac_objext" + + + + + fi + + + + + + if test "$GNULIB_INET_PTON" != 1; then + if test "$GNULIB_INET_PTON" = 0; then + GNULIB_INET_PTON=$gl_module_indicator_condition + else + GNULIB_INET_PTON="($GNULIB_INET_PTON || $gl_module_indicator_condition)" + fi + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in @%:@( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in @%:@( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes +then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +unsigned short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + unsigned short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + unsigned short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + unsigned short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else case e in @%:@( + e) ac_cv_c_bigendian=yes ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + printf "%s\n" "@%:@define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +printf "%s\n" "@%:@define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + + + + HAVE_IOCTL=1 + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_IOCTL=0 + else + ac_fn_c_check_func "$LINENO" "ioctl" "ac_cv_func_ioctl" +if test "x$ac_cv_func_ioctl" = xyes +then : + printf "%s\n" "@%:@define HAVE_IOCTL 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ioctl with POSIX signature" >&5 +printf %s "checking for ioctl with POSIX signature... " >&6; } +if test ${gl_cv_func_ioctl_posix_signature+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +extern + #ifdef __cplusplus + "C" + #endif + int ioctl (int, int, ...); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_ioctl_posix_signature=yes +else case e in @%:@( + e) gl_cv_func_ioctl_posix_signature=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ioctl_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_ioctl_posix_signature" >&6; } + if test $gl_cv_func_ioctl_posix_signature != yes; then + REPLACE_IOCTL=1 + fi + fi + + if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS ioctl.$ac_objext" + + fi + + + + + + if test "$GNULIB_IOCTL" != 1; then + if test "$GNULIB_IOCTL" = 0; then + GNULIB_IOCTL=$gl_module_indicator_condition + else + GNULIB_IOCTL="($GNULIB_IOCTL || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_IOCTL 1" >>confdefs.h + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS listen.$ac_objext" + + fi + + + + + + if test "$GNULIB_LISTEN" != 1; then + if test "$GNULIB_LISTEN" = 0; then + GNULIB_LISTEN=$gl_module_indicator_condition + else + GNULIB_LISTEN="($GNULIB_LISTEN || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_LISTEN 1" >>confdefs.h + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5 +printf %s "checking for a turkish Unicode locale... " >&6; } +if test ${gt_cv_locale_tr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. But BeOS does not + implement the Turkish upper-/lowercase mappings. Therefore, let this + program return 1 on BeOS. */ + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the eighth month, the second + character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f) + return 1; + /* Check whether the upper-/lowercase mappings are as expected for + Turkish. */ + if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i' + || towupper(0x0131) != 'I' || towlower ('I') != 0x0131) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=Turkish_Turkey.65001 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr.UTF-8 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + fi + fi + ;; + esac + else + gt_cv_locale_tr_utf8=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_tr_utf8" >&6; } + LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8 + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in @%:@( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "@%:@define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "@%:@define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + + + + + + nanosleep_save_libs=$LIBS + + # Solaris 2.5.1 needs -lposix4 to get the nanosleep function. + # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. + LIB_NANOSLEEP= + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5 +printf %s "checking for library containing nanosleep... " >&6; } +if test ${ac_cv_search_nanosleep+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char nanosleep (void); +int +main (void) +{ +return nanosleep (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt posix4 +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_nanosleep=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_nanosleep+y} +then : + break +fi +done +if test ${ac_cv_search_nanosleep+y} +then : + +else case e in @%:@( + e) ac_cv_search_nanosleep=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5 +printf "%s\n" "$ac_cv_search_nanosleep" >&6; } +ac_res=$ac_cv_search_nanosleep +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ac_cv_search_nanosleep" = "none required" || + LIB_NANOSLEEP=$ac_cv_search_nanosleep +fi + + if test "x$ac_cv_search_nanosleep" != xno; then + + + if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple Mac OS X platforms. + # The test result would be 'no (mishandles large arguments)' in 64-bit + # mode but 'yes' in 32-bit mode. But we need a configuration result that + # is valid in both modes. + gl_cv_func_nanosleep='no (mishandles large arguments)' + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working nanosleep" >&5 +printf %s "checking for working nanosleep... " >&6; } +if test ${gl_cv_func_nanosleep+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + case "$host_os" in linux*) # Guess it halfway works when the kernel is Linux. + gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;; + *) # If we don't know, assume the worst. + gl_cv_func_nanosleep='guessing no' ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + #if HAVE_SYS_TIME_H + #include + #endif + #include + #include + #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) + #define TYPE_MAXIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) + + static void + check_for_SIGALRM (int sig) + { + if (sig != SIGALRM) + _exit (1); + } + + int + main () + { + static struct timespec ts_sleep; + static struct timespec ts_remaining; + static struct sigaction act; + /* Test for major problems first. */ + if (! nanosleep) + return 2; + act.sa_handler = check_for_SIGALRM; + sigemptyset (&act.sa_mask); + sigaction (SIGALRM, &act, NULL); + ts_sleep.tv_sec = 0; + ts_sleep.tv_nsec = 1; + alarm (1); + if (nanosleep (&ts_sleep, NULL) != 0) + return 3; + /* Test for a minor problem: the handling of large arguments. */ + ts_sleep.tv_sec = TYPE_MAXIMUM (time_t); + ts_sleep.tv_nsec = 999999999; + alarm (1); + if (nanosleep (&ts_sleep, &ts_remaining) != -1) + return 4; + if (errno != EINTR) + return 5; + if (ts_remaining.tv_sec <= TYPE_MAXIMUM (time_t) - 10) + return 6; + return 0; + } +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_nanosleep=yes +else case e in @%:@( + e) case $? in 4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)';; *) gl_cv_func_nanosleep=no;; + esac ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nanosleep" >&5 +printf "%s\n" "$gl_cv_func_nanosleep" >&6; } + case "$gl_cv_func_nanosleep" in + *yes) + REPLACE_NANOSLEEP=0 + ;; + *) + REPLACE_NANOSLEEP=1 + case "$gl_cv_func_nanosleep" in + *"mishandles large arguments"*) + +printf "%s\n" "@%:@define HAVE_BUG_BIG_NANOSLEEP 1" >>confdefs.h + + ;; + *) + # The replacement uses select(). Add $LIBSOCKET to $LIB_NANOSLEEP. + for ac_lib in $LIBSOCKET; do + case " $LIB_NANOSLEEP " in + *" $ac_lib "*) ;; + *) LIB_NANOSLEEP="$LIB_NANOSLEEP $ac_lib";; + esac + done + ;; + esac + ;; + esac + else + HAVE_NANOSLEEP=0 + fi + LIBS=$nanosleep_save_libs + + if test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS nanosleep.$ac_objext" + + + + : + + fi + + + + + + if test "$GNULIB_NANOSLEEP" != 1; then + if test "$GNULIB_NANOSLEEP" = 0; then + GNULIB_NANOSLEEP=$gl_module_indicator_condition + else + GNULIB_NANOSLEEP="($GNULIB_NANOSLEEP || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_NANOSLEEP 1" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether is self-contained" >&5 +printf %s "checking whether is self-contained... " >&6; } +if test ${gl_cv_header_netinet_in_h_selfcontained+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_netinet_in_h_selfcontained=yes +else case e in @%:@( + e) gl_cv_header_netinet_in_h_selfcontained=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5 +printf "%s\n" "$gl_cv_header_netinet_in_h_selfcontained" >&6; } + if test $gl_cv_header_netinet_in_h_selfcontained = yes; then + NETINET_IN_H='' + else + NETINET_IN_H='netinet/in.h' + ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_NETINET_IN_H 1" >>confdefs.h + +fi + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_netinet_in_h='<'netinet/in.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_netinet_in_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_netinet_in_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'netinet/in.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_netinet_in_h + gl_cv_next_netinet_in_h='"'$gl_header'"' + else + gl_cv_next_netinet_in_h='<'netinet/in.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5 +printf "%s\n" "$gl_cv_next_netinet_in_h" >&6; } + fi + NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'netinet/in.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_netinet_in_h + fi + NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_netinet_in_h = yes; then + HAVE_NETINET_IN_H=1 + else + HAVE_NETINET_IN_H=0 + fi + + fi + + if test -n "$NETINET_IN_H"; then + GL_GENERATE_NETINET_IN_H_TRUE= + GL_GENERATE_NETINET_IN_H_FALSE='#' +else + GL_GENERATE_NETINET_IN_H_TRUE='#' + GL_GENERATE_NETINET_IN_H_FALSE= +fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + + + if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then + REPLACE_PERROR=1 + fi + case ${gl_cv_func_strerror_r_works-unset} in + unset|*yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether perror matches strerror" >&5 +printf %s "checking whether perror matches strerror... " >&6; } +if test ${gl_cv_func_perror_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_perror_works="guessing no" + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + #include + +int +main (void) +{ +char *str = strerror (-1); + if (!getenv("CONFTEST_OUTPUT")) return 0; + if (!str) str = ""; + puts (str); + errno = -1; + perror (""); + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + if CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2 \ + && cmp conftest.txt1 conftest.txt2 >/dev/null; then + gl_cv_func_perror_works=yes + else + gl_cv_func_perror_works=no + fi + rm -rf conftest.txt1 conftest.txt2 +else case e in @%:@( + e) gl_cv_func_perror_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_perror_works" >&5 +printf "%s\n" "$gl_cv_func_perror_works" >&6; } + if test "$gl_cv_func_perror_works" != yes; then + REPLACE_PERROR=1 + fi + ;; + *) + REPLACE_PERROR=1 + ;; + esac + + if test $REPLACE_PERROR = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS perror.$ac_objext" + + fi + + + + + + if test "$GNULIB_PERROR" != 1; then + if test "$GNULIB_PERROR" = 0; then + GNULIB_PERROR=$gl_module_indicator_condition + else + GNULIB_PERROR="($GNULIB_PERROR || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_PERROR 1" >>confdefs.h + + + + + + + + if test $ac_cv_func_pipe != yes; then + HAVE_PIPE=0 + fi + + if test $HAVE_PIPE = 0; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS pipe.$ac_objext" + + fi + + + + + + if test "$GNULIB_PIPE" != 1; then + if test "$GNULIB_PIPE" = 0; then + GNULIB_PIPE=$gl_module_indicator_condition + else + GNULIB_PIPE="($GNULIB_PIPE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_PIPE 1" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for putenv compatible with GNU and SVID" >&5 +printf %s "checking for putenv compatible with GNU and SVID... " >&6; } +if test ${gl_cv_func_svid_putenv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_svid_putenv="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Put it in env. */ + if (putenv ("CONFTEST_putenv=val")) + return 1; + + /* Try to remove it. */ + if (putenv ("CONFTEST_putenv")) + return 2; + + /* Make sure it was deleted. */ + if (getenv ("CONFTEST_putenv") != 0) + return 3; + + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_svid_putenv=yes +else case e in @%:@( + e) gl_cv_func_svid_putenv=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_svid_putenv" >&5 +printf "%s\n" "$gl_cv_func_svid_putenv" >&6; } + case "$gl_cv_func_svid_putenv" in + *yes) ;; + *) + REPLACE_PUTENV=1 + ;; + esac + + if test $REPLACE_PUTENV = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS putenv.$ac_objext" + + + ac_fn_check_decl "$LINENO" "_putenv" "ac_cv_have_decl__putenv" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl__putenv" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL__PUTENV $ac_have_decl" >>confdefs.h + + + fi + + + + + + if test "$GNULIB_PUTENV" != 1; then + if test "$GNULIB_PUTENV" = 0; then + GNULIB_PUTENV=$gl_module_indicator_condition + else + GNULIB_PUTENV="($GNULIB_PUTENV || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_PUTENV 1" >>confdefs.h + + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in @%:@( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "@%:@define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "@%:@define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in @%:@( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "@%:@define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "@%:@define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + REPLACE_SELECT=1 + else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select supports a 0 argument" >&5 +printf %s "checking whether select supports a 0 argument... " >&6; } +if test ${gl_cv_func_select_supports0+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on Interix. + interix*) gl_cv_func_select_supports0="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_select_supports0="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_SYS_SELECT_H +#include +#endif +int main () +{ + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_supports0=yes +else case e in @%:@( + e) gl_cv_func_select_supports0=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_supports0" >&5 +printf "%s\n" "$gl_cv_func_select_supports0" >&6; } + case "$gl_cv_func_select_supports0" in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select detects invalid fds" >&5 +printf %s "checking whether select detects invalid fds... " >&6; } +if test ${gl_cv_func_select_detects_ebadf+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_select_detects_ebadf="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_SYS_SELECT_H +# include +#endif +#include +#include + +int +main (void) +{ + + fd_set set; + dup2(0, 16); + FD_ZERO(&set); + FD_SET(16, &set); + close(16); + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_detects_ebadf=yes +else case e in @%:@( + e) gl_cv_func_select_detects_ebadf=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_detects_ebadf" >&5 +printf "%s\n" "$gl_cv_func_select_detects_ebadf" >&6; } + case $gl_cv_func_select_detects_ebadf in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + fi + + LIB_SELECT="$LIBSOCKET" + if test $REPLACE_SELECT = 1; then + case "$host_os" in + mingw*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define WIN32_LEAN_AND_MEAN +#include +int +main () +{ + MsgWaitForMultipleObjects (0, NULL, 0, 0, 0); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in @%:@( + e) LIB_SELECT="$LIB_SELECT -luser32" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ;; + esac + fi + + + if test $REPLACE_SELECT = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS select.$ac_objext" + + fi + + + + + + if test "$GNULIB_SELECT" != 1; then + if test "$GNULIB_SELECT" = 0; then + GNULIB_SELECT=$gl_module_indicator_condition + else + GNULIB_SELECT="($GNULIB_SELECT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SELECT 1" >>confdefs.h + + + + + + + + case "$host_os" in + mingw*) REPLACE_SETLOCALE=1 ;; + cygwin*) + case `uname -r` in + 1.5.*) REPLACE_SETLOCALE=1 ;; + esac + ;; + esac + + if test $REPLACE_SETLOCALE = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS setlocale.$ac_objext" + + + : + + fi + + + + + + if test "$GNULIB_SETLOCALE" != 1; then + if test "$GNULIB_SETLOCALE" = 0; then + GNULIB_SETLOCALE=$gl_module_indicator_condition + else + GNULIB_SETLOCALE="($GNULIB_SETLOCALE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SETLOCALE 1" >>confdefs.h + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS setsockopt.$ac_objext" + + fi + + + + + + if test "$GNULIB_SETSOCKOPT" != 1; then + if test "$GNULIB_SETSOCKOPT" = 0; then + GNULIB_SETSOCKOPT=$gl_module_indicator_condition + else + GNULIB_SETSOCKOPT="($GNULIB_SETSOCKOPT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SETSOCKOPT 1" >>confdefs.h + + + + + + ac_fn_check_decl "$LINENO" "sleep" "ac_cv_have_decl_sleep" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_sleep" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_SLEEP $ac_have_decl" >>confdefs.h + + + if test $ac_cv_have_decl_sleep != yes; then + HAVE_SLEEP=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working sleep" >&5 +printf %s "checking for working sleep... " >&6; } +if test ${gl_cv_func_sleep_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_sleep_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_sleep_works="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +static void +handle_alarm (int sig) +{ + if (sig != SIGALRM) + _exit (2); +} + +int +main (void) +{ + + /* Failure to compile this test due to missing alarm is okay, + since all such platforms (mingw) also lack sleep. */ + unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days. */ + unsigned int remaining; + signal (SIGALRM, handle_alarm); + alarm (1); + remaining = sleep (pentecost); + if (remaining > pentecost) + return 3; + if (remaining <= pentecost - 10) + return 4; + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_sleep_works=yes +else case e in @%:@( + e) gl_cv_func_sleep_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_sleep_works" >&5 +printf "%s\n" "$gl_cv_func_sleep_works" >&6; } + case "$gl_cv_func_sleep_works" in + *yes) ;; + *) + REPLACE_SLEEP=1 + ;; + esac + fi + + if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS sleep.$ac_objext" + + fi + + + + + + if test "$GNULIB_SLEEP" != 1; then + if test "$GNULIB_SLEEP" = 0; then + GNULIB_SLEEP=$gl_module_indicator_condition + else + GNULIB_SLEEP="($GNULIB_SLEEP || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SLEEP 1" >>confdefs.h + + + + + + + gl_cv_func_snprintf_usable=no + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "@%:@define HAVE_SNPRINTF 1" >>confdefs.h + +fi + + if test $ac_cv_func_snprintf = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5 +printf %s "checking whether snprintf respects a size of 1... " >&6; } +if test ${gl_cv_func_snprintf_size1+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + gl_cv_func_snprintf_size1="guessing yes" +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + my_snprintf (buf, 1, "%d", 12345); + return buf[1] != 'E'; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_snprintf_size1=yes +else case e in @%:@( + e) gl_cv_func_snprintf_size1=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_size1" >&5 +printf "%s\n" "$gl_cv_func_snprintf_size1" >&6; } + + case "$gl_cv_func_snprintf_size1" in + *yes) + + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5 +printf %s "checking whether printf supports POSIX/XSI format strings with positions... " >&6; } +if test ${gl_cv_func_printf_positions+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) + gl_cv_func_printf_positions="guessing no";; + beos*) gl_cv_func_printf_positions="guessing no";; + mingw* | pw*) gl_cv_func_printf_positions="guessing no";; + *) gl_cv_func_printf_positions="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* The string "%2$d %1$d", with dollar characters protected from the shell's + dollar expansion (possibly an autoconf bug). */ +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; +static char buf[100]; +int main () +{ + sprintf (buf, format, 33, 55); + return (strcmp (buf, "55 33") != 0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_printf_positions=yes +else case e in @%:@( + e) gl_cv_func_printf_positions=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_positions" >&5 +printf "%s\n" "$gl_cv_func_printf_positions" >&6; } + + case "$gl_cv_func_printf_positions" in + *yes) + gl_cv_func_snprintf_usable=yes + ;; + esac + ;; + esac + ;; + esac + fi + if test $gl_cv_func_snprintf_usable = no; then + + + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS snprintf.$ac_objext" + + if test $ac_cv_func_snprintf = yes; then + REPLACE_SNPRINTF=1 + else + + if test $ac_cv_have_decl_snprintf = yes; then + REPLACE_SNPRINTF=1 + fi + fi + : + + fi + + if test $ac_cv_have_decl_snprintf = no; then + HAVE_DECL_SNPRINTF=0 + fi + + + + + + + if test "$GNULIB_SNPRINTF" != 1; then + if test "$GNULIB_SNPRINTF" = 0; then + GNULIB_SNPRINTF=$gl_module_indicator_condition + else + GNULIB_SNPRINTF="($GNULIB_SNPRINTF || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SNPRINTF 1" >>confdefs.h + + + + + +printf "%s\n" "@%:@define GNULIB_SNPRINTF $gl_module_indicator_condition" >>confdefs.h + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS socket.$ac_objext" + + fi + # When this module is used, sockets may actually occur as file descriptors, + # hence it is worth warning if the modules 'close' and 'ioctl' are not used. + + + + if test "$ac_cv_header_winsock2_h" = yes; then + UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 + fi + + + + + + if test "$GNULIB_SOCKET" != 1; then + if test "$GNULIB_SOCKET" = 0; then + GNULIB_SOCKET=$gl_module_indicator_condition + else + GNULIB_SOCKET="($GNULIB_SOCKET || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SOCKET 1" >>confdefs.h + + + + + + ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " +/* is not needed according to POSIX, but the + in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include +#if HAVE_SYS_SOCKET_H +# include +#elif HAVE_WS2TCPIP_H +# include +#endif + +" +if test "x$ac_cv_type_socklen_t" = xyes +then : + +else case e in @%:@( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5 +printf %s "checking for socklen_t equivalent... " >&6; } + if test ${gl_cv_socklen_t_equiv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # Systems have either "struct sockaddr *" or + # "void *" as the second argument to getpeername + gl_cv_socklen_t_equiv= + for arg2 in "struct sockaddr" void; do + for t in int size_t "unsigned int" "long int" "unsigned long int"; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + + int getpeername (int, $arg2 *, $t *); +int +main (void) +{ +$t len; + getpeername (0, 0, &len); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_socklen_t_equiv="$t" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$gl_cv_socklen_t_equiv" != "" && break + done + test "$gl_cv_socklen_t_equiv" != "" && break + done + ;; +esac +fi + + if test "$gl_cv_socklen_t_equiv" = ""; then + as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5 +printf "%s\n" "$gl_cv_socklen_t_equiv" >&6; } + +printf "%s\n" "@%:@define socklen_t $gl_cv_socklen_t_equiv" >>confdefs.h + ;; +esac +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5 +printf %s "checking for working stdalign.h... " >&6; } +if test ${gl_cv_header_working_stdalign_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + + /* Test that alignof yields a result consistent with offsetof. + This catches GCC bug 52023 + . */ + #ifdef __cplusplus + template struct alignof_helper { char a; t b; }; + # define ao(type) offsetof (alignof_helper, b) + #else + # define ao(type) offsetof (struct { char a; type b; }, b) + #endif + char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1]; + char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1]; + char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1]; + + /* Test _Alignas only on platforms where gnulib can help. */ + #if \ + ((defined __cplusplus && 201103 <= __cplusplus) \ + || (defined __APPLE__ && defined __MACH__ \ + ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ + : __GNUC__) \ + || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ + || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \ + || 1300 <= _MSC_VER) + struct alignas_test { char c; char alignas (8) alignas_8; }; + char test_alignas[offsetof (struct alignas_test, alignas_8) == 8 + ? 1 : -1]; + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_working_stdalign_h=yes +else case e in @%:@( + e) gl_cv_header_working_stdalign_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5 +printf "%s\n" "$gl_cv_header_working_stdalign_h" >&6; } + + if test $gl_cv_header_working_stdalign_h = yes; then + STDALIGN_H='' + else + STDALIGN_H='stdalign.h' + fi + + + if test -n "$STDALIGN_H"; then + GL_GENERATE_STDALIGN_H_TRUE= + GL_GENERATE_STDALIGN_H_FALSE='#' +else + GL_GENERATE_STDALIGN_H_TRUE='#' + GL_GENERATE_STDALIGN_H_FALSE= +fi + + + + + + + + + + + + if test $ac_cv_have_decl_strerror_r = no; then + HAVE_DECL_STRERROR_R=0 + fi + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + if test $gl_cv_func_strerror_r_posix_signature = yes; then + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR_R=1 ;; + esac + else + REPLACE_STRERROR_R=1 + fi + else + REPLACE_STRERROR_R=1 + fi + fi + + if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS strerror_r.$ac_objext" + + + + + + + fi + + + + + + if test "$GNULIB_STRERROR_R" != 1; then + if test "$GNULIB_STRERROR_R" = 0; then + GNULIB_STRERROR_R=$gl_module_indicator_condition + else + GNULIB_STRERROR_R="($GNULIB_STRERROR_R || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STRERROR_R 1" >>confdefs.h + + + + + +printf "%s\n" "@%:@define GNULIB_STRERROR_R_POSIX $gl_module_indicator_condition" >>confdefs.h + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in @%:@( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "@%:@define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "@%:@define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + if test $ac_cv_func_symlink = no; then + HAVE_SYMLINK=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether symlink handles trailing slash correctly" >&5 +printf %s "checking whether symlink handles trailing slash correctly... " >&6; } +if test ${gl_cv_func_symlink_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_symlink_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_symlink_works="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +int result = 0; + if (!symlink ("a", "conftest.link/")) + result |= 1; + if (symlink ("conftest.f", "conftest.lnk2")) + result |= 2; + else if (!symlink ("a", "conftest.lnk2/")) + result |= 4; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_symlink_works=yes +else case e in @%:@( + e) gl_cv_func_symlink_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.f conftest.link conftest.lnk2 ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_symlink_works" >&5 +printf "%s\n" "$gl_cv_func_symlink_works" >&6; } + case "$gl_cv_func_symlink_works" in + *yes) ;; + *) + REPLACE_SYMLINK=1 + ;; + esac + fi + + if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS symlink.$ac_objext" + + fi + + + + + + if test "$GNULIB_SYMLINK" != 1; then + if test "$GNULIB_SYMLINK" = 0; then + GNULIB_SYMLINK=$gl_module_indicator_condition + else + GNULIB_SYMLINK="($GNULIB_SYMLINK || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SYMLINK 1" >>confdefs.h + + + + + + + + if test $ac_cv_header_sys_ioctl_h = yes; then + HAVE_SYS_IOCTL_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether declares ioctl" >&5 +printf %s "checking whether declares ioctl... " >&6; } +if test ${gl_cv_decl_ioctl_in_sys_ioctl_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +(void) ioctl; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_ioctl_in_sys_ioctl_h=yes +else case e in @%:@( + e) gl_cv_decl_ioctl_in_sys_ioctl_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_ioctl_in_sys_ioctl_h" >&5 +printf "%s\n" "$gl_cv_decl_ioctl_in_sys_ioctl_h" >&6; } + else + HAVE_SYS_IOCTL_H=0 + fi + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_ioctl_h='<'sys/ioctl.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_ioctl_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_ioctl_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/ioctl.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_ioctl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_ioctl_h + gl_cv_next_sys_ioctl_h='"'$gl_header'"' + else + gl_cv_next_sys_ioctl_h='<'sys/ioctl.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_ioctl_h" >&5 +printf "%s\n" "$gl_cv_next_sys_ioctl_h" >&6; } + fi + NEXT_SYS_IOCTL_H=$gl_cv_next_sys_ioctl_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/ioctl.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_ioctl_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H=$gl_next_as_first_directive + + + + + + + for gl_func in ioctl; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +/* Some platforms declare ioctl in the wrong header. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +#endif + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_uio_h='<'sys/uio.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_uio_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_uio_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/uio.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_uio_h + gl_cv_next_sys_uio_h='"'$gl_header'"' + else + gl_cv_next_sys_uio_h='<'sys/uio.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5 +printf "%s\n" "$gl_cv_next_sys_uio_h" >&6; } + fi + NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/uio.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_uio_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_sys_uio_h = yes; then + HAVE_SYS_UIO_H=1 + else + HAVE_SYS_UIO_H=0 + fi + + + + abs_aux_dir=`cd "$ac_aux_dir"; pwd` + + abs_aux_dir=`cd "$ac_aux_dir"; pwd` + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + + + if test $ac_cv_func_wctob = no; then + HAVE_WCTOB=0 + HAVE_DECL_WCTOB=0 + else + HAVE_WCTOB=1 + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wctob works" >&5 +printf %s "checking whether wctob works... " >&6; } +if test ${gl_cv_func_wctob_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris <= 9 and Cygwin. + solaris2.[1-9] | solaris2.[1-9].* | cygwin*) + gl_cv_func_wctob_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wctob_works="guessing yes" ;; + esac + case "$host_os" in + cygwin*) + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include + +register long global __asm__ ("%ebx"); + +int main () +{ + setlocale (LC_ALL, "en_US.UTF-8"); + + global = 0x12345678; + if (wctob (0x00FC) != -1) + return 1; + if (global != 0x12345678) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + : +else case e in @%:@( + e) gl_cv_func_wctob_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; + esac + if test "$gl_cv_func_wctob_works" != no && test $LOCALE_FR != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + wchar_t wc; + + if (mbtowc (&wc, "\374", 1) == 1) + if (wctob (wc) != (unsigned char) '\374') + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_wctob_works=yes +else case e in @%:@( + e) gl_cv_func_wctob_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wctob_works" >&5 +printf "%s\n" "$gl_cv_func_wctob_works" >&6; } + case "$gl_cv_func_wctob_works" in + *yes) ;; + *) REPLACE_WCTOB=1 ;; + esac + if test $REPLACE_WCTOB = 0; then + + ac_fn_check_decl "$LINENO" "wctob" "ac_cv_have_decl_wctob" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_wctob" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_WCTOB $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_wctob != yes; then + HAVE_DECL_WCTOB=0 + fi + fi + fi + + if test $HAVE_WCTOB = 0 || test $REPLACE_WCTOB = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS wctob.$ac_objext" + + + : + + fi + + + + + + if test "$GNULIB_WCTOB" != 1; then + if test "$GNULIB_WCTOB" = 0; then + GNULIB_WCTOB=$gl_module_indicator_condition + else + GNULIB_WCTOB="($GNULIB_WCTOB || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_WCTOB 1" >>confdefs.h + + + + + + + if false; then + REPLACE_WCTOMB=1 + fi + + if test $REPLACE_WCTOMB = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS wctomb.$ac_objext" + + + : + + fi + + + + + + if test "$GNULIB_WCTOMB" != 1; then + if test "$GNULIB_WCTOMB" = 0; then + GNULIB_WCTOMB=$gl_module_indicator_condition + else + GNULIB_WCTOMB="($GNULIB_WCTOMB || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_WCTOMB 1" >>confdefs.h + + + + + + + + + + + + + + LIBDIFFUTILS_LIBDEPS="$gl_libdeps" + + LIBDIFFUTILS_LTLIBDEPS="$gl_ltlibdeps" + + LIBTESTS_LIBDEPS="$gltests_libdeps" + + + +@%:@ Check whether --enable-gcc-warnings was given. +if test ${enable_gcc_warnings+y} +then : + enableval=$enable_gcc_warnings; case $enableval in + yes|no) ;; + *) as_fn_error $? "bad value $enableval for gcc-warnings option" "$LINENO" 5 ;; + esac + gl_gcc_warnings=$enableval +else case e in @%:@( + e) if test -d "$srcdir"/.git; then + gl_gcc_warnings=yes + else + gl_gcc_warnings=no + fi + ;; +esac +fi + + +if test "$gl_gcc_warnings" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror -Wunknown-warning-option" >&5 +printf %s "checking whether C compiler handles -Werror -Wunknown-warning-option... " >&6; } +if test ${gl_cv_warn_c__Werror__Wunknown_warning_option+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Werror__Wunknown_warning_option=yes +else case e in @%:@( + e) gl_cv_warn_c__Werror__Wunknown_warning_option=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror__Wunknown_warning_option" >&5 +printf "%s\n" "$gl_cv_warn_c__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_c__Werror__Wunknown_warning_option" = xyes +then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else case e in @%:@( + e) gl_unknown_warnings_are_errors= ;; +esac +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror" >&5 +printf %s "checking whether C compiler handles -Werror... " >&6; } +if test ${gl_cv_warn_c__Werror+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Werror=yes +else case e in @%:@( + e) gl_cv_warn_c__Werror=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror" >&5 +printf "%s\n" "$gl_cv_warn_c__Werror" >&6; } +if test "x$gl_cv_warn_c__Werror" = xyes +then : + as_fn_append WERROR_CFLAGS " -Werror" +fi + + + + + nw= + # This, $nw, is the list of warnings we disable. + nw="$nw -Wdeclaration-after-statement" # too useful to forbid + nw="$nw -Waggregate-return" # anachronistic + nw="$nw -Wlong-long" # C90 is anachronistic (lib/gethrxtime.h) + nw="$nw -Wc++-compat" # We don't care about C++ compilers + nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib + nw="$nw -Wtraditional" # Warns on #elif which we use often + nw="$nw -Wcast-qual" # Too many warnings for now + nw="$nw -Wconversion" # Too many warnings for now + nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings + nw="$nw -Wsign-conversion" # Too many warnings for now + nw="$nw -Wtraditional-conversion" # Too many warnings for now + nw="$nw -Wunreachable-code" # Too many warnings for now + nw="$nw -Wpadded" # Our structs are not padded + nw="$nw -Wredundant-decls" # openat.h declares e.g., mkdirat + nw="$nw -Wlogical-op" # any use of fwrite provokes this + nw="$nw -Wformat-nonliteral" # who.c and pinky.c strftime uses + nw="$nw -Wvla" # warnings in gettext.h + nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__ + nw="$nw -Wswitch-enum" # Too many warnings for now + nw="$nw -Wswitch-default" # Too many warnings for now + nw="$nw -Wstack-protector" # not worth working around + # things I might fix soon: + nw="$nw -Wfloat-equal" # sort.c, seq.c + nw="$nw -Wmissing-format-attribute" # copy.c + nw="$nw -Wunsafe-loop-optimizations" # a few src/*.c + nw="$nw -Winline" # system.h's readdir_ignoring_dot_and_dotdot + nw="$nw -Wstrict-overflow" # expr.c, pr.c, tr.c, factor.c + nw="$nw -Wformat-extra-args" # sdiff.c + # ?? -Wstrict-overflow + + + + if test -n "$GCC"; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is supported" >&5 +printf %s "checking whether -Wno-missing-field-initializers is supported... " >&6; } + if test ${gl_cv_cc_nomfi_supported+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_nomfi_supported=yes +else case e in @%:@( + e) gl_cv_cc_nomfi_supported=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_supported" >&5 +printf "%s\n" "$gl_cv_cc_nomfi_supported" >&6; } + + if test "$gl_cv_cc_nomfi_supported" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is needed" >&5 +printf %s "checking whether -Wno-missing-field-initializers is needed... " >&6; } + if test ${gl_cv_cc_nomfi_needed+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int f (void) + { + typedef struct { int a; int b; } s_t; + s_t s1 = { 0, }; + return s1.b; + } + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_nomfi_needed=no +else case e in @%:@( + e) gl_cv_cc_nomfi_needed=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" + ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_needed" >&5 +printf "%s\n" "$gl_cv_cc_nomfi_needed" >&6; } + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wuninitialized is supported" >&5 +printf %s "checking whether -Wuninitialized is supported... " >&6; } + if test ${gl_cv_cc_uninitialized_supported+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wuninitialized" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_uninitialized_supported=yes +else case e in @%:@( + e) gl_cv_cc_uninitialized_supported=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_uninitialized_supported" >&5 +printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; } + + fi + + # List all gcc warning categories. + # To compare this list to your installed GCC's, run this Bash command: + # + # comm -3 \ + # <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \ + # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort | + # grep -v -x -F -f <( + # awk '/^[^#]/ {print ws}' ../build-aux/gcc-warning.spec)) + + gl_manywarn_set= + for gl_manywarn_item in -fno-common \ + -W \ + -Wabi \ + -Waddress \ + -Waggressive-loop-optimizations \ + -Wall \ + -Wattributes \ + -Wbad-function-cast \ + -Wbool-compare \ + -Wbool-operation \ + -Wbuiltin-declaration-mismatch \ + -Wbuiltin-macro-redefined \ + -Wcast-align \ + -Wchar-subscripts \ + -Wchkp \ + -Wclobbered \ + -Wcomment \ + -Wcomments \ + -Wcoverage-mismatch \ + -Wcpp \ + -Wdangling-else \ + -Wdate-time \ + -Wdeprecated \ + -Wdeprecated-declarations \ + -Wdesignated-init \ + -Wdisabled-optimization \ + -Wdiscarded-array-qualifiers \ + -Wdiscarded-qualifiers \ + -Wdiv-by-zero \ + -Wdouble-promotion \ + -Wduplicated-branches \ + -Wduplicated-cond \ + -Wduplicate-decl-specifier \ + -Wempty-body \ + -Wendif-labels \ + -Wenum-compare \ + -Wexpansion-to-defined \ + -Wextra \ + -Wformat-contains-nul \ + -Wformat-extra-args \ + -Wformat-nonliteral \ + -Wformat-security \ + -Wformat-signedness \ + -Wformat-y2k \ + -Wformat-zero-length \ + -Wframe-address \ + -Wfree-nonheap-object \ + -Whsa \ + -Wignored-attributes \ + -Wignored-qualifiers \ + -Wimplicit \ + -Wimplicit-function-declaration \ + -Wimplicit-int \ + -Wincompatible-pointer-types \ + -Winit-self \ + -Winline \ + -Wint-conversion \ + -Wint-in-bool-context \ + -Wint-to-pointer-cast \ + -Winvalid-memory-model \ + -Winvalid-pch \ + -Wjump-misses-init \ + -Wlogical-not-parentheses \ + -Wlogical-op \ + -Wmain \ + -Wmaybe-uninitialized \ + -Wmemset-elt-size \ + -Wmemset-transposed-args \ + -Wmisleading-indentation \ + -Wmissing-braces \ + -Wmissing-declarations \ + -Wmissing-field-initializers \ + -Wmissing-include-dirs \ + -Wmissing-parameter-type \ + -Wmissing-prototypes \ + -Wmultichar \ + -Wnarrowing \ + -Wnested-externs \ + -Wnonnull \ + -Wnonnull-compare \ + -Wnull-dereference \ + -Wodr \ + -Wold-style-declaration \ + -Wold-style-definition \ + -Wopenmp-simd \ + -Woverflow \ + -Woverlength-strings \ + -Woverride-init \ + -Wpacked \ + -Wpacked-bitfield-compat \ + -Wparentheses \ + -Wpointer-arith \ + -Wpointer-compare \ + -Wpointer-sign \ + -Wpointer-to-int-cast \ + -Wpragmas \ + -Wpsabi \ + -Wrestrict \ + -Wreturn-local-addr \ + -Wreturn-type \ + -Wscalar-storage-order \ + -Wsequence-point \ + -Wshadow \ + -Wshift-count-negative \ + -Wshift-count-overflow \ + -Wshift-negative-value \ + -Wsizeof-array-argument \ + -Wsizeof-pointer-memaccess \ + -Wstack-protector \ + -Wstrict-aliasing \ + -Wstrict-overflow \ + -Wstrict-prototypes \ + -Wsuggest-attribute=const \ + -Wsuggest-attribute=format \ + -Wsuggest-attribute=noreturn \ + -Wsuggest-attribute=pure \ + -Wsuggest-final-methods \ + -Wsuggest-final-types \ + -Wswitch \ + -Wswitch-bool \ + -Wswitch-default \ + -Wswitch-unreachable \ + -Wsync-nand \ + -Wsystem-headers \ + -Wtautological-compare \ + -Wtrampolines \ + -Wtrigraphs \ + -Wtype-limits \ + -Wuninitialized \ + -Wunknown-pragmas \ + -Wunsafe-loop-optimizations \ + -Wunused \ + -Wunused-but-set-parameter \ + -Wunused-but-set-variable \ + -Wunused-function \ + -Wunused-label \ + -Wunused-local-typedefs \ + -Wunused-macros \ + -Wunused-parameter \ + -Wunused-result \ + -Wunused-value \ + -Wunused-variable \ + -Wvarargs \ + -Wvariadic-macros \ + -Wvector-operation-performance \ + -Wvla \ + -Wvolatile-register-var \ + -Wwrite-strings \ + \ + ; do + gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" + done + + # gcc --help=warnings outputs an unusual form for these options; list + # them here so that the above 'comm' command doesn't report a false match. + # Would prefer "min (PTRDIFF_MAX, SIZE_MAX)", but it must be a literal: + ptrdiff_max_max=9223372036854775807 + gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$ptrdiff_max_max" + gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2" + gl_manywarn_set="$gl_manywarn_set -Wformat-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wformat-truncation=2" + gl_manywarn_set="$gl_manywarn_set -Wimplicit-fallthrough=5" + gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc" + gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wstringop-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2" + gl_manywarn_set="$gl_manywarn_set -Wvla-larger-than=4031" + + # These are needed for older GCC versions. + if test -n "$GCC"; then + case `($CC --version) 2>/dev/null` in + 'gcc (GCC) '[0-3].* | \ + 'gcc (GCC) '4.[0-7].*) + gl_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option" + gl_manywarn_set="$gl_manywarn_set -funit-at-a-time" + ;; + esac + fi + + # Disable specific options as needed. + if test "$gl_cv_cc_nomfi_needed" = yes; then + gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers" + fi + + if test "$gl_cv_cc_uninitialized_supported" = no; then + gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized" + fi + + ws=$gl_manywarn_set + + + gl_warn_set= + set x $ws; shift + for gl_warn_item + do + case " $nw " in + *" $gl_warn_item "*) + ;; + *) + gl_warn_set="$gl_warn_set $gl_warn_item" + ;; + esac + done + ws=$gl_warn_set + + for w in $ws; do + +as_gl_Warn=`printf "%s\n" "gl_cv_warn_c_$w" | sed "$as_sed_sh"` +gl_positive="$w" +case $gl_positive in + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles $w" >&5 +printf %s "checking whether C compiler handles $w... " >&6; } +if eval test \${$as_gl_Warn+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors $gl_positive" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_gl_Warn=yes" +else case e in @%:@( + e) eval "$as_gl_Warn=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +eval ac_res=\$$as_gl_Warn + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_gl_Warn"\" = x"yes" +then : + as_fn_append WARN_CFLAGS " $w" +fi + + + done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-missing-field-initializers" >&5 +printf %s "checking whether C compiler handles -Wno-missing-field-initializers... " >&6; } +if test ${gl_cv_warn_c__Wno_missing_field_initializers+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wmissing-field-initializers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_missing_field_initializers=yes +else case e in @%:@( + e) gl_cv_warn_c__Wno_missing_field_initializers=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_missing_field_initializers" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_missing_field_initializers" >&6; } +if test "x$gl_cv_warn_c__Wno_missing_field_initializers" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-missing-field-initializers" +fi + + # We need this one + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-sign-compare" >&5 +printf %s "checking whether C compiler handles -Wno-sign-compare... " >&6; } +if test ${gl_cv_warn_c__Wno_sign_compare+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wsign-compare" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_sign_compare=yes +else case e in @%:@( + e) gl_cv_warn_c__Wno_sign_compare=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_sign_compare" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_sign_compare" >&6; } +if test "x$gl_cv_warn_c__Wno_sign_compare" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-sign-compare" +fi + + # Too many warnings for now + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-pointer-sign" >&5 +printf %s "checking whether C compiler handles -Wno-pointer-sign... " >&6; } +if test ${gl_cv_warn_c__Wno_pointer_sign+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wpointer-sign" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_pointer_sign=yes +else case e in @%:@( + e) gl_cv_warn_c__Wno_pointer_sign=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_pointer_sign" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_pointer_sign" >&6; } +if test "x$gl_cv_warn_c__Wno_pointer_sign" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-pointer-sign" +fi + + # Too many warnings for now + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-unused-parameter" >&5 +printf %s "checking whether C compiler handles -Wno-unused-parameter... " >&6; } +if test ${gl_cv_warn_c__Wno_unused_parameter+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wunused-parameter" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_unused_parameter=yes +else case e in @%:@( + e) gl_cv_warn_c__Wno_unused_parameter=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_unused_parameter" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_unused_parameter" >&6; } +if test "x$gl_cv_warn_c__Wno_unused_parameter" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-unused-parameter" +fi + + # Too many warnings for now + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-format-nonliteral" >&5 +printf %s "checking whether C compiler handles -Wno-format-nonliteral... " >&6; } +if test ${gl_cv_warn_c__Wno_format_nonliteral+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wformat-nonliteral" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_format_nonliteral=yes +else case e in @%:@( + e) gl_cv_warn_c__Wno_format_nonliteral=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_format_nonliteral" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_format_nonliteral" >&6; } +if test "x$gl_cv_warn_c__Wno_format_nonliteral" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-format-nonliteral" +fi + + + + # In spite of excluding -Wlogical-op above, it is enabled, as of + # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-logical-op" >&5 +printf %s "checking whether C compiler handles -Wno-logical-op... " >&6; } +if test ${gl_cv_warn_c__Wno_logical_op+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wlogical-op" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_logical_op=yes +else case e in @%:@( + e) gl_cv_warn_c__Wno_logical_op=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_logical_op" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_logical_op" >&6; } +if test "x$gl_cv_warn_c__Wno_logical_op" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-logical-op" +fi + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -fdiagnostics-show-option" >&5 +printf %s "checking whether C compiler handles -fdiagnostics-show-option... " >&6; } +if test ${gl_cv_warn_c__fdiagnostics_show_option+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -fdiagnostics-show-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__fdiagnostics_show_option=yes +else case e in @%:@( + e) gl_cv_warn_c__fdiagnostics_show_option=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__fdiagnostics_show_option" >&5 +printf "%s\n" "$gl_cv_warn_c__fdiagnostics_show_option" >&6; } +if test "x$gl_cv_warn_c__fdiagnostics_show_option" = xyes +then : + as_fn_append WARN_CFLAGS " -fdiagnostics-show-option" +fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -funit-at-a-time" >&5 +printf %s "checking whether C compiler handles -funit-at-a-time... " >&6; } +if test ${gl_cv_warn_c__funit_at_a_time+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -funit-at-a-time" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__funit_at_a_time=yes +else case e in @%:@( + e) gl_cv_warn_c__funit_at_a_time=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__funit_at_a_time" >&5 +printf "%s\n" "$gl_cv_warn_c__funit_at_a_time" >&6; } +if test "x$gl_cv_warn_c__funit_at_a_time" = xyes +then : + as_fn_append WARN_CFLAGS " -funit-at-a-time" +fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -fno-common" >&5 +printf %s "checking whether C compiler handles -fno-common... " >&6; } +if test ${gl_cv_warn_c__fno_common+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -fno-common" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__fno_common=yes +else case e in @%:@( + e) gl_cv_warn_c__fno_common=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__fno_common" >&5 +printf "%s\n" "$gl_cv_warn_c__fno_common" >&6; } +if test "x$gl_cv_warn_c__fno_common" = xyes +then : + as_fn_append WARN_CFLAGS " -fno-common" +fi + + + + + + +printf "%s\n" "@%:@define lint 1" >>confdefs.h + + +printf "%s\n" "@%:@define _FORTIFY_SOURCE 2" >>confdefs.h + + +printf "%s\n" "@%:@define GNULIB_PORTCHECK 1" >>confdefs.h + + + # We use a slightly smaller set of warning options for lib/. + # Remove the following and save the result in GNULIB_WARN_CFLAGS. + nw= + nw="$nw -Wunused-macros" + nw="$nw -Wmissing-prototypes" + nw="$nw -Wold-style-definition" + nw="$nw -Wsuggest-attribute=pure" + + gl_warn_set= + set x $WARN_CFLAGS; shift + for gl_warn_item + do + case " $nw " in + *" $gl_warn_item "*) + ;; + *) + gl_warn_set="$gl_warn_set $gl_warn_item" + ;; + esac + done + GNULIB_WARN_CFLAGS=$gl_warn_set + + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo (void) {return 0; } +$ac_kw foo_t foo (void) {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for variable-length arrays" >&5 +printf %s "checking for variable-length arrays... " >&6; } +if test ${ac_cv_c_vararrays+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC_NO_VLA__ + defined + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "defined" >/dev/null 2>&1 +then : + ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined' +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test for VLA support. This test is partly inspired + from examples in the C standard. Use at least two VLA + functions to detect the GCC 3.4.3 bug described in: + http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html + */ + #ifdef __STDC_NO_VLA__ + syntax error; + #else + extern int n; + int B[100]; + int fvla (int m, int C[m][m]); + + int + simple (int count, int all[static count]) + { + return all[count - 1]; + } + + int + fvla (int m, int C[m][m]) + { + typedef int VLA[m][m]; + VLA x; + int D[m]; + static int (*q)[m] = &B; + int (*s)[n] = q; + return C && &x[0][0] == &D[0] && &D[0] == s[0]; + } + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_vararrays=yes +else case e in @%:@( + e) ac_cv_c_vararrays=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -rf conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_vararrays" >&5 +printf "%s\n" "$ac_cv_c_vararrays" >&6; } + if test "$ac_cv_c_vararrays" = yes; then + +printf "%s\n" "@%:@define HAVE_C_VARARRAYS 1" >>confdefs.h + + elif test "$ac_cv_c_vararrays" = no; then + +printf "%s\n" "@%:@define __STDC_NO_VLA__ 1" >>confdefs.h + + fi + + + +printf "%s\n" "@%:@define DEFAULT_EDITOR_PROGRAM \"ed\"" >>confdefs.h + + +# Extract the first word of "pr", so it can be a program name with args. +set dummy pr; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PR_PROGRAM+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) case $PR_PROGRAM in + [\\/]* | ?:[\\/]*) + ac_cv_path_PR_PROGRAM="$PR_PROGRAM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PR_PROGRAM="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PR_PROGRAM" && ac_cv_path_PR_PROGRAM="""" + ;; +esac ;; +esac +fi +PR_PROGRAM=$ac_cv_path_PR_PROGRAM +if test -n "$PR_PROGRAM"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PR_PROGRAM" >&5 +printf "%s\n" "$PR_PROGRAM" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +printf "%s\n" "@%:@define PR_PROGRAM \"$PR_PROGRAM\"" >>confdefs.h + + +ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_blksize" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_BLKSIZE 1" >>confdefs.h + + +fi + +ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_rdev" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_RDEV 1" >>confdefs.h + + +fi + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | sed "$as_sed_sh"` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +printf %s "checking for $ac_hdr that defines DIR... " >&6; } +if eval test \${$as_ac_Header+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main (void) +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_ac_Header=yes" +else case e in @%:@( + e) eval "$as_ac_Header=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_ac_Header + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_$ac_hdr" | sed "$as_sed_cpp"` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); +int +main (void) +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_opendir+y} +then : + break +fi +done +if test ${ac_cv_search_opendir+y} +then : + +else case e in @%:@( + e) ac_cv_search_opendir=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); +int +main (void) +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_opendir+y} +then : + break +fi +done +if test ${ac_cv_search_opendir+y} +then : + +else case e in @%:@( + e) ac_cv_search_opendir=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 +printf %s "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } +if test ${ac_cv_header_sys_wait_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) +#endif +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif + +int +main (void) +{ + int s; + wait (&s); + s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_header_sys_wait_h=yes +else case e in @%:@( + e) ac_cv_header_sys_wait_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 +printf "%s\n" "$ac_cv_header_sys_wait_h" >&6; } +if test $ac_cv_header_sys_wait_h = yes; then + +printf "%s\n" "@%:@define HAVE_SYS_WAIT_H 1" >>confdefs.h + +fi + + + ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default +" +if test "x$ac_cv_type_pid_t" = xyes +then : + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_pid_type='int' +else case e in @%:@( + e) ac_pid_type='__int64' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +printf "%s\n" "@%:@define pid_t $ac_pid_type" >>confdefs.h + + ;; +esac +fi + + + + + + + +if test $ac_cv_func_sigprocmask = no; then + ac_fn_c_check_func "$LINENO" "sigblock" "ac_cv_func_sigblock" +if test "x$ac_cv_func_sigblock" = xyes +then : + printf "%s\n" "@%:@define HAVE_SIGBLOCK 1" >>confdefs.h + +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5 +printf %s "checking whether closedir returns void... " >&6; } +if test ${ac_cv_func_closedir_void+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <$ac_header_dirent> + +int +main (void) +{ + + return closedir(0); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_func_closedir_void=no +else case e in @%:@( + e) ac_cv_func_closedir_void=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_closedir_void" >&5 +printf "%s\n" "$ac_cv_func_closedir_void" >&6; } +if test $ac_cv_func_closedir_void = yes; then + +printf "%s\n" "@%:@define CLOSEDIR_VOID 1" >>confdefs.h + +fi + + + + + + +if test "x$ac_cv_func_fork" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 +printf %s "checking for working fork... " >&6; } +if test ${ac_cv_func_fork_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + ac_cv_func_fork_works=cross +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* By R. Kuhlmann. */ + return fork () < 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_fork_works=yes +else case e in @%:@( + e) ac_cv_func_fork_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 +printf "%s\n" "$ac_cv_func_fork_works" >&6; } + +else + ac_cv_func_fork_works=$ac_cv_func_fork +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 +printf %s "checking for working vfork... " >&6; } +if test ${ac_cv_func_vfork_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + ac_cv_func_vfork_works=cross +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Thanks to Paul Eggert for this test. */ +$ac_includes_default +#include +#include +#ifdef HAVE_VFORK_H +# include +#endif + +static void +do_nothing (int sig) +{ + (void) sig; +} + +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include , but some compilers + (e.g. gcc -O) don't grok . Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static void +sparc_address_test (int arg) +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} + +int +main (void) +{ + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (0); + + /* On Solaris 2.4, changes by the child to the signal handler + also munge signal handlers in the parent. To detect this, + start by putting the parent's handler in a known state. */ + signal (SIGTERM, SIG_DFL); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* Alter the child's signal handler. */ + if (signal (SIGTERM, do_nothing) != SIG_DFL) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + return ( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child munge the parent's signal handler? */ + || signal (SIGTERM, SIG_DFL) != SIG_DFL + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_vfork_works=yes +else case e in @%:@( + e) ac_cv_func_vfork_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 +printf "%s\n" "$ac_cv_func_vfork_works" >&6; } + +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=$ac_cv_func_vfork + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} +fi + +if test "x$ac_cv_func_vfork_works" = xyes; then + +printf "%s\n" "@%:@define HAVE_WORKING_VFORK 1" >>confdefs.h + +else + +printf "%s\n" "@%:@define vfork fork" >>confdefs.h + +fi +if test "x$ac_cv_func_fork_works" = xyes; then + +printf "%s\n" "@%:@define HAVE_WORKING_FORK 1" >>confdefs.h + +fi + + +# When .tarball-version exists, we're building from a tarball +# and must not make man/*.1 files depend on the generated src/version.c, +# because that would induce a requirement to run the help2man perl script. +# We are not yet prepared to make perl a build-from-tarball requirement. +# Hence, here we detect .tarball-version existence. When not present, +# we define a variable to be used in man/Makefile.am to induce the +# proper dependency (so that man/*.1 will be rebuilt upon any version change), +# but not when built from a tarball. + +test -f $srcdir/.tarball-version \ + && SRC_VERSION_C= \ + || SRC_VERSION_C=../src/version.c + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +printf %s "checking whether NLS is requested... " >&6; } + @%:@ Check whether --enable-nls was given. +if test ${enable_nls+y} +then : + enableval=$enable_nls; USE_NLS=$enableval +else case e in @%:@( + e) USE_NLS=yes ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$USE_NLS" >&6; } + + + + + GETTEXT_MACRO_VERSION=0.19 + + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MSGFMT+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) case "$MSGFMT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +printf "%s\n" "$MSGFMT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_GMSGFMT+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +printf "%s\n" "$GMSGFMT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; + *) MSGFMT_015=$MSGFMT ;; + esac + + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_XGETTEXT+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) case "$XGETTEXT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +printf "%s\n" "$XGETTEXT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + rm -f messages.po + + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MSGMERGE+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) case "$MSGMERGE" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" + ;; +esac ;; +esac +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 +printf "%s\n" "$MSGMERGE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$localedir" || localedir='${datadir}/locale' + + + test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + + + ac_config_commands="$ac_config_commands po-directories" + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 +printf %s "checking for CFPreferencesCopyAppValue... " >&6; } +if test ${gt_cv_func_CFPreferencesCopyAppValue+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +CFPreferencesCopyAppValue(NULL, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gt_cv_func_CFPreferencesCopyAppValue=yes +else case e in @%:@( + e) gt_cv_func_CFPreferencesCopyAppValue=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 +printf "%s\n" "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + +printf "%s\n" "@%:@define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 +printf %s "checking for CFLocaleCopyCurrent... " >&6; } +if test ${gt_cv_func_CFLocaleCopyCurrent+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +CFLocaleCopyCurrent(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gt_cv_func_CFLocaleCopyCurrent=yes +else case e in @%:@( + e) gt_cv_func_CFLocaleCopyCurrent=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 +printf "%s\n" "$gt_cv_func_CFLocaleCopyCurrent" >&6; } + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + +printf "%s\n" "@%:@define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h + + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + fi + + + + + + + LIBINTL= + LTLIBINTL= + POSUB= + + case " $gt_needs " in + *" need-formatstring-macros "*) gt_api_version=3 ;; + *" need-ngettext "*) gt_api_version=2 ;; + *) gt_api_version=1 ;; + esac + gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" + gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + + + if test $gt_api_version -ge 3; then + gt_revision_test_code=' +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +' + else + gt_revision_test_code= + fi + if test $gt_api_version -ge 2; then + gt_expression_test_code=' + * ngettext ("", "", 0)' + else + gt_expression_test_code= + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 +printf %s "checking for GNU gettext in libc... " >&6; } +if eval test \${$gt_func_gnugettext_libc+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$gt_func_gnugettext_libc=yes" +else case e in @%:@( + e) eval "$gt_func_gnugettext_libc=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$gt_func_gnugettext_libc + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +printf %s "checking for iconv... " >&6; } +if test ${am_cv_func_iconv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +printf "%s\n" "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +printf %s "checking for working iconv... " >&6; } +if test ${am_cv_func_iconv_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + if test "$cross_compiling" = yes +then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + +int +main (void) +{ +int result = 0; + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\263"; + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + result |= 8; + iconv_close (cd_88591_to_utf8); + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + result |= 16; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + am_cv_func_iconv_works=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + test "$am_cv_func_iconv_works" = no || break + done + LIBS="$am_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +printf "%s\n" "$am_cv_func_iconv_works" >&6; } + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + +printf "%s\n" "@%:@define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +printf %s "checking how to link with libiconv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +printf "%s\n" "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +@%:@ Check whether --with-libintl-prefix was given. +if test ${with_libintl_prefix+y} +then : + withval=$with_libintl_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBINTL= + LTLIBINTL= + INCINTL= + LIBINTL_PREFIX= + HAVE_LIBINTL= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='intl ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" + ;; + esac + done + fi + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" + done + fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 +printf %s "checking for GNU gettext in libintl... " >&6; } +if eval test \${$gt_func_gnugettext_libintl+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$gt_func_gnugettext_libintl=yes" +else case e in @%:@( + e) eval "$gt_func_gnugettext_libintl=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS" ;; +esac +fi +eval ac_res=\$$gt_func_gnugettext_libintl + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + fi + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ + || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + + + if test -n "$INTL_MACOSX_LIBS"; then + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" + LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" + fi + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + +printf "%s\n" "@%:@define ENABLE_NLS 1" >>confdefs.h + + else + USE_NLS=no + fi + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 +printf %s "checking whether to use NLS... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$USE_NLS" >&6; } + if test "$USE_NLS" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 +printf %s "checking where the gettext function comes from... " >&6; } + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 +printf "%s\n" "$gt_source" >&6; } + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 +printf %s "checking how to link with libintl... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 +printf "%s\n" "$LIBINTL" >&6; } + + for element in $INCINTL; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + fi + + +printf "%s\n" "@%:@define HAVE_GETTEXT 1" >>confdefs.h + + +printf "%s\n" "@%:@define HAVE_DCGETTEXT 1" >>confdefs.h + + fi + + POSUB=po + fi + + + + INTLLIBS="$LIBINTL" + + + + + + + +XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT" + +ac_config_files="$ac_config_files Makefile doc/Makefile lib/Makefile src/Makefile tests/Makefile gnulib-tests/Makefile man/Makefile po/Makefile.in" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # 'set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # 'set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; +esac +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +@%:@ Check whether --enable-year2038 was given. +if test ${enable_year2038+y} +then : + enableval=$enable_year2038; +fi + +if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then + as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +test "X$DEFS" = X-DHAVE_CONFIG_H && DEFS= +if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GNU_MAKE_TRUE}" && test -z "${GNU_MAKE_FALSE}"; then + as_fn_error $? "conditional \"GNU_MAKE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +CONFIG_INCLUDE=lib/config.h + +if test -z "${GL_GENERATE_STDARG_H_TRUE}" && test -z "${GL_GENERATE_STDARG_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDARG_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE}"; then + as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE}"; then + as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE}"; then + as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + + gl_libobjs= + gl_ltlibobjs= + if test -n "$gl_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do + gl_libobjs="$gl_libobjs $i.$ac_objext" + gl_ltlibobjs="$gl_ltlibobjs $i.lo" + done + fi + gl_LIBOBJS=$gl_libobjs + + gl_LTLIBOBJS=$gl_ltlibobjs + + + +if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_NETINET_IN_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + gltests_libobjs= + gltests_ltlibobjs= + if test -n "$gltests_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do + gltests_libobjs="$gltests_libobjs $i.$ac_objext" + gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" + done + fi + gltests_LIBOBJS=$gltests_libobjs + + gltests_LTLIBOBJS=$gltests_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else case e in @%:@( + e) case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as 'sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else case e in @%:@( + e) as_fn_append () + { + eval $1=\$$1\$2 + } ;; +esac +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else case e in @%:@( + e) as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } ;; +esac +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_@&t@echo='printf %s\n' +as_@&t@echo_n='printf %s' + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated + +# Sed expression to map a string onto a valid variable name. +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by GNU diffutils $as_me 3.6, which was +generated by GNU Autoconf 2.72. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_links="$ac_config_links" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +'$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration links: +$config_links + +Configuration commands: +$config_commands + +Report bugs to . +GNU diffutils home page: . +General help using GNU software: ." + +_ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config='$ac_cs_config_escaped' +ac_cs_version="\\ +GNU diffutils config.status 3.6 +configured by $0, generated by GNU Autoconf 2.72, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2023 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + printf "%s\n" "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + printf "%s\n" "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; + --help | --hel | -h ) + printf "%s\n" "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + printf "%s\n" "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" +GNUmakefile=$GNUmakefile +# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it + # from automake < 1.5. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "lib/config.h") CONFIG_HEADERS="$CONFIG_HEADERS lib/config.h:lib/config.hin" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "$GNUmakefile") CONFIG_LINKS="$CONFIG_LINKS $GNUmakefile:$GNUmakefile" ;; + "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "gnulib-tests/Makefile") CONFIG_FILES="$CONFIG_FILES gnulib-tests/Makefile" ;; + "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_LINKS+y} || CONFIG_LINKS=$config_links + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to '$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with './config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with './config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script 'defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain ':'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is 'configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`printf "%s\n" "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when '$srcdir' = '.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + :L) + # + # CONFIG_LINK + # + + if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then + : + else + # Prefer the file from the source tree if names are identical. + if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then + ac_source=$srcdir/$ac_source + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5 +printf "%s\n" "$as_me: linking $ac_source to $ac_file" >&6;} + + if test ! -r "$ac_source"; then + as_fn_error $? "$ac_source: file not found" "$LINENO" 5 + fi + rm -f "$ac_file" + + # Try a relative symlink, then a hard link, then a copy. + case $ac_source in + [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; + *) ac_rel_source=$ac_top_build_prefix$ac_source ;; + esac + ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || + ln "$ac_source" "$ac_file" 2>/dev/null || + cp -p "$ac_source" "$ac_file" || + as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5 + fi + ;; + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in @%:@( + *\'*) : + eval set x "$CONFIG_FILES" ;; @%:@( + *) : + set x $CONFIG_FILES ;; @%:@( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See 'config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + "po-directories":C) + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + # Treat a directory as a PO directory if and only if it has a + # POTFILES.in file. This allows packages to have multiple PO + # directories under different names or in different locations. + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/local/recipes/tools/diffutils/source/autom4te.cache/output.1 b/local/recipes/tools/diffutils/source/autom4te.cache/output.1 new file mode 100644 index 0000000000..e3b823c73b --- /dev/null +++ b/local/recipes/tools/diffutils/source/autom4te.cache/output.1 @@ -0,0 +1,43075 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.72 for GNU diffutils 3.6. +@%:@ +@%:@ Report bugs to . +@%:@ +@%:@ +@%:@ Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, +@%:@ Inc. +@%:@ +@%:@ +@%:@ This configure script is free software; the Free Software Foundation +@%:@ gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else case e in @%:@( + e) case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as 'sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed 'exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else case e in @%:@( + e) case \`(set -o) 2>/dev/null\` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : + +else case e in @%:@( + e) exitcode=1; echo positional parameters were not saved. ;; +esac +fi +test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null +then : + as_have_required=yes +else case e in @%:@( + e) as_have_required=no ;; +esac +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : + +else case e in @%:@( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + case $as_dir in @%:@( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$as_shell as_have_required=yes + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : + break 2 +fi +fi + done;; + esac + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else case e in @%:@( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi ;; +esac +fi + + + if test "x$CONFIG_SHELL" != x +then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed 'exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and +$0: bug-diffutils@gnu.org about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do have one." + fi + exit 1 +fi ;; +esac +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else case e in @%:@( + e) as_fn_append () + { + eval $1=\$$1\$2 + } ;; +esac +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else case e in @%:@( + e) as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } ;; +esac +fi # as_fn_arith + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + t clear + :clear + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_@&t@echo='printf %s\n' +as_@&t@echo_n='printf %s' + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated + +# Sed expression to map a string onto a valid variable name. +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='GNU diffutils' +PACKAGE_TARNAME='diffutils' +PACKAGE_VERSION='3.6' +PACKAGE_STRING='GNU diffutils 3.6' +PACKAGE_BUGREPORT='bug-diffutils@gnu.org' +PACKAGE_URL='https://www.gnu.org/software/diffutils/' + +ac_unique_file="src/diff.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_STDIO_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_c_list= +ac_func_c_list= +gl_fnmatch_required=POSIX +gl_getopt_required=POSIX +gt_needs= +enable_year2038=no +ac_subst_vars='gltests_LTLIBOBJS +gltests_LIBOBJS +gl_LTLIBOBJS +gl_LIBOBJS +CONFIG_INCLUDE +am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIB@&t@OBJS +POSUB +INTLLIBS +INTL_MACOSX_LIBS +XGETTEXT_EXTRA_OPTIONS +MSGMERGE +XGETTEXT_015 +XGETTEXT +GMSGFMT_015 +MSGFMT_015 +GMSGFMT +MSGFMT +GETTEXT_MACRO_VERSION +USE_NLS +SRC_VERSION_C +PR_PROGRAM +GNULIB_WARN_CFLAGS +WARN_CFLAGS +WERROR_CFLAGS +LIBTESTS_LIBDEPS +LIBDIFFUTILS_LTLIBDEPS +LIBDIFFUTILS_LIBDEPS +abs_aux_dir +HAVE_SYS_UIO_H +NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H +NEXT_SYS_UIO_H +NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H +NEXT_SYS_IOCTL_H +HAVE_SYS_IOCTL_H +GL_GENERATE_STDALIGN_H_FALSE +GL_GENERATE_STDALIGN_H_TRUE +STDALIGN_H +GL_GENERATE_NETINET_IN_H_FALSE +GL_GENERATE_NETINET_IN_H_TRUE +NETINET_IN_H +HAVE_NETINET_IN_H +NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H +NEXT_NETINET_IN_H +LIB_NANOSLEEP +LIB_SELECT +LIBSOCKET +HAVE_SYS_SELECT_H +NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H +NEXT_SYS_SELECT_H +REPLACE_SELECT +REPLACE_PSELECT +HAVE_PSELECT +GNULIB_SELECT +GNULIB_PSELECT +INET_PTON_LIB +LOCALE_TR_UTF8 +NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H +NEXT_ARPA_INET_H +HAVE_ARPA_INET_H +REPLACE_INET_PTON +REPLACE_INET_NTOP +HAVE_DECL_INET_PTON +HAVE_DECL_INET_NTOP +GNULIB_INET_PTON +GNULIB_INET_NTOP +HAVE_WS2TCPIP_H +HAVE_SYS_SOCKET_H +NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H +NEXT_SYS_SOCKET_H +HAVE_ACCEPT4 +HAVE_SA_FAMILY_T +HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY +HAVE_STRUCT_SOCKADDR_STORAGE +GNULIB_ACCEPT4 +GNULIB_SHUTDOWN +GNULIB_SETSOCKOPT +GNULIB_SENDTO +GNULIB_RECVFROM +GNULIB_SEND +GNULIB_RECV +GNULIB_LISTEN +GNULIB_GETSOCKOPT +GNULIB_GETSOCKNAME +GNULIB_GETPEERNAME +GNULIB_BIND +GNULIB_ACCEPT +GNULIB_CONNECT +GNULIB_SOCKET +gltests_WITNESS +NEXT_AS_FIRST_DIRECTIVE_WCHAR_H +NEXT_WCHAR_H +HAVE_FEATURES_H +LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE +LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE +LIBUNISTRING_UNIWIDTH_H +LIBUNISTRING_UNITYPES_H +LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE +LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE +LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE +LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE +LIBUNISTRING_UNISTR_H +HAVE_UNISTD_H +NEXT_AS_FIRST_DIRECTIVE_UNISTD_H +NEXT_UNISTD_H +UNISTD_H_DEFINES_STRUCT_TIMESPEC +PTHREAD_H_DEFINES_STRUCT_TIMESPEC +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC +TIME_H_DEFINES_STRUCT_TIMESPEC +NEXT_AS_FIRST_DIRECTIVE_TIME_H +NEXT_TIME_H +NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H +NEXT_SYS_WAIT_H +GNULIB_WAITPID +WINDOWS_STAT_INODES +WINDOWS_64_BIT_OFF_T +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H +NEXT_SYS_TYPES_H +HAVE_STRINGS_H +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H +NEXT_STRINGS_H +NEXT_AS_FIRST_DIRECTIVE_STRING_H +NEXT_STRING_H +HAVE_DECL_STRNCASECMP +HAVE_STRCASECMP +HAVE_FFS +GNULIB_FFS +NEXT_AS_FIRST_DIRECTIVE_STDLIB_H +NEXT_STDLIB_H +NEXT_AS_FIRST_DIRECTIVE_STDIO_H +NEXT_STDIO_H +HAVE__BOOL +GL_GENERATE_STDBOOL_H_FALSE +GL_GENERATE_STDBOOL_H_TRUE +STDBOOL_H +GL_GENERATE_STDARG_H_FALSE +GL_GENERATE_STDARG_H_TRUE +STDARG_H +NEXT_AS_FIRST_DIRECTIVE_STDARG_H +NEXT_STDARG_H +NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H +NEXT_SIGNAL_H +REPLACE_RAISE +REPLACE_PTHREAD_SIGMASK +HAVE_SIGHANDLER_T +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T +HAVE_STRUCT_SIGACTION_SA_SIGACTION +HAVE_SIGACTION +HAVE_SIGINFO_T +HAVE_SIGSET_T +HAVE_RAISE +HAVE_PTHREAD_SIGMASK +HAVE_POSIX_SIGNALBLOCKING +GNULIB_SIGACTION +GNULIB_SIGPROCMASK +GNULIB_SIGNAL_H_SIGPIPE +GNULIB_RAISE +GNULIB_PTHREAD_SIGMASK +UNDEFINE_STRTOK_R +REPLACE_STRTOK_R +REPLACE_STRSIGNAL +REPLACE_STRNLEN +REPLACE_STRNDUP +REPLACE_STRNCAT +REPLACE_STRERROR_R +REPLACE_STRERROR +REPLACE_STRCHRNUL +REPLACE_STRCASESTR +REPLACE_STRSTR +REPLACE_STRDUP +REPLACE_STPNCPY +REPLACE_MEMMEM +REPLACE_MEMCHR +HAVE_STRVERSCMP +HAVE_DECL_STRSIGNAL +HAVE_DECL_STRERROR_R +HAVE_DECL_STRTOK_R +HAVE_STRCASESTR +HAVE_STRSEP +HAVE_STRPBRK +HAVE_DECL_STRNLEN +HAVE_DECL_STRNDUP +HAVE_DECL_STRDUP +HAVE_STRCHRNUL +HAVE_STPNCPY +HAVE_STPCPY +HAVE_RAWMEMCHR +HAVE_DECL_MEMRCHR +HAVE_MEMPCPY +HAVE_DECL_MEMMEM +HAVE_MEMCHR +HAVE_FFSLL +HAVE_FFSL +HAVE_MBSLEN +GNULIB_STRVERSCMP +GNULIB_STRSIGNAL +GNULIB_STRERROR_R +GNULIB_STRERROR +GNULIB_MBSTOK_R +GNULIB_MBSSEP +GNULIB_MBSSPN +GNULIB_MBSPBRK +GNULIB_MBSCSPN +GNULIB_MBSCASESTR +GNULIB_MBSPCASECMP +GNULIB_MBSNCASECMP +GNULIB_MBSCASECMP +GNULIB_MBSSTR +GNULIB_MBSRCHR +GNULIB_MBSCHR +GNULIB_MBSNLEN +GNULIB_MBSLEN +GNULIB_STRTOK_R +GNULIB_STRCASESTR +GNULIB_STRSTR +GNULIB_STRSEP +GNULIB_STRPBRK +GNULIB_STRNLEN +GNULIB_STRNDUP +GNULIB_STRNCAT +GNULIB_STRDUP +GNULIB_STRCHRNUL +GNULIB_STPNCPY +GNULIB_STPCPY +GNULIB_RAWMEMCHR +GNULIB_MEMRCHR +GNULIB_MEMPCPY +GNULIB_MEMMEM +GNULIB_MEMCHR +GNULIB_FFSLL +GNULIB_FFSL +LOCALE_FR_UTF8 +LOCALE_ZH_CN +LOCALE_JA +REPLACE_WCTOMB +REPLACE_UNSETENV +REPLACE_STRTOD +REPLACE_SETENV +REPLACE_REALPATH +REPLACE_REALLOC +REPLACE_RANDOM_R +REPLACE_QSORT_R +REPLACE_PUTENV +REPLACE_PTSNAME_R +REPLACE_PTSNAME +REPLACE_MKSTEMP +REPLACE_MBTOWC +REPLACE_MALLOC +REPLACE_CANONICALIZE_FILE_NAME +REPLACE_CALLOC +HAVE_DECL_UNSETENV +HAVE_UNLOCKPT +HAVE_SYS_LOADAVG_H +HAVE_STRUCT_RANDOM_DATA +HAVE_STRTOULL +HAVE_STRTOLL +HAVE_STRTOD +HAVE_DECL_SETENV +HAVE_SETENV +HAVE_SECURE_GETENV +HAVE_RPMATCH +HAVE_REALPATH +HAVE_RANDOM_R +HAVE_RANDOM_H +HAVE_RANDOM +HAVE_QSORT_R +HAVE_PTSNAME_R +HAVE_PTSNAME +HAVE_POSIX_OPENPT +HAVE_MKSTEMPS +HAVE_MKSTEMP +HAVE_MKOSTEMPS +HAVE_MKOSTEMP +HAVE_MKDTEMP +HAVE_GRANTPT +HAVE_GETSUBOPT +HAVE_DECL_GETLOADAVG +HAVE_CANONICALIZE_FILE_NAME +HAVE_ATOLL +HAVE__EXIT +GNULIB_WCTOMB +GNULIB_UNSETENV +GNULIB_UNLOCKPT +GNULIB_SYSTEM_POSIX +GNULIB_STRTOULL +GNULIB_STRTOLL +GNULIB_STRTOD +GNULIB_SETENV +GNULIB_SECURE_GETENV +GNULIB_RPMATCH +GNULIB_REALPATH +GNULIB_REALLOC_POSIX +GNULIB_RANDOM_R +GNULIB_RANDOM +GNULIB_QSORT_R +GNULIB_PUTENV +GNULIB_PTSNAME_R +GNULIB_PTSNAME +GNULIB_POSIX_OPENPT +GNULIB_MKSTEMPS +GNULIB_MKSTEMP +GNULIB_MKOSTEMPS +GNULIB_MKOSTEMP +GNULIB_MKDTEMP +GNULIB_MBTOWC +GNULIB_MALLOC_POSIX +GNULIB_GRANTPT +GNULIB_GETSUBOPT +GNULIB_GETLOADAVG +GNULIB_CANONICALIZE_FILE_NAME +GNULIB_CALLOC_POSIX +GNULIB_ATOLL +GNULIB__EXIT +SED +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H +NEXT_LOCALE_H +HAVE_XLOCALE_H +NEXT_AS_FIRST_DIRECTIVE_STDDEF_H +NEXT_STDDEF_H +GL_GENERATE_STDDEF_H_FALSE +GL_GENERATE_STDDEF_H_TRUE +STDDEF_H +HAVE_WCHAR_T +HAVE_MAX_ALIGN_T +REPLACE_NULL +REPLACE_STRUCT_LCONV +REPLACE_DUPLOCALE +REPLACE_SETLOCALE +REPLACE_LOCALECONV +HAVE_DUPLOCALE +GNULIB_DUPLOCALE +GNULIB_SETLOCALE +GNULIB_LOCALECONV +LOCALCHARSET_TESTS_ENVIRONMENT +GLIBC21 +HAVE_LANGINFO_YESEXPR +HAVE_LANGINFO_ERA +HAVE_LANGINFO_T_FMT_AMPM +HAVE_LANGINFO_CODESET +HAVE_LANGINFO_H +NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H +NEXT_LANGINFO_H +REPLACE_NL_LANGINFO +HAVE_NL_LANGINFO +GNULIB_NL_LANGINFO +REPLACE_TOWLOWER +REPLACE_ISWCNTRL +HAVE_WCTYPE_H +NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H +NEXT_WCTYPE_H +HAVE_CRTDEFS_H +HAVE_WINT_T +HAVE_ISWCNTRL +REPLACE_ISWBLANK +HAVE_WCTRANS_T +HAVE_WCTYPE_T +HAVE_ISWBLANK +GNULIB_TOWCTRANS +GNULIB_WCTRANS +GNULIB_ISWCTYPE +GNULIB_WCTYPE +GNULIB_ISWBLANK +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H +NEXT_INTTYPES_H +UINT64_MAX_EQ_ULONG_MAX +UINT32_MAX_LT_UINTMAX_MAX +PRIPTR_PREFIX +PRI_MACROS_BROKEN +INT64_MAX_EQ_LONG_MAX +INT32_MAX_LT_INTMAX_MAX +REPLACE_STRTOUMAX +REPLACE_STRTOIMAX +HAVE_DECL_STRTOUMAX +HAVE_DECL_STRTOIMAX +HAVE_DECL_IMAXDIV +HAVE_DECL_IMAXABS +GNULIB_STRTOUMAX +GNULIB_STRTOIMAX +GNULIB_IMAXDIV +GNULIB_IMAXABS +GL_GENERATE_STDINT_H_FALSE +GL_GENERATE_STDINT_H_TRUE +STDINT_H +HAVE_SYS_INTTYPES_H +HAVE_SYS_BITYPES_H +HAVE_C99_STDINT_H +WINT_T_SUFFIX +WCHAR_T_SUFFIX +SIG_ATOMIC_T_SUFFIX +SIZE_T_SUFFIX +PTRDIFF_T_SUFFIX +HAVE_SIGNED_WINT_T +HAVE_SIGNED_WCHAR_T +HAVE_SIGNED_SIG_ATOMIC_T +BITSIZEOF_WINT_T +BITSIZEOF_WCHAR_T +BITSIZEOF_SIG_ATOMIC_T +BITSIZEOF_SIZE_T +BITSIZEOF_PTRDIFF_T +APPLE_UNIVERSAL_BUILD +HAVE_STDINT_H +NEXT_AS_FIRST_DIRECTIVE_STDINT_H +NEXT_STDINT_H +HAVE_SYS_TYPES_H +HAVE_INTTYPES_H +HAVE_WCHAR_H +HAVE_UNSIGNED_LONG_LONG_INT +HAVE_LONG_LONG_INT +GNULIB_OVERRIDES_WINT_T +GL_GENERATE_LIMITS_H_FALSE +GL_GENERATE_LIMITS_H_TRUE +LIMITS_H +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H +NEXT_LIMITS_H +NEXT_AS_FIRST_DIRECTIVE_ICONV_H +NEXT_ICONV_H +GL_GENERATE_ICONV_H_FALSE +GL_GENERATE_ICONV_H_TRUE +ICONV_H +REPLACE_ICONV_UTF +REPLACE_ICONV_OPEN +REPLACE_ICONV +ICONV_CONST +GNULIB_ICONV +LTLIBICONV +LIBICONV +GNU_MAKE_FALSE +GNU_MAKE_TRUE +REPLACE_LOCALTIME +REPLACE_GMTIME +REPLACE_TZSET +REPLACE_TIMEGM +REPLACE_STRFTIME +REPLACE_NANOSLEEP +REPLACE_MKTIME +REPLACE_LOCALTIME_R +REPLACE_CTIME +HAVE_TIMEZONE_T +HAVE_TZSET +HAVE_TIMEGM +HAVE_STRPTIME +HAVE_NANOSLEEP +HAVE_DECL_LOCALTIME_R +GNULIB_TZSET +GNULIB_TIME_RZ +GNULIB_TIME_R +GNULIB_TIMEGM +GNULIB_STRPTIME +GNULIB_STRFTIME +GNULIB_NANOSLEEP +GNULIB_LOCALTIME +GNULIB_MKTIME +GNULIB_CTIME +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H +NEXT_SYS_TIME_H +REPLACE_STRUCT_TIMEVAL +REPLACE_GETTIMEOFDAY +HAVE_SYS_TIME_H +HAVE_STRUCT_TIMEVAL +HAVE_GETTIMEOFDAY +GNULIB_GETTIMEOFDAY +LTLIBINTL +LIBINTL +GNULIB_GL_UNISTD_H_GETOPT +GETOPT_CDEFS_H +GETOPT_H +HAVE_SYS_CDEFS_H +HAVE_GETOPT_H +NEXT_AS_FIRST_DIRECTIVE_GETOPT_H +NEXT_GETOPT_H +WINDOWS_64_BIT_ST_SIZE +WINDOWS_STAT_TIMESPEC +NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H +NEXT_SYS_STAT_H +REPLACE_UTIMENSAT +REPLACE_STAT +REPLACE_MKNOD +REPLACE_MKFIFO +REPLACE_MKDIR +REPLACE_LSTAT +REPLACE_FUTIMENS +REPLACE_FSTATAT +REPLACE_FSTAT +HAVE_UTIMENSAT +HAVE_MKNODAT +HAVE_MKNOD +HAVE_MKFIFOAT +HAVE_MKFIFO +HAVE_MKDIRAT +HAVE_LSTAT +HAVE_LCHMOD +HAVE_FUTIMENS +HAVE_FSTATAT +HAVE_FCHMODAT +GNULIB_OVERRIDES_STRUCT_STAT +GNULIB_UTIMENSAT +GNULIB_STAT +GNULIB_MKNODAT +GNULIB_MKNOD +GNULIB_MKFIFOAT +GNULIB_MKFIFO +GNULIB_MKDIRAT +GNULIB_LSTAT +GNULIB_LCHMOD +GNULIB_FUTIMENS +GNULIB_FSTATAT +GNULIB_FSTAT +GNULIB_FCHMODAT +REPLACE_VSPRINTF +REPLACE_VSNPRINTF +REPLACE_VPRINTF +REPLACE_VFPRINTF +REPLACE_VDPRINTF +REPLACE_VASPRINTF +REPLACE_TMPFILE +REPLACE_STDIO_WRITE_FUNCS +REPLACE_STDIO_READ_FUNCS +REPLACE_SPRINTF +REPLACE_SNPRINTF +REPLACE_RENAMEAT +REPLACE_RENAME +REPLACE_REMOVE +REPLACE_PRINTF +REPLACE_POPEN +REPLACE_PERROR +REPLACE_OBSTACK_PRINTF +REPLACE_GETLINE +REPLACE_GETDELIM +REPLACE_FTELLO +REPLACE_FTELL +REPLACE_FSEEKO +REPLACE_FSEEK +REPLACE_FREOPEN +REPLACE_FPURGE +REPLACE_FPRINTF +REPLACE_FOPEN +REPLACE_FFLUSH +REPLACE_FDOPEN +REPLACE_FCLOSE +REPLACE_DPRINTF +HAVE_VDPRINTF +HAVE_VASPRINTF +HAVE_RENAMEAT +HAVE_POPEN +HAVE_PCLOSE +HAVE_FTELLO +HAVE_FSEEKO +HAVE_DPRINTF +HAVE_DECL_VSNPRINTF +HAVE_DECL_SNPRINTF +HAVE_DECL_OBSTACK_PRINTF +HAVE_DECL_GETLINE +HAVE_DECL_GETDELIM +HAVE_DECL_FTELLO +HAVE_DECL_FSEEKO +HAVE_DECL_FPURGE +GNULIB_VSPRINTF_POSIX +GNULIB_VSNPRINTF +GNULIB_VPRINTF_POSIX +GNULIB_VPRINTF +GNULIB_VFPRINTF_POSIX +GNULIB_VFPRINTF +GNULIB_VDPRINTF +GNULIB_VSCANF +GNULIB_VFSCANF +GNULIB_VASPRINTF +GNULIB_TMPFILE +GNULIB_STDIO_H_SIGPIPE +GNULIB_STDIO_H_NONBLOCKING +GNULIB_SPRINTF_POSIX +GNULIB_SNPRINTF +GNULIB_SCANF +GNULIB_RENAMEAT +GNULIB_RENAME +GNULIB_REMOVE +GNULIB_PUTS +GNULIB_PUTCHAR +GNULIB_PUTC +GNULIB_PRINTF_POSIX +GNULIB_PRINTF +GNULIB_POPEN +GNULIB_PERROR +GNULIB_PCLOSE +GNULIB_OBSTACK_PRINTF_POSIX +GNULIB_OBSTACK_PRINTF +GNULIB_GETLINE +GNULIB_GETDELIM +GNULIB_GETCHAR +GNULIB_GETC +GNULIB_FWRITE +GNULIB_FTELLO +GNULIB_FTELL +GNULIB_FSEEKO +GNULIB_FSEEK +GNULIB_FSCANF +GNULIB_FREOPEN +GNULIB_FREAD +GNULIB_FPUTS +GNULIB_FPUTC +GNULIB_FPURGE +GNULIB_FPRINTF_POSIX +GNULIB_FPRINTF +GNULIB_FOPEN +GNULIB_FGETS +GNULIB_FGETC +GNULIB_FFLUSH +GNULIB_FDOPEN +GNULIB_FCLOSE +GNULIB_DPRINTF +GL_GENERATE_FNMATCH_H_FALSE +GL_GENERATE_FNMATCH_H_TRUE +FNMATCH_H +REPLACE_ITOLD +GL_GENERATE_FLOAT_H_FALSE +GL_GENERATE_FLOAT_H_TRUE +FLOAT_H +NEXT_AS_FIRST_DIRECTIVE_FLOAT_H +NEXT_FLOAT_H +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H +NEXT_FCNTL_H +REPLACE_OPENAT +REPLACE_OPEN +REPLACE_FCNTL +HAVE_OPENAT +HAVE_FCNTL +GNULIB_OPENAT +GNULIB_OPEN +GNULIB_NONBLOCKING +GNULIB_FCNTL +EOVERFLOW_VALUE +EOVERFLOW_HIDDEN +ENOLINK_VALUE +ENOLINK_HIDDEN +EMULTIHOP_VALUE +EMULTIHOP_HIDDEN +GL_GENERATE_ERRNO_H_FALSE +GL_GENERATE_ERRNO_H_TRUE +ERRNO_H +NEXT_AS_FIRST_DIRECTIVE_ERRNO_H +NEXT_ERRNO_H +NEXT_AS_FIRST_DIRECTIVE_CTYPE_H +NEXT_CTYPE_H +PRAGMA_COLUMNS +PRAGMA_SYSTEM_HEADER +INCLUDE_NEXT_AS_FIRST_DIRECTIVE +INCLUDE_NEXT +HAVE_ISBLANK +GNULIB_ISBLANK +pkglibexecdir +lispdir +HAVE_WINSOCK2_H +REPLACE_IOCTL +SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS +SYS_IOCTL_H_HAVE_WINSOCK2_H +GNULIB_IOCTL +HAVE_MSVC_INVALID_PARAMETER_HANDLER +UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS +UNISTD_H_HAVE_WINSOCK2_H +REPLACE_WRITE +REPLACE_USLEEP +REPLACE_UNLINKAT +REPLACE_UNLINK +REPLACE_TTYNAME_R +REPLACE_TRUNCATE +REPLACE_SYMLINKAT +REPLACE_SYMLINK +REPLACE_SLEEP +REPLACE_RMDIR +REPLACE_READLINKAT +REPLACE_READLINK +REPLACE_READ +REPLACE_PWRITE +REPLACE_PREAD +REPLACE_LSEEK +REPLACE_LINKAT +REPLACE_LINK +REPLACE_LCHOWN +REPLACE_ISATTY +REPLACE_GETPAGESIZE +REPLACE_GETGROUPS +REPLACE_GETLOGIN_R +REPLACE_GETDTABLESIZE +REPLACE_GETDOMAINNAME +REPLACE_GETCWD +REPLACE_FTRUNCATE +REPLACE_FCHOWNAT +REPLACE_DUP2 +REPLACE_DUP +REPLACE_CLOSE +REPLACE_CHOWN +HAVE_SYS_PARAM_H +HAVE_OS_H +HAVE_DECL_TTYNAME_R +HAVE_DECL_SETHOSTNAME +HAVE_DECL_GETUSERSHELL +HAVE_DECL_GETPAGESIZE +HAVE_DECL_GETLOGIN_R +HAVE_DECL_GETLOGIN +HAVE_DECL_GETDOMAINNAME +HAVE_DECL_FDATASYNC +HAVE_DECL_FCHDIR +HAVE_DECL_ENVIRON +HAVE_USLEEP +HAVE_UNLINKAT +HAVE_TRUNCATE +HAVE_SYMLINKAT +HAVE_SYMLINK +HAVE_SLEEP +HAVE_SETHOSTNAME +HAVE_READLINKAT +HAVE_READLINK +HAVE_PWRITE +HAVE_PREAD +HAVE_PIPE2 +HAVE_PIPE +HAVE_LINKAT +HAVE_LINK +HAVE_LCHOWN +HAVE_GROUP_MEMBER +HAVE_GETPAGESIZE +HAVE_GETLOGIN +HAVE_GETHOSTNAME +HAVE_GETGROUPS +HAVE_GETDTABLESIZE +HAVE_FTRUNCATE +HAVE_FSYNC +HAVE_FDATASYNC +HAVE_FCHOWNAT +HAVE_FCHDIR +HAVE_FACCESSAT +HAVE_EUIDACCESS +HAVE_DUP3 +HAVE_DUP2 +HAVE_CHOWN +GNULIB_WRITE +GNULIB_USLEEP +GNULIB_UNLINKAT +GNULIB_UNLINK +GNULIB_UNISTD_H_SIGPIPE +GNULIB_UNISTD_H_NONBLOCKING +GNULIB_TTYNAME_R +GNULIB_TRUNCATE +GNULIB_SYMLINKAT +GNULIB_SYMLINK +GNULIB_SLEEP +GNULIB_SETHOSTNAME +GNULIB_RMDIR +GNULIB_READLINKAT +GNULIB_READLINK +GNULIB_READ +GNULIB_PWRITE +GNULIB_PREAD +GNULIB_PIPE2 +GNULIB_PIPE +GNULIB_LSEEK +GNULIB_LINKAT +GNULIB_LINK +GNULIB_LCHOWN +GNULIB_ISATTY +GNULIB_GROUP_MEMBER +GNULIB_GETUSERSHELL +GNULIB_GETPAGESIZE +GNULIB_GETLOGIN_R +GNULIB_GETLOGIN +GNULIB_GETHOSTNAME +GNULIB_GETGROUPS +GNULIB_GETDTABLESIZE +GNULIB_GETDOMAINNAME +GNULIB_GETCWD +GNULIB_FTRUNCATE +GNULIB_FSYNC +GNULIB_FDATASYNC +GNULIB_FCHOWNAT +GNULIB_FCHDIR +GNULIB_FACCESSAT +GNULIB_EUIDACCESS +GNULIB_ENVIRON +GNULIB_DUP3 +GNULIB_DUP2 +GNULIB_DUP +GNULIB_CLOSE +GNULIB_CHOWN +GNULIB_CHDIR +LIB_CLOCK_GETTIME +LTLIBCSTACK +LIBCSTACK +LIBSIGSEGV_PREFIX +LTLIBSIGSEGV +LIBSIGSEGV +HAVE_LIBSIGSEGV +LOCALE_FR +REPLACE_WCSFTIME +REPLACE_WCSWIDTH +REPLACE_WCWIDTH +REPLACE_WCSNRTOMBS +REPLACE_WCSRTOMBS +REPLACE_WCRTOMB +REPLACE_MBSNRTOWCS +REPLACE_MBSRTOWCS +REPLACE_MBRLEN +REPLACE_MBRTOWC +REPLACE_MBSINIT +REPLACE_WCTOB +REPLACE_BTOWC +REPLACE_MBSTATE_T +HAVE_DECL_WCWIDTH +HAVE_DECL_WCTOB +HAVE_WCSFTIME +HAVE_WCSWIDTH +HAVE_WCSTOK +HAVE_WCSSTR +HAVE_WCSPBRK +HAVE_WCSSPN +HAVE_WCSCSPN +HAVE_WCSRCHR +HAVE_WCSCHR +HAVE_WCSDUP +HAVE_WCSXFRM +HAVE_WCSCOLL +HAVE_WCSNCASECMP +HAVE_WCSCASECMP +HAVE_WCSNCMP +HAVE_WCSCMP +HAVE_WCSNCAT +HAVE_WCSCAT +HAVE_WCPNCPY +HAVE_WCSNCPY +HAVE_WCPCPY +HAVE_WCSCPY +HAVE_WCSNLEN +HAVE_WCSLEN +HAVE_WMEMSET +HAVE_WMEMMOVE +HAVE_WMEMCPY +HAVE_WMEMCMP +HAVE_WMEMCHR +HAVE_WCSNRTOMBS +HAVE_WCSRTOMBS +HAVE_WCRTOMB +HAVE_MBSNRTOWCS +HAVE_MBSRTOWCS +HAVE_MBRLEN +HAVE_MBRTOWC +HAVE_MBSINIT +HAVE_BTOWC +GNULIB_WCSFTIME +GNULIB_WCSWIDTH +GNULIB_WCSTOK +GNULIB_WCSSTR +GNULIB_WCSPBRK +GNULIB_WCSSPN +GNULIB_WCSCSPN +GNULIB_WCSRCHR +GNULIB_WCSCHR +GNULIB_WCSDUP +GNULIB_WCSXFRM +GNULIB_WCSCOLL +GNULIB_WCSNCASECMP +GNULIB_WCSCASECMP +GNULIB_WCSNCMP +GNULIB_WCSCMP +GNULIB_WCSNCAT +GNULIB_WCSCAT +GNULIB_WCPNCPY +GNULIB_WCSNCPY +GNULIB_WCPCPY +GNULIB_WCSCPY +GNULIB_WCSNLEN +GNULIB_WCSLEN +GNULIB_WMEMSET +GNULIB_WMEMMOVE +GNULIB_WMEMCPY +GNULIB_WMEMCMP +GNULIB_WMEMCHR +GNULIB_WCWIDTH +GNULIB_WCSNRTOMBS +GNULIB_WCSRTOMBS +GNULIB_WCRTOMB +GNULIB_MBSNRTOWCS +GNULIB_MBSRTOWCS +GNULIB_MBRLEN +GNULIB_MBRTOWC +GNULIB_MBSINIT +GNULIB_WCTOB +GNULIB_BTOWC +GL_GENERATE_ALLOCA_H_FALSE +GL_GENERATE_ALLOCA_H_TRUE +ALLOCA_H +ALLOCA +GL_COND_LIBTOOL_FALSE +GL_COND_LIBTOOL_TRUE +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +ARFLAGS +AR +CPP +RANLIB +HELP2MAN +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__xargs_n +am__rm_f_notfound +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +CSCOPE +ETAGS +CTAGS +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +enable_largefile +with_gnu_ld +enable_rpath +with_libsigsegv_prefix +with_libiconv_prefix +with_included_regex +with_packager +with_packager_version +with_packager_bug_reports +enable_gcc_warnings +enable_nls +with_libintl_prefix +enable_year2038 +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: '$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +'configure' configures GNU diffutils 3.6 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print 'checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for '--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or '..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + @<:@@S|@ac_default_prefix@:>@ + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + @<:@PREFIX@:>@ + +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/diffutils@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of GNU diffutils 3.6:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --disable-largefile omit support for large files + --disable-rpath do not hardcode runtime library paths + --enable-gcc-warnings turn on lots of GCC warnings (for developers) + --disable-nls do not use Native Language Support + --enable-year2038 support timestamps after 2038 + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ + --with-libsigsegv-prefix[=DIR] search for libsigsegv in DIR/include and DIR/lib + --without-libsigsegv-prefix don't search for libsigsegv in includedir and libdir + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib + --without-libiconv-prefix don't search for libiconv in includedir and libdir + --without-included-regex + don't compile regex; this is the default on systems + with recent-enough versions of the GNU C Library + (use with caution on other systems). + --with-packager String identifying the packager of this software + --with-packager-version Packager-specific version information + --with-packager-bug-reports + Packager info for bug reports (URL/e-mail/...) + --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib + --without-libintl-prefix don't search for libintl in includedir and libdir + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by 'configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +GNU diffutils home page: . +General help using GNU software: . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +GNU diffutils configure 3.6 +generated by GNU Autoconf 2.72 + +Copyright (C) 2023 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +@%:@ ac_fn_c_try_compile LINENO +@%:@ -------------------------- +@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else case e in @%:@( + e) printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_compile + +@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists and can be compiled using the include files in +@%:@ INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else case e in @%:@( + e) eval "$3=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_header_compile + +@%:@ ac_fn_c_try_cpp LINENO +@%:@ ---------------------- +@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else case e in @%:@( + e) printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_cpp + +@%:@ ac_fn_c_check_type LINENO TYPE VAR INCLUDES +@%:@ ------------------------------------------- +@%:@ Tests whether TYPE exists after having included INCLUDES, setting cache +@%:@ variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in @%:@( + e) eval "$3=yes" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_type + +@%:@ ac_fn_c_try_link LINENO +@%:@ ----------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else case e in @%:@( + e) printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_link + +@%:@ ac_fn_c_try_run LINENO +@%:@ ---------------------- +@%:@ Try to run conftest.@S|@ac_ext, and return whether this succeeded. Assumes that +@%:@ executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else case e in @%:@( + e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status ;; +esac +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_run + +@%:@ ac_fn_c_check_func LINENO FUNC VAR +@%:@ ---------------------------------- +@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (void); below. */ + +#include +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (void); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main (void) +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$3=yes" +else case e in @%:@( + e) eval "$3=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_func + +@%:@ ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +@%:@ ------------------------------------------------------------------ +@%:@ Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +@%:@ accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else case e in @%:@( + e) eval "$3=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_check_decl + +@%:@ ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +@%:@ -------------------------------------------- +@%:@ Tries to find the compile-time value of EXPR in a program that includes +@%:@ INCLUDES, setting VAR accordingly. Returns whether the value could be +@%:@ computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array @<:@1 - 2 * !(($2) >= 0)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array @<:@1 - 2 * !(($2) <= $ac_mid)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid; break +else case e in @%:@( + e) as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array @<:@1 - 2 * !(($2) < 0)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array @<:@1 - 2 * !(($2) >= $ac_mid)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=$ac_mid; break +else case e in @%:@( + e) as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else case e in @%:@( + e) ac_lo= ac_hi= ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array @<:@1 - 2 * !(($2) <= $ac_mid)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid +else case e in @%:@( + e) as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +done +case $ac_lo in @%:@(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval (void) { return $2; } +static unsigned long int ulongval (void) { return $2; } +@%:@include +@%:@include +int +main (void) +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + echo >>conftest.val; read $3 &5 +printf %s "checking for $2.$3... " >&6; } +if eval test \${$4+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$4=yes" +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$4=yes" +else case e in @%:@( + e) eval "$4=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$4 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_member +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?@<:@ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by GNU diffutils $as_me 3.6, which was +generated by GNU Autoconf 2.72. Invocation command line was + + $ $0$ac_configure_args_raw + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + { + echo + + printf "%s\n" "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + printf "%s\n" "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + printf "%s\n" "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + printf "%s\n" "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +printf "%s\n" "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +printf "%s\n" "@%:@define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +printf "%s\n" "@%:@define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +printf "%s\n" "@%:@define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +printf "%s\n" "@%:@define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +printf "%s\n" "@%:@define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +printf "%s\n" "@%:@define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + ac_site_files="$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" +else + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +fi + +for ac_site_file in $ac_site_files +do + case $ac_site_file in @%:@( + */*) : + ;; @%:@( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See 'config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif + +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (char **p, int i) +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +/* Does the compiler advertise C99 conformance? */ +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +// See if C++-style comments work. + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); +extern void free (void *); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +/* Does the compiler advertise C11 conformance? */ +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +as_fn_append ac_func_c_list " btowc HAVE_BTOWC" +as_fn_append ac_func_c_list " setrlimit HAVE_SETRLIMIT" +as_fn_append ac_header_c_list " ucontext.h ucontext_h HAVE_UCONTEXT_H" +as_fn_append ac_func_c_list " sigaltstack HAVE_SIGALTSTACK" +as_fn_append ac_func_c_list " readlinkat HAVE_READLINKAT" +as_fn_append ac_func_c_list " _set_invalid_parameter_handler HAVE__SET_INVALID_PARAMETER_HANDLER" +as_fn_append ac_header_c_list " sys/socket.h sys_socket_h HAVE_SYS_SOCKET_H" +as_fn_append ac_func_c_list " fcntl HAVE_FCNTL" +as_fn_append ac_func_c_list " symlink HAVE_SYMLINK" +as_fn_append ac_func_c_list " mempcpy HAVE_MEMPCPY" +as_fn_append ac_func_c_list " isblank HAVE_ISBLANK" +as_fn_append ac_func_c_list " iswctype HAVE_ISWCTYPE" +as_fn_append ac_func_c_list " mbsrtowcs HAVE_MBSRTOWCS" +as_fn_append ac_func_c_list " wmemchr HAVE_WMEMCHR" +as_fn_append ac_func_c_list " wmemcpy HAVE_WMEMCPY" +as_fn_append ac_func_c_list " wmempcpy HAVE_WMEMPCPY" +as_fn_append ac_header_c_list " wctype.h wctype_h HAVE_WCTYPE_H" +gl_fnmatch_required=GNU +as_fn_append ac_func_c_list " getdtablesize HAVE_GETDTABLESIZE" +gl_getopt_required=GNU +as_fn_append ac_header_c_list " getopt.h getopt_h HAVE_GETOPT_H" +as_fn_append ac_header_c_list " sys/cdefs.h sys_cdefs_h HAVE_SYS_CDEFS_H" +as_fn_append ac_func_c_list " getprogname HAVE_GETPROGNAME" +as_fn_append ac_func_c_list " getexecname HAVE_GETEXECNAME" +as_fn_append ac_func_c_list " gettimeofday HAVE_GETTIMEOFDAY" +as_fn_append ac_func_c_list " nanotime HAVE_NANOTIME" +as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H" +as_fn_append ac_header_c_list " iconv.h iconv_h HAVE_ICONV_H" +as_fn_append ac_header_c_list " limits.h limits_h HAVE_LIMITS_H" +as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H" +as_fn_append ac_func_c_list " iswcntrl HAVE_ISWCNTRL" +as_fn_append ac_header_c_list " crtdefs.h crtdefs_h HAVE_CRTDEFS_H" +as_fn_append ac_func_c_list " iswblank HAVE_ISWBLANK" +as_fn_append ac_header_c_list " langinfo.h langinfo_h HAVE_LANGINFO_H" +as_fn_append ac_header_c_list " xlocale.h xlocale_h HAVE_XLOCALE_H" +as_fn_append ac_func_c_list " lstat HAVE_LSTAT" +as_fn_append ac_func_c_list " mbsinit HAVE_MBSINIT" +as_fn_append ac_func_c_list " mbrtowc HAVE_MBRTOWC" +as_fn_append ac_func_c_list " mbslen HAVE_MBSLEN" +as_fn_append ac_header_c_list " sys/mman.h sys_mman_h HAVE_SYS_MMAN_H" +as_fn_append ac_func_c_list " mprotect HAVE_MPROTECT" +as_fn_append ac_func_c_list " mkstemp HAVE_MKSTEMP" +as_fn_append ac_func_c_list " tzset HAVE_TZSET" +as_fn_append ac_func_c_list " nl_langinfo HAVE_NL_LANGINFO" +as_fn_append ac_header_c_list " sys/param.h sys_param_h HAVE_SYS_PARAM_H" +as_fn_append ac_func_c_list " readlink HAVE_READLINK" +as_fn_append ac_header_c_list " malloc.h malloc_h HAVE_MALLOC_H" +as_fn_append ac_func_c_list " secure_getenv HAVE_SECURE_GETENV" +as_fn_append ac_func_c_list " getuid HAVE_GETUID" +as_fn_append ac_func_c_list " geteuid HAVE_GETEUID" +as_fn_append ac_func_c_list " getgid HAVE_GETGID" +as_fn_append ac_func_c_list " getegid HAVE_GETEGID" +as_fn_append ac_func_c_list " setenv HAVE_SETENV" +as_fn_append ac_func_c_list " sigaction HAVE_SIGACTION" +as_fn_append ac_func_c_list " siginterrupt HAVE_SIGINTERRUPT" +as_fn_append ac_func_c_list " strerror_r HAVE_STRERROR_R" +as_fn_append ac_func_c_list " __xpg_strerror_r HAVE___XPG_STRERROR_R" +as_fn_append ac_func_c_list " strndup HAVE_STRNDUP" +as_fn_append ac_func_c_list " strptime HAVE_STRPTIME" +as_fn_append ac_func_c_list " strtoumax HAVE_STRTOUMAX" +as_fn_append ac_header_c_list " sys/wait.h sys_wait_h HAVE_SYS_WAIT_H" +as_fn_append ac_func_c_list " localtime_r HAVE_LOCALTIME_R" +as_fn_append ac_func_c_list " timegm HAVE_TIMEGM" +as_fn_append ac_func_c_list " vasnprintf HAVE_VASNPRINTF" +as_fn_append ac_header_c_list " features.h features_h HAVE_FEATURES_H" +as_fn_append ac_func_c_list " snprintf HAVE_SNPRINTF" +as_fn_append ac_func_c_list " wcrtomb HAVE_WCRTOMB" +as_fn_append ac_func_c_list " wcwidth HAVE_WCWIDTH" +as_fn_append ac_header_c_list " arpa/inet.h arpa_inet_h HAVE_ARPA_INET_H" +as_fn_append ac_func_c_list " ftruncate HAVE_FTRUNCATE" +as_fn_append ac_header_c_list " netdb.h netdb_h HAVE_NETDB_H" +as_fn_append ac_header_c_list " netinet/in.h netinet_in_h HAVE_NETINET_IN_H" +as_fn_append ac_func_c_list " newlocale HAVE_NEWLOCALE" +as_fn_append ac_header_c_list " sys/select.h sys_select_h HAVE_SYS_SELECT_H" +as_fn_append ac_func_c_list " pipe HAVE_PIPE" +as_fn_append ac_func_c_list " sleep HAVE_SLEEP" +as_fn_append ac_func_c_list " catgets HAVE_CATGETS" +as_fn_append ac_header_c_list " sys/ioctl.h sys_ioctl_h HAVE_SYS_IOCTL_H" +as_fn_append ac_func_c_list " shutdown HAVE_SHUTDOWN" +as_fn_append ac_header_c_list " sys/uio.h sys_uio_h HAVE_SYS_UIO_H" +as_fn_append ac_func_c_list " wctob HAVE_WCTOB" +as_fn_append ac_func_c_list " sigprocmask HAVE_SIGPROCMASK" +as_fn_append ac_func_c_list " strcasecoll HAVE_STRCASECOLL" +as_fn_append ac_func_c_list " stricoll HAVE_STRICOLL" +as_fn_append ac_header_c_list " vfork.h vfork_h HAVE_VFORK_H" +as_fn_append ac_func_c_list " fork HAVE_FORK" +as_fn_append ac_func_c_list " vfork HAVE_VFORK" +gt_needs="$gt_needs need-ngettext" + +# Auxiliary files required by this configure script. +ac_aux_files="config.rpath config.guess config.sub compile missing install-sh" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}/build-aux" + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else case e in @%:@( + e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; +esac +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_@&t@config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_@&t@config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_@&t@configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + +am__api_version='1.18' + + + + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in @%:@(( + ./ | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + ;; +esac +fi + if test ${ac_cv_path_install+y}; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether sleep supports fractional seconds" >&5 +printf %s "checking whether sleep supports fractional seconds... " >&6; } +if test ${am_cv_sleep_fractional_seconds+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if sleep 0.001 2>/dev/null +then : + am_cv_sleep_fractional_seconds=yes +else case e in @%:@( + e) am_cv_sleep_fractional_seconds=no ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_sleep_fractional_seconds" >&5 +printf "%s\n" "$am_cv_sleep_fractional_seconds" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking filesystem timestamp resolution" >&5 +printf %s "checking filesystem timestamp resolution... " >&6; } +if test ${am_cv_filesystem_timestamp_resolution+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # Default to the worst case. +am_cv_filesystem_timestamp_resolution=2 + +# Only try to go finer than 1 sec if sleep can do it. +# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, +# - 1 sec is not much of a win compared to 2 sec, and +# - it takes 2 seconds to perform the test whether 1 sec works. +# +# Instead, just use the default 2s on platforms that have 1s resolution, +# accept the extra 1s delay when using $sleep in the Automake tests, in +# exchange for not incurring the 2s delay for running the test for all +# packages. +# +am_try_resolutions= +if test "$am_cv_sleep_fractional_seconds" = yes; then + # Even a millisecond often causes a bunch of false positives, + # so just try a hundredth of a second. The time saved between .001 and + # .01 is not terribly consequential. + am_try_resolutions="0.01 0.1 $am_try_resolutions" +fi + +# In order to catch current-generation FAT out, we must *modify* files +# that already exist; the *creation* timestamp is finer. Use names +# that make ls -t sort them differently when they have equal +# timestamps than when they have distinct timestamps, keeping +# in mind that ls -t prints the *newest* file first. +rm -f conftest.ts? +: > conftest.ts1 +: > conftest.ts2 +: > conftest.ts3 + +# Make sure ls -t actually works. Do 'set' in a subshell so we don't +# clobber the current shell's arguments. (Outer-level square brackets +# are removed by m4; they're present so that m4 does not expand +# ; be careful, easy to get confused.) +if ( + set X `ls -t conftest.ts[12]` && + { + test "$*" != "X conftest.ts1 conftest.ts2" || + test "$*" != "X conftest.ts2 conftest.ts1"; + } +); then :; else + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + printf "%s\n" ""Bad output from ls -t: \"`ls -t conftest.ts[12]`\""" >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "ls -t produces unexpected output. +Make sure there is not a broken ls alias in your environment. +See 'config.log' for more details" "$LINENO" 5; } +fi + +for am_try_res in $am_try_resolutions; do + # Any one fine-grained sleep might happen to cross the boundary + # between two values of a coarser actual resolution, but if we do + # two fine-grained sleeps in a row, at least one of them will fall + # entirely within a coarse interval. + echo alpha > conftest.ts1 + sleep $am_try_res + echo beta > conftest.ts2 + sleep $am_try_res + echo gamma > conftest.ts3 + + # We assume that 'ls -t' will make use of high-resolution + # timestamps if the operating system supports them at all. + if (set X `ls -t conftest.ts?` && + test "$2" = conftest.ts3 && + test "$3" = conftest.ts2 && + test "$4" = conftest.ts1); then + # + # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, + # because we don't need to test make. + make_ok=true + if test $am_try_res != 1; then + # But if we've succeeded so far with a subsecond resolution, we + # have one more thing to check: make. It can happen that + # everything else supports the subsecond mtimes, but make doesn't; + # notably on macOS, which ships make 3.81 from 2006 (the last one + # released under GPLv2). https://bugs.gnu.org/68808 + # + # We test $MAKE if it is defined in the environment, else "make". + # It might get overridden later, but our hope is that in practice + # it does not matter: it is the system "make" which is (by far) + # the most likely to be broken, whereas if the user overrides it, + # probably they did so with a better, or at least not worse, make. + # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html + # + # Create a Makefile (real tab character here): + rm -f conftest.mk + echo 'conftest.ts1: conftest.ts2' >conftest.mk + echo ' touch conftest.ts2' >>conftest.mk + # + # Now, running + # touch conftest.ts1; touch conftest.ts2; make + # should touch ts1 because ts2 is newer. This could happen by luck, + # but most often, it will fail if make's support is insufficient. So + # test for several consecutive successes. + # + # (We reuse conftest.ts[12] because we still want to modify existing + # files, not create new ones, per above.) + n=0 + make=${MAKE-make} + until test $n -eq 3; do + echo one > conftest.ts1 + sleep $am_try_res + echo two > conftest.ts2 # ts2 should now be newer than ts1 + if $make -f conftest.mk | grep 'up to date' >/dev/null; then + make_ok=false + break # out of $n loop + fi + n=`expr $n + 1` + done + fi + # + if $make_ok; then + # Everything we know to check worked out, so call this resolution good. + am_cv_filesystem_timestamp_resolution=$am_try_res + break # out of $am_try_res loop + fi + # Otherwise, we'll go on to check the next resolution. + fi +done +rm -f conftest.ts? +# (end _am_filesystem_timestamp_resolution) + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_filesystem_timestamp_resolution" >&5 +printf "%s\n" "$am_cv_filesystem_timestamp_resolution" >&6; } + +# This check should not be cached, as it may vary across builds of +# different projects. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +am_build_env_is_sane=no +am_has_slept=no +rm -f conftest.file +for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + test "$2" = conftest.file + ); then + am_build_env_is_sane=yes + break + fi + # Just in case. + sleep "$am_cv_filesystem_timestamp_resolution" + am_has_slept=yes +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_build_env_is_sane" >&5 +printf "%s\n" "$am_build_env_is_sane" >&6; } +if test "$am_build_env_is_sane" = no; then + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi + +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1 +then : + +else case e in @%:@( + e) ( sleep "$am_cv_filesystem_timestamp_resolution" ) & + am_sleep_pid=$! + ;; +esac +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was 's,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + *'BusyBox '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + ;; +esac +fi + + test -d ./--version && rmdir ./--version + if test ${ac_cv_path_mkdir+y}; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use plain mkdir -p, + # in the hope it doesn't have the bugs of ancient mkdir. + MKDIR_P='mkdir -p' + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make ;; +esac +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +AM_DEFAULT_VERBOSITY=1 +@%:@ Check whether --enable-silent-rules was given. +if test ${enable_silent_rules+y} +then : + enableval=$enable_silent_rules; +fi + +am_make=${MAKE-make} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if printf "%s\n" 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } +AM_BACKSLASH='\' + +am__rm_f_notfound= +if (rm -f && rm -fr && rm -rf) 2>/dev/null +then : + +else case e in @%:@( + e) am__rm_f_notfound='""' ;; +esac +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking xargs -n works" >&5 +printf %s "checking xargs -n works... " >&6; } +if test ${am_cv_xargs_n_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 +3" +then : + am_cv_xargs_n_works=yes +else case e in @%:@( + e) am_cv_xargs_n_works=no ;; +esac +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_xargs_n_works" >&5 +printf "%s\n" "$am_cv_xargs_n_works" >&6; } +if test "$am_cv_xargs_n_works" = yes +then : + am__xargs_n='xargs -n' +else case e in @%:@( + e) am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "" "$am__xargs_n_arg"; done; }' + ;; +esac +fi + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='diffutils' + VERSION='3.6' + + +printf "%s\n" "@%:@define PACKAGE \"$PACKAGE\"" >>confdefs.h + + +printf "%s\n" "@%:@define VERSION \"$VERSION\"" >>confdefs.h + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar plaintar pax cpio none' + +# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 +printf %s "checking whether UID '$am_uid' is supported by ustar format... " >&6; } + if test x$am_uid = xunknown; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&5 +printf "%s\n" "$as_me: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&2;} + elif test $am_uid -le $am_max_uid; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + _am_tools=none + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 +printf %s "checking whether GID '$am_gid' is supported by ustar format... " >&6; } + if test x$gm_gid = xunknown; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&5 +printf "%s\n" "$as_me: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&2;} + elif test $am_gid -le $am_max_gid; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + _am_tools=none + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 +printf %s "checking how to create a ustar tar archive... " >&6; } + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_ustar-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + { echo "$as_me:$LINENO: $_am_tar --version" >&5 + ($_am_tar --version) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && break + done + am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x ustar -w "$$tardir"' + am__tar_='pax -L -x ustar -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H ustar -L' + am__tar_='find "$tardir" -print | cpio -o -H ustar -L' + am__untar='cpio -i -H ustar -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_ustar}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 + (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + rm -rf conftest.dir + if test -s conftest.tar; then + { echo "$as_me:$LINENO: $am__untar &5 + ($am__untar &5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 + (cat conftest.dir/file) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + if test ${am_cv_prog_tar_ustar+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) am_cv_prog_tar_ustar=$_am_tool ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 +printf "%s\n" "$am_cv_prog_tar_ustar" >&6; } + + + + + +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + + + + + + + +AM_DEFAULT_VERBOSITY=0 + + # make --enable-silent-rules the default. + +ac_config_headers="$ac_config_headers lib/config.h:lib/config.hin" + + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $@%:@ != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See 'config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. +# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an '-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else case e in @%:@( + e) ac_file='' ;; +esac +fi +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See 'config.log' for more details" "$LINENO" 5; } +else case e in @%:@( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else case e in @%:@( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See 'config.log' for more details" "$LINENO" 5; } ;; +esac +fi +rm -f conftest conftest$ac_cv_exeext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main (void) +{ +FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else case e in @%:@( + e) printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See 'config.log' for more details" "$LINENO" 5; } ;; +esac +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else case e in @%:@( + e) ac_compiler_gnu=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else case e in @%:@( + e) CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in @%:@( + e) ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in @%:@( + e) if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in @%:@( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in @%:@( + e) if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in @%:@( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in @%:@( + e) if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in @%:@( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 ;; +esac +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + # aligned with autoconf, so not including core; see bug#72225. + rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \ + conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \ + conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM + unset am_i ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in @%:@( + '0:this is the am__doit target') : + case $s in @%:@( + BSD) : + am__include='.include' am__quote='"' ;; @%:@( + *) : + am__include='include' am__quote='' ;; +esac ;; @%:@( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } + +@%:@ Check whether --enable-dependency-tracking was given. +if test ${enable_dependency_tracking+y} +then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thus: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + + +HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"} + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "@%:@define STDC_HEADERS 1" >>confdefs.h + +fi + + ac_fn_c_check_header_compile "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes +then : + MINIX=yes +else case e in @%:@( + e) MINIX= ;; +esac +fi + + if test "$MINIX" = yes; then + +printf "%s\n" "@%:@define _POSIX_SOURCE 1" >>confdefs.h + + +printf "%s\n" "@%:@define _POSIX_1_SOURCE 2" >>confdefs.h + + +printf "%s\n" "@%:@define _MINIX 1" >>confdefs.h + + +printf "%s\n" "@%:@define _NETBSD_SOURCE 1" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test ${ac_cv_safe_to_define___extensions__+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_safe_to_define___extensions__=yes +else case e in @%:@( + e) ac_cv_safe_to_define___extensions__=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + printf "%s\n" "@%:@define __EXTENSIONS__ 1" >>confdefs.h + + printf "%s\n" "@%:@define _ALL_SOURCE 1" >>confdefs.h + + printf "%s\n" "@%:@define _DARWIN_C_SOURCE 1" >>confdefs.h + + printf "%s\n" "@%:@define _GNU_SOURCE 1" >>confdefs.h + + printf "%s\n" "@%:@define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h + + printf "%s\n" "@%:@define _TANDEM_SOURCE 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 +printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } +if test ${ac_cv_should_define__xopen_source+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_should_define__xopen_source=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define _XOPEN_SOURCE 500 + #include + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_should_define__xopen_source=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 +printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } + test $ac_cv_should_define__xopen_source = yes && + printf "%s\n" "@%:@define _XOPEN_SOURCE 500" >>confdefs.h + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else case e in @%:@( + e) # Broken: fails on valid input. +continue ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else case e in @%:@( + e) # Passes both tests. +ac_preproc_ok=: +break ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + break +fi + + done + ac_cv_prog_CPP=$CPP + ;; +esac +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else case e in @%:@( + e) # Broken: fails on valid input. +continue ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else case e in @%:@( + e) # Passes both tests. +ac_preproc_ok=: +break ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + +else case e in @%:@( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See 'config.log' for more details" "$LINENO" 5; } ;; +esac +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5 +printf %s "checking for egrep -e... " >&6; } +if test ${ac_cv_path_EGREP_TRADITIONAL+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in @%:@( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +@%:@( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + : + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + + if test "$ac_cv_path_EGREP_TRADITIONAL" +then : + ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E" +else case e in @%:@( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in @%:@( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +@%:@( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + ;; +esac +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5 +printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; } + EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5 +printf %s "checking for Minix Amsterdam compiler... " >&6; } +if test ${gl_cv_c_amsterdam_compiler+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __ACK__ +Amsterdam +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "Amsterdam" >/dev/null 2>&1 +then : + gl_cv_c_amsterdam_compiler=yes +else case e in @%:@( + e) gl_cv_c_amsterdam_compiler=no ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5 +printf "%s\n" "$gl_cv_c_amsterdam_compiler" >&6; } + + if test $gl_cv_c_amsterdam_compiler = yes; then + if test -z "$AR"; then + AR='cc -c.a' + fi + if test -z "$ARFLAGS"; then + ARFLAGS='-o' + fi + else + : + fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="ar" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + + if test -z "$ARFLAGS"; then + ARFLAGS='cr' + fi + + + + if test -z "$RANLIB"; then + if test $gl_cv_c_amsterdam_compiler = yes; then + RANLIB=':' + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + fi + fi + + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + + + + # IEEE behaviour is the default on all CPUs except Alpha and SH + # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 + # and the GCC 4.1.2 manual). + case "$host_cpu" in + alpha*) + # On Alpha systems, a compiler option provides the behaviour. + # See the ieee(3) manual page, also available at + # + if test -n "$GCC"; then + # GCC has the option -mieee. + # For full IEEE compliance (rarely needed), use option -mieee-with-inexact. + CPPFLAGS="$CPPFLAGS -mieee" + else + # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact. + # For full IEEE compliance (rarely needed), use option -ieee_with_inexact. + CPPFLAGS="$CPPFLAGS -ieee" + fi + ;; + sh*) + if test -n "$GCC"; then + # GCC has the option -mieee. + CPPFLAGS="$CPPFLAGS -mieee" + fi + ;; + esac + +@%:@ Check whether --enable-largefile was given. +if test ${enable_largefile+y} +then : + enableval=$enable_largefile; +fi +if test "$enable_largefile,$enable_year2038" != no,no +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable large file support" >&5 +printf %s "checking for $CC option to enable large file support... " >&6; } +if test ${ac_cv_sys_largefile_opts+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_save_CC="$CC" + ac_opt_found=no + for ac_opt in "none needed" "-D_FILE_OFFSET_BITS=64" "-D_LARGE_FILES=1" "-n32"; do + if test x"$ac_opt" != x"none needed" +then : + CC="$ac_save_CC $ac_opt" +fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +@%:@ifndef FTYPE +@%:@ define FTYPE off_t +@%:@endif + /* Check that FTYPE can represent 2**63 - 1 correctly. + We can't simply define LARGE_FTYPE to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +@%:@define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31)) + int FTYPE_is_large[(LARGE_FTYPE % 2147483629 == 721 + && LARGE_FTYPE % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_opt" = x"none needed" +then : + # GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t. + CC="$CC -DFTYPE=ino_t" + if ac_fn_c_try_compile "$LINENO" +then : + +else case e in @%:@( + e) CC="$CC -D_FILE_OFFSET_BITS=64" + if ac_fn_c_try_compile "$LINENO" +then : + ac_opt='-D_FILE_OFFSET_BITS=64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam +fi + ac_cv_sys_largefile_opts=$ac_opt + ac_opt_found=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test $ac_opt_found = no || break + done + CC="$ac_save_CC" + + + if test $ac_opt_found != yes; then + case $host_os in @%:@( + mingw* | windows*) : + ac_cv_sys_largefile_opts="supported through gnulib" + ac_opt_found=yes + ;; @%:@( + *) : + ;; +esac + fi + + test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected" ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_opts" >&5 +printf "%s\n" "$ac_cv_sys_largefile_opts" >&6; } + +ac_have_largefile=yes +case $ac_cv_sys_largefile_opts in @%:@( + "none needed") : + ;; @%:@( + "supported through gnulib") : + ;; @%:@( + "support not detected") : + ac_have_largefile=no ;; @%:@( + "-D_FILE_OFFSET_BITS=64") : + +printf "%s\n" "@%:@define _FILE_OFFSET_BITS 64" >>confdefs.h + ;; @%:@( + "-D_LARGE_FILES=1") : + +printf "%s\n" "@%:@define _LARGE_FILES 1" >>confdefs.h + ;; @%:@( + "-n32") : + CC="$CC -n32" ;; @%:@( + *) : + as_fn_error $? "internal error: bad value for \$ac_cv_sys_largefile_opts" "$LINENO" 5 ;; +esac + +if test "$enable_year2038" != no +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option for timestamps after 2038" >&5 +printf %s "checking for $CC option for timestamps after 2038... " >&6; } +if test ${ac_cv_sys_year2038_opts+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_save_CPPFLAGS="$CPPFLAGS" + ac_opt_found=no + for ac_opt in "none needed" "-D_TIME_BITS=64" "-D__MINGW_USE_VC2005_COMPAT" "-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT"; do + if test x"$ac_opt" != x"none needed" +then : + CPPFLAGS="$ac_save_CPPFLAGS $ac_opt" +fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + /* Check that time_t can represent 2**32 - 1 correctly. */ + #define LARGE_TIME_T \\ + ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30))) + int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535 + && LARGE_TIME_T % 65537 == 0) + ? 1 : -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_year2038_opts="$ac_opt" + ac_opt_found=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test $ac_opt_found = no || break + done + CPPFLAGS="$ac_save_CPPFLAGS" + test $ac_opt_found = yes || ac_cv_sys_year2038_opts="support not detected" ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_year2038_opts" >&5 +printf "%s\n" "$ac_cv_sys_year2038_opts" >&6; } + +ac_have_year2038=yes +case $ac_cv_sys_year2038_opts in @%:@( + "none needed") : + ;; @%:@( + "support not detected") : + ac_have_year2038=no ;; @%:@( + "-D_TIME_BITS=64") : + +printf "%s\n" "@%:@define _TIME_BITS 64" >>confdefs.h + ;; @%:@( + "-D__MINGW_USE_VC2005_COMPAT") : + +printf "%s\n" "@%:@define __MINGW_USE_VC2005_COMPAT 1" >>confdefs.h + ;; @%:@( + "-U_USE_32_BIT_TIME_T"*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "the 'time_t' type is currently forced to be 32-bit. It +will stop working after mid-January 2038. Remove +_USE_32BIT_TIME_T from the compiler flags. +See 'config.log' for more details" "$LINENO" 5; } ;; @%:@( + *) : + as_fn_error $? "internal error: bad value for \$ac_cv_sys_year2038_opts" "$LINENO" 5 ;; +esac + +fi + +fi + + + + # Pre-early section. + + + + + # Code from module absolute-header: + # Code from module accept: + # Code from module accept-tests: + # Code from module alloca: + # Code from module alloca-opt: + # Code from module alloca-opt-tests: + # Code from module allocator: + # Code from module announce-gen: + # Code from module areadlink: + # Code from module areadlink-tests: + # Code from module argmatch: + # Code from module argmatch-tests: + # Code from module arpa_inet: + # Code from module arpa_inet-tests: + # Code from module assure: + # Code from module binary-io: + # Code from module binary-io-tests: + # Code from module bind: + # Code from module bind-tests: + # Code from module bitrotate: + # Code from module bitrotate-tests: + # Code from module btowc: + # Code from module btowc-tests: + # Code from module builtin-expect: + # Code from module c-ctype: + # Code from module c-ctype-tests: + # Code from module c-stack: + # Code from module c-stack-tests: + # Code from module c-strcase: + # Code from module c-strcase-tests: + # Code from module c-strcaseeq: + # Code from module careadlinkat: + # Code from module clock-time: + # Code from module close: + # Code from module close-tests: + # Code from module config-h: + # Code from module configmake: + # Code from module connect: + # Code from module connect-tests: + # Code from module ctype: + # Code from module ctype-tests: + # Code from module diffseq: + # Code from module dirname: + # Code from module dirname-lgpl: + # Code from module dirname-tests: + # Code from module do-release-commit-and-tag: + # Code from module dosname: + # Code from module double-slash-root: + # Code from module dtotimespec: + # Code from module dup2: + # Code from module dup2-tests: + # Code from module environ: + # Code from module environ-tests: + # Code from module errno: + # Code from module errno-tests: + # Code from module error: + # Code from module exclude: + # Code from module exclude-tests: + # Code from module exitfail: + # Code from module extensions: + # Code from module extern-inline: + # Code from module fcntl: + # Code from module fcntl-h: + # Code from module fcntl-h-tests: + # Code from module fcntl-tests: + # Code from module fd-hook: + # Code from module fdl: + # Code from module fdopen: + # Code from module fdopen-tests: + # Code from module fgetc-tests: + # Code from module file-type: + # Code from module filename: + # Code from module filenamecat: + # Code from module filenamecat-lgpl: + # Code from module filenamecat-tests: + # Code from module flexmember: + # Code from module float: + # Code from module float-tests: + # Code from module fnmatch: + # Code from module fnmatch-gnu: + # Code from module fnmatch-tests: + # Code from module fpieee: + + # Code from module fpucw: + # Code from module fputc-tests: + # Code from module fread-tests: + # Code from module freopen: + # Code from module freopen-safer: + # Code from module freopen-safer-tests: + # Code from module freopen-tests: + # Code from module fstat: + # Code from module fstat-tests: + # Code from module ftruncate: + # Code from module ftruncate-tests: + # Code from module fwrite-tests: + # Code from module gendocs: + # Code from module getcwd-lgpl: + # Code from module getcwd-lgpl-tests: + # Code from module getdtablesize: + # Code from module getdtablesize-tests: + # Code from module getopt: + # Code from module getopt-gnu: + # Code from module getopt-gnu-tests: + # Code from module getopt-posix: + # Code from module getopt-posix-tests: + # Code from module getpagesize: + # Code from module getprogname: + # Code from module getprogname-tests: + # Code from module gettext-h: + # Code from module gettime: + # Code from module gettimeofday: + # Code from module gettimeofday-tests: + # Code from module git-version-gen: + # Code from module gitlog-to-changelog: + # Code from module gnu-make: + # Code from module gnu-web-doc-update: + # Code from module gnumakefile: + # Code from module gnupload: + # Code from module gperf: + # Code from module hard-locale: + # Code from module hash: + # Code from module hash-pjw: + # Code from module hash-tests: + # Code from module havelib: + # Code from module iconv: + # Code from module iconv-h: + # Code from module iconv-h-tests: + # Code from module iconv-tests: + # Code from module iconv_open: + # Code from module ignore-value: + # Code from module ignore-value-tests: + # Code from module include_next: + # Code from module inet_pton: + # Code from module inet_pton-tests: + # Code from module inline: + # Code from module intprops: + # Code from module intprops-tests: + # Code from module inttostr: + # Code from module inttostr-tests: + # Code from module inttypes: + # Code from module inttypes-incomplete: + # Code from module inttypes-tests: + # Code from module ioctl: + # Code from module ioctl-tests: + # Code from module isblank: + # Code from module isblank-tests: + # Code from module iswblank: + # Code from module iswblank-tests: + # Code from module langinfo: + # Code from module langinfo-tests: + # Code from module largefile: + + # Code from module libsigsegv: + # Code from module limits-h: + # Code from module limits-h-tests: + # Code from module listen: + # Code from module listen-tests: + # Code from module localcharset: + # Code from module locale: + # Code from module locale-tests: + # Code from module localeconv: + # Code from module localeconv-tests: + # Code from module localtime-buffer: + # Code from module lstat: + # Code from module lstat-tests: + # Code from module maintainer-makefile: + # Code from module malloc-posix: + # Code from module malloca: + # Code from module malloca-tests: + # Code from module manywarnings: + # Code from module mbchar: + # Code from module mbiter: + # Code from module mbrtowc: + # Code from module mbrtowc-tests: + # Code from module mbscasecmp: + # Code from module mbscasecmp-tests: + # Code from module mbsinit: + # Code from module mbsinit-tests: + # Code from module mbslen: + # Code from module mbsrtowcs: + # Code from module mbsrtowcs-tests: + # Code from module mbsstr: + # Code from module mbsstr-tests: + # Code from module mbtowc: + # Code from module mbuiter: + # Code from module memchr: + # Code from module memchr-tests: + # Code from module minmax: + # Code from module mkstemp: + # Code from module mktime: + # Code from module mktime-internal: + # Code from module msvc-inval: + # Code from module msvc-nothrow: + # Code from module multiarch: + # Code from module nanosleep: + # Code from module nanosleep-tests: + # Code from module netinet_in: + # Code from module netinet_in-tests: + # Code from module nl_langinfo: + # Code from module nl_langinfo-tests: + # Code from module nocrash: + # Code from module open: + # Code from module open-tests: + # Code from module pathmax: + # Code from module pathmax-tests: + # Code from module perror: + # Code from module perror-tests: + # Code from module pipe-posix: + # Code from module pipe-posix-tests: + # Code from module progname: + # Code from module propername: + # Code from module putenv: + # Code from module quote: + # Code from module quotearg: + # Code from module quotearg-simple: + # Code from module quotearg-simple-tests: + # Code from module raise: + # Code from module raise-tests: + # Code from module rawmemchr: + # Code from module rawmemchr-tests: + # Code from module readlink: + # Code from module readlink-tests: + # Code from module readme-release: + # Code from module regex: + # Code from module regex-tests: + # Code from module same-inode: + # Code from module secure_getenv: + # Code from module select: + # Code from module select-tests: + # Code from module setenv: + # Code from module setenv-tests: + # Code from module setlocale: + # Code from module setlocale-tests: + # Code from module setsockopt: + # Code from module setsockopt-tests: + # Code from module sh-quote: + # Code from module sh-quote-tests: + # Code from module sigaction: + # Code from module sigaction-tests: + # Code from module signal: + # Code from module signal-h: + # Code from module signal-h-tests: + # Code from module sigprocmask: + # Code from module sigprocmask-tests: + # Code from module size_max: + # Code from module sleep: + # Code from module sleep-tests: + # Code from module snippet/_Noreturn: + # Code from module snippet/arg-nonnull: + # Code from module snippet/c++defs: + # Code from module snippet/unused-parameter: + # Code from module snippet/warn-on-use: + # Code from module snprintf: + # Code from module snprintf-tests: + # Code from module socket: + # Code from module socketlib: + # Code from module sockets: + # Code from module sockets-tests: + # Code from module socklen: + # Code from module ssize_t: + # Code from module stat: + # Code from module stat-macros: + # Code from module stat-tests: + # Code from module stat-time: + # Code from module stat-time-tests: + # Code from module stdalign: + # Code from module stdalign-tests: + # Code from module stdarg: + + + + # Code from module stdbool: + # Code from module stdbool-tests: + # Code from module stddef: + # Code from module stddef-tests: + # Code from module stdint: + # Code from module stdint-tests: + # Code from module stdio: + # Code from module stdio-tests: + # Code from module stdlib: + # Code from module stdlib-tests: + # Code from module strcase: + # Code from module streq: + # Code from module strerror: + # Code from module strerror-override: + # Code from module strerror-tests: + # Code from module strerror_r-posix: + # Code from module strerror_r-posix-tests: + # Code from module strftime: + # Code from module strftime-tests: + # Code from module striconv: + # Code from module striconv-tests: + # Code from module string: + # Code from module string-tests: + # Code from module strings: + # Code from module strings-tests: + # Code from module strndup: + # Code from module strnlen: + # Code from module strnlen-tests: + # Code from module strnlen1: + # Code from module strptime: + # Code from module strtoull: + # Code from module strtoull-tests: + # Code from module strtoumax: + # Code from module strtoumax-tests: + # Code from module symlink: + # Code from module symlink-tests: + # Code from module sys_ioctl: + # Code from module sys_ioctl-tests: + # Code from module sys_select: + # Code from module sys_select-tests: + # Code from module sys_socket: + # Code from module sys_socket-tests: + # Code from module sys_stat: + # Code from module sys_stat-tests: + # Code from module sys_time: + # Code from module sys_time-tests: + # Code from module sys_types: + # Code from module sys_types-tests: + # Code from module sys_uio: + # Code from module sys_uio-tests: + # Code from module sys_wait: + # Code from module sys_wait-tests: + # Code from module system-quote: + # Code from module tempname: + # Code from module test-framework-sh: + # Code from module test-framework-sh-tests: + # Code from module time: + # Code from module time-tests: + # Code from module time_r: + # Code from module time_rz: + # Code from module timegm: + # Code from module timespec: + # Code from module timespec-add: + # Code from module timespec-sub: + # Code from module timespec-tests: + # Code from module trim: + # Code from module tzset: + # Code from module unistd: + # Code from module unistd-tests: + # Code from module unistr/base: + # Code from module unistr/u8-mbtoucr: + # Code from module unistr/u8-mbtoucr-tests: + # Code from module unistr/u8-uctomb: + # Code from module unistr/u8-uctomb-tests: + # Code from module unitypes: + # Code from module uniwidth/base: + # Code from module uniwidth/width: + # Code from module uniwidth/width-tests: + # Code from module unlocked-io: + # Code from module unsetenv: + # Code from module unsetenv-tests: + # Code from module update-copyright: + # Code from module update-copyright-tests: + # Code from module useless-if-before-free: + # Code from module vararrays: + # Code from module vasnprintf: + # Code from module vasnprintf-tests: + # Code from module vasprintf: + # Code from module vasprintf-tests: + # Code from module vc-list-files: + # Code from module vc-list-files-tests: + # Code from module verify: + # Code from module verify-tests: + # Code from module version-etc: + # Code from module version-etc-fsf: + # Code from module version-etc-tests: + # Code from module warnings: + # Code from module wchar: + # Code from module wchar-tests: + # Code from module wcrtomb: + # Code from module wcrtomb-tests: + # Code from module wctob: + # Code from module wctomb: + # Code from module wctype-h: + # Code from module wctype-h-tests: + # Code from module wcwidth: + # Code from module wcwidth-tests: + # Code from module xalloc: + # Code from module xalloc-die: + # Code from module xalloc-die-tests: + # Code from module xalloc-oversized: + # Code from module xfreopen: + # Code from module xreadlink: + # Code from module xsize: + # Code from module xstriconv: + # Code from module xstrndup: + # Code from module xstrtol: + # Code from module xstrtol-tests: + # Code from module xstrtoumax: + # Code from module xstrtoumax-tests: + # Code from module xvasprintf: + # Code from module xvasprintf-tests: + + + + + + + + LIBC_FATAL_STDERR_=1 + export LIBC_FATAL_STDERR_ + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define size_t unsigned int" >>confdefs.h + ;; +esac +fi + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +printf %s "checking for working alloca.h... " >&6; } +if test ${ac_cv_working_alloca_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main (void) +{ +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_working_alloca_h=yes +else case e in @%:@( + e) ac_cv_working_alloca_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +printf "%s\n" "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then + +printf "%s\n" "@%:@define HAVE_ALLOCA_H 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +printf %s "checking for alloca... " >&6; } +if test ${ac_cv_func_alloca_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_func_alloca_works=$ac_cv_working_alloca_h +if test "$ac_cv_func_alloca_works" != yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#ifndef alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _MSC_VER +# include +# define alloca _alloca +# else +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +# endif +#endif + +int +main (void) +{ +char *p = (char *) alloca (1); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_func_alloca_works=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +printf "%s\n" "$ac_cv_func_alloca_works" >&6; } + +if test $ac_cv_func_alloca_works = yes; then + +printf "%s\n" "@%:@define HAVE_ALLOCA 1" >>confdefs.h + +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + + + + + +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext + +printf "%s\n" "@%:@define C_ALLOCA 1" >>confdefs.h + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +printf %s "checking stack direction for C alloca... " >&6; } +if test ${ac_cv_c_stack_direction+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + ac_cv_c_stack_direction=0 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction (int *addr, int depth) +{ + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; +} + +int +main (int argc, char **argv) +{ + return find_stack_direction (0, argc + !argv + 20) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_stack_direction=1 +else case e in @%:@( + e) ac_cv_c_stack_direction=-1 ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +printf "%s\n" "$ac_cv_c_stack_direction" >&6; } +printf "%s\n" "@%:@define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h + + +fi + + + GNULIB_BTOWC=0; + GNULIB_WCTOB=0; + GNULIB_MBSINIT=0; + GNULIB_MBRTOWC=0; + GNULIB_MBRLEN=0; + GNULIB_MBSRTOWCS=0; + GNULIB_MBSNRTOWCS=0; + GNULIB_WCRTOMB=0; + GNULIB_WCSRTOMBS=0; + GNULIB_WCSNRTOMBS=0; + GNULIB_WCWIDTH=0; + GNULIB_WMEMCHR=0; + GNULIB_WMEMCMP=0; + GNULIB_WMEMCPY=0; + GNULIB_WMEMMOVE=0; + GNULIB_WMEMSET=0; + GNULIB_WCSLEN=0; + GNULIB_WCSNLEN=0; + GNULIB_WCSCPY=0; + GNULIB_WCPCPY=0; + GNULIB_WCSNCPY=0; + GNULIB_WCPNCPY=0; + GNULIB_WCSCAT=0; + GNULIB_WCSNCAT=0; + GNULIB_WCSCMP=0; + GNULIB_WCSNCMP=0; + GNULIB_WCSCASECMP=0; + GNULIB_WCSNCASECMP=0; + GNULIB_WCSCOLL=0; + GNULIB_WCSXFRM=0; + GNULIB_WCSDUP=0; + GNULIB_WCSCHR=0; + GNULIB_WCSRCHR=0; + GNULIB_WCSCSPN=0; + GNULIB_WCSSPN=0; + GNULIB_WCSPBRK=0; + GNULIB_WCSSTR=0; + GNULIB_WCSTOK=0; + GNULIB_WCSWIDTH=0; + GNULIB_WCSFTIME=0; + HAVE_BTOWC=1; + HAVE_MBSINIT=1; + HAVE_MBRTOWC=1; + HAVE_MBRLEN=1; + HAVE_MBSRTOWCS=1; + HAVE_MBSNRTOWCS=1; + HAVE_WCRTOMB=1; + HAVE_WCSRTOMBS=1; + HAVE_WCSNRTOMBS=1; + HAVE_WMEMCHR=1; + HAVE_WMEMCMP=1; + HAVE_WMEMCPY=1; + HAVE_WMEMMOVE=1; + HAVE_WMEMSET=1; + HAVE_WCSLEN=1; + HAVE_WCSNLEN=1; + HAVE_WCSCPY=1; + HAVE_WCPCPY=1; + HAVE_WCSNCPY=1; + HAVE_WCPNCPY=1; + HAVE_WCSCAT=1; + HAVE_WCSNCAT=1; + HAVE_WCSCMP=1; + HAVE_WCSNCMP=1; + HAVE_WCSCASECMP=1; + HAVE_WCSNCASECMP=1; + HAVE_WCSCOLL=1; + HAVE_WCSXFRM=1; + HAVE_WCSDUP=1; + HAVE_WCSCHR=1; + HAVE_WCSRCHR=1; + HAVE_WCSCSPN=1; + HAVE_WCSSPN=1; + HAVE_WCSPBRK=1; + HAVE_WCSSTR=1; + HAVE_WCSTOK=1; + HAVE_WCSWIDTH=1; + HAVE_WCSFTIME=1; + HAVE_DECL_WCTOB=1; + HAVE_DECL_WCWIDTH=1; + REPLACE_MBSTATE_T=0; + REPLACE_BTOWC=0; + REPLACE_WCTOB=0; + REPLACE_MBSINIT=0; + REPLACE_MBRTOWC=0; + REPLACE_MBRLEN=0; + REPLACE_MBSRTOWCS=0; + REPLACE_MBSNRTOWCS=0; + REPLACE_WCRTOMB=0; + REPLACE_WCSRTOMBS=0; + REPLACE_WCSNRTOMBS=0; + REPLACE_WCWIDTH=0; + REPLACE_WCSWIDTH=0; + REPLACE_WCSFTIME=0; + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether uses 'inline' correctly" >&5 +printf %s "checking whether uses 'inline' correctly... " >&6; } +if test ${gl_cv_header_wchar_h_correct_inline+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gl_cv_header_wchar_h_correct_inline=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +extern int zero (void); +int main () { return zero(); } + +_ACEOF + save_ac_compile="$ac_compile" + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int zero (void) { return 0; } + +_ACEOF + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then + : + else + gl_cv_header_wchar_h_correct_inline=no + fi + fi + fi + ac_compile="$save_ac_compile" + rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5 +printf "%s\n" "$gl_cv_header_wchar_h_correct_inline" >&6; } + if test $gl_cv_header_wchar_h_correct_inline = no; then + as_fn_error $? " cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). +This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in +C99 mode. You have four options: + - Add the flag -fgnu89-inline to CC and reconfigure, or + - Fix your include files, using parts of + , or + - Use a gcc version older than 4.3, or + - Don't use the flags -std=c99 or -std=gnu99. +Configuration aborted." "$LINENO" 5 + fi + +ac_func= +for ac_item in $ac_func_c_list +do + if test $ac_func; then + ac_fn_c_check_func "$LINENO" $ac_func ac_cv_func_$ac_func + if eval test \"x\$ac_cv_func_$ac_func\" = xyes; then + echo "#define $ac_item 1" >> confdefs.h + fi + ac_func= + else + ac_func=$ac_item + fi +done + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 +printf %s "checking for nl_langinfo and CODESET... " >&6; } +if test ${am_cv_langinfo_codeset+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +char* cs = nl_langinfo(CODESET); return !cs; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_langinfo_codeset=yes +else case e in @%:@( + e) am_cv_langinfo_codeset=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 +printf "%s\n" "$am_cv_langinfo_codeset" >&6; } + if test $am_cv_langinfo_codeset = yes; then + +printf "%s\n" "@%:@define HAVE_LANGINFO_CODESET 1" >>confdefs.h + + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + + + + + + case "$host_os" in + sunos4* | freebsd* | dragonfly* | openbsd* | mirbsd* | netbsd* | kfreebsd* | knetbsd*) # BSD systems + FAULT_YIELDS_SIGBUS=1 ;; + hpux*) # HP-UX + FAULT_YIELDS_SIGBUS=1 ;; + macos* | darwin*) # Mac OS X + FAULT_YIELDS_SIGBUS=1 ;; + gnu*) # Hurd + FAULT_YIELDS_SIGBUS=1 ;; + *) + FAULT_YIELDS_SIGBUS=0 ;; + esac + +printf "%s\n" "@%:@define FAULT_YIELDS_SIGBUS $FAULT_YIELDS_SIGBUS" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working C stack overflow detection" >&5 +printf %s "checking for working C stack overflow detection... " >&6; } +if test ${ac_cv_sys_stack_overflow_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + ac_cv_sys_stack_overflow_works=cross-compiling +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #if HAVE_SETRLIMIT + # include + # include + # include + #endif + #ifndef SIGSTKSZ + # define SIGSTKSZ 16384 + #endif + + static union + { + char buffer[2 * SIGSTKSZ]; + long double ld; + long u; + void *p; + } alternate_signal_stack; + + static void + segv_handler (int signo) + { + _exit (0); + } + + static int + c_stack_action () + { + stack_t st; + struct sigaction act; + int r; + + st.ss_flags = 0; + /* Use the midpoint to avoid Irix sigaltstack bug. */ + st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; + st.ss_size = SIGSTKSZ; + r = sigaltstack (&st, 0); + if (r != 0) + return 1; + + sigemptyset (&act.sa_mask); + act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND; + act.sa_handler = segv_handler; + #if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, 0) < 0) + return 2; + #endif + if (sigaction (SIGSEGV, &act, 0) < 0) + return 3; + return 0; + } + static volatile int * + recurse_1 (volatile int n, volatile int *p) + { + if (n >= 0) + *recurse_1 (n + 1, p) += n; + return p; + } + static int + recurse (volatile int n) + { + int sum = 0; + return *recurse_1 (n, &sum); + } + int + main () + { + int result; + #if HAVE_SETRLIMIT && defined RLIMIT_STACK + /* Before starting the endless recursion, try to be friendly + to the user's machine. On some Linux 2.2.x systems, there + is no stack limit for user processes at all. We don't want + to kill such systems. */ + struct rlimit rl; + rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */ + setrlimit (RLIMIT_STACK, &rl); + #endif + + result = c_stack_action (); + if (result != 0) + return result; + return recurse (0); + } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_sys_stack_overflow_works=yes +else case e in @%:@( + e) ac_cv_sys_stack_overflow_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_stack_overflow_works" >&5 +printf "%s\n" "$ac_cv_sys_stack_overflow_works" >&6; } + + if test $ac_cv_sys_stack_overflow_works = yes; then + +printf "%s\n" "@%:@define HAVE_STACK_OVERFLOW_HANDLING 1" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for correct stack_t interpretation" >&5 +printf %s "checking for correct stack_t interpretation... " >&6; } +if test ${gl_cv_sigaltstack_low_base+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + gl_cv_sigaltstack_low_base=cross-compiling +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#include +#include +#if HAVE_SYS_SIGNAL_H +# include +#endif +#ifndef SIGSTKSZ +# define SIGSTKSZ 16384 +#endif +volatile char *stack_lower_bound; +volatile char *stack_upper_bound; +static void check_stack_location (volatile char *addr) +{ + if (addr >= stack_lower_bound && addr <= stack_upper_bound) + exit (0); + else + exit (1); +} +static void stackoverflow_handler (int sig) +{ + char dummy; + check_stack_location (&dummy); +} +int main () +{ + char mystack[2 * SIGSTKSZ]; + stack_t altstack; + struct sigaction action; + /* Install the alternate stack. */ + altstack.ss_sp = mystack + SIGSTKSZ; + altstack.ss_size = SIGSTKSZ; + stack_lower_bound = (char *) altstack.ss_sp; + stack_upper_bound = (char *) altstack.ss_sp + altstack.ss_size - 1; + altstack.ss_flags = 0; /* no SS_DISABLE */ + if (sigaltstack (&altstack, NULL) < 0) + exit (2); + /* Install the SIGSEGV handler. */ + sigemptyset (&action.sa_mask); + action.sa_handler = &stackoverflow_handler; + action.sa_flags = SA_ONSTACK; + if (sigaction (SIGSEGV, &action, (struct sigaction *) NULL) < 0) + exit(3); + /* Provoke a SIGSEGV. */ + raise (SIGSEGV); + exit (4); +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_sigaltstack_low_base=yes +else case e in @%:@( + e) gl_cv_sigaltstack_low_base=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sigaltstack_low_base" >&5 +printf "%s\n" "$gl_cv_sigaltstack_low_base" >&6; } + if test "$gl_cv_sigaltstack_low_base" = no; then + +printf "%s\n" "@%:@define SIGALTSTACK_SS_REVERSED 1" >>confdefs.h + + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for precise C stack overflow detection" >&5 +printf %s "checking for precise C stack overflow detection... " >&6; } +if test ${ac_cv_sys_xsi_stack_overflow_heuristic+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #if HAVE_UCONTEXT_H + # include + #endif + #if HAVE_SETRLIMIT + # include + # include + # include + #endif + #ifndef SIGSTKSZ + # define SIGSTKSZ 16384 + #endif + + static union + { + char buffer[2 * SIGSTKSZ]; + long double ld; + long u; + void *p; + } alternate_signal_stack; + + #if STACK_DIRECTION + # define find_stack_direction(ptr) STACK_DIRECTION + #else + static int + find_stack_direction (char const *addr) + { + char dummy; + return (! addr ? find_stack_direction (&dummy) + : addr < &dummy ? 1 : -1); + } + #endif + + static void + segv_handler (int signo, siginfo_t *info, void *context) + { + if (0 < info->si_code) + { + /* For XSI heuristics to work, we need uc_stack to describe + the interrupted stack (as on Solaris), and not the + currently executing stack (as on Linux). */ + ucontext_t const *user_context = context; + char const *stack_min = user_context->uc_stack.ss_sp; + size_t stack_size = user_context->uc_stack.ss_size; + char const *faulting_address = info->si_addr; + size_t s = faulting_address - stack_min; + size_t page_size = sysconf (_SC_PAGESIZE); + if (find_stack_direction (0) < 0) + s += page_size; + if (s < stack_size + page_size) + _exit (0); + _exit (4); + } + _exit (5); + } + + static int + c_stack_action () + { + stack_t st; + struct sigaction act; + int r; + + st.ss_flags = 0; + /* Use the midpoint to avoid Irix sigaltstack bug. */ + st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; + st.ss_size = SIGSTKSZ; + r = sigaltstack (&st, 0); + if (r != 0) + return 1; + + sigemptyset (&act.sa_mask); + act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO; + act.sa_sigaction = segv_handler; + #if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, 0) < 0) + return 2; + #endif + if (sigaction (SIGSEGV, &act, 0) < 0) + return 3; + return 0; + } + static volatile int * + recurse_1 (volatile int n, volatile int *p) + { + if (n >= 0) + *recurse_1 (n + 1, p) += n; + return p; + } + static int + recurse (volatile int n) + { + int sum = 0; + return *recurse_1 (n, &sum); + } + int + main () + { + int result; + #if HAVE_SETRLIMIT && defined RLIMIT_STACK + /* Before starting the endless recursion, try to be friendly + to the user's machine. On some Linux 2.2.x systems, there + is no stack limit for user processes at all. We don't want + to kill such systems. */ + struct rlimit rl; + rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */ + setrlimit (RLIMIT_STACK, &rl); + #endif + + result = c_stack_action (); + if (result != 0) + return result; + return recurse (0); + } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_sys_xsi_stack_overflow_heuristic=yes +else case e in @%:@( + e) ac_cv_sys_xsi_stack_overflow_heuristic=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_xsi_stack_overflow_heuristic" >&5 +printf "%s\n" "$ac_cv_sys_xsi_stack_overflow_heuristic" >&6; } + + if test $ac_cv_sys_xsi_stack_overflow_heuristic = yes; then + +printf "%s\n" "@%:@define HAVE_XSI_STACK_OVERFLOW_HEURISTIC 1" >>confdefs.h + + fi + fi + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + + +@%:@ Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else case e in @%:@( + e) with_gnu_ld=no ;; +esac +fi + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld" >&5 +printf %s "checking for ld... " >&6; } +elif test "$GCC" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } +elif test "$with_gnu_ld" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test -n "$LD"; then + # Let the user override the test with a path. + : +else + if test ${acl_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + acl_cv_path_LD= # Final result of this test + ac_prog=ld # Program to search in $PATH + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + acl_output=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $acl_output in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` + while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do + acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` + done + # Got the pathname. No search in PATH is needed. + acl_cv_path_LD="$acl_output" + ac_prog= + ;; + "") + # If it fails, then pretend we aren't using GCC. + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac + fi + if test -n "$ac_prog"; then + # Search for $ac_prog in $PATH. + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$acl_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 conftest.$ac_ext +/* end confdefs.h. */ +#if defined __powerpc64__ || defined _ARCH_PPC64 + yes + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + # The compiler produces 64-bit code. Add option '-b64' so that the + # linker groks 64-bit object files. + case "$acl_cv_path_LD " in + *" -b64 "*) ;; + *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;; + esac + +fi +rm -rf conftest* + + ;; + esac + ;; +esac +fi + + LD="$acl_cv_path_LD" +fi +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${acl_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +printf "%s\n" "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +printf %s "checking for shared library run path origin... " >&6; } +if test ${acl_cv_rpath+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +printf "%s\n" "$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + @%:@ Check whether --enable-rpath was given. +if test ${enable_rpath+y} +then : + enableval=$enable_rpath; : +else case e in @%:@( + e) enable_rpath=yes ;; +esac +fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5 +printf %s "checking for the common suffixes of directories in the library search path... " >&6; } +if test ${acl_cv_libdirstems+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) acl_libdirstem=lib + acl_libdirstem2= + case "$host_os" in + solaris*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 +printf %s "checking for 64-bit host... " >&6; } +if test ${gl_cv_solaris_64bit+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _LP64 +sixtyfour bits +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "sixtyfour bits" >/dev/null 2>&1 +then : + gl_cv_solaris_64bit=yes +else case e in @%:@( + e) gl_cv_solaris_64bit=no ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 +printf "%s\n" "$gl_cv_solaris_64bit" >&6; } + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; + esac + fi + ;; + *) + searchpath=`(if test -f /usr/bin/gcc \ + && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \ + LC_ALL=C /usr/bin/gcc -print-search-dirs; \ + else \ + LC_ALL=C $CC -print-search-dirs; \ + fi) 2>/dev/null \ + | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_libdirstems" >&5 +printf "%s\n" "$acl_cv_libdirstems" >&6; } + # Decompose acl_cv_libdirstems into acl_libdirstem and acl_libdirstem2. + acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` + acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e '/,/s/.*,//'` + + + + + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +@%:@ Check whether --with-libsigsegv-prefix was given. +if test ${with_libsigsegv_prefix+y} +then : + withval=$with_libsigsegv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBSIGSEGV= + LTLIBSIGSEGV= + INCSIGSEGV= + LIBSIGSEGV_PREFIX= + HAVE_LIBSIGSEGV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='sigsegv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_a" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCSIGSEGV="${INCSIGSEGV}${INCSIGSEGV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$dep" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$dep" + ;; + esac + done + fi + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-R$found_dir" + done + fi + + + + + + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCSIGSEGV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsigsegv" >&5 +printf %s "checking for libsigsegv... " >&6; } +if test ${ac_cv_libsigsegv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + ac_save_LIBS="$LIBS" + case " $LIBSIGSEGV" in + *" -l"*) LIBS="$LIBS $LIBSIGSEGV" ;; + *) LIBS="$LIBSIGSEGV $LIBS" ;; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +sigsegv_deinstall_handler(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libsigsegv=yes +else case e in @%:@( + e) ac_cv_libsigsegv='no, consider installing GNU libsigsegv' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libsigsegv" >&5 +printf "%s\n" "$ac_cv_libsigsegv" >&6; } + if test "$ac_cv_libsigsegv" = yes; then + HAVE_LIBSIGSEGV=yes + +printf "%s\n" "@%:@define HAVE_LIBSIGSEGV 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libsigsegv" >&5 +printf %s "checking how to link with libsigsegv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBSIGSEGV" >&5 +printf "%s\n" "$LIBSIGSEGV" >&6; } + else + HAVE_LIBSIGSEGV=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBSIGSEGV= + LTLIBSIGSEGV= + LIBSIGSEGV_PREFIX= + fi + + + + + + + + gl_cv_lib_sigsegv="$ac_cv_libsigsegv" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in @%:@( + e) # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +extern void ac_decl (int, char *); + +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else case e in @%:@( + e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; +esac +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in @%:@( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See 'config.log' for more details" "$LINENO" 5; } ;; @%:@( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; @%:@( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac + + + + GNULIB_CHDIR=0; + GNULIB_CHOWN=0; + GNULIB_CLOSE=0; + GNULIB_DUP=0; + GNULIB_DUP2=0; + GNULIB_DUP3=0; + GNULIB_ENVIRON=0; + GNULIB_EUIDACCESS=0; + GNULIB_FACCESSAT=0; + GNULIB_FCHDIR=0; + GNULIB_FCHOWNAT=0; + GNULIB_FDATASYNC=0; + GNULIB_FSYNC=0; + GNULIB_FTRUNCATE=0; + GNULIB_GETCWD=0; + GNULIB_GETDOMAINNAME=0; + GNULIB_GETDTABLESIZE=0; + GNULIB_GETGROUPS=0; + GNULIB_GETHOSTNAME=0; + GNULIB_GETLOGIN=0; + GNULIB_GETLOGIN_R=0; + GNULIB_GETPAGESIZE=0; + GNULIB_GETUSERSHELL=0; + GNULIB_GROUP_MEMBER=0; + GNULIB_ISATTY=0; + GNULIB_LCHOWN=0; + GNULIB_LINK=0; + GNULIB_LINKAT=0; + GNULIB_LSEEK=0; + GNULIB_PIPE=0; + GNULIB_PIPE2=0; + GNULIB_PREAD=0; + GNULIB_PWRITE=0; + GNULIB_READ=0; + GNULIB_READLINK=0; + GNULIB_READLINKAT=0; + GNULIB_RMDIR=0; + GNULIB_SETHOSTNAME=0; + GNULIB_SLEEP=0; + GNULIB_SYMLINK=0; + GNULIB_SYMLINKAT=0; + GNULIB_TRUNCATE=0; + GNULIB_TTYNAME_R=0; + GNULIB_UNISTD_H_NONBLOCKING=0; + GNULIB_UNISTD_H_SIGPIPE=0; + GNULIB_UNLINK=0; + GNULIB_UNLINKAT=0; + GNULIB_USLEEP=0; + GNULIB_WRITE=0; + HAVE_CHOWN=1; + HAVE_DUP2=1; + HAVE_DUP3=1; + HAVE_EUIDACCESS=1; + HAVE_FACCESSAT=1; + HAVE_FCHDIR=1; + HAVE_FCHOWNAT=1; + HAVE_FDATASYNC=1; + HAVE_FSYNC=1; + HAVE_FTRUNCATE=1; + HAVE_GETDTABLESIZE=1; + HAVE_GETGROUPS=1; + HAVE_GETHOSTNAME=1; + HAVE_GETLOGIN=1; + HAVE_GETPAGESIZE=1; + HAVE_GROUP_MEMBER=1; + HAVE_LCHOWN=1; + HAVE_LINK=1; + HAVE_LINKAT=1; + HAVE_PIPE=1; + HAVE_PIPE2=1; + HAVE_PREAD=1; + HAVE_PWRITE=1; + HAVE_READLINK=1; + HAVE_READLINKAT=1; + HAVE_SETHOSTNAME=1; + HAVE_SLEEP=1; + HAVE_SYMLINK=1; + HAVE_SYMLINKAT=1; + HAVE_TRUNCATE=1; + HAVE_UNLINKAT=1; + HAVE_USLEEP=1; + HAVE_DECL_ENVIRON=1; + HAVE_DECL_FCHDIR=1; + HAVE_DECL_FDATASYNC=1; + HAVE_DECL_GETDOMAINNAME=1; + HAVE_DECL_GETLOGIN=1; + HAVE_DECL_GETLOGIN_R=1; + HAVE_DECL_GETPAGESIZE=1; + HAVE_DECL_GETUSERSHELL=1; + HAVE_DECL_SETHOSTNAME=1; + HAVE_DECL_TTYNAME_R=1; + HAVE_OS_H=0; + HAVE_SYS_PARAM_H=0; + REPLACE_CHOWN=0; + REPLACE_CLOSE=0; + REPLACE_DUP=0; + REPLACE_DUP2=0; + REPLACE_FCHOWNAT=0; + REPLACE_FTRUNCATE=0; + REPLACE_GETCWD=0; + REPLACE_GETDOMAINNAME=0; + REPLACE_GETDTABLESIZE=0; + REPLACE_GETLOGIN_R=0; + REPLACE_GETGROUPS=0; + REPLACE_GETPAGESIZE=0; + REPLACE_ISATTY=0; + REPLACE_LCHOWN=0; + REPLACE_LINK=0; + REPLACE_LINKAT=0; + REPLACE_LSEEK=0; + REPLACE_PREAD=0; + REPLACE_PWRITE=0; + REPLACE_READ=0; + REPLACE_READLINK=0; + REPLACE_READLINKAT=0; + REPLACE_RMDIR=0; + REPLACE_SLEEP=0; + REPLACE_SYMLINK=0; + REPLACE_SYMLINKAT=0; + REPLACE_TRUNCATE=0; + REPLACE_TTYNAME_R=0; + REPLACE_UNLINK=0; + REPLACE_UNLINKAT=0; + REPLACE_USLEEP=0; + REPLACE_WRITE=0; + UNISTD_H_HAVE_WINSOCK2_H=0; + UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; + + + + + + if test $ac_cv_func__set_invalid_parameter_handler = yes; then + HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 + +printf "%s\n" "@%:@define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h + + else + HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 + fi + + + + GNULIB_IOCTL=0; + SYS_IOCTL_H_HAVE_WINSOCK2_H=0; + SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; + + REPLACE_IOCTL=0; + + + + GNULIB_ISBLANK=0; + HAVE_ISBLANK=1; + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5 +printf %s "checking whether the preprocessor supports include_next... " >&6; } +if test ${gl_cv_have_include_next+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) rm -rf conftestd1a conftestd1b conftestd2 + mkdir conftestd1a conftestd1b conftestd2 + cat < conftestd1a/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include_next +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat < conftestd1b/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include +#include_next +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat < conftestd2/conftest.h +#ifndef DEFINED_IN_CONFTESTD1 +#error "include_next test doesn't work" +#endif +#define DEFINED_IN_CONFTESTD2 +EOF + gl_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_have_include_next=yes +else case e in @%:@( + e) CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_have_include_next=buggy +else case e in @%:@( + e) gl_cv_have_include_next=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CPPFLAGS="$gl_save_CPPFLAGS" + rm -rf conftestd1a conftestd1b conftestd2 + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5 +printf "%s\n" "$gl_cv_have_include_next" >&6; } + PRAGMA_SYSTEM_HEADER= + if test $gl_cv_have_include_next = yes; then + INCLUDE_NEXT=include_next + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + if test -n "$GCC"; then + PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' + fi + else + if test $gl_cv_have_include_next = buggy; then + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + else + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include + fi + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5 +printf %s "checking whether system header files limit the line length... " >&6; } +if test ${gl_cv_pragma_columns+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __TANDEM +choke me +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "choke me" >/dev/null 2>&1 +then : + gl_cv_pragma_columns=yes +else case e in @%:@( + e) gl_cv_pragma_columns=no ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5 +printf "%s\n" "$gl_cv_pragma_columns" >&6; } + if test $gl_cv_pragma_columns = yes; then + PRAGMA_COLUMNS="#pragma COLUMNS 10000" + else + PRAGMA_COLUMNS= + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 +printf %s "checking whether // is distinct from /... " >&6; } +if test ${gl_cv_double_slash_root+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # . + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + gl_cv_double_slash_root='unknown, assuming no' ;; + esac + else + set x `ls -di / // 2>/dev/null` + if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 +printf "%s\n" "$gl_cv_double_slash_root" >&6; } + if test "$gl_cv_double_slash_root" = yes; then + +printf "%s\n" "@%:@define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h + + fi + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5 +printf %s "checking if environ is properly declared... " >&6; } + if test ${gt_cv_var_environ_declaration+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_UNISTD_H + #include + #endif + /* mingw, BeOS, Haiku declare environ in , not in . */ + #include + + extern struct { int foo; } environ; +int +main (void) +{ +environ.foo = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_var_environ_declaration=no +else case e in @%:@( + e) gt_cv_var_environ_declaration=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5 +printf "%s\n" "$gt_cv_var_environ_declaration" >&6; } + if test $gt_cv_var_environ_declaration = yes; then + +printf "%s\n" "@%:@define HAVE_ENVIRON_DECL 1" >>confdefs.h + + fi + + + if test $gt_cv_var_environ_declaration != yes; then + HAVE_DECL_ENVIRON=0 + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5 +printf %s "checking for complete errno.h... " >&6; } +if test ${gl_cv_header_errno_h_complete+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if !defined ETXTBSY +booboo +#endif +#if !defined ENOMSG +booboo +#endif +#if !defined EIDRM +booboo +#endif +#if !defined ENOLINK +booboo +#endif +#if !defined EPROTO +booboo +#endif +#if !defined EMULTIHOP +booboo +#endif +#if !defined EBADMSG +booboo +#endif +#if !defined EOVERFLOW +booboo +#endif +#if !defined ENOTSUP +booboo +#endif +#if !defined ENETRESET +booboo +#endif +#if !defined ECONNABORTED +booboo +#endif +#if !defined ESTALE +booboo +#endif +#if !defined EDQUOT +booboo +#endif +#if !defined ECANCELED +booboo +#endif +#if !defined EOWNERDEAD +booboo +#endif +#if !defined ENOTRECOVERABLE +booboo +#endif +#if !defined EILSEQ +booboo +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "booboo" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_complete=no +else case e in @%:@( + e) gl_cv_header_errno_h_complete=yes ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5 +printf "%s\n" "$gl_cv_header_errno_h_complete" >&6; } + if test $gl_cv_header_errno_h_complete = yes; then + ERRNO_H='' + else + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_errno_h='<'errno.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_errno_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'errno.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_errno_h + gl_cv_next_errno_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5 +printf "%s\n" "$gl_cv_next_errno_h" >&6; } + fi + NEXT_ERRNO_H=$gl_cv_next_errno_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'errno.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_errno_h + fi + NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive + + + + + ERRNO_H='errno.h' + fi + + if test -n "$ERRNO_H"; then + GL_GENERATE_ERRNO_H_TRUE= + GL_GENERATE_ERRNO_H_FALSE='#' +else + GL_GENERATE_ERRNO_H_TRUE='#' + GL_GENERATE_ERRNO_H_FALSE= +fi + + + if test -n "$ERRNO_H"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5 +printf %s "checking for EMULTIHOP value... " >&6; } +if test ${gl_cv_header_errno_h_EMULTIHOP+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef EMULTIHOP +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EMULTIHOP=yes +else case e in @%:@( + e) gl_cv_header_errno_h_EMULTIHOP=no ;; +esac +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EMULTIHOP = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#ifdef EMULTIHOP +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EMULTIHOP=hidden +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then + if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +" +then : + +fi + + fi + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5 +printf "%s\n" "$gl_cv_header_errno_h_EMULTIHOP" >&6; } + case $gl_cv_header_errno_h_EMULTIHOP in + yes | no) + EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE= + ;; + *) + EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP" + ;; + esac + + + fi + + + if test -n "$ERRNO_H"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5 +printf %s "checking for ENOLINK value... " >&6; } +if test ${gl_cv_header_errno_h_ENOLINK+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef ENOLINK +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_ENOLINK=yes +else case e in @%:@( + e) gl_cv_header_errno_h_ENOLINK=no ;; +esac +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_ENOLINK = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#ifdef ENOLINK +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_ENOLINK=hidden +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_ENOLINK = hidden; then + if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +" +then : + +fi + + fi + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5 +printf "%s\n" "$gl_cv_header_errno_h_ENOLINK" >&6; } + case $gl_cv_header_errno_h_ENOLINK in + yes | no) + ENOLINK_HIDDEN=0; ENOLINK_VALUE= + ;; + *) + ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK" + ;; + esac + + + fi + + + if test -n "$ERRNO_H"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5 +printf %s "checking for EOVERFLOW value... " >&6; } +if test ${gl_cv_header_errno_h_EOVERFLOW+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EOVERFLOW=yes +else case e in @%:@( + e) gl_cv_header_errno_h_EOVERFLOW=no ;; +esac +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EOVERFLOW = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EOVERFLOW=hidden +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then + if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +" +then : + +fi + + fi + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5 +printf "%s\n" "$gl_cv_header_errno_h_EOVERFLOW" >&6; } + case $gl_cv_header_errno_h_EOVERFLOW in + yes | no) + EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE= + ;; + *) + EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW" + ;; + esac + + + fi + + +ac_fn_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strerror_r" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_STRERROR_R $ac_have_decl" >>confdefs.h + + +if test $ac_cv_have_decl_strerror_r = yes; then + # For backward compatibility's sake, define HAVE_STRERROR_R. + # (We used to run AC_CHECK_FUNCS_ONCE for strerror_r, as well + # as AC_CHECK_DECLS_ONCE.) + +printf "%s\n" "@%:@define HAVE_STRERROR_R 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 +printf %s "checking whether strerror_r returns char *... " >&6; } +if test ${ac_cv_func_strerror_r_char_p+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + ac_cv_func_strerror_r_char_p=no + if test $ac_cv_have_decl_strerror_r = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main (void) +{ + + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + char *p = strerror_r (0, buf, sizeof buf); + return !p || x; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_func_strerror_r_char_p=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 +printf "%s\n" "$ac_cv_func_strerror_r_char_p" >&6; } +if test $ac_cv_func_strerror_r_char_p = yes; then + +printf "%s\n" "@%:@define STRERROR_R_CHAR_P 1" >>confdefs.h + +fi + + + XGETTEXT_EXTRA_OPTIONS= + + + + + + GNULIB_FCNTL=0; + GNULIB_NONBLOCKING=0; + GNULIB_OPEN=0; + GNULIB_OPENAT=0; + HAVE_FCNTL=1; + HAVE_OPENAT=1; + REPLACE_FCNTL=0; + REPLACE_OPEN=0; + REPLACE_OPENAT=0; + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5 +printf %s "checking for working fcntl.h... " >&6; } +if test ${gl_cv_header_working_fcntl_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + gl_cv_header_working_fcntl_h=cross-compiling +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #if HAVE_UNISTD_H + # include + #else /* on Windows with MSVC */ + # include + # include + # defined sleep(n) _sleep ((n) * 1000) + #endif + #include + #ifndef O_NOATIME + #define O_NOATIME 0 + #endif + #ifndef O_NOFOLLOW + #define O_NOFOLLOW 0 + #endif + static int const constants[] = + { + O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, + O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY + }; + +int +main (void) +{ + + int result = !constants; + #if HAVE_SYMLINK + { + static char const sym[] = "conftest.sym"; + if (symlink ("/dev/null", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + if (unlink (sym) != 0 || symlink (".", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_RDONLY | O_NOFOLLOW); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + unlink (sym); + } + #endif + { + static char const file[] = "confdefs.h"; + int fd = open (file, O_RDONLY | O_NOATIME); + if (fd < 0) + result |= 8; + else + { + struct stat st0; + if (fstat (fd, &st0) != 0) + result |= 16; + else + { + char c; + sleep (1); + if (read (fd, &c, 1) != 1) + result |= 24; + else + { + if (close (fd) != 0) + result |= 32; + else + { + struct stat st1; + if (stat (file, &st1) != 0) + result |= 40; + else + if (st0.st_atime != st1.st_atime) + result |= 64; + } + } + } + } + } + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_header_working_fcntl_h=yes +else case e in @%:@( + e) case $? in #( + 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( + 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( + 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( + *) gl_cv_header_working_fcntl_h='no';; + esac ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5 +printf "%s\n" "$gl_cv_header_working_fcntl_h" >&6; } + + case $gl_cv_header_working_fcntl_h in #( + *O_NOATIME* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + +printf "%s\n" "@%:@define HAVE_WORKING_O_NOATIME $ac_val" >>confdefs.h + + + case $gl_cv_header_working_fcntl_h in #( + *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + +printf "%s\n" "@%:@define HAVE_WORKING_O_NOFOLLOW $ac_val" >>confdefs.h + + + + ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default +" +if test "x$ac_cv_type_pid_t" = xyes +then : + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_pid_type='int' +else case e in @%:@( + e) ac_pid_type='__int64' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +printf "%s\n" "@%:@define pid_t $ac_pid_type" >>confdefs.h + + ;; +esac +fi + + +ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define mode_t int" >>confdefs.h + ;; +esac +fi + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 +printf %s "checking for mbstate_t... " >&6; } +if test ${ac_cv_type_mbstate_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int +main (void) +{ +mbstate_t x; return sizeof x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_type_mbstate_t=yes +else case e in @%:@( + e) ac_cv_type_mbstate_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5 +printf "%s\n" "$ac_cv_type_mbstate_t" >&6; } + if test $ac_cv_type_mbstate_t = yes; then + +printf "%s\n" "@%:@define HAVE_MBSTATE_T 1" >>confdefs.h + + else + +printf "%s\n" "@%:@define mbstate_t int" >>confdefs.h + + fi + + + + + + + + + + GNULIB_DPRINTF=0; + GNULIB_FCLOSE=0; + GNULIB_FDOPEN=0; + GNULIB_FFLUSH=0; + GNULIB_FGETC=0; + GNULIB_FGETS=0; + GNULIB_FOPEN=0; + GNULIB_FPRINTF=0; + GNULIB_FPRINTF_POSIX=0; + GNULIB_FPURGE=0; + GNULIB_FPUTC=0; + GNULIB_FPUTS=0; + GNULIB_FREAD=0; + GNULIB_FREOPEN=0; + GNULIB_FSCANF=0; + GNULIB_FSEEK=0; + GNULIB_FSEEKO=0; + GNULIB_FTELL=0; + GNULIB_FTELLO=0; + GNULIB_FWRITE=0; + GNULIB_GETC=0; + GNULIB_GETCHAR=0; + GNULIB_GETDELIM=0; + GNULIB_GETLINE=0; + GNULIB_OBSTACK_PRINTF=0; + GNULIB_OBSTACK_PRINTF_POSIX=0; + GNULIB_PCLOSE=0; + GNULIB_PERROR=0; + GNULIB_POPEN=0; + GNULIB_PRINTF=0; + GNULIB_PRINTF_POSIX=0; + GNULIB_PUTC=0; + GNULIB_PUTCHAR=0; + GNULIB_PUTS=0; + GNULIB_REMOVE=0; + GNULIB_RENAME=0; + GNULIB_RENAMEAT=0; + GNULIB_SCANF=0; + GNULIB_SNPRINTF=0; + GNULIB_SPRINTF_POSIX=0; + GNULIB_STDIO_H_NONBLOCKING=0; + GNULIB_STDIO_H_SIGPIPE=0; + GNULIB_TMPFILE=0; + GNULIB_VASPRINTF=0; + GNULIB_VFSCANF=0; + GNULIB_VSCANF=0; + GNULIB_VDPRINTF=0; + GNULIB_VFPRINTF=0; + GNULIB_VFPRINTF_POSIX=0; + GNULIB_VPRINTF=0; + GNULIB_VPRINTF_POSIX=0; + GNULIB_VSNPRINTF=0; + GNULIB_VSPRINTF_POSIX=0; + HAVE_DECL_FPURGE=1; + HAVE_DECL_FSEEKO=1; + HAVE_DECL_FTELLO=1; + HAVE_DECL_GETDELIM=1; + HAVE_DECL_GETLINE=1; + HAVE_DECL_OBSTACK_PRINTF=1; + HAVE_DECL_SNPRINTF=1; + HAVE_DECL_VSNPRINTF=1; + HAVE_DPRINTF=1; + HAVE_FSEEKO=1; + HAVE_FTELLO=1; + HAVE_PCLOSE=1; + HAVE_POPEN=1; + HAVE_RENAMEAT=1; + HAVE_VASPRINTF=1; + HAVE_VDPRINTF=1; + REPLACE_DPRINTF=0; + REPLACE_FCLOSE=0; + REPLACE_FDOPEN=0; + REPLACE_FFLUSH=0; + REPLACE_FOPEN=0; + REPLACE_FPRINTF=0; + REPLACE_FPURGE=0; + REPLACE_FREOPEN=0; + REPLACE_FSEEK=0; + REPLACE_FSEEKO=0; + REPLACE_FTELL=0; + REPLACE_FTELLO=0; + REPLACE_GETDELIM=0; + REPLACE_GETLINE=0; + REPLACE_OBSTACK_PRINTF=0; + REPLACE_PERROR=0; + REPLACE_POPEN=0; + REPLACE_PRINTF=0; + REPLACE_REMOVE=0; + REPLACE_RENAME=0; + REPLACE_RENAMEAT=0; + REPLACE_SNPRINTF=0; + REPLACE_SPRINTF=0; + REPLACE_STDIO_READ_FUNCS=0; + REPLACE_STDIO_WRITE_FUNCS=0; + REPLACE_TMPFILE=0; + REPLACE_VASPRINTF=0; + REPLACE_VDPRINTF=0; + REPLACE_VFPRINTF=0; + REPLACE_VPRINTF=0; + REPLACE_VSNPRINTF=0; + REPLACE_VSPRINTF=0; + + + GNULIB_FCHMODAT=0; + GNULIB_FSTAT=0; + GNULIB_FSTATAT=0; + GNULIB_FUTIMENS=0; + GNULIB_LCHMOD=0; + GNULIB_LSTAT=0; + GNULIB_MKDIRAT=0; + GNULIB_MKFIFO=0; + GNULIB_MKFIFOAT=0; + GNULIB_MKNOD=0; + GNULIB_MKNODAT=0; + GNULIB_STAT=0; + GNULIB_UTIMENSAT=0; + GNULIB_OVERRIDES_STRUCT_STAT=0; + HAVE_FCHMODAT=1; + HAVE_FSTATAT=1; + HAVE_FUTIMENS=1; + HAVE_LCHMOD=1; + HAVE_LSTAT=1; + HAVE_MKDIRAT=1; + HAVE_MKFIFO=1; + HAVE_MKFIFOAT=1; + HAVE_MKNOD=1; + HAVE_MKNODAT=1; + HAVE_UTIMENSAT=1; + REPLACE_FSTAT=0; + REPLACE_FSTATAT=0; + REPLACE_FUTIMENS=0; + REPLACE_LSTAT=0; + REPLACE_MKDIR=0; + REPLACE_MKFIFO=0; + REPLACE_MKNOD=0; + REPLACE_STAT=0; + REPLACE_UTIMENSAT=0; + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5 +printf %s "checking whether stat file-mode macros are broken... " >&6; } +if test ${ac_cv_header_stat_broken+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +#if defined S_ISBLK && defined S_IFDIR +extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; +#endif + +#if defined S_ISBLK && defined S_IFCHR +extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; +#endif + +#if defined S_ISLNK && defined S_IFREG +extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; +#endif + +#if defined S_ISSOCK && defined S_IFREG +extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_header_stat_broken=no +else case e in @%:@( + e) ac_cv_header_stat_broken=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 +printf "%s\n" "$ac_cv_header_stat_broken" >&6; } +if test $ac_cv_header_stat_broken = yes; then + +printf "%s\n" "@%:@define STAT_MACROS_BROKEN 1" >>confdefs.h + +fi + + + + case "$host_os" in + mingw*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5 +printf %s "checking for 64-bit off_t... " >&6; } +if test ${gl_cv_type_off_t_64+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_off_t_64=yes +else case e in @%:@( + e) gl_cv_type_off_t_64=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5 +printf "%s\n" "$gl_cv_type_off_t_64" >&6; } + if test $gl_cv_type_off_t_64 = no; then + WINDOWS_64_BIT_OFF_T=1 + else + WINDOWS_64_BIT_OFF_T=0 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5 +printf %s "checking for 64-bit st_size... " >&6; } +if test ${gl_cv_member_st_size_64+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + struct stat buf; + int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_member_st_size_64=yes +else case e in @%:@( + e) gl_cv_member_st_size_64=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5 +printf "%s\n" "$gl_cv_member_st_size_64" >&6; } + if test $gl_cv_member_st_size_64 = no; then + WINDOWS_64_BIT_ST_SIZE=1 + else + WINDOWS_64_BIT_ST_SIZE=0 + fi + ;; + *) + WINDOWS_64_BIT_OFF_T=0 + WINDOWS_64_BIT_ST_SIZE=0 + ;; + esac + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_stat_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_stat_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/stat.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_stat_h + gl_cv_next_sys_stat_h='"'$gl_header'"' + else + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 +printf "%s\n" "$gl_cv_next_sys_stat_h" >&6; } + fi + NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/stat.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_stat_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive + + + + + + + + + WINDOWS_STAT_TIMESPEC=0 + + + + + + + + + ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include + #include +" +if test "x$ac_cv_type_nlink_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define nlink_t int" >>confdefs.h + ;; +esac +fi + + + + for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + +ac_fn_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getdtablesize" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_GETDTABLESIZE $ac_have_decl" >>confdefs.h + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_getopt_h='<'getopt.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_getopt_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_getopt_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'getopt.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_getopt_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_getopt_h + gl_cv_next_getopt_h='"'$gl_header'"' + else + gl_cv_next_getopt_h='<'getopt.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_getopt_h" >&5 +printf "%s\n" "$gl_cv_next_getopt_h" >&6; } + fi + NEXT_GETOPT_H=$gl_cv_next_getopt_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'getopt.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_getopt_h + fi + NEXT_AS_FIRST_DIRECTIVE_GETOPT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_getopt_h = yes; then + HAVE_GETOPT_H=1 + else + HAVE_GETOPT_H=0 + fi + + + gl_replace_getopt= + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + for ac_header in getopt.h +do : + ac_fn_c_check_header_compile "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" +if test "x$ac_cv_header_getopt_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_GETOPT_H 1" >>confdefs.h + +else case e in @%:@( + e) gl_replace_getopt=yes ;; +esac +fi + +done + fi + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + + for ac_func in getopt_long_only +do : + ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only" +if test "x$ac_cv_func_getopt_long_only" = xyes +then : + printf "%s\n" "@%:@define HAVE_GETOPT_LONG_ONLY 1" >>confdefs.h + +else case e in @%:@( + e) gl_replace_getopt=yes ;; +esac +fi + +done + fi + + if test -z "$gl_replace_getopt"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getopt is POSIX compatible" >&5 +printf %s "checking whether getopt is POSIX compatible... " >&6; } +if test ${gl_cv_func_getopt_posix+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $cross_compiling = no; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See 'config.log' for more details" "$LINENO" 5; } +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char a[] = "-a"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, a, foo, bar, NULL }; + int c; + + c = getopt (4, argv, "ab"); + if (!(c == 'a')) + return 1; + c = getopt (4, argv, "ab"); + if (!(c == -1)) + return 2; + if (!(optind == 2)) + return 3; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_posix=maybe +else case e in @%:@( + e) gl_cv_func_getopt_posix=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + if test $gl_cv_func_getopt_posix = maybe; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See 'config.log' for more details" "$LINENO" 5; } +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char donald[] = "donald"; + static char p[] = "-p"; + static char billy[] = "billy"; + static char duck[] = "duck"; + static char a[] = "-a"; + static char bar[] = "bar"; + char *argv[] = { program, donald, p, billy, duck, a, bar, NULL }; + int c; + + c = getopt (7, argv, "+abp:q:"); + if (!(c == -1)) + return 4; + if (!(strcmp (argv[0], "program") == 0)) + return 5; + if (!(strcmp (argv[1], "donald") == 0)) + return 6; + if (!(strcmp (argv[2], "-p") == 0)) + return 7; + if (!(strcmp (argv[3], "billy") == 0)) + return 8; + if (!(strcmp (argv[4], "duck") == 0)) + return 9; + if (!(strcmp (argv[5], "-a") == 0)) + return 10; + if (!(strcmp (argv[6], "bar") == 0)) + return 11; + if (!(optind == 1)) + return 12; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_posix=maybe +else case e in @%:@( + e) gl_cv_func_getopt_posix=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + if test $gl_cv_func_getopt_posix = maybe; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See 'config.log' for more details" "$LINENO" 5; } +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char ab[] = "-ab"; + char *argv[3] = { program, ab, NULL }; + if (getopt (2, argv, "ab:") != 'a') + return 13; + if (getopt (2, argv, "ab:") != '?') + return 14; + if (optopt != 'b') + return 15; + if (optind != 2) + return 16; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_posix=yes +else case e in @%:@( + e) gl_cv_func_getopt_posix=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + else + case "$host_os" in + darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";; + *) gl_cv_func_getopt_posix="guessing yes";; + esac + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_posix" >&5 +printf "%s\n" "$gl_cv_func_getopt_posix" >&6; } + case "$gl_cv_func_getopt_posix" in + *no) gl_replace_getopt=yes ;; + esac + fi + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5 +printf %s "checking for working GNU getopt function... " >&6; } +if test ${gl_cv_func_getopt_gnu+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the + # optstring is necessary for programs like m4 that have POSIX-mandated + # semantics for supporting options interspersed with files. + # Also, since getopt_long is a GNU extension, we require optind=0. + # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT; + # so take care to revert to the correct (non-)export state. + gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }' + case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + +#include +#if defined __MACH__ && defined __APPLE__ +/* Avoid a crash on Mac OS X. */ +#include +#include +#include +#include +#include +#include +/* The exception port on which our thread listens. */ +static mach_port_t our_exception_port; +/* The main function of the thread listening for exceptions of type + EXC_BAD_ACCESS. */ +static void * +mach_exception_thread (void *arg) +{ + /* Buffer for a message to be received. */ + struct { + mach_msg_header_t head; + mach_msg_body_t msgh_body; + char data[1024]; + } msg; + mach_msg_return_t retval; + /* Wait for a message on the exception port. */ + retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), + our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + if (retval != MACH_MSG_SUCCESS) + abort (); + exit (1); +} +static void +nocrash_init (void) +{ + mach_port_t self = mach_task_self (); + /* Allocate a port on which the thread shall listen for exceptions. */ + if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) + == KERN_SUCCESS) { + /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ + if (mach_port_insert_right (self, our_exception_port, our_exception_port, + MACH_MSG_TYPE_MAKE_SEND) + == KERN_SUCCESS) { + /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting + for us. */ + exception_mask_t mask = EXC_MASK_BAD_ACCESS; + /* Create the thread listening on the exception port. */ + pthread_attr_t attr; + pthread_t thread; + if (pthread_attr_init (&attr) == 0 + && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 + && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { + pthread_attr_destroy (&attr); + /* Replace the exception port info for these exceptions with our own. + Note that we replace the exception port for the entire task, not only + for a particular thread. This has the effect that when our exception + port gets the message, the thread specific exception port has already + been asked, and we don't need to bother about it. + See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ + task_set_exception_ports (self, mask, our_exception_port, + EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); + } + } + } +} +#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Avoid a crash on native Windows. */ +#define WIN32_LEAN_AND_MEAN +#include +#include +static LONG WINAPI +exception_filter (EXCEPTION_POINTERS *ExceptionInfo) +{ + switch (ExceptionInfo->ExceptionRecord->ExceptionCode) + { + case EXCEPTION_ACCESS_VIOLATION: + case EXCEPTION_IN_PAGE_ERROR: + case EXCEPTION_STACK_OVERFLOW: + case EXCEPTION_GUARD_PAGE: + case EXCEPTION_PRIV_INSTRUCTION: + case EXCEPTION_ILLEGAL_INSTRUCTION: + case EXCEPTION_DATATYPE_MISALIGNMENT: + case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: + case EXCEPTION_NONCONTINUABLE_EXCEPTION: + exit (1); + } + return EXCEPTION_CONTINUE_SEARCH; +} +static void +nocrash_init (void) +{ + SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter); +} +#else +/* Avoid a crash on POSIX systems. */ +#include +#include +/* A POSIX signal handler. */ +static void +exception_handler (int sig) +{ + _exit (1); +} +static void +nocrash_init (void) +{ +#ifdef SIGSEGV + signal (SIGSEGV, exception_handler); +#endif +#ifdef SIGBUS + signal (SIGBUS, exception_handler); +#endif +} +#endif + + +int +main (void) +{ + + int result = 0; + + nocrash_init(); + + /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw, + and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5, + OSF/1 5.1, Solaris 10. */ + { + static char conftest[] = "conftest"; + static char plus[] = "-+"; + char *argv[3] = { conftest, plus, NULL }; + opterr = 0; + if (getopt (2, argv, "+a") != '?') + result |= 1; + } + /* This code succeeds on glibc 2.8, mingw, + and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11, + IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */ + { + static char program[] = "program"; + static char p[] = "-p"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, p, foo, bar, NULL }; + + optind = 1; + if (getopt (4, argv, "p::") != 'p') + result |= 2; + else if (optarg != NULL) + result |= 4; + else if (getopt (4, argv, "p::") != -1) + result |= 6; + else if (optind != 2) + result |= 8; + } + /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */ + { + static char program[] = "program"; + static char foo[] = "foo"; + static char p[] = "-p"; + char *argv[] = { program, foo, p, NULL }; + optind = 0; + if (getopt (3, argv, "-p") != 1) + result |= 16; + else if (getopt (3, argv, "-p") != 'p') + result |= 16; + } + /* This code fails on glibc 2.11. */ + { + static char program[] = "program"; + static char b[] = "-b"; + static char a[] = "-a"; + char *argv[] = { program, b, a, NULL }; + optind = opterr = 0; + if (getopt (3, argv, "+:a:b") != 'b') + result |= 32; + else if (getopt (3, argv, "+:a:b") != ':') + result |= 32; + } + /* This code dumps core on glibc 2.14. */ + { + static char program[] = "program"; + static char w[] = "-W"; + static char dummy[] = "dummy"; + char *argv[] = { program, w, dummy, NULL }; + optind = opterr = 1; + if (getopt (3, argv, "W;") != 'W') + result |= 64; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_gnu=yes +else case e in @%:@( + e) gl_cv_func_getopt_gnu=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + case $gl_had_POSIXLY_CORRECT in + exported) ;; + yes) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;}; POSIXLY_CORRECT=1 ;; + *) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;} ;; + esac + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5 +printf "%s\n" "$gl_cv_func_getopt_gnu" >&6; } + if test "$gl_cv_func_getopt_gnu" != yes; then + gl_replace_getopt=yes + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt_long function" >&5 +printf %s "checking for working GNU getopt_long function... " >&6; } +if test ${gl_cv_func_getopt_long_gnu+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + openbsd*) gl_cv_func_getopt_long_gnu="guessing no";; + *) gl_cv_func_getopt_long_gnu="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + +int +main (void) +{ +static const struct option long_options[] = + { + { "xtremely-",no_argument, NULL, 1003 }, + { "xtra", no_argument, NULL, 1001 }, + { "xtreme", no_argument, NULL, 1002 }, + { "xtremely", no_argument, NULL, 1003 }, + { NULL, 0, NULL, 0 } + }; + /* This code fails on OpenBSD 5.0. */ + { + static char program[] = "program"; + static char xtremel[] = "--xtremel"; + char *argv[] = { program, xtremel, NULL }; + int option_index; + optind = 1; opterr = 0; + if (getopt_long (2, argv, "", long_options, &option_index) != 1003) + return 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_long_gnu=yes +else case e in @%:@( + e) gl_cv_func_getopt_long_gnu=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_long_gnu" >&5 +printf "%s\n" "$gl_cv_func_getopt_long_gnu" >&6; } + case "$gl_cv_func_getopt_long_gnu" in + *yes) ;; + *) gl_replace_getopt=yes ;; + esac + fi + fi + + + + +: + + + + GNULIB_GETTIMEOFDAY=0; + HAVE_GETTIMEOFDAY=1; + HAVE_STRUCT_TIMEVAL=1; + HAVE_SYS_TIME_H=1; + REPLACE_GETTIMEOFDAY=0; + REPLACE_STRUCT_TIMEVAL=0; + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 +printf %s "checking for C/C++ restrict keyword... " >&6; } +if test ${ac_cv_c_restrict+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_c_restrict=no + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +typedef int *int_ptr; + int foo (int_ptr $ac_kw ip) { return ip[0]; } + int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ + int bar (int ip[$ac_kw]) { return ip[0]; } + +int +main (void) +{ +int s[1]; + int *$ac_kw t = s; + t[0] = 0; + return foo (t) + bar (t); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_restrict=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$ac_cv_c_restrict" != no && break + done + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 +printf "%s\n" "$ac_cv_c_restrict" >&6; } + + case $ac_cv_c_restrict in + restrict) ;; + no) printf "%s\n" "@%:@define restrict /**/" >>confdefs.h + ;; + *) printf "%s\n" "@%:@define restrict $ac_cv_c_restrict" >>confdefs.h + ;; + esac + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_time_h='<'sys/time.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_time_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_time_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/time.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_time_h + gl_cv_next_sys_time_h='"'$gl_header'"' + else + gl_cv_next_sys_time_h='<'sys/time.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5 +printf "%s\n" "$gl_cv_next_sys_time_h" >&6; } + fi + NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/time.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_time_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive + + + + + + if test $ac_cv_header_sys_time_h != yes; then + HAVE_SYS_TIME_H=0 + fi + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5 +printf %s "checking for struct timeval... " >&6; } +if test ${gl_cv_sys_struct_timeval+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_SYS_TIME_H + #include + #endif + #include + #if HAVE_WINSOCK2_H + # include + #endif + +int +main (void) +{ +static struct timeval x; x.tv_sec = x.tv_usec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timeval=yes +else case e in @%:@( + e) gl_cv_sys_struct_timeval=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5 +printf "%s\n" "$gl_cv_sys_struct_timeval" >&6; } + if test $gl_cv_sys_struct_timeval != yes; then + HAVE_STRUCT_TIMEVAL=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5 +printf %s "checking for wide-enough struct timeval.tv_sec member... " >&6; } +if test ${gl_cv_sys_struct_timeval_tv_sec+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_SYS_TIME_H + #include + #endif + #include + #if HAVE_WINSOCK2_H + # include + #endif + +int +main (void) +{ +static struct timeval x; + typedef int verify_tv_sec_type[ + sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1 + ]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timeval_tv_sec=yes +else case e in @%:@( + e) gl_cv_sys_struct_timeval_tv_sec=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5 +printf "%s\n" "$gl_cv_sys_struct_timeval_tv_sec" >&6; } + if test $gl_cv_sys_struct_timeval_tv_sec != yes; then + REPLACE_STRUCT_TIMEVAL=1 + fi + fi + + + for gl_func in gettimeofday; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if HAVE_SYS_TIME_H +# include +#endif +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + NEED_LOCALTIME_BUFFER=0 + + + GNULIB_CTIME=0; + GNULIB_MKTIME=0; + GNULIB_LOCALTIME=0; + GNULIB_NANOSLEEP=0; + GNULIB_STRFTIME=0; + GNULIB_STRPTIME=0; + GNULIB_TIMEGM=0; + GNULIB_TIME_R=0; + GNULIB_TIME_RZ=0; + GNULIB_TZSET=0; + HAVE_DECL_LOCALTIME_R=1; + HAVE_NANOSLEEP=1; + HAVE_STRPTIME=1; + HAVE_TIMEGM=1; + HAVE_TZSET=1; + HAVE_TIMEZONE_T=0; + REPLACE_CTIME=GNULIB_PORTCHECK; + REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; + REPLACE_MKTIME=GNULIB_PORTCHECK; + REPLACE_NANOSLEEP=GNULIB_PORTCHECK; + REPLACE_STRFTIME=GNULIB_PORTCHECK; + REPLACE_TIMEGM=GNULIB_PORTCHECK; + REPLACE_TZSET=GNULIB_PORTCHECK; + + : ${GNULIB_GETTIMEOFDAY=0}; + REPLACE_GMTIME=0; + REPLACE_LOCALTIME=0; + + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +@%:@ Check whether --with-libiconv-prefix was given. +if test ${with_libiconv_prefix+y} +then : + withval=$with_libiconv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBICONV= + LTLIBICONV= + INCICONV= + LIBICONV_PREFIX= + HAVE_LIBICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + + + + + + + GNULIB_ICONV=0; + ICONV_CONST=; + REPLACE_ICONV=0; + REPLACE_ICONV_OPEN=0; + REPLACE_ICONV_UTF=0; + ICONV_H=''; + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + + + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +printf %s "checking for iconv... " >&6; } +if test ${am_cv_func_iconv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +printf "%s\n" "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +printf %s "checking for working iconv... " >&6; } +if test ${am_cv_func_iconv_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + if test "$cross_compiling" = yes +then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + +int +main (void) +{ +int result = 0; + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\263"; + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + result |= 8; + iconv_close (cd_88591_to_utf8); + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + result |= 16; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + am_cv_func_iconv_works=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + test "$am_cv_func_iconv_works" = no || break + done + LIBS="$am_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +printf "%s\n" "$am_cv_func_iconv_works" >&6; } + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + +printf "%s\n" "@%:@define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +printf %s "checking how to link with libiconv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +printf "%s\n" "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 +printf %s "checking for iconv declaration... " >&6; } + if test ${am_cv_proto_iconv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + am_cv_proto_iconv_arg1="" +else case e in @%:@( + e) am_cv_proto_iconv_arg1="const" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" ;; +esac +fi + + am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: + $am_cv_proto_iconv" >&5 +printf "%s\n" " + $am_cv_proto_iconv" >&6; } + else + am_cv_proto_iconv_arg1="" + fi + +printf "%s\n" "@%:@define ICONV_CONST $am_cv_proto_iconv_arg1" >>confdefs.h + + + if test -n "$am_cv_proto_iconv_arg1"; then + ICONV_CONST="const" + fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo (void) {return 0; } +$ac_kw foo_t foo (void) {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define off_t long int" >>confdefs.h + ;; +esac +fi + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_limits_h='<'limits.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_limits_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_limits_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'limits.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_limits_h + gl_cv_next_limits_h='"'$gl_header'"' + else + gl_cv_next_limits_h='<'limits.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5 +printf "%s\n" "$gl_cv_next_limits_h" >&6; } + fi + NEXT_LIMITS_H=$gl_cv_next_limits_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'limits.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_limits_h + fi + NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether limits.h has ULLONG_WIDTH etc." >&5 +printf %s "checking whether limits.h has ULLONG_WIDTH etc.... " >&6; } +if test ${gl_cv_header_limits_width+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include + int ullw = ULLONG_WIDTH; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_limits_width=yes +else case e in @%:@( + e) gl_cv_header_limits_width=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5 +printf "%s\n" "$gl_cv_header_limits_width" >&6; } + if test "$gl_cv_header_limits_width" = yes; then + LIMITS_H= + else + LIMITS_H=limits.h + fi + + if test -n "$LIMITS_H"; then + GL_GENERATE_LIMITS_H_TRUE= + GL_GENERATE_LIMITS_H_FALSE='#' +else + GL_GENERATE_LIMITS_H_TRUE='#' + GL_GENERATE_LIMITS_H_FALSE= +fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 +printf %s "checking for wint_t... " >&6; } +if test ${gt_cv_c_wint_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include + wint_t foo = (wchar_t)'\0'; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_c_wint_t=yes +else case e in @%:@( + e) gt_cv_c_wint_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 +printf "%s\n" "$gt_cv_c_wint_t" >&6; } + if test $gt_cv_c_wint_t = yes; then + +printf "%s\n" "@%:@define HAVE_WINT_T 1" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wint_t is too small" >&5 +printf %s "checking whether wint_t is too small... " >&6; } +if test ${gl_cv_type_wint_t_too_small+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +#endif +#include + int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wint_t_too_small=no +else case e in @%:@( + e) gl_cv_type_wint_t_too_small=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_too_small" >&5 +printf "%s\n" "$gl_cv_type_wint_t_too_small" >&6; } + if test $gl_cv_type_wint_t_too_small = yes; then + GNULIB_OVERRIDES_WINT_T=1 + else + GNULIB_OVERRIDES_WINT_T=0 + fi + else + GNULIB_OVERRIDES_WINT_T=0 + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 +printf %s "checking for unsigned long long int... " >&6; } +if test ${ac_cv_type_unsigned_long_long_int+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_type_unsigned_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; +int +main (void) +{ +/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in @%:@( + e) ac_cv_type_unsigned_long_long_int=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; } + if test $ac_cv_type_unsigned_long_long_int = yes; then + +printf "%s\n" "@%:@define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h + + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 +printf %s "checking for long long int... " >&6; } +if test ${ac_cv_type_long_long_int+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_type_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_long_long_int = yes; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include + @%:@ifndef LLONG_MAX + @%:@ define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + @%:@ define LLONG_MAX (HALF - 1 + HALF) + @%:@endif +int +main (void) +{ +long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + +else case e in @%:@( + e) ac_cv_type_long_long_int=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_long_long_int" >&6; } + if test $ac_cv_type_long_long_int = yes; then + +printf "%s\n" "@%:@define HAVE_LONG_LONG_INT 1" >>confdefs.h + + fi + + + + gl_cv_c_multiarch=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + arch= + prev= + for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do + if test -n "$prev"; then + case $word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$arch" || test "$arch" = "$word"; then + arch="$word" + else + gl_cv_c_multiarch=yes + fi + ;; + esac + prev= + else + if test "x$word" = "x-arch"; then + prev=arch + fi + fi + done + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $gl_cv_c_multiarch = yes; then + APPLE_UNIVERSAL_BUILD=1 + else + APPLE_UNIVERSAL_BUILD=0 + fi + + + + + + + + + if test $ac_cv_type_long_long_int = yes; then + HAVE_LONG_LONG_INT=1 + else + HAVE_LONG_LONG_INT=0 + fi + + + if test $ac_cv_type_unsigned_long_long_int = yes; then + HAVE_UNSIGNED_LONG_LONG_INT=1 + else + HAVE_UNSIGNED_LONG_LONG_INT=0 + fi + + + + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + + + if test $ac_cv_header_inttypes_h = yes; then + HAVE_INTTYPES_H=1 + else + HAVE_INTTYPES_H=0 + fi + + + if test $ac_cv_header_sys_types_h = yes; then + HAVE_SYS_TYPES_H=1 + else + HAVE_SYS_TYPES_H=0 + fi + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdint_h='<'stdint.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_stdint_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_stdint_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdint.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdint_h + gl_cv_next_stdint_h='"'$gl_header'"' + else + gl_cv_next_stdint_h='<'stdint.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5 +printf "%s\n" "$gl_cv_next_stdint_h" >&6; } + fi + NEXT_STDINT_H=$gl_cv_next_stdint_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdint.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdint_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_stdint_h = yes; then + HAVE_STDINT_H=1 + else + HAVE_STDINT_H=0 + fi + + + if test $ac_cv_header_stdint_h = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5 +printf %s "checking whether stdint.h conforms to C99... " >&6; } +if test ${gl_cv_header_working_stdint_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gl_cv_header_working_stdint_h=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 +#include +/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ +#if !(defined WCHAR_MIN && defined WCHAR_MAX) +#error "WCHAR_MIN, WCHAR_MAX not defined in " +#endif + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + +#ifdef INT8_MAX +int8_t a1 = INT8_MAX; +int8_t a1min = INT8_MIN; +#endif +#ifdef INT16_MAX +int16_t a2 = INT16_MAX; +int16_t a2min = INT16_MIN; +#endif +#ifdef INT32_MAX +int32_t a3 = INT32_MAX; +int32_t a3min = INT32_MIN; +#endif +#ifdef INT64_MAX +int64_t a4 = INT64_MAX; +int64_t a4min = INT64_MIN; +#endif +#ifdef UINT8_MAX +uint8_t b1 = UINT8_MAX; +#else +typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; +#endif +#ifdef UINT16_MAX +uint16_t b2 = UINT16_MAX; +#endif +#ifdef UINT32_MAX +uint32_t b3 = UINT32_MAX; +#endif +#ifdef UINT64_MAX +uint64_t b4 = UINT64_MAX; +#endif +int_least8_t c1 = INT8_C (0x7f); +int_least8_t c1max = INT_LEAST8_MAX; +int_least8_t c1min = INT_LEAST8_MIN; +int_least16_t c2 = INT16_C (0x7fff); +int_least16_t c2max = INT_LEAST16_MAX; +int_least16_t c2min = INT_LEAST16_MIN; +int_least32_t c3 = INT32_C (0x7fffffff); +int_least32_t c3max = INT_LEAST32_MAX; +int_least32_t c3min = INT_LEAST32_MIN; +int_least64_t c4 = INT64_C (0x7fffffffffffffff); +int_least64_t c4max = INT_LEAST64_MAX; +int_least64_t c4min = INT_LEAST64_MIN; +uint_least8_t d1 = UINT8_C (0xff); +uint_least8_t d1max = UINT_LEAST8_MAX; +uint_least16_t d2 = UINT16_C (0xffff); +uint_least16_t d2max = UINT_LEAST16_MAX; +uint_least32_t d3 = UINT32_C (0xffffffff); +uint_least32_t d3max = UINT_LEAST32_MAX; +uint_least64_t d4 = UINT64_C (0xffffffffffffffff); +uint_least64_t d4max = UINT_LEAST64_MAX; +int_fast8_t e1 = INT_FAST8_MAX; +int_fast8_t e1min = INT_FAST8_MIN; +int_fast16_t e2 = INT_FAST16_MAX; +int_fast16_t e2min = INT_FAST16_MIN; +int_fast32_t e3 = INT_FAST32_MAX; +int_fast32_t e3min = INT_FAST32_MIN; +int_fast64_t e4 = INT_FAST64_MAX; +int_fast64_t e4min = INT_FAST64_MIN; +uint_fast8_t f1 = UINT_FAST8_MAX; +uint_fast16_t f2 = UINT_FAST16_MAX; +uint_fast32_t f3 = UINT_FAST32_MAX; +uint_fast64_t f4 = UINT_FAST64_MAX; +#ifdef INTPTR_MAX +intptr_t g = INTPTR_MAX; +intptr_t gmin = INTPTR_MIN; +#endif +#ifdef UINTPTR_MAX +uintptr_t h = UINTPTR_MAX; +#endif +intmax_t i = INTMAX_MAX; +uintmax_t j = UINTMAX_MAX; + +/* Check that SIZE_MAX has the correct type, if possible. */ +#if 201112 <= __STDC_VERSION__ +int k = _Generic (SIZE_MAX, size_t: 0); +#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) +extern size_t k; +extern __typeof__ (SIZE_MAX) k; +#endif + +#include /* for CHAR_BIT */ +#define TYPE_MINIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) +#define TYPE_MAXIMUM(t) \ + ((t) ((t) 0 < (t) -1 \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) +struct s { + int check_PTRDIFF: + PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) + && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) + ? 1 : -1; + /* Detect bug in FreeBSD 6.0 / ia64. */ + int check_SIG_ATOMIC: + SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) + && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) + ? 1 : -1; + int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; + int check_WCHAR: + WCHAR_MIN == TYPE_MINIMUM (wchar_t) + && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) + ? 1 : -1; + /* Detect bug in mingw. */ + int check_WINT: + WINT_MIN == TYPE_MINIMUM (wint_t) + && WINT_MAX == TYPE_MAXIMUM (wint_t) + ? 1 : -1; + + /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ + int check_UINT8_C: + (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; + int check_UINT16_C: + (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; + + /* Detect bugs in OpenBSD 3.9 stdint.h. */ +#ifdef UINT8_MAX + int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; +#endif +#ifdef UINT16_MAX + int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; +#endif +#ifdef UINT32_MAX + int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; +#endif +#ifdef UINT64_MAX + int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; +#endif + int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; + int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; + int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; + int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; + int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; + int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; + int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; + int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; + int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; + int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; + int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; +}; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test "$cross_compiling" = yes +then : + gl_cv_header_working_stdint_h=yes + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 +#include + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + +#include +#include +#define MVAL(macro) MVAL1(macro) +#define MVAL1(expression) #expression +static const char *macro_values[] = + { +#ifdef INT8_MAX + MVAL (INT8_MAX), +#endif +#ifdef INT16_MAX + MVAL (INT16_MAX), +#endif +#ifdef INT32_MAX + MVAL (INT32_MAX), +#endif +#ifdef INT64_MAX + MVAL (INT64_MAX), +#endif +#ifdef UINT8_MAX + MVAL (UINT8_MAX), +#endif +#ifdef UINT16_MAX + MVAL (UINT16_MAX), +#endif +#ifdef UINT32_MAX + MVAL (UINT32_MAX), +#endif +#ifdef UINT64_MAX + MVAL (UINT64_MAX), +#endif + NULL + }; + +int +main (void) +{ + + const char **mv; + for (mv = macro_values; *mv != NULL; mv++) + { + const char *value = *mv; + /* Test whether it looks like a cast expression. */ + if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 + || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 + || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 + || strncmp (value, "((int)"/*)*/, 6) == 0 + || strncmp (value, "((signed short)"/*)*/, 15) == 0 + || strncmp (value, "((signed char)"/*)*/, 14) == 0) + return mv - macro_values + 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_header_working_stdint_h=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 +printf "%s\n" "$gl_cv_header_working_stdint_h" >&6; } + fi + + HAVE_C99_STDINT_H=0 + HAVE_SYS_BITYPES_H=0 + HAVE_SYS_INTTYPES_H=0 + STDINT_H=stdint.h + if test "$gl_cv_header_working_stdint_h" = yes; then + HAVE_C99_STDINT_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h predates C++11" >&5 +printf %s "checking whether stdint.h predates C++11... " >&6; } +if test ${gl_cv_header_stdint_predates_cxx11_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gl_cv_header_stdint_predates_cxx11_h=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + +intmax_t im = INTMAX_MAX; +int32_t i32 = INT32_C (0x7fffffff); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_stdint_predates_cxx11_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_predates_cxx11_h" >&5 +printf "%s\n" "$gl_cv_header_stdint_predates_cxx11_h" >&6; } + + if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + +printf "%s\n" "@%:@define __STDC_CONSTANT_MACROS 1" >>confdefs.h + + +printf "%s\n" "@%:@define __STDC_LIMIT_MACROS 1" >>confdefs.h + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5 +printf %s "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; } +if test ${gl_cv_header_stdint_width+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gl_cv_header_stdint_width=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 + #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + int iw = UINTMAX_WIDTH; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_stdint_width=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5 +printf "%s\n" "$gl_cv_header_stdint_width" >&6; } + if test "$gl_cv_header_stdint_width" = yes; then + STDINT_H= + fi + else + ac_fn_c_check_header_compile "$LINENO" "sys/inttypes.h" "ac_cv_header_sys_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_inttypes_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_SYS_INTTYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/bitypes.h" "ac_cv_header_sys_bitypes_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_bitypes_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_SYS_BITYPES_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_sys_inttypes_h = yes; then + HAVE_SYS_INTTYPES_H=1 + fi + if test $ac_cv_header_sys_bitypes_h = yes; then + HAVE_SYS_BITYPES_H=1 + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + + for gltype in ptrdiff_t size_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +printf %s "checking for bit size of $gltype... " >&6; } +if eval test \${gl_cv_bitsizeof_${gltype}+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + +#include " +then : + +else case e in @%:@( + e) result=unknown ;; +esac +fi + + eval gl_cv_bitsizeof_${gltype}=\$result + ;; +esac +fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + printf "%s\n" "@%:@define BITSIZEOF_${GLTYPE} $result" >>confdefs.h + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +printf %s "checking for bit size of $gltype... " >&6; } +if eval test \${gl_cv_bitsizeof_${gltype}+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + +#include " +then : + +else case e in @%:@( + e) result=unknown ;; +esac +fi + + eval gl_cv_bitsizeof_${gltype}=\$result + ;; +esac +fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + printf "%s\n" "@%:@define BITSIZEOF_${GLTYPE} $result" >>confdefs.h + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 +printf %s "checking whether $gltype is signed... " >&6; } +if eval test \${gl_cv_type_${gltype}_signed+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + result=yes +else case e in @%:@( + e) result=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval gl_cv_type_${gltype}_signed=\$result + ;; +esac +fi +eval ac_res=\$gl_cv_type_${gltype}_signed + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval result=\$gl_cv_type_${gltype}_signed + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + if test "$result" = yes; then + printf "%s\n" "@%:@define HAVE_SIGNED_${GLTYPE} 1" >>confdefs.h + + eval HAVE_SIGNED_${GLTYPE}=1 + else + eval HAVE_SIGNED_${GLTYPE}=0 + fi + done + + + gl_cv_type_ptrdiff_t_signed=yes + gl_cv_type_size_t_signed=no + if test $APPLE_UNIVERSAL_BUILD = 0; then + + + for gltype in ptrdiff_t size_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +printf %s "checking for $gltype integer literal suffix... " >&6; } +if eval test \${gl_cv_type_${gltype}_suffix+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + extern $gltype foo; + extern $gltype1 foo; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval gl_cv_type_${gltype}_suffix=\$glsuf +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done ;; +esac +fi +eval ac_res=\$gl_cv_type_${gltype}_suffix + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + printf "%s\n" "@%:@define ${GLTYPE}_SUFFIX $result" >>confdefs.h + + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +printf %s "checking for $gltype integer literal suffix... " >&6; } +if eval test \${gl_cv_type_${gltype}_suffix+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + extern $gltype foo; + extern $gltype1 foo; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval gl_cv_type_${gltype}_suffix=\$glsuf +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done ;; +esac +fi +eval ac_res=\$gl_cv_type_${gltype}_suffix + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + printf "%s\n" "@%:@define ${GLTYPE}_SUFFIX $result" >>confdefs.h + + done + + + + if test $GNULIB_OVERRIDES_WINT_T = 1; then + BITSIZEOF_WINT_T=32 + fi + + fi + + LIMITS_H=limits.h + if test -n "$LIMITS_H"; then + GL_GENERATE_LIMITS_H_TRUE= + GL_GENERATE_LIMITS_H_FALSE='#' +else + GL_GENERATE_LIMITS_H_TRUE='#' + GL_GENERATE_LIMITS_H_FALSE= +fi + + + + + + + if test -n "$STDINT_H"; then + GL_GENERATE_STDINT_H_TRUE= + GL_GENERATE_STDINT_H_FALSE='#' +else + GL_GENERATE_STDINT_H_TRUE='#' + GL_GENERATE_STDINT_H_FALSE= +fi + + + + GNULIB_IMAXABS=0; + GNULIB_IMAXDIV=0; + GNULIB_STRTOIMAX=0; + GNULIB_STRTOUMAX=0; + HAVE_DECL_IMAXABS=1; + HAVE_DECL_IMAXDIV=1; + HAVE_DECL_STRTOIMAX=1; + HAVE_DECL_STRTOUMAX=1; + REPLACE_STRTOIMAX=0; + REPLACE_STRTOUMAX=0; + INT32_MAX_LT_INTMAX_MAX=1; + INT64_MAX_EQ_LONG_MAX='defined _LP64'; + PRI_MACROS_BROKEN=0; + PRIPTR_PREFIX=__PRIPTR_PREFIX; + UINT32_MAX_LT_UINTMAX_MAX=1; + UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_inttypes_h='<'inttypes.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_inttypes_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_inttypes_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'inttypes.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_inttypes_h + gl_cv_next_inttypes_h='"'$gl_header'"' + else + gl_cv_next_inttypes_h='<'inttypes.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5 +printf "%s\n" "$gl_cv_next_inttypes_h" >&6; } + fi + NEXT_INTTYPES_H=$gl_cv_next_inttypes_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'inttypes.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_inttypes_h + fi + NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive + + + + + + + + + for gl_func in imaxabs imaxdiv strtoimax strtoumax; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + ac_fn_c_check_header_compile "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_inttypes_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_INTTYPES_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_inttypes_h = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5 +printf %s "checking whether the inttypes.h PRIxNN macros are broken... " >&6; } +if test ${gt_cv_inttypes_pri_broken+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef PRId32 +char *p = PRId32; +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_inttypes_pri_broken=no +else case e in @%:@( + e) gt_cv_inttypes_pri_broken=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5 +printf "%s\n" "$gt_cv_inttypes_pri_broken" >&6; } + fi + if test "$gt_cv_inttypes_pri_broken" = yes; then + +printf "%s\n" "@%:@define PRI_MACROS_BROKEN 1" >>confdefs.h + + PRI_MACROS_BROKEN=1 + else + PRI_MACROS_BROKEN=0 + fi + + + + GNULIB_ISWBLANK=0; + GNULIB_WCTYPE=0; + GNULIB_ISWCTYPE=0; + GNULIB_WCTRANS=0; + GNULIB_TOWCTRANS=0; + HAVE_ISWBLANK=1; + HAVE_WCTYPE_T=1; + HAVE_WCTRANS_T=1; + REPLACE_ISWBLANK=0; + + + + + + if test $ac_cv_header_crtdefs_h = yes; then + HAVE_CRTDEFS_H=1 + else + HAVE_CRTDEFS_H=0 + fi + + + + + + + + if test $ac_cv_func_iswcntrl = yes; then + HAVE_ISWCNTRL=1 + else + HAVE_ISWCNTRL=0 + fi + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wctype_h='<'wctype.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_wctype_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_wctype_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wctype_h + gl_cv_next_wctype_h='"'$gl_header'"' + else + gl_cv_next_wctype_h='<'wctype.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 +printf "%s\n" "$gl_cv_next_wctype_h" >&6; } + fi + NEXT_WCTYPE_H=$gl_cv_next_wctype_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'wctype.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_wctype_h + fi + NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_wctype_h = yes; then + if test $ac_cv_func_iswcntrl = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 +printf %s "checking whether iswcntrl works... " >&6; } +if test ${gl_cv_func_iswcntrl_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #if __GNU_LIBRARY__ == 1 + Linux libc5 i18n is broken. + #endif +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_iswcntrl_works="guessing yes" +else case e in @%:@( + e) gl_cv_func_iswcntrl_works="guessing no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + int main () { return iswprint ('x') == 0; } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_iswcntrl_works=yes +else case e in @%:@( + e) gl_cv_func_iswcntrl_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 +printf "%s\n" "$gl_cv_func_iswcntrl_works" >&6; } + fi + HAVE_WCTYPE_H=1 + else + HAVE_WCTYPE_H=0 + fi + + + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + fi + + if test $REPLACE_ISWCNTRL = 1; then + REPLACE_TOWLOWER=1 + else + ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" +if test "x$ac_cv_func_towlower" = xyes +then : + printf "%s\n" "@%:@define HAVE_TOWLOWER 1" >>confdefs.h + +fi + + if test $ac_cv_func_towlower = yes; then + REPLACE_TOWLOWER=0 + else + ac_fn_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_towlower" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_TOWLOWER $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_towlower = yes; then + REPLACE_TOWLOWER=1 + else + REPLACE_TOWLOWER=0 + fi + fi + fi + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then + : + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 +printf %s "checking for wctype_t... " >&6; } +if test ${gl_cv_type_wctype_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + wctype_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctype_t=yes +else case e in @%:@( + e) gl_cv_type_wctype_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 +printf "%s\n" "$gl_cv_type_wctype_t" >&6; } + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 +printf %s "checking for wctrans_t... " >&6; } +if test ${gl_cv_type_wctrans_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + wctrans_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctrans_t=yes +else case e in @%:@( + e) gl_cv_type_wctrans_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 +printf "%s\n" "$gl_cv_type_wctrans_t" >&6; } + if test $gl_cv_type_wctrans_t = no; then + HAVE_WCTRANS_T=0 + fi + + + for gl_func in wctype iswctype wctrans towctrans ; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +# include +#endif +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + GNULIB_NL_LANGINFO=0; + HAVE_NL_LANGINFO=1; + REPLACE_NL_LANGINFO=0; + + +ac_fn_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getc_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_GETC_UNLOCKED $ac_have_decl" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library >= 2.1 or uClibc" >&5 +printf %s "checking whether we are using the GNU C Library >= 2.1 or uClibc... " >&6; } +if test ${ac_cv_gnu_library_2_1+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif +#ifdef __UCLIBC__ + Lucky user +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "Lucky" >/dev/null 2>&1 +then : + ac_cv_gnu_library_2_1=yes +else case e in @%:@( + e) ac_cv_gnu_library_2_1=no ;; +esac +fi +rm -rf conftest* + + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5 +printf "%s\n" "$ac_cv_gnu_library_2_1" >&6; } + + GLIBC21="$ac_cv_gnu_library_2_1" + + + + GNULIB_LOCALECONV=0; + GNULIB_SETLOCALE=0; + GNULIB_DUPLOCALE=0; + HAVE_DUPLOCALE=1; + REPLACE_LOCALECONV=0; + REPLACE_SETLOCALE=0; + REPLACE_DUPLOCALE=0; + REPLACE_STRUCT_LCONV=0; + + + REPLACE_NULL=0; + HAVE_MAX_ALIGN_T=1; + HAVE_WCHAR_T=1; + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 +printf %s "checking for wchar_t... " >&6; } +if test ${gt_cv_c_wchar_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + wchar_t foo = (wchar_t)'\0'; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_c_wchar_t=yes +else case e in @%:@( + e) gt_cv_c_wchar_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 +printf "%s\n" "$gt_cv_c_wchar_t" >&6; } + if test $gt_cv_c_wchar_t = yes; then + +printf "%s\n" "@%:@define HAVE_WCHAR_T 1" >>confdefs.h + + fi + + + + + STDDEF_H= + ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include + +" +if test "x$ac_cv_type_max_align_t" = xyes +then : + +else case e in @%:@( + e) HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h ;; +esac +fi + + if test $gt_cv_c_wchar_t = no; then + HAVE_WCHAR_T=0 + STDDEF_H=stddef.h + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 +printf %s "checking whether NULL can be used in arbitrary expressions... " >&6; } +if test ${gl_cv_decl_null_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int test[2 * (sizeof NULL == sizeof (void *)) -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_null_works=yes +else case e in @%:@( + e) gl_cv_decl_null_works=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 +printf "%s\n" "$gl_cv_decl_null_works" >&6; } + if test $gl_cv_decl_null_works = no; then + REPLACE_NULL=1 + STDDEF_H=stddef.h + fi + + if test -n "$STDDEF_H"; then + GL_GENERATE_STDDEF_H_TRUE= + GL_GENERATE_STDDEF_H_FALSE='#' +else + GL_GENERATE_STDDEF_H_TRUE='#' + GL_GENERATE_STDDEF_H_FALSE= +fi + + if test -n "$STDDEF_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stddef_h='<'stddef.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_stddef_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stddef.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stddef_h + gl_cv_next_stddef_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 +printf "%s\n" "$gl_cv_next_stddef_h" >&6; } + fi + NEXT_STDDEF_H=$gl_cv_next_stddef_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stddef.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stddef_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive + + + + + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 +printf %s "checking whether lstat correctly handles trailing slash... " >&6; } +if test ${gl_cv_func_lstat_dereferences_slashed_symlink+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) rm -f conftest.sym conftest.file + echo >conftest.file + if test "$cross_compiling" = yes +then : + case "$host_os" in + *-gnu*) + # Guess yes on glibc systems. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; + *) + # If we don't know, assume the worst. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ +struct stat sbuf; + if (symlink ("conftest.file", "conftest.sym") != 0) + return 1; + /* Linux will dereference the symlink and fail, as required by + POSIX. That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_lstat_dereferences_slashed_symlink=yes +else case e in @%:@( + e) gl_cv_func_lstat_dereferences_slashed_symlink=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.sym conftest.file + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5 +printf "%s\n" "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; } + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *yes) + +printf "%s\n" "@%:@define LSTAT_FOLLOWS_SLASHED_SYMLINK 1" >>confdefs.h + + ;; + esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in @%:@( +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +@%:@( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + + + GNULIB__EXIT=0; + GNULIB_ATOLL=0; + GNULIB_CALLOC_POSIX=0; + GNULIB_CANONICALIZE_FILE_NAME=0; + GNULIB_GETLOADAVG=0; + GNULIB_GETSUBOPT=0; + GNULIB_GRANTPT=0; + GNULIB_MALLOC_POSIX=0; + GNULIB_MBTOWC=0; + GNULIB_MKDTEMP=0; + GNULIB_MKOSTEMP=0; + GNULIB_MKOSTEMPS=0; + GNULIB_MKSTEMP=0; + GNULIB_MKSTEMPS=0; + GNULIB_POSIX_OPENPT=0; + GNULIB_PTSNAME=0; + GNULIB_PTSNAME_R=0; + GNULIB_PUTENV=0; + GNULIB_QSORT_R=0; + GNULIB_RANDOM=0; + GNULIB_RANDOM_R=0; + GNULIB_REALLOC_POSIX=0; + GNULIB_REALPATH=0; + GNULIB_RPMATCH=0; + GNULIB_SECURE_GETENV=0; + GNULIB_SETENV=0; + GNULIB_STRTOD=0; + GNULIB_STRTOLL=0; + GNULIB_STRTOULL=0; + GNULIB_SYSTEM_POSIX=0; + GNULIB_UNLOCKPT=0; + GNULIB_UNSETENV=0; + GNULIB_WCTOMB=0; + HAVE__EXIT=1; + HAVE_ATOLL=1; + HAVE_CANONICALIZE_FILE_NAME=1; + HAVE_DECL_GETLOADAVG=1; + HAVE_GETSUBOPT=1; + HAVE_GRANTPT=1; + HAVE_MKDTEMP=1; + HAVE_MKOSTEMP=1; + HAVE_MKOSTEMPS=1; + HAVE_MKSTEMP=1; + HAVE_MKSTEMPS=1; + HAVE_POSIX_OPENPT=1; + HAVE_PTSNAME=1; + HAVE_PTSNAME_R=1; + HAVE_QSORT_R=1; + HAVE_RANDOM=1; + HAVE_RANDOM_H=1; + HAVE_RANDOM_R=1; + HAVE_REALPATH=1; + HAVE_RPMATCH=1; + HAVE_SECURE_GETENV=1; + HAVE_SETENV=1; + HAVE_DECL_SETENV=1; + HAVE_STRTOD=1; + HAVE_STRTOLL=1; + HAVE_STRTOULL=1; + HAVE_STRUCT_RANDOM_DATA=1; + HAVE_SYS_LOADAVG_H=0; + HAVE_UNLOCKPT=1; + HAVE_DECL_UNSETENV=1; + REPLACE_CALLOC=0; + REPLACE_CANONICALIZE_FILE_NAME=0; + REPLACE_MALLOC=0; + REPLACE_MBTOWC=0; + REPLACE_MKSTEMP=0; + REPLACE_PTSNAME=0; + REPLACE_PTSNAME_R=0; + REPLACE_PUTENV=0; + REPLACE_QSORT_R=0; + REPLACE_RANDOM_R=0; + REPLACE_REALLOC=0; + REPLACE_REALPATH=0; + REPLACE_SETENV=0; + REPLACE_STRTOD=0; + REPLACE_UNSETENV=0; + REPLACE_WCTOMB=0; + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5 +printf %s "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; } +if test ${gl_cv_func_malloc_posix+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + choke me + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_malloc_posix=yes +else case e in @%:@( + e) gl_cv_func_malloc_posix=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5 +printf "%s\n" "$gl_cv_func_malloc_posix" >&6; } + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +printf %s "checking for GNU libc compatible malloc... " >&6; } +if test ${ac_cv_func_malloc_0_nonnull+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ + | hpux* | solaris* | cygwin* | mingw* | windows* | msys* ) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +void *p = malloc (0); + int result = !p; + free (p); + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_malloc_0_nonnull=yes +else case e in @%:@( + e) ac_cv_func_malloc_0_nonnull=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes +then : + gl_cv_func_malloc_0_nonnull=1 +else case e in @%:@( + e) gl_cv_func_malloc_0_nonnull=0 ;; +esac +fi + + +printf "%s\n" "@%:@define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull" >>confdefs.h + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + GNULIB_FFSL=0; + GNULIB_FFSLL=0; + GNULIB_MEMCHR=0; + GNULIB_MEMMEM=0; + GNULIB_MEMPCPY=0; + GNULIB_MEMRCHR=0; + GNULIB_RAWMEMCHR=0; + GNULIB_STPCPY=0; + GNULIB_STPNCPY=0; + GNULIB_STRCHRNUL=0; + GNULIB_STRDUP=0; + GNULIB_STRNCAT=0; + GNULIB_STRNDUP=0; + GNULIB_STRNLEN=0; + GNULIB_STRPBRK=0; + GNULIB_STRSEP=0; + GNULIB_STRSTR=0; + GNULIB_STRCASESTR=0; + GNULIB_STRTOK_R=0; + GNULIB_MBSLEN=0; + GNULIB_MBSNLEN=0; + GNULIB_MBSCHR=0; + GNULIB_MBSRCHR=0; + GNULIB_MBSSTR=0; + GNULIB_MBSCASECMP=0; + GNULIB_MBSNCASECMP=0; + GNULIB_MBSPCASECMP=0; + GNULIB_MBSCASESTR=0; + GNULIB_MBSCSPN=0; + GNULIB_MBSPBRK=0; + GNULIB_MBSSPN=0; + GNULIB_MBSSEP=0; + GNULIB_MBSTOK_R=0; + GNULIB_STRERROR=0; + GNULIB_STRERROR_R=0; + GNULIB_STRSIGNAL=0; + GNULIB_STRVERSCMP=0; + HAVE_MBSLEN=0; + HAVE_FFSL=1; + HAVE_FFSLL=1; + HAVE_MEMCHR=1; + HAVE_DECL_MEMMEM=1; + HAVE_MEMPCPY=1; + HAVE_DECL_MEMRCHR=1; + HAVE_RAWMEMCHR=1; + HAVE_STPCPY=1; + HAVE_STPNCPY=1; + HAVE_STRCHRNUL=1; + HAVE_DECL_STRDUP=1; + HAVE_DECL_STRNDUP=1; + HAVE_DECL_STRNLEN=1; + HAVE_STRPBRK=1; + HAVE_STRSEP=1; + HAVE_STRCASESTR=1; + HAVE_DECL_STRTOK_R=1; + HAVE_DECL_STRERROR_R=1; + HAVE_DECL_STRSIGNAL=1; + HAVE_STRVERSCMP=1; + REPLACE_MEMCHR=0; + REPLACE_MEMMEM=0; + REPLACE_STPNCPY=0; + REPLACE_STRDUP=0; + REPLACE_STRSTR=0; + REPLACE_STRCASESTR=0; + REPLACE_STRCHRNUL=0; + REPLACE_STRERROR=0; + REPLACE_STRERROR_R=0; + REPLACE_STRNCAT=0; + REPLACE_STRNDUP=0; + REPLACE_STRNLEN=0; + REPLACE_STRSIGNAL=0; + REPLACE_STRTOK_R=0; + UNDEFINE_STRTOK_R=0; + + + + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in @%:@( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "@%:@define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "@%:@define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + if test $HAVE_MEMCHR = 1; then + # Detect platform-specific bugs in some versions of glibc: + # memchr should not dereference anything with length 0 + # http://bugzilla.redhat.com/499689 + # memchr should not dereference overestimated length after a match + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 + # http://sourceware.org/bugzilla/show_bug.cgi?id=10162 + # Assume that memchr works on platforms that lack mprotect. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5 +printf %s "checking whether memchr works... " >&6; } +if test ${gl_cv_func_memchr_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_memchr_works="guessing no" +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_SYS_MMAN_H +# include +# include +# include +# include +# ifndef MAP_FILE +# define MAP_FILE 0 +# endif +#endif + +int +main (void) +{ + + int result = 0; + char *fence = NULL; +#if HAVE_SYS_MMAN_H && HAVE_MPROTECT +# if HAVE_MAP_ANONYMOUS + const int flags = MAP_ANONYMOUS | MAP_PRIVATE; + const int fd = -1; +# else /* !HAVE_MAP_ANONYMOUS */ + const int flags = MAP_FILE | MAP_PRIVATE; + int fd = open ("/dev/zero", O_RDONLY, 0666); + if (fd >= 0) +# endif + { + int pagesize = getpagesize (); + char *two_pages = + (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, + flags, fd, 0); + if (two_pages != (char *)(-1) + && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) + fence = two_pages + pagesize; + } +#endif + if (fence) + { + if (memchr (fence, 0, 0)) + result |= 1; + strcpy (fence - 9, "12345678"); + if (memchr (fence - 9, 0, 79) != fence - 1) + result |= 2; + if (memchr (fence - 1, 0, 3) != fence - 1) + result |= 4; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_memchr_works=yes +else case e in @%:@( + e) gl_cv_func_memchr_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5 +printf "%s\n" "$gl_cv_func_memchr_works" >&6; } + if test "$gl_cv_func_memchr_works" != yes; then + REPLACE_MEMCHR=1 + fi + fi + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether defines MIN and MAX" >&5 +printf %s "checking whether defines MIN and MAX... " >&6; } +if test ${gl_cv_minmax_in_limits_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int x = MIN (42, 17); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_minmax_in_limits_h=yes +else case e in @%:@( + e) gl_cv_minmax_in_limits_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5 +printf "%s\n" "$gl_cv_minmax_in_limits_h" >&6; } + if test $gl_cv_minmax_in_limits_h = yes; then + +printf "%s\n" "@%:@define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h + + fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether defines MIN and MAX" >&5 +printf %s "checking whether defines MIN and MAX... " >&6; } +if test ${gl_cv_minmax_in_sys_param_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int x = MIN (42, 17); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_minmax_in_sys_param_h=yes +else case e in @%:@( + e) gl_cv_minmax_in_sys_param_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5 +printf "%s\n" "$gl_cv_minmax_in_sys_param_h" >&6; } + if test $gl_cv_minmax_in_sys_param_h = yes; then + +printf "%s\n" "@%:@define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h + + fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether time_t is signed" >&5 +printf %s "checking whether time_t is signed... " >&6; } +if test ${gl_cv_time_t_is_signed+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + char time_t_signed[(time_t) -1 < 0 ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_time_t_is_signed=yes +else case e in @%:@( + e) gl_cv_time_t_is_signed=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_t_is_signed" >&5 +printf "%s\n" "$gl_cv_time_t_is_signed" >&6; } + if test $gl_cv_time_t_is_signed = yes; then + +printf "%s\n" "@%:@define TIME_T_IS_SIGNED 1" >>confdefs.h + + fi + +ac_fn_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_alarm" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_ALARM $ac_have_decl" >>confdefs.h + + + + + + + + + + if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple Mac OS X platforms. + # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode. + # But we need a configuration result that is valid in both modes. + gl_cv_func_working_mktime=no + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5 +printf %s "checking for working mktime... " >&6; } +if test ${gl_cv_func_working_mktime+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_working_mktime="guessing no" +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test program from Paul Eggert and Tony Leneis. */ +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#if HAVE_DECL_ALARM +# include +#endif + +/* Work around redefinition to rpl_putenv by other config tests. */ +#undef putenv + +static time_t time_t_max; +static time_t time_t_min; + +/* Values we'll use to set the TZ environment variable. */ +static char *tz_strings[] = { + (char *) 0, "TZ=GMT0", "TZ=JST-9", + "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" +}; +#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) + +/* Return 0 if mktime fails to convert a date in the spring-forward gap. + Based on a problem report from Andreas Jaeger. */ +static int +spring_forward_gap () +{ + /* glibc (up to about 1998-10-07) failed this test. */ + struct tm tm; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + tm.tm_year = 98; + tm.tm_mon = 3; + tm.tm_mday = 5; + tm.tm_hour = 2; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + return mktime (&tm) != (time_t) -1; +} + +static int +mktime_test1 (time_t now) +{ + struct tm *lt; + return ! (lt = localtime (&now)) || mktime (lt) == now; +} + +static int +mktime_test (time_t now) +{ + return (mktime_test1 (now) + && mktime_test1 ((time_t) (time_t_max - now)) + && mktime_test1 ((time_t) (time_t_min + now))); +} + +static int +irix_6_4_bug () +{ + /* Based on code from Ariel Faigon. */ + struct tm tm; + tm.tm_year = 96; + tm.tm_mon = 3; + tm.tm_mday = 0; + tm.tm_hour = 0; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + mktime (&tm); + return tm.tm_mon == 2 && tm.tm_mday == 31; +} + +static int +bigtime_test (int j) +{ + struct tm tm; + time_t now; + tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; + now = mktime (&tm); + if (now != (time_t) -1) + { + struct tm *lt = localtime (&now); + if (! (lt + && lt->tm_year == tm.tm_year + && lt->tm_mon == tm.tm_mon + && lt->tm_mday == tm.tm_mday + && lt->tm_hour == tm.tm_hour + && lt->tm_min == tm.tm_min + && lt->tm_sec == tm.tm_sec + && lt->tm_yday == tm.tm_yday + && lt->tm_wday == tm.tm_wday + && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) + == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) + return 0; + } + return 1; +} + +static int +year_2050_test () +{ + /* The correct answer for 2050-02-01 00:00:00 in Pacific time, + ignoring leap seconds. */ + unsigned long int answer = 2527315200UL; + + struct tm tm; + time_t t; + tm.tm_year = 2050 - 1900; + tm.tm_mon = 2 - 1; + tm.tm_mday = 1; + tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + tm.tm_isdst = -1; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + t = mktime (&tm); + + /* Check that the result is either a failure, or close enough + to the correct answer that we can assume the discrepancy is + due to leap seconds. */ + return (t == (time_t) -1 + || (0 < t && answer - 120 <= t && t <= answer + 120)); +} + +int +main () +{ + int result = 0; + time_t t, delta; + int i, j; + int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1; + +#if HAVE_DECL_ALARM + /* This test makes some buggy mktime implementations loop. + Give up after 60 seconds; a mktime slower than that + isn't worth using anyway. */ + signal (SIGALRM, SIG_DFL); + alarm (60); +#endif + + time_t_max = (! TIME_T_IS_SIGNED + ? (time_t) -1 + : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1) + * 2 + 1)); + time_t_min = (! TIME_T_IS_SIGNED + ? (time_t) 0 + : time_t_signed_magnitude + ? ~ (time_t) 0 + : ~ time_t_max); + + delta = time_t_max / 997; /* a suitable prime number */ + for (i = 0; i < N_STRINGS; i++) + { + if (tz_strings[i]) + putenv (tz_strings[i]); + + for (t = 0; t <= time_t_max - delta && (result & 1) == 0; t += delta) + if (! mktime_test (t)) + result |= 1; + if ((result & 2) == 0 + && ! (mktime_test ((time_t) 1) + && mktime_test ((time_t) (60 * 60)) + && mktime_test ((time_t) (60 * 60 * 24)))) + result |= 2; + + for (j = 1; (result & 4) == 0; j <<= 1) + { + if (! bigtime_test (j)) + result |= 4; + if (INT_MAX / 2 < j) + break; + } + if ((result & 8) == 0 && ! bigtime_test (INT_MAX)) + result |= 8; + } + if (! irix_6_4_bug ()) + result |= 16; + if (! spring_forward_gap ()) + result |= 32; + if (! year_2050_test ()) + result |= 64; + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_working_mktime=yes +else case e in @%:@( + e) gl_cv_func_working_mktime=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mktime" >&5 +printf "%s\n" "$gl_cv_func_working_mktime" >&6; } + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5 +printf %s "checking for promoted mode_t type... " >&6; } +if test ${gl_cv_promoted_mode_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_promoted_mode_t='int' +else case e in @%:@( + e) gl_cv_promoted_mode_t='mode_t' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5 +printf "%s\n" "$gl_cv_promoted_mode_t" >&6; } + +printf "%s\n" "@%:@define PROMOTED_MODE_T $gl_cv_promoted_mode_t" >>confdefs.h + + + + + GNULIB_PTHREAD_SIGMASK=0; + GNULIB_RAISE=0; + GNULIB_SIGNAL_H_SIGPIPE=0; + GNULIB_SIGPROCMASK=0; + GNULIB_SIGACTION=0; + HAVE_POSIX_SIGNALBLOCKING=1; + HAVE_PTHREAD_SIGMASK=1; + HAVE_RAISE=1; + HAVE_SIGSET_T=1; + HAVE_SIGINFO_T=1; + HAVE_SIGACTION=1; + HAVE_STRUCT_SIGACTION_SA_SIGACTION=1; + + HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1; + + HAVE_SIGHANDLER_T=1; + REPLACE_PTHREAD_SIGMASK=0; + REPLACE_RAISE=0; + + + ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" " + #include + /* Mingw defines sigset_t not in , but in . */ + #include + +" +if test "x$ac_cv_type_sigset_t" = xyes +then : + +printf "%s\n" "@%:@define HAVE_SIGSET_T 1" >>confdefs.h + +gl_cv_type_sigset_t=yes +else case e in @%:@( + e) gl_cv_type_sigset_t=no ;; +esac +fi + + if test $gl_cv_type_sigset_t != yes; then + HAVE_SIGSET_T=0 + fi + + + + + + + + +ac_fn_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_setenv" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_SETENV $ac_have_decl" >>confdefs.h + + + + + + if test $ac_cv_have_decl_setenv = no; then + HAVE_DECL_SETENV=0 + fi + + + + + + ac_fn_c_check_header_compile "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default" +if test "x$ac_cv_header_search_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_SEARCH_H 1" >>confdefs.h + +fi + + ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch" +if test "x$ac_cv_func_tsearch" = xyes +then : + printf "%s\n" "@%:@define HAVE_TSEARCH 1" >>confdefs.h + +fi + + + + +ac_fn_c_check_type "$LINENO" "uid_t" "ac_cv_type_uid_t" "$ac_includes_default" +if test "x$ac_cv_type_uid_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define uid_t int" >>confdefs.h + ;; +esac +fi + +ac_fn_c_check_type "$LINENO" "gid_t" "ac_cv_type_gid_t" "$ac_includes_default" +if test "x$ac_cv_type_gid_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define gid_t int" >>confdefs.h + ;; +esac +fi + +: + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +printf %s "checking for stdbool.h that conforms to C99... " >&6; } +if test ${ac_cv_header_stdbool_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + + #ifdef __cplusplus + typedef bool Bool; + #else + typedef _Bool Bool; + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #endif + + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + Bool q = true; + Bool *pq = &q; + bool *qq = &q; + +int +main (void) +{ + + bool e = &s; + *pq |= q; *pq |= ! q; + *qq |= q; *qq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq + !qq); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_header_stdbool_h=yes +else case e in @%:@( + e) ac_cv_header_stdbool_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } + ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes +then : + +printf "%s\n" "@%:@define HAVE__BOOL 1" >>confdefs.h + + +fi + + + + GNULIB_FFS=0; + HAVE_FFS=1; + HAVE_STRCASECMP=1; + HAVE_DECL_STRNCASECMP=1; + + + REPLACE_STRERROR_0=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5 +printf %s "checking whether strerror(0) succeeds... " >&6; } +if test ${gl_cv_func_strerror_0_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_strerror_0_works="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +int result = 0; + char *str; + errno = 0; + str = strerror (0); + if (!*str) result |= 1; + if (errno) result |= 2; + if (strstr (str, "nknown") || strstr (str, "ndefined")) + result |= 4; + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strerror_0_works=yes +else case e in @%:@( + e) gl_cv_func_strerror_0_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5 +printf "%s\n" "$gl_cv_func_strerror_0_works" >&6; } + case "$gl_cv_func_strerror_0_works" in + *yes) ;; + *) + REPLACE_STRERROR_0=1 + +printf "%s\n" "@%:@define REPLACE_STRERROR_0 1" >>confdefs.h + + ;; + esac + + + + + + + + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5 +printf %s "checking for strerror_r with POSIX signature... " >&6; } +if test ${gl_cv_func_strerror_r_posix_signature+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int strerror_r (int, char *, size_t); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_strerror_r_posix_signature=yes +else case e in @%:@( + e) gl_cv_func_strerror_r_posix_signature=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_strerror_r_posix_signature" >&6; } + if test $gl_cv_func_strerror_r_posix_signature = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5 +printf %s "checking whether strerror_r works... " >&6; } +if test ${gl_cv_func_strerror_r_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on AIX. + aix*) gl_cv_func_strerror_r_works="guessing no";; + # Guess no on HP-UX. + hpux*) gl_cv_func_strerror_r_works="guessing no";; + # Guess no on BSD variants. + *bsd*) gl_cv_func_strerror_r_works="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_strerror_r_works="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +int result = 0; + char buf[79]; + if (strerror_r (EACCES, buf, 0) < 0) + result |= 1; + errno = 0; + if (strerror_r (EACCES, buf, sizeof buf) != 0) + result |= 2; + strcpy (buf, "Unknown"); + if (strerror_r (0, buf, sizeof buf) != 0) + result |= 4; + if (errno) + result |= 8; + if (strstr (buf, "nknown") || strstr (buf, "ndefined")) + result |= 0x10; + errno = 0; + *buf = 0; + if (strerror_r (-3, buf, sizeof buf) < 0) + result |= 0x20; + if (errno) + result |= 0x40; + if (!*buf) + result |= 0x80; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strerror_r_works=yes +else case e in @%:@( + e) gl_cv_func_strerror_r_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5 +printf "%s\n" "$gl_cv_func_strerror_r_works" >&6; } + else + + if test $ac_cv_func___xpg_strerror_r = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5 +printf %s "checking whether __xpg_strerror_r works... " >&6; } +if test ${gl_cv_func_strerror_r_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_strerror_r_works="guessing no" + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + extern + #ifdef __cplusplus + "C" + #endif + int __xpg_strerror_r(int, char *, size_t); + +int +main (void) +{ +int result = 0; + char buf[256] = "^"; + char copy[256]; + char *str = strerror (-1); + strcpy (copy, str); + if (__xpg_strerror_r (-2, buf, 1) == 0) + result |= 1; + if (*buf) + result |= 2; + __xpg_strerror_r (-2, buf, 256); + if (strcmp (str, copy)) + result |= 4; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strerror_r_works=yes +else case e in @%:@( + e) gl_cv_func_strerror_r_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5 +printf "%s\n" "$gl_cv_func_strerror_r_works" >&6; } + fi + fi + fi + fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +printf %s "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if test ${ac_cv_struct_tm+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main (void) +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_struct_tm=time.h +else case e in @%:@( + e) ac_cv_struct_tm=sys/time.h ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +printf "%s\n" "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +printf "%s\n" "@%:@define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include +#include <$ac_cv_struct_tm> + +" +if test "x$ac_cv_member_struct_tm_tm_zone" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_TM_TM_ZONE 1" >>confdefs.h + + +fi + +if test "$ac_cv_member_struct_tm_tm_zone" = yes; then + +printf "%s\n" "@%:@define HAVE_TM_ZONE 1" >>confdefs.h + +else + ac_fn_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_tzname" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_TZNAME $ac_have_decl" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 +printf %s "checking for tzname... " >&6; } +if test ${ac_cv_var_tzname+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#if !HAVE_DECL_TZNAME +extern char *tzname[]; +#endif + +int +main (void) +{ +return tzname[0][0]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_var_tzname=yes +else case e in @%:@( + e) ac_cv_var_tzname=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5 +printf "%s\n" "$ac_cv_var_tzname" >&6; } + if test $ac_cv_var_tzname = yes; then + +printf "%s\n" "@%:@define HAVE_TZNAME 1" >>confdefs.h + + fi +fi + + + ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include +" +if test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes +then : + +printf "%s\n" "@%:@define HAVE_TM_GMTOFF 1" >>confdefs.h + +fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_string_h='<'string.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_string_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'string.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_string_h + gl_cv_next_string_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5 +printf "%s\n" "$gl_cv_next_string_h" >&6; } + fi + NEXT_STRING_H=$gl_cv_next_string_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'string.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_string_h + fi + NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive + + + + + + + for gl_func in ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r strerror_r strsignal strverscmp; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_strings_h='<'strings.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_strings_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_strings_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'strings.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_strings_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_strings_h + gl_cv_next_strings_h='"'$gl_header'"' + else + gl_cv_next_strings_h='<'strings.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_strings_h" >&5 +printf "%s\n" "$gl_cv_next_strings_h" >&6; } + fi + NEXT_STRINGS_H=$gl_cv_next_strings_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'strings.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_strings_h + fi + NEXT_AS_FIRST_DIRECTIVE_STRINGS_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_strings_h = yes; then + HAVE_STRINGS_H=1 + else + HAVE_STRINGS_H=0 + fi + + + + for gl_func in ffs strcasecmp strncasecmp; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Minix 3.1.8 has a bug: must be included before + . */ + #include + #include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + +ac_fn_check_decl "$LINENO" "strndup" "ac_cv_have_decl_strndup" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strndup" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_STRNDUP $ac_have_decl" >>confdefs.h + + +ac_fn_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strnlen" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_STRNLEN $ac_have_decl" >>confdefs.h + + + +ac_fn_check_decl "$LINENO" "strtoumax" "ac_cv_have_decl_strtoumax" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strtoumax" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_STRTOUMAX $ac_have_decl" >>confdefs.h + + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_types_h='<'sys/types.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_types_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/types.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_types_h + gl_cv_next_sys_types_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5 +printf "%s\n" "$gl_cv_next_sys_types_h" >&6; } + fi + NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/types.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_types_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive + + + + + + + + + + + + + WINDOWS_STAT_INODES=0 + + + + + GNULIB_WAITPID=0; + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 +printf %s "checking for struct timespec in ... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_time_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_time_h=yes +else case e in @%:@( + e) gl_cv_sys_struct_timespec_in_time_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_time_h" >&6; } + + TIME_H_DEFINES_STRUCT_TIMESPEC=0 + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 + UNISTD_H_DEFINES_STRUCT_TIMESPEC=0 + if test $gl_cv_sys_struct_timespec_in_time_h = yes; then + TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 +printf %s "checking for struct timespec in ... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_sys_time_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_sys_time_h=yes +else case e in @%:@( + e) gl_cv_sys_struct_timespec_in_sys_time_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 +printf %s "checking for struct timespec in ... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_pthread_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_pthread_h=yes +else case e in @%:@( + e) gl_cv_sys_struct_timespec_in_pthread_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 +printf %s "checking for struct timespec in ... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_unistd_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_unistd_h=yes +else case e in @%:@( + e) gl_cv_sys_struct_timespec_in_unistd_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then + UNISTD_H_DEFINES_STRUCT_TIMESPEC=1 + fi + fi + fi + fi + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_time_h='<'time.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_time_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'time.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_time_h + gl_cv_next_time_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5 +printf "%s\n" "$gl_cv_next_time_h" >&6; } + fi + NEXT_TIME_H=$gl_cv_next_time_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'time.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_time_h + fi + NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive + + + + + + + + + + + + + + +gl_libunistring_sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' + + + if test "$HAVE_LIBUNISTRING" = yes; then + LIBUNISTRING_VERSION_MAJOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_major"` + LIBUNISTRING_VERSION_MINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_minor"` + LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_subminor"` + fi + +ac_fn_check_decl "$LINENO" "clearerr_unlocked" "ac_cv_have_decl_clearerr_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_clearerr_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_CLEARERR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "feof_unlocked" "ac_cv_have_decl_feof_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_feof_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FEOF_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "ferror_unlocked" "ac_cv_have_decl_ferror_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_ferror_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FERROR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fflush_unlocked" "ac_cv_have_decl_fflush_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fflush_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FFLUSH_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fgets_unlocked" "ac_cv_have_decl_fgets_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fgets_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FGETS_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fputc_unlocked" "ac_cv_have_decl_fputc_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fputc_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FPUTC_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fputs_unlocked" "ac_cv_have_decl_fputs_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fputs_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FPUTS_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fread_unlocked" "ac_cv_have_decl_fread_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fread_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FREAD_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fwrite_unlocked" "ac_cv_have_decl_fwrite_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fwrite_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FWRITE_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "getchar_unlocked" "ac_cv_have_decl_getchar_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getchar_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_GETCHAR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "putc_unlocked" "ac_cv_have_decl_putc_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_putc_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_PUTC_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "putchar_unlocked" "ac_cv_have_decl_putchar_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_putchar_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_PUTCHAR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_unsetenv" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_UNSETENV $ac_have_decl" >>confdefs.h + + + + + + if test $ac_cv_header_features_h = yes; then + HAVE_FEATURES_H=1 + else + HAVE_FEATURES_H=0 + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5 +printf %s "checking for inttypes.h... " >&6; } +if test ${gl_cv_header_inttypes_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +uintmax_t i = (uintmax_t) -1; return !i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_inttypes_h=yes +else case e in @%:@( + e) gl_cv_header_inttypes_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_inttypes_h" >&5 +printf "%s\n" "$gl_cv_header_inttypes_h" >&6; } + if test $gl_cv_header_inttypes_h = yes; then + +printf "%s\n" "@%:@define HAVE_INTTYPES_H_WITH_UINTMAX 1" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5 +printf %s "checking for stdint.h... " >&6; } +if test ${gl_cv_header_stdint_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include +int +main (void) +{ +uintmax_t i = (uintmax_t) -1; return !i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_stdint_h=yes +else case e in @%:@( + e) gl_cv_header_stdint_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_h" >&5 +printf "%s\n" "$gl_cv_header_stdint_h" >&6; } + if test $gl_cv_header_stdint_h = yes; then + +printf "%s\n" "@%:@define HAVE_STDINT_H_WITH_UINTMAX 1" >>confdefs.h + + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5 +printf %s "checking for intmax_t... " >&6; } +if test ${gt_cv_c_intmax_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_STDINT_H_WITH_UINTMAX +#include +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include +#endif + +int +main (void) +{ +intmax_t x = -1; return !x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_c_intmax_t=yes +else case e in @%:@( + e) gt_cv_c_intmax_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_intmax_t" >&5 +printf "%s\n" "$gt_cv_c_intmax_t" >&6; } + if test $gt_cv_c_intmax_t = yes; then + +printf "%s\n" "@%:@define HAVE_INTMAX_T 1" >>confdefs.h + + else + + test $ac_cv_type_long_long_int = yes \ + && ac_type='long long' \ + || ac_type='long' + +printf "%s\n" "@%:@define intmax_t $ac_type" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5 +printf %s "checking where to find the exponent in a 'double'... " >&6; } +if test ${gl_cv_cc_double_expbit0+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined arm || defined __arm || defined __arm__ + mixed_endianness +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "mixed_endianness" >/dev/null 2>&1 +then : + gl_cv_cc_double_expbit0="unknown" +else case e in @%:@( + e) + : +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in @%:@( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in @%:@( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes +then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +unsigned short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + unsigned short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + unsigned short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + unsigned short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else case e in @%:@( + e) ac_cv_c_bigendian=yes ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi ;; +esac +fi +: + case $ac_cv_c_bigendian in #( + yes) + gl_cv_cc_double_expbit0="word 0 bit 20";; #( + no) + gl_cv_cc_double_expbit0="word 1 bit 20" ;; #( + universal) + +printf "%s\n" "@%:@define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + gl_cv_cc_double_expbit0="unknown" ;; + esac + + ;; +esac +fi +rm -rf conftest* + + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +#define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { double value; unsigned int word[NWORDS]; } memory_double; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (double x) +{ + memory_double m; + size_t i; + /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ + memset (&m, 0, sizeof (memory_double)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25); + add_to_ored_words (0.5); + add_to_ored_words (1.0); + add_to_ored_words (2.0); + add_to_ored_words (4.0); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_cc_double_expbit0=`cat conftest.out` +else case e in @%:@( + e) gl_cv_cc_double_expbit0="unknown" ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.out + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5 +printf "%s\n" "$gl_cv_cc_double_expbit0" >&6; } + case "$gl_cv_cc_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` + +printf "%s\n" "@%:@define DBL_EXPBIT0_WORD $word" >>confdefs.h + + +printf "%s\n" "@%:@define DBL_EXPBIT0_BIT $bit" >>confdefs.h + + ;; + esac + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether snprintf returns a byte count as in C99" >&5 +printf %s "checking whether snprintf returns a byte count as in C99... " >&6; } +if test ${gl_cv_func_snprintf_retval_c99+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";; + darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_retval_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";; + aix*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_retval_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_retval_c99="guessing no";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char buf[100]; +int main () +{ + strcpy (buf, "ABCDEF"); + if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7) + return 1; + if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7) + return 2; + if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7) + return 3; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_snprintf_retval_c99=yes +else case e in @%:@( + e) gl_cv_func_snprintf_retval_c99=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_retval_c99" >&5 +printf "%s\n" "$gl_cv_func_snprintf_retval_c99" >&6; } + + + + + + + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "@%:@define HAVE_SNPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strnlen" "ac_cv_func_strnlen" +if test "x$ac_cv_func_strnlen" = xyes +then : + printf "%s\n" "@%:@define HAVE_STRNLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcslen" "ac_cv_func_wcslen" +if test "x$ac_cv_func_wcslen" = xyes +then : + printf "%s\n" "@%:@define HAVE_WCSLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcsnlen" "ac_cv_func_wcsnlen" +if test "x$ac_cv_func_wcsnlen" = xyes +then : + printf "%s\n" "@%:@define HAVE_WCSNLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mbrtowc" "ac_cv_func_mbrtowc" +if test "x$ac_cv_func_mbrtowc" = xyes +then : + printf "%s\n" "@%:@define HAVE_MBRTOWC 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcrtomb" "ac_cv_func_wcrtomb" +if test "x$ac_cv_func_wcrtomb" = xyes +then : + printf "%s\n" "@%:@define HAVE_WCRTOMB 1" >>confdefs.h + +fi + + ac_fn_check_decl "$LINENO" "_snprintf" "ac_cv_have_decl__snprintf" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl__snprintf" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL__SNPRINTF $ac_have_decl" >>confdefs.h + + + + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + +printf "%s\n" "@%:@define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h + + ;; + esac + + + + + GNULIB_SOCKET=0; + GNULIB_CONNECT=0; + GNULIB_ACCEPT=0; + GNULIB_BIND=0; + GNULIB_GETPEERNAME=0; + GNULIB_GETSOCKNAME=0; + GNULIB_GETSOCKOPT=0; + GNULIB_LISTEN=0; + GNULIB_RECV=0; + GNULIB_SEND=0; + GNULIB_RECVFROM=0; + GNULIB_SENDTO=0; + GNULIB_SETSOCKOPT=0; + GNULIB_SHUTDOWN=0; + GNULIB_ACCEPT4=0; + HAVE_STRUCT_SOCKADDR_STORAGE=1; + HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1; + + HAVE_SA_FAMILY_T=1; + HAVE_ACCEPT4=1; + + + if test $ac_cv_header_sys_socket_h = no; then + ac_fn_c_check_header_compile "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" +if test "x$ac_cv_header_ws2tcpip_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WS2TCPIP_H 1" >>confdefs.h + +fi + + fi + + + + + + case "$host_os" in + osf*) + +printf "%s\n" "@%:@define _POSIX_PII_SOCKET 1" >>confdefs.h + + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether is self-contained" >&5 +printf %s "checking whether is self-contained... " >&6; } +if test ${gl_cv_header_sys_socket_h_selfcontained+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_sys_socket_h_selfcontained=yes +else case e in @%:@( + e) gl_cv_header_sys_socket_h_selfcontained=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5 +printf "%s\n" "$gl_cv_header_sys_socket_h_selfcontained" >&6; } + if test $gl_cv_header_sys_socket_h_selfcontained = yes; then + ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown" +if test "x$ac_cv_func_shutdown" = xyes +then : + printf "%s\n" "@%:@define HAVE_SHUTDOWN 1" >>confdefs.h + +fi + + if test $ac_cv_func_shutdown = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether defines the SHUT_* macros" >&5 +printf %s "checking whether defines the SHUT_* macros... " >&6; } +if test ${gl_cv_header_sys_socket_h_shut+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR }; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_sys_socket_h_shut=yes +else case e in @%:@( + e) gl_cv_header_sys_socket_h_shut=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5 +printf "%s\n" "$gl_cv_header_sys_socket_h_shut" >&6; } + if test $gl_cv_header_sys_socket_h_shut = no; then + SYS_SOCKET_H='sys/socket.h' + fi + fi + fi + # We need to check for ws2tcpip.h now. + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_socket_h='<'sys/socket.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_socket_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_socket_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/socket.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_socket_h + gl_cv_next_sys_socket_h='"'$gl_header'"' + else + gl_cv_next_sys_socket_h='<'sys/socket.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5 +printf "%s\n" "$gl_cv_next_sys_socket_h" >&6; } + fi + NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/socket.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_socket_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_sys_socket_h = yes; then + HAVE_SYS_SOCKET_H=1 + HAVE_WS2TCPIP_H=0 + else + HAVE_SYS_SOCKET_H=0 + if test $ac_cv_header_ws2tcpip_h = yes; then + HAVE_WS2TCPIP_H=1 + else + HAVE_WS2TCPIP_H=0 + fi + fi + + + + ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" " + /* sys/types.h is not needed according to POSIX, but the + sys/socket.h in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif + +" +if test "x$ac_cv_type_struct_sockaddr_storage" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h + + +fi +ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" " + /* sys/types.h is not needed according to POSIX, but the + sys/socket.h in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif + +" +if test "x$ac_cv_type_sa_family_t" = xyes +then : + +printf "%s\n" "@%:@define HAVE_SA_FAMILY_T 1" >>confdefs.h + + +fi + + if test $ac_cv_type_struct_sockaddr_storage = no; then + HAVE_STRUCT_SOCKADDR_STORAGE=0 + fi + if test $ac_cv_type_sa_family_t = no; then + HAVE_SA_FAMILY_T=0 + fi + if test $ac_cv_type_struct_sockaddr_storage != no; then + ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include + #ifdef HAVE_SYS_SOCKET_H + #include + #endif + #ifdef HAVE_WS2TCPIP_H + #include + #endif + +" +if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1" >>confdefs.h + + +else case e in @%:@( + e) HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0 ;; +esac +fi + + fi + if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \ + || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then + SYS_SOCKET_H='sys/socket.h' + fi + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + + + for gl_func in socket connect accept bind getpeername getsockname getsockopt listen recv send recvfrom sendto setsockopt shutdown accept4; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Some systems require prerequisite headers. */ +#include +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + GNULIB_INET_NTOP=0; + GNULIB_INET_PTON=0; + HAVE_DECL_INET_NTOP=1; + HAVE_DECL_INET_PTON=1; + REPLACE_INET_NTOP=0; + REPLACE_INET_PTON=0; + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5 +printf %s "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; } +if test ${gl_cv_func_getcwd_null+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_getcwd_null="guessing yes";; + # Guess yes on Cygwin. + cygwin*) gl_cv_func_getcwd_null="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_getcwd_null="guessing no";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# include +# if HAVE_UNISTD_H +# include +# else /* on Windows with MSVC */ +# include +# endif +# ifndef getcwd + char *getcwd (); +# endif + +int +main (void) +{ + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* mingw cwd does not start with '/', but getcwd does allocate. + However, mingw fails to honor non-zero size. */ +#else + if (chdir ("/") != 0) + return 1; + else + { + char *f = getcwd (NULL, 0); + if (! f) + return 2; + if (f[0] != '/') + return 3; + if (f[1] != '\0') + return 4; + free (f); + return 0; + } +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getcwd_null=yes +else case e in @%:@( + e) gl_cv_func_getcwd_null=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5 +printf "%s\n" "$gl_cv_func_getcwd_null" >&6; } + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5 +printf %s "checking for getcwd with POSIX signature... " >&6; } +if test ${gl_cv_func_getcwd_posix_signature+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +extern + #ifdef __cplusplus + "C" + #endif + char *getcwd (char *, size_t); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_getcwd_posix_signature=yes +else case e in @%:@( + e) gl_cv_func_getcwd_posix_signature=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_getcwd_posix_signature" >&6; } + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5 +printf %s "checking for IPv4 sockets... " >&6; } + if test ${gl_cv_socket_ipv4+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +int +main (void) +{ +int x = AF_INET; struct in_addr y; struct sockaddr_in z; + if (&x && &y && &z) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_socket_ipv4=yes +else case e in @%:@( + e) gl_cv_socket_ipv4=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5 +printf "%s\n" "$gl_cv_socket_ipv4" >&6; } + if test $gl_cv_socket_ipv4 = yes; then + +printf "%s\n" "@%:@define HAVE_IPV4 1" >>confdefs.h + + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5 +printf %s "checking for IPv6 sockets... " >&6; } + if test ${gl_cv_socket_ipv6+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif +int +main (void) +{ +int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; + if (&x && &y && &z) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_socket_ipv6=yes +else case e in @%:@( + e) gl_cv_socket_ipv6=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5 +printf "%s\n" "$gl_cv_socket_ipv6" >&6; } + if test $gl_cv_socket_ipv6 = yes; then + +printf "%s\n" "@%:@define HAVE_IPV6 1" >>confdefs.h + + fi + + + + GNULIB_PSELECT=0; + GNULIB_SELECT=0; + HAVE_PSELECT=1; + REPLACE_PSELECT=0; + REPLACE_SELECT=0; + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether is self-contained" >&5 +printf %s "checking whether is self-contained... " >&6; } +if test ${gl_cv_header_sys_select_h_selfcontained+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +struct timeval b; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_sys_select_h_selfcontained=yes +else case e in @%:@( + e) gl_cv_header_sys_select_h_selfcontained=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $gl_cv_header_sys_select_h_selfcontained = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +int memset; int bzero; + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + + #undef memset + #define memset nonexistent_memset + extern + #ifdef __cplusplus + "C" + #endif + void *memset (void *, int, unsigned long); + #undef bzero + #define bzero nonexistent_bzero + extern + #ifdef __cplusplus + "C" + #endif + void bzero (void *, unsigned long); + fd_set fds; + FD_ZERO (&fds); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in @%:@( + e) gl_cv_header_sys_select_h_selfcontained=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_select_h_selfcontained" >&5 +printf "%s\n" "$gl_cv_header_sys_select_h_selfcontained" >&6; } + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_select_h='<'sys/select.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_select_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_select_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/select.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_select_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_select_h + gl_cv_next_sys_select_h='"'$gl_header'"' + else + gl_cv_next_sys_select_h='<'sys/select.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_select_h" >&5 +printf "%s\n" "$gl_cv_next_sys_select_h" >&6; } + fi + NEXT_SYS_SELECT_H=$gl_cv_next_sys_select_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/select.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_select_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_sys_select_h = yes; then + HAVE_SYS_SELECT_H=1 + else + HAVE_SYS_SELECT_H=0 + fi + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + + + for gl_func in pselect select; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Some systems require prerequisite headers. */ +#include +#if !(defined __GLIBC__ && !defined __UCLIBC__) && HAVE_SYS_TIME_H +# include +#endif +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + LIBSOCKET= + if test $HAVE_WINSOCK2_H = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we need to call WSAStartup in winsock2.h and -lws2_32" >&5 +printf %s "checking if we need to call WSAStartup in winsock2.h and -lws2_32... " >&6; } +if test ${gl_cv_func_wsastartup+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_WINSOCK2_H +# include +#endif +int +main (void) +{ + + WORD wVersionRequested = MAKEWORD(1, 1); + WSADATA wsaData; + int err = WSAStartup(wVersionRequested, &wsaData); + WSACleanup (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_func_wsastartup=yes +else case e in @%:@( + e) gl_cv_func_wsastartup=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wsastartup" >&5 +printf "%s\n" "$gl_cv_func_wsastartup" >&6; } + if test "$gl_cv_func_wsastartup" = "yes"; then + +printf "%s\n" "@%:@define WINDOWS_SOCKETS 1" >>confdefs.h + + LIBSOCKET='-lws2_32' + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5 +printf %s "checking for library containing setsockopt... " >&6; } +if test ${gl_cv_lib_socket+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_cv_lib_socket= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in @%:@( + e) gl_save_LIBS="$LIBS" + LIBS="$gl_save_LIBS -lsocket" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_lib_socket="-lsocket" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$gl_cv_lib_socket"; then + LIBS="$gl_save_LIBS -lnetwork" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_lib_socket="-lnetwork" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$gl_cv_lib_socket"; then + LIBS="$gl_save_LIBS -lnet" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_lib_socket="-lnet" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + fi + LIBS="$gl_save_LIBS" + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$gl_cv_lib_socket"; then + gl_cv_lib_socket="none needed" + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_socket" >&5 +printf "%s\n" "$gl_cv_lib_socket" >&6; } + if test "$gl_cv_lib_socket" != "none needed"; then + LIBSOCKET="$gl_cv_lib_socket" + fi + fi + + + + + + + : + + + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + REPLACE_SELECT=1 + else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select supports a 0 argument" >&5 +printf %s "checking whether select supports a 0 argument... " >&6; } +if test ${gl_cv_func_select_supports0+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on Interix. + interix*) gl_cv_func_select_supports0="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_select_supports0="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_SYS_SELECT_H +#include +#endif +int main () +{ + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_supports0=yes +else case e in @%:@( + e) gl_cv_func_select_supports0=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_supports0" >&5 +printf "%s\n" "$gl_cv_func_select_supports0" >&6; } + case "$gl_cv_func_select_supports0" in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select detects invalid fds" >&5 +printf %s "checking whether select detects invalid fds... " >&6; } +if test ${gl_cv_func_select_detects_ebadf+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_select_detects_ebadf="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_SYS_SELECT_H +# include +#endif +#include +#include + +int +main (void) +{ + + fd_set set; + dup2(0, 16); + FD_ZERO(&set); + FD_SET(16, &set); + close(16); + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_detects_ebadf=yes +else case e in @%:@( + e) gl_cv_func_select_detects_ebadf=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_detects_ebadf" >&5 +printf "%s\n" "$gl_cv_func_select_detects_ebadf" >&6; } + case $gl_cv_func_select_detects_ebadf in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + fi + + LIB_SELECT="$LIBSOCKET" + if test $REPLACE_SELECT = 1; then + case "$host_os" in + mingw*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define WIN32_LEAN_AND_MEAN +#include +int +main () +{ + MsgWaitForMultipleObjects (0, NULL, 0, 0, 0); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in @%:@( + e) LIB_SELECT="$LIB_SELECT -luser32" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ;; + esac + fi + + + + + + + + + + if test $ac_cv_have_decl_strerror_r = no; then + HAVE_DECL_STRERROR_R=0 + fi + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + if test $gl_cv_func_strerror_r_posix_signature = yes; then + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR_R=1 ;; + esac + else + REPLACE_STRERROR_R=1 + fi + else + REPLACE_STRERROR_R=1 + fi + fi + + + +ac_fn_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_snprintf" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_SNPRINTF $ac_have_decl" >>confdefs.h + + + + + + + + + + if false; then + GL_COND_LIBTOOL_TRUE= + GL_COND_LIBTOOL_FALSE='#' +else + GL_COND_LIBTOOL_TRUE='#' + GL_COND_LIBTOOL_FALSE= +fi + + gl_cond_libtool=false + gl_libdeps= + gl_ltlibdeps= + gl_m4_base='m4' + + + + + + + + + + gl_source_base='lib' + + + if test $ac_cv_func_alloca_works = no; then + : + fi + + # Define an additional variable used in the Makefile substitution. + if test $ac_cv_working_alloca_h = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5 +printf %s "checking for alloca as a compiler built-in... " >&6; } +if test ${gl_cv_rpl_alloca+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined __GNUC__ || defined _AIX || defined _MSC_VER + Need own alloca +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "Need own alloca" >/dev/null 2>&1 +then : + gl_cv_rpl_alloca=yes +else case e in @%:@( + e) gl_cv_rpl_alloca=no ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5 +printf "%s\n" "$gl_cv_rpl_alloca" >&6; } + if test $gl_cv_rpl_alloca = yes; then + +printf "%s\n" "@%:@define HAVE_ALLOCA 1" >>confdefs.h + + ALLOCA_H=alloca.h + else + ALLOCA_H= + fi + else + ALLOCA_H=alloca.h + fi + + if test -n "$ALLOCA_H"; then + GL_GENERATE_ALLOCA_H_TRUE= + GL_GENERATE_ALLOCA_H_FALSE='#' +else + GL_GENERATE_ALLOCA_H_TRUE='#' + GL_GENERATE_ALLOCA_H_FALSE= +fi + + + + + + + + + if test $ac_cv_func_btowc = no; then + HAVE_BTOWC=0 + else + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether btowc(0) is correct" >&5 +printf %s "checking whether btowc(0) is correct... " >&6; } +if test ${gl_cv_func_btowc_nul+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on Cygwin. + cygwin*) gl_cv_func_btowc_nul="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_nul="guessing yes" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (btowc ('\0') != 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_btowc_nul=yes +else case e in @%:@( + e) gl_cv_func_btowc_nul=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_nul" >&5 +printf "%s\n" "$gl_cv_func_btowc_nul" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5 +printf %s "checking whether btowc(EOF) is correct... " >&6; } +if test ${gl_cv_func_btowc_eof+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on IRIX. + irix*) gl_cv_func_btowc_eof="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_eof="guessing yes" ;; + esac + if test $LOCALE_FR != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (btowc (EOF) != WEOF) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_btowc_eof=yes +else case e in @%:@( + e) gl_cv_func_btowc_eof=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5 +printf "%s\n" "$gl_cv_func_btowc_eof" >&6; } + + case "$gl_cv_func_btowc_nul" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + case "$gl_cv_func_btowc_eof" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + fi + + if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS btowc.$ac_objext" + + + : + + fi + + + + + + GNULIB_BTOWC=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_BTOWC 1" >>confdefs.h + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5 +printf %s "checking for __builtin_expect... " >&6; } +if test ${gl_cv___builtin_expect+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int + main (int argc, char **argv) + { + argc = __builtin_expect (argc, 100); + return argv[argc != 100][0]; + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv___builtin_expect=yes +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + int + main (int argc, char **argv) + { + argc = __builtin_expect (argc, 100); + return argv[argc != 100][0]; + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv___builtin_expect="in " +else case e in @%:@( + e) gl_cv___builtin_expect=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5 +printf "%s\n" "$gl_cv___builtin_expect" >&6; } + if test "$gl_cv___builtin_expect" = yes; then + printf "%s\n" "@%:@define HAVE___BUILTIN_EXPECT 1" >>confdefs.h + + elif test "$gl_cv___builtin_expect" = "in "; then + printf "%s\n" "@%:@define HAVE___BUILTIN_EXPECT 2" >>confdefs.h + + fi + + + + + + + # for STACK_DIRECTION + + + + ac_fn_check_decl "$LINENO" "sigaltstack" "ac_cv_have_decl_sigaltstack" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_sigaltstack" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_SIGALTSTACK $ac_have_decl" >>confdefs.h + + + + + ac_fn_c_check_type "$LINENO" "stack_t" "ac_cv_type_stack_t" "#include +" +if test "x$ac_cv_type_stack_t" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STACK_T 1" >>confdefs.h + + +fi + + + if test "$gl_cv_lib_sigsegv" = yes \ + && test $"ac_cv_sys_xsi_stack_overflow_heuristic" != yes ; then + LIBCSTACK=$LIBSIGSEGV + + LTLIBCSTACK=$LTLIBSIGSEGV + + fi + + + + + + + # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. + # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. + + # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* + # programs in the package would end up linked with that potentially-shared + # library, inducing unnecessary run-time overhead. + LIB_CLOCK_GETTIME= + + gl_saved_libs=$LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 +printf %s "checking for library containing clock_gettime... " >&6; } +if test ${ac_cv_search_clock_gettime+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (void); +int +main (void) +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt posix4 +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_clock_gettime=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_clock_gettime+y} +then : + break +fi +done +if test ${ac_cv_search_clock_gettime+y} +then : + +else case e in @%:@( + e) ac_cv_search_clock_gettime=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 +printf "%s\n" "$ac_cv_search_clock_gettime" >&6; } +ac_res=$ac_cv_search_clock_gettime +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ac_cv_search_clock_gettime" = "none required" || + LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime +fi + + ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" +if test "x$ac_cv_func_clock_gettime" = xyes +then : + printf "%s\n" "@%:@define HAVE_CLOCK_GETTIME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "clock_settime" "ac_cv_func_clock_settime" +if test "x$ac_cv_func_clock_settime" = xyes +then : + printf "%s\n" "@%:@define HAVE_CLOCK_SETTIME 1" >>confdefs.h + +fi + + LIBS=$gl_saved_libs + + + + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_CLOSE=1 + fi + + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then + REPLACE_CLOSE=1 + fi + + + + if test $REPLACE_CLOSE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext" + + fi + + + + + + GNULIB_CLOSE=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_CLOSE 1" >>confdefs.h + + + + + + if test "x$datarootdir" = x; then + datarootdir='${datadir}' + + fi + if test "x$docdir" = x; then + docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' + + fi + if test "x$htmldir" = x; then + htmldir='${docdir}' + + fi + if test "x$dvidir" = x; then + dvidir='${docdir}' + + fi + if test "x$pdfdir" = x; then + pdfdir='${docdir}' + + fi + if test "x$psdir" = x; then + psdir='${docdir}' + + fi + if test "x$lispdir" = x; then + lispdir='${datarootdir}/emacs/site-lisp' + + fi + if test "x$localedir" = x; then + localedir='${datarootdir}/locale' + + fi + if test "x$runstatedir" = x; then + runstatedir='${localstatedir}/run' + + fi + + pkglibexecdir='${libexecdir}/${PACKAGE}' + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_ctype_h='<'ctype.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_ctype_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'ctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_ctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_ctype_h + gl_cv_next_ctype_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_ctype_h" >&5 +printf "%s\n" "$gl_cv_next_ctype_h" >&6; } + fi + NEXT_CTYPE_H=$gl_cv_next_ctype_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'ctype.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_ctype_h + fi + NEXT_AS_FIRST_DIRECTIVE_CTYPE_H=$gl_next_as_first_directive + + + + + + + for gl_func in isblank; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + +printf "%s\n" "@%:@define GNULIB_DIRNAME 1" >>confdefs.h + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 +printf %s "checking whether // is distinct from /... " >&6; } +if test ${gl_cv_double_slash_root+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # . + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + gl_cv_double_slash_root='unknown, assuming no' ;; + esac + else + set x `ls -di / // 2>/dev/null` + if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 +printf "%s\n" "$gl_cv_double_slash_root" >&6; } + if test "$gl_cv_double_slash_root" = yes; then + +printf "%s\n" "@%:@define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h + + fi + + + + + + +printf "%s\n" "@%:@define HAVE_DUP2 1" >>confdefs.h + + + if test $HAVE_DUP2 = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5 +printf %s "checking whether dup2 works... " >&6; } +if test ${gl_cv_func_dup2_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + mingw*) # on this platform, dup2 always returns 0 for success + gl_cv_func_dup2_works="guessing no" ;; + cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 + gl_cv_func_dup2_works="guessing no" ;; + aix* | freebsd*) + # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE, + # not EBADF. + gl_cv_func_dup2_works="guessing no" ;; + haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. + gl_cv_func_dup2_works="guessing no" ;; + *-android*) # implemented using dup3(), which fails if oldfd == newfd + gl_cv_func_dup2_works="guessing no" ;; + os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd. + gl_cv_func_dup2_works="guessing no" ;; + *) gl_cv_func_dup2_works="guessing yes" ;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + #include + #include + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + +int +main (void) +{ +int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + #ifdef FD_CLOEXEC + if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) + result |= 1; + #endif + if (dup2 (1, 1) != 1) + result |= 2; + #ifdef FD_CLOEXEC + if (fcntl (1, F_GETFD) != FD_CLOEXEC) + result |= 4; + #endif + close (0); + if (dup2 (0, 0) != -1) + result |= 8; + /* Many gnulib modules require POSIX conformance of EBADF. */ + if (dup2 (2, bad_fd) == -1 && errno != EBADF) + result |= 16; + /* Flush out some cygwin core dumps. */ + if (dup2 (2, -1) != -1 || errno != EBADF) + result |= 32; + dup2 (2, 255); + dup2 (2, 256); + /* On OS/2 kLIBC, dup2() does not work on a directory fd. */ + { + int fd = open (".", O_RDONLY); + if (fd == -1) + result |= 64; + else if (dup2 (fd, fd + 1) == -1) + result |= 128; + + close (fd); + } + return result; + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_dup2_works=yes +else case e in @%:@( + e) gl_cv_func_dup2_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5 +printf "%s\n" "$gl_cv_func_dup2_works" >&6; } + case "$gl_cv_func_dup2_works" in + *yes) ;; + *) + REPLACE_DUP2=1 + ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize" +if test "x$ac_cv_func_setdtablesize" = xyes +then : + printf "%s\n" "@%:@define HAVE_SETDTABLESIZE 1" >>confdefs.h + +fi + + ;; + esac + fi + + + if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext" + + + fi + + + + + + GNULIB_DUP2=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_DUP2 1" >>confdefs.h + + + + + + + + + + GNULIB_ENVIRON=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_ENVIRON 1" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 +printf %s "checking for error_at_line... " >&6; } +if test ${ac_cv_lib_error_at_line+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +error_at_line (0, 0, "", 0, "an error occurred"); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_error_at_line=yes +else case e in @%:@( + e) ac_cv_lib_error_at_line=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 +printf "%s\n" "$ac_cv_lib_error_at_line" >&6; } + + if test $ac_cv_lib_error_at_line = no; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext" + + + + : + + fi + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error:3:c-format" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error_at_line:5:c-format" + + + + + + + + if test $ac_cv_func_fcntl = no; then + + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5 +printf %s "checking whether fcntl handles F_DUPFD correctly... " >&6; } +if test ${gl_cv_func_fcntl_f_dupfd_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case $host_os in + aix* | cygwin* | haiku*) + gl_cv_func_fcntl_f_dupfd_works="guessing no" ;; + *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + #include + #include + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + +int +main (void) +{ +int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + if (fcntl (0, F_DUPFD, -1) != -1) result |= 1; + if (errno != EINVAL) result |= 2; + if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4; + if (errno != EINVAL) result |= 8; + /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */ + { + int fd; + fd = open (".", O_RDONLY); + if (fd == -1) + result |= 16; + else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1) + result |= 32; + + close (fd); + } + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_fcntl_f_dupfd_works=yes +else case e in @%:@( + e) gl_cv_func_fcntl_f_dupfd_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5 +printf "%s\n" "$gl_cv_func_fcntl_f_dupfd_works" >&6; } + case $gl_cv_func_fcntl_f_dupfd_works in + *yes) ;; + *) + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + +printf "%s\n" "@%:@define FCNTL_DUPFD_BUGGY 1" >>confdefs.h + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5 +printf %s "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; } +if test ${gl_cv_func_fcntl_f_dupfd_cloexec+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifndef F_DUPFD_CLOEXEC +choke me +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __linux__ +/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace + it to support the semantics on older kernels that failed with EINVAL. */ +choke me +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_fcntl_f_dupfd_cloexec=yes +else case e in @%:@( + e) gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +else case e in @%:@( + e) gl_cv_func_fcntl_f_dupfd_cloexec=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5 +printf "%s\n" "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; } + if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then + + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + fi + fi + + + if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext" + + fi + + + + + + GNULIB_FCNTL=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_FCNTL 1" >>confdefs.h + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_fcntl_h='<'fcntl.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_fcntl_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'fcntl.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_fcntl_h + gl_cv_next_fcntl_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5 +printf "%s\n" "$gl_cv_next_fcntl_h" >&6; } + fi + NEXT_FCNTL_H=$gl_cv_next_fcntl_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'fcntl.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_fcntl_h + fi + NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive + + + + + + + + + + + for gl_func in fcntl openat; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + +printf "%s\n" "@%:@define GNULIB_FILENAMECAT 1" >>confdefs.h + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5 +printf %s "checking for flexible array member... " >&6; } +if test ${ac_cv_c_flexmember+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + struct m { struct m *next, **list; char name[]; }; + struct s { struct s *p; struct m *m; int n; double d[]; }; +int +main (void) +{ +int m = getchar (); + size_t nbytes = offsetof (struct s, d) + m * sizeof (double); + nbytes += sizeof (struct s) - 1; + nbytes -= nbytes % sizeof (struct s); + struct s *p = malloc (nbytes); + p->p = p; + p->m = NULL; + p->d[0] = 0.0; + return p->d != (double *) NULL; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_flexmember=yes +else case e in @%:@( + e) ac_cv_c_flexmember=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5 +printf "%s\n" "$ac_cv_c_flexmember" >&6; } + if test $ac_cv_c_flexmember = yes; then + +printf "%s\n" "@%:@define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h + + else + printf "%s\n" "@%:@define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h + + fi + + + + + FLOAT_H= + REPLACE_FLOAT_LDBL=0 + case "$host_os" in + aix* | beos* | openbsd* | mirbsd* | irix*) + FLOAT_H=float.h + ;; + freebsd*) + case "$host_cpu" in + i[34567]86 ) + FLOAT_H=float.h + ;; + x86_64 ) + # On x86_64 systems, the C compiler may still be generating + # 32-bit code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ || defined __x86_64__ || defined __amd64__ + yes + #endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + +else case e in @%:@( + e) FLOAT_H=float.h ;; +esac +fi +rm -rf conftest* + + ;; + esac + ;; + linux*) + case "$host_cpu" in + powerpc*) + FLOAT_H=float.h + ;; + esac + ;; + esac + case "$host_os" in + aix* | freebsd* | linux*) + if test -n "$FLOAT_H"; then + REPLACE_FLOAT_LDBL=1 + fi + ;; + esac + + REPLACE_ITOLD=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5 +printf %s "checking whether conversion from 'int' to 'long double' works... " >&6; } +if test ${gl_cv_func_itold_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + case "$host" in + sparc*-*-linux*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ || defined __arch64__ + yes + #endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_func_itold_works="guessing no" +else case e in @%:@( + e) gl_cv_func_itold_works="guessing yes" ;; +esac +fi +rm -rf conftest* + + ;; + *) gl_cv_func_itold_works="guessing yes" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int i = -1; +volatile long double ld; +int main () +{ + ld += i * 1.0L; + if (ld > 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_itold_works=yes +else case e in @%:@( + e) gl_cv_func_itold_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5 +printf "%s\n" "$gl_cv_func_itold_works" >&6; } + case "$gl_cv_func_itold_works" in + *no) + REPLACE_ITOLD=1 + FLOAT_H=float.h + ;; + esac + + if test -n "$FLOAT_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_float_h='<'float.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_float_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'float.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_float_h + gl_cv_next_float_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5 +printf "%s\n" "$gl_cv_next_float_h" >&6; } + fi + NEXT_FLOAT_H=$gl_cv_next_float_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'float.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_float_h + fi + NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive + + + + + fi + + if test -n "$FLOAT_H"; then + GL_GENERATE_FLOAT_H_TRUE= + GL_GENERATE_FLOAT_H_FALSE='#' +else + GL_GENERATE_FLOAT_H_TRUE='#' + GL_GENERATE_FLOAT_H_FALSE= +fi + + + + if test $REPLACE_FLOAT_LDBL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext" + + fi + if test $REPLACE_ITOLD = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext" + + fi + + + + + + FNMATCH_H= + gl_fnmatch_required_lowercase=` + echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]' + ` + gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5 +printf %s "checking for working $gl_fnmatch_required fnmatch... " >&6; } +if eval test \${$gl_fnmatch_cache_var+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test $gl_fnmatch_required = GNU; then + gl_fnmatch_gnu_start= + gl_fnmatch_gnu_end= + else + gl_fnmatch_gnu_start='#if 0' + gl_fnmatch_gnu_end='#endif' + fi + if test "$cross_compiling" = yes +then : + eval "$gl_fnmatch_cache_var=\"guessing no\"" +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + static int + y (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == 0; + } + static int + n (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == FNM_NOMATCH; + } + +int +main (void) +{ +char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]"; + char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]"; + static char const A_1[] = { 'A' - 1, 0 }; + static char const A01[] = { 'A' + 1, 0 }; + static char const a_1[] = { 'a' - 1, 0 }; + static char const a01[] = { 'a' + 1, 0 }; + static char const bs_1[] = { '\\\\' - 1, 0 }; + static char const bs01[] = { '\\\\' + 1, 0 }; + int result = 0; + if (!n ("a*", "", 0)) + return 1; + if (!y ("a*", "abc", 0)) + return 1; + if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */ + return 1; + if (!n ("d*/*1", "d/s/1", FNM_PATHNAME)) + return 2; + if (!y ("a\\\\bc", "abc", 0)) + return 3; + if (!n ("a\\\\bc", "abc", FNM_NOESCAPE)) + return 3; + if (!y ("*x", ".x", 0)) + return 4; + if (!n ("*x", ".x", FNM_PERIOD)) + return 4; + if (!y (Apat, "\\\\", 0)) + return 5; + if (!y (Apat, "A", 0)) + return 5; + if (!y (apat, "\\\\", 0)) + return 5; + if (!y (apat, "a", 0)) + return 5; + if (!(n (Apat, A_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, a_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, A01, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, a01, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, bs_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, bs_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(n (Apat, bs01, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, bs01, 0) == ('a' < '\\\\'))) + return 5; + $gl_fnmatch_gnu_start + if (!y ("xxXX", "xXxX", FNM_CASEFOLD)) + result |= 8; + if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)) + result |= 16; + if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME)) + result |= 32; + if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + $gl_fnmatch_gnu_end + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + eval "$gl_fnmatch_cache_var=yes" +else case e in @%:@( + e) eval "$gl_fnmatch_cache_var=no" ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +eval ac_res=\$$gl_fnmatch_cache_var + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\"" + if test "$gl_fnmatch_result" = yes; then + rm -f "$gl_source_base/fnmatch.h" + else + FNMATCH_H=fnmatch.h + fi + + if test -n "$FNMATCH_H"; then + GL_GENERATE_FNMATCH_H_TRUE= + GL_GENERATE_FNMATCH_H_FALSE='#' +else + GL_GENERATE_FNMATCH_H_TRUE='#' + GL_GENERATE_FNMATCH_H_FALSE= +fi + + + if test -n "$FNMATCH_H"; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" + + + +printf "%s\n" "@%:@define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch" >>confdefs.h + + + ac_fn_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_isblank" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h + + + + + fi + + + + + + if test -n "$FNMATCH_H"; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" + + + +printf "%s\n" "@%:@define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch" >>confdefs.h + + + ac_fn_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_isblank" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h + + + + + fi + + + + case "$host_os" in + mingw* | pw* | os2*) + REPLACE_FREOPEN=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether freopen works on closed fds" >&5 +printf %s "checking whether freopen works on closed fds... " >&6; } +if test ${gl_cv_func_freopen_works_on_closed+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case $host_os in + *gnu*) gl_cv_func_freopen_works_on_closed="guessing no" ;; + *) gl_cv_func_freopen_works_on_closed="guessing yes";; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +close (0); + return !(freopen ("/dev/null", "r", stdin) + && getchar () == EOF + && !ferror (stdin) && feof (stdin)); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_freopen_works_on_closed=yes +else case e in @%:@( + e) gl_cv_func_freopen_works_on_closed=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_freopen_works_on_closed" >&5 +printf "%s\n" "$gl_cv_func_freopen_works_on_closed" >&6; } + case $gl_cv_func_freopen_works_on_closed in + *no) REPLACE_FREOPEN=1;; + esac + esac + + if test $REPLACE_FREOPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS freopen.$ac_objext" + + : + fi + + + + + + GNULIB_FREOPEN=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_FREOPEN 1" >>confdefs.h + + + + + +printf "%s\n" "@%:@define GNULIB_FREOPEN_SAFER 1" >>confdefs.h + + + + + + + case "$host_os" in + mingw*) + REPLACE_FSTAT=1 + ;; + esac + + + + if test $REPLACE_FSTAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" + + + + : + + fi + + + + + + GNULIB_FSTAT=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_FSTAT 1" >>confdefs.h + + + + + + + + + if test $ac_cv_func_getdtablesize = yes && + test $ac_cv_have_decl_getdtablesize = yes; then + # Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft limit + # up to an unchangeable hard limit; all other platforms correctly + # require setrlimit before getdtablesize() can report a larger value. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5 +printf %s "checking whether getdtablesize works... " >&6; } +if test ${gl_cv_func_getdtablesize_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows + gl_cv_func_getdtablesize_works="guessing no" ;; + *) gl_cv_func_getdtablesize_works="guessing yes" ;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int size = getdtablesize(); + if (dup2 (0, getdtablesize()) != -1) + return 1; + if (size != getdtablesize()) + return 2; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getdtablesize_works=yes +else case e in @%:@( + e) gl_cv_func_getdtablesize_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5 +printf "%s\n" "$gl_cv_func_getdtablesize_works" >&6; } + case "$gl_cv_func_getdtablesize_works" in + *yes) ;; + *) REPLACE_GETDTABLESIZE=1 ;; + esac + else + HAVE_GETDTABLESIZE=0 + fi + + if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext" + + : + fi + + + + + + GNULIB_GETDTABLESIZE=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h + + + + + + + + + + + + + REPLACE_GETOPT=0 + if test -n "$gl_replace_getopt"; then + REPLACE_GETOPT=1 + fi + + if test $REPLACE_GETOPT = 1; then + + + if test $ac_cv_header_sys_cdefs_h = yes; then + HAVE_SYS_CDEFS_H=1 + else + HAVE_SYS_CDEFS_H=0 + fi + + + +printf "%s\n" "@%:@define __GETOPT_PREFIX rpl_" >>confdefs.h + + GETOPT_H=getopt.h + GETOPT_CDEFS_H=getopt-cdefs.h + + + + fi + + if test $REPLACE_GETOPT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" + + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + + + + + ac_found=0 + ac_fn_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_program_invocation_name" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + ac_found=1 +fi + + ac_fn_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + ac_found=1 +fi + + ac_fn_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl___argv" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL___ARGV $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + ac_found=1 +fi + + + # Incur the cost of this test only if none of the above worked. + if test $ac_found = 0; then + # On OpenBSD 5.1, using the global __progname variable appears to be + # the only way to implement getprogname. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5 +printf %s "checking whether __progname is defined in default libraries... " >&6; } +if test ${gl_cv_var___progname+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_cv_var___progname= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char *__progname; +int +main (void) +{ +return *__progname; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_var___progname=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5 +printf "%s\n" "$gl_cv_var___progname" >&6; } + if test "$gl_cv_var___progname" = yes; then + +printf "%s\n" "@%:@define HAVE_VAR___PROGNAME 1" >>confdefs.h + + fi + fi + + + + + + + + + + + + + + + + gl_gettimeofday_timezone=void + if test $ac_cv_func_gettimeofday != yes; then + HAVE_GETTIMEOFDAY=0 + else + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5 +printf %s "checking whether gettimeofday clobbers localtime buffer... " >&6; } +if test ${gl_cv_func_gettimeofday_clobber+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + # When cross-compiling: + case "$host_os" in + # Guess all is fine on glibc systems. + *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_gettimeofday_clobber="guessing yes" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + #include + +int +main (void) +{ + + time_t t = 0; + struct tm *lt; + struct tm saved_lt; + struct timeval tv; + lt = localtime (&t); + saved_lt = *lt; + gettimeofday (&tv, NULL); + return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_gettimeofday_clobber=no +else case e in @%:@( + e) gl_cv_func_gettimeofday_clobber=yes ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5 +printf "%s\n" "$gl_cv_func_gettimeofday_clobber" >&6; } + + case "$gl_cv_func_gettimeofday_clobber" in + *yes) + REPLACE_GETTIMEOFDAY=1 + +printf "%s\n" "@%:@define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h + + + + + NEED_LOCALTIME_BUFFER=1 + REPLACE_GMTIME=1 + REPLACE_LOCALTIME=1 + + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5 +printf %s "checking for gettimeofday with POSIX signature... " >&6; } +if test ${gl_cv_func_gettimeofday_posix_signature+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + struct timeval c; + int gettimeofday (struct timeval *restrict, void *restrict); + +int +main (void) +{ +/* glibc uses struct timezone * rather than the POSIX void * + if _GNU_SOURCE is defined. However, since the only portable + use of gettimeofday uses NULL as the second parameter, and + since the glibc definition is actually more typesafe, it is + not worth wrapping this to get a compliant signature. */ + int (*f) (struct timeval *restrict, void *restrict) + = gettimeofday; + int x = f (&c, 0); + return !(x | c.tv_sec | c.tv_usec); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_gettimeofday_posix_signature=yes +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int gettimeofday (struct timeval *restrict, struct timezone *restrict); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_gettimeofday_posix_signature=almost +else case e in @%:@( + e) gl_cv_func_gettimeofday_posix_signature=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_gettimeofday_posix_signature" >&6; } + if test $gl_cv_func_gettimeofday_posix_signature = almost; then + gl_gettimeofday_timezone='struct timezone' + elif test $gl_cv_func_gettimeofday_posix_signature != yes; then + REPLACE_GETTIMEOFDAY=1 + fi + if test $REPLACE_STRUCT_TIMEVAL = 1; then + REPLACE_GETTIMEOFDAY=1 + fi + case "$host_os" in + mingw*) REPLACE_GETTIMEOFDAY=1 ;; + esac + fi + +printf "%s\n" "@%:@define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone" >>confdefs.h + + + if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" + + : + fi + + + + + + GNULIB_GETTIMEOFDAY=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h + + + + + if ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then + GNU_MAKE_TRUE= + GNU_MAKE_FALSE='#' +else + GNU_MAKE_TRUE='#' + GNU_MAKE_FALSE= +fi + + + # Autoconf 2.61a.99 and earlier don't support linking a file only + # in VPATH builds. But since GNUmakefile is for maintainer use + # only, it does not matter if we skip the link with older autoconf. + # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH + # builds, so use a shell variable to bypass this. + GNUmakefile=GNUmakefile + ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile" + + + : + + + + + + + + GNULIB_ICONV=1 + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_iconv_h='<'iconv.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_iconv_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_iconv_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'iconv.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_iconv_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_iconv_h + gl_cv_next_iconv_h='"'$gl_header'"' + else + gl_cv_next_iconv_h='<'iconv.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_iconv_h" >&5 +printf "%s\n" "$gl_cv_next_iconv_h" >&6; } + fi + NEXT_ICONV_H=$gl_cv_next_iconv_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'iconv.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_iconv_h + fi + NEXT_AS_FIRST_DIRECTIVE_ICONV_H=$gl_next_as_first_directive + + + + + + + + + + if test "$am_cv_func_iconv" = yes; then + + + ICONV_H='iconv.h' + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__) + gnu_iconv + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "gnu_iconv" >/dev/null 2>&1 +then : + gl_func_iconv_gnu=yes +else case e in @%:@( + e) gl_func_iconv_gnu=no ;; +esac +fi +rm -rf conftest* + + if test $gl_func_iconv_gnu = no; then + iconv_flavor= + case "$host_os" in + aix*) iconv_flavor=ICONV_FLAVOR_AIX ;; + irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;; + hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;; + osf*) iconv_flavor=ICONV_FLAVOR_OSF ;; + solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;; + esac + if test -n "$iconv_flavor"; then + +printf "%s\n" "@%:@define ICONV_FLAVOR $iconv_flavor" >>confdefs.h + + + + + ICONV_H='iconv.h' + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + + + REPLACE_ICONV_OPEN=1 + + fi + fi + + fi + + if test $REPLACE_ICONV_OPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv_open.$ac_objext" + + fi + if test $REPLACE_ICONV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv_close.$ac_objext" + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler generally respects inline" >&5 +printf %s "checking whether the compiler generally respects inline... " >&6; } +if test ${gl_cv_c_inline_effective+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test $ac_cv_c_inline = no; then + gl_cv_c_inline_effective=no + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifdef __NO_INLINE__ + #error "inline is not effective" + #endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_c_inline_effective=yes +else case e in @%:@( + e) gl_cv_c_inline_effective=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_inline_effective" >&5 +printf "%s\n" "$gl_cv_c_inline_effective" >&6; } + if test $gl_cv_c_inline_effective = yes; then + +printf "%s\n" "@%:@define HAVE_INLINE 1" >>confdefs.h + + fi + + + + + : + + : + : + : + : + + + + + + + PRIPTR_PREFIX= + if test -n "$STDINT_H"; then + PRIPTR_PREFIX='"l"' + else + for glpfx in '' l ll I64; do + case $glpfx in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + I64) gltype1='__int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + extern intptr_t foo; + extern $gltype1 foo; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + PRIPTR_PREFIX='"'$glpfx'"' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test -n "$PRIPTR_PREFIX" && break + done + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5 +printf %s "checking whether INT32_MAX < INTMAX_MAX... " >&6; } +if test ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include + #if HAVE_STDINT_H + #include + #endif + + #if defined INT32_MAX && defined INTMAX_MAX + #define CONDITION (INT32_MAX < INTMAX_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (int) < sizeof (long long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes +else case e in @%:@( + e) gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5 +printf "%s\n" "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; } + if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then + INT32_MAX_LT_INTMAX_MAX=1; + else + INT32_MAX_LT_INTMAX_MAX=0; + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5 +printf %s "checking whether INT64_MAX == LONG_MAX... " >&6; } +if test ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include + #if HAVE_STDINT_H + #include + #endif + + #if defined INT64_MAX + #define CONDITION (INT64_MAX == LONG_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (long long int) == sizeof (long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes +else case e in @%:@( + e) gl_cv_test_INT64_MAX_EQ_LONG_MAX=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5 +printf "%s\n" "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; } + if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then + INT64_MAX_EQ_LONG_MAX=1; + else + INT64_MAX_EQ_LONG_MAX=0; + fi + + + else + INT64_MAX_EQ_LONG_MAX=-1 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5 +printf %s "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; } +if test ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include + #if HAVE_STDINT_H + #include + #endif + + #if defined UINT32_MAX && defined UINTMAX_MAX + #define CONDITION (UINT32_MAX < UINTMAX_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes +else case e in @%:@( + e) gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5 +printf "%s\n" "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; } + if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then + UINT32_MAX_LT_UINTMAX_MAX=1; + else + UINT32_MAX_LT_UINTMAX_MAX=0; + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5 +printf %s "checking whether UINT64_MAX == ULONG_MAX... " >&6; } +if test ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include + #if HAVE_STDINT_H + #include + #endif + + #if defined UINT64_MAX + #define CONDITION (UINT64_MAX == ULONG_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes +else case e in @%:@( + e) gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5 +printf "%s\n" "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; } + if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then + UINT64_MAX_EQ_ULONG_MAX=1; + else + UINT64_MAX_EQ_ULONG_MAX=0; + fi + + + else + UINT64_MAX_EQ_ULONG_MAX=-1 + fi + + + + + + + + + if test $ac_cv_func_isblank = no; then + HAVE_ISBLANK=0 + fi + + if test $HAVE_ISBLANK = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS isblank.$ac_objext" + + fi + + + + + + GNULIB_ISBLANK=1 + + + + + + + + + + ac_fn_check_decl "$LINENO" "iswblank" "ac_cv_have_decl_iswblank" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_iswblank" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_ISWBLANK $ac_have_decl" >>confdefs.h + + if test $ac_cv_func_iswblank = no; then + HAVE_ISWBLANK=0 + if test $ac_cv_have_decl_iswblank = yes; then + REPLACE_ISWBLANK=1 + fi + fi + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + : + fi + fi + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iswblank.$ac_objext" + + fi + fi + + + + + + GNULIB_ISWBLANK=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_ISWBLANK 1" >>confdefs.h + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_langinfo_h='<'langinfo.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_langinfo_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_langinfo_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'langinfo.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_langinfo_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_langinfo_h + gl_cv_next_langinfo_h='"'$gl_header'"' + else + gl_cv_next_langinfo_h='<'langinfo.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_langinfo_h" >&5 +printf "%s\n" "$gl_cv_next_langinfo_h" >&6; } + fi + NEXT_LANGINFO_H=$gl_cv_next_langinfo_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'langinfo.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_langinfo_h + fi + NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H=$gl_next_as_first_directive + + + + + + HAVE_LANGINFO_CODESET=0 + HAVE_LANGINFO_T_FMT_AMPM=0 + HAVE_LANGINFO_ERA=0 + HAVE_LANGINFO_YESEXPR=0 + + if test $ac_cv_header_langinfo_h = yes; then + HAVE_LANGINFO_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines CODESET" >&5 +printf %s "checking whether langinfo.h defines CODESET... " >&6; } +if test ${gl_cv_header_langinfo_codeset+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int a = CODESET; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_codeset=yes +else case e in @%:@( + e) gl_cv_header_langinfo_codeset=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_codeset" >&5 +printf "%s\n" "$gl_cv_header_langinfo_codeset" >&6; } + if test $gl_cv_header_langinfo_codeset = yes; then + HAVE_LANGINFO_CODESET=1 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines T_FMT_AMPM" >&5 +printf %s "checking whether langinfo.h defines T_FMT_AMPM... " >&6; } +if test ${gl_cv_header_langinfo_t_fmt_ampm+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int a = T_FMT_AMPM; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_t_fmt_ampm=yes +else case e in @%:@( + e) gl_cv_header_langinfo_t_fmt_ampm=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_t_fmt_ampm" >&5 +printf "%s\n" "$gl_cv_header_langinfo_t_fmt_ampm" >&6; } + if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then + HAVE_LANGINFO_T_FMT_AMPM=1 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ERA" >&5 +printf %s "checking whether langinfo.h defines ERA... " >&6; } +if test ${gl_cv_header_langinfo_era+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int a = ERA; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_era=yes +else case e in @%:@( + e) gl_cv_header_langinfo_era=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_era" >&5 +printf "%s\n" "$gl_cv_header_langinfo_era" >&6; } + if test $gl_cv_header_langinfo_era = yes; then + HAVE_LANGINFO_ERA=1 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines YESEXPR" >&5 +printf %s "checking whether langinfo.h defines YESEXPR... " >&6; } +if test ${gl_cv_header_langinfo_yesexpr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int a = YESEXPR; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_yesexpr=yes +else case e in @%:@( + e) gl_cv_header_langinfo_yesexpr=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_yesexpr" >&5 +printf "%s\n" "$gl_cv_header_langinfo_yesexpr" >&6; } + if test $gl_cv_header_langinfo_yesexpr = yes; then + HAVE_LANGINFO_YESEXPR=1 + fi + else + HAVE_LANGINFO_H=0 + fi + + + + + + + + for gl_func in nl_langinfo; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +@%:@ Check whether --with-libsigsegv-prefix was given. +if test ${with_libsigsegv_prefix+y} +then : + withval=$with_libsigsegv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBSIGSEGV= + LTLIBSIGSEGV= + INCSIGSEGV= + LIBSIGSEGV_PREFIX= + HAVE_LIBSIGSEGV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='sigsegv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_a" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCSIGSEGV="${INCSIGSEGV}${INCSIGSEGV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$dep" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$dep" + ;; + esac + done + fi + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-R$found_dir" + done + fi + + + + + + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCSIGSEGV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsigsegv" >&5 +printf %s "checking for libsigsegv... " >&6; } +if test ${ac_cv_libsigsegv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + ac_save_LIBS="$LIBS" + case " $LIBSIGSEGV" in + *" -l"*) LIBS="$LIBS $LIBSIGSEGV" ;; + *) LIBS="$LIBSIGSEGV $LIBS" ;; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +sigsegv_deinstall_handler(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libsigsegv=yes +else case e in @%:@( + e) ac_cv_libsigsegv='no, consider installing GNU libsigsegv' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libsigsegv" >&5 +printf "%s\n" "$ac_cv_libsigsegv" >&6; } + if test "$ac_cv_libsigsegv" = yes; then + HAVE_LIBSIGSEGV=yes + +printf "%s\n" "@%:@define HAVE_LIBSIGSEGV 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libsigsegv" >&5 +printf %s "checking how to link with libsigsegv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBSIGSEGV" >&5 +printf "%s\n" "$LIBSIGSEGV" >&6; } + else + HAVE_LIBSIGSEGV=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBSIGSEGV= + LTLIBSIGSEGV= + LIBSIGSEGV_PREFIX= + fi + + + + + + + + gl_cv_lib_sigsegv="$ac_cv_libsigsegv" + + + + + + + + + + + LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" + + + + + + + + + + case "$host_os" in + solaris*) + +printf "%s\n" "@%:@define _LCONV_C99 1" >>confdefs.h + + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5 +printf %s "checking whether locale.h conforms to POSIX:2001... " >&6; } +if test ${gl_cv_header_locale_h_posix2001+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int x = LC_MESSAGES; + int y = sizeof (((struct lconv *) 0)->decimal_point); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_locale_h_posix2001=yes +else case e in @%:@( + e) gl_cv_header_locale_h_posix2001=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5 +printf "%s\n" "$gl_cv_header_locale_h_posix2001" >&6; } + + + if test $ac_cv_header_xlocale_h = yes; then + HAVE_XLOCALE_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5 +printf %s "checking whether locale.h defines locale_t... " >&6; } +if test ${gl_cv_header_locale_has_locale_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + locale_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_locale_has_locale_t=yes +else case e in @%:@( + e) gl_cv_header_locale_has_locale_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5 +printf "%s\n" "$gl_cv_header_locale_has_locale_t" >&6; } + if test $gl_cv_header_locale_has_locale_t = yes; then + gl_cv_header_locale_h_needs_xlocale_h=no + else + gl_cv_header_locale_h_needs_xlocale_h=yes + fi + else + HAVE_XLOCALE_H=0 + gl_cv_header_locale_h_needs_xlocale_h=no + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5 +printf %s "checking whether struct lconv is properly defined... " >&6; } +if test ${gl_cv_sys_struct_lconv_ok+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + struct lconv l; + int x = sizeof (l.decimal_point); + int y = sizeof (l.int_p_cs_precedes); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_lconv_ok=yes +else case e in @%:@( + e) gl_cv_sys_struct_lconv_ok=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5 +printf "%s\n" "$gl_cv_sys_struct_lconv_ok" >&6; } + if test $gl_cv_sys_struct_lconv_ok = no; then + REPLACE_STRUCT_LCONV=1 + fi + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_locale_h='<'locale.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_locale_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'locale.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_locale_h + gl_cv_next_locale_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5 +printf "%s\n" "$gl_cv_next_locale_h" >&6; } + fi + NEXT_LOCALE_H=$gl_cv_next_locale_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'locale.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_locale_h + fi + NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive + + + + + + + for gl_func in setlocale duplocale; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +/* Some systems provide declarations in a non-standard header. */ +#if HAVE_XLOCALE_H +# include +#endif + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + if test $REPLACE_STRUCT_LCONV = 1; then + REPLACE_LOCALECONV=1 + fi + + if test $REPLACE_LOCALECONV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS localeconv.$ac_objext" + + + ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include +" +if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_LCONV_DECIMAL_POINT 1" >>confdefs.h + + +fi + + + fi + + + + + + GNULIB_LOCALECONV=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_LOCALECONV 1" >>confdefs.h + + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS localtime-buffer.$ac_objext" + + + + + if test $ac_cv_func_lstat = yes; then + + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *no) + REPLACE_LSTAT=1 + ;; + esac + else + HAVE_LSTAT=0 + fi + + if test $REPLACE_LSTAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext" + + : + fi + + + + + + GNULIB_LSTAT=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_LSTAT 1" >>confdefs.h + + + + + + + + + if test $gl_cv_func_malloc_posix = yes; then + +printf "%s\n" "@%:@define HAVE_MALLOC_POSIX 1" >>confdefs.h + + else + REPLACE_MALLOC=1 + fi + + if test $REPLACE_MALLOC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" + + fi + + + + + + GNULIB_MALLOC_POSIX=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h + + + + + + + + + + + + + : + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_incomplete_state=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_sanitycheck=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_mbrtowc = no; then + HAVE_MBRTOWC=0 + ac_fn_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_mbrtowc" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_MBRTOWC $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_mbrtowc = yes; then + REPLACE_MBRTOWC=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBRTOWC=1 + else + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5 +printf %s "checking whether mbrtowc handles a NULL pwc argument... " >&6; } +if test ${gl_cv_func_mbrtowc_null_arg1+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris. + solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + int result = 0; + + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "\303\237er"; + mbstate_t state; + wchar_t wc; + size_t ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 5, &state); + if (ret != 2) + result |= 1; + if (!mbsinit (&state)) + result |= 2; + + memset (&state, '\0', sizeof (mbstate_t)); + ret = mbrtowc (NULL, input, 5, &state); + if (ret != 2) /* Solaris 7 fails here: ret is -1. */ + result |= 4; + if (!mbsinit (&state)) + result |= 8; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_null_arg1=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_null_arg1=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_null_arg1" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5 +printf %s "checking whether mbrtowc handles a NULL string argument... " >&6; } +if test ${gl_cv_func_mbrtowc_null_arg2+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on OSF/1. + osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + mbstate_t state; + wchar_t wc; + int ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + mbrtowc (&wc, NULL, 5, &state); + /* Check that wc was not modified. */ + if (wc != (wchar_t) 0xBADFACE) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_null_arg2=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_null_arg2=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_null_arg2" >&6; } + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5 +printf %s "checking whether mbrtowc has a correct return value... " >&6; } +if test ${gl_cv_func_mbrtowc_retval+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on HP-UX, Solaris, native Windows. + hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_retval="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \ + || { case "$host_os" in mingw*) true;; *) false;; esac; }; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + int result = 0; + int found_some_locale = 0; + /* This fails on Solaris. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "B\303\274\303\237er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 1) + result |= 1; + } + found_some_locale = 1; + } + /* This fails on HP-UX 11.11. */ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 2) + result |= 2; + } + found_some_locale = 1; + } + /* This fails on native Windows. */ + if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) + { + char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 4; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) + { + char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 8; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_China.936") != NULL) + { + char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 16; + } + found_some_locale = 1; + } + return (found_some_locale ? result : 77); +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_retval=yes +else case e in @%:@( + e) if test $? != 77; then + gl_cv_func_mbrtowc_retval=no + fi + ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_retval" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5 +printf %s "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; } +if test ${gl_cv_func_mbrtowc_nul_retval+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris 8 and 9. + solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + /* This fails on Solaris 8 and 9. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, "", 1, &state) != 0) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_nul_retval=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_nul_retval=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_nul_retval" >&6; } + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5 +printf %s "checking whether mbrtowc works on empty input... " >&6; } +if test ${gl_cv_func_mbrtowc_empty_input+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on AIX and glibc systems. + aix* | *-gnu*) + gl_cv_func_mbrtowc_empty_input="guessing no" ;; + *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; + esac + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + static wchar_t wc; + static mbstate_t mbs; + int + main (void) + { + return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2; + } +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_empty_input=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_empty_input=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_empty_input" >&6; } + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5 +printf %s "checking whether the C locale is free of encoding errors... " >&6; } +if test ${gl_cv_C_locale_sans_EILSEQ+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_cv_C_locale_sans_EILSEQ="guessing no" + + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + +int +main (void) +{ + + int i; + char *locale = setlocale (LC_ALL, "C"); + if (! locale) + return 2; + for (i = CHAR_MIN; i <= CHAR_MAX; i++) + { + char c = i; + wchar_t wc; + mbstate_t mbs = { 0, }; + size_t ss = mbrtowc (&wc, &c, 1, &mbs); + if (1 < ss) + return 3; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_C_locale_sans_EILSEQ=yes +else case e in @%:@( + e) gl_cv_C_locale_sans_EILSEQ=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_C_locale_sans_EILSEQ" >&5 +printf "%s\n" "$gl_cv_C_locale_sans_EILSEQ" >&6; } + + case "$gl_cv_func_mbrtowc_null_arg1" in + *yes) ;; + *) +printf "%s\n" "@%:@define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_null_arg2" in + *yes) ;; + *) +printf "%s\n" "@%:@define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_retval" in + *yes) ;; + *) +printf "%s\n" "@%:@define MBRTOWC_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_nul_retval" in + *yes) ;; + *) +printf "%s\n" "@%:@define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_empty_input" in + *yes) ;; + *) +printf "%s\n" "@%:@define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case $gl_cv_C_locale_sans_EILSEQ in + *yes) ;; + *) +printf "%s\n" "@%:@define C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + fi + fi + + if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBRTOWC=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBRTOWC 1" >>confdefs.h + + + + + + + + + GNULIB_MBSCASECMP=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBSCASECMP 1" >>confdefs.h + + + + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_incomplete_state=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_sanitycheck=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_mbsinit = no; then + HAVE_MBSINIT=0 + ac_fn_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_mbsinit" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_MBSINIT $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_mbsinit = yes; then + REPLACE_MBSINIT=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSINIT=1 + else + case "$host_os" in + mingw*) REPLACE_MBSINIT=1 ;; + esac + fi + fi + + if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBSINIT=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBSINIT 1" >>confdefs.h + + + + + + + if test $ac_cv_func_mbslen = yes; then + HAVE_MBSLEN=1 + else + HAVE_MBSLEN=0 + fi + + + + + + + GNULIB_MBSLEN=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBSLEN 1" >>confdefs.h + + + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_incomplete_state=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_sanitycheck=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_mbsrtowcs = no; then + HAVE_MBSRTOWCS=0 + ac_fn_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_mbsrtowcs" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_MBSRTOWCS $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_mbsrtowcs = yes; then + REPLACE_MBSRTOWCS=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSRTOWCS=1 + else + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5 +printf %s "checking whether mbsrtowcs works... " >&6; } +if test ${gl_cv_func_mbsrtowcs_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on HP-UX, Solaris, mingw. + hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbsrtowcs_works="guessing yes" ;; + esac + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + int result = 0; + /* Test whether the function supports a NULL destination argument. + This fails on native Windows. */ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + const char input[] = "\337er"; + const char *src = input; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbsrtowcs (NULL, &src, 1, &state) != 3 + || src != input) + result |= 1; + } + /* Test whether the function works when started with a conversion state + in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + const char input[] = "B\303\274\303\237er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + result |= 2; + } + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "<\306\374\313\334\270\354>"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 4; + if (mbsrtowcs (NULL, &src, 10, &state) != 3) + result |= 4; + } + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + const char input[] = "B\250\271\201\060\211\070er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + result |= 8; + } + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbsrtowcs_works=yes +else case e in @%:@( + e) gl_cv_func_mbsrtowcs_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5 +printf "%s\n" "$gl_cv_func_mbsrtowcs_works" >&6; } + + case "$gl_cv_func_mbsrtowcs_works" in + *yes) ;; + *) REPLACE_MBSRTOWCS=1 ;; + esac + fi + fi + + if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBSRTOWCS=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h + + + + + + + + + GNULIB_MBSSTR=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBSSTR 1" >>confdefs.h + + + + + + + if false; then + REPLACE_MBTOWC=1 + fi + + if test $REPLACE_MBTOWC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbtowc.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBTOWC=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBTOWC 1" >>confdefs.h + + + + + + : + + + if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext" + + + ac_fn_c_check_header_compile "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default" +if test "x$ac_cv_header_bp_sym_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_BP_SYM_H 1" >>confdefs.h + +fi + + + fi + + + + + + GNULIB_MEMCHR=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MEMCHR 1" >>confdefs.h + + + + + + + + + + + if test $ac_cv_func_mkstemp = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working mkstemp" >&5 +printf %s "checking for working mkstemp... " >&6; } +if test ${gl_cv_func_working_mkstemp+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + mkdir conftest.mkstemp + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_working_mkstemp="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_mkstemp="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ +int result = 0; + int i; + off_t large = (off_t) 4294967295u; + if (large < 0) + large = 2147483647; + umask (0); + for (i = 0; i < 70; i++) + { + char templ[] = "conftest.mkstemp/coXXXXXX"; + int (*mkstemp_function) (char *) = mkstemp; + int fd = mkstemp_function (templ); + if (fd < 0) + result |= 1; + else + { + struct stat st; + if (lseek (fd, large, SEEK_SET) != large) + result |= 2; + if (fstat (fd, &st) < 0) + result |= 4; + else if (st.st_mode & 0077) + result |= 8; + if (close (fd)) + result |= 16; + } + } + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_working_mkstemp=yes +else case e in @%:@( + e) gl_cv_func_working_mkstemp=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -rf conftest.mkstemp + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mkstemp" >&5 +printf "%s\n" "$gl_cv_func_working_mkstemp" >&6; } + case "$gl_cv_func_working_mkstemp" in + *yes) ;; + *) + REPLACE_MKSTEMP=1 + ;; + esac + else + HAVE_MKSTEMP=0 + fi + + if test $HAVE_MKSTEMP = 0 || test $REPLACE_MKSTEMP = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mkstemp.$ac_objext" + + + + fi + + + + + + GNULIB_MKSTEMP=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MKSTEMP 1" >>confdefs.h + + + + + + + + + REPLACE_MKTIME=0 + if test "$gl_cv_func_working_mktime" != yes; then + REPLACE_MKTIME=1 + +printf "%s\n" "@%:@define NEED_MKTIME_WORKING 1" >>confdefs.h + + fi + case "$host_os" in + mingw*) + REPLACE_MKTIME=1 + +printf "%s\n" "@%:@define NEED_MKTIME_WINDOWS 1" >>confdefs.h + + ;; + esac + + if test $REPLACE_MKTIME = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext" + + : + fi + + + + + + GNULIB_MKTIME=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MKTIME 1" >>confdefs.h + + + + + + + WANT_MKTIME_INTERNAL=0 + ac_fn_c_check_func "$LINENO" "__mktime_internal" "ac_cv_func___mktime_internal" +if test "x$ac_cv_func___mktime_internal" = xyes +then : + +printf "%s\n" "@%:@define mktime_internal __mktime_internal" >>confdefs.h + + +else case e in @%:@( + e) WANT_MKTIME_INTERNAL=1 + +printf "%s\n" "@%:@define NEED_MKTIME_INTERNAL 1" >>confdefs.h + + ;; +esac +fi + + + if test $WANT_MKTIME_INTERNAL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext" + + : + fi + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext" + + fi + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext" + + fi + + +printf "%s\n" "@%:@define GNULIB_MSVC_NOTHROW 1" >>confdefs.h + + + + + + + + if test $ac_cv_func_nl_langinfo = yes; then + # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether YESEXPR works" >&5 +printf %s "checking whether YESEXPR works... " >&6; } +if test ${gl_cv_func_nl_langinfo_yesexpr_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on irix systems. + irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";; + # Guess yes elsewhere. + *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +return !*nl_langinfo(YESEXPR); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_nl_langinfo_yesexpr_works=yes +else case e in @%:@( + e) gl_cv_func_nl_langinfo_yesexpr_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nl_langinfo_yesexpr_works" >&5 +printf "%s\n" "$gl_cv_func_nl_langinfo_yesexpr_works" >&6; } + case $gl_cv_func_nl_langinfo_yesexpr_works in + *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;; + *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;; + esac + +printf "%s\n" "@%:@define FUNC_NL_LANGINFO_YESEXPR_WORKS $FUNC_NL_LANGINFO_YESEXPR_WORKS" >>confdefs.h + + if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \ + && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then + : + else + REPLACE_NL_LANGINFO=1 + +printf "%s\n" "@%:@define REPLACE_NL_LANGINFO 1" >>confdefs.h + + fi + else + HAVE_NL_LANGINFO=0 + fi + + if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS nl_langinfo.$ac_objext" + + fi + + + + + + GNULIB_NL_LANGINFO=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_NL_LANGINFO 1" >>confdefs.h + + + + + + case "$host_os" in + mingw* | pw*) + REPLACE_OPEN=1 + ;; + *) + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5 +printf %s "checking whether open recognizes a trailing slash... " >&6; } +if test ${gl_cv_func_open_slash+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + touch conftest.tmp + ln -s conftest.tmp conftest.lnk + fi + if test "$cross_compiling" = yes +then : + + case "$host_os" in + freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*) + gl_cv_func_open_slash="guessing no" ;; + *) + gl_cv_func_open_slash="guessing yes" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_UNISTD_H +# include +#endif +int main () +{ + int result = 0; +#if HAVE_LSTAT + if (open ("conftest.lnk/", O_RDONLY) != -1) + result |= 1; +#endif + if (open ("conftest.sl/", O_CREAT, 0600) >= 0) + result |= 2; + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_open_slash=yes +else case e in @%:@( + e) gl_cv_func_open_slash=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.sl conftest.tmp conftest.lnk + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5 +printf "%s\n" "$gl_cv_func_open_slash" >&6; } + case "$gl_cv_func_open_slash" in + *no) + +printf "%s\n" "@%:@define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h + + REPLACE_OPEN=1 + ;; + esac + ;; + esac + + + + if test $REPLACE_OPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext" + + + + : + + fi + + + + + + GNULIB_OPEN=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_OPEN 1" >>confdefs.h + + + + + + + ac_fn_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_program_invocation_name" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl" >>confdefs.h + + ac_fn_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl" >>confdefs.h + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"'" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"'" + + + : + + + : + + + + + ac_fn_c_check_func "$LINENO" "raise" "ac_cv_func_raise" +if test "x$ac_cv_func_raise" = xyes +then : + printf "%s\n" "@%:@define HAVE_RAISE 1" >>confdefs.h + +fi + + if test $ac_cv_func_raise = no; then + HAVE_RAISE=0 + else + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_RAISE=1 + fi + + + + + + if test $gl_cv_type_sigset_t = yes; then + ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" +if test "x$ac_cv_func_sigprocmask" = xyes +then : + gl_cv_func_sigprocmask=1 +fi + + fi + if test -z "$gl_cv_func_sigprocmask"; then + HAVE_POSIX_SIGNALBLOCKING=0 + fi + + if test $HAVE_POSIX_SIGNALBLOCKING = 0; then + : + fi + + fi + + if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS raise.$ac_objext" + + : + fi + + + + + + GNULIB_RAISE=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_RAISE 1" >>confdefs.h + + + + + + + + ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr" +if test "x$ac_cv_func_rawmemchr" = xyes +then : + printf "%s\n" "@%:@define HAVE_RAWMEMCHR 1" >>confdefs.h + +fi + + if test $ac_cv_func_rawmemchr = no; then + HAVE_RAWMEMCHR=0 + fi + + if test $HAVE_RAWMEMCHR = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext" + + : + fi + + + + + + GNULIB_RAWMEMCHR=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h + + + + + + + if test $ac_cv_func_readlink = no; then + HAVE_READLINK=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5 +printf %s "checking whether readlink signature is correct... " >&6; } +if test ${gl_cv_decl_readlink_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Cause compilation failure if original declaration has wrong type. */ + ssize_t readlink (const char *, char *, size_t); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_readlink_works=yes +else case e in @%:@( + e) gl_cv_decl_readlink_works=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5 +printf "%s\n" "$gl_cv_decl_readlink_works" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5 +printf %s "checking whether readlink handles trailing slash correctly... " >&6; } +if test ${gl_cv_func_readlink_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # We have readlink, so assume ln -s works. + ln -s conftest.no-such conftest.link + ln -s conftest.link conftest.lnk2 + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_readlink_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_readlink_works="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +char buf[20]; + return readlink ("conftest.lnk2/", buf, sizeof buf) != -1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_readlink_works=yes +else case e in @%:@( + e) gl_cv_func_readlink_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.link conftest.lnk2 ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_works" >&5 +printf "%s\n" "$gl_cv_func_readlink_works" >&6; } + case "$gl_cv_func_readlink_works" in + *yes) + if test "$gl_cv_decl_readlink_works" != yes; then + REPLACE_READLINK=1 + fi + ;; + *) + +printf "%s\n" "@%:@define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h + + REPLACE_READLINK=1 + ;; + esac + fi + + if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext" + + + : + + fi + + + + + + GNULIB_READLINK=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_READLINK 1" >>confdefs.h + + + + + +@%:@ Check whether --with-included-regex was given. +if test ${with_included_regex+y} +then : + withval=$with_included_regex; +fi + + + case $with_included_regex in #( + yes|no) ac_use_included_regex=$with_included_regex + ;; + '') + # If the system regex support is good enough that it passes the + # following run test, then default to *not* using the included regex.c. + # If cross compiling, assume the test would fail and use the included + # regex.c. + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working re_compile_pattern" >&5 +printf %s "checking for working re_compile_pattern... " >&6; } +if test ${gl_cv_func_re_compile_pattern_working+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_re_compile_pattern_working=no +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + + #include + #include + #include + + #if defined M_CHECK_ACTION || HAVE_DECL_ALARM + # include + # include + #endif + + #if HAVE_MALLOC_H + # include + #endif + + #ifdef M_CHECK_ACTION + /* Exit with distinguishable exit code. */ + static void sigabrt_no_core (int sig) { raise (SIGTERM); } + #endif + +int +main (void) +{ +int result = 0; + static struct re_pattern_buffer regex; + unsigned char folded_chars[UCHAR_MAX + 1]; + int i; + const char *s; + struct re_registers regs; + + /* Some builds of glibc go into an infinite loop on this + test. Use alarm to force death, and mallopt to avoid + malloc recursion in diagnosing the corrupted heap. */ +#if HAVE_DECL_ALARM + signal (SIGALRM, SIG_DFL); + alarm (2); +#endif +#ifdef M_CHECK_ACTION + signal (SIGABRT, sigabrt_no_core); + mallopt (M_CHECK_ACTION, 2); +#endif + + if (setlocale (LC_ALL, "en_US.UTF-8")) + { + { + /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html + This test needs valgrind to catch the bug on Debian + GNU/Linux 3.1 x86, but it might catch the bug better + on other platforms and it shouldn't hurt to try the + test here. */ + static char const pat[] = "insert into"; + static char const data[] = + "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK"; + re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE + | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else if (re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, ®s) + != -1) + result |= 1; + regfree (®ex); + } + + { + /* This test is from glibc bug 15078. + The test case is from Andreas Schwab in + . + */ + static char const pat[] = "[^x]x"; + static char const data[] = + /* */ + "\xe1\x80\x80" + "\xe1\x80\xbb" + "\xe1\x80\xbd" + "\xe1\x80\x94" + "\xe1\x80\xba" + "\xe1\x80\xaf" + "\xe1\x80\x95" + "\xe1\x80\xba" + "x"; + re_set_syntax (0); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else + { + i = re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, 0); + if (i != 0 && i != 21) + result |= 1; + } + regfree (®ex); + } + + if (! setlocale (LC_ALL, "C")) + return 1; + } + + /* This test is from glibc bug 3957, reported by Andrew Mackey. */ + re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[^x]b", 6, ®ex); + if (s) + result |= 2; + /* This should fail, but succeeds for glibc-2.5. */ + else if (re_search (®ex, "a\nb", 3, 0, 3, ®s) != -1) + result |= 2; + + /* This regular expression is from Spencer ere test number 75 + in grep-2.3. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP); + memset (®ex, 0, sizeof regex); + for (i = 0; i <= UCHAR_MAX; i++) + folded_chars[i] = i; + regex.translate = folded_chars; + s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, ®ex); + /* This should fail with _Invalid character class name_ error. */ + if (!s) + result |= 4; + + /* Ensure that [b-a] is diagnosed as invalid, when + using RE_NO_EMPTY_RANGES. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[b-a]", 6, ®ex); + if (s == 0) + result |= 8; + + /* This should succeed, but does not for glibc-2.1.3. */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("{1", 2, ®ex); + if (s) + result |= 8; + + /* The following example is derived from a problem report + against gawk from Jorge Stolfi . */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[an\371]*n", 7, ®ex); + if (s) + result |= 8; + /* This should match, but does not for glibc-2.2.1. */ + else if (re_match (®ex, "an", 2, 0, ®s) != 2) + result |= 8; + + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 8; + /* glibc-2.2.93 does not work with a negative RANGE argument. */ + else if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1) + result |= 8; + + /* The version of regex.c in older versions of gnulib + ignored RE_ICASE. Detect that problem too. */ + re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 16; + else if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0) + result |= 16; + + /* Catch a bug reported by Vin Shelton in + http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html + */ + re_set_syntax (RE_SYNTAX_POSIX_BASIC + & ~RE_CONTEXT_INVALID_DUP + & ~RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, ®ex); + if (s) + result |= 32; + + /* REG_STARTEND was added to glibc on 2004-01-15. + Reject older versions. */ + if (! REG_STARTEND) + result |= 64; + +#if 0 + /* It would be nice to reject hosts whose regoff_t values are too + narrow (including glibc on hosts with 64-bit ptrdiff_t and + 32-bit int), but we should wait until glibc implements this + feature. Otherwise, support for equivalence classes and + multibyte collation symbols would always be broken except + when compiling --without-included-regex. */ + if (sizeof (regoff_t) < sizeof (ptrdiff_t) + || sizeof (regoff_t) < sizeof (ssize_t)) + result |= 64; +#endif + + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_re_compile_pattern_working=yes +else case e in @%:@( + e) gl_cv_func_re_compile_pattern_working=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_re_compile_pattern_working" >&5 +printf "%s\n" "$gl_cv_func_re_compile_pattern_working" >&6; } + case $gl_cv_func_re_compile_pattern_working in #( + yes) ac_use_included_regex=no;; #( + no) ac_use_included_regex=yes;; + esac + ;; + *) as_fn_error $? "Invalid value for --with-included-regex: $with_included_regex" "$LINENO" 5 + ;; + esac + + if test $ac_use_included_regex = yes; then + +printf "%s\n" "@%:@define _REGEX_INCLUDE_LIMITS_H 1" >>confdefs.h + + +printf "%s\n" "@%:@define _REGEX_LARGE_OFFSETS 1" >>confdefs.h + + +printf "%s\n" "@%:@define re_syntax_options rpl_re_syntax_options" >>confdefs.h + + +printf "%s\n" "@%:@define re_set_syntax rpl_re_set_syntax" >>confdefs.h + + +printf "%s\n" "@%:@define re_compile_pattern rpl_re_compile_pattern" >>confdefs.h + + +printf "%s\n" "@%:@define re_compile_fastmap rpl_re_compile_fastmap" >>confdefs.h + + +printf "%s\n" "@%:@define re_search rpl_re_search" >>confdefs.h + + +printf "%s\n" "@%:@define re_search_2 rpl_re_search_2" >>confdefs.h + + +printf "%s\n" "@%:@define re_match rpl_re_match" >>confdefs.h + + +printf "%s\n" "@%:@define re_match_2 rpl_re_match_2" >>confdefs.h + + +printf "%s\n" "@%:@define re_set_registers rpl_re_set_registers" >>confdefs.h + + +printf "%s\n" "@%:@define re_comp rpl_re_comp" >>confdefs.h + + +printf "%s\n" "@%:@define re_exec rpl_re_exec" >>confdefs.h + + +printf "%s\n" "@%:@define regcomp rpl_regcomp" >>confdefs.h + + +printf "%s\n" "@%:@define regexec rpl_regexec" >>confdefs.h + + +printf "%s\n" "@%:@define regerror rpl_regerror" >>confdefs.h + + +printf "%s\n" "@%:@define regfree rpl_regfree" >>confdefs.h + + fi + + if test $ac_use_included_regex = yes; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS regex.$ac_objext" + + + + + + + + + ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_LIBINTL_H 1" >>confdefs.h + +fi + + + ac_fn_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_isblank" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h + + + fi + + + + + + if test $ac_cv_func_secure_getenv = no; then + HAVE_SECURE_GETENV=0 + fi + + if test $HAVE_SECURE_GETENV = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS secure_getenv.$ac_objext" + + + ac_fn_c_check_func "$LINENO" "__secure_getenv" "ac_cv_func___secure_getenv" +if test "x$ac_cv_func___secure_getenv" = xyes +then : + printf "%s\n" "@%:@define HAVE___SECURE_GETENV 1" >>confdefs.h + +fi + + if test $ac_cv_func___secure_getenv = no; then + ac_fn_c_check_func "$LINENO" "issetugid" "ac_cv_func_issetugid" +if test "x$ac_cv_func_issetugid" = xyes +then : + printf "%s\n" "@%:@define HAVE_ISSETUGID 1" >>confdefs.h + +fi + + fi + + + fi + + + + + + GNULIB_SECURE_GETENV=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SECURE_GETENV 1" >>confdefs.h + + + + + + if test $ac_cv_func_setenv = no; then + HAVE_SETENV=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5 +printf %s "checking whether setenv validates arguments... " >&6; } +if test ${gl_cv_func_setenv_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_setenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_setenv_works="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + +int +main (void) +{ + + int result = 0; + { + if (setenv ("", "", 0) != -1) + result |= 1; + else if (errno != EINVAL) + result |= 2; + } + { + if (setenv ("a", "=", 1) != 0) + result |= 4; + else if (strcmp (getenv ("a"), "=") != 0) + result |= 8; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_setenv_works=yes +else case e in @%:@( + e) gl_cv_func_setenv_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5 +printf "%s\n" "$gl_cv_func_setenv_works" >&6; } + case "$gl_cv_func_setenv_works" in + *yes) ;; + *) + REPLACE_SETENV=1 + ;; + esac + fi + + if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext" + + fi + + + + + + GNULIB_SETENV=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SETENV 1" >>confdefs.h + + + + + + + if test $ac_cv_func_sigaction = yes; then + ac_fn_c_check_member "$LINENO" "struct sigaction" "sa_sigaction" "ac_cv_member_struct_sigaction_sa_sigaction" "#include +" +if test "x$ac_cv_member_struct_sigaction_sa_sigaction" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1" >>confdefs.h + + +fi + + if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then + HAVE_STRUCT_SIGACTION_SA_SIGACTION=0 + fi + else + HAVE_SIGACTION=0 + fi + + if test $HAVE_SIGACTION = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS sigaction.$ac_objext" + + + + + + + + ac_fn_c_check_type "$LINENO" "siginfo_t" "ac_cv_type_siginfo_t" " +#include + +" +if test "x$ac_cv_type_siginfo_t" = xyes +then : + +printf "%s\n" "@%:@define HAVE_SIGINFO_T 1" >>confdefs.h + + +fi + + if test $ac_cv_type_siginfo_t = no; then + HAVE_SIGINFO_T=0 + fi + + fi + + + + + + GNULIB_SIGACTION=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SIGACTION 1" >>confdefs.h + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_signal_h='<'signal.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_signal_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'signal.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_signal_h + gl_cv_next_signal_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5 +printf "%s\n" "$gl_cv_next_signal_h" >&6; } + fi + NEXT_SIGNAL_H=$gl_cv_next_signal_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'signal.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_signal_h + fi + NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive + + + + + +# AIX declares sig_atomic_t to already include volatile, and C89 compilers +# then choke on 'volatile sig_atomic_t'. C99 requires that it compile. + ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" " +#include + +" +if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes +then : + +else case e in @%:@( + e) HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0 ;; +esac +fi + + + + + + + + ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" " +#include + +" +if test "x$ac_cv_type_sighandler_t" = xyes +then : + +else case e in @%:@( + e) HAVE_SIGHANDLER_T=0 ;; +esac +fi + + + + for gl_func in pthread_sigmask sigaction sigaddset sigdelset sigemptyset sigfillset sigismember sigpending sigprocmask; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + if test $gl_cv_type_sigset_t = yes; then + ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" +if test "x$ac_cv_func_sigprocmask" = xyes +then : + gl_cv_func_sigprocmask=1 +fi + + fi + if test -z "$gl_cv_func_sigprocmask"; then + HAVE_POSIX_SIGNALBLOCKING=0 + fi + + if test $HAVE_POSIX_SIGNALBLOCKING = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS sigprocmask.$ac_objext" + + : + fi + + + + + + GNULIB_SIGPROCMASK=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SIGPROCMASK 1" >>confdefs.h + + + + + ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_STDINT_H 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5 +printf %s "checking for SIZE_MAX... " >&6; } +if test ${gl_cv_size_max+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_cv_size_max= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_STDINT_H +#include +#endif +#ifdef SIZE_MAX +Found it +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "Found it" >/dev/null 2>&1 +then : + gl_cv_size_max=yes +fi +rm -rf conftest* + + if test -z "$gl_cv_size_max"; then + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) * CHAR_BIT - 1" "size_t_bits_minus_1" "#include +#include " +then : + +else case e in @%:@( + e) size_t_bits_minus_1= ;; +esac +fi + + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint" "#include " +then : + +else case e in @%:@( + e) fits_in_uint= ;; +esac +fi + + if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then + if test $fits_in_uint = 1; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + extern size_t foo; + extern unsigned long foo; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + fits_in_uint=0 +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $fits_in_uint = 1; then + gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" + else + gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" + fi + else + gl_cv_size_max='((size_t)~(size_t)0)' + fi + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5 +printf "%s\n" "$gl_cv_size_max" >&6; } + if test "$gl_cv_size_max" != yes; then + +printf "%s\n" "@%:@define SIZE_MAX $gl_cv_size_max" >>confdefs.h + + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 +printf %s "checking for ssize_t... " >&6; } +if test ${gt_cv_ssize_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +int x = sizeof (ssize_t *) + sizeof (ssize_t); + return !x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_ssize_t=yes +else case e in @%:@( + e) gt_cv_ssize_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5 +printf "%s\n" "$gt_cv_ssize_t" >&6; } + if test $gt_cv_ssize_t = no; then + +printf "%s\n" "@%:@define ssize_t int" >>confdefs.h + + fi + + + + + + case "$host_os" in + mingw*) + REPLACE_STAT=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5 +printf %s "checking whether stat handles trailing slashes on files... " >&6; } +if test ${gl_cv_func_stat_file_slash+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) touch conftest.tmp + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + ln -s conftest.tmp conftest.lnk + fi + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_stat_file_slash="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +int result = 0; + struct stat st; + if (!stat ("conftest.tmp/", &st)) + result |= 1; +#if HAVE_LSTAT + if (!stat ("conftest.lnk/", &st)) + result |= 2; +#endif + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_stat_file_slash=yes +else case e in @%:@( + e) gl_cv_func_stat_file_slash=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.tmp conftest.lnk ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5 +printf "%s\n" "$gl_cv_func_stat_file_slash" >&6; } + case $gl_cv_func_stat_file_slash in + *no) + REPLACE_STAT=1 + +printf "%s\n" "@%:@define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h +;; + esac + ;; + esac + + if test $REPLACE_STAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" + + + + : + + fi + + + + + + GNULIB_STAT=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STAT 1" >>confdefs.h + + + + + + + + ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1" >>confdefs.h + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5 +printf %s "checking whether struct stat.st_atim is of type struct timespec... " >&6; } +if test ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #if HAVE_SYS_TIME_H + # include + #endif + #include + struct timespec ts; + struct stat st; + +int +main (void) +{ + + st.st_atim = ts; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes +else case e in @%:@( + e) ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5 +printf "%s\n" "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; } + if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then + +printf "%s\n" "@%:@define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h + + fi +else case e in @%:@( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1" >>confdefs.h + + +else case e in @%:@( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_ATIMENSEC 1" >>confdefs.h + + +else case e in @%:@( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1" >>confdefs.h + + +fi + ;; +esac +fi + ;; +esac +fi + ;; +esac +fi + + + + + + ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1" >>confdefs.h + + +else case e in @%:@( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1" >>confdefs.h + + +else case e in @%:@( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtim.tv_nsec" "ac_cv_member_struct_stat_st_birthtim_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1" >>confdefs.h + + +fi + ;; +esac +fi + ;; +esac +fi + + + + STDARG_H='' + NEXT_STDARG_H='' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 +printf %s "checking for va_copy... " >&6; } + if test ${gl_cv_func_va_copy+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + +#ifndef va_copy +void (*func) (va_list, va_list) = va_copy; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_va_copy=yes +else case e in @%:@( + e) gl_cv_func_va_copy=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_va_copy" >&5 +printf "%s\n" "$gl_cv_func_va_copy" >&6; } + if test $gl_cv_func_va_copy = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined _AIX && !defined __GNUC__ + AIX vaccine + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "vaccine" >/dev/null 2>&1 +then : + gl_aixcc=yes +else case e in @%:@( + e) gl_aixcc=no ;; +esac +fi +rm -rf conftest* + + if test $gl_aixcc = yes; then + STDARG_H=stdarg.h + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdarg_h='<'stdarg.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_stdarg_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdarg.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdarg_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdarg_h + gl_cv_next_stdarg_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdarg_h" >&5 +printf "%s\n" "$gl_cv_next_stdarg_h" >&6; } + fi + NEXT_STDARG_H=$gl_cv_next_stdarg_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdarg.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdarg_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDARG_H=$gl_next_as_first_directive + + + + + if test "$gl_cv_next_stdarg_h" = '""'; then + gl_cv_next_stdarg_h='"///usr/include/stdarg.h"' + NEXT_STDARG_H="$gl_cv_next_stdarg_h" + fi + else + + saved_as_echo_n="$as_@&t@echo_n" + as_@&t@echo_n=':' + if test ${gl_cv_func___va_copy+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + +#ifndef __va_copy +error, bail out +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func___va_copy=yes +else case e in @%:@( + e) gl_cv_func___va_copy=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + as_@&t@echo_n="$saved_as_echo_n" + + if test $gl_cv_func___va_copy = yes; then + +printf "%s\n" "@%:@define va_copy __va_copy" >>confdefs.h + + else + + +printf "%s\n" "@%:@define va_copy gl_va_copy" >>confdefs.h + + fi + fi + fi + + if test -n "$STDARG_H"; then + GL_GENERATE_STDARG_H_TRUE= + GL_GENERATE_STDARG_H_FALSE='#' +else + GL_GENERATE_STDARG_H_TRUE='#' + GL_GENERATE_STDARG_H_FALSE= +fi + + + + + + + # Define two additional variables used in the Makefile substitution. + + if test "$ac_cv_header_stdbool_h" = yes; then + STDBOOL_H='' + else + STDBOOL_H='stdbool.h' + fi + + if test -n "$STDBOOL_H"; then + GL_GENERATE_STDBOOL_H_TRUE= + GL_GENERATE_STDBOOL_H_FALSE='#' +else + GL_GENERATE_STDBOOL_H_TRUE='#' + GL_GENERATE_STDBOOL_H_FALSE= +fi + + + if test "$ac_cv_type__Bool" = yes; then + HAVE__BOOL=1 + else + HAVE__BOOL=0 + fi + + + + + + STDDEF_H= + ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include + +" +if test "x$ac_cv_type_max_align_t" = xyes +then : + +else case e in @%:@( + e) HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h ;; +esac +fi + + if test $gt_cv_c_wchar_t = no; then + HAVE_WCHAR_T=0 + STDDEF_H=stddef.h + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 +printf %s "checking whether NULL can be used in arbitrary expressions... " >&6; } +if test ${gl_cv_decl_null_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int test[2 * (sizeof NULL == sizeof (void *)) -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_null_works=yes +else case e in @%:@( + e) gl_cv_decl_null_works=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 +printf "%s\n" "$gl_cv_decl_null_works" >&6; } + if test $gl_cv_decl_null_works = no; then + REPLACE_NULL=1 + STDDEF_H=stddef.h + fi + + if test -n "$STDDEF_H"; then + GL_GENERATE_STDDEF_H_TRUE= + GL_GENERATE_STDDEF_H_FALSE='#' +else + GL_GENERATE_STDDEF_H_TRUE='#' + GL_GENERATE_STDDEF_H_FALSE= +fi + + if test -n "$STDDEF_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stddef_h='<'stddef.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_stddef_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stddef.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stddef_h + gl_cv_next_stddef_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 +printf "%s\n" "$gl_cv_next_stddef_h" >&6; } + fi + NEXT_STDDEF_H=$gl_cv_next_stddef_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stddef.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stddef_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive + + + + + fi + + + + + printf "%s\n" "@%:@define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdio_h='<'stdio.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_stdio_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdio.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdio_h + gl_cv_next_stdio_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5 +printf "%s\n" "$gl_cv_next_stdio_h" >&6; } + fi + NEXT_STDIO_H=$gl_cv_next_stdio_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdio.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdio_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5 +printf %s "checking which flavor of printf attribute matches inttypes macros... " >&6; } +if test ${gl_cv_func_printf_attribute_flavor+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define __STDC_FORMAT_MACROS 1 + #include + #include + /* For non-mingw systems, compilation will trivially succeed. + For mingw, compilation will succeed for older mingw (system + printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */ + #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_printf_attribute_flavor=system +else case e in @%:@( + e) gl_cv_func_printf_attribute_flavor=gnu ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5 +printf "%s\n" "$gl_cv_func_printf_attribute_flavor" >&6; } + if test "$gl_cv_func_printf_attribute_flavor" = gnu; then + +printf "%s\n" "@%:@define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h + + fi + + GNULIB_FSCANF=1 + + +printf "%s\n" "@%:@define GNULIB_FSCANF 1" >>confdefs.h + + + GNULIB_SCANF=1 + + +printf "%s\n" "@%:@define GNULIB_SCANF 1" >>confdefs.h + + + GNULIB_FGETC=1 + GNULIB_GETC=1 + GNULIB_GETCHAR=1 + GNULIB_FGETS=1 + GNULIB_FREAD=1 + + + GNULIB_FPRINTF=1 + GNULIB_PRINTF=1 + GNULIB_VFPRINTF=1 + GNULIB_VPRINTF=1 + GNULIB_FPUTC=1 + GNULIB_PUTC=1 + GNULIB_PUTCHAR=1 + GNULIB_FPUTS=1 + GNULIB_PUTS=1 + GNULIB_FWRITE=1 + + + + + for gl_func in dprintf fpurge fseeko ftello getdelim getline gets pclose popen renameat snprintf tmpfile vdprintf vsnprintf; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdlib_h='<'stdlib.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_stdlib_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdlib.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdlib_h + gl_cv_next_stdlib_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5 +printf "%s\n" "$gl_cv_next_stdlib_h" >&6; } + fi + NEXT_STDLIB_H=$gl_cv_next_stdlib_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdlib.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdlib_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive + + + + + + + for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#if HAVE_SYS_LOADAVG_H +# include +#endif +#if HAVE_RANDOM_H +# include +#endif + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" +if test "x$ac_cv_func_strcasecmp" = xyes +then : + printf "%s\n" "@%:@define HAVE_STRCASECMP 1" >>confdefs.h + +fi + + if test $ac_cv_func_strcasecmp = no; then + HAVE_STRCASECMP=0 + fi + + + + ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" +if test "x$ac_cv_func_strncasecmp" = xyes +then : + printf "%s\n" "@%:@define HAVE_STRNCASECMP 1" >>confdefs.h + +fi + + if test $ac_cv_func_strncasecmp = yes; then + HAVE_STRNCASECMP=1 + else + HAVE_STRNCASECMP=0 + fi + ac_fn_check_decl "$LINENO" "strncasecmp" "ac_cv_have_decl_strncasecmp" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strncasecmp" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_STRNCASECMP $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_strncasecmp = no; then + HAVE_DECL_STRNCASECMP=0 + fi + + + if test $HAVE_STRCASECMP = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strcasecmp.$ac_objext" + + + : + + fi + if test $HAVE_STRNCASECMP = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strncasecmp.$ac_objext" + + + : + + fi + + + + + + + + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5 +printf %s "checking for working strerror function... " >&6; } +if test ${gl_cv_func_working_strerror+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_working_strerror="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_strerror="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +if (!*strerror (-2)) return 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_working_strerror=yes +else case e in @%:@( + e) gl_cv_func_working_strerror=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5 +printf "%s\n" "$gl_cv_func_working_strerror" >&6; } + case "$gl_cv_func_working_strerror" in + *yes) ;; + *) + REPLACE_STRERROR=1 + ;; + esac + + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR=1 ;; + esac + + else + REPLACE_STRERROR=1 + fi + + if test $REPLACE_STRERROR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext" + + fi + + +printf "%s\n" "@%:@define GNULIB_STRERROR 1" >>confdefs.h + + + + + + + + GNULIB_STRERROR=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STRERROR 1" >>confdefs.h + + + + + + if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext" + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + fi + + # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE. + + + + + + + +printf "%s\n" "@%:@define my_strftime nstrftime" >>confdefs.h + + + if test $gl_cond_libtool = false; then + gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV" + gl_libdeps="$gl_libdeps $LIBICONV" + fi + + + + + + + + + + + + + if test $ac_cv_have_decl_strndup = no; then + HAVE_DECL_STRNDUP=0 + fi + + if test $ac_cv_func_strndup = yes; then + HAVE_STRNDUP=1 + # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strndup" >&5 +printf %s "checking for working strndup... " >&6; } +if test ${gl_cv_func_strndup_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + + case $host_os in + aix | aix[3-6]*) gl_cv_func_strndup_works="guessing no";; + *) gl_cv_func_strndup_works="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include +int +main (void) +{ + +#if !HAVE_DECL_STRNDUP + extern + #ifdef __cplusplus + "C" + #endif + char *strndup (const char *, size_t); +#endif + int result; + char *s; + s = strndup ("some longer string", 15); + free (s); + s = strndup ("shorter string", 13); + result = s[13] != '\0'; + free (s); + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strndup_works=yes +else case e in @%:@( + e) gl_cv_func_strndup_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strndup_works" >&5 +printf "%s\n" "$gl_cv_func_strndup_works" >&6; } + case $gl_cv_func_strndup_works in + *no) REPLACE_STRNDUP=1 ;; + esac + else + HAVE_STRNDUP=0 + fi + + if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strndup.$ac_objext" + + fi + + + + + + GNULIB_STRNDUP=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STRNDUP 1" >>confdefs.h + + + + + + + + + + if test $ac_cv_have_decl_strnlen = no; then + HAVE_DECL_STRNLEN=0 + else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5 +printf %s "checking for working strnlen... " >&6; } +if test ${ac_cv_func_strnlen_working+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + # Guess no on AIX systems, yes otherwise. + case "$host_os" in + aix*) ac_cv_func_strnlen_working=no;; + *) ac_cv_func_strnlen_working=yes;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + +#define S "foobar" +#define S_LEN (sizeof S - 1) + + /* At least one implementation is buggy: that of AIX 4.3 would + give strnlen (S, 1) == 3. */ + + int i; + for (i = 0; i < S_LEN + 1; ++i) + { + int expected = i <= S_LEN ? i : S_LEN; + if (strnlen (S, i) != expected) + return 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_strnlen_working=yes +else case e in @%:@( + e) ac_cv_func_strnlen_working=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5 +printf "%s\n" "$ac_cv_func_strnlen_working" >&6; } +test $ac_cv_func_strnlen_working = no && : + + + if test $ac_cv_func_strnlen_working = no; then + REPLACE_STRNLEN=1 + fi + fi + + if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext" + + : + fi + + + + + + GNULIB_STRNLEN=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STRNLEN 1" >>confdefs.h + + + + + + + + if test $ac_cv_func_strptime != yes; then + HAVE_STRPTIME=0 + fi + + if test $HAVE_STRPTIME = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strptime.$ac_objext" + + + + : + + fi + + + + + + GNULIB_STRPTIME=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STRPTIME 1" >>confdefs.h + + + + + + + if test "$ac_cv_type_unsigned_long_long_int" = yes; then + ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull" +if test "x$ac_cv_func_strtoull" = xyes +then : + printf "%s\n" "@%:@define HAVE_STRTOULL 1" >>confdefs.h + +fi + + if test $ac_cv_func_strtoull = no; then + HAVE_STRTOULL=0 + fi + fi + + if test $HAVE_STRTOULL = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strtoull.$ac_objext" + + + : + + fi + + + + + + GNULIB_STRTOULL=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STRTOULL 1" >>confdefs.h + + + + + + + + + if test "$ac_cv_have_decl_strtoumax" = yes; then + if test "$ac_cv_func_strtoumax" != yes; then + # HP-UX 11.11 has "#define strtoimax(...) ..." but no function. + REPLACE_STRTOUMAX=1 + fi + else + HAVE_DECL_STRTOUMAX=0 + fi + + if test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strtoumax.$ac_objext" + + + ac_fn_check_decl "$LINENO" "strtoull" "ac_cv_have_decl_strtoull" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strtoull" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_STRTOULL $ac_have_decl" >>confdefs.h + + + + fi + + + + + + GNULIB_STRTOUMAX=1 + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_stat_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_stat_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/stat.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_stat_h + gl_cv_next_sys_stat_h='"'$gl_header'"' + else + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 +printf "%s\n" "$gl_cv_next_sys_stat_h" >&6; } + fi + NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/stat.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_stat_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive + + + + + + + + + WINDOWS_STAT_TIMESPEC=0 + + + + + + + + + ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include + #include +" +if test "x$ac_cv_type_nlink_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define nlink_t int" >>confdefs.h + ;; +esac +fi + + + + for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_wait_h='<'sys/wait.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_wait_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_wait_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/wait.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_wait_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_wait_h + gl_cv_next_sys_wait_h='"'$gl_header'"' + else + gl_cv_next_sys_wait_h='<'sys/wait.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_wait_h" >&5 +printf "%s\n" "$gl_cv_next_sys_wait_h" >&6; } + fi + NEXT_SYS_WAIT_H=$gl_cv_next_sys_wait_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/wait.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_wait_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H=$gl_next_as_first_directive + + + + + + + + + for gl_func in waitpid; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + : + + + + + + + + + + + + ac_fn_check_decl "$LINENO" "localtime_r" "ac_cv_have_decl_localtime_r" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_localtime_r" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_LOCALTIME_R $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_localtime_r = no; then + HAVE_DECL_LOCALTIME_R=0 + fi + + + if test $ac_cv_func_localtime_r = yes; then + HAVE_LOCALTIME_R=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5 +printf %s "checking whether localtime_r is compatible with its POSIX signature... " >&6; } +if test ${gl_cv_time_r_posix+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +/* We don't need to append 'restrict's to the argument types, + even though the POSIX signature has the 'restrict's, + since C99 says they can't affect type compatibility. */ + struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r; + if (ptr) return 0; + /* Check the return type is a pointer. + On HP-UX 10 it is 'int'. */ + *localtime_r (0, 0); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_time_r_posix=yes +else case e in @%:@( + e) gl_cv_time_r_posix=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5 +printf "%s\n" "$gl_cv_time_r_posix" >&6; } + if test $gl_cv_time_r_posix = yes; then + REPLACE_LOCALTIME_R=0 + else + REPLACE_LOCALTIME_R=1 + fi + else + HAVE_LOCALTIME_R=0 + fi + + if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext" + + + : + + fi + + + + + + GNULIB_TIME_R=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_TIME_R 1" >>confdefs.h + + + + + + + + + ac_fn_c_check_type "$LINENO" "timezone_t" "ac_cv_type_timezone_t" "#include +" +if test "x$ac_cv_type_timezone_t" = xyes +then : + +printf "%s\n" "@%:@define HAVE_TIMEZONE_T 1" >>confdefs.h + + +fi + + if test "$ac_cv_type_timezone_t" = yes; then + HAVE_TIMEZONE_T=1 + fi + + if test $HAVE_TIMEZONE_T = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS time_rz.$ac_objext" + + fi + + + + + + GNULIB_TIME_RZ=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_TIME_RZ 1" >>confdefs.h + + + + + + + REPLACE_TIMEGM=0 + + if test $ac_cv_func_timegm = yes; then + if test "$gl_cv_func_working_mktime" != yes; then + # Assume that timegm is buggy if mktime is. + REPLACE_TIMEGM=1 + fi + else + HAVE_TIMEGM=0 + fi + + if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS timegm.$ac_objext" + + + : + + fi + + + + + + GNULIB_TIMEGM=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_TIMEGM 1" >>confdefs.h + + + + : + + + + + + if test $ac_cv_func_tzset = no; then + HAVE_TZSET=0 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether tzset clobbers localtime buffer" >&5 +printf %s "checking whether tzset clobbers localtime buffer... " >&6; } +if test ${gl_cv_func_tzset_clobber+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess all is fine on glibc systems. + *-gnu*) gl_cv_func_tzset_clobber="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_tzset_clobber="guessing yes" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main () +{ + time_t t1 = 853958121; + struct tm *p, s; + putenv ("TZ=GMT0"); + p = localtime (&t1); + s = *p; + putenv ("TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"); + tzset (); + return (p->tm_year != s.tm_year + || p->tm_mon != s.tm_mon + || p->tm_mday != s.tm_mday + || p->tm_hour != s.tm_hour + || p->tm_min != s.tm_min + || p->tm_sec != s.tm_sec); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_tzset_clobber=no +else case e in @%:@( + e) gl_cv_func_tzset_clobber=yes ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_tzset_clobber" >&5 +printf "%s\n" "$gl_cv_func_tzset_clobber" >&6; } + + +printf "%s\n" "@%:@define HAVE_RUN_TZSET_TEST 1" >>confdefs.h + + + REPLACE_TZSET=0 + case "$gl_cv_func_tzset_clobber" in + *yes) + REPLACE_TZSET=1 + +printf "%s\n" "@%:@define TZSET_CLOBBERS_LOCALTIME 1" >>confdefs.h + + + + + NEED_LOCALTIME_BUFFER=1 + REPLACE_GMTIME=1 + REPLACE_LOCALTIME=1 + + ;; + esac + case "$host_os" in + mingw*) REPLACE_TZSET=1 ;; + esac + + if test $HAVE_TZSET = 0 || test $REPLACE_TZSET = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS tzset.$ac_objext" + + fi + + + + + + GNULIB_TZSET=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_TZSET 1" >>confdefs.h + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_unistd_h='<'unistd.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_unistd_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_unistd_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'unistd.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_unistd_h + gl_cv_next_unistd_h='"'$gl_header'"' + else + gl_cv_next_unistd_h='<'unistd.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5 +printf "%s\n" "$gl_cv_next_unistd_h" >&6; } + fi + NEXT_UNISTD_H=$gl_cv_next_unistd_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'unistd.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_unistd_h + fi + NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_unistd_h = yes; then + HAVE_UNISTD_H=1 + else + HAVE_UNISTD_H=0 + fi + + + + + + + + for gl_func in chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell endusershell group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite readlink readlinkat rmdir sethostname sleep symlink symlinkat truncate ttyname_r unlink unlinkat usleep; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if HAVE_UNISTD_H +# include +#endif +/* Some systems declare various items in the wrong headers. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include +# endif +#endif + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 + } + } + } + + + + + } + }; then + LIBUNISTRING_UNISTR_H='unistr.h' + else + LIBUNISTRING_UNISTR_H= + fi + + + + +printf "%s\n" "@%:@define GNULIB_UNISTR_U8_MBTOUCR 1" >>confdefs.h + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE= + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE='#' +else + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE='#' + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE= +fi + + + + +printf "%s\n" "@%:@define GNULIB_UNISTR_U8_UCTOMB 1" >>confdefs.h + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE= + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE='#' +else + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE='#' + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE= +fi + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 + } + } + } + + + + + } + }; then + LIBUNISTRING_UNITYPES_H='unitypes.h' + else + LIBUNISTRING_UNITYPES_H= + fi + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 + } + } + } + + + + + } + }; then + LIBUNISTRING_UNIWIDTH_H='uniwidth.h' + else + LIBUNISTRING_UNIWIDTH_H= + fi + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 6 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE= + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE='#' +else + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE='#' + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE= +fi + + + + +printf "%s\n" "@%:@define USE_UNLOCKED_IO 1" >>confdefs.h + + + + + + + + + + + + + + + + + + + + + + if test $ac_cv_have_decl_unsetenv = no; then + HAVE_DECL_UNSETENV=0 + fi + ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv" +if test "x$ac_cv_func_unsetenv" = xyes +then : + printf "%s\n" "@%:@define HAVE_UNSETENV 1" >>confdefs.h + +fi + + if test $ac_cv_func_unsetenv = no; then + HAVE_UNSETENV=0 + else + HAVE_UNSETENV=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5 +printf %s "checking for unsetenv() return type... " >&6; } +if test ${gt_cv_func_unsetenv_ret+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#undef _BSD +#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 */ +#include +extern +#ifdef __cplusplus +"C" +#endif +int unsetenv (const char *name); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_func_unsetenv_ret='int' +else case e in @%:@( + e) gt_cv_func_unsetenv_ret='void' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5 +printf "%s\n" "$gt_cv_func_unsetenv_ret" >&6; } + if test $gt_cv_func_unsetenv_ret = 'void'; then + +printf "%s\n" "@%:@define VOID_UNSETENV 1" >>confdefs.h + + REPLACE_UNSETENV=1 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5 +printf %s "checking whether unsetenv obeys POSIX... " >&6; } +if test ${gl_cv_func_unsetenv_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_unsetenv_works="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + extern char **environ; + +int +main (void) +{ + + char entry1[] = "a=1"; + char entry2[] = "b=2"; + char *env[] = { entry1, entry2, NULL }; + if (putenv ((char *) "a=1")) return 1; + if (putenv (entry2)) return 2; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 3; + if (!unsetenv ("") || errno != EINVAL) return 4; + entry2[0] = 'b'; + environ = env; + if (!getenv ("a")) return 5; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 6; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_unsetenv_works=yes +else case e in @%:@( + e) gl_cv_func_unsetenv_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5 +printf "%s\n" "$gl_cv_func_unsetenv_works" >&6; } + case "$gl_cv_func_unsetenv_works" in + *yes) ;; + *) + REPLACE_UNSETENV=1 + ;; + esac + fi + + if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext" + + + + + + fi + + + + + + GNULIB_UNSETENV=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_UNSETENV 1" >>confdefs.h + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for variable-length arrays" >&5 +printf %s "checking for variable-length arrays... " >&6; } +if test ${ac_cv_c_vararrays+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC_NO_VLA__ + defined + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "defined" >/dev/null 2>&1 +then : + ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined' +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test for VLA support. This test is partly inspired + from examples in the C standard. Use at least two VLA + functions to detect the GCC 3.4.3 bug described in: + http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html + */ + #ifdef __STDC_NO_VLA__ + syntax error; + #else + extern int n; + int B[100]; + int fvla (int m, int C[m][m]); + + int + simple (int count, int all[static count]) + { + return all[count - 1]; + } + + int + fvla (int m, int C[m][m]) + { + typedef int VLA[m][m]; + VLA x; + int D[m]; + static int (*q)[m] = &B; + int (*s)[n] = q; + return C && &x[0][0] == &D[0] && &D[0] == s[0]; + } + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_vararrays=yes +else case e in @%:@( + e) ac_cv_c_vararrays=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -rf conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_vararrays" >&5 +printf "%s\n" "$ac_cv_c_vararrays" >&6; } + if test "$ac_cv_c_vararrays" = yes; then + +printf "%s\n" "@%:@define HAVE_C_VARARRAYS 1" >>confdefs.h + + elif test "$ac_cv_c_vararrays" = no; then + +printf "%s\n" "@%:@define __STDC_NO_VLA__ 1" >>confdefs.h + + fi + + + + if test $ac_cv_func_vasnprintf = no; then + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + + if test $ac_cv_func_vasnprintf = yes; then + +printf "%s\n" "@%:@define REPLACE_VASNPRINTF 1" >>confdefs.h + + fi + + + + + + + + + + + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define ptrdiff_t long" >>confdefs.h + + ;; +esac +fi + + + + + + + + fi + + + ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf" +if test "x$ac_cv_func_vasprintf" = xyes +then : + printf "%s\n" "@%:@define HAVE_VASPRINTF 1" >>confdefs.h + +fi + + if test $ac_cv_func_vasprintf = no; then + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asprintf.$ac_objext" + + + if test $ac_cv_func_vasprintf = yes; then + REPLACE_VASPRINTF=1 + else + HAVE_VASPRINTF=0 + fi + + + + + + + + + fi + + + + + + + GNULIB_VASPRINTF=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_VASPRINTF 1" >>confdefs.h + + + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=asprintf:2:c-format" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=vasprintf:2:c-format" + + +@%:@ Check whether --with-packager was given. +if test ${with_packager+y} +then : + withval=$with_packager; case $withval in + yes|no) ;; + *) +printf "%s\n" "@%:@define PACKAGE_PACKAGER \"$withval\"" >>confdefs.h + ;; + esac + +fi + + + +@%:@ Check whether --with-packager-version was given. +if test ${with_packager_version+y} +then : + withval=$with_packager_version; case $withval in + yes|no) ;; + *) +printf "%s\n" "@%:@define PACKAGE_PACKAGER_VERSION \"$withval\"" >>confdefs.h + ;; + esac + +fi + + + +@%:@ Check whether --with-packager-bug-reports was given. +if test ${with_packager_bug_reports+y} +then : + withval=$with_packager_bug_reports; case $withval in + yes|no) ;; + *) +printf "%s\n" "@%:@define PACKAGE_PACKAGER_BUG_REPORTS \"$withval\"" >>confdefs.h + ;; + esac + +fi + + + if test "X$with_packager" = "X" && \ + test "X$with_packager_version$with_packager_bug_reports" != "X" + then + as_fn_error $? "The --with-packager-{bug-reports,version} options require --with-packager" "$LINENO" 5 + fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wchar_h='<'wchar.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_wchar_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_wchar_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wchar.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wchar_h + gl_cv_next_wchar_h='"'$gl_header'"' + else + gl_cv_next_wchar_h='<'wchar.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5 +printf "%s\n" "$gl_cv_next_wchar_h" >&6; } + fi + NEXT_WCHAR_H=$gl_cv_next_wchar_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'wchar.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_wchar_h + fi + NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + + + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + + + + for gl_func in btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime ; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +#endif +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_incomplete_state=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_sanitycheck=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_wcrtomb = no; then + HAVE_WCRTOMB=0 + ac_fn_check_decl "$LINENO" "wcrtomb" "ac_cv_have_decl_wcrtomb" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_wcrtomb" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_WCRTOMB $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_wcrtomb = yes; then + REPLACE_WCRTOMB=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_WCRTOMB=1 + else + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wcrtomb return value is correct" >&5 +printf %s "checking whether wcrtomb return value is correct... " >&6; } +if test ${gl_cv_func_wcrtomb_retval+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on AIX 4, OSF/1 and Solaris. + aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wcrtomb_retval="guessing yes" ;; + esac + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + int result = 0; + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 1; + } + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 2; + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 4; + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 8; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_wcrtomb_retval=yes +else case e in @%:@( + e) gl_cv_func_wcrtomb_retval=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcrtomb_retval" >&5 +printf "%s\n" "$gl_cv_func_wcrtomb_retval" >&6; } + case "$gl_cv_func_wcrtomb_retval" in + *yes) ;; + *) REPLACE_WCRTOMB=1 ;; + esac + fi + fi + + if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS wcrtomb.$ac_objext" + + + : + + fi + + + + + + GNULIB_WCRTOMB=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_WCRTOMB 1" >>confdefs.h + + + + + + + + + if test $ac_cv_func_iswcntrl = yes; then + HAVE_ISWCNTRL=1 + else + HAVE_ISWCNTRL=0 + fi + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wctype_h='<'wctype.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_wctype_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_wctype_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wctype_h + gl_cv_next_wctype_h='"'$gl_header'"' + else + gl_cv_next_wctype_h='<'wctype.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 +printf "%s\n" "$gl_cv_next_wctype_h" >&6; } + fi + NEXT_WCTYPE_H=$gl_cv_next_wctype_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'wctype.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_wctype_h + fi + NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_wctype_h = yes; then + if test $ac_cv_func_iswcntrl = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 +printf %s "checking whether iswcntrl works... " >&6; } +if test ${gl_cv_func_iswcntrl_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #if __GNU_LIBRARY__ == 1 + Linux libc5 i18n is broken. + #endif +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_iswcntrl_works="guessing yes" +else case e in @%:@( + e) gl_cv_func_iswcntrl_works="guessing no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + int main () { return iswprint ('x') == 0; } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_iswcntrl_works=yes +else case e in @%:@( + e) gl_cv_func_iswcntrl_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 +printf "%s\n" "$gl_cv_func_iswcntrl_works" >&6; } + fi + HAVE_WCTYPE_H=1 + else + HAVE_WCTYPE_H=0 + fi + + + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + fi + + if test $REPLACE_ISWCNTRL = 1; then + REPLACE_TOWLOWER=1 + else + ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" +if test "x$ac_cv_func_towlower" = xyes +then : + printf "%s\n" "@%:@define HAVE_TOWLOWER 1" >>confdefs.h + +fi + + if test $ac_cv_func_towlower = yes; then + REPLACE_TOWLOWER=0 + else + ac_fn_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_towlower" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_TOWLOWER $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_towlower = yes; then + REPLACE_TOWLOWER=1 + else + REPLACE_TOWLOWER=0 + fi + fi + fi + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then + : + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 +printf %s "checking for wctype_t... " >&6; } +if test ${gl_cv_type_wctype_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + wctype_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctype_t=yes +else case e in @%:@( + e) gl_cv_type_wctype_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 +printf "%s\n" "$gl_cv_type_wctype_t" >&6; } + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 +printf %s "checking for wctrans_t... " >&6; } +if test ${gl_cv_type_wctrans_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + wctrans_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctrans_t=yes +else case e in @%:@( + e) gl_cv_type_wctrans_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 +printf "%s\n" "$gl_cv_type_wctrans_t" >&6; } + if test $gl_cv_type_wctrans_t = no; then + HAVE_WCTRANS_T=0 + fi + + + for gl_func in wctype iswctype wctrans towctrans ; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +# include +#endif +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + ac_fn_check_decl "$LINENO" "wcwidth" "ac_cv_have_decl_wcwidth" " +/* AIX 3.2.5 declares wcwidth in . */ +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_wcwidth" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_WCWIDTH $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_wcwidth != yes; then + HAVE_DECL_WCWIDTH=0 + fi + + if test $ac_cv_func_wcwidth = yes; then + HAVE_WCWIDTH=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wcwidth works reasonably in UTF-8 locales" >&5 +printf %s "checking whether wcwidth works reasonably in UTF-8 locales... " >&6; } +if test ${gl_cv_func_wcwidth_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc and AIX 7 systems. + *-gnu* | aix[7-9]*) gl_cv_func_wcwidth_works="guessing yes";; + *) gl_cv_func_wcwidth_works="guessing no";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +/* AIX 3.2.5 declares wcwidth in . */ +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include +#if !HAVE_DECL_WCWIDTH +extern +# ifdef __cplusplus +"C" +# endif +int wcwidth (int); +#endif +int main () +{ + int result = 0; + if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL) + { + if (wcwidth (0x0301) > 0) + result |= 1; + if (wcwidth (0x05B0) > 0) + result |= 2; + if (wcwidth (0x200B) > 0) + result |= 4; + if (wcwidth (0xFF1A) == 0) + result |= 8; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_wcwidth_works=yes +else case e in @%:@( + e) gl_cv_func_wcwidth_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcwidth_works" >&5 +printf "%s\n" "$gl_cv_func_wcwidth_works" >&6; } + case "$gl_cv_func_wcwidth_works" in + *yes) ;; + *no) REPLACE_WCWIDTH=1 ;; + esac + else + HAVE_WCWIDTH=0 + fi + + if test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS wcwidth.$ac_objext" + + fi + + + + + + GNULIB_WCWIDTH=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_WCWIDTH 1" >>confdefs.h + + + + : + + + ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_STDINT_H 1" >>confdefs.h + +fi + + + + + : + + + + : + + : + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xasprintf:1:c-format" + + # End of code from modules + + + + + + + + + + gltests_libdeps= + gltests_ltlibdeps= + + + + + + + + + + gl_source_base='gnulib-tests' + gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS + + gl_module_indicator_condition=$gltests_WITNESS + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS accept.$ac_objext" + + fi + + + + + + if test "$GNULIB_ACCEPT" != 1; then + if test "$GNULIB_ACCEPT" = 0; then + GNULIB_ACCEPT=$gl_module_indicator_condition + else + GNULIB_ACCEPT="($GNULIB_ACCEPT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_ACCEPT 1" >>confdefs.h + + + + + + + + if test $ac_cv_header_arpa_inet_h = yes; then + HAVE_ARPA_INET_H=1 + else + HAVE_ARPA_INET_H=0 + fi + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_arpa_inet_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_arpa_inet_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'arpa/inet.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_arpa_inet_h + gl_cv_next_arpa_inet_h='"'$gl_header'"' + else + gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5 +printf "%s\n" "$gl_cv_next_arpa_inet_h" >&6; } + fi + NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'arpa/inet.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_arpa_inet_h + fi + NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive + + + + + + + + + for gl_func in inet_ntop inet_pton; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* On some systems, this header is not self-consistent. */ +#if !(defined __GLIBC__ || defined __UCLIBC__) +# include +#endif +#ifdef __TANDEM +# include +#endif +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS bind.$ac_objext" + + fi + + + + + + if test "$GNULIB_BIND" != 1; then + if test "$GNULIB_BIND" = 0; then + GNULIB_BIND=$gl_module_indicator_condition + else + GNULIB_BIND="($GNULIB_BIND || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_BIND 1" >>confdefs.h + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5 +printf %s "checking for a turkish Unicode locale... " >&6; } +if test ${gt_cv_locale_tr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. But BeOS does not + implement the Turkish upper-/lowercase mappings. Therefore, let this + program return 1 on BeOS. */ + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the eighth month, the second + character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f) + return 1; + /* Check whether the upper-/lowercase mappings are as expected for + Turkish. */ + if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i' + || towupper(0x0131) != 'I' || towlower ('I') != 0x0131) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=Turkish_Turkey.65001 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr.UTF-8 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + fi + fi + ;; + esac + else + gt_cv_locale_tr_utf8=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_tr_utf8" >&6; } + LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8 + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS connect.$ac_objext" + + fi + + + + + + if test "$GNULIB_CONNECT" != 1; then + if test "$GNULIB_CONNECT" = 0; then + GNULIB_CONNECT=$gl_module_indicator_condition + else + GNULIB_CONNECT="($GNULIB_CONNECT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_CONNECT 1" >>confdefs.h + + + + + + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_FDOPEN=1 + fi + + if test $REPLACE_FDOPEN = 0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fdopen sets errno" >&5 +printf %s "checking whether fdopen sets errno... " >&6; } +if test ${gl_cv_func_fdopen_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + case "$host_os" in + mingw*) gl_cv_func_fdopen_works="guessing no" ;; + *) gl_cv_func_fdopen_works="guessing yes" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +int +main (void) +{ + FILE *fp; + errno = 0; + fp = fdopen (-1, "r"); + if (fp == NULL && errno == 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_fdopen_works=yes +else case e in @%:@( + e) gl_cv_func_fdopen_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopen_works" >&5 +printf "%s\n" "$gl_cv_func_fdopen_works" >&6; } + case "$gl_cv_func_fdopen_works" in + *no) REPLACE_FDOPEN=1 ;; + esac + fi + + if test $REPLACE_FDOPEN = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS fdopen.$ac_objext" + + + fi + + + + + + if test "$GNULIB_FDOPEN" != 1; then + if test "$GNULIB_FDOPEN" = 0; then + GNULIB_FDOPEN=$gl_module_indicator_condition + else + GNULIB_FDOPEN="($GNULIB_FDOPEN || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_FDOPEN 1" >>confdefs.h + + + + + + + if test $ac_cv_func_ftruncate = yes; then + + + case "$host_os" in + mingw*) + REPLACE_FTRUNCATE=1 + ;; + esac + + else + HAVE_FTRUNCATE=0 + fi + + if test $HAVE_FTRUNCATE = 0 || test $REPLACE_FTRUNCATE = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS ftruncate.$ac_objext" + + + ac_fn_c_check_func "$LINENO" "chsize" "ac_cv_func_chsize" +if test "x$ac_cv_func_chsize" = xyes +then : + printf "%s\n" "@%:@define HAVE_CHSIZE 1" >>confdefs.h + +fi + + + fi + + + + + + if test "$GNULIB_FTRUNCATE" != 1; then + if test "$GNULIB_FTRUNCATE" = 0; then + GNULIB_FTRUNCATE=$gl_module_indicator_condition + else + GNULIB_FTRUNCATE="($GNULIB_FTRUNCATE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_FTRUNCATE 1" >>confdefs.h + + + + + + + + + case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in + *yes,yes) ;; + *) + REPLACE_GETCWD=1 + ;; + esac + + if test $REPLACE_GETCWD = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS getcwd-lgpl.$ac_objext" + + fi + + + + + + if test "$GNULIB_GETCWD" != 1; then + if test "$GNULIB_GETCWD" = 0; then + GNULIB_GETCWD=$gl_module_indicator_condition + else + GNULIB_GETCWD="($GNULIB_GETCWD || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_GETCWD 1" >>confdefs.h + + + + + + + ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = xyes +then : + printf "%s\n" "@%:@define HAVE_GETPAGESIZE 1" >>confdefs.h + +fi + + if test $ac_cv_func_getpagesize = no; then + HAVE_GETPAGESIZE=0 + ac_fn_c_check_header_compile "$LINENO" "OS.h" "ac_cv_header_OS_h" "$ac_includes_default" +if test "x$ac_cv_header_OS_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_OS_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_OS_h = yes; then + HAVE_OS_H=1 + fi + ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_SYS_PARAM_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_sys_param_h = yes; then + HAVE_SYS_PARAM_H=1 + fi + fi + case "$host_os" in + mingw*) + REPLACE_GETPAGESIZE=1 + ;; + esac + ac_fn_check_decl "$LINENO" "getpagesize" "ac_cv_have_decl_getpagesize" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getpagesize" = xyes +then : + +else case e in @%:@( + e) HAVE_DECL_GETPAGESIZE=0 ;; +esac +fi + + if test $REPLACE_GETPAGESIZE = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS getpagesize.$ac_objext" + + fi + + + + + + if test "$GNULIB_GETPAGESIZE" != 1; then + if test "$GNULIB_GETPAGESIZE" = 0; then + GNULIB_GETPAGESIZE=$gl_module_indicator_condition + else + GNULIB_GETPAGESIZE="($GNULIB_GETPAGESIZE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_GETPAGESIZE 1" >>confdefs.h + + + + + + + + + + + HAVE_INET_PTON=1 + INET_PTON_LIB= + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + if test $HAVE_WINSOCK2_H = 1; then + ac_fn_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_inet_pton" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_INET_PTON $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_inet_pton = yes; then + REPLACE_INET_PTON=1 + INET_PTON_LIB="-lws2_32" + else + HAVE_DECL_INET_PTON=0 + HAVE_INET_PTON=0 + fi + else + gl_save_LIBS=$LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing inet_pton" >&5 +printf %s "checking for library containing inet_pton... " >&6; } +if test ${ac_cv_search_inet_pton+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char inet_pton (void); +int +main (void) +{ +return inet_pton (); + ; + return 0; +} +_ACEOF +for ac_lib in '' nsl resolv +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_inet_pton=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_inet_pton+y} +then : + break +fi +done +if test ${ac_cv_search_inet_pton+y} +then : + +else case e in @%:@( + e) ac_cv_search_inet_pton=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_pton" >&5 +printf "%s\n" "$ac_cv_search_inet_pton" >&6; } +ac_res=$ac_cv_search_inet_pton +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else case e in @%:@( + e) ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton" +if test "x$ac_cv_func_inet_pton" = xyes +then : + printf "%s\n" "@%:@define HAVE_INET_PTON 1" >>confdefs.h + +fi + + if test $ac_cv_func_inet_pton = no; then + HAVE_INET_PTON=0 + fi + ;; +esac +fi + + LIBS=$gl_save_LIBS + + if test "$ac_cv_search_inet_pton" != "no" \ + && test "$ac_cv_search_inet_pton" != "none required"; then + INET_PTON_LIB="$ac_cv_search_inet_pton" + fi + + + ac_fn_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include + #if HAVE_NETDB_H + # include + #endif + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_inet_pton" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_INET_PTON $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_inet_pton = no; then + HAVE_DECL_INET_PTON=0 + fi + fi + + + if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS inet_pton.$ac_objext" + + + + + fi + + + + + + if test "$GNULIB_INET_PTON" != 1; then + if test "$GNULIB_INET_PTON" = 0; then + GNULIB_INET_PTON=$gl_module_indicator_condition + else + GNULIB_INET_PTON="($GNULIB_INET_PTON || $gl_module_indicator_condition)" + fi + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in @%:@( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in @%:@( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes +then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +unsigned short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + unsigned short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + unsigned short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + unsigned short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else case e in @%:@( + e) ac_cv_c_bigendian=yes ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + printf "%s\n" "@%:@define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +printf "%s\n" "@%:@define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + + + + HAVE_IOCTL=1 + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_IOCTL=0 + else + ac_fn_c_check_func "$LINENO" "ioctl" "ac_cv_func_ioctl" +if test "x$ac_cv_func_ioctl" = xyes +then : + printf "%s\n" "@%:@define HAVE_IOCTL 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ioctl with POSIX signature" >&5 +printf %s "checking for ioctl with POSIX signature... " >&6; } +if test ${gl_cv_func_ioctl_posix_signature+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +extern + #ifdef __cplusplus + "C" + #endif + int ioctl (int, int, ...); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_ioctl_posix_signature=yes +else case e in @%:@( + e) gl_cv_func_ioctl_posix_signature=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ioctl_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_ioctl_posix_signature" >&6; } + if test $gl_cv_func_ioctl_posix_signature != yes; then + REPLACE_IOCTL=1 + fi + fi + + if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS ioctl.$ac_objext" + + fi + + + + + + if test "$GNULIB_IOCTL" != 1; then + if test "$GNULIB_IOCTL" = 0; then + GNULIB_IOCTL=$gl_module_indicator_condition + else + GNULIB_IOCTL="($GNULIB_IOCTL || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_IOCTL 1" >>confdefs.h + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS listen.$ac_objext" + + fi + + + + + + if test "$GNULIB_LISTEN" != 1; then + if test "$GNULIB_LISTEN" = 0; then + GNULIB_LISTEN=$gl_module_indicator_condition + else + GNULIB_LISTEN="($GNULIB_LISTEN || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_LISTEN 1" >>confdefs.h + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5 +printf %s "checking for a turkish Unicode locale... " >&6; } +if test ${gt_cv_locale_tr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. But BeOS does not + implement the Turkish upper-/lowercase mappings. Therefore, let this + program return 1 on BeOS. */ + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the eighth month, the second + character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f) + return 1; + /* Check whether the upper-/lowercase mappings are as expected for + Turkish. */ + if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i' + || towupper(0x0131) != 'I' || towlower ('I') != 0x0131) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=Turkish_Turkey.65001 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr.UTF-8 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + fi + fi + ;; + esac + else + gt_cv_locale_tr_utf8=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_tr_utf8" >&6; } + LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8 + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in @%:@( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "@%:@define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "@%:@define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + + + + + + nanosleep_save_libs=$LIBS + + # Solaris 2.5.1 needs -lposix4 to get the nanosleep function. + # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. + LIB_NANOSLEEP= + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5 +printf %s "checking for library containing nanosleep... " >&6; } +if test ${ac_cv_search_nanosleep+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char nanosleep (void); +int +main (void) +{ +return nanosleep (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt posix4 +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_nanosleep=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_nanosleep+y} +then : + break +fi +done +if test ${ac_cv_search_nanosleep+y} +then : + +else case e in @%:@( + e) ac_cv_search_nanosleep=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5 +printf "%s\n" "$ac_cv_search_nanosleep" >&6; } +ac_res=$ac_cv_search_nanosleep +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ac_cv_search_nanosleep" = "none required" || + LIB_NANOSLEEP=$ac_cv_search_nanosleep +fi + + if test "x$ac_cv_search_nanosleep" != xno; then + + + if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple Mac OS X platforms. + # The test result would be 'no (mishandles large arguments)' in 64-bit + # mode but 'yes' in 32-bit mode. But we need a configuration result that + # is valid in both modes. + gl_cv_func_nanosleep='no (mishandles large arguments)' + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working nanosleep" >&5 +printf %s "checking for working nanosleep... " >&6; } +if test ${gl_cv_func_nanosleep+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + case "$host_os" in linux*) # Guess it halfway works when the kernel is Linux. + gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;; + *) # If we don't know, assume the worst. + gl_cv_func_nanosleep='guessing no' ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + #if HAVE_SYS_TIME_H + #include + #endif + #include + #include + #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) + #define TYPE_MAXIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) + + static void + check_for_SIGALRM (int sig) + { + if (sig != SIGALRM) + _exit (1); + } + + int + main () + { + static struct timespec ts_sleep; + static struct timespec ts_remaining; + static struct sigaction act; + /* Test for major problems first. */ + if (! nanosleep) + return 2; + act.sa_handler = check_for_SIGALRM; + sigemptyset (&act.sa_mask); + sigaction (SIGALRM, &act, NULL); + ts_sleep.tv_sec = 0; + ts_sleep.tv_nsec = 1; + alarm (1); + if (nanosleep (&ts_sleep, NULL) != 0) + return 3; + /* Test for a minor problem: the handling of large arguments. */ + ts_sleep.tv_sec = TYPE_MAXIMUM (time_t); + ts_sleep.tv_nsec = 999999999; + alarm (1); + if (nanosleep (&ts_sleep, &ts_remaining) != -1) + return 4; + if (errno != EINTR) + return 5; + if (ts_remaining.tv_sec <= TYPE_MAXIMUM (time_t) - 10) + return 6; + return 0; + } +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_nanosleep=yes +else case e in @%:@( + e) case $? in 4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)';; *) gl_cv_func_nanosleep=no;; + esac ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nanosleep" >&5 +printf "%s\n" "$gl_cv_func_nanosleep" >&6; } + case "$gl_cv_func_nanosleep" in + *yes) + REPLACE_NANOSLEEP=0 + ;; + *) + REPLACE_NANOSLEEP=1 + case "$gl_cv_func_nanosleep" in + *"mishandles large arguments"*) + +printf "%s\n" "@%:@define HAVE_BUG_BIG_NANOSLEEP 1" >>confdefs.h + + ;; + *) + # The replacement uses select(). Add $LIBSOCKET to $LIB_NANOSLEEP. + for ac_lib in $LIBSOCKET; do + case " $LIB_NANOSLEEP " in + *" $ac_lib "*) ;; + *) LIB_NANOSLEEP="$LIB_NANOSLEEP $ac_lib";; + esac + done + ;; + esac + ;; + esac + else + HAVE_NANOSLEEP=0 + fi + LIBS=$nanosleep_save_libs + + if test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS nanosleep.$ac_objext" + + + + : + + fi + + + + + + if test "$GNULIB_NANOSLEEP" != 1; then + if test "$GNULIB_NANOSLEEP" = 0; then + GNULIB_NANOSLEEP=$gl_module_indicator_condition + else + GNULIB_NANOSLEEP="($GNULIB_NANOSLEEP || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_NANOSLEEP 1" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether is self-contained" >&5 +printf %s "checking whether is self-contained... " >&6; } +if test ${gl_cv_header_netinet_in_h_selfcontained+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_netinet_in_h_selfcontained=yes +else case e in @%:@( + e) gl_cv_header_netinet_in_h_selfcontained=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5 +printf "%s\n" "$gl_cv_header_netinet_in_h_selfcontained" >&6; } + if test $gl_cv_header_netinet_in_h_selfcontained = yes; then + NETINET_IN_H='' + else + NETINET_IN_H='netinet/in.h' + ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_NETINET_IN_H 1" >>confdefs.h + +fi + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_netinet_in_h='<'netinet/in.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_netinet_in_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_netinet_in_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'netinet/in.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_netinet_in_h + gl_cv_next_netinet_in_h='"'$gl_header'"' + else + gl_cv_next_netinet_in_h='<'netinet/in.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5 +printf "%s\n" "$gl_cv_next_netinet_in_h" >&6; } + fi + NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'netinet/in.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_netinet_in_h + fi + NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_netinet_in_h = yes; then + HAVE_NETINET_IN_H=1 + else + HAVE_NETINET_IN_H=0 + fi + + fi + + if test -n "$NETINET_IN_H"; then + GL_GENERATE_NETINET_IN_H_TRUE= + GL_GENERATE_NETINET_IN_H_FALSE='#' +else + GL_GENERATE_NETINET_IN_H_TRUE='#' + GL_GENERATE_NETINET_IN_H_FALSE= +fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + + + if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then + REPLACE_PERROR=1 + fi + case ${gl_cv_func_strerror_r_works-unset} in + unset|*yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether perror matches strerror" >&5 +printf %s "checking whether perror matches strerror... " >&6; } +if test ${gl_cv_func_perror_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_perror_works="guessing no" + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + #include + +int +main (void) +{ +char *str = strerror (-1); + if (!getenv("CONFTEST_OUTPUT")) return 0; + if (!str) str = ""; + puts (str); + errno = -1; + perror (""); + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + if CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2 \ + && cmp conftest.txt1 conftest.txt2 >/dev/null; then + gl_cv_func_perror_works=yes + else + gl_cv_func_perror_works=no + fi + rm -rf conftest.txt1 conftest.txt2 +else case e in @%:@( + e) gl_cv_func_perror_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_perror_works" >&5 +printf "%s\n" "$gl_cv_func_perror_works" >&6; } + if test "$gl_cv_func_perror_works" != yes; then + REPLACE_PERROR=1 + fi + ;; + *) + REPLACE_PERROR=1 + ;; + esac + + if test $REPLACE_PERROR = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS perror.$ac_objext" + + fi + + + + + + if test "$GNULIB_PERROR" != 1; then + if test "$GNULIB_PERROR" = 0; then + GNULIB_PERROR=$gl_module_indicator_condition + else + GNULIB_PERROR="($GNULIB_PERROR || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_PERROR 1" >>confdefs.h + + + + + + + + if test $ac_cv_func_pipe != yes; then + HAVE_PIPE=0 + fi + + if test $HAVE_PIPE = 0; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS pipe.$ac_objext" + + fi + + + + + + if test "$GNULIB_PIPE" != 1; then + if test "$GNULIB_PIPE" = 0; then + GNULIB_PIPE=$gl_module_indicator_condition + else + GNULIB_PIPE="($GNULIB_PIPE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_PIPE 1" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for putenv compatible with GNU and SVID" >&5 +printf %s "checking for putenv compatible with GNU and SVID... " >&6; } +if test ${gl_cv_func_svid_putenv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_svid_putenv="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Put it in env. */ + if (putenv ("CONFTEST_putenv=val")) + return 1; + + /* Try to remove it. */ + if (putenv ("CONFTEST_putenv")) + return 2; + + /* Make sure it was deleted. */ + if (getenv ("CONFTEST_putenv") != 0) + return 3; + + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_svid_putenv=yes +else case e in @%:@( + e) gl_cv_func_svid_putenv=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_svid_putenv" >&5 +printf "%s\n" "$gl_cv_func_svid_putenv" >&6; } + case "$gl_cv_func_svid_putenv" in + *yes) ;; + *) + REPLACE_PUTENV=1 + ;; + esac + + if test $REPLACE_PUTENV = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS putenv.$ac_objext" + + + ac_fn_check_decl "$LINENO" "_putenv" "ac_cv_have_decl__putenv" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl__putenv" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL__PUTENV $ac_have_decl" >>confdefs.h + + + fi + + + + + + if test "$GNULIB_PUTENV" != 1; then + if test "$GNULIB_PUTENV" = 0; then + GNULIB_PUTENV=$gl_module_indicator_condition + else + GNULIB_PUTENV="($GNULIB_PUTENV || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_PUTENV 1" >>confdefs.h + + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in @%:@( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "@%:@define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "@%:@define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in @%:@( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "@%:@define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "@%:@define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + REPLACE_SELECT=1 + else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select supports a 0 argument" >&5 +printf %s "checking whether select supports a 0 argument... " >&6; } +if test ${gl_cv_func_select_supports0+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on Interix. + interix*) gl_cv_func_select_supports0="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_select_supports0="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_SYS_SELECT_H +#include +#endif +int main () +{ + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_supports0=yes +else case e in @%:@( + e) gl_cv_func_select_supports0=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_supports0" >&5 +printf "%s\n" "$gl_cv_func_select_supports0" >&6; } + case "$gl_cv_func_select_supports0" in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select detects invalid fds" >&5 +printf %s "checking whether select detects invalid fds... " >&6; } +if test ${gl_cv_func_select_detects_ebadf+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_select_detects_ebadf="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_SYS_SELECT_H +# include +#endif +#include +#include + +int +main (void) +{ + + fd_set set; + dup2(0, 16); + FD_ZERO(&set); + FD_SET(16, &set); + close(16); + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_detects_ebadf=yes +else case e in @%:@( + e) gl_cv_func_select_detects_ebadf=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_detects_ebadf" >&5 +printf "%s\n" "$gl_cv_func_select_detects_ebadf" >&6; } + case $gl_cv_func_select_detects_ebadf in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + fi + + LIB_SELECT="$LIBSOCKET" + if test $REPLACE_SELECT = 1; then + case "$host_os" in + mingw*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define WIN32_LEAN_AND_MEAN +#include +int +main () +{ + MsgWaitForMultipleObjects (0, NULL, 0, 0, 0); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in @%:@( + e) LIB_SELECT="$LIB_SELECT -luser32" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ;; + esac + fi + + + if test $REPLACE_SELECT = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS select.$ac_objext" + + fi + + + + + + if test "$GNULIB_SELECT" != 1; then + if test "$GNULIB_SELECT" = 0; then + GNULIB_SELECT=$gl_module_indicator_condition + else + GNULIB_SELECT="($GNULIB_SELECT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SELECT 1" >>confdefs.h + + + + + + + + case "$host_os" in + mingw*) REPLACE_SETLOCALE=1 ;; + cygwin*) + case `uname -r` in + 1.5.*) REPLACE_SETLOCALE=1 ;; + esac + ;; + esac + + if test $REPLACE_SETLOCALE = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS setlocale.$ac_objext" + + + : + + fi + + + + + + if test "$GNULIB_SETLOCALE" != 1; then + if test "$GNULIB_SETLOCALE" = 0; then + GNULIB_SETLOCALE=$gl_module_indicator_condition + else + GNULIB_SETLOCALE="($GNULIB_SETLOCALE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SETLOCALE 1" >>confdefs.h + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS setsockopt.$ac_objext" + + fi + + + + + + if test "$GNULIB_SETSOCKOPT" != 1; then + if test "$GNULIB_SETSOCKOPT" = 0; then + GNULIB_SETSOCKOPT=$gl_module_indicator_condition + else + GNULIB_SETSOCKOPT="($GNULIB_SETSOCKOPT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SETSOCKOPT 1" >>confdefs.h + + + + + + ac_fn_check_decl "$LINENO" "sleep" "ac_cv_have_decl_sleep" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_sleep" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_SLEEP $ac_have_decl" >>confdefs.h + + + if test $ac_cv_have_decl_sleep != yes; then + HAVE_SLEEP=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working sleep" >&5 +printf %s "checking for working sleep... " >&6; } +if test ${gl_cv_func_sleep_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_sleep_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_sleep_works="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +static void +handle_alarm (int sig) +{ + if (sig != SIGALRM) + _exit (2); +} + +int +main (void) +{ + + /* Failure to compile this test due to missing alarm is okay, + since all such platforms (mingw) also lack sleep. */ + unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days. */ + unsigned int remaining; + signal (SIGALRM, handle_alarm); + alarm (1); + remaining = sleep (pentecost); + if (remaining > pentecost) + return 3; + if (remaining <= pentecost - 10) + return 4; + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_sleep_works=yes +else case e in @%:@( + e) gl_cv_func_sleep_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_sleep_works" >&5 +printf "%s\n" "$gl_cv_func_sleep_works" >&6; } + case "$gl_cv_func_sleep_works" in + *yes) ;; + *) + REPLACE_SLEEP=1 + ;; + esac + fi + + if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS sleep.$ac_objext" + + fi + + + + + + if test "$GNULIB_SLEEP" != 1; then + if test "$GNULIB_SLEEP" = 0; then + GNULIB_SLEEP=$gl_module_indicator_condition + else + GNULIB_SLEEP="($GNULIB_SLEEP || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SLEEP 1" >>confdefs.h + + + + + + + gl_cv_func_snprintf_usable=no + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "@%:@define HAVE_SNPRINTF 1" >>confdefs.h + +fi + + if test $ac_cv_func_snprintf = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5 +printf %s "checking whether snprintf respects a size of 1... " >&6; } +if test ${gl_cv_func_snprintf_size1+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + gl_cv_func_snprintf_size1="guessing yes" +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + my_snprintf (buf, 1, "%d", 12345); + return buf[1] != 'E'; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_snprintf_size1=yes +else case e in @%:@( + e) gl_cv_func_snprintf_size1=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_size1" >&5 +printf "%s\n" "$gl_cv_func_snprintf_size1" >&6; } + + case "$gl_cv_func_snprintf_size1" in + *yes) + + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5 +printf %s "checking whether printf supports POSIX/XSI format strings with positions... " >&6; } +if test ${gl_cv_func_printf_positions+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) + gl_cv_func_printf_positions="guessing no";; + beos*) gl_cv_func_printf_positions="guessing no";; + mingw* | pw*) gl_cv_func_printf_positions="guessing no";; + *) gl_cv_func_printf_positions="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* The string "%2$d %1$d", with dollar characters protected from the shell's + dollar expansion (possibly an autoconf bug). */ +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; +static char buf[100]; +int main () +{ + sprintf (buf, format, 33, 55); + return (strcmp (buf, "55 33") != 0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_printf_positions=yes +else case e in @%:@( + e) gl_cv_func_printf_positions=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_positions" >&5 +printf "%s\n" "$gl_cv_func_printf_positions" >&6; } + + case "$gl_cv_func_printf_positions" in + *yes) + gl_cv_func_snprintf_usable=yes + ;; + esac + ;; + esac + ;; + esac + fi + if test $gl_cv_func_snprintf_usable = no; then + + + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS snprintf.$ac_objext" + + if test $ac_cv_func_snprintf = yes; then + REPLACE_SNPRINTF=1 + else + + if test $ac_cv_have_decl_snprintf = yes; then + REPLACE_SNPRINTF=1 + fi + fi + : + + fi + + if test $ac_cv_have_decl_snprintf = no; then + HAVE_DECL_SNPRINTF=0 + fi + + + + + + + if test "$GNULIB_SNPRINTF" != 1; then + if test "$GNULIB_SNPRINTF" = 0; then + GNULIB_SNPRINTF=$gl_module_indicator_condition + else + GNULIB_SNPRINTF="($GNULIB_SNPRINTF || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SNPRINTF 1" >>confdefs.h + + + + + +printf "%s\n" "@%:@define GNULIB_SNPRINTF $gl_module_indicator_condition" >>confdefs.h + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS socket.$ac_objext" + + fi + # When this module is used, sockets may actually occur as file descriptors, + # hence it is worth warning if the modules 'close' and 'ioctl' are not used. + + + + if test "$ac_cv_header_winsock2_h" = yes; then + UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 + fi + + + + + + if test "$GNULIB_SOCKET" != 1; then + if test "$GNULIB_SOCKET" = 0; then + GNULIB_SOCKET=$gl_module_indicator_condition + else + GNULIB_SOCKET="($GNULIB_SOCKET || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SOCKET 1" >>confdefs.h + + + + + + ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " +/* is not needed according to POSIX, but the + in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include +#if HAVE_SYS_SOCKET_H +# include +#elif HAVE_WS2TCPIP_H +# include +#endif + +" +if test "x$ac_cv_type_socklen_t" = xyes +then : + +else case e in @%:@( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5 +printf %s "checking for socklen_t equivalent... " >&6; } + if test ${gl_cv_socklen_t_equiv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # Systems have either "struct sockaddr *" or + # "void *" as the second argument to getpeername + gl_cv_socklen_t_equiv= + for arg2 in "struct sockaddr" void; do + for t in int size_t "unsigned int" "long int" "unsigned long int"; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + + int getpeername (int, $arg2 *, $t *); +int +main (void) +{ +$t len; + getpeername (0, 0, &len); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_socklen_t_equiv="$t" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$gl_cv_socklen_t_equiv" != "" && break + done + test "$gl_cv_socklen_t_equiv" != "" && break + done + ;; +esac +fi + + if test "$gl_cv_socklen_t_equiv" = ""; then + as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5 +printf "%s\n" "$gl_cv_socklen_t_equiv" >&6; } + +printf "%s\n" "@%:@define socklen_t $gl_cv_socklen_t_equiv" >>confdefs.h + ;; +esac +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5 +printf %s "checking for working stdalign.h... " >&6; } +if test ${gl_cv_header_working_stdalign_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + + /* Test that alignof yields a result consistent with offsetof. + This catches GCC bug 52023 + . */ + #ifdef __cplusplus + template struct alignof_helper { char a; t b; }; + # define ao(type) offsetof (alignof_helper, b) + #else + # define ao(type) offsetof (struct { char a; type b; }, b) + #endif + char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1]; + char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1]; + char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1]; + + /* Test _Alignas only on platforms where gnulib can help. */ + #if \ + ((defined __cplusplus && 201103 <= __cplusplus) \ + || (defined __APPLE__ && defined __MACH__ \ + ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ + : __GNUC__) \ + || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ + || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \ + || 1300 <= _MSC_VER) + struct alignas_test { char c; char alignas (8) alignas_8; }; + char test_alignas[offsetof (struct alignas_test, alignas_8) == 8 + ? 1 : -1]; + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_working_stdalign_h=yes +else case e in @%:@( + e) gl_cv_header_working_stdalign_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5 +printf "%s\n" "$gl_cv_header_working_stdalign_h" >&6; } + + if test $gl_cv_header_working_stdalign_h = yes; then + STDALIGN_H='' + else + STDALIGN_H='stdalign.h' + fi + + + if test -n "$STDALIGN_H"; then + GL_GENERATE_STDALIGN_H_TRUE= + GL_GENERATE_STDALIGN_H_FALSE='#' +else + GL_GENERATE_STDALIGN_H_TRUE='#' + GL_GENERATE_STDALIGN_H_FALSE= +fi + + + + + + + + + + + + if test $ac_cv_have_decl_strerror_r = no; then + HAVE_DECL_STRERROR_R=0 + fi + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + if test $gl_cv_func_strerror_r_posix_signature = yes; then + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR_R=1 ;; + esac + else + REPLACE_STRERROR_R=1 + fi + else + REPLACE_STRERROR_R=1 + fi + fi + + if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS strerror_r.$ac_objext" + + + + + + + fi + + + + + + if test "$GNULIB_STRERROR_R" != 1; then + if test "$GNULIB_STRERROR_R" = 0; then + GNULIB_STRERROR_R=$gl_module_indicator_condition + else + GNULIB_STRERROR_R="($GNULIB_STRERROR_R || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STRERROR_R 1" >>confdefs.h + + + + + +printf "%s\n" "@%:@define GNULIB_STRERROR_R_POSIX $gl_module_indicator_condition" >>confdefs.h + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in @%:@( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "@%:@define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "@%:@define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + if test $ac_cv_func_symlink = no; then + HAVE_SYMLINK=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether symlink handles trailing slash correctly" >&5 +printf %s "checking whether symlink handles trailing slash correctly... " >&6; } +if test ${gl_cv_func_symlink_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_symlink_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_symlink_works="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +int result = 0; + if (!symlink ("a", "conftest.link/")) + result |= 1; + if (symlink ("conftest.f", "conftest.lnk2")) + result |= 2; + else if (!symlink ("a", "conftest.lnk2/")) + result |= 4; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_symlink_works=yes +else case e in @%:@( + e) gl_cv_func_symlink_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.f conftest.link conftest.lnk2 ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_symlink_works" >&5 +printf "%s\n" "$gl_cv_func_symlink_works" >&6; } + case "$gl_cv_func_symlink_works" in + *yes) ;; + *) + REPLACE_SYMLINK=1 + ;; + esac + fi + + if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS symlink.$ac_objext" + + fi + + + + + + if test "$GNULIB_SYMLINK" != 1; then + if test "$GNULIB_SYMLINK" = 0; then + GNULIB_SYMLINK=$gl_module_indicator_condition + else + GNULIB_SYMLINK="($GNULIB_SYMLINK || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SYMLINK 1" >>confdefs.h + + + + + + + + if test $ac_cv_header_sys_ioctl_h = yes; then + HAVE_SYS_IOCTL_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether declares ioctl" >&5 +printf %s "checking whether declares ioctl... " >&6; } +if test ${gl_cv_decl_ioctl_in_sys_ioctl_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +(void) ioctl; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_ioctl_in_sys_ioctl_h=yes +else case e in @%:@( + e) gl_cv_decl_ioctl_in_sys_ioctl_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_ioctl_in_sys_ioctl_h" >&5 +printf "%s\n" "$gl_cv_decl_ioctl_in_sys_ioctl_h" >&6; } + else + HAVE_SYS_IOCTL_H=0 + fi + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_ioctl_h='<'sys/ioctl.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_ioctl_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_ioctl_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/ioctl.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_ioctl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_ioctl_h + gl_cv_next_sys_ioctl_h='"'$gl_header'"' + else + gl_cv_next_sys_ioctl_h='<'sys/ioctl.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_ioctl_h" >&5 +printf "%s\n" "$gl_cv_next_sys_ioctl_h" >&6; } + fi + NEXT_SYS_IOCTL_H=$gl_cv_next_sys_ioctl_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/ioctl.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_ioctl_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H=$gl_next_as_first_directive + + + + + + + for gl_func in ioctl; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +/* Some platforms declare ioctl in the wrong header. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +#endif + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_uio_h='<'sys/uio.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_uio_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_uio_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/uio.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_uio_h + gl_cv_next_sys_uio_h='"'$gl_header'"' + else + gl_cv_next_sys_uio_h='<'sys/uio.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5 +printf "%s\n" "$gl_cv_next_sys_uio_h" >&6; } + fi + NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/uio.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_uio_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_sys_uio_h = yes; then + HAVE_SYS_UIO_H=1 + else + HAVE_SYS_UIO_H=0 + fi + + + + abs_aux_dir=`cd "$ac_aux_dir"; pwd` + + abs_aux_dir=`cd "$ac_aux_dir"; pwd` + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + + + if test $ac_cv_func_wctob = no; then + HAVE_WCTOB=0 + HAVE_DECL_WCTOB=0 + else + HAVE_WCTOB=1 + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wctob works" >&5 +printf %s "checking whether wctob works... " >&6; } +if test ${gl_cv_func_wctob_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris <= 9 and Cygwin. + solaris2.[1-9] | solaris2.[1-9].* | cygwin*) + gl_cv_func_wctob_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wctob_works="guessing yes" ;; + esac + case "$host_os" in + cygwin*) + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include + +register long global __asm__ ("%ebx"); + +int main () +{ + setlocale (LC_ALL, "en_US.UTF-8"); + + global = 0x12345678; + if (wctob (0x00FC) != -1) + return 1; + if (global != 0x12345678) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + : +else case e in @%:@( + e) gl_cv_func_wctob_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; + esac + if test "$gl_cv_func_wctob_works" != no && test $LOCALE_FR != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + wchar_t wc; + + if (mbtowc (&wc, "\374", 1) == 1) + if (wctob (wc) != (unsigned char) '\374') + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_wctob_works=yes +else case e in @%:@( + e) gl_cv_func_wctob_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wctob_works" >&5 +printf "%s\n" "$gl_cv_func_wctob_works" >&6; } + case "$gl_cv_func_wctob_works" in + *yes) ;; + *) REPLACE_WCTOB=1 ;; + esac + if test $REPLACE_WCTOB = 0; then + + ac_fn_check_decl "$LINENO" "wctob" "ac_cv_have_decl_wctob" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_wctob" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_WCTOB $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_wctob != yes; then + HAVE_DECL_WCTOB=0 + fi + fi + fi + + if test $HAVE_WCTOB = 0 || test $REPLACE_WCTOB = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS wctob.$ac_objext" + + + : + + fi + + + + + + if test "$GNULIB_WCTOB" != 1; then + if test "$GNULIB_WCTOB" = 0; then + GNULIB_WCTOB=$gl_module_indicator_condition + else + GNULIB_WCTOB="($GNULIB_WCTOB || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_WCTOB 1" >>confdefs.h + + + + + + + if false; then + REPLACE_WCTOMB=1 + fi + + if test $REPLACE_WCTOMB = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS wctomb.$ac_objext" + + + : + + fi + + + + + + if test "$GNULIB_WCTOMB" != 1; then + if test "$GNULIB_WCTOMB" = 0; then + GNULIB_WCTOMB=$gl_module_indicator_condition + else + GNULIB_WCTOMB="($GNULIB_WCTOMB || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_WCTOMB 1" >>confdefs.h + + + + + + + + + + + + + + LIBDIFFUTILS_LIBDEPS="$gl_libdeps" + + LIBDIFFUTILS_LTLIBDEPS="$gl_ltlibdeps" + + LIBTESTS_LIBDEPS="$gltests_libdeps" + + + +@%:@ Check whether --enable-gcc-warnings was given. +if test ${enable_gcc_warnings+y} +then : + enableval=$enable_gcc_warnings; case $enableval in + yes|no) ;; + *) as_fn_error $? "bad value $enableval for gcc-warnings option" "$LINENO" 5 ;; + esac + gl_gcc_warnings=$enableval +else case e in @%:@( + e) if test -d "$srcdir"/.git; then + gl_gcc_warnings=yes + else + gl_gcc_warnings=no + fi + ;; +esac +fi + + +if test "$gl_gcc_warnings" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror -Wunknown-warning-option" >&5 +printf %s "checking whether C compiler handles -Werror -Wunknown-warning-option... " >&6; } +if test ${gl_cv_warn_c__Werror__Wunknown_warning_option+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Werror__Wunknown_warning_option=yes +else case e in @%:@( + e) gl_cv_warn_c__Werror__Wunknown_warning_option=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror__Wunknown_warning_option" >&5 +printf "%s\n" "$gl_cv_warn_c__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_c__Werror__Wunknown_warning_option" = xyes +then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else case e in @%:@( + e) gl_unknown_warnings_are_errors= ;; +esac +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror" >&5 +printf %s "checking whether C compiler handles -Werror... " >&6; } +if test ${gl_cv_warn_c__Werror+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Werror=yes +else case e in @%:@( + e) gl_cv_warn_c__Werror=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror" >&5 +printf "%s\n" "$gl_cv_warn_c__Werror" >&6; } +if test "x$gl_cv_warn_c__Werror" = xyes +then : + as_fn_append WERROR_CFLAGS " -Werror" +fi + + + + + nw= + # This, $nw, is the list of warnings we disable. + nw="$nw -Wdeclaration-after-statement" # too useful to forbid + nw="$nw -Waggregate-return" # anachronistic + nw="$nw -Wlong-long" # C90 is anachronistic (lib/gethrxtime.h) + nw="$nw -Wc++-compat" # We don't care about C++ compilers + nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib + nw="$nw -Wtraditional" # Warns on #elif which we use often + nw="$nw -Wcast-qual" # Too many warnings for now + nw="$nw -Wconversion" # Too many warnings for now + nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings + nw="$nw -Wsign-conversion" # Too many warnings for now + nw="$nw -Wtraditional-conversion" # Too many warnings for now + nw="$nw -Wunreachable-code" # Too many warnings for now + nw="$nw -Wpadded" # Our structs are not padded + nw="$nw -Wredundant-decls" # openat.h declares e.g., mkdirat + nw="$nw -Wlogical-op" # any use of fwrite provokes this + nw="$nw -Wformat-nonliteral" # who.c and pinky.c strftime uses + nw="$nw -Wvla" # warnings in gettext.h + nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__ + nw="$nw -Wswitch-enum" # Too many warnings for now + nw="$nw -Wswitch-default" # Too many warnings for now + nw="$nw -Wstack-protector" # not worth working around + # things I might fix soon: + nw="$nw -Wfloat-equal" # sort.c, seq.c + nw="$nw -Wmissing-format-attribute" # copy.c + nw="$nw -Wunsafe-loop-optimizations" # a few src/*.c + nw="$nw -Winline" # system.h's readdir_ignoring_dot_and_dotdot + nw="$nw -Wstrict-overflow" # expr.c, pr.c, tr.c, factor.c + nw="$nw -Wformat-extra-args" # sdiff.c + # ?? -Wstrict-overflow + + + + if test -n "$GCC"; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is supported" >&5 +printf %s "checking whether -Wno-missing-field-initializers is supported... " >&6; } + if test ${gl_cv_cc_nomfi_supported+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_nomfi_supported=yes +else case e in @%:@( + e) gl_cv_cc_nomfi_supported=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_supported" >&5 +printf "%s\n" "$gl_cv_cc_nomfi_supported" >&6; } + + if test "$gl_cv_cc_nomfi_supported" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is needed" >&5 +printf %s "checking whether -Wno-missing-field-initializers is needed... " >&6; } + if test ${gl_cv_cc_nomfi_needed+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int f (void) + { + typedef struct { int a; int b; } s_t; + s_t s1 = { 0, }; + return s1.b; + } + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_nomfi_needed=no +else case e in @%:@( + e) gl_cv_cc_nomfi_needed=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" + ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_needed" >&5 +printf "%s\n" "$gl_cv_cc_nomfi_needed" >&6; } + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wuninitialized is supported" >&5 +printf %s "checking whether -Wuninitialized is supported... " >&6; } + if test ${gl_cv_cc_uninitialized_supported+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wuninitialized" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_uninitialized_supported=yes +else case e in @%:@( + e) gl_cv_cc_uninitialized_supported=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_uninitialized_supported" >&5 +printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; } + + fi + + # List all gcc warning categories. + # To compare this list to your installed GCC's, run this Bash command: + # + # comm -3 \ + # <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \ + # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort | + # grep -v -x -F -f <( + # awk '/^[^#]/ {print ws}' ../build-aux/gcc-warning.spec)) + + gl_manywarn_set= + for gl_manywarn_item in -fno-common \ + -W \ + -Wabi \ + -Waddress \ + -Waggressive-loop-optimizations \ + -Wall \ + -Wattributes \ + -Wbad-function-cast \ + -Wbool-compare \ + -Wbool-operation \ + -Wbuiltin-declaration-mismatch \ + -Wbuiltin-macro-redefined \ + -Wcast-align \ + -Wchar-subscripts \ + -Wchkp \ + -Wclobbered \ + -Wcomment \ + -Wcomments \ + -Wcoverage-mismatch \ + -Wcpp \ + -Wdangling-else \ + -Wdate-time \ + -Wdeprecated \ + -Wdeprecated-declarations \ + -Wdesignated-init \ + -Wdisabled-optimization \ + -Wdiscarded-array-qualifiers \ + -Wdiscarded-qualifiers \ + -Wdiv-by-zero \ + -Wdouble-promotion \ + -Wduplicated-branches \ + -Wduplicated-cond \ + -Wduplicate-decl-specifier \ + -Wempty-body \ + -Wendif-labels \ + -Wenum-compare \ + -Wexpansion-to-defined \ + -Wextra \ + -Wformat-contains-nul \ + -Wformat-extra-args \ + -Wformat-nonliteral \ + -Wformat-security \ + -Wformat-signedness \ + -Wformat-y2k \ + -Wformat-zero-length \ + -Wframe-address \ + -Wfree-nonheap-object \ + -Whsa \ + -Wignored-attributes \ + -Wignored-qualifiers \ + -Wimplicit \ + -Wimplicit-function-declaration \ + -Wimplicit-int \ + -Wincompatible-pointer-types \ + -Winit-self \ + -Winline \ + -Wint-conversion \ + -Wint-in-bool-context \ + -Wint-to-pointer-cast \ + -Winvalid-memory-model \ + -Winvalid-pch \ + -Wjump-misses-init \ + -Wlogical-not-parentheses \ + -Wlogical-op \ + -Wmain \ + -Wmaybe-uninitialized \ + -Wmemset-elt-size \ + -Wmemset-transposed-args \ + -Wmisleading-indentation \ + -Wmissing-braces \ + -Wmissing-declarations \ + -Wmissing-field-initializers \ + -Wmissing-include-dirs \ + -Wmissing-parameter-type \ + -Wmissing-prototypes \ + -Wmultichar \ + -Wnarrowing \ + -Wnested-externs \ + -Wnonnull \ + -Wnonnull-compare \ + -Wnull-dereference \ + -Wodr \ + -Wold-style-declaration \ + -Wold-style-definition \ + -Wopenmp-simd \ + -Woverflow \ + -Woverlength-strings \ + -Woverride-init \ + -Wpacked \ + -Wpacked-bitfield-compat \ + -Wparentheses \ + -Wpointer-arith \ + -Wpointer-compare \ + -Wpointer-sign \ + -Wpointer-to-int-cast \ + -Wpragmas \ + -Wpsabi \ + -Wrestrict \ + -Wreturn-local-addr \ + -Wreturn-type \ + -Wscalar-storage-order \ + -Wsequence-point \ + -Wshadow \ + -Wshift-count-negative \ + -Wshift-count-overflow \ + -Wshift-negative-value \ + -Wsizeof-array-argument \ + -Wsizeof-pointer-memaccess \ + -Wstack-protector \ + -Wstrict-aliasing \ + -Wstrict-overflow \ + -Wstrict-prototypes \ + -Wsuggest-attribute=const \ + -Wsuggest-attribute=format \ + -Wsuggest-attribute=noreturn \ + -Wsuggest-attribute=pure \ + -Wsuggest-final-methods \ + -Wsuggest-final-types \ + -Wswitch \ + -Wswitch-bool \ + -Wswitch-default \ + -Wswitch-unreachable \ + -Wsync-nand \ + -Wsystem-headers \ + -Wtautological-compare \ + -Wtrampolines \ + -Wtrigraphs \ + -Wtype-limits \ + -Wuninitialized \ + -Wunknown-pragmas \ + -Wunsafe-loop-optimizations \ + -Wunused \ + -Wunused-but-set-parameter \ + -Wunused-but-set-variable \ + -Wunused-function \ + -Wunused-label \ + -Wunused-local-typedefs \ + -Wunused-macros \ + -Wunused-parameter \ + -Wunused-result \ + -Wunused-value \ + -Wunused-variable \ + -Wvarargs \ + -Wvariadic-macros \ + -Wvector-operation-performance \ + -Wvla \ + -Wvolatile-register-var \ + -Wwrite-strings \ + \ + ; do + gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" + done + + # gcc --help=warnings outputs an unusual form for these options; list + # them here so that the above 'comm' command doesn't report a false match. + # Would prefer "min (PTRDIFF_MAX, SIZE_MAX)", but it must be a literal: + ptrdiff_max_max=9223372036854775807 + gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$ptrdiff_max_max" + gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2" + gl_manywarn_set="$gl_manywarn_set -Wformat-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wformat-truncation=2" + gl_manywarn_set="$gl_manywarn_set -Wimplicit-fallthrough=5" + gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc" + gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wstringop-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2" + gl_manywarn_set="$gl_manywarn_set -Wvla-larger-than=4031" + + # These are needed for older GCC versions. + if test -n "$GCC"; then + case `($CC --version) 2>/dev/null` in + 'gcc (GCC) '[0-3].* | \ + 'gcc (GCC) '4.[0-7].*) + gl_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option" + gl_manywarn_set="$gl_manywarn_set -funit-at-a-time" + ;; + esac + fi + + # Disable specific options as needed. + if test "$gl_cv_cc_nomfi_needed" = yes; then + gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers" + fi + + if test "$gl_cv_cc_uninitialized_supported" = no; then + gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized" + fi + + ws=$gl_manywarn_set + + + gl_warn_set= + set x $ws; shift + for gl_warn_item + do + case " $nw " in + *" $gl_warn_item "*) + ;; + *) + gl_warn_set="$gl_warn_set $gl_warn_item" + ;; + esac + done + ws=$gl_warn_set + + for w in $ws; do + +as_gl_Warn=`printf "%s\n" "gl_cv_warn_c_$w" | sed "$as_sed_sh"` +gl_positive="$w" +case $gl_positive in + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles $w" >&5 +printf %s "checking whether C compiler handles $w... " >&6; } +if eval test \${$as_gl_Warn+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors $gl_positive" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_gl_Warn=yes" +else case e in @%:@( + e) eval "$as_gl_Warn=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +eval ac_res=\$$as_gl_Warn + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_gl_Warn"\" = x"yes" +then : + as_fn_append WARN_CFLAGS " $w" +fi + + + done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-missing-field-initializers" >&5 +printf %s "checking whether C compiler handles -Wno-missing-field-initializers... " >&6; } +if test ${gl_cv_warn_c__Wno_missing_field_initializers+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wmissing-field-initializers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_missing_field_initializers=yes +else case e in @%:@( + e) gl_cv_warn_c__Wno_missing_field_initializers=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_missing_field_initializers" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_missing_field_initializers" >&6; } +if test "x$gl_cv_warn_c__Wno_missing_field_initializers" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-missing-field-initializers" +fi + + # We need this one + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-sign-compare" >&5 +printf %s "checking whether C compiler handles -Wno-sign-compare... " >&6; } +if test ${gl_cv_warn_c__Wno_sign_compare+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wsign-compare" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_sign_compare=yes +else case e in @%:@( + e) gl_cv_warn_c__Wno_sign_compare=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_sign_compare" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_sign_compare" >&6; } +if test "x$gl_cv_warn_c__Wno_sign_compare" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-sign-compare" +fi + + # Too many warnings for now + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-pointer-sign" >&5 +printf %s "checking whether C compiler handles -Wno-pointer-sign... " >&6; } +if test ${gl_cv_warn_c__Wno_pointer_sign+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wpointer-sign" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_pointer_sign=yes +else case e in @%:@( + e) gl_cv_warn_c__Wno_pointer_sign=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_pointer_sign" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_pointer_sign" >&6; } +if test "x$gl_cv_warn_c__Wno_pointer_sign" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-pointer-sign" +fi + + # Too many warnings for now + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-unused-parameter" >&5 +printf %s "checking whether C compiler handles -Wno-unused-parameter... " >&6; } +if test ${gl_cv_warn_c__Wno_unused_parameter+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wunused-parameter" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_unused_parameter=yes +else case e in @%:@( + e) gl_cv_warn_c__Wno_unused_parameter=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_unused_parameter" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_unused_parameter" >&6; } +if test "x$gl_cv_warn_c__Wno_unused_parameter" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-unused-parameter" +fi + + # Too many warnings for now + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-format-nonliteral" >&5 +printf %s "checking whether C compiler handles -Wno-format-nonliteral... " >&6; } +if test ${gl_cv_warn_c__Wno_format_nonliteral+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wformat-nonliteral" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_format_nonliteral=yes +else case e in @%:@( + e) gl_cv_warn_c__Wno_format_nonliteral=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_format_nonliteral" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_format_nonliteral" >&6; } +if test "x$gl_cv_warn_c__Wno_format_nonliteral" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-format-nonliteral" +fi + + + + # In spite of excluding -Wlogical-op above, it is enabled, as of + # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-logical-op" >&5 +printf %s "checking whether C compiler handles -Wno-logical-op... " >&6; } +if test ${gl_cv_warn_c__Wno_logical_op+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wlogical-op" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_logical_op=yes +else case e in @%:@( + e) gl_cv_warn_c__Wno_logical_op=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_logical_op" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_logical_op" >&6; } +if test "x$gl_cv_warn_c__Wno_logical_op" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-logical-op" +fi + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -fdiagnostics-show-option" >&5 +printf %s "checking whether C compiler handles -fdiagnostics-show-option... " >&6; } +if test ${gl_cv_warn_c__fdiagnostics_show_option+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -fdiagnostics-show-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__fdiagnostics_show_option=yes +else case e in @%:@( + e) gl_cv_warn_c__fdiagnostics_show_option=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__fdiagnostics_show_option" >&5 +printf "%s\n" "$gl_cv_warn_c__fdiagnostics_show_option" >&6; } +if test "x$gl_cv_warn_c__fdiagnostics_show_option" = xyes +then : + as_fn_append WARN_CFLAGS " -fdiagnostics-show-option" +fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -funit-at-a-time" >&5 +printf %s "checking whether C compiler handles -funit-at-a-time... " >&6; } +if test ${gl_cv_warn_c__funit_at_a_time+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -funit-at-a-time" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__funit_at_a_time=yes +else case e in @%:@( + e) gl_cv_warn_c__funit_at_a_time=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__funit_at_a_time" >&5 +printf "%s\n" "$gl_cv_warn_c__funit_at_a_time" >&6; } +if test "x$gl_cv_warn_c__funit_at_a_time" = xyes +then : + as_fn_append WARN_CFLAGS " -funit-at-a-time" +fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -fno-common" >&5 +printf %s "checking whether C compiler handles -fno-common... " >&6; } +if test ${gl_cv_warn_c__fno_common+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -fno-common" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__fno_common=yes +else case e in @%:@( + e) gl_cv_warn_c__fno_common=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__fno_common" >&5 +printf "%s\n" "$gl_cv_warn_c__fno_common" >&6; } +if test "x$gl_cv_warn_c__fno_common" = xyes +then : + as_fn_append WARN_CFLAGS " -fno-common" +fi + + + + + + +printf "%s\n" "@%:@define lint 1" >>confdefs.h + + +printf "%s\n" "@%:@define _FORTIFY_SOURCE 2" >>confdefs.h + + +printf "%s\n" "@%:@define GNULIB_PORTCHECK 1" >>confdefs.h + + + # We use a slightly smaller set of warning options for lib/. + # Remove the following and save the result in GNULIB_WARN_CFLAGS. + nw= + nw="$nw -Wunused-macros" + nw="$nw -Wmissing-prototypes" + nw="$nw -Wold-style-definition" + nw="$nw -Wsuggest-attribute=pure" + + gl_warn_set= + set x $WARN_CFLAGS; shift + for gl_warn_item + do + case " $nw " in + *" $gl_warn_item "*) + ;; + *) + gl_warn_set="$gl_warn_set $gl_warn_item" + ;; + esac + done + GNULIB_WARN_CFLAGS=$gl_warn_set + + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo (void) {return 0; } +$ac_kw foo_t foo (void) {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for variable-length arrays" >&5 +printf %s "checking for variable-length arrays... " >&6; } +if test ${ac_cv_c_vararrays+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC_NO_VLA__ + defined + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "defined" >/dev/null 2>&1 +then : + ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined' +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test for VLA support. This test is partly inspired + from examples in the C standard. Use at least two VLA + functions to detect the GCC 3.4.3 bug described in: + http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html + */ + #ifdef __STDC_NO_VLA__ + syntax error; + #else + extern int n; + int B[100]; + int fvla (int m, int C[m][m]); + + int + simple (int count, int all[static count]) + { + return all[count - 1]; + } + + int + fvla (int m, int C[m][m]) + { + typedef int VLA[m][m]; + VLA x; + int D[m]; + static int (*q)[m] = &B; + int (*s)[n] = q; + return C && &x[0][0] == &D[0] && &D[0] == s[0]; + } + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_vararrays=yes +else case e in @%:@( + e) ac_cv_c_vararrays=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -rf conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_vararrays" >&5 +printf "%s\n" "$ac_cv_c_vararrays" >&6; } + if test "$ac_cv_c_vararrays" = yes; then + +printf "%s\n" "@%:@define HAVE_C_VARARRAYS 1" >>confdefs.h + + elif test "$ac_cv_c_vararrays" = no; then + +printf "%s\n" "@%:@define __STDC_NO_VLA__ 1" >>confdefs.h + + fi + + + +printf "%s\n" "@%:@define DEFAULT_EDITOR_PROGRAM \"ed\"" >>confdefs.h + + +# Extract the first word of "pr", so it can be a program name with args. +set dummy pr; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PR_PROGRAM+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) case $PR_PROGRAM in + [\\/]* | ?:[\\/]*) + ac_cv_path_PR_PROGRAM="$PR_PROGRAM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PR_PROGRAM="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PR_PROGRAM" && ac_cv_path_PR_PROGRAM="""" + ;; +esac ;; +esac +fi +PR_PROGRAM=$ac_cv_path_PR_PROGRAM +if test -n "$PR_PROGRAM"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PR_PROGRAM" >&5 +printf "%s\n" "$PR_PROGRAM" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +printf "%s\n" "@%:@define PR_PROGRAM \"$PR_PROGRAM\"" >>confdefs.h + + +ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_blksize" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_BLKSIZE 1" >>confdefs.h + + +fi + +ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_rdev" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_RDEV 1" >>confdefs.h + + +fi + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | sed "$as_sed_sh"` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +printf %s "checking for $ac_hdr that defines DIR... " >&6; } +if eval test \${$as_ac_Header+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main (void) +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_ac_Header=yes" +else case e in @%:@( + e) eval "$as_ac_Header=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_ac_Header + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_$ac_hdr" | sed "$as_sed_cpp"` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); +int +main (void) +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_opendir+y} +then : + break +fi +done +if test ${ac_cv_search_opendir+y} +then : + +else case e in @%:@( + e) ac_cv_search_opendir=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); +int +main (void) +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_opendir+y} +then : + break +fi +done +if test ${ac_cv_search_opendir+y} +then : + +else case e in @%:@( + e) ac_cv_search_opendir=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 +printf %s "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } +if test ${ac_cv_header_sys_wait_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) +#endif +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif + +int +main (void) +{ + int s; + wait (&s); + s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_header_sys_wait_h=yes +else case e in @%:@( + e) ac_cv_header_sys_wait_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 +printf "%s\n" "$ac_cv_header_sys_wait_h" >&6; } +if test $ac_cv_header_sys_wait_h = yes; then + +printf "%s\n" "@%:@define HAVE_SYS_WAIT_H 1" >>confdefs.h + +fi + + + ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default +" +if test "x$ac_cv_type_pid_t" = xyes +then : + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_pid_type='int' +else case e in @%:@( + e) ac_pid_type='__int64' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +printf "%s\n" "@%:@define pid_t $ac_pid_type" >>confdefs.h + + ;; +esac +fi + + + + + + + +if test $ac_cv_func_sigprocmask = no; then + ac_fn_c_check_func "$LINENO" "sigblock" "ac_cv_func_sigblock" +if test "x$ac_cv_func_sigblock" = xyes +then : + printf "%s\n" "@%:@define HAVE_SIGBLOCK 1" >>confdefs.h + +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5 +printf %s "checking whether closedir returns void... " >&6; } +if test ${ac_cv_func_closedir_void+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <$ac_header_dirent> + +int +main (void) +{ + + return closedir(0); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_func_closedir_void=no +else case e in @%:@( + e) ac_cv_func_closedir_void=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_closedir_void" >&5 +printf "%s\n" "$ac_cv_func_closedir_void" >&6; } +if test $ac_cv_func_closedir_void = yes; then + +printf "%s\n" "@%:@define CLOSEDIR_VOID 1" >>confdefs.h + +fi + + + + + + +if test "x$ac_cv_func_fork" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 +printf %s "checking for working fork... " >&6; } +if test ${ac_cv_func_fork_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + ac_cv_func_fork_works=cross +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* By R. Kuhlmann. */ + return fork () < 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_fork_works=yes +else case e in @%:@( + e) ac_cv_func_fork_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 +printf "%s\n" "$ac_cv_func_fork_works" >&6; } + +else + ac_cv_func_fork_works=$ac_cv_func_fork +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 +printf %s "checking for working vfork... " >&6; } +if test ${ac_cv_func_vfork_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + ac_cv_func_vfork_works=cross +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Thanks to Paul Eggert for this test. */ +$ac_includes_default +#include +#include +#ifdef HAVE_VFORK_H +# include +#endif + +static void +do_nothing (int sig) +{ + (void) sig; +} + +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include , but some compilers + (e.g. gcc -O) don't grok . Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static void +sparc_address_test (int arg) +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} + +int +main (void) +{ + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (0); + + /* On Solaris 2.4, changes by the child to the signal handler + also munge signal handlers in the parent. To detect this, + start by putting the parent's handler in a known state. */ + signal (SIGTERM, SIG_DFL); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* Alter the child's signal handler. */ + if (signal (SIGTERM, do_nothing) != SIG_DFL) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + return ( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child munge the parent's signal handler? */ + || signal (SIGTERM, SIG_DFL) != SIG_DFL + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_vfork_works=yes +else case e in @%:@( + e) ac_cv_func_vfork_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 +printf "%s\n" "$ac_cv_func_vfork_works" >&6; } + +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=$ac_cv_func_vfork + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} +fi + +if test "x$ac_cv_func_vfork_works" = xyes; then + +printf "%s\n" "@%:@define HAVE_WORKING_VFORK 1" >>confdefs.h + +else + +printf "%s\n" "@%:@define vfork fork" >>confdefs.h + +fi +if test "x$ac_cv_func_fork_works" = xyes; then + +printf "%s\n" "@%:@define HAVE_WORKING_FORK 1" >>confdefs.h + +fi + + +# When .tarball-version exists, we're building from a tarball +# and must not make man/*.1 files depend on the generated src/version.c, +# because that would induce a requirement to run the help2man perl script. +# We are not yet prepared to make perl a build-from-tarball requirement. +# Hence, here we detect .tarball-version existence. When not present, +# we define a variable to be used in man/Makefile.am to induce the +# proper dependency (so that man/*.1 will be rebuilt upon any version change), +# but not when built from a tarball. + +test -f $srcdir/.tarball-version \ + && SRC_VERSION_C= \ + || SRC_VERSION_C=../src/version.c + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +printf %s "checking whether NLS is requested... " >&6; } + @%:@ Check whether --enable-nls was given. +if test ${enable_nls+y} +then : + enableval=$enable_nls; USE_NLS=$enableval +else case e in @%:@( + e) USE_NLS=yes ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$USE_NLS" >&6; } + + + + + GETTEXT_MACRO_VERSION=0.19 + + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MSGFMT+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) case "$MSGFMT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +printf "%s\n" "$MSGFMT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_GMSGFMT+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +printf "%s\n" "$GMSGFMT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; + *) MSGFMT_015=$MSGFMT ;; + esac + + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_XGETTEXT+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) case "$XGETTEXT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +printf "%s\n" "$XGETTEXT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + rm -f messages.po + + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MSGMERGE+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) case "$MSGMERGE" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" + ;; +esac ;; +esac +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 +printf "%s\n" "$MSGMERGE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$localedir" || localedir='${datadir}/locale' + + + test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + + + ac_config_commands="$ac_config_commands po-directories" + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 +printf %s "checking for CFPreferencesCopyAppValue... " >&6; } +if test ${gt_cv_func_CFPreferencesCopyAppValue+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +CFPreferencesCopyAppValue(NULL, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gt_cv_func_CFPreferencesCopyAppValue=yes +else case e in @%:@( + e) gt_cv_func_CFPreferencesCopyAppValue=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 +printf "%s\n" "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + +printf "%s\n" "@%:@define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 +printf %s "checking for CFLocaleCopyCurrent... " >&6; } +if test ${gt_cv_func_CFLocaleCopyCurrent+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +CFLocaleCopyCurrent(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gt_cv_func_CFLocaleCopyCurrent=yes +else case e in @%:@( + e) gt_cv_func_CFLocaleCopyCurrent=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 +printf "%s\n" "$gt_cv_func_CFLocaleCopyCurrent" >&6; } + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + +printf "%s\n" "@%:@define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h + + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + fi + + + + + + + LIBINTL= + LTLIBINTL= + POSUB= + + case " $gt_needs " in + *" need-formatstring-macros "*) gt_api_version=3 ;; + *" need-ngettext "*) gt_api_version=2 ;; + *) gt_api_version=1 ;; + esac + gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" + gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + + + if test $gt_api_version -ge 3; then + gt_revision_test_code=' +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +' + else + gt_revision_test_code= + fi + if test $gt_api_version -ge 2; then + gt_expression_test_code=' + * ngettext ("", "", 0)' + else + gt_expression_test_code= + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 +printf %s "checking for GNU gettext in libc... " >&6; } +if eval test \${$gt_func_gnugettext_libc+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$gt_func_gnugettext_libc=yes" +else case e in @%:@( + e) eval "$gt_func_gnugettext_libc=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$gt_func_gnugettext_libc + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +printf %s "checking for iconv... " >&6; } +if test ${am_cv_func_iconv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +printf "%s\n" "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +printf %s "checking for working iconv... " >&6; } +if test ${am_cv_func_iconv_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + if test "$cross_compiling" = yes +then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + +int +main (void) +{ +int result = 0; + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\263"; + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + result |= 8; + iconv_close (cd_88591_to_utf8); + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + result |= 16; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + am_cv_func_iconv_works=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + test "$am_cv_func_iconv_works" = no || break + done + LIBS="$am_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +printf "%s\n" "$am_cv_func_iconv_works" >&6; } + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + +printf "%s\n" "@%:@define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +printf %s "checking how to link with libiconv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +printf "%s\n" "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +@%:@ Check whether --with-libintl-prefix was given. +if test ${with_libintl_prefix+y} +then : + withval=$with_libintl_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBINTL= + LTLIBINTL= + INCINTL= + LIBINTL_PREFIX= + HAVE_LIBINTL= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='intl ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" + ;; + esac + done + fi + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" + done + fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 +printf %s "checking for GNU gettext in libintl... " >&6; } +if eval test \${$gt_func_gnugettext_libintl+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$gt_func_gnugettext_libintl=yes" +else case e in @%:@( + e) eval "$gt_func_gnugettext_libintl=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS" ;; +esac +fi +eval ac_res=\$$gt_func_gnugettext_libintl + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + fi + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ + || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + + + if test -n "$INTL_MACOSX_LIBS"; then + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" + LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" + fi + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + +printf "%s\n" "@%:@define ENABLE_NLS 1" >>confdefs.h + + else + USE_NLS=no + fi + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 +printf %s "checking whether to use NLS... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$USE_NLS" >&6; } + if test "$USE_NLS" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 +printf %s "checking where the gettext function comes from... " >&6; } + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 +printf "%s\n" "$gt_source" >&6; } + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 +printf %s "checking how to link with libintl... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 +printf "%s\n" "$LIBINTL" >&6; } + + for element in $INCINTL; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + fi + + +printf "%s\n" "@%:@define HAVE_GETTEXT 1" >>confdefs.h + + +printf "%s\n" "@%:@define HAVE_DCGETTEXT 1" >>confdefs.h + + fi + + POSUB=po + fi + + + + INTLLIBS="$LIBINTL" + + + + + + + +XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT" + +ac_config_files="$ac_config_files Makefile doc/Makefile lib/Makefile src/Makefile tests/Makefile gnulib-tests/Makefile man/Makefile po/Makefile.in" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # 'set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # 'set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; +esac +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +@%:@ Check whether --enable-year2038 was given. +if test ${enable_year2038+y} +then : + enableval=$enable_year2038; +fi + +if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then + as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +test "X$DEFS" = X-DHAVE_CONFIG_H && DEFS= +if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GNU_MAKE_TRUE}" && test -z "${GNU_MAKE_FALSE}"; then + as_fn_error $? "conditional \"GNU_MAKE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +CONFIG_INCLUDE=lib/config.h + +if test -z "${GL_GENERATE_STDARG_H_TRUE}" && test -z "${GL_GENERATE_STDARG_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDARG_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE}"; then + as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE}"; then + as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE}"; then + as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + + gl_libobjs= + gl_ltlibobjs= + if test -n "$gl_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do + gl_libobjs="$gl_libobjs $i.$ac_objext" + gl_ltlibobjs="$gl_ltlibobjs $i.lo" + done + fi + gl_LIBOBJS=$gl_libobjs + + gl_LTLIBOBJS=$gl_ltlibobjs + + + +if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_NETINET_IN_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + gltests_libobjs= + gltests_ltlibobjs= + if test -n "$gltests_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do + gltests_libobjs="$gltests_libobjs $i.$ac_objext" + gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" + done + fi + gltests_LIBOBJS=$gltests_libobjs + + gltests_LTLIBOBJS=$gltests_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else case e in @%:@( + e) case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as 'sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else case e in @%:@( + e) as_fn_append () + { + eval $1=\$$1\$2 + } ;; +esac +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else case e in @%:@( + e) as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } ;; +esac +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_@&t@echo='printf %s\n' +as_@&t@echo_n='printf %s' + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated + +# Sed expression to map a string onto a valid variable name. +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by GNU diffutils $as_me 3.6, which was +generated by GNU Autoconf 2.72. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_links="$ac_config_links" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +'$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration links: +$config_links + +Configuration commands: +$config_commands + +Report bugs to . +GNU diffutils home page: . +General help using GNU software: ." + +_ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config='$ac_cs_config_escaped' +ac_cs_version="\\ +GNU diffutils config.status 3.6 +configured by $0, generated by GNU Autoconf 2.72, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2023 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + printf "%s\n" "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + printf "%s\n" "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; + --help | --hel | -h ) + printf "%s\n" "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + printf "%s\n" "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" +GNUmakefile=$GNUmakefile +# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it + # from automake < 1.5. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "lib/config.h") CONFIG_HEADERS="$CONFIG_HEADERS lib/config.h:lib/config.hin" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "$GNUmakefile") CONFIG_LINKS="$CONFIG_LINKS $GNUmakefile:$GNUmakefile" ;; + "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "gnulib-tests/Makefile") CONFIG_FILES="$CONFIG_FILES gnulib-tests/Makefile" ;; + "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_LINKS+y} || CONFIG_LINKS=$config_links + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to '$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with './config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with './config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script 'defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain ':'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is 'configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`printf "%s\n" "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when '$srcdir' = '.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + :L) + # + # CONFIG_LINK + # + + if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then + : + else + # Prefer the file from the source tree if names are identical. + if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then + ac_source=$srcdir/$ac_source + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5 +printf "%s\n" "$as_me: linking $ac_source to $ac_file" >&6;} + + if test ! -r "$ac_source"; then + as_fn_error $? "$ac_source: file not found" "$LINENO" 5 + fi + rm -f "$ac_file" + + # Try a relative symlink, then a hard link, then a copy. + case $ac_source in + [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; + *) ac_rel_source=$ac_top_build_prefix$ac_source ;; + esac + ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || + ln "$ac_source" "$ac_file" 2>/dev/null || + cp -p "$ac_source" "$ac_file" || + as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5 + fi + ;; + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in @%:@( + *\'*) : + eval set x "$CONFIG_FILES" ;; @%:@( + *) : + set x $CONFIG_FILES ;; @%:@( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See 'config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + "po-directories":C) + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + # Treat a directory as a PO directory if and only if it has a + # POTFILES.in file. This allows packages to have multiple PO + # directories under different names or in different locations. + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/local/recipes/tools/diffutils/source/autom4te.cache/output.2 b/local/recipes/tools/diffutils/source/autom4te.cache/output.2 new file mode 100644 index 0000000000..91ee1bf58f --- /dev/null +++ b/local/recipes/tools/diffutils/source/autom4te.cache/output.2 @@ -0,0 +1,43076 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.72 for GNU diffutils 3.6. +@%:@ +@%:@ Report bugs to . +@%:@ +@%:@ +@%:@ Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, +@%:@ Inc. +@%:@ +@%:@ +@%:@ This configure script is free software; the Free Software Foundation +@%:@ gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else case e in @%:@( + e) case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as 'sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed 'exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else case e in @%:@( + e) case \`(set -o) 2>/dev/null\` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : + +else case e in @%:@( + e) exitcode=1; echo positional parameters were not saved. ;; +esac +fi +test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null +then : + as_have_required=yes +else case e in @%:@( + e) as_have_required=no ;; +esac +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : + +else case e in @%:@( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + case $as_dir in @%:@( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$as_shell as_have_required=yes + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : + break 2 +fi +fi + done;; + esac + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else case e in @%:@( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi ;; +esac +fi + + + if test "x$CONFIG_SHELL" != x +then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed 'exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and +$0: bug-diffutils@gnu.org about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do have one." + fi + exit 1 +fi ;; +esac +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else case e in @%:@( + e) as_fn_append () + { + eval $1=\$$1\$2 + } ;; +esac +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else case e in @%:@( + e) as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } ;; +esac +fi # as_fn_arith + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + t clear + :clear + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_@&t@echo='printf %s\n' +as_@&t@echo_n='printf %s' + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated + +# Sed expression to map a string onto a valid variable name. +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='GNU diffutils' +PACKAGE_TARNAME='diffutils' +PACKAGE_VERSION='3.6' +PACKAGE_STRING='GNU diffutils 3.6' +PACKAGE_BUGREPORT='bug-diffutils@gnu.org' +PACKAGE_URL='https://www.gnu.org/software/diffutils/' + +ac_unique_file="src/diff.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_STDIO_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_c_list= +ac_func_c_list= +gl_fnmatch_required=POSIX +gl_getopt_required=POSIX +gt_needs= +enable_year2038=no +ac_subst_vars='gltests_LTLIBOBJS +gltests_LIBOBJS +gl_LTLIBOBJS +gl_LIBOBJS +CONFIG_INCLUDE +am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIB@&t@OBJS +POSUB +INTLLIBS +INTL_MACOSX_LIBS +XGETTEXT_EXTRA_OPTIONS +MSGMERGE +XGETTEXT_015 +XGETTEXT +GMSGFMT_015 +MSGFMT_015 +GMSGFMT +MSGFMT +GETTEXT_MACRO_VERSION +USE_NLS +SRC_VERSION_C +PR_PROGRAM +GNULIB_WARN_CFLAGS +WARN_CFLAGS +WERROR_CFLAGS +LIBTESTS_LIBDEPS +LIBDIFFUTILS_LTLIBDEPS +LIBDIFFUTILS_LIBDEPS +abs_aux_dir +HAVE_SYS_UIO_H +NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H +NEXT_SYS_UIO_H +NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H +NEXT_SYS_IOCTL_H +HAVE_SYS_IOCTL_H +GL_GENERATE_STDALIGN_H_FALSE +GL_GENERATE_STDALIGN_H_TRUE +STDALIGN_H +GL_GENERATE_NETINET_IN_H_FALSE +GL_GENERATE_NETINET_IN_H_TRUE +NETINET_IN_H +HAVE_NETINET_IN_H +NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H +NEXT_NETINET_IN_H +LIB_NANOSLEEP +LIB_SELECT +LIBSOCKET +HAVE_SYS_SELECT_H +NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H +NEXT_SYS_SELECT_H +REPLACE_SELECT +REPLACE_PSELECT +HAVE_PSELECT +GNULIB_SELECT +GNULIB_PSELECT +INET_PTON_LIB +LOCALE_TR_UTF8 +NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H +NEXT_ARPA_INET_H +HAVE_ARPA_INET_H +REPLACE_INET_PTON +REPLACE_INET_NTOP +HAVE_DECL_INET_PTON +HAVE_DECL_INET_NTOP +GNULIB_INET_PTON +GNULIB_INET_NTOP +HAVE_WS2TCPIP_H +HAVE_SYS_SOCKET_H +NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H +NEXT_SYS_SOCKET_H +HAVE_ACCEPT4 +HAVE_SA_FAMILY_T +HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY +HAVE_STRUCT_SOCKADDR_STORAGE +GNULIB_ACCEPT4 +GNULIB_SHUTDOWN +GNULIB_SETSOCKOPT +GNULIB_SENDTO +GNULIB_RECVFROM +GNULIB_SEND +GNULIB_RECV +GNULIB_LISTEN +GNULIB_GETSOCKOPT +GNULIB_GETSOCKNAME +GNULIB_GETPEERNAME +GNULIB_BIND +GNULIB_ACCEPT +GNULIB_CONNECT +GNULIB_SOCKET +gltests_WITNESS +NEXT_AS_FIRST_DIRECTIVE_WCHAR_H +NEXT_WCHAR_H +HAVE_FEATURES_H +LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE +LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE +LIBUNISTRING_UNIWIDTH_H +LIBUNISTRING_UNITYPES_H +LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE +LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE +LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE +LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE +LIBUNISTRING_UNISTR_H +HAVE_UNISTD_H +NEXT_AS_FIRST_DIRECTIVE_UNISTD_H +NEXT_UNISTD_H +UNISTD_H_DEFINES_STRUCT_TIMESPEC +PTHREAD_H_DEFINES_STRUCT_TIMESPEC +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC +TIME_H_DEFINES_STRUCT_TIMESPEC +NEXT_AS_FIRST_DIRECTIVE_TIME_H +NEXT_TIME_H +NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H +NEXT_SYS_WAIT_H +GNULIB_WAITPID +WINDOWS_STAT_INODES +WINDOWS_64_BIT_OFF_T +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H +NEXT_SYS_TYPES_H +HAVE_STRINGS_H +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H +NEXT_STRINGS_H +NEXT_AS_FIRST_DIRECTIVE_STRING_H +NEXT_STRING_H +HAVE_DECL_STRNCASECMP +HAVE_STRCASECMP +HAVE_FFS +GNULIB_FFS +NEXT_AS_FIRST_DIRECTIVE_STDLIB_H +NEXT_STDLIB_H +NEXT_AS_FIRST_DIRECTIVE_STDIO_H +NEXT_STDIO_H +HAVE__BOOL +GL_GENERATE_STDBOOL_H_FALSE +GL_GENERATE_STDBOOL_H_TRUE +STDBOOL_H +GL_GENERATE_STDARG_H_FALSE +GL_GENERATE_STDARG_H_TRUE +STDARG_H +NEXT_AS_FIRST_DIRECTIVE_STDARG_H +NEXT_STDARG_H +NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H +NEXT_SIGNAL_H +REPLACE_RAISE +REPLACE_PTHREAD_SIGMASK +HAVE_SIGHANDLER_T +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T +HAVE_STRUCT_SIGACTION_SA_SIGACTION +HAVE_SIGACTION +HAVE_SIGINFO_T +HAVE_SIGSET_T +HAVE_RAISE +HAVE_PTHREAD_SIGMASK +HAVE_POSIX_SIGNALBLOCKING +GNULIB_SIGACTION +GNULIB_SIGPROCMASK +GNULIB_SIGNAL_H_SIGPIPE +GNULIB_RAISE +GNULIB_PTHREAD_SIGMASK +UNDEFINE_STRTOK_R +REPLACE_STRTOK_R +REPLACE_STRSIGNAL +REPLACE_STRNLEN +REPLACE_STRNDUP +REPLACE_STRNCAT +REPLACE_STRERROR_R +REPLACE_STRERROR +REPLACE_STRCHRNUL +REPLACE_STRCASESTR +REPLACE_STRSTR +REPLACE_STRDUP +REPLACE_STPNCPY +REPLACE_MEMMEM +REPLACE_MEMCHR +HAVE_STRVERSCMP +HAVE_DECL_STRSIGNAL +HAVE_DECL_STRERROR_R +HAVE_DECL_STRTOK_R +HAVE_STRCASESTR +HAVE_STRSEP +HAVE_STRPBRK +HAVE_DECL_STRNLEN +HAVE_DECL_STRNDUP +HAVE_DECL_STRDUP +HAVE_STRCHRNUL +HAVE_STPNCPY +HAVE_STPCPY +HAVE_RAWMEMCHR +HAVE_DECL_MEMRCHR +HAVE_MEMPCPY +HAVE_DECL_MEMMEM +HAVE_MEMCHR +HAVE_FFSLL +HAVE_FFSL +HAVE_MBSLEN +GNULIB_STRVERSCMP +GNULIB_STRSIGNAL +GNULIB_STRERROR_R +GNULIB_STRERROR +GNULIB_MBSTOK_R +GNULIB_MBSSEP +GNULIB_MBSSPN +GNULIB_MBSPBRK +GNULIB_MBSCSPN +GNULIB_MBSCASESTR +GNULIB_MBSPCASECMP +GNULIB_MBSNCASECMP +GNULIB_MBSCASECMP +GNULIB_MBSSTR +GNULIB_MBSRCHR +GNULIB_MBSCHR +GNULIB_MBSNLEN +GNULIB_MBSLEN +GNULIB_STRTOK_R +GNULIB_STRCASESTR +GNULIB_STRSTR +GNULIB_STRSEP +GNULIB_STRPBRK +GNULIB_STRNLEN +GNULIB_STRNDUP +GNULIB_STRNCAT +GNULIB_STRDUP +GNULIB_STRCHRNUL +GNULIB_STPNCPY +GNULIB_STPCPY +GNULIB_RAWMEMCHR +GNULIB_MEMRCHR +GNULIB_MEMPCPY +GNULIB_MEMMEM +GNULIB_MEMCHR +GNULIB_FFSLL +GNULIB_FFSL +LOCALE_FR_UTF8 +LOCALE_ZH_CN +LOCALE_JA +REPLACE_WCTOMB +REPLACE_UNSETENV +REPLACE_STRTOD +REPLACE_SETENV +REPLACE_REALPATH +REPLACE_REALLOC +REPLACE_RANDOM_R +REPLACE_QSORT_R +REPLACE_PUTENV +REPLACE_PTSNAME_R +REPLACE_PTSNAME +REPLACE_MKSTEMP +REPLACE_MBTOWC +REPLACE_MALLOC +REPLACE_CANONICALIZE_FILE_NAME +REPLACE_CALLOC +HAVE_DECL_UNSETENV +HAVE_UNLOCKPT +HAVE_SYS_LOADAVG_H +HAVE_STRUCT_RANDOM_DATA +HAVE_STRTOULL +HAVE_STRTOLL +HAVE_STRTOD +HAVE_DECL_SETENV +HAVE_SETENV +HAVE_SECURE_GETENV +HAVE_RPMATCH +HAVE_REALPATH +HAVE_RANDOM_R +HAVE_RANDOM_H +HAVE_RANDOM +HAVE_QSORT_R +HAVE_PTSNAME_R +HAVE_PTSNAME +HAVE_POSIX_OPENPT +HAVE_MKSTEMPS +HAVE_MKSTEMP +HAVE_MKOSTEMPS +HAVE_MKOSTEMP +HAVE_MKDTEMP +HAVE_GRANTPT +HAVE_GETSUBOPT +HAVE_DECL_GETLOADAVG +HAVE_CANONICALIZE_FILE_NAME +HAVE_ATOLL +HAVE__EXIT +GNULIB_WCTOMB +GNULIB_UNSETENV +GNULIB_UNLOCKPT +GNULIB_SYSTEM_POSIX +GNULIB_STRTOULL +GNULIB_STRTOLL +GNULIB_STRTOD +GNULIB_SETENV +GNULIB_SECURE_GETENV +GNULIB_RPMATCH +GNULIB_REALPATH +GNULIB_REALLOC_POSIX +GNULIB_RANDOM_R +GNULIB_RANDOM +GNULIB_QSORT_R +GNULIB_PUTENV +GNULIB_PTSNAME_R +GNULIB_PTSNAME +GNULIB_POSIX_OPENPT +GNULIB_MKSTEMPS +GNULIB_MKSTEMP +GNULIB_MKOSTEMPS +GNULIB_MKOSTEMP +GNULIB_MKDTEMP +GNULIB_MBTOWC +GNULIB_MALLOC_POSIX +GNULIB_GRANTPT +GNULIB_GETSUBOPT +GNULIB_GETLOADAVG +GNULIB_CANONICALIZE_FILE_NAME +GNULIB_CALLOC_POSIX +GNULIB_ATOLL +GNULIB__EXIT +SED +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H +NEXT_LOCALE_H +HAVE_XLOCALE_H +NEXT_AS_FIRST_DIRECTIVE_STDDEF_H +NEXT_STDDEF_H +GL_GENERATE_STDDEF_H_FALSE +GL_GENERATE_STDDEF_H_TRUE +STDDEF_H +HAVE_WCHAR_T +HAVE_MAX_ALIGN_T +REPLACE_NULL +REPLACE_STRUCT_LCONV +REPLACE_DUPLOCALE +REPLACE_SETLOCALE +REPLACE_LOCALECONV +HAVE_DUPLOCALE +GNULIB_DUPLOCALE +GNULIB_SETLOCALE +GNULIB_LOCALECONV +LOCALCHARSET_TESTS_ENVIRONMENT +GLIBC21 +HAVE_LANGINFO_YESEXPR +HAVE_LANGINFO_ERA +HAVE_LANGINFO_T_FMT_AMPM +HAVE_LANGINFO_CODESET +HAVE_LANGINFO_H +NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H +NEXT_LANGINFO_H +REPLACE_NL_LANGINFO +HAVE_NL_LANGINFO +GNULIB_NL_LANGINFO +REPLACE_TOWLOWER +REPLACE_ISWCNTRL +HAVE_WCTYPE_H +NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H +NEXT_WCTYPE_H +HAVE_CRTDEFS_H +HAVE_WINT_T +HAVE_ISWCNTRL +REPLACE_ISWBLANK +HAVE_WCTRANS_T +HAVE_WCTYPE_T +HAVE_ISWBLANK +GNULIB_TOWCTRANS +GNULIB_WCTRANS +GNULIB_ISWCTYPE +GNULIB_WCTYPE +GNULIB_ISWBLANK +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H +NEXT_INTTYPES_H +UINT64_MAX_EQ_ULONG_MAX +UINT32_MAX_LT_UINTMAX_MAX +PRIPTR_PREFIX +PRI_MACROS_BROKEN +INT64_MAX_EQ_LONG_MAX +INT32_MAX_LT_INTMAX_MAX +REPLACE_STRTOUMAX +REPLACE_STRTOIMAX +HAVE_DECL_STRTOUMAX +HAVE_DECL_STRTOIMAX +HAVE_DECL_IMAXDIV +HAVE_DECL_IMAXABS +GNULIB_STRTOUMAX +GNULIB_STRTOIMAX +GNULIB_IMAXDIV +GNULIB_IMAXABS +GL_GENERATE_STDINT_H_FALSE +GL_GENERATE_STDINT_H_TRUE +STDINT_H +HAVE_SYS_INTTYPES_H +HAVE_SYS_BITYPES_H +HAVE_C99_STDINT_H +WINT_T_SUFFIX +WCHAR_T_SUFFIX +SIG_ATOMIC_T_SUFFIX +SIZE_T_SUFFIX +PTRDIFF_T_SUFFIX +HAVE_SIGNED_WINT_T +HAVE_SIGNED_WCHAR_T +HAVE_SIGNED_SIG_ATOMIC_T +BITSIZEOF_WINT_T +BITSIZEOF_WCHAR_T +BITSIZEOF_SIG_ATOMIC_T +BITSIZEOF_SIZE_T +BITSIZEOF_PTRDIFF_T +APPLE_UNIVERSAL_BUILD +HAVE_STDINT_H +NEXT_AS_FIRST_DIRECTIVE_STDINT_H +NEXT_STDINT_H +HAVE_SYS_TYPES_H +HAVE_INTTYPES_H +HAVE_WCHAR_H +HAVE_UNSIGNED_LONG_LONG_INT +HAVE_LONG_LONG_INT +GNULIB_OVERRIDES_WINT_T +GL_GENERATE_LIMITS_H_FALSE +GL_GENERATE_LIMITS_H_TRUE +LIMITS_H +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H +NEXT_LIMITS_H +NEXT_AS_FIRST_DIRECTIVE_ICONV_H +NEXT_ICONV_H +GL_GENERATE_ICONV_H_FALSE +GL_GENERATE_ICONV_H_TRUE +ICONV_H +REPLACE_ICONV_UTF +REPLACE_ICONV_OPEN +REPLACE_ICONV +ICONV_CONST +GNULIB_ICONV +LTLIBICONV +LIBICONV +GNU_MAKE_FALSE +GNU_MAKE_TRUE +REPLACE_LOCALTIME +REPLACE_GMTIME +REPLACE_TZSET +REPLACE_TIMEGM +REPLACE_STRFTIME +REPLACE_NANOSLEEP +REPLACE_MKTIME +REPLACE_LOCALTIME_R +REPLACE_CTIME +HAVE_TIMEZONE_T +HAVE_TZSET +HAVE_TIMEGM +HAVE_STRPTIME +HAVE_NANOSLEEP +HAVE_DECL_LOCALTIME_R +GNULIB_TZSET +GNULIB_TIME_RZ +GNULIB_TIME_R +GNULIB_TIMEGM +GNULIB_STRPTIME +GNULIB_STRFTIME +GNULIB_NANOSLEEP +GNULIB_LOCALTIME +GNULIB_MKTIME +GNULIB_CTIME +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H +NEXT_SYS_TIME_H +REPLACE_STRUCT_TIMEVAL +REPLACE_GETTIMEOFDAY +HAVE_SYS_TIME_H +HAVE_STRUCT_TIMEVAL +HAVE_GETTIMEOFDAY +GNULIB_GETTIMEOFDAY +LTLIBINTL +LIBINTL +GNULIB_GL_UNISTD_H_GETOPT +GETOPT_CDEFS_H +GETOPT_H +HAVE_SYS_CDEFS_H +HAVE_GETOPT_H +NEXT_AS_FIRST_DIRECTIVE_GETOPT_H +NEXT_GETOPT_H +WINDOWS_64_BIT_ST_SIZE +WINDOWS_STAT_TIMESPEC +NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H +NEXT_SYS_STAT_H +REPLACE_UTIMENSAT +REPLACE_STAT +REPLACE_MKNOD +REPLACE_MKFIFO +REPLACE_MKDIR +REPLACE_LSTAT +REPLACE_FUTIMENS +REPLACE_FSTATAT +REPLACE_FSTAT +HAVE_UTIMENSAT +HAVE_MKNODAT +HAVE_MKNOD +HAVE_MKFIFOAT +HAVE_MKFIFO +HAVE_MKDIRAT +HAVE_LSTAT +HAVE_LCHMOD +HAVE_FUTIMENS +HAVE_FSTATAT +HAVE_FCHMODAT +GNULIB_OVERRIDES_STRUCT_STAT +GNULIB_UTIMENSAT +GNULIB_STAT +GNULIB_MKNODAT +GNULIB_MKNOD +GNULIB_MKFIFOAT +GNULIB_MKFIFO +GNULIB_MKDIRAT +GNULIB_LSTAT +GNULIB_LCHMOD +GNULIB_FUTIMENS +GNULIB_FSTATAT +GNULIB_FSTAT +GNULIB_FCHMODAT +REPLACE_VSPRINTF +REPLACE_VSNPRINTF +REPLACE_VPRINTF +REPLACE_VFPRINTF +REPLACE_VDPRINTF +REPLACE_VASPRINTF +REPLACE_TMPFILE +REPLACE_STDIO_WRITE_FUNCS +REPLACE_STDIO_READ_FUNCS +REPLACE_SPRINTF +REPLACE_SNPRINTF +REPLACE_RENAMEAT +REPLACE_RENAME +REPLACE_REMOVE +REPLACE_PRINTF +REPLACE_POPEN +REPLACE_PERROR +REPLACE_OBSTACK_PRINTF +REPLACE_GETLINE +REPLACE_GETDELIM +REPLACE_FTELLO +REPLACE_FTELL +REPLACE_FSEEKO +REPLACE_FSEEK +REPLACE_FREOPEN +REPLACE_FPURGE +REPLACE_FPRINTF +REPLACE_FOPEN +REPLACE_FFLUSH +REPLACE_FDOPEN +REPLACE_FCLOSE +REPLACE_DPRINTF +HAVE_VDPRINTF +HAVE_VASPRINTF +HAVE_RENAMEAT +HAVE_POPEN +HAVE_PCLOSE +HAVE_FTELLO +HAVE_FSEEKO +HAVE_DPRINTF +HAVE_DECL_VSNPRINTF +HAVE_DECL_SNPRINTF +HAVE_DECL_OBSTACK_PRINTF +HAVE_DECL_GETLINE +HAVE_DECL_GETDELIM +HAVE_DECL_FTELLO +HAVE_DECL_FSEEKO +HAVE_DECL_FPURGE +GNULIB_VSPRINTF_POSIX +GNULIB_VSNPRINTF +GNULIB_VPRINTF_POSIX +GNULIB_VPRINTF +GNULIB_VFPRINTF_POSIX +GNULIB_VFPRINTF +GNULIB_VDPRINTF +GNULIB_VSCANF +GNULIB_VFSCANF +GNULIB_VASPRINTF +GNULIB_TMPFILE +GNULIB_STDIO_H_SIGPIPE +GNULIB_STDIO_H_NONBLOCKING +GNULIB_SPRINTF_POSIX +GNULIB_SNPRINTF +GNULIB_SCANF +GNULIB_RENAMEAT +GNULIB_RENAME +GNULIB_REMOVE +GNULIB_PUTS +GNULIB_PUTCHAR +GNULIB_PUTC +GNULIB_PRINTF_POSIX +GNULIB_PRINTF +GNULIB_POPEN +GNULIB_PERROR +GNULIB_PCLOSE +GNULIB_OBSTACK_PRINTF_POSIX +GNULIB_OBSTACK_PRINTF +GNULIB_GETLINE +GNULIB_GETDELIM +GNULIB_GETCHAR +GNULIB_GETC +GNULIB_FWRITE +GNULIB_FTELLO +GNULIB_FTELL +GNULIB_FSEEKO +GNULIB_FSEEK +GNULIB_FSCANF +GNULIB_FREOPEN +GNULIB_FREAD +GNULIB_FPUTS +GNULIB_FPUTC +GNULIB_FPURGE +GNULIB_FPRINTF_POSIX +GNULIB_FPRINTF +GNULIB_FOPEN +GNULIB_FGETS +GNULIB_FGETC +GNULIB_FFLUSH +GNULIB_FDOPEN +GNULIB_FCLOSE +GNULIB_DPRINTF +GL_GENERATE_FNMATCH_H_FALSE +GL_GENERATE_FNMATCH_H_TRUE +FNMATCH_H +REPLACE_ITOLD +GL_GENERATE_FLOAT_H_FALSE +GL_GENERATE_FLOAT_H_TRUE +FLOAT_H +NEXT_AS_FIRST_DIRECTIVE_FLOAT_H +NEXT_FLOAT_H +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H +NEXT_FCNTL_H +REPLACE_OPENAT +REPLACE_OPEN +REPLACE_FCNTL +HAVE_OPENAT +HAVE_FCNTL +GNULIB_OPENAT +GNULIB_OPEN +GNULIB_NONBLOCKING +GNULIB_FCNTL +EOVERFLOW_VALUE +EOVERFLOW_HIDDEN +ENOLINK_VALUE +ENOLINK_HIDDEN +EMULTIHOP_VALUE +EMULTIHOP_HIDDEN +GL_GENERATE_ERRNO_H_FALSE +GL_GENERATE_ERRNO_H_TRUE +ERRNO_H +NEXT_AS_FIRST_DIRECTIVE_ERRNO_H +NEXT_ERRNO_H +NEXT_AS_FIRST_DIRECTIVE_CTYPE_H +NEXT_CTYPE_H +PRAGMA_COLUMNS +PRAGMA_SYSTEM_HEADER +INCLUDE_NEXT_AS_FIRST_DIRECTIVE +INCLUDE_NEXT +HAVE_ISBLANK +GNULIB_ISBLANK +pkglibexecdir +lispdir +HAVE_WINSOCK2_H +REPLACE_IOCTL +SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS +SYS_IOCTL_H_HAVE_WINSOCK2_H +GNULIB_IOCTL +HAVE_MSVC_INVALID_PARAMETER_HANDLER +UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS +UNISTD_H_HAVE_WINSOCK2_H +REPLACE_WRITE +REPLACE_USLEEP +REPLACE_UNLINKAT +REPLACE_UNLINK +REPLACE_TTYNAME_R +REPLACE_TRUNCATE +REPLACE_SYMLINKAT +REPLACE_SYMLINK +REPLACE_SLEEP +REPLACE_RMDIR +REPLACE_READLINKAT +REPLACE_READLINK +REPLACE_READ +REPLACE_PWRITE +REPLACE_PREAD +REPLACE_LSEEK +REPLACE_LINKAT +REPLACE_LINK +REPLACE_LCHOWN +REPLACE_ISATTY +REPLACE_GETPAGESIZE +REPLACE_GETGROUPS +REPLACE_GETLOGIN_R +REPLACE_GETDTABLESIZE +REPLACE_GETDOMAINNAME +REPLACE_GETCWD +REPLACE_FTRUNCATE +REPLACE_FCHOWNAT +REPLACE_DUP2 +REPLACE_DUP +REPLACE_CLOSE +REPLACE_CHOWN +HAVE_SYS_PARAM_H +HAVE_OS_H +HAVE_DECL_TTYNAME_R +HAVE_DECL_SETHOSTNAME +HAVE_DECL_GETUSERSHELL +HAVE_DECL_GETPAGESIZE +HAVE_DECL_GETLOGIN_R +HAVE_DECL_GETLOGIN +HAVE_DECL_GETDOMAINNAME +HAVE_DECL_FDATASYNC +HAVE_DECL_FCHDIR +HAVE_DECL_ENVIRON +HAVE_USLEEP +HAVE_UNLINKAT +HAVE_TRUNCATE +HAVE_SYMLINKAT +HAVE_SYMLINK +HAVE_SLEEP +HAVE_SETHOSTNAME +HAVE_READLINKAT +HAVE_READLINK +HAVE_PWRITE +HAVE_PREAD +HAVE_PIPE2 +HAVE_PIPE +HAVE_LINKAT +HAVE_LINK +HAVE_LCHOWN +HAVE_GROUP_MEMBER +HAVE_GETPAGESIZE +HAVE_GETLOGIN +HAVE_GETHOSTNAME +HAVE_GETGROUPS +HAVE_GETDTABLESIZE +HAVE_FTRUNCATE +HAVE_FSYNC +HAVE_FDATASYNC +HAVE_FCHOWNAT +HAVE_FCHDIR +HAVE_FACCESSAT +HAVE_EUIDACCESS +HAVE_DUP3 +HAVE_DUP2 +HAVE_CHOWN +GNULIB_WRITE +GNULIB_USLEEP +GNULIB_UNLINKAT +GNULIB_UNLINK +GNULIB_UNISTD_H_SIGPIPE +GNULIB_UNISTD_H_NONBLOCKING +GNULIB_TTYNAME_R +GNULIB_TRUNCATE +GNULIB_SYMLINKAT +GNULIB_SYMLINK +GNULIB_SLEEP +GNULIB_SETHOSTNAME +GNULIB_RMDIR +GNULIB_READLINKAT +GNULIB_READLINK +GNULIB_READ +GNULIB_PWRITE +GNULIB_PREAD +GNULIB_PIPE2 +GNULIB_PIPE +GNULIB_LSEEK +GNULIB_LINKAT +GNULIB_LINK +GNULIB_LCHOWN +GNULIB_ISATTY +GNULIB_GROUP_MEMBER +GNULIB_GETUSERSHELL +GNULIB_GETPAGESIZE +GNULIB_GETLOGIN_R +GNULIB_GETLOGIN +GNULIB_GETHOSTNAME +GNULIB_GETGROUPS +GNULIB_GETDTABLESIZE +GNULIB_GETDOMAINNAME +GNULIB_GETCWD +GNULIB_FTRUNCATE +GNULIB_FSYNC +GNULIB_FDATASYNC +GNULIB_FCHOWNAT +GNULIB_FCHDIR +GNULIB_FACCESSAT +GNULIB_EUIDACCESS +GNULIB_ENVIRON +GNULIB_DUP3 +GNULIB_DUP2 +GNULIB_DUP +GNULIB_CLOSE +GNULIB_CHOWN +GNULIB_CHDIR +LIB_CLOCK_GETTIME +LTLIBCSTACK +LIBCSTACK +LIBSIGSEGV_PREFIX +LTLIBSIGSEGV +LIBSIGSEGV +HAVE_LIBSIGSEGV +LOCALE_FR +REPLACE_WCSFTIME +REPLACE_WCSWIDTH +REPLACE_WCWIDTH +REPLACE_WCSNRTOMBS +REPLACE_WCSRTOMBS +REPLACE_WCRTOMB +REPLACE_MBSNRTOWCS +REPLACE_MBSRTOWCS +REPLACE_MBRLEN +REPLACE_MBRTOWC +REPLACE_MBSINIT +REPLACE_WCTOB +REPLACE_BTOWC +REPLACE_MBSTATE_T +HAVE_DECL_WCWIDTH +HAVE_DECL_WCTOB +HAVE_WCSFTIME +HAVE_WCSWIDTH +HAVE_WCSTOK +HAVE_WCSSTR +HAVE_WCSPBRK +HAVE_WCSSPN +HAVE_WCSCSPN +HAVE_WCSRCHR +HAVE_WCSCHR +HAVE_WCSDUP +HAVE_WCSXFRM +HAVE_WCSCOLL +HAVE_WCSNCASECMP +HAVE_WCSCASECMP +HAVE_WCSNCMP +HAVE_WCSCMP +HAVE_WCSNCAT +HAVE_WCSCAT +HAVE_WCPNCPY +HAVE_WCSNCPY +HAVE_WCPCPY +HAVE_WCSCPY +HAVE_WCSNLEN +HAVE_WCSLEN +HAVE_WMEMSET +HAVE_WMEMMOVE +HAVE_WMEMCPY +HAVE_WMEMCMP +HAVE_WMEMCHR +HAVE_WCSNRTOMBS +HAVE_WCSRTOMBS +HAVE_WCRTOMB +HAVE_MBSNRTOWCS +HAVE_MBSRTOWCS +HAVE_MBRLEN +HAVE_MBRTOWC +HAVE_MBSINIT +HAVE_BTOWC +GNULIB_WCSFTIME +GNULIB_WCSWIDTH +GNULIB_WCSTOK +GNULIB_WCSSTR +GNULIB_WCSPBRK +GNULIB_WCSSPN +GNULIB_WCSCSPN +GNULIB_WCSRCHR +GNULIB_WCSCHR +GNULIB_WCSDUP +GNULIB_WCSXFRM +GNULIB_WCSCOLL +GNULIB_WCSNCASECMP +GNULIB_WCSCASECMP +GNULIB_WCSNCMP +GNULIB_WCSCMP +GNULIB_WCSNCAT +GNULIB_WCSCAT +GNULIB_WCPNCPY +GNULIB_WCSNCPY +GNULIB_WCPCPY +GNULIB_WCSCPY +GNULIB_WCSNLEN +GNULIB_WCSLEN +GNULIB_WMEMSET +GNULIB_WMEMMOVE +GNULIB_WMEMCPY +GNULIB_WMEMCMP +GNULIB_WMEMCHR +GNULIB_WCWIDTH +GNULIB_WCSNRTOMBS +GNULIB_WCSRTOMBS +GNULIB_WCRTOMB +GNULIB_MBSNRTOWCS +GNULIB_MBSRTOWCS +GNULIB_MBRLEN +GNULIB_MBRTOWC +GNULIB_MBSINIT +GNULIB_WCTOB +GNULIB_BTOWC +GL_GENERATE_ALLOCA_H_FALSE +GL_GENERATE_ALLOCA_H_TRUE +ALLOCA_H +ALLOCA +GL_COND_LIBTOOL_FALSE +GL_COND_LIBTOOL_TRUE +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +ARFLAGS +AR +CPP +RANLIB +HELP2MAN +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__xargs_n +am__rm_f_notfound +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +CSCOPE +ETAGS +CTAGS +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +enable_largefile +with_gnu_ld +enable_rpath +with_libsigsegv_prefix +with_libiconv_prefix +with_included_regex +with_packager +with_packager_version +with_packager_bug_reports +enable_gcc_warnings +enable_nls +with_libintl_prefix +enable_year2038 +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: '$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +'configure' configures GNU diffutils 3.6 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print 'checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for '--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or '..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + @<:@@S|@ac_default_prefix@:>@ + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + @<:@PREFIX@:>@ + +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/diffutils@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of GNU diffutils 3.6:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --disable-largefile omit support for large files + --disable-rpath do not hardcode runtime library paths + --enable-gcc-warnings turn on lots of GCC warnings (for developers) + --disable-nls do not use Native Language Support + --enable-year2038 support timestamps after 2038 + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ + --with-libsigsegv-prefix[=DIR] search for libsigsegv in DIR/include and DIR/lib + --without-libsigsegv-prefix don't search for libsigsegv in includedir and libdir + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib + --without-libiconv-prefix don't search for libiconv in includedir and libdir + --without-included-regex + don't compile regex; this is the default on systems + with recent-enough versions of the GNU C Library + (use with caution on other systems). + --with-packager String identifying the packager of this software + --with-packager-version Packager-specific version information + --with-packager-bug-reports + Packager info for bug reports (URL/e-mail/...) + --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib + --without-libintl-prefix don't search for libintl in includedir and libdir + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by 'configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +GNU diffutils home page: . +General help using GNU software: . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +GNU diffutils configure 3.6 +generated by GNU Autoconf 2.72 + +Copyright (C) 2023 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +@%:@ ac_fn_c_try_compile LINENO +@%:@ -------------------------- +@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else case e in @%:@( + e) printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_compile + +@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists and can be compiled using the include files in +@%:@ INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else case e in @%:@( + e) eval "$3=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_header_compile + +@%:@ ac_fn_c_try_cpp LINENO +@%:@ ---------------------- +@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else case e in @%:@( + e) printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_cpp + +@%:@ ac_fn_c_check_type LINENO TYPE VAR INCLUDES +@%:@ ------------------------------------------- +@%:@ Tests whether TYPE exists after having included INCLUDES, setting cache +@%:@ variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in @%:@( + e) eval "$3=yes" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_type + +@%:@ ac_fn_c_try_link LINENO +@%:@ ----------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else case e in @%:@( + e) printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_link + +@%:@ ac_fn_c_try_run LINENO +@%:@ ---------------------- +@%:@ Try to run conftest.@S|@ac_ext, and return whether this succeeded. Assumes that +@%:@ executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else case e in @%:@( + e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status ;; +esac +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_run + +@%:@ ac_fn_c_check_func LINENO FUNC VAR +@%:@ ---------------------------------- +@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (void); below. */ + +#include +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (void); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main (void) +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$3=yes" +else case e in @%:@( + e) eval "$3=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_func + +@%:@ ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +@%:@ ------------------------------------------------------------------ +@%:@ Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +@%:@ accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else case e in @%:@( + e) eval "$3=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_check_decl + +@%:@ ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +@%:@ -------------------------------------------- +@%:@ Tries to find the compile-time value of EXPR in a program that includes +@%:@ INCLUDES, setting VAR accordingly. Returns whether the value could be +@%:@ computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array @<:@1 - 2 * !(($2) >= 0)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array @<:@1 - 2 * !(($2) <= $ac_mid)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid; break +else case e in @%:@( + e) as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array @<:@1 - 2 * !(($2) < 0)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array @<:@1 - 2 * !(($2) >= $ac_mid)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=$ac_mid; break +else case e in @%:@( + e) as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else case e in @%:@( + e) ac_lo= ac_hi= ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array @<:@1 - 2 * !(($2) <= $ac_mid)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid +else case e in @%:@( + e) as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +done +case $ac_lo in @%:@(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval (void) { return $2; } +static unsigned long int ulongval (void) { return $2; } +@%:@include +@%:@include +int +main (void) +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + echo >>conftest.val; read $3 &5 +printf %s "checking for $2.$3... " >&6; } +if eval test \${$4+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$4=yes" +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$4=yes" +else case e in @%:@( + e) eval "$4=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$4 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_member +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?@<:@ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by GNU diffutils $as_me 3.6, which was +generated by GNU Autoconf 2.72. Invocation command line was + + $ $0$ac_configure_args_raw + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + { + echo + + printf "%s\n" "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + printf "%s\n" "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + printf "%s\n" "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + printf "%s\n" "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +printf "%s\n" "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +printf "%s\n" "@%:@define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +printf "%s\n" "@%:@define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +printf "%s\n" "@%:@define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +printf "%s\n" "@%:@define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +printf "%s\n" "@%:@define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +printf "%s\n" "@%:@define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + ac_site_files="$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" +else + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +fi + +for ac_site_file in $ac_site_files +do + case $ac_site_file in @%:@( + */*) : + ;; @%:@( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See 'config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif + +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (char **p, int i) +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +/* Does the compiler advertise C99 conformance? */ +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +// See if C++-style comments work. + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); +extern void free (void *); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +/* Does the compiler advertise C11 conformance? */ +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +as_fn_append ac_func_c_list " btowc HAVE_BTOWC" +as_fn_append ac_func_c_list " setrlimit HAVE_SETRLIMIT" +as_fn_append ac_header_c_list " ucontext.h ucontext_h HAVE_UCONTEXT_H" +as_fn_append ac_func_c_list " sigaltstack HAVE_SIGALTSTACK" +as_fn_append ac_func_c_list " readlinkat HAVE_READLINKAT" +as_fn_append ac_func_c_list " _set_invalid_parameter_handler HAVE__SET_INVALID_PARAMETER_HANDLER" +as_fn_append ac_header_c_list " sys/socket.h sys_socket_h HAVE_SYS_SOCKET_H" +as_fn_append ac_func_c_list " fcntl HAVE_FCNTL" +as_fn_append ac_func_c_list " symlink HAVE_SYMLINK" +as_fn_append ac_func_c_list " mempcpy HAVE_MEMPCPY" +as_fn_append ac_func_c_list " isblank HAVE_ISBLANK" +as_fn_append ac_func_c_list " iswctype HAVE_ISWCTYPE" +as_fn_append ac_func_c_list " mbsrtowcs HAVE_MBSRTOWCS" +as_fn_append ac_func_c_list " wmemchr HAVE_WMEMCHR" +as_fn_append ac_func_c_list " wmemcpy HAVE_WMEMCPY" +as_fn_append ac_func_c_list " wmempcpy HAVE_WMEMPCPY" +as_fn_append ac_header_c_list " wctype.h wctype_h HAVE_WCTYPE_H" +gl_fnmatch_required=GNU +as_fn_append ac_func_c_list " getdtablesize HAVE_GETDTABLESIZE" +gl_getopt_required=GNU +as_fn_append ac_header_c_list " getopt.h getopt_h HAVE_GETOPT_H" +as_fn_append ac_header_c_list " sys/cdefs.h sys_cdefs_h HAVE_SYS_CDEFS_H" +as_fn_append ac_func_c_list " getprogname HAVE_GETPROGNAME" +as_fn_append ac_func_c_list " getexecname HAVE_GETEXECNAME" +as_fn_append ac_func_c_list " gettimeofday HAVE_GETTIMEOFDAY" +as_fn_append ac_func_c_list " nanotime HAVE_NANOTIME" +as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H" +as_fn_append ac_header_c_list " iconv.h iconv_h HAVE_ICONV_H" +as_fn_append ac_header_c_list " limits.h limits_h HAVE_LIMITS_H" +as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H" +as_fn_append ac_func_c_list " iswcntrl HAVE_ISWCNTRL" +as_fn_append ac_header_c_list " crtdefs.h crtdefs_h HAVE_CRTDEFS_H" +as_fn_append ac_func_c_list " iswblank HAVE_ISWBLANK" +as_fn_append ac_header_c_list " langinfo.h langinfo_h HAVE_LANGINFO_H" +as_fn_append ac_header_c_list " xlocale.h xlocale_h HAVE_XLOCALE_H" +as_fn_append ac_func_c_list " lstat HAVE_LSTAT" +as_fn_append ac_func_c_list " mbsinit HAVE_MBSINIT" +as_fn_append ac_func_c_list " mbrtowc HAVE_MBRTOWC" +as_fn_append ac_func_c_list " mbslen HAVE_MBSLEN" +as_fn_append ac_header_c_list " sys/mman.h sys_mman_h HAVE_SYS_MMAN_H" +as_fn_append ac_func_c_list " mprotect HAVE_MPROTECT" +as_fn_append ac_func_c_list " mkstemp HAVE_MKSTEMP" +as_fn_append ac_func_c_list " tzset HAVE_TZSET" +as_fn_append ac_func_c_list " nl_langinfo HAVE_NL_LANGINFO" +as_fn_append ac_header_c_list " sys/param.h sys_param_h HAVE_SYS_PARAM_H" +as_fn_append ac_func_c_list " readlink HAVE_READLINK" +as_fn_append ac_header_c_list " malloc.h malloc_h HAVE_MALLOC_H" +as_fn_append ac_func_c_list " secure_getenv HAVE_SECURE_GETENV" +as_fn_append ac_func_c_list " getuid HAVE_GETUID" +as_fn_append ac_func_c_list " geteuid HAVE_GETEUID" +as_fn_append ac_func_c_list " getgid HAVE_GETGID" +as_fn_append ac_func_c_list " getegid HAVE_GETEGID" +as_fn_append ac_func_c_list " setenv HAVE_SETENV" +as_fn_append ac_func_c_list " sigaction HAVE_SIGACTION" +as_fn_append ac_func_c_list " siginterrupt HAVE_SIGINTERRUPT" +as_fn_append ac_func_c_list " strerror_r HAVE_STRERROR_R" +as_fn_append ac_func_c_list " __xpg_strerror_r HAVE___XPG_STRERROR_R" +as_fn_append ac_func_c_list " strndup HAVE_STRNDUP" +as_fn_append ac_func_c_list " strptime HAVE_STRPTIME" +as_fn_append ac_func_c_list " strtoumax HAVE_STRTOUMAX" +as_fn_append ac_header_c_list " sys/wait.h sys_wait_h HAVE_SYS_WAIT_H" +as_fn_append ac_func_c_list " localtime_r HAVE_LOCALTIME_R" +as_fn_append ac_func_c_list " timegm HAVE_TIMEGM" +as_fn_append ac_func_c_list " vasnprintf HAVE_VASNPRINTF" +as_fn_append ac_header_c_list " features.h features_h HAVE_FEATURES_H" +as_fn_append ac_func_c_list " snprintf HAVE_SNPRINTF" +as_fn_append ac_func_c_list " wcrtomb HAVE_WCRTOMB" +as_fn_append ac_func_c_list " wcwidth HAVE_WCWIDTH" +as_fn_append ac_header_c_list " arpa/inet.h arpa_inet_h HAVE_ARPA_INET_H" +as_fn_append ac_func_c_list " ftruncate HAVE_FTRUNCATE" +as_fn_append ac_header_c_list " netdb.h netdb_h HAVE_NETDB_H" +as_fn_append ac_header_c_list " netinet/in.h netinet_in_h HAVE_NETINET_IN_H" +as_fn_append ac_func_c_list " newlocale HAVE_NEWLOCALE" +as_fn_append ac_header_c_list " sys/select.h sys_select_h HAVE_SYS_SELECT_H" +as_fn_append ac_func_c_list " pipe HAVE_PIPE" +as_fn_append ac_func_c_list " sleep HAVE_SLEEP" +as_fn_append ac_func_c_list " catgets HAVE_CATGETS" +as_fn_append ac_header_c_list " sys/ioctl.h sys_ioctl_h HAVE_SYS_IOCTL_H" +as_fn_append ac_func_c_list " shutdown HAVE_SHUTDOWN" +as_fn_append ac_header_c_list " sys/uio.h sys_uio_h HAVE_SYS_UIO_H" +as_fn_append ac_func_c_list " wctob HAVE_WCTOB" +as_fn_append ac_func_c_list " sigprocmask HAVE_SIGPROCMASK" +as_fn_append ac_func_c_list " strcasecoll HAVE_STRCASECOLL" +as_fn_append ac_func_c_list " stricoll HAVE_STRICOLL" +as_fn_append ac_header_c_list " vfork.h vfork_h HAVE_VFORK_H" +as_fn_append ac_func_c_list " fork HAVE_FORK" +as_fn_append ac_func_c_list " vfork HAVE_VFORK" +gt_needs="$gt_needs need-ngettext" + +# Auxiliary files required by this configure script. +ac_aux_files="config.rpath config.guess config.sub compile missing install-sh" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}/build-aux" + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else case e in @%:@( + e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; +esac +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_@&t@config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_@&t@config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_@&t@configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + +am__api_version='1.18' + + + + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in @%:@(( + ./ | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + ;; +esac +fi + if test ${ac_cv_path_install+y}; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether sleep supports fractional seconds" >&5 +printf %s "checking whether sleep supports fractional seconds... " >&6; } +if test ${am_cv_sleep_fractional_seconds+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if sleep 0.001 2>/dev/null +then : + am_cv_sleep_fractional_seconds=yes +else case e in @%:@( + e) am_cv_sleep_fractional_seconds=no ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_sleep_fractional_seconds" >&5 +printf "%s\n" "$am_cv_sleep_fractional_seconds" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking filesystem timestamp resolution" >&5 +printf %s "checking filesystem timestamp resolution... " >&6; } +if test ${am_cv_filesystem_timestamp_resolution+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # Default to the worst case. +am_cv_filesystem_timestamp_resolution=2 + +# Only try to go finer than 1 sec if sleep can do it. +# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, +# - 1 sec is not much of a win compared to 2 sec, and +# - it takes 2 seconds to perform the test whether 1 sec works. +# +# Instead, just use the default 2s on platforms that have 1s resolution, +# accept the extra 1s delay when using $sleep in the Automake tests, in +# exchange for not incurring the 2s delay for running the test for all +# packages. +# +am_try_resolutions= +if test "$am_cv_sleep_fractional_seconds" = yes; then + # Even a millisecond often causes a bunch of false positives, + # so just try a hundredth of a second. The time saved between .001 and + # .01 is not terribly consequential. + am_try_resolutions="0.01 0.1 $am_try_resolutions" +fi + +# In order to catch current-generation FAT out, we must *modify* files +# that already exist; the *creation* timestamp is finer. Use names +# that make ls -t sort them differently when they have equal +# timestamps than when they have distinct timestamps, keeping +# in mind that ls -t prints the *newest* file first. +rm -f conftest.ts? +: > conftest.ts1 +: > conftest.ts2 +: > conftest.ts3 + +# Make sure ls -t actually works. Do 'set' in a subshell so we don't +# clobber the current shell's arguments. (Outer-level square brackets +# are removed by m4; they're present so that m4 does not expand +# ; be careful, easy to get confused.) +if ( + set X `ls -t conftest.ts[12]` && + { + test "$*" != "X conftest.ts1 conftest.ts2" || + test "$*" != "X conftest.ts2 conftest.ts1"; + } +); then :; else + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + printf "%s\n" ""Bad output from ls -t: \"`ls -t conftest.ts[12]`\""" >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "ls -t produces unexpected output. +Make sure there is not a broken ls alias in your environment. +See 'config.log' for more details" "$LINENO" 5; } +fi + +for am_try_res in $am_try_resolutions; do + # Any one fine-grained sleep might happen to cross the boundary + # between two values of a coarser actual resolution, but if we do + # two fine-grained sleeps in a row, at least one of them will fall + # entirely within a coarse interval. + echo alpha > conftest.ts1 + sleep $am_try_res + echo beta > conftest.ts2 + sleep $am_try_res + echo gamma > conftest.ts3 + + # We assume that 'ls -t' will make use of high-resolution + # timestamps if the operating system supports them at all. + if (set X `ls -t conftest.ts?` && + test "$2" = conftest.ts3 && + test "$3" = conftest.ts2 && + test "$4" = conftest.ts1); then + # + # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, + # because we don't need to test make. + make_ok=true + if test $am_try_res != 1; then + # But if we've succeeded so far with a subsecond resolution, we + # have one more thing to check: make. It can happen that + # everything else supports the subsecond mtimes, but make doesn't; + # notably on macOS, which ships make 3.81 from 2006 (the last one + # released under GPLv2). https://bugs.gnu.org/68808 + # + # We test $MAKE if it is defined in the environment, else "make". + # It might get overridden later, but our hope is that in practice + # it does not matter: it is the system "make" which is (by far) + # the most likely to be broken, whereas if the user overrides it, + # probably they did so with a better, or at least not worse, make. + # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html + # + # Create a Makefile (real tab character here): + rm -f conftest.mk + echo 'conftest.ts1: conftest.ts2' >conftest.mk + echo ' touch conftest.ts2' >>conftest.mk + # + # Now, running + # touch conftest.ts1; touch conftest.ts2; make + # should touch ts1 because ts2 is newer. This could happen by luck, + # but most often, it will fail if make's support is insufficient. So + # test for several consecutive successes. + # + # (We reuse conftest.ts[12] because we still want to modify existing + # files, not create new ones, per above.) + n=0 + make=${MAKE-make} + until test $n -eq 3; do + echo one > conftest.ts1 + sleep $am_try_res + echo two > conftest.ts2 # ts2 should now be newer than ts1 + if $make -f conftest.mk | grep 'up to date' >/dev/null; then + make_ok=false + break # out of $n loop + fi + n=`expr $n + 1` + done + fi + # + if $make_ok; then + # Everything we know to check worked out, so call this resolution good. + am_cv_filesystem_timestamp_resolution=$am_try_res + break # out of $am_try_res loop + fi + # Otherwise, we'll go on to check the next resolution. + fi +done +rm -f conftest.ts? +# (end _am_filesystem_timestamp_resolution) + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_filesystem_timestamp_resolution" >&5 +printf "%s\n" "$am_cv_filesystem_timestamp_resolution" >&6; } + +# This check should not be cached, as it may vary across builds of +# different projects. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +am_build_env_is_sane=no +am_has_slept=no +rm -f conftest.file +for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + test "$2" = conftest.file + ); then + am_build_env_is_sane=yes + break + fi + # Just in case. + sleep "$am_cv_filesystem_timestamp_resolution" + am_has_slept=yes +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_build_env_is_sane" >&5 +printf "%s\n" "$am_build_env_is_sane" >&6; } +if test "$am_build_env_is_sane" = no; then + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi + +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1 +then : + +else case e in @%:@( + e) ( sleep "$am_cv_filesystem_timestamp_resolution" ) & + am_sleep_pid=$! + ;; +esac +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was 's,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + *'BusyBox '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + ;; +esac +fi + + test -d ./--version && rmdir ./--version + if test ${ac_cv_path_mkdir+y}; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use plain mkdir -p, + # in the hope it doesn't have the bugs of ancient mkdir. + MKDIR_P='mkdir -p' + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make ;; +esac +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +AM_DEFAULT_VERBOSITY=1 +@%:@ Check whether --enable-silent-rules was given. +if test ${enable_silent_rules+y} +then : + enableval=$enable_silent_rules; +fi + +am_make=${MAKE-make} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if printf "%s\n" 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } +AM_BACKSLASH='\' + +am__rm_f_notfound= +if (rm -f && rm -fr && rm -rf) 2>/dev/null +then : + +else case e in @%:@( + e) am__rm_f_notfound='""' ;; +esac +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking xargs -n works" >&5 +printf %s "checking xargs -n works... " >&6; } +if test ${am_cv_xargs_n_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 +3" +then : + am_cv_xargs_n_works=yes +else case e in @%:@( + e) am_cv_xargs_n_works=no ;; +esac +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_xargs_n_works" >&5 +printf "%s\n" "$am_cv_xargs_n_works" >&6; } +if test "$am_cv_xargs_n_works" = yes +then : + am__xargs_n='xargs -n' +else case e in @%:@( + e) am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "" "$am__xargs_n_arg"; done; }' + ;; +esac +fi + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='diffutils' + VERSION='3.6' + + +printf "%s\n" "@%:@define PACKAGE \"$PACKAGE\"" >>confdefs.h + + +printf "%s\n" "@%:@define VERSION \"$VERSION\"" >>confdefs.h + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar plaintar pax cpio none' + +# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 +printf %s "checking whether UID '$am_uid' is supported by ustar format... " >&6; } + if test x$am_uid = xunknown; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&5 +printf "%s\n" "$as_me: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&2;} + elif test $am_uid -le $am_max_uid; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + _am_tools=none + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 +printf %s "checking whether GID '$am_gid' is supported by ustar format... " >&6; } + if test x$gm_gid = xunknown; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&5 +printf "%s\n" "$as_me: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&2;} + elif test $am_gid -le $am_max_gid; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + _am_tools=none + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 +printf %s "checking how to create a ustar tar archive... " >&6; } + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_ustar-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + { echo "$as_me:$LINENO: $_am_tar --version" >&5 + ($_am_tar --version) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && break + done + am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x ustar -w "$$tardir"' + am__tar_='pax -L -x ustar -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H ustar -L' + am__tar_='find "$tardir" -print | cpio -o -H ustar -L' + am__untar='cpio -i -H ustar -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_ustar}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 + (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + rm -rf conftest.dir + if test -s conftest.tar; then + { echo "$as_me:$LINENO: $am__untar &5 + ($am__untar &5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 + (cat conftest.dir/file) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + if test ${am_cv_prog_tar_ustar+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) am_cv_prog_tar_ustar=$_am_tool ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 +printf "%s\n" "$am_cv_prog_tar_ustar" >&6; } + + + + + +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + + + + + + + +AM_DEFAULT_VERBOSITY=0 + + # make --enable-silent-rules the default. + +ac_config_headers="$ac_config_headers lib/config.h:lib/config.hin" + + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $@%:@ != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See 'config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. +# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an '-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else case e in @%:@( + e) ac_file='' ;; +esac +fi +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See 'config.log' for more details" "$LINENO" 5; } +else case e in @%:@( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else case e in @%:@( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See 'config.log' for more details" "$LINENO" 5; } ;; +esac +fi +rm -f conftest conftest$ac_cv_exeext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main (void) +{ +FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else case e in @%:@( + e) printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See 'config.log' for more details" "$LINENO" 5; } ;; +esac +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else case e in @%:@( + e) ac_compiler_gnu=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else case e in @%:@( + e) CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in @%:@( + e) ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in @%:@( + e) if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in @%:@( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in @%:@( + e) if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in @%:@( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in @%:@( + e) if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in @%:@( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 ;; +esac +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + # aligned with autoconf, so not including core; see bug#72225. + rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \ + conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \ + conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM + unset am_i ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in @%:@( + '0:this is the am__doit target') : + case $s in @%:@( + BSD) : + am__include='.include' am__quote='"' ;; @%:@( + *) : + am__include='include' am__quote='' ;; +esac ;; @%:@( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } + +@%:@ Check whether --enable-dependency-tracking was given. +if test ${enable_dependency_tracking+y} +then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thus: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + + +HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"} + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "@%:@define STDC_HEADERS 1" >>confdefs.h + +fi + + ac_fn_c_check_header_compile "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes +then : + MINIX=yes +else case e in @%:@( + e) MINIX= ;; +esac +fi + + if test "$MINIX" = yes; then + +printf "%s\n" "@%:@define _POSIX_SOURCE 1" >>confdefs.h + + +printf "%s\n" "@%:@define _POSIX_1_SOURCE 2" >>confdefs.h + + +printf "%s\n" "@%:@define _MINIX 1" >>confdefs.h + + +printf "%s\n" "@%:@define _NETBSD_SOURCE 1" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test ${ac_cv_safe_to_define___extensions__+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_safe_to_define___extensions__=yes +else case e in @%:@( + e) ac_cv_safe_to_define___extensions__=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + printf "%s\n" "@%:@define __EXTENSIONS__ 1" >>confdefs.h + + printf "%s\n" "@%:@define _ALL_SOURCE 1" >>confdefs.h + + printf "%s\n" "@%:@define _DARWIN_C_SOURCE 1" >>confdefs.h + + printf "%s\n" "@%:@define _GNU_SOURCE 1" >>confdefs.h + + printf "%s\n" "@%:@define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h + + printf "%s\n" "@%:@define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h + + printf "%s\n" "@%:@define _TANDEM_SOURCE 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 +printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } +if test ${ac_cv_should_define__xopen_source+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_should_define__xopen_source=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define _XOPEN_SOURCE 500 + #include + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_should_define__xopen_source=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 +printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } + test $ac_cv_should_define__xopen_source = yes && + printf "%s\n" "@%:@define _XOPEN_SOURCE 500" >>confdefs.h + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else case e in @%:@( + e) # Broken: fails on valid input. +continue ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else case e in @%:@( + e) # Passes both tests. +ac_preproc_ok=: +break ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + break +fi + + done + ac_cv_prog_CPP=$CPP + ;; +esac +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else case e in @%:@( + e) # Broken: fails on valid input. +continue ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else case e in @%:@( + e) # Passes both tests. +ac_preproc_ok=: +break ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + +else case e in @%:@( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See 'config.log' for more details" "$LINENO" 5; } ;; +esac +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5 +printf %s "checking for egrep -e... " >&6; } +if test ${ac_cv_path_EGREP_TRADITIONAL+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in @%:@( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +@%:@( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + : + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + + if test "$ac_cv_path_EGREP_TRADITIONAL" +then : + ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E" +else case e in @%:@( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in @%:@( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +@%:@( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + ;; +esac +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5 +printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; } + EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5 +printf %s "checking for Minix Amsterdam compiler... " >&6; } +if test ${gl_cv_c_amsterdam_compiler+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __ACK__ +Amsterdam +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "Amsterdam" >/dev/null 2>&1 +then : + gl_cv_c_amsterdam_compiler=yes +else case e in @%:@( + e) gl_cv_c_amsterdam_compiler=no ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5 +printf "%s\n" "$gl_cv_c_amsterdam_compiler" >&6; } + + if test $gl_cv_c_amsterdam_compiler = yes; then + if test -z "$AR"; then + AR='cc -c.a' + fi + if test -z "$ARFLAGS"; then + ARFLAGS='-o' + fi + else + : + fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="ar" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + + if test -z "$ARFLAGS"; then + ARFLAGS='cr' + fi + + + + if test -z "$RANLIB"; then + if test $gl_cv_c_amsterdam_compiler = yes; then + RANLIB=':' + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + fi + fi + + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + + + + # IEEE behaviour is the default on all CPUs except Alpha and SH + # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 + # and the GCC 4.1.2 manual). + case "$host_cpu" in + alpha*) + # On Alpha systems, a compiler option provides the behaviour. + # See the ieee(3) manual page, also available at + # + if test -n "$GCC"; then + # GCC has the option -mieee. + # For full IEEE compliance (rarely needed), use option -mieee-with-inexact. + CPPFLAGS="$CPPFLAGS -mieee" + else + # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact. + # For full IEEE compliance (rarely needed), use option -ieee_with_inexact. + CPPFLAGS="$CPPFLAGS -ieee" + fi + ;; + sh*) + if test -n "$GCC"; then + # GCC has the option -mieee. + CPPFLAGS="$CPPFLAGS -mieee" + fi + ;; + esac + +@%:@ Check whether --enable-largefile was given. +if test ${enable_largefile+y} +then : + enableval=$enable_largefile; +fi +if test "$enable_largefile,$enable_year2038" != no,no +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable large file support" >&5 +printf %s "checking for $CC option to enable large file support... " >&6; } +if test ${ac_cv_sys_largefile_opts+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_save_CC="$CC" + ac_opt_found=no + for ac_opt in "none needed" "-D_FILE_OFFSET_BITS=64" "-D_LARGE_FILES=1" "-n32"; do + if test x"$ac_opt" != x"none needed" +then : + CC="$ac_save_CC $ac_opt" +fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +@%:@ifndef FTYPE +@%:@ define FTYPE off_t +@%:@endif + /* Check that FTYPE can represent 2**63 - 1 correctly. + We can't simply define LARGE_FTYPE to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +@%:@define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31)) + int FTYPE_is_large[(LARGE_FTYPE % 2147483629 == 721 + && LARGE_FTYPE % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_opt" = x"none needed" +then : + # GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t. + CC="$CC -DFTYPE=ino_t" + if ac_fn_c_try_compile "$LINENO" +then : + +else case e in @%:@( + e) CC="$CC -D_FILE_OFFSET_BITS=64" + if ac_fn_c_try_compile "$LINENO" +then : + ac_opt='-D_FILE_OFFSET_BITS=64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam +fi + ac_cv_sys_largefile_opts=$ac_opt + ac_opt_found=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test $ac_opt_found = no || break + done + CC="$ac_save_CC" + + + if test $ac_opt_found != yes; then + case $host_os in @%:@( + mingw* | windows*) : + ac_cv_sys_largefile_opts="supported through gnulib" + ac_opt_found=yes + ;; @%:@( + *) : + ;; +esac + fi + + test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected" ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_opts" >&5 +printf "%s\n" "$ac_cv_sys_largefile_opts" >&6; } + +ac_have_largefile=yes +case $ac_cv_sys_largefile_opts in @%:@( + "none needed") : + ;; @%:@( + "supported through gnulib") : + ;; @%:@( + "support not detected") : + ac_have_largefile=no ;; @%:@( + "-D_FILE_OFFSET_BITS=64") : + +printf "%s\n" "@%:@define _FILE_OFFSET_BITS 64" >>confdefs.h + ;; @%:@( + "-D_LARGE_FILES=1") : + +printf "%s\n" "@%:@define _LARGE_FILES 1" >>confdefs.h + ;; @%:@( + "-n32") : + CC="$CC -n32" ;; @%:@( + *) : + as_fn_error $? "internal error: bad value for \$ac_cv_sys_largefile_opts" "$LINENO" 5 ;; +esac + +if test "$enable_year2038" != no +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option for timestamps after 2038" >&5 +printf %s "checking for $CC option for timestamps after 2038... " >&6; } +if test ${ac_cv_sys_year2038_opts+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_save_CPPFLAGS="$CPPFLAGS" + ac_opt_found=no + for ac_opt in "none needed" "-D_TIME_BITS=64" "-D__MINGW_USE_VC2005_COMPAT" "-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT"; do + if test x"$ac_opt" != x"none needed" +then : + CPPFLAGS="$ac_save_CPPFLAGS $ac_opt" +fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + /* Check that time_t can represent 2**32 - 1 correctly. */ + #define LARGE_TIME_T \\ + ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30))) + int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535 + && LARGE_TIME_T % 65537 == 0) + ? 1 : -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_year2038_opts="$ac_opt" + ac_opt_found=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test $ac_opt_found = no || break + done + CPPFLAGS="$ac_save_CPPFLAGS" + test $ac_opt_found = yes || ac_cv_sys_year2038_opts="support not detected" ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_year2038_opts" >&5 +printf "%s\n" "$ac_cv_sys_year2038_opts" >&6; } + +ac_have_year2038=yes +case $ac_cv_sys_year2038_opts in @%:@( + "none needed") : + ;; @%:@( + "support not detected") : + ac_have_year2038=no ;; @%:@( + "-D_TIME_BITS=64") : + +printf "%s\n" "@%:@define _TIME_BITS 64" >>confdefs.h + ;; @%:@( + "-D__MINGW_USE_VC2005_COMPAT") : + +printf "%s\n" "@%:@define __MINGW_USE_VC2005_COMPAT 1" >>confdefs.h + ;; @%:@( + "-U_USE_32_BIT_TIME_T"*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "the 'time_t' type is currently forced to be 32-bit. It +will stop working after mid-January 2038. Remove +_USE_32BIT_TIME_T from the compiler flags. +See 'config.log' for more details" "$LINENO" 5; } ;; @%:@( + *) : + as_fn_error $? "internal error: bad value for \$ac_cv_sys_year2038_opts" "$LINENO" 5 ;; +esac + +fi + +fi + + + + # Pre-early section. + + + + + # Code from module absolute-header: + # Code from module accept: + # Code from module accept-tests: + # Code from module alloca: + # Code from module alloca-opt: + # Code from module alloca-opt-tests: + # Code from module allocator: + # Code from module announce-gen: + # Code from module areadlink: + # Code from module areadlink-tests: + # Code from module argmatch: + # Code from module argmatch-tests: + # Code from module arpa_inet: + # Code from module arpa_inet-tests: + # Code from module assure: + # Code from module binary-io: + # Code from module binary-io-tests: + # Code from module bind: + # Code from module bind-tests: + # Code from module bitrotate: + # Code from module bitrotate-tests: + # Code from module btowc: + # Code from module btowc-tests: + # Code from module builtin-expect: + # Code from module c-ctype: + # Code from module c-ctype-tests: + # Code from module c-stack: + # Code from module c-stack-tests: + # Code from module c-strcase: + # Code from module c-strcase-tests: + # Code from module c-strcaseeq: + # Code from module careadlinkat: + # Code from module clock-time: + # Code from module close: + # Code from module close-tests: + # Code from module config-h: + # Code from module configmake: + # Code from module connect: + # Code from module connect-tests: + # Code from module ctype: + # Code from module ctype-tests: + # Code from module diffseq: + # Code from module dirname: + # Code from module dirname-lgpl: + # Code from module dirname-tests: + # Code from module do-release-commit-and-tag: + # Code from module dosname: + # Code from module double-slash-root: + # Code from module dtotimespec: + # Code from module dup2: + # Code from module dup2-tests: + # Code from module environ: + # Code from module environ-tests: + # Code from module errno: + # Code from module errno-tests: + # Code from module error: + # Code from module exclude: + # Code from module exclude-tests: + # Code from module exitfail: + # Code from module extensions: + # Code from module extern-inline: + # Code from module fcntl: + # Code from module fcntl-h: + # Code from module fcntl-h-tests: + # Code from module fcntl-tests: + # Code from module fd-hook: + # Code from module fdl: + # Code from module fdopen: + # Code from module fdopen-tests: + # Code from module fgetc-tests: + # Code from module file-type: + # Code from module filename: + # Code from module filenamecat: + # Code from module filenamecat-lgpl: + # Code from module filenamecat-tests: + # Code from module flexmember: + # Code from module float: + # Code from module float-tests: + # Code from module fnmatch: + # Code from module fnmatch-gnu: + # Code from module fnmatch-tests: + # Code from module fpieee: + + # Code from module fpucw: + # Code from module fputc-tests: + # Code from module fread-tests: + # Code from module freopen: + # Code from module freopen-safer: + # Code from module freopen-safer-tests: + # Code from module freopen-tests: + # Code from module fstat: + # Code from module fstat-tests: + # Code from module ftruncate: + # Code from module ftruncate-tests: + # Code from module fwrite-tests: + # Code from module gendocs: + # Code from module getcwd-lgpl: + # Code from module getcwd-lgpl-tests: + # Code from module getdtablesize: + # Code from module getdtablesize-tests: + # Code from module getopt: + # Code from module getopt-gnu: + # Code from module getopt-gnu-tests: + # Code from module getopt-posix: + # Code from module getopt-posix-tests: + # Code from module getpagesize: + # Code from module getprogname: + # Code from module getprogname-tests: + # Code from module gettext-h: + # Code from module gettime: + # Code from module gettimeofday: + # Code from module gettimeofday-tests: + # Code from module git-version-gen: + # Code from module gitlog-to-changelog: + # Code from module gnu-make: + # Code from module gnu-web-doc-update: + # Code from module gnumakefile: + # Code from module gnupload: + # Code from module gperf: + # Code from module hard-locale: + # Code from module hash: + # Code from module hash-pjw: + # Code from module hash-tests: + # Code from module havelib: + # Code from module iconv: + # Code from module iconv-h: + # Code from module iconv-h-tests: + # Code from module iconv-tests: + # Code from module iconv_open: + # Code from module ignore-value: + # Code from module ignore-value-tests: + # Code from module include_next: + # Code from module inet_pton: + # Code from module inet_pton-tests: + # Code from module inline: + # Code from module intprops: + # Code from module intprops-tests: + # Code from module inttostr: + # Code from module inttostr-tests: + # Code from module inttypes: + # Code from module inttypes-incomplete: + # Code from module inttypes-tests: + # Code from module ioctl: + # Code from module ioctl-tests: + # Code from module isblank: + # Code from module isblank-tests: + # Code from module iswblank: + # Code from module iswblank-tests: + # Code from module langinfo: + # Code from module langinfo-tests: + # Code from module largefile: + + # Code from module libsigsegv: + # Code from module limits-h: + # Code from module limits-h-tests: + # Code from module listen: + # Code from module listen-tests: + # Code from module localcharset: + # Code from module locale: + # Code from module locale-tests: + # Code from module localeconv: + # Code from module localeconv-tests: + # Code from module localtime-buffer: + # Code from module lstat: + # Code from module lstat-tests: + # Code from module maintainer-makefile: + # Code from module malloc-posix: + # Code from module malloca: + # Code from module malloca-tests: + # Code from module manywarnings: + # Code from module mbchar: + # Code from module mbiter: + # Code from module mbrtowc: + # Code from module mbrtowc-tests: + # Code from module mbscasecmp: + # Code from module mbscasecmp-tests: + # Code from module mbsinit: + # Code from module mbsinit-tests: + # Code from module mbslen: + # Code from module mbsrtowcs: + # Code from module mbsrtowcs-tests: + # Code from module mbsstr: + # Code from module mbsstr-tests: + # Code from module mbtowc: + # Code from module mbuiter: + # Code from module memchr: + # Code from module memchr-tests: + # Code from module minmax: + # Code from module mkstemp: + # Code from module mktime: + # Code from module mktime-internal: + # Code from module msvc-inval: + # Code from module msvc-nothrow: + # Code from module multiarch: + # Code from module nanosleep: + # Code from module nanosleep-tests: + # Code from module netinet_in: + # Code from module netinet_in-tests: + # Code from module nl_langinfo: + # Code from module nl_langinfo-tests: + # Code from module nocrash: + # Code from module open: + # Code from module open-tests: + # Code from module pathmax: + # Code from module pathmax-tests: + # Code from module perror: + # Code from module perror-tests: + # Code from module pipe-posix: + # Code from module pipe-posix-tests: + # Code from module progname: + # Code from module propername: + # Code from module putenv: + # Code from module quote: + # Code from module quotearg: + # Code from module quotearg-simple: + # Code from module quotearg-simple-tests: + # Code from module raise: + # Code from module raise-tests: + # Code from module rawmemchr: + # Code from module rawmemchr-tests: + # Code from module readlink: + # Code from module readlink-tests: + # Code from module readme-release: + # Code from module regex: + # Code from module regex-tests: + # Code from module same-inode: + # Code from module secure_getenv: + # Code from module select: + # Code from module select-tests: + # Code from module setenv: + # Code from module setenv-tests: + # Code from module setlocale: + # Code from module setlocale-tests: + # Code from module setsockopt: + # Code from module setsockopt-tests: + # Code from module sh-quote: + # Code from module sh-quote-tests: + # Code from module sigaction: + # Code from module sigaction-tests: + # Code from module signal: + # Code from module signal-h: + # Code from module signal-h-tests: + # Code from module sigprocmask: + # Code from module sigprocmask-tests: + # Code from module size_max: + # Code from module sleep: + # Code from module sleep-tests: + # Code from module snippet/_Noreturn: + # Code from module snippet/arg-nonnull: + # Code from module snippet/c++defs: + # Code from module snippet/unused-parameter: + # Code from module snippet/warn-on-use: + # Code from module snprintf: + # Code from module snprintf-tests: + # Code from module socket: + # Code from module socketlib: + # Code from module sockets: + # Code from module sockets-tests: + # Code from module socklen: + # Code from module ssize_t: + # Code from module stat: + # Code from module stat-macros: + # Code from module stat-tests: + # Code from module stat-time: + # Code from module stat-time-tests: + # Code from module stdalign: + # Code from module stdalign-tests: + # Code from module stdarg: + + + + # Code from module stdbool: + # Code from module stdbool-tests: + # Code from module stddef: + # Code from module stddef-tests: + # Code from module stdint: + # Code from module stdint-tests: + # Code from module stdio: + # Code from module stdio-tests: + # Code from module stdlib: + # Code from module stdlib-tests: + # Code from module strcase: + # Code from module streq: + # Code from module strerror: + # Code from module strerror-override: + # Code from module strerror-tests: + # Code from module strerror_r-posix: + # Code from module strerror_r-posix-tests: + # Code from module strftime: + # Code from module strftime-tests: + # Code from module striconv: + # Code from module striconv-tests: + # Code from module string: + # Code from module string-tests: + # Code from module strings: + # Code from module strings-tests: + # Code from module strndup: + # Code from module strnlen: + # Code from module strnlen-tests: + # Code from module strnlen1: + # Code from module strptime: + # Code from module strtoull: + # Code from module strtoull-tests: + # Code from module strtoumax: + # Code from module strtoumax-tests: + # Code from module symlink: + # Code from module symlink-tests: + # Code from module sys_ioctl: + # Code from module sys_ioctl-tests: + # Code from module sys_select: + # Code from module sys_select-tests: + # Code from module sys_socket: + # Code from module sys_socket-tests: + # Code from module sys_stat: + # Code from module sys_stat-tests: + # Code from module sys_time: + # Code from module sys_time-tests: + # Code from module sys_types: + # Code from module sys_types-tests: + # Code from module sys_uio: + # Code from module sys_uio-tests: + # Code from module sys_wait: + # Code from module sys_wait-tests: + # Code from module system-quote: + # Code from module tempname: + # Code from module test-framework-sh: + # Code from module test-framework-sh-tests: + # Code from module time: + # Code from module time-tests: + # Code from module time_r: + # Code from module time_rz: + # Code from module timegm: + # Code from module timespec: + # Code from module timespec-add: + # Code from module timespec-sub: + # Code from module timespec-tests: + # Code from module trim: + # Code from module tzset: + # Code from module unistd: + # Code from module unistd-tests: + # Code from module unistr/base: + # Code from module unistr/u8-mbtoucr: + # Code from module unistr/u8-mbtoucr-tests: + # Code from module unistr/u8-uctomb: + # Code from module unistr/u8-uctomb-tests: + # Code from module unitypes: + # Code from module uniwidth/base: + # Code from module uniwidth/width: + # Code from module uniwidth/width-tests: + # Code from module unlocked-io: + # Code from module unsetenv: + # Code from module unsetenv-tests: + # Code from module update-copyright: + # Code from module update-copyright-tests: + # Code from module useless-if-before-free: + # Code from module vararrays: + # Code from module vasnprintf: + # Code from module vasnprintf-tests: + # Code from module vasprintf: + # Code from module vasprintf-tests: + # Code from module vc-list-files: + # Code from module vc-list-files-tests: + # Code from module verify: + # Code from module verify-tests: + # Code from module version-etc: + # Code from module version-etc-fsf: + # Code from module version-etc-tests: + # Code from module warnings: + # Code from module wchar: + # Code from module wchar-tests: + # Code from module wcrtomb: + # Code from module wcrtomb-tests: + # Code from module wctob: + # Code from module wctomb: + # Code from module wctype-h: + # Code from module wctype-h-tests: + # Code from module wcwidth: + # Code from module wcwidth-tests: + # Code from module xalloc: + # Code from module xalloc-die: + # Code from module xalloc-die-tests: + # Code from module xalloc-oversized: + # Code from module xfreopen: + # Code from module xreadlink: + # Code from module xsize: + # Code from module xstriconv: + # Code from module xstrndup: + # Code from module xstrtol: + # Code from module xstrtol-tests: + # Code from module xstrtoumax: + # Code from module xstrtoumax-tests: + # Code from module xvasprintf: + # Code from module xvasprintf-tests: + + + + + + + + LIBC_FATAL_STDERR_=1 + export LIBC_FATAL_STDERR_ + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define size_t unsigned int" >>confdefs.h + ;; +esac +fi + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +printf %s "checking for working alloca.h... " >&6; } +if test ${ac_cv_working_alloca_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main (void) +{ +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_working_alloca_h=yes +else case e in @%:@( + e) ac_cv_working_alloca_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +printf "%s\n" "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then + +printf "%s\n" "@%:@define HAVE_ALLOCA_H 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +printf %s "checking for alloca... " >&6; } +if test ${ac_cv_func_alloca_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_func_alloca_works=$ac_cv_working_alloca_h +if test "$ac_cv_func_alloca_works" != yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#ifndef alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _MSC_VER +# include +# define alloca _alloca +# else +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +# endif +#endif + +int +main (void) +{ +char *p = (char *) alloca (1); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_func_alloca_works=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +printf "%s\n" "$ac_cv_func_alloca_works" >&6; } + +if test $ac_cv_func_alloca_works = yes; then + +printf "%s\n" "@%:@define HAVE_ALLOCA 1" >>confdefs.h + +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + + + + + +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext + +printf "%s\n" "@%:@define C_ALLOCA 1" >>confdefs.h + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +printf %s "checking stack direction for C alloca... " >&6; } +if test ${ac_cv_c_stack_direction+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + ac_cv_c_stack_direction=0 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction (int *addr, int depth) +{ + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; +} + +int +main (int argc, char **argv) +{ + return find_stack_direction (0, argc + !argv + 20) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_stack_direction=1 +else case e in @%:@( + e) ac_cv_c_stack_direction=-1 ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +printf "%s\n" "$ac_cv_c_stack_direction" >&6; } +printf "%s\n" "@%:@define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h + + +fi + + + GNULIB_BTOWC=0; + GNULIB_WCTOB=0; + GNULIB_MBSINIT=0; + GNULIB_MBRTOWC=0; + GNULIB_MBRLEN=0; + GNULIB_MBSRTOWCS=0; + GNULIB_MBSNRTOWCS=0; + GNULIB_WCRTOMB=0; + GNULIB_WCSRTOMBS=0; + GNULIB_WCSNRTOMBS=0; + GNULIB_WCWIDTH=0; + GNULIB_WMEMCHR=0; + GNULIB_WMEMCMP=0; + GNULIB_WMEMCPY=0; + GNULIB_WMEMMOVE=0; + GNULIB_WMEMSET=0; + GNULIB_WCSLEN=0; + GNULIB_WCSNLEN=0; + GNULIB_WCSCPY=0; + GNULIB_WCPCPY=0; + GNULIB_WCSNCPY=0; + GNULIB_WCPNCPY=0; + GNULIB_WCSCAT=0; + GNULIB_WCSNCAT=0; + GNULIB_WCSCMP=0; + GNULIB_WCSNCMP=0; + GNULIB_WCSCASECMP=0; + GNULIB_WCSNCASECMP=0; + GNULIB_WCSCOLL=0; + GNULIB_WCSXFRM=0; + GNULIB_WCSDUP=0; + GNULIB_WCSCHR=0; + GNULIB_WCSRCHR=0; + GNULIB_WCSCSPN=0; + GNULIB_WCSSPN=0; + GNULIB_WCSPBRK=0; + GNULIB_WCSSTR=0; + GNULIB_WCSTOK=0; + GNULIB_WCSWIDTH=0; + GNULIB_WCSFTIME=0; + HAVE_BTOWC=1; + HAVE_MBSINIT=1; + HAVE_MBRTOWC=1; + HAVE_MBRLEN=1; + HAVE_MBSRTOWCS=1; + HAVE_MBSNRTOWCS=1; + HAVE_WCRTOMB=1; + HAVE_WCSRTOMBS=1; + HAVE_WCSNRTOMBS=1; + HAVE_WMEMCHR=1; + HAVE_WMEMCMP=1; + HAVE_WMEMCPY=1; + HAVE_WMEMMOVE=1; + HAVE_WMEMSET=1; + HAVE_WCSLEN=1; + HAVE_WCSNLEN=1; + HAVE_WCSCPY=1; + HAVE_WCPCPY=1; + HAVE_WCSNCPY=1; + HAVE_WCPNCPY=1; + HAVE_WCSCAT=1; + HAVE_WCSNCAT=1; + HAVE_WCSCMP=1; + HAVE_WCSNCMP=1; + HAVE_WCSCASECMP=1; + HAVE_WCSNCASECMP=1; + HAVE_WCSCOLL=1; + HAVE_WCSXFRM=1; + HAVE_WCSDUP=1; + HAVE_WCSCHR=1; + HAVE_WCSRCHR=1; + HAVE_WCSCSPN=1; + HAVE_WCSSPN=1; + HAVE_WCSPBRK=1; + HAVE_WCSSTR=1; + HAVE_WCSTOK=1; + HAVE_WCSWIDTH=1; + HAVE_WCSFTIME=1; + HAVE_DECL_WCTOB=1; + HAVE_DECL_WCWIDTH=1; + REPLACE_MBSTATE_T=0; + REPLACE_BTOWC=0; + REPLACE_WCTOB=0; + REPLACE_MBSINIT=0; + REPLACE_MBRTOWC=0; + REPLACE_MBRLEN=0; + REPLACE_MBSRTOWCS=0; + REPLACE_MBSNRTOWCS=0; + REPLACE_WCRTOMB=0; + REPLACE_WCSRTOMBS=0; + REPLACE_WCSNRTOMBS=0; + REPLACE_WCWIDTH=0; + REPLACE_WCSWIDTH=0; + REPLACE_WCSFTIME=0; + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether uses 'inline' correctly" >&5 +printf %s "checking whether uses 'inline' correctly... " >&6; } +if test ${gl_cv_header_wchar_h_correct_inline+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gl_cv_header_wchar_h_correct_inline=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +extern int zero (void); +int main () { return zero(); } + +_ACEOF + save_ac_compile="$ac_compile" + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int zero (void) { return 0; } + +_ACEOF + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then + : + else + gl_cv_header_wchar_h_correct_inline=no + fi + fi + fi + ac_compile="$save_ac_compile" + rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5 +printf "%s\n" "$gl_cv_header_wchar_h_correct_inline" >&6; } + if test $gl_cv_header_wchar_h_correct_inline = no; then + as_fn_error $? " cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). +This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in +C99 mode. You have four options: + - Add the flag -fgnu89-inline to CC and reconfigure, or + - Fix your include files, using parts of + , or + - Use a gcc version older than 4.3, or + - Don't use the flags -std=c99 or -std=gnu99. +Configuration aborted." "$LINENO" 5 + fi + +ac_func= +for ac_item in $ac_func_c_list +do + if test $ac_func; then + ac_fn_c_check_func "$LINENO" $ac_func ac_cv_func_$ac_func + if eval test \"x\$ac_cv_func_$ac_func\" = xyes; then + echo "#define $ac_item 1" >> confdefs.h + fi + ac_func= + else + ac_func=$ac_item + fi +done + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 +printf %s "checking for nl_langinfo and CODESET... " >&6; } +if test ${am_cv_langinfo_codeset+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +char* cs = nl_langinfo(CODESET); return !cs; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_langinfo_codeset=yes +else case e in @%:@( + e) am_cv_langinfo_codeset=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 +printf "%s\n" "$am_cv_langinfo_codeset" >&6; } + if test $am_cv_langinfo_codeset = yes; then + +printf "%s\n" "@%:@define HAVE_LANGINFO_CODESET 1" >>confdefs.h + + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + + + + + + case "$host_os" in + sunos4* | freebsd* | dragonfly* | openbsd* | mirbsd* | netbsd* | kfreebsd* | knetbsd*) # BSD systems + FAULT_YIELDS_SIGBUS=1 ;; + hpux*) # HP-UX + FAULT_YIELDS_SIGBUS=1 ;; + macos* | darwin*) # Mac OS X + FAULT_YIELDS_SIGBUS=1 ;; + gnu*) # Hurd + FAULT_YIELDS_SIGBUS=1 ;; + *) + FAULT_YIELDS_SIGBUS=0 ;; + esac + +printf "%s\n" "@%:@define FAULT_YIELDS_SIGBUS $FAULT_YIELDS_SIGBUS" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working C stack overflow detection" >&5 +printf %s "checking for working C stack overflow detection... " >&6; } +if test ${ac_cv_sys_stack_overflow_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + ac_cv_sys_stack_overflow_works=cross-compiling +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #if HAVE_SETRLIMIT + # include + # include + # include + #endif + #ifndef SIGSTKSZ + # define SIGSTKSZ 16384 + #endif + + static union + { + char buffer[2 * SIGSTKSZ]; + long double ld; + long u; + void *p; + } alternate_signal_stack; + + static void + segv_handler (int signo) + { + _exit (0); + } + + static int + c_stack_action () + { + stack_t st; + struct sigaction act; + int r; + + st.ss_flags = 0; + /* Use the midpoint to avoid Irix sigaltstack bug. */ + st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; + st.ss_size = SIGSTKSZ; + r = sigaltstack (&st, 0); + if (r != 0) + return 1; + + sigemptyset (&act.sa_mask); + act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND; + act.sa_handler = segv_handler; + #if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, 0) < 0) + return 2; + #endif + if (sigaction (SIGSEGV, &act, 0) < 0) + return 3; + return 0; + } + static volatile int * + recurse_1 (volatile int n, volatile int *p) + { + if (n >= 0) + *recurse_1 (n + 1, p) += n; + return p; + } + static int + recurse (volatile int n) + { + int sum = 0; + return *recurse_1 (n, &sum); + } + int + main () + { + int result; + #if HAVE_SETRLIMIT && defined RLIMIT_STACK + /* Before starting the endless recursion, try to be friendly + to the user's machine. On some Linux 2.2.x systems, there + is no stack limit for user processes at all. We don't want + to kill such systems. */ + struct rlimit rl; + rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */ + setrlimit (RLIMIT_STACK, &rl); + #endif + + result = c_stack_action (); + if (result != 0) + return result; + return recurse (0); + } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_sys_stack_overflow_works=yes +else case e in @%:@( + e) ac_cv_sys_stack_overflow_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_stack_overflow_works" >&5 +printf "%s\n" "$ac_cv_sys_stack_overflow_works" >&6; } + + if test $ac_cv_sys_stack_overflow_works = yes; then + +printf "%s\n" "@%:@define HAVE_STACK_OVERFLOW_HANDLING 1" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for correct stack_t interpretation" >&5 +printf %s "checking for correct stack_t interpretation... " >&6; } +if test ${gl_cv_sigaltstack_low_base+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + gl_cv_sigaltstack_low_base=cross-compiling +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#include +#include +#if HAVE_SYS_SIGNAL_H +# include +#endif +#ifndef SIGSTKSZ +# define SIGSTKSZ 16384 +#endif +volatile char *stack_lower_bound; +volatile char *stack_upper_bound; +static void check_stack_location (volatile char *addr) +{ + if (addr >= stack_lower_bound && addr <= stack_upper_bound) + exit (0); + else + exit (1); +} +static void stackoverflow_handler (int sig) +{ + char dummy; + check_stack_location (&dummy); +} +int main () +{ + char mystack[2 * SIGSTKSZ]; + stack_t altstack; + struct sigaction action; + /* Install the alternate stack. */ + altstack.ss_sp = mystack + SIGSTKSZ; + altstack.ss_size = SIGSTKSZ; + stack_lower_bound = (char *) altstack.ss_sp; + stack_upper_bound = (char *) altstack.ss_sp + altstack.ss_size - 1; + altstack.ss_flags = 0; /* no SS_DISABLE */ + if (sigaltstack (&altstack, NULL) < 0) + exit (2); + /* Install the SIGSEGV handler. */ + sigemptyset (&action.sa_mask); + action.sa_handler = &stackoverflow_handler; + action.sa_flags = SA_ONSTACK; + if (sigaction (SIGSEGV, &action, (struct sigaction *) NULL) < 0) + exit(3); + /* Provoke a SIGSEGV. */ + raise (SIGSEGV); + exit (4); +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_sigaltstack_low_base=yes +else case e in @%:@( + e) gl_cv_sigaltstack_low_base=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sigaltstack_low_base" >&5 +printf "%s\n" "$gl_cv_sigaltstack_low_base" >&6; } + if test "$gl_cv_sigaltstack_low_base" = no; then + +printf "%s\n" "@%:@define SIGALTSTACK_SS_REVERSED 1" >>confdefs.h + + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for precise C stack overflow detection" >&5 +printf %s "checking for precise C stack overflow detection... " >&6; } +if test ${ac_cv_sys_xsi_stack_overflow_heuristic+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #if HAVE_UCONTEXT_H + # include + #endif + #if HAVE_SETRLIMIT + # include + # include + # include + #endif + #ifndef SIGSTKSZ + # define SIGSTKSZ 16384 + #endif + + static union + { + char buffer[2 * SIGSTKSZ]; + long double ld; + long u; + void *p; + } alternate_signal_stack; + + #if STACK_DIRECTION + # define find_stack_direction(ptr) STACK_DIRECTION + #else + static int + find_stack_direction (char const *addr) + { + char dummy; + return (! addr ? find_stack_direction (&dummy) + : addr < &dummy ? 1 : -1); + } + #endif + + static void + segv_handler (int signo, siginfo_t *info, void *context) + { + if (0 < info->si_code) + { + /* For XSI heuristics to work, we need uc_stack to describe + the interrupted stack (as on Solaris), and not the + currently executing stack (as on Linux). */ + ucontext_t const *user_context = context; + char const *stack_min = user_context->uc_stack.ss_sp; + size_t stack_size = user_context->uc_stack.ss_size; + char const *faulting_address = info->si_addr; + size_t s = faulting_address - stack_min; + size_t page_size = sysconf (_SC_PAGESIZE); + if (find_stack_direction (0) < 0) + s += page_size; + if (s < stack_size + page_size) + _exit (0); + _exit (4); + } + _exit (5); + } + + static int + c_stack_action () + { + stack_t st; + struct sigaction act; + int r; + + st.ss_flags = 0; + /* Use the midpoint to avoid Irix sigaltstack bug. */ + st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; + st.ss_size = SIGSTKSZ; + r = sigaltstack (&st, 0); + if (r != 0) + return 1; + + sigemptyset (&act.sa_mask); + act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO; + act.sa_sigaction = segv_handler; + #if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, 0) < 0) + return 2; + #endif + if (sigaction (SIGSEGV, &act, 0) < 0) + return 3; + return 0; + } + static volatile int * + recurse_1 (volatile int n, volatile int *p) + { + if (n >= 0) + *recurse_1 (n + 1, p) += n; + return p; + } + static int + recurse (volatile int n) + { + int sum = 0; + return *recurse_1 (n, &sum); + } + int + main () + { + int result; + #if HAVE_SETRLIMIT && defined RLIMIT_STACK + /* Before starting the endless recursion, try to be friendly + to the user's machine. On some Linux 2.2.x systems, there + is no stack limit for user processes at all. We don't want + to kill such systems. */ + struct rlimit rl; + rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */ + setrlimit (RLIMIT_STACK, &rl); + #endif + + result = c_stack_action (); + if (result != 0) + return result; + return recurse (0); + } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_sys_xsi_stack_overflow_heuristic=yes +else case e in @%:@( + e) ac_cv_sys_xsi_stack_overflow_heuristic=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_xsi_stack_overflow_heuristic" >&5 +printf "%s\n" "$ac_cv_sys_xsi_stack_overflow_heuristic" >&6; } + + if test $ac_cv_sys_xsi_stack_overflow_heuristic = yes; then + +printf "%s\n" "@%:@define HAVE_XSI_STACK_OVERFLOW_HEURISTIC 1" >>confdefs.h + + fi + fi + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + + +@%:@ Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else case e in @%:@( + e) with_gnu_ld=no ;; +esac +fi + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld" >&5 +printf %s "checking for ld... " >&6; } +elif test "$GCC" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } +elif test "$with_gnu_ld" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test -n "$LD"; then + # Let the user override the test with a path. + : +else + if test ${acl_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + acl_cv_path_LD= # Final result of this test + ac_prog=ld # Program to search in $PATH + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + acl_output=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $acl_output in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` + while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do + acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` + done + # Got the pathname. No search in PATH is needed. + acl_cv_path_LD="$acl_output" + ac_prog= + ;; + "") + # If it fails, then pretend we aren't using GCC. + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac + fi + if test -n "$ac_prog"; then + # Search for $ac_prog in $PATH. + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$acl_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 conftest.$ac_ext +/* end confdefs.h. */ +#if defined __powerpc64__ || defined _ARCH_PPC64 + yes + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + # The compiler produces 64-bit code. Add option '-b64' so that the + # linker groks 64-bit object files. + case "$acl_cv_path_LD " in + *" -b64 "*) ;; + *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;; + esac + +fi +rm -rf conftest* + + ;; + esac + ;; +esac +fi + + LD="$acl_cv_path_LD" +fi +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${acl_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +printf "%s\n" "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +printf %s "checking for shared library run path origin... " >&6; } +if test ${acl_cv_rpath+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +printf "%s\n" "$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + @%:@ Check whether --enable-rpath was given. +if test ${enable_rpath+y} +then : + enableval=$enable_rpath; : +else case e in @%:@( + e) enable_rpath=yes ;; +esac +fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5 +printf %s "checking for the common suffixes of directories in the library search path... " >&6; } +if test ${acl_cv_libdirstems+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) acl_libdirstem=lib + acl_libdirstem2= + case "$host_os" in + solaris*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 +printf %s "checking for 64-bit host... " >&6; } +if test ${gl_cv_solaris_64bit+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _LP64 +sixtyfour bits +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "sixtyfour bits" >/dev/null 2>&1 +then : + gl_cv_solaris_64bit=yes +else case e in @%:@( + e) gl_cv_solaris_64bit=no ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 +printf "%s\n" "$gl_cv_solaris_64bit" >&6; } + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; + esac + fi + ;; + *) + searchpath=`(if test -f /usr/bin/gcc \ + && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \ + LC_ALL=C /usr/bin/gcc -print-search-dirs; \ + else \ + LC_ALL=C $CC -print-search-dirs; \ + fi) 2>/dev/null \ + | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_libdirstems" >&5 +printf "%s\n" "$acl_cv_libdirstems" >&6; } + # Decompose acl_cv_libdirstems into acl_libdirstem and acl_libdirstem2. + acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` + acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e '/,/s/.*,//'` + + + + + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +@%:@ Check whether --with-libsigsegv-prefix was given. +if test ${with_libsigsegv_prefix+y} +then : + withval=$with_libsigsegv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBSIGSEGV= + LTLIBSIGSEGV= + INCSIGSEGV= + LIBSIGSEGV_PREFIX= + HAVE_LIBSIGSEGV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='sigsegv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_a" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCSIGSEGV="${INCSIGSEGV}${INCSIGSEGV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$dep" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$dep" + ;; + esac + done + fi + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-R$found_dir" + done + fi + + + + + + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCSIGSEGV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsigsegv" >&5 +printf %s "checking for libsigsegv... " >&6; } +if test ${ac_cv_libsigsegv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + ac_save_LIBS="$LIBS" + case " $LIBSIGSEGV" in + *" -l"*) LIBS="$LIBS $LIBSIGSEGV" ;; + *) LIBS="$LIBSIGSEGV $LIBS" ;; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +sigsegv_deinstall_handler(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libsigsegv=yes +else case e in @%:@( + e) ac_cv_libsigsegv='no, consider installing GNU libsigsegv' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libsigsegv" >&5 +printf "%s\n" "$ac_cv_libsigsegv" >&6; } + if test "$ac_cv_libsigsegv" = yes; then + HAVE_LIBSIGSEGV=yes + +printf "%s\n" "@%:@define HAVE_LIBSIGSEGV 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libsigsegv" >&5 +printf %s "checking how to link with libsigsegv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBSIGSEGV" >&5 +printf "%s\n" "$LIBSIGSEGV" >&6; } + else + HAVE_LIBSIGSEGV=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBSIGSEGV= + LTLIBSIGSEGV= + LIBSIGSEGV_PREFIX= + fi + + + + + + + + gl_cv_lib_sigsegv="$ac_cv_libsigsegv" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in @%:@( + e) # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +extern void ac_decl (int, char *); + +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else case e in @%:@( + e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; +esac +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in @%:@( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See 'config.log' for more details" "$LINENO" 5; } ;; @%:@( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; @%:@( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac + + + + GNULIB_CHDIR=0; + GNULIB_CHOWN=0; + GNULIB_CLOSE=0; + GNULIB_DUP=0; + GNULIB_DUP2=0; + GNULIB_DUP3=0; + GNULIB_ENVIRON=0; + GNULIB_EUIDACCESS=0; + GNULIB_FACCESSAT=0; + GNULIB_FCHDIR=0; + GNULIB_FCHOWNAT=0; + GNULIB_FDATASYNC=0; + GNULIB_FSYNC=0; + GNULIB_FTRUNCATE=0; + GNULIB_GETCWD=0; + GNULIB_GETDOMAINNAME=0; + GNULIB_GETDTABLESIZE=0; + GNULIB_GETGROUPS=0; + GNULIB_GETHOSTNAME=0; + GNULIB_GETLOGIN=0; + GNULIB_GETLOGIN_R=0; + GNULIB_GETPAGESIZE=0; + GNULIB_GETUSERSHELL=0; + GNULIB_GROUP_MEMBER=0; + GNULIB_ISATTY=0; + GNULIB_LCHOWN=0; + GNULIB_LINK=0; + GNULIB_LINKAT=0; + GNULIB_LSEEK=0; + GNULIB_PIPE=0; + GNULIB_PIPE2=0; + GNULIB_PREAD=0; + GNULIB_PWRITE=0; + GNULIB_READ=0; + GNULIB_READLINK=0; + GNULIB_READLINKAT=0; + GNULIB_RMDIR=0; + GNULIB_SETHOSTNAME=0; + GNULIB_SLEEP=0; + GNULIB_SYMLINK=0; + GNULIB_SYMLINKAT=0; + GNULIB_TRUNCATE=0; + GNULIB_TTYNAME_R=0; + GNULIB_UNISTD_H_NONBLOCKING=0; + GNULIB_UNISTD_H_SIGPIPE=0; + GNULIB_UNLINK=0; + GNULIB_UNLINKAT=0; + GNULIB_USLEEP=0; + GNULIB_WRITE=0; + HAVE_CHOWN=1; + HAVE_DUP2=1; + HAVE_DUP3=1; + HAVE_EUIDACCESS=1; + HAVE_FACCESSAT=1; + HAVE_FCHDIR=1; + HAVE_FCHOWNAT=1; + HAVE_FDATASYNC=1; + HAVE_FSYNC=1; + HAVE_FTRUNCATE=1; + HAVE_GETDTABLESIZE=1; + HAVE_GETGROUPS=1; + HAVE_GETHOSTNAME=1; + HAVE_GETLOGIN=1; + HAVE_GETPAGESIZE=1; + HAVE_GROUP_MEMBER=1; + HAVE_LCHOWN=1; + HAVE_LINK=1; + HAVE_LINKAT=1; + HAVE_PIPE=1; + HAVE_PIPE2=1; + HAVE_PREAD=1; + HAVE_PWRITE=1; + HAVE_READLINK=1; + HAVE_READLINKAT=1; + HAVE_SETHOSTNAME=1; + HAVE_SLEEP=1; + HAVE_SYMLINK=1; + HAVE_SYMLINKAT=1; + HAVE_TRUNCATE=1; + HAVE_UNLINKAT=1; + HAVE_USLEEP=1; + HAVE_DECL_ENVIRON=1; + HAVE_DECL_FCHDIR=1; + HAVE_DECL_FDATASYNC=1; + HAVE_DECL_GETDOMAINNAME=1; + HAVE_DECL_GETLOGIN=1; + HAVE_DECL_GETLOGIN_R=1; + HAVE_DECL_GETPAGESIZE=1; + HAVE_DECL_GETUSERSHELL=1; + HAVE_DECL_SETHOSTNAME=1; + HAVE_DECL_TTYNAME_R=1; + HAVE_OS_H=0; + HAVE_SYS_PARAM_H=0; + REPLACE_CHOWN=0; + REPLACE_CLOSE=0; + REPLACE_DUP=0; + REPLACE_DUP2=0; + REPLACE_FCHOWNAT=0; + REPLACE_FTRUNCATE=0; + REPLACE_GETCWD=0; + REPLACE_GETDOMAINNAME=0; + REPLACE_GETDTABLESIZE=0; + REPLACE_GETLOGIN_R=0; + REPLACE_GETGROUPS=0; + REPLACE_GETPAGESIZE=0; + REPLACE_ISATTY=0; + REPLACE_LCHOWN=0; + REPLACE_LINK=0; + REPLACE_LINKAT=0; + REPLACE_LSEEK=0; + REPLACE_PREAD=0; + REPLACE_PWRITE=0; + REPLACE_READ=0; + REPLACE_READLINK=0; + REPLACE_READLINKAT=0; + REPLACE_RMDIR=0; + REPLACE_SLEEP=0; + REPLACE_SYMLINK=0; + REPLACE_SYMLINKAT=0; + REPLACE_TRUNCATE=0; + REPLACE_TTYNAME_R=0; + REPLACE_UNLINK=0; + REPLACE_UNLINKAT=0; + REPLACE_USLEEP=0; + REPLACE_WRITE=0; + UNISTD_H_HAVE_WINSOCK2_H=0; + UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; + + + + + + if test $ac_cv_func__set_invalid_parameter_handler = yes; then + HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 + +printf "%s\n" "@%:@define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h + + else + HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 + fi + + + + GNULIB_IOCTL=0; + SYS_IOCTL_H_HAVE_WINSOCK2_H=0; + SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; + + REPLACE_IOCTL=0; + + + + GNULIB_ISBLANK=0; + HAVE_ISBLANK=1; + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5 +printf %s "checking whether the preprocessor supports include_next... " >&6; } +if test ${gl_cv_have_include_next+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) rm -rf conftestd1a conftestd1b conftestd2 + mkdir conftestd1a conftestd1b conftestd2 + cat < conftestd1a/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include_next +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat < conftestd1b/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include +#include_next +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat < conftestd2/conftest.h +#ifndef DEFINED_IN_CONFTESTD1 +#error "include_next test doesn't work" +#endif +#define DEFINED_IN_CONFTESTD2 +EOF + gl_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_have_include_next=yes +else case e in @%:@( + e) CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_have_include_next=buggy +else case e in @%:@( + e) gl_cv_have_include_next=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CPPFLAGS="$gl_save_CPPFLAGS" + rm -rf conftestd1a conftestd1b conftestd2 + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5 +printf "%s\n" "$gl_cv_have_include_next" >&6; } + PRAGMA_SYSTEM_HEADER= + if test $gl_cv_have_include_next = yes; then + INCLUDE_NEXT=include_next + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + if test -n "$GCC"; then + PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' + fi + else + if test $gl_cv_have_include_next = buggy; then + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + else + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include + fi + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5 +printf %s "checking whether system header files limit the line length... " >&6; } +if test ${gl_cv_pragma_columns+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __TANDEM +choke me +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "choke me" >/dev/null 2>&1 +then : + gl_cv_pragma_columns=yes +else case e in @%:@( + e) gl_cv_pragma_columns=no ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5 +printf "%s\n" "$gl_cv_pragma_columns" >&6; } + if test $gl_cv_pragma_columns = yes; then + PRAGMA_COLUMNS="#pragma COLUMNS 10000" + else + PRAGMA_COLUMNS= + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 +printf %s "checking whether // is distinct from /... " >&6; } +if test ${gl_cv_double_slash_root+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # . + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + gl_cv_double_slash_root='unknown, assuming no' ;; + esac + else + set x `ls -di / // 2>/dev/null` + if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 +printf "%s\n" "$gl_cv_double_slash_root" >&6; } + if test "$gl_cv_double_slash_root" = yes; then + +printf "%s\n" "@%:@define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h + + fi + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5 +printf %s "checking if environ is properly declared... " >&6; } + if test ${gt_cv_var_environ_declaration+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_UNISTD_H + #include + #endif + /* mingw, BeOS, Haiku declare environ in , not in . */ + #include + + extern struct { int foo; } environ; +int +main (void) +{ +environ.foo = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_var_environ_declaration=no +else case e in @%:@( + e) gt_cv_var_environ_declaration=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5 +printf "%s\n" "$gt_cv_var_environ_declaration" >&6; } + if test $gt_cv_var_environ_declaration = yes; then + +printf "%s\n" "@%:@define HAVE_ENVIRON_DECL 1" >>confdefs.h + + fi + + + if test $gt_cv_var_environ_declaration != yes; then + HAVE_DECL_ENVIRON=0 + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5 +printf %s "checking for complete errno.h... " >&6; } +if test ${gl_cv_header_errno_h_complete+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if !defined ETXTBSY +booboo +#endif +#if !defined ENOMSG +booboo +#endif +#if !defined EIDRM +booboo +#endif +#if !defined ENOLINK +booboo +#endif +#if !defined EPROTO +booboo +#endif +#if !defined EMULTIHOP +booboo +#endif +#if !defined EBADMSG +booboo +#endif +#if !defined EOVERFLOW +booboo +#endif +#if !defined ENOTSUP +booboo +#endif +#if !defined ENETRESET +booboo +#endif +#if !defined ECONNABORTED +booboo +#endif +#if !defined ESTALE +booboo +#endif +#if !defined EDQUOT +booboo +#endif +#if !defined ECANCELED +booboo +#endif +#if !defined EOWNERDEAD +booboo +#endif +#if !defined ENOTRECOVERABLE +booboo +#endif +#if !defined EILSEQ +booboo +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "booboo" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_complete=no +else case e in @%:@( + e) gl_cv_header_errno_h_complete=yes ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5 +printf "%s\n" "$gl_cv_header_errno_h_complete" >&6; } + if test $gl_cv_header_errno_h_complete = yes; then + ERRNO_H='' + else + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_errno_h='<'errno.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_errno_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'errno.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_errno_h + gl_cv_next_errno_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5 +printf "%s\n" "$gl_cv_next_errno_h" >&6; } + fi + NEXT_ERRNO_H=$gl_cv_next_errno_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'errno.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_errno_h + fi + NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive + + + + + ERRNO_H='errno.h' + fi + + if test -n "$ERRNO_H"; then + GL_GENERATE_ERRNO_H_TRUE= + GL_GENERATE_ERRNO_H_FALSE='#' +else + GL_GENERATE_ERRNO_H_TRUE='#' + GL_GENERATE_ERRNO_H_FALSE= +fi + + + if test -n "$ERRNO_H"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5 +printf %s "checking for EMULTIHOP value... " >&6; } +if test ${gl_cv_header_errno_h_EMULTIHOP+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef EMULTIHOP +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EMULTIHOP=yes +else case e in @%:@( + e) gl_cv_header_errno_h_EMULTIHOP=no ;; +esac +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EMULTIHOP = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#ifdef EMULTIHOP +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EMULTIHOP=hidden +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then + if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +" +then : + +fi + + fi + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5 +printf "%s\n" "$gl_cv_header_errno_h_EMULTIHOP" >&6; } + case $gl_cv_header_errno_h_EMULTIHOP in + yes | no) + EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE= + ;; + *) + EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP" + ;; + esac + + + fi + + + if test -n "$ERRNO_H"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5 +printf %s "checking for ENOLINK value... " >&6; } +if test ${gl_cv_header_errno_h_ENOLINK+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef ENOLINK +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_ENOLINK=yes +else case e in @%:@( + e) gl_cv_header_errno_h_ENOLINK=no ;; +esac +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_ENOLINK = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#ifdef ENOLINK +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_ENOLINK=hidden +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_ENOLINK = hidden; then + if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +" +then : + +fi + + fi + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5 +printf "%s\n" "$gl_cv_header_errno_h_ENOLINK" >&6; } + case $gl_cv_header_errno_h_ENOLINK in + yes | no) + ENOLINK_HIDDEN=0; ENOLINK_VALUE= + ;; + *) + ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK" + ;; + esac + + + fi + + + if test -n "$ERRNO_H"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5 +printf %s "checking for EOVERFLOW value... " >&6; } +if test ${gl_cv_header_errno_h_EOVERFLOW+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EOVERFLOW=yes +else case e in @%:@( + e) gl_cv_header_errno_h_EOVERFLOW=no ;; +esac +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EOVERFLOW = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EOVERFLOW=hidden +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then + if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +" +then : + +fi + + fi + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5 +printf "%s\n" "$gl_cv_header_errno_h_EOVERFLOW" >&6; } + case $gl_cv_header_errno_h_EOVERFLOW in + yes | no) + EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE= + ;; + *) + EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW" + ;; + esac + + + fi + + +ac_fn_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strerror_r" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_STRERROR_R $ac_have_decl" >>confdefs.h + + +if test $ac_cv_have_decl_strerror_r = yes; then + # For backward compatibility's sake, define HAVE_STRERROR_R. + # (We used to run AC_CHECK_FUNCS_ONCE for strerror_r, as well + # as AC_CHECK_DECLS_ONCE.) + +printf "%s\n" "@%:@define HAVE_STRERROR_R 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 +printf %s "checking whether strerror_r returns char *... " >&6; } +if test ${ac_cv_func_strerror_r_char_p+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + ac_cv_func_strerror_r_char_p=no + if test $ac_cv_have_decl_strerror_r = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main (void) +{ + + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + char *p = strerror_r (0, buf, sizeof buf); + return !p || x; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_func_strerror_r_char_p=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 +printf "%s\n" "$ac_cv_func_strerror_r_char_p" >&6; } +if test $ac_cv_func_strerror_r_char_p = yes; then + +printf "%s\n" "@%:@define STRERROR_R_CHAR_P 1" >>confdefs.h + +fi + + + XGETTEXT_EXTRA_OPTIONS= + + + + + + GNULIB_FCNTL=0; + GNULIB_NONBLOCKING=0; + GNULIB_OPEN=0; + GNULIB_OPENAT=0; + HAVE_FCNTL=1; + HAVE_OPENAT=1; + REPLACE_FCNTL=0; + REPLACE_OPEN=0; + REPLACE_OPENAT=0; + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5 +printf %s "checking for working fcntl.h... " >&6; } +if test ${gl_cv_header_working_fcntl_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + gl_cv_header_working_fcntl_h=cross-compiling +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #if HAVE_UNISTD_H + # include + #else /* on Windows with MSVC */ + # include + # include + # defined sleep(n) _sleep ((n) * 1000) + #endif + #include + #ifndef O_NOATIME + #define O_NOATIME 0 + #endif + #ifndef O_NOFOLLOW + #define O_NOFOLLOW 0 + #endif + static int const constants[] = + { + O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, + O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY + }; + +int +main (void) +{ + + int result = !constants; + #if HAVE_SYMLINK + { + static char const sym[] = "conftest.sym"; + if (symlink ("/dev/null", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + if (unlink (sym) != 0 || symlink (".", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_RDONLY | O_NOFOLLOW); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + unlink (sym); + } + #endif + { + static char const file[] = "confdefs.h"; + int fd = open (file, O_RDONLY | O_NOATIME); + if (fd < 0) + result |= 8; + else + { + struct stat st0; + if (fstat (fd, &st0) != 0) + result |= 16; + else + { + char c; + sleep (1); + if (read (fd, &c, 1) != 1) + result |= 24; + else + { + if (close (fd) != 0) + result |= 32; + else + { + struct stat st1; + if (stat (file, &st1) != 0) + result |= 40; + else + if (st0.st_atime != st1.st_atime) + result |= 64; + } + } + } + } + } + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_header_working_fcntl_h=yes +else case e in @%:@( + e) case $? in #( + 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( + 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( + 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( + *) gl_cv_header_working_fcntl_h='no';; + esac ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5 +printf "%s\n" "$gl_cv_header_working_fcntl_h" >&6; } + + case $gl_cv_header_working_fcntl_h in #( + *O_NOATIME* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + +printf "%s\n" "@%:@define HAVE_WORKING_O_NOATIME $ac_val" >>confdefs.h + + + case $gl_cv_header_working_fcntl_h in #( + *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + +printf "%s\n" "@%:@define HAVE_WORKING_O_NOFOLLOW $ac_val" >>confdefs.h + + + + ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default +" +if test "x$ac_cv_type_pid_t" = xyes +then : + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_pid_type='int' +else case e in @%:@( + e) ac_pid_type='__int64' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +printf "%s\n" "@%:@define pid_t $ac_pid_type" >>confdefs.h + + ;; +esac +fi + + +ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define mode_t int" >>confdefs.h + ;; +esac +fi + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 +printf %s "checking for mbstate_t... " >&6; } +if test ${ac_cv_type_mbstate_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int +main (void) +{ +mbstate_t x; return sizeof x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_type_mbstate_t=yes +else case e in @%:@( + e) ac_cv_type_mbstate_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5 +printf "%s\n" "$ac_cv_type_mbstate_t" >&6; } + if test $ac_cv_type_mbstate_t = yes; then + +printf "%s\n" "@%:@define HAVE_MBSTATE_T 1" >>confdefs.h + + else + +printf "%s\n" "@%:@define mbstate_t int" >>confdefs.h + + fi + + + + + + + + + + GNULIB_DPRINTF=0; + GNULIB_FCLOSE=0; + GNULIB_FDOPEN=0; + GNULIB_FFLUSH=0; + GNULIB_FGETC=0; + GNULIB_FGETS=0; + GNULIB_FOPEN=0; + GNULIB_FPRINTF=0; + GNULIB_FPRINTF_POSIX=0; + GNULIB_FPURGE=0; + GNULIB_FPUTC=0; + GNULIB_FPUTS=0; + GNULIB_FREAD=0; + GNULIB_FREOPEN=0; + GNULIB_FSCANF=0; + GNULIB_FSEEK=0; + GNULIB_FSEEKO=0; + GNULIB_FTELL=0; + GNULIB_FTELLO=0; + GNULIB_FWRITE=0; + GNULIB_GETC=0; + GNULIB_GETCHAR=0; + GNULIB_GETDELIM=0; + GNULIB_GETLINE=0; + GNULIB_OBSTACK_PRINTF=0; + GNULIB_OBSTACK_PRINTF_POSIX=0; + GNULIB_PCLOSE=0; + GNULIB_PERROR=0; + GNULIB_POPEN=0; + GNULIB_PRINTF=0; + GNULIB_PRINTF_POSIX=0; + GNULIB_PUTC=0; + GNULIB_PUTCHAR=0; + GNULIB_PUTS=0; + GNULIB_REMOVE=0; + GNULIB_RENAME=0; + GNULIB_RENAMEAT=0; + GNULIB_SCANF=0; + GNULIB_SNPRINTF=0; + GNULIB_SPRINTF_POSIX=0; + GNULIB_STDIO_H_NONBLOCKING=0; + GNULIB_STDIO_H_SIGPIPE=0; + GNULIB_TMPFILE=0; + GNULIB_VASPRINTF=0; + GNULIB_VFSCANF=0; + GNULIB_VSCANF=0; + GNULIB_VDPRINTF=0; + GNULIB_VFPRINTF=0; + GNULIB_VFPRINTF_POSIX=0; + GNULIB_VPRINTF=0; + GNULIB_VPRINTF_POSIX=0; + GNULIB_VSNPRINTF=0; + GNULIB_VSPRINTF_POSIX=0; + HAVE_DECL_FPURGE=1; + HAVE_DECL_FSEEKO=1; + HAVE_DECL_FTELLO=1; + HAVE_DECL_GETDELIM=1; + HAVE_DECL_GETLINE=1; + HAVE_DECL_OBSTACK_PRINTF=1; + HAVE_DECL_SNPRINTF=1; + HAVE_DECL_VSNPRINTF=1; + HAVE_DPRINTF=1; + HAVE_FSEEKO=1; + HAVE_FTELLO=1; + HAVE_PCLOSE=1; + HAVE_POPEN=1; + HAVE_RENAMEAT=1; + HAVE_VASPRINTF=1; + HAVE_VDPRINTF=1; + REPLACE_DPRINTF=0; + REPLACE_FCLOSE=0; + REPLACE_FDOPEN=0; + REPLACE_FFLUSH=0; + REPLACE_FOPEN=0; + REPLACE_FPRINTF=0; + REPLACE_FPURGE=0; + REPLACE_FREOPEN=0; + REPLACE_FSEEK=0; + REPLACE_FSEEKO=0; + REPLACE_FTELL=0; + REPLACE_FTELLO=0; + REPLACE_GETDELIM=0; + REPLACE_GETLINE=0; + REPLACE_OBSTACK_PRINTF=0; + REPLACE_PERROR=0; + REPLACE_POPEN=0; + REPLACE_PRINTF=0; + REPLACE_REMOVE=0; + REPLACE_RENAME=0; + REPLACE_RENAMEAT=0; + REPLACE_SNPRINTF=0; + REPLACE_SPRINTF=0; + REPLACE_STDIO_READ_FUNCS=0; + REPLACE_STDIO_WRITE_FUNCS=0; + REPLACE_TMPFILE=0; + REPLACE_VASPRINTF=0; + REPLACE_VDPRINTF=0; + REPLACE_VFPRINTF=0; + REPLACE_VPRINTF=0; + REPLACE_VSNPRINTF=0; + REPLACE_VSPRINTF=0; + + + GNULIB_FCHMODAT=0; + GNULIB_FSTAT=0; + GNULIB_FSTATAT=0; + GNULIB_FUTIMENS=0; + GNULIB_LCHMOD=0; + GNULIB_LSTAT=0; + GNULIB_MKDIRAT=0; + GNULIB_MKFIFO=0; + GNULIB_MKFIFOAT=0; + GNULIB_MKNOD=0; + GNULIB_MKNODAT=0; + GNULIB_STAT=0; + GNULIB_UTIMENSAT=0; + GNULIB_OVERRIDES_STRUCT_STAT=0; + HAVE_FCHMODAT=1; + HAVE_FSTATAT=1; + HAVE_FUTIMENS=1; + HAVE_LCHMOD=1; + HAVE_LSTAT=1; + HAVE_MKDIRAT=1; + HAVE_MKFIFO=1; + HAVE_MKFIFOAT=1; + HAVE_MKNOD=1; + HAVE_MKNODAT=1; + HAVE_UTIMENSAT=1; + REPLACE_FSTAT=0; + REPLACE_FSTATAT=0; + REPLACE_FUTIMENS=0; + REPLACE_LSTAT=0; + REPLACE_MKDIR=0; + REPLACE_MKFIFO=0; + REPLACE_MKNOD=0; + REPLACE_STAT=0; + REPLACE_UTIMENSAT=0; + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5 +printf %s "checking whether stat file-mode macros are broken... " >&6; } +if test ${ac_cv_header_stat_broken+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +#if defined S_ISBLK && defined S_IFDIR +extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; +#endif + +#if defined S_ISBLK && defined S_IFCHR +extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; +#endif + +#if defined S_ISLNK && defined S_IFREG +extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; +#endif + +#if defined S_ISSOCK && defined S_IFREG +extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_header_stat_broken=no +else case e in @%:@( + e) ac_cv_header_stat_broken=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 +printf "%s\n" "$ac_cv_header_stat_broken" >&6; } +if test $ac_cv_header_stat_broken = yes; then + +printf "%s\n" "@%:@define STAT_MACROS_BROKEN 1" >>confdefs.h + +fi + + + + case "$host_os" in + mingw*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5 +printf %s "checking for 64-bit off_t... " >&6; } +if test ${gl_cv_type_off_t_64+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_off_t_64=yes +else case e in @%:@( + e) gl_cv_type_off_t_64=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5 +printf "%s\n" "$gl_cv_type_off_t_64" >&6; } + if test $gl_cv_type_off_t_64 = no; then + WINDOWS_64_BIT_OFF_T=1 + else + WINDOWS_64_BIT_OFF_T=0 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5 +printf %s "checking for 64-bit st_size... " >&6; } +if test ${gl_cv_member_st_size_64+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + struct stat buf; + int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_member_st_size_64=yes +else case e in @%:@( + e) gl_cv_member_st_size_64=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5 +printf "%s\n" "$gl_cv_member_st_size_64" >&6; } + if test $gl_cv_member_st_size_64 = no; then + WINDOWS_64_BIT_ST_SIZE=1 + else + WINDOWS_64_BIT_ST_SIZE=0 + fi + ;; + *) + WINDOWS_64_BIT_OFF_T=0 + WINDOWS_64_BIT_ST_SIZE=0 + ;; + esac + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_stat_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_stat_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/stat.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_stat_h + gl_cv_next_sys_stat_h='"'$gl_header'"' + else + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 +printf "%s\n" "$gl_cv_next_sys_stat_h" >&6; } + fi + NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/stat.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_stat_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive + + + + + + + + + WINDOWS_STAT_TIMESPEC=0 + + + + + + + + + ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include + #include +" +if test "x$ac_cv_type_nlink_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define nlink_t int" >>confdefs.h + ;; +esac +fi + + + + for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + +ac_fn_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getdtablesize" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_GETDTABLESIZE $ac_have_decl" >>confdefs.h + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_getopt_h='<'getopt.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_getopt_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_getopt_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'getopt.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_getopt_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_getopt_h + gl_cv_next_getopt_h='"'$gl_header'"' + else + gl_cv_next_getopt_h='<'getopt.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_getopt_h" >&5 +printf "%s\n" "$gl_cv_next_getopt_h" >&6; } + fi + NEXT_GETOPT_H=$gl_cv_next_getopt_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'getopt.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_getopt_h + fi + NEXT_AS_FIRST_DIRECTIVE_GETOPT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_getopt_h = yes; then + HAVE_GETOPT_H=1 + else + HAVE_GETOPT_H=0 + fi + + + gl_replace_getopt= + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + for ac_header in getopt.h +do : + ac_fn_c_check_header_compile "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" +if test "x$ac_cv_header_getopt_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_GETOPT_H 1" >>confdefs.h + +else case e in @%:@( + e) gl_replace_getopt=yes ;; +esac +fi + +done + fi + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + + for ac_func in getopt_long_only +do : + ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only" +if test "x$ac_cv_func_getopt_long_only" = xyes +then : + printf "%s\n" "@%:@define HAVE_GETOPT_LONG_ONLY 1" >>confdefs.h + +else case e in @%:@( + e) gl_replace_getopt=yes ;; +esac +fi + +done + fi + + if test -z "$gl_replace_getopt"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getopt is POSIX compatible" >&5 +printf %s "checking whether getopt is POSIX compatible... " >&6; } +if test ${gl_cv_func_getopt_posix+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $cross_compiling = no; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See 'config.log' for more details" "$LINENO" 5; } +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char a[] = "-a"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, a, foo, bar, NULL }; + int c; + + c = getopt (4, argv, "ab"); + if (!(c == 'a')) + return 1; + c = getopt (4, argv, "ab"); + if (!(c == -1)) + return 2; + if (!(optind == 2)) + return 3; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_posix=maybe +else case e in @%:@( + e) gl_cv_func_getopt_posix=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + if test $gl_cv_func_getopt_posix = maybe; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See 'config.log' for more details" "$LINENO" 5; } +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char donald[] = "donald"; + static char p[] = "-p"; + static char billy[] = "billy"; + static char duck[] = "duck"; + static char a[] = "-a"; + static char bar[] = "bar"; + char *argv[] = { program, donald, p, billy, duck, a, bar, NULL }; + int c; + + c = getopt (7, argv, "+abp:q:"); + if (!(c == -1)) + return 4; + if (!(strcmp (argv[0], "program") == 0)) + return 5; + if (!(strcmp (argv[1], "donald") == 0)) + return 6; + if (!(strcmp (argv[2], "-p") == 0)) + return 7; + if (!(strcmp (argv[3], "billy") == 0)) + return 8; + if (!(strcmp (argv[4], "duck") == 0)) + return 9; + if (!(strcmp (argv[5], "-a") == 0)) + return 10; + if (!(strcmp (argv[6], "bar") == 0)) + return 11; + if (!(optind == 1)) + return 12; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_posix=maybe +else case e in @%:@( + e) gl_cv_func_getopt_posix=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + if test $gl_cv_func_getopt_posix = maybe; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See 'config.log' for more details" "$LINENO" 5; } +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char ab[] = "-ab"; + char *argv[3] = { program, ab, NULL }; + if (getopt (2, argv, "ab:") != 'a') + return 13; + if (getopt (2, argv, "ab:") != '?') + return 14; + if (optopt != 'b') + return 15; + if (optind != 2) + return 16; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_posix=yes +else case e in @%:@( + e) gl_cv_func_getopt_posix=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + else + case "$host_os" in + darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";; + *) gl_cv_func_getopt_posix="guessing yes";; + esac + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_posix" >&5 +printf "%s\n" "$gl_cv_func_getopt_posix" >&6; } + case "$gl_cv_func_getopt_posix" in + *no) gl_replace_getopt=yes ;; + esac + fi + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5 +printf %s "checking for working GNU getopt function... " >&6; } +if test ${gl_cv_func_getopt_gnu+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the + # optstring is necessary for programs like m4 that have POSIX-mandated + # semantics for supporting options interspersed with files. + # Also, since getopt_long is a GNU extension, we require optind=0. + # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT; + # so take care to revert to the correct (non-)export state. + gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }' + case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + +#include +#if defined __MACH__ && defined __APPLE__ +/* Avoid a crash on Mac OS X. */ +#include +#include +#include +#include +#include +#include +/* The exception port on which our thread listens. */ +static mach_port_t our_exception_port; +/* The main function of the thread listening for exceptions of type + EXC_BAD_ACCESS. */ +static void * +mach_exception_thread (void *arg) +{ + /* Buffer for a message to be received. */ + struct { + mach_msg_header_t head; + mach_msg_body_t msgh_body; + char data[1024]; + } msg; + mach_msg_return_t retval; + /* Wait for a message on the exception port. */ + retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), + our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + if (retval != MACH_MSG_SUCCESS) + abort (); + exit (1); +} +static void +nocrash_init (void) +{ + mach_port_t self = mach_task_self (); + /* Allocate a port on which the thread shall listen for exceptions. */ + if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) + == KERN_SUCCESS) { + /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ + if (mach_port_insert_right (self, our_exception_port, our_exception_port, + MACH_MSG_TYPE_MAKE_SEND) + == KERN_SUCCESS) { + /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting + for us. */ + exception_mask_t mask = EXC_MASK_BAD_ACCESS; + /* Create the thread listening on the exception port. */ + pthread_attr_t attr; + pthread_t thread; + if (pthread_attr_init (&attr) == 0 + && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 + && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { + pthread_attr_destroy (&attr); + /* Replace the exception port info for these exceptions with our own. + Note that we replace the exception port for the entire task, not only + for a particular thread. This has the effect that when our exception + port gets the message, the thread specific exception port has already + been asked, and we don't need to bother about it. + See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ + task_set_exception_ports (self, mask, our_exception_port, + EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); + } + } + } +} +#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Avoid a crash on native Windows. */ +#define WIN32_LEAN_AND_MEAN +#include +#include +static LONG WINAPI +exception_filter (EXCEPTION_POINTERS *ExceptionInfo) +{ + switch (ExceptionInfo->ExceptionRecord->ExceptionCode) + { + case EXCEPTION_ACCESS_VIOLATION: + case EXCEPTION_IN_PAGE_ERROR: + case EXCEPTION_STACK_OVERFLOW: + case EXCEPTION_GUARD_PAGE: + case EXCEPTION_PRIV_INSTRUCTION: + case EXCEPTION_ILLEGAL_INSTRUCTION: + case EXCEPTION_DATATYPE_MISALIGNMENT: + case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: + case EXCEPTION_NONCONTINUABLE_EXCEPTION: + exit (1); + } + return EXCEPTION_CONTINUE_SEARCH; +} +static void +nocrash_init (void) +{ + SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter); +} +#else +/* Avoid a crash on POSIX systems. */ +#include +#include +/* A POSIX signal handler. */ +static void +exception_handler (int sig) +{ + _exit (1); +} +static void +nocrash_init (void) +{ +#ifdef SIGSEGV + signal (SIGSEGV, exception_handler); +#endif +#ifdef SIGBUS + signal (SIGBUS, exception_handler); +#endif +} +#endif + + +int +main (void) +{ + + int result = 0; + + nocrash_init(); + + /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw, + and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5, + OSF/1 5.1, Solaris 10. */ + { + static char conftest[] = "conftest"; + static char plus[] = "-+"; + char *argv[3] = { conftest, plus, NULL }; + opterr = 0; + if (getopt (2, argv, "+a") != '?') + result |= 1; + } + /* This code succeeds on glibc 2.8, mingw, + and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11, + IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */ + { + static char program[] = "program"; + static char p[] = "-p"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, p, foo, bar, NULL }; + + optind = 1; + if (getopt (4, argv, "p::") != 'p') + result |= 2; + else if (optarg != NULL) + result |= 4; + else if (getopt (4, argv, "p::") != -1) + result |= 6; + else if (optind != 2) + result |= 8; + } + /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */ + { + static char program[] = "program"; + static char foo[] = "foo"; + static char p[] = "-p"; + char *argv[] = { program, foo, p, NULL }; + optind = 0; + if (getopt (3, argv, "-p") != 1) + result |= 16; + else if (getopt (3, argv, "-p") != 'p') + result |= 16; + } + /* This code fails on glibc 2.11. */ + { + static char program[] = "program"; + static char b[] = "-b"; + static char a[] = "-a"; + char *argv[] = { program, b, a, NULL }; + optind = opterr = 0; + if (getopt (3, argv, "+:a:b") != 'b') + result |= 32; + else if (getopt (3, argv, "+:a:b") != ':') + result |= 32; + } + /* This code dumps core on glibc 2.14. */ + { + static char program[] = "program"; + static char w[] = "-W"; + static char dummy[] = "dummy"; + char *argv[] = { program, w, dummy, NULL }; + optind = opterr = 1; + if (getopt (3, argv, "W;") != 'W') + result |= 64; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_gnu=yes +else case e in @%:@( + e) gl_cv_func_getopt_gnu=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + case $gl_had_POSIXLY_CORRECT in + exported) ;; + yes) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;}; POSIXLY_CORRECT=1 ;; + *) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;} ;; + esac + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5 +printf "%s\n" "$gl_cv_func_getopt_gnu" >&6; } + if test "$gl_cv_func_getopt_gnu" != yes; then + gl_replace_getopt=yes + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt_long function" >&5 +printf %s "checking for working GNU getopt_long function... " >&6; } +if test ${gl_cv_func_getopt_long_gnu+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + openbsd*) gl_cv_func_getopt_long_gnu="guessing no";; + *) gl_cv_func_getopt_long_gnu="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + +int +main (void) +{ +static const struct option long_options[] = + { + { "xtremely-",no_argument, NULL, 1003 }, + { "xtra", no_argument, NULL, 1001 }, + { "xtreme", no_argument, NULL, 1002 }, + { "xtremely", no_argument, NULL, 1003 }, + { NULL, 0, NULL, 0 } + }; + /* This code fails on OpenBSD 5.0. */ + { + static char program[] = "program"; + static char xtremel[] = "--xtremel"; + char *argv[] = { program, xtremel, NULL }; + int option_index; + optind = 1; opterr = 0; + if (getopt_long (2, argv, "", long_options, &option_index) != 1003) + return 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_long_gnu=yes +else case e in @%:@( + e) gl_cv_func_getopt_long_gnu=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_long_gnu" >&5 +printf "%s\n" "$gl_cv_func_getopt_long_gnu" >&6; } + case "$gl_cv_func_getopt_long_gnu" in + *yes) ;; + *) gl_replace_getopt=yes ;; + esac + fi + fi + + + + +: + + + + GNULIB_GETTIMEOFDAY=0; + HAVE_GETTIMEOFDAY=1; + HAVE_STRUCT_TIMEVAL=1; + HAVE_SYS_TIME_H=1; + REPLACE_GETTIMEOFDAY=0; + REPLACE_STRUCT_TIMEVAL=0; + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 +printf %s "checking for C/C++ restrict keyword... " >&6; } +if test ${ac_cv_c_restrict+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_c_restrict=no + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +typedef int *int_ptr; + int foo (int_ptr $ac_kw ip) { return ip[0]; } + int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ + int bar (int ip[$ac_kw]) { return ip[0]; } + +int +main (void) +{ +int s[1]; + int *$ac_kw t = s; + t[0] = 0; + return foo (t) + bar (t); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_restrict=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$ac_cv_c_restrict" != no && break + done + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 +printf "%s\n" "$ac_cv_c_restrict" >&6; } + + case $ac_cv_c_restrict in + restrict) ;; + no) printf "%s\n" "@%:@define restrict /**/" >>confdefs.h + ;; + *) printf "%s\n" "@%:@define restrict $ac_cv_c_restrict" >>confdefs.h + ;; + esac + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_time_h='<'sys/time.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_time_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_time_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/time.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_time_h + gl_cv_next_sys_time_h='"'$gl_header'"' + else + gl_cv_next_sys_time_h='<'sys/time.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5 +printf "%s\n" "$gl_cv_next_sys_time_h" >&6; } + fi + NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/time.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_time_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive + + + + + + if test $ac_cv_header_sys_time_h != yes; then + HAVE_SYS_TIME_H=0 + fi + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5 +printf %s "checking for struct timeval... " >&6; } +if test ${gl_cv_sys_struct_timeval+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_SYS_TIME_H + #include + #endif + #include + #if HAVE_WINSOCK2_H + # include + #endif + +int +main (void) +{ +static struct timeval x; x.tv_sec = x.tv_usec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timeval=yes +else case e in @%:@( + e) gl_cv_sys_struct_timeval=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5 +printf "%s\n" "$gl_cv_sys_struct_timeval" >&6; } + if test $gl_cv_sys_struct_timeval != yes; then + HAVE_STRUCT_TIMEVAL=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5 +printf %s "checking for wide-enough struct timeval.tv_sec member... " >&6; } +if test ${gl_cv_sys_struct_timeval_tv_sec+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_SYS_TIME_H + #include + #endif + #include + #if HAVE_WINSOCK2_H + # include + #endif + +int +main (void) +{ +static struct timeval x; + typedef int verify_tv_sec_type[ + sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1 + ]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timeval_tv_sec=yes +else case e in @%:@( + e) gl_cv_sys_struct_timeval_tv_sec=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5 +printf "%s\n" "$gl_cv_sys_struct_timeval_tv_sec" >&6; } + if test $gl_cv_sys_struct_timeval_tv_sec != yes; then + REPLACE_STRUCT_TIMEVAL=1 + fi + fi + + + for gl_func in gettimeofday; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if HAVE_SYS_TIME_H +# include +#endif +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + NEED_LOCALTIME_BUFFER=0 + + + GNULIB_CTIME=0; + GNULIB_MKTIME=0; + GNULIB_LOCALTIME=0; + GNULIB_NANOSLEEP=0; + GNULIB_STRFTIME=0; + GNULIB_STRPTIME=0; + GNULIB_TIMEGM=0; + GNULIB_TIME_R=0; + GNULIB_TIME_RZ=0; + GNULIB_TZSET=0; + HAVE_DECL_LOCALTIME_R=1; + HAVE_NANOSLEEP=1; + HAVE_STRPTIME=1; + HAVE_TIMEGM=1; + HAVE_TZSET=1; + HAVE_TIMEZONE_T=0; + REPLACE_CTIME=GNULIB_PORTCHECK; + REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; + REPLACE_MKTIME=GNULIB_PORTCHECK; + REPLACE_NANOSLEEP=GNULIB_PORTCHECK; + REPLACE_STRFTIME=GNULIB_PORTCHECK; + REPLACE_TIMEGM=GNULIB_PORTCHECK; + REPLACE_TZSET=GNULIB_PORTCHECK; + + : ${GNULIB_GETTIMEOFDAY=0}; + REPLACE_GMTIME=0; + REPLACE_LOCALTIME=0; + + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +@%:@ Check whether --with-libiconv-prefix was given. +if test ${with_libiconv_prefix+y} +then : + withval=$with_libiconv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBICONV= + LTLIBICONV= + INCICONV= + LIBICONV_PREFIX= + HAVE_LIBICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + + + + + + + GNULIB_ICONV=0; + ICONV_CONST=; + REPLACE_ICONV=0; + REPLACE_ICONV_OPEN=0; + REPLACE_ICONV_UTF=0; + ICONV_H=''; + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + + + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +printf %s "checking for iconv... " >&6; } +if test ${am_cv_func_iconv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +printf "%s\n" "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +printf %s "checking for working iconv... " >&6; } +if test ${am_cv_func_iconv_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + if test "$cross_compiling" = yes +then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + +int +main (void) +{ +int result = 0; + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\263"; + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + result |= 8; + iconv_close (cd_88591_to_utf8); + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + result |= 16; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + am_cv_func_iconv_works=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + test "$am_cv_func_iconv_works" = no || break + done + LIBS="$am_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +printf "%s\n" "$am_cv_func_iconv_works" >&6; } + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + +printf "%s\n" "@%:@define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +printf %s "checking how to link with libiconv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +printf "%s\n" "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 +printf %s "checking for iconv declaration... " >&6; } + if test ${am_cv_proto_iconv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + am_cv_proto_iconv_arg1="" +else case e in @%:@( + e) am_cv_proto_iconv_arg1="const" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" ;; +esac +fi + + am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: + $am_cv_proto_iconv" >&5 +printf "%s\n" " + $am_cv_proto_iconv" >&6; } + else + am_cv_proto_iconv_arg1="" + fi + +printf "%s\n" "@%:@define ICONV_CONST $am_cv_proto_iconv_arg1" >>confdefs.h + + + if test -n "$am_cv_proto_iconv_arg1"; then + ICONV_CONST="const" + fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo (void) {return 0; } +$ac_kw foo_t foo (void) {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define off_t long int" >>confdefs.h + ;; +esac +fi + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_limits_h='<'limits.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_limits_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_limits_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'limits.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_limits_h + gl_cv_next_limits_h='"'$gl_header'"' + else + gl_cv_next_limits_h='<'limits.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5 +printf "%s\n" "$gl_cv_next_limits_h" >&6; } + fi + NEXT_LIMITS_H=$gl_cv_next_limits_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'limits.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_limits_h + fi + NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether limits.h has ULLONG_WIDTH etc." >&5 +printf %s "checking whether limits.h has ULLONG_WIDTH etc.... " >&6; } +if test ${gl_cv_header_limits_width+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include + int ullw = ULLONG_WIDTH; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_limits_width=yes +else case e in @%:@( + e) gl_cv_header_limits_width=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5 +printf "%s\n" "$gl_cv_header_limits_width" >&6; } + if test "$gl_cv_header_limits_width" = yes; then + LIMITS_H= + else + LIMITS_H=limits.h + fi + + if test -n "$LIMITS_H"; then + GL_GENERATE_LIMITS_H_TRUE= + GL_GENERATE_LIMITS_H_FALSE='#' +else + GL_GENERATE_LIMITS_H_TRUE='#' + GL_GENERATE_LIMITS_H_FALSE= +fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 +printf %s "checking for wint_t... " >&6; } +if test ${gt_cv_c_wint_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include + wint_t foo = (wchar_t)'\0'; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_c_wint_t=yes +else case e in @%:@( + e) gt_cv_c_wint_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 +printf "%s\n" "$gt_cv_c_wint_t" >&6; } + if test $gt_cv_c_wint_t = yes; then + +printf "%s\n" "@%:@define HAVE_WINT_T 1" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wint_t is too small" >&5 +printf %s "checking whether wint_t is too small... " >&6; } +if test ${gl_cv_type_wint_t_too_small+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +#endif +#include + int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wint_t_too_small=no +else case e in @%:@( + e) gl_cv_type_wint_t_too_small=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_too_small" >&5 +printf "%s\n" "$gl_cv_type_wint_t_too_small" >&6; } + if test $gl_cv_type_wint_t_too_small = yes; then + GNULIB_OVERRIDES_WINT_T=1 + else + GNULIB_OVERRIDES_WINT_T=0 + fi + else + GNULIB_OVERRIDES_WINT_T=0 + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 +printf %s "checking for unsigned long long int... " >&6; } +if test ${ac_cv_type_unsigned_long_long_int+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_type_unsigned_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; +int +main (void) +{ +/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in @%:@( + e) ac_cv_type_unsigned_long_long_int=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; } + if test $ac_cv_type_unsigned_long_long_int = yes; then + +printf "%s\n" "@%:@define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h + + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 +printf %s "checking for long long int... " >&6; } +if test ${ac_cv_type_long_long_int+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_type_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_long_long_int = yes; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include + @%:@ifndef LLONG_MAX + @%:@ define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + @%:@ define LLONG_MAX (HALF - 1 + HALF) + @%:@endif +int +main (void) +{ +long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + +else case e in @%:@( + e) ac_cv_type_long_long_int=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_long_long_int" >&6; } + if test $ac_cv_type_long_long_int = yes; then + +printf "%s\n" "@%:@define HAVE_LONG_LONG_INT 1" >>confdefs.h + + fi + + + + gl_cv_c_multiarch=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + arch= + prev= + for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do + if test -n "$prev"; then + case $word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$arch" || test "$arch" = "$word"; then + arch="$word" + else + gl_cv_c_multiarch=yes + fi + ;; + esac + prev= + else + if test "x$word" = "x-arch"; then + prev=arch + fi + fi + done + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $gl_cv_c_multiarch = yes; then + APPLE_UNIVERSAL_BUILD=1 + else + APPLE_UNIVERSAL_BUILD=0 + fi + + + + + + + + + if test $ac_cv_type_long_long_int = yes; then + HAVE_LONG_LONG_INT=1 + else + HAVE_LONG_LONG_INT=0 + fi + + + if test $ac_cv_type_unsigned_long_long_int = yes; then + HAVE_UNSIGNED_LONG_LONG_INT=1 + else + HAVE_UNSIGNED_LONG_LONG_INT=0 + fi + + + + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + + + if test $ac_cv_header_inttypes_h = yes; then + HAVE_INTTYPES_H=1 + else + HAVE_INTTYPES_H=0 + fi + + + if test $ac_cv_header_sys_types_h = yes; then + HAVE_SYS_TYPES_H=1 + else + HAVE_SYS_TYPES_H=0 + fi + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdint_h='<'stdint.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_stdint_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_stdint_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdint.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdint_h + gl_cv_next_stdint_h='"'$gl_header'"' + else + gl_cv_next_stdint_h='<'stdint.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5 +printf "%s\n" "$gl_cv_next_stdint_h" >&6; } + fi + NEXT_STDINT_H=$gl_cv_next_stdint_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdint.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdint_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_stdint_h = yes; then + HAVE_STDINT_H=1 + else + HAVE_STDINT_H=0 + fi + + + if test $ac_cv_header_stdint_h = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5 +printf %s "checking whether stdint.h conforms to C99... " >&6; } +if test ${gl_cv_header_working_stdint_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gl_cv_header_working_stdint_h=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 +#include +/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ +#if !(defined WCHAR_MIN && defined WCHAR_MAX) +#error "WCHAR_MIN, WCHAR_MAX not defined in " +#endif + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + +#ifdef INT8_MAX +int8_t a1 = INT8_MAX; +int8_t a1min = INT8_MIN; +#endif +#ifdef INT16_MAX +int16_t a2 = INT16_MAX; +int16_t a2min = INT16_MIN; +#endif +#ifdef INT32_MAX +int32_t a3 = INT32_MAX; +int32_t a3min = INT32_MIN; +#endif +#ifdef INT64_MAX +int64_t a4 = INT64_MAX; +int64_t a4min = INT64_MIN; +#endif +#ifdef UINT8_MAX +uint8_t b1 = UINT8_MAX; +#else +typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; +#endif +#ifdef UINT16_MAX +uint16_t b2 = UINT16_MAX; +#endif +#ifdef UINT32_MAX +uint32_t b3 = UINT32_MAX; +#endif +#ifdef UINT64_MAX +uint64_t b4 = UINT64_MAX; +#endif +int_least8_t c1 = INT8_C (0x7f); +int_least8_t c1max = INT_LEAST8_MAX; +int_least8_t c1min = INT_LEAST8_MIN; +int_least16_t c2 = INT16_C (0x7fff); +int_least16_t c2max = INT_LEAST16_MAX; +int_least16_t c2min = INT_LEAST16_MIN; +int_least32_t c3 = INT32_C (0x7fffffff); +int_least32_t c3max = INT_LEAST32_MAX; +int_least32_t c3min = INT_LEAST32_MIN; +int_least64_t c4 = INT64_C (0x7fffffffffffffff); +int_least64_t c4max = INT_LEAST64_MAX; +int_least64_t c4min = INT_LEAST64_MIN; +uint_least8_t d1 = UINT8_C (0xff); +uint_least8_t d1max = UINT_LEAST8_MAX; +uint_least16_t d2 = UINT16_C (0xffff); +uint_least16_t d2max = UINT_LEAST16_MAX; +uint_least32_t d3 = UINT32_C (0xffffffff); +uint_least32_t d3max = UINT_LEAST32_MAX; +uint_least64_t d4 = UINT64_C (0xffffffffffffffff); +uint_least64_t d4max = UINT_LEAST64_MAX; +int_fast8_t e1 = INT_FAST8_MAX; +int_fast8_t e1min = INT_FAST8_MIN; +int_fast16_t e2 = INT_FAST16_MAX; +int_fast16_t e2min = INT_FAST16_MIN; +int_fast32_t e3 = INT_FAST32_MAX; +int_fast32_t e3min = INT_FAST32_MIN; +int_fast64_t e4 = INT_FAST64_MAX; +int_fast64_t e4min = INT_FAST64_MIN; +uint_fast8_t f1 = UINT_FAST8_MAX; +uint_fast16_t f2 = UINT_FAST16_MAX; +uint_fast32_t f3 = UINT_FAST32_MAX; +uint_fast64_t f4 = UINT_FAST64_MAX; +#ifdef INTPTR_MAX +intptr_t g = INTPTR_MAX; +intptr_t gmin = INTPTR_MIN; +#endif +#ifdef UINTPTR_MAX +uintptr_t h = UINTPTR_MAX; +#endif +intmax_t i = INTMAX_MAX; +uintmax_t j = UINTMAX_MAX; + +/* Check that SIZE_MAX has the correct type, if possible. */ +#if 201112 <= __STDC_VERSION__ +int k = _Generic (SIZE_MAX, size_t: 0); +#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) +extern size_t k; +extern __typeof__ (SIZE_MAX) k; +#endif + +#include /* for CHAR_BIT */ +#define TYPE_MINIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) +#define TYPE_MAXIMUM(t) \ + ((t) ((t) 0 < (t) -1 \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) +struct s { + int check_PTRDIFF: + PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) + && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) + ? 1 : -1; + /* Detect bug in FreeBSD 6.0 / ia64. */ + int check_SIG_ATOMIC: + SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) + && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) + ? 1 : -1; + int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; + int check_WCHAR: + WCHAR_MIN == TYPE_MINIMUM (wchar_t) + && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) + ? 1 : -1; + /* Detect bug in mingw. */ + int check_WINT: + WINT_MIN == TYPE_MINIMUM (wint_t) + && WINT_MAX == TYPE_MAXIMUM (wint_t) + ? 1 : -1; + + /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ + int check_UINT8_C: + (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; + int check_UINT16_C: + (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; + + /* Detect bugs in OpenBSD 3.9 stdint.h. */ +#ifdef UINT8_MAX + int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; +#endif +#ifdef UINT16_MAX + int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; +#endif +#ifdef UINT32_MAX + int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; +#endif +#ifdef UINT64_MAX + int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; +#endif + int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; + int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; + int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; + int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; + int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; + int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; + int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; + int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; + int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; + int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; + int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; +}; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test "$cross_compiling" = yes +then : + gl_cv_header_working_stdint_h=yes + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 +#include + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + +#include +#include +#define MVAL(macro) MVAL1(macro) +#define MVAL1(expression) #expression +static const char *macro_values[] = + { +#ifdef INT8_MAX + MVAL (INT8_MAX), +#endif +#ifdef INT16_MAX + MVAL (INT16_MAX), +#endif +#ifdef INT32_MAX + MVAL (INT32_MAX), +#endif +#ifdef INT64_MAX + MVAL (INT64_MAX), +#endif +#ifdef UINT8_MAX + MVAL (UINT8_MAX), +#endif +#ifdef UINT16_MAX + MVAL (UINT16_MAX), +#endif +#ifdef UINT32_MAX + MVAL (UINT32_MAX), +#endif +#ifdef UINT64_MAX + MVAL (UINT64_MAX), +#endif + NULL + }; + +int +main (void) +{ + + const char **mv; + for (mv = macro_values; *mv != NULL; mv++) + { + const char *value = *mv; + /* Test whether it looks like a cast expression. */ + if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 + || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 + || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 + || strncmp (value, "((int)"/*)*/, 6) == 0 + || strncmp (value, "((signed short)"/*)*/, 15) == 0 + || strncmp (value, "((signed char)"/*)*/, 14) == 0) + return mv - macro_values + 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_header_working_stdint_h=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 +printf "%s\n" "$gl_cv_header_working_stdint_h" >&6; } + fi + + HAVE_C99_STDINT_H=0 + HAVE_SYS_BITYPES_H=0 + HAVE_SYS_INTTYPES_H=0 + STDINT_H=stdint.h + if test "$gl_cv_header_working_stdint_h" = yes; then + HAVE_C99_STDINT_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h predates C++11" >&5 +printf %s "checking whether stdint.h predates C++11... " >&6; } +if test ${gl_cv_header_stdint_predates_cxx11_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gl_cv_header_stdint_predates_cxx11_h=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + +intmax_t im = INTMAX_MAX; +int32_t i32 = INT32_C (0x7fffffff); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_stdint_predates_cxx11_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_predates_cxx11_h" >&5 +printf "%s\n" "$gl_cv_header_stdint_predates_cxx11_h" >&6; } + + if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + +printf "%s\n" "@%:@define __STDC_CONSTANT_MACROS 1" >>confdefs.h + + +printf "%s\n" "@%:@define __STDC_LIMIT_MACROS 1" >>confdefs.h + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5 +printf %s "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; } +if test ${gl_cv_header_stdint_width+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gl_cv_header_stdint_width=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 + #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + int iw = UINTMAX_WIDTH; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_stdint_width=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5 +printf "%s\n" "$gl_cv_header_stdint_width" >&6; } + if test "$gl_cv_header_stdint_width" = yes; then + STDINT_H= + fi + else + ac_fn_c_check_header_compile "$LINENO" "sys/inttypes.h" "ac_cv_header_sys_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_inttypes_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_SYS_INTTYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/bitypes.h" "ac_cv_header_sys_bitypes_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_bitypes_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_SYS_BITYPES_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_sys_inttypes_h = yes; then + HAVE_SYS_INTTYPES_H=1 + fi + if test $ac_cv_header_sys_bitypes_h = yes; then + HAVE_SYS_BITYPES_H=1 + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + + for gltype in ptrdiff_t size_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +printf %s "checking for bit size of $gltype... " >&6; } +if eval test \${gl_cv_bitsizeof_${gltype}+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + +#include " +then : + +else case e in @%:@( + e) result=unknown ;; +esac +fi + + eval gl_cv_bitsizeof_${gltype}=\$result + ;; +esac +fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + printf "%s\n" "@%:@define BITSIZEOF_${GLTYPE} $result" >>confdefs.h + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +printf %s "checking for bit size of $gltype... " >&6; } +if eval test \${gl_cv_bitsizeof_${gltype}+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + +#include " +then : + +else case e in @%:@( + e) result=unknown ;; +esac +fi + + eval gl_cv_bitsizeof_${gltype}=\$result + ;; +esac +fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + printf "%s\n" "@%:@define BITSIZEOF_${GLTYPE} $result" >>confdefs.h + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 +printf %s "checking whether $gltype is signed... " >&6; } +if eval test \${gl_cv_type_${gltype}_signed+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + result=yes +else case e in @%:@( + e) result=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval gl_cv_type_${gltype}_signed=\$result + ;; +esac +fi +eval ac_res=\$gl_cv_type_${gltype}_signed + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval result=\$gl_cv_type_${gltype}_signed + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + if test "$result" = yes; then + printf "%s\n" "@%:@define HAVE_SIGNED_${GLTYPE} 1" >>confdefs.h + + eval HAVE_SIGNED_${GLTYPE}=1 + else + eval HAVE_SIGNED_${GLTYPE}=0 + fi + done + + + gl_cv_type_ptrdiff_t_signed=yes + gl_cv_type_size_t_signed=no + if test $APPLE_UNIVERSAL_BUILD = 0; then + + + for gltype in ptrdiff_t size_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +printf %s "checking for $gltype integer literal suffix... " >&6; } +if eval test \${gl_cv_type_${gltype}_suffix+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + extern $gltype foo; + extern $gltype1 foo; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval gl_cv_type_${gltype}_suffix=\$glsuf +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done ;; +esac +fi +eval ac_res=\$gl_cv_type_${gltype}_suffix + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + printf "%s\n" "@%:@define ${GLTYPE}_SUFFIX $result" >>confdefs.h + + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +printf %s "checking for $gltype integer literal suffix... " >&6; } +if eval test \${gl_cv_type_${gltype}_suffix+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + extern $gltype foo; + extern $gltype1 foo; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval gl_cv_type_${gltype}_suffix=\$glsuf +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done ;; +esac +fi +eval ac_res=\$gl_cv_type_${gltype}_suffix + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + printf "%s\n" "@%:@define ${GLTYPE}_SUFFIX $result" >>confdefs.h + + done + + + + if test $GNULIB_OVERRIDES_WINT_T = 1; then + BITSIZEOF_WINT_T=32 + fi + + fi + + LIMITS_H=limits.h + if test -n "$LIMITS_H"; then + GL_GENERATE_LIMITS_H_TRUE= + GL_GENERATE_LIMITS_H_FALSE='#' +else + GL_GENERATE_LIMITS_H_TRUE='#' + GL_GENERATE_LIMITS_H_FALSE= +fi + + + + + + + if test -n "$STDINT_H"; then + GL_GENERATE_STDINT_H_TRUE= + GL_GENERATE_STDINT_H_FALSE='#' +else + GL_GENERATE_STDINT_H_TRUE='#' + GL_GENERATE_STDINT_H_FALSE= +fi + + + + GNULIB_IMAXABS=0; + GNULIB_IMAXDIV=0; + GNULIB_STRTOIMAX=0; + GNULIB_STRTOUMAX=0; + HAVE_DECL_IMAXABS=1; + HAVE_DECL_IMAXDIV=1; + HAVE_DECL_STRTOIMAX=1; + HAVE_DECL_STRTOUMAX=1; + REPLACE_STRTOIMAX=0; + REPLACE_STRTOUMAX=0; + INT32_MAX_LT_INTMAX_MAX=1; + INT64_MAX_EQ_LONG_MAX='defined _LP64'; + PRI_MACROS_BROKEN=0; + PRIPTR_PREFIX=__PRIPTR_PREFIX; + UINT32_MAX_LT_UINTMAX_MAX=1; + UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_inttypes_h='<'inttypes.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_inttypes_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_inttypes_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'inttypes.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_inttypes_h + gl_cv_next_inttypes_h='"'$gl_header'"' + else + gl_cv_next_inttypes_h='<'inttypes.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5 +printf "%s\n" "$gl_cv_next_inttypes_h" >&6; } + fi + NEXT_INTTYPES_H=$gl_cv_next_inttypes_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'inttypes.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_inttypes_h + fi + NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive + + + + + + + + + for gl_func in imaxabs imaxdiv strtoimax strtoumax; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + ac_fn_c_check_header_compile "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_inttypes_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_INTTYPES_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_inttypes_h = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5 +printf %s "checking whether the inttypes.h PRIxNN macros are broken... " >&6; } +if test ${gt_cv_inttypes_pri_broken+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef PRId32 +char *p = PRId32; +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_inttypes_pri_broken=no +else case e in @%:@( + e) gt_cv_inttypes_pri_broken=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5 +printf "%s\n" "$gt_cv_inttypes_pri_broken" >&6; } + fi + if test "$gt_cv_inttypes_pri_broken" = yes; then + +printf "%s\n" "@%:@define PRI_MACROS_BROKEN 1" >>confdefs.h + + PRI_MACROS_BROKEN=1 + else + PRI_MACROS_BROKEN=0 + fi + + + + GNULIB_ISWBLANK=0; + GNULIB_WCTYPE=0; + GNULIB_ISWCTYPE=0; + GNULIB_WCTRANS=0; + GNULIB_TOWCTRANS=0; + HAVE_ISWBLANK=1; + HAVE_WCTYPE_T=1; + HAVE_WCTRANS_T=1; + REPLACE_ISWBLANK=0; + + + + + + if test $ac_cv_header_crtdefs_h = yes; then + HAVE_CRTDEFS_H=1 + else + HAVE_CRTDEFS_H=0 + fi + + + + + + + + if test $ac_cv_func_iswcntrl = yes; then + HAVE_ISWCNTRL=1 + else + HAVE_ISWCNTRL=0 + fi + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wctype_h='<'wctype.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_wctype_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_wctype_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wctype_h + gl_cv_next_wctype_h='"'$gl_header'"' + else + gl_cv_next_wctype_h='<'wctype.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 +printf "%s\n" "$gl_cv_next_wctype_h" >&6; } + fi + NEXT_WCTYPE_H=$gl_cv_next_wctype_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'wctype.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_wctype_h + fi + NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_wctype_h = yes; then + if test $ac_cv_func_iswcntrl = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 +printf %s "checking whether iswcntrl works... " >&6; } +if test ${gl_cv_func_iswcntrl_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #if __GNU_LIBRARY__ == 1 + Linux libc5 i18n is broken. + #endif +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_iswcntrl_works="guessing yes" +else case e in @%:@( + e) gl_cv_func_iswcntrl_works="guessing no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + int main () { return iswprint ('x') == 0; } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_iswcntrl_works=yes +else case e in @%:@( + e) gl_cv_func_iswcntrl_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 +printf "%s\n" "$gl_cv_func_iswcntrl_works" >&6; } + fi + HAVE_WCTYPE_H=1 + else + HAVE_WCTYPE_H=0 + fi + + + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + fi + + if test $REPLACE_ISWCNTRL = 1; then + REPLACE_TOWLOWER=1 + else + ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" +if test "x$ac_cv_func_towlower" = xyes +then : + printf "%s\n" "@%:@define HAVE_TOWLOWER 1" >>confdefs.h + +fi + + if test $ac_cv_func_towlower = yes; then + REPLACE_TOWLOWER=0 + else + ac_fn_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_towlower" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_TOWLOWER $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_towlower = yes; then + REPLACE_TOWLOWER=1 + else + REPLACE_TOWLOWER=0 + fi + fi + fi + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then + : + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 +printf %s "checking for wctype_t... " >&6; } +if test ${gl_cv_type_wctype_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + wctype_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctype_t=yes +else case e in @%:@( + e) gl_cv_type_wctype_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 +printf "%s\n" "$gl_cv_type_wctype_t" >&6; } + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 +printf %s "checking for wctrans_t... " >&6; } +if test ${gl_cv_type_wctrans_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + wctrans_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctrans_t=yes +else case e in @%:@( + e) gl_cv_type_wctrans_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 +printf "%s\n" "$gl_cv_type_wctrans_t" >&6; } + if test $gl_cv_type_wctrans_t = no; then + HAVE_WCTRANS_T=0 + fi + + + for gl_func in wctype iswctype wctrans towctrans ; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +# include +#endif +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + GNULIB_NL_LANGINFO=0; + HAVE_NL_LANGINFO=1; + REPLACE_NL_LANGINFO=0; + + +ac_fn_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getc_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_GETC_UNLOCKED $ac_have_decl" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library >= 2.1 or uClibc" >&5 +printf %s "checking whether we are using the GNU C Library >= 2.1 or uClibc... " >&6; } +if test ${ac_cv_gnu_library_2_1+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif +#ifdef __UCLIBC__ + Lucky user +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "Lucky" >/dev/null 2>&1 +then : + ac_cv_gnu_library_2_1=yes +else case e in @%:@( + e) ac_cv_gnu_library_2_1=no ;; +esac +fi +rm -rf conftest* + + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5 +printf "%s\n" "$ac_cv_gnu_library_2_1" >&6; } + + GLIBC21="$ac_cv_gnu_library_2_1" + + + + GNULIB_LOCALECONV=0; + GNULIB_SETLOCALE=0; + GNULIB_DUPLOCALE=0; + HAVE_DUPLOCALE=1; + REPLACE_LOCALECONV=0; + REPLACE_SETLOCALE=0; + REPLACE_DUPLOCALE=0; + REPLACE_STRUCT_LCONV=0; + + + REPLACE_NULL=0; + HAVE_MAX_ALIGN_T=1; + HAVE_WCHAR_T=1; + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 +printf %s "checking for wchar_t... " >&6; } +if test ${gt_cv_c_wchar_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + wchar_t foo = (wchar_t)'\0'; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_c_wchar_t=yes +else case e in @%:@( + e) gt_cv_c_wchar_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 +printf "%s\n" "$gt_cv_c_wchar_t" >&6; } + if test $gt_cv_c_wchar_t = yes; then + +printf "%s\n" "@%:@define HAVE_WCHAR_T 1" >>confdefs.h + + fi + + + + + STDDEF_H= + ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include + +" +if test "x$ac_cv_type_max_align_t" = xyes +then : + +else case e in @%:@( + e) HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h ;; +esac +fi + + if test $gt_cv_c_wchar_t = no; then + HAVE_WCHAR_T=0 + STDDEF_H=stddef.h + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 +printf %s "checking whether NULL can be used in arbitrary expressions... " >&6; } +if test ${gl_cv_decl_null_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int test[2 * (sizeof NULL == sizeof (void *)) -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_null_works=yes +else case e in @%:@( + e) gl_cv_decl_null_works=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 +printf "%s\n" "$gl_cv_decl_null_works" >&6; } + if test $gl_cv_decl_null_works = no; then + REPLACE_NULL=1 + STDDEF_H=stddef.h + fi + + if test -n "$STDDEF_H"; then + GL_GENERATE_STDDEF_H_TRUE= + GL_GENERATE_STDDEF_H_FALSE='#' +else + GL_GENERATE_STDDEF_H_TRUE='#' + GL_GENERATE_STDDEF_H_FALSE= +fi + + if test -n "$STDDEF_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stddef_h='<'stddef.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_stddef_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stddef.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stddef_h + gl_cv_next_stddef_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 +printf "%s\n" "$gl_cv_next_stddef_h" >&6; } + fi + NEXT_STDDEF_H=$gl_cv_next_stddef_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stddef.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stddef_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive + + + + + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 +printf %s "checking whether lstat correctly handles trailing slash... " >&6; } +if test ${gl_cv_func_lstat_dereferences_slashed_symlink+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) rm -f conftest.sym conftest.file + echo >conftest.file + if test "$cross_compiling" = yes +then : + case "$host_os" in + *-gnu*) + # Guess yes on glibc systems. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; + *) + # If we don't know, assume the worst. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ +struct stat sbuf; + if (symlink ("conftest.file", "conftest.sym") != 0) + return 1; + /* Linux will dereference the symlink and fail, as required by + POSIX. That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_lstat_dereferences_slashed_symlink=yes +else case e in @%:@( + e) gl_cv_func_lstat_dereferences_slashed_symlink=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.sym conftest.file + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5 +printf "%s\n" "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; } + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *yes) + +printf "%s\n" "@%:@define LSTAT_FOLLOWS_SLASHED_SYMLINK 1" >>confdefs.h + + ;; + esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in @%:@( +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +@%:@( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + + + GNULIB__EXIT=0; + GNULIB_ATOLL=0; + GNULIB_CALLOC_POSIX=0; + GNULIB_CANONICALIZE_FILE_NAME=0; + GNULIB_GETLOADAVG=0; + GNULIB_GETSUBOPT=0; + GNULIB_GRANTPT=0; + GNULIB_MALLOC_POSIX=0; + GNULIB_MBTOWC=0; + GNULIB_MKDTEMP=0; + GNULIB_MKOSTEMP=0; + GNULIB_MKOSTEMPS=0; + GNULIB_MKSTEMP=0; + GNULIB_MKSTEMPS=0; + GNULIB_POSIX_OPENPT=0; + GNULIB_PTSNAME=0; + GNULIB_PTSNAME_R=0; + GNULIB_PUTENV=0; + GNULIB_QSORT_R=0; + GNULIB_RANDOM=0; + GNULIB_RANDOM_R=0; + GNULIB_REALLOC_POSIX=0; + GNULIB_REALPATH=0; + GNULIB_RPMATCH=0; + GNULIB_SECURE_GETENV=0; + GNULIB_SETENV=0; + GNULIB_STRTOD=0; + GNULIB_STRTOLL=0; + GNULIB_STRTOULL=0; + GNULIB_SYSTEM_POSIX=0; + GNULIB_UNLOCKPT=0; + GNULIB_UNSETENV=0; + GNULIB_WCTOMB=0; + HAVE__EXIT=1; + HAVE_ATOLL=1; + HAVE_CANONICALIZE_FILE_NAME=1; + HAVE_DECL_GETLOADAVG=1; + HAVE_GETSUBOPT=1; + HAVE_GRANTPT=1; + HAVE_MKDTEMP=1; + HAVE_MKOSTEMP=1; + HAVE_MKOSTEMPS=1; + HAVE_MKSTEMP=1; + HAVE_MKSTEMPS=1; + HAVE_POSIX_OPENPT=1; + HAVE_PTSNAME=1; + HAVE_PTSNAME_R=1; + HAVE_QSORT_R=1; + HAVE_RANDOM=1; + HAVE_RANDOM_H=1; + HAVE_RANDOM_R=1; + HAVE_REALPATH=1; + HAVE_RPMATCH=1; + HAVE_SECURE_GETENV=1; + HAVE_SETENV=1; + HAVE_DECL_SETENV=1; + HAVE_STRTOD=1; + HAVE_STRTOLL=1; + HAVE_STRTOULL=1; + HAVE_STRUCT_RANDOM_DATA=1; + HAVE_SYS_LOADAVG_H=0; + HAVE_UNLOCKPT=1; + HAVE_DECL_UNSETENV=1; + REPLACE_CALLOC=0; + REPLACE_CANONICALIZE_FILE_NAME=0; + REPLACE_MALLOC=0; + REPLACE_MBTOWC=0; + REPLACE_MKSTEMP=0; + REPLACE_PTSNAME=0; + REPLACE_PTSNAME_R=0; + REPLACE_PUTENV=0; + REPLACE_QSORT_R=0; + REPLACE_RANDOM_R=0; + REPLACE_REALLOC=0; + REPLACE_REALPATH=0; + REPLACE_SETENV=0; + REPLACE_STRTOD=0; + REPLACE_UNSETENV=0; + REPLACE_WCTOMB=0; + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5 +printf %s "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; } +if test ${gl_cv_func_malloc_posix+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + choke me + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_malloc_posix=yes +else case e in @%:@( + e) gl_cv_func_malloc_posix=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5 +printf "%s\n" "$gl_cv_func_malloc_posix" >&6; } + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +printf %s "checking for GNU libc compatible malloc... " >&6; } +if test ${ac_cv_func_malloc_0_nonnull+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ + | hpux* | solaris* | cygwin* | mingw* | windows* | msys* ) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +void *p = malloc (0); + int result = !p; + free (p); + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_malloc_0_nonnull=yes +else case e in @%:@( + e) ac_cv_func_malloc_0_nonnull=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes +then : + gl_cv_func_malloc_0_nonnull=1 +else case e in @%:@( + e) gl_cv_func_malloc_0_nonnull=0 ;; +esac +fi + + +printf "%s\n" "@%:@define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull" >>confdefs.h + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + GNULIB_FFSL=0; + GNULIB_FFSLL=0; + GNULIB_MEMCHR=0; + GNULIB_MEMMEM=0; + GNULIB_MEMPCPY=0; + GNULIB_MEMRCHR=0; + GNULIB_RAWMEMCHR=0; + GNULIB_STPCPY=0; + GNULIB_STPNCPY=0; + GNULIB_STRCHRNUL=0; + GNULIB_STRDUP=0; + GNULIB_STRNCAT=0; + GNULIB_STRNDUP=0; + GNULIB_STRNLEN=0; + GNULIB_STRPBRK=0; + GNULIB_STRSEP=0; + GNULIB_STRSTR=0; + GNULIB_STRCASESTR=0; + GNULIB_STRTOK_R=0; + GNULIB_MBSLEN=0; + GNULIB_MBSNLEN=0; + GNULIB_MBSCHR=0; + GNULIB_MBSRCHR=0; + GNULIB_MBSSTR=0; + GNULIB_MBSCASECMP=0; + GNULIB_MBSNCASECMP=0; + GNULIB_MBSPCASECMP=0; + GNULIB_MBSCASESTR=0; + GNULIB_MBSCSPN=0; + GNULIB_MBSPBRK=0; + GNULIB_MBSSPN=0; + GNULIB_MBSSEP=0; + GNULIB_MBSTOK_R=0; + GNULIB_STRERROR=0; + GNULIB_STRERROR_R=0; + GNULIB_STRSIGNAL=0; + GNULIB_STRVERSCMP=0; + HAVE_MBSLEN=0; + HAVE_FFSL=1; + HAVE_FFSLL=1; + HAVE_MEMCHR=1; + HAVE_DECL_MEMMEM=1; + HAVE_MEMPCPY=1; + HAVE_DECL_MEMRCHR=1; + HAVE_RAWMEMCHR=1; + HAVE_STPCPY=1; + HAVE_STPNCPY=1; + HAVE_STRCHRNUL=1; + HAVE_DECL_STRDUP=1; + HAVE_DECL_STRNDUP=1; + HAVE_DECL_STRNLEN=1; + HAVE_STRPBRK=1; + HAVE_STRSEP=1; + HAVE_STRCASESTR=1; + HAVE_DECL_STRTOK_R=1; + HAVE_DECL_STRERROR_R=1; + HAVE_DECL_STRSIGNAL=1; + HAVE_STRVERSCMP=1; + REPLACE_MEMCHR=0; + REPLACE_MEMMEM=0; + REPLACE_STPNCPY=0; + REPLACE_STRDUP=0; + REPLACE_STRSTR=0; + REPLACE_STRCASESTR=0; + REPLACE_STRCHRNUL=0; + REPLACE_STRERROR=0; + REPLACE_STRERROR_R=0; + REPLACE_STRNCAT=0; + REPLACE_STRNDUP=0; + REPLACE_STRNLEN=0; + REPLACE_STRSIGNAL=0; + REPLACE_STRTOK_R=0; + UNDEFINE_STRTOK_R=0; + + + + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in @%:@( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "@%:@define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "@%:@define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + if test $HAVE_MEMCHR = 1; then + # Detect platform-specific bugs in some versions of glibc: + # memchr should not dereference anything with length 0 + # http://bugzilla.redhat.com/499689 + # memchr should not dereference overestimated length after a match + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 + # http://sourceware.org/bugzilla/show_bug.cgi?id=10162 + # Assume that memchr works on platforms that lack mprotect. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5 +printf %s "checking whether memchr works... " >&6; } +if test ${gl_cv_func_memchr_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_memchr_works="guessing no" +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_SYS_MMAN_H +# include +# include +# include +# include +# ifndef MAP_FILE +# define MAP_FILE 0 +# endif +#endif + +int +main (void) +{ + + int result = 0; + char *fence = NULL; +#if HAVE_SYS_MMAN_H && HAVE_MPROTECT +# if HAVE_MAP_ANONYMOUS + const int flags = MAP_ANONYMOUS | MAP_PRIVATE; + const int fd = -1; +# else /* !HAVE_MAP_ANONYMOUS */ + const int flags = MAP_FILE | MAP_PRIVATE; + int fd = open ("/dev/zero", O_RDONLY, 0666); + if (fd >= 0) +# endif + { + int pagesize = getpagesize (); + char *two_pages = + (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, + flags, fd, 0); + if (two_pages != (char *)(-1) + && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) + fence = two_pages + pagesize; + } +#endif + if (fence) + { + if (memchr (fence, 0, 0)) + result |= 1; + strcpy (fence - 9, "12345678"); + if (memchr (fence - 9, 0, 79) != fence - 1) + result |= 2; + if (memchr (fence - 1, 0, 3) != fence - 1) + result |= 4; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_memchr_works=yes +else case e in @%:@( + e) gl_cv_func_memchr_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5 +printf "%s\n" "$gl_cv_func_memchr_works" >&6; } + if test "$gl_cv_func_memchr_works" != yes; then + REPLACE_MEMCHR=1 + fi + fi + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether defines MIN and MAX" >&5 +printf %s "checking whether defines MIN and MAX... " >&6; } +if test ${gl_cv_minmax_in_limits_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int x = MIN (42, 17); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_minmax_in_limits_h=yes +else case e in @%:@( + e) gl_cv_minmax_in_limits_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5 +printf "%s\n" "$gl_cv_minmax_in_limits_h" >&6; } + if test $gl_cv_minmax_in_limits_h = yes; then + +printf "%s\n" "@%:@define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h + + fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether defines MIN and MAX" >&5 +printf %s "checking whether defines MIN and MAX... " >&6; } +if test ${gl_cv_minmax_in_sys_param_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int x = MIN (42, 17); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_minmax_in_sys_param_h=yes +else case e in @%:@( + e) gl_cv_minmax_in_sys_param_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5 +printf "%s\n" "$gl_cv_minmax_in_sys_param_h" >&6; } + if test $gl_cv_minmax_in_sys_param_h = yes; then + +printf "%s\n" "@%:@define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h + + fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether time_t is signed" >&5 +printf %s "checking whether time_t is signed... " >&6; } +if test ${gl_cv_time_t_is_signed+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + char time_t_signed[(time_t) -1 < 0 ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_time_t_is_signed=yes +else case e in @%:@( + e) gl_cv_time_t_is_signed=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_t_is_signed" >&5 +printf "%s\n" "$gl_cv_time_t_is_signed" >&6; } + if test $gl_cv_time_t_is_signed = yes; then + +printf "%s\n" "@%:@define TIME_T_IS_SIGNED 1" >>confdefs.h + + fi + +ac_fn_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_alarm" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_ALARM $ac_have_decl" >>confdefs.h + + + + + + + + + + if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple Mac OS X platforms. + # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode. + # But we need a configuration result that is valid in both modes. + gl_cv_func_working_mktime=no + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5 +printf %s "checking for working mktime... " >&6; } +if test ${gl_cv_func_working_mktime+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_working_mktime="guessing no" +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test program from Paul Eggert and Tony Leneis. */ +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#if HAVE_DECL_ALARM +# include +#endif + +/* Work around redefinition to rpl_putenv by other config tests. */ +#undef putenv + +static time_t time_t_max; +static time_t time_t_min; + +/* Values we'll use to set the TZ environment variable. */ +static char *tz_strings[] = { + (char *) 0, "TZ=GMT0", "TZ=JST-9", + "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" +}; +#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) + +/* Return 0 if mktime fails to convert a date in the spring-forward gap. + Based on a problem report from Andreas Jaeger. */ +static int +spring_forward_gap () +{ + /* glibc (up to about 1998-10-07) failed this test. */ + struct tm tm; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + tm.tm_year = 98; + tm.tm_mon = 3; + tm.tm_mday = 5; + tm.tm_hour = 2; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + return mktime (&tm) != (time_t) -1; +} + +static int +mktime_test1 (time_t now) +{ + struct tm *lt; + return ! (lt = localtime (&now)) || mktime (lt) == now; +} + +static int +mktime_test (time_t now) +{ + return (mktime_test1 (now) + && mktime_test1 ((time_t) (time_t_max - now)) + && mktime_test1 ((time_t) (time_t_min + now))); +} + +static int +irix_6_4_bug () +{ + /* Based on code from Ariel Faigon. */ + struct tm tm; + tm.tm_year = 96; + tm.tm_mon = 3; + tm.tm_mday = 0; + tm.tm_hour = 0; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + mktime (&tm); + return tm.tm_mon == 2 && tm.tm_mday == 31; +} + +static int +bigtime_test (int j) +{ + struct tm tm; + time_t now; + tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; + now = mktime (&tm); + if (now != (time_t) -1) + { + struct tm *lt = localtime (&now); + if (! (lt + && lt->tm_year == tm.tm_year + && lt->tm_mon == tm.tm_mon + && lt->tm_mday == tm.tm_mday + && lt->tm_hour == tm.tm_hour + && lt->tm_min == tm.tm_min + && lt->tm_sec == tm.tm_sec + && lt->tm_yday == tm.tm_yday + && lt->tm_wday == tm.tm_wday + && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) + == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) + return 0; + } + return 1; +} + +static int +year_2050_test () +{ + /* The correct answer for 2050-02-01 00:00:00 in Pacific time, + ignoring leap seconds. */ + unsigned long int answer = 2527315200UL; + + struct tm tm; + time_t t; + tm.tm_year = 2050 - 1900; + tm.tm_mon = 2 - 1; + tm.tm_mday = 1; + tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + tm.tm_isdst = -1; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + t = mktime (&tm); + + /* Check that the result is either a failure, or close enough + to the correct answer that we can assume the discrepancy is + due to leap seconds. */ + return (t == (time_t) -1 + || (0 < t && answer - 120 <= t && t <= answer + 120)); +} + +int +main () +{ + int result = 0; + time_t t, delta; + int i, j; + int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1; + +#if HAVE_DECL_ALARM + /* This test makes some buggy mktime implementations loop. + Give up after 60 seconds; a mktime slower than that + isn't worth using anyway. */ + signal (SIGALRM, SIG_DFL); + alarm (60); +#endif + + time_t_max = (! TIME_T_IS_SIGNED + ? (time_t) -1 + : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1) + * 2 + 1)); + time_t_min = (! TIME_T_IS_SIGNED + ? (time_t) 0 + : time_t_signed_magnitude + ? ~ (time_t) 0 + : ~ time_t_max); + + delta = time_t_max / 997; /* a suitable prime number */ + for (i = 0; i < N_STRINGS; i++) + { + if (tz_strings[i]) + putenv (tz_strings[i]); + + for (t = 0; t <= time_t_max - delta && (result & 1) == 0; t += delta) + if (! mktime_test (t)) + result |= 1; + if ((result & 2) == 0 + && ! (mktime_test ((time_t) 1) + && mktime_test ((time_t) (60 * 60)) + && mktime_test ((time_t) (60 * 60 * 24)))) + result |= 2; + + for (j = 1; (result & 4) == 0; j <<= 1) + { + if (! bigtime_test (j)) + result |= 4; + if (INT_MAX / 2 < j) + break; + } + if ((result & 8) == 0 && ! bigtime_test (INT_MAX)) + result |= 8; + } + if (! irix_6_4_bug ()) + result |= 16; + if (! spring_forward_gap ()) + result |= 32; + if (! year_2050_test ()) + result |= 64; + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_working_mktime=yes +else case e in @%:@( + e) gl_cv_func_working_mktime=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mktime" >&5 +printf "%s\n" "$gl_cv_func_working_mktime" >&6; } + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5 +printf %s "checking for promoted mode_t type... " >&6; } +if test ${gl_cv_promoted_mode_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_promoted_mode_t='int' +else case e in @%:@( + e) gl_cv_promoted_mode_t='mode_t' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5 +printf "%s\n" "$gl_cv_promoted_mode_t" >&6; } + +printf "%s\n" "@%:@define PROMOTED_MODE_T $gl_cv_promoted_mode_t" >>confdefs.h + + + + + GNULIB_PTHREAD_SIGMASK=0; + GNULIB_RAISE=0; + GNULIB_SIGNAL_H_SIGPIPE=0; + GNULIB_SIGPROCMASK=0; + GNULIB_SIGACTION=0; + HAVE_POSIX_SIGNALBLOCKING=1; + HAVE_PTHREAD_SIGMASK=1; + HAVE_RAISE=1; + HAVE_SIGSET_T=1; + HAVE_SIGINFO_T=1; + HAVE_SIGACTION=1; + HAVE_STRUCT_SIGACTION_SA_SIGACTION=1; + + HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1; + + HAVE_SIGHANDLER_T=1; + REPLACE_PTHREAD_SIGMASK=0; + REPLACE_RAISE=0; + + + ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" " + #include + /* Mingw defines sigset_t not in , but in . */ + #include + +" +if test "x$ac_cv_type_sigset_t" = xyes +then : + +printf "%s\n" "@%:@define HAVE_SIGSET_T 1" >>confdefs.h + +gl_cv_type_sigset_t=yes +else case e in @%:@( + e) gl_cv_type_sigset_t=no ;; +esac +fi + + if test $gl_cv_type_sigset_t != yes; then + HAVE_SIGSET_T=0 + fi + + + + + + + + +ac_fn_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_setenv" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_SETENV $ac_have_decl" >>confdefs.h + + + + + + if test $ac_cv_have_decl_setenv = no; then + HAVE_DECL_SETENV=0 + fi + + + + + + ac_fn_c_check_header_compile "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default" +if test "x$ac_cv_header_search_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_SEARCH_H 1" >>confdefs.h + +fi + + ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch" +if test "x$ac_cv_func_tsearch" = xyes +then : + printf "%s\n" "@%:@define HAVE_TSEARCH 1" >>confdefs.h + +fi + + + + +ac_fn_c_check_type "$LINENO" "uid_t" "ac_cv_type_uid_t" "$ac_includes_default" +if test "x$ac_cv_type_uid_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define uid_t int" >>confdefs.h + ;; +esac +fi + +ac_fn_c_check_type "$LINENO" "gid_t" "ac_cv_type_gid_t" "$ac_includes_default" +if test "x$ac_cv_type_gid_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define gid_t int" >>confdefs.h + ;; +esac +fi + +: + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +printf %s "checking for stdbool.h that conforms to C99... " >&6; } +if test ${ac_cv_header_stdbool_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + + #ifdef __cplusplus + typedef bool Bool; + #else + typedef _Bool Bool; + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #endif + + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + Bool q = true; + Bool *pq = &q; + bool *qq = &q; + +int +main (void) +{ + + bool e = &s; + *pq |= q; *pq |= ! q; + *qq |= q; *qq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq + !qq); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_header_stdbool_h=yes +else case e in @%:@( + e) ac_cv_header_stdbool_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } + ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes +then : + +printf "%s\n" "@%:@define HAVE__BOOL 1" >>confdefs.h + + +fi + + + + GNULIB_FFS=0; + HAVE_FFS=1; + HAVE_STRCASECMP=1; + HAVE_DECL_STRNCASECMP=1; + + + REPLACE_STRERROR_0=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5 +printf %s "checking whether strerror(0) succeeds... " >&6; } +if test ${gl_cv_func_strerror_0_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_strerror_0_works="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +int result = 0; + char *str; + errno = 0; + str = strerror (0); + if (!*str) result |= 1; + if (errno) result |= 2; + if (strstr (str, "nknown") || strstr (str, "ndefined")) + result |= 4; + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strerror_0_works=yes +else case e in @%:@( + e) gl_cv_func_strerror_0_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5 +printf "%s\n" "$gl_cv_func_strerror_0_works" >&6; } + case "$gl_cv_func_strerror_0_works" in + *yes) ;; + *) + REPLACE_STRERROR_0=1 + +printf "%s\n" "@%:@define REPLACE_STRERROR_0 1" >>confdefs.h + + ;; + esac + + + + + + + + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5 +printf %s "checking for strerror_r with POSIX signature... " >&6; } +if test ${gl_cv_func_strerror_r_posix_signature+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int strerror_r (int, char *, size_t); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_strerror_r_posix_signature=yes +else case e in @%:@( + e) gl_cv_func_strerror_r_posix_signature=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_strerror_r_posix_signature" >&6; } + if test $gl_cv_func_strerror_r_posix_signature = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5 +printf %s "checking whether strerror_r works... " >&6; } +if test ${gl_cv_func_strerror_r_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on AIX. + aix*) gl_cv_func_strerror_r_works="guessing no";; + # Guess no on HP-UX. + hpux*) gl_cv_func_strerror_r_works="guessing no";; + # Guess no on BSD variants. + *bsd*) gl_cv_func_strerror_r_works="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_strerror_r_works="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +int result = 0; + char buf[79]; + if (strerror_r (EACCES, buf, 0) < 0) + result |= 1; + errno = 0; + if (strerror_r (EACCES, buf, sizeof buf) != 0) + result |= 2; + strcpy (buf, "Unknown"); + if (strerror_r (0, buf, sizeof buf) != 0) + result |= 4; + if (errno) + result |= 8; + if (strstr (buf, "nknown") || strstr (buf, "ndefined")) + result |= 0x10; + errno = 0; + *buf = 0; + if (strerror_r (-3, buf, sizeof buf) < 0) + result |= 0x20; + if (errno) + result |= 0x40; + if (!*buf) + result |= 0x80; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strerror_r_works=yes +else case e in @%:@( + e) gl_cv_func_strerror_r_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5 +printf "%s\n" "$gl_cv_func_strerror_r_works" >&6; } + else + + if test $ac_cv_func___xpg_strerror_r = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5 +printf %s "checking whether __xpg_strerror_r works... " >&6; } +if test ${gl_cv_func_strerror_r_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_strerror_r_works="guessing no" + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + extern + #ifdef __cplusplus + "C" + #endif + int __xpg_strerror_r(int, char *, size_t); + +int +main (void) +{ +int result = 0; + char buf[256] = "^"; + char copy[256]; + char *str = strerror (-1); + strcpy (copy, str); + if (__xpg_strerror_r (-2, buf, 1) == 0) + result |= 1; + if (*buf) + result |= 2; + __xpg_strerror_r (-2, buf, 256); + if (strcmp (str, copy)) + result |= 4; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strerror_r_works=yes +else case e in @%:@( + e) gl_cv_func_strerror_r_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5 +printf "%s\n" "$gl_cv_func_strerror_r_works" >&6; } + fi + fi + fi + fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +printf %s "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if test ${ac_cv_struct_tm+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main (void) +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_struct_tm=time.h +else case e in @%:@( + e) ac_cv_struct_tm=sys/time.h ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +printf "%s\n" "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +printf "%s\n" "@%:@define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include +#include <$ac_cv_struct_tm> + +" +if test "x$ac_cv_member_struct_tm_tm_zone" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_TM_TM_ZONE 1" >>confdefs.h + + +fi + +if test "$ac_cv_member_struct_tm_tm_zone" = yes; then + +printf "%s\n" "@%:@define HAVE_TM_ZONE 1" >>confdefs.h + +else + ac_fn_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_tzname" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_TZNAME $ac_have_decl" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 +printf %s "checking for tzname... " >&6; } +if test ${ac_cv_var_tzname+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#if !HAVE_DECL_TZNAME +extern char *tzname[]; +#endif + +int +main (void) +{ +return tzname[0][0]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_var_tzname=yes +else case e in @%:@( + e) ac_cv_var_tzname=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5 +printf "%s\n" "$ac_cv_var_tzname" >&6; } + if test $ac_cv_var_tzname = yes; then + +printf "%s\n" "@%:@define HAVE_TZNAME 1" >>confdefs.h + + fi +fi + + + ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include +" +if test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes +then : + +printf "%s\n" "@%:@define HAVE_TM_GMTOFF 1" >>confdefs.h + +fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_string_h='<'string.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_string_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'string.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_string_h + gl_cv_next_string_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5 +printf "%s\n" "$gl_cv_next_string_h" >&6; } + fi + NEXT_STRING_H=$gl_cv_next_string_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'string.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_string_h + fi + NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive + + + + + + + for gl_func in ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r strerror_r strsignal strverscmp; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_strings_h='<'strings.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_strings_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_strings_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'strings.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_strings_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_strings_h + gl_cv_next_strings_h='"'$gl_header'"' + else + gl_cv_next_strings_h='<'strings.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_strings_h" >&5 +printf "%s\n" "$gl_cv_next_strings_h" >&6; } + fi + NEXT_STRINGS_H=$gl_cv_next_strings_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'strings.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_strings_h + fi + NEXT_AS_FIRST_DIRECTIVE_STRINGS_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_strings_h = yes; then + HAVE_STRINGS_H=1 + else + HAVE_STRINGS_H=0 + fi + + + + for gl_func in ffs strcasecmp strncasecmp; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Minix 3.1.8 has a bug: must be included before + . */ + #include + #include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + +ac_fn_check_decl "$LINENO" "strndup" "ac_cv_have_decl_strndup" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strndup" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_STRNDUP $ac_have_decl" >>confdefs.h + + +ac_fn_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strnlen" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_STRNLEN $ac_have_decl" >>confdefs.h + + + +ac_fn_check_decl "$LINENO" "strtoumax" "ac_cv_have_decl_strtoumax" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strtoumax" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_STRTOUMAX $ac_have_decl" >>confdefs.h + + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_types_h='<'sys/types.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_types_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/types.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_types_h + gl_cv_next_sys_types_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5 +printf "%s\n" "$gl_cv_next_sys_types_h" >&6; } + fi + NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/types.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_types_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive + + + + + + + + + + + + + WINDOWS_STAT_INODES=0 + + + + + GNULIB_WAITPID=0; + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 +printf %s "checking for struct timespec in ... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_time_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_time_h=yes +else case e in @%:@( + e) gl_cv_sys_struct_timespec_in_time_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_time_h" >&6; } + + TIME_H_DEFINES_STRUCT_TIMESPEC=0 + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 + UNISTD_H_DEFINES_STRUCT_TIMESPEC=0 + if test $gl_cv_sys_struct_timespec_in_time_h = yes; then + TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 +printf %s "checking for struct timespec in ... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_sys_time_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_sys_time_h=yes +else case e in @%:@( + e) gl_cv_sys_struct_timespec_in_sys_time_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 +printf %s "checking for struct timespec in ... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_pthread_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_pthread_h=yes +else case e in @%:@( + e) gl_cv_sys_struct_timespec_in_pthread_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 +printf %s "checking for struct timespec in ... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_unistd_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_unistd_h=yes +else case e in @%:@( + e) gl_cv_sys_struct_timespec_in_unistd_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then + UNISTD_H_DEFINES_STRUCT_TIMESPEC=1 + fi + fi + fi + fi + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_time_h='<'time.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_time_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'time.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_time_h + gl_cv_next_time_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5 +printf "%s\n" "$gl_cv_next_time_h" >&6; } + fi + NEXT_TIME_H=$gl_cv_next_time_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'time.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_time_h + fi + NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive + + + + + + + + + + + + + + +gl_libunistring_sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' + + + if test "$HAVE_LIBUNISTRING" = yes; then + LIBUNISTRING_VERSION_MAJOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_major"` + LIBUNISTRING_VERSION_MINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_minor"` + LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_subminor"` + fi + +ac_fn_check_decl "$LINENO" "clearerr_unlocked" "ac_cv_have_decl_clearerr_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_clearerr_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_CLEARERR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "feof_unlocked" "ac_cv_have_decl_feof_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_feof_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FEOF_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "ferror_unlocked" "ac_cv_have_decl_ferror_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_ferror_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FERROR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fflush_unlocked" "ac_cv_have_decl_fflush_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fflush_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FFLUSH_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fgets_unlocked" "ac_cv_have_decl_fgets_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fgets_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FGETS_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fputc_unlocked" "ac_cv_have_decl_fputc_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fputc_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FPUTC_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fputs_unlocked" "ac_cv_have_decl_fputs_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fputs_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FPUTS_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fread_unlocked" "ac_cv_have_decl_fread_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fread_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FREAD_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fwrite_unlocked" "ac_cv_have_decl_fwrite_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fwrite_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_FWRITE_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "getchar_unlocked" "ac_cv_have_decl_getchar_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getchar_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_GETCHAR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "putc_unlocked" "ac_cv_have_decl_putc_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_putc_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_PUTC_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "putchar_unlocked" "ac_cv_have_decl_putchar_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_putchar_unlocked" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_PUTCHAR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_unsetenv" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_UNSETENV $ac_have_decl" >>confdefs.h + + + + + + if test $ac_cv_header_features_h = yes; then + HAVE_FEATURES_H=1 + else + HAVE_FEATURES_H=0 + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5 +printf %s "checking for inttypes.h... " >&6; } +if test ${gl_cv_header_inttypes_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +uintmax_t i = (uintmax_t) -1; return !i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_inttypes_h=yes +else case e in @%:@( + e) gl_cv_header_inttypes_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_inttypes_h" >&5 +printf "%s\n" "$gl_cv_header_inttypes_h" >&6; } + if test $gl_cv_header_inttypes_h = yes; then + +printf "%s\n" "@%:@define HAVE_INTTYPES_H_WITH_UINTMAX 1" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5 +printf %s "checking for stdint.h... " >&6; } +if test ${gl_cv_header_stdint_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include +int +main (void) +{ +uintmax_t i = (uintmax_t) -1; return !i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_stdint_h=yes +else case e in @%:@( + e) gl_cv_header_stdint_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_h" >&5 +printf "%s\n" "$gl_cv_header_stdint_h" >&6; } + if test $gl_cv_header_stdint_h = yes; then + +printf "%s\n" "@%:@define HAVE_STDINT_H_WITH_UINTMAX 1" >>confdefs.h + + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5 +printf %s "checking for intmax_t... " >&6; } +if test ${gt_cv_c_intmax_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_STDINT_H_WITH_UINTMAX +#include +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include +#endif + +int +main (void) +{ +intmax_t x = -1; return !x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_c_intmax_t=yes +else case e in @%:@( + e) gt_cv_c_intmax_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_intmax_t" >&5 +printf "%s\n" "$gt_cv_c_intmax_t" >&6; } + if test $gt_cv_c_intmax_t = yes; then + +printf "%s\n" "@%:@define HAVE_INTMAX_T 1" >>confdefs.h + + else + + test $ac_cv_type_long_long_int = yes \ + && ac_type='long long' \ + || ac_type='long' + +printf "%s\n" "@%:@define intmax_t $ac_type" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5 +printf %s "checking where to find the exponent in a 'double'... " >&6; } +if test ${gl_cv_cc_double_expbit0+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined arm || defined __arm || defined __arm__ + mixed_endianness +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "mixed_endianness" >/dev/null 2>&1 +then : + gl_cv_cc_double_expbit0="unknown" +else case e in @%:@( + e) + : +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in @%:@( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in @%:@( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes +then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +unsigned short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + unsigned short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + unsigned short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + unsigned short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else case e in @%:@( + e) ac_cv_c_bigendian=yes ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi ;; +esac +fi +: + case $ac_cv_c_bigendian in #( + yes) + gl_cv_cc_double_expbit0="word 0 bit 20";; #( + no) + gl_cv_cc_double_expbit0="word 1 bit 20" ;; #( + universal) + +printf "%s\n" "@%:@define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + gl_cv_cc_double_expbit0="unknown" ;; + esac + + ;; +esac +fi +rm -rf conftest* + + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +#define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { double value; unsigned int word[NWORDS]; } memory_double; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (double x) +{ + memory_double m; + size_t i; + /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ + memset (&m, 0, sizeof (memory_double)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25); + add_to_ored_words (0.5); + add_to_ored_words (1.0); + add_to_ored_words (2.0); + add_to_ored_words (4.0); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_cc_double_expbit0=`cat conftest.out` +else case e in @%:@( + e) gl_cv_cc_double_expbit0="unknown" ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.out + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5 +printf "%s\n" "$gl_cv_cc_double_expbit0" >&6; } + case "$gl_cv_cc_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` + +printf "%s\n" "@%:@define DBL_EXPBIT0_WORD $word" >>confdefs.h + + +printf "%s\n" "@%:@define DBL_EXPBIT0_BIT $bit" >>confdefs.h + + ;; + esac + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether snprintf returns a byte count as in C99" >&5 +printf %s "checking whether snprintf returns a byte count as in C99... " >&6; } +if test ${gl_cv_func_snprintf_retval_c99+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";; + darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_retval_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";; + aix*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_retval_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_retval_c99="guessing no";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char buf[100]; +int main () +{ + strcpy (buf, "ABCDEF"); + if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7) + return 1; + if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7) + return 2; + if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7) + return 3; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_snprintf_retval_c99=yes +else case e in @%:@( + e) gl_cv_func_snprintf_retval_c99=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_retval_c99" >&5 +printf "%s\n" "$gl_cv_func_snprintf_retval_c99" >&6; } + + + + + + + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "@%:@define HAVE_SNPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strnlen" "ac_cv_func_strnlen" +if test "x$ac_cv_func_strnlen" = xyes +then : + printf "%s\n" "@%:@define HAVE_STRNLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcslen" "ac_cv_func_wcslen" +if test "x$ac_cv_func_wcslen" = xyes +then : + printf "%s\n" "@%:@define HAVE_WCSLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcsnlen" "ac_cv_func_wcsnlen" +if test "x$ac_cv_func_wcsnlen" = xyes +then : + printf "%s\n" "@%:@define HAVE_WCSNLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mbrtowc" "ac_cv_func_mbrtowc" +if test "x$ac_cv_func_mbrtowc" = xyes +then : + printf "%s\n" "@%:@define HAVE_MBRTOWC 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcrtomb" "ac_cv_func_wcrtomb" +if test "x$ac_cv_func_wcrtomb" = xyes +then : + printf "%s\n" "@%:@define HAVE_WCRTOMB 1" >>confdefs.h + +fi + + ac_fn_check_decl "$LINENO" "_snprintf" "ac_cv_have_decl__snprintf" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl__snprintf" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL__SNPRINTF $ac_have_decl" >>confdefs.h + + + + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + +printf "%s\n" "@%:@define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h + + ;; + esac + + + + + GNULIB_SOCKET=0; + GNULIB_CONNECT=0; + GNULIB_ACCEPT=0; + GNULIB_BIND=0; + GNULIB_GETPEERNAME=0; + GNULIB_GETSOCKNAME=0; + GNULIB_GETSOCKOPT=0; + GNULIB_LISTEN=0; + GNULIB_RECV=0; + GNULIB_SEND=0; + GNULIB_RECVFROM=0; + GNULIB_SENDTO=0; + GNULIB_SETSOCKOPT=0; + GNULIB_SHUTDOWN=0; + GNULIB_ACCEPT4=0; + HAVE_STRUCT_SOCKADDR_STORAGE=1; + HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1; + + HAVE_SA_FAMILY_T=1; + HAVE_ACCEPT4=1; + + + if test $ac_cv_header_sys_socket_h = no; then + ac_fn_c_check_header_compile "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" +if test "x$ac_cv_header_ws2tcpip_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WS2TCPIP_H 1" >>confdefs.h + +fi + + fi + + + + + + case "$host_os" in + osf*) + +printf "%s\n" "@%:@define _POSIX_PII_SOCKET 1" >>confdefs.h + + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether is self-contained" >&5 +printf %s "checking whether is self-contained... " >&6; } +if test ${gl_cv_header_sys_socket_h_selfcontained+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_sys_socket_h_selfcontained=yes +else case e in @%:@( + e) gl_cv_header_sys_socket_h_selfcontained=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5 +printf "%s\n" "$gl_cv_header_sys_socket_h_selfcontained" >&6; } + if test $gl_cv_header_sys_socket_h_selfcontained = yes; then + ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown" +if test "x$ac_cv_func_shutdown" = xyes +then : + printf "%s\n" "@%:@define HAVE_SHUTDOWN 1" >>confdefs.h + +fi + + if test $ac_cv_func_shutdown = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether defines the SHUT_* macros" >&5 +printf %s "checking whether defines the SHUT_* macros... " >&6; } +if test ${gl_cv_header_sys_socket_h_shut+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR }; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_sys_socket_h_shut=yes +else case e in @%:@( + e) gl_cv_header_sys_socket_h_shut=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5 +printf "%s\n" "$gl_cv_header_sys_socket_h_shut" >&6; } + if test $gl_cv_header_sys_socket_h_shut = no; then + SYS_SOCKET_H='sys/socket.h' + fi + fi + fi + # We need to check for ws2tcpip.h now. + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_socket_h='<'sys/socket.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_socket_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_socket_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/socket.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_socket_h + gl_cv_next_sys_socket_h='"'$gl_header'"' + else + gl_cv_next_sys_socket_h='<'sys/socket.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5 +printf "%s\n" "$gl_cv_next_sys_socket_h" >&6; } + fi + NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/socket.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_socket_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_sys_socket_h = yes; then + HAVE_SYS_SOCKET_H=1 + HAVE_WS2TCPIP_H=0 + else + HAVE_SYS_SOCKET_H=0 + if test $ac_cv_header_ws2tcpip_h = yes; then + HAVE_WS2TCPIP_H=1 + else + HAVE_WS2TCPIP_H=0 + fi + fi + + + + ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" " + /* sys/types.h is not needed according to POSIX, but the + sys/socket.h in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif + +" +if test "x$ac_cv_type_struct_sockaddr_storage" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h + + +fi +ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" " + /* sys/types.h is not needed according to POSIX, but the + sys/socket.h in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif + +" +if test "x$ac_cv_type_sa_family_t" = xyes +then : + +printf "%s\n" "@%:@define HAVE_SA_FAMILY_T 1" >>confdefs.h + + +fi + + if test $ac_cv_type_struct_sockaddr_storage = no; then + HAVE_STRUCT_SOCKADDR_STORAGE=0 + fi + if test $ac_cv_type_sa_family_t = no; then + HAVE_SA_FAMILY_T=0 + fi + if test $ac_cv_type_struct_sockaddr_storage != no; then + ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include + #ifdef HAVE_SYS_SOCKET_H + #include + #endif + #ifdef HAVE_WS2TCPIP_H + #include + #endif + +" +if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1" >>confdefs.h + + +else case e in @%:@( + e) HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0 ;; +esac +fi + + fi + if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \ + || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then + SYS_SOCKET_H='sys/socket.h' + fi + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + + + for gl_func in socket connect accept bind getpeername getsockname getsockopt listen recv send recvfrom sendto setsockopt shutdown accept4; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Some systems require prerequisite headers. */ +#include +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + GNULIB_INET_NTOP=0; + GNULIB_INET_PTON=0; + HAVE_DECL_INET_NTOP=1; + HAVE_DECL_INET_PTON=1; + REPLACE_INET_NTOP=0; + REPLACE_INET_PTON=0; + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5 +printf %s "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; } +if test ${gl_cv_func_getcwd_null+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_getcwd_null="guessing yes";; + # Guess yes on Cygwin. + cygwin*) gl_cv_func_getcwd_null="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_getcwd_null="guessing no";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# include +# if HAVE_UNISTD_H +# include +# else /* on Windows with MSVC */ +# include +# endif +# ifndef getcwd + char *getcwd (); +# endif + +int +main (void) +{ + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* mingw cwd does not start with '/', but getcwd does allocate. + However, mingw fails to honor non-zero size. */ +#else + if (chdir ("/") != 0) + return 1; + else + { + char *f = getcwd (NULL, 0); + if (! f) + return 2; + if (f[0] != '/') + return 3; + if (f[1] != '\0') + return 4; + free (f); + return 0; + } +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getcwd_null=yes +else case e in @%:@( + e) gl_cv_func_getcwd_null=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5 +printf "%s\n" "$gl_cv_func_getcwd_null" >&6; } + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5 +printf %s "checking for getcwd with POSIX signature... " >&6; } +if test ${gl_cv_func_getcwd_posix_signature+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +extern + #ifdef __cplusplus + "C" + #endif + char *getcwd (char *, size_t); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_getcwd_posix_signature=yes +else case e in @%:@( + e) gl_cv_func_getcwd_posix_signature=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_getcwd_posix_signature" >&6; } + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5 +printf %s "checking for IPv4 sockets... " >&6; } + if test ${gl_cv_socket_ipv4+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +int +main (void) +{ +int x = AF_INET; struct in_addr y; struct sockaddr_in z; + if (&x && &y && &z) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_socket_ipv4=yes +else case e in @%:@( + e) gl_cv_socket_ipv4=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5 +printf "%s\n" "$gl_cv_socket_ipv4" >&6; } + if test $gl_cv_socket_ipv4 = yes; then + +printf "%s\n" "@%:@define HAVE_IPV4 1" >>confdefs.h + + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5 +printf %s "checking for IPv6 sockets... " >&6; } + if test ${gl_cv_socket_ipv6+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif +int +main (void) +{ +int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; + if (&x && &y && &z) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_socket_ipv6=yes +else case e in @%:@( + e) gl_cv_socket_ipv6=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5 +printf "%s\n" "$gl_cv_socket_ipv6" >&6; } + if test $gl_cv_socket_ipv6 = yes; then + +printf "%s\n" "@%:@define HAVE_IPV6 1" >>confdefs.h + + fi + + + + GNULIB_PSELECT=0; + GNULIB_SELECT=0; + HAVE_PSELECT=1; + REPLACE_PSELECT=0; + REPLACE_SELECT=0; + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether is self-contained" >&5 +printf %s "checking whether is self-contained... " >&6; } +if test ${gl_cv_header_sys_select_h_selfcontained+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +struct timeval b; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_sys_select_h_selfcontained=yes +else case e in @%:@( + e) gl_cv_header_sys_select_h_selfcontained=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $gl_cv_header_sys_select_h_selfcontained = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +int memset; int bzero; + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + + #undef memset + #define memset nonexistent_memset + extern + #ifdef __cplusplus + "C" + #endif + void *memset (void *, int, unsigned long); + #undef bzero + #define bzero nonexistent_bzero + extern + #ifdef __cplusplus + "C" + #endif + void bzero (void *, unsigned long); + fd_set fds; + FD_ZERO (&fds); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in @%:@( + e) gl_cv_header_sys_select_h_selfcontained=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_select_h_selfcontained" >&5 +printf "%s\n" "$gl_cv_header_sys_select_h_selfcontained" >&6; } + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_select_h='<'sys/select.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_select_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_select_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/select.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_select_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_select_h + gl_cv_next_sys_select_h='"'$gl_header'"' + else + gl_cv_next_sys_select_h='<'sys/select.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_select_h" >&5 +printf "%s\n" "$gl_cv_next_sys_select_h" >&6; } + fi + NEXT_SYS_SELECT_H=$gl_cv_next_sys_select_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/select.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_select_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_sys_select_h = yes; then + HAVE_SYS_SELECT_H=1 + else + HAVE_SYS_SELECT_H=0 + fi + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + + + for gl_func in pselect select; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Some systems require prerequisite headers. */ +#include +#if !(defined __GLIBC__ && !defined __UCLIBC__) && HAVE_SYS_TIME_H +# include +#endif +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + LIBSOCKET= + if test $HAVE_WINSOCK2_H = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we need to call WSAStartup in winsock2.h and -lws2_32" >&5 +printf %s "checking if we need to call WSAStartup in winsock2.h and -lws2_32... " >&6; } +if test ${gl_cv_func_wsastartup+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_WINSOCK2_H +# include +#endif +int +main (void) +{ + + WORD wVersionRequested = MAKEWORD(1, 1); + WSADATA wsaData; + int err = WSAStartup(wVersionRequested, &wsaData); + WSACleanup (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_func_wsastartup=yes +else case e in @%:@( + e) gl_cv_func_wsastartup=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wsastartup" >&5 +printf "%s\n" "$gl_cv_func_wsastartup" >&6; } + if test "$gl_cv_func_wsastartup" = "yes"; then + +printf "%s\n" "@%:@define WINDOWS_SOCKETS 1" >>confdefs.h + + LIBSOCKET='-lws2_32' + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5 +printf %s "checking for library containing setsockopt... " >&6; } +if test ${gl_cv_lib_socket+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_cv_lib_socket= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in @%:@( + e) gl_save_LIBS="$LIBS" + LIBS="$gl_save_LIBS -lsocket" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_lib_socket="-lsocket" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$gl_cv_lib_socket"; then + LIBS="$gl_save_LIBS -lnetwork" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_lib_socket="-lnetwork" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$gl_cv_lib_socket"; then + LIBS="$gl_save_LIBS -lnet" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_lib_socket="-lnet" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + fi + LIBS="$gl_save_LIBS" + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$gl_cv_lib_socket"; then + gl_cv_lib_socket="none needed" + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_socket" >&5 +printf "%s\n" "$gl_cv_lib_socket" >&6; } + if test "$gl_cv_lib_socket" != "none needed"; then + LIBSOCKET="$gl_cv_lib_socket" + fi + fi + + + + + + + : + + + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + REPLACE_SELECT=1 + else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select supports a 0 argument" >&5 +printf %s "checking whether select supports a 0 argument... " >&6; } +if test ${gl_cv_func_select_supports0+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on Interix. + interix*) gl_cv_func_select_supports0="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_select_supports0="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_SYS_SELECT_H +#include +#endif +int main () +{ + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_supports0=yes +else case e in @%:@( + e) gl_cv_func_select_supports0=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_supports0" >&5 +printf "%s\n" "$gl_cv_func_select_supports0" >&6; } + case "$gl_cv_func_select_supports0" in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select detects invalid fds" >&5 +printf %s "checking whether select detects invalid fds... " >&6; } +if test ${gl_cv_func_select_detects_ebadf+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_select_detects_ebadf="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_SYS_SELECT_H +# include +#endif +#include +#include + +int +main (void) +{ + + fd_set set; + dup2(0, 16); + FD_ZERO(&set); + FD_SET(16, &set); + close(16); + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_detects_ebadf=yes +else case e in @%:@( + e) gl_cv_func_select_detects_ebadf=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_detects_ebadf" >&5 +printf "%s\n" "$gl_cv_func_select_detects_ebadf" >&6; } + case $gl_cv_func_select_detects_ebadf in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + fi + + LIB_SELECT="$LIBSOCKET" + if test $REPLACE_SELECT = 1; then + case "$host_os" in + mingw*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define WIN32_LEAN_AND_MEAN +#include +int +main () +{ + MsgWaitForMultipleObjects (0, NULL, 0, 0, 0); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in @%:@( + e) LIB_SELECT="$LIB_SELECT -luser32" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ;; + esac + fi + + + + + + + + + + if test $ac_cv_have_decl_strerror_r = no; then + HAVE_DECL_STRERROR_R=0 + fi + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + if test $gl_cv_func_strerror_r_posix_signature = yes; then + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR_R=1 ;; + esac + else + REPLACE_STRERROR_R=1 + fi + else + REPLACE_STRERROR_R=1 + fi + fi + + + +ac_fn_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_snprintf" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_SNPRINTF $ac_have_decl" >>confdefs.h + + + + + + + + + + if false; then + GL_COND_LIBTOOL_TRUE= + GL_COND_LIBTOOL_FALSE='#' +else + GL_COND_LIBTOOL_TRUE='#' + GL_COND_LIBTOOL_FALSE= +fi + + gl_cond_libtool=false + gl_libdeps= + gl_ltlibdeps= + gl_m4_base='m4' + + + + + + + + + + gl_source_base='lib' + + + if test $ac_cv_func_alloca_works = no; then + : + fi + + # Define an additional variable used in the Makefile substitution. + if test $ac_cv_working_alloca_h = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5 +printf %s "checking for alloca as a compiler built-in... " >&6; } +if test ${gl_cv_rpl_alloca+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined __GNUC__ || defined _AIX || defined _MSC_VER + Need own alloca +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "Need own alloca" >/dev/null 2>&1 +then : + gl_cv_rpl_alloca=yes +else case e in @%:@( + e) gl_cv_rpl_alloca=no ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5 +printf "%s\n" "$gl_cv_rpl_alloca" >&6; } + if test $gl_cv_rpl_alloca = yes; then + +printf "%s\n" "@%:@define HAVE_ALLOCA 1" >>confdefs.h + + ALLOCA_H=alloca.h + else + ALLOCA_H= + fi + else + ALLOCA_H=alloca.h + fi + + if test -n "$ALLOCA_H"; then + GL_GENERATE_ALLOCA_H_TRUE= + GL_GENERATE_ALLOCA_H_FALSE='#' +else + GL_GENERATE_ALLOCA_H_TRUE='#' + GL_GENERATE_ALLOCA_H_FALSE= +fi + + + + + + + + + if test $ac_cv_func_btowc = no; then + HAVE_BTOWC=0 + else + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether btowc(0) is correct" >&5 +printf %s "checking whether btowc(0) is correct... " >&6; } +if test ${gl_cv_func_btowc_nul+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on Cygwin. + cygwin*) gl_cv_func_btowc_nul="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_nul="guessing yes" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (btowc ('\0') != 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_btowc_nul=yes +else case e in @%:@( + e) gl_cv_func_btowc_nul=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_nul" >&5 +printf "%s\n" "$gl_cv_func_btowc_nul" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5 +printf %s "checking whether btowc(EOF) is correct... " >&6; } +if test ${gl_cv_func_btowc_eof+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on IRIX. + irix*) gl_cv_func_btowc_eof="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_eof="guessing yes" ;; + esac + if test $LOCALE_FR != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (btowc (EOF) != WEOF) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_btowc_eof=yes +else case e in @%:@( + e) gl_cv_func_btowc_eof=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5 +printf "%s\n" "$gl_cv_func_btowc_eof" >&6; } + + case "$gl_cv_func_btowc_nul" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + case "$gl_cv_func_btowc_eof" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + fi + + if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS btowc.$ac_objext" + + + : + + fi + + + + + + GNULIB_BTOWC=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_BTOWC 1" >>confdefs.h + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5 +printf %s "checking for __builtin_expect... " >&6; } +if test ${gl_cv___builtin_expect+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int + main (int argc, char **argv) + { + argc = __builtin_expect (argc, 100); + return argv[argc != 100][0]; + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv___builtin_expect=yes +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + int + main (int argc, char **argv) + { + argc = __builtin_expect (argc, 100); + return argv[argc != 100][0]; + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv___builtin_expect="in " +else case e in @%:@( + e) gl_cv___builtin_expect=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5 +printf "%s\n" "$gl_cv___builtin_expect" >&6; } + if test "$gl_cv___builtin_expect" = yes; then + printf "%s\n" "@%:@define HAVE___BUILTIN_EXPECT 1" >>confdefs.h + + elif test "$gl_cv___builtin_expect" = "in "; then + printf "%s\n" "@%:@define HAVE___BUILTIN_EXPECT 2" >>confdefs.h + + fi + + + + + + + # for STACK_DIRECTION + + + + ac_fn_check_decl "$LINENO" "sigaltstack" "ac_cv_have_decl_sigaltstack" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_sigaltstack" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_SIGALTSTACK $ac_have_decl" >>confdefs.h + + + + + ac_fn_c_check_type "$LINENO" "stack_t" "ac_cv_type_stack_t" "#include +" +if test "x$ac_cv_type_stack_t" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STACK_T 1" >>confdefs.h + + +fi + + + if test "$gl_cv_lib_sigsegv" = yes \ + && test $"ac_cv_sys_xsi_stack_overflow_heuristic" != yes ; then + LIBCSTACK=$LIBSIGSEGV + + LTLIBCSTACK=$LTLIBSIGSEGV + + fi + + + + + + + # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. + # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. + + # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* + # programs in the package would end up linked with that potentially-shared + # library, inducing unnecessary run-time overhead. + LIB_CLOCK_GETTIME= + + gl_saved_libs=$LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 +printf %s "checking for library containing clock_gettime... " >&6; } +if test ${ac_cv_search_clock_gettime+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (void); +int +main (void) +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt posix4 +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_clock_gettime=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_clock_gettime+y} +then : + break +fi +done +if test ${ac_cv_search_clock_gettime+y} +then : + +else case e in @%:@( + e) ac_cv_search_clock_gettime=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 +printf "%s\n" "$ac_cv_search_clock_gettime" >&6; } +ac_res=$ac_cv_search_clock_gettime +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ac_cv_search_clock_gettime" = "none required" || + LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime +fi + + ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" +if test "x$ac_cv_func_clock_gettime" = xyes +then : + printf "%s\n" "@%:@define HAVE_CLOCK_GETTIME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "clock_settime" "ac_cv_func_clock_settime" +if test "x$ac_cv_func_clock_settime" = xyes +then : + printf "%s\n" "@%:@define HAVE_CLOCK_SETTIME 1" >>confdefs.h + +fi + + LIBS=$gl_saved_libs + + + + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_CLOSE=1 + fi + + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then + REPLACE_CLOSE=1 + fi + + + + if test $REPLACE_CLOSE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext" + + fi + + + + + + GNULIB_CLOSE=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_CLOSE 1" >>confdefs.h + + + + + + if test "x$datarootdir" = x; then + datarootdir='${datadir}' + + fi + if test "x$docdir" = x; then + docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' + + fi + if test "x$htmldir" = x; then + htmldir='${docdir}' + + fi + if test "x$dvidir" = x; then + dvidir='${docdir}' + + fi + if test "x$pdfdir" = x; then + pdfdir='${docdir}' + + fi + if test "x$psdir" = x; then + psdir='${docdir}' + + fi + if test "x$lispdir" = x; then + lispdir='${datarootdir}/emacs/site-lisp' + + fi + if test "x$localedir" = x; then + localedir='${datarootdir}/locale' + + fi + if test "x$runstatedir" = x; then + runstatedir='${localstatedir}/run' + + fi + + pkglibexecdir='${libexecdir}/${PACKAGE}' + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_ctype_h='<'ctype.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_ctype_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'ctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_ctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_ctype_h + gl_cv_next_ctype_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_ctype_h" >&5 +printf "%s\n" "$gl_cv_next_ctype_h" >&6; } + fi + NEXT_CTYPE_H=$gl_cv_next_ctype_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'ctype.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_ctype_h + fi + NEXT_AS_FIRST_DIRECTIVE_CTYPE_H=$gl_next_as_first_directive + + + + + + + for gl_func in isblank; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + +printf "%s\n" "@%:@define GNULIB_DIRNAME 1" >>confdefs.h + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 +printf %s "checking whether // is distinct from /... " >&6; } +if test ${gl_cv_double_slash_root+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # . + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + gl_cv_double_slash_root='unknown, assuming no' ;; + esac + else + set x `ls -di / // 2>/dev/null` + if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 +printf "%s\n" "$gl_cv_double_slash_root" >&6; } + if test "$gl_cv_double_slash_root" = yes; then + +printf "%s\n" "@%:@define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h + + fi + + + + + + +printf "%s\n" "@%:@define HAVE_DUP2 1" >>confdefs.h + + + if test $HAVE_DUP2 = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5 +printf %s "checking whether dup2 works... " >&6; } +if test ${gl_cv_func_dup2_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + mingw*) # on this platform, dup2 always returns 0 for success + gl_cv_func_dup2_works="guessing no" ;; + cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 + gl_cv_func_dup2_works="guessing no" ;; + aix* | freebsd*) + # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE, + # not EBADF. + gl_cv_func_dup2_works="guessing no" ;; + haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. + gl_cv_func_dup2_works="guessing no" ;; + *-android*) # implemented using dup3(), which fails if oldfd == newfd + gl_cv_func_dup2_works="guessing no" ;; + os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd. + gl_cv_func_dup2_works="guessing no" ;; + *) gl_cv_func_dup2_works="guessing yes" ;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + #include + #include + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + +int +main (void) +{ +int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + #ifdef FD_CLOEXEC + if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) + result |= 1; + #endif + if (dup2 (1, 1) != 1) + result |= 2; + #ifdef FD_CLOEXEC + if (fcntl (1, F_GETFD) != FD_CLOEXEC) + result |= 4; + #endif + close (0); + if (dup2 (0, 0) != -1) + result |= 8; + /* Many gnulib modules require POSIX conformance of EBADF. */ + if (dup2 (2, bad_fd) == -1 && errno != EBADF) + result |= 16; + /* Flush out some cygwin core dumps. */ + if (dup2 (2, -1) != -1 || errno != EBADF) + result |= 32; + dup2 (2, 255); + dup2 (2, 256); + /* On OS/2 kLIBC, dup2() does not work on a directory fd. */ + { + int fd = open (".", O_RDONLY); + if (fd == -1) + result |= 64; + else if (dup2 (fd, fd + 1) == -1) + result |= 128; + + close (fd); + } + return result; + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_dup2_works=yes +else case e in @%:@( + e) gl_cv_func_dup2_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5 +printf "%s\n" "$gl_cv_func_dup2_works" >&6; } + case "$gl_cv_func_dup2_works" in + *yes) ;; + *) + REPLACE_DUP2=1 + ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize" +if test "x$ac_cv_func_setdtablesize" = xyes +then : + printf "%s\n" "@%:@define HAVE_SETDTABLESIZE 1" >>confdefs.h + +fi + + ;; + esac + fi + + + if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext" + + + fi + + + + + + GNULIB_DUP2=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_DUP2 1" >>confdefs.h + + + + + + + + + + GNULIB_ENVIRON=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_ENVIRON 1" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 +printf %s "checking for error_at_line... " >&6; } +if test ${ac_cv_lib_error_at_line+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +error_at_line (0, 0, "", 0, "an error occurred"); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_error_at_line=yes +else case e in @%:@( + e) ac_cv_lib_error_at_line=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 +printf "%s\n" "$ac_cv_lib_error_at_line" >&6; } + + if test $ac_cv_lib_error_at_line = no; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext" + + + + : + + fi + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error:3:c-format" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error_at_line:5:c-format" + + + + + + + + if test $ac_cv_func_fcntl = no; then + + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5 +printf %s "checking whether fcntl handles F_DUPFD correctly... " >&6; } +if test ${gl_cv_func_fcntl_f_dupfd_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case $host_os in + aix* | cygwin* | haiku*) + gl_cv_func_fcntl_f_dupfd_works="guessing no" ;; + *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + #include + #include + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + +int +main (void) +{ +int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + if (fcntl (0, F_DUPFD, -1) != -1) result |= 1; + if (errno != EINVAL) result |= 2; + if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4; + if (errno != EINVAL) result |= 8; + /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */ + { + int fd; + fd = open (".", O_RDONLY); + if (fd == -1) + result |= 16; + else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1) + result |= 32; + + close (fd); + } + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_fcntl_f_dupfd_works=yes +else case e in @%:@( + e) gl_cv_func_fcntl_f_dupfd_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5 +printf "%s\n" "$gl_cv_func_fcntl_f_dupfd_works" >&6; } + case $gl_cv_func_fcntl_f_dupfd_works in + *yes) ;; + *) + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + +printf "%s\n" "@%:@define FCNTL_DUPFD_BUGGY 1" >>confdefs.h + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5 +printf %s "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; } +if test ${gl_cv_func_fcntl_f_dupfd_cloexec+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifndef F_DUPFD_CLOEXEC +choke me +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __linux__ +/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace + it to support the semantics on older kernels that failed with EINVAL. */ +choke me +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_fcntl_f_dupfd_cloexec=yes +else case e in @%:@( + e) gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +else case e in @%:@( + e) gl_cv_func_fcntl_f_dupfd_cloexec=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5 +printf "%s\n" "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; } + if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then + + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + fi + fi + + + if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext" + + fi + + + + + + GNULIB_FCNTL=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_FCNTL 1" >>confdefs.h + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_fcntl_h='<'fcntl.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_fcntl_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'fcntl.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_fcntl_h + gl_cv_next_fcntl_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5 +printf "%s\n" "$gl_cv_next_fcntl_h" >&6; } + fi + NEXT_FCNTL_H=$gl_cv_next_fcntl_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'fcntl.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_fcntl_h + fi + NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive + + + + + + + + + + + for gl_func in fcntl openat; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + +printf "%s\n" "@%:@define GNULIB_FILENAMECAT 1" >>confdefs.h + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5 +printf %s "checking for flexible array member... " >&6; } +if test ${ac_cv_c_flexmember+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + struct m { struct m *next, **list; char name[]; }; + struct s { struct s *p; struct m *m; int n; double d[]; }; +int +main (void) +{ +int m = getchar (); + size_t nbytes = offsetof (struct s, d) + m * sizeof (double); + nbytes += sizeof (struct s) - 1; + nbytes -= nbytes % sizeof (struct s); + struct s *p = malloc (nbytes); + p->p = p; + p->m = NULL; + p->d[0] = 0.0; + return p->d != (double *) NULL; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_flexmember=yes +else case e in @%:@( + e) ac_cv_c_flexmember=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5 +printf "%s\n" "$ac_cv_c_flexmember" >&6; } + if test $ac_cv_c_flexmember = yes; then + +printf "%s\n" "@%:@define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h + + else + printf "%s\n" "@%:@define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h + + fi + + + + + FLOAT_H= + REPLACE_FLOAT_LDBL=0 + case "$host_os" in + aix* | beos* | openbsd* | mirbsd* | irix*) + FLOAT_H=float.h + ;; + freebsd*) + case "$host_cpu" in + i[34567]86 ) + FLOAT_H=float.h + ;; + x86_64 ) + # On x86_64 systems, the C compiler may still be generating + # 32-bit code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ || defined __x86_64__ || defined __amd64__ + yes + #endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + +else case e in @%:@( + e) FLOAT_H=float.h ;; +esac +fi +rm -rf conftest* + + ;; + esac + ;; + linux*) + case "$host_cpu" in + powerpc*) + FLOAT_H=float.h + ;; + esac + ;; + esac + case "$host_os" in + aix* | freebsd* | linux*) + if test -n "$FLOAT_H"; then + REPLACE_FLOAT_LDBL=1 + fi + ;; + esac + + REPLACE_ITOLD=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5 +printf %s "checking whether conversion from 'int' to 'long double' works... " >&6; } +if test ${gl_cv_func_itold_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + case "$host" in + sparc*-*-linux*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ || defined __arch64__ + yes + #endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_func_itold_works="guessing no" +else case e in @%:@( + e) gl_cv_func_itold_works="guessing yes" ;; +esac +fi +rm -rf conftest* + + ;; + *) gl_cv_func_itold_works="guessing yes" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int i = -1; +volatile long double ld; +int main () +{ + ld += i * 1.0L; + if (ld > 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_itold_works=yes +else case e in @%:@( + e) gl_cv_func_itold_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5 +printf "%s\n" "$gl_cv_func_itold_works" >&6; } + case "$gl_cv_func_itold_works" in + *no) + REPLACE_ITOLD=1 + FLOAT_H=float.h + ;; + esac + + if test -n "$FLOAT_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_float_h='<'float.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_float_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'float.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_float_h + gl_cv_next_float_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5 +printf "%s\n" "$gl_cv_next_float_h" >&6; } + fi + NEXT_FLOAT_H=$gl_cv_next_float_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'float.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_float_h + fi + NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive + + + + + fi + + if test -n "$FLOAT_H"; then + GL_GENERATE_FLOAT_H_TRUE= + GL_GENERATE_FLOAT_H_FALSE='#' +else + GL_GENERATE_FLOAT_H_TRUE='#' + GL_GENERATE_FLOAT_H_FALSE= +fi + + + + if test $REPLACE_FLOAT_LDBL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext" + + fi + if test $REPLACE_ITOLD = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext" + + fi + + + + + + FNMATCH_H= + gl_fnmatch_required_lowercase=` + echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]' + ` + gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5 +printf %s "checking for working $gl_fnmatch_required fnmatch... " >&6; } +if eval test \${$gl_fnmatch_cache_var+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test $gl_fnmatch_required = GNU; then + gl_fnmatch_gnu_start= + gl_fnmatch_gnu_end= + else + gl_fnmatch_gnu_start='#if 0' + gl_fnmatch_gnu_end='#endif' + fi + if test "$cross_compiling" = yes +then : + eval "$gl_fnmatch_cache_var=\"guessing no\"" +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + static int + y (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == 0; + } + static int + n (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == FNM_NOMATCH; + } + +int +main (void) +{ +char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]"; + char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]"; + static char const A_1[] = { 'A' - 1, 0 }; + static char const A01[] = { 'A' + 1, 0 }; + static char const a_1[] = { 'a' - 1, 0 }; + static char const a01[] = { 'a' + 1, 0 }; + static char const bs_1[] = { '\\\\' - 1, 0 }; + static char const bs01[] = { '\\\\' + 1, 0 }; + int result = 0; + if (!n ("a*", "", 0)) + return 1; + if (!y ("a*", "abc", 0)) + return 1; + if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */ + return 1; + if (!n ("d*/*1", "d/s/1", FNM_PATHNAME)) + return 2; + if (!y ("a\\\\bc", "abc", 0)) + return 3; + if (!n ("a\\\\bc", "abc", FNM_NOESCAPE)) + return 3; + if (!y ("*x", ".x", 0)) + return 4; + if (!n ("*x", ".x", FNM_PERIOD)) + return 4; + if (!y (Apat, "\\\\", 0)) + return 5; + if (!y (Apat, "A", 0)) + return 5; + if (!y (apat, "\\\\", 0)) + return 5; + if (!y (apat, "a", 0)) + return 5; + if (!(n (Apat, A_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, a_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, A01, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, a01, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, bs_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, bs_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(n (Apat, bs01, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, bs01, 0) == ('a' < '\\\\'))) + return 5; + $gl_fnmatch_gnu_start + if (!y ("xxXX", "xXxX", FNM_CASEFOLD)) + result |= 8; + if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)) + result |= 16; + if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME)) + result |= 32; + if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + $gl_fnmatch_gnu_end + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + eval "$gl_fnmatch_cache_var=yes" +else case e in @%:@( + e) eval "$gl_fnmatch_cache_var=no" ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +eval ac_res=\$$gl_fnmatch_cache_var + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\"" + if test "$gl_fnmatch_result" = yes; then + rm -f "$gl_source_base/fnmatch.h" + else + FNMATCH_H=fnmatch.h + fi + + if test -n "$FNMATCH_H"; then + GL_GENERATE_FNMATCH_H_TRUE= + GL_GENERATE_FNMATCH_H_FALSE='#' +else + GL_GENERATE_FNMATCH_H_TRUE='#' + GL_GENERATE_FNMATCH_H_FALSE= +fi + + + if test -n "$FNMATCH_H"; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" + + + +printf "%s\n" "@%:@define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch" >>confdefs.h + + + ac_fn_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_isblank" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h + + + + + fi + + + + + + if test -n "$FNMATCH_H"; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" + + + +printf "%s\n" "@%:@define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch" >>confdefs.h + + + ac_fn_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_isblank" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h + + + + + fi + + + + case "$host_os" in + mingw* | pw* | os2*) + REPLACE_FREOPEN=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether freopen works on closed fds" >&5 +printf %s "checking whether freopen works on closed fds... " >&6; } +if test ${gl_cv_func_freopen_works_on_closed+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case $host_os in + *gnu*) gl_cv_func_freopen_works_on_closed="guessing no" ;; + *) gl_cv_func_freopen_works_on_closed="guessing yes";; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +close (0); + return !(freopen ("/dev/null", "r", stdin) + && getchar () == EOF + && !ferror (stdin) && feof (stdin)); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_freopen_works_on_closed=yes +else case e in @%:@( + e) gl_cv_func_freopen_works_on_closed=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_freopen_works_on_closed" >&5 +printf "%s\n" "$gl_cv_func_freopen_works_on_closed" >&6; } + case $gl_cv_func_freopen_works_on_closed in + *no) REPLACE_FREOPEN=1;; + esac + esac + + if test $REPLACE_FREOPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS freopen.$ac_objext" + + : + fi + + + + + + GNULIB_FREOPEN=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_FREOPEN 1" >>confdefs.h + + + + + +printf "%s\n" "@%:@define GNULIB_FREOPEN_SAFER 1" >>confdefs.h + + + + + + + case "$host_os" in + mingw*) + REPLACE_FSTAT=1 + ;; + esac + + + + if test $REPLACE_FSTAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" + + + + : + + fi + + + + + + GNULIB_FSTAT=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_FSTAT 1" >>confdefs.h + + + + + + + + + if test $ac_cv_func_getdtablesize = yes && + test $ac_cv_have_decl_getdtablesize = yes; then + # Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft limit + # up to an unchangeable hard limit; all other platforms correctly + # require setrlimit before getdtablesize() can report a larger value. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5 +printf %s "checking whether getdtablesize works... " >&6; } +if test ${gl_cv_func_getdtablesize_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows + gl_cv_func_getdtablesize_works="guessing no" ;; + *) gl_cv_func_getdtablesize_works="guessing yes" ;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int size = getdtablesize(); + if (dup2 (0, getdtablesize()) != -1) + return 1; + if (size != getdtablesize()) + return 2; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getdtablesize_works=yes +else case e in @%:@( + e) gl_cv_func_getdtablesize_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5 +printf "%s\n" "$gl_cv_func_getdtablesize_works" >&6; } + case "$gl_cv_func_getdtablesize_works" in + *yes) ;; + *) REPLACE_GETDTABLESIZE=1 ;; + esac + else + HAVE_GETDTABLESIZE=0 + fi + + if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext" + + : + fi + + + + + + GNULIB_GETDTABLESIZE=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h + + + + + + + + + + + + + REPLACE_GETOPT=0 + if test -n "$gl_replace_getopt"; then + REPLACE_GETOPT=1 + fi + + if test $REPLACE_GETOPT = 1; then + + + if test $ac_cv_header_sys_cdefs_h = yes; then + HAVE_SYS_CDEFS_H=1 + else + HAVE_SYS_CDEFS_H=0 + fi + + + +printf "%s\n" "@%:@define __GETOPT_PREFIX rpl_" >>confdefs.h + + GETOPT_H=getopt.h + GETOPT_CDEFS_H=getopt-cdefs.h + + + + fi + + if test $REPLACE_GETOPT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" + + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + + + + + ac_found=0 + ac_fn_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_program_invocation_name" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + ac_found=1 +fi + + ac_fn_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + ac_found=1 +fi + + ac_fn_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl___argv" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL___ARGV $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + ac_found=1 +fi + + + # Incur the cost of this test only if none of the above worked. + if test $ac_found = 0; then + # On OpenBSD 5.1, using the global __progname variable appears to be + # the only way to implement getprogname. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5 +printf %s "checking whether __progname is defined in default libraries... " >&6; } +if test ${gl_cv_var___progname+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_cv_var___progname= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char *__progname; +int +main (void) +{ +return *__progname; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_var___progname=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5 +printf "%s\n" "$gl_cv_var___progname" >&6; } + if test "$gl_cv_var___progname" = yes; then + +printf "%s\n" "@%:@define HAVE_VAR___PROGNAME 1" >>confdefs.h + + fi + fi + + + + + + + + + + + + + + + + gl_gettimeofday_timezone=void + if test $ac_cv_func_gettimeofday != yes; then + HAVE_GETTIMEOFDAY=0 + else + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5 +printf %s "checking whether gettimeofday clobbers localtime buffer... " >&6; } +if test ${gl_cv_func_gettimeofday_clobber+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + # When cross-compiling: + case "$host_os" in + # Guess all is fine on glibc systems. + *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_gettimeofday_clobber="guessing yes" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + #include + +int +main (void) +{ + + time_t t = 0; + struct tm *lt; + struct tm saved_lt; + struct timeval tv; + lt = localtime (&t); + saved_lt = *lt; + gettimeofday (&tv, NULL); + return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_gettimeofday_clobber=no +else case e in @%:@( + e) gl_cv_func_gettimeofday_clobber=yes ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5 +printf "%s\n" "$gl_cv_func_gettimeofday_clobber" >&6; } + + case "$gl_cv_func_gettimeofday_clobber" in + *yes) + REPLACE_GETTIMEOFDAY=1 + +printf "%s\n" "@%:@define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h + + + + + NEED_LOCALTIME_BUFFER=1 + REPLACE_GMTIME=1 + REPLACE_LOCALTIME=1 + + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5 +printf %s "checking for gettimeofday with POSIX signature... " >&6; } +if test ${gl_cv_func_gettimeofday_posix_signature+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + struct timeval c; + int gettimeofday (struct timeval *restrict, void *restrict); + +int +main (void) +{ +/* glibc uses struct timezone * rather than the POSIX void * + if _GNU_SOURCE is defined. However, since the only portable + use of gettimeofday uses NULL as the second parameter, and + since the glibc definition is actually more typesafe, it is + not worth wrapping this to get a compliant signature. */ + int (*f) (struct timeval *restrict, void *restrict) + = gettimeofday; + int x = f (&c, 0); + return !(x | c.tv_sec | c.tv_usec); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_gettimeofday_posix_signature=yes +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int gettimeofday (struct timeval *restrict, struct timezone *restrict); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_gettimeofday_posix_signature=almost +else case e in @%:@( + e) gl_cv_func_gettimeofday_posix_signature=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_gettimeofday_posix_signature" >&6; } + if test $gl_cv_func_gettimeofday_posix_signature = almost; then + gl_gettimeofday_timezone='struct timezone' + elif test $gl_cv_func_gettimeofday_posix_signature != yes; then + REPLACE_GETTIMEOFDAY=1 + fi + if test $REPLACE_STRUCT_TIMEVAL = 1; then + REPLACE_GETTIMEOFDAY=1 + fi + case "$host_os" in + mingw*) REPLACE_GETTIMEOFDAY=1 ;; + esac + fi + +printf "%s\n" "@%:@define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone" >>confdefs.h + + + if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" + + : + fi + + + + + + GNULIB_GETTIMEOFDAY=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h + + + + + if ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then + GNU_MAKE_TRUE= + GNU_MAKE_FALSE='#' +else + GNU_MAKE_TRUE='#' + GNU_MAKE_FALSE= +fi + + + # Autoconf 2.61a.99 and earlier don't support linking a file only + # in VPATH builds. But since GNUmakefile is for maintainer use + # only, it does not matter if we skip the link with older autoconf. + # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH + # builds, so use a shell variable to bypass this. + GNUmakefile=GNUmakefile + ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile" + + + : + + + + + + + + GNULIB_ICONV=1 + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_iconv_h='<'iconv.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_iconv_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_iconv_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'iconv.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_iconv_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_iconv_h + gl_cv_next_iconv_h='"'$gl_header'"' + else + gl_cv_next_iconv_h='<'iconv.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_iconv_h" >&5 +printf "%s\n" "$gl_cv_next_iconv_h" >&6; } + fi + NEXT_ICONV_H=$gl_cv_next_iconv_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'iconv.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_iconv_h + fi + NEXT_AS_FIRST_DIRECTIVE_ICONV_H=$gl_next_as_first_directive + + + + + + + + + + if test "$am_cv_func_iconv" = yes; then + + + ICONV_H='iconv.h' + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__) + gnu_iconv + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "gnu_iconv" >/dev/null 2>&1 +then : + gl_func_iconv_gnu=yes +else case e in @%:@( + e) gl_func_iconv_gnu=no ;; +esac +fi +rm -rf conftest* + + if test $gl_func_iconv_gnu = no; then + iconv_flavor= + case "$host_os" in + aix*) iconv_flavor=ICONV_FLAVOR_AIX ;; + irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;; + hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;; + osf*) iconv_flavor=ICONV_FLAVOR_OSF ;; + solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;; + esac + if test -n "$iconv_flavor"; then + +printf "%s\n" "@%:@define ICONV_FLAVOR $iconv_flavor" >>confdefs.h + + + + + ICONV_H='iconv.h' + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + + + REPLACE_ICONV_OPEN=1 + + fi + fi + + fi + + if test $REPLACE_ICONV_OPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv_open.$ac_objext" + + fi + if test $REPLACE_ICONV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv_close.$ac_objext" + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler generally respects inline" >&5 +printf %s "checking whether the compiler generally respects inline... " >&6; } +if test ${gl_cv_c_inline_effective+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test $ac_cv_c_inline = no; then + gl_cv_c_inline_effective=no + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifdef __NO_INLINE__ + #error "inline is not effective" + #endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_c_inline_effective=yes +else case e in @%:@( + e) gl_cv_c_inline_effective=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_inline_effective" >&5 +printf "%s\n" "$gl_cv_c_inline_effective" >&6; } + if test $gl_cv_c_inline_effective = yes; then + +printf "%s\n" "@%:@define HAVE_INLINE 1" >>confdefs.h + + fi + + + + + : + + : + : + : + : + + + + + + + PRIPTR_PREFIX= + if test -n "$STDINT_H"; then + PRIPTR_PREFIX='"l"' + else + for glpfx in '' l ll I64; do + case $glpfx in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + I64) gltype1='__int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + extern intptr_t foo; + extern $gltype1 foo; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + PRIPTR_PREFIX='"'$glpfx'"' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test -n "$PRIPTR_PREFIX" && break + done + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5 +printf %s "checking whether INT32_MAX < INTMAX_MAX... " >&6; } +if test ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include + #if HAVE_STDINT_H + #include + #endif + + #if defined INT32_MAX && defined INTMAX_MAX + #define CONDITION (INT32_MAX < INTMAX_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (int) < sizeof (long long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes +else case e in @%:@( + e) gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5 +printf "%s\n" "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; } + if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then + INT32_MAX_LT_INTMAX_MAX=1; + else + INT32_MAX_LT_INTMAX_MAX=0; + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5 +printf %s "checking whether INT64_MAX == LONG_MAX... " >&6; } +if test ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include + #if HAVE_STDINT_H + #include + #endif + + #if defined INT64_MAX + #define CONDITION (INT64_MAX == LONG_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (long long int) == sizeof (long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes +else case e in @%:@( + e) gl_cv_test_INT64_MAX_EQ_LONG_MAX=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5 +printf "%s\n" "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; } + if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then + INT64_MAX_EQ_LONG_MAX=1; + else + INT64_MAX_EQ_LONG_MAX=0; + fi + + + else + INT64_MAX_EQ_LONG_MAX=-1 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5 +printf %s "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; } +if test ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include + #if HAVE_STDINT_H + #include + #endif + + #if defined UINT32_MAX && defined UINTMAX_MAX + #define CONDITION (UINT32_MAX < UINTMAX_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes +else case e in @%:@( + e) gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5 +printf "%s\n" "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; } + if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then + UINT32_MAX_LT_UINTMAX_MAX=1; + else + UINT32_MAX_LT_UINTMAX_MAX=0; + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5 +printf %s "checking whether UINT64_MAX == ULONG_MAX... " >&6; } +if test ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include + #if HAVE_STDINT_H + #include + #endif + + #if defined UINT64_MAX + #define CONDITION (UINT64_MAX == ULONG_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes +else case e in @%:@( + e) gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5 +printf "%s\n" "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; } + if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then + UINT64_MAX_EQ_ULONG_MAX=1; + else + UINT64_MAX_EQ_ULONG_MAX=0; + fi + + + else + UINT64_MAX_EQ_ULONG_MAX=-1 + fi + + + + + + + + + if test $ac_cv_func_isblank = no; then + HAVE_ISBLANK=0 + fi + + if test $HAVE_ISBLANK = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS isblank.$ac_objext" + + fi + + + + + + GNULIB_ISBLANK=1 + + + + + + + + + + ac_fn_check_decl "$LINENO" "iswblank" "ac_cv_have_decl_iswblank" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_iswblank" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_ISWBLANK $ac_have_decl" >>confdefs.h + + if test $ac_cv_func_iswblank = no; then + HAVE_ISWBLANK=0 + if test $ac_cv_have_decl_iswblank = yes; then + REPLACE_ISWBLANK=1 + fi + fi + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + : + fi + fi + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iswblank.$ac_objext" + + fi + fi + + + + + + GNULIB_ISWBLANK=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_ISWBLANK 1" >>confdefs.h + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_langinfo_h='<'langinfo.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_langinfo_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_langinfo_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'langinfo.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_langinfo_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_langinfo_h + gl_cv_next_langinfo_h='"'$gl_header'"' + else + gl_cv_next_langinfo_h='<'langinfo.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_langinfo_h" >&5 +printf "%s\n" "$gl_cv_next_langinfo_h" >&6; } + fi + NEXT_LANGINFO_H=$gl_cv_next_langinfo_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'langinfo.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_langinfo_h + fi + NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H=$gl_next_as_first_directive + + + + + + HAVE_LANGINFO_CODESET=0 + HAVE_LANGINFO_T_FMT_AMPM=0 + HAVE_LANGINFO_ERA=0 + HAVE_LANGINFO_YESEXPR=0 + + if test $ac_cv_header_langinfo_h = yes; then + HAVE_LANGINFO_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines CODESET" >&5 +printf %s "checking whether langinfo.h defines CODESET... " >&6; } +if test ${gl_cv_header_langinfo_codeset+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int a = CODESET; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_codeset=yes +else case e in @%:@( + e) gl_cv_header_langinfo_codeset=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_codeset" >&5 +printf "%s\n" "$gl_cv_header_langinfo_codeset" >&6; } + if test $gl_cv_header_langinfo_codeset = yes; then + HAVE_LANGINFO_CODESET=1 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines T_FMT_AMPM" >&5 +printf %s "checking whether langinfo.h defines T_FMT_AMPM... " >&6; } +if test ${gl_cv_header_langinfo_t_fmt_ampm+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int a = T_FMT_AMPM; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_t_fmt_ampm=yes +else case e in @%:@( + e) gl_cv_header_langinfo_t_fmt_ampm=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_t_fmt_ampm" >&5 +printf "%s\n" "$gl_cv_header_langinfo_t_fmt_ampm" >&6; } + if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then + HAVE_LANGINFO_T_FMT_AMPM=1 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ERA" >&5 +printf %s "checking whether langinfo.h defines ERA... " >&6; } +if test ${gl_cv_header_langinfo_era+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int a = ERA; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_era=yes +else case e in @%:@( + e) gl_cv_header_langinfo_era=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_era" >&5 +printf "%s\n" "$gl_cv_header_langinfo_era" >&6; } + if test $gl_cv_header_langinfo_era = yes; then + HAVE_LANGINFO_ERA=1 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines YESEXPR" >&5 +printf %s "checking whether langinfo.h defines YESEXPR... " >&6; } +if test ${gl_cv_header_langinfo_yesexpr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int a = YESEXPR; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_yesexpr=yes +else case e in @%:@( + e) gl_cv_header_langinfo_yesexpr=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_yesexpr" >&5 +printf "%s\n" "$gl_cv_header_langinfo_yesexpr" >&6; } + if test $gl_cv_header_langinfo_yesexpr = yes; then + HAVE_LANGINFO_YESEXPR=1 + fi + else + HAVE_LANGINFO_H=0 + fi + + + + + + + + for gl_func in nl_langinfo; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +@%:@ Check whether --with-libsigsegv-prefix was given. +if test ${with_libsigsegv_prefix+y} +then : + withval=$with_libsigsegv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBSIGSEGV= + LTLIBSIGSEGV= + INCSIGSEGV= + LIBSIGSEGV_PREFIX= + HAVE_LIBSIGSEGV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='sigsegv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_a" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCSIGSEGV="${INCSIGSEGV}${INCSIGSEGV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$dep" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$dep" + ;; + esac + done + fi + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-R$found_dir" + done + fi + + + + + + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCSIGSEGV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsigsegv" >&5 +printf %s "checking for libsigsegv... " >&6; } +if test ${ac_cv_libsigsegv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + ac_save_LIBS="$LIBS" + case " $LIBSIGSEGV" in + *" -l"*) LIBS="$LIBS $LIBSIGSEGV" ;; + *) LIBS="$LIBSIGSEGV $LIBS" ;; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +sigsegv_deinstall_handler(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libsigsegv=yes +else case e in @%:@( + e) ac_cv_libsigsegv='no, consider installing GNU libsigsegv' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libsigsegv" >&5 +printf "%s\n" "$ac_cv_libsigsegv" >&6; } + if test "$ac_cv_libsigsegv" = yes; then + HAVE_LIBSIGSEGV=yes + +printf "%s\n" "@%:@define HAVE_LIBSIGSEGV 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libsigsegv" >&5 +printf %s "checking how to link with libsigsegv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBSIGSEGV" >&5 +printf "%s\n" "$LIBSIGSEGV" >&6; } + else + HAVE_LIBSIGSEGV=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBSIGSEGV= + LTLIBSIGSEGV= + LIBSIGSEGV_PREFIX= + fi + + + + + + + + gl_cv_lib_sigsegv="$ac_cv_libsigsegv" + + + + + + + + + + + LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" + + + + + + + + + + case "$host_os" in + solaris*) + +printf "%s\n" "@%:@define _LCONV_C99 1" >>confdefs.h + + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5 +printf %s "checking whether locale.h conforms to POSIX:2001... " >&6; } +if test ${gl_cv_header_locale_h_posix2001+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int x = LC_MESSAGES; + int y = sizeof (((struct lconv *) 0)->decimal_point); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_locale_h_posix2001=yes +else case e in @%:@( + e) gl_cv_header_locale_h_posix2001=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5 +printf "%s\n" "$gl_cv_header_locale_h_posix2001" >&6; } + + + if test $ac_cv_header_xlocale_h = yes; then + HAVE_XLOCALE_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5 +printf %s "checking whether locale.h defines locale_t... " >&6; } +if test ${gl_cv_header_locale_has_locale_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + locale_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_locale_has_locale_t=yes +else case e in @%:@( + e) gl_cv_header_locale_has_locale_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5 +printf "%s\n" "$gl_cv_header_locale_has_locale_t" >&6; } + if test $gl_cv_header_locale_has_locale_t = yes; then + gl_cv_header_locale_h_needs_xlocale_h=no + else + gl_cv_header_locale_h_needs_xlocale_h=yes + fi + else + HAVE_XLOCALE_H=0 + gl_cv_header_locale_h_needs_xlocale_h=no + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5 +printf %s "checking whether struct lconv is properly defined... " >&6; } +if test ${gl_cv_sys_struct_lconv_ok+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + struct lconv l; + int x = sizeof (l.decimal_point); + int y = sizeof (l.int_p_cs_precedes); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_lconv_ok=yes +else case e in @%:@( + e) gl_cv_sys_struct_lconv_ok=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5 +printf "%s\n" "$gl_cv_sys_struct_lconv_ok" >&6; } + if test $gl_cv_sys_struct_lconv_ok = no; then + REPLACE_STRUCT_LCONV=1 + fi + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_locale_h='<'locale.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_locale_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'locale.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_locale_h + gl_cv_next_locale_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5 +printf "%s\n" "$gl_cv_next_locale_h" >&6; } + fi + NEXT_LOCALE_H=$gl_cv_next_locale_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'locale.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_locale_h + fi + NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive + + + + + + + for gl_func in setlocale duplocale; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +/* Some systems provide declarations in a non-standard header. */ +#if HAVE_XLOCALE_H +# include +#endif + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + if test $REPLACE_STRUCT_LCONV = 1; then + REPLACE_LOCALECONV=1 + fi + + if test $REPLACE_LOCALECONV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS localeconv.$ac_objext" + + + ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include +" +if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_LCONV_DECIMAL_POINT 1" >>confdefs.h + + +fi + + + fi + + + + + + GNULIB_LOCALECONV=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_LOCALECONV 1" >>confdefs.h + + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS localtime-buffer.$ac_objext" + + + + + if test $ac_cv_func_lstat = yes; then + + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *no) + REPLACE_LSTAT=1 + ;; + esac + else + HAVE_LSTAT=0 + fi + + if test $REPLACE_LSTAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext" + + : + fi + + + + + + GNULIB_LSTAT=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_LSTAT 1" >>confdefs.h + + + + + + + + + if test $gl_cv_func_malloc_posix = yes; then + +printf "%s\n" "@%:@define HAVE_MALLOC_POSIX 1" >>confdefs.h + + else + REPLACE_MALLOC=1 + fi + + if test $REPLACE_MALLOC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" + + fi + + + + + + GNULIB_MALLOC_POSIX=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h + + + + + + + + + + + + + : + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_incomplete_state=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_sanitycheck=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_mbrtowc = no; then + HAVE_MBRTOWC=0 + ac_fn_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_mbrtowc" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_MBRTOWC $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_mbrtowc = yes; then + REPLACE_MBRTOWC=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBRTOWC=1 + else + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5 +printf %s "checking whether mbrtowc handles a NULL pwc argument... " >&6; } +if test ${gl_cv_func_mbrtowc_null_arg1+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris. + solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + int result = 0; + + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "\303\237er"; + mbstate_t state; + wchar_t wc; + size_t ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 5, &state); + if (ret != 2) + result |= 1; + if (!mbsinit (&state)) + result |= 2; + + memset (&state, '\0', sizeof (mbstate_t)); + ret = mbrtowc (NULL, input, 5, &state); + if (ret != 2) /* Solaris 7 fails here: ret is -1. */ + result |= 4; + if (!mbsinit (&state)) + result |= 8; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_null_arg1=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_null_arg1=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_null_arg1" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5 +printf %s "checking whether mbrtowc handles a NULL string argument... " >&6; } +if test ${gl_cv_func_mbrtowc_null_arg2+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on OSF/1. + osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + mbstate_t state; + wchar_t wc; + int ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + mbrtowc (&wc, NULL, 5, &state); + /* Check that wc was not modified. */ + if (wc != (wchar_t) 0xBADFACE) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_null_arg2=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_null_arg2=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_null_arg2" >&6; } + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5 +printf %s "checking whether mbrtowc has a correct return value... " >&6; } +if test ${gl_cv_func_mbrtowc_retval+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on HP-UX, Solaris, native Windows. + hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_retval="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \ + || { case "$host_os" in mingw*) true;; *) false;; esac; }; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + int result = 0; + int found_some_locale = 0; + /* This fails on Solaris. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "B\303\274\303\237er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 1) + result |= 1; + } + found_some_locale = 1; + } + /* This fails on HP-UX 11.11. */ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 2) + result |= 2; + } + found_some_locale = 1; + } + /* This fails on native Windows. */ + if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) + { + char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 4; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) + { + char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 8; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_China.936") != NULL) + { + char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 16; + } + found_some_locale = 1; + } + return (found_some_locale ? result : 77); +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_retval=yes +else case e in @%:@( + e) if test $? != 77; then + gl_cv_func_mbrtowc_retval=no + fi + ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_retval" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5 +printf %s "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; } +if test ${gl_cv_func_mbrtowc_nul_retval+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris 8 and 9. + solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + /* This fails on Solaris 8 and 9. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, "", 1, &state) != 0) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_nul_retval=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_nul_retval=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_nul_retval" >&6; } + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5 +printf %s "checking whether mbrtowc works on empty input... " >&6; } +if test ${gl_cv_func_mbrtowc_empty_input+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on AIX and glibc systems. + aix* | *-gnu*) + gl_cv_func_mbrtowc_empty_input="guessing no" ;; + *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; + esac + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + static wchar_t wc; + static mbstate_t mbs; + int + main (void) + { + return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2; + } +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_empty_input=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_empty_input=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_empty_input" >&6; } + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5 +printf %s "checking whether the C locale is free of encoding errors... " >&6; } +if test ${gl_cv_C_locale_sans_EILSEQ+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_cv_C_locale_sans_EILSEQ="guessing no" + + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + +int +main (void) +{ + + int i; + char *locale = setlocale (LC_ALL, "C"); + if (! locale) + return 2; + for (i = CHAR_MIN; i <= CHAR_MAX; i++) + { + char c = i; + wchar_t wc; + mbstate_t mbs = { 0, }; + size_t ss = mbrtowc (&wc, &c, 1, &mbs); + if (1 < ss) + return 3; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_C_locale_sans_EILSEQ=yes +else case e in @%:@( + e) gl_cv_C_locale_sans_EILSEQ=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_C_locale_sans_EILSEQ" >&5 +printf "%s\n" "$gl_cv_C_locale_sans_EILSEQ" >&6; } + + case "$gl_cv_func_mbrtowc_null_arg1" in + *yes) ;; + *) +printf "%s\n" "@%:@define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_null_arg2" in + *yes) ;; + *) +printf "%s\n" "@%:@define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_retval" in + *yes) ;; + *) +printf "%s\n" "@%:@define MBRTOWC_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_nul_retval" in + *yes) ;; + *) +printf "%s\n" "@%:@define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_empty_input" in + *yes) ;; + *) +printf "%s\n" "@%:@define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case $gl_cv_C_locale_sans_EILSEQ in + *yes) ;; + *) +printf "%s\n" "@%:@define C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + fi + fi + + if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBRTOWC=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBRTOWC 1" >>confdefs.h + + + + + + + + + GNULIB_MBSCASECMP=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBSCASECMP 1" >>confdefs.h + + + + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_incomplete_state=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_sanitycheck=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_mbsinit = no; then + HAVE_MBSINIT=0 + ac_fn_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_mbsinit" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_MBSINIT $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_mbsinit = yes; then + REPLACE_MBSINIT=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSINIT=1 + else + case "$host_os" in + mingw*) REPLACE_MBSINIT=1 ;; + esac + fi + fi + + if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBSINIT=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBSINIT 1" >>confdefs.h + + + + + + + if test $ac_cv_func_mbslen = yes; then + HAVE_MBSLEN=1 + else + HAVE_MBSLEN=0 + fi + + + + + + + GNULIB_MBSLEN=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBSLEN 1" >>confdefs.h + + + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_incomplete_state=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_sanitycheck=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_mbsrtowcs = no; then + HAVE_MBSRTOWCS=0 + ac_fn_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_mbsrtowcs" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_MBSRTOWCS $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_mbsrtowcs = yes; then + REPLACE_MBSRTOWCS=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSRTOWCS=1 + else + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5 +printf %s "checking whether mbsrtowcs works... " >&6; } +if test ${gl_cv_func_mbsrtowcs_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on HP-UX, Solaris, mingw. + hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbsrtowcs_works="guessing yes" ;; + esac + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + int result = 0; + /* Test whether the function supports a NULL destination argument. + This fails on native Windows. */ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + const char input[] = "\337er"; + const char *src = input; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbsrtowcs (NULL, &src, 1, &state) != 3 + || src != input) + result |= 1; + } + /* Test whether the function works when started with a conversion state + in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + const char input[] = "B\303\274\303\237er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + result |= 2; + } + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "<\306\374\313\334\270\354>"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 4; + if (mbsrtowcs (NULL, &src, 10, &state) != 3) + result |= 4; + } + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + const char input[] = "B\250\271\201\060\211\070er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + result |= 8; + } + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbsrtowcs_works=yes +else case e in @%:@( + e) gl_cv_func_mbsrtowcs_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5 +printf "%s\n" "$gl_cv_func_mbsrtowcs_works" >&6; } + + case "$gl_cv_func_mbsrtowcs_works" in + *yes) ;; + *) REPLACE_MBSRTOWCS=1 ;; + esac + fi + fi + + if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBSRTOWCS=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h + + + + + + + + + GNULIB_MBSSTR=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBSSTR 1" >>confdefs.h + + + + + + + if false; then + REPLACE_MBTOWC=1 + fi + + if test $REPLACE_MBTOWC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbtowc.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBTOWC=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MBTOWC 1" >>confdefs.h + + + + + + : + + + if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext" + + + ac_fn_c_check_header_compile "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default" +if test "x$ac_cv_header_bp_sym_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_BP_SYM_H 1" >>confdefs.h + +fi + + + fi + + + + + + GNULIB_MEMCHR=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MEMCHR 1" >>confdefs.h + + + + + + + + + + + if test $ac_cv_func_mkstemp = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working mkstemp" >&5 +printf %s "checking for working mkstemp... " >&6; } +if test ${gl_cv_func_working_mkstemp+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + mkdir conftest.mkstemp + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_working_mkstemp="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_mkstemp="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ +int result = 0; + int i; + off_t large = (off_t) 4294967295u; + if (large < 0) + large = 2147483647; + umask (0); + for (i = 0; i < 70; i++) + { + char templ[] = "conftest.mkstemp/coXXXXXX"; + int (*mkstemp_function) (char *) = mkstemp; + int fd = mkstemp_function (templ); + if (fd < 0) + result |= 1; + else + { + struct stat st; + if (lseek (fd, large, SEEK_SET) != large) + result |= 2; + if (fstat (fd, &st) < 0) + result |= 4; + else if (st.st_mode & 0077) + result |= 8; + if (close (fd)) + result |= 16; + } + } + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_working_mkstemp=yes +else case e in @%:@( + e) gl_cv_func_working_mkstemp=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -rf conftest.mkstemp + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mkstemp" >&5 +printf "%s\n" "$gl_cv_func_working_mkstemp" >&6; } + case "$gl_cv_func_working_mkstemp" in + *yes) ;; + *) + REPLACE_MKSTEMP=1 + ;; + esac + else + HAVE_MKSTEMP=0 + fi + + if test $HAVE_MKSTEMP = 0 || test $REPLACE_MKSTEMP = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mkstemp.$ac_objext" + + + + fi + + + + + + GNULIB_MKSTEMP=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MKSTEMP 1" >>confdefs.h + + + + + + + + + REPLACE_MKTIME=0 + if test "$gl_cv_func_working_mktime" != yes; then + REPLACE_MKTIME=1 + +printf "%s\n" "@%:@define NEED_MKTIME_WORKING 1" >>confdefs.h + + fi + case "$host_os" in + mingw*) + REPLACE_MKTIME=1 + +printf "%s\n" "@%:@define NEED_MKTIME_WINDOWS 1" >>confdefs.h + + ;; + esac + + if test $REPLACE_MKTIME = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext" + + : + fi + + + + + + GNULIB_MKTIME=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_MKTIME 1" >>confdefs.h + + + + + + + WANT_MKTIME_INTERNAL=0 + ac_fn_c_check_func "$LINENO" "__mktime_internal" "ac_cv_func___mktime_internal" +if test "x$ac_cv_func___mktime_internal" = xyes +then : + +printf "%s\n" "@%:@define mktime_internal __mktime_internal" >>confdefs.h + + +else case e in @%:@( + e) WANT_MKTIME_INTERNAL=1 + +printf "%s\n" "@%:@define NEED_MKTIME_INTERNAL 1" >>confdefs.h + + ;; +esac +fi + + + if test $WANT_MKTIME_INTERNAL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext" + + : + fi + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext" + + fi + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext" + + fi + + +printf "%s\n" "@%:@define GNULIB_MSVC_NOTHROW 1" >>confdefs.h + + + + + + + + if test $ac_cv_func_nl_langinfo = yes; then + # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether YESEXPR works" >&5 +printf %s "checking whether YESEXPR works... " >&6; } +if test ${gl_cv_func_nl_langinfo_yesexpr_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on irix systems. + irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";; + # Guess yes elsewhere. + *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +return !*nl_langinfo(YESEXPR); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_nl_langinfo_yesexpr_works=yes +else case e in @%:@( + e) gl_cv_func_nl_langinfo_yesexpr_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nl_langinfo_yesexpr_works" >&5 +printf "%s\n" "$gl_cv_func_nl_langinfo_yesexpr_works" >&6; } + case $gl_cv_func_nl_langinfo_yesexpr_works in + *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;; + *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;; + esac + +printf "%s\n" "@%:@define FUNC_NL_LANGINFO_YESEXPR_WORKS $FUNC_NL_LANGINFO_YESEXPR_WORKS" >>confdefs.h + + if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \ + && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then + : + else + REPLACE_NL_LANGINFO=1 + +printf "%s\n" "@%:@define REPLACE_NL_LANGINFO 1" >>confdefs.h + + fi + else + HAVE_NL_LANGINFO=0 + fi + + if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS nl_langinfo.$ac_objext" + + fi + + + + + + GNULIB_NL_LANGINFO=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_NL_LANGINFO 1" >>confdefs.h + + + + + + case "$host_os" in + mingw* | pw*) + REPLACE_OPEN=1 + ;; + *) + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5 +printf %s "checking whether open recognizes a trailing slash... " >&6; } +if test ${gl_cv_func_open_slash+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + touch conftest.tmp + ln -s conftest.tmp conftest.lnk + fi + if test "$cross_compiling" = yes +then : + + case "$host_os" in + freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*) + gl_cv_func_open_slash="guessing no" ;; + *) + gl_cv_func_open_slash="guessing yes" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_UNISTD_H +# include +#endif +int main () +{ + int result = 0; +#if HAVE_LSTAT + if (open ("conftest.lnk/", O_RDONLY) != -1) + result |= 1; +#endif + if (open ("conftest.sl/", O_CREAT, 0600) >= 0) + result |= 2; + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_open_slash=yes +else case e in @%:@( + e) gl_cv_func_open_slash=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.sl conftest.tmp conftest.lnk + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5 +printf "%s\n" "$gl_cv_func_open_slash" >&6; } + case "$gl_cv_func_open_slash" in + *no) + +printf "%s\n" "@%:@define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h + + REPLACE_OPEN=1 + ;; + esac + ;; + esac + + + + if test $REPLACE_OPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext" + + + + : + + fi + + + + + + GNULIB_OPEN=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_OPEN 1" >>confdefs.h + + + + + + + ac_fn_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_program_invocation_name" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl" >>confdefs.h + + ac_fn_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl" >>confdefs.h + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"'" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"'" + + + : + + + : + + + + + ac_fn_c_check_func "$LINENO" "raise" "ac_cv_func_raise" +if test "x$ac_cv_func_raise" = xyes +then : + printf "%s\n" "@%:@define HAVE_RAISE 1" >>confdefs.h + +fi + + if test $ac_cv_func_raise = no; then + HAVE_RAISE=0 + else + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_RAISE=1 + fi + + + + + + if test $gl_cv_type_sigset_t = yes; then + ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" +if test "x$ac_cv_func_sigprocmask" = xyes +then : + gl_cv_func_sigprocmask=1 +fi + + fi + if test -z "$gl_cv_func_sigprocmask"; then + HAVE_POSIX_SIGNALBLOCKING=0 + fi + + if test $HAVE_POSIX_SIGNALBLOCKING = 0; then + : + fi + + fi + + if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS raise.$ac_objext" + + : + fi + + + + + + GNULIB_RAISE=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_RAISE 1" >>confdefs.h + + + + + + + + ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr" +if test "x$ac_cv_func_rawmemchr" = xyes +then : + printf "%s\n" "@%:@define HAVE_RAWMEMCHR 1" >>confdefs.h + +fi + + if test $ac_cv_func_rawmemchr = no; then + HAVE_RAWMEMCHR=0 + fi + + if test $HAVE_RAWMEMCHR = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext" + + : + fi + + + + + + GNULIB_RAWMEMCHR=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h + + + + + + + if test $ac_cv_func_readlink = no; then + HAVE_READLINK=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5 +printf %s "checking whether readlink signature is correct... " >&6; } +if test ${gl_cv_decl_readlink_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Cause compilation failure if original declaration has wrong type. */ + ssize_t readlink (const char *, char *, size_t); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_readlink_works=yes +else case e in @%:@( + e) gl_cv_decl_readlink_works=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5 +printf "%s\n" "$gl_cv_decl_readlink_works" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5 +printf %s "checking whether readlink handles trailing slash correctly... " >&6; } +if test ${gl_cv_func_readlink_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # We have readlink, so assume ln -s works. + ln -s conftest.no-such conftest.link + ln -s conftest.link conftest.lnk2 + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_readlink_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_readlink_works="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +char buf[20]; + return readlink ("conftest.lnk2/", buf, sizeof buf) != -1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_readlink_works=yes +else case e in @%:@( + e) gl_cv_func_readlink_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.link conftest.lnk2 ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_works" >&5 +printf "%s\n" "$gl_cv_func_readlink_works" >&6; } + case "$gl_cv_func_readlink_works" in + *yes) + if test "$gl_cv_decl_readlink_works" != yes; then + REPLACE_READLINK=1 + fi + ;; + *) + +printf "%s\n" "@%:@define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h + + REPLACE_READLINK=1 + ;; + esac + fi + + if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext" + + + : + + fi + + + + + + GNULIB_READLINK=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_READLINK 1" >>confdefs.h + + + + + +@%:@ Check whether --with-included-regex was given. +if test ${with_included_regex+y} +then : + withval=$with_included_regex; +fi + + + case $with_included_regex in #( + yes|no) ac_use_included_regex=$with_included_regex + ;; + '') + # If the system regex support is good enough that it passes the + # following run test, then default to *not* using the included regex.c. + # If cross compiling, assume the test would fail and use the included + # regex.c. + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working re_compile_pattern" >&5 +printf %s "checking for working re_compile_pattern... " >&6; } +if test ${gl_cv_func_re_compile_pattern_working+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_re_compile_pattern_working=no +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + + #include + #include + #include + + #if defined M_CHECK_ACTION || HAVE_DECL_ALARM + # include + # include + #endif + + #if HAVE_MALLOC_H + # include + #endif + + #ifdef M_CHECK_ACTION + /* Exit with distinguishable exit code. */ + static void sigabrt_no_core (int sig) { raise (SIGTERM); } + #endif + +int +main (void) +{ +int result = 0; + static struct re_pattern_buffer regex; + unsigned char folded_chars[UCHAR_MAX + 1]; + int i; + const char *s; + struct re_registers regs; + + /* Some builds of glibc go into an infinite loop on this + test. Use alarm to force death, and mallopt to avoid + malloc recursion in diagnosing the corrupted heap. */ +#if HAVE_DECL_ALARM + signal (SIGALRM, SIG_DFL); + alarm (2); +#endif +#ifdef M_CHECK_ACTION + signal (SIGABRT, sigabrt_no_core); + mallopt (M_CHECK_ACTION, 2); +#endif + + if (setlocale (LC_ALL, "en_US.UTF-8")) + { + { + /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html + This test needs valgrind to catch the bug on Debian + GNU/Linux 3.1 x86, but it might catch the bug better + on other platforms and it shouldn't hurt to try the + test here. */ + static char const pat[] = "insert into"; + static char const data[] = + "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK"; + re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE + | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else if (re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, ®s) + != -1) + result |= 1; + regfree (®ex); + } + + { + /* This test is from glibc bug 15078. + The test case is from Andreas Schwab in + . + */ + static char const pat[] = "[^x]x"; + static char const data[] = + /* */ + "\xe1\x80\x80" + "\xe1\x80\xbb" + "\xe1\x80\xbd" + "\xe1\x80\x94" + "\xe1\x80\xba" + "\xe1\x80\xaf" + "\xe1\x80\x95" + "\xe1\x80\xba" + "x"; + re_set_syntax (0); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else + { + i = re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, 0); + if (i != 0 && i != 21) + result |= 1; + } + regfree (®ex); + } + + if (! setlocale (LC_ALL, "C")) + return 1; + } + + /* This test is from glibc bug 3957, reported by Andrew Mackey. */ + re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[^x]b", 6, ®ex); + if (s) + result |= 2; + /* This should fail, but succeeds for glibc-2.5. */ + else if (re_search (®ex, "a\nb", 3, 0, 3, ®s) != -1) + result |= 2; + + /* This regular expression is from Spencer ere test number 75 + in grep-2.3. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP); + memset (®ex, 0, sizeof regex); + for (i = 0; i <= UCHAR_MAX; i++) + folded_chars[i] = i; + regex.translate = folded_chars; + s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, ®ex); + /* This should fail with _Invalid character class name_ error. */ + if (!s) + result |= 4; + + /* Ensure that [b-a] is diagnosed as invalid, when + using RE_NO_EMPTY_RANGES. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[b-a]", 6, ®ex); + if (s == 0) + result |= 8; + + /* This should succeed, but does not for glibc-2.1.3. */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("{1", 2, ®ex); + if (s) + result |= 8; + + /* The following example is derived from a problem report + against gawk from Jorge Stolfi . */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[an\371]*n", 7, ®ex); + if (s) + result |= 8; + /* This should match, but does not for glibc-2.2.1. */ + else if (re_match (®ex, "an", 2, 0, ®s) != 2) + result |= 8; + + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 8; + /* glibc-2.2.93 does not work with a negative RANGE argument. */ + else if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1) + result |= 8; + + /* The version of regex.c in older versions of gnulib + ignored RE_ICASE. Detect that problem too. */ + re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 16; + else if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0) + result |= 16; + + /* Catch a bug reported by Vin Shelton in + http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html + */ + re_set_syntax (RE_SYNTAX_POSIX_BASIC + & ~RE_CONTEXT_INVALID_DUP + & ~RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, ®ex); + if (s) + result |= 32; + + /* REG_STARTEND was added to glibc on 2004-01-15. + Reject older versions. */ + if (! REG_STARTEND) + result |= 64; + +#if 0 + /* It would be nice to reject hosts whose regoff_t values are too + narrow (including glibc on hosts with 64-bit ptrdiff_t and + 32-bit int), but we should wait until glibc implements this + feature. Otherwise, support for equivalence classes and + multibyte collation symbols would always be broken except + when compiling --without-included-regex. */ + if (sizeof (regoff_t) < sizeof (ptrdiff_t) + || sizeof (regoff_t) < sizeof (ssize_t)) + result |= 64; +#endif + + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_re_compile_pattern_working=yes +else case e in @%:@( + e) gl_cv_func_re_compile_pattern_working=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_re_compile_pattern_working" >&5 +printf "%s\n" "$gl_cv_func_re_compile_pattern_working" >&6; } + case $gl_cv_func_re_compile_pattern_working in #( + yes) ac_use_included_regex=no;; #( + no) ac_use_included_regex=yes;; + esac + ;; + *) as_fn_error $? "Invalid value for --with-included-regex: $with_included_regex" "$LINENO" 5 + ;; + esac + + if test $ac_use_included_regex = yes; then + +printf "%s\n" "@%:@define _REGEX_INCLUDE_LIMITS_H 1" >>confdefs.h + + +printf "%s\n" "@%:@define _REGEX_LARGE_OFFSETS 1" >>confdefs.h + + +printf "%s\n" "@%:@define re_syntax_options rpl_re_syntax_options" >>confdefs.h + + +printf "%s\n" "@%:@define re_set_syntax rpl_re_set_syntax" >>confdefs.h + + +printf "%s\n" "@%:@define re_compile_pattern rpl_re_compile_pattern" >>confdefs.h + + +printf "%s\n" "@%:@define re_compile_fastmap rpl_re_compile_fastmap" >>confdefs.h + + +printf "%s\n" "@%:@define re_search rpl_re_search" >>confdefs.h + + +printf "%s\n" "@%:@define re_search_2 rpl_re_search_2" >>confdefs.h + + +printf "%s\n" "@%:@define re_match rpl_re_match" >>confdefs.h + + +printf "%s\n" "@%:@define re_match_2 rpl_re_match_2" >>confdefs.h + + +printf "%s\n" "@%:@define re_set_registers rpl_re_set_registers" >>confdefs.h + + +printf "%s\n" "@%:@define re_comp rpl_re_comp" >>confdefs.h + + +printf "%s\n" "@%:@define re_exec rpl_re_exec" >>confdefs.h + + +printf "%s\n" "@%:@define regcomp rpl_regcomp" >>confdefs.h + + +printf "%s\n" "@%:@define regexec rpl_regexec" >>confdefs.h + + +printf "%s\n" "@%:@define regerror rpl_regerror" >>confdefs.h + + +printf "%s\n" "@%:@define regfree rpl_regfree" >>confdefs.h + + fi + + if test $ac_use_included_regex = yes; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS regex.$ac_objext" + + + + + + + + + ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_LIBINTL_H 1" >>confdefs.h + +fi + + + ac_fn_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_isblank" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h + + + fi + + + + + + if test $ac_cv_func_secure_getenv = no; then + HAVE_SECURE_GETENV=0 + fi + + if test $HAVE_SECURE_GETENV = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS secure_getenv.$ac_objext" + + + ac_fn_c_check_func "$LINENO" "__secure_getenv" "ac_cv_func___secure_getenv" +if test "x$ac_cv_func___secure_getenv" = xyes +then : + printf "%s\n" "@%:@define HAVE___SECURE_GETENV 1" >>confdefs.h + +fi + + if test $ac_cv_func___secure_getenv = no; then + ac_fn_c_check_func "$LINENO" "issetugid" "ac_cv_func_issetugid" +if test "x$ac_cv_func_issetugid" = xyes +then : + printf "%s\n" "@%:@define HAVE_ISSETUGID 1" >>confdefs.h + +fi + + fi + + + fi + + + + + + GNULIB_SECURE_GETENV=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SECURE_GETENV 1" >>confdefs.h + + + + + + if test $ac_cv_func_setenv = no; then + HAVE_SETENV=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5 +printf %s "checking whether setenv validates arguments... " >&6; } +if test ${gl_cv_func_setenv_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_setenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_setenv_works="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + +int +main (void) +{ + + int result = 0; + { + if (setenv ("", "", 0) != -1) + result |= 1; + else if (errno != EINVAL) + result |= 2; + } + { + if (setenv ("a", "=", 1) != 0) + result |= 4; + else if (strcmp (getenv ("a"), "=") != 0) + result |= 8; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_setenv_works=yes +else case e in @%:@( + e) gl_cv_func_setenv_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5 +printf "%s\n" "$gl_cv_func_setenv_works" >&6; } + case "$gl_cv_func_setenv_works" in + *yes) ;; + *) + REPLACE_SETENV=1 + ;; + esac + fi + + if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext" + + fi + + + + + + GNULIB_SETENV=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SETENV 1" >>confdefs.h + + + + + + + if test $ac_cv_func_sigaction = yes; then + ac_fn_c_check_member "$LINENO" "struct sigaction" "sa_sigaction" "ac_cv_member_struct_sigaction_sa_sigaction" "#include +" +if test "x$ac_cv_member_struct_sigaction_sa_sigaction" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1" >>confdefs.h + + +fi + + if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then + HAVE_STRUCT_SIGACTION_SA_SIGACTION=0 + fi + else + HAVE_SIGACTION=0 + fi + + if test $HAVE_SIGACTION = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS sigaction.$ac_objext" + + + + + + + + ac_fn_c_check_type "$LINENO" "siginfo_t" "ac_cv_type_siginfo_t" " +#include + +" +if test "x$ac_cv_type_siginfo_t" = xyes +then : + +printf "%s\n" "@%:@define HAVE_SIGINFO_T 1" >>confdefs.h + + +fi + + if test $ac_cv_type_siginfo_t = no; then + HAVE_SIGINFO_T=0 + fi + + fi + + + + + + GNULIB_SIGACTION=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SIGACTION 1" >>confdefs.h + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_signal_h='<'signal.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_signal_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'signal.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_signal_h + gl_cv_next_signal_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5 +printf "%s\n" "$gl_cv_next_signal_h" >&6; } + fi + NEXT_SIGNAL_H=$gl_cv_next_signal_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'signal.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_signal_h + fi + NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive + + + + + +# AIX declares sig_atomic_t to already include volatile, and C89 compilers +# then choke on 'volatile sig_atomic_t'. C99 requires that it compile. + ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" " +#include + +" +if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes +then : + +else case e in @%:@( + e) HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0 ;; +esac +fi + + + + + + + + ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" " +#include + +" +if test "x$ac_cv_type_sighandler_t" = xyes +then : + +else case e in @%:@( + e) HAVE_SIGHANDLER_T=0 ;; +esac +fi + + + + for gl_func in pthread_sigmask sigaction sigaddset sigdelset sigemptyset sigfillset sigismember sigpending sigprocmask; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + if test $gl_cv_type_sigset_t = yes; then + ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" +if test "x$ac_cv_func_sigprocmask" = xyes +then : + gl_cv_func_sigprocmask=1 +fi + + fi + if test -z "$gl_cv_func_sigprocmask"; then + HAVE_POSIX_SIGNALBLOCKING=0 + fi + + if test $HAVE_POSIX_SIGNALBLOCKING = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS sigprocmask.$ac_objext" + + : + fi + + + + + + GNULIB_SIGPROCMASK=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SIGPROCMASK 1" >>confdefs.h + + + + + ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_STDINT_H 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5 +printf %s "checking for SIZE_MAX... " >&6; } +if test ${gl_cv_size_max+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_cv_size_max= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_STDINT_H +#include +#endif +#ifdef SIZE_MAX +Found it +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "Found it" >/dev/null 2>&1 +then : + gl_cv_size_max=yes +fi +rm -rf conftest* + + if test -z "$gl_cv_size_max"; then + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) * CHAR_BIT - 1" "size_t_bits_minus_1" "#include +#include " +then : + +else case e in @%:@( + e) size_t_bits_minus_1= ;; +esac +fi + + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint" "#include " +then : + +else case e in @%:@( + e) fits_in_uint= ;; +esac +fi + + if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then + if test $fits_in_uint = 1; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + extern size_t foo; + extern unsigned long foo; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + fits_in_uint=0 +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $fits_in_uint = 1; then + gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" + else + gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" + fi + else + gl_cv_size_max='((size_t)~(size_t)0)' + fi + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5 +printf "%s\n" "$gl_cv_size_max" >&6; } + if test "$gl_cv_size_max" != yes; then + +printf "%s\n" "@%:@define SIZE_MAX $gl_cv_size_max" >>confdefs.h + + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 +printf %s "checking for ssize_t... " >&6; } +if test ${gt_cv_ssize_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +int x = sizeof (ssize_t *) + sizeof (ssize_t); + return !x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_ssize_t=yes +else case e in @%:@( + e) gt_cv_ssize_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5 +printf "%s\n" "$gt_cv_ssize_t" >&6; } + if test $gt_cv_ssize_t = no; then + +printf "%s\n" "@%:@define ssize_t int" >>confdefs.h + + fi + + + + + + case "$host_os" in + mingw*) + REPLACE_STAT=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5 +printf %s "checking whether stat handles trailing slashes on files... " >&6; } +if test ${gl_cv_func_stat_file_slash+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) touch conftest.tmp + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + ln -s conftest.tmp conftest.lnk + fi + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_stat_file_slash="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +int result = 0; + struct stat st; + if (!stat ("conftest.tmp/", &st)) + result |= 1; +#if HAVE_LSTAT + if (!stat ("conftest.lnk/", &st)) + result |= 2; +#endif + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_stat_file_slash=yes +else case e in @%:@( + e) gl_cv_func_stat_file_slash=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.tmp conftest.lnk ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5 +printf "%s\n" "$gl_cv_func_stat_file_slash" >&6; } + case $gl_cv_func_stat_file_slash in + *no) + REPLACE_STAT=1 + +printf "%s\n" "@%:@define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h +;; + esac + ;; + esac + + if test $REPLACE_STAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" + + + + : + + fi + + + + + + GNULIB_STAT=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STAT 1" >>confdefs.h + + + + + + + + ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1" >>confdefs.h + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5 +printf %s "checking whether struct stat.st_atim is of type struct timespec... " >&6; } +if test ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #if HAVE_SYS_TIME_H + # include + #endif + #include + struct timespec ts; + struct stat st; + +int +main (void) +{ + + st.st_atim = ts; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes +else case e in @%:@( + e) ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5 +printf "%s\n" "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; } + if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then + +printf "%s\n" "@%:@define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h + + fi +else case e in @%:@( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1" >>confdefs.h + + +else case e in @%:@( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_ATIMENSEC 1" >>confdefs.h + + +else case e in @%:@( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1" >>confdefs.h + + +fi + ;; +esac +fi + ;; +esac +fi + ;; +esac +fi + + + + + + ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1" >>confdefs.h + + +else case e in @%:@( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1" >>confdefs.h + + +else case e in @%:@( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtim.tv_nsec" "ac_cv_member_struct_stat_st_birthtim_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1" >>confdefs.h + + +fi + ;; +esac +fi + ;; +esac +fi + + + + STDARG_H='' + NEXT_STDARG_H='' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 +printf %s "checking for va_copy... " >&6; } + if test ${gl_cv_func_va_copy+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + +#ifndef va_copy +void (*func) (va_list, va_list) = va_copy; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_va_copy=yes +else case e in @%:@( + e) gl_cv_func_va_copy=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_va_copy" >&5 +printf "%s\n" "$gl_cv_func_va_copy" >&6; } + if test $gl_cv_func_va_copy = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined _AIX && !defined __GNUC__ + AIX vaccine + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "vaccine" >/dev/null 2>&1 +then : + gl_aixcc=yes +else case e in @%:@( + e) gl_aixcc=no ;; +esac +fi +rm -rf conftest* + + if test $gl_aixcc = yes; then + STDARG_H=stdarg.h + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdarg_h='<'stdarg.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_stdarg_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdarg.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdarg_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdarg_h + gl_cv_next_stdarg_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdarg_h" >&5 +printf "%s\n" "$gl_cv_next_stdarg_h" >&6; } + fi + NEXT_STDARG_H=$gl_cv_next_stdarg_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdarg.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdarg_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDARG_H=$gl_next_as_first_directive + + + + + if test "$gl_cv_next_stdarg_h" = '""'; then + gl_cv_next_stdarg_h='"///usr/include/stdarg.h"' + NEXT_STDARG_H="$gl_cv_next_stdarg_h" + fi + else + + saved_as_echo_n="$as_@&t@echo_n" + as_@&t@echo_n=':' + if test ${gl_cv_func___va_copy+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + +#ifndef __va_copy +error, bail out +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func___va_copy=yes +else case e in @%:@( + e) gl_cv_func___va_copy=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + as_@&t@echo_n="$saved_as_echo_n" + + if test $gl_cv_func___va_copy = yes; then + +printf "%s\n" "@%:@define va_copy __va_copy" >>confdefs.h + + else + + +printf "%s\n" "@%:@define va_copy gl_va_copy" >>confdefs.h + + fi + fi + fi + + if test -n "$STDARG_H"; then + GL_GENERATE_STDARG_H_TRUE= + GL_GENERATE_STDARG_H_FALSE='#' +else + GL_GENERATE_STDARG_H_TRUE='#' + GL_GENERATE_STDARG_H_FALSE= +fi + + + + + + + # Define two additional variables used in the Makefile substitution. + + if test "$ac_cv_header_stdbool_h" = yes; then + STDBOOL_H='' + else + STDBOOL_H='stdbool.h' + fi + + if test -n "$STDBOOL_H"; then + GL_GENERATE_STDBOOL_H_TRUE= + GL_GENERATE_STDBOOL_H_FALSE='#' +else + GL_GENERATE_STDBOOL_H_TRUE='#' + GL_GENERATE_STDBOOL_H_FALSE= +fi + + + if test "$ac_cv_type__Bool" = yes; then + HAVE__BOOL=1 + else + HAVE__BOOL=0 + fi + + + + + + STDDEF_H= + ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include + +" +if test "x$ac_cv_type_max_align_t" = xyes +then : + +else case e in @%:@( + e) HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h ;; +esac +fi + + if test $gt_cv_c_wchar_t = no; then + HAVE_WCHAR_T=0 + STDDEF_H=stddef.h + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 +printf %s "checking whether NULL can be used in arbitrary expressions... " >&6; } +if test ${gl_cv_decl_null_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int test[2 * (sizeof NULL == sizeof (void *)) -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_null_works=yes +else case e in @%:@( + e) gl_cv_decl_null_works=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 +printf "%s\n" "$gl_cv_decl_null_works" >&6; } + if test $gl_cv_decl_null_works = no; then + REPLACE_NULL=1 + STDDEF_H=stddef.h + fi + + if test -n "$STDDEF_H"; then + GL_GENERATE_STDDEF_H_TRUE= + GL_GENERATE_STDDEF_H_FALSE='#' +else + GL_GENERATE_STDDEF_H_TRUE='#' + GL_GENERATE_STDDEF_H_FALSE= +fi + + if test -n "$STDDEF_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stddef_h='<'stddef.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_stddef_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stddef.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stddef_h + gl_cv_next_stddef_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 +printf "%s\n" "$gl_cv_next_stddef_h" >&6; } + fi + NEXT_STDDEF_H=$gl_cv_next_stddef_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stddef.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stddef_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive + + + + + fi + + + + + printf "%s\n" "@%:@define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdio_h='<'stdio.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_stdio_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdio.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdio_h + gl_cv_next_stdio_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5 +printf "%s\n" "$gl_cv_next_stdio_h" >&6; } + fi + NEXT_STDIO_H=$gl_cv_next_stdio_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdio.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdio_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5 +printf %s "checking which flavor of printf attribute matches inttypes macros... " >&6; } +if test ${gl_cv_func_printf_attribute_flavor+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define __STDC_FORMAT_MACROS 1 + #include + #include + /* For non-mingw systems, compilation will trivially succeed. + For mingw, compilation will succeed for older mingw (system + printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */ + #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_printf_attribute_flavor=system +else case e in @%:@( + e) gl_cv_func_printf_attribute_flavor=gnu ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5 +printf "%s\n" "$gl_cv_func_printf_attribute_flavor" >&6; } + if test "$gl_cv_func_printf_attribute_flavor" = gnu; then + +printf "%s\n" "@%:@define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h + + fi + + GNULIB_FSCANF=1 + + +printf "%s\n" "@%:@define GNULIB_FSCANF 1" >>confdefs.h + + + GNULIB_SCANF=1 + + +printf "%s\n" "@%:@define GNULIB_SCANF 1" >>confdefs.h + + + GNULIB_FGETC=1 + GNULIB_GETC=1 + GNULIB_GETCHAR=1 + GNULIB_FGETS=1 + GNULIB_FREAD=1 + + + GNULIB_FPRINTF=1 + GNULIB_PRINTF=1 + GNULIB_VFPRINTF=1 + GNULIB_VPRINTF=1 + GNULIB_FPUTC=1 + GNULIB_PUTC=1 + GNULIB_PUTCHAR=1 + GNULIB_FPUTS=1 + GNULIB_PUTS=1 + GNULIB_FWRITE=1 + + + + + for gl_func in dprintf fpurge fseeko ftello getdelim getline gets pclose popen renameat snprintf tmpfile vdprintf vsnprintf; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdlib_h='<'stdlib.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_stdlib_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdlib.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdlib_h + gl_cv_next_stdlib_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5 +printf "%s\n" "$gl_cv_next_stdlib_h" >&6; } + fi + NEXT_STDLIB_H=$gl_cv_next_stdlib_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdlib.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdlib_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive + + + + + + + for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#if HAVE_SYS_LOADAVG_H +# include +#endif +#if HAVE_RANDOM_H +# include +#endif + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" +if test "x$ac_cv_func_strcasecmp" = xyes +then : + printf "%s\n" "@%:@define HAVE_STRCASECMP 1" >>confdefs.h + +fi + + if test $ac_cv_func_strcasecmp = no; then + HAVE_STRCASECMP=0 + fi + + + + ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" +if test "x$ac_cv_func_strncasecmp" = xyes +then : + printf "%s\n" "@%:@define HAVE_STRNCASECMP 1" >>confdefs.h + +fi + + if test $ac_cv_func_strncasecmp = yes; then + HAVE_STRNCASECMP=1 + else + HAVE_STRNCASECMP=0 + fi + ac_fn_check_decl "$LINENO" "strncasecmp" "ac_cv_have_decl_strncasecmp" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strncasecmp" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_STRNCASECMP $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_strncasecmp = no; then + HAVE_DECL_STRNCASECMP=0 + fi + + + if test $HAVE_STRCASECMP = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strcasecmp.$ac_objext" + + + : + + fi + if test $HAVE_STRNCASECMP = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strncasecmp.$ac_objext" + + + : + + fi + + + + + + + + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5 +printf %s "checking for working strerror function... " >&6; } +if test ${gl_cv_func_working_strerror+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_working_strerror="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_strerror="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +if (!*strerror (-2)) return 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_working_strerror=yes +else case e in @%:@( + e) gl_cv_func_working_strerror=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5 +printf "%s\n" "$gl_cv_func_working_strerror" >&6; } + case "$gl_cv_func_working_strerror" in + *yes) ;; + *) + REPLACE_STRERROR=1 + ;; + esac + + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR=1 ;; + esac + + else + REPLACE_STRERROR=1 + fi + + if test $REPLACE_STRERROR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext" + + fi + + +printf "%s\n" "@%:@define GNULIB_STRERROR 1" >>confdefs.h + + + + + + + + GNULIB_STRERROR=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STRERROR 1" >>confdefs.h + + + + + + if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext" + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + fi + + # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE. + + + + + + + +printf "%s\n" "@%:@define my_strftime nstrftime" >>confdefs.h + + + if test $gl_cond_libtool = false; then + gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV" + gl_libdeps="$gl_libdeps $LIBICONV" + fi + + + + + + + + + + + + + if test $ac_cv_have_decl_strndup = no; then + HAVE_DECL_STRNDUP=0 + fi + + if test $ac_cv_func_strndup = yes; then + HAVE_STRNDUP=1 + # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strndup" >&5 +printf %s "checking for working strndup... " >&6; } +if test ${gl_cv_func_strndup_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + + case $host_os in + aix | aix[3-6]*) gl_cv_func_strndup_works="guessing no";; + *) gl_cv_func_strndup_works="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include +int +main (void) +{ + +#if !HAVE_DECL_STRNDUP + extern + #ifdef __cplusplus + "C" + #endif + char *strndup (const char *, size_t); +#endif + int result; + char *s; + s = strndup ("some longer string", 15); + free (s); + s = strndup ("shorter string", 13); + result = s[13] != '\0'; + free (s); + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strndup_works=yes +else case e in @%:@( + e) gl_cv_func_strndup_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strndup_works" >&5 +printf "%s\n" "$gl_cv_func_strndup_works" >&6; } + case $gl_cv_func_strndup_works in + *no) REPLACE_STRNDUP=1 ;; + esac + else + HAVE_STRNDUP=0 + fi + + if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strndup.$ac_objext" + + fi + + + + + + GNULIB_STRNDUP=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STRNDUP 1" >>confdefs.h + + + + + + + + + + if test $ac_cv_have_decl_strnlen = no; then + HAVE_DECL_STRNLEN=0 + else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5 +printf %s "checking for working strnlen... " >&6; } +if test ${ac_cv_func_strnlen_working+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + # Guess no on AIX systems, yes otherwise. + case "$host_os" in + aix*) ac_cv_func_strnlen_working=no;; + *) ac_cv_func_strnlen_working=yes;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + +#define S "foobar" +#define S_LEN (sizeof S - 1) + + /* At least one implementation is buggy: that of AIX 4.3 would + give strnlen (S, 1) == 3. */ + + int i; + for (i = 0; i < S_LEN + 1; ++i) + { + int expected = i <= S_LEN ? i : S_LEN; + if (strnlen (S, i) != expected) + return 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_strnlen_working=yes +else case e in @%:@( + e) ac_cv_func_strnlen_working=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5 +printf "%s\n" "$ac_cv_func_strnlen_working" >&6; } +test $ac_cv_func_strnlen_working = no && : + + + if test $ac_cv_func_strnlen_working = no; then + REPLACE_STRNLEN=1 + fi + fi + + if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext" + + : + fi + + + + + + GNULIB_STRNLEN=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STRNLEN 1" >>confdefs.h + + + + + + + + if test $ac_cv_func_strptime != yes; then + HAVE_STRPTIME=0 + fi + + if test $HAVE_STRPTIME = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strptime.$ac_objext" + + + + : + + fi + + + + + + GNULIB_STRPTIME=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STRPTIME 1" >>confdefs.h + + + + + + + if test "$ac_cv_type_unsigned_long_long_int" = yes; then + ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull" +if test "x$ac_cv_func_strtoull" = xyes +then : + printf "%s\n" "@%:@define HAVE_STRTOULL 1" >>confdefs.h + +fi + + if test $ac_cv_func_strtoull = no; then + HAVE_STRTOULL=0 + fi + fi + + if test $HAVE_STRTOULL = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strtoull.$ac_objext" + + + : + + fi + + + + + + GNULIB_STRTOULL=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STRTOULL 1" >>confdefs.h + + + + + + + + + if test "$ac_cv_have_decl_strtoumax" = yes; then + if test "$ac_cv_func_strtoumax" != yes; then + # HP-UX 11.11 has "#define strtoimax(...) ..." but no function. + REPLACE_STRTOUMAX=1 + fi + else + HAVE_DECL_STRTOUMAX=0 + fi + + if test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strtoumax.$ac_objext" + + + ac_fn_check_decl "$LINENO" "strtoull" "ac_cv_have_decl_strtoull" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strtoull" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_STRTOULL $ac_have_decl" >>confdefs.h + + + + fi + + + + + + GNULIB_STRTOUMAX=1 + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_stat_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_stat_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/stat.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_stat_h + gl_cv_next_sys_stat_h='"'$gl_header'"' + else + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 +printf "%s\n" "$gl_cv_next_sys_stat_h" >&6; } + fi + NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/stat.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_stat_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive + + + + + + + + + WINDOWS_STAT_TIMESPEC=0 + + + + + + + + + ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include + #include +" +if test "x$ac_cv_type_nlink_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define nlink_t int" >>confdefs.h + ;; +esac +fi + + + + for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_wait_h='<'sys/wait.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_wait_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_wait_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/wait.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_wait_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_wait_h + gl_cv_next_sys_wait_h='"'$gl_header'"' + else + gl_cv_next_sys_wait_h='<'sys/wait.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_wait_h" >&5 +printf "%s\n" "$gl_cv_next_sys_wait_h" >&6; } + fi + NEXT_SYS_WAIT_H=$gl_cv_next_sys_wait_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/wait.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_wait_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H=$gl_next_as_first_directive + + + + + + + + + for gl_func in waitpid; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + : + + + + + + + + + + + + ac_fn_check_decl "$LINENO" "localtime_r" "ac_cv_have_decl_localtime_r" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_localtime_r" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_LOCALTIME_R $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_localtime_r = no; then + HAVE_DECL_LOCALTIME_R=0 + fi + + + if test $ac_cv_func_localtime_r = yes; then + HAVE_LOCALTIME_R=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5 +printf %s "checking whether localtime_r is compatible with its POSIX signature... " >&6; } +if test ${gl_cv_time_r_posix+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +/* We don't need to append 'restrict's to the argument types, + even though the POSIX signature has the 'restrict's, + since C99 says they can't affect type compatibility. */ + struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r; + if (ptr) return 0; + /* Check the return type is a pointer. + On HP-UX 10 it is 'int'. */ + *localtime_r (0, 0); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_time_r_posix=yes +else case e in @%:@( + e) gl_cv_time_r_posix=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5 +printf "%s\n" "$gl_cv_time_r_posix" >&6; } + if test $gl_cv_time_r_posix = yes; then + REPLACE_LOCALTIME_R=0 + else + REPLACE_LOCALTIME_R=1 + fi + else + HAVE_LOCALTIME_R=0 + fi + + if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext" + + + : + + fi + + + + + + GNULIB_TIME_R=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_TIME_R 1" >>confdefs.h + + + + + + + + + ac_fn_c_check_type "$LINENO" "timezone_t" "ac_cv_type_timezone_t" "#include +" +if test "x$ac_cv_type_timezone_t" = xyes +then : + +printf "%s\n" "@%:@define HAVE_TIMEZONE_T 1" >>confdefs.h + + +fi + + if test "$ac_cv_type_timezone_t" = yes; then + HAVE_TIMEZONE_T=1 + fi + + if test $HAVE_TIMEZONE_T = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS time_rz.$ac_objext" + + fi + + + + + + GNULIB_TIME_RZ=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_TIME_RZ 1" >>confdefs.h + + + + + + + REPLACE_TIMEGM=0 + + if test $ac_cv_func_timegm = yes; then + if test "$gl_cv_func_working_mktime" != yes; then + # Assume that timegm is buggy if mktime is. + REPLACE_TIMEGM=1 + fi + else + HAVE_TIMEGM=0 + fi + + if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS timegm.$ac_objext" + + + : + + fi + + + + + + GNULIB_TIMEGM=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_TIMEGM 1" >>confdefs.h + + + + : + + + + + + if test $ac_cv_func_tzset = no; then + HAVE_TZSET=0 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether tzset clobbers localtime buffer" >&5 +printf %s "checking whether tzset clobbers localtime buffer... " >&6; } +if test ${gl_cv_func_tzset_clobber+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess all is fine on glibc systems. + *-gnu*) gl_cv_func_tzset_clobber="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_tzset_clobber="guessing yes" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main () +{ + time_t t1 = 853958121; + struct tm *p, s; + putenv ("TZ=GMT0"); + p = localtime (&t1); + s = *p; + putenv ("TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"); + tzset (); + return (p->tm_year != s.tm_year + || p->tm_mon != s.tm_mon + || p->tm_mday != s.tm_mday + || p->tm_hour != s.tm_hour + || p->tm_min != s.tm_min + || p->tm_sec != s.tm_sec); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_tzset_clobber=no +else case e in @%:@( + e) gl_cv_func_tzset_clobber=yes ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_tzset_clobber" >&5 +printf "%s\n" "$gl_cv_func_tzset_clobber" >&6; } + + +printf "%s\n" "@%:@define HAVE_RUN_TZSET_TEST 1" >>confdefs.h + + + REPLACE_TZSET=0 + case "$gl_cv_func_tzset_clobber" in + *yes) + REPLACE_TZSET=1 + +printf "%s\n" "@%:@define TZSET_CLOBBERS_LOCALTIME 1" >>confdefs.h + + + + + NEED_LOCALTIME_BUFFER=1 + REPLACE_GMTIME=1 + REPLACE_LOCALTIME=1 + + ;; + esac + case "$host_os" in + mingw*) REPLACE_TZSET=1 ;; + esac + + if test $HAVE_TZSET = 0 || test $REPLACE_TZSET = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS tzset.$ac_objext" + + fi + + + + + + GNULIB_TZSET=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_TZSET 1" >>confdefs.h + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_unistd_h='<'unistd.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_unistd_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_unistd_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'unistd.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_unistd_h + gl_cv_next_unistd_h='"'$gl_header'"' + else + gl_cv_next_unistd_h='<'unistd.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5 +printf "%s\n" "$gl_cv_next_unistd_h" >&6; } + fi + NEXT_UNISTD_H=$gl_cv_next_unistd_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'unistd.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_unistd_h + fi + NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_unistd_h = yes; then + HAVE_UNISTD_H=1 + else + HAVE_UNISTD_H=0 + fi + + + + + + + + for gl_func in chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell endusershell group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite readlink readlinkat rmdir sethostname sleep symlink symlinkat truncate ttyname_r unlink unlinkat usleep; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if HAVE_UNISTD_H +# include +#endif +/* Some systems declare various items in the wrong headers. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include +# endif +#endif + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 + } + } + } + + + + + } + }; then + LIBUNISTRING_UNISTR_H='unistr.h' + else + LIBUNISTRING_UNISTR_H= + fi + + + + +printf "%s\n" "@%:@define GNULIB_UNISTR_U8_MBTOUCR 1" >>confdefs.h + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE= + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE='#' +else + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE='#' + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE= +fi + + + + +printf "%s\n" "@%:@define GNULIB_UNISTR_U8_UCTOMB 1" >>confdefs.h + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE= + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE='#' +else + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE='#' + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE= +fi + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 + } + } + } + + + + + } + }; then + LIBUNISTRING_UNITYPES_H='unitypes.h' + else + LIBUNISTRING_UNITYPES_H= + fi + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 + } + } + } + + + + + } + }; then + LIBUNISTRING_UNIWIDTH_H='uniwidth.h' + else + LIBUNISTRING_UNIWIDTH_H= + fi + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 6 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE= + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE='#' +else + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE='#' + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE= +fi + + + + +printf "%s\n" "@%:@define USE_UNLOCKED_IO 1" >>confdefs.h + + + + + + + + + + + + + + + + + + + + + + if test $ac_cv_have_decl_unsetenv = no; then + HAVE_DECL_UNSETENV=0 + fi + ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv" +if test "x$ac_cv_func_unsetenv" = xyes +then : + printf "%s\n" "@%:@define HAVE_UNSETENV 1" >>confdefs.h + +fi + + if test $ac_cv_func_unsetenv = no; then + HAVE_UNSETENV=0 + else + HAVE_UNSETENV=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5 +printf %s "checking for unsetenv() return type... " >&6; } +if test ${gt_cv_func_unsetenv_ret+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#undef _BSD +#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 */ +#include +extern +#ifdef __cplusplus +"C" +#endif +int unsetenv (const char *name); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_func_unsetenv_ret='int' +else case e in @%:@( + e) gt_cv_func_unsetenv_ret='void' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5 +printf "%s\n" "$gt_cv_func_unsetenv_ret" >&6; } + if test $gt_cv_func_unsetenv_ret = 'void'; then + +printf "%s\n" "@%:@define VOID_UNSETENV 1" >>confdefs.h + + REPLACE_UNSETENV=1 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5 +printf %s "checking whether unsetenv obeys POSIX... " >&6; } +if test ${gl_cv_func_unsetenv_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_unsetenv_works="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + extern char **environ; + +int +main (void) +{ + + char entry1[] = "a=1"; + char entry2[] = "b=2"; + char *env[] = { entry1, entry2, NULL }; + if (putenv ((char *) "a=1")) return 1; + if (putenv (entry2)) return 2; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 3; + if (!unsetenv ("") || errno != EINVAL) return 4; + entry2[0] = 'b'; + environ = env; + if (!getenv ("a")) return 5; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 6; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_unsetenv_works=yes +else case e in @%:@( + e) gl_cv_func_unsetenv_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5 +printf "%s\n" "$gl_cv_func_unsetenv_works" >&6; } + case "$gl_cv_func_unsetenv_works" in + *yes) ;; + *) + REPLACE_UNSETENV=1 + ;; + esac + fi + + if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext" + + + + + + fi + + + + + + GNULIB_UNSETENV=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_UNSETENV 1" >>confdefs.h + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for variable-length arrays" >&5 +printf %s "checking for variable-length arrays... " >&6; } +if test ${ac_cv_c_vararrays+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC_NO_VLA__ + defined + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "defined" >/dev/null 2>&1 +then : + ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined' +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test for VLA support. This test is partly inspired + from examples in the C standard. Use at least two VLA + functions to detect the GCC 3.4.3 bug described in: + http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html + */ + #ifdef __STDC_NO_VLA__ + syntax error; + #else + extern int n; + int B[100]; + int fvla (int m, int C[m][m]); + + int + simple (int count, int all[static count]) + { + return all[count - 1]; + } + + int + fvla (int m, int C[m][m]) + { + typedef int VLA[m][m]; + VLA x; + int D[m]; + static int (*q)[m] = &B; + int (*s)[n] = q; + return C && &x[0][0] == &D[0] && &D[0] == s[0]; + } + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_vararrays=yes +else case e in @%:@( + e) ac_cv_c_vararrays=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -rf conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_vararrays" >&5 +printf "%s\n" "$ac_cv_c_vararrays" >&6; } + if test "$ac_cv_c_vararrays" = yes; then + +printf "%s\n" "@%:@define HAVE_C_VARARRAYS 1" >>confdefs.h + + elif test "$ac_cv_c_vararrays" = no; then + +printf "%s\n" "@%:@define __STDC_NO_VLA__ 1" >>confdefs.h + + fi + + + + if test $ac_cv_func_vasnprintf = no; then + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + + if test $ac_cv_func_vasnprintf = yes; then + +printf "%s\n" "@%:@define REPLACE_VASNPRINTF 1" >>confdefs.h + + fi + + + + + + + + + + + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes +then : + +else case e in @%:@( + e) +printf "%s\n" "@%:@define ptrdiff_t long" >>confdefs.h + + ;; +esac +fi + + + + + + + + fi + + + ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf" +if test "x$ac_cv_func_vasprintf" = xyes +then : + printf "%s\n" "@%:@define HAVE_VASPRINTF 1" >>confdefs.h + +fi + + if test $ac_cv_func_vasprintf = no; then + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asprintf.$ac_objext" + + + if test $ac_cv_func_vasprintf = yes; then + REPLACE_VASPRINTF=1 + else + HAVE_VASPRINTF=0 + fi + + + + + + + + + fi + + + + + + + GNULIB_VASPRINTF=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_VASPRINTF 1" >>confdefs.h + + + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=asprintf:2:c-format" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=vasprintf:2:c-format" + + +@%:@ Check whether --with-packager was given. +if test ${with_packager+y} +then : + withval=$with_packager; case $withval in + yes|no) ;; + *) +printf "%s\n" "@%:@define PACKAGE_PACKAGER \"$withval\"" >>confdefs.h + ;; + esac + +fi + + + +@%:@ Check whether --with-packager-version was given. +if test ${with_packager_version+y} +then : + withval=$with_packager_version; case $withval in + yes|no) ;; + *) +printf "%s\n" "@%:@define PACKAGE_PACKAGER_VERSION \"$withval\"" >>confdefs.h + ;; + esac + +fi + + + +@%:@ Check whether --with-packager-bug-reports was given. +if test ${with_packager_bug_reports+y} +then : + withval=$with_packager_bug_reports; case $withval in + yes|no) ;; + *) +printf "%s\n" "@%:@define PACKAGE_PACKAGER_BUG_REPORTS \"$withval\"" >>confdefs.h + ;; + esac + +fi + + + if test "X$with_packager" = "X" && \ + test "X$with_packager_version$with_packager_bug_reports" != "X" + then + as_fn_error $? "The --with-packager-{bug-reports,version} options require --with-packager" "$LINENO" 5 + fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wchar_h='<'wchar.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_wchar_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_wchar_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wchar.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wchar_h + gl_cv_next_wchar_h='"'$gl_header'"' + else + gl_cv_next_wchar_h='<'wchar.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5 +printf "%s\n" "$gl_cv_next_wchar_h" >&6; } + fi + NEXT_WCHAR_H=$gl_cv_next_wchar_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'wchar.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_wchar_h + fi + NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + + + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + + + + for gl_func in btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime ; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +#endif +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_incomplete_state=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else case e in @%:@( + e) gl_cv_func_mbrtowc_sanitycheck=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_wcrtomb = no; then + HAVE_WCRTOMB=0 + ac_fn_check_decl "$LINENO" "wcrtomb" "ac_cv_have_decl_wcrtomb" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_wcrtomb" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_WCRTOMB $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_wcrtomb = yes; then + REPLACE_WCRTOMB=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_WCRTOMB=1 + else + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wcrtomb return value is correct" >&5 +printf %s "checking whether wcrtomb return value is correct... " >&6; } +if test ${gl_cv_func_wcrtomb_retval+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on AIX 4, OSF/1 and Solaris. + aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wcrtomb_retval="guessing yes" ;; + esac + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + int result = 0; + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 1; + } + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 2; + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 4; + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 8; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_wcrtomb_retval=yes +else case e in @%:@( + e) gl_cv_func_wcrtomb_retval=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcrtomb_retval" >&5 +printf "%s\n" "$gl_cv_func_wcrtomb_retval" >&6; } + case "$gl_cv_func_wcrtomb_retval" in + *yes) ;; + *) REPLACE_WCRTOMB=1 ;; + esac + fi + fi + + if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS wcrtomb.$ac_objext" + + + : + + fi + + + + + + GNULIB_WCRTOMB=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_WCRTOMB 1" >>confdefs.h + + + + + + + + + if test $ac_cv_func_iswcntrl = yes; then + HAVE_ISWCNTRL=1 + else + HAVE_ISWCNTRL=0 + fi + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wctype_h='<'wctype.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_wctype_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_wctype_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wctype_h + gl_cv_next_wctype_h='"'$gl_header'"' + else + gl_cv_next_wctype_h='<'wctype.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 +printf "%s\n" "$gl_cv_next_wctype_h" >&6; } + fi + NEXT_WCTYPE_H=$gl_cv_next_wctype_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'wctype.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_wctype_h + fi + NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_wctype_h = yes; then + if test $ac_cv_func_iswcntrl = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 +printf %s "checking whether iswcntrl works... " >&6; } +if test ${gl_cv_func_iswcntrl_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #if __GNU_LIBRARY__ == 1 + Linux libc5 i18n is broken. + #endif +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_iswcntrl_works="guessing yes" +else case e in @%:@( + e) gl_cv_func_iswcntrl_works="guessing no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + int main () { return iswprint ('x') == 0; } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_iswcntrl_works=yes +else case e in @%:@( + e) gl_cv_func_iswcntrl_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 +printf "%s\n" "$gl_cv_func_iswcntrl_works" >&6; } + fi + HAVE_WCTYPE_H=1 + else + HAVE_WCTYPE_H=0 + fi + + + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + fi + + if test $REPLACE_ISWCNTRL = 1; then + REPLACE_TOWLOWER=1 + else + ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" +if test "x$ac_cv_func_towlower" = xyes +then : + printf "%s\n" "@%:@define HAVE_TOWLOWER 1" >>confdefs.h + +fi + + if test $ac_cv_func_towlower = yes; then + REPLACE_TOWLOWER=0 + else + ac_fn_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_towlower" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_TOWLOWER $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_towlower = yes; then + REPLACE_TOWLOWER=1 + else + REPLACE_TOWLOWER=0 + fi + fi + fi + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then + : + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 +printf %s "checking for wctype_t... " >&6; } +if test ${gl_cv_type_wctype_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + wctype_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctype_t=yes +else case e in @%:@( + e) gl_cv_type_wctype_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 +printf "%s\n" "$gl_cv_type_wctype_t" >&6; } + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 +printf %s "checking for wctrans_t... " >&6; } +if test ${gl_cv_type_wctrans_t+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + wctrans_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctrans_t=yes +else case e in @%:@( + e) gl_cv_type_wctrans_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 +printf "%s\n" "$gl_cv_type_wctrans_t" >&6; } + if test $gl_cv_type_wctrans_t = no; then + HAVE_WCTRANS_T=0 + fi + + + for gl_func in wctype iswctype wctrans towctrans ; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +# include +#endif +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + ac_fn_check_decl "$LINENO" "wcwidth" "ac_cv_have_decl_wcwidth" " +/* AIX 3.2.5 declares wcwidth in . */ +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_wcwidth" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_WCWIDTH $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_wcwidth != yes; then + HAVE_DECL_WCWIDTH=0 + fi + + if test $ac_cv_func_wcwidth = yes; then + HAVE_WCWIDTH=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wcwidth works reasonably in UTF-8 locales" >&5 +printf %s "checking whether wcwidth works reasonably in UTF-8 locales... " >&6; } +if test ${gl_cv_func_wcwidth_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc and AIX 7 systems. + *-gnu* | aix[7-9]*) gl_cv_func_wcwidth_works="guessing yes";; + *) gl_cv_func_wcwidth_works="guessing no";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +/* AIX 3.2.5 declares wcwidth in . */ +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include +#if !HAVE_DECL_WCWIDTH +extern +# ifdef __cplusplus +"C" +# endif +int wcwidth (int); +#endif +int main () +{ + int result = 0; + if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL) + { + if (wcwidth (0x0301) > 0) + result |= 1; + if (wcwidth (0x05B0) > 0) + result |= 2; + if (wcwidth (0x200B) > 0) + result |= 4; + if (wcwidth (0xFF1A) == 0) + result |= 8; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_wcwidth_works=yes +else case e in @%:@( + e) gl_cv_func_wcwidth_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcwidth_works" >&5 +printf "%s\n" "$gl_cv_func_wcwidth_works" >&6; } + case "$gl_cv_func_wcwidth_works" in + *yes) ;; + *no) REPLACE_WCWIDTH=1 ;; + esac + else + HAVE_WCWIDTH=0 + fi + + if test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS wcwidth.$ac_objext" + + fi + + + + + + GNULIB_WCWIDTH=1 + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_WCWIDTH 1" >>confdefs.h + + + + : + + + ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_STDINT_H 1" >>confdefs.h + +fi + + + + + : + + + + : + + : + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xasprintf:1:c-format" + + # End of code from modules + + + + + + + + + + gltests_libdeps= + gltests_ltlibdeps= + + + + + + + + + + gl_source_base='gnulib-tests' + gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS + + gl_module_indicator_condition=$gltests_WITNESS + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS accept.$ac_objext" + + fi + + + + + + if test "$GNULIB_ACCEPT" != 1; then + if test "$GNULIB_ACCEPT" = 0; then + GNULIB_ACCEPT=$gl_module_indicator_condition + else + GNULIB_ACCEPT="($GNULIB_ACCEPT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_ACCEPT 1" >>confdefs.h + + + + + + + + if test $ac_cv_header_arpa_inet_h = yes; then + HAVE_ARPA_INET_H=1 + else + HAVE_ARPA_INET_H=0 + fi + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_arpa_inet_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_arpa_inet_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'arpa/inet.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_arpa_inet_h + gl_cv_next_arpa_inet_h='"'$gl_header'"' + else + gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5 +printf "%s\n" "$gl_cv_next_arpa_inet_h" >&6; } + fi + NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'arpa/inet.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_arpa_inet_h + fi + NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive + + + + + + + + + for gl_func in inet_ntop inet_pton; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* On some systems, this header is not self-consistent. */ +#if !(defined __GLIBC__ || defined __UCLIBC__) +# include +#endif +#ifdef __TANDEM +# include +#endif +#include + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS bind.$ac_objext" + + fi + + + + + + if test "$GNULIB_BIND" != 1; then + if test "$GNULIB_BIND" = 0; then + GNULIB_BIND=$gl_module_indicator_condition + else + GNULIB_BIND="($GNULIB_BIND || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_BIND 1" >>confdefs.h + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5 +printf %s "checking for a turkish Unicode locale... " >&6; } +if test ${gt_cv_locale_tr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. But BeOS does not + implement the Turkish upper-/lowercase mappings. Therefore, let this + program return 1 on BeOS. */ + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the eighth month, the second + character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f) + return 1; + /* Check whether the upper-/lowercase mappings are as expected for + Turkish. */ + if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i' + || towupper(0x0131) != 'I' || towlower ('I') != 0x0131) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=Turkish_Turkey.65001 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr.UTF-8 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + fi + fi + ;; + esac + else + gt_cv_locale_tr_utf8=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_tr_utf8" >&6; } + LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8 + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS connect.$ac_objext" + + fi + + + + + + if test "$GNULIB_CONNECT" != 1; then + if test "$GNULIB_CONNECT" = 0; then + GNULIB_CONNECT=$gl_module_indicator_condition + else + GNULIB_CONNECT="($GNULIB_CONNECT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_CONNECT 1" >>confdefs.h + + + + + + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_FDOPEN=1 + fi + + if test $REPLACE_FDOPEN = 0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fdopen sets errno" >&5 +printf %s "checking whether fdopen sets errno... " >&6; } +if test ${gl_cv_func_fdopen_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + case "$host_os" in + mingw*) gl_cv_func_fdopen_works="guessing no" ;; + *) gl_cv_func_fdopen_works="guessing yes" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +int +main (void) +{ + FILE *fp; + errno = 0; + fp = fdopen (-1, "r"); + if (fp == NULL && errno == 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_fdopen_works=yes +else case e in @%:@( + e) gl_cv_func_fdopen_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopen_works" >&5 +printf "%s\n" "$gl_cv_func_fdopen_works" >&6; } + case "$gl_cv_func_fdopen_works" in + *no) REPLACE_FDOPEN=1 ;; + esac + fi + + if test $REPLACE_FDOPEN = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS fdopen.$ac_objext" + + + fi + + + + + + if test "$GNULIB_FDOPEN" != 1; then + if test "$GNULIB_FDOPEN" = 0; then + GNULIB_FDOPEN=$gl_module_indicator_condition + else + GNULIB_FDOPEN="($GNULIB_FDOPEN || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_FDOPEN 1" >>confdefs.h + + + + + + + if test $ac_cv_func_ftruncate = yes; then + + + case "$host_os" in + mingw*) + REPLACE_FTRUNCATE=1 + ;; + esac + + else + HAVE_FTRUNCATE=0 + fi + + if test $HAVE_FTRUNCATE = 0 || test $REPLACE_FTRUNCATE = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS ftruncate.$ac_objext" + + + ac_fn_c_check_func "$LINENO" "chsize" "ac_cv_func_chsize" +if test "x$ac_cv_func_chsize" = xyes +then : + printf "%s\n" "@%:@define HAVE_CHSIZE 1" >>confdefs.h + +fi + + + fi + + + + + + if test "$GNULIB_FTRUNCATE" != 1; then + if test "$GNULIB_FTRUNCATE" = 0; then + GNULIB_FTRUNCATE=$gl_module_indicator_condition + else + GNULIB_FTRUNCATE="($GNULIB_FTRUNCATE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_FTRUNCATE 1" >>confdefs.h + + + + + + + + + case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in + *yes,yes) ;; + *) + REPLACE_GETCWD=1 + ;; + esac + + if test $REPLACE_GETCWD = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS getcwd-lgpl.$ac_objext" + + fi + + + + + + if test "$GNULIB_GETCWD" != 1; then + if test "$GNULIB_GETCWD" = 0; then + GNULIB_GETCWD=$gl_module_indicator_condition + else + GNULIB_GETCWD="($GNULIB_GETCWD || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_GETCWD 1" >>confdefs.h + + + + + + + ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = xyes +then : + printf "%s\n" "@%:@define HAVE_GETPAGESIZE 1" >>confdefs.h + +fi + + if test $ac_cv_func_getpagesize = no; then + HAVE_GETPAGESIZE=0 + ac_fn_c_check_header_compile "$LINENO" "OS.h" "ac_cv_header_OS_h" "$ac_includes_default" +if test "x$ac_cv_header_OS_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_OS_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_OS_h = yes; then + HAVE_OS_H=1 + fi + ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_SYS_PARAM_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_sys_param_h = yes; then + HAVE_SYS_PARAM_H=1 + fi + fi + case "$host_os" in + mingw*) + REPLACE_GETPAGESIZE=1 + ;; + esac + ac_fn_check_decl "$LINENO" "getpagesize" "ac_cv_have_decl_getpagesize" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getpagesize" = xyes +then : + +else case e in @%:@( + e) HAVE_DECL_GETPAGESIZE=0 ;; +esac +fi + + if test $REPLACE_GETPAGESIZE = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS getpagesize.$ac_objext" + + fi + + + + + + if test "$GNULIB_GETPAGESIZE" != 1; then + if test "$GNULIB_GETPAGESIZE" = 0; then + GNULIB_GETPAGESIZE=$gl_module_indicator_condition + else + GNULIB_GETPAGESIZE="($GNULIB_GETPAGESIZE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_GETPAGESIZE 1" >>confdefs.h + + + + + + + + + + + HAVE_INET_PTON=1 + INET_PTON_LIB= + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + if test $HAVE_WINSOCK2_H = 1; then + ac_fn_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_inet_pton" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_INET_PTON $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_inet_pton = yes; then + REPLACE_INET_PTON=1 + INET_PTON_LIB="-lws2_32" + else + HAVE_DECL_INET_PTON=0 + HAVE_INET_PTON=0 + fi + else + gl_save_LIBS=$LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing inet_pton" >&5 +printf %s "checking for library containing inet_pton... " >&6; } +if test ${ac_cv_search_inet_pton+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char inet_pton (void); +int +main (void) +{ +return inet_pton (); + ; + return 0; +} +_ACEOF +for ac_lib in '' nsl resolv +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_inet_pton=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_inet_pton+y} +then : + break +fi +done +if test ${ac_cv_search_inet_pton+y} +then : + +else case e in @%:@( + e) ac_cv_search_inet_pton=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_pton" >&5 +printf "%s\n" "$ac_cv_search_inet_pton" >&6; } +ac_res=$ac_cv_search_inet_pton +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else case e in @%:@( + e) ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton" +if test "x$ac_cv_func_inet_pton" = xyes +then : + printf "%s\n" "@%:@define HAVE_INET_PTON 1" >>confdefs.h + +fi + + if test $ac_cv_func_inet_pton = no; then + HAVE_INET_PTON=0 + fi + ;; +esac +fi + + LIBS=$gl_save_LIBS + + if test "$ac_cv_search_inet_pton" != "no" \ + && test "$ac_cv_search_inet_pton" != "none required"; then + INET_PTON_LIB="$ac_cv_search_inet_pton" + fi + + + ac_fn_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include + #if HAVE_NETDB_H + # include + #endif + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_inet_pton" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_INET_PTON $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_inet_pton = no; then + HAVE_DECL_INET_PTON=0 + fi + fi + + + if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS inet_pton.$ac_objext" + + + + + fi + + + + + + if test "$GNULIB_INET_PTON" != 1; then + if test "$GNULIB_INET_PTON" = 0; then + GNULIB_INET_PTON=$gl_module_indicator_condition + else + GNULIB_INET_PTON="($GNULIB_INET_PTON || $gl_module_indicator_condition)" + fi + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in @%:@( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in @%:@( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes +then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +unsigned short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + unsigned short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + unsigned short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + unsigned short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else case e in @%:@( + e) ac_cv_c_bigendian=yes ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + printf "%s\n" "@%:@define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +printf "%s\n" "@%:@define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + + + + HAVE_IOCTL=1 + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_IOCTL=0 + else + ac_fn_c_check_func "$LINENO" "ioctl" "ac_cv_func_ioctl" +if test "x$ac_cv_func_ioctl" = xyes +then : + printf "%s\n" "@%:@define HAVE_IOCTL 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ioctl with POSIX signature" >&5 +printf %s "checking for ioctl with POSIX signature... " >&6; } +if test ${gl_cv_func_ioctl_posix_signature+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +extern + #ifdef __cplusplus + "C" + #endif + int ioctl (int, int, ...); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_ioctl_posix_signature=yes +else case e in @%:@( + e) gl_cv_func_ioctl_posix_signature=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ioctl_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_ioctl_posix_signature" >&6; } + if test $gl_cv_func_ioctl_posix_signature != yes; then + REPLACE_IOCTL=1 + fi + fi + + if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS ioctl.$ac_objext" + + fi + + + + + + if test "$GNULIB_IOCTL" != 1; then + if test "$GNULIB_IOCTL" = 0; then + GNULIB_IOCTL=$gl_module_indicator_condition + else + GNULIB_IOCTL="($GNULIB_IOCTL || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_IOCTL 1" >>confdefs.h + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS listen.$ac_objext" + + fi + + + + + + if test "$GNULIB_LISTEN" != 1; then + if test "$GNULIB_LISTEN" = 0; then + GNULIB_LISTEN=$gl_module_indicator_condition + else + GNULIB_LISTEN="($GNULIB_LISTEN || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_LISTEN 1" >>confdefs.h + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5 +printf %s "checking for a turkish Unicode locale... " >&6; } +if test ${gt_cv_locale_tr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. But BeOS does not + implement the Turkish upper-/lowercase mappings. Therefore, let this + program return 1 on BeOS. */ + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the eighth month, the second + character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f) + return 1; + /* Check whether the upper-/lowercase mappings are as expected for + Turkish. */ + if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i' + || towupper(0x0131) != 'I' || towlower ('I') != 0x0131) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=Turkish_Turkey.65001 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr.UTF-8 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + fi + fi + ;; + esac + else + gt_cv_locale_tr_utf8=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_tr_utf8" >&6; } + LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8 + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in @%:@( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "@%:@define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "@%:@define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + + + + + + nanosleep_save_libs=$LIBS + + # Solaris 2.5.1 needs -lposix4 to get the nanosleep function. + # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. + LIB_NANOSLEEP= + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5 +printf %s "checking for library containing nanosleep... " >&6; } +if test ${ac_cv_search_nanosleep+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char nanosleep (void); +int +main (void) +{ +return nanosleep (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt posix4 +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_nanosleep=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_nanosleep+y} +then : + break +fi +done +if test ${ac_cv_search_nanosleep+y} +then : + +else case e in @%:@( + e) ac_cv_search_nanosleep=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5 +printf "%s\n" "$ac_cv_search_nanosleep" >&6; } +ac_res=$ac_cv_search_nanosleep +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ac_cv_search_nanosleep" = "none required" || + LIB_NANOSLEEP=$ac_cv_search_nanosleep +fi + + if test "x$ac_cv_search_nanosleep" != xno; then + + + if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple Mac OS X platforms. + # The test result would be 'no (mishandles large arguments)' in 64-bit + # mode but 'yes' in 32-bit mode. But we need a configuration result that + # is valid in both modes. + gl_cv_func_nanosleep='no (mishandles large arguments)' + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working nanosleep" >&5 +printf %s "checking for working nanosleep... " >&6; } +if test ${gl_cv_func_nanosleep+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + case "$host_os" in linux*) # Guess it halfway works when the kernel is Linux. + gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;; + *) # If we don't know, assume the worst. + gl_cv_func_nanosleep='guessing no' ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + #if HAVE_SYS_TIME_H + #include + #endif + #include + #include + #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) + #define TYPE_MAXIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) + + static void + check_for_SIGALRM (int sig) + { + if (sig != SIGALRM) + _exit (1); + } + + int + main () + { + static struct timespec ts_sleep; + static struct timespec ts_remaining; + static struct sigaction act; + /* Test for major problems first. */ + if (! nanosleep) + return 2; + act.sa_handler = check_for_SIGALRM; + sigemptyset (&act.sa_mask); + sigaction (SIGALRM, &act, NULL); + ts_sleep.tv_sec = 0; + ts_sleep.tv_nsec = 1; + alarm (1); + if (nanosleep (&ts_sleep, NULL) != 0) + return 3; + /* Test for a minor problem: the handling of large arguments. */ + ts_sleep.tv_sec = TYPE_MAXIMUM (time_t); + ts_sleep.tv_nsec = 999999999; + alarm (1); + if (nanosleep (&ts_sleep, &ts_remaining) != -1) + return 4; + if (errno != EINTR) + return 5; + if (ts_remaining.tv_sec <= TYPE_MAXIMUM (time_t) - 10) + return 6; + return 0; + } +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_nanosleep=yes +else case e in @%:@( + e) case $? in 4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)';; *) gl_cv_func_nanosleep=no;; + esac ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nanosleep" >&5 +printf "%s\n" "$gl_cv_func_nanosleep" >&6; } + case "$gl_cv_func_nanosleep" in + *yes) + REPLACE_NANOSLEEP=0 + ;; + *) + REPLACE_NANOSLEEP=1 + case "$gl_cv_func_nanosleep" in + *"mishandles large arguments"*) + +printf "%s\n" "@%:@define HAVE_BUG_BIG_NANOSLEEP 1" >>confdefs.h + + ;; + *) + # The replacement uses select(). Add $LIBSOCKET to $LIB_NANOSLEEP. + for ac_lib in $LIBSOCKET; do + case " $LIB_NANOSLEEP " in + *" $ac_lib "*) ;; + *) LIB_NANOSLEEP="$LIB_NANOSLEEP $ac_lib";; + esac + done + ;; + esac + ;; + esac + else + HAVE_NANOSLEEP=0 + fi + LIBS=$nanosleep_save_libs + + if test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS nanosleep.$ac_objext" + + + + : + + fi + + + + + + if test "$GNULIB_NANOSLEEP" != 1; then + if test "$GNULIB_NANOSLEEP" = 0; then + GNULIB_NANOSLEEP=$gl_module_indicator_condition + else + GNULIB_NANOSLEEP="($GNULIB_NANOSLEEP || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_NANOSLEEP 1" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether is self-contained" >&5 +printf %s "checking whether is self-contained... " >&6; } +if test ${gl_cv_header_netinet_in_h_selfcontained+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_netinet_in_h_selfcontained=yes +else case e in @%:@( + e) gl_cv_header_netinet_in_h_selfcontained=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5 +printf "%s\n" "$gl_cv_header_netinet_in_h_selfcontained" >&6; } + if test $gl_cv_header_netinet_in_h_selfcontained = yes; then + NETINET_IN_H='' + else + NETINET_IN_H='netinet/in.h' + ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "@%:@define HAVE_NETINET_IN_H 1" >>confdefs.h + +fi + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_netinet_in_h='<'netinet/in.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_netinet_in_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_netinet_in_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'netinet/in.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_netinet_in_h + gl_cv_next_netinet_in_h='"'$gl_header'"' + else + gl_cv_next_netinet_in_h='<'netinet/in.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5 +printf "%s\n" "$gl_cv_next_netinet_in_h" >&6; } + fi + NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'netinet/in.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_netinet_in_h + fi + NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_netinet_in_h = yes; then + HAVE_NETINET_IN_H=1 + else + HAVE_NETINET_IN_H=0 + fi + + fi + + if test -n "$NETINET_IN_H"; then + GL_GENERATE_NETINET_IN_H_TRUE= + GL_GENERATE_NETINET_IN_H_FALSE='#' +else + GL_GENERATE_NETINET_IN_H_TRUE='#' + GL_GENERATE_NETINET_IN_H_FALSE= +fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + + + if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then + REPLACE_PERROR=1 + fi + case ${gl_cv_func_strerror_r_works-unset} in + unset|*yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether perror matches strerror" >&5 +printf %s "checking whether perror matches strerror... " >&6; } +if test ${gl_cv_func_perror_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_perror_works="guessing no" + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + #include + +int +main (void) +{ +char *str = strerror (-1); + if (!getenv("CONFTEST_OUTPUT")) return 0; + if (!str) str = ""; + puts (str); + errno = -1; + perror (""); + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + if CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2 \ + && cmp conftest.txt1 conftest.txt2 >/dev/null; then + gl_cv_func_perror_works=yes + else + gl_cv_func_perror_works=no + fi + rm -rf conftest.txt1 conftest.txt2 +else case e in @%:@( + e) gl_cv_func_perror_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_perror_works" >&5 +printf "%s\n" "$gl_cv_func_perror_works" >&6; } + if test "$gl_cv_func_perror_works" != yes; then + REPLACE_PERROR=1 + fi + ;; + *) + REPLACE_PERROR=1 + ;; + esac + + if test $REPLACE_PERROR = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS perror.$ac_objext" + + fi + + + + + + if test "$GNULIB_PERROR" != 1; then + if test "$GNULIB_PERROR" = 0; then + GNULIB_PERROR=$gl_module_indicator_condition + else + GNULIB_PERROR="($GNULIB_PERROR || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_PERROR 1" >>confdefs.h + + + + + + + + if test $ac_cv_func_pipe != yes; then + HAVE_PIPE=0 + fi + + if test $HAVE_PIPE = 0; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS pipe.$ac_objext" + + fi + + + + + + if test "$GNULIB_PIPE" != 1; then + if test "$GNULIB_PIPE" = 0; then + GNULIB_PIPE=$gl_module_indicator_condition + else + GNULIB_PIPE="($GNULIB_PIPE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_PIPE 1" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for putenv compatible with GNU and SVID" >&5 +printf %s "checking for putenv compatible with GNU and SVID... " >&6; } +if test ${gl_cv_func_svid_putenv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_svid_putenv="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Put it in env. */ + if (putenv ("CONFTEST_putenv=val")) + return 1; + + /* Try to remove it. */ + if (putenv ("CONFTEST_putenv")) + return 2; + + /* Make sure it was deleted. */ + if (getenv ("CONFTEST_putenv") != 0) + return 3; + + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_svid_putenv=yes +else case e in @%:@( + e) gl_cv_func_svid_putenv=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_svid_putenv" >&5 +printf "%s\n" "$gl_cv_func_svid_putenv" >&6; } + case "$gl_cv_func_svid_putenv" in + *yes) ;; + *) + REPLACE_PUTENV=1 + ;; + esac + + if test $REPLACE_PUTENV = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS putenv.$ac_objext" + + + ac_fn_check_decl "$LINENO" "_putenv" "ac_cv_have_decl__putenv" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl__putenv" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL__PUTENV $ac_have_decl" >>confdefs.h + + + fi + + + + + + if test "$GNULIB_PUTENV" != 1; then + if test "$GNULIB_PUTENV" = 0; then + GNULIB_PUTENV=$gl_module_indicator_condition + else + GNULIB_PUTENV="($GNULIB_PUTENV || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_PUTENV 1" >>confdefs.h + + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in @%:@( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "@%:@define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "@%:@define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in @%:@( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "@%:@define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "@%:@define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + REPLACE_SELECT=1 + else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select supports a 0 argument" >&5 +printf %s "checking whether select supports a 0 argument... " >&6; } +if test ${gl_cv_func_select_supports0+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on Interix. + interix*) gl_cv_func_select_supports0="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_select_supports0="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_SYS_SELECT_H +#include +#endif +int main () +{ + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_supports0=yes +else case e in @%:@( + e) gl_cv_func_select_supports0=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_supports0" >&5 +printf "%s\n" "$gl_cv_func_select_supports0" >&6; } + case "$gl_cv_func_select_supports0" in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select detects invalid fds" >&5 +printf %s "checking whether select detects invalid fds... " >&6; } +if test ${gl_cv_func_select_detects_ebadf+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_select_detects_ebadf="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_SYS_SELECT_H +# include +#endif +#include +#include + +int +main (void) +{ + + fd_set set; + dup2(0, 16); + FD_ZERO(&set); + FD_SET(16, &set); + close(16); + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_detects_ebadf=yes +else case e in @%:@( + e) gl_cv_func_select_detects_ebadf=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_detects_ebadf" >&5 +printf "%s\n" "$gl_cv_func_select_detects_ebadf" >&6; } + case $gl_cv_func_select_detects_ebadf in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + fi + + LIB_SELECT="$LIBSOCKET" + if test $REPLACE_SELECT = 1; then + case "$host_os" in + mingw*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define WIN32_LEAN_AND_MEAN +#include +int +main () +{ + MsgWaitForMultipleObjects (0, NULL, 0, 0, 0); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in @%:@( + e) LIB_SELECT="$LIB_SELECT -luser32" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ;; + esac + fi + + + if test $REPLACE_SELECT = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS select.$ac_objext" + + fi + + + + + + if test "$GNULIB_SELECT" != 1; then + if test "$GNULIB_SELECT" = 0; then + GNULIB_SELECT=$gl_module_indicator_condition + else + GNULIB_SELECT="($GNULIB_SELECT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SELECT 1" >>confdefs.h + + + + + + + + case "$host_os" in + mingw*) REPLACE_SETLOCALE=1 ;; + cygwin*) + case `uname -r` in + 1.5.*) REPLACE_SETLOCALE=1 ;; + esac + ;; + esac + + if test $REPLACE_SETLOCALE = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS setlocale.$ac_objext" + + + : + + fi + + + + + + if test "$GNULIB_SETLOCALE" != 1; then + if test "$GNULIB_SETLOCALE" = 0; then + GNULIB_SETLOCALE=$gl_module_indicator_condition + else + GNULIB_SETLOCALE="($GNULIB_SETLOCALE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SETLOCALE 1" >>confdefs.h + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS setsockopt.$ac_objext" + + fi + + + + + + if test "$GNULIB_SETSOCKOPT" != 1; then + if test "$GNULIB_SETSOCKOPT" = 0; then + GNULIB_SETSOCKOPT=$gl_module_indicator_condition + else + GNULIB_SETSOCKOPT="($GNULIB_SETSOCKOPT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SETSOCKOPT 1" >>confdefs.h + + + + + + ac_fn_check_decl "$LINENO" "sleep" "ac_cv_have_decl_sleep" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_sleep" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_SLEEP $ac_have_decl" >>confdefs.h + + + if test $ac_cv_have_decl_sleep != yes; then + HAVE_SLEEP=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working sleep" >&5 +printf %s "checking for working sleep... " >&6; } +if test ${gl_cv_func_sleep_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_sleep_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_sleep_works="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +static void +handle_alarm (int sig) +{ + if (sig != SIGALRM) + _exit (2); +} + +int +main (void) +{ + + /* Failure to compile this test due to missing alarm is okay, + since all such platforms (mingw) also lack sleep. */ + unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days. */ + unsigned int remaining; + signal (SIGALRM, handle_alarm); + alarm (1); + remaining = sleep (pentecost); + if (remaining > pentecost) + return 3; + if (remaining <= pentecost - 10) + return 4; + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_sleep_works=yes +else case e in @%:@( + e) gl_cv_func_sleep_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_sleep_works" >&5 +printf "%s\n" "$gl_cv_func_sleep_works" >&6; } + case "$gl_cv_func_sleep_works" in + *yes) ;; + *) + REPLACE_SLEEP=1 + ;; + esac + fi + + if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS sleep.$ac_objext" + + fi + + + + + + if test "$GNULIB_SLEEP" != 1; then + if test "$GNULIB_SLEEP" = 0; then + GNULIB_SLEEP=$gl_module_indicator_condition + else + GNULIB_SLEEP="($GNULIB_SLEEP || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SLEEP 1" >>confdefs.h + + + + + + + gl_cv_func_snprintf_usable=no + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "@%:@define HAVE_SNPRINTF 1" >>confdefs.h + +fi + + if test $ac_cv_func_snprintf = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5 +printf %s "checking whether snprintf respects a size of 1... " >&6; } +if test ${gl_cv_func_snprintf_size1+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + gl_cv_func_snprintf_size1="guessing yes" +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + my_snprintf (buf, 1, "%d", 12345); + return buf[1] != 'E'; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_snprintf_size1=yes +else case e in @%:@( + e) gl_cv_func_snprintf_size1=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_size1" >&5 +printf "%s\n" "$gl_cv_func_snprintf_size1" >&6; } + + case "$gl_cv_func_snprintf_size1" in + *yes) + + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5 +printf %s "checking whether printf supports POSIX/XSI format strings with positions... " >&6; } +if test ${gl_cv_func_printf_positions+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) + gl_cv_func_printf_positions="guessing no";; + beos*) gl_cv_func_printf_positions="guessing no";; + mingw* | pw*) gl_cv_func_printf_positions="guessing no";; + *) gl_cv_func_printf_positions="guessing yes";; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* The string "%2$d %1$d", with dollar characters protected from the shell's + dollar expansion (possibly an autoconf bug). */ +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; +static char buf[100]; +int main () +{ + sprintf (buf, format, 33, 55); + return (strcmp (buf, "55 33") != 0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_printf_positions=yes +else case e in @%:@( + e) gl_cv_func_printf_positions=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_positions" >&5 +printf "%s\n" "$gl_cv_func_printf_positions" >&6; } + + case "$gl_cv_func_printf_positions" in + *yes) + gl_cv_func_snprintf_usable=yes + ;; + esac + ;; + esac + ;; + esac + fi + if test $gl_cv_func_snprintf_usable = no; then + + + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS snprintf.$ac_objext" + + if test $ac_cv_func_snprintf = yes; then + REPLACE_SNPRINTF=1 + else + + if test $ac_cv_have_decl_snprintf = yes; then + REPLACE_SNPRINTF=1 + fi + fi + : + + fi + + if test $ac_cv_have_decl_snprintf = no; then + HAVE_DECL_SNPRINTF=0 + fi + + + + + + + if test "$GNULIB_SNPRINTF" != 1; then + if test "$GNULIB_SNPRINTF" = 0; then + GNULIB_SNPRINTF=$gl_module_indicator_condition + else + GNULIB_SNPRINTF="($GNULIB_SNPRINTF || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SNPRINTF 1" >>confdefs.h + + + + + +printf "%s\n" "@%:@define GNULIB_SNPRINTF $gl_module_indicator_condition" >>confdefs.h + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS socket.$ac_objext" + + fi + # When this module is used, sockets may actually occur as file descriptors, + # hence it is worth warning if the modules 'close' and 'ioctl' are not used. + + + + if test "$ac_cv_header_winsock2_h" = yes; then + UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 + fi + + + + + + if test "$GNULIB_SOCKET" != 1; then + if test "$GNULIB_SOCKET" = 0; then + GNULIB_SOCKET=$gl_module_indicator_condition + else + GNULIB_SOCKET="($GNULIB_SOCKET || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SOCKET 1" >>confdefs.h + + + + + + ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " +/* is not needed according to POSIX, but the + in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include +#if HAVE_SYS_SOCKET_H +# include +#elif HAVE_WS2TCPIP_H +# include +#endif + +" +if test "x$ac_cv_type_socklen_t" = xyes +then : + +else case e in @%:@( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5 +printf %s "checking for socklen_t equivalent... " >&6; } + if test ${gl_cv_socklen_t_equiv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) # Systems have either "struct sockaddr *" or + # "void *" as the second argument to getpeername + gl_cv_socklen_t_equiv= + for arg2 in "struct sockaddr" void; do + for t in int size_t "unsigned int" "long int" "unsigned long int"; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + + int getpeername (int, $arg2 *, $t *); +int +main (void) +{ +$t len; + getpeername (0, 0, &len); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_socklen_t_equiv="$t" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$gl_cv_socklen_t_equiv" != "" && break + done + test "$gl_cv_socklen_t_equiv" != "" && break + done + ;; +esac +fi + + if test "$gl_cv_socklen_t_equiv" = ""; then + as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5 +printf "%s\n" "$gl_cv_socklen_t_equiv" >&6; } + +printf "%s\n" "@%:@define socklen_t $gl_cv_socklen_t_equiv" >>confdefs.h + ;; +esac +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5 +printf %s "checking for working stdalign.h... " >&6; } +if test ${gl_cv_header_working_stdalign_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + + /* Test that alignof yields a result consistent with offsetof. + This catches GCC bug 52023 + . */ + #ifdef __cplusplus + template struct alignof_helper { char a; t b; }; + # define ao(type) offsetof (alignof_helper, b) + #else + # define ao(type) offsetof (struct { char a; type b; }, b) + #endif + char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1]; + char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1]; + char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1]; + + /* Test _Alignas only on platforms where gnulib can help. */ + #if \ + ((defined __cplusplus && 201103 <= __cplusplus) \ + || (defined __APPLE__ && defined __MACH__ \ + ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ + : __GNUC__) \ + || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ + || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \ + || 1300 <= _MSC_VER) + struct alignas_test { char c; char alignas (8) alignas_8; }; + char test_alignas[offsetof (struct alignas_test, alignas_8) == 8 + ? 1 : -1]; + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_working_stdalign_h=yes +else case e in @%:@( + e) gl_cv_header_working_stdalign_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5 +printf "%s\n" "$gl_cv_header_working_stdalign_h" >&6; } + + if test $gl_cv_header_working_stdalign_h = yes; then + STDALIGN_H='' + else + STDALIGN_H='stdalign.h' + fi + + + if test -n "$STDALIGN_H"; then + GL_GENERATE_STDALIGN_H_TRUE= + GL_GENERATE_STDALIGN_H_FALSE='#' +else + GL_GENERATE_STDALIGN_H_TRUE='#' + GL_GENERATE_STDALIGN_H_FALSE= +fi + + + + + + + + + + + + if test $ac_cv_have_decl_strerror_r = no; then + HAVE_DECL_STRERROR_R=0 + fi + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + if test $gl_cv_func_strerror_r_posix_signature = yes; then + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR_R=1 ;; + esac + else + REPLACE_STRERROR_R=1 + fi + else + REPLACE_STRERROR_R=1 + fi + fi + + if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS strerror_r.$ac_objext" + + + + + + + fi + + + + + + if test "$GNULIB_STRERROR_R" != 1; then + if test "$GNULIB_STRERROR_R" = 0; then + GNULIB_STRERROR_R=$gl_module_indicator_condition + else + GNULIB_STRERROR_R="($GNULIB_STRERROR_R || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_STRERROR_R 1" >>confdefs.h + + + + + +printf "%s\n" "@%:@define GNULIB_STRERROR_R_POSIX $gl_module_indicator_condition" >>confdefs.h + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in @%:@( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "@%:@define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "@%:@define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + if test $ac_cv_func_symlink = no; then + HAVE_SYMLINK=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether symlink handles trailing slash correctly" >&5 +printf %s "checking whether symlink handles trailing slash correctly... " >&6; } +if test ${gl_cv_func_symlink_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_symlink_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_symlink_works="guessing no" ;; + esac + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +int result = 0; + if (!symlink ("a", "conftest.link/")) + result |= 1; + if (symlink ("conftest.f", "conftest.lnk2")) + result |= 2; + else if (!symlink ("a", "conftest.lnk2/")) + result |= 4; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_symlink_works=yes +else case e in @%:@( + e) gl_cv_func_symlink_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.f conftest.link conftest.lnk2 ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_symlink_works" >&5 +printf "%s\n" "$gl_cv_func_symlink_works" >&6; } + case "$gl_cv_func_symlink_works" in + *yes) ;; + *) + REPLACE_SYMLINK=1 + ;; + esac + fi + + if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS symlink.$ac_objext" + + fi + + + + + + if test "$GNULIB_SYMLINK" != 1; then + if test "$GNULIB_SYMLINK" = 0; then + GNULIB_SYMLINK=$gl_module_indicator_condition + else + GNULIB_SYMLINK="($GNULIB_SYMLINK || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_SYMLINK 1" >>confdefs.h + + + + + + + + if test $ac_cv_header_sys_ioctl_h = yes; then + HAVE_SYS_IOCTL_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether declares ioctl" >&5 +printf %s "checking whether declares ioctl... " >&6; } +if test ${gl_cv_decl_ioctl_in_sys_ioctl_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +(void) ioctl; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_ioctl_in_sys_ioctl_h=yes +else case e in @%:@( + e) gl_cv_decl_ioctl_in_sys_ioctl_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_ioctl_in_sys_ioctl_h" >&5 +printf "%s\n" "$gl_cv_decl_ioctl_in_sys_ioctl_h" >&6; } + else + HAVE_SYS_IOCTL_H=0 + fi + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_ioctl_h='<'sys/ioctl.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_ioctl_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_ioctl_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/ioctl.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_ioctl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_ioctl_h + gl_cv_next_sys_ioctl_h='"'$gl_header'"' + else + gl_cv_next_sys_ioctl_h='<'sys/ioctl.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_ioctl_h" >&5 +printf "%s\n" "$gl_cv_next_sys_ioctl_h" >&6; } + fi + NEXT_SYS_IOCTL_H=$gl_cv_next_sys_ioctl_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/ioctl.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_ioctl_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H=$gl_next_as_first_directive + + + + + + + for gl_func in ioctl; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +/* Some platforms declare ioctl in the wrong header. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +#endif + +int +main (void) +{ +@%:@undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in @%:@( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_uio_h='<'sys/uio.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +printf %s "checking absolute name of ... " >&6; } +if test ${gl_cv_next_sys_uio_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + if test $ac_cv_header_sys_uio_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/uio.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_uio_h + gl_cv_next_sys_uio_h='"'$gl_header'"' + else + gl_cv_next_sys_uio_h='<'sys/uio.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5 +printf "%s\n" "$gl_cv_next_sys_uio_h" >&6; } + fi + NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/uio.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_uio_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_sys_uio_h = yes; then + HAVE_SYS_UIO_H=1 + else + HAVE_SYS_UIO_H=0 + fi + + + + abs_aux_dir=`cd "$ac_aux_dir"; pwd` + + abs_aux_dir=`cd "$ac_aux_dir"; pwd` + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + + + if test $ac_cv_func_wctob = no; then + HAVE_WCTOB=0 + HAVE_DECL_WCTOB=0 + else + HAVE_WCTOB=1 + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wctob works" >&5 +printf %s "checking whether wctob works... " >&6; } +if test ${gl_cv_func_wctob_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + case "$host_os" in + # Guess no on Solaris <= 9 and Cygwin. + solaris2.[1-9] | solaris2.[1-9].* | cygwin*) + gl_cv_func_wctob_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wctob_works="guessing yes" ;; + esac + case "$host_os" in + cygwin*) + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include + +register long global __asm__ ("%ebx"); + +int main () +{ + setlocale (LC_ALL, "en_US.UTF-8"); + + global = 0x12345678; + if (wctob (0x00FC) != -1) + return 1; + if (global != 0x12345678) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + : +else case e in @%:@( + e) gl_cv_func_wctob_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; + esac + if test "$gl_cv_func_wctob_works" != no && test $LOCALE_FR != none; then + if test "$cross_compiling" = yes +then : + : +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + wchar_t wc; + + if (mbtowc (&wc, "\374", 1) == 1) + if (wctob (wc) != (unsigned char) '\374') + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_wctob_works=yes +else case e in @%:@( + e) gl_cv_func_wctob_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wctob_works" >&5 +printf "%s\n" "$gl_cv_func_wctob_works" >&6; } + case "$gl_cv_func_wctob_works" in + *yes) ;; + *) REPLACE_WCTOB=1 ;; + esac + if test $REPLACE_WCTOB = 0; then + + ac_fn_check_decl "$LINENO" "wctob" "ac_cv_have_decl_wctob" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_wctob" = xyes +then : + ac_have_decl=1 +else case e in @%:@( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "@%:@define HAVE_DECL_WCTOB $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_wctob != yes; then + HAVE_DECL_WCTOB=0 + fi + fi + fi + + if test $HAVE_WCTOB = 0 || test $REPLACE_WCTOB = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS wctob.$ac_objext" + + + : + + fi + + + + + + if test "$GNULIB_WCTOB" != 1; then + if test "$GNULIB_WCTOB" = 0; then + GNULIB_WCTOB=$gl_module_indicator_condition + else + GNULIB_WCTOB="($GNULIB_WCTOB || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_WCTOB 1" >>confdefs.h + + + + + + + if false; then + REPLACE_WCTOMB=1 + fi + + if test $REPLACE_WCTOMB = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS wctomb.$ac_objext" + + + : + + fi + + + + + + if test "$GNULIB_WCTOMB" != 1; then + if test "$GNULIB_WCTOMB" = 0; then + GNULIB_WCTOMB=$gl_module_indicator_condition + else + GNULIB_WCTOMB="($GNULIB_WCTOMB || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "@%:@define GNULIB_TEST_WCTOMB 1" >>confdefs.h + + + + + + + + + + + + + + LIBDIFFUTILS_LIBDEPS="$gl_libdeps" + + LIBDIFFUTILS_LTLIBDEPS="$gl_ltlibdeps" + + LIBTESTS_LIBDEPS="$gltests_libdeps" + + + +@%:@ Check whether --enable-gcc-warnings was given. +if test ${enable_gcc_warnings+y} +then : + enableval=$enable_gcc_warnings; case $enableval in + yes|no) ;; + *) as_fn_error $? "bad value $enableval for gcc-warnings option" "$LINENO" 5 ;; + esac + gl_gcc_warnings=$enableval +else case e in @%:@( + e) if test -d "$srcdir"/.git; then + gl_gcc_warnings=yes + else + gl_gcc_warnings=no + fi + ;; +esac +fi + + +if test "$gl_gcc_warnings" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror -Wunknown-warning-option" >&5 +printf %s "checking whether C compiler handles -Werror -Wunknown-warning-option... " >&6; } +if test ${gl_cv_warn_c__Werror__Wunknown_warning_option+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Werror__Wunknown_warning_option=yes +else case e in @%:@( + e) gl_cv_warn_c__Werror__Wunknown_warning_option=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror__Wunknown_warning_option" >&5 +printf "%s\n" "$gl_cv_warn_c__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_c__Werror__Wunknown_warning_option" = xyes +then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else case e in @%:@( + e) gl_unknown_warnings_are_errors= ;; +esac +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror" >&5 +printf %s "checking whether C compiler handles -Werror... " >&6; } +if test ${gl_cv_warn_c__Werror+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Werror=yes +else case e in @%:@( + e) gl_cv_warn_c__Werror=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror" >&5 +printf "%s\n" "$gl_cv_warn_c__Werror" >&6; } +if test "x$gl_cv_warn_c__Werror" = xyes +then : + as_fn_append WERROR_CFLAGS " -Werror" +fi + + + + + nw= + # This, $nw, is the list of warnings we disable. + nw="$nw -Wdeclaration-after-statement" # too useful to forbid + nw="$nw -Waggregate-return" # anachronistic + nw="$nw -Wlong-long" # C90 is anachronistic (lib/gethrxtime.h) + nw="$nw -Wc++-compat" # We don't care about C++ compilers + nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib + nw="$nw -Wtraditional" # Warns on #elif which we use often + nw="$nw -Wcast-qual" # Too many warnings for now + nw="$nw -Wconversion" # Too many warnings for now + nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings + nw="$nw -Wsign-conversion" # Too many warnings for now + nw="$nw -Wtraditional-conversion" # Too many warnings for now + nw="$nw -Wunreachable-code" # Too many warnings for now + nw="$nw -Wpadded" # Our structs are not padded + nw="$nw -Wredundant-decls" # openat.h declares e.g., mkdirat + nw="$nw -Wlogical-op" # any use of fwrite provokes this + nw="$nw -Wformat-nonliteral" # who.c and pinky.c strftime uses + nw="$nw -Wvla" # warnings in gettext.h + nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__ + nw="$nw -Wswitch-enum" # Too many warnings for now + nw="$nw -Wswitch-default" # Too many warnings for now + nw="$nw -Wstack-protector" # not worth working around + # things I might fix soon: + nw="$nw -Wfloat-equal" # sort.c, seq.c + nw="$nw -Wmissing-format-attribute" # copy.c + nw="$nw -Wunsafe-loop-optimizations" # a few src/*.c + nw="$nw -Winline" # system.h's readdir_ignoring_dot_and_dotdot + nw="$nw -Wstrict-overflow" # expr.c, pr.c, tr.c, factor.c + nw="$nw -Wformat-extra-args" # sdiff.c + # ?? -Wstrict-overflow + + + + if test -n "$GCC"; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is supported" >&5 +printf %s "checking whether -Wno-missing-field-initializers is supported... " >&6; } + if test ${gl_cv_cc_nomfi_supported+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_nomfi_supported=yes +else case e in @%:@( + e) gl_cv_cc_nomfi_supported=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_supported" >&5 +printf "%s\n" "$gl_cv_cc_nomfi_supported" >&6; } + + if test "$gl_cv_cc_nomfi_supported" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is needed" >&5 +printf %s "checking whether -Wno-missing-field-initializers is needed... " >&6; } + if test ${gl_cv_cc_nomfi_needed+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int f (void) + { + typedef struct { int a; int b; } s_t; + s_t s1 = { 0, }; + return s1.b; + } + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_nomfi_needed=no +else case e in @%:@( + e) gl_cv_cc_nomfi_needed=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" + ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_needed" >&5 +printf "%s\n" "$gl_cv_cc_nomfi_needed" >&6; } + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wuninitialized is supported" >&5 +printf %s "checking whether -Wuninitialized is supported... " >&6; } + if test ${gl_cv_cc_uninitialized_supported+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wuninitialized" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_uninitialized_supported=yes +else case e in @%:@( + e) gl_cv_cc_uninitialized_supported=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_uninitialized_supported" >&5 +printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; } + + fi + + # List all gcc warning categories. + # To compare this list to your installed GCC's, run this Bash command: + # + # comm -3 \ + # <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \ + # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort | + # grep -v -x -F -f <( + # awk '/^[^#]/ {print ws}' ../build-aux/gcc-warning.spec)) + + gl_manywarn_set= + for gl_manywarn_item in -fno-common \ + -W \ + -Wabi \ + -Waddress \ + -Waggressive-loop-optimizations \ + -Wall \ + -Wattributes \ + -Wbad-function-cast \ + -Wbool-compare \ + -Wbool-operation \ + -Wbuiltin-declaration-mismatch \ + -Wbuiltin-macro-redefined \ + -Wcast-align \ + -Wchar-subscripts \ + -Wchkp \ + -Wclobbered \ + -Wcomment \ + -Wcomments \ + -Wcoverage-mismatch \ + -Wcpp \ + -Wdangling-else \ + -Wdate-time \ + -Wdeprecated \ + -Wdeprecated-declarations \ + -Wdesignated-init \ + -Wdisabled-optimization \ + -Wdiscarded-array-qualifiers \ + -Wdiscarded-qualifiers \ + -Wdiv-by-zero \ + -Wdouble-promotion \ + -Wduplicated-branches \ + -Wduplicated-cond \ + -Wduplicate-decl-specifier \ + -Wempty-body \ + -Wendif-labels \ + -Wenum-compare \ + -Wexpansion-to-defined \ + -Wextra \ + -Wformat-contains-nul \ + -Wformat-extra-args \ + -Wformat-nonliteral \ + -Wformat-security \ + -Wformat-signedness \ + -Wformat-y2k \ + -Wformat-zero-length \ + -Wframe-address \ + -Wfree-nonheap-object \ + -Whsa \ + -Wignored-attributes \ + -Wignored-qualifiers \ + -Wimplicit \ + -Wimplicit-function-declaration \ + -Wimplicit-int \ + -Wincompatible-pointer-types \ + -Winit-self \ + -Winline \ + -Wint-conversion \ + -Wint-in-bool-context \ + -Wint-to-pointer-cast \ + -Winvalid-memory-model \ + -Winvalid-pch \ + -Wjump-misses-init \ + -Wlogical-not-parentheses \ + -Wlogical-op \ + -Wmain \ + -Wmaybe-uninitialized \ + -Wmemset-elt-size \ + -Wmemset-transposed-args \ + -Wmisleading-indentation \ + -Wmissing-braces \ + -Wmissing-declarations \ + -Wmissing-field-initializers \ + -Wmissing-include-dirs \ + -Wmissing-parameter-type \ + -Wmissing-prototypes \ + -Wmultichar \ + -Wnarrowing \ + -Wnested-externs \ + -Wnonnull \ + -Wnonnull-compare \ + -Wnull-dereference \ + -Wodr \ + -Wold-style-declaration \ + -Wold-style-definition \ + -Wopenmp-simd \ + -Woverflow \ + -Woverlength-strings \ + -Woverride-init \ + -Wpacked \ + -Wpacked-bitfield-compat \ + -Wparentheses \ + -Wpointer-arith \ + -Wpointer-compare \ + -Wpointer-sign \ + -Wpointer-to-int-cast \ + -Wpragmas \ + -Wpsabi \ + -Wrestrict \ + -Wreturn-local-addr \ + -Wreturn-type \ + -Wscalar-storage-order \ + -Wsequence-point \ + -Wshadow \ + -Wshift-count-negative \ + -Wshift-count-overflow \ + -Wshift-negative-value \ + -Wsizeof-array-argument \ + -Wsizeof-pointer-memaccess \ + -Wstack-protector \ + -Wstrict-aliasing \ + -Wstrict-overflow \ + -Wstrict-prototypes \ + -Wsuggest-attribute=const \ + -Wsuggest-attribute=format \ + -Wsuggest-attribute=noreturn \ + -Wsuggest-attribute=pure \ + -Wsuggest-final-methods \ + -Wsuggest-final-types \ + -Wswitch \ + -Wswitch-bool \ + -Wswitch-default \ + -Wswitch-unreachable \ + -Wsync-nand \ + -Wsystem-headers \ + -Wtautological-compare \ + -Wtrampolines \ + -Wtrigraphs \ + -Wtype-limits \ + -Wuninitialized \ + -Wunknown-pragmas \ + -Wunsafe-loop-optimizations \ + -Wunused \ + -Wunused-but-set-parameter \ + -Wunused-but-set-variable \ + -Wunused-function \ + -Wunused-label \ + -Wunused-local-typedefs \ + -Wunused-macros \ + -Wunused-parameter \ + -Wunused-result \ + -Wunused-value \ + -Wunused-variable \ + -Wvarargs \ + -Wvariadic-macros \ + -Wvector-operation-performance \ + -Wvla \ + -Wvolatile-register-var \ + -Wwrite-strings \ + \ + ; do + gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" + done + + # gcc --help=warnings outputs an unusual form for these options; list + # them here so that the above 'comm' command doesn't report a false match. + # Would prefer "min (PTRDIFF_MAX, SIZE_MAX)", but it must be a literal: + ptrdiff_max_max=9223372036854775807 + gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$ptrdiff_max_max" + gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2" + gl_manywarn_set="$gl_manywarn_set -Wformat-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wformat-truncation=2" + gl_manywarn_set="$gl_manywarn_set -Wimplicit-fallthrough=5" + gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc" + gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wstringop-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2" + gl_manywarn_set="$gl_manywarn_set -Wvla-larger-than=4031" + + # These are needed for older GCC versions. + if test -n "$GCC"; then + case `($CC --version) 2>/dev/null` in + 'gcc (GCC) '[0-3].* | \ + 'gcc (GCC) '4.[0-7].*) + gl_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option" + gl_manywarn_set="$gl_manywarn_set -funit-at-a-time" + ;; + esac + fi + + # Disable specific options as needed. + if test "$gl_cv_cc_nomfi_needed" = yes; then + gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers" + fi + + if test "$gl_cv_cc_uninitialized_supported" = no; then + gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized" + fi + + ws=$gl_manywarn_set + + + gl_warn_set= + set x $ws; shift + for gl_warn_item + do + case " $nw " in + *" $gl_warn_item "*) + ;; + *) + gl_warn_set="$gl_warn_set $gl_warn_item" + ;; + esac + done + ws=$gl_warn_set + + for w in $ws; do + +as_gl_Warn=`printf "%s\n" "gl_cv_warn_c_$w" | sed "$as_sed_sh"` +gl_positive="$w" +case $gl_positive in + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles $w" >&5 +printf %s "checking whether C compiler handles $w... " >&6; } +if eval test \${$as_gl_Warn+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors $gl_positive" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_gl_Warn=yes" +else case e in @%:@( + e) eval "$as_gl_Warn=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +eval ac_res=\$$as_gl_Warn + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_gl_Warn"\" = x"yes" +then : + as_fn_append WARN_CFLAGS " $w" +fi + + + done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-missing-field-initializers" >&5 +printf %s "checking whether C compiler handles -Wno-missing-field-initializers... " >&6; } +if test ${gl_cv_warn_c__Wno_missing_field_initializers+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wmissing-field-initializers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_missing_field_initializers=yes +else case e in @%:@( + e) gl_cv_warn_c__Wno_missing_field_initializers=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_missing_field_initializers" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_missing_field_initializers" >&6; } +if test "x$gl_cv_warn_c__Wno_missing_field_initializers" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-missing-field-initializers" +fi + + # We need this one + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-sign-compare" >&5 +printf %s "checking whether C compiler handles -Wno-sign-compare... " >&6; } +if test ${gl_cv_warn_c__Wno_sign_compare+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wsign-compare" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_sign_compare=yes +else case e in @%:@( + e) gl_cv_warn_c__Wno_sign_compare=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_sign_compare" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_sign_compare" >&6; } +if test "x$gl_cv_warn_c__Wno_sign_compare" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-sign-compare" +fi + + # Too many warnings for now + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-pointer-sign" >&5 +printf %s "checking whether C compiler handles -Wno-pointer-sign... " >&6; } +if test ${gl_cv_warn_c__Wno_pointer_sign+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wpointer-sign" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_pointer_sign=yes +else case e in @%:@( + e) gl_cv_warn_c__Wno_pointer_sign=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_pointer_sign" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_pointer_sign" >&6; } +if test "x$gl_cv_warn_c__Wno_pointer_sign" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-pointer-sign" +fi + + # Too many warnings for now + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-unused-parameter" >&5 +printf %s "checking whether C compiler handles -Wno-unused-parameter... " >&6; } +if test ${gl_cv_warn_c__Wno_unused_parameter+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wunused-parameter" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_unused_parameter=yes +else case e in @%:@( + e) gl_cv_warn_c__Wno_unused_parameter=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_unused_parameter" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_unused_parameter" >&6; } +if test "x$gl_cv_warn_c__Wno_unused_parameter" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-unused-parameter" +fi + + # Too many warnings for now + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-format-nonliteral" >&5 +printf %s "checking whether C compiler handles -Wno-format-nonliteral... " >&6; } +if test ${gl_cv_warn_c__Wno_format_nonliteral+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wformat-nonliteral" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_format_nonliteral=yes +else case e in @%:@( + e) gl_cv_warn_c__Wno_format_nonliteral=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_format_nonliteral" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_format_nonliteral" >&6; } +if test "x$gl_cv_warn_c__Wno_format_nonliteral" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-format-nonliteral" +fi + + + + # In spite of excluding -Wlogical-op above, it is enabled, as of + # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-logical-op" >&5 +printf %s "checking whether C compiler handles -Wno-logical-op... " >&6; } +if test ${gl_cv_warn_c__Wno_logical_op+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wlogical-op" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_logical_op=yes +else case e in @%:@( + e) gl_cv_warn_c__Wno_logical_op=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_logical_op" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_logical_op" >&6; } +if test "x$gl_cv_warn_c__Wno_logical_op" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-logical-op" +fi + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -fdiagnostics-show-option" >&5 +printf %s "checking whether C compiler handles -fdiagnostics-show-option... " >&6; } +if test ${gl_cv_warn_c__fdiagnostics_show_option+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -fdiagnostics-show-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__fdiagnostics_show_option=yes +else case e in @%:@( + e) gl_cv_warn_c__fdiagnostics_show_option=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__fdiagnostics_show_option" >&5 +printf "%s\n" "$gl_cv_warn_c__fdiagnostics_show_option" >&6; } +if test "x$gl_cv_warn_c__fdiagnostics_show_option" = xyes +then : + as_fn_append WARN_CFLAGS " -fdiagnostics-show-option" +fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -funit-at-a-time" >&5 +printf %s "checking whether C compiler handles -funit-at-a-time... " >&6; } +if test ${gl_cv_warn_c__funit_at_a_time+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -funit-at-a-time" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__funit_at_a_time=yes +else case e in @%:@( + e) gl_cv_warn_c__funit_at_a_time=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__funit_at_a_time" >&5 +printf "%s\n" "$gl_cv_warn_c__funit_at_a_time" >&6; } +if test "x$gl_cv_warn_c__funit_at_a_time" = xyes +then : + as_fn_append WARN_CFLAGS " -funit-at-a-time" +fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -fno-common" >&5 +printf %s "checking whether C compiler handles -fno-common... " >&6; } +if test ${gl_cv_warn_c__fno_common+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -fno-common" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__fno_common=yes +else case e in @%:@( + e) gl_cv_warn_c__fno_common=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__fno_common" >&5 +printf "%s\n" "$gl_cv_warn_c__fno_common" >&6; } +if test "x$gl_cv_warn_c__fno_common" = xyes +then : + as_fn_append WARN_CFLAGS " -fno-common" +fi + + + + + + +printf "%s\n" "@%:@define lint 1" >>confdefs.h + + +printf "%s\n" "@%:@define _FORTIFY_SOURCE 2" >>confdefs.h + + +printf "%s\n" "@%:@define GNULIB_PORTCHECK 1" >>confdefs.h + + + # We use a slightly smaller set of warning options for lib/. + # Remove the following and save the result in GNULIB_WARN_CFLAGS. + nw= + nw="$nw -Wunused-macros" + nw="$nw -Wmissing-prototypes" + nw="$nw -Wold-style-definition" + nw="$nw -Wsuggest-attribute=pure" + + gl_warn_set= + set x $WARN_CFLAGS; shift + for gl_warn_item + do + case " $nw " in + *" $gl_warn_item "*) + ;; + *) + gl_warn_set="$gl_warn_set $gl_warn_item" + ;; + esac + done + GNULIB_WARN_CFLAGS=$gl_warn_set + + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo (void) {return 0; } +$ac_kw foo_t foo (void) {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for variable-length arrays" >&5 +printf %s "checking for variable-length arrays... " >&6; } +if test ${ac_cv_c_vararrays+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC_NO_VLA__ + defined + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "defined" >/dev/null 2>&1 +then : + ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined' +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test for VLA support. This test is partly inspired + from examples in the C standard. Use at least two VLA + functions to detect the GCC 3.4.3 bug described in: + http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html + */ + #ifdef __STDC_NO_VLA__ + syntax error; + #else + extern int n; + int B[100]; + int fvla (int m, int C[m][m]); + + int + simple (int count, int all[static count]) + { + return all[count - 1]; + } + + int + fvla (int m, int C[m][m]) + { + typedef int VLA[m][m]; + VLA x; + int D[m]; + static int (*q)[m] = &B; + int (*s)[n] = q; + return C && &x[0][0] == &D[0] && &D[0] == s[0]; + } + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_vararrays=yes +else case e in @%:@( + e) ac_cv_c_vararrays=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -rf conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_vararrays" >&5 +printf "%s\n" "$ac_cv_c_vararrays" >&6; } + if test "$ac_cv_c_vararrays" = yes; then + +printf "%s\n" "@%:@define HAVE_C_VARARRAYS 1" >>confdefs.h + + elif test "$ac_cv_c_vararrays" = no; then + +printf "%s\n" "@%:@define __STDC_NO_VLA__ 1" >>confdefs.h + + fi + + + +printf "%s\n" "@%:@define DEFAULT_EDITOR_PROGRAM \"ed\"" >>confdefs.h + + +# Extract the first word of "pr", so it can be a program name with args. +set dummy pr; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PR_PROGRAM+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) case $PR_PROGRAM in + [\\/]* | ?:[\\/]*) + ac_cv_path_PR_PROGRAM="$PR_PROGRAM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PR_PROGRAM="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PR_PROGRAM" && ac_cv_path_PR_PROGRAM="""" + ;; +esac ;; +esac +fi +PR_PROGRAM=$ac_cv_path_PR_PROGRAM +if test -n "$PR_PROGRAM"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PR_PROGRAM" >&5 +printf "%s\n" "$PR_PROGRAM" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +printf "%s\n" "@%:@define PR_PROGRAM \"$PR_PROGRAM\"" >>confdefs.h + + +ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_blksize" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_BLKSIZE 1" >>confdefs.h + + +fi + +ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_rdev" = xyes +then : + +printf "%s\n" "@%:@define HAVE_STRUCT_STAT_ST_RDEV 1" >>confdefs.h + + +fi + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | sed "$as_sed_sh"` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +printf %s "checking for $ac_hdr that defines DIR... " >&6; } +if eval test \${$as_ac_Header+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main (void) +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_ac_Header=yes" +else case e in @%:@( + e) eval "$as_ac_Header=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_ac_Header + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +@%:@define `printf "%s\n" "HAVE_$ac_hdr" | sed "$as_sed_cpp"` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); +int +main (void) +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_opendir+y} +then : + break +fi +done +if test ${ac_cv_search_opendir+y} +then : + +else case e in @%:@( + e) ac_cv_search_opendir=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); +int +main (void) +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_opendir+y} +then : + break +fi +done +if test ${ac_cv_search_opendir+y} +then : + +else case e in @%:@( + e) ac_cv_search_opendir=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 +printf %s "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } +if test ${ac_cv_header_sys_wait_h+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) +#endif +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif + +int +main (void) +{ + int s; + wait (&s); + s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_header_sys_wait_h=yes +else case e in @%:@( + e) ac_cv_header_sys_wait_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 +printf "%s\n" "$ac_cv_header_sys_wait_h" >&6; } +if test $ac_cv_header_sys_wait_h = yes; then + +printf "%s\n" "@%:@define HAVE_SYS_WAIT_H 1" >>confdefs.h + +fi + + + ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default +" +if test "x$ac_cv_type_pid_t" = xyes +then : + +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_pid_type='int' +else case e in @%:@( + e) ac_pid_type='__int64' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +printf "%s\n" "@%:@define pid_t $ac_pid_type" >>confdefs.h + + ;; +esac +fi + + + + + + + +if test $ac_cv_func_sigprocmask = no; then + ac_fn_c_check_func "$LINENO" "sigblock" "ac_cv_func_sigblock" +if test "x$ac_cv_func_sigblock" = xyes +then : + printf "%s\n" "@%:@define HAVE_SIGBLOCK 1" >>confdefs.h + +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5 +printf %s "checking whether closedir returns void... " >&6; } +if test ${ac_cv_func_closedir_void+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <$ac_header_dirent> + +int +main (void) +{ + + return closedir(0); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_func_closedir_void=no +else case e in @%:@( + e) ac_cv_func_closedir_void=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_closedir_void" >&5 +printf "%s\n" "$ac_cv_func_closedir_void" >&6; } +if test $ac_cv_func_closedir_void = yes; then + +printf "%s\n" "@%:@define CLOSEDIR_VOID 1" >>confdefs.h + +fi + + + + + + +if test "x$ac_cv_func_fork" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 +printf %s "checking for working fork... " >&6; } +if test ${ac_cv_func_fork_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + ac_cv_func_fork_works=cross +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* By R. Kuhlmann. */ + return fork () < 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_fork_works=yes +else case e in @%:@( + e) ac_cv_func_fork_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 +printf "%s\n" "$ac_cv_func_fork_works" >&6; } + +else + ac_cv_func_fork_works=$ac_cv_func_fork +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 +printf %s "checking for working vfork... " >&6; } +if test ${ac_cv_func_vfork_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) if test "$cross_compiling" = yes +then : + ac_cv_func_vfork_works=cross +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Thanks to Paul Eggert for this test. */ +$ac_includes_default +#include +#include +#ifdef HAVE_VFORK_H +# include +#endif + +static void +do_nothing (int sig) +{ + (void) sig; +} + +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include , but some compilers + (e.g. gcc -O) don't grok . Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static void +sparc_address_test (int arg) +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} + +int +main (void) +{ + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (0); + + /* On Solaris 2.4, changes by the child to the signal handler + also munge signal handlers in the parent. To detect this, + start by putting the parent's handler in a known state. */ + signal (SIGTERM, SIG_DFL); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* Alter the child's signal handler. */ + if (signal (SIGTERM, do_nothing) != SIG_DFL) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + return ( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child munge the parent's signal handler? */ + || signal (SIGTERM, SIG_DFL) != SIG_DFL + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_vfork_works=yes +else case e in @%:@( + e) ac_cv_func_vfork_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 +printf "%s\n" "$ac_cv_func_vfork_works" >&6; } + +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=$ac_cv_func_vfork + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} +fi + +if test "x$ac_cv_func_vfork_works" = xyes; then + +printf "%s\n" "@%:@define HAVE_WORKING_VFORK 1" >>confdefs.h + +else + +printf "%s\n" "@%:@define vfork fork" >>confdefs.h + +fi +if test "x$ac_cv_func_fork_works" = xyes; then + +printf "%s\n" "@%:@define HAVE_WORKING_FORK 1" >>confdefs.h + +fi + + +# When .tarball-version exists, we're building from a tarball +# and must not make man/*.1 files depend on the generated src/version.c, +# because that would induce a requirement to run the help2man perl script. +# We are not yet prepared to make perl a build-from-tarball requirement. +# Hence, here we detect .tarball-version existence. When not present, +# we define a variable to be used in man/Makefile.am to induce the +# proper dependency (so that man/*.1 will be rebuilt upon any version change), +# but not when built from a tarball. + +test -f $srcdir/.tarball-version \ + && SRC_VERSION_C= \ + || SRC_VERSION_C=../src/version.c + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +printf %s "checking whether NLS is requested... " >&6; } + @%:@ Check whether --enable-nls was given. +if test ${enable_nls+y} +then : + enableval=$enable_nls; USE_NLS=$enableval +else case e in @%:@( + e) USE_NLS=yes ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$USE_NLS" >&6; } + + + + + GETTEXT_MACRO_VERSION=0.19 + + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MSGFMT+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) case "$MSGFMT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +printf "%s\n" "$MSGFMT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_GMSGFMT+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +printf "%s\n" "$GMSGFMT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; + *) MSGFMT_015=$MSGFMT ;; + esac + + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_XGETTEXT+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) case "$XGETTEXT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +printf "%s\n" "$XGETTEXT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + rm -f messages.po + + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MSGMERGE+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) case "$MSGMERGE" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" + ;; +esac ;; +esac +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 +printf "%s\n" "$MSGMERGE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$localedir" || localedir='${datadir}/locale' + + + test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + + + ac_config_commands="$ac_config_commands po-directories" + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 +printf %s "checking for CFPreferencesCopyAppValue... " >&6; } +if test ${gt_cv_func_CFPreferencesCopyAppValue+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +CFPreferencesCopyAppValue(NULL, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gt_cv_func_CFPreferencesCopyAppValue=yes +else case e in @%:@( + e) gt_cv_func_CFPreferencesCopyAppValue=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 +printf "%s\n" "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + +printf "%s\n" "@%:@define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 +printf %s "checking for CFLocaleCopyCurrent... " >&6; } +if test ${gt_cv_func_CFLocaleCopyCurrent+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +CFLocaleCopyCurrent(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gt_cv_func_CFLocaleCopyCurrent=yes +else case e in @%:@( + e) gt_cv_func_CFLocaleCopyCurrent=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 +printf "%s\n" "$gt_cv_func_CFLocaleCopyCurrent" >&6; } + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + +printf "%s\n" "@%:@define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h + + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + fi + + + + + + + LIBINTL= + LTLIBINTL= + POSUB= + + case " $gt_needs " in + *" need-formatstring-macros "*) gt_api_version=3 ;; + *" need-ngettext "*) gt_api_version=2 ;; + *) gt_api_version=1 ;; + esac + gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" + gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + + + if test $gt_api_version -ge 3; then + gt_revision_test_code=' +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +' + else + gt_revision_test_code= + fi + if test $gt_api_version -ge 2; then + gt_expression_test_code=' + * ngettext ("", "", 0)' + else + gt_expression_test_code= + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 +printf %s "checking for GNU gettext in libc... " >&6; } +if eval test \${$gt_func_gnugettext_libc+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$gt_func_gnugettext_libc=yes" +else case e in @%:@( + e) eval "$gt_func_gnugettext_libc=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$gt_func_gnugettext_libc + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +printf %s "checking for iconv... " >&6; } +if test ${am_cv_func_iconv+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +printf "%s\n" "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +printf %s "checking for working iconv... " >&6; } +if test ${am_cv_func_iconv_works+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + if test "$cross_compiling" = yes +then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac +else case e in @%:@( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + +int +main (void) +{ +int result = 0; + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\263"; + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + result |= 8; + iconv_close (cd_88591_to_utf8); + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + result |= 16; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + am_cv_func_iconv_works=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + test "$am_cv_func_iconv_works" = no || break + done + LIBS="$am_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +printf "%s\n" "$am_cv_func_iconv_works" >&6; } + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + +printf "%s\n" "@%:@define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +printf %s "checking how to link with libiconv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +printf "%s\n" "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +@%:@ Check whether --with-libintl-prefix was given. +if test ${with_libintl_prefix+y} +then : + withval=$with_libintl_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBINTL= + LTLIBINTL= + INCINTL= + LIBINTL_PREFIX= + HAVE_LIBINTL= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='intl ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" + ;; + esac + done + fi + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" + done + fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 +printf %s "checking for GNU gettext in libintl... " >&6; } +if eval test \${$gt_func_gnugettext_libintl+y} +then : + printf %s "(cached) " >&6 +else case e in @%:@( + e) gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$gt_func_gnugettext_libintl=yes" +else case e in @%:@( + e) eval "$gt_func_gnugettext_libintl=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS" ;; +esac +fi +eval ac_res=\$$gt_func_gnugettext_libintl + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + fi + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ + || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + + + if test -n "$INTL_MACOSX_LIBS"; then + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" + LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" + fi + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + +printf "%s\n" "@%:@define ENABLE_NLS 1" >>confdefs.h + + else + USE_NLS=no + fi + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 +printf %s "checking whether to use NLS... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$USE_NLS" >&6; } + if test "$USE_NLS" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 +printf %s "checking where the gettext function comes from... " >&6; } + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 +printf "%s\n" "$gt_source" >&6; } + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 +printf %s "checking how to link with libintl... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 +printf "%s\n" "$LIBINTL" >&6; } + + for element in $INCINTL; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + fi + + +printf "%s\n" "@%:@define HAVE_GETTEXT 1" >>confdefs.h + + +printf "%s\n" "@%:@define HAVE_DCGETTEXT 1" >>confdefs.h + + fi + + POSUB=po + fi + + + + INTLLIBS="$LIBINTL" + + + + + + + +XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT" + +ac_config_files="$ac_config_files Makefile doc/Makefile lib/Makefile src/Makefile tests/Makefile gnulib-tests/Makefile man/Makefile po/Makefile.in" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # 'set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # 'set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; +esac +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +@%:@ Check whether --enable-year2038 was given. +if test ${enable_year2038+y} +then : + enableval=$enable_year2038; +fi + +if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then + as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +test "X$DEFS" = X-DHAVE_CONFIG_H && DEFS= +if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GNU_MAKE_TRUE}" && test -z "${GNU_MAKE_FALSE}"; then + as_fn_error $? "conditional \"GNU_MAKE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +CONFIG_INCLUDE=lib/config.h + +if test -z "${GL_GENERATE_STDARG_H_TRUE}" && test -z "${GL_GENERATE_STDARG_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDARG_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE}"; then + as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE}"; then + as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE}"; then + as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + + gl_libobjs= + gl_ltlibobjs= + if test -n "$gl_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do + gl_libobjs="$gl_libobjs $i.$ac_objext" + gl_ltlibobjs="$gl_ltlibobjs $i.lo" + done + fi + gl_LIBOBJS=$gl_libobjs + + gl_LTLIBOBJS=$gl_ltlibobjs + + + +if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_NETINET_IN_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + gltests_libobjs= + gltests_ltlibobjs= + if test -n "$gltests_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do + gltests_libobjs="$gltests_libobjs $i.$ac_objext" + gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" + done + fi + gltests_LIBOBJS=$gltests_libobjs + + gltests_LTLIBOBJS=$gltests_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else case e in @%:@( + e) case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in @%:@((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as 'sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else case e in @%:@( + e) as_fn_append () + { + eval $1=\$$1\$2 + } ;; +esac +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else case e in @%:@( + e) as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } ;; +esac +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_@&t@echo='printf %s\n' +as_@&t@echo_n='printf %s' + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated + +# Sed expression to map a string onto a valid variable name. +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by GNU diffutils $as_me 3.6, which was +generated by GNU Autoconf 2.72. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_links="$ac_config_links" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +'$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration links: +$config_links + +Configuration commands: +$config_commands + +Report bugs to . +GNU diffutils home page: . +General help using GNU software: ." + +_ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config='$ac_cs_config_escaped' +ac_cs_version="\\ +GNU diffutils config.status 3.6 +configured by $0, generated by GNU Autoconf 2.72, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2023 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + printf "%s\n" "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + printf "%s\n" "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; + --help | --hel | -h ) + printf "%s\n" "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + printf "%s\n" "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" +GNUmakefile=$GNUmakefile +# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it + # from automake < 1.5. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "lib/config.h") CONFIG_HEADERS="$CONFIG_HEADERS lib/config.h:lib/config.hin" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "$GNUmakefile") CONFIG_LINKS="$CONFIG_LINKS $GNUmakefile:$GNUmakefile" ;; + "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "gnulib-tests/Makefile") CONFIG_FILES="$CONFIG_FILES gnulib-tests/Makefile" ;; + "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_LINKS+y} || CONFIG_LINKS=$config_links + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to '$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with './config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with './config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script 'defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain ':'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is 'configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`printf "%s\n" "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when '$srcdir' = '.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + :L) + # + # CONFIG_LINK + # + + if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then + : + else + # Prefer the file from the source tree if names are identical. + if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then + ac_source=$srcdir/$ac_source + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5 +printf "%s\n" "$as_me: linking $ac_source to $ac_file" >&6;} + + if test ! -r "$ac_source"; then + as_fn_error $? "$ac_source: file not found" "$LINENO" 5 + fi + rm -f "$ac_file" + + # Try a relative symlink, then a hard link, then a copy. + case $ac_source in + [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; + *) ac_rel_source=$ac_top_build_prefix$ac_source ;; + esac + ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || + ln "$ac_source" "$ac_file" 2>/dev/null || + cp -p "$ac_source" "$ac_file" || + as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5 + fi + ;; + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in @%:@( + *\'*) : + eval set x "$CONFIG_FILES" ;; @%:@( + *) : + set x $CONFIG_FILES ;; @%:@( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See 'config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + "po-directories":C) + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + # Treat a directory as a PO directory if and only if it has a + # POTFILES.in file. This allows packages to have multiple PO + # directories under different names or in different locations. + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + \ No newline at end of file diff --git a/local/recipes/tools/diffutils/source/autom4te.cache/requests b/local/recipes/tools/diffutils/source/autom4te.cache/requests new file mode 100644 index 0000000000..0055007a08 --- /dev/null +++ b/local/recipes/tools/diffutils/source/autom4te.cache/requests @@ -0,0 +1,918 @@ +# This file was generated by Autom4te 2.72. +# It contains the lists of macros which have been traced. +# It can be safely removed. + +@request = ( + bless( [ + '0', + 1, + [ + '/usr/share/autoconf' + ], + [ + '/usr/share/autoconf/autoconf/autoconf.m4f', + '/usr/share/aclocal-1.18/internal/ac-config-macro-dirs.m4', + '/usr/share/aclocal-1.18/amversion.m4', + '/usr/share/aclocal-1.18/auxdir.m4', + '/usr/share/aclocal-1.18/cond.m4', + '/usr/share/aclocal-1.18/depend.m4', + '/usr/share/aclocal-1.18/depout.m4', + '/usr/share/aclocal-1.18/init.m4', + '/usr/share/aclocal-1.18/install-sh.m4', + '/usr/share/aclocal-1.18/lead-dot.m4', + '/usr/share/aclocal-1.18/make.m4', + '/usr/share/aclocal-1.18/missing.m4', + '/usr/share/aclocal-1.18/mkdirp.m4', + '/usr/share/aclocal-1.18/options.m4', + '/usr/share/aclocal-1.18/prog-cc-c-o.m4', + '/usr/share/aclocal-1.18/rmf.m4', + '/usr/share/aclocal-1.18/runlog.m4', + '/usr/share/aclocal-1.18/sanity.m4', + '/usr/share/aclocal-1.18/silent.m4', + '/usr/share/aclocal-1.18/strip.m4', + '/usr/share/aclocal-1.18/substnot.m4', + '/usr/share/aclocal-1.18/tar.m4', + '/usr/share/aclocal-1.18/xargsn.m4', + 'm4/00gnulib.m4', + 'm4/absolute-header.m4', + 'm4/alloca.m4', + 'm4/arpa_inet_h.m4', + 'm4/btowc.m4', + 'm4/builtin-expect.m4', + 'm4/c-stack.m4', + 'm4/clock_time.m4', + 'm4/close.m4', + 'm4/codeset.m4', + 'm4/config-h.m4', + 'm4/configmake.m4', + 'm4/ctype.m4', + 'm4/dirname.m4', + 'm4/double-slash-root.m4', + 'm4/dup2.m4', + 'm4/eealloc.m4', + 'm4/environ.m4', + 'm4/errno_h.m4', + 'm4/error.m4', + 'm4/exponentd.m4', + 'm4/extensions.m4', + 'm4/extern-inline.m4', + 'm4/fcntl-o.m4', + 'm4/fcntl.m4', + 'm4/fcntl_h.m4', + 'm4/fdopen.m4', + 'm4/filenamecat.m4', + 'm4/flexmember.m4', + 'm4/float_h.m4', + 'm4/fnmatch.m4', + 'm4/fpieee.m4', + 'm4/freopen.m4', + 'm4/fstat.m4', + 'm4/ftruncate.m4', + 'm4/getcwd.m4', + 'm4/getdtablesize.m4', + 'm4/getopt.m4', + 'm4/getpagesize.m4', + 'm4/getprogname.m4', + 'm4/gettext.m4', + 'm4/gettime.m4', + 'm4/gettimeofday.m4', + 'm4/glibc21.m4', + 'm4/gnu-make.m4', + 'm4/gnulib-common.m4', + 'm4/gnulib-comp.m4', + 'm4/hard-locale.m4', + 'm4/iconv.m4', + 'm4/iconv_h.m4', + 'm4/iconv_open.m4', + 'm4/include_next.m4', + 'm4/inet_pton.m4', + 'm4/inline.m4', + 'm4/intlmacosx.m4', + 'm4/intmax_t.m4', + 'm4/inttostr.m4', + 'm4/inttypes-pri.m4', + 'm4/inttypes.m4', + 'm4/inttypes_h.m4', + 'm4/ioctl.m4', + 'm4/isblank.m4', + 'm4/iswblank.m4', + 'm4/langinfo_h.m4', + 'm4/largefile.m4', + 'm4/lib-ld.m4', + 'm4/lib-link.m4', + 'm4/lib-prefix.m4', + 'm4/libsigsegv.m4', + 'm4/libunistring-base.m4', + 'm4/limits-h.m4', + 'm4/localcharset.m4', + 'm4/locale-fr.m4', + 'm4/locale-ja.m4', + 'm4/locale-tr.m4', + 'm4/locale-zh.m4', + 'm4/locale_h.m4', + 'm4/localeconv.m4', + 'm4/localtime-buffer.m4', + 'm4/longlong.m4', + 'm4/lstat.m4', + 'm4/malloc.m4', + 'm4/malloca.m4', + 'm4/manywarnings.m4', + 'm4/mbchar.m4', + 'm4/mbiter.m4', + 'm4/mbrtowc.m4', + 'm4/mbsinit.m4', + 'm4/mbslen.m4', + 'm4/mbsrtowcs.m4', + 'm4/mbstate_t.m4', + 'm4/mbtowc.m4', + 'm4/memchr.m4', + 'm4/minmax.m4', + 'm4/mkstemp.m4', + 'm4/mktime.m4', + 'm4/mmap-anon.m4', + 'm4/mode_t.m4', + 'm4/msvc-inval.m4', + 'm4/msvc-nothrow.m4', + 'm4/multiarch.m4', + 'm4/nanosleep.m4', + 'm4/netinet_in_h.m4', + 'm4/nl_langinfo.m4', + 'm4/nls.m4', + 'm4/nocrash.m4', + 'm4/off_t.m4', + 'm4/open.m4', + 'm4/pathmax.m4', + 'm4/perror.m4', + 'm4/pipe.m4', + 'm4/po.m4', + 'm4/printf.m4', + 'm4/progtest.m4', + 'm4/putenv.m4', + 'm4/quote.m4', + 'm4/quotearg.m4', + 'm4/raise.m4', + 'm4/rawmemchr.m4', + 'm4/readlink.m4', + 'm4/regex.m4', + 'm4/secure_getenv.m4', + 'm4/select.m4', + 'm4/setenv.m4', + 'm4/setlocale.m4', + 'm4/sigaction.m4', + 'm4/signal_h.m4', + 'm4/signalblocking.m4', + 'm4/size_max.m4', + 'm4/sleep.m4', + 'm4/snprintf.m4', + 'm4/socketlib.m4', + 'm4/sockets.m4', + 'm4/socklen.m4', + 'm4/sockpfaf.m4', + 'm4/ssize_t.m4', + 'm4/stat-time.m4', + 'm4/stat.m4', + 'm4/stdalign.m4', + 'm4/stdarg.m4', + 'm4/stdbool.m4', + 'm4/stddef_h.m4', + 'm4/stdint.m4', + 'm4/stdint_h.m4', + 'm4/stdio_h.m4', + 'm4/stdlib_h.m4', + 'm4/strcase.m4', + 'm4/strerror.m4', + 'm4/strerror_r.m4', + 'm4/strftime.m4', + 'm4/string_h.m4', + 'm4/strings_h.m4', + 'm4/strndup.m4', + 'm4/strnlen.m4', + 'm4/strptime.m4', + 'm4/strtoull.m4', + 'm4/strtoumax.m4', + 'm4/symlink.m4', + 'm4/sys_ioctl_h.m4', + 'm4/sys_select_h.m4', + 'm4/sys_socket_h.m4', + 'm4/sys_stat_h.m4', + 'm4/sys_time_h.m4', + 'm4/sys_types_h.m4', + 'm4/sys_uio_h.m4', + 'm4/sys_wait_h.m4', + 'm4/tempname.m4', + 'm4/time_h.m4', + 'm4/time_r.m4', + 'm4/time_rz.m4', + 'm4/timegm.m4', + 'm4/timespec.m4', + 'm4/tm_gmtoff.m4', + 'm4/tzset.m4', + 'm4/unistd_h.m4', + 'm4/unlocked-io.m4', + 'm4/vararrays.m4', + 'm4/vasnprintf.m4', + 'm4/vasprintf.m4', + 'm4/version-etc.m4', + 'm4/warn-on-use.m4', + 'm4/warnings.m4', + 'm4/wchar_h.m4', + 'm4/wchar_t.m4', + 'm4/wcrtomb.m4', + 'm4/wctob.m4', + 'm4/wctomb.m4', + 'm4/wctype_h.m4', + 'm4/wcwidth.m4', + 'm4/wint_t.m4', + 'm4/xalloc.m4', + 'm4/xsize.m4', + 'm4/xstrndup.m4', + 'm4/xstrtol.m4', + 'm4/xvasprintf.m4', + 'configure.ac' + ], + { + 'AC_' => 1, + 'AC_CHECK_HEADER_STDBOOL' => 1, + 'AC_COMPUTE_INT' => 1, + 'AC_CONFIG_MACRO_DIR' => 1, + 'AC_CONFIG_MACRO_DIR_TRACE' => 1, + 'AC_C_FLEXIBLE_ARRAY_MEMBER' => 1, + 'AC_C_RESTRICT' => 1, + 'AC_C_VARARRAYS' => 1, + 'AC_DEFUN' => 1, + 'AC_DEFUN_ONCE' => 1, + 'AC_FUNC_MBRTOWC' => 1, + 'AC_HEADER_MAJOR' => 1, + 'AC_LIB_APPENDTOVAR' => 1, + 'AC_LIB_ARG_WITH' => 1, + 'AC_LIB_FROMPACKAGE' => 1, + 'AC_LIB_HAVE_LINKFLAGS' => 1, + 'AC_LIB_LINKFLAGS' => 1, + 'AC_LIB_LINKFLAGS_BODY' => 1, + 'AC_LIB_LINKFLAGS_FROM_LIBS' => 1, + 'AC_LIB_PREFIX' => 1, + 'AC_LIB_PREPARE_MULTILIB' => 1, + 'AC_LIB_PREPARE_PREFIX' => 1, + 'AC_LIB_PROG_LD' => 1, + 'AC_LIB_PROG_LD_GNU' => 1, + 'AC_LIB_RPATH' => 1, + 'AC_LIB_WITH_FINAL_PREFIX' => 1, + 'AC_PROG_MKDIR_P' => 1, + 'AC_PROG_SED' => 1, + 'AC_SYS_LARGEFILE' => 1, + 'AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC' => 1, + 'AC_TYPE_LONG_LONG_INT' => 1, + 'AC_TYPE_MBSTATE_T' => 1, + 'AC_TYPE_UNSIGNED_LONG_LONG_INT' => 1, + 'AC_USE_SYSTEM_EXTENSIONS' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'AM_AUX_DIR_EXPAND' => 1, + 'AM_CONDITIONAL' => 1, + 'AM_DEP_TRACK' => 1, + 'AM_GNU_GETTEXT' => 1, + 'AM_GNU_GETTEXT_NEED' => 1, + 'AM_GNU_GETTEXT_VERSION' => 1, + 'AM_ICONV' => 1, + 'AM_ICONV_LINK' => 1, + 'AM_ICONV_LINKFLAGS_BODY' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AM_LANGINFO_CODESET' => 1, + 'AM_MAKE_INCLUDE' => 1, + 'AM_MISSING_HAS_RUN' => 1, + 'AM_MISSING_PROG' => 1, + 'AM_NLS' => 1, + 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AM_PATH_PROG_WITH_TEST' => 1, + 'AM_POSTPROCESS_PO_MAKEFILE' => 1, + 'AM_PO_SUBDIRS' => 1, + 'AM_PROG_CC_C_O' => 1, + 'AM_PROG_INSTALL_SH' => 1, + 'AM_PROG_INSTALL_STRIP' => 1, + 'AM_PROG_MKDIR_P' => 1, + 'AM_RUN_LOG' => 1, + 'AM_SANITY_CHECK' => 1, + 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, + 'AM_SET_DEPDIR' => 1, + 'AM_SET_LEADING_DOT' => 1, + 'AM_SILENT_RULES' => 1, + 'AM_STDBOOL_H' => 1, + 'AM_SUBST_NOTMAKE' => 1, + 'AM_XGETTEXT_OPTION' => 1, + 'AM_XGETTEXT_OPTION_INIT' => 1, + 'AU_DEFUN' => 1, + 'GL_NOCRASH' => 1, + '_AC_AM_CONFIG_HEADER_HOOK' => 1, + '_AC_FUNC_MALLOC_IF' => 1, + '_AC_TYPE_LONG_LONG_SNIPPET' => 1, + '_AM_AUTOCONF_VERSION' => 1, + '_AM_CONFIG_MACRO_DIRS' => 1, + '_AM_DEPENDENCIES' => 1, + '_AM_FILESYSTEM_TIMESTAMP_RESOLUTION' => 1, + '_AM_IF_OPTION' => 1, + '_AM_MANGLE_OPTION' => 1, + '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + '_AM_PROG_CC_C_O' => 1, + '_AM_PROG_RM_F' => 1, + '_AM_PROG_TAR' => 1, + '_AM_PROG_XARGS_N' => 1, + '_AM_SET_OPTION' => 1, + '_AM_SET_OPTIONS' => 1, + '_AM_SILENT_RULES' => 1, + '_AM_SLEEP_FRACTIONAL_SECONDS' => 1, + '_AM_SUBST_NOTMAKE' => 1, + '_m4_warn' => 1, + 'gl_00GNULIB' => 1, + 'gl_ABSOLUTE_HEADER' => 1, + 'gl_ABSOLUTE_HEADER_ONE' => 1, + 'gl_AC_HEADER_INTTYPES_H' => 1, + 'gl_AC_HEADER_STDINT_H' => 1, + 'gl_AC_TYPE_INTMAX_T' => 1, + 'gl_ARPA_INET_H_DEFAULTS' => 1, + 'gl_ARPA_INET_MODULE_INDICATOR' => 1, + 'gl_ASSERT_NO_GNULIB_POSIXCHECK' => 1, + 'gl_ASSERT_NO_GNULIB_TESTS' => 1, + 'gl_BIGENDIAN' => 1, + 'gl_CACHE_VAL_SILENT' => 1, + 'gl_CHECK_MALLOC_POSIX' => 1, + 'gl_CHECK_NEXT_HEADERS' => 1, + 'gl_CHECK_SOCKET_HEADERS' => 1, + 'gl_CHECK_TYPES_SIGNED' => 1, + 'gl_CHECK_TYPE_SIGSET_T' => 1, + 'gl_CHECK_TYPE_STRUCT_TIMESPEC' => 1, + 'gl_CLOCK_TIME' => 1, + 'gl_COMMON' => 1, + 'gl_COMMON_BODY' => 1, + 'gl_COMPILER_OPTION_IF' => 1, + 'gl_CONFIGMAKE_PREP' => 1, + 'gl_CONFIG_H' => 1, + 'gl_CTYPE_H' => 1, + 'gl_CTYPE_H_DEFAULTS' => 1, + 'gl_CTYPE_MODULE_INDICATOR' => 1, + 'gl_C_STACK' => 1, + 'gl_DIRNAME' => 1, + 'gl_DIRNAME_LGPL' => 1, + 'gl_DOUBLE_EXPONENT_LOCATION' => 1, + 'gl_DOUBLE_SLASH_ROOT' => 1, + 'gl_EARLY' => 1, + 'gl_EEALLOC' => 1, + 'gl_EEMALLOC' => 1, + 'gl_EEREALLOC' => 1, + 'gl_ENVIRON' => 1, + 'gl_ERROR' => 1, + 'gl_EXTERN_INLINE' => 1, + 'gl_FCNTL_H' => 1, + 'gl_FCNTL_H_DEFAULTS' => 1, + 'gl_FCNTL_MODULE_INDICATOR' => 1, + 'gl_FCNTL_O_FLAGS' => 1, + 'gl_FEATURES_H' => 1, + 'gl_FILE_LIST' => 1, + 'gl_FILE_NAME_CONCAT' => 1, + 'gl_FILE_NAME_CONCAT_LGPL' => 1, + 'gl_FLOAT_H' => 1, + 'gl_FP_IEEE' => 1, + 'gl_FUNC_ALLOCA' => 1, + 'gl_FUNC_BTOWC' => 1, + 'gl_FUNC_CLOSE' => 1, + 'gl_FUNC_DUP2' => 1, + 'gl_FUNC_FCNTL' => 1, + 'gl_FUNC_FDOPEN' => 1, + 'gl_FUNC_FNMATCH_GNU' => 1, + 'gl_FUNC_FNMATCH_POSIX' => 1, + 'gl_FUNC_FREOPEN' => 1, + 'gl_FUNC_FSTAT' => 1, + 'gl_FUNC_FTRUNCATE' => 1, + 'gl_FUNC_GEN_TEMPNAME' => 1, + 'gl_FUNC_GETCWD' => 1, + 'gl_FUNC_GETCWD_LGPL' => 1, + 'gl_FUNC_GETCWD_NULL' => 1, + 'gl_FUNC_GETCWD_SIGNATURE' => 1, + 'gl_FUNC_GETDTABLESIZE' => 1, + 'gl_FUNC_GETOPT_GNU' => 1, + 'gl_FUNC_GETOPT_POSIX' => 1, + 'gl_FUNC_GETPAGESIZE' => 1, + 'gl_FUNC_GETPROGNAME' => 1, + 'gl_FUNC_GETTIMEOFDAY' => 1, + 'gl_FUNC_GETTIMEOFDAY_CLOBBER' => 1, + 'gl_FUNC_GLIBC_UNLOCKED_IO' => 1, + 'gl_FUNC_GNU_STRFTIME' => 1, + 'gl_FUNC_ICONV_OPEN' => 1, + 'gl_FUNC_INET_PTON' => 1, + 'gl_FUNC_IOCTL' => 1, + 'gl_FUNC_ISBLANK' => 1, + 'gl_FUNC_ISWBLANK' => 1, + 'gl_FUNC_LOCALECONV' => 1, + 'gl_FUNC_LSTAT' => 1, + 'gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1, + 'gl_FUNC_MALLOC_GNU' => 1, + 'gl_FUNC_MALLOC_POSIX' => 1, + 'gl_FUNC_MBRTOWC' => 1, + 'gl_FUNC_MBSINIT' => 1, + 'gl_FUNC_MBSLEN' => 1, + 'gl_FUNC_MBSRTOWCS' => 1, + 'gl_FUNC_MBTOWC' => 1, + 'gl_FUNC_MEMCHR' => 1, + 'gl_FUNC_MKSTEMP' => 1, + 'gl_FUNC_MKTIME' => 1, + 'gl_FUNC_MKTIME_INTERNAL' => 1, + 'gl_FUNC_MKTIME_WORKS' => 1, + 'gl_FUNC_MMAP_ANON' => 1, + 'gl_FUNC_NANOSLEEP' => 1, + 'gl_FUNC_NL_LANGINFO' => 1, + 'gl_FUNC_OPEN' => 1, + 'gl_FUNC_PERROR' => 1, + 'gl_FUNC_PIPE' => 1, + 'gl_FUNC_PUTENV' => 1, + 'gl_FUNC_RAISE' => 1, + 'gl_FUNC_RAWMEMCHR' => 1, + 'gl_FUNC_READLINK' => 1, + 'gl_FUNC_READLINK_SEPARATE' => 1, + 'gl_FUNC_SECURE_GETENV' => 1, + 'gl_FUNC_SELECT' => 1, + 'gl_FUNC_SETENV' => 1, + 'gl_FUNC_SETENV_SEPARATE' => 1, + 'gl_FUNC_SETLOCALE' => 1, + 'gl_FUNC_SLEEP' => 1, + 'gl_FUNC_SNPRINTF' => 1, + 'gl_FUNC_STAT' => 1, + 'gl_FUNC_STRCASECMP' => 1, + 'gl_FUNC_STRERROR' => 1, + 'gl_FUNC_STRERROR_0' => 1, + 'gl_FUNC_STRERROR_R' => 1, + 'gl_FUNC_STRERROR_R_WORKS' => 1, + 'gl_FUNC_STRNCASECMP' => 1, + 'gl_FUNC_STRNDUP' => 1, + 'gl_FUNC_STRNLEN' => 1, + 'gl_FUNC_STRPTIME' => 1, + 'gl_FUNC_STRTOULL' => 1, + 'gl_FUNC_STRTOUMAX' => 1, + 'gl_FUNC_SYMLINK' => 1, + 'gl_FUNC_TIMEGM' => 1, + 'gl_FUNC_TZSET' => 1, + 'gl_FUNC_TZSET_CLOBBER' => 1, + 'gl_FUNC_UNSETENV' => 1, + 'gl_FUNC_VASNPRINTF' => 1, + 'gl_FUNC_VASPRINTF' => 1, + 'gl_FUNC_WCRTOMB' => 1, + 'gl_FUNC_WCTOB' => 1, + 'gl_FUNC_WCTOMB' => 1, + 'gl_FUNC_WCWIDTH' => 1, + 'gl_GETOPT_CHECK_HEADERS' => 1, + 'gl_GETOPT_SUBSTITUTE_HEADER' => 1, + 'gl_GETTIME' => 1, + 'gl_GLIBC21' => 1, + 'gl_GNU_MAKE' => 1, + 'gl_HARD_LOCALE' => 1, + 'gl_HEADER_ARPA_INET' => 1, + 'gl_HEADER_ERRNO_H' => 1, + 'gl_HEADER_NETINET_IN' => 1, + 'gl_HEADER_STRINGS_H' => 1, + 'gl_HEADER_STRINGS_H_BODY' => 1, + 'gl_HEADER_STRINGS_H_DEFAULTS' => 1, + 'gl_HEADER_STRING_H' => 1, + 'gl_HEADER_STRING_H_BODY' => 1, + 'gl_HEADER_STRING_H_DEFAULTS' => 1, + 'gl_HEADER_SYS_SELECT' => 1, + 'gl_HEADER_SYS_SOCKET' => 1, + 'gl_HEADER_SYS_STAT_H' => 1, + 'gl_HEADER_SYS_TIME_H' => 1, + 'gl_HEADER_SYS_TIME_H_BODY' => 1, + 'gl_HEADER_SYS_TIME_H_DEFAULTS' => 1, + 'gl_HEADER_SYS_UIO' => 1, + 'gl_HEADER_TIME_H' => 1, + 'gl_HEADER_TIME_H_BODY' => 1, + 'gl_HEADER_TIME_H_DEFAULTS' => 1, + 'gl_ICONV_H' => 1, + 'gl_ICONV_H_DEFAULTS' => 1, + 'gl_ICONV_MODULE_INDICATOR' => 1, + 'gl_INCLUDE_NEXT' => 1, + 'gl_INIT' => 1, + 'gl_INLINE' => 1, + 'gl_INTEGER_TYPE_SUFFIX' => 1, + 'gl_INTTOSTR' => 1, + 'gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION' => 1, + 'gl_INTTYPES_H' => 1, + 'gl_INTTYPES_H_DEFAULTS' => 1, + 'gl_INTTYPES_INCOMPLETE' => 1, + 'gl_INTTYPES_MODULE_INDICATOR' => 1, + 'gl_INTTYPES_PRI_SCN' => 1, + 'gl_LANGINFO_H' => 1, + 'gl_LANGINFO_H_DEFAULTS' => 1, + 'gl_LANGINFO_MODULE_INDICATOR' => 1, + 'gl_LARGEFILE' => 1, + 'gl_LIBOBJ' => 1, + 'gl_LIBSIGSEGV' => 1, + 'gl_LIBSOURCES' => 1, + 'gl_LIBUNISTRING_LIBHEADER' => 1, + 'gl_LIBUNISTRING_LIB_PREPARE' => 1, + 'gl_LIBUNISTRING_MODULE' => 1, + 'gl_LIBUNISTRING_VERSION_CMP' => 1, + 'gl_LIMITS_H' => 1, + 'gl_LOCALCHARSET' => 1, + 'gl_LOCALE_H' => 1, + 'gl_LOCALE_H_DEFAULTS' => 1, + 'gl_LOCALE_MODULE_INDICATOR' => 1, + 'gl_LOCALTIME_BUFFER_DEFAULTS' => 1, + 'gl_LOCALTIME_BUFFER_NEEDED' => 1, + 'gl_MALLOCA' => 1, + 'gl_MANYWARN_ALL_GCC' => 1, + 'gl_MANYWARN_COMPLEMENT' => 1, + 'gl_MBCHAR' => 1, + 'gl_MBITER' => 1, + 'gl_MBRTOWC_C_LOCALE' => 1, + 'gl_MBRTOWC_EMPTY_INPUT' => 1, + 'gl_MBRTOWC_INCOMPLETE_STATE' => 1, + 'gl_MBRTOWC_NULL_ARG1' => 1, + 'gl_MBRTOWC_NULL_ARG2' => 1, + 'gl_MBRTOWC_NUL_RETVAL' => 1, + 'gl_MBRTOWC_RETVAL' => 1, + 'gl_MBRTOWC_SANITYCHECK' => 1, + 'gl_MBSRTOWCS_WORKS' => 1, + 'gl_MBSTATE_T_BROKEN' => 1, + 'gl_MINMAX' => 1, + 'gl_MINMAX_IN_HEADER' => 1, + 'gl_MODULE_INDICATOR' => 1, + 'gl_MODULE_INDICATOR_FOR_TESTS' => 1, + 'gl_MODULE_INDICATOR_SET_VARIABLE' => 1, + 'gl_MODULE_INDICATOR_SET_VARIABLE_AUX' => 1, + 'gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR' => 1, + 'gl_MSVC_INVAL' => 1, + 'gl_MSVC_NOTHROW' => 1, + 'gl_MULTIARCH' => 1, + 'gl_NEXT_HEADERS' => 1, + 'gl_NEXT_HEADERS_INTERNAL' => 1, + 'gl_PATHMAX' => 1, + 'gl_PATHMAX_SNIPPET' => 1, + 'gl_PATHMAX_SNIPPET_PREREQ' => 1, + 'gl_PREREQ_ALLOCA' => 1, + 'gl_PREREQ_ASNPRINTF' => 1, + 'gl_PREREQ_ASPRINTF' => 1, + 'gl_PREREQ_BTOWC' => 1, + 'gl_PREREQ_C_STACK' => 1, + 'gl_PREREQ_DUP2' => 1, + 'gl_PREREQ_ERROR' => 1, + 'gl_PREREQ_FDOPEN' => 1, + 'gl_PREREQ_FNMATCH' => 1, + 'gl_PREREQ_FREOPEN' => 1, + 'gl_PREREQ_FSTAT' => 1, + 'gl_PREREQ_FTRUNCATE' => 1, + 'gl_PREREQ_GETCWD' => 1, + 'gl_PREREQ_GETDTABLESIZE' => 1, + 'gl_PREREQ_GETTIMEOFDAY' => 1, + 'gl_PREREQ_IMAXTOSTR' => 1, + 'gl_PREREQ_INET_PTON' => 1, + 'gl_PREREQ_INTTOSTR' => 1, + 'gl_PREREQ_LOCALECONV' => 1, + 'gl_PREREQ_LSTAT' => 1, + 'gl_PREREQ_MBRTOWC' => 1, + 'gl_PREREQ_MBSINIT' => 1, + 'gl_PREREQ_MBSRTOWCS' => 1, + 'gl_PREREQ_MBTOWC' => 1, + 'gl_PREREQ_MEMCHR' => 1, + 'gl_PREREQ_MINMAX' => 1, + 'gl_PREREQ_MKSTEMP' => 1, + 'gl_PREREQ_MKTIME' => 1, + 'gl_PREREQ_NANOSLEEP' => 1, + 'gl_PREREQ_OFFTOSTR' => 1, + 'gl_PREREQ_OPEN' => 1, + 'gl_PREREQ_PRINTF_ARGS' => 1, + 'gl_PREREQ_PRINTF_PARSE' => 1, + 'gl_PREREQ_PUTENV' => 1, + 'gl_PREREQ_RAISE' => 1, + 'gl_PREREQ_RAWMEMCHR' => 1, + 'gl_PREREQ_READLINK' => 1, + 'gl_PREREQ_REGEX' => 1, + 'gl_PREREQ_SECURE_GETENV' => 1, + 'gl_PREREQ_SETENV' => 1, + 'gl_PREREQ_SETLOCALE' => 1, + 'gl_PREREQ_SIGACTION' => 1, + 'gl_PREREQ_SIGPROCMASK' => 1, + 'gl_PREREQ_SIG_HANDLER_H' => 1, + 'gl_PREREQ_SNPRINTF' => 1, + 'gl_PREREQ_SOCKETS' => 1, + 'gl_PREREQ_STAT' => 1, + 'gl_PREREQ_STRCASECMP' => 1, + 'gl_PREREQ_STRERROR_R' => 1, + 'gl_PREREQ_STRNCASECMP' => 1, + 'gl_PREREQ_STRNLEN' => 1, + 'gl_PREREQ_STRPTIME' => 1, + 'gl_PREREQ_STRTOULL' => 1, + 'gl_PREREQ_STRTOUMAX' => 1, + 'gl_PREREQ_SYS_H_SOCKET' => 1, + 'gl_PREREQ_SYS_H_WINSOCK2' => 1, + 'gl_PREREQ_TEMPNAME' => 1, + 'gl_PREREQ_TIMEGM' => 1, + 'gl_PREREQ_TIME_R' => 1, + 'gl_PREREQ_UINTTOSTR' => 1, + 'gl_PREREQ_UMAXTOSTR' => 1, + 'gl_PREREQ_UNSETENV' => 1, + 'gl_PREREQ_VASNPRINTF' => 1, + 'gl_PREREQ_VASNPRINTF_DIRECTIVE_A' => 1, + 'gl_PREREQ_VASNPRINTF_DIRECTIVE_F' => 1, + 'gl_PREREQ_VASNPRINTF_DIRECTIVE_LS' => 1, + 'gl_PREREQ_VASNPRINTF_ENOMEM' => 1, + 'gl_PREREQ_VASNPRINTF_FLAG_GROUPING' => 1, + 'gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST' => 1, + 'gl_PREREQ_VASNPRINTF_FLAG_ZERO' => 1, + 'gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE' => 1, + 'gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE' => 1, + 'gl_PREREQ_VASNPRINTF_LONG_DOUBLE' => 1, + 'gl_PREREQ_VASNPRINTF_PRECISION' => 1, + 'gl_PREREQ_VASNPRINTF_WITH_EXTRAS' => 1, + 'gl_PREREQ_VASPRINTF' => 1, + 'gl_PREREQ_VASPRINTF_H' => 1, + 'gl_PREREQ_WCRTOMB' => 1, + 'gl_PREREQ_WCTOB' => 1, + 'gl_PREREQ_WCTOMB' => 1, + 'gl_PREREQ_XSTRNDUP' => 1, + 'gl_PRINTF_DIRECTIVE_A' => 1, + 'gl_PRINTF_DIRECTIVE_F' => 1, + 'gl_PRINTF_DIRECTIVE_LS' => 1, + 'gl_PRINTF_DIRECTIVE_N' => 1, + 'gl_PRINTF_ENOMEM' => 1, + 'gl_PRINTF_FLAG_GROUPING' => 1, + 'gl_PRINTF_FLAG_LEFTADJUST' => 1, + 'gl_PRINTF_FLAG_ZERO' => 1, + 'gl_PRINTF_INFINITE' => 1, + 'gl_PRINTF_INFINITE_LONG_DOUBLE' => 1, + 'gl_PRINTF_LONG_DOUBLE' => 1, + 'gl_PRINTF_POSITIONS' => 1, + 'gl_PRINTF_PRECISION' => 1, + 'gl_PRINTF_SIZES_C99' => 1, + 'gl_PROG_AR_RANLIB' => 1, + 'gl_PROG_CC_C99' => 1, + 'gl_PROMOTED_TYPE_MODE_T' => 1, + 'gl_QUOTE' => 1, + 'gl_QUOTEARG' => 1, + 'gl_REGEX' => 1, + 'gl_REPLACE_ERRNO_VALUE' => 1, + 'gl_REPLACE_FCNTL' => 1, + 'gl_REPLACE_FUNCS' => 1, + 'gl_REPLACE_ICONV_H' => 1, + 'gl_REPLACE_ICONV_OPEN' => 1, + 'gl_REPLACE_SNPRINTF' => 1, + 'gl_REPLACE_VASNPRINTF' => 1, + 'gl_REPLACE_VASPRINTF' => 1, + 'gl_SIGACTION' => 1, + 'gl_SIGNALBLOCKING' => 1, + 'gl_SIGNAL_H' => 1, + 'gl_SIGNAL_H_DEFAULTS' => 1, + 'gl_SIGNAL_MODULE_INDICATOR' => 1, + 'gl_SIZE_MAX' => 1, + 'gl_SNPRINTF_DIRECTIVE_N' => 1, + 'gl_SNPRINTF_PRESENCE' => 1, + 'gl_SNPRINTF_RETVAL_C99' => 1, + 'gl_SNPRINTF_SIZE1' => 1, + 'gl_SNPRINTF_TRUNCATION_C99' => 1, + 'gl_SOCKETLIB' => 1, + 'gl_SOCKETS' => 1, + 'gl_SOCKET_FAMILIES' => 1, + 'gl_SOCKET_FAMILY_UNIX' => 1, + 'gl_SOCKET_HEADERS' => 1, + 'gl_STAT_BIRTHTIME' => 1, + 'gl_STAT_TIME' => 1, + 'gl_STDALIGN_H' => 1, + 'gl_STDARG_H' => 1, + 'gl_STDBOOL_H' => 1, + 'gl_STDDEF_H' => 1, + 'gl_STDDEF_H_DEFAULTS' => 1, + 'gl_STDDEF_MODULE_INDICATOR' => 1, + 'gl_STDINT_BITSIZEOF' => 1, + 'gl_STDINT_H' => 1, + 'gl_STDINT_INCLUDES' => 1, + 'gl_STDINT_TYPE_PROPERTIES' => 1, + 'gl_STDIO_H' => 1, + 'gl_STDIO_H_DEFAULTS' => 1, + 'gl_STDIO_MODULE_INDICATOR' => 1, + 'gl_STDLIB_H' => 1, + 'gl_STDLIB_H_DEFAULTS' => 1, + 'gl_STDLIB_MODULE_INDICATOR' => 1, + 'gl_STRCASE' => 1, + 'gl_STRINGS_MODULE_INDICATOR' => 1, + 'gl_STRING_MODULE_INDICATOR' => 1, + 'gl_SYS_IOCTL_H' => 1, + 'gl_SYS_IOCTL_H_DEFAULTS' => 1, + 'gl_SYS_IOCTL_MODULE_INDICATOR' => 1, + 'gl_SYS_SELECT_H_DEFAULTS' => 1, + 'gl_SYS_SELECT_MODULE_INDICATOR' => 1, + 'gl_SYS_SOCKET_H_DEFAULTS' => 1, + 'gl_SYS_SOCKET_MODULE_INDICATOR' => 1, + 'gl_SYS_STAT_H_DEFAULTS' => 1, + 'gl_SYS_STAT_MODULE_INDICATOR' => 1, + 'gl_SYS_TIME_MODULE_INDICATOR' => 1, + 'gl_SYS_TYPES_H' => 1, + 'gl_SYS_TYPES_H_DEFAULTS' => 1, + 'gl_SYS_UIO_H_DEFAULTS' => 1, + 'gl_SYS_UIO_MODULE_INDICATOR' => 1, + 'gl_SYS_WAIT_H' => 1, + 'gl_SYS_WAIT_H_DEFAULTS' => 1, + 'gl_SYS_WAIT_MODULE_INDICATOR' => 1, + 'gl_TIMESPEC' => 1, + 'gl_TIME_MODULE_INDICATOR' => 1, + 'gl_TIME_R' => 1, + 'gl_TIME_RZ' => 1, + 'gl_TIME_T_IS_SIGNED' => 1, + 'gl_TM_GMTOFF' => 1, + 'gl_TYPE_OFF_T' => 1, + 'gl_TYPE_SOCKLEN_T' => 1, + 'gl_TYPE_WINT_T_PREREQ' => 1, + 'gl_UNISTD_H' => 1, + 'gl_UNISTD_H_DEFAULTS' => 1, + 'gl_UNISTD_MODULE_INDICATOR' => 1, + 'gl_UNKNOWN_WARNINGS_ARE_ERRORS' => 1, + 'gl_USE_SYSTEM_EXTENSIONS' => 1, + 'gl_VERSION_ETC' => 1, + 'gl_VSNPRINTF_ZEROSIZE_C99' => 1, + 'gl_W' => 1, + 'gl_WARN_ADD' => 1, + 'gl_WARN_ON_USE_PREPARE' => 1, + 'gl_WCHAR_H' => 1, + 'gl_WCHAR_H_DEFAULTS' => 1, + 'gl_WCHAR_H_INLINE_OK' => 1, + 'gl_WCHAR_MODULE_INDICATOR' => 1, + 'gl_WCTYPE_H' => 1, + 'gl_WCTYPE_H_DEFAULTS' => 1, + 'gl_WCTYPE_MODULE_INDICATOR' => 1, + 'gl_XALLOC' => 1, + 'gl_XSIZE' => 1, + 'gl_XSTRNDUP' => 1, + 'gl_XSTRTOL' => 1, + 'gl_XVASPRINTF' => 1, + 'gl___BUILTIN_EXPECT' => 1, + 'gltests_LIBOBJ' => 1, + 'gltests_LIBSOURCES' => 1, + 'gltests_REPLACE_FUNCS' => 1, + 'gt_AC_TYPE_INTMAX_T' => 1, + 'gt_CHECK_VAR_DECL' => 1, + 'gt_INTL_MACOSX' => 1, + 'gt_INTTYPES_PRI' => 1, + 'gt_LOCALE_FR' => 1, + 'gt_LOCALE_FR_UTF8' => 1, + 'gt_LOCALE_JA' => 1, + 'gt_LOCALE_TR_UTF8' => 1, + 'gt_LOCALE_ZH_CN' => 1, + 'gt_TYPE_SSIZE_T' => 1, + 'gt_TYPE_WCHAR_T' => 1, + 'gt_TYPE_WINT_T' => 1, + 'include' => 1, + 'm4_include' => 1, + 'm4_pattern_allow' => 1, + 'm4_pattern_forbid' => 1 + } + ], 'Autom4te::Request' ), + bless( [ + '1', + 1, + [ + '/usr/share/autoconf' + ], + [ + '/usr/share/autoconf/autoconf/autoconf.m4f', + 'aclocal.m4', + 'configure.ac' + ], + { + 'AC_CANONICAL_BUILD' => 1, + 'AC_CANONICAL_HOST' => 1, + 'AC_CANONICAL_SYSTEM' => 1, + 'AC_CANONICAL_TARGET' => 1, + 'AC_CONFIG_AUX_DIR' => 1, + 'AC_CONFIG_FILES' => 1, + 'AC_CONFIG_HEADERS' => 1, + 'AC_CONFIG_LIBOBJ_DIR' => 1, + 'AC_CONFIG_LINKS' => 1, + 'AC_CONFIG_MACRO_DIR_TRACE' => 1, + 'AC_CONFIG_SUBDIRS' => 1, + 'AC_DEFINE_TRACE_LITERAL' => 1, + 'AC_FC_FREEFORM' => 1, + 'AC_FC_PP_DEFINE' => 1, + 'AC_FC_PP_SRCEXT' => 1, + 'AC_FC_SRCEXT' => 1, + 'AC_INIT' => 1, + 'AC_LIBSOURCE' => 1, + 'AC_PROG_LIBTOOL' => 1, + 'AC_REQUIRE_AUX_FILE' => 1, + 'AC_SUBST' => 1, + 'AC_SUBST_TRACE' => 1, + 'AH_OUTPUT' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'AM_CONDITIONAL' => 1, + 'AM_ENABLE_MULTILIB' => 1, + 'AM_EXTRA_RECURSIVE_TARGETS' => 1, + 'AM_GNU_GETTEXT' => 1, + 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AM_MAINTAINER_MODE' => 1, + 'AM_MAKEFILE_INCLUDE' => 1, + 'AM_NLS' => 1, + 'AM_PATH_GUILE' => 1, + 'AM_POT_TOOLS' => 1, + 'AM_PROG_AR' => 1, + 'AM_PROG_CC_C_O' => 1, + 'AM_PROG_CXX_C_O' => 1, + 'AM_PROG_F77_C_O' => 1, + 'AM_PROG_FC_C_O' => 1, + 'AM_PROG_LIBTOOL' => 1, + 'AM_PROG_MKDIR_P' => 1, + 'AM_PROG_MOC' => 1, + 'AM_SILENT_RULES' => 1, + 'AM_XGETTEXT_OPTION' => 1, + 'GTK_DOC_CHECK' => 1, + 'IT_PROG_INTLTOOL' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + 'LT_INIT' => 1, + 'LT_SUPPORTED_TAG' => 1, + '_AM_COND_ELSE' => 1, + '_AM_COND_ENDIF' => 1, + '_AM_COND_IF' => 1, + '_AM_MAKEFILE_INCLUDE' => 1, + '_AM_SUBST_NOTMAKE' => 1, + '_LT_AC_TAGCONFIG' => 1, + '_m4_warn' => 1, + 'include' => 1, + 'm4_include' => 1, + 'm4_pattern_allow' => 1, + 'm4_pattern_forbid' => 1, + 'm4_sinclude' => 1, + 'sinclude' => 1 + } + ], 'Autom4te::Request' ), + bless( [ + '2', + 1, + [ + '/usr/share/autoconf' + ], + [ + '/usr/share/autoconf/autoconf/autoconf.m4f', + 'aclocal.m4', + '/usr/share/autoconf/autoconf/trailer.m4', + 'configure.ac' + ], + { + 'AC_CANONICAL_BUILD' => 1, + 'AC_CANONICAL_HOST' => 1, + 'AC_CANONICAL_SYSTEM' => 1, + 'AC_CANONICAL_TARGET' => 1, + 'AC_CONFIG_AUX_DIR' => 1, + 'AC_CONFIG_FILES' => 1, + 'AC_CONFIG_HEADERS' => 1, + 'AC_CONFIG_LIBOBJ_DIR' => 1, + 'AC_CONFIG_LINKS' => 1, + 'AC_CONFIG_MACRO_DIR_TRACE' => 1, + 'AC_CONFIG_SUBDIRS' => 1, + 'AC_DEFINE_TRACE_LITERAL' => 1, + 'AC_FC_FREEFORM' => 1, + 'AC_FC_PP_DEFINE' => 1, + 'AC_FC_PP_SRCEXT' => 1, + 'AC_FC_SRCEXT' => 1, + 'AC_INIT' => 1, + 'AC_LIBSOURCE' => 1, + 'AC_PROG_LIBTOOL' => 1, + 'AC_REQUIRE_AUX_FILE' => 1, + 'AC_SUBST' => 1, + 'AC_SUBST_TRACE' => 1, + 'AH_OUTPUT' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'AM_CONDITIONAL' => 1, + 'AM_ENABLE_MULTILIB' => 1, + 'AM_EXTRA_RECURSIVE_TARGETS' => 1, + 'AM_GNU_GETTEXT' => 1, + 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AM_MAINTAINER_MODE' => 1, + 'AM_MAKEFILE_INCLUDE' => 1, + 'AM_NLS' => 1, + 'AM_PATH_GUILE' => 1, + 'AM_POT_TOOLS' => 1, + 'AM_PROG_AR' => 1, + 'AM_PROG_CC_C_O' => 1, + 'AM_PROG_CXX_C_O' => 1, + 'AM_PROG_F77_C_O' => 1, + 'AM_PROG_FC_C_O' => 1, + 'AM_PROG_LIBTOOL' => 1, + 'AM_PROG_MKDIR_P' => 1, + 'AM_PROG_MOC' => 1, + 'AM_SILENT_RULES' => 1, + 'AM_XGETTEXT_OPTION' => 1, + 'GTK_DOC_CHECK' => 1, + 'IT_PROG_INTLTOOL' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + 'LT_INIT' => 1, + 'LT_SUPPORTED_TAG' => 1, + '_AM_COND_ELSE' => 1, + '_AM_COND_ENDIF' => 1, + '_AM_COND_IF' => 1, + '_AM_MAKEFILE_INCLUDE' => 1, + '_AM_SUBST_NOTMAKE' => 1, + '_LT_AC_TAGCONFIG' => 1, + '_m4_warn' => 1, + 'include' => 1, + 'm4_include' => 1, + 'm4_pattern_allow' => 1, + 'm4_pattern_forbid' => 1, + 'm4_sinclude' => 1, + 'sinclude' => 1 + } + ], 'Autom4te::Request' ) + ); + diff --git a/local/recipes/tools/diffutils/source/autom4te.cache/traces.0 b/local/recipes/tools/diffutils/source/autom4te.cache/traces.0 new file mode 100644 index 0000000000..b76ac3d660 --- /dev/null +++ b/local/recipes/tools/diffutils/source/autom4te.cache/traces.0 @@ -0,0 +1,22416 @@ +m4trace:/usr/share/aclocal-1.18/amversion.m4:14: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.18' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.18.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) +m4trace:/usr/share/aclocal-1.18/amversion.m4:33: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.18.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) +m4trace:/usr/share/aclocal-1.18/auxdir.m4:47: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) +m4trace:/usr/share/aclocal-1.18/cond.m4:12: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) +m4trace:/usr/share/aclocal-1.18/depend.m4:26: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thus: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) +m4trace:/usr/share/aclocal-1.18/depend.m4:163: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) +m4trace:/usr/share/aclocal-1.18/depend.m4:171: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) +m4trace:/usr/share/aclocal-1.18/depout.m4:11: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk +} +]) +m4trace:/usr/share/aclocal-1.18/depout.m4:64: -1- AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) +m4trace:/usr/share/aclocal-1.18/init.m4:29: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_IF_OPTION([tar-v7], [_AM_PROG_TAR([v7])], + [_AM_PROG_TAR([ustar])])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + +AC_REQUIRE([_AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +AC_REQUIRE([_AM_PROG_RM_F]) +AC_REQUIRE([_AM_PROG_XARGS_N]) + +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) +m4trace:/usr/share/aclocal-1.18/init.m4:167: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) +m4trace:/usr/share/aclocal-1.18/install-sh.m4:11: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) +m4trace:/usr/share/aclocal-1.18/lead-dot.m4:10: -1- AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) +m4trace:/usr/share/aclocal-1.18/make.m4:13: -1- AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +m4trace:/usr/share/aclocal-1.18/make.m4:42: -1- m4_pattern_allow([^am__quote$]) +m4trace:/usr/share/aclocal-1.18/missing.m4:11: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) +m4trace:/usr/share/aclocal-1.18/missing.m4:20: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) +m4trace:/usr/share/aclocal-1.18/mkdirp.m4:11: -1- AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl FIXME we are no longer going to remove this! adjust warning +dnl FIXME message accordingly. +AC_DIAGNOSE([obsolete], +[$0: this macro is deprecated, and will soon be removed. +You should use the Autoconf-provided 'AC][_PROG_MKDIR_P' macro instead, +and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.]) +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) +m4trace:/usr/share/aclocal-1.18/options.m4:11: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) +m4trace:/usr/share/aclocal-1.18/options.m4:17: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) +m4trace:/usr/share/aclocal-1.18/options.m4:23: -1- AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +m4trace:/usr/share/aclocal-1.18/options.m4:29: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +m4trace:/usr/share/aclocal-1.18/prog-cc-c-o.m4:12: -1- AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + # aligned with autoconf, so not including core; see bug#72225. + rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \ + conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \ + conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) +m4trace:/usr/share/aclocal-1.18/prog-cc-c-o.m4:50: -1- AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) +m4trace:/usr/share/aclocal-1.18/rmf.m4:12: -1- AC_DEFUN([_AM_PROG_RM_F], [am__rm_f_notfound= +AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""']) +AC_SUBST(am__rm_f_notfound) +]) +m4trace:/usr/share/aclocal-1.18/runlog.m4:12: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) +m4trace:/usr/share/aclocal-1.18/sanity.m4:11: -1- AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl +AC_CACHE_CHECK([whether sleep supports fractional seconds], + am_cv_sleep_fractional_seconds, [dnl +AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes], + [am_cv_sleep_fractional_seconds=no]) +])]) +m4trace:/usr/share/aclocal-1.18/sanity.m4:28: -1- AC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl +AC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS]) +AC_CACHE_CHECK([filesystem timestamp resolution], + am_cv_filesystem_timestamp_resolution, [dnl +# Default to the worst case. +am_cv_filesystem_timestamp_resolution=2 + +# Only try to go finer than 1 sec if sleep can do it. +# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, +# - 1 sec is not much of a win compared to 2 sec, and +# - it takes 2 seconds to perform the test whether 1 sec works. +# +# Instead, just use the default 2s on platforms that have 1s resolution, +# accept the extra 1s delay when using $sleep in the Automake tests, in +# exchange for not incurring the 2s delay for running the test for all +# packages. +# +am_try_resolutions= +if test "$am_cv_sleep_fractional_seconds" = yes; then + # Even a millisecond often causes a bunch of false positives, + # so just try a hundredth of a second. The time saved between .001 and + # .01 is not terribly consequential. + am_try_resolutions="0.01 0.1 $am_try_resolutions" +fi + +# In order to catch current-generation FAT out, we must *modify* files +# that already exist; the *creation* timestamp is finer. Use names +# that make ls -t sort them differently when they have equal +# timestamps than when they have distinct timestamps, keeping +# in mind that ls -t prints the *newest* file first. +rm -f conftest.ts? +: > conftest.ts1 +: > conftest.ts2 +: > conftest.ts3 + +# Make sure ls -t actually works. Do 'set' in a subshell so we don't +# clobber the current shell's arguments. (Outer-level square brackets +# are removed by m4; they're present so that m4 does not expand +# ; be careful, easy to get confused.) +if ( + set X `[ls -t conftest.ts[12]]` && + { + test "$[]*" != "X conftest.ts1 conftest.ts2" || + test "$[]*" != "X conftest.ts2 conftest.ts1"; + } +); then :; else + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + _AS_ECHO_UNQUOTED( + ["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""], + [AS_MESSAGE_LOG_FD]) + AC_MSG_FAILURE([ls -t produces unexpected output. +Make sure there is not a broken ls alias in your environment.]) +fi + +for am_try_res in $am_try_resolutions; do + # Any one fine-grained sleep might happen to cross the boundary + # between two values of a coarser actual resolution, but if we do + # two fine-grained sleeps in a row, at least one of them will fall + # entirely within a coarse interval. + echo alpha > conftest.ts1 + sleep $am_try_res + echo beta > conftest.ts2 + sleep $am_try_res + echo gamma > conftest.ts3 + + # We assume that 'ls -t' will make use of high-resolution + # timestamps if the operating system supports them at all. + if (set X `ls -t conftest.ts?` && + test "$[]2" = conftest.ts3 && + test "$[]3" = conftest.ts2 && + test "$[]4" = conftest.ts1); then + # + # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, + # because we don't need to test make. + make_ok=true + if test $am_try_res != 1; then + # But if we've succeeded so far with a subsecond resolution, we + # have one more thing to check: make. It can happen that + # everything else supports the subsecond mtimes, but make doesn't; + # notably on macOS, which ships make 3.81 from 2006 (the last one + # released under GPLv2). https://bugs.gnu.org/68808 + # + # We test $MAKE if it is defined in the environment, else "make". + # It might get overridden later, but our hope is that in practice + # it does not matter: it is the system "make" which is (by far) + # the most likely to be broken, whereas if the user overrides it, + # probably they did so with a better, or at least not worse, make. + # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html + # + # Create a Makefile (real tab character here): + rm -f conftest.mk + echo 'conftest.ts1: conftest.ts2' >conftest.mk + echo ' touch conftest.ts2' >>conftest.mk + # + # Now, running + # touch conftest.ts1; touch conftest.ts2; make + # should touch ts1 because ts2 is newer. This could happen by luck, + # but most often, it will fail if make's support is insufficient. So + # test for several consecutive successes. + # + # (We reuse conftest.ts[12] because we still want to modify existing + # files, not create new ones, per above.) + n=0 + make=${MAKE-make} + until test $n -eq 3; do + echo one > conftest.ts1 + sleep $am_try_res + echo two > conftest.ts2 # ts2 should now be newer than ts1 + if $make -f conftest.mk | grep 'up to date' >/dev/null; then + make_ok=false + break # out of $n loop + fi + n=`expr $n + 1` + done + fi + # + if $make_ok; then + # Everything we know to check worked out, so call this resolution good. + am_cv_filesystem_timestamp_resolution=$am_try_res + break # out of $am_try_res loop + fi + # Otherwise, we'll go on to check the next resolution. + fi +done +rm -f conftest.ts? +# (end _am_filesystem_timestamp_resolution) +])]) +m4trace:/usr/share/aclocal-1.18/sanity.m4:161: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION]) +# This check should not be cached, as it may vary across builds of +# different projects. +AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_RESULT([no]) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_RESULT([no]) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +am_build_env_is_sane=no +am_has_slept=no +rm -f conftest.file +for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[]*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + test "$[]2" = conftest.file + ); then + am_build_env_is_sane=yes + break + fi + # Just in case. + sleep "$am_cv_filesystem_timestamp_resolution" + am_has_slept=yes +done + +AC_MSG_RESULT([$am_build_env_is_sane]) +if test "$am_build_env_is_sane" = no; then + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi + +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl + ( sleep "$am_cv_filesystem_timestamp_resolution" ) & + am_sleep_pid=$! +]) +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) +m4trace:/usr/share/aclocal-1.18/silent.m4:11: -1- AC_DEFUN([_AM_SILENT_RULES], [AM_DEFAULT_VERBOSITY=1 +AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls +dnl to AM_SILENT_RULES to change the default value. +AC_CONFIG_COMMANDS_PRE([dnl +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; +esac +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +])dnl +]) +m4trace:/usr/share/aclocal-1.18/silent.m4:69: -1- AC_DEFUN([AM_SILENT_RULES], [AC_REQUIRE([_AM_SILENT_RULES]) +AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])m4_newline +dnl We intentionally force a newline after the assignment, since a) nothing +dnl good can come of more text following, and b) that was the behavior +dnl before 1.17. See https://bugs.gnu.org/72267. +]) +m4trace:/usr/share/aclocal-1.18/strip.m4:17: -1- AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) +m4trace:/usr/share/aclocal-1.18/substnot.m4:12: -1- AC_DEFUN([_AM_SUBST_NOTMAKE]) +m4trace:/usr/share/aclocal-1.18/substnot.m4:17: -1- AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) +m4trace:/usr/share/aclocal-1.18/tar.m4:23: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test x$am_uid = xunknown; then + AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work]) + elif test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test x$gm_gid = xunknown; then + AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work]) + elif test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) +m4trace:/usr/share/aclocal-1.18/xargsn.m4:12: -1- AC_DEFUN([_AM_PROG_XARGS_N], [AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl +AS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 +3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])]) +AS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl + am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }' +])dnl +AC_SUBST(am__xargs_n) +]) +m4trace:m4/00gnulib.m4:46: -1- AC_DEFUN([gl_00GNULIB]) +m4trace:m4/absolute-header.m4:22: -1- AC_DEFUN([gl_ABSOLUTE_HEADER], [AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_PREPROC_REQUIRE()dnl +dnl FIXME: gl_absolute_header and ac_header_exists must be used unquoted +dnl until we can assume autoconf 2.64 or newer. +m4_foreach_w([gl_HEADER_NAME], [$1], + [AS_VAR_PUSHDEF([gl_absolute_header], + [gl_cv_absolute_]m4_defn([gl_HEADER_NAME]))dnl + AC_CACHE_CHECK([absolute name of <]m4_defn([gl_HEADER_NAME])[>], + m4_defn([gl_absolute_header]), + [AS_VAR_PUSHDEF([ac_header_exists], + [ac_cv_header_]m4_defn([gl_HEADER_NAME]))dnl + AC_CHECK_HEADERS_ONCE(m4_defn([gl_HEADER_NAME]))dnl + if test AS_VAR_GET(ac_header_exists) = yes; then + gl_ABSOLUTE_HEADER_ONE(m4_defn([gl_HEADER_NAME])) + fi + AS_VAR_POPDEF([ac_header_exists])dnl + ])dnl + AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_defn([gl_HEADER_NAME])), + ["AS_VAR_GET(gl_absolute_header)"], + [Define this to an absolute name of <]m4_defn([gl_HEADER_NAME])[>.]) + AS_VAR_POPDEF([gl_absolute_header])dnl +])dnl +]) +m4trace:m4/absolute-header.m4:54: -1- AC_DEFUN([gl_ABSOLUTE_HEADER_ONE], [ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote([$1])[[>]])]) + dnl AIX "xlc -E" and "cc -E" omit #line directives for header files + dnl that contain only a #include of other header files and no + dnl non-comment tokens of their own. This leads to a failure to + dnl detect the absolute name of , , + dnl and others. The workaround is to force preservation of comments + dnl through option -C. This ensures all necessary #line directives + dnl are present. GCC supports option -C as well. + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac +changequote(,) + case "$host_os" in + mingw*) + dnl For the sake of native Windows compilers (excluding gcc), + dnl treat backslash as a directory separator, like /. + dnl Actually, these compilers use a double-backslash as + dnl directory separator, inside the + dnl # line "filename" + dnl directives. + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + dnl A sed expression that turns a string into a basic regular + dnl expression, for use within "/.../". + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo '$1' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' +changequote([,]) + dnl eval is necessary to expand gl_absname_cpp. + dnl Ultrix and Pyramid sh refuse to redirect output of eval, + dnl so use subshell. + AS_VAR_SET([gl_cv_absolute_]AS_TR_SH([[$1]]), +[`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | + sed -n "$gl_absolute_header_sed"`]) +]) +m4trace:m4/alloca.m4:8: -1- AC_DEFUN([gl_FUNC_ALLOCA], [ + AC_REQUIRE([AC_FUNC_ALLOCA]) + if test $ac_cv_func_alloca_works = no; then + gl_PREREQ_ALLOCA + fi + + # Define an additional variable used in the Makefile substitution. + if test $ac_cv_working_alloca_h = yes; then + AC_CACHE_CHECK([for alloca as a compiler built-in], [gl_cv_rpl_alloca], [ + AC_EGREP_CPP([Need own alloca], [ +#if defined __GNUC__ || defined _AIX || defined _MSC_VER + Need own alloca +#endif + ], [gl_cv_rpl_alloca=yes], [gl_cv_rpl_alloca=no]) + ]) + if test $gl_cv_rpl_alloca = yes; then + dnl OK, alloca can be implemented through a compiler built-in. + AC_DEFINE([HAVE_ALLOCA], [1], + [Define to 1 if you have 'alloca' after including , + a header that may be supplied by this distribution.]) + ALLOCA_H=alloca.h + else + dnl alloca exists as a library function, i.e. it is slow and probably + dnl a memory leak. Don't define HAVE_ALLOCA in this case. + ALLOCA_H= + fi + else + ALLOCA_H=alloca.h + fi + AC_SUBST([ALLOCA_H]) + AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"]) +]) +m4trace:m4/alloca.m4:44: -1- AC_DEFUN([gl_PREREQ_ALLOCA], [:]) +m4trace:m4/arpa_inet_h.m4:9: -1- AC_DEFUN([gl_HEADER_ARPA_INET], [ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) + + AC_CHECK_HEADERS_ONCE([arpa/inet.h]) + if test $ac_cv_header_arpa_inet_h = yes; then + HAVE_ARPA_INET_H=1 + else + HAVE_ARPA_INET_H=0 + fi + AC_SUBST([HAVE_ARPA_INET_H]) + dnl is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([arpa/inet.h]) + + AC_REQUIRE([gl_FEATURES_H]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ +/* On some systems, this header is not self-consistent. */ +#if !(defined __GLIBC__ || defined __UCLIBC__) +# include +#endif +#ifdef __TANDEM +# include +#endif +#include + ]], [inet_ntop inet_pton]) +]) +m4trace:m4/arpa_inet_h.m4:41: -1- AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) +]) +m4trace:m4/arpa_inet_h.m4:48: -1- AC_DEFUN([gl_ARPA_INET_H_DEFAULTS], [ + GNULIB_INET_NTOP=0; AC_SUBST([GNULIB_INET_NTOP]) + GNULIB_INET_PTON=0; AC_SUBST([GNULIB_INET_PTON]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DECL_INET_NTOP=1; AC_SUBST([HAVE_DECL_INET_NTOP]) + HAVE_DECL_INET_PTON=1; AC_SUBST([HAVE_DECL_INET_PTON]) + REPLACE_INET_NTOP=0; AC_SUBST([REPLACE_INET_NTOP]) + REPLACE_INET_PTON=0; AC_SUBST([REPLACE_INET_PTON]) +]) +m4trace:m4/btowc.m4:7: -1- AC_DEFUN([gl_FUNC_BTOWC], [ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + dnl Check whether is usable at all, first. Otherwise the test + dnl program below may lead to an endless loop. See + dnl . + AC_REQUIRE([gl_WCHAR_H_INLINE_OK]) + + AC_CHECK_FUNCS_ONCE([btowc]) + if test $ac_cv_func_btowc = no; then + HAVE_BTOWC=0 + else + + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + dnl Cygwin 1.7.2 btowc('\0') is WEOF, not 0. + AC_CACHE_CHECK([whether btowc(0) is correct], + [gl_cv_func_btowc_nul], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (btowc ('\0') != 0) + return 1; + return 0; +}]])], + [gl_cv_func_btowc_nul=yes], + [gl_cv_func_btowc_nul=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess no on Cygwin. + cygwin*) gl_cv_func_btowc_nul="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_nul="guessing yes" ;; + esac +changequote([,])dnl + ]) + ]) + + dnl IRIX 6.5 btowc(EOF) is 0xFF, not WEOF. + AC_CACHE_CHECK([whether btowc(EOF) is correct], + [gl_cv_func_btowc_eof], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on IRIX. + irix*) gl_cv_func_btowc_eof="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_eof="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (btowc (EOF) != WEOF) + return 1; + } + return 0; +}]])], + [gl_cv_func_btowc_eof=yes], + [gl_cv_func_btowc_eof=no], + [:]) + fi + ]) + + case "$gl_cv_func_btowc_nul" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + case "$gl_cv_func_btowc_eof" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + fi +]) +m4trace:m4/btowc.m4:114: -1- AC_DEFUN([gl_PREREQ_BTOWC], [ + : +]) +m4trace:m4/builtin-expect.m4:10: -1- AC_DEFUN([gl___BUILTIN_EXPECT], [ + AC_CACHE_CHECK([for __builtin_expect], + [gl_cv___builtin_expect], + [AC_LINK_IFELSE( + [AC_LANG_SOURCE([[ + int + main (int argc, char **argv) + { + argc = __builtin_expect (argc, 100); + return argv[argc != 100][0]; + }]])], + [gl_cv___builtin_expect=yes], + [AC_LINK_IFELSE( + [AC_LANG_SOURCE([[ + #include + int + main (int argc, char **argv) + { + argc = __builtin_expect (argc, 100); + return argv[argc != 100][0]; + }]])], + [gl_cv___builtin_expect="in "], + [gl_cv___builtin_expect=no])])]) + if test "$gl_cv___builtin_expect" = yes; then + AC_DEFINE([HAVE___BUILTIN_EXPECT], [1]) + elif test "$gl_cv___builtin_expect" = "in "; then + AC_DEFINE([HAVE___BUILTIN_EXPECT], [2]) + fi + AH_VERBATIM([HAVE___BUILTIN_EXPECT], + [/* Define to 1 if the compiler supports __builtin_expect, + and to 2 if does. */ +#undef HAVE___BUILTIN_EXPECT +#ifndef HAVE___BUILTIN_EXPECT +# define __builtin_expect(e, c) (e) +#elif HAVE___BUILTIN_EXPECT == 2 +# include +#endif + ]) +]) +m4trace:m4/c-stack.m4:12: -1- AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC], [ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_FUNCS_ONCE([setrlimit]) + AC_CHECK_HEADERS_ONCE([ucontext.h]) + + dnl List of signals that are sent when an invalid virtual memory address + dnl is accessed, or when the stack overflows. + dnl Either { SIGSEGV } or { SIGSEGV, SIGBUS }. + case "$host_os" in + sunos4* | freebsd* | dragonfly* | openbsd* | mirbsd* | netbsd* | kfreebsd* | knetbsd*) # BSD systems + FAULT_YIELDS_SIGBUS=1 ;; + hpux*) # HP-UX + FAULT_YIELDS_SIGBUS=1 ;; + macos* | darwin*) # Mac OS X + FAULT_YIELDS_SIGBUS=1 ;; + gnu*) # Hurd + FAULT_YIELDS_SIGBUS=1 ;; + *) + FAULT_YIELDS_SIGBUS=0 ;; + esac + AC_DEFINE_UNQUOTED([FAULT_YIELDS_SIGBUS], [$FAULT_YIELDS_SIGBUS], + [Define to 1 if an invalid memory address access may yield a SIGBUS.]) + + AC_CACHE_CHECK([for working C stack overflow detection], + [ac_cv_sys_stack_overflow_works], + [AC_RUN_IFELSE([AC_LANG_SOURCE( + [[ + #include + #include + #if HAVE_SETRLIMIT + # include + # include + # include + #endif + #ifndef SIGSTKSZ + # define SIGSTKSZ 16384 + #endif + + static union + { + char buffer[2 * SIGSTKSZ]; + long double ld; + long u; + void *p; + } alternate_signal_stack; + + static void + segv_handler (int signo) + { + _exit (0); + } + + static int + c_stack_action () + { + stack_t st; + struct sigaction act; + int r; + + st.ss_flags = 0; + /* Use the midpoint to avoid Irix sigaltstack bug. */ + st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; + st.ss_size = SIGSTKSZ; + r = sigaltstack (&st, 0); + if (r != 0) + return 1; + + sigemptyset (&act.sa_mask); + act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND; + act.sa_handler = segv_handler; + #if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, 0) < 0) + return 2; + #endif + if (sigaction (SIGSEGV, &act, 0) < 0) + return 3; + return 0; + } + static volatile int * + recurse_1 (volatile int n, volatile int *p) + { + if (n >= 0) + *recurse_1 (n + 1, p) += n; + return p; + } + static int + recurse (volatile int n) + { + int sum = 0; + return *recurse_1 (n, &sum); + } + int + main () + { + int result; + #if HAVE_SETRLIMIT && defined RLIMIT_STACK + /* Before starting the endless recursion, try to be friendly + to the user's machine. On some Linux 2.2.x systems, there + is no stack limit for user processes at all. We don't want + to kill such systems. */ + struct rlimit rl; + rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */ + setrlimit (RLIMIT_STACK, &rl); + #endif + + result = c_stack_action (); + if (result != 0) + return result; + return recurse (0); + } + ]])], + [ac_cv_sys_stack_overflow_works=yes], + [ac_cv_sys_stack_overflow_works=no], + [ac_cv_sys_stack_overflow_works=cross-compiling])]) + + if test $ac_cv_sys_stack_overflow_works = yes; then + AC_DEFINE([HAVE_STACK_OVERFLOW_HANDLING], [1], + [Define to 1 if extending the stack slightly past the limit causes + a SIGSEGV which can be handled on an alternate stack established + with sigaltstack.]) + + dnl The ss_sp field of a stack_t is, according to POSIX, the lowest address + dnl of the memory block designated as an alternate stack. But IRIX 5.3 + dnl interprets it as the highest address! + AC_CACHE_CHECK([for correct stack_t interpretation], + [gl_cv_sigaltstack_low_base], [ + AC_RUN_IFELSE([ + AC_LANG_SOURCE([[ +#include +#include +#if HAVE_SYS_SIGNAL_H +# include +#endif +#ifndef SIGSTKSZ +# define SIGSTKSZ 16384 +#endif +volatile char *stack_lower_bound; +volatile char *stack_upper_bound; +static void check_stack_location (volatile char *addr) +{ + if (addr >= stack_lower_bound && addr <= stack_upper_bound) + exit (0); + else + exit (1); +} +static void stackoverflow_handler (int sig) +{ + char dummy; + check_stack_location (&dummy); +} +int main () +{ + char mystack[2 * SIGSTKSZ]; + stack_t altstack; + struct sigaction action; + /* Install the alternate stack. */ + altstack.ss_sp = mystack + SIGSTKSZ; + altstack.ss_size = SIGSTKSZ; + stack_lower_bound = (char *) altstack.ss_sp; + stack_upper_bound = (char *) altstack.ss_sp + altstack.ss_size - 1; + altstack.ss_flags = 0; /* no SS_DISABLE */ + if (sigaltstack (&altstack, NULL) < 0) + exit (2); + /* Install the SIGSEGV handler. */ + sigemptyset (&action.sa_mask); + action.sa_handler = &stackoverflow_handler; + action.sa_flags = SA_ONSTACK; + if (sigaction (SIGSEGV, &action, (struct sigaction *) NULL) < 0) + exit(3); + /* Provoke a SIGSEGV. */ + raise (SIGSEGV); + exit (4); +}]])], + [gl_cv_sigaltstack_low_base=yes], + [gl_cv_sigaltstack_low_base=no], + [gl_cv_sigaltstack_low_base=cross-compiling])]) + if test "$gl_cv_sigaltstack_low_base" = no; then + AC_DEFINE([SIGALTSTACK_SS_REVERSED], [1], + [Define if sigaltstack() interprets the stack_t.ss_sp field + incorrectly, as the highest address of the alternate stack range + rather than as the lowest address.]) + fi + + AC_CACHE_CHECK([for precise C stack overflow detection], + ac_cv_sys_xsi_stack_overflow_heuristic, + [AC_RUN_IFELSE([AC_LANG_SOURCE( + [[ + #include + #include + #if HAVE_UCONTEXT_H + # include + #endif + #if HAVE_SETRLIMIT + # include + # include + # include + #endif + #ifndef SIGSTKSZ + # define SIGSTKSZ 16384 + #endif + + static union + { + char buffer[2 * SIGSTKSZ]; + long double ld; + long u; + void *p; + } alternate_signal_stack; + + #if STACK_DIRECTION + # define find_stack_direction(ptr) STACK_DIRECTION + #else + static int + find_stack_direction (char const *addr) + { + char dummy; + return (! addr ? find_stack_direction (&dummy) + : addr < &dummy ? 1 : -1); + } + #endif + + static void + segv_handler (int signo, siginfo_t *info, void *context) + { + if (0 < info->si_code) + { + /* For XSI heuristics to work, we need uc_stack to describe + the interrupted stack (as on Solaris), and not the + currently executing stack (as on Linux). */ + ucontext_t const *user_context = context; + char const *stack_min = user_context->uc_stack.ss_sp; + size_t stack_size = user_context->uc_stack.ss_size; + char const *faulting_address = info->si_addr; + size_t s = faulting_address - stack_min; + size_t page_size = sysconf (_SC_PAGESIZE); + if (find_stack_direction (0) < 0) + s += page_size; + if (s < stack_size + page_size) + _exit (0); + _exit (4); + } + _exit (5); + } + + static int + c_stack_action () + { + stack_t st; + struct sigaction act; + int r; + + st.ss_flags = 0; + /* Use the midpoint to avoid Irix sigaltstack bug. */ + st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; + st.ss_size = SIGSTKSZ; + r = sigaltstack (&st, 0); + if (r != 0) + return 1; + + sigemptyset (&act.sa_mask); + act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO; + act.sa_sigaction = segv_handler; + #if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, 0) < 0) + return 2; + #endif + if (sigaction (SIGSEGV, &act, 0) < 0) + return 3; + return 0; + } + static volatile int * + recurse_1 (volatile int n, volatile int *p) + { + if (n >= 0) + *recurse_1 (n + 1, p) += n; + return p; + } + static int + recurse (volatile int n) + { + int sum = 0; + return *recurse_1 (n, &sum); + } + int + main () + { + int result; + #if HAVE_SETRLIMIT && defined RLIMIT_STACK + /* Before starting the endless recursion, try to be friendly + to the user's machine. On some Linux 2.2.x systems, there + is no stack limit for user processes at all. We don't want + to kill such systems. */ + struct rlimit rl; + rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */ + setrlimit (RLIMIT_STACK, &rl); + #endif + + result = c_stack_action (); + if (result != 0) + return result; + return recurse (0); + } + ]])], + [ac_cv_sys_xsi_stack_overflow_heuristic=yes], + [ac_cv_sys_xsi_stack_overflow_heuristic=no], + [ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling])]) + + if test $ac_cv_sys_xsi_stack_overflow_heuristic = yes; then + AC_DEFINE([HAVE_XSI_STACK_OVERFLOW_HEURISTIC], [1], + [Define to 1 if extending the stack slightly past the limit causes + a SIGSEGV, and an alternate stack can be established with sigaltstack, + and the signal handler is passed a context that specifies the + run time stack. This behavior is defined by POSIX 1003.1-2001 + with the X/Open System Interface (XSI) option + and is a standardized way to implement a SEGV-based stack + overflow detection heuristic.]) + fi + fi]) +m4trace:m4/c-stack.m4:333: -1- AC_DEFUN([gl_PREREQ_C_STACK], [AC_REQUIRE([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC]) + AC_REQUIRE([gl_LIBSIGSEGV]) + + # for STACK_DIRECTION + AC_REQUIRE([AC_FUNC_ALLOCA]) + + AC_CHECK_FUNCS_ONCE([sigaltstack]) + AC_CHECK_DECLS([sigaltstack], , , [[#include ]]) + + AC_CHECK_HEADERS_ONCE([unistd.h ucontext.h]) + + AC_CHECK_TYPES([stack_t], , , [#include ]) + + dnl c-stack does not need -lsigsegv if the system has XSI heuristics. + if test "$gl_cv_lib_sigsegv" = yes \ + && test $"ac_cv_sys_xsi_stack_overflow_heuristic" != yes ; then + AC_SUBST([LIBCSTACK], [$LIBSIGSEGV]) + AC_SUBST([LTLIBCSTACK], [$LTLIBSIGSEGV]) + fi +]) +m4trace:m4/c-stack.m4:355: -1- AC_DEFUN([gl_C_STACK], [ + dnl Prerequisites of lib/c-stack.c. + gl_PREREQ_C_STACK +]) +m4trace:m4/clock_time.m4:12: -1- AC_DEFUN([gl_CLOCK_TIME], [ + dnl Persuade glibc and Solaris to declare these functions. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. + # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. + + # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* + # programs in the package would end up linked with that potentially-shared + # library, inducing unnecessary run-time overhead. + LIB_CLOCK_GETTIME= + AC_SUBST([LIB_CLOCK_GETTIME]) + gl_saved_libs=$LIBS + AC_SEARCH_LIBS([clock_gettime], [rt posix4], + [test "$ac_cv_search_clock_gettime" = "none required" || + LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime]) + AC_CHECK_FUNCS([clock_gettime clock_settime]) + LIBS=$gl_saved_libs +]) +m4trace:m4/close.m4:7: -1- AC_DEFUN([gl_FUNC_CLOSE], [ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + m4_ifdef([gl_MSVC_INVAL], [ + AC_REQUIRE([gl_MSVC_INVAL]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_CLOSE=1 + fi + ]) + m4_ifdef([gl_PREREQ_SYS_H_WINSOCK2], [ + gl_PREREQ_SYS_H_WINSOCK2 + if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then + dnl Even if the 'socket' module is not used here, another part of the + dnl application may use it and pass file descriptors that refer to + dnl sockets to the close() function. So enable the support for sockets. + REPLACE_CLOSE=1 + fi + ]) + dnl Replace close() for supporting the gnulib-defined fchdir() function, + dnl to keep fchdir's bookkeeping up-to-date. + m4_ifdef([gl_FUNC_FCHDIR], [ + if test $REPLACE_CLOSE = 0; then + gl_TEST_FCHDIR + if test $HAVE_FCHDIR = 0; then + REPLACE_CLOSE=1 + fi + fi + ]) +]) +m4trace:m4/codeset.m4:10: -1- AC_DEFUN([AM_LANGINFO_CODESET], [ + AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[char* cs = nl_langinfo(CODESET); return !cs;]])], + [am_cv_langinfo_codeset=yes], + [am_cv_langinfo_codeset=no]) + ]) + if test $am_cv_langinfo_codeset = yes; then + AC_DEFINE([HAVE_LANGINFO_CODESET], [1], + [Define if you have and nl_langinfo(CODESET).]) + fi +]) +m4trace:m4/config-h.m4:12: -1- AC_DEFUN([gl_CONFIG_H], [AC_CONFIG_COMMANDS_PRE([test "X$DEFS" = X-DHAVE_CONFIG_H && DEFS=])]) +m4trace:m4/configmake.m4:13: -1- AC_DEFUN([gl_CONFIGMAKE_PREP], [ + dnl Technically, datadir should default to datarootdir. But if + dnl autoconf is too old to provide datarootdir, then reversing the + dnl definition is a reasonable compromise. Only AC_SUBST a variable + dnl if it was not already defined earlier by autoconf. + if test "x$datarootdir" = x; then + AC_SUBST([datarootdir], ['${datadir}']) + fi + dnl Copy the approach used in autoconf 2.60. + if test "x$docdir" = x; then + AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], + ['${datarootdir}/doc/${PACKAGE_TARNAME}'], + ['${datarootdir}/doc/${PACKAGE}'])]) + fi + dnl The remaining variables missing from autoconf 2.59 are easier. + if test "x$htmldir" = x; then + AC_SUBST([htmldir], ['${docdir}']) + fi + if test "x$dvidir" = x; then + AC_SUBST([dvidir], ['${docdir}']) + fi + if test "x$pdfdir" = x; then + AC_SUBST([pdfdir], ['${docdir}']) + fi + if test "x$psdir" = x; then + AC_SUBST([psdir], ['${docdir}']) + fi + if test "x$lispdir" = x; then + AC_SUBST([lispdir], ['${datarootdir}/emacs/site-lisp']) + fi + if test "x$localedir" = x; then + AC_SUBST([localedir], ['${datarootdir}/locale']) + fi + dnl Added in autoconf 2.70 + if test "x$runstatedir" = x; then + AC_SUBST([runstatedir], ['${localstatedir}/run']) + fi + + dnl Automake 1.9.6 only lacks pkglibexecdir; and since 1.11 merely + dnl provides it without AC_SUBST, this blind use of AC_SUBST is safe. + AC_SUBST([pkglibexecdir], ['${libexecdir}/${PACKAGE}']) +]) +m4trace:m4/ctype.m4:7: -1- AC_DEFUN([gl_CTYPE_H], [ + AC_REQUIRE([gl_CTYPE_H_DEFAULTS]) + + dnl is always overridden, because of GNULIB_POSIXCHECK. + gl_NEXT_HEADERS([ctype.h]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include + ]], [isblank]) +]) +m4trace:m4/ctype.m4:20: -1- AC_DEFUN([gl_CTYPE_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_CTYPE_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) +]) +m4trace:m4/ctype.m4:27: -1- AC_DEFUN([gl_CTYPE_H_DEFAULTS], [ + GNULIB_ISBLANK=0; AC_SUBST([GNULIB_ISBLANK]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_ISBLANK=1; AC_SUBST([HAVE_ISBLANK]) +]) +m4trace:m4/dirname.m4:7: -1- AC_DEFUN([gl_DIRNAME], [ + AC_REQUIRE([gl_DIRNAME_LGPL]) +]) +m4trace:m4/dirname.m4:12: -1- AC_DEFUN([gl_DIRNAME_LGPL], [ + dnl Prerequisites of lib/dirname.h. + AC_REQUIRE([gl_DOUBLE_SLASH_ROOT]) + + dnl No prerequisites of lib/basename-lgpl.c, lib/dirname-lgpl.c, + dnl lib/stripslash.c. +]) +m4trace:m4/double-slash-root.m4:7: -1- AC_DEFUN([gl_DOUBLE_SLASH_ROOT], [ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CACHE_CHECK([whether // is distinct from /], [gl_cv_double_slash_root], + [ if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # . + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + gl_cv_double_slash_root='unknown, assuming no' ;; + esac + else + set x `ls -di / // 2>/dev/null` + if test "$[2]" = "$[4]" && wc //dev/null >/dev/null 2>&1; then + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi]) + if test "$gl_cv_double_slash_root" = yes; then + AC_DEFINE([DOUBLE_SLASH_IS_DISTINCT_ROOT], [1], + [Define to 1 if // is a file system root distinct from /.]) + fi +]) +m4trace:m4/dup2.m4:7: -1- AC_DEFUN([gl_FUNC_DUP2], [ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + m4_ifdef([gl_FUNC_DUP2_OBSOLETE], [ + AC_CHECK_FUNCS_ONCE([dup2]) + if test $ac_cv_func_dup2 = no; then + HAVE_DUP2=0 + fi + ], [ + AC_DEFINE([HAVE_DUP2], [1], [Define to 1 if you have the 'dup2' function.]) + ]) + if test $HAVE_DUP2 = 1; then + AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works], + [AC_RUN_IFELSE([ + AC_LANG_PROGRAM( + [[#include + #include + #include + #include + #include + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + ]], + [[int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + #ifdef FD_CLOEXEC + if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) + result |= 1; + #endif + if (dup2 (1, 1) != 1) + result |= 2; + #ifdef FD_CLOEXEC + if (fcntl (1, F_GETFD) != FD_CLOEXEC) + result |= 4; + #endif + close (0); + if (dup2 (0, 0) != -1) + result |= 8; + /* Many gnulib modules require POSIX conformance of EBADF. */ + if (dup2 (2, bad_fd) == -1 && errno != EBADF) + result |= 16; + /* Flush out some cygwin core dumps. */ + if (dup2 (2, -1) != -1 || errno != EBADF) + result |= 32; + dup2 (2, 255); + dup2 (2, 256); + /* On OS/2 kLIBC, dup2() does not work on a directory fd. */ + { + int fd = open (".", O_RDONLY); + if (fd == -1) + result |= 64; + else if (dup2 (fd, fd + 1) == -1) + result |= 128; + + close (fd); + } + return result;]]) + ], + [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no], + [case "$host_os" in + mingw*) # on this platform, dup2 always returns 0 for success + gl_cv_func_dup2_works="guessing no" ;; + cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 + gl_cv_func_dup2_works="guessing no" ;; + aix* | freebsd*) + # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE, + # not EBADF. + gl_cv_func_dup2_works="guessing no" ;; + haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. + gl_cv_func_dup2_works="guessing no" ;; + *-android*) # implemented using dup3(), which fails if oldfd == newfd + gl_cv_func_dup2_works="guessing no" ;; + os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd. + gl_cv_func_dup2_works="guessing no" ;; + *) gl_cv_func_dup2_works="guessing yes" ;; + esac]) + ]) + case "$gl_cv_func_dup2_works" in + *yes) ;; + *) + REPLACE_DUP2=1 + AC_CHECK_FUNCS([setdtablesize]) + ;; + esac + fi + dnl Replace dup2() for supporting the gnulib-defined fchdir() function, + dnl to keep fchdir's bookkeeping up-to-date. + m4_ifdef([gl_FUNC_FCHDIR], [ + gl_TEST_FCHDIR + if test $HAVE_FCHDIR = 0; then + if test $HAVE_DUP2 = 1; then + REPLACE_DUP2=1 + fi + fi + ]) +]) +m4trace:m4/dup2.m4:117: -1- AC_DEFUN([gl_PREREQ_DUP2], []) +m4trace:m4/eealloc.m4:7: -1- AC_DEFUN([gl_EEALLOC], [ + AC_REQUIRE([gl_EEMALLOC]) + AC_REQUIRE([gl_EEREALLOC]) +]) +m4trace:m4/eealloc.m4:13: -1- AC_DEFUN([gl_EEMALLOC], [ + _AC_FUNC_MALLOC_IF( + [gl_cv_func_malloc_0_nonnull=1], + [gl_cv_func_malloc_0_nonnull=0]) + AC_DEFINE_UNQUOTED([MALLOC_0_IS_NONNULL], [$gl_cv_func_malloc_0_nonnull], + [If malloc(0) is != NULL, define this to 1. Otherwise define this + to 0.]) +]) +m4trace:m4/eealloc.m4:23: -1- AC_DEFUN([gl_EEREALLOC], [ + _AC_FUNC_REALLOC_IF( + [gl_cv_func_realloc_0_nonnull=1], + [gl_cv_func_realloc_0_nonnull=0]) + AC_DEFINE_UNQUOTED([REALLOC_0_IS_NONNULL], [$gl_cv_func_realloc_0_nonnull], + [If realloc(NULL,0) is != NULL, define this to 1. Otherwise define this + to 0.]) +]) +m4trace:m4/environ.m4:7: -1- AC_DEFUN_ONCE([gl_ENVIRON], [ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + dnl Persuade glibc to declare environ. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_CHECK_HEADERS_ONCE([unistd.h]) + gt_CHECK_VAR_DECL( + [#if HAVE_UNISTD_H + #include + #endif + /* mingw, BeOS, Haiku declare environ in , not in . */ + #include + ], + [environ]) + if test $gt_cv_var_environ_declaration != yes; then + HAVE_DECL_ENVIRON=0 + fi +]) +m4trace:m4/environ.m4:29: -1- AC_DEFUN([gt_CHECK_VAR_DECL], [ + define([gt_cv_var], [gt_cv_var_]$2[_declaration]) + AC_MSG_CHECKING([if $2 is properly declared]) + AC_CACHE_VAL([gt_cv_var], [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[$1 + extern struct { int foo; } $2;]], + [[$2.foo = 1;]])], + [gt_cv_var=no], + [gt_cv_var=yes])]) + AC_MSG_RESULT([$gt_cv_var]) + if test $gt_cv_var = yes; then + AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1, + [Define if you have the declaration of $2.]) + fi + undefine([gt_cv_var]) +]) +m4trace:m4/errno_h.m4:7: -1- AC_DEFUN_ONCE([gl_HEADER_ERRNO_H], [ + AC_REQUIRE([AC_PROG_CC]) + AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [ + AC_EGREP_CPP([booboo],[ +#include +#if !defined ETXTBSY +booboo +#endif +#if !defined ENOMSG +booboo +#endif +#if !defined EIDRM +booboo +#endif +#if !defined ENOLINK +booboo +#endif +#if !defined EPROTO +booboo +#endif +#if !defined EMULTIHOP +booboo +#endif +#if !defined EBADMSG +booboo +#endif +#if !defined EOVERFLOW +booboo +#endif +#if !defined ENOTSUP +booboo +#endif +#if !defined ENETRESET +booboo +#endif +#if !defined ECONNABORTED +booboo +#endif +#if !defined ESTALE +booboo +#endif +#if !defined EDQUOT +booboo +#endif +#if !defined ECANCELED +booboo +#endif +#if !defined EOWNERDEAD +booboo +#endif +#if !defined ENOTRECOVERABLE +booboo +#endif +#if !defined EILSEQ +booboo +#endif + ], + [gl_cv_header_errno_h_complete=no], + [gl_cv_header_errno_h_complete=yes]) + ]) + if test $gl_cv_header_errno_h_complete = yes; then + ERRNO_H='' + else + gl_NEXT_HEADERS([errno.h]) + ERRNO_H='errno.h' + fi + AC_SUBST([ERRNO_H]) + AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"]) + gl_REPLACE_ERRNO_VALUE([EMULTIHOP]) + gl_REPLACE_ERRNO_VALUE([ENOLINK]) + gl_REPLACE_ERRNO_VALUE([EOVERFLOW]) +]) +m4trace:m4/errno_h.m4:87: -1- AC_DEFUN([gl_REPLACE_ERRNO_VALUE], [ + if test -n "$ERRNO_H"; then + AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [ + AC_EGREP_CPP([yes],[ +#include +#ifdef ]$1[ +yes +#endif + ], + [gl_cv_header_errno_h_]$1[=yes], + [gl_cv_header_errno_h_]$1[=no]) + if test $gl_cv_header_errno_h_]$1[ = no; then + AC_EGREP_CPP([yes],[ +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#ifdef ]$1[ +yes +#endif + ], [gl_cv_header_errno_h_]$1[=hidden]) + if test $gl_cv_header_errno_h_]$1[ = hidden; then + dnl The macro exists but is hidden. + dnl Define it to the same value. + AC_COMPUTE_INT([gl_cv_header_errno_h_]$1, $1, [ +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +]) + fi + fi + ]) + case $gl_cv_header_errno_h_$1 in + yes | no) + $1_HIDDEN=0; $1_VALUE= + ;; + *) + $1_HIDDEN=1; $1_VALUE="$gl_cv_header_errno_h_$1" + ;; + esac + AC_SUBST($1[_HIDDEN]) + AC_SUBST($1[_VALUE]) + fi +]) +m4trace:m4/error.m4:9: -1- AC_DEFUN([gl_ERROR], [ + dnl We don't use AC_FUNC_ERROR_AT_LINE any more, because it is no longer + dnl maintained in Autoconf and because it invokes AC_LIBOBJ. + AC_CACHE_CHECK([for error_at_line], [ac_cv_lib_error_at_line], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[error_at_line (0, 0, "", 0, "an error occurred");]])], + [ac_cv_lib_error_at_line=yes], + [ac_cv_lib_error_at_line=no])]) +]) +m4trace:m4/error.m4:23: -1- AC_DEFUN([gl_PREREQ_ERROR], [ + AC_REQUIRE([AC_FUNC_STRERROR_R]) + : +]) +m4trace:m4/exponentd.m4:6: -1- AC_DEFUN([gl_DOUBLE_EXPONENT_LOCATION], [ + AC_CACHE_CHECK([where to find the exponent in a 'double'], + [gl_cv_cc_double_expbit0], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include +#include +#define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { double value; unsigned int word[NWORDS]; } memory_double; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (double x) +{ + memory_double m; + size_t i; + /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ + memset (&m, 0, sizeof (memory_double)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25); + add_to_ored_words (0.5); + add_to_ored_words (1.0); + add_to_ored_words (2.0); + add_to_ored_words (4.0); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + ]])], + [gl_cv_cc_double_expbit0=`cat conftest.out`], + [gl_cv_cc_double_expbit0="unknown"], + [ + dnl On ARM, there are two 'double' floating-point formats, used by + dnl different sets of instructions: The older FPA instructions assume + dnl that they are stored in big-endian word order, while the words + dnl (like integer types) are stored in little-endian byte order. + dnl The newer VFP instructions assume little-endian order + dnl consistently. + AC_EGREP_CPP([mixed_endianness], [ +#if defined arm || defined __arm || defined __arm__ + mixed_endianness +#endif + ], + [gl_cv_cc_double_expbit0="unknown"], + [ + pushdef([AC_MSG_CHECKING],[:])dnl + pushdef([AC_MSG_RESULT],[:])dnl + pushdef([AC_MSG_RESULT_UNQUOTED],[:])dnl + AC_C_BIGENDIAN( + [gl_cv_cc_double_expbit0="word 0 bit 20"], + [gl_cv_cc_double_expbit0="word 1 bit 20"], + [gl_cv_cc_double_expbit0="unknown"]) + popdef([AC_MSG_RESULT_UNQUOTED])dnl + popdef([AC_MSG_RESULT])dnl + popdef([AC_MSG_CHECKING])dnl + ]) + ]) + rm -f conftest.out + ]) + case "$gl_cv_cc_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` + AC_DEFINE_UNQUOTED([DBL_EXPBIT0_WORD], [$word], + [Define as the word index where to find the exponent of 'double'.]) + AC_DEFINE_UNQUOTED([DBL_EXPBIT0_BIT], [$bit], + [Define as the bit index in the word where to find bit 0 of the exponent of 'double'.]) + ;; + esac +]) +m4trace:m4/extensions.m4:38: -1- AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS], [AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl +AC_BEFORE([$0], [AC_RUN_IFELSE])dnl + + AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=]) + if test "$MINIX" = yes; then + AC_DEFINE([_POSIX_SOURCE], [1], + [Define to 1 if you need to in order for 'stat' and other + things to work.]) + AC_DEFINE([_POSIX_1_SOURCE], [2], + [Define to 2 if the system does not provide POSIX.1 features + except with this defined.]) + AC_DEFINE([_MINIX], [1], + [Define to 1 if on MINIX.]) + AC_DEFINE([_NETBSD_SOURCE], [1], + [Define to 1 to make NetBSD features available. MINIX 3 needs this.]) + fi + +dnl Use a different key than __EXTENSIONS__, as that name broke existing +dnl configure.ac when using autoheader 2.62. + AH_VERBATIM([USE_SYSTEM_EXTENSIONS], +[/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable general extensions on macOS. */ +#ifndef _DARWIN_C_SOURCE +# undef _DARWIN_C_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# undef __STDC_WANT_IEC_60559_BFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# undef __STDC_WANT_IEC_60559_DFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# undef __STDC_WANT_IEC_60559_TYPES_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# undef __STDC_WANT_LIB_EXT2__ +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# undef __STDC_WANT_MATH_SPEC_FUNCS__ +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable X/Open extensions if necessary. HP-UX 11.11 defines + mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of + whether compiling with -Ae or -D_HPUX_SOURCE=1. */ +#ifndef _XOPEN_SOURCE +# undef _XOPEN_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif +]) + AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], + [ac_cv_safe_to_define___extensions__], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ +# define __EXTENSIONS__ 1 + ]AC_INCLUDES_DEFAULT])], + [ac_cv_safe_to_define___extensions__=yes], + [ac_cv_safe_to_define___extensions__=no])]) + test $ac_cv_safe_to_define___extensions__ = yes && + AC_DEFINE([__EXTENSIONS__]) + AC_DEFINE([_ALL_SOURCE]) + AC_DEFINE([_DARWIN_C_SOURCE]) + AC_DEFINE([_GNU_SOURCE]) + AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) + AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_DFP_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_FUNCS_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_TYPES_EXT__]) + AC_DEFINE([__STDC_WANT_LIB_EXT2__]) + AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__]) + AC_DEFINE([_TANDEM_SOURCE]) + AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined], + [ac_cv_should_define__xopen_source], + [ac_cv_should_define__xopen_source=no + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #include + mbstate_t x;]])], + [], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #define _XOPEN_SOURCE 500 + #include + mbstate_t x;]])], + [ac_cv_should_define__xopen_source=yes])])]) + test $ac_cv_should_define__xopen_source = yes && + AC_DEFINE([_XOPEN_SOURCE], [500]) +]) +m4trace:m4/extensions.m4:162: -1- AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS], [ + dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS. + dnl gnulib does not need it. But if it gets required by third-party macros + dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a + dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS". + dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE, + dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck. + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) +]) +m4trace:m4/extern-inline.m4:8: -1- AC_DEFUN([gl_EXTERN_INLINE], [ + AH_VERBATIM([extern_inline], +[/* Please see the Gnulib manual for how to use these macros. + + Suppress extern inline with HP-UX cc, as it appears to be broken; see + . + + Suppress extern inline with Sun C in standards-conformance mode, as it + mishandles inline functions that call each other. E.g., for 'inline void f + (void) { } inline void g (void) { f (); }', c99 incorrectly complains + 'reference to static identifier "f" in extern inline function'. + This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. + + Suppress extern inline (with or without __attribute__ ((__gnu_inline__))) + on configurations that mistakenly use 'static inline' to implement + functions or macros in standard C headers like . For example, + if isdigit is mistakenly implemented via a static inline function, + a program containing an extern inline function that calls isdigit + may not work since the C standard prohibits extern inline functions + from calling static functions. This bug is known to occur on: + + OS X 10.8 and earlier; see: + http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html + + DragonFly; see + http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log + + FreeBSD; see: + http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html + + OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and + for clang but remains for g++; see . + Assume DragonFly and FreeBSD will be similar. */ +#if (((defined __APPLE__ && defined __MACH__) \ + || defined __DragonFly__ || defined __FreeBSD__) \ + && (defined __header_inline \ + ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \ + && ! defined __clang__) \ + : ((! defined _DONT_USE_CTYPE_INLINE_ \ + && (defined __GNUC__ || defined __cplusplus)) \ + || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \ + && defined __GNUC__ && ! defined __cplusplus)))) +# define _GL_EXTERN_INLINE_STDHEADER_BUG +#endif +#if ((__GNUC__ \ + ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ + : (199901L <= __STDC_VERSION__ \ + && !defined __HP_cc \ + && !defined __PGI \ + && !(defined __SUNPRO_C && __STDC__))) \ + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) +# define _GL_INLINE inline +# define _GL_EXTERN_INLINE extern inline +# define _GL_EXTERN_INLINE_IN_USE +#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \ + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) +# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__ + /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ +# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) +# else +# define _GL_INLINE extern inline +# endif +# define _GL_EXTERN_INLINE extern +# define _GL_EXTERN_INLINE_IN_USE +#else +# define _GL_INLINE static _GL_UNUSED +# define _GL_EXTERN_INLINE static _GL_UNUSED +#endif + +/* In GCC 4.6 (inclusive) to 5.1 (exclusive), + suppress bogus "no previous prototype for 'FOO'" + and "no previous declaration for 'FOO'" diagnostics, + when FOO is an inline function in the header; see + and + . */ +#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__ +# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ +# define _GL_INLINE_HEADER_CONST_PRAGMA +# else +# define _GL_INLINE_HEADER_CONST_PRAGMA \ + _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") +# endif +# define _GL_INLINE_HEADER_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \ + _GL_INLINE_HEADER_CONST_PRAGMA +# define _GL_INLINE_HEADER_END \ + _Pragma ("GCC diagnostic pop") +#else +# define _GL_INLINE_HEADER_BEGIN +# define _GL_INLINE_HEADER_END +#endif]) +]) +m4trace:m4/fcntl-o.m4:12: -1- AC_DEFUN([gl_FCNTL_O_FLAGS], [ + dnl Persuade glibc to define O_NOATIME and O_NOFOLLOW. + dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes + dnl AC_GNU_SOURCE. + m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], + [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])], + [AC_REQUIRE([AC_GNU_SOURCE])]) + + AC_CHECK_HEADERS_ONCE([unistd.h]) + AC_CHECK_FUNCS_ONCE([symlink]) + AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #if HAVE_UNISTD_H + # include + #else /* on Windows with MSVC */ + # include + # include + # defined sleep(n) _sleep ((n) * 1000) + #endif + #include + #ifndef O_NOATIME + #define O_NOATIME 0 + #endif + #ifndef O_NOFOLLOW + #define O_NOFOLLOW 0 + #endif + static int const constants[] = + { + O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, + O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY + }; + ]], + [[ + int result = !constants; + #if HAVE_SYMLINK + { + static char const sym[] = "conftest.sym"; + if (symlink ("/dev/null", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + if (unlink (sym) != 0 || symlink (".", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_RDONLY | O_NOFOLLOW); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + unlink (sym); + } + #endif + { + static char const file[] = "confdefs.h"; + int fd = open (file, O_RDONLY | O_NOATIME); + if (fd < 0) + result |= 8; + else + { + struct stat st0; + if (fstat (fd, &st0) != 0) + result |= 16; + else + { + char c; + sleep (1); + if (read (fd, &c, 1) != 1) + result |= 24; + else + { + if (close (fd) != 0) + result |= 32; + else + { + struct stat st1; + if (stat (file, &st1) != 0) + result |= 40; + else + if (st0.st_atime != st1.st_atime) + result |= 64; + } + } + } + } + } + return result;]])], + [gl_cv_header_working_fcntl_h=yes], + [case $? in #( + 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( + 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( + 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( + *) gl_cv_header_working_fcntl_h='no';; + esac], + [gl_cv_header_working_fcntl_h=cross-compiling])]) + + case $gl_cv_header_working_fcntl_h in #( + *O_NOATIME* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val], + [Define to 1 if O_NOATIME works.]) + + case $gl_cv_header_working_fcntl_h in #( + *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val], + [Define to 1 if O_NOFOLLOW works.]) +]) +m4trace:m4/fcntl.m4:16: -1- AC_DEFUN([gl_FUNC_FCNTL], [ + dnl Persuade glibc to expose F_DUPFD_CLOEXEC. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_FUNCS_ONCE([fcntl]) + if test $ac_cv_func_fcntl = no; then + gl_REPLACE_FCNTL + else + dnl cygwin 1.5.x F_DUPFD has wrong errno, and allows negative target + dnl haiku alpha 2 F_DUPFD has wrong errno + AC_CACHE_CHECK([whether fcntl handles F_DUPFD correctly], + [gl_cv_func_fcntl_f_dupfd_works], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #include + #include + #include + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + ]], + [[int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + if (fcntl (0, F_DUPFD, -1) != -1) result |= 1; + if (errno != EINVAL) result |= 2; + if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4; + if (errno != EINVAL) result |= 8; + /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */ + { + int fd; + fd = open (".", O_RDONLY); + if (fd == -1) + result |= 16; + else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1) + result |= 32; + + close (fd); + } + return result;]])], + [gl_cv_func_fcntl_f_dupfd_works=yes], + [gl_cv_func_fcntl_f_dupfd_works=no], + [case $host_os in + aix* | cygwin* | haiku*) + gl_cv_func_fcntl_f_dupfd_works="guessing no" ;; + *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;; + esac])]) + case $gl_cv_func_fcntl_f_dupfd_works in + *yes) ;; + *) gl_REPLACE_FCNTL + AC_DEFINE([FCNTL_DUPFD_BUGGY], [1], [Define this to 1 if F_DUPFD + behavior does not match POSIX]) ;; + esac + + dnl Many systems lack F_DUPFD_CLOEXEC + AC_CACHE_CHECK([whether fcntl understands F_DUPFD_CLOEXEC], + [gl_cv_func_fcntl_f_dupfd_cloexec], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +#ifndef F_DUPFD_CLOEXEC +choke me +#endif + ]])], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#ifdef __linux__ +/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace + it to support the semantics on older kernels that failed with EINVAL. */ +choke me +#endif + ]])], + [gl_cv_func_fcntl_f_dupfd_cloexec=yes], + [gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"])], + [gl_cv_func_fcntl_f_dupfd_cloexec=no])]) + if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then + gl_REPLACE_FCNTL + dnl No witness macro needed for this bug. + fi + fi + dnl Replace fcntl() for supporting the gnulib-defined fchdir() function, + dnl to keep fchdir's bookkeeping up-to-date. + m4_ifdef([gl_FUNC_FCHDIR], [ + gl_TEST_FCHDIR + if test $HAVE_FCHDIR = 0; then + gl_REPLACE_FCNTL + fi + ]) +]) +m4trace:m4/fcntl.m4:117: -1- AC_DEFUN([gl_REPLACE_FCNTL], [ + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([fcntl]) + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi +]) +m4trace:m4/fcntl_h.m4:10: -1- AC_DEFUN([gl_FCNTL_H], [ + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + AC_REQUIRE([gl_FCNTL_O_FLAGS]) + gl_NEXT_HEADERS([fcntl.h]) + + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) + + dnl Ensure the type mode_t gets defined. + AC_REQUIRE([AC_TYPE_MODE_T]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use, if it is not common + dnl enough to be declared everywhere. + gl_WARN_ON_USE_PREPARE([[#include + ]], [fcntl openat]) +]) +m4trace:m4/fcntl_h.m4:29: -1- AC_DEFUN([gl_FCNTL_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) +m4trace:m4/fcntl_h.m4:38: -1- AC_DEFUN([gl_FCNTL_H_DEFAULTS], [ + GNULIB_FCNTL=0; AC_SUBST([GNULIB_FCNTL]) + GNULIB_NONBLOCKING=0; AC_SUBST([GNULIB_NONBLOCKING]) + GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN]) + GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL]) + HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT]) + REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL]) + REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN]) + REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT]) +]) +m4trace:m4/fdopen.m4:7: -1- AC_DEFUN([gl_FUNC_FDOPEN], [ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + m4_ifdef([gl_MSVC_INVAL], [ + AC_REQUIRE([gl_MSVC_INVAL]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_FDOPEN=1 + fi + ]) + if test $REPLACE_FDOPEN = 0; then + dnl Test whether fdopen() sets errno when it fails due to a bad fd argument. + AC_CACHE_CHECK([whether fdopen sets errno], [gl_cv_func_fdopen_works], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +int +main (void) +{ + FILE *fp; + errno = 0; + fp = fdopen (-1, "r"); + if (fp == NULL && errno == 0) + return 1; + return 0; +}]])], + [gl_cv_func_fdopen_works=yes], + [gl_cv_func_fdopen_works=no], + [case "$host_os" in + mingw*) gl_cv_func_fdopen_works="guessing no" ;; + *) gl_cv_func_fdopen_works="guessing yes" ;; + esac + ]) + ]) + case "$gl_cv_func_fdopen_works" in + *no) REPLACE_FDOPEN=1 ;; + esac + fi +]) +m4trace:m4/fdopen.m4:50: -1- AC_DEFUN([gl_PREREQ_FDOPEN], []) +m4trace:m4/filenamecat.m4:7: -1- AC_DEFUN([gl_FILE_NAME_CONCAT], [ + AC_REQUIRE([gl_FILE_NAME_CONCAT_LGPL]) +]) +m4trace:m4/filenamecat.m4:12: -1- AC_DEFUN([gl_FILE_NAME_CONCAT_LGPL], [ + dnl Prerequisites of lib/filenamecat-lgpl.c. + AC_CHECK_FUNCS_ONCE([mempcpy]) +]) +m4trace:m4/flexmember.m4:11: -1- AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER], [ + AC_CACHE_CHECK([for flexible array member], + ac_cv_c_flexmember, + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #include + struct m { struct m *next, **list; char name[]; }; + struct s { struct s *p; struct m *m; int n; double d[]; };]], + [[int m = getchar (); + size_t nbytes = offsetof (struct s, d) + m * sizeof (double); + nbytes += sizeof (struct s) - 1; + nbytes -= nbytes % sizeof (struct s); + struct s *p = malloc (nbytes); + p->p = p; + p->m = NULL; + p->d[0] = 0.0; + return p->d != (double *) NULL;]])], + [ac_cv_c_flexmember=yes], + [ac_cv_c_flexmember=no])]) + if test $ac_cv_c_flexmember = yes; then + AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [], + [Define to nothing if C supports flexible array members, and to + 1 if it does not. That way, with a declaration like 'struct s + { int n; double d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };', the struct hack + can be used with pre-C99 compilers. + When computing the size of such an object, don't use 'sizeof (struct s)' + as it overestimates the size. Use 'offsetof (struct s, d)' instead. + Don't use 'offsetof (struct s, d@<:@0@:>@)', as this doesn't work with + MSVC and with C++ compilers.]) + else + AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [1]) + fi +]) +m4trace:m4/float_h.m4:7: -1- AC_DEFUN([gl_FLOAT_H], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + FLOAT_H= + REPLACE_FLOAT_LDBL=0 + case "$host_os" in + aix* | beos* | openbsd* | mirbsd* | irix*) + FLOAT_H=float.h + ;; + freebsd*) + case "$host_cpu" in +changequote(,)dnl + i[34567]86 ) +changequote([,])dnl + FLOAT_H=float.h + ;; + x86_64 ) + # On x86_64 systems, the C compiler may still be generating + # 32-bit code. + AC_EGREP_CPP([yes], + [#if defined __LP64__ || defined __x86_64__ || defined __amd64__ + yes + #endif], + [], + [FLOAT_H=float.h]) + ;; + esac + ;; + linux*) + case "$host_cpu" in + powerpc*) + FLOAT_H=float.h + ;; + esac + ;; + esac + case "$host_os" in + aix* | freebsd* | linux*) + if test -n "$FLOAT_H"; then + REPLACE_FLOAT_LDBL=1 + fi + ;; + esac + + dnl Test against glibc-2.7 Linux/SPARC64 bug. + REPLACE_ITOLD=0 + AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works], + [gl_cv_func_itold_works], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +int i = -1; +volatile long double ld; +int main () +{ + ld += i * 1.0L; + if (ld > 0) + return 1; + return 0; +}]])], + [gl_cv_func_itold_works=yes], + [gl_cv_func_itold_works=no], + [case "$host" in + sparc*-*-linux*) + AC_EGREP_CPP([yes], + [#if defined __LP64__ || defined __arch64__ + yes + #endif], + [gl_cv_func_itold_works="guessing no"], + [gl_cv_func_itold_works="guessing yes"]) + ;; + *) gl_cv_func_itold_works="guessing yes" ;; + esac + ]) + ]) + case "$gl_cv_func_itold_works" in + *no) + REPLACE_ITOLD=1 + dnl We add the workaround to but also to , + dnl to increase the chances that the fix function gets pulled in. + FLOAT_H=float.h + ;; + esac + + if test -n "$FLOAT_H"; then + gl_NEXT_HEADERS([float.h]) + fi + AC_SUBST([FLOAT_H]) + AM_CONDITIONAL([GL_GENERATE_FLOAT_H], [test -n "$FLOAT_H"]) + AC_SUBST([REPLACE_ITOLD]) +]) +m4trace:m4/fnmatch.m4:12: -1- AC_DEFUN([gl_FUNC_FNMATCH_POSIX], [ + m4_divert_text([DEFAULTS], [gl_fnmatch_required=POSIX]) + + dnl Persuade glibc to declare FNM_CASEFOLD etc. + dnl This is only needed if gl_fnmatch_required = GNU. It would be possible + dnl to avoid this dependency for gl_FUNC_FNMATCH_POSIX by putting + dnl gl_FUNC_FNMATCH_GNU into a separate .m4 file. + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + FNMATCH_H= + gl_fnmatch_required_lowercase=` + echo $gl_fnmatch_required | LC_ALL=C tr '[[A-Z]]' '[[a-z]]' + ` + gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" + AC_CACHE_CHECK([for working $gl_fnmatch_required fnmatch], + [$gl_fnmatch_cache_var], + [dnl Some versions of Solaris, SCO, and the GNU C Library + dnl have a broken or incompatible fnmatch. + dnl So we run a test program. If we are cross-compiling, take no chance. + dnl Thanks to John Oleynick, François Pinard, and Paul Eggert for this + dnl test. + if test $gl_fnmatch_required = GNU; then + gl_fnmatch_gnu_start= + gl_fnmatch_gnu_end= + else + gl_fnmatch_gnu_start='#if 0' + gl_fnmatch_gnu_end='#endif' + fi + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + static int + y (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == 0; + } + static int + n (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == FNM_NOMATCH; + } + ]], + [[char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]"; + char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]"; + static char const A_1[] = { 'A' - 1, 0 }; + static char const A01[] = { 'A' + 1, 0 }; + static char const a_1[] = { 'a' - 1, 0 }; + static char const a01[] = { 'a' + 1, 0 }; + static char const bs_1[] = { '\\\\' - 1, 0 }; + static char const bs01[] = { '\\\\' + 1, 0 }; + int result = 0; + if (!n ("a*", "", 0)) + return 1; + if (!y ("a*", "abc", 0)) + return 1; + if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */ + return 1; + if (!n ("d*/*1", "d/s/1", FNM_PATHNAME)) + return 2; + if (!y ("a\\\\bc", "abc", 0)) + return 3; + if (!n ("a\\\\bc", "abc", FNM_NOESCAPE)) + return 3; + if (!y ("*x", ".x", 0)) + return 4; + if (!n ("*x", ".x", FNM_PERIOD)) + return 4; + if (!y (Apat, "\\\\", 0)) + return 5; + if (!y (Apat, "A", 0)) + return 5; + if (!y (apat, "\\\\", 0)) + return 5; + if (!y (apat, "a", 0)) + return 5; + if (!(n (Apat, A_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, a_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, A01, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, a01, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, bs_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, bs_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(n (Apat, bs01, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, bs01, 0) == ('a' < '\\\\'))) + return 5; + $gl_fnmatch_gnu_start + if (!y ("xxXX", "xXxX", FNM_CASEFOLD)) + result |= 8; + if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)) + result |= 16; + if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME)) + result |= 32; + if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + $gl_fnmatch_gnu_end + return result; + ]])], + [eval "$gl_fnmatch_cache_var=yes"], + [eval "$gl_fnmatch_cache_var=no"], + [eval "$gl_fnmatch_cache_var=\"guessing no\""]) + ]) + eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\"" + if test "$gl_fnmatch_result" = yes; then + dnl Not strictly necessary. Only to avoid spurious leftover files if people + dnl don't do "make distclean". + rm -f "$gl_source_base/fnmatch.h" + else + FNMATCH_H=fnmatch.h + fi + AC_SUBST([FNMATCH_H]) + AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_H"]) +]) +m4trace:m4/fnmatch.m4:137: -1- AC_DEFUN([gl_FUNC_FNMATCH_GNU], [ + m4_divert_text([INIT_PREPARE], [gl_fnmatch_required=GNU]) + + AC_REQUIRE([gl_FUNC_FNMATCH_POSIX]) +]) +m4trace:m4/fnmatch.m4:144: -1- AC_DEFUN([gl_PREREQ_FNMATCH], [ + dnl We must choose a different name for our function, since on ELF systems + dnl a broken fnmatch() in libc.so would override our fnmatch() if it is + dnl compiled into a shared library. + AC_DEFINE_UNQUOTED([fnmatch], [${gl_fnmatch_required_lowercase}_fnmatch], + [Define to a replacement function name for fnmatch().]) + dnl Prerequisites of lib/fnmatch.c. + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + AC_CHECK_DECLS([isblank], [], [], [[#include ]]) + AC_CHECK_FUNCS_ONCE([btowc isblank iswctype mbsrtowcs mempcpy wmemchr wmemcpy wmempcpy]) + AC_CHECK_HEADERS_ONCE([wctype.h]) +]) +m4trace:m4/fpieee.m4:25: -1- AC_DEFUN([gl_FP_IEEE], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + # IEEE behaviour is the default on all CPUs except Alpha and SH + # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 + # and the GCC 4.1.2 manual). + case "$host_cpu" in + alpha*) + # On Alpha systems, a compiler option provides the behaviour. + # See the ieee(3) manual page, also available at + # + if test -n "$GCC"; then + # GCC has the option -mieee. + # For full IEEE compliance (rarely needed), use option -mieee-with-inexact. + CPPFLAGS="$CPPFLAGS -mieee" + else + # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact. + # For full IEEE compliance (rarely needed), use option -ieee_with_inexact. + CPPFLAGS="$CPPFLAGS -ieee" + fi + ;; + sh*) + if test -n "$GCC"; then + # GCC has the option -mieee. + CPPFLAGS="$CPPFLAGS -mieee" + fi + ;; + esac +]) +m4trace:m4/freopen.m4:7: -1- AC_DEFUN([gl_FUNC_FREOPEN], [ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw* | pw* | os2*) + REPLACE_FREOPEN=1 + ;; + *) + AC_CACHE_CHECK([whether freopen works on closed fds], + [gl_cv_func_freopen_works_on_closed], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + ]], + [[close (0); + return !(freopen ("/dev/null", "r", stdin) + && getchar () == EOF + && !ferror (stdin) && feof (stdin));]])], + [gl_cv_func_freopen_works_on_closed=yes], + [gl_cv_func_freopen_works_on_closed=no], + [case $host_os in + *gnu*) gl_cv_func_freopen_works_on_closed="guessing no" ;; + *) gl_cv_func_freopen_works_on_closed="guessing yes";; + esac])]) + case $gl_cv_func_freopen_works_on_closed in + *no) REPLACE_FREOPEN=1;; + esac + esac +]) +m4trace:m4/freopen.m4:40: -1- AC_DEFUN([gl_PREREQ_FREOPEN], [:]) +m4trace:m4/fstat.m4:7: -1- AC_DEFUN([gl_FUNC_FSTAT], [ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + + case "$host_os" in + mingw*) + dnl On this platform, the original stat() returns st_atime, st_mtime, + dnl st_ctime values that are affected by the time zone. + REPLACE_FSTAT=1 + ;; + esac + + dnl Replace fstat() for supporting the gnulib-defined open() on directories. + m4_ifdef([gl_FUNC_FCHDIR], [ + gl_TEST_FCHDIR + if test $HAVE_FCHDIR = 0; then + case "$gl_cv_func_open_directory_works" in + *yes) ;; + *) + REPLACE_FSTAT=1 + ;; + esac + fi + ]) +]) +m4trace:m4/fstat.m4:35: -1- AC_DEFUN([gl_PREREQ_FSTAT], [ + AC_REQUIRE([gl_HEADER_SYS_STAT_H]) + : +]) +m4trace:m4/ftruncate.m4:10: -1- AC_DEFUN([gl_FUNC_FTRUNCATE], [ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([ftruncate]) + if test $ac_cv_func_ftruncate = yes; then + m4_ifdef([gl_LARGEFILE], [ + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw*) + dnl Native Windows, and Large File Support is requested. + dnl The MSVCRT _chsize() function only accepts a 32-bit file size, + dnl and the mingw64 ftruncate64() function is unreliable (it may + dnl delete the file, see + dnl ). + dnl Use gnulib's ftruncate() implementation instead. + REPLACE_FTRUNCATE=1 + ;; + esac + ], [ + : + ]) + else + HAVE_FTRUNCATE=0 + fi +]) +m4trace:m4/ftruncate.m4:37: -1- AC_DEFUN([gl_PREREQ_FTRUNCATE], [ + AC_CHECK_FUNCS([chsize]) +]) +m4trace:m4/getcwd.m4:11: -1- AC_DEFUN([gl_FUNC_GETCWD_NULL], [ + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CHECK_HEADERS_ONCE([unistd.h]) + AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result], + [gl_cv_func_getcwd_null], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +# include +# if HAVE_UNISTD_H +# include +# else /* on Windows with MSVC */ +# include +# endif +# ifndef getcwd + char *getcwd (); +# endif +]], [[ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* mingw cwd does not start with '/', but getcwd does allocate. + However, mingw fails to honor non-zero size. */ +#else + if (chdir ("/") != 0) + return 1; + else + { + char *f = getcwd (NULL, 0); + if (! f) + return 2; + if (f[0] != '/') + return 3; + if (f[1] != '\0') + return 4; + free (f); + return 0; + } +#endif + ]])], + [gl_cv_func_getcwd_null=yes], + [gl_cv_func_getcwd_null=no], + [[case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_getcwd_null="guessing yes";; + # Guess yes on Cygwin. + cygwin*) gl_cv_func_getcwd_null="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_getcwd_null="guessing no";; + esac + ]])]) +]) +m4trace:m4/getcwd.m4:61: -1- AC_DEFUN([gl_FUNC_GETCWD_SIGNATURE], [ + AC_CACHE_CHECK([for getcwd with POSIX signature], + [gl_cv_func_getcwd_posix_signature], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[extern + #ifdef __cplusplus + "C" + #endif + char *getcwd (char *, size_t); + ]]) + ], + [gl_cv_func_getcwd_posix_signature=yes], + [gl_cv_func_getcwd_posix_signature=no]) + ]) +]) +m4trace:m4/getcwd.m4:87: -1- AC_DEFUN([gl_FUNC_GETCWD_LGPL], [ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([gl_FUNC_GETCWD_NULL]) + AC_REQUIRE([gl_FUNC_GETCWD_SIGNATURE]) + + case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in + *yes,yes) ;; + *) + dnl Minimal replacement lib/getcwd-lgpl.c. + REPLACE_GETCWD=1 + ;; + esac +]) +m4trace:m4/getcwd.m4:104: -1- AC_DEFUN([gl_FUNC_GETCWD], [ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([gl_FUNC_GETCWD_NULL]) + AC_REQUIRE([gl_FUNC_GETCWD_SIGNATURE]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + gl_abort_bug=no + case "$host_os" in + mingw*) + gl_cv_func_getcwd_path_max=yes + ;; + *) + gl_FUNC_GETCWD_PATH_MAX + case "$gl_cv_func_getcwd_null" in + *yes) + gl_FUNC_GETCWD_ABORT_BUG([gl_abort_bug=yes]) + ;; + esac + ;; + esac + dnl Define HAVE_MINIMALLY_WORKING_GETCWD and HAVE_PARTLY_WORKING_GETCWD + dnl if appropriate. + case "$gl_cv_func_getcwd_path_max" in + "no"|"no, it has the AIX bug") ;; + *) + AC_DEFINE([HAVE_MINIMALLY_WORKING_GETCWD], [1], + [Define to 1 if getcwd minimally works, that is, its result can be + trusted when it succeeds.]) + ;; + esac + case "$gl_cv_func_getcwd_path_max" in + "no, but it is partly working") + AC_DEFINE([HAVE_PARTLY_WORKING_GETCWD], [1], + [Define to 1 if getcwd works, except it sometimes fails when it + shouldn't, setting errno to ERANGE, ENAMETOOLONG, or ENOENT.]) + ;; + "yes, but with shorter paths") + AC_DEFINE([HAVE_GETCWD_SHORTER], [1], + [Define to 1 if getcwd works, but with shorter paths + than is generally tested with the replacement.]) + ;; + esac + + if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \ + || test $gl_cv_func_getcwd_posix_signature != yes \ + || { case "$gl_cv_func_getcwd_path_max" in *yes*) false;; *) true;; esac; } \ + || test $gl_abort_bug = yes; then + REPLACE_GETCWD=1 + fi +]) +m4trace:m4/getcwd.m4:157: -1- AC_DEFUN([gl_PREREQ_GETCWD], [ + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO]) + : +]) +m4trace:m4/getdtablesize.m4:7: -1- AC_DEFUN([gl_FUNC_GETDTABLESIZE], [ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_FUNCS_ONCE([getdtablesize]) + AC_CHECK_DECLS_ONCE([getdtablesize]) + if test $ac_cv_func_getdtablesize = yes && + test $ac_cv_have_decl_getdtablesize = yes; then + # Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft limit + # up to an unchangeable hard limit; all other platforms correctly + # require setrlimit before getdtablesize() can report a larger value. + AC_CACHE_CHECK([whether getdtablesize works], + [gl_cv_func_getdtablesize_works], + [AC_RUN_IFELSE([ + AC_LANG_PROGRAM([[#include ]], + [int size = getdtablesize(); + if (dup2 (0, getdtablesize()) != -1) + return 1; + if (size != getdtablesize()) + return 2; + ])], + [gl_cv_func_getdtablesize_works=yes], + [gl_cv_func_getdtablesize_works=no], + [case "$host_os" in + cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows + gl_cv_func_getdtablesize_works="guessing no" ;; + *) gl_cv_func_getdtablesize_works="guessing yes" ;; + esac]) + ]) + case "$gl_cv_func_getdtablesize_works" in + *yes) ;; + *) REPLACE_GETDTABLESIZE=1 ;; + esac + else + HAVE_GETDTABLESIZE=0 + fi +]) +m4trace:m4/getdtablesize.m4:46: -1- AC_DEFUN([gl_PREREQ_GETDTABLESIZE], [:]) +m4trace:m4/getopt.m4:8: -1- AC_DEFUN([gl_FUNC_GETOPT_POSIX], [ + m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX]) + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([gl_GETOPT_CHECK_HEADERS]) + dnl Other modules can request the gnulib implementation of the getopt + dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS. + dnl argp.m4 does this. + m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [ + REPLACE_GETOPT=1 + ], [ + REPLACE_GETOPT=0 + if test -n "$gl_replace_getopt"; then + REPLACE_GETOPT=1 + fi + ]) + if test $REPLACE_GETOPT = 1; then + dnl Arrange for getopt.h to be created. + gl_GETOPT_SUBSTITUTE_HEADER + fi +]) +m4trace:m4/getopt.m4:33: -1- AC_DEFUN([gl_FUNC_GETOPT_GNU], [ + dnl Set the variable gl_getopt_required, so that all invocations of + dnl gl_GETOPT_CHECK_HEADERS in the scope of the current configure file + dnl will check for getopt with GNU extensions. + dnl This means that if one gnulib-tool invocation requests getopt-posix + dnl and another gnulib-tool invocation requests getopt-gnu, it is as if + dnl both had requested getopt-gnu. + m4_divert_text([INIT_PREPARE], [gl_getopt_required=GNU]) + + dnl No need to invoke gl_FUNC_GETOPT_POSIX here; this is automatically + dnl done through the module dependency getopt-gnu -> getopt-posix. +]) +m4trace:m4/getopt.m4:48: -1- AC_DEFUN([gl_GETOPT_CHECK_HEADERS], [ + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([AC_PROG_AWK]) dnl for awk that supports ENVIRON + + dnl Persuade Solaris to declare optarg, optind, opterr, optopt. + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + gl_CHECK_NEXT_HEADERS([getopt.h]) + if test $ac_cv_header_getopt_h = yes; then + HAVE_GETOPT_H=1 + else + HAVE_GETOPT_H=0 + fi + AC_SUBST([HAVE_GETOPT_H]) + + gl_replace_getopt= + + dnl Test whether is available. + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + AC_CHECK_HEADERS([getopt.h], [], [gl_replace_getopt=yes]) + fi + + dnl Test whether the function getopt_long is available. + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes]) + fi + + dnl POSIX 2008 does not specify leading '+' behavior, but see + dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on + dnl the next version of POSIX. For now, we only guarantee leading '+' + dnl behavior with getopt-gnu. + if test -z "$gl_replace_getopt"; then + AC_CACHE_CHECK([whether getopt is POSIX compatible], + [gl_cv_func_getopt_posix], + [ + dnl Merging these three different test programs into a single one + dnl would require a reset mechanism. On BSD systems, it can be done + dnl through 'optreset'; on some others (glibc), it can be done by + dnl setting 'optind' to 0; on others again (HP-UX, IRIX, OSF/1, + dnl Solaris 9, musl libc), there is no such mechanism. + if test $cross_compiling = no; then + dnl Sanity check. Succeeds everywhere (except on MSVC, + dnl which lacks and getopt() entirely). + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char a[] = "-a"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, a, foo, bar, NULL }; + int c; + + c = getopt (4, argv, "ab"); + if (!(c == 'a')) + return 1; + c = getopt (4, argv, "ab"); + if (!(c == -1)) + return 2; + if (!(optind == 2)) + return 3; + return 0; +} +]])], + [gl_cv_func_getopt_posix=maybe], + [gl_cv_func_getopt_posix=no]) + if test $gl_cv_func_getopt_posix = maybe; then + dnl Sanity check with '+'. Succeeds everywhere (except on MSVC, + dnl which lacks and getopt() entirely). + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char donald[] = "donald"; + static char p[] = "-p"; + static char billy[] = "billy"; + static char duck[] = "duck"; + static char a[] = "-a"; + static char bar[] = "bar"; + char *argv[] = { program, donald, p, billy, duck, a, bar, NULL }; + int c; + + c = getopt (7, argv, "+abp:q:"); + if (!(c == -1)) + return 4; + if (!(strcmp (argv[0], "program") == 0)) + return 5; + if (!(strcmp (argv[1], "donald") == 0)) + return 6; + if (!(strcmp (argv[2], "-p") == 0)) + return 7; + if (!(strcmp (argv[3], "billy") == 0)) + return 8; + if (!(strcmp (argv[4], "duck") == 0)) + return 9; + if (!(strcmp (argv[5], "-a") == 0)) + return 10; + if (!(strcmp (argv[6], "bar") == 0)) + return 11; + if (!(optind == 1)) + return 12; + return 0; +} +]])], + [gl_cv_func_getopt_posix=maybe], + [gl_cv_func_getopt_posix=no]) + fi + if test $gl_cv_func_getopt_posix = maybe; then + dnl Detect Mac OS X 10.5, AIX 7.1, mingw bug. + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char ab[] = "-ab"; + char *argv[3] = { program, ab, NULL }; + if (getopt (2, argv, "ab:") != 'a') + return 13; + if (getopt (2, argv, "ab:") != '?') + return 14; + if (optopt != 'b') + return 15; + if (optind != 2) + return 16; + return 0; +} +]])], + [gl_cv_func_getopt_posix=yes], + [gl_cv_func_getopt_posix=no]) + fi + else + case "$host_os" in + darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";; + *) gl_cv_func_getopt_posix="guessing yes";; + esac + fi + ]) + case "$gl_cv_func_getopt_posix" in + *no) gl_replace_getopt=yes ;; + esac + fi + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_getopt_gnu], + [# Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the + # optstring is necessary for programs like m4 that have POSIX-mandated + # semantics for supporting options interspersed with files. + # Also, since getopt_long is a GNU extension, we require optind=0. + # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT; + # so take care to revert to the correct (non-)export state. +dnl GNU Coding Standards currently allow awk but not env; besides, env +dnl is ambiguous with environment values that contain newlines. + gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }' + case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" + #include + #include + ]GL_NOCRASH[ + ]], [[ + int result = 0; + + nocrash_init(); + + /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw, + and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5, + OSF/1 5.1, Solaris 10. */ + { + static char conftest[] = "conftest"; + static char plus[] = "-+"; + char *argv[3] = { conftest, plus, NULL }; + opterr = 0; + if (getopt (2, argv, "+a") != '?') + result |= 1; + } + /* This code succeeds on glibc 2.8, mingw, + and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11, + IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */ + { + static char program[] = "program"; + static char p[] = "-p"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, p, foo, bar, NULL }; + + optind = 1; + if (getopt (4, argv, "p::") != 'p') + result |= 2; + else if (optarg != NULL) + result |= 4; + else if (getopt (4, argv, "p::") != -1) + result |= 6; + else if (optind != 2) + result |= 8; + } + /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */ + { + static char program[] = "program"; + static char foo[] = "foo"; + static char p[] = "-p"; + char *argv[] = { program, foo, p, NULL }; + optind = 0; + if (getopt (3, argv, "-p") != 1) + result |= 16; + else if (getopt (3, argv, "-p") != 'p') + result |= 16; + } + /* This code fails on glibc 2.11. */ + { + static char program[] = "program"; + static char b[] = "-b"; + static char a[] = "-a"; + char *argv[] = { program, b, a, NULL }; + optind = opterr = 0; + if (getopt (3, argv, "+:a:b") != 'b') + result |= 32; + else if (getopt (3, argv, "+:a:b") != ':') + result |= 32; + } + /* This code dumps core on glibc 2.14. */ + { + static char program[] = "program"; + static char w[] = "-W"; + static char dummy[] = "dummy"; + char *argv[] = { program, w, dummy, NULL }; + optind = opterr = 1; + if (getopt (3, argv, "W;") != 'W') + result |= 64; + } + return result; + ]])], + [gl_cv_func_getopt_gnu=yes], + [gl_cv_func_getopt_gnu=no], + [dnl Cross compiling. Assume the worst, even on glibc platforms. + gl_cv_func_getopt_gnu="guessing no" + ]) + case $gl_had_POSIXLY_CORRECT in + exported) ;; + yes) AS_UNSET([POSIXLY_CORRECT]); POSIXLY_CORRECT=1 ;; + *) AS_UNSET([POSIXLY_CORRECT]) ;; + esac + ]) + if test "$gl_cv_func_getopt_gnu" != yes; then + gl_replace_getopt=yes + else + AC_CACHE_CHECK([for working GNU getopt_long function], + [gl_cv_func_getopt_long_gnu], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #include + ]], + [[static const struct option long_options[] = + { + { "xtremely-",no_argument, NULL, 1003 }, + { "xtra", no_argument, NULL, 1001 }, + { "xtreme", no_argument, NULL, 1002 }, + { "xtremely", no_argument, NULL, 1003 }, + { NULL, 0, NULL, 0 } + }; + /* This code fails on OpenBSD 5.0. */ + { + static char program[] = "program"; + static char xtremel[] = "--xtremel"; + char *argv[] = { program, xtremel, NULL }; + int option_index; + optind = 1; opterr = 0; + if (getopt_long (2, argv, "", long_options, &option_index) != 1003) + return 1; + } + return 0; + ]])], + [gl_cv_func_getopt_long_gnu=yes], + [gl_cv_func_getopt_long_gnu=no], + [dnl Cross compiling. Guess no on OpenBSD, yes otherwise. + case "$host_os" in + openbsd*) gl_cv_func_getopt_long_gnu="guessing no";; + *) gl_cv_func_getopt_long_gnu="guessing yes";; + esac + ]) + ]) + case "$gl_cv_func_getopt_long_gnu" in + *yes) ;; + *) gl_replace_getopt=yes ;; + esac + fi + fi +]) +m4trace:m4/getopt.m4:362: -1- AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER], [ + AC_CHECK_HEADERS_ONCE([sys/cdefs.h]) + if test $ac_cv_header_sys_cdefs_h = yes; then + HAVE_SYS_CDEFS_H=1 + else + HAVE_SYS_CDEFS_H=0 + fi + AC_SUBST([HAVE_SYS_CDEFS_H]) + + AC_DEFINE([__GETOPT_PREFIX], [[rpl_]], + [Define to rpl_ if the getopt replacement functions and variables + should be used.]) + GETOPT_H=getopt.h + GETOPT_CDEFS_H=getopt-cdefs.h + AC_SUBST([GETOPT_H]) + AC_SUBST([GETOPT_CDEFS_H]) +]) +m4trace:m4/getpagesize.m4:8: -1- AC_DEFUN([gl_FUNC_GETPAGESIZE], [ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_FUNCS([getpagesize]) + if test $ac_cv_func_getpagesize = no; then + HAVE_GETPAGESIZE=0 + AC_CHECK_HEADERS([OS.h]) + if test $ac_cv_header_OS_h = yes; then + HAVE_OS_H=1 + fi + AC_CHECK_HEADERS([sys/param.h]) + if test $ac_cv_header_sys_param_h = yes; then + HAVE_SYS_PARAM_H=1 + fi + fi + case "$host_os" in + mingw*) + REPLACE_GETPAGESIZE=1 + ;; + esac + dnl Also check whether it's declared. + dnl mingw has getpagesize() in libgcc.a but doesn't declare it. + AC_CHECK_DECL([getpagesize], , [HAVE_DECL_GETPAGESIZE=0]) +]) +m4trace:m4/getprogname.m4:10: -1- AC_DEFUN([gl_FUNC_GETPROGNAME], [ + AC_CHECK_FUNCS_ONCE([getprogname getexecname]) + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + ac_found=0 + AC_CHECK_DECLS([program_invocation_name], [ac_found=1], [], + [#include ]) + AC_CHECK_DECLS([program_invocation_short_name], [ac_found=1], [], + [#include ]) + AC_CHECK_DECLS([__argv], [ac_found=1], [], [#include ]) + + # Incur the cost of this test only if none of the above worked. + if test $ac_found = 0; then + # On OpenBSD 5.1, using the global __progname variable appears to be + # the only way to implement getprogname. + AC_CACHE_CHECK([whether __progname is defined in default libraries], + [gl_cv_var___progname], + [ + gl_cv_var___progname= + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[extern char *__progname;]], + [[return *__progname;]] + )], + [gl_cv_var___progname=yes] + ) + ] + ) + if test "$gl_cv_var___progname" = yes; then + AC_DEFINE([HAVE_VAR___PROGNAME], 1, + [Define if you have a global __progname variable]) + fi + fi +]) +m4trace:m4/gettext.m4:57: -1- AC_DEFUN([AM_GNU_GETTEXT], [ + dnl Argument checking. + ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , + [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT +])])])])]) + ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], + [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])]) + ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , + [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT +])])])]) + define([gt_included_intl], + ifelse([$1], [external], + ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), + [yes])) + define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) + gt_NEEDS_INIT + AM_GNU_GETTEXT_NEED([$2]) + + AC_REQUIRE([AM_PO_SUBDIRS])dnl + ifelse(gt_included_intl, yes, [ + AC_REQUIRE([AM_INTL_SUBDIR])dnl + ]) + + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Sometimes libintl requires libiconv, so first search for libiconv. + dnl Ideally we would do this search only after the + dnl if test "$USE_NLS" = "yes"; then + dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT + dnl the configure script would need to contain the same shell code + dnl again, outside any 'if'. There are two solutions: + dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. + dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. + dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not + dnl documented, we avoid it. + ifelse(gt_included_intl, yes, , [ + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + ]) + + dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation. + gt_INTL_MACOSX + + dnl Set USE_NLS. + AC_REQUIRE([AM_NLS]) + + ifelse(gt_included_intl, yes, [ + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + ]) + LIBINTL= + LTLIBINTL= + POSUB= + + dnl Add a version number to the cache macros. + case " $gt_needs " in + *" need-formatstring-macros "*) gt_api_version=3 ;; + *" need-ngettext "*) gt_api_version=2 ;; + *) gt_api_version=1 ;; + esac + gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" + gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + + dnl If we use NLS figure out what method + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + ifelse(gt_included_intl, yes, [ + AC_MSG_CHECKING([whether included gettext is requested]) + AC_ARG_WITH([included-gettext], + [ --with-included-gettext use the GNU gettext library included here], + nls_cv_force_use_gnu_gettext=$withval, + nls_cv_force_use_gnu_gettext=no) + AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext]) + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + ]) + dnl User does not insist on using GNU NLS library. Figure out what + dnl to use. If GNU gettext is available we use this. Else we have + dnl to fall back to GNU NLS library. + + if test $gt_api_version -ge 3; then + gt_revision_test_code=' +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +changequote(,)dnl +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +changequote([,])dnl +' + else + gt_revision_test_code= + fi + if test $gt_api_version -ge 2; then + gt_expression_test_code=' + * ngettext ("", "", 0)' + else + gt_expression_test_code= + fi + + AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings + ]])], + [eval "$gt_func_gnugettext_libc=yes"], + [eval "$gt_func_gnugettext_libc=no"])]) + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + dnl Sometimes libintl requires libiconv, so first search for libiconv. + ifelse(gt_included_intl, yes, , [ + AM_ICONV_LINK + ]) + dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL + dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) + dnl because that would add "-liconv" to LIBINTL and LTLIBINTL + dnl even if libiconv doesn't exist. + AC_LIB_LINKFLAGS_BODY([intl]) + AC_CACHE_CHECK([for GNU gettext in libintl], + [$gt_func_gnugettext_libintl], + [gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + dnl Now see whether libintl exists and does not depend on libiconv. + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ]])], + [eval "$gt_func_gnugettext_libintl=yes"], + [eval "$gt_func_gnugettext_libintl=no"]) + dnl Now see whether libintl exists and depends on libiconv. + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ]])], + [LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" + ]) + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS"]) + fi + + dnl If an already present or preinstalled GNU gettext() is found, + dnl use it. But if this macro is used in GNU gettext, and GNU + dnl gettext is already preinstalled in libintl, we update this + dnl libintl. (Cf. the install rule in intl/Makefile.in.) + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ + || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + dnl Reset the values set by searching for libintl. + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + ifelse(gt_included_intl, yes, [ + if test "$gt_use_preinstalled_gnugettext" != "yes"; then + dnl GNU gettext is not found in the C library. + dnl Fall back on included GNU gettext library. + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions used to generate GNU NLS library. + BUILD_INCLUDED_LIBINTL=yes + USE_INCLUDED_LIBINTL=yes + LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" + LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + fi + + CATOBJEXT= + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions to use GNU gettext tools. + CATOBJEXT=.gmo + fi + ]) + + if test -n "$INTL_MACOSX_LIBS"; then + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Some extra flags are needed during linking. + LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" + LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" + fi + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + AC_DEFINE([ENABLE_NLS], [1], + [Define to 1 if translation of program messages to the user's native language + is requested.]) + else + USE_NLS=no + fi + fi + + AC_MSG_CHECKING([whether to use NLS]) + AC_MSG_RESULT([$USE_NLS]) + if test "$USE_NLS" = "yes"; then + AC_MSG_CHECKING([where the gettext function comes from]) + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + AC_MSG_RESULT([$gt_source]) + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + AC_MSG_CHECKING([how to link with libintl]) + AC_MSG_RESULT([$LIBINTL]) + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) + fi + + dnl For backward compatibility. Some packages may be using this. + AC_DEFINE([HAVE_GETTEXT], [1], + [Define if the GNU gettext() function is already present or preinstalled.]) + AC_DEFINE([HAVE_DCGETTEXT], [1], + [Define if the GNU dcgettext() function is already present or preinstalled.]) + fi + + dnl We need to process the po/ directory. + POSUB=po + fi + + ifelse(gt_included_intl, yes, [ + dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL + dnl to 'yes' because some of the testsuite requires it. + if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then + BUILD_INCLUDED_LIBINTL=yes + fi + + dnl Make all variables we use known to autoconf. + AC_SUBST([BUILD_INCLUDED_LIBINTL]) + AC_SUBST([USE_INCLUDED_LIBINTL]) + AC_SUBST([CATOBJEXT]) + + dnl For backward compatibility. Some configure.ins may be using this. + nls_cv_header_intl= + nls_cv_header_libgt= + + dnl For backward compatibility. Some Makefiles may be using this. + DATADIRNAME=share + AC_SUBST([DATADIRNAME]) + + dnl For backward compatibility. Some Makefiles may be using this. + INSTOBJEXT=.mo + AC_SUBST([INSTOBJEXT]) + + dnl For backward compatibility. Some Makefiles may be using this. + GENCAT=gencat + AC_SUBST([GENCAT]) + + dnl For backward compatibility. Some Makefiles may be using this. + INTLOBJS= + if test "$USE_INCLUDED_LIBINTL" = yes; then + INTLOBJS="\$(GETTOBJS)" + fi + AC_SUBST([INTLOBJS]) + + dnl Enable libtool support if the surrounding package wishes it. + INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix + AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX]) + ]) + + dnl For backward compatibility. Some Makefiles may be using this. + INTLLIBS="$LIBINTL" + AC_SUBST([INTLLIBS]) + + dnl Make all documented variables known to autoconf. + AC_SUBST([LIBINTL]) + AC_SUBST([LTLIBINTL]) + AC_SUBST([POSUB]) +]) +m4trace:m4/gettext.m4:394: -1- AC_DEFUN([AM_GNU_GETTEXT_NEED], [ + m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) +]) +m4trace:m4/gettext.m4:401: -1- AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) +m4trace:m4/gettime.m4:7: -1- AC_DEFUN([gl_GETTIME], [ + dnl Prerequisites of lib/gettime.c. + AC_REQUIRE([gl_CLOCK_TIME]) + AC_REQUIRE([gl_TIMESPEC]) + AC_CHECK_FUNCS_ONCE([gettimeofday nanotime]) +]) +m4trace:m4/gettimeofday.m4:10: -1- AC_DEFUN([gl_FUNC_GETTIMEOFDAY], [ + AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_HEADER_SYS_TIME_H]) + AC_CHECK_FUNCS_ONCE([gettimeofday]) + + gl_gettimeofday_timezone=void + if test $ac_cv_func_gettimeofday != yes; then + HAVE_GETTIMEOFDAY=0 + else + gl_FUNC_GETTIMEOFDAY_CLOBBER + AC_CACHE_CHECK([for gettimeofday with POSIX signature], + [gl_cv_func_gettimeofday_posix_signature], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + struct timeval c; + int gettimeofday (struct timeval *restrict, void *restrict); + ]], + [[/* glibc uses struct timezone * rather than the POSIX void * + if _GNU_SOURCE is defined. However, since the only portable + use of gettimeofday uses NULL as the second parameter, and + since the glibc definition is actually more typesafe, it is + not worth wrapping this to get a compliant signature. */ + int (*f) (struct timeval *restrict, void *restrict) + = gettimeofday; + int x = f (&c, 0); + return !(x | c.tv_sec | c.tv_usec); + ]])], + [gl_cv_func_gettimeofday_posix_signature=yes], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include +int gettimeofday (struct timeval *restrict, struct timezone *restrict); + ]])], + [gl_cv_func_gettimeofday_posix_signature=almost], + [gl_cv_func_gettimeofday_posix_signature=no])])]) + if test $gl_cv_func_gettimeofday_posix_signature = almost; then + gl_gettimeofday_timezone='struct timezone' + elif test $gl_cv_func_gettimeofday_posix_signature != yes; then + REPLACE_GETTIMEOFDAY=1 + fi + dnl If we override 'struct timeval', we also have to override gettimeofday. + if test $REPLACE_STRUCT_TIMEVAL = 1; then + REPLACE_GETTIMEOFDAY=1 + fi + dnl On mingw, the original gettimeofday has only a precision of 15.6 + dnl milliseconds. So override it. + case "$host_os" in + mingw*) REPLACE_GETTIMEOFDAY=1 ;; + esac + fi + AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone], + [Define this to 'void' or 'struct timezone' to match the system's + declaration of the second argument to gettimeofday.]) +]) +m4trace:m4/gettimeofday.m4:77: -1- AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], [ + AC_REQUIRE([gl_HEADER_SYS_TIME_H]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) + + AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer], + [gl_cv_func_gettimeofday_clobber], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #include + #include + ]], + [[ + time_t t = 0; + struct tm *lt; + struct tm saved_lt; + struct timeval tv; + lt = localtime (&t); + saved_lt = *lt; + gettimeofday (&tv, NULL); + return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0; + ]])], + [gl_cv_func_gettimeofday_clobber=no], + [gl_cv_func_gettimeofday_clobber=yes], + [# When cross-compiling: + case "$host_os" in + # Guess all is fine on glibc systems. + *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_gettimeofday_clobber="guessing yes" ;; + esac + ])]) + + case "$gl_cv_func_gettimeofday_clobber" in + *yes) + REPLACE_GETTIMEOFDAY=1 + AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1], + [Define if gettimeofday clobbers the localtime buffer.]) + gl_LOCALTIME_BUFFER_NEEDED + ;; + esac +]) +m4trace:m4/gettimeofday.m4:124: -1- AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [:]) +m4trace:m4/glibc21.m4:11: -1- AC_DEFUN([gl_GLIBC21], [ + AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc], + [ac_cv_gnu_library_2_1], + [AC_EGREP_CPP([Lucky], + [ +#include +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif +#ifdef __UCLIBC__ + Lucky user +#endif + ], + [ac_cv_gnu_library_2_1=yes], + [ac_cv_gnu_library_2_1=no]) + ] + ) + AC_SUBST([GLIBC21]) + GLIBC21="$ac_cv_gnu_library_2_1" + +]) +m4trace:m4/gnu-make.m4:15: -1- AC_DEFUN([gl_GNU_MAKE], [ + AM_CONDITIONAL([GNU_MAKE], + [${MAKE-make} --version /cannot/make/this >/dev/null 2>&1]) +]) +m4trace:m4/gnulib-common.m4:9: -1- AC_DEFUN([gl_COMMON], [ + dnl Use AC_REQUIRE here, so that the code is expanded once only. + AC_REQUIRE([gl_00GNULIB]) + AC_REQUIRE([gl_COMMON_BODY]) +]) +m4trace:m4/gnulib-common.m4:14: -1- AC_DEFUN([gl_COMMON_BODY], [ + AH_VERBATIM([_Noreturn], +[/* The _Noreturn keyword of C11. */ +#if ! (defined _Noreturn \ + || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) +# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ + || 0x5110 <= __SUNPRO_C) +# define _Noreturn __attribute__ ((__noreturn__)) +# elif defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn +# endif +#endif +]) + AH_VERBATIM([isoc99_inline], +[/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports + the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of + earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. + __APPLE__ && __MACH__ test for Mac OS X. + __APPLE_CC__ tests for the Apple compiler and its version. + __STDC_VERSION__ tests for the C99 mode. */ +#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ +# define __GNUC_STDC_INLINE__ 1 +#endif]) + AH_VERBATIM([unused_parameter], +[/* Define as a marker that can be attached to declarations that might not + be used. This helps to reduce warnings, such as from + GCC -Wunused-parameter. */ +#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _GL_UNUSED __attribute__ ((__unused__)) +#else +# define _GL_UNUSED +#endif +/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name + is a misnomer outside of parameter lists. */ +#define _UNUSED_PARAMETER_ _GL_UNUSED + +/* gcc supports the "unused" attribute on possibly unused labels, and + g++ has since version 4.5. Note to support C++ as well as C, + _GL_UNUSED_LABEL should be used with a trailing ; */ +#if !defined __cplusplus || __GNUC__ > 4 \ + || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# define _GL_UNUSED_LABEL _GL_UNUSED +#else +# define _GL_UNUSED_LABEL +#endif + +/* The __pure__ attribute was added in gcc 2.96. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE /* empty */ +#endif + +/* The __const__ attribute was added in gcc 2.95. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) +#else +# define _GL_ATTRIBUTE_CONST /* empty */ +#endif +]) + dnl Preparation for running test programs: + dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not + dnl to /dev/tty, so they can be redirected to log files. Such diagnostics + dnl arise e.g., in the macros gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N. + LIBC_FATAL_STDERR_=1 + export LIBC_FATAL_STDERR_ +]) +m4trace:m4/gnulib-common.m4:93: -1- AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE], [ + gl_MODULE_INDICATOR_SET_VARIABLE_AUX( + [GNULIB_[]m4_translit([[$1]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], + [gl_MODULE_INDICATOR_CONDITION]) +]) +m4trace:m4/gnulib-common.m4:106: -1- AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX], [ + m4_if(m4_defn([gl_MODULE_INDICATOR_CONDITION]), [1], + [ + dnl Simplify the expression VALUE || 1 to 1. + $1=1 + ], + [gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([$1], + [gl_MODULE_INDICATOR_CONDITION])]) +]) +m4trace:m4/gnulib-common.m4:120: -1- AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR], [ + dnl Simplify the expression 1 || CONDITION to 1. + if test "$[]$1" != 1; then + dnl Simplify the expression 0 || CONDITION to CONDITION. + if test "$[]$1" = 0; then + $1=$2 + else + $1="($[]$1 || $2)" + fi + fi +]) +m4trace:m4/gnulib-common.m4:145: -1- AC_DEFUN([gl_MODULE_INDICATOR], [ + AC_DEFINE_UNQUOTED([GNULIB_]m4_translit([[$1]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), + [gl_MODULE_INDICATOR_CONDITION], + [Define to a C preprocessor expression that evaluates to 1 or 0, + depending whether the gnulib module $1 shall be considered present.]) +]) +m4trace:m4/gnulib-common.m4:168: -1- AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], [ + AC_DEFINE([GNULIB_TEST_]m4_translit([[$1]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1], + [Define to 1 when the gnulib module $1 should be tested.]) +]) +m4trace:m4/gnulib-common.m4:180: -1- AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK], [ + dnl Override gl_WARN_ON_USE_PREPARE. + dnl But hide this definition from 'aclocal'. + AC_DEFUN([gl_W][ARN_ON_USE_PREPARE], []) +]) +m4trace:m4/gnulib-common.m4:191: -1- AC_DEFUN([gl_ASSERT_NO_GNULIB_TESTS], [ + dnl Override gl_MODULE_INDICATOR_FOR_TESTS. + AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], []) +]) +m4trace:m4/gnulib-common.m4:199: -1- AC_DEFUN([gl_FEATURES_H], [ + AC_CHECK_HEADERS_ONCE([features.h]) + if test $ac_cv_header_features_h = yes; then + HAVE_FEATURES_H=1 + else + HAVE_FEATURES_H=0 + fi + AC_SUBST([HAVE_FEATURES_H]) +]) +m4trace:m4/gnulib-common.m4:239: -1- AC_DEFUN([gl_PROG_CC_C99], [ + dnl Change that version number to the minimum Autoconf version that supports + dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls. + m4_version_prereq([9.0], + [AC_REQUIRE([AC_PROG_CC_C99])], + [AC_REQUIRE([AC_PROG_CC_STDC])]) +]) +m4trace:m4/gnulib-common.m4:252: -1- AC_DEFUN([gl_PROG_AR_RANLIB], [ + dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler + dnl as "cc", and GCC as "gcc". They have different object file formats and + dnl library formats. In particular, the GNU binutils programs ar and ranlib + dnl produce libraries that work only with gcc, not with cc. + AC_REQUIRE([AC_PROG_CC]) + dnl The '' hides this use from 'aclocal'. + AC_BEFORE([$0], [A][M_PROG_AR]) + AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler], + [ + AC_EGREP_CPP([Amsterdam], + [ +#ifdef __ACK__ +Amsterdam +#endif + ], + [gl_cv_c_amsterdam_compiler=yes], + [gl_cv_c_amsterdam_compiler=no]) + ]) + + dnl Don't compete with AM_PROG_AR's decision about AR/ARFLAGS if we are not + dnl building with __ACK__. + if test $gl_cv_c_amsterdam_compiler = yes; then + if test -z "$AR"; then + AR='cc -c.a' + fi + if test -z "$ARFLAGS"; then + ARFLAGS='-o' + fi + else + dnl AM_PROG_AR was added in automake v1.11.2. AM_PROG_AR does not AC_SUBST + dnl ARFLAGS variable (it is filed into Makefile.in directly by automake + dnl script on-demand, if not specified by ./configure of course). + dnl Don't AC_REQUIRE the AM_PROG_AR otherwise the code for __ACK__ above + dnl will be ignored. Also, pay attention to call AM_PROG_AR in else block + dnl because AM_PROG_AR is written so it could re-set AR variable even for + dnl __ACK__. It may seem like its easier to avoid calling the macro here, + dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some good + dnl default value and automake should usually know them). + dnl + dnl The '' hides this use from 'aclocal'. + m4_ifdef([A][M_PROG_AR], [A][M_PROG_AR], [:]) + fi + + dnl In case the code above has not helped with setting AR/ARFLAGS, use + dnl Automake-documented default values for AR and ARFLAGS, but prefer + dnl ${host}-ar over ar (useful for cross-compiling). + AC_CHECK_TOOL([AR], [ar], [ar]) + if test -z "$ARFLAGS"; then + ARFLAGS='cr' + fi + + AC_SUBST([AR]) + AC_SUBST([ARFLAGS]) + if test -z "$RANLIB"; then + if test $gl_cv_c_amsterdam_compiler = yes; then + RANLIB=':' + else + dnl Use the ranlib program if it is available. + AC_PROG_RANLIB + fi + fi + AC_SUBST([RANLIB]) +]) +m4trace:m4/gnulib-common.m4:343: -1- AC_DEFUN([AC_C_RESTRICT], [AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict], + [ac_cv_c_restrict=no + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[typedef int *int_ptr; + int foo (int_ptr $ac_kw ip) { return ip[0]; } + int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ + int bar (int ip[$ac_kw]) { return ip[0]; } + ]], + [[int s[1]; + int *$ac_kw t = s; + t[0] = 0; + return foo (t) + bar (t); + ]])], + [ac_cv_c_restrict=$ac_kw]) + test "$ac_cv_c_restrict" != no && break + done + ]) + AH_VERBATIM([restrict], +[/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#undef restrict +/* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the + previous line. Perhaps some future version of Sun C++ will work with + restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +# define _Restrict +# define __restrict__ +#endif]) + case $ac_cv_c_restrict in + restrict) ;; + no) AC_DEFINE([restrict], []) ;; + *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;; + esac +]) +m4trace:m4/gnulib-common.m4:389: -1- AC_DEFUN([gl_BIGENDIAN], [ + AC_C_BIGENDIAN +]) +m4trace:m4/gnulib-common.m4:399: -1- AC_DEFUN([gl_CACHE_VAL_SILENT], [ + saved_as_echo_n="$as_echo_n" + as_echo_n=':' + AC_CACHE_VAL([$1], [$2]) + as_echo_n="$saved_as_echo_n" +]) +m4trace:m4/gnulib-comp.m4:34: -1- AC_DEFUN([gl_EARLY], [ + m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace + m4_pattern_allow([^gl_ES$])dnl a valid locale name + m4_pattern_allow([^gl_LIBOBJS$])dnl a variable + m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable + + # Pre-early section. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([gl_PROG_AR_RANLIB]) + + AC_REQUIRE([AM_PROG_CC_C_O]) + # Code from module absolute-header: + # Code from module accept: + # Code from module accept-tests: + # Code from module alloca: + # Code from module alloca-opt: + # Code from module alloca-opt-tests: + # Code from module allocator: + # Code from module announce-gen: + # Code from module areadlink: + # Code from module areadlink-tests: + # Code from module argmatch: + # Code from module argmatch-tests: + # Code from module arpa_inet: + # Code from module arpa_inet-tests: + # Code from module assure: + # Code from module binary-io: + # Code from module binary-io-tests: + # Code from module bind: + # Code from module bind-tests: + # Code from module bitrotate: + # Code from module bitrotate-tests: + # Code from module btowc: + # Code from module btowc-tests: + # Code from module builtin-expect: + # Code from module c-ctype: + # Code from module c-ctype-tests: + # Code from module c-stack: + # Code from module c-stack-tests: + # Code from module c-strcase: + # Code from module c-strcase-tests: + # Code from module c-strcaseeq: + # Code from module careadlinkat: + # Code from module clock-time: + # Code from module close: + # Code from module close-tests: + # Code from module config-h: + # Code from module configmake: + # Code from module connect: + # Code from module connect-tests: + # Code from module ctype: + # Code from module ctype-tests: + # Code from module diffseq: + # Code from module dirname: + # Code from module dirname-lgpl: + # Code from module dirname-tests: + # Code from module do-release-commit-and-tag: + # Code from module dosname: + # Code from module double-slash-root: + # Code from module dtotimespec: + # Code from module dup2: + # Code from module dup2-tests: + # Code from module environ: + # Code from module environ-tests: + # Code from module errno: + # Code from module errno-tests: + # Code from module error: + # Code from module exclude: + # Code from module exclude-tests: + # Code from module exitfail: + # Code from module extensions: + # Code from module extern-inline: + # Code from module fcntl: + # Code from module fcntl-h: + # Code from module fcntl-h-tests: + # Code from module fcntl-tests: + # Code from module fd-hook: + # Code from module fdl: + # Code from module fdopen: + # Code from module fdopen-tests: + # Code from module fgetc-tests: + # Code from module file-type: + # Code from module filename: + # Code from module filenamecat: + # Code from module filenamecat-lgpl: + # Code from module filenamecat-tests: + # Code from module flexmember: + # Code from module float: + # Code from module float-tests: + # Code from module fnmatch: + # Code from module fnmatch-gnu: + # Code from module fnmatch-tests: + # Code from module fpieee: + AC_REQUIRE([gl_FP_IEEE]) + # Code from module fpucw: + # Code from module fputc-tests: + # Code from module fread-tests: + # Code from module freopen: + # Code from module freopen-safer: + # Code from module freopen-safer-tests: + # Code from module freopen-tests: + # Code from module fstat: + # Code from module fstat-tests: + # Code from module ftruncate: + # Code from module ftruncate-tests: + # Code from module fwrite-tests: + # Code from module gendocs: + # Code from module getcwd-lgpl: + # Code from module getcwd-lgpl-tests: + # Code from module getdtablesize: + # Code from module getdtablesize-tests: + # Code from module getopt: + # Code from module getopt-gnu: + # Code from module getopt-gnu-tests: + # Code from module getopt-posix: + # Code from module getopt-posix-tests: + # Code from module getpagesize: + # Code from module getprogname: + # Code from module getprogname-tests: + # Code from module gettext-h: + # Code from module gettime: + # Code from module gettimeofday: + # Code from module gettimeofday-tests: + # Code from module git-version-gen: + # Code from module gitlog-to-changelog: + # Code from module gnu-make: + # Code from module gnu-web-doc-update: + # Code from module gnumakefile: + # Code from module gnupload: + # Code from module gperf: + # Code from module hard-locale: + # Code from module hash: + # Code from module hash-pjw: + # Code from module hash-tests: + # Code from module havelib: + # Code from module iconv: + # Code from module iconv-h: + # Code from module iconv-h-tests: + # Code from module iconv-tests: + # Code from module iconv_open: + # Code from module ignore-value: + # Code from module ignore-value-tests: + # Code from module include_next: + # Code from module inet_pton: + # Code from module inet_pton-tests: + # Code from module inline: + # Code from module intprops: + # Code from module intprops-tests: + # Code from module inttostr: + # Code from module inttostr-tests: + # Code from module inttypes: + # Code from module inttypes-incomplete: + # Code from module inttypes-tests: + # Code from module ioctl: + # Code from module ioctl-tests: + # Code from module isblank: + # Code from module isblank-tests: + # Code from module iswblank: + # Code from module iswblank-tests: + # Code from module langinfo: + # Code from module langinfo-tests: + # Code from module largefile: + AC_REQUIRE([AC_SYS_LARGEFILE]) + # Code from module libsigsegv: + # Code from module limits-h: + # Code from module limits-h-tests: + # Code from module listen: + # Code from module listen-tests: + # Code from module localcharset: + # Code from module locale: + # Code from module locale-tests: + # Code from module localeconv: + # Code from module localeconv-tests: + # Code from module localtime-buffer: + # Code from module lstat: + # Code from module lstat-tests: + # Code from module maintainer-makefile: + # Code from module malloc-posix: + # Code from module malloca: + # Code from module malloca-tests: + # Code from module manywarnings: + # Code from module mbchar: + # Code from module mbiter: + # Code from module mbrtowc: + # Code from module mbrtowc-tests: + # Code from module mbscasecmp: + # Code from module mbscasecmp-tests: + # Code from module mbsinit: + # Code from module mbsinit-tests: + # Code from module mbslen: + # Code from module mbsrtowcs: + # Code from module mbsrtowcs-tests: + # Code from module mbsstr: + # Code from module mbsstr-tests: + # Code from module mbtowc: + # Code from module mbuiter: + # Code from module memchr: + # Code from module memchr-tests: + # Code from module minmax: + # Code from module mkstemp: + # Code from module mktime: + # Code from module mktime-internal: + # Code from module msvc-inval: + # Code from module msvc-nothrow: + # Code from module multiarch: + # Code from module nanosleep: + # Code from module nanosleep-tests: + # Code from module netinet_in: + # Code from module netinet_in-tests: + # Code from module nl_langinfo: + # Code from module nl_langinfo-tests: + # Code from module nocrash: + # Code from module open: + # Code from module open-tests: + # Code from module pathmax: + # Code from module pathmax-tests: + # Code from module perror: + # Code from module perror-tests: + # Code from module pipe-posix: + # Code from module pipe-posix-tests: + # Code from module progname: + # Code from module propername: + # Code from module putenv: + # Code from module quote: + # Code from module quotearg: + # Code from module quotearg-simple: + # Code from module quotearg-simple-tests: + # Code from module raise: + # Code from module raise-tests: + # Code from module rawmemchr: + # Code from module rawmemchr-tests: + # Code from module readlink: + # Code from module readlink-tests: + # Code from module readme-release: + # Code from module regex: + # Code from module regex-tests: + # Code from module same-inode: + # Code from module secure_getenv: + # Code from module select: + # Code from module select-tests: + # Code from module setenv: + # Code from module setenv-tests: + # Code from module setlocale: + # Code from module setlocale-tests: + # Code from module setsockopt: + # Code from module setsockopt-tests: + # Code from module sh-quote: + # Code from module sh-quote-tests: + # Code from module sigaction: + # Code from module sigaction-tests: + # Code from module signal: + # Code from module signal-h: + # Code from module signal-h-tests: + # Code from module sigprocmask: + # Code from module sigprocmask-tests: + # Code from module size_max: + # Code from module sleep: + # Code from module sleep-tests: + # Code from module snippet/_Noreturn: + # Code from module snippet/arg-nonnull: + # Code from module snippet/c++defs: + # Code from module snippet/unused-parameter: + # Code from module snippet/warn-on-use: + # Code from module snprintf: + # Code from module snprintf-tests: + # Code from module socket: + # Code from module socketlib: + # Code from module sockets: + # Code from module sockets-tests: + # Code from module socklen: + # Code from module ssize_t: + # Code from module stat: + # Code from module stat-macros: + # Code from module stat-tests: + # Code from module stat-time: + # Code from module stat-time-tests: + # Code from module stdalign: + # Code from module stdalign-tests: + # Code from module stdarg: + dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode + dnl for the builtin va_copy to work. With Autoconf 2.60 or later, + dnl gl_PROG_CC_C99 arranges for this. With older Autoconf gl_PROG_CC_C99 + dnl shouldn't hurt, though installers are on their own to set c99 mode. + gl_PROG_CC_C99 + # Code from module stdbool: + # Code from module stdbool-tests: + # Code from module stddef: + # Code from module stddef-tests: + # Code from module stdint: + # Code from module stdint-tests: + # Code from module stdio: + # Code from module stdio-tests: + # Code from module stdlib: + # Code from module stdlib-tests: + # Code from module strcase: + # Code from module streq: + # Code from module strerror: + # Code from module strerror-override: + # Code from module strerror-tests: + # Code from module strerror_r-posix: + # Code from module strerror_r-posix-tests: + # Code from module strftime: + # Code from module strftime-tests: + # Code from module striconv: + # Code from module striconv-tests: + # Code from module string: + # Code from module string-tests: + # Code from module strings: + # Code from module strings-tests: + # Code from module strndup: + # Code from module strnlen: + # Code from module strnlen-tests: + # Code from module strnlen1: + # Code from module strptime: + # Code from module strtoull: + # Code from module strtoull-tests: + # Code from module strtoumax: + # Code from module strtoumax-tests: + # Code from module symlink: + # Code from module symlink-tests: + # Code from module sys_ioctl: + # Code from module sys_ioctl-tests: + # Code from module sys_select: + # Code from module sys_select-tests: + # Code from module sys_socket: + # Code from module sys_socket-tests: + # Code from module sys_stat: + # Code from module sys_stat-tests: + # Code from module sys_time: + # Code from module sys_time-tests: + # Code from module sys_types: + # Code from module sys_types-tests: + # Code from module sys_uio: + # Code from module sys_uio-tests: + # Code from module sys_wait: + # Code from module sys_wait-tests: + # Code from module system-quote: + # Code from module tempname: + # Code from module test-framework-sh: + # Code from module test-framework-sh-tests: + # Code from module time: + # Code from module time-tests: + # Code from module time_r: + # Code from module time_rz: + # Code from module timegm: + # Code from module timespec: + # Code from module timespec-add: + # Code from module timespec-sub: + # Code from module timespec-tests: + # Code from module trim: + # Code from module tzset: + # Code from module unistd: + # Code from module unistd-tests: + # Code from module unistr/base: + # Code from module unistr/u8-mbtoucr: + # Code from module unistr/u8-mbtoucr-tests: + # Code from module unistr/u8-uctomb: + # Code from module unistr/u8-uctomb-tests: + # Code from module unitypes: + # Code from module uniwidth/base: + # Code from module uniwidth/width: + # Code from module uniwidth/width-tests: + # Code from module unlocked-io: + # Code from module unsetenv: + # Code from module unsetenv-tests: + # Code from module update-copyright: + # Code from module update-copyright-tests: + # Code from module useless-if-before-free: + # Code from module vararrays: + # Code from module vasnprintf: + # Code from module vasnprintf-tests: + # Code from module vasprintf: + # Code from module vasprintf-tests: + # Code from module vc-list-files: + # Code from module vc-list-files-tests: + # Code from module verify: + # Code from module verify-tests: + # Code from module version-etc: + # Code from module version-etc-fsf: + # Code from module version-etc-tests: + # Code from module warnings: + # Code from module wchar: + # Code from module wchar-tests: + # Code from module wcrtomb: + # Code from module wcrtomb-tests: + # Code from module wctob: + # Code from module wctomb: + # Code from module wctype-h: + # Code from module wctype-h-tests: + # Code from module wcwidth: + # Code from module wcwidth-tests: + # Code from module xalloc: + # Code from module xalloc-die: + # Code from module xalloc-die-tests: + # Code from module xalloc-oversized: + # Code from module xfreopen: + # Code from module xreadlink: + # Code from module xsize: + # Code from module xstriconv: + # Code from module xstrndup: + # Code from module xstrtol: + # Code from module xstrtol-tests: + # Code from module xstrtoumax: + # Code from module xstrtoumax-tests: + # Code from module xvasprintf: + # Code from module xvasprintf-tests: +]) +m4trace:m4/gnulib-comp.m4:445: -1- AC_DEFUN([gl_INIT], [ + AM_CONDITIONAL([GL_COND_LIBTOOL], [false]) + gl_cond_libtool=false + gl_libdeps= + gl_ltlibdeps= + gl_m4_base='m4' + m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ])) + m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS])) + m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES])) + m4_pushdef([gl_LIBSOURCES_LIST], []) + m4_pushdef([gl_LIBSOURCES_DIR], []) + gl_COMMON + gl_source_base='lib' + gl_FUNC_ALLOCA + gl_FUNC_BTOWC + if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then + AC_LIBOBJ([btowc]) + gl_PREREQ_BTOWC + fi + gl_WCHAR_MODULE_INDICATOR([btowc]) + gl___BUILTIN_EXPECT + gl_C_STACK + AC_CHECK_FUNCS_ONCE([readlinkat]) + gl_CLOCK_TIME + gl_FUNC_CLOSE + if test $REPLACE_CLOSE = 1; then + AC_LIBOBJ([close]) + fi + gl_UNISTD_MODULE_INDICATOR([close]) + gl_CONFIG_H + gl_CONFIGMAKE_PREP + gl_CTYPE_H + gl_DIRNAME + gl_MODULE_INDICATOR([dirname]) + gl_DIRNAME_LGPL + gl_DOUBLE_SLASH_ROOT + gl_FUNC_DUP2 + if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then + AC_LIBOBJ([dup2]) + gl_PREREQ_DUP2 + fi + gl_UNISTD_MODULE_INDICATOR([dup2]) + gl_ENVIRON + gl_UNISTD_MODULE_INDICATOR([environ]) + gl_HEADER_ERRNO_H + gl_ERROR + if test $ac_cv_lib_error_at_line = no; then + AC_LIBOBJ([error]) + gl_PREREQ_ERROR + fi + m4_ifdef([AM_XGETTEXT_OPTION], + [AM_][XGETTEXT_OPTION([--flag=error:3:c-format]) + AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])]) + AC_REQUIRE([gl_EXTERN_INLINE]) + gl_FUNC_FCNTL + if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then + AC_LIBOBJ([fcntl]) + fi + gl_FCNTL_MODULE_INDICATOR([fcntl]) + gl_FCNTL_H + gl_FILE_NAME_CONCAT + gl_MODULE_INDICATOR([filenamecat]) + gl_FILE_NAME_CONCAT_LGPL + AC_C_FLEXIBLE_ARRAY_MEMBER + gl_FLOAT_H + if test $REPLACE_FLOAT_LDBL = 1; then + AC_LIBOBJ([float]) + fi + if test $REPLACE_ITOLD = 1; then + AC_LIBOBJ([itold]) + fi + gl_FUNC_FNMATCH_POSIX + if test -n "$FNMATCH_H"; then + AC_LIBOBJ([fnmatch]) + gl_PREREQ_FNMATCH + fi + gl_FUNC_FNMATCH_GNU + if test -n "$FNMATCH_H"; then + AC_LIBOBJ([fnmatch]) + gl_PREREQ_FNMATCH + fi + gl_FUNC_FREOPEN + if test $REPLACE_FREOPEN = 1; then + AC_LIBOBJ([freopen]) + gl_PREREQ_FREOPEN + fi + gl_STDIO_MODULE_INDICATOR([freopen]) + gl_MODULE_INDICATOR([freopen-safer]) + gl_FUNC_FSTAT + if test $REPLACE_FSTAT = 1; then + AC_LIBOBJ([fstat]) + AC_LIBOBJ([stat-w32]) + gl_PREREQ_FSTAT + fi + gl_SYS_STAT_MODULE_INDICATOR([fstat]) + gl_FUNC_GETDTABLESIZE + if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then + AC_LIBOBJ([getdtablesize]) + gl_PREREQ_GETDTABLESIZE + fi + gl_UNISTD_MODULE_INDICATOR([getdtablesize]) + gl_FUNC_GETOPT_GNU + dnl Because of the way gl_FUNC_GETOPT_GNU is implemented (the gl_getopt_required + dnl mechanism), there is no need to do any AC_LIBOBJ or AC_SUBST here; they are + dnl done in the getopt-posix module. + gl_FUNC_GETOPT_POSIX + if test $REPLACE_GETOPT = 1; then + AC_LIBOBJ([getopt]) + AC_LIBOBJ([getopt1]) + dnl Arrange for unistd.h to include getopt.h. + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) + gl_FUNC_GETPROGNAME + AC_SUBST([LIBINTL]) + AC_SUBST([LTLIBINTL]) + gl_GETTIME + gl_FUNC_GETTIMEOFDAY + if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then + AC_LIBOBJ([gettimeofday]) + gl_PREREQ_GETTIMEOFDAY + fi + gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) + gl_GNU_MAKE + # Autoconf 2.61a.99 and earlier don't support linking a file only + # in VPATH builds. But since GNUmakefile is for maintainer use + # only, it does not matter if we skip the link with older autoconf. + # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH + # builds, so use a shell variable to bypass this. + GNUmakefile=GNUmakefile + m4_if(m4_version_compare([2.61a.100], + m4_defn([m4_PACKAGE_VERSION])), [1], [], + [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], + [GNUmakefile=$GNUmakefile])]) + gl_HARD_LOCALE + AM_ICONV + m4_ifdef([gl_ICONV_MODULE_INDICATOR], + [gl_ICONV_MODULE_INDICATOR([iconv])]) + gl_ICONV_H + gl_FUNC_ICONV_OPEN + if test $REPLACE_ICONV_OPEN = 1; then + AC_LIBOBJ([iconv_open]) + fi + if test $REPLACE_ICONV = 1; then + AC_LIBOBJ([iconv]) + AC_LIBOBJ([iconv_close]) + fi + gl_INLINE + gl_INTTOSTR + gl_INTTYPES_H + gl_INTTYPES_INCOMPLETE + gl_FUNC_ISBLANK + if test $HAVE_ISBLANK = 0; then + AC_LIBOBJ([isblank]) + fi + gl_CTYPE_MODULE_INDICATOR([isblank]) + gl_FUNC_ISWBLANK + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + AC_LIBOBJ([iswblank]) + fi + fi + gl_WCTYPE_MODULE_INDICATOR([iswblank]) + gl_LANGINFO_H + AC_REQUIRE([gl_LARGEFILE]) + gl_LIBSIGSEGV + gl_LIMITS_H + gl_LOCALCHARSET + LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" + AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT]) + gl_LOCALE_H + gl_FUNC_LOCALECONV + if test $REPLACE_LOCALECONV = 1; then + AC_LIBOBJ([localeconv]) + gl_PREREQ_LOCALECONV + fi + gl_LOCALE_MODULE_INDICATOR([localeconv]) + AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) + AC_LIBOBJ([localtime-buffer]) + gl_FUNC_LSTAT + if test $REPLACE_LSTAT = 1; then + AC_LIBOBJ([lstat]) + gl_PREREQ_LSTAT + fi + gl_SYS_STAT_MODULE_INDICATOR([lstat]) + AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER], + [AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])]) + AC_REQUIRE([AC_PROG_SED]) + gl_FUNC_MALLOC_POSIX + if test $REPLACE_MALLOC = 1; then + AC_LIBOBJ([malloc]) + fi + gl_STDLIB_MODULE_INDICATOR([malloc-posix]) + gl_MALLOCA + gl_MBCHAR + gl_MBITER + gl_FUNC_MBRTOWC + if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then + AC_LIBOBJ([mbrtowc]) + gl_PREREQ_MBRTOWC + fi + gl_WCHAR_MODULE_INDICATOR([mbrtowc]) + gl_STRING_MODULE_INDICATOR([mbscasecmp]) + gl_FUNC_MBSINIT + if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then + AC_LIBOBJ([mbsinit]) + gl_PREREQ_MBSINIT + fi + gl_WCHAR_MODULE_INDICATOR([mbsinit]) + gl_FUNC_MBSLEN + gl_STRING_MODULE_INDICATOR([mbslen]) + gl_FUNC_MBSRTOWCS + if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then + AC_LIBOBJ([mbsrtowcs]) + AC_LIBOBJ([mbsrtowcs-state]) + gl_PREREQ_MBSRTOWCS + fi + gl_WCHAR_MODULE_INDICATOR([mbsrtowcs]) + gl_STRING_MODULE_INDICATOR([mbsstr]) + gl_FUNC_MBTOWC + if test $REPLACE_MBTOWC = 1; then + AC_LIBOBJ([mbtowc]) + gl_PREREQ_MBTOWC + fi + gl_STDLIB_MODULE_INDICATOR([mbtowc]) + gl_MBITER + gl_FUNC_MEMCHR + if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + AC_LIBOBJ([memchr]) + gl_PREREQ_MEMCHR + fi + gl_STRING_MODULE_INDICATOR([memchr]) + gl_MINMAX + gl_FUNC_MKSTEMP + if test $HAVE_MKSTEMP = 0 || test $REPLACE_MKSTEMP = 1; then + AC_LIBOBJ([mkstemp]) + gl_PREREQ_MKSTEMP + fi + gl_STDLIB_MODULE_INDICATOR([mkstemp]) + gl_FUNC_MKTIME + if test $REPLACE_MKTIME = 1; then + AC_LIBOBJ([mktime]) + gl_PREREQ_MKTIME + fi + gl_TIME_MODULE_INDICATOR([mktime]) + gl_FUNC_MKTIME_INTERNAL + if test $WANT_MKTIME_INTERNAL = 1; then + AC_LIBOBJ([mktime]) + gl_PREREQ_MKTIME + fi + AC_REQUIRE([gl_MSVC_INVAL]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + AC_LIBOBJ([msvc-inval]) + fi + AC_REQUIRE([gl_MSVC_NOTHROW]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + AC_LIBOBJ([msvc-nothrow]) + fi + gl_MODULE_INDICATOR([msvc-nothrow]) + gl_MULTIARCH + gl_FUNC_NL_LANGINFO + if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then + AC_LIBOBJ([nl_langinfo]) + fi + gl_LANGINFO_MODULE_INDICATOR([nl_langinfo]) + gl_FUNC_OPEN + if test $REPLACE_OPEN = 1; then + AC_LIBOBJ([open]) + gl_PREREQ_OPEN + fi + gl_FCNTL_MODULE_INDICATOR([open]) + gl_PATHMAX + AC_CHECK_DECLS([program_invocation_name], [], [], [#include ]) + AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include ]) + m4_ifdef([AM_XGETTEXT_OPTION], + [AM_][XGETTEXT_OPTION([--keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"']) + AM_][XGETTEXT_OPTION([--keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"'])]) + gl_QUOTE + gl_QUOTEARG + gl_FUNC_RAISE + if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then + AC_LIBOBJ([raise]) + gl_PREREQ_RAISE + fi + gl_SIGNAL_MODULE_INDICATOR([raise]) + gl_FUNC_RAWMEMCHR + if test $HAVE_RAWMEMCHR = 0; then + AC_LIBOBJ([rawmemchr]) + gl_PREREQ_RAWMEMCHR + fi + gl_STRING_MODULE_INDICATOR([rawmemchr]) + gl_FUNC_READLINK + if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then + AC_LIBOBJ([readlink]) + gl_PREREQ_READLINK + fi + gl_UNISTD_MODULE_INDICATOR([readlink]) + gl_REGEX + if test $ac_use_included_regex = yes; then + AC_LIBOBJ([regex]) + gl_PREREQ_REGEX + fi + gl_FUNC_SECURE_GETENV + if test $HAVE_SECURE_GETENV = 0; then + AC_LIBOBJ([secure_getenv]) + gl_PREREQ_SECURE_GETENV + fi + gl_STDLIB_MODULE_INDICATOR([secure_getenv]) + gl_FUNC_SETENV + if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then + AC_LIBOBJ([setenv]) + fi + gl_STDLIB_MODULE_INDICATOR([setenv]) + gl_SIGACTION + if test $HAVE_SIGACTION = 0; then + AC_LIBOBJ([sigaction]) + gl_PREREQ_SIGACTION + fi + gl_SIGNAL_MODULE_INDICATOR([sigaction]) + gl_SIGNAL_H + gl_SIGNALBLOCKING + if test $HAVE_POSIX_SIGNALBLOCKING = 0; then + AC_LIBOBJ([sigprocmask]) + gl_PREREQ_SIGPROCMASK + fi + gl_SIGNAL_MODULE_INDICATOR([sigprocmask]) + gl_SIZE_MAX + gt_TYPE_SSIZE_T + gl_FUNC_STAT + if test $REPLACE_STAT = 1; then + AC_LIBOBJ([stat]) + AC_LIBOBJ([stat-w32]) + gl_PREREQ_STAT + fi + gl_SYS_STAT_MODULE_INDICATOR([stat]) + gl_STAT_TIME + gl_STAT_BIRTHTIME + gl_STDARG_H + AM_STDBOOL_H + gl_STDDEF_H + gl_STDINT_H + gl_STDIO_H + gl_STDLIB_H + gl_STRCASE + if test $HAVE_STRCASECMP = 0; then + AC_LIBOBJ([strcasecmp]) + gl_PREREQ_STRCASECMP + fi + if test $HAVE_STRNCASECMP = 0; then + AC_LIBOBJ([strncasecmp]) + gl_PREREQ_STRNCASECMP + fi + gl_FUNC_STRERROR + if test $REPLACE_STRERROR = 1; then + AC_LIBOBJ([strerror]) + fi + gl_MODULE_INDICATOR([strerror]) + gl_STRING_MODULE_INDICATOR([strerror]) + AC_REQUIRE([gl_HEADER_ERRNO_H]) + AC_REQUIRE([gl_FUNC_STRERROR_0]) + if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then + AC_LIBOBJ([strerror-override]) + gl_PREREQ_SYS_H_WINSOCK2 + fi + gl_FUNC_GNU_STRFTIME + if test $gl_cond_libtool = false; then + gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV" + gl_libdeps="$gl_libdeps $LIBICONV" + fi + gl_HEADER_STRING_H + gl_HEADER_STRINGS_H + gl_FUNC_STRNDUP + if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then + AC_LIBOBJ([strndup]) + fi + gl_STRING_MODULE_INDICATOR([strndup]) + gl_FUNC_STRNLEN + if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then + AC_LIBOBJ([strnlen]) + gl_PREREQ_STRNLEN + fi + gl_STRING_MODULE_INDICATOR([strnlen]) + gl_FUNC_STRPTIME + if test $HAVE_STRPTIME = 0; then + AC_LIBOBJ([strptime]) + gl_PREREQ_STRPTIME + fi + gl_TIME_MODULE_INDICATOR([strptime]) + gl_FUNC_STRTOULL + if test $HAVE_STRTOULL = 0; then + AC_LIBOBJ([strtoull]) + gl_PREREQ_STRTOULL + fi + gl_STDLIB_MODULE_INDICATOR([strtoull]) + gl_FUNC_STRTOUMAX + if test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; then + AC_LIBOBJ([strtoumax]) + gl_PREREQ_STRTOUMAX + fi + gl_INTTYPES_MODULE_INDICATOR([strtoumax]) + gl_HEADER_SYS_STAT_H + AC_PROG_MKDIR_P + gl_HEADER_SYS_TIME_H + AC_PROG_MKDIR_P + gl_SYS_TYPES_H + AC_PROG_MKDIR_P + gl_SYS_WAIT_H + AC_PROG_MKDIR_P + gl_FUNC_GEN_TEMPNAME + gl_HEADER_TIME_H + gl_TIME_R + if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then + AC_LIBOBJ([time_r]) + gl_PREREQ_TIME_R + fi + gl_TIME_MODULE_INDICATOR([time_r]) + gl_TIME_RZ + if test $HAVE_TIMEZONE_T = 0; then + AC_LIBOBJ([time_rz]) + fi + gl_TIME_MODULE_INDICATOR([time_rz]) + gl_FUNC_TIMEGM + if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then + AC_LIBOBJ([timegm]) + gl_PREREQ_TIMEGM + fi + gl_TIME_MODULE_INDICATOR([timegm]) + gl_TIMESPEC + gl_FUNC_TZSET + if test $HAVE_TZSET = 0 || test $REPLACE_TZSET = 1; then + AC_LIBOBJ([tzset]) + fi + gl_TIME_MODULE_INDICATOR([tzset]) + gl_UNISTD_H + gl_LIBUNISTRING_LIBHEADER([0.9.4], [unistr.h]) + gl_MODULE_INDICATOR([unistr/u8-mbtoucr]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-mbtoucr]) + gl_MODULE_INDICATOR([unistr/u8-uctomb]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-uctomb]) + gl_LIBUNISTRING_LIBHEADER([0.9.4], [unitypes.h]) + gl_LIBUNISTRING_LIBHEADER([0.9.4], [uniwidth.h]) + gl_LIBUNISTRING_MODULE([0.9.6], [uniwidth/width]) + gl_FUNC_GLIBC_UNLOCKED_IO + gl_FUNC_UNSETENV + if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then + AC_LIBOBJ([unsetenv]) + gl_PREREQ_UNSETENV + fi + gl_STDLIB_MODULE_INDICATOR([unsetenv]) + AC_C_VARARRAYS + gl_FUNC_VASNPRINTF + gl_FUNC_VASPRINTF + gl_STDIO_MODULE_INDICATOR([vasprintf]) + m4_ifdef([AM_XGETTEXT_OPTION], + [AM_][XGETTEXT_OPTION([--flag=asprintf:2:c-format]) + AM_][XGETTEXT_OPTION([--flag=vasprintf:2:c-format])]) + gl_VERSION_ETC + gl_WCHAR_H + gl_FUNC_WCRTOMB + if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then + AC_LIBOBJ([wcrtomb]) + gl_PREREQ_WCRTOMB + fi + gl_WCHAR_MODULE_INDICATOR([wcrtomb]) + gl_WCTYPE_H + gl_FUNC_WCWIDTH + if test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1; then + AC_LIBOBJ([wcwidth]) + fi + gl_WCHAR_MODULE_INDICATOR([wcwidth]) + gl_XALLOC + gl_XSIZE + gl_XSTRNDUP + gl_XSTRTOL + gl_XVASPRINTF + m4_ifdef([AM_XGETTEXT_OPTION], + [AM_][XGETTEXT_OPTION([--flag=xasprintf:1:c-format])]) + # End of code from modules + m4_ifval(gl_LIBSOURCES_LIST, [ + m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ || + for gl_file in ]gl_LIBSOURCES_LIST[ ; do + if test ! -r ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file ; then + echo "missing file ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file" >&2 + exit 1 + fi + done])dnl + m4_if(m4_sysval, [0], [], + [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])]) + ]) + m4_popdef([gl_LIBSOURCES_DIR]) + m4_popdef([gl_LIBSOURCES_LIST]) + m4_popdef([AC_LIBSOURCES]) + m4_popdef([AC_REPLACE_FUNCS]) + m4_popdef([AC_LIBOBJ]) + AC_CONFIG_COMMANDS_PRE([ + gl_libobjs= + gl_ltlibobjs= + if test -n "$gl_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do + gl_libobjs="$gl_libobjs $i.$ac_objext" + gl_ltlibobjs="$gl_ltlibobjs $i.lo" + done + fi + AC_SUBST([gl_LIBOBJS], [$gl_libobjs]) + AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs]) + ]) + gltests_libdeps= + gltests_ltlibdeps= + m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ])) + m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS])) + m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES])) + m4_pushdef([gltests_LIBSOURCES_LIST], []) + m4_pushdef([gltests_LIBSOURCES_DIR], []) + gl_COMMON + gl_source_base='gnulib-tests' +changequote(,)dnl + gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS +changequote([, ])dnl + AC_SUBST([gltests_WITNESS]) + gl_module_indicator_condition=$gltests_WITNESS + m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([accept]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([accept]) + gl_HEADER_ARPA_INET + AC_PROG_MKDIR_P + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([bind]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([bind]) + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 + gt_LOCALE_FR + gt_LOCALE_TR_UTF8 + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([connect]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([connect]) + gl_FUNC_FDOPEN + if test $REPLACE_FDOPEN = 1; then + AC_LIBOBJ([fdopen]) + gl_PREREQ_FDOPEN + fi + gl_STDIO_MODULE_INDICATOR([fdopen]) + gl_FUNC_FTRUNCATE + if test $HAVE_FTRUNCATE = 0 || test $REPLACE_FTRUNCATE = 1; then + AC_LIBOBJ([ftruncate]) + gl_PREREQ_FTRUNCATE + fi + gl_UNISTD_MODULE_INDICATOR([ftruncate]) + gl_FUNC_GETCWD_LGPL + if test $REPLACE_GETCWD = 1; then + AC_LIBOBJ([getcwd-lgpl]) + fi + gl_UNISTD_MODULE_INDICATOR([getcwd]) + gl_FUNC_GETPAGESIZE + if test $REPLACE_GETPAGESIZE = 1; then + AC_LIBOBJ([getpagesize]) + fi + gl_UNISTD_MODULE_INDICATOR([getpagesize]) + gl_FUNC_INET_PTON + if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then + AC_LIBOBJ([inet_pton]) + gl_PREREQ_INET_PTON + fi + gl_ARPA_INET_MODULE_INDICATOR([inet_pton]) + AC_C_BIGENDIAN + gl_FUNC_IOCTL + if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then + AC_LIBOBJ([ioctl]) + fi + gl_SYS_IOCTL_MODULE_INDICATOR([ioctl]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([listen]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([listen]) + AC_CHECK_FUNCS_ONCE([newlocale]) + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 + gt_LOCALE_JA + gt_LOCALE_ZH_CN + gt_LOCALE_TR_UTF8 + gt_LOCALE_FR_UTF8 + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 + gt_LOCALE_JA + gt_LOCALE_ZH_CN + gt_LOCALE_FR_UTF8 + gt_LOCALE_ZH_CN + dnl Check for prerequisites for memory fence checks. + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + gl_FUNC_NANOSLEEP + if test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1; then + AC_LIBOBJ([nanosleep]) + gl_PREREQ_NANOSLEEP + fi + gl_TIME_MODULE_INDICATOR([nanosleep]) + AC_CHECK_DECLS_ONCE([alarm]) + gl_HEADER_NETINET_IN + AC_PROG_MKDIR_P + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 + gl_FUNC_PERROR + if test $REPLACE_PERROR = 1; then + AC_LIBOBJ([perror]) + fi + gl_STRING_MODULE_INDICATOR([perror]) + gl_FUNC_PIPE + if test $HAVE_PIPE = 0; then + AC_LIBOBJ([pipe]) + fi + gl_UNISTD_MODULE_INDICATOR([pipe]) + gl_FUNC_PUTENV + if test $REPLACE_PUTENV = 1; then + AC_LIBOBJ([putenv]) + gl_PREREQ_PUTENV + fi + gl_STDLIB_MODULE_INDICATOR([putenv]) + dnl Check for prerequisites for memory fence checks. + dnl FIXME: zerosize-ptr.h requires these: make a module for it + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + dnl Check for prerequisites for memory fence checks. + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + gl_FUNC_SELECT + if test $REPLACE_SELECT = 1; then + AC_LIBOBJ([select]) + fi + gl_SYS_SELECT_MODULE_INDICATOR([select]) + AC_CHECK_HEADERS_ONCE([sys/wait.h]) + gl_FUNC_SETLOCALE + if test $REPLACE_SETLOCALE = 1; then + AC_LIBOBJ([setlocale]) + gl_PREREQ_SETLOCALE + fi + gl_LOCALE_MODULE_INDICATOR([setlocale]) + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 + gt_LOCALE_JA + gt_LOCALE_ZH_CN + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([setsockopt]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([setsockopt]) + gl_FUNC_SLEEP + if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then + AC_LIBOBJ([sleep]) + fi + gl_UNISTD_MODULE_INDICATOR([sleep]) + AC_CHECK_DECLS_ONCE([alarm]) + gl_FUNC_SNPRINTF + gl_STDIO_MODULE_INDICATOR([snprintf]) + gl_MODULE_INDICATOR([snprintf]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([socket]) + fi + # When this module is used, sockets may actually occur as file descriptors, + # hence it is worth warning if the modules 'close' and 'ioctl' are not used. + m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])]) + m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])]) + AC_REQUIRE([gl_PREREQ_SYS_H_WINSOCK2]) + if test "$ac_cv_header_winsock2_h" = yes; then + UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 + fi + gl_SYS_SOCKET_MODULE_INDICATOR([socket]) + AC_REQUIRE([gl_SOCKETLIB]) + AC_REQUIRE([gl_SOCKETS]) + gl_TYPE_SOCKLEN_T + gl_STDALIGN_H + AC_REQUIRE([gt_TYPE_WCHAR_T]) + AC_REQUIRE([gt_TYPE_WINT_T]) + gl_FUNC_STRERROR_R + if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then + AC_LIBOBJ([strerror_r]) + gl_PREREQ_STRERROR_R + fi + gl_STRING_MODULE_INDICATOR([strerror_r]) + dnl For the modules argp, error. + gl_MODULE_INDICATOR([strerror_r-posix]) + dnl Check for prerequisites for memory fence checks. + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + gl_FUNC_SYMLINK + if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then + AC_LIBOBJ([symlink]) + fi + gl_UNISTD_MODULE_INDICATOR([symlink]) + gl_SYS_IOCTL_H + AC_PROG_MKDIR_P + AC_REQUIRE([gl_HEADER_SYS_SELECT]) + AC_PROG_MKDIR_P + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + AC_PROG_MKDIR_P + AC_CHECK_FUNCS_ONCE([shutdown]) + gl_HEADER_SYS_UIO + AC_PROG_MKDIR_P + abs_aux_dir=`cd "$ac_aux_dir"; pwd` + AC_SUBST([abs_aux_dir]) + abs_aux_dir=`cd "$ac_aux_dir"; pwd` + AC_SUBST([abs_aux_dir]) + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 + gt_LOCALE_JA + gt_LOCALE_ZH_CN + gl_FUNC_WCTOB + if test $HAVE_WCTOB = 0 || test $REPLACE_WCTOB = 1; then + AC_LIBOBJ([wctob]) + gl_PREREQ_WCTOB + fi + gl_WCHAR_MODULE_INDICATOR([wctob]) + gl_FUNC_WCTOMB + if test $REPLACE_WCTOMB = 1; then + AC_LIBOBJ([wctomb]) + gl_PREREQ_WCTOMB + fi + gl_STDLIB_MODULE_INDICATOR([wctomb]) + m4_popdef([gl_MODULE_INDICATOR_CONDITION]) + m4_ifval(gltests_LIBSOURCES_LIST, [ + m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ || + for gl_file in ]gltests_LIBSOURCES_LIST[ ; do + if test ! -r ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file ; then + echo "missing file ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file" >&2 + exit 1 + fi + done])dnl + m4_if(m4_sysval, [0], [], + [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])]) + ]) + m4_popdef([gltests_LIBSOURCES_DIR]) + m4_popdef([gltests_LIBSOURCES_LIST]) + m4_popdef([AC_LIBSOURCES]) + m4_popdef([AC_REPLACE_FUNCS]) + m4_popdef([AC_LIBOBJ]) + AC_CONFIG_COMMANDS_PRE([ + gltests_libobjs= + gltests_ltlibobjs= + if test -n "$gltests_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do + gltests_libobjs="$gltests_libobjs $i.$ac_objext" + gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" + done + fi + AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs]) + AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs]) + ]) + LIBDIFFUTILS_LIBDEPS="$gl_libdeps" + AC_SUBST([LIBDIFFUTILS_LIBDEPS]) + LIBDIFFUTILS_LTLIBDEPS="$gl_ltlibdeps" + AC_SUBST([LIBDIFFUTILS_LTLIBDEPS]) + LIBTESTS_LIBDEPS="$gltests_libdeps" + AC_SUBST([LIBTESTS_LIBDEPS]) +]) +m4trace:m4/gnulib-comp.m4:1221: -1- AC_DEFUN([gl_LIBOBJ], [ + AS_LITERAL_IF([$1], [gl_LIBSOURCES([$1.c])])dnl + gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext" +]) +m4trace:m4/gnulib-comp.m4:1228: -1- AC_DEFUN([gl_REPLACE_FUNCS], [ + m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl + AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)]) +]) +m4trace:m4/gnulib-comp.m4:1237: -1- AC_DEFUN([gl_LIBSOURCES], [ + m4_foreach([_gl_NAME], [$1], [ + m4_if(_gl_NAME, [alloca.c], [], [ + m4_define([gl_LIBSOURCES_DIR], [lib]) + m4_append([gl_LIBSOURCES_LIST], _gl_NAME, [ ]) + ]) + ]) +]) +m4trace:m4/gnulib-comp.m4:1248: -1- AC_DEFUN([gltests_LIBOBJ], [ + AS_LITERAL_IF([$1], [gltests_LIBSOURCES([$1.c])])dnl + gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext" +]) +m4trace:m4/gnulib-comp.m4:1255: -1- AC_DEFUN([gltests_REPLACE_FUNCS], [ + m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl + AC_CHECK_FUNCS([$1], , [gltests_LIBOBJ($ac_func)]) +]) +m4trace:m4/gnulib-comp.m4:1264: -1- AC_DEFUN([gltests_LIBSOURCES], [ + m4_foreach([_gl_NAME], [$1], [ + m4_if(_gl_NAME, [alloca.c], [], [ + m4_define([gltests_LIBSOURCES_DIR], [gnulib-tests]) + m4_append([gltests_LIBSOURCES_LIST], _gl_NAME, [ ]) + ]) + ]) +]) +m4trace:m4/gnulib-comp.m4:1275: -1- AC_DEFUN([gl_FILE_LIST], [ + build-aux/announce-gen + build-aux/config.rpath + build-aux/do-release-commit-and-tag + build-aux/gendocs.sh + build-aux/git-version-gen + build-aux/gitlog-to-changelog + build-aux/gnu-web-doc-update + build-aux/gnupload + build-aux/update-copyright + build-aux/useless-if-before-free + build-aux/vc-list-files + doc/fdl.texi + doc/gendocs_template + doc/gendocs_template_min + lib/_Noreturn.h + lib/alloca.c + lib/alloca.in.h + lib/allocator.c + lib/allocator.h + lib/anytostr.c + lib/areadlink.c + lib/areadlink.h + lib/arg-nonnull.h + lib/argmatch.c + lib/argmatch.h + lib/asnprintf.c + lib/asprintf.c + lib/assure.h + lib/basename-lgpl.c + lib/basename.c + lib/binary-io.c + lib/binary-io.h + lib/bitrotate.c + lib/bitrotate.h + lib/btowc.c + lib/c++defs.h + lib/c-ctype.c + lib/c-ctype.h + lib/c-stack.c + lib/c-stack.h + lib/c-strcase.h + lib/c-strcasecmp.c + lib/c-strcaseeq.h + lib/c-strncasecmp.c + lib/careadlinkat.c + lib/careadlinkat.h + lib/close.c + lib/config.charset + lib/ctype.in.h + lib/diffseq.h + lib/dirname-lgpl.c + lib/dirname.c + lib/dirname.h + lib/dosname.h + lib/dup2.c + lib/errno.in.h + lib/error.c + lib/error.h + lib/exclude.c + lib/exclude.h + lib/exitfail.c + lib/exitfail.h + lib/fcntl.c + lib/fcntl.in.h + lib/fd-hook.c + lib/fd-hook.h + lib/file-type.c + lib/file-type.h + lib/filename.h + lib/filenamecat-lgpl.c + lib/filenamecat.c + lib/filenamecat.h + lib/flexmember.h + lib/float+.h + lib/float.c + lib/float.in.h + lib/fnmatch.c + lib/fnmatch.in.h + lib/fnmatch_loop.c + lib/freopen-safer.c + lib/freopen.c + lib/fstat.c + lib/getdtablesize.c + lib/getopt-cdefs.in.h + lib/getopt-core.h + lib/getopt-ext.h + lib/getopt-pfx-core.h + lib/getopt-pfx-ext.h + lib/getopt.c + lib/getopt.in.h + lib/getopt1.c + lib/getopt_int.h + lib/getprogname.c + lib/getprogname.h + lib/gettext.h + lib/gettime.c + lib/gettimeofday.c + lib/hard-locale.c + lib/hard-locale.h + lib/hash.c + lib/hash.h + lib/iconv.c + lib/iconv.in.h + lib/iconv_close.c + lib/iconv_open-aix.gperf + lib/iconv_open-hpux.gperf + lib/iconv_open-irix.gperf + lib/iconv_open-osf.gperf + lib/iconv_open-solaris.gperf + lib/iconv_open.c + lib/ignore-value.h + lib/imaxtostr.c + lib/intprops.h + lib/inttostr.c + lib/inttostr.h + lib/inttypes.in.h + lib/isblank.c + lib/iswblank.c + lib/itold.c + lib/langinfo.in.h + lib/limits.in.h + lib/localcharset.c + lib/localcharset.h + lib/locale.in.h + lib/localeconv.c + lib/localtime-buffer.c + lib/localtime-buffer.h + lib/lstat.c + lib/malloc.c + lib/malloca.c + lib/malloca.h + lib/malloca.valgrind + lib/mbchar.c + lib/mbchar.h + lib/mbiter.c + lib/mbiter.h + lib/mbrtowc.c + lib/mbscasecmp.c + lib/mbsinit.c + lib/mbslen.c + lib/mbsrtowcs-impl.h + lib/mbsrtowcs-state.c + lib/mbsrtowcs.c + lib/mbsstr.c + lib/mbtowc-impl.h + lib/mbtowc.c + lib/mbuiter.c + lib/mbuiter.h + lib/memchr.c + lib/memchr.valgrind + lib/minmax.h + lib/mkstemp.c + lib/mktime-internal.h + lib/mktime.c + lib/msvc-inval.c + lib/msvc-inval.h + lib/msvc-nothrow.c + lib/msvc-nothrow.h + lib/nl_langinfo.c + lib/offtostr.c + lib/open.c + lib/pathmax.h + lib/printf-args.c + lib/printf-args.h + lib/printf-parse.c + lib/printf-parse.h + lib/progname.c + lib/progname.h + lib/propername.c + lib/propername.h + lib/quote.h + lib/quotearg.c + lib/quotearg.h + lib/raise.c + lib/rawmemchr.c + lib/rawmemchr.valgrind + lib/readlink.c + lib/ref-add.sin + lib/ref-del.sin + lib/regcomp.c + lib/regex.c + lib/regex.h + lib/regex_internal.c + lib/regex_internal.h + lib/regexec.c + lib/secure_getenv.c + lib/setenv.c + lib/sh-quote.c + lib/sh-quote.h + lib/sig-handler.c + lib/sig-handler.h + lib/sigaction.c + lib/signal.in.h + lib/sigprocmask.c + lib/size_max.h + lib/stat-macros.h + lib/stat-time.c + lib/stat-time.h + lib/stat-w32.c + lib/stat-w32.h + lib/stat.c + lib/stdarg.in.h + lib/stdbool.in.h + lib/stddef.in.h + lib/stdint.in.h + lib/stdio--.h + lib/stdio-safer.h + lib/stdio.in.h + lib/stdlib.in.h + lib/str-kmp.h + lib/strcasecmp.c + lib/streq.h + lib/strerror-override.c + lib/strerror-override.h + lib/strerror.c + lib/strftime.c + lib/strftime.h + lib/striconv.c + lib/striconv.h + lib/string.in.h + lib/strings.in.h + lib/stripslash.c + lib/strncasecmp.c + lib/strndup.c + lib/strnlen.c + lib/strnlen1.c + lib/strnlen1.h + lib/strptime.c + lib/strtoimax.c + lib/strtol.c + lib/strtoul.c + lib/strtoull.c + lib/strtoumax.c + lib/sys_stat.in.h + lib/sys_time.in.h + lib/sys_types.in.h + lib/sys_wait.in.h + lib/system-quote.c + lib/system-quote.h + lib/tempname.c + lib/tempname.h + lib/time-internal.h + lib/time.in.h + lib/time_r.c + lib/time_rz.c + lib/timegm.c + lib/timespec.c + lib/timespec.h + lib/trim.c + lib/trim.h + lib/tzset.c + lib/uinttostr.c + lib/umaxtostr.c + lib/unistd.c + lib/unistd.in.h + lib/unistr.in.h + lib/unistr/u8-mbtoucr.c + lib/unistr/u8-uctomb-aux.c + lib/unistr/u8-uctomb.c + lib/unitypes.in.h + lib/uniwidth.in.h + lib/uniwidth/cjk.h + lib/uniwidth/width.c + lib/unlocked-io.h + lib/unsetenv.c + lib/unused-parameter.h + lib/vasnprintf.c + lib/vasnprintf.h + lib/vasprintf.c + lib/verify.h + lib/version-etc-fsf.c + lib/version-etc.c + lib/version-etc.h + lib/warn-on-use.h + lib/wchar.in.h + lib/wcrtomb.c + lib/wctype-h.c + lib/wctype.in.h + lib/wcwidth.c + lib/xalloc-die.c + lib/xalloc-oversized.h + lib/xalloc.h + lib/xasprintf.c + lib/xfreopen.c + lib/xfreopen.h + lib/xmalloc.c + lib/xreadlink.c + lib/xreadlink.h + lib/xsize.c + lib/xsize.h + lib/xstriconv.c + lib/xstriconv.h + lib/xstrndup.c + lib/xstrndup.h + lib/xstrtol-error.c + lib/xstrtol.c + lib/xstrtol.h + lib/xstrtoul.c + lib/xstrtoumax.c + lib/xvasprintf.c + lib/xvasprintf.h + m4/00gnulib.m4 + m4/absolute-header.m4 + m4/alloca.m4 + m4/arpa_inet_h.m4 + m4/btowc.m4 + m4/builtin-expect.m4 + m4/c-stack.m4 + m4/clock_time.m4 + m4/close.m4 + m4/codeset.m4 + m4/config-h.m4 + m4/configmake.m4 + m4/ctype.m4 + m4/dirname.m4 + m4/double-slash-root.m4 + m4/dup2.m4 + m4/eealloc.m4 + m4/environ.m4 + m4/errno_h.m4 + m4/error.m4 + m4/exponentd.m4 + m4/extensions.m4 + m4/extern-inline.m4 + m4/fcntl-o.m4 + m4/fcntl.m4 + m4/fcntl_h.m4 + m4/fdopen.m4 + m4/filenamecat.m4 + m4/flexmember.m4 + m4/float_h.m4 + m4/fnmatch.m4 + m4/fpieee.m4 + m4/freopen.m4 + m4/fstat.m4 + m4/ftruncate.m4 + m4/getcwd.m4 + m4/getdtablesize.m4 + m4/getopt.m4 + m4/getpagesize.m4 + m4/getprogname.m4 + m4/gettime.m4 + m4/gettimeofday.m4 + m4/glibc21.m4 + m4/gnu-make.m4 + m4/gnulib-common.m4 + m4/hard-locale.m4 + m4/iconv.m4 + m4/iconv_h.m4 + m4/iconv_open.m4 + m4/include_next.m4 + m4/inet_pton.m4 + m4/inline.m4 + m4/intmax_t.m4 + m4/inttostr.m4 + m4/inttypes-pri.m4 + m4/inttypes.m4 + m4/inttypes_h.m4 + m4/ioctl.m4 + m4/isblank.m4 + m4/iswblank.m4 + m4/langinfo_h.m4 + m4/largefile.m4 + m4/lib-ld.m4 + m4/lib-link.m4 + m4/lib-prefix.m4 + m4/libsigsegv.m4 + m4/libunistring-base.m4 + m4/limits-h.m4 + m4/localcharset.m4 + m4/locale-fr.m4 + m4/locale-ja.m4 + m4/locale-tr.m4 + m4/locale-zh.m4 + m4/locale_h.m4 + m4/localeconv.m4 + m4/localtime-buffer.m4 + m4/longlong.m4 + m4/lstat.m4 + m4/malloc.m4 + m4/malloca.m4 + m4/manywarnings.m4 + m4/math_h.m4 + m4/mbchar.m4 + m4/mbiter.m4 + m4/mbrtowc.m4 + m4/mbsinit.m4 + m4/mbslen.m4 + m4/mbsrtowcs.m4 + m4/mbstate_t.m4 + m4/mbtowc.m4 + m4/memchr.m4 + m4/minmax.m4 + m4/mkstemp.m4 + m4/mktime.m4 + m4/mmap-anon.m4 + m4/mode_t.m4 + m4/msvc-inval.m4 + m4/msvc-nothrow.m4 + m4/multiarch.m4 + m4/nanosleep.m4 + m4/netinet_in_h.m4 + m4/nl_langinfo.m4 + m4/nocrash.m4 + m4/off_t.m4 + m4/open.m4 + m4/pathmax.m4 + m4/perror.m4 + m4/pipe.m4 + m4/printf.m4 + m4/putenv.m4 + m4/quote.m4 + m4/quotearg.m4 + m4/raise.m4 + m4/rawmemchr.m4 + m4/readlink.m4 + m4/regex.m4 + m4/secure_getenv.m4 + m4/select.m4 + m4/setenv.m4 + m4/setlocale.m4 + m4/sigaction.m4 + m4/signal_h.m4 + m4/signalblocking.m4 + m4/size_max.m4 + m4/sleep.m4 + m4/snprintf.m4 + m4/socketlib.m4 + m4/sockets.m4 + m4/socklen.m4 + m4/sockpfaf.m4 + m4/ssize_t.m4 + m4/stat-time.m4 + m4/stat.m4 + m4/stdalign.m4 + m4/stdarg.m4 + m4/stdbool.m4 + m4/stddef_h.m4 + m4/stdint.m4 + m4/stdint_h.m4 + m4/stdio_h.m4 + m4/stdlib_h.m4 + m4/strcase.m4 + m4/strerror.m4 + m4/strerror_r.m4 + m4/strftime.m4 + m4/string_h.m4 + m4/strings_h.m4 + m4/strndup.m4 + m4/strnlen.m4 + m4/strptime.m4 + m4/strtoull.m4 + m4/strtoumax.m4 + m4/symlink.m4 + m4/sys_ioctl_h.m4 + m4/sys_select_h.m4 + m4/sys_socket_h.m4 + m4/sys_stat_h.m4 + m4/sys_time_h.m4 + m4/sys_types_h.m4 + m4/sys_uio_h.m4 + m4/sys_wait_h.m4 + m4/tempname.m4 + m4/time_h.m4 + m4/time_r.m4 + m4/time_rz.m4 + m4/timegm.m4 + m4/timespec.m4 + m4/tm_gmtoff.m4 + m4/tzset.m4 + m4/unistd_h.m4 + m4/unlocked-io.m4 + m4/vararrays.m4 + m4/vasnprintf.m4 + m4/vasprintf.m4 + m4/version-etc.m4 + m4/warn-on-use.m4 + m4/warnings.m4 + m4/wchar_h.m4 + m4/wchar_t.m4 + m4/wcrtomb.m4 + m4/wctob.m4 + m4/wctomb.m4 + m4/wctype_h.m4 + m4/wcwidth.m4 + m4/wint_t.m4 + m4/xalloc.m4 + m4/xsize.m4 + m4/xstrndup.m4 + m4/xstrtol.m4 + m4/xvasprintf.m4 + tests/init.sh + tests/macros.h + tests/nap.h + tests/signature.h + tests/test-accept.c + tests/test-alloca-opt.c + tests/test-areadlink.c + tests/test-areadlink.h + tests/test-argmatch.c + tests/test-arpa_inet.c + tests/test-binary-io.c + tests/test-binary-io.sh + tests/test-bind.c + tests/test-bitrotate.c + tests/test-btowc.c + tests/test-btowc1.sh + tests/test-btowc2.sh + tests/test-c-ctype.c + tests/test-c-stack.c + tests/test-c-stack.sh + tests/test-c-stack2.sh + tests/test-c-strcase.sh + tests/test-c-strcasecmp.c + tests/test-c-strncasecmp.c + tests/test-close.c + tests/test-connect.c + tests/test-ctype.c + tests/test-dirname.c + tests/test-dup2.c + tests/test-environ.c + tests/test-errno.c + tests/test-exclude.c + tests/test-exclude1.sh + tests/test-exclude2.sh + tests/test-exclude3.sh + tests/test-exclude4.sh + tests/test-exclude5.sh + tests/test-exclude6.sh + tests/test-exclude7.sh + tests/test-exclude8.sh + tests/test-fcntl-h.c + tests/test-fcntl.c + tests/test-fdopen.c + tests/test-fgetc.c + tests/test-filenamecat.c + tests/test-float.c + tests/test-fnmatch.c + tests/test-fputc.c + tests/test-fread.c + tests/test-freopen-safer.c + tests/test-freopen.c + tests/test-fstat.c + tests/test-ftruncate.c + tests/test-ftruncate.sh + tests/test-fwrite.c + tests/test-getcwd-lgpl.c + tests/test-getdtablesize.c + tests/test-getopt-gnu.c + tests/test-getopt-main.h + tests/test-getopt-posix.c + tests/test-getopt.h + tests/test-getopt_long.h + tests/test-getprogname.c + tests/test-gettimeofday.c + tests/test-hash.c + tests/test-iconv-h.c + tests/test-iconv.c + tests/test-ignore-value.c + tests/test-inet_pton.c + tests/test-init.sh + tests/test-intprops.c + tests/test-inttostr.c + tests/test-inttypes.c + tests/test-ioctl.c + tests/test-isblank.c + tests/test-iswblank.c + tests/test-langinfo.c + tests/test-limits-h.c + tests/test-listen.c + tests/test-locale.c + tests/test-localeconv.c + tests/test-lstat.c + tests/test-lstat.h + tests/test-malloca.c + tests/test-mbrtowc-w32-1.sh + tests/test-mbrtowc-w32-2.sh + tests/test-mbrtowc-w32-3.sh + tests/test-mbrtowc-w32-4.sh + tests/test-mbrtowc-w32-5.sh + tests/test-mbrtowc-w32.c + tests/test-mbrtowc.c + tests/test-mbrtowc1.sh + tests/test-mbrtowc2.sh + tests/test-mbrtowc3.sh + tests/test-mbrtowc4.sh + tests/test-mbrtowc5.sh + tests/test-mbscasecmp.c + tests/test-mbscasecmp.sh + tests/test-mbsinit.c + tests/test-mbsinit.sh + tests/test-mbsrtowcs.c + tests/test-mbsrtowcs1.sh + tests/test-mbsrtowcs2.sh + tests/test-mbsrtowcs3.sh + tests/test-mbsrtowcs4.sh + tests/test-mbsstr1.c + tests/test-mbsstr2.c + tests/test-mbsstr2.sh + tests/test-mbsstr3.c + tests/test-mbsstr3.sh + tests/test-memchr.c + tests/test-nanosleep.c + tests/test-netinet_in.c + tests/test-nl_langinfo.c + tests/test-nl_langinfo.sh + tests/test-open.c + tests/test-open.h + tests/test-pathmax.c + tests/test-perror.c + tests/test-perror.sh + tests/test-perror2.c + tests/test-pipe.c + tests/test-quotearg-simple.c + tests/test-quotearg.h + tests/test-raise.c + tests/test-rawmemchr.c + tests/test-readlink.c + tests/test-readlink.h + tests/test-regex.c + tests/test-select-fd.c + tests/test-select-in.sh + tests/test-select-out.sh + tests/test-select-stdin.c + tests/test-select.c + tests/test-select.h + tests/test-setenv.c + tests/test-setlocale1.c + tests/test-setlocale1.sh + tests/test-setlocale2.c + tests/test-setlocale2.sh + tests/test-setsockopt.c + tests/test-sh-quote.c + tests/test-sigaction.c + tests/test-signal-h.c + tests/test-sigprocmask.c + tests/test-sleep.c + tests/test-snprintf.c + tests/test-sockets.c + tests/test-stat-time.c + tests/test-stat.c + tests/test-stat.h + tests/test-stdalign.c + tests/test-stdbool.c + tests/test-stddef.c + tests/test-stdint.c + tests/test-stdio.c + tests/test-stdlib.c + tests/test-strerror.c + tests/test-strerror_r.c + tests/test-strftime.c + tests/test-striconv.c + tests/test-string.c + tests/test-strings.c + tests/test-strnlen.c + tests/test-strtoull.c + tests/test-strtoumax.c + tests/test-symlink.c + tests/test-symlink.h + tests/test-sys_ioctl.c + tests/test-sys_select.c + tests/test-sys_socket.c + tests/test-sys_stat.c + tests/test-sys_time.c + tests/test-sys_types.c + tests/test-sys_uio.c + tests/test-sys_wait.c + tests/test-sys_wait.h + tests/test-time.c + tests/test-timespec.c + tests/test-unistd.c + tests/test-unsetenv.c + tests/test-update-copyright.sh + tests/test-vasnprintf.c + tests/test-vasprintf.c + tests/test-vc-list-files-cvs.sh + tests/test-vc-list-files-git.sh + tests/test-verify-try.c + tests/test-verify.c + tests/test-verify.sh + tests/test-version-etc.c + tests/test-version-etc.sh + tests/test-wchar.c + tests/test-wcrtomb-w32-1.sh + tests/test-wcrtomb-w32-2.sh + tests/test-wcrtomb-w32-3.sh + tests/test-wcrtomb-w32-4.sh + tests/test-wcrtomb-w32-5.sh + tests/test-wcrtomb-w32.c + tests/test-wcrtomb.c + tests/test-wcrtomb.sh + tests/test-wctype-h.c + tests/test-wcwidth.c + tests/test-xalloc-die.c + tests/test-xalloc-die.sh + tests/test-xstrtol.c + tests/test-xstrtol.sh + tests/test-xstrtoul.c + tests/test-xstrtoumax.c + tests/test-xstrtoumax.sh + tests/test-xvasprintf.c + tests/unistr/test-u8-mbtoucr.c + tests/unistr/test-u8-uctomb.c + tests/uniwidth/test-uc_width.c + tests/uniwidth/test-uc_width2.c + tests/uniwidth/test-uc_width2.sh + tests/zerosize-ptr.h + tests=lib/_Noreturn.h + tests=lib/accept.c + tests=lib/arg-nonnull.h + tests=lib/arpa_inet.in.h + tests=lib/bind.c + tests=lib/c++defs.h + tests=lib/connect.c + tests=lib/dtotimespec.c + tests=lib/fdopen.c + tests=lib/fpucw.h + tests=lib/ftruncate.c + tests=lib/getcwd-lgpl.c + tests=lib/getpagesize.c + tests=lib/hash-pjw.c + tests=lib/hash-pjw.h + tests=lib/inet_pton.c + tests=lib/ioctl.c + tests=lib/listen.c + tests=lib/nanosleep.c + tests=lib/netinet_in.in.h + tests=lib/perror.c + tests=lib/pipe.c + tests=lib/putenv.c + tests=lib/same-inode.h + tests=lib/select.c + tests=lib/setlocale.c + tests=lib/setsockopt.c + tests=lib/sleep.c + tests=lib/snprintf.c + tests=lib/socket.c + tests=lib/sockets.c + tests=lib/sockets.h + tests=lib/stdalign.in.h + tests=lib/strerror_r.c + tests=lib/symlink.c + tests=lib/sys_ioctl.in.h + tests=lib/sys_select.in.h + tests=lib/sys_socket.c + tests=lib/sys_socket.in.h + tests=lib/sys_uio.in.h + tests=lib/timespec-add.c + tests=lib/timespec-sub.c + tests=lib/unused-parameter.h + tests=lib/w32sock.h + tests=lib/warn-on-use.h + tests=lib/wctob.c + tests=lib/wctomb-impl.h + tests=lib/wctomb.c + top/GNUmakefile + top/README-release + top/maint.mk +]) +m4trace:m4/hard-locale.m4:8: -1- AC_DEFUN([gl_HARD_LOCALE], [ + : +]) +m4trace:m4/iconv.m4:9: -1- AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([iconv]) +]) +m4trace:m4/iconv.m4:20: -1- AC_DEFUN([AM_ICONV_LINK], [ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable GNU libiconv installed). + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + + dnl Add $INCICONV to CPPFLAGS before performing the following checks, + dnl because if the user has installed libiconv and not disabled its use + dnl via --without-libiconv-prefix, he wants to use it. The first + dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. + am_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) + + AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);]])], + [am_cv_func_iconv=yes]) + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);]])], + [am_cv_lib_iconv=yes] + [am_cv_func_iconv=yes]) + LIBS="$am_save_LIBS" + fi + ]) + if test "$am_cv_func_iconv" = yes; then + AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ + dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, + dnl Solaris 10. + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + ]], + [[int result = 0; + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\263"; + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + result |= 8; + iconv_close (cd_88591_to_utf8); + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + result |= 16; + return result; +]])], + [am_cv_func_iconv_works=yes], , + [case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac]) + test "$am_cv_func_iconv_works" = no || break + done + LIBS="$am_save_LIBS" + ]) + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + AC_DEFINE([HAVE_ICONV], [1], + [Define if you have the iconv() function and it works.]) + fi + if test "$am_cv_lib_iconv" = yes; then + AC_MSG_CHECKING([how to link with libiconv]) + AC_MSG_RESULT([$LIBICONV]) + else + dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV + dnl either. + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + AC_SUBST([LIBICONV]) + AC_SUBST([LTLIBICONV]) +]) +m4trace:m4/iconv.m4:233: -1- AC_DEFUN_ONCE([AM_ICONV], [ + AM_ICONV_LINK + if test "$am_cv_func_iconv" = yes; then + AC_MSG_CHECKING([for iconv declaration]) + AC_CACHE_VAL([am_cv_proto_iconv], [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif + ]], + [[]])], + [am_cv_proto_iconv_arg1=""], + [am_cv_proto_iconv_arg1="const"]) + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) + am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + AC_MSG_RESULT([ + $am_cv_proto_iconv]) + else + dnl When compiling GNU libiconv on a system that does not have iconv yet, + dnl pick the POSIX compliant declaration without 'const'. + am_cv_proto_iconv_arg1="" + fi + AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], + [Define as const if the declaration of iconv() needs const.]) + dnl Also substitute ICONV_CONST in the gnulib generated . + m4_ifdef([gl_ICONV_H_DEFAULTS], + [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) + if test -n "$am_cv_proto_iconv_arg1"; then + ICONV_CONST="const" + fi + ]) +]) +m4trace:m4/iconv_h.m4:7: -1- AC_DEFUN([gl_ICONV_H], [ + AC_REQUIRE([gl_ICONV_H_DEFAULTS]) + + dnl Execute this unconditionally, because ICONV_H may be set by other + dnl modules, after this code is executed. + gl_CHECK_NEXT_HEADERS([iconv.h]) +]) +m4trace:m4/iconv_h.m4:17: -1- AC_DEFUN([gl_REPLACE_ICONV_H], [ + AC_REQUIRE([gl_ICONV_H_DEFAULTS]) + ICONV_H='iconv.h' + AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"]) +]) +m4trace:m4/iconv_h.m4:24: -1- AC_DEFUN([gl_ICONV_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_ICONV_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) +]) +m4trace:m4/iconv_h.m4:31: -1- AC_DEFUN([gl_ICONV_H_DEFAULTS], [ + GNULIB_ICONV=0; AC_SUBST([GNULIB_ICONV]) + dnl Assume proper GNU behavior unless another module says otherwise. + ICONV_CONST=; AC_SUBST([ICONV_CONST]) + REPLACE_ICONV=0; AC_SUBST([REPLACE_ICONV]) + REPLACE_ICONV_OPEN=0; AC_SUBST([REPLACE_ICONV_OPEN]) + REPLACE_ICONV_UTF=0; AC_SUBST([REPLACE_ICONV_UTF]) + ICONV_H=''; AC_SUBST([ICONV_H]) + AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"]) +]) +m4trace:m4/iconv_open.m4:7: -1- AC_DEFUN([gl_FUNC_ICONV_OPEN], [ + AC_REQUIRE([AM_ICONV]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_ICONV_H_DEFAULTS]) + if test "$am_cv_func_iconv" = yes; then + dnl Provide the override, for the sake of the C++ aliases. + gl_REPLACE_ICONV_H + dnl Test whether iconv_open accepts standardized encoding names. + dnl We know that GNU libiconv and GNU libc do. + AC_EGREP_CPP([gnu_iconv], [ + #include + #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__) + gnu_iconv + #endif + ], [gl_func_iconv_gnu=yes], [gl_func_iconv_gnu=no]) + if test $gl_func_iconv_gnu = no; then + iconv_flavor= + case "$host_os" in + aix*) iconv_flavor=ICONV_FLAVOR_AIX ;; + irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;; + hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;; + osf*) iconv_flavor=ICONV_FLAVOR_OSF ;; + solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;; + esac + if test -n "$iconv_flavor"; then + AC_DEFINE_UNQUOTED([ICONV_FLAVOR], [$iconv_flavor], + [Define to a symbolic name denoting the flavor of iconv_open() + implementation.]) + gl_REPLACE_ICONV_OPEN + fi + fi + m4_ifdef([gl_FUNC_ICONV_OPEN_UTF_SUPPORT], [ + gl_FUNC_ICONV_OPEN_UTF_SUPPORT + if test $gl_cv_func_iconv_supports_utf = no; then + REPLACE_ICONV_UTF=1 + AC_DEFINE([REPLACE_ICONV_UTF], [1], + [Define if the iconv() functions are enhanced to handle the UTF-{16,32}{BE,LE} encodings.]) + REPLACE_ICONV=1 + gl_REPLACE_ICONV_OPEN + fi + ]) + fi +]) +m4trace:m4/iconv_open.m4:52: -1- AC_DEFUN([gl_REPLACE_ICONV_OPEN], [ + gl_REPLACE_ICONV_H + REPLACE_ICONV_OPEN=1 +]) +m4trace:m4/include_next.m4:36: -1- AC_DEFUN([gl_INCLUDE_NEXT], [ + AC_LANG_PREPROC_REQUIRE() + AC_CACHE_CHECK([whether the preprocessor supports include_next], + [gl_cv_have_include_next], + [rm -rf conftestd1a conftestd1b conftestd2 + mkdir conftestd1a conftestd1b conftestd2 + dnl IBM C 9.0, 10.1 (original versions, prior to the 2009-01 updates) on + dnl AIX 6.1 support include_next when used as first preprocessor directive + dnl in a file, but not when preceded by another include directive. Check + dnl for this bug by including . + dnl Additionally, with this same compiler, include_next is a no-op when + dnl used in a header file that was included by specifying its absolute + dnl file name. Despite these two bugs, include_next is used in the + dnl compiler's . By virtue of the second bug, we need to use + dnl include_next as well in this case. + cat < conftestd1a/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include_next +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat < conftestd1b/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include +#include_next +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat < conftestd2/conftest.h +#ifndef DEFINED_IN_CONFTESTD1 +#error "include_next test doesn't work" +#endif +#define DEFINED_IN_CONFTESTD2 +EOF + gl_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" +dnl We intentionally avoid using AC_LANG_SOURCE here. + AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include ]], + [gl_cv_have_include_next=yes], + [CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" + AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include ]], + [gl_cv_have_include_next=buggy], + [gl_cv_have_include_next=no]) + ]) + CPPFLAGS="$gl_save_CPPFLAGS" + rm -rf conftestd1a conftestd1b conftestd2 + ]) + PRAGMA_SYSTEM_HEADER= + if test $gl_cv_have_include_next = yes; then + INCLUDE_NEXT=include_next + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + if test -n "$GCC"; then + PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' + fi + else + if test $gl_cv_have_include_next = buggy; then + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + else + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include + fi + fi + AC_SUBST([INCLUDE_NEXT]) + AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE]) + AC_SUBST([PRAGMA_SYSTEM_HEADER]) + AC_CACHE_CHECK([whether system header files limit the line length], + [gl_cv_pragma_columns], + [dnl HP NonStop systems, which define __TANDEM, have this misfeature. + AC_EGREP_CPP([choke me], + [ +#ifdef __TANDEM +choke me +#endif + ], + [gl_cv_pragma_columns=yes], + [gl_cv_pragma_columns=no]) + ]) + if test $gl_cv_pragma_columns = yes; then + PRAGMA_COLUMNS="#pragma COLUMNS 10000" + else + PRAGMA_COLUMNS= + fi + AC_SUBST([PRAGMA_COLUMNS]) +]) +m4trace:m4/include_next.m4:154: -1- AC_DEFUN([gl_CHECK_NEXT_HEADERS], [ + gl_NEXT_HEADERS_INTERNAL([$1], [check]) +]) +m4trace:m4/include_next.m4:164: -1- AC_DEFUN([gl_NEXT_HEADERS], [ + gl_NEXT_HEADERS_INTERNAL([$1], [assume]) +]) +m4trace:m4/include_next.m4:170: -1- AC_DEFUN([gl_NEXT_HEADERS_INTERNAL], [ + AC_REQUIRE([gl_INCLUDE_NEXT]) + AC_REQUIRE([AC_CANONICAL_HOST]) + + m4_if([$2], [check], + [AC_CHECK_HEADERS_ONCE([$1]) + ]) + +dnl FIXME: gl_next_header and gl_header_exists must be used unquoted +dnl until we can assume autoconf 2.64 or newer. + m4_foreach_w([gl_HEADER_NAME], [$1], + [AS_VAR_PUSHDEF([gl_next_header], + [gl_cv_next_]m4_defn([gl_HEADER_NAME])) + if test $gl_cv_have_include_next = yes; then + AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>']) + else + AC_CACHE_CHECK( + [absolute name of <]m4_defn([gl_HEADER_NAME])[>], + m4_defn([gl_next_header]), + [m4_if([$2], [check], + [AS_VAR_PUSHDEF([gl_header_exists], + [ac_cv_header_]m4_defn([gl_HEADER_NAME])) + if test AS_VAR_GET(gl_header_exists) = yes; then + AS_VAR_POPDEF([gl_header_exists]) + ]) + gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME) + AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME)) + AS_VAR_SET(gl_next_header, ['"'$gl_header'"']) + m4_if([$2], [check], + [else + AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>']) + fi + ]) + ]) + fi + AC_SUBST( + AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])), + [AS_VAR_GET(gl_next_header)]) + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'gl_HEADER_NAME'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=AS_VAR_GET(gl_next_header) + fi + AC_SUBST( + AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])), + [$gl_next_as_first_directive]) + AS_VAR_POPDEF([gl_next_header])]) +]) +m4trace:m4/inet_pton.m4:7: -1- AC_DEFUN([gl_FUNC_INET_PTON], [ + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) + + dnl Persuade Solaris to declare inet_pton. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([AC_C_RESTRICT]) + + dnl Most platforms that provide inet_pton define it in libc. + dnl Solaris 8..10 provide inet_pton in libnsl instead. + dnl Solaris 2.6..7 provide inet_pton in libresolv instead. + dnl Native Windows provides it in -lws2_32 instead, with a declaration in + dnl , and it uses stdcall calling convention, not cdecl + dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it). + HAVE_INET_PTON=1 + INET_PTON_LIB= + gl_PREREQ_SYS_H_WINSOCK2 + if test $HAVE_WINSOCK2_H = 1; then + AC_CHECK_DECLS([inet_pton],,, [[#include ]]) + if test $ac_cv_have_decl_inet_pton = yes; then + dnl It needs to be overridden, because the stdcall calling convention + dnl is not compliant with POSIX. + REPLACE_INET_PTON=1 + INET_PTON_LIB="-lws2_32" + else + HAVE_DECL_INET_PTON=0 + HAVE_INET_PTON=0 + fi + else + gl_save_LIBS=$LIBS + AC_SEARCH_LIBS([inet_pton], [nsl resolv], [], + [AC_CHECK_FUNCS([inet_pton]) + if test $ac_cv_func_inet_pton = no; then + HAVE_INET_PTON=0 + fi + ]) + LIBS=$gl_save_LIBS + + if test "$ac_cv_search_inet_pton" != "no" \ + && test "$ac_cv_search_inet_pton" != "none required"; then + INET_PTON_LIB="$ac_cv_search_inet_pton" + fi + + AC_CHECK_HEADERS_ONCE([netdb.h]) + AC_CHECK_DECLS([inet_pton],,, + [[#include + #if HAVE_NETDB_H + # include + #endif + ]]) + if test $ac_cv_have_decl_inet_pton = no; then + HAVE_DECL_INET_PTON=0 + fi + fi + AC_SUBST([INET_PTON_LIB]) +]) +m4trace:m4/inet_pton.m4:66: -1- AC_DEFUN([gl_PREREQ_INET_PTON], [ + AC_REQUIRE([gl_SOCKET_FAMILIES]) +]) +m4trace:m4/inline.m4:12: -1- AC_DEFUN([gl_INLINE], [ + AC_REQUIRE([AC_C_INLINE]) + AC_CACHE_CHECK([whether the compiler generally respects inline], + [gl_cv_c_inline_effective], + [if test $ac_cv_c_inline = no; then + gl_cv_c_inline_effective=no + else + dnl GCC defines __NO_INLINE__ if not optimizing or if -fno-inline is + dnl specified. + dnl Use AC_COMPILE_IFELSE here, not AC_EGREP_CPP, because the result + dnl depends on optimization flags, which can be in CFLAGS. + dnl (AC_EGREP_CPP looks only at the CPPFLAGS.) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], + [[#ifdef __NO_INLINE__ + #error "inline is not effective" + #endif]])], + [gl_cv_c_inline_effective=yes], + [gl_cv_c_inline_effective=no]) + fi + ]) + if test $gl_cv_c_inline_effective = yes; then + AC_DEFINE([HAVE_INLINE], [1], + [Define to 1 if the compiler supports one of the keywords + 'inline', '__inline__', '__inline' and effectively inlines + functions marked as such.]) + fi +]) +m4trace:m4/intlmacosx.m4:18: -1- AC_DEFUN([gt_INTL_MACOSX], [ + dnl Check for API introduced in Mac OS X 10.2. + AC_CACHE_CHECK([for CFPreferencesCopyAppValue], + [gt_cv_func_CFPreferencesCopyAppValue], + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[CFPreferencesCopyAppValue(NULL, NULL)]])], + [gt_cv_func_CFPreferencesCopyAppValue=yes], + [gt_cv_func_CFPreferencesCopyAppValue=no]) + LIBS="$gt_save_LIBS"]) + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], + [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) + fi + dnl Check for API introduced in Mac OS X 10.3. + AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[CFLocaleCopyCurrent();]])], + [gt_cv_func_CFLocaleCopyCurrent=yes], + [gt_cv_func_CFLocaleCopyCurrent=no]) + LIBS="$gt_save_LIBS"]) + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], + [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + fi + AC_SUBST([INTL_MACOSX_LIBS]) +]) +m4trace:m4/intmax_t.m4:15: -1- AC_DEFUN([gl_AC_TYPE_INTMAX_T], [ + dnl For simplicity, we assume that a header file defines 'intmax_t' if and + dnl only if it defines 'uintmax_t'. + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([gl_AC_HEADER_STDINT_H]) + if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + test $ac_cv_type_long_long_int = yes \ + && ac_type='long long' \ + || ac_type='long' + AC_DEFINE_UNQUOTED([intmax_t], [$ac_type], + [Define to long or long long if and don't define.]) + else + AC_DEFINE([HAVE_INTMAX_T], [1], + [Define if you have the 'intmax_t' type in or .]) + fi +]) +m4trace:m4/intmax_t.m4:36: -1- AC_DEFUN([gt_AC_TYPE_INTMAX_T], [ + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([gl_AC_HEADER_STDINT_H]) + AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include +#if HAVE_STDINT_H_WITH_UINTMAX +#include +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include +#endif + ]], + [[intmax_t x = -1; return !x;]])], + [gt_cv_c_intmax_t=yes], + [gt_cv_c_intmax_t=no])]) + if test $gt_cv_c_intmax_t = yes; then + AC_DEFINE([HAVE_INTMAX_T], [1], + [Define if you have the 'intmax_t' type in or .]) + else + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + test $ac_cv_type_long_long_int = yes \ + && ac_type='long long' \ + || ac_type='long' + AC_DEFINE_UNQUOTED([intmax_t], [$ac_type], + [Define to long or long long if and don't define.]) + fi +]) +m4trace:m4/inttostr.m4:7: -1- AC_DEFUN([gl_INTTOSTR], [ + gl_PREREQ_INTTOSTR + gl_PREREQ_IMAXTOSTR + gl_PREREQ_OFFTOSTR + gl_PREREQ_UMAXTOSTR + gl_PREREQ_UINTTOSTR +]) +m4trace:m4/inttostr.m4:17: -1- AC_DEFUN([gl_PREREQ_INTTOSTR], [ + AC_REQUIRE([AC_TYPE_OFF_T]) + : +]) +m4trace:m4/inttostr.m4:23: -1- AC_DEFUN([gl_PREREQ_IMAXTOSTR], [:]) +m4trace:m4/inttostr.m4:26: -1- AC_DEFUN([gl_PREREQ_OFFTOSTR], [:]) +m4trace:m4/inttostr.m4:29: -1- AC_DEFUN([gl_PREREQ_UMAXTOSTR], [:]) +m4trace:m4/inttostr.m4:32: -1- AC_DEFUN([gl_PREREQ_UINTTOSTR], [:]) +m4trace:m4/inttypes-pri.m4:14: -1- AC_DEFUN([gt_INTTYPES_PRI], [ + AC_CHECK_HEADERS([inttypes.h]) + if test $ac_cv_header_inttypes_h = yes; then + AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], + [gt_cv_inttypes_pri_broken], + [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#ifdef PRId32 +char *p = PRId32; +#endif + ]], + [[]])], + [gt_cv_inttypes_pri_broken=no], + [gt_cv_inttypes_pri_broken=yes]) + ]) + fi + if test "$gt_cv_inttypes_pri_broken" = yes; then + AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1], + [Define if exists and defines unusable PRI* macros.]) + PRI_MACROS_BROKEN=1 + else + PRI_MACROS_BROKEN=0 + fi + AC_SUBST([PRI_MACROS_BROKEN]) +]) +m4trace:m4/inttypes.m4:10: -1- AC_DEFUN([gl_INTTYPES_H], [ + AC_REQUIRE([gl_INTTYPES_INCOMPLETE]) + gl_INTTYPES_PRI_SCN +]) +m4trace:m4/inttypes.m4:16: -1- AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE], [ + AC_REQUIRE([gl_STDINT_H]) + AC_CHECK_HEADERS_ONCE([inttypes.h]) + + dnl Override always, so that the portability warnings work. + AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) + gl_CHECK_NEXT_HEADERS([inttypes.h]) + + AC_REQUIRE([gl_MULTIARCH]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include + ]], [imaxabs imaxdiv strtoimax strtoumax]) +]) +m4trace:m4/inttypes.m4:34: -1- AC_DEFUN([gl_INTTYPES_PRI_SCN], [ + AC_REQUIRE([gt_INTTYPES_PRI]) + + PRIPTR_PREFIX= + if test -n "$STDINT_H"; then + dnl Using the gnulib . It always defines intptr_t to 'long'. + PRIPTR_PREFIX='"l"' + else + dnl Using the system's . + for glpfx in '' l ll I64; do + case $glpfx in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + I64) gltype1='__int64';; + esac + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include + extern intptr_t foo; + extern $gltype1 foo;]])], + [PRIPTR_PREFIX='"'$glpfx'"']) + test -n "$PRIPTR_PREFIX" && break + done + fi + AC_SUBST([PRIPTR_PREFIX]) + + gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( + [INT32_MAX_LT_INTMAX_MAX], + [defined INT32_MAX && defined INTMAX_MAX], + [INT32_MAX < INTMAX_MAX], + [sizeof (int) < sizeof (long long int)]) + if test $APPLE_UNIVERSAL_BUILD = 0; then + gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( + [INT64_MAX_EQ_LONG_MAX], + [defined INT64_MAX], + [INT64_MAX == LONG_MAX], + [sizeof (long long int) == sizeof (long int)]) + else + INT64_MAX_EQ_LONG_MAX=-1 + fi + gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( + [UINT32_MAX_LT_UINTMAX_MAX], + [defined UINT32_MAX && defined UINTMAX_MAX], + [UINT32_MAX < UINTMAX_MAX], + [sizeof (unsigned int) < sizeof (unsigned long long int)]) + if test $APPLE_UNIVERSAL_BUILD = 0; then + gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( + [UINT64_MAX_EQ_ULONG_MAX], + [defined UINT64_MAX], + [UINT64_MAX == ULONG_MAX], + [sizeof (unsigned long long int) == sizeof (unsigned long int)]) + else + UINT64_MAX_EQ_ULONG_MAX=-1 + fi +]) +m4trace:m4/inttypes.m4:97: -1- AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION], [ + AC_CACHE_CHECK([whether $3], + [gl_cv_test_$1], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include + #if HAVE_STDINT_H + #include + #endif + + #if $2 + #define CONDITION ($3) + #elif HAVE_LONG_LONG_INT + #define CONDITION ($4) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1];]])], + [gl_cv_test_$1=yes], + [gl_cv_test_$1=no])]) + if test $gl_cv_test_$1 = yes; then + $1=1; + else + $1=0; + fi + AC_SUBST([$1]) +]) +m4trace:m4/inttypes.m4:132: -1- AC_DEFUN([gl_INTTYPES_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) +]) +m4trace:m4/inttypes.m4:139: -1- AC_DEFUN([gl_INTTYPES_H_DEFAULTS], [ + GNULIB_IMAXABS=0; AC_SUBST([GNULIB_IMAXABS]) + GNULIB_IMAXDIV=0; AC_SUBST([GNULIB_IMAXDIV]) + GNULIB_STRTOIMAX=0; AC_SUBST([GNULIB_STRTOIMAX]) + GNULIB_STRTOUMAX=0; AC_SUBST([GNULIB_STRTOUMAX]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DECL_IMAXABS=1; AC_SUBST([HAVE_DECL_IMAXABS]) + HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV]) + HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX]) + HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX]) + REPLACE_STRTOIMAX=0; AC_SUBST([REPLACE_STRTOIMAX]) + REPLACE_STRTOUMAX=0; AC_SUBST([REPLACE_STRTOUMAX]) + INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX]) + INT64_MAX_EQ_LONG_MAX='defined _LP64'; AC_SUBST([INT64_MAX_EQ_LONG_MAX]) + PRI_MACROS_BROKEN=0; AC_SUBST([PRI_MACROS_BROKEN]) + PRIPTR_PREFIX=__PRIPTR_PREFIX; AC_SUBST([PRIPTR_PREFIX]) + UINT32_MAX_LT_UINTMAX_MAX=1; AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX]) + UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; AC_SUBST([UINT64_MAX_EQ_ULONG_MAX]) +]) +m4trace:m4/inttypes_h.m4:12: -1- AC_DEFUN([gl_AC_HEADER_INTTYPES_H], [ + AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[uintmax_t i = (uintmax_t) -1; return !i;]])], + [gl_cv_header_inttypes_h=yes], + [gl_cv_header_inttypes_h=no])]) + if test $gl_cv_header_inttypes_h = yes; then + AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1], + [Define if exists, doesn't clash with , + and declares uintmax_t. ]) + fi +]) +m4trace:m4/ioctl.m4:7: -1- AC_DEFUN([gl_FUNC_IOCTL], [ + AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + HAVE_IOCTL=1 + if test "$ac_cv_header_winsock2_h" = yes; then + dnl Even if the 'socket' module is not used here, another part of the + dnl application may use it and pass file descriptors that refer to + dnl sockets to the ioctl() function. So enable the support for sockets. + HAVE_IOCTL=0 + else + AC_CHECK_FUNCS([ioctl]) + dnl On glibc systems, the second parameter is 'unsigned long int request', + dnl not 'int request'. We cannot simply cast the function pointer, but + dnl instead need a wrapper. + AC_CACHE_CHECK([for ioctl with POSIX signature], + [gl_cv_func_ioctl_posix_signature], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[extern + #ifdef __cplusplus + "C" + #endif + int ioctl (int, int, ...); + ]]) + ], + [gl_cv_func_ioctl_posix_signature=yes], + [gl_cv_func_ioctl_posix_signature=no]) + ]) + if test $gl_cv_func_ioctl_posix_signature != yes; then + REPLACE_IOCTL=1 + fi + fi +]) +m4trace:m4/isblank.m4:7: -1- AC_DEFUN([gl_FUNC_ISBLANK], [ + dnl Persuade glibc to declare isblank(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([gl_CTYPE_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([isblank]) + if test $ac_cv_func_isblank = no; then + HAVE_ISBLANK=0 + fi +]) +m4trace:m4/iswblank.m4:7: -1- AC_DEFUN([gl_FUNC_ISWBLANK], [ + AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) + AC_REQUIRE([gl_WCTYPE_H]) + dnl Persuade glibc to declare iswblank(). + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_FUNCS_ONCE([iswblank]) + AC_CHECK_DECLS([iswblank], , , [[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include +#include +]]) + if test $ac_cv_func_iswblank = no; then + HAVE_ISWBLANK=0 + if test $ac_cv_have_decl_iswblank = yes; then + REPLACE_ISWBLANK=1 + fi + fi + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + dnl Redefine all of iswcntrl, ..., towupper in . + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + dnl Redefine only iswblank. + : + fi + fi + +]) +m4trace:m4/langinfo_h.m4:7: -1- AC_DEFUN([gl_LANGINFO_H], [ + AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) + + dnl Persuade glibc-2.0.6 to define CODESET. + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + dnl is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([langinfo.h]) + + dnl Determine whether exists. It is missing on mingw and BeOS. + HAVE_LANGINFO_CODESET=0 + HAVE_LANGINFO_T_FMT_AMPM=0 + HAVE_LANGINFO_ERA=0 + HAVE_LANGINFO_YESEXPR=0 + AC_CHECK_HEADERS_ONCE([langinfo.h]) + if test $ac_cv_header_langinfo_h = yes; then + HAVE_LANGINFO_H=1 + dnl Determine what defines. CODESET and ERA etc. are missing + dnl on OpenBSD 3.8. T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3. + AC_CACHE_CHECK([whether langinfo.h defines CODESET], + [gl_cv_header_langinfo_codeset], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include +int a = CODESET; +]])], + [gl_cv_header_langinfo_codeset=yes], + [gl_cv_header_langinfo_codeset=no]) + ]) + if test $gl_cv_header_langinfo_codeset = yes; then + HAVE_LANGINFO_CODESET=1 + fi + AC_CACHE_CHECK([whether langinfo.h defines T_FMT_AMPM], + [gl_cv_header_langinfo_t_fmt_ampm], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include +int a = T_FMT_AMPM; +]])], + [gl_cv_header_langinfo_t_fmt_ampm=yes], + [gl_cv_header_langinfo_t_fmt_ampm=no]) + ]) + if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then + HAVE_LANGINFO_T_FMT_AMPM=1 + fi + AC_CACHE_CHECK([whether langinfo.h defines ERA], + [gl_cv_header_langinfo_era], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include +int a = ERA; +]])], + [gl_cv_header_langinfo_era=yes], + [gl_cv_header_langinfo_era=no]) + ]) + if test $gl_cv_header_langinfo_era = yes; then + HAVE_LANGINFO_ERA=1 + fi + AC_CACHE_CHECK([whether langinfo.h defines YESEXPR], + [gl_cv_header_langinfo_yesexpr], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include +int a = YESEXPR; +]])], + [gl_cv_header_langinfo_yesexpr=yes], + [gl_cv_header_langinfo_yesexpr=no]) + ]) + if test $gl_cv_header_langinfo_yesexpr = yes; then + HAVE_LANGINFO_YESEXPR=1 + fi + else + HAVE_LANGINFO_H=0 + fi + AC_SUBST([HAVE_LANGINFO_H]) + AC_SUBST([HAVE_LANGINFO_CODESET]) + AC_SUBST([HAVE_LANGINFO_T_FMT_AMPM]) + AC_SUBST([HAVE_LANGINFO_ERA]) + AC_SUBST([HAVE_LANGINFO_YESEXPR]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include + ]], [nl_langinfo]) +]) +m4trace:m4/langinfo_h.m4:90: -1- AC_DEFUN([gl_LANGINFO_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) +m4trace:m4/langinfo_h.m4:99: -1- AC_DEFUN([gl_LANGINFO_H_DEFAULTS], [ + GNULIB_NL_LANGINFO=0; AC_SUBST([GNULIB_NL_LANGINFO]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_NL_LANGINFO=1; AC_SUBST([HAVE_NL_LANGINFO]) + REPLACE_NL_LANGINFO=0; AC_SUBST([REPLACE_NL_LANGINFO]) +]) +m4trace:m4/largefile.m4:107: -1- AC_DEFUN([gl_LARGEFILE], [ + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw*) + dnl Native Windows. + dnl mingw64 defines off_t to a 64-bit type already, if + dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE. + AC_CACHE_CHECK([for 64-bit off_t], [gl_cv_type_off_t_64], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1]; + ]], + [[]])], + [gl_cv_type_off_t_64=yes], [gl_cv_type_off_t_64=no]) + ]) + if test $gl_cv_type_off_t_64 = no; then + WINDOWS_64_BIT_OFF_T=1 + else + WINDOWS_64_BIT_OFF_T=0 + fi + dnl Some mingw versions define, if _FILE_OFFSET_BITS=64, 'struct stat' + dnl to 'struct _stat32i64' or 'struct _stat64' (depending on + dnl _USE_32BIT_TIME_T), which has a 32-bit st_size member. + AC_CACHE_CHECK([for 64-bit st_size], [gl_cv_member_st_size_64], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + struct stat buf; + int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1]; + ]], + [[]])], + [gl_cv_member_st_size_64=yes], [gl_cv_member_st_size_64=no]) + ]) + if test $gl_cv_member_st_size_64 = no; then + WINDOWS_64_BIT_ST_SIZE=1 + else + WINDOWS_64_BIT_ST_SIZE=0 + fi + ;; + *) + dnl Nothing to do on gnulib's side. + dnl A 64-bit off_t is + dnl - already the default on Mac OS X, FreeBSD, NetBSD, OpenBSD, IRIX, + dnl OSF/1, Cygwin, + dnl - enabled by _FILE_OFFSET_BITS=64 (ensured by AC_SYS_LARGEFILE) on + dnl glibc, HP-UX, Solaris, + dnl - enabled by _LARGE_FILES=1 (ensured by AC_SYS_LARGEFILE) on AIX, + dnl - impossible to achieve on Minix 3.1.8. + WINDOWS_64_BIT_OFF_T=0 + WINDOWS_64_BIT_ST_SIZE=0 + ;; + esac +]) +m4trace:m4/lib-ld.m4:12: -1- AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], +[# I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 /dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +if test -n "$LD"; then + AC_MSG_CHECKING([for ld]) +elif test "$GCC" = yes; then + AC_MSG_CHECKING([for ld used by $CC]) +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +if test -n "$LD"; then + # Let the user override the test with a path. + : +else + AC_CACHE_VAL([acl_cv_path_LD], + [ + acl_cv_path_LD= # Final result of this test + ac_prog=ld # Program to search in $PATH + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + acl_output=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $acl_output in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` + while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do + acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` + done + # Got the pathname. No search in PATH is needed. + acl_cv_path_LD="$acl_output" + ac_prog= + ;; + "") + # If it fails, then pretend we aren't using GCC. + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac + fi + if test -n "$ac_prog"; then + # Search for $ac_prog in $PATH. + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$acl_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 = 1.10 to complain if config.rpath is missing. + m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) + AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS + AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld + AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host + AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir + AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ]) + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + dnl Determine whether the user wants rpath handling at all. + AC_ARG_ENABLE([rpath], + [ --disable-rpath do not hardcode runtime library paths], + :, enable_rpath=yes) +]) +m4trace:m4/lib-link.m4:161: -1- AC_DEFUN([AC_LIB_FROMPACKAGE], [ + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + define([acl_frompackage_]NAME, [$2]) + popdef([NAME]) + pushdef([PACK],[$2]) + pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + define([acl_libsinpackage_]PACKUP, + m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) + popdef([PACKUP]) + popdef([PACK]) +]) +m4trace:m4/lib-link.m4:181: -1- AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) + pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) + dnl Autoconf >= 2.61 supports dots in --with options. + pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_ARG_WITH(P_A_C_K[-prefix], +[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib + --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi +]) + dnl Search the library and its dependencies in $additional_libdir and + dnl $LDFLAGS. Using breadth-first-seach. + LIB[]NAME= + LTLIB[]NAME= + INC[]NAME= + LIB[]NAME[]_PREFIX= + dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been + dnl computed. So it has to be reset here. + HAVE_LIB[]NAME= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='$1 $2' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + dnl See if it was already located by an earlier AC_LIB_LINKFLAGS + dnl or AC_LIB_HAVE_LINKFLAGS call. + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" + else + dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined + dnl that this library doesn't exist. So just drop it. + : + fi + else + dnl Search the library lib$name in $additional_libdir and $LDFLAGS + dnl and the already constructed $LIBNAME/$LTLIBNAME. + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + dnl The same code as in the loop below: + dnl First look for a shared library. + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + dnl Then look for a static library. + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + dnl First look for a shared library. + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + dnl Then look for a static library. + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + dnl Found the library. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + dnl Linking with a shared library. We attempt to hardcode its + dnl directory into the executable's runpath, unless it's the + dnl standard /usr/lib. + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + dnl No hardcoding is needed. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + dnl The hardcoding into $LIBNAME is system dependent. + if test "$acl_hardcode_direct" = yes; then + dnl Using DIR/libNAME.so during linking hardcodes DIR into the + dnl resulting binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + dnl Rely on "-L$found_dir". + dnl But don't add it if it's already contained in the LDFLAGS + dnl or the already constructed $LIBNAME + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH + dnl here, because this doesn't fit in flags passed to the + dnl compiler. So give up. No hardcoding. This affects only + dnl very old systems. + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + dnl Linking with a static library. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" + else + dnl We shouldn't come here, but anyway it's good to have a + dnl fallback. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" + fi + fi + dnl Assume the include files are nearby. + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = '$1'; then + LIB[]NAME[]_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = '$1'; then + LIB[]NAME[]_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + dnl Potentially add $additional_includedir to $INCNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's /usr/local/include and we are using GCC on Linux, + dnl 3. if it's already present in $CPPFLAGS or the already + dnl constructed $INCNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INC[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $INCNAME. + INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + dnl Look for dependencies. + if test -n "$found_la"; then + dnl Read the .la file. It defines the variables + dnl dlname, library_names, old_library, dependency_libs, current, + dnl age, revision, installed, dlopen, dlpreopen, libdir. + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + dnl We use only dependency_libs. + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's /usr/local/lib and we are using GCC on Linux, + dnl 3. if it's already present in $LDFLAGS or the already + dnl constructed $LIBNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LIBNAME. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LTLIBNAME. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + dnl Handle this in the next round. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + dnl Handle this in the next round. Throw away the .la's + dnl directory; it is already contained in a preceding -L + dnl option. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + dnl Most likely an immediate library name. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" + ;; + esac + done + fi + else + dnl Didn't find the library; assume it is in the system directories + dnl known to the linker and runtime loader. (All the system + dnl directories known to the linker should also be known to the + dnl runtime loader, otherwise the system is severely misconfigured.) + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user must + dnl pass all path elements in one option. We can arrange that for a + dnl single library, but not when more than one $LIBNAMEs are used. + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + else + dnl The -rpath options are cumulative. + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + dnl When using libtool, the option that works for both libraries and + dnl executables is -R. The -R options are cumulative. + for found_dir in $ltrpathdirs; do + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" + done + fi + popdef([P_A_C_K]) + popdef([PACKLIBS]) + popdef([PACKUP]) + popdef([PACK]) + popdef([NAME]) +]) +m4trace:m4/lib-link.m4:684: -1- AC_DEFUN([AC_LIB_APPENDTOVAR], [ + for element in [$2]; do + haveit= + for x in $[$1]; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + [$1]="${[$1]}${[$1]:+ }$element" + fi + done +]) +m4trace:m4/lib-link.m4:708: -1- AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ + AC_REQUIRE([AC_LIB_RPATH]) + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + $1= + if test "$enable_rpath" != no; then + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode directories into the resulting + dnl binary. + rpathdirs= + next= + for opt in $2; do + if test -n "$next"; then + dir="$next" + dnl No need to hardcode the standard /usr/lib. + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2"; then + rpathdirs="$rpathdirs $dir" + fi + next= + else + case $opt in + -L) next=yes ;; + -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` + dnl No need to hardcode the standard /usr/lib. + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2"; then + rpathdirs="$rpathdirs $dir" + fi + next= ;; + *) next= ;; + esac + fi + done + if test "X$rpathdirs" != "X"; then + if test -n ""$3""; then + dnl libtool is used for linking. Use -R options. + for dir in $rpathdirs; do + $1="${$1}${$1:+ }-R$dir" + done + else + dnl The linker is used for linking directly. + if test -n "$acl_hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user + dnl must pass all path elements in one option. + alldirs= + for dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + $1="$flag" + else + dnl The -rpath options are cumulative. + for dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + $1="${$1}${$1:+ }$flag" + done + fi + fi + fi + fi + fi + AC_SUBST([$1]) +]) +m4trace:m4/lib-prefix.m4:12: -1- AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])]) +m4trace:m4/lib-prefix.m4:22: -1- AC_DEFUN([AC_LIB_PREFIX], [ + AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib-prefix], +[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib + --without-lib-prefix don't search for libraries in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi +]) + if test $use_additional = yes; then + dnl Potentially add $additional_includedir to $CPPFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's already present in $CPPFLAGS, + dnl 3. if it's /usr/local/include and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + for x in $CPPFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $CPPFLAGS. + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" + fi + fi + fi + fi + dnl Potentially add $additional_libdir to $LDFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's already present in $LDFLAGS, + dnl 3. if it's /usr/local/lib and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + for x in $LDFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LDFLAGS. + LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" + fi + fi + fi + fi + fi +]) +m4trace:m4/lib-prefix.m4:122: -1- AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" +]) +m4trace:m4/lib-prefix.m4:145: -1- AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + $1 + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" +]) +m4trace:m4/lib-prefix.m4:162: -1- AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ + dnl There is no formal standard regarding lib and lib64. + dnl On glibc systems, the current practice is that on a system supporting + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under + dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine + dnl the compiler's default mode by looking at the compiler's library search + dnl path. If at least one of its elements ends in /lib64 or points to a + dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. + dnl Otherwise we use the default, namely "lib". + dnl On Solaris systems, the current practice is that on a system supporting + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under + dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or + dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. + AC_REQUIRE([AC_CANONICAL_HOST]) + dnl Allow the user to override the result by setting acl_cv_libdirstems. + AC_CACHE_CHECK([for the common suffixes of directories in the library search path], + [acl_cv_libdirstems], + [acl_libdirstem=lib + acl_libdirstem2= + case "$host_os" in + solaris*) + dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment + dnl . + dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." + dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the + dnl symlink is missing, so we set acl_libdirstem2 too. + AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], + [AC_EGREP_CPP([sixtyfour bits], [ +#ifdef _LP64 +sixtyfour bits +#endif + ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) + ]) + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; + esac + fi + ;; + *) + dnl The result is a property of the system. However, non-system + dnl compilers sometimes have odd library search paths. Therefore + dnl prefer asking /usr/bin/gcc, if available, rather than $CC. + searchpath=`(if test -f /usr/bin/gcc \ + && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \ + LC_ALL=C /usr/bin/gcc -print-search-dirs; \ + else \ + LC_ALL=C $CC -print-search-dirs; \ + fi) 2>/dev/null \ + | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2" + ]) + # Decompose acl_cv_libdirstems into acl_libdirstem and acl_libdirstem2. + acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` + acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e '/,/s/.*,//'` +]) +m4trace:m4/libsigsegv.m4:9: -1- AC_DEFUN([gl_LIBSIGSEGV], [ + AC_LIB_HAVE_LINKFLAGS([sigsegv], [], + [#include ], [sigsegv_deinstall_handler();], + [no, consider installing GNU libsigsegv]) + dnl Some other autoconf macros and clisp's configure use this variable. + gl_cv_lib_sigsegv="$ac_cv_libsigsegv" +]) +m4trace:m4/libunistring-base.m4:22: -1- AC_DEFUN([gl_LIBUNISTRING_MODULE], [ + AC_REQUIRE([gl_LIBUNISTRING_LIB_PREPARE]) + dnl Use the variables HAVE_LIBUNISTRING, LIBUNISTRING_VERSION from + dnl gl_LIBUNISTRING_CORE if that macro has been run. + AM_CONDITIONAL(AS_TR_CPP([LIBUNISTRING_COMPILE_$2]), + [gl_LIBUNISTRING_VERSION_CMP([$1])]) +]) +m4trace:m4/libunistring-base.m4:48: -1- AC_DEFUN([gl_LIBUNISTRING_LIBHEADER], [ + AC_REQUIRE([gl_LIBUNISTRING_LIB_PREPARE]) + dnl Use the variables HAVE_LIBUNISTRING, LIBUNISTRING_VERSION from + dnl gl_LIBUNISTRING_CORE if that macro has been run. + if gl_LIBUNISTRING_VERSION_CMP([$1]); then + LIBUNISTRING_[]AS_TR_CPP([$2])='$2' + else + LIBUNISTRING_[]AS_TR_CPP([$2])= + fi + AC_SUBST([LIBUNISTRING_]AS_TR_CPP([$2])) +]) +m4trace:m4/libunistring-base.m4:63: -1- AC_DEFUN([gl_LIBUNISTRING_LIB_PREPARE], [ + dnl Ensure that HAVE_LIBUNISTRING is fully determined at this point. + m4_ifdef([gl_LIBUNISTRING], [AC_REQUIRE([gl_LIBUNISTRING])]) + + AC_REQUIRE([AC_PROG_AWK]) + +dnl Sed expressions to extract the parts of a version number. +changequote(,) +gl_libunistring_sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +changequote([,]) + + if test "$HAVE_LIBUNISTRING" = yes; then + LIBUNISTRING_VERSION_MAJOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_major"` + LIBUNISTRING_VERSION_MINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_minor"` + LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_subminor"` + fi +]) +m4trace:m4/libunistring-base.m4:99: -1- AC_DEFUN([gl_LIBUNISTRING_VERSION_CMP], [ { test "$HAVE_LIBUNISTRING" != yes \ + || { + dnl AS_LITERAL_IF exists and works fine since autoconf-2.59 at least. + AS_LITERAL_IF([$1], + [dnl This is the optimized variant, that assumes the argument is a literal: + m4_pushdef([requested_version_major], + [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^\([0-9]*\).*], [\1]), [])]) + m4_pushdef([requested_version_minor], + [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^[0-9]*[.]\([0-9]*\).*], [\1]), [$1])]) + m4_pushdef([requested_version_subminor], + [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^[0-9]*[.][0-9]*[.]\([0-9]*\).*], [\1]), [$1])]) + test $LIBUNISTRING_VERSION_MAJOR -lt requested_version_major \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq requested_version_major \ + && { test $LIBUNISTRING_VERSION_MINOR -lt requested_version_minor \ + || { test $LIBUNISTRING_VERSION_MINOR -eq requested_version_minor \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt requested_version_subminor + } + } + } + m4_popdef([requested_version_subminor]) + m4_popdef([requested_version_minor]) + m4_popdef([requested_version_major]) + ], + [dnl This is the unoptimized variant: + requested_version_major=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_major"` + requested_version_minor=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_minor"` + requested_version_subminor=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_subminor"` + test $LIBUNISTRING_VERSION_MAJOR -lt $requested_version_major \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq $requested_version_major \ + && { test $LIBUNISTRING_VERSION_MINOR -lt $requested_version_minor \ + || { test $LIBUNISTRING_VERSION_MINOR -eq $requested_version_minor \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt $requested_version_subminor + } + } + } + ]) + } + }]) +m4trace:m4/limits-h.m4:10: -1- AC_DEFUN_ONCE([gl_LIMITS_H], [ + gl_CHECK_NEXT_HEADERS([limits.h]) + + AC_CACHE_CHECK([whether limits.h has ULLONG_WIDTH etc.], + [gl_cv_header_limits_width], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include + int ullw = ULLONG_WIDTH;]])], + [gl_cv_header_limits_width=yes], + [gl_cv_header_limits_width=no])]) + if test "$gl_cv_header_limits_width" = yes; then + LIMITS_H= + else + LIMITS_H=limits.h + fi + AC_SUBST([LIMITS_H]) + AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) +]) +m4trace:m4/localcharset.m4:7: -1- AC_DEFUN([gl_LOCALCHARSET], [ + dnl Prerequisites of lib/localcharset.c. + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_REQUIRE([gl_FCNTL_O_FLAGS]) + AC_CHECK_DECLS_ONCE([getc_unlocked]) + + dnl Prerequisites of the lib/Makefile.am snippet. + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_GLIBC21]) +]) +m4trace:m4/locale-fr.m4:10: -1- AC_DEFUN([gt_LOCALE_FR], [ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [ + AC_LANG_CONFTEST([AC_LANG_SOURCE([ +changequote(,)dnl +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ]) + LOCALE_FR=$gt_cv_locale_fr + AC_SUBST([LOCALE_FR]) +]) +m4trace:m4/locale-fr.m4:135: -1- AC_DEFUN([gt_LOCALE_FR_UTF8], [ + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [ + AC_LANG_CONFTEST([AC_LANG_SOURCE([ +changequote(,)dnl +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ]) + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + AC_SUBST([LOCALE_FR_UTF8]) +]) +m4trace:m4/locale-ja.m4:10: -1- AC_DEFUN([gt_LOCALE_JA], [ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_CACHE_CHECK([for a traditional japanese locale], [gt_cv_locale_ja], [ + AC_LANG_CONFTEST([AC_LANG_SOURCE([ +changequote(,)dnl +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ]) + LOCALE_JA=$gt_cv_locale_ja + AC_SUBST([LOCALE_JA]) +]) +m4trace:m4/locale-tr.m4:10: -1- AC_DEFUN([gt_LOCALE_TR_UTF8], [ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_CACHE_CHECK([for a turkish Unicode locale], [gt_cv_locale_tr_utf8], [ + AC_LANG_CONFTEST([AC_LANG_SOURCE([ +changequote(,)dnl +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. But BeOS does not + implement the Turkish upper-/lowercase mappings. Therefore, let this + program return 1 on BeOS. */ + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the eighth month, the second + character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f) + return 1; + /* Check whether the upper-/lowercase mappings are as expected for + Turkish. */ + if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i' + || towupper(0x0131) != 'I' || towlower ('I') != 0x0131) + return 1; + return 0; +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=Turkish_Turkey.65001 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr.UTF-8 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + fi + fi + ;; + esac + else + gt_cv_locale_tr_utf8=none + fi + rm -fr conftest* + ]) + LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8 + AC_SUBST([LOCALE_TR_UTF8]) +]) +m4trace:m4/locale-zh.m4:10: -1- AC_DEFUN([gt_LOCALE_ZH_CN], [ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_CACHE_CHECK([for a transitional chinese locale], [gt_cv_locale_zh_CN], [ + AC_LANG_CONFTEST([AC_LANG_SOURCE([ +changequote(,)dnl +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ]) + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + AC_SUBST([LOCALE_ZH_CN]) +]) +m4trace:m4/locale_h.m4:7: -1- AC_DEFUN([gl_LOCALE_H], [ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) + + dnl Persuade glibc to define locale_t and the int_p_*, int_n_* + dnl members of 'struct lconv'. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + dnl If is replaced, then must also be replaced. + AC_REQUIRE([gl_STDDEF_H]) + + dnl Solaris 11 2011-11 defines the int_p_*, int_n_* members of 'struct lconv' + dnl only if _LCONV_C99 is defined. + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + solaris*) + AC_DEFINE([_LCONV_C99], [1], [Define to 1 on Solaris.]) + ;; + esac + + AC_CACHE_CHECK([whether locale.h conforms to POSIX:2001], + [gl_cv_header_locale_h_posix2001], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + int x = LC_MESSAGES; + int y = sizeof (((struct lconv *) 0)->decimal_point);]], + [[]])], + [gl_cv_header_locale_h_posix2001=yes], + [gl_cv_header_locale_h_posix2001=no])]) + + dnl Check for . + AC_CHECK_HEADERS_ONCE([xlocale.h]) + if test $ac_cv_header_xlocale_h = yes; then + HAVE_XLOCALE_H=1 + dnl Check whether use of locale_t requires inclusion of , + dnl e.g. on Mac OS X 10.5. If does not define locale_t by + dnl itself, we assume that will do so. + AC_CACHE_CHECK([whether locale.h defines locale_t], + [gl_cv_header_locale_has_locale_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + locale_t x;]], + [[]])], + [gl_cv_header_locale_has_locale_t=yes], + [gl_cv_header_locale_has_locale_t=no]) + ]) + if test $gl_cv_header_locale_has_locale_t = yes; then + gl_cv_header_locale_h_needs_xlocale_h=no + else + gl_cv_header_locale_h_needs_xlocale_h=yes + fi + else + HAVE_XLOCALE_H=0 + gl_cv_header_locale_h_needs_xlocale_h=no + fi + AC_SUBST([HAVE_XLOCALE_H]) + + dnl Check whether 'struct lconv' is complete. + dnl Bionic libc's 'struct lconv' is just a dummy. + dnl On OpenBSD 4.9, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin 1.5.x, + dnl mingw, MSVC 9, it lacks the int_p_* and int_n_* members. + AC_CACHE_CHECK([whether struct lconv is properly defined], + [gl_cv_sys_struct_lconv_ok], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + struct lconv l; + int x = sizeof (l.decimal_point); + int y = sizeof (l.int_p_cs_precedes);]], + [[]])], + [gl_cv_sys_struct_lconv_ok=yes], + [gl_cv_sys_struct_lconv_ok=no]) + ]) + if test $gl_cv_sys_struct_lconv_ok = no; then + REPLACE_STRUCT_LCONV=1 + fi + + dnl is always overridden, because of GNULIB_POSIXCHECK. + gl_NEXT_HEADERS([locale.h]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include +/* Some systems provide declarations in a non-standard header. */ +#if HAVE_XLOCALE_H +# include +#endif + ]], + [setlocale duplocale]) +]) +m4trace:m4/locale_h.m4:102: -1- AC_DEFUN([gl_LOCALE_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) +m4trace:m4/locale_h.m4:111: -1- AC_DEFUN([gl_LOCALE_H_DEFAULTS], [ + GNULIB_LOCALECONV=0; AC_SUBST([GNULIB_LOCALECONV]) + GNULIB_SETLOCALE=0; AC_SUBST([GNULIB_SETLOCALE]) + GNULIB_DUPLOCALE=0; AC_SUBST([GNULIB_DUPLOCALE]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE]) + REPLACE_LOCALECONV=0; AC_SUBST([REPLACE_LOCALECONV]) + REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE]) + REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE]) + REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV]) +]) +m4trace:m4/localeconv.m4:7: -1- AC_DEFUN([gl_FUNC_LOCALECONV], [ + AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) + AC_REQUIRE([gl_LOCALE_H]) + + if test $REPLACE_STRUCT_LCONV = 1; then + REPLACE_LOCALECONV=1 + fi +]) +m4trace:m4/localeconv.m4:18: -1- AC_DEFUN([gl_PREREQ_LOCALECONV], [ + AC_CHECK_MEMBERS([struct lconv.decimal_point], [], [], + [[#include ]]) +]) +m4trace:m4/localtime-buffer.m4:7: -1- AC_DEFUN([gl_LOCALTIME_BUFFER_DEFAULTS], [ + NEED_LOCALTIME_BUFFER=0 +]) +m4trace:m4/localtime-buffer.m4:14: -1- AC_DEFUN([gl_LOCALTIME_BUFFER_NEEDED], [ + AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + NEED_LOCALTIME_BUFFER=1 + REPLACE_GMTIME=1 + REPLACE_LOCALTIME=1 +]) +m4trace:m4/longlong.m4:17: -1- AC_DEFUN([AC_TYPE_LONG_LONG_INT], [ + AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) + AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], + [ac_cv_type_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_long_long_int = yes; then + dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. + dnl If cross compiling, assume the bug is not important, since + dnl nobody cross compiles for this platform as far as we know. + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[@%:@include + @%:@ifndef LLONG_MAX + @%:@ define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + @%:@ define LLONG_MAX (HALF - 1 + HALF) + @%:@endif]], + [[long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0;]])], + [], + [ac_cv_type_long_long_int=no], + [:]) + fi + fi]) + if test $ac_cv_type_long_long_int = yes; then + AC_DEFINE([HAVE_LONG_LONG_INT], [1], + [Define to 1 if the system has the type 'long long int'.]) + fi +]) +m4trace:m4/longlong.m4:67: -1- AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], [ + AC_CACHE_CHECK([for unsigned long long int], + [ac_cv_type_unsigned_long_long_int], + [ac_cv_type_unsigned_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + AC_LINK_IFELSE( + [_AC_TYPE_LONG_LONG_SNIPPET], + [], + [ac_cv_type_unsigned_long_long_int=no]) + fi]) + if test $ac_cv_type_unsigned_long_long_int = yes; then + AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], + [Define to 1 if the system has the type 'unsigned long long int'.]) + fi +]) +m4trace:m4/longlong.m4:89: -1- AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET], [ + AC_LANG_PROGRAM( + [[/* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63;]], + [[/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull));]]) +]) +m4trace:m4/lstat.m4:11: -1- AC_DEFUN([gl_FUNC_LSTAT], [ + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + dnl If lstat does not exist, the replacement does + dnl "#define lstat stat", and lstat.c is a no-op. + AC_CHECK_FUNCS_ONCE([lstat]) + if test $ac_cv_func_lstat = yes; then + AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *no) + REPLACE_LSTAT=1 + ;; + esac + else + HAVE_LSTAT=0 + fi +]) +m4trace:m4/lstat.m4:30: -1- AC_DEFUN([gl_PREREQ_LSTAT], [:]) +m4trace:m4/lstat.m4:32: -1- AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK], [ + dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it + dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ. + AC_CACHE_CHECK([whether lstat correctly handles trailing slash], + [gl_cv_func_lstat_dereferences_slashed_symlink], + [rm -f conftest.sym conftest.file + echo >conftest.file + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [AC_INCLUDES_DEFAULT], + [[struct stat sbuf; + if (symlink ("conftest.file", "conftest.sym") != 0) + return 1; + /* Linux will dereference the symlink and fail, as required by + POSIX. That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + ]])], + [gl_cv_func_lstat_dereferences_slashed_symlink=yes], + [gl_cv_func_lstat_dereferences_slashed_symlink=no], + [case "$host_os" in + *-gnu*) + # Guess yes on glibc systems. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; + *) + # If we don't know, assume the worst. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; + esac + ]) + rm -f conftest.sym conftest.file + ]) + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *yes) + AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1], + [Define to 1 if 'lstat' dereferences a symlink specified + with a trailing slash.]) + ;; + esac +]) +m4trace:m4/malloc.m4:52: -1- AC_DEFUN([gl_FUNC_MALLOC_GNU], [ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + dnl _AC_FUNC_MALLOC_IF is defined in Autoconf. + _AC_FUNC_MALLOC_IF( + [AC_DEFINE([HAVE_MALLOC_GNU], [1], + [Define to 1 if your system has a GNU libc compatible 'malloc' + function, and to 0 otherwise.])], + [AC_DEFINE([HAVE_MALLOC_GNU], [0]) + REPLACE_MALLOC=1 + ]) +]) +m4trace:m4/malloc.m4:69: -1- AC_DEFUN([gl_FUNC_MALLOC_POSIX], [ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) + if test $gl_cv_func_malloc_posix = yes; then + AC_DEFINE([HAVE_MALLOC_POSIX], [1], + [Define if the 'malloc' function is POSIX compliant.]) + else + REPLACE_MALLOC=1 + fi +]) +m4trace:m4/malloc.m4:83: -1- AC_DEFUN([gl_CHECK_MALLOC_POSIX], [ + AC_CACHE_CHECK([whether malloc, realloc, calloc are POSIX compliant], + [gl_cv_func_malloc_posix], + [ + dnl It is too dangerous to try to allocate a large amount of memory: + dnl some systems go to their knees when you do that. So assume that + dnl all Unix implementations of the function are POSIX compliant. + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[]], + [[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + choke me + #endif + ]])], + [gl_cv_func_malloc_posix=yes], + [gl_cv_func_malloc_posix=no]) + ]) +]) +m4trace:m4/malloca.m4:8: -1- AC_DEFUN([gl_MALLOCA], [ + dnl Use the autoconf tests for alloca(), but not the AC_SUBSTed variables + dnl @ALLOCA@ and @LTALLOCA@. + dnl gl_FUNC_ALLOCA dnl Already brought in by the module dependencies. + AC_REQUIRE([gl_EEMALLOC]) + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) +]) +m4trace:m4/manywarnings.m4:14: -1- AC_DEFUN([gl_MANYWARN_COMPLEMENT], [ + gl_warn_set= + set x $2; shift + for gl_warn_item + do + case " $3 " in + *" $gl_warn_item "*) + ;; + *) + gl_warn_set="$gl_warn_set $gl_warn_item" + ;; + esac + done + $1=$gl_warn_set +]) +m4trace:m4/manywarnings.m4:36: -1- AC_DEFUN([gl_MANYWARN_ALL_GCC], [ + dnl First, check for some issues that only occur when combining multiple + dnl gcc warning categories. + AC_REQUIRE([AC_PROG_CC]) + if test -n "$GCC"; then + + dnl Check if -W -Werror -Wno-missing-field-initializers is supported + dnl with the current $CC $CFLAGS $CPPFLAGS. + AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported]) + AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [ + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], [[]])], + [gl_cv_cc_nomfi_supported=yes], + [gl_cv_cc_nomfi_supported=no]) + CFLAGS="$gl_save_CFLAGS"]) + AC_MSG_RESULT([$gl_cv_cc_nomfi_supported]) + + if test "$gl_cv_cc_nomfi_supported" = yes; then + dnl Now check whether -Wno-missing-field-initializers is needed + dnl for the { 0, } construct. + AC_MSG_CHECKING([whether -Wno-missing-field-initializers is needed]) + AC_CACHE_VAL([gl_cv_cc_nomfi_needed], [ + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[int f (void) + { + typedef struct { int a; int b; } s_t; + s_t s1 = { 0, }; + return s1.b; + } + ]], + [[]])], + [gl_cv_cc_nomfi_needed=no], + [gl_cv_cc_nomfi_needed=yes]) + CFLAGS="$gl_save_CFLAGS" + ]) + AC_MSG_RESULT([$gl_cv_cc_nomfi_needed]) + fi + + dnl Next, check if -Werror -Wuninitialized is useful with the + dnl user's choice of $CFLAGS; some versions of gcc warn that it + dnl has no effect if -O is not also used + AC_MSG_CHECKING([whether -Wuninitialized is supported]) + AC_CACHE_VAL([gl_cv_cc_uninitialized_supported], [ + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wuninitialized" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], [[]])], + [gl_cv_cc_uninitialized_supported=yes], + [gl_cv_cc_uninitialized_supported=no]) + CFLAGS="$gl_save_CFLAGS"]) + AC_MSG_RESULT([$gl_cv_cc_uninitialized_supported]) + + fi + + # List all gcc warning categories. + # To compare this list to your installed GCC's, run this Bash command: + # + # comm -3 \ + # <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \ + # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort | + # grep -v -x -F -f <( + # awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec)) + + gl_manywarn_set= + for gl_manywarn_item in -fno-common \ + -W \ + -Wabi \ + -Waddress \ + -Waggressive-loop-optimizations \ + -Wall \ + -Wattributes \ + -Wbad-function-cast \ + -Wbool-compare \ + -Wbool-operation \ + -Wbuiltin-declaration-mismatch \ + -Wbuiltin-macro-redefined \ + -Wcast-align \ + -Wchar-subscripts \ + -Wchkp \ + -Wclobbered \ + -Wcomment \ + -Wcomments \ + -Wcoverage-mismatch \ + -Wcpp \ + -Wdangling-else \ + -Wdate-time \ + -Wdeprecated \ + -Wdeprecated-declarations \ + -Wdesignated-init \ + -Wdisabled-optimization \ + -Wdiscarded-array-qualifiers \ + -Wdiscarded-qualifiers \ + -Wdiv-by-zero \ + -Wdouble-promotion \ + -Wduplicated-branches \ + -Wduplicated-cond \ + -Wduplicate-decl-specifier \ + -Wempty-body \ + -Wendif-labels \ + -Wenum-compare \ + -Wexpansion-to-defined \ + -Wextra \ + -Wformat-contains-nul \ + -Wformat-extra-args \ + -Wformat-nonliteral \ + -Wformat-security \ + -Wformat-signedness \ + -Wformat-y2k \ + -Wformat-zero-length \ + -Wframe-address \ + -Wfree-nonheap-object \ + -Whsa \ + -Wignored-attributes \ + -Wignored-qualifiers \ + -Wimplicit \ + -Wimplicit-function-declaration \ + -Wimplicit-int \ + -Wincompatible-pointer-types \ + -Winit-self \ + -Winline \ + -Wint-conversion \ + -Wint-in-bool-context \ + -Wint-to-pointer-cast \ + -Winvalid-memory-model \ + -Winvalid-pch \ + -Wjump-misses-init \ + -Wlogical-not-parentheses \ + -Wlogical-op \ + -Wmain \ + -Wmaybe-uninitialized \ + -Wmemset-elt-size \ + -Wmemset-transposed-args \ + -Wmisleading-indentation \ + -Wmissing-braces \ + -Wmissing-declarations \ + -Wmissing-field-initializers \ + -Wmissing-include-dirs \ + -Wmissing-parameter-type \ + -Wmissing-prototypes \ + -Wmultichar \ + -Wnarrowing \ + -Wnested-externs \ + -Wnonnull \ + -Wnonnull-compare \ + -Wnull-dereference \ + -Wodr \ + -Wold-style-declaration \ + -Wold-style-definition \ + -Wopenmp-simd \ + -Woverflow \ + -Woverlength-strings \ + -Woverride-init \ + -Wpacked \ + -Wpacked-bitfield-compat \ + -Wparentheses \ + -Wpointer-arith \ + -Wpointer-compare \ + -Wpointer-sign \ + -Wpointer-to-int-cast \ + -Wpragmas \ + -Wpsabi \ + -Wrestrict \ + -Wreturn-local-addr \ + -Wreturn-type \ + -Wscalar-storage-order \ + -Wsequence-point \ + -Wshadow \ + -Wshift-count-negative \ + -Wshift-count-overflow \ + -Wshift-negative-value \ + -Wsizeof-array-argument \ + -Wsizeof-pointer-memaccess \ + -Wstack-protector \ + -Wstrict-aliasing \ + -Wstrict-overflow \ + -Wstrict-prototypes \ + -Wsuggest-attribute=const \ + -Wsuggest-attribute=format \ + -Wsuggest-attribute=noreturn \ + -Wsuggest-attribute=pure \ + -Wsuggest-final-methods \ + -Wsuggest-final-types \ + -Wswitch \ + -Wswitch-bool \ + -Wswitch-default \ + -Wswitch-unreachable \ + -Wsync-nand \ + -Wsystem-headers \ + -Wtautological-compare \ + -Wtrampolines \ + -Wtrigraphs \ + -Wtype-limits \ + -Wuninitialized \ + -Wunknown-pragmas \ + -Wunsafe-loop-optimizations \ + -Wunused \ + -Wunused-but-set-parameter \ + -Wunused-but-set-variable \ + -Wunused-function \ + -Wunused-label \ + -Wunused-local-typedefs \ + -Wunused-macros \ + -Wunused-parameter \ + -Wunused-result \ + -Wunused-value \ + -Wunused-variable \ + -Wvarargs \ + -Wvariadic-macros \ + -Wvector-operation-performance \ + -Wvla \ + -Wvolatile-register-var \ + -Wwrite-strings \ + \ + ; do + gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" + done + + # gcc --help=warnings outputs an unusual form for these options; list + # them here so that the above 'comm' command doesn't report a false match. + # Would prefer "min (PTRDIFF_MAX, SIZE_MAX)", but it must be a literal: + ptrdiff_max_max=9223372036854775807 + gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$ptrdiff_max_max" + gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2" + gl_manywarn_set="$gl_manywarn_set -Wformat-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wformat-truncation=2" + gl_manywarn_set="$gl_manywarn_set -Wimplicit-fallthrough=5" + gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc" + gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wstringop-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2" + gl_manywarn_set="$gl_manywarn_set -Wvla-larger-than=4031" + + # These are needed for older GCC versions. + if test -n "$GCC"; then + case `($CC --version) 2>/dev/null` in + 'gcc (GCC) '[[0-3]].* | \ + 'gcc (GCC) '4.[[0-7]].*) + gl_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option" + gl_manywarn_set="$gl_manywarn_set -funit-at-a-time" + ;; + esac + fi + + # Disable specific options as needed. + if test "$gl_cv_cc_nomfi_needed" = yes; then + gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers" + fi + + if test "$gl_cv_cc_uninitialized_supported" = no; then + gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized" + fi + + $1=$gl_manywarn_set +]) +m4trace:m4/mbchar.m4:10: -1- AC_DEFUN([gl_MBCHAR], [ + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) +]) +m4trace:m4/mbiter.m4:10: -1- AC_DEFUN([gl_MBITER], [ + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + : +]) +m4trace:m4/mbrtowc.m4:8: -1- AC_DEFUN([gl_FUNC_MBRTOWC], [ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + gl_MBSTATE_T_BROKEN + + AC_CHECK_FUNCS_ONCE([mbrtowc]) + if test $ac_cv_func_mbrtowc = no; then + HAVE_MBRTOWC=0 + AC_CHECK_DECLS([mbrtowc],,, [[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +]]) + if test $ac_cv_have_decl_mbrtowc = yes; then + dnl On Minix 3.1.8, the system's declares mbrtowc() although + dnl it does not have the function. Avoid a collision with gnulib's + dnl replacement. + REPLACE_MBRTOWC=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBRTOWC=1 + else + gl_MBRTOWC_NULL_ARG1 + gl_MBRTOWC_NULL_ARG2 + gl_MBRTOWC_RETVAL + gl_MBRTOWC_NUL_RETVAL + gl_MBRTOWC_EMPTY_INPUT + gl_MBRTOWC_C_LOCALE + case "$gl_cv_func_mbrtowc_null_arg1" in + *yes) ;; + *) AC_DEFINE([MBRTOWC_NULL_ARG1_BUG], [1], + [Define if the mbrtowc function has the NULL pwc argument bug.]) + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_null_arg2" in + *yes) ;; + *) AC_DEFINE([MBRTOWC_NULL_ARG2_BUG], [1], + [Define if the mbrtowc function has the NULL string argument bug.]) + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_retval" in + *yes) ;; + *) AC_DEFINE([MBRTOWC_RETVAL_BUG], [1], + [Define if the mbrtowc function returns a wrong return value.]) + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_nul_retval" in + *yes) ;; + *) AC_DEFINE([MBRTOWC_NUL_RETVAL_BUG], [1], + [Define if the mbrtowc function does not return 0 for a NUL character.]) + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_empty_input" in + *yes) ;; + *) AC_DEFINE([MBRTOWC_EMPTY_INPUT_BUG], [1], + [Define if the mbrtowc function does not return (size_t) -2 + for empty input.]) + REPLACE_MBRTOWC=1 + ;; + esac + case $gl_cv_C_locale_sans_EILSEQ in + *yes) ;; + *) AC_DEFINE([C_LOCALE_MAYBE_EILSEQ], [1], + [Define to 1 if the C locale may have encoding errors.]) + REPLACE_MBRTOWC=1 + ;; + esac + fi + fi +]) +m4trace:m4/mbrtowc.m4:97: -1- AC_DEFUN([gl_MBSTATE_T_BROKEN], [ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + AC_CHECK_FUNCS_ONCE([mbsinit]) + AC_CHECK_FUNCS_ONCE([mbrtowc]) + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + gl_MBRTOWC_INCOMPLETE_STATE + gl_MBRTOWC_SANITYCHECK + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi +]) +m4trace:m4/mbrtowc.m4:125: -1- AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_JA]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc handles incomplete characters], + [gl_cv_func_mbrtowc_incomplete_state], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_JA != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +}]])], + [gl_cv_func_mbrtowc_incomplete_state=yes], + [gl_cv_func_mbrtowc_incomplete_state=no], + [:]) + fi + ]) +]) +m4trace:m4/mbrtowc.m4:181: -1- AC_DEFUN([gl_MBRTOWC_SANITYCHECK], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_ZH_CN]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc works as well as mbtowc], + [gl_cv_func_mbrtowc_sanitycheck], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_ZH_CN != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +}]])], + [gl_cv_func_mbrtowc_sanitycheck=yes], + [gl_cv_func_mbrtowc_sanitycheck=no], + [:]) + fi + ]) +]) +m4trace:m4/mbrtowc.m4:241: -1- AC_DEFUN([gl_MBRTOWC_NULL_ARG1], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR_UTF8]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc handles a NULL pwc argument], + [gl_cv_func_mbrtowc_null_arg1], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on Solaris. + solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR_UTF8 != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + int result = 0; + + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "\303\237er"; + mbstate_t state; + wchar_t wc; + size_t ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 5, &state); + if (ret != 2) + result |= 1; + if (!mbsinit (&state)) + result |= 2; + + memset (&state, '\0', sizeof (mbstate_t)); + ret = mbrtowc (NULL, input, 5, &state); + if (ret != 2) /* Solaris 7 fails here: ret is -1. */ + result |= 4; + if (!mbsinit (&state)) + result |= 8; + } + return result; +}]])], + [gl_cv_func_mbrtowc_null_arg1=yes], + [gl_cv_func_mbrtowc_null_arg1=no], + [:]) + fi + ]) +]) +m4trace:m4/mbrtowc.m4:311: -1- AC_DEFUN([gl_MBRTOWC_NULL_ARG2], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR_UTF8]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc handles a NULL string argument], + [gl_cv_func_mbrtowc_null_arg2], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on OSF/1. + osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR_UTF8 != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + mbstate_t state; + wchar_t wc; + int ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + mbrtowc (&wc, NULL, 5, &state); + /* Check that wc was not modified. */ + if (wc != (wchar_t) 0xBADFACE) + return 2; + } + return 0; +}]])], + [gl_cv_func_mbrtowc_null_arg2=yes], + [gl_cv_func_mbrtowc_null_arg2=no], + [:]) + fi + ]) +]) +m4trace:m4/mbrtowc.m4:371: -1- AC_DEFUN([gl_MBRTOWC_RETVAL], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR_UTF8]) + AC_REQUIRE([gt_LOCALE_JA]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CACHE_CHECK([whether mbrtowc has a correct return value], + [gl_cv_func_mbrtowc_retval], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on HP-UX, Solaris, native Windows. + hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_retval="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \ + || { case "$host_os" in mingw*) true;; *) false;; esac; }; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + int result = 0; + int found_some_locale = 0; + /* This fails on Solaris. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "B\303\274\303\237er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 1) + result |= 1; + } + found_some_locale = 1; + } + /* This fails on HP-UX 11.11. */ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 2) + result |= 2; + } + found_some_locale = 1; + } + /* This fails on native Windows. */ + if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) + { + char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 4; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) + { + char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 8; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_China.936") != NULL) + { + char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 16; + } + found_some_locale = 1; + } + return (found_some_locale ? result : 77); +}]])], + [gl_cv_func_mbrtowc_retval=yes], + [if test $? != 77; then + gl_cv_func_mbrtowc_retval=no + fi + ], + [:]) + fi + ]) +]) +m4trace:m4/mbrtowc.m4:501: -1- AC_DEFUN([gl_MBRTOWC_NUL_RETVAL], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_ZH_CN]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc returns 0 when parsing a NUL character], + [gl_cv_func_mbrtowc_nul_retval], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on Solaris 8 and 9. + solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_ZH_CN != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + /* This fails on Solaris 8 and 9. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, "", 1, &state) != 0) + return 2; + } + return 0; +}]])], + [gl_cv_func_mbrtowc_nul_retval=yes], + [gl_cv_func_mbrtowc_nul_retval=no], + [:]) + fi + ]) +]) +m4trace:m4/mbrtowc.m4:555: -1- AC_DEFUN([gl_MBRTOWC_EMPTY_INPUT], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc works on empty input], + [gl_cv_func_mbrtowc_empty_input], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on AIX and glibc systems. + aix* | *-gnu*) + gl_cv_func_mbrtowc_empty_input="guessing no" ;; + *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; + esac +changequote([,])dnl + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ + #include + static wchar_t wc; + static mbstate_t mbs; + int + main (void) + { + return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2; + }]])], + [gl_cv_func_mbrtowc_empty_input=yes], + [gl_cv_func_mbrtowc_empty_input=no], + [:]) + ]) +]) +m4trace:m4/mbrtowc.m4:593: -1- AC_DEFUN([gl_MBRTOWC_C_LOCALE], [ + AC_CACHE_CHECK([whether the C locale is free of encoding errors], + [gl_cv_C_locale_sans_EILSEQ], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. + gl_cv_C_locale_sans_EILSEQ="guessing no" + + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #include + ]], [[ + int i; + char *locale = setlocale (LC_ALL, "C"); + if (! locale) + return 2; + for (i = CHAR_MIN; i <= CHAR_MAX; i++) + { + char c = i; + wchar_t wc; + mbstate_t mbs = { 0, }; + size_t ss = mbrtowc (&wc, &c, 1, &mbs); + if (1 < ss) + return 3; + } + return 0; + ]])], + [gl_cv_C_locale_sans_EILSEQ=yes], + [gl_cv_C_locale_sans_EILSEQ=no], + [:])]) +]) +m4trace:m4/mbrtowc.m4:629: -1- AC_DEFUN([gl_PREREQ_MBRTOWC], [ + : +]) +m4trace:m4/mbrtowc.m4:638: -1- AC_DEFUN([AC_FUNC_MBRTOWC], [ + dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60. + AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared], + gl_cv_func_mbrtowc, + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include ]], + [[wchar_t wc; + char const s[] = ""; + size_t n = 1; + mbstate_t state; + return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])], + gl_cv_func_mbrtowc=yes, + gl_cv_func_mbrtowc=no)]) + if test $gl_cv_func_mbrtowc = yes; then + AC_DEFINE([HAVE_MBRTOWC], [1], + [Define to 1 if mbrtowc and mbstate_t are properly declared.]) + fi +]) +m4trace:m4/mbsinit.m4:7: -1- AC_DEFUN([gl_FUNC_MBSINIT], [ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + gl_MBSTATE_T_BROKEN + + AC_CHECK_FUNCS_ONCE([mbsinit]) + if test $ac_cv_func_mbsinit = no; then + HAVE_MBSINIT=0 + AC_CHECK_DECLS([mbsinit],,, [[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +]]) + if test $ac_cv_have_decl_mbsinit = yes; then + dnl On Minix 3.1.8, the system's declares mbsinit() although + dnl it does not have the function. Avoid a collision with gnulib's + dnl replacement. + REPLACE_MBSINIT=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSINIT=1 + else + dnl On mingw, mbsinit() always returns 1, which is inappropriate for + dnl states produced by mbrtowc() for an incomplete multibyte character + dnl in multibyte locales. + case "$host_os" in + mingw*) REPLACE_MBSINIT=1 ;; + esac + fi + fi +]) +m4trace:m4/mbsinit.m4:49: -1- AC_DEFUN([gl_PREREQ_MBSINIT], [ + : +]) +m4trace:m4/mbslen.m4:7: -1- AC_DEFUN([gl_FUNC_MBSLEN], [ + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([mbslen]) + if test $ac_cv_func_mbslen = yes; then + HAVE_MBSLEN=1 + else + HAVE_MBSLEN=0 + fi +]) +m4trace:m4/mbsrtowcs.m4:7: -1- AC_DEFUN([gl_FUNC_MBSRTOWCS], [ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + gl_MBSTATE_T_BROKEN + + AC_CHECK_FUNCS_ONCE([mbsrtowcs]) + if test $ac_cv_func_mbsrtowcs = no; then + HAVE_MBSRTOWCS=0 + AC_CHECK_DECLS([mbsrtowcs],,, [[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +]]) + if test $ac_cv_have_decl_mbsrtowcs = yes; then + dnl On Minix 3.1.8, the system's declares mbsrtowcs() although + dnl it does not have the function. Avoid a collision with gnulib's + dnl replacement. + REPLACE_MBSRTOWCS=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSRTOWCS=1 + else + gl_MBSRTOWCS_WORKS + case "$gl_cv_func_mbsrtowcs_works" in + *yes) ;; + *) REPLACE_MBSRTOWCS=1 ;; + esac + fi + fi +]) +m4trace:m4/mbsrtowcs.m4:49: -1- AC_DEFUN([gl_MBSRTOWCS_WORKS], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR]) + AC_REQUIRE([gt_LOCALE_FR_UTF8]) + AC_REQUIRE([gt_LOCALE_JA]) + AC_REQUIRE([gt_LOCALE_ZH_CN]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbsrtowcs works], + [gl_cv_func_mbsrtowcs_works], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on HP-UX, Solaris, mingw. + hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbsrtowcs_works="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + int result = 0; + /* Test whether the function supports a NULL destination argument. + This fails on native Windows. */ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + const char input[] = "\337er"; + const char *src = input; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbsrtowcs (NULL, &src, 1, &state) != 3 + || src != input) + result |= 1; + } + /* Test whether the function works when started with a conversion state + in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + const char input[] = "B\303\274\303\237er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + result |= 2; + } + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "<\306\374\313\334\270\354>"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 4; + if (mbsrtowcs (NULL, &src, 10, &state) != 3) + result |= 4; + } + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + const char input[] = "B\250\271\201\060\211\070er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + result |= 8; + } + } + return result; +}]])], + [gl_cv_func_mbsrtowcs_works=yes], + [gl_cv_func_mbsrtowcs_works=no], + [:]) + fi + ]) +]) +m4trace:m4/mbsrtowcs.m4:153: -1- AC_DEFUN([gl_PREREQ_MBSRTOWCS], [ + : +]) +m4trace:m4/mbstate_t.m4:15: -1- AC_DEFUN([AC_TYPE_MBSTATE_T], [ + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) dnl for HP-UX 11.11 + + AC_CACHE_CHECK([for mbstate_t], [ac_cv_type_mbstate_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [AC_INCLUDES_DEFAULT[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include ]], + [[mbstate_t x; return sizeof x;]])], + [ac_cv_type_mbstate_t=yes], + [ac_cv_type_mbstate_t=no])]) + if test $ac_cv_type_mbstate_t = yes; then + AC_DEFINE([HAVE_MBSTATE_T], [1], + [Define to 1 if declares mbstate_t.]) + else + AC_DEFINE([mbstate_t], [int], + [Define to a type if does not define.]) + fi +]) +m4trace:m4/mbtowc.m4:7: -1- AC_DEFUN([gl_FUNC_MBTOWC], [ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + + if false; then + REPLACE_MBTOWC=1 + fi +]) +m4trace:m4/mbtowc.m4:17: -1- AC_DEFUN([gl_PREREQ_MBTOWC], [ + : +]) +m4trace:m4/memchr.m4:7: -1- AC_DEFUN_ONCE([gl_FUNC_MEMCHR], [ + dnl Check for prerequisites for memory fence checks. + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + m4_ifdef([gl_FUNC_MEMCHR_OBSOLETE], [ + dnl These days, we assume memchr is present. But if support for old + dnl platforms is desired: + AC_CHECK_FUNCS_ONCE([memchr]) + if test $ac_cv_func_memchr = no; then + HAVE_MEMCHR=0 + fi + ]) + if test $HAVE_MEMCHR = 1; then + # Detect platform-specific bugs in some versions of glibc: + # memchr should not dereference anything with length 0 + # http://bugzilla.redhat.com/499689 + # memchr should not dereference overestimated length after a match + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 + # http://sourceware.org/bugzilla/show_bug.cgi?id=10162 + # Assume that memchr works on platforms that lack mprotect. + AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include +#if HAVE_SYS_MMAN_H +# include +# include +# include +# include +# ifndef MAP_FILE +# define MAP_FILE 0 +# endif +#endif +]], [[ + int result = 0; + char *fence = NULL; +#if HAVE_SYS_MMAN_H && HAVE_MPROTECT +# if HAVE_MAP_ANONYMOUS + const int flags = MAP_ANONYMOUS | MAP_PRIVATE; + const int fd = -1; +# else /* !HAVE_MAP_ANONYMOUS */ + const int flags = MAP_FILE | MAP_PRIVATE; + int fd = open ("/dev/zero", O_RDONLY, 0666); + if (fd >= 0) +# endif + { + int pagesize = getpagesize (); + char *two_pages = + (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, + flags, fd, 0); + if (two_pages != (char *)(-1) + && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) + fence = two_pages + pagesize; + } +#endif + if (fence) + { + if (memchr (fence, 0, 0)) + result |= 1; + strcpy (fence - 9, "12345678"); + if (memchr (fence - 9, 0, 79) != fence - 1) + result |= 2; + if (memchr (fence - 1, 0, 3) != fence - 1) + result |= 4; + } + return result; +]])], [gl_cv_func_memchr_works=yes], [gl_cv_func_memchr_works=no], + [dnl Be pessimistic for now. + gl_cv_func_memchr_works="guessing no"])]) + if test "$gl_cv_func_memchr_works" != yes; then + REPLACE_MEMCHR=1 + fi + fi +]) +m4trace:m4/memchr.m4:86: -1- AC_DEFUN([gl_PREREQ_MEMCHR], [ + AC_CHECK_HEADERS([bp-sym.h]) +]) +m4trace:m4/minmax.m4:9: -1- AC_DEFUN([gl_MINMAX], [ + AC_REQUIRE([gl_PREREQ_MINMAX]) +]) +m4trace:m4/minmax.m4:15: -1- AC_DEFUN([gl_PREREQ_MINMAX], [ + gl_MINMAX_IN_HEADER([limits.h]) + gl_MINMAX_IN_HEADER([sys/param.h]) +]) +m4trace:m4/minmax.m4:25: -1- AC_DEFUN([gl_MINMAX_IN_HEADER], [ + m4_pushdef([header], AS_TR_SH([$1])) + m4_pushdef([HEADER], AS_TR_CPP([$1])) + AC_CACHE_CHECK([whether <$1> defines MIN and MAX], + [gl_cv_minmax_in_]header, + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <$1> + int x = MIN (42, 17);]], + [[]])], + [gl_cv_minmax_in_]header[=yes], + [gl_cv_minmax_in_]header[=no])]) + if test $gl_cv_minmax_in_[]header = yes; then + AC_DEFINE([HAVE_MINMAX_IN_]HEADER, 1, + [Define to 1 if <$1> defines the MIN and MAX macros.]) + fi + m4_popdef([HEADER]) + m4_popdef([header]) +]) +m4trace:m4/mkstemp.m4:16: -1- AC_DEFUN([gl_FUNC_MKSTEMP], [ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + AC_CHECK_FUNCS_ONCE([mkstemp]) + if test $ac_cv_func_mkstemp = yes; then + AC_CACHE_CHECK([for working mkstemp], + [gl_cv_func_working_mkstemp], + [ + mkdir conftest.mkstemp + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [AC_INCLUDES_DEFAULT], + [[int result = 0; + int i; + off_t large = (off_t) 4294967295u; + if (large < 0) + large = 2147483647; + umask (0); + for (i = 0; i < 70; i++) + { + char templ[] = "conftest.mkstemp/coXXXXXX"; + int (*mkstemp_function) (char *) = mkstemp; + int fd = mkstemp_function (templ); + if (fd < 0) + result |= 1; + else + { + struct stat st; + if (lseek (fd, large, SEEK_SET) != large) + result |= 2; + if (fstat (fd, &st) < 0) + result |= 4; + else if (st.st_mode & 0077) + result |= 8; + if (close (fd)) + result |= 16; + } + } + return result;]])], + [gl_cv_func_working_mkstemp=yes], + [gl_cv_func_working_mkstemp=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_working_mkstemp="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_mkstemp="guessing no" ;; + esac + ]) + rm -rf conftest.mkstemp + ]) + case "$gl_cv_func_working_mkstemp" in + *yes) ;; + *) + REPLACE_MKSTEMP=1 + ;; + esac + else + HAVE_MKSTEMP=0 + fi +]) +m4trace:m4/mkstemp.m4:80: -1- AC_DEFUN([gl_PREREQ_MKSTEMP], [ +]) +m4trace:m4/mktime.m4:10: -1- AC_DEFUN([gl_TIME_T_IS_SIGNED], [ + AC_CACHE_CHECK([whether time_t is signed], + [gl_cv_time_t_is_signed], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include + char time_t_signed[(time_t) -1 < 0 ? 1 : -1];]])], + [gl_cv_time_t_is_signed=yes], + [gl_cv_time_t_is_signed=no])]) + if test $gl_cv_time_t_is_signed = yes; then + AC_DEFINE([TIME_T_IS_SIGNED], [1], [Define to 1 if time_t is signed.]) + fi +]) +m4trace:m4/mktime.m4:25: -1- AC_DEFUN([gl_FUNC_MKTIME_WORKS], [ + AC_REQUIRE([gl_TIME_T_IS_SIGNED]) + + dnl We don't use AC_FUNC_MKTIME any more, because it is no longer maintained + dnl in Autoconf and because it invokes AC_LIBOBJ. + AC_CHECK_HEADERS_ONCE([unistd.h]) + AC_CHECK_DECLS_ONCE([alarm]) + AC_CHECK_FUNCS_ONCE([tzset]) + AC_REQUIRE([gl_MULTIARCH]) + if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple Mac OS X platforms. + # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode. + # But we need a configuration result that is valid in both modes. + gl_cv_func_working_mktime=no + fi + AC_CACHE_CHECK([for working mktime], [gl_cv_func_working_mktime], + [AC_RUN_IFELSE( + [AC_LANG_SOURCE( +[[/* Test program from Paul Eggert and Tony Leneis. */ +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#if HAVE_DECL_ALARM +# include +#endif + +/* Work around redefinition to rpl_putenv by other config tests. */ +#undef putenv + +static time_t time_t_max; +static time_t time_t_min; + +/* Values we'll use to set the TZ environment variable. */ +static char *tz_strings[] = { + (char *) 0, "TZ=GMT0", "TZ=JST-9", + "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" +}; +#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) + +/* Return 0 if mktime fails to convert a date in the spring-forward gap. + Based on a problem report from Andreas Jaeger. */ +static int +spring_forward_gap () +{ + /* glibc (up to about 1998-10-07) failed this test. */ + struct tm tm; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + tm.tm_year = 98; + tm.tm_mon = 3; + tm.tm_mday = 5; + tm.tm_hour = 2; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + return mktime (&tm) != (time_t) -1; +} + +static int +mktime_test1 (time_t now) +{ + struct tm *lt; + return ! (lt = localtime (&now)) || mktime (lt) == now; +} + +static int +mktime_test (time_t now) +{ + return (mktime_test1 (now) + && mktime_test1 ((time_t) (time_t_max - now)) + && mktime_test1 ((time_t) (time_t_min + now))); +} + +static int +irix_6_4_bug () +{ + /* Based on code from Ariel Faigon. */ + struct tm tm; + tm.tm_year = 96; + tm.tm_mon = 3; + tm.tm_mday = 0; + tm.tm_hour = 0; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + mktime (&tm); + return tm.tm_mon == 2 && tm.tm_mday == 31; +} + +static int +bigtime_test (int j) +{ + struct tm tm; + time_t now; + tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; + now = mktime (&tm); + if (now != (time_t) -1) + { + struct tm *lt = localtime (&now); + if (! (lt + && lt->tm_year == tm.tm_year + && lt->tm_mon == tm.tm_mon + && lt->tm_mday == tm.tm_mday + && lt->tm_hour == tm.tm_hour + && lt->tm_min == tm.tm_min + && lt->tm_sec == tm.tm_sec + && lt->tm_yday == tm.tm_yday + && lt->tm_wday == tm.tm_wday + && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) + == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) + return 0; + } + return 1; +} + +static int +year_2050_test () +{ + /* The correct answer for 2050-02-01 00:00:00 in Pacific time, + ignoring leap seconds. */ + unsigned long int answer = 2527315200UL; + + struct tm tm; + time_t t; + tm.tm_year = 2050 - 1900; + tm.tm_mon = 2 - 1; + tm.tm_mday = 1; + tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + tm.tm_isdst = -1; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + t = mktime (&tm); + + /* Check that the result is either a failure, or close enough + to the correct answer that we can assume the discrepancy is + due to leap seconds. */ + return (t == (time_t) -1 + || (0 < t && answer - 120 <= t && t <= answer + 120)); +} + +int +main () +{ + int result = 0; + time_t t, delta; + int i, j; + int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1; + +#if HAVE_DECL_ALARM + /* This test makes some buggy mktime implementations loop. + Give up after 60 seconds; a mktime slower than that + isn't worth using anyway. */ + signal (SIGALRM, SIG_DFL); + alarm (60); +#endif + + time_t_max = (! TIME_T_IS_SIGNED + ? (time_t) -1 + : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1) + * 2 + 1)); + time_t_min = (! TIME_T_IS_SIGNED + ? (time_t) 0 + : time_t_signed_magnitude + ? ~ (time_t) 0 + : ~ time_t_max); + + delta = time_t_max / 997; /* a suitable prime number */ + for (i = 0; i < N_STRINGS; i++) + { + if (tz_strings[i]) + putenv (tz_strings[i]); + + for (t = 0; t <= time_t_max - delta && (result & 1) == 0; t += delta) + if (! mktime_test (t)) + result |= 1; + if ((result & 2) == 0 + && ! (mktime_test ((time_t) 1) + && mktime_test ((time_t) (60 * 60)) + && mktime_test ((time_t) (60 * 60 * 24)))) + result |= 2; + + for (j = 1; (result & 4) == 0; j <<= 1) + { + if (! bigtime_test (j)) + result |= 4; + if (INT_MAX / 2 < j) + break; + } + if ((result & 8) == 0 && ! bigtime_test (INT_MAX)) + result |= 8; + } + if (! irix_6_4_bug ()) + result |= 16; + if (! spring_forward_gap ()) + result |= 32; + if (! year_2050_test ()) + result |= 64; + return result; +}]])], + [gl_cv_func_working_mktime=yes], + [gl_cv_func_working_mktime=no], + [gl_cv_func_working_mktime="guessing no"]) + ]) +]) +m4trace:m4/mktime.m4:247: -1- AC_DEFUN([gl_FUNC_MKTIME], [ + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_FUNC_MKTIME_WORKS]) + + REPLACE_MKTIME=0 + if test "$gl_cv_func_working_mktime" != yes; then + REPLACE_MKTIME=1 + AC_DEFINE([NEED_MKTIME_WORKING], [1], + [Define if the compilation of mktime.c should define 'mktime' + with the algorithmic workarounds.]) + fi + case "$host_os" in + mingw*) + REPLACE_MKTIME=1 + AC_DEFINE([NEED_MKTIME_WINDOWS], [1], + [Define if the compilation of mktime.c should define 'mktime' + with the native Windows TZ workaround.]) + ;; + esac +]) +m4trace:m4/mktime.m4:271: -1- AC_DEFUN([gl_FUNC_MKTIME_INTERNAL], [ + AC_REQUIRE([gl_FUNC_MKTIME_WORKS]) + + WANT_MKTIME_INTERNAL=0 + dnl BeOS has __mktime_internal in libc, but other platforms don't. + AC_CHECK_FUNC([__mktime_internal], + [AC_DEFINE([mktime_internal], [__mktime_internal], + [Define to the real name of the mktime_internal function.]) + ], + [dnl mktime works but it doesn't export __mktime_internal, + dnl so we need to substitute our own mktime implementation. + WANT_MKTIME_INTERNAL=1 + AC_DEFINE([NEED_MKTIME_INTERNAL], [1], + [Define if the compilation of mktime.c should define 'mktime_internal'.]) + ]) +]) +m4trace:m4/mktime.m4:289: -1- AC_DEFUN([gl_PREREQ_MKTIME], [:]) +m4trace:m4/mmap-anon.m4:16: -1- AC_DEFUN([gl_FUNC_MMAP_ANON], [ + dnl Persuade glibc to define MAP_ANONYMOUS. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + AC_CHECK_FUNC([mmap], [gl_have_mmap=yes], [gl_have_mmap=no]) + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + AC_MSG_CHECKING([for MAP_ANONYMOUS]) + AC_EGREP_CPP([I cannot identify this map], [ +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif +], + [gl_have_mmap_anonymous=yes]) + if test $gl_have_mmap_anonymous != yes; then + AC_EGREP_CPP([I cannot identify this map], [ +#include +#ifdef MAP_ANON + I cannot identify this map +#endif +], + [AC_DEFINE([MAP_ANONYMOUS], [MAP_ANON], + [Define to a substitute value for mmap()'s MAP_ANONYMOUS flag.]) + gl_have_mmap_anonymous=yes]) + fi + AC_MSG_RESULT([$gl_have_mmap_anonymous]) + if test $gl_have_mmap_anonymous = yes; then + AC_DEFINE([HAVE_MAP_ANONYMOUS], [1], + [Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including + config.h and .]) + fi + fi +]) +m4trace:m4/mode_t.m4:12: -1- AC_DEFUN([gl_PROMOTED_TYPE_MODE_T], [ + AC_REQUIRE([AC_TYPE_MODE_T]) + AC_CACHE_CHECK([for promoted mode_t type], [gl_cv_promoted_mode_t], [ + dnl Assume mode_t promotes to 'int' if and only if it is smaller than 'int', + dnl and to itself otherwise. This assumption is not guaranteed by the ISO C + dnl standard, but we don't know of any real-world counterexamples. + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];]])], + [gl_cv_promoted_mode_t='int'], + [gl_cv_promoted_mode_t='mode_t']) + ]) + AC_DEFINE_UNQUOTED([PROMOTED_MODE_T], [$gl_cv_promoted_mode_t], + [Define to the type that is the result of default argument promotions of type mode_t.]) +]) +m4trace:m4/msvc-inval.m4:7: -1- AC_DEFUN([gl_MSVC_INVAL], [ + AC_CHECK_FUNCS_ONCE([_set_invalid_parameter_handler]) + if test $ac_cv_func__set_invalid_parameter_handler = yes; then + HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 + AC_DEFINE([HAVE_MSVC_INVALID_PARAMETER_HANDLER], [1], + [Define to 1 on MSVC platforms that have the "invalid parameter handler" + concept.]) + else + HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 + fi + AC_SUBST([HAVE_MSVC_INVALID_PARAMETER_HANDLER]) +]) +m4trace:m4/msvc-nothrow.m4:7: -1- AC_DEFUN([gl_MSVC_NOTHROW], [ + AC_REQUIRE([gl_MSVC_INVAL]) +]) +m4trace:m4/multiarch.m4:21: -1- AC_DEFUN_ONCE([gl_MULTIARCH], [ + dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN. + gl_cv_c_multiarch=no + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + ]])], + [ + dnl Check for potential -arch flags. It is not universal unless + dnl there are at least two -arch flags with different values. + arch= + prev= + for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do + if test -n "$prev"; then + case $word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$arch" || test "$arch" = "$word"; then + arch="$word" + else + gl_cv_c_multiarch=yes + fi + ;; + esac + prev= + else + if test "x$word" = "x-arch"; then + prev=arch + fi + fi + done + ]) + if test $gl_cv_c_multiarch = yes; then + APPLE_UNIVERSAL_BUILD=1 + else + APPLE_UNIVERSAL_BUILD=0 + fi + AC_SUBST([APPLE_UNIVERSAL_BUILD]) +]) +m4trace:m4/nanosleep.m4:14: -1- AC_DEFUN([gl_FUNC_NANOSLEEP], [ + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + dnl Persuade glibc and Solaris to declare nanosleep. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_CHECK_HEADERS_ONCE([sys/time.h]) + AC_REQUIRE([gl_FUNC_SELECT]) + + nanosleep_save_libs=$LIBS + + # Solaris 2.5.1 needs -lposix4 to get the nanosleep function. + # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. + LIB_NANOSLEEP= + AC_SUBST([LIB_NANOSLEEP]) + AC_SEARCH_LIBS([nanosleep], [rt posix4], + [test "$ac_cv_search_nanosleep" = "none required" || + LIB_NANOSLEEP=$ac_cv_search_nanosleep]) + if test "x$ac_cv_search_nanosleep" != xno; then + dnl The system has a nanosleep function. + + AC_REQUIRE([gl_MULTIARCH]) + if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple Mac OS X platforms. + # The test result would be 'no (mishandles large arguments)' in 64-bit + # mode but 'yes' in 32-bit mode. But we need a configuration result that + # is valid in both modes. + gl_cv_func_nanosleep='no (mishandles large arguments)' + fi + + AC_CACHE_CHECK([for working nanosleep], + [gl_cv_func_nanosleep], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ + #include + #include + #include + #if HAVE_SYS_TIME_H + #include + #endif + #include + #include + #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) + #define TYPE_MAXIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) + + static void + check_for_SIGALRM (int sig) + { + if (sig != SIGALRM) + _exit (1); + } + + int + main () + { + static struct timespec ts_sleep; + static struct timespec ts_remaining; + static struct sigaction act; + /* Test for major problems first. */ + if (! nanosleep) + return 2; + act.sa_handler = check_for_SIGALRM; + sigemptyset (&act.sa_mask); + sigaction (SIGALRM, &act, NULL); + ts_sleep.tv_sec = 0; + ts_sleep.tv_nsec = 1; + alarm (1); + if (nanosleep (&ts_sleep, NULL) != 0) + return 3; + /* Test for a minor problem: the handling of large arguments. */ + ts_sleep.tv_sec = TYPE_MAXIMUM (time_t); + ts_sleep.tv_nsec = 999999999; + alarm (1); + if (nanosleep (&ts_sleep, &ts_remaining) != -1) + return 4; + if (errno != EINTR) + return 5; + if (ts_remaining.tv_sec <= TYPE_MAXIMUM (time_t) - 10) + return 6; + return 0; + }]])], + [gl_cv_func_nanosleep=yes], + [case $? in dnl ( + 4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)';; dnl ( + *) gl_cv_func_nanosleep=no;; + esac], + [case "$host_os" in dnl (( + linux*) # Guess it halfway works when the kernel is Linux. + gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;; + *) # If we don't know, assume the worst. + gl_cv_func_nanosleep='guessing no' ;; + esac + ]) + ]) + case "$gl_cv_func_nanosleep" in + *yes) + REPLACE_NANOSLEEP=0 + ;; + *) + REPLACE_NANOSLEEP=1 + case "$gl_cv_func_nanosleep" in + *"mishandles large arguments"*) + AC_DEFINE([HAVE_BUG_BIG_NANOSLEEP], [1], + [Define to 1 if nanosleep mishandles large arguments.]) + ;; + *) + # The replacement uses select(). Add $LIBSOCKET to $LIB_NANOSLEEP. + for ac_lib in $LIBSOCKET; do + case " $LIB_NANOSLEEP " in + *" $ac_lib "*) ;; + *) LIB_NANOSLEEP="$LIB_NANOSLEEP $ac_lib";; + esac + done + ;; + esac + ;; + esac + else + HAVE_NANOSLEEP=0 + fi + LIBS=$nanosleep_save_libs +]) +m4trace:m4/nanosleep.m4:144: -1- AC_DEFUN([gl_PREREQ_NANOSLEEP], [ + AC_CHECK_HEADERS_ONCE([sys/select.h]) + gl_PREREQ_SIG_HANDLER_H +]) +m4trace:m4/netinet_in_h.m4:7: -1- AC_DEFUN([gl_HEADER_NETINET_IN], [ + AC_CACHE_CHECK([whether is self-contained], + [gl_cv_header_netinet_in_h_selfcontained], + [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[]])], + [gl_cv_header_netinet_in_h_selfcontained=yes], + [gl_cv_header_netinet_in_h_selfcontained=no]) + ]) + if test $gl_cv_header_netinet_in_h_selfcontained = yes; then + NETINET_IN_H='' + else + NETINET_IN_H='netinet/in.h' + AC_CHECK_HEADERS([netinet/in.h]) + gl_CHECK_NEXT_HEADERS([netinet/in.h]) + if test $ac_cv_header_netinet_in_h = yes; then + HAVE_NETINET_IN_H=1 + else + HAVE_NETINET_IN_H=0 + fi + AC_SUBST([HAVE_NETINET_IN_H]) + fi + AC_SUBST([NETINET_IN_H]) + AM_CONDITIONAL([GL_GENERATE_NETINET_IN_H], [test -n "$NETINET_IN_H"]) +]) +m4trace:m4/nl_langinfo.m4:7: -1- AC_DEFUN([gl_FUNC_NL_LANGINFO], [ + AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) + AC_REQUIRE([gl_LANGINFO_H]) + AC_CHECK_FUNCS_ONCE([nl_langinfo]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + if test $ac_cv_func_nl_langinfo = yes; then + # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken. + AC_CACHE_CHECK([whether YESEXPR works], + [gl_cv_func_nl_langinfo_yesexpr_works], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM([[#include +]], [[return !*nl_langinfo(YESEXPR); +]])], + [gl_cv_func_nl_langinfo_yesexpr_works=yes], + [gl_cv_func_nl_langinfo_yesexpr_works=no], + [ + case "$host_os" in + # Guess no on irix systems. + irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";; + # Guess yes elsewhere. + *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";; + esac + ]) + ]) + case $gl_cv_func_nl_langinfo_yesexpr_works in + *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;; + *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;; + esac + AC_DEFINE_UNQUOTED([FUNC_NL_LANGINFO_YESEXPR_WORKS], + [$FUNC_NL_LANGINFO_YESEXPR_WORKS], + [Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string.]) + if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \ + && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then + : + else + REPLACE_NL_LANGINFO=1 + AC_DEFINE([REPLACE_NL_LANGINFO], [1], + [Define if nl_langinfo exists but is overridden by gnulib.]) + fi + else + HAVE_NL_LANGINFO=0 + fi +]) +m4trace:m4/nls.m4:23: -1- AC_DEFUN([AM_NLS], [ + AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE([nls], + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT([$USE_NLS]) + AC_SUBST([USE_NLS]) +]) +m4trace:m4/nocrash.m4:18: -1- AC_DEFUN([GL_NOCRASH], [[ +#include +#if defined __MACH__ && defined __APPLE__ +/* Avoid a crash on Mac OS X. */ +#include +#include +#include +#include +#include +#include +/* The exception port on which our thread listens. */ +static mach_port_t our_exception_port; +/* The main function of the thread listening for exceptions of type + EXC_BAD_ACCESS. */ +static void * +mach_exception_thread (void *arg) +{ + /* Buffer for a message to be received. */ + struct { + mach_msg_header_t head; + mach_msg_body_t msgh_body; + char data[1024]; + } msg; + mach_msg_return_t retval; + /* Wait for a message on the exception port. */ + retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), + our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + if (retval != MACH_MSG_SUCCESS) + abort (); + exit (1); +} +static void +nocrash_init (void) +{ + mach_port_t self = mach_task_self (); + /* Allocate a port on which the thread shall listen for exceptions. */ + if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) + == KERN_SUCCESS) { + /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ + if (mach_port_insert_right (self, our_exception_port, our_exception_port, + MACH_MSG_TYPE_MAKE_SEND) + == KERN_SUCCESS) { + /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting + for us. */ + exception_mask_t mask = EXC_MASK_BAD_ACCESS; + /* Create the thread listening on the exception port. */ + pthread_attr_t attr; + pthread_t thread; + if (pthread_attr_init (&attr) == 0 + && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 + && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { + pthread_attr_destroy (&attr); + /* Replace the exception port info for these exceptions with our own. + Note that we replace the exception port for the entire task, not only + for a particular thread. This has the effect that when our exception + port gets the message, the thread specific exception port has already + been asked, and we don't need to bother about it. + See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ + task_set_exception_ports (self, mask, our_exception_port, + EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); + } + } + } +} +#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Avoid a crash on native Windows. */ +#define WIN32_LEAN_AND_MEAN +#include +#include +static LONG WINAPI +exception_filter (EXCEPTION_POINTERS *ExceptionInfo) +{ + switch (ExceptionInfo->ExceptionRecord->ExceptionCode) + { + case EXCEPTION_ACCESS_VIOLATION: + case EXCEPTION_IN_PAGE_ERROR: + case EXCEPTION_STACK_OVERFLOW: + case EXCEPTION_GUARD_PAGE: + case EXCEPTION_PRIV_INSTRUCTION: + case EXCEPTION_ILLEGAL_INSTRUCTION: + case EXCEPTION_DATATYPE_MISALIGNMENT: + case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: + case EXCEPTION_NONCONTINUABLE_EXCEPTION: + exit (1); + } + return EXCEPTION_CONTINUE_SEARCH; +} +static void +nocrash_init (void) +{ + SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter); +} +#else +/* Avoid a crash on POSIX systems. */ +#include +#include +/* A POSIX signal handler. */ +static void +exception_handler (int sig) +{ + _exit (1); +} +static void +nocrash_init (void) +{ +#ifdef SIGSEGV + signal (SIGSEGV, exception_handler); +#endif +#ifdef SIGBUS + signal (SIGBUS, exception_handler); +#endif +} +#endif +]]) +m4trace:m4/off_t.m4:10: -1- AC_DEFUN([gl_TYPE_OFF_T], [ + m4_ifdef([gl_LARGEFILE], [ + AC_REQUIRE([gl_LARGEFILE]) + ], [ + WINDOWS_64_BIT_OFF_T=0 + ]) + AC_SUBST([WINDOWS_64_BIT_OFF_T]) +]) +m4trace:m4/open.m4:7: -1- AC_DEFUN([gl_FUNC_OPEN], [ + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw* | pw*) + REPLACE_OPEN=1 + ;; + *) + dnl open("foo/") should not create a file when the file name has a + dnl trailing slash. FreeBSD only has the problem on symlinks. + AC_CHECK_FUNCS_ONCE([lstat]) + AC_CACHE_CHECK([whether open recognizes a trailing slash], + [gl_cv_func_open_slash], + [# Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + touch conftest.tmp + ln -s conftest.tmp conftest.lnk + fi + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#if HAVE_UNISTD_H +# include +#endif +int main () +{ + int result = 0; +#if HAVE_LSTAT + if (open ("conftest.lnk/", O_RDONLY) != -1) + result |= 1; +#endif + if (open ("conftest.sl/", O_CREAT, 0600) >= 0) + result |= 2; + return result; +}]])], + [gl_cv_func_open_slash=yes], + [gl_cv_func_open_slash=no], + [ +changequote(,)dnl + case "$host_os" in + freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*) + gl_cv_func_open_slash="guessing no" ;; + *) + gl_cv_func_open_slash="guessing yes" ;; + esac +changequote([,])dnl + ]) + rm -f conftest.sl conftest.tmp conftest.lnk + ]) + case "$gl_cv_func_open_slash" in + *no) + AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1], + [Define to 1 if open() fails to recognize a trailing slash.]) + REPLACE_OPEN=1 + ;; + esac + ;; + esac + dnl Replace open() for supporting the gnulib-defined fchdir() function, + dnl to keep fchdir's bookkeeping up-to-date. + m4_ifdef([gl_FUNC_FCHDIR], [ + if test $REPLACE_OPEN = 0; then + gl_TEST_FCHDIR + if test $HAVE_FCHDIR = 0; then + REPLACE_OPEN=1 + fi + fi + ]) + dnl Replace open() for supporting the gnulib-defined O_NONBLOCK flag. + m4_ifdef([gl_NONBLOCKING_IO], [ + if test $REPLACE_OPEN = 0; then + gl_NONBLOCKING_IO + if test $gl_cv_have_open_O_NONBLOCK != yes; then + REPLACE_OPEN=1 + fi + fi + ]) +]) +m4trace:m4/open.m4:87: -1- AC_DEFUN([gl_PREREQ_OPEN], [ + AC_REQUIRE([gl_PROMOTED_TYPE_MODE_T]) + : +]) +m4trace:m4/pathmax.m4:8: -1- AC_DEFUN([gl_PATHMAX], [ + dnl Prerequisites of lib/pathmax.h. + AC_CHECK_HEADERS_ONCE([sys/param.h]) +]) +m4trace:m4/pathmax.m4:16: -1- AC_DEFUN([gl_PATHMAX_SNIPPET], [[ +/* Arrange to define PATH_MAX, like "pathmax.h" does. */ +#if HAVE_UNISTD_H +# include +#endif +#include +#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN +# include +#endif +#if !defined PATH_MAX && defined MAXPATHLEN +# define PATH_MAX MAXPATHLEN +#endif +#ifdef __hpux +# undef PATH_MAX +# define PATH_MAX 1024 +#endif +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# undef PATH_MAX +# define PATH_MAX 260 +#endif +]]) +m4trace:m4/pathmax.m4:39: -1- AC_DEFUN([gl_PATHMAX_SNIPPET_PREREQ], [ + AC_CHECK_HEADERS_ONCE([unistd.h sys/param.h]) +]) +m4trace:m4/perror.m4:7: -1- AC_DEFUN([gl_FUNC_PERROR], [ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_REQUIRE([gl_HEADER_ERRNO_H]) + AC_REQUIRE([gl_FUNC_STRERROR_R]) + AC_REQUIRE([gl_FUNC_STRERROR_0]) + dnl We intentionally do not check for the broader REPLACE_STRERROR_R, + dnl since on glibc systems, strerror_r is replaced only for signature + dnl issues, and perror is just fine. Rather, we only want to + dnl replace perror if strerror_r was replaced for a content fix. + if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then + dnl The system's perror() cannot know about the new errno values we add + dnl to , or any fix for strerror(0). Replace it. + REPLACE_PERROR=1 + fi + case ${gl_cv_func_strerror_r_works-unset} in + unset|*yes) + AC_CACHE_CHECK([whether perror matches strerror], + [gl_cv_func_perror_works], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #include + #include + ]], + [[char *str = strerror (-1); + if (!getenv("CONFTEST_OUTPUT")) return 0; + if (!str) str = ""; + puts (str); + errno = -1; + perror (""); + return 0; + ]])], + [if CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2 \ + && cmp conftest.txt1 conftest.txt2 >/dev/null; then + gl_cv_func_perror_works=yes + else + gl_cv_func_perror_works=no + fi + rm -rf conftest.txt1 conftest.txt2], + [gl_cv_func_perror_works=no], + [dnl Guess no when cross-compiling. + gl_cv_func_perror_works="guessing no" + ]) + ]) + if test "$gl_cv_func_perror_works" != yes; then + REPLACE_PERROR=1 + fi + ;; + *) + dnl The system's perror() probably inherits the bugs in the + dnl system's strerror_r(). Replace it. + REPLACE_PERROR=1 + ;; + esac +]) +m4trace:m4/pipe.m4:7: -1- AC_DEFUN([gl_FUNC_PIPE], [ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + + AC_CHECK_FUNCS_ONCE([pipe]) + if test $ac_cv_func_pipe != yes; then + HAVE_PIPE=0 + fi +]) +m4trace:m4/po.m4:23: -1- AC_DEFUN([AM_PO_SUBDIRS], [ + AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl + AC_REQUIRE([AC_PROG_MKDIR_P])dnl + AC_REQUIRE([AC_PROG_SED])dnl + AC_REQUIRE([AM_NLS])dnl + + dnl Release version of the gettext macros. This is used to ensure that + dnl the gettext macros and po/Makefile.in.in are in sync. + AC_SUBST([GETTEXT_MACRO_VERSION], [0.19]) + + dnl Perform the following tests also if --disable-nls has been given, + dnl because they are needed for "make dist" to work. + + dnl Search for GNU msgfmt in the PATH. + dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. + dnl The second test excludes FreeBSD msgfmt. + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) + + dnl Test whether it is GNU msgfmt >= 0.15. +changequote(,)dnl + case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; + *) MSGFMT_015=$MSGFMT ;; + esac +changequote([,])dnl + AC_SUBST([MSGFMT_015]) +changequote(,)dnl + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac +changequote([,])dnl + AC_SUBST([GMSGFMT_015]) + + dnl Search for GNU xgettext 0.12 or newer in the PATH. + dnl The first test excludes Solaris xgettext and early GNU xgettext versions. + dnl The second test excludes FreeBSD xgettext. + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + dnl Remove leftover from FreeBSD xgettext call. + rm -f messages.po + + dnl Test whether it is GNU xgettext >= 0.15. +changequote(,)dnl + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac +changequote([,])dnl + AC_SUBST([XGETTEXT_015]) + + dnl Search for GNU msgmerge 0.11 or newer in the PATH. + AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, + [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) + + dnl Installation directories. + dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we + dnl have to define it here, so that it can be used in po/Makefile. + test -n "$localedir" || localedir='${datadir}/locale' + AC_SUBST([localedir]) + + dnl Support for AM_XGETTEXT_OPTION. + test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) + + AC_CONFIG_COMMANDS([po-directories], [[ + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + # Treat a directory as a PO directory if and only if it has a + # POTFILES.in file. This allows packages to have multiple PO + # directories under different names or in different locations. + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done]], + [# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it + # from automake < 1.5. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + ]) +]) +m4trace:m4/po.m4:220: -1- AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ + # When this code is run, in config.status, two variables have already been + # set: + # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, + # - LINGUAS is the value of the environment variable LINGUAS at configure + # time. + +changequote(,)dnl + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + # Find a way to echo strings without interpreting backslash. + if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then + gt_echo='echo' + else + if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then + gt_echo='printf %s\n' + else + echo_func () { + cat < "$ac_file.tmp" + tab=`printf '\t'` + if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then + # Add dependencies that cannot be formulated as a simple suffix rule. + for lang in $ALL_LINGUAS; do + frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` + cat >> "$ac_file.tmp" < /dev/null; then + # Add dependencies that cannot be formulated as a simple suffix rule. + for lang in $ALL_LINGUAS; do + frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` + cat >> "$ac_file.tmp" <> "$ac_file.tmp" < +#include +#include +#include +#if HAVE_STDINT_H_WITH_UINTMAX +# include +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +# include +#endif +static char buf[100]; +int main () +{ + int result = 0; +#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX + buf[0] = '\0'; + if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0 + || strcmp (buf, "12345671 33") != 0) + result |= 1; +#else + result |= 1; +#endif + buf[0] = '\0'; + if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0 + || strcmp (buf, "12345672 33") != 0) + result |= 2; + buf[0] = '\0'; + if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0 + || strcmp (buf, "12345673 33") != 0) + result |= 4; + buf[0] = '\0'; + if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0 + || strcmp (buf, "1.5 33") != 0) + result |= 8; + return result; +}]])], + [gl_cv_func_printf_sizes_c99=yes], + [gl_cv_func_printf_sizes_c99=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_printf_sizes_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";; + darwin*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_printf_sizes_c99="guessing no";; + openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_sizes_c99="guessing no";; + netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_sizes_c99="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) +m4trace:m4/printf.m4:94: -1- AC_DEFUN([gl_PRINTF_LONG_DOUBLE], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports 'long double' arguments], + [gl_cv_func_printf_long_double], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +static char buf[10000]; +int main () +{ + int result = 0; + buf[0] = '\0'; + if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.750000 33") != 0) + result |= 1; + buf[0] = '\0'; + if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.750000e+00 33") != 0) + result |= 2; + buf[0] = '\0'; + if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.75 33") != 0) + result |= 4; + return result; +}]])], + [gl_cv_func_printf_long_double=yes], + [gl_cv_func_printf_long_double=no], + [ +changequote(,)dnl + case "$host_os" in + beos*) gl_cv_func_printf_long_double="guessing no";; + mingw* | pw*) gl_cv_func_printf_long_double="guessing no";; + *) gl_cv_func_printf_long_double="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) +m4trace:m4/printf.m4:142: -1- AC_DEFUN([gl_PRINTF_INFINITE], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports infinite 'double' arguments], + [gl_cv_func_printf_infinite], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +static int +strisnan (const char *string, size_t start_index, size_t end_index) +{ + if (start_index < end_index) + { + if (string[start_index] == '-') + start_index++; + if (start_index + 3 <= end_index + && memcmp (string + start_index, "nan", 3) == 0) + { + start_index += 3; + if (start_index == end_index + || (string[start_index] == '(' && string[end_index - 1] == ')')) + return 1; + } + } + return 0; +} +static int +have_minus_zero () +{ + static double plus_zero = 0.0; + double minus_zero = - plus_zero; + return memcmp (&plus_zero, &minus_zero, sizeof (double)) != 0; +} +static char buf[10000]; +static double zero = 0.0; +int main () +{ + int result = 0; + if (sprintf (buf, "%f", 1.0 / zero) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 1; + if (sprintf (buf, "%f", -1.0 / zero) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 1; + if (sprintf (buf, "%f", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%e", 1.0 / zero) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 4; + if (sprintf (buf, "%e", -1.0 / zero) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 4; + if (sprintf (buf, "%e", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 8; + if (sprintf (buf, "%g", 1.0 / zero) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 16; + if (sprintf (buf, "%g", -1.0 / zero) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 16; + if (sprintf (buf, "%g", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 32; + /* This test fails on HP-UX 10.20. */ + if (have_minus_zero ()) + if (sprintf (buf, "%g", - zero) < 0 + || strcmp (buf, "-0") != 0) + result |= 64; + return result; +}]])], + [gl_cv_func_printf_infinite=yes], + [gl_cv_func_printf_infinite=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5].*) gl_cv_func_printf_infinite="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";; + darwin*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";; + hpux*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_infinite="guessing no";; + netbsd*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_infinite="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_infinite="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) +m4trace:m4/printf.m4:251: -1- AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE], [ + AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gl_BIGENDIAN]) + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + dnl The user can set or unset the variable gl_printf_safe to indicate + dnl that he wishes a safe handling of non-IEEE-754 'long double' values. + if test -n "$gl_printf_safe"; then + AC_DEFINE([CHECK_PRINTF_SAFE], [1], + [Define if you wish *printf() functions that have a safe handling of + non-IEEE-754 'long double' values.]) + fi + case "$gl_cv_func_printf_long_double" in + *yes) + AC_CACHE_CHECK([whether printf supports infinite 'long double' arguments], + [gl_cv_func_printf_infinite_long_double], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +]GL_NOCRASH[ +#include +#include +#include +static int +strisnan (const char *string, size_t start_index, size_t end_index) +{ + if (start_index < end_index) + { + if (string[start_index] == '-') + start_index++; + if (start_index + 3 <= end_index + && memcmp (string + start_index, "nan", 3) == 0) + { + start_index += 3; + if (start_index == end_index + || (string[start_index] == '(' && string[end_index - 1] == ')')) + return 1; + } + } + return 0; +} +static char buf[10000]; +static long double zeroL = 0.0L; +int main () +{ + int result = 0; + nocrash_init(); + if (sprintf (buf, "%Lf", 1.0L / zeroL) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Lf", -1.0L / zeroL) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Lf", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 1; + if (sprintf (buf, "%Le", 1.0L / zeroL) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Le", -1.0L / zeroL) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Le", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 1; + if (sprintf (buf, "%Lg", 1.0L / zeroL) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Lg", -1.0L / zeroL) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Lg", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 1; +#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE +/* Representation of an 80-bit 'long double' as an initializer for a sequence + of 'unsigned int' words. */ +# ifdef WORDS_BIGENDIAN +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ + (unsigned int) (mantlo) << 16 \ + } +# else +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { mantlo, manthi, exponent } +# endif + { /* Quiet NaN. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + } + { + /* Signalling NaN. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + } + { /* Pseudo-NaN. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 4; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 4; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 4; + } + { /* Pseudo-Infinity. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 8; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 8; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 8; + } + { /* Pseudo-Zero. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 16; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 16; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 16; + } + { /* Unnormalized number. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 32; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 32; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 32; + } + { /* Pseudo-Denormal. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 64; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 64; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 64; + } +#endif + return result; +}]])], + [gl_cv_func_printf_infinite_long_double=yes], + [gl_cv_func_printf_infinite_long_double=no], + [ +changequote(,)dnl + case "$host_cpu" in + # Guess no on ia64, x86_64, i386. + ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";; + *) + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";; + hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_infinite_long_double="guessing no";; + esac + ;; + esac +changequote([,])dnl + ]) + ]) + ;; + *) + gl_cv_func_printf_infinite_long_double="irrelevant" + ;; + esac +]) +m4trace:m4/printf.m4:457: -1- AC_DEFUN([gl_PRINTF_DIRECTIVE_A], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives], + [gl_cv_func_printf_directive_a], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +static char buf[100]; +static double zero = 0.0; +int main () +{ + int result = 0; + if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0 + || (strcmp (buf, "0x1.922p+1 33") != 0 + && strcmp (buf, "0x3.244p+0 33") != 0 + && strcmp (buf, "0x6.488p-1 33") != 0 + && strcmp (buf, "0xc.91p-2 33") != 0)) + result |= 1; + if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0 + || (strcmp (buf, "-0X1.922P+1 33") != 0 + && strcmp (buf, "-0X3.244P+0 33") != 0 + && strcmp (buf, "-0X6.488P-1 33") != 0 + && strcmp (buf, "-0XC.91P-2 33") != 0)) + result |= 2; + /* This catches a FreeBSD 6.1 bug: it doesn't round. */ + if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0 + || (strcmp (buf, "0x1.83p+0 33") != 0 + && strcmp (buf, "0x3.05p-1 33") != 0 + && strcmp (buf, "0x6.0ap-2 33") != 0 + && strcmp (buf, "0xc.14p-3 33") != 0)) + result |= 4; + /* This catches a Mac OS X 10.12.4 (Darwin 16.5) bug: it doesn't round. */ + if (sprintf (buf, "%.0a %d", 1.51, 33, 44, 55) < 0 + || (strcmp (buf, "0x2p+0 33") != 0 + && strcmp (buf, "0x3p-1 33") != 0 + && strcmp (buf, "0x6p-2 33") != 0 + && strcmp (buf, "0xcp-3 33") != 0)) + result |= 4; + /* This catches a FreeBSD 6.1 bug. See + */ + if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0 + || buf[0] == '0') + result |= 8; + /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug. */ + if (sprintf (buf, "%.1a", 1.999) < 0 + || (strcmp (buf, "0x1.0p+1") != 0 + && strcmp (buf, "0x2.0p+0") != 0 + && strcmp (buf, "0x4.0p-1") != 0 + && strcmp (buf, "0x8.0p-2") != 0)) + result |= 16; + /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a + glibc 2.4 bug . */ + if (sprintf (buf, "%.1La", 1.999L) < 0 + || (strcmp (buf, "0x1.0p+1") != 0 + && strcmp (buf, "0x2.0p+0") != 0 + && strcmp (buf, "0x4.0p-1") != 0 + && strcmp (buf, "0x8.0p-2") != 0)) + result |= 32; + return result; +}]])], + [gl_cv_func_printf_directive_a=yes], + [gl_cv_func_printf_directive_a=no], + [ + case "$host_os" in + # Guess yes on glibc >= 2.5 systems. + *-gnu*) + AC_EGREP_CPP([BZ2908], [ + #include + #ifdef __GNU_LIBRARY__ + #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)) && !defined __UCLIBC__ + BZ2908 + #endif + #endif + ], + [gl_cv_func_printf_directive_a="guessing yes"], + [gl_cv_func_printf_directive_a="guessing no"]) + ;; + # If we don't know, assume the worst. + *) gl_cv_func_printf_directive_a="guessing no";; + esac + ]) + ]) +]) +m4trace:m4/printf.m4:549: -1- AC_DEFUN([gl_PRINTF_DIRECTIVE_F], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the 'F' directive], + [gl_cv_func_printf_directive_f], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +static char buf[100]; +static double zero = 0.0; +int main () +{ + int result = 0; + if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0 + || strcmp (buf, "1234567.000000 33") != 0) + result |= 1; + if (sprintf (buf, "%F", 1.0 / zero) < 0 + || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0)) + result |= 2; + /* This catches a Cygwin 1.5.x bug. */ + if (sprintf (buf, "%.F", 1234.0) < 0 + || strcmp (buf, "1234") != 0) + result |= 4; + return result; +}]])], + [gl_cv_func_printf_directive_f=yes], + [gl_cv_func_printf_directive_f=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";; + darwin*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_directive_f="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) +m4trace:m4/printf.m4:605: -1- AC_DEFUN([gl_PRINTF_DIRECTIVE_N], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the 'n' directive], + [gl_cv_func_printf_directive_n], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include +#ifdef _MSC_VER +/* See page about "Parameter Validation" on msdn.microsoft.com. */ +static void cdecl +invalid_parameter_handler (const wchar_t *expression, + const wchar_t *function, + const wchar_t *file, unsigned int line, + uintptr_t dummy) +{ + exit (1); +} +#endif +static char fmtstring[10]; +static char buf[100]; +int main () +{ + int count = -1; +#ifdef _MSC_VER + _set_invalid_parameter_handler (invalid_parameter_handler); +#endif + /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) + support %n in format strings in read-only memory but not in writable + memory. */ + strcpy (fmtstring, "%d %n"); + if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0 + || strcmp (buf, "123 ") != 0 + || count != 4) + return 1; + return 0; +}]])], + [gl_cv_func_printf_directive_n=yes], + [gl_cv_func_printf_directive_n=no], + [ +changequote(,)dnl + case "$host_os" in + mingw*) gl_cv_func_printf_directive_n="guessing no";; + *) gl_cv_func_printf_directive_n="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) +m4trace:m4/printf.m4:666: -1- AC_DEFUN([gl_PRINTF_DIRECTIVE_LS], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the 'ls' directive], + [gl_cv_func_printf_directive_ls], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +#include +int main () +{ + int result = 0; + char buf[100]; + /* Test whether %ls works at all. + This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on + Cygwin 1.5. */ + { + static const wchar_t wstring[] = { 'a', 'b', 'c', 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%ls", wstring) < 0 + || strcmp (buf, "abc") != 0) + result |= 1; + } + /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an + assertion failure inside libc), but not on OpenBSD 4.0. */ + { + static const wchar_t wstring[] = { 'a', 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%ls", wstring) < 0 + || strcmp (buf, "a") != 0) + result |= 2; + } + /* Test whether precisions in %ls are supported as specified in ISO C 99 + section 7.19.6.1: + "If a precision is specified, no more than that many bytes are written + (including shift sequences, if any), and the array shall contain a + null wide character if, to equal the multibyte character sequence + length given by the precision, the function would need to access a + wide character one past the end of the array." + This test fails on Solaris 10. */ + { + static const wchar_t wstring[] = { 'a', 'b', (wchar_t) 0xfdfdfdfd, 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%.2ls", wstring) < 0 + || strcmp (buf, "ab") != 0) + result |= 8; + } + return result; +}]])], + [gl_cv_func_printf_directive_ls=yes], + [gl_cv_func_printf_directive_ls=no], + [ +changequote(,)dnl + case "$host_os" in + openbsd*) gl_cv_func_printf_directive_ls="guessing no";; + irix*) gl_cv_func_printf_directive_ls="guessing no";; + solaris*) gl_cv_func_printf_directive_ls="guessing no";; + cygwin*) gl_cv_func_printf_directive_ls="guessing no";; + beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; + *) gl_cv_func_printf_directive_ls="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) +m4trace:m4/printf.m4:745: -1- AC_DEFUN([gl_PRINTF_POSITIONS], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with positions], + [gl_cv_func_printf_positions], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +/* The string "%2$d %1$d", with dollar characters protected from the shell's + dollar expansion (possibly an autoconf bug). */ +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; +static char buf[100]; +int main () +{ + sprintf (buf, format, 33, 55); + return (strcmp (buf, "55 33") != 0); +}]])], + [gl_cv_func_printf_positions=yes], + [gl_cv_func_printf_positions=no], + [ +changequote(,)dnl + case "$host_os" in + netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) + gl_cv_func_printf_positions="guessing no";; + beos*) gl_cv_func_printf_positions="guessing no";; + mingw* | pw*) gl_cv_func_printf_positions="guessing no";; + *) gl_cv_func_printf_positions="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) +m4trace:m4/printf.m4:785: -1- AC_DEFUN([gl_PRINTF_FLAG_GROUPING], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the grouping flag], + [gl_cv_func_printf_flag_grouping], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +static char buf[100]; +int main () +{ + if (sprintf (buf, "%'d %d", 1234567, 99) < 0 + || buf[strlen (buf) - 1] != '9') + return 1; + return 0; +}]])], + [gl_cv_func_printf_flag_grouping=yes], + [gl_cv_func_printf_flag_grouping=no], + [ +changequote(,)dnl + case "$host_os" in + cygwin*) gl_cv_func_printf_flag_grouping="guessing no";; + netbsd*) gl_cv_func_printf_flag_grouping="guessing no";; + mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";; + *) gl_cv_func_printf_flag_grouping="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) +m4trace:m4/printf.m4:824: -1- AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the left-adjust flag correctly], + [gl_cv_func_printf_flag_leftadjust], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +static char buf[100]; +int main () +{ + /* Check that a '-' flag is not annihilated by a negative width. */ + if (sprintf (buf, "a%-*sc", -3, "b") < 0 + || strcmp (buf, "ab c") != 0) + return 1; + return 0; +}]])], + [gl_cv_func_printf_flag_leftadjust=yes], + [gl_cv_func_printf_flag_leftadjust=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on HP-UX 11. + hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";; + # Guess no on HP-UX 10 and older. + hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_printf_flag_leftadjust="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) +m4trace:m4/printf.m4:866: -1- AC_DEFUN([gl_PRINTF_FLAG_ZERO], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the zero flag correctly], + [gl_cv_func_printf_flag_zero], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +static char buf[100]; +static double zero = 0.0; +int main () +{ + if (sprintf (buf, "%010f", 1.0 / zero, 33, 44, 55) < 0 + || (strcmp (buf, " inf") != 0 + && strcmp (buf, " infinity") != 0)) + return 1; + return 0; +}]])], + [gl_cv_func_printf_flag_zero=yes], + [gl_cv_func_printf_flag_zero=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_flag_zero="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_flag_zero="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) +m4trace:m4/printf.m4:913: -1- AC_DEFUN([gl_PRINTF_PRECISION], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports large precisions], + [gl_cv_func_printf_precision], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +static char buf[5000]; +int main () +{ + int result = 0; +#ifdef __BEOS__ + /* On BeOS, this would crash and show a dialog box. Avoid the crash. */ + return 1; +#endif + if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3) + result |= 1; + if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5) + result |= 2; + if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5 + || buf[0] != '1') + result |= 4; + if (sprintf (buf, "%.999f %d", 1.0, 33, 44) < 999 + 5 + || buf[0] != '1') + result |= 4; + return result; +}]])], + [gl_cv_func_printf_precision=yes], + [gl_cv_func_printf_precision=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess no only on Solaris, native Windows, and BeOS systems. + solaris*) gl_cv_func_printf_precision="guessing no" ;; + mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;; + beos*) gl_cv_func_printf_precision="guessing no" ;; + *) gl_cv_func_printf_precision="guessing yes" ;; + esac +changequote([,])dnl + ]) + ]) +]) +m4trace:m4/printf.m4:964: -1- AC_DEFUN([gl_PRINTF_ENOMEM], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gl_MULTIARCH]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf survives out-of-memory conditions], + [gl_cv_func_printf_enomem], + [ + gl_cv_func_printf_enomem="guessing no" + if test "$cross_compiling" = no; then + if test $APPLE_UNIVERSAL_BUILD = 0; then + AC_LANG_CONFTEST([AC_LANG_SOURCE([ +]GL_NOCRASH[ +changequote(,)dnl +#include +#include +#include +#include +#include +int main() +{ + struct rlimit limit; + int ret; + nocrash_init (); + /* Some printf implementations allocate temporary space with malloc. */ + /* On BSD systems, malloc() is limited by RLIMIT_DATA. */ +#ifdef RLIMIT_DATA + if (getrlimit (RLIMIT_DATA, &limit) < 0) + return 77; + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) + limit.rlim_max = 5000000; + limit.rlim_cur = limit.rlim_max; + if (setrlimit (RLIMIT_DATA, &limit) < 0) + return 77; +#endif + /* On Linux systems, malloc() is limited by RLIMIT_AS. */ +#ifdef RLIMIT_AS + if (getrlimit (RLIMIT_AS, &limit) < 0) + return 77; + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) + limit.rlim_max = 5000000; + limit.rlim_cur = limit.rlim_max; + if (setrlimit (RLIMIT_AS, &limit) < 0) + return 77; +#endif + /* Some printf implementations allocate temporary space on the stack. */ +#ifdef RLIMIT_STACK + if (getrlimit (RLIMIT_STACK, &limit) < 0) + return 77; + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) + limit.rlim_max = 5000000; + limit.rlim_cur = limit.rlim_max; + if (setrlimit (RLIMIT_STACK, &limit) < 0) + return 77; +#endif + ret = printf ("%.5000000f", 1.0); + return !(ret == 5000002 || (ret < 0 && errno == ENOMEM)); +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + (./conftest 2>&AS_MESSAGE_LOG_FD + result=$? + _AS_ECHO_LOG([\$? = $result]) + if test $result != 0 && test $result != 77; then result=1; fi + exit $result + ) >/dev/null 2>/dev/null + case $? in + 0) gl_cv_func_printf_enomem="yes" ;; + 77) gl_cv_func_printf_enomem="guessing no" ;; + *) gl_cv_func_printf_enomem="no" ;; + esac + else + gl_cv_func_printf_enomem="guessing no" + fi + rm -fr conftest* + else + dnl A universal build on Apple Mac OS X platforms. + dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode. + dnl But we need a configuration result that is valid in both modes. + gl_cv_func_printf_enomem="guessing no" + fi + fi + if test "$gl_cv_func_printf_enomem" = "guessing no"; then +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on Solaris. + solaris*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on AIX. + aix*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on HP-UX/hppa. + hpux*) case "$host_cpu" in + hppa*) gl_cv_func_printf_enomem="guessing yes";; + *) gl_cv_func_printf_enomem="guessing no";; + esac + ;; + # Guess yes on IRIX. + irix*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on OSF/1. + osf*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on Haiku. + haiku*) gl_cv_func_printf_enomem="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_enomem="guessing no";; + esac +changequote([,])dnl + fi + ]) +]) +m4trace:m4/printf.m4:1081: -1- AC_DEFUN([gl_SNPRINTF_PRESENCE], [ + AC_CHECK_FUNCS_ONCE([snprintf]) +]) +m4trace:m4/printf.m4:1090: -1- AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_SNPRINTF_PRESENCE]) + AC_CACHE_CHECK([whether snprintf truncates the result as in C99], + [gl_cv_func_snprintf_truncation_c99], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char buf[100]; +int main () +{ + strcpy (buf, "ABCDEF"); + my_snprintf (buf, 3, "%d %d", 4567, 89); + if (memcmp (buf, "45\0DEF", 6) != 0) + return 1; + return 0; +}]])], + [gl_cv_func_snprintf_truncation_c99=yes], + [gl_cv_func_snprintf_truncation_c99=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";; + darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";; + hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on OSF/1 >= 5. + osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_truncation_c99="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) +m4trace:m4/printf.m4:1186: -1- AC_DEFUN_ONCE([gl_SNPRINTF_RETVAL_C99], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_SNPRINTF_PRESENCE]) + AC_CACHE_CHECK([whether snprintf returns a byte count as in C99], + [gl_cv_func_snprintf_retval_c99], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char buf[100]; +int main () +{ + strcpy (buf, "ABCDEF"); + if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7) + return 1; + if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7) + return 2; + if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7) + return 3; + return 0; +}]])], + [gl_cv_func_snprintf_retval_c99=yes], + [gl_cv_func_snprintf_retval_c99=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";; + darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_retval_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";; + aix*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_retval_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_retval_c99="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) +m4trace:m4/printf.m4:1265: -1- AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_SNPRINTF_PRESENCE]) + AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive], + [gl_cv_func_snprintf_directive_n], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char fmtstring[10]; +static char buf[100]; +int main () +{ + int count = -1; + /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) + support %n in format strings in read-only memory but not in writable + memory. */ + strcpy (fmtstring, "%d %n"); + my_snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55); + if (count != 6) + return 1; + return 0; +}]])], + [gl_cv_func_snprintf_directive_n=yes], + [gl_cv_func_snprintf_directive_n=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_directive_n="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";; + darwin*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_snprintf_directive_n="guessing no";; + solaris*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";; + aix*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on OSF/1 >= 5. + osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";; + osf*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_directive_n="guessing no";; + netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_directive_n="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_directive_n="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) +m4trace:m4/printf.m4:1349: -1- AC_DEFUN([gl_SNPRINTF_SIZE1], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gl_SNPRINTF_PRESENCE]) + AC_CACHE_CHECK([whether snprintf respects a size of 1], + [gl_cv_func_snprintf_size1], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + my_snprintf (buf, 1, "%d", 12345); + return buf[1] != 'E'; +}]])], + [gl_cv_func_snprintf_size1=yes], + [gl_cv_func_snprintf_size1=no], + [gl_cv_func_snprintf_size1="guessing yes"]) + ]) +]) +m4trace:m4/printf.m4:1421: -1- AC_DEFUN([gl_VSNPRINTF_ZEROSIZE_C99], [ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether vsnprintf respects a zero size as in C99], + [gl_cv_func_vsnprintf_zerosize_c99], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + my_snprintf (buf, 0, "%d", 12345); + return buf[0] != 'D'; +}]])], + [gl_cv_func_vsnprintf_zerosize_c99=yes], + [gl_cv_func_vsnprintf_zerosize_c99=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Cygwin. + cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on mingw. + mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) +m4trace:m4/progtest.m4:25: -1- AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL([ac_cv_path_$1], +[case "[$]$1" in + [[\\/]]* | ?:[[\\/]]*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in ifelse([$5], , $PATH, [$5]); do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then + AC_MSG_RESULT([$][$1]) +else + AC_MSG_RESULT([no]) +fi +AC_SUBST([$1])dnl +]) +m4trace:m4/putenv.m4:12: -1- AC_DEFUN([gl_FUNC_PUTENV], [ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([for putenv compatible with GNU and SVID], + [gl_cv_func_svid_putenv], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[ + /* Put it in env. */ + if (putenv ("CONFTEST_putenv=val")) + return 1; + + /* Try to remove it. */ + if (putenv ("CONFTEST_putenv")) + return 2; + + /* Make sure it was deleted. */ + if (getenv ("CONFTEST_putenv") != 0) + return 3; + + return 0; + ]])], + gl_cv_func_svid_putenv=yes, + gl_cv_func_svid_putenv=no, + dnl When crosscompiling, assume putenv is broken. + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_svid_putenv="guessing no" ;; + esac + ]) + ]) + case "$gl_cv_func_svid_putenv" in + *yes) ;; + *) + REPLACE_PUTENV=1 + ;; + esac +]) +m4trace:m4/putenv.m4:53: -1- AC_DEFUN([gl_PREREQ_PUTENV], [ + AC_CHECK_DECLS([_putenv]) +]) +m4trace:m4/quote.m4:8: -1- AC_DEFUN([gl_QUOTE], [ + dnl Prerequisites of lib/quote.c. + dnl (none) + : +]) +m4trace:m4/quotearg.m4:7: -1- AC_DEFUN([gl_QUOTEARG], [ + : +]) +m4trace:m4/raise.m4:7: -1- AC_DEFUN([gl_FUNC_RAISE], [ + AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_FUNCS([raise]) + if test $ac_cv_func_raise = no; then + HAVE_RAISE=0 + else + m4_ifdef([gl_MSVC_INVAL], [ + AC_REQUIRE([gl_MSVC_INVAL]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_RAISE=1 + fi + ]) + m4_ifdef([gl_SIGNALBLOCKING], [ + gl_SIGNALBLOCKING + if test $HAVE_POSIX_SIGNALBLOCKING = 0; then + m4_ifdef([gl_SIGNAL_SIGPIPE], [ + gl_SIGNAL_SIGPIPE + if test $gl_cv_header_signal_h_SIGPIPE != yes; then + REPLACE_RAISE=1 + fi + ], [:]) + fi + ]) + fi +]) +m4trace:m4/raise.m4:36: -1- AC_DEFUN([gl_PREREQ_RAISE], [:]) +m4trace:m4/rawmemchr.m4:7: -1- AC_DEFUN([gl_FUNC_RAWMEMCHR], [ + dnl Persuade glibc to declare rawmemchr(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_CHECK_FUNCS([rawmemchr]) + if test $ac_cv_func_rawmemchr = no; then + HAVE_RAWMEMCHR=0 + fi +]) +m4trace:m4/rawmemchr.m4:20: -1- AC_DEFUN([gl_PREREQ_RAWMEMCHR], [:]) +m4trace:m4/readlink.m4:7: -1- AC_DEFUN([gl_FUNC_READLINK], [ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CHECK_FUNCS_ONCE([readlink]) + if test $ac_cv_func_readlink = no; then + HAVE_READLINK=0 + else + AC_CACHE_CHECK([whether readlink signature is correct], + [gl_cv_decl_readlink_works], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + /* Cause compilation failure if original declaration has wrong type. */ + ssize_t readlink (const char *, char *, size_t);]])], + [gl_cv_decl_readlink_works=yes], [gl_cv_decl_readlink_works=no])]) + dnl Solaris 9 ignores trailing slash. + dnl FreeBSD 7.2 dereferences only one level of links with trailing slash. + AC_CACHE_CHECK([whether readlink handles trailing slash correctly], + [gl_cv_func_readlink_works], + [# We have readlink, so assume ln -s works. + ln -s conftest.no-such conftest.link + ln -s conftest.link conftest.lnk2 + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include +]], [[char buf[20]; + return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;]])], + [gl_cv_func_readlink_works=yes], [gl_cv_func_readlink_works=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_readlink_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_readlink_works="guessing no" ;; + esac + ]) + rm -f conftest.link conftest.lnk2]) + case "$gl_cv_func_readlink_works" in + *yes) + if test "$gl_cv_decl_readlink_works" != yes; then + REPLACE_READLINK=1 + fi + ;; + *) + AC_DEFINE([READLINK_TRAILING_SLASH_BUG], [1], [Define to 1 if readlink + fails to recognize a trailing slash.]) + REPLACE_READLINK=1 + ;; + esac + fi +]) +m4trace:m4/readlink.m4:61: -1- AC_DEFUN([gl_FUNC_READLINK_SEPARATE], [ + AC_CHECK_FUNCS_ONCE([readlink]) + gl_PREREQ_READLINK +]) +m4trace:m4/readlink.m4:68: -1- AC_DEFUN([gl_PREREQ_READLINK], [ + : +]) +m4trace:m4/regex.m4:14: -1- AC_DEFUN([gl_REGEX], [ + AC_ARG_WITH([included-regex], + [AS_HELP_STRING([--without-included-regex], + [don't compile regex; this is the default on systems + with recent-enough versions of the GNU C Library + (use with caution on other systems).])]) + + case $with_included_regex in #( + yes|no) ac_use_included_regex=$with_included_regex + ;; + '') + # If the system regex support is good enough that it passes the + # following run test, then default to *not* using the included regex.c. + # If cross compiling, assume the test would fail and use the included + # regex.c. + AC_CHECK_DECLS_ONCE([alarm]) + AC_CHECK_HEADERS_ONCE([malloc.h]) + AC_CACHE_CHECK([for working re_compile_pattern], + [gl_cv_func_re_compile_pattern_working], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + + #include + #include + #include + + #if defined M_CHECK_ACTION || HAVE_DECL_ALARM + # include + # include + #endif + + #if HAVE_MALLOC_H + # include + #endif + + #ifdef M_CHECK_ACTION + /* Exit with distinguishable exit code. */ + static void sigabrt_no_core (int sig) { raise (SIGTERM); } + #endif + ]], + [[int result = 0; + static struct re_pattern_buffer regex; + unsigned char folded_chars[UCHAR_MAX + 1]; + int i; + const char *s; + struct re_registers regs; + + /* Some builds of glibc go into an infinite loop on this + test. Use alarm to force death, and mallopt to avoid + malloc recursion in diagnosing the corrupted heap. */ +#if HAVE_DECL_ALARM + signal (SIGALRM, SIG_DFL); + alarm (2); +#endif +#ifdef M_CHECK_ACTION + signal (SIGABRT, sigabrt_no_core); + mallopt (M_CHECK_ACTION, 2); +#endif + + if (setlocale (LC_ALL, "en_US.UTF-8")) + { + { + /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html + This test needs valgrind to catch the bug on Debian + GNU/Linux 3.1 x86, but it might catch the bug better + on other platforms and it shouldn't hurt to try the + test here. */ + static char const pat[] = "insert into"; + static char const data[] = + "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK"; + re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE + | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else if (re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, ®s) + != -1) + result |= 1; + regfree (®ex); + } + + { + /* This test is from glibc bug 15078. + The test case is from Andreas Schwab in + . + */ + static char const pat[] = "[^x]x"; + static char const data[] = + /* */ + "\xe1\x80\x80" + "\xe1\x80\xbb" + "\xe1\x80\xbd" + "\xe1\x80\x94" + "\xe1\x80\xba" + "\xe1\x80\xaf" + "\xe1\x80\x95" + "\xe1\x80\xba" + "x"; + re_set_syntax (0); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else + { + i = re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, 0); + if (i != 0 && i != 21) + result |= 1; + } + regfree (®ex); + } + + if (! setlocale (LC_ALL, "C")) + return 1; + } + + /* This test is from glibc bug 3957, reported by Andrew Mackey. */ + re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[^x]b", 6, ®ex); + if (s) + result |= 2; + /* This should fail, but succeeds for glibc-2.5. */ + else if (re_search (®ex, "a\nb", 3, 0, 3, ®s) != -1) + result |= 2; + + /* This regular expression is from Spencer ere test number 75 + in grep-2.3. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP); + memset (®ex, 0, sizeof regex); + for (i = 0; i <= UCHAR_MAX; i++) + folded_chars[i] = i; + regex.translate = folded_chars; + s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, ®ex); + /* This should fail with _Invalid character class name_ error. */ + if (!s) + result |= 4; + + /* Ensure that [b-a] is diagnosed as invalid, when + using RE_NO_EMPTY_RANGES. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[b-a]", 6, ®ex); + if (s == 0) + result |= 8; + + /* This should succeed, but does not for glibc-2.1.3. */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("{1", 2, ®ex); + if (s) + result |= 8; + + /* The following example is derived from a problem report + against gawk from Jorge Stolfi . */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[an\371]*n", 7, ®ex); + if (s) + result |= 8; + /* This should match, but does not for glibc-2.2.1. */ + else if (re_match (®ex, "an", 2, 0, ®s) != 2) + result |= 8; + + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 8; + /* glibc-2.2.93 does not work with a negative RANGE argument. */ + else if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1) + result |= 8; + + /* The version of regex.c in older versions of gnulib + ignored RE_ICASE. Detect that problem too. */ + re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 16; + else if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0) + result |= 16; + + /* Catch a bug reported by Vin Shelton in + http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html + */ + re_set_syntax (RE_SYNTAX_POSIX_BASIC + & ~RE_CONTEXT_INVALID_DUP + & ~RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, ®ex); + if (s) + result |= 32; + + /* REG_STARTEND was added to glibc on 2004-01-15. + Reject older versions. */ + if (! REG_STARTEND) + result |= 64; + +#if 0 + /* It would be nice to reject hosts whose regoff_t values are too + narrow (including glibc on hosts with 64-bit ptrdiff_t and + 32-bit int), but we should wait until glibc implements this + feature. Otherwise, support for equivalence classes and + multibyte collation symbols would always be broken except + when compiling --without-included-regex. */ + if (sizeof (regoff_t) < sizeof (ptrdiff_t) + || sizeof (regoff_t) < sizeof (ssize_t)) + result |= 64; +#endif + + return result; + ]])], + [gl_cv_func_re_compile_pattern_working=yes], + [gl_cv_func_re_compile_pattern_working=no], + dnl When crosscompiling, assume it is not working. + [gl_cv_func_re_compile_pattern_working=no])]) + case $gl_cv_func_re_compile_pattern_working in #( + yes) ac_use_included_regex=no;; #( + no) ac_use_included_regex=yes;; + esac + ;; + *) AC_MSG_ERROR([Invalid value for --with-included-regex: $with_included_regex]) + ;; + esac + + if test $ac_use_included_regex = yes; then + AC_DEFINE([_REGEX_INCLUDE_LIMITS_H], [1], + [Define if you want to include , so that it + consistently overrides 's RE_DUP_MAX.]) + AC_DEFINE([_REGEX_LARGE_OFFSETS], [1], + [Define if you want regoff_t to be at least as wide POSIX requires.]) + AC_DEFINE([re_syntax_options], [rpl_re_syntax_options], + [Define to rpl_re_syntax_options if the replacement should be used.]) + AC_DEFINE([re_set_syntax], [rpl_re_set_syntax], + [Define to rpl_re_set_syntax if the replacement should be used.]) + AC_DEFINE([re_compile_pattern], [rpl_re_compile_pattern], + [Define to rpl_re_compile_pattern if the replacement should be used.]) + AC_DEFINE([re_compile_fastmap], [rpl_re_compile_fastmap], + [Define to rpl_re_compile_fastmap if the replacement should be used.]) + AC_DEFINE([re_search], [rpl_re_search], + [Define to rpl_re_search if the replacement should be used.]) + AC_DEFINE([re_search_2], [rpl_re_search_2], + [Define to rpl_re_search_2 if the replacement should be used.]) + AC_DEFINE([re_match], [rpl_re_match], + [Define to rpl_re_match if the replacement should be used.]) + AC_DEFINE([re_match_2], [rpl_re_match_2], + [Define to rpl_re_match_2 if the replacement should be used.]) + AC_DEFINE([re_set_registers], [rpl_re_set_registers], + [Define to rpl_re_set_registers if the replacement should be used.]) + AC_DEFINE([re_comp], [rpl_re_comp], + [Define to rpl_re_comp if the replacement should be used.]) + AC_DEFINE([re_exec], [rpl_re_exec], + [Define to rpl_re_exec if the replacement should be used.]) + AC_DEFINE([regcomp], [rpl_regcomp], + [Define to rpl_regcomp if the replacement should be used.]) + AC_DEFINE([regexec], [rpl_regexec], + [Define to rpl_regexec if the replacement should be used.]) + AC_DEFINE([regerror], [rpl_regerror], + [Define to rpl_regerror if the replacement should be used.]) + AC_DEFINE([regfree], [rpl_regfree], + [Define to rpl_regfree if the replacement should be used.]) + fi +]) +m4trace:m4/regex.m4:282: -1- AC_DEFUN([gl_PREREQ_REGEX], [ + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([AC_C_INLINE]) + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + AC_REQUIRE([gl_EEMALLOC]) + AC_REQUIRE([gl_GLIBC21]) + AC_CHECK_HEADERS([libintl.h]) + AC_CHECK_FUNCS_ONCE([isblank iswctype]) + AC_CHECK_DECLS([isblank], [], [], [[#include ]]) +]) +m4trace:m4/secure_getenv.m4:7: -1- AC_DEFUN([gl_FUNC_SECURE_GETENV], [ + dnl Persuade glibc to declare secure_getenv(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([secure_getenv]) + if test $ac_cv_func_secure_getenv = no; then + HAVE_SECURE_GETENV=0 + fi +]) +m4trace:m4/secure_getenv.m4:20: -1- AC_DEFUN([gl_PREREQ_SECURE_GETENV], [ + AC_CHECK_FUNCS([__secure_getenv]) + if test $ac_cv_func___secure_getenv = no; then + AC_CHECK_FUNCS([issetugid]) + fi + AC_CHECK_FUNCS_ONCE([getuid geteuid getgid getegid]) +]) +m4trace:m4/select.m4:7: -1- AC_DEFUN([gl_FUNC_SELECT], [ + AC_REQUIRE([gl_HEADER_SYS_SELECT]) + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_SOCKETS]) + if test "$ac_cv_header_winsock2_h" = yes; then + REPLACE_SELECT=1 + else + dnl On Interix 3.5, select(0, NULL, NULL, NULL, timeout) fails with error + dnl EFAULT. + AC_CHECK_HEADERS_ONCE([sys/select.h]) + AC_CACHE_CHECK([whether select supports a 0 argument], + [gl_cv_func_select_supports0], + [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include +#include +#if HAVE_SYS_SELECT_H +#include +#endif +int main () +{ + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0; +}]])], [gl_cv_func_select_supports0=yes], [gl_cv_func_select_supports0=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess no on Interix. + interix*) gl_cv_func_select_supports0="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_select_supports0="guessing yes";; + esac +changequote([,])dnl + ]) + ]) + case "$gl_cv_func_select_supports0" in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + + dnl On FreeBSD 8.2, select() doesn't always reject bad fds. + AC_CACHE_CHECK([whether select detects invalid fds], + [gl_cv_func_select_detects_ebadf], + [ + AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include +#include +#if HAVE_SYS_SELECT_H +# include +#endif +#include +#include +]],[[ + fd_set set; + dup2(0, 16); + FD_ZERO(&set); + FD_SET(16, &set); + close(16); + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF; +]])], [gl_cv_func_select_detects_ebadf=yes], + [gl_cv_func_select_detects_ebadf=no], + [ + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_select_detects_ebadf="guessing no" ;; + esac + ]) + ]) + case $gl_cv_func_select_detects_ebadf in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + fi + + dnl Determine the needed libraries. + LIB_SELECT="$LIBSOCKET" + if test $REPLACE_SELECT = 1; then + case "$host_os" in + mingw*) + dnl On the MSVC platform, the function MsgWaitForMultipleObjects + dnl (used in lib/select.c) requires linking with -luser32. On mingw, + dnl it is implicit. + AC_LINK_IFELSE( + [AC_LANG_SOURCE([[ +#define WIN32_LEAN_AND_MEAN +#include +int +main () +{ + MsgWaitForMultipleObjects (0, NULL, 0, 0, 0); + return 0; +}]])], + [], + [LIB_SELECT="$LIB_SELECT -luser32"]) + ;; + esac + fi + AC_SUBST([LIB_SELECT]) +]) +m4trace:m4/setenv.m4:7: -1- AC_DEFUN([gl_FUNC_SETENV], [ + AC_REQUIRE([gl_FUNC_SETENV_SEPARATE]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + if test $ac_cv_func_setenv = no; then + HAVE_SETENV=0 + else + AC_CACHE_CHECK([whether setenv validates arguments], + [gl_cv_func_setenv_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + #include + ]], [[ + int result = 0; + { + if (setenv ("", "", 0) != -1) + result |= 1; + else if (errno != EINVAL) + result |= 2; + } + { + if (setenv ("a", "=", 1) != 0) + result |= 4; + else if (strcmp (getenv ("a"), "=") != 0) + result |= 8; + } + return result; + ]])], + [gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_setenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_setenv_works="guessing no" ;; + esac + ])]) + case "$gl_cv_func_setenv_works" in + *yes) ;; + *) + REPLACE_SETENV=1 + ;; + esac + fi +]) +m4trace:m4/setenv.m4:55: -1- AC_DEFUN([gl_FUNC_SETENV_SEPARATE], [ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_CHECK_DECLS_ONCE([setenv]) + if test $ac_cv_have_decl_setenv = no; then + HAVE_DECL_SETENV=0 + fi + AC_CHECK_FUNCS_ONCE([setenv]) + gl_PREREQ_SETENV +]) +m4trace:m4/setenv.m4:66: -1- AC_DEFUN([gl_FUNC_UNSETENV], [ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CHECK_DECLS_ONCE([unsetenv]) + if test $ac_cv_have_decl_unsetenv = no; then + HAVE_DECL_UNSETENV=0 + fi + AC_CHECK_FUNCS([unsetenv]) + if test $ac_cv_func_unsetenv = no; then + HAVE_UNSETENV=0 + else + HAVE_UNSETENV=1 + dnl Some BSDs return void, failing to do error checking. + AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#undef _BSD +#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 */ +#include +extern +#ifdef __cplusplus +"C" +#endif +int unsetenv (const char *name); + ]], + [[]])], + [gt_cv_func_unsetenv_ret='int'], + [gt_cv_func_unsetenv_ret='void'])]) + if test $gt_cv_func_unsetenv_ret = 'void'; then + AC_DEFINE([VOID_UNSETENV], [1], [Define to 1 if unsetenv returns void + instead of int.]) + REPLACE_UNSETENV=1 + fi + + dnl Solaris 10 unsetenv does not remove all copies of a name. + dnl Haiku alpha 2 unsetenv gets confused by assignment to environ. + dnl OpenBSD 4.7 unsetenv("") does not fail. + AC_CACHE_CHECK([whether unsetenv obeys POSIX], + [gl_cv_func_unsetenv_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + extern char **environ; + ]], [[ + char entry1[] = "a=1"; + char entry2[] = "b=2"; + char *env[] = { entry1, entry2, NULL }; + if (putenv ((char *) "a=1")) return 1; + if (putenv (entry2)) return 2; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 3; + if (!unsetenv ("") || errno != EINVAL) return 4; + entry2[0] = 'b'; + environ = env; + if (!getenv ("a")) return 5; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 6; + ]])], + [gl_cv_func_unsetenv_works=yes], [gl_cv_func_unsetenv_works=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_unsetenv_works="guessing no" ;; + esac + ])]) + case "$gl_cv_func_unsetenv_works" in + *yes) ;; + *) + REPLACE_UNSETENV=1 + ;; + esac + fi +]) +m4trace:m4/setenv.m4:146: -1- AC_DEFUN([gl_PREREQ_SETENV], [ + AC_REQUIRE([AC_FUNC_ALLOCA]) + AC_REQUIRE([gl_ENVIRON]) + AC_CHECK_HEADERS_ONCE([unistd.h]) + AC_CHECK_HEADERS([search.h]) + AC_CHECK_FUNCS([tsearch]) +]) +m4trace:m4/setenv.m4:156: -1- AC_DEFUN([gl_PREREQ_UNSETENV], [ + AC_REQUIRE([gl_ENVIRON]) + AC_CHECK_HEADERS_ONCE([unistd.h]) +]) +m4trace:m4/setlocale.m4:7: -1- AC_DEFUN([gl_FUNC_SETLOCALE], [ + AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + dnl On native Windows systems, setlocale(category,NULL) does not look at + dnl the environment variables LC_ALL, category, and LANG. + mingw*) REPLACE_SETLOCALE=1 ;; + dnl On Cygwin 1.5.x, setlocale always succeeds but setlocale(LC_CTYPE,NULL) + dnl is then still "C". + cygwin*) + case `uname -r` in + 1.5.*) REPLACE_SETLOCALE=1 ;; + esac + ;; + esac +]) +m4trace:m4/setlocale.m4:26: -1- AC_DEFUN([gl_PREREQ_SETLOCALE], [ + : +]) +m4trace:m4/sigaction.m4:8: -1- AC_DEFUN([gl_SIGACTION], [ + AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([sigaction]) + if test $ac_cv_func_sigaction = yes; then + AC_CHECK_MEMBERS([struct sigaction.sa_sigaction], , , + [[#include ]]) + if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then + HAVE_STRUCT_SIGACTION_SA_SIGACTION=0 + fi + else + HAVE_SIGACTION=0 + fi +]) +m4trace:m4/sigaction.m4:24: -1- AC_DEFUN([gl_PREREQ_SIGACTION], [ + AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([AC_TYPE_UID_T]) + AC_REQUIRE([gl_PREREQ_SIG_HANDLER_H]) + AC_CHECK_FUNCS_ONCE([sigaltstack siginterrupt]) + AC_CHECK_TYPES([siginfo_t], [], [], [[ +#include + ]]) + if test $ac_cv_type_siginfo_t = no; then + HAVE_SIGINFO_T=0 + fi +]) +m4trace:m4/sigaction.m4:40: -1- AC_DEFUN([gl_PREREQ_SIG_HANDLER_H], [:]) +m4trace:m4/signal_h.m4:7: -1- AC_DEFUN([gl_SIGNAL_H], [ + AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) + AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T]) + gl_NEXT_HEADERS([signal.h]) + +# AIX declares sig_atomic_t to already include volatile, and C89 compilers +# then choke on 'volatile sig_atomic_t'. C99 requires that it compile. + AC_CHECK_TYPE([volatile sig_atomic_t], [], + [HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0], [[ +#include + ]]) + + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) + + AC_REQUIRE([AC_TYPE_UID_T]) + + dnl Persuade glibc to define sighandler_t. + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_TYPE([sighandler_t], [], [HAVE_SIGHANDLER_T=0], [[ +#include + ]]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include + ]], [pthread_sigmask sigaction + sigaddset sigdelset sigemptyset sigfillset sigismember + sigpending sigprocmask]) +]) +m4trace:m4/signal_h.m4:39: -1- AC_DEFUN([gl_CHECK_TYPE_SIGSET_T], [ + AC_CHECK_TYPES([sigset_t], + [gl_cv_type_sigset_t=yes], [gl_cv_type_sigset_t=no], + [[ + #include + /* Mingw defines sigset_t not in , but in . */ + #include + ]]) + if test $gl_cv_type_sigset_t != yes; then + HAVE_SIGSET_T=0 + fi +]) +m4trace:m4/signal_h.m4:53: -1- AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) +m4trace:m4/signal_h.m4:62: -1- AC_DEFUN([gl_SIGNAL_H_DEFAULTS], [ + GNULIB_PTHREAD_SIGMASK=0; AC_SUBST([GNULIB_PTHREAD_SIGMASK]) + GNULIB_RAISE=0; AC_SUBST([GNULIB_RAISE]) + GNULIB_SIGNAL_H_SIGPIPE=0; AC_SUBST([GNULIB_SIGNAL_H_SIGPIPE]) + GNULIB_SIGPROCMASK=0; AC_SUBST([GNULIB_SIGPROCMASK]) + GNULIB_SIGACTION=0; AC_SUBST([GNULIB_SIGACTION]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_POSIX_SIGNALBLOCKING=1; AC_SUBST([HAVE_POSIX_SIGNALBLOCKING]) + HAVE_PTHREAD_SIGMASK=1; AC_SUBST([HAVE_PTHREAD_SIGMASK]) + HAVE_RAISE=1; AC_SUBST([HAVE_RAISE]) + HAVE_SIGSET_T=1; AC_SUBST([HAVE_SIGSET_T]) + HAVE_SIGINFO_T=1; AC_SUBST([HAVE_SIGINFO_T]) + HAVE_SIGACTION=1; AC_SUBST([HAVE_SIGACTION]) + HAVE_STRUCT_SIGACTION_SA_SIGACTION=1; + AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION]) + HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1; + AC_SUBST([HAVE_TYPE_VOLATILE_SIG_ATOMIC_T]) + HAVE_SIGHANDLER_T=1; AC_SUBST([HAVE_SIGHANDLER_T]) + REPLACE_PTHREAD_SIGMASK=0; AC_SUBST([REPLACE_PTHREAD_SIGMASK]) + REPLACE_RAISE=0; AC_SUBST([REPLACE_RAISE]) +]) +m4trace:m4/signalblocking.m4:12: -1- AC_DEFUN([gl_SIGNALBLOCKING], [ + AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) + AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T]) + if test $gl_cv_type_sigset_t = yes; then + AC_CHECK_FUNC([sigprocmask], [gl_cv_func_sigprocmask=1]) + fi + if test -z "$gl_cv_func_sigprocmask"; then + HAVE_POSIX_SIGNALBLOCKING=0 + fi +]) +m4trace:m4/signalblocking.m4:25: -1- AC_DEFUN([gl_PREREQ_SIGPROCMASK], [:]) +m4trace:m4/size_max.m4:9: -1- AC_DEFUN([gl_SIZE_MAX], [ + AC_CHECK_HEADERS([stdint.h]) + dnl First test whether the system already has SIZE_MAX. + AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [ + gl_cv_size_max= + AC_EGREP_CPP([Found it], [ +#include +#if HAVE_STDINT_H +#include +#endif +#ifdef SIZE_MAX +Found it +#endif +], [gl_cv_size_max=yes]) + if test -z "$gl_cv_size_max"; then + dnl Define it ourselves. Here we assume that the type 'size_t' is not wider + dnl than the type 'unsigned long'. Try hard to find a definition that can + dnl be used in a preprocessor #if, i.e. doesn't contain a cast. + AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1], + [#include +#include ], [size_t_bits_minus_1=]) + AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)], + [#include ], [fits_in_uint=]) + if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then + if test $fits_in_uint = 1; then + dnl Even though SIZE_MAX fits in an unsigned int, it must be of type + dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + extern size_t foo; + extern unsigned long foo; + ]], + [[]])], + [fits_in_uint=0]) + fi + dnl We cannot use 'expr' to simplify this expression, because 'expr' + dnl works only with 'long' integers in the host environment, while we + dnl might be cross-compiling from a 32-bit platform to a 64-bit platform. + if test $fits_in_uint = 1; then + gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" + else + gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" + fi + else + dnl Shouldn't happen, but who knows... + gl_cv_size_max='((size_t)~(size_t)0)' + fi + fi + ]) + if test "$gl_cv_size_max" != yes; then + AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max], + [Define as the maximum value of type 'size_t', if the system doesn't define it.]) + fi + dnl Don't redefine SIZE_MAX in config.h if config.h is re-included after + dnl . Remember that the #undef in AH_VERBATIM gets replaced with + dnl #define by AC_DEFINE_UNQUOTED. + AH_VERBATIM([SIZE_MAX], +[/* Define as the maximum value of type 'size_t', if the system doesn't define + it. */ +#ifndef SIZE_MAX +# undef SIZE_MAX +#endif]) +]) +m4trace:m4/sleep.m4:7: -1- AC_DEFUN([gl_FUNC_SLEEP], [ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + dnl We expect to see the declaration of sleep() in a header file. + dnl Older versions of mingw have a sleep() function that is an alias to + dnl _sleep() in MSVCRT. It has a different signature than POSIX sleep(): + dnl it takes the number of milliseconds as argument and returns void. + dnl mingw does not declare this function. + AC_CHECK_DECLS([sleep], , , [[#include ]]) + AC_CHECK_FUNCS_ONCE([sleep]) + if test $ac_cv_have_decl_sleep != yes; then + HAVE_SLEEP=0 + else + dnl Cygwin 1.5.x has a bug where sleep can't exceed 49.7 days. + AC_CACHE_CHECK([for working sleep], [gl_cv_func_sleep_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include +#include +#include +static void +handle_alarm (int sig) +{ + if (sig != SIGALRM) + _exit (2); +} +]], [[ + /* Failure to compile this test due to missing alarm is okay, + since all such platforms (mingw) also lack sleep. */ + unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days. */ + unsigned int remaining; + signal (SIGALRM, handle_alarm); + alarm (1); + remaining = sleep (pentecost); + if (remaining > pentecost) + return 3; + if (remaining <= pentecost - 10) + return 4; + return 0; + ]])], + [gl_cv_func_sleep_works=yes], [gl_cv_func_sleep_works=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_sleep_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_sleep_works="guessing no" ;; + esac + ])]) + case "$gl_cv_func_sleep_works" in + *yes) ;; + *) + REPLACE_SLEEP=1 + ;; + esac + fi +]) +m4trace:m4/snprintf.m4:11: -1- AC_DEFUN([gl_FUNC_SNPRINTF], [ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + gl_cv_func_snprintf_usable=no + AC_CHECK_FUNCS([snprintf]) + if test $ac_cv_func_snprintf = yes; then + gl_SNPRINTF_SIZE1 + case "$gl_cv_func_snprintf_size1" in + *yes) + gl_SNPRINTF_RETVAL_C99 + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + gl_PRINTF_POSITIONS + case "$gl_cv_func_printf_positions" in + *yes) + gl_cv_func_snprintf_usable=yes + ;; + esac + ;; + esac + ;; + esac + fi + if test $gl_cv_func_snprintf_usable = no; then + gl_REPLACE_SNPRINTF + fi + AC_CHECK_DECLS_ONCE([snprintf]) + if test $ac_cv_have_decl_snprintf = no; then + HAVE_DECL_SNPRINTF=0 + fi +]) +m4trace:m4/snprintf.m4:43: -1- AC_DEFUN([gl_REPLACE_SNPRINTF], [ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_LIBOBJ([snprintf]) + if test $ac_cv_func_snprintf = yes; then + REPLACE_SNPRINTF=1 + else + AC_CHECK_DECLS_ONCE([snprintf]) + if test $ac_cv_have_decl_snprintf = yes; then + dnl If the function is declared but does not appear to exist, it may be + dnl defined as an inline function. In order to avoid a conflict, we have + dnl to define rpl_snprintf, not snprintf. + REPLACE_SNPRINTF=1 + fi + fi + gl_PREREQ_SNPRINTF +]) +m4trace:m4/snprintf.m4:62: -1- AC_DEFUN([gl_PREREQ_SNPRINTF], [:]) +m4trace:m4/socketlib.m4:11: -1- AC_DEFUN([gl_SOCKETLIB], [ + gl_PREREQ_SYS_H_WINSOCK2 dnl for HAVE_WINSOCK2_H + LIBSOCKET= + if test $HAVE_WINSOCK2_H = 1; then + dnl Native Windows API (not Cygwin). + AC_CACHE_CHECK([if we need to call WSAStartup in winsock2.h and -lws2_32], + [gl_cv_func_wsastartup], [ + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#ifdef HAVE_WINSOCK2_H +# include +#endif]], [[ + WORD wVersionRequested = MAKEWORD(1, 1); + WSADATA wsaData; + int err = WSAStartup(wVersionRequested, &wsaData); + WSACleanup ();]])], + gl_cv_func_wsastartup=yes, gl_cv_func_wsastartup=no) + LIBS="$gl_save_LIBS" + ]) + if test "$gl_cv_func_wsastartup" = "yes"; then + AC_DEFINE([WINDOWS_SOCKETS], [1], [Define if WSAStartup is needed.]) + LIBSOCKET='-lws2_32' + fi + else + dnl Unix API. + dnl Solaris has most socket functions in libsocket. + dnl Haiku has most socket functions in libnetwork. + dnl BeOS has most socket functions in libnet. + AC_CACHE_CHECK([for library containing setsockopt], [gl_cv_lib_socket], [ + gl_cv_lib_socket= + AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern +#ifdef __cplusplus +"C" +#endif +char setsockopt();]], [[setsockopt();]])], + [], + [gl_save_LIBS="$LIBS" + LIBS="$gl_save_LIBS -lsocket" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern +#ifdef __cplusplus +"C" +#endif +char setsockopt();]], [[setsockopt();]])], + [gl_cv_lib_socket="-lsocket"]) + if test -z "$gl_cv_lib_socket"; then + LIBS="$gl_save_LIBS -lnetwork" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern +#ifdef __cplusplus +"C" +#endif +char setsockopt();]], [[setsockopt();]])], + [gl_cv_lib_socket="-lnetwork"]) + if test -z "$gl_cv_lib_socket"; then + LIBS="$gl_save_LIBS -lnet" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern +#ifdef __cplusplus +"C" +#endif +char setsockopt();]], [[setsockopt();]])], + [gl_cv_lib_socket="-lnet"]) + fi + fi + LIBS="$gl_save_LIBS" + ]) + if test -z "$gl_cv_lib_socket"; then + gl_cv_lib_socket="none needed" + fi + ]) + if test "$gl_cv_lib_socket" != "none needed"; then + LIBSOCKET="$gl_cv_lib_socket" + fi + fi + AC_SUBST([LIBSOCKET]) +]) +m4trace:m4/sockets.m4:7: -1- AC_DEFUN([gl_SOCKETS], [ + AC_REQUIRE([AC_C_INLINE]) + AC_REQUIRE([gl_SOCKETLIB]) + gl_PREREQ_SOCKETS +]) +m4trace:m4/sockets.m4:15: -1- AC_DEFUN([gl_PREREQ_SOCKETS], [ + : +]) +m4trace:m4/socklen.m4:15: -1- AC_DEFUN([gl_TYPE_SOCKLEN_T], [AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])dnl + AC_CHECK_TYPE([socklen_t], , + [AC_MSG_CHECKING([for socklen_t equivalent]) + AC_CACHE_VAL([gl_cv_socklen_t_equiv], + [# Systems have either "struct sockaddr *" or + # "void *" as the second argument to getpeername + gl_cv_socklen_t_equiv= + for arg2 in "struct sockaddr" void; do + for t in int size_t "unsigned int" "long int" "unsigned long int"; do + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[#include + #include + + int getpeername (int, $arg2 *, $t *);]], + [[$t len; + getpeername (0, 0, &len);]])], + [gl_cv_socklen_t_equiv="$t"]) + test "$gl_cv_socklen_t_equiv" != "" && break + done + test "$gl_cv_socklen_t_equiv" != "" && break + done + ]) + if test "$gl_cv_socklen_t_equiv" = ""; then + AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) + fi + AC_MSG_RESULT([$gl_cv_socklen_t_equiv]) + AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv], + [type to use in place of socklen_t if not defined])], + [gl_SOCKET_HEADERS])]) +m4trace:m4/socklen.m4:52: -1- AC_DEFUN([gl_SOCKET_HEADERS], [ +/* is not needed according to POSIX, but the + in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include +#if HAVE_SYS_SOCKET_H +# include +#elif HAVE_WS2TCPIP_H +# include +#endif +]) +m4trace:m4/socklen.m4:68: -1- AC_DEFUN([gl_CHECK_SOCKET_HEADERS], [AC_CHECK_HEADERS_ONCE([sys/socket.h]) + if test $ac_cv_header_sys_socket_h = no; then + dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make + dnl the check for those headers unconditional; yet cygwin reports + dnl that the headers are present but cannot be compiled (since on + dnl cygwin, all socket information should come from sys/socket.h). + AC_CHECK_HEADERS([ws2tcpip.h]) + fi + ]) +m4trace:m4/sockpfaf.m4:14: -1- AC_DEFUN([gl_SOCKET_FAMILIES], [ + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + AC_CHECK_HEADERS_ONCE([netinet/in.h]) + + AC_MSG_CHECKING([for IPv4 sockets]) + AC_CACHE_VAL([gl_cv_socket_ipv4], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif]], +[[int x = AF_INET; struct in_addr y; struct sockaddr_in z; + if (&x && &y && &z) return 0;]])], + gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)]) + AC_MSG_RESULT([$gl_cv_socket_ipv4]) + if test $gl_cv_socket_ipv4 = yes; then + AC_DEFINE([HAVE_IPV4], [1], [Define to 1 if defines AF_INET.]) + fi + + AC_MSG_CHECKING([for IPv6 sockets]) + AC_CACHE_VAL([gl_cv_socket_ipv6], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif]], +[[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; + if (&x && &y && &z) return 0;]])], + gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)]) + AC_MSG_RESULT([$gl_cv_socket_ipv6]) + if test $gl_cv_socket_ipv6 = yes; then + AC_DEFINE([HAVE_IPV6], [1], [Define to 1 if defines AF_INET6.]) + fi +]) +m4trace:m4/sockpfaf.m4:63: -1- AC_DEFUN([gl_SOCKET_FAMILY_UNIX], [ + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + AC_CHECK_HEADERS_ONCE([sys/un.h]) + + AC_MSG_CHECKING([for UNIX domain sockets]) + AC_CACHE_VAL([gl_cv_socket_unix], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_SYS_UN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif]], +[[int x = AF_UNIX; struct sockaddr_un y; + if (&x && &y) return 0;]])], + gl_cv_socket_unix=yes, gl_cv_socket_unix=no)]) + AC_MSG_RESULT([$gl_cv_socket_unix]) + if test $gl_cv_socket_unix = yes; then + AC_DEFINE([HAVE_UNIXSOCKET], [1], [Define to 1 if defines AF_UNIX.]) + fi +]) +m4trace:m4/ssize_t.m4:10: -1- AC_DEFUN([gt_TYPE_SSIZE_T], [ + AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[int x = sizeof (ssize_t *) + sizeof (ssize_t); + return !x;]])], + [gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])]) + if test $gt_cv_ssize_t = no; then + AC_DEFINE([ssize_t], [int], + [Define as a signed type of the same size as size_t.]) + fi +]) +m4trace:m4/stat-time.m4:20: -1- AC_DEFUN([gl_STAT_TIME], [ + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_HEADERS_ONCE([sys/time.h]) + + AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec], + [AC_CACHE_CHECK([whether struct stat.st_atim is of type struct timespec], + [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[ + #include + #include + #if HAVE_SYS_TIME_H + # include + #endif + #include + struct timespec ts; + struct stat st; + ]], + [[ + st.st_atim = ts; + ]])], + [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes], + [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no])]) + if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then + AC_DEFINE([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], [1], + [Define to 1 if the type of the st_atim member of a struct stat is + struct timespec.]) + fi], + [AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec], [], + [AC_CHECK_MEMBERS([struct stat.st_atimensec], [], + [AC_CHECK_MEMBERS([struct stat.st_atim.st__tim.tv_nsec], [], [], + [#include + #include ])], + [#include + #include ])], + [#include + #include ])], + [#include + #include ]) +]) +m4trace:m4/stat-time.m4:70: -1- AC_DEFUN([gl_STAT_BIRTHTIME], [ + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_HEADERS_ONCE([sys/time.h]) + AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec], [], + [AC_CHECK_MEMBERS([struct stat.st_birthtimensec], [], + [AC_CHECK_MEMBERS([struct stat.st_birthtim.tv_nsec], [], [], + [#include + #include ])], + [#include + #include ])], + [#include + #include ]) +]) +m4trace:m4/stat.m4:9: -1- AC_DEFUN([gl_FUNC_STAT], [ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([lstat]) + case "$host_os" in + mingw*) + dnl On this platform, the original stat() returns st_atime, st_mtime, + dnl st_ctime values that are affected by the time zone. + REPLACE_STAT=1 + ;; + *) + dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/"). + dnl (For mingw, this is due to a broken stat() override in libmingwex.a.) + dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/"). + AC_CACHE_CHECK([whether stat handles trailing slashes on files], + [gl_cv_func_stat_file_slash], + [touch conftest.tmp + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + ln -s conftest.tmp conftest.lnk + fi + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include +]], [[int result = 0; + struct stat st; + if (!stat ("conftest.tmp/", &st)) + result |= 1; +#if HAVE_LSTAT + if (!stat ("conftest.lnk/", &st)) + result |= 2; +#endif + return result; + ]])], + [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_stat_file_slash="guessing no" ;; + esac + ]) + rm -f conftest.tmp conftest.lnk]) + case $gl_cv_func_stat_file_slash in + *no) + REPLACE_STAT=1 + AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs + help when passed a file name with a trailing slash]);; + esac + ;; + esac +]) +m4trace:m4/stat.m4:64: -1- AC_DEFUN([gl_PREREQ_STAT], [ + AC_REQUIRE([gl_HEADER_SYS_STAT_H]) + : +]) +m4trace:m4/stdalign.m4:10: -1- AC_DEFUN([gl_STDALIGN_H], [ + AC_CACHE_CHECK([for working stdalign.h], + [gl_cv_header_working_stdalign_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + + /* Test that alignof yields a result consistent with offsetof. + This catches GCC bug 52023 + . */ + #ifdef __cplusplus + template struct alignof_helper { char a; t b; }; + # define ao(type) offsetof (alignof_helper, b) + #else + # define ao(type) offsetof (struct { char a; type b; }, b) + #endif + char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1]; + char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1]; + char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1]; + + /* Test _Alignas only on platforms where gnulib can help. */ + #if \ + ((defined __cplusplus && 201103 <= __cplusplus) \ + || (defined __APPLE__ && defined __MACH__ \ + ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ + : __GNUC__) \ + || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ + || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \ + || 1300 <= _MSC_VER) + struct alignas_test { char c; char alignas (8) alignas_8; }; + char test_alignas[offsetof (struct alignas_test, alignas_8) == 8 + ? 1 : -1]; + #endif + ]])], + [gl_cv_header_working_stdalign_h=yes], + [gl_cv_header_working_stdalign_h=no])]) + + if test $gl_cv_header_working_stdalign_h = yes; then + STDALIGN_H='' + else + STDALIGN_H='stdalign.h' + fi + + AC_SUBST([STDALIGN_H]) + AM_CONDITIONAL([GL_GENERATE_STDALIGN_H], [test -n "$STDALIGN_H"]) +]) +m4trace:m4/stdarg.m4:10: -1- AC_DEFUN([gl_STDARG_H], [ + STDARG_H='' + NEXT_STDARG_H='' + AC_MSG_CHECKING([for va_copy]) + AC_CACHE_VAL([gl_cv_func_va_copy], [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[ +#ifndef va_copy +void (*func) (va_list, va_list) = va_copy; +#endif + ]])], + [gl_cv_func_va_copy=yes], + [gl_cv_func_va_copy=no])]) + AC_MSG_RESULT([$gl_cv_func_va_copy]) + if test $gl_cv_func_va_copy = no; then + dnl Provide a substitute. + dnl Usually a simple definition in is enough. Not so on AIX 5 + dnl with some versions of the /usr/vac/bin/cc compiler. It has an + dnl which does '#undef va_copy', leading to a missing va_copy symbol. For + dnl this platform, we use an substitute. But we cannot use this + dnl approach on other platforms, because often defines only + dnl preprocessor macros and gl_ABSOLUTE_HEADER, gl_CHECK_NEXT_HEADERS do + dnl not work in this situation. + AC_EGREP_CPP([vaccine], + [#if defined _AIX && !defined __GNUC__ + AIX vaccine + #endif + ], [gl_aixcc=yes], [gl_aixcc=no]) + if test $gl_aixcc = yes; then + dnl Provide a substitute file. + STDARG_H=stdarg.h + gl_NEXT_HEADERS([stdarg.h]) + dnl Fallback for the case when contains only macro definitions. + if test "$gl_cv_next_stdarg_h" = '""'; then + gl_cv_next_stdarg_h='"///usr/include/stdarg.h"' + NEXT_STDARG_H="$gl_cv_next_stdarg_h" + fi + else + dnl Provide a substitute in , either __va_copy or as a simple + dnl assignment. + gl_CACHE_VAL_SILENT([gl_cv_func___va_copy], [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[ +#ifndef __va_copy +error, bail out +#endif + ]])], + [gl_cv_func___va_copy=yes], + [gl_cv_func___va_copy=no])]) + if test $gl_cv_func___va_copy = yes; then + AC_DEFINE([va_copy], [__va_copy], + [Define as a macro for copying va_list variables.]) + else + AH_VERBATIM([gl_VA_COPY], [/* A replacement for va_copy, if needed. */ +#define gl_va_copy(a,b) ((a) = (b))]) + AC_DEFINE([va_copy], [gl_va_copy], + [Define as a macro for copying va_list variables.]) + fi + fi + fi + AC_SUBST([STDARG_H]) + AM_CONDITIONAL([GL_GENERATE_STDARG_H], [test -n "$STDARG_H"]) + AC_SUBST([NEXT_STDARG_H]) +]) +m4trace:m4/stdbool.m4:12: -1- AC_DEFUN([AM_STDBOOL_H], [ + AC_REQUIRE([AC_CHECK_HEADER_STDBOOL]) + + # Define two additional variables used in the Makefile substitution. + + if test "$ac_cv_header_stdbool_h" = yes; then + STDBOOL_H='' + else + STDBOOL_H='stdbool.h' + fi + AC_SUBST([STDBOOL_H]) + AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"]) + + if test "$ac_cv_type__Bool" = yes; then + HAVE__BOOL=1 + else + HAVE__BOOL=0 + fi + AC_SUBST([HAVE__BOOL]) +]) +m4trace:m4/stdbool.m4:35: -1- AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H]) +m4trace:m4/stdbool.m4:39: -1- AC_DEFUN([AC_CHECK_HEADER_STDBOOL], [AC_CACHE_CHECK([for stdbool.h that conforms to C99], + [ac_cv_header_stdbool_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + + #ifdef __cplusplus + typedef bool Bool; + #else + typedef _Bool Bool; + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #endif + + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + Bool q = true; + Bool *pq = &q; + bool *qq = &q; + ]], + [[ + bool e = &s; + *pq |= q; *pq |= ! q; + *qq |= q; *qq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq + !qq); + ]])], + [ac_cv_header_stdbool_h=yes], + [ac_cv_header_stdbool_h=no])]) + AC_CHECK_TYPES([_Bool]) +]) +m4trace:m4/stddef_h.m4:8: -1- AC_DEFUN([gl_STDDEF_H], [ + AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) + AC_REQUIRE([gt_TYPE_WCHAR_T]) + STDDEF_H= + AC_CHECK_TYPE([max_align_t], [], [HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h], + [[#include + ]]) + if test $gt_cv_c_wchar_t = no; then + HAVE_WCHAR_T=0 + STDDEF_H=stddef.h + fi + AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions], + [gl_cv_decl_null_works], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + int test[2 * (sizeof NULL == sizeof (void *)) -1]; +]])], + [gl_cv_decl_null_works=yes], + [gl_cv_decl_null_works=no])]) + if test $gl_cv_decl_null_works = no; then + REPLACE_NULL=1 + STDDEF_H=stddef.h + fi + AC_SUBST([STDDEF_H]) + AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"]) + if test -n "$STDDEF_H"; then + gl_NEXT_HEADERS([stddef.h]) + fi +]) +m4trace:m4/stddef_h.m4:38: -1- AC_DEFUN([gl_STDDEF_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) +]) +m4trace:m4/stddef_h.m4:45: -1- AC_DEFUN([gl_STDDEF_H_DEFAULTS], [ + dnl Assume proper GNU behavior unless another module says otherwise. + REPLACE_NULL=0; AC_SUBST([REPLACE_NULL]) + HAVE_MAX_ALIGN_T=1; AC_SUBST([HAVE_MAX_ALIGN_T]) + HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T]) +]) +m4trace:m4/stdint.m4:10: -1- AC_DEFUN_ONCE([gl_STDINT_H], [ + AC_PREREQ([2.59])dnl + + AC_REQUIRE([gl_LIMITS_H]) + AC_REQUIRE([gt_TYPE_WINT_T]) + + dnl Check for long long int and unsigned long long int. + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + if test $ac_cv_type_long_long_int = yes; then + HAVE_LONG_LONG_INT=1 + else + HAVE_LONG_LONG_INT=0 + fi + AC_SUBST([HAVE_LONG_LONG_INT]) + AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) + if test $ac_cv_type_unsigned_long_long_int = yes; then + HAVE_UNSIGNED_LONG_LONG_INT=1 + else + HAVE_UNSIGNED_LONG_LONG_INT=0 + fi + AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT]) + + dnl Check for , in the same way as gl_WCHAR_H does. + AC_CHECK_HEADERS_ONCE([wchar.h]) + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + AC_SUBST([HAVE_WCHAR_H]) + + dnl Check for . + dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h. + if test $ac_cv_header_inttypes_h = yes; then + HAVE_INTTYPES_H=1 + else + HAVE_INTTYPES_H=0 + fi + AC_SUBST([HAVE_INTTYPES_H]) + + dnl Check for . + dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_sys_types_h. + if test $ac_cv_header_sys_types_h = yes; then + HAVE_SYS_TYPES_H=1 + else + HAVE_SYS_TYPES_H=0 + fi + AC_SUBST([HAVE_SYS_TYPES_H]) + + gl_CHECK_NEXT_HEADERS([stdint.h]) + if test $ac_cv_header_stdint_h = yes; then + HAVE_STDINT_H=1 + else + HAVE_STDINT_H=0 + fi + AC_SUBST([HAVE_STDINT_H]) + + dnl Now see whether we need a substitute . + if test $ac_cv_header_stdint_h = yes; then + AC_CACHE_CHECK([whether stdint.h conforms to C99], + [gl_cv_header_working_stdint_h], + [gl_cv_header_working_stdint_h=no + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 +#include +/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ +#if !(defined WCHAR_MIN && defined WCHAR_MAX) +#error "WCHAR_MIN, WCHAR_MAX not defined in " +#endif +] +gl_STDINT_INCLUDES +[ +#ifdef INT8_MAX +int8_t a1 = INT8_MAX; +int8_t a1min = INT8_MIN; +#endif +#ifdef INT16_MAX +int16_t a2 = INT16_MAX; +int16_t a2min = INT16_MIN; +#endif +#ifdef INT32_MAX +int32_t a3 = INT32_MAX; +int32_t a3min = INT32_MIN; +#endif +#ifdef INT64_MAX +int64_t a4 = INT64_MAX; +int64_t a4min = INT64_MIN; +#endif +#ifdef UINT8_MAX +uint8_t b1 = UINT8_MAX; +#else +typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; +#endif +#ifdef UINT16_MAX +uint16_t b2 = UINT16_MAX; +#endif +#ifdef UINT32_MAX +uint32_t b3 = UINT32_MAX; +#endif +#ifdef UINT64_MAX +uint64_t b4 = UINT64_MAX; +#endif +int_least8_t c1 = INT8_C (0x7f); +int_least8_t c1max = INT_LEAST8_MAX; +int_least8_t c1min = INT_LEAST8_MIN; +int_least16_t c2 = INT16_C (0x7fff); +int_least16_t c2max = INT_LEAST16_MAX; +int_least16_t c2min = INT_LEAST16_MIN; +int_least32_t c3 = INT32_C (0x7fffffff); +int_least32_t c3max = INT_LEAST32_MAX; +int_least32_t c3min = INT_LEAST32_MIN; +int_least64_t c4 = INT64_C (0x7fffffffffffffff); +int_least64_t c4max = INT_LEAST64_MAX; +int_least64_t c4min = INT_LEAST64_MIN; +uint_least8_t d1 = UINT8_C (0xff); +uint_least8_t d1max = UINT_LEAST8_MAX; +uint_least16_t d2 = UINT16_C (0xffff); +uint_least16_t d2max = UINT_LEAST16_MAX; +uint_least32_t d3 = UINT32_C (0xffffffff); +uint_least32_t d3max = UINT_LEAST32_MAX; +uint_least64_t d4 = UINT64_C (0xffffffffffffffff); +uint_least64_t d4max = UINT_LEAST64_MAX; +int_fast8_t e1 = INT_FAST8_MAX; +int_fast8_t e1min = INT_FAST8_MIN; +int_fast16_t e2 = INT_FAST16_MAX; +int_fast16_t e2min = INT_FAST16_MIN; +int_fast32_t e3 = INT_FAST32_MAX; +int_fast32_t e3min = INT_FAST32_MIN; +int_fast64_t e4 = INT_FAST64_MAX; +int_fast64_t e4min = INT_FAST64_MIN; +uint_fast8_t f1 = UINT_FAST8_MAX; +uint_fast16_t f2 = UINT_FAST16_MAX; +uint_fast32_t f3 = UINT_FAST32_MAX; +uint_fast64_t f4 = UINT_FAST64_MAX; +#ifdef INTPTR_MAX +intptr_t g = INTPTR_MAX; +intptr_t gmin = INTPTR_MIN; +#endif +#ifdef UINTPTR_MAX +uintptr_t h = UINTPTR_MAX; +#endif +intmax_t i = INTMAX_MAX; +uintmax_t j = UINTMAX_MAX; + +/* Check that SIZE_MAX has the correct type, if possible. */ +#if 201112 <= __STDC_VERSION__ +int k = _Generic (SIZE_MAX, size_t: 0); +#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) +extern size_t k; +extern __typeof__ (SIZE_MAX) k; +#endif + +#include /* for CHAR_BIT */ +#define TYPE_MINIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) +#define TYPE_MAXIMUM(t) \ + ((t) ((t) 0 < (t) -1 \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) +struct s { + int check_PTRDIFF: + PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) + && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) + ? 1 : -1; + /* Detect bug in FreeBSD 6.0 / ia64. */ + int check_SIG_ATOMIC: + SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) + && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) + ? 1 : -1; + int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; + int check_WCHAR: + WCHAR_MIN == TYPE_MINIMUM (wchar_t) + && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) + ? 1 : -1; + /* Detect bug in mingw. */ + int check_WINT: + WINT_MIN == TYPE_MINIMUM (wint_t) + && WINT_MAX == TYPE_MAXIMUM (wint_t) + ? 1 : -1; + + /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ + int check_UINT8_C: + (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; + int check_UINT16_C: + (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; + + /* Detect bugs in OpenBSD 3.9 stdint.h. */ +#ifdef UINT8_MAX + int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; +#endif +#ifdef UINT16_MAX + int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; +#endif +#ifdef UINT32_MAX + int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; +#endif +#ifdef UINT64_MAX + int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; +#endif + int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; + int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; + int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; + int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; + int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; + int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; + int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; + int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; + int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; + int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; + int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; +}; + ]])], + [dnl Determine whether the various *_MIN, *_MAX macros are usable + dnl in preprocessor expression. We could do it by compiling a test + dnl program for each of these macros. It is faster to run a program + dnl that inspects the macro expansion. + dnl This detects a bug on HP-UX 11.23/ia64. + AC_RUN_IFELSE([ + AC_LANG_PROGRAM([[ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 +#include +] +gl_STDINT_INCLUDES +[ +#include +#include +#define MVAL(macro) MVAL1(macro) +#define MVAL1(expression) #expression +static const char *macro_values[] = + { +#ifdef INT8_MAX + MVAL (INT8_MAX), +#endif +#ifdef INT16_MAX + MVAL (INT16_MAX), +#endif +#ifdef INT32_MAX + MVAL (INT32_MAX), +#endif +#ifdef INT64_MAX + MVAL (INT64_MAX), +#endif +#ifdef UINT8_MAX + MVAL (UINT8_MAX), +#endif +#ifdef UINT16_MAX + MVAL (UINT16_MAX), +#endif +#ifdef UINT32_MAX + MVAL (UINT32_MAX), +#endif +#ifdef UINT64_MAX + MVAL (UINT64_MAX), +#endif + NULL + }; +]], [[ + const char **mv; + for (mv = macro_values; *mv != NULL; mv++) + { + const char *value = *mv; + /* Test whether it looks like a cast expression. */ + if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 + || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 + || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 + || strncmp (value, "((int)"/*)*/, 6) == 0 + || strncmp (value, "((signed short)"/*)*/, 15) == 0 + || strncmp (value, "((signed char)"/*)*/, 14) == 0) + return mv - macro_values + 1; + } + return 0; +]])], + [gl_cv_header_working_stdint_h=yes], + [], + [dnl When cross-compiling, assume it works. + gl_cv_header_working_stdint_h=yes + ]) + ]) + ]) + fi + + HAVE_C99_STDINT_H=0 + HAVE_SYS_BITYPES_H=0 + HAVE_SYS_INTTYPES_H=0 + STDINT_H=stdint.h + if test "$gl_cv_header_working_stdint_h" = yes; then + HAVE_C99_STDINT_H=1 + dnl Now see whether the system works without + dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined. + AC_CACHE_CHECK([whether stdint.h predates C++11], + [gl_cv_header_stdint_predates_cxx11_h], + [gl_cv_header_stdint_predates_cxx11_h=yes + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include +] +gl_STDINT_INCLUDES +[ +intmax_t im = INTMAX_MAX; +int32_t i32 = INT32_C (0x7fffffff); + ]])], + [gl_cv_header_stdint_predates_cxx11_h=no])]) + + if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + AC_DEFINE([__STDC_CONSTANT_MACROS], [1], + [Define to 1 if the system predates C++11.]) + AC_DEFINE([__STDC_LIMIT_MACROS], [1], + [Define to 1 if the system predates C++11.]) + fi + AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.], + [gl_cv_header_stdint_width], + [gl_cv_header_stdint_width=no + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 + #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include + ]gl_STDINT_INCLUDES[ + int iw = UINTMAX_WIDTH; + ]])], + [gl_cv_header_stdint_width=yes])]) + if test "$gl_cv_header_stdint_width" = yes; then + STDINT_H= + fi + else + dnl Check for , and for + dnl (used in Linux libc4 >= 4.6.7 and libc5). + AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h]) + if test $ac_cv_header_sys_inttypes_h = yes; then + HAVE_SYS_INTTYPES_H=1 + fi + if test $ac_cv_header_sys_bitypes_h = yes; then + HAVE_SYS_BITYPES_H=1 + fi + gl_STDINT_TYPE_PROPERTIES + fi + + dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH. + LIMITS_H=limits.h + AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) + + AC_SUBST([HAVE_C99_STDINT_H]) + AC_SUBST([HAVE_SYS_BITYPES_H]) + AC_SUBST([HAVE_SYS_INTTYPES_H]) + AC_SUBST([STDINT_H]) + AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"]) +]) +m4trace:m4/stdint.m4:371: -1- AC_DEFUN([gl_STDINT_BITSIZEOF], [ + dnl Use a shell loop, to avoid bloating configure, and + dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into + dnl config.h.in, + dnl - extra AC_SUBST calls, so that the right substitutions are made. + m4_foreach_w([gltype], [$1], + [AH_TEMPLATE([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), + [Define to the number of bits in type ']gltype['.])]) + for gltype in $1 ; do + AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}], + [AC_COMPUTE_INT([result], [sizeof ($gltype) * CHAR_BIT], + [$2 +#include ], [result=unknown]) + eval gl_cv_bitsizeof_${gltype}=\$result + ]) + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + dnl Use a nonempty default, because some compilers, such as IRIX 5 cc, + dnl do a syntax check even on unused #if conditions and give an error + dnl on valid C code like this: + dnl #if 0 + dnl # if > 32 + dnl # endif + dnl #endif + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result]) + eval BITSIZEOF_${GLTYPE}=\$result + done + m4_foreach_w([gltype], [$1], + [AC_SUBST([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) +]) +m4trace:m4/stdint.m4:409: -1- AC_DEFUN([gl_CHECK_TYPES_SIGNED], [ + dnl Use a shell loop, to avoid bloating configure, and + dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into + dnl config.h.in, + dnl - extra AC_SUBST calls, so that the right substitutions are made. + m4_foreach_w([gltype], [$1], + [AH_TEMPLATE([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), + [Define to 1 if ']gltype[' is a signed integer type.])]) + for gltype in $1 ; do + AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([$2[ + int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];]])], + result=yes, result=no) + eval gl_cv_type_${gltype}_signed=\$result + ]) + eval result=\$gl_cv_type_${gltype}_signed + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + if test "$result" = yes; then + AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], [1]) + eval HAVE_SIGNED_${GLTYPE}=1 + else + eval HAVE_SIGNED_${GLTYPE}=0 + fi + done + m4_foreach_w([gltype], [$1], + [AC_SUBST([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) +]) +m4trace:m4/stdint.m4:442: -1- AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], [ + dnl Use a shell loop, to avoid bloating configure, and + dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into + dnl config.h.in, + dnl - extra AC_SUBST calls, so that the right substitutions are made. + m4_foreach_w([gltype], [$1], + [AH_TEMPLATE(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX], + [Define to l, ll, u, ul, ull, etc., as suitable for + constants of type ']gltype['.])]) + for gltype in $1 ; do + AC_CACHE_CHECK([for $gltype integer literal suffix], + [gl_cv_type_${gltype}_suffix], + [eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([$2[ + extern $gltype foo; + extern $gltype1 foo;]])], + [eval gl_cv_type_${gltype}_suffix=\$glsuf]) + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done]) + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result]) + done + m4_foreach_w([gltype], [$1], + [AC_SUBST(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])]) +]) +m4trace:m4/stdint.m4:492: -1- AC_DEFUN([gl_STDINT_INCLUDES], [[ + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif +]]) +m4trace:m4/stdint.m4:508: -1- AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], [ + AC_REQUIRE([gl_MULTIARCH]) + if test $APPLE_UNIVERSAL_BUILD = 0; then + gl_STDINT_BITSIZEOF([ptrdiff_t size_t], + [gl_STDINT_INCLUDES]) + fi + gl_STDINT_BITSIZEOF([sig_atomic_t wchar_t wint_t], + [gl_STDINT_INCLUDES]) + gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t], + [gl_STDINT_INCLUDES]) + gl_cv_type_ptrdiff_t_signed=yes + gl_cv_type_size_t_signed=no + if test $APPLE_UNIVERSAL_BUILD = 0; then + gl_INTEGER_TYPE_SUFFIX([ptrdiff_t size_t], + [gl_STDINT_INCLUDES]) + fi + gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t], + [gl_STDINT_INCLUDES]) + + dnl If wint_t is smaller than 'int', it cannot satisfy the ISO C 99 + dnl requirement that wint_t is "unchanged by default argument promotions". + dnl In this case gnulib's and override wint_t. + dnl Set the variable BITSIZEOF_WINT_T accordingly. + if test $GNULIB_OVERRIDES_WINT_T = 1; then + BITSIZEOF_WINT_T=32 + fi +]) +m4trace:m4/stdint_h.m4:12: -1- AC_DEFUN([gl_AC_HEADER_STDINT_H], [ + AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include ]], + [[uintmax_t i = (uintmax_t) -1; return !i;]])], + [gl_cv_header_stdint_h=yes], + [gl_cv_header_stdint_h=no])]) + if test $gl_cv_header_stdint_h = yes; then + AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1], + [Define if exists, doesn't clash with , + and declares uintmax_t. ]) + fi +]) +m4trace:m4/stdio_h.m4:7: -1- AC_DEFUN([gl_STDIO_H], [ + AH_VERBATIM([MINGW_ANSI_STDIO], +[/* Use GNU style printf and scanf. */ +#ifndef __USE_MINGW_ANSI_STDIO +# undef __USE_MINGW_ANSI_STDIO +#endif +]) + AC_DEFINE([__USE_MINGW_ANSI_STDIO]) + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + gl_NEXT_HEADERS([stdio.h]) + + dnl Determine whether __USE_MINGW_ANSI_STDIO makes printf and + dnl inttypes.h behave like gnu instead of system; we must give our + dnl printf wrapper the right attribute to match. + AC_CACHE_CHECK([which flavor of printf attribute matches inttypes macros], + [gl_cv_func_printf_attribute_flavor], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #define __STDC_FORMAT_MACROS 1 + #include + #include + /* For non-mingw systems, compilation will trivially succeed. + For mingw, compilation will succeed for older mingw (system + printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */ + #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; + #endif + ]])], [gl_cv_func_printf_attribute_flavor=system], + [gl_cv_func_printf_attribute_flavor=gnu])]) + if test "$gl_cv_func_printf_attribute_flavor" = gnu; then + AC_DEFINE([GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU], [1], + [Define to 1 if printf and friends should be labeled with + attribute "__gnu_printf__" instead of "__printf__"]) + fi + + dnl No need to create extra modules for these functions. Everyone who uses + dnl likely needs them. + GNULIB_FSCANF=1 + gl_MODULE_INDICATOR([fscanf]) + GNULIB_SCANF=1 + gl_MODULE_INDICATOR([scanf]) + GNULIB_FGETC=1 + GNULIB_GETC=1 + GNULIB_GETCHAR=1 + GNULIB_FGETS=1 + GNULIB_FREAD=1 + dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c" + dnl "expected source file, required through AC_LIBSOURCES, not found". It is + dnl also an optimization, to avoid performing a configure check whose result + dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING + dnl or GNULIB_NONBLOCKING redundant. + m4_ifdef([gl_NONBLOCKING_IO], [ + gl_NONBLOCKING_IO + if test $gl_cv_have_nonblocking != yes; then + REPLACE_STDIO_READ_FUNCS=1 + AC_LIBOBJ([stdio-read]) + fi + ]) + + dnl No need to create extra modules for these functions. Everyone who uses + dnl likely needs them. + GNULIB_FPRINTF=1 + GNULIB_PRINTF=1 + GNULIB_VFPRINTF=1 + GNULIB_VPRINTF=1 + GNULIB_FPUTC=1 + GNULIB_PUTC=1 + GNULIB_PUTCHAR=1 + GNULIB_FPUTS=1 + GNULIB_PUTS=1 + GNULIB_FWRITE=1 + dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c" + dnl "expected source file, required through AC_LIBSOURCES, not found". It is + dnl also an optimization, to avoid performing a configure check whose result + dnl is not used. But it does not make the test of GNULIB_STDIO_H_SIGPIPE or + dnl GNULIB_SIGPIPE redundant. + m4_ifdef([gl_SIGNAL_SIGPIPE], [ + gl_SIGNAL_SIGPIPE + if test $gl_cv_header_signal_h_SIGPIPE != yes; then + REPLACE_STDIO_WRITE_FUNCS=1 + AC_LIBOBJ([stdio-write]) + fi + ]) + dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c" + dnl "expected source file, required through AC_LIBSOURCES, not found". It is + dnl also an optimization, to avoid performing a configure check whose result + dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING + dnl or GNULIB_NONBLOCKING redundant. + m4_ifdef([gl_NONBLOCKING_IO], [ + gl_NONBLOCKING_IO + if test $gl_cv_have_nonblocking != yes; then + REPLACE_STDIO_WRITE_FUNCS=1 + AC_LIBOBJ([stdio-write]) + fi + ]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use, and which is not + dnl guaranteed by both C89 and C11. + gl_WARN_ON_USE_PREPARE([[#include + ]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen + renameat snprintf tmpfile vdprintf vsnprintf]) +]) +m4trace:m4/stdio_h.m4:112: -1- AC_DEFUN([gl_STDIO_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) +m4trace:m4/stdio_h.m4:121: -1- AC_DEFUN([gl_STDIO_H_DEFAULTS], [ + GNULIB_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF]) + GNULIB_FCLOSE=0; AC_SUBST([GNULIB_FCLOSE]) + GNULIB_FDOPEN=0; AC_SUBST([GNULIB_FDOPEN]) + GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH]) + GNULIB_FGETC=0; AC_SUBST([GNULIB_FGETC]) + GNULIB_FGETS=0; AC_SUBST([GNULIB_FGETS]) + GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN]) + GNULIB_FPRINTF=0; AC_SUBST([GNULIB_FPRINTF]) + GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX]) + GNULIB_FPURGE=0; AC_SUBST([GNULIB_FPURGE]) + GNULIB_FPUTC=0; AC_SUBST([GNULIB_FPUTC]) + GNULIB_FPUTS=0; AC_SUBST([GNULIB_FPUTS]) + GNULIB_FREAD=0; AC_SUBST([GNULIB_FREAD]) + GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN]) + GNULIB_FSCANF=0; AC_SUBST([GNULIB_FSCANF]) + GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK]) + GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO]) + GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL]) + GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO]) + GNULIB_FWRITE=0; AC_SUBST([GNULIB_FWRITE]) + GNULIB_GETC=0; AC_SUBST([GNULIB_GETC]) + GNULIB_GETCHAR=0; AC_SUBST([GNULIB_GETCHAR]) + GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM]) + GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE]) + GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF]) + GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX]) + GNULIB_PCLOSE=0; AC_SUBST([GNULIB_PCLOSE]) + GNULIB_PERROR=0; AC_SUBST([GNULIB_PERROR]) + GNULIB_POPEN=0; AC_SUBST([GNULIB_POPEN]) + GNULIB_PRINTF=0; AC_SUBST([GNULIB_PRINTF]) + GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX]) + GNULIB_PUTC=0; AC_SUBST([GNULIB_PUTC]) + GNULIB_PUTCHAR=0; AC_SUBST([GNULIB_PUTCHAR]) + GNULIB_PUTS=0; AC_SUBST([GNULIB_PUTS]) + GNULIB_REMOVE=0; AC_SUBST([GNULIB_REMOVE]) + GNULIB_RENAME=0; AC_SUBST([GNULIB_RENAME]) + GNULIB_RENAMEAT=0; AC_SUBST([GNULIB_RENAMEAT]) + GNULIB_SCANF=0; AC_SUBST([GNULIB_SCANF]) + GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF]) + GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX]) + GNULIB_STDIO_H_NONBLOCKING=0; AC_SUBST([GNULIB_STDIO_H_NONBLOCKING]) + GNULIB_STDIO_H_SIGPIPE=0; AC_SUBST([GNULIB_STDIO_H_SIGPIPE]) + GNULIB_TMPFILE=0; AC_SUBST([GNULIB_TMPFILE]) + GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF]) + GNULIB_VFSCANF=0; AC_SUBST([GNULIB_VFSCANF]) + GNULIB_VSCANF=0; AC_SUBST([GNULIB_VSCANF]) + GNULIB_VDPRINTF=0; AC_SUBST([GNULIB_VDPRINTF]) + GNULIB_VFPRINTF=0; AC_SUBST([GNULIB_VFPRINTF]) + GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX]) + GNULIB_VPRINTF=0; AC_SUBST([GNULIB_VPRINTF]) + GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX]) + GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF]) + GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DECL_FPURGE=1; AC_SUBST([HAVE_DECL_FPURGE]) + HAVE_DECL_FSEEKO=1; AC_SUBST([HAVE_DECL_FSEEKO]) + HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO]) + HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM]) + HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE]) + HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF]) + HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF]) + HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF]) + HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF]) + HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO]) + HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO]) + HAVE_PCLOSE=1; AC_SUBST([HAVE_PCLOSE]) + HAVE_POPEN=1; AC_SUBST([HAVE_POPEN]) + HAVE_RENAMEAT=1; AC_SUBST([HAVE_RENAMEAT]) + HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF]) + HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF]) + REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF]) + REPLACE_FCLOSE=0; AC_SUBST([REPLACE_FCLOSE]) + REPLACE_FDOPEN=0; AC_SUBST([REPLACE_FDOPEN]) + REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH]) + REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN]) + REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF]) + REPLACE_FPURGE=0; AC_SUBST([REPLACE_FPURGE]) + REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN]) + REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK]) + REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO]) + REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL]) + REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO]) + REPLACE_GETDELIM=0; AC_SUBST([REPLACE_GETDELIM]) + REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE]) + REPLACE_OBSTACK_PRINTF=0; AC_SUBST([REPLACE_OBSTACK_PRINTF]) + REPLACE_PERROR=0; AC_SUBST([REPLACE_PERROR]) + REPLACE_POPEN=0; AC_SUBST([REPLACE_POPEN]) + REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF]) + REPLACE_REMOVE=0; AC_SUBST([REPLACE_REMOVE]) + REPLACE_RENAME=0; AC_SUBST([REPLACE_RENAME]) + REPLACE_RENAMEAT=0; AC_SUBST([REPLACE_RENAMEAT]) + REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF]) + REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF]) + REPLACE_STDIO_READ_FUNCS=0; AC_SUBST([REPLACE_STDIO_READ_FUNCS]) + REPLACE_STDIO_WRITE_FUNCS=0; AC_SUBST([REPLACE_STDIO_WRITE_FUNCS]) + REPLACE_TMPFILE=0; AC_SUBST([REPLACE_TMPFILE]) + REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF]) + REPLACE_VDPRINTF=0; AC_SUBST([REPLACE_VDPRINTF]) + REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF]) + REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF]) + REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF]) + REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF]) +]) +m4trace:m4/stdlib_h.m4:7: -1- AC_DEFUN([gl_STDLIB_H], [ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + gl_NEXT_HEADERS([stdlib.h]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use, and which is not + dnl guaranteed by C89. + gl_WARN_ON_USE_PREPARE([[#include +#if HAVE_SYS_LOADAVG_H +# include +#endif +#if HAVE_RANDOM_H +# include +#endif + ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt + initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps + posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch + secure_getenv setenv setstate setstate_r srandom srandom_r + strtod strtoll strtoull unlockpt unsetenv]) +]) +m4trace:m4/stdlib_h.m4:29: -1- AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) +m4trace:m4/stdlib_h.m4:38: -1- AC_DEFUN([gl_STDLIB_H_DEFAULTS], [ + GNULIB__EXIT=0; AC_SUBST([GNULIB__EXIT]) + GNULIB_ATOLL=0; AC_SUBST([GNULIB_ATOLL]) + GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX]) + GNULIB_CANONICALIZE_FILE_NAME=0; AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME]) + GNULIB_GETLOADAVG=0; AC_SUBST([GNULIB_GETLOADAVG]) + GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) + GNULIB_GRANTPT=0; AC_SUBST([GNULIB_GRANTPT]) + GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX]) + GNULIB_MBTOWC=0; AC_SUBST([GNULIB_MBTOWC]) + GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP]) + GNULIB_MKOSTEMP=0; AC_SUBST([GNULIB_MKOSTEMP]) + GNULIB_MKOSTEMPS=0; AC_SUBST([GNULIB_MKOSTEMPS]) + GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP]) + GNULIB_MKSTEMPS=0; AC_SUBST([GNULIB_MKSTEMPS]) + GNULIB_POSIX_OPENPT=0; AC_SUBST([GNULIB_POSIX_OPENPT]) + GNULIB_PTSNAME=0; AC_SUBST([GNULIB_PTSNAME]) + GNULIB_PTSNAME_R=0; AC_SUBST([GNULIB_PTSNAME_R]) + GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV]) + GNULIB_QSORT_R=0; AC_SUBST([GNULIB_QSORT_R]) + GNULIB_RANDOM=0; AC_SUBST([GNULIB_RANDOM]) + GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R]) + GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX]) + GNULIB_REALPATH=0; AC_SUBST([GNULIB_REALPATH]) + GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH]) + GNULIB_SECURE_GETENV=0; AC_SUBST([GNULIB_SECURE_GETENV]) + GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV]) + GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD]) + GNULIB_STRTOLL=0; AC_SUBST([GNULIB_STRTOLL]) + GNULIB_STRTOULL=0; AC_SUBST([GNULIB_STRTOULL]) + GNULIB_SYSTEM_POSIX=0; AC_SUBST([GNULIB_SYSTEM_POSIX]) + GNULIB_UNLOCKPT=0; AC_SUBST([GNULIB_UNLOCKPT]) + GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV]) + GNULIB_WCTOMB=0; AC_SUBST([GNULIB_WCTOMB]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE__EXIT=1; AC_SUBST([HAVE__EXIT]) + HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL]) + HAVE_CANONICALIZE_FILE_NAME=1; AC_SUBST([HAVE_CANONICALIZE_FILE_NAME]) + HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG]) + HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) + HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT]) + HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP]) + HAVE_MKOSTEMP=1; AC_SUBST([HAVE_MKOSTEMP]) + HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS]) + HAVE_MKSTEMP=1; AC_SUBST([HAVE_MKSTEMP]) + HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS]) + HAVE_POSIX_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT]) + HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME]) + HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R]) + HAVE_QSORT_R=1; AC_SUBST([HAVE_QSORT_R]) + HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM]) + HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H]) + HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R]) + HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH]) + HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH]) + HAVE_SECURE_GETENV=1; AC_SUBST([HAVE_SECURE_GETENV]) + HAVE_SETENV=1; AC_SUBST([HAVE_SETENV]) + HAVE_DECL_SETENV=1; AC_SUBST([HAVE_DECL_SETENV]) + HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD]) + HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL]) + HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL]) + HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA]) + HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H]) + HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT]) + HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV]) + REPLACE_CALLOC=0; AC_SUBST([REPLACE_CALLOC]) + REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME]) + REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC]) + REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC]) + REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) + REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME]) + REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R]) + REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) + REPLACE_QSORT_R=0; AC_SUBST([REPLACE_QSORT_R]) + REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R]) + REPLACE_REALLOC=0; AC_SUBST([REPLACE_REALLOC]) + REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH]) + REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV]) + REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD]) + REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV]) + REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB]) +]) +m4trace:m4/strcase.m4:7: -1- AC_DEFUN([gl_STRCASE], [ + gl_FUNC_STRCASECMP + gl_FUNC_STRNCASECMP +]) +m4trace:m4/strcase.m4:13: -1- AC_DEFUN([gl_FUNC_STRCASECMP], [ + AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + AC_CHECK_FUNCS([strcasecmp]) + if test $ac_cv_func_strcasecmp = no; then + HAVE_STRCASECMP=0 + fi +]) +m4trace:m4/strcase.m4:22: -1- AC_DEFUN([gl_FUNC_STRNCASECMP], [ + AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + AC_CHECK_FUNCS([strncasecmp]) + if test $ac_cv_func_strncasecmp = yes; then + HAVE_STRNCASECMP=1 + else + HAVE_STRNCASECMP=0 + fi + AC_CHECK_DECLS([strncasecmp]) + if test $ac_cv_have_decl_strncasecmp = no; then + HAVE_DECL_STRNCASECMP=0 + fi +]) +m4trace:m4/strcase.m4:38: -1- AC_DEFUN([gl_PREREQ_STRCASECMP], [ + : +]) +m4trace:m4/strcase.m4:43: -1- AC_DEFUN([gl_PREREQ_STRNCASECMP], [ + : +]) +m4trace:m4/strerror.m4:7: -1- AC_DEFUN([gl_FUNC_STRERROR], [ + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_HEADER_ERRNO_H]) + AC_REQUIRE([gl_FUNC_STRERROR_0]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [ + AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS]) + ]) + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + AC_CACHE_CHECK([for working strerror function], + [gl_cv_func_working_strerror], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[if (!*strerror (-2)) return 1;]])], + [gl_cv_func_working_strerror=yes], + [gl_cv_func_working_strerror=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_working_strerror="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_strerror="guessing no" ;; + esac + ]) + ]) + case "$gl_cv_func_working_strerror" in + *yes) ;; + *) + dnl The system's strerror() fails to return a string for out-of-range + dnl integers. Replace it. + REPLACE_STRERROR=1 + ;; + esac + m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [ + dnl If the system's strerror_r or __xpg_strerror_r clobbers strerror's + dnl buffer, we must replace strerror. + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR=1 ;; + esac + ]) + else + dnl The system's strerror() cannot know about the new errno values we add + dnl to , or any fix for strerror(0). Replace it. + REPLACE_STRERROR=1 + fi +]) +m4trace:m4/strerror.m4:58: -1- AC_DEFUN([gl_FUNC_STRERROR_0], [ + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + REPLACE_STRERROR_0=0 + AC_CACHE_CHECK([whether strerror(0) succeeds], + [gl_cv_func_strerror_0_works], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + ]], + [[int result = 0; + char *str; + errno = 0; + str = strerror (0); + if (!*str) result |= 1; + if (errno) result |= 2; + if (strstr (str, "nknown") || strstr (str, "ndefined")) + result |= 4; + return result;]])], + [gl_cv_func_strerror_0_works=yes], + [gl_cv_func_strerror_0_works=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_strerror_0_works="guessing no" ;; + esac + ]) + ]) + case "$gl_cv_func_strerror_0_works" in + *yes) ;; + *) + REPLACE_STRERROR_0=1 + AC_DEFINE([REPLACE_STRERROR_0], [1], [Define to 1 if strerror(0) + does not return a message implying success.]) + ;; + esac +]) +m4trace:m4/strerror_r.m4:7: -1- AC_DEFUN([gl_FUNC_STRERROR_R], [ + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS]) + + dnl Persuade Solaris to declare strerror_r(). + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + dnl Some systems don't declare strerror_r() if _THREAD_SAFE and _REENTRANT + dnl are not defined. + AC_CHECK_DECLS_ONCE([strerror_r]) + if test $ac_cv_have_decl_strerror_r = no; then + HAVE_DECL_STRERROR_R=0 + fi + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + if test $gl_cv_func_strerror_r_posix_signature = yes; then + case "$gl_cv_func_strerror_r_works" in + dnl The system's strerror_r has bugs. Replace it. + *no) REPLACE_STRERROR_R=1 ;; + esac + else + dnl The system's strerror_r() has a wrong signature. Replace it. + REPLACE_STRERROR_R=1 + fi + else + dnl The system's strerror_r() cannot know about the new errno values we + dnl add to , or any fix for strerror(0). Replace it. + REPLACE_STRERROR_R=1 + fi + fi +]) +m4trace:m4/strerror_r.m4:42: -1- AC_DEFUN([gl_PREREQ_STRERROR_R], [ + dnl glibc >= 2.3.4 and cygwin 1.7.9 have a function __xpg_strerror_r. + AC_CHECK_FUNCS_ONCE([__xpg_strerror_r]) + AC_CHECK_FUNCS_ONCE([catgets]) + AC_CHECK_FUNCS_ONCE([snprintf]) +]) +m4trace:m4/strerror_r.m4:51: -1- AC_DEFUN([gl_FUNC_STRERROR_R_WORKS], [ + AC_REQUIRE([gl_HEADER_ERRNO_H]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_FUNC_STRERROR_0]) + + AC_CHECK_FUNCS_ONCE([strerror_r]) + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + dnl The POSIX prototype is: int strerror_r (int, char *, size_t); + dnl glibc, Cygwin: char *strerror_r (int, char *, size_t); + dnl AIX 5.1, OSF/1 5.1: int strerror_r (int, char *, int); + AC_CACHE_CHECK([for strerror_r with POSIX signature], + [gl_cv_func_strerror_r_posix_signature], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + int strerror_r (int, char *, size_t); + ]], + [])], + [gl_cv_func_strerror_r_posix_signature=yes], + [gl_cv_func_strerror_r_posix_signature=no]) + ]) + if test $gl_cv_func_strerror_r_posix_signature = yes; then + dnl AIX 6.1 strerror_r fails by returning -1, not an error number. + dnl HP-UX 11.31 strerror_r always fails when the buffer length argument + dnl is less than 80. + dnl FreeBSD 8.s strerror_r claims failure on 0 + dnl Mac OS X 10.5 strerror_r treats 0 like -1 + dnl Solaris 10 strerror_r corrupts errno on failure + AC_CACHE_CHECK([whether strerror_r works], + [gl_cv_func_strerror_r_works], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + ]], + [[int result = 0; + char buf[79]; + if (strerror_r (EACCES, buf, 0) < 0) + result |= 1; + errno = 0; + if (strerror_r (EACCES, buf, sizeof buf) != 0) + result |= 2; + strcpy (buf, "Unknown"); + if (strerror_r (0, buf, sizeof buf) != 0) + result |= 4; + if (errno) + result |= 8; + if (strstr (buf, "nknown") || strstr (buf, "ndefined")) + result |= 0x10; + errno = 0; + *buf = 0; + if (strerror_r (-3, buf, sizeof buf) < 0) + result |= 0x20; + if (errno) + result |= 0x40; + if (!*buf) + result |= 0x80; + return result; + ]])], + [gl_cv_func_strerror_r_works=yes], + [gl_cv_func_strerror_r_works=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess no on AIX. + aix*) gl_cv_func_strerror_r_works="guessing no";; + # Guess no on HP-UX. + hpux*) gl_cv_func_strerror_r_works="guessing no";; + # Guess no on BSD variants. + *bsd*) gl_cv_func_strerror_r_works="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_strerror_r_works="guessing yes";; + esac +changequote([,])dnl + ]) + ]) + else + dnl The system's strerror() has a wrong signature. + dnl glibc >= 2.3.4 and cygwin 1.7.9 have a function __xpg_strerror_r. + AC_CHECK_FUNCS_ONCE([__xpg_strerror_r]) + dnl In glibc < 2.14, __xpg_strerror_r does not populate buf on failure. + dnl In cygwin < 1.7.10, __xpg_strerror_r clobbers strerror's buffer. + if test $ac_cv_func___xpg_strerror_r = yes; then + AC_CACHE_CHECK([whether __xpg_strerror_r works], + [gl_cv_func_strerror_r_works], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + extern + #ifdef __cplusplus + "C" + #endif + int __xpg_strerror_r(int, char *, size_t); + ]], + [[int result = 0; + char buf[256] = "^"; + char copy[256]; + char *str = strerror (-1); + strcpy (copy, str); + if (__xpg_strerror_r (-2, buf, 1) == 0) + result |= 1; + if (*buf) + result |= 2; + __xpg_strerror_r (-2, buf, 256); + if (strcmp (str, copy)) + result |= 4; + return result; + ]])], + [gl_cv_func_strerror_r_works=yes], + [gl_cv_func_strerror_r_works=no], + [dnl Guess no on all platforms that have __xpg_strerror_r, + dnl at least until fixed glibc and cygwin are more common. + gl_cv_func_strerror_r_works="guessing no" + ]) + ]) + fi + fi + fi + fi +]) +m4trace:m4/strftime.m4:11: -1- AC_DEFUN([gl_FUNC_GNU_STRFTIME], [ + # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE. + AC_REQUIRE([AC_STRUCT_TIMEZONE]) + + AC_REQUIRE([gl_TM_GMTOFF]) + + AC_CHECK_FUNCS_ONCE([tzset]) + + AC_DEFINE([my_strftime], [nstrftime], + [Define to the name of the strftime replacement function.]) +]) +m4trace:m4/string_h.m4:12: -1- AC_DEFUN([gl_HEADER_STRING_H], [ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_HEADER_STRING_H_BODY]) +]) +m4trace:m4/string_h.m4:19: -1- AC_DEFUN([gl_HEADER_STRING_H_BODY], [ + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + gl_NEXT_HEADERS([string.h]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use, and which is not + dnl guaranteed by C89. + gl_WARN_ON_USE_PREPARE([[#include + ]], + [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul + strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r + strerror_r strsignal strverscmp]) +]) +m4trace:m4/string_h.m4:35: -1- AC_DEFUN([gl_STRING_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) +m4trace:m4/string_h.m4:44: -1- AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], [ + GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL]) + GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL]) + GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR]) + GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) + GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) + GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR]) + GNULIB_RAWMEMCHR=0; AC_SUBST([GNULIB_RAWMEMCHR]) + GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY]) + GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY]) + GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL]) + GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP]) + GNULIB_STRNCAT=0; AC_SUBST([GNULIB_STRNCAT]) + GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP]) + GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN]) + GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK]) + GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP]) + GNULIB_STRSTR=0; AC_SUBST([GNULIB_STRSTR]) + GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR]) + GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R]) + GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN]) + GNULIB_MBSNLEN=0; AC_SUBST([GNULIB_MBSNLEN]) + GNULIB_MBSCHR=0; AC_SUBST([GNULIB_MBSCHR]) + GNULIB_MBSRCHR=0; AC_SUBST([GNULIB_MBSRCHR]) + GNULIB_MBSSTR=0; AC_SUBST([GNULIB_MBSSTR]) + GNULIB_MBSCASECMP=0; AC_SUBST([GNULIB_MBSCASECMP]) + GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP]) + GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP]) + GNULIB_MBSCASESTR=0; AC_SUBST([GNULIB_MBSCASESTR]) + GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN]) + GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK]) + GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN]) + GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP]) + GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) + GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR]) + GNULIB_STRERROR_R=0; AC_SUBST([GNULIB_STRERROR_R]) + GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL]) + GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP]) + HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_FFSL=1; AC_SUBST([HAVE_FFSL]) + HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL]) + HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR]) + HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM]) + HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY]) + HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR]) + HAVE_RAWMEMCHR=1; AC_SUBST([HAVE_RAWMEMCHR]) + HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY]) + HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY]) + HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL]) + HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP]) + HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP]) + HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN]) + HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK]) + HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP]) + HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR]) + HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R]) + HAVE_DECL_STRERROR_R=1; AC_SUBST([HAVE_DECL_STRERROR_R]) + HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL]) + HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP]) + REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR]) + REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM]) + REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY]) + REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP]) + REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR]) + REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR]) + REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL]) + REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR]) + REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R]) + REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT]) + REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP]) + REPLACE_STRNLEN=0; AC_SUBST([REPLACE_STRNLEN]) + REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL]) + REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R]) + UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R]) +]) +m4trace:m4/strings_h.m4:9: -1- AC_DEFUN([gl_HEADER_STRINGS_H], [ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_HEADER_STRINGS_H_BODY]) +]) +m4trace:m4/strings_h.m4:16: -1- AC_DEFUN([gl_HEADER_STRINGS_H_BODY], [ + AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + + gl_CHECK_NEXT_HEADERS([strings.h]) + if test $ac_cv_header_strings_h = yes; then + HAVE_STRINGS_H=1 + else + HAVE_STRINGS_H=0 + fi + AC_SUBST([HAVE_STRINGS_H]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ + /* Minix 3.1.8 has a bug: must be included before + . */ + #include + #include + ]], [ffs strcasecmp strncasecmp]) +]) +m4trace:m4/strings_h.m4:38: -1- AC_DEFUN([gl_STRINGS_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) +]) +m4trace:m4/strings_h.m4:45: -1- AC_DEFUN([gl_HEADER_STRINGS_H_DEFAULTS], [ + GNULIB_FFS=0; AC_SUBST([GNULIB_FFS]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_FFS=1; AC_SUBST([HAVE_FFS]) + HAVE_STRCASECMP=1; AC_SUBST([HAVE_STRCASECMP]) + HAVE_DECL_STRNCASECMP=1; AC_SUBST([HAVE_DECL_STRNCASECMP]) +]) +m4trace:m4/strndup.m4:7: -1- AC_DEFUN([gl_FUNC_STRNDUP], [ + dnl Persuade glibc to declare strndup(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_CHECK_DECLS_ONCE([strndup]) + AC_CHECK_FUNCS_ONCE([strndup]) + if test $ac_cv_have_decl_strndup = no; then + HAVE_DECL_STRNDUP=0 + fi + + if test $ac_cv_func_strndup = yes; then + HAVE_STRNDUP=1 + # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. + AC_CACHE_CHECK([for working strndup], [gl_cv_func_strndup_works], + [AC_RUN_IFELSE([ + AC_LANG_PROGRAM([[#include + #include ]], [[ +#if !HAVE_DECL_STRNDUP + extern + #ifdef __cplusplus + "C" + #endif + char *strndup (const char *, size_t); +#endif + int result; + char *s; + s = strndup ("some longer string", 15); + free (s); + s = strndup ("shorter string", 13); + result = s[13] != '\0'; + free (s); + return result;]])], + [gl_cv_func_strndup_works=yes], + [gl_cv_func_strndup_works=no], + [ +changequote(,)dnl + case $host_os in + aix | aix[3-6]*) gl_cv_func_strndup_works="guessing no";; + *) gl_cv_func_strndup_works="guessing yes";; + esac +changequote([,])dnl + ])]) + case $gl_cv_func_strndup_works in + *no) REPLACE_STRNDUP=1 ;; + esac + else + HAVE_STRNDUP=0 + fi +]) +m4trace:m4/strnlen.m4:8: -1- AC_DEFUN([gl_FUNC_STRNLEN], [ + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + + dnl Persuade glibc to declare strnlen(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + AC_CHECK_DECLS_ONCE([strnlen]) + if test $ac_cv_have_decl_strnlen = no; then + HAVE_DECL_STRNLEN=0 + else + m4_pushdef([AC_LIBOBJ], [:]) + dnl Note: AC_FUNC_STRNLEN does AC_LIBOBJ([strnlen]). + AC_FUNC_STRNLEN + m4_popdef([AC_LIBOBJ]) + if test $ac_cv_func_strnlen_working = no; then + REPLACE_STRNLEN=1 + fi + fi +]) +m4trace:m4/strnlen.m4:30: -1- AC_DEFUN([gl_PREREQ_STRNLEN], [:]) +m4trace:m4/strptime.m4:7: -1- AC_DEFUN([gl_FUNC_STRPTIME], [ + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([AC_C_RESTRICT]) + AC_CHECK_FUNCS_ONCE([strptime]) + if test $ac_cv_func_strptime != yes; then + HAVE_STRPTIME=0 + fi +]) +m4trace:m4/strptime.m4:18: -1- AC_DEFUN([gl_PREREQ_STRPTIME], [ + AC_REQUIRE([gl_TM_GMTOFF]) + : +]) +m4trace:m4/strtoull.m4:7: -1- AC_DEFUN([gl_FUNC_STRTOULL], [ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + dnl We don't need (and can't compile) the replacement strtoull + dnl unless the type 'unsigned long long int' exists. + AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) + if test "$ac_cv_type_unsigned_long_long_int" = yes; then + AC_CHECK_FUNCS([strtoull]) + if test $ac_cv_func_strtoull = no; then + HAVE_STRTOULL=0 + fi + fi +]) +m4trace:m4/strtoull.m4:22: -1- AC_DEFUN([gl_PREREQ_STRTOULL], [ + : +]) +m4trace:m4/strtoumax.m4:7: -1- AC_DEFUN([gl_FUNC_STRTOUMAX], [ + AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) + + dnl On OSF/1 5.1 with cc, this function is declared but not defined. + AC_CHECK_FUNCS_ONCE([strtoumax]) + AC_CHECK_DECLS_ONCE([strtoumax]) + if test "$ac_cv_have_decl_strtoumax" = yes; then + if test "$ac_cv_func_strtoumax" != yes; then + # HP-UX 11.11 has "#define strtoimax(...) ..." but no function. + REPLACE_STRTOUMAX=1 + fi + else + HAVE_DECL_STRTOUMAX=0 + fi +]) +m4trace:m4/strtoumax.m4:25: -1- AC_DEFUN([gl_PREREQ_STRTOUMAX], [ + AC_CHECK_DECLS([strtoull]) + AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) +]) +m4trace:m4/symlink.m4:11: -1- AC_DEFUN([gl_FUNC_SYMLINK], [ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CHECK_FUNCS_ONCE([symlink]) + dnl The best we can do on mingw is provide a dummy that always fails, so + dnl that compilation can proceed with fewer ifdefs. On FreeBSD 7.2, AIX 7.1, + dnl and Solaris 9, we want to fix a bug with trailing slash handling. + if test $ac_cv_func_symlink = no; then + HAVE_SYMLINK=0 + else + AC_CACHE_CHECK([whether symlink handles trailing slash correctly], + [gl_cv_func_symlink_works], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[int result = 0; + if (!symlink ("a", "conftest.link/")) + result |= 1; + if (symlink ("conftest.f", "conftest.lnk2")) + result |= 2; + else if (!symlink ("a", "conftest.lnk2/")) + result |= 4; + return result; + ]])], + [gl_cv_func_symlink_works=yes], [gl_cv_func_symlink_works=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_symlink_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_symlink_works="guessing no" ;; + esac + ]) + rm -f conftest.f conftest.link conftest.lnk2]) + case "$gl_cv_func_symlink_works" in + *yes) ;; + *) + REPLACE_SYMLINK=1 + ;; + esac + fi +]) +m4trace:m4/sys_ioctl_h.m4:9: -1- AC_DEFUN([gl_SYS_IOCTL_H], [ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS]) + + AC_CHECK_HEADERS_ONCE([sys/ioctl.h]) + if test $ac_cv_header_sys_ioctl_h = yes; then + HAVE_SYS_IOCTL_H=1 + dnl Test whether declares ioctl(), or whether some other + dnl header file, such as or , is needed for that. + AC_CACHE_CHECK([whether declares ioctl], + [gl_cv_decl_ioctl_in_sys_ioctl_h], + [dnl We cannot use AC_CHECK_DECL because it produces its own messages. + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [AC_INCLUDES_DEFAULT([#include ])], + [(void) ioctl;])], + [gl_cv_decl_ioctl_in_sys_ioctl_h=yes], + [gl_cv_decl_ioctl_in_sys_ioctl_h=no]) + ]) + else + HAVE_SYS_IOCTL_H=0 + fi + AC_SUBST([HAVE_SYS_IOCTL_H]) + dnl is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([sys/ioctl.h]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include +/* Some platforms declare ioctl in the wrong header. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +#endif + ]], [ioctl]) +]) +m4trace:m4/sys_ioctl_h.m4:47: -1- AC_DEFUN([gl_SYS_IOCTL_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) +m4trace:m4/sys_ioctl_h.m4:56: -1- AC_DEFUN([gl_SYS_IOCTL_H_DEFAULTS], [ + GNULIB_IOCTL=0; AC_SUBST([GNULIB_IOCTL]) + dnl Assume proper GNU behavior unless another module says otherwise. + SYS_IOCTL_H_HAVE_WINSOCK2_H=0; AC_SUBST([SYS_IOCTL_H_HAVE_WINSOCK2_H]) + SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; + AC_SUBST([SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS]) + REPLACE_IOCTL=0; AC_SUBST([REPLACE_IOCTL]) +]) +m4trace:m4/sys_select_h.m4:7: -1- AC_DEFUN([gl_HEADER_SYS_SELECT], [ + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([gl_SYS_SELECT_H_DEFAULTS]) + AC_CACHE_CHECK([whether is self-contained], + [gl_cv_header_sys_select_h_selfcontained], + [ + dnl Test against two bugs: + dnl 1. On many platforms, assumes prior inclusion of + dnl . + dnl 2. On OSF/1 4.0, provides only a forward declaration + dnl of 'struct timeval', and no definition of this type. + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[struct timeval b;]])], + [gl_cv_header_sys_select_h_selfcontained=yes], + [gl_cv_header_sys_select_h_selfcontained=no]) + dnl Test against another bug: + dnl 3. On Solaris 10, provides an FD_ZERO implementation + dnl that relies on memset(), but without including . + if test $gl_cv_header_sys_select_h_selfcontained = yes; then + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include ]], + [[int memset; int bzero;]]) + ], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include ]], [[ + #undef memset + #define memset nonexistent_memset + extern + #ifdef __cplusplus + "C" + #endif + void *memset (void *, int, unsigned long); + #undef bzero + #define bzero nonexistent_bzero + extern + #ifdef __cplusplus + "C" + #endif + void bzero (void *, unsigned long); + fd_set fds; + FD_ZERO (&fds); + ]]) + ], + [], + [gl_cv_header_sys_select_h_selfcontained=no]) + ]) + fi + ]) + dnl is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([sys/select.h]) + if test $ac_cv_header_sys_select_h = yes; then + HAVE_SYS_SELECT_H=1 + else + HAVE_SYS_SELECT_H=0 + fi + AC_SUBST([HAVE_SYS_SELECT_H]) + gl_PREREQ_SYS_H_WINSOCK2 + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ +/* Some systems require prerequisite headers. */ +#include +#if !(defined __GLIBC__ && !defined __UCLIBC__) && HAVE_SYS_TIME_H +# include +#endif +#include + ]], [pselect select]) +]) +m4trace:m4/sys_select_h.m4:78: -1- AC_DEFUN([gl_SYS_SELECT_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_SELECT_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) +m4trace:m4/sys_select_h.m4:87: -1- AC_DEFUN([gl_SYS_SELECT_H_DEFAULTS], [ + GNULIB_PSELECT=0; AC_SUBST([GNULIB_PSELECT]) + GNULIB_SELECT=0; AC_SUBST([GNULIB_SELECT]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_PSELECT=1; AC_SUBST([HAVE_PSELECT]) + REPLACE_PSELECT=0; AC_SUBST([REPLACE_PSELECT]) + REPLACE_SELECT=0; AC_SUBST([REPLACE_SELECT]) +]) +m4trace:m4/sys_socket_h.m4:9: -1- AC_DEFUN([gl_HEADER_SYS_SOCKET], [ + AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + + dnl On OSF/1, the functions recv(), send(), recvfrom(), sendto() have + dnl old-style declarations (with return type 'int' instead of 'ssize_t') + dnl unless _POSIX_PII_SOCKET is defined. + case "$host_os" in + osf*) + AC_DEFINE([_POSIX_PII_SOCKET], [1], + [Define to 1 in order to get the POSIX compatible declarations + of socket functions.]) + ;; + esac + + AC_CACHE_CHECK([whether is self-contained], + [gl_cv_header_sys_socket_h_selfcontained], + [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[]])], + [gl_cv_header_sys_socket_h_selfcontained=yes], + [gl_cv_header_sys_socket_h_selfcontained=no]) + ]) + if test $gl_cv_header_sys_socket_h_selfcontained = yes; then + dnl If the shutdown function exists, should define + dnl SHUT_RD, SHUT_WR, SHUT_RDWR. + AC_CHECK_FUNCS([shutdown]) + if test $ac_cv_func_shutdown = yes; then + AC_CACHE_CHECK([whether defines the SHUT_* macros], + [gl_cv_header_sys_socket_h_shut], + [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include ]], + [[int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };]])], + [gl_cv_header_sys_socket_h_shut=yes], + [gl_cv_header_sys_socket_h_shut=no]) + ]) + if test $gl_cv_header_sys_socket_h_shut = no; then + SYS_SOCKET_H='sys/socket.h' + fi + fi + fi + # We need to check for ws2tcpip.h now. + gl_PREREQ_SYS_H_SOCKET + AC_CHECK_TYPES([struct sockaddr_storage, sa_family_t],,,[ + /* sys/types.h is not needed according to POSIX, but the + sys/socket.h in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif +]) + if test $ac_cv_type_struct_sockaddr_storage = no; then + HAVE_STRUCT_SOCKADDR_STORAGE=0 + fi + if test $ac_cv_type_sa_family_t = no; then + HAVE_SA_FAMILY_T=0 + fi + if test $ac_cv_type_struct_sockaddr_storage != no; then + AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], + [], + [HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0], + [#include + #ifdef HAVE_SYS_SOCKET_H + #include + #endif + #ifdef HAVE_WS2TCPIP_H + #include + #endif + ]) + fi + if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \ + || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then + SYS_SOCKET_H='sys/socket.h' + fi + gl_PREREQ_SYS_H_WINSOCK2 + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ +/* Some systems require prerequisite headers. */ +#include +#include + ]], [socket connect accept bind getpeername getsockname getsockopt + listen recv send recvfrom sendto setsockopt shutdown accept4]) +]) +m4trace:m4/sys_socket_h.m4:100: -1- AC_DEFUN([gl_PREREQ_SYS_H_SOCKET], [ + dnl Check prerequisites of the replacement. + AC_REQUIRE([gl_CHECK_SOCKET_HEADERS]) + gl_CHECK_NEXT_HEADERS([sys/socket.h]) + if test $ac_cv_header_sys_socket_h = yes; then + HAVE_SYS_SOCKET_H=1 + HAVE_WS2TCPIP_H=0 + else + HAVE_SYS_SOCKET_H=0 + if test $ac_cv_header_ws2tcpip_h = yes; then + HAVE_WS2TCPIP_H=1 + else + HAVE_WS2TCPIP_H=0 + fi + fi + AC_SUBST([HAVE_SYS_SOCKET_H]) + AC_SUBST([HAVE_WS2TCPIP_H]) +]) +m4trace:m4/sys_socket_h.m4:123: -1- AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2], [ + m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])]) + m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])]) + AC_CHECK_HEADERS_ONCE([sys/socket.h]) + if test $ac_cv_header_sys_socket_h != yes; then + dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make + dnl the check for those headers unconditional; yet cygwin reports + dnl that the headers are present but cannot be compiled (since on + dnl cygwin, all socket information should come from sys/socket.h). + AC_CHECK_HEADERS([winsock2.h]) + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + AC_SUBST([HAVE_WINSOCK2_H]) +]) +m4trace:m4/sys_socket_h.m4:145: -1- AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) +m4trace:m4/sys_socket_h.m4:154: -1- AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS], [ + GNULIB_SOCKET=0; AC_SUBST([GNULIB_SOCKET]) + GNULIB_CONNECT=0; AC_SUBST([GNULIB_CONNECT]) + GNULIB_ACCEPT=0; AC_SUBST([GNULIB_ACCEPT]) + GNULIB_BIND=0; AC_SUBST([GNULIB_BIND]) + GNULIB_GETPEERNAME=0; AC_SUBST([GNULIB_GETPEERNAME]) + GNULIB_GETSOCKNAME=0; AC_SUBST([GNULIB_GETSOCKNAME]) + GNULIB_GETSOCKOPT=0; AC_SUBST([GNULIB_GETSOCKOPT]) + GNULIB_LISTEN=0; AC_SUBST([GNULIB_LISTEN]) + GNULIB_RECV=0; AC_SUBST([GNULIB_RECV]) + GNULIB_SEND=0; AC_SUBST([GNULIB_SEND]) + GNULIB_RECVFROM=0; AC_SUBST([GNULIB_RECVFROM]) + GNULIB_SENDTO=0; AC_SUBST([GNULIB_SENDTO]) + GNULIB_SETSOCKOPT=0; AC_SUBST([GNULIB_SETSOCKOPT]) + GNULIB_SHUTDOWN=0; AC_SUBST([GNULIB_SHUTDOWN]) + GNULIB_ACCEPT4=0; AC_SUBST([GNULIB_ACCEPT4]) + HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE]) + HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1; + AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY]) + HAVE_SA_FAMILY_T=1; AC_SUBST([HAVE_SA_FAMILY_T]) + HAVE_ACCEPT4=1; AC_SUBST([HAVE_ACCEPT4]) +]) +m4trace:m4/sys_stat_h.m4:10: -1- AC_DEFUN([gl_HEADER_SYS_STAT_H], [ + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + + dnl Check for broken stat macros. + AC_REQUIRE([AC_HEADER_STAT]) + + gl_CHECK_NEXT_HEADERS([sys/stat.h]) + + dnl Ensure the type mode_t gets defined. + AC_REQUIRE([AC_TYPE_MODE_T]) + + dnl Whether to enable precise timestamps in 'struct stat'. + m4_ifdef([gl_WINDOWS_STAT_TIMESPEC], [ + AC_REQUIRE([gl_WINDOWS_STAT_TIMESPEC]) + ], [ + WINDOWS_STAT_TIMESPEC=0 + ]) + AC_SUBST([WINDOWS_STAT_TIMESPEC]) + + dnl Whether to ensure that struct stat.st_size is 64-bit wide. + m4_ifdef([gl_LARGEFILE], [ + AC_REQUIRE([gl_LARGEFILE]) + ], [ + WINDOWS_64_BIT_ST_SIZE=0 + ]) + AC_SUBST([WINDOWS_64_BIT_ST_SIZE]) + + dnl Define types that are supposed to be defined in or + dnl . + AC_CHECK_TYPE([nlink_t], [], + [AC_DEFINE([nlink_t], [int], + [Define to the type of st_nlink in struct stat, or a supertype.])], + [#include + #include ]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include + ]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat + mknod mknodat stat utimensat]) +]) +m4trace:m4/sys_stat_h.m4:53: -1- AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) +m4trace:m4/sys_stat_h.m4:62: -1- AC_DEFUN([gl_SYS_STAT_H_DEFAULTS], [ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR + GNULIB_FCHMODAT=0; AC_SUBST([GNULIB_FCHMODAT]) + GNULIB_FSTAT=0; AC_SUBST([GNULIB_FSTAT]) + GNULIB_FSTATAT=0; AC_SUBST([GNULIB_FSTATAT]) + GNULIB_FUTIMENS=0; AC_SUBST([GNULIB_FUTIMENS]) + GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD]) + GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT]) + GNULIB_MKDIRAT=0; AC_SUBST([GNULIB_MKDIRAT]) + GNULIB_MKFIFO=0; AC_SUBST([GNULIB_MKFIFO]) + GNULIB_MKFIFOAT=0; AC_SUBST([GNULIB_MKFIFOAT]) + GNULIB_MKNOD=0; AC_SUBST([GNULIB_MKNOD]) + GNULIB_MKNODAT=0; AC_SUBST([GNULIB_MKNODAT]) + GNULIB_STAT=0; AC_SUBST([GNULIB_STAT]) + GNULIB_UTIMENSAT=0; AC_SUBST([GNULIB_UTIMENSAT]) + GNULIB_OVERRIDES_STRUCT_STAT=0; AC_SUBST([GNULIB_OVERRIDES_STRUCT_STAT]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT]) + HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT]) + HAVE_FUTIMENS=1; AC_SUBST([HAVE_FUTIMENS]) + HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD]) + HAVE_LSTAT=1; AC_SUBST([HAVE_LSTAT]) + HAVE_MKDIRAT=1; AC_SUBST([HAVE_MKDIRAT]) + HAVE_MKFIFO=1; AC_SUBST([HAVE_MKFIFO]) + HAVE_MKFIFOAT=1; AC_SUBST([HAVE_MKFIFOAT]) + HAVE_MKNOD=1; AC_SUBST([HAVE_MKNOD]) + HAVE_MKNODAT=1; AC_SUBST([HAVE_MKNODAT]) + HAVE_UTIMENSAT=1; AC_SUBST([HAVE_UTIMENSAT]) + REPLACE_FSTAT=0; AC_SUBST([REPLACE_FSTAT]) + REPLACE_FSTATAT=0; AC_SUBST([REPLACE_FSTATAT]) + REPLACE_FUTIMENS=0; AC_SUBST([REPLACE_FUTIMENS]) + REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT]) + REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR]) + REPLACE_MKFIFO=0; AC_SUBST([REPLACE_MKFIFO]) + REPLACE_MKNOD=0; AC_SUBST([REPLACE_MKNOD]) + REPLACE_STAT=0; AC_SUBST([REPLACE_STAT]) + REPLACE_UTIMENSAT=0; AC_SUBST([REPLACE_UTIMENSAT]) +]) +m4trace:m4/sys_time_h.m4:11: -1- AC_DEFUN([gl_HEADER_SYS_TIME_H], [ + dnl Use AC_REQUIRE here, so that the REPLACE_GETTIMEOFDAY=0 statement + dnl below is expanded once only, before all REPLACE_GETTIMEOFDAY=1 + dnl statements that occur in other macros. + AC_REQUIRE([gl_HEADER_SYS_TIME_H_BODY]) +]) +m4trace:m4/sys_time_h.m4:19: -1- AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY], [ + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) + AC_CHECK_HEADERS_ONCE([sys/time.h]) + gl_CHECK_NEXT_HEADERS([sys/time.h]) + + if test $ac_cv_header_sys_time_h != yes; then + HAVE_SYS_TIME_H=0 + fi + + dnl On native Windows with MSVC, 'struct timeval' is defined in + dnl only. So include that header in the list. + gl_PREREQ_SYS_H_WINSOCK2 + AC_CACHE_CHECK([for struct timeval], [gl_cv_sys_struct_timeval], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#if HAVE_SYS_TIME_H + #include + #endif + #include + #if HAVE_WINSOCK2_H + # include + #endif + ]], + [[static struct timeval x; x.tv_sec = x.tv_usec;]])], + [gl_cv_sys_struct_timeval=yes], + [gl_cv_sys_struct_timeval=no]) + ]) + if test $gl_cv_sys_struct_timeval != yes; then + HAVE_STRUCT_TIMEVAL=0 + else + dnl On native Windows with a 64-bit 'time_t', 'struct timeval' is defined + dnl (in and for mingw64, in only + dnl for MSVC) with a tv_sec field of type 'long' (32-bit!), which is + dnl smaller than the 'time_t' type mandated by POSIX. + dnl On OpenBSD 5.1 amd64, tv_sec is 64 bits and time_t 32 bits, but + dnl that is good enough. + AC_CACHE_CHECK([for wide-enough struct timeval.tv_sec member], + [gl_cv_sys_struct_timeval_tv_sec], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#if HAVE_SYS_TIME_H + #include + #endif + #include + #if HAVE_WINSOCK2_H + # include + #endif + ]], + [[static struct timeval x; + typedef int verify_tv_sec_type[ + sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1 + ]; + ]])], + [gl_cv_sys_struct_timeval_tv_sec=yes], + [gl_cv_sys_struct_timeval_tv_sec=no]) + ]) + if test $gl_cv_sys_struct_timeval_tv_sec != yes; then + REPLACE_STRUCT_TIMEVAL=1 + fi + fi + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ +#if HAVE_SYS_TIME_H +# include +#endif +#include + ]], [gettimeofday]) +]) +m4trace:m4/sys_time_h.m4:92: -1- AC_DEFUN([gl_SYS_TIME_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) +m4trace:m4/sys_time_h.m4:101: -1- AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS], [ + GNULIB_GETTIMEOFDAY=0; AC_SUBST([GNULIB_GETTIMEOFDAY]) + dnl Assume POSIX behavior unless another module says otherwise. + HAVE_GETTIMEOFDAY=1; AC_SUBST([HAVE_GETTIMEOFDAY]) + HAVE_STRUCT_TIMEVAL=1; AC_SUBST([HAVE_STRUCT_TIMEVAL]) + HAVE_SYS_TIME_H=1; AC_SUBST([HAVE_SYS_TIME_H]) + REPLACE_GETTIMEOFDAY=0; AC_SUBST([REPLACE_GETTIMEOFDAY]) + REPLACE_STRUCT_TIMEVAL=0; AC_SUBST([REPLACE_STRUCT_TIMEVAL]) +]) +m4trace:m4/sys_types_h.m4:7: -1- AC_DEFUN_ONCE([gl_SYS_TYPES_H], [ + AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS]) + gl_NEXT_HEADERS([sys/types.h]) + + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) + + dnl Ensure the type mode_t gets defined. + AC_REQUIRE([AC_TYPE_MODE_T]) + + dnl Whether to override the 'off_t' type. + AC_REQUIRE([gl_TYPE_OFF_T]) + + dnl Whether to override the 'dev_t' and 'ino_t' types. + m4_ifdef([gl_WINDOWS_STAT_INODES], [ + AC_REQUIRE([gl_WINDOWS_STAT_INODES]) + ], [ + WINDOWS_STAT_INODES=0 + ]) + AC_SUBST([WINDOWS_STAT_INODES]) +]) +m4trace:m4/sys_types_h.m4:30: -1- AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS], [ +]) +m4trace:m4/sys_uio_h.m4:7: -1- AC_DEFUN([gl_HEADER_SYS_UIO], [ + AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS]) + dnl is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([sys/uio.h]) + if test $ac_cv_header_sys_uio_h = yes; then + HAVE_SYS_UIO_H=1 + else + HAVE_SYS_UIO_H=0 + fi + AC_SUBST([HAVE_SYS_UIO_H]) +]) +m4trace:m4/sys_uio_h.m4:20: -1- AC_DEFUN([gl_SYS_UIO_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) +m4trace:m4/sys_uio_h.m4:29: -1- AC_DEFUN([gl_SYS_UIO_H_DEFAULTS], [ +]) +m4trace:m4/sys_wait_h.m4:7: -1- AC_DEFUN([gl_SYS_WAIT_H], [ + AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS]) + + dnl is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([sys/wait.h]) + + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include ]], + [waitpid]) +]) +m4trace:m4/sys_wait_h.m4:23: -1- AC_DEFUN([gl_SYS_WAIT_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) +m4trace:m4/sys_wait_h.m4:32: -1- AC_DEFUN([gl_SYS_WAIT_H_DEFAULTS], [ + GNULIB_WAITPID=0; AC_SUBST([GNULIB_WAITPID]) + dnl Assume proper GNU behavior unless another module says otherwise. +]) +m4trace:m4/tempname.m4:10: -1- AC_DEFUN([gl_FUNC_GEN_TEMPNAME], [ + gl_PREREQ_TEMPNAME +]) +m4trace:m4/tempname.m4:16: -1- AC_DEFUN([gl_PREREQ_TEMPNAME], [ + : +]) +m4trace:m4/time_h.m4:13: -1- AC_DEFUN([gl_HEADER_TIME_H], [ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_HEADER_TIME_H_BODY]) +]) +m4trace:m4/time_h.m4:20: -1- AC_DEFUN([gl_HEADER_TIME_H_BODY], [ + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + gl_NEXT_HEADERS([time.h]) + AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC]) +]) +m4trace:m4/time_h.m4:31: -1- AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC], [ + AC_CHECK_HEADERS_ONCE([sys/time.h]) + AC_CACHE_CHECK([for struct timespec in ], + [gl_cv_sys_struct_timespec_in_time_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], + [gl_cv_sys_struct_timespec_in_time_h=yes], + [gl_cv_sys_struct_timespec_in_time_h=no])]) + + TIME_H_DEFINES_STRUCT_TIMESPEC=0 + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 + UNISTD_H_DEFINES_STRUCT_TIMESPEC=0 + if test $gl_cv_sys_struct_timespec_in_time_h = yes; then + TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + AC_CACHE_CHECK([for struct timespec in ], + [gl_cv_sys_struct_timespec_in_sys_time_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], + [gl_cv_sys_struct_timespec_in_sys_time_h=yes], + [gl_cv_sys_struct_timespec_in_sys_time_h=no])]) + if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + AC_CACHE_CHECK([for struct timespec in ], + [gl_cv_sys_struct_timespec_in_pthread_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], + [gl_cv_sys_struct_timespec_in_pthread_h=yes], + [gl_cv_sys_struct_timespec_in_pthread_h=no])]) + if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 + else + AC_CACHE_CHECK([for struct timespec in ], + [gl_cv_sys_struct_timespec_in_unistd_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], + [gl_cv_sys_struct_timespec_in_unistd_h=yes], + [gl_cv_sys_struct_timespec_in_unistd_h=no])]) + if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then + UNISTD_H_DEFINES_STRUCT_TIMESPEC=1 + fi + fi + fi + fi + AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC]) + AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC]) + AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC]) + AC_SUBST([UNISTD_H_DEFINES_STRUCT_TIMESPEC]) +]) +m4trace:m4/time_h.m4:96: -1- AC_DEFUN([gl_TIME_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) +m4trace:m4/time_h.m4:105: -1- AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], [ + GNULIB_CTIME=0; AC_SUBST([GNULIB_CTIME]) + GNULIB_MKTIME=0; AC_SUBST([GNULIB_MKTIME]) + GNULIB_LOCALTIME=0; AC_SUBST([GNULIB_LOCALTIME]) + GNULIB_NANOSLEEP=0; AC_SUBST([GNULIB_NANOSLEEP]) + GNULIB_STRFTIME=0; AC_SUBST([GNULIB_STRFTIME]) + GNULIB_STRPTIME=0; AC_SUBST([GNULIB_STRPTIME]) + GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM]) + GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R]) + GNULIB_TIME_RZ=0; AC_SUBST([GNULIB_TIME_RZ]) + GNULIB_TZSET=0; AC_SUBST([GNULIB_TZSET]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R]) + HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP]) + HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME]) + HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM]) + HAVE_TZSET=1; AC_SUBST([HAVE_TZSET]) + dnl Even GNU libc does not have timezone_t yet. + HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T]) + dnl If another module says to replace or to not replace, do that. + dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK; + dnl this lets maintainers check for portability. + REPLACE_CTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_CTIME]) + REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R]) + REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME]) + REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP]) + REPLACE_STRFTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRFTIME]) + REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM]) + REPLACE_TZSET=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TZSET]) + + dnl Hack so that the time module doesn't depend on the sys_time module. + dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent. + : ${GNULIB_GETTIMEOFDAY=0}; AC_SUBST([GNULIB_GETTIMEOFDAY]) + dnl Second, it's OK to not use GNULIB_PORTCHECK for REPLACE_GMTIME + dnl and REPLACE_LOCALTIME, as portability to Solaris 2.6 and earlier + dnl is no longer a big deal. + REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME]) + REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME]) +]) +m4trace:m4/time_r.m4:10: -1- AC_DEFUN([gl_TIME_R], [ + dnl Persuade glibc and Solaris to declare localtime_r. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([AC_C_RESTRICT]) + + dnl Some systems don't declare localtime_r() and gmtime_r() if _REENTRANT is + dnl not defined. + AC_CHECK_DECLS([localtime_r], [], [], [[#include ]]) + if test $ac_cv_have_decl_localtime_r = no; then + HAVE_DECL_LOCALTIME_R=0 + fi + + AC_CHECK_FUNCS_ONCE([localtime_r]) + if test $ac_cv_func_localtime_r = yes; then + HAVE_LOCALTIME_R=1 + AC_CACHE_CHECK([whether localtime_r is compatible with its POSIX signature], + [gl_cv_time_r_posix], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[/* We don't need to append 'restrict's to the argument types, + even though the POSIX signature has the 'restrict's, + since C99 says they can't affect type compatibility. */ + struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r; + if (ptr) return 0; + /* Check the return type is a pointer. + On HP-UX 10 it is 'int'. */ + *localtime_r (0, 0);]]) + ], + [gl_cv_time_r_posix=yes], + [gl_cv_time_r_posix=no]) + ]) + if test $gl_cv_time_r_posix = yes; then + REPLACE_LOCALTIME_R=0 + else + REPLACE_LOCALTIME_R=1 + fi + else + HAVE_LOCALTIME_R=0 + fi +]) +m4trace:m4/time_r.m4:56: -1- AC_DEFUN([gl_PREREQ_TIME_R], [ + : +]) +m4trace:m4/time_rz.m4:10: -1- AC_DEFUN([gl_TIME_RZ], [ + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([AC_STRUCT_TIMEZONE]) + + AC_CHECK_TYPES([timezone_t], [], [], [[#include ]]) + if test "$ac_cv_type_timezone_t" = yes; then + HAVE_TIMEZONE_T=1 + fi +]) +m4trace:m4/timegm.m4:7: -1- AC_DEFUN([gl_FUNC_TIMEGM], [ + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([gl_FUNC_MKTIME_WORKS]) + REPLACE_TIMEGM=0 + AC_CHECK_FUNCS_ONCE([timegm]) + if test $ac_cv_func_timegm = yes; then + if test "$gl_cv_func_working_mktime" != yes; then + # Assume that timegm is buggy if mktime is. + REPLACE_TIMEGM=1 + fi + else + HAVE_TIMEGM=0 + fi +]) +m4trace:m4/timegm.m4:24: -1- AC_DEFUN([gl_PREREQ_TIMEGM], [ + : +]) +m4trace:m4/timespec.m4:11: -1- AC_DEFUN([gl_TIMESPEC], [:]) +m4trace:m4/tm_gmtoff.m4:7: -1- AC_DEFUN([gl_TM_GMTOFF], [ + AC_CHECK_MEMBER([struct tm.tm_gmtoff], + [AC_DEFINE([HAVE_TM_GMTOFF], [1], + [Define if struct tm has the tm_gmtoff member.])], + , + [#include ]) +]) +m4trace:m4/tzset.m4:16: -1- AC_DEFUN([gl_FUNC_TZSET], [ + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_FUNCS_ONCE([tzset]) + if test $ac_cv_func_tzset = no; then + HAVE_TZSET=0 + fi + gl_FUNC_TZSET_CLOBBER + REPLACE_TZSET=0 + case "$gl_cv_func_tzset_clobber" in + *yes) + REPLACE_TZSET=1 + AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1], + [Define if tzset clobbers localtime's static buffer.]) + gl_LOCALTIME_BUFFER_NEEDED + ;; + esac + case "$host_os" in + mingw*) REPLACE_TZSET=1 ;; + esac +]) +m4trace:m4/tzset.m4:41: -1- AC_DEFUN([gl_FUNC_TZSET_CLOBBER], [ + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether tzset clobbers localtime buffer], + gl_cv_func_tzset_clobber, + [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include +#include + +int +main () +{ + time_t t1 = 853958121; + struct tm *p, s; + putenv ("TZ=GMT0"); + p = localtime (&t1); + s = *p; + putenv ("TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"); + tzset (); + return (p->tm_year != s.tm_year + || p->tm_mon != s.tm_mon + || p->tm_mday != s.tm_mday + || p->tm_hour != s.tm_hour + || p->tm_min != s.tm_min + || p->tm_sec != s.tm_sec); +} + ]])], + [gl_cv_func_tzset_clobber=no], + [gl_cv_func_tzset_clobber=yes], + [case "$host_os" in + # Guess all is fine on glibc systems. + *-gnu*) gl_cv_func_tzset_clobber="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_tzset_clobber="guessing yes" ;; + esac + ])]) + + AC_DEFINE([HAVE_RUN_TZSET_TEST], [1], + [Define to 1 if you have run the test for working tzset.]) +]) +m4trace:m4/unistd_h.m4:9: -1- AC_DEFUN([gl_UNISTD_H], [ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + + gl_CHECK_NEXT_HEADERS([unistd.h]) + if test $ac_cv_header_unistd_h = yes; then + HAVE_UNISTD_H=1 + else + HAVE_UNISTD_H=0 + fi + AC_SUBST([HAVE_UNISTD_H]) + + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) + + dnl Determine WINDOWS_64_BIT_OFF_T. + AC_REQUIRE([gl_TYPE_OFF_T]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ +#if HAVE_UNISTD_H +# include +#endif +/* Some systems declare various items in the wrong headers. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include +# endif +#endif + ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat + fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups + gethostname getlogin getlogin_r getpagesize + getusershell setusershell endusershell + group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite + readlink readlinkat rmdir sethostname sleep symlink symlinkat + truncate ttyname_r unlink unlinkat usleep]) +]) +m4trace:m4/unistd_h.m4:53: -1- AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) +m4trace:m4/unistd_h.m4:62: -1- AC_DEFUN([gl_UNISTD_H_DEFAULTS], [ + GNULIB_CHDIR=0; AC_SUBST([GNULIB_CHDIR]) + GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) + GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) + GNULIB_DUP=0; AC_SUBST([GNULIB_DUP]) + GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) + GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3]) + GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) + GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) + GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT]) + GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) + GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT]) + GNULIB_FDATASYNC=0; AC_SUBST([GNULIB_FDATASYNC]) + GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) + GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) + GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) + GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME]) + GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE]) + GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS]) + GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME]) + GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN]) + GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) + GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) + GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) + GNULIB_GROUP_MEMBER=0; AC_SUBST([GNULIB_GROUP_MEMBER]) + GNULIB_ISATTY=0; AC_SUBST([GNULIB_ISATTY]) + GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) + GNULIB_LINK=0; AC_SUBST([GNULIB_LINK]) + GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT]) + GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) + GNULIB_PIPE=0; AC_SUBST([GNULIB_PIPE]) + GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2]) + GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD]) + GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE]) + GNULIB_READ=0; AC_SUBST([GNULIB_READ]) + GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) + GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT]) + GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR]) + GNULIB_SETHOSTNAME=0; AC_SUBST([GNULIB_SETHOSTNAME]) + GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) + GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK]) + GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT]) + GNULIB_TRUNCATE=0; AC_SUBST([GNULIB_TRUNCATE]) + GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R]) + GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING]) + GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) + GNULIB_UNLINK=0; AC_SUBST([GNULIB_UNLINK]) + GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT]) + GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP]) + GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN]) + HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) + HAVE_DUP3=1; AC_SUBST([HAVE_DUP3]) + HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS]) + HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT]) + HAVE_FCHDIR=1; AC_SUBST([HAVE_FCHDIR]) + HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT]) + HAVE_FDATASYNC=1; AC_SUBST([HAVE_FDATASYNC]) + HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) + HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) + HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE]) + HAVE_GETGROUPS=1; AC_SUBST([HAVE_GETGROUPS]) + HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) + HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN]) + HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) + HAVE_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER]) + HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN]) + HAVE_LINK=1; AC_SUBST([HAVE_LINK]) + HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT]) + HAVE_PIPE=1; AC_SUBST([HAVE_PIPE]) + HAVE_PIPE2=1; AC_SUBST([HAVE_PIPE2]) + HAVE_PREAD=1; AC_SUBST([HAVE_PREAD]) + HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE]) + HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) + HAVE_READLINKAT=1; AC_SUBST([HAVE_READLINKAT]) + HAVE_SETHOSTNAME=1; AC_SUBST([HAVE_SETHOSTNAME]) + HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) + HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK]) + HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT]) + HAVE_TRUNCATE=1; AC_SUBST([HAVE_TRUNCATE]) + HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT]) + HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP]) + HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) + HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR]) + HAVE_DECL_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC]) + HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME]) + HAVE_DECL_GETLOGIN=1; AC_SUBST([HAVE_DECL_GETLOGIN]) + HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) + HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE]) + HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL]) + HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME]) + HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R]) + HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) + HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) + REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) + REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE]) + REPLACE_DUP=0; AC_SUBST([REPLACE_DUP]) + REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2]) + REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT]) + REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE]) + REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) + REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME]) + REPLACE_GETDTABLESIZE=0; AC_SUBST([REPLACE_GETDTABLESIZE]) + REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R]) + REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS]) + REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE]) + REPLACE_ISATTY=0; AC_SUBST([REPLACE_ISATTY]) + REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN]) + REPLACE_LINK=0; AC_SUBST([REPLACE_LINK]) + REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT]) + REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) + REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD]) + REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE]) + REPLACE_READ=0; AC_SUBST([REPLACE_READ]) + REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK]) + REPLACE_READLINKAT=0; AC_SUBST([REPLACE_READLINKAT]) + REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR]) + REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP]) + REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK]) + REPLACE_SYMLINKAT=0; AC_SUBST([REPLACE_SYMLINKAT]) + REPLACE_TRUNCATE=0; AC_SUBST([REPLACE_TRUNCATE]) + REPLACE_TTYNAME_R=0; AC_SUBST([REPLACE_TTYNAME_R]) + REPLACE_UNLINK=0; AC_SUBST([REPLACE_UNLINK]) + REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT]) + REPLACE_USLEEP=0; AC_SUBST([REPLACE_USLEEP]) + REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE]) + UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H]) + UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; + AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS]) +]) +m4trace:m4/unlocked-io.m4:17: -1- AC_DEFUN([gl_FUNC_GLIBC_UNLOCKED_IO], [ + AC_DEFINE([USE_UNLOCKED_IO], [1], + [Define to 1 if you want getc etc. to use unlocked I/O if available. + Unlocked I/O can improve performance in unithreaded apps, + but it is not safe for multithreaded apps.]) + + dnl Persuade glibc and Solaris to declare + dnl fgets_unlocked(), fputs_unlocked() etc. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_CHECK_DECLS_ONCE([clearerr_unlocked]) + AC_CHECK_DECLS_ONCE([feof_unlocked]) + AC_CHECK_DECLS_ONCE([ferror_unlocked]) + AC_CHECK_DECLS_ONCE([fflush_unlocked]) + AC_CHECK_DECLS_ONCE([fgets_unlocked]) + AC_CHECK_DECLS_ONCE([fputc_unlocked]) + AC_CHECK_DECLS_ONCE([fputs_unlocked]) + AC_CHECK_DECLS_ONCE([fread_unlocked]) + AC_CHECK_DECLS_ONCE([fwrite_unlocked]) + AC_CHECK_DECLS_ONCE([getc_unlocked]) + AC_CHECK_DECLS_ONCE([getchar_unlocked]) + AC_CHECK_DECLS_ONCE([putc_unlocked]) + AC_CHECK_DECLS_ONCE([putchar_unlocked]) +]) +m4trace:m4/vararrays.m4:15: -1- AC_DEFUN([AC_C_VARARRAYS], [ + AC_CACHE_CHECK([for variable-length arrays], + ac_cv_c_vararrays, + [AC_EGREP_CPP([defined], + [#ifdef __STDC_NO_VLA__ + defined + #endif + ], + [ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined'], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[/* Test for VLA support. This test is partly inspired + from examples in the C standard. Use at least two VLA + functions to detect the GCC 3.4.3 bug described in: + http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html + */ + #ifdef __STDC_NO_VLA__ + syntax error; + #else + extern int n; + int B[100]; + int fvla (int m, int C[m][m]); + + int + simple (int count, int all[static count]) + { + return all[count - 1]; + } + + int + fvla (int m, int C[m][m]) + { + typedef int VLA[m][m]; + VLA x; + int D[m]; + static int (*q)[m] = &B; + int (*s)[n] = q; + return C && &x[0][0] == &D[0] && &D[0] == s[0]; + } + #endif + ]])], + [ac_cv_c_vararrays=yes], + [ac_cv_c_vararrays=no])])]) + if test "$ac_cv_c_vararrays" = yes; then + dnl This is for compatibility with Autoconf 2.61-2.69. + AC_DEFINE([HAVE_C_VARARRAYS], 1, + [Define to 1 if C supports variable-length arrays.]) + elif test "$ac_cv_c_vararrays" = no; then + AC_DEFINE([__STDC_NO_VLA__], 1, + [Define to 1 if C does not support variable-length arrays, and + if the compiler does not already define this.]) + fi +]) +m4trace:m4/vasnprintf.m4:7: -1- AC_DEFUN([gl_FUNC_VASNPRINTF], [ + AC_CHECK_FUNCS_ONCE([vasnprintf]) + if test $ac_cv_func_vasnprintf = no; then + gl_REPLACE_VASNPRINTF + fi +]) +m4trace:m4/vasnprintf.m4:15: -1- AC_DEFUN([gl_REPLACE_VASNPRINTF], [ + AC_CHECK_FUNCS_ONCE([vasnprintf]) + AC_LIBOBJ([vasnprintf]) + AC_LIBOBJ([printf-args]) + AC_LIBOBJ([printf-parse]) + AC_LIBOBJ([asnprintf]) + if test $ac_cv_func_vasnprintf = yes; then + AC_DEFINE([REPLACE_VASNPRINTF], [1], + [Define if vasnprintf exists but is overridden by gnulib.]) + fi + gl_PREREQ_PRINTF_ARGS + gl_PREREQ_PRINTF_PARSE + gl_PREREQ_VASNPRINTF + gl_PREREQ_ASNPRINTF +]) +m4trace:m4/vasnprintf.m4:33: -1- AC_DEFUN([gl_PREREQ_PRINTF_ARGS], [ + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + AC_REQUIRE([gt_TYPE_WCHAR_T]) + AC_REQUIRE([gt_TYPE_WINT_T]) +]) +m4trace:m4/vasnprintf.m4:41: -1- AC_DEFUN([gl_PREREQ_PRINTF_PARSE], [ + AC_REQUIRE([gl_FEATURES_H]) + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + AC_REQUIRE([gt_TYPE_WCHAR_T]) + AC_REQUIRE([gt_TYPE_WINT_T]) + AC_REQUIRE([AC_TYPE_SIZE_T]) + AC_CHECK_TYPE([ptrdiff_t], , + [AC_DEFINE([ptrdiff_t], [long], + [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) + ]) + AC_REQUIRE([gt_AC_TYPE_INTMAX_T]) +]) +m4trace:m4/vasnprintf.m4:56: -1- AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF], [ + AC_REQUIRE([AC_FUNC_ALLOCA]) + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + AC_REQUIRE([gt_TYPE_WCHAR_T]) + AC_REQUIRE([gt_TYPE_WINT_T]) + AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb]) + dnl Use the _snprintf function only if it is declared (because on NetBSD it + dnl is defined as a weak alias of snprintf; we prefer to use the latter). + AC_CHECK_DECLS([_snprintf], , , [[#include ]]) + dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization + dnl in the code for NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE. + AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION]) + dnl We can avoid a lot of code by assuming that snprintf's return value + dnl conforms to ISO C99. So check that. + AC_REQUIRE([gl_SNPRINTF_RETVAL_C99]) + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + AC_DEFINE([HAVE_SNPRINTF_RETVAL_C99], [1], + [Define if the return value of the snprintf function is the number of + of bytes (excluding the terminating NUL) that would have been produced + if the buffer had been large enough.]) + ;; + esac +]) +m4trace:m4/vasnprintf.m4:84: -1- AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE], [ + AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) + case "$gl_cv_func_printf_long_double" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + 'long double' arguments.]) + ;; + esac +]) +m4trace:m4/vasnprintf.m4:100: -1- AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE], [ + AC_REQUIRE([gl_PRINTF_INFINITE]) + case "$gl_cv_func_printf_infinite" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + infinite 'double' arguments.]) + ;; + esac +]) +m4trace:m4/vasnprintf.m4:116: -1- AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE], [ + AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE]) + dnl There is no need to set NEED_PRINTF_INFINITE_LONG_DOUBLE if + dnl NEED_PRINTF_LONG_DOUBLE is already set. + AC_REQUIRE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE]) + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + infinite 'long double' arguments.]) + ;; + esac + ;; + esac +]) +m4trace:m4/vasnprintf.m4:138: -1- AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A], [ + AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) + case "$gl_cv_func_printf_directive_a" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], [1], + [Define if the vasnprintf implementation needs special code for + the 'a' and 'A' directives.]) + AC_CHECK_FUNCS([nl_langinfo]) + ;; + esac +]) +m4trace:m4/vasnprintf.m4:154: -1- AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F], [ + AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) + case "$gl_cv_func_printf_directive_f" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], [1], + [Define if the vasnprintf implementation needs special code for + the 'F' directive.]) + ;; + esac +]) +m4trace:m4/vasnprintf.m4:169: -1- AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_LS], [ + AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) + case "$gl_cv_func_printf_directive_ls" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_DIRECTIVE_LS], [1], + [Define if the vasnprintf implementation needs special code for + the 'ls' directive.]) + ;; + esac +]) +m4trace:m4/vasnprintf.m4:184: -1- AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING], [ + AC_REQUIRE([gl_PRINTF_FLAG_GROUPING]) + case "$gl_cv_func_printf_flag_grouping" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], [1], + [Define if the vasnprintf implementation needs special code for the + ' flag.]) + ;; + esac +]) +m4trace:m4/vasnprintf.m4:199: -1- AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST], [ + AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST]) + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], [1], + [Define if the vasnprintf implementation needs special code for the + '-' flag.]) + ;; + esac +]) +m4trace:m4/vasnprintf.m4:214: -1- AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO], [ + AC_REQUIRE([gl_PRINTF_FLAG_ZERO]) + case "$gl_cv_func_printf_flag_zero" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_FLAG_ZERO], [1], + [Define if the vasnprintf implementation needs special code for the + 0 flag.]) + ;; + esac +]) +m4trace:m4/vasnprintf.m4:229: -1- AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION], [ + AC_REQUIRE([gl_PRINTF_PRECISION]) + case "$gl_cv_func_printf_precision" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], [1], + [Define if the vasnprintf implementation needs special code for + supporting large precisions without arbitrary bounds.]) + AC_DEFINE([NEED_PRINTF_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + 'double' arguments.]) + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + 'long double' arguments.]) + ;; + esac +]) +m4trace:m4/vasnprintf.m4:251: -1- AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM], [ + AC_REQUIRE([gl_PRINTF_ENOMEM]) + case "$gl_cv_func_printf_enomem" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_ENOMEM], [1], + [Define if the vasnprintf implementation needs special code for + surviving out-of-memory conditions.]) + AC_DEFINE([NEED_PRINTF_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + 'double' arguments.]) + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + 'long double' arguments.]) + ;; + esac +]) +m4trace:m4/vasnprintf.m4:272: -1- AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS], [ + AC_REQUIRE([gl_PREREQ_VASNPRINTF]) + gl_PREREQ_VASNPRINTF_LONG_DOUBLE + gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE + gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE + gl_PREREQ_VASNPRINTF_DIRECTIVE_A + gl_PREREQ_VASNPRINTF_DIRECTIVE_F + gl_PREREQ_VASNPRINTF_DIRECTIVE_LS + gl_PREREQ_VASNPRINTF_FLAG_GROUPING + gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST + gl_PREREQ_VASNPRINTF_FLAG_ZERO + gl_PREREQ_VASNPRINTF_PRECISION + gl_PREREQ_VASNPRINTF_ENOMEM +]) +m4trace:m4/vasnprintf.m4:289: -1- AC_DEFUN([gl_PREREQ_ASNPRINTF], [ +]) +m4trace:m4/vasprintf.m4:8: -1- AC_DEFUN([gl_FUNC_VASPRINTF], [ + AC_CHECK_FUNCS([vasprintf]) + if test $ac_cv_func_vasprintf = no; then + gl_REPLACE_VASPRINTF + fi +]) +m4trace:m4/vasprintf.m4:16: -1- AC_DEFUN([gl_REPLACE_VASPRINTF], [ + AC_LIBOBJ([vasprintf]) + AC_LIBOBJ([asprintf]) + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + if test $ac_cv_func_vasprintf = yes; then + REPLACE_VASPRINTF=1 + else + HAVE_VASPRINTF=0 + fi + gl_PREREQ_VASPRINTF_H + gl_PREREQ_VASPRINTF + gl_PREREQ_ASPRINTF +]) +m4trace:m4/vasprintf.m4:32: -1- AC_DEFUN([gl_PREREQ_VASPRINTF_H], [ + dnl Persuade glibc to declare asprintf() and vasprintf(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) +]) +m4trace:m4/vasprintf.m4:39: -1- AC_DEFUN([gl_PREREQ_VASPRINTF], [ +]) +m4trace:m4/vasprintf.m4:44: -1- AC_DEFUN([gl_PREREQ_ASPRINTF], [ +]) +m4trace:m4/version-etc.m4:20: -1- AC_DEFUN([gl_VERSION_ETC], [dnl + gl_VERSION_ETC_FLAG([packager], + [String identifying the packager of this software]) + gl_VERSION_ETC_FLAG([packager-version], + [Packager-specific version information]) + gl_VERSION_ETC_FLAG([packager-bug-reports], + [Packager info for bug reports (URL/e-mail/...)]) + if test "X$with_packager" = "X" && \ + test "X$with_packager_version$with_packager_bug_reports" != "X" + then + AC_MSG_ERROR([The --with-packager-{bug-reports,version} options require --with-packager]) + fi +]) +m4trace:m4/warn-on-use.m4:24: -1- AC_DEFUN([gl_WARN_ON_USE_PREPARE], [ + m4_foreach_w([gl_decl], [$2], + [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])), + [Define to 1 if ]m4_defn([gl_decl])[ is declared even after + undefining macros.])])dnl +dnl FIXME: gl_Symbol must be used unquoted until we can assume +dnl autoconf 2.64 or newer. + for gl_func in m4_flatten([$2]); do + AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl + AC_CACHE_CHECK([whether $gl_func is declared without a macro], + gl_Symbol, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1], +[@%:@undef $gl_func + (void) $gl_func;])], + [AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])]) + AS_VAR_IF(gl_Symbol, [yes], + [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1]) + dnl shortcut - if the raw declaration exists, then set a cache + dnl variable to allow skipping any later AC_CHECK_DECL efforts + eval ac_cv_have_decl_$gl_func=yes]) + AS_VAR_POPDEF([gl_Symbol])dnl + done +]) +m4trace:m4/warnings.m4:25: -1- AC_DEFUN([gl_COMPILER_OPTION_IF], [AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl +AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl +AS_LITERAL_IF([$1], + [m4_pushdef([gl_Positive], m4_bpatsubst([$1], [^-Wno-], [-W]))], + [gl_positive="$1" +case $gl_positive in + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; +esac +m4_pushdef([gl_Positive], [$gl_positive])])dnl +AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [ + gl_save_compiler_FLAGS="$gl_Flags" + gl_AS_VAR_APPEND(m4_defn([gl_Flags]), + [" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["]) + AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])], + [AS_VAR_SET(gl_Warn, [yes])], + [AS_VAR_SET(gl_Warn, [no])]) + gl_Flags="$gl_save_compiler_FLAGS" +]) +AS_VAR_IF(gl_Warn, [yes], [$2], [$3]) +m4_popdef([gl_Positive])dnl +AS_VAR_POPDEF([gl_Flags])dnl +AS_VAR_POPDEF([gl_Warn])dnl +]) +m4trace:m4/warnings.m4:54: -1- AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS], [gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option], + [gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'], + [gl_unknown_warnings_are_errors=])]) +m4trace:m4/warnings.m4:66: -1- AC_DEFUN([gl_WARN_ADD], [AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS]) +gl_COMPILER_OPTION_IF([$1], + [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])], + [], + [$3]) +m4_ifval([$2], + [AS_LITERAL_IF([$2], [AC_SUBST([$2])])], + [AC_SUBST([WARN_CFLAGS])])dnl +]) +m4trace:m4/wchar_h.m4:12: -1- AC_DEFUN([gl_WCHAR_H], [ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + AC_REQUIRE([gl_WCHAR_H_INLINE_OK]) + dnl Prepare for creating substitute . + dnl Check for (missing in Linux uClibc when built without wide + dnl character support). + dnl is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([wchar.h]) + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + AC_SUBST([HAVE_WCHAR_H]) + + AC_REQUIRE([gl_FEATURES_H]) + + AC_REQUIRE([gt_TYPE_WINT_T]) + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + AC_SUBST([HAVE_WINT_T]) + + AC_REQUIRE([gl_TYPE_WINT_T_PREREQ]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +#endif +#include + ]], + [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb + wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset + wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp + wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr + wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime + ]) +]) +m4trace:m4/wchar_h.m4:63: -1- AC_DEFUN([gl_WCHAR_H_INLINE_OK], [ + dnl Test whether suffers due to the transition from '__inline' to + dnl 'gnu_inline'. See + dnl and . In summary, + dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and + dnl the option -std=c99 or -std=gnu99, leads to a broken . + AC_CACHE_CHECK([whether uses 'inline' correctly], + [gl_cv_header_wchar_h_correct_inline], + [gl_cv_header_wchar_h_correct_inline=yes + AC_LANG_CONFTEST([ + AC_LANG_SOURCE([[#define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +extern int zero (void); +int main () { return zero(); } +]])]) + dnl Do not rename the object file from conftest.$ac_objext to + dnl conftest1.$ac_objext, as this will cause the link to fail on + dnl z/OS when using the XPLINK object format (due to duplicate + dnl CSECT names). Instead, temporarily redefine $ac_compile so + dnl that the object file has the latter name from the start. + save_ac_compile="$ac_compile" + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` + if AC_TRY_EVAL([ac_compile]); then + AC_LANG_CONFTEST([ + AC_LANG_SOURCE([[#define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int zero (void) { return 0; } +]])]) + dnl See note above about renaming object files. + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` + if AC_TRY_EVAL([ac_compile]); then + if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then + : + else + gl_cv_header_wchar_h_correct_inline=no + fi + fi + fi + ac_compile="$save_ac_compile" + rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext + ]) + if test $gl_cv_header_wchar_h_correct_inline = no; then + AC_MSG_ERROR([ cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). +This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in +C99 mode. You have four options: + - Add the flag -fgnu89-inline to CC and reconfigure, or + - Fix your include files, using parts of + , or + - Use a gcc version older than 4.3, or + - Don't use the flags -std=c99 or -std=gnu99. +Configuration aborted.]) + fi +]) +m4trace:m4/wchar_h.m4:132: -1- AC_DEFUN([gl_WCHAR_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) +m4trace:m4/wchar_h.m4:141: -1- AC_DEFUN([gl_WCHAR_H_DEFAULTS], [ + GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC]) + GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB]) + GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT]) + GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC]) + GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN]) + GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS]) + GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS]) + GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB]) + GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS]) + GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS]) + GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH]) + GNULIB_WMEMCHR=0; AC_SUBST([GNULIB_WMEMCHR]) + GNULIB_WMEMCMP=0; AC_SUBST([GNULIB_WMEMCMP]) + GNULIB_WMEMCPY=0; AC_SUBST([GNULIB_WMEMCPY]) + GNULIB_WMEMMOVE=0; AC_SUBST([GNULIB_WMEMMOVE]) + GNULIB_WMEMSET=0; AC_SUBST([GNULIB_WMEMSET]) + GNULIB_WCSLEN=0; AC_SUBST([GNULIB_WCSLEN]) + GNULIB_WCSNLEN=0; AC_SUBST([GNULIB_WCSNLEN]) + GNULIB_WCSCPY=0; AC_SUBST([GNULIB_WCSCPY]) + GNULIB_WCPCPY=0; AC_SUBST([GNULIB_WCPCPY]) + GNULIB_WCSNCPY=0; AC_SUBST([GNULIB_WCSNCPY]) + GNULIB_WCPNCPY=0; AC_SUBST([GNULIB_WCPNCPY]) + GNULIB_WCSCAT=0; AC_SUBST([GNULIB_WCSCAT]) + GNULIB_WCSNCAT=0; AC_SUBST([GNULIB_WCSNCAT]) + GNULIB_WCSCMP=0; AC_SUBST([GNULIB_WCSCMP]) + GNULIB_WCSNCMP=0; AC_SUBST([GNULIB_WCSNCMP]) + GNULIB_WCSCASECMP=0; AC_SUBST([GNULIB_WCSCASECMP]) + GNULIB_WCSNCASECMP=0; AC_SUBST([GNULIB_WCSNCASECMP]) + GNULIB_WCSCOLL=0; AC_SUBST([GNULIB_WCSCOLL]) + GNULIB_WCSXFRM=0; AC_SUBST([GNULIB_WCSXFRM]) + GNULIB_WCSDUP=0; AC_SUBST([GNULIB_WCSDUP]) + GNULIB_WCSCHR=0; AC_SUBST([GNULIB_WCSCHR]) + GNULIB_WCSRCHR=0; AC_SUBST([GNULIB_WCSRCHR]) + GNULIB_WCSCSPN=0; AC_SUBST([GNULIB_WCSCSPN]) + GNULIB_WCSSPN=0; AC_SUBST([GNULIB_WCSSPN]) + GNULIB_WCSPBRK=0; AC_SUBST([GNULIB_WCSPBRK]) + GNULIB_WCSSTR=0; AC_SUBST([GNULIB_WCSSTR]) + GNULIB_WCSTOK=0; AC_SUBST([GNULIB_WCSTOK]) + GNULIB_WCSWIDTH=0; AC_SUBST([GNULIB_WCSWIDTH]) + GNULIB_WCSFTIME=0; AC_SUBST([GNULIB_WCSFTIME]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC]) + HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT]) + HAVE_MBRTOWC=1; AC_SUBST([HAVE_MBRTOWC]) + HAVE_MBRLEN=1; AC_SUBST([HAVE_MBRLEN]) + HAVE_MBSRTOWCS=1; AC_SUBST([HAVE_MBSRTOWCS]) + HAVE_MBSNRTOWCS=1; AC_SUBST([HAVE_MBSNRTOWCS]) + HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB]) + HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS]) + HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS]) + HAVE_WMEMCHR=1; AC_SUBST([HAVE_WMEMCHR]) + HAVE_WMEMCMP=1; AC_SUBST([HAVE_WMEMCMP]) + HAVE_WMEMCPY=1; AC_SUBST([HAVE_WMEMCPY]) + HAVE_WMEMMOVE=1; AC_SUBST([HAVE_WMEMMOVE]) + HAVE_WMEMSET=1; AC_SUBST([HAVE_WMEMSET]) + HAVE_WCSLEN=1; AC_SUBST([HAVE_WCSLEN]) + HAVE_WCSNLEN=1; AC_SUBST([HAVE_WCSNLEN]) + HAVE_WCSCPY=1; AC_SUBST([HAVE_WCSCPY]) + HAVE_WCPCPY=1; AC_SUBST([HAVE_WCPCPY]) + HAVE_WCSNCPY=1; AC_SUBST([HAVE_WCSNCPY]) + HAVE_WCPNCPY=1; AC_SUBST([HAVE_WCPNCPY]) + HAVE_WCSCAT=1; AC_SUBST([HAVE_WCSCAT]) + HAVE_WCSNCAT=1; AC_SUBST([HAVE_WCSNCAT]) + HAVE_WCSCMP=1; AC_SUBST([HAVE_WCSCMP]) + HAVE_WCSNCMP=1; AC_SUBST([HAVE_WCSNCMP]) + HAVE_WCSCASECMP=1; AC_SUBST([HAVE_WCSCASECMP]) + HAVE_WCSNCASECMP=1; AC_SUBST([HAVE_WCSNCASECMP]) + HAVE_WCSCOLL=1; AC_SUBST([HAVE_WCSCOLL]) + HAVE_WCSXFRM=1; AC_SUBST([HAVE_WCSXFRM]) + HAVE_WCSDUP=1; AC_SUBST([HAVE_WCSDUP]) + HAVE_WCSCHR=1; AC_SUBST([HAVE_WCSCHR]) + HAVE_WCSRCHR=1; AC_SUBST([HAVE_WCSRCHR]) + HAVE_WCSCSPN=1; AC_SUBST([HAVE_WCSCSPN]) + HAVE_WCSSPN=1; AC_SUBST([HAVE_WCSSPN]) + HAVE_WCSPBRK=1; AC_SUBST([HAVE_WCSPBRK]) + HAVE_WCSSTR=1; AC_SUBST([HAVE_WCSSTR]) + HAVE_WCSTOK=1; AC_SUBST([HAVE_WCSTOK]) + HAVE_WCSWIDTH=1; AC_SUBST([HAVE_WCSWIDTH]) + HAVE_WCSFTIME=1; AC_SUBST([HAVE_WCSFTIME]) + HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB]) + HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH]) + REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T]) + REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC]) + REPLACE_WCTOB=0; AC_SUBST([REPLACE_WCTOB]) + REPLACE_MBSINIT=0; AC_SUBST([REPLACE_MBSINIT]) + REPLACE_MBRTOWC=0; AC_SUBST([REPLACE_MBRTOWC]) + REPLACE_MBRLEN=0; AC_SUBST([REPLACE_MBRLEN]) + REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS]) + REPLACE_MBSNRTOWCS=0; AC_SUBST([REPLACE_MBSNRTOWCS]) + REPLACE_WCRTOMB=0; AC_SUBST([REPLACE_WCRTOMB]) + REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS]) + REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS]) + REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH]) + REPLACE_WCSWIDTH=0; AC_SUBST([REPLACE_WCSWIDTH]) + REPLACE_WCSFTIME=0; AC_SUBST([REPLACE_WCSFTIME]) +]) +m4trace:m4/wchar_t.m4:11: -1- AC_DEFUN([gt_TYPE_WCHAR_T], [ + AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + wchar_t foo = (wchar_t)'\0';]], + [[]])], + [gt_cv_c_wchar_t=yes], + [gt_cv_c_wchar_t=no])]) + if test $gt_cv_c_wchar_t = yes; then + AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.]) + fi +]) +m4trace:m4/wcrtomb.m4:7: -1- AC_DEFUN([gl_FUNC_WCRTOMB], [ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + gl_MBSTATE_T_BROKEN + + AC_CHECK_FUNCS_ONCE([wcrtomb]) + if test $ac_cv_func_wcrtomb = no; then + HAVE_WCRTOMB=0 + AC_CHECK_DECLS([wcrtomb],,, [[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +]]) + if test $ac_cv_have_decl_wcrtomb = yes; then + dnl On Minix 3.1.8, the system's declares wcrtomb() although + dnl it does not have the function. Avoid a collision with gnulib's + dnl replacement. + REPLACE_WCRTOMB=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_WCRTOMB=1 + else + dnl On AIX 4.3, OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes + dnl returns 0 instead of 1. + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR]) + AC_REQUIRE([gt_LOCALE_FR_UTF8]) + AC_REQUIRE([gt_LOCALE_JA]) + AC_REQUIRE([gt_LOCALE_ZH_CN]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether wcrtomb return value is correct], + [gl_cv_func_wcrtomb_retval], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on AIX 4, OSF/1 and Solaris. + aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wcrtomb_retval="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + int result = 0; + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 1; + } + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 2; + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 4; + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 8; + } + return result; +}]])], + [gl_cv_func_wcrtomb_retval=yes], + [gl_cv_func_wcrtomb_retval=no], + [:]) + fi + ]) + case "$gl_cv_func_wcrtomb_retval" in + *yes) ;; + *) REPLACE_WCRTOMB=1 ;; + esac + fi + fi +]) +m4trace:m4/wcrtomb.m4:110: -1- AC_DEFUN([gl_PREREQ_WCRTOMB], [ + : +]) +m4trace:m4/wctob.m4:7: -1- AC_DEFUN([gl_FUNC_WCTOB], [ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_CHECK_FUNCS_ONCE([wctob]) + if test $ac_cv_func_wctob = no; then + HAVE_WCTOB=0 + HAVE_DECL_WCTOB=0 + else + HAVE_WCTOB=1 + + dnl Solaris 9 has the wctob() function but it does not work. + dnl Cygwin 1.7.2 has the wctob() function but it clobbers caller-owned + dnl registers, see . + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether wctob works], + [gl_cv_func_wctob_works], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on Solaris <= 9 and Cygwin. + solaris2.[1-9] | solaris2.[1-9].* | cygwin*) + gl_cv_func_wctob_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wctob_works="guessing yes" ;; + esac +changequote([,])dnl + case "$host_os" in + cygwin*) + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include + +register long global __asm__ ("%ebx"); + +int main () +{ + setlocale (LC_ALL, "en_US.UTF-8"); + + global = 0x12345678; + if (wctob (0x00FC) != -1) + return 1; + if (global != 0x12345678) + return 2; + return 0; +}]])], + [:], + [gl_cv_func_wctob_works=no], + [:]) + ;; + esac + if test "$gl_cv_func_wctob_works" != no && test $LOCALE_FR != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + wchar_t wc; + + if (mbtowc (&wc, "\374", 1) == 1) + if (wctob (wc) != (unsigned char) '\374') + return 1; + } + return 0; +}]])], + [gl_cv_func_wctob_works=yes], + [gl_cv_func_wctob_works=no], + [:]) + fi + ]) + case "$gl_cv_func_wctob_works" in + *yes) ;; + *) REPLACE_WCTOB=1 ;; + esac + if test $REPLACE_WCTOB = 0; then + + dnl IRIX 6.5 has the wctob() function but does not declare it. + AC_CHECK_DECLS([wctob], [], [], [[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include +]]) + if test $ac_cv_have_decl_wctob != yes; then + HAVE_DECL_WCTOB=0 + fi + fi + fi +]) +m4trace:m4/wctob.m4:125: -1- AC_DEFUN([gl_PREREQ_WCTOB], [ + : +]) +m4trace:m4/wctomb.m4:7: -1- AC_DEFUN([gl_FUNC_WCTOMB], [ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + + if false; then + REPLACE_WCTOMB=1 + fi +]) +m4trace:m4/wctomb.m4:17: -1- AC_DEFUN([gl_PREREQ_WCTOMB], [ + : +]) +m4trace:m4/wctype_h.m4:12: -1- AC_DEFUN([gl_WCTYPE_H], [ + AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_FUNCS_ONCE([iswcntrl]) + if test $ac_cv_func_iswcntrl = yes; then + HAVE_ISWCNTRL=1 + else + HAVE_ISWCNTRL=0 + fi + AC_SUBST([HAVE_ISWCNTRL]) + + AC_REQUIRE([gt_TYPE_WINT_T]) + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + AC_SUBST([HAVE_WINT_T]) + + AC_REQUIRE([gl_TYPE_WINT_T_PREREQ]) + + gl_CHECK_NEXT_HEADERS([wctype.h]) + if test $ac_cv_header_wctype_h = yes; then + if test $ac_cv_func_iswcntrl = yes; then + dnl Linux libc5 has an iswprint function that returns 0 for all arguments. + dnl The other functions are likely broken in the same way. + AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ + /* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + int main () { return iswprint ('x') == 0; } + ]])], + [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + #if __GNU_LIBRARY__ == 1 + Linux libc5 i18n is broken. + #endif]], [])], + [gl_cv_func_iswcntrl_works="guessing yes"], + [gl_cv_func_iswcntrl_works="guessing no"]) + ]) + ]) + fi + HAVE_WCTYPE_H=1 + else + HAVE_WCTYPE_H=0 + fi + AC_SUBST([HAVE_WCTYPE_H]) + + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac + AC_SUBST([REPLACE_ISWCNTRL]) + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + dnl Redefine all of iswcntrl, ..., iswxdigit in . + : + fi + + if test $REPLACE_ISWCNTRL = 1; then + REPLACE_TOWLOWER=1 + else + AC_CHECK_FUNCS([towlower]) + if test $ac_cv_func_towlower = yes; then + REPLACE_TOWLOWER=0 + else + AC_CHECK_DECLS([towlower],,, + [[/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + ]]) + if test $ac_cv_have_decl_towlower = yes; then + dnl On Minix 3.1.8, the system's declares towlower() and + dnl towupper() although it does not have the functions. Avoid a + dnl collision with gnulib's replacement. + REPLACE_TOWLOWER=1 + else + REPLACE_TOWLOWER=0 + fi + fi + fi + AC_SUBST([REPLACE_TOWLOWER]) + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then + dnl Redefine towlower, towupper in . + : + fi + + dnl We assume that the wctype() and iswctype() functions exist if and only + dnl if the type wctype_t is defined in or in if that + dnl exists. + dnl HP-UX 11.00 declares all these in and lacks . + AC_CACHE_CHECK([for wctype_t], [gl_cv_type_wctype_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + wctype_t a; + ]], + [[]])], + [gl_cv_type_wctype_t=yes], + [gl_cv_type_wctype_t=no]) + ]) + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi + + dnl We assume that the wctrans() and towctrans() functions exist if and only + dnl if the type wctrans_t is defined in . + AC_CACHE_CHECK([for wctrans_t], [gl_cv_type_wctrans_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + wctrans_t a; + ]], + [[]])], + [gl_cv_type_wctrans_t=yes], + [gl_cv_type_wctrans_t=no]) + ]) + if test $gl_cv_type_wctrans_t = no; then + HAVE_WCTRANS_T=0 + fi + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +# include +#endif +#include + ]], + [wctype iswctype wctrans towctrans + ]) +]) +m4trace:m4/wctype_h.m4:190: -1- AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR], [ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) +m4trace:m4/wctype_h.m4:199: -1- AC_DEFUN([gl_WCTYPE_H_DEFAULTS], [ + GNULIB_ISWBLANK=0; AC_SUBST([GNULIB_ISWBLANK]) + GNULIB_WCTYPE=0; AC_SUBST([GNULIB_WCTYPE]) + GNULIB_ISWCTYPE=0; AC_SUBST([GNULIB_ISWCTYPE]) + GNULIB_WCTRANS=0; AC_SUBST([GNULIB_WCTRANS]) + GNULIB_TOWCTRANS=0; AC_SUBST([GNULIB_TOWCTRANS]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_ISWBLANK=1; AC_SUBST([HAVE_ISWBLANK]) + HAVE_WCTYPE_T=1; AC_SUBST([HAVE_WCTYPE_T]) + HAVE_WCTRANS_T=1; AC_SUBST([HAVE_WCTRANS_T]) + REPLACE_ISWBLANK=0; AC_SUBST([REPLACE_ISWBLANK]) +]) +m4trace:m4/wcwidth.m4:7: -1- AC_DEFUN([gl_FUNC_WCWIDTH], [ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + dnl Persuade glibc to declare wcwidth(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([gt_TYPE_WCHAR_T]) + AC_REQUIRE([gt_TYPE_WINT_T]) + + AC_CHECK_HEADERS_ONCE([wchar.h]) + AC_CHECK_FUNCS_ONCE([wcwidth]) + + AC_CHECK_DECLS([wcwidth], [], [], [[ +/* AIX 3.2.5 declares wcwidth in . */ +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include +]]) + if test $ac_cv_have_decl_wcwidth != yes; then + HAVE_DECL_WCWIDTH=0 + fi + + if test $ac_cv_func_wcwidth = yes; then + HAVE_WCWIDTH=1 + dnl On Mac OS X 10.3, wcwidth(0x0301) (COMBINING ACUTE ACCENT) returns 1. + dnl On OpenBSD 5.0, wcwidth(0x05B0) (HEBREW POINT SHEVA) returns 1. + dnl On OSF/1 5.1, wcwidth(0x200B) (ZERO WIDTH SPACE) returns 1. + dnl On OpenBSD 5.8, wcwidth(0xFF1A) (FULLWIDTH COLON) returns 0. + dnl This leads to bugs in 'ls' (coreutils). + AC_CACHE_CHECK([whether wcwidth works reasonably in UTF-8 locales], + [gl_cv_func_wcwidth_works], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +/* AIX 3.2.5 declares wcwidth in . */ +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include +#if !HAVE_DECL_WCWIDTH +extern +# ifdef __cplusplus +"C" +# endif +int wcwidth (int); +#endif +int main () +{ + int result = 0; + if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL) + { + if (wcwidth (0x0301) > 0) + result |= 1; + if (wcwidth (0x05B0) > 0) + result |= 2; + if (wcwidth (0x200B) > 0) + result |= 4; + if (wcwidth (0xFF1A) == 0) + result |= 8; + } + return result; +}]])], + [gl_cv_func_wcwidth_works=yes], + [gl_cv_func_wcwidth_works=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc and AIX 7 systems. + *-gnu* | aix[7-9]*) gl_cv_func_wcwidth_works="guessing yes";; + *) gl_cv_func_wcwidth_works="guessing no";; + esac +changequote([,])dnl + ]) + ]) + case "$gl_cv_func_wcwidth_works" in + *yes) ;; + *no) REPLACE_WCWIDTH=1 ;; + esac + else + HAVE_WCWIDTH=0 + fi + dnl We don't substitute HAVE_WCWIDTH. We assume that if the system does not + dnl have the wcwidth function, then it does not declare it. +]) +m4trace:m4/wint_t.m4:12: -1- AC_DEFUN([gt_TYPE_WINT_T], [ + AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include + wint_t foo = (wchar_t)'\0';]], + [[]])], + [gt_cv_c_wint_t=yes], + [gt_cv_c_wint_t=no])]) + if test $gt_cv_c_wint_t = yes; then + AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.]) + + dnl Determine whether gnulib's or would, if present, + dnl override 'wint_t'. + AC_CACHE_CHECK([whether wint_t is too small], + [gl_cv_type_wint_t_too_small], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +#endif +#include + int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; + ]])], + [gl_cv_type_wint_t_too_small=no], + [gl_cv_type_wint_t_too_small=yes])]) + if test $gl_cv_type_wint_t_too_small = yes; then + GNULIB_OVERRIDES_WINT_T=1 + else + GNULIB_OVERRIDES_WINT_T=0 + fi + else + GNULIB_OVERRIDES_WINT_T=0 + fi + AC_SUBST([GNULIB_OVERRIDES_WINT_T]) +]) +m4trace:m4/wint_t.m4:65: -1- AC_DEFUN([gl_TYPE_WINT_T_PREREQ], [ + AC_CHECK_HEADERS_ONCE([crtdefs.h]) + if test $ac_cv_header_crtdefs_h = yes; then + HAVE_CRTDEFS_H=1 + else + HAVE_CRTDEFS_H=0 + fi + AC_SUBST([HAVE_CRTDEFS_H]) +]) +m4trace:m4/xalloc.m4:7: -1- AC_DEFUN([gl_XALLOC], [:]) +m4trace:m4/xsize.m4:7: -1- AC_DEFUN([gl_XSIZE], [ + dnl Prerequisites of lib/xsize.h. + AC_REQUIRE([gl_SIZE_MAX]) + AC_CHECK_HEADERS([stdint.h]) +]) +m4trace:m4/xstrndup.m4:7: -1- AC_DEFUN([gl_XSTRNDUP], [ + gl_PREREQ_XSTRNDUP +]) +m4trace:m4/xstrndup.m4:13: -1- AC_DEFUN([gl_PREREQ_XSTRNDUP], [ + : +]) +m4trace:m4/xstrtol.m4:7: -1- AC_DEFUN([gl_XSTRTOL], [ + : +]) +m4trace:m4/xvasprintf.m4:8: -1- AC_DEFUN([gl_XVASPRINTF], [:]) +m4trace:configure.ac:21: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.ac:21: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.ac:21: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section 'AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.ac:21: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.ac:21: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.ac:21: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.ac:21: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^runstatedir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.ac:27: -1- AC_CONFIG_MACRO_DIR([m4]) +m4trace:configure.ac:27: -1- AC_CONFIG_MACRO_DIR_TRACE([m4]) +m4trace:configure.ac:29: -1- AM_INIT_AUTOMAKE([1.11 dist-xz no-dist-gzip subdir-objects + color-tests parallel-tests]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.ac:29: -1- AM_SET_CURRENT_AUTOMAKE_VERSION +m4trace:configure.ac:29: -1- AM_AUTOMAKE_VERSION([1.18.1]) +m4trace:configure.ac:29: -1- _AM_AUTOCONF_VERSION([2.72]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.ac:29: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.ac:29: -1- _AM_SET_OPTIONS([1.11 dist-xz no-dist-gzip subdir-objects + color-tests parallel-tests]) +m4trace:configure.ac:29: -1- _AM_SET_OPTION([1.11]) +m4trace:configure.ac:29: -2- _AM_MANGLE_OPTION([1.11]) +m4trace:configure.ac:29: -1- _AM_SET_OPTION([dist-xz]) +m4trace:configure.ac:29: -2- _AM_MANGLE_OPTION([dist-xz]) +m4trace:configure.ac:29: -1- _AM_SET_OPTION([no-dist-gzip]) +m4trace:configure.ac:29: -2- _AM_MANGLE_OPTION([no-dist-gzip]) +m4trace:configure.ac:29: -1- _AM_SET_OPTION([subdir-objects]) +m4trace:configure.ac:29: -2- _AM_MANGLE_OPTION([subdir-objects]) +m4trace:configure.ac:29: -1- _AM_SET_OPTION([color-tests]) +m4trace:configure.ac:29: -2- _AM_MANGLE_OPTION([color-tests]) +m4trace:configure.ac:29: -1- _AM_SET_OPTION([parallel-tests]) +m4trace:configure.ac:29: -2- _AM_MANGLE_OPTION([parallel-tests]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:29: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])]) +m4trace:configure.ac:29: -2- _AM_MANGLE_OPTION([no-define]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:29: -1- AM_SANITY_CHECK +m4trace:configure.ac:29: -1- _AM_FILESYSTEM_TIMESTAMP_RESOLUTION +m4trace:configure.ac:29: -1- _AM_SLEEP_FRACTIONAL_SECONDS +m4trace:configure.ac:29: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +m4trace:configure.ac:29: -1- AM_MISSING_HAS_RUN +m4trace:configure.ac:29: -1- AM_AUX_DIR_EXPAND +m4trace:configure.ac:29: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.ac:29: -1- AM_MISSING_PROG([AUTOCONF], [autoconf]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.ac:29: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.ac:29: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.ac:29: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.ac:29: -1- AM_PROG_INSTALL_SH +m4trace:configure.ac:29: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.ac:29: -1- AM_PROG_INSTALL_STRIP +m4trace:configure.ac:29: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.ac:29: -1- AC_PROG_MKDIR_P +m4trace:configure.ac:29: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.ac:29: -1- AM_SET_LEADING_DOT +m4trace:configure.ac:29: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.ac:29: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_IF_OPTION([tar-v7], [_AM_PROG_TAR([v7])], + [_AM_PROG_TAR([ustar])])])]) +m4trace:configure.ac:29: -2- _AM_MANGLE_OPTION([tar-ustar]) +m4trace:configure.ac:29: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_IF_OPTION([tar-v7], [_AM_PROG_TAR([v7])], + [_AM_PROG_TAR([ustar])])]) +m4trace:configure.ac:29: -2- _AM_MANGLE_OPTION([tar-pax]) +m4trace:configure.ac:29: -1- _AM_IF_OPTION([tar-v7], [_AM_PROG_TAR([v7])], [_AM_PROG_TAR([ustar])]) +m4trace:configure.ac:29: -2- _AM_MANGLE_OPTION([tar-v7]) +m4trace:configure.ac:29: -1- _AM_PROG_TAR([ustar]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.ac:29: -1- AM_RUN_LOG([$_am_tar --version]) +m4trace:configure.ac:29: -1- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) +m4trace:configure.ac:29: -1- AM_RUN_LOG([$am__untar ], [sigsegv_deinstall_handler();], [no, consider installing GNU libsigsegv]) +m4trace:configure.ac:42: -1- AC_LIB_PREPARE_PREFIX +m4trace:configure.ac:42: -1- AC_LIB_RPATH +m4trace:configure.ac:42: -1- AC_LIB_PROG_LD +m4trace:configure.ac:42: -1- AC_LIB_PROG_LD_GNU +m4trace:configure.ac:42: -1- AC_LIB_LINKFLAGS_BODY([sigsegv], []) +m4trace:configure.ac:42: -1- AC_LIB_PREPARE_MULTILIB +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:42: -1- AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCSIGSEGV]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LIBSIGSEGV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LIBSIGSEGV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBSIGSEGV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LTLIBSIGSEGV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBSIGSEGV_PREFIX$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_sigaltstack], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" sigaltstack ]AS_TR_CPP([HAVE_sigaltstack])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SIGALTSTACK$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_unistd_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" unistd.h ]AS_TR_SH([unistd.h]) AS_TR_CPP([HAVE_unistd.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_ucontext_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" ucontext.h ]AS_TR_SH([ucontext.h]) AS_TR_CPP([HAVE_ucontext.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STACK_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBCSTACK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LTLIBCSTACK$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_readlinkat], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" readlinkat ]AS_TR_CPP([HAVE_readlinkat])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_CLOCK_TIME +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIB_CLOCK_GETTIME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_CLOCK_GETTIME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_CLOCK_SETTIME$]) +m4trace:configure.ac:42: -1- gl_FUNC_CLOSE +m4trace:configure.ac:42: -1- gl_UNISTD_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CHDIR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CHOWN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CLOSE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_DUP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_DUP2$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_DUP3$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ENVIRON$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_EUIDACCESS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FACCESSAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FCHDIR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FCHOWNAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FDATASYNC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSYNC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FTRUNCATE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETCWD$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETDOMAINNAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETDTABLESIZE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETGROUPS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETHOSTNAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETLOGIN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETLOGIN_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETPAGESIZE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETUSERSHELL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GROUP_MEMBER$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ISATTY$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LCHOWN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LINK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LINKAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LSEEK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PIPE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PIPE2$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PREAD$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PWRITE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_READ$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_READLINK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_READLINKAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RMDIR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SETHOSTNAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SLEEP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SYMLINK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SYMLINKAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TRUNCATE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TTYNAME_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNISTD_H_NONBLOCKING$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNISTD_H_SIGPIPE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNLINK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNLINKAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_USLEEP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WRITE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_CHOWN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DUP2$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DUP3$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_EUIDACCESS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FACCESSAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FCHDIR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FCHOWNAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FDATASYNC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FSYNC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FTRUNCATE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETDTABLESIZE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETGROUPS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETHOSTNAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETLOGIN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETPAGESIZE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GROUP_MEMBER$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LCHOWN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LINK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LINKAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PIPE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PIPE2$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PREAD$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PWRITE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_READLINK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_READLINKAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SETHOSTNAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SLEEP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYMLINK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYMLINKAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TRUNCATE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UNLINKAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_USLEEP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_ENVIRON$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FCHDIR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FDATASYNC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETDOMAINNAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETLOGIN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETLOGIN_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETPAGESIZE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETUSERSHELL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SETHOSTNAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_TTYNAME_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_OS_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_PARAM_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_CHOWN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_CLOSE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_DUP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_DUP2$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FCHOWNAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FTRUNCATE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETCWD$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETDOMAINNAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETDTABLESIZE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETLOGIN_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETGROUPS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETPAGESIZE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ISATTY$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LCHOWN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LINK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LINKAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LSEEK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PREAD$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PWRITE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_READ$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_READLINK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_READLINKAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_RMDIR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SLEEP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SYMLINK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SYMLINKAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TRUNCATE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TTYNAME_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_UNLINK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_UNLINKAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_USLEEP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WRITE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UNISTD_H_HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS$]) +m4trace:configure.ac:42: -1- gl_MSVC_INVAL +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func__set_invalid_parameter_handler], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" _set_invalid_parameter_handler ]AS_TR_CPP([HAVE__set_invalid_parameter_handler])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MSVC_INVALID_PARAMETER_HANDLER$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MSVC_INVALID_PARAMETER_HANDLER$]) +m4trace:configure.ac:42: -1- gl_PREREQ_SYS_H_WINSOCK2 +m4trace:configure.ac:42: -1- gl_SYS_IOCTL_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_IOCTL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SYS_IOCTL_H_HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_IOCTL$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_socket_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/socket.h ]AS_TR_SH([sys/socket.h]) AS_TR_CPP([HAVE_sys/socket.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([close.c]) +m4trace:configure.ac:42: -1- gl_UNISTD_MODULE_INDICATOR([close]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([close]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[close]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([close]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_CLOSE$]) +m4trace:configure.ac:42: -1- gl_CONFIG_H +m4trace:configure.ac:42: -1- gl_CONFIGMAKE_PREP +m4trace:configure.ac:42: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^lispdir$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^runstatedir$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^pkglibexecdir$]) +m4trace:configure.ac:42: -1- gl_CTYPE_H +m4trace:configure.ac:42: -1- gl_CTYPE_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ISBLANK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ISBLANK$]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS([ctype.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([ctype.h], [assume]) +m4trace:configure.ac:42: -1- gl_INCLUDE_NEXT +m4trace:configure.ac:42: -1- m4_pattern_allow([^INCLUDE_NEXT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INCLUDE_NEXT_AS_FIRST_DIRECTIVE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRAGMA_SYSTEM_HEADER$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRAGMA_COLUMNS$]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([ctype.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_CTYPE_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_CTYPE_H$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[#include + ]], [isblank]) +m4trace:configure.ac:42: -1- gl_DIRNAME +m4trace:configure.ac:42: -1- gl_DIRNAME_LGPL +m4trace:configure.ac:42: -1- gl_DOUBLE_SLASH_ROOT +m4trace:configure.ac:42: -1- m4_pattern_allow([^DOUBLE_SLASH_IS_DISTINCT_ROOT$]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR([dirname]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_DIRNAME$]) +m4trace:configure.ac:42: -1- gl_DIRNAME_LGPL +m4trace:configure.ac:42: -1- gl_DOUBLE_SLASH_ROOT +m4trace:configure.ac:42: -1- m4_pattern_allow([^DOUBLE_SLASH_IS_DISTINCT_ROOT$]) +m4trace:configure.ac:42: -1- gl_FUNC_DUP2 +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DUP2$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SETDTABLESIZE$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([dup2.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_DUP2 +m4trace:configure.ac:42: -1- gl_UNISTD_MODULE_INDICATOR([dup2]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([dup2]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[dup2]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([dup2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_DUP2$]) +m4trace:configure.ac:42: -1- gl_ENVIRON +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_unistd_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" unistd.h ]AS_TR_SH([unistd.h]) AS_TR_CPP([HAVE_unistd.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gt_CHECK_VAR_DECL([#if HAVE_UNISTD_H + #include + #endif + /* mingw, BeOS, Haiku declare environ in , not in . */ + #include + ], [environ]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ENVIRON_DECL$]) +m4trace:configure.ac:42: -1- gl_UNISTD_MODULE_INDICATOR([environ]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([environ]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[environ]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([environ]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_ENVIRON$]) +m4trace:configure.ac:42: -1- gl_HEADER_ERRNO_H +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS([errno.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([errno.h], [assume]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([errno.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_ERRNO_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_ERRNO_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ERRNO_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ERRNO_H_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ERRNO_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ERRNO_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ERRNO_H_FALSE]) +m4trace:configure.ac:42: -1- gl_REPLACE_ERRNO_VALUE([EMULTIHOP]) +m4trace:configure.ac:42: -1- AC_COMPUTE_INT([gl_cv_header_errno_h_EMULTIHOP], [EMULTIHOP], [ +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^EMULTIHOP_HIDDEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^EMULTIHOP_VALUE$]) +m4trace:configure.ac:42: -1- gl_REPLACE_ERRNO_VALUE([ENOLINK]) +m4trace:configure.ac:42: -1- AC_COMPUTE_INT([gl_cv_header_errno_h_ENOLINK], [ENOLINK], [ +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ENOLINK_HIDDEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ENOLINK_VALUE$]) +m4trace:configure.ac:42: -1- gl_REPLACE_ERRNO_VALUE([EOVERFLOW]) +m4trace:configure.ac:42: -1- AC_COMPUTE_INT([gl_cv_header_errno_h_EOVERFLOW], [EOVERFLOW], [ +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^EOVERFLOW_HIDDEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^EOVERFLOW_VALUE$]) +m4trace:configure.ac:42: -1- gl_ERROR +m4trace:configure.ac:42: -1- gl_LIBSOURCES([error.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_ERROR +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_strerror_r], [_AC_CHECK_DECLS([strerror_r])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRERROR_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRERROR_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STRERROR_R_CHAR_P$]) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--flag=error:3:c-format]) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION_INIT +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--flag=error_at_line:5:c-format]) +m4trace:configure.ac:42: -1- gl_EXTERN_INLINE +m4trace:configure.ac:42: -1- gl_FUNC_FCNTL +m4trace:configure.ac:42: -1- gl_FCNTL_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FCNTL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_NONBLOCKING$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_OPEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_OPENAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FCNTL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_OPENAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FCNTL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_OPEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_OPENAT$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_fcntl], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" fcntl ]AS_TR_CPP([HAVE_fcntl])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_REPLACE_FCNTL +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_fcntl], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" fcntl ]AS_TR_CPP([HAVE_fcntl])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_REPLACE_FCNTL +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_fcntl], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" fcntl ]AS_TR_CPP([HAVE_fcntl])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^FCNTL_DUPFD_BUGGY$]) +m4trace:configure.ac:42: -1- gl_REPLACE_FCNTL +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_fcntl], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" fcntl ]AS_TR_CPP([HAVE_fcntl])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([fcntl.c]) +m4trace:configure.ac:42: -1- gl_FCNTL_MODULE_INDICATOR([fcntl]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([fcntl]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[fcntl]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([fcntl]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_FCNTL$]) +m4trace:configure.ac:42: -1- gl_FCNTL_H +m4trace:configure.ac:42: -1- gl_FCNTL_O_FLAGS +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_unistd_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" unistd.h ]AS_TR_SH([unistd.h]) AS_TR_CPP([HAVE_unistd.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_symlink], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" symlink ]AS_TR_CPP([HAVE_symlink])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WORKING_O_NOATIME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WORKING_O_NOFOLLOW$]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS([fcntl.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([fcntl.h], [assume]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([fcntl.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_FCNTL_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_FCNTL_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^pid_t$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^mode_t$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[#include + ]], [fcntl openat]) +m4trace:configure.ac:42: -1- gl_FILE_NAME_CONCAT +m4trace:configure.ac:42: -1- gl_FILE_NAME_CONCAT_LGPL +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mempcpy], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mempcpy ]AS_TR_CPP([HAVE_mempcpy])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR([filenamecat]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FILENAMECAT$]) +m4trace:configure.ac:42: -1- gl_FILE_NAME_CONCAT_LGPL +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mempcpy], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mempcpy ]AS_TR_CPP([HAVE_mempcpy])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_C_FLEXIBLE_ARRAY_MEMBER +m4trace:configure.ac:42: -1- m4_pattern_allow([^FLEXIBLE_ARRAY_MEMBER$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^FLEXIBLE_ARRAY_MEMBER$]) +m4trace:configure.ac:42: -1- gl_FLOAT_H +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS([float.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([float.h], [assume]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([float.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_FLOAT_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_FLOAT_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^FLOAT_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_FLOAT_H], [test -n "$FLOAT_H"]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_FLOAT_H_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_FLOAT_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_FLOAT_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_FLOAT_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ITOLD$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([float.c]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([itold.c]) +m4trace:configure.ac:42: -1- gl_FUNC_FNMATCH_POSIX +m4trace:configure.ac:42: -1- m4_pattern_allow([^FNMATCH_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_H"]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_FNMATCH_H_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_FNMATCH_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_FNMATCH_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_FNMATCH_H_FALSE]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([fnmatch.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_FNMATCH +m4trace:configure.ac:42: -1- m4_pattern_allow([^fnmatch$]) +m4trace:configure.ac:42: -1- AC_TYPE_MBSTATE_T +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBSTATE_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^mbstate_t$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_ISBLANK$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_btowc], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" btowc ]AS_TR_CPP([HAVE_btowc])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_isblank], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" isblank ]AS_TR_CPP([HAVE_isblank])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_iswctype], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" iswctype ]AS_TR_CPP([HAVE_iswctype])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mbsrtowcs], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mbsrtowcs ]AS_TR_CPP([HAVE_mbsrtowcs])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mempcpy], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mempcpy ]AS_TR_CPP([HAVE_mempcpy])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_wmemchr], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" wmemchr ]AS_TR_CPP([HAVE_wmemchr])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_wmemcpy], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" wmemcpy ]AS_TR_CPP([HAVE_wmemcpy])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_wmempcpy], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" wmempcpy ]AS_TR_CPP([HAVE_wmempcpy])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_wctype_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" wctype.h ]AS_TR_SH([wctype.h]) AS_TR_CPP([HAVE_wctype.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_FUNC_FNMATCH_GNU +m4trace:configure.ac:42: -1- gl_LIBSOURCES([fnmatch.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_FNMATCH +m4trace:configure.ac:42: -1- m4_pattern_allow([^fnmatch$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_ISBLANK$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_btowc], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" btowc ]AS_TR_CPP([HAVE_btowc])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_isblank], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" isblank ]AS_TR_CPP([HAVE_isblank])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_iswctype], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" iswctype ]AS_TR_CPP([HAVE_iswctype])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mbsrtowcs], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mbsrtowcs ]AS_TR_CPP([HAVE_mbsrtowcs])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mempcpy], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mempcpy ]AS_TR_CPP([HAVE_mempcpy])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_wmemchr], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" wmemchr ]AS_TR_CPP([HAVE_wmemchr])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_wmemcpy], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" wmemcpy ]AS_TR_CPP([HAVE_wmemcpy])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_wmempcpy], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" wmempcpy ]AS_TR_CPP([HAVE_wmempcpy])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_wctype_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" wctype.h ]AS_TR_SH([wctype.h]) AS_TR_CPP([HAVE_wctype.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_FUNC_FREOPEN +m4trace:configure.ac:42: -1- gl_STDIO_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_DPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FCLOSE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FDOPEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FFLUSH$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FGETC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FGETS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FOPEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FPRINTF_POSIX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FPURGE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FPUTC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FPUTS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FREAD$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FREOPEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSCANF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSEEK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSEEKO$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FTELL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FTELLO$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FWRITE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETCHAR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETDELIM$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETLINE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_OBSTACK_PRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_OBSTACK_PRINTF_POSIX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PCLOSE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PERROR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_POPEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PRINTF_POSIX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PUTC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PUTCHAR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PUTS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_REMOVE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RENAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RENAMEAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SCANF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SNPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SPRINTF_POSIX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STDIO_H_NONBLOCKING$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STDIO_H_SIGPIPE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TMPFILE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VASPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VFSCANF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VSCANF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VDPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VFPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VFPRINTF_POSIX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VPRINTF_POSIX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VSNPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VSPRINTF_POSIX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FPURGE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FSEEKO$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FTELLO$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETDELIM$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETLINE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_OBSTACK_PRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SNPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_VSNPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FSEEKO$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FTELLO$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PCLOSE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_POPEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RENAMEAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_VASPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_VDPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_DPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FCLOSE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FDOPEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FFLUSH$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FOPEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FPURGE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FREOPEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FSEEK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FSEEKO$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FTELL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FTELLO$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETDELIM$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETLINE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_OBSTACK_PRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PERROR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_POPEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_REMOVE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_RENAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_RENAMEAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SNPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STDIO_READ_FUNCS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STDIO_WRITE_FUNCS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TMPFILE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VASPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VDPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VFPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VSNPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VSPRINTF$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([freopen.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_FREOPEN +m4trace:configure.ac:42: -1- gl_STDIO_MODULE_INDICATOR([freopen]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([freopen]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[freopen]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([freopen]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_FREOPEN$]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR([freopen-safer]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FREOPEN_SAFER$]) +m4trace:configure.ac:42: -1- gl_FUNC_FSTAT +m4trace:configure.ac:42: -1- gl_SYS_STAT_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FCHMODAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSTAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSTATAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FUTIMENS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LCHMOD$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LSTAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKDIRAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKFIFO$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKFIFOAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKNOD$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKNODAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UTIMENSAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_OVERRIDES_STRUCT_STAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FCHMODAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FSTATAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FUTIMENS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LCHMOD$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LSTAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKDIRAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKFIFO$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKFIFOAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKNOD$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKNODAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UTIMENSAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FSTAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FSTATAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FUTIMENS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LSTAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MKDIR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MKFIFO$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MKNOD$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_UTIMENSAT$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([fstat.c]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([stat-w32.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_FSTAT +m4trace:configure.ac:42: -1- gl_HEADER_SYS_STAT_H +m4trace:configure.ac:42: -1- m4_pattern_allow([^STAT_MACROS_BROKEN$]) +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([sys/stat.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([sys/stat.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_stat_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/stat.h ]AS_TR_SH([sys/stat.h]) AS_TR_CPP([HAVE_sys/stat.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([sys/stat.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_STAT_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_STAT_TIMESPEC$]) +m4trace:configure.ac:42: -1- gl_LARGEFILE +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_64_BIT_ST_SIZE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^nlink_t$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[#include + ]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat + mknod mknodat stat utimensat]) +m4trace:configure.ac:42: -1- gl_SYS_STAT_MODULE_INDICATOR([fstat]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([fstat]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[fstat]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([fstat]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_FSTAT$]) +m4trace:configure.ac:42: -1- gl_FUNC_GETDTABLESIZE +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_getdtablesize], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" getdtablesize ]AS_TR_CPP([HAVE_getdtablesize])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_getdtablesize], [_AC_CHECK_DECLS([getdtablesize])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETDTABLESIZE$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([getdtablesize.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_GETDTABLESIZE +m4trace:configure.ac:42: -1- gl_UNISTD_MODULE_INDICATOR([getdtablesize]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([getdtablesize]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[getdtablesize]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([getdtablesize]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_GETDTABLESIZE$]) +m4trace:configure.ac:42: -1- gl_FUNC_GETOPT_GNU +m4trace:configure.ac:42: -1- gl_FUNC_GETOPT_POSIX +m4trace:configure.ac:42: -1- gl_GETOPT_CHECK_HEADERS +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([getopt.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([getopt.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_getopt_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" getopt.h ]AS_TR_SH([getopt.h]) AS_TR_CPP([HAVE_getopt.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([getopt.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_GETOPT_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_GETOPT_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETOPT_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETOPT_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETOPT_LONG_ONLY$]) +m4trace:configure.ac:42: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [./lib/autoconf/general.m4:2979: AC_RUN_IFELSE is expanded from... +lib/m4sugar/m4sh.m4:690: _AS_IF_ELSE is expanded from... +lib/m4sugar/m4sh.m4:697: AS_IF is expanded from... +./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... +./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... +m4/getopt.m4:48: gl_GETOPT_CHECK_HEADERS is expanded from... +m4/getopt.m4:8: gl_FUNC_GETOPT_POSIX is expanded from... +m4/gnulib-comp.m4:445: gl_INIT is expanded from... +configure.ac:42: the top level]) +m4trace:configure.ac:42: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [./lib/autoconf/general.m4:2979: AC_RUN_IFELSE is expanded from... +lib/m4sugar/m4sh.m4:690: _AS_IF_ELSE is expanded from... +lib/m4sugar/m4sh.m4:697: AS_IF is expanded from... +./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... +./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... +m4/getopt.m4:48: gl_GETOPT_CHECK_HEADERS is expanded from... +m4/getopt.m4:8: gl_FUNC_GETOPT_POSIX is expanded from... +m4/gnulib-comp.m4:445: gl_INIT is expanded from... +configure.ac:42: the top level]) +m4trace:configure.ac:42: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [./lib/autoconf/general.m4:2979: AC_RUN_IFELSE is expanded from... +lib/m4sugar/m4sh.m4:690: _AS_IF_ELSE is expanded from... +lib/m4sugar/m4sh.m4:697: AS_IF is expanded from... +./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... +./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... +m4/getopt.m4:48: gl_GETOPT_CHECK_HEADERS is expanded from... +m4/getopt.m4:8: gl_FUNC_GETOPT_POSIX is expanded from... +m4/gnulib-comp.m4:445: gl_INIT is expanded from... +configure.ac:42: the top level]) +m4trace:configure.ac:42: -1- GL_NOCRASH +m4trace:configure.ac:42: -1- gl_GETOPT_SUBSTITUTE_HEADER +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_cdefs_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/cdefs.h ]AS_TR_SH([sys/cdefs.h]) AS_TR_CPP([HAVE_sys/cdefs.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_CDEFS_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^__GETOPT_PREFIX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GETOPT_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GETOPT_CDEFS_H$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([getopt.c]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([getopt1.c]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GL_UNISTD_H_GETOPT$]) +m4trace:configure.ac:42: -1- gl_FUNC_GETPROGNAME +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_getprogname], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" getprogname ]AS_TR_CPP([HAVE_getprogname])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_getexecname], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" getexecname ]AS_TR_CPP([HAVE_getexecname])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_PROGRAM_INVOCATION_NAME$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL___ARGV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_VAR___PROGNAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBINTL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LTLIBINTL$]) +m4trace:configure.ac:42: -1- gl_GETTIME +m4trace:configure.ac:42: -1- gl_TIMESPEC +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_gettimeofday], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" gettimeofday ]AS_TR_CPP([HAVE_gettimeofday])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_nanotime], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" nanotime ]AS_TR_CPP([HAVE_nanotime])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_FUNC_GETTIMEOFDAY +m4trace:configure.ac:42: -1- gl_HEADER_SYS_TIME_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETTIMEOFDAY$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETTIMEOFDAY$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_TIMEVAL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_TIME_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETTIMEOFDAY$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRUCT_TIMEVAL$]) +m4trace:configure.ac:42: -1- AC_C_RESTRICT +m4trace:configure.ac:42: -1- m4_pattern_allow([^restrict$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^restrict$]) +m4trace:configure.ac:42: -1- gl_HEADER_SYS_TIME_H +m4trace:configure.ac:42: -1- gl_HEADER_SYS_TIME_H_BODY +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_time_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/time.h ]AS_TR_SH([sys/time.h]) AS_TR_CPP([HAVE_sys/time.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([sys/time.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([sys/time.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_time_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/time.h ]AS_TR_SH([sys/time.h]) AS_TR_CPP([HAVE_sys/time.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([sys/time.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_TIME_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H$]) +m4trace:configure.ac:42: -1- gl_PREREQ_SYS_H_WINSOCK2 +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_socket_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/socket.h ]AS_TR_SH([sys/socket.h]) AS_TR_CPP([HAVE_sys/socket.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[ +#if HAVE_SYS_TIME_H +# include +#endif +#include + ]], [gettimeofday]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_gettimeofday], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" gettimeofday ]AS_TR_CPP([HAVE_gettimeofday])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_FUNC_GETTIMEOFDAY_CLOBBER +m4trace:configure.ac:42: -1- gl_LOCALTIME_BUFFER_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GETTIMEOFDAY_CLOBBERS_LOCALTIME$]) +m4trace:configure.ac:42: -1- gl_LOCALTIME_BUFFER_NEEDED +m4trace:configure.ac:42: -1- gl_HEADER_TIME_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CTIME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKTIME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LOCALTIME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_NANOSLEEP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRFTIME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRPTIME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TIMEGM$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TIME_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TIME_RZ$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TZSET$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_LOCALTIME_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_NANOSLEEP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRPTIME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TIMEGM$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TZSET$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TIMEZONE_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_CTIME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LOCALTIME_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MKTIME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_NANOSLEEP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRFTIME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TIMEGM$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TZSET$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETTIMEOFDAY$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GMTIME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LOCALTIME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GETTIMEOFDAY_TIMEZONE$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([gettimeofday.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_GETTIMEOFDAY +m4trace:configure.ac:42: -1- gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([gettimeofday]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[gettimeofday]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([gettimeofday]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_GETTIMEOFDAY$]) +m4trace:configure.ac:42: -1- gl_GNU_MAKE +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GNU_MAKE], [${MAKE-make} --version /cannot/make/this >/dev/null 2>&1]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNU_MAKE_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNU_MAKE_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GNU_MAKE_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GNU_MAKE_FALSE]) +m4trace:configure.ac:42: -1- gl_HARD_LOCALE +m4trace:configure.ac:42: -1- AM_ICONV +m4trace:configure.ac:42: -1- AM_ICONV_LINK +m4trace:configure.ac:42: -1- AM_ICONV_LINKFLAGS_BODY +m4trace:configure.ac:42: -1- AC_LIB_LINKFLAGS_BODY([iconv]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:42: -1- AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ICONV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBICONV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LTLIBICONV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ICONV_CONST$]) +m4trace:configure.ac:42: -1- gl_ICONV_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ICONV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ICONV_CONST$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ICONV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ICONV_OPEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ICONV_UTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ICONV_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ICONV_H_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ICONV_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- gl_ICONV_MODULE_INDICATOR([iconv]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([iconv]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[iconv]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_ICONV_H +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([iconv.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([iconv.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_iconv_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" iconv.h ]AS_TR_SH([iconv.h]) AS_TR_CPP([HAVE_iconv.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([iconv.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_ICONV_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_ICONV_H$]) +m4trace:configure.ac:42: -1- gl_FUNC_ICONV_OPEN +m4trace:configure.ac:42: -1- gl_REPLACE_ICONV_H +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ICONV_H_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ICONV_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ICONV_FLAVOR$]) +m4trace:configure.ac:42: -1- gl_REPLACE_ICONV_OPEN +m4trace:configure.ac:42: -1- gl_REPLACE_ICONV_H +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ICONV_H_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ICONV_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([iconv_open.c]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([iconv.c]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([iconv_close.c]) +m4trace:configure.ac:42: -1- gl_INLINE +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_INLINE$]) +m4trace:configure.ac:42: -1- gl_INTTOSTR +m4trace:configure.ac:42: -1- gl_PREREQ_INTTOSTR +m4trace:configure.ac:42: -1- m4_pattern_allow([^off_t$]) +m4trace:configure.ac:42: -1- gl_PREREQ_IMAXTOSTR +m4trace:configure.ac:42: -1- gl_PREREQ_OFFTOSTR +m4trace:configure.ac:42: -1- gl_PREREQ_UMAXTOSTR +m4trace:configure.ac:42: -1- gl_PREREQ_UINTTOSTR +m4trace:configure.ac:42: -1- gl_INTTYPES_H +m4trace:configure.ac:42: -1- gl_INTTYPES_INCOMPLETE +m4trace:configure.ac:42: -1- gl_STDINT_H +m4trace:configure.ac:42: -1- gl_LIMITS_H +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([limits.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([limits.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_limits_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" limits.h ]AS_TR_SH([limits.h]) AS_TR_CPP([HAVE_limits.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([limits.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_LIMITS_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_LIMITS_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIMITS_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_LIMITS_H_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_LIMITS_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_LIMITS_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_LIMITS_H_FALSE]) +m4trace:configure.ac:42: -1- gt_TYPE_WINT_T +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINT_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_OVERRIDES_WINT_T$]) +m4trace:configure.ac:42: -1- AC_TYPE_LONG_LONG_INT +m4trace:configure.ac:42: -1- AC_TYPE_UNSIGNED_LONG_LONG_INT +m4trace:configure.ac:42: -1- _AC_TYPE_LONG_LONG_SNIPPET +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UNSIGNED_LONG_LONG_INT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LONG_LONG_INT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LONG_LONG_INT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UNSIGNED_LONG_LONG_INT$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_wchar_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" wchar.h ]AS_TR_SH([wchar.h]) AS_TR_CPP([HAVE_wchar.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCHAR_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_INTTYPES_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_TYPES_H$]) +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([stdint.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([stdint.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_stdint_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" stdint.h ]AS_TR_SH([stdint.h]) AS_TR_CPP([HAVE_stdint.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([stdint.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDINT_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STDINT_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STDINT_H$]) +m4trace:configure.ac:42: -1- gl_STDINT_INCLUDES +m4trace:configure.ac:42: -1- gl_STDINT_INCLUDES +m4trace:configure.ac:42: -1- gl_STDINT_INCLUDES +m4trace:configure.ac:42: -1- m4_pattern_allow([^__STDC_CONSTANT_MACROS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^__STDC_LIMIT_MACROS$]) +m4trace:configure.ac:42: -1- gl_STDINT_INCLUDES +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_INTTYPES_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_BITYPES_H$]) +m4trace:configure.ac:42: -1- gl_STDINT_TYPE_PROPERTIES +m4trace:configure.ac:42: -1- gl_MULTIARCH +m4trace:configure.ac:42: -1- m4_pattern_allow([^APPLE_UNIVERSAL_BUILD$]) +m4trace:configure.ac:42: -1- gl_STDINT_BITSIZEOF([ptrdiff_t size_t], [gl_STDINT_INCLUDES]) +m4trace:configure.ac:42: -1- AC_COMPUTE_INT([result], [sizeof ($gltype) * CHAR_BIT], [gl_STDINT_INCLUDES +#include ], [result=unknown]) +m4trace:configure.ac:42: -1- gl_STDINT_INCLUDES +m4trace:configure.ac:42: -1- m4_pattern_allow([^BITSIZEOF_PTRDIFF_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^BITSIZEOF_SIZE_T$]) +m4trace:configure.ac:42: -1- gl_STDINT_BITSIZEOF([sig_atomic_t wchar_t wint_t], [gl_STDINT_INCLUDES]) +m4trace:configure.ac:42: -1- AC_COMPUTE_INT([result], [sizeof ($gltype) * CHAR_BIT], [gl_STDINT_INCLUDES +#include ], [result=unknown]) +m4trace:configure.ac:42: -1- gl_STDINT_INCLUDES +m4trace:configure.ac:42: -1- m4_pattern_allow([^BITSIZEOF_SIG_ATOMIC_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^BITSIZEOF_WCHAR_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^BITSIZEOF_WINT_T$]) +m4trace:configure.ac:42: -1- gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t], [gl_STDINT_INCLUDES]) +m4trace:configure.ac:42: -1- gl_STDINT_INCLUDES +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGNED_SIG_ATOMIC_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGNED_WCHAR_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGNED_WINT_T$]) +m4trace:configure.ac:42: -1- gl_INTEGER_TYPE_SUFFIX([ptrdiff_t size_t], [gl_STDINT_INCLUDES]) +m4trace:configure.ac:42: -1- gl_STDINT_INCLUDES +m4trace:configure.ac:42: -1- m4_pattern_allow([^PTRDIFF_T_SUFFIX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SIZE_T_SUFFIX$]) +m4trace:configure.ac:42: -1- gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t], [gl_STDINT_INCLUDES]) +m4trace:configure.ac:42: -1- gl_STDINT_INCLUDES +m4trace:configure.ac:42: -1- m4_pattern_allow([^SIG_ATOMIC_T_SUFFIX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WCHAR_T_SUFFIX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINT_T_SUFFIX$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_LIMITS_H_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_LIMITS_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_LIMITS_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_LIMITS_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_C99_STDINT_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_BITYPES_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_INTTYPES_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STDINT_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDINT_H_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDINT_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDINT_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDINT_H_FALSE]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_inttypes_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" inttypes.h ]AS_TR_SH([inttypes.h]) AS_TR_CPP([HAVE_inttypes.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_INTTYPES_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_IMAXABS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_IMAXDIV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRTOIMAX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRTOUMAX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_IMAXABS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_IMAXDIV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRTOIMAX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRTOUMAX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRTOIMAX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRTOUMAX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INT32_MAX_LT_INTMAX_MAX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INT64_MAX_EQ_LONG_MAX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRI_MACROS_BROKEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRIPTR_PREFIX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UINT32_MAX_LT_UINTMAX_MAX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UINT64_MAX_EQ_ULONG_MAX$]) +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([inttypes.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([inttypes.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_inttypes_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" inttypes.h ]AS_TR_SH([inttypes.h]) AS_TR_CPP([HAVE_inttypes.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([inttypes.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_INTTYPES_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[#include + ]], [imaxabs imaxdiv strtoimax strtoumax]) +m4trace:configure.ac:42: -1- gl_INTTYPES_PRI_SCN +m4trace:configure.ac:42: -1- gt_INTTYPES_PRI +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_INTTYPES_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRI_MACROS_BROKEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRI_MACROS_BROKEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRIPTR_PREFIX$]) +m4trace:configure.ac:42: -1- gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION([INT32_MAX_LT_INTMAX_MAX], [defined INT32_MAX && defined INTMAX_MAX], [INT32_MAX < INTMAX_MAX], [sizeof (int) < sizeof (long long int)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INT32_MAX_LT_INTMAX_MAX$]) +m4trace:configure.ac:42: -1- gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION([INT64_MAX_EQ_LONG_MAX], [defined INT64_MAX], [INT64_MAX == LONG_MAX], [sizeof (long long int) == sizeof (long int)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INT64_MAX_EQ_LONG_MAX$]) +m4trace:configure.ac:42: -1- gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION([UINT32_MAX_LT_UINTMAX_MAX], [defined UINT32_MAX && defined UINTMAX_MAX], [UINT32_MAX < UINTMAX_MAX], [sizeof (unsigned int) < sizeof (unsigned long long int)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UINT32_MAX_LT_UINTMAX_MAX$]) +m4trace:configure.ac:42: -1- gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION([UINT64_MAX_EQ_ULONG_MAX], [defined UINT64_MAX], [UINT64_MAX == ULONG_MAX], [sizeof (unsigned long long int) == sizeof (unsigned long int)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UINT64_MAX_EQ_ULONG_MAX$]) +m4trace:configure.ac:42: -1- gl_INTTYPES_INCOMPLETE +m4trace:configure.ac:42: -1- gl_FUNC_ISBLANK +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_isblank], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" isblank ]AS_TR_CPP([HAVE_isblank])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([isblank.c]) +m4trace:configure.ac:42: -1- gl_CTYPE_MODULE_INDICATOR([isblank]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([isblank]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[isblank]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_FUNC_ISWBLANK +m4trace:configure.ac:42: -1- gl_WCTYPE_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ISWBLANK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCTYPE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ISWCTYPE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCTRANS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TOWCTRANS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ISWBLANK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCTYPE_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCTRANS_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ISWBLANK$]) +m4trace:configure.ac:42: -1- gl_WCTYPE_H +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_iswcntrl], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" iswcntrl ]AS_TR_CPP([HAVE_iswcntrl])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ISWCNTRL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINT_T$]) +m4trace:configure.ac:42: -1- gl_TYPE_WINT_T_PREREQ +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_crtdefs_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" crtdefs.h ]AS_TR_SH([crtdefs.h]) AS_TR_CPP([HAVE_crtdefs.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_CRTDEFS_H$]) +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([wctype.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([wctype.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_wctype_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" wctype.h ]AS_TR_SH([wctype.h]) AS_TR_CPP([HAVE_wctype.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([wctype.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_WCTYPE_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCTYPE_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ISWCNTRL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TOWLOWER$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_TOWLOWER$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TOWLOWER$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +# include +#endif +#include + ]], [wctype iswctype wctrans towctrans + ]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_iswblank], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" iswblank ]AS_TR_CPP([HAVE_iswblank])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_ISWBLANK$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([iswblank.c]) +m4trace:configure.ac:42: -1- gl_WCTYPE_MODULE_INDICATOR([iswblank]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([iswblank]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[iswblank]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([iswblank]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_ISWBLANK$]) +m4trace:configure.ac:42: -1- gl_LANGINFO_H +m4trace:configure.ac:42: -1- gl_LANGINFO_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_NL_LANGINFO$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_NL_LANGINFO$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_NL_LANGINFO$]) +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([langinfo.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([langinfo.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_langinfo_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" langinfo.h ]AS_TR_SH([langinfo.h]) AS_TR_CPP([HAVE_langinfo.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([langinfo.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_LANGINFO_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_langinfo_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" langinfo.h ]AS_TR_SH([langinfo.h]) AS_TR_CPP([HAVE_langinfo.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LANGINFO_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LANGINFO_CODESET$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LANGINFO_T_FMT_AMPM$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LANGINFO_ERA$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LANGINFO_YESEXPR$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[#include + ]], [nl_langinfo]) +m4trace:configure.ac:42: -1- gl_LIBSIGSEGV +m4trace:configure.ac:42: -1- AC_LIB_HAVE_LINKFLAGS([sigsegv], [], [#include ], [sigsegv_deinstall_handler();], [no, consider installing GNU libsigsegv]) +m4trace:configure.ac:42: -1- AC_LIB_LINKFLAGS_BODY([sigsegv], []) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:42: -1- AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCSIGSEGV]) +m4trace:configure.ac:42: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LIBSIGSEGV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LIBSIGSEGV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBSIGSEGV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LTLIBSIGSEGV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBSIGSEGV_PREFIX$]) +m4trace:configure.ac:42: -1- gl_LIMITS_H +m4trace:configure.ac:42: -1- gl_LOCALCHARSET +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_getc_unlocked], [_AC_CHECK_DECLS([getc_unlocked])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETC_UNLOCKED$]) +m4trace:configure.ac:42: -1- gl_GLIBC21 +m4trace:configure.ac:42: -1- m4_pattern_allow([^GLIBC21$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALCHARSET_TESTS_ENVIRONMENT$]) +m4trace:configure.ac:42: -1- gl_LOCALE_H +m4trace:configure.ac:42: -1- gl_LOCALE_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LOCALECONV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SETLOCALE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_DUPLOCALE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DUPLOCALE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LOCALECONV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SETLOCALE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_DUPLOCALE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRUCT_LCONV$]) +m4trace:configure.ac:42: -1- gl_STDDEF_H +m4trace:configure.ac:42: -1- gl_STDDEF_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_NULL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MAX_ALIGN_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCHAR_T$]) +m4trace:configure.ac:42: -1- gt_TYPE_WCHAR_T +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCHAR_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STDDEF_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDDEF_H_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDDEF_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDDEF_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDDEF_H_FALSE]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS([stddef.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([stddef.h], [assume]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([stddef.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDDEF_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STDDEF_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^_LCONV_C99$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_xlocale_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" xlocale.h ]AS_TR_SH([xlocale.h]) AS_TR_CPP([HAVE_xlocale.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_XLOCALE_H$]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS([locale.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([locale.h], [assume]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([locale.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_LOCALE_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_LOCALE_H$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[#include +/* Some systems provide declarations in a non-standard header. */ +#if HAVE_XLOCALE_H +# include +#endif + ]], [setlocale duplocale]) +m4trace:configure.ac:42: -1- gl_FUNC_LOCALECONV +m4trace:configure.ac:42: -1- gl_LIBSOURCES([localeconv.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_LOCALECONV +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_LCONV_DECIMAL_POINT$]) +m4trace:configure.ac:42: -1- gl_LOCALE_MODULE_INDICATOR([localeconv]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([localeconv]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[localeconv]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([localeconv]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_LOCALECONV$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([localtime-buffer.c]) +m4trace:configure.ac:42: -1- gl_FUNC_LSTAT +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_lstat], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" lstat ]AS_TR_CPP([HAVE_lstat])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK +m4trace:configure.ac:42: -1- m4_pattern_allow([^LSTAT_FOLLOWS_SLASHED_SYMLINK$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([lstat.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_LSTAT +m4trace:configure.ac:42: -1- gl_SYS_STAT_MODULE_INDICATOR([lstat]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([lstat]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[lstat]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([lstat]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_LSTAT$]) +m4trace:configure.ac:42: -1- AC_PROG_SED +m4trace:configure.ac:42: -1- m4_pattern_allow([^SED$]) +m4trace:configure.ac:42: -1- gl_FUNC_MALLOC_POSIX +m4trace:configure.ac:42: -1- gl_STDLIB_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB__EXIT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ATOLL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CALLOC_POSIX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CANONICALIZE_FILE_NAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETLOADAVG$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETSUBOPT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GRANTPT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MALLOC_POSIX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBTOWC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKDTEMP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKOSTEMP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKOSTEMPS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKSTEMP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKSTEMPS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_POSIX_OPENPT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PTSNAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PTSNAME_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PUTENV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_QSORT_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RANDOM$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RANDOM_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_REALLOC_POSIX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_REALPATH$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RPMATCH$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SECURE_GETENV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SETENV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRTOD$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRTOLL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRTOULL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SYSTEM_POSIX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNLOCKPT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNSETENV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCTOMB$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE__EXIT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ATOLL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_CANONICALIZE_FILE_NAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETLOADAVG$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETSUBOPT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GRANTPT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKDTEMP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKOSTEMP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKOSTEMPS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKSTEMP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKSTEMPS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_POSIX_OPENPT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PTSNAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PTSNAME_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_QSORT_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RANDOM$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RANDOM_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RANDOM_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_REALPATH$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RPMATCH$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SECURE_GETENV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SETENV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SETENV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRTOD$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRTOLL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRTOULL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_RANDOM_DATA$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_LOADAVG_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UNLOCKPT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_UNSETENV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_CALLOC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_CANONICALIZE_FILE_NAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MALLOC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MBTOWC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MKSTEMP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PTSNAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PTSNAME_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PUTENV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_QSORT_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_RANDOM_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_REALLOC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_REALPATH$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SETENV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRTOD$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_UNSETENV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WCTOMB$]) +m4trace:configure.ac:42: -1- gl_CHECK_MALLOC_POSIX +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MALLOC_POSIX$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([malloc.c]) +m4trace:configure.ac:42: -1- gl_STDLIB_MODULE_INDICATOR([malloc-posix]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([malloc-posix]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[malloc-posix]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([malloc-posix]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MALLOC_POSIX$]) +m4trace:configure.ac:42: -1- gl_MALLOCA +m4trace:configure.ac:42: -1- gl_EEMALLOC +m4trace:configure.ac:42: -1- _AC_FUNC_MALLOC_IF([gl_cv_func_malloc_0_nonnull=1], [gl_cv_func_malloc_0_nonnull=0]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MALLOC_0_IS_NONNULL$]) +m4trace:configure.ac:42: -1- gl_MBCHAR +m4trace:configure.ac:42: -1- gl_MBITER +m4trace:configure.ac:42: -1- gl_FUNC_MBRTOWC +m4trace:configure.ac:42: -1- gl_MBSTATE_T_BROKEN +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mbsinit], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mbsinit ]AS_TR_CPP([HAVE_mbsinit])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mbrtowc], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mbrtowc ]AS_TR_CPP([HAVE_mbrtowc])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_MBRTOWC_INCOMPLETE_STATE +m4trace:configure.ac:42: -1- gt_LOCALE_JA +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_JA$]) +m4trace:configure.ac:42: -1- gl_MBRTOWC_SANITYCHECK +m4trace:configure.ac:42: -1- gt_LOCALE_ZH_CN +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_ZH_CN$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mbrtowc], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mbrtowc ]AS_TR_CPP([HAVE_mbrtowc])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_MBRTOWC$]) +m4trace:configure.ac:42: -1- gl_MBRTOWC_NULL_ARG1 +m4trace:configure.ac:42: -1- gt_LOCALE_FR_UTF8 +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- gl_MBRTOWC_NULL_ARG2 +m4trace:configure.ac:42: -1- gl_MBRTOWC_RETVAL +m4trace:configure.ac:42: -1- gl_MBRTOWC_NUL_RETVAL +m4trace:configure.ac:42: -1- gl_MBRTOWC_EMPTY_INPUT +m4trace:configure.ac:42: -1- gl_MBRTOWC_C_LOCALE +m4trace:configure.ac:42: -1- m4_pattern_allow([^MBRTOWC_NULL_ARG1_BUG$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MBRTOWC_NULL_ARG2_BUG$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MBRTOWC_RETVAL_BUG$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MBRTOWC_NUL_RETVAL_BUG$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MBRTOWC_EMPTY_INPUT_BUG$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^C_LOCALE_MAYBE_EILSEQ$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([mbrtowc.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_MBRTOWC +m4trace:configure.ac:42: -1- gl_WCHAR_MODULE_INDICATOR([mbrtowc]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([mbrtowc]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[mbrtowc]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([mbrtowc]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBRTOWC$]) +m4trace:configure.ac:42: -1- gl_STRING_MODULE_INDICATOR([mbscasecmp]) +m4trace:configure.ac:42: -1- gl_HEADER_STRING_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FFSL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FFSLL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MEMCHR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MEMMEM$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MEMPCPY$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MEMRCHR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RAWMEMCHR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STPCPY$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STPNCPY$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRCHRNUL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRDUP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRNCAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRNDUP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRNLEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRPBRK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRSEP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRSTR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRCASESTR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRTOK_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSLEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSNLEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSCHR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSRCHR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSSTR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSCASECMP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSNCASECMP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSPCASECMP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSCASESTR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSCSPN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSPBRK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSSPN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSSEP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSTOK_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRERROR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRERROR_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRSIGNAL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRVERSCMP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBSLEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FFSL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FFSLL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MEMCHR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_MEMMEM$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MEMPCPY$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_MEMRCHR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RAWMEMCHR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STPCPY$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STPNCPY$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRCHRNUL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRDUP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRNDUP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRNLEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRPBRK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRSEP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRCASESTR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRTOK_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRERROR_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRSIGNAL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRVERSCMP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MEMCHR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MEMMEM$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STPNCPY$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRDUP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRSTR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRCASESTR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRCHRNUL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRERROR$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRERROR_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRNCAT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRNDUP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRNLEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRSIGNAL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRTOK_R$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UNDEFINE_STRTOK_R$]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([mbscasecmp]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[mbscasecmp]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([mbscasecmp]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBSCASECMP$]) +m4trace:configure.ac:42: -1- gl_FUNC_MBSINIT +m4trace:configure.ac:42: -1- gl_MBSTATE_T_BROKEN +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mbsinit], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mbsinit ]AS_TR_CPP([HAVE_mbsinit])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mbrtowc], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mbrtowc ]AS_TR_CPP([HAVE_mbrtowc])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_MBRTOWC_INCOMPLETE_STATE +m4trace:configure.ac:42: -1- gl_MBRTOWC_SANITYCHECK +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mbsinit], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mbsinit ]AS_TR_CPP([HAVE_mbsinit])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_MBSINIT$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([mbsinit.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_MBSINIT +m4trace:configure.ac:42: -1- gl_WCHAR_MODULE_INDICATOR([mbsinit]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([mbsinit]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[mbsinit]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([mbsinit]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBSINIT$]) +m4trace:configure.ac:42: -1- gl_FUNC_MBSLEN +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mbslen], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mbslen ]AS_TR_CPP([HAVE_mbslen])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_STRING_MODULE_INDICATOR([mbslen]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([mbslen]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[mbslen]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([mbslen]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBSLEN$]) +m4trace:configure.ac:42: -1- gl_FUNC_MBSRTOWCS +m4trace:configure.ac:42: -1- gl_MBSTATE_T_BROKEN +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mbsinit], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mbsinit ]AS_TR_CPP([HAVE_mbsinit])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mbrtowc], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mbrtowc ]AS_TR_CPP([HAVE_mbrtowc])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_MBRTOWC_INCOMPLETE_STATE +m4trace:configure.ac:42: -1- gl_MBRTOWC_SANITYCHECK +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mbsrtowcs], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mbsrtowcs ]AS_TR_CPP([HAVE_mbsrtowcs])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_MBSRTOWCS$]) +m4trace:configure.ac:42: -1- gl_MBSRTOWCS_WORKS +m4trace:configure.ac:42: -1- gl_LIBSOURCES([mbsrtowcs.c]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([mbsrtowcs-state.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_MBSRTOWCS +m4trace:configure.ac:42: -1- gl_WCHAR_MODULE_INDICATOR([mbsrtowcs]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([mbsrtowcs]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[mbsrtowcs]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([mbsrtowcs]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBSRTOWCS$]) +m4trace:configure.ac:42: -1- gl_STRING_MODULE_INDICATOR([mbsstr]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([mbsstr]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[mbsstr]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([mbsstr]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBSSTR$]) +m4trace:configure.ac:42: -1- gl_FUNC_MBTOWC +m4trace:configure.ac:42: -1- gl_LIBSOURCES([mbtowc.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_MBTOWC +m4trace:configure.ac:42: -1- gl_STDLIB_MODULE_INDICATOR([mbtowc]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([mbtowc]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[mbtowc]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([mbtowc]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBTOWC$]) +m4trace:configure.ac:42: -1- gl_MBITER +m4trace:configure.ac:42: -1- gl_FUNC_MEMCHR +m4trace:configure.ac:42: -1- gl_FUNC_MMAP_ANON +m4trace:configure.ac:42: -1- m4_pattern_allow([^MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_mman_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/mman.h ]AS_TR_SH([sys/mman.h]) AS_TR_CPP([HAVE_sys/mman.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mprotect], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mprotect ]AS_TR_CPP([HAVE_mprotect])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([memchr.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_MEMCHR +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_BP_SYM_H$]) +m4trace:configure.ac:42: -1- gl_STRING_MODULE_INDICATOR([memchr]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([memchr]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[memchr]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([memchr]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MEMCHR$]) +m4trace:configure.ac:42: -1- gl_MINMAX +m4trace:configure.ac:42: -1- gl_PREREQ_MINMAX +m4trace:configure.ac:42: -1- gl_MINMAX_IN_HEADER([limits.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MINMAX_IN_LIMITS_H$]) +m4trace:configure.ac:42: -1- gl_MINMAX_IN_HEADER([sys/param.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MINMAX_IN_SYS_PARAM_H$]) +m4trace:configure.ac:42: -1- gl_FUNC_MKSTEMP +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mkstemp], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mkstemp ]AS_TR_CPP([HAVE_mkstemp])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([mkstemp.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_MKSTEMP +m4trace:configure.ac:42: -1- gl_STDLIB_MODULE_INDICATOR([mkstemp]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([mkstemp]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[mkstemp]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([mkstemp]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MKSTEMP$]) +m4trace:configure.ac:42: -1- gl_FUNC_MKTIME +m4trace:configure.ac:42: -1- gl_FUNC_MKTIME_WORKS +m4trace:configure.ac:42: -1- gl_TIME_T_IS_SIGNED +m4trace:configure.ac:42: -1- m4_pattern_allow([^TIME_T_IS_SIGNED$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_unistd_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" unistd.h ]AS_TR_SH([unistd.h]) AS_TR_CPP([HAVE_unistd.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_alarm], [_AC_CHECK_DECLS([alarm])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_ALARM$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_tzset], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" tzset ]AS_TR_CPP([HAVE_tzset])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEED_MKTIME_WORKING$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEED_MKTIME_WINDOWS$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([mktime.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_MKTIME +m4trace:configure.ac:42: -1- gl_TIME_MODULE_INDICATOR([mktime]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([mktime]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[mktime]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([mktime]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MKTIME$]) +m4trace:configure.ac:42: -1- gl_FUNC_MKTIME_INTERNAL +m4trace:configure.ac:42: -1- m4_pattern_allow([^mktime_internal$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEED_MKTIME_INTERNAL$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([mktime.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_MKTIME +m4trace:configure.ac:42: -1- gl_LIBSOURCES([msvc-inval.c]) +m4trace:configure.ac:42: -1- gl_MSVC_NOTHROW +m4trace:configure.ac:42: -1- gl_LIBSOURCES([msvc-nothrow.c]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR([msvc-nothrow]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MSVC_NOTHROW$]) +m4trace:configure.ac:42: -1- gl_MULTIARCH +m4trace:configure.ac:42: -1- gl_FUNC_NL_LANGINFO +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_nl_langinfo], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" nl_langinfo ]AS_TR_CPP([HAVE_nl_langinfo])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^FUNC_NL_LANGINFO_YESEXPR_WORKS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_NL_LANGINFO$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([nl_langinfo.c]) +m4trace:configure.ac:42: -1- gl_LANGINFO_MODULE_INDICATOR([nl_langinfo]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([nl_langinfo]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[nl_langinfo]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([nl_langinfo]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_NL_LANGINFO$]) +m4trace:configure.ac:42: -1- gl_FUNC_OPEN +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_lstat], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" lstat ]AS_TR_CPP([HAVE_lstat])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^OPEN_TRAILING_SLASH_BUG$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([open.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_OPEN +m4trace:configure.ac:42: -1- gl_PROMOTED_TYPE_MODE_T +m4trace:configure.ac:42: -1- m4_pattern_allow([^PROMOTED_MODE_T$]) +m4trace:configure.ac:42: -1- gl_FCNTL_MODULE_INDICATOR([open]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([open]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[open]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([open]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_OPEN$]) +m4trace:configure.ac:42: -1- gl_PATHMAX +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_param_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/param.h ]AS_TR_SH([sys/param.h]) AS_TR_CPP([HAVE_sys/param.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_PROGRAM_INVOCATION_NAME$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME$]) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"']) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"']) +m4trace:configure.ac:42: -1- gl_QUOTE +m4trace:configure.ac:42: -1- gl_QUOTEARG +m4trace:configure.ac:42: -1- gl_FUNC_RAISE +m4trace:configure.ac:42: -1- gl_SIGNAL_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PTHREAD_SIGMASK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RAISE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SIGNAL_H_SIGPIPE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SIGPROCMASK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SIGACTION$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_POSIX_SIGNALBLOCKING$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PTHREAD_SIGMASK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RAISE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGSET_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGINFO_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGACTION$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_SIGACTION_SA_SIGACTION$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TYPE_VOLATILE_SIG_ATOMIC_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGHANDLER_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PTHREAD_SIGMASK$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_RAISE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RAISE$]) +m4trace:configure.ac:42: -1- gl_SIGNALBLOCKING +m4trace:configure.ac:42: -1- gl_CHECK_TYPE_SIGSET_T +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGSET_T$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([raise.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_RAISE +m4trace:configure.ac:42: -1- gl_SIGNAL_MODULE_INDICATOR([raise]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([raise]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[raise]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([raise]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_RAISE$]) +m4trace:configure.ac:42: -1- gl_FUNC_RAWMEMCHR +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RAWMEMCHR$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([rawmemchr.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_RAWMEMCHR +m4trace:configure.ac:42: -1- gl_STRING_MODULE_INDICATOR([rawmemchr]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([rawmemchr]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[rawmemchr]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([rawmemchr]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_RAWMEMCHR$]) +m4trace:configure.ac:42: -1- gl_FUNC_READLINK +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_readlink], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" readlink ]AS_TR_CPP([HAVE_readlink])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^READLINK_TRAILING_SLASH_BUG$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([readlink.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_READLINK +m4trace:configure.ac:42: -1- gl_UNISTD_MODULE_INDICATOR([readlink]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([readlink]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[readlink]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([readlink]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_READLINK$]) +m4trace:configure.ac:42: -1- gl_REGEX +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_alarm], [_AC_CHECK_DECLS([alarm])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_malloc_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" malloc.h ]AS_TR_SH([malloc.h]) AS_TR_CPP([HAVE_malloc.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^_REGEX_INCLUDE_LIMITS_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^_REGEX_LARGE_OFFSETS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_syntax_options$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_set_syntax$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_compile_pattern$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_compile_fastmap$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_search$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_search_2$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_match$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_match_2$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_set_registers$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_comp$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_exec$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^regcomp$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^regexec$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^regerror$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^regfree$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([regex.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_REGEX +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LIBINTL_H$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_isblank], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" isblank ]AS_TR_CPP([HAVE_isblank])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_iswctype], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" iswctype ]AS_TR_CPP([HAVE_iswctype])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_ISBLANK$]) +m4trace:configure.ac:42: -1- gl_FUNC_SECURE_GETENV +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_secure_getenv], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" secure_getenv ]AS_TR_CPP([HAVE_secure_getenv])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([secure_getenv.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_SECURE_GETENV +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE___SECURE_GETENV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ISSETUGID$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_getuid], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" getuid ]AS_TR_CPP([HAVE_getuid])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_geteuid], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" geteuid ]AS_TR_CPP([HAVE_geteuid])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_getgid], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" getgid ]AS_TR_CPP([HAVE_getgid])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_getegid], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" getegid ]AS_TR_CPP([HAVE_getegid])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_STDLIB_MODULE_INDICATOR([secure_getenv]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([secure_getenv]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[secure_getenv]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([secure_getenv]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SECURE_GETENV$]) +m4trace:configure.ac:42: -1- gl_FUNC_SETENV +m4trace:configure.ac:42: -1- gl_FUNC_SETENV_SEPARATE +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_setenv], [_AC_CHECK_DECLS([setenv])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SETENV$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_setenv], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" setenv ]AS_TR_CPP([HAVE_setenv])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_PREREQ_SETENV +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_unistd_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" unistd.h ]AS_TR_SH([unistd.h]) AS_TR_CPP([HAVE_unistd.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SEARCH_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TSEARCH$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([setenv.c]) +m4trace:configure.ac:42: -1- gl_STDLIB_MODULE_INDICATOR([setenv]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([setenv]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[setenv]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([setenv]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SETENV$]) +m4trace:configure.ac:42: -1- gl_SIGACTION +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_sigaction], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" sigaction ]AS_TR_CPP([HAVE_sigaction])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_SIGACTION_SA_SIGACTION$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([sigaction.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_SIGACTION +m4trace:configure.ac:42: -1- m4_pattern_allow([^uid_t$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^gid_t$]) +m4trace:configure.ac:42: -1- gl_PREREQ_SIG_HANDLER_H +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_sigaltstack], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" sigaltstack ]AS_TR_CPP([HAVE_sigaltstack])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_siginterrupt], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" siginterrupt ]AS_TR_CPP([HAVE_siginterrupt])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGINFO_T$]) +m4trace:configure.ac:42: -1- gl_SIGNAL_MODULE_INDICATOR([sigaction]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([sigaction]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[sigaction]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([sigaction]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SIGACTION$]) +m4trace:configure.ac:42: -1- gl_SIGNAL_H +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS([signal.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([signal.h], [assume]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([signal.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SIGNAL_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[#include + ]], [pthread_sigmask sigaction + sigaddset sigdelset sigemptyset sigfillset sigismember + sigpending sigprocmask]) +m4trace:configure.ac:42: -1- gl_SIGNALBLOCKING +m4trace:configure.ac:42: -1- gl_LIBSOURCES([sigprocmask.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_SIGPROCMASK +m4trace:configure.ac:42: -1- gl_SIGNAL_MODULE_INDICATOR([sigprocmask]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([sigprocmask]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[sigprocmask]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([sigprocmask]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SIGPROCMASK$]) +m4trace:configure.ac:42: -1- gl_SIZE_MAX +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STDINT_H$]) +m4trace:configure.ac:42: -1- AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1], [#include +#include ], [size_t_bits_minus_1=]) +m4trace:configure.ac:42: -1- AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)], [#include ], [fits_in_uint=]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SIZE_MAX$]) +m4trace:configure.ac:42: -1- gt_TYPE_SSIZE_T +m4trace:configure.ac:42: -1- m4_pattern_allow([^ssize_t$]) +m4trace:configure.ac:42: -1- gl_FUNC_STAT +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_lstat], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" lstat ]AS_TR_CPP([HAVE_lstat])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FUNC_STAT_FILE$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([stat.c]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([stat-w32.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_STAT +m4trace:configure.ac:42: -1- gl_SYS_STAT_MODULE_INDICATOR([stat]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([stat]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[stat]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([stat]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STAT$]) +m4trace:configure.ac:42: -1- gl_STAT_TIME +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_time_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/time.h ]AS_TR_SH([sys/time.h]) AS_TR_CPP([HAVE_sys/time.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_ATIMENSEC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC$]) +m4trace:configure.ac:42: -1- gl_STAT_BIRTHTIME +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_time_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/time.h ]AS_TR_SH([sys/time.h]) AS_TR_CPP([HAVE_sys/time.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC$]) +m4trace:configure.ac:42: -1- gl_STDARG_H +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS([stdarg.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([stdarg.h], [assume]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([stdarg.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDARG_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STDARG_H$]) +m4trace:configure.ac:42: -1- gl_CACHE_VAL_SILENT([gl_cv_func___va_copy], [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[ +#ifndef __va_copy +error, bail out +#endif + ]])], + [gl_cv_func___va_copy=yes], + [gl_cv_func___va_copy=no])]) +m4trace:configure.ac:42: -1- _m4_warn([obsolete], [$as_echo_n is obsolete; use AS_ECHO_N(["message"]) instead], [m4/gnulib-common.m4:399: gl_CACHE_VAL_SILENT is expanded from... +m4/stdarg.m4:10: gl_STDARG_H is expanded from... +m4/gnulib-comp.m4:445: gl_INIT is expanded from... +configure.ac:42: the top level]) +m4trace:configure.ac:42: -1- _m4_warn([obsolete], [$as_echo_n is obsolete; use AS_ECHO_N(["message"]) instead], [m4/gnulib-common.m4:399: gl_CACHE_VAL_SILENT is expanded from... +m4/stdarg.m4:10: gl_STDARG_H is expanded from... +m4/gnulib-comp.m4:445: gl_INIT is expanded from... +configure.ac:42: the top level]) +m4trace:configure.ac:42: -1- _m4_warn([obsolete], [$as_echo_n is obsolete; use AS_ECHO_N(["message"]) instead], [m4/gnulib-common.m4:399: gl_CACHE_VAL_SILENT is expanded from... +m4/stdarg.m4:10: gl_STDARG_H is expanded from... +m4/gnulib-comp.m4:445: gl_INIT is expanded from... +configure.ac:42: the top level]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^va_copy$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^va_copy$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STDARG_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_STDARG_H], [test -n "$STDARG_H"]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDARG_H_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDARG_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDARG_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDARG_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDARG_H$]) +m4trace:configure.ac:42: -1- AM_STDBOOL_H +m4trace:configure.ac:42: -1- AC_CHECK_HEADER_STDBOOL +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE__BOOL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STDBOOL_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDBOOL_H_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDBOOL_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDBOOL_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDBOOL_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE__BOOL$]) +m4trace:configure.ac:42: -1- gl_STDDEF_H +m4trace:configure.ac:42: -1- m4_pattern_allow([^STDDEF_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDDEF_H_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDDEF_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDDEF_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDDEF_H_FALSE]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS([stddef.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([stddef.h], [assume]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([stddef.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDDEF_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STDDEF_H$]) +m4trace:configure.ac:42: -1- gl_STDINT_H +m4trace:configure.ac:42: -1- gl_STDIO_H +m4trace:configure.ac:42: -1- m4_pattern_allow([^__USE_MINGW_ANSI_STDIO$]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS([stdio.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([stdio.h], [assume]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([stdio.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDIO_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STDIO_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU$]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR([fscanf]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSCANF$]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR([scanf]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SCANF$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[#include + ]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen + renameat snprintf tmpfile vdprintf vsnprintf]) +m4trace:configure.ac:42: -1- gl_STDLIB_H +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS([stdlib.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([stdlib.h], [assume]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([stdlib.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDLIB_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STDLIB_H$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[#include +#if HAVE_SYS_LOADAVG_H +# include +#endif +#if HAVE_RANDOM_H +# include +#endif + ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt + initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps + posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch + secure_getenv setenv setstate setstate_r srandom srandom_r + strtod strtoll strtoull unlockpt unsetenv]) +m4trace:configure.ac:42: -1- gl_STRCASE +m4trace:configure.ac:42: -1- gl_FUNC_STRCASECMP +m4trace:configure.ac:42: -1- gl_HEADER_STRINGS_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FFS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FFS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRCASECMP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRNCASECMP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRCASECMP$]) +m4trace:configure.ac:42: -1- gl_FUNC_STRNCASECMP +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRNCASECMP$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRNCASECMP$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([strcasecmp.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_STRCASECMP +m4trace:configure.ac:42: -1- gl_LIBSOURCES([strncasecmp.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_STRNCASECMP +m4trace:configure.ac:42: -1- gl_FUNC_STRERROR +m4trace:configure.ac:42: -1- gl_FUNC_STRERROR_0 +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRERROR_0$]) +m4trace:configure.ac:42: -1- gl_FUNC_STRERROR_R_WORKS +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_strerror_r], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" strerror_r ]AS_TR_CPP([HAVE_strerror_r])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func___xpg_strerror_r], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" __xpg_strerror_r ]AS_TR_CPP([HAVE___xpg_strerror_r])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([strerror.c]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR([strerror]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRERROR$]) +m4trace:configure.ac:42: -1- gl_STRING_MODULE_INDICATOR([strerror]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([strerror]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[strerror]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([strerror]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STRERROR$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([strerror-override.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_SYS_H_WINSOCK2 +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_socket_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/socket.h ]AS_TR_SH([sys/socket.h]) AS_TR_CPP([HAVE_sys/socket.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- gl_FUNC_GNU_STRFTIME +m4trace:configure.ac:42: -1- m4_pattern_allow([^TM_IN_SYS_TIME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_TM_TM_ZONE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TM_ZONE$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_TZNAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TZNAME$]) +m4trace:configure.ac:42: -1- gl_TM_GMTOFF +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TM_GMTOFF$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_tzset], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" tzset ]AS_TR_CPP([HAVE_tzset])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^my_strftime$]) +m4trace:configure.ac:42: -1- gl_HEADER_STRING_H +m4trace:configure.ac:42: -1- gl_HEADER_STRING_H_BODY +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS([string.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([string.h], [assume]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([string.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STRING_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STRING_H$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[#include + ]], [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul + strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r + strerror_r strsignal strverscmp]) +m4trace:configure.ac:42: -1- gl_HEADER_STRINGS_H +m4trace:configure.ac:42: -1- gl_HEADER_STRINGS_H_BODY +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([strings.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([strings.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_strings_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" strings.h ]AS_TR_SH([strings.h]) AS_TR_CPP([HAVE_strings.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([strings.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STRINGS_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STRINGS_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRINGS_H$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[ + /* Minix 3.1.8 has a bug: must be included before + . */ + #include + #include + ]], [ffs strcasecmp strncasecmp]) +m4trace:configure.ac:42: -1- gl_FUNC_STRNDUP +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_strndup], [_AC_CHECK_DECLS([strndup])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRNDUP$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_strndup], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" strndup ]AS_TR_CPP([HAVE_strndup])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([strndup.c]) +m4trace:configure.ac:42: -1- gl_STRING_MODULE_INDICATOR([strndup]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([strndup]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[strndup]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([strndup]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STRNDUP$]) +m4trace:configure.ac:42: -1- gl_FUNC_STRNLEN +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_strnlen], [_AC_CHECK_DECLS([strnlen])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRNLEN$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([strnlen.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_STRNLEN +m4trace:configure.ac:42: -1- gl_STRING_MODULE_INDICATOR([strnlen]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([strnlen]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[strnlen]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([strnlen]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STRNLEN$]) +m4trace:configure.ac:42: -1- gl_FUNC_STRPTIME +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_strptime], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" strptime ]AS_TR_CPP([HAVE_strptime])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([strptime.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_STRPTIME +m4trace:configure.ac:42: -1- gl_TIME_MODULE_INDICATOR([strptime]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([strptime]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[strptime]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([strptime]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STRPTIME$]) +m4trace:configure.ac:42: -1- gl_FUNC_STRTOULL +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRTOULL$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([strtoull.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_STRTOULL +m4trace:configure.ac:42: -1- gl_STDLIB_MODULE_INDICATOR([strtoull]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([strtoull]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[strtoull]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([strtoull]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STRTOULL$]) +m4trace:configure.ac:42: -1- gl_FUNC_STRTOUMAX +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_strtoumax], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" strtoumax ]AS_TR_CPP([HAVE_strtoumax])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_strtoumax], [_AC_CHECK_DECLS([strtoumax])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRTOUMAX$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([strtoumax.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_STRTOUMAX +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRTOULL$]) +m4trace:configure.ac:42: -1- gl_INTTYPES_MODULE_INDICATOR([strtoumax]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([strtoumax]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[strtoumax]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_HEADER_SYS_STAT_H +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([sys/stat.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([sys/stat.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_stat_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/stat.h ]AS_TR_SH([sys/stat.h]) AS_TR_CPP([HAVE_sys/stat.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([sys/stat.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_STAT_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_STAT_TIMESPEC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_64_BIT_ST_SIZE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^nlink_t$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[#include + ]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat + mknod mknodat stat utimensat]) +m4trace:configure.ac:42: -1- AC_PROG_MKDIR_P +m4trace:configure.ac:42: -1- gl_HEADER_SYS_TIME_H +m4trace:configure.ac:42: -1- AC_PROG_MKDIR_P +m4trace:configure.ac:42: -1- gl_SYS_TYPES_H +m4trace:configure.ac:42: -1- gl_SYS_TYPES_H_DEFAULTS +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS([sys/types.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([sys/types.h], [assume]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([sys/types.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_TYPES_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H$]) +m4trace:configure.ac:42: -1- gl_TYPE_OFF_T +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_64_BIT_OFF_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_STAT_INODES$]) +m4trace:configure.ac:42: -1- AC_PROG_MKDIR_P +m4trace:configure.ac:42: -1- gl_SYS_WAIT_H +m4trace:configure.ac:42: -1- gl_SYS_WAIT_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WAITPID$]) +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([sys/wait.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([sys/wait.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_wait_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/wait.h ]AS_TR_SH([sys/wait.h]) AS_TR_CPP([HAVE_sys/wait.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([sys/wait.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_WAIT_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[#include ]], [waitpid]) +m4trace:configure.ac:42: -1- AC_PROG_MKDIR_P +m4trace:configure.ac:42: -1- gl_FUNC_GEN_TEMPNAME +m4trace:configure.ac:42: -1- gl_PREREQ_TEMPNAME +m4trace:configure.ac:42: -1- gl_HEADER_TIME_H +m4trace:configure.ac:42: -1- gl_HEADER_TIME_H_BODY +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS([time.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([time.h], [assume]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([time.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_TIME_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_TIME_H$]) +m4trace:configure.ac:42: -1- gl_CHECK_TYPE_STRUCT_TIMESPEC +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_time_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/time.h ]AS_TR_SH([sys/time.h]) AS_TR_CPP([HAVE_sys/time.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^TIME_H_DEFINES_STRUCT_TIMESPEC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SYS_TIME_H_DEFINES_STRUCT_TIMESPEC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PTHREAD_H_DEFINES_STRUCT_TIMESPEC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UNISTD_H_DEFINES_STRUCT_TIMESPEC$]) +m4trace:configure.ac:42: -1- gl_TIME_R +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_LOCALTIME_R$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_localtime_r], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" localtime_r ]AS_TR_CPP([HAVE_localtime_r])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([time_r.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_TIME_R +m4trace:configure.ac:42: -1- gl_TIME_MODULE_INDICATOR([time_r]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([time_r]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[time_r]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([time_r]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_TIME_R$]) +m4trace:configure.ac:42: -1- gl_TIME_RZ +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TIMEZONE_T$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([time_rz.c]) +m4trace:configure.ac:42: -1- gl_TIME_MODULE_INDICATOR([time_rz]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([time_rz]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[time_rz]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([time_rz]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_TIME_RZ$]) +m4trace:configure.ac:42: -1- gl_FUNC_TIMEGM +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_timegm], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" timegm ]AS_TR_CPP([HAVE_timegm])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([timegm.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_TIMEGM +m4trace:configure.ac:42: -1- gl_TIME_MODULE_INDICATOR([timegm]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([timegm]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[timegm]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([timegm]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_TIMEGM$]) +m4trace:configure.ac:42: -1- gl_TIMESPEC +m4trace:configure.ac:42: -1- gl_FUNC_TZSET +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_tzset], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" tzset ]AS_TR_CPP([HAVE_tzset])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_FUNC_TZSET_CLOBBER +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RUN_TZSET_TEST$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^TZSET_CLOBBERS_LOCALTIME$]) +m4trace:configure.ac:42: -1- gl_LOCALTIME_BUFFER_NEEDED +m4trace:configure.ac:42: -1- gl_LIBSOURCES([tzset.c]) +m4trace:configure.ac:42: -1- gl_TIME_MODULE_INDICATOR([tzset]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([tzset]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[tzset]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([tzset]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_TZSET$]) +m4trace:configure.ac:42: -1- gl_UNISTD_H +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([unistd.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([unistd.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_unistd_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" unistd.h ]AS_TR_SH([unistd.h]) AS_TR_CPP([HAVE_unistd.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([unistd.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_UNISTD_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_UNISTD_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UNISTD_H$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[ +#if HAVE_UNISTD_H +# include +#endif +/* Some systems declare various items in the wrong headers. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include +# endif +#endif + ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat + fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups + gethostname getlogin getlogin_r getpagesize + getusershell setusershell endusershell + group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite + readlink readlinkat rmdir sethostname sleep symlink symlinkat + truncate ttyname_r unlink unlinkat usleep]) +m4trace:configure.ac:42: -1- gl_LIBUNISTRING_LIBHEADER([0.9.4], [unistr.h]) +m4trace:configure.ac:42: -1- gl_LIBUNISTRING_LIB_PREPARE +m4trace:configure.ac:42: -1- gl_LIBUNISTRING_VERSION_CMP([0.9.4]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_UNISTR_H$]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR([unistr/u8-mbtoucr]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNISTR_U8_MBTOUCR$]) +m4trace:configure.ac:42: -1- gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-mbtoucr]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR], [gl_LIBUNISTRING_VERSION_CMP([0.9])]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE]) +m4trace:configure.ac:42: -1- gl_LIBUNISTRING_VERSION_CMP([0.9]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR([unistr/u8-uctomb]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNISTR_U8_UCTOMB$]) +m4trace:configure.ac:42: -1- gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-uctomb]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB], [gl_LIBUNISTRING_VERSION_CMP([0.9])]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE]) +m4trace:configure.ac:42: -1- gl_LIBUNISTRING_VERSION_CMP([0.9]) +m4trace:configure.ac:42: -1- gl_LIBUNISTRING_LIBHEADER([0.9.4], [unitypes.h]) +m4trace:configure.ac:42: -1- gl_LIBUNISTRING_VERSION_CMP([0.9.4]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_UNITYPES_H$]) +m4trace:configure.ac:42: -1- gl_LIBUNISTRING_LIBHEADER([0.9.4], [uniwidth.h]) +m4trace:configure.ac:42: -1- gl_LIBUNISTRING_VERSION_CMP([0.9.4]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_UNIWIDTH_H$]) +m4trace:configure.ac:42: -1- gl_LIBUNISTRING_MODULE([0.9.6], [uniwidth/width]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH], [gl_LIBUNISTRING_VERSION_CMP([0.9.6])]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE]) +m4trace:configure.ac:42: -1- gl_LIBUNISTRING_VERSION_CMP([0.9.6]) +m4trace:configure.ac:42: -1- gl_FUNC_GLIBC_UNLOCKED_IO +m4trace:configure.ac:42: -1- m4_pattern_allow([^USE_UNLOCKED_IO$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_clearerr_unlocked], [_AC_CHECK_DECLS([clearerr_unlocked])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_CLEARERR_UNLOCKED$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_feof_unlocked], [_AC_CHECK_DECLS([feof_unlocked])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FEOF_UNLOCKED$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_ferror_unlocked], [_AC_CHECK_DECLS([ferror_unlocked])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FERROR_UNLOCKED$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_fflush_unlocked], [_AC_CHECK_DECLS([fflush_unlocked])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FFLUSH_UNLOCKED$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_fgets_unlocked], [_AC_CHECK_DECLS([fgets_unlocked])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FGETS_UNLOCKED$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_fputc_unlocked], [_AC_CHECK_DECLS([fputc_unlocked])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FPUTC_UNLOCKED$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_fputs_unlocked], [_AC_CHECK_DECLS([fputs_unlocked])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FPUTS_UNLOCKED$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_fread_unlocked], [_AC_CHECK_DECLS([fread_unlocked])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FREAD_UNLOCKED$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_fwrite_unlocked], [_AC_CHECK_DECLS([fwrite_unlocked])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FWRITE_UNLOCKED$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_getc_unlocked], [_AC_CHECK_DECLS([getc_unlocked])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_getchar_unlocked], [_AC_CHECK_DECLS([getchar_unlocked])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETCHAR_UNLOCKED$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_putc_unlocked], [_AC_CHECK_DECLS([putc_unlocked])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_PUTC_UNLOCKED$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_putchar_unlocked], [_AC_CHECK_DECLS([putchar_unlocked])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_PUTCHAR_UNLOCKED$]) +m4trace:configure.ac:42: -1- gl_FUNC_UNSETENV +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_unsetenv], [_AC_CHECK_DECLS([unsetenv])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_UNSETENV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UNSETENV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^VOID_UNSETENV$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([unsetenv.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_UNSETENV +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_unistd_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" unistd.h ]AS_TR_SH([unistd.h]) AS_TR_CPP([HAVE_unistd.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_STDLIB_MODULE_INDICATOR([unsetenv]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([unsetenv]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[unsetenv]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([unsetenv]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_UNSETENV$]) +m4trace:configure.ac:42: -1- AC_C_VARARRAYS +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_C_VARARRAYS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^__STDC_NO_VLA__$]) +m4trace:configure.ac:42: -1- gl_FUNC_VASNPRINTF +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_vasnprintf], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" vasnprintf ]AS_TR_CPP([HAVE_vasnprintf])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_REPLACE_VASNPRINTF +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_vasnprintf], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" vasnprintf ]AS_TR_CPP([HAVE_vasnprintf])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([vasnprintf.c]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([printf-args.c]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([printf-parse.c]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([asnprintf.c]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VASNPRINTF$]) +m4trace:configure.ac:42: -1- gl_PREREQ_PRINTF_ARGS +m4trace:configure.ac:42: -1- gl_PREREQ_PRINTF_PARSE +m4trace:configure.ac:42: -1- gl_FEATURES_H +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_features_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" features.h ]AS_TR_SH([features.h]) AS_TR_CPP([HAVE_features.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FEATURES_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ptrdiff_t$]) +m4trace:configure.ac:42: -1- gt_AC_TYPE_INTMAX_T +m4trace:configure.ac:42: -1- gl_AC_HEADER_INTTYPES_H +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_INTTYPES_H_WITH_UINTMAX$]) +m4trace:configure.ac:42: -1- gl_AC_HEADER_STDINT_H +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STDINT_H_WITH_UINTMAX$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_INTMAX_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^intmax_t$]) +m4trace:configure.ac:42: -1- gl_PREREQ_VASNPRINTF +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SNPRINTF$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRNLEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSLEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSNLEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBRTOWC$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCRTOMB$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL__SNPRINTF$]) +m4trace:configure.ac:42: -1- gl_DOUBLE_EXPONENT_LOCATION +m4trace:configure.ac:42: -1- m4_pattern_allow([^AC_APPLE_UNIVERSAL_BUILD$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^DBL_EXPBIT0_WORD$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^DBL_EXPBIT0_BIT$]) +m4trace:configure.ac:42: -1- gl_SNPRINTF_RETVAL_C99 +m4trace:configure.ac:42: -1- gl_SNPRINTF_PRESENCE +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_snprintf], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" snprintf ]AS_TR_CPP([HAVE_snprintf])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SNPRINTF_RETVAL_C99$]) +m4trace:configure.ac:42: -1- gl_PREREQ_ASNPRINTF +m4trace:configure.ac:42: -1- gl_FUNC_VASPRINTF +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_VASPRINTF$]) +m4trace:configure.ac:42: -1- gl_REPLACE_VASPRINTF +m4trace:configure.ac:42: -1- gl_LIBSOURCES([vasprintf.c]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([asprintf.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_VASPRINTF_H +m4trace:configure.ac:42: -1- gl_PREREQ_VASPRINTF +m4trace:configure.ac:42: -1- gl_PREREQ_ASPRINTF +m4trace:configure.ac:42: -1- gl_STDIO_MODULE_INDICATOR([vasprintf]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([vasprintf]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[vasprintf]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([vasprintf]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_VASPRINTF$]) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--flag=asprintf:2:c-format]) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--flag=vasprintf:2:c-format]) +m4trace:configure.ac:42: -1- gl_VERSION_ETC +m4trace:configure.ac:42: -1- m4_pattern_allow([^PACKAGE_PACKAGER$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PACKAGE_PACKAGER_VERSION$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PACKAGE_PACKAGER_BUG_REPORTS$]) +m4trace:configure.ac:42: -1- gl_WCHAR_H +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([wchar.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([wchar.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_wchar_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" wchar.h ]AS_TR_SH([wchar.h]) AS_TR_CPP([HAVE_wchar.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([wchar.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_WCHAR_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_WCHAR_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCHAR_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINT_T$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +#endif +#include + ]], [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb + wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset + wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp + wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr + wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime + ]) +m4trace:configure.ac:42: -1- gl_FUNC_WCRTOMB +m4trace:configure.ac:42: -1- gl_MBSTATE_T_BROKEN +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mbsinit], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mbsinit ]AS_TR_CPP([HAVE_mbsinit])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mbrtowc], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mbrtowc ]AS_TR_CPP([HAVE_mbrtowc])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_MBRTOWC_INCOMPLETE_STATE +m4trace:configure.ac:42: -1- gl_MBRTOWC_SANITYCHECK +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_wcrtomb], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" wcrtomb ]AS_TR_CPP([HAVE_wcrtomb])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_WCRTOMB$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([wcrtomb.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_WCRTOMB +m4trace:configure.ac:42: -1- gl_WCHAR_MODULE_INDICATOR([wcrtomb]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([wcrtomb]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[wcrtomb]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([wcrtomb]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_WCRTOMB$]) +m4trace:configure.ac:42: -1- gl_WCTYPE_H +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_iswcntrl], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" iswcntrl ]AS_TR_CPP([HAVE_iswcntrl])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ISWCNTRL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINT_T$]) +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([wctype.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([wctype.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_wctype_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" wctype.h ]AS_TR_SH([wctype.h]) AS_TR_CPP([HAVE_wctype.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([wctype.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_WCTYPE_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCTYPE_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ISWCNTRL$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TOWLOWER$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_TOWLOWER$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TOWLOWER$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +# include +#endif +#include + ]], [wctype iswctype wctrans towctrans + ]) +m4trace:configure.ac:42: -1- gl_FUNC_WCWIDTH +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_wchar_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" wchar.h ]AS_TR_SH([wchar.h]) AS_TR_CPP([HAVE_wchar.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_wcwidth], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" wcwidth ]AS_TR_CPP([HAVE_wcwidth])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_WCWIDTH$]) +m4trace:configure.ac:42: -1- gl_LIBSOURCES([wcwidth.c]) +m4trace:configure.ac:42: -1- gl_WCHAR_MODULE_INDICATOR([wcwidth]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([wcwidth]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[wcwidth]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([wcwidth]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_WCWIDTH$]) +m4trace:configure.ac:42: -1- gl_XALLOC +m4trace:configure.ac:42: -1- gl_XSIZE +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STDINT_H$]) +m4trace:configure.ac:42: -1- gl_XSTRNDUP +m4trace:configure.ac:42: -1- gl_PREREQ_XSTRNDUP +m4trace:configure.ac:42: -1- gl_XSTRTOL +m4trace:configure.ac:42: -1- gl_XVASPRINTF +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--flag=xasprintf:1:c-format]) +m4trace:configure.ac:42: -1- gl_COMMON +m4trace:configure.ac:42: -1- m4_pattern_allow([^gltests_WITNESS$]) +m4trace:configure.ac:42: -1- gl_HEADER_SYS_SOCKET +m4trace:configure.ac:42: -1- gl_SYS_SOCKET_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SOCKET$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CONNECT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ACCEPT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_BIND$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETPEERNAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETSOCKNAME$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETSOCKOPT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LISTEN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RECV$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SEND$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RECVFROM$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SENDTO$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SETSOCKOPT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SHUTDOWN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ACCEPT4$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SA_FAMILY_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ACCEPT4$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^_POSIX_PII_SOCKET$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SHUTDOWN$]) +m4trace:configure.ac:42: -1- gl_PREREQ_SYS_H_SOCKET +m4trace:configure.ac:42: -1- gl_CHECK_SOCKET_HEADERS +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_socket_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/socket.h ]AS_TR_SH([sys/socket.h]) AS_TR_CPP([HAVE_sys/socket.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WS2TCPIP_H$]) +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([sys/socket.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([sys/socket.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_socket_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/socket.h ]AS_TR_SH([sys/socket.h]) AS_TR_CPP([HAVE_sys/socket.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([sys/socket.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_SOCKET_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_SOCKET_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WS2TCPIP_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SA_FAMILY_T$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY$]) +m4trace:configure.ac:42: -1- gl_PREREQ_SYS_H_WINSOCK2 +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_socket_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/socket.h ]AS_TR_SH([sys/socket.h]) AS_TR_CPP([HAVE_sys/socket.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[ +/* Some systems require prerequisite headers. */ +#include +#include + ]], [socket connect accept bind getpeername getsockname getsockopt + listen recv send recvfrom sendto setsockopt shutdown accept4]) +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([accept.c]) +m4trace:configure.ac:42: -1- gl_SYS_SOCKET_MODULE_INDICATOR([accept]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([accept]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[accept]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[accept]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([accept]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_ACCEPT$]) +m4trace:configure.ac:42: -1- gl_HEADER_ARPA_INET +m4trace:configure.ac:42: -1- gl_ARPA_INET_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_INET_NTOP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_INET_PTON$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_INET_NTOP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_INET_PTON$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_INET_NTOP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_INET_PTON$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_arpa_inet_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" arpa/inet.h ]AS_TR_SH([arpa/inet.h]) AS_TR_CPP([HAVE_arpa/inet.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ARPA_INET_H$]) +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([arpa/inet.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([arpa/inet.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_arpa_inet_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" arpa/inet.h ]AS_TR_SH([arpa/inet.h]) AS_TR_CPP([HAVE_arpa/inet.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([arpa/inet.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_ARPA_INET_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[ +/* On some systems, this header is not self-consistent. */ +#if !(defined __GLIBC__ || defined __UCLIBC__) +# include +#endif +#ifdef __TANDEM +# include +#endif +#include + ]], [inet_ntop inet_pton]) +m4trace:configure.ac:42: -1- AC_PROG_MKDIR_P +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([bind.c]) +m4trace:configure.ac:42: -1- gl_SYS_SOCKET_MODULE_INDICATOR([bind]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([bind]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[bind]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[bind]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([bind]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_BIND$]) +m4trace:configure.ac:42: -1- gt_LOCALE_FR +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- gt_LOCALE_FR_UTF8 +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- gt_LOCALE_FR +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- gt_LOCALE_TR_UTF8 +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_TR_UTF8$]) +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([connect.c]) +m4trace:configure.ac:42: -1- gl_SYS_SOCKET_MODULE_INDICATOR([connect]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([connect]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[connect]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[connect]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([connect]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_CONNECT$]) +m4trace:configure.ac:42: -1- gl_FUNC_FDOPEN +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([fdopen.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_FDOPEN +m4trace:configure.ac:42: -1- gl_STDIO_MODULE_INDICATOR([fdopen]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([fdopen]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[fdopen]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[fdopen]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([fdopen]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_FDOPEN$]) +m4trace:configure.ac:42: -1- gl_FUNC_FTRUNCATE +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_ftruncate], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" ftruncate ]AS_TR_CPP([HAVE_ftruncate])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([ftruncate.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_FTRUNCATE +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_CHSIZE$]) +m4trace:configure.ac:42: -1- gl_UNISTD_MODULE_INDICATOR([ftruncate]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([ftruncate]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[ftruncate]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[ftruncate]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([ftruncate]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_FTRUNCATE$]) +m4trace:configure.ac:42: -1- gl_FUNC_GETCWD_LGPL +m4trace:configure.ac:42: -1- gl_FUNC_GETCWD_NULL +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_unistd_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" unistd.h ]AS_TR_SH([unistd.h]) AS_TR_CPP([HAVE_unistd.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_FUNC_GETCWD_SIGNATURE +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([getcwd-lgpl.c]) +m4trace:configure.ac:42: -1- gl_UNISTD_MODULE_INDICATOR([getcwd]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([getcwd]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[getcwd]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[getcwd]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([getcwd]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_GETCWD$]) +m4trace:configure.ac:42: -1- gl_FUNC_GETPAGESIZE +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETPAGESIZE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_OS_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_PARAM_H$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([getpagesize.c]) +m4trace:configure.ac:42: -1- gl_UNISTD_MODULE_INDICATOR([getpagesize]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([getpagesize]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[getpagesize]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[getpagesize]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([getpagesize]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_GETPAGESIZE$]) +m4trace:configure.ac:42: -1- gl_FUNC_INET_PTON +m4trace:configure.ac:42: -1- gl_PREREQ_SYS_H_WINSOCK2 +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_socket_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/socket.h ]AS_TR_SH([sys/socket.h]) AS_TR_CPP([HAVE_sys/socket.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_INET_PTON$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_INET_PTON$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_netdb_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" netdb.h ]AS_TR_SH([netdb.h]) AS_TR_CPP([HAVE_netdb.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_INET_PTON$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INET_PTON_LIB$]) +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([inet_pton.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_INET_PTON +m4trace:configure.ac:42: -1- gl_SOCKET_FAMILIES +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_netinet_in_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" netinet/in.h ]AS_TR_SH([netinet/in.h]) AS_TR_CPP([HAVE_netinet/in.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_IPV4$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_IPV6$]) +m4trace:configure.ac:42: -1- gl_ARPA_INET_MODULE_INDICATOR([inet_pton]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([inet_pton]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[inet_pton]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[inet_pton]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WORDS_BIGENDIAN$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^AC_APPLE_UNIVERSAL_BUILD$]) +m4trace:configure.ac:42: -1- gl_FUNC_IOCTL +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_IOCTL$]) +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([ioctl.c]) +m4trace:configure.ac:42: -1- gl_SYS_IOCTL_MODULE_INDICATOR([ioctl]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([ioctl]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[ioctl]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[ioctl]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([ioctl]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_IOCTL$]) +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([listen.c]) +m4trace:configure.ac:42: -1- gl_SYS_SOCKET_MODULE_INDICATOR([listen]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([listen]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[listen]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[listen]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([listen]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_LISTEN$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_newlocale], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" newlocale ]AS_TR_CPP([HAVE_newlocale])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gt_LOCALE_FR +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- gt_LOCALE_FR_UTF8 +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- gt_LOCALE_JA +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_JA$]) +m4trace:configure.ac:42: -1- gt_LOCALE_ZH_CN +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_ZH_CN$]) +m4trace:configure.ac:42: -1- gt_LOCALE_TR_UTF8 +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_TR_UTF8$]) +m4trace:configure.ac:42: -1- gt_LOCALE_FR_UTF8 +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- gt_LOCALE_FR +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- gt_LOCALE_FR_UTF8 +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- gt_LOCALE_JA +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_JA$]) +m4trace:configure.ac:42: -1- gt_LOCALE_ZH_CN +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_ZH_CN$]) +m4trace:configure.ac:42: -1- gt_LOCALE_FR_UTF8 +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- gt_LOCALE_ZH_CN +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_ZH_CN$]) +m4trace:configure.ac:42: -1- gl_FUNC_MMAP_ANON +m4trace:configure.ac:42: -1- m4_pattern_allow([^MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_mman_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/mman.h ]AS_TR_SH([sys/mman.h]) AS_TR_CPP([HAVE_sys/mman.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mprotect], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mprotect ]AS_TR_CPP([HAVE_mprotect])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_FUNC_NANOSLEEP +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_time_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/time.h ]AS_TR_SH([sys/time.h]) AS_TR_CPP([HAVE_sys/time.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_FUNC_SELECT +m4trace:configure.ac:42: -1- gl_HEADER_SYS_SELECT +m4trace:configure.ac:42: -1- gl_SYS_SELECT_H_DEFAULTS +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PSELECT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SELECT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PSELECT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PSELECT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SELECT$]) +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([sys/select.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([sys/select.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_select_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/select.h ]AS_TR_SH([sys/select.h]) AS_TR_CPP([HAVE_sys/select.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([sys/select.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_SELECT_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_SELECT_H$]) +m4trace:configure.ac:42: -1- gl_PREREQ_SYS_H_WINSOCK2 +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_socket_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/socket.h ]AS_TR_SH([sys/socket.h]) AS_TR_CPP([HAVE_sys/socket.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[ +/* Some systems require prerequisite headers. */ +#include +#if !(defined __GLIBC__ && !defined __UCLIBC__) && HAVE_SYS_TIME_H +# include +#endif +#include + ]], [pselect select]) +m4trace:configure.ac:42: -1- gl_SOCKETS +m4trace:configure.ac:42: -1- gl_SOCKETLIB +m4trace:configure.ac:42: -1- gl_PREREQ_SYS_H_WINSOCK2 +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_socket_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/socket.h ]AS_TR_SH([sys/socket.h]) AS_TR_CPP([HAVE_sys/socket.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_SOCKETS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBSOCKET$]) +m4trace:configure.ac:42: -1- gl_PREREQ_SOCKETS +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_select_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/select.h ]AS_TR_SH([sys/select.h]) AS_TR_CPP([HAVE_sys/select.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIB_SELECT$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIB_NANOSLEEP$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_BUG_BIG_NANOSLEEP$]) +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([nanosleep.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_NANOSLEEP +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_select_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/select.h ]AS_TR_SH([sys/select.h]) AS_TR_CPP([HAVE_sys/select.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_PREREQ_SIG_HANDLER_H +m4trace:configure.ac:42: -1- gl_TIME_MODULE_INDICATOR([nanosleep]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([nanosleep]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[nanosleep]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[nanosleep]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([nanosleep]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_NANOSLEEP$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_alarm], [_AC_CHECK_DECLS([alarm])]) +m4trace:configure.ac:42: -1- gl_HEADER_NETINET_IN +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_NETINET_IN_H$]) +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([netinet/in.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([netinet/in.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_netinet_in_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" netinet/in.h ]AS_TR_SH([netinet/in.h]) AS_TR_CPP([HAVE_netinet/in.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([netinet/in.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_NETINET_IN_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_NETINET_IN_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NETINET_IN_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_NETINET_IN_H], [test -n "$NETINET_IN_H"]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_NETINET_IN_H_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_NETINET_IN_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_NETINET_IN_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_NETINET_IN_H_FALSE]) +m4trace:configure.ac:42: -1- AC_PROG_MKDIR_P +m4trace:configure.ac:42: -1- gt_LOCALE_FR +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- gt_LOCALE_FR_UTF8 +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- gl_FUNC_PERROR +m4trace:configure.ac:42: -1- gl_FUNC_STRERROR_R +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_strerror_r], [_AC_CHECK_DECLS([strerror_r])]) +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([perror.c]) +m4trace:configure.ac:42: -1- gl_STRING_MODULE_INDICATOR([perror]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([perror]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[perror]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[perror]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([perror]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_PERROR$]) +m4trace:configure.ac:42: -1- gl_FUNC_PIPE +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_pipe], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" pipe ]AS_TR_CPP([HAVE_pipe])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([pipe.c]) +m4trace:configure.ac:42: -1- gl_UNISTD_MODULE_INDICATOR([pipe]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([pipe]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[pipe]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[pipe]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([pipe]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_PIPE$]) +m4trace:configure.ac:42: -1- gl_FUNC_PUTENV +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([putenv.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_PUTENV +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL__PUTENV$]) +m4trace:configure.ac:42: -1- gl_STDLIB_MODULE_INDICATOR([putenv]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([putenv]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[putenv]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[putenv]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([putenv]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_PUTENV$]) +m4trace:configure.ac:42: -1- gl_FUNC_MMAP_ANON +m4trace:configure.ac:42: -1- m4_pattern_allow([^MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_mman_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/mman.h ]AS_TR_SH([sys/mman.h]) AS_TR_CPP([HAVE_sys/mman.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mprotect], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mprotect ]AS_TR_CPP([HAVE_mprotect])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_FUNC_MMAP_ANON +m4trace:configure.ac:42: -1- m4_pattern_allow([^MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_mman_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/mman.h ]AS_TR_SH([sys/mman.h]) AS_TR_CPP([HAVE_sys/mman.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mprotect], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mprotect ]AS_TR_CPP([HAVE_mprotect])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_FUNC_SELECT +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_select_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/select.h ]AS_TR_SH([sys/select.h]) AS_TR_CPP([HAVE_sys/select.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIB_SELECT$]) +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([select.c]) +m4trace:configure.ac:42: -1- gl_SYS_SELECT_MODULE_INDICATOR([select]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([select]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[select]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[select]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([select]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SELECT$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_wait_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/wait.h ]AS_TR_SH([sys/wait.h]) AS_TR_CPP([HAVE_sys/wait.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_FUNC_SETLOCALE +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([setlocale.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_SETLOCALE +m4trace:configure.ac:42: -1- gl_LOCALE_MODULE_INDICATOR([setlocale]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([setlocale]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[setlocale]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[setlocale]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([setlocale]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SETLOCALE$]) +m4trace:configure.ac:42: -1- gt_LOCALE_FR +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- gt_LOCALE_FR_UTF8 +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- gt_LOCALE_JA +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_JA$]) +m4trace:configure.ac:42: -1- gt_LOCALE_ZH_CN +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_ZH_CN$]) +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([setsockopt.c]) +m4trace:configure.ac:42: -1- gl_SYS_SOCKET_MODULE_INDICATOR([setsockopt]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([setsockopt]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[setsockopt]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[setsockopt]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([setsockopt]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SETSOCKOPT$]) +m4trace:configure.ac:42: -1- gl_FUNC_SLEEP +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SLEEP$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_sleep], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" sleep ]AS_TR_CPP([HAVE_sleep])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([sleep.c]) +m4trace:configure.ac:42: -1- gl_UNISTD_MODULE_INDICATOR([sleep]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([sleep]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[sleep]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[sleep]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([sleep]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SLEEP$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_alarm], [_AC_CHECK_DECLS([alarm])]) +m4trace:configure.ac:42: -1- gl_FUNC_SNPRINTF +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SNPRINTF$]) +m4trace:configure.ac:42: -1- gl_SNPRINTF_SIZE1 +m4trace:configure.ac:42: -1- gl_SNPRINTF_RETVAL_C99 +m4trace:configure.ac:42: -1- gl_PRINTF_POSITIONS +m4trace:configure.ac:42: -1- gl_REPLACE_SNPRINTF +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([snprintf.c]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_snprintf], [_AC_CHECK_DECLS([snprintf])]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SNPRINTF$]) +m4trace:configure.ac:42: -1- gl_PREREQ_SNPRINTF +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_snprintf], [_AC_CHECK_DECLS([snprintf])]) +m4trace:configure.ac:42: -1- gl_STDIO_MODULE_INDICATOR([snprintf]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([snprintf]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[snprintf]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[snprintf]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([snprintf]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SNPRINTF$]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR([snprintf]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SNPRINTF$]) +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([socket.c]) +m4trace:configure.ac:42: -1- gl_SYS_SOCKET_MODULE_INDICATOR([socket]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([socket]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[socket]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[socket]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([socket]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SOCKET$]) +m4trace:configure.ac:42: -1- gl_TYPE_SOCKLEN_T +m4trace:configure.ac:42: -1- gl_SOCKET_HEADERS +m4trace:configure.ac:42: -1- m4_pattern_allow([^socklen_t$]) +m4trace:configure.ac:42: -1- gl_STDALIGN_H +m4trace:configure.ac:42: -1- m4_pattern_allow([^STDALIGN_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_STDALIGN_H], [test -n "$STDALIGN_H"]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDALIGN_H_TRUE$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDALIGN_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDALIGN_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDALIGN_H_FALSE]) +m4trace:configure.ac:42: -1- gl_FUNC_STRERROR_R +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Check_Decl_strerror_r], [_AC_CHECK_DECLS([strerror_r])]) +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([strerror_r.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_STRERROR_R +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func___xpg_strerror_r], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" __xpg_strerror_r ]AS_TR_CPP([HAVE___xpg_strerror_r])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_catgets], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" catgets ]AS_TR_CPP([HAVE_catgets])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_snprintf], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" snprintf ]AS_TR_CPP([HAVE_snprintf])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_STRING_MODULE_INDICATOR([strerror_r]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([strerror_r]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[strerror_r]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[strerror_r]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([strerror_r]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STRERROR_R$]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR([strerror_r-posix]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRERROR_R_POSIX$]) +m4trace:configure.ac:42: -1- gl_FUNC_MMAP_ANON +m4trace:configure.ac:42: -1- m4_pattern_allow([^MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_mman_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/mman.h ]AS_TR_SH([sys/mman.h]) AS_TR_CPP([HAVE_sys/mman.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_mprotect], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" mprotect ]AS_TR_CPP([HAVE_mprotect])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_FUNC_SYMLINK +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_symlink], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" symlink ]AS_TR_CPP([HAVE_symlink])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([symlink.c]) +m4trace:configure.ac:42: -1- gl_UNISTD_MODULE_INDICATOR([symlink]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([symlink]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[symlink]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[symlink]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([symlink]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SYMLINK$]) +m4trace:configure.ac:42: -1- gl_SYS_IOCTL_H +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_ioctl_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/ioctl.h ]AS_TR_SH([sys/ioctl.h]) AS_TR_CPP([HAVE_sys/ioctl.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_IOCTL_H$]) +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([sys/ioctl.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([sys/ioctl.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_ioctl_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/ioctl.h ]AS_TR_SH([sys/ioctl.h]) AS_TR_CPP([HAVE_sys/ioctl.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([sys/ioctl.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_IOCTL_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H$]) +m4trace:configure.ac:42: -1- gl_WARN_ON_USE_PREPARE([[#include +/* Some platforms declare ioctl in the wrong header. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +#endif + ]], [ioctl]) +m4trace:configure.ac:42: -1- AC_PROG_MKDIR_P +m4trace:configure.ac:42: -1- AC_PROG_MKDIR_P +m4trace:configure.ac:42: -1- AC_PROG_MKDIR_P +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_shutdown], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" shutdown ]AS_TR_CPP([HAVE_shutdown])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_HEADER_SYS_UIO +m4trace:configure.ac:42: -1- gl_SYS_UIO_H_DEFAULTS +m4trace:configure.ac:42: -1- gl_CHECK_NEXT_HEADERS([sys/uio.h]) +m4trace:configure.ac:42: -1- gl_NEXT_HEADERS_INTERNAL([sys/uio.h], [check]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Header_sys_uio_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" sys/uio.h ]AS_TR_SH([sys/uio.h]) AS_TR_CPP([HAVE_sys/uio.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- gl_ABSOLUTE_HEADER_ONE([sys/uio.h]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_UIO_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_UIO_H$]) +m4trace:configure.ac:42: -1- AC_PROG_MKDIR_P +m4trace:configure.ac:42: -1- m4_pattern_allow([^abs_aux_dir$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^abs_aux_dir$]) +m4trace:configure.ac:42: -1- gt_LOCALE_FR +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- gt_LOCALE_FR_UTF8 +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- gt_LOCALE_JA +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_JA$]) +m4trace:configure.ac:42: -1- gt_LOCALE_ZH_CN +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_ZH_CN$]) +m4trace:configure.ac:42: -1- gl_FUNC_WCTOB +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_Func_wctob], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" wctob ]AS_TR_CPP([HAVE_wctob])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:42: -1- AC_DEFUN([_AC_UNDECLARED_BUILTIN_c], [_AC_UNDECLARED_BUILTIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_WCTOB$]) +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([wctob.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_WCTOB +m4trace:configure.ac:42: -1- gl_WCHAR_MODULE_INDICATOR([wctob]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([wctob]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[wctob]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[wctob]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([wctob]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_WCTOB$]) +m4trace:configure.ac:42: -1- gl_FUNC_WCTOMB +m4trace:configure.ac:42: -1- gltests_LIBSOURCES([wctomb.c]) +m4trace:configure.ac:42: -1- gl_PREREQ_WCTOMB +m4trace:configure.ac:42: -1- gl_STDLIB_MODULE_INDICATOR([wctomb]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE([wctomb]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX([GNULIB_[]m4_translit([[wctomb]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([GNULIB_[]m4_translit([[wctomb]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) +m4trace:configure.ac:42: -1- gl_MODULE_INDICATOR_FOR_TESTS([wctomb]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_WCTOMB$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBDIFFUTILS_LIBDEPS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBDIFFUTILS_LTLIBDEPS$]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBTESTS_LIBDEPS$]) +m4trace:configure.ac:60: -1- gl_WARN_ADD([-Werror], [WERROR_CFLAGS]) +m4trace:configure.ac:60: -1- gl_UNKNOWN_WARNINGS_ARE_ERRORS +m4trace:configure.ac:60: -1- gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option], [gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'], [gl_unknown_warnings_are_errors=]) +m4trace:configure.ac:60: -1- gl_COMPILER_OPTION_IF([-Werror], [gl_AS_VAR_APPEND(m4_if([WERROR_CFLAGS], [], [[WARN_CFLAGS]], [[WERROR_CFLAGS]]), [" -Werror"])], [], []) +m4trace:configure.ac:60: -1- m4_pattern_allow([^WERROR_CFLAGS$]) +m4trace:configure.ac:61: -1- m4_pattern_allow([^WERROR_CFLAGS$]) +m4trace:configure.ac:95: -1- gl_MANYWARN_ALL_GCC([ws]) +m4trace:configure.ac:96: -1- gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw]) +m4trace:configure.ac:98: -1- gl_WARN_ADD([$w]) +m4trace:configure.ac:98: -1- gl_COMPILER_OPTION_IF([$w], [gl_AS_VAR_APPEND(m4_if([], [], [[WARN_CFLAGS]], [[]]), [" $w"])], [], []) +m4trace:configure.ac:98: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:100: -1- gl_WARN_ADD([-Wno-missing-field-initializers]) +m4trace:configure.ac:100: -1- gl_COMPILER_OPTION_IF([-Wno-missing-field-initializers], [gl_AS_VAR_APPEND(m4_if([], [], [[WARN_CFLAGS]], [[]]), [" -Wno-missing-field-initializers"])], [], []) +m4trace:configure.ac:100: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:101: -1- gl_WARN_ADD([-Wno-sign-compare]) +m4trace:configure.ac:101: -1- gl_COMPILER_OPTION_IF([-Wno-sign-compare], [gl_AS_VAR_APPEND(m4_if([], [], [[WARN_CFLAGS]], [[]]), [" -Wno-sign-compare"])], [], []) +m4trace:configure.ac:101: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:102: -1- gl_WARN_ADD([-Wno-pointer-sign]) +m4trace:configure.ac:102: -1- gl_COMPILER_OPTION_IF([-Wno-pointer-sign], [gl_AS_VAR_APPEND(m4_if([], [], [[WARN_CFLAGS]], [[]]), [" -Wno-pointer-sign"])], [], []) +m4trace:configure.ac:102: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:103: -1- gl_WARN_ADD([-Wno-unused-parameter]) +m4trace:configure.ac:103: -1- gl_COMPILER_OPTION_IF([-Wno-unused-parameter], [gl_AS_VAR_APPEND(m4_if([], [], [[WARN_CFLAGS]], [[]]), [" -Wno-unused-parameter"])], [], []) +m4trace:configure.ac:103: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:104: -1- gl_WARN_ADD([-Wno-format-nonliteral]) +m4trace:configure.ac:104: -1- gl_COMPILER_OPTION_IF([-Wno-format-nonliteral], [gl_AS_VAR_APPEND(m4_if([], [], [[WARN_CFLAGS]], [[]]), [" -Wno-format-nonliteral"])], [], []) +m4trace:configure.ac:104: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:108: -1- gl_WARN_ADD([-Wno-logical-op]) +m4trace:configure.ac:108: -1- gl_COMPILER_OPTION_IF([-Wno-logical-op], [gl_AS_VAR_APPEND(m4_if([], [], [[WARN_CFLAGS]], [[]]), [" -Wno-logical-op"])], [], []) +m4trace:configure.ac:108: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:110: -1- gl_WARN_ADD([-fdiagnostics-show-option]) +m4trace:configure.ac:110: -1- gl_COMPILER_OPTION_IF([-fdiagnostics-show-option], [gl_AS_VAR_APPEND(m4_if([], [], [[WARN_CFLAGS]], [[]]), [" -fdiagnostics-show-option"])], [], []) +m4trace:configure.ac:110: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:111: -1- gl_WARN_ADD([-funit-at-a-time]) +m4trace:configure.ac:111: -1- gl_COMPILER_OPTION_IF([-funit-at-a-time], [gl_AS_VAR_APPEND(m4_if([], [], [[WARN_CFLAGS]], [[]]), [" -funit-at-a-time"])], [], []) +m4trace:configure.ac:111: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:112: -1- gl_WARN_ADD([-fno-common]) +m4trace:configure.ac:112: -1- gl_COMPILER_OPTION_IF([-fno-common], [gl_AS_VAR_APPEND(m4_if([], [], [[WARN_CFLAGS]], [[]]), [" -fno-common"])], [], []) +m4trace:configure.ac:112: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:114: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:116: -1- m4_pattern_allow([^lint$]) +m4trace:configure.ac:117: -1- m4_pattern_allow([^_FORTIFY_SOURCE$]) +m4trace:configure.ac:119: -1- m4_pattern_allow([^GNULIB_PORTCHECK$]) +m4trace:configure.ac:128: -1- gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw]) +m4trace:configure.ac:129: -1- m4_pattern_allow([^GNULIB_WARN_CFLAGS$]) +m4trace:configure.ac:133: -1- AC_C_VARARRAYS +m4trace:configure.ac:133: -1- m4_pattern_allow([^HAVE_C_VARARRAYS$]) +m4trace:configure.ac:133: -1- m4_pattern_allow([^__STDC_NO_VLA__$]) +m4trace:configure.ac:135: -1- m4_pattern_allow([^DEFAULT_EDITOR_PROGRAM$]) +m4trace:configure.ac:138: -1- m4_pattern_allow([^PR_PROGRAM$]) +m4trace:configure.ac:139: -1- m4_pattern_allow([^PR_PROGRAM$]) +m4trace:configure.ac:141: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_BLKSIZE$]) +m4trace:configure.ac:142: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_RDEV$]) +m4trace:configure.ac:144: -1- m4_pattern_allow([^HAVE_SYS_WAIT_H$]) +m4trace:configure.ac:145: -1- m4_pattern_allow([^pid_t$]) +m4trace:configure.ac:147: -1- AC_DEFUN([_AC_Func_sigaction], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" sigaction ]AS_TR_CPP([HAVE_sigaction])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:147: -1- AC_DEFUN([_AC_Func_sigprocmask], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" sigprocmask ]AS_TR_CPP([HAVE_sigprocmask])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:147: -1- AC_DEFUN([_AC_Func_strcasecoll], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" strcasecoll ]AS_TR_CPP([HAVE_strcasecoll])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:147: -1- AC_DEFUN([_AC_Func_stricoll], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" stricoll ]AS_TR_CPP([HAVE_stricoll])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:149: -1- m4_pattern_allow([^HAVE_SIGBLOCK$]) +m4trace:configure.ac:151: -1- m4_pattern_allow([^CLOSEDIR_VOID$]) +m4trace:configure.ac:152: -1- AC_DEFUN([_AC_Header_vfork_h], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list], + [" vfork.h ]AS_TR_SH([vfork.h]) AS_TR_CPP([HAVE_vfork.h])["])])_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:152: -1- AC_DEFUN([_AC_Func_fork], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" fork ]AS_TR_CPP([HAVE_fork])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:152: -1- AC_DEFUN([_AC_Func_vfork], [m4_divert_text([INIT_PREPARE], + [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list], + [" vfork ]AS_TR_CPP([HAVE_vfork])["])])_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)]) +m4trace:configure.ac:152: -1- m4_pattern_allow([^HAVE_WORKING_VFORK$]) +m4trace:configure.ac:152: -1- m4_pattern_allow([^vfork$]) +m4trace:configure.ac:152: -1- m4_pattern_allow([^HAVE_WORKING_FORK$]) +m4trace:configure.ac:162: -1- m4_pattern_allow([^SRC_VERSION_C$]) +m4trace:configure.ac:167: -1- AM_GNU_GETTEXT([external], [need-ngettext]) +m4trace:configure.ac:167: -1- AM_GNU_GETTEXT_NEED([need-ngettext]) +m4trace:configure.ac:167: -1- AM_PO_SUBDIRS +m4trace:configure.ac:167: -1- AM_NLS +m4trace:configure.ac:167: -1- m4_pattern_allow([^USE_NLS$]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^GETTEXT_MACRO_VERSION$]) +m4trace:configure.ac:167: -1- AM_PATH_PROG_WITH_TEST([MSGFMT], [msgfmt], [$ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], [:]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^MSGFMT$]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^GMSGFMT$]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^MSGFMT_015$]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^GMSGFMT_015$]) +m4trace:configure.ac:167: -1- AM_PATH_PROG_WITH_TEST([XGETTEXT], [xgettext], [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], [:]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^XGETTEXT$]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^XGETTEXT_015$]) +m4trace:configure.ac:167: -1- AM_PATH_PROG_WITH_TEST([MSGMERGE], [msgmerge], [$ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1], [:]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^MSGMERGE$]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^XGETTEXT_EXTRA_OPTIONS$]) +m4trace:configure.ac:167: -1- gt_INTL_MACOSX +m4trace:configure.ac:167: -1- m4_pattern_allow([^HAVE_CFPREFERENCESCOPYAPPVALUE$]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^HAVE_CFLOCALECOPYCURRENT$]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^INTL_MACOSX_LIBS$]) +m4trace:configure.ac:167: -1- AM_ICONV_LINK +m4trace:configure.ac:167: -1- AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) +m4trace:configure.ac:167: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^HAVE_ICONV$]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^LIBICONV$]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^LTLIBICONV$]) +m4trace:configure.ac:167: -1- AC_LIB_LINKFLAGS_BODY([intl]) +m4trace:configure.ac:167: -1- AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) +m4trace:configure.ac:167: -1- AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) +m4trace:configure.ac:167: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:167: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:167: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:167: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:167: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^ENABLE_NLS$]) +m4trace:configure.ac:167: -1- AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) +m4trace:configure.ac:167: -1- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^HAVE_GETTEXT$]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^HAVE_DCGETTEXT$]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^INTLLIBS$]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^LIBINTL$]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^LTLIBINTL$]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^POSUB$]) +m4trace:configure.ac:168: -1- AM_GNU_GETTEXT_VERSION([0.19.2]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.ac:180: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.ac:180: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.ac:180: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^CONFIG_INCLUDE$]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^gl_LIBOBJS$]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^gl_LTLIBOBJS$]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^gltests_LIBOBJS$]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^gltests_LTLIBOBJS$]) +m4trace:configure.ac:180: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"]) +m4trace:configure.ac:180: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.ac:180: -1- AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) diff --git a/local/recipes/tools/diffutils/source/autom4te.cache/traces.1 b/local/recipes/tools/diffutils/source/autom4te.cache/traces.1 new file mode 100644 index 0000000000..3c660a7230 --- /dev/null +++ b/local/recipes/tools/diffutils/source/autom4te.cache/traces.1 @@ -0,0 +1,6481 @@ +m4trace:aclocal.m4:662: -1- AC_SUBST([am__quote]) +m4trace:aclocal.m4:662: -1- AC_SUBST_TRACE([am__quote]) +m4trace:aclocal.m4:662: -1- m4_pattern_allow([^am__quote$]) +m4trace:aclocal.m4:1318: -1- m4_include([m4/00gnulib.m4]) +m4trace:aclocal.m4:1319: -1- m4_include([m4/absolute-header.m4]) +m4trace:aclocal.m4:1320: -1- m4_include([m4/alloca.m4]) +m4trace:aclocal.m4:1321: -1- m4_include([m4/arpa_inet_h.m4]) +m4trace:aclocal.m4:1322: -1- m4_include([m4/btowc.m4]) +m4trace:aclocal.m4:1323: -1- m4_include([m4/builtin-expect.m4]) +m4trace:aclocal.m4:1324: -1- m4_include([m4/c-stack.m4]) +m4trace:aclocal.m4:1325: -1- m4_include([m4/clock_time.m4]) +m4trace:aclocal.m4:1326: -1- m4_include([m4/close.m4]) +m4trace:aclocal.m4:1327: -1- m4_include([m4/codeset.m4]) +m4trace:aclocal.m4:1328: -1- m4_include([m4/config-h.m4]) +m4trace:aclocal.m4:1329: -1- m4_include([m4/configmake.m4]) +m4trace:aclocal.m4:1330: -1- m4_include([m4/ctype.m4]) +m4trace:aclocal.m4:1331: -1- m4_include([m4/dirname.m4]) +m4trace:aclocal.m4:1332: -1- m4_include([m4/double-slash-root.m4]) +m4trace:aclocal.m4:1333: -1- m4_include([m4/dup2.m4]) +m4trace:aclocal.m4:1334: -1- m4_include([m4/eealloc.m4]) +m4trace:aclocal.m4:1335: -1- m4_include([m4/environ.m4]) +m4trace:aclocal.m4:1336: -1- m4_include([m4/errno_h.m4]) +m4trace:aclocal.m4:1337: -1- m4_include([m4/error.m4]) +m4trace:aclocal.m4:1338: -1- m4_include([m4/exponentd.m4]) +m4trace:aclocal.m4:1339: -1- m4_include([m4/extensions.m4]) +m4trace:aclocal.m4:1340: -1- m4_include([m4/extern-inline.m4]) +m4trace:aclocal.m4:1341: -1- m4_include([m4/fcntl-o.m4]) +m4trace:aclocal.m4:1342: -1- m4_include([m4/fcntl.m4]) +m4trace:aclocal.m4:1343: -1- m4_include([m4/fcntl_h.m4]) +m4trace:aclocal.m4:1344: -1- m4_include([m4/fdopen.m4]) +m4trace:aclocal.m4:1345: -1- m4_include([m4/filenamecat.m4]) +m4trace:aclocal.m4:1346: -1- m4_include([m4/flexmember.m4]) +m4trace:aclocal.m4:1347: -1- m4_include([m4/float_h.m4]) +m4trace:aclocal.m4:1348: -1- m4_include([m4/fnmatch.m4]) +m4trace:aclocal.m4:1349: -1- m4_include([m4/fpieee.m4]) +m4trace:aclocal.m4:1350: -1- m4_include([m4/freopen.m4]) +m4trace:aclocal.m4:1351: -1- m4_include([m4/fstat.m4]) +m4trace:aclocal.m4:1352: -1- m4_include([m4/ftruncate.m4]) +m4trace:aclocal.m4:1353: -1- m4_include([m4/getcwd.m4]) +m4trace:aclocal.m4:1354: -1- m4_include([m4/getdtablesize.m4]) +m4trace:aclocal.m4:1355: -1- m4_include([m4/getopt.m4]) +m4trace:aclocal.m4:1356: -1- m4_include([m4/getpagesize.m4]) +m4trace:aclocal.m4:1357: -1- m4_include([m4/getprogname.m4]) +m4trace:aclocal.m4:1358: -1- m4_include([m4/gettext.m4]) +m4trace:aclocal.m4:1359: -1- m4_include([m4/gettime.m4]) +m4trace:aclocal.m4:1360: -1- m4_include([m4/gettimeofday.m4]) +m4trace:aclocal.m4:1361: -1- m4_include([m4/glibc21.m4]) +m4trace:aclocal.m4:1362: -1- m4_include([m4/gnu-make.m4]) +m4trace:aclocal.m4:1363: -1- m4_include([m4/gnulib-common.m4]) +m4trace:aclocal.m4:1364: -1- m4_include([m4/gnulib-comp.m4]) +m4trace:aclocal.m4:1365: -1- m4_include([m4/hard-locale.m4]) +m4trace:aclocal.m4:1366: -1- m4_include([m4/iconv.m4]) +m4trace:aclocal.m4:1367: -1- m4_include([m4/iconv_h.m4]) +m4trace:aclocal.m4:1368: -1- m4_include([m4/iconv_open.m4]) +m4trace:aclocal.m4:1369: -1- m4_include([m4/include_next.m4]) +m4trace:aclocal.m4:1370: -1- m4_include([m4/inet_pton.m4]) +m4trace:aclocal.m4:1371: -1- m4_include([m4/inline.m4]) +m4trace:aclocal.m4:1372: -1- m4_include([m4/intlmacosx.m4]) +m4trace:aclocal.m4:1373: -1- m4_include([m4/intmax_t.m4]) +m4trace:aclocal.m4:1374: -1- m4_include([m4/inttostr.m4]) +m4trace:aclocal.m4:1375: -1- m4_include([m4/inttypes-pri.m4]) +m4trace:aclocal.m4:1376: -1- m4_include([m4/inttypes.m4]) +m4trace:aclocal.m4:1377: -1- m4_include([m4/inttypes_h.m4]) +m4trace:aclocal.m4:1378: -1- m4_include([m4/ioctl.m4]) +m4trace:aclocal.m4:1379: -1- m4_include([m4/isblank.m4]) +m4trace:aclocal.m4:1380: -1- m4_include([m4/iswblank.m4]) +m4trace:aclocal.m4:1381: -1- m4_include([m4/langinfo_h.m4]) +m4trace:aclocal.m4:1382: -1- m4_include([m4/largefile.m4]) +m4trace:aclocal.m4:1383: -1- m4_include([m4/lib-ld.m4]) +m4trace:aclocal.m4:1384: -1- m4_include([m4/lib-link.m4]) +m4trace:aclocal.m4:1385: -1- m4_include([m4/lib-prefix.m4]) +m4trace:aclocal.m4:1386: -1- m4_include([m4/libsigsegv.m4]) +m4trace:aclocal.m4:1387: -1- m4_include([m4/libunistring-base.m4]) +m4trace:aclocal.m4:1388: -1- m4_include([m4/limits-h.m4]) +m4trace:aclocal.m4:1389: -1- m4_include([m4/localcharset.m4]) +m4trace:aclocal.m4:1390: -1- m4_include([m4/locale-fr.m4]) +m4trace:aclocal.m4:1391: -1- m4_include([m4/locale-ja.m4]) +m4trace:aclocal.m4:1392: -1- m4_include([m4/locale-tr.m4]) +m4trace:aclocal.m4:1393: -1- m4_include([m4/locale-zh.m4]) +m4trace:aclocal.m4:1394: -1- m4_include([m4/locale_h.m4]) +m4trace:aclocal.m4:1395: -1- m4_include([m4/localeconv.m4]) +m4trace:aclocal.m4:1396: -1- m4_include([m4/localtime-buffer.m4]) +m4trace:aclocal.m4:1397: -1- m4_include([m4/longlong.m4]) +m4trace:aclocal.m4:1398: -1- m4_include([m4/lstat.m4]) +m4trace:aclocal.m4:1399: -1- m4_include([m4/malloc.m4]) +m4trace:aclocal.m4:1400: -1- m4_include([m4/malloca.m4]) +m4trace:aclocal.m4:1401: -1- m4_include([m4/manywarnings.m4]) +m4trace:aclocal.m4:1402: -1- m4_include([m4/mbchar.m4]) +m4trace:aclocal.m4:1403: -1- m4_include([m4/mbiter.m4]) +m4trace:aclocal.m4:1404: -1- m4_include([m4/mbrtowc.m4]) +m4trace:aclocal.m4:1405: -1- m4_include([m4/mbsinit.m4]) +m4trace:aclocal.m4:1406: -1- m4_include([m4/mbslen.m4]) +m4trace:aclocal.m4:1407: -1- m4_include([m4/mbsrtowcs.m4]) +m4trace:aclocal.m4:1408: -1- m4_include([m4/mbstate_t.m4]) +m4trace:aclocal.m4:1409: -1- m4_include([m4/mbtowc.m4]) +m4trace:aclocal.m4:1410: -1- m4_include([m4/memchr.m4]) +m4trace:aclocal.m4:1411: -1- m4_include([m4/minmax.m4]) +m4trace:aclocal.m4:1412: -1- m4_include([m4/mkstemp.m4]) +m4trace:aclocal.m4:1413: -1- m4_include([m4/mktime.m4]) +m4trace:aclocal.m4:1414: -1- m4_include([m4/mmap-anon.m4]) +m4trace:aclocal.m4:1415: -1- m4_include([m4/mode_t.m4]) +m4trace:aclocal.m4:1416: -1- m4_include([m4/msvc-inval.m4]) +m4trace:aclocal.m4:1417: -1- m4_include([m4/msvc-nothrow.m4]) +m4trace:aclocal.m4:1418: -1- m4_include([m4/multiarch.m4]) +m4trace:aclocal.m4:1419: -1- m4_include([m4/nanosleep.m4]) +m4trace:aclocal.m4:1420: -1- m4_include([m4/netinet_in_h.m4]) +m4trace:aclocal.m4:1421: -1- m4_include([m4/nl_langinfo.m4]) +m4trace:aclocal.m4:1422: -1- m4_include([m4/nls.m4]) +m4trace:aclocal.m4:1423: -1- m4_include([m4/nocrash.m4]) +m4trace:aclocal.m4:1424: -1- m4_include([m4/off_t.m4]) +m4trace:aclocal.m4:1425: -1- m4_include([m4/open.m4]) +m4trace:aclocal.m4:1426: -1- m4_include([m4/pathmax.m4]) +m4trace:aclocal.m4:1427: -1- m4_include([m4/perror.m4]) +m4trace:aclocal.m4:1428: -1- m4_include([m4/pipe.m4]) +m4trace:aclocal.m4:1429: -1- m4_include([m4/po.m4]) +m4trace:aclocal.m4:1430: -1- m4_include([m4/printf.m4]) +m4trace:aclocal.m4:1431: -1- m4_include([m4/progtest.m4]) +m4trace:aclocal.m4:1432: -1- m4_include([m4/putenv.m4]) +m4trace:aclocal.m4:1433: -1- m4_include([m4/quote.m4]) +m4trace:aclocal.m4:1434: -1- m4_include([m4/quotearg.m4]) +m4trace:aclocal.m4:1435: -1- m4_include([m4/raise.m4]) +m4trace:aclocal.m4:1436: -1- m4_include([m4/rawmemchr.m4]) +m4trace:aclocal.m4:1437: -1- m4_include([m4/readlink.m4]) +m4trace:aclocal.m4:1438: -1- m4_include([m4/regex.m4]) +m4trace:aclocal.m4:1439: -1- m4_include([m4/secure_getenv.m4]) +m4trace:aclocal.m4:1440: -1- m4_include([m4/select.m4]) +m4trace:aclocal.m4:1441: -1- m4_include([m4/setenv.m4]) +m4trace:aclocal.m4:1442: -1- m4_include([m4/setlocale.m4]) +m4trace:aclocal.m4:1443: -1- m4_include([m4/sigaction.m4]) +m4trace:aclocal.m4:1444: -1- m4_include([m4/signal_h.m4]) +m4trace:aclocal.m4:1445: -1- m4_include([m4/signalblocking.m4]) +m4trace:aclocal.m4:1446: -1- m4_include([m4/size_max.m4]) +m4trace:aclocal.m4:1447: -1- m4_include([m4/sleep.m4]) +m4trace:aclocal.m4:1448: -1- m4_include([m4/snprintf.m4]) +m4trace:aclocal.m4:1449: -1- m4_include([m4/socketlib.m4]) +m4trace:aclocal.m4:1450: -1- m4_include([m4/sockets.m4]) +m4trace:aclocal.m4:1451: -1- m4_include([m4/socklen.m4]) +m4trace:aclocal.m4:1452: -1- m4_include([m4/sockpfaf.m4]) +m4trace:aclocal.m4:1453: -1- m4_include([m4/ssize_t.m4]) +m4trace:aclocal.m4:1454: -1- m4_include([m4/stat-time.m4]) +m4trace:aclocal.m4:1455: -1- m4_include([m4/stat.m4]) +m4trace:aclocal.m4:1456: -1- m4_include([m4/stdalign.m4]) +m4trace:aclocal.m4:1457: -1- m4_include([m4/stdarg.m4]) +m4trace:aclocal.m4:1458: -1- m4_include([m4/stdbool.m4]) +m4trace:aclocal.m4:1459: -1- m4_include([m4/stddef_h.m4]) +m4trace:aclocal.m4:1460: -1- m4_include([m4/stdint.m4]) +m4trace:aclocal.m4:1461: -1- m4_include([m4/stdint_h.m4]) +m4trace:aclocal.m4:1462: -1- m4_include([m4/stdio_h.m4]) +m4trace:aclocal.m4:1463: -1- m4_include([m4/stdlib_h.m4]) +m4trace:aclocal.m4:1464: -1- m4_include([m4/strcase.m4]) +m4trace:aclocal.m4:1465: -1- m4_include([m4/strerror.m4]) +m4trace:aclocal.m4:1466: -1- m4_include([m4/strerror_r.m4]) +m4trace:aclocal.m4:1467: -1- m4_include([m4/strftime.m4]) +m4trace:aclocal.m4:1468: -1- m4_include([m4/string_h.m4]) +m4trace:aclocal.m4:1469: -1- m4_include([m4/strings_h.m4]) +m4trace:aclocal.m4:1470: -1- m4_include([m4/strndup.m4]) +m4trace:aclocal.m4:1471: -1- m4_include([m4/strnlen.m4]) +m4trace:aclocal.m4:1472: -1- m4_include([m4/strptime.m4]) +m4trace:aclocal.m4:1473: -1- m4_include([m4/strtoull.m4]) +m4trace:aclocal.m4:1474: -1- m4_include([m4/strtoumax.m4]) +m4trace:aclocal.m4:1475: -1- m4_include([m4/symlink.m4]) +m4trace:aclocal.m4:1476: -1- m4_include([m4/sys_ioctl_h.m4]) +m4trace:aclocal.m4:1477: -1- m4_include([m4/sys_select_h.m4]) +m4trace:aclocal.m4:1478: -1- m4_include([m4/sys_socket_h.m4]) +m4trace:aclocal.m4:1479: -1- m4_include([m4/sys_stat_h.m4]) +m4trace:aclocal.m4:1480: -1- m4_include([m4/sys_time_h.m4]) +m4trace:aclocal.m4:1481: -1- m4_include([m4/sys_types_h.m4]) +m4trace:aclocal.m4:1482: -1- m4_include([m4/sys_uio_h.m4]) +m4trace:aclocal.m4:1483: -1- m4_include([m4/sys_wait_h.m4]) +m4trace:aclocal.m4:1484: -1- m4_include([m4/tempname.m4]) +m4trace:aclocal.m4:1485: -1- m4_include([m4/time_h.m4]) +m4trace:aclocal.m4:1486: -1- m4_include([m4/time_r.m4]) +m4trace:aclocal.m4:1487: -1- m4_include([m4/time_rz.m4]) +m4trace:aclocal.m4:1488: -1- m4_include([m4/timegm.m4]) +m4trace:aclocal.m4:1489: -1- m4_include([m4/timespec.m4]) +m4trace:aclocal.m4:1490: -1- m4_include([m4/tm_gmtoff.m4]) +m4trace:aclocal.m4:1491: -1- m4_include([m4/tzset.m4]) +m4trace:aclocal.m4:1492: -1- m4_include([m4/unistd_h.m4]) +m4trace:aclocal.m4:1493: -1- m4_include([m4/unlocked-io.m4]) +m4trace:aclocal.m4:1494: -1- m4_include([m4/vararrays.m4]) +m4trace:aclocal.m4:1495: -1- m4_include([m4/vasnprintf.m4]) +m4trace:aclocal.m4:1496: -1- m4_include([m4/vasprintf.m4]) +m4trace:aclocal.m4:1497: -1- m4_include([m4/version-etc.m4]) +m4trace:aclocal.m4:1498: -1- m4_include([m4/warn-on-use.m4]) +m4trace:aclocal.m4:1499: -1- m4_include([m4/warnings.m4]) +m4trace:aclocal.m4:1500: -1- m4_include([m4/wchar_h.m4]) +m4trace:aclocal.m4:1501: -1- m4_include([m4/wchar_t.m4]) +m4trace:aclocal.m4:1502: -1- m4_include([m4/wcrtomb.m4]) +m4trace:aclocal.m4:1503: -1- m4_include([m4/wctob.m4]) +m4trace:aclocal.m4:1504: -1- m4_include([m4/wctomb.m4]) +m4trace:aclocal.m4:1505: -1- m4_include([m4/wctype_h.m4]) +m4trace:aclocal.m4:1506: -1- m4_include([m4/wcwidth.m4]) +m4trace:aclocal.m4:1507: -1- m4_include([m4/wint_t.m4]) +m4trace:aclocal.m4:1508: -1- m4_include([m4/xalloc.m4]) +m4trace:aclocal.m4:1509: -1- m4_include([m4/xsize.m4]) +m4trace:aclocal.m4:1510: -1- m4_include([m4/xstrndup.m4]) +m4trace:aclocal.m4:1511: -1- m4_include([m4/xstrtol.m4]) +m4trace:aclocal.m4:1512: -1- m4_include([m4/xvasprintf.m4]) +m4trace:configure.ac:21: -1- AC_INIT([GNU diffutils], [3.6], [bug-diffutils@gnu.org]) +m4trace:configure.ac:21: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.ac:21: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.ac:21: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section 'AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.ac:21: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.ac:21: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.ac:21: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.ac:21: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.ac:21: -1- AC_SUBST([SHELL]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([SHELL]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.ac:21: -1- AC_SUBST([PATH_SEPARATOR]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.ac:21: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([PACKAGE_NAME]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:21: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:21: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:21: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([PACKAGE_STRING]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:21: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:21: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([PACKAGE_URL]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:21: -1- AC_SUBST([exec_prefix], [NONE]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([exec_prefix]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.ac:21: -1- AC_SUBST([prefix], [NONE]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([prefix]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.ac:21: -1- AC_SUBST([program_transform_name], [s,x,x,]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([program_transform_name]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.ac:21: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([bindir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.ac:21: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([sbindir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.ac:21: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([libexecdir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.ac:21: -1- AC_SUBST([datarootdir], ['${prefix}/share']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([datarootdir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:21: -1- AC_SUBST([datadir], ['${datarootdir}']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([datadir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.ac:21: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([sysconfdir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.ac:21: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([sharedstatedir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.ac:21: -1- AC_SUBST([localstatedir], ['${prefix}/var']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([localstatedir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.ac:21: -1- AC_SUBST([runstatedir], ['${localstatedir}/run']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([runstatedir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^runstatedir$]) +m4trace:configure.ac:21: -1- AC_SUBST([includedir], ['${prefix}/include']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([includedir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.ac:21: -1- AC_SUBST([oldincludedir], ['/usr/include']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([oldincludedir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.ac:21: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], + ['${datarootdir}/doc/${PACKAGE_TARNAME}'], + ['${datarootdir}/doc/${PACKAGE}'])]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([docdir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:21: -1- AC_SUBST([infodir], ['${datarootdir}/info']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([infodir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.ac:21: -1- AC_SUBST([htmldir], ['${docdir}']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([htmldir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:21: -1- AC_SUBST([dvidir], ['${docdir}']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([dvidir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:21: -1- AC_SUBST([pdfdir], ['${docdir}']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([pdfdir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:21: -1- AC_SUBST([psdir], ['${docdir}']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([psdir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:21: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([libdir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.ac:21: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([localedir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:21: -1- AC_SUBST([mandir], ['${datarootdir}/man']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([mandir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.ac:21: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:21: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ +@%:@undef PACKAGE_NAME]) +m4trace:configure.ac:21: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:21: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ +@%:@undef PACKAGE_TARNAME]) +m4trace:configure.ac:21: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:21: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ +@%:@undef PACKAGE_VERSION]) +m4trace:configure.ac:21: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:21: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ +@%:@undef PACKAGE_STRING]) +m4trace:configure.ac:21: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:21: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ +@%:@undef PACKAGE_BUGREPORT]) +m4trace:configure.ac:21: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:21: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */ +@%:@undef PACKAGE_URL]) +m4trace:configure.ac:21: -1- AC_SUBST([DEFS]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([DEFS]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.ac:21: -1- AC_SUBST([ECHO_C]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([ECHO_C]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.ac:21: -1- AC_SUBST([ECHO_N]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([ECHO_N]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.ac:21: -1- AC_SUBST([ECHO_T]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([ECHO_T]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.ac:21: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:21: -1- AC_SUBST([build_alias]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([build_alias]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.ac:21: -1- AC_SUBST([host_alias]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([host_alias]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.ac:21: -1- AC_SUBST([target_alias]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([target_alias]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.ac:26: -1- AC_CONFIG_AUX_DIR([build-aux]) +m4trace:configure.ac:27: -1- AC_CONFIG_MACRO_DIR_TRACE([m4]) +m4trace:configure.ac:29: -1- AM_INIT_AUTOMAKE([1.11 dist-xz no-dist-gzip subdir-objects + color-tests parallel-tests]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.ac:29: -1- AM_AUTOMAKE_VERSION([1.18.1]) +m4trace:configure.ac:29: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.ac:29: -1- AC_SUBST([INSTALL_PROGRAM]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:29: -1- AC_SUBST([INSTALL_SCRIPT]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:29: -1- AC_SUBST([INSTALL_DATA]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([INSTALL_DATA]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:29: -1- AC_SUBST([am__isrc], [' -I$(srcdir)']) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([am__isrc]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.ac:29: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.ac:29: -1- AC_SUBST([CYGPATH_W]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([CYGPATH_W]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.ac:29: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME']) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([PACKAGE]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:29: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION']) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([VERSION]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:29: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:29: -1- AH_OUTPUT([PACKAGE], [/* Name of package */ +@%:@undef PACKAGE]) +m4trace:configure.ac:29: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:29: -1- AH_OUTPUT([VERSION], [/* Version number of package */ +@%:@undef VERSION]) +m4trace:configure.ac:29: -1- AC_REQUIRE_AUX_FILE([missing]) +m4trace:configure.ac:29: -1- AC_SUBST([ACLOCAL]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([ACLOCAL]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.ac:29: -1- AC_SUBST([AUTOCONF]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([AUTOCONF]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.ac:29: -1- AC_SUBST([AUTOMAKE]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([AUTOMAKE]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.ac:29: -1- AC_SUBST([AUTOHEADER]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([AUTOHEADER]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.ac:29: -1- AC_SUBST([MAKEINFO]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([MAKEINFO]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.ac:29: -1- AC_SUBST([install_sh]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([install_sh]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.ac:29: -1- AC_SUBST([STRIP]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([STRIP]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:29: -1- AC_SUBST([INSTALL_STRIP_PROGRAM]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.ac:29: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.ac:29: -1- AC_SUBST([MKDIR_P]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([MKDIR_P]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.ac:29: -1- AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([mkdir_p]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.ac:29: -1- AC_SUBST([AWK]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([AWK]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.ac:29: -1- AC_SUBST([SET_MAKE]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([SET_MAKE]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.ac:29: -1- AC_SUBST([am__leading_dot]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([am__leading_dot]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.ac:29: -1- AC_SUBST([AMTAR], ['$${TAR-tar}']) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([AMTAR]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.ac:29: -1- AC_SUBST([am__tar]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([am__tar]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.ac:29: -1- AC_SUBST([am__untar]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([am__untar]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.ac:29: -1- AC_SUBST([CTAGS]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([CTAGS]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^CTAGS$]) +m4trace:configure.ac:29: -1- AC_SUBST([ETAGS]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([ETAGS]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^ETAGS$]) +m4trace:configure.ac:29: -1- AC_SUBST([CSCOPE]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([CSCOPE]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^CSCOPE$]) +m4trace:configure.ac:29: -1- AC_SUBST([AM_V]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([AM_V]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AM_V$]) +m4trace:configure.ac:29: -1- _AM_SUBST_NOTMAKE([AM_V]) +m4trace:configure.ac:29: -1- AC_SUBST([AM_DEFAULT_V]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([AM_DEFAULT_V]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AM_DEFAULT_V$]) +m4trace:configure.ac:29: -1- _AM_SUBST_NOTMAKE([AM_DEFAULT_V]) +m4trace:configure.ac:29: -1- AC_SUBST([AM_DEFAULT_VERBOSITY]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([AM_DEFAULT_VERBOSITY]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AM_DEFAULT_VERBOSITY$]) +m4trace:configure.ac:29: -1- AC_SUBST([AM_BACKSLASH]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([AM_BACKSLASH]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AM_BACKSLASH$]) +m4trace:configure.ac:29: -1- _AM_SUBST_NOTMAKE([AM_BACKSLASH]) +m4trace:configure.ac:29: -1- AC_SUBST([am__rm_f_notfound]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([am__rm_f_notfound]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^am__rm_f_notfound$]) +m4trace:configure.ac:29: -1- AC_SUBST([am__xargs_n]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([am__xargs_n]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^am__xargs_n$]) +m4trace:configure.ac:31: -1- AM_SILENT_RULES([yes]) +m4trace:configure.ac:33: -1- _m4_warn([obsolete], [The macro 'AC_CONFIG_HEADER' is obsolete. +You should run autoupdate.], [./lib/autoconf/status.m4:719: AC_CONFIG_HEADER is expanded from... +configure.ac:33: the top level]) +m4trace:configure.ac:33: -1- AC_CONFIG_HEADERS([lib/config.h:lib/config.hin]) +m4trace:configure.ac:35: -1- AC_SUBST([AWK]) +m4trace:configure.ac:35: -1- AC_SUBST_TRACE([AWK]) +m4trace:configure.ac:35: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.ac:36: -1- AC_SUBST([CC]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:36: -1- AC_SUBST([CFLAGS]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([CFLAGS]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.ac:36: -1- AC_SUBST([LDFLAGS]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([LDFLAGS]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:36: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:36: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:36: -1- AC_SUBST([CC]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:36: -1- AC_SUBST([CC]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:36: -1- AC_SUBST([CC]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:36: -1- AC_SUBST([CC]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:36: -1- AC_SUBST([ac_ct_CC]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([ac_ct_CC]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.ac:36: -1- AC_SUBST([CC]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:36: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([EXEEXT]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.ac:36: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([OBJEXT]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.ac:36: -1- AC_REQUIRE_AUX_FILE([compile]) +m4trace:configure.ac:36: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([DEPDIR]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.ac:36: -1- AC_SUBST([am__include]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([am__include]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.ac:36: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.ac:36: -1- AC_SUBST([AMDEP_TRUE]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([AMDEP_TRUE]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.ac:36: -1- AC_SUBST([AMDEP_FALSE]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([AMDEP_FALSE]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.ac:36: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.ac:36: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.ac:36: -1- AC_SUBST([AMDEPBACKSLASH]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([AMDEPBACKSLASH]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.ac:36: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.ac:36: -1- AC_SUBST([am__nodep]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([am__nodep]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^am__nodep$]) +m4trace:configure.ac:36: -1- _AM_SUBST_NOTMAKE([am__nodep]) +m4trace:configure.ac:36: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([CCDEPMODE]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.ac:36: -1- AM_CONDITIONAL([am__fastdepCC], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:36: -1- AC_SUBST([am__fastdepCC_TRUE]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.ac:36: -1- AC_SUBST([am__fastdepCC_FALSE]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.ac:36: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.ac:36: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.ac:37: -1- AM_PROG_CC_C_O +m4trace:configure.ac:38: -1- AC_SUBST([HELP2MAN]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([HELP2MAN]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^HELP2MAN$]) +m4trace:configure.ac:39: -1- AC_SUBST([RANLIB]) +m4trace:configure.ac:39: -1- AC_SUBST_TRACE([RANLIB]) +m4trace:configure.ac:39: -1- m4_pattern_allow([^RANLIB$]) +m4trace:configure.ac:40: -1- m4_pattern_forbid([^gl_[A-Z]]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^gl_ES$]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^gl_LIBOBJS$]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^gl_LTLIBOBJS$]) +m4trace:configure.ac:40: -1- _m4_warn([obsolete], [The macro 'AC_GNU_SOURCE' is obsolete. +You should run autoupdate.], [./lib/autoconf/specific.m4:489: AC_GNU_SOURCE is expanded from... +m4/gnulib-comp.m4:34: gl_EARLY is expanded from... +configure.ac:40: the top level]) +m4trace:configure.ac:40: -1- AH_OUTPUT([HAVE_STDIO_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDIO_H]) +m4trace:configure.ac:40: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDLIB_H]) +m4trace:configure.ac:40: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRING_H]) +m4trace:configure.ac:40: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_INTTYPES_H]) +m4trace:configure.ac:40: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDINT_H]) +m4trace:configure.ac:40: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRINGS_H]) +m4trace:configure.ac:40: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_STAT_H]) +m4trace:configure.ac:40: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TYPES_H]) +m4trace:configure.ac:40: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.ac:40: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if all of the C89 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +@%:@undef STDC_HEADERS]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_POSIX_SOURCE]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_POSIX_SOURCE$]) +m4trace:configure.ac:40: -1- AH_OUTPUT([_POSIX_SOURCE], [/* Define to 1 if you need to in order for \'stat\' and other things to work. */ +@%:@undef _POSIX_SOURCE]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_POSIX_1_SOURCE]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_POSIX_1_SOURCE$]) +m4trace:configure.ac:40: -1- AH_OUTPUT([_POSIX_1_SOURCE], [/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +@%:@undef _POSIX_1_SOURCE]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_MINIX]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_MINIX$]) +m4trace:configure.ac:40: -1- AH_OUTPUT([_MINIX], [/* Define to 1 if on MINIX. */ +@%:@undef _MINIX]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_NETBSD_SOURCE]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_NETBSD_SOURCE$]) +m4trace:configure.ac:40: -1- AH_OUTPUT([_NETBSD_SOURCE], [/* Define to 1 to make NetBSD features available. MINIX 3 needs this. */ +@%:@undef _NETBSD_SOURCE]) +m4trace:configure.ac:40: -1- AH_OUTPUT([USE_SYSTEM_EXTENSIONS], [/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable general extensions on macOS. */ +#ifndef _DARWIN_C_SOURCE +# undef _DARWIN_C_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# undef __STDC_WANT_IEC_60559_BFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# undef __STDC_WANT_IEC_60559_DFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# undef __STDC_WANT_IEC_60559_TYPES_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# undef __STDC_WANT_LIB_EXT2__ +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# undef __STDC_WANT_MATH_SPEC_FUNCS__ +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable X/Open extensions if necessary. HP-UX 11.11 defines + mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of + whether compiling with -Ae or -D_HPUX_SOURCE=1. */ +#ifndef _XOPEN_SOURCE +# undef _XOPEN_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif +]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([__EXTENSIONS__]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^__EXTENSIONS__$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_ALL_SOURCE]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_ALL_SOURCE$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_DARWIN_C_SOURCE]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_DARWIN_C_SOURCE$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_GNU_SOURCE]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_GNU_SOURCE$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_POSIX_PTHREAD_SEMANTICS]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_POSIX_PTHREAD_SEMANTICS$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([__STDC_WANT_IEC_60559_ATTRIBS_EXT__]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^__STDC_WANT_IEC_60559_ATTRIBS_EXT__$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([__STDC_WANT_IEC_60559_BFP_EXT__]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^__STDC_WANT_IEC_60559_BFP_EXT__$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([__STDC_WANT_IEC_60559_DFP_EXT__]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^__STDC_WANT_IEC_60559_DFP_EXT__$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([__STDC_WANT_IEC_60559_FUNCS_EXT__]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^__STDC_WANT_IEC_60559_FUNCS_EXT__$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([__STDC_WANT_IEC_60559_TYPES_EXT__]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^__STDC_WANT_IEC_60559_TYPES_EXT__$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([__STDC_WANT_LIB_EXT2__]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^__STDC_WANT_LIB_EXT2__$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([__STDC_WANT_MATH_SPEC_FUNCS__]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^__STDC_WANT_MATH_SPEC_FUNCS__$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_TANDEM_SOURCE]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_TANDEM_SOURCE$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_XOPEN_SOURCE]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_XOPEN_SOURCE$]) +m4trace:configure.ac:40: -1- AC_SUBST([CPP]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:40: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:40: -1- AC_SUBST([CPP]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:40: -1- AC_SUBST([AR]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([AR]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^AR$]) +m4trace:configure.ac:40: -1- AC_SUBST([AR]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([AR]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^AR$]) +m4trace:configure.ac:40: -1- AC_SUBST([ARFLAGS]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([ARFLAGS]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^ARFLAGS$]) +m4trace:configure.ac:40: -1- AC_SUBST([RANLIB]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([RANLIB]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^RANLIB$]) +m4trace:configure.ac:40: -1- AC_SUBST([RANLIB]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([RANLIB]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^RANLIB$]) +m4trace:configure.ac:40: -1- AC_CANONICAL_HOST +m4trace:configure.ac:40: -1- AC_CANONICAL_BUILD +m4trace:configure.ac:40: -1- AC_REQUIRE_AUX_FILE([config.sub]) +m4trace:configure.ac:40: -1- AC_REQUIRE_AUX_FILE([config.guess]) +m4trace:configure.ac:40: -1- AC_SUBST([build], [$ac_cv_build]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([build]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^build$]) +m4trace:configure.ac:40: -1- AC_SUBST([build_cpu], [$[1]]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([build_cpu]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^build_cpu$]) +m4trace:configure.ac:40: -1- AC_SUBST([build_vendor], [$[2]]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([build_vendor]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^build_vendor$]) +m4trace:configure.ac:40: -1- AC_SUBST([build_os]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([build_os]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^build_os$]) +m4trace:configure.ac:40: -1- AC_SUBST([host], [$ac_cv_host]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([host]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^host$]) +m4trace:configure.ac:40: -1- AC_SUBST([host_cpu], [$[1]]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([host_cpu]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^host_cpu$]) +m4trace:configure.ac:40: -1- AC_SUBST([host_vendor], [$[2]]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([host_vendor]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^host_vendor$]) +m4trace:configure.ac:40: -1- AC_SUBST([host_os]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([host_os]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^host_os$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_FILE_OFFSET_BITS]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_FILE_OFFSET_BITS$]) +m4trace:configure.ac:40: -1- AH_OUTPUT([_FILE_OFFSET_BITS], [/* Number of bits in a file offset, on hosts where this is settable. */ +@%:@undef _FILE_OFFSET_BITS]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_LARGE_FILES]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_LARGE_FILES$]) +m4trace:configure.ac:40: -1- AH_OUTPUT([_LARGE_FILES], [/* Define to 1 on platforms where this makes off_t a 64-bit type. */ +@%:@undef _LARGE_FILES]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_TIME_BITS]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_TIME_BITS$]) +m4trace:configure.ac:40: -1- AH_OUTPUT([_TIME_BITS], [/* Number of bits in time_t, on hosts where this is settable. */ +@%:@undef _TIME_BITS]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([__MINGW_USE_VC2005_COMPAT]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^__MINGW_USE_VC2005_COMPAT$]) +m4trace:configure.ac:40: -1- AH_OUTPUT([__MINGW_USE_VC2005_COMPAT], [/* Define to 1 on platforms where this makes time_t a 64-bit type. */ +@%:@undef __MINGW_USE_VC2005_COMPAT]) +m4trace:configure.ac:40: -1- _m4_warn([obsolete], [The macro 'AC_PROG_CC_STDC' is obsolete. +You should run autoupdate.], [./lib/autoconf/c.m4:1669: AC_PROG_CC_STDC is expanded from... +m4/gnulib-common.m4:239: gl_PROG_CC_C99 is expanded from... +m4/gnulib-comp.m4:34: gl_EARLY is expanded from... +configure.ac:40: the top level]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_COND_LIBTOOL], [false]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_COND_LIBTOOL_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_COND_LIBTOOL_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_COND_LIBTOOL_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_COND_LIBTOOL_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_COND_LIBTOOL_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_COND_LIBTOOL_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_COND_LIBTOOL_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_COND_LIBTOOL_FALSE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([_Noreturn], [/* The _Noreturn keyword of C11. */ +#if ! (defined _Noreturn \\ + || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) +# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \\ + || 0x5110 <= __SUNPRO_C) +# define _Noreturn __attribute__ ((__noreturn__)) +# elif defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn +# endif +#endif +]) +m4trace:configure.ac:42: -1- AH_OUTPUT([isoc99_inline], [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports + the ISO C 99 semantics of \'extern inline\' (unlike the GNU C semantics of + earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. + __APPLE__ && __MACH__ test for Mac OS X. + __APPLE_CC__ tests for the Apple compiler and its version. + __STDC_VERSION__ tests for the C99 mode. */ +#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ +# define __GNUC_STDC_INLINE__ 1 +#endif]) +m4trace:configure.ac:42: -1- AH_OUTPUT([unused_parameter], [/* Define as a marker that can be attached to declarations that might not + be used. This helps to reduce warnings, such as from + GCC -Wunused-parameter. */ +#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _GL_UNUSED __attribute__ ((__unused__)) +#else +# define _GL_UNUSED +#endif +/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name + is a misnomer outside of parameter lists. */ +#define _UNUSED_PARAMETER_ _GL_UNUSED + +/* gcc supports the "unused" attribute on possibly unused labels, and + g++ has since version 4.5. Note to support C++ as well as C, + _GL_UNUSED_LABEL should be used with a trailing ; */ +#if !defined __cplusplus || __GNUC__ > 4 \\ + || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# define _GL_UNUSED_LABEL _GL_UNUSED +#else +# define _GL_UNUSED_LABEL +#endif + +/* The __pure__ attribute was added in gcc 2.96. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE /* empty */ +#endif + +/* The __const__ attribute was added in gcc 2.95. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) +#else +# define _GL_ATTRIBUTE_CONST /* empty */ +#endif +]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([size_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^size_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([size_t], [/* Define as \'unsigned int\' if doesn\'t define. */ +@%:@undef size_t]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ALLOCA_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ALLOCA_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ALLOCA_H], [/* Define to 1 if works. */ +@%:@undef HAVE_ALLOCA_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ALLOCA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ALLOCA$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ALLOCA], [/* Define to 1 if you have \'alloca\', as a function or macro. */ +@%:@undef HAVE_ALLOCA]) +m4trace:configure.ac:42: -1- AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([ALLOCA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ALLOCA$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([C_ALLOCA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^C_ALLOCA$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([C_ALLOCA], [/* Define to 1 if using \'alloca.c\'. */ +@%:@undef C_ALLOCA]) +m4trace:configure.ac:42: -1- AH_OUTPUT([STACK_DIRECTION], [/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([STACK_DIRECTION]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STACK_DIRECTION$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ALLOCA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ALLOCA$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ALLOCA], [/* Define to 1 if you have \'alloca\' after including , a header that + may be supplied by this distribution. */ +@%:@undef HAVE_ALLOCA]) +m4trace:configure.ac:42: -1- AC_SUBST([ALLOCA_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([ALLOCA_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ALLOCA_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ALLOCA_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ALLOCA_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ALLOCA_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ALLOCA_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ALLOCA_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ALLOCA_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ALLOCA_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ALLOCA_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_BTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_BTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_BTOWC$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCTOB]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCTOB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCTOB$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSINIT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSINIT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSINIT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBRTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBRTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBRTOWC$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBRLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBRLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBRLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSRTOWCS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSRTOWCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSRTOWCS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSNRTOWCS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSNRTOWCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSNRTOWCS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCRTOMB]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCRTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCRTOMB$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSRTOMBS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSRTOMBS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSRTOMBS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSNRTOMBS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSNRTOMBS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSNRTOMBS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCWIDTH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCWIDTH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCWIDTH$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WMEMCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WMEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WMEMCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WMEMCMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WMEMCMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WMEMCMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WMEMCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WMEMCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WMEMCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WMEMMOVE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WMEMMOVE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WMEMMOVE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WMEMSET]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WMEMSET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WMEMSET$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSNLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSNLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCPCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCPCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCPCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSNCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSNCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSNCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCPNCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCPNCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCPNCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSCAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSCAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSCAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSNCAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSNCAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSNCAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSCMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSCMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSCMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSNCMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSNCMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSNCMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSCASECMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSCASECMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSNCASECMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSNCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSNCASECMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSCOLL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSCOLL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSCOLL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSXFRM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSXFRM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSXFRM$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSDUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSDUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSRCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSRCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSRCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSCSPN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSCSPN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSCSPN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSSPN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSSPN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSSPN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSPBRK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSPBRK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSPBRK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSSTR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSSTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSSTR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSTOK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSTOK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSTOK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSWIDTH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSWIDTH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSWIDTH$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSFTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSFTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSFTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_BTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_BTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_BTOWC$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MBSINIT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MBSINIT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBSINIT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MBRTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MBRTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBRTOWC$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MBRLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MBRLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBRLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MBSRTOWCS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MBSRTOWCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBSRTOWCS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MBSNRTOWCS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MBSNRTOWCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBSNRTOWCS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCRTOMB]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCRTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCRTOMB$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSRTOMBS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSRTOMBS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSRTOMBS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSNRTOMBS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSNRTOMBS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSNRTOMBS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WMEMCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WMEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WMEMCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WMEMCMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WMEMCMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WMEMCMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WMEMCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WMEMCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WMEMCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WMEMMOVE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WMEMMOVE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WMEMMOVE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WMEMSET]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WMEMSET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WMEMSET$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSNLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSNLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCPCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCPCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCPCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSNCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSNCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSNCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCPNCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCPNCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCPNCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSCAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSCAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSCAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSNCAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSNCAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSNCAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSCMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSCMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSCMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSNCMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSNCMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSNCMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSCASECMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSCASECMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSNCASECMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSNCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSNCASECMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSCOLL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSCOLL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSCOLL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSXFRM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSXFRM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSXFRM$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSDUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSDUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSRCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSRCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSRCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSCSPN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSCSPN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSCSPN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSSPN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSSPN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSSPN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSPBRK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSPBRK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSPBRK$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSSTR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSSTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSSTR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSTOK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSTOK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSTOK$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSWIDTH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSWIDTH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSWIDTH$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSFTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSFTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSFTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_WCTOB]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_WCTOB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_WCTOB$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_WCWIDTH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_WCWIDTH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_WCWIDTH$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MBSTATE_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MBSTATE_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MBSTATE_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_BTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_BTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_BTOWC$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_WCTOB]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_WCTOB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WCTOB$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MBSINIT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MBSINIT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MBSINIT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MBRTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MBRTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MBRTOWC$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MBRLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MBRLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MBRLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MBSRTOWCS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MBSRTOWCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MBSRTOWCS$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MBSNRTOWCS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MBSNRTOWCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MBSNRTOWCS$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_WCRTOMB]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_WCRTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WCRTOMB$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_WCSRTOMBS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_WCSRTOMBS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WCSRTOMBS$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_WCSNRTOMBS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_WCSNRTOMBS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WCSNRTOMBS$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_WCWIDTH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_WCWIDTH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WCWIDTH$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_WCSWIDTH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_WCSWIDTH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WCSWIDTH$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_WCSFTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_WCSFTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WCSFTIME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_BTOWC], [/* Define to 1 if you have the \'btowc\' function. */ +@%:@undef HAVE_BTOWC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LANGINFO_CODESET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LANGINFO_CODESET$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LANGINFO_CODESET], [/* Define if you have and nl_langinfo(CODESET). */ +@%:@undef HAVE_LANGINFO_CODESET]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_BTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_BTOWC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_BTOWC], [/* Define to 1 when the gnulib module btowc should be tested. */ +@%:@undef GNULIB_TEST_BTOWC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE___BUILTIN_EXPECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE___BUILTIN_EXPECT$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE___BUILTIN_EXPECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE___BUILTIN_EXPECT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE___BUILTIN_EXPECT], [/* Define to 1 if the compiler supports __builtin_expect, + and to 2 if does. */ +#undef HAVE___BUILTIN_EXPECT +#ifndef HAVE___BUILTIN_EXPECT +# define __builtin_expect(e, c) (e) +#elif HAVE___BUILTIN_EXPECT == 2 +# include +#endif + ]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SETRLIMIT], [/* Define to 1 if you have the \'setrlimit\' function. */ +@%:@undef HAVE_SETRLIMIT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UCONTEXT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UCONTEXT_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([FAULT_YIELDS_SIGBUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^FAULT_YIELDS_SIGBUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([FAULT_YIELDS_SIGBUS], [/* Define to 1 if an invalid memory address access may yield a SIGBUS. */ +@%:@undef FAULT_YIELDS_SIGBUS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STACK_OVERFLOW_HANDLING]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STACK_OVERFLOW_HANDLING$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STACK_OVERFLOW_HANDLING], [/* Define to 1 if extending the stack slightly past the limit causes a SIGSEGV + which can be handled on an alternate stack established with sigaltstack. */ +@%:@undef HAVE_STACK_OVERFLOW_HANDLING]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([SIGALTSTACK_SS_REVERSED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SIGALTSTACK_SS_REVERSED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([SIGALTSTACK_SS_REVERSED], [/* Define if sigaltstack() interprets the stack_t.ss_sp field incorrectly, as + the highest address of the alternate stack range rather than as the lowest + address. */ +@%:@undef SIGALTSTACK_SS_REVERSED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_XSI_STACK_OVERFLOW_HEURISTIC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_XSI_STACK_OVERFLOW_HEURISTIC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_XSI_STACK_OVERFLOW_HEURISTIC], [/* Define to 1 if extending the stack slightly past the limit causes a + SIGSEGV, and an alternate stack can be established with sigaltstack, and + the signal handler is passed a context that specifies the run time stack. + This behavior is defined by POSIX 1003.1-2001 with the X/Open System + Interface (XSI) option and is a standardized way to implement a SEGV-based + stack overflow detection heuristic. */ +@%:@undef HAVE_XSI_STACK_OVERFLOW_HEURISTIC]) +m4trace:configure.ac:42: -1- AC_REQUIRE_AUX_FILE([config.rpath]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBSIGSEGV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LIBSIGSEGV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LIBSIGSEGV], [/* Define if you have the libsigsegv library. */ +@%:@undef HAVE_LIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LIBSIGSEGV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LIBSIGSEGV$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBSIGSEGV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBSIGSEGV$]) +m4trace:configure.ac:42: -1- AC_SUBST([LTLIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LTLIBSIGSEGV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LTLIBSIGSEGV$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBSIGSEGV_PREFIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBSIGSEGV_PREFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBSIGSEGV_PREFIX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SIGALTSTACK], [/* Define to 1 if you have the \'sigaltstack\' function. */ +@%:@undef HAVE_SIGALTSTACK]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_SIGALTSTACK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SIGALTSTACK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_SIGALTSTACK], [/* Define to 1 if you have the declaration of \'sigaltstack\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_SIGALTSTACK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UCONTEXT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UCONTEXT_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STACK_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STACK_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STACK_T], [/* Define to 1 if the system has the type \'stack_t\'. */ +@%:@undef HAVE_STACK_T]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBCSTACK], [$LIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBCSTACK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBCSTACK$]) +m4trace:configure.ac:42: -1- AC_SUBST([LTLIBCSTACK], [$LTLIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LTLIBCSTACK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LTLIBCSTACK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_READLINKAT], [/* Define to 1 if you have the \'readlinkat\' function. */ +@%:@undef HAVE_READLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST([LIB_CLOCK_GETTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIB_CLOCK_GETTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIB_CLOCK_GETTIME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_CLOCK_GETTIME], [/* Define to 1 if you have the \'clock_gettime\' function. */ +@%:@undef HAVE_CLOCK_GETTIME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CLOCK_GETTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_CLOCK_GETTIME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_CLOCK_SETTIME], [/* Define to 1 if you have the \'clock_settime\' function. */ +@%:@undef HAVE_CLOCK_SETTIME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CLOCK_SETTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_CLOCK_SETTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_CHDIR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_CHDIR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CHDIR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_CHOWN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_CHOWN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CHOWN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_CLOSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_CLOSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CLOSE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_DUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_DUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_DUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_DUP2]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_DUP2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_DUP2$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_DUP3]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_DUP3]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_DUP3$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_ENVIRON]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_ENVIRON]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ENVIRON$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_EUIDACCESS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_EUIDACCESS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_EUIDACCESS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FACCESSAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FACCESSAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FACCESSAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FCHDIR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FCHDIR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FCHDIR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FCHOWNAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FCHOWNAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FCHOWNAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FDATASYNC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FDATASYNC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FDATASYNC$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FSYNC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FSYNC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSYNC$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FTRUNCATE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FTRUNCATE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FTRUNCATE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETCWD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETCWD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETCWD$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETDOMAINNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETDOMAINNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETDOMAINNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETDTABLESIZE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETGROUPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETGROUPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETGROUPS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETHOSTNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETHOSTNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETHOSTNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETLOGIN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETLOGIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETLOGIN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETLOGIN_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETLOGIN_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETLOGIN_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETPAGESIZE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETPAGESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETPAGESIZE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETUSERSHELL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETUSERSHELL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETUSERSHELL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GROUP_MEMBER]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GROUP_MEMBER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GROUP_MEMBER$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_ISATTY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_ISATTY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ISATTY$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_LCHOWN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_LCHOWN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LCHOWN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_LINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_LINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_LINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_LINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_LSEEK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_LSEEK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LSEEK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PIPE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PIPE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PIPE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PIPE2]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PIPE2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PIPE2$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PREAD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PREAD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PREAD$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PWRITE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PWRITE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PWRITE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_READ]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_READ]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_READ$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_READLINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_READLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_READLINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_READLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_READLINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_READLINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RMDIR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RMDIR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RMDIR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SETHOSTNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SETHOSTNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SETHOSTNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SLEEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SYMLINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SYMLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SYMLINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SYMLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SYMLINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SYMLINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_TRUNCATE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_TRUNCATE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TRUNCATE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_TTYNAME_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_TTYNAME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TTYNAME_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_UNISTD_H_NONBLOCKING]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNISTD_H_NONBLOCKING$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_UNISTD_H_SIGPIPE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNISTD_H_SIGPIPE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_UNLINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_UNLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNLINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_UNLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_UNLINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNLINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_USLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_USLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_USLEEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WRITE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WRITE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WRITE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_CHOWN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_CHOWN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_CHOWN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DUP2]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DUP2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DUP2$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DUP3]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DUP3]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DUP3$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_EUIDACCESS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_EUIDACCESS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_EUIDACCESS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FACCESSAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FACCESSAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FACCESSAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FCHDIR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FCHDIR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FCHDIR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FCHOWNAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FCHOWNAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FCHOWNAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FDATASYNC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FDATASYNC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FDATASYNC$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FSYNC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FSYNC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FSYNC$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FTRUNCATE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FTRUNCATE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FTRUNCATE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETDTABLESIZE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GETGROUPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GETGROUPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETGROUPS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GETHOSTNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GETHOSTNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETHOSTNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GETLOGIN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GETLOGIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETLOGIN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GETPAGESIZE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GETPAGESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETPAGESIZE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GROUP_MEMBER]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GROUP_MEMBER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GROUP_MEMBER$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LCHOWN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LCHOWN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LCHOWN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_PIPE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_PIPE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PIPE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_PIPE2]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_PIPE2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PIPE2$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_PREAD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_PREAD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PREAD$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_PWRITE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_PWRITE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PWRITE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_READLINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_READLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_READLINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_READLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_READLINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_READLINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SETHOSTNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SETHOSTNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SETHOSTNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SLEEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYMLINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYMLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYMLINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYMLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYMLINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYMLINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_TRUNCATE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_TRUNCATE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TRUNCATE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_UNLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_UNLINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UNLINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_USLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_USLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_USLEEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_ENVIRON]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_ENVIRON]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_ENVIRON$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_FCHDIR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_FCHDIR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FCHDIR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_FDATASYNC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_FDATASYNC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FDATASYNC$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_GETDOMAINNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_GETDOMAINNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETDOMAINNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_GETLOGIN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_GETLOGIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETLOGIN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_GETLOGIN_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_GETLOGIN_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETLOGIN_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_GETPAGESIZE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_GETPAGESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETPAGESIZE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_GETUSERSHELL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_GETUSERSHELL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETUSERSHELL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_SETHOSTNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_SETHOSTNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SETHOSTNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_TTYNAME_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_TTYNAME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_TTYNAME_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_OS_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_OS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_OS_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_PARAM_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_PARAM_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_PARAM_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_CHOWN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_CHOWN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_CHOWN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_CLOSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_CLOSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_CLOSE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_DUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_DUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_DUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_DUP2]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_DUP2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_DUP2$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FCHOWNAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FCHOWNAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FCHOWNAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FTRUNCATE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FTRUNCATE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FTRUNCATE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GETCWD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GETCWD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETCWD$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GETDOMAINNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GETDOMAINNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETDOMAINNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETDTABLESIZE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GETLOGIN_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GETLOGIN_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETLOGIN_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GETGROUPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GETGROUPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETGROUPS$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GETPAGESIZE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GETPAGESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETPAGESIZE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_ISATTY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_ISATTY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ISATTY$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_LCHOWN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_LCHOWN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LCHOWN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_LINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_LINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_LINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_LINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_LSEEK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_LSEEK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LSEEK$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_PREAD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_PREAD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PREAD$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_PWRITE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_PWRITE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PWRITE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_READ]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_READ]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_READ$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_READLINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_READLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_READLINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_READLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_READLINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_READLINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_RMDIR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_RMDIR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_RMDIR$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_SLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_SLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SLEEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_SYMLINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_SYMLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SYMLINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_SYMLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_SYMLINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SYMLINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_TRUNCATE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_TRUNCATE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TRUNCATE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_TTYNAME_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_TTYNAME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TTYNAME_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_UNLINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_UNLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_UNLINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_UNLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_UNLINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_UNLINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_USLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_USLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_USLEEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_WRITE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_WRITE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WRITE$]) +m4trace:configure.ac:42: -1- AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([UNISTD_H_HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UNISTD_H_HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE__SET_INVALID_PARAMETER_HANDLER], [/* Define to 1 if you have the \'_set_invalid_parameter_handler\' function. */ +@%:@undef HAVE__SET_INVALID_PARAMETER_HANDLER]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MSVC_INVALID_PARAMETER_HANDLER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MSVC_INVALID_PARAMETER_HANDLER$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MSVC_INVALID_PARAMETER_HANDLER], [/* Define to 1 on MSVC platforms that have the "invalid parameter handler" + concept. */ +@%:@undef HAVE_MSVC_INVALID_PARAMETER_HANDLER]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MSVC_INVALID_PARAMETER_HANDLER]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MSVC_INVALID_PARAMETER_HANDLER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MSVC_INVALID_PARAMETER_HANDLER$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_IOCTL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_IOCTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_IOCTL$]) +m4trace:configure.ac:42: -1- AC_SUBST([SYS_IOCTL_H_HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([SYS_IOCTL_H_HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SYS_IOCTL_H_HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_IOCTL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_IOCTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_IOCTL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WINSOCK2_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_CLOSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_CLOSE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_CLOSE], [/* Define to 1 when the gnulib module close should be tested. */ +@%:@undef GNULIB_TEST_CLOSE]) +m4trace:configure.ac:42: -1- AC_SUBST([datarootdir], ['${datadir}']) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([datarootdir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:42: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], + ['${datarootdir}/doc/${PACKAGE_TARNAME}'], + ['${datarootdir}/doc/${PACKAGE}'])]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([docdir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:42: -1- AC_SUBST([htmldir], ['${docdir}']) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([htmldir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:42: -1- AC_SUBST([dvidir], ['${docdir}']) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([dvidir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:42: -1- AC_SUBST([pdfdir], ['${docdir}']) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([pdfdir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:42: -1- AC_SUBST([psdir], ['${docdir}']) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([psdir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:42: -1- AC_SUBST([lispdir], ['${datarootdir}/emacs/site-lisp']) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([lispdir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^lispdir$]) +m4trace:configure.ac:42: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([localedir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:42: -1- AC_SUBST([runstatedir], ['${localstatedir}/run']) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([runstatedir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^runstatedir$]) +m4trace:configure.ac:42: -1- AC_SUBST([pkglibexecdir], ['${libexecdir}/${PACKAGE}']) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([pkglibexecdir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^pkglibexecdir$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_ISBLANK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_ISBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ISBLANK$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_ISBLANK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_ISBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ISBLANK$]) +m4trace:configure.ac:42: -1- AC_SUBST([INCLUDE_NEXT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([INCLUDE_NEXT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INCLUDE_NEXT$]) +m4trace:configure.ac:42: -1- AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([INCLUDE_NEXT_AS_FIRST_DIRECTIVE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INCLUDE_NEXT_AS_FIRST_DIRECTIVE$]) +m4trace:configure.ac:42: -1- AC_SUBST([PRAGMA_SYSTEM_HEADER]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([PRAGMA_SYSTEM_HEADER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRAGMA_SYSTEM_HEADER$]) +m4trace:configure.ac:42: -1- AC_SUBST([PRAGMA_COLUMNS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([PRAGMA_COLUMNS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRAGMA_COLUMNS$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_CTYPE_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_CTYPE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_CTYPE_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_CTYPE_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_CTYPE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_CTYPE_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_ISBLANK], [/* Define to 1 if isblank is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_ISBLANK]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([DOUBLE_SLASH_IS_DISTINCT_ROOT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^DOUBLE_SLASH_IS_DISTINCT_ROOT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([DOUBLE_SLASH_IS_DISTINCT_ROOT], [/* Define to 1 if // is a file system root distinct from /. */ +@%:@undef DOUBLE_SLASH_IS_DISTINCT_ROOT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_DIRNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_DIRNAME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_DIRNAME], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module dirname shall be considered present. */ +@%:@undef GNULIB_DIRNAME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([DOUBLE_SLASH_IS_DISTINCT_ROOT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^DOUBLE_SLASH_IS_DISTINCT_ROOT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([DOUBLE_SLASH_IS_DISTINCT_ROOT], [/* Define to 1 if // is a file system root distinct from /. */ +@%:@undef DOUBLE_SLASH_IS_DISTINCT_ROOT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DUP2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DUP2$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DUP2], [/* Define to 1 if you have the \'dup2\' function. */ +@%:@undef HAVE_DUP2]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SETDTABLESIZE], [/* Define to 1 if you have the \'setdtablesize\' function. */ +@%:@undef HAVE_SETDTABLESIZE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SETDTABLESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SETDTABLESIZE$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_DUP2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_DUP2$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_DUP2], [/* Define to 1 when the gnulib module dup2 should be tested. */ +@%:@undef GNULIB_TEST_DUP2]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ENVIRON_DECL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ENVIRON_DECL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ENVIRON_DECL], [/* Define if you have the declaration of environ. */ +@%:@undef HAVE_ENVIRON_DECL]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_ENVIRON]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_ENVIRON$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_ENVIRON], [/* Define to 1 when the gnulib module environ should be tested. */ +@%:@undef GNULIB_TEST_ENVIRON]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_ERRNO_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_ERRNO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_ERRNO_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_ERRNO_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_ERRNO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_ERRNO_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([ERRNO_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([ERRNO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ERRNO_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ERRNO_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ERRNO_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ERRNO_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ERRNO_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ERRNO_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ERRNO_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ERRNO_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ERRNO_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([EMULTIHOP_HIDDEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([EMULTIHOP_HIDDEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^EMULTIHOP_HIDDEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([EMULTIHOP_VALUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([EMULTIHOP_VALUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^EMULTIHOP_VALUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([ENOLINK_HIDDEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([ENOLINK_HIDDEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ENOLINK_HIDDEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([ENOLINK_VALUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([ENOLINK_VALUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ENOLINK_VALUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([EOVERFLOW_HIDDEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([EOVERFLOW_HIDDEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^EOVERFLOW_HIDDEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([EOVERFLOW_VALUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([EOVERFLOW_VALUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^EOVERFLOW_VALUE$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_STRERROR_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRERROR_R$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_STRERROR_R], [/* Define to 1 if you have the declaration of \'strerror_r\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_STRERROR_R]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRERROR_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRERROR_R$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRERROR_R], [/* Define if you have \'strerror_r\'. */ +@%:@undef HAVE_STRERROR_R]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([STRERROR_R_CHAR_P]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STRERROR_R_CHAR_P$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([STRERROR_R_CHAR_P], [/* Define to 1 if strerror_r returns char *. */ +@%:@undef STRERROR_R_CHAR_P]) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--flag=error:3:c-format]) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--flag=error_at_line:5:c-format]) +m4trace:configure.ac:42: -1- AH_OUTPUT([extern_inline], [/* Please see the Gnulib manual for how to use these macros. + + Suppress extern inline with HP-UX cc, as it appears to be broken; see + . + + Suppress extern inline with Sun C in standards-conformance mode, as it + mishandles inline functions that call each other. E.g., for \'inline void f + (void) { } inline void g (void) { f (); }\', c99 incorrectly complains + \'reference to static identifier "f" in extern inline function\'. + This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. + + Suppress extern inline (with or without __attribute__ ((__gnu_inline__))) + on configurations that mistakenly use \'static inline\' to implement + functions or macros in standard C headers like . For example, + if isdigit is mistakenly implemented via a static inline function, + a program containing an extern inline function that calls isdigit + may not work since the C standard prohibits extern inline functions + from calling static functions. This bug is known to occur on: + + OS X 10.8 and earlier; see: + http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html + + DragonFly; see + http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log + + FreeBSD; see: + http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html + + OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and + for clang but remains for g++; see . + Assume DragonFly and FreeBSD will be similar. */ +#if (((defined __APPLE__ && defined __MACH__) \\ + || defined __DragonFly__ || defined __FreeBSD__) \\ + && (defined __header_inline \\ + ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \\ + && ! defined __clang__) \\ + : ((! defined _DONT_USE_CTYPE_INLINE_ \\ + && (defined __GNUC__ || defined __cplusplus)) \\ + || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \\ + && defined __GNUC__ && ! defined __cplusplus)))) +# define _GL_EXTERN_INLINE_STDHEADER_BUG +#endif +#if ((__GNUC__ \\ + ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \\ + : (199901L <= __STDC_VERSION__ \\ + && !defined __HP_cc \\ + && !defined __PGI \\ + && !(defined __SUNPRO_C && __STDC__))) \\ + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) +# define _GL_INLINE inline +# define _GL_EXTERN_INLINE extern inline +# define _GL_EXTERN_INLINE_IN_USE +#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \\ + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) +# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__ + /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ +# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) +# else +# define _GL_INLINE extern inline +# endif +# define _GL_EXTERN_INLINE extern +# define _GL_EXTERN_INLINE_IN_USE +#else +# define _GL_INLINE static _GL_UNUSED +# define _GL_EXTERN_INLINE static _GL_UNUSED +#endif + +/* In GCC 4.6 (inclusive) to 5.1 (exclusive), + suppress bogus "no previous prototype for \'FOO\'" + and "no previous declaration for \'FOO\'" diagnostics, + when FOO is an inline function in the header; see + and + . */ +#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__ +# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ +# define _GL_INLINE_HEADER_CONST_PRAGMA +# else +# define _GL_INLINE_HEADER_CONST_PRAGMA \\ + _Pragma ("GCC diagnostic ignored \\"-Wsuggest-attribute=const\\"") +# endif +# define _GL_INLINE_HEADER_BEGIN \\ + _Pragma ("GCC diagnostic push") \\ + _Pragma ("GCC diagnostic ignored \\"-Wmissing-prototypes\\"") \\ + _Pragma ("GCC diagnostic ignored \\"-Wmissing-declarations\\"") \\ + _GL_INLINE_HEADER_CONST_PRAGMA +# define _GL_INLINE_HEADER_END \\ + _Pragma ("GCC diagnostic pop") +#else +# define _GL_INLINE_HEADER_BEGIN +# define _GL_INLINE_HEADER_END +#endif]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FCNTL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FCNTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FCNTL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_NONBLOCKING]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_NONBLOCKING]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_NONBLOCKING$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_OPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_OPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_OPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_OPENAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_OPENAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_OPENAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FCNTL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FCNTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FCNTL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_OPENAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_OPENAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_OPENAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FCNTL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FCNTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FCNTL$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_OPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_OPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_OPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_OPENAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_OPENAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_OPENAT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_FCNTL], [/* Define to 1 if you have the \'fcntl\' function. */ +@%:@undef HAVE_FCNTL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_FCNTL], [/* Define to 1 if you have the \'fcntl\' function. */ +@%:@undef HAVE_FCNTL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_FCNTL], [/* Define to 1 if you have the \'fcntl\' function. */ +@%:@undef HAVE_FCNTL]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([FCNTL_DUPFD_BUGGY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^FCNTL_DUPFD_BUGGY$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([FCNTL_DUPFD_BUGGY], [/* Define this to 1 if F_DUPFD behavior does not match POSIX */ +@%:@undef FCNTL_DUPFD_BUGGY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_FCNTL], [/* Define to 1 if you have the \'fcntl\' function. */ +@%:@undef HAVE_FCNTL]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_FCNTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_FCNTL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_FCNTL], [/* Define to 1 when the gnulib module fcntl should be tested. */ +@%:@undef GNULIB_TEST_FCNTL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYMLINK], [/* Define to 1 if you have the \'symlink\' function. */ +@%:@undef HAVE_SYMLINK]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WORKING_O_NOATIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WORKING_O_NOATIME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WORKING_O_NOATIME], [/* Define to 1 if O_NOATIME works. */ +@%:@undef HAVE_WORKING_O_NOATIME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WORKING_O_NOFOLLOW]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WORKING_O_NOFOLLOW$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WORKING_O_NOFOLLOW], [/* Define to 1 if O_NOFOLLOW works. */ +@%:@undef HAVE_WORKING_O_NOFOLLOW]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_FCNTL_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_FCNTL_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_FCNTL_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_FCNTL_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_FCNTL_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_FCNTL_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([pid_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^pid_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([pid_t], [/* Define as a signed integer type capable of holding a process identifier. */ +@%:@undef pid_t]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([mode_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^mode_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([mode_t], [/* Define to \'int\' if does not define. */ +@%:@undef mode_t]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FCNTL], [/* Define to 1 if fcntl is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FCNTL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_OPENAT], [/* Define to 1 if openat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_OPENAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MEMPCPY], [/* Define to 1 if you have the \'mempcpy\' function. */ +@%:@undef HAVE_MEMPCPY]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_FILENAMECAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FILENAMECAT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_FILENAMECAT], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module filenamecat shall be considered present. */ +@%:@undef GNULIB_FILENAMECAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MEMPCPY], [/* Define to 1 if you have the \'mempcpy\' function. */ +@%:@undef HAVE_MEMPCPY]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([FLEXIBLE_ARRAY_MEMBER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^FLEXIBLE_ARRAY_MEMBER$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([FLEXIBLE_ARRAY_MEMBER], [/* Define to nothing if C supports flexible array members, and to 1 if it does + not. That way, with a declaration like \'struct s { int n; double + d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };\', the struct hack can be used with pre-C99 + compilers. When computing the size of such an object, don\'t use \'sizeof + (struct s)\' as it overestimates the size. Use \'offsetof (struct s, d)\' + instead. Don\'t use \'offsetof (struct s, d@<:@0@:>@)\', as this doesn\'t work with + MSVC and with C++ compilers. */ +@%:@undef FLEXIBLE_ARRAY_MEMBER]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([FLEXIBLE_ARRAY_MEMBER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^FLEXIBLE_ARRAY_MEMBER$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_FLOAT_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_FLOAT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_FLOAT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_FLOAT_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_FLOAT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_FLOAT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([FLOAT_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([FLOAT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^FLOAT_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_FLOAT_H], [test -n "$FLOAT_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_FLOAT_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_FLOAT_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_FLOAT_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_FLOAT_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_FLOAT_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_FLOAT_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_FLOAT_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_FLOAT_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_ITOLD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_ITOLD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ITOLD$]) +m4trace:configure.ac:42: -1- AC_SUBST([FNMATCH_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([FNMATCH_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^FNMATCH_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_FNMATCH_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_FNMATCH_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_FNMATCH_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_FNMATCH_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_FNMATCH_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_FNMATCH_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_FNMATCH_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_FNMATCH_H_FALSE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([fnmatch]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^fnmatch$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([fnmatch], [/* Define to a replacement function name for fnmatch(). */ +@%:@undef fnmatch]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MBSTATE_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBSTATE_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSTATE_T], [/* Define to 1 if declares mbstate_t. */ +@%:@undef HAVE_MBSTATE_T]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([mbstate_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^mbstate_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([mbstate_t], [/* Define to a type if does not define. */ +@%:@undef mbstate_t]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_ISBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_ISBLANK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_ISBLANK], [/* Define to 1 if you have the declaration of \'isblank\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_ISBLANK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_BTOWC], [/* Define to 1 if you have the \'btowc\' function. */ +@%:@undef HAVE_BTOWC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISBLANK], [/* Define to 1 if you have the \'isblank\' function. */ +@%:@undef HAVE_ISBLANK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISWCTYPE], [/* Define to 1 if you have the \'iswctype\' function. */ +@%:@undef HAVE_ISWCTYPE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSRTOWCS], [/* Define to 1 if you have the \'mbsrtowcs\' function. */ +@%:@undef HAVE_MBSRTOWCS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MEMPCPY], [/* Define to 1 if you have the \'mempcpy\' function. */ +@%:@undef HAVE_MEMPCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WMEMCHR], [/* Define to 1 if you have the \'wmemchr\' function. */ +@%:@undef HAVE_WMEMCHR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WMEMCPY], [/* Define to 1 if you have the \'wmemcpy\' function. */ +@%:@undef HAVE_WMEMCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WMEMPCPY], [/* Define to 1 if you have the \'wmempcpy\' function. */ +@%:@undef HAVE_WMEMPCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCTYPE_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([fnmatch]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^fnmatch$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([fnmatch], [/* Define to a replacement function name for fnmatch(). */ +@%:@undef fnmatch]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_ISBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_ISBLANK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_ISBLANK], [/* Define to 1 if you have the declaration of \'isblank\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_ISBLANK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_BTOWC], [/* Define to 1 if you have the \'btowc\' function. */ +@%:@undef HAVE_BTOWC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISBLANK], [/* Define to 1 if you have the \'isblank\' function. */ +@%:@undef HAVE_ISBLANK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISWCTYPE], [/* Define to 1 if you have the \'iswctype\' function. */ +@%:@undef HAVE_ISWCTYPE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSRTOWCS], [/* Define to 1 if you have the \'mbsrtowcs\' function. */ +@%:@undef HAVE_MBSRTOWCS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MEMPCPY], [/* Define to 1 if you have the \'mempcpy\' function. */ +@%:@undef HAVE_MEMPCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WMEMCHR], [/* Define to 1 if you have the \'wmemchr\' function. */ +@%:@undef HAVE_WMEMCHR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WMEMCPY], [/* Define to 1 if you have the \'wmemcpy\' function. */ +@%:@undef HAVE_WMEMCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WMEMPCPY], [/* Define to 1 if you have the \'wmempcpy\' function. */ +@%:@undef HAVE_WMEMPCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCTYPE_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_DPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_DPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_DPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FCLOSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FCLOSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FCLOSE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FDOPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FDOPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FDOPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FFLUSH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FFLUSH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FFLUSH$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FGETC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FGETC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FGETC$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FGETS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FGETS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FGETS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FOPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FOPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FOPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FPRINTF_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FPRINTF_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FPRINTF_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FPURGE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FPURGE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FPURGE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FPUTC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FPUTC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FPUTC$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FPUTS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FPUTS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FPUTS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FREAD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FREAD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FREAD$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FREOPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FREOPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FREOPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FSCANF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FSCANF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSCANF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FSEEK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FSEEK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSEEK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FSEEKO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FSEEKO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSEEKO$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FTELL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FTELL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FTELL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FTELLO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FTELLO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FTELLO$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FWRITE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FWRITE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FWRITE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETC$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETCHAR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETCHAR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETCHAR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETDELIM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETDELIM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETDELIM$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETLINE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETLINE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETLINE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_OBSTACK_PRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_OBSTACK_PRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_OBSTACK_PRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_OBSTACK_PRINTF_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_OBSTACK_PRINTF_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PCLOSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PCLOSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PCLOSE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PERROR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PERROR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PERROR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_POPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_POPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_POPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PRINTF_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PRINTF_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PRINTF_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PUTC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PUTC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PUTC$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PUTCHAR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PUTCHAR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PUTCHAR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PUTS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PUTS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PUTS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_REMOVE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_REMOVE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_REMOVE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RENAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RENAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RENAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RENAMEAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RENAMEAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RENAMEAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SCANF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SCANF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SCANF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SNPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SPRINTF_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SPRINTF_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SPRINTF_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STDIO_H_NONBLOCKING]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STDIO_H_NONBLOCKING]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STDIO_H_NONBLOCKING$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STDIO_H_SIGPIPE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STDIO_H_SIGPIPE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STDIO_H_SIGPIPE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_TMPFILE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_TMPFILE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TMPFILE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VASPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VASPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VASPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VFSCANF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VFSCANF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VFSCANF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VSCANF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VSCANF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VSCANF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VDPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VDPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VDPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VFPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VFPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VFPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VFPRINTF_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VFPRINTF_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VFPRINTF_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VPRINTF_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VPRINTF_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VPRINTF_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VSNPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VSNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VSNPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VSPRINTF_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VSPRINTF_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VSPRINTF_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_FPURGE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_FPURGE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FPURGE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_FSEEKO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_FSEEKO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FSEEKO$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_FTELLO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_FTELLO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FTELLO$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_GETDELIM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_GETDELIM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETDELIM$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_GETLINE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_GETLINE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETLINE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_OBSTACK_PRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_OBSTACK_PRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_OBSTACK_PRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_SNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SNPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_VSNPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_VSNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_VSNPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FSEEKO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FSEEKO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FSEEKO$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FTELLO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FTELLO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FTELLO$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_PCLOSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_PCLOSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PCLOSE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_POPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_POPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_POPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_RENAMEAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_RENAMEAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RENAMEAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_VASPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_VASPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_VASPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_VDPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_VDPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_VDPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_DPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_DPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_DPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FCLOSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FCLOSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FCLOSE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FDOPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FDOPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FDOPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FFLUSH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FFLUSH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FFLUSH$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FOPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FOPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FOPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FPURGE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FPURGE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FPURGE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FREOPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FREOPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FREOPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FSEEK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FSEEK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FSEEK$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FSEEKO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FSEEKO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FSEEKO$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FTELL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FTELL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FTELL$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FTELLO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FTELLO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FTELLO$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GETDELIM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GETDELIM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETDELIM$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GETLINE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GETLINE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETLINE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_OBSTACK_PRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_OBSTACK_PRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_OBSTACK_PRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_PERROR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_PERROR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PERROR$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_POPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_POPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_POPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_PRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_PRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_REMOVE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_REMOVE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_REMOVE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_RENAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_RENAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_RENAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_RENAMEAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_RENAMEAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_RENAMEAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_SNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SNPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_SPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_SPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STDIO_READ_FUNCS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STDIO_READ_FUNCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STDIO_READ_FUNCS$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STDIO_WRITE_FUNCS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STDIO_WRITE_FUNCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STDIO_WRITE_FUNCS$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_TMPFILE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_TMPFILE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TMPFILE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_VASPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_VASPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VASPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_VDPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_VDPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VDPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_VFPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_VFPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VFPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_VPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_VPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_VSNPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_VSNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VSNPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_VSPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_VSPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VSPRINTF$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_FREOPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_FREOPEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_FREOPEN], [/* Define to 1 when the gnulib module freopen should be tested. */ +@%:@undef GNULIB_TEST_FREOPEN]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_FREOPEN_SAFER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FREOPEN_SAFER$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_FREOPEN_SAFER], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module freopen-safer shall be considered present. */ +@%:@undef GNULIB_FREOPEN_SAFER]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FCHMODAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FCHMODAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FCHMODAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FSTAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FSTAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSTAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FSTATAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FSTATAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSTATAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FUTIMENS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FUTIMENS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FUTIMENS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_LCHMOD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_LCHMOD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LCHMOD$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_LSTAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_LSTAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LSTAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKDIRAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKDIRAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKDIRAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKFIFO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKFIFO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKFIFO$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKFIFOAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKFIFOAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKFIFOAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKNOD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKNOD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKNOD$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKNODAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKNODAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKNODAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_UTIMENSAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_UTIMENSAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UTIMENSAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_OVERRIDES_STRUCT_STAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_OVERRIDES_STRUCT_STAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_OVERRIDES_STRUCT_STAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FCHMODAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FCHMODAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FCHMODAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FSTATAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FSTATAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FSTATAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FUTIMENS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FUTIMENS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FUTIMENS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LCHMOD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LCHMOD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LCHMOD$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LSTAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LSTAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LSTAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKDIRAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKDIRAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKDIRAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKFIFO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKFIFO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKFIFO$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKFIFOAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKFIFOAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKFIFOAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKNOD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKNOD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKNOD$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKNODAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKNODAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKNODAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_UTIMENSAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_UTIMENSAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UTIMENSAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FSTAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FSTAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FSTAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FSTATAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FSTATAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FSTATAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FUTIMENS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FUTIMENS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FUTIMENS$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_LSTAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_LSTAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LSTAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MKDIR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MKDIR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MKDIR$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MKFIFO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MKFIFO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MKFIFO$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MKNOD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MKNOD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MKNOD$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_UTIMENSAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_UTIMENSAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_UTIMENSAT$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([STAT_MACROS_BROKEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STAT_MACROS_BROKEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([STAT_MACROS_BROKEN], [/* Define to 1 if the \'S_IS*\' macros in do not work properly. */ +@%:@undef STAT_MACROS_BROKEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_STAT_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SYS_STAT_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SYS_STAT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_STAT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([WINDOWS_STAT_TIMESPEC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([WINDOWS_STAT_TIMESPEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_STAT_TIMESPEC$]) +m4trace:configure.ac:42: -1- AC_SUBST([WINDOWS_64_BIT_ST_SIZE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([WINDOWS_64_BIT_ST_SIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_64_BIT_ST_SIZE$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([nlink_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^nlink_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([nlink_t], [/* Define to the type of st_nlink in struct stat, or a supertype. */ +@%:@undef nlink_t]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FCHMODAT], [/* Define to 1 if fchmodat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FCHMODAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FSTAT], [/* Define to 1 if fstat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FSTAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FSTATAT], [/* Define to 1 if fstatat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FSTATAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FUTIMENS], [/* Define to 1 if futimens is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FUTIMENS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_LCHMOD], [/* Define to 1 if lchmod is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_LCHMOD]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_LSTAT], [/* Define to 1 if lstat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_LSTAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKDIRAT], [/* Define to 1 if mkdirat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKDIRAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKFIFO], [/* Define to 1 if mkfifo is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKFIFO]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKFIFOAT], [/* Define to 1 if mkfifoat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKFIFOAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKNOD], [/* Define to 1 if mknod is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKNOD]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKNODAT], [/* Define to 1 if mknodat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKNODAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STAT], [/* Define to 1 if stat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_UTIMENSAT], [/* Define to 1 if utimensat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_UTIMENSAT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_FSTAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_FSTAT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_FSTAT], [/* Define to 1 when the gnulib module fstat should be tested. */ +@%:@undef GNULIB_TEST_FSTAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETDTABLESIZE], [/* Define to 1 if you have the \'getdtablesize\' function. */ +@%:@undef HAVE_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETDTABLESIZE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_GETDTABLESIZE], [/* Define to 1 if you have the declaration of \'getdtablesize\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_GETDTABLESIZE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_GETDTABLESIZE], [/* Define to 1 when the gnulib module getdtablesize should be tested. */ +@%:@undef GNULIB_TEST_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETOPT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_GETOPT_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_GETOPT_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_GETOPT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_GETOPT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_GETOPT_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_GETOPT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_GETOPT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GETOPT_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GETOPT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETOPT_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETOPT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_GETOPT_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETOPT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETOPT_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETOPT_LONG_ONLY], [/* Define to 1 if you have the \'getopt_long_only\' function. */ +@%:@undef HAVE_GETOPT_LONG_ONLY]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETOPT_LONG_ONLY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETOPT_LONG_ONLY$]) +m4trace:configure.ac:42: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [./lib/autoconf/general.m4:2979: AC_RUN_IFELSE is expanded from... +lib/m4sugar/m4sh.m4:690: _AS_IF_ELSE is expanded from... +lib/m4sugar/m4sh.m4:697: AS_IF is expanded from... +./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... +./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... +m4/getopt.m4:48: gl_GETOPT_CHECK_HEADERS is expanded from... +m4/getopt.m4:8: gl_FUNC_GETOPT_POSIX is expanded from... +m4/gnulib-comp.m4:445: gl_INIT is expanded from... +configure.ac:42: the top level]) +m4trace:configure.ac:42: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [./lib/autoconf/general.m4:2979: AC_RUN_IFELSE is expanded from... +lib/m4sugar/m4sh.m4:690: _AS_IF_ELSE is expanded from... +lib/m4sugar/m4sh.m4:697: AS_IF is expanded from... +./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... +./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... +m4/getopt.m4:48: gl_GETOPT_CHECK_HEADERS is expanded from... +m4/getopt.m4:8: gl_FUNC_GETOPT_POSIX is expanded from... +m4/gnulib-comp.m4:445: gl_INIT is expanded from... +configure.ac:42: the top level]) +m4trace:configure.ac:42: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [./lib/autoconf/general.m4:2979: AC_RUN_IFELSE is expanded from... +lib/m4sugar/m4sh.m4:690: _AS_IF_ELSE is expanded from... +lib/m4sugar/m4sh.m4:697: AS_IF is expanded from... +./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... +./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... +m4/getopt.m4:48: gl_GETOPT_CHECK_HEADERS is expanded from... +m4/getopt.m4:8: gl_FUNC_GETOPT_POSIX is expanded from... +m4/gnulib-comp.m4:445: gl_INIT is expanded from... +configure.ac:42: the top level]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_CDEFS_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_CDEFS_H]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_CDEFS_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_CDEFS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_CDEFS_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([__GETOPT_PREFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^__GETOPT_PREFIX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([__GETOPT_PREFIX], [/* Define to rpl_ if the getopt replacement functions and variables should be + used. */ +@%:@undef __GETOPT_PREFIX]) +m4trace:configure.ac:42: -1- AC_SUBST([GETOPT_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GETOPT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GETOPT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([GETOPT_CDEFS_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GETOPT_CDEFS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GETOPT_CDEFS_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GL_UNISTD_H_GETOPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GL_UNISTD_H_GETOPT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETPROGNAME], [/* Define to 1 if you have the \'getprogname\' function. */ +@%:@undef HAVE_GETPROGNAME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETEXECNAME], [/* Define to 1 if you have the \'getexecname\' function. */ +@%:@undef HAVE_GETEXECNAME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_PROGRAM_INVOCATION_NAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_PROGRAM_INVOCATION_NAME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_PROGRAM_INVOCATION_NAME], [/* Define to 1 if you have the declaration of \'program_invocation_name\', and + to 0 if you don\'t. */ +@%:@undef HAVE_DECL_PROGRAM_INVOCATION_NAME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME], [/* Define to 1 if you have the declaration of \'program_invocation_short_name\', + and to 0 if you don\'t. */ +@%:@undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL___ARGV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL___ARGV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL___ARGV], [/* Define to 1 if you have the declaration of \'__argv\', and to 0 if you don\'t. + */ +@%:@undef HAVE_DECL___ARGV]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_VAR___PROGNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_VAR___PROGNAME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_VAR___PROGNAME], [/* Define if you have a global __progname variable */ +@%:@undef HAVE_VAR___PROGNAME]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBINTL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBINTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBINTL$]) +m4trace:configure.ac:42: -1- AC_SUBST([LTLIBINTL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LTLIBINTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LTLIBINTL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETTIMEOFDAY], [/* Define to 1 if you have the \'gettimeofday\' function. */ +@%:@undef HAVE_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_NANOTIME], [/* Define to 1 if you have the \'nanotime\' function. */ +@%:@undef HAVE_NANOTIME]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETTIMEOFDAY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETTIMEOFDAY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRUCT_TIMEVAL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRUCT_TIMEVAL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_TIMEVAL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_TIME_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_TIME_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_TIME_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETTIMEOFDAY$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRUCT_TIMEVAL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRUCT_TIMEVAL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRUCT_TIMEVAL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([restrict], [/* Define to the equivalent of the C99 \'restrict\' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#undef restrict +/* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the + previous line. Perhaps some future version of Sun C++ will work with + restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +# define _Restrict +# define __restrict__ +#endif]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([restrict]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^restrict$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([restrict]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^restrict$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TIME_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TIME_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SYS_TIME_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SYS_TIME_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_TIME_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WINSOCK2_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETTIMEOFDAY], [/* Define to 1 if gettimeofday is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETTIMEOFDAY], [/* Define to 1 if you have the \'gettimeofday\' function. */ +@%:@undef HAVE_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GETTIMEOFDAY_CLOBBERS_LOCALTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GETTIMEOFDAY_CLOBBERS_LOCALTIME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [/* Define if gettimeofday clobbers the localtime buffer. */ +@%:@undef GETTIMEOFDAY_CLOBBERS_LOCALTIME]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_CTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_CTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_LOCALTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_LOCALTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LOCALTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_NANOSLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_NANOSLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_NANOSLEEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRFTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRFTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRFTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRPTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRPTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRPTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_TIMEGM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_TIMEGM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TIMEGM$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_TIME_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_TIME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TIME_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_TIME_RZ]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_TIME_RZ]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TIME_RZ$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_TZSET]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_TZSET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TZSET$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_LOCALTIME_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_LOCALTIME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_LOCALTIME_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_NANOSLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_NANOSLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_NANOSLEEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRPTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRPTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRPTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_TIMEGM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_TIMEGM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TIMEGM$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_TZSET]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_TZSET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TZSET$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_TIMEZONE_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_TIMEZONE_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TIMEZONE_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_CTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_CTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_CTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_LOCALTIME_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_LOCALTIME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LOCALTIME_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MKTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MKTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MKTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_NANOSLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_NANOSLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_NANOSLEEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRFTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRFTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRFTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_TIMEGM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_TIMEGM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TIMEGM$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_TZSET]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_TZSET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TZSET$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETTIMEOFDAY$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GMTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GMTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GMTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_LOCALTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_LOCALTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LOCALTIME$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GETTIMEOFDAY_TIMEZONE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GETTIMEOFDAY_TIMEZONE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GETTIMEOFDAY_TIMEZONE], [/* Define this to \'void\' or \'struct timezone\' to match the system\'s + declaration of the second argument to gettimeofday. */ +@%:@undef GETTIMEOFDAY_TIMEZONE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_GETTIMEOFDAY$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_GETTIMEOFDAY], [/* Define to 1 when the gnulib module gettimeofday should be tested. */ +@%:@undef GNULIB_TEST_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GNU_MAKE], [${MAKE-make} --version /cannot/make/this >/dev/null 2>&1]) +m4trace:configure.ac:42: -1- AC_SUBST([GNU_MAKE_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNU_MAKE_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNU_MAKE_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNU_MAKE_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNU_MAKE_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNU_MAKE_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GNU_MAKE_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GNU_MAKE_FALSE]) +m4trace:configure.ac:42: -1- AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], [GNUmakefile=$GNUmakefile]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ICONV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ICONV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ICONV], [/* Define if you have the iconv() function and it works. */ +@%:@undef HAVE_ICONV]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBICONV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBICONV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBICONV$]) +m4trace:configure.ac:42: -1- AC_SUBST([LTLIBICONV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LTLIBICONV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LTLIBICONV$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([ICONV_CONST]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ICONV_CONST$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([ICONV_CONST], [/* Define as const if the declaration of iconv() needs const. */ +@%:@undef ICONV_CONST]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_ICONV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_ICONV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ICONV$]) +m4trace:configure.ac:42: -1- AC_SUBST([ICONV_CONST]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([ICONV_CONST]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ICONV_CONST$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_ICONV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_ICONV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ICONV$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_ICONV_OPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_ICONV_OPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ICONV_OPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_ICONV_UTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_ICONV_UTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ICONV_UTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([ICONV_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([ICONV_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ICONV_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ICONV_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ICONV_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ICONV_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_ICONV_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_ICONV_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_ICONV_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_ICONV_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_ICONV_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_ICONV_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_ICONV_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ICONV_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ICONV_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([ICONV_FLAVOR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ICONV_FLAVOR$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([ICONV_FLAVOR], [/* Define to a symbolic name denoting the flavor of iconv_open() + implementation. */ +@%:@undef ICONV_FLAVOR]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ICONV_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ICONV_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([inline], [/* Define to \'__inline__\' or \'__inline\' if that\'s what the C compiler + calls it, or to nothing if \'inline\' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INLINE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_INLINE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_INLINE], [/* Define to 1 if the compiler supports one of the keywords \'inline\', + \'__inline__\', \'__inline\' and effectively inlines functions marked as such. + */ +@%:@undef HAVE_INLINE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([off_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^off_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([off_t], [/* Define to \'long int\' if does not define. */ +@%:@undef off_t]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LIMITS_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_LIMITS_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_LIMITS_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_LIMITS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_LIMITS_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_LIMITS_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_LIMITS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_LIMITS_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIMITS_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIMITS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIMITS_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_LIMITS_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_LIMITS_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_LIMITS_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_LIMITS_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_LIMITS_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_LIMITS_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_LIMITS_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_LIMITS_H_FALSE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINT_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINT_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WINT_T], [/* Define if you have the \'wint_t\' type. */ +@%:@undef HAVE_WINT_T]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_OVERRIDES_WINT_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_OVERRIDES_WINT_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_OVERRIDES_WINT_T$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UNSIGNED_LONG_LONG_INT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UNSIGNED_LONG_LONG_INT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNSIGNED_LONG_LONG_INT], [/* Define to 1 if the system has the type \'unsigned long long int\'. */ +@%:@undef HAVE_UNSIGNED_LONG_LONG_INT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LONG_LONG_INT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LONG_LONG_INT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LONG_LONG_INT], [/* Define to 1 if the system has the type \'long long int\'. */ +@%:@undef HAVE_LONG_LONG_INT]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LONG_LONG_INT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LONG_LONG_INT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LONG_LONG_INT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_UNSIGNED_LONG_LONG_INT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UNSIGNED_LONG_LONG_INT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCHAR_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WCHAR_H]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCHAR_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCHAR_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCHAR_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_INTTYPES_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_INTTYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_INTTYPES_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_TYPES_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_TYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_TYPES_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDINT_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_STDINT_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_STDINT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDINT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_STDINT_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_STDINT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STDINT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STDINT_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STDINT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STDINT_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([__STDC_CONSTANT_MACROS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^__STDC_CONSTANT_MACROS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([__STDC_CONSTANT_MACROS], [/* Define to 1 if the system predates C++11. */ +@%:@undef __STDC_CONSTANT_MACROS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([__STDC_LIMIT_MACROS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^__STDC_LIMIT_MACROS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([__STDC_LIMIT_MACROS], [/* Define to 1 if the system predates C++11. */ +@%:@undef __STDC_LIMIT_MACROS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_INTTYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_INTTYPES_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_INTTYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_INTTYPES_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_BITYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_BITYPES_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_BITYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_BITYPES_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([APPLE_UNIVERSAL_BUILD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([APPLE_UNIVERSAL_BUILD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^APPLE_UNIVERSAL_BUILD$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([BITSIZEOF_PTRDIFF_T], [/* Define to the number of bits in type \'ptrdiff_t\'. */ +@%:@undef BITSIZEOF_PTRDIFF_T]) +m4trace:configure.ac:42: -1- AH_OUTPUT([BITSIZEOF_SIZE_T], [/* Define to the number of bits in type \'size_t\'. */ +@%:@undef BITSIZEOF_SIZE_T]) +m4trace:configure.ac:42: -1- AC_SUBST([BITSIZEOF_PTRDIFF_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([BITSIZEOF_PTRDIFF_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^BITSIZEOF_PTRDIFF_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([BITSIZEOF_SIZE_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([BITSIZEOF_SIZE_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^BITSIZEOF_SIZE_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([BITSIZEOF_SIG_ATOMIC_T], [/* Define to the number of bits in type \'sig_atomic_t\'. */ +@%:@undef BITSIZEOF_SIG_ATOMIC_T]) +m4trace:configure.ac:42: -1- AH_OUTPUT([BITSIZEOF_WCHAR_T], [/* Define to the number of bits in type \'wchar_t\'. */ +@%:@undef BITSIZEOF_WCHAR_T]) +m4trace:configure.ac:42: -1- AH_OUTPUT([BITSIZEOF_WINT_T], [/* Define to the number of bits in type \'wint_t\'. */ +@%:@undef BITSIZEOF_WINT_T]) +m4trace:configure.ac:42: -1- AC_SUBST([BITSIZEOF_SIG_ATOMIC_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([BITSIZEOF_SIG_ATOMIC_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^BITSIZEOF_SIG_ATOMIC_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([BITSIZEOF_WCHAR_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([BITSIZEOF_WCHAR_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^BITSIZEOF_WCHAR_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([BITSIZEOF_WINT_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([BITSIZEOF_WINT_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^BITSIZEOF_WINT_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SIGNED_SIG_ATOMIC_T], [/* Define to 1 if \'sig_atomic_t\' is a signed integer type. */ +@%:@undef HAVE_SIGNED_SIG_ATOMIC_T]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SIGNED_WCHAR_T], [/* Define to 1 if \'wchar_t\' is a signed integer type. */ +@%:@undef HAVE_SIGNED_WCHAR_T]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SIGNED_WINT_T], [/* Define to 1 if \'wint_t\' is a signed integer type. */ +@%:@undef HAVE_SIGNED_WINT_T]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SIGNED_SIG_ATOMIC_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SIGNED_SIG_ATOMIC_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGNED_SIG_ATOMIC_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SIGNED_WCHAR_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SIGNED_WCHAR_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGNED_WCHAR_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SIGNED_WINT_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SIGNED_WINT_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGNED_WINT_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([PTRDIFF_T_SUFFIX], [/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + \'ptrdiff_t\'. */ +@%:@undef PTRDIFF_T_SUFFIX]) +m4trace:configure.ac:42: -1- AH_OUTPUT([SIZE_T_SUFFIX], [/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + \'size_t\'. */ +@%:@undef SIZE_T_SUFFIX]) +m4trace:configure.ac:42: -1- AC_SUBST([PTRDIFF_T_SUFFIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([PTRDIFF_T_SUFFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PTRDIFF_T_SUFFIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([SIZE_T_SUFFIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([SIZE_T_SUFFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SIZE_T_SUFFIX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([SIG_ATOMIC_T_SUFFIX], [/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + \'sig_atomic_t\'. */ +@%:@undef SIG_ATOMIC_T_SUFFIX]) +m4trace:configure.ac:42: -1- AH_OUTPUT([WCHAR_T_SUFFIX], [/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + \'wchar_t\'. */ +@%:@undef WCHAR_T_SUFFIX]) +m4trace:configure.ac:42: -1- AH_OUTPUT([WINT_T_SUFFIX], [/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + \'wint_t\'. */ +@%:@undef WINT_T_SUFFIX]) +m4trace:configure.ac:42: -1- AC_SUBST([SIG_ATOMIC_T_SUFFIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([SIG_ATOMIC_T_SUFFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SIG_ATOMIC_T_SUFFIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([WCHAR_T_SUFFIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([WCHAR_T_SUFFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WCHAR_T_SUFFIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([WINT_T_SUFFIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([WINT_T_SUFFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINT_T_SUFFIX$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_LIMITS_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_LIMITS_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_LIMITS_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_LIMITS_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_LIMITS_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_LIMITS_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_LIMITS_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_LIMITS_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_C99_STDINT_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_C99_STDINT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_C99_STDINT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_BITYPES_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_BITYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_BITYPES_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_INTTYPES_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_INTTYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_INTTYPES_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([STDINT_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([STDINT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STDINT_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDINT_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDINT_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDINT_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDINT_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDINT_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDINT_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDINT_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDINT_H_FALSE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_INTTYPES_H]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_IMAXABS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_IMAXABS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_IMAXABS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_IMAXDIV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_IMAXDIV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_IMAXDIV$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRTOIMAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRTOIMAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRTOIMAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRTOUMAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRTOUMAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRTOUMAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_IMAXABS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_IMAXABS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_IMAXABS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_IMAXDIV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_IMAXDIV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_IMAXDIV$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_STRTOIMAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_STRTOIMAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRTOIMAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_STRTOUMAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_STRTOUMAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRTOUMAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRTOIMAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRTOIMAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRTOIMAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRTOUMAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRTOUMAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRTOUMAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([INT32_MAX_LT_INTMAX_MAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([INT32_MAX_LT_INTMAX_MAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INT32_MAX_LT_INTMAX_MAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([INT64_MAX_EQ_LONG_MAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([INT64_MAX_EQ_LONG_MAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INT64_MAX_EQ_LONG_MAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([PRI_MACROS_BROKEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([PRI_MACROS_BROKEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRI_MACROS_BROKEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([PRIPTR_PREFIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([PRIPTR_PREFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRIPTR_PREFIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([UINT32_MAX_LT_UINTMAX_MAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UINT32_MAX_LT_UINTMAX_MAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([UINT64_MAX_EQ_ULONG_MAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([UINT64_MAX_EQ_ULONG_MAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UINT64_MAX_EQ_ULONG_MAX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_INTTYPES_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_INTTYPES_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_INTTYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_INTTYPES_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_IMAXABS], [/* Define to 1 if imaxabs is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_IMAXABS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_IMAXDIV], [/* Define to 1 if imaxdiv is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_IMAXDIV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRTOIMAX], [/* Define to 1 if strtoimax is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRTOIMAX]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRTOUMAX], [/* Define to 1 if strtoumax is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRTOUMAX]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_INTTYPES_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INTTYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_INTTYPES_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([PRI_MACROS_BROKEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRI_MACROS_BROKEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([PRI_MACROS_BROKEN], [/* Define if exists and defines unusable PRI* macros. */ +@%:@undef PRI_MACROS_BROKEN]) +m4trace:configure.ac:42: -1- AC_SUBST([PRI_MACROS_BROKEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([PRI_MACROS_BROKEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRI_MACROS_BROKEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([PRIPTR_PREFIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([PRIPTR_PREFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRIPTR_PREFIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([INT32_MAX_LT_INTMAX_MAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([INT32_MAX_LT_INTMAX_MAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INT32_MAX_LT_INTMAX_MAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([INT64_MAX_EQ_LONG_MAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([INT64_MAX_EQ_LONG_MAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INT64_MAX_EQ_LONG_MAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([UINT32_MAX_LT_UINTMAX_MAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UINT32_MAX_LT_UINTMAX_MAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([UINT64_MAX_EQ_ULONG_MAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([UINT64_MAX_EQ_ULONG_MAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UINT64_MAX_EQ_ULONG_MAX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISBLANK], [/* Define to 1 if you have the \'isblank\' function. */ +@%:@undef HAVE_ISBLANK]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_ISWBLANK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_ISWBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ISWBLANK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCTYPE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCTYPE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCTYPE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_ISWCTYPE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_ISWCTYPE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ISWCTYPE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCTRANS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCTRANS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCTRANS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_TOWCTRANS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_TOWCTRANS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TOWCTRANS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_ISWBLANK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_ISWBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ISWBLANK$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCTYPE_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCTYPE_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCTYPE_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCTRANS_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCTRANS_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCTRANS_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_ISWBLANK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_ISWBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ISWBLANK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISWCNTRL], [/* Define to 1 if you have the \'iswcntrl\' function. */ +@%:@undef HAVE_ISWCNTRL]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_ISWCNTRL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_ISWCNTRL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ISWCNTRL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINT_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINT_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINT_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_CRTDEFS_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_CRTDEFS_H]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_CRTDEFS_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_CRTDEFS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_CRTDEFS_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCTYPE_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_WCTYPE_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_WCTYPE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_WCTYPE_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCTYPE_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_ISWCNTRL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_ISWCNTRL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ISWCNTRL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TOWLOWER], [/* Define to 1 if you have the \'towlower\' function. */ +@%:@undef HAVE_TOWLOWER]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TOWLOWER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TOWLOWER$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_TOWLOWER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_TOWLOWER$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_TOWLOWER], [/* Define to 1 if you have the declaration of \'towlower\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_TOWLOWER]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_TOWLOWER]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_TOWLOWER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TOWLOWER$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCTYPE], [/* Define to 1 if wctype is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCTYPE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_ISWCTYPE], [/* Define to 1 if iswctype is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_ISWCTYPE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCTRANS], [/* Define to 1 if wctrans is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCTRANS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_TOWCTRANS], [/* Define to 1 if towctrans is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_TOWCTRANS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISWBLANK], [/* Define to 1 if you have the \'iswblank\' function. */ +@%:@undef HAVE_ISWBLANK]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_ISWBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_ISWBLANK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_ISWBLANK], [/* Define to 1 if you have the declaration of \'iswblank\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_ISWBLANK]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_ISWBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_ISWBLANK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_ISWBLANK], [/* Define to 1 when the gnulib module iswblank should be tested. */ +@%:@undef GNULIB_TEST_ISWBLANK]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_NL_LANGINFO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_NL_LANGINFO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_NL_LANGINFO$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_NL_LANGINFO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_NL_LANGINFO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_NL_LANGINFO$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_NL_LANGINFO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_NL_LANGINFO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_NL_LANGINFO$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LANGINFO_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_LANGINFO_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_LANGINFO_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_LANGINFO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_LANGINFO_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LANGINFO_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_LANGINFO_H]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LANGINFO_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LANGINFO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LANGINFO_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LANGINFO_CODESET]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LANGINFO_CODESET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LANGINFO_CODESET$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LANGINFO_T_FMT_AMPM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LANGINFO_T_FMT_AMPM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LANGINFO_T_FMT_AMPM$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LANGINFO_ERA]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LANGINFO_ERA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LANGINFO_ERA$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LANGINFO_YESEXPR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LANGINFO_YESEXPR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LANGINFO_YESEXPR$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_NL_LANGINFO], [/* Define to 1 if nl_langinfo is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_NL_LANGINFO]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBSIGSEGV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LIBSIGSEGV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LIBSIGSEGV], [/* Define if you have the libsigsegv library. */ +@%:@undef HAVE_LIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LIBSIGSEGV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LIBSIGSEGV$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBSIGSEGV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBSIGSEGV$]) +m4trace:configure.ac:42: -1- AC_SUBST([LTLIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LTLIBSIGSEGV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LTLIBSIGSEGV$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBSIGSEGV_PREFIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBSIGSEGV_PREFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBSIGSEGV_PREFIX$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_GETC_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETC_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_GETC_UNLOCKED], [/* Define to 1 if you have the declaration of \'getc_unlocked\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_GETC_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_SUBST([GLIBC21]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GLIBC21]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GLIBC21$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALCHARSET_TESTS_ENVIRONMENT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALCHARSET_TESTS_ENVIRONMENT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_LOCALECONV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_LOCALECONV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LOCALECONV$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SETLOCALE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SETLOCALE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SETLOCALE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_DUPLOCALE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_DUPLOCALE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_DUPLOCALE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DUPLOCALE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DUPLOCALE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DUPLOCALE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_LOCALECONV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_LOCALECONV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LOCALECONV$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_SETLOCALE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_SETLOCALE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SETLOCALE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_DUPLOCALE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_DUPLOCALE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_DUPLOCALE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRUCT_LCONV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRUCT_LCONV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRUCT_LCONV$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_NULL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_NULL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_NULL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MAX_ALIGN_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MAX_ALIGN_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MAX_ALIGN_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCHAR_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCHAR_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCHAR_T$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WCHAR_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCHAR_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCHAR_T], [/* Define if you have the \'wchar_t\' type. */ +@%:@undef HAVE_WCHAR_T]) +m4trace:configure.ac:42: -1- AC_SUBST([STDDEF_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([STDDEF_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STDDEF_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDDEF_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDDEF_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDDEF_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDDEF_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDDEF_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDDEF_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDDEF_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDDEF_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_STDDEF_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_STDDEF_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDDEF_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_STDDEF_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_STDDEF_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STDDEF_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([_LCONV_C99]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^_LCONV_C99$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([_LCONV_C99], [/* Define to 1 on Solaris. */ +@%:@undef _LCONV_C99]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_XLOCALE_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_XLOCALE_H]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_XLOCALE_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_XLOCALE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_XLOCALE_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_LOCALE_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_LOCALE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_LOCALE_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_LOCALE_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_LOCALE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_LOCALE_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SETLOCALE], [/* Define to 1 if setlocale is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SETLOCALE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_DUPLOCALE], [/* Define to 1 if duplocale is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_DUPLOCALE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_LCONV_DECIMAL_POINT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_LCONV_DECIMAL_POINT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_LCONV_DECIMAL_POINT], [/* Define to 1 if \'decimal_point\' is a member of \'struct lconv\'. */ +@%:@undef HAVE_STRUCT_LCONV_DECIMAL_POINT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_LOCALECONV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_LOCALECONV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_LOCALECONV], [/* Define to 1 when the gnulib module localeconv should be tested. */ +@%:@undef GNULIB_TEST_LOCALECONV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LSTAT], [/* Define to 1 if you have the \'lstat\' function. */ +@%:@undef HAVE_LSTAT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([LSTAT_FOLLOWS_SLASHED_SYMLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LSTAT_FOLLOWS_SLASHED_SYMLINK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([LSTAT_FOLLOWS_SLASHED_SYMLINK], [/* Define to 1 if \'lstat\' dereferences a symlink specified with a trailing + slash. */ +@%:@undef LSTAT_FOLLOWS_SLASHED_SYMLINK]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_LSTAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_LSTAT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_LSTAT], [/* Define to 1 when the gnulib module lstat should be tested. */ +@%:@undef GNULIB_TEST_LSTAT]) +m4trace:configure.ac:42: -1- AC_SUBST([SED]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([SED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SED$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB__EXIT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB__EXIT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB__EXIT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_ATOLL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_ATOLL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ATOLL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_CALLOC_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_CALLOC_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CALLOC_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_CANONICALIZE_FILE_NAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CANONICALIZE_FILE_NAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETLOADAVG]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETLOADAVG]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETLOADAVG$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETSUBOPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETSUBOPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETSUBOPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GRANTPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GRANTPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GRANTPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MALLOC_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MALLOC_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MALLOC_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBTOWC$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKDTEMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKDTEMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKDTEMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKOSTEMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKOSTEMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKOSTEMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKOSTEMPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKOSTEMPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKOSTEMPS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKSTEMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKSTEMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKSTEMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKSTEMPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKSTEMPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKSTEMPS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_POSIX_OPENPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_POSIX_OPENPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_POSIX_OPENPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PTSNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PTSNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PTSNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PTSNAME_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PTSNAME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PTSNAME_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PUTENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PUTENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PUTENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_QSORT_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_QSORT_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_QSORT_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RANDOM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RANDOM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RANDOM$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RANDOM_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RANDOM_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RANDOM_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_REALLOC_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_REALLOC_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_REALLOC_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_REALPATH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_REALPATH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_REALPATH$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RPMATCH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RPMATCH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RPMATCH$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SECURE_GETENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SECURE_GETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SECURE_GETENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SETENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SETENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRTOD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRTOD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRTOD$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRTOLL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRTOLL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRTOLL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRTOULL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRTOULL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRTOULL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SYSTEM_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SYSTEM_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SYSTEM_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_UNLOCKPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_UNLOCKPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNLOCKPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_UNSETENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_UNSETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNSETENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCTOMB]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCTOMB$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE__EXIT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE__EXIT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE__EXIT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_ATOLL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_ATOLL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ATOLL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_CANONICALIZE_FILE_NAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_CANONICALIZE_FILE_NAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_CANONICALIZE_FILE_NAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_GETLOADAVG]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_GETLOADAVG]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETLOADAVG$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GETSUBOPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GETSUBOPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETSUBOPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GRANTPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GRANTPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GRANTPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKDTEMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKDTEMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKDTEMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKOSTEMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKOSTEMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKOSTEMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKOSTEMPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKOSTEMPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKOSTEMPS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKSTEMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKSTEMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKSTEMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKSTEMPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKSTEMPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKSTEMPS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_POSIX_OPENPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_POSIX_OPENPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_POSIX_OPENPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_PTSNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_PTSNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PTSNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_PTSNAME_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_PTSNAME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PTSNAME_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_QSORT_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_QSORT_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_QSORT_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_RANDOM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_RANDOM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RANDOM$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_RANDOM_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_RANDOM_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RANDOM_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_RANDOM_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_RANDOM_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RANDOM_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_REALPATH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_REALPATH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_REALPATH$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_RPMATCH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_RPMATCH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RPMATCH$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SECURE_GETENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SECURE_GETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SECURE_GETENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SETENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SETENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_SETENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_SETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SETENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRTOD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRTOD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRTOD$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRTOLL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRTOLL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRTOLL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRTOULL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRTOULL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRTOULL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRUCT_RANDOM_DATA]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRUCT_RANDOM_DATA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_RANDOM_DATA$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_LOADAVG_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_LOADAVG_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_LOADAVG_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_UNLOCKPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_UNLOCKPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UNLOCKPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_UNSETENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_UNSETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_UNSETENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_CALLOC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_CALLOC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_CALLOC$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_CANONICALIZE_FILE_NAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_CANONICALIZE_FILE_NAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MALLOC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MALLOC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MALLOC$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MBTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MBTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MBTOWC$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MKSTEMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MKSTEMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MKSTEMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_PTSNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_PTSNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PTSNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_PTSNAME_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_PTSNAME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PTSNAME_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_PUTENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_PUTENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PUTENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_QSORT_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_QSORT_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_QSORT_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_RANDOM_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_RANDOM_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_RANDOM_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_REALLOC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_REALLOC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_REALLOC$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_REALPATH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_REALPATH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_REALPATH$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_SETENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_SETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SETENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRTOD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRTOD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRTOD$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_UNSETENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_UNSETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_UNSETENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_WCTOMB]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_WCTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WCTOMB$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MALLOC_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MALLOC_POSIX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MALLOC_POSIX], [/* Define if the \'malloc\' function is POSIX compliant. */ +@%:@undef HAVE_MALLOC_POSIX]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MALLOC_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MALLOC_POSIX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MALLOC_POSIX], [/* Define to 1 when the gnulib module malloc-posix should be tested. */ +@%:@undef GNULIB_TEST_MALLOC_POSIX]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MALLOC_0_IS_NONNULL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MALLOC_0_IS_NONNULL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MALLOC_0_IS_NONNULL], [/* If malloc(0) is != NULL, define this to 1. Otherwise define this to 0. */ +@%:@undef MALLOC_0_IS_NONNULL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSINIT], [/* Define to 1 if you have the \'mbsinit\' function. */ +@%:@undef HAVE_MBSINIT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBRTOWC], [/* Define to 1 if you have the \'mbrtowc\' function. */ +@%:@undef HAVE_MBRTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_JA]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_JA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_JA$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_ZH_CN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBRTOWC], [/* Define to 1 if you have the \'mbrtowc\' function. */ +@%:@undef HAVE_MBRTOWC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_MBRTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_MBRTOWC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_MBRTOWC], [/* Define to 1 if you have the declaration of \'mbrtowc\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_MBRTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MBRTOWC_NULL_ARG1_BUG]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MBRTOWC_NULL_ARG1_BUG$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MBRTOWC_NULL_ARG1_BUG], [/* Define if the mbrtowc function has the NULL pwc argument bug. */ +@%:@undef MBRTOWC_NULL_ARG1_BUG]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MBRTOWC_NULL_ARG2_BUG]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MBRTOWC_NULL_ARG2_BUG$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MBRTOWC_NULL_ARG2_BUG], [/* Define if the mbrtowc function has the NULL string argument bug. */ +@%:@undef MBRTOWC_NULL_ARG2_BUG]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MBRTOWC_RETVAL_BUG]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MBRTOWC_RETVAL_BUG$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MBRTOWC_RETVAL_BUG], [/* Define if the mbrtowc function returns a wrong return value. */ +@%:@undef MBRTOWC_RETVAL_BUG]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MBRTOWC_NUL_RETVAL_BUG]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MBRTOWC_NUL_RETVAL_BUG$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MBRTOWC_NUL_RETVAL_BUG], [/* Define if the mbrtowc function does not return 0 for a NUL character. */ +@%:@undef MBRTOWC_NUL_RETVAL_BUG]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MBRTOWC_EMPTY_INPUT_BUG]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MBRTOWC_EMPTY_INPUT_BUG$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MBRTOWC_EMPTY_INPUT_BUG], [/* Define if the mbrtowc function does not return (size_t) -2 for empty input. + */ +@%:@undef MBRTOWC_EMPTY_INPUT_BUG]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([C_LOCALE_MAYBE_EILSEQ]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^C_LOCALE_MAYBE_EILSEQ$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([C_LOCALE_MAYBE_EILSEQ], [/* Define to 1 if the C locale may have encoding errors. */ +@%:@undef C_LOCALE_MAYBE_EILSEQ]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MBRTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBRTOWC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MBRTOWC], [/* Define to 1 when the gnulib module mbrtowc should be tested. */ +@%:@undef GNULIB_TEST_MBRTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FFSL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FFSL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FFSL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FFSLL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FFSLL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FFSLL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MEMCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MEMCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MEMMEM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MEMMEM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MEMMEM$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MEMPCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MEMPCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MEMPCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MEMRCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MEMRCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MEMRCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RAWMEMCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RAWMEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RAWMEMCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STPCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STPCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STPCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STPNCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STPNCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STPNCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRCHRNUL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRCHRNUL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRCHRNUL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRDUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRDUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRNCAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRNCAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRNCAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRNDUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRNDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRNDUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRNLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRNLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRPBRK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRPBRK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRPBRK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRSEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRSEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRSEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRSTR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRSTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRSTR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRCASESTR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRCASESTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRCASESTR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRTOK_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRTOK_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRTOK_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSNLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSNLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSRCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSRCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSRCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSSTR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSSTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSSTR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSCASECMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSCASECMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSNCASECMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSNCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSNCASECMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSPCASECMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSPCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSPCASECMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSCASESTR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSCASESTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSCASESTR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSCSPN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSCSPN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSCSPN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSPBRK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSPBRK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSPBRK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSSPN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSSPN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSSPN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSSEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSSEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSSEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSTOK_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSTOK_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSTOK_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRERROR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRERROR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRERROR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRERROR_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRERROR_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRERROR_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRSIGNAL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRSIGNAL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRSIGNAL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRVERSCMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRVERSCMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRVERSCMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MBSLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MBSLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBSLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FFSL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FFSL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FFSL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FFSLL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FFSLL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FFSLL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MEMCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MEMCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_MEMMEM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_MEMMEM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_MEMMEM$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MEMPCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MEMPCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MEMPCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_MEMRCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_MEMRCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_MEMRCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_RAWMEMCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_RAWMEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RAWMEMCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STPCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STPCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STPCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STPNCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STPNCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STPNCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRCHRNUL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRCHRNUL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRCHRNUL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_STRDUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_STRDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRDUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_STRNDUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_STRNDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRNDUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_STRNLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_STRNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRNLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRPBRK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRPBRK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRPBRK$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRSEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRSEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRSEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRCASESTR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRCASESTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRCASESTR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_STRTOK_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_STRTOK_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRTOK_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_STRERROR_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_STRERROR_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRERROR_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_STRSIGNAL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_STRSIGNAL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRSIGNAL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRVERSCMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRVERSCMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRVERSCMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MEMCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MEMCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MEMMEM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MEMMEM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MEMMEM$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STPNCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STPNCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STPNCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRDUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRDUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRSTR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRSTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRSTR$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRCASESTR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRCASESTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRCASESTR$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRCHRNUL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRCHRNUL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRCHRNUL$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRERROR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRERROR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRERROR$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRERROR_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRERROR_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRERROR_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRNCAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRNCAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRNCAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRNDUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRNDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRNDUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRNLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRNLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRSIGNAL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRSIGNAL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRSIGNAL$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRTOK_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRTOK_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRTOK_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([UNDEFINE_STRTOK_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([UNDEFINE_STRTOK_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UNDEFINE_STRTOK_R$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MBSCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBSCASECMP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MBSCASECMP], [/* Define to 1 when the gnulib module mbscasecmp should be tested. */ +@%:@undef GNULIB_TEST_MBSCASECMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSINIT], [/* Define to 1 if you have the \'mbsinit\' function. */ +@%:@undef HAVE_MBSINIT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBRTOWC], [/* Define to 1 if you have the \'mbrtowc\' function. */ +@%:@undef HAVE_MBRTOWC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSINIT], [/* Define to 1 if you have the \'mbsinit\' function. */ +@%:@undef HAVE_MBSINIT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_MBSINIT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_MBSINIT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_MBSINIT], [/* Define to 1 if you have the declaration of \'mbsinit\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_MBSINIT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MBSINIT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBSINIT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MBSINIT], [/* Define to 1 when the gnulib module mbsinit should be tested. */ +@%:@undef GNULIB_TEST_MBSINIT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSLEN], [/* Define to 1 if you have the \'mbslen\' function. */ +@%:@undef HAVE_MBSLEN]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MBSLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBSLEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MBSLEN], [/* Define to 1 when the gnulib module mbslen should be tested. */ +@%:@undef GNULIB_TEST_MBSLEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSINIT], [/* Define to 1 if you have the \'mbsinit\' function. */ +@%:@undef HAVE_MBSINIT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBRTOWC], [/* Define to 1 if you have the \'mbrtowc\' function. */ +@%:@undef HAVE_MBRTOWC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSRTOWCS], [/* Define to 1 if you have the \'mbsrtowcs\' function. */ +@%:@undef HAVE_MBSRTOWCS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_MBSRTOWCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_MBSRTOWCS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_MBSRTOWCS], [/* Define to 1 if you have the declaration of \'mbsrtowcs\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_MBSRTOWCS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MBSRTOWCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBSRTOWCS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MBSRTOWCS], [/* Define to 1 when the gnulib module mbsrtowcs should be tested. */ +@%:@undef GNULIB_TEST_MBSRTOWCS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MBSSTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBSSTR$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MBSSTR], [/* Define to 1 when the gnulib module mbsstr should be tested. */ +@%:@undef GNULIB_TEST_MBSSTR]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MBTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBTOWC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MBTOWC], [/* Define to 1 when the gnulib module mbtowc should be tested. */ +@%:@undef GNULIB_TEST_MBTOWC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MAP_ANONYMOUS], [/* Define to a substitute value for mmap()\'s MAP_ANONYMOUS flag. */ +@%:@undef MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MAP_ANONYMOUS], [/* Define to 1 if mmap()\'s MAP_ANONYMOUS flag is available after including + config.h and . */ +@%:@undef HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_MMAN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_MMAN_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MPROTECT], [/* Define to 1 if you have the \'mprotect\' function. */ +@%:@undef HAVE_MPROTECT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_BP_SYM_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_BP_SYM_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_BP_SYM_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_BP_SYM_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MEMCHR$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MEMCHR], [/* Define to 1 when the gnulib module memchr should be tested. */ +@%:@undef GNULIB_TEST_MEMCHR]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MINMAX_IN_LIMITS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MINMAX_IN_LIMITS_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MINMAX_IN_LIMITS_H], [/* Define to 1 if defines the MIN and MAX macros. */ +@%:@undef HAVE_MINMAX_IN_LIMITS_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MINMAX_IN_SYS_PARAM_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MINMAX_IN_SYS_PARAM_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MINMAX_IN_SYS_PARAM_H], [/* Define to 1 if defines the MIN and MAX macros. */ +@%:@undef HAVE_MINMAX_IN_SYS_PARAM_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MKSTEMP], [/* Define to 1 if you have the \'mkstemp\' function. */ +@%:@undef HAVE_MKSTEMP]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MKSTEMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MKSTEMP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MKSTEMP], [/* Define to 1 when the gnulib module mkstemp should be tested. */ +@%:@undef GNULIB_TEST_MKSTEMP]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([TIME_T_IS_SIGNED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^TIME_T_IS_SIGNED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([TIME_T_IS_SIGNED], [/* Define to 1 if time_t is signed. */ +@%:@undef TIME_T_IS_SIGNED]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_ALARM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_ALARM$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_ALARM], [/* Define to 1 if you have the declaration of \'alarm\', and to 0 if you don\'t. + */ +@%:@undef HAVE_DECL_ALARM]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TZSET], [/* Define to 1 if you have the \'tzset\' function. */ +@%:@undef HAVE_TZSET]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([NEED_MKTIME_WORKING]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEED_MKTIME_WORKING$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([NEED_MKTIME_WORKING], [/* Define if the compilation of mktime.c should define \'mktime\' with the + algorithmic workarounds. */ +@%:@undef NEED_MKTIME_WORKING]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([NEED_MKTIME_WINDOWS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEED_MKTIME_WINDOWS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([NEED_MKTIME_WINDOWS], [/* Define if the compilation of mktime.c should define \'mktime\' with the + native Windows TZ workaround. */ +@%:@undef NEED_MKTIME_WINDOWS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MKTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MKTIME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MKTIME], [/* Define to 1 when the gnulib module mktime should be tested. */ +@%:@undef GNULIB_TEST_MKTIME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([mktime_internal]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^mktime_internal$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([mktime_internal], [/* Define to the real name of the mktime_internal function. */ +@%:@undef mktime_internal]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([NEED_MKTIME_INTERNAL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEED_MKTIME_INTERNAL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([NEED_MKTIME_INTERNAL], [/* Define if the compilation of mktime.c should define \'mktime_internal\'. */ +@%:@undef NEED_MKTIME_INTERNAL]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_MSVC_NOTHROW]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MSVC_NOTHROW$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_MSVC_NOTHROW], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module msvc-nothrow shall be considered present. */ +@%:@undef GNULIB_MSVC_NOTHROW]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_NL_LANGINFO], [/* Define to 1 if you have the \'nl_langinfo\' function. */ +@%:@undef HAVE_NL_LANGINFO]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([FUNC_NL_LANGINFO_YESEXPR_WORKS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^FUNC_NL_LANGINFO_YESEXPR_WORKS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([FUNC_NL_LANGINFO_YESEXPR_WORKS], [/* Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string. */ +@%:@undef FUNC_NL_LANGINFO_YESEXPR_WORKS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([REPLACE_NL_LANGINFO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_NL_LANGINFO$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([REPLACE_NL_LANGINFO], [/* Define if nl_langinfo exists but is overridden by gnulib. */ +@%:@undef REPLACE_NL_LANGINFO]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_NL_LANGINFO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_NL_LANGINFO$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_NL_LANGINFO], [/* Define to 1 when the gnulib module nl_langinfo should be tested. */ +@%:@undef GNULIB_TEST_NL_LANGINFO]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LSTAT], [/* Define to 1 if you have the \'lstat\' function. */ +@%:@undef HAVE_LSTAT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([OPEN_TRAILING_SLASH_BUG]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^OPEN_TRAILING_SLASH_BUG$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([OPEN_TRAILING_SLASH_BUG], [/* Define to 1 if open() fails to recognize a trailing slash. */ +@%:@undef OPEN_TRAILING_SLASH_BUG]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([PROMOTED_MODE_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PROMOTED_MODE_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([PROMOTED_MODE_T], [/* Define to the type that is the result of default argument promotions of + type mode_t. */ +@%:@undef PROMOTED_MODE_T]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_OPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_OPEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_OPEN], [/* Define to 1 when the gnulib module open should be tested. */ +@%:@undef GNULIB_TEST_OPEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_PARAM_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_PARAM_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_PROGRAM_INVOCATION_NAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_PROGRAM_INVOCATION_NAME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_PROGRAM_INVOCATION_NAME], [/* Define to 1 if you have the declaration of \'program_invocation_name\', and + to 0 if you don\'t. */ +@%:@undef HAVE_DECL_PROGRAM_INVOCATION_NAME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME], [/* Define to 1 if you have the declaration of \'program_invocation_short_name\', + and to 0 if you don\'t. */ +@%:@undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME]) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"']) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"']) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PTHREAD_SIGMASK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PTHREAD_SIGMASK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PTHREAD_SIGMASK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RAISE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RAISE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RAISE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SIGNAL_H_SIGPIPE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SIGNAL_H_SIGPIPE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SIGNAL_H_SIGPIPE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SIGPROCMASK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SIGPROCMASK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SIGPROCMASK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SIGACTION]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SIGACTION]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SIGACTION$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_POSIX_SIGNALBLOCKING]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_POSIX_SIGNALBLOCKING]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_POSIX_SIGNALBLOCKING$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_PTHREAD_SIGMASK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_PTHREAD_SIGMASK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PTHREAD_SIGMASK$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_RAISE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_RAISE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RAISE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SIGSET_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SIGSET_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGSET_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SIGINFO_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SIGINFO_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGINFO_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SIGACTION]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SIGACTION]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGACTION$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRUCT_SIGACTION_SA_SIGACTION]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_SIGACTION_SA_SIGACTION$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_TYPE_VOLATILE_SIG_ATOMIC_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_TYPE_VOLATILE_SIG_ATOMIC_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TYPE_VOLATILE_SIG_ATOMIC_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SIGHANDLER_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SIGHANDLER_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGHANDLER_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_PTHREAD_SIGMASK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_PTHREAD_SIGMASK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PTHREAD_SIGMASK$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_RAISE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_RAISE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_RAISE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAISE], [/* Define to 1 if you have the \'raise\' function. */ +@%:@undef HAVE_RAISE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_RAISE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RAISE$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SIGSET_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGSET_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SIGSET_T], [/* Define to 1 if the system has the type \'sigset_t\'. */ +@%:@undef HAVE_SIGSET_T]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_RAISE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_RAISE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_RAISE], [/* Define to 1 when the gnulib module raise should be tested. */ +@%:@undef GNULIB_TEST_RAISE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAWMEMCHR], [/* Define to 1 if you have the \'rawmemchr\' function. */ +@%:@undef HAVE_RAWMEMCHR]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_RAWMEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RAWMEMCHR$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_RAWMEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_RAWMEMCHR$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_RAWMEMCHR], [/* Define to 1 when the gnulib module rawmemchr should be tested. */ +@%:@undef GNULIB_TEST_RAWMEMCHR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_READLINK], [/* Define to 1 if you have the \'readlink\' function. */ +@%:@undef HAVE_READLINK]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([READLINK_TRAILING_SLASH_BUG]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^READLINK_TRAILING_SLASH_BUG$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([READLINK_TRAILING_SLASH_BUG], [/* Define to 1 if readlink fails to recognize a trailing slash. */ +@%:@undef READLINK_TRAILING_SLASH_BUG]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_READLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_READLINK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_READLINK], [/* Define to 1 when the gnulib module readlink should be tested. */ +@%:@undef GNULIB_TEST_READLINK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MALLOC_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_MALLOC_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([_REGEX_INCLUDE_LIMITS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^_REGEX_INCLUDE_LIMITS_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([_REGEX_INCLUDE_LIMITS_H], [/* Define if you want to include , so that it consistently + overrides \'s RE_DUP_MAX. */ +@%:@undef _REGEX_INCLUDE_LIMITS_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([_REGEX_LARGE_OFFSETS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^_REGEX_LARGE_OFFSETS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([_REGEX_LARGE_OFFSETS], [/* Define if you want regoff_t to be at least as wide POSIX requires. */ +@%:@undef _REGEX_LARGE_OFFSETS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_syntax_options]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_syntax_options$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_syntax_options], [/* Define to rpl_re_syntax_options if the replacement should be used. */ +@%:@undef re_syntax_options]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_set_syntax]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_set_syntax$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_set_syntax], [/* Define to rpl_re_set_syntax if the replacement should be used. */ +@%:@undef re_set_syntax]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_compile_pattern]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_compile_pattern$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_compile_pattern], [/* Define to rpl_re_compile_pattern if the replacement should be used. */ +@%:@undef re_compile_pattern]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_compile_fastmap]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_compile_fastmap$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_compile_fastmap], [/* Define to rpl_re_compile_fastmap if the replacement should be used. */ +@%:@undef re_compile_fastmap]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_search]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_search$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_search], [/* Define to rpl_re_search if the replacement should be used. */ +@%:@undef re_search]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_search_2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_search_2$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_search_2], [/* Define to rpl_re_search_2 if the replacement should be used. */ +@%:@undef re_search_2]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_match]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_match$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_match], [/* Define to rpl_re_match if the replacement should be used. */ +@%:@undef re_match]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_match_2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_match_2$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_match_2], [/* Define to rpl_re_match_2 if the replacement should be used. */ +@%:@undef re_match_2]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_set_registers]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_set_registers$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_set_registers], [/* Define to rpl_re_set_registers if the replacement should be used. */ +@%:@undef re_set_registers]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_comp]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_comp$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_comp], [/* Define to rpl_re_comp if the replacement should be used. */ +@%:@undef re_comp]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_exec]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_exec$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_exec], [/* Define to rpl_re_exec if the replacement should be used. */ +@%:@undef re_exec]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([regcomp]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^regcomp$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([regcomp], [/* Define to rpl_regcomp if the replacement should be used. */ +@%:@undef regcomp]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([regexec]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^regexec$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([regexec], [/* Define to rpl_regexec if the replacement should be used. */ +@%:@undef regexec]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([regerror]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^regerror$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([regerror], [/* Define to rpl_regerror if the replacement should be used. */ +@%:@undef regerror]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([regfree]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^regfree$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([regfree], [/* Define to rpl_regfree if the replacement should be used. */ +@%:@undef regfree]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LIBINTL_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_LIBINTL_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBINTL_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LIBINTL_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISBLANK], [/* Define to 1 if you have the \'isblank\' function. */ +@%:@undef HAVE_ISBLANK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISWCTYPE], [/* Define to 1 if you have the \'iswctype\' function. */ +@%:@undef HAVE_ISWCTYPE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_ISBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_ISBLANK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_ISBLANK], [/* Define to 1 if you have the declaration of \'isblank\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_ISBLANK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SECURE_GETENV], [/* Define to 1 if you have the \'secure_getenv\' function. */ +@%:@undef HAVE_SECURE_GETENV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE___SECURE_GETENV], [/* Define to 1 if you have the \'__secure_getenv\' function. */ +@%:@undef HAVE___SECURE_GETENV]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE___SECURE_GETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE___SECURE_GETENV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISSETUGID], [/* Define to 1 if you have the \'issetugid\' function. */ +@%:@undef HAVE_ISSETUGID]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ISSETUGID]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ISSETUGID$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETUID], [/* Define to 1 if you have the \'getuid\' function. */ +@%:@undef HAVE_GETUID]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETEUID], [/* Define to 1 if you have the \'geteuid\' function. */ +@%:@undef HAVE_GETEUID]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETGID], [/* Define to 1 if you have the \'getgid\' function. */ +@%:@undef HAVE_GETGID]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETEGID], [/* Define to 1 if you have the \'getegid\' function. */ +@%:@undef HAVE_GETEGID]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SECURE_GETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SECURE_GETENV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SECURE_GETENV], [/* Define to 1 when the gnulib module secure_getenv should be tested. */ +@%:@undef GNULIB_TEST_SECURE_GETENV]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_SETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SETENV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_SETENV], [/* Define to 1 if you have the declaration of \'setenv\', and to 0 if you don\'t. + */ +@%:@undef HAVE_DECL_SETENV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SETENV], [/* Define to 1 if you have the \'setenv\' function. */ +@%:@undef HAVE_SETENV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SEARCH_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SEARCH_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SEARCH_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SEARCH_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TSEARCH], [/* Define to 1 if you have the \'tsearch\' function. */ +@%:@undef HAVE_TSEARCH]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TSEARCH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TSEARCH$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SETENV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SETENV], [/* Define to 1 when the gnulib module setenv should be tested. */ +@%:@undef GNULIB_TEST_SETENV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SIGACTION], [/* Define to 1 if you have the \'sigaction\' function. */ +@%:@undef HAVE_SIGACTION]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SIGACTION_SA_SIGACTION]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_SIGACTION_SA_SIGACTION$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_SIGACTION_SA_SIGACTION], [/* Define to 1 if \'sa_sigaction\' is a member of \'struct sigaction\'. */ +@%:@undef HAVE_STRUCT_SIGACTION_SA_SIGACTION]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([uid_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^uid_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([uid_t], [/* Define as \'int\' if doesn\'t define. */ +@%:@undef uid_t]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([gid_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^gid_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([gid_t], [/* Define as \'int\' if doesn\'t define. */ +@%:@undef gid_t]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SIGALTSTACK], [/* Define to 1 if you have the \'sigaltstack\' function. */ +@%:@undef HAVE_SIGALTSTACK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SIGINTERRUPT], [/* Define to 1 if you have the \'siginterrupt\' function. */ +@%:@undef HAVE_SIGINTERRUPT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SIGINFO_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGINFO_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SIGINFO_T], [/* Define to 1 if the system has the type \'siginfo_t\'. */ +@%:@undef HAVE_SIGINFO_T]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SIGACTION]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SIGACTION$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SIGACTION], [/* Define to 1 when the gnulib module sigaction should be tested. */ +@%:@undef GNULIB_TEST_SIGACTION]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SIGNAL_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SIGNAL_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SIGNAL_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_PTHREAD_SIGMASK], [/* Define to 1 if pthread_sigmask is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_PTHREAD_SIGMASK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SIGACTION], [/* Define to 1 if sigaction is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SIGACTION]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SIGADDSET], [/* Define to 1 if sigaddset is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SIGADDSET]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SIGDELSET], [/* Define to 1 if sigdelset is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SIGDELSET]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SIGEMPTYSET], [/* Define to 1 if sigemptyset is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SIGEMPTYSET]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SIGFILLSET], [/* Define to 1 if sigfillset is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SIGFILLSET]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SIGISMEMBER], [/* Define to 1 if sigismember is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SIGISMEMBER]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SIGPENDING], [/* Define to 1 if sigpending is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SIGPENDING]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SIGPROCMASK], [/* Define to 1 if sigprocmask is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SIGPROCMASK]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SIGPROCMASK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SIGPROCMASK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SIGPROCMASK], [/* Define to 1 when the gnulib module sigprocmask should be tested. */ +@%:@undef GNULIB_TEST_SIGPROCMASK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDINT_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STDINT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STDINT_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([SIZE_MAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SIZE_MAX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([SIZE_MAX], [/* Define as the maximum value of type \'size_t\', if the system doesn\'t define + it. */ +@%:@undef SIZE_MAX]) +m4trace:configure.ac:42: -1- AH_OUTPUT([SIZE_MAX], [/* Define as the maximum value of type \'size_t\', if the system doesn\'t define + it. */ +#ifndef SIZE_MAX +# undef SIZE_MAX +#endif]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([ssize_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ssize_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([ssize_t], [/* Define as a signed type of the same size as size_t. */ +@%:@undef ssize_t]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LSTAT], [/* Define to 1 if you have the \'lstat\' function. */ +@%:@undef HAVE_LSTAT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([REPLACE_FUNC_STAT_FILE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FUNC_STAT_FILE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([REPLACE_FUNC_STAT_FILE], [/* Define to 1 if stat needs help when passed a file name with a trailing + slash */ +@%:@undef REPLACE_FUNC_STAT_FILE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_STAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STAT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_STAT], [/* Define to 1 when the gnulib module stat should be tested. */ +@%:@undef GNULIB_TEST_STAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TIME_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC], [/* Define to 1 if \'st_atim.tv_nsec\' is a member of \'struct stat\'. */ +@%:@undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], [/* Define to 1 if the type of the st_atim member of a struct stat is struct + timespec. */ +@%:@undef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC], [/* Define to 1 if \'st_atimespec.tv_nsec\' is a member of \'struct stat\'. */ +@%:@undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_ATIMENSEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_ATIMENSEC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_ATIMENSEC], [/* Define to 1 if \'st_atimensec\' is a member of \'struct stat\'. */ +@%:@undef HAVE_STRUCT_STAT_ST_ATIMENSEC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC], [/* Define to 1 if \'st_atim.st__tim.tv_nsec\' is a member of \'struct stat\'. */ +@%:@undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TIME_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC], [/* Define to 1 if \'st_birthtimespec.tv_nsec\' is a member of \'struct stat\'. */ +@%:@undef HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC], [/* Define to 1 if \'st_birthtimensec\' is a member of \'struct stat\'. */ +@%:@undef HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC], [/* Define to 1 if \'st_birthtim.tv_nsec\' is a member of \'struct stat\'. */ +@%:@undef HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_STDARG_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_STDARG_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDARG_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_STDARG_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_STDARG_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STDARG_H$]) +m4trace:configure.ac:42: -1- _m4_warn([obsolete], [$as_echo_n is obsolete; use AS_ECHO_N(["message"]) instead], [m4/gnulib-common.m4:399: gl_CACHE_VAL_SILENT is expanded from... +m4/stdarg.m4:10: gl_STDARG_H is expanded from... +m4/gnulib-comp.m4:445: gl_INIT is expanded from... +configure.ac:42: the top level]) +m4trace:configure.ac:42: -1- _m4_warn([obsolete], [$as_echo_n is obsolete; use AS_ECHO_N(["message"]) instead], [m4/gnulib-common.m4:399: gl_CACHE_VAL_SILENT is expanded from... +m4/stdarg.m4:10: gl_STDARG_H is expanded from... +m4/gnulib-comp.m4:445: gl_INIT is expanded from... +configure.ac:42: the top level]) +m4trace:configure.ac:42: -1- _m4_warn([obsolete], [$as_echo_n is obsolete; use AS_ECHO_N(["message"]) instead], [m4/gnulib-common.m4:399: gl_CACHE_VAL_SILENT is expanded from... +m4/stdarg.m4:10: gl_STDARG_H is expanded from... +m4/gnulib-comp.m4:445: gl_INIT is expanded from... +configure.ac:42: the top level]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([va_copy]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^va_copy$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([va_copy], [/* Define as a macro for copying va_list variables. */ +@%:@undef va_copy]) +m4trace:configure.ac:42: -1- AH_OUTPUT([gl_VA_COPY], [/* A replacement for va_copy, if needed. */ +#define gl_va_copy(a,b) ((a) = (b))]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([va_copy]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^va_copy$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([va_copy], [/* Define as a macro for copying va_list variables. */ +@%:@undef va_copy]) +m4trace:configure.ac:42: -1- AC_SUBST([STDARG_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([STDARG_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STDARG_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_STDARG_H], [test -n "$STDARG_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDARG_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDARG_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDARG_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDARG_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDARG_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDARG_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDARG_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDARG_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_STDARG_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_STDARG_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDARG_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE__BOOL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE__BOOL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE__BOOL], [/* Define to 1 if the system has the type \'_Bool\'. */ +@%:@undef HAVE__BOOL]) +m4trace:configure.ac:42: -1- AC_SUBST([STDBOOL_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([STDBOOL_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STDBOOL_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDBOOL_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDBOOL_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDBOOL_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDBOOL_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDBOOL_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDBOOL_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDBOOL_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDBOOL_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE__BOOL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE__BOOL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE__BOOL$]) +m4trace:configure.ac:42: -1- AC_SUBST([STDDEF_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([STDDEF_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STDDEF_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDDEF_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDDEF_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDDEF_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDDEF_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDDEF_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDDEF_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDDEF_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDDEF_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_STDDEF_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_STDDEF_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDDEF_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_STDDEF_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_STDDEF_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STDDEF_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MINGW_ANSI_STDIO], [/* Use GNU style printf and scanf. */ +#ifndef __USE_MINGW_ANSI_STDIO +# undef __USE_MINGW_ANSI_STDIO +#endif +]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([__USE_MINGW_ANSI_STDIO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^__USE_MINGW_ANSI_STDIO$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_STDIO_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_STDIO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDIO_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_STDIO_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_STDIO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STDIO_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU], [/* Define to 1 if printf and friends should be labeled with attribute + "__gnu_printf__" instead of "__printf__" */ +@%:@undef GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_FSCANF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSCANF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_FSCANF], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module fscanf shall be considered present. */ +@%:@undef GNULIB_FSCANF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_SCANF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SCANF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_SCANF], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module scanf shall be considered present. */ +@%:@undef GNULIB_SCANF]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_DPRINTF], [/* Define to 1 if dprintf is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_DPRINTF]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FPURGE], [/* Define to 1 if fpurge is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FPURGE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FSEEKO], [/* Define to 1 if fseeko is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FSEEKO]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FTELLO], [/* Define to 1 if ftello is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FTELLO]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETDELIM], [/* Define to 1 if getdelim is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETDELIM]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETLINE], [/* Define to 1 if getline is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETLINE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETS], [/* Define to 1 if gets is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_PCLOSE], [/* Define to 1 if pclose is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_PCLOSE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_POPEN], [/* Define to 1 if popen is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_POPEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_RENAMEAT], [/* Define to 1 if renameat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_RENAMEAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SNPRINTF], [/* Define to 1 if snprintf is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SNPRINTF]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_TMPFILE], [/* Define to 1 if tmpfile is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_TMPFILE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_VDPRINTF], [/* Define to 1 if vdprintf is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_VDPRINTF]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_VSNPRINTF], [/* Define to 1 if vsnprintf is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_VSNPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_STDLIB_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_STDLIB_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDLIB_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_STDLIB_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_STDLIB_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STDLIB_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL__EXIT], [/* Define to 1 if _Exit is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL__EXIT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_ATOLL], [/* Define to 1 if atoll is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_ATOLL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_CANONICALIZE_FILE_NAME], [/* Define to 1 if canonicalize_file_name is declared even after undefining + macros. */ +@%:@undef HAVE_RAW_DECL_CANONICALIZE_FILE_NAME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETLOADAVG], [/* Define to 1 if getloadavg is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETLOADAVG]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETSUBOPT], [/* Define to 1 if getsubopt is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETSUBOPT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GRANTPT], [/* Define to 1 if grantpt is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GRANTPT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_INITSTATE], [/* Define to 1 if initstate is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_INITSTATE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_INITSTATE_R], [/* Define to 1 if initstate_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_INITSTATE_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKDTEMP], [/* Define to 1 if mkdtemp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKDTEMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKOSTEMP], [/* Define to 1 if mkostemp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKOSTEMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKOSTEMPS], [/* Define to 1 if mkostemps is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKOSTEMPS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKSTEMP], [/* Define to 1 if mkstemp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKSTEMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKSTEMPS], [/* Define to 1 if mkstemps is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKSTEMPS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_POSIX_OPENPT], [/* Define to 1 if posix_openpt is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_POSIX_OPENPT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_PTSNAME], [/* Define to 1 if ptsname is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_PTSNAME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_PTSNAME_R], [/* Define to 1 if ptsname_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_PTSNAME_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_QSORT_R], [/* Define to 1 if qsort_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_QSORT_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_RANDOM], [/* Define to 1 if random is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_RANDOM]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_RANDOM_R], [/* Define to 1 if random_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_RANDOM_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_REALPATH], [/* Define to 1 if realpath is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_REALPATH]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_RPMATCH], [/* Define to 1 if rpmatch is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_RPMATCH]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SECURE_GETENV], [/* Define to 1 if secure_getenv is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SECURE_GETENV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SETENV], [/* Define to 1 if setenv is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SETENV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SETSTATE], [/* Define to 1 if setstate is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SETSTATE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SETSTATE_R], [/* Define to 1 if setstate_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SETSTATE_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SRANDOM], [/* Define to 1 if srandom is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SRANDOM]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SRANDOM_R], [/* Define to 1 if srandom_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SRANDOM_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRTOD], [/* Define to 1 if strtod is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRTOD]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRTOLL], [/* Define to 1 if strtoll is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRTOLL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRTOULL], [/* Define to 1 if strtoull is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRTOULL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_UNLOCKPT], [/* Define to 1 if unlockpt is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_UNLOCKPT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_UNSETENV], [/* Define to 1 if unsetenv is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_UNSETENV]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FFS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FFS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FFS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FFS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FFS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FFS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRCASECMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRCASECMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_STRNCASECMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_STRNCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRNCASECMP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRCASECMP], [/* Define to 1 if you have the \'strcasecmp\' function. */ +@%:@undef HAVE_STRCASECMP]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRCASECMP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRNCASECMP], [/* Define to 1 if you have the \'strncasecmp\' function. */ +@%:@undef HAVE_STRNCASECMP]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRNCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRNCASECMP$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_STRNCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRNCASECMP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_STRNCASECMP], [/* Define to 1 if you have the declaration of \'strncasecmp\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_STRNCASECMP]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([REPLACE_STRERROR_0]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRERROR_0$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([REPLACE_STRERROR_0], [/* Define to 1 if strerror(0) does not return a message implying success. */ +@%:@undef REPLACE_STRERROR_0]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRERROR_R], [/* Define to 1 if you have the \'strerror_r\' function. */ +@%:@undef HAVE_STRERROR_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE___XPG_STRERROR_R], [/* Define to 1 if you have the \'__xpg_strerror_r\' function. */ +@%:@undef HAVE___XPG_STRERROR_R]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_STRERROR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRERROR$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_STRERROR], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module strerror shall be considered present. */ +@%:@undef GNULIB_STRERROR]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_STRERROR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STRERROR$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_STRERROR], [/* Define to 1 when the gnulib module strerror should be tested. */ +@%:@undef GNULIB_TEST_STRERROR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WINSOCK2_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([TM_IN_SYS_TIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^TM_IN_SYS_TIME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([TM_IN_SYS_TIME], [/* Define to 1 if your declares \'struct tm\'. */ +@%:@undef TM_IN_SYS_TIME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_TM_TM_ZONE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_TM_TM_ZONE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_TM_TM_ZONE], [/* Define to 1 if \'tm_zone\' is a member of \'struct tm\'. */ +@%:@undef HAVE_STRUCT_TM_TM_ZONE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TM_ZONE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TM_ZONE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TM_ZONE], [/* Define to 1 if your \'struct tm\' has \'tm_zone\'. Deprecated, use + \'HAVE_STRUCT_TM_TM_ZONE\' instead. */ +@%:@undef HAVE_TM_ZONE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_TZNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_TZNAME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_TZNAME], [/* Define to 1 if you have the declaration of \'tzname\', and to 0 if you don\'t. + */ +@%:@undef HAVE_DECL_TZNAME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TZNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TZNAME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TZNAME], [/* Define to 1 if you don\'t have \'tm_zone\' but do have the external array + \'tzname\'. */ +@%:@undef HAVE_TZNAME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TM_GMTOFF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TM_GMTOFF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TM_GMTOFF], [/* Define if struct tm has the tm_gmtoff member. */ +@%:@undef HAVE_TM_GMTOFF]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TZSET], [/* Define to 1 if you have the \'tzset\' function. */ +@%:@undef HAVE_TZSET]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([my_strftime]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^my_strftime$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([my_strftime], [/* Define to the name of the strftime replacement function. */ +@%:@undef my_strftime]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_STRING_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_STRING_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STRING_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_STRING_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_STRING_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STRING_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FFSL], [/* Define to 1 if ffsl is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FFSL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FFSLL], [/* Define to 1 if ffsll is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FFSLL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MEMMEM], [/* Define to 1 if memmem is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MEMMEM]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MEMPCPY], [/* Define to 1 if mempcpy is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MEMPCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MEMRCHR], [/* Define to 1 if memrchr is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MEMRCHR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_RAWMEMCHR], [/* Define to 1 if rawmemchr is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_RAWMEMCHR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STPCPY], [/* Define to 1 if stpcpy is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STPCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STPNCPY], [/* Define to 1 if stpncpy is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STPNCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRCHRNUL], [/* Define to 1 if strchrnul is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRCHRNUL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRDUP], [/* Define to 1 if strdup is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRDUP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRNCAT], [/* Define to 1 if strncat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRNCAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRNDUP], [/* Define to 1 if strndup is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRNDUP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRNLEN], [/* Define to 1 if strnlen is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRNLEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRPBRK], [/* Define to 1 if strpbrk is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRPBRK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRSEP], [/* Define to 1 if strsep is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRSEP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRCASESTR], [/* Define to 1 if strcasestr is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRCASESTR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRTOK_R], [/* Define to 1 if strtok_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRTOK_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRERROR_R], [/* Define to 1 if strerror_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRERROR_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRSIGNAL], [/* Define to 1 if strsignal is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRSIGNAL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRVERSCMP], [/* Define to 1 if strverscmp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRVERSCMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRINGS_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_STRINGS_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_STRINGS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STRINGS_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_STRINGS_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_STRINGS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STRINGS_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRINGS_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRINGS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRINGS_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FFS], [/* Define to 1 if ffs is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FFS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRCASECMP], [/* Define to 1 if strcasecmp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRCASECMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRNCASECMP], [/* Define to 1 if strncasecmp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRNCASECMP]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_STRNDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRNDUP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_STRNDUP], [/* Define to 1 if you have the declaration of \'strndup\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_STRNDUP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRNDUP], [/* Define to 1 if you have the \'strndup\' function. */ +@%:@undef HAVE_STRNDUP]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_STRNDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STRNDUP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_STRNDUP], [/* Define to 1 when the gnulib module strndup should be tested. */ +@%:@undef GNULIB_TEST_STRNDUP]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_STRNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRNLEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_STRNLEN], [/* Define to 1 if you have the declaration of \'strnlen\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_STRNLEN]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_STRNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STRNLEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_STRNLEN], [/* Define to 1 when the gnulib module strnlen should be tested. */ +@%:@undef GNULIB_TEST_STRNLEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRPTIME], [/* Define to 1 if you have the \'strptime\' function. */ +@%:@undef HAVE_STRPTIME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_STRPTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STRPTIME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_STRPTIME], [/* Define to 1 when the gnulib module strptime should be tested. */ +@%:@undef GNULIB_TEST_STRPTIME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRTOULL], [/* Define to 1 if you have the \'strtoull\' function. */ +@%:@undef HAVE_STRTOULL]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRTOULL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRTOULL$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_STRTOULL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STRTOULL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_STRTOULL], [/* Define to 1 when the gnulib module strtoull should be tested. */ +@%:@undef GNULIB_TEST_STRTOULL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRTOUMAX], [/* Define to 1 if you have the \'strtoumax\' function. */ +@%:@undef HAVE_STRTOUMAX]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_STRTOUMAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRTOUMAX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_STRTOUMAX], [/* Define to 1 if you have the declaration of \'strtoumax\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_STRTOUMAX]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_STRTOULL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRTOULL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_STRTOULL], [/* Define to 1 if you have the declaration of \'strtoull\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_STRTOULL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_STAT_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SYS_STAT_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SYS_STAT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_STAT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([WINDOWS_STAT_TIMESPEC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([WINDOWS_STAT_TIMESPEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_STAT_TIMESPEC$]) +m4trace:configure.ac:42: -1- AC_SUBST([WINDOWS_64_BIT_ST_SIZE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([WINDOWS_64_BIT_ST_SIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_64_BIT_ST_SIZE$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([nlink_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^nlink_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([nlink_t], [/* Define to the type of st_nlink in struct stat, or a supertype. */ +@%:@undef nlink_t]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FCHMODAT], [/* Define to 1 if fchmodat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FCHMODAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FSTAT], [/* Define to 1 if fstat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FSTAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FSTATAT], [/* Define to 1 if fstatat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FSTATAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FUTIMENS], [/* Define to 1 if futimens is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FUTIMENS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_LCHMOD], [/* Define to 1 if lchmod is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_LCHMOD]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_LSTAT], [/* Define to 1 if lstat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_LSTAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKDIRAT], [/* Define to 1 if mkdirat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKDIRAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKFIFO], [/* Define to 1 if mkfifo is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKFIFO]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKFIFOAT], [/* Define to 1 if mkfifoat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKFIFOAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKNOD], [/* Define to 1 if mknod is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKNOD]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKNODAT], [/* Define to 1 if mknodat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKNODAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STAT], [/* Define to 1 if stat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_UTIMENSAT], [/* Define to 1 if utimensat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_UTIMENSAT]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SYS_TYPES_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SYS_TYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_TYPES_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([WINDOWS_64_BIT_OFF_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([WINDOWS_64_BIT_OFF_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_64_BIT_OFF_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([WINDOWS_STAT_INODES]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([WINDOWS_STAT_INODES]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_STAT_INODES$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WAITPID]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WAITPID]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WAITPID$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_WAIT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_WAIT_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SYS_WAIT_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SYS_WAIT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_WAIT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WAITPID], [/* Define to 1 if waitpid is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WAITPID]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_TIME_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_TIME_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_TIME_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_TIME_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_TIME_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_TIME_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TIME_H]) +m4trace:configure.ac:42: -1- AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([TIME_H_DEFINES_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^TIME_H_DEFINES_STRUCT_TIMESPEC$]) +m4trace:configure.ac:42: -1- AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SYS_TIME_H_DEFINES_STRUCT_TIMESPEC$]) +m4trace:configure.ac:42: -1- AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([PTHREAD_H_DEFINES_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PTHREAD_H_DEFINES_STRUCT_TIMESPEC$]) +m4trace:configure.ac:42: -1- AC_SUBST([UNISTD_H_DEFINES_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([UNISTD_H_DEFINES_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UNISTD_H_DEFINES_STRUCT_TIMESPEC$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_LOCALTIME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_LOCALTIME_R$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_LOCALTIME_R], [/* Define to 1 if you have the declaration of \'localtime_r\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_LOCALTIME_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LOCALTIME_R], [/* Define to 1 if you have the \'localtime_r\' function. */ +@%:@undef HAVE_LOCALTIME_R]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_TIME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_TIME_R$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_TIME_R], [/* Define to 1 when the gnulib module time_r should be tested. */ +@%:@undef GNULIB_TEST_TIME_R]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TIMEZONE_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TIMEZONE_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TIMEZONE_T], [/* Define to 1 if the system has the type \'timezone_t\'. */ +@%:@undef HAVE_TIMEZONE_T]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_TIME_RZ]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_TIME_RZ$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_TIME_RZ], [/* Define to 1 when the gnulib module time_rz should be tested. */ +@%:@undef GNULIB_TEST_TIME_RZ]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TIMEGM], [/* Define to 1 if you have the \'timegm\' function. */ +@%:@undef HAVE_TIMEGM]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_TIMEGM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_TIMEGM$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_TIMEGM], [/* Define to 1 when the gnulib module timegm should be tested. */ +@%:@undef GNULIB_TEST_TIMEGM]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TZSET], [/* Define to 1 if you have the \'tzset\' function. */ +@%:@undef HAVE_TZSET]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_RUN_TZSET_TEST]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RUN_TZSET_TEST$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RUN_TZSET_TEST], [/* Define to 1 if you have run the test for working tzset. */ +@%:@undef HAVE_RUN_TZSET_TEST]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([TZSET_CLOBBERS_LOCALTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^TZSET_CLOBBERS_LOCALTIME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([TZSET_CLOBBERS_LOCALTIME], [/* Define if tzset clobbers localtime\'s static buffer. */ +@%:@undef TZSET_CLOBBERS_LOCALTIME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_TZSET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_TZSET$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_TZSET], [/* Define to 1 when the gnulib module tzset should be tested. */ +@%:@undef GNULIB_TEST_TZSET]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_UNISTD_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_UNISTD_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_UNISTD_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_UNISTD_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_UNISTD_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_UNISTD_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UNISTD_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_CHDIR], [/* Define to 1 if chdir is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_CHDIR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_CHOWN], [/* Define to 1 if chown is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_CHOWN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_DUP], [/* Define to 1 if dup is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_DUP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_DUP2], [/* Define to 1 if dup2 is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_DUP2]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_DUP3], [/* Define to 1 if dup3 is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_DUP3]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_ENVIRON], [/* Define to 1 if environ is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_ENVIRON]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_EUIDACCESS], [/* Define to 1 if euidaccess is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_EUIDACCESS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FACCESSAT], [/* Define to 1 if faccessat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FACCESSAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FCHDIR], [/* Define to 1 if fchdir is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FCHDIR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FCHOWNAT], [/* Define to 1 if fchownat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FCHOWNAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FDATASYNC], [/* Define to 1 if fdatasync is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FDATASYNC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FSYNC], [/* Define to 1 if fsync is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FSYNC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FTRUNCATE], [/* Define to 1 if ftruncate is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FTRUNCATE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETCWD], [/* Define to 1 if getcwd is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETCWD]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETDOMAINNAME], [/* Define to 1 if getdomainname is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETDOMAINNAME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETDTABLESIZE], [/* Define to 1 if getdtablesize is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETGROUPS], [/* Define to 1 if getgroups is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETGROUPS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETHOSTNAME], [/* Define to 1 if gethostname is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETHOSTNAME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETLOGIN], [/* Define to 1 if getlogin is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETLOGIN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETLOGIN_R], [/* Define to 1 if getlogin_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETLOGIN_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETPAGESIZE], [/* Define to 1 if getpagesize is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETPAGESIZE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETUSERSHELL], [/* Define to 1 if getusershell is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETUSERSHELL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SETUSERSHELL], [/* Define to 1 if setusershell is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SETUSERSHELL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_ENDUSERSHELL], [/* Define to 1 if endusershell is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_ENDUSERSHELL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GROUP_MEMBER], [/* Define to 1 if group_member is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GROUP_MEMBER]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_ISATTY], [/* Define to 1 if isatty is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_ISATTY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_LCHOWN], [/* Define to 1 if lchown is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_LCHOWN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_LINK], [/* Define to 1 if link is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_LINK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_LINKAT], [/* Define to 1 if linkat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_LINKAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_LSEEK], [/* Define to 1 if lseek is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_LSEEK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_PIPE], [/* Define to 1 if pipe is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_PIPE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_PIPE2], [/* Define to 1 if pipe2 is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_PIPE2]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_PREAD], [/* Define to 1 if pread is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_PREAD]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_PWRITE], [/* Define to 1 if pwrite is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_PWRITE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_READLINK], [/* Define to 1 if readlink is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_READLINK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_READLINKAT], [/* Define to 1 if readlinkat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_READLINKAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_RMDIR], [/* Define to 1 if rmdir is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_RMDIR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SETHOSTNAME], [/* Define to 1 if sethostname is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SETHOSTNAME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SLEEP], [/* Define to 1 if sleep is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SLEEP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SYMLINK], [/* Define to 1 if symlink is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SYMLINK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SYMLINKAT], [/* Define to 1 if symlinkat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SYMLINKAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_TRUNCATE], [/* Define to 1 if truncate is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_TRUNCATE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_TTYNAME_R], [/* Define to 1 if ttyname_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_TTYNAME_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_UNLINK], [/* Define to 1 if unlink is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_UNLINK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_UNLINKAT], [/* Define to 1 if unlinkat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_UNLINKAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_USLEEP], [/* Define to 1 if usleep is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_USLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBUNISTRING_UNISTR_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBUNISTRING_UNISTR_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_UNISTR_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_UNISTR_U8_MBTOUCR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNISTR_U8_MBTOUCR$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_UNISTR_U8_MBTOUCR], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module unistr/u8-mbtoucr shall be considered present. */ +@%:@undef GNULIB_UNISTR_U8_MBTOUCR]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR], [gl_LIBUNISTRING_VERSION_CMP([0.9])]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_UNISTR_U8_UCTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNISTR_U8_UCTOMB$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_UNISTR_U8_UCTOMB], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module unistr/u8-uctomb shall be considered present. */ +@%:@undef GNULIB_UNISTR_U8_UCTOMB]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB], [gl_LIBUNISTRING_VERSION_CMP([0.9])]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBUNISTRING_UNITYPES_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBUNISTRING_UNITYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_UNITYPES_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBUNISTRING_UNIWIDTH_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBUNISTRING_UNIWIDTH_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_UNIWIDTH_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH], [gl_LIBUNISTRING_VERSION_CMP([0.9.6])]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([USE_UNLOCKED_IO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^USE_UNLOCKED_IO$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([USE_UNLOCKED_IO], [/* Define to 1 if you want getc etc. to use unlocked I/O if available. + Unlocked I/O can improve performance in unithreaded apps, but it is not + safe for multithreaded apps. */ +@%:@undef USE_UNLOCKED_IO]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_CLEARERR_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_CLEARERR_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_CLEARERR_UNLOCKED], [/* Define to 1 if you have the declaration of \'clearerr_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_CLEARERR_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_FEOF_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FEOF_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_FEOF_UNLOCKED], [/* Define to 1 if you have the declaration of \'feof_unlocked\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_FEOF_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_FERROR_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FERROR_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_FERROR_UNLOCKED], [/* Define to 1 if you have the declaration of \'ferror_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_FERROR_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_FFLUSH_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FFLUSH_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_FFLUSH_UNLOCKED], [/* Define to 1 if you have the declaration of \'fflush_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_FFLUSH_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_FGETS_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FGETS_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_FGETS_UNLOCKED], [/* Define to 1 if you have the declaration of \'fgets_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_FGETS_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_FPUTC_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FPUTC_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_FPUTC_UNLOCKED], [/* Define to 1 if you have the declaration of \'fputc_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_FPUTC_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_FPUTS_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FPUTS_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_FPUTS_UNLOCKED], [/* Define to 1 if you have the declaration of \'fputs_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_FPUTS_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_FREAD_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FREAD_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_FREAD_UNLOCKED], [/* Define to 1 if you have the declaration of \'fread_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_FREAD_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_FWRITE_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FWRITE_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_FWRITE_UNLOCKED], [/* Define to 1 if you have the declaration of \'fwrite_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_FWRITE_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_GETCHAR_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETCHAR_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_GETCHAR_UNLOCKED], [/* Define to 1 if you have the declaration of \'getchar_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_GETCHAR_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_PUTC_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_PUTC_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_PUTC_UNLOCKED], [/* Define to 1 if you have the declaration of \'putc_unlocked\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_PUTC_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_PUTCHAR_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_PUTCHAR_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_PUTCHAR_UNLOCKED], [/* Define to 1 if you have the declaration of \'putchar_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_PUTCHAR_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_UNSETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_UNSETENV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_UNSETENV], [/* Define to 1 if you have the declaration of \'unsetenv\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_UNSETENV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNSETENV], [/* Define to 1 if you have the \'unsetenv\' function. */ +@%:@undef HAVE_UNSETENV]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UNSETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UNSETENV$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([VOID_UNSETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^VOID_UNSETENV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([VOID_UNSETENV], [/* Define to 1 if unsetenv returns void instead of int. */ +@%:@undef VOID_UNSETENV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_UNSETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_UNSETENV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_UNSETENV], [/* Define to 1 when the gnulib module unsetenv should be tested. */ +@%:@undef GNULIB_TEST_UNSETENV]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_C_VARARRAYS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_C_VARARRAYS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_C_VARARRAYS], [/* Define to 1 if C supports variable-length arrays. */ +@%:@undef HAVE_C_VARARRAYS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([__STDC_NO_VLA__]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^__STDC_NO_VLA__$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([__STDC_NO_VLA__], [/* Define to 1 if C does not support variable-length arrays, and if the + compiler does not already define this. */ +@%:@undef __STDC_NO_VLA__]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_VASNPRINTF], [/* Define to 1 if you have the \'vasnprintf\' function. */ +@%:@undef HAVE_VASNPRINTF]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_VASNPRINTF], [/* Define to 1 if you have the \'vasnprintf\' function. */ +@%:@undef HAVE_VASNPRINTF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([REPLACE_VASNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VASNPRINTF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([REPLACE_VASNPRINTF], [/* Define if vasnprintf exists but is overridden by gnulib. */ +@%:@undef REPLACE_VASNPRINTF]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_FEATURES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_FEATURES_H]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FEATURES_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FEATURES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FEATURES_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([ptrdiff_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ptrdiff_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([ptrdiff_t], [/* Define as the type of the result of subtracting two pointers, if the system + doesn\'t define it. */ +@%:@undef ptrdiff_t]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INTTYPES_H_WITH_UINTMAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_INTTYPES_H_WITH_UINTMAX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_INTTYPES_H_WITH_UINTMAX], [/* Define if exists, doesn\'t clash with , and + declares uintmax_t. */ +@%:@undef HAVE_INTTYPES_H_WITH_UINTMAX]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STDINT_H_WITH_UINTMAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STDINT_H_WITH_UINTMAX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STDINT_H_WITH_UINTMAX], [/* Define if exists, doesn\'t clash with , and declares + uintmax_t. */ +@%:@undef HAVE_STDINT_H_WITH_UINTMAX]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INTMAX_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_INTMAX_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_INTMAX_T], [/* Define if you have the \'intmax_t\' type in or . */ +@%:@undef HAVE_INTMAX_T]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([intmax_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^intmax_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([intmax_t], [/* Define to long or long long if and don\'t define. */ +@%:@undef intmax_t]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SNPRINTF], [/* Define to 1 if you have the \'snprintf\' function. */ +@%:@undef HAVE_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SNPRINTF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRNLEN], [/* Define to 1 if you have the \'strnlen\' function. */ +@%:@undef HAVE_STRNLEN]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRNLEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCSLEN], [/* Define to 1 if you have the \'wcslen\' function. */ +@%:@undef HAVE_WCSLEN]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WCSLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSLEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCSNLEN], [/* Define to 1 if you have the \'wcsnlen\' function. */ +@%:@undef HAVE_WCSNLEN]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WCSNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSNLEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBRTOWC], [/* Define to 1 if you have the \'mbrtowc\' function. */ +@%:@undef HAVE_MBRTOWC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MBRTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBRTOWC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCRTOMB], [/* Define to 1 if you have the \'wcrtomb\' function. */ +@%:@undef HAVE_WCRTOMB]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WCRTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCRTOMB$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL__SNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL__SNPRINTF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL__SNPRINTF], [/* Define to 1 if you have the declaration of \'_snprintf\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL__SNPRINTF]) +m4trace:configure.ac:42: -1- AH_OUTPUT([WORDS_BIGENDIAN], [/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([AC_APPLE_UNIVERSAL_BUILD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^AC_APPLE_UNIVERSAL_BUILD$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([AC_APPLE_UNIVERSAL_BUILD], [/* Define if building universal (internal helper macro) */ +@%:@undef AC_APPLE_UNIVERSAL_BUILD]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([DBL_EXPBIT0_WORD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^DBL_EXPBIT0_WORD$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([DBL_EXPBIT0_WORD], [/* Define as the word index where to find the exponent of \'double\'. */ +@%:@undef DBL_EXPBIT0_WORD]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([DBL_EXPBIT0_BIT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^DBL_EXPBIT0_BIT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([DBL_EXPBIT0_BIT], [/* Define as the bit index in the word where to find bit 0 of the exponent of + \'double\'. */ +@%:@undef DBL_EXPBIT0_BIT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SNPRINTF], [/* Define to 1 if you have the \'snprintf\' function. */ +@%:@undef HAVE_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SNPRINTF_RETVAL_C99]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SNPRINTF_RETVAL_C99$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SNPRINTF_RETVAL_C99], [/* Define if the return value of the snprintf function is the number of of + bytes (excluding the terminating NUL) that would have been produced if the + buffer had been large enough. */ +@%:@undef HAVE_SNPRINTF_RETVAL_C99]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_VASPRINTF], [/* Define to 1 if you have the \'vasprintf\' function. */ +@%:@undef HAVE_VASPRINTF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_VASPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_VASPRINTF$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_VASPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_VASPRINTF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_VASPRINTF], [/* Define to 1 when the gnulib module vasprintf should be tested. */ +@%:@undef GNULIB_TEST_VASPRINTF]) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--flag=asprintf:2:c-format]) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--flag=vasprintf:2:c-format]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_PACKAGER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PACKAGE_PACKAGER$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([PACKAGE_PACKAGER], [/* String identifying the packager of this software */ +@%:@undef PACKAGE_PACKAGER]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_PACKAGER_VERSION]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PACKAGE_PACKAGER_VERSION$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([PACKAGE_PACKAGER_VERSION], [/* Packager-specific version information */ +@%:@undef PACKAGE_PACKAGER_VERSION]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_PACKAGER_BUG_REPORTS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PACKAGE_PACKAGER_BUG_REPORTS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([PACKAGE_PACKAGER_BUG_REPORTS], [/* Packager info for bug reports (URL/e-mail/...) */ +@%:@undef PACKAGE_PACKAGER_BUG_REPORTS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCHAR_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WCHAR_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_WCHAR_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_WCHAR_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_WCHAR_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_WCHAR_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_WCHAR_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_WCHAR_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCHAR_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCHAR_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCHAR_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINT_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINT_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINT_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_BTOWC], [/* Define to 1 if btowc is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_BTOWC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCTOB], [/* Define to 1 if wctob is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCTOB]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MBSINIT], [/* Define to 1 if mbsinit is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MBSINIT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MBRTOWC], [/* Define to 1 if mbrtowc is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MBRTOWC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MBRLEN], [/* Define to 1 if mbrlen is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MBRLEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MBSRTOWCS], [/* Define to 1 if mbsrtowcs is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MBSRTOWCS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MBSNRTOWCS], [/* Define to 1 if mbsnrtowcs is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MBSNRTOWCS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCRTOMB], [/* Define to 1 if wcrtomb is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCRTOMB]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSRTOMBS], [/* Define to 1 if wcsrtombs is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSRTOMBS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSNRTOMBS], [/* Define to 1 if wcsnrtombs is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSNRTOMBS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCWIDTH], [/* Define to 1 if wcwidth is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCWIDTH]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WMEMCHR], [/* Define to 1 if wmemchr is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WMEMCHR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WMEMCMP], [/* Define to 1 if wmemcmp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WMEMCMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WMEMCPY], [/* Define to 1 if wmemcpy is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WMEMCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WMEMMOVE], [/* Define to 1 if wmemmove is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WMEMMOVE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WMEMSET], [/* Define to 1 if wmemset is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WMEMSET]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSLEN], [/* Define to 1 if wcslen is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSLEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSNLEN], [/* Define to 1 if wcsnlen is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSNLEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSCPY], [/* Define to 1 if wcscpy is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCPCPY], [/* Define to 1 if wcpcpy is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCPCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSNCPY], [/* Define to 1 if wcsncpy is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSNCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCPNCPY], [/* Define to 1 if wcpncpy is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCPNCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSCAT], [/* Define to 1 if wcscat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSCAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSNCAT], [/* Define to 1 if wcsncat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSNCAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSCMP], [/* Define to 1 if wcscmp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSCMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSNCMP], [/* Define to 1 if wcsncmp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSNCMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSCASECMP], [/* Define to 1 if wcscasecmp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSCASECMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSNCASECMP], [/* Define to 1 if wcsncasecmp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSNCASECMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSCOLL], [/* Define to 1 if wcscoll is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSCOLL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSXFRM], [/* Define to 1 if wcsxfrm is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSXFRM]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSDUP], [/* Define to 1 if wcsdup is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSDUP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSCHR], [/* Define to 1 if wcschr is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSCHR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSRCHR], [/* Define to 1 if wcsrchr is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSRCHR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSCSPN], [/* Define to 1 if wcscspn is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSCSPN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSSPN], [/* Define to 1 if wcsspn is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSSPN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSPBRK], [/* Define to 1 if wcspbrk is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSPBRK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSSTR], [/* Define to 1 if wcsstr is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSSTR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSTOK], [/* Define to 1 if wcstok is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSTOK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSWIDTH], [/* Define to 1 if wcswidth is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSWIDTH]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSFTIME], [/* Define to 1 if wcsftime is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSFTIME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSINIT], [/* Define to 1 if you have the \'mbsinit\' function. */ +@%:@undef HAVE_MBSINIT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBRTOWC], [/* Define to 1 if you have the \'mbrtowc\' function. */ +@%:@undef HAVE_MBRTOWC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCRTOMB], [/* Define to 1 if you have the \'wcrtomb\' function. */ +@%:@undef HAVE_WCRTOMB]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_WCRTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_WCRTOMB$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_WCRTOMB], [/* Define to 1 if you have the declaration of \'wcrtomb\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_WCRTOMB]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_WCRTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_WCRTOMB$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_WCRTOMB], [/* Define to 1 when the gnulib module wcrtomb should be tested. */ +@%:@undef GNULIB_TEST_WCRTOMB]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISWCNTRL], [/* Define to 1 if you have the \'iswcntrl\' function. */ +@%:@undef HAVE_ISWCNTRL]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_ISWCNTRL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_ISWCNTRL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ISWCNTRL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINT_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINT_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINT_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCTYPE_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_WCTYPE_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_WCTYPE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_WCTYPE_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCTYPE_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_ISWCNTRL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_ISWCNTRL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ISWCNTRL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TOWLOWER], [/* Define to 1 if you have the \'towlower\' function. */ +@%:@undef HAVE_TOWLOWER]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TOWLOWER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TOWLOWER$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_TOWLOWER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_TOWLOWER$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_TOWLOWER], [/* Define to 1 if you have the declaration of \'towlower\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_TOWLOWER]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_TOWLOWER]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_TOWLOWER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TOWLOWER$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCTYPE], [/* Define to 1 if wctype is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCTYPE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_ISWCTYPE], [/* Define to 1 if iswctype is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_ISWCTYPE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCTRANS], [/* Define to 1 if wctrans is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCTRANS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_TOWCTRANS], [/* Define to 1 if towctrans is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_TOWCTRANS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCHAR_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WCHAR_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCWIDTH], [/* Define to 1 if you have the \'wcwidth\' function. */ +@%:@undef HAVE_WCWIDTH]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_WCWIDTH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_WCWIDTH$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_WCWIDTH], [/* Define to 1 if you have the declaration of \'wcwidth\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_WCWIDTH]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_WCWIDTH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_WCWIDTH$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_WCWIDTH], [/* Define to 1 when the gnulib module wcwidth should be tested. */ +@%:@undef GNULIB_TEST_WCWIDTH]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDINT_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STDINT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STDINT_H$]) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--flag=xasprintf:1:c-format]) +m4trace:configure.ac:42: -1- AC_SUBST([gltests_WITNESS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([gltests_WITNESS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^gltests_WITNESS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SOCKET]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SOCKET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SOCKET$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_CONNECT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_CONNECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CONNECT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_ACCEPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_ACCEPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ACCEPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_BIND]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_BIND]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_BIND$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETPEERNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETPEERNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETPEERNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETSOCKNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETSOCKNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETSOCKNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETSOCKOPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETSOCKOPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETSOCKOPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_LISTEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_LISTEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LISTEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RECV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RECV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RECV$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SEND]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SEND]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SEND$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RECVFROM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RECVFROM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RECVFROM$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SENDTO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SENDTO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SENDTO$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SETSOCKOPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SETSOCKOPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SETSOCKOPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SHUTDOWN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SHUTDOWN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SHUTDOWN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_ACCEPT4]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_ACCEPT4]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ACCEPT4$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRUCT_SOCKADDR_STORAGE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SA_FAMILY_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SA_FAMILY_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SA_FAMILY_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_ACCEPT4]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_ACCEPT4]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ACCEPT4$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([_POSIX_PII_SOCKET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^_POSIX_PII_SOCKET$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([_POSIX_PII_SOCKET], [/* Define to 1 in order to get the POSIX compatible declarations of socket + functions. */ +@%:@undef _POSIX_PII_SOCKET]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SHUTDOWN], [/* Define to 1 if you have the \'shutdown\' function. */ +@%:@undef HAVE_SHUTDOWN]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SHUTDOWN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SHUTDOWN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WS2TCPIP_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WS2TCPIP_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WS2TCPIP_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WS2TCPIP_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SYS_SOCKET_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_SOCKET_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_SOCKET_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WS2TCPIP_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WS2TCPIP_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WS2TCPIP_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_STORAGE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_SOCKADDR_STORAGE], [/* Define to 1 if the system has the type \'struct sockaddr_storage\'. */ +@%:@undef HAVE_STRUCT_SOCKADDR_STORAGE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SA_FAMILY_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SA_FAMILY_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SA_FAMILY_T], [/* Define to 1 if the system has the type \'sa_family_t\'. */ +@%:@undef HAVE_SA_FAMILY_T]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY], [/* Define to 1 if \'ss_family\' is a member of \'struct sockaddr_storage\'. */ +@%:@undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WINSOCK2_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SOCKET], [/* Define to 1 if socket is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SOCKET]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_CONNECT], [/* Define to 1 if connect is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_CONNECT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_ACCEPT], [/* Define to 1 if accept is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_ACCEPT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_BIND], [/* Define to 1 if bind is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_BIND]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETPEERNAME], [/* Define to 1 if getpeername is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETPEERNAME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETSOCKNAME], [/* Define to 1 if getsockname is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETSOCKNAME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETSOCKOPT], [/* Define to 1 if getsockopt is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETSOCKOPT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_LISTEN], [/* Define to 1 if listen is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_LISTEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_RECV], [/* Define to 1 if recv is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_RECV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SEND], [/* Define to 1 if send is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SEND]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_RECVFROM], [/* Define to 1 if recvfrom is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_RECVFROM]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SENDTO], [/* Define to 1 if sendto is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SENDTO]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SETSOCKOPT], [/* Define to 1 if setsockopt is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SETSOCKOPT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SHUTDOWN], [/* Define to 1 if shutdown is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SHUTDOWN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_ACCEPT4], [/* Define to 1 if accept4 is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_ACCEPT4]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_ACCEPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_ACCEPT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_ACCEPT], [/* Define to 1 when the gnulib module accept should be tested. */ +@%:@undef GNULIB_TEST_ACCEPT]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_INET_NTOP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_INET_NTOP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_INET_NTOP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_INET_PTON]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_INET_PTON]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_INET_PTON$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_INET_NTOP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_INET_NTOP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_INET_NTOP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_INET_PTON]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_INET_PTON]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_INET_PTON$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_INET_NTOP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_INET_NTOP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_INET_NTOP$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_INET_PTON]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_INET_PTON]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_INET_PTON$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ARPA_INET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_ARPA_INET_H]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_ARPA_INET_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_ARPA_INET_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ARPA_INET_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ARPA_INET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_ARPA_INET_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_ARPA_INET_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_ARPA_INET_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_ARPA_INET_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_INET_NTOP], [/* Define to 1 if inet_ntop is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_INET_NTOP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_INET_PTON], [/* Define to 1 if inet_pton is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_INET_PTON]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_BIND]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_BIND$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_BIND], [/* Define to 1 when the gnulib module bind should be tested. */ +@%:@undef GNULIB_TEST_BIND]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_TR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_TR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_TR_UTF8$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_CONNECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_CONNECT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_CONNECT], [/* Define to 1 when the gnulib module connect should be tested. */ +@%:@undef GNULIB_TEST_CONNECT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_FDOPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_FDOPEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_FDOPEN], [/* Define to 1 when the gnulib module fdopen should be tested. */ +@%:@undef GNULIB_TEST_FDOPEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_FTRUNCATE], [/* Define to 1 if you have the \'ftruncate\' function. */ +@%:@undef HAVE_FTRUNCATE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_CHSIZE], [/* Define to 1 if you have the \'chsize\' function. */ +@%:@undef HAVE_CHSIZE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CHSIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_CHSIZE$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_FTRUNCATE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_FTRUNCATE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_FTRUNCATE], [/* Define to 1 when the gnulib module ftruncate should be tested. */ +@%:@undef GNULIB_TEST_FTRUNCATE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_GETCWD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_GETCWD$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_GETCWD], [/* Define to 1 when the gnulib module getcwd should be tested. */ +@%:@undef GNULIB_TEST_GETCWD]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETPAGESIZE], [/* Define to 1 if you have the \'getpagesize\' function. */ +@%:@undef HAVE_GETPAGESIZE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETPAGESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETPAGESIZE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_OS_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_OS_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_OS_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_PARAM_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_PARAM_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_PARAM_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_PARAM_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_GETPAGESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_GETPAGESIZE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_GETPAGESIZE], [/* Define to 1 when the gnulib module getpagesize should be tested. */ +@%:@undef GNULIB_TEST_GETPAGESIZE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WINSOCK2_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_INET_PTON]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_INET_PTON$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_INET_PTON], [/* Define to 1 if you have the declaration of \'inet_pton\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_INET_PTON]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_INET_PTON], [/* Define to 1 if you have the \'inet_pton\' function. */ +@%:@undef HAVE_INET_PTON]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_PTON]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_INET_PTON$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_NETDB_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_NETDB_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_INET_PTON]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_INET_PTON$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_INET_PTON], [/* Define to 1 if you have the declaration of \'inet_pton\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_INET_PTON]) +m4trace:configure.ac:42: -1- AC_SUBST([INET_PTON_LIB]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([INET_PTON_LIB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INET_PTON_LIB$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_NETINET_IN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_NETINET_IN_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IPV4]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_IPV4$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_IPV4], [/* Define to 1 if defines AF_INET. */ +@%:@undef HAVE_IPV4]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IPV6]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_IPV6$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_IPV6], [/* Define to 1 if defines AF_INET6. */ +@%:@undef HAVE_IPV6]) +m4trace:configure.ac:42: -1- AH_OUTPUT([WORDS_BIGENDIAN], [/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([WORDS_BIGENDIAN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WORDS_BIGENDIAN$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([AC_APPLE_UNIVERSAL_BUILD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^AC_APPLE_UNIVERSAL_BUILD$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([AC_APPLE_UNIVERSAL_BUILD], [/* Define if building universal (internal helper macro) */ +@%:@undef AC_APPLE_UNIVERSAL_BUILD]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_IOCTL], [/* Define to 1 if you have the \'ioctl\' function. */ +@%:@undef HAVE_IOCTL]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IOCTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_IOCTL$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_IOCTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_IOCTL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_IOCTL], [/* Define to 1 when the gnulib module ioctl should be tested. */ +@%:@undef GNULIB_TEST_IOCTL]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_LISTEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_LISTEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_LISTEN], [/* Define to 1 when the gnulib module listen should be tested. */ +@%:@undef GNULIB_TEST_LISTEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_NEWLOCALE], [/* Define to 1 if you have the \'newlocale\' function. */ +@%:@undef HAVE_NEWLOCALE]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_JA]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_JA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_JA$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_ZH_CN$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_TR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_TR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_TR_UTF8$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_JA]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_JA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_JA$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_ZH_CN$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_ZH_CN$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MAP_ANONYMOUS], [/* Define to a substitute value for mmap()\'s MAP_ANONYMOUS flag. */ +@%:@undef MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MAP_ANONYMOUS], [/* Define to 1 if mmap()\'s MAP_ANONYMOUS flag is available after including + config.h and . */ +@%:@undef HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_MMAN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_MMAN_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MPROTECT], [/* Define to 1 if you have the \'mprotect\' function. */ +@%:@undef HAVE_MPROTECT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TIME_H]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PSELECT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PSELECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PSELECT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SELECT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SELECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SELECT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_PSELECT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_PSELECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PSELECT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_PSELECT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_PSELECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PSELECT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_SELECT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_SELECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SELECT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SELECT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SELECT_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SYS_SELECT_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SYS_SELECT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_SELECT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_SELECT_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_SELECT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_SELECT_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WINSOCK2_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_PSELECT], [/* Define to 1 if pselect is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_PSELECT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SELECT], [/* Define to 1 if select is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SELECT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WINSOCK2_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([WINDOWS_SOCKETS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_SOCKETS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([WINDOWS_SOCKETS], [/* Define if WSAStartup is needed. */ +@%:@undef WINDOWS_SOCKETS]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBSOCKET]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBSOCKET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBSOCKET$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SELECT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SELECT_H]) +m4trace:configure.ac:42: -1- AC_SUBST([LIB_SELECT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIB_SELECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIB_SELECT$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIB_NANOSLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIB_NANOSLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIB_NANOSLEEP$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_BUG_BIG_NANOSLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_BUG_BIG_NANOSLEEP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_BUG_BIG_NANOSLEEP], [/* Define to 1 if nanosleep mishandles large arguments. */ +@%:@undef HAVE_BUG_BIG_NANOSLEEP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SELECT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SELECT_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_NANOSLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_NANOSLEEP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_NANOSLEEP], [/* Define to 1 when the gnulib module nanosleep should be tested. */ +@%:@undef GNULIB_TEST_NANOSLEEP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_NETINET_IN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_NETINET_IN_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NETINET_IN_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_NETINET_IN_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_NETINET_IN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_NETINET_IN_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_NETINET_IN_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_NETINET_IN_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_NETINET_IN_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_NETINET_IN_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_NETINET_IN_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_NETINET_IN_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NETINET_IN_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NETINET_IN_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NETINET_IN_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_NETINET_IN_H], [test -n "$NETINET_IN_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_NETINET_IN_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_NETINET_IN_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_NETINET_IN_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_NETINET_IN_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_NETINET_IN_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_NETINET_IN_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_NETINET_IN_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_NETINET_IN_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_PERROR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_PERROR$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_PERROR], [/* Define to 1 when the gnulib module perror should be tested. */ +@%:@undef GNULIB_TEST_PERROR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_PIPE], [/* Define to 1 if you have the \'pipe\' function. */ +@%:@undef HAVE_PIPE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_PIPE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_PIPE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_PIPE], [/* Define to 1 when the gnulib module pipe should be tested. */ +@%:@undef GNULIB_TEST_PIPE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL__PUTENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL__PUTENV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL__PUTENV], [/* Define to 1 if you have the declaration of \'_putenv\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL__PUTENV]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_PUTENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_PUTENV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_PUTENV], [/* Define to 1 when the gnulib module putenv should be tested. */ +@%:@undef GNULIB_TEST_PUTENV]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MAP_ANONYMOUS], [/* Define to a substitute value for mmap()\'s MAP_ANONYMOUS flag. */ +@%:@undef MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MAP_ANONYMOUS], [/* Define to 1 if mmap()\'s MAP_ANONYMOUS flag is available after including + config.h and . */ +@%:@undef HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_MMAN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_MMAN_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MPROTECT], [/* Define to 1 if you have the \'mprotect\' function. */ +@%:@undef HAVE_MPROTECT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MAP_ANONYMOUS], [/* Define to a substitute value for mmap()\'s MAP_ANONYMOUS flag. */ +@%:@undef MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MAP_ANONYMOUS], [/* Define to 1 if mmap()\'s MAP_ANONYMOUS flag is available after including + config.h and . */ +@%:@undef HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_MMAN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_MMAN_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MPROTECT], [/* Define to 1 if you have the \'mprotect\' function. */ +@%:@undef HAVE_MPROTECT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SELECT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SELECT_H]) +m4trace:configure.ac:42: -1- AC_SUBST([LIB_SELECT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIB_SELECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIB_SELECT$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SELECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SELECT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SELECT], [/* Define to 1 when the gnulib module select should be tested. */ +@%:@undef GNULIB_TEST_SELECT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_WAIT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_WAIT_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SETLOCALE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SETLOCALE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SETLOCALE], [/* Define to 1 when the gnulib module setlocale should be tested. */ +@%:@undef GNULIB_TEST_SETLOCALE]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_JA]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_JA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_JA$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_ZH_CN$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SETSOCKOPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SETSOCKOPT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SETSOCKOPT], [/* Define to 1 when the gnulib module setsockopt should be tested. */ +@%:@undef GNULIB_TEST_SETSOCKOPT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_SLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SLEEP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_SLEEP], [/* Define to 1 if you have the declaration of \'sleep\', and to 0 if you don\'t. + */ +@%:@undef HAVE_DECL_SLEEP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SLEEP], [/* Define to 1 if you have the \'sleep\' function. */ +@%:@undef HAVE_SLEEP]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SLEEP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SLEEP], [/* Define to 1 when the gnulib module sleep should be tested. */ +@%:@undef GNULIB_TEST_SLEEP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SNPRINTF], [/* Define to 1 if you have the \'snprintf\' function. */ +@%:@undef HAVE_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SNPRINTF$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_SNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SNPRINTF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_SNPRINTF], [/* Define to 1 if you have the declaration of \'snprintf\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SNPRINTF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SNPRINTF], [/* Define to 1 when the gnulib module snprintf should be tested. */ +@%:@undef GNULIB_TEST_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_SNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SNPRINTF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_SNPRINTF], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module snprintf shall be considered present. */ +@%:@undef GNULIB_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SOCKET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SOCKET$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SOCKET], [/* Define to 1 when the gnulib module socket should be tested. */ +@%:@undef GNULIB_TEST_SOCKET]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([socklen_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^socklen_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([socklen_t], [/* type to use in place of socklen_t if not defined */ +@%:@undef socklen_t]) +m4trace:configure.ac:42: -1- AC_SUBST([STDALIGN_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([STDALIGN_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STDALIGN_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_STDALIGN_H], [test -n "$STDALIGN_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDALIGN_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDALIGN_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDALIGN_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDALIGN_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDALIGN_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDALIGN_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDALIGN_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDALIGN_H_FALSE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE___XPG_STRERROR_R], [/* Define to 1 if you have the \'__xpg_strerror_r\' function. */ +@%:@undef HAVE___XPG_STRERROR_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_CATGETS], [/* Define to 1 if you have the \'catgets\' function. */ +@%:@undef HAVE_CATGETS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SNPRINTF], [/* Define to 1 if you have the \'snprintf\' function. */ +@%:@undef HAVE_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_STRERROR_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STRERROR_R$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_STRERROR_R], [/* Define to 1 when the gnulib module strerror_r should be tested. */ +@%:@undef GNULIB_TEST_STRERROR_R]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_STRERROR_R_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRERROR_R_POSIX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_STRERROR_R_POSIX], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module strerror_r-posix shall be considered present. */ +@%:@undef GNULIB_STRERROR_R_POSIX]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MAP_ANONYMOUS], [/* Define to a substitute value for mmap()\'s MAP_ANONYMOUS flag. */ +@%:@undef MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MAP_ANONYMOUS], [/* Define to 1 if mmap()\'s MAP_ANONYMOUS flag is available after including + config.h and . */ +@%:@undef HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_MMAN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_MMAN_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MPROTECT], [/* Define to 1 if you have the \'mprotect\' function. */ +@%:@undef HAVE_MPROTECT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYMLINK], [/* Define to 1 if you have the \'symlink\' function. */ +@%:@undef HAVE_SYMLINK]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SYMLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SYMLINK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SYMLINK], [/* Define to 1 when the gnulib module symlink should be tested. */ +@%:@undef GNULIB_TEST_SYMLINK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_IOCTL_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_IOCTL_H]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_IOCTL_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_IOCTL_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_IOCTL_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_IOCTL_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_IOCTL_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SYS_IOCTL_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SYS_IOCTL_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_IOCTL_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_IOCTL], [/* Define to 1 if ioctl is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_IOCTL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SHUTDOWN], [/* Define to 1 if you have the \'shutdown\' function. */ +@%:@undef HAVE_SHUTDOWN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_UIO_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_UIO_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SYS_UIO_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SYS_UIO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_UIO_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_UIO_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_UIO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_UIO_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([abs_aux_dir]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([abs_aux_dir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^abs_aux_dir$]) +m4trace:configure.ac:42: -1- AC_SUBST([abs_aux_dir]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([abs_aux_dir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^abs_aux_dir$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_JA]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_JA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_JA$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_ZH_CN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCTOB], [/* Define to 1 if you have the \'wctob\' function. */ +@%:@undef HAVE_WCTOB]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_WCTOB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_WCTOB$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_WCTOB], [/* Define to 1 if you have the declaration of \'wctob\', and to 0 if you don\'t. + */ +@%:@undef HAVE_DECL_WCTOB]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_WCTOB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_WCTOB$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_WCTOB], [/* Define to 1 when the gnulib module wctob should be tested. */ +@%:@undef GNULIB_TEST_WCTOB]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_WCTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_WCTOMB$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_WCTOMB], [/* Define to 1 when the gnulib module wctomb should be tested. */ +@%:@undef GNULIB_TEST_WCTOMB]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBDIFFUTILS_LIBDEPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBDIFFUTILS_LIBDEPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBDIFFUTILS_LIBDEPS$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBDIFFUTILS_LTLIBDEPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBDIFFUTILS_LTLIBDEPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBDIFFUTILS_LTLIBDEPS$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBTESTS_LIBDEPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBTESTS_LIBDEPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBTESTS_LIBDEPS$]) +m4trace:configure.ac:60: -1- AC_SUBST([WERROR_CFLAGS]) +m4trace:configure.ac:60: -1- AC_SUBST_TRACE([WERROR_CFLAGS]) +m4trace:configure.ac:60: -1- m4_pattern_allow([^WERROR_CFLAGS$]) +m4trace:configure.ac:61: -1- AC_SUBST([WERROR_CFLAGS]) +m4trace:configure.ac:61: -1- AC_SUBST_TRACE([WERROR_CFLAGS]) +m4trace:configure.ac:61: -1- m4_pattern_allow([^WERROR_CFLAGS$]) +m4trace:configure.ac:98: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:98: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:98: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:100: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:100: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:100: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:101: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:101: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:101: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:102: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:102: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:102: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:103: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:103: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:103: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:104: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:104: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:104: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:108: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:108: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:108: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:110: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:110: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:110: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:111: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:111: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:111: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:112: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:112: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:112: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:114: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:114: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:114: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:116: -1- AC_DEFINE_TRACE_LITERAL([lint]) +m4trace:configure.ac:116: -1- m4_pattern_allow([^lint$]) +m4trace:configure.ac:116: -1- AH_OUTPUT([lint], [/* Define to 1 if the compiler is checking for lint. */ +@%:@undef lint]) +m4trace:configure.ac:117: -1- AC_DEFINE_TRACE_LITERAL([_FORTIFY_SOURCE]) +m4trace:configure.ac:117: -1- m4_pattern_allow([^_FORTIFY_SOURCE$]) +m4trace:configure.ac:117: -1- AH_OUTPUT([_FORTIFY_SOURCE], [/* enable compile-time and run-time bounds-checking, and some warnings */ +@%:@undef _FORTIFY_SOURCE]) +m4trace:configure.ac:119: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_PORTCHECK]) +m4trace:configure.ac:119: -1- m4_pattern_allow([^GNULIB_PORTCHECK$]) +m4trace:configure.ac:119: -1- AH_OUTPUT([GNULIB_PORTCHECK], [/* enable some gnulib portability checks */ +@%:@undef GNULIB_PORTCHECK]) +m4trace:configure.ac:129: -1- AC_SUBST([GNULIB_WARN_CFLAGS]) +m4trace:configure.ac:129: -1- AC_SUBST_TRACE([GNULIB_WARN_CFLAGS]) +m4trace:configure.ac:129: -1- m4_pattern_allow([^GNULIB_WARN_CFLAGS$]) +m4trace:configure.ac:132: -1- AH_OUTPUT([inline], [/* Define to \'__inline__\' or \'__inline\' if that\'s what the C compiler + calls it, or to nothing if \'inline\' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif]) +m4trace:configure.ac:133: -1- AC_DEFINE_TRACE_LITERAL([HAVE_C_VARARRAYS]) +m4trace:configure.ac:133: -1- m4_pattern_allow([^HAVE_C_VARARRAYS$]) +m4trace:configure.ac:133: -1- AH_OUTPUT([HAVE_C_VARARRAYS], [/* Define to 1 if C supports variable-length arrays. */ +@%:@undef HAVE_C_VARARRAYS]) +m4trace:configure.ac:133: -1- AC_DEFINE_TRACE_LITERAL([__STDC_NO_VLA__]) +m4trace:configure.ac:133: -1- m4_pattern_allow([^__STDC_NO_VLA__$]) +m4trace:configure.ac:133: -1- AH_OUTPUT([__STDC_NO_VLA__], [/* Define to 1 if C does not support variable-length arrays, and if the + compiler does not already define this. */ +@%:@undef __STDC_NO_VLA__]) +m4trace:configure.ac:135: -1- AC_DEFINE_TRACE_LITERAL([DEFAULT_EDITOR_PROGRAM]) +m4trace:configure.ac:135: -1- m4_pattern_allow([^DEFAULT_EDITOR_PROGRAM$]) +m4trace:configure.ac:135: -1- AH_OUTPUT([DEFAULT_EDITOR_PROGRAM], [/* Name of editor program, unless overridden. */ +@%:@undef DEFAULT_EDITOR_PROGRAM]) +m4trace:configure.ac:138: -1- AC_SUBST([PR_PROGRAM]) +m4trace:configure.ac:138: -1- AC_SUBST_TRACE([PR_PROGRAM]) +m4trace:configure.ac:138: -1- m4_pattern_allow([^PR_PROGRAM$]) +m4trace:configure.ac:139: -1- AC_DEFINE_TRACE_LITERAL([PR_PROGRAM]) +m4trace:configure.ac:139: -1- m4_pattern_allow([^PR_PROGRAM$]) +m4trace:configure.ac:139: -1- AH_OUTPUT([PR_PROGRAM], [/* Name of "pr" program. */ +@%:@undef PR_PROGRAM]) +m4trace:configure.ac:141: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_BLKSIZE]) +m4trace:configure.ac:141: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_BLKSIZE$]) +m4trace:configure.ac:141: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_BLKSIZE], [/* Define to 1 if \'st_blksize\' is a member of \'struct stat\'. */ +@%:@undef HAVE_STRUCT_STAT_ST_BLKSIZE]) +m4trace:configure.ac:142: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_RDEV]) +m4trace:configure.ac:142: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_RDEV$]) +m4trace:configure.ac:142: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_RDEV], [/* Define to 1 if \'st_rdev\' is a member of \'struct stat\'. */ +@%:@undef HAVE_STRUCT_STAT_ST_RDEV]) +m4trace:configure.ac:143: -1- AH_OUTPUT([HAVE_DIRENT_H], [/* Define to 1 if you have the header file, and it defines \'DIR\'. + */ +@%:@undef HAVE_DIRENT_H]) +m4trace:configure.ac:143: -1- AH_OUTPUT([HAVE_SYS_NDIR_H], [/* Define to 1 if you have the header file, and it defines \'DIR\'. + */ +@%:@undef HAVE_SYS_NDIR_H]) +m4trace:configure.ac:143: -1- AH_OUTPUT([HAVE_SYS_DIR_H], [/* Define to 1 if you have the header file, and it defines \'DIR\'. + */ +@%:@undef HAVE_SYS_DIR_H]) +m4trace:configure.ac:143: -1- AH_OUTPUT([HAVE_NDIR_H], [/* Define to 1 if you have the header file, and it defines \'DIR\'. */ +@%:@undef HAVE_NDIR_H]) +m4trace:configure.ac:144: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_WAIT_H]) +m4trace:configure.ac:144: -1- m4_pattern_allow([^HAVE_SYS_WAIT_H$]) +m4trace:configure.ac:144: -1- AH_OUTPUT([HAVE_SYS_WAIT_H], [/* Define to 1 if you have that is POSIX.1 compatible. */ +@%:@undef HAVE_SYS_WAIT_H]) +m4trace:configure.ac:145: -1- AC_DEFINE_TRACE_LITERAL([pid_t]) +m4trace:configure.ac:145: -1- m4_pattern_allow([^pid_t$]) +m4trace:configure.ac:145: -1- AH_OUTPUT([pid_t], [/* Define as a signed integer type capable of holding a process identifier. */ +@%:@undef pid_t]) +m4trace:configure.ac:147: -1- AH_OUTPUT([HAVE_SIGACTION], [/* Define to 1 if you have the \'sigaction\' function. */ +@%:@undef HAVE_SIGACTION]) +m4trace:configure.ac:147: -1- AH_OUTPUT([HAVE_SIGPROCMASK], [/* Define to 1 if you have the \'sigprocmask\' function. */ +@%:@undef HAVE_SIGPROCMASK]) +m4trace:configure.ac:147: -1- AH_OUTPUT([HAVE_STRCASECOLL], [/* Define to 1 if you have the \'strcasecoll\' function. */ +@%:@undef HAVE_STRCASECOLL]) +m4trace:configure.ac:147: -1- AH_OUTPUT([HAVE_STRICOLL], [/* Define to 1 if you have the \'stricoll\' function. */ +@%:@undef HAVE_STRICOLL]) +m4trace:configure.ac:149: -1- AH_OUTPUT([HAVE_SIGBLOCK], [/* Define to 1 if you have the \'sigblock\' function. */ +@%:@undef HAVE_SIGBLOCK]) +m4trace:configure.ac:149: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SIGBLOCK]) +m4trace:configure.ac:149: -1- m4_pattern_allow([^HAVE_SIGBLOCK$]) +m4trace:configure.ac:151: -1- AC_DEFINE_TRACE_LITERAL([CLOSEDIR_VOID]) +m4trace:configure.ac:151: -1- m4_pattern_allow([^CLOSEDIR_VOID$]) +m4trace:configure.ac:151: -1- AH_OUTPUT([CLOSEDIR_VOID], [/* Define to 1 if the \'closedir\' function returns void instead of int. */ +@%:@undef CLOSEDIR_VOID]) +m4trace:configure.ac:152: -1- AH_OUTPUT([HAVE_VFORK_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_VFORK_H]) +m4trace:configure.ac:152: -1- AH_OUTPUT([HAVE_FORK], [/* Define to 1 if you have the \'fork\' function. */ +@%:@undef HAVE_FORK]) +m4trace:configure.ac:152: -1- AH_OUTPUT([HAVE_VFORK], [/* Define to 1 if you have the \'vfork\' function. */ +@%:@undef HAVE_VFORK]) +m4trace:configure.ac:152: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WORKING_VFORK]) +m4trace:configure.ac:152: -1- m4_pattern_allow([^HAVE_WORKING_VFORK$]) +m4trace:configure.ac:152: -1- AH_OUTPUT([HAVE_WORKING_VFORK], [/* Define to 1 if \'vfork\' works. */ +@%:@undef HAVE_WORKING_VFORK]) +m4trace:configure.ac:152: -1- AC_DEFINE_TRACE_LITERAL([vfork]) +m4trace:configure.ac:152: -1- m4_pattern_allow([^vfork$]) +m4trace:configure.ac:152: -1- AH_OUTPUT([vfork], [/* Define as \'fork\' if \'vfork\' does not work. */ +@%:@undef vfork]) +m4trace:configure.ac:152: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WORKING_FORK]) +m4trace:configure.ac:152: -1- m4_pattern_allow([^HAVE_WORKING_FORK$]) +m4trace:configure.ac:152: -1- AH_OUTPUT([HAVE_WORKING_FORK], [/* Define to 1 if \'fork\' works. */ +@%:@undef HAVE_WORKING_FORK]) +m4trace:configure.ac:162: -1- AC_SUBST([SRC_VERSION_C]) +m4trace:configure.ac:162: -1- AC_SUBST_TRACE([SRC_VERSION_C]) +m4trace:configure.ac:162: -1- m4_pattern_allow([^SRC_VERSION_C$]) +m4trace:configure.ac:167: -1- AM_GNU_GETTEXT([external], [need-ngettext]) +m4trace:configure.ac:167: -1- AM_NLS +m4trace:configure.ac:167: -1- AC_SUBST([USE_NLS]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([USE_NLS]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^USE_NLS$]) +m4trace:configure.ac:167: -1- AC_SUBST([GETTEXT_MACRO_VERSION], [0.19]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([GETTEXT_MACRO_VERSION]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^GETTEXT_MACRO_VERSION$]) +m4trace:configure.ac:167: -1- AC_SUBST([MSGFMT]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([MSGFMT]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^MSGFMT$]) +m4trace:configure.ac:167: -1- AC_SUBST([GMSGFMT]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([GMSGFMT]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^GMSGFMT$]) +m4trace:configure.ac:167: -1- AC_SUBST([MSGFMT_015]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([MSGFMT_015]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^MSGFMT_015$]) +m4trace:configure.ac:167: -1- AC_SUBST([GMSGFMT_015]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([GMSGFMT_015]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^GMSGFMT_015$]) +m4trace:configure.ac:167: -1- AC_SUBST([XGETTEXT]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([XGETTEXT]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^XGETTEXT$]) +m4trace:configure.ac:167: -1- AC_SUBST([XGETTEXT_015]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([XGETTEXT_015]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^XGETTEXT_015$]) +m4trace:configure.ac:167: -1- AC_SUBST([MSGMERGE]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([MSGMERGE]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^MSGMERGE$]) +m4trace:configure.ac:167: -1- AC_SUBST([localedir]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([localedir]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:167: -1- AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([XGETTEXT_EXTRA_OPTIONS]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^XGETTEXT_EXTRA_OPTIONS$]) +m4trace:configure.ac:167: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CFPREFERENCESCOPYAPPVALUE]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^HAVE_CFPREFERENCESCOPYAPPVALUE$]) +m4trace:configure.ac:167: -1- AH_OUTPUT([HAVE_CFPREFERENCESCOPYAPPVALUE], [/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +@%:@undef HAVE_CFPREFERENCESCOPYAPPVALUE]) +m4trace:configure.ac:167: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CFLOCALECOPYCURRENT]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^HAVE_CFLOCALECOPYCURRENT$]) +m4trace:configure.ac:167: -1- AH_OUTPUT([HAVE_CFLOCALECOPYCURRENT], [/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +@%:@undef HAVE_CFLOCALECOPYCURRENT]) +m4trace:configure.ac:167: -1- AC_SUBST([INTL_MACOSX_LIBS]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([INTL_MACOSX_LIBS]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^INTL_MACOSX_LIBS$]) +m4trace:configure.ac:167: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ICONV]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^HAVE_ICONV$]) +m4trace:configure.ac:167: -1- AH_OUTPUT([HAVE_ICONV], [/* Define if you have the iconv() function and it works. */ +@%:@undef HAVE_ICONV]) +m4trace:configure.ac:167: -1- AC_SUBST([LIBICONV]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([LIBICONV]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^LIBICONV$]) +m4trace:configure.ac:167: -1- AC_SUBST([LTLIBICONV]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([LTLIBICONV]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^LTLIBICONV$]) +m4trace:configure.ac:167: -1- AC_DEFINE_TRACE_LITERAL([ENABLE_NLS]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^ENABLE_NLS$]) +m4trace:configure.ac:167: -1- AH_OUTPUT([ENABLE_NLS], [/* Define to 1 if translation of program messages to the user\'s native + language is requested. */ +@%:@undef ENABLE_NLS]) +m4trace:configure.ac:167: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETTEXT]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^HAVE_GETTEXT$]) +m4trace:configure.ac:167: -1- AH_OUTPUT([HAVE_GETTEXT], [/* Define if the GNU gettext() function is already present or preinstalled. */ +@%:@undef HAVE_GETTEXT]) +m4trace:configure.ac:167: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DCGETTEXT]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^HAVE_DCGETTEXT$]) +m4trace:configure.ac:167: -1- AH_OUTPUT([HAVE_DCGETTEXT], [/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +@%:@undef HAVE_DCGETTEXT]) +m4trace:configure.ac:167: -1- AC_SUBST([INTLLIBS]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([INTLLIBS]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^INTLLIBS$]) +m4trace:configure.ac:167: -1- AC_SUBST([LIBINTL]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([LIBINTL]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^LIBINTL$]) +m4trace:configure.ac:167: -1- AC_SUBST([LTLIBINTL]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([LTLIBINTL]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^LTLIBINTL$]) +m4trace:configure.ac:167: -1- AC_SUBST([POSUB]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([POSUB]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^POSUB$]) +m4trace:configure.ac:171: -1- AC_CONFIG_FILES([ + Makefile doc/Makefile + lib/Makefile + src/Makefile + tests/Makefile + gnulib-tests/Makefile + man/Makefile + po/Makefile.in +]) +m4trace:configure.ac:180: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:180: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([LTLIBOBJS]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.ac:180: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.ac:180: -1- AC_SUBST([am__EXEEXT_TRUE]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.ac:180: -1- AC_SUBST([am__EXEEXT_FALSE]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.ac:180: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.ac:180: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.ac:180: -1- AC_SUBST([CONFIG_INCLUDE], [lib/config.h]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([CONFIG_INCLUDE]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^CONFIG_INCLUDE$]) +m4trace:configure.ac:180: -1- AC_SUBST([gl_LIBOBJS], [$gl_libobjs]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([gl_LIBOBJS]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^gl_LIBOBJS$]) +m4trace:configure.ac:180: -1- AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([gl_LTLIBOBJS]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^gl_LTLIBOBJS$]) +m4trace:configure.ac:180: -1- AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([gltests_LIBOBJS]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^gltests_LIBOBJS$]) +m4trace:configure.ac:180: -1- AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([gltests_LTLIBOBJS]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^gltests_LTLIBOBJS$]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([top_builddir]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([top_build_prefix]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([srcdir]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([abs_srcdir]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([top_srcdir]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([abs_top_srcdir]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([builddir]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([abs_builddir]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([abs_top_builddir]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([INSTALL]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([MKDIR_P]) diff --git a/local/recipes/tools/diffutils/source/autom4te.cache/traces.2 b/local/recipes/tools/diffutils/source/autom4te.cache/traces.2 new file mode 100644 index 0000000000..3c660a7230 --- /dev/null +++ b/local/recipes/tools/diffutils/source/autom4te.cache/traces.2 @@ -0,0 +1,6481 @@ +m4trace:aclocal.m4:662: -1- AC_SUBST([am__quote]) +m4trace:aclocal.m4:662: -1- AC_SUBST_TRACE([am__quote]) +m4trace:aclocal.m4:662: -1- m4_pattern_allow([^am__quote$]) +m4trace:aclocal.m4:1318: -1- m4_include([m4/00gnulib.m4]) +m4trace:aclocal.m4:1319: -1- m4_include([m4/absolute-header.m4]) +m4trace:aclocal.m4:1320: -1- m4_include([m4/alloca.m4]) +m4trace:aclocal.m4:1321: -1- m4_include([m4/arpa_inet_h.m4]) +m4trace:aclocal.m4:1322: -1- m4_include([m4/btowc.m4]) +m4trace:aclocal.m4:1323: -1- m4_include([m4/builtin-expect.m4]) +m4trace:aclocal.m4:1324: -1- m4_include([m4/c-stack.m4]) +m4trace:aclocal.m4:1325: -1- m4_include([m4/clock_time.m4]) +m4trace:aclocal.m4:1326: -1- m4_include([m4/close.m4]) +m4trace:aclocal.m4:1327: -1- m4_include([m4/codeset.m4]) +m4trace:aclocal.m4:1328: -1- m4_include([m4/config-h.m4]) +m4trace:aclocal.m4:1329: -1- m4_include([m4/configmake.m4]) +m4trace:aclocal.m4:1330: -1- m4_include([m4/ctype.m4]) +m4trace:aclocal.m4:1331: -1- m4_include([m4/dirname.m4]) +m4trace:aclocal.m4:1332: -1- m4_include([m4/double-slash-root.m4]) +m4trace:aclocal.m4:1333: -1- m4_include([m4/dup2.m4]) +m4trace:aclocal.m4:1334: -1- m4_include([m4/eealloc.m4]) +m4trace:aclocal.m4:1335: -1- m4_include([m4/environ.m4]) +m4trace:aclocal.m4:1336: -1- m4_include([m4/errno_h.m4]) +m4trace:aclocal.m4:1337: -1- m4_include([m4/error.m4]) +m4trace:aclocal.m4:1338: -1- m4_include([m4/exponentd.m4]) +m4trace:aclocal.m4:1339: -1- m4_include([m4/extensions.m4]) +m4trace:aclocal.m4:1340: -1- m4_include([m4/extern-inline.m4]) +m4trace:aclocal.m4:1341: -1- m4_include([m4/fcntl-o.m4]) +m4trace:aclocal.m4:1342: -1- m4_include([m4/fcntl.m4]) +m4trace:aclocal.m4:1343: -1- m4_include([m4/fcntl_h.m4]) +m4trace:aclocal.m4:1344: -1- m4_include([m4/fdopen.m4]) +m4trace:aclocal.m4:1345: -1- m4_include([m4/filenamecat.m4]) +m4trace:aclocal.m4:1346: -1- m4_include([m4/flexmember.m4]) +m4trace:aclocal.m4:1347: -1- m4_include([m4/float_h.m4]) +m4trace:aclocal.m4:1348: -1- m4_include([m4/fnmatch.m4]) +m4trace:aclocal.m4:1349: -1- m4_include([m4/fpieee.m4]) +m4trace:aclocal.m4:1350: -1- m4_include([m4/freopen.m4]) +m4trace:aclocal.m4:1351: -1- m4_include([m4/fstat.m4]) +m4trace:aclocal.m4:1352: -1- m4_include([m4/ftruncate.m4]) +m4trace:aclocal.m4:1353: -1- m4_include([m4/getcwd.m4]) +m4trace:aclocal.m4:1354: -1- m4_include([m4/getdtablesize.m4]) +m4trace:aclocal.m4:1355: -1- m4_include([m4/getopt.m4]) +m4trace:aclocal.m4:1356: -1- m4_include([m4/getpagesize.m4]) +m4trace:aclocal.m4:1357: -1- m4_include([m4/getprogname.m4]) +m4trace:aclocal.m4:1358: -1- m4_include([m4/gettext.m4]) +m4trace:aclocal.m4:1359: -1- m4_include([m4/gettime.m4]) +m4trace:aclocal.m4:1360: -1- m4_include([m4/gettimeofday.m4]) +m4trace:aclocal.m4:1361: -1- m4_include([m4/glibc21.m4]) +m4trace:aclocal.m4:1362: -1- m4_include([m4/gnu-make.m4]) +m4trace:aclocal.m4:1363: -1- m4_include([m4/gnulib-common.m4]) +m4trace:aclocal.m4:1364: -1- m4_include([m4/gnulib-comp.m4]) +m4trace:aclocal.m4:1365: -1- m4_include([m4/hard-locale.m4]) +m4trace:aclocal.m4:1366: -1- m4_include([m4/iconv.m4]) +m4trace:aclocal.m4:1367: -1- m4_include([m4/iconv_h.m4]) +m4trace:aclocal.m4:1368: -1- m4_include([m4/iconv_open.m4]) +m4trace:aclocal.m4:1369: -1- m4_include([m4/include_next.m4]) +m4trace:aclocal.m4:1370: -1- m4_include([m4/inet_pton.m4]) +m4trace:aclocal.m4:1371: -1- m4_include([m4/inline.m4]) +m4trace:aclocal.m4:1372: -1- m4_include([m4/intlmacosx.m4]) +m4trace:aclocal.m4:1373: -1- m4_include([m4/intmax_t.m4]) +m4trace:aclocal.m4:1374: -1- m4_include([m4/inttostr.m4]) +m4trace:aclocal.m4:1375: -1- m4_include([m4/inttypes-pri.m4]) +m4trace:aclocal.m4:1376: -1- m4_include([m4/inttypes.m4]) +m4trace:aclocal.m4:1377: -1- m4_include([m4/inttypes_h.m4]) +m4trace:aclocal.m4:1378: -1- m4_include([m4/ioctl.m4]) +m4trace:aclocal.m4:1379: -1- m4_include([m4/isblank.m4]) +m4trace:aclocal.m4:1380: -1- m4_include([m4/iswblank.m4]) +m4trace:aclocal.m4:1381: -1- m4_include([m4/langinfo_h.m4]) +m4trace:aclocal.m4:1382: -1- m4_include([m4/largefile.m4]) +m4trace:aclocal.m4:1383: -1- m4_include([m4/lib-ld.m4]) +m4trace:aclocal.m4:1384: -1- m4_include([m4/lib-link.m4]) +m4trace:aclocal.m4:1385: -1- m4_include([m4/lib-prefix.m4]) +m4trace:aclocal.m4:1386: -1- m4_include([m4/libsigsegv.m4]) +m4trace:aclocal.m4:1387: -1- m4_include([m4/libunistring-base.m4]) +m4trace:aclocal.m4:1388: -1- m4_include([m4/limits-h.m4]) +m4trace:aclocal.m4:1389: -1- m4_include([m4/localcharset.m4]) +m4trace:aclocal.m4:1390: -1- m4_include([m4/locale-fr.m4]) +m4trace:aclocal.m4:1391: -1- m4_include([m4/locale-ja.m4]) +m4trace:aclocal.m4:1392: -1- m4_include([m4/locale-tr.m4]) +m4trace:aclocal.m4:1393: -1- m4_include([m4/locale-zh.m4]) +m4trace:aclocal.m4:1394: -1- m4_include([m4/locale_h.m4]) +m4trace:aclocal.m4:1395: -1- m4_include([m4/localeconv.m4]) +m4trace:aclocal.m4:1396: -1- m4_include([m4/localtime-buffer.m4]) +m4trace:aclocal.m4:1397: -1- m4_include([m4/longlong.m4]) +m4trace:aclocal.m4:1398: -1- m4_include([m4/lstat.m4]) +m4trace:aclocal.m4:1399: -1- m4_include([m4/malloc.m4]) +m4trace:aclocal.m4:1400: -1- m4_include([m4/malloca.m4]) +m4trace:aclocal.m4:1401: -1- m4_include([m4/manywarnings.m4]) +m4trace:aclocal.m4:1402: -1- m4_include([m4/mbchar.m4]) +m4trace:aclocal.m4:1403: -1- m4_include([m4/mbiter.m4]) +m4trace:aclocal.m4:1404: -1- m4_include([m4/mbrtowc.m4]) +m4trace:aclocal.m4:1405: -1- m4_include([m4/mbsinit.m4]) +m4trace:aclocal.m4:1406: -1- m4_include([m4/mbslen.m4]) +m4trace:aclocal.m4:1407: -1- m4_include([m4/mbsrtowcs.m4]) +m4trace:aclocal.m4:1408: -1- m4_include([m4/mbstate_t.m4]) +m4trace:aclocal.m4:1409: -1- m4_include([m4/mbtowc.m4]) +m4trace:aclocal.m4:1410: -1- m4_include([m4/memchr.m4]) +m4trace:aclocal.m4:1411: -1- m4_include([m4/minmax.m4]) +m4trace:aclocal.m4:1412: -1- m4_include([m4/mkstemp.m4]) +m4trace:aclocal.m4:1413: -1- m4_include([m4/mktime.m4]) +m4trace:aclocal.m4:1414: -1- m4_include([m4/mmap-anon.m4]) +m4trace:aclocal.m4:1415: -1- m4_include([m4/mode_t.m4]) +m4trace:aclocal.m4:1416: -1- m4_include([m4/msvc-inval.m4]) +m4trace:aclocal.m4:1417: -1- m4_include([m4/msvc-nothrow.m4]) +m4trace:aclocal.m4:1418: -1- m4_include([m4/multiarch.m4]) +m4trace:aclocal.m4:1419: -1- m4_include([m4/nanosleep.m4]) +m4trace:aclocal.m4:1420: -1- m4_include([m4/netinet_in_h.m4]) +m4trace:aclocal.m4:1421: -1- m4_include([m4/nl_langinfo.m4]) +m4trace:aclocal.m4:1422: -1- m4_include([m4/nls.m4]) +m4trace:aclocal.m4:1423: -1- m4_include([m4/nocrash.m4]) +m4trace:aclocal.m4:1424: -1- m4_include([m4/off_t.m4]) +m4trace:aclocal.m4:1425: -1- m4_include([m4/open.m4]) +m4trace:aclocal.m4:1426: -1- m4_include([m4/pathmax.m4]) +m4trace:aclocal.m4:1427: -1- m4_include([m4/perror.m4]) +m4trace:aclocal.m4:1428: -1- m4_include([m4/pipe.m4]) +m4trace:aclocal.m4:1429: -1- m4_include([m4/po.m4]) +m4trace:aclocal.m4:1430: -1- m4_include([m4/printf.m4]) +m4trace:aclocal.m4:1431: -1- m4_include([m4/progtest.m4]) +m4trace:aclocal.m4:1432: -1- m4_include([m4/putenv.m4]) +m4trace:aclocal.m4:1433: -1- m4_include([m4/quote.m4]) +m4trace:aclocal.m4:1434: -1- m4_include([m4/quotearg.m4]) +m4trace:aclocal.m4:1435: -1- m4_include([m4/raise.m4]) +m4trace:aclocal.m4:1436: -1- m4_include([m4/rawmemchr.m4]) +m4trace:aclocal.m4:1437: -1- m4_include([m4/readlink.m4]) +m4trace:aclocal.m4:1438: -1- m4_include([m4/regex.m4]) +m4trace:aclocal.m4:1439: -1- m4_include([m4/secure_getenv.m4]) +m4trace:aclocal.m4:1440: -1- m4_include([m4/select.m4]) +m4trace:aclocal.m4:1441: -1- m4_include([m4/setenv.m4]) +m4trace:aclocal.m4:1442: -1- m4_include([m4/setlocale.m4]) +m4trace:aclocal.m4:1443: -1- m4_include([m4/sigaction.m4]) +m4trace:aclocal.m4:1444: -1- m4_include([m4/signal_h.m4]) +m4trace:aclocal.m4:1445: -1- m4_include([m4/signalblocking.m4]) +m4trace:aclocal.m4:1446: -1- m4_include([m4/size_max.m4]) +m4trace:aclocal.m4:1447: -1- m4_include([m4/sleep.m4]) +m4trace:aclocal.m4:1448: -1- m4_include([m4/snprintf.m4]) +m4trace:aclocal.m4:1449: -1- m4_include([m4/socketlib.m4]) +m4trace:aclocal.m4:1450: -1- m4_include([m4/sockets.m4]) +m4trace:aclocal.m4:1451: -1- m4_include([m4/socklen.m4]) +m4trace:aclocal.m4:1452: -1- m4_include([m4/sockpfaf.m4]) +m4trace:aclocal.m4:1453: -1- m4_include([m4/ssize_t.m4]) +m4trace:aclocal.m4:1454: -1- m4_include([m4/stat-time.m4]) +m4trace:aclocal.m4:1455: -1- m4_include([m4/stat.m4]) +m4trace:aclocal.m4:1456: -1- m4_include([m4/stdalign.m4]) +m4trace:aclocal.m4:1457: -1- m4_include([m4/stdarg.m4]) +m4trace:aclocal.m4:1458: -1- m4_include([m4/stdbool.m4]) +m4trace:aclocal.m4:1459: -1- m4_include([m4/stddef_h.m4]) +m4trace:aclocal.m4:1460: -1- m4_include([m4/stdint.m4]) +m4trace:aclocal.m4:1461: -1- m4_include([m4/stdint_h.m4]) +m4trace:aclocal.m4:1462: -1- m4_include([m4/stdio_h.m4]) +m4trace:aclocal.m4:1463: -1- m4_include([m4/stdlib_h.m4]) +m4trace:aclocal.m4:1464: -1- m4_include([m4/strcase.m4]) +m4trace:aclocal.m4:1465: -1- m4_include([m4/strerror.m4]) +m4trace:aclocal.m4:1466: -1- m4_include([m4/strerror_r.m4]) +m4trace:aclocal.m4:1467: -1- m4_include([m4/strftime.m4]) +m4trace:aclocal.m4:1468: -1- m4_include([m4/string_h.m4]) +m4trace:aclocal.m4:1469: -1- m4_include([m4/strings_h.m4]) +m4trace:aclocal.m4:1470: -1- m4_include([m4/strndup.m4]) +m4trace:aclocal.m4:1471: -1- m4_include([m4/strnlen.m4]) +m4trace:aclocal.m4:1472: -1- m4_include([m4/strptime.m4]) +m4trace:aclocal.m4:1473: -1- m4_include([m4/strtoull.m4]) +m4trace:aclocal.m4:1474: -1- m4_include([m4/strtoumax.m4]) +m4trace:aclocal.m4:1475: -1- m4_include([m4/symlink.m4]) +m4trace:aclocal.m4:1476: -1- m4_include([m4/sys_ioctl_h.m4]) +m4trace:aclocal.m4:1477: -1- m4_include([m4/sys_select_h.m4]) +m4trace:aclocal.m4:1478: -1- m4_include([m4/sys_socket_h.m4]) +m4trace:aclocal.m4:1479: -1- m4_include([m4/sys_stat_h.m4]) +m4trace:aclocal.m4:1480: -1- m4_include([m4/sys_time_h.m4]) +m4trace:aclocal.m4:1481: -1- m4_include([m4/sys_types_h.m4]) +m4trace:aclocal.m4:1482: -1- m4_include([m4/sys_uio_h.m4]) +m4trace:aclocal.m4:1483: -1- m4_include([m4/sys_wait_h.m4]) +m4trace:aclocal.m4:1484: -1- m4_include([m4/tempname.m4]) +m4trace:aclocal.m4:1485: -1- m4_include([m4/time_h.m4]) +m4trace:aclocal.m4:1486: -1- m4_include([m4/time_r.m4]) +m4trace:aclocal.m4:1487: -1- m4_include([m4/time_rz.m4]) +m4trace:aclocal.m4:1488: -1- m4_include([m4/timegm.m4]) +m4trace:aclocal.m4:1489: -1- m4_include([m4/timespec.m4]) +m4trace:aclocal.m4:1490: -1- m4_include([m4/tm_gmtoff.m4]) +m4trace:aclocal.m4:1491: -1- m4_include([m4/tzset.m4]) +m4trace:aclocal.m4:1492: -1- m4_include([m4/unistd_h.m4]) +m4trace:aclocal.m4:1493: -1- m4_include([m4/unlocked-io.m4]) +m4trace:aclocal.m4:1494: -1- m4_include([m4/vararrays.m4]) +m4trace:aclocal.m4:1495: -1- m4_include([m4/vasnprintf.m4]) +m4trace:aclocal.m4:1496: -1- m4_include([m4/vasprintf.m4]) +m4trace:aclocal.m4:1497: -1- m4_include([m4/version-etc.m4]) +m4trace:aclocal.m4:1498: -1- m4_include([m4/warn-on-use.m4]) +m4trace:aclocal.m4:1499: -1- m4_include([m4/warnings.m4]) +m4trace:aclocal.m4:1500: -1- m4_include([m4/wchar_h.m4]) +m4trace:aclocal.m4:1501: -1- m4_include([m4/wchar_t.m4]) +m4trace:aclocal.m4:1502: -1- m4_include([m4/wcrtomb.m4]) +m4trace:aclocal.m4:1503: -1- m4_include([m4/wctob.m4]) +m4trace:aclocal.m4:1504: -1- m4_include([m4/wctomb.m4]) +m4trace:aclocal.m4:1505: -1- m4_include([m4/wctype_h.m4]) +m4trace:aclocal.m4:1506: -1- m4_include([m4/wcwidth.m4]) +m4trace:aclocal.m4:1507: -1- m4_include([m4/wint_t.m4]) +m4trace:aclocal.m4:1508: -1- m4_include([m4/xalloc.m4]) +m4trace:aclocal.m4:1509: -1- m4_include([m4/xsize.m4]) +m4trace:aclocal.m4:1510: -1- m4_include([m4/xstrndup.m4]) +m4trace:aclocal.m4:1511: -1- m4_include([m4/xstrtol.m4]) +m4trace:aclocal.m4:1512: -1- m4_include([m4/xvasprintf.m4]) +m4trace:configure.ac:21: -1- AC_INIT([GNU diffutils], [3.6], [bug-diffutils@gnu.org]) +m4trace:configure.ac:21: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.ac:21: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.ac:21: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section 'AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.ac:21: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.ac:21: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.ac:21: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.ac:21: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.ac:21: -1- AC_SUBST([SHELL]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([SHELL]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.ac:21: -1- AC_SUBST([PATH_SEPARATOR]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.ac:21: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([PACKAGE_NAME]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:21: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:21: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:21: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([PACKAGE_STRING]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:21: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:21: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([PACKAGE_URL]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:21: -1- AC_SUBST([exec_prefix], [NONE]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([exec_prefix]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.ac:21: -1- AC_SUBST([prefix], [NONE]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([prefix]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.ac:21: -1- AC_SUBST([program_transform_name], [s,x,x,]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([program_transform_name]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.ac:21: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([bindir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.ac:21: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([sbindir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.ac:21: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([libexecdir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.ac:21: -1- AC_SUBST([datarootdir], ['${prefix}/share']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([datarootdir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:21: -1- AC_SUBST([datadir], ['${datarootdir}']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([datadir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.ac:21: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([sysconfdir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.ac:21: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([sharedstatedir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.ac:21: -1- AC_SUBST([localstatedir], ['${prefix}/var']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([localstatedir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.ac:21: -1- AC_SUBST([runstatedir], ['${localstatedir}/run']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([runstatedir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^runstatedir$]) +m4trace:configure.ac:21: -1- AC_SUBST([includedir], ['${prefix}/include']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([includedir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.ac:21: -1- AC_SUBST([oldincludedir], ['/usr/include']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([oldincludedir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.ac:21: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], + ['${datarootdir}/doc/${PACKAGE_TARNAME}'], + ['${datarootdir}/doc/${PACKAGE}'])]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([docdir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:21: -1- AC_SUBST([infodir], ['${datarootdir}/info']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([infodir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.ac:21: -1- AC_SUBST([htmldir], ['${docdir}']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([htmldir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:21: -1- AC_SUBST([dvidir], ['${docdir}']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([dvidir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:21: -1- AC_SUBST([pdfdir], ['${docdir}']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([pdfdir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:21: -1- AC_SUBST([psdir], ['${docdir}']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([psdir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:21: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([libdir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.ac:21: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([localedir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:21: -1- AC_SUBST([mandir], ['${datarootdir}/man']) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([mandir]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.ac:21: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:21: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ +@%:@undef PACKAGE_NAME]) +m4trace:configure.ac:21: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:21: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ +@%:@undef PACKAGE_TARNAME]) +m4trace:configure.ac:21: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:21: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ +@%:@undef PACKAGE_VERSION]) +m4trace:configure.ac:21: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:21: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ +@%:@undef PACKAGE_STRING]) +m4trace:configure.ac:21: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:21: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ +@%:@undef PACKAGE_BUGREPORT]) +m4trace:configure.ac:21: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:21: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */ +@%:@undef PACKAGE_URL]) +m4trace:configure.ac:21: -1- AC_SUBST([DEFS]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([DEFS]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.ac:21: -1- AC_SUBST([ECHO_C]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([ECHO_C]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.ac:21: -1- AC_SUBST([ECHO_N]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([ECHO_N]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.ac:21: -1- AC_SUBST([ECHO_T]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([ECHO_T]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.ac:21: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:21: -1- AC_SUBST([build_alias]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([build_alias]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.ac:21: -1- AC_SUBST([host_alias]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([host_alias]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.ac:21: -1- AC_SUBST([target_alias]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([target_alias]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.ac:26: -1- AC_CONFIG_AUX_DIR([build-aux]) +m4trace:configure.ac:27: -1- AC_CONFIG_MACRO_DIR_TRACE([m4]) +m4trace:configure.ac:29: -1- AM_INIT_AUTOMAKE([1.11 dist-xz no-dist-gzip subdir-objects + color-tests parallel-tests]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.ac:29: -1- AM_AUTOMAKE_VERSION([1.18.1]) +m4trace:configure.ac:29: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.ac:29: -1- AC_SUBST([INSTALL_PROGRAM]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:29: -1- AC_SUBST([INSTALL_SCRIPT]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:29: -1- AC_SUBST([INSTALL_DATA]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([INSTALL_DATA]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:29: -1- AC_SUBST([am__isrc], [' -I$(srcdir)']) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([am__isrc]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.ac:29: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.ac:29: -1- AC_SUBST([CYGPATH_W]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([CYGPATH_W]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.ac:29: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME']) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([PACKAGE]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:29: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION']) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([VERSION]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:29: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:29: -1- AH_OUTPUT([PACKAGE], [/* Name of package */ +@%:@undef PACKAGE]) +m4trace:configure.ac:29: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:29: -1- AH_OUTPUT([VERSION], [/* Version number of package */ +@%:@undef VERSION]) +m4trace:configure.ac:29: -1- AC_REQUIRE_AUX_FILE([missing]) +m4trace:configure.ac:29: -1- AC_SUBST([ACLOCAL]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([ACLOCAL]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.ac:29: -1- AC_SUBST([AUTOCONF]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([AUTOCONF]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.ac:29: -1- AC_SUBST([AUTOMAKE]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([AUTOMAKE]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.ac:29: -1- AC_SUBST([AUTOHEADER]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([AUTOHEADER]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.ac:29: -1- AC_SUBST([MAKEINFO]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([MAKEINFO]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.ac:29: -1- AC_SUBST([install_sh]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([install_sh]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.ac:29: -1- AC_SUBST([STRIP]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([STRIP]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:29: -1- AC_SUBST([INSTALL_STRIP_PROGRAM]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.ac:29: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.ac:29: -1- AC_SUBST([MKDIR_P]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([MKDIR_P]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.ac:29: -1- AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([mkdir_p]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.ac:29: -1- AC_SUBST([AWK]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([AWK]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.ac:29: -1- AC_SUBST([SET_MAKE]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([SET_MAKE]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.ac:29: -1- AC_SUBST([am__leading_dot]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([am__leading_dot]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.ac:29: -1- AC_SUBST([AMTAR], ['$${TAR-tar}']) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([AMTAR]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.ac:29: -1- AC_SUBST([am__tar]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([am__tar]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.ac:29: -1- AC_SUBST([am__untar]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([am__untar]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.ac:29: -1- AC_SUBST([CTAGS]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([CTAGS]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^CTAGS$]) +m4trace:configure.ac:29: -1- AC_SUBST([ETAGS]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([ETAGS]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^ETAGS$]) +m4trace:configure.ac:29: -1- AC_SUBST([CSCOPE]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([CSCOPE]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^CSCOPE$]) +m4trace:configure.ac:29: -1- AC_SUBST([AM_V]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([AM_V]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AM_V$]) +m4trace:configure.ac:29: -1- _AM_SUBST_NOTMAKE([AM_V]) +m4trace:configure.ac:29: -1- AC_SUBST([AM_DEFAULT_V]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([AM_DEFAULT_V]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AM_DEFAULT_V$]) +m4trace:configure.ac:29: -1- _AM_SUBST_NOTMAKE([AM_DEFAULT_V]) +m4trace:configure.ac:29: -1- AC_SUBST([AM_DEFAULT_VERBOSITY]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([AM_DEFAULT_VERBOSITY]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AM_DEFAULT_VERBOSITY$]) +m4trace:configure.ac:29: -1- AC_SUBST([AM_BACKSLASH]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([AM_BACKSLASH]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^AM_BACKSLASH$]) +m4trace:configure.ac:29: -1- _AM_SUBST_NOTMAKE([AM_BACKSLASH]) +m4trace:configure.ac:29: -1- AC_SUBST([am__rm_f_notfound]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([am__rm_f_notfound]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^am__rm_f_notfound$]) +m4trace:configure.ac:29: -1- AC_SUBST([am__xargs_n]) +m4trace:configure.ac:29: -1- AC_SUBST_TRACE([am__xargs_n]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^am__xargs_n$]) +m4trace:configure.ac:31: -1- AM_SILENT_RULES([yes]) +m4trace:configure.ac:33: -1- _m4_warn([obsolete], [The macro 'AC_CONFIG_HEADER' is obsolete. +You should run autoupdate.], [./lib/autoconf/status.m4:719: AC_CONFIG_HEADER is expanded from... +configure.ac:33: the top level]) +m4trace:configure.ac:33: -1- AC_CONFIG_HEADERS([lib/config.h:lib/config.hin]) +m4trace:configure.ac:35: -1- AC_SUBST([AWK]) +m4trace:configure.ac:35: -1- AC_SUBST_TRACE([AWK]) +m4trace:configure.ac:35: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.ac:36: -1- AC_SUBST([CC]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:36: -1- AC_SUBST([CFLAGS]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([CFLAGS]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.ac:36: -1- AC_SUBST([LDFLAGS]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([LDFLAGS]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:36: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:36: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:36: -1- AC_SUBST([CC]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:36: -1- AC_SUBST([CC]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:36: -1- AC_SUBST([CC]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:36: -1- AC_SUBST([CC]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:36: -1- AC_SUBST([ac_ct_CC]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([ac_ct_CC]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.ac:36: -1- AC_SUBST([CC]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:36: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([EXEEXT]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.ac:36: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([OBJEXT]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.ac:36: -1- AC_REQUIRE_AUX_FILE([compile]) +m4trace:configure.ac:36: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([DEPDIR]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.ac:36: -1- AC_SUBST([am__include]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([am__include]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.ac:36: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.ac:36: -1- AC_SUBST([AMDEP_TRUE]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([AMDEP_TRUE]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.ac:36: -1- AC_SUBST([AMDEP_FALSE]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([AMDEP_FALSE]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.ac:36: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.ac:36: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.ac:36: -1- AC_SUBST([AMDEPBACKSLASH]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([AMDEPBACKSLASH]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.ac:36: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.ac:36: -1- AC_SUBST([am__nodep]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([am__nodep]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^am__nodep$]) +m4trace:configure.ac:36: -1- _AM_SUBST_NOTMAKE([am__nodep]) +m4trace:configure.ac:36: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([CCDEPMODE]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.ac:36: -1- AM_CONDITIONAL([am__fastdepCC], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:36: -1- AC_SUBST([am__fastdepCC_TRUE]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.ac:36: -1- AC_SUBST([am__fastdepCC_FALSE]) +m4trace:configure.ac:36: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) +m4trace:configure.ac:36: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.ac:36: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.ac:36: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.ac:37: -1- AM_PROG_CC_C_O +m4trace:configure.ac:38: -1- AC_SUBST([HELP2MAN]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([HELP2MAN]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^HELP2MAN$]) +m4trace:configure.ac:39: -1- AC_SUBST([RANLIB]) +m4trace:configure.ac:39: -1- AC_SUBST_TRACE([RANLIB]) +m4trace:configure.ac:39: -1- m4_pattern_allow([^RANLIB$]) +m4trace:configure.ac:40: -1- m4_pattern_forbid([^gl_[A-Z]]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^gl_ES$]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^gl_LIBOBJS$]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^gl_LTLIBOBJS$]) +m4trace:configure.ac:40: -1- _m4_warn([obsolete], [The macro 'AC_GNU_SOURCE' is obsolete. +You should run autoupdate.], [./lib/autoconf/specific.m4:489: AC_GNU_SOURCE is expanded from... +m4/gnulib-comp.m4:34: gl_EARLY is expanded from... +configure.ac:40: the top level]) +m4trace:configure.ac:40: -1- AH_OUTPUT([HAVE_STDIO_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDIO_H]) +m4trace:configure.ac:40: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDLIB_H]) +m4trace:configure.ac:40: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRING_H]) +m4trace:configure.ac:40: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_INTTYPES_H]) +m4trace:configure.ac:40: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDINT_H]) +m4trace:configure.ac:40: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRINGS_H]) +m4trace:configure.ac:40: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_STAT_H]) +m4trace:configure.ac:40: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TYPES_H]) +m4trace:configure.ac:40: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.ac:40: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if all of the C89 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +@%:@undef STDC_HEADERS]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_POSIX_SOURCE]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_POSIX_SOURCE$]) +m4trace:configure.ac:40: -1- AH_OUTPUT([_POSIX_SOURCE], [/* Define to 1 if you need to in order for \'stat\' and other things to work. */ +@%:@undef _POSIX_SOURCE]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_POSIX_1_SOURCE]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_POSIX_1_SOURCE$]) +m4trace:configure.ac:40: -1- AH_OUTPUT([_POSIX_1_SOURCE], [/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +@%:@undef _POSIX_1_SOURCE]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_MINIX]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_MINIX$]) +m4trace:configure.ac:40: -1- AH_OUTPUT([_MINIX], [/* Define to 1 if on MINIX. */ +@%:@undef _MINIX]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_NETBSD_SOURCE]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_NETBSD_SOURCE$]) +m4trace:configure.ac:40: -1- AH_OUTPUT([_NETBSD_SOURCE], [/* Define to 1 to make NetBSD features available. MINIX 3 needs this. */ +@%:@undef _NETBSD_SOURCE]) +m4trace:configure.ac:40: -1- AH_OUTPUT([USE_SYSTEM_EXTENSIONS], [/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable general extensions on macOS. */ +#ifndef _DARWIN_C_SOURCE +# undef _DARWIN_C_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# undef __STDC_WANT_IEC_60559_BFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# undef __STDC_WANT_IEC_60559_DFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# undef __STDC_WANT_IEC_60559_TYPES_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# undef __STDC_WANT_LIB_EXT2__ +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# undef __STDC_WANT_MATH_SPEC_FUNCS__ +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable X/Open extensions if necessary. HP-UX 11.11 defines + mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of + whether compiling with -Ae or -D_HPUX_SOURCE=1. */ +#ifndef _XOPEN_SOURCE +# undef _XOPEN_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif +]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([__EXTENSIONS__]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^__EXTENSIONS__$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_ALL_SOURCE]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_ALL_SOURCE$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_DARWIN_C_SOURCE]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_DARWIN_C_SOURCE$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_GNU_SOURCE]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_GNU_SOURCE$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_POSIX_PTHREAD_SEMANTICS]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_POSIX_PTHREAD_SEMANTICS$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([__STDC_WANT_IEC_60559_ATTRIBS_EXT__]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^__STDC_WANT_IEC_60559_ATTRIBS_EXT__$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([__STDC_WANT_IEC_60559_BFP_EXT__]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^__STDC_WANT_IEC_60559_BFP_EXT__$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([__STDC_WANT_IEC_60559_DFP_EXT__]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^__STDC_WANT_IEC_60559_DFP_EXT__$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([__STDC_WANT_IEC_60559_FUNCS_EXT__]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^__STDC_WANT_IEC_60559_FUNCS_EXT__$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([__STDC_WANT_IEC_60559_TYPES_EXT__]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^__STDC_WANT_IEC_60559_TYPES_EXT__$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([__STDC_WANT_LIB_EXT2__]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^__STDC_WANT_LIB_EXT2__$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([__STDC_WANT_MATH_SPEC_FUNCS__]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^__STDC_WANT_MATH_SPEC_FUNCS__$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_TANDEM_SOURCE]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_TANDEM_SOURCE$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_XOPEN_SOURCE]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_XOPEN_SOURCE$]) +m4trace:configure.ac:40: -1- AC_SUBST([CPP]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:40: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:40: -1- AC_SUBST([CPP]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:40: -1- AC_SUBST([AR]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([AR]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^AR$]) +m4trace:configure.ac:40: -1- AC_SUBST([AR]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([AR]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^AR$]) +m4trace:configure.ac:40: -1- AC_SUBST([ARFLAGS]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([ARFLAGS]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^ARFLAGS$]) +m4trace:configure.ac:40: -1- AC_SUBST([RANLIB]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([RANLIB]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^RANLIB$]) +m4trace:configure.ac:40: -1- AC_SUBST([RANLIB]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([RANLIB]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^RANLIB$]) +m4trace:configure.ac:40: -1- AC_CANONICAL_HOST +m4trace:configure.ac:40: -1- AC_CANONICAL_BUILD +m4trace:configure.ac:40: -1- AC_REQUIRE_AUX_FILE([config.sub]) +m4trace:configure.ac:40: -1- AC_REQUIRE_AUX_FILE([config.guess]) +m4trace:configure.ac:40: -1- AC_SUBST([build], [$ac_cv_build]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([build]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^build$]) +m4trace:configure.ac:40: -1- AC_SUBST([build_cpu], [$[1]]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([build_cpu]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^build_cpu$]) +m4trace:configure.ac:40: -1- AC_SUBST([build_vendor], [$[2]]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([build_vendor]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^build_vendor$]) +m4trace:configure.ac:40: -1- AC_SUBST([build_os]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([build_os]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^build_os$]) +m4trace:configure.ac:40: -1- AC_SUBST([host], [$ac_cv_host]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([host]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^host$]) +m4trace:configure.ac:40: -1- AC_SUBST([host_cpu], [$[1]]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([host_cpu]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^host_cpu$]) +m4trace:configure.ac:40: -1- AC_SUBST([host_vendor], [$[2]]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([host_vendor]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^host_vendor$]) +m4trace:configure.ac:40: -1- AC_SUBST([host_os]) +m4trace:configure.ac:40: -1- AC_SUBST_TRACE([host_os]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^host_os$]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_FILE_OFFSET_BITS]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_FILE_OFFSET_BITS$]) +m4trace:configure.ac:40: -1- AH_OUTPUT([_FILE_OFFSET_BITS], [/* Number of bits in a file offset, on hosts where this is settable. */ +@%:@undef _FILE_OFFSET_BITS]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_LARGE_FILES]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_LARGE_FILES$]) +m4trace:configure.ac:40: -1- AH_OUTPUT([_LARGE_FILES], [/* Define to 1 on platforms where this makes off_t a 64-bit type. */ +@%:@undef _LARGE_FILES]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([_TIME_BITS]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^_TIME_BITS$]) +m4trace:configure.ac:40: -1- AH_OUTPUT([_TIME_BITS], [/* Number of bits in time_t, on hosts where this is settable. */ +@%:@undef _TIME_BITS]) +m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([__MINGW_USE_VC2005_COMPAT]) +m4trace:configure.ac:40: -1- m4_pattern_allow([^__MINGW_USE_VC2005_COMPAT$]) +m4trace:configure.ac:40: -1- AH_OUTPUT([__MINGW_USE_VC2005_COMPAT], [/* Define to 1 on platforms where this makes time_t a 64-bit type. */ +@%:@undef __MINGW_USE_VC2005_COMPAT]) +m4trace:configure.ac:40: -1- _m4_warn([obsolete], [The macro 'AC_PROG_CC_STDC' is obsolete. +You should run autoupdate.], [./lib/autoconf/c.m4:1669: AC_PROG_CC_STDC is expanded from... +m4/gnulib-common.m4:239: gl_PROG_CC_C99 is expanded from... +m4/gnulib-comp.m4:34: gl_EARLY is expanded from... +configure.ac:40: the top level]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_COND_LIBTOOL], [false]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_COND_LIBTOOL_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_COND_LIBTOOL_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_COND_LIBTOOL_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_COND_LIBTOOL_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_COND_LIBTOOL_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_COND_LIBTOOL_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_COND_LIBTOOL_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_COND_LIBTOOL_FALSE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([_Noreturn], [/* The _Noreturn keyword of C11. */ +#if ! (defined _Noreturn \\ + || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) +# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \\ + || 0x5110 <= __SUNPRO_C) +# define _Noreturn __attribute__ ((__noreturn__)) +# elif defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn +# endif +#endif +]) +m4trace:configure.ac:42: -1- AH_OUTPUT([isoc99_inline], [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports + the ISO C 99 semantics of \'extern inline\' (unlike the GNU C semantics of + earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. + __APPLE__ && __MACH__ test for Mac OS X. + __APPLE_CC__ tests for the Apple compiler and its version. + __STDC_VERSION__ tests for the C99 mode. */ +#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ +# define __GNUC_STDC_INLINE__ 1 +#endif]) +m4trace:configure.ac:42: -1- AH_OUTPUT([unused_parameter], [/* Define as a marker that can be attached to declarations that might not + be used. This helps to reduce warnings, such as from + GCC -Wunused-parameter. */ +#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _GL_UNUSED __attribute__ ((__unused__)) +#else +# define _GL_UNUSED +#endif +/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name + is a misnomer outside of parameter lists. */ +#define _UNUSED_PARAMETER_ _GL_UNUSED + +/* gcc supports the "unused" attribute on possibly unused labels, and + g++ has since version 4.5. Note to support C++ as well as C, + _GL_UNUSED_LABEL should be used with a trailing ; */ +#if !defined __cplusplus || __GNUC__ > 4 \\ + || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# define _GL_UNUSED_LABEL _GL_UNUSED +#else +# define _GL_UNUSED_LABEL +#endif + +/* The __pure__ attribute was added in gcc 2.96. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE /* empty */ +#endif + +/* The __const__ attribute was added in gcc 2.95. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) +#else +# define _GL_ATTRIBUTE_CONST /* empty */ +#endif +]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([size_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^size_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([size_t], [/* Define as \'unsigned int\' if doesn\'t define. */ +@%:@undef size_t]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ALLOCA_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ALLOCA_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ALLOCA_H], [/* Define to 1 if works. */ +@%:@undef HAVE_ALLOCA_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ALLOCA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ALLOCA$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ALLOCA], [/* Define to 1 if you have \'alloca\', as a function or macro. */ +@%:@undef HAVE_ALLOCA]) +m4trace:configure.ac:42: -1- AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([ALLOCA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ALLOCA$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([C_ALLOCA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^C_ALLOCA$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([C_ALLOCA], [/* Define to 1 if using \'alloca.c\'. */ +@%:@undef C_ALLOCA]) +m4trace:configure.ac:42: -1- AH_OUTPUT([STACK_DIRECTION], [/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([STACK_DIRECTION]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STACK_DIRECTION$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ALLOCA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ALLOCA$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ALLOCA], [/* Define to 1 if you have \'alloca\' after including , a header that + may be supplied by this distribution. */ +@%:@undef HAVE_ALLOCA]) +m4trace:configure.ac:42: -1- AC_SUBST([ALLOCA_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([ALLOCA_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ALLOCA_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ALLOCA_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ALLOCA_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ALLOCA_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ALLOCA_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ALLOCA_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ALLOCA_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ALLOCA_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ALLOCA_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_BTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_BTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_BTOWC$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCTOB]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCTOB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCTOB$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSINIT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSINIT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSINIT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBRTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBRTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBRTOWC$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBRLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBRLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBRLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSRTOWCS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSRTOWCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSRTOWCS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSNRTOWCS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSNRTOWCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSNRTOWCS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCRTOMB]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCRTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCRTOMB$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSRTOMBS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSRTOMBS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSRTOMBS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSNRTOMBS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSNRTOMBS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSNRTOMBS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCWIDTH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCWIDTH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCWIDTH$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WMEMCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WMEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WMEMCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WMEMCMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WMEMCMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WMEMCMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WMEMCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WMEMCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WMEMCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WMEMMOVE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WMEMMOVE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WMEMMOVE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WMEMSET]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WMEMSET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WMEMSET$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSNLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSNLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCPCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCPCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCPCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSNCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSNCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSNCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCPNCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCPNCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCPNCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSCAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSCAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSCAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSNCAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSNCAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSNCAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSCMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSCMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSCMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSNCMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSNCMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSNCMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSCASECMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSCASECMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSNCASECMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSNCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSNCASECMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSCOLL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSCOLL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSCOLL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSXFRM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSXFRM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSXFRM$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSDUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSDUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSRCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSRCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSRCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSCSPN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSCSPN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSCSPN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSSPN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSSPN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSSPN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSPBRK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSPBRK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSPBRK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSSTR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSSTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSSTR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSTOK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSTOK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSTOK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSWIDTH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSWIDTH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSWIDTH$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCSFTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCSFTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCSFTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_BTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_BTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_BTOWC$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MBSINIT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MBSINIT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBSINIT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MBRTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MBRTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBRTOWC$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MBRLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MBRLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBRLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MBSRTOWCS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MBSRTOWCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBSRTOWCS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MBSNRTOWCS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MBSNRTOWCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBSNRTOWCS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCRTOMB]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCRTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCRTOMB$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSRTOMBS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSRTOMBS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSRTOMBS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSNRTOMBS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSNRTOMBS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSNRTOMBS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WMEMCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WMEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WMEMCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WMEMCMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WMEMCMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WMEMCMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WMEMCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WMEMCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WMEMCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WMEMMOVE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WMEMMOVE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WMEMMOVE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WMEMSET]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WMEMSET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WMEMSET$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSNLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSNLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCPCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCPCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCPCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSNCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSNCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSNCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCPNCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCPNCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCPNCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSCAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSCAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSCAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSNCAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSNCAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSNCAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSCMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSCMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSCMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSNCMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSNCMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSNCMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSCASECMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSCASECMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSNCASECMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSNCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSNCASECMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSCOLL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSCOLL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSCOLL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSXFRM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSXFRM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSXFRM$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSDUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSDUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSRCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSRCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSRCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSCSPN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSCSPN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSCSPN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSSPN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSSPN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSSPN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSPBRK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSPBRK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSPBRK$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSSTR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSSTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSSTR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSTOK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSTOK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSTOK$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSWIDTH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSWIDTH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSWIDTH$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCSFTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCSFTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSFTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_WCTOB]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_WCTOB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_WCTOB$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_WCWIDTH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_WCWIDTH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_WCWIDTH$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MBSTATE_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MBSTATE_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MBSTATE_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_BTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_BTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_BTOWC$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_WCTOB]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_WCTOB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WCTOB$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MBSINIT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MBSINIT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MBSINIT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MBRTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MBRTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MBRTOWC$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MBRLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MBRLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MBRLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MBSRTOWCS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MBSRTOWCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MBSRTOWCS$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MBSNRTOWCS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MBSNRTOWCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MBSNRTOWCS$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_WCRTOMB]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_WCRTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WCRTOMB$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_WCSRTOMBS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_WCSRTOMBS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WCSRTOMBS$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_WCSNRTOMBS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_WCSNRTOMBS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WCSNRTOMBS$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_WCWIDTH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_WCWIDTH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WCWIDTH$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_WCSWIDTH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_WCSWIDTH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WCSWIDTH$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_WCSFTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_WCSFTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WCSFTIME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_BTOWC], [/* Define to 1 if you have the \'btowc\' function. */ +@%:@undef HAVE_BTOWC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LANGINFO_CODESET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LANGINFO_CODESET$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LANGINFO_CODESET], [/* Define if you have and nl_langinfo(CODESET). */ +@%:@undef HAVE_LANGINFO_CODESET]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_BTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_BTOWC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_BTOWC], [/* Define to 1 when the gnulib module btowc should be tested. */ +@%:@undef GNULIB_TEST_BTOWC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE___BUILTIN_EXPECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE___BUILTIN_EXPECT$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE___BUILTIN_EXPECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE___BUILTIN_EXPECT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE___BUILTIN_EXPECT], [/* Define to 1 if the compiler supports __builtin_expect, + and to 2 if does. */ +#undef HAVE___BUILTIN_EXPECT +#ifndef HAVE___BUILTIN_EXPECT +# define __builtin_expect(e, c) (e) +#elif HAVE___BUILTIN_EXPECT == 2 +# include +#endif + ]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SETRLIMIT], [/* Define to 1 if you have the \'setrlimit\' function. */ +@%:@undef HAVE_SETRLIMIT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UCONTEXT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UCONTEXT_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([FAULT_YIELDS_SIGBUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^FAULT_YIELDS_SIGBUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([FAULT_YIELDS_SIGBUS], [/* Define to 1 if an invalid memory address access may yield a SIGBUS. */ +@%:@undef FAULT_YIELDS_SIGBUS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STACK_OVERFLOW_HANDLING]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STACK_OVERFLOW_HANDLING$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STACK_OVERFLOW_HANDLING], [/* Define to 1 if extending the stack slightly past the limit causes a SIGSEGV + which can be handled on an alternate stack established with sigaltstack. */ +@%:@undef HAVE_STACK_OVERFLOW_HANDLING]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([SIGALTSTACK_SS_REVERSED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SIGALTSTACK_SS_REVERSED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([SIGALTSTACK_SS_REVERSED], [/* Define if sigaltstack() interprets the stack_t.ss_sp field incorrectly, as + the highest address of the alternate stack range rather than as the lowest + address. */ +@%:@undef SIGALTSTACK_SS_REVERSED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_XSI_STACK_OVERFLOW_HEURISTIC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_XSI_STACK_OVERFLOW_HEURISTIC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_XSI_STACK_OVERFLOW_HEURISTIC], [/* Define to 1 if extending the stack slightly past the limit causes a + SIGSEGV, and an alternate stack can be established with sigaltstack, and + the signal handler is passed a context that specifies the run time stack. + This behavior is defined by POSIX 1003.1-2001 with the X/Open System + Interface (XSI) option and is a standardized way to implement a SEGV-based + stack overflow detection heuristic. */ +@%:@undef HAVE_XSI_STACK_OVERFLOW_HEURISTIC]) +m4trace:configure.ac:42: -1- AC_REQUIRE_AUX_FILE([config.rpath]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBSIGSEGV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LIBSIGSEGV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LIBSIGSEGV], [/* Define if you have the libsigsegv library. */ +@%:@undef HAVE_LIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LIBSIGSEGV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LIBSIGSEGV$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBSIGSEGV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBSIGSEGV$]) +m4trace:configure.ac:42: -1- AC_SUBST([LTLIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LTLIBSIGSEGV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LTLIBSIGSEGV$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBSIGSEGV_PREFIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBSIGSEGV_PREFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBSIGSEGV_PREFIX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SIGALTSTACK], [/* Define to 1 if you have the \'sigaltstack\' function. */ +@%:@undef HAVE_SIGALTSTACK]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_SIGALTSTACK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SIGALTSTACK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_SIGALTSTACK], [/* Define to 1 if you have the declaration of \'sigaltstack\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_SIGALTSTACK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UCONTEXT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UCONTEXT_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STACK_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STACK_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STACK_T], [/* Define to 1 if the system has the type \'stack_t\'. */ +@%:@undef HAVE_STACK_T]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBCSTACK], [$LIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBCSTACK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBCSTACK$]) +m4trace:configure.ac:42: -1- AC_SUBST([LTLIBCSTACK], [$LTLIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LTLIBCSTACK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LTLIBCSTACK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_READLINKAT], [/* Define to 1 if you have the \'readlinkat\' function. */ +@%:@undef HAVE_READLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST([LIB_CLOCK_GETTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIB_CLOCK_GETTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIB_CLOCK_GETTIME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_CLOCK_GETTIME], [/* Define to 1 if you have the \'clock_gettime\' function. */ +@%:@undef HAVE_CLOCK_GETTIME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CLOCK_GETTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_CLOCK_GETTIME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_CLOCK_SETTIME], [/* Define to 1 if you have the \'clock_settime\' function. */ +@%:@undef HAVE_CLOCK_SETTIME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CLOCK_SETTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_CLOCK_SETTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_CHDIR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_CHDIR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CHDIR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_CHOWN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_CHOWN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CHOWN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_CLOSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_CLOSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CLOSE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_DUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_DUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_DUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_DUP2]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_DUP2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_DUP2$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_DUP3]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_DUP3]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_DUP3$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_ENVIRON]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_ENVIRON]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ENVIRON$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_EUIDACCESS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_EUIDACCESS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_EUIDACCESS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FACCESSAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FACCESSAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FACCESSAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FCHDIR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FCHDIR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FCHDIR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FCHOWNAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FCHOWNAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FCHOWNAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FDATASYNC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FDATASYNC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FDATASYNC$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FSYNC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FSYNC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSYNC$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FTRUNCATE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FTRUNCATE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FTRUNCATE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETCWD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETCWD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETCWD$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETDOMAINNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETDOMAINNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETDOMAINNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETDTABLESIZE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETGROUPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETGROUPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETGROUPS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETHOSTNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETHOSTNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETHOSTNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETLOGIN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETLOGIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETLOGIN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETLOGIN_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETLOGIN_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETLOGIN_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETPAGESIZE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETPAGESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETPAGESIZE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETUSERSHELL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETUSERSHELL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETUSERSHELL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GROUP_MEMBER]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GROUP_MEMBER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GROUP_MEMBER$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_ISATTY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_ISATTY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ISATTY$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_LCHOWN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_LCHOWN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LCHOWN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_LINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_LINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_LINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_LINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_LSEEK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_LSEEK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LSEEK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PIPE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PIPE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PIPE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PIPE2]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PIPE2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PIPE2$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PREAD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PREAD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PREAD$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PWRITE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PWRITE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PWRITE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_READ]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_READ]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_READ$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_READLINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_READLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_READLINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_READLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_READLINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_READLINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RMDIR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RMDIR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RMDIR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SETHOSTNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SETHOSTNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SETHOSTNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SLEEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SYMLINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SYMLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SYMLINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SYMLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SYMLINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SYMLINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_TRUNCATE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_TRUNCATE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TRUNCATE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_TTYNAME_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_TTYNAME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TTYNAME_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_UNISTD_H_NONBLOCKING]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNISTD_H_NONBLOCKING$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_UNISTD_H_SIGPIPE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNISTD_H_SIGPIPE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_UNLINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_UNLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNLINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_UNLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_UNLINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNLINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_USLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_USLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_USLEEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WRITE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WRITE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WRITE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_CHOWN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_CHOWN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_CHOWN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DUP2]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DUP2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DUP2$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DUP3]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DUP3]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DUP3$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_EUIDACCESS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_EUIDACCESS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_EUIDACCESS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FACCESSAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FACCESSAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FACCESSAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FCHDIR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FCHDIR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FCHDIR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FCHOWNAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FCHOWNAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FCHOWNAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FDATASYNC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FDATASYNC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FDATASYNC$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FSYNC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FSYNC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FSYNC$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FTRUNCATE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FTRUNCATE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FTRUNCATE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETDTABLESIZE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GETGROUPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GETGROUPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETGROUPS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GETHOSTNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GETHOSTNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETHOSTNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GETLOGIN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GETLOGIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETLOGIN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GETPAGESIZE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GETPAGESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETPAGESIZE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GROUP_MEMBER]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GROUP_MEMBER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GROUP_MEMBER$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LCHOWN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LCHOWN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LCHOWN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_PIPE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_PIPE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PIPE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_PIPE2]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_PIPE2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PIPE2$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_PREAD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_PREAD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PREAD$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_PWRITE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_PWRITE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PWRITE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_READLINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_READLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_READLINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_READLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_READLINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_READLINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SETHOSTNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SETHOSTNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SETHOSTNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SLEEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYMLINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYMLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYMLINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYMLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYMLINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYMLINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_TRUNCATE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_TRUNCATE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TRUNCATE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_UNLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_UNLINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UNLINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_USLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_USLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_USLEEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_ENVIRON]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_ENVIRON]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_ENVIRON$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_FCHDIR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_FCHDIR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FCHDIR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_FDATASYNC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_FDATASYNC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FDATASYNC$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_GETDOMAINNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_GETDOMAINNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETDOMAINNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_GETLOGIN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_GETLOGIN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETLOGIN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_GETLOGIN_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_GETLOGIN_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETLOGIN_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_GETPAGESIZE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_GETPAGESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETPAGESIZE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_GETUSERSHELL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_GETUSERSHELL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETUSERSHELL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_SETHOSTNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_SETHOSTNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SETHOSTNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_TTYNAME_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_TTYNAME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_TTYNAME_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_OS_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_OS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_OS_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_PARAM_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_PARAM_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_PARAM_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_CHOWN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_CHOWN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_CHOWN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_CLOSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_CLOSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_CLOSE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_DUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_DUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_DUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_DUP2]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_DUP2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_DUP2$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FCHOWNAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FCHOWNAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FCHOWNAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FTRUNCATE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FTRUNCATE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FTRUNCATE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GETCWD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GETCWD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETCWD$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GETDOMAINNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GETDOMAINNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETDOMAINNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETDTABLESIZE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GETLOGIN_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GETLOGIN_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETLOGIN_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GETGROUPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GETGROUPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETGROUPS$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GETPAGESIZE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GETPAGESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETPAGESIZE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_ISATTY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_ISATTY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ISATTY$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_LCHOWN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_LCHOWN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LCHOWN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_LINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_LINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_LINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_LINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_LSEEK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_LSEEK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LSEEK$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_PREAD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_PREAD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PREAD$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_PWRITE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_PWRITE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PWRITE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_READ]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_READ]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_READ$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_READLINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_READLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_READLINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_READLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_READLINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_READLINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_RMDIR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_RMDIR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_RMDIR$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_SLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_SLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SLEEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_SYMLINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_SYMLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SYMLINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_SYMLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_SYMLINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SYMLINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_TRUNCATE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_TRUNCATE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TRUNCATE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_TTYNAME_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_TTYNAME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TTYNAME_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_UNLINK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_UNLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_UNLINK$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_UNLINKAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_UNLINKAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_UNLINKAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_USLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_USLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_USLEEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_WRITE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_WRITE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WRITE$]) +m4trace:configure.ac:42: -1- AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([UNISTD_H_HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UNISTD_H_HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE__SET_INVALID_PARAMETER_HANDLER], [/* Define to 1 if you have the \'_set_invalid_parameter_handler\' function. */ +@%:@undef HAVE__SET_INVALID_PARAMETER_HANDLER]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MSVC_INVALID_PARAMETER_HANDLER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MSVC_INVALID_PARAMETER_HANDLER$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MSVC_INVALID_PARAMETER_HANDLER], [/* Define to 1 on MSVC platforms that have the "invalid parameter handler" + concept. */ +@%:@undef HAVE_MSVC_INVALID_PARAMETER_HANDLER]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MSVC_INVALID_PARAMETER_HANDLER]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MSVC_INVALID_PARAMETER_HANDLER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MSVC_INVALID_PARAMETER_HANDLER$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_IOCTL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_IOCTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_IOCTL$]) +m4trace:configure.ac:42: -1- AC_SUBST([SYS_IOCTL_H_HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([SYS_IOCTL_H_HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SYS_IOCTL_H_HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_IOCTL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_IOCTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_IOCTL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WINSOCK2_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_CLOSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_CLOSE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_CLOSE], [/* Define to 1 when the gnulib module close should be tested. */ +@%:@undef GNULIB_TEST_CLOSE]) +m4trace:configure.ac:42: -1- AC_SUBST([datarootdir], ['${datadir}']) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([datarootdir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:42: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], + ['${datarootdir}/doc/${PACKAGE_TARNAME}'], + ['${datarootdir}/doc/${PACKAGE}'])]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([docdir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:42: -1- AC_SUBST([htmldir], ['${docdir}']) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([htmldir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:42: -1- AC_SUBST([dvidir], ['${docdir}']) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([dvidir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:42: -1- AC_SUBST([pdfdir], ['${docdir}']) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([pdfdir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:42: -1- AC_SUBST([psdir], ['${docdir}']) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([psdir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:42: -1- AC_SUBST([lispdir], ['${datarootdir}/emacs/site-lisp']) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([lispdir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^lispdir$]) +m4trace:configure.ac:42: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([localedir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:42: -1- AC_SUBST([runstatedir], ['${localstatedir}/run']) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([runstatedir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^runstatedir$]) +m4trace:configure.ac:42: -1- AC_SUBST([pkglibexecdir], ['${libexecdir}/${PACKAGE}']) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([pkglibexecdir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^pkglibexecdir$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_ISBLANK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_ISBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ISBLANK$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_ISBLANK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_ISBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ISBLANK$]) +m4trace:configure.ac:42: -1- AC_SUBST([INCLUDE_NEXT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([INCLUDE_NEXT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INCLUDE_NEXT$]) +m4trace:configure.ac:42: -1- AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([INCLUDE_NEXT_AS_FIRST_DIRECTIVE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INCLUDE_NEXT_AS_FIRST_DIRECTIVE$]) +m4trace:configure.ac:42: -1- AC_SUBST([PRAGMA_SYSTEM_HEADER]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([PRAGMA_SYSTEM_HEADER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRAGMA_SYSTEM_HEADER$]) +m4trace:configure.ac:42: -1- AC_SUBST([PRAGMA_COLUMNS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([PRAGMA_COLUMNS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRAGMA_COLUMNS$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_CTYPE_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_CTYPE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_CTYPE_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_CTYPE_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_CTYPE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_CTYPE_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_ISBLANK], [/* Define to 1 if isblank is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_ISBLANK]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([DOUBLE_SLASH_IS_DISTINCT_ROOT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^DOUBLE_SLASH_IS_DISTINCT_ROOT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([DOUBLE_SLASH_IS_DISTINCT_ROOT], [/* Define to 1 if // is a file system root distinct from /. */ +@%:@undef DOUBLE_SLASH_IS_DISTINCT_ROOT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_DIRNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_DIRNAME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_DIRNAME], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module dirname shall be considered present. */ +@%:@undef GNULIB_DIRNAME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([DOUBLE_SLASH_IS_DISTINCT_ROOT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^DOUBLE_SLASH_IS_DISTINCT_ROOT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([DOUBLE_SLASH_IS_DISTINCT_ROOT], [/* Define to 1 if // is a file system root distinct from /. */ +@%:@undef DOUBLE_SLASH_IS_DISTINCT_ROOT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DUP2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DUP2$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DUP2], [/* Define to 1 if you have the \'dup2\' function. */ +@%:@undef HAVE_DUP2]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SETDTABLESIZE], [/* Define to 1 if you have the \'setdtablesize\' function. */ +@%:@undef HAVE_SETDTABLESIZE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SETDTABLESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SETDTABLESIZE$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_DUP2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_DUP2$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_DUP2], [/* Define to 1 when the gnulib module dup2 should be tested. */ +@%:@undef GNULIB_TEST_DUP2]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ENVIRON_DECL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ENVIRON_DECL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ENVIRON_DECL], [/* Define if you have the declaration of environ. */ +@%:@undef HAVE_ENVIRON_DECL]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_ENVIRON]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_ENVIRON$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_ENVIRON], [/* Define to 1 when the gnulib module environ should be tested. */ +@%:@undef GNULIB_TEST_ENVIRON]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_ERRNO_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_ERRNO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_ERRNO_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_ERRNO_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_ERRNO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_ERRNO_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([ERRNO_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([ERRNO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ERRNO_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ERRNO_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ERRNO_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ERRNO_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ERRNO_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ERRNO_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ERRNO_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ERRNO_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ERRNO_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([EMULTIHOP_HIDDEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([EMULTIHOP_HIDDEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^EMULTIHOP_HIDDEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([EMULTIHOP_VALUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([EMULTIHOP_VALUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^EMULTIHOP_VALUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([ENOLINK_HIDDEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([ENOLINK_HIDDEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ENOLINK_HIDDEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([ENOLINK_VALUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([ENOLINK_VALUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ENOLINK_VALUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([EOVERFLOW_HIDDEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([EOVERFLOW_HIDDEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^EOVERFLOW_HIDDEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([EOVERFLOW_VALUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([EOVERFLOW_VALUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^EOVERFLOW_VALUE$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_STRERROR_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRERROR_R$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_STRERROR_R], [/* Define to 1 if you have the declaration of \'strerror_r\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_STRERROR_R]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRERROR_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRERROR_R$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRERROR_R], [/* Define if you have \'strerror_r\'. */ +@%:@undef HAVE_STRERROR_R]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([STRERROR_R_CHAR_P]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STRERROR_R_CHAR_P$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([STRERROR_R_CHAR_P], [/* Define to 1 if strerror_r returns char *. */ +@%:@undef STRERROR_R_CHAR_P]) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--flag=error:3:c-format]) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--flag=error_at_line:5:c-format]) +m4trace:configure.ac:42: -1- AH_OUTPUT([extern_inline], [/* Please see the Gnulib manual for how to use these macros. + + Suppress extern inline with HP-UX cc, as it appears to be broken; see + . + + Suppress extern inline with Sun C in standards-conformance mode, as it + mishandles inline functions that call each other. E.g., for \'inline void f + (void) { } inline void g (void) { f (); }\', c99 incorrectly complains + \'reference to static identifier "f" in extern inline function\'. + This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. + + Suppress extern inline (with or without __attribute__ ((__gnu_inline__))) + on configurations that mistakenly use \'static inline\' to implement + functions or macros in standard C headers like . For example, + if isdigit is mistakenly implemented via a static inline function, + a program containing an extern inline function that calls isdigit + may not work since the C standard prohibits extern inline functions + from calling static functions. This bug is known to occur on: + + OS X 10.8 and earlier; see: + http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html + + DragonFly; see + http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log + + FreeBSD; see: + http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html + + OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and + for clang but remains for g++; see . + Assume DragonFly and FreeBSD will be similar. */ +#if (((defined __APPLE__ && defined __MACH__) \\ + || defined __DragonFly__ || defined __FreeBSD__) \\ + && (defined __header_inline \\ + ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \\ + && ! defined __clang__) \\ + : ((! defined _DONT_USE_CTYPE_INLINE_ \\ + && (defined __GNUC__ || defined __cplusplus)) \\ + || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \\ + && defined __GNUC__ && ! defined __cplusplus)))) +# define _GL_EXTERN_INLINE_STDHEADER_BUG +#endif +#if ((__GNUC__ \\ + ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \\ + : (199901L <= __STDC_VERSION__ \\ + && !defined __HP_cc \\ + && !defined __PGI \\ + && !(defined __SUNPRO_C && __STDC__))) \\ + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) +# define _GL_INLINE inline +# define _GL_EXTERN_INLINE extern inline +# define _GL_EXTERN_INLINE_IN_USE +#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \\ + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) +# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__ + /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ +# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) +# else +# define _GL_INLINE extern inline +# endif +# define _GL_EXTERN_INLINE extern +# define _GL_EXTERN_INLINE_IN_USE +#else +# define _GL_INLINE static _GL_UNUSED +# define _GL_EXTERN_INLINE static _GL_UNUSED +#endif + +/* In GCC 4.6 (inclusive) to 5.1 (exclusive), + suppress bogus "no previous prototype for \'FOO\'" + and "no previous declaration for \'FOO\'" diagnostics, + when FOO is an inline function in the header; see + and + . */ +#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__ +# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ +# define _GL_INLINE_HEADER_CONST_PRAGMA +# else +# define _GL_INLINE_HEADER_CONST_PRAGMA \\ + _Pragma ("GCC diagnostic ignored \\"-Wsuggest-attribute=const\\"") +# endif +# define _GL_INLINE_HEADER_BEGIN \\ + _Pragma ("GCC diagnostic push") \\ + _Pragma ("GCC diagnostic ignored \\"-Wmissing-prototypes\\"") \\ + _Pragma ("GCC diagnostic ignored \\"-Wmissing-declarations\\"") \\ + _GL_INLINE_HEADER_CONST_PRAGMA +# define _GL_INLINE_HEADER_END \\ + _Pragma ("GCC diagnostic pop") +#else +# define _GL_INLINE_HEADER_BEGIN +# define _GL_INLINE_HEADER_END +#endif]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FCNTL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FCNTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FCNTL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_NONBLOCKING]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_NONBLOCKING]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_NONBLOCKING$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_OPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_OPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_OPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_OPENAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_OPENAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_OPENAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FCNTL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FCNTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FCNTL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_OPENAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_OPENAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_OPENAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FCNTL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FCNTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FCNTL$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_OPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_OPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_OPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_OPENAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_OPENAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_OPENAT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_FCNTL], [/* Define to 1 if you have the \'fcntl\' function. */ +@%:@undef HAVE_FCNTL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_FCNTL], [/* Define to 1 if you have the \'fcntl\' function. */ +@%:@undef HAVE_FCNTL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_FCNTL], [/* Define to 1 if you have the \'fcntl\' function. */ +@%:@undef HAVE_FCNTL]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([FCNTL_DUPFD_BUGGY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^FCNTL_DUPFD_BUGGY$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([FCNTL_DUPFD_BUGGY], [/* Define this to 1 if F_DUPFD behavior does not match POSIX */ +@%:@undef FCNTL_DUPFD_BUGGY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_FCNTL], [/* Define to 1 if you have the \'fcntl\' function. */ +@%:@undef HAVE_FCNTL]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_FCNTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_FCNTL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_FCNTL], [/* Define to 1 when the gnulib module fcntl should be tested. */ +@%:@undef GNULIB_TEST_FCNTL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYMLINK], [/* Define to 1 if you have the \'symlink\' function. */ +@%:@undef HAVE_SYMLINK]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WORKING_O_NOATIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WORKING_O_NOATIME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WORKING_O_NOATIME], [/* Define to 1 if O_NOATIME works. */ +@%:@undef HAVE_WORKING_O_NOATIME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WORKING_O_NOFOLLOW]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WORKING_O_NOFOLLOW$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WORKING_O_NOFOLLOW], [/* Define to 1 if O_NOFOLLOW works. */ +@%:@undef HAVE_WORKING_O_NOFOLLOW]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_FCNTL_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_FCNTL_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_FCNTL_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_FCNTL_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_FCNTL_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_FCNTL_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([pid_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^pid_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([pid_t], [/* Define as a signed integer type capable of holding a process identifier. */ +@%:@undef pid_t]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([mode_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^mode_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([mode_t], [/* Define to \'int\' if does not define. */ +@%:@undef mode_t]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FCNTL], [/* Define to 1 if fcntl is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FCNTL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_OPENAT], [/* Define to 1 if openat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_OPENAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MEMPCPY], [/* Define to 1 if you have the \'mempcpy\' function. */ +@%:@undef HAVE_MEMPCPY]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_FILENAMECAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FILENAMECAT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_FILENAMECAT], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module filenamecat shall be considered present. */ +@%:@undef GNULIB_FILENAMECAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MEMPCPY], [/* Define to 1 if you have the \'mempcpy\' function. */ +@%:@undef HAVE_MEMPCPY]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([FLEXIBLE_ARRAY_MEMBER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^FLEXIBLE_ARRAY_MEMBER$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([FLEXIBLE_ARRAY_MEMBER], [/* Define to nothing if C supports flexible array members, and to 1 if it does + not. That way, with a declaration like \'struct s { int n; double + d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };\', the struct hack can be used with pre-C99 + compilers. When computing the size of such an object, don\'t use \'sizeof + (struct s)\' as it overestimates the size. Use \'offsetof (struct s, d)\' + instead. Don\'t use \'offsetof (struct s, d@<:@0@:>@)\', as this doesn\'t work with + MSVC and with C++ compilers. */ +@%:@undef FLEXIBLE_ARRAY_MEMBER]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([FLEXIBLE_ARRAY_MEMBER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^FLEXIBLE_ARRAY_MEMBER$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_FLOAT_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_FLOAT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_FLOAT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_FLOAT_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_FLOAT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_FLOAT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([FLOAT_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([FLOAT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^FLOAT_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_FLOAT_H], [test -n "$FLOAT_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_FLOAT_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_FLOAT_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_FLOAT_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_FLOAT_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_FLOAT_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_FLOAT_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_FLOAT_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_FLOAT_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_ITOLD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_ITOLD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ITOLD$]) +m4trace:configure.ac:42: -1- AC_SUBST([FNMATCH_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([FNMATCH_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^FNMATCH_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_FNMATCH_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_FNMATCH_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_FNMATCH_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_FNMATCH_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_FNMATCH_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_FNMATCH_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_FNMATCH_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_FNMATCH_H_FALSE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([fnmatch]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^fnmatch$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([fnmatch], [/* Define to a replacement function name for fnmatch(). */ +@%:@undef fnmatch]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MBSTATE_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBSTATE_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSTATE_T], [/* Define to 1 if declares mbstate_t. */ +@%:@undef HAVE_MBSTATE_T]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([mbstate_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^mbstate_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([mbstate_t], [/* Define to a type if does not define. */ +@%:@undef mbstate_t]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_ISBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_ISBLANK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_ISBLANK], [/* Define to 1 if you have the declaration of \'isblank\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_ISBLANK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_BTOWC], [/* Define to 1 if you have the \'btowc\' function. */ +@%:@undef HAVE_BTOWC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISBLANK], [/* Define to 1 if you have the \'isblank\' function. */ +@%:@undef HAVE_ISBLANK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISWCTYPE], [/* Define to 1 if you have the \'iswctype\' function. */ +@%:@undef HAVE_ISWCTYPE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSRTOWCS], [/* Define to 1 if you have the \'mbsrtowcs\' function. */ +@%:@undef HAVE_MBSRTOWCS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MEMPCPY], [/* Define to 1 if you have the \'mempcpy\' function. */ +@%:@undef HAVE_MEMPCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WMEMCHR], [/* Define to 1 if you have the \'wmemchr\' function. */ +@%:@undef HAVE_WMEMCHR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WMEMCPY], [/* Define to 1 if you have the \'wmemcpy\' function. */ +@%:@undef HAVE_WMEMCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WMEMPCPY], [/* Define to 1 if you have the \'wmempcpy\' function. */ +@%:@undef HAVE_WMEMPCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCTYPE_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([fnmatch]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^fnmatch$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([fnmatch], [/* Define to a replacement function name for fnmatch(). */ +@%:@undef fnmatch]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_ISBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_ISBLANK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_ISBLANK], [/* Define to 1 if you have the declaration of \'isblank\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_ISBLANK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_BTOWC], [/* Define to 1 if you have the \'btowc\' function. */ +@%:@undef HAVE_BTOWC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISBLANK], [/* Define to 1 if you have the \'isblank\' function. */ +@%:@undef HAVE_ISBLANK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISWCTYPE], [/* Define to 1 if you have the \'iswctype\' function. */ +@%:@undef HAVE_ISWCTYPE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSRTOWCS], [/* Define to 1 if you have the \'mbsrtowcs\' function. */ +@%:@undef HAVE_MBSRTOWCS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MEMPCPY], [/* Define to 1 if you have the \'mempcpy\' function. */ +@%:@undef HAVE_MEMPCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WMEMCHR], [/* Define to 1 if you have the \'wmemchr\' function. */ +@%:@undef HAVE_WMEMCHR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WMEMCPY], [/* Define to 1 if you have the \'wmemcpy\' function. */ +@%:@undef HAVE_WMEMCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WMEMPCPY], [/* Define to 1 if you have the \'wmempcpy\' function. */ +@%:@undef HAVE_WMEMPCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCTYPE_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_DPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_DPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_DPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FCLOSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FCLOSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FCLOSE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FDOPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FDOPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FDOPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FFLUSH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FFLUSH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FFLUSH$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FGETC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FGETC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FGETC$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FGETS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FGETS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FGETS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FOPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FOPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FOPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FPRINTF_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FPRINTF_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FPRINTF_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FPURGE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FPURGE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FPURGE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FPUTC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FPUTC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FPUTC$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FPUTS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FPUTS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FPUTS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FREAD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FREAD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FREAD$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FREOPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FREOPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FREOPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FSCANF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FSCANF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSCANF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FSEEK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FSEEK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSEEK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FSEEKO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FSEEKO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSEEKO$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FTELL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FTELL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FTELL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FTELLO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FTELLO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FTELLO$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FWRITE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FWRITE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FWRITE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETC$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETCHAR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETCHAR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETCHAR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETDELIM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETDELIM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETDELIM$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETLINE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETLINE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETLINE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_OBSTACK_PRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_OBSTACK_PRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_OBSTACK_PRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_OBSTACK_PRINTF_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_OBSTACK_PRINTF_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PCLOSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PCLOSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PCLOSE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PERROR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PERROR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PERROR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_POPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_POPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_POPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PRINTF_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PRINTF_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PRINTF_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PUTC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PUTC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PUTC$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PUTCHAR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PUTCHAR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PUTCHAR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PUTS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PUTS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PUTS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_REMOVE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_REMOVE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_REMOVE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RENAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RENAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RENAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RENAMEAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RENAMEAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RENAMEAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SCANF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SCANF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SCANF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SNPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SPRINTF_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SPRINTF_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SPRINTF_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STDIO_H_NONBLOCKING]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STDIO_H_NONBLOCKING]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STDIO_H_NONBLOCKING$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STDIO_H_SIGPIPE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STDIO_H_SIGPIPE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STDIO_H_SIGPIPE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_TMPFILE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_TMPFILE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TMPFILE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VASPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VASPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VASPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VFSCANF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VFSCANF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VFSCANF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VSCANF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VSCANF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VSCANF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VDPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VDPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VDPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VFPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VFPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VFPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VFPRINTF_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VFPRINTF_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VFPRINTF_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VPRINTF_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VPRINTF_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VPRINTF_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VSNPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VSNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VSNPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_VSPRINTF_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_VSPRINTF_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_VSPRINTF_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_FPURGE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_FPURGE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FPURGE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_FSEEKO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_FSEEKO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FSEEKO$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_FTELLO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_FTELLO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FTELLO$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_GETDELIM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_GETDELIM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETDELIM$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_GETLINE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_GETLINE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETLINE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_OBSTACK_PRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_OBSTACK_PRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_OBSTACK_PRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_SNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SNPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_VSNPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_VSNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_VSNPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FSEEKO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FSEEKO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FSEEKO$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FTELLO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FTELLO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FTELLO$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_PCLOSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_PCLOSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PCLOSE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_POPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_POPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_POPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_RENAMEAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_RENAMEAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RENAMEAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_VASPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_VASPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_VASPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_VDPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_VDPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_VDPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_DPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_DPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_DPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FCLOSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FCLOSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FCLOSE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FDOPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FDOPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FDOPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FFLUSH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FFLUSH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FFLUSH$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FOPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FOPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FOPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FPURGE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FPURGE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FPURGE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FREOPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FREOPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FREOPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FSEEK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FSEEK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FSEEK$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FSEEKO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FSEEKO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FSEEKO$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FTELL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FTELL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FTELL$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FTELLO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FTELLO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FTELLO$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GETDELIM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GETDELIM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETDELIM$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GETLINE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GETLINE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETLINE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_OBSTACK_PRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_OBSTACK_PRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_OBSTACK_PRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_PERROR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_PERROR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PERROR$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_POPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_POPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_POPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_PRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_PRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_REMOVE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_REMOVE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_REMOVE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_RENAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_RENAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_RENAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_RENAMEAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_RENAMEAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_RENAMEAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_SNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SNPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_SPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_SPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STDIO_READ_FUNCS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STDIO_READ_FUNCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STDIO_READ_FUNCS$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STDIO_WRITE_FUNCS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STDIO_WRITE_FUNCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STDIO_WRITE_FUNCS$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_TMPFILE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_TMPFILE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TMPFILE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_VASPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_VASPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VASPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_VDPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_VDPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VDPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_VFPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_VFPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VFPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_VPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_VPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_VSNPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_VSNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VSNPRINTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_VSPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_VSPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VSPRINTF$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_FREOPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_FREOPEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_FREOPEN], [/* Define to 1 when the gnulib module freopen should be tested. */ +@%:@undef GNULIB_TEST_FREOPEN]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_FREOPEN_SAFER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FREOPEN_SAFER$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_FREOPEN_SAFER], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module freopen-safer shall be considered present. */ +@%:@undef GNULIB_FREOPEN_SAFER]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FCHMODAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FCHMODAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FCHMODAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FSTAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FSTAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSTAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FSTATAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FSTATAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSTATAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FUTIMENS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FUTIMENS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FUTIMENS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_LCHMOD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_LCHMOD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LCHMOD$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_LSTAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_LSTAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LSTAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKDIRAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKDIRAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKDIRAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKFIFO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKFIFO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKFIFO$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKFIFOAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKFIFOAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKFIFOAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKNOD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKNOD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKNOD$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKNODAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKNODAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKNODAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_UTIMENSAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_UTIMENSAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UTIMENSAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_OVERRIDES_STRUCT_STAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_OVERRIDES_STRUCT_STAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_OVERRIDES_STRUCT_STAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FCHMODAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FCHMODAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FCHMODAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FSTATAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FSTATAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FSTATAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FUTIMENS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FUTIMENS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FUTIMENS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LCHMOD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LCHMOD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LCHMOD$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LSTAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LSTAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LSTAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKDIRAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKDIRAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKDIRAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKFIFO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKFIFO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKFIFO$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKFIFOAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKFIFOAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKFIFOAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKNOD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKNOD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKNOD$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKNODAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKNODAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKNODAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_UTIMENSAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_UTIMENSAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UTIMENSAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FSTAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FSTAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FSTAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FSTATAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FSTATAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FSTATAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_FUTIMENS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_FUTIMENS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FUTIMENS$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_LSTAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_LSTAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LSTAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MKDIR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MKDIR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MKDIR$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MKFIFO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MKFIFO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MKFIFO$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MKNOD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MKNOD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MKNOD$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_UTIMENSAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_UTIMENSAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_UTIMENSAT$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([STAT_MACROS_BROKEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STAT_MACROS_BROKEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([STAT_MACROS_BROKEN], [/* Define to 1 if the \'S_IS*\' macros in do not work properly. */ +@%:@undef STAT_MACROS_BROKEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_STAT_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SYS_STAT_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SYS_STAT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_STAT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([WINDOWS_STAT_TIMESPEC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([WINDOWS_STAT_TIMESPEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_STAT_TIMESPEC$]) +m4trace:configure.ac:42: -1- AC_SUBST([WINDOWS_64_BIT_ST_SIZE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([WINDOWS_64_BIT_ST_SIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_64_BIT_ST_SIZE$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([nlink_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^nlink_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([nlink_t], [/* Define to the type of st_nlink in struct stat, or a supertype. */ +@%:@undef nlink_t]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FCHMODAT], [/* Define to 1 if fchmodat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FCHMODAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FSTAT], [/* Define to 1 if fstat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FSTAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FSTATAT], [/* Define to 1 if fstatat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FSTATAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FUTIMENS], [/* Define to 1 if futimens is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FUTIMENS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_LCHMOD], [/* Define to 1 if lchmod is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_LCHMOD]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_LSTAT], [/* Define to 1 if lstat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_LSTAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKDIRAT], [/* Define to 1 if mkdirat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKDIRAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKFIFO], [/* Define to 1 if mkfifo is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKFIFO]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKFIFOAT], [/* Define to 1 if mkfifoat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKFIFOAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKNOD], [/* Define to 1 if mknod is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKNOD]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKNODAT], [/* Define to 1 if mknodat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKNODAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STAT], [/* Define to 1 if stat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_UTIMENSAT], [/* Define to 1 if utimensat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_UTIMENSAT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_FSTAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_FSTAT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_FSTAT], [/* Define to 1 when the gnulib module fstat should be tested. */ +@%:@undef GNULIB_TEST_FSTAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETDTABLESIZE], [/* Define to 1 if you have the \'getdtablesize\' function. */ +@%:@undef HAVE_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETDTABLESIZE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_GETDTABLESIZE], [/* Define to 1 if you have the declaration of \'getdtablesize\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_GETDTABLESIZE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_GETDTABLESIZE], [/* Define to 1 when the gnulib module getdtablesize should be tested. */ +@%:@undef GNULIB_TEST_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETOPT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_GETOPT_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_GETOPT_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_GETOPT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_GETOPT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_GETOPT_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_GETOPT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_GETOPT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GETOPT_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GETOPT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETOPT_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETOPT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_GETOPT_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETOPT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETOPT_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETOPT_LONG_ONLY], [/* Define to 1 if you have the \'getopt_long_only\' function. */ +@%:@undef HAVE_GETOPT_LONG_ONLY]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETOPT_LONG_ONLY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETOPT_LONG_ONLY$]) +m4trace:configure.ac:42: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [./lib/autoconf/general.m4:2979: AC_RUN_IFELSE is expanded from... +lib/m4sugar/m4sh.m4:690: _AS_IF_ELSE is expanded from... +lib/m4sugar/m4sh.m4:697: AS_IF is expanded from... +./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... +./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... +m4/getopt.m4:48: gl_GETOPT_CHECK_HEADERS is expanded from... +m4/getopt.m4:8: gl_FUNC_GETOPT_POSIX is expanded from... +m4/gnulib-comp.m4:445: gl_INIT is expanded from... +configure.ac:42: the top level]) +m4trace:configure.ac:42: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [./lib/autoconf/general.m4:2979: AC_RUN_IFELSE is expanded from... +lib/m4sugar/m4sh.m4:690: _AS_IF_ELSE is expanded from... +lib/m4sugar/m4sh.m4:697: AS_IF is expanded from... +./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... +./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... +m4/getopt.m4:48: gl_GETOPT_CHECK_HEADERS is expanded from... +m4/getopt.m4:8: gl_FUNC_GETOPT_POSIX is expanded from... +m4/gnulib-comp.m4:445: gl_INIT is expanded from... +configure.ac:42: the top level]) +m4trace:configure.ac:42: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [./lib/autoconf/general.m4:2979: AC_RUN_IFELSE is expanded from... +lib/m4sugar/m4sh.m4:690: _AS_IF_ELSE is expanded from... +lib/m4sugar/m4sh.m4:697: AS_IF is expanded from... +./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... +./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... +m4/getopt.m4:48: gl_GETOPT_CHECK_HEADERS is expanded from... +m4/getopt.m4:8: gl_FUNC_GETOPT_POSIX is expanded from... +m4/gnulib-comp.m4:445: gl_INIT is expanded from... +configure.ac:42: the top level]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_CDEFS_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_CDEFS_H]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_CDEFS_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_CDEFS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_CDEFS_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([__GETOPT_PREFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^__GETOPT_PREFIX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([__GETOPT_PREFIX], [/* Define to rpl_ if the getopt replacement functions and variables should be + used. */ +@%:@undef __GETOPT_PREFIX]) +m4trace:configure.ac:42: -1- AC_SUBST([GETOPT_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GETOPT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GETOPT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([GETOPT_CDEFS_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GETOPT_CDEFS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GETOPT_CDEFS_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GL_UNISTD_H_GETOPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GL_UNISTD_H_GETOPT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETPROGNAME], [/* Define to 1 if you have the \'getprogname\' function. */ +@%:@undef HAVE_GETPROGNAME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETEXECNAME], [/* Define to 1 if you have the \'getexecname\' function. */ +@%:@undef HAVE_GETEXECNAME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_PROGRAM_INVOCATION_NAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_PROGRAM_INVOCATION_NAME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_PROGRAM_INVOCATION_NAME], [/* Define to 1 if you have the declaration of \'program_invocation_name\', and + to 0 if you don\'t. */ +@%:@undef HAVE_DECL_PROGRAM_INVOCATION_NAME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME], [/* Define to 1 if you have the declaration of \'program_invocation_short_name\', + and to 0 if you don\'t. */ +@%:@undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL___ARGV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL___ARGV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL___ARGV], [/* Define to 1 if you have the declaration of \'__argv\', and to 0 if you don\'t. + */ +@%:@undef HAVE_DECL___ARGV]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_VAR___PROGNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_VAR___PROGNAME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_VAR___PROGNAME], [/* Define if you have a global __progname variable */ +@%:@undef HAVE_VAR___PROGNAME]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBINTL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBINTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBINTL$]) +m4trace:configure.ac:42: -1- AC_SUBST([LTLIBINTL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LTLIBINTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LTLIBINTL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETTIMEOFDAY], [/* Define to 1 if you have the \'gettimeofday\' function. */ +@%:@undef HAVE_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_NANOTIME], [/* Define to 1 if you have the \'nanotime\' function. */ +@%:@undef HAVE_NANOTIME]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETTIMEOFDAY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETTIMEOFDAY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRUCT_TIMEVAL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRUCT_TIMEVAL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_TIMEVAL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_TIME_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_TIME_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_TIME_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GETTIMEOFDAY$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRUCT_TIMEVAL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRUCT_TIMEVAL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRUCT_TIMEVAL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([restrict], [/* Define to the equivalent of the C99 \'restrict\' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#undef restrict +/* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the + previous line. Perhaps some future version of Sun C++ will work with + restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +# define _Restrict +# define __restrict__ +#endif]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([restrict]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^restrict$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([restrict]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^restrict$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TIME_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TIME_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SYS_TIME_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SYS_TIME_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_TIME_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WINSOCK2_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETTIMEOFDAY], [/* Define to 1 if gettimeofday is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETTIMEOFDAY], [/* Define to 1 if you have the \'gettimeofday\' function. */ +@%:@undef HAVE_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GETTIMEOFDAY_CLOBBERS_LOCALTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GETTIMEOFDAY_CLOBBERS_LOCALTIME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [/* Define if gettimeofday clobbers the localtime buffer. */ +@%:@undef GETTIMEOFDAY_CLOBBERS_LOCALTIME]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_CTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_CTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_LOCALTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_LOCALTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LOCALTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_NANOSLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_NANOSLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_NANOSLEEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRFTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRFTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRFTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRPTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRPTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRPTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_TIMEGM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_TIMEGM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TIMEGM$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_TIME_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_TIME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TIME_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_TIME_RZ]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_TIME_RZ]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TIME_RZ$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_TZSET]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_TZSET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TZSET$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_LOCALTIME_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_LOCALTIME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_LOCALTIME_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_NANOSLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_NANOSLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_NANOSLEEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRPTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRPTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRPTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_TIMEGM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_TIMEGM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TIMEGM$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_TZSET]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_TZSET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TZSET$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_TIMEZONE_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_TIMEZONE_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TIMEZONE_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_CTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_CTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_CTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_LOCALTIME_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_LOCALTIME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LOCALTIME_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MKTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MKTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MKTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_NANOSLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_NANOSLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_NANOSLEEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRFTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRFTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRFTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_TIMEGM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_TIMEGM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TIMEGM$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_TZSET]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_TZSET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TZSET$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETTIMEOFDAY$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_GMTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_GMTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_GMTIME$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_LOCALTIME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_LOCALTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LOCALTIME$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GETTIMEOFDAY_TIMEZONE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GETTIMEOFDAY_TIMEZONE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GETTIMEOFDAY_TIMEZONE], [/* Define this to \'void\' or \'struct timezone\' to match the system\'s + declaration of the second argument to gettimeofday. */ +@%:@undef GETTIMEOFDAY_TIMEZONE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_GETTIMEOFDAY$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_GETTIMEOFDAY], [/* Define to 1 when the gnulib module gettimeofday should be tested. */ +@%:@undef GNULIB_TEST_GETTIMEOFDAY]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GNU_MAKE], [${MAKE-make} --version /cannot/make/this >/dev/null 2>&1]) +m4trace:configure.ac:42: -1- AC_SUBST([GNU_MAKE_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNU_MAKE_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNU_MAKE_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNU_MAKE_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNU_MAKE_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNU_MAKE_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GNU_MAKE_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GNU_MAKE_FALSE]) +m4trace:configure.ac:42: -1- AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], [GNUmakefile=$GNUmakefile]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ICONV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ICONV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ICONV], [/* Define if you have the iconv() function and it works. */ +@%:@undef HAVE_ICONV]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBICONV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBICONV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBICONV$]) +m4trace:configure.ac:42: -1- AC_SUBST([LTLIBICONV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LTLIBICONV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LTLIBICONV$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([ICONV_CONST]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ICONV_CONST$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([ICONV_CONST], [/* Define as const if the declaration of iconv() needs const. */ +@%:@undef ICONV_CONST]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_ICONV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_ICONV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ICONV$]) +m4trace:configure.ac:42: -1- AC_SUBST([ICONV_CONST]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([ICONV_CONST]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ICONV_CONST$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_ICONV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_ICONV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ICONV$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_ICONV_OPEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_ICONV_OPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ICONV_OPEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_ICONV_UTF]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_ICONV_UTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ICONV_UTF$]) +m4trace:configure.ac:42: -1- AC_SUBST([ICONV_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([ICONV_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ICONV_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ICONV_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ICONV_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ICONV_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_ICONV_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_ICONV_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_ICONV_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_ICONV_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_ICONV_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_ICONV_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_ICONV_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ICONV_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ICONV_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([ICONV_FLAVOR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ICONV_FLAVOR$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([ICONV_FLAVOR], [/* Define to a symbolic name denoting the flavor of iconv_open() + implementation. */ +@%:@undef ICONV_FLAVOR]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ICONV_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_ICONV_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ICONV_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_ICONV_H_FALSE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([inline], [/* Define to \'__inline__\' or \'__inline\' if that\'s what the C compiler + calls it, or to nothing if \'inline\' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INLINE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_INLINE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_INLINE], [/* Define to 1 if the compiler supports one of the keywords \'inline\', + \'__inline__\', \'__inline\' and effectively inlines functions marked as such. + */ +@%:@undef HAVE_INLINE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([off_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^off_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([off_t], [/* Define to \'long int\' if does not define. */ +@%:@undef off_t]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LIMITS_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_LIMITS_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_LIMITS_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_LIMITS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_LIMITS_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_LIMITS_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_LIMITS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_LIMITS_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIMITS_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIMITS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIMITS_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_LIMITS_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_LIMITS_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_LIMITS_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_LIMITS_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_LIMITS_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_LIMITS_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_LIMITS_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_LIMITS_H_FALSE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINT_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINT_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WINT_T], [/* Define if you have the \'wint_t\' type. */ +@%:@undef HAVE_WINT_T]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_OVERRIDES_WINT_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_OVERRIDES_WINT_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_OVERRIDES_WINT_T$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UNSIGNED_LONG_LONG_INT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UNSIGNED_LONG_LONG_INT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNSIGNED_LONG_LONG_INT], [/* Define to 1 if the system has the type \'unsigned long long int\'. */ +@%:@undef HAVE_UNSIGNED_LONG_LONG_INT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LONG_LONG_INT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LONG_LONG_INT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LONG_LONG_INT], [/* Define to 1 if the system has the type \'long long int\'. */ +@%:@undef HAVE_LONG_LONG_INT]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LONG_LONG_INT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LONG_LONG_INT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LONG_LONG_INT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_UNSIGNED_LONG_LONG_INT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UNSIGNED_LONG_LONG_INT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCHAR_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WCHAR_H]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCHAR_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCHAR_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCHAR_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_INTTYPES_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_INTTYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_INTTYPES_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_TYPES_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_TYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_TYPES_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDINT_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_STDINT_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_STDINT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDINT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_STDINT_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_STDINT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STDINT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STDINT_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STDINT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STDINT_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([__STDC_CONSTANT_MACROS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^__STDC_CONSTANT_MACROS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([__STDC_CONSTANT_MACROS], [/* Define to 1 if the system predates C++11. */ +@%:@undef __STDC_CONSTANT_MACROS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([__STDC_LIMIT_MACROS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^__STDC_LIMIT_MACROS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([__STDC_LIMIT_MACROS], [/* Define to 1 if the system predates C++11. */ +@%:@undef __STDC_LIMIT_MACROS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_INTTYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_INTTYPES_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_INTTYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_INTTYPES_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_BITYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_BITYPES_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_BITYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_BITYPES_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([APPLE_UNIVERSAL_BUILD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([APPLE_UNIVERSAL_BUILD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^APPLE_UNIVERSAL_BUILD$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([BITSIZEOF_PTRDIFF_T], [/* Define to the number of bits in type \'ptrdiff_t\'. */ +@%:@undef BITSIZEOF_PTRDIFF_T]) +m4trace:configure.ac:42: -1- AH_OUTPUT([BITSIZEOF_SIZE_T], [/* Define to the number of bits in type \'size_t\'. */ +@%:@undef BITSIZEOF_SIZE_T]) +m4trace:configure.ac:42: -1- AC_SUBST([BITSIZEOF_PTRDIFF_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([BITSIZEOF_PTRDIFF_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^BITSIZEOF_PTRDIFF_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([BITSIZEOF_SIZE_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([BITSIZEOF_SIZE_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^BITSIZEOF_SIZE_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([BITSIZEOF_SIG_ATOMIC_T], [/* Define to the number of bits in type \'sig_atomic_t\'. */ +@%:@undef BITSIZEOF_SIG_ATOMIC_T]) +m4trace:configure.ac:42: -1- AH_OUTPUT([BITSIZEOF_WCHAR_T], [/* Define to the number of bits in type \'wchar_t\'. */ +@%:@undef BITSIZEOF_WCHAR_T]) +m4trace:configure.ac:42: -1- AH_OUTPUT([BITSIZEOF_WINT_T], [/* Define to the number of bits in type \'wint_t\'. */ +@%:@undef BITSIZEOF_WINT_T]) +m4trace:configure.ac:42: -1- AC_SUBST([BITSIZEOF_SIG_ATOMIC_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([BITSIZEOF_SIG_ATOMIC_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^BITSIZEOF_SIG_ATOMIC_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([BITSIZEOF_WCHAR_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([BITSIZEOF_WCHAR_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^BITSIZEOF_WCHAR_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([BITSIZEOF_WINT_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([BITSIZEOF_WINT_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^BITSIZEOF_WINT_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SIGNED_SIG_ATOMIC_T], [/* Define to 1 if \'sig_atomic_t\' is a signed integer type. */ +@%:@undef HAVE_SIGNED_SIG_ATOMIC_T]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SIGNED_WCHAR_T], [/* Define to 1 if \'wchar_t\' is a signed integer type. */ +@%:@undef HAVE_SIGNED_WCHAR_T]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SIGNED_WINT_T], [/* Define to 1 if \'wint_t\' is a signed integer type. */ +@%:@undef HAVE_SIGNED_WINT_T]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SIGNED_SIG_ATOMIC_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SIGNED_SIG_ATOMIC_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGNED_SIG_ATOMIC_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SIGNED_WCHAR_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SIGNED_WCHAR_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGNED_WCHAR_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SIGNED_WINT_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SIGNED_WINT_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGNED_WINT_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([PTRDIFF_T_SUFFIX], [/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + \'ptrdiff_t\'. */ +@%:@undef PTRDIFF_T_SUFFIX]) +m4trace:configure.ac:42: -1- AH_OUTPUT([SIZE_T_SUFFIX], [/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + \'size_t\'. */ +@%:@undef SIZE_T_SUFFIX]) +m4trace:configure.ac:42: -1- AC_SUBST([PTRDIFF_T_SUFFIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([PTRDIFF_T_SUFFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PTRDIFF_T_SUFFIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([SIZE_T_SUFFIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([SIZE_T_SUFFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SIZE_T_SUFFIX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([SIG_ATOMIC_T_SUFFIX], [/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + \'sig_atomic_t\'. */ +@%:@undef SIG_ATOMIC_T_SUFFIX]) +m4trace:configure.ac:42: -1- AH_OUTPUT([WCHAR_T_SUFFIX], [/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + \'wchar_t\'. */ +@%:@undef WCHAR_T_SUFFIX]) +m4trace:configure.ac:42: -1- AH_OUTPUT([WINT_T_SUFFIX], [/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + \'wint_t\'. */ +@%:@undef WINT_T_SUFFIX]) +m4trace:configure.ac:42: -1- AC_SUBST([SIG_ATOMIC_T_SUFFIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([SIG_ATOMIC_T_SUFFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SIG_ATOMIC_T_SUFFIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([WCHAR_T_SUFFIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([WCHAR_T_SUFFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WCHAR_T_SUFFIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([WINT_T_SUFFIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([WINT_T_SUFFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINT_T_SUFFIX$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_LIMITS_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_LIMITS_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_LIMITS_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_LIMITS_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_LIMITS_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_LIMITS_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_LIMITS_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_LIMITS_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_C99_STDINT_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_C99_STDINT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_C99_STDINT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_BITYPES_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_BITYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_BITYPES_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_INTTYPES_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_INTTYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_INTTYPES_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([STDINT_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([STDINT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STDINT_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDINT_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDINT_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDINT_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDINT_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDINT_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDINT_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDINT_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDINT_H_FALSE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_INTTYPES_H]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_IMAXABS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_IMAXABS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_IMAXABS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_IMAXDIV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_IMAXDIV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_IMAXDIV$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRTOIMAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRTOIMAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRTOIMAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRTOUMAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRTOUMAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRTOUMAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_IMAXABS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_IMAXABS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_IMAXABS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_IMAXDIV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_IMAXDIV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_IMAXDIV$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_STRTOIMAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_STRTOIMAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRTOIMAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_STRTOUMAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_STRTOUMAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRTOUMAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRTOIMAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRTOIMAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRTOIMAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRTOUMAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRTOUMAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRTOUMAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([INT32_MAX_LT_INTMAX_MAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([INT32_MAX_LT_INTMAX_MAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INT32_MAX_LT_INTMAX_MAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([INT64_MAX_EQ_LONG_MAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([INT64_MAX_EQ_LONG_MAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INT64_MAX_EQ_LONG_MAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([PRI_MACROS_BROKEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([PRI_MACROS_BROKEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRI_MACROS_BROKEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([PRIPTR_PREFIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([PRIPTR_PREFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRIPTR_PREFIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([UINT32_MAX_LT_UINTMAX_MAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UINT32_MAX_LT_UINTMAX_MAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([UINT64_MAX_EQ_ULONG_MAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([UINT64_MAX_EQ_ULONG_MAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UINT64_MAX_EQ_ULONG_MAX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_INTTYPES_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_INTTYPES_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_INTTYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_INTTYPES_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_IMAXABS], [/* Define to 1 if imaxabs is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_IMAXABS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_IMAXDIV], [/* Define to 1 if imaxdiv is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_IMAXDIV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRTOIMAX], [/* Define to 1 if strtoimax is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRTOIMAX]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRTOUMAX], [/* Define to 1 if strtoumax is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRTOUMAX]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_INTTYPES_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INTTYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_INTTYPES_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([PRI_MACROS_BROKEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRI_MACROS_BROKEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([PRI_MACROS_BROKEN], [/* Define if exists and defines unusable PRI* macros. */ +@%:@undef PRI_MACROS_BROKEN]) +m4trace:configure.ac:42: -1- AC_SUBST([PRI_MACROS_BROKEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([PRI_MACROS_BROKEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRI_MACROS_BROKEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([PRIPTR_PREFIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([PRIPTR_PREFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PRIPTR_PREFIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([INT32_MAX_LT_INTMAX_MAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([INT32_MAX_LT_INTMAX_MAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INT32_MAX_LT_INTMAX_MAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([INT64_MAX_EQ_LONG_MAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([INT64_MAX_EQ_LONG_MAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INT64_MAX_EQ_LONG_MAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([UINT32_MAX_LT_UINTMAX_MAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UINT32_MAX_LT_UINTMAX_MAX$]) +m4trace:configure.ac:42: -1- AC_SUBST([UINT64_MAX_EQ_ULONG_MAX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([UINT64_MAX_EQ_ULONG_MAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UINT64_MAX_EQ_ULONG_MAX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISBLANK], [/* Define to 1 if you have the \'isblank\' function. */ +@%:@undef HAVE_ISBLANK]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_ISWBLANK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_ISWBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ISWBLANK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCTYPE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCTYPE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCTYPE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_ISWCTYPE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_ISWCTYPE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ISWCTYPE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCTRANS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCTRANS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCTRANS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_TOWCTRANS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_TOWCTRANS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TOWCTRANS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_ISWBLANK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_ISWBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ISWBLANK$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCTYPE_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCTYPE_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCTYPE_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCTRANS_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCTRANS_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCTRANS_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_ISWBLANK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_ISWBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ISWBLANK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISWCNTRL], [/* Define to 1 if you have the \'iswcntrl\' function. */ +@%:@undef HAVE_ISWCNTRL]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_ISWCNTRL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_ISWCNTRL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ISWCNTRL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINT_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINT_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINT_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_CRTDEFS_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_CRTDEFS_H]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_CRTDEFS_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_CRTDEFS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_CRTDEFS_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCTYPE_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_WCTYPE_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_WCTYPE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_WCTYPE_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCTYPE_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_ISWCNTRL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_ISWCNTRL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ISWCNTRL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TOWLOWER], [/* Define to 1 if you have the \'towlower\' function. */ +@%:@undef HAVE_TOWLOWER]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TOWLOWER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TOWLOWER$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_TOWLOWER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_TOWLOWER$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_TOWLOWER], [/* Define to 1 if you have the declaration of \'towlower\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_TOWLOWER]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_TOWLOWER]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_TOWLOWER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TOWLOWER$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCTYPE], [/* Define to 1 if wctype is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCTYPE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_ISWCTYPE], [/* Define to 1 if iswctype is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_ISWCTYPE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCTRANS], [/* Define to 1 if wctrans is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCTRANS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_TOWCTRANS], [/* Define to 1 if towctrans is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_TOWCTRANS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISWBLANK], [/* Define to 1 if you have the \'iswblank\' function. */ +@%:@undef HAVE_ISWBLANK]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_ISWBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_ISWBLANK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_ISWBLANK], [/* Define to 1 if you have the declaration of \'iswblank\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_ISWBLANK]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_ISWBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_ISWBLANK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_ISWBLANK], [/* Define to 1 when the gnulib module iswblank should be tested. */ +@%:@undef GNULIB_TEST_ISWBLANK]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_NL_LANGINFO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_NL_LANGINFO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_NL_LANGINFO$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_NL_LANGINFO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_NL_LANGINFO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_NL_LANGINFO$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_NL_LANGINFO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_NL_LANGINFO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_NL_LANGINFO$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LANGINFO_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_LANGINFO_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_LANGINFO_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_LANGINFO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_LANGINFO_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LANGINFO_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_LANGINFO_H]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LANGINFO_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LANGINFO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LANGINFO_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LANGINFO_CODESET]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LANGINFO_CODESET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LANGINFO_CODESET$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LANGINFO_T_FMT_AMPM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LANGINFO_T_FMT_AMPM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LANGINFO_T_FMT_AMPM$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LANGINFO_ERA]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LANGINFO_ERA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LANGINFO_ERA$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LANGINFO_YESEXPR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LANGINFO_YESEXPR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LANGINFO_YESEXPR$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_NL_LANGINFO], [/* Define to 1 if nl_langinfo is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_NL_LANGINFO]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBSIGSEGV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LIBSIGSEGV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LIBSIGSEGV], [/* Define if you have the libsigsegv library. */ +@%:@undef HAVE_LIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_LIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_LIBSIGSEGV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LIBSIGSEGV$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBSIGSEGV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBSIGSEGV$]) +m4trace:configure.ac:42: -1- AC_SUBST([LTLIBSIGSEGV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LTLIBSIGSEGV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LTLIBSIGSEGV$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBSIGSEGV_PREFIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBSIGSEGV_PREFIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBSIGSEGV_PREFIX$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_GETC_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETC_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_GETC_UNLOCKED], [/* Define to 1 if you have the declaration of \'getc_unlocked\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_GETC_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_SUBST([GLIBC21]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GLIBC21]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GLIBC21$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALCHARSET_TESTS_ENVIRONMENT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALCHARSET_TESTS_ENVIRONMENT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_LOCALECONV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_LOCALECONV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LOCALECONV$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SETLOCALE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SETLOCALE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SETLOCALE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_DUPLOCALE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_DUPLOCALE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_DUPLOCALE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DUPLOCALE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DUPLOCALE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DUPLOCALE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_LOCALECONV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_LOCALECONV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_LOCALECONV$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_SETLOCALE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_SETLOCALE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SETLOCALE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_DUPLOCALE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_DUPLOCALE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_DUPLOCALE$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRUCT_LCONV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRUCT_LCONV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRUCT_LCONV$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_NULL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_NULL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_NULL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MAX_ALIGN_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MAX_ALIGN_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MAX_ALIGN_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCHAR_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCHAR_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCHAR_T$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WCHAR_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCHAR_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCHAR_T], [/* Define if you have the \'wchar_t\' type. */ +@%:@undef HAVE_WCHAR_T]) +m4trace:configure.ac:42: -1- AC_SUBST([STDDEF_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([STDDEF_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STDDEF_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDDEF_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDDEF_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDDEF_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDDEF_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDDEF_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDDEF_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDDEF_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDDEF_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_STDDEF_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_STDDEF_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDDEF_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_STDDEF_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_STDDEF_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STDDEF_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([_LCONV_C99]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^_LCONV_C99$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([_LCONV_C99], [/* Define to 1 on Solaris. */ +@%:@undef _LCONV_C99]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_XLOCALE_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_XLOCALE_H]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_XLOCALE_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_XLOCALE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_XLOCALE_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_LOCALE_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_LOCALE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_LOCALE_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_LOCALE_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_LOCALE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_LOCALE_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SETLOCALE], [/* Define to 1 if setlocale is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SETLOCALE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_DUPLOCALE], [/* Define to 1 if duplocale is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_DUPLOCALE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_LCONV_DECIMAL_POINT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_LCONV_DECIMAL_POINT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_LCONV_DECIMAL_POINT], [/* Define to 1 if \'decimal_point\' is a member of \'struct lconv\'. */ +@%:@undef HAVE_STRUCT_LCONV_DECIMAL_POINT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_LOCALECONV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_LOCALECONV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_LOCALECONV], [/* Define to 1 when the gnulib module localeconv should be tested. */ +@%:@undef GNULIB_TEST_LOCALECONV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LSTAT], [/* Define to 1 if you have the \'lstat\' function. */ +@%:@undef HAVE_LSTAT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([LSTAT_FOLLOWS_SLASHED_SYMLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LSTAT_FOLLOWS_SLASHED_SYMLINK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([LSTAT_FOLLOWS_SLASHED_SYMLINK], [/* Define to 1 if \'lstat\' dereferences a symlink specified with a trailing + slash. */ +@%:@undef LSTAT_FOLLOWS_SLASHED_SYMLINK]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_LSTAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_LSTAT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_LSTAT], [/* Define to 1 when the gnulib module lstat should be tested. */ +@%:@undef GNULIB_TEST_LSTAT]) +m4trace:configure.ac:42: -1- AC_SUBST([SED]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([SED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SED$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB__EXIT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB__EXIT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB__EXIT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_ATOLL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_ATOLL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ATOLL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_CALLOC_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_CALLOC_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CALLOC_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_CANONICALIZE_FILE_NAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CANONICALIZE_FILE_NAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETLOADAVG]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETLOADAVG]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETLOADAVG$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETSUBOPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETSUBOPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETSUBOPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GRANTPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GRANTPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GRANTPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MALLOC_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MALLOC_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MALLOC_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBTOWC$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKDTEMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKDTEMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKDTEMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKOSTEMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKOSTEMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKOSTEMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKOSTEMPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKOSTEMPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKOSTEMPS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKSTEMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKSTEMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKSTEMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MKSTEMPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MKSTEMPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MKSTEMPS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_POSIX_OPENPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_POSIX_OPENPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_POSIX_OPENPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PTSNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PTSNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PTSNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PTSNAME_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PTSNAME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PTSNAME_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PUTENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PUTENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PUTENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_QSORT_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_QSORT_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_QSORT_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RANDOM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RANDOM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RANDOM$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RANDOM_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RANDOM_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RANDOM_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_REALLOC_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_REALLOC_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_REALLOC_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_REALPATH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_REALPATH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_REALPATH$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RPMATCH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RPMATCH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RPMATCH$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SECURE_GETENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SECURE_GETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SECURE_GETENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SETENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SETENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRTOD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRTOD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRTOD$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRTOLL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRTOLL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRTOLL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRTOULL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRTOULL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRTOULL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SYSTEM_POSIX]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SYSTEM_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SYSTEM_POSIX$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_UNLOCKPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_UNLOCKPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNLOCKPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_UNSETENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_UNSETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNSETENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WCTOMB]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WCTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WCTOMB$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE__EXIT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE__EXIT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE__EXIT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_ATOLL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_ATOLL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ATOLL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_CANONICALIZE_FILE_NAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_CANONICALIZE_FILE_NAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_CANONICALIZE_FILE_NAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_GETLOADAVG]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_GETLOADAVG]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETLOADAVG$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GETSUBOPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GETSUBOPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETSUBOPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_GRANTPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_GRANTPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GRANTPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKDTEMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKDTEMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKDTEMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKOSTEMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKOSTEMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKOSTEMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKOSTEMPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKOSTEMPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKOSTEMPS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKSTEMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKSTEMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKSTEMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MKSTEMPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MKSTEMPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MKSTEMPS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_POSIX_OPENPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_POSIX_OPENPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_POSIX_OPENPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_PTSNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_PTSNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PTSNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_PTSNAME_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_PTSNAME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PTSNAME_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_QSORT_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_QSORT_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_QSORT_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_RANDOM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_RANDOM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RANDOM$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_RANDOM_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_RANDOM_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RANDOM_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_RANDOM_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_RANDOM_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RANDOM_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_REALPATH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_REALPATH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_REALPATH$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_RPMATCH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_RPMATCH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RPMATCH$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SECURE_GETENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SECURE_GETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SECURE_GETENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SETENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SETENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_SETENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_SETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SETENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRTOD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRTOD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRTOD$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRTOLL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRTOLL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRTOLL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRTOULL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRTOULL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRTOULL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRUCT_RANDOM_DATA]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRUCT_RANDOM_DATA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_RANDOM_DATA$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_LOADAVG_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_LOADAVG_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_LOADAVG_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_UNLOCKPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_UNLOCKPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UNLOCKPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_UNSETENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_UNSETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_UNSETENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_CALLOC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_CALLOC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_CALLOC$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_CANONICALIZE_FILE_NAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_CANONICALIZE_FILE_NAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MALLOC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MALLOC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MALLOC$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MBTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MBTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MBTOWC$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MKSTEMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MKSTEMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MKSTEMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_PTSNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_PTSNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PTSNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_PTSNAME_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_PTSNAME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PTSNAME_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_PUTENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_PUTENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PUTENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_QSORT_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_QSORT_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_QSORT_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_RANDOM_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_RANDOM_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_RANDOM_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_REALLOC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_REALLOC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_REALLOC$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_REALPATH]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_REALPATH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_REALPATH$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_SETENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_SETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SETENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRTOD]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRTOD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRTOD$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_UNSETENV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_UNSETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_UNSETENV$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_WCTOMB]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_WCTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_WCTOMB$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MALLOC_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MALLOC_POSIX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MALLOC_POSIX], [/* Define if the \'malloc\' function is POSIX compliant. */ +@%:@undef HAVE_MALLOC_POSIX]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MALLOC_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MALLOC_POSIX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MALLOC_POSIX], [/* Define to 1 when the gnulib module malloc-posix should be tested. */ +@%:@undef GNULIB_TEST_MALLOC_POSIX]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MALLOC_0_IS_NONNULL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MALLOC_0_IS_NONNULL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MALLOC_0_IS_NONNULL], [/* If malloc(0) is != NULL, define this to 1. Otherwise define this to 0. */ +@%:@undef MALLOC_0_IS_NONNULL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSINIT], [/* Define to 1 if you have the \'mbsinit\' function. */ +@%:@undef HAVE_MBSINIT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBRTOWC], [/* Define to 1 if you have the \'mbrtowc\' function. */ +@%:@undef HAVE_MBRTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_JA]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_JA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_JA$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_ZH_CN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBRTOWC], [/* Define to 1 if you have the \'mbrtowc\' function. */ +@%:@undef HAVE_MBRTOWC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_MBRTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_MBRTOWC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_MBRTOWC], [/* Define to 1 if you have the declaration of \'mbrtowc\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_MBRTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MBRTOWC_NULL_ARG1_BUG]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MBRTOWC_NULL_ARG1_BUG$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MBRTOWC_NULL_ARG1_BUG], [/* Define if the mbrtowc function has the NULL pwc argument bug. */ +@%:@undef MBRTOWC_NULL_ARG1_BUG]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MBRTOWC_NULL_ARG2_BUG]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MBRTOWC_NULL_ARG2_BUG$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MBRTOWC_NULL_ARG2_BUG], [/* Define if the mbrtowc function has the NULL string argument bug. */ +@%:@undef MBRTOWC_NULL_ARG2_BUG]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MBRTOWC_RETVAL_BUG]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MBRTOWC_RETVAL_BUG$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MBRTOWC_RETVAL_BUG], [/* Define if the mbrtowc function returns a wrong return value. */ +@%:@undef MBRTOWC_RETVAL_BUG]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MBRTOWC_NUL_RETVAL_BUG]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MBRTOWC_NUL_RETVAL_BUG$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MBRTOWC_NUL_RETVAL_BUG], [/* Define if the mbrtowc function does not return 0 for a NUL character. */ +@%:@undef MBRTOWC_NUL_RETVAL_BUG]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MBRTOWC_EMPTY_INPUT_BUG]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MBRTOWC_EMPTY_INPUT_BUG$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MBRTOWC_EMPTY_INPUT_BUG], [/* Define if the mbrtowc function does not return (size_t) -2 for empty input. + */ +@%:@undef MBRTOWC_EMPTY_INPUT_BUG]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([C_LOCALE_MAYBE_EILSEQ]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^C_LOCALE_MAYBE_EILSEQ$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([C_LOCALE_MAYBE_EILSEQ], [/* Define to 1 if the C locale may have encoding errors. */ +@%:@undef C_LOCALE_MAYBE_EILSEQ]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MBRTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBRTOWC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MBRTOWC], [/* Define to 1 when the gnulib module mbrtowc should be tested. */ +@%:@undef GNULIB_TEST_MBRTOWC]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FFSL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FFSL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FFSL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FFSLL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FFSLL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FFSLL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MEMCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MEMCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MEMMEM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MEMMEM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MEMMEM$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MEMPCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MEMPCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MEMPCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MEMRCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MEMRCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MEMRCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RAWMEMCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RAWMEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RAWMEMCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STPCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STPCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STPCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STPNCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STPNCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STPNCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRCHRNUL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRCHRNUL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRCHRNUL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRDUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRDUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRNCAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRNCAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRNCAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRNDUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRNDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRNDUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRNLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRNLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRPBRK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRPBRK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRPBRK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRSEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRSEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRSEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRSTR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRSTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRSTR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRCASESTR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRCASESTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRCASESTR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRTOK_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRTOK_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRTOK_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSNLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSNLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSRCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSRCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSRCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSSTR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSSTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSSTR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSCASECMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSCASECMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSNCASECMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSNCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSNCASECMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSPCASECMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSPCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSPCASECMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSCASESTR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSCASESTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSCASESTR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSCSPN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSCSPN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSCSPN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSPBRK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSPBRK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSPBRK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSSPN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSSPN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSSPN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSSEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSSEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSSEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_MBSTOK_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_MBSTOK_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MBSTOK_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRERROR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRERROR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRERROR$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRERROR_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRERROR_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRERROR_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRSIGNAL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRSIGNAL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRSIGNAL$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_STRVERSCMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_STRVERSCMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRVERSCMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MBSLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MBSLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBSLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FFSL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FFSL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FFSL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FFSLL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FFSLL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FFSLL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MEMCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MEMCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_MEMMEM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_MEMMEM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_MEMMEM$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_MEMPCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_MEMPCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MEMPCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_MEMRCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_MEMRCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_MEMRCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_RAWMEMCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_RAWMEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RAWMEMCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STPCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STPCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STPCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STPNCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STPNCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STPNCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRCHRNUL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRCHRNUL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRCHRNUL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_STRDUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_STRDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRDUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_STRNDUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_STRNDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRNDUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_STRNLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_STRNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRNLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRPBRK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRPBRK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRPBRK$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRSEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRSEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRSEP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRCASESTR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRCASESTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRCASESTR$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_STRTOK_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_STRTOK_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRTOK_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_STRERROR_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_STRERROR_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRERROR_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_STRSIGNAL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_STRSIGNAL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRSIGNAL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRVERSCMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRVERSCMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRVERSCMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MEMCHR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MEMCHR$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_MEMMEM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_MEMMEM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_MEMMEM$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STPNCPY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STPNCPY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STPNCPY$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRDUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRDUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRSTR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRSTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRSTR$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRCASESTR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRCASESTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRCASESTR$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRCHRNUL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRCHRNUL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRCHRNUL$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRERROR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRERROR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRERROR$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRERROR_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRERROR_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRERROR_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRNCAT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRNCAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRNCAT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRNDUP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRNDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRNDUP$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRNLEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRNLEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRSIGNAL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRSIGNAL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRSIGNAL$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_STRTOK_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_STRTOK_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRTOK_R$]) +m4trace:configure.ac:42: -1- AC_SUBST([UNDEFINE_STRTOK_R]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([UNDEFINE_STRTOK_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UNDEFINE_STRTOK_R$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MBSCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBSCASECMP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MBSCASECMP], [/* Define to 1 when the gnulib module mbscasecmp should be tested. */ +@%:@undef GNULIB_TEST_MBSCASECMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSINIT], [/* Define to 1 if you have the \'mbsinit\' function. */ +@%:@undef HAVE_MBSINIT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBRTOWC], [/* Define to 1 if you have the \'mbrtowc\' function. */ +@%:@undef HAVE_MBRTOWC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSINIT], [/* Define to 1 if you have the \'mbsinit\' function. */ +@%:@undef HAVE_MBSINIT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_MBSINIT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_MBSINIT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_MBSINIT], [/* Define to 1 if you have the declaration of \'mbsinit\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_MBSINIT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MBSINIT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBSINIT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MBSINIT], [/* Define to 1 when the gnulib module mbsinit should be tested. */ +@%:@undef GNULIB_TEST_MBSINIT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSLEN], [/* Define to 1 if you have the \'mbslen\' function. */ +@%:@undef HAVE_MBSLEN]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MBSLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBSLEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MBSLEN], [/* Define to 1 when the gnulib module mbslen should be tested. */ +@%:@undef GNULIB_TEST_MBSLEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSINIT], [/* Define to 1 if you have the \'mbsinit\' function. */ +@%:@undef HAVE_MBSINIT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBRTOWC], [/* Define to 1 if you have the \'mbrtowc\' function. */ +@%:@undef HAVE_MBRTOWC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSRTOWCS], [/* Define to 1 if you have the \'mbsrtowcs\' function. */ +@%:@undef HAVE_MBSRTOWCS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_MBSRTOWCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_MBSRTOWCS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_MBSRTOWCS], [/* Define to 1 if you have the declaration of \'mbsrtowcs\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_MBSRTOWCS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MBSRTOWCS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBSRTOWCS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MBSRTOWCS], [/* Define to 1 when the gnulib module mbsrtowcs should be tested. */ +@%:@undef GNULIB_TEST_MBSRTOWCS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MBSSTR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBSSTR$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MBSSTR], [/* Define to 1 when the gnulib module mbsstr should be tested. */ +@%:@undef GNULIB_TEST_MBSSTR]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MBTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MBTOWC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MBTOWC], [/* Define to 1 when the gnulib module mbtowc should be tested. */ +@%:@undef GNULIB_TEST_MBTOWC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MAP_ANONYMOUS], [/* Define to a substitute value for mmap()\'s MAP_ANONYMOUS flag. */ +@%:@undef MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MAP_ANONYMOUS], [/* Define to 1 if mmap()\'s MAP_ANONYMOUS flag is available after including + config.h and . */ +@%:@undef HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_MMAN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_MMAN_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MPROTECT], [/* Define to 1 if you have the \'mprotect\' function. */ +@%:@undef HAVE_MPROTECT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_BP_SYM_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_BP_SYM_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_BP_SYM_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_BP_SYM_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MEMCHR$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MEMCHR], [/* Define to 1 when the gnulib module memchr should be tested. */ +@%:@undef GNULIB_TEST_MEMCHR]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MINMAX_IN_LIMITS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MINMAX_IN_LIMITS_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MINMAX_IN_LIMITS_H], [/* Define to 1 if defines the MIN and MAX macros. */ +@%:@undef HAVE_MINMAX_IN_LIMITS_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MINMAX_IN_SYS_PARAM_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MINMAX_IN_SYS_PARAM_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MINMAX_IN_SYS_PARAM_H], [/* Define to 1 if defines the MIN and MAX macros. */ +@%:@undef HAVE_MINMAX_IN_SYS_PARAM_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MKSTEMP], [/* Define to 1 if you have the \'mkstemp\' function. */ +@%:@undef HAVE_MKSTEMP]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MKSTEMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MKSTEMP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MKSTEMP], [/* Define to 1 when the gnulib module mkstemp should be tested. */ +@%:@undef GNULIB_TEST_MKSTEMP]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([TIME_T_IS_SIGNED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^TIME_T_IS_SIGNED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([TIME_T_IS_SIGNED], [/* Define to 1 if time_t is signed. */ +@%:@undef TIME_T_IS_SIGNED]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_ALARM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_ALARM$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_ALARM], [/* Define to 1 if you have the declaration of \'alarm\', and to 0 if you don\'t. + */ +@%:@undef HAVE_DECL_ALARM]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TZSET], [/* Define to 1 if you have the \'tzset\' function. */ +@%:@undef HAVE_TZSET]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([NEED_MKTIME_WORKING]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEED_MKTIME_WORKING$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([NEED_MKTIME_WORKING], [/* Define if the compilation of mktime.c should define \'mktime\' with the + algorithmic workarounds. */ +@%:@undef NEED_MKTIME_WORKING]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([NEED_MKTIME_WINDOWS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEED_MKTIME_WINDOWS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([NEED_MKTIME_WINDOWS], [/* Define if the compilation of mktime.c should define \'mktime\' with the + native Windows TZ workaround. */ +@%:@undef NEED_MKTIME_WINDOWS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_MKTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_MKTIME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_MKTIME], [/* Define to 1 when the gnulib module mktime should be tested. */ +@%:@undef GNULIB_TEST_MKTIME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([mktime_internal]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^mktime_internal$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([mktime_internal], [/* Define to the real name of the mktime_internal function. */ +@%:@undef mktime_internal]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([NEED_MKTIME_INTERNAL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEED_MKTIME_INTERNAL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([NEED_MKTIME_INTERNAL], [/* Define if the compilation of mktime.c should define \'mktime_internal\'. */ +@%:@undef NEED_MKTIME_INTERNAL]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_MSVC_NOTHROW]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_MSVC_NOTHROW$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_MSVC_NOTHROW], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module msvc-nothrow shall be considered present. */ +@%:@undef GNULIB_MSVC_NOTHROW]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_NL_LANGINFO], [/* Define to 1 if you have the \'nl_langinfo\' function. */ +@%:@undef HAVE_NL_LANGINFO]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([FUNC_NL_LANGINFO_YESEXPR_WORKS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^FUNC_NL_LANGINFO_YESEXPR_WORKS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([FUNC_NL_LANGINFO_YESEXPR_WORKS], [/* Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string. */ +@%:@undef FUNC_NL_LANGINFO_YESEXPR_WORKS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([REPLACE_NL_LANGINFO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_NL_LANGINFO$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([REPLACE_NL_LANGINFO], [/* Define if nl_langinfo exists but is overridden by gnulib. */ +@%:@undef REPLACE_NL_LANGINFO]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_NL_LANGINFO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_NL_LANGINFO$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_NL_LANGINFO], [/* Define to 1 when the gnulib module nl_langinfo should be tested. */ +@%:@undef GNULIB_TEST_NL_LANGINFO]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LSTAT], [/* Define to 1 if you have the \'lstat\' function. */ +@%:@undef HAVE_LSTAT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([OPEN_TRAILING_SLASH_BUG]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^OPEN_TRAILING_SLASH_BUG$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([OPEN_TRAILING_SLASH_BUG], [/* Define to 1 if open() fails to recognize a trailing slash. */ +@%:@undef OPEN_TRAILING_SLASH_BUG]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([PROMOTED_MODE_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PROMOTED_MODE_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([PROMOTED_MODE_T], [/* Define to the type that is the result of default argument promotions of + type mode_t. */ +@%:@undef PROMOTED_MODE_T]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_OPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_OPEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_OPEN], [/* Define to 1 when the gnulib module open should be tested. */ +@%:@undef GNULIB_TEST_OPEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_PARAM_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_PARAM_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_PROGRAM_INVOCATION_NAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_PROGRAM_INVOCATION_NAME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_PROGRAM_INVOCATION_NAME], [/* Define to 1 if you have the declaration of \'program_invocation_name\', and + to 0 if you don\'t. */ +@%:@undef HAVE_DECL_PROGRAM_INVOCATION_NAME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME], [/* Define to 1 if you have the declaration of \'program_invocation_short_name\', + and to 0 if you don\'t. */ +@%:@undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME]) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"']) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"']) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PTHREAD_SIGMASK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PTHREAD_SIGMASK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PTHREAD_SIGMASK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RAISE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RAISE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RAISE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SIGNAL_H_SIGPIPE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SIGNAL_H_SIGPIPE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SIGNAL_H_SIGPIPE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SIGPROCMASK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SIGPROCMASK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SIGPROCMASK$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SIGACTION]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SIGACTION]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SIGACTION$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_POSIX_SIGNALBLOCKING]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_POSIX_SIGNALBLOCKING]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_POSIX_SIGNALBLOCKING$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_PTHREAD_SIGMASK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_PTHREAD_SIGMASK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PTHREAD_SIGMASK$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_RAISE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_RAISE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RAISE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SIGSET_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SIGSET_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGSET_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SIGINFO_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SIGINFO_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGINFO_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SIGACTION]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SIGACTION]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGACTION$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRUCT_SIGACTION_SA_SIGACTION]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_SIGACTION_SA_SIGACTION$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_TYPE_VOLATILE_SIG_ATOMIC_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_TYPE_VOLATILE_SIG_ATOMIC_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TYPE_VOLATILE_SIG_ATOMIC_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SIGHANDLER_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SIGHANDLER_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGHANDLER_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_PTHREAD_SIGMASK]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_PTHREAD_SIGMASK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PTHREAD_SIGMASK$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_RAISE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_RAISE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_RAISE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAISE], [/* Define to 1 if you have the \'raise\' function. */ +@%:@undef HAVE_RAISE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_RAISE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RAISE$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SIGSET_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGSET_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SIGSET_T], [/* Define to 1 if the system has the type \'sigset_t\'. */ +@%:@undef HAVE_SIGSET_T]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_RAISE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_RAISE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_RAISE], [/* Define to 1 when the gnulib module raise should be tested. */ +@%:@undef GNULIB_TEST_RAISE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAWMEMCHR], [/* Define to 1 if you have the \'rawmemchr\' function. */ +@%:@undef HAVE_RAWMEMCHR]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_RAWMEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RAWMEMCHR$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_RAWMEMCHR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_RAWMEMCHR$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_RAWMEMCHR], [/* Define to 1 when the gnulib module rawmemchr should be tested. */ +@%:@undef GNULIB_TEST_RAWMEMCHR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_READLINK], [/* Define to 1 if you have the \'readlink\' function. */ +@%:@undef HAVE_READLINK]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([READLINK_TRAILING_SLASH_BUG]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^READLINK_TRAILING_SLASH_BUG$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([READLINK_TRAILING_SLASH_BUG], [/* Define to 1 if readlink fails to recognize a trailing slash. */ +@%:@undef READLINK_TRAILING_SLASH_BUG]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_READLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_READLINK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_READLINK], [/* Define to 1 when the gnulib module readlink should be tested. */ +@%:@undef GNULIB_TEST_READLINK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MALLOC_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_MALLOC_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([_REGEX_INCLUDE_LIMITS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^_REGEX_INCLUDE_LIMITS_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([_REGEX_INCLUDE_LIMITS_H], [/* Define if you want to include , so that it consistently + overrides \'s RE_DUP_MAX. */ +@%:@undef _REGEX_INCLUDE_LIMITS_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([_REGEX_LARGE_OFFSETS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^_REGEX_LARGE_OFFSETS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([_REGEX_LARGE_OFFSETS], [/* Define if you want regoff_t to be at least as wide POSIX requires. */ +@%:@undef _REGEX_LARGE_OFFSETS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_syntax_options]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_syntax_options$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_syntax_options], [/* Define to rpl_re_syntax_options if the replacement should be used. */ +@%:@undef re_syntax_options]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_set_syntax]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_set_syntax$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_set_syntax], [/* Define to rpl_re_set_syntax if the replacement should be used. */ +@%:@undef re_set_syntax]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_compile_pattern]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_compile_pattern$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_compile_pattern], [/* Define to rpl_re_compile_pattern if the replacement should be used. */ +@%:@undef re_compile_pattern]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_compile_fastmap]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_compile_fastmap$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_compile_fastmap], [/* Define to rpl_re_compile_fastmap if the replacement should be used. */ +@%:@undef re_compile_fastmap]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_search]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_search$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_search], [/* Define to rpl_re_search if the replacement should be used. */ +@%:@undef re_search]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_search_2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_search_2$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_search_2], [/* Define to rpl_re_search_2 if the replacement should be used. */ +@%:@undef re_search_2]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_match]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_match$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_match], [/* Define to rpl_re_match if the replacement should be used. */ +@%:@undef re_match]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_match_2]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_match_2$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_match_2], [/* Define to rpl_re_match_2 if the replacement should be used. */ +@%:@undef re_match_2]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_set_registers]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_set_registers$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_set_registers], [/* Define to rpl_re_set_registers if the replacement should be used. */ +@%:@undef re_set_registers]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_comp]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_comp$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_comp], [/* Define to rpl_re_comp if the replacement should be used. */ +@%:@undef re_comp]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([re_exec]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^re_exec$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([re_exec], [/* Define to rpl_re_exec if the replacement should be used. */ +@%:@undef re_exec]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([regcomp]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^regcomp$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([regcomp], [/* Define to rpl_regcomp if the replacement should be used. */ +@%:@undef regcomp]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([regexec]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^regexec$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([regexec], [/* Define to rpl_regexec if the replacement should be used. */ +@%:@undef regexec]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([regerror]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^regerror$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([regerror], [/* Define to rpl_regerror if the replacement should be used. */ +@%:@undef regerror]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([regfree]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^regfree$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([regfree], [/* Define to rpl_regfree if the replacement should be used. */ +@%:@undef regfree]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LIBINTL_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_LIBINTL_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBINTL_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_LIBINTL_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISBLANK], [/* Define to 1 if you have the \'isblank\' function. */ +@%:@undef HAVE_ISBLANK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISWCTYPE], [/* Define to 1 if you have the \'iswctype\' function. */ +@%:@undef HAVE_ISWCTYPE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_ISBLANK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_ISBLANK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_ISBLANK], [/* Define to 1 if you have the declaration of \'isblank\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_ISBLANK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SECURE_GETENV], [/* Define to 1 if you have the \'secure_getenv\' function. */ +@%:@undef HAVE_SECURE_GETENV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE___SECURE_GETENV], [/* Define to 1 if you have the \'__secure_getenv\' function. */ +@%:@undef HAVE___SECURE_GETENV]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE___SECURE_GETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE___SECURE_GETENV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISSETUGID], [/* Define to 1 if you have the \'issetugid\' function. */ +@%:@undef HAVE_ISSETUGID]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ISSETUGID]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ISSETUGID$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETUID], [/* Define to 1 if you have the \'getuid\' function. */ +@%:@undef HAVE_GETUID]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETEUID], [/* Define to 1 if you have the \'geteuid\' function. */ +@%:@undef HAVE_GETEUID]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETGID], [/* Define to 1 if you have the \'getgid\' function. */ +@%:@undef HAVE_GETGID]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETEGID], [/* Define to 1 if you have the \'getegid\' function. */ +@%:@undef HAVE_GETEGID]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SECURE_GETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SECURE_GETENV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SECURE_GETENV], [/* Define to 1 when the gnulib module secure_getenv should be tested. */ +@%:@undef GNULIB_TEST_SECURE_GETENV]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_SETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SETENV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_SETENV], [/* Define to 1 if you have the declaration of \'setenv\', and to 0 if you don\'t. + */ +@%:@undef HAVE_DECL_SETENV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SETENV], [/* Define to 1 if you have the \'setenv\' function. */ +@%:@undef HAVE_SETENV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SEARCH_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SEARCH_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SEARCH_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SEARCH_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TSEARCH], [/* Define to 1 if you have the \'tsearch\' function. */ +@%:@undef HAVE_TSEARCH]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TSEARCH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TSEARCH$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SETENV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SETENV], [/* Define to 1 when the gnulib module setenv should be tested. */ +@%:@undef GNULIB_TEST_SETENV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SIGACTION], [/* Define to 1 if you have the \'sigaction\' function. */ +@%:@undef HAVE_SIGACTION]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SIGACTION_SA_SIGACTION]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_SIGACTION_SA_SIGACTION$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_SIGACTION_SA_SIGACTION], [/* Define to 1 if \'sa_sigaction\' is a member of \'struct sigaction\'. */ +@%:@undef HAVE_STRUCT_SIGACTION_SA_SIGACTION]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([uid_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^uid_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([uid_t], [/* Define as \'int\' if doesn\'t define. */ +@%:@undef uid_t]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([gid_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^gid_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([gid_t], [/* Define as \'int\' if doesn\'t define. */ +@%:@undef gid_t]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SIGALTSTACK], [/* Define to 1 if you have the \'sigaltstack\' function. */ +@%:@undef HAVE_SIGALTSTACK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SIGINTERRUPT], [/* Define to 1 if you have the \'siginterrupt\' function. */ +@%:@undef HAVE_SIGINTERRUPT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SIGINFO_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SIGINFO_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SIGINFO_T], [/* Define to 1 if the system has the type \'siginfo_t\'. */ +@%:@undef HAVE_SIGINFO_T]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SIGACTION]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SIGACTION$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SIGACTION], [/* Define to 1 when the gnulib module sigaction should be tested. */ +@%:@undef GNULIB_TEST_SIGACTION]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SIGNAL_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SIGNAL_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SIGNAL_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_PTHREAD_SIGMASK], [/* Define to 1 if pthread_sigmask is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_PTHREAD_SIGMASK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SIGACTION], [/* Define to 1 if sigaction is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SIGACTION]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SIGADDSET], [/* Define to 1 if sigaddset is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SIGADDSET]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SIGDELSET], [/* Define to 1 if sigdelset is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SIGDELSET]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SIGEMPTYSET], [/* Define to 1 if sigemptyset is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SIGEMPTYSET]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SIGFILLSET], [/* Define to 1 if sigfillset is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SIGFILLSET]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SIGISMEMBER], [/* Define to 1 if sigismember is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SIGISMEMBER]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SIGPENDING], [/* Define to 1 if sigpending is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SIGPENDING]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SIGPROCMASK], [/* Define to 1 if sigprocmask is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SIGPROCMASK]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SIGPROCMASK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SIGPROCMASK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SIGPROCMASK], [/* Define to 1 when the gnulib module sigprocmask should be tested. */ +@%:@undef GNULIB_TEST_SIGPROCMASK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDINT_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STDINT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STDINT_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([SIZE_MAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SIZE_MAX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([SIZE_MAX], [/* Define as the maximum value of type \'size_t\', if the system doesn\'t define + it. */ +@%:@undef SIZE_MAX]) +m4trace:configure.ac:42: -1- AH_OUTPUT([SIZE_MAX], [/* Define as the maximum value of type \'size_t\', if the system doesn\'t define + it. */ +#ifndef SIZE_MAX +# undef SIZE_MAX +#endif]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([ssize_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ssize_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([ssize_t], [/* Define as a signed type of the same size as size_t. */ +@%:@undef ssize_t]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LSTAT], [/* Define to 1 if you have the \'lstat\' function. */ +@%:@undef HAVE_LSTAT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([REPLACE_FUNC_STAT_FILE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_FUNC_STAT_FILE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([REPLACE_FUNC_STAT_FILE], [/* Define to 1 if stat needs help when passed a file name with a trailing + slash */ +@%:@undef REPLACE_FUNC_STAT_FILE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_STAT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STAT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_STAT], [/* Define to 1 when the gnulib module stat should be tested. */ +@%:@undef GNULIB_TEST_STAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TIME_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC], [/* Define to 1 if \'st_atim.tv_nsec\' is a member of \'struct stat\'. */ +@%:@undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], [/* Define to 1 if the type of the st_atim member of a struct stat is struct + timespec. */ +@%:@undef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC], [/* Define to 1 if \'st_atimespec.tv_nsec\' is a member of \'struct stat\'. */ +@%:@undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_ATIMENSEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_ATIMENSEC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_ATIMENSEC], [/* Define to 1 if \'st_atimensec\' is a member of \'struct stat\'. */ +@%:@undef HAVE_STRUCT_STAT_ST_ATIMENSEC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC], [/* Define to 1 if \'st_atim.st__tim.tv_nsec\' is a member of \'struct stat\'. */ +@%:@undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TIME_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC], [/* Define to 1 if \'st_birthtimespec.tv_nsec\' is a member of \'struct stat\'. */ +@%:@undef HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC], [/* Define to 1 if \'st_birthtimensec\' is a member of \'struct stat\'. */ +@%:@undef HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC], [/* Define to 1 if \'st_birthtim.tv_nsec\' is a member of \'struct stat\'. */ +@%:@undef HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_STDARG_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_STDARG_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDARG_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_STDARG_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_STDARG_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STDARG_H$]) +m4trace:configure.ac:42: -1- _m4_warn([obsolete], [$as_echo_n is obsolete; use AS_ECHO_N(["message"]) instead], [m4/gnulib-common.m4:399: gl_CACHE_VAL_SILENT is expanded from... +m4/stdarg.m4:10: gl_STDARG_H is expanded from... +m4/gnulib-comp.m4:445: gl_INIT is expanded from... +configure.ac:42: the top level]) +m4trace:configure.ac:42: -1- _m4_warn([obsolete], [$as_echo_n is obsolete; use AS_ECHO_N(["message"]) instead], [m4/gnulib-common.m4:399: gl_CACHE_VAL_SILENT is expanded from... +m4/stdarg.m4:10: gl_STDARG_H is expanded from... +m4/gnulib-comp.m4:445: gl_INIT is expanded from... +configure.ac:42: the top level]) +m4trace:configure.ac:42: -1- _m4_warn([obsolete], [$as_echo_n is obsolete; use AS_ECHO_N(["message"]) instead], [m4/gnulib-common.m4:399: gl_CACHE_VAL_SILENT is expanded from... +m4/stdarg.m4:10: gl_STDARG_H is expanded from... +m4/gnulib-comp.m4:445: gl_INIT is expanded from... +configure.ac:42: the top level]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([va_copy]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^va_copy$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([va_copy], [/* Define as a macro for copying va_list variables. */ +@%:@undef va_copy]) +m4trace:configure.ac:42: -1- AH_OUTPUT([gl_VA_COPY], [/* A replacement for va_copy, if needed. */ +#define gl_va_copy(a,b) ((a) = (b))]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([va_copy]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^va_copy$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([va_copy], [/* Define as a macro for copying va_list variables. */ +@%:@undef va_copy]) +m4trace:configure.ac:42: -1- AC_SUBST([STDARG_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([STDARG_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STDARG_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_STDARG_H], [test -n "$STDARG_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDARG_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDARG_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDARG_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDARG_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDARG_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDARG_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDARG_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDARG_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_STDARG_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_STDARG_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDARG_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE__BOOL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE__BOOL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE__BOOL], [/* Define to 1 if the system has the type \'_Bool\'. */ +@%:@undef HAVE__BOOL]) +m4trace:configure.ac:42: -1- AC_SUBST([STDBOOL_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([STDBOOL_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STDBOOL_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDBOOL_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDBOOL_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDBOOL_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDBOOL_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDBOOL_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDBOOL_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDBOOL_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDBOOL_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE__BOOL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE__BOOL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE__BOOL$]) +m4trace:configure.ac:42: -1- AC_SUBST([STDDEF_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([STDDEF_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STDDEF_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDDEF_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDDEF_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDDEF_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDDEF_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDDEF_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDDEF_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDDEF_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDDEF_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_STDDEF_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_STDDEF_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDDEF_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_STDDEF_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_STDDEF_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STDDEF_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MINGW_ANSI_STDIO], [/* Use GNU style printf and scanf. */ +#ifndef __USE_MINGW_ANSI_STDIO +# undef __USE_MINGW_ANSI_STDIO +#endif +]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([__USE_MINGW_ANSI_STDIO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^__USE_MINGW_ANSI_STDIO$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_STDIO_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_STDIO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDIO_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_STDIO_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_STDIO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STDIO_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU], [/* Define to 1 if printf and friends should be labeled with attribute + "__gnu_printf__" instead of "__printf__" */ +@%:@undef GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_FSCANF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FSCANF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_FSCANF], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module fscanf shall be considered present. */ +@%:@undef GNULIB_FSCANF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_SCANF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SCANF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_SCANF], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module scanf shall be considered present. */ +@%:@undef GNULIB_SCANF]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_DPRINTF], [/* Define to 1 if dprintf is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_DPRINTF]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FPURGE], [/* Define to 1 if fpurge is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FPURGE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FSEEKO], [/* Define to 1 if fseeko is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FSEEKO]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FTELLO], [/* Define to 1 if ftello is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FTELLO]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETDELIM], [/* Define to 1 if getdelim is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETDELIM]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETLINE], [/* Define to 1 if getline is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETLINE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETS], [/* Define to 1 if gets is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_PCLOSE], [/* Define to 1 if pclose is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_PCLOSE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_POPEN], [/* Define to 1 if popen is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_POPEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_RENAMEAT], [/* Define to 1 if renameat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_RENAMEAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SNPRINTF], [/* Define to 1 if snprintf is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SNPRINTF]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_TMPFILE], [/* Define to 1 if tmpfile is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_TMPFILE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_VDPRINTF], [/* Define to 1 if vdprintf is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_VDPRINTF]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_VSNPRINTF], [/* Define to 1 if vsnprintf is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_VSNPRINTF]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_STDLIB_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_STDLIB_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STDLIB_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_STDLIB_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_STDLIB_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STDLIB_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL__EXIT], [/* Define to 1 if _Exit is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL__EXIT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_ATOLL], [/* Define to 1 if atoll is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_ATOLL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_CANONICALIZE_FILE_NAME], [/* Define to 1 if canonicalize_file_name is declared even after undefining + macros. */ +@%:@undef HAVE_RAW_DECL_CANONICALIZE_FILE_NAME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETLOADAVG], [/* Define to 1 if getloadavg is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETLOADAVG]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETSUBOPT], [/* Define to 1 if getsubopt is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETSUBOPT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GRANTPT], [/* Define to 1 if grantpt is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GRANTPT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_INITSTATE], [/* Define to 1 if initstate is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_INITSTATE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_INITSTATE_R], [/* Define to 1 if initstate_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_INITSTATE_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKDTEMP], [/* Define to 1 if mkdtemp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKDTEMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKOSTEMP], [/* Define to 1 if mkostemp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKOSTEMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKOSTEMPS], [/* Define to 1 if mkostemps is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKOSTEMPS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKSTEMP], [/* Define to 1 if mkstemp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKSTEMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKSTEMPS], [/* Define to 1 if mkstemps is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKSTEMPS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_POSIX_OPENPT], [/* Define to 1 if posix_openpt is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_POSIX_OPENPT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_PTSNAME], [/* Define to 1 if ptsname is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_PTSNAME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_PTSNAME_R], [/* Define to 1 if ptsname_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_PTSNAME_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_QSORT_R], [/* Define to 1 if qsort_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_QSORT_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_RANDOM], [/* Define to 1 if random is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_RANDOM]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_RANDOM_R], [/* Define to 1 if random_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_RANDOM_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_REALPATH], [/* Define to 1 if realpath is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_REALPATH]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_RPMATCH], [/* Define to 1 if rpmatch is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_RPMATCH]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SECURE_GETENV], [/* Define to 1 if secure_getenv is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SECURE_GETENV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SETENV], [/* Define to 1 if setenv is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SETENV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SETSTATE], [/* Define to 1 if setstate is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SETSTATE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SETSTATE_R], [/* Define to 1 if setstate_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SETSTATE_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SRANDOM], [/* Define to 1 if srandom is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SRANDOM]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SRANDOM_R], [/* Define to 1 if srandom_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SRANDOM_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRTOD], [/* Define to 1 if strtod is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRTOD]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRTOLL], [/* Define to 1 if strtoll is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRTOLL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRTOULL], [/* Define to 1 if strtoull is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRTOULL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_UNLOCKPT], [/* Define to 1 if unlockpt is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_UNLOCKPT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_UNSETENV], [/* Define to 1 if unsetenv is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_UNSETENV]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_FFS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_FFS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_FFS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FFS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FFS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FFS$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRCASECMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRCASECMP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_STRNCASECMP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_STRNCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRNCASECMP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRCASECMP], [/* Define to 1 if you have the \'strcasecmp\' function. */ +@%:@undef HAVE_STRCASECMP]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRCASECMP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRNCASECMP], [/* Define to 1 if you have the \'strncasecmp\' function. */ +@%:@undef HAVE_STRNCASECMP]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRNCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRNCASECMP$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_STRNCASECMP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRNCASECMP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_STRNCASECMP], [/* Define to 1 if you have the declaration of \'strncasecmp\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_STRNCASECMP]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([REPLACE_STRERROR_0]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_STRERROR_0$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([REPLACE_STRERROR_0], [/* Define to 1 if strerror(0) does not return a message implying success. */ +@%:@undef REPLACE_STRERROR_0]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRERROR_R], [/* Define to 1 if you have the \'strerror_r\' function. */ +@%:@undef HAVE_STRERROR_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE___XPG_STRERROR_R], [/* Define to 1 if you have the \'__xpg_strerror_r\' function. */ +@%:@undef HAVE___XPG_STRERROR_R]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_STRERROR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRERROR$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_STRERROR], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module strerror shall be considered present. */ +@%:@undef GNULIB_STRERROR]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_STRERROR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STRERROR$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_STRERROR], [/* Define to 1 when the gnulib module strerror should be tested. */ +@%:@undef GNULIB_TEST_STRERROR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WINSOCK2_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([TM_IN_SYS_TIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^TM_IN_SYS_TIME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([TM_IN_SYS_TIME], [/* Define to 1 if your declares \'struct tm\'. */ +@%:@undef TM_IN_SYS_TIME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_TM_TM_ZONE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_TM_TM_ZONE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_TM_TM_ZONE], [/* Define to 1 if \'tm_zone\' is a member of \'struct tm\'. */ +@%:@undef HAVE_STRUCT_TM_TM_ZONE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TM_ZONE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TM_ZONE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TM_ZONE], [/* Define to 1 if your \'struct tm\' has \'tm_zone\'. Deprecated, use + \'HAVE_STRUCT_TM_TM_ZONE\' instead. */ +@%:@undef HAVE_TM_ZONE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_TZNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_TZNAME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_TZNAME], [/* Define to 1 if you have the declaration of \'tzname\', and to 0 if you don\'t. + */ +@%:@undef HAVE_DECL_TZNAME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TZNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TZNAME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TZNAME], [/* Define to 1 if you don\'t have \'tm_zone\' but do have the external array + \'tzname\'. */ +@%:@undef HAVE_TZNAME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TM_GMTOFF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TM_GMTOFF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TM_GMTOFF], [/* Define if struct tm has the tm_gmtoff member. */ +@%:@undef HAVE_TM_GMTOFF]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TZSET], [/* Define to 1 if you have the \'tzset\' function. */ +@%:@undef HAVE_TZSET]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([my_strftime]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^my_strftime$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([my_strftime], [/* Define to the name of the strftime replacement function. */ +@%:@undef my_strftime]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_STRING_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_STRING_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STRING_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_STRING_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_STRING_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STRING_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FFSL], [/* Define to 1 if ffsl is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FFSL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FFSLL], [/* Define to 1 if ffsll is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FFSLL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MEMMEM], [/* Define to 1 if memmem is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MEMMEM]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MEMPCPY], [/* Define to 1 if mempcpy is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MEMPCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MEMRCHR], [/* Define to 1 if memrchr is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MEMRCHR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_RAWMEMCHR], [/* Define to 1 if rawmemchr is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_RAWMEMCHR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STPCPY], [/* Define to 1 if stpcpy is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STPCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STPNCPY], [/* Define to 1 if stpncpy is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STPNCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRCHRNUL], [/* Define to 1 if strchrnul is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRCHRNUL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRDUP], [/* Define to 1 if strdup is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRDUP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRNCAT], [/* Define to 1 if strncat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRNCAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRNDUP], [/* Define to 1 if strndup is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRNDUP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRNLEN], [/* Define to 1 if strnlen is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRNLEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRPBRK], [/* Define to 1 if strpbrk is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRPBRK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRSEP], [/* Define to 1 if strsep is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRSEP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRCASESTR], [/* Define to 1 if strcasestr is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRCASESTR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRTOK_R], [/* Define to 1 if strtok_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRTOK_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRERROR_R], [/* Define to 1 if strerror_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRERROR_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRSIGNAL], [/* Define to 1 if strsignal is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRSIGNAL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRVERSCMP], [/* Define to 1 if strverscmp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRVERSCMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRINGS_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_STRINGS_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_STRINGS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_STRINGS_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_STRINGS_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_STRINGS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_STRINGS_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRINGS_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRINGS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRINGS_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FFS], [/* Define to 1 if ffs is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FFS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRCASECMP], [/* Define to 1 if strcasecmp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRCASECMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STRNCASECMP], [/* Define to 1 if strncasecmp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STRNCASECMP]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_STRNDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRNDUP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_STRNDUP], [/* Define to 1 if you have the declaration of \'strndup\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_STRNDUP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRNDUP], [/* Define to 1 if you have the \'strndup\' function. */ +@%:@undef HAVE_STRNDUP]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_STRNDUP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STRNDUP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_STRNDUP], [/* Define to 1 when the gnulib module strndup should be tested. */ +@%:@undef GNULIB_TEST_STRNDUP]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_STRNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRNLEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_STRNLEN], [/* Define to 1 if you have the declaration of \'strnlen\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_STRNLEN]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_STRNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STRNLEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_STRNLEN], [/* Define to 1 when the gnulib module strnlen should be tested. */ +@%:@undef GNULIB_TEST_STRNLEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRPTIME], [/* Define to 1 if you have the \'strptime\' function. */ +@%:@undef HAVE_STRPTIME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_STRPTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STRPTIME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_STRPTIME], [/* Define to 1 when the gnulib module strptime should be tested. */ +@%:@undef GNULIB_TEST_STRPTIME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRTOULL], [/* Define to 1 if you have the \'strtoull\' function. */ +@%:@undef HAVE_STRTOULL]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRTOULL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRTOULL$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_STRTOULL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STRTOULL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_STRTOULL], [/* Define to 1 when the gnulib module strtoull should be tested. */ +@%:@undef GNULIB_TEST_STRTOULL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRTOUMAX], [/* Define to 1 if you have the \'strtoumax\' function. */ +@%:@undef HAVE_STRTOUMAX]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_STRTOUMAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRTOUMAX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_STRTOUMAX], [/* Define to 1 if you have the declaration of \'strtoumax\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_STRTOUMAX]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_STRTOULL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_STRTOULL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_STRTOULL], [/* Define to 1 if you have the declaration of \'strtoull\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_STRTOULL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_STAT_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SYS_STAT_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SYS_STAT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_STAT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([WINDOWS_STAT_TIMESPEC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([WINDOWS_STAT_TIMESPEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_STAT_TIMESPEC$]) +m4trace:configure.ac:42: -1- AC_SUBST([WINDOWS_64_BIT_ST_SIZE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([WINDOWS_64_BIT_ST_SIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_64_BIT_ST_SIZE$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([nlink_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^nlink_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([nlink_t], [/* Define to the type of st_nlink in struct stat, or a supertype. */ +@%:@undef nlink_t]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FCHMODAT], [/* Define to 1 if fchmodat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FCHMODAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FSTAT], [/* Define to 1 if fstat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FSTAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FSTATAT], [/* Define to 1 if fstatat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FSTATAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FUTIMENS], [/* Define to 1 if futimens is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FUTIMENS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_LCHMOD], [/* Define to 1 if lchmod is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_LCHMOD]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_LSTAT], [/* Define to 1 if lstat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_LSTAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKDIRAT], [/* Define to 1 if mkdirat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKDIRAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKFIFO], [/* Define to 1 if mkfifo is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKFIFO]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKFIFOAT], [/* Define to 1 if mkfifoat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKFIFOAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKNOD], [/* Define to 1 if mknod is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKNOD]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MKNODAT], [/* Define to 1 if mknodat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MKNODAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_STAT], [/* Define to 1 if stat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_STAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_UTIMENSAT], [/* Define to 1 if utimensat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_UTIMENSAT]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SYS_TYPES_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SYS_TYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_TYPES_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([WINDOWS_64_BIT_OFF_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([WINDOWS_64_BIT_OFF_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_64_BIT_OFF_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([WINDOWS_STAT_INODES]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([WINDOWS_STAT_INODES]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_STAT_INODES$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_WAITPID]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_WAITPID]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_WAITPID$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_WAIT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_WAIT_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SYS_WAIT_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SYS_WAIT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_WAIT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WAITPID], [/* Define to 1 if waitpid is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WAITPID]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_TIME_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_TIME_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_TIME_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_TIME_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_TIME_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_TIME_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TIME_H]) +m4trace:configure.ac:42: -1- AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([TIME_H_DEFINES_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^TIME_H_DEFINES_STRUCT_TIMESPEC$]) +m4trace:configure.ac:42: -1- AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^SYS_TIME_H_DEFINES_STRUCT_TIMESPEC$]) +m4trace:configure.ac:42: -1- AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([PTHREAD_H_DEFINES_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PTHREAD_H_DEFINES_STRUCT_TIMESPEC$]) +m4trace:configure.ac:42: -1- AC_SUBST([UNISTD_H_DEFINES_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([UNISTD_H_DEFINES_STRUCT_TIMESPEC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^UNISTD_H_DEFINES_STRUCT_TIMESPEC$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_LOCALTIME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_LOCALTIME_R$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_LOCALTIME_R], [/* Define to 1 if you have the declaration of \'localtime_r\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_LOCALTIME_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_LOCALTIME_R], [/* Define to 1 if you have the \'localtime_r\' function. */ +@%:@undef HAVE_LOCALTIME_R]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_TIME_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_TIME_R$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_TIME_R], [/* Define to 1 when the gnulib module time_r should be tested. */ +@%:@undef GNULIB_TEST_TIME_R]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TIMEZONE_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TIMEZONE_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TIMEZONE_T], [/* Define to 1 if the system has the type \'timezone_t\'. */ +@%:@undef HAVE_TIMEZONE_T]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_TIME_RZ]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_TIME_RZ$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_TIME_RZ], [/* Define to 1 when the gnulib module time_rz should be tested. */ +@%:@undef GNULIB_TEST_TIME_RZ]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TIMEGM], [/* Define to 1 if you have the \'timegm\' function. */ +@%:@undef HAVE_TIMEGM]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_TIMEGM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_TIMEGM$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_TIMEGM], [/* Define to 1 when the gnulib module timegm should be tested. */ +@%:@undef GNULIB_TEST_TIMEGM]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TZSET], [/* Define to 1 if you have the \'tzset\' function. */ +@%:@undef HAVE_TZSET]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_RUN_TZSET_TEST]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_RUN_TZSET_TEST$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RUN_TZSET_TEST], [/* Define to 1 if you have run the test for working tzset. */ +@%:@undef HAVE_RUN_TZSET_TEST]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([TZSET_CLOBBERS_LOCALTIME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^TZSET_CLOBBERS_LOCALTIME$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([TZSET_CLOBBERS_LOCALTIME], [/* Define if tzset clobbers localtime\'s static buffer. */ +@%:@undef TZSET_CLOBBERS_LOCALTIME]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_TZSET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_TZSET$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_TZSET], [/* Define to 1 when the gnulib module tzset should be tested. */ +@%:@undef GNULIB_TEST_TZSET]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_UNISTD_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_UNISTD_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_UNISTD_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_UNISTD_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_UNISTD_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_UNISTD_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UNISTD_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_CHDIR], [/* Define to 1 if chdir is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_CHDIR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_CHOWN], [/* Define to 1 if chown is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_CHOWN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_DUP], [/* Define to 1 if dup is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_DUP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_DUP2], [/* Define to 1 if dup2 is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_DUP2]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_DUP3], [/* Define to 1 if dup3 is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_DUP3]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_ENVIRON], [/* Define to 1 if environ is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_ENVIRON]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_EUIDACCESS], [/* Define to 1 if euidaccess is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_EUIDACCESS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FACCESSAT], [/* Define to 1 if faccessat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FACCESSAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FCHDIR], [/* Define to 1 if fchdir is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FCHDIR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FCHOWNAT], [/* Define to 1 if fchownat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FCHOWNAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FDATASYNC], [/* Define to 1 if fdatasync is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FDATASYNC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FSYNC], [/* Define to 1 if fsync is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FSYNC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_FTRUNCATE], [/* Define to 1 if ftruncate is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_FTRUNCATE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETCWD], [/* Define to 1 if getcwd is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETCWD]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETDOMAINNAME], [/* Define to 1 if getdomainname is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETDOMAINNAME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETDTABLESIZE], [/* Define to 1 if getdtablesize is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETDTABLESIZE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETGROUPS], [/* Define to 1 if getgroups is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETGROUPS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETHOSTNAME], [/* Define to 1 if gethostname is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETHOSTNAME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETLOGIN], [/* Define to 1 if getlogin is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETLOGIN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETLOGIN_R], [/* Define to 1 if getlogin_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETLOGIN_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETPAGESIZE], [/* Define to 1 if getpagesize is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETPAGESIZE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETUSERSHELL], [/* Define to 1 if getusershell is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETUSERSHELL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SETUSERSHELL], [/* Define to 1 if setusershell is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SETUSERSHELL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_ENDUSERSHELL], [/* Define to 1 if endusershell is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_ENDUSERSHELL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GROUP_MEMBER], [/* Define to 1 if group_member is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GROUP_MEMBER]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_ISATTY], [/* Define to 1 if isatty is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_ISATTY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_LCHOWN], [/* Define to 1 if lchown is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_LCHOWN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_LINK], [/* Define to 1 if link is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_LINK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_LINKAT], [/* Define to 1 if linkat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_LINKAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_LSEEK], [/* Define to 1 if lseek is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_LSEEK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_PIPE], [/* Define to 1 if pipe is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_PIPE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_PIPE2], [/* Define to 1 if pipe2 is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_PIPE2]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_PREAD], [/* Define to 1 if pread is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_PREAD]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_PWRITE], [/* Define to 1 if pwrite is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_PWRITE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_READLINK], [/* Define to 1 if readlink is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_READLINK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_READLINKAT], [/* Define to 1 if readlinkat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_READLINKAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_RMDIR], [/* Define to 1 if rmdir is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_RMDIR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SETHOSTNAME], [/* Define to 1 if sethostname is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SETHOSTNAME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SLEEP], [/* Define to 1 if sleep is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SLEEP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SYMLINK], [/* Define to 1 if symlink is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SYMLINK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SYMLINKAT], [/* Define to 1 if symlinkat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SYMLINKAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_TRUNCATE], [/* Define to 1 if truncate is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_TRUNCATE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_TTYNAME_R], [/* Define to 1 if ttyname_r is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_TTYNAME_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_UNLINK], [/* Define to 1 if unlink is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_UNLINK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_UNLINKAT], [/* Define to 1 if unlinkat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_UNLINKAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_USLEEP], [/* Define to 1 if usleep is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_USLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBUNISTRING_UNISTR_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBUNISTRING_UNISTR_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_UNISTR_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_UNISTR_U8_MBTOUCR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNISTR_U8_MBTOUCR$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_UNISTR_U8_MBTOUCR], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module unistr/u8-mbtoucr shall be considered present. */ +@%:@undef GNULIB_UNISTR_U8_MBTOUCR]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR], [gl_LIBUNISTRING_VERSION_CMP([0.9])]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_UNISTR_U8_UCTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_UNISTR_U8_UCTOMB$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_UNISTR_U8_UCTOMB], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module unistr/u8-uctomb shall be considered present. */ +@%:@undef GNULIB_UNISTR_U8_UCTOMB]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB], [gl_LIBUNISTRING_VERSION_CMP([0.9])]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBUNISTRING_UNITYPES_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBUNISTRING_UNITYPES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_UNITYPES_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBUNISTRING_UNIWIDTH_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBUNISTRING_UNIWIDTH_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_UNIWIDTH_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH], [gl_LIBUNISTRING_VERSION_CMP([0.9.6])]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([USE_UNLOCKED_IO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^USE_UNLOCKED_IO$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([USE_UNLOCKED_IO], [/* Define to 1 if you want getc etc. to use unlocked I/O if available. + Unlocked I/O can improve performance in unithreaded apps, but it is not + safe for multithreaded apps. */ +@%:@undef USE_UNLOCKED_IO]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_CLEARERR_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_CLEARERR_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_CLEARERR_UNLOCKED], [/* Define to 1 if you have the declaration of \'clearerr_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_CLEARERR_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_FEOF_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FEOF_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_FEOF_UNLOCKED], [/* Define to 1 if you have the declaration of \'feof_unlocked\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_FEOF_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_FERROR_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FERROR_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_FERROR_UNLOCKED], [/* Define to 1 if you have the declaration of \'ferror_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_FERROR_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_FFLUSH_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FFLUSH_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_FFLUSH_UNLOCKED], [/* Define to 1 if you have the declaration of \'fflush_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_FFLUSH_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_FGETS_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FGETS_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_FGETS_UNLOCKED], [/* Define to 1 if you have the declaration of \'fgets_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_FGETS_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_FPUTC_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FPUTC_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_FPUTC_UNLOCKED], [/* Define to 1 if you have the declaration of \'fputc_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_FPUTC_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_FPUTS_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FPUTS_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_FPUTS_UNLOCKED], [/* Define to 1 if you have the declaration of \'fputs_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_FPUTS_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_FREAD_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FREAD_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_FREAD_UNLOCKED], [/* Define to 1 if you have the declaration of \'fread_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_FREAD_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_FWRITE_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_FWRITE_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_FWRITE_UNLOCKED], [/* Define to 1 if you have the declaration of \'fwrite_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_FWRITE_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_GETCHAR_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_GETCHAR_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_GETCHAR_UNLOCKED], [/* Define to 1 if you have the declaration of \'getchar_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_GETCHAR_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_PUTC_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_PUTC_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_PUTC_UNLOCKED], [/* Define to 1 if you have the declaration of \'putc_unlocked\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_PUTC_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_PUTCHAR_UNLOCKED]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_PUTCHAR_UNLOCKED$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_PUTCHAR_UNLOCKED], [/* Define to 1 if you have the declaration of \'putchar_unlocked\', and to 0 if + you don\'t. */ +@%:@undef HAVE_DECL_PUTCHAR_UNLOCKED]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_UNSETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_UNSETENV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_UNSETENV], [/* Define to 1 if you have the declaration of \'unsetenv\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_UNSETENV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNSETENV], [/* Define to 1 if you have the \'unsetenv\' function. */ +@%:@undef HAVE_UNSETENV]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UNSETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_UNSETENV$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([VOID_UNSETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^VOID_UNSETENV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([VOID_UNSETENV], [/* Define to 1 if unsetenv returns void instead of int. */ +@%:@undef VOID_UNSETENV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_UNSETENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_UNSETENV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_UNSETENV], [/* Define to 1 when the gnulib module unsetenv should be tested. */ +@%:@undef GNULIB_TEST_UNSETENV]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_C_VARARRAYS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_C_VARARRAYS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_C_VARARRAYS], [/* Define to 1 if C supports variable-length arrays. */ +@%:@undef HAVE_C_VARARRAYS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([__STDC_NO_VLA__]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^__STDC_NO_VLA__$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([__STDC_NO_VLA__], [/* Define to 1 if C does not support variable-length arrays, and if the + compiler does not already define this. */ +@%:@undef __STDC_NO_VLA__]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_VASNPRINTF], [/* Define to 1 if you have the \'vasnprintf\' function. */ +@%:@undef HAVE_VASNPRINTF]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_VASNPRINTF], [/* Define to 1 if you have the \'vasnprintf\' function. */ +@%:@undef HAVE_VASNPRINTF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([REPLACE_VASNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_VASNPRINTF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([REPLACE_VASNPRINTF], [/* Define if vasnprintf exists but is overridden by gnulib. */ +@%:@undef REPLACE_VASNPRINTF]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_FEATURES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_FEATURES_H]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_FEATURES_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_FEATURES_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_FEATURES_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([ptrdiff_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^ptrdiff_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([ptrdiff_t], [/* Define as the type of the result of subtracting two pointers, if the system + doesn\'t define it. */ +@%:@undef ptrdiff_t]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INTTYPES_H_WITH_UINTMAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_INTTYPES_H_WITH_UINTMAX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_INTTYPES_H_WITH_UINTMAX], [/* Define if exists, doesn\'t clash with , and + declares uintmax_t. */ +@%:@undef HAVE_INTTYPES_H_WITH_UINTMAX]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STDINT_H_WITH_UINTMAX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STDINT_H_WITH_UINTMAX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STDINT_H_WITH_UINTMAX], [/* Define if exists, doesn\'t clash with , and declares + uintmax_t. */ +@%:@undef HAVE_STDINT_H_WITH_UINTMAX]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INTMAX_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_INTMAX_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_INTMAX_T], [/* Define if you have the \'intmax_t\' type in or . */ +@%:@undef HAVE_INTMAX_T]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([intmax_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^intmax_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([intmax_t], [/* Define to long or long long if and don\'t define. */ +@%:@undef intmax_t]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SNPRINTF], [/* Define to 1 if you have the \'snprintf\' function. */ +@%:@undef HAVE_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SNPRINTF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRNLEN], [/* Define to 1 if you have the \'strnlen\' function. */ +@%:@undef HAVE_STRNLEN]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRNLEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCSLEN], [/* Define to 1 if you have the \'wcslen\' function. */ +@%:@undef HAVE_WCSLEN]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WCSLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSLEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCSNLEN], [/* Define to 1 if you have the \'wcsnlen\' function. */ +@%:@undef HAVE_WCSNLEN]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WCSNLEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCSNLEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBRTOWC], [/* Define to 1 if you have the \'mbrtowc\' function. */ +@%:@undef HAVE_MBRTOWC]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MBRTOWC]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MBRTOWC$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCRTOMB], [/* Define to 1 if you have the \'wcrtomb\' function. */ +@%:@undef HAVE_WCRTOMB]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WCRTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCRTOMB$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL__SNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL__SNPRINTF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL__SNPRINTF], [/* Define to 1 if you have the declaration of \'_snprintf\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL__SNPRINTF]) +m4trace:configure.ac:42: -1- AH_OUTPUT([WORDS_BIGENDIAN], [/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([AC_APPLE_UNIVERSAL_BUILD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^AC_APPLE_UNIVERSAL_BUILD$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([AC_APPLE_UNIVERSAL_BUILD], [/* Define if building universal (internal helper macro) */ +@%:@undef AC_APPLE_UNIVERSAL_BUILD]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([DBL_EXPBIT0_WORD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^DBL_EXPBIT0_WORD$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([DBL_EXPBIT0_WORD], [/* Define as the word index where to find the exponent of \'double\'. */ +@%:@undef DBL_EXPBIT0_WORD]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([DBL_EXPBIT0_BIT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^DBL_EXPBIT0_BIT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([DBL_EXPBIT0_BIT], [/* Define as the bit index in the word where to find bit 0 of the exponent of + \'double\'. */ +@%:@undef DBL_EXPBIT0_BIT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SNPRINTF], [/* Define to 1 if you have the \'snprintf\' function. */ +@%:@undef HAVE_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SNPRINTF_RETVAL_C99]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SNPRINTF_RETVAL_C99$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SNPRINTF_RETVAL_C99], [/* Define if the return value of the snprintf function is the number of of + bytes (excluding the terminating NUL) that would have been produced if the + buffer had been large enough. */ +@%:@undef HAVE_SNPRINTF_RETVAL_C99]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_VASPRINTF], [/* Define to 1 if you have the \'vasprintf\' function. */ +@%:@undef HAVE_VASPRINTF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_VASPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_VASPRINTF$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_VASPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_VASPRINTF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_VASPRINTF], [/* Define to 1 when the gnulib module vasprintf should be tested. */ +@%:@undef GNULIB_TEST_VASPRINTF]) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--flag=asprintf:2:c-format]) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--flag=vasprintf:2:c-format]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_PACKAGER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PACKAGE_PACKAGER$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([PACKAGE_PACKAGER], [/* String identifying the packager of this software */ +@%:@undef PACKAGE_PACKAGER]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_PACKAGER_VERSION]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PACKAGE_PACKAGER_VERSION$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([PACKAGE_PACKAGER_VERSION], [/* Packager-specific version information */ +@%:@undef PACKAGE_PACKAGER_VERSION]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_PACKAGER_BUG_REPORTS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^PACKAGE_PACKAGER_BUG_REPORTS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([PACKAGE_PACKAGER_BUG_REPORTS], [/* Packager info for bug reports (URL/e-mail/...) */ +@%:@undef PACKAGE_PACKAGER_BUG_REPORTS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCHAR_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WCHAR_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_WCHAR_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_WCHAR_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_WCHAR_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_WCHAR_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_WCHAR_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_WCHAR_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCHAR_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCHAR_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCHAR_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINT_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINT_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINT_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_BTOWC], [/* Define to 1 if btowc is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_BTOWC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCTOB], [/* Define to 1 if wctob is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCTOB]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MBSINIT], [/* Define to 1 if mbsinit is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MBSINIT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MBRTOWC], [/* Define to 1 if mbrtowc is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MBRTOWC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MBRLEN], [/* Define to 1 if mbrlen is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MBRLEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MBSRTOWCS], [/* Define to 1 if mbsrtowcs is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MBSRTOWCS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_MBSNRTOWCS], [/* Define to 1 if mbsnrtowcs is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_MBSNRTOWCS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCRTOMB], [/* Define to 1 if wcrtomb is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCRTOMB]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSRTOMBS], [/* Define to 1 if wcsrtombs is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSRTOMBS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSNRTOMBS], [/* Define to 1 if wcsnrtombs is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSNRTOMBS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCWIDTH], [/* Define to 1 if wcwidth is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCWIDTH]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WMEMCHR], [/* Define to 1 if wmemchr is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WMEMCHR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WMEMCMP], [/* Define to 1 if wmemcmp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WMEMCMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WMEMCPY], [/* Define to 1 if wmemcpy is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WMEMCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WMEMMOVE], [/* Define to 1 if wmemmove is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WMEMMOVE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WMEMSET], [/* Define to 1 if wmemset is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WMEMSET]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSLEN], [/* Define to 1 if wcslen is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSLEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSNLEN], [/* Define to 1 if wcsnlen is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSNLEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSCPY], [/* Define to 1 if wcscpy is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCPCPY], [/* Define to 1 if wcpcpy is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCPCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSNCPY], [/* Define to 1 if wcsncpy is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSNCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCPNCPY], [/* Define to 1 if wcpncpy is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCPNCPY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSCAT], [/* Define to 1 if wcscat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSCAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSNCAT], [/* Define to 1 if wcsncat is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSNCAT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSCMP], [/* Define to 1 if wcscmp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSCMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSNCMP], [/* Define to 1 if wcsncmp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSNCMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSCASECMP], [/* Define to 1 if wcscasecmp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSCASECMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSNCASECMP], [/* Define to 1 if wcsncasecmp is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSNCASECMP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSCOLL], [/* Define to 1 if wcscoll is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSCOLL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSXFRM], [/* Define to 1 if wcsxfrm is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSXFRM]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSDUP], [/* Define to 1 if wcsdup is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSDUP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSCHR], [/* Define to 1 if wcschr is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSCHR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSRCHR], [/* Define to 1 if wcsrchr is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSRCHR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSCSPN], [/* Define to 1 if wcscspn is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSCSPN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSSPN], [/* Define to 1 if wcsspn is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSSPN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSPBRK], [/* Define to 1 if wcspbrk is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSPBRK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSSTR], [/* Define to 1 if wcsstr is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSSTR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSTOK], [/* Define to 1 if wcstok is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSTOK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSWIDTH], [/* Define to 1 if wcswidth is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSWIDTH]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCSFTIME], [/* Define to 1 if wcsftime is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCSFTIME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBSINIT], [/* Define to 1 if you have the \'mbsinit\' function. */ +@%:@undef HAVE_MBSINIT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MBRTOWC], [/* Define to 1 if you have the \'mbrtowc\' function. */ +@%:@undef HAVE_MBRTOWC]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCRTOMB], [/* Define to 1 if you have the \'wcrtomb\' function. */ +@%:@undef HAVE_WCRTOMB]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_WCRTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_WCRTOMB$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_WCRTOMB], [/* Define to 1 if you have the declaration of \'wcrtomb\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_WCRTOMB]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_WCRTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_WCRTOMB$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_WCRTOMB], [/* Define to 1 when the gnulib module wcrtomb should be tested. */ +@%:@undef GNULIB_TEST_WCRTOMB]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ISWCNTRL], [/* Define to 1 if you have the \'iswcntrl\' function. */ +@%:@undef HAVE_ISWCNTRL]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_ISWCNTRL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_ISWCNTRL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ISWCNTRL$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINT_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINT_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINT_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCTYPE_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_WCTYPE_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_WCTYPE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_WCTYPE_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WCTYPE_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WCTYPE_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_ISWCNTRL]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_ISWCNTRL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_ISWCNTRL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_TOWLOWER], [/* Define to 1 if you have the \'towlower\' function. */ +@%:@undef HAVE_TOWLOWER]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TOWLOWER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_TOWLOWER$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_TOWLOWER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_TOWLOWER$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_TOWLOWER], [/* Define to 1 if you have the declaration of \'towlower\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_TOWLOWER]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_TOWLOWER]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_TOWLOWER]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_TOWLOWER$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCTYPE], [/* Define to 1 if wctype is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCTYPE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_ISWCTYPE], [/* Define to 1 if iswctype is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_ISWCTYPE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_WCTRANS], [/* Define to 1 if wctrans is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_WCTRANS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_TOWCTRANS], [/* Define to 1 if towctrans is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_TOWCTRANS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCHAR_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WCHAR_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCWIDTH], [/* Define to 1 if you have the \'wcwidth\' function. */ +@%:@undef HAVE_WCWIDTH]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_WCWIDTH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_WCWIDTH$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_WCWIDTH], [/* Define to 1 if you have the declaration of \'wcwidth\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_WCWIDTH]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_WCWIDTH]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_WCWIDTH$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_WCWIDTH], [/* Define to 1 when the gnulib module wcwidth should be tested. */ +@%:@undef GNULIB_TEST_WCWIDTH]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDINT_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STDINT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STDINT_H$]) +m4trace:configure.ac:42: -1- AM_XGETTEXT_OPTION([--flag=xasprintf:1:c-format]) +m4trace:configure.ac:42: -1- AC_SUBST([gltests_WITNESS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([gltests_WITNESS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^gltests_WITNESS$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SOCKET]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SOCKET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SOCKET$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_CONNECT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_CONNECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_CONNECT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_ACCEPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_ACCEPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ACCEPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_BIND]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_BIND]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_BIND$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETPEERNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETPEERNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETPEERNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETSOCKNAME]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETSOCKNAME]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETSOCKNAME$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_GETSOCKOPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_GETSOCKOPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_GETSOCKOPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_LISTEN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_LISTEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_LISTEN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RECV]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RECV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RECV$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SEND]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SEND]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SEND$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_RECVFROM]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_RECVFROM]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_RECVFROM$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SENDTO]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SENDTO]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SENDTO$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SETSOCKOPT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SETSOCKOPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SETSOCKOPT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SHUTDOWN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SHUTDOWN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SHUTDOWN$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_ACCEPT4]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_ACCEPT4]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_ACCEPT4$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRUCT_SOCKADDR_STORAGE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SA_FAMILY_T]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SA_FAMILY_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SA_FAMILY_T$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_ACCEPT4]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_ACCEPT4]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ACCEPT4$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([_POSIX_PII_SOCKET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^_POSIX_PII_SOCKET$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([_POSIX_PII_SOCKET], [/* Define to 1 in order to get the POSIX compatible declarations of socket + functions. */ +@%:@undef _POSIX_PII_SOCKET]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SHUTDOWN], [/* Define to 1 if you have the \'shutdown\' function. */ +@%:@undef HAVE_SHUTDOWN]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SHUTDOWN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SHUTDOWN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WS2TCPIP_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WS2TCPIP_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WS2TCPIP_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WS2TCPIP_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SYS_SOCKET_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_SOCKET_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_SOCKET_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WS2TCPIP_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WS2TCPIP_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WS2TCPIP_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_STORAGE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_SOCKADDR_STORAGE], [/* Define to 1 if the system has the type \'struct sockaddr_storage\'. */ +@%:@undef HAVE_STRUCT_SOCKADDR_STORAGE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SA_FAMILY_T]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SA_FAMILY_T$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SA_FAMILY_T], [/* Define to 1 if the system has the type \'sa_family_t\'. */ +@%:@undef HAVE_SA_FAMILY_T]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY], [/* Define to 1 if \'ss_family\' is a member of \'struct sockaddr_storage\'. */ +@%:@undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WINSOCK2_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SOCKET], [/* Define to 1 if socket is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SOCKET]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_CONNECT], [/* Define to 1 if connect is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_CONNECT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_ACCEPT], [/* Define to 1 if accept is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_ACCEPT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_BIND], [/* Define to 1 if bind is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_BIND]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETPEERNAME], [/* Define to 1 if getpeername is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETPEERNAME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETSOCKNAME], [/* Define to 1 if getsockname is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETSOCKNAME]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_GETSOCKOPT], [/* Define to 1 if getsockopt is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_GETSOCKOPT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_LISTEN], [/* Define to 1 if listen is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_LISTEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_RECV], [/* Define to 1 if recv is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_RECV]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SEND], [/* Define to 1 if send is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SEND]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_RECVFROM], [/* Define to 1 if recvfrom is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_RECVFROM]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SENDTO], [/* Define to 1 if sendto is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SENDTO]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SETSOCKOPT], [/* Define to 1 if setsockopt is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SETSOCKOPT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SHUTDOWN], [/* Define to 1 if shutdown is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SHUTDOWN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_ACCEPT4], [/* Define to 1 if accept4 is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_ACCEPT4]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_ACCEPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_ACCEPT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_ACCEPT], [/* Define to 1 when the gnulib module accept should be tested. */ +@%:@undef GNULIB_TEST_ACCEPT]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_INET_NTOP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_INET_NTOP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_INET_NTOP$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_INET_PTON]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_INET_PTON]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_INET_PTON$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_INET_NTOP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_INET_NTOP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_INET_NTOP$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_DECL_INET_PTON]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_DECL_INET_PTON]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_INET_PTON$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_INET_NTOP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_INET_NTOP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_INET_NTOP$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_INET_PTON]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_INET_PTON]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_INET_PTON$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ARPA_INET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_ARPA_INET_H]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_ARPA_INET_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_ARPA_INET_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_ARPA_INET_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_ARPA_INET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_ARPA_INET_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_ARPA_INET_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_ARPA_INET_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_ARPA_INET_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_INET_NTOP], [/* Define to 1 if inet_ntop is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_INET_NTOP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_INET_PTON], [/* Define to 1 if inet_pton is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_INET_PTON]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_BIND]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_BIND$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_BIND], [/* Define to 1 when the gnulib module bind should be tested. */ +@%:@undef GNULIB_TEST_BIND]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_TR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_TR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_TR_UTF8$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_CONNECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_CONNECT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_CONNECT], [/* Define to 1 when the gnulib module connect should be tested. */ +@%:@undef GNULIB_TEST_CONNECT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_FDOPEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_FDOPEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_FDOPEN], [/* Define to 1 when the gnulib module fdopen should be tested. */ +@%:@undef GNULIB_TEST_FDOPEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_FTRUNCATE], [/* Define to 1 if you have the \'ftruncate\' function. */ +@%:@undef HAVE_FTRUNCATE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_CHSIZE], [/* Define to 1 if you have the \'chsize\' function. */ +@%:@undef HAVE_CHSIZE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CHSIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_CHSIZE$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_FTRUNCATE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_FTRUNCATE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_FTRUNCATE], [/* Define to 1 when the gnulib module ftruncate should be tested. */ +@%:@undef GNULIB_TEST_FTRUNCATE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_GETCWD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_GETCWD$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_GETCWD], [/* Define to 1 when the gnulib module getcwd should be tested. */ +@%:@undef GNULIB_TEST_GETCWD]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_GETPAGESIZE], [/* Define to 1 if you have the \'getpagesize\' function. */ +@%:@undef HAVE_GETPAGESIZE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETPAGESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_GETPAGESIZE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_OS_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_OS_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OS_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_OS_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_PARAM_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_PARAM_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_PARAM_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_PARAM_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_GETPAGESIZE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_GETPAGESIZE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_GETPAGESIZE], [/* Define to 1 when the gnulib module getpagesize should be tested. */ +@%:@undef GNULIB_TEST_GETPAGESIZE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WINSOCK2_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_INET_PTON]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_INET_PTON$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_INET_PTON], [/* Define to 1 if you have the declaration of \'inet_pton\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_INET_PTON]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_INET_PTON], [/* Define to 1 if you have the \'inet_pton\' function. */ +@%:@undef HAVE_INET_PTON]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_PTON]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_INET_PTON$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_NETDB_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_NETDB_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_INET_PTON]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_INET_PTON$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_INET_PTON], [/* Define to 1 if you have the declaration of \'inet_pton\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_INET_PTON]) +m4trace:configure.ac:42: -1- AC_SUBST([INET_PTON_LIB]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([INET_PTON_LIB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^INET_PTON_LIB$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_NETINET_IN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_NETINET_IN_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IPV4]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_IPV4$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_IPV4], [/* Define to 1 if defines AF_INET. */ +@%:@undef HAVE_IPV4]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IPV6]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_IPV6$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_IPV6], [/* Define to 1 if defines AF_INET6. */ +@%:@undef HAVE_IPV6]) +m4trace:configure.ac:42: -1- AH_OUTPUT([WORDS_BIGENDIAN], [/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([WORDS_BIGENDIAN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WORDS_BIGENDIAN$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([AC_APPLE_UNIVERSAL_BUILD]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^AC_APPLE_UNIVERSAL_BUILD$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([AC_APPLE_UNIVERSAL_BUILD], [/* Define if building universal (internal helper macro) */ +@%:@undef AC_APPLE_UNIVERSAL_BUILD]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_IOCTL], [/* Define to 1 if you have the \'ioctl\' function. */ +@%:@undef HAVE_IOCTL]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IOCTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_IOCTL$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_IOCTL]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_IOCTL$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_IOCTL], [/* Define to 1 when the gnulib module ioctl should be tested. */ +@%:@undef GNULIB_TEST_IOCTL]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_LISTEN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_LISTEN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_LISTEN], [/* Define to 1 when the gnulib module listen should be tested. */ +@%:@undef GNULIB_TEST_LISTEN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_NEWLOCALE], [/* Define to 1 if you have the \'newlocale\' function. */ +@%:@undef HAVE_NEWLOCALE]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_JA]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_JA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_JA$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_ZH_CN$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_TR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_TR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_TR_UTF8$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_JA]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_JA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_JA$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_ZH_CN$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_ZH_CN$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MAP_ANONYMOUS], [/* Define to a substitute value for mmap()\'s MAP_ANONYMOUS flag. */ +@%:@undef MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MAP_ANONYMOUS], [/* Define to 1 if mmap()\'s MAP_ANONYMOUS flag is available after including + config.h and . */ +@%:@undef HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_MMAN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_MMAN_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MPROTECT], [/* Define to 1 if you have the \'mprotect\' function. */ +@%:@undef HAVE_MPROTECT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TIME_H]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_PSELECT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_PSELECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_PSELECT$]) +m4trace:configure.ac:42: -1- AC_SUBST([GNULIB_SELECT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GNULIB_SELECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SELECT$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_PSELECT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_PSELECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_PSELECT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_PSELECT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_PSELECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_PSELECT$]) +m4trace:configure.ac:42: -1- AC_SUBST([REPLACE_SELECT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([REPLACE_SELECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^REPLACE_SELECT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SELECT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SELECT_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SYS_SELECT_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SYS_SELECT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_SELECT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_SELECT_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_SELECT_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_SELECT_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WINSOCK2_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_PSELECT], [/* Define to 1 if pselect is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_PSELECT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_SELECT], [/* Define to 1 if select is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_SELECT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WINSOCK2_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_WINSOCK2_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_WINSOCK2_H$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([WINDOWS_SOCKETS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^WINDOWS_SOCKETS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([WINDOWS_SOCKETS], [/* Define if WSAStartup is needed. */ +@%:@undef WINDOWS_SOCKETS]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBSOCKET]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBSOCKET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBSOCKET$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SELECT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SELECT_H]) +m4trace:configure.ac:42: -1- AC_SUBST([LIB_SELECT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIB_SELECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIB_SELECT$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIB_NANOSLEEP]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIB_NANOSLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIB_NANOSLEEP$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_BUG_BIG_NANOSLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_BUG_BIG_NANOSLEEP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_BUG_BIG_NANOSLEEP], [/* Define to 1 if nanosleep mishandles large arguments. */ +@%:@undef HAVE_BUG_BIG_NANOSLEEP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SELECT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SELECT_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_NANOSLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_NANOSLEEP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_NANOSLEEP], [/* Define to 1 when the gnulib module nanosleep should be tested. */ +@%:@undef GNULIB_TEST_NANOSLEEP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_NETINET_IN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_NETINET_IN_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NETINET_IN_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_NETINET_IN_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_NETINET_IN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_NETINET_IN_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_NETINET_IN_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_NETINET_IN_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_NETINET_IN_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_NETINET_IN_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_NETINET_IN_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_NETINET_IN_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NETINET_IN_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NETINET_IN_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NETINET_IN_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_NETINET_IN_H], [test -n "$NETINET_IN_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_NETINET_IN_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_NETINET_IN_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_NETINET_IN_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_NETINET_IN_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_NETINET_IN_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_NETINET_IN_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_NETINET_IN_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_NETINET_IN_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_PERROR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_PERROR$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_PERROR], [/* Define to 1 when the gnulib module perror should be tested. */ +@%:@undef GNULIB_TEST_PERROR]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_PIPE], [/* Define to 1 if you have the \'pipe\' function. */ +@%:@undef HAVE_PIPE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_PIPE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_PIPE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_PIPE], [/* Define to 1 when the gnulib module pipe should be tested. */ +@%:@undef GNULIB_TEST_PIPE]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL__PUTENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL__PUTENV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL__PUTENV], [/* Define to 1 if you have the declaration of \'_putenv\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL__PUTENV]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_PUTENV]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_PUTENV$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_PUTENV], [/* Define to 1 when the gnulib module putenv should be tested. */ +@%:@undef GNULIB_TEST_PUTENV]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MAP_ANONYMOUS], [/* Define to a substitute value for mmap()\'s MAP_ANONYMOUS flag. */ +@%:@undef MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MAP_ANONYMOUS], [/* Define to 1 if mmap()\'s MAP_ANONYMOUS flag is available after including + config.h and . */ +@%:@undef HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_MMAN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_MMAN_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MPROTECT], [/* Define to 1 if you have the \'mprotect\' function. */ +@%:@undef HAVE_MPROTECT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MAP_ANONYMOUS], [/* Define to a substitute value for mmap()\'s MAP_ANONYMOUS flag. */ +@%:@undef MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MAP_ANONYMOUS], [/* Define to 1 if mmap()\'s MAP_ANONYMOUS flag is available after including + config.h and . */ +@%:@undef HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_MMAN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_MMAN_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MPROTECT], [/* Define to 1 if you have the \'mprotect\' function. */ +@%:@undef HAVE_MPROTECT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_SELECT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SELECT_H]) +m4trace:configure.ac:42: -1- AC_SUBST([LIB_SELECT]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIB_SELECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIB_SELECT$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SELECT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SELECT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SELECT], [/* Define to 1 when the gnulib module select should be tested. */ +@%:@undef GNULIB_TEST_SELECT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_WAIT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_WAIT_H]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SETLOCALE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SETLOCALE$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SETLOCALE], [/* Define to 1 when the gnulib module setlocale should be tested. */ +@%:@undef GNULIB_TEST_SETLOCALE]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_JA]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_JA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_JA$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_ZH_CN$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SETSOCKOPT]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SETSOCKOPT$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SETSOCKOPT], [/* Define to 1 when the gnulib module setsockopt should be tested. */ +@%:@undef GNULIB_TEST_SETSOCKOPT]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_SLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SLEEP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_SLEEP], [/* Define to 1 if you have the declaration of \'sleep\', and to 0 if you don\'t. + */ +@%:@undef HAVE_DECL_SLEEP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SLEEP], [/* Define to 1 if you have the \'sleep\' function. */ +@%:@undef HAVE_SLEEP]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SLEEP]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SLEEP$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SLEEP], [/* Define to 1 when the gnulib module sleep should be tested. */ +@%:@undef GNULIB_TEST_SLEEP]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SNPRINTF], [/* Define to 1 if you have the \'snprintf\' function. */ +@%:@undef HAVE_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SNPRINTF$]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_SNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_SNPRINTF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_SNPRINTF], [/* Define to 1 if you have the declaration of \'snprintf\', and to 0 if you + don\'t. */ +@%:@undef HAVE_DECL_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SNPRINTF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SNPRINTF], [/* Define to 1 when the gnulib module snprintf should be tested. */ +@%:@undef GNULIB_TEST_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_SNPRINTF]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_SNPRINTF$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_SNPRINTF], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module snprintf shall be considered present. */ +@%:@undef GNULIB_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SOCKET]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SOCKET$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SOCKET], [/* Define to 1 when the gnulib module socket should be tested. */ +@%:@undef GNULIB_TEST_SOCKET]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([socklen_t]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^socklen_t$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([socklen_t], [/* type to use in place of socklen_t if not defined */ +@%:@undef socklen_t]) +m4trace:configure.ac:42: -1- AC_SUBST([STDALIGN_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([STDALIGN_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^STDALIGN_H$]) +m4trace:configure.ac:42: -1- AM_CONDITIONAL([GL_GENERATE_STDALIGN_H], [test -n "$STDALIGN_H"]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDALIGN_H_TRUE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDALIGN_H_TRUE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDALIGN_H_TRUE$]) +m4trace:configure.ac:42: -1- AC_SUBST([GL_GENERATE_STDALIGN_H_FALSE]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([GL_GENERATE_STDALIGN_H_FALSE]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GL_GENERATE_STDALIGN_H_FALSE$]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDALIGN_H_TRUE]) +m4trace:configure.ac:42: -1- _AM_SUBST_NOTMAKE([GL_GENERATE_STDALIGN_H_FALSE]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE___XPG_STRERROR_R], [/* Define to 1 if you have the \'__xpg_strerror_r\' function. */ +@%:@undef HAVE___XPG_STRERROR_R]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_CATGETS], [/* Define to 1 if you have the \'catgets\' function. */ +@%:@undef HAVE_CATGETS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SNPRINTF], [/* Define to 1 if you have the \'snprintf\' function. */ +@%:@undef HAVE_SNPRINTF]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_STRERROR_R]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_STRERROR_R$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_STRERROR_R], [/* Define to 1 when the gnulib module strerror_r should be tested. */ +@%:@undef GNULIB_TEST_STRERROR_R]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_STRERROR_R_POSIX]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_STRERROR_R_POSIX$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_STRERROR_R_POSIX], [/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module strerror_r-posix shall be considered present. */ +@%:@undef GNULIB_STRERROR_R_POSIX]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([MAP_ANONYMOUS], [/* Define to a substitute value for mmap()\'s MAP_ANONYMOUS flag. */ +@%:@undef MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_MAP_ANONYMOUS$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MAP_ANONYMOUS], [/* Define to 1 if mmap()\'s MAP_ANONYMOUS flag is available after including + config.h and . */ +@%:@undef HAVE_MAP_ANONYMOUS]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_MMAN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_MMAN_H]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_MPROTECT], [/* Define to 1 if you have the \'mprotect\' function. */ +@%:@undef HAVE_MPROTECT]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYMLINK], [/* Define to 1 if you have the \'symlink\' function. */ +@%:@undef HAVE_SYMLINK]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_SYMLINK]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_SYMLINK$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_SYMLINK], [/* Define to 1 when the gnulib module symlink should be tested. */ +@%:@undef GNULIB_TEST_SYMLINK]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_IOCTL_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_IOCTL_H]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_IOCTL_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_IOCTL_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_IOCTL_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_IOCTL_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_IOCTL_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SYS_IOCTL_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SYS_IOCTL_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_IOCTL_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_RAW_DECL_IOCTL], [/* Define to 1 if ioctl is declared even after undefining macros. */ +@%:@undef HAVE_RAW_DECL_IOCTL]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SHUTDOWN], [/* Define to 1 if you have the \'shutdown\' function. */ +@%:@undef HAVE_SHUTDOWN]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_SYS_UIO_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_UIO_H]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_SYS_UIO_H], [AS_VAR_GET(gl_next_header)]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_SYS_UIO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_SYS_UIO_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H], [$gl_next_as_first_directive]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([HAVE_SYS_UIO_H]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([HAVE_SYS_UIO_H]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_SYS_UIO_H$]) +m4trace:configure.ac:42: -1- AC_SUBST([abs_aux_dir]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([abs_aux_dir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^abs_aux_dir$]) +m4trace:configure.ac:42: -1- AC_SUBST([abs_aux_dir]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([abs_aux_dir]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^abs_aux_dir$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_FR_UTF8]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_FR_UTF8$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_JA]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_JA]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_JA$]) +m4trace:configure.ac:42: -1- AC_SUBST([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LOCALE_ZH_CN]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LOCALE_ZH_CN$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_WCTOB], [/* Define to 1 if you have the \'wctob\' function. */ +@%:@undef HAVE_WCTOB]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_WCTOB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^HAVE_DECL_WCTOB$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([HAVE_DECL_WCTOB], [/* Define to 1 if you have the declaration of \'wctob\', and to 0 if you don\'t. + */ +@%:@undef HAVE_DECL_WCTOB]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_WCTOB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_WCTOB$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_WCTOB], [/* Define to 1 when the gnulib module wctob should be tested. */ +@%:@undef GNULIB_TEST_WCTOB]) +m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_TEST_WCTOMB]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^GNULIB_TEST_WCTOMB$]) +m4trace:configure.ac:42: -1- AH_OUTPUT([GNULIB_TEST_WCTOMB], [/* Define to 1 when the gnulib module wctomb should be tested. */ +@%:@undef GNULIB_TEST_WCTOMB]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBDIFFUTILS_LIBDEPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBDIFFUTILS_LIBDEPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBDIFFUTILS_LIBDEPS$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBDIFFUTILS_LTLIBDEPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBDIFFUTILS_LTLIBDEPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBDIFFUTILS_LTLIBDEPS$]) +m4trace:configure.ac:42: -1- AC_SUBST([LIBTESTS_LIBDEPS]) +m4trace:configure.ac:42: -1- AC_SUBST_TRACE([LIBTESTS_LIBDEPS]) +m4trace:configure.ac:42: -1- m4_pattern_allow([^LIBTESTS_LIBDEPS$]) +m4trace:configure.ac:60: -1- AC_SUBST([WERROR_CFLAGS]) +m4trace:configure.ac:60: -1- AC_SUBST_TRACE([WERROR_CFLAGS]) +m4trace:configure.ac:60: -1- m4_pattern_allow([^WERROR_CFLAGS$]) +m4trace:configure.ac:61: -1- AC_SUBST([WERROR_CFLAGS]) +m4trace:configure.ac:61: -1- AC_SUBST_TRACE([WERROR_CFLAGS]) +m4trace:configure.ac:61: -1- m4_pattern_allow([^WERROR_CFLAGS$]) +m4trace:configure.ac:98: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:98: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:98: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:100: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:100: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:100: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:101: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:101: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:101: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:102: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:102: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:102: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:103: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:103: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:103: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:104: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:104: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:104: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:108: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:108: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:108: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:110: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:110: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:110: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:111: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:111: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:111: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:112: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:112: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:112: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:114: -1- AC_SUBST([WARN_CFLAGS]) +m4trace:configure.ac:114: -1- AC_SUBST_TRACE([WARN_CFLAGS]) +m4trace:configure.ac:114: -1- m4_pattern_allow([^WARN_CFLAGS$]) +m4trace:configure.ac:116: -1- AC_DEFINE_TRACE_LITERAL([lint]) +m4trace:configure.ac:116: -1- m4_pattern_allow([^lint$]) +m4trace:configure.ac:116: -1- AH_OUTPUT([lint], [/* Define to 1 if the compiler is checking for lint. */ +@%:@undef lint]) +m4trace:configure.ac:117: -1- AC_DEFINE_TRACE_LITERAL([_FORTIFY_SOURCE]) +m4trace:configure.ac:117: -1- m4_pattern_allow([^_FORTIFY_SOURCE$]) +m4trace:configure.ac:117: -1- AH_OUTPUT([_FORTIFY_SOURCE], [/* enable compile-time and run-time bounds-checking, and some warnings */ +@%:@undef _FORTIFY_SOURCE]) +m4trace:configure.ac:119: -1- AC_DEFINE_TRACE_LITERAL([GNULIB_PORTCHECK]) +m4trace:configure.ac:119: -1- m4_pattern_allow([^GNULIB_PORTCHECK$]) +m4trace:configure.ac:119: -1- AH_OUTPUT([GNULIB_PORTCHECK], [/* enable some gnulib portability checks */ +@%:@undef GNULIB_PORTCHECK]) +m4trace:configure.ac:129: -1- AC_SUBST([GNULIB_WARN_CFLAGS]) +m4trace:configure.ac:129: -1- AC_SUBST_TRACE([GNULIB_WARN_CFLAGS]) +m4trace:configure.ac:129: -1- m4_pattern_allow([^GNULIB_WARN_CFLAGS$]) +m4trace:configure.ac:132: -1- AH_OUTPUT([inline], [/* Define to \'__inline__\' or \'__inline\' if that\'s what the C compiler + calls it, or to nothing if \'inline\' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif]) +m4trace:configure.ac:133: -1- AC_DEFINE_TRACE_LITERAL([HAVE_C_VARARRAYS]) +m4trace:configure.ac:133: -1- m4_pattern_allow([^HAVE_C_VARARRAYS$]) +m4trace:configure.ac:133: -1- AH_OUTPUT([HAVE_C_VARARRAYS], [/* Define to 1 if C supports variable-length arrays. */ +@%:@undef HAVE_C_VARARRAYS]) +m4trace:configure.ac:133: -1- AC_DEFINE_TRACE_LITERAL([__STDC_NO_VLA__]) +m4trace:configure.ac:133: -1- m4_pattern_allow([^__STDC_NO_VLA__$]) +m4trace:configure.ac:133: -1- AH_OUTPUT([__STDC_NO_VLA__], [/* Define to 1 if C does not support variable-length arrays, and if the + compiler does not already define this. */ +@%:@undef __STDC_NO_VLA__]) +m4trace:configure.ac:135: -1- AC_DEFINE_TRACE_LITERAL([DEFAULT_EDITOR_PROGRAM]) +m4trace:configure.ac:135: -1- m4_pattern_allow([^DEFAULT_EDITOR_PROGRAM$]) +m4trace:configure.ac:135: -1- AH_OUTPUT([DEFAULT_EDITOR_PROGRAM], [/* Name of editor program, unless overridden. */ +@%:@undef DEFAULT_EDITOR_PROGRAM]) +m4trace:configure.ac:138: -1- AC_SUBST([PR_PROGRAM]) +m4trace:configure.ac:138: -1- AC_SUBST_TRACE([PR_PROGRAM]) +m4trace:configure.ac:138: -1- m4_pattern_allow([^PR_PROGRAM$]) +m4trace:configure.ac:139: -1- AC_DEFINE_TRACE_LITERAL([PR_PROGRAM]) +m4trace:configure.ac:139: -1- m4_pattern_allow([^PR_PROGRAM$]) +m4trace:configure.ac:139: -1- AH_OUTPUT([PR_PROGRAM], [/* Name of "pr" program. */ +@%:@undef PR_PROGRAM]) +m4trace:configure.ac:141: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_BLKSIZE]) +m4trace:configure.ac:141: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_BLKSIZE$]) +m4trace:configure.ac:141: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_BLKSIZE], [/* Define to 1 if \'st_blksize\' is a member of \'struct stat\'. */ +@%:@undef HAVE_STRUCT_STAT_ST_BLKSIZE]) +m4trace:configure.ac:142: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_RDEV]) +m4trace:configure.ac:142: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_RDEV$]) +m4trace:configure.ac:142: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_RDEV], [/* Define to 1 if \'st_rdev\' is a member of \'struct stat\'. */ +@%:@undef HAVE_STRUCT_STAT_ST_RDEV]) +m4trace:configure.ac:143: -1- AH_OUTPUT([HAVE_DIRENT_H], [/* Define to 1 if you have the header file, and it defines \'DIR\'. + */ +@%:@undef HAVE_DIRENT_H]) +m4trace:configure.ac:143: -1- AH_OUTPUT([HAVE_SYS_NDIR_H], [/* Define to 1 if you have the header file, and it defines \'DIR\'. + */ +@%:@undef HAVE_SYS_NDIR_H]) +m4trace:configure.ac:143: -1- AH_OUTPUT([HAVE_SYS_DIR_H], [/* Define to 1 if you have the header file, and it defines \'DIR\'. + */ +@%:@undef HAVE_SYS_DIR_H]) +m4trace:configure.ac:143: -1- AH_OUTPUT([HAVE_NDIR_H], [/* Define to 1 if you have the header file, and it defines \'DIR\'. */ +@%:@undef HAVE_NDIR_H]) +m4trace:configure.ac:144: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_WAIT_H]) +m4trace:configure.ac:144: -1- m4_pattern_allow([^HAVE_SYS_WAIT_H$]) +m4trace:configure.ac:144: -1- AH_OUTPUT([HAVE_SYS_WAIT_H], [/* Define to 1 if you have that is POSIX.1 compatible. */ +@%:@undef HAVE_SYS_WAIT_H]) +m4trace:configure.ac:145: -1- AC_DEFINE_TRACE_LITERAL([pid_t]) +m4trace:configure.ac:145: -1- m4_pattern_allow([^pid_t$]) +m4trace:configure.ac:145: -1- AH_OUTPUT([pid_t], [/* Define as a signed integer type capable of holding a process identifier. */ +@%:@undef pid_t]) +m4trace:configure.ac:147: -1- AH_OUTPUT([HAVE_SIGACTION], [/* Define to 1 if you have the \'sigaction\' function. */ +@%:@undef HAVE_SIGACTION]) +m4trace:configure.ac:147: -1- AH_OUTPUT([HAVE_SIGPROCMASK], [/* Define to 1 if you have the \'sigprocmask\' function. */ +@%:@undef HAVE_SIGPROCMASK]) +m4trace:configure.ac:147: -1- AH_OUTPUT([HAVE_STRCASECOLL], [/* Define to 1 if you have the \'strcasecoll\' function. */ +@%:@undef HAVE_STRCASECOLL]) +m4trace:configure.ac:147: -1- AH_OUTPUT([HAVE_STRICOLL], [/* Define to 1 if you have the \'stricoll\' function. */ +@%:@undef HAVE_STRICOLL]) +m4trace:configure.ac:149: -1- AH_OUTPUT([HAVE_SIGBLOCK], [/* Define to 1 if you have the \'sigblock\' function. */ +@%:@undef HAVE_SIGBLOCK]) +m4trace:configure.ac:149: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SIGBLOCK]) +m4trace:configure.ac:149: -1- m4_pattern_allow([^HAVE_SIGBLOCK$]) +m4trace:configure.ac:151: -1- AC_DEFINE_TRACE_LITERAL([CLOSEDIR_VOID]) +m4trace:configure.ac:151: -1- m4_pattern_allow([^CLOSEDIR_VOID$]) +m4trace:configure.ac:151: -1- AH_OUTPUT([CLOSEDIR_VOID], [/* Define to 1 if the \'closedir\' function returns void instead of int. */ +@%:@undef CLOSEDIR_VOID]) +m4trace:configure.ac:152: -1- AH_OUTPUT([HAVE_VFORK_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_VFORK_H]) +m4trace:configure.ac:152: -1- AH_OUTPUT([HAVE_FORK], [/* Define to 1 if you have the \'fork\' function. */ +@%:@undef HAVE_FORK]) +m4trace:configure.ac:152: -1- AH_OUTPUT([HAVE_VFORK], [/* Define to 1 if you have the \'vfork\' function. */ +@%:@undef HAVE_VFORK]) +m4trace:configure.ac:152: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WORKING_VFORK]) +m4trace:configure.ac:152: -1- m4_pattern_allow([^HAVE_WORKING_VFORK$]) +m4trace:configure.ac:152: -1- AH_OUTPUT([HAVE_WORKING_VFORK], [/* Define to 1 if \'vfork\' works. */ +@%:@undef HAVE_WORKING_VFORK]) +m4trace:configure.ac:152: -1- AC_DEFINE_TRACE_LITERAL([vfork]) +m4trace:configure.ac:152: -1- m4_pattern_allow([^vfork$]) +m4trace:configure.ac:152: -1- AH_OUTPUT([vfork], [/* Define as \'fork\' if \'vfork\' does not work. */ +@%:@undef vfork]) +m4trace:configure.ac:152: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WORKING_FORK]) +m4trace:configure.ac:152: -1- m4_pattern_allow([^HAVE_WORKING_FORK$]) +m4trace:configure.ac:152: -1- AH_OUTPUT([HAVE_WORKING_FORK], [/* Define to 1 if \'fork\' works. */ +@%:@undef HAVE_WORKING_FORK]) +m4trace:configure.ac:162: -1- AC_SUBST([SRC_VERSION_C]) +m4trace:configure.ac:162: -1- AC_SUBST_TRACE([SRC_VERSION_C]) +m4trace:configure.ac:162: -1- m4_pattern_allow([^SRC_VERSION_C$]) +m4trace:configure.ac:167: -1- AM_GNU_GETTEXT([external], [need-ngettext]) +m4trace:configure.ac:167: -1- AM_NLS +m4trace:configure.ac:167: -1- AC_SUBST([USE_NLS]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([USE_NLS]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^USE_NLS$]) +m4trace:configure.ac:167: -1- AC_SUBST([GETTEXT_MACRO_VERSION], [0.19]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([GETTEXT_MACRO_VERSION]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^GETTEXT_MACRO_VERSION$]) +m4trace:configure.ac:167: -1- AC_SUBST([MSGFMT]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([MSGFMT]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^MSGFMT$]) +m4trace:configure.ac:167: -1- AC_SUBST([GMSGFMT]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([GMSGFMT]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^GMSGFMT$]) +m4trace:configure.ac:167: -1- AC_SUBST([MSGFMT_015]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([MSGFMT_015]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^MSGFMT_015$]) +m4trace:configure.ac:167: -1- AC_SUBST([GMSGFMT_015]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([GMSGFMT_015]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^GMSGFMT_015$]) +m4trace:configure.ac:167: -1- AC_SUBST([XGETTEXT]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([XGETTEXT]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^XGETTEXT$]) +m4trace:configure.ac:167: -1- AC_SUBST([XGETTEXT_015]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([XGETTEXT_015]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^XGETTEXT_015$]) +m4trace:configure.ac:167: -1- AC_SUBST([MSGMERGE]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([MSGMERGE]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^MSGMERGE$]) +m4trace:configure.ac:167: -1- AC_SUBST([localedir]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([localedir]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:167: -1- AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([XGETTEXT_EXTRA_OPTIONS]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^XGETTEXT_EXTRA_OPTIONS$]) +m4trace:configure.ac:167: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CFPREFERENCESCOPYAPPVALUE]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^HAVE_CFPREFERENCESCOPYAPPVALUE$]) +m4trace:configure.ac:167: -1- AH_OUTPUT([HAVE_CFPREFERENCESCOPYAPPVALUE], [/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +@%:@undef HAVE_CFPREFERENCESCOPYAPPVALUE]) +m4trace:configure.ac:167: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CFLOCALECOPYCURRENT]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^HAVE_CFLOCALECOPYCURRENT$]) +m4trace:configure.ac:167: -1- AH_OUTPUT([HAVE_CFLOCALECOPYCURRENT], [/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +@%:@undef HAVE_CFLOCALECOPYCURRENT]) +m4trace:configure.ac:167: -1- AC_SUBST([INTL_MACOSX_LIBS]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([INTL_MACOSX_LIBS]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^INTL_MACOSX_LIBS$]) +m4trace:configure.ac:167: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ICONV]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^HAVE_ICONV$]) +m4trace:configure.ac:167: -1- AH_OUTPUT([HAVE_ICONV], [/* Define if you have the iconv() function and it works. */ +@%:@undef HAVE_ICONV]) +m4trace:configure.ac:167: -1- AC_SUBST([LIBICONV]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([LIBICONV]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^LIBICONV$]) +m4trace:configure.ac:167: -1- AC_SUBST([LTLIBICONV]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([LTLIBICONV]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^LTLIBICONV$]) +m4trace:configure.ac:167: -1- AC_DEFINE_TRACE_LITERAL([ENABLE_NLS]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^ENABLE_NLS$]) +m4trace:configure.ac:167: -1- AH_OUTPUT([ENABLE_NLS], [/* Define to 1 if translation of program messages to the user\'s native + language is requested. */ +@%:@undef ENABLE_NLS]) +m4trace:configure.ac:167: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETTEXT]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^HAVE_GETTEXT$]) +m4trace:configure.ac:167: -1- AH_OUTPUT([HAVE_GETTEXT], [/* Define if the GNU gettext() function is already present or preinstalled. */ +@%:@undef HAVE_GETTEXT]) +m4trace:configure.ac:167: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DCGETTEXT]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^HAVE_DCGETTEXT$]) +m4trace:configure.ac:167: -1- AH_OUTPUT([HAVE_DCGETTEXT], [/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +@%:@undef HAVE_DCGETTEXT]) +m4trace:configure.ac:167: -1- AC_SUBST([INTLLIBS]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([INTLLIBS]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^INTLLIBS$]) +m4trace:configure.ac:167: -1- AC_SUBST([LIBINTL]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([LIBINTL]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^LIBINTL$]) +m4trace:configure.ac:167: -1- AC_SUBST([LTLIBINTL]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([LTLIBINTL]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^LTLIBINTL$]) +m4trace:configure.ac:167: -1- AC_SUBST([POSUB]) +m4trace:configure.ac:167: -1- AC_SUBST_TRACE([POSUB]) +m4trace:configure.ac:167: -1- m4_pattern_allow([^POSUB$]) +m4trace:configure.ac:171: -1- AC_CONFIG_FILES([ + Makefile doc/Makefile + lib/Makefile + src/Makefile + tests/Makefile + gnulib-tests/Makefile + man/Makefile + po/Makefile.in +]) +m4trace:configure.ac:180: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:180: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([LTLIBOBJS]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.ac:180: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.ac:180: -1- AC_SUBST([am__EXEEXT_TRUE]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.ac:180: -1- AC_SUBST([am__EXEEXT_FALSE]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.ac:180: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.ac:180: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.ac:180: -1- AC_SUBST([CONFIG_INCLUDE], [lib/config.h]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([CONFIG_INCLUDE]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^CONFIG_INCLUDE$]) +m4trace:configure.ac:180: -1- AC_SUBST([gl_LIBOBJS], [$gl_libobjs]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([gl_LIBOBJS]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^gl_LIBOBJS$]) +m4trace:configure.ac:180: -1- AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([gl_LTLIBOBJS]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^gl_LTLIBOBJS$]) +m4trace:configure.ac:180: -1- AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([gltests_LIBOBJS]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^gltests_LIBOBJS$]) +m4trace:configure.ac:180: -1- AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([gltests_LTLIBOBJS]) +m4trace:configure.ac:180: -1- m4_pattern_allow([^gltests_LTLIBOBJS$]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([top_builddir]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([top_build_prefix]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([srcdir]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([abs_srcdir]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([top_srcdir]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([abs_top_srcdir]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([builddir]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([abs_builddir]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([abs_top_builddir]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([INSTALL]) +m4trace:configure.ac:180: -1- AC_SUBST_TRACE([MKDIR_P]) diff --git a/local/recipes/tools/diffutils/source/bootstrap b/local/recipes/tools/diffutils/source/bootstrap new file mode 100755 index 0000000000..932ff85e78 --- /dev/null +++ b/local/recipes/tools/diffutils/source/bootstrap @@ -0,0 +1,1028 @@ +#! /bin/sh +# Print a version string. +scriptversion=2017-01-09.19; # UTC + +# Bootstrap this package from checked-out sources. + +# Copyright (C) 2003-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Originally written by Paul Eggert. The canonical version of this +# script is maintained as build-aux/bootstrap in gnulib, however, to +# be useful to your project, you should place a copy of it under +# version control in the top-level directory of your project. The +# intent is that all customization can be done with a bootstrap.conf +# file also maintained in your version control; gnulib comes with a +# template build-aux/bootstrap.conf to get you started. + +# Please report bugs or propose patches to bug-gnulib@gnu.org. + +nl=' +' + +# Ensure file names are sorted consistently across platforms. +LC_ALL=C +export LC_ALL + +# Ensure that CDPATH is not set. Otherwise, the output from cd +# would cause trouble in at least one use below. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +local_gl_dir=gl + +# Honor $PERL, but work even if there is none. +PERL="${PERL-perl}" + +me=$0 + +usage() { + cat <&2 +} + +# warn_ WORD1... +warn_ () +{ + # If IFS does not start with ' ', set it and emit the warning in a subshell. + case $IFS in + ' '*) warnf_ '%s\n' "$*";; + *) (IFS=' '; warn_ "$@");; + esac +} + +# die WORD1... +die() { warn_ "$@"; exit 1; } + +# Configuration. + +# Name of the Makefile.am +gnulib_mk=gnulib.mk + +# List of gnulib modules needed. +gnulib_modules= + +# Any gnulib files needed that are not in modules. +gnulib_files= + +: ${AUTOPOINT=autopoint} +: ${AUTORECONF=autoreconf} + +# A function to be called right after gnulib-tool is run. +# Override it via your own definition in bootstrap.conf. +bootstrap_post_import_hook() { :; } + +# A function to be called after everything else in this script. +# Override it via your own definition in bootstrap.conf. +bootstrap_epilogue() { :; } + +# The command to download all .po files for a specified domain into +# a specified directory. Fill in the first %s is the domain name, and +# the second with the destination directory. Use rsync's -L and -r +# options because the latest/%s directory and the .po files within are +# all symlinks. +po_download_command_format=\ +"rsync --delete --exclude '*.s1' -Lrtvz \ + 'translationproject.org::tp/latest/%s/' '%s'" + +# Fallback for downloading .po files (if rsync fails). +po_download_command_format2=\ +"wget --mirror -nd -q -np -A.po -P '%s' \ + http://translationproject.org/latest/%s/" + +# Prefer a non-empty tarname (4th argument of AC_INIT if given), else +# fall back to the package name (1st argument with munging) +extract_package_name=' + /^AC_INIT(\[*/{ + s/// + /^[^,]*,[^,]*,[^,]*,[ []*\([^][ ,)]\)/{ + s//\1/ + s/[],)].*// + p + q + } + s/[],)].*// + s/^GNU // + y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + s/[^abcdefghijklmnopqrstuvwxyz0123456789_]/-/g + p + } +' +package=$(sed -n "$extract_package_name" configure.ac) \ + || die 'cannot find package name in configure.ac' +gnulib_name=lib$package + +build_aux=build-aux +source_base=lib +m4_base=m4 +doc_base=doc +tests_base=tests +gnulib_extra_files='' + +# Additional gnulib-tool options to use. Use "\newline" to break lines. +gnulib_tool_option_extras= + +# Other locale categories that need message catalogs. +EXTRA_LOCALE_CATEGORIES= + +# Additional xgettext options to use. Use "\\\newline" to break lines. +XGETTEXT_OPTIONS='\\\ + --flag=_:1:pass-c-format\\\ + --flag=N_:1:pass-c-format\\\ + --flag=error:3:c-format --flag=error_at_line:5:c-format\\\ +' + +# Package bug report address and copyright holder for gettext files +COPYRIGHT_HOLDER='Free Software Foundation, Inc.' +MSGID_BUGS_ADDRESS=bug-$package@gnu.org + +# Files we don't want to import. +excluded_files= + +# File that should exist in the top directory of a checked out hierarchy, +# but not in a distribution tarball. +checkout_only_file=README-hacking + +# Whether to use copies instead of symlinks. +copy=false + +# Set this to '.cvsignore .gitignore' in bootstrap.conf if you want +# those files to be generated in directories like lib/, m4/, and po/. +# Or set it to 'auto' to make this script select which to use based +# on which version control system (if any) is used in the source directory. +vc_ignore=auto + +# Set this to true in bootstrap.conf to enable --bootstrap-sync by +# default. +bootstrap_sync=false + +# Use git to update gnulib sources +use_git=true + +check_exists() { + if test "$1" = "--verbose"; then + ($2 --version /dev/null 2>&1 + if test $? -ge 126; then + # If not found, run with diagnostics as one may be + # presented with env variables to set to find the right version + ($2 --version /dev/null 2>&1 + fi + + test $? -lt 126 +} + +# find_tool ENVVAR NAMES... +# ------------------------- +# Search for a required program. Use the value of ENVVAR, if set, +# otherwise find the first of the NAMES that can be run. +# If found, set ENVVAR to the program name, die otherwise. +# +# FIXME: code duplication, see also gnu-web-doc-update. +find_tool () +{ + find_tool_envvar=$1 + shift + find_tool_names=$@ + eval "find_tool_res=\$$find_tool_envvar" + if test x"$find_tool_res" = x; then + for i; do + if check_exists $i; then + find_tool_res=$i + break + fi + done + fi + if test x"$find_tool_res" = x; then + warn_ "one of these is required: $find_tool_names;" + die "alternatively set $find_tool_envvar to a compatible tool" + fi + eval "$find_tool_envvar=\$find_tool_res" + eval "export $find_tool_envvar" +} + +# Override the default configuration, if necessary. +# Make sure that bootstrap.conf is sourced from the current directory +# if we were invoked as "sh bootstrap". +case "$0" in + */*) test -r "$0.conf" && . "$0.conf" ;; + *) test -r "$0.conf" && . ./"$0.conf" ;; +esac + +# Extra files from gnulib, which override files from other sources. +test -z "${gnulib_extra_files}" && \ + gnulib_extra_files=" + build-aux/install-sh + build-aux/mdate-sh + build-aux/texinfo.tex + build-aux/depcomp + build-aux/config.guess + build-aux/config.sub + doc/INSTALL +" + +if test "$vc_ignore" = auto; then + vc_ignore= + test -d .git && vc_ignore=.gitignore + test -d CVS && vc_ignore="$vc_ignore .cvsignore" +fi + +# Translate configuration into internal form. + +# Parse options. + +for option +do + case $option in + --help) + usage + exit;; + --gnulib-srcdir=*) + GNULIB_SRCDIR=${option#--gnulib-srcdir=};; + --skip-po) + SKIP_PO=t;; + --force) + checkout_only_file=;; + --copy) + copy=true;; + --bootstrap-sync) + bootstrap_sync=true;; + --no-bootstrap-sync) + bootstrap_sync=false;; + --no-git) + use_git=false;; + *) + die "$option: unknown option";; + esac +done + +$use_git || test -d "$GNULIB_SRCDIR" \ + || die "Error: --no-git requires --gnulib-srcdir" + +if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then + die "Bootstrapping from a non-checked-out distribution is risky." +fi + +# Strip blank and comment lines to leave significant entries. +gitignore_entries() { + sed '/^#/d; /^$/d' "$@" +} + +# If $STR is not already on a line by itself in $FILE, insert it at the start. +# Entries are inserted at the start of the ignore list to ensure existing +# entries starting with ! are not overridden. Such entries support +# whitelisting exceptions after a more generic blacklist pattern. +insert_if_absent() { + file=$1 + str=$2 + test -f $file || touch $file + test -r $file || die "Error: failed to read ignore file: $file" + duplicate_entries=$(gitignore_entries $file | sort | uniq -d) + if [ "$duplicate_entries" ] ; then + die "Error: Duplicate entries in $file: " $duplicate_entries + fi + linesold=$(gitignore_entries $file | wc -l) + linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l) + if [ $linesold != $linesnew ] ; then + { echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \ + || die "insert_if_absent $file $str: failed" + fi +} + +# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with +# insert_if_absent. +insert_vc_ignore() { + vc_ignore_file="$1" + pattern="$2" + case $vc_ignore_file in + *.gitignore) + # A .gitignore entry that does not start with '/' applies + # recursively to subdirectories, so prepend '/' to every + # .gitignore entry. + pattern=$(echo "$pattern" | sed s,^,/,);; + esac + insert_if_absent "$vc_ignore_file" "$pattern" +} + +# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac. +found_aux_dir=no +grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \ + >/dev/null && found_aux_dir=yes +grep '^[ ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \ + >/dev/null && found_aux_dir=yes +test $found_aux_dir = yes \ + || die "configure.ac lacks 'AC_CONFIG_AUX_DIR([$build_aux])'; add it" + +# If $build_aux doesn't exist, create it now, otherwise some bits +# below will malfunction. If creating it, also mark it as ignored. +if test ! -d $build_aux; then + mkdir $build_aux + for dot_ig in x $vc_ignore; do + test $dot_ig = x && continue + insert_vc_ignore $dot_ig $build_aux + done +fi + +# Note this deviates from the version comparison in automake +# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a +# but this should suffice as we won't be specifying old +# version formats or redundant trailing .0 in bootstrap.conf. +# If we did want full compatibility then we should probably +# use m4_version_compare from autoconf. +sort_ver() { # sort -V is not generally available + ver1="$1" + ver2="$2" + + # split on '.' and compare each component + i=1 + while : ; do + p1=$(echo "$ver1" | cut -d. -f$i) + p2=$(echo "$ver2" | cut -d. -f$i) + if [ ! "$p1" ]; then + echo "$1 $2" + break + elif [ ! "$p2" ]; then + echo "$2 $1" + break + elif [ ! "$p1" = "$p2" ]; then + if [ "$p1" -gt "$p2" ] 2>/dev/null; then # numeric comparison + echo "$2 $1" + elif [ "$p2" -gt "$p1" ] 2>/dev/null; then # numeric comparison + echo "$1 $2" + else # numeric, then lexicographic comparison + lp=$(printf "$p1\n$p2\n" | LANG=C sort -n | tail -n1) + if [ "$lp" = "$p2" ]; then + echo "$1 $2" + else + echo "$2 $1" + fi + fi + break + fi + i=$(($i+1)) + done +} + +get_version_sed=' +# Move version to start of line. +s/.*[v ]\([0-9]\)/\1/ + +# Skip lines that do not start with version. +/^[0-9]/!d + +# Remove characters after the version. +s/[^.a-z0-9-].*// + +# The first component must be digits only. +s/^\([0-9]*\)[a-z-].*/\1/ + +#the following essentially does s/5.005/5.5/ +s/\.0*\([1-9]\)/.\1/g +p +q' + +get_version() { + app=$1 + + $app --version >/dev/null 2>&1 || { $app --version; return 1; } + + $app --version 2>&1 | sed -n "$get_version_sed" +} + +check_versions() { + ret=0 + + while read app req_ver; do + # We only need libtoolize from the libtool package. + if test "$app" = libtool; then + app=libtoolize + fi + # Exempt git if --no-git is in effect. + if test "$app" = git; then + $use_git || continue + fi + # Honor $APP variables ($TAR, $AUTOCONF, etc.) + appvar=$(echo $app | LC_ALL=C tr '[a-z]-' '[A-Z]_') + test "$appvar" = TAR && appvar=AMTAR + case $appvar in + GZIP) ;; # Do not use $GZIP: it contains gzip options. + PERL::*) ;; # Keep perl modules as-is + *) eval "app=\${$appvar-$app}" ;; + esac + + # Handle the still-experimental Automake-NG programs specially. + # They remain named as the mainstream Automake programs ("automake", + # and "aclocal") to avoid gratuitous incompatibilities with + # pre-existing usages (by, say, autoreconf, or custom autogen.sh + # scripts), but correctly identify themselves (as being part of + # "GNU automake-ng") when asked their version. + case $app in + automake-ng|aclocal-ng) + app=${app%-ng} + ($app --version | grep '(GNU automake-ng)') >/dev/null 2>&1 || { + warn_ "Error: '$app' not found or not from Automake-NG" + ret=1 + continue + } ;; + # Another check is for perl modules. These can be written as + # e.g. perl::XML::XPath in case of XML::XPath module, etc. + perl::*) + # Extract module name + app="${app#perl::}" + if ! $PERL -m"$app" -e 'exit 0' >/dev/null 2>&1; then + warn_ "Error: perl module '$app' not found" + ret=1 + fi + continue + ;; + esac + if [ "$req_ver" = "-" ]; then + # Merely require app to exist; not all prereq apps are well-behaved + # so we have to rely on $? rather than get_version. + if ! check_exists --verbose $app; then + warn_ "Error: '$app' not found" + ret=1 + fi + else + # Require app to produce a new enough version string. + inst_ver=$(get_version $app) + if [ ! "$inst_ver" ]; then + warn_ "Error: '$app' not found" + ret=1 + else + latest_ver=$(sort_ver $req_ver $inst_ver | cut -d' ' -f2) + if [ ! "$latest_ver" = "$inst_ver" ]; then + warnf_ '%s\n' \ + "Error: '$app' version == $inst_ver is too old" \ + " '$app' version >= $req_ver is required" + ret=1 + fi + fi + fi + done + + return $ret +} + +print_versions() { + echo "Program Min_version" + echo "----------------------" + printf %s "$buildreq" + echo "----------------------" + # can't depend on column -t +} + +# Find sha1sum, named gsha1sum on MacPorts, shasum on Mac OS X 10.6. +# Also find the compatible sha1 utility on the BSDs +if test x"$SKIP_PO" = x; then + find_tool SHA1SUM sha1sum gsha1sum shasum sha1 +fi + +use_libtool=0 +# We'd like to use grep -E, to see if any of LT_INIT, +# AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac, +# but that's not portable enough (e.g., for Solaris). +grep '^[ ]*A[CM]_PROG_LIBTOOL' configure.ac >/dev/null \ + && use_libtool=1 +grep '^[ ]*LT_INIT' configure.ac >/dev/null \ + && use_libtool=1 +if test $use_libtool = 1; then + find_tool LIBTOOLIZE glibtoolize libtoolize +fi + +# gnulib-tool requires at least automake and autoconf. +# If either is not listed, add it (with minimum version) as a prerequisite. +case $buildreq in + *automake*) ;; + *) buildreq="automake 1.9 +$buildreq" ;; +esac +case $buildreq in + *autoconf*) ;; + *) buildreq="autoconf 2.59 +$buildreq" ;; +esac + +# When we can deduce that gnulib-tool will require patch, +# and when patch is not already listed as a prerequisite, add it, too. +if test -d "$local_gl_dir" \ + && ! find "$local_gl_dir" -name '*.diff' -exec false {} +; then + case $buildreq in + *patch*) ;; + *) buildreq="patch - +$buildreq" ;; + esac +fi + +if ! printf "$buildreq" | check_versions; then + echo >&2 + if test -f README-prereq; then + die "See README-prereq for how to get the prerequisite programs" + else + die "Please install the prerequisite programs" + fi +fi + +# Warn the user if autom4te appears to be broken; this causes known +# issues with at least gettext 0.18.3. +probe=$(echo 'm4_quote([hi])' | autom4te -l M4sugar -t 'm4_quote:$%' -) +if test "x$probe" != xhi; then + warn_ "WARNING: your autom4te wrapper eats stdin;" + warn_ "if bootstrap fails, consider upgrading your autotools" +fi + +echo "$0: Bootstrapping from checked-out $package sources..." + +# See if we can use gnulib's git-merge-changelog merge driver. +if $use_git && test -d .git && check_exists git; then + if git config merge.merge-changelog.driver >/dev/null ; then + : + elif check_exists git-merge-changelog; then + echo "$0: initializing git-merge-changelog driver" + git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver' + git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B' + else + echo "$0: consider installing git-merge-changelog from gnulib" + fi +fi + + +cleanup_gnulib() { + status=$? + rm -fr "$gnulib_path" + exit $status +} + +git_modules_config () { + test -f .gitmodules && git config --file .gitmodules "$@" +} + +if $use_git; then + gnulib_path=$(git_modules_config submodule.gnulib.path) + test -z "$gnulib_path" && gnulib_path=gnulib +fi + +# Get gnulib files. Populate $GNULIB_SRCDIR, possibly updating a +# submodule, for use in the rest of the script. + +case ${GNULIB_SRCDIR--} in +-) + # Note that $use_git is necessarily true in this case. + if git_modules_config submodule.gnulib.url >/dev/null; then + echo "$0: getting gnulib files..." + git submodule init -- "$gnulib_path" || exit $? + git submodule update -- "$gnulib_path" || exit $? + + elif [ ! -d "$gnulib_path" ]; then + echo "$0: getting gnulib files..." + + trap cleanup_gnulib 1 2 13 15 + + shallow= + git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2' + git clone $shallow git://git.sv.gnu.org/gnulib "$gnulib_path" || + cleanup_gnulib + + trap - 1 2 13 15 + fi + GNULIB_SRCDIR=$gnulib_path + ;; +*) + # Use GNULIB_SRCDIR directly or as a reference. + if $use_git && test -d "$GNULIB_SRCDIR"/.git && \ + git_modules_config submodule.gnulib.url >/dev/null; then + echo "$0: getting gnulib files..." + if git submodule -h|grep -- --reference > /dev/null; then + # Prefer the one-liner available in git 1.6.4 or newer. + git submodule update --init --reference "$GNULIB_SRCDIR" \ + "$gnulib_path" || exit $? + else + # This fallback allows at least git 1.5.5. + if test -f "$gnulib_path"/gnulib-tool; then + # Since file already exists, assume submodule init already complete. + git submodule update -- "$gnulib_path" || exit $? + else + # Older git can't clone into an empty directory. + rmdir "$gnulib_path" 2>/dev/null + git clone --reference "$GNULIB_SRCDIR" \ + "$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \ + && git submodule init -- "$gnulib_path" \ + && git submodule update -- "$gnulib_path" \ + || exit $? + fi + fi + GNULIB_SRCDIR=$gnulib_path + fi + ;; +esac + +# $GNULIB_SRCDIR now points to the version of gnulib to use, and +# we no longer need to use git or $gnulib_path below here. + +if $bootstrap_sync; then + cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || { + echo "$0: updating bootstrap and restarting..." + case $(sh -c 'echo "$1"' -- a) in + a) ignored=--;; + *) ignored=ignored;; + esac + exec sh -c \ + 'cp "$1" "$2" && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \ + $ignored "$GNULIB_SRCDIR/build-aux/bootstrap" \ + "$0" "$@" --no-bootstrap-sync + } +fi + +gnulib_tool=$GNULIB_SRCDIR/gnulib-tool +<$gnulib_tool || exit $? + +# Get translations. + +download_po_files() { + subdir=$1 + domain=$2 + echo "$me: getting translations into $subdir for $domain..." + cmd=$(printf "$po_download_command_format" "$domain" "$subdir") + eval "$cmd" && return + # Fallback to HTTP. + cmd=$(printf "$po_download_command_format2" "$subdir" "$domain") + eval "$cmd" +} + +# Mirror .po files to $po_dir/.reference and copy only the new +# or modified ones into $po_dir. Also update $po_dir/LINGUAS. +# Note po files that exist locally only are left in $po_dir but will +# not be included in LINGUAS and hence will not be distributed. +update_po_files() { + # Directory containing primary .po files. + # Overwrite them only when we're sure a .po file is new. + po_dir=$1 + domain=$2 + + # Mirror *.po files into this dir. + # Usually contains *.s1 checksum files. + ref_po_dir="$po_dir/.reference" + + test -d $ref_po_dir || mkdir $ref_po_dir || return + download_po_files $ref_po_dir $domain \ + && ls "$ref_po_dir"/*.po 2>/dev/null | + sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return + + langs=$(cd $ref_po_dir && echo *.po | sed 's/\.po//g') + test "$langs" = '*' && langs=x + for po in $langs; do + case $po in x) continue;; esac + new_po="$ref_po_dir/$po.po" + cksum_file="$ref_po_dir/$po.s1" + if ! test -f "$cksum_file" || + ! test -f "$po_dir/$po.po" || + ! $SHA1SUM -c "$cksum_file" < "$new_po" > /dev/null 2>&1; then + echo "$me: updated $po_dir/$po.po..." + cp "$new_po" "$po_dir/$po.po" \ + && $SHA1SUM < "$new_po" > "$cksum_file" || return + fi + done +} + +case $SKIP_PO in +'') + if test -d po; then + update_po_files po $package || exit + fi + + if test -d runtime-po; then + update_po_files runtime-po $package-runtime || exit + fi;; +esac + +symlink_to_dir() +{ + src=$1/$2 + dst=${3-$2} + + test -f "$src" && { + + # If the destination directory doesn't exist, create it. + # This is required at least for "lib/uniwidth/cjk.h". + dst_dir=$(dirname "$dst") + if ! test -d "$dst_dir"; then + mkdir -p "$dst_dir" + + # If we've just created a directory like lib/uniwidth, + # tell version control system(s) it's ignorable. + # FIXME: for now, this does only one level + parent=$(dirname "$dst_dir") + for dot_ig in x $vc_ignore; do + test $dot_ig = x && continue + ig=$parent/$dot_ig + insert_vc_ignore $ig "${dst_dir##*/}" + done + fi + + if $copy; then + { + test ! -h "$dst" || { + echo "$me: rm -f $dst" && + rm -f "$dst" + } + } && + test -f "$dst" && + cmp -s "$src" "$dst" || { + echo "$me: cp -fp $src $dst" && + cp -fp "$src" "$dst" + } + else + # Leave any existing symlink alone, if it already points to the source, + # so that broken build tools that care about symlink times + # aren't confused into doing unnecessary builds. Conversely, if the + # existing symlink's timestamp is older than the source, make it afresh, + # so that broken tools aren't confused into skipping needed builds. See + # . + test -h "$dst" && + src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 && + dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 && + test "$src_i" = "$dst_i" && + both_ls=$(ls -dt "$src" "$dst") && + test "X$both_ls" = "X$dst$nl$src" || { + dot_dots= + case $src in + /*) ;; + *) + case /$dst/ in + *//* | */../* | */./* | /*/*/*/*/*/) + die "invalid symlink calculation: $src -> $dst";; + /*/*/*/*/) dot_dots=../../../;; + /*/*/*/) dot_dots=../../;; + /*/*/) dot_dots=../;; + esac;; + esac + + echo "$me: ln -fs $dot_dots$src $dst" && + ln -fs "$dot_dots$src" "$dst" + } + fi + } +} + +version_controlled_file() { + parent=$1 + file=$2 + if test -d .git; then + git rm -n "$file" > /dev/null 2>&1 + elif test -d .svn; then + svn log -r HEAD "$file" > /dev/null 2>&1 + elif test -d CVS; then + grep -F "/${file##*/}/" "$parent/CVS/Entries" 2>/dev/null | + grep '^/[^/]*/[0-9]' > /dev/null + else + warn_ "no version control for $file?" + false + fi +} + +# NOTE: we have to be careful to run both autopoint and libtoolize +# before gnulib-tool, since gnulib-tool is likely to provide newer +# versions of files "installed" by these two programs. +# Then, *after* gnulib-tool (see below), we have to be careful to +# run autoreconf in such a way that it does not run either of these +# two just-pre-run programs. + +# Import from gettext. +with_gettext=yes +grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \ + with_gettext=no + +if test $with_gettext = yes || test $use_libtool = 1; then + + tempbase=.bootstrap$$ + trap "rm -f $tempbase.0 $tempbase.1" 1 2 13 15 + + > $tempbase.0 > $tempbase.1 && + find . ! -type d -print | sort > $tempbase.0 || exit + + if test $with_gettext = yes; then + # Released autopoint has the tendency to install macros that have been + # obsoleted in current gnulib, so run this before gnulib-tool. + echo "$0: $AUTOPOINT --force" + $AUTOPOINT --force || exit + fi + + # Autoreconf runs aclocal before libtoolize, which causes spurious + # warnings if the initial aclocal is confused by the libtoolized + # (or worse out-of-date) macro directory. + # libtoolize 1.9b added the --install option; but we support back + # to libtoolize 1.5.22, where the install action was default. + if test $use_libtool = 1; then + install= + case $($LIBTOOLIZE --help) in + *--install*) install=--install ;; + esac + echo "running: $LIBTOOLIZE $install --copy" + $LIBTOOLIZE $install --copy + fi + + find . ! -type d -print | sort >$tempbase.1 + old_IFS=$IFS + IFS=$nl + for file in $(comm -13 $tempbase.0 $tempbase.1); do + IFS=$old_IFS + parent=${file%/*} + version_controlled_file "$parent" "$file" || { + for dot_ig in x $vc_ignore; do + test $dot_ig = x && continue + ig=$parent/$dot_ig + insert_vc_ignore "$ig" "${file##*/}" + done + } + done + IFS=$old_IFS + + rm -f $tempbase.0 $tempbase.1 + trap - 1 2 13 15 +fi + +# Import from gnulib. + +gnulib_tool_options="\ + --import\ + --no-changelog\ + --aux-dir $build_aux\ + --doc-base $doc_base\ + --lib $gnulib_name\ + --m4-base $m4_base/\ + --source-base $source_base/\ + --tests-base $tests_base\ + --local-dir $local_gl_dir\ + $gnulib_tool_option_extras\ +" +if test $use_libtool = 1; then + case "$gnulib_tool_options " in + *' --libtool '*) ;; + *) gnulib_tool_options="$gnulib_tool_options --libtool" ;; + esac +fi +echo "$0: $gnulib_tool $gnulib_tool_options --import ..." +$gnulib_tool $gnulib_tool_options --import $gnulib_modules \ + || die "gnulib-tool failed" + +for file in $gnulib_files; do + symlink_to_dir "$GNULIB_SRCDIR" $file \ + || die "failed to symlink $file" +done + +bootstrap_post_import_hook \ + || die "bootstrap_post_import_hook failed" + +# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some +# gnulib-populated directories. Such .m4 files would cause aclocal to fail. +# The following requires GNU find 4.2.3 or newer. Considering the usual +# portability constraints of this script, that may seem a very demanding +# requirement, but it should be ok. Ignore any failure, which is fine, +# since this is only a convenience to help developers avoid the relatively +# unusual case in which a symlinked-to .m4 file is git-removed from gnulib +# between successive runs of this script. +find "$m4_base" "$source_base" \ + -depth \( -name '*.m4' -o -name '*.[ch]' \) \ + -type l -xtype l -delete > /dev/null 2>&1 + +# Invoke autoreconf with --force --install to ensure upgrades of tools +# such as ylwrap. +AUTORECONFFLAGS="--verbose --install --force -I $m4_base $ACLOCAL_FLAGS" + +# Some systems (RHEL 5) are using ancient autotools, for which the +# --no-recursive option had not been invented. Detect that lack and +# omit the option when it's not supported. FIXME in 2017: remove this +# hack when RHEL 5 autotools are updated, or when they become irrelevant. +case $($AUTORECONF --help) in + *--no-recursive*) AUTORECONFFLAGS="$AUTORECONFFLAGS --no-recursive";; +esac + +# Tell autoreconf not to invoke autopoint or libtoolize; they were run above. +echo "running: AUTOPOINT=true LIBTOOLIZE=true $AUTORECONF $AUTORECONFFLAGS" +AUTOPOINT=true LIBTOOLIZE=true $AUTORECONF $AUTORECONFFLAGS \ + || die "autoreconf failed" + +# Get some extra files from gnulib, overriding existing files. +for file in $gnulib_extra_files; do + case $file in + */INSTALL) dst=INSTALL;; + build-aux/*) dst=$build_aux/${file#build-aux/};; + *) dst=$file;; + esac + symlink_to_dir "$GNULIB_SRCDIR" $file $dst \ + || die "failed to symlink $file" +done + +if test $with_gettext = yes; then + # Create gettext configuration. + echo "$0: Creating po/Makevars from po/Makevars.template ..." + rm -f po/Makevars + sed ' + /^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/ + /^COPYRIGHT_HOLDER *=/s/=.*/= '"$COPYRIGHT_HOLDER"'/ + /^MSGID_BUGS_ADDRESS *=/s|=.*|= '"$MSGID_BUGS_ADDRESS"'| + /^XGETTEXT_OPTIONS *=/{ + s/$/ \\/ + a\ + '"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+} + } + ' po/Makevars.template >po/Makevars \ + || die 'cannot generate po/Makevars' + + # If the 'gettext' module is in use, grab the latest Makefile.in.in. + # If only the 'gettext-h' module is in use, assume autopoint already + # put the correct version of this file into place. + case $gnulib_modules in + *gettext-h*) ;; + *gettext*) + cp $GNULIB_SRCDIR/build-aux/po/Makefile.in.in po/Makefile.in.in \ + || die "cannot create po/Makefile.in.in" + ;; + esac + + if test -d runtime-po; then + # Similarly for runtime-po/Makevars, but not quite the same. + rm -f runtime-po/Makevars + sed ' + /^DOMAIN *=.*/s/=.*/= '"$package"'-runtime/ + /^subdir *=.*/s/=.*/= runtime-po/ + /^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/ + /^XGETTEXT_OPTIONS *=/{ + s/$/ \\/ + a\ + '"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+} + } + ' po/Makevars.template >runtime-po/Makevars \ + || die 'cannot generate runtime-po/Makevars' + + # Copy identical files from po to runtime-po. + (cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po) + fi +fi + +bootstrap_epilogue + +echo "$0: done. Now you can run './configure'." + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/local/recipes/tools/diffutils/source/build-aux/announce-gen b/local/recipes/tools/diffutils/source/build-aux/announce-gen new file mode 100755 index 0000000000..e789b13a80 --- /dev/null +++ b/local/recipes/tools/diffutils/source/build-aux/announce-gen @@ -0,0 +1,557 @@ +eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"' + & eval 'exec perl -wS "$0" $argv:q' + if 0; +# Generate a release announcement message. + +my $VERSION = '2016-01-12 23:09'; # UTC +# The definition above must lie within the first 8 lines in order +# for the Emacs time-stamp write hook (at end) to update it. +# If you change this file with Emacs, please let the write hook +# do its job. Otherwise, update this string manually. + +# Copyright (C) 2002-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Written by Jim Meyering + +use strict; + +use Getopt::Long; +use POSIX qw(strftime); + +(my $ME = $0) =~ s|.*/||; + +my %valid_release_types = map {$_ => 1} qw (alpha beta stable); +my @archive_suffixes = ('tar.gz', 'tar.bz2', 'tar.lzma', 'tar.xz'); +my %digest_classes = + ( + 'md5' => (eval { require Digest::MD5; } and 'Digest::MD5'), + 'sha1' => ((eval { require Digest::SHA; } and 'Digest::SHA') + or (eval { require Digest::SHA1; } and 'Digest::SHA1')) + ); +my $srcdir = '.'; + +sub usage ($) +{ + my ($exit_code) = @_; + my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR); + if ($exit_code != 0) + { + print $STREAM "Try '$ME --help' for more information.\n"; + } + else + { + my @types = sort keys %valid_release_types; + print $STREAM < = C + +Compute the sizes of the C<@file> and return them as a hash. Return +C if one of the computation failed. + +=cut + +sub sizes (@) +{ + my (@file) = @_; + + my $fail = 0; + my %res; + foreach my $f (@file) + { + my $cmd = "du -h $f"; + my $t = `$cmd`; + # FIXME-someday: give a better diagnostic, a la $PROCESS_STATUS + $@ + and (warn "command failed: '$cmd'\n"), $fail = 1; + chomp $t; + $t =~ s/^\s*([\d.]+[MkK]).*/${1}B/; + $res{$f} = $t; + } + return $fail ? undef : %res; +} + +=item C dedicated to the list of <@file>, which +sizes are stored in C<%size>, and which are available from the C<@url>. + +=cut + +sub print_locations ($\@\%@) +{ + my ($title, $url, $size, @file) = @_; + print "Here are the $title:\n"; + foreach my $url (@{$url}) + { + for my $file (@file) + { + print " $url/$file"; + print " (", $$size{$file}, ")" + if exists $$size{$file}; + print "\n"; + } + } + print "\n"; +} + +=item C. + +=cut + +sub print_checksums (@) +{ + my (@file) = @_; + + print "Here are the MD5 and SHA1 checksums:\n"; + print "\n"; + + foreach my $meth (qw (md5 sha1)) + { + my $class = $digest_classes{$meth} or next; + foreach my $f (@file) + { + open IN, '<', $f + or die "$ME: $f: cannot open for reading: $!\n"; + binmode IN; + my $dig = $class->new->addfile(*IN)->hexdigest; + close IN; + print "$dig $f\n"; + } + } + print "\n"; +} + +=item C addressing changes +between versions C<$prev_version> and C<$curr_version>. + +=cut + +sub print_news_deltas ($$$) +{ + my ($news_file, $prev_version, $curr_version) = @_; + + my $news_name = $news_file; + $news_name =~ s|^\Q$srcdir\E/||; + + print "\n$news_name\n\n"; + + # Print all lines from $news_file, starting with the first one + # that mentions $curr_version up to but not including + # the first occurrence of $prev_version. + my $in_items; + + my $re_prefix = qr/(?:\* )?(?:Noteworthy c|Major c|C)(?i:hanges)/; + + my $found_news; + open NEWS, '<', $news_file + or die "$ME: $news_file: cannot open for reading: $!\n"; + while (defined (my $line = )) + { + if ( ! $in_items) + { + # Match lines like these: + # * Major changes in release 5.0.1: + # * Noteworthy changes in release 6.6 (2006-11-22) [stable] + $line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$curr_version\E(?:[^\d.]|$)/o + or next; + $in_items = 1; + print $line; + } + else + { + # This regexp must not match version numbers in NEWS items. + # For example, they might well say "introduced in 4.5.5", + # and we don't want that to match. + $line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$prev_version\E(?:[^\d.]|$)/o + and last; + print $line; + $line =~ /\S/ + and $found_news = 1; + } + } + close NEWS; + + $in_items + or die "$ME: $news_file: no matching lines for '$curr_version'\n"; + $found_news + or die "$ME: $news_file: no news item found for '$curr_version'\n"; +} + +sub print_changelog_deltas ($$) +{ + my ($package_name, $prev_version) = @_; + + # Print new ChangeLog entries. + + # First find all CVS-controlled ChangeLog files. + use File::Find; + my @changelog; + find ({wanted => sub {$_ eq 'ChangeLog' && -d 'CVS' + and push @changelog, $File::Find::name}}, + '.'); + + # If there are no ChangeLog files, we're done. + @changelog + or return; + my %changelog = map {$_ => 1} @changelog; + + # Reorder the list of files so that if there are ChangeLog + # files in the specified directories, they're listed first, + # in this order: + my @dir = qw ( . src lib m4 config doc ); + + # A typical @changelog array might look like this: + # ./ChangeLog + # ./po/ChangeLog + # ./m4/ChangeLog + # ./lib/ChangeLog + # ./doc/ChangeLog + # ./config/ChangeLog + my @reordered; + foreach my $d (@dir) + { + my $dot_slash = $d eq '.' ? $d : "./$d"; + my $target = "$dot_slash/ChangeLog"; + delete $changelog{$target} + and push @reordered, $target; + } + + # Append any remaining ChangeLog files. + push @reordered, sort keys %changelog; + + # Remove leading './'. + @reordered = map { s!^\./!!; $_ } @reordered; + + print "\nChangeLog entries:\n\n"; + # print join ("\n", @reordered), "\n"; + + $prev_version =~ s/\./_/g; + my $prev_cvs_tag = "\U$package_name\E-$prev_version"; + + my $cmd = "cvs -n diff -u -r$prev_cvs_tag -rHEAD @reordered"; + open DIFF, '-|', $cmd + or die "$ME: cannot run '$cmd': $!\n"; + # Print two types of lines, making minor changes: + # Lines starting with '+++ ', e.g., + # +++ ChangeLog 22 Feb 2003 16:52:51 -0000 1.247 + # and those starting with '+'. + # Don't print the others. + my $prev_printed_line_empty = 1; + while (defined (my $line = )) + { + if ($line =~ /^\+\+\+ /) + { + my $separator = "*"x70 ."\n"; + $line =~ s///; + $line =~ s/\s.*//; + $prev_printed_line_empty + or print "\n"; + print $separator, $line, $separator; + } + elsif ($line =~ /^\+/) + { + $line =~ s///; + print $line; + $prev_printed_line_empty = ($line =~ /^$/); + } + } + close DIFF; + + # The exit code should be 1. + # Allow in case there are no modified ChangeLog entries. + $? == 256 || $? == 128 + or warn "warning: '$cmd' had unexpected exit code or signal ($?)\n"; +} + +sub get_tool_versions ($$) +{ + my ($tool_list, $gnulib_version) = @_; + @$tool_list + or return (); + + my $fail; + my @tool_version_pair; + foreach my $t (@$tool_list) + { + if ($t eq 'gnulib') + { + push @tool_version_pair, ucfirst $t . ' ' . $gnulib_version; + next; + } + # Assume that the last "word" on the first line of + # 'tool --version' output is the version string. + my ($first_line, undef) = split ("\n", `$t --version`); + if ($first_line =~ /.* (\d[\w.-]+)$/) + { + $t = ucfirst $t; + push @tool_version_pair, "$t $1"; + } + else + { + defined $first_line + and $first_line = ''; + warn "$t: unexpected --version output\n:$first_line"; + $fail = 1; + } + } + + $fail + and exit 1; + + return @tool_version_pair; +} + +{ + # Neutralize the locale, so that, for instance, "du" does not + # issue "1,2" instead of "1.2", what confuses our regexps. + $ENV{LC_ALL} = "C"; + + my $mail_headers; + my $release_type; + my $package_name; + my $prev_version; + my $curr_version; + my $gpg_key_id; + my @url_dir_list; + my @news_file; + my $bootstrap_tools; + my $gnulib_version; + my $print_checksums_p = 1; + + # Reformat the warnings before displaying them. + local $SIG{__WARN__} = sub + { + my ($msg) = @_; + # Warnings from GetOptions. + $msg =~ s/Option (\w)/option --$1/; + warn "$ME: $msg"; + }; + + GetOptions + ( + 'mail-headers=s' => \$mail_headers, + 'release-type=s' => \$release_type, + 'package-name=s' => \$package_name, + 'previous-version=s' => \$prev_version, + 'current-version=s' => \$curr_version, + 'gpg-key-id=s' => \$gpg_key_id, + 'url-directory=s' => \@url_dir_list, + 'news=s' => \@news_file, + 'srcdir=s' => \$srcdir, + 'bootstrap-tools=s' => \$bootstrap_tools, + 'gnulib-version=s' => \$gnulib_version, + 'print-checksums!' => \$print_checksums_p, + 'archive-suffix=s' => \@archive_suffixes, + + help => sub { usage 0 }, + version => sub { print "$ME version $VERSION\n"; exit }, + ) or usage 1; + + my $fail = 0; + # Ensure that each required option is specified. + $release_type + or (warn "release type not specified\n"), $fail = 1; + $package_name + or (warn "package name not specified\n"), $fail = 1; + $prev_version + or (warn "previous version string not specified\n"), $fail = 1; + $curr_version + or (warn "current version string not specified\n"), $fail = 1; + $gpg_key_id + or (warn "GnuPG key ID not specified\n"), $fail = 1; + @url_dir_list + or (warn "URL directory name(s) not specified\n"), $fail = 1; + + my @tool_list = split ',', $bootstrap_tools + if $bootstrap_tools; + + grep (/^gnulib$/, @tool_list) ^ defined $gnulib_version + and (warn "when specifying gnulib as a tool, you must also specify\n" + . "--gnulib-version=V, where V is the result of running git describe\n" + . "in the gnulib source directory.\n"), $fail = 1; + + !$release_type || exists $valid_release_types{$release_type} + or (warn "'$release_type': invalid release type\n"), $fail = 1; + + @ARGV + and (warn "too many arguments:\n", join ("\n", @ARGV), "\n"), + $fail = 1; + $fail + and usage 1; + + my $my_distdir = "$package_name-$curr_version"; + + my $xd = "$package_name-$prev_version-$curr_version.xdelta"; + + my @candidates = map { "$my_distdir.$_" } @archive_suffixes; + my @tarballs = grep {-f $_} @candidates; + + @tarballs + or die "$ME: none of " . join(', ', @candidates) . " were found\n"; + my @sizable = @tarballs; + -f $xd + and push @sizable, $xd; + my %size = sizes (@sizable); + %size + or exit 1; + + my $headers = ''; + if (defined $mail_headers) + { + ($headers = $mail_headers) =~ s/\s+(\S+:)/\n$1/g; + $headers .= "\n"; + } + + # The markup is escaped as <\# so that when this script is sent by + # mail (or part of a diff), Gnus is not triggered. + print < + +FIXME: put comments here + +EOF + + if (@url_dir_list == 1 && @tarballs == 1) + { + # When there's only one tarball and one URL, use a more concise form. + my $m = "$url_dir_list[0]/$tarballs[0]"; + print "Here are the compressed sources and a GPG detached signature[*]:\n" + . " $m\n" + . " $m.sig\n\n"; + } + else + { + print_locations ("compressed sources", @url_dir_list, %size, @tarballs); + -f $xd + and print_locations ("xdelta diffs (useful? if so, " + . "please tell bug-gnulib\@gnu.org)", + @url_dir_list, %size, $xd); + my @sig_files = map { "$_.sig" } @tarballs; + print_locations ("GPG detached signatures[*]", @url_dir_list, %size, + @sig_files); + } + + if ($url_dir_list[0] =~ "gnu\.org") + { + print "Use a mirror for higher download bandwidth:\n"; + if (@tarballs == 1 && $url_dir_list[0] =~ m!http://ftp\.gnu\.org/gnu/!) + { + (my $m = "$url_dir_list[0]/$tarballs[0]") + =~ s!http://ftp\.gnu\.org/gnu/!http://ftpmirror\.gnu\.org/!; + print " $m\n" + . " $m.sig\n\n"; + + } + else + { + print " http://www.gnu.org/order/ftp.html\n\n"; + } + } + + $print_checksums_p + and print_checksums (@sizable); + + print <. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + + +# func_error message +func_error () +{ + echo "$me: $1" 1>&2 + exit 1 +} + +file_conv= + +# func_file_conv build_file +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv in + mingw) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_at_file at_file operation archive +# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE +# for each of them. +# When interpreting the content of the @FILE, do NOT use func_file_conv, +# since the user would need to supply preconverted file names to +# binutils ar, at least for MinGW. +func_at_file () +{ + operation=$2 + archive=$3 + at_file_contents=`cat "$1"` + eval set x "$at_file_contents" + shift + + for member + do + $AR -NOLOGO $operation:"$member" "$archive" || exit $? + done +} + +case $1 in + '') + func_error "no command. Try '$0 --help' for more information." + ;; + -h | --h*) + cat <. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/local/recipes/tools/diffutils/source/build-aux/config.guess b/local/recipes/tools/diffutils/source/build-aux/config.guess new file mode 100755 index 0000000000..faa63aa942 --- /dev/null +++ b/local/recipes/tools/diffutils/source/build-aux/config.guess @@ -0,0 +1,1466 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2017 Free Software Foundation, Inc. + +timestamp='2017-05-11' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to . + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2017 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case "${UNAME_MACHINE_ARCH}" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}${abi}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = hppa2.0w ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + *:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; + mips64el:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = 386; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; +esac + +cat >&2 </dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/local/recipes/tools/diffutils/source/build-aux/config.rpath b/local/recipes/tools/diffutils/source/build-aux/config.rpath new file mode 100755 index 0000000000..af3c415598 --- /dev/null +++ b/local/recipes/tools/diffutils/source/build-aux/config.rpath @@ -0,0 +1,684 @@ +#! /bin/sh +# Output a system dependent set of variables, describing how to set the +# run time search path of shared libraries in an executable. +# +# Copyright 1996-2017 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally by Gordon Matzigkeit , 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. + +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +shrext=.so + +host="$1" +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's _LT_CC_BASENAME. + +for cc_temp in $CC""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` + +# Code taken from libtool.m4's _LT_COMPILER_PIC. + +wl= +if test "$GCC" = yes; then + wl='-Wl,' +else + case "$host_os" in + aix*) + wl='-Wl,' + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + ecc*) + wl='-Wl,' + ;; + icc* | ifort*) + wl='-Wl,' + ;; + lf95*) + wl='-Wl,' + ;; + nagfor*) + wl='-Wl,-Wl,,' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + wl='-Wl,' + ;; + ccc*) + wl='-Wl,' + ;; + xl* | bgxl* | bgf* | mpixl*) + wl='-Wl,' + ;; + como) + wl='-lopt=' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + wl= + ;; + *Sun\ C*) + wl='-Wl,' + ;; + esac + ;; + esac + ;; + newsos6) + ;; + *nto* | *qnx*) + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + rdos*) + ;; + solaris*) + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + wl='-Qoption ld ' + ;; + *) + wl='-Wl,' + ;; + esac + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + wl='-Wl,' + ;; + unicos*) + wl='-Wl,' + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's _LT_LINKER_SHLIBS. + +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no + +case "$host_os" in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + case "$host_os" in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + fi + ;; + amigaos*) + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32* | cegcc*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + haiku*) + ;; + interix[3-9]*) + hardcode_direct=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) + ;; + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + else + ld_shlibs=no + fi + ;; + esac + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = no; then + hardcode_libdir_flag_spec= + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + else + aix_use_runtimelinking=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + fi + fi + ;; + amigaos*) + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + bsdi[45]*) + ;; + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + libext=lib + ;; + darwin* | rhapsody*) + hardcode_direct=no + if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then + : + else + ld_shlibs=no + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + freebsd2.[01]*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd* | dragonfly*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + hpux10*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + hpux11*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + ;; + *) + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + *nto* | *qnx*) + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + ;; + sysv5* | sco3.2v5* | sco5v6*) + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + *) + ld_shlibs=no + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. +# Unlike libtool.m4, here we don't care about _all_ names of the library, but +# only about the one the linker finds when passed -lNAME. This is the last +# element of library_names_spec in libtool.m4, or possibly two of them if the +# linker has special search rules. +library_names_spec= # the last element of library_names_spec in libtool.m4 +libname_spec='lib$name' +case "$host_os" in + aix3*) + library_names_spec='$libname.a' + ;; + aix[4-9]*) + library_names_spec='$libname$shrext' + ;; + amigaos*) + case "$host_cpu" in + powerpc*) + library_names_spec='$libname$shrext' ;; + m68k) + library_names_spec='$libname.a' ;; + esac + ;; + beos*) + library_names_spec='$libname$shrext' + ;; + bsdi[45]*) + library_names_spec='$libname$shrext' + ;; + cygwin* | mingw* | pw32* | cegcc*) + shrext=.dll + library_names_spec='$libname.dll.a $libname.lib' + ;; + darwin* | rhapsody*) + shrext=.dylib + library_names_spec='$libname$shrext' + ;; + dgux*) + library_names_spec='$libname$shrext' + ;; + freebsd[23].*) + library_names_spec='$libname$shrext$versuffix' + ;; + freebsd* | dragonfly*) + library_names_spec='$libname$shrext' + ;; + gnu*) + library_names_spec='$libname$shrext' + ;; + haiku*) + library_names_spec='$libname$shrext' + ;; + hpux9* | hpux10* | hpux11*) + case $host_cpu in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac + library_names_spec='$libname$shrext' + ;; + interix[3-9]*) + library_names_spec='$libname$shrext' + ;; + irix5* | irix6* | nonstopux*) + library_names_spec='$libname$shrext' + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + library_names_spec='$libname$shrext' + ;; + knetbsd*-gnu) + library_names_spec='$libname$shrext' + ;; + netbsd*) + library_names_spec='$libname$shrext' + ;; + newsos6) + library_names_spec='$libname$shrext' + ;; + *nto* | *qnx*) + library_names_spec='$libname$shrext' + ;; + openbsd*) + library_names_spec='$libname$shrext$versuffix' + ;; + os2*) + libname_spec='$name' + shrext=.dll + library_names_spec='$libname.a' + ;; + osf3* | osf4* | osf5*) + library_names_spec='$libname$shrext' + ;; + rdos*) + ;; + solaris*) + library_names_spec='$libname$shrext' + ;; + sunos4*) + library_names_spec='$libname$shrext$versuffix' + ;; + sysv4 | sysv4.3*) + library_names_spec='$libname$shrext' + ;; + sysv4*MP*) + library_names_spec='$libname$shrext' + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + library_names_spec='$libname$shrext' + ;; + tpf*) + library_names_spec='$libname$shrext' + ;; + uts4*) + library_names_spec='$libname$shrext' + ;; +esac + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + +LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2017 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ + | pyramid \ + | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ + | wasm32 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | ba-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | e2k-* | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ + | pyramid-* \ + | riscv32-* | riscv64-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | visium-* \ + | wasm32-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + asmjs) + basic_machine=asmjs-unknown + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=$os"spe" + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + wasm32) + basic_machine=wasm32-unknown + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -ios) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + pru-*) + os=-elf + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/local/recipes/tools/diffutils/source/build-aux/depcomp b/local/recipes/tools/diffutils/source/build-aux/depcomp new file mode 100755 index 0000000000..b68723213b --- /dev/null +++ b/local/recipes/tools/diffutils/source/build-aux/depcomp @@ -0,0 +1,756 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 1999-2017 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/local/recipes/tools/diffutils/source/build-aux/do-release-commit-and-tag b/local/recipes/tools/diffutils/source/build-aux/do-release-commit-and-tag new file mode 100755 index 0000000000..b72b15c0dd --- /dev/null +++ b/local/recipes/tools/diffutils/source/build-aux/do-release-commit-and-tag @@ -0,0 +1,179 @@ +#!/bin/sh +# In a git/autoconf/automake-enabled project with a NEWS file and a version- +# controlled .prev-version file, automate the procedure by which we record +# the date, release-type and version string in the NEWS file. That commit +# will serve to identify the release, so apply a signed tag to it as well. +VERSION=2016-12-31.14 # UTC + +# Note: this is a bash script (could be zsh or dash) + +# Copyright (C) 2009-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Written by Jim Meyering + +ME=$(basename "$0") +warn() { printf '%s: %s\n' "$ME" "$*" >&2; } +die() { warn "$*"; exit 1; } + +help() +{ + cat <. +EOF + exit +} + +version() +{ + year=$(echo "$VERSION" | sed 's/[^0-9].*//') + cat < +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +EOF + exit +} + +## ------ ## +## Main. ## +## ------ ## + +# Constants. +noteworthy='* Noteworthy changes in release' +noteworthy_stub="$noteworthy ?.? (????-??-??) [?]" + +# Variables. +branch=$(git branch | sed -ne '/^\* /{s///;p;q;}') +builddir=. + +while test $# != 0 +do + # Handle --option=value by splitting apart and putting back on argv. + case $1 in + --*=*) + opt=$(echo "$1" | sed -e 's/=.*//') + val=$(echo "$1" | sed -e 's/[^=]*=//') + shift + set dummy "$opt" "$val" "$@"; shift + ;; + esac + + case $1 in + --help|--version) ${1#--};; + --branch) shift; branch=$1; shift ;; + -C|--builddir) shift; builddir=$1; shift ;; + --*) die "unrecognized option: $1";; + *) break;; + esac +done + +test $# = 2 \ + || die "Usage: $ME [OPTION...] VERSION TYPE" + +ver=$1 +type=$2 + + +## ---------------------- ## +## First, sanity checks. ## +## ---------------------- ## + +# Verify that $ver looks like a version number, and... +echo "$ver"|grep -E '^[0-9][0-9.]*[0-9]$' > /dev/null \ + || die "invalid version: $ver" +prev_ver=$(cat .prev-version) \ + || die 'failed to determine previous version number from .prev-version' + +# Verify that $ver is sensible (> .prev-version). +case $(printf "$prev_ver\n$ver\n"|sort -V -u|tr '\n' ':') in + "$prev_ver:$ver:") ;; + *) die "invalid version: $ver (<= $prev_ver)";; +esac + +case $type in + alpha|beta|stable) ;; + *) die "invalid release type: $type";; +esac + +# No local modifications allowed. +case $(git diff-index --name-only HEAD) in + '') ;; + *) die 'this tree is dirty; commit your changes first';; +esac + +# Ensure the current branch name is correct: +curr_br=$(git rev-parse --symbolic-full-name HEAD) +test "$curr_br" = "refs/heads/$branch" || die not on branch $branch + +# Extract package name from Makefile. +Makefile=$builddir/Makefile +pkg=$(sed -n 's/^PACKAGE = \(.*\)/\1/p' "$Makefile") \ + || die "failed to determine package name from $Makefile" + +# Check that line 3 of NEWS is the stub line about to be replaced. +test "$(sed -n 3p NEWS)" = "$noteworthy_stub" \ + || die "line 3 of NEWS must be exactly '$noteworthy_stub'" + +## --------------- ## +## Then, changes. ## +## --------------- ## + +# Update NEWS to have today's date, plus desired version number and $type. +perl -MPOSIX -ni -e 'my $today = strftime "%F", localtime time;' \ + -e 'my ($type, $ver) = qw('"$type $ver"');' \ + -e 'my $pfx = "'"$noteworthy"'";' \ + -e 'print $.==3 ? "$pfx $ver ($today) [$type]\n" : $_' \ + NEWS || die 'failed to update NEWS' + +printf "version $ver\n\n* NEWS: Record release date.\n" \ + | git commit -F - -a || die 'git commit failed' +git tag -s -m "$pkg $ver" v$ver HEAD || die 'git tag failed' + +# Local variables: +# indent-tabs-mode: nil +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "VERSION=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: " # UTC" +# End: diff --git a/local/recipes/tools/diffutils/source/build-aux/gendocs.sh b/local/recipes/tools/diffutils/source/build-aux/gendocs.sh new file mode 100755 index 0000000000..3b71b36a20 --- /dev/null +++ b/local/recipes/tools/diffutils/source/build-aux/gendocs.sh @@ -0,0 +1,504 @@ +#!/bin/sh -e +# gendocs.sh -- generate a GNU manual in many formats. This script is +# mentioned in maintain.texi. See the help message below for usage details. + +scriptversion=2016-12-31.18 + +# Copyright 2003-2017 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# Original author: Mohit Agarwal. +# Send bug reports and any other correspondence to bug-gnulib@gnu.org. +# +# The latest version of this script, and the companion template, is +# available from the Gnulib repository: +# +# http://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/gendocs.sh +# http://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/gendocs_template + +# TODO: +# - image importing was only implemented for HTML generated by +# makeinfo. But it should be simple enough to adjust. +# - images are not imported in the source tarball. All the needed +# formats (PDF, PNG, etc.) should be included. + +prog=`basename "$0"` +srcdir=`pwd` + +scripturl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/gendocs.sh" +templateurl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/gendocs_template" + +: ${SETLANG="env LANG= LC_MESSAGES= LC_ALL= LANGUAGE="} +: ${MAKEINFO="makeinfo"} +: ${TEXI2DVI="texi2dvi"} +: ${DOCBOOK2HTML="docbook2html"} +: ${DOCBOOK2PDF="docbook2pdf"} +: ${DOCBOOK2TXT="docbook2txt"} +: ${GENDOCS_TEMPLATE_DIR="."} +: ${PERL='perl'} +: ${TEXI2HTML="texi2html"} +unset CDPATH +unset use_texi2html + +MANUAL_TITLE= +PACKAGE= +EMAIL=webmasters@gnu.org # please override with --email +commonarg= # passed to all makeinfo/texi2html invcations. +dirargs= # passed to all tools (-I dir). +dirs= # -I directories. +htmlarg="--css-ref=/software/gnulib/manual.css -c TOP_NODE_UP_URL=/manual" +infoarg=--no-split +generate_ascii=true +generate_html=true +generate_info=true +generate_tex=true +outdir=manual +source_extra= +split=node +srcfile= +texarg="-t @finalout" + +version="gendocs.sh $scriptversion + +Copyright 2017 Free Software Foundation, Inc. +There is NO warranty. You may redistribute this software +under the terms of the GNU General Public License. +For more information about these matters, see the files named COPYING." + +usage="Usage: $prog [OPTION]... PACKAGE MANUAL-TITLE + +Generate output in various formats from PACKAGE.texinfo (or .texi or +.txi) source. See the GNU Maintainers document for a more extensive +discussion: + http://www.gnu.org/prep/maintain_toc.html + +Options: + --email ADR use ADR as contact in generated web pages; always give this. + + -s SRCFILE read Texinfo from SRCFILE, instead of PACKAGE.{texinfo|texi|txi} + -o OUTDIR write files into OUTDIR, instead of manual/. + -I DIR append DIR to the Texinfo search path. + --common ARG pass ARG in all invocations. + --html ARG pass ARG to makeinfo or texi2html for HTML targets, + instead of '$htmlarg'. + --info ARG pass ARG to makeinfo for Info, instead of --no-split. + --no-ascii skip generating the plain text output. + --no-html skip generating the html output. + --no-info skip generating the info output. + --no-tex skip generating the dvi and pdf output. + --source ARG include ARG in tar archive of sources. + --split HOW make split HTML by node, section, chapter; default node. + --tex ARG pass ARG to texi2dvi for DVI and PDF, instead of -t @finalout. + + --texi2html use texi2html to make HTML target, with all split versions. + --docbook convert through DocBook too (xml, txt, html, pdf). + + --help display this help and exit successfully. + --version display version information and exit successfully. + +Simple example: $prog --email bug-gnu-emacs@gnu.org emacs \"GNU Emacs Manual\" + +Typical sequence: + cd PACKAGESOURCE/doc + wget \"$scripturl\" + wget \"$templateurl\" + $prog --email BUGLIST MANUAL \"GNU MANUAL - One-line description\" + +Output will be in a new subdirectory \"manual\" (by default; +use -o OUTDIR to override). Move all the new files into your web CVS +tree, as explained in the Web Pages node of maintain.texi. + +Please use the --email ADDRESS option so your own bug-reporting +address will be used in the generated HTML pages. + +MANUAL-TITLE is included as part of the HTML of the overall +manual/index.html file. It should include the name of the package being +documented. manual/index.html is created by substitution from the file +$GENDOCS_TEMPLATE_DIR/gendocs_template. (Feel free to modify the +generic template for your own purposes.) + +If you have several manuals, you'll need to run this script several +times with different MANUAL values, specifying a different output +directory with -o each time. Then write (by hand) an overall index.html +with links to them all. + +If a manual's Texinfo sources are spread across several directories, +first copy or symlink all Texinfo sources into a single directory. +(Part of the script's work is to make a tar.gz of the sources.) + +As implied above, by default monolithic Info files are generated. +If you want split Info, or other Info options, use --info to override. + +You can set the environment variables MAKEINFO, TEXI2DVI, TEXI2HTML, +and PERL to control the programs that get executed, and +GENDOCS_TEMPLATE_DIR to control where the gendocs_template file is +looked for. With --docbook, the environment variables DOCBOOK2HTML, +DOCBOOK2PDF, and DOCBOOK2TXT are also consulted. + +By default, makeinfo and texi2dvi are run in the default (English) +locale, since that's the language of most Texinfo manuals. If you +happen to have a non-English manual and non-English web site, see the +SETLANG setting in the source. + +Email bug reports or enhancement requests to bug-gnulib@gnu.org. +" + +while test $# -gt 0; do + case $1 in + -s) shift; srcfile=$1;; + -o) shift; outdir=$1;; + -I) shift; dirargs="$dirargs -I '$1'"; dirs="$dirs $1";; + --common) shift; commonarg=$1;; + --docbook) docbook=yes;; + --email) shift; EMAIL=$1;; + --html) shift; htmlarg=$1;; + --info) shift; infoarg=$1;; + --no-ascii) generate_ascii=false;; + --no-html) generate_ascii=false;; + --no-info) generate_info=false;; + --no-tex) generate_tex=false;; + --source) shift; source_extra=$1;; + --split) shift; split=$1;; + --tex) shift; texarg=$1;; + --texi2html) use_texi2html=1;; + + --help) echo "$usage"; exit 0;; + --version) echo "$version"; exit 0;; + -*) + echo "$0: Unknown option \`$1'." >&2 + echo "$0: Try \`--help' for more information." >&2 + exit 1;; + *) + if test -z "$PACKAGE"; then + PACKAGE=$1 + elif test -z "$MANUAL_TITLE"; then + MANUAL_TITLE=$1 + else + echo "$0: extra non-option argument \`$1'." >&2 + exit 1 + fi;; + esac + shift +done + +# makeinfo uses the dirargs, but texi2dvi doesn't. +commonarg=" $dirargs $commonarg" + +# For most of the following, the base name is just $PACKAGE +base=$PACKAGE + +if test -n "$srcfile"; then + # but here, we use the basename of $srcfile + base=`basename "$srcfile"` + case $base in + *.txi|*.texi|*.texinfo) base=`echo "$base"|sed 's/\.[texinfo]*$//'`;; + esac + PACKAGE=$base +elif test -s "$srcdir/$PACKAGE.texinfo"; then + srcfile=$srcdir/$PACKAGE.texinfo +elif test -s "$srcdir/$PACKAGE.texi"; then + srcfile=$srcdir/$PACKAGE.texi +elif test -s "$srcdir/$PACKAGE.txi"; then + srcfile=$srcdir/$PACKAGE.txi +else + echo "$0: cannot find .texinfo or .texi or .txi for $PACKAGE in $srcdir." >&2 + exit 1 +fi + +if test ! -r $GENDOCS_TEMPLATE_DIR/gendocs_template; then + echo "$0: cannot read $GENDOCS_TEMPLATE_DIR/gendocs_template." >&2 + echo "$0: it is available from $templateurl." >&2 + exit 1 +fi + +# Function to return size of $1 in something resembling kilobytes. +calcsize() +{ + size=`ls -ksl $1 | awk '{print $1}'` + echo $size +} + +# copy_images OUTDIR HTML-FILE... +# ------------------------------- +# Copy all the images needed by the HTML-FILEs into OUTDIR. +# Look for them in . and the -I directories; this is simpler than what +# makeinfo supports with -I, but hopefully it will suffice. +copy_images() +{ + local odir + odir=$1 + shift + $PERL -n -e " +BEGIN { + \$me = '$prog'; + \$odir = '$odir'; + @dirs = qw(. $dirs); +} +" -e ' +/<img src="(.*?)"/g && ++$need{$1}; + +END { + #print "$me: @{[keys %need]}\n"; # for debugging, show images found. + FILE: for my $f (keys %need) { + for my $d (@dirs) { + if (-f "$d/$f") { + use File::Basename; + my $dest = dirname ("$odir/$f"); + # + use File::Path; + -d $dest || mkpath ($dest) + || die "$me: cannot mkdir $dest: $!\n"; + # + use File::Copy; + copy ("$d/$f", $dest) + || die "$me: cannot copy $d/$f to $dest: $!\n"; + next FILE; + } + } + die "$me: $ARGV: cannot find image $f\n"; + } +} +' -- "$@" || exit 1 +} + +case $outdir in + /*) abs_outdir=$outdir;; + *) abs_outdir=$srcdir/$outdir;; +esac + +echo "Making output for $srcfile" +echo " in `pwd`" +mkdir -p "$outdir/" + +# +if $generate_info; then + cmd="$SETLANG $MAKEINFO -o $PACKAGE.info $commonarg $infoarg \"$srcfile\"" + echo "Generating info... ($cmd)" + rm -f $PACKAGE.info* # get rid of any strays + eval "$cmd" + tar czf "$outdir/$PACKAGE.info.tar.gz" $PACKAGE.info* + ls -l "$outdir/$PACKAGE.info.tar.gz" + info_tgz_size=`calcsize "$outdir/$PACKAGE.info.tar.gz"` + # do not mv the info files, there's no point in having them available + # separately on the web. +fi # end info + +# +if $generate_tex; then + cmd="$SETLANG $TEXI2DVI $dirargs $texarg \"$srcfile\"" + printf "\nGenerating dvi... ($cmd)\n" + eval "$cmd" + # compress/finish dvi: + gzip -f -9 $PACKAGE.dvi + dvi_gz_size=`calcsize $PACKAGE.dvi.gz` + mv $PACKAGE.dvi.gz "$outdir/" + ls -l "$outdir/$PACKAGE.dvi.gz" + + cmd="$SETLANG $TEXI2DVI --pdf $dirargs $texarg \"$srcfile\"" + printf "\nGenerating pdf... ($cmd)\n" + eval "$cmd" + pdf_size=`calcsize $PACKAGE.pdf` + mv $PACKAGE.pdf "$outdir/" + ls -l "$outdir/$PACKAGE.pdf" +fi # end tex (dvi + pdf) + +# +if $generate_ascii; then + opt="-o $PACKAGE.txt --no-split --no-headers $commonarg" + cmd="$SETLANG $MAKEINFO $opt \"$srcfile\"" + printf "\nGenerating ascii... ($cmd)\n" + eval "$cmd" + ascii_size=`calcsize $PACKAGE.txt` + gzip -f -9 -c $PACKAGE.txt >"$outdir/$PACKAGE.txt.gz" + ascii_gz_size=`calcsize "$outdir/$PACKAGE.txt.gz"` + mv $PACKAGE.txt "$outdir/" + ls -l "$outdir/$PACKAGE.txt" "$outdir/$PACKAGE.txt.gz" +fi + +# + +if $generate_html; then +# Split HTML at level $1. Used for texi2html. +html_split() +{ + opt="--split=$1 --node-files $commonarg $htmlarg" + cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html $opt \"$srcfile\"" + printf "\nGenerating html by $1... ($cmd)\n" + eval "$cmd" + split_html_dir=$PACKAGE.html + ( + cd ${split_html_dir} || exit 1 + ln -sf ${PACKAGE}.html index.html + tar -czf "$abs_outdir/${PACKAGE}.html_$1.tar.gz" -- *.html + ) + eval html_$1_tgz_size=`calcsize "$outdir/${PACKAGE}.html_$1.tar.gz"` + rm -f "$outdir"/html_$1/*.html + mkdir -p "$outdir/html_$1/" + mv ${split_html_dir}/*.html "$outdir/html_$1/" + rmdir ${split_html_dir} +} + +if test -z "$use_texi2html"; then + opt="--no-split --html -o $PACKAGE.html $commonarg $htmlarg" + cmd="$SETLANG $MAKEINFO $opt \"$srcfile\"" + printf "\nGenerating monolithic html... ($cmd)\n" + rm -rf $PACKAGE.html # in case a directory is left over + eval "$cmd" + html_mono_size=`calcsize $PACKAGE.html` + gzip -f -9 -c $PACKAGE.html >"$outdir/$PACKAGE.html.gz" + html_mono_gz_size=`calcsize "$outdir/$PACKAGE.html.gz"` + copy_images "$outdir/" $PACKAGE.html + mv $PACKAGE.html "$outdir/" + ls -l "$outdir/$PACKAGE.html" "$outdir/$PACKAGE.html.gz" + + # Before Texinfo 5.0, makeinfo did not accept a --split=HOW option, + # it just always split by node. So if we're splitting by node anyway, + # leave it out. + if test "x$split" = xnode; then + split_arg= + else + split_arg=--split=$split + fi + # + opt="--html -o $PACKAGE.html $split_arg $commonarg $htmlarg" + cmd="$SETLANG $MAKEINFO $opt \"$srcfile\"" + printf "\nGenerating html by $split... ($cmd)\n" + eval "$cmd" + split_html_dir=$PACKAGE.html + copy_images $split_html_dir/ $split_html_dir/*.html + ( + cd $split_html_dir || exit 1 + tar -czf "$abs_outdir/$PACKAGE.html_$split.tar.gz" -- * + ) + eval \ + html_${split}_tgz_size=`calcsize "$outdir/$PACKAGE.html_$split.tar.gz"` + rm -rf "$outdir/html_$split/" + mv $split_html_dir "$outdir/html_$split/" + du -s "$outdir/html_$split/" + ls -l "$outdir/$PACKAGE.html_$split.tar.gz" + +else # use texi2html: + opt="--output $PACKAGE.html $commonarg $htmlarg" + cmd="$SETLANG $TEXI2HTML $opt \"$srcfile\"" + printf "\nGenerating monolithic html with texi2html... ($cmd)\n" + rm -rf $PACKAGE.html # in case a directory is left over + eval "$cmd" + html_mono_size=`calcsize $PACKAGE.html` + gzip -f -9 -c $PACKAGE.html >"$outdir/$PACKAGE.html.gz" + html_mono_gz_size=`calcsize "$outdir/$PACKAGE.html.gz"` + mv $PACKAGE.html "$outdir/" + + html_split node + html_split chapter + html_split section +fi +fi # end html + +# +printf "\nMaking .tar.gz for sources...\n" +d=`dirname $srcfile` +( + cd "$d" + srcfiles=`ls -d *.texinfo *.texi *.txi *.eps $source_extra 2>/dev/null` || true + tar czfh "$abs_outdir/$PACKAGE.texi.tar.gz" $srcfiles + ls -l "$abs_outdir/$PACKAGE.texi.tar.gz" +) +texi_tgz_size=`calcsize "$outdir/$PACKAGE.texi.tar.gz"` + +# +# Do everything again through docbook. +if test -n "$docbook"; then + opt="-o - --docbook $commonarg" + cmd="$SETLANG $MAKEINFO $opt \"$srcfile\" >${srcdir}/$PACKAGE-db.xml" + printf "\nGenerating docbook XML... ($cmd)\n" + eval "$cmd" + docbook_xml_size=`calcsize $PACKAGE-db.xml` + gzip -f -9 -c $PACKAGE-db.xml >"$outdir/$PACKAGE-db.xml.gz" + docbook_xml_gz_size=`calcsize "$outdir/$PACKAGE-db.xml.gz"` + mv $PACKAGE-db.xml "$outdir/" + + split_html_db_dir=html_node_db + opt="$commonarg -o $split_html_db_dir" + cmd="$DOCBOOK2HTML $opt \"${outdir}/$PACKAGE-db.xml\"" + printf "\nGenerating docbook HTML... ($cmd)\n" + eval "$cmd" + ( + cd ${split_html_db_dir} || exit 1 + tar -czf "$abs_outdir/${PACKAGE}.html_node_db.tar.gz" -- *.html + ) + html_node_db_tgz_size=`calcsize "$outdir/${PACKAGE}.html_node_db.tar.gz"` + rm -f "$outdir"/html_node_db/*.html + mkdir -p "$outdir/html_node_db" + mv ${split_html_db_dir}/*.html "$outdir/html_node_db/" + rmdir ${split_html_db_dir} + + cmd="$DOCBOOK2TXT \"${outdir}/$PACKAGE-db.xml\"" + printf "\nGenerating docbook ASCII... ($cmd)\n" + eval "$cmd" + docbook_ascii_size=`calcsize $PACKAGE-db.txt` + mv $PACKAGE-db.txt "$outdir/" + + cmd="$DOCBOOK2PDF \"${outdir}/$PACKAGE-db.xml\"" + printf "\nGenerating docbook PDF... ($cmd)\n" + eval "$cmd" + docbook_pdf_size=`calcsize $PACKAGE-db.pdf` + mv $PACKAGE-db.pdf "$outdir/" +fi + +# +printf "\nMaking index.html for $PACKAGE...\n" +if test -z "$use_texi2html"; then + CONDS="/%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;\ + /%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d" +else + # should take account of --split here. + CONDS="/%%ENDIF.*%%/d;/%%IF *HTML_SECTION%%/d;/%%IF *HTML_CHAPTER%%/d" +fi + +curdate=`$SETLANG date '+%B %d, %Y'` +sed \ + -e "s!%%TITLE%%!$MANUAL_TITLE!g" \ + -e "s!%%EMAIL%%!$EMAIL!g" \ + -e "s!%%PACKAGE%%!$PACKAGE!g" \ + -e "s!%%DATE%%!$curdate!g" \ + -e "s!%%HTML_MONO_SIZE%%!$html_mono_size!g" \ + -e "s!%%HTML_MONO_GZ_SIZE%%!$html_mono_gz_size!g" \ + -e "s!%%HTML_NODE_TGZ_SIZE%%!$html_node_tgz_size!g" \ + -e "s!%%HTML_SECTION_TGZ_SIZE%%!$html_section_tgz_size!g" \ + -e "s!%%HTML_CHAPTER_TGZ_SIZE%%!$html_chapter_tgz_size!g" \ + -e "s!%%INFO_TGZ_SIZE%%!$info_tgz_size!g" \ + -e "s!%%DVI_GZ_SIZE%%!$dvi_gz_size!g" \ + -e "s!%%PDF_SIZE%%!$pdf_size!g" \ + -e "s!%%ASCII_SIZE%%!$ascii_size!g" \ + -e "s!%%ASCII_GZ_SIZE%%!$ascii_gz_size!g" \ + -e "s!%%TEXI_TGZ_SIZE%%!$texi_tgz_size!g" \ + -e "s!%%DOCBOOK_HTML_NODE_TGZ_SIZE%%!$html_node_db_tgz_size!g" \ + -e "s!%%DOCBOOK_ASCII_SIZE%%!$docbook_ascii_size!g" \ + -e "s!%%DOCBOOK_PDF_SIZE%%!$docbook_pdf_size!g" \ + -e "s!%%DOCBOOK_XML_SIZE%%!$docbook_xml_size!g" \ + -e "s!%%DOCBOOK_XML_GZ_SIZE%%!$docbook_xml_gz_size!g" \ + -e "s,%%SCRIPTURL%%,$scripturl,g" \ + -e "s!%%SCRIPTNAME%%!$prog!g" \ + -e "$CONDS" \ +$GENDOCS_TEMPLATE_DIR/gendocs_template >"$outdir/index.html" + +echo "Done, see $outdir/ subdirectory for new files." + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/local/recipes/tools/diffutils/source/build-aux/git-version-gen b/local/recipes/tools/diffutils/source/build-aux/git-version-gen new file mode 100755 index 0000000000..079849d5e5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/build-aux/git-version-gen @@ -0,0 +1,226 @@ +#!/bin/sh +# Print a version string. +scriptversion=2017-01-09.19; # UTC + +# Copyright (C) 2007-2017 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. +# It may be run two ways: +# - from a git repository in which the "git describe" command below +# produces useful output (thus requiring at least one signed tag) +# - from a non-git-repo directory containing a .tarball-version file, which +# presumes this script is invoked like "./git-version-gen .tarball-version". + +# In order to use intra-version strings in your project, you will need two +# separate generated version string files: +# +# .tarball-version - present only in a distribution tarball, and not in +# a checked-out repository. Created with contents that were learned at +# the last time autoconf was run, and used by git-version-gen. Must not +# be present in either $(srcdir) or $(builddir) for git-version-gen to +# give accurate answers during normal development with a checked out tree, +# but must be present in a tarball when there is no version control system. +# Therefore, it cannot be used in any dependencies. GNUmakefile has +# hooks to force a reconfigure at distribution time to get the value +# correct, without penalizing normal development with extra reconfigures. +# +# .version - present in a checked-out repository and in a distribution +# tarball. Usable in dependencies, particularly for files that don't +# want to depend on config.h but do want to track version changes. +# Delete this file prior to any autoconf run where you want to rebuild +# files to pick up a version string change; and leave it stale to +# minimize rebuild time after unrelated changes to configure sources. +# +# As with any generated file in a VC'd directory, you should add +# /.version to .gitignore, so that you don't accidentally commit it. +# .tarball-version is never generated in a VC'd directory, so needn't +# be listed there. +# +# Use the following line in your configure.ac, so that $(VERSION) will +# automatically be up-to-date each time configure is run (and note that +# since configure.ac no longer includes a version string, Makefile rules +# should not depend on configure.ac for version updates). +# +# AC_INIT([GNU project], +# m4_esyscmd([build-aux/git-version-gen .tarball-version]), +# [bug-project@example]) +# +# Then use the following lines in your Makefile.am, so that .version +# will be present for dependencies, and so that .version and +# .tarball-version will exist in distribution tarballs. +# +# EXTRA_DIST = $(top_srcdir)/.version +# BUILT_SOURCES = $(top_srcdir)/.version +# $(top_srcdir)/.version: +# echo $(VERSION) > $@-t && mv $@-t $@ +# dist-hook: +# echo $(VERSION) > $(distdir)/.tarball-version + + +me=$0 + +version="git-version-gen $scriptversion + +Copyright 2011 Free Software Foundation, Inc. +There is NO warranty. You may redistribute this software +under the terms of the GNU General Public License. +For more information about these matters, see the files named COPYING." + +usage="\ +Usage: $me [OPTION]... \$srcdir/.tarball-version [TAG-NORMALIZATION-SED-SCRIPT] +Print a version string. + +Options: + + --prefix PREFIX prefix of git tags (default 'v') + --fallback VERSION + fallback version to use if \"git --version\" fails + + --help display this help and exit + --version output version information and exit + +Running without arguments will suffice in most cases." + +prefix=v +fallback= + +while test $# -gt 0; do + case $1 in + --help) echo "$usage"; exit 0;; + --version) echo "$version"; exit 0;; + --prefix) shift; prefix=${1?};; + --fallback) shift; fallback=${1?};; + -*) + echo "$0: Unknown option '$1'." >&2 + echo "$0: Try '--help' for more information." >&2 + exit 1;; + *) + if test "x$tarball_version_file" = x; then + tarball_version_file="$1" + elif test "x$tag_sed_script" = x; then + tag_sed_script="$1" + else + echo "$0: extra non-option argument '$1'." >&2 + exit 1 + fi;; + esac + shift +done + +if test "x$tarball_version_file" = x; then + echo "$usage" + exit 1 +fi + +tag_sed_script="${tag_sed_script:-s/x/x/}" + +nl=' +' + +# Avoid meddling by environment variable of the same name. +v= +v_from_git= + +# First see if there is a tarball-only version file. +# then try "git describe", then default. +if test -f $tarball_version_file +then + v=`cat $tarball_version_file` || v= + case $v in + *$nl*) v= ;; # reject multi-line output + [0-9]*) ;; + *) v= ;; + esac + test "x$v" = x \ + && echo "$0: WARNING: $tarball_version_file is missing or damaged" 1>&2 +fi + +if test "x$v" != x +then + : # use $v +# Otherwise, if there is at least one git commit involving the working +# directory, and "git describe" output looks sensible, use that to +# derive a version string. +elif test "`git log -1 --pretty=format:x . 2>&1`" = x \ + && v=`git describe --abbrev=4 --match="$prefix*" HEAD 2>/dev/null \ + || git describe --abbrev=4 HEAD 2>/dev/null` \ + && v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \ + && case $v in + $prefix[0-9]*) ;; + *) (exit 1) ;; + esac +then + # Is this a new git that lists number of commits since the last + # tag or the previous older version that did not? + # Newer: v6.10-77-g0f8faeb + # Older: v6.10-g0f8faeb + case $v in + *-*-*) : git describe is okay three part flavor ;; + *-*) + : git describe is older two part flavor + # Recreate the number of commits and rewrite such that the + # result is the same as if we were using the newer version + # of git describe. + vtag=`echo "$v" | sed 's/-.*//'` + commit_list=`git rev-list "$vtag"..HEAD 2>/dev/null` \ + || { commit_list=failed; + echo "$0: WARNING: git rev-list failed" 1>&2; } + numcommits=`echo "$commit_list" | wc -l` + v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`; + test "$commit_list" = failed && v=UNKNOWN + ;; + esac + + # Change the first '-' to a '.', so version-comparing tools work properly. + # Remove the "g" in git describe's output string, to save a byte. + v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; + v_from_git=1 +elif test "x$fallback" = x || git --version >/dev/null 2>&1; then + v=UNKNOWN +else + v=$fallback +fi + +v=`echo "$v" |sed "s/^$prefix//"` + +# Test whether to append the "-dirty" suffix only if the version +# string we're using came from git. I.e., skip the test if it's "UNKNOWN" +# or if it came from .tarball-version. +if test "x$v_from_git" != x; then + # Don't declare a version "dirty" merely because a timestamp has changed. + git update-index --refresh > /dev/null 2>&1 + + dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty= + case "$dirty" in + '') ;; + *) # Append the suffix only if there isn't one already. + case $v in + *-dirty) ;; + *) v="$v-dirty" ;; + esac ;; + esac +fi + +# Omit the trailing newline, so that m4_esyscmd can use the result directly. +printf %s "$v" + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/local/recipes/tools/diffutils/source/build-aux/gitlog-to-changelog b/local/recipes/tools/diffutils/source/build-aux/gitlog-to-changelog new file mode 100755 index 0000000000..cf16425463 --- /dev/null +++ b/local/recipes/tools/diffutils/source/build-aux/gitlog-to-changelog @@ -0,0 +1,499 @@ +eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"' + & eval 'exec perl -wS "$0" $argv:q' + if 0; +# Convert git log output to ChangeLog format. + +my $VERSION = '2016-03-22 21:49'; # UTC +# The definition above must lie within the first 8 lines in order +# for the Emacs time-stamp write hook (at end) to update it. +# If you change this file with Emacs, please let the write hook +# do its job. Otherwise, update this string manually. + +# Copyright (C) 2008-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Written by Jim Meyering + +use strict; +use warnings; +use Getopt::Long; +use POSIX qw(strftime); + +(my $ME = $0) =~ s|.*/||; + +# use File::Coda; # http://meyering.net/code/Coda/ +END { + defined fileno STDOUT or return; + close STDOUT and return; + warn "$ME: failed to close standard output: $!\n"; + $? ||= 1; +} + +sub usage ($) +{ + my ($exit_code) = @_; + my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR); + if ($exit_code != 0) + { + print $STREAM "Try '$ME --help' for more information.\n"; + } + else + { + print $STREAM <<EOF; +Usage: $ME [OPTIONS] [ARGS] + +Convert git log output to ChangeLog format. If present, any ARGS +are passed to "git log". To avoid ARGS being parsed as options to +$ME, they may be preceded by '--'. + +OPTIONS: + + --amend=FILE FILE maps from an SHA1 to perl code (i.e., s/old/new/) that + makes a change to SHA1's commit log text or metadata. + --append-dot append a dot to the first line of each commit message if + there is no other punctuation or blank at the end. + --no-cluster never cluster commit messages under the same date/author + header; the default is to cluster adjacent commit messages + if their headers are the same and neither commit message + contains multiple paragraphs. + --srcdir=DIR the root of the source tree, from which the .git/ + directory can be derived. + --since=DATE convert only the logs since DATE; + the default is to convert all log entries. + --until=DATE convert only the logs older than DATE. + --ignore-matching=PAT ignore commit messages whose first lines match PAT. + --ignore-line=PAT ignore lines of commit messages that match PAT. + --format=FMT set format string for commit subject and body; + see 'man git-log' for the list of format metacharacters; + the default is '%s%n%b%n' + --strip-tab remove one additional leading TAB from commit message lines. + --strip-cherry-pick remove data inserted by "git cherry-pick"; + this includes the "cherry picked from commit ..." line, + and the possible final "Conflicts:" paragraph. + --help display this help and exit + --version output version information and exit + +EXAMPLE: + + $ME --since=2008-01-01 > ChangeLog + $ME -- -n 5 foo > last-5-commits-to-branch-foo + +SPECIAL SYNTAX: + +The following types of strings are interpreted specially when they appear +at the beginning of a log message line. They are not copied to the output. + + Copyright-paperwork-exempt: Yes + Append the "(tiny change)" notation to the usual "date name email" + ChangeLog header to mark a change that does not require a copyright + assignment. + Co-authored-by: Joe User <user\@example.com> + List the specified name and email address on a second + ChangeLog header, denoting a co-author. + Signed-off-by: Joe User <user\@example.com> + These lines are simply elided. + +In a FILE specified via --amend, comment lines (starting with "#") are ignored. +FILE must consist of <SHA,CODE+> pairs where SHA is a 40-byte SHA1 (alone on +a line) referring to a commit in the current project, and CODE refers to one +or more consecutive lines of Perl code. Pairs must be separated by one or +more blank line. + +Here is sample input for use with --amend=FILE, from coreutils: + +3a169f4c5d9159283548178668d2fae6fced3030 +# fix typo in title: +s/all tile types/all file types/ + +1379ed974f1fa39b12e2ffab18b3f7a607082202 +# Due to a bug in vc-dwim, I mis-attributed a patch by Paul to myself. +# Change the author to be Paul. Note the escaped "@": +s,Jim .*>,Paul Eggert <eggert\\\@cs.ucla.edu>, + +EOF + } + exit $exit_code; +} + +# If the string $S is a well-behaved file name, simply return it. +# If it contains white space, quotes, etc., quote it, and return the new string. +sub shell_quote($) +{ + my ($s) = @_; + if ($s =~ m![^\w+/.,-]!) + { + # Convert each single quote to '\'' + $s =~ s/\'/\'\\\'\'/g; + # Then single quote the string. + $s = "'$s'"; + } + return $s; +} + +sub quoted_cmd(@) +{ + return join (' ', map {shell_quote $_} @_); +} + +# Parse file F. +# Comment lines (starting with "#") are ignored. +# F must consist of <SHA,CODE+> pairs where SHA is a 40-byte SHA1 +# (alone on a line) referring to a commit in the current project, and +# CODE refers to one or more consecutive lines of Perl code. +# Pairs must be separated by one or more blank line. +sub parse_amend_file($) +{ + my ($f) = @_; + + open F, '<', $f + or die "$ME: $f: failed to open for reading: $!\n"; + + my $fail; + my $h = {}; + my $in_code = 0; + my $sha; + while (defined (my $line = <F>)) + { + $line =~ /^\#/ + and next; + chomp $line; + $line eq '' + and $in_code = 0, next; + + if (!$in_code) + { + $line =~ /^([0-9a-fA-F]{40})$/ + or (warn "$ME: $f:$.: invalid line; expected an SHA1\n"), + $fail = 1, next; + $sha = lc $1; + $in_code = 1; + exists $h->{$sha} + and (warn "$ME: $f:$.: duplicate SHA1\n"), + $fail = 1, next; + } + else + { + $h->{$sha} ||= ''; + $h->{$sha} .= "$line\n"; + } + } + close F; + + $fail + and exit 1; + + return $h; +} + +# git_dir_option $SRCDIR +# +# From $SRCDIR, the --git-dir option to pass to git (none if $SRCDIR +# is undef). Return as a list (0 or 1 element). +sub git_dir_option($) +{ + my ($srcdir) = @_; + my @res = (); + if (defined $srcdir) + { + my $qdir = shell_quote $srcdir; + my $cmd = "cd $qdir && git rev-parse --show-toplevel"; + my $qcmd = shell_quote $cmd; + my $git_dir = qx($cmd); + defined $git_dir + or die "$ME: cannot run $qcmd: $!\n"; + $? == 0 + or die "$ME: $qcmd had unexpected exit code or signal ($?)\n"; + chomp $git_dir; + push @res, "--git-dir=$git_dir/.git"; + } + @res; +} + +{ + my $since_date; + my $until_date; + my $format_string = '%s%n%b%n'; + my $amend_file; + my $append_dot = 0; + my $cluster = 1; + my $ignore_matching; + my $ignore_line; + my $strip_tab = 0; + my $strip_cherry_pick = 0; + my $srcdir; + GetOptions + ( + help => sub { usage 0 }, + version => sub { print "$ME version $VERSION\n"; exit }, + 'since=s' => \$since_date, + 'until=s' => \$until_date, + 'format=s' => \$format_string, + 'amend=s' => \$amend_file, + 'append-dot' => \$append_dot, + 'cluster!' => \$cluster, + 'ignore-matching=s' => \$ignore_matching, + 'ignore-line=s' => \$ignore_line, + 'strip-tab' => \$strip_tab, + 'strip-cherry-pick' => \$strip_cherry_pick, + 'srcdir=s' => \$srcdir, + ) or usage 1; + + defined $since_date + and unshift @ARGV, "--since=$since_date"; + defined $until_date + and unshift @ARGV, "--until=$until_date"; + + # This is a hash that maps an SHA1 to perl code (i.e., s/old/new/) + # that makes a correction in the log or attribution of that commit. + my $amend_code = defined $amend_file ? parse_amend_file $amend_file : {}; + + my @cmd = ('git', + git_dir_option $srcdir, + qw(log --log-size), + '--pretty=format:%H:%ct %an <%ae>%n%n'.$format_string, @ARGV); + open PIPE, '-|', @cmd + or die ("$ME: failed to run '". quoted_cmd (@cmd) ."': $!\n" + . "(Is your Git too old? Version 1.5.1 or later is required.)\n"); + + my $prev_multi_paragraph; + my $prev_date_line = ''; + my @prev_coauthors = (); + my @skipshas = (); + while (1) + { + defined (my $in = <PIPE>) + or last; + $in =~ /^log size (\d+)$/ + or die "$ME:$.: Invalid line (expected log size):\n$in"; + my $log_nbytes = $1; + + my $log; + my $n_read = read PIPE, $log, $log_nbytes; + $n_read == $log_nbytes + or die "$ME:$.: unexpected EOF\n"; + + # Extract leading hash. + my ($sha, $rest) = split ':', $log, 2; + defined $sha + or die "$ME:$.: malformed log entry\n"; + $sha =~ /^[0-9a-fA-F]{40}$/ + or die "$ME:$.: invalid SHA1: $sha\n"; + + my $skipflag = 0; + if (@skipshas) + { + foreach(@skipshas) + { + if ($sha =~ /^$_/) + { + $skipflag = $_; + last; + } + } + } + + # If this commit's log requires any transformation, do it now. + my $code = $amend_code->{$sha}; + if (defined $code) + { + eval 'use Safe'; + my $s = new Safe; + # Put the unpreprocessed entry into "$_". + $_ = $rest; + + # Let $code operate on it, safely. + my $r = $s->reval("$code") + or die "$ME:$.:$sha: failed to eval \"$code\":\n$@\n"; + + # Note that we've used this entry. + delete $amend_code->{$sha}; + + # Update $rest upon success. + $rest = $_; + } + + # Remove lines inserted by "git cherry-pick". + if ($strip_cherry_pick) + { + $rest =~ s/^\s*Conflicts:\n.*//sm; + $rest =~ s/^\s*\(cherry picked from commit [\da-f]+\)\n//m; + } + + my @line = split /[ \t]*\n/, $rest; + my $author_line = shift @line; + defined $author_line + or die "$ME:$.: unexpected EOF\n"; + $author_line =~ /^(\d+) (.*>)$/ + or die "$ME:$.: Invalid line " + . "(expected date/author/email):\n$author_line\n"; + + # Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog + # `(tiny change)' annotation. + my $tiny = (grep (/^(?:Copyright-paperwork-exempt|Tiny-change):\s+[Yy]es$/, @line) + ? ' (tiny change)' : ''); + + my $date_line = sprintf "%s %s$tiny\n", + strftime ("%Y-%m-%d", localtime ($1)), $2; + + my @coauthors = grep /^Co-authored-by:.*$/, @line; + # Omit meta-data lines we've already interpreted. + @line = grep !/^(?:Signed-off-by:[ ].*>$ + |Co-authored-by:[ ] + |Copyright-paperwork-exempt:[ ] + |Tiny-change:[ ] + )/x, @line; + + # Remove leading and trailing blank lines. + if (@line) + { + while ($line[0] =~ /^\s*$/) { shift @line; } + while ($line[$#line] =~ /^\s*$/) { pop @line; } + } + + # Handle Emacs gitmerge.el "skipped" commits. + # Yes, this should be controlled by an option. So sue me. + if ( grep /^(; )?Merge from /, @line ) + { + my $found = 0; + foreach (@line) + { + if (grep /^The following commit.*skipped:$/, $_) + { + $found = 1; + ## Reset at each merge to reduce chance of false matches. + @skipshas = (); + next; + } + if ($found && $_ =~ /^([0-9a-fA-F]{7,}) [^ ]/) + { + push ( @skipshas, $1 ); + } + } + } + + # Ignore commits that match the --ignore-matching pattern, if specified. + if (defined $ignore_matching && @line && $line[0] =~ /$ignore_matching/) + { + $skipflag = 1; + } + elsif ($skipflag) + { + ## Perhaps only warn if a pattern matches more than once? + warn "$ME: warning: skipping $sha due to $skipflag\n"; + } + + if (! $skipflag) + { + if (defined $ignore_line && @line) + { + @line = grep ! /$ignore_line/, @line; + while ($line[$#line] =~ /^\s*$/) { pop @line; } + } + + # Record whether there are two or more paragraphs. + my $multi_paragraph = grep /^\s*$/, @line; + + # Format 'Co-authored-by: A U Thor <email@example.com>' lines in + # standard multi-author ChangeLog format. + for (@coauthors) + { + s/^Co-authored-by:\s*/\t /; + s/\s*</ </; + + /<.*?@.*\..*>/ + or warn "$ME: warning: missing email address for " + . substr ($_, 5) . "\n"; + } + + # If clustering of commit messages has been disabled, if this header + # would be different from the previous date/name/etc. header, + # or if this or the previous entry consists of two or more paragraphs, + # then print the header. + if ( ! $cluster + || $date_line ne $prev_date_line + || "@coauthors" ne "@prev_coauthors" + || $multi_paragraph + || $prev_multi_paragraph) + { + $prev_date_line eq '' + or print "\n"; + print $date_line; + @coauthors + and print join ("\n", @coauthors), "\n"; + } + $prev_date_line = $date_line; + @prev_coauthors = @coauthors; + $prev_multi_paragraph = $multi_paragraph; + + # If there were any lines + if (@line == 0) + { + warn "$ME: warning: empty commit message:\n $date_line\n"; + } + else + { + if ($append_dot) + { + # If the first line of the message has enough room, then + if (length $line[0] < 72) + { + # append a dot if there is no other punctuation or blank + # at the end. + $line[0] =~ /[[:punct:]\s]$/ + or $line[0] .= '.'; + } + } + + # Remove one additional leading TAB from each line. + $strip_tab + and map { s/^\t// } @line; + + # Prefix each non-empty line with a TAB. + @line = map { length $_ ? "\t$_" : '' } @line; + + print "\n", join ("\n", @line), "\n"; + } + } + + defined ($in = <PIPE>) + or last; + $in ne "\n" + and die "$ME:$.: unexpected line:\n$in"; + } + + close PIPE + or die "$ME: error closing pipe from " . quoted_cmd (@cmd) . "\n"; + # FIXME-someday: include $PROCESS_STATUS in the diagnostic + + # Complain about any unused entry in the --amend=F specified file. + my $fail = 0; + foreach my $sha (keys %$amend_code) + { + warn "$ME:$amend_file: unused entry: $sha\n"; + $fail = 1; + } + + exit $fail; +} + +# Local Variables: +# mode: perl +# indent-tabs-mode: nil +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "my $VERSION = '" +# time-stamp-format: "%:y-%02m-%02d %02H:%02M" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "'; # UTC" +# End: diff --git a/local/recipes/tools/diffutils/source/build-aux/gnu-web-doc-update b/local/recipes/tools/diffutils/source/build-aux/gnu-web-doc-update new file mode 100755 index 0000000000..a8ed60952d --- /dev/null +++ b/local/recipes/tools/diffutils/source/build-aux/gnu-web-doc-update @@ -0,0 +1,210 @@ +#!/bin/sh +# Run this after each non-alpha release, to update the web documentation at +# http://www.gnu.org/software/$pkg/manual/ + +VERSION=2016-01-12.23; # UTC + +# Copyright (C) 2009-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +ME=$(basename "$0") +warn() { printf '%s: %s\n' "$ME" "$*" >&2; } +die() { warn "$*"; exit 1; } + +help() +{ + cat <<EOF +Usage: $ME + +Run this script from top_srcdir (no arguments) after each non-alpha +release, to update the web documentation at +http://www.gnu.org/software/\$pkg/manual/ + +This script assumes you're using git for revision control, and +requires a .prev-version file as well as a Makefile, from which it +extracts the version number and package name, respectively. Also, it +assumes all documentation is in the doc/ sub-directory. + +Options: + -C, --builddir=DIR location of (configured) Makefile (default: .) + -n, --dry-run don't actually commit anything + -m, --mirror remove out of date files from document server + --help print this help, then exit + --version print version number, then exit + +Report bugs and patches to <bug-gnulib@gnu.org>. +EOF + exit +} + +version() +{ + year=$(echo "$VERSION" | sed 's/[^0-9].*//') + cat <<EOF +$ME $VERSION +Copyright (C) $year Free Software Foundation, Inc, +License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +EOF + exit +} + +# find_tool ENVVAR NAMES... +# ------------------------- +# Search for a required program. Use the value of ENVVAR, if set, +# otherwise find the first of the NAMES that can be run (i.e., +# supports --version). If found, set ENVVAR to the program name, +# die otherwise. +# +# FIXME: code duplication, see also bootstrap. +find_tool () +{ + find_tool_envvar=$1 + shift + find_tool_names=$@ + eval "find_tool_res=\$$find_tool_envvar" + if test x"$find_tool_res" = x; then + for i + do + if ($i --version </dev/null) >/dev/null 2>&1; then + find_tool_res=$i + break + fi + done + else + find_tool_error_prefix="\$$find_tool_envvar: " + fi + test x"$find_tool_res" != x \ + || die "one of these is required: $find_tool_names" + ($find_tool_res --version </dev/null) >/dev/null 2>&1 \ + || die "${find_tool_error_prefix}cannot run $find_tool_res --version" + eval "$find_tool_envvar=\$find_tool_res" + eval "export $find_tool_envvar" +} + +## ------ ## +## Main. ## +## ------ ## + +# Requirements: everything required to bootstrap your package, plus +# these. +find_tool CVS cvs +find_tool GIT git +find_tool RSYNC rsync +find_tool XARGS gxargs xargs + +builddir=. +dryrun= +rm_stale='echo' +while test $# != 0 +do + # Handle --option=value by splitting apart and putting back on argv. + case $1 in + --*=*) + opt=$(echo "$1" | sed -e 's/=.*//') + val=$(echo "$1" | sed -e 's/[^=]*=//') + shift + set dummy "$opt" "$val" "$@"; shift + ;; + esac + + case $1 in + --help|--version) ${1#--};; + -C|--builddir) shift; builddir=$1; shift ;; + -n|--dry-run) dryrun=echo; shift;; + -m|--mirror) rm_stale=''; shift;; + --*) die "unrecognized option: $1";; + *) break;; + esac +done + +test $# = 0 \ + || die "too many arguments" + +prev=.prev-version +version=$(cat $prev) || die "no $prev file?" +pkg=$(sed -n 's/^PACKAGE = \(.*\)/\1/p' $builddir/Makefile) \ + || die "no Makefile?" +tmp_branch=web-doc-$version-$$ +current_branch=$($GIT branch | sed -ne '/^\* /{s///;p;q;}') + +cleanup() +{ + __st=$? + $dryrun rm -rf "$tmp" + $GIT checkout "$current_branch" + $GIT submodule update --recursive + $GIT branch -d $tmp_branch + exit $__st +} +trap cleanup 0 +trap 'exit $?' 1 2 13 15 + +# We must build using sources for which --version reports the +# just-released version number, not some string like 7.6.18-20761. +# That version string propagates into all documentation. +set -e +$GIT checkout -b $tmp_branch v$version +$GIT submodule update --recursive +./bootstrap +srcdir=$(pwd) +cd "$builddir" +builddir=$(pwd) + ./config.status --recheck + ./config.status + make + make web-manual +cd "$srcdir" +set +e + +tmp=$(mktemp -d web-doc-update.XXXXXX) || exit 1 +( cd $tmp \ + && $CVS -d $USER@cvs.sv.gnu.org:/webcvs/$pkg co $pkg ) +$RSYNC -avP "$builddir"/doc/manual/ $tmp/$pkg/manual + +( + cd $tmp/$pkg/manual + + # Add all the files. This is simpler than trying to add only the + # new ones because of new directories + # First add non empty dirs individually + find . -name CVS -prune -o -type d \! -empty -print \ + | $XARGS -n1 --no-run-if-empty -- $dryrun $CVS add -ko + # Now add all files + find . -name CVS -prune -o -type f -print \ + | $XARGS --no-run-if-empty -- $dryrun $CVS add -ko + + # Report/Remove stale files + # excluding doc server specific files like CVS/* and .symlinks + if test -n "$rm_stale"; then + echo 'Consider the --mirror option if all of the manual is generated,' >&2 + echo 'which will run `cvs remove` to remove stale files.' >&2 + fi + { find . \( -name CVS -o -type f -name '.*' \) -prune -o -type f -print + (cd "$builddir"/doc/manual/ && find . -type f -print | sed p) + } | sort | uniq -u \ + | $XARGS --no-run-if-empty -- ${rm_stale:-$dryrun} $CVS remove -f + + $dryrun $CVS ci -m $version +) + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "VERSION=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/local/recipes/tools/diffutils/source/build-aux/gnupload b/local/recipes/tools/diffutils/source/build-aux/gnupload new file mode 100755 index 0000000000..d4d95ee9b7 --- /dev/null +++ b/local/recipes/tools/diffutils/source/build-aux/gnupload @@ -0,0 +1,440 @@ +#!/bin/sh +# Sign files and upload them. + +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 2004-2017 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Originally written by Alexandre Duret-Lutz <adl@gnu.org>. +# The master copy of this file is maintained in the gnulib Git repository. +# Please send bug reports and feature requests to bug-gnulib@gnu.org. + +set -e + +GPG='gpg --batch --no-tty' +conffile=.gnuploadrc +to= +dry_run=false +replace= +symlink_files= +delete_files= +delete_symlinks= +collect_var= +dbg= +nl=' +' + +usage="Usage: $0 [OPTION]... [CMD] FILE... [[CMD] FILE...] + +Sign all FILES, and process them at the destinations specified with --to. +If CMD is not given, it defaults to uploading. See examples below. + +Commands: + --delete delete FILES from destination + --symlink create symbolic links + --rmsymlink remove symbolic links + -- treat the remaining arguments as files to upload + +Options: + --to DEST specify a destination DEST for FILES + (multiple --to options are allowed) + --user NAME sign with key NAME + --replace allow replacements of existing files + --symlink-regex[=EXPR] use sed script EXPR to compute symbolic link names + --dry-run do nothing, show what would have been done + (including the constructed directive file) + --version output version information and exit + --help print this help text and exit + +If --symlink-regex is given without EXPR, then the link target name +is created by replacing the version information with '-latest', e.g.: + foo-1.3.4.tar.gz -> foo-latest.tar.gz + +Recognized destinations are: + alpha.gnu.org:DIRECTORY + savannah.gnu.org:DIRECTORY + savannah.nongnu.org:DIRECTORY + ftp.gnu.org:DIRECTORY + build directive files and upload files by FTP + download.gnu.org.ua:{alpha|ftp}/DIRECTORY + build directive files and upload files by SFTP + [user@]host:DIRECTORY upload files with scp + +Options and commands are applied in order. If the file $conffile exists +in the current working directory, its contents are prepended to the +actual command line options. Use this to keep your defaults. Comments +(#) and empty lines in $conffile are allowed. + +<http://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html> +gives some further background. + +Examples: +1. Upload foobar-1.0.tar.gz to ftp.gnu.org: + gnupload --to ftp.gnu.org:foobar foobar-1.0.tar.gz + +2. Upload foobar-1.0.tar.gz and foobar-1.0.tar.xz to ftp.gnu.org: + gnupload --to ftp.gnu.org:foobar foobar-1.0.tar.gz foobar-1.0.tar.xz + +3. Same as above, and also create symbolic links to foobar-latest.tar.*: + gnupload --to ftp.gnu.org:foobar \\ + --symlink-regex \\ + foobar-1.0.tar.gz foobar-1.0.tar.xz + +4. Upload foobar-0.9.90.tar.gz to two sites: + gnupload --to alpha.gnu.org:foobar \\ + --to sources.redhat.com:~ftp/pub/foobar \\ + foobar-0.9.90.tar.gz + +5. Delete oopsbar-0.9.91.tar.gz and upload foobar-0.9.91.tar.gz + (the -- terminates the list of files to delete): + gnupload --to alpha.gnu.org:foobar \\ + --to sources.redhat.com:~ftp/pub/foobar \\ + --delete oopsbar-0.9.91.tar.gz \\ + -- foobar-0.9.91.tar.gz + +gnupload executes a program ncftpput to do the transfers; if you don't +happen to have an ncftp package installed, the ncftpput-ftp script in +the build-aux/ directory of the gnulib package +(http://savannah.gnu.org/projects/gnulib) may serve as a replacement. + +Send patches and bug reports to <bug-gnulib@gnu.org>." + +# Read local configuration file +if test -r "$conffile"; then + echo "$0: Reading configuration file $conffile" + conf=`sed 's/#.*$//;/^$/d' "$conffile" | tr "\015$nl" ' '` + eval set x "$conf \"\$@\"" + shift +fi + +while test -n "$1"; do + case $1 in + -*) + collect_var= + case $1 in + --help) + echo "$usage" + exit $? + ;; + --to) + if test -z "$2"; then + echo "$0: Missing argument for --to" 1>&2 + exit 1 + elif echo "$2" | grep 'ftp-upload\.gnu\.org' >/dev/null; then + echo "$0: Use ftp.gnu.org:PKGNAME or alpha.gnu.org:PKGNAME" >&2 + echo "$0: for the destination, not ftp-upload.gnu.org (which" >&2 + echo "$0: is used for direct ftp uploads, not with gnupload)." >&2 + echo "$0: See --help and its examples if need be." >&2 + exit 1 + else + to="$to $2" + shift + fi + ;; + --user) + if test -z "$2"; then + echo "$0: Missing argument for --user" 1>&2 + exit 1 + else + GPG="$GPG --local-user $2" + shift + fi + ;; + --delete) + collect_var=delete_files + ;; + --replace) + replace="replace: true" + ;; + --rmsymlink) + collect_var=delete_symlinks + ;; + --symlink-regex=*) + symlink_expr=`expr "$1" : '[^=]*=\(.*\)'` + ;; + --symlink-regex) + symlink_expr='s|-[0-9][0-9\.]*\(-[0-9][0-9]*\)\{0,1\}\.|-latest.|' + ;; + --symlink) + collect_var=symlink_files + ;; + --dry-run|-n) + dry_run=: + ;; + --version) + echo "gnupload $scriptversion" + exit $? + ;; + --) + shift + break + ;; + -*) + echo "$0: Unknown option '$1', try '$0 --help'" 1>&2 + exit 1 + ;; + esac + ;; + *) + if test -z "$collect_var"; then + break + else + eval "$collect_var=\"\$$collect_var $1\"" + fi + ;; + esac + shift +done + +dprint() +{ + echo "Running $* ..." +} + +if $dry_run; then + dbg=dprint +fi + +if test -z "$to"; then + echo "$0: Missing destination sites" >&2 + exit 1 +fi + +if test -n "$symlink_files"; then + x=`echo "$symlink_files" | sed 's/[^ ]//g;s/ //g'` + if test -n "$x"; then + echo "$0: Odd number of symlink arguments" >&2 + exit 1 + fi +fi + +if test $# = 0; then + if test -z "${symlink_files}${delete_files}${delete_symlinks}"; then + echo "$0: No file to upload" 1>&2 + exit 1 + fi +else + # Make sure all files exist. We don't want to ask + # for the passphrase if the script will fail. + for file + do + if test ! -f $file; then + echo "$0: Cannot find '$file'" 1>&2 + exit 1 + elif test -n "$symlink_expr"; then + linkname=`echo $file | sed "$symlink_expr"` + if test -z "$linkname"; then + echo "$0: symlink expression produces empty results" >&2 + exit 1 + elif test "$linkname" = $file; then + echo "$0: symlink expression does not alter file name" >&2 + exit 1 + fi + fi + done +fi + +# Make sure passphrase is not exported in the environment. +unset passphrase +unset passphrase_fd_0 +GNUPGHOME=${GNUPGHOME:-$HOME/.gnupg} + +# Reset PATH to be sure that echo is a built-in. We will later use +# 'echo $passphrase' to output the passphrase, so it is important that +# it is a built-in (third-party programs tend to appear in 'ps' +# listings with their arguments...). +# Remember this script runs with 'set -e', so if echo is not built-in +# it will exit now. +if $dry_run || grep -q "^use-agent" $GNUPGHOME/gpg.conf; then :; else + PATH=/empty echo -n "Enter GPG passphrase: " + stty -echo + read -r passphrase + stty echo + echo + passphrase_fd_0="--passphrase-fd 0" +fi + +if test $# -ne 0; then + for file + do + echo "Signing $file ..." + rm -f $file.sig + echo "$passphrase" | $dbg $GPG $passphrase_fd_0 -ba -o $file.sig $file + done +fi + + +# mkdirective DESTDIR BASE FILE STMT +# Arguments: See upload, below +mkdirective () +{ + stmt="$4" + if test -n "$3"; then + stmt=" +filename: $3$stmt" + fi + + cat >${2}.directive<<EOF +version: 1.2 +directory: $1 +comment: gnupload v. $scriptversion$stmt +EOF + if $dry_run; then + echo "File ${2}.directive:" + cat ${2}.directive + echo "File ${2}.directive:" | sed 's/./-/g' + fi +} + +mksymlink () +{ + while test $# -ne 0 + do + echo "symlink: $1 $2" + shift + shift + done +} + +# upload DEST DESTDIR BASE FILE STMT FILES +# Arguments: +# DEST Destination site; +# DESTDIR Destination directory; +# BASE Base name for the directive file; +# FILE Name of the file to distribute (may be empty); +# STMT Additional statements for the directive file; +# FILES List of files to upload. +upload () +{ + dest=$1 + destdir=$2 + base=$3 + file=$4 + stmt=$5 + files=$6 + + rm -f $base.directive $base.directive.asc + case $dest in + alpha.gnu.org:*) + mkdirective "$destdir" "$base" "$file" "$stmt" + echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive + $dbg ncftpput ftp-upload.gnu.org /incoming/alpha $files $base.directive.asc + ;; + ftp.gnu.org:*) + mkdirective "$destdir" "$base" "$file" "$stmt" + echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive + $dbg ncftpput ftp-upload.gnu.org /incoming/ftp $files $base.directive.asc + ;; + savannah.gnu.org:*) + if test -z "$files"; then + echo "$0: warning: standalone directives not applicable for $dest" >&2 + fi + $dbg ncftpput savannah.gnu.org /incoming/savannah/$destdir $files + ;; + savannah.nongnu.org:*) + if test -z "$files"; then + echo "$0: warning: standalone directives not applicable for $dest" >&2 + fi + $dbg ncftpput savannah.nongnu.org /incoming/savannah/$destdir $files + ;; + download.gnu.org.ua:alpha/*|download.gnu.org.ua:ftp/*) + destdir_p1=`echo "$destdir" | sed 's,^[^/]*/,,'` + destdir_topdir=`echo "$destdir" | sed 's,/.*,,'` + mkdirective "$destdir_p1" "$base" "$file" "$stmt" + echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive + for f in $files $base.directive.asc + do + echo put $f + done | $dbg sftp -b - puszcza.gnu.org.ua:/incoming/$destdir_topdir + ;; + /*) + dest_host=`echo "$dest" | sed 's,:.*,,'` + mkdirective "$destdir" "$base" "$file" "$stmt" + echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive + $dbg cp $files $base.directive.asc $dest_host + ;; + *) + if test -z "$files"; then + echo "$0: warning: standalone directives not applicable for $dest" >&2 + fi + $dbg scp $files $dest + ;; + esac + rm -f $base.directive $base.directive.asc +} + +##### +# Process any standalone directives +stmt= +if test -n "$symlink_files"; then + stmt="$stmt +`mksymlink $symlink_files`" +fi + +for file in $delete_files +do + stmt="$stmt +archive: $file" +done + +for file in $delete_symlinks +do + stmt="$stmt +rmsymlink: $file" +done + +if test -n "$stmt"; then + for dest in $to + do + destdir=`echo $dest | sed 's/[^:]*://'` + upload "$dest" "$destdir" "`hostname`-$$" "" "$stmt" + done +fi + +# Process actual uploads +for dest in $to +do + for file + do + echo "Uploading $file to $dest ..." + stmt= + # + # allowing file replacement is all or nothing. + if test -n "$replace"; then stmt="$stmt +$replace" + fi + # + files="$file $file.sig" + destdir=`echo $dest | sed 's/[^:]*://'` + if test -n "$symlink_expr"; then + linkname=`echo $file | sed "$symlink_expr"` + stmt="$stmt +symlink: $file $linkname +symlink: $file.sig $linkname.sig" + fi + upload "$dest" "$destdir" "$file" "$file" "$stmt" "$files" + done +done + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/local/recipes/tools/diffutils/source/build-aux/install-sh b/local/recipes/tools/diffutils/source/build-aux/install-sh new file mode 100755 index 0000000000..0360b79e7d --- /dev/null +++ b/local/recipes/tools/diffutils/source/build-aux/install-sh @@ -0,0 +1,501 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2016-01-11.22; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + +doit=${DOITPROG-} +doit_exec=${doit:-exec} + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +is_target_a_directory=possibly + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/local/recipes/tools/diffutils/source/build-aux/mdate-sh b/local/recipes/tools/diffutils/source/build-aux/mdate-sh new file mode 100755 index 0000000000..f80075c049 --- /dev/null +++ b/local/recipes/tools/diffutils/source/build-aux/mdate-sh @@ -0,0 +1,224 @@ +#!/bin/sh +# Get modification time of a file or directory and pretty-print it. + +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 1995-2017 Free Software Foundation, Inc. +# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +fi + +case $1 in + '') + echo "$0: No file. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: mdate-sh [--help] [--version] FILE + +Pretty-print the modification day of FILE, in the format: +1 January 1970 + +Report bugs to <bug-automake@gnu.org>. +EOF + exit $? + ;; + -v | --v*) + echo "mdate-sh $scriptversion" + exit $? + ;; +esac + +error () +{ + echo "$0: $1" >&2 + exit 1 +} + + +# Prevent date giving response in another language. +LANG=C +export LANG +LC_ALL=C +export LC_ALL +LC_TIME=C +export LC_TIME + +# GNU ls changes its time format in response to the TIME_STYLE +# variable. Since we cannot assume 'unset' works, revert this +# variable to its documented default. +if test "${TIME_STYLE+set}" = set; then + TIME_STYLE=posix-long-iso + export TIME_STYLE +fi + +save_arg1=$1 + +# Find out how to get the extended ls output of a file or directory. +if ls -L /dev/null 1>/dev/null 2>&1; then + ls_command='ls -L -l -d' +else + ls_command='ls -l -d' +fi +# Avoid user/group names that might have spaces, when possible. +if ls -n /dev/null 1>/dev/null 2>&1; then + ls_command="$ls_command -n" +fi + +# A 'ls -l' line looks as follows on OS/2. +# drwxrwx--- 0 Aug 11 2001 foo +# This differs from Unix, which adds ownership information. +# drwxrwx--- 2 root root 4096 Aug 11 2001 foo +# +# To find the date, we split the line on spaces and iterate on words +# until we find a month. This cannot work with files whose owner is a +# user named "Jan", or "Feb", etc. However, it's unlikely that '/' +# will be owned by a user whose name is a month. So we first look at +# the extended ls output of the root directory to decide how many +# words should be skipped to get the date. + +# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. +set x`$ls_command /` + +# Find which argument is the month. +month= +command= +until test $month +do + test $# -gt 0 || error "failed parsing '$ls_command /' output" + shift + # Add another shift to the command. + command="$command shift;" + case $1 in + Jan) month=January; nummonth=1;; + Feb) month=February; nummonth=2;; + Mar) month=March; nummonth=3;; + Apr) month=April; nummonth=4;; + May) month=May; nummonth=5;; + Jun) month=June; nummonth=6;; + Jul) month=July; nummonth=7;; + Aug) month=August; nummonth=8;; + Sep) month=September; nummonth=9;; + Oct) month=October; nummonth=10;; + Nov) month=November; nummonth=11;; + Dec) month=December; nummonth=12;; + esac +done + +test -n "$month" || error "failed parsing '$ls_command /' output" + +# Get the extended ls output of the file or directory. +set dummy x`eval "$ls_command \"\\\$save_arg1\""` + +# Remove all preceding arguments +eval $command + +# Because of the dummy argument above, month is in $2. +# +# On a POSIX system, we should have +# +# $# = 5 +# $1 = file size +# $2 = month +# $3 = day +# $4 = year or time +# $5 = filename +# +# On Darwin 7.7.0 and 7.6.0, we have +# +# $# = 4 +# $1 = day +# $2 = month +# $3 = year or time +# $4 = filename + +# Get the month. +case $2 in + Jan) month=January; nummonth=1;; + Feb) month=February; nummonth=2;; + Mar) month=March; nummonth=3;; + Apr) month=April; nummonth=4;; + May) month=May; nummonth=5;; + Jun) month=June; nummonth=6;; + Jul) month=July; nummonth=7;; + Aug) month=August; nummonth=8;; + Sep) month=September; nummonth=9;; + Oct) month=October; nummonth=10;; + Nov) month=November; nummonth=11;; + Dec) month=December; nummonth=12;; +esac + +case $3 in + ???*) day=$1;; + *) day=$3; shift;; +esac + +# Here we have to deal with the problem that the ls output gives either +# the time of day or the year. +case $3 in + *:*) set `date`; eval year=\$$# + case $2 in + Jan) nummonthtod=1;; + Feb) nummonthtod=2;; + Mar) nummonthtod=3;; + Apr) nummonthtod=4;; + May) nummonthtod=5;; + Jun) nummonthtod=6;; + Jul) nummonthtod=7;; + Aug) nummonthtod=8;; + Sep) nummonthtod=9;; + Oct) nummonthtod=10;; + Nov) nummonthtod=11;; + Dec) nummonthtod=12;; + esac + # For the first six month of the year the time notation can also + # be used for files modified in the last year. + if (expr $nummonth \> $nummonthtod) > /dev/null; + then + year=`expr $year - 1` + fi;; + *) year=$3;; +esac + +# The result. +echo $day $month $year + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/local/recipes/tools/diffutils/source/build-aux/missing b/local/recipes/tools/diffutils/source/build-aux/missing new file mode 100755 index 0000000000..594918c781 --- /dev/null +++ b/local/recipes/tools/diffutils/source/build-aux/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to <bug-automake@gnu.org>." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/local/recipes/tools/diffutils/source/build-aux/test-driver b/local/recipes/tools/diffutils/source/build-aux/test-driver new file mode 100755 index 0000000000..d7eac829e6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/build-aux/test-driver @@ -0,0 +1,148 @@ +#! /bin/sh +# test-driver - basic testsuite driver script. + +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 2011-2015 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +# Make unconditional expansion of undefined variables an error. This +# helps a lot in preventing typo-related bugs. +set -u + +usage_error () +{ + echo "$0: $*" >&2 + print_usage >&2 + exit 2 +} + +print_usage () +{ + cat <<END +Usage: + test-driver --test-name=NAME --log-file=PATH --trs-file=PATH + [--expect-failure={yes|no}] [--color-tests={yes|no}] + [--enable-hard-errors={yes|no}] [--] + TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS] +The '--test-name', '--log-file' and '--trs-file' options are mandatory. +END +} + +test_name= # Used for reporting. +log_file= # Where to save the output of the test script. +trs_file= # Where to save the metadata of the test run. +expect_failure=no +color_tests=no +enable_hard_errors=yes +while test $# -gt 0; do + case $1 in + --help) print_usage; exit $?;; + --version) echo "test-driver $scriptversion"; exit $?;; + --test-name) test_name=$2; shift;; + --log-file) log_file=$2; shift;; + --trs-file) trs_file=$2; shift;; + --color-tests) color_tests=$2; shift;; + --expect-failure) expect_failure=$2; shift;; + --enable-hard-errors) enable_hard_errors=$2; shift;; + --) shift; break;; + -*) usage_error "invalid option: '$1'";; + *) break;; + esac + shift +done + +missing_opts= +test x"$test_name" = x && missing_opts="$missing_opts --test-name" +test x"$log_file" = x && missing_opts="$missing_opts --log-file" +test x"$trs_file" = x && missing_opts="$missing_opts --trs-file" +if test x"$missing_opts" != x; then + usage_error "the following mandatory options are missing:$missing_opts" +fi + +if test $# -eq 0; then + usage_error "missing argument" +fi + +if test $color_tests = yes; then + # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'. + red='' # Red. + grn='' # Green. + lgn='' # Light green. + blu='' # Blue. + mgn='' # Magenta. + std='' # No color. +else + red= grn= lgn= blu= mgn= std= +fi + +do_exit='rm -f $log_file $trs_file; (exit $st); exit $st' +trap "st=129; $do_exit" 1 +trap "st=130; $do_exit" 2 +trap "st=141; $do_exit" 13 +trap "st=143; $do_exit" 15 + +# Test script is run here. +"$@" >$log_file 2>&1 +estatus=$? + +if test $enable_hard_errors = no && test $estatus -eq 99; then + tweaked_estatus=1 +else + tweaked_estatus=$estatus +fi + +case $tweaked_estatus:$expect_failure in + 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; + 0:*) col=$grn res=PASS recheck=no gcopy=no;; + 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; + 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; + *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; + *:*) col=$red res=FAIL recheck=yes gcopy=yes;; +esac + +# Report the test outcome and exit status in the logs, so that one can +# know whether the test passed or failed simply by looking at the '.log' +# file, without the need of also peaking into the corresponding '.trs' +# file (automake bug#11814). +echo "$res $test_name (exit status: $estatus)" >>$log_file + +# Report outcome to console. +echo "${col}${res}${std}: $test_name" + +# Register the test result, and other relevant metadata. +echo ":test-result: $res" > $trs_file +echo ":global-test-result: $res" >> $trs_file +echo ":recheck: $recheck" >> $trs_file +echo ":copy-in-global-log: $gcopy" >> $trs_file + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/local/recipes/tools/diffutils/source/build-aux/texinfo.tex b/local/recipes/tools/diffutils/source/build-aux/texinfo.tex new file mode 100644 index 0000000000..8204f3e3ae --- /dev/null +++ b/local/recipes/tools/diffutils/source/build-aux/texinfo.tex @@ -0,0 +1,11681 @@ +% texinfo.tex -- TeX macros to handle Texinfo files. +% +% Load plain if necessary, i.e., if running under initex. +\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi +% +\def\texinfoversion{2017-05-14.14} +% +% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, +% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, +% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 +% Free Software Foundation, Inc. +% +% This texinfo.tex file is free software: you can redistribute it and/or +% modify it under the terms of the GNU General Public License as +% published by the Free Software Foundation, either version 3 of the +% License, or (at your option) any later version. +% +% This texinfo.tex file is distributed in the hope that it will be +% useful, but WITHOUT ANY WARRANTY; without even the implied warranty +% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% As a special exception, when this file is read by TeX when processing +% a Texinfo source document, you may use the result without +% restriction. This Exception is an additional permission under section 7 +% of the GNU General Public License, version 3 ("GPLv3"). +% +% Please try the latest version of texinfo.tex before submitting bug +% reports; you can get the latest version from: +% http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or +% http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or +% http://www.gnu.org/software/texinfo/ (the Texinfo home page) +% The texinfo.tex in any given distribution could well be out +% of date, so if that's what you're using, please check. +% +% Send bug reports to bug-texinfo@gnu.org. Please include including a +% complete document in each bug report with which we can reproduce the +% problem. Patches are, of course, greatly appreciated. +% +% To process a Texinfo manual with TeX, it's most reliable to use the +% texi2dvi shell script that comes with the distribution. For a simple +% manual foo.texi, however, you can get away with this: +% tex foo.texi +% texindex foo.?? +% tex foo.texi +% tex foo.texi +% dvips foo.dvi -o # or whatever; this makes foo.ps. +% The extra TeX runs get the cross-reference information correct. +% Sometimes one run after texindex suffices, and sometimes you need more +% than two; texi2dvi does it as many times as necessary. +% +% It is possible to adapt texinfo.tex for other languages, to some +% extent. You can get the existing language-specific files from the +% full Texinfo distribution. +% +% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. + + +\message{Loading texinfo [version \texinfoversion]:} + +% If in a .fmt file, print the version number +% and turn on active characters that we couldn't do earlier because +% they might have appeared in the input file name. +\everyjob{\message{[Texinfo version \texinfoversion]}% + \catcode`+=\active \catcode`\_=\active} + +% LaTeX's \typeout. This ensures that the messages it is used for +% are identical in format to the corresponding ones from latex/pdflatex. +\def\typeout{\immediate\write17}% + +\chardef\other=12 + +% We never want plain's \outer definition of \+ in Texinfo. +% For @tex, we can use \tabalign. +\let\+ = \relax + +% Save some plain tex macros whose names we will redefine. +\let\ptexb=\b +\let\ptexbullet=\bullet +\let\ptexc=\c +\let\ptexcomma=\, +\let\ptexdot=\. +\let\ptexdots=\dots +\let\ptexend=\end +\let\ptexequiv=\equiv +\let\ptexexclam=\! +\let\ptexfootnote=\footnote +\let\ptexgtr=> +\let\ptexhat=^ +\let\ptexi=\i +\let\ptexindent=\indent +\let\ptexinsert=\insert +\let\ptexlbrace=\{ +\let\ptexless=< +\let\ptexnewwrite\newwrite +\let\ptexnoindent=\noindent +\let\ptexplus=+ +\let\ptexraggedright=\raggedright +\let\ptexrbrace=\} +\let\ptexslash=\/ +\let\ptexsp=\sp +\let\ptexstar=\* +\let\ptexsup=\sup +\let\ptext=\t +\let\ptextop=\top +{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode + +% If this character appears in an error message or help string, it +% starts a new line in the output. +\newlinechar = `^^J + +% Use TeX 3.0's \inputlineno to get the line number, for better error +% messages, but if we're using an old version of TeX, don't do anything. +% +\ifx\inputlineno\thisisundefined + \let\linenumber = \empty % Pre-3.0. +\else + \def\linenumber{l.\the\inputlineno:\space} +\fi + +% Set up fixed words for English if not already set. +\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi +\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi +\ifx\putworderror\undefined \gdef\putworderror{error}\fi +\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi +\ifx\putwordin\undefined \gdef\putwordin{in}\fi +\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi +\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi +\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi +\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi +\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi +\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi +\ifx\putwordof\undefined \gdef\putwordof{of}\fi +\ifx\putwordon\undefined \gdef\putwordon{on}\fi +\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi +\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi +\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi +\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi +\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi +\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi +\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi +% +\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi +\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi +\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi +\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi +\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi +\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi +\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi +\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi +\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi +\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi +\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi +\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi +% +\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi +\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi +\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi +\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi +\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi + +% Give the space character the catcode for a space. +\def\spaceisspace{\catcode`\ =10\relax} + +% Likewise for ^^M, the end of line character. +\def\endlineisspace{\catcode13=10\relax} + +\chardef\dashChar = `\- +\chardef\slashChar = `\/ +\chardef\underChar = `\_ + +% Ignore a token. +% +\def\gobble#1{} + +% The following is used inside several \edef's. +\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} + +% Hyphenation fixes. +\hyphenation{ + Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script + ap-pen-dix bit-map bit-maps + data-base data-bases eshell fall-ing half-way long-est man-u-script + man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm + par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces + spell-ing spell-ings + stand-alone strong-est time-stamp time-stamps which-ever white-space + wide-spread wrap-around +} + +% Sometimes it is convenient to have everything in the transcript file +% and nothing on the terminal. We don't just call \tracingall here, +% since that produces some useless output on the terminal. We also make +% some effort to order the tracing commands to reduce output in the log +% file; cf. trace.sty in LaTeX. +% +\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% +\def\loggingall{% + \tracingstats2 + \tracingpages1 + \tracinglostchars2 % 2 gives us more in etex + \tracingparagraphs1 + \tracingoutput1 + \tracingmacros2 + \tracingrestores1 + \showboxbreadth\maxdimen \showboxdepth\maxdimen + \ifx\eTeXversion\thisisundefined\else % etex gives us more logging + \tracingscantokens1 + \tracingifs1 + \tracinggroups1 + \tracingnesting2 + \tracingassigns1 + \fi + \tracingcommands3 % 3 gives us more in etex + \errorcontextlines16 +}% + +% @errormsg{MSG}. Do the index-like expansions on MSG, but if things +% aren't perfect, it's not the end of the world, being an error message, +% after all. +% +\def\errormsg{\begingroup \indexnofonts \doerrormsg} +\def\doerrormsg#1{\errmessage{#1}} + +% add check for \lastpenalty to plain's definitions. If the last thing +% we did was a \nobreak, we don't want to insert more space. +% +\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount + \removelastskip\penalty-50\smallskip\fi\fi} +\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount + \removelastskip\penalty-100\medskip\fi\fi} +\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount + \removelastskip\penalty-200\bigskip\fi\fi} + +% Output routine +% + +% For a final copy, take out the rectangles +% that mark overfull boxes (in case you have decided +% that the text looks ok even though it passes the margin). +% +\def\finalout{\overfullrule=0pt } + +% Do @cropmarks to get crop marks. +% +\newif\ifcropmarks +\let\cropmarks = \cropmarkstrue +% +% Dimensions to add cropmarks at corners. +% Added by P. A. MacKay, 12 Nov. 1986 +% +\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines +\newdimen\cornerlong \cornerlong=1pc +\newdimen\cornerthick \cornerthick=.3pt +\newdimen\topandbottommargin \topandbottommargin=.75in + +% Output a mark which sets \thischapter, \thissection and \thiscolor. +% We dump everything together because we only have one kind of mark. +% This works because we only use \botmark / \topmark, not \firstmark. +% +% A mark contains a subexpression of the \ifcase ... \fi construct. +% \get*marks macros below extract the needed part using \ifcase. +% +% Another complication is to let the user choose whether \thischapter +% (\thissection) refers to the chapter (section) in effect at the top +% of a page, or that at the bottom of a page. + +% \domark is called twice inside \chapmacro, to add one +% mark before the section break, and one after. +% In the second call \prevchapterdefs is the same as \lastchapterdefs, +% and \prevsectiondefs is the same as \lastsectiondefs. +% Then if the page is not broken at the mark, some of the previous +% section appears on the page, and we can get the name of this section +% from \firstmark for @everyheadingmarks top. +% @everyheadingmarks bottom uses \botmark. +% +% See page 260 of The TeXbook. +\def\domark{% + \toks0=\expandafter{\lastchapterdefs}% + \toks2=\expandafter{\lastsectiondefs}% + \toks4=\expandafter{\prevchapterdefs}% + \toks6=\expandafter{\prevsectiondefs}% + \toks8=\expandafter{\lastcolordefs}% + \mark{% + \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top + \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom + \noexpand\else \the\toks8 % 2: color marks + }% +} + +% \gettopheadingmarks, \getbottomheadingmarks, +% \getcolormarks - extract needed part of mark. +% +% \topmark doesn't work for the very first chapter (after the title +% page or the contents), so we use \firstmark there -- this gets us +% the mark with the chapter defs, unless the user sneaks in, e.g., +% @setcolor (or @url, or @link, etc.) between @contents and the very +% first @chapter. +\def\gettopheadingmarks{% + \ifcase0\topmark\fi + \ifx\thischapter\empty \ifcase0\firstmark\fi \fi +} +\def\getbottomheadingmarks{\ifcase1\botmark\fi} +\def\getcolormarks{\ifcase2\topmark\fi} + +% Avoid "undefined control sequence" errors. +\def\lastchapterdefs{} +\def\lastsectiondefs{} +\def\lastsection{} +\def\prevchapterdefs{} +\def\prevsectiondefs{} +\def\lastcolordefs{} + +% Margin to add to right of even pages, to left of odd pages. +\newdimen\bindingoffset +\newdimen\normaloffset +\newdimen\txipagewidth \newdimen\txipageheight + +% Main output routine. +% +\chardef\PAGE = 255 +\output = {\onepageout{\pagecontents\PAGE}} + +\newbox\headlinebox +\newbox\footlinebox + +% \onepageout takes a vbox as an argument. +% \shipout a vbox for a single page, adding an optional header, footer, +% cropmarks, and footnote. This also causes index entries for this page +% to be written to the auxiliary files. +% +\def\onepageout#1{% + \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi + % + \ifodd\pageno \advance\hoffset by \bindingoffset + \else \advance\hoffset by -\bindingoffset\fi + % + % Common context changes for both heading and footing. + % Do this outside of the \shipout so @code etc. will be expanded in + % the headline as they should be, not taken literally (outputting ''code). + \def\commmonheadfootline{\let\hsize=\txipagewidth \texinfochars} + % + % Retrieve the information for the headings from the marks in the page, + % and call Plain TeX's \makeheadline and \makefootline, which use the + % values in \headline and \footline. + % + % This is used to check if we are on the first page of a chapter. + \ifcase1\topmark\fi + \let\prevchaptername\thischaptername + \ifcase0\firstmark\fi + \let\curchaptername\thischaptername + % + \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi + \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi + % + \ifx\curchaptername\prevchaptername + \let\thischapterheading\thischapter + \else + % \thischapterheading is the same as \thischapter except it is blank + % for the first page of a chapter. This is to prevent the chapter name + % being shown twice. + \def\thischapterheading{}% + \fi + % + \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}% + \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}% + % + {% + % Set context for writing to auxiliary files like index files. + % Have to do this stuff outside the \shipout because we want it to + % take effect in \write's, yet the group defined by the \vbox ends + % before the \shipout runs. + % + \indexdummies % don't expand commands in the output. + \normalturnoffactive % \ in index entries must not stay \, e.g., if + % the page break happens to be in the middle of an example. + % We don't want .vr (or whatever) entries like this: + % \entry{{\indexbackslash }acronym}{32}{\code {\acronym}} + % "\acronym" won't work when it's read back in; + % it needs to be + % {\code {{\backslashcurfont }acronym} + \shipout\vbox{% + % Do this early so pdf references go to the beginning of the page. + \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi + % + \ifcropmarks \vbox to \outervsize\bgroup + \hsize = \outerhsize + \vskip-\topandbottommargin + \vtop to0pt{% + \line{\ewtop\hfil\ewtop}% + \nointerlineskip + \line{% + \vbox{\moveleft\cornerthick\nstop}% + \hfill + \vbox{\moveright\cornerthick\nstop}% + }% + \vss}% + \vskip\topandbottommargin + \line\bgroup + \hfil % center the page within the outer (page) hsize. + \ifodd\pageno\hskip\bindingoffset\fi + \vbox\bgroup + \fi + % + \unvbox\headlinebox + \pagebody{#1}% + \ifdim\ht\footlinebox > 0pt + % Only leave this space if the footline is nonempty. + % (We lessened \vsize for it in \oddfootingyyy.) + % The \baselineskip=24pt in plain's \makefootline has no effect. + \vskip 24pt + \unvbox\footlinebox + \fi + % + \ifcropmarks + \egroup % end of \vbox\bgroup + \hfil\egroup % end of (centering) \line\bgroup + \vskip\topandbottommargin plus1fill minus1fill + \boxmaxdepth = \cornerthick + \vbox to0pt{\vss + \line{% + \vbox{\moveleft\cornerthick\nsbot}% + \hfill + \vbox{\moveright\cornerthick\nsbot}% + }% + \nointerlineskip + \line{\ewbot\hfil\ewbot}% + }% + \egroup % \vbox from first cropmarks clause + \fi + }% end of \shipout\vbox + }% end of group with \indexdummies + \advancepageno + \ifnum\outputpenalty>-20000 \else\dosupereject\fi +} + +\newinsert\margin \dimen\margin=\maxdimen + +% Main part of page, including any footnotes +\def\pagebody#1{\vbox to\txipageheight{\boxmaxdepth=\maxdepth #1}} +{\catcode`\@ =11 +\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi +% marginal hacks, juha@viisa.uucp (Juha Takala) +\ifvoid\margin\else % marginal info is present + \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi +\dimen@=\dp#1\relax \unvbox#1\relax +\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi +\ifr@ggedbottom \kern-\dimen@ \vfil \fi} +} + +% Here are the rules for the cropmarks. Note that they are +% offset so that the space between them is truly \outerhsize or \outervsize +% (P. A. MacKay, 12 November, 1986) +% +\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} +\def\nstop{\vbox + {\hrule height\cornerthick depth\cornerlong width\cornerthick}} +\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} +\def\nsbot{\vbox + {\hrule height\cornerlong depth\cornerthick width\cornerthick}} + + +% Argument parsing + +% Parse an argument, then pass it to #1. The argument is the rest of +% the input line (except we remove a trailing comment). #1 should be a +% macro which expects an ordinary undelimited TeX argument. +% For example, \def\foo{\parsearg\fooxxx}. +% +\def\parsearg{\parseargusing{}} +\def\parseargusing#1#2{% + \def\argtorun{#2}% + \begingroup + \obeylines + \spaceisspace + #1% + \parseargline\empty% Insert the \empty token, see \finishparsearg below. +} + +{\obeylines % + \gdef\parseargline#1^^M{% + \endgroup % End of the group started in \parsearg. + \argremovecomment #1\comment\ArgTerm% + }% +} + +% First remove any @comment, then any @c comment. Also remove a @texinfoc +% comment (see \scanmacro for details). Pass the result on to \argcheckspaces. +\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} +\def\argremovec#1\c#2\ArgTerm{\argremovetexinfoc #1\texinfoc\ArgTerm} +\def\argremovetexinfoc#1\texinfoc#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} + +% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space. +% +% \argremovec might leave us with trailing space, e.g., +% @end itemize @c foo +% This space token undergoes the same procedure and is eventually removed +% by \finishparsearg. +% +\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} +\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} +\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% + \def\temp{#3}% + \ifx\temp\empty + % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: + \let\temp\finishparsearg + \else + \let\temp\argcheckspaces + \fi + % Put the space token in: + \temp#1 #3\ArgTerm +} + +% If a _delimited_ argument is enclosed in braces, they get stripped; so +% to get _exactly_ the rest of the line, we had to prevent such situation. +% We prepended an \empty token at the very beginning and we expand it now, +% just before passing the control to \argtorun. +% (Similarly, we have to think about #3 of \argcheckspacesY above: it is +% either the null string, or it ends with \^^M---thus there is no danger +% that a pair of braces would be stripped. +% +% But first, we have to remove the trailing space token. +% +\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} + + +% \parseargdef - define a command taking an argument on the line +% +% \parseargdef\foo{...} +% is roughly equivalent to +% \def\foo{\parsearg\Xfoo} +% \def\Xfoo#1{...} +\def\parseargdef#1{% + \expandafter \doparseargdef \csname\string#1\endcsname #1% +} +\def\doparseargdef#1#2{% + \def#2{\parsearg#1}% + \def#1##1% +} + +% Several utility definitions with active space: +{ + \obeyspaces + \gdef\obeyedspace{ } + + % Make each space character in the input produce a normal interword + % space in the output. Don't allow a line break at this space, as this + % is used only in environments like @example, where each line of input + % should produce a line of output anyway. + % + \gdef\sepspaces{\obeyspaces\let =\tie} + + % If an index command is used in an @example environment, any spaces + % therein should become regular spaces in the raw index file, not the + % expansion of \tie (\leavevmode \penalty \@M \ ). + \gdef\unsepspaces{\let =\space} +} + + +\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} + +% Define the framework for environments in texinfo.tex. It's used like this: +% +% \envdef\foo{...} +% \def\Efoo{...} +% +% It's the responsibility of \envdef to insert \begingroup before the +% actual body; @end closes the group after calling \Efoo. \envdef also +% defines \thisenv, so the current environment is known; @end checks +% whether the environment name matches. The \checkenv macro can also be +% used to check whether the current environment is the one expected. +% +% Non-false conditionals (@iftex, @ifset) don't fit into this, so they +% are not treated as environments; they don't open a group. (The +% implementation of @end takes care not to call \endgroup in this +% special case.) + + +% At run-time, environments start with this: +\def\startenvironment#1{\begingroup\def\thisenv{#1}} +% initialize +\let\thisenv\empty + +% ... but they get defined via ``\envdef\foo{...}'': +\long\def\envdef#1#2{\def#1{\startenvironment#1#2}} +\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} + +% Check whether we're in the right environment: +\def\checkenv#1{% + \def\temp{#1}% + \ifx\thisenv\temp + \else + \badenverr + \fi +} + +% Environment mismatch, #1 expected: +\def\badenverr{% + \errhelp = \EMsimple + \errmessage{This command can appear only \inenvironment\temp, + not \inenvironment\thisenv}% +} +\def\inenvironment#1{% + \ifx#1\empty + outside of any environment% + \else + in environment \expandafter\string#1% + \fi +} + +% @end foo executes the definition of \Efoo. +% But first, it executes a specialized version of \checkenv +% +\parseargdef\end{% + \if 1\csname iscond.#1\endcsname + \else + % The general wording of \badenverr may not be ideal. + \expandafter\checkenv\csname#1\endcsname + \csname E#1\endcsname + \endgroup + \fi +} + +\newhelp\EMsimple{Press RETURN to continue.} + + +% Be sure we're in horizontal mode when doing a tie, since we make space +% equivalent to this in @example-like environments. Otherwise, a space +% at the beginning of a line will start with \penalty -- and +% since \penalty is valid in vertical mode, we'd end up putting the +% penalty on the vertical list instead of in the new paragraph. +{\catcode`@ = 11 + % Avoid using \@M directly, because that causes trouble + % if the definition is written into an index file. + \global\let\tiepenalty = \@M + \gdef\tie{\leavevmode\penalty\tiepenalty\ } +} + +% @: forces normal size whitespace following. +\def\:{\spacefactor=1000 } + +% @* forces a line break. +\def\*{\unskip\hfil\break\hbox{}\ignorespaces} + +% @/ allows a line break. +\let\/=\allowbreak + +% @. is an end-of-sentence period. +\def\.{.\spacefactor=\endofsentencespacefactor\space} + +% @! is an end-of-sentence bang. +\def\!{!\spacefactor=\endofsentencespacefactor\space} + +% @? is an end-of-sentence query. +\def\?{?\spacefactor=\endofsentencespacefactor\space} + +% @frenchspacing on|off says whether to put extra space after punctuation. +% +\def\onword{on} +\def\offword{off} +% +\parseargdef\frenchspacing{% + \def\temp{#1}% + \ifx\temp\onword \plainfrenchspacing + \else\ifx\temp\offword \plainnonfrenchspacing + \else + \errhelp = \EMsimple + \errmessage{Unknown @frenchspacing option `\temp', must be on|off}% + \fi\fi +} + +% @w prevents a word break. Without the \leavevmode, @w at the +% beginning of a paragraph, when TeX is still in vertical mode, would +% produce a whole line of output instead of starting the paragraph. +\def\w#1{\leavevmode\hbox{#1}} + +% @group ... @end group forces ... to be all on one page, by enclosing +% it in a TeX vbox. We use \vtop instead of \vbox to construct the box +% to keep its height that of a normal line. According to the rules for +% \topskip (p.114 of the TeXbook), the glue inserted is +% max (\topskip - \ht (first item), 0). If that height is large, +% therefore, no glue is inserted, and the space between the headline and +% the text is small, which looks bad. +% +% Another complication is that the group might be very large. This can +% cause the glue on the previous page to be unduly stretched, because it +% does not have much material. In this case, it's better to add an +% explicit \vfill so that the extra space is at the bottom. The +% threshold for doing this is if the group is more than \vfilllimit +% percent of a page (\vfilllimit can be changed inside of @tex). +% +\newbox\groupbox +\def\vfilllimit{0.7} +% +\envdef\group{% + \ifnum\catcode`\^^M=\active \else + \errhelp = \groupinvalidhelp + \errmessage{@group invalid in context where filling is enabled}% + \fi + \startsavinginserts + % + \setbox\groupbox = \vtop\bgroup + % Do @comment since we are called inside an environment such as + % @example, where each end-of-line in the input causes an + % end-of-line in the output. We don't want the end-of-line after + % the `@group' to put extra space in the output. Since @group + % should appear on a line by itself (according to the Texinfo + % manual), we don't worry about eating any user text. + \comment +} +% +% The \vtop produces a box with normal height and large depth; thus, TeX puts +% \baselineskip glue before it, and (when the next line of text is done) +% \lineskip glue after it. Thus, space below is not quite equal to space +% above. But it's pretty close. +\def\Egroup{% + % To get correct interline space between the last line of the group + % and the first line afterwards, we have to propagate \prevdepth. + \endgraf % Not \par, as it may have been set to \lisppar. + \global\dimen1 = \prevdepth + \egroup % End the \vtop. + \addgroupbox + \prevdepth = \dimen1 + \checkinserts +} + +\def\addgroupbox{ + % \dimen0 is the vertical size of the group's box. + \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox + % \dimen2 is how much space is left on the page (more or less). + \dimen2 = \txipageheight \advance\dimen2 by -\pagetotal + % if the group doesn't fit on the current page, and it's a big big + % group, force a page break. + \ifdim \dimen0 > \dimen2 + \ifdim \pagetotal < \vfilllimit\txipageheight + \page + \fi + \fi + \box\groupbox +} + +% +% TeX puts in an \escapechar (i.e., `@') at the beginning of the help +% message, so this ends up printing `@group can only ...'. +% +\newhelp\groupinvalidhelp{% +group can only be used in environments such as @example,^^J% +where each line of input produces a line of output.} + +% @need space-in-mils +% forces a page break if there is not space-in-mils remaining. + +\newdimen\mil \mil=0.001in + +\parseargdef\need{% + % Ensure vertical mode, so we don't make a big box in the middle of a + % paragraph. + \par + % + % If the @need value is less than one line space, it's useless. + \dimen0 = #1\mil + \dimen2 = \ht\strutbox + \advance\dimen2 by \dp\strutbox + \ifdim\dimen0 > \dimen2 + % + % Do a \strut just to make the height of this box be normal, so the + % normal leading is inserted relative to the preceding line. + % And a page break here is fine. + \vtop to #1\mil{\strut\vfil}% + % + % TeX does not even consider page breaks if a penalty added to the + % main vertical list is 10000 or more. But in order to see if the + % empty box we just added fits on the page, we must make it consider + % page breaks. On the other hand, we don't want to actually break the + % page after the empty box. So we use a penalty of 9999. + % + % There is an extremely small chance that TeX will actually break the + % page at this \penalty, if there are no other feasible breakpoints in + % sight. (If the user is using lots of big @group commands, which + % almost-but-not-quite fill up a page, TeX will have a hard time doing + % good page breaking, for example.) However, I could not construct an + % example where a page broke at this \penalty; if it happens in a real + % document, then we can reconsider our strategy. + \penalty9999 + % + % Back up by the size of the box, whether we did a page break or not. + \kern -#1\mil + % + % Do not allow a page break right after this kern. + \nobreak + \fi +} + +% @br forces paragraph break (and is undocumented). + +\let\br = \par + +% @page forces the start of a new page. +% +\def\page{\par\vfill\supereject} + +% @exdent text.... +% outputs text on separate line in roman font, starting at standard page margin + +% This records the amount of indent in the innermost environment. +% That's how much \exdent should take out. +\newskip\exdentamount + +% This defn is used inside fill environments such as @defun. +\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} + +% This defn is used inside nofill environments such as @example. +\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount + \leftline{\hskip\leftskip{\rm#1}}}} + +% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current +% paragraph. For more general purposes, use the \margin insertion +% class. WHICH is `l' or `r'. Not documented, written for gawk manual. +% +\newskip\inmarginspacing \inmarginspacing=1cm +\def\strutdepth{\dp\strutbox} +% +\def\doinmargin#1#2{\strut\vadjust{% + \nobreak + \kern-\strutdepth + \vtop to \strutdepth{% + \baselineskip=\strutdepth + \vss + % if you have multiple lines of stuff to put here, you'll need to + % make the vbox yourself of the appropriate size. + \ifx#1l% + \llap{\ignorespaces #2\hskip\inmarginspacing}% + \else + \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% + \fi + \null + }% +}} +\def\inleftmargin{\doinmargin l} +\def\inrightmargin{\doinmargin r} +% +% @inmargin{TEXT [, RIGHT-TEXT]} +% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; +% else use TEXT for both). +% +\def\inmargin#1{\parseinmargin #1,,\finish} +\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \def\lefttext{#1}% have both texts + \def\righttext{#2}% + \else + \def\lefttext{#1}% have only one text + \def\righttext{#1}% + \fi + % + \ifodd\pageno + \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin + \else + \def\temp{\inleftmargin\lefttext}% + \fi + \temp +} + +% @include FILE -- \input text of FILE. +% +\def\include{\parseargusing\filenamecatcodes\includezzz} +\def\includezzz#1{% + \pushthisfilestack + \def\thisfile{#1}% + {% + \makevalueexpandable % we want to expand any @value in FILE. + \turnoffactive % and allow special characters in the expansion + \indexnofonts % Allow `@@' and other weird things in file names. + \wlog{texinfo.tex: doing @include of #1^^J}% + \edef\temp{\noexpand\input #1 }% + % + % This trickery is to read FILE outside of a group, in case it makes + % definitions, etc. + \expandafter + }\temp + \popthisfilestack +} +\def\filenamecatcodes{% + \catcode`\\=\other + \catcode`~=\other + \catcode`^=\other + \catcode`_=\other + \catcode`|=\other + \catcode`<=\other + \catcode`>=\other + \catcode`+=\other + \catcode`-=\other + \catcode`\`=\other + \catcode`\'=\other +} + +\def\pushthisfilestack{% + \expandafter\pushthisfilestackX\popthisfilestack\StackTerm +} +\def\pushthisfilestackX{% + \expandafter\pushthisfilestackY\thisfile\StackTerm +} +\def\pushthisfilestackY #1\StackTerm #2\StackTerm {% + \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% +} + +\def\popthisfilestack{\errthisfilestackempty} +\def\errthisfilestackempty{\errmessage{Internal error: + the stack of filenames is empty.}} +% +\def\thisfile{} + +% @center line +% outputs that line, centered. +% +\parseargdef\center{% + \ifhmode + \let\centersub\centerH + \else + \let\centersub\centerV + \fi + \centersub{\hfil \ignorespaces#1\unskip \hfil}% + \let\centersub\relax % don't let the definition persist, just in case +} +\def\centerH#1{{% + \hfil\break + \advance\hsize by -\leftskip + \advance\hsize by -\rightskip + \line{#1}% + \break +}} +% +\newcount\centerpenalty +\def\centerV#1{% + % The idea here is the same as in \startdefun, \cartouche, etc.: if + % @center is the first thing after a section heading, we need to wipe + % out the negative parskip inserted by \sectionheading, but still + % prevent a page break here. + \centerpenalty = \lastpenalty + \ifnum\centerpenalty>10000 \vskip\parskip \fi + \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi + \line{\kern\leftskip #1\kern\rightskip}% +} + +% @sp n outputs n lines of vertical space +% +\parseargdef\sp{\vskip #1\baselineskip} + +% @comment ...line which is ignored... +% @c is the same as @comment +% @ignore ... @end ignore is another way to write a comment + + +\def\c{\begingroup \catcode`\^^M=\active% +\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% +\cxxx} +{\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}} +% +\let\comment\c + +% @paragraphindent NCHARS +% We'll use ems for NCHARS, close enough. +% NCHARS can also be the word `asis' or `none'. +% We cannot feasibly implement @paragraphindent asis, though. +% +\def\asisword{asis} % no translation, these are keywords +\def\noneword{none} +% +\parseargdef\paragraphindent{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \defaultparindent = 0pt + \else + \defaultparindent = #1em + \fi + \fi + \parindent = \defaultparindent +} + +% @exampleindent NCHARS +% We'll use ems for NCHARS like @paragraphindent. +% It seems @exampleindent asis isn't necessary, but +% I preserve it to make it similar to @paragraphindent. +\parseargdef\exampleindent{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \lispnarrowing = 0pt + \else + \lispnarrowing = #1em + \fi + \fi +} + +% @firstparagraphindent WORD +% If WORD is `none', then suppress indentation of the first paragraph +% after a section heading. If WORD is `insert', then do indent at such +% paragraphs. +% +% The paragraph indentation is suppressed or not by calling +% \suppressfirstparagraphindent, which the sectioning commands do. +% We switch the definition of this back and forth according to WORD. +% By default, we suppress indentation. +% +\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} +\def\insertword{insert} +% +\parseargdef\firstparagraphindent{% + \def\temp{#1}% + \ifx\temp\noneword + \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent + \else\ifx\temp\insertword + \let\suppressfirstparagraphindent = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @firstparagraphindent option `\temp'}% + \fi\fi +} + +% Here is how we actually suppress indentation. Redefine \everypar to +% \kern backwards by \parindent, and then reset itself to empty. +% +% We also make \indent itself not actually do anything until the next +% paragraph. +% +\gdef\dosuppressfirstparagraphindent{% + \gdef\indent {\restorefirstparagraphindent \indent}% + \gdef\noindent{\restorefirstparagraphindent \noindent}% + \global\everypar = {\kern -\parindent \restorefirstparagraphindent}% +} +% +\gdef\restorefirstparagraphindent{% + \global\let\indent = \ptexindent + \global\let\noindent = \ptexnoindent + \global\everypar = {}% +} + + +% @refill is a no-op. +\let\refill=\relax + +% @setfilename INFO-FILENAME - ignored +\let\setfilename=\comment + +% @bye. +\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} + + +\message{pdf,} +% adobe `portable' document format +\newcount\tempnum +\newcount\lnkcount +\newtoks\filename +\newcount\filenamelength +\newcount\pgn +\newtoks\toksA +\newtoks\toksB +\newtoks\toksC +\newtoks\toksD +\newbox\boxA +\newbox\boxB +\newcount\countA +\newif\ifpdf +\newif\ifpdfmakepagedest + +% +% For LuaTeX +% + +\newif\iftxiuseunicodedestname +\txiuseunicodedestnamefalse % For pdfTeX etc. + +\ifx\luatexversion\thisisundefined +\else + % Use Unicode destination names + \txiuseunicodedestnametrue + % Escape PDF strings with converting UTF-16 from UTF-8 + \begingroup + \catcode`\%=12 + \directlua{ + function UTF16oct(str) + tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '377') + for c in string.utfvalues(str) do + if c < 0x10000 then + tex.sprint( + string.format(string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o', + (c / 256), (c % 256))) + else + c = c - 0x10000 + local c_hi = c / 1024 + 0xd800 + local c_lo = c % 1024 + 0xdc00 + tex.sprint( + string.format(string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o', + (c_hi / 256), (c_hi % 256), + (c_lo / 256), (c_lo % 256))) + end + end + end + } + \endgroup + \def\pdfescapestrutfsixteen#1{\directlua{UTF16oct('\luaescapestring{#1}')}} + % Escape PDF strings without converting + \begingroup + \directlua{ + function PDFescstr(str) + for c in string.bytes(str) do + if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then + tex.sprint( + string.format(string.char(0x5c) .. string.char(0x25) .. '03o', + c)) + else + tex.sprint(string.char(c)) + end + end + end + } + \endgroup + \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}} + \ifnum\luatexversion>84 + % For LuaTeX >= 0.85 + \def\pdfdest{\pdfextension dest} + \let\pdfoutput\outputmode + \def\pdfliteral{\pdfextension literal} + \def\pdfcatalog{\pdfextension catalog} + \def\pdftexversion{\numexpr\pdffeedback version\relax} + \let\pdfximage\saveimageresource + \let\pdfrefximage\useimageresource + \let\pdflastximage\lastsavedimageresourceindex + \def\pdfendlink{\pdfextension endlink\relax} + \def\pdfoutline{\pdfextension outline} + \def\pdfstartlink{\pdfextension startlink} + \def\pdffontattr{\pdfextension fontattr} + \def\pdfobj{\pdfextension obj} + \def\pdflastobj{\numexpr\pdffeedback lastobj\relax} + \let\pdfpagewidth\pagewidth + \let\pdfpageheight\pageheight + \edef\pdfhorigin{\pdfvariable horigin} + \edef\pdfvorigin{\pdfvariable vorigin} + \fi +\fi + +% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 +% can be set). So we test for \relax and 0 as well as being undefined. +\ifx\pdfoutput\thisisundefined +\else + \ifx\pdfoutput\relax + \else + \ifcase\pdfoutput + \else + \pdftrue + \fi + \fi +\fi + +% PDF uses PostScript string constants for the names of xref targets, +% for display in the outlines, and in other places. Thus, we have to +% double any backslashes. Otherwise, a name like "\node" will be +% interpreted as a newline (\n), followed by o, d, e. Not good. +% +% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and +% related messages. The final outcome is that it is up to the TeX user +% to double the backslashes and otherwise make the string valid, so +% that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to +% do this reliably, so we use it. + +% #1 is a control sequence in which to do the replacements, +% which we \xdef. +\def\txiescapepdf#1{% + \ifx\pdfescapestring\thisisundefined + % No primitive available; should we give a warning or log? + % Many times it won't matter. + \xdef#1{#1}% + \else + % The expandable \pdfescapestring primitive escapes parentheses, + % backslashes, and other special chars. + \xdef#1{\pdfescapestring{#1}}% + \fi +} +\def\txiescapepdfutfsixteen#1{% + \ifx\pdfescapestrutfsixteen\thisisundefined + % No UTF-16 converting macro available. + \txiescapepdf{#1}% + \else + \xdef#1{\pdfescapestrutfsixteen{#1}}% + \fi +} + +\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images +with PDF output, and none of those formats could be found. (.eps cannot +be supported due to the design of the PDF format; use regular TeX (DVI +output) for that.)} + +\ifpdf + % + % Color manipulation macros using ideas from pdfcolor.tex, + % except using rgb instead of cmyk; the latter is said to render as a + % very dark gray on-screen and a very dark halftone in print, instead + % of actual black. The dark red here is dark enough to print on paper as + % nearly black, but still distinguishable for online viewing. We use + % black by default, though. + \def\rgbDarkRed{0.50 0.09 0.12} + \def\rgbBlack{0 0 0} + % + % rg sets the color for filling (usual text, etc.); + % RG sets the color for stroking (thin rules, e.g., normal _'s). + \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} + % + % Set color, and create a mark which defines \thiscolor accordingly, + % so that \makeheadline knows which color to restore. + \def\setcolor#1{% + \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% + \domark + \pdfsetcolor{#1}% + } + % + \def\maincolor{\rgbBlack} + \pdfsetcolor{\maincolor} + \edef\thiscolor{\maincolor} + \def\lastcolordefs{} + % + \def\makefootline{% + \baselineskip24pt + \line{\pdfsetcolor{\maincolor}\the\footline}% + } + % + \def\makeheadline{% + \vbox to 0pt{% + \vskip-22.5pt + \line{% + \vbox to8.5pt{}% + % Extract \thiscolor definition from the marks. + \getcolormarks + % Typeset the headline with \maincolor, then restore the color. + \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% + }% + \vss + }% + \nointerlineskip + } + % + % + \pdfcatalog{/PageMode /UseOutlines} + % + % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). + \def\dopdfimage#1#2#3{% + \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% + \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% + % + % pdftex (and the PDF format) support .pdf, .png, .jpg (among + % others). Let's try in that order, PDF first since if + % someone has a scalable image, presumably better to use that than a + % bitmap. + \let\pdfimgext=\empty + \begingroup + \openin 1 #1.pdf \ifeof 1 + \openin 1 #1.PDF \ifeof 1 + \openin 1 #1.png \ifeof 1 + \openin 1 #1.jpg \ifeof 1 + \openin 1 #1.jpeg \ifeof 1 + \openin 1 #1.JPG \ifeof 1 + \errhelp = \nopdfimagehelp + \errmessage{Could not find image file #1 for pdf}% + \else \gdef\pdfimgext{JPG}% + \fi + \else \gdef\pdfimgext{jpeg}% + \fi + \else \gdef\pdfimgext{jpg}% + \fi + \else \gdef\pdfimgext{png}% + \fi + \else \gdef\pdfimgext{PDF}% + \fi + \else \gdef\pdfimgext{pdf}% + \fi + \closein 1 + \endgroup + % + % without \immediate, ancient pdftex seg faults when the same image is + % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) + \ifnum\pdftexversion < 14 + \immediate\pdfimage + \else + \immediate\pdfximage + \fi + \ifdim \wd0 >0pt width \pdfimagewidth \fi + \ifdim \wd2 >0pt height \pdfimageheight \fi + \ifnum\pdftexversion<13 + #1.\pdfimgext + \else + {#1.\pdfimgext}% + \fi + \ifnum\pdftexversion < 14 \else + \pdfrefximage \pdflastximage + \fi} + % + \def\setpdfdestname#1{{% + % We have to set dummies so commands such as @code, and characters + % such as \, aren't expanded when present in a section title. + \indexnofonts + \makevalueexpandable + \turnoffactive + \iftxiuseunicodedestname + \ifx \declaredencoding \latone + % Pass through Latin-1 characters. + % LuaTeX with byte wise I/O converts Latin-1 characters to Unicode. + \else + \ifx \declaredencoding \utfeight + % Pass through Unicode characters. + \else + % Use ASCII approximations in destination names. + \passthroughcharsfalse + \fi + \fi + \else + % Use ASCII approximations in destination names. + \passthroughcharsfalse + \fi + \def\pdfdestname{#1}% + \txiescapepdf\pdfdestname + }} + % + \def\setpdfoutlinetext#1{{% + \indexnofonts + \makevalueexpandable + \turnoffactive + \ifx \declaredencoding \latone + % The PDF format can use an extended form of Latin-1 in bookmark + % strings. See Appendix D of the PDF Reference, Sixth Edition, for + % the "PDFDocEncoding". + \passthroughcharstrue + % Pass through Latin-1 characters. + % LuaTeX: Convert to Unicode + % pdfTeX: Use Latin-1 as PDFDocEncoding + \def\pdfoutlinetext{#1}% + \else + \ifx \declaredencoding \utfeight + \ifx\luatexversion\thisisundefined + % For pdfTeX with UTF-8. + % TODO: the PDF format can use UTF-16 in bookmark strings, + % but the code for this isn't done yet. + % Use ASCII approximations. + \passthroughcharsfalse + \def\pdfoutlinetext{#1}% + \else + % For LuaTeX with UTF-8. + % Pass through Unicode characters for title texts. + \passthroughcharstrue + \def\pdfoutlinetext{#1}% + \fi + \else + % For non-Latin-1 or non-UTF-8 encodings. + % Use ASCII approximations. + \passthroughcharsfalse + \def\pdfoutlinetext{#1}% + \fi + \fi + % LuaTeX: Convert to UTF-16 + % pdfTeX: Use Latin-1 as PDFDocEncoding + \txiescapepdfutfsixteen\pdfoutlinetext + }} + % + \def\pdfmkdest#1{% + \setpdfdestname{#1}% + \safewhatsit{\pdfdest name{\pdfdestname} xyz}% + } + % + % used to mark target names; must be expandable. + \def\pdfmkpgn#1{#1} + % + % by default, use black for everything. + \def\urlcolor{\rgbBlack} + \def\linkcolor{\rgbBlack} + \def\endlink{\setcolor{\maincolor}\pdfendlink} + % + % Adding outlines to PDF; macros for calculating structure of outlines + % come from Petr Olsak + \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% + \else \csname#1\endcsname \fi} + \def\advancenumber#1{\tempnum=\expnumber{#1}\relax + \advance\tempnum by 1 + \expandafter\xdef\csname#1\endcsname{\the\tempnum}} + % + % #1 is the section text, which is what will be displayed in the + % outline by the pdf viewer. #2 is the pdf expression for the number + % of subentries (or empty, for subsubsections). #3 is the node text, + % which might be empty if this toc entry had no corresponding node. + % #4 is the page number + % + \def\dopdfoutline#1#2#3#4{% + % Generate a link to the node text if that exists; else, use the + % page number. We could generate a destination for the section + % text in the case where a section has no node, but it doesn't + % seem worth the trouble, since most documents are normally structured. + \setpdfoutlinetext{#1} + \setpdfdestname{#3} + \ifx\pdfdestname\empty + \def\pdfdestname{#4}% + \fi + % + \pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#2{\pdfoutlinetext}% + } + % + \def\pdfmakeoutlines{% + \begingroup + % Read toc silently, to get counts of subentries for \pdfoutline. + \def\partentry##1##2##3##4{}% ignore parts in the outlines + \def\numchapentry##1##2##3##4{% + \def\thischapnum{##2}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + }% + \def\numsecentry##1##2##3##4{% + \advancenumber{chap\thischapnum}% + \def\thissecnum{##2}% + \def\thissubsecnum{0}% + }% + \def\numsubsecentry##1##2##3##4{% + \advancenumber{sec\thissecnum}% + \def\thissubsecnum{##2}% + }% + \def\numsubsubsecentry##1##2##3##4{% + \advancenumber{subsec\thissubsecnum}% + }% + \def\thischapnum{0}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + % + % use \def rather than \let here because we redefine \chapentry et + % al. a second time, below. + \def\appentry{\numchapentry}% + \def\appsecentry{\numsecentry}% + \def\appsubsecentry{\numsubsecentry}% + \def\appsubsubsecentry{\numsubsubsecentry}% + \def\unnchapentry{\numchapentry}% + \def\unnsecentry{\numsecentry}% + \def\unnsubsecentry{\numsubsecentry}% + \def\unnsubsubsecentry{\numsubsubsecentry}% + \readdatafile{toc}% + % + % Read toc second time, this time actually producing the outlines. + % The `-' means take the \expnumber as the absolute number of + % subentries, which we calculated on our first read of the .toc above. + % + % We use the node names as the destinations. + \def\numchapentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% + \def\numsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% + \def\numsubsubsecentry##1##2##3##4{% count is always zero + \dopdfoutline{##1}{}{##3}{##4}}% + % + % PDF outlines are displayed using system fonts, instead of + % document fonts. Therefore we cannot use special characters, + % since the encoding is unknown. For example, the eogonek from + % Latin 2 (0xea) gets translated to a | character. Info from + % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. + % + % TODO this right, we have to translate 8-bit characters to + % their "best" equivalent, based on the @documentencoding. Too + % much work for too little return. Just use the ASCII equivalents + % we use for the index sort strings. + % + \indexnofonts + \setupdatafile + % We can have normal brace characters in the PDF outlines, unlike + % Texinfo index files. So set that up. + \def\{{\lbracecharliteral}% + \def\}{\rbracecharliteral}% + \catcode`\\=\active \otherbackslash + \input \tocreadfilename + \endgroup + } + {\catcode`[=1 \catcode`]=2 + \catcode`{=\other \catcode`}=\other + \gdef\lbracecharliteral[{]% + \gdef\rbracecharliteral[}]% + ] + % + \def\skipspaces#1{\def\PP{#1}\def\D{|}% + \ifx\PP\D\let\nextsp\relax + \else\let\nextsp\skipspaces + \addtokens{\filename}{\PP}% + \advance\filenamelength by 1 + \fi + \nextsp} + \def\getfilename#1{% + \filenamelength=0 + % If we don't expand the argument now, \skipspaces will get + % snagged on things like "@value{foo}". + \edef\temp{#1}% + \expandafter\skipspaces\temp|\relax + } + \ifnum\pdftexversion < 14 + \let \startlink \pdfannotlink + \else + \let \startlink \pdfstartlink + \fi + % make a live url in pdf output. + \def\pdfurl#1{% + \begingroup + % it seems we really need yet another set of dummies; have not + % tried to figure out what each command should do in the context + % of @url. for now, just make @/ a no-op, that's the only one + % people have actually reported a problem with. + % + \normalturnoffactive + \def\@{@}% + \let\/=\empty + \makevalueexpandable + % do we want to go so far as to use \indexnofonts instead of just + % special-casing \var here? + \def\var##1{##1}% + % + \leavevmode\setcolor{\urlcolor}% + \startlink attr{/Border [0 0 0]}% + user{/Subtype /Link /A << /S /URI /URI (#1) >>}% + \endgroup} + \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} + \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} + \def\maketoks{% + \expandafter\poptoks\the\toksA|ENDTOKS|\relax + \ifx\first0\adn0 + \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 + \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else + \ifnum0=\countA\else\makelink\fi + \ifx\first.\let\next=\done\else + \let\next=\maketoks + \addtokens{\toksB}{\the\toksD} + \ifx\first,\addtokens{\toksB}{\space}\fi + \fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \next} + \def\makelink{\addtokens{\toksB}% + {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} + \def\pdflink#1{% + \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} + \setcolor{\linkcolor}#1\endlink} + \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} +\else + % non-pdf mode + \let\pdfmkdest = \gobble + \let\pdfurl = \gobble + \let\endlink = \relax + \let\setcolor = \gobble + \let\pdfsetcolor = \gobble + \let\pdfmakeoutlines = \relax +\fi % \ifx\pdfoutput + +% +% For XeTeX +% +\ifx\XeTeXrevision\thisisundefined +\else + % + % XeTeX version check + % + \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99996}>-1 + % TeX Live 2016 contains XeTeX 0.99996 and xdvipdfmx 20160307. + % It can use the `dvipdfmx:config' special (from TeX Live SVN r40941). + % For avoiding PDF destination name replacement, we use this special + % instead of xdvipdfmx's command line option `-C 0x0010'. + \special{dvipdfmx:config C 0x0010} + % XeTeX 0.99995+ comes with xdvipdfmx 20160307+. + % It can handle Unicode destination names for PDF. + \txiuseunicodedestnametrue + \else + % XeTeX < 0.99996 (TeX Live < 2016) cannot use the + % `dvipdfmx:config' special. + % So for avoiding PDF destination name replacement, + % xdvipdfmx's command line option `-C 0x0010' is necessary. + % + % XeTeX < 0.99995 can not handle Unicode destination names for PDF + % because xdvipdfmx 20150315 has a UTF-16 conversion issue. + % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). + \txiuseunicodedestnamefalse + \fi + % + % Color support + % + \def\rgbDarkRed{0.50 0.09 0.12} + \def\rgbBlack{0 0 0} + % + \def\pdfsetcolor#1{\special{pdf:scolor [#1]}} + % + % Set color, and create a mark which defines \thiscolor accordingly, + % so that \makeheadline knows which color to restore. + \def\setcolor#1{% + \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% + \domark + \pdfsetcolor{#1}% + } + % + \def\maincolor{\rgbBlack} + \pdfsetcolor{\maincolor} + \edef\thiscolor{\maincolor} + \def\lastcolordefs{} + % + \def\makefootline{% + \baselineskip24pt + \line{\pdfsetcolor{\maincolor}\the\footline}% + } + % + \def\makeheadline{% + \vbox to 0pt{% + \vskip-22.5pt + \line{% + \vbox to8.5pt{}% + % Extract \thiscolor definition from the marks. + \getcolormarks + % Typeset the headline with \maincolor, then restore the color. + \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% + }% + \vss + }% + \nointerlineskip + } + % + % PDF outline support + % + % Emulate pdfTeX primitive + \def\pdfdest name#1 xyz{% + \special{pdf:dest (#1) [@thispage /XYZ @xpos @ypos null]}% + } + % + \def\setpdfdestname#1{{% + % We have to set dummies so commands such as @code, and characters + % such as \, aren't expanded when present in a section title. + \indexnofonts + \makevalueexpandable + \turnoffactive + \iftxiuseunicodedestname + % Pass through Unicode characters. + \else + % Use ASCII approximations in destination names. + \passthroughcharsfalse + \fi + \def\pdfdestname{#1}% + \txiescapepdf\pdfdestname + }} + % + \def\setpdfoutlinetext#1{{% + \turnoffactive + % Always use Unicode characters in title texts. + \def\pdfoutlinetext{#1}% + % For XeTeX, xdvipdfmx converts to UTF-16. + % So we do not convert. + \txiescapepdf\pdfoutlinetext + }} + % + \def\pdfmkdest#1{% + \setpdfdestname{#1}% + \safewhatsit{\pdfdest name{\pdfdestname} xyz}% + } + % + % by default, use black for everything. + \def\urlcolor{\rgbBlack} + \def\linkcolor{\rgbBlack} + \def\endlink{\setcolor{\maincolor}\pdfendlink} + % + \def\dopdfoutline#1#2#3#4{% + \setpdfoutlinetext{#1} + \setpdfdestname{#3} + \ifx\pdfdestname\empty + \def\pdfdestname{#4}% + \fi + % + \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A + << /S /GoTo /D (\pdfdestname) >> >> }% + } + % + \def\pdfmakeoutlines{% + \begingroup + % + % For XeTeX, counts of subentries are not necessary. + % Therefore, we read toc only once. + % + % We use node names as destinations. + \def\partentry##1##2##3##4{}% ignore parts in the outlines + \def\numchapentry##1##2##3##4{% + \dopdfoutline{##1}{1}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{2}{##3}{##4}}% + \def\numsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{3}{##3}{##4}}% + \def\numsubsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{4}{##3}{##4}}% + % + \let\appentry\numchapentry% + \let\appsecentry\numsecentry% + \let\appsubsecentry\numsubsecentry% + \let\appsubsubsecentry\numsubsubsecentry% + \let\unnchapentry\numchapentry% + \let\unnsecentry\numsecentry% + \let\unnsubsecentry\numsubsecentry% + \let\unnsubsubsecentry\numsubsubsecentry% + % + % For XeTeX, xdvipdfmx converts strings to UTF-16. + % Therefore, the encoding and the language may not be considered. + % + \indexnofonts + \setupdatafile + % We can have normal brace characters in the PDF outlines, unlike + % Texinfo index files. So set that up. + \def\{{\lbracecharliteral}% + \def\}{\rbracecharliteral}% + \catcode`\\=\active \otherbackslash + \input \tocreadfilename + \endgroup + } + {\catcode`[=1 \catcode`]=2 + \catcode`{=\other \catcode`}=\other + \gdef\lbracecharliteral[{]% + \gdef\rbracecharliteral[}]% + ] + + \special{pdf:docview << /PageMode /UseOutlines >> } + % ``\special{pdf:tounicode ...}'' is not necessary + % because xdvipdfmx converts strings from UTF-8 to UTF-16 without it. + % However, due to a UTF-16 conversion issue of xdvipdfmx 20150315, + % ``\special{pdf:dest ...}'' cannot handle non-ASCII strings. + % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). +% + \def\skipspaces#1{\def\PP{#1}\def\D{|}% + \ifx\PP\D\let\nextsp\relax + \else\let\nextsp\skipspaces + \addtokens{\filename}{\PP}% + \advance\filenamelength by 1 + \fi + \nextsp} + \def\getfilename#1{% + \filenamelength=0 + % If we don't expand the argument now, \skipspaces will get + % snagged on things like "@value{foo}". + \edef\temp{#1}% + \expandafter\skipspaces\temp|\relax + } + % make a live url in pdf output. + \def\pdfurl#1{% + \begingroup + % it seems we really need yet another set of dummies; have not + % tried to figure out what each command should do in the context + % of @url. for now, just make @/ a no-op, that's the only one + % people have actually reported a problem with. + % + \normalturnoffactive + \def\@{@}% + \let\/=\empty + \makevalueexpandable + % do we want to go so far as to use \indexnofonts instead of just + % special-casing \var here? + \def\var##1{##1}% + % + \leavevmode\setcolor{\urlcolor}% + \special{pdf:bann << /Border [0 0 0] + /Subtype /Link /A << /S /URI /URI (#1) >> >>}% + \endgroup} + \def\endlink{\setcolor{\maincolor}\special{pdf:eann}} + \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} + \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} + \def\maketoks{% + \expandafter\poptoks\the\toksA|ENDTOKS|\relax + \ifx\first0\adn0 + \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 + \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else + \ifnum0=\countA\else\makelink\fi + \ifx\first.\let\next=\done\else + \let\next=\maketoks + \addtokens{\toksB}{\the\toksD} + \ifx\first,\addtokens{\toksB}{\space}\fi + \fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \next} + \def\makelink{\addtokens{\toksB}% + {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} + \def\pdflink#1{% + \special{pdf:bann << /Border [0 0 0] + /Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}% + \setcolor{\linkcolor}#1\endlink} + \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} +% + % + % @image support + % + % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). + \def\doxeteximage#1#2#3{% + \def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% + \def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% + % + % XeTeX (and the PDF format) supports .pdf, .png, .jpg (among + % others). Let's try in that order, PDF first since if + % someone has a scalable image, presumably better to use that than a + % bitmap. + \let\xeteximgext=\empty + \begingroup + \openin 1 #1.pdf \ifeof 1 + \openin 1 #1.PDF \ifeof 1 + \openin 1 #1.png \ifeof 1 + \openin 1 #1.jpg \ifeof 1 + \openin 1 #1.jpeg \ifeof 1 + \openin 1 #1.JPG \ifeof 1 + \errmessage{Could not find image file #1 for XeTeX}% + \else \gdef\xeteximgext{JPG}% + \fi + \else \gdef\xeteximgext{jpeg}% + \fi + \else \gdef\xeteximgext{jpg}% + \fi + \else \gdef\xeteximgext{png}% + \fi + \else \gdef\xeteximgext{PDF}% + \fi + \else \gdef\xeteximgext{pdf}% + \fi + \closein 1 + \endgroup + % + \def\xetexpdfext{pdf}% + \ifx\xeteximgext\xetexpdfext + \XeTeXpdffile "#1".\xeteximgext "" + \else + \def\xetexpdfext{PDF}% + \ifx\xeteximgext\xetexpdfext + \XeTeXpdffile "#1".\xeteximgext "" + \else + \XeTeXpicfile "#1".\xeteximgext "" + \fi + \fi + \ifdim \wd0 >0pt width \xeteximagewidth \fi + \ifdim \wd2 >0pt height \xeteximageheight \fi \relax + } +\fi + + +% +\message{fonts,} + +% Set the baselineskip to #1, and the lineskip and strut size +% correspondingly. There is no deep meaning behind these magic numbers +% used as factors; they just match (closely enough) what Knuth defined. +% +\def\lineskipfactor{.08333} +\def\strutheightpercent{.70833} +\def\strutdepthpercent {.29167} +% +% can get a sort of poor man's double spacing by redefining this. +\def\baselinefactor{1} +% +\newdimen\textleading +\def\setleading#1{% + \dimen0 = #1\relax + \normalbaselineskip = \baselinefactor\dimen0 + \normallineskip = \lineskipfactor\normalbaselineskip + \normalbaselines + \setbox\strutbox =\hbox{% + \vrule width0pt height\strutheightpercent\baselineskip + depth \strutdepthpercent \baselineskip + }% +} + +% PDF CMaps. See also LaTeX's t1.cmap. +% +% do nothing with this by default. +\expandafter\let\csname cmapOT1\endcsname\gobble +\expandafter\let\csname cmapOT1IT\endcsname\gobble +\expandafter\let\csname cmapOT1TT\endcsname\gobble + +% if we are producing pdf, and we have \pdffontattr, then define cmaps. +% (\pdffontattr was introduced many years ago, but people still run +% older pdftex's; it's easy to conditionalize, so we do.) +\ifpdf \ifx\pdffontattr\thisisundefined \else + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1-0) +%%Title: (TeX-OT1-0 TeX OT1 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1) +/Supplement 0 +>> def +/CMapName /TeX-OT1-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<23> <26> <0023> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +40 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1IT + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1IT-0) +%%Title: (TeX-OT1IT-0 TeX OT1IT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1IT) +/Supplement 0 +>> def +/CMapName /TeX-OT1IT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<25> <26> <0025> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +42 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<23> <0023> +<24> <00A3> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1IT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1TT + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1TT-0) +%%Title: (TeX-OT1TT-0 TeX OT1TT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1TT) +/Supplement 0 +>> def +/CMapName /TeX-OT1TT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +5 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<21> <26> <0021> +<28> <5F> <0028> +<61> <7E> <0061> +endbfrange +32 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <2191> +<0C> <2193> +<0D> <0027> +<0E> <00A1> +<0F> <00BF> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<20> <2423> +<27> <2019> +<60> <2018> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1TT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +\fi\fi + + +% Set the font macro #1 to the font named \fontprefix#2. +% #3 is the font's design size, #4 is a scale factor, #5 is the CMap +% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit). +% Example: +% #1 = \textrm +% #2 = \rmshape +% #3 = 10 +% #4 = \mainmagstep +% #5 = OT1 +% +\def\setfont#1#2#3#4#5{% + \font#1=\fontprefix#2#3 scaled #4 + \csname cmap#5\endcsname#1% +} +% This is what gets called when #5 of \setfont is empty. +\let\cmap\gobble +% +% (end of cmaps) + +% Use cm as the default font prefix. +% To specify the font prefix, you must define \fontprefix +% before you read in texinfo.tex. +\ifx\fontprefix\thisisundefined +\def\fontprefix{cm} +\fi +% Support font families that don't use the same naming scheme as CM. +\def\rmshape{r} +\def\rmbshape{bx} % where the normal face is bold +\def\bfshape{b} +\def\bxshape{bx} +\def\ttshape{tt} +\def\ttbshape{tt} +\def\ttslshape{sltt} +\def\itshape{ti} +\def\itbshape{bxti} +\def\slshape{sl} +\def\slbshape{bxsl} +\def\sfshape{ss} +\def\sfbshape{ss} +\def\scshape{csc} +\def\scbshape{csc} + +% Definitions for a main text size of 11pt. (The default in Texinfo.) +% +\def\definetextfontsizexi{% +% Text fonts (11.2pt, magstep1). +\def\textnominalsize{11pt} +\edef\mainmagstep{\magstephalf} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep +\def\textecsize{1095} + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstep1}{OT1} +\setfont\deftt\ttshape{10}{\magstep1}{OT1TT} +\setfont\defsl\slshape{10}{\magstep1}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} +\def\df{\let\ttfont=\deftt \let\bffont = \defbf +\let\ttslfont=\defttsl \let\slfont=\defsl \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 +\def\smallecsize{0900} + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 +\def\smallerecsize{0800} + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\titleecsize{2074} + +% Chapter (and unnumbered) fonts (17.28pt). +\def\chapnominalsize{17pt} +\setfont\chaprm\rmbshape{12}{\magstep2}{OT1} +\setfont\chapit\itbshape{10}{\magstep3}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep3}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} +\setfont\chapsf\sfbshape{17}{1000}{OT1} +\let\chapbf=\chaprm +\setfont\chapsc\scbshape{10}{\magstep3}{OT1} +\font\chapi=cmmi12 scaled \magstep2 +\font\chapsy=cmsy10 scaled \magstep3 +\def\chapecsize{1728} + +% Section fonts (14.4pt). +\def\secnominalsize{14pt} +\setfont\secrm\rmbshape{12}{\magstep1}{OT1} +\setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1} +\setfont\secit\itbshape{10}{\magstep2}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep2}{OT1} +\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\secsf\sfbshape{12}{\magstep1}{OT1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep2}{OT1} +\font\seci=cmmi12 scaled \magstep1 +\font\secsy=cmsy10 scaled \magstep2 +\def\sececsize{1440} + +% Subsection fonts (13.15pt). +\def\ssecnominalsize{13pt} +\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} +\setfont\ssecit\itbshape{10}{1315}{OT1IT} +\setfont\ssecsl\slbshape{10}{1315}{OT1} +\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} +\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1315}{OT1} +\font\sseci=cmmi12 scaled \magstephalf +\font\ssecsy=cmsy10 scaled 1315 +\def\ssececsize{1200} + +% Reduced fonts for @acronym in text (10pt). +\def\reducednominalsize{10pt} +\setfont\reducedrm\rmshape{10}{1000}{OT1} +\setfont\reducedtt\ttshape{10}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{1000}{OT1} +\setfont\reducedit\itshape{10}{1000}{OT1IT} +\setfont\reducedsl\slshape{10}{1000}{OT1} +\setfont\reducedsf\sfshape{10}{1000}{OT1} +\setfont\reducedsc\scshape{10}{1000}{OT1} +\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} +\font\reducedi=cmmi10 +\font\reducedsy=cmsy10 +\def\reducedecsize{1000} + +\textleading = 13.2pt % line spacing for 11pt CM +\textfonts % reset the current fonts +\rm +} % end of 11pt text font size definitions, \definetextfontsizexi + + +% Definitions to make the main text be 10pt Computer Modern, with +% section, chapter, etc., sizes following suit. This is for the GNU +% Press printing of the Emacs 22 manual. Maybe other manuals in the +% future. Used with @smallbook, which sets the leading to 12pt. +% +\def\definetextfontsizex{% +% Text fonts (10pt). +\def\textnominalsize{10pt} +\edef\mainmagstep{1000} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep +\def\textecsize{1000} + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstephalf}{OT1} +\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} +\setfont\defsl\slshape{10}{\magstephalf}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} +\def\df{\let\ttfont=\deftt \let\bffont = \defbf +\let\slfont=\defsl \let\ttslfont=\defttsl \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 +\def\smallecsize{0900} + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 +\def\smallerecsize{0800} + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\titleecsize{2074} + +% Chapter fonts (14.4pt). +\def\chapnominalsize{14pt} +\setfont\chaprm\rmbshape{12}{\magstep1}{OT1} +\setfont\chapit\itbshape{10}{\magstep2}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep2}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\chapsf\sfbshape{12}{\magstep1}{OT1} +\let\chapbf\chaprm +\setfont\chapsc\scbshape{10}{\magstep2}{OT1} +\font\chapi=cmmi12 scaled \magstep1 +\font\chapsy=cmsy10 scaled \magstep2 +\def\chapecsize{1440} + +% Section fonts (12pt). +\def\secnominalsize{12pt} +\setfont\secrm\rmbshape{12}{1000}{OT1} +\setfont\secit\itbshape{10}{\magstep1}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep1}{OT1} +\setfont\sectt\ttbshape{12}{1000}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} +\setfont\secsf\sfbshape{12}{1000}{OT1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep1}{OT1} +\font\seci=cmmi12 +\font\secsy=cmsy10 scaled \magstep1 +\def\sececsize{1200} + +% Subsection fonts (10pt). +\def\ssecnominalsize{10pt} +\setfont\ssecrm\rmbshape{10}{1000}{OT1} +\setfont\ssecit\itbshape{10}{1000}{OT1IT} +\setfont\ssecsl\slbshape{10}{1000}{OT1} +\setfont\ssectt\ttbshape{10}{1000}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} +\setfont\ssecsf\sfbshape{10}{1000}{OT1} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1000}{OT1} +\font\sseci=cmmi10 +\font\ssecsy=cmsy10 +\def\ssececsize{1000} + +% Reduced fonts for @acronym in text (9pt). +\def\reducednominalsize{9pt} +\setfont\reducedrm\rmshape{9}{1000}{OT1} +\setfont\reducedtt\ttshape{9}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{900}{OT1} +\setfont\reducedit\itshape{9}{1000}{OT1IT} +\setfont\reducedsl\slshape{9}{1000}{OT1} +\setfont\reducedsf\sfshape{9}{1000}{OT1} +\setfont\reducedsc\scshape{10}{900}{OT1} +\setfont\reducedttsl\ttslshape{10}{900}{OT1TT} +\font\reducedi=cmmi9 +\font\reducedsy=cmsy9 +\def\reducedecsize{0900} + +\divide\parskip by 2 % reduce space between paragraphs +\textleading = 12pt % line spacing for 10pt CM +\textfonts % reset the current fonts +\rm +} % end of 10pt text font size definitions, \definetextfontsizex + +% Fonts for short table of contents. +\setfont\shortcontrm\rmshape{12}{1000}{OT1} +\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 +\setfont\shortcontsl\slshape{12}{1000}{OT1} +\setfont\shortconttt\ttshape{12}{1000}{OT1TT} + + +% We provide the user-level command +% @fonttextsize 10 +% (or 11) to redefine the text font size. pt is assumed. +% +\def\xiword{11} +\def\xword{10} +\def\xwordpt{10pt} +% +\parseargdef\fonttextsize{% + \def\textsizearg{#1}% + %\wlog{doing @fonttextsize \textsizearg}% + % + % Set \globaldefs so that documents can use this inside @tex, since + % makeinfo 4.8 does not support it, but we need it nonetheless. + % + \begingroup \globaldefs=1 + \ifx\textsizearg\xword \definetextfontsizex + \else \ifx\textsizearg\xiword \definetextfontsizexi + \else + \errhelp=\EMsimple + \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} + \fi\fi + \endgroup +} + +% +% Change the current font style to #1, remembering it in \curfontstyle. +% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in +% italics, not bold italics. +% +\def\setfontstyle#1{% + \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. + \csname #1font\endcsname % change the current font +} + +\def\rm{\fam=0 \setfontstyle{rm}} +\def\it{\fam=\itfam \setfontstyle{it}} +\def\sl{\fam=\slfam \setfontstyle{sl}} +\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} +\def\tt{\fam=\ttfam \setfontstyle{tt}} + +% Texinfo sort of supports the sans serif font style, which plain TeX does not. +% So we set up a \sf. +\newfam\sffam +\def\sf{\fam=\sffam \setfontstyle{sf}} + +% We don't need math for this font style. +\def\ttsl{\setfontstyle{ttsl}} + + +% In order for the font changes to affect most math symbols and letters, +% we have to define the \textfont of the standard families. We don't +% bother to reset \scriptfont and \scriptscriptfont; awaiting user need. +% +\def\resetmathfonts{% + \textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont + \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont + \textfont\ttfam=\ttfont \textfont\sffam=\sffont +} + +% + +% The font-changing commands (all called \...fonts) redefine the meanings +% of \STYLEfont, instead of just \STYLE. We do this because \STYLE needs +% to also set the current \fam for math mode. Our \STYLE (e.g., \rm) +% commands hardwire \STYLEfont to set the current font. +% +% Each font-changing command also sets the names \lsize (one size lower) +% and \lllsize (three sizes lower). These relative commands are used +% in, e.g., the LaTeX logo and acronyms. +% +% This all needs generalizing, badly. +% + +\def\assignfonts#1{% + \expandafter\let\expandafter\rmfont\csname #1rm\endcsname + \expandafter\let\expandafter\itfont\csname #1it\endcsname + \expandafter\let\expandafter\slfont\csname #1sl\endcsname + \expandafter\let\expandafter\bffont\csname #1bf\endcsname + \expandafter\let\expandafter\ttfont\csname #1tt\endcsname + \expandafter\let\expandafter\smallcaps\csname #1sc\endcsname + \expandafter\let\expandafter\sffont \csname #1sf\endcsname + \expandafter\let\expandafter\ifont \csname #1i\endcsname + \expandafter\let\expandafter\syfont \csname #1sy\endcsname + \expandafter\let\expandafter\ttslfont\csname #1ttsl\endcsname +} + +\newif\ifrmisbold + +% Select smaller font size with the current style. Used to change font size +% in, e.g., the LaTeX logo and acronyms. If we are using bold fonts for +% normal roman text, also use bold fonts for roman text in the smaller size. +\def\switchtolllsize{% + \expandafter\assignfonts\expandafter{\lllsize}% + \ifrmisbold + \let\rmfont\bffont + \fi + \csname\curfontstyle\endcsname +}% + +\def\switchtolsize{% + \expandafter\assignfonts\expandafter{\lsize}% + \ifrmisbold + \let\rmfont\bffont + \fi + \csname\curfontstyle\endcsname +}% + +\def\definefontsetatsize#1#2#3#4#5{% +\expandafter\def\csname #1fonts\endcsname{% + \def\curfontsize{#1}% + \def\lsize{#2}\def\lllsize{#3}% + \csname rmisbold#5\endcsname + \assignfonts{#1}% + \resetmathfonts + \setleading{#4}% +}} + +\definefontsetatsize{text} {reduced}{smaller}{\textleading}{false} +\definefontsetatsize{title} {chap} {subsec} {27pt} {true} +\definefontsetatsize{chap} {sec} {text} {19pt} {true} +\definefontsetatsize{sec} {subsec} {reduced}{17pt} {true} +\definefontsetatsize{ssec} {text} {small} {15pt} {true} +\definefontsetatsize{reduced}{small} {smaller}{10.5pt}{false} +\definefontsetatsize{small} {smaller}{smaller}{10.5pt}{false} +\definefontsetatsize{smaller}{smaller}{smaller}{9.5pt} {false} + +\def\titlefont#1{{\titlefonts\rm #1}} +\let\subsecfonts = \ssecfonts +\let\subsubsecfonts = \ssecfonts + +% Define these just so they can be easily changed for other fonts. +\def\angleleft{$\langle$} +\def\angleright{$\rangle$} + +% Set the fonts to use with the @small... environments. +\let\smallexamplefonts = \smallfonts + +% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample +% can fit this many characters: +% 8.5x11=86 smallbook=72 a4=90 a5=69 +% If we use \scriptfonts (8pt), then we can fit this many characters: +% 8.5x11=90+ smallbook=80 a4=90+ a5=77 +% For me, subjectively, the few extra characters that fit aren't worth +% the additional smallness of 8pt. So I'm making the default 9pt. +% +% By the way, for comparison, here's what fits with @example (10pt): +% 8.5x11=71 smallbook=60 a4=75 a5=58 +% --karl, 24jan03. + +% Set up the default fonts, so we can use them for creating boxes. +% +\definetextfontsizexi + + +\message{markup,} + +% Check if we are currently using a typewriter font. Since all the +% Computer Modern typewriter fonts have zero interword stretch (and +% shrink), and it is reasonable to expect all typewriter fonts to have +% this property, we can check that font parameter. +% +\def\ifmonospace{\ifdim\fontdimen3\font=0pt } + +% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will +% define and register \INITMACRO to be called on markup style changes. +% \INITMACRO can check \currentmarkupstyle for the innermost +% style and the set of \ifmarkupSTYLE switches for all styles +% currently in effect. +\newif\ifmarkupvar +\newif\ifmarkupsamp +\newif\ifmarkupkey +%\newif\ifmarkupfile % @file == @samp. +%\newif\ifmarkupoption % @option == @samp. +\newif\ifmarkupcode +\newif\ifmarkupkbd +%\newif\ifmarkupenv % @env == @code. +%\newif\ifmarkupcommand % @command == @code. +\newif\ifmarkuptex % @tex (and part of @math, for now). +\newif\ifmarkupexample +\newif\ifmarkupverb +\newif\ifmarkupverbatim + +\let\currentmarkupstyle\empty + +\def\setupmarkupstyle#1{% + \csname markup#1true\endcsname + \def\currentmarkupstyle{#1}% + \markupstylesetup +} + +\let\markupstylesetup\empty + +\def\defmarkupstylesetup#1{% + \expandafter\def\expandafter\markupstylesetup + \expandafter{\markupstylesetup #1}% + \def#1% +} + +% Markup style setup for left and right quotes. +\defmarkupstylesetup\markupsetuplq{% + \expandafter\let\expandafter \temp + \csname markupsetuplq\currentmarkupstyle\endcsname + \ifx\temp\relax \markupsetuplqdefault \else \temp \fi +} + +\defmarkupstylesetup\markupsetuprq{% + \expandafter\let\expandafter \temp + \csname markupsetuprq\currentmarkupstyle\endcsname + \ifx\temp\relax \markupsetuprqdefault \else \temp \fi +} + +{ +\catcode`\'=\active +\catcode`\`=\active + +\gdef\markupsetuplqdefault{\let`\lq} +\gdef\markupsetuprqdefault{\let'\rq} + +\gdef\markupsetcodequoteleft{\let`\codequoteleft} +\gdef\markupsetcodequoteright{\let'\codequoteright} +} + +\let\markupsetuplqcode \markupsetcodequoteleft +\let\markupsetuprqcode \markupsetcodequoteright +% +\let\markupsetuplqexample \markupsetcodequoteleft +\let\markupsetuprqexample \markupsetcodequoteright +% +\let\markupsetuplqkbd \markupsetcodequoteleft +\let\markupsetuprqkbd \markupsetcodequoteright +% +\let\markupsetuplqsamp \markupsetcodequoteleft +\let\markupsetuprqsamp \markupsetcodequoteright +% +\let\markupsetuplqverb \markupsetcodequoteleft +\let\markupsetuprqverb \markupsetcodequoteright +% +\let\markupsetuplqverbatim \markupsetcodequoteleft +\let\markupsetuprqverbatim \markupsetcodequoteright + +% Allow an option to not use regular directed right quote/apostrophe +% (char 0x27), but instead the undirected quote from cmtt (char 0x0d). +% The undirected quote is ugly, so don't make it the default, but it +% works for pasting with more pdf viewers (at least evince), the +% lilypond developers report. xpdf does work with the regular 0x27. +% +\def\codequoteright{% + \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax + \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax + '% + \else \char'15 \fi + \else \char'15 \fi +} +% +% and a similar option for the left quote char vs. a grave accent. +% Modern fonts display ASCII 0x60 as a grave accent, so some people like +% the code environments to do likewise. +% +\def\codequoteleft{% + \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax + \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax + % [Knuth] pp. 380,381,391 + % \relax disables Spanish ligatures ?` and !` of \tt font. + \relax`% + \else \char'22 \fi + \else \char'22 \fi +} + +% Commands to set the quote options. +% +\parseargdef\codequoteundirected{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETtxicodequoteundirected\endcsname + = t% + \else\ifx\temp\offword + \expandafter\let\csname SETtxicodequoteundirected\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}% + \fi\fi +} +% +\parseargdef\codequotebacktick{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETtxicodequotebacktick\endcsname + = t% + \else\ifx\temp\offword + \expandafter\let\csname SETtxicodequotebacktick\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}% + \fi\fi +} + +% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. +\def\noligaturesquoteleft{\relax\lq} + +% Count depth in font-changes, for error checks +\newcount\fontdepth \fontdepth=0 + +% Font commands. + +% #1 is the font command (\sl or \it), #2 is the text to slant. +% If we are in a monospaced environment, however, 1) always use \ttsl, +% and 2) do not add an italic correction. +\def\dosmartslant#1#2{% + \ifusingtt + {{\ttsl #2}\let\next=\relax}% + {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}% + \next +} +\def\smartslanted{\dosmartslant\sl} +\def\smartitalic{\dosmartslant\it} + +% Output an italic correction unless \next (presumed to be the following +% character) is such as not to need one. +\def\smartitaliccorrection{% + \ifx\next,% + \else\ifx\next-% + \else\ifx\next.% + \else\ifx\next\.% + \else\ifx\next\comma% + \else\ptexslash + \fi\fi\fi\fi\fi + \aftersmartic +} + +% Unconditional use \ttsl, and no ic. @var is set to this for defuns. +\def\ttslanted#1{{\ttsl #1}} + +% @cite is like \smartslanted except unconditionally use \sl. We never want +% ttsl for book titles, do we? +\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection} + +\def\aftersmartic{} +\def\var#1{% + \let\saveaftersmartic = \aftersmartic + \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% + \smartslanted{#1}% +} + +\let\i=\smartitalic +\let\slanted=\smartslanted +\let\dfn=\smartslanted +\let\emph=\smartitalic + +% Explicit font changes: @r, @sc, undocumented @ii. +\def\r#1{{\rm #1}} % roman font +\def\sc#1{{\smallcaps#1}} % smallcaps font +\def\ii#1{{\it #1}} % italic font + +% @b, explicit bold. Also @strong. +\def\b#1{{\bf #1}} +\let\strong=\b + +% @sansserif, explicit sans. +\def\sansserif#1{{\sf #1}} + +% We can't just use \exhyphenpenalty, because that only has effect at +% the end of a paragraph. Restore normal hyphenation at the end of the +% group within which \nohyphenation is presumably called. +% +\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} +\def\restorehyphenation{\hyphenchar\font = `- } + +% Set sfcode to normal for the chars that usually have another value. +% Can't use plain's \frenchspacing because it uses the `\x notation, and +% sometimes \x has an active definition that messes things up. +% +\catcode`@=11 + \def\plainfrenchspacing{% + \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m + \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m + \def\endofsentencespacefactor{1000}% for @. and friends + } + \def\plainnonfrenchspacing{% + \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 + \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 + \def\endofsentencespacefactor{3000}% for @. and friends + } +\catcode`@=\other +\def\endofsentencespacefactor{3000}% default + +% @t, explicit typewriter. +\def\t#1{% + {\tt \rawbackslash \plainfrenchspacing #1}% + \null +} + +% @samp. +\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} + +% @indicateurl is \samp, that is, with quotes. +\let\indicateurl=\samp + +% @code (and similar) prints in typewriter, but with spaces the same +% size as normal in the surrounding text, without hyphenation, etc. +% This is a subroutine for that. +\def\tclose#1{% + {% + % Change normal interword space to be same as for the current font. + \spaceskip = \fontdimen2\font + % + % Switch to typewriter. + \tt + % + % But `\ ' produces the large typewriter interword space. + \def\ {{\spaceskip = 0pt{} }}% + % + % Turn off hyphenation. + \nohyphenation + % + \rawbackslash + \plainfrenchspacing + #1% + }% + \null % reset spacefactor to 1000 +} + +% We *must* turn on hyphenation at `-' and `_' in @code. +% (But see \codedashfinish below.) +% Otherwise, it is too hard to avoid overfull hboxes +% in the Emacs manual, the Library manual, etc. +% +% Unfortunately, TeX uses one parameter (\hyphenchar) to control +% both hyphenation at - and hyphenation within words. +% We must therefore turn them both off (\tclose does that) +% and arrange explicitly to hyphenate at a dash. -- rms. +{ + \catcode`\-=\active \catcode`\_=\active + \catcode`\'=\active \catcode`\`=\active + \global\let'=\rq \global\let`=\lq % default definitions + % + \global\def\code{\begingroup + \setupmarkupstyle{code}% + % The following should really be moved into \setupmarkupstyle handlers. + \catcode\dashChar=\active \catcode\underChar=\active + \ifallowcodebreaks + \let-\codedash + \let_\codeunder + \else + \let-\normaldash + \let_\realunder + \fi + % Given -foo (with a single dash), we do not want to allow a break + % after the hyphen. + \global\let\codedashprev=\codedash + % + \codex + } + % + \gdef\codedash{\futurelet\next\codedashfinish} + \gdef\codedashfinish{% + \normaldash % always output the dash character itself. + % + % Now, output a discretionary to allow a line break, unless + % (a) the next character is a -, or + % (b) the preceding character is a -. + % E.g., given --posix, we do not want to allow a break after either -. + % Given --foo-bar, we do want to allow a break between the - and the b. + \ifx\next\codedash \else + \ifx\codedashprev\codedash + \else \discretionary{}{}{}\fi + \fi + % we need the space after the = for the case when \next itself is a + % space token; it would get swallowed otherwise. As in @code{- a}. + \global\let\codedashprev= \next + } +} +\def\normaldash{-} +% +\def\codex #1{\tclose{#1}\endgroup} + +\def\codeunder{% + % this is all so @math{@code{var_name}+1} can work. In math mode, _ + % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) + % will therefore expand the active definition of _, which is us + % (inside @code that is), therefore an endless loop. + \ifusingtt{\ifmmode + \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. + \else\normalunderscore \fi + \discretionary{}{}{}}% + {\_}% +} + +% An additional complication: the above will allow breaks after, e.g., +% each of the four underscores in __typeof__. This is bad. +% @allowcodebreaks provides a document-level way to turn breaking at - +% and _ on and off. +% +\newif\ifallowcodebreaks \allowcodebreakstrue + +\def\keywordtrue{true} +\def\keywordfalse{false} + +\parseargdef\allowcodebreaks{% + \def\txiarg{#1}% + \ifx\txiarg\keywordtrue + \allowcodebreakstrue + \else\ifx\txiarg\keywordfalse + \allowcodebreaksfalse + \else + \errhelp = \EMsimple + \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}% + \fi\fi +} + +% For @command, @env, @file, @option quotes seem unnecessary, +% so use \code rather than \samp. +\let\command=\code +\let\env=\code +\let\file=\code +\let\option=\code + +% @uref (abbreviation for `urlref') aka @url takes an optional +% (comma-separated) second argument specifying the text to display and +% an optional third arg as text to display instead of (rather than in +% addition to) the url itself. First (mandatory) arg is the url. + +% TeX-only option to allow changing PDF output to show only the second +% arg (if given), and not the url (which is then just the link target). +\newif\ifurefurlonlylink + +% The main macro is \urefbreak, which allows breaking at expected +% places within the url. (There used to be another version, which +% didn't support automatic breaking.) +\def\urefbreak{\begingroup \urefcatcodes \dourefbreak} +\let\uref=\urefbreak +% +\def\dourefbreak#1{\urefbreakfinish #1,,,\finish} +\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example + \unsepspaces + \pdfurl{#1}% + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt + \unhbox0 % third arg given, show only that + \else + \setbox0 = \hbox{\ignorespaces #2}% look for second arg + \ifdim\wd0 > 0pt + \ifpdf + % For pdfTeX and LuaTeX + \ifurefurlonlylink + % PDF plus option to not display url, show just arg + \unhbox0 + \else + % PDF, normally display both arg and url for consistency, + % visibility, if the pdf is eventually used to print, etc. + \unhbox0\ (\urefcode{#1})% + \fi + \else + \ifx\XeTeXrevision\thisisundefined + \unhbox0\ (\urefcode{#1})% DVI, always show arg and url + \else + % For XeTeX + \ifurefurlonlylink + % PDF plus option to not display url, show just arg + \unhbox0 + \else + % PDF, normally display both arg and url for consistency, + % visibility, if the pdf is eventually used to print, etc. + \unhbox0\ (\urefcode{#1})% + \fi + \fi + \fi + \else + \urefcode{#1}% only url given, so show it + \fi + \fi + \endlink +\endgroup} + +% Allow line breaks around only a few characters (only). +\def\urefcatcodes{% + \catcode`\&=\active \catcode`\.=\active + \catcode`\#=\active \catcode`\?=\active + \catcode`\/=\active +} +{ + \urefcatcodes + % + \global\def\urefcode{\begingroup + \setupmarkupstyle{code}% + \urefcatcodes + \let&\urefcodeamp + \let.\urefcodedot + \let#\urefcodehash + \let?\urefcodequest + \let/\urefcodeslash + \codex + } + % + % By default, they are just regular characters. + \global\def&{\normalamp} + \global\def.{\normaldot} + \global\def#{\normalhash} + \global\def?{\normalquest} + \global\def/{\normalslash} +} + +% we put a little stretch before and after the breakable chars, to help +% line breaking of long url's. The unequal skips make look better in +% cmtt at least, especially for dots. +\def\urefprestretchamount{.13em} +\def\urefpoststretchamount{.1em} +\def\urefprestretch{\urefprebreak \hskip0pt plus\urefprestretchamount\relax} +\def\urefpoststretch{\urefpostbreak \hskip0pt plus\urefprestretchamount\relax} +% +\def\urefcodeamp{\urefprestretch \&\urefpoststretch} +\def\urefcodedot{\urefprestretch .\urefpoststretch} +\def\urefcodehash{\urefprestretch \#\urefpoststretch} +\def\urefcodequest{\urefprestretch ?\urefpoststretch} +\def\urefcodeslash{\futurelet\next\urefcodeslashfinish} +{ + \catcode`\/=\active + \global\def\urefcodeslashfinish{% + \urefprestretch \slashChar + % Allow line break only after the final / in a sequence of + % slashes, to avoid line break between the slashes in http://. + \ifx\next/\else \urefpoststretch \fi + } +} + +% One more complication: by default we'll break after the special +% characters, but some people like to break before the special chars, so +% allow that. Also allow no breaking at all, for manual control. +% +\parseargdef\urefbreakstyle{% + \def\txiarg{#1}% + \ifx\txiarg\wordnone + \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} + \else\ifx\txiarg\wordbefore + \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} + \else\ifx\txiarg\wordafter + \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} + \else + \errhelp = \EMsimple + \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% + \fi\fi\fi +} +\def\wordafter{after} +\def\wordbefore{before} +\def\wordnone{none} + +\urefbreakstyle after + +% @url synonym for @uref, since that's how everyone uses it. +% +\let\url=\uref + +% rms does not like angle brackets --karl, 17may97. +% So now @email is just like @uref, unless we are pdf. +% +%\def\email#1{\angleleft{\tt #1}\angleright} +\ifpdf + \def\email#1{\doemail#1,,\finish} + \def\doemail#1,#2,#3\finish{\begingroup + \unsepspaces + \pdfurl{mailto:#1}% + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi + \endlink + \endgroup} +\else + \ifx\XeTeXrevision\thisisundefined + \let\email=\uref + \else + \def\email#1{\doemail#1,,\finish} + \def\doemail#1,#2,#3\finish{\begingroup + \unsepspaces + \pdfurl{mailto:#1}% + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi + \endlink + \endgroup} + \fi +\fi + +% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), +% `example' (@kbd uses ttsl only inside of @example and friends), +% or `code' (@kbd uses normal tty font always). +\parseargdef\kbdinputstyle{% + \def\txiarg{#1}% + \ifx\txiarg\worddistinct + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% + \else\ifx\txiarg\wordexample + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% + \else\ifx\txiarg\wordcode + \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% + \else + \errhelp = \EMsimple + \errmessage{Unknown @kbdinputstyle setting `\txiarg'}% + \fi\fi\fi +} +\def\worddistinct{distinct} +\def\wordexample{example} +\def\wordcode{code} + +% Default is `distinct'. +\kbdinputstyle distinct + +% @kbd is like @code, except that if the argument is just one @key command, +% then @kbd has no effect. +\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}} + +\def\xkey{\key} +\def\kbdsub#1#2#3\par{% + \def\one{#1}\def\three{#3}\def\threex{??}% + \ifx\one\xkey\ifx\threex\three \key{#2}% + \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi + \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi +} + +% definition of @key that produces a lozenge. Doesn't adjust to text size. +%\setfont\keyrm\rmshape{8}{1000}{OT1} +%\font\keysy=cmsy9 +%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% +% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% +% \vbox{\hrule\kern-0.4pt +% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% +% \kern-0.4pt\hrule}% +% \kern-.06em\raise0.4pt\hbox{\angleright}}}} + +% definition of @key with no lozenge. If the current font is already +% monospace, don't change it; that way, we respect @kbdinputstyle. But +% if it isn't monospace, then use \tt. +% +\def\key#1{{\setupmarkupstyle{key}% + \nohyphenation + \ifmonospace\else\tt\fi + #1}\null} + +% @clicksequence{File @click{} Open ...} +\def\clicksequence#1{\begingroup #1\endgroup} + +% @clickstyle @arrow (by default) +\parseargdef\clickstyle{\def\click{#1}} +\def\click{\arrow} + +% Typeset a dimension, e.g., `in' or `pt'. The only reason for the +% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. +% +\def\dmn#1{\thinspace #1} + +% @acronym for "FBI", "NATO", and the like. +% We print this one point size smaller, since it's intended for +% all-uppercase. +% +\def\acronym#1{\doacronym #1,,\finish} +\def\doacronym#1,#2,#3\finish{% + {\switchtolsize #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi + \null % reset \spacefactor=1000 +} + +% @abbr for "Comput. J." and the like. +% No font change, but don't do end-of-sentence spacing. +% +\def\abbr#1{\doabbr #1,,\finish} +\def\doabbr#1,#2,#3\finish{% + {\plainfrenchspacing #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi + \null % reset \spacefactor=1000 +} + +% @asis just yields its argument. Used with @table, for example. +% +\def\asis#1{#1} + +% @math outputs its argument in math mode. +% +% One complication: _ usually means subscripts, but it could also mean +% an actual _ character, as in @math{@var{some_variable} + 1}. So make +% _ active, and distinguish by seeing if the current family is \slfam, +% which is what @var uses. +{ + \catcode`\_ = \active + \gdef\mathunderscore{% + \catcode`\_=\active + \def_{\ifnum\fam=\slfam \_\else\sb\fi}% + } +} +% Another complication: we want \\ (and @\) to output a math (or tt) \. +% FYI, plain.tex uses \\ as a temporary control sequence (for no +% particular reason), but this is not advertised and we don't care. +% +% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. +\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} +% +\def\math{% + \ifmmode\else % only go into math if not in math mode already + \tex + \mathunderscore + \let\\ = \mathbackslash + \mathactive + % make the texinfo accent commands work in math mode + \let\"=\ddot + \let\'=\acute + \let\==\bar + \let\^=\hat + \let\`=\grave + \let\u=\breve + \let\v=\check + \let\~=\tilde + \let\dotaccent=\dot + % have to provide another name for sup operator + \let\mathopsup=\sup + $\expandafter\finishmath\fi +} +\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. + +% Some active characters (such as <) are spaced differently in math. +% We have to reset their definitions in case the @math was an argument +% to a command which sets the catcodes (such as @item or @section). +% +{ + \catcode`^ = \active + \catcode`< = \active + \catcode`> = \active + \catcode`+ = \active + \catcode`' = \active + \gdef\mathactive{% + \let^ = \ptexhat + \let< = \ptexless + \let> = \ptexgtr + \let+ = \ptexplus + \let' = \ptexquoteright + } +} + +% for @sub and @sup, if in math mode, just do a normal sub/superscript. +% If in text, use math to place as sub/superscript, but switch +% into text mode, with smaller fonts. This is a different font than the +% one used for real math sub/superscripts (8pt vs. 7pt), but let's not +% fix it (significant additions to font machinery) until someone notices. +% +\def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi} +\def\finishsub#1{$\sb{\hbox{\switchtolllsize #1}}$}% +% +\def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi} +\def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}% + +% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. +% Ignore unless FMTNAME == tex; then it is like @iftex and @tex, +% except specified as a normal braced arg, so no newlines to worry about. +% +\def\outfmtnametex{tex} +% +\long\def\inlinefmt#1{\doinlinefmt #1,\finish} +\long\def\doinlinefmt#1,#2,\finish{% + \def\inlinefmtname{#1}% + \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi +} +% +% @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if +% FMTNAME is tex, else ELSE-TEXT. +\long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish} +\long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{% + \def\inlinefmtname{#1}% + \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi +} +% +% For raw, must switch into @tex before parsing the argument, to avoid +% setting catcodes prematurely. Doing it this way means that, for +% example, @inlineraw{html, foo{bar} gets a parse error instead of being +% ignored. But this isn't important because if people want a literal +% *right* brace they would have to use a command anyway, so they may as +% well use a command to get a left brace too. We could re-use the +% delimiter character idea from \verb, but it seems like overkill. +% +\long\def\inlineraw{\tex \doinlineraw} +\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish} +\def\doinlinerawtwo#1,#2,\finish{% + \def\inlinerawname{#1}% + \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi + \endgroup % close group opened by \tex. +} + +% @inlineifset{VAR, TEXT} expands TEXT if VAR is @set. +% +\long\def\inlineifset#1{\doinlineifset #1,\finish} +\long\def\doinlineifset#1,#2,\finish{% + \def\inlinevarname{#1}% + \expandafter\ifx\csname SET\inlinevarname\endcsname\relax + \else\ignorespaces#2\fi +} + +% @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set. +% +\long\def\inlineifclear#1{\doinlineifclear #1,\finish} +\long\def\doinlineifclear#1,#2,\finish{% + \def\inlinevarname{#1}% + \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi +} + + +\message{glyphs,} +% and logos. + +% @@ prints an @, as does @atchar{}. +\def\@{\char64 } +\let\atchar=\@ + +% @{ @} @lbracechar{} @rbracechar{} all generate brace characters. +\def\lbracechar{{\ifmonospace\char123\else\ensuremath\lbrace\fi}} +\def\rbracechar{{\ifmonospace\char125\else\ensuremath\rbrace\fi}} +\let\{=\lbracechar +\let\}=\rbracechar + +% @comma{} to avoid , parsing problems. +\let\comma = , + +% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent +% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. +\let\, = \ptexc +\let\dotaccent = \ptexdot +\def\ringaccent#1{{\accent23 #1}} +\let\tieaccent = \ptext +\let\ubaraccent = \ptexb +\let\udotaccent = \d + +% Other special characters: @questiondown @exclamdown @ordf @ordm +% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. +\def\questiondown{?`} +\def\exclamdown{!`} +\def\ordf{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{a}}} +\def\ordm{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{o}}} + +% Dotless i and dotless j, used for accents. +\def\imacro{i} +\def\jmacro{j} +\def\dotless#1{% + \def\temp{#1}% + \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi + \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi + \else \errmessage{@dotless can be used only with i or j}% + \fi\fi +} + +% The \TeX{} logo, as in plain, but resetting the spacing so that a +% period following counts as ending a sentence. (Idea found in latex.) +% +\edef\TeX{\TeX \spacefactor=1000 } + +% @LaTeX{} logo. Not quite the same results as the definition in +% latex.ltx, since we use a different font for the raised A; it's most +% convenient for us to use an explicitly smaller font, rather than using +% the \scriptstyle font (since we don't reset \scriptstyle and +% \scriptscriptstyle). +% +\def\LaTeX{% + L\kern-.36em + {\setbox0=\hbox{T}% + \vbox to \ht0{\hbox{% + \ifx\textnominalsize\xwordpt + % for 10pt running text, lllsize (8pt) is too small for the A in LaTeX. + % Revert to plain's \scriptsize, which is 7pt. + \count255=\the\fam $\fam\count255 \scriptstyle A$% + \else + % For 11pt, we can use our lllsize. + \switchtolllsize A% + \fi + }% + \vss + }}% + \kern-.15em + \TeX +} + +% Some math mode symbols. Define \ensuremath to switch into math mode +% unless we are already there. Expansion tricks may not be needed here, +% but safer, and can't hurt. +\def\ensuremath{\ifmmode \expandafter\asis \else\expandafter\ensuredmath \fi} +\def\ensuredmath#1{$\relax#1$} +% +\def\bullet{\ensuremath\ptexbullet} +\def\geq{\ensuremath\ge} +\def\leq{\ensuremath\le} +\def\minus{\ensuremath-} + +% @dots{} outputs an ellipsis using the current font. +% We do .5em per period so that it has the same spacing in the cm +% typewriter fonts as three actual period characters; on the other hand, +% in other typewriter fonts three periods are wider than 1.5em. So do +% whichever is larger. +% +\def\dots{% + \leavevmode + \setbox0=\hbox{...}% get width of three periods + \ifdim\wd0 > 1.5em + \dimen0 = \wd0 + \else + \dimen0 = 1.5em + \fi + \hbox to \dimen0{% + \hskip 0pt plus.25fil + .\hskip 0pt plus1fil + .\hskip 0pt plus1fil + .\hskip 0pt plus.5fil + }% +} + +% @enddots{} is an end-of-sentence ellipsis. +% +\def\enddots{% + \dots + \spacefactor=\endofsentencespacefactor +} + +% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. +% +% Since these characters are used in examples, they should be an even number of +% \tt widths. Each \tt character is 1en, so two makes it 1em. +% +\def\point{$\star$} +\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} +\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} +\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} +\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} +\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}} + +% The @error{} command. +% Adapted from the TeXbook's \boxit. +% +\newbox\errorbox +% +{\ttfont \global\dimen0 = 3em}% Width of the box. +\dimen2 = .55pt % Thickness of rules +% The text. (`r' is open on the right, `e' somewhat less so on the left.) +\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} +% +\setbox\errorbox=\hbox to \dimen0{\hfil + \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. + \advance\hsize by -2\dimen2 % Rules. + \vbox{% + \hrule height\dimen2 + \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. + \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. + \kern3pt\vrule width\dimen2}% Space to right. + \hrule height\dimen2} + \hfil} +% +\def\error{\leavevmode\lower.7ex\copy\errorbox} + +% @pounds{} is a sterling sign, which Knuth put in the CM italic font. +% +\def\pounds{{\it\$}} + +% @euro{} comes from a separate font, depending on the current style. +% We use the free feym* fonts from the eurosym package by Henrik +% Theiling, which support regular, slanted, bold and bold slanted (and +% "outlined" (blackboard board, sort of) versions, which we don't need). +% It is available from http://www.ctan.org/tex-archive/fonts/eurosym. +% +% Although only regular is the truly official Euro symbol, we ignore +% that. The Euro is designed to be slightly taller than the regular +% font height. +% +% feymr - regular +% feymo - slanted +% feybr - bold +% feybo - bold slanted +% +% There is no good (free) typewriter version, to my knowledge. +% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. +% Hmm. +% +% Also doesn't work in math. Do we need to do math with euro symbols? +% Hope not. +% +% +\def\euro{{\eurofont e}} +\def\eurofont{% + % We set the font at each command, rather than predefining it in + % \textfonts and the other font-switching commands, so that + % installations which never need the symbol don't have to have the + % font installed. + % + % There is only one designed size (nominal 10pt), so we always scale + % that to the current nominal size. + % + % By the way, simply using "at 1em" works for cmr10 and the like, but + % does not work for cmbx10 and other extended/shrunken fonts. + % + \def\eurosize{\csname\curfontsize nominalsize\endcsname}% + % + \ifx\curfontstyle\bfstylename + % bold: + \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize + \else + % regular: + \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize + \fi + \thiseurofont +} + +% Glyphs from the EC fonts. We don't use \let for the aliases, because +% sometimes we redefine the original macro, and the alias should reflect +% the redefinition. +% +% Use LaTeX names for the Icelandic letters. +\def\DH{{\ecfont \char"D0}} % Eth +\def\dh{{\ecfont \char"F0}} % eth +\def\TH{{\ecfont \char"DE}} % Thorn +\def\th{{\ecfont \char"FE}} % thorn +% +\def\guillemetleft{{\ecfont \char"13}} +\def\guillemotleft{\guillemetleft} +\def\guillemetright{{\ecfont \char"14}} +\def\guillemotright{\guillemetright} +\def\guilsinglleft{{\ecfont \char"0E}} +\def\guilsinglright{{\ecfont \char"0F}} +\def\quotedblbase{{\ecfont \char"12}} +\def\quotesinglbase{{\ecfont \char"0D}} +% +% This positioning is not perfect (see the ogonek LaTeX package), but +% we have the precomposed glyphs for the most common cases. We put the +% tests to use those glyphs in the single \ogonek macro so we have fewer +% dummy definitions to worry about for index entries, etc. +% +% ogonek is also used with other letters in Lithuanian (IOU), but using +% the precomposed glyphs for those is not so easy since they aren't in +% the same EC font. +\def\ogonek#1{{% + \def\temp{#1}% + \ifx\temp\macrocharA\Aogonek + \else\ifx\temp\macrochara\aogonek + \else\ifx\temp\macrocharE\Eogonek + \else\ifx\temp\macrochare\eogonek + \else + \ecfont \setbox0=\hbox{#1}% + \ifdim\ht0=1ex\accent"0C #1% + \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}% + \fi + \fi\fi\fi\fi + }% +} +\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A} +\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a} +\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} +\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} +% +% Use the European Computer Modern fonts (cm-super in outline format) +% for non-CM glyphs. That is ec* for regular text and tc* for the text +% companion symbols (LaTeX TS1 encoding). Both are part of the ec +% package and follow the same conventions. +% +\def\ecfont{\etcfont{e}} +\def\tcfont{\etcfont{t}} +% +\def\etcfont#1{% + % We can't distinguish serif/sans and italic/slanted, but this + % is used for crude hacks anyway (like adding French and German + % quotes to documents typeset with CM, where we lose kerning), so + % hopefully nobody will notice/care. + \edef\ecsize{\csname\curfontsize ecsize\endcsname}% + \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% + \ifmonospace + % typewriter: + \font\thisecfont = #1ctt\ecsize \space at \nominalsize + \else + \ifx\curfontstyle\bfstylename + % bold: + \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize + \else + % regular: + \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \fi + \fi + \thisecfont +} + +% @registeredsymbol - R in a circle. The font for the R should really +% be smaller yet, but lllsize is the best we can do for now. +% Adapted from the plain.tex definition of \copyright. +% +\def\registeredsymbol{% + $^{{\ooalign{\hfil\raise.07ex\hbox{\switchtolllsize R}% + \hfil\crcr\Orb}}% + }$% +} + +% @textdegree - the normal degrees sign. +% +\def\textdegree{$^\circ$} + +% Laurent Siebenmann reports \Orb undefined with: +% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 +% so we'll define it if necessary. +% +\ifx\Orb\thisisundefined +\def\Orb{\mathhexbox20D} +\fi + +% Quotes. +\chardef\quotedblleft="5C +\chardef\quotedblright=`\" +\chardef\quoteleft=`\` +\chardef\quoteright=`\' + + +\message{page headings,} + +\newskip\titlepagetopglue \titlepagetopglue = 1.5in +\newskip\titlepagebottomglue \titlepagebottomglue = 2pc + +% First the title page. Must do @settitle before @titlepage. +\newif\ifseenauthor +\newif\iffinishedtitlepage + +% @setcontentsaftertitlepage used to do an implicit @contents or +% @shortcontents after @end titlepage, but it is now obsolete. +\def\setcontentsaftertitlepage{% + \errmessage{@setcontentsaftertitlepage has been removed as a Texinfo + command; move your @contents command if you want the contents + after the title page.}}% +\def\setshortcontentsaftertitlepage{% + \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo + command; move your @shortcontents and @contents commands if you + want the contents after the title page.}}% + +\parseargdef\shorttitlepage{% + \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% + \endgroup\page\hbox{}\page} + +\envdef\titlepage{% + % Open one extra group, as we want to close it in the middle of \Etitlepage. + \begingroup + \parindent=0pt \textfonts + % Leave some space at the very top of the page. + \vglue\titlepagetopglue + % No rule at page bottom unless we print one at the top with @title. + \finishedtitlepagetrue + % + % Most title ``pages'' are actually two pages long, with space + % at the top of the second. We don't want the ragged left on the second. + \let\oldpage = \page + \def\page{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + \let\page = \oldpage + \page + \null + }% +} + +\def\Etitlepage{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + % It is important to do the page break before ending the group, + % because the headline and footline are only empty inside the group. + % If we use the new definition of \page, we always get a blank page + % after the title page, which we certainly don't want. + \oldpage + \endgroup + % + % Need this before the \...aftertitlepage checks so that if they are + % in effect the toc pages will come out with page numbers. + \HEADINGSon +} + +\def\finishtitlepage{% + \vskip4pt \hrule height 2pt width \hsize + \vskip\titlepagebottomglue + \finishedtitlepagetrue +} + +% Settings used for typesetting titles: no hyphenation, no indentation, +% don't worry much about spacing, ragged right. This should be used +% inside a \vbox, and fonts need to be set appropriately first. \par should +% be specified before the end of the \vbox, since a vbox is a group. +% +\def\raggedtitlesettings{% + \rm + \hyphenpenalty=10000 + \parindent=0pt + \tolerance=5000 + \ptexraggedright +} + +% Macros to be used within @titlepage: + +\let\subtitlerm=\rmfont +\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} + +\parseargdef\title{% + \checkenv\titlepage + \vbox{\titlefonts \raggedtitlesettings #1\par}% + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt +} + +\parseargdef\subtitle{% + \checkenv\titlepage + {\subtitlefont \rightline{#1}}% +} + +% @author should come last, but may come many times. +% It can also be used inside @quotation. +% +\parseargdef\author{% + \def\temp{\quotation}% + \ifx\thisenv\temp + \def\quotationauthor{#1}% printed in \Equotation. + \else + \checkenv\titlepage + \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi + {\secfonts\rm \leftline{#1}}% + \fi +} + + +% Set up page headings and footings. + +\let\thispage=\folio + +\newtoks\evenheadline % headline on even pages +\newtoks\oddheadline % headline on odd pages +\newtoks\evenfootline % footline on even pages +\newtoks\oddfootline % footline on odd pages + +% Now make \makeheadline and \makefootline in Plain TeX use those variables +\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline + \else \the\evenheadline \fi}} +\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline + \else \the\evenfootline \fi}\HEADINGShook} +\let\HEADINGShook=\relax + +% Commands to set those variables. +% For example, this is what @headings on does +% @evenheading @thistitle|@thispage|@thischapter +% @oddheading @thischapter|@thispage|@thistitle +% @evenfooting @thisfile|| +% @oddfooting ||@thisfile + + +\def\evenheading{\parsearg\evenheadingxxx} +\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} +\def\evenheadingyyy #1\|#2\|#3\|#4\finish{% +\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\def\oddheading{\parsearg\oddheadingxxx} +\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} +\def\oddheadingyyy #1\|#2\|#3\|#4\finish{% +\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% + +\def\evenfooting{\parsearg\evenfootingxxx} +\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} +\def\evenfootingyyy #1\|#2\|#3\|#4\finish{% +\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\def\oddfooting{\parsearg\oddfootingxxx} +\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} +\def\oddfootingyyy #1\|#2\|#3\|#4\finish{% + \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% + % + % Leave some space for the footline. Hopefully ok to assume + % @evenfooting will not be used by itself. + \global\advance\txipageheight by -12pt + \global\advance\vsize by -12pt +} + +\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} + +% @evenheadingmarks top \thischapter <- chapter at the top of a page +% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page +% +% The same set of arguments for: +% +% @oddheadingmarks +% @evenfootingmarks +% @oddfootingmarks +% @everyheadingmarks +% @everyfootingmarks + +% These define \getoddheadingmarks, \getevenheadingmarks, +% \getoddfootingmarks, and \getevenfootingmarks, each to one of +% \gettopheadingmarks, \getbottomheadingmarks. +% +\def\evenheadingmarks{\headingmarks{even}{heading}} +\def\oddheadingmarks{\headingmarks{odd}{heading}} +\def\evenfootingmarks{\headingmarks{even}{footing}} +\def\oddfootingmarks{\headingmarks{odd}{footing}} +\parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1} + \headingmarks{odd}{heading}{#1} } +\parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1} + \headingmarks{odd}{footing}{#1} } +% #1 = even/odd, #2 = heading/footing, #3 = top/bottom. +\def\headingmarks#1#2#3 {% + \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname + \global\expandafter\let\csname get#1#2marks\endcsname \temp +} + +\everyheadingmarks bottom +\everyfootingmarks bottom + +% @headings double turns headings on for double-sided printing. +% @headings single turns headings on for single-sided printing. +% @headings off turns them off. +% @headings on same as @headings double, retained for compatibility. +% @headings after turns on double-sided headings after this page. +% @headings doubleafter turns on double-sided headings after this page. +% @headings singleafter turns on single-sided headings after this page. +% By default, they are off at the start of a document, +% and turned `on' after @end titlepage. + +\parseargdef\headings{\csname HEADINGS#1\endcsname} + +\def\headingsoff{% non-global headings elimination + \evenheadline={\hfil}\evenfootline={\hfil}% + \oddheadline={\hfil}\oddfootline={\hfil}% +} + +\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting +\HEADINGSoff % it's the default + +% When we turn headings on, set the page number to 1. +% For double-sided printing, put current file name in lower left corner, +% chapter name on inside top of right hand pages, document +% title on inside top of left hand pages, and page numbers on outside top +% edge of all pages. +\def\HEADINGSdouble{% +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapterheading\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} +\let\contentsalignmacro = \chappager + +% For single-sided printing, chapter title goes across top left of page, +% page number on top right. +\def\HEADINGSsingle{% +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapterheading\hfil\folio}} +\global\oddheadline={\line{\thischapterheading\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} +\def\HEADINGSon{\HEADINGSdouble} + +\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} +\let\HEADINGSdoubleafter=\HEADINGSafter +\def\HEADINGSdoublex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapterheading\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} + +\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} +\def\HEADINGSsinglex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapterheading\hfil\folio}} +\global\oddheadline={\line{\thischapterheading\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} + +% Subroutines used in generating headings +% This produces Day Month Year style of output. +% Only define if not already defined, in case a txi-??.tex file has set +% up a different format (e.g., txi-cs.tex does this). +\ifx\today\thisisundefined +\def\today{% + \number\day\space + \ifcase\month + \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr + \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug + \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec + \fi + \space\number\year} +\fi + +% @settitle line... specifies the title of the document, for headings. +% It generates no output of its own. +\def\thistitle{\putwordNoTitle} +\def\settitle{\parsearg{\gdef\thistitle}} + + +\message{tables,} +% Tables -- @table, @ftable, @vtable, @item(x). + +% default indentation of table text +\newdimen\tableindent \tableindent=.8in +% default indentation of @itemize and @enumerate text +\newdimen\itemindent \itemindent=.3in +% margin between end of table item and start of table text. +\newdimen\itemmargin \itemmargin=.1in + +% used internally for \itemindent minus \itemmargin +\newdimen\itemmax + +% Note @table, @ftable, and @vtable define @item, @itemx, etc., with +% these defs. +% They also define \itemindex +% to index the item name in whatever manner is desired (perhaps none). + +\newif\ifitemxneedsnegativevskip + +\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} + +\def\internalBitem{\smallbreak \parsearg\itemzzz} +\def\internalBitemx{\itemxpar \parsearg\itemzzz} + +\def\itemzzz #1{\begingroup % + \advance\hsize by -\rightskip + \advance\hsize by -\tableindent + \setbox0=\hbox{\itemindicate{#1}}% + \itemindex{#1}% + \nobreak % This prevents a break before @itemx. + % + % If the item text does not fit in the space we have, put it on a line + % by itself, and do not allow a page break either before or after that + % line. We do not start a paragraph here because then if the next + % command is, e.g., @kindex, the whatsit would get put into the + % horizontal list on a line by itself, resulting in extra blank space. + \ifdim \wd0>\itemmax + % + % Make this a paragraph so we get the \parskip glue and wrapping, + % but leave it ragged-right. + \begingroup + \advance\leftskip by-\tableindent + \advance\hsize by\tableindent + \advance\rightskip by0pt plus1fil\relax + \leavevmode\unhbox0\par + \endgroup + % + % We're going to be starting a paragraph, but we don't want the + % \parskip glue -- logically it's part of the @item we just started. + \nobreak \vskip-\parskip + % + % Stop a page break at the \parskip glue coming up. However, if + % what follows is an environment such as @example, there will be no + % \parskip glue; then the negative vskip we just inserted would + % cause the example and the item to crash together. So we use this + % bizarre value of 10001 as a signal to \aboveenvbreak to insert + % \parskip glue after all. Section titles are handled this way also. + % + \penalty 10001 + \endgroup + \itemxneedsnegativevskipfalse + \else + % The item text fits into the space. Start a paragraph, so that the + % following text (if any) will end up on the same line. + \noindent + % Do this with kerns and \unhbox so that if there is a footnote in + % the item text, it can migrate to the main vertical list and + % eventually be printed. + \nobreak\kern-\tableindent + \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 + \unhbox0 + \nobreak\kern\dimen0 + \endgroup + \itemxneedsnegativevskiptrue + \fi +} + +\def\item{\errmessage{@item while not in a list environment}} +\def\itemx{\errmessage{@itemx while not in a list environment}} + +% @table, @ftable, @vtable. +\envdef\table{% + \let\itemindex\gobble + \tablecheck{table}% +} +\envdef\ftable{% + \def\itemindex ##1{\doind {fn}{\code{##1}}}% + \tablecheck{ftable}% +} +\envdef\vtable{% + \def\itemindex ##1{\doind {vr}{\code{##1}}}% + \tablecheck{vtable}% +} +\def\tablecheck#1{% + \ifnum \the\catcode`\^^M=\active + \endgroup + \errmessage{This command won't work in this context; perhaps the problem is + that we are \inenvironment\thisenv}% + \def\next{\doignore{#1}}% + \else + \let\next\tablex + \fi + \next +} +\def\tablex#1{% + \def\itemindicate{#1}% + \parsearg\tabley +} +\def\tabley#1{% + {% + \makevalueexpandable + \edef\temp{\noexpand\tablez #1\space\space\space}% + \expandafter + }\temp \endtablez +} +\def\tablez #1 #2 #3 #4\endtablez{% + \aboveenvbreak + \ifnum 0#1>0 \advance \leftskip by #1\mil \fi + \ifnum 0#2>0 \tableindent=#2\mil \fi + \ifnum 0#3>0 \advance \rightskip by #3\mil \fi + \itemmax=\tableindent + \advance \itemmax by -\itemmargin + \advance \leftskip by \tableindent + \exdentamount=\tableindent + \parindent = 0pt + \parskip = \smallskipamount + \ifdim \parskip=0pt \parskip=2pt \fi + \let\item = \internalBitem + \let\itemx = \internalBitemx +} +\def\Etable{\endgraf\afterenvbreak} +\let\Eftable\Etable +\let\Evtable\Etable +\let\Eitemize\Etable +\let\Eenumerate\Etable + +% This is the counter used by @enumerate, which is really @itemize + +\newcount \itemno + +\envdef\itemize{\parsearg\doitemize} + +\def\doitemize#1{% + \aboveenvbreak + \itemmax=\itemindent + \advance\itemmax by -\itemmargin + \advance\leftskip by \itemindent + \exdentamount=\itemindent + \parindent=0pt + \parskip=\smallskipamount + \ifdim\parskip=0pt \parskip=2pt \fi + % + % Try typesetting the item mark so that if the document erroneously says + % something like @itemize @samp (intending @table), there's an error + % right away at the @itemize. It's not the best error message in the + % world, but it's better than leaving it to the @item. This means if + % the user wants an empty mark, they have to say @w{} not just @w. + \def\itemcontents{#1}% + \setbox0 = \hbox{\itemcontents}% + % + % @itemize with no arg is equivalent to @itemize @bullet. + \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi + % + \let\item=\itemizeitem +} + +% Definition of @item while inside @itemize and @enumerate. +% +\def\itemizeitem{% + \advance\itemno by 1 % for enumerations + {\let\par=\endgraf \smallbreak}% reasonable place to break + {% + % If the document has an @itemize directly after a section title, a + % \nobreak will be last on the list, and \sectionheading will have + % done a \vskip-\parskip. In that case, we don't want to zero + % parskip, or the item text will crash with the heading. On the + % other hand, when there is normal text preceding the item (as there + % usually is), we do want to zero parskip, or there would be too much + % space. In that case, we won't have a \nobreak before. At least + % that's the theory. + \ifnum\lastpenalty<10000 \parskip=0in \fi + \noindent + \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% + % + \ifinner\else + \vadjust{\penalty 1200}% not good to break after first line of item. + \fi + % We can be in inner vertical mode in a footnote, although an + % @itemize looks awful there. + }% + \flushcr +} + +% \splitoff TOKENS\endmark defines \first to be the first token in +% TOKENS, and \rest to be the remainder. +% +\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% + +% Allow an optional argument of an uppercase letter, lowercase letter, +% or number, to specify the first label in the enumerated list. No +% argument is the same as `1'. +% +\envparseargdef\enumerate{\enumeratey #1 \endenumeratey} +\def\enumeratey #1 #2\endenumeratey{% + % If we were given no argument, pretend we were given `1'. + \def\thearg{#1}% + \ifx\thearg\empty \def\thearg{1}\fi + % + % Detect if the argument is a single token. If so, it might be a + % letter. Otherwise, the only valid thing it can be is a number. + % (We will always have one token, because of the test we just made. + % This is a good thing, since \splitoff doesn't work given nothing at + % all -- the first parameter is undelimited.) + \expandafter\splitoff\thearg\endmark + \ifx\rest\empty + % Only one token in the argument. It could still be anything. + % A ``lowercase letter'' is one whose \lccode is nonzero. + % An ``uppercase letter'' is one whose \lccode is both nonzero, and + % not equal to itself. + % Otherwise, we assume it's a number. + % + % We need the \relax at the end of the \ifnum lines to stop TeX from + % continuing to look for a <number>. + % + \ifnum\lccode\expandafter`\thearg=0\relax + \numericenumerate % a number (we hope) + \else + % It's a letter. + \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax + \lowercaseenumerate % lowercase letter + \else + \uppercaseenumerate % uppercase letter + \fi + \fi + \else + % Multiple tokens in the argument. We hope it's a number. + \numericenumerate + \fi +} + +% An @enumerate whose labels are integers. The starting integer is +% given in \thearg. +% +\def\numericenumerate{% + \itemno = \thearg + \startenumeration{\the\itemno}% +} + +% The starting (lowercase) letter is in \thearg. +\def\lowercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more lowercase letters in @enumerate; get a bigger + alphabet}% + \fi + \char\lccode\itemno + }% +} + +% The starting (uppercase) letter is in \thearg. +\def\uppercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more uppercase letters in @enumerate; get a bigger + alphabet} + \fi + \char\uccode\itemno + }% +} + +% Call \doitemize, adding a period to the first argument and supplying the +% common last two arguments. Also subtract one from the initial value in +% \itemno, since @item increments \itemno. +% +\def\startenumeration#1{% + \advance\itemno by -1 + \doitemize{#1.}\flushcr +} + +% @alphaenumerate and @capsenumerate are abbreviations for giving an arg +% to @enumerate. +% +\def\alphaenumerate{\enumerate{a}} +\def\capsenumerate{\enumerate{A}} +\def\Ealphaenumerate{\Eenumerate} +\def\Ecapsenumerate{\Eenumerate} + + +% @multitable macros +% Amy Hendrickson, 8/18/94, 3/6/96 +% +% @multitable ... @end multitable will make as many columns as desired. +% Contents of each column will wrap at width given in preamble. Width +% can be specified either with sample text given in a template line, +% or in percent of \hsize, the current width of text on page. + +% Table can continue over pages but will only break between lines. + +% To make preamble: +% +% Either define widths of columns in terms of percent of \hsize: +% @multitable @columnfractions .25 .3 .45 +% @item ... +% +% Numbers following @columnfractions are the percent of the total +% current hsize to be used for each column. You may use as many +% columns as desired. + + +% Or use a template: +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item ... +% using the widest term desired in each column. + +% Each new table line starts with @item, each subsequent new column +% starts with @tab. Empty columns may be produced by supplying @tab's +% with nothing between them for as many times as empty columns are needed, +% ie, @tab@tab@tab will produce two empty columns. + +% @item, @tab do not need to be on their own lines, but it will not hurt +% if they are. + +% Sample multitable: + +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item first col stuff @tab second col stuff @tab third col +% @item +% first col stuff +% @tab +% second col stuff +% @tab +% third col +% @item first col stuff @tab second col stuff +% @tab Many paragraphs of text may be used in any column. +% +% They will wrap at the width determined by the template. +% @item@tab@tab This will be in third column. +% @end multitable + +% Default dimensions may be reset by user. +% @multitableparskip is vertical space between paragraphs in table. +% @multitableparindent is paragraph indent in table. +% @multitablecolmargin is horizontal space to be left between columns. +% @multitablelinespace is space to leave between table items, baseline +% to baseline. +% 0pt means it depends on current normal line spacing. +% +\newskip\multitableparskip +\newskip\multitableparindent +\newdimen\multitablecolspace +\newskip\multitablelinespace +\multitableparskip=0pt +\multitableparindent=6pt +\multitablecolspace=12pt +\multitablelinespace=0pt + +% Macros used to set up halign preamble: +% +\let\endsetuptable\relax +\def\xendsetuptable{\endsetuptable} +\let\columnfractions\relax +\def\xcolumnfractions{\columnfractions} +\newif\ifsetpercent + +% #1 is the @columnfraction, usually a decimal number like .5, but might +% be just 1. We just use it, whatever it is. +% +\def\pickupwholefraction#1 {% + \global\advance\colcount by 1 + \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% + \setuptable +} + +\newcount\colcount +\def\setuptable#1{% + \def\firstarg{#1}% + \ifx\firstarg\xendsetuptable + \let\go = \relax + \else + \ifx\firstarg\xcolumnfractions + \global\setpercenttrue + \else + \ifsetpercent + \let\go\pickupwholefraction + \else + \global\advance\colcount by 1 + \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a + % separator; typically that is always in the input, anyway. + \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% + \fi + \fi + \ifx\go\pickupwholefraction + % Put the argument back for the \pickupwholefraction call, so + % we'll always have a period there to be parsed. + \def\go{\pickupwholefraction#1}% + \else + \let\go = \setuptable + \fi% + \fi + \go +} + +% multitable-only commands. +% +% @headitem starts a heading row, which we typeset in bold. Assignments +% have to be global since we are inside the implicit group of an +% alignment entry. \everycr below resets \everytab so we don't have to +% undo it ourselves. +\def\headitemfont{\b}% for people to use in the template row; not changeable +\def\headitem{% + \checkenv\multitable + \crcr + \gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings + \global\everytab={\bf}% can't use \headitemfont since the parsing differs + \the\everytab % for the first item +}% +% +% default for tables with no headings. +\let\headitemcrhook=\relax +% +% A \tab used to include \hskip1sp. But then the space in a template +% line is not enough. That is bad. So let's go back to just `&' until +% we again encounter the problem the 1sp was intended to solve. +% --karl, nathan@acm.org, 20apr99. +\def\tab{\checkenv\multitable &\the\everytab}% + +% @multitable ... @end multitable definitions: +% +\newtoks\everytab % insert after every tab. +% +\envdef\multitable{% + \vskip\parskip + \startsavinginserts + % + % @item within a multitable starts a normal row. + % We use \def instead of \let so that if one of the multitable entries + % contains an @itemize, we don't choke on the \item (seen as \crcr aka + % \endtemplate) expanding \doitemize. + \def\item{\crcr}% + % + \tolerance=9500 + \hbadness=9500 + \setmultitablespacing + \parskip=\multitableparskip + \parindent=\multitableparindent + \overfullrule=0pt + \global\colcount=0 + % + \everycr = {% + \noalign{% + \global\everytab={}% Reset from possible headitem. + \global\colcount=0 % Reset the column counter. + % + % Check for saved footnotes, etc.: + \checkinserts + % + % Perhaps a \nobreak, then reset: + \headitemcrhook + \global\let\headitemcrhook=\relax + }% + }% + % + \parsearg\domultitable +} +\def\domultitable#1{% + % To parse everything between @multitable and @item: + \setuptable#1 \endsetuptable + % + % This preamble sets up a generic column definition, which will + % be used as many times as user calls for columns. + % \vtop will set a single line and will also let text wrap and + % continue for many paragraphs if desired. + \halign\bgroup &% + \global\advance\colcount by 1 + \multistrut + \vtop{% + % Use the current \colcount to find the correct column width: + \hsize=\expandafter\csname col\the\colcount\endcsname + % + % In order to keep entries from bumping into each other + % we will add a \leftskip of \multitablecolspace to all columns after + % the first one. + % + % If a template has been used, we will add \multitablecolspace + % to the width of each template entry. + % + % If the user has set preamble in terms of percent of \hsize we will + % use that dimension as the width of the column, and the \leftskip + % will keep entries from bumping into each other. Table will start at + % left margin and final column will justify at right margin. + % + % Make sure we don't inherit \rightskip from the outer environment. + \rightskip=0pt + \ifnum\colcount=1 + % The first column will be indented with the surrounding text. + \advance\hsize by\leftskip + \else + \ifsetpercent \else + % If user has not set preamble in terms of percent of \hsize + % we will advance \hsize by \multitablecolspace. + \advance\hsize by \multitablecolspace + \fi + % In either case we will make \leftskip=\multitablecolspace: + \leftskip=\multitablecolspace + \fi + % Ignoring space at the beginning and end avoids an occasional spurious + % blank line, when TeX decides to break the line at the space before the + % box from the multistrut, so the strut ends up on a line by itself. + % For example: + % @multitable @columnfractions .11 .89 + % @item @code{#} + % @tab Legal holiday which is valid in major parts of the whole country. + % Is automatically provided with highlighting sequences respectively + % marking characters. + \noindent\ignorespaces##\unskip\multistrut + }\cr +} +\def\Emultitable{% + \crcr + \egroup % end the \halign + \global\setpercentfalse +} + +\def\setmultitablespacing{% + \def\multistrut{\strut}% just use the standard line spacing + % + % Compute \multitablelinespace (if not defined by user) for use in + % \multitableparskip calculation. We used define \multistrut based on + % this, but (ironically) that caused the spacing to be off. + % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. +\ifdim\multitablelinespace=0pt +\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip +\global\advance\multitablelinespace by-\ht0 +\fi +% Test to see if parskip is larger than space between lines of +% table. If not, do nothing. +% If so, set to same dimension as multitablelinespace. +\ifdim\multitableparskip>\multitablelinespace +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller + % than skip between lines in the table. +\fi% +\ifdim\multitableparskip=0pt +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller + % than skip between lines in the table. +\fi} + + +\message{conditionals,} + +% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, +% @ifnotxml always succeed. They currently do nothing; we don't +% attempt to check whether the conditionals are properly nested. But we +% have to remember that they are conditionals, so that @end doesn't +% attempt to close an environment group. +% +\def\makecond#1{% + \expandafter\let\csname #1\endcsname = \relax + \expandafter\let\csname iscond.#1\endcsname = 1 +} +\makecond{iftex} +\makecond{ifnotdocbook} +\makecond{ifnothtml} +\makecond{ifnotinfo} +\makecond{ifnotplaintext} +\makecond{ifnotxml} + +% Ignore @ignore, @ifhtml, @ifinfo, and the like. +% +\def\direntry{\doignore{direntry}} +\def\documentdescription{\doignore{documentdescription}} +\def\docbook{\doignore{docbook}} +\def\html{\doignore{html}} +\def\ifdocbook{\doignore{ifdocbook}} +\def\ifhtml{\doignore{ifhtml}} +\def\ifinfo{\doignore{ifinfo}} +\def\ifnottex{\doignore{ifnottex}} +\def\ifplaintext{\doignore{ifplaintext}} +\def\ifxml{\doignore{ifxml}} +\def\ignore{\doignore{ignore}} +\def\menu{\doignore{menu}} +\def\xml{\doignore{xml}} + +% Ignore text until a line `@end #1', keeping track of nested conditionals. +% +% A count to remember the depth of nesting. +\newcount\doignorecount + +\def\doignore#1{\begingroup + % Scan in ``verbatim'' mode: + \obeylines + \catcode`\@ = \other + \catcode`\{ = \other + \catcode`\} = \other + % + % Make sure that spaces turn into tokens that match what \doignoretext wants. + \spaceisspace + % + % Count number of #1's that we've seen. + \doignorecount = 0 + % + % Swallow text until we reach the matching `@end #1'. + \dodoignore{#1}% +} + +{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. + \obeylines % + % + \gdef\dodoignore#1{% + % #1 contains the command name as a string, e.g., `ifinfo'. + % + % Define a command to find the next `@end #1'. + \long\def\doignoretext##1^^M@end #1{% + \doignoretextyyy##1^^M@#1\_STOP_}% + % + % And this command to find another #1 command, at the beginning of a + % line. (Otherwise, we would consider a line `@c @ifset', for + % example, to count as an @ifset for nesting.) + \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% + % + % And now expand that command. + \doignoretext ^^M% + }% +} + +\def\doignoreyyy#1{% + \def\temp{#1}% + \ifx\temp\empty % Nothing found. + \let\next\doignoretextzzz + \else % Found a nested condition, ... + \advance\doignorecount by 1 + \let\next\doignoretextyyy % ..., look for another. + % If we're here, #1 ends with ^^M\ifinfo (for example). + \fi + \next #1% the token \_STOP_ is present just after this macro. +} + +% We have to swallow the remaining "\_STOP_". +% +\def\doignoretextzzz#1{% + \ifnum\doignorecount = 0 % We have just found the outermost @end. + \let\next\enddoignore + \else % Still inside a nested condition. + \advance\doignorecount by -1 + \let\next\doignoretext % Look for the next @end. + \fi + \next +} + +% Finish off ignored text. +{ \obeylines% + % Ignore anything after the last `@end #1'; this matters in verbatim + % environments, where otherwise the newline after an ignored conditional + % would result in a blank line in the output. + \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% +} + + +% @set VAR sets the variable VAR to an empty value. +% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. +% +% Since we want to separate VAR from REST-OF-LINE (which might be +% empty), we can't just use \parsearg; we have to insert a space of our +% own to delimit the rest of the line, and then take it out again if we +% didn't need it. +% We rely on the fact that \parsearg sets \catcode`\ =10. +% +\parseargdef\set{\setyyy#1 \endsetyyy} +\def\setyyy#1 #2\endsetyyy{% + {% + \makevalueexpandable + \def\temp{#2}% + \edef\next{\gdef\makecsname{SET#1}}% + \ifx\temp\empty + \next{}% + \else + \setzzz#2\endsetzzz + \fi + }% +} +% Remove the trailing space \setxxx inserted. +\def\setzzz#1 \endsetzzz{\next{#1}} + +% @clear VAR clears (i.e., unsets) the variable VAR. +% +\parseargdef\clear{% + {% + \makevalueexpandable + \global\expandafter\let\csname SET#1\endcsname=\relax + }% +} + +% @value{foo} gets the text saved in variable foo. +\def\value{\begingroup\makevalueexpandable\valuexxx} +\def\valuexxx#1{\expandablevalue{#1}\endgroup} +{ + \catcode`\-=\active \catcode`\_=\active + % + \gdef\makevalueexpandable{% + \let\value = \expandablevalue + % We don't want these characters active, ... + \catcode`\-=\other \catcode`\_=\other + % ..., but we might end up with active ones in the argument if + % we're called from @code, as @code{@value{foo-bar_}}, though. + % So \let them to their normal equivalents. + \let-\normaldash \let_\normalunderscore + } +} + +% We have this subroutine so that we can handle at least some @value's +% properly in indexes (we call \makevalueexpandable in \indexdummies). +% The command has to be fully expandable (if the variable is set), since +% the result winds up in the index file. This means that if the +% variable's value contains other Texinfo commands, it's almost certain +% it will fail (although perhaps we could fix that with sufficient work +% to do a one-level expansion on the result, instead of complete). +% +% Unfortunately, this has the consequence that when _ is in the *value* +% of an @set, it does not print properly in the roman fonts (get the cmr +% dot accent at position 126 instead). No fix comes to mind, and it's +% been this way since 2003 or earlier, so just ignore it. +% +\def\expandablevalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + {[No value for ``#1'']}% + \message{Variable `#1', used in @value, is not set.}% + \else + \csname SET#1\endcsname + \fi +} + +% Like \expandablevalue, but completely expandable (the \message in the +% definition above operates at the execution level of TeX). Used when +% writing to auxiliary files, due to the expansion that \write does. +% If flag is undefined, pass through an unexpanded @value command: maybe it +% will be set by the time it is read back in. +% +% NB flag names containing - or _ may not work here. +\def\dummyvalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + \noexpand\value{#1}% + \else + \csname SET#1\endcsname + \fi +} + +% Used for @value's in index entries to form the sort key: expand the @value +% if possible, otherwise sort late. +\def\indexnofontsvalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + ZZZZZZZ + \else + \csname SET#1\endcsname + \fi +} + +% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined +% with @set. +% +% To get the special treatment we need for `@end ifset,' we call +% \makecond and then redefine. +% +\makecond{ifset} +\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} +\def\doifset#1#2{% + {% + \makevalueexpandable + \let\next=\empty + \expandafter\ifx\csname SET#2\endcsname\relax + #1% If not set, redefine \next. + \fi + \expandafter + }\next +} +\def\ifsetfail{\doignore{ifset}} + +% @ifclear VAR ... @end executes the `...' iff VAR has never been +% defined with @set, or has been undefined with @clear. +% +% The `\else' inside the `\doifset' parameter is a trick to reuse the +% above code: if the variable is not set, do nothing, if it is set, +% then redefine \next to \ifclearfail. +% +\makecond{ifclear} +\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} +\def\ifclearfail{\doignore{ifclear}} + +% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written +% without the @) is in fact defined. We can only feasibly check at the +% TeX level, so something like `mathcode' is going to considered +% defined even though it is not a Texinfo command. +% +\makecond{ifcommanddefined} +\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}} +% +\def\doifcmddefined#1#2{{% + \makevalueexpandable + \let\next=\empty + \expandafter\ifx\csname #2\endcsname\relax + #1% If not defined, \let\next as above. + \fi + \expandafter + }\next +} +\def\ifcmddefinedfail{\doignore{ifcommanddefined}} + +% @ifcommandnotdefined CMD ... handled similar to @ifclear above. +\makecond{ifcommandnotdefined} +\def\ifcommandnotdefined{% + \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}} +\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}} + +% Set the `txicommandconditionals' variable, so documents have a way to +% test if the @ifcommand...defined conditionals are available. +\set txicommandconditionals + +% @dircategory CATEGORY -- specify a category of the dir file +% which this file should belong to. Ignore this in TeX. +\let\dircategory=\comment + +% @defininfoenclose. +\let\definfoenclose=\comment + + +\message{indexing,} +% Index generation facilities + +% Define \newwrite to be identical to plain tex's \newwrite +% except not \outer, so it can be used within macros and \if's. +\edef\newwrite{\makecsname{ptexnewwrite}} + +% \newindex {foo} defines an index named IX. +% It automatically defines \IXindex such that +% \IXindex ...rest of line... puts an entry in the index IX. +% It also defines \IXindfile to be the number of the output channel for +% the file that accumulates this index. The file's extension is IX. +% The name of an index should be no more than 2 characters long +% for the sake of vms. +% +\def\newindex#1{% + \expandafter\chardef\csname#1indfile\endcsname=0 + \expandafter\xdef\csname#1index\endcsname{% % Define @#1index + \noexpand\doindex{#1}} +} + +% @defindex foo == \newindex{foo} +% +\def\defindex{\parsearg\newindex} + +% Define @defcodeindex, like @defindex except put all entries in @code. +% +\def\defcodeindex{\parsearg\newcodeindex} +% +\def\newcodeindex#1{% + \expandafter\chardef\csname#1indfile\endcsname=0 + \expandafter\xdef\csname#1index\endcsname{% + \noexpand\docodeindex{#1}}% +} + +% The default indices: +\newindex{cp}% concepts, +\newcodeindex{fn}% functions, +\newcodeindex{vr}% variables, +\newcodeindex{tp}% types, +\newcodeindex{ky}% keys +\newcodeindex{pg}% and programs. + + +% @synindex foo bar makes index foo feed into index bar. +% Do this instead of @defindex foo if you don't want it as a separate index. +% +% @syncodeindex foo bar similar, but put all entries made for index foo +% inside @code. +% +\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} +\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} + +% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), +% #3 the target index (bar). +\def\dosynindex#1#2#3{% + \requireopenindexfile{#3}% + % redefine \fooindfile: + \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname + \expandafter\let\csname#2indfile\endcsname=\temp + % redefine \fooindex: + \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% +} + +% Define \doindex, the driver for all index macros. +% Argument #1 is generated by the calling \fooindex macro, +% and it is the two-letter name of the index. + +\def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx} +\def\doindexxxx #1{\doind{\indexname}{#1}} + +% like the previous two, but they put @code around the argument. +\def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx} +\def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}} + + +% Used when writing an index entry out to an index file to prevent +% expansion of Texinfo commands that can appear in an index entry. +% +\def\indexdummies{% + \escapechar = `\\ % use backslash in output files. + \definedummyletter\@% + \definedummyletter\ % + % + % For texindex which always views { and } as separators. + \def\{{\lbracechar{}}% + \def\}{\rbracechar{}}% + % + % Do the redefinitions. + \definedummies +} + +% Used for the aux and toc files, where @ is the escape character. +% +\def\atdummies{% + \definedummyletter\@% + \definedummyletter\ % + \definedummyletter\{% + \definedummyletter\}% + % + % Do the redefinitions. + \definedummies + \otherbackslash +} + +% \definedummyword defines \#1 as \string\#1\space, thus effectively +% preventing its expansion. This is used only for control words, +% not control letters, because the \space would be incorrect for +% control characters, but is needed to separate the control word +% from whatever follows. +% +% These can be used both for control words that take an argument and +% those that do not. If it is followed by {arg} in the input, then +% that will dutifully get written to the index (or wherever). +% +% For control letters, we have \definedummyletter, which omits the +% space. +% +\def\definedummyword #1{\def#1{\string#1\space}}% +\def\definedummyletter#1{\def#1{\string#1}}% +\let\definedummyaccent\definedummyletter + +% Called from \indexdummies and \atdummies, to effectively prevent +% the expansion of commands. +% +\def\definedummies{% + % + \let\commondummyword\definedummyword + \let\commondummyletter\definedummyletter + \let\commondummyaccent\definedummyaccent + \commondummiesnofonts + % + \definedummyletter\_% + \definedummyletter\-% + % + % Non-English letters. + \definedummyword\AA + \definedummyword\AE + \definedummyword\DH + \definedummyword\L + \definedummyword\O + \definedummyword\OE + \definedummyword\TH + \definedummyword\aa + \definedummyword\ae + \definedummyword\dh + \definedummyword\exclamdown + \definedummyword\l + \definedummyword\o + \definedummyword\oe + \definedummyword\ordf + \definedummyword\ordm + \definedummyword\questiondown + \definedummyword\ss + \definedummyword\th + % + % Although these internal commands shouldn't show up, sometimes they do. + \definedummyword\bf + \definedummyword\gtr + \definedummyword\hat + \definedummyword\less + \definedummyword\sf + \definedummyword\sl + \definedummyword\tclose + \definedummyword\tt + % + \definedummyword\LaTeX + \definedummyword\TeX + % + % Assorted special characters. + \definedummyword\atchar + \definedummyword\arrow + \definedummyword\bullet + \definedummyword\comma + \definedummyword\copyright + \definedummyword\registeredsymbol + \definedummyword\dots + \definedummyword\enddots + \definedummyword\entrybreak + \definedummyword\equiv + \definedummyword\error + \definedummyword\euro + \definedummyword\expansion + \definedummyword\geq + \definedummyword\guillemetleft + \definedummyword\guillemetright + \definedummyword\guilsinglleft + \definedummyword\guilsinglright + \definedummyword\lbracechar + \definedummyword\leq + \definedummyword\mathopsup + \definedummyword\minus + \definedummyword\ogonek + \definedummyword\pounds + \definedummyword\point + \definedummyword\print + \definedummyword\quotedblbase + \definedummyword\quotedblleft + \definedummyword\quotedblright + \definedummyword\quoteleft + \definedummyword\quoteright + \definedummyword\quotesinglbase + \definedummyword\rbracechar + \definedummyword\result + \definedummyword\sub + \definedummyword\sup + \definedummyword\textdegree + % + % We want to disable all macros so that they are not expanded by \write. + \macrolist + \let\value\dummyvalue + % + \normalturnoffactive +} + +% \commondummiesnofonts: common to \definedummies and \indexnofonts. +% Define \commondummyletter, \commondummyaccent and \commondummyword before +% using. Used for accents, font commands, and various control letters. +% +\def\commondummiesnofonts{% + % Control letters and accents. + \commondummyletter\!% + \commondummyaccent\"% + \commondummyaccent\'% + \commondummyletter\*% + \commondummyaccent\,% + \commondummyletter\.% + \commondummyletter\/% + \commondummyletter\:% + \commondummyaccent\=% + \commondummyletter\?% + \commondummyaccent\^% + \commondummyaccent\`% + \commondummyaccent\~% + \commondummyword\u + \commondummyword\v + \commondummyword\H + \commondummyword\dotaccent + \commondummyword\ogonek + \commondummyword\ringaccent + \commondummyword\tieaccent + \commondummyword\ubaraccent + \commondummyword\udotaccent + \commondummyword\dotless + % + % Texinfo font commands. + \commondummyword\b + \commondummyword\i + \commondummyword\r + \commondummyword\sansserif + \commondummyword\sc + \commondummyword\slanted + \commondummyword\t + % + % Commands that take arguments. + \commondummyword\abbr + \commondummyword\acronym + \commondummyword\anchor + \commondummyword\cite + \commondummyword\code + \commondummyword\command + \commondummyword\dfn + \commondummyword\dmn + \commondummyword\email + \commondummyword\emph + \commondummyword\env + \commondummyword\file + \commondummyword\image + \commondummyword\indicateurl + \commondummyword\inforef + \commondummyword\kbd + \commondummyword\key + \commondummyword\math + \commondummyword\option + \commondummyword\pxref + \commondummyword\ref + \commondummyword\samp + \commondummyword\strong + \commondummyword\tie + \commondummyword\U + \commondummyword\uref + \commondummyword\url + \commondummyword\var + \commondummyword\verb + \commondummyword\w + \commondummyword\xref +} + +% For testing: output @{ and @} in index sort strings as \{ and \}. +\newif\ifusebracesinindexes + +\let\indexlbrace\relax +\let\indexrbrace\relax + +{\catcode`\@=0 +\catcode`\\=13 + @gdef@backslashdisappear{@def\{}} +} + +{ +\catcode`\<=13 +\catcode`\-=13 +\catcode`\`=13 + \gdef\indexnonalnumdisappear{% + \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax\else + % @set txiindexlquoteignore makes us ignore left quotes in the sort term. + % (Introduced for FSFS 2nd ed.) + \let`=\empty + \fi + % + \expandafter\ifx\csname SETtxiindexbackslashignore\endcsname\relax\else + \backslashdisappear + \fi + % + \expandafter\ifx\csname SETtxiindexhyphenignore\endcsname\relax\else + \def-{}% + \fi + \expandafter\ifx\csname SETtxiindexlessthanignore\endcsname\relax\else + \def<{}% + \fi + \expandafter\ifx\csname SETtxiindexatsignignore\endcsname\relax\else + \def\@{}% + \fi + } + + \gdef\indexnonalnumreappear{% + \useindexbackslash + \let-\normaldash + \let<\normalless + \def\@{@}% + } +} + + +% \indexnofonts is used when outputting the strings to sort the index +% by, and when constructing control sequence names. It eliminates all +% control sequences and just writes whatever the best ASCII sort string +% would be for a given command (usually its argument). +% +\def\indexnofonts{% + % Accent commands should become @asis. + \def\commondummyaccent##1{\let##1\asis}% + % We can just ignore other control letters. + \def\commondummyletter##1{\let##1\empty}% + % All control words become @asis by default; overrides below. + \let\commondummyword\commondummyaccent + \commondummiesnofonts + % + % Don't no-op \tt, since it isn't a user-level command + % and is used in the definitions of the active chars like <, >, |, etc. + % Likewise with the other plain tex font commands. + %\let\tt=\asis + % + \def\ { }% + \def\@{@}% + \def\_{\normalunderscore}% + \def\-{}% @- shouldn't affect sorting + % + \uccode`\1=`\{ \uppercase{\def\{{1}}% + \uccode`\1=`\} \uppercase{\def\}{1}}% + \let\lbracechar\{% + \let\rbracechar\}% + % + % Non-English letters. + \def\AA{AA}% + \def\AE{AE}% + \def\DH{DZZ}% + \def\L{L}% + \def\OE{OE}% + \def\O{O}% + \def\TH{TH}% + \def\aa{aa}% + \def\ae{ae}% + \def\dh{dzz}% + \def\exclamdown{!}% + \def\l{l}% + \def\oe{oe}% + \def\ordf{a}% + \def\ordm{o}% + \def\o{o}% + \def\questiondown{?}% + \def\ss{ss}% + \def\th{th}% + % + \def\LaTeX{LaTeX}% + \def\TeX{TeX}% + % + % Assorted special characters. \defglyph gives the control sequence a + % definition that removes the {} that follows its use. + \defglyph\atchar{@}% + \defglyph\arrow{->}% + \defglyph\bullet{bullet}% + \defglyph\comma{,}% + \defglyph\copyright{copyright}% + \defglyph\dots{...}% + \defglyph\enddots{...}% + \defglyph\equiv{==}% + \defglyph\error{error}% + \defglyph\euro{euro}% + \defglyph\expansion{==>}% + \defglyph\geq{>=}% + \defglyph\guillemetleft{<<}% + \defglyph\guillemetright{>>}% + \defglyph\guilsinglleft{<}% + \defglyph\guilsinglright{>}% + \defglyph\leq{<=}% + \defglyph\lbracechar{\{}% + \defglyph\minus{-}% + \defglyph\point{.}% + \defglyph\pounds{pounds}% + \defglyph\print{-|}% + \defglyph\quotedblbase{"}% + \defglyph\quotedblleft{"}% + \defglyph\quotedblright{"}% + \defglyph\quoteleft{`}% + \defglyph\quoteright{'}% + \defglyph\quotesinglbase{,}% + \defglyph\rbracechar{\}}% + \defglyph\registeredsymbol{R}% + \defglyph\result{=>}% + \defglyph\textdegree{o}% + % + % We need to get rid of all macros, leaving only the arguments (if present). + % Of course this is not nearly correct, but it is the best we can do for now. + % makeinfo does not expand macros in the argument to @deffn, which ends up + % writing an index entry, and texindex isn't prepared for an index sort entry + % that starts with \. + % + % Since macro invocations are followed by braces, we can just redefine them + % to take a single TeX argument. The case of a macro invocation that + % goes to end-of-line is not handled. + % + \macrolist + \let\value\indexnofontsvalue +} +\def\defglyph#1#2{\def#1##1{#2}} % see above + + + + +\let\SETmarginindex=\relax % put index entries in margin (undocumented)? + +% Most index entries go through here, but \dosubind is the general case. +% #1 is the index name, #2 is the entry text. +\def\doind#1#2{\dosubind{#1}{#2}{}} + +% There is also \dosubind {index}{topic}{subtopic} +% which makes an entry in a two-level index such as the operation index. +% TODO: Two-level index? Operation index? + +% Workhorse for all indexes. +% #1 is name of index, #2 is stuff to put there, #3 is subentry -- +% empty if called from \doind, as we usually are (the main exception +% is with most defuns, which call us directly). +% +\def\dosubind#1#2#3{% + \iflinks + {% + \requireopenindexfile{#1}% + % Store the main index entry text (including the third arg). + \toks0 = {#2}% + % If third arg is present, precede it with a space. + \def\thirdarg{#3}% + \ifx\thirdarg\empty \else + \toks0 = \expandafter{\the\toks0 \space #3}% + \fi + % + \edef\writeto{\csname#1indfile\endcsname}% + % + \safewhatsit\dosubindwrite + }% + \fi +} + +% Check if an index file has been opened, and if not, open it. +\def\requireopenindexfile#1{% +\ifnum\csname #1indfile\endcsname=0 + \expandafter\newwrite \csname#1indfile\endcsname + \edef\suffix{#1}% + % A .fls suffix would conflict with the file extension for the output + % of -recorder, so use .f1s instead. + \ifx\suffix\indexisfl\def\suffix{f1}\fi + % Open the file + \immediate\openout\csname#1indfile\endcsname \jobname.\suffix + % Using \immediate above here prevents an object entering into the current + % box, which could confound checks such as those in \safewhatsit for + % preceding skips. + \typeout{Writing index file \jobname.\suffix}% +\fi} +\def\indexisfl{fl} + +% Output \ as {\indexbackslash}, because \ is an escape character in +% the index files. +\let\indexbackslash=\relax +{\catcode`\@=0 \catcode`\\=\active + @gdef@useindexbackslash{@def\{{@indexbackslash}}} +} + +% Definition for writing index entry text. +\def\sortas#1{\ignorespaces}% + +% Definition for writing index entry sort key. Should occur at the at +% the beginning of the index entry, like +% @cindex @sortas{september} \september +% The \ignorespaces takes care of following space, but there's no way +% to remove space before it. +{ +\catcode`\-=13 +\gdef\indexwritesortas{% + \begingroup + \indexnonalnumreappear + \indexwritesortasxxx} +\gdef\indexwritesortasxxx#1{% + \xdef\indexsortkey{#1}\endgroup} +} + + +% Write the entry in \toks0 to the index file. +% +\def\dosubindwrite{% + % Put the index entry in the margin if desired. + \ifx\SETmarginindex\relax\else + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% + \fi + % + % Remember, we are within a group. + \indexdummies % Must do this here, since \bf, etc expand at this stage + \useindexbackslash % \indexbackslash isn't defined now so it will be output + % as is; and it will print as backslash. + % The braces around \indexbrace are recognized by texindex. + % + % Get the string to sort by, by processing the index entry with all + % font commands turned off. + {\indexnofonts + \def\lbracechar{{\indexlbrace}}% + \def\rbracechar{{\indexrbrace}}% + \let\{=\lbracechar + \let\}=\rbracechar + \indexnonalnumdisappear + \xdef\indexsortkey{}% + \let\sortas=\indexwritesortas + \edef\temp{\the\toks0}% + \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas + \ifx\indexsortkey\empty + \xdef\indexsortkey{\temp}% + \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi + \fi + }% + % + % Set up the complete index entry, with both the sort key and + % the original text, including any font commands. We write + % three arguments to \entry to the .?? file (four in the + % subentry case), texindex reduces to two when writing the .??s + % sorted result. + \edef\temp{% + \write\writeto{% + \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}% + }% + \temp +} +\newbox\dummybox % used above + +% Take care of unwanted page breaks/skips around a whatsit: +% +% If a skip is the last thing on the list now, preserve it +% by backing up by \lastskip, doing the \write, then inserting +% the skip again. Otherwise, the whatsit generated by the +% \write or \pdfdest will make \lastskip zero. The result is that +% sequences like this: +% @end defun +% @tindex whatever +% @defun ... +% will have extra space inserted, because the \medbreak in the +% start of the @defun won't see the skip inserted by the @end of +% the previous defun. +% +% But don't do any of this if we're not in vertical mode. We +% don't want to do a \vskip and prematurely end a paragraph. +% +% Avoid page breaks due to these extra skips, too. +% +% But wait, there is a catch there: +% We'll have to check whether \lastskip is zero skip. \ifdim is not +% sufficient for this purpose, as it ignores stretch and shrink parts +% of the skip. The only way seems to be to check the textual +% representation of the skip. +% +% The following is almost like \def\zeroskipmacro{0.0pt} except that +% the ``p'' and ``t'' characters have catcode \other, not 11 (letter). +% +\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} +% +\newskip\whatsitskip +\newcount\whatsitpenalty +% +% ..., ready, GO: +% +\def\safewhatsit#1{\ifhmode + #1% + \else + % \lastskip and \lastpenalty cannot both be nonzero simultaneously. + \whatsitskip = \lastskip + \edef\lastskipmacro{\the\lastskip}% + \whatsitpenalty = \lastpenalty + % + % If \lastskip is nonzero, that means the last item was a + % skip. And since a skip is discardable, that means this + % -\whatsitskip glue we're inserting is preceded by a + % non-discardable item, therefore it is not a potential + % breakpoint, therefore no \nobreak needed. + \ifx\lastskipmacro\zeroskipmacro + \else + \vskip-\whatsitskip + \fi + % + #1% + % + \ifx\lastskipmacro\zeroskipmacro + % If \lastskip was zero, perhaps the last item was a penalty, and + % perhaps it was >=10000, e.g., a \nobreak. In that case, we want + % to re-insert the same penalty (values >10000 are used for various + % signals); since we just inserted a non-discardable item, any + % following glue (such as a \parskip) would be a breakpoint. For example: + % @deffn deffn-whatever + % @vindex index-whatever + % Description. + % would allow a break between the index-whatever whatsit + % and the "Description." paragraph. + \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi + \else + % On the other hand, if we had a nonzero \lastskip, + % this make-up glue would be preceded by a non-discardable item + % (the whatsit from the \write), so we must insert a \nobreak. + \nobreak\vskip\whatsitskip + \fi +\fi} + +% The index entry written in the file actually looks like +% \entry {sortstring}{page}{topic} +% or +% \entry {sortstring}{page}{topic}{subtopic} +% The texindex program reads in these files and writes files +% containing these kinds of lines: +% \initial {c} +% before the first topic whose initial is c +% \entry {topic}{pagelist} +% for a topic that is used without subtopics +% \primary {topic} +% for the beginning of a topic that is used with subtopics +% \secondary {subtopic}{pagelist} +% for each subtopic. + +% Define the user-accessible indexing commands +% @findex, @vindex, @kindex, @cindex. + +\def\findex {\fnindex} +\def\kindex {\kyindex} +\def\cindex {\cpindex} +\def\vindex {\vrindex} +\def\tindex {\tpindex} +\def\pindex {\pgindex} + +\def\cindexsub {\begingroup\obeylines\cindexsub} +{\obeylines % +\gdef\cindexsub "#1" #2^^M{\endgroup % +\dosubind{cp}{#2}{#1}}} + +% Define the macros used in formatting output of the sorted index material. + +% @printindex causes a particular index (the ??s file) to get printed. +% It does not print any chapter heading (usually an @unnumbered). +% +\parseargdef\printindex{\begingroup + \dobreak \chapheadingskip{10000}% + % + \smallfonts \rm + \tolerance = 9500 + \plainfrenchspacing + \everypar = {}% don't want the \kern\-parindent from indentation suppression. + % + % See if the index file exists and is nonempty. + % Change catcode of @ here so that if the index file contains + % \initial {@} + % as its first line, TeX doesn't complain about mismatched braces + % (because it thinks @} is a control sequence). + \catcode`\@ = 12 + % See comment in \requireopenindexfile. + \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi + \openin 1 \jobname.\indexname s + \ifeof 1 + % \enddoublecolumns gets confused if there is no text in the index, + % and it loses the chapter title and the aux file entries for the + % index. The easiest way to prevent this problem is to make sure + % there is some text. + \putwordIndexNonexistent + \typeout{No file \jobname.\indexname s.}% + \else + \catcode`\\ = 0 + % + % If the index file exists but is empty, then \openin leaves \ifeof + % false. We have to make TeX try to read something from the file, so + % it can discover if there is anything in it. + \read 1 to \thisline + \ifeof 1 + \putwordIndexIsEmpty + \else + % Index files are almost Texinfo source, but we use \ as the escape + % character. It would be better to use @, but that's too big a change + % to make right now. + \def\indexbackslash{\ttbackslash}% + \let\indexlbrace\{ % Likewise, set these sequences for braces + \let\indexrbrace\} % used in the sort key. + \begindoublecolumns + \let\entrywidowpenalty=\indexwidowpenalty + % + % Read input from the index file line by line. + \loopdo + \ifeof1 + \let\firsttoken\relax + \else + \read 1 to \nextline + \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}% + \act + \fi + \thisline + % + \ifeof1\else + \let\thisline\nextline + \repeat + %% + \enddoublecolumns + \fi + \fi + \closein 1 +\endgroup} + +\def\getfirsttoken#1{\expandafter\getfirsttokenx#1\endfirsttoken} +\long\def\getfirsttokenx#1#2\endfirsttoken{\noexpand#1} + +\def\loopdo#1\repeat{\def\body{#1}\loopdoxxx} +\def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next} + +% These macros are used by the sorted index file itself. +% Change them to control the appearance of the index. + +{\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13 +\catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13 +\catcode`\$=3 +\gdef\initialglyphs{% + % Some changes for non-alphabetic characters. Using the glyphs from the + % math fonts looks more consistent than the typewriter font used elsewhere + % for these characters. + \def\indexbackslash{\math{\backslash}}% + \let\\=\indexbackslash + % + % Can't get bold backslash so don't use bold forward slash + \catcode`\/=13 + \def/{{\secrmnotbold \normalslash}}% + \def-{{\normaldash\normaldash}}% en dash `--' + \def^{{\chapbf \normalcaret}}% + \def~{{\chapbf \normaltilde}}% + \def\_{% + \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }% + \def|{$\vert$}% + \def<{$\less$}% + \def>{$\gtr$}% + \def+{$\normalplus$}% +}} + +\def\initial{% + \bgroup + \initialglyphs + \initialx +} + +\def\initialx#1{% + % Remove any glue we may have, we'll be inserting our own. + \removelastskip + % + % We like breaks before the index initials, so insert a bonus. + % The glue before the bonus allows a little bit of space at the + % bottom of a column to reduce an increase in inter-line spacing. + \nobreak + \vskip 0pt plus 5\baselineskip + \penalty -300 + \vskip 0pt plus -5\baselineskip + % + % Typeset the initial. Making this add up to a whole number of + % baselineskips increases the chance of the dots lining up from column + % to column. It still won't often be perfect, because of the stretch + % we need before each entry, but it's better. + % + % No shrink because it confuses \balancecolumns. + \vskip 1.67\baselineskip plus 1\baselineskip + \leftline{\secfonts \kern-0.05em \secbf #1}% + % \secfonts is inside the argument of \leftline so that the change of + % \baselineskip will not affect any glue inserted before the vbox that + % \leftline creates. + % Do our best not to break after the initial. + \nobreak + \vskip .33\baselineskip plus .1\baselineskip + \egroup % \initialglyphs +} + +\newdimen\entryrightmargin +\entryrightmargin=0pt + +% \entry typesets a paragraph consisting of the text (#1), dot leaders, and +% then page number (#2) flushed to the right margin. It is used for index +% and table of contents entries. The paragraph is indented by \leftskip. +% +\def\entry{% + \begingroup + % + % For pdfTeX and XeTeX. + % The redefinition of \domark stops marks being added in \pdflink to + % preserve coloured links across page boundaries. Otherwise the marks + % would get in the way of \lastbox in \insertindexentrybox. + \let\domark\relax + % + % Start a new paragraph if necessary, so our assignments below can't + % affect previous text. + \par + % + % No extra space above this paragraph. + \parskip = 0in + % + % When reading the text of entry, convert explicit line breaks + % from @* into spaces. The user might give these in long section + % titles, for instance. + \def\*{\unskip\space\ignorespaces}% + \def\entrybreak{\hfil\break}% An undocumented command + % + % Swallow the left brace of the text (first parameter): + \afterassignment\doentry + \let\temp = +} +\def\entrybreak{\unskip\space\ignorespaces}% +\def\doentry{% + % Save the text of the entry + \global\setbox\boxA=\hbox\bgroup + \bgroup % Instead of the swallowed brace. + \noindent + \aftergroup\finishentry + % And now comes the text of the entry. + % Not absorbing as a macro argument reduces the chance of problems + % with catcodes occurring. +} +{\catcode`\@=11 +\gdef\finishentry#1{% + \egroup % end box A + \dimen@ = \wd\boxA % Length of text of entry + \global\setbox\boxA=\hbox\bgroup\unhbox\boxA + % #1 is the page number. + % + % Get the width of the page numbers, and only use + % leaders if they are present. + \global\setbox\boxB = \hbox{#1}% + \ifdim\wd\boxB = 0pt + \null\nobreak\hfill\ % + \else + % + \null\nobreak\indexdotfill % Have leaders before the page number. + % + \ifpdf + \pdfgettoks#1.% + \hskip\skip\thinshrinkable\the\toksA + \else + \ifx\XeTeXrevision\thisisundefined + \hskip\skip\thinshrinkable #1% + \else + \pdfgettoks#1.% + \hskip\skip\thinshrinkable\the\toksA + \fi + \fi + \fi + \egroup % end \boxA + \ifdim\wd\boxB = 0pt + \global\setbox\entryindexbox=\vbox{\unhbox\boxA}% + \else + \global\setbox\entryindexbox=\vbox\bgroup + % We want the text of the entries to be aligned to the left, and the + % page numbers to be aligned to the right. + % + \parindent = 0pt + \advance\leftskip by 0pt plus 1fil + \advance\leftskip by 0pt plus -1fill + \rightskip = 0pt plus -1fil + \advance\rightskip by 0pt plus 1fill + % Cause last line, which could consist of page numbers on their own + % if the list of page numbers is long, to be aligned to the right. + \parfillskip=0pt plus -1fill + % + \advance\rightskip by \entryrightmargin + % Determine how far we can stretch into the margin. + % This allows, e.g., "Appendix H GNU Free Documentation License" to + % fit on one line in @letterpaper format. + \ifdim\entryrightmargin>2.1em + \dimen@i=2.1em + \else + \dimen@i=0em + \fi + \advance \parfillskip by 0pt minus 1\dimen@i + % + \dimen@ii = \hsize + \advance\dimen@ii by -1\leftskip + \advance\dimen@ii by -1\entryrightmargin + \advance\dimen@ii by 1\dimen@i + \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line + \ifdim\dimen@ > 0.8\dimen@ii % due to long index text + \dimen@ = 0.7\dimen@ % Try to split the text roughly evenly + \dimen@ii = \hsize + \ifnum\dimen@>\dimen@ii + % If the entry is too long, use the whole line + \dimen@ = \dimen@ii + \fi + \advance\leftskip by 0pt plus 1fill % ragged right + \advance \dimen@ by 1\rightskip + \parshape = 2 0pt \dimen@ 0em \dimen@ii + % Ideally we'd add a finite glue at the end of the first line only, + % instead of using \parshape with explicit line lengths, but TeX + % doesn't seem to provide a way to do such a thing. + % + \leftskip = 1em + \parindent = -1em + \fi\fi + \indent % start paragraph + \unhbox\boxA + % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 + % + % Word spacing - no stretch + \spaceskip=\fontdimen2\font minus \fontdimen4\font + % + \linepenalty=1000 % Discourage line breaks. + \hyphenpenalty=5000 % Discourage hyphenation. + % + \par % format the paragraph + \egroup % The \vbox + \fi + \endgroup + % delay text of entry until after penalty + \bgroup\aftergroup\insertindexentrybox + \entrywidowpenalty +}} + +\newskip\thinshrinkable +\skip\thinshrinkable=.15em minus .15em + +\newbox\entryindexbox +\def\insertindexentrybox{% + \ourunvbox\entryindexbox +} + +% Use \lastbox to take apart vbox box by box, and add each sub-box +% to the current vertical list. +\def\ourunvbox#1{% +\bgroup % for local binding of \delayedbox + % Remove the last box from box #1 + \global\setbox#1=\vbox{% + \unvbox#1% + \unskip % remove any glue + \unpenalty + \global\setbox\interbox=\lastbox + }% + \setbox\delayedbox=\box\interbox + \ifdim\ht#1=0pt\else + \ourunvbox#1 % Repeat on what's left of the box + \nobreak + \fi + \box\delayedbox +\egroup +} +\newbox\delayedbox +\newbox\interbox + +% Default is no penalty +\let\entrywidowpenalty\egroup + +% Used from \printindex. \firsttoken should be the first token +% after the \entry. If it's not another \entry, we are at the last +% line of a group of index entries, so insert a penalty to discourage +% widowed index entries. +\long\def\indexwidowpenalty{% + \def\isentry{\entry}% + \ifx\firsttoken\isentry + \else + \penalty 9000 + \fi + \egroup % now comes the box added with \aftergroup +} + +% Like plain.tex's \dotfill, except uses up at least 1 em. +% The filll stretch here overpowers both the fil and fill stretch to push +% the page number to the right. +\def\indexdotfill{\cleaders + \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll} + + +\def\primary #1{\line{#1\hfil}} + +\newskip\secondaryindent \secondaryindent=0.5cm +\def\secondary#1#2{{% + \parfillskip=0in + \parskip=0in + \hangindent=1in + \hangafter=1 + \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill + \ifpdf + \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + \else + \ifx\XeTeXrevision\thisisundefined + #2 + \else + \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + \fi + \fi + \par +}} + +% Define two-column mode, which we use to typeset indexes. +% Adapted from the TeXbook, page 416, which is to say, +% the manmac.tex format used to print the TeXbook itself. +\catcode`\@=11 % private names + +\newbox\partialpage +\newdimen\doublecolumnhsize + +% Use inside an output routine to save \topmark and \firstmark +\def\savemarks{% + \global\savedtopmark=\expandafter{\topmark }% + \global\savedfirstmark=\expandafter{\firstmark }% +} +\newtoks\savedtopmark +\newtoks\savedfirstmark + +% Set \topmark and \firstmark for next time \output runs. +% Can't be run from withinside \output (because any material +% added while an output routine is active, including +% penalties, is saved for after it finishes). The page so far +% should be empty, otherwise what's on it will be thrown away. +\def\restoremarks{% + \mark{\the\savedtopmark}% + \bgroup\output = {% + \setbox\dummybox=\box\PAGE + }abc\eject\egroup + % "abc" because output routine doesn't fire for a completely empty page. + \mark{\the\savedfirstmark}% +} + +\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns + % If not much space left on page, start a new page. + \ifdim\pagetotal>0.8\vsize\vfill\eject\fi + % + % Grab any single-column material above us. + \output = {% + % + % Here is a possibility not foreseen in manmac: if we accumulate a + % whole lot of material, we might end up calling this \output + % routine twice in a row (see the doublecol-lose test, which is + % essentially a couple of indexes with @setchapternewpage off). In + % that case we just ship out what is in \partialpage with the normal + % output routine. Generally, \partialpage will be empty when this + % runs and this will be a no-op. See the indexspread.tex test case. + \ifvoid\partialpage \else + \onepageout{\pagecontents\partialpage}% + \fi + % + \global\setbox\partialpage = \vbox{% + % Unvbox the main output page. + \unvbox\PAGE + \kern-\topskip \kern\baselineskip + }% + \savemarks + }% + \eject % run that output routine to set \partialpage + \restoremarks + % + % We recover the two marks that the last output routine saved in order + % to propagate the information in marks added around a chapter heading, + % which could be otherwise be lost by the time the final page is output. + % + % + % Use the double-column output routine for subsequent pages. + \output = {\doublecolumnout}% + % + % Change the page size parameters. We could do this once outside this + % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 + % format, but then we repeat the same computation. Repeating a couple + % of assignments once per index is clearly meaningless for the + % execution time, so we may as well do it in one place. + % + % First we halve the line length, less a little for the gutter between + % the columns. We compute the gutter based on the line length, so it + % changes automatically with the paper format. The magic constant + % below is chosen so that the gutter has the same value (well, +-<1pt) + % as it did when we hard-coded it. + % + % We put the result in a separate register, \doublecolumhsize, so we + % can restore it in \pagesofar, after \hsize itself has (potentially) + % been clobbered. + % + \doublecolumnhsize = \hsize + \advance\doublecolumnhsize by -.04154\hsize + \divide\doublecolumnhsize by 2 + \hsize = \doublecolumnhsize + % + % Double the \vsize as well. + \advance\vsize by -\ht\partialpage + \vsize = 2\vsize + % + % For the benefit of balancing columns + \advance\baselineskip by 0pt plus 0.5pt +} + +% The double-column output routine for all double-column pages except +% the last, which is done by \balancecolumns. +% +\def\doublecolumnout{% + % + \splittopskip=\topskip \splitmaxdepth=\maxdepth + % Get the available space for the double columns -- the normal + % (undoubled) page height minus any material left over from the + % previous page. + \dimen@ = \vsize + \divide\dimen@ by 2 + % + % box0 will be the left-hand column, box2 the right. + \setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@ + \global\advance\vsize by 2\ht\partialpage + \onepageout\pagesofar + \unvbox\PAGE + \penalty\outputpenalty +} +% +% Re-output the contents of the output page -- any previous material, +% followed by the two boxes we just split, in box0 and box2. +\def\pagesofar{% + \unvbox\partialpage + % + \hsize = \doublecolumnhsize + \wd0=\hsize \wd2=\hsize + \hbox to\txipagewidth{\box0\hfil\box2}% +} + + +% Finished with with double columns. +\def\enddoublecolumns{% + % The following penalty ensures that the page builder is exercised + % _before_ we change the output routine. This is necessary in the + % following situation: + % + % The last section of the index consists only of a single entry. + % Before this section, \pagetotal is less than \pagegoal, so no + % break occurs before the last section starts. However, the last + % section, consisting of \initial and the single \entry, does not + % fit on the page and has to be broken off. Without the following + % penalty the page builder will not be exercised until \eject + % below, and by that time we'll already have changed the output + % routine to the \balancecolumns version, so the next-to-last + % double-column page will be processed with \balancecolumns, which + % is wrong: The two columns will go to the main vertical list, with + % the broken-off section in the recent contributions. As soon as + % the output routine finishes, TeX starts reconsidering the page + % break. The two columns and the broken-off section both fit on the + % page, because the two columns now take up only half of the page + % goal. When TeX sees \eject from below which follows the final + % section, it invokes the new output routine that we've set after + % \balancecolumns below; \onepageout will try to fit the two columns + % and the final section into the vbox of \txipageheight (see + % \pagebody), causing an overfull box. + % + % Note that glue won't work here, because glue does not exercise the + % page builder, unlike penalties (see The TeXbook, pp. 280-281). + \penalty0 + % + \output = {% + % Split the last of the double-column material. + \savemarks + \balancecolumns + % + % Having called \balancecolumns once, we do not + % want to call it again. Therefore, reset \output to its normal + % definition right away. + \global\output = {\onepageout{\pagecontents\PAGE}}% + }% + \eject + \endgroup % started in \begindoublecolumns + \restoremarks + % Leave the double-column material on the current page, no automatic + % page break. + \box\balancedcolumns + % + % \pagegoal was set to the doubled \vsize above, since we restarted + % the current page. We're now back to normal single-column + % typesetting, so reset \pagegoal to the normal \vsize. + \global\vsize = \txipageheight % + \pagegoal = \txipageheight % +} +\newbox\balancedcolumns +\setbox\balancedcolumns=\vbox{shouldnt see this}% +% +% Only called for the last of the double column material. \doublecolumnout +% does the others. +\def\balancecolumns{% + \setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120. + \dimen@ = \ht0 + \advance\dimen@ by \topskip + \advance\dimen@ by-\baselineskip + \ifdim\dimen@<5\baselineskip + % Don't split a short final column in two. + \setbox2=\vbox{}% + \else + \divide\dimen@ by 2 % target to split to + \dimen@ii = \dimen@ + \splittopskip = \topskip + % Loop until left column is at least as high as the right column. + {% + \vbadness = 10000 + \loop + \global\setbox3 = \copy0 + \global\setbox1 = \vsplit3 to \dimen@ + \ifdim\ht1<\ht3 + \global\advance\dimen@ by 1pt + \repeat + }% + % Now the left column is in box 1, and the right column in box 3. + % Check whether the left column has come out higher than the page itself. + % (Note that we have doubled \vsize for the double columns, so + % the actual height of the page is 0.5\vsize). + \ifdim2\ht1>\vsize + % Just split the last of the double column material roughly in half. + \setbox2=\box0 + \setbox0 = \vsplit2 to \dimen@ii + \setbox0=\vbox to \dimen@ii {\unvbox0\vfill}% + \setbox2=\vbox to \dimen@ii {\unvbox2\vfill}% + \else + % Compare the heights of the two columns. + \ifdim4\ht1>5\ht3 + % Column heights are too different, so don't make their bottoms + % flush with each other. + \setbox2=\vbox to \ht1 {\unvbox3\vfill}% + \setbox0=\vbox to \ht1 {\unvbox1\vfill}% + \else + % Make column bottoms flush with each other. + \setbox2=\vbox to\ht1{\unvbox3\unskip}% + \setbox0=\vbox to\ht1{\unvbox1\unskip}% + \fi + \fi + \fi + % + \global\setbox\balancedcolumns=\vbox{\pagesofar}% +} +\catcode`\@ = \other + + +\message{sectioning,} +% Chapters, sections, etc. + +% Let's start with @part. +\outer\parseargdef\part{\partzzz{#1}} +\def\partzzz#1{% + \chapoddpage + \null + \vskip.3\vsize % move it down on the page a bit + \begingroup + \noindent \titlefonts\rm #1\par % the text + \let\lastnode=\empty % no node to associate with + \writetocentry{part}{#1}{}% but put it in the toc + \headingsoff % no headline or footline on the part page + % This outputs a mark at the end of the page that clears \thischapter + % and \thissection, as is done in \startcontents. + \let\pchapsepmacro\relax + \chapmacro{}{Yomitfromtoc}{}% + \chapoddpage + \endgroup +} + +% \unnumberedno is an oxymoron. But we count the unnumbered +% sections so that we can refer to them unambiguously in the pdf +% outlines by their "section number". We avoid collisions with chapter +% numbers by starting them at 10000. (If a document ever has 10000 +% chapters, we're in trouble anyway, I'm sure.) +\newcount\unnumberedno \unnumberedno = 10000 +\newcount\chapno +\newcount\secno \secno=0 +\newcount\subsecno \subsecno=0 +\newcount\subsubsecno \subsubsecno=0 + +% This counter is funny since it counts through charcodes of letters A, B, ... +\newcount\appendixno \appendixno = `\@ +% +% \def\appendixletter{\char\the\appendixno} +% We do the following ugly conditional instead of the above simple +% construct for the sake of pdftex, which needs the actual +% letter in the expansion, not just typeset. +% +\def\appendixletter{% + \ifnum\appendixno=`A A% + \else\ifnum\appendixno=`B B% + \else\ifnum\appendixno=`C C% + \else\ifnum\appendixno=`D D% + \else\ifnum\appendixno=`E E% + \else\ifnum\appendixno=`F F% + \else\ifnum\appendixno=`G G% + \else\ifnum\appendixno=`H H% + \else\ifnum\appendixno=`I I% + \else\ifnum\appendixno=`J J% + \else\ifnum\appendixno=`K K% + \else\ifnum\appendixno=`L L% + \else\ifnum\appendixno=`M M% + \else\ifnum\appendixno=`N N% + \else\ifnum\appendixno=`O O% + \else\ifnum\appendixno=`P P% + \else\ifnum\appendixno=`Q Q% + \else\ifnum\appendixno=`R R% + \else\ifnum\appendixno=`S S% + \else\ifnum\appendixno=`T T% + \else\ifnum\appendixno=`U U% + \else\ifnum\appendixno=`V V% + \else\ifnum\appendixno=`W W% + \else\ifnum\appendixno=`X X% + \else\ifnum\appendixno=`Y Y% + \else\ifnum\appendixno=`Z Z% + % The \the is necessary, despite appearances, because \appendixletter is + % expanded while writing the .toc file. \char\appendixno is not + % expandable, thus it is written literally, thus all appendixes come out + % with the same letter (or @) in the toc without it. + \else\char\the\appendixno + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} + +% Each @chapter defines these (using marks) as the number+name, number +% and name of the chapter. Page headings and footings can use +% these. @section does likewise. +\def\thischapter{} +\def\thischapternum{} +\def\thischaptername{} +\def\thissection{} +\def\thissectionnum{} +\def\thissectionname{} + +\newcount\absseclevel % used to calculate proper heading level +\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count + +% @raisesections: treat @section as chapter, @subsection as section, etc. +\def\raisesections{\global\advance\secbase by -1} +\let\up=\raisesections % original BFox name + +% @lowersections: treat @chapter as section, @section as subsection, etc. +\def\lowersections{\global\advance\secbase by 1} +\let\down=\lowersections % original BFox name + +% we only have subsub. +\chardef\maxseclevel = 3 +% +% A numbered section within an unnumbered changes to unnumbered too. +% To achieve this, remember the "biggest" unnum. sec. we are currently in: +\chardef\unnlevel = \maxseclevel +% +% Trace whether the current chapter is an appendix or not: +% \chapheadtype is "N" or "A", unnumbered chapters are ignored. +\def\chapheadtype{N} + +% Choose a heading macro +% #1 is heading type +% #2 is heading level +% #3 is text for heading +\def\genhead#1#2#3{% + % Compute the abs. sec. level: + \absseclevel=#2 + \advance\absseclevel by \secbase + % Make sure \absseclevel doesn't fall outside the range: + \ifnum \absseclevel < 0 + \absseclevel = 0 + \else + \ifnum \absseclevel > 3 + \absseclevel = 3 + \fi + \fi + % The heading type: + \def\headtype{#1}% + \if \headtype U% + \ifnum \absseclevel < \unnlevel + \chardef\unnlevel = \absseclevel + \fi + \else + % Check for appendix sections: + \ifnum \absseclevel = 0 + \edef\chapheadtype{\headtype}% + \else + \if \headtype A\if \chapheadtype N% + \errmessage{@appendix... within a non-appendix chapter}% + \fi\fi + \fi + % Check for numbered within unnumbered: + \ifnum \absseclevel > \unnlevel + \def\headtype{U}% + \else + \chardef\unnlevel = 3 + \fi + \fi + % Now print the heading: + \if \headtype U% + \ifcase\absseclevel + \unnumberedzzz{#3}% + \or \unnumberedseczzz{#3}% + \or \unnumberedsubseczzz{#3}% + \or \unnumberedsubsubseczzz{#3}% + \fi + \else + \if \headtype A% + \ifcase\absseclevel + \appendixzzz{#3}% + \or \appendixsectionzzz{#3}% + \or \appendixsubseczzz{#3}% + \or \appendixsubsubseczzz{#3}% + \fi + \else + \ifcase\absseclevel + \chapterzzz{#3}% + \or \seczzz{#3}% + \or \numberedsubseczzz{#3}% + \or \numberedsubsubseczzz{#3}% + \fi + \fi + \fi + \suppressfirstparagraphindent +} + +% an interface: +\def\numhead{\genhead N} +\def\apphead{\genhead A} +\def\unnmhead{\genhead U} + +% @chapter, @appendix, @unnumbered. Increment top-level counter, reset +% all lower-level sectioning counters to zero. +% +% Also set \chaplevelprefix, which we prepend to @float sequence numbers +% (e.g., figures), q.v. By default (before any chapter), that is empty. +\let\chaplevelprefix = \empty +% +\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz +\def\chapterzzz#1{% + % section resetting is \global in case the chapter is in a group, such + % as an @include file. + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\chapno by 1 + % + % Used for \float. + \gdef\chaplevelprefix{\the\chapno.}% + \resetallfloatnos + % + % \putwordChapter can contain complex things in translations. + \toks0=\expandafter{\putwordChapter}% + \message{\the\toks0 \space \the\chapno}% + % + % Write the actual heading. + \chapmacro{#1}{Ynumbered}{\the\chapno}% + % + % So @section and the like are numbered underneath this chapter. + \global\let\section = \numberedsec + \global\let\subsection = \numberedsubsec + \global\let\subsubsection = \numberedsubsubsec +} + +\outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz +% +\def\appendixzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\appendixno by 1 + \gdef\chaplevelprefix{\appendixletter.}% + \resetallfloatnos + % + % \putwordAppendix can contain complex things in translations. + \toks0=\expandafter{\putwordAppendix}% + \message{\the\toks0 \space \appendixletter}% + % + \chapmacro{#1}{Yappendix}{\appendixletter}% + % + \global\let\section = \appendixsec + \global\let\subsection = \appendixsubsec + \global\let\subsubsection = \appendixsubsubsec +} + +% normally unnmhead0 calls unnumberedzzz: +\outer\parseargdef\unnumbered{\unnmhead0{#1}} +\def\unnumberedzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\unnumberedno by 1 + % + % Since an unnumbered has no number, no prefix for figures. + \global\let\chaplevelprefix = \empty + \resetallfloatnos + % + % This used to be simply \message{#1}, but TeX fully expands the + % argument to \message. Therefore, if #1 contained @-commands, TeX + % expanded them. For example, in `@unnumbered The @cite{Book}', TeX + % expanded @cite (which turns out to cause errors because \cite is meant + % to be executed, not expanded). + % + % Anyway, we don't want the fully-expanded definition of @cite to appear + % as a result of the \message, we just want `@cite' itself. We use + % \the<toks register> to achieve this: TeX expands \the<toks> only once, + % simply yielding the contents of <toks register>. (We also do this for + % the toc entries.) + \toks0 = {#1}% + \message{(\the\toks0)}% + % + \chapmacro{#1}{Ynothing}{\the\unnumberedno}% + % + \global\let\section = \unnumberedsec + \global\let\subsection = \unnumberedsubsec + \global\let\subsubsection = \unnumberedsubsubsec +} + +% @centerchap is like @unnumbered, but the heading is centered. +\outer\parseargdef\centerchap{% + \let\centerparametersmaybe = \centerparameters + \unnmhead0{#1}% + \let\centerparametersmaybe = \relax +} + +% @top is like @unnumbered. +\let\top\unnumbered + +% Sections. +% +\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz +\def\seczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% +} + +% normally calls appendixsectionzzz: +\outer\parseargdef\appendixsection{\apphead1{#1}} +\def\appendixsectionzzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% +} +\let\appendixsec\appendixsection + +% normally calls unnumberedseczzz: +\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} +\def\unnumberedseczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% +} + +% Subsections. +% +% normally calls numberedsubseczzz: +\outer\parseargdef\numberedsubsec{\numhead2{#1}} +\def\numberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% +} + +% normally calls appendixsubseczzz: +\outer\parseargdef\appendixsubsec{\apphead2{#1}} +\def\appendixsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno}% +} + +% normally calls unnumberedsubseczzz: +\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} +\def\unnumberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno}% +} + +% Subsubsections. +% +% normally numberedsubsubseczzz: +\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} +\def\numberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynumbered}% + {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +% normally appendixsubsubseczzz: +\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} +\def\appendixsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +% normally unnumberedsubsubseczzz: +\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} +\def\unnumberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +% These macros control what the section commands do, according +% to what kind of chapter we are in (ordinary, appendix, or unnumbered). +% Define them by default for a numbered chapter. +\let\section = \numberedsec +\let\subsection = \numberedsubsec +\let\subsubsection = \numberedsubsubsec + +% Define @majorheading, @heading and @subheading + +\def\majorheading{% + {\advance\chapheadingskip by 10pt \chapbreak }% + \parsearg\chapheadingzzz +} + +\def\chapheading{\chapbreak \parsearg\chapheadingzzz} +\def\chapheadingzzz#1{% + \vbox{\chapfonts \raggedtitlesettings #1\par}% + \nobreak\bigskip \nobreak + \suppressfirstparagraphindent +} + +% @heading, @subheading, @subsubheading. +\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} + +% These macros generate a chapter, section, etc. heading only +% (including whitespace, linebreaking, etc. around it), +% given all the information in convenient, parsed form. + +% Args are the skip and penalty (usually negative) +\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} + +% Parameter controlling skip before chapter headings (if needed) +\newskip\chapheadingskip + +% Define plain chapter starts, and page on/off switching for it. +\def\chapbreak{\dobreak \chapheadingskip {-4000}} + +% Start a new page +\def\chappager{\par\vfill\supereject} + +% \chapoddpage - start on an odd page for a new chapter +% Because \domark is called before \chapoddpage, the filler page will +% get the headings for the next chapter, which is wrong. But we don't +% care -- we just disable all headings on the filler page. +\def\chapoddpage{% + \chappager + \ifodd\pageno \else + \begingroup + \headingsoff + \null + \chappager + \endgroup + \fi +} + +\parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname} + +\def\CHAPPAGoff{% +\global\let\contentsalignmacro = \chappager +\global\let\pchapsepmacro=\chapbreak +\global\let\pagealignmacro=\chappager} + +\def\CHAPPAGon{% +\global\let\contentsalignmacro = \chappager +\global\let\pchapsepmacro=\chappager +\global\let\pagealignmacro=\chappager +\global\def\HEADINGSon{\HEADINGSsingle}} + +\def\CHAPPAGodd{% +\global\let\contentsalignmacro = \chapoddpage +\global\let\pchapsepmacro=\chapoddpage +\global\let\pagealignmacro=\chapoddpage +\global\def\HEADINGSon{\HEADINGSdouble}} + +\CHAPPAGon + +% \chapmacro - Chapter opening. +% +% #1 is the text, #2 is the section type (Ynumbered, Ynothing, +% Yappendix, Yomitfromtoc), #3 the chapter number. +% Not used for @heading series. +% +% To test against our argument. +\def\Ynothingkeyword{Ynothing} +\def\Yappendixkeyword{Yappendix} +\def\Yomitfromtockeyword{Yomitfromtoc} +% +\def\chapmacro#1#2#3{% + \expandafter\ifx\thisenv\titlepage\else + \checkenv{}% chapters, etc., should not start inside an environment. + \fi + % FIXME: \chapmacro is currently called from inside \titlepage when + % \setcontentsaftertitlepage to print the "Table of Contents" heading, but + % this should probably be done by \sectionheading with an option to print + % in chapter size. + % + % Insert the first mark before the heading break (see notes for \domark). + \let\prevchapterdefs=\lastchapterdefs + \let\prevsectiondefs=\lastsectiondefs + \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% + \gdef\thissection{}}% + % + \def\temptype{#2}% + \ifx\temptype\Ynothingkeyword + \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\thischapter{\thischaptername}}% + \else\ifx\temptype\Yomitfromtockeyword + \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\thischapter{}}% + \else\ifx\temptype\Yappendixkeyword + \toks0={#1}% + \xdef\lastchapterdefs{% + \gdef\noexpand\thischaptername{\the\toks0}% + \gdef\noexpand\thischapternum{\appendixletter}% + % \noexpand\putwordAppendix avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thischapter{\noexpand\putwordAppendix{} + \noexpand\thischapternum: + \noexpand\thischaptername}% + }% + \else + \toks0={#1}% + \xdef\lastchapterdefs{% + \gdef\noexpand\thischaptername{\the\toks0}% + \gdef\noexpand\thischapternum{\the\chapno}% + % \noexpand\putwordChapter avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thischapter{\noexpand\putwordChapter{} + \noexpand\thischapternum: + \noexpand\thischaptername}% + }% + \fi\fi\fi + % + % Output the mark. Pass it through \safewhatsit, to take care of + % the preceding space. + \safewhatsit\domark + % + % Insert the chapter heading break. + \pchapsepmacro + % + % Now the second mark, after the heading break. No break points + % between here and the heading. + \let\prevchapterdefs=\lastchapterdefs + \let\prevsectiondefs=\lastsectiondefs + \domark + % + {% + \chapfonts \rm + \let\footnote=\errfootnoteheading % give better error message + % + % Have to define \lastsection before calling \donoderef, because the + % xref code eventually uses it. On the other hand, it has to be called + % after \pchapsepmacro, or the headline will change too soon. + \gdef\lastsection{#1}% + % + % Only insert the separating space if we have a chapter/appendix + % number, and don't print the unnumbered ``number''. + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unnchap}% + \else\ifx\temptype\Yomitfromtockeyword + \setbox0 = \hbox{}% contents like unnumbered, but no toc entry + \def\toctype{omit}% + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% + \def\toctype{app}% + \else + \setbox0 = \hbox{#3\enspace}% + \def\toctype{numchap}% + \fi\fi\fi + % + % Write the toc entry for this chapter. Must come before the + % \donoderef, because we include the current node name in the toc + % entry, and \donoderef resets it to empty. + \writetocentry{\toctype}{#1}{#3}% + % + % For pdftex, we have to write out the node definition (aka, make + % the pdfdest) after any page break, but before the actual text has + % been typeset. If the destination for the pdf outline is after the + % text, then jumping from the outline may wind up with the text not + % being visible, for instance under high magnification. + \donoderef{#2}% + % + % Typeset the actual heading. + \nobreak % Avoid page breaks at the interline glue. + \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe + \unhbox0 #1\par}% + }% + \nobreak\bigskip % no page break after a chapter title + \nobreak +} + +% @centerchap -- centered and unnumbered. +\let\centerparametersmaybe = \relax +\def\centerparameters{% + \advance\rightskip by 3\rightskip + \leftskip = \rightskip + \parfillskip = 0pt +} + + +% Section titles. These macros combine the section number parts and +% call the generic \sectionheading to do the printing. +% +\newskip\secheadingskip +\def\secheadingbreak{\dobreak \secheadingskip{-1000}} + +% Subsection titles. +\newskip\subsecheadingskip +\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} + +% Subsubsection titles. +\def\subsubsecheadingskip{\subsecheadingskip} +\def\subsubsecheadingbreak{\subsecheadingbreak} + + +% Print any size, any type, section title. +% +% #1 is the text of the title, +% #2 is the section level (sec/subsec/subsubsec), +% #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc), +% #4 is the section number. +% +\def\seckeyword{sec} +% +\def\sectionheading#1#2#3#4{% + {% + \def\sectionlevel{#2}% + \def\temptype{#3}% + % + % It is ok for the @heading series commands to appear inside an + % environment (it's been historically allowed, though the logic is + % dubious), but not the others. + \ifx\temptype\Yomitfromtockeyword\else + \checkenv{}% non-@*heading should not be in an environment. + \fi + \let\footnote=\errfootnoteheading + % + % Switch to the right set of fonts. + \csname #2fonts\endcsname \rm + % + % Insert first mark before the heading break (see notes for \domark). + \let\prevsectiondefs=\lastsectiondefs + \ifx\temptype\Ynothingkeyword + \ifx\sectionlevel\seckeyword + \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% + \gdef\thissection{\thissectionname}}% + \fi + \else\ifx\temptype\Yomitfromtockeyword + % Don't redefine \thissection. + \else\ifx\temptype\Yappendixkeyword + \ifx\sectionlevel\seckeyword + \toks0={#1}% + \xdef\lastsectiondefs{% + \gdef\noexpand\thissectionname{\the\toks0}% + \gdef\noexpand\thissectionnum{#4}% + % \noexpand\putwordSection avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thissection{\noexpand\putwordSection{} + \noexpand\thissectionnum: + \noexpand\thissectionname}% + }% + \fi + \else + \ifx\sectionlevel\seckeyword + \toks0={#1}% + \xdef\lastsectiondefs{% + \gdef\noexpand\thissectionname{\the\toks0}% + \gdef\noexpand\thissectionnum{#4}% + % \noexpand\putwordSection avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thissection{\noexpand\putwordSection{} + \noexpand\thissectionnum: + \noexpand\thissectionname}% + }% + \fi + \fi\fi\fi + % + % Go into vertical mode. Usually we'll already be there, but we + % don't want the following whatsit to end up in a preceding paragraph + % if the document didn't happen to have a blank line. + \par + % + % Output the mark. Pass it through \safewhatsit, to take care of + % the preceding space. + \safewhatsit\domark + % + % Insert space above the heading. + \csname #2headingbreak\endcsname + % + % Now the second mark, after the heading break. No break points + % between here and the heading. + \global\let\prevsectiondefs=\lastsectiondefs + \domark + % + % Only insert the space after the number if we have a section number. + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unn}% + \gdef\lastsection{#1}% + \else\ifx\temptype\Yomitfromtockeyword + % for @headings -- no section number, don't include in toc, + % and don't redefine \lastsection. + \setbox0 = \hbox{}% + \def\toctype{omit}% + \let\sectionlevel=\empty + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{#4\enspace}% + \def\toctype{app}% + \gdef\lastsection{#1}% + \else + \setbox0 = \hbox{#4\enspace}% + \def\toctype{num}% + \gdef\lastsection{#1}% + \fi\fi\fi + % + % Write the toc entry (before \donoderef). See comments in \chapmacro. + \writetocentry{\toctype\sectionlevel}{#1}{#4}% + % + % Write the node reference (= pdf destination for pdftex). + % Again, see comments in \chapmacro. + \donoderef{#3}% + % + % Interline glue will be inserted when the vbox is completed. + % That glue will be a valid breakpoint for the page, since it'll be + % preceded by a whatsit (usually from the \donoderef, or from the + % \writetocentry if there was no node). We don't want to allow that + % break, since then the whatsits could end up on page n while the + % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. + \nobreak + % + % Output the actual section heading. + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright + \hangindent=\wd0 % zero if no section number + \unhbox0 #1}% + }% + % Add extra space after the heading -- half of whatever came above it. + % Don't allow stretch, though. + \kern .5 \csname #2headingskip\endcsname + % + % Do not let the kern be a potential breakpoint, as it would be if it + % was followed by glue. + \nobreak + % + % We'll almost certainly start a paragraph next, so don't let that + % glue accumulate. (Not a breakpoint because it's preceded by a + % discardable item.) However, when a paragraph is not started next + % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out + % or the negative glue will cause weirdly wrong output, typically + % obscuring the section heading with something else. + \vskip-\parskip + % + % This is so the last item on the main vertical list is a known + % \penalty > 10000, so \startdefun, etc., can recognize the situation + % and do the needful. + \penalty 10001 +} + + +\message{toc,} +% Table of contents. +\newwrite\tocfile + +% Write an entry to the toc file, opening it if necessary. +% Called from @chapter, etc. +% +% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} +% We append the current node name (if any) and page number as additional +% arguments for the \{chap,sec,...}entry macros which will eventually +% read this. The node name is used in the pdf outlines as the +% destination to jump to. +% +% We open the .toc file for writing here instead of at @setfilename (or +% any other fixed time) so that @contents can be anywhere in the document. +% But if #1 is `omit', then we don't do anything. This is used for the +% table of contents chapter openings themselves. +% +\newif\iftocfileopened +\def\omitkeyword{omit}% +% +\def\writetocentry#1#2#3{% + \edef\writetoctype{#1}% + \ifx\writetoctype\omitkeyword \else + \iftocfileopened\else + \immediate\openout\tocfile = \jobname.toc + \global\tocfileopenedtrue + \fi + % + \iflinks + {\atdummies + \edef\temp{% + \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% + \temp + }% + \fi + \fi + % + % Tell \shipout to create a pdf destination on each page, if we're + % writing pdf. These are used in the table of contents. We can't + % just write one on every page because the title pages are numbered + % 1 and 2 (the page numbers aren't printed), and so are the first + % two pages of the document. Thus, we'd have two destinations named + % `1', and two named `2'. + \ifpdf + \global\pdfmakepagedesttrue + \else + \ifx\XeTeXrevision\thisisundefined + \else + \global\pdfmakepagedesttrue + \fi + \fi +} + + +% These characters do not print properly in the Computer Modern roman +% fonts, so we must take special care. This is more or less redundant +% with the Texinfo input format setup at the end of this file. +% +\def\activecatcodes{% + \catcode`\"=\active + \catcode`\$=\active + \catcode`\<=\active + \catcode`\>=\active + \catcode`\\=\active + \catcode`\^=\active + \catcode`\_=\active + \catcode`\|=\active + \catcode`\~=\active +} + + +% Read the toc file, which is essentially Texinfo input. +\def\readtocfile{% + \setupdatafile + \activecatcodes + \input \tocreadfilename +} + +\newskip\contentsrightmargin \contentsrightmargin=1in +\newcount\savepageno +\newcount\lastnegativepageno \lastnegativepageno = -1 + +% Prepare to read what we've written to \tocfile. +% +\def\startcontents#1{% + % If @setchapternewpage on, and @headings double, the contents should + % start on an odd page, unlike chapters. Thus, we maintain + % \contentsalignmacro in parallel with \pagealignmacro. + % From: Torbjorn Granlund <tege@matematik.su.se> + \contentsalignmacro + \immediate\closeout\tocfile + % + % Don't need to put `Contents' or `Short Contents' in the headline. + % It is abundantly clear what they are. + \chapmacro{#1}{Yomitfromtoc}{}% + % + \savepageno = \pageno + \begingroup % Set up to handle contents files properly. + \raggedbottom % Worry more about breakpoints than the bottom. + \entryrightmargin=\contentsrightmargin % Don't use the full line length. + % + % Roman numerals for page numbers. + \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi +} + +% redefined for the two-volume lispref. We always output on +% \jobname.toc even if this is redefined. +% +\def\tocreadfilename{\jobname.toc} + +% Normal (long) toc. +% +\def\contents{% + \startcontents{\putwordTOC}% + \openin 1 \tocreadfilename\space + \ifeof 1 \else + \readtocfile + \fi + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \ifeof 1 \else + \pdfmakeoutlines + \fi + \closein 1 + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno +} + +% And just the chapters. +\def\summarycontents{% + \startcontents{\putwordShortTOC}% + % + \let\partentry = \shortpartentry + \let\numchapentry = \shortchapentry + \let\appentry = \shortchapentry + \let\unnchapentry = \shortunnchapentry + % We want a true roman here for the page numbers. + \secfonts + \let\rm=\shortcontrm \let\bf=\shortcontbf + \let\sl=\shortcontsl \let\tt=\shortconttt + \rm + \hyphenpenalty = 10000 + \advance\baselineskip by 1pt % Open it up a little. + \def\numsecentry##1##2##3##4{} + \let\appsecentry = \numsecentry + \let\unnsecentry = \numsecentry + \let\numsubsecentry = \numsecentry + \let\appsubsecentry = \numsecentry + \let\unnsubsecentry = \numsecentry + \let\numsubsubsecentry = \numsecentry + \let\appsubsubsecentry = \numsecentry + \let\unnsubsubsecentry = \numsecentry + \openin 1 \tocreadfilename\space + \ifeof 1 \else + \readtocfile + \fi + \closein 1 + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno +} +\let\shortcontents = \summarycontents + +% Typeset the label for a chapter or appendix for the short contents. +% The arg is, e.g., `A' for an appendix, or `3' for a chapter. +% +\def\shortchaplabel#1{% + % This space should be enough, since a single number is .5em, and the + % widest letter (M) is 1em, at least in the Computer Modern fonts. + % But use \hss just in case. + % (This space doesn't include the extra space that gets added after + % the label; that gets put in by \shortchapentry above.) + % + % We'd like to right-justify chapter numbers, but that looks strange + % with appendix letters. And right-justifying numbers and + % left-justifying letters looks strange when there is less than 10 + % chapters. Have to read the whole toc once to know how many chapters + % there are before deciding ... + \hbox to 1em{#1\hss}% +} + +% These macros generate individual entries in the table of contents. +% The first argument is the chapter or section name. +% The last argument is the page number. +% The arguments in between are the chapter number, section number, ... + +% Parts, in the main contents. Replace the part number, which doesn't +% exist, with an empty box. Let's hope all the numbers have the same width. +% Also ignore the page number, which is conventionally not printed. +\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} +\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}} +% +% Parts, in the short toc. +\def\shortpartentry#1#2#3#4{% + \penalty-300 + \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip + \shortchapentry{{\bf #1}}{\numeralbox}{}{}% +} + +% Chapters, in the main contents. +\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} + +% Chapters, in the short toc. +% See comments in \dochapentry re vbox and related settings. +\def\shortchapentry#1#2#3#4{% + \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% +} + +% Appendices, in the main contents. +% Need the word Appendix, and a fixed-size box. +% +\def\appendixbox#1{% + % We use M since it's probably the widest letter. + \setbox0 = \hbox{\putwordAppendix{} M}% + \hbox to \wd0{\putwordAppendix{} #1\hss}} +% +\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\hskip.7em#1}{#4}} + +% Unnumbered chapters. +\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} +\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} + +% Sections. +\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} +\let\appsecentry=\numsecentry +\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} + +% Subsections. +\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} +\let\appsubsecentry=\numsubsecentry +\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} + +% And subsubsections. +\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} +\let\appsubsubsecentry=\numsubsubsecentry +\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} + +% This parameter controls the indentation of the various levels. +% Same as \defaultparindent. +\newdimen\tocindent \tocindent = 15pt + +% Now for the actual typesetting. In all these, #1 is the text and #2 is the +% page number. +% +% If the toc has to be broken over pages, we want it to be at chapters +% if at all possible; hence the \penalty. +\def\dochapentry#1#2{% + \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip + \begingroup + % Move the page numbers slightly to the right + \advance\entryrightmargin by -0.05em + \chapentryfonts + \tocentry{#1}{\dopageno\bgroup#2\egroup}% + \endgroup + \nobreak\vskip .25\baselineskip plus.1\baselineskip +} + +\def\dosecentry#1#2{\begingroup + \secentryfonts \leftskip=\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsecentry#1#2{\begingroup + \subsecentryfonts \leftskip=2\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsubsecentry#1#2{\begingroup + \subsubsecentryfonts \leftskip=3\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +% We use the same \entry macro as for the index entries. +\let\tocentry = \entry + +% Space between chapter (or whatever) number and the title. +\def\labelspace{\hskip1em \relax} + +\def\dopageno#1{{\rm #1}} +\def\doshortpageno#1{{\rm #1}} + +\def\chapentryfonts{\secfonts \rm} +\def\secentryfonts{\textfonts} +\def\subsecentryfonts{\textfonts} +\def\subsubsecentryfonts{\textfonts} + + +\message{environments,} +% @foo ... @end foo. + +% @tex ... @end tex escapes into raw TeX temporarily. +% One exception: @ is still an escape character, so that @end tex works. +% But \@ or @@ will get a plain @ character. + +\envdef\tex{% + \setupmarkupstyle{tex}% + \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 + \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 + \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie + \catcode `\%=14 + \catcode `\+=\other + \catcode `\"=\other + \catcode `\|=\other + \catcode `\<=\other + \catcode `\>=\other + \catcode `\`=\other + \catcode `\'=\other + % + % ' is active in math mode (mathcode"8000). So reset it, and all our + % other math active characters (just in case), to plain's definitions. + \mathactive + % + % Inverse of the list at the beginning of the file. + \let\b=\ptexb + \let\bullet=\ptexbullet + \let\c=\ptexc + \let\,=\ptexcomma + \let\.=\ptexdot + \let\dots=\ptexdots + \let\equiv=\ptexequiv + \let\!=\ptexexclam + \let\i=\ptexi + \let\indent=\ptexindent + \let\noindent=\ptexnoindent + \let\{=\ptexlbrace + \let\+=\tabalign + \let\}=\ptexrbrace + \let\/=\ptexslash + \let\sp=\ptexsp + \let\*=\ptexstar + %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode + \let\t=\ptext + \expandafter \let\csname top\endcsname=\ptextop % we've made it outer + \let\frenchspacing=\plainfrenchspacing + % + \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% + \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% + \def\@{@}% +} +% There is no need to define \Etex. + +% Define @lisp ... @end lisp. +% @lisp environment forms a group so it can rebind things, +% including the definition of @end lisp (which normally is erroneous). + +% Amount to narrow the margins by for @lisp. +\newskip\lispnarrowing \lispnarrowing=0.4in + +% This is the definition that ^^M gets inside @lisp, @example, and other +% such environments. \null is better than a space, since it doesn't +% have any width. +\def\lisppar{\null\endgraf} + +% This space is always present above and below environments. +\newskip\envskipamount \envskipamount = 0pt + +% Make spacing and below environment symmetrical. We use \parskip here +% to help in doing that, since in @example-like environments \parskip +% is reset to zero; thus the \afterenvbreak inserts no space -- but the +% start of the next paragraph will insert \parskip. +% +\def\aboveenvbreak{{% + % =10000 instead of <10000 because of a special case in \itemzzz and + % \sectionheading, q.v. + \ifnum \lastpenalty=10000 \else + \advance\envskipamount by \parskip + \endgraf + \ifdim\lastskip<\envskipamount + \removelastskip + \ifnum\lastpenalty<10000 + % Penalize breaking before the environment, because preceding text + % often leads into it. + \penalty100 + \fi + \vskip\envskipamount + \fi + \fi +}} + +\def\afterenvbreak{{% + % =10000 instead of <10000 because of a special case in \itemzzz and + % \sectionheading, q.v. + \ifnum \lastpenalty=10000 \else + \advance\envskipamount by \parskip + \endgraf + \ifdim\lastskip<\envskipamount + \removelastskip + % it's not a good place to break if the last penalty was \nobreak + % or better ... + \ifnum\lastpenalty<10000 \penalty-50 \fi + \vskip\envskipamount + \fi + \fi +}} + +% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will +% also clear it, so that its embedded environments do the narrowing again. +\let\nonarrowing=\relax + +% @cartouche ... @end cartouche: draw rectangle w/rounded corners around +% environment contents. +\font\circle=lcircle10 +\newdimen\circthick +\newdimen\cartouter\newdimen\cartinner +\newskip\normbskip\newskip\normpskip\newskip\normlskip +\circthick=\fontdimen8\circle +% +\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth +\def\ctr{{\hskip 6pt\circle\char'010}} +\def\cbl{{\circle\char'012\hskip -6pt}} +\def\cbr{{\hskip 6pt\circle\char'011}} +\def\carttop{\hbox to \cartouter{\hskip\lskip + \ctl\leaders\hrule height\circthick\hfil\ctr + \hskip\rskip}} +\def\cartbot{\hbox to \cartouter{\hskip\lskip + \cbl\leaders\hrule height\circthick\hfil\cbr + \hskip\rskip}} +% +\newskip\lskip\newskip\rskip + +\envdef\cartouche{% + \ifhmode\par\fi % can't be in the midst of a paragraph. + \startsavinginserts + \lskip=\leftskip \rskip=\rightskip + \leftskip=0pt\rightskip=0pt % we want these *outside*. + \cartinner=\hsize \advance\cartinner by-\lskip + \advance\cartinner by-\rskip + \cartouter=\hsize + \advance\cartouter by 18.4pt % allow for 3pt kerns on either + % side, and for 6pt waste from + % each corner char, and rule thickness + \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip + % + % If this cartouche directly follows a sectioning command, we need the + % \parskip glue (backspaced over by default) or the cartouche can + % collide with the section heading. + \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi + % + \setbox\groupbox=\vbox\bgroup + \baselineskip=0pt\parskip=0pt\lineskip=0pt + \carttop + \hbox\bgroup + \hskip\lskip + \vrule\kern3pt + \vbox\bgroup + \kern3pt + \hsize=\cartinner + \baselineskip=\normbskip + \lineskip=\normlskip + \parskip=\normpskip + \vskip -\parskip + \comment % For explanation, see the end of def\group. +} +\def\Ecartouche{% + \ifhmode\par\fi + \kern3pt + \egroup + \kern3pt\vrule + \hskip\rskip + \egroup + \cartbot + \egroup + \addgroupbox + \checkinserts +} + + +% This macro is called at the beginning of all the @example variants, +% inside a group. +\newdimen\nonfillparindent +\def\nonfillstart{% + \aboveenvbreak + \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy + \sepspaces % Make spaces be word-separators rather than space tokens. + \let\par = \lisppar % don't ignore blank lines + \obeylines % each line of input is a line of output + \parskip = 0pt + % Turn off paragraph indentation but redefine \indent to emulate + % the normal \indent. + \nonfillparindent=\parindent + \parindent = 0pt + \let\indent\nonfillindent + % + \emergencystretch = 0pt % don't try to avoid overfull boxes + \ifx\nonarrowing\relax + \advance \leftskip by \lispnarrowing + \exdentamount=\lispnarrowing + \else + \let\nonarrowing = \relax + \fi + \let\exdent=\nofillexdent +} + +\begingroup +\obeyspaces +% We want to swallow spaces (but not other tokens) after the fake +% @indent in our nonfill-environments, where spaces are normally +% active and set to @tie, resulting in them not being ignored after +% @indent. +\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}% +\gdef\nonfillindentcheck{% +\ifx\temp % +\expandafter\nonfillindentgobble% +\else% +\leavevmode\nonfillindentbox% +\fi% +}% +\endgroup +\def\nonfillindentgobble#1{\nonfillindent} +\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}} + +% If you want all examples etc. small: @set dispenvsize small. +% If you want even small examples the full size: @set dispenvsize nosmall. +% This affects the following displayed environments: +% @example, @display, @format, @lisp +% +\def\smallword{small} +\def\nosmallword{nosmall} +\let\SETdispenvsize\relax +\def\setnormaldispenv{% + \ifx\SETdispenvsize\smallword + % end paragraph for sake of leading, in case document has no blank + % line. This is redundant with what happens in \aboveenvbreak, but + % we need to do it before changing the fonts, and it's inconvenient + % to change the fonts afterward. + \ifnum \lastpenalty=10000 \else \endgraf \fi + \smallexamplefonts \rm + \fi +} +\def\setsmalldispenv{% + \ifx\SETdispenvsize\nosmallword + \else + \ifnum \lastpenalty=10000 \else \endgraf \fi + \smallexamplefonts \rm + \fi +} + +% We often define two environments, @foo and @smallfoo. +% Let's do it in one command. #1 is the env name, #2 the definition. +\def\makedispenvdef#1#2{% + \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}% + \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}% + \expandafter\let\csname E#1\endcsname \afterenvbreak + \expandafter\let\csname Esmall#1\endcsname \afterenvbreak +} + +% Define two environment synonyms (#1 and #2) for an environment. +\def\maketwodispenvdef#1#2#3{% + \makedispenvdef{#1}{#3}% + \makedispenvdef{#2}{#3}% +} +% +% @lisp: indented, narrowed, typewriter font; +% @example: same as @lisp. +% +% @smallexample and @smalllisp: use smaller fonts. +% Originally contributed by Pavel@xerox. +% +\maketwodispenvdef{lisp}{example}{% + \nonfillstart + \tt\setupmarkupstyle{example}% + \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. + \gobble % eat return +} +% @display/@smalldisplay: same as @lisp except keep current font. +% +\makedispenvdef{display}{% + \nonfillstart + \gobble +} + +% @format/@smallformat: same as @display except don't narrow margins. +% +\makedispenvdef{format}{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} + +% @flushleft: same as @format, but doesn't obey \SETdispenvsize. +\envdef\flushleft{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} +\let\Eflushleft = \afterenvbreak + +% @flushright. +% +\envdef\flushright{% + \let\nonarrowing = t% + \nonfillstart + \advance\leftskip by 0pt plus 1fill\relax + \gobble +} +\let\Eflushright = \afterenvbreak + + +% @raggedright does more-or-less normal line breaking but no right +% justification. From plain.tex. Don't stretch around special +% characters in urls in this environment, since the stretch at the right +% should be enough. +\envdef\raggedright{% + \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax + \def\urefprestretchamount{0pt}% + \def\urefpoststretchamount{0pt}% +} +\let\Eraggedright\par + +\envdef\raggedleft{% + \parindent=0pt \leftskip0pt plus2em + \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt + \hbadness=10000 % Last line will usually be underfull, so turn off + % badness reporting. +} +\let\Eraggedleft\par + +\envdef\raggedcenter{% + \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em + \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt + \hbadness=10000 % Last line will usually be underfull, so turn off + % badness reporting. +} +\let\Eraggedcenter\par + + +% @quotation does normal linebreaking (hence we can't use \nonfillstart) +% and narrows the margins. We keep \parskip nonzero in general, since +% we're doing normal filling. So, when using \aboveenvbreak and +% \afterenvbreak, temporarily make \parskip 0. +% +\makedispenvdef{quotation}{\quotationstart} +% +\def\quotationstart{% + \indentedblockstart % same as \indentedblock, but increase right margin too. + \ifx\nonarrowing\relax + \advance\rightskip by \lispnarrowing + \fi + \parsearg\quotationlabel +} + +% We have retained a nonzero parskip for the environment, since we're +% doing normal filling. +% +\def\Equotation{% + \par + \ifx\quotationauthor\thisisundefined\else + % indent a bit. + \leftline{\kern 2\leftskip \sl ---\quotationauthor}% + \fi + {\parskip=0pt \afterenvbreak}% +} +\def\Esmallquotation{\Equotation} + +% If we're given an argument, typeset it in bold with a colon after. +\def\quotationlabel#1{% + \def\temp{#1}% + \ifx\temp\empty \else + {\bf #1: }% + \fi +} + +% @indentedblock is like @quotation, but indents only on the left and +% has no optional argument. +% +\makedispenvdef{indentedblock}{\indentedblockstart} +% +\def\indentedblockstart{% + {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip + \parindent=0pt + % + % @cartouche defines \nonarrowing to inhibit narrowing at next level down. + \ifx\nonarrowing\relax + \advance\leftskip by \lispnarrowing + \exdentamount = \lispnarrowing + \else + \let\nonarrowing = \relax + \fi +} + +% Keep a nonzero parskip for the environment, since we're doing normal filling. +% +\def\Eindentedblock{% + \par + {\parskip=0pt \afterenvbreak}% +} +\def\Esmallindentedblock{\Eindentedblock} + + +% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>} +% If we want to allow any <char> as delimiter, +% we need the curly braces so that makeinfo sees the @verb command, eg: +% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org +% +% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. +% +% [Knuth] p.344; only we need to do the other characters Texinfo sets +% active too. Otherwise, they get lost as the first character on a +% verbatim line. +\def\dospecials{% + \do\ \do\\\do\{\do\}\do\$\do\&% + \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% + \do\<\do\>\do\|\do\@\do+\do\"% + % Don't do the quotes -- if we do, @set txicodequoteundirected and + % @set txicodequotebacktick will not have effect on @verb and + % @verbatim, and ?` and !` ligatures won't get disabled. + %\do\`\do\'% +} +% +% [Knuth] p. 380 +\def\uncatcodespecials{% + \def\do##1{\catcode`##1=\other}\dospecials} +% +% Setup for the @verb command. +% +% Eight spaces for a tab +\begingroup + \catcode`\^^I=\active + \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} +\endgroup +% +\def\setupverb{% + \tt % easiest (and conventionally used) font for verbatim + \def\par{\leavevmode\endgraf}% + \setupmarkupstyle{verb}% + \tabeightspaces + % Respect line breaks, + % print special symbols as themselves, and + % make each space count + % must do in this order: + \obeylines \uncatcodespecials \sepspaces +} + +% Setup for the @verbatim environment +% +% Real tab expansion. +\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount +% +% We typeset each line of the verbatim in an \hbox, so we can handle +% tabs. The \global is in case the verbatim line starts with an accent, +% or some other command that starts with a begin-group. Otherwise, the +% entire \verbbox would disappear at the corresponding end-group, before +% it is typeset. Meanwhile, we can't have nested verbatim commands +% (can we?), so the \global won't be overwriting itself. +\newbox\verbbox +\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup} +% +\begingroup + \catcode`\^^I=\active + \gdef\tabexpand{% + \catcode`\^^I=\active + \def^^I{\leavevmode\egroup + \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab + \divide\dimen\verbbox by\tabw + \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw + \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw + \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox + }% + } +\endgroup + +% start the verbatim environment. +\def\setupverbatim{% + \let\nonarrowing = t% + \nonfillstart + \tt % easiest (and conventionally used) font for verbatim + % The \leavevmode here is for blank lines. Otherwise, we would + % never \starttabox and the \egroup would end verbatim mode. + \def\par{\leavevmode\egroup\box\verbbox\endgraf}% + \tabexpand + \setupmarkupstyle{verbatim}% + % Respect line breaks, + % print special symbols as themselves, and + % make each space count. + % Must do in this order: + \obeylines \uncatcodespecials \sepspaces + \everypar{\starttabbox}% +} + +% Do the @verb magic: verbatim text is quoted by unique +% delimiter characters. Before first delimiter expect a +% right brace, after last delimiter expect closing brace: +% +% \def\doverb'{'<char>#1<char>'}'{#1} +% +% [Knuth] p. 382; only eat outer {} +\begingroup + \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other + \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] +\endgroup +% +\def\verb{\begingroup\setupverb\doverb} +% +% +% Do the @verbatim magic: define the macro \doverbatim so that +% the (first) argument ends when '@end verbatim' is reached, ie: +% +% \def\doverbatim#1@end verbatim{#1} +% +% For Texinfo it's a lot easier than for LaTeX, +% because texinfo's \verbatim doesn't stop at '\end{verbatim}': +% we need not redefine '\', '{' and '}'. +% +% Inspired by LaTeX's verbatim command set [latex.ltx] +% +\begingroup + \catcode`\ =\active + \obeylines % + % ignore everything up to the first ^^M, that's the newline at the end + % of the @verbatim input line itself. Otherwise we get an extra blank + % line in the output. + \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% + % We really want {...\end verbatim} in the body of the macro, but + % without the active space; thus we have to use \xdef and \gobble. +\endgroup +% +\envdef\verbatim{% + \setupverbatim\doverbatim +} +\let\Everbatim = \afterenvbreak + + +% @verbatiminclude FILE - insert text of file in verbatim environment. +% +\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} +% +\def\doverbatiminclude#1{% + {% + \makevalueexpandable + \setupverbatim + \indexnofonts % Allow `@@' and other weird things in file names. + \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% + \input #1 + \afterenvbreak + }% +} + +% @copying ... @end copying. +% Save the text away for @insertcopying later. +% +% We save the uninterpreted tokens, rather than creating a box. +% Saving the text in a box would be much easier, but then all the +% typesetting commands (@smallbook, font changes, etc.) have to be done +% beforehand -- and a) we want @copying to be done first in the source +% file; b) letting users define the frontmatter in as flexible order as +% possible is desirable. +% +\def\copying{\checkenv{}\begingroup\scanargctxt\docopying} +\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} +% +\def\insertcopying{% + \begingroup + \parindent = 0pt % paragraph indentation looks wrong on title page + \scanexp\copyingtext + \endgroup +} + + +\message{defuns,} +% @defun etc. + +\newskip\defbodyindent \defbodyindent=.4in +\newskip\defargsindent \defargsindent=50pt +\newskip\deflastargmargin \deflastargmargin=18pt +\newcount\defunpenalty + +% Start the processing of @deffn: +\def\startdefun{% + \ifnum\lastpenalty<10000 + \medbreak + \defunpenalty=10003 % Will keep this @deffn together with the + % following @def command, see below. + \else + % If there are two @def commands in a row, we'll have a \nobreak, + % which is there to keep the function description together with its + % header. But if there's nothing but headers, we need to allow a + % break somewhere. Check specifically for penalty 10002, inserted + % by \printdefunline, instead of 10000, since the sectioning + % commands also insert a nobreak penalty, and we don't want to allow + % a break between a section heading and a defun. + % + % As a further refinement, we avoid "club" headers by signalling + % with penalty of 10003 after the very first @deffn in the + % sequence (see above), and penalty of 10002 after any following + % @def command. + \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi + % + % Similarly, after a section heading, do not allow a break. + % But do insert the glue. + \medskip % preceded by discardable penalty, so not a breakpoint + \fi + % + \parindent=0in + \advance\leftskip by \defbodyindent + \exdentamount=\defbodyindent +} + +\def\dodefunx#1{% + % First, check whether we are in the right environment: + \checkenv#1% + % + % As above, allow line break if we have multiple x headers in a row. + % It's not a great place, though. + \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi + % + % And now, it's time to reuse the body of the original defun: + \expandafter\gobbledefun#1% +} +\def\gobbledefun#1\startdefun{} + +% \printdefunline \deffnheader{text} +% +\def\printdefunline#1#2{% + \begingroup + % call \deffnheader: + #1#2 \endheader + % common ending: + \interlinepenalty = 10000 + \advance\rightskip by 0pt plus 1fil\relax + \endgraf + \nobreak\vskip -\parskip + \penalty\defunpenalty % signal to \startdefun and \dodefunx + % Some of the @defun-type tags do not enable magic parentheses, + % rendering the following check redundant. But we don't optimize. + \checkparencounts + \endgroup +} + +\def\Edefun{\endgraf\medbreak} + +% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; +% the only thing remaining is to define \deffnheader. +% +\def\makedefun#1{% + \expandafter\let\csname E#1\endcsname = \Edefun + \edef\temp{\noexpand\domakedefun + \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% + \temp +} + +% \domakedefun \deffn \deffnx \deffnheader { (defn. of \deffnheader) } +% +% Define \deffn and \deffnx, without parameters. +% \deffnheader has to be defined explicitly. +% +\def\domakedefun#1#2#3{% + \envdef#1{% + \startdefun + \doingtypefnfalse % distinguish typed functions from all else + \parseargusing\activeparens{\printdefunline#3}% + }% + \def#2{\dodefunx#1}% + \def#3% +} + +\newif\ifdoingtypefn % doing typed function? +\newif\ifrettypeownline % typeset return type on its own line? + +% @deftypefnnewline on|off says whether the return type of typed functions +% are printed on their own line. This affects @deftypefn, @deftypefun, +% @deftypeop, and @deftypemethod. +% +\parseargdef\deftypefnnewline{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETtxideftypefnnl\endcsname + = \empty + \else\ifx\temp\offword + \expandafter\let\csname SETtxideftypefnnl\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @txideftypefnnl value `\temp', + must be on|off}% + \fi\fi +} + +% Untyped functions: + +% @deffn category name args +\makedefun{deffn}{\deffngeneral{}} + +% @deffn category class name args +\makedefun{defop}#1 {\defopon{#1\ \putwordon}} + +% \defopon {category on}class name args +\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deffngeneral {subind}category name args +% +\def\deffngeneral#1#2 #3 #4\endheader{% + % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. + \dosubind{fn}{\code{#3}}{#1}% + \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% +} + +% Typed functions: + +% @deftypefn category type name args +\makedefun{deftypefn}{\deftypefngeneral{}} + +% @deftypeop category class type name args +\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} + +% \deftypeopon {category on}class type name args +\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deftypefngeneral {subind}category type name args +% +\def\deftypefngeneral#1#2 #3 #4 #5\endheader{% + \dosubind{fn}{\code{#4}}{#1}% + \doingtypefntrue + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +% Typed variables: + +% @deftypevr category type var args +\makedefun{deftypevr}{\deftypecvgeneral{}} + +% @deftypecv category class type var args +\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} + +% \deftypecvof {category of}class type var args +\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } + +% \deftypecvgeneral {subind}category type var args +% +\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% + \dosubind{vr}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +% Untyped variables: + +% @defvr category var args +\makedefun{defvr}#1 {\deftypevrheader{#1} {} } + +% @defcv category class var args +\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} + +% \defcvof {category of}class var args +\def\defcvof#1#2 {\deftypecvof{#1}#2 {} } + +% Types: + +% @deftp category name args +\makedefun{deftp}#1 #2 #3\endheader{% + \doind{tp}{\code{#2}}% + \defname{#1}{}{#2}\defunargs{#3\unskip}% +} + +% Remaining @defun-like shortcuts: +\makedefun{defun}{\deffnheader{\putwordDeffunc} } +\makedefun{defmac}{\deffnheader{\putwordDefmac} } +\makedefun{defspec}{\deffnheader{\putwordDefspec} } +\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } +\makedefun{defvar}{\defvrheader{\putwordDefvar} } +\makedefun{defopt}{\defvrheader{\putwordDefopt} } +\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } +\makedefun{defmethod}{\defopon\putwordMethodon} +\makedefun{deftypemethod}{\deftypeopon\putwordMethodon} +\makedefun{defivar}{\defcvof\putwordInstanceVariableof} +\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} + +% \defname, which formats the name of the @def (not the args). +% #1 is the category, such as "Function". +% #2 is the return type, if any. +% #3 is the function name. +% +% We are followed by (but not passed) the arguments, if any. +% +\def\defname#1#2#3{% + \par + % Get the values of \leftskip and \rightskip as they were outside the @def... + \advance\leftskip by -\defbodyindent + % + % Determine if we are typesetting the return type of a typed function + % on a line by itself. + \rettypeownlinefalse + \ifdoingtypefn % doing a typed function specifically? + % then check user option for putting return type on its own line: + \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else + \rettypeownlinetrue + \fi + \fi + % + % How we'll format the category name. Putting it in brackets helps + % distinguish it from the body text that may end up on the next line + % just below it. + \def\temp{#1}% + \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} + % + % Figure out line sizes for the paragraph shape. We'll always have at + % least two. + \tempnum = 2 + % + % The first line needs space for \box0; but if \rightskip is nonzero, + % we need only space for the part of \box0 which exceeds it: + \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip + % + % If doing a return type on its own line, we'll have another line. + \ifrettypeownline + \advance\tempnum by 1 + \def\maybeshapeline{0in \hsize}% + \else + \def\maybeshapeline{}% + \fi + % + % The continuations: + \dimen2=\hsize \advance\dimen2 by -\defargsindent + % + % The final paragraph shape: + \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2 + % + % Put the category name at the right margin. + \noindent + \hbox to 0pt{% + \hfil\box0 \kern-\hsize + % \hsize has to be shortened this way: + \kern\leftskip + % Intentionally do not respect \rightskip, since we need the space. + }% + % + % Allow all lines to be underfull without complaint: + \tolerance=10000 \hbadness=10000 + \exdentamount=\defbodyindent + {% + % defun fonts. We use typewriter by default (used to be bold) because: + % . we're printing identifiers, they should be in tt in principle. + % . in languages with many accents, such as Czech or French, it's + % common to leave accents off identifiers. The result looks ok in + % tt, but exceedingly strange in rm. + % . we don't want -- and --- to be treated as ligatures. + % . this still does not fix the ?` and !` ligatures, but so far no + % one has made identifiers using them :). + \df \tt + \def\temp{#2}% text of the return type + \ifx\temp\empty\else + \tclose{\temp}% typeset the return type + \ifrettypeownline + % put return type on its own line; prohibit line break following: + \hfil\vadjust{\nobreak}\break + \else + \space % type on same line, so just followed by a space + \fi + \fi % no return type + #3% output function name + }% + {\rm\enskip}% hskip 0.5 em of \rmfont + % + \boldbrax + % arguments will be output next, if any. +} + +% Print arguments in slanted roman (not ttsl), inconsistently with using +% tt for the name. This is because literal text is sometimes needed in +% the argument list (groff manual), and ttsl and tt are not very +% distinguishable. Prevent hyphenation at `-' chars. +% +\def\defunargs#1{% + % use sl by default (not ttsl), + % tt for the names. + \df \sl \hyphenchar\font=0 + % + % On the other hand, if an argument has two dashes (for instance), we + % want a way to get ttsl. We used to recommend @var for that, so + % leave the code in, but it's strange for @var to lead to typewriter. + % Nowadays we recommend @code, since the difference between a ttsl hyphen + % and a tt hyphen is pretty tiny. @code also disables ?` !`. + \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% + #1% + \sl\hyphenchar\font=45 +} + +% We want ()&[] to print specially on the defun line. +% +\def\activeparens{% + \catcode`\(=\active \catcode`\)=\active + \catcode`\[=\active \catcode`\]=\active + \catcode`\&=\active +} + +% Make control sequences which act like normal parenthesis chars. +\let\lparen = ( \let\rparen = ) + +% Be sure that we always have a definition for `(', etc. For example, +% if the fn name has parens in it, \boldbrax will not be in effect yet, +% so TeX would otherwise complain about undefined control sequence. +{ + \activeparens + \global\let(=\lparen \global\let)=\rparen + \global\let[=\lbrack \global\let]=\rbrack + \global\let& = \& + + \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} + \gdef\magicamp{\let&=\amprm} +} + +\newcount\parencount + +% If we encounter &foo, then turn on ()-hacking afterwards +\newif\ifampseen +\def\amprm#1 {\ampseentrue{\bf\ }} + +\def\parenfont{% + \ifampseen + % At the first level, print parens in roman, + % otherwise use the default font. + \ifnum \parencount=1 \rm \fi + \else + % The \sf parens (in \boldbrax) actually are a little bolder than + % the contained text. This is especially needed for [ and ] . + \sf + \fi +} +\def\infirstlevel#1{% + \ifampseen + \ifnum\parencount=1 + #1% + \fi + \fi +} +\def\bfafterword#1 {#1 \bf} + +\def\opnr{% + \global\advance\parencount by 1 + {\parenfont(}% + \infirstlevel \bfafterword +} +\def\clnr{% + {\parenfont)}% + \infirstlevel \sl + \global\advance\parencount by -1 +} + +\newcount\brackcount +\def\lbrb{% + \global\advance\brackcount by 1 + {\bf[}% +} +\def\rbrb{% + {\bf]}% + \global\advance\brackcount by -1 +} + +\def\checkparencounts{% + \ifnum\parencount=0 \else \badparencount \fi + \ifnum\brackcount=0 \else \badbrackcount \fi +} +% these should not use \errmessage; the glibc manual, at least, actually +% has such constructs (when documenting function pointers). +\def\badparencount{% + \message{Warning: unbalanced parentheses in @def...}% + \global\parencount=0 +} +\def\badbrackcount{% + \message{Warning: unbalanced square brackets in @def...}% + \global\brackcount=0 +} + + +\message{macros,} +% @macro. + +% To do this right we need a feature of e-TeX, \scantokens, +% which we arrange to emulate with a temporary file in ordinary TeX. +\ifx\eTeXversion\thisisundefined + \newwrite\macscribble + \def\scantokens#1{% + \toks0={#1}% + \immediate\openout\macscribble=\jobname.tmp + \immediate\write\macscribble{\the\toks0}% + \immediate\closeout\macscribble + \input \jobname.tmp + } +\fi + +% alias because \c means cedilla in @tex or @math +\let\texinfoc=\c + +\newcount\savedcatcodeone +\newcount\savedcatcodetwo + +% Used at the time of macro expansion. +% Argument is macro body with arguments substituted +\def\scanmacro#1{% + \newlinechar`\^^M + \def\xeatspaces{\eatspaces}% + % + % Temporarily undo catcode changes of \printindex. Set catcode of @ to + % 0 so that @-commands in macro expansions aren't printed literally when + % formatting an index file, where \ is used as the escape character. + \savedcatcodeone=\catcode`\@ + \savedcatcodetwo=\catcode`\\ + \catcode`\@=0 + \catcode`\\=\active + % + % Process the macro body under the current catcode regime. + \scantokens{#1@texinfoc}% + % + \catcode`\@=\savedcatcodeone + \catcode`\\=\savedcatcodetwo + % + % The \texinfoc is to remove the \newlinechar added by \scantokens, and + % can be noticed by \parsearg. + % We avoid surrounding the call to \scantokens with \bgroup and \egroup + % to allow macros to open or close groups themselves. +} + +% Used for copying and captions +\def\scanexp#1{% + \expandafter\scanmacro\expandafter{#1}% +} + +\newcount\paramno % Count of parameters +\newtoks\macname % Macro name +\newif\ifrecursive % Is it recursive? + +% List of all defined macros in the form +% \commondummyword\macro1\commondummyword\macro2... +% Currently is also contains all @aliases; the list can be split +% if there is a need. +\def\macrolist{} + +% Add the macro to \macrolist +\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} +\def\addtomacrolistxxx#1{% + \toks0 = \expandafter{\macrolist\commondummyword#1}% + \xdef\macrolist{\the\toks0}% +} + +% Utility routines. +% This does \let #1 = #2, with \csnames; that is, +% \let \csname#1\endcsname = \csname#2\endcsname +% (except of course we have to play expansion games). +% +\def\cslet#1#2{% + \expandafter\let + \csname#1\expandafter\endcsname + \csname#2\endcsname +} + +% Trim leading and trailing spaces off a string. +% Concepts from aro-bend problem 15 (see CTAN). +{\catcode`\@=11 +\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} +\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} +\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} +\def\unbrace#1{#1} +\unbrace{\gdef\trim@@@ #1 } #2@{#1} +} + +% Trim a single trailing ^^M off a string. +{\catcode`\^^M=\other \catcode`\Q=3% +\gdef\eatcr #1{\eatcra #1Q^^MQ}% +\gdef\eatcra#1^^MQ{\eatcrb#1Q}% +\gdef\eatcrb#1Q#2Q{#1}% +} + +% Macro bodies are absorbed as an argument in a context where +% all characters are catcode 10, 11 or 12, except \ which is active +% (as in normal texinfo). It is necessary to change the definition of \ +% to recognize macro arguments; this is the job of \mbodybackslash. +% +% Non-ASCII encodings make 8-bit characters active, so un-activate +% them to avoid their expansion. Must do this non-globally, to +% confine the change to the current group. +% +% It's necessary to have hard CRs when the macro is executed. This is +% done by making ^^M (\endlinechar) catcode 12 when reading the macro +% body, and then making it the \newlinechar in \scanmacro. +% +\def\scanctxt{% used as subroutine + \catcode`\"=\other + \catcode`\+=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\^=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\~=\other + \passthroughcharstrue +} + +\def\scanargctxt{% used for copying and captions, not macros. + \scanctxt + \catcode`\@=\other + \catcode`\\=\other + \catcode`\^^M=\other +} + +\def\macrobodyctxt{% used for @macro definitions + \scanctxt + \catcode`\ =\other + \catcode`\@=\other + \catcode`\{=\other + \catcode`\}=\other + \catcode`\^^M=\other + \usembodybackslash +} + +% Used when scanning braced macro arguments. Note, however, that catcode +% changes here are ineffectual if the macro invocation was nested inside +% an argument to another Texinfo command. +\def\macroargctxt{% + \scanctxt + \catcode`\ =\active + \catcode`\^^M=\other + \catcode`\\=\active +} + +\def\macrolineargctxt{% used for whole-line arguments without braces + \scanctxt + \catcode`\{=\other + \catcode`\}=\other +} + +% \mbodybackslash is the definition of \ in @macro bodies. +% It maps \foo\ => \csname macarg.foo\endcsname => #N +% where N is the macro parameter number. +% We define \csname macarg.\endcsname to be \realbackslash, so +% \\ in macro replacement text gets you a backslash. +% +{\catcode`@=0 @catcode`@\=@active + @gdef@usembodybackslash{@let\=@mbodybackslash} + @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} +} +\expandafter\def\csname macarg.\endcsname{\realbackslash} + +\def\margbackslash#1{\char`\#1 } + +\def\macro{\recursivefalse\parsearg\macroxxx} +\def\rmacro{\recursivetrue\parsearg\macroxxx} + +\def\macroxxx#1{% + \getargs{#1}% now \macname is the macname and \argl the arglist + \ifx\argl\empty % no arguments + \paramno=0\relax + \else + \expandafter\parsemargdef \argl;% + \if\paramno>256\relax + \ifx\eTeXversion\thisisundefined + \errhelp = \EMsimple + \errmessage{You need eTeX to compile a file with macros with more than 256 arguments} + \fi + \fi + \fi + \if1\csname ismacro.\the\macname\endcsname + \message{Warning: redefining \the\macname}% + \else + \expandafter\ifx\csname \the\macname\endcsname \relax + \else \errmessage{Macro name \the\macname\space already defined}\fi + \global\cslet{macsave.\the\macname}{\the\macname}% + \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% + \addtomacrolist{\the\macname}% + \fi + \begingroup \macrobodyctxt + \ifrecursive \expandafter\parsermacbody + \else \expandafter\parsemacbody + \fi} + +\parseargdef\unmacro{% + \if1\csname ismacro.#1\endcsname + \global\cslet{#1}{macsave.#1}% + \global\expandafter\let \csname ismacro.#1\endcsname=0% + % Remove the macro name from \macrolist: + \begingroup + \expandafter\let\csname#1\endcsname \relax + \let\commondummyword\unmacrodo + \xdef\macrolist{\macrolist}% + \endgroup + \else + \errmessage{Macro #1 not defined}% + \fi +} + +% Called by \do from \dounmacro on each macro. The idea is to omit any +% macro definitions that have been changed to \relax. +% +\def\unmacrodo#1{% + \ifx #1\relax + % remove this + \else + \noexpand\commondummyword \noexpand#1% + \fi +} + +% \getargs -- Parse the arguments to a @macro line. Set \macname to +% the name of the macro, and \argl to the braced argument list. +\def\getargs#1{\getargsxxx#1{}} +\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} +\def\getmacname#1 #2\relax{\macname={#1}} +\def\getmacargs#1{\def\argl{#1}} +% This made use of the feature that if the last token of a +% <parameter list> is #, then the preceding argument is delimited by +% an opening brace, and that opening brace is not consumed. + +% Parse the optional {params} list to @macro or @rmacro. +% Set \paramno to the number of arguments, +% and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a +% three-param macro.) Define \macarg.BLAH for each BLAH in the params +% list to some hook where the argument is to be expanded. If there are +% less than 10 arguments that hook is to be replaced by ##N where N +% is the position in that list, that is to say the macro arguments are to be +% defined `a la TeX in the macro body. +% +% That gets used by \mbodybackslash (above). +% +% If there are 10 or more arguments, a different technique is used: see +% \parsemmanyargdef. +% +\def\parsemargdef#1;{% + \paramno=0\def\paramlist{}% + \let\hash\relax + % \hash is redefined to `#' later to get it into definitions + \let\xeatspaces\relax + \parsemargdefxxx#1,;,% + \ifnum\paramno<10\relax\else + \paramno0\relax + \parsemmanyargdef@@#1,;,% 10 or more arguments + \fi +} +\def\parsemargdefxxx#1,{% + \if#1;\let\next=\relax + \else \let\next=\parsemargdefxxx + \advance\paramno by 1 + \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname + {\xeatspaces{\hash\the\paramno}}% + \edef\paramlist{\paramlist\hash\the\paramno,}% + \fi\next} + +% \parsemacbody, \parsermacbody +% +% Read recursive and nonrecursive macro bodies. (They're different since +% rec and nonrec macros end differently.) +% +% We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro +% body to be transformed. +% Set \macrobody to the body of the macro, and call \defmacro. +% +{\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{% +\xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}% +{\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{% +\xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}% + +% Make @ a letter, so that we can make private-to-Texinfo macro names. +\edef\texiatcatcode{\the\catcode`\@} +\catcode `@=11\relax + +%%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%% + +% If there are 10 or more arguments, a different technique is used, where the +% hook remains in the body, and when macro is to be expanded the body is +% processed again to replace the arguments. +% +% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the +% argument N value and then \edef the body (nothing else will expand because of +% the catcode regime under which the body was input). +% +% If you compile with TeX (not eTeX), and you have macros with 10 or more +% arguments, no macro can have more than 256 arguments (else error). +% +% In case that there are 10 or more arguments we parse again the arguments +% list to set new definitions for the \macarg.BLAH macros corresponding to +% each BLAH argument. It was anyhow needed to parse already once this list +% in order to count the arguments, and as macros with at most 9 arguments +% are by far more frequent than macro with 10 or more arguments, defining +% twice the \macarg.BLAH macros does not cost too much processing power. +\def\parsemmanyargdef@@#1,{% + \if#1;\let\next=\relax + \else + \let\next=\parsemmanyargdef@@ + \edef\tempb{\eatspaces{#1}}% + \expandafter\def\expandafter\tempa + \expandafter{\csname macarg.\tempb\endcsname}% + % Note that we need some extra \noexpand\noexpand, this is because we + % don't want \the to be expanded in the \parsermacbody as it uses an + % \xdef . + \expandafter\edef\tempa + {\noexpand\noexpand\noexpand\the\toks\the\paramno}% + \advance\paramno by 1\relax + \fi\next} + + +\let\endargs@\relax +\let\nil@\relax +\def\nilm@{\nil@}% +\long\def\nillm@{\nil@}% + +% This macro is expanded during the Texinfo macro expansion, not during its +% definition. It gets all the arguments' values and assigns them to macros +% macarg.ARGNAME +% +% #1 is the macro name +% #2 is the list of argument names +% #3 is the list of argument values +\def\getargvals@#1#2#3{% + \def\macargdeflist@{}% + \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion. + \def\paramlist{#2,\nil@}% + \def\macroname{#1}% + \begingroup + \macroargctxt + \def\argvaluelist{#3,\nil@}% + \def\@tempa{#3}% + \ifx\@tempa\empty + \setemptyargvalues@ + \else + \getargvals@@ + \fi +} +\def\getargvals@@{% + \ifx\paramlist\nilm@ + % Some sanity check needed here that \argvaluelist is also empty. + \ifx\argvaluelist\nillm@ + \else + \errhelp = \EMsimple + \errmessage{Too many arguments in macro `\macroname'!}% + \fi + \let\next\macargexpandinbody@ + \else + \ifx\argvaluelist\nillm@ + % No more arguments values passed to macro. Set remaining named-arg + % macros to empty. + \let\next\setemptyargvalues@ + \else + % pop current arg name into \@tempb + \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}% + \expandafter\@tempa\expandafter{\paramlist}% + % pop current argument value into \@tempc + \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}% + \expandafter\@tempa\expandafter{\argvaluelist}% + % Here \@tempb is the current arg name and \@tempc is the current arg value. + % First place the new argument macro definition into \@tempd + \expandafter\macname\expandafter{\@tempc}% + \expandafter\let\csname macarg.\@tempb\endcsname\relax + \expandafter\def\expandafter\@tempe\expandafter{% + \csname macarg.\@tempb\endcsname}% + \edef\@tempd{\long\def\@tempe{\the\macname}}% + \push@\@tempd\macargdeflist@ + \let\next\getargvals@@ + \fi + \fi + \next +} + +\def\push@#1#2{% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter#2% + \expandafter\expandafter\expandafter{% + \expandafter#1#2}% +} + +% Replace arguments by their values in the macro body, and place the result +% in macro \@tempa. +% +\def\macvalstoargs@{% + % To do this we use the property that token registers that are \the'ed + % within an \edef expand only once. So we are going to place all argument + % values into respective token registers. + % + % First we save the token context, and initialize argument numbering. + \begingroup + \paramno0\relax + % Then, for each argument number #N, we place the corresponding argument + % value into a new token list register \toks#N + \expandafter\putargsintokens@\saveparamlist@,;,% + % Then, we expand the body so that argument are replaced by their + % values. The trick for values not to be expanded themselves is that they + % are within tokens and that tokens expand only once in an \edef . + \edef\@tempc{\csname mac.\macroname .body\endcsname}% + % Now we restore the token stack pointer to free the token list registers + % which we have used, but we make sure that expanded body is saved after + % group. + \expandafter + \endgroup + \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% + } + +% Define the named-macro outside of this group and then close this group. +% +\def\macargexpandinbody@{% + \expandafter + \endgroup + \macargdeflist@ + % First the replace in body the macro arguments by their values, the result + % is in \@tempa . + \macvalstoargs@ + % Then we point at the \norecurse or \gobble (for recursive) macro value + % with \@tempb . + \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname + % Depending on whether it is recursive or not, we need some tailing + % \egroup . + \ifx\@tempb\gobble + \let\@tempc\relax + \else + \let\@tempc\egroup + \fi + % And now we do the real job: + \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}% + \@tempd +} + +\def\putargsintokens@#1,{% + \if#1;\let\next\relax + \else + \let\next\putargsintokens@ + % First we allocate the new token list register, and give it a temporary + % alias \@tempb . + \toksdef\@tempb\the\paramno + % Then we place the argument value into that token list register. + \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname + \expandafter\@tempb\expandafter{\@tempa}% + \advance\paramno by 1\relax + \fi + \next +} + +% Trailing missing arguments are set to empty. +% +\def\setemptyargvalues@{% + \ifx\paramlist\nilm@ + \let\next\macargexpandinbody@ + \else + \expandafter\setemptyargvaluesparser@\paramlist\endargs@ + \let\next\setemptyargvalues@ + \fi + \next +} + +\def\setemptyargvaluesparser@#1,#2\endargs@{% + \expandafter\def\expandafter\@tempa\expandafter{% + \expandafter\def\csname macarg.#1\endcsname{}}% + \push@\@tempa\macargdeflist@ + \def\paramlist{#2}% +} + +% #1 is the element target macro +% #2 is the list macro +% #3,#4\endargs@ is the list value +\def\pop@#1#2#3,#4\endargs@{% + \def#1{#3}% + \def#2{#4}% +} +\long\def\longpop@#1#2#3,#4\endargs@{% + \long\def#1{#3}% + \long\def#2{#4}% +} + + +%%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%% + + +% This defines a Texinfo @macro or @rmacro, called by \parsemacbody. +% \macrobody has the body of the macro in it, with placeholders for +% its parameters, looking like "\xeatspaces{\hash 1}". +% \paramno is the number of parameters +% \paramlist is a TeX parameter text, e.g. "#1,#2,#3," +% There are four cases: macros of zero, one, up to nine, and many arguments. +% \xdef is used so that macro definitions will survive the file +% they're defined in: @include reads the file inside a group. +% +\def\defmacro{% + \let\hash=##% convert placeholders to macro parameter chars + \ifnum\paramno=1 + \def\xeatspaces##1{##1}% + % This removes the pair of braces around the argument. We don't + % use \eatspaces, because this can cause ends of lines to be lost + % when the argument to \eatspaces is read, leading to line-based + % commands like "@itemize" not being read correctly. + \else + \let\xeatspaces\relax % suppress expansion + \fi + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup + \noexpand\spaceisspace + \noexpand\endlineisspace + \noexpand\expandafter % skip any whitespace after the macro name. + \expandafter\noexpand\csname\the\macname @@@\endcsname}% + \expandafter\xdef\csname\the\macname @@@\endcsname{% + \egroup + \noexpand\scanmacro{\macrobody}}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname @@@\endcsname}% + \expandafter\xdef\csname\the\macname @@@\endcsname##1{% + \egroup + \noexpand\scanmacro{\macrobody}% + }% + \else % at most 9 + \ifnum\paramno<10\relax + % @MACNAME sets the context for reading the macro argument + % @MACNAME@@ gets the argument, processes backslashes and appends a + % comma. + % @MACNAME@@@ removes braces surrounding the argument list. + % @MACNAME@@@@ scans the macro body with arguments substituted. + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup + \noexpand\expandafter % This \expandafter skip any spaces after the + \noexpand\macroargctxt % macro before we change the catcode of space. + \noexpand\expandafter + \expandafter\noexpand\csname\the\macname @@\endcsname}% + \expandafter\xdef\csname\the\macname @@\endcsname##1{% + \noexpand\passargtomacro + \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}% + \expandafter\xdef\csname\the\macname @@@\endcsname##1{% + \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname @@@@\endcsname\paramlist{% + \egroup\noexpand\scanmacro{\macrobody}}% + \else % 10 or more: + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\getargvals@{\the\macname}{\argl}% + }% + \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody + \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble + \fi + \fi} + +\catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes + +\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +{\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape +@catcode`@_=11 % private names +@catcode`@!=11 % used as argument separator + +% \passargtomacro#1#2 - +% Call #1 with a list of tokens #2, with any doubled backslashes in #2 +% compressed to one. +% +% This implementation works by expansion, and not execution (so we cannot use +% \def or similar). This reduces the risk of this failing in contexts where +% complete expansion is done with no execution (for example, in writing out to +% an auxiliary file for an index entry). +% +% State is kept in the input stream: the argument passed to +% @look_ahead, @gobble_and_check_finish and @add_segment is +% +% THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input) +% +% where: +% THE_MACRO - name of the macro we want to call +% ARG_RESULT - argument list we build to pass to that macro +% PENDING_BS - either a backslash or nothing +% NEXT_TOKEN - used to look ahead in the input stream to see what's coming next + +@gdef@passargtomacro#1#2{% + @add_segment #1!{}@relax#2\@_finish\% +} +@gdef@_finish{@_finishx} @global@let@_finishx@relax + +% #1 - THE_MACRO ARG_RESULT +% #2 - PENDING_BS +% #3 - NEXT_TOKEN +% #4 used to look ahead +% +% If the next token is not a backslash, process the rest of the argument; +% otherwise, remove the next token. +@gdef@look_ahead#1!#2#3#4{% + @ifx#4\% + @expandafter@gobble_and_check_finish + @else + @expandafter@add_segment + @fi#1!{#2}#4#4% +} + +% #1 - THE_MACRO ARG_RESULT +% #2 - PENDING_BS +% #3 - NEXT_TOKEN +% #4 should be a backslash, which is gobbled. +% #5 looks ahead +% +% Double backslash found. Add a single backslash, and look ahead. +@gdef@gobble_and_check_finish#1!#2#3#4#5{% + @add_segment#1\!{}#5#5% +} + +@gdef@is_fi{@fi} + +% #1 - THE_MACRO ARG_RESULT +% #2 - PENDING_BS +% #3 - NEXT_TOKEN +% #4 is input stream until next backslash +% +% Input stream is either at the start of the argument, or just after a +% backslash sequence, either a lone backslash, or a doubled backslash. +% NEXT_TOKEN contains the first token in the input stream: if it is \finish, +% finish; otherwise, append to ARG_RESULT the segment of the argument up until +% the next backslash. PENDING_BACKSLASH contains a backslash to represent +% a backslash just before the start of the input stream that has not been +% added to ARG_RESULT. +@gdef@add_segment#1!#2#3#4\{% +@ifx#3@_finish + @call_the_macro#1!% +@else + % append the pending backslash to the result, followed by the next segment + @expandafter@is_fi@look_ahead#1#2#4!{\}@fi + % this @fi is discarded by @look_ahead. + % we can't get rid of it with \expandafter because we don't know how + % long #4 is. +} + +% #1 - THE_MACRO +% #2 - ARG_RESULT +% #3 discards the res of the conditional in @add_segment, and @is_fi ends the +% conditional. +@gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}} + +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% \braceorline MAC is used for a one-argument macro MAC. It checks +% whether the next non-whitespace character is a {. It sets the context +% for reading the argument (slightly different in the two cases). Then, +% to read the argument, in the whole-line case, it then calls the regular +% \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC. +% +\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} +\def\braceorlinexxx{% + \ifx\nchar\bgroup + \macroargctxt + \expandafter\passargtomacro + \else + \macrolineargctxt\expandafter\parsearg + \fi \macnamexxx} + + +% @alias. +% We need some trickery to remove the optional spaces around the equal +% sign. Make them active and then expand them all to nothing. +% +\def\alias{\parseargusing\obeyspaces\aliasxxx} +\def\aliasxxx #1{\aliasyyy#1\relax} +\def\aliasyyy #1=#2\relax{% + {% + \expandafter\let\obeyedspace=\empty + \addtomacrolist{#1}% + \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% + }% + \next +} + + +\message{cross references,} + +\newwrite\auxfile +\newif\ifhavexrefs % True if xref values are known. +\newif\ifwarnedxrefs % True if we warned once that they aren't known. + +% @inforef is relatively simple. +\def\inforef #1{\inforefzzz #1,,,,**} +\def\inforefzzz #1,#2,#3,#4**{% + \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, + node \samp{\ignorespaces#1{}}} + +% @node's only job in TeX is to define \lastnode, which is used in +% cross-references. The @node line might or might not have commas, and +% might or might not have spaces before the first comma, like: +% @node foo , bar , ... +% We don't want such trailing spaces in the node name. +% +\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} +% +% also remove a trailing comma, in case of something like this: +% @node Help-Cross, , , Cross-refs +\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} +\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} + +\let\nwnode=\node +\let\lastnode=\empty + +% Write a cross-reference definition for the current node. #1 is the +% type (Ynumbered, Yappendix, Ynothing). +% +\def\donoderef#1{% + \ifx\lastnode\empty\else + \setref{\lastnode}{#1}% + \global\let\lastnode=\empty + \fi +} + +% @anchor{NAME} -- define xref target at arbitrary point. +% +\newcount\savesfregister +% +\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} +\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} +\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} + +% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an +% anchor), which consists of three parts: +% 1) NAME-title - the current sectioning name taken from \lastsection, +% or the anchor name. +% 2) NAME-snt - section number and type, passed as the SNT arg, or +% empty for anchors. +% 3) NAME-pg - the page number. +% +% This is called from \donoderef, \anchor, and \dofloat. In the case of +% floats, there is an additional part, which is not written here: +% 4) NAME-lof - the text as it should appear in a @listoffloats. +% +\def\setref#1#2{% + \pdfmkdest{#1}% + \iflinks + {% + \requireauxfile + \atdummies % preserve commands, but don't expand them + % match definition in \xrdef, \refx, \xrefX. + \def\value##1{##1}% + \edef\writexrdef##1##2{% + \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef + ##1}{##2}}% these are parameters of \writexrdef + }% + \toks0 = \expandafter{\lastsection}% + \immediate \writexrdef{title}{\the\toks0 }% + \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. + \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout + }% + \fi +} + +% @xrefautosectiontitle on|off says whether @section(ing) names are used +% automatically in xrefs, if the third arg is not explicitly specified. +% This was provided as a "secret" @set xref-automatic-section-title +% variable, now it's official. +% +\parseargdef\xrefautomaticsectiontitle{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETxref-automatic-section-title\endcsname + = \empty + \else\ifx\temp\offword + \expandafter\let\csname SETxref-automatic-section-title\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @xrefautomaticsectiontitle value `\temp', + must be on|off}% + \fi\fi +} + +% +% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is +% the node name, #2 the name of the Info cross-reference, #3 the printed +% node name, #4 the name of the Info file, #5 the name of the printed +% manual. All but the node name can be omitted. +% +\def\pxref{\putwordsee{} \xrefXX} +\def\xref{\putwordSee{} \xrefXX} +\def\ref{\xrefXX} + +\def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX} +\def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]} +% +\newbox\toprefbox +\newbox\printedrefnamebox +\newbox\infofilenamebox +\newbox\printedmanualbox +% +\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup + \unsepspaces + % + % Get args without leading/trailing spaces. + \def\printedrefname{\ignorespaces #3}% + \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}% + % + \def\infofilename{\ignorespaces #4}% + \setbox\infofilenamebox = \hbox{\infofilename\unskip}% + % + \def\printedmanual{\ignorespaces #5}% + \setbox\printedmanualbox = \hbox{\printedmanual\unskip}% + % + % If the printed reference name (arg #3) was not explicitly given in + % the @xref, figure out what we want to use. + \ifdim \wd\printedrefnamebox = 0pt + % No printed node name was explicitly given. + \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax + % Not auto section-title: use node name inside the square brackets. + \def\printedrefname{\ignorespaces #1}% + \else + % Auto section-title: use chapter/section title inside + % the square brackets if we have it. + \ifdim \wd\printedmanualbox > 0pt + % It is in another manual, so we don't have it; use node name. + \def\printedrefname{\ignorespaces #1}% + \else + \ifhavexrefs + % We (should) know the real title if we have the xref values. + \def\printedrefname{\refx{#1-title}{}}% + \else + % Otherwise just copy the Info node name. + \def\printedrefname{\ignorespaces #1}% + \fi% + \fi + \fi + \fi + % + % Make link in pdf output. + \ifpdf + % For pdfTeX and LuaTeX + {\indexnofonts + \makevalueexpandable + \turnoffactive + % This expands tokens, so do it after making catcode changes, so _ + % etc. don't get their TeX definitions. This ignores all spaces in + % #4, including (wrongly) those in the middle of the filename. + \getfilename{#4}% + % + % This (wrongly) does not take account of leading or trailing + % spaces in #1, which should be ignored. + \setpdfdestname{#1}% + % + \ifx\pdfdestname\empty + \def\pdfdestname{Top}% no empty targets + \fi + % + \leavevmode + \startlink attr{/Border [0 0 0]}% + \ifnum\filenamelength>0 + goto file{\the\filename.pdf} name{\pdfdestname}% + \else + goto name{\pdfmkpgn{\pdfdestname}}% + \fi + }% + \setcolor{\linkcolor}% + \else + \ifx\XeTeXrevision\thisisundefined + \else + % For XeTeX + {\indexnofonts + \makevalueexpandable + \turnoffactive + % This expands tokens, so do it after making catcode changes, so _ + % etc. don't get their TeX definitions. This ignores all spaces in + % #4, including (wrongly) those in the middle of the filename. + \getfilename{#4}% + % + % This (wrongly) does not take account of leading or trailing + % spaces in #1, which should be ignored. + \setpdfdestname{#1}% + % + \ifx\pdfdestname\empty + \def\pdfdestname{Top}% no empty targets + \fi + % + \leavevmode + \ifnum\filenamelength>0 + % With default settings, + % XeTeX (xdvipdfmx) replaces link destination names with integers. + % In this case, the replaced destination names of + % remote PDFs are no longer known. In order to avoid a replacement, + % you can use xdvipdfmx's command line option `-C 0x0010'. + % If you use XeTeX 0.99996+ (TeX Live 2016+), + % this command line option is no longer necessary + % because we can use the `dvipdfmx:config' special. + \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A + << /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}% + \else + \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A + << /S /GoTo /D (\pdfdestname) >> >>}% + \fi + }% + \setcolor{\linkcolor}% + \fi + \fi + {% + % Have to otherify everything special to allow the \csname to + % include an _ in the xref name, etc. + \indexnofonts + \turnoffactive + \def\value##1{##1}% + \expandafter\global\expandafter\let\expandafter\Xthisreftitle + \csname XR#1-title\endcsname + }% + % + % Float references are printed completely differently: "Figure 1.2" + % instead of "[somenode], p.3". \iffloat distinguishes them by + % \Xthisreftitle being set to a magic string. + \iffloat\Xthisreftitle + % If the user specified the print name (third arg) to the ref, + % print it instead of our usual "Figure 1.2". + \ifdim\wd\printedrefnamebox = 0pt + \refx{#1-snt}{}% + \else + \printedrefname + \fi + % + % If the user also gave the printed manual name (fifth arg), append + % "in MANUALNAME". + \ifdim \wd\printedmanualbox > 0pt + \space \putwordin{} \cite{\printedmanual}% + \fi + \else + % node/anchor (non-float) references. + % + % If we use \unhbox to print the node names, TeX does not insert + % empty discretionaries after hyphens, which means that it will not + % find a line break at a hyphen in a node names. Since some manuals + % are best written with fairly long node names, containing hyphens, + % this is a loss. Therefore, we give the text of the node name + % again, so it is as if TeX is seeing it for the first time. + % + \ifdim \wd\printedmanualbox > 0pt + % Cross-manual reference with a printed manual name. + % + \crossmanualxref{\cite{\printedmanual\unskip}}% + % + \else\ifdim \wd\infofilenamebox > 0pt + % Cross-manual reference with only an info filename (arg 4), no + % printed manual name (arg 5). This is essentially the same as + % the case above; we output the filename, since we have nothing else. + % + \crossmanualxref{\code{\infofilename\unskip}}% + % + \else + % Reference within this manual. + % + % _ (for example) has to be the character _ for the purposes of the + % control sequence corresponding to the node, but it has to expand + % into the usual \leavevmode...\vrule stuff for purposes of + % printing. So we \turnoffactive for the \refx-snt, back on for the + % printing, back off for the \refx-pg. + {\turnoffactive + % Only output a following space if the -snt ref is nonempty; for + % @unnumbered and @anchor, it won't be. + \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% + \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + }% + % output the `[mynode]' via the macro below so it can be overridden. + \xrefprintnodename\printedrefname + % + % But we always want a comma and a space: + ,\space + % + % output the `page 3'. + \turnoffactive \putwordpage\tie\refx{#1-pg}{}% + % Add a , if xref followed by a space + \if\space\noexpand\tokenafterxref ,% + \else\ifx\ \tokenafterxref ,% @TAB + \else\ifx\*\tokenafterxref ,% @* + \else\ifx\ \tokenafterxref ,% @SPACE + \else\ifx\ + \tokenafterxref ,% @NL + \else\ifx\tie\tokenafterxref ,% @tie + \fi\fi\fi\fi\fi\fi + \fi\fi + \fi + \endlink +\endgroup} + +% Output a cross-manual xref to #1. Used just above (twice). +% +% Only include the text "Section ``foo'' in" if the foo is neither +% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply +% "see The Foo Manual", the idea being to refer to the whole manual. +% +% But, this being TeX, we can't easily compare our node name against the +% string "Top" while ignoring the possible spaces before and after in +% the input. By adding the arbitrary 7sp below, we make it much less +% likely that a real node name would have the same width as "Top" (e.g., +% in a monospaced font). Hopefully it will never happen in practice. +% +% For the same basic reason, we retypeset the "Top" at every +% reference, since the current font is indeterminate. +% +\def\crossmanualxref#1{% + \setbox\toprefbox = \hbox{Top\kern7sp}% + \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}% + \ifdim \wd2 > 7sp % nonempty? + \ifdim \wd2 = \wd\toprefbox \else % same as Top? + \putwordSection{} ``\printedrefname'' \putwordin{}\space + \fi + \fi + #1% +} + +% This macro is called from \xrefX for the `[nodename]' part of xref +% output. It's a separate macro only so it can be changed more easily, +% since square brackets don't work well in some documents. Particularly +% one that Bob is working on :). +% +\def\xrefprintnodename#1{[#1]} + +% Things referred to by \setref. +% +\def\Ynothing{} +\def\Yomitfromtoc{} +\def\Ynumbered{% + \ifnum\secno=0 + \putwordChapter@tie \the\chapno + \else \ifnum\subsecno=0 + \putwordSection@tie \the\chapno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno + \else + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} +\def\Yappendix{% + \ifnum\secno=0 + \putwordAppendix@tie @char\the\appendixno{}% + \else \ifnum\subsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno + \else + \putwordSection@tie + @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} + +% \refx{NAME}{SUFFIX} - reference a cross-reference string named NAME. SUFFIX +% is output afterwards if non-empty. +\def\refx#1#2{% + \requireauxfile + {% + \indexnofonts + \otherbackslash + \def\value##1{##1}% + \expandafter\global\expandafter\let\expandafter\thisrefX + \csname XR#1\endcsname + }% + \ifx\thisrefX\relax + % If not defined, say something at least. + \angleleft un\-de\-fined\angleright + \iflinks + \ifhavexrefs + {\toks0 = {#1}% avoid expansion of possibly-complex value + \message{\linenumber Undefined cross reference `\the\toks0'.}}% + \else + \ifwarnedxrefs\else + \global\warnedxrefstrue + \message{Cross reference values unknown; you must run TeX again.}% + \fi + \fi + \fi + \else + % It's defined, so just use it. + \thisrefX + \fi + #2% Output the suffix in any case. +} + +% This is the macro invoked by entries in the aux file. Define a control +% sequence for a cross-reference target (we prepend XR to the control sequence +% name to avoid collisions). The value is the page number. If this is a float +% type, we have more work to do. +% +\def\xrdef#1#2{% + {% Expand the node or anchor name to remove control sequences. + % \turnoffactive stops 8-bit characters being changed to commands + % like @'e. \refx does the same to retrieve the value in the definition. + \indexnofonts + \turnoffactive + \def\value##1{##1}% + \xdef\safexrefname{#1}% + }% + % + \bgroup + \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% + \egroup + % We put the \gdef inside a group to avoid the definitions building up on + % TeX's save stack, which can cause it to run out of space for aux files with + % thousands of lines. \gdef doesn't use the save stack, but \csname does + % when it defines an unknown control sequence as \relax. + % + % Was that xref control sequence that we just defined for a float? + \expandafter\iffloat\csname XR\safexrefname\endcsname + % it was a float, and we have the (safe) float type in \iffloattype. + \expandafter\let\expandafter\floatlist + \csname floatlist\iffloattype\endcsname + % + % Is this the first time we've seen this float type? + \expandafter\ifx\floatlist\relax + \toks0 = {\do}% yes, so just \do + \else + % had it before, so preserve previous elements in list. + \toks0 = \expandafter{\floatlist\do}% + \fi + % + % Remember this xref in the control sequence \floatlistFLOATTYPE, + % for later use in \listoffloats. + \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 + {\safexrefname}}% + \fi +} + +% If working on a large document in chapters, it is convenient to +% be able to disable indexing, cross-referencing, and contents, for test runs. +% This is done with @novalidate at the beginning of the file. +% +\newif\iflinks \linkstrue % by default we want the aux files. +\let\novalidate = \linksfalse + +% Used when writing to the aux file, or when using data from it. +\def\requireauxfile{% + \iflinks + \tryauxfile + % Open the new aux file. TeX will close it automatically at exit. + \immediate\openout\auxfile=\jobname.aux + \fi + \global\let\requireauxfile=\relax % Only do this once. +} + +% Read the last existing aux file, if any. No error if none exists. +% +\def\tryauxfile{% + \openin 1 \jobname.aux + \ifeof 1 \else + \readdatafile{aux}% + \global\havexrefstrue + \fi + \closein 1 +} + +\def\setupdatafile{% + \catcode`\^^@=\other + \catcode`\^^A=\other + \catcode`\^^B=\other + \catcode`\^^C=\other + \catcode`\^^D=\other + \catcode`\^^E=\other + \catcode`\^^F=\other + \catcode`\^^G=\other + \catcode`\^^H=\other + \catcode`\^^K=\other + \catcode`\^^L=\other + \catcode`\^^N=\other + \catcode`\^^P=\other + \catcode`\^^Q=\other + \catcode`\^^R=\other + \catcode`\^^S=\other + \catcode`\^^T=\other + \catcode`\^^U=\other + \catcode`\^^V=\other + \catcode`\^^W=\other + \catcode`\^^X=\other + \catcode`\^^Z=\other + \catcode`\^^[=\other + \catcode`\^^\=\other + \catcode`\^^]=\other + \catcode`\^^^=\other + \catcode`\^^_=\other + % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. + % in xref tags, i.e., node names. But since ^^e4 notation isn't + % supported in the main text, it doesn't seem desirable. Furthermore, + % that is not enough: for node names that actually contain a ^ + % character, we would end up writing a line like this: 'xrdef {'hat + % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first + % argument, and \hat is not an expandable control sequence. It could + % all be worked out, but why? Either we support ^^ or we don't. + % + % The other change necessary for this was to define \auxhat: + % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter + % and then to call \auxhat in \setq. + % + \catcode`\^=\other + % + % Special characters. Should be turned off anyway, but... + \catcode`\~=\other + \catcode`\[=\other + \catcode`\]=\other + \catcode`\"=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\$=\other + \catcode`\#=\other + \catcode`\&=\other + \catcode`\%=\other + \catcode`+=\other % avoid \+ for paranoia even though we've turned it off + % + % This is to support \ in node names and titles, since the \ + % characters end up in a \csname. It's easier than + % leaving it active and making its active definition an actual \ + % character. What I don't understand is why it works in the *value* + % of the xrdef. Seems like it should be a catcode12 \, and that + % should not typeset properly. But it works, so I'm moving on for + % now. --karl, 15jan04. + \catcode`\\=\other + % + % @ is our escape character in .aux files, and we need braces. + \catcode`\{=1 + \catcode`\}=2 + \catcode`\@=0 +} + +\def\readdatafile#1{% +\begingroup + \setupdatafile + \input\jobname.#1 +\endgroup} + + +\message{insertions,} +% including footnotes. + +\newcount \footnoteno + +% The trailing space in the following definition for supereject is +% vital for proper filling; pages come out unaligned when you do a +% pagealignmacro call if that space before the closing brace is +% removed. (Generally, numeric constants should always be followed by a +% space to prevent strange expansion errors.) +\def\supereject{\par\penalty -20000\footnoteno =0 } + +% @footnotestyle is meaningful for Info output only. +\let\footnotestyle=\comment + +{\catcode `\@=11 +% +% Auto-number footnotes. Otherwise like plain. +\gdef\footnote{% + \global\advance\footnoteno by \@ne + \edef\thisfootno{$^{\the\footnoteno}$}% + % + % In case the footnote comes at the end of a sentence, preserve the + % extra spacing after we do the footnote number. + \let\@sf\empty + \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi + % + % Remove inadvertent blank space before typesetting the footnote number. + \unskip + \thisfootno\@sf + \dofootnote +}% + +% Don't bother with the trickery in plain.tex to not require the +% footnote text as a parameter. Our footnotes don't need to be so general. +% +% Oh yes, they do; otherwise, @ifset (and anything else that uses +% \parseargline) fails inside footnotes because the tokens are fixed when +% the footnote is read. --karl, 16nov96. +% +\gdef\dofootnote{% + \insert\footins\bgroup + % + % Nested footnotes are not supported in TeX, that would take a lot + % more work. (\startsavinginserts does not suffice.) + \let\footnote=\errfootnotenest + % + % We want to typeset this text as a normal paragraph, even if the + % footnote reference occurs in (for example) a display environment. + % So reset some parameters. + \hsize=\txipagewidth + \interlinepenalty\interfootnotelinepenalty + \splittopskip\ht\strutbox % top baseline for broken footnotes + \splitmaxdepth\dp\strutbox + \floatingpenalty\@MM + \leftskip\z@skip + \rightskip\z@skip + \spaceskip\z@skip + \xspaceskip\z@skip + \parindent\defaultparindent + % + \smallfonts \rm + % + % Because we use hanging indentation in footnotes, a @noindent appears + % to exdent this text, so make it be a no-op. makeinfo does not use + % hanging indentation so @noindent can still be needed within footnote + % text after an @example or the like (not that this is good style). + \let\noindent = \relax + % + % Hang the footnote text off the number. Use \everypar in case the + % footnote extends for more than one paragraph. + \everypar = {\hang}% + \textindent{\thisfootno}% + % + % Don't crash into the line above the footnote text. Since this + % expands into a box, it must come within the paragraph, lest it + % provide a place where TeX can split the footnote. + \footstrut + % + % Invoke rest of plain TeX footnote routine. + \futurelet\next\fo@t +} +}%end \catcode `\@=11 + +\def\errfootnotenest{% + \errhelp=\EMsimple + \errmessage{Nested footnotes not supported in texinfo.tex, + even though they work in makeinfo; sorry} +} + +\def\errfootnoteheading{% + \errhelp=\EMsimple + \errmessage{Footnotes in chapters, sections, etc., are not supported} +} + +% In case a @footnote appears in a vbox, save the footnote text and create +% the real \insert just after the vbox finished. Otherwise, the insertion +% would be lost. +% Similarly, if a @footnote appears inside an alignment, save the footnote +% text to a box and make the \insert when a row of the table is finished. +% And the same can be done for other insert classes. --kasal, 16nov03. +% +% Replace the \insert primitive by a cheating macro. +% Deeper inside, just make sure that the saved insertions are not spilled +% out prematurely. +% +\def\startsavinginserts{% + \ifx \insert\ptexinsert + \let\insert\saveinsert + \else + \let\checkinserts\relax + \fi +} + +% This \insert replacement works for both \insert\footins{foo} and +% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. +% +\def\saveinsert#1{% + \edef\next{\noexpand\savetobox \makeSAVEname#1}% + \afterassignment\next + % swallow the left brace + \let\temp = +} +\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} +\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} + +\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} + +\def\placesaveins#1{% + \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname + {\box#1}% +} + +% eat @SAVE -- beware, all of them have catcode \other: +{ + \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) + \gdef\gobblesave @SAVE{} +} + +% initialization: +\def\newsaveins #1{% + \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% + \next +} +\def\newsaveinsX #1{% + \csname newbox\endcsname #1% + \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts + \checksaveins #1}% +} + +% initialize: +\let\checkinserts\empty +\newsaveins\footins +\newsaveins\margin + + +% @image. We use the macros from epsf.tex to support this. +% If epsf.tex is not installed and @image is used, we complain. +% +% Check for and read epsf.tex up front. If we read it only at @image +% time, we might be inside a group, and then its definitions would get +% undone and the next image would fail. +\openin 1 = epsf.tex +\ifeof 1 \else + % Do not bother showing banner with epsf.tex v2.7k (available in + % doc/epsf.tex and on ctan). + \def\epsfannounce{\toks0 = }% + \input epsf.tex +\fi +\closein 1 +% +% We will only complain once about lack of epsf.tex. +\newif\ifwarnednoepsf +\newhelp\noepsfhelp{epsf.tex must be installed for images to + work. It is also included in the Texinfo distribution, or you can get + it from ftp://tug.org/tex/epsf.tex.} +% +\def\image#1{% + \ifx\epsfbox\thisisundefined + \ifwarnednoepsf \else + \errhelp = \noepsfhelp + \errmessage{epsf.tex not found, images will be ignored}% + \global\warnednoepsftrue + \fi + \else + \imagexxx #1,,,,,\finish + \fi +} +% +% Arguments to @image: +% #1 is (mandatory) image filename; we tack on .eps extension. +% #2 is (optional) width, #3 is (optional) height. +% #4 is (ignored optional) html alt text. +% #5 is (ignored optional) extension. +% #6 is just the usual extra ignored arg for parsing stuff. +\newif\ifimagevmode +\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup + \catcode`\^^M = 5 % in case we're inside an example + \normalturnoffactive % allow _ et al. in names + \def\xprocessmacroarg{\eatspaces}% in case we are being used via a macro + % If the image is by itself, center it. + \ifvmode + \imagevmodetrue + \else \ifx\centersub\centerV + % for @center @image, we need a vbox so we can have our vertical space + \imagevmodetrue + \vbox\bgroup % vbox has better behavior than vtop herev + \fi\fi + % + \ifimagevmode + \nobreak\medskip + % Usually we'll have text after the image which will insert + % \parskip glue, so insert it here too to equalize the space + % above and below. + \nobreak\vskip\parskip + \nobreak + \fi + % + % Leave vertical mode so that indentation from an enclosing + % environment such as @quotation is respected. + % However, if we're at the top level, we don't want the + % normal paragraph indentation. + % On the other hand, if we are in the case of @center @image, we don't + % want to start a paragraph, which will create a hsize-width box and + % eradicate the centering. + \ifx\centersub\centerV\else \noindent \fi + % + % Output the image. + \ifpdf + % For pdfTeX and LuaTeX <= 0.80 + \dopdfimage{#1}{#2}{#3}% + \else + \ifx\XeTeXrevision\thisisundefined + % For epsf.tex + % \epsfbox itself resets \epsf?size at each figure. + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt \epsfysize=#3\relax \fi + \epsfbox{#1.eps}% + \else + % For XeTeX + \doxeteximage{#1}{#2}{#3}% + \fi + \fi + % + \ifimagevmode + \medskip % space after a standalone image + \fi + \ifx\centersub\centerV \egroup \fi +\endgroup} + + +% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, +% etc. We don't actually implement floating yet, we always include the +% float "here". But it seemed the best name for the future. +% +\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} + +% There may be a space before second and/or third parameter; delete it. +\def\eatcommaspace#1, {#1,} + +% #1 is the optional FLOATTYPE, the text label for this float, typically +% "Figure", "Table", "Example", etc. Can't contain commas. If omitted, +% this float will not be numbered and cannot be referred to. +% +% #2 is the optional xref label. Also must be present for the float to +% be referable. +% +% #3 is the optional positioning argument; for now, it is ignored. It +% will somehow specify the positions allowed to float to (here, top, bottom). +% +% We keep a separate counter for each FLOATTYPE, which we reset at each +% chapter-level command. +\let\resetallfloatnos=\empty +% +\def\dofloat#1,#2,#3,#4\finish{% + \let\thiscaption=\empty + \let\thisshortcaption=\empty + % + % don't lose footnotes inside @float. + % + % BEWARE: when the floats start float, we have to issue warning whenever an + % insert appears inside a float which could possibly float. --kasal, 26may04 + % + \startsavinginserts + % + % We can't be used inside a paragraph. + \par + % + \vtop\bgroup + \def\floattype{#1}% + \def\floatlabel{#2}% + \def\floatloc{#3}% we do nothing with this yet. + % + \ifx\floattype\empty + \let\safefloattype=\empty + \else + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + \fi + % + % If label is given but no type, we handle that as the empty type. + \ifx\floatlabel\empty \else + % We want each FLOATTYPE to be numbered separately (Figure 1, + % Table 1, Figure 2, ...). (And if no label, no number.) + % + \expandafter\getfloatno\csname\safefloattype floatno\endcsname + \global\advance\floatno by 1 + % + {% + % This magic value for \lastsection is output by \setref as the + % XREFLABEL-title value. \xrefX uses it to distinguish float + % labels (which have a completely different output format) from + % node and anchor labels. And \xrdef uses it to construct the + % lists of floats. + % + \edef\lastsection{\floatmagic=\safefloattype}% + \setref{\floatlabel}{Yfloat}% + }% + \fi + % + % start with \parskip glue, I guess. + \vskip\parskip + % + % Don't suppress indentation if a float happens to start a section. + \restorefirstparagraphindent +} + +% we have these possibilities: +% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap +% @float Foo,lbl & no caption: Foo 1.1 +% @float Foo & @caption{Cap}: Foo: Cap +% @float Foo & no caption: Foo +% @float ,lbl & Caption{Cap}: 1.1: Cap +% @float ,lbl & no caption: 1.1 +% @float & @caption{Cap}: Cap +% @float & no caption: +% +\def\Efloat{% + \let\floatident = \empty + % + % In all cases, if we have a float type, it comes first. + \ifx\floattype\empty \else \def\floatident{\floattype}\fi + % + % If we have an xref label, the number comes next. + \ifx\floatlabel\empty \else + \ifx\floattype\empty \else % if also had float type, need tie first. + \appendtomacro\floatident{\tie}% + \fi + % the number. + \appendtomacro\floatident{\chaplevelprefix\the\floatno}% + \fi + % + % Start the printed caption with what we've constructed in + % \floatident, but keep it separate; we need \floatident again. + \let\captionline = \floatident + % + \ifx\thiscaption\empty \else + \ifx\floatident\empty \else + \appendtomacro\captionline{: }% had ident, so need a colon between + \fi + % + % caption text. + \appendtomacro\captionline{\scanexp\thiscaption}% + \fi + % + % If we have anything to print, print it, with space before. + % Eventually this needs to become an \insert. + \ifx\captionline\empty \else + \vskip.5\parskip + \captionline + % + % Space below caption. + \vskip\parskip + \fi + % + % If have an xref label, write the list of floats info. Do this + % after the caption, to avoid chance of it being a breakpoint. + \ifx\floatlabel\empty \else + % Write the text that goes in the lof to the aux file as + % \floatlabel-lof. Besides \floatident, we include the short + % caption if specified, else the full caption if specified, else nothing. + {% + \requireauxfile + \atdummies + % + \ifx\thisshortcaption\empty + \def\gtemp{\thiscaption}% + \else + \def\gtemp{\thisshortcaption}% + \fi + \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident + \ifx\gtemp\empty \else : \gtemp \fi}}% + }% + \fi + \egroup % end of \vtop + % + \checkinserts +} + +% Append the tokens #2 to the definition of macro #1, not expanding either. +% +\def\appendtomacro#1#2{% + \expandafter\def\expandafter#1\expandafter{#1#2}% +} + +% @caption, @shortcaption +% +\def\caption{\docaption\thiscaption} +\def\shortcaption{\docaption\thisshortcaption} +\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} +\def\defcaption#1#2{\egroup \def#1{#2}} + +% The parameter is the control sequence identifying the counter we are +% going to use. Create it if it doesn't exist and assign it to \floatno. +\def\getfloatno#1{% + \ifx#1\relax + % Haven't seen this figure type before. + \csname newcount\endcsname #1% + % + % Remember to reset this floatno at the next chap. + \expandafter\gdef\expandafter\resetallfloatnos + \expandafter{\resetallfloatnos #1=0 }% + \fi + \let\floatno#1% +} + +% \setref calls this to get the XREFLABEL-snt value. We want an @xref +% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we +% first read the @float command. +% +\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% + +% Magic string used for the XREFLABEL-title value, so \xrefX can +% distinguish floats from other xref types. +\def\floatmagic{!!float!!} + +% #1 is the control sequence we are passed; we expand into a conditional +% which is true if #1 represents a float ref. That is, the magic +% \lastsection value which we \setref above. +% +\def\iffloat#1{\expandafter\doiffloat#1==\finish} +% +% #1 is (maybe) the \floatmagic string. If so, #2 will be the +% (safe) float type for this float. We set \iffloattype to #2. +% +\def\doiffloat#1=#2=#3\finish{% + \def\temp{#1}% + \def\iffloattype{#2}% + \ifx\temp\floatmagic +} + +% @listoffloats FLOATTYPE - print a list of floats like a table of contents. +% +\parseargdef\listoffloats{% + \def\floattype{#1}% floattype + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + % + % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. + \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax + \ifhavexrefs + % if the user said @listoffloats foo but never @float foo. + \message{\linenumber No `\safefloattype' floats to list.}% + \fi + \else + \begingroup + \leftskip=\tocindent % indent these entries like a toc + \let\do=\listoffloatsdo + \csname floatlist\safefloattype\endcsname + \endgroup + \fi +} + +% This is called on each entry in a list of floats. We're passed the +% xref label, in the form LABEL-title, which is how we save it in the +% aux file. We strip off the -title and look up \XRLABEL-lof, which +% has the text we're supposed to typeset here. +% +% Figures without xref labels will not be included in the list (since +% they won't appear in the aux file). +% +\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} +\def\listoffloatsdoentry#1-title\finish{{% + % Can't fully expand XR#1-lof because it can contain anything. Just + % pass the control sequence. On the other hand, XR#1-pg is just the + % page number, and we want to fully expand that so we can get a link + % in pdf output. + \toksA = \expandafter{\csname XR#1-lof\endcsname}% + % + % use the same \entry macro we use to generate the TOC and index. + \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% + \writeentry +}} + + +\message{localization,} + +% For single-language documents, @documentlanguage is usually given very +% early, just after @documentencoding. Single argument is the language +% (de) or locale (de_DE) abbreviation. +% +{ + \catcode`\_ = \active + \globaldefs=1 +\parseargdef\documentlanguage{% + \tex % read txi-??.tex file in plain TeX. + % Read the file by the name they passed if it exists. + \let_ = \normalunderscore % normal _ character for filename test + \openin 1 txi-#1.tex + \ifeof 1 + \documentlanguagetrywithoutunderscore #1_\finish + \else + \globaldefs = 1 % everything in the txi-LL files needs to persist + \input txi-#1.tex + \fi + \closein 1 + \endgroup % end raw TeX +} +% +% If they passed de_DE, and txi-de_DE.tex doesn't exist, +% try txi-de.tex. +% +\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{% + \openin 1 txi-#1.tex + \ifeof 1 + \errhelp = \nolanghelp + \errmessage{Cannot read language file txi-#1.tex}% + \else + \globaldefs = 1 % everything in the txi-LL files needs to persist + \input txi-#1.tex + \fi + \closein 1 +} +}% end of special _ catcode +% +\newhelp\nolanghelp{The given language definition file cannot be found or +is empty. Maybe you need to install it? Putting it in the current +directory should work if nowhere else does.} + +% This macro is called from txi-??.tex files; the first argument is the +% \language name to set (without the "\lang@" prefix), the second and +% third args are \{left,right}hyphenmin. +% +% The language names to pass are determined when the format is built. +% See the etex.log file created at that time, e.g., +% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log. +% +% With TeX Live 2008, etex now includes hyphenation patterns for all +% available languages. This means we can support hyphenation in +% Texinfo, at least to some extent. (This still doesn't solve the +% accented characters problem.) +% +\catcode`@=11 +\def\txisetlanguage#1#2#3{% + % do not set the language if the name is undefined in the current TeX. + \expandafter\ifx\csname lang@#1\endcsname \relax + \message{no patterns for #1}% + \else + \global\language = \csname lang@#1\endcsname + \fi + % but there is no harm in adjusting the hyphenmin values regardless. + \global\lefthyphenmin = #2\relax + \global\righthyphenmin = #3\relax +} + +% XeTeX and LuaTeX can handle Unicode natively. +% Their default I/O uses UTF-8 sequences instead of a byte-wise operation. +% Other TeX engines' I/O (pdfTeX, etc.) is byte-wise. +% +\newif\iftxinativeunicodecapable +\newif\iftxiusebytewiseio + +\ifx\XeTeXrevision\thisisundefined + \ifx\luatexversion\thisisundefined + \txinativeunicodecapablefalse + \txiusebytewiseiotrue + \else + \txinativeunicodecapabletrue + \txiusebytewiseiofalse + \fi +\else + \txinativeunicodecapabletrue + \txiusebytewiseiofalse +\fi + +% Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex +% for non-UTF-8 (byte-wise) encodings. +% +\def\setbytewiseio{% + \ifx\XeTeXrevision\thisisundefined + \else + \XeTeXdefaultencoding "bytes" % For subsequent files to be read + \XeTeXinputencoding "bytes" % For document root file + % Unfortunately, there seems to be no corresponding XeTeX command for + % output encoding. This is a problem for auxiliary index and TOC files. + % The only solution would be perhaps to write out @U{...} sequences in + % place of non-ASCII characters. + \fi + + \ifx\luatexversion\thisisundefined + \else + \directlua{ + local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub + local function convert_char (char) + return utf8_char(byte(char)) + end + + local function convert_line (line) + return gsub(line, ".", convert_char) + end + + callback.register("process_input_buffer", convert_line) + + local function convert_line_out (line) + local line_out = "" + for c in string.utfvalues(line) do + line_out = line_out .. string.char(c) + end + return line_out + end + + callback.register("process_output_buffer", convert_line_out) + } + \fi + + \txiusebytewiseiotrue +} + + +% Helpers for encodings. +% Set the catcode of characters 128 through 255 to the specified number. +% +\def\setnonasciicharscatcode#1{% + \count255=128 + \loop\ifnum\count255<256 + \global\catcode\count255=#1\relax + \advance\count255 by 1 + \repeat +} + +\def\setnonasciicharscatcodenonglobal#1{% + \count255=128 + \loop\ifnum\count255<256 + \catcode\count255=#1\relax + \advance\count255 by 1 + \repeat +} + +% @documentencoding sets the definition of non-ASCII characters +% according to the specified encoding. +% +\def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz} +\def\documentencodingzzz#1{% + % + % Encoding being declared for the document. + \def\declaredencoding{\csname #1.enc\endcsname}% + % + % Supported encodings: names converted to tokens in order to be able + % to compare them with \ifx. + \def\ascii{\csname US-ASCII.enc\endcsname}% + \def\latnine{\csname ISO-8859-15.enc\endcsname}% + \def\latone{\csname ISO-8859-1.enc\endcsname}% + \def\lattwo{\csname ISO-8859-2.enc\endcsname}% + \def\utfeight{\csname UTF-8.enc\endcsname}% + % + \ifx \declaredencoding \ascii + \asciichardefs + % + \else \ifx \declaredencoding \lattwo + \iftxinativeunicodecapable + \setbytewiseio + \fi + \setnonasciicharscatcode\active + \lattwochardefs + % + \else \ifx \declaredencoding \latone + \iftxinativeunicodecapable + \setbytewiseio + \fi + \setnonasciicharscatcode\active + \latonechardefs + % + \else \ifx \declaredencoding \latnine + \iftxinativeunicodecapable + \setbytewiseio + \fi + \setnonasciicharscatcode\active + \latninechardefs + % + \else \ifx \declaredencoding \utfeight + \iftxinativeunicodecapable + % For native Unicode handling (XeTeX and LuaTeX) + \nativeunicodechardefs + \else + % For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX) + \setnonasciicharscatcode\active + % since we already invoked \utfeightchardefs at the top level + % (below), do not re-invoke it, otherwise our check for duplicated + % definitions gets triggered. Making non-ascii chars active is + % sufficient. + \fi + % + \else + \message{Ignoring unknown document encoding: #1.}% + % + \fi % utfeight + \fi % latnine + \fi % latone + \fi % lattwo + \fi % ascii + % + \ifx\XeTeXrevision\thisisundefined + \else + \ifx \declaredencoding \utfeight + \else + \ifx \declaredencoding \ascii + \else + \message{Warning: XeTeX with non-UTF-8 encodings cannot handle % + non-ASCII characters in auxiliary files.}% + \fi + \fi + \fi +} + +% emacs-page +% A message to be logged when using a character that isn't available +% the default font encoding (OT1). +% +\def\missingcharmsg#1{\message{Character missing, sorry: #1.}} + +% Take account of \c (plain) vs. \, (Texinfo) difference. +\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} + +% First, make active non-ASCII characters in order for them to be +% correctly categorized when TeX reads the replacement text of +% macros containing the character definitions. +\setnonasciicharscatcode\active +% + +\def\gdefchar#1#2{% +\gdef#1{% + \ifpassthroughchars + \string#1% + \else + #2% + \fi +}} + +% Latin1 (ISO-8859-1) character definitions. +\def\latonechardefs{% + \gdefchar^^a0{\tie} + \gdefchar^^a1{\exclamdown} + \gdefchar^^a2{{\tcfont \char162}} % cent + \gdefchar^^a3{\pounds{}} + \gdefchar^^a4{{\tcfont \char164}} % currency + \gdefchar^^a5{{\tcfont \char165}} % yen + \gdefchar^^a6{{\tcfont \char166}} % broken bar + \gdefchar^^a7{\S} + \gdefchar^^a8{\"{}} + \gdefchar^^a9{\copyright{}} + \gdefchar^^aa{\ordf} + \gdefchar^^ab{\guillemetleft{}} + \gdefchar^^ac{\ensuremath\lnot} + \gdefchar^^ad{\-} + \gdefchar^^ae{\registeredsymbol{}} + \gdefchar^^af{\={}} + % + \gdefchar^^b0{\textdegree} + \gdefchar^^b1{$\pm$} + \gdefchar^^b2{$^2$} + \gdefchar^^b3{$^3$} + \gdefchar^^b4{\'{}} + \gdefchar^^b5{$\mu$} + \gdefchar^^b6{\P} + \gdefchar^^b7{\ensuremath\cdot} + \gdefchar^^b8{\cedilla\ } + \gdefchar^^b9{$^1$} + \gdefchar^^ba{\ordm} + \gdefchar^^bb{\guillemetright{}} + \gdefchar^^bc{$1\over4$} + \gdefchar^^bd{$1\over2$} + \gdefchar^^be{$3\over4$} + \gdefchar^^bf{\questiondown} + % + \gdefchar^^c0{\`A} + \gdefchar^^c1{\'A} + \gdefchar^^c2{\^A} + \gdefchar^^c3{\~A} + \gdefchar^^c4{\"A} + \gdefchar^^c5{\ringaccent A} + \gdefchar^^c6{\AE} + \gdefchar^^c7{\cedilla C} + \gdefchar^^c8{\`E} + \gdefchar^^c9{\'E} + \gdefchar^^ca{\^E} + \gdefchar^^cb{\"E} + \gdefchar^^cc{\`I} + \gdefchar^^cd{\'I} + \gdefchar^^ce{\^I} + \gdefchar^^cf{\"I} + % + \gdefchar^^d0{\DH} + \gdefchar^^d1{\~N} + \gdefchar^^d2{\`O} + \gdefchar^^d3{\'O} + \gdefchar^^d4{\^O} + \gdefchar^^d5{\~O} + \gdefchar^^d6{\"O} + \gdefchar^^d7{$\times$} + \gdefchar^^d8{\O} + \gdefchar^^d9{\`U} + \gdefchar^^da{\'U} + \gdefchar^^db{\^U} + \gdefchar^^dc{\"U} + \gdefchar^^dd{\'Y} + \gdefchar^^de{\TH} + \gdefchar^^df{\ss} + % + \gdefchar^^e0{\`a} + \gdefchar^^e1{\'a} + \gdefchar^^e2{\^a} + \gdefchar^^e3{\~a} + \gdefchar^^e4{\"a} + \gdefchar^^e5{\ringaccent a} + \gdefchar^^e6{\ae} + \gdefchar^^e7{\cedilla c} + \gdefchar^^e8{\`e} + \gdefchar^^e9{\'e} + \gdefchar^^ea{\^e} + \gdefchar^^eb{\"e} + \gdefchar^^ec{\`{\dotless i}} + \gdefchar^^ed{\'{\dotless i}} + \gdefchar^^ee{\^{\dotless i}} + \gdefchar^^ef{\"{\dotless i}} + % + \gdefchar^^f0{\dh} + \gdefchar^^f1{\~n} + \gdefchar^^f2{\`o} + \gdefchar^^f3{\'o} + \gdefchar^^f4{\^o} + \gdefchar^^f5{\~o} + \gdefchar^^f6{\"o} + \gdefchar^^f7{$\div$} + \gdefchar^^f8{\o} + \gdefchar^^f9{\`u} + \gdefchar^^fa{\'u} + \gdefchar^^fb{\^u} + \gdefchar^^fc{\"u} + \gdefchar^^fd{\'y} + \gdefchar^^fe{\th} + \gdefchar^^ff{\"y} +} + +% Latin9 (ISO-8859-15) encoding character definitions. +\def\latninechardefs{% + % Encoding is almost identical to Latin1. + \latonechardefs + % + \gdefchar^^a4{\euro{}} + \gdefchar^^a6{\v S} + \gdefchar^^a8{\v s} + \gdefchar^^b4{\v Z} + \gdefchar^^b8{\v z} + \gdefchar^^bc{\OE} + \gdefchar^^bd{\oe} + \gdefchar^^be{\"Y} +} + +% Latin2 (ISO-8859-2) character definitions. +\def\lattwochardefs{% + \gdefchar^^a0{\tie} + \gdefchar^^a1{\ogonek{A}} + \gdefchar^^a2{\u{}} + \gdefchar^^a3{\L} + \gdefchar^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdefchar^^a5{\v L} + \gdefchar^^a6{\'S} + \gdefchar^^a7{\S} + \gdefchar^^a8{\"{}} + \gdefchar^^a9{\v S} + \gdefchar^^aa{\cedilla S} + \gdefchar^^ab{\v T} + \gdefchar^^ac{\'Z} + \gdefchar^^ad{\-} + \gdefchar^^ae{\v Z} + \gdefchar^^af{\dotaccent Z} + % + \gdefchar^^b0{\textdegree{}} + \gdefchar^^b1{\ogonek{a}} + \gdefchar^^b2{\ogonek{ }} + \gdefchar^^b3{\l} + \gdefchar^^b4{\'{}} + \gdefchar^^b5{\v l} + \gdefchar^^b6{\'s} + \gdefchar^^b7{\v{}} + \gdefchar^^b8{\cedilla\ } + \gdefchar^^b9{\v s} + \gdefchar^^ba{\cedilla s} + \gdefchar^^bb{\v t} + \gdefchar^^bc{\'z} + \gdefchar^^bd{\H{}} + \gdefchar^^be{\v z} + \gdefchar^^bf{\dotaccent z} + % + \gdefchar^^c0{\'R} + \gdefchar^^c1{\'A} + \gdefchar^^c2{\^A} + \gdefchar^^c3{\u A} + \gdefchar^^c4{\"A} + \gdefchar^^c5{\'L} + \gdefchar^^c6{\'C} + \gdefchar^^c7{\cedilla C} + \gdefchar^^c8{\v C} + \gdefchar^^c9{\'E} + \gdefchar^^ca{\ogonek{E}} + \gdefchar^^cb{\"E} + \gdefchar^^cc{\v E} + \gdefchar^^cd{\'I} + \gdefchar^^ce{\^I} + \gdefchar^^cf{\v D} + % + \gdefchar^^d0{\DH} + \gdefchar^^d1{\'N} + \gdefchar^^d2{\v N} + \gdefchar^^d3{\'O} + \gdefchar^^d4{\^O} + \gdefchar^^d5{\H O} + \gdefchar^^d6{\"O} + \gdefchar^^d7{$\times$} + \gdefchar^^d8{\v R} + \gdefchar^^d9{\ringaccent U} + \gdefchar^^da{\'U} + \gdefchar^^db{\H U} + \gdefchar^^dc{\"U} + \gdefchar^^dd{\'Y} + \gdefchar^^de{\cedilla T} + \gdefchar^^df{\ss} + % + \gdefchar^^e0{\'r} + \gdefchar^^e1{\'a} + \gdefchar^^e2{\^a} + \gdefchar^^e3{\u a} + \gdefchar^^e4{\"a} + \gdefchar^^e5{\'l} + \gdefchar^^e6{\'c} + \gdefchar^^e7{\cedilla c} + \gdefchar^^e8{\v c} + \gdefchar^^e9{\'e} + \gdefchar^^ea{\ogonek{e}} + \gdefchar^^eb{\"e} + \gdefchar^^ec{\v e} + \gdefchar^^ed{\'{\dotless{i}}} + \gdefchar^^ee{\^{\dotless{i}}} + \gdefchar^^ef{\v d} + % + \gdefchar^^f0{\dh} + \gdefchar^^f1{\'n} + \gdefchar^^f2{\v n} + \gdefchar^^f3{\'o} + \gdefchar^^f4{\^o} + \gdefchar^^f5{\H o} + \gdefchar^^f6{\"o} + \gdefchar^^f7{$\div$} + \gdefchar^^f8{\v r} + \gdefchar^^f9{\ringaccent u} + \gdefchar^^fa{\'u} + \gdefchar^^fb{\H u} + \gdefchar^^fc{\"u} + \gdefchar^^fd{\'y} + \gdefchar^^fe{\cedilla t} + \gdefchar^^ff{\dotaccent{}} +} + +% UTF-8 character definitions. +% +% This code to support UTF-8 is based on LaTeX's utf8.def, with some +% changes for Texinfo conventions. It is included here under the GPL by +% permission from Frank Mittelbach and the LaTeX team. +% +\newcount\countUTFx +\newcount\countUTFy +\newcount\countUTFz + +\gdef\UTFviiiTwoOctets#1#2{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\endcsname} +% +\gdef\UTFviiiThreeOctets#1#2#3{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} +% +\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} + +\gdef\UTFviiiDefined#1{% + \ifx #1\relax + \message{\linenumber Unicode char \string #1 not defined for Texinfo}% + \else + \expandafter #1% + \fi +} + +% Give non-ASCII bytes the active definitions for processing UTF-8 sequences +\begingroup + \catcode`\~13 + \catcode`\$12 + \catcode`\"12 + + % Loop from \countUTFx to \countUTFy, performing \UTFviiiTmp + % substituting ~ and $ with a character token of that value. + \def\UTFviiiLoop{% + \global\catcode\countUTFx\active + \uccode`\~\countUTFx + \uccode`\$\countUTFx + \uppercase\expandafter{\UTFviiiTmp}% + \advance\countUTFx by 1 + \ifnum\countUTFx < \countUTFy + \expandafter\UTFviiiLoop + \fi} + + % For bytes other than the first in a UTF-8 sequence. Not expected to + % be expanded except when writing to auxiliary files. + \countUTFx = "80 + \countUTFy = "C2 + \def\UTFviiiTmp{% + \gdef~{% + \ifpassthroughchars $\fi}}% + \UTFviiiLoop + + \countUTFx = "C2 + \countUTFy = "E0 + \def\UTFviiiTmp{% + \gdef~{% + \ifpassthroughchars $% + \else\expandafter\UTFviiiTwoOctets\expandafter$\fi}}% + \UTFviiiLoop + + \countUTFx = "E0 + \countUTFy = "F0 + \def\UTFviiiTmp{% + \gdef~{% + \ifpassthroughchars $% + \else\expandafter\UTFviiiThreeOctets\expandafter$\fi}}% + \UTFviiiLoop + + \countUTFx = "F0 + \countUTFy = "F4 + \def\UTFviiiTmp{% + \gdef~{% + \ifpassthroughchars $% + \else\expandafter\UTFviiiFourOctets\expandafter$\fi + }}% + \UTFviiiLoop +\endgroup + +\def\globallet{\global\let} % save some \expandafter's below + +% @U{xxxx} to produce U+xxxx, if we support it. +\def\U#1{% + \expandafter\ifx\csname uni:#1\endcsname \relax + \iftxinativeunicodecapable + % All Unicode characters can be used if native Unicode handling is + % active. However, if the font does not have the glyph, + % letters are missing. + \begingroup + \uccode`\.="#1\relax + \uppercase{.} + \endgroup + \else + \errhelp = \EMsimple + \errmessage{Unicode character U+#1 not supported, sorry}% + \fi + \else + \csname uni:#1\endcsname + \fi +} + +% These macros are used here to construct the name of a control +% sequence to be defined. +\def\UTFviiiTwoOctetsName#1#2{% + \csname u8:#1\string #2\endcsname}% +\def\UTFviiiThreeOctetsName#1#2#3{% + \csname u8:#1\string #2\string #3\endcsname}% +\def\UTFviiiFourOctetsName#1#2#3#4{% + \csname u8:#1\string #2\string #3\string #4\endcsname}% + +% For UTF-8 byte sequences (TeX, e-TeX and pdfTeX), +% provide a definition macro to replace a Unicode character; +% this gets used by the @U command +% +\begingroup + \catcode`\"=12 + \catcode`\<=12 + \catcode`\.=12 + \catcode`\,=12 + \catcode`\;=12 + \catcode`\!=12 + \catcode`\~=13 + \gdef\DeclareUnicodeCharacterUTFviii#1#2{% + \countUTFz = "#1\relax + \begingroup + \parseXMLCharref + + % Give \u8:... its definition. The sequence of seven \expandafter's + % expands after the \gdef three times, e.g. + % + % 1. \UTFviiTwoOctetsName B1 B2 + % 2. \csname u8:B1 \string B2 \endcsname + % 3. \u8: B1 B2 (a single control sequence token) + % + \expandafter\expandafter + \expandafter\expandafter + \expandafter\expandafter + \expandafter\gdef \UTFviiiTmp{#2}% + % + \expandafter\ifx\csname uni:#1\endcsname \relax \else + \message{Internal error, already defined: #1}% + \fi + % + % define an additional control sequence for this code point. + \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp + \endgroup} + % + % Given the value in \countUTFz as a Unicode code point, set \UTFviiiTmp + % to the corresponding UTF-8 sequence. + \gdef\parseXMLCharref{% + \ifnum\countUTFz < "A0\relax + \errhelp = \EMsimple + \errmessage{Cannot define Unicode char value < 00A0}% + \else\ifnum\countUTFz < "800\relax + \parseUTFviiiA,% + \parseUTFviiiB C\UTFviiiTwoOctetsName.,% + \else\ifnum\countUTFz < "10000\relax + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiB E\UTFviiiThreeOctetsName.{,;}% + \else + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiA!% + \parseUTFviiiB F\UTFviiiFourOctetsName.{!,;}% + \fi\fi\fi + } + + % Extract a byte from the end of the UTF-8 representation of \countUTFx. + % It must be a non-initial byte in the sequence. + % Change \uccode of #1 for it to be used in \parseUTFviiiB as one + % of the bytes. + \gdef\parseUTFviiiA#1{% + \countUTFx = \countUTFz + \divide\countUTFz by 64 + \countUTFy = \countUTFz % Save to be the future value of \countUTFz. + \multiply\countUTFz by 64 + + % \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract + % in order to get the last five bits. + \advance\countUTFx by -\countUTFz + + % Convert this to the byte in the UTF-8 sequence. + \advance\countUTFx by 128 + \uccode `#1\countUTFx + \countUTFz = \countUTFy} + + % Used to put a UTF-8 byte sequence into \UTFviiiTmp + % #1 is the increment for \countUTFz to yield a the first byte of the UTF-8 + % sequence. + % #2 is one of the \UTFviii*OctetsName macros. + % #3 is always a full stop (.) + % #4 is a template for the other bytes in the sequence. The values for these + % bytes is substituted in here with \uppercase using the \uccode's. + \gdef\parseUTFviiiB#1#2#3#4{% + \advance\countUTFz by "#10\relax + \uccode `#3\countUTFz + \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} +\endgroup + +% For native Unicode handling (XeTeX and LuaTeX), +% provide a definition macro that sets a catcode to `other' non-globally +% +\def\DeclareUnicodeCharacterNativeOther#1#2{% + \catcode"#1=\other +} + +% https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M +% U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block) +% U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block) +% U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A +% U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B +% +% Many of our renditions are less than wonderful, and all the missing +% characters are available somewhere. Loading the necessary fonts +% awaits user request. We can't truly support Unicode without +% reimplementing everything that's been done in LaTeX for many years, +% plus probably using luatex or xetex, and who knows what else. +% We won't be doing that here in this simple file. But we can try to at +% least make most of the characters not bomb out. +% +\def\unicodechardefs{% + \DeclareUnicodeCharacter{00A0}{\tie}% + \DeclareUnicodeCharacter{00A1}{\exclamdown}% + \DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent + \DeclareUnicodeCharacter{00A3}{\pounds{}}% + \DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency + \DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen + \DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar + \DeclareUnicodeCharacter{00A7}{\S}% + \DeclareUnicodeCharacter{00A8}{\"{ }}% + \DeclareUnicodeCharacter{00A9}{\copyright{}}% + \DeclareUnicodeCharacter{00AA}{\ordf}% + \DeclareUnicodeCharacter{00AB}{\guillemetleft{}}% + \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}% + \DeclareUnicodeCharacter{00AD}{\-}% + \DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}% + \DeclareUnicodeCharacter{00AF}{\={ }}% + % + \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}% + \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}% + \DeclareUnicodeCharacter{00B2}{$^2$}% + \DeclareUnicodeCharacter{00B3}{$^3$}% + \DeclareUnicodeCharacter{00B4}{\'{ }}% + \DeclareUnicodeCharacter{00B5}{$\mu$}% + \DeclareUnicodeCharacter{00B6}{\P}% + \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}% + \DeclareUnicodeCharacter{00B8}{\cedilla{ }}% + \DeclareUnicodeCharacter{00B9}{$^1$}% + \DeclareUnicodeCharacter{00BA}{\ordm}% + \DeclareUnicodeCharacter{00BB}{\guillemetright{}}% + \DeclareUnicodeCharacter{00BC}{$1\over4$}% + \DeclareUnicodeCharacter{00BD}{$1\over2$}% + \DeclareUnicodeCharacter{00BE}{$3\over4$}% + \DeclareUnicodeCharacter{00BF}{\questiondown}% + % + \DeclareUnicodeCharacter{00C0}{\`A}% + \DeclareUnicodeCharacter{00C1}{\'A}% + \DeclareUnicodeCharacter{00C2}{\^A}% + \DeclareUnicodeCharacter{00C3}{\~A}% + \DeclareUnicodeCharacter{00C4}{\"A}% + \DeclareUnicodeCharacter{00C5}{\AA}% + \DeclareUnicodeCharacter{00C6}{\AE}% + \DeclareUnicodeCharacter{00C7}{\cedilla{C}}% + \DeclareUnicodeCharacter{00C8}{\`E}% + \DeclareUnicodeCharacter{00C9}{\'E}% + \DeclareUnicodeCharacter{00CA}{\^E}% + \DeclareUnicodeCharacter{00CB}{\"E}% + \DeclareUnicodeCharacter{00CC}{\`I}% + \DeclareUnicodeCharacter{00CD}{\'I}% + \DeclareUnicodeCharacter{00CE}{\^I}% + \DeclareUnicodeCharacter{00CF}{\"I}% + % + \DeclareUnicodeCharacter{00D0}{\DH}% + \DeclareUnicodeCharacter{00D1}{\~N}% + \DeclareUnicodeCharacter{00D2}{\`O}% + \DeclareUnicodeCharacter{00D3}{\'O}% + \DeclareUnicodeCharacter{00D4}{\^O}% + \DeclareUnicodeCharacter{00D5}{\~O}% + \DeclareUnicodeCharacter{00D6}{\"O}% + \DeclareUnicodeCharacter{00D7}{\ensuremath\times}% + \DeclareUnicodeCharacter{00D8}{\O}% + \DeclareUnicodeCharacter{00D9}{\`U}% + \DeclareUnicodeCharacter{00DA}{\'U}% + \DeclareUnicodeCharacter{00DB}{\^U}% + \DeclareUnicodeCharacter{00DC}{\"U}% + \DeclareUnicodeCharacter{00DD}{\'Y}% + \DeclareUnicodeCharacter{00DE}{\TH}% + \DeclareUnicodeCharacter{00DF}{\ss}% + % + \DeclareUnicodeCharacter{00E0}{\`a}% + \DeclareUnicodeCharacter{00E1}{\'a}% + \DeclareUnicodeCharacter{00E2}{\^a}% + \DeclareUnicodeCharacter{00E3}{\~a}% + \DeclareUnicodeCharacter{00E4}{\"a}% + \DeclareUnicodeCharacter{00E5}{\aa}% + \DeclareUnicodeCharacter{00E6}{\ae}% + \DeclareUnicodeCharacter{00E7}{\cedilla{c}}% + \DeclareUnicodeCharacter{00E8}{\`e}% + \DeclareUnicodeCharacter{00E9}{\'e}% + \DeclareUnicodeCharacter{00EA}{\^e}% + \DeclareUnicodeCharacter{00EB}{\"e}% + \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}% + \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}% + \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}% + \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}% + % + \DeclareUnicodeCharacter{00F0}{\dh}% + \DeclareUnicodeCharacter{00F1}{\~n}% + \DeclareUnicodeCharacter{00F2}{\`o}% + \DeclareUnicodeCharacter{00F3}{\'o}% + \DeclareUnicodeCharacter{00F4}{\^o}% + \DeclareUnicodeCharacter{00F5}{\~o}% + \DeclareUnicodeCharacter{00F6}{\"o}% + \DeclareUnicodeCharacter{00F7}{\ensuremath\div}% + \DeclareUnicodeCharacter{00F8}{\o}% + \DeclareUnicodeCharacter{00F9}{\`u}% + \DeclareUnicodeCharacter{00FA}{\'u}% + \DeclareUnicodeCharacter{00FB}{\^u}% + \DeclareUnicodeCharacter{00FC}{\"u}% + \DeclareUnicodeCharacter{00FD}{\'y}% + \DeclareUnicodeCharacter{00FE}{\th}% + \DeclareUnicodeCharacter{00FF}{\"y}% + % + \DeclareUnicodeCharacter{0100}{\=A}% + \DeclareUnicodeCharacter{0101}{\=a}% + \DeclareUnicodeCharacter{0102}{\u{A}}% + \DeclareUnicodeCharacter{0103}{\u{a}}% + \DeclareUnicodeCharacter{0104}{\ogonek{A}}% + \DeclareUnicodeCharacter{0105}{\ogonek{a}}% + \DeclareUnicodeCharacter{0106}{\'C}% + \DeclareUnicodeCharacter{0107}{\'c}% + \DeclareUnicodeCharacter{0108}{\^C}% + \DeclareUnicodeCharacter{0109}{\^c}% + \DeclareUnicodeCharacter{010A}{\dotaccent{C}}% + \DeclareUnicodeCharacter{010B}{\dotaccent{c}}% + \DeclareUnicodeCharacter{010C}{\v{C}}% + \DeclareUnicodeCharacter{010D}{\v{c}}% + \DeclareUnicodeCharacter{010E}{\v{D}}% + \DeclareUnicodeCharacter{010F}{d'}% + % + \DeclareUnicodeCharacter{0110}{\DH}% + \DeclareUnicodeCharacter{0111}{\dh}% + \DeclareUnicodeCharacter{0112}{\=E}% + \DeclareUnicodeCharacter{0113}{\=e}% + \DeclareUnicodeCharacter{0114}{\u{E}}% + \DeclareUnicodeCharacter{0115}{\u{e}}% + \DeclareUnicodeCharacter{0116}{\dotaccent{E}}% + \DeclareUnicodeCharacter{0117}{\dotaccent{e}}% + \DeclareUnicodeCharacter{0118}{\ogonek{E}}% + \DeclareUnicodeCharacter{0119}{\ogonek{e}}% + \DeclareUnicodeCharacter{011A}{\v{E}}% + \DeclareUnicodeCharacter{011B}{\v{e}}% + \DeclareUnicodeCharacter{011C}{\^G}% + \DeclareUnicodeCharacter{011D}{\^g}% + \DeclareUnicodeCharacter{011E}{\u{G}}% + \DeclareUnicodeCharacter{011F}{\u{g}}% + % + \DeclareUnicodeCharacter{0120}{\dotaccent{G}}% + \DeclareUnicodeCharacter{0121}{\dotaccent{g}}% + \DeclareUnicodeCharacter{0122}{\cedilla{G}}% + \DeclareUnicodeCharacter{0123}{\cedilla{g}}% + \DeclareUnicodeCharacter{0124}{\^H}% + \DeclareUnicodeCharacter{0125}{\^h}% + \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}% + \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}% + \DeclareUnicodeCharacter{0128}{\~I}% + \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}% + \DeclareUnicodeCharacter{012A}{\=I}% + \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}% + \DeclareUnicodeCharacter{012C}{\u{I}}% + \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}% + \DeclareUnicodeCharacter{012E}{\ogonek{I}}% + \DeclareUnicodeCharacter{012F}{\ogonek{i}}% + % + \DeclareUnicodeCharacter{0130}{\dotaccent{I}}% + \DeclareUnicodeCharacter{0131}{\dotless{i}}% + \DeclareUnicodeCharacter{0132}{IJ}% + \DeclareUnicodeCharacter{0133}{ij}% + \DeclareUnicodeCharacter{0134}{\^J}% + \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}% + \DeclareUnicodeCharacter{0136}{\cedilla{K}}% + \DeclareUnicodeCharacter{0137}{\cedilla{k}}% + \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}% + \DeclareUnicodeCharacter{0139}{\'L}% + \DeclareUnicodeCharacter{013A}{\'l}% + \DeclareUnicodeCharacter{013B}{\cedilla{L}}% + \DeclareUnicodeCharacter{013C}{\cedilla{l}}% + \DeclareUnicodeCharacter{013D}{L'}% should kern + \DeclareUnicodeCharacter{013E}{l'}% should kern + \DeclareUnicodeCharacter{013F}{L\U{00B7}}% + % + \DeclareUnicodeCharacter{0140}{l\U{00B7}}% + \DeclareUnicodeCharacter{0141}{\L}% + \DeclareUnicodeCharacter{0142}{\l}% + \DeclareUnicodeCharacter{0143}{\'N}% + \DeclareUnicodeCharacter{0144}{\'n}% + \DeclareUnicodeCharacter{0145}{\cedilla{N}}% + \DeclareUnicodeCharacter{0146}{\cedilla{n}}% + \DeclareUnicodeCharacter{0147}{\v{N}}% + \DeclareUnicodeCharacter{0148}{\v{n}}% + \DeclareUnicodeCharacter{0149}{'n}% + \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}% + \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}% + \DeclareUnicodeCharacter{014C}{\=O}% + \DeclareUnicodeCharacter{014D}{\=o}% + \DeclareUnicodeCharacter{014E}{\u{O}}% + \DeclareUnicodeCharacter{014F}{\u{o}}% + % + \DeclareUnicodeCharacter{0150}{\H{O}}% + \DeclareUnicodeCharacter{0151}{\H{o}}% + \DeclareUnicodeCharacter{0152}{\OE}% + \DeclareUnicodeCharacter{0153}{\oe}% + \DeclareUnicodeCharacter{0154}{\'R}% + \DeclareUnicodeCharacter{0155}{\'r}% + \DeclareUnicodeCharacter{0156}{\cedilla{R}}% + \DeclareUnicodeCharacter{0157}{\cedilla{r}}% + \DeclareUnicodeCharacter{0158}{\v{R}}% + \DeclareUnicodeCharacter{0159}{\v{r}}% + \DeclareUnicodeCharacter{015A}{\'S}% + \DeclareUnicodeCharacter{015B}{\'s}% + \DeclareUnicodeCharacter{015C}{\^S}% + \DeclareUnicodeCharacter{015D}{\^s}% + \DeclareUnicodeCharacter{015E}{\cedilla{S}}% + \DeclareUnicodeCharacter{015F}{\cedilla{s}}% + % + \DeclareUnicodeCharacter{0160}{\v{S}}% + \DeclareUnicodeCharacter{0161}{\v{s}}% + \DeclareUnicodeCharacter{0162}{\cedilla{T}}% + \DeclareUnicodeCharacter{0163}{\cedilla{t}}% + \DeclareUnicodeCharacter{0164}{\v{T}}% + \DeclareUnicodeCharacter{0165}{\v{t}}% + \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}% + \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}% + \DeclareUnicodeCharacter{0168}{\~U}% + \DeclareUnicodeCharacter{0169}{\~u}% + \DeclareUnicodeCharacter{016A}{\=U}% + \DeclareUnicodeCharacter{016B}{\=u}% + \DeclareUnicodeCharacter{016C}{\u{U}}% + \DeclareUnicodeCharacter{016D}{\u{u}}% + \DeclareUnicodeCharacter{016E}{\ringaccent{U}}% + \DeclareUnicodeCharacter{016F}{\ringaccent{u}}% + % + \DeclareUnicodeCharacter{0170}{\H{U}}% + \DeclareUnicodeCharacter{0171}{\H{u}}% + \DeclareUnicodeCharacter{0172}{\ogonek{U}}% + \DeclareUnicodeCharacter{0173}{\ogonek{u}}% + \DeclareUnicodeCharacter{0174}{\^W}% + \DeclareUnicodeCharacter{0175}{\^w}% + \DeclareUnicodeCharacter{0176}{\^Y}% + \DeclareUnicodeCharacter{0177}{\^y}% + \DeclareUnicodeCharacter{0178}{\"Y}% + \DeclareUnicodeCharacter{0179}{\'Z}% + \DeclareUnicodeCharacter{017A}{\'z}% + \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}% + \DeclareUnicodeCharacter{017C}{\dotaccent{z}}% + \DeclareUnicodeCharacter{017D}{\v{Z}}% + \DeclareUnicodeCharacter{017E}{\v{z}}% + \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}% + % + \DeclareUnicodeCharacter{01C4}{D\v{Z}}% + \DeclareUnicodeCharacter{01C5}{D\v{z}}% + \DeclareUnicodeCharacter{01C6}{d\v{z}}% + \DeclareUnicodeCharacter{01C7}{LJ}% + \DeclareUnicodeCharacter{01C8}{Lj}% + \DeclareUnicodeCharacter{01C9}{lj}% + \DeclareUnicodeCharacter{01CA}{NJ}% + \DeclareUnicodeCharacter{01CB}{Nj}% + \DeclareUnicodeCharacter{01CC}{nj}% + \DeclareUnicodeCharacter{01CD}{\v{A}}% + \DeclareUnicodeCharacter{01CE}{\v{a}}% + \DeclareUnicodeCharacter{01CF}{\v{I}}% + % + \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}% + \DeclareUnicodeCharacter{01D1}{\v{O}}% + \DeclareUnicodeCharacter{01D2}{\v{o}}% + \DeclareUnicodeCharacter{01D3}{\v{U}}% + \DeclareUnicodeCharacter{01D4}{\v{u}}% + % + \DeclareUnicodeCharacter{01E2}{\={\AE}}% + \DeclareUnicodeCharacter{01E3}{\={\ae}}% + \DeclareUnicodeCharacter{01E6}{\v{G}}% + \DeclareUnicodeCharacter{01E7}{\v{g}}% + \DeclareUnicodeCharacter{01E8}{\v{K}}% + \DeclareUnicodeCharacter{01E9}{\v{k}}% + % + \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}% + \DeclareUnicodeCharacter{01F1}{DZ}% + \DeclareUnicodeCharacter{01F2}{Dz}% + \DeclareUnicodeCharacter{01F3}{dz}% + \DeclareUnicodeCharacter{01F4}{\'G}% + \DeclareUnicodeCharacter{01F5}{\'g}% + \DeclareUnicodeCharacter{01F8}{\`N}% + \DeclareUnicodeCharacter{01F9}{\`n}% + \DeclareUnicodeCharacter{01FC}{\'{\AE}}% + \DeclareUnicodeCharacter{01FD}{\'{\ae}}% + \DeclareUnicodeCharacter{01FE}{\'{\O}}% + \DeclareUnicodeCharacter{01FF}{\'{\o}}% + % + \DeclareUnicodeCharacter{021E}{\v{H}}% + \DeclareUnicodeCharacter{021F}{\v{h}}% + % + \DeclareUnicodeCharacter{0226}{\dotaccent{A}}% + \DeclareUnicodeCharacter{0227}{\dotaccent{a}}% + \DeclareUnicodeCharacter{0228}{\cedilla{E}}% + \DeclareUnicodeCharacter{0229}{\cedilla{e}}% + \DeclareUnicodeCharacter{022E}{\dotaccent{O}}% + \DeclareUnicodeCharacter{022F}{\dotaccent{o}}% + % + \DeclareUnicodeCharacter{0232}{\=Y}% + \DeclareUnicodeCharacter{0233}{\=y}% + \DeclareUnicodeCharacter{0237}{\dotless{j}}% + % + \DeclareUnicodeCharacter{02DB}{\ogonek{ }}% + % + % Greek letters upper case + \DeclareUnicodeCharacter{0391}{{\it A}}% + \DeclareUnicodeCharacter{0392}{{\it B}}% + \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}% + \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}% + \DeclareUnicodeCharacter{0395}{{\it E}}% + \DeclareUnicodeCharacter{0396}{{\it Z}}% + \DeclareUnicodeCharacter{0397}{{\it H}}% + \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}% + \DeclareUnicodeCharacter{0399}{{\it I}}% + \DeclareUnicodeCharacter{039A}{{\it K}}% + \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}% + \DeclareUnicodeCharacter{039C}{{\it M}}% + \DeclareUnicodeCharacter{039D}{{\it N}}% + \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}% + \DeclareUnicodeCharacter{039F}{{\it O}}% + \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}% + \DeclareUnicodeCharacter{03A1}{{\it P}}% + %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma + \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}% + \DeclareUnicodeCharacter{03A4}{{\it T}}% + \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}% + \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}% + \DeclareUnicodeCharacter{03A7}{{\it X}}% + \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}% + \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}% + % + % Vowels with accents + \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}% + \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}% + \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}% + \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}% + \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}% + \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}% + % + % Standalone accent + \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}% + % + % Greek letters lower case + \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}% + \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}% + \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}% + \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}% + \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}% + \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}% + \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}% + \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}% + \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}% + \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}% + \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}% + \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}% + \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}% + \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}% + \DeclareUnicodeCharacter{03BF}{{\it o}}% omicron + \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}% + \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}% + \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}% + \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}% + \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}% + \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}% + \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}% + \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}% + \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}% + \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}% + % + % More Greek vowels with accents + \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}% + \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}% + \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}% + \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}% + \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}% + % + % Variant Greek letters + \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}% + \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}% + \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}% + % + \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}% + \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}% + \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}% + \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}% + \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}% + \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}% + \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}% + \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}% + \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}% + \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}% + \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}% + \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}% + % + \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}% + \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}% + % + \DeclareUnicodeCharacter{1E20}{\=G}% + \DeclareUnicodeCharacter{1E21}{\=g}% + \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}% + \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}% + \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}% + \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}% + \DeclareUnicodeCharacter{1E26}{\"H}% + \DeclareUnicodeCharacter{1E27}{\"h}% + % + \DeclareUnicodeCharacter{1E30}{\'K}% + \DeclareUnicodeCharacter{1E31}{\'k}% + \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}% + \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}% + \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}% + \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}% + \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}% + \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}% + \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}% + \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}% + \DeclareUnicodeCharacter{1E3E}{\'M}% + \DeclareUnicodeCharacter{1E3F}{\'m}% + % + \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}% + \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}% + \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}% + \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}% + \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}% + \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}% + \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}% + \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}% + \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}% + \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}% + % + \DeclareUnicodeCharacter{1E54}{\'P}% + \DeclareUnicodeCharacter{1E55}{\'p}% + \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}% + \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}% + \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}% + \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}% + \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}% + \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}% + \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}% + \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}% + % + \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}% + \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}% + \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}% + \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}% + \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}% + \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}% + \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}% + \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}% + \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}% + \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}% + % + \DeclareUnicodeCharacter{1E7C}{\~V}% + \DeclareUnicodeCharacter{1E7D}{\~v}% + \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}% + \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}% + % + \DeclareUnicodeCharacter{1E80}{\`W}% + \DeclareUnicodeCharacter{1E81}{\`w}% + \DeclareUnicodeCharacter{1E82}{\'W}% + \DeclareUnicodeCharacter{1E83}{\'w}% + \DeclareUnicodeCharacter{1E84}{\"W}% + \DeclareUnicodeCharacter{1E85}{\"w}% + \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}% + \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}% + \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}% + \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}% + \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}% + \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}% + \DeclareUnicodeCharacter{1E8C}{\"X}% + \DeclareUnicodeCharacter{1E8D}{\"x}% + \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}% + \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}% + % + \DeclareUnicodeCharacter{1E90}{\^Z}% + \DeclareUnicodeCharacter{1E91}{\^z}% + \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}% + \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}% + \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}% + \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}% + \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}% + \DeclareUnicodeCharacter{1E97}{\"t}% + \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}% + \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}% + % + \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}% + \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}% + % + \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}% + \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}% + \DeclareUnicodeCharacter{1EBC}{\~E}% + \DeclareUnicodeCharacter{1EBD}{\~e}% + % + \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}% + \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}% + \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}% + \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}% + % + \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}% + \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}% + % + \DeclareUnicodeCharacter{1EF2}{\`Y}% + \DeclareUnicodeCharacter{1EF3}{\`y}% + \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}% + % + \DeclareUnicodeCharacter{1EF8}{\~Y}% + \DeclareUnicodeCharacter{1EF9}{\~y}% + % + % Punctuation + \DeclareUnicodeCharacter{2013}{--}% + \DeclareUnicodeCharacter{2014}{---}% + \DeclareUnicodeCharacter{2018}{\quoteleft{}}% + \DeclareUnicodeCharacter{2019}{\quoteright{}}% + \DeclareUnicodeCharacter{201A}{\quotesinglbase{}}% + \DeclareUnicodeCharacter{201C}{\quotedblleft{}}% + \DeclareUnicodeCharacter{201D}{\quotedblright{}}% + \DeclareUnicodeCharacter{201E}{\quotedblbase{}}% + \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}% + \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}% + \DeclareUnicodeCharacter{2022}{\bullet{}}% + \DeclareUnicodeCharacter{202F}{\thinspace}% + \DeclareUnicodeCharacter{2026}{\dots{}}% + \DeclareUnicodeCharacter{2039}{\guilsinglleft{}}% + \DeclareUnicodeCharacter{203A}{\guilsinglright{}}% + % + \DeclareUnicodeCharacter{20AC}{\euro{}}% + % + \DeclareUnicodeCharacter{2192}{\expansion{}}% + \DeclareUnicodeCharacter{21D2}{\result{}}% + % + % Mathematical symbols + \DeclareUnicodeCharacter{2200}{\ensuremath\forall}% + \DeclareUnicodeCharacter{2203}{\ensuremath\exists}% + \DeclareUnicodeCharacter{2208}{\ensuremath\in}% + \DeclareUnicodeCharacter{2212}{\minus{}}% + \DeclareUnicodeCharacter{2217}{\ast}% + \DeclareUnicodeCharacter{221E}{\ensuremath\infty}% + \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}% + \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}% + \DeclareUnicodeCharacter{2229}{\ensuremath\cap}% + \DeclareUnicodeCharacter{2261}{\equiv{}}% + \DeclareUnicodeCharacter{2264}{\ensuremath\leq}% + \DeclareUnicodeCharacter{2265}{\ensuremath\geq}% + \DeclareUnicodeCharacter{2282}{\ensuremath\subset}% + \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}% + % + \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}% + \DeclareUnicodeCharacter{2032}{\ensuremath\prime}% + \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}% + \DeclareUnicodeCharacter{2111}{\ensuremath\Im}% + \DeclareUnicodeCharacter{2113}{\ensuremath\ell}% + \DeclareUnicodeCharacter{2118}{\ensuremath\wp}% + \DeclareUnicodeCharacter{211C}{\ensuremath\Re}% + \DeclareUnicodeCharacter{2127}{\ensuremath\mho}% + \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}% + \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}% + \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}% + \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}% + \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}% + \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}% + \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}% + \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}% + \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}% + \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}% + \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}% + \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}% + \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}% + \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}% + \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}% + \DeclareUnicodeCharacter{21BE}{\ensuremath\upharpoonright}% + \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}% + \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}% + \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}% + \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}% + \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}% + \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}% + \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}% + \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}% + \DeclareUnicodeCharacter{21DD}{\ensuremath\leadsto}% + \DeclareUnicodeCharacter{2201}{\ensuremath\complement}% + \DeclareUnicodeCharacter{2202}{\ensuremath\partial}% + \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}% + \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}% + \DeclareUnicodeCharacter{2209}{\ensuremath\notin}% + \DeclareUnicodeCharacter{220B}{\ensuremath\owns}% + \DeclareUnicodeCharacter{220F}{\ensuremath\prod}% + \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}% + \DeclareUnicodeCharacter{2211}{\ensuremath\sum}% + \DeclareUnicodeCharacter{2213}{\ensuremath\mp}% + \DeclareUnicodeCharacter{2218}{\ensuremath\circ}% + \DeclareUnicodeCharacter{221A}{\ensuremath\surd}% + \DeclareUnicodeCharacter{221D}{\ensuremath\propto}% + \DeclareUnicodeCharacter{2220}{\ensuremath\angle}% + \DeclareUnicodeCharacter{2223}{\ensuremath\mid}% + \DeclareUnicodeCharacter{2228}{\ensuremath\vee}% + \DeclareUnicodeCharacter{222A}{\ensuremath\cup}% + \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}% + \DeclareUnicodeCharacter{222E}{\ensuremath\oint}% + \DeclareUnicodeCharacter{223C}{\ensuremath\sim}% + \DeclareUnicodeCharacter{2240}{\ensuremath\wr}% + \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}% + \DeclareUnicodeCharacter{2245}{\ensuremath\cong}% + \DeclareUnicodeCharacter{2248}{\ensuremath\approx}% + \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}% + \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}% + \DeclareUnicodeCharacter{2260}{\ensuremath\neq}% + \DeclareUnicodeCharacter{226A}{\ensuremath\ll}% + \DeclareUnicodeCharacter{226B}{\ensuremath\gg}% + \DeclareUnicodeCharacter{227A}{\ensuremath\prec}% + \DeclareUnicodeCharacter{227B}{\ensuremath\succ}% + \DeclareUnicodeCharacter{2283}{\ensuremath\supset}% + \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}% + \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}% + \DeclareUnicodeCharacter{228F}{\ensuremath\sqsubset}% + \DeclareUnicodeCharacter{2290}{\ensuremath\sqsupset}% + \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}% + \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}% + \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}% + \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}% + \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}% + \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}% + \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}% + \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}% + \DeclareUnicodeCharacter{2299}{\ensuremath\odot}% + \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}% + \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}% + \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}% + \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}% + \DeclareUnicodeCharacter{22A8}{\ensuremath\models}% + \DeclareUnicodeCharacter{22B4}{\ensuremath\unlhd}% + \DeclareUnicodeCharacter{22B5}{\ensuremath\unrhd}% + \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}% + \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}% + \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}% + \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}% + \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}% + \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}% + \DeclareUnicodeCharacter{22C6}{\ensuremath\star}% + \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}% + \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}% + \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}% + \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}% + \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}% + \DeclareUnicodeCharacter{2322}{\ensuremath\frown}% + \DeclareUnicodeCharacter{2323}{\ensuremath\smile}% + % + \DeclareUnicodeCharacter{25A1}{\ensuremath\Box}% + \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}% + \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}% + \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}% + \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}% + \DeclareUnicodeCharacter{25C7}{\ensuremath\Diamond}% + \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}% + \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}% + \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}% + \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}% + \DeclareUnicodeCharacter{266D}{\ensuremath\flat}% + \DeclareUnicodeCharacter{266E}{\ensuremath\natural}% + \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}% + \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}% + \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}% + \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}% + \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}% + \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}% + \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}% + \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}% + \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}% + \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}% + \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}% + \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}% + \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}% + \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}% + \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}% + \DeclareUnicodeCharacter{2A1D}{\ensuremath\Join}% + \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}% + \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}% + \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}% + % + \global\mathchardef\checkmark="1370% actually the square root sign + \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}% +}% end of \unicodechardefs + +% UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command) +% It makes the setting that replace UTF-8 byte sequence. +\def\utfeightchardefs{% + \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii + \unicodechardefs +} + +% Whether the active definitions of non-ASCII characters expand to +% non-active tokens with the same character code. This is used to +% write characters literally, instead of using active definitions for +% printing the correct glyphs. +\newif\ifpassthroughchars +\passthroughcharsfalse + +% For native Unicode handling (XeTeX and LuaTeX), +% provide a definition macro to replace/pass-through a Unicode character +% +\def\DeclareUnicodeCharacterNative#1#2{% + \catcode"#1=\active + \def\dodeclareunicodecharacternative##1##2##3{% + \begingroup + \uccode`\~="##2\relax + \uppercase{\gdef~}{% + \ifpassthroughchars + ##1% + \else + ##3% + \fi + } + \endgroup + } + \begingroup + \uccode`\.="#1\relax + \uppercase{\def\UTFNativeTmp{.}}% + \expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}% + \endgroup +} + +% Native Unicode handling (XeTeX and LuaTeX) character replacing definition. +% It activates the setting that replaces Unicode characters. +\def\nativeunicodechardefs{% + \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative + \unicodechardefs +} + +% For native Unicode handling (XeTeX and LuaTeX), +% make the character token expand +% to the sequences given in \unicodechardefs for printing. +\def\DeclareUnicodeCharacterNativeAtU#1#2{% + \def\UTFAtUTmp{#2} + \expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp +} + +% @U command definitions for native Unicode handling (XeTeX and LuaTeX). +\def\nativeunicodechardefsatu{% + \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU + \unicodechardefs +} + +% US-ASCII character definitions. +\def\asciichardefs{% nothing need be done + \relax +} + +% define all Unicode characters we know about, for the sake of @U. +\iftxinativeunicodecapable + \nativeunicodechardefsatu +\else + \utfeightchardefs +\fi + + +% Make non-ASCII characters printable again for compatibility with +% existing Texinfo documents that may use them, even without declaring a +% document encoding. +% +\setnonasciicharscatcode \other + + +\message{formatting,} + +\newdimen\defaultparindent \defaultparindent = 15pt + +\chapheadingskip = 15pt plus 4pt minus 2pt +\secheadingskip = 12pt plus 3pt minus 2pt +\subsecheadingskip = 9pt plus 2pt minus 2pt + +% Prevent underfull vbox error messages. +\vbadness = 10000 + +% Don't be very finicky about underfull hboxes, either. +\hbadness = 6666 + +% Following George Bush, get rid of widows and orphans. +\widowpenalty=10000 +\clubpenalty=10000 + +% Use TeX 3.0's \emergencystretch to help line breaking, but if we're +% using an old version of TeX, don't do anything. We want the amount of +% stretch added to depend on the line length, hence the dependence on +% \hsize. We call this whenever the paper size is set. +% +\def\setemergencystretch{% + \ifx\emergencystretch\thisisundefined + % Allow us to assign to \emergencystretch anyway. + \def\emergencystretch{\dimen0}% + \else + \emergencystretch = .15\hsize + \fi +} + +% Parameters in order: 1) textheight; 2) textwidth; +% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; +% 7) physical page height; 8) physical page width. +% +% We also call \setleading{\textleading}, so the caller should define +% \textleading. The caller should also set \parskip. +% +\def\internalpagesizes#1#2#3#4#5#6#7#8{% + \voffset = #3\relax + \topskip = #6\relax + \splittopskip = \topskip + % + \vsize = #1\relax + \advance\vsize by \topskip + \outervsize = \vsize + \advance\outervsize by 2\topandbottommargin + \txipageheight = \vsize + % + \hsize = #2\relax + \outerhsize = \hsize + \advance\outerhsize by 0.5in + \txipagewidth = \hsize + % + \normaloffset = #4\relax + \bindingoffset = #5\relax + % + \ifpdf + \pdfpageheight #7\relax + \pdfpagewidth #8\relax + % if we don't reset these, they will remain at "1 true in" of + % whatever layout pdftex was dumped with. + \pdfhorigin = 1 true in + \pdfvorigin = 1 true in + \else + \ifx\XeTeXrevision\thisisundefined + \special{papersize=#8,#7}% + \else + \pdfpageheight #7\relax + \pdfpagewidth #8\relax + % XeTeX does not have \pdfhorigin and \pdfvorigin. + \fi + \fi + % + \setleading{\textleading} + % + \parindent = \defaultparindent + \setemergencystretch +} + +% @letterpaper (the default). +\def\letterpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \textleading = 13.2pt + % + % If page is nothing but text, make it come out even. + \internalpagesizes{607.2pt}{6in}% that's 46 lines + {\voffset}{.25in}% + {\bindingoffset}{36pt}% + {11in}{8.5in}% +}} + +% Use @smallbook to reset parameters for 7x9.25 trim size. +\def\smallbook{{\globaldefs = 1 + \parskip = 2pt plus 1pt + \textleading = 12pt + % + \internalpagesizes{7.5in}{5in}% + {-.2in}{0in}% + {\bindingoffset}{16pt}% + {9.25in}{7in}% + % + \lispnarrowing = 0.3in + \tolerance = 700 + \contentsrightmargin = 0pt + \defbodyindent = .5cm +}} + +% Use @smallerbook to reset parameters for 6x9 trim size. +% (Just testing, parameters still in flux.) +\def\smallerbook{{\globaldefs = 1 + \parskip = 1.5pt plus 1pt + \textleading = 12pt + % + \internalpagesizes{7.4in}{4.8in}% + {-.2in}{-.4in}% + {0pt}{14pt}% + {9in}{6in}% + % + \lispnarrowing = 0.25in + \tolerance = 700 + \contentsrightmargin = 0pt + \defbodyindent = .4cm +}} + +% Use @afourpaper to print on European A4 paper. +\def\afourpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \textleading = 13.2pt + % + % Double-side printing via postscript on Laserjet 4050 + % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. + % To change the settings for a different printer or situation, adjust + % \normaloffset until the front-side and back-side texts align. Then + % do the same for \bindingoffset. You can set these for testing in + % your texinfo source file like this: + % @tex + % \global\normaloffset = -6mm + % \global\bindingoffset = 10mm + % @end tex + \internalpagesizes{673.2pt}{160mm}% that's 51 lines + {\voffset}{\hoffset}% + {\bindingoffset}{44pt}% + {297mm}{210mm}% + % + \tolerance = 700 + \contentsrightmargin = 0pt + \defbodyindent = 5mm +}} + +% Use @afivepaper to print on European A5 paper. +% From romildo@urano.iceb.ufop.br, 2 July 2000. +% He also recommends making @example and @lisp be small. +\def\afivepaper{{\globaldefs = 1 + \parskip = 2pt plus 1pt minus 0.1pt + \textleading = 12.5pt + % + \internalpagesizes{160mm}{120mm}% + {\voffset}{\hoffset}% + {\bindingoffset}{8pt}% + {210mm}{148mm}% + % + \lispnarrowing = 0.2in + \tolerance = 800 + \contentsrightmargin = 0pt + \defbodyindent = 2mm + \tableindent = 12mm +}} + +% A specific text layout, 24x15cm overall, intended for A4 paper. +\def\afourlatex{{\globaldefs = 1 + \afourpaper + \internalpagesizes{237mm}{150mm}% + {\voffset}{4.6mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + % + % Must explicitly reset to 0 because we call \afourpaper. + \globaldefs = 0 +}} + +% Use @afourwide to print on A4 paper in landscape format. +\def\afourwide{{\globaldefs = 1 + \afourpaper + \internalpagesizes{241mm}{165mm}% + {\voffset}{-2.95mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + \globaldefs = 0 +}} + +% @pagesizes TEXTHEIGHT[,TEXTWIDTH] +% Perhaps we should allow setting the margins, \topskip, \parskip, +% and/or leading, also. Or perhaps we should compute them somehow. +% +\parseargdef\pagesizes{\pagesizesyyy #1,,\finish} +\def\pagesizesyyy#1,#2,#3\finish{{% + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi + \globaldefs = 1 + % + \parskip = 3pt plus 2pt minus 1pt + \setleading{\textleading}% + % + \dimen0 = #1\relax + \advance\dimen0 by \voffset + % + \dimen2 = \hsize + \advance\dimen2 by \normaloffset + % + \internalpagesizes{#1}{\hsize}% + {\voffset}{\normaloffset}% + {\bindingoffset}{44pt}% + {\dimen0}{\dimen2}% +}} + +% Set default to letter. +% +\letterpaper + +% Default value of \hfuzz, for suppressing warnings about overfull hboxes. +\hfuzz = 1pt + + +\message{and turning on texinfo input format.} + +\def^^L{\par} % remove \outer, so ^L can appear in an @comment + +% DEL is a comment character, in case @c does not suffice. +\catcode`\^^? = 14 + +% Define macros to output various characters with catcode for normal text. +\catcode`\"=\other \def\normaldoublequote{"} +\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix +\catcode`\+=\other \def\normalplus{+} +\catcode`\<=\other \def\normalless{<} +\catcode`\>=\other \def\normalgreater{>} +\catcode`\^=\other \def\normalcaret{^} +\catcode`\_=\other \def\normalunderscore{_} +\catcode`\|=\other \def\normalverticalbar{|} +\catcode`\~=\other \def\normaltilde{~} + +% This macro is used to make a character print one way in \tt +% (where it can probably be output as-is), and another way in other fonts, +% where something hairier probably needs to be done. +% +% #1 is what to print if we are indeed using \tt; #2 is what to print +% otherwise. Since all the Computer Modern typewriter fonts have zero +% interword stretch (and shrink), and it is reasonable to expect all +% typewriter fonts to have this, we can check that font parameter. +% +\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} + +% Same as above, but check for italic font. Actually this also catches +% non-italic slanted fonts since it is impossible to distinguish them from +% italic fonts. But since this is only used by $ and it uses \sl anyway +% this is not a problem. +\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} + +% Set catcodes for Texinfo file + +% Active characters for printing the wanted glyph. +% Most of these we simply print from the \tt font, but for some, we can +% use math or other variants that look better in normal text. +% +\catcode`\"=\active +\def\activedoublequote{{\tt\char34}} +\let"=\activedoublequote +\catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde +\chardef\hatchar=`\^ +\catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat + +\catcode`\_=\active +\def_{\ifusingtt\normalunderscore\_} +\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } +\let\realunder=_ + +\catcode`\|=\active \def|{{\tt\char124}} + +\chardef \less=`\< +\catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless +\chardef \gtr=`\> +\catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr +\catcode`\+=\active \def+{{\tt \char 43}} +\catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix +\catcode`\-=\active \let-=\normaldash + + +% used for headline/footline in the output routine, in case the page +% breaks in the middle of an @tex block. +\def\texinfochars{% + \let< = \activeless + \let> = \activegtr + \let~ = \activetilde + \let^ = \activehat + \markupsetuplqdefault \markupsetuprqdefault + \let\b = \strong + \let\i = \smartitalic + % in principle, all other definitions in \tex have to be undone too. +} + +% Used sometimes to turn off (effectively) the active characters even after +% parsing them. +\def\turnoffactive{% + \normalturnoffactive + \otherbackslash +} + +\catcode`\@=0 + +% \backslashcurfont outputs one backslash character in current font, +% as in \char`\\. +\global\chardef\backslashcurfont=`\\ +\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work + +% \realbackslash is an actual character `\' with catcode other, and +% \doublebackslash is two of them (for the pdf outlines). +{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} + +% In Texinfo, backslash is an active character; it prints the backslash +% in fixed width font. +\catcode`\\=\active % @ for escape char from now on. + +% Print a typewriter backslash. For math mode, we can't simply use +% \backslashcurfont: the story here is that in math mode, the \char +% of \backslashcurfont ends up printing the roman \ from the math symbol +% font (because \char in math mode uses the \mathcode, and plain.tex +% sets \mathcode`\\="026E). Hence we use an explicit \mathchar, +% which is the decimal equivalent of "715c (class 7, e.g., use \fam; +% ignored family value; char position "5C). We can't use " for the +% usual hex value because it has already been made active. + +@def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} +@let@backslashchar = @ttbackslash % @backslashchar{} is for user documents. + +% \rawbackslash defines an active \ to do \backslashcurfont. +% \otherbackslash defines an active \ to be a literal `\' character with +% catcode other. We switch back and forth between these. +@gdef@rawbackslash{@let\=@backslashcurfont} +@gdef@otherbackslash{@let\=@realbackslash} + +% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of +% the literal character `\'. +% +{@catcode`- = @active + @gdef@normalturnoffactive{% + @passthroughcharstrue + @let-=@normaldash + @let"=@normaldoublequote + @let$=@normaldollar %$ font-lock fix + @let+=@normalplus + @let<=@normalless + @let>=@normalgreater + @let^=@normalcaret + @let_=@normalunderscore + @let|=@normalverticalbar + @let~=@normaltilde + @let\=@ttbackslash + @markupsetuplqdefault + @markupsetuprqdefault + @unsepspaces + } +} + +% If a .fmt file is being used, characters that might appear in a file +% name cannot be active until we have parsed the command line. +% So turn them off again, and have @fixbackslash turn them back on. +@catcode`+=@other @catcode`@_=@other + +% \enablebackslashhack - allow file to begin `\input texinfo' +% +% If a .fmt file is being used, we don't want the `\input texinfo' to show up. +% That is what \eatinput is for; after that, the `\' should revert to printing +% a backslash. +% If the file did not have a `\input texinfo', then it is turned off after +% the first line; otherwise the first `\' in the file would cause an error. +% This is used on the very last line of this file, texinfo.tex. +% We also use @c to call @fixbackslash, in case ends of lines are hidden. +{ +@catcode`@^=7 +@catcode`@^^M=13@gdef@enablebackslashhack{% + @global@let\ = @eatinput% + @catcode`@^^M=13% + @def@c{@fixbackslash@c}% + % Definition for the newline at the end of this file. + @def ^^M{@let^^M@secondlinenl}% + % Definition for a newline in the main Texinfo file. + @gdef @secondlinenl{@fixbackslash}% + % In case the first line has a whole-line command on it + @let@originalparsearg@parsearg + @def@parsearg{@fixbackslash@originalparsearg} +}} + +{@catcode`@^=7 @catcode`@^^M=13% +@gdef@eatinput input texinfo#1^^M{@fixbackslash}} + +% Emergency active definition of newline, in case an active newline token +% appears by mistake. +{@catcode`@^=7 @catcode13=13% +@gdef@enableemergencynewline{% + @gdef^^M{% + @par% + %<warning: active newline>@par% +}}} + + +@gdef@fixbackslash{% + @ifx\@eatinput @let\ = @ttbackslash @fi + @catcode13=5 % regular end of line + @enableemergencynewline + @let@c=@texinfoc + @let@parsearg@originalparsearg + % Also turn back on active characters that might appear in the input + % file name, in case not using a pre-dumped format. + @catcode`+=@active + @catcode`@_=@active + % + % If texinfo.cnf is present on the system, read it. + % Useful for site-wide @afourpaper, etc. This macro, @fixbackslash, gets + % called at the beginning of every Texinfo file. Not opening texinfo.cnf + % directly in this file, texinfo.tex, makes it possible to make a format + % file for Texinfo. + % + @openin 1 texinfo.cnf + @ifeof 1 @else @input texinfo.cnf @fi + @closein 1 +} + + +% Say @foo, not \foo, in error messages. +@escapechar = `@@ + +% These (along with & and #) are made active for url-breaking, so need +% active definitions as the normal characters. +@def@normaldot{.} +@def@normalquest{?} +@def@normalslash{/} + +% These look ok in all fonts, so just make them not special. +% @hashchar{} gets its own user-level command, because of #line. +@catcode`@& = @other @def@normalamp{&} +@catcode`@# = @other @def@normalhash{#} +@catcode`@% = @other @def@normalpercent{%} + +@let @hashchar = @normalhash + +@c Finally, make ` and ' active, so that txicodequoteundirected and +@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we +@c don't make ` and ' active, @code will not get them as active chars. +@c Do this last of all since we use ` in the previous @catcode assignments. +@catcode`@'=@active +@catcode`@`=@active +@markupsetuplqdefault +@markupsetuprqdefault + +@c Local variables: +@c eval: (add-hook 'write-file-hooks 'time-stamp) +@c page-delimiter: "^\\\\message\\|emacs-page" +@c time-stamp-start: "def\\\\texinfoversion{" +@c time-stamp-format: "%:y-%02m-%02d.%02H" +@c time-stamp-end: "}" +@c End: + +@c vim:sw=2: + +@enablebackslashhack diff --git a/local/recipes/tools/diffutils/source/build-aux/update-copyright b/local/recipes/tools/diffutils/source/build-aux/update-copyright new file mode 100755 index 0000000000..2d20d211c9 --- /dev/null +++ b/local/recipes/tools/diffutils/source/build-aux/update-copyright @@ -0,0 +1,274 @@ +eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"' + & eval 'exec perl -wS -0777 -pi "$0" $argv:q' + if 0; +# Update an FSF copyright year list to include the current year. + +my $VERSION = '2016-01-12.23:13'; # UTC + +# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Written by Jim Meyering and Joel E. Denny + +# The arguments to this script should be names of files that contain +# copyright statements to be updated. The copyright holder's name +# defaults to "Free Software Foundation, Inc." but may be changed to +# any other name by using the "UPDATE_COPYRIGHT_HOLDER" environment +# variable. +# +# For example, you might wish to use the update-copyright target rule +# in maint.mk from gnulib's maintainer-makefile module. +# +# Iff a copyright statement is recognized in a file and the final +# year is not the current year, then the statement is updated for the +# new year and it is reformatted to: +# +# 1. Fit within 72 columns. +# 2. Convert 2-digit years to 4-digit years by prepending "19". +# 3. Expand copyright year intervals. (See "Environment variables" +# below.) +# +# A warning is printed for every file for which no copyright +# statement is recognized. +# +# Each file's copyright statement must be formatted correctly in +# order to be recognized. For example, each of these is fine: +# +# Copyright @copyright{} 1990-2005, 2007-2009 Free Software +# Foundation, Inc. +# +# # Copyright (C) 1990-2005, 2007-2009 Free Software +# # Foundation, Inc. +# +# /* +# * Copyright © 90,2005,2007-2009 +# * Free Software Foundation, Inc. +# */ +# +# However, the following format is not recognized because the line +# prefix changes after the first line: +# +# ## Copyright (C) 1990-2005, 2007-2009 Free Software +# # Foundation, Inc. +# +# However, any correctly formatted copyright statement following +# a non-matching copyright statements would be recognized. +# +# The exact conditions that a file's copyright statement must meet +# to be recognized are: +# +# 1. It is the first copyright statement that meets all of the +# following conditions. Subsequent copyright statements are +# ignored. +# 2. Its format is "Copyright (C)", then a list of copyright years, +# and then the name of the copyright holder. +# 3. The "(C)" takes one of the following forms or is omitted +# entirely: +# +# A. (C) +# B. (c) +# C. @copyright{} +# D. © +# +# 4. The "Copyright" appears at the beginning of a line, except that it +# may be prefixed by any sequence (e.g., a comment) of no more than +# 5 characters -- including white space. +# 5. Iff such a prefix is present, the same prefix appears at the +# beginning of each remaining line within the FSF copyright +# statement. There is one exception in order to support C-style +# comments: if the first line's prefix contains nothing but +# whitespace surrounding a "/*", then the prefix for all subsequent +# lines is the same as the first line's prefix except with each of +# "/" and possibly "*" replaced by a " ". The replacement of "*" +# by " " is consistent throughout all subsequent lines. +# 6. Blank lines, even if preceded by the prefix, do not appear +# within the FSF copyright statement. +# 7. Each copyright year is 2 or 4 digits, and years are separated by +# commas or dashes. Whitespace may appear after commas. +# +# Environment variables: +# +# 1. If UPDATE_COPYRIGHT_FORCE=1, a recognized FSF copyright statement +# is reformatted even if it does not need updating for the new +# year. If unset or set to 0, only updated FSF copyright +# statements are reformatted. +# 2. If UPDATE_COPYRIGHT_USE_INTERVALS=1, every series of consecutive +# copyright years (such as 90, 1991, 1992-2007, 2008) in a +# reformatted FSF copyright statement is collapsed to a single +# interval (such as 1990-2008). If unset or set to 0, all existing +# copyright year intervals in a reformatted FSF copyright statement +# are expanded instead. +# If UPDATE_COPYRIGHT_USE_INTERVALS=2, convert a sequence with gaps +# to the minimal containing range. For example, convert +# 2000, 2004-2007, 2009 to 2000-2009. +# 3. For testing purposes, you can set the assumed current year in +# UPDATE_COPYRIGHT_YEAR. +# 4. The default maximum line length for a copyright line is 72. +# Set UPDATE_COPYRIGHT_MAX_LINE_LENGTH to use a different length. +# 5. Set UPDATE_COPYRIGHT_HOLDER if the copyright holder is other +# than "Free Software Foundation, Inc.". + +use strict; +use warnings; + +my $copyright_re = 'Copyright'; +my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|©)'; +my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER}; +$holder ||= 'Free Software Foundation, Inc.'; +my $prefix_max = 5; +my $margin = $ENV{UPDATE_COPYRIGHT_MAX_LINE_LENGTH}; +!$margin || $margin !~ m/^\d+$/ + and $margin = 72; + +my $tab_width = 8; + +my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR}; +if (!$this_year || $this_year !~ m/^\d{4}$/) + { + my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ()); + $this_year = $year + 1900; + } + +# Unless the file consistently uses "\r\n" as the EOL, use "\n" instead. +my $eol = /(?:^|[^\r])\n/ ? "\n" : "\r\n"; + +my $leading; +my $prefix; +my $ws_re; +my $stmt_re; +while (/(^|\n)(.{0,$prefix_max})$copyright_re/g) + { + $leading = "$1$2"; + $prefix = $2; + if ($prefix =~ /^(\s*\/)\*(\s*)$/) + { + $prefix =~ s,/, ,; + my $prefix_ws = $prefix; + $prefix_ws =~ s/\*/ /; # Only whitespace. + if (/\G(?:[^*\n]|\*[^\/\n])*\*?\n$prefix_ws/) + { + $prefix = $prefix_ws; + } + } + $ws_re = '[ \t\r\f]'; # \s without \n + $ws_re = + "(?:$ws_re*(?:$ws_re|\\n" . quotemeta($prefix) . ")$ws_re*)"; + my $holder_re = $holder; + $holder_re =~ s/\s/$ws_re/g; + my $stmt_remainder_re = + "(?:$ws_re$circle_c_re)?" + . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|-))*" + . "((?:\\d\\d)?\\d\\d)$ws_re$holder_re"; + if (/\G$stmt_remainder_re/) + { + $stmt_re = + quotemeta($leading) . "($copyright_re$stmt_remainder_re)"; + last; + } + } +if (defined $stmt_re) + { + /$stmt_re/ or die; # Should never die. + my $stmt = $1; + my $final_year_orig = $2; + + # Handle two-digit year numbers like "98" and "99". + my $final_year = $final_year_orig; + $final_year <= 99 + and $final_year += 1900; + + if ($final_year != $this_year) + { + # Update the year. + $stmt =~ s/\b$final_year_orig\b/$final_year, $this_year/; + } + if ($final_year != $this_year || $ENV{'UPDATE_COPYRIGHT_FORCE'}) + { + # Normalize all whitespace including newline-prefix sequences. + $stmt =~ s/$ws_re/ /g; + + # Put spaces after commas. + $stmt =~ s/, ?/, /g; + + # Convert 2-digit to 4-digit years. + $stmt =~ s/(\b\d\d\b)/19$1/g; + + # Make the use of intervals consistent. + if (!$ENV{UPDATE_COPYRIGHT_USE_INTERVALS}) + { + $stmt =~ s/(\d{4})-(\d{4})/join(', ', $1..$2)/eg; + } + else + { + $stmt =~ + s/ + (\d{4}) + (?: + (,\ |-) + ((??{ + if ($2 eq '-') { '\d{4}'; } + elsif (!$3) { $1 + 1; } + else { $3 + 1; } + })) + )+ + /$1-$3/gx; + + # When it's 2, emit a single range encompassing all year numbers. + $ENV{UPDATE_COPYRIGHT_USE_INTERVALS} == 2 + and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1-$2/; + } + + # Format within margin. + my $stmt_wrapped; + my $text_margin = $margin - length($prefix); + if ($prefix =~ /^(\t+)/) + { + $text_margin -= length($1) * ($tab_width - 1); + } + while (length $stmt) + { + if (($stmt =~ s/^(.{1,$text_margin})(?: |$)//) + || ($stmt =~ s/^([\S]+)(?: |$)//)) + { + my $line = $1; + $stmt_wrapped .= $stmt_wrapped ? "$eol$prefix" : $leading; + $stmt_wrapped .= $line; + } + else + { + # Should be unreachable, but we don't want an infinite + # loop if it can be reached. + die; + } + } + + # Replace the old copyright statement. + s/$stmt_re/$stmt_wrapped/; + } + } +else + { + print STDERR "$ARGV: warning: copyright statement not found\n"; + } + +# Local variables: +# mode: perl +# indent-tabs-mode: nil +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "my $VERSION = '" +# time-stamp-format: "%:y-%02m-%02d.%02H:%02M" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "'; # UTC" +# End: diff --git a/local/recipes/tools/diffutils/source/build-aux/useless-if-before-free b/local/recipes/tools/diffutils/source/build-aux/useless-if-before-free new file mode 100755 index 0000000000..4e3f3a2658 --- /dev/null +++ b/local/recipes/tools/diffutils/source/build-aux/useless-if-before-free @@ -0,0 +1,210 @@ +eval '(exit $?0)' && eval 'exec perl -wST "$0" "$@"' + & eval 'exec perl -wST "$0" $argv:q' + if 0; +# Detect instances of "if (p) free (p);". +# Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces. + +my $VERSION = '2016-08-01 17:47'; # UTC +# The definition above must lie within the first 8 lines in order +# for the Emacs time-stamp write hook (at end) to update it. +# If you change this file with Emacs, please let the write hook +# do its job. Otherwise, update this string manually. + +# Copyright (C) 2008-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Written by Jim Meyering + +use strict; +use warnings; +use Getopt::Long; + +(my $ME = $0) =~ s|.*/||; + +# use File::Coda; # http://meyering.net/code/Coda/ +END { + defined fileno STDOUT or return; + close STDOUT and return; + warn "$ME: failed to close standard output: $!\n"; + $? ||= 1; +} + +sub usage ($) +{ + my ($exit_code) = @_; + my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR); + if ($exit_code != 0) + { + print $STREAM "Try '$ME --help' for more information.\n"; + } + else + { + print $STREAM <<EOF; +Usage: $ME [OPTIONS] FILE... + +Detect any instance in FILE of a useless "if" test before a free call, e.g., +"if (p) free (p);". Any such test may be safely removed without affecting +the semantics of the C code in FILE. Use --name=FOO --name=BAR to also +detect free-like functions named FOO and BAR. + +OPTIONS: + + --list print only the name of each matching FILE (\\0-terminated) + --name=N add name N to the list of \'free\'-like functions to detect; + may be repeated + + --help display this help and exit + --version output version information and exit + +Exit status: + + 0 one or more matches + 1 no match + 2 an error + +EXAMPLE: + +For example, this command prints all removable "if" tests before "free" +and "kfree" calls in the linux kernel sources: + + git ls-files -z |xargs -0 $ME --name=kfree + +EOF + } + exit $exit_code; +} + +sub is_NULL ($) +{ + my ($expr) = @_; + return ($expr eq 'NULL' || $expr eq '0'); +} + +{ + sub EXIT_MATCH {0} + sub EXIT_NO_MATCH {1} + sub EXIT_ERROR {2} + my $err = EXIT_NO_MATCH; + + my $list; + my @name = qw(free); + GetOptions + ( + help => sub { usage 0 }, + version => sub { print "$ME version $VERSION\n"; exit }, + list => \$list, + 'name=s@' => \@name, + ) or usage 1; + + # Make sure we have the right number of non-option arguments. + # Always tell the user why we fail. + @ARGV < 1 + and (warn "$ME: missing FILE argument\n"), usage EXIT_ERROR; + + my $or = join '|', @name; + my $regexp = qr/(?:$or)/; + + # Set the input record separator. + # Note: this makes it impractical to print line numbers. + $/ = '"'; + + my $found_match = 0; + FILE: + foreach my $file (@ARGV) + { + open FH, '<', $file + or (warn "$ME: can't open '$file' for reading: $!\n"), + $err = EXIT_ERROR, next; + while (defined (my $line = <FH>)) + { + # Skip non-matching lines early to save time + $line =~ /\bif\b/ + or next; + while ($line =~ + /\b(if\s*\(\s*([^)]+?)(?:\s*!=\s*([^)]+?))?\s*\) + # 1 2 3 + (?: \s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)\s*;| + \s*\{\s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)\s*;\s*\}))/sxg) + { + my $all = $1; + my ($lhs, $rhs) = ($2, $3); + my ($free_opnd, $braced_free_opnd) = ($4, $5); + my $non_NULL; + if (!defined $rhs) { $non_NULL = $lhs } + elsif (is_NULL $rhs) { $non_NULL = $lhs } + elsif (is_NULL $lhs) { $non_NULL = $rhs } + else { next } + + # Compare the non-NULL part of the "if" expression and the + # free'd expression, without regard to white space. + $non_NULL =~ tr/ \t//d; + my $e2 = defined $free_opnd ? $free_opnd : $braced_free_opnd; + $e2 =~ tr/ \t//d; + if ($non_NULL eq $e2) + { + $found_match = 1; + $list + and (print "$file\0"), next FILE; + print "$file: $all\n"; + } + } + } + } + continue + { + close FH; + } + + $found_match && $err == EXIT_NO_MATCH + and $err = EXIT_MATCH; + + exit $err; +} + +my $foo = <<'EOF'; +# The above is to *find* them. +# This adjusts them, removing the unnecessary "if (p)" part. + +# FIXME: do something like this as an option (doesn't do braces): +free=xfree +git grep -l -z "$free *(" \ + | xargs -0 useless-if-before-free -l --name="$free" \ + | xargs -0 perl -0x3b -pi -e \ + 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL))?\s*\)\s+('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\)\s*;)/$2/s' + +# Use the following to remove redundant uses of kfree inside braces. +# Note that -0777 puts perl in slurp-whole-file mode; +# but we have plenty of memory, these days... +free=kfree +git grep -l -z "$free *(" \ + | xargs -0 useless-if-before-free -l --name="$free" \ + | xargs -0 perl -0777 -pi -e \ + 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL))?\s*\)\s*\{\s*('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\);)\s*\}[^\n]*$/$2/gms' + +Be careful that the result of the above transformation is valid. +If the matched string is followed by "else", then obviously, it won't be. + +When modifying files, refuse to process anything other than a regular file. +EOF + +## Local Variables: +## mode: perl +## indent-tabs-mode: nil +## eval: (add-hook 'write-file-hooks 'time-stamp) +## time-stamp-start: "my $VERSION = '" +## time-stamp-format: "%:y-%02m-%02d %02H:%02M" +## time-stamp-time-zone: "UTC0" +## time-stamp-end: "'; # UTC" +## End: diff --git a/local/recipes/tools/diffutils/source/build-aux/vc-list-files b/local/recipes/tools/diffutils/source/build-aux/vc-list-files new file mode 100755 index 0000000000..2d17eaf69d --- /dev/null +++ b/local/recipes/tools/diffutils/source/build-aux/vc-list-files @@ -0,0 +1,113 @@ +#!/bin/sh +# List version-controlled file names. + +# Print a version string. +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 2006-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +# List the specified version-controlled files. +# With no argument, list them all. With a single DIRECTORY argument, +# list the version-controlled files in that directory. + +# If there's an argument, it must be a single, "."-relative directory name. +# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/ + +postprocess= +case $1 in + --help) cat <<EOF +Usage: $0 [-C SRCDIR] [DIR...] + +Output a list of version-controlled files in DIR (default .), relative to +SRCDIR (default .). SRCDIR must be the top directory of a checkout. + +Options: + --help print this help, then exit + --version print version number, then exit + -C SRCDIR change directory to SRCDIR before generating list + +Report bugs and patches to <bug-gnulib@gnu.org>. +EOF + exit ;; + + --version) + year=`echo "$scriptversion" | sed 's/[^0-9].*//'` + cat <<EOF +vc-list-files $scriptversion +Copyright (C) $year Free Software Foundation, Inc, +License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +EOF + exit ;; + + -C) + test "$2" = . || postprocess="| sed 's|^|$2/|'" + cd "$2" || exit 1 + shift; shift ;; +esac + +test $# = 0 && set . + +for dir +do + if test -d .git; then + test "x$dir" = x. \ + && dir= sed_esc= \ + || { dir="$dir/"; sed_esc=`echo "$dir"|env sed 's,\([\\/]\),\\\\\1,g'`; } + # Ignore git symlinks - either they point into the tree, in which case + # we don't need to visit the target twice, or they point somewhere + # else (often into a submodule), in which case the content does not + # belong to this package. + eval exec git ls-tree -r 'HEAD:"$dir"' \ + \| sed -n '"s/^100[^ ]*./$sed_esc/p"' $postprocess + elif test -d .hg; then + eval exec hg locate '"$dir/*"' $postprocess + elif test -d .bzr; then + test "$postprocess" = '' && postprocess="| sed 's|^\./||'" + eval exec bzr ls -R --versioned '"$dir"' $postprocess + elif test -d CVS; then + test "$postprocess" = '' && postprocess="| sed 's|^\./||'" + if test -x build-aux/cvsu; then + eval build-aux/cvsu --find --types=AFGM '"$dir"' $postprocess + elif (cvsu --help) >/dev/null 2>&1; then + eval cvsu --find --types=AFGM '"$dir"' $postprocess + else + eval awk -F/ \''{ \ + if (!$1 && $3 !~ /^-/) { \ + f=FILENAME; \ + if (f ~ /CVS\/Entries$/) \ + f = substr(f, 1, length(f)-11); \ + print f $2; \ + }}'\'' \ + `find "$dir" -name Entries -print` /dev/null' $postprocess + fi + elif test -d .svn; then + eval exec svn list -R '"$dir"' $postprocess + else + echo "$0: Failed to determine type of version control used in `pwd`" 1>&2 + exit 1 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/local/recipes/tools/diffutils/source/cfg.mk b/local/recipes/tools/diffutils/source/cfg.mk new file mode 100644 index 0000000000..6a0620c288 --- /dev/null +++ b/local/recipes/tools/diffutils/source/cfg.mk @@ -0,0 +1,72 @@ +# Customize maint.mk -*- makefile -*- +# Copyright (C) 2003-2013, 2015-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Use the direct link. This is guaranteed to work immediately, while +# it can take a while for the faster mirror links to become usable. +url_dir_list = http://ftp.gnu.org/gnu/$(PACKAGE) + +# Used in maint.mk's web-manual rule +manual_title = Comparing and Merging Files + +# Tests not to run as part of "make distcheck". +local-checks-to-skip = \ + sc_error_message_period \ + sc_error_message_uppercase + +# Tools used to bootstrap this package, used for "announcement". +bootstrap-tools = autoconf,automake,gnulib + +# Now that we have better tests, make this the default. +export VERBOSE = yes + +old_NEWS_hash = 0216ec3bf3e3322f33afd4e949a9a29b + +# Tell maint.mk's syntax-check rules that diff gets config.h directly or +# via diff.h or system.h. +config_h_header = (<config\.h>|"(diff|system)\.h") + +update-copyright-env = \ + UPDATE_COPYRIGHT_USE_INTERVALS=1 \ + UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79 + +-include $(srcdir)/dist-check.mk + +_cf_state_dir ?= .config-state +_date_time := $(shell date +%F.%T) +config-compare: + diff -u \ + -I'define VERSION ' \ + -I'define PACKAGE_VERSION ' \ + -I'define PACKAGE_STRING ' \ + $(_cf_state_dir)/latest lib/config.h + diff -u \ + -I'$(PACKAGE_NAME)' \ + -I'[SD]\["VERSION"\]' \ + -I'[SD]\["PACKAGE_VERSION"\]' \ + -I'D\["PACKAGE_STRING"\]' \ + $(_cf_state_dir)/latest config.status + +config-save: + $(MAKE) --quiet config-compare > /dev/null 2>&1 \ + && { echo no change; exit 1; } || : + mkdir -p $(_cf_state_dir)/$(_date_time) + ln -nsf $(_date_time) $(_cf_state_dir)/latest + cp lib/config.h config.status $(_cf_state_dir)/latest + +exclude_file_name_regexp--sc_space_tab = ^gl/lib/.*\.c\.diff$$ + +# Tell gnulib's tight_scope rule that we mark externs with XTERN +export _gl_TS_extern = extern|XTERN diff --git a/local/recipes/tools/diffutils/source/configure b/local/recipes/tools/diffutils/source/configure new file mode 100755 index 0000000000..79be7e9a33 --- /dev/null +++ b/local/recipes/tools/diffutils/source/configure @@ -0,0 +1,43076 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.72 for GNU diffutils 3.6. +# +# Report bugs to <bug-diffutils@gnu.org>. +# +# +# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, +# Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else case e in #( + e) case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi +if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as 'sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed 'exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else case e in #( + e) case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : + +else case e in #( + e) exitcode=1; echo positional parameters were not saved. ;; +esac +fi +test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null +then : + as_have_required=yes +else case e in #( + e) as_have_required=no ;; +esac +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : + +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$as_shell as_have_required=yes + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : + break 2 +fi +fi + done;; + esac + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else case e in #( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi ;; +esac +fi + + + if test "x$CONFIG_SHELL" != x +then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed 'exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and +$0: bug-diffutils@gnu.org about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do have one." + fi + exit 1 +fi ;; +esac +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else case e in #( + e) as_fn_append () + { + eval $1=\$$1\$2 + } ;; +esac +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else case e in #( + e) as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } ;; +esac +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + t clear + :clear + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated + +# Sed expression to map a string onto a valid variable name. +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated + + +test -n "$DJDIR" || exec 7<&0 </dev/null +exec 6>&1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='GNU diffutils' +PACKAGE_TARNAME='diffutils' +PACKAGE_VERSION='3.6' +PACKAGE_STRING='GNU diffutils 3.6' +PACKAGE_BUGREPORT='bug-diffutils@gnu.org' +PACKAGE_URL='https://www.gnu.org/software/diffutils/' + +ac_unique_file="src/diff.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include <stddef.h> +#ifdef HAVE_STDIO_H +# include <stdio.h> +#endif +#ifdef HAVE_STDLIB_H +# include <stdlib.h> +#endif +#ifdef HAVE_STRING_H +# include <string.h> +#endif +#ifdef HAVE_INTTYPES_H +# include <inttypes.h> +#endif +#ifdef HAVE_STDINT_H +# include <stdint.h> +#endif +#ifdef HAVE_STRINGS_H +# include <strings.h> +#endif +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif" + +ac_header_c_list= +ac_func_c_list= +gl_fnmatch_required=POSIX +gl_getopt_required=POSIX +gt_needs= +enable_year2038=no +ac_subst_vars='gltests_LTLIBOBJS +gltests_LIBOBJS +gl_LTLIBOBJS +gl_LIBOBJS +CONFIG_INCLUDE +am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +POSUB +INTLLIBS +INTL_MACOSX_LIBS +XGETTEXT_EXTRA_OPTIONS +MSGMERGE +XGETTEXT_015 +XGETTEXT +GMSGFMT_015 +MSGFMT_015 +GMSGFMT +MSGFMT +GETTEXT_MACRO_VERSION +USE_NLS +SRC_VERSION_C +PR_PROGRAM +GNULIB_WARN_CFLAGS +WARN_CFLAGS +WERROR_CFLAGS +LIBTESTS_LIBDEPS +LIBDIFFUTILS_LTLIBDEPS +LIBDIFFUTILS_LIBDEPS +abs_aux_dir +HAVE_SYS_UIO_H +NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H +NEXT_SYS_UIO_H +NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H +NEXT_SYS_IOCTL_H +HAVE_SYS_IOCTL_H +GL_GENERATE_STDALIGN_H_FALSE +GL_GENERATE_STDALIGN_H_TRUE +STDALIGN_H +GL_GENERATE_NETINET_IN_H_FALSE +GL_GENERATE_NETINET_IN_H_TRUE +NETINET_IN_H +HAVE_NETINET_IN_H +NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H +NEXT_NETINET_IN_H +LIB_NANOSLEEP +LIB_SELECT +LIBSOCKET +HAVE_SYS_SELECT_H +NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H +NEXT_SYS_SELECT_H +REPLACE_SELECT +REPLACE_PSELECT +HAVE_PSELECT +GNULIB_SELECT +GNULIB_PSELECT +INET_PTON_LIB +LOCALE_TR_UTF8 +NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H +NEXT_ARPA_INET_H +HAVE_ARPA_INET_H +REPLACE_INET_PTON +REPLACE_INET_NTOP +HAVE_DECL_INET_PTON +HAVE_DECL_INET_NTOP +GNULIB_INET_PTON +GNULIB_INET_NTOP +HAVE_WS2TCPIP_H +HAVE_SYS_SOCKET_H +NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H +NEXT_SYS_SOCKET_H +HAVE_ACCEPT4 +HAVE_SA_FAMILY_T +HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY +HAVE_STRUCT_SOCKADDR_STORAGE +GNULIB_ACCEPT4 +GNULIB_SHUTDOWN +GNULIB_SETSOCKOPT +GNULIB_SENDTO +GNULIB_RECVFROM +GNULIB_SEND +GNULIB_RECV +GNULIB_LISTEN +GNULIB_GETSOCKOPT +GNULIB_GETSOCKNAME +GNULIB_GETPEERNAME +GNULIB_BIND +GNULIB_ACCEPT +GNULIB_CONNECT +GNULIB_SOCKET +gltests_WITNESS +NEXT_AS_FIRST_DIRECTIVE_WCHAR_H +NEXT_WCHAR_H +HAVE_FEATURES_H +LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE +LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE +LIBUNISTRING_UNIWIDTH_H +LIBUNISTRING_UNITYPES_H +LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE +LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE +LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE +LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE +LIBUNISTRING_UNISTR_H +HAVE_UNISTD_H +NEXT_AS_FIRST_DIRECTIVE_UNISTD_H +NEXT_UNISTD_H +UNISTD_H_DEFINES_STRUCT_TIMESPEC +PTHREAD_H_DEFINES_STRUCT_TIMESPEC +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC +TIME_H_DEFINES_STRUCT_TIMESPEC +NEXT_AS_FIRST_DIRECTIVE_TIME_H +NEXT_TIME_H +NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H +NEXT_SYS_WAIT_H +GNULIB_WAITPID +WINDOWS_STAT_INODES +WINDOWS_64_BIT_OFF_T +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H +NEXT_SYS_TYPES_H +HAVE_STRINGS_H +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H +NEXT_STRINGS_H +NEXT_AS_FIRST_DIRECTIVE_STRING_H +NEXT_STRING_H +HAVE_DECL_STRNCASECMP +HAVE_STRCASECMP +HAVE_FFS +GNULIB_FFS +NEXT_AS_FIRST_DIRECTIVE_STDLIB_H +NEXT_STDLIB_H +NEXT_AS_FIRST_DIRECTIVE_STDIO_H +NEXT_STDIO_H +HAVE__BOOL +GL_GENERATE_STDBOOL_H_FALSE +GL_GENERATE_STDBOOL_H_TRUE +STDBOOL_H +GL_GENERATE_STDARG_H_FALSE +GL_GENERATE_STDARG_H_TRUE +STDARG_H +NEXT_AS_FIRST_DIRECTIVE_STDARG_H +NEXT_STDARG_H +NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H +NEXT_SIGNAL_H +REPLACE_RAISE +REPLACE_PTHREAD_SIGMASK +HAVE_SIGHANDLER_T +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T +HAVE_STRUCT_SIGACTION_SA_SIGACTION +HAVE_SIGACTION +HAVE_SIGINFO_T +HAVE_SIGSET_T +HAVE_RAISE +HAVE_PTHREAD_SIGMASK +HAVE_POSIX_SIGNALBLOCKING +GNULIB_SIGACTION +GNULIB_SIGPROCMASK +GNULIB_SIGNAL_H_SIGPIPE +GNULIB_RAISE +GNULIB_PTHREAD_SIGMASK +UNDEFINE_STRTOK_R +REPLACE_STRTOK_R +REPLACE_STRSIGNAL +REPLACE_STRNLEN +REPLACE_STRNDUP +REPLACE_STRNCAT +REPLACE_STRERROR_R +REPLACE_STRERROR +REPLACE_STRCHRNUL +REPLACE_STRCASESTR +REPLACE_STRSTR +REPLACE_STRDUP +REPLACE_STPNCPY +REPLACE_MEMMEM +REPLACE_MEMCHR +HAVE_STRVERSCMP +HAVE_DECL_STRSIGNAL +HAVE_DECL_STRERROR_R +HAVE_DECL_STRTOK_R +HAVE_STRCASESTR +HAVE_STRSEP +HAVE_STRPBRK +HAVE_DECL_STRNLEN +HAVE_DECL_STRNDUP +HAVE_DECL_STRDUP +HAVE_STRCHRNUL +HAVE_STPNCPY +HAVE_STPCPY +HAVE_RAWMEMCHR +HAVE_DECL_MEMRCHR +HAVE_MEMPCPY +HAVE_DECL_MEMMEM +HAVE_MEMCHR +HAVE_FFSLL +HAVE_FFSL +HAVE_MBSLEN +GNULIB_STRVERSCMP +GNULIB_STRSIGNAL +GNULIB_STRERROR_R +GNULIB_STRERROR +GNULIB_MBSTOK_R +GNULIB_MBSSEP +GNULIB_MBSSPN +GNULIB_MBSPBRK +GNULIB_MBSCSPN +GNULIB_MBSCASESTR +GNULIB_MBSPCASECMP +GNULIB_MBSNCASECMP +GNULIB_MBSCASECMP +GNULIB_MBSSTR +GNULIB_MBSRCHR +GNULIB_MBSCHR +GNULIB_MBSNLEN +GNULIB_MBSLEN +GNULIB_STRTOK_R +GNULIB_STRCASESTR +GNULIB_STRSTR +GNULIB_STRSEP +GNULIB_STRPBRK +GNULIB_STRNLEN +GNULIB_STRNDUP +GNULIB_STRNCAT +GNULIB_STRDUP +GNULIB_STRCHRNUL +GNULIB_STPNCPY +GNULIB_STPCPY +GNULIB_RAWMEMCHR +GNULIB_MEMRCHR +GNULIB_MEMPCPY +GNULIB_MEMMEM +GNULIB_MEMCHR +GNULIB_FFSLL +GNULIB_FFSL +LOCALE_FR_UTF8 +LOCALE_ZH_CN +LOCALE_JA +REPLACE_WCTOMB +REPLACE_UNSETENV +REPLACE_STRTOD +REPLACE_SETENV +REPLACE_REALPATH +REPLACE_REALLOC +REPLACE_RANDOM_R +REPLACE_QSORT_R +REPLACE_PUTENV +REPLACE_PTSNAME_R +REPLACE_PTSNAME +REPLACE_MKSTEMP +REPLACE_MBTOWC +REPLACE_MALLOC +REPLACE_CANONICALIZE_FILE_NAME +REPLACE_CALLOC +HAVE_DECL_UNSETENV +HAVE_UNLOCKPT +HAVE_SYS_LOADAVG_H +HAVE_STRUCT_RANDOM_DATA +HAVE_STRTOULL +HAVE_STRTOLL +HAVE_STRTOD +HAVE_DECL_SETENV +HAVE_SETENV +HAVE_SECURE_GETENV +HAVE_RPMATCH +HAVE_REALPATH +HAVE_RANDOM_R +HAVE_RANDOM_H +HAVE_RANDOM +HAVE_QSORT_R +HAVE_PTSNAME_R +HAVE_PTSNAME +HAVE_POSIX_OPENPT +HAVE_MKSTEMPS +HAVE_MKSTEMP +HAVE_MKOSTEMPS +HAVE_MKOSTEMP +HAVE_MKDTEMP +HAVE_GRANTPT +HAVE_GETSUBOPT +HAVE_DECL_GETLOADAVG +HAVE_CANONICALIZE_FILE_NAME +HAVE_ATOLL +HAVE__EXIT +GNULIB_WCTOMB +GNULIB_UNSETENV +GNULIB_UNLOCKPT +GNULIB_SYSTEM_POSIX +GNULIB_STRTOULL +GNULIB_STRTOLL +GNULIB_STRTOD +GNULIB_SETENV +GNULIB_SECURE_GETENV +GNULIB_RPMATCH +GNULIB_REALPATH +GNULIB_REALLOC_POSIX +GNULIB_RANDOM_R +GNULIB_RANDOM +GNULIB_QSORT_R +GNULIB_PUTENV +GNULIB_PTSNAME_R +GNULIB_PTSNAME +GNULIB_POSIX_OPENPT +GNULIB_MKSTEMPS +GNULIB_MKSTEMP +GNULIB_MKOSTEMPS +GNULIB_MKOSTEMP +GNULIB_MKDTEMP +GNULIB_MBTOWC +GNULIB_MALLOC_POSIX +GNULIB_GRANTPT +GNULIB_GETSUBOPT +GNULIB_GETLOADAVG +GNULIB_CANONICALIZE_FILE_NAME +GNULIB_CALLOC_POSIX +GNULIB_ATOLL +GNULIB__EXIT +SED +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H +NEXT_LOCALE_H +HAVE_XLOCALE_H +NEXT_AS_FIRST_DIRECTIVE_STDDEF_H +NEXT_STDDEF_H +GL_GENERATE_STDDEF_H_FALSE +GL_GENERATE_STDDEF_H_TRUE +STDDEF_H +HAVE_WCHAR_T +HAVE_MAX_ALIGN_T +REPLACE_NULL +REPLACE_STRUCT_LCONV +REPLACE_DUPLOCALE +REPLACE_SETLOCALE +REPLACE_LOCALECONV +HAVE_DUPLOCALE +GNULIB_DUPLOCALE +GNULIB_SETLOCALE +GNULIB_LOCALECONV +LOCALCHARSET_TESTS_ENVIRONMENT +GLIBC21 +HAVE_LANGINFO_YESEXPR +HAVE_LANGINFO_ERA +HAVE_LANGINFO_T_FMT_AMPM +HAVE_LANGINFO_CODESET +HAVE_LANGINFO_H +NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H +NEXT_LANGINFO_H +REPLACE_NL_LANGINFO +HAVE_NL_LANGINFO +GNULIB_NL_LANGINFO +REPLACE_TOWLOWER +REPLACE_ISWCNTRL +HAVE_WCTYPE_H +NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H +NEXT_WCTYPE_H +HAVE_CRTDEFS_H +HAVE_WINT_T +HAVE_ISWCNTRL +REPLACE_ISWBLANK +HAVE_WCTRANS_T +HAVE_WCTYPE_T +HAVE_ISWBLANK +GNULIB_TOWCTRANS +GNULIB_WCTRANS +GNULIB_ISWCTYPE +GNULIB_WCTYPE +GNULIB_ISWBLANK +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H +NEXT_INTTYPES_H +UINT64_MAX_EQ_ULONG_MAX +UINT32_MAX_LT_UINTMAX_MAX +PRIPTR_PREFIX +PRI_MACROS_BROKEN +INT64_MAX_EQ_LONG_MAX +INT32_MAX_LT_INTMAX_MAX +REPLACE_STRTOUMAX +REPLACE_STRTOIMAX +HAVE_DECL_STRTOUMAX +HAVE_DECL_STRTOIMAX +HAVE_DECL_IMAXDIV +HAVE_DECL_IMAXABS +GNULIB_STRTOUMAX +GNULIB_STRTOIMAX +GNULIB_IMAXDIV +GNULIB_IMAXABS +GL_GENERATE_STDINT_H_FALSE +GL_GENERATE_STDINT_H_TRUE +STDINT_H +HAVE_SYS_INTTYPES_H +HAVE_SYS_BITYPES_H +HAVE_C99_STDINT_H +WINT_T_SUFFIX +WCHAR_T_SUFFIX +SIG_ATOMIC_T_SUFFIX +SIZE_T_SUFFIX +PTRDIFF_T_SUFFIX +HAVE_SIGNED_WINT_T +HAVE_SIGNED_WCHAR_T +HAVE_SIGNED_SIG_ATOMIC_T +BITSIZEOF_WINT_T +BITSIZEOF_WCHAR_T +BITSIZEOF_SIG_ATOMIC_T +BITSIZEOF_SIZE_T +BITSIZEOF_PTRDIFF_T +APPLE_UNIVERSAL_BUILD +HAVE_STDINT_H +NEXT_AS_FIRST_DIRECTIVE_STDINT_H +NEXT_STDINT_H +HAVE_SYS_TYPES_H +HAVE_INTTYPES_H +HAVE_WCHAR_H +HAVE_UNSIGNED_LONG_LONG_INT +HAVE_LONG_LONG_INT +GNULIB_OVERRIDES_WINT_T +GL_GENERATE_LIMITS_H_FALSE +GL_GENERATE_LIMITS_H_TRUE +LIMITS_H +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H +NEXT_LIMITS_H +NEXT_AS_FIRST_DIRECTIVE_ICONV_H +NEXT_ICONV_H +GL_GENERATE_ICONV_H_FALSE +GL_GENERATE_ICONV_H_TRUE +ICONV_H +REPLACE_ICONV_UTF +REPLACE_ICONV_OPEN +REPLACE_ICONV +ICONV_CONST +GNULIB_ICONV +LTLIBICONV +LIBICONV +GNU_MAKE_FALSE +GNU_MAKE_TRUE +REPLACE_LOCALTIME +REPLACE_GMTIME +REPLACE_TZSET +REPLACE_TIMEGM +REPLACE_STRFTIME +REPLACE_NANOSLEEP +REPLACE_MKTIME +REPLACE_LOCALTIME_R +REPLACE_CTIME +HAVE_TIMEZONE_T +HAVE_TZSET +HAVE_TIMEGM +HAVE_STRPTIME +HAVE_NANOSLEEP +HAVE_DECL_LOCALTIME_R +GNULIB_TZSET +GNULIB_TIME_RZ +GNULIB_TIME_R +GNULIB_TIMEGM +GNULIB_STRPTIME +GNULIB_STRFTIME +GNULIB_NANOSLEEP +GNULIB_LOCALTIME +GNULIB_MKTIME +GNULIB_CTIME +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H +NEXT_SYS_TIME_H +REPLACE_STRUCT_TIMEVAL +REPLACE_GETTIMEOFDAY +HAVE_SYS_TIME_H +HAVE_STRUCT_TIMEVAL +HAVE_GETTIMEOFDAY +GNULIB_GETTIMEOFDAY +LTLIBINTL +LIBINTL +GNULIB_GL_UNISTD_H_GETOPT +GETOPT_CDEFS_H +GETOPT_H +HAVE_SYS_CDEFS_H +HAVE_GETOPT_H +NEXT_AS_FIRST_DIRECTIVE_GETOPT_H +NEXT_GETOPT_H +WINDOWS_64_BIT_ST_SIZE +WINDOWS_STAT_TIMESPEC +NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H +NEXT_SYS_STAT_H +REPLACE_UTIMENSAT +REPLACE_STAT +REPLACE_MKNOD +REPLACE_MKFIFO +REPLACE_MKDIR +REPLACE_LSTAT +REPLACE_FUTIMENS +REPLACE_FSTATAT +REPLACE_FSTAT +HAVE_UTIMENSAT +HAVE_MKNODAT +HAVE_MKNOD +HAVE_MKFIFOAT +HAVE_MKFIFO +HAVE_MKDIRAT +HAVE_LSTAT +HAVE_LCHMOD +HAVE_FUTIMENS +HAVE_FSTATAT +HAVE_FCHMODAT +GNULIB_OVERRIDES_STRUCT_STAT +GNULIB_UTIMENSAT +GNULIB_STAT +GNULIB_MKNODAT +GNULIB_MKNOD +GNULIB_MKFIFOAT +GNULIB_MKFIFO +GNULIB_MKDIRAT +GNULIB_LSTAT +GNULIB_LCHMOD +GNULIB_FUTIMENS +GNULIB_FSTATAT +GNULIB_FSTAT +GNULIB_FCHMODAT +REPLACE_VSPRINTF +REPLACE_VSNPRINTF +REPLACE_VPRINTF +REPLACE_VFPRINTF +REPLACE_VDPRINTF +REPLACE_VASPRINTF +REPLACE_TMPFILE +REPLACE_STDIO_WRITE_FUNCS +REPLACE_STDIO_READ_FUNCS +REPLACE_SPRINTF +REPLACE_SNPRINTF +REPLACE_RENAMEAT +REPLACE_RENAME +REPLACE_REMOVE +REPLACE_PRINTF +REPLACE_POPEN +REPLACE_PERROR +REPLACE_OBSTACK_PRINTF +REPLACE_GETLINE +REPLACE_GETDELIM +REPLACE_FTELLO +REPLACE_FTELL +REPLACE_FSEEKO +REPLACE_FSEEK +REPLACE_FREOPEN +REPLACE_FPURGE +REPLACE_FPRINTF +REPLACE_FOPEN +REPLACE_FFLUSH +REPLACE_FDOPEN +REPLACE_FCLOSE +REPLACE_DPRINTF +HAVE_VDPRINTF +HAVE_VASPRINTF +HAVE_RENAMEAT +HAVE_POPEN +HAVE_PCLOSE +HAVE_FTELLO +HAVE_FSEEKO +HAVE_DPRINTF +HAVE_DECL_VSNPRINTF +HAVE_DECL_SNPRINTF +HAVE_DECL_OBSTACK_PRINTF +HAVE_DECL_GETLINE +HAVE_DECL_GETDELIM +HAVE_DECL_FTELLO +HAVE_DECL_FSEEKO +HAVE_DECL_FPURGE +GNULIB_VSPRINTF_POSIX +GNULIB_VSNPRINTF +GNULIB_VPRINTF_POSIX +GNULIB_VPRINTF +GNULIB_VFPRINTF_POSIX +GNULIB_VFPRINTF +GNULIB_VDPRINTF +GNULIB_VSCANF +GNULIB_VFSCANF +GNULIB_VASPRINTF +GNULIB_TMPFILE +GNULIB_STDIO_H_SIGPIPE +GNULIB_STDIO_H_NONBLOCKING +GNULIB_SPRINTF_POSIX +GNULIB_SNPRINTF +GNULIB_SCANF +GNULIB_RENAMEAT +GNULIB_RENAME +GNULIB_REMOVE +GNULIB_PUTS +GNULIB_PUTCHAR +GNULIB_PUTC +GNULIB_PRINTF_POSIX +GNULIB_PRINTF +GNULIB_POPEN +GNULIB_PERROR +GNULIB_PCLOSE +GNULIB_OBSTACK_PRINTF_POSIX +GNULIB_OBSTACK_PRINTF +GNULIB_GETLINE +GNULIB_GETDELIM +GNULIB_GETCHAR +GNULIB_GETC +GNULIB_FWRITE +GNULIB_FTELLO +GNULIB_FTELL +GNULIB_FSEEKO +GNULIB_FSEEK +GNULIB_FSCANF +GNULIB_FREOPEN +GNULIB_FREAD +GNULIB_FPUTS +GNULIB_FPUTC +GNULIB_FPURGE +GNULIB_FPRINTF_POSIX +GNULIB_FPRINTF +GNULIB_FOPEN +GNULIB_FGETS +GNULIB_FGETC +GNULIB_FFLUSH +GNULIB_FDOPEN +GNULIB_FCLOSE +GNULIB_DPRINTF +GL_GENERATE_FNMATCH_H_FALSE +GL_GENERATE_FNMATCH_H_TRUE +FNMATCH_H +REPLACE_ITOLD +GL_GENERATE_FLOAT_H_FALSE +GL_GENERATE_FLOAT_H_TRUE +FLOAT_H +NEXT_AS_FIRST_DIRECTIVE_FLOAT_H +NEXT_FLOAT_H +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H +NEXT_FCNTL_H +REPLACE_OPENAT +REPLACE_OPEN +REPLACE_FCNTL +HAVE_OPENAT +HAVE_FCNTL +GNULIB_OPENAT +GNULIB_OPEN +GNULIB_NONBLOCKING +GNULIB_FCNTL +EOVERFLOW_VALUE +EOVERFLOW_HIDDEN +ENOLINK_VALUE +ENOLINK_HIDDEN +EMULTIHOP_VALUE +EMULTIHOP_HIDDEN +GL_GENERATE_ERRNO_H_FALSE +GL_GENERATE_ERRNO_H_TRUE +ERRNO_H +NEXT_AS_FIRST_DIRECTIVE_ERRNO_H +NEXT_ERRNO_H +NEXT_AS_FIRST_DIRECTIVE_CTYPE_H +NEXT_CTYPE_H +PRAGMA_COLUMNS +PRAGMA_SYSTEM_HEADER +INCLUDE_NEXT_AS_FIRST_DIRECTIVE +INCLUDE_NEXT +HAVE_ISBLANK +GNULIB_ISBLANK +pkglibexecdir +lispdir +HAVE_WINSOCK2_H +REPLACE_IOCTL +SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS +SYS_IOCTL_H_HAVE_WINSOCK2_H +GNULIB_IOCTL +HAVE_MSVC_INVALID_PARAMETER_HANDLER +UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS +UNISTD_H_HAVE_WINSOCK2_H +REPLACE_WRITE +REPLACE_USLEEP +REPLACE_UNLINKAT +REPLACE_UNLINK +REPLACE_TTYNAME_R +REPLACE_TRUNCATE +REPLACE_SYMLINKAT +REPLACE_SYMLINK +REPLACE_SLEEP +REPLACE_RMDIR +REPLACE_READLINKAT +REPLACE_READLINK +REPLACE_READ +REPLACE_PWRITE +REPLACE_PREAD +REPLACE_LSEEK +REPLACE_LINKAT +REPLACE_LINK +REPLACE_LCHOWN +REPLACE_ISATTY +REPLACE_GETPAGESIZE +REPLACE_GETGROUPS +REPLACE_GETLOGIN_R +REPLACE_GETDTABLESIZE +REPLACE_GETDOMAINNAME +REPLACE_GETCWD +REPLACE_FTRUNCATE +REPLACE_FCHOWNAT +REPLACE_DUP2 +REPLACE_DUP +REPLACE_CLOSE +REPLACE_CHOWN +HAVE_SYS_PARAM_H +HAVE_OS_H +HAVE_DECL_TTYNAME_R +HAVE_DECL_SETHOSTNAME +HAVE_DECL_GETUSERSHELL +HAVE_DECL_GETPAGESIZE +HAVE_DECL_GETLOGIN_R +HAVE_DECL_GETLOGIN +HAVE_DECL_GETDOMAINNAME +HAVE_DECL_FDATASYNC +HAVE_DECL_FCHDIR +HAVE_DECL_ENVIRON +HAVE_USLEEP +HAVE_UNLINKAT +HAVE_TRUNCATE +HAVE_SYMLINKAT +HAVE_SYMLINK +HAVE_SLEEP +HAVE_SETHOSTNAME +HAVE_READLINKAT +HAVE_READLINK +HAVE_PWRITE +HAVE_PREAD +HAVE_PIPE2 +HAVE_PIPE +HAVE_LINKAT +HAVE_LINK +HAVE_LCHOWN +HAVE_GROUP_MEMBER +HAVE_GETPAGESIZE +HAVE_GETLOGIN +HAVE_GETHOSTNAME +HAVE_GETGROUPS +HAVE_GETDTABLESIZE +HAVE_FTRUNCATE +HAVE_FSYNC +HAVE_FDATASYNC +HAVE_FCHOWNAT +HAVE_FCHDIR +HAVE_FACCESSAT +HAVE_EUIDACCESS +HAVE_DUP3 +HAVE_DUP2 +HAVE_CHOWN +GNULIB_WRITE +GNULIB_USLEEP +GNULIB_UNLINKAT +GNULIB_UNLINK +GNULIB_UNISTD_H_SIGPIPE +GNULIB_UNISTD_H_NONBLOCKING +GNULIB_TTYNAME_R +GNULIB_TRUNCATE +GNULIB_SYMLINKAT +GNULIB_SYMLINK +GNULIB_SLEEP +GNULIB_SETHOSTNAME +GNULIB_RMDIR +GNULIB_READLINKAT +GNULIB_READLINK +GNULIB_READ +GNULIB_PWRITE +GNULIB_PREAD +GNULIB_PIPE2 +GNULIB_PIPE +GNULIB_LSEEK +GNULIB_LINKAT +GNULIB_LINK +GNULIB_LCHOWN +GNULIB_ISATTY +GNULIB_GROUP_MEMBER +GNULIB_GETUSERSHELL +GNULIB_GETPAGESIZE +GNULIB_GETLOGIN_R +GNULIB_GETLOGIN +GNULIB_GETHOSTNAME +GNULIB_GETGROUPS +GNULIB_GETDTABLESIZE +GNULIB_GETDOMAINNAME +GNULIB_GETCWD +GNULIB_FTRUNCATE +GNULIB_FSYNC +GNULIB_FDATASYNC +GNULIB_FCHOWNAT +GNULIB_FCHDIR +GNULIB_FACCESSAT +GNULIB_EUIDACCESS +GNULIB_ENVIRON +GNULIB_DUP3 +GNULIB_DUP2 +GNULIB_DUP +GNULIB_CLOSE +GNULIB_CHOWN +GNULIB_CHDIR +LIB_CLOCK_GETTIME +LTLIBCSTACK +LIBCSTACK +LIBSIGSEGV_PREFIX +LTLIBSIGSEGV +LIBSIGSEGV +HAVE_LIBSIGSEGV +LOCALE_FR +REPLACE_WCSFTIME +REPLACE_WCSWIDTH +REPLACE_WCWIDTH +REPLACE_WCSNRTOMBS +REPLACE_WCSRTOMBS +REPLACE_WCRTOMB +REPLACE_MBSNRTOWCS +REPLACE_MBSRTOWCS +REPLACE_MBRLEN +REPLACE_MBRTOWC +REPLACE_MBSINIT +REPLACE_WCTOB +REPLACE_BTOWC +REPLACE_MBSTATE_T +HAVE_DECL_WCWIDTH +HAVE_DECL_WCTOB +HAVE_WCSFTIME +HAVE_WCSWIDTH +HAVE_WCSTOK +HAVE_WCSSTR +HAVE_WCSPBRK +HAVE_WCSSPN +HAVE_WCSCSPN +HAVE_WCSRCHR +HAVE_WCSCHR +HAVE_WCSDUP +HAVE_WCSXFRM +HAVE_WCSCOLL +HAVE_WCSNCASECMP +HAVE_WCSCASECMP +HAVE_WCSNCMP +HAVE_WCSCMP +HAVE_WCSNCAT +HAVE_WCSCAT +HAVE_WCPNCPY +HAVE_WCSNCPY +HAVE_WCPCPY +HAVE_WCSCPY +HAVE_WCSNLEN +HAVE_WCSLEN +HAVE_WMEMSET +HAVE_WMEMMOVE +HAVE_WMEMCPY +HAVE_WMEMCMP +HAVE_WMEMCHR +HAVE_WCSNRTOMBS +HAVE_WCSRTOMBS +HAVE_WCRTOMB +HAVE_MBSNRTOWCS +HAVE_MBSRTOWCS +HAVE_MBRLEN +HAVE_MBRTOWC +HAVE_MBSINIT +HAVE_BTOWC +GNULIB_WCSFTIME +GNULIB_WCSWIDTH +GNULIB_WCSTOK +GNULIB_WCSSTR +GNULIB_WCSPBRK +GNULIB_WCSSPN +GNULIB_WCSCSPN +GNULIB_WCSRCHR +GNULIB_WCSCHR +GNULIB_WCSDUP +GNULIB_WCSXFRM +GNULIB_WCSCOLL +GNULIB_WCSNCASECMP +GNULIB_WCSCASECMP +GNULIB_WCSNCMP +GNULIB_WCSCMP +GNULIB_WCSNCAT +GNULIB_WCSCAT +GNULIB_WCPNCPY +GNULIB_WCSNCPY +GNULIB_WCPCPY +GNULIB_WCSCPY +GNULIB_WCSNLEN +GNULIB_WCSLEN +GNULIB_WMEMSET +GNULIB_WMEMMOVE +GNULIB_WMEMCPY +GNULIB_WMEMCMP +GNULIB_WMEMCHR +GNULIB_WCWIDTH +GNULIB_WCSNRTOMBS +GNULIB_WCSRTOMBS +GNULIB_WCRTOMB +GNULIB_MBSNRTOWCS +GNULIB_MBSRTOWCS +GNULIB_MBRLEN +GNULIB_MBRTOWC +GNULIB_MBSINIT +GNULIB_WCTOB +GNULIB_BTOWC +GL_GENERATE_ALLOCA_H_FALSE +GL_GENERATE_ALLOCA_H_TRUE +ALLOCA_H +ALLOCA +GL_COND_LIBTOOL_FALSE +GL_COND_LIBTOOL_TRUE +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +ARFLAGS +AR +CPP +RANLIB +HELP2MAN +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__xargs_n +am__rm_f_notfound +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +CSCOPE +ETAGS +CTAGS +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +enable_largefile +with_gnu_ld +enable_rpath +with_libsigsegv_prefix +with_libiconv_prefix +with_included_regex +with_packager +with_packager_version +with_packager_bug_reports +enable_gcc_warnings +enable_nls +with_libintl_prefix +enable_year2038 +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: '$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +'configure' configures GNU diffutils 3.6 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print 'checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for '--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or '..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/diffutils] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of GNU diffutils 3.6:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --disable-largefile omit support for large files + --disable-rpath do not hardcode runtime library paths + --enable-gcc-warnings turn on lots of GCC warnings (for developers) + --disable-nls do not use Native Language Support + --enable-year2038 support timestamps after 2038 + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-libsigsegv-prefix[=DIR] search for libsigsegv in DIR/include and DIR/lib + --without-libsigsegv-prefix don't search for libsigsegv in includedir and libdir + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib + --without-libiconv-prefix don't search for libiconv in includedir and libdir + --without-included-regex + don't compile regex; this is the default on systems + with recent-enough versions of the GNU C Library + (use with caution on other systems). + --with-packager String identifying the packager of this software + --with-packager-version Packager-specific version information + --with-packager-bug-reports + Packager info for bug reports (URL/e-mail/...) + --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib + --without-libintl-prefix don't search for libintl in includedir and libdir + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a + nonstandard directory <lib dir> + LIBS libraries to pass to the linker, e.g. -l<library> + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if + you have headers in a nonstandard directory <include dir> + CPP C preprocessor + +Use these variables to override the choices made by 'configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to <bug-diffutils@gnu.org>. +GNU diffutils home page: <https://www.gnu.org/software/diffutils/>. +General help using GNU software: <https://www.gnu.org/gethelp/>. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +GNU diffutils configure 3.6 +generated by GNU Autoconf 2.72 + +Copyright (C) 2023 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else case e in #( + e) eval "$3=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in #( + e) eval "$3=yes" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else case e in #( + e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status ;; +esac +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case <limits.h> declares $2. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (void); below. */ + +#include <limits.h> +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (void); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main (void) +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$3=yes" +else case e in #( + e) eval "$3=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +# ------------------------------------------------------------------ +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else case e in #( + e) eval "$3=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_check_decl + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid; break +else case e in #( + e) as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=$ac_mid; break +else case e in #( + e) as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else case e in #( + e) ac_lo= ac_hi= ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid +else case e in #( + e) as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval (void) { return $2; } +static unsigned long int ulongval (void) { return $2; } +#include <stdio.h> +#include <stdlib.h> +int +main (void) +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + echo >>conftest.val; read $3 <conftest.val; ac_retval=0 +else case e in #( + e) ac_retval=1 ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f conftest.val + + fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_compute_int + +# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +# ---------------------------------------------------- +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +printf %s "checking for $2.$3... " >&6; } +if eval test \${$4+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$4=yes" +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$4=yes" +else case e in #( + e) eval "$4=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$4 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_member +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by GNU diffutils $as_me 3.6, which was +generated by GNU Autoconf 2.72. Invocation command line was + + $ $0$ac_configure_args_raw + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + { + echo + + printf "%s\n" "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + printf "%s\n" "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + printf "%s\n" "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + printf "%s\n" "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +printf "%s\n" "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + ac_site_files="$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" +else + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +fi + +for ac_site_file in $ac_site_files +do + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See 'config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif + +#include <stddef.h> +#include <stdarg.h> +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (char **p, int i) +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +/* Does the compiler advertise C99 conformance? */ +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +// See if C++-style comments work. + +#include <stdbool.h> +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); +extern void free (void *); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +/* Does the compiler advertise C11 conformance? */ +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +as_fn_append ac_func_c_list " btowc HAVE_BTOWC" +as_fn_append ac_func_c_list " setrlimit HAVE_SETRLIMIT" +as_fn_append ac_header_c_list " ucontext.h ucontext_h HAVE_UCONTEXT_H" +as_fn_append ac_func_c_list " sigaltstack HAVE_SIGALTSTACK" +as_fn_append ac_func_c_list " readlinkat HAVE_READLINKAT" +as_fn_append ac_func_c_list " _set_invalid_parameter_handler HAVE__SET_INVALID_PARAMETER_HANDLER" +as_fn_append ac_header_c_list " sys/socket.h sys_socket_h HAVE_SYS_SOCKET_H" +as_fn_append ac_func_c_list " fcntl HAVE_FCNTL" +as_fn_append ac_func_c_list " symlink HAVE_SYMLINK" +as_fn_append ac_func_c_list " mempcpy HAVE_MEMPCPY" +as_fn_append ac_func_c_list " isblank HAVE_ISBLANK" +as_fn_append ac_func_c_list " iswctype HAVE_ISWCTYPE" +as_fn_append ac_func_c_list " mbsrtowcs HAVE_MBSRTOWCS" +as_fn_append ac_func_c_list " wmemchr HAVE_WMEMCHR" +as_fn_append ac_func_c_list " wmemcpy HAVE_WMEMCPY" +as_fn_append ac_func_c_list " wmempcpy HAVE_WMEMPCPY" +as_fn_append ac_header_c_list " wctype.h wctype_h HAVE_WCTYPE_H" +gl_fnmatch_required=GNU +as_fn_append ac_func_c_list " getdtablesize HAVE_GETDTABLESIZE" +gl_getopt_required=GNU +as_fn_append ac_header_c_list " getopt.h getopt_h HAVE_GETOPT_H" +as_fn_append ac_header_c_list " sys/cdefs.h sys_cdefs_h HAVE_SYS_CDEFS_H" +as_fn_append ac_func_c_list " getprogname HAVE_GETPROGNAME" +as_fn_append ac_func_c_list " getexecname HAVE_GETEXECNAME" +as_fn_append ac_func_c_list " gettimeofday HAVE_GETTIMEOFDAY" +as_fn_append ac_func_c_list " nanotime HAVE_NANOTIME" +as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H" +as_fn_append ac_header_c_list " iconv.h iconv_h HAVE_ICONV_H" +as_fn_append ac_header_c_list " limits.h limits_h HAVE_LIMITS_H" +as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H" +as_fn_append ac_func_c_list " iswcntrl HAVE_ISWCNTRL" +as_fn_append ac_header_c_list " crtdefs.h crtdefs_h HAVE_CRTDEFS_H" +as_fn_append ac_func_c_list " iswblank HAVE_ISWBLANK" +as_fn_append ac_header_c_list " langinfo.h langinfo_h HAVE_LANGINFO_H" +as_fn_append ac_header_c_list " xlocale.h xlocale_h HAVE_XLOCALE_H" +as_fn_append ac_func_c_list " lstat HAVE_LSTAT" +as_fn_append ac_func_c_list " mbsinit HAVE_MBSINIT" +as_fn_append ac_func_c_list " mbrtowc HAVE_MBRTOWC" +as_fn_append ac_func_c_list " mbslen HAVE_MBSLEN" +as_fn_append ac_header_c_list " sys/mman.h sys_mman_h HAVE_SYS_MMAN_H" +as_fn_append ac_func_c_list " mprotect HAVE_MPROTECT" +as_fn_append ac_func_c_list " mkstemp HAVE_MKSTEMP" +as_fn_append ac_func_c_list " tzset HAVE_TZSET" +as_fn_append ac_func_c_list " nl_langinfo HAVE_NL_LANGINFO" +as_fn_append ac_header_c_list " sys/param.h sys_param_h HAVE_SYS_PARAM_H" +as_fn_append ac_func_c_list " readlink HAVE_READLINK" +as_fn_append ac_header_c_list " malloc.h malloc_h HAVE_MALLOC_H" +as_fn_append ac_func_c_list " secure_getenv HAVE_SECURE_GETENV" +as_fn_append ac_func_c_list " getuid HAVE_GETUID" +as_fn_append ac_func_c_list " geteuid HAVE_GETEUID" +as_fn_append ac_func_c_list " getgid HAVE_GETGID" +as_fn_append ac_func_c_list " getegid HAVE_GETEGID" +as_fn_append ac_func_c_list " setenv HAVE_SETENV" +as_fn_append ac_func_c_list " sigaction HAVE_SIGACTION" +as_fn_append ac_func_c_list " siginterrupt HAVE_SIGINTERRUPT" +as_fn_append ac_func_c_list " strerror_r HAVE_STRERROR_R" +as_fn_append ac_func_c_list " __xpg_strerror_r HAVE___XPG_STRERROR_R" +as_fn_append ac_func_c_list " strndup HAVE_STRNDUP" +as_fn_append ac_func_c_list " strptime HAVE_STRPTIME" +as_fn_append ac_func_c_list " strtoumax HAVE_STRTOUMAX" +as_fn_append ac_header_c_list " sys/wait.h sys_wait_h HAVE_SYS_WAIT_H" +as_fn_append ac_func_c_list " localtime_r HAVE_LOCALTIME_R" +as_fn_append ac_func_c_list " timegm HAVE_TIMEGM" +as_fn_append ac_func_c_list " vasnprintf HAVE_VASNPRINTF" +as_fn_append ac_header_c_list " features.h features_h HAVE_FEATURES_H" +as_fn_append ac_func_c_list " snprintf HAVE_SNPRINTF" +as_fn_append ac_func_c_list " wcrtomb HAVE_WCRTOMB" +as_fn_append ac_func_c_list " wcwidth HAVE_WCWIDTH" +as_fn_append ac_header_c_list " arpa/inet.h arpa_inet_h HAVE_ARPA_INET_H" +as_fn_append ac_func_c_list " ftruncate HAVE_FTRUNCATE" +as_fn_append ac_header_c_list " netdb.h netdb_h HAVE_NETDB_H" +as_fn_append ac_header_c_list " netinet/in.h netinet_in_h HAVE_NETINET_IN_H" +as_fn_append ac_func_c_list " newlocale HAVE_NEWLOCALE" +as_fn_append ac_header_c_list " sys/select.h sys_select_h HAVE_SYS_SELECT_H" +as_fn_append ac_func_c_list " pipe HAVE_PIPE" +as_fn_append ac_func_c_list " sleep HAVE_SLEEP" +as_fn_append ac_func_c_list " catgets HAVE_CATGETS" +as_fn_append ac_header_c_list " sys/ioctl.h sys_ioctl_h HAVE_SYS_IOCTL_H" +as_fn_append ac_func_c_list " shutdown HAVE_SHUTDOWN" +as_fn_append ac_header_c_list " sys/uio.h sys_uio_h HAVE_SYS_UIO_H" +as_fn_append ac_func_c_list " wctob HAVE_WCTOB" +as_fn_append ac_func_c_list " sigprocmask HAVE_SIGPROCMASK" +as_fn_append ac_func_c_list " strcasecoll HAVE_STRCASECOLL" +as_fn_append ac_func_c_list " stricoll HAVE_STRICOLL" +as_fn_append ac_header_c_list " vfork.h vfork_h HAVE_VFORK_H" +as_fn_append ac_func_c_list " fork HAVE_FORK" +as_fn_append ac_func_c_list " vfork HAVE_VFORK" +gt_needs="$gt_needs need-ngettext" + +# Auxiliary files required by this configure script. +ac_aux_files="config.rpath config.guess config.sub compile missing install-sh" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}/build-aux" + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else case e in #( + e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; +esac +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + +am__api_version='1.18' + + + + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + ;; +esac +fi + if test ${ac_cv_path_install+y}; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether sleep supports fractional seconds" >&5 +printf %s "checking whether sleep supports fractional seconds... " >&6; } +if test ${am_cv_sleep_fractional_seconds+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if sleep 0.001 2>/dev/null +then : + am_cv_sleep_fractional_seconds=yes +else case e in #( + e) am_cv_sleep_fractional_seconds=no ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_sleep_fractional_seconds" >&5 +printf "%s\n" "$am_cv_sleep_fractional_seconds" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking filesystem timestamp resolution" >&5 +printf %s "checking filesystem timestamp resolution... " >&6; } +if test ${am_cv_filesystem_timestamp_resolution+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) # Default to the worst case. +am_cv_filesystem_timestamp_resolution=2 + +# Only try to go finer than 1 sec if sleep can do it. +# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, +# - 1 sec is not much of a win compared to 2 sec, and +# - it takes 2 seconds to perform the test whether 1 sec works. +# +# Instead, just use the default 2s on platforms that have 1s resolution, +# accept the extra 1s delay when using $sleep in the Automake tests, in +# exchange for not incurring the 2s delay for running the test for all +# packages. +# +am_try_resolutions= +if test "$am_cv_sleep_fractional_seconds" = yes; then + # Even a millisecond often causes a bunch of false positives, + # so just try a hundredth of a second. The time saved between .001 and + # .01 is not terribly consequential. + am_try_resolutions="0.01 0.1 $am_try_resolutions" +fi + +# In order to catch current-generation FAT out, we must *modify* files +# that already exist; the *creation* timestamp is finer. Use names +# that make ls -t sort them differently when they have equal +# timestamps than when they have distinct timestamps, keeping +# in mind that ls -t prints the *newest* file first. +rm -f conftest.ts? +: > conftest.ts1 +: > conftest.ts2 +: > conftest.ts3 + +# Make sure ls -t actually works. Do 'set' in a subshell so we don't +# clobber the current shell's arguments. (Outer-level square brackets +# are removed by m4; they're present so that m4 does not expand +# <dollar><star>; be careful, easy to get confused.) +if ( + set X `ls -t conftest.ts[12]` && + { + test "$*" != "X conftest.ts1 conftest.ts2" || + test "$*" != "X conftest.ts2 conftest.ts1"; + } +); then :; else + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + printf "%s\n" ""Bad output from ls -t: \"`ls -t conftest.ts[12]`\""" >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "ls -t produces unexpected output. +Make sure there is not a broken ls alias in your environment. +See 'config.log' for more details" "$LINENO" 5; } +fi + +for am_try_res in $am_try_resolutions; do + # Any one fine-grained sleep might happen to cross the boundary + # between two values of a coarser actual resolution, but if we do + # two fine-grained sleeps in a row, at least one of them will fall + # entirely within a coarse interval. + echo alpha > conftest.ts1 + sleep $am_try_res + echo beta > conftest.ts2 + sleep $am_try_res + echo gamma > conftest.ts3 + + # We assume that 'ls -t' will make use of high-resolution + # timestamps if the operating system supports them at all. + if (set X `ls -t conftest.ts?` && + test "$2" = conftest.ts3 && + test "$3" = conftest.ts2 && + test "$4" = conftest.ts1); then + # + # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, + # because we don't need to test make. + make_ok=true + if test $am_try_res != 1; then + # But if we've succeeded so far with a subsecond resolution, we + # have one more thing to check: make. It can happen that + # everything else supports the subsecond mtimes, but make doesn't; + # notably on macOS, which ships make 3.81 from 2006 (the last one + # released under GPLv2). https://bugs.gnu.org/68808 + # + # We test $MAKE if it is defined in the environment, else "make". + # It might get overridden later, but our hope is that in practice + # it does not matter: it is the system "make" which is (by far) + # the most likely to be broken, whereas if the user overrides it, + # probably they did so with a better, or at least not worse, make. + # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html + # + # Create a Makefile (real tab character here): + rm -f conftest.mk + echo 'conftest.ts1: conftest.ts2' >conftest.mk + echo ' touch conftest.ts2' >>conftest.mk + # + # Now, running + # touch conftest.ts1; touch conftest.ts2; make + # should touch ts1 because ts2 is newer. This could happen by luck, + # but most often, it will fail if make's support is insufficient. So + # test for several consecutive successes. + # + # (We reuse conftest.ts[12] because we still want to modify existing + # files, not create new ones, per above.) + n=0 + make=${MAKE-make} + until test $n -eq 3; do + echo one > conftest.ts1 + sleep $am_try_res + echo two > conftest.ts2 # ts2 should now be newer than ts1 + if $make -f conftest.mk | grep 'up to date' >/dev/null; then + make_ok=false + break # out of $n loop + fi + n=`expr $n + 1` + done + fi + # + if $make_ok; then + # Everything we know to check worked out, so call this resolution good. + am_cv_filesystem_timestamp_resolution=$am_try_res + break # out of $am_try_res loop + fi + # Otherwise, we'll go on to check the next resolution. + fi +done +rm -f conftest.ts? +# (end _am_filesystem_timestamp_resolution) + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_filesystem_timestamp_resolution" >&5 +printf "%s\n" "$am_cv_filesystem_timestamp_resolution" >&6; } + +# This check should not be cached, as it may vary across builds of +# different projects. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +am_build_env_is_sane=no +am_has_slept=no +rm -f conftest.file +for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + test "$2" = conftest.file + ); then + am_build_env_is_sane=yes + break + fi + # Just in case. + sleep "$am_cv_filesystem_timestamp_resolution" + am_has_slept=yes +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_build_env_is_sane" >&5 +printf "%s\n" "$am_build_env_is_sane" >&6; } +if test "$am_build_env_is_sane" = no; then + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi + +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1 +then : + +else case e in #( + e) ( sleep "$am_cv_filesystem_timestamp_resolution" ) & + am_sleep_pid=$! + ;; +esac +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was 's,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + *'BusyBox '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + ;; +esac +fi + + test -d ./--version && rmdir ./--version + if test ${ac_cv_path_mkdir+y}; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use plain mkdir -p, + # in the hope it doesn't have the bugs of ancient mkdir. + MKDIR_P='mkdir -p' + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make ;; +esac +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +AM_DEFAULT_VERBOSITY=1 +# Check whether --enable-silent-rules was given. +if test ${enable_silent_rules+y} +then : + enableval=$enable_silent_rules; +fi + +am_make=${MAKE-make} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if printf "%s\n" 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } +AM_BACKSLASH='\' + +am__rm_f_notfound= +if (rm -f && rm -fr && rm -rf) 2>/dev/null +then : + +else case e in #( + e) am__rm_f_notfound='""' ;; +esac +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking xargs -n works" >&5 +printf %s "checking xargs -n works... " >&6; } +if test ${am_cv_xargs_n_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 +3" +then : + am_cv_xargs_n_works=yes +else case e in #( + e) am_cv_xargs_n_works=no ;; +esac +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_xargs_n_works" >&5 +printf "%s\n" "$am_cv_xargs_n_works" >&6; } +if test "$am_cv_xargs_n_works" = yes +then : + am__xargs_n='xargs -n' +else case e in #( + e) am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "" "$am__xargs_n_arg"; done; }' + ;; +esac +fi + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='diffutils' + VERSION='3.6' + + +printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h + + +printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> +# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar plaintar pax cpio none' + +# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 +printf %s "checking whether UID '$am_uid' is supported by ustar format... " >&6; } + if test x$am_uid = xunknown; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&5 +printf "%s\n" "$as_me: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&2;} + elif test $am_uid -le $am_max_uid; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + _am_tools=none + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 +printf %s "checking whether GID '$am_gid' is supported by ustar format... " >&6; } + if test x$gm_gid = xunknown; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&5 +printf "%s\n" "$as_me: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&2;} + elif test $am_gid -le $am_max_gid; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + _am_tools=none + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 +printf %s "checking how to create a ustar tar archive... " >&6; } + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_ustar-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + { echo "$as_me:$LINENO: $_am_tar --version" >&5 + ($_am_tar --version) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && break + done + am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x ustar -w "$$tardir"' + am__tar_='pax -L -x ustar -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H ustar -L' + am__tar_='find "$tardir" -print | cpio -o -H ustar -L' + am__untar='cpio -i -H ustar -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_ustar}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 + (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + rm -rf conftest.dir + if test -s conftest.tar; then + { echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5 + ($am__untar <conftest.tar) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 + (cat conftest.dir/file) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + if test ${am_cv_prog_tar_ustar+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) am_cv_prog_tar_ustar=$_am_tool ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 +printf "%s\n" "$am_cv_prog_tar_ustar" >&6; } + + + + + +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + + + + + + + +AM_DEFAULT_VERBOSITY=0 + + # make --enable-silent-rules the default. + +ac_config_headers="$ac_config_headers lib/config.h:lib/config.hin" + + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See 'config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. +# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an '-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else case e in #( + e) ac_file='' ;; +esac +fi +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See 'config.log' for more details" "$LINENO" 5; } ;; +esac +fi +rm -f conftest conftest$ac_cv_exeext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +int +main (void) +{ +FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See 'config.log' for more details" "$LINENO" 5; } ;; +esac +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else case e in #( + e) ac_compiler_gnu=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else case e in #( + e) CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 ;; +esac +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + # aligned with autoconf, so not including core; see bug#72225. + rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \ + conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \ + conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM + unset am_i ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } + +# Check whether --enable-dependency-tracking was given. +if test ${enable_dependency_tracking+y} +then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thus: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + + +HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"} + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + +fi + + ac_fn_c_check_header_compile "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes +then : + MINIX=yes +else case e in #( + e) MINIX= ;; +esac +fi + + if test "$MINIX" = yes; then + +printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h + + +printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +printf "%s\n" "#define _MINIX 1" >>confdefs.h + + +printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test ${ac_cv_safe_to_define___extensions__+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_safe_to_define___extensions__=yes +else case e in #( + e) ac_cv_safe_to_define___extensions__=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h + + printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h + + printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 +printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } +if test ${ac_cv_should_define__xopen_source+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_should_define__xopen_source=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <wchar.h> + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define _XOPEN_SOURCE 500 + #include <wchar.h> + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_should_define__xopen_source=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 +printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } + test $ac_cv_should_define__xopen_source = yes && + printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else case e in #( + e) # Passes both tests. +ac_preproc_ok=: +break ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + break +fi + + done + ac_cv_prog_CPP=$CPP + ;; +esac +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else case e in #( + e) # Passes both tests. +ac_preproc_ok=: +break ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See 'config.log' for more details" "$LINENO" 5; } ;; +esac +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5 +printf %s "checking for egrep -e... " >&6; } +if test ${ac_cv_path_EGREP_TRADITIONAL+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + : + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + + if test "$ac_cv_path_EGREP_TRADITIONAL" +then : + ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E" +else case e in #( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + ;; +esac +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5 +printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; } + EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5 +printf %s "checking for Minix Amsterdam compiler... " >&6; } +if test ${gl_cv_c_amsterdam_compiler+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __ACK__ +Amsterdam +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "Amsterdam" >/dev/null 2>&1 +then : + gl_cv_c_amsterdam_compiler=yes +else case e in #( + e) gl_cv_c_amsterdam_compiler=no ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5 +printf "%s\n" "$gl_cv_c_amsterdam_compiler" >&6; } + + if test $gl_cv_c_amsterdam_compiler = yes; then + if test -z "$AR"; then + AR='cc -c.a' + fi + if test -z "$ARFLAGS"; then + ARFLAGS='-o' + fi + else + : + fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="ar" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + + if test -z "$ARFLAGS"; then + ARFLAGS='cr' + fi + + + + if test -z "$RANLIB"; then + if test $gl_cv_c_amsterdam_compiler = yes; then + RANLIB=':' + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + fi + fi + + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + + + + # IEEE behaviour is the default on all CPUs except Alpha and SH + # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 + # and the GCC 4.1.2 manual). + case "$host_cpu" in + alpha*) + # On Alpha systems, a compiler option provides the behaviour. + # See the ieee(3) manual page, also available at + # <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/0600____.HTM> + if test -n "$GCC"; then + # GCC has the option -mieee. + # For full IEEE compliance (rarely needed), use option -mieee-with-inexact. + CPPFLAGS="$CPPFLAGS -mieee" + else + # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact. + # For full IEEE compliance (rarely needed), use option -ieee_with_inexact. + CPPFLAGS="$CPPFLAGS -ieee" + fi + ;; + sh*) + if test -n "$GCC"; then + # GCC has the option -mieee. + CPPFLAGS="$CPPFLAGS -mieee" + fi + ;; + esac + +# Check whether --enable-largefile was given. +if test ${enable_largefile+y} +then : + enableval=$enable_largefile; +fi +if test "$enable_largefile,$enable_year2038" != no,no +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable large file support" >&5 +printf %s "checking for $CC option to enable large file support... " >&6; } +if test ${ac_cv_sys_largefile_opts+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_save_CC="$CC" + ac_opt_found=no + for ac_opt in "none needed" "-D_FILE_OFFSET_BITS=64" "-D_LARGE_FILES=1" "-n32"; do + if test x"$ac_opt" != x"none needed" +then : + CC="$ac_save_CC $ac_opt" +fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#ifndef FTYPE +# define FTYPE off_t +#endif + /* Check that FTYPE can represent 2**63 - 1 correctly. + We can't simply define LARGE_FTYPE to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31)) + int FTYPE_is_large[(LARGE_FTYPE % 2147483629 == 721 + && LARGE_FTYPE % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_opt" = x"none needed" +then : + # GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t. + CC="$CC -DFTYPE=ino_t" + if ac_fn_c_try_compile "$LINENO" +then : + +else case e in #( + e) CC="$CC -D_FILE_OFFSET_BITS=64" + if ac_fn_c_try_compile "$LINENO" +then : + ac_opt='-D_FILE_OFFSET_BITS=64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam +fi + ac_cv_sys_largefile_opts=$ac_opt + ac_opt_found=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test $ac_opt_found = no || break + done + CC="$ac_save_CC" + + + if test $ac_opt_found != yes; then + case $host_os in #( + mingw* | windows*) : + ac_cv_sys_largefile_opts="supported through gnulib" + ac_opt_found=yes + ;; #( + *) : + ;; +esac + fi + + test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected" ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_opts" >&5 +printf "%s\n" "$ac_cv_sys_largefile_opts" >&6; } + +ac_have_largefile=yes +case $ac_cv_sys_largefile_opts in #( + "none needed") : + ;; #( + "supported through gnulib") : + ;; #( + "support not detected") : + ac_have_largefile=no ;; #( + "-D_FILE_OFFSET_BITS=64") : + +printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h + ;; #( + "-D_LARGE_FILES=1") : + +printf "%s\n" "#define _LARGE_FILES 1" >>confdefs.h + ;; #( + "-n32") : + CC="$CC -n32" ;; #( + *) : + as_fn_error $? "internal error: bad value for \$ac_cv_sys_largefile_opts" "$LINENO" 5 ;; +esac + +if test "$enable_year2038" != no +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option for timestamps after 2038" >&5 +printf %s "checking for $CC option for timestamps after 2038... " >&6; } +if test ${ac_cv_sys_year2038_opts+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_save_CPPFLAGS="$CPPFLAGS" + ac_opt_found=no + for ac_opt in "none needed" "-D_TIME_BITS=64" "-D__MINGW_USE_VC2005_COMPAT" "-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT"; do + if test x"$ac_opt" != x"none needed" +then : + CPPFLAGS="$ac_save_CPPFLAGS $ac_opt" +fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <time.h> + /* Check that time_t can represent 2**32 - 1 correctly. */ + #define LARGE_TIME_T \\ + ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30))) + int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535 + && LARGE_TIME_T % 65537 == 0) + ? 1 : -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_year2038_opts="$ac_opt" + ac_opt_found=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test $ac_opt_found = no || break + done + CPPFLAGS="$ac_save_CPPFLAGS" + test $ac_opt_found = yes || ac_cv_sys_year2038_opts="support not detected" ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_year2038_opts" >&5 +printf "%s\n" "$ac_cv_sys_year2038_opts" >&6; } + +ac_have_year2038=yes +case $ac_cv_sys_year2038_opts in #( + "none needed") : + ;; #( + "support not detected") : + ac_have_year2038=no ;; #( + "-D_TIME_BITS=64") : + +printf "%s\n" "#define _TIME_BITS 64" >>confdefs.h + ;; #( + "-D__MINGW_USE_VC2005_COMPAT") : + +printf "%s\n" "#define __MINGW_USE_VC2005_COMPAT 1" >>confdefs.h + ;; #( + "-U_USE_32_BIT_TIME_T"*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "the 'time_t' type is currently forced to be 32-bit. It +will stop working after mid-January 2038. Remove +_USE_32BIT_TIME_T from the compiler flags. +See 'config.log' for more details" "$LINENO" 5; } ;; #( + *) : + as_fn_error $? "internal error: bad value for \$ac_cv_sys_year2038_opts" "$LINENO" 5 ;; +esac + +fi + +fi + + + + # Pre-early section. + + + + + # Code from module absolute-header: + # Code from module accept: + # Code from module accept-tests: + # Code from module alloca: + # Code from module alloca-opt: + # Code from module alloca-opt-tests: + # Code from module allocator: + # Code from module announce-gen: + # Code from module areadlink: + # Code from module areadlink-tests: + # Code from module argmatch: + # Code from module argmatch-tests: + # Code from module arpa_inet: + # Code from module arpa_inet-tests: + # Code from module assure: + # Code from module binary-io: + # Code from module binary-io-tests: + # Code from module bind: + # Code from module bind-tests: + # Code from module bitrotate: + # Code from module bitrotate-tests: + # Code from module btowc: + # Code from module btowc-tests: + # Code from module builtin-expect: + # Code from module c-ctype: + # Code from module c-ctype-tests: + # Code from module c-stack: + # Code from module c-stack-tests: + # Code from module c-strcase: + # Code from module c-strcase-tests: + # Code from module c-strcaseeq: + # Code from module careadlinkat: + # Code from module clock-time: + # Code from module close: + # Code from module close-tests: + # Code from module config-h: + # Code from module configmake: + # Code from module connect: + # Code from module connect-tests: + # Code from module ctype: + # Code from module ctype-tests: + # Code from module diffseq: + # Code from module dirname: + # Code from module dirname-lgpl: + # Code from module dirname-tests: + # Code from module do-release-commit-and-tag: + # Code from module dosname: + # Code from module double-slash-root: + # Code from module dtotimespec: + # Code from module dup2: + # Code from module dup2-tests: + # Code from module environ: + # Code from module environ-tests: + # Code from module errno: + # Code from module errno-tests: + # Code from module error: + # Code from module exclude: + # Code from module exclude-tests: + # Code from module exitfail: + # Code from module extensions: + # Code from module extern-inline: + # Code from module fcntl: + # Code from module fcntl-h: + # Code from module fcntl-h-tests: + # Code from module fcntl-tests: + # Code from module fd-hook: + # Code from module fdl: + # Code from module fdopen: + # Code from module fdopen-tests: + # Code from module fgetc-tests: + # Code from module file-type: + # Code from module filename: + # Code from module filenamecat: + # Code from module filenamecat-lgpl: + # Code from module filenamecat-tests: + # Code from module flexmember: + # Code from module float: + # Code from module float-tests: + # Code from module fnmatch: + # Code from module fnmatch-gnu: + # Code from module fnmatch-tests: + # Code from module fpieee: + + # Code from module fpucw: + # Code from module fputc-tests: + # Code from module fread-tests: + # Code from module freopen: + # Code from module freopen-safer: + # Code from module freopen-safer-tests: + # Code from module freopen-tests: + # Code from module fstat: + # Code from module fstat-tests: + # Code from module ftruncate: + # Code from module ftruncate-tests: + # Code from module fwrite-tests: + # Code from module gendocs: + # Code from module getcwd-lgpl: + # Code from module getcwd-lgpl-tests: + # Code from module getdtablesize: + # Code from module getdtablesize-tests: + # Code from module getopt: + # Code from module getopt-gnu: + # Code from module getopt-gnu-tests: + # Code from module getopt-posix: + # Code from module getopt-posix-tests: + # Code from module getpagesize: + # Code from module getprogname: + # Code from module getprogname-tests: + # Code from module gettext-h: + # Code from module gettime: + # Code from module gettimeofday: + # Code from module gettimeofday-tests: + # Code from module git-version-gen: + # Code from module gitlog-to-changelog: + # Code from module gnu-make: + # Code from module gnu-web-doc-update: + # Code from module gnumakefile: + # Code from module gnupload: + # Code from module gperf: + # Code from module hard-locale: + # Code from module hash: + # Code from module hash-pjw: + # Code from module hash-tests: + # Code from module havelib: + # Code from module iconv: + # Code from module iconv-h: + # Code from module iconv-h-tests: + # Code from module iconv-tests: + # Code from module iconv_open: + # Code from module ignore-value: + # Code from module ignore-value-tests: + # Code from module include_next: + # Code from module inet_pton: + # Code from module inet_pton-tests: + # Code from module inline: + # Code from module intprops: + # Code from module intprops-tests: + # Code from module inttostr: + # Code from module inttostr-tests: + # Code from module inttypes: + # Code from module inttypes-incomplete: + # Code from module inttypes-tests: + # Code from module ioctl: + # Code from module ioctl-tests: + # Code from module isblank: + # Code from module isblank-tests: + # Code from module iswblank: + # Code from module iswblank-tests: + # Code from module langinfo: + # Code from module langinfo-tests: + # Code from module largefile: + + # Code from module libsigsegv: + # Code from module limits-h: + # Code from module limits-h-tests: + # Code from module listen: + # Code from module listen-tests: + # Code from module localcharset: + # Code from module locale: + # Code from module locale-tests: + # Code from module localeconv: + # Code from module localeconv-tests: + # Code from module localtime-buffer: + # Code from module lstat: + # Code from module lstat-tests: + # Code from module maintainer-makefile: + # Code from module malloc-posix: + # Code from module malloca: + # Code from module malloca-tests: + # Code from module manywarnings: + # Code from module mbchar: + # Code from module mbiter: + # Code from module mbrtowc: + # Code from module mbrtowc-tests: + # Code from module mbscasecmp: + # Code from module mbscasecmp-tests: + # Code from module mbsinit: + # Code from module mbsinit-tests: + # Code from module mbslen: + # Code from module mbsrtowcs: + # Code from module mbsrtowcs-tests: + # Code from module mbsstr: + # Code from module mbsstr-tests: + # Code from module mbtowc: + # Code from module mbuiter: + # Code from module memchr: + # Code from module memchr-tests: + # Code from module minmax: + # Code from module mkstemp: + # Code from module mktime: + # Code from module mktime-internal: + # Code from module msvc-inval: + # Code from module msvc-nothrow: + # Code from module multiarch: + # Code from module nanosleep: + # Code from module nanosleep-tests: + # Code from module netinet_in: + # Code from module netinet_in-tests: + # Code from module nl_langinfo: + # Code from module nl_langinfo-tests: + # Code from module nocrash: + # Code from module open: + # Code from module open-tests: + # Code from module pathmax: + # Code from module pathmax-tests: + # Code from module perror: + # Code from module perror-tests: + # Code from module pipe-posix: + # Code from module pipe-posix-tests: + # Code from module progname: + # Code from module propername: + # Code from module putenv: + # Code from module quote: + # Code from module quotearg: + # Code from module quotearg-simple: + # Code from module quotearg-simple-tests: + # Code from module raise: + # Code from module raise-tests: + # Code from module rawmemchr: + # Code from module rawmemchr-tests: + # Code from module readlink: + # Code from module readlink-tests: + # Code from module readme-release: + # Code from module regex: + # Code from module regex-tests: + # Code from module same-inode: + # Code from module secure_getenv: + # Code from module select: + # Code from module select-tests: + # Code from module setenv: + # Code from module setenv-tests: + # Code from module setlocale: + # Code from module setlocale-tests: + # Code from module setsockopt: + # Code from module setsockopt-tests: + # Code from module sh-quote: + # Code from module sh-quote-tests: + # Code from module sigaction: + # Code from module sigaction-tests: + # Code from module signal: + # Code from module signal-h: + # Code from module signal-h-tests: + # Code from module sigprocmask: + # Code from module sigprocmask-tests: + # Code from module size_max: + # Code from module sleep: + # Code from module sleep-tests: + # Code from module snippet/_Noreturn: + # Code from module snippet/arg-nonnull: + # Code from module snippet/c++defs: + # Code from module snippet/unused-parameter: + # Code from module snippet/warn-on-use: + # Code from module snprintf: + # Code from module snprintf-tests: + # Code from module socket: + # Code from module socketlib: + # Code from module sockets: + # Code from module sockets-tests: + # Code from module socklen: + # Code from module ssize_t: + # Code from module stat: + # Code from module stat-macros: + # Code from module stat-tests: + # Code from module stat-time: + # Code from module stat-time-tests: + # Code from module stdalign: + # Code from module stdalign-tests: + # Code from module stdarg: + + + + # Code from module stdbool: + # Code from module stdbool-tests: + # Code from module stddef: + # Code from module stddef-tests: + # Code from module stdint: + # Code from module stdint-tests: + # Code from module stdio: + # Code from module stdio-tests: + # Code from module stdlib: + # Code from module stdlib-tests: + # Code from module strcase: + # Code from module streq: + # Code from module strerror: + # Code from module strerror-override: + # Code from module strerror-tests: + # Code from module strerror_r-posix: + # Code from module strerror_r-posix-tests: + # Code from module strftime: + # Code from module strftime-tests: + # Code from module striconv: + # Code from module striconv-tests: + # Code from module string: + # Code from module string-tests: + # Code from module strings: + # Code from module strings-tests: + # Code from module strndup: + # Code from module strnlen: + # Code from module strnlen-tests: + # Code from module strnlen1: + # Code from module strptime: + # Code from module strtoull: + # Code from module strtoull-tests: + # Code from module strtoumax: + # Code from module strtoumax-tests: + # Code from module symlink: + # Code from module symlink-tests: + # Code from module sys_ioctl: + # Code from module sys_ioctl-tests: + # Code from module sys_select: + # Code from module sys_select-tests: + # Code from module sys_socket: + # Code from module sys_socket-tests: + # Code from module sys_stat: + # Code from module sys_stat-tests: + # Code from module sys_time: + # Code from module sys_time-tests: + # Code from module sys_types: + # Code from module sys_types-tests: + # Code from module sys_uio: + # Code from module sys_uio-tests: + # Code from module sys_wait: + # Code from module sys_wait-tests: + # Code from module system-quote: + # Code from module tempname: + # Code from module test-framework-sh: + # Code from module test-framework-sh-tests: + # Code from module time: + # Code from module time-tests: + # Code from module time_r: + # Code from module time_rz: + # Code from module timegm: + # Code from module timespec: + # Code from module timespec-add: + # Code from module timespec-sub: + # Code from module timespec-tests: + # Code from module trim: + # Code from module tzset: + # Code from module unistd: + # Code from module unistd-tests: + # Code from module unistr/base: + # Code from module unistr/u8-mbtoucr: + # Code from module unistr/u8-mbtoucr-tests: + # Code from module unistr/u8-uctomb: + # Code from module unistr/u8-uctomb-tests: + # Code from module unitypes: + # Code from module uniwidth/base: + # Code from module uniwidth/width: + # Code from module uniwidth/width-tests: + # Code from module unlocked-io: + # Code from module unsetenv: + # Code from module unsetenv-tests: + # Code from module update-copyright: + # Code from module update-copyright-tests: + # Code from module useless-if-before-free: + # Code from module vararrays: + # Code from module vasnprintf: + # Code from module vasnprintf-tests: + # Code from module vasprintf: + # Code from module vasprintf-tests: + # Code from module vc-list-files: + # Code from module vc-list-files-tests: + # Code from module verify: + # Code from module verify-tests: + # Code from module version-etc: + # Code from module version-etc-fsf: + # Code from module version-etc-tests: + # Code from module warnings: + # Code from module wchar: + # Code from module wchar-tests: + # Code from module wcrtomb: + # Code from module wcrtomb-tests: + # Code from module wctob: + # Code from module wctomb: + # Code from module wctype-h: + # Code from module wctype-h-tests: + # Code from module wcwidth: + # Code from module wcwidth-tests: + # Code from module xalloc: + # Code from module xalloc-die: + # Code from module xalloc-die-tests: + # Code from module xalloc-oversized: + # Code from module xfreopen: + # Code from module xreadlink: + # Code from module xsize: + # Code from module xstriconv: + # Code from module xstrndup: + # Code from module xstrtol: + # Code from module xstrtol-tests: + # Code from module xstrtoumax: + # Code from module xstrtoumax-tests: + # Code from module xvasprintf: + # Code from module xvasprintf-tests: + + + + + + + + LIBC_FATAL_STDERR_=1 + export LIBC_FATAL_STDERR_ + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes +then : + +else case e in #( + e) +printf "%s\n" "#define size_t unsigned int" >>confdefs.h + ;; +esac +fi + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +printf %s "checking for working alloca.h... " >&6; } +if test ${ac_cv_working_alloca_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <alloca.h> +int +main (void) +{ +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_working_alloca_h=yes +else case e in #( + e) ac_cv_working_alloca_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +printf "%s\n" "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then + +printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +printf %s "checking for alloca... " >&6; } +if test ${ac_cv_func_alloca_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_func_alloca_works=$ac_cv_working_alloca_h +if test "$ac_cv_func_alloca_works" != yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#include <stddef.h> +#ifndef alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _MSC_VER +# include <malloc.h> +# define alloca _alloca +# else +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +# endif +#endif + +int +main (void) +{ +char *p = (char *) alloca (1); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_func_alloca_works=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +printf "%s\n" "$ac_cv_func_alloca_works" >&6; } + +if test $ac_cv_func_alloca_works = yes; then + +printf "%s\n" "#define HAVE_ALLOCA 1" >>confdefs.h + +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + + + + + +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext + +printf "%s\n" "#define C_ALLOCA 1" >>confdefs.h + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +printf %s "checking stack direction for C alloca... " >&6; } +if test ${ac_cv_c_stack_direction+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + ac_cv_c_stack_direction=0 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction (int *addr, int depth) +{ + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; +} + +int +main (int argc, char **argv) +{ + return find_stack_direction (0, argc + !argv + 20) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_stack_direction=1 +else case e in #( + e) ac_cv_c_stack_direction=-1 ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +printf "%s\n" "$ac_cv_c_stack_direction" >&6; } +printf "%s\n" "#define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h + + +fi + + + GNULIB_BTOWC=0; + GNULIB_WCTOB=0; + GNULIB_MBSINIT=0; + GNULIB_MBRTOWC=0; + GNULIB_MBRLEN=0; + GNULIB_MBSRTOWCS=0; + GNULIB_MBSNRTOWCS=0; + GNULIB_WCRTOMB=0; + GNULIB_WCSRTOMBS=0; + GNULIB_WCSNRTOMBS=0; + GNULIB_WCWIDTH=0; + GNULIB_WMEMCHR=0; + GNULIB_WMEMCMP=0; + GNULIB_WMEMCPY=0; + GNULIB_WMEMMOVE=0; + GNULIB_WMEMSET=0; + GNULIB_WCSLEN=0; + GNULIB_WCSNLEN=0; + GNULIB_WCSCPY=0; + GNULIB_WCPCPY=0; + GNULIB_WCSNCPY=0; + GNULIB_WCPNCPY=0; + GNULIB_WCSCAT=0; + GNULIB_WCSNCAT=0; + GNULIB_WCSCMP=0; + GNULIB_WCSNCMP=0; + GNULIB_WCSCASECMP=0; + GNULIB_WCSNCASECMP=0; + GNULIB_WCSCOLL=0; + GNULIB_WCSXFRM=0; + GNULIB_WCSDUP=0; + GNULIB_WCSCHR=0; + GNULIB_WCSRCHR=0; + GNULIB_WCSCSPN=0; + GNULIB_WCSSPN=0; + GNULIB_WCSPBRK=0; + GNULIB_WCSSTR=0; + GNULIB_WCSTOK=0; + GNULIB_WCSWIDTH=0; + GNULIB_WCSFTIME=0; + HAVE_BTOWC=1; + HAVE_MBSINIT=1; + HAVE_MBRTOWC=1; + HAVE_MBRLEN=1; + HAVE_MBSRTOWCS=1; + HAVE_MBSNRTOWCS=1; + HAVE_WCRTOMB=1; + HAVE_WCSRTOMBS=1; + HAVE_WCSNRTOMBS=1; + HAVE_WMEMCHR=1; + HAVE_WMEMCMP=1; + HAVE_WMEMCPY=1; + HAVE_WMEMMOVE=1; + HAVE_WMEMSET=1; + HAVE_WCSLEN=1; + HAVE_WCSNLEN=1; + HAVE_WCSCPY=1; + HAVE_WCPCPY=1; + HAVE_WCSNCPY=1; + HAVE_WCPNCPY=1; + HAVE_WCSCAT=1; + HAVE_WCSNCAT=1; + HAVE_WCSCMP=1; + HAVE_WCSNCMP=1; + HAVE_WCSCASECMP=1; + HAVE_WCSNCASECMP=1; + HAVE_WCSCOLL=1; + HAVE_WCSXFRM=1; + HAVE_WCSDUP=1; + HAVE_WCSCHR=1; + HAVE_WCSRCHR=1; + HAVE_WCSCSPN=1; + HAVE_WCSSPN=1; + HAVE_WCSPBRK=1; + HAVE_WCSSTR=1; + HAVE_WCSTOK=1; + HAVE_WCSWIDTH=1; + HAVE_WCSFTIME=1; + HAVE_DECL_WCTOB=1; + HAVE_DECL_WCWIDTH=1; + REPLACE_MBSTATE_T=0; + REPLACE_BTOWC=0; + REPLACE_WCTOB=0; + REPLACE_MBSINIT=0; + REPLACE_MBRTOWC=0; + REPLACE_MBRLEN=0; + REPLACE_MBSRTOWCS=0; + REPLACE_MBSNRTOWCS=0; + REPLACE_WCRTOMB=0; + REPLACE_WCSRTOMBS=0; + REPLACE_WCSNRTOMBS=0; + REPLACE_WCWIDTH=0; + REPLACE_WCSWIDTH=0; + REPLACE_WCSFTIME=0; + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5 +printf %s "checking whether <wchar.h> uses 'inline' correctly... " >&6; } +if test ${gl_cv_header_wchar_h_correct_inline+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) gl_cv_header_wchar_h_correct_inline=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +extern int zero (void); +int main () { return zero(); } + +_ACEOF + save_ac_compile="$ac_compile" + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int zero (void) { return 0; } + +_ACEOF + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then + : + else + gl_cv_header_wchar_h_correct_inline=no + fi + fi + fi + ac_compile="$save_ac_compile" + rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5 +printf "%s\n" "$gl_cv_header_wchar_h_correct_inline" >&6; } + if test $gl_cv_header_wchar_h_correct_inline = no; then + as_fn_error $? "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). +This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in +C99 mode. You have four options: + - Add the flag -fgnu89-inline to CC and reconfigure, or + - Fix your include files, using parts of + <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or + - Use a gcc version older than 4.3, or + - Don't use the flags -std=c99 or -std=gnu99. +Configuration aborted." "$LINENO" 5 + fi + +ac_func= +for ac_item in $ac_func_c_list +do + if test $ac_func; then + ac_fn_c_check_func "$LINENO" $ac_func ac_cv_func_$ac_func + if eval test \"x\$ac_cv_func_$ac_func\" = xyes; then + echo "#define $ac_item 1" >> confdefs.h + fi + ac_func= + else + ac_func=$ac_item + fi +done + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 +printf %s "checking for nl_langinfo and CODESET... " >&6; } +if test ${am_cv_langinfo_codeset+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> +int +main (void) +{ +char* cs = nl_langinfo(CODESET); return !cs; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_langinfo_codeset=yes +else case e in #( + e) am_cv_langinfo_codeset=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 +printf "%s\n" "$am_cv_langinfo_codeset" >&6; } + if test $am_cv_langinfo_codeset = yes; then + +printf "%s\n" "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h + + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + + + + + + case "$host_os" in + sunos4* | freebsd* | dragonfly* | openbsd* | mirbsd* | netbsd* | kfreebsd* | knetbsd*) # BSD systems + FAULT_YIELDS_SIGBUS=1 ;; + hpux*) # HP-UX + FAULT_YIELDS_SIGBUS=1 ;; + macos* | darwin*) # Mac OS X + FAULT_YIELDS_SIGBUS=1 ;; + gnu*) # Hurd + FAULT_YIELDS_SIGBUS=1 ;; + *) + FAULT_YIELDS_SIGBUS=0 ;; + esac + +printf "%s\n" "#define FAULT_YIELDS_SIGBUS $FAULT_YIELDS_SIGBUS" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working C stack overflow detection" >&5 +printf %s "checking for working C stack overflow detection... " >&6; } +if test ${ac_cv_sys_stack_overflow_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + ac_cv_sys_stack_overflow_works=cross-compiling +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <unistd.h> + #include <signal.h> + #if HAVE_SETRLIMIT + # include <sys/types.h> + # include <sys/time.h> + # include <sys/resource.h> + #endif + #ifndef SIGSTKSZ + # define SIGSTKSZ 16384 + #endif + + static union + { + char buffer[2 * SIGSTKSZ]; + long double ld; + long u; + void *p; + } alternate_signal_stack; + + static void + segv_handler (int signo) + { + _exit (0); + } + + static int + c_stack_action () + { + stack_t st; + struct sigaction act; + int r; + + st.ss_flags = 0; + /* Use the midpoint to avoid Irix sigaltstack bug. */ + st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; + st.ss_size = SIGSTKSZ; + r = sigaltstack (&st, 0); + if (r != 0) + return 1; + + sigemptyset (&act.sa_mask); + act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND; + act.sa_handler = segv_handler; + #if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, 0) < 0) + return 2; + #endif + if (sigaction (SIGSEGV, &act, 0) < 0) + return 3; + return 0; + } + static volatile int * + recurse_1 (volatile int n, volatile int *p) + { + if (n >= 0) + *recurse_1 (n + 1, p) += n; + return p; + } + static int + recurse (volatile int n) + { + int sum = 0; + return *recurse_1 (n, &sum); + } + int + main () + { + int result; + #if HAVE_SETRLIMIT && defined RLIMIT_STACK + /* Before starting the endless recursion, try to be friendly + to the user's machine. On some Linux 2.2.x systems, there + is no stack limit for user processes at all. We don't want + to kill such systems. */ + struct rlimit rl; + rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */ + setrlimit (RLIMIT_STACK, &rl); + #endif + + result = c_stack_action (); + if (result != 0) + return result; + return recurse (0); + } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_sys_stack_overflow_works=yes +else case e in #( + e) ac_cv_sys_stack_overflow_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_stack_overflow_works" >&5 +printf "%s\n" "$ac_cv_sys_stack_overflow_works" >&6; } + + if test $ac_cv_sys_stack_overflow_works = yes; then + +printf "%s\n" "#define HAVE_STACK_OVERFLOW_HANDLING 1" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for correct stack_t interpretation" >&5 +printf %s "checking for correct stack_t interpretation... " >&6; } +if test ${gl_cv_sigaltstack_low_base+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test "$cross_compiling" = yes +then : + gl_cv_sigaltstack_low_base=cross-compiling +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#include <stdlib.h> +#include <signal.h> +#if HAVE_SYS_SIGNAL_H +# include <sys/signal.h> +#endif +#ifndef SIGSTKSZ +# define SIGSTKSZ 16384 +#endif +volatile char *stack_lower_bound; +volatile char *stack_upper_bound; +static void check_stack_location (volatile char *addr) +{ + if (addr >= stack_lower_bound && addr <= stack_upper_bound) + exit (0); + else + exit (1); +} +static void stackoverflow_handler (int sig) +{ + char dummy; + check_stack_location (&dummy); +} +int main () +{ + char mystack[2 * SIGSTKSZ]; + stack_t altstack; + struct sigaction action; + /* Install the alternate stack. */ + altstack.ss_sp = mystack + SIGSTKSZ; + altstack.ss_size = SIGSTKSZ; + stack_lower_bound = (char *) altstack.ss_sp; + stack_upper_bound = (char *) altstack.ss_sp + altstack.ss_size - 1; + altstack.ss_flags = 0; /* no SS_DISABLE */ + if (sigaltstack (&altstack, NULL) < 0) + exit (2); + /* Install the SIGSEGV handler. */ + sigemptyset (&action.sa_mask); + action.sa_handler = &stackoverflow_handler; + action.sa_flags = SA_ONSTACK; + if (sigaction (SIGSEGV, &action, (struct sigaction *) NULL) < 0) + exit(3); + /* Provoke a SIGSEGV. */ + raise (SIGSEGV); + exit (4); +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_sigaltstack_low_base=yes +else case e in #( + e) gl_cv_sigaltstack_low_base=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sigaltstack_low_base" >&5 +printf "%s\n" "$gl_cv_sigaltstack_low_base" >&6; } + if test "$gl_cv_sigaltstack_low_base" = no; then + +printf "%s\n" "#define SIGALTSTACK_SS_REVERSED 1" >>confdefs.h + + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for precise C stack overflow detection" >&5 +printf %s "checking for precise C stack overflow detection... " >&6; } +if test ${ac_cv_sys_xsi_stack_overflow_heuristic+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <unistd.h> + #include <signal.h> + #if HAVE_UCONTEXT_H + # include <ucontext.h> + #endif + #if HAVE_SETRLIMIT + # include <sys/types.h> + # include <sys/time.h> + # include <sys/resource.h> + #endif + #ifndef SIGSTKSZ + # define SIGSTKSZ 16384 + #endif + + static union + { + char buffer[2 * SIGSTKSZ]; + long double ld; + long u; + void *p; + } alternate_signal_stack; + + #if STACK_DIRECTION + # define find_stack_direction(ptr) STACK_DIRECTION + #else + static int + find_stack_direction (char const *addr) + { + char dummy; + return (! addr ? find_stack_direction (&dummy) + : addr < &dummy ? 1 : -1); + } + #endif + + static void + segv_handler (int signo, siginfo_t *info, void *context) + { + if (0 < info->si_code) + { + /* For XSI heuristics to work, we need uc_stack to describe + the interrupted stack (as on Solaris), and not the + currently executing stack (as on Linux). */ + ucontext_t const *user_context = context; + char const *stack_min = user_context->uc_stack.ss_sp; + size_t stack_size = user_context->uc_stack.ss_size; + char const *faulting_address = info->si_addr; + size_t s = faulting_address - stack_min; + size_t page_size = sysconf (_SC_PAGESIZE); + if (find_stack_direction (0) < 0) + s += page_size; + if (s < stack_size + page_size) + _exit (0); + _exit (4); + } + _exit (5); + } + + static int + c_stack_action () + { + stack_t st; + struct sigaction act; + int r; + + st.ss_flags = 0; + /* Use the midpoint to avoid Irix sigaltstack bug. */ + st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; + st.ss_size = SIGSTKSZ; + r = sigaltstack (&st, 0); + if (r != 0) + return 1; + + sigemptyset (&act.sa_mask); + act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO; + act.sa_sigaction = segv_handler; + #if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, 0) < 0) + return 2; + #endif + if (sigaction (SIGSEGV, &act, 0) < 0) + return 3; + return 0; + } + static volatile int * + recurse_1 (volatile int n, volatile int *p) + { + if (n >= 0) + *recurse_1 (n + 1, p) += n; + return p; + } + static int + recurse (volatile int n) + { + int sum = 0; + return *recurse_1 (n, &sum); + } + int + main () + { + int result; + #if HAVE_SETRLIMIT && defined RLIMIT_STACK + /* Before starting the endless recursion, try to be friendly + to the user's machine. On some Linux 2.2.x systems, there + is no stack limit for user processes at all. We don't want + to kill such systems. */ + struct rlimit rl; + rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */ + setrlimit (RLIMIT_STACK, &rl); + #endif + + result = c_stack_action (); + if (result != 0) + return result; + return recurse (0); + } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_sys_xsi_stack_overflow_heuristic=yes +else case e in #( + e) ac_cv_sys_xsi_stack_overflow_heuristic=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_xsi_stack_overflow_heuristic" >&5 +printf "%s\n" "$ac_cv_sys_xsi_stack_overflow_heuristic" >&6; } + + if test $ac_cv_sys_xsi_stack_overflow_heuristic = yes; then + +printf "%s\n" "#define HAVE_XSI_STACK_OVERFLOW_HEURISTIC 1" >>confdefs.h + + fi + fi + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + + +# Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else case e in #( + e) with_gnu_ld=no ;; +esac +fi + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld" >&5 +printf %s "checking for ld... " >&6; } +elif test "$GCC" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } +elif test "$with_gnu_ld" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test -n "$LD"; then + # Let the user override the test with a path. + : +else + if test ${acl_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + acl_cv_path_LD= # Final result of this test + ac_prog=ld # Program to search in $PATH + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + acl_output=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $acl_output in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` + while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do + acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` + done + # Got the pathname. No search in PATH is needed. + acl_cv_path_LD="$acl_output" + ac_prog= + ;; + "") + # If it fails, then pretend we aren't using GCC. + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac + fi + if test -n "$ac_prog"; then + # Search for $ac_prog in $PATH. + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$acl_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break + ;; + *) + test "$with_gnu_ld" != yes && break + ;; + esac + fi + done + IFS="$acl_save_ifs" + fi + case $host in + *-*-aix*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __powerpc64__ || defined _ARCH_PPC64 + yes + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + # The compiler produces 64-bit code. Add option '-b64' so that the + # linker groks 64-bit object files. + case "$acl_cv_path_LD " in + *" -b64 "*) ;; + *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;; + esac + +fi +rm -rf conftest* + + ;; + esac + ;; +esac +fi + + LD="$acl_cv_path_LD" +fi +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${acl_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + acl_cv_prog_gnu_ld=yes + ;; +*) + acl_cv_prog_gnu_ld=no + ;; +esac ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5 +printf "%s\n" "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +printf %s "checking for shared library run path origin... " >&6; } +if test ${acl_cv_rpath+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +printf "%s\n" "$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath was given. +if test ${enable_rpath+y} +then : + enableval=$enable_rpath; : +else case e in #( + e) enable_rpath=yes ;; +esac +fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5 +printf %s "checking for the common suffixes of directories in the library search path... " >&6; } +if test ${acl_cv_libdirstems+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) acl_libdirstem=lib + acl_libdirstem2= + case "$host_os" in + solaris*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 +printf %s "checking for 64-bit host... " >&6; } +if test ${gl_cv_solaris_64bit+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _LP64 +sixtyfour bits +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "sixtyfour bits" >/dev/null 2>&1 +then : + gl_cv_solaris_64bit=yes +else case e in #( + e) gl_cv_solaris_64bit=no ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 +printf "%s\n" "$gl_cv_solaris_64bit" >&6; } + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; + esac + fi + ;; + *) + searchpath=`(if test -f /usr/bin/gcc \ + && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \ + LC_ALL=C /usr/bin/gcc -print-search-dirs; \ + else \ + LC_ALL=C $CC -print-search-dirs; \ + fi) 2>/dev/null \ + | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_libdirstems" >&5 +printf "%s\n" "$acl_cv_libdirstems" >&6; } + # Decompose acl_cv_libdirstems into acl_libdirstem and acl_libdirstem2. + acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` + acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e '/,/s/.*,//'` + + + + + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libsigsegv-prefix was given. +if test ${with_libsigsegv_prefix+y} +then : + withval=$with_libsigsegv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBSIGSEGV= + LTLIBSIGSEGV= + INCSIGSEGV= + LIBSIGSEGV_PREFIX= + HAVE_LIBSIGSEGV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='sigsegv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_a" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCSIGSEGV="${INCSIGSEGV}${INCSIGSEGV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$dep" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$dep" + ;; + esac + done + fi + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-R$found_dir" + done + fi + + + + + + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCSIGSEGV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsigsegv" >&5 +printf %s "checking for libsigsegv... " >&6; } +if test ${ac_cv_libsigsegv+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + ac_save_LIBS="$LIBS" + case " $LIBSIGSEGV" in + *" -l"*) LIBS="$LIBS $LIBSIGSEGV" ;; + *) LIBS="$LIBSIGSEGV $LIBS" ;; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sigsegv.h> +int +main (void) +{ +sigsegv_deinstall_handler(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libsigsegv=yes +else case e in #( + e) ac_cv_libsigsegv='no, consider installing GNU libsigsegv' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libsigsegv" >&5 +printf "%s\n" "$ac_cv_libsigsegv" >&6; } + if test "$ac_cv_libsigsegv" = yes; then + HAVE_LIBSIGSEGV=yes + +printf "%s\n" "#define HAVE_LIBSIGSEGV 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libsigsegv" >&5 +printf %s "checking how to link with libsigsegv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBSIGSEGV" >&5 +printf "%s\n" "$LIBSIGSEGV" >&6; } + else + HAVE_LIBSIGSEGV=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBSIGSEGV= + LTLIBSIGSEGV= + LIBSIGSEGV_PREFIX= + fi + + + + + + + + gl_cv_lib_sigsegv="$ac_cv_libsigsegv" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in #( + e) # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <float.h> +#include <limits.h> +#include <stdarg.h> +#include <stddef.h> +extern void ac_decl (int, char *); + +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else case e in #( + e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; +esac +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See 'config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac + + + + GNULIB_CHDIR=0; + GNULIB_CHOWN=0; + GNULIB_CLOSE=0; + GNULIB_DUP=0; + GNULIB_DUP2=0; + GNULIB_DUP3=0; + GNULIB_ENVIRON=0; + GNULIB_EUIDACCESS=0; + GNULIB_FACCESSAT=0; + GNULIB_FCHDIR=0; + GNULIB_FCHOWNAT=0; + GNULIB_FDATASYNC=0; + GNULIB_FSYNC=0; + GNULIB_FTRUNCATE=0; + GNULIB_GETCWD=0; + GNULIB_GETDOMAINNAME=0; + GNULIB_GETDTABLESIZE=0; + GNULIB_GETGROUPS=0; + GNULIB_GETHOSTNAME=0; + GNULIB_GETLOGIN=0; + GNULIB_GETLOGIN_R=0; + GNULIB_GETPAGESIZE=0; + GNULIB_GETUSERSHELL=0; + GNULIB_GROUP_MEMBER=0; + GNULIB_ISATTY=0; + GNULIB_LCHOWN=0; + GNULIB_LINK=0; + GNULIB_LINKAT=0; + GNULIB_LSEEK=0; + GNULIB_PIPE=0; + GNULIB_PIPE2=0; + GNULIB_PREAD=0; + GNULIB_PWRITE=0; + GNULIB_READ=0; + GNULIB_READLINK=0; + GNULIB_READLINKAT=0; + GNULIB_RMDIR=0; + GNULIB_SETHOSTNAME=0; + GNULIB_SLEEP=0; + GNULIB_SYMLINK=0; + GNULIB_SYMLINKAT=0; + GNULIB_TRUNCATE=0; + GNULIB_TTYNAME_R=0; + GNULIB_UNISTD_H_NONBLOCKING=0; + GNULIB_UNISTD_H_SIGPIPE=0; + GNULIB_UNLINK=0; + GNULIB_UNLINKAT=0; + GNULIB_USLEEP=0; + GNULIB_WRITE=0; + HAVE_CHOWN=1; + HAVE_DUP2=1; + HAVE_DUP3=1; + HAVE_EUIDACCESS=1; + HAVE_FACCESSAT=1; + HAVE_FCHDIR=1; + HAVE_FCHOWNAT=1; + HAVE_FDATASYNC=1; + HAVE_FSYNC=1; + HAVE_FTRUNCATE=1; + HAVE_GETDTABLESIZE=1; + HAVE_GETGROUPS=1; + HAVE_GETHOSTNAME=1; + HAVE_GETLOGIN=1; + HAVE_GETPAGESIZE=1; + HAVE_GROUP_MEMBER=1; + HAVE_LCHOWN=1; + HAVE_LINK=1; + HAVE_LINKAT=1; + HAVE_PIPE=1; + HAVE_PIPE2=1; + HAVE_PREAD=1; + HAVE_PWRITE=1; + HAVE_READLINK=1; + HAVE_READLINKAT=1; + HAVE_SETHOSTNAME=1; + HAVE_SLEEP=1; + HAVE_SYMLINK=1; + HAVE_SYMLINKAT=1; + HAVE_TRUNCATE=1; + HAVE_UNLINKAT=1; + HAVE_USLEEP=1; + HAVE_DECL_ENVIRON=1; + HAVE_DECL_FCHDIR=1; + HAVE_DECL_FDATASYNC=1; + HAVE_DECL_GETDOMAINNAME=1; + HAVE_DECL_GETLOGIN=1; + HAVE_DECL_GETLOGIN_R=1; + HAVE_DECL_GETPAGESIZE=1; + HAVE_DECL_GETUSERSHELL=1; + HAVE_DECL_SETHOSTNAME=1; + HAVE_DECL_TTYNAME_R=1; + HAVE_OS_H=0; + HAVE_SYS_PARAM_H=0; + REPLACE_CHOWN=0; + REPLACE_CLOSE=0; + REPLACE_DUP=0; + REPLACE_DUP2=0; + REPLACE_FCHOWNAT=0; + REPLACE_FTRUNCATE=0; + REPLACE_GETCWD=0; + REPLACE_GETDOMAINNAME=0; + REPLACE_GETDTABLESIZE=0; + REPLACE_GETLOGIN_R=0; + REPLACE_GETGROUPS=0; + REPLACE_GETPAGESIZE=0; + REPLACE_ISATTY=0; + REPLACE_LCHOWN=0; + REPLACE_LINK=0; + REPLACE_LINKAT=0; + REPLACE_LSEEK=0; + REPLACE_PREAD=0; + REPLACE_PWRITE=0; + REPLACE_READ=0; + REPLACE_READLINK=0; + REPLACE_READLINKAT=0; + REPLACE_RMDIR=0; + REPLACE_SLEEP=0; + REPLACE_SYMLINK=0; + REPLACE_SYMLINKAT=0; + REPLACE_TRUNCATE=0; + REPLACE_TTYNAME_R=0; + REPLACE_UNLINK=0; + REPLACE_UNLINKAT=0; + REPLACE_USLEEP=0; + REPLACE_WRITE=0; + UNISTD_H_HAVE_WINSOCK2_H=0; + UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; + + + + + + if test $ac_cv_func__set_invalid_parameter_handler = yes; then + HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 + +printf "%s\n" "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h + + else + HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 + fi + + + + GNULIB_IOCTL=0; + SYS_IOCTL_H_HAVE_WINSOCK2_H=0; + SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; + + REPLACE_IOCTL=0; + + + + GNULIB_ISBLANK=0; + HAVE_ISBLANK=1; + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5 +printf %s "checking whether the preprocessor supports include_next... " >&6; } +if test ${gl_cv_have_include_next+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) rm -rf conftestd1a conftestd1b conftestd2 + mkdir conftestd1a conftestd1b conftestd2 + cat <<EOF > conftestd1a/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include_next <conftest.h> +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat <<EOF > conftestd1b/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include <stdio.h> +#include_next <conftest.h> +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat <<EOF > conftestd2/conftest.h +#ifndef DEFINED_IN_CONFTESTD1 +#error "include_next test doesn't work" +#endif +#define DEFINED_IN_CONFTESTD2 +EOF + gl_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <conftest.h> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_have_include_next=yes +else case e in #( + e) CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <conftest.h> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_have_include_next=buggy +else case e in #( + e) gl_cv_have_include_next=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CPPFLAGS="$gl_save_CPPFLAGS" + rm -rf conftestd1a conftestd1b conftestd2 + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5 +printf "%s\n" "$gl_cv_have_include_next" >&6; } + PRAGMA_SYSTEM_HEADER= + if test $gl_cv_have_include_next = yes; then + INCLUDE_NEXT=include_next + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + if test -n "$GCC"; then + PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' + fi + else + if test $gl_cv_have_include_next = buggy; then + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + else + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include + fi + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5 +printf %s "checking whether system header files limit the line length... " >&6; } +if test ${gl_cv_pragma_columns+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __TANDEM +choke me +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "choke me" >/dev/null 2>&1 +then : + gl_cv_pragma_columns=yes +else case e in #( + e) gl_cv_pragma_columns=no ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5 +printf "%s\n" "$gl_cv_pragma_columns" >&6; } + if test $gl_cv_pragma_columns = yes; then + PRAGMA_COLUMNS="#pragma COLUMNS 10000" + else + PRAGMA_COLUMNS= + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 +printf %s "checking whether // is distinct from /... " >&6; } +if test ${gl_cv_double_slash_root+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # <bug-gnulib@gnu.org>. + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + gl_cv_double_slash_root='unknown, assuming no' ;; + esac + else + set x `ls -di / // 2>/dev/null` + if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 +printf "%s\n" "$gl_cv_double_slash_root" >&6; } + if test "$gl_cv_double_slash_root" = yes; then + +printf "%s\n" "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h + + fi + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5 +printf %s "checking if environ is properly declared... " >&6; } + if test ${gt_cv_var_environ_declaration+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_UNISTD_H + #include <unistd.h> + #endif + /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */ + #include <stdlib.h> + + extern struct { int foo; } environ; +int +main (void) +{ +environ.foo = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_var_environ_declaration=no +else case e in #( + e) gt_cv_var_environ_declaration=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5 +printf "%s\n" "$gt_cv_var_environ_declaration" >&6; } + if test $gt_cv_var_environ_declaration = yes; then + +printf "%s\n" "#define HAVE_ENVIRON_DECL 1" >>confdefs.h + + fi + + + if test $gt_cv_var_environ_declaration != yes; then + HAVE_DECL_ENVIRON=0 + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5 +printf %s "checking for complete errno.h... " >&6; } +if test ${gl_cv_header_errno_h_complete+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <errno.h> +#if !defined ETXTBSY +booboo +#endif +#if !defined ENOMSG +booboo +#endif +#if !defined EIDRM +booboo +#endif +#if !defined ENOLINK +booboo +#endif +#if !defined EPROTO +booboo +#endif +#if !defined EMULTIHOP +booboo +#endif +#if !defined EBADMSG +booboo +#endif +#if !defined EOVERFLOW +booboo +#endif +#if !defined ENOTSUP +booboo +#endif +#if !defined ENETRESET +booboo +#endif +#if !defined ECONNABORTED +booboo +#endif +#if !defined ESTALE +booboo +#endif +#if !defined EDQUOT +booboo +#endif +#if !defined ECANCELED +booboo +#endif +#if !defined EOWNERDEAD +booboo +#endif +#if !defined ENOTRECOVERABLE +booboo +#endif +#if !defined EILSEQ +booboo +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "booboo" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_complete=no +else case e in #( + e) gl_cv_header_errno_h_complete=yes ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5 +printf "%s\n" "$gl_cv_header_errno_h_complete" >&6; } + if test $gl_cv_header_errno_h_complete = yes; then + ERRNO_H='' + else + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_errno_h='<'errno.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5 +printf %s "checking absolute name of <errno.h>... " >&6; } +if test ${gl_cv_next_errno_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <errno.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'errno.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_errno_h + gl_cv_next_errno_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5 +printf "%s\n" "$gl_cv_next_errno_h" >&6; } + fi + NEXT_ERRNO_H=$gl_cv_next_errno_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'errno.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_errno_h + fi + NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive + + + + + ERRNO_H='errno.h' + fi + + if test -n "$ERRNO_H"; then + GL_GENERATE_ERRNO_H_TRUE= + GL_GENERATE_ERRNO_H_FALSE='#' +else + GL_GENERATE_ERRNO_H_TRUE='#' + GL_GENERATE_ERRNO_H_FALSE= +fi + + + if test -n "$ERRNO_H"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5 +printf %s "checking for EMULTIHOP value... " >&6; } +if test ${gl_cv_header_errno_h_EMULTIHOP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <errno.h> +#ifdef EMULTIHOP +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EMULTIHOP=yes +else case e in #( + e) gl_cv_header_errno_h_EMULTIHOP=no ;; +esac +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EMULTIHOP = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +#ifdef EMULTIHOP +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EMULTIHOP=hidden +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then + if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include <stdio.h> +#include <stdlib.h> +" +then : + +fi + + fi + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5 +printf "%s\n" "$gl_cv_header_errno_h_EMULTIHOP" >&6; } + case $gl_cv_header_errno_h_EMULTIHOP in + yes | no) + EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE= + ;; + *) + EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP" + ;; + esac + + + fi + + + if test -n "$ERRNO_H"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5 +printf %s "checking for ENOLINK value... " >&6; } +if test ${gl_cv_header_errno_h_ENOLINK+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <errno.h> +#ifdef ENOLINK +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_ENOLINK=yes +else case e in #( + e) gl_cv_header_errno_h_ENOLINK=no ;; +esac +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_ENOLINK = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +#ifdef ENOLINK +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_ENOLINK=hidden +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_ENOLINK = hidden; then + if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include <stdio.h> +#include <stdlib.h> +" +then : + +fi + + fi + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5 +printf "%s\n" "$gl_cv_header_errno_h_ENOLINK" >&6; } + case $gl_cv_header_errno_h_ENOLINK in + yes | no) + ENOLINK_HIDDEN=0; ENOLINK_VALUE= + ;; + *) + ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK" + ;; + esac + + + fi + + + if test -n "$ERRNO_H"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5 +printf %s "checking for EOVERFLOW value... " >&6; } +if test ${gl_cv_header_errno_h_EOVERFLOW+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <errno.h> +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EOVERFLOW=yes +else case e in #( + e) gl_cv_header_errno_h_EOVERFLOW=no ;; +esac +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EOVERFLOW = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EOVERFLOW=hidden +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then + if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include <stdio.h> +#include <stdlib.h> +" +then : + +fi + + fi + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5 +printf "%s\n" "$gl_cv_header_errno_h_EOVERFLOW" >&6; } + case $gl_cv_header_errno_h_EOVERFLOW in + yes | no) + EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE= + ;; + *) + EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW" + ;; + esac + + + fi + + +ac_fn_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strerror_r" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_STRERROR_R $ac_have_decl" >>confdefs.h + + +if test $ac_cv_have_decl_strerror_r = yes; then + # For backward compatibility's sake, define HAVE_STRERROR_R. + # (We used to run AC_CHECK_FUNCS_ONCE for strerror_r, as well + # as AC_CHECK_DECLS_ONCE.) + +printf "%s\n" "#define HAVE_STRERROR_R 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 +printf %s "checking whether strerror_r returns char *... " >&6; } +if test ${ac_cv_func_strerror_r_char_p+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + ac_cv_func_strerror_r_char_p=no + if test $ac_cv_have_decl_strerror_r = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> +int +main (void) +{ + + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + char *p = strerror_r (0, buf, sizeof buf); + return !p || x; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_func_strerror_r_char_p=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 +printf "%s\n" "$ac_cv_func_strerror_r_char_p" >&6; } +if test $ac_cv_func_strerror_r_char_p = yes; then + +printf "%s\n" "#define STRERROR_R_CHAR_P 1" >>confdefs.h + +fi + + + XGETTEXT_EXTRA_OPTIONS= + + + + + + GNULIB_FCNTL=0; + GNULIB_NONBLOCKING=0; + GNULIB_OPEN=0; + GNULIB_OPENAT=0; + HAVE_FCNTL=1; + HAVE_OPENAT=1; + REPLACE_FCNTL=0; + REPLACE_OPEN=0; + REPLACE_OPENAT=0; + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5 +printf %s "checking for working fcntl.h... " >&6; } +if test ${gl_cv_header_working_fcntl_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + gl_cv_header_working_fcntl_h=cross-compiling +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/stat.h> + #if HAVE_UNISTD_H + # include <unistd.h> + #else /* on Windows with MSVC */ + # include <io.h> + # include <stdlib.h> + # defined sleep(n) _sleep ((n) * 1000) + #endif + #include <fcntl.h> + #ifndef O_NOATIME + #define O_NOATIME 0 + #endif + #ifndef O_NOFOLLOW + #define O_NOFOLLOW 0 + #endif + static int const constants[] = + { + O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, + O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY + }; + +int +main (void) +{ + + int result = !constants; + #if HAVE_SYMLINK + { + static char const sym[] = "conftest.sym"; + if (symlink ("/dev/null", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + if (unlink (sym) != 0 || symlink (".", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_RDONLY | O_NOFOLLOW); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + unlink (sym); + } + #endif + { + static char const file[] = "confdefs.h"; + int fd = open (file, O_RDONLY | O_NOATIME); + if (fd < 0) + result |= 8; + else + { + struct stat st0; + if (fstat (fd, &st0) != 0) + result |= 16; + else + { + char c; + sleep (1); + if (read (fd, &c, 1) != 1) + result |= 24; + else + { + if (close (fd) != 0) + result |= 32; + else + { + struct stat st1; + if (stat (file, &st1) != 0) + result |= 40; + else + if (st0.st_atime != st1.st_atime) + result |= 64; + } + } + } + } + } + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_header_working_fcntl_h=yes +else case e in #( + e) case $? in #( + 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( + 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( + 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( + *) gl_cv_header_working_fcntl_h='no';; + esac ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5 +printf "%s\n" "$gl_cv_header_working_fcntl_h" >&6; } + + case $gl_cv_header_working_fcntl_h in #( + *O_NOATIME* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + +printf "%s\n" "#define HAVE_WORKING_O_NOATIME $ac_val" >>confdefs.h + + + case $gl_cv_header_working_fcntl_h in #( + *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + +printf "%s\n" "#define HAVE_WORKING_O_NOFOLLOW $ac_val" >>confdefs.h + + + + ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default +" +if test "x$ac_cv_type_pid_t" = xyes +then : + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_pid_type='int' +else case e in #( + e) ac_pid_type='__int64' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h + + ;; +esac +fi + + +ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = xyes +then : + +else case e in #( + e) +printf "%s\n" "#define mode_t int" >>confdefs.h + ;; +esac +fi + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 +printf %s "checking for mbstate_t... " >&6; } +if test ${ac_cv_type_mbstate_t+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int +main (void) +{ +mbstate_t x; return sizeof x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_type_mbstate_t=yes +else case e in #( + e) ac_cv_type_mbstate_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5 +printf "%s\n" "$ac_cv_type_mbstate_t" >&6; } + if test $ac_cv_type_mbstate_t = yes; then + +printf "%s\n" "#define HAVE_MBSTATE_T 1" >>confdefs.h + + else + +printf "%s\n" "#define mbstate_t int" >>confdefs.h + + fi + + + + + + + + + + GNULIB_DPRINTF=0; + GNULIB_FCLOSE=0; + GNULIB_FDOPEN=0; + GNULIB_FFLUSH=0; + GNULIB_FGETC=0; + GNULIB_FGETS=0; + GNULIB_FOPEN=0; + GNULIB_FPRINTF=0; + GNULIB_FPRINTF_POSIX=0; + GNULIB_FPURGE=0; + GNULIB_FPUTC=0; + GNULIB_FPUTS=0; + GNULIB_FREAD=0; + GNULIB_FREOPEN=0; + GNULIB_FSCANF=0; + GNULIB_FSEEK=0; + GNULIB_FSEEKO=0; + GNULIB_FTELL=0; + GNULIB_FTELLO=0; + GNULIB_FWRITE=0; + GNULIB_GETC=0; + GNULIB_GETCHAR=0; + GNULIB_GETDELIM=0; + GNULIB_GETLINE=0; + GNULIB_OBSTACK_PRINTF=0; + GNULIB_OBSTACK_PRINTF_POSIX=0; + GNULIB_PCLOSE=0; + GNULIB_PERROR=0; + GNULIB_POPEN=0; + GNULIB_PRINTF=0; + GNULIB_PRINTF_POSIX=0; + GNULIB_PUTC=0; + GNULIB_PUTCHAR=0; + GNULIB_PUTS=0; + GNULIB_REMOVE=0; + GNULIB_RENAME=0; + GNULIB_RENAMEAT=0; + GNULIB_SCANF=0; + GNULIB_SNPRINTF=0; + GNULIB_SPRINTF_POSIX=0; + GNULIB_STDIO_H_NONBLOCKING=0; + GNULIB_STDIO_H_SIGPIPE=0; + GNULIB_TMPFILE=0; + GNULIB_VASPRINTF=0; + GNULIB_VFSCANF=0; + GNULIB_VSCANF=0; + GNULIB_VDPRINTF=0; + GNULIB_VFPRINTF=0; + GNULIB_VFPRINTF_POSIX=0; + GNULIB_VPRINTF=0; + GNULIB_VPRINTF_POSIX=0; + GNULIB_VSNPRINTF=0; + GNULIB_VSPRINTF_POSIX=0; + HAVE_DECL_FPURGE=1; + HAVE_DECL_FSEEKO=1; + HAVE_DECL_FTELLO=1; + HAVE_DECL_GETDELIM=1; + HAVE_DECL_GETLINE=1; + HAVE_DECL_OBSTACK_PRINTF=1; + HAVE_DECL_SNPRINTF=1; + HAVE_DECL_VSNPRINTF=1; + HAVE_DPRINTF=1; + HAVE_FSEEKO=1; + HAVE_FTELLO=1; + HAVE_PCLOSE=1; + HAVE_POPEN=1; + HAVE_RENAMEAT=1; + HAVE_VASPRINTF=1; + HAVE_VDPRINTF=1; + REPLACE_DPRINTF=0; + REPLACE_FCLOSE=0; + REPLACE_FDOPEN=0; + REPLACE_FFLUSH=0; + REPLACE_FOPEN=0; + REPLACE_FPRINTF=0; + REPLACE_FPURGE=0; + REPLACE_FREOPEN=0; + REPLACE_FSEEK=0; + REPLACE_FSEEKO=0; + REPLACE_FTELL=0; + REPLACE_FTELLO=0; + REPLACE_GETDELIM=0; + REPLACE_GETLINE=0; + REPLACE_OBSTACK_PRINTF=0; + REPLACE_PERROR=0; + REPLACE_POPEN=0; + REPLACE_PRINTF=0; + REPLACE_REMOVE=0; + REPLACE_RENAME=0; + REPLACE_RENAMEAT=0; + REPLACE_SNPRINTF=0; + REPLACE_SPRINTF=0; + REPLACE_STDIO_READ_FUNCS=0; + REPLACE_STDIO_WRITE_FUNCS=0; + REPLACE_TMPFILE=0; + REPLACE_VASPRINTF=0; + REPLACE_VDPRINTF=0; + REPLACE_VFPRINTF=0; + REPLACE_VPRINTF=0; + REPLACE_VSNPRINTF=0; + REPLACE_VSPRINTF=0; + + + GNULIB_FCHMODAT=0; + GNULIB_FSTAT=0; + GNULIB_FSTATAT=0; + GNULIB_FUTIMENS=0; + GNULIB_LCHMOD=0; + GNULIB_LSTAT=0; + GNULIB_MKDIRAT=0; + GNULIB_MKFIFO=0; + GNULIB_MKFIFOAT=0; + GNULIB_MKNOD=0; + GNULIB_MKNODAT=0; + GNULIB_STAT=0; + GNULIB_UTIMENSAT=0; + GNULIB_OVERRIDES_STRUCT_STAT=0; + HAVE_FCHMODAT=1; + HAVE_FSTATAT=1; + HAVE_FUTIMENS=1; + HAVE_LCHMOD=1; + HAVE_LSTAT=1; + HAVE_MKDIRAT=1; + HAVE_MKFIFO=1; + HAVE_MKFIFOAT=1; + HAVE_MKNOD=1; + HAVE_MKNODAT=1; + HAVE_UTIMENSAT=1; + REPLACE_FSTAT=0; + REPLACE_FSTATAT=0; + REPLACE_FUTIMENS=0; + REPLACE_LSTAT=0; + REPLACE_MKDIR=0; + REPLACE_MKFIFO=0; + REPLACE_MKNOD=0; + REPLACE_STAT=0; + REPLACE_UTIMENSAT=0; + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5 +printf %s "checking whether stat file-mode macros are broken... " >&6; } +if test ${ac_cv_header_stat_broken+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <sys/stat.h> + +#if defined S_ISBLK && defined S_IFDIR +extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; +#endif + +#if defined S_ISBLK && defined S_IFCHR +extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; +#endif + +#if defined S_ISLNK && defined S_IFREG +extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; +#endif + +#if defined S_ISSOCK && defined S_IFREG +extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_header_stat_broken=no +else case e in #( + e) ac_cv_header_stat_broken=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 +printf "%s\n" "$ac_cv_header_stat_broken" >&6; } +if test $ac_cv_header_stat_broken = yes; then + +printf "%s\n" "#define STAT_MACROS_BROKEN 1" >>confdefs.h + +fi + + + + case "$host_os" in + mingw*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5 +printf %s "checking for 64-bit off_t... " >&6; } +if test ${gl_cv_type_off_t_64+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_off_t_64=yes +else case e in #( + e) gl_cv_type_off_t_64=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5 +printf "%s\n" "$gl_cv_type_off_t_64" >&6; } + if test $gl_cv_type_off_t_64 = no; then + WINDOWS_64_BIT_OFF_T=1 + else + WINDOWS_64_BIT_OFF_T=0 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5 +printf %s "checking for 64-bit st_size... " >&6; } +if test ${gl_cv_member_st_size_64+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + struct stat buf; + int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_member_st_size_64=yes +else case e in #( + e) gl_cv_member_st_size_64=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5 +printf "%s\n" "$gl_cv_member_st_size_64" >&6; } + if test $gl_cv_member_st_size_64 = no; then + WINDOWS_64_BIT_ST_SIZE=1 + else + WINDOWS_64_BIT_ST_SIZE=0 + fi + ;; + *) + WINDOWS_64_BIT_OFF_T=0 + WINDOWS_64_BIT_ST_SIZE=0 + ;; + esac + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5 +printf %s "checking absolute name of <sys/stat.h>... " >&6; } +if test ${gl_cv_next_sys_stat_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_sys_stat_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/stat.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_stat_h + gl_cv_next_sys_stat_h='"'$gl_header'"' + else + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 +printf "%s\n" "$gl_cv_next_sys_stat_h" >&6; } + fi + NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/stat.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_stat_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive + + + + + + + + + WINDOWS_STAT_TIMESPEC=0 + + + + + + + + + ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_type_nlink_t" = xyes +then : + +else case e in #( + e) +printf "%s\n" "#define nlink_t int" >>confdefs.h + ;; +esac +fi + + + + for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + +ac_fn_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getdtablesize" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_GETDTABLESIZE $ac_have_decl" >>confdefs.h + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_getopt_h='<'getopt.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <getopt.h>" >&5 +printf %s "checking absolute name of <getopt.h>... " >&6; } +if test ${gl_cv_next_getopt_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_getopt_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <getopt.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'getopt.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_getopt_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_getopt_h + gl_cv_next_getopt_h='"'$gl_header'"' + else + gl_cv_next_getopt_h='<'getopt.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_getopt_h" >&5 +printf "%s\n" "$gl_cv_next_getopt_h" >&6; } + fi + NEXT_GETOPT_H=$gl_cv_next_getopt_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'getopt.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_getopt_h + fi + NEXT_AS_FIRST_DIRECTIVE_GETOPT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_getopt_h = yes; then + HAVE_GETOPT_H=1 + else + HAVE_GETOPT_H=0 + fi + + + gl_replace_getopt= + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + for ac_header in getopt.h +do : + ac_fn_c_check_header_compile "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" +if test "x$ac_cv_header_getopt_h" = xyes +then : + printf "%s\n" "#define HAVE_GETOPT_H 1" >>confdefs.h + +else case e in #( + e) gl_replace_getopt=yes ;; +esac +fi + +done + fi + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + + for ac_func in getopt_long_only +do : + ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only" +if test "x$ac_cv_func_getopt_long_only" = xyes +then : + printf "%s\n" "#define HAVE_GETOPT_LONG_ONLY 1" >>confdefs.h + +else case e in #( + e) gl_replace_getopt=yes ;; +esac +fi + +done + fi + + if test -z "$gl_replace_getopt"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getopt is POSIX compatible" >&5 +printf %s "checking whether getopt is POSIX compatible... " >&6; } +if test ${gl_cv_func_getopt_posix+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $cross_compiling = no; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <unistd.h> +#include <stdlib.h> +#include <string.h> + +int +main () +{ + static char program[] = "program"; + static char a[] = "-a"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, a, foo, bar, NULL }; + int c; + + c = getopt (4, argv, "ab"); + if (!(c == 'a')) + return 1; + c = getopt (4, argv, "ab"); + if (!(c == -1)) + return 2; + if (!(optind == 2)) + return 3; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_posix=maybe +else case e in #( + e) gl_cv_func_getopt_posix=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + if test $gl_cv_func_getopt_posix = maybe; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <unistd.h> +#include <stdlib.h> +#include <string.h> + +int +main () +{ + static char program[] = "program"; + static char donald[] = "donald"; + static char p[] = "-p"; + static char billy[] = "billy"; + static char duck[] = "duck"; + static char a[] = "-a"; + static char bar[] = "bar"; + char *argv[] = { program, donald, p, billy, duck, a, bar, NULL }; + int c; + + c = getopt (7, argv, "+abp:q:"); + if (!(c == -1)) + return 4; + if (!(strcmp (argv[0], "program") == 0)) + return 5; + if (!(strcmp (argv[1], "donald") == 0)) + return 6; + if (!(strcmp (argv[2], "-p") == 0)) + return 7; + if (!(strcmp (argv[3], "billy") == 0)) + return 8; + if (!(strcmp (argv[4], "duck") == 0)) + return 9; + if (!(strcmp (argv[5], "-a") == 0)) + return 10; + if (!(strcmp (argv[6], "bar") == 0)) + return 11; + if (!(optind == 1)) + return 12; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_posix=maybe +else case e in #( + e) gl_cv_func_getopt_posix=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + if test $gl_cv_func_getopt_posix = maybe; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <unistd.h> +#include <stdlib.h> +#include <string.h> + +int +main () +{ + static char program[] = "program"; + static char ab[] = "-ab"; + char *argv[3] = { program, ab, NULL }; + if (getopt (2, argv, "ab:") != 'a') + return 13; + if (getopt (2, argv, "ab:") != '?') + return 14; + if (optopt != 'b') + return 15; + if (optind != 2) + return 16; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_posix=yes +else case e in #( + e) gl_cv_func_getopt_posix=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + else + case "$host_os" in + darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";; + *) gl_cv_func_getopt_posix="guessing yes";; + esac + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_posix" >&5 +printf "%s\n" "$gl_cv_func_getopt_posix" >&6; } + case "$gl_cv_func_getopt_posix" in + *no) gl_replace_getopt=yes ;; + esac + fi + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5 +printf %s "checking for working GNU getopt function... " >&6; } +if test ${gl_cv_func_getopt_gnu+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) # Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the + # optstring is necessary for programs like m4 that have POSIX-mandated + # semantics for supporting options interspersed with files. + # Also, since getopt_long is a GNU extension, we require optind=0. + # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT; + # so take care to revert to the correct (non-)export state. + gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }' + case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in + xx) gl_had_POSIXLY_CORRECT=exported ;; + x) gl_had_POSIXLY_CORRECT=yes ;; + *) gl_had_POSIXLY_CORRECT= ;; + esac + POSIXLY_CORRECT=1 + export POSIXLY_CORRECT + if test "$cross_compiling" = yes +then : + gl_cv_func_getopt_gnu="guessing no" + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <getopt.h> + #include <stddef.h> + #include <string.h> + +#include <stdlib.h> +#if defined __MACH__ && defined __APPLE__ +/* Avoid a crash on Mac OS X. */ +#include <mach/mach.h> +#include <mach/mach_error.h> +#include <mach/thread_status.h> +#include <mach/exception.h> +#include <mach/task.h> +#include <pthread.h> +/* The exception port on which our thread listens. */ +static mach_port_t our_exception_port; +/* The main function of the thread listening for exceptions of type + EXC_BAD_ACCESS. */ +static void * +mach_exception_thread (void *arg) +{ + /* Buffer for a message to be received. */ + struct { + mach_msg_header_t head; + mach_msg_body_t msgh_body; + char data[1024]; + } msg; + mach_msg_return_t retval; + /* Wait for a message on the exception port. */ + retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), + our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + if (retval != MACH_MSG_SUCCESS) + abort (); + exit (1); +} +static void +nocrash_init (void) +{ + mach_port_t self = mach_task_self (); + /* Allocate a port on which the thread shall listen for exceptions. */ + if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) + == KERN_SUCCESS) { + /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ + if (mach_port_insert_right (self, our_exception_port, our_exception_port, + MACH_MSG_TYPE_MAKE_SEND) + == KERN_SUCCESS) { + /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting + for us. */ + exception_mask_t mask = EXC_MASK_BAD_ACCESS; + /* Create the thread listening on the exception port. */ + pthread_attr_t attr; + pthread_t thread; + if (pthread_attr_init (&attr) == 0 + && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 + && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { + pthread_attr_destroy (&attr); + /* Replace the exception port info for these exceptions with our own. + Note that we replace the exception port for the entire task, not only + for a particular thread. This has the effect that when our exception + port gets the message, the thread specific exception port has already + been asked, and we don't need to bother about it. + See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ + task_set_exception_ports (self, mask, our_exception_port, + EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); + } + } + } +} +#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Avoid a crash on native Windows. */ +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <winerror.h> +static LONG WINAPI +exception_filter (EXCEPTION_POINTERS *ExceptionInfo) +{ + switch (ExceptionInfo->ExceptionRecord->ExceptionCode) + { + case EXCEPTION_ACCESS_VIOLATION: + case EXCEPTION_IN_PAGE_ERROR: + case EXCEPTION_STACK_OVERFLOW: + case EXCEPTION_GUARD_PAGE: + case EXCEPTION_PRIV_INSTRUCTION: + case EXCEPTION_ILLEGAL_INSTRUCTION: + case EXCEPTION_DATATYPE_MISALIGNMENT: + case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: + case EXCEPTION_NONCONTINUABLE_EXCEPTION: + exit (1); + } + return EXCEPTION_CONTINUE_SEARCH; +} +static void +nocrash_init (void) +{ + SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter); +} +#else +/* Avoid a crash on POSIX systems. */ +#include <signal.h> +#include <unistd.h> +/* A POSIX signal handler. */ +static void +exception_handler (int sig) +{ + _exit (1); +} +static void +nocrash_init (void) +{ +#ifdef SIGSEGV + signal (SIGSEGV, exception_handler); +#endif +#ifdef SIGBUS + signal (SIGBUS, exception_handler); +#endif +} +#endif + + +int +main (void) +{ + + int result = 0; + + nocrash_init(); + + /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw, + and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5, + OSF/1 5.1, Solaris 10. */ + { + static char conftest[] = "conftest"; + static char plus[] = "-+"; + char *argv[3] = { conftest, plus, NULL }; + opterr = 0; + if (getopt (2, argv, "+a") != '?') + result |= 1; + } + /* This code succeeds on glibc 2.8, mingw, + and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11, + IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */ + { + static char program[] = "program"; + static char p[] = "-p"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, p, foo, bar, NULL }; + + optind = 1; + if (getopt (4, argv, "p::") != 'p') + result |= 2; + else if (optarg != NULL) + result |= 4; + else if (getopt (4, argv, "p::") != -1) + result |= 6; + else if (optind != 2) + result |= 8; + } + /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */ + { + static char program[] = "program"; + static char foo[] = "foo"; + static char p[] = "-p"; + char *argv[] = { program, foo, p, NULL }; + optind = 0; + if (getopt (3, argv, "-p") != 1) + result |= 16; + else if (getopt (3, argv, "-p") != 'p') + result |= 16; + } + /* This code fails on glibc 2.11. */ + { + static char program[] = "program"; + static char b[] = "-b"; + static char a[] = "-a"; + char *argv[] = { program, b, a, NULL }; + optind = opterr = 0; + if (getopt (3, argv, "+:a:b") != 'b') + result |= 32; + else if (getopt (3, argv, "+:a:b") != ':') + result |= 32; + } + /* This code dumps core on glibc 2.14. */ + { + static char program[] = "program"; + static char w[] = "-W"; + static char dummy[] = "dummy"; + char *argv[] = { program, w, dummy, NULL }; + optind = opterr = 1; + if (getopt (3, argv, "W;") != 'W') + result |= 64; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_gnu=yes +else case e in #( + e) gl_cv_func_getopt_gnu=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + case $gl_had_POSIXLY_CORRECT in + exported) ;; + yes) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;}; POSIXLY_CORRECT=1 ;; + *) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;} ;; + esac + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5 +printf "%s\n" "$gl_cv_func_getopt_gnu" >&6; } + if test "$gl_cv_func_getopt_gnu" != yes; then + gl_replace_getopt=yes + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt_long function" >&5 +printf %s "checking for working GNU getopt_long function... " >&6; } +if test ${gl_cv_func_getopt_long_gnu+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + openbsd*) gl_cv_func_getopt_long_gnu="guessing no";; + *) gl_cv_func_getopt_long_gnu="guessing yes";; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <getopt.h> + #include <stddef.h> + #include <string.h> + +int +main (void) +{ +static const struct option long_options[] = + { + { "xtremely-",no_argument, NULL, 1003 }, + { "xtra", no_argument, NULL, 1001 }, + { "xtreme", no_argument, NULL, 1002 }, + { "xtremely", no_argument, NULL, 1003 }, + { NULL, 0, NULL, 0 } + }; + /* This code fails on OpenBSD 5.0. */ + { + static char program[] = "program"; + static char xtremel[] = "--xtremel"; + char *argv[] = { program, xtremel, NULL }; + int option_index; + optind = 1; opterr = 0; + if (getopt_long (2, argv, "", long_options, &option_index) != 1003) + return 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_long_gnu=yes +else case e in #( + e) gl_cv_func_getopt_long_gnu=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_long_gnu" >&5 +printf "%s\n" "$gl_cv_func_getopt_long_gnu" >&6; } + case "$gl_cv_func_getopt_long_gnu" in + *yes) ;; + *) gl_replace_getopt=yes ;; + esac + fi + fi + + + + +: + + + + GNULIB_GETTIMEOFDAY=0; + HAVE_GETTIMEOFDAY=1; + HAVE_STRUCT_TIMEVAL=1; + HAVE_SYS_TIME_H=1; + REPLACE_GETTIMEOFDAY=0; + REPLACE_STRUCT_TIMEVAL=0; + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 +printf %s "checking for C/C++ restrict keyword... " >&6; } +if test ${ac_cv_c_restrict+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_c_restrict=no + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +typedef int *int_ptr; + int foo (int_ptr $ac_kw ip) { return ip[0]; } + int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ + int bar (int ip[$ac_kw]) { return ip[0]; } + +int +main (void) +{ +int s[1]; + int *$ac_kw t = s; + t[0] = 0; + return foo (t) + bar (t); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_restrict=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$ac_cv_c_restrict" != no && break + done + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 +printf "%s\n" "$ac_cv_c_restrict" >&6; } + + case $ac_cv_c_restrict in + restrict) ;; + no) printf "%s\n" "#define restrict /**/" >>confdefs.h + ;; + *) printf "%s\n" "#define restrict $ac_cv_c_restrict" >>confdefs.h + ;; + esac + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_time_h='<'sys/time.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5 +printf %s "checking absolute name of <sys/time.h>... " >&6; } +if test ${gl_cv_next_sys_time_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_sys_time_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/time.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/time.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_time_h + gl_cv_next_sys_time_h='"'$gl_header'"' + else + gl_cv_next_sys_time_h='<'sys/time.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5 +printf "%s\n" "$gl_cv_next_sys_time_h" >&6; } + fi + NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/time.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_time_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive + + + + + + if test $ac_cv_header_sys_time_h != yes; then + HAVE_SYS_TIME_H=0 + fi + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5 +printf %s "checking for struct timeval... " >&6; } +if test ${gl_cv_sys_struct_timeval+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_SYS_TIME_H + #include <sys/time.h> + #endif + #include <time.h> + #if HAVE_WINSOCK2_H + # include <winsock2.h> + #endif + +int +main (void) +{ +static struct timeval x; x.tv_sec = x.tv_usec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timeval=yes +else case e in #( + e) gl_cv_sys_struct_timeval=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5 +printf "%s\n" "$gl_cv_sys_struct_timeval" >&6; } + if test $gl_cv_sys_struct_timeval != yes; then + HAVE_STRUCT_TIMEVAL=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5 +printf %s "checking for wide-enough struct timeval.tv_sec member... " >&6; } +if test ${gl_cv_sys_struct_timeval_tv_sec+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_SYS_TIME_H + #include <sys/time.h> + #endif + #include <time.h> + #if HAVE_WINSOCK2_H + # include <winsock2.h> + #endif + +int +main (void) +{ +static struct timeval x; + typedef int verify_tv_sec_type[ + sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1 + ]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timeval_tv_sec=yes +else case e in #( + e) gl_cv_sys_struct_timeval_tv_sec=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5 +printf "%s\n" "$gl_cv_sys_struct_timeval_tv_sec" >&6; } + if test $gl_cv_sys_struct_timeval_tv_sec != yes; then + REPLACE_STRUCT_TIMEVAL=1 + fi + fi + + + for gl_func in gettimeofday; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +#include <time.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + NEED_LOCALTIME_BUFFER=0 + + + GNULIB_CTIME=0; + GNULIB_MKTIME=0; + GNULIB_LOCALTIME=0; + GNULIB_NANOSLEEP=0; + GNULIB_STRFTIME=0; + GNULIB_STRPTIME=0; + GNULIB_TIMEGM=0; + GNULIB_TIME_R=0; + GNULIB_TIME_RZ=0; + GNULIB_TZSET=0; + HAVE_DECL_LOCALTIME_R=1; + HAVE_NANOSLEEP=1; + HAVE_STRPTIME=1; + HAVE_TIMEGM=1; + HAVE_TZSET=1; + HAVE_TIMEZONE_T=0; + REPLACE_CTIME=GNULIB_PORTCHECK; + REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; + REPLACE_MKTIME=GNULIB_PORTCHECK; + REPLACE_NANOSLEEP=GNULIB_PORTCHECK; + REPLACE_STRFTIME=GNULIB_PORTCHECK; + REPLACE_TIMEGM=GNULIB_PORTCHECK; + REPLACE_TZSET=GNULIB_PORTCHECK; + + : ${GNULIB_GETTIMEOFDAY=0}; + REPLACE_GMTIME=0; + REPLACE_LOCALTIME=0; + + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libiconv-prefix was given. +if test ${with_libiconv_prefix+y} +then : + withval=$with_libiconv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBICONV= + LTLIBICONV= + INCICONV= + LIBICONV_PREFIX= + HAVE_LIBICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + + + + + + + GNULIB_ICONV=0; + ICONV_CONST=; + REPLACE_ICONV=0; + REPLACE_ICONV_OPEN=0; + REPLACE_ICONV_UTF=0; + ICONV_H=''; + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + + + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +printf %s "checking for iconv... " >&6; } +if test ${am_cv_func_iconv+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdlib.h> +#include <iconv.h> + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdlib.h> +#include <iconv.h> + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +printf "%s\n" "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +printf %s "checking for working iconv... " >&6; } +if test ${am_cv_func_iconv_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + if test "$cross_compiling" = yes +then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <iconv.h> +#include <string.h> + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + +int +main (void) +{ +int result = 0; + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\263"; + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + result |= 8; + iconv_close (cd_88591_to_utf8); + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + result |= 16; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + am_cv_func_iconv_works=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + test "$am_cv_func_iconv_works" = no || break + done + LIBS="$am_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +printf "%s\n" "$am_cv_func_iconv_works" >&6; } + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + +printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +printf %s "checking how to link with libiconv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +printf "%s\n" "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 +printf %s "checking for iconv declaration... " >&6; } + if test ${am_cv_proto_iconv+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdlib.h> +#include <iconv.h> +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + am_cv_proto_iconv_arg1="" +else case e in #( + e) am_cv_proto_iconv_arg1="const" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" ;; +esac +fi + + am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: + $am_cv_proto_iconv" >&5 +printf "%s\n" " + $am_cv_proto_iconv" >&6; } + else + am_cv_proto_iconv_arg1="" + fi + +printf "%s\n" "#define ICONV_CONST $am_cv_proto_iconv_arg1" >>confdefs.h + + + if test -n "$am_cv_proto_iconv_arg1"; then + ICONV_CONST="const" + fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo (void) {return 0; } +$ac_kw foo_t foo (void) {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes +then : + +else case e in #( + e) +printf "%s\n" "#define off_t long int" >>confdefs.h + ;; +esac +fi + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_limits_h='<'limits.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <limits.h>" >&5 +printf %s "checking absolute name of <limits.h>... " >&6; } +if test ${gl_cv_next_limits_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_limits_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'limits.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_limits_h + gl_cv_next_limits_h='"'$gl_header'"' + else + gl_cv_next_limits_h='<'limits.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5 +printf "%s\n" "$gl_cv_next_limits_h" >&6; } + fi + NEXT_LIMITS_H=$gl_cv_next_limits_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'limits.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_limits_h + fi + NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether limits.h has ULLONG_WIDTH etc." >&5 +printf %s "checking whether limits.h has ULLONG_WIDTH etc.... " >&6; } +if test ${gl_cv_header_limits_width+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include <limits.h> + int ullw = ULLONG_WIDTH; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_limits_width=yes +else case e in #( + e) gl_cv_header_limits_width=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5 +printf "%s\n" "$gl_cv_header_limits_width" >&6; } + if test "$gl_cv_header_limits_width" = yes; then + LIMITS_H= + else + LIMITS_H=limits.h + fi + + if test -n "$LIMITS_H"; then + GL_GENERATE_LIMITS_H_TRUE= + GL_GENERATE_LIMITS_H_FALSE='#' +else + GL_GENERATE_LIMITS_H_TRUE='#' + GL_GENERATE_LIMITS_H_FALSE= +fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 +printf %s "checking for wint_t... " >&6; } +if test ${gt_cv_c_wint_t+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + wint_t foo = (wchar_t)'\0'; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_c_wint_t=yes +else case e in #( + e) gt_cv_c_wint_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 +printf "%s\n" "$gt_cv_c_wint_t" >&6; } + if test $gt_cv_c_wint_t = yes; then + +printf "%s\n" "#define HAVE_WINT_T 1" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wint_t is too small" >&5 +printf %s "checking whether wint_t is too small... " >&6; } +if test ${gl_cv_type_wint_t_too_small+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <stddef.h> +# include <stdio.h> +# include <time.h> +#endif +#include <wchar.h> + int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wint_t_too_small=no +else case e in #( + e) gl_cv_type_wint_t_too_small=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_too_small" >&5 +printf "%s\n" "$gl_cv_type_wint_t_too_small" >&6; } + if test $gl_cv_type_wint_t_too_small = yes; then + GNULIB_OVERRIDES_WINT_T=1 + else + GNULIB_OVERRIDES_WINT_T=0 + fi + else + GNULIB_OVERRIDES_WINT_T=0 + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 +printf %s "checking for unsigned long long int... " >&6; } +if test ${ac_cv_type_unsigned_long_long_int+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_type_unsigned_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; +int +main (void) +{ +/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in #( + e) ac_cv_type_unsigned_long_long_int=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; } + if test $ac_cv_type_unsigned_long_long_int = yes; then + +printf "%s\n" "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h + + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 +printf %s "checking for long long int... " >&6; } +if test ${ac_cv_type_long_long_int+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_type_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_long_long_int = yes; then + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + #ifndef LLONG_MAX + # define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + # define LLONG_MAX (HALF - 1 + HALF) + #endif +int +main (void) +{ +long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + +else case e in #( + e) ac_cv_type_long_long_int=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_long_long_int" >&6; } + if test $ac_cv_type_long_long_int = yes; then + +printf "%s\n" "#define HAVE_LONG_LONG_INT 1" >>confdefs.h + + fi + + + + gl_cv_c_multiarch=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + arch= + prev= + for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do + if test -n "$prev"; then + case $word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$arch" || test "$arch" = "$word"; then + arch="$word" + else + gl_cv_c_multiarch=yes + fi + ;; + esac + prev= + else + if test "x$word" = "x-arch"; then + prev=arch + fi + fi + done + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $gl_cv_c_multiarch = yes; then + APPLE_UNIVERSAL_BUILD=1 + else + APPLE_UNIVERSAL_BUILD=0 + fi + + + + + + + + + if test $ac_cv_type_long_long_int = yes; then + HAVE_LONG_LONG_INT=1 + else + HAVE_LONG_LONG_INT=0 + fi + + + if test $ac_cv_type_unsigned_long_long_int = yes; then + HAVE_UNSIGNED_LONG_LONG_INT=1 + else + HAVE_UNSIGNED_LONG_LONG_INT=0 + fi + + + + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + + + if test $ac_cv_header_inttypes_h = yes; then + HAVE_INTTYPES_H=1 + else + HAVE_INTTYPES_H=0 + fi + + + if test $ac_cv_header_sys_types_h = yes; then + HAVE_SYS_TYPES_H=1 + else + HAVE_SYS_TYPES_H=0 + fi + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdint_h='<'stdint.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5 +printf %s "checking absolute name of <stdint.h>... " >&6; } +if test ${gl_cv_next_stdint_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_stdint_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdint.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdint.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdint_h + gl_cv_next_stdint_h='"'$gl_header'"' + else + gl_cv_next_stdint_h='<'stdint.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5 +printf "%s\n" "$gl_cv_next_stdint_h" >&6; } + fi + NEXT_STDINT_H=$gl_cv_next_stdint_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdint.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdint_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_stdint_h = yes; then + HAVE_STDINT_H=1 + else + HAVE_STDINT_H=0 + fi + + + if test $ac_cv_header_stdint_h = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5 +printf %s "checking whether stdint.h conforms to C99... " >&6; } +if test ${gl_cv_header_working_stdint_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) gl_cv_header_working_stdint_h=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 +#include <stdint.h> +/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */ +#if !(defined WCHAR_MIN && defined WCHAR_MAX) +#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>" +#endif + + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + +#ifdef INT8_MAX +int8_t a1 = INT8_MAX; +int8_t a1min = INT8_MIN; +#endif +#ifdef INT16_MAX +int16_t a2 = INT16_MAX; +int16_t a2min = INT16_MIN; +#endif +#ifdef INT32_MAX +int32_t a3 = INT32_MAX; +int32_t a3min = INT32_MIN; +#endif +#ifdef INT64_MAX +int64_t a4 = INT64_MAX; +int64_t a4min = INT64_MIN; +#endif +#ifdef UINT8_MAX +uint8_t b1 = UINT8_MAX; +#else +typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; +#endif +#ifdef UINT16_MAX +uint16_t b2 = UINT16_MAX; +#endif +#ifdef UINT32_MAX +uint32_t b3 = UINT32_MAX; +#endif +#ifdef UINT64_MAX +uint64_t b4 = UINT64_MAX; +#endif +int_least8_t c1 = INT8_C (0x7f); +int_least8_t c1max = INT_LEAST8_MAX; +int_least8_t c1min = INT_LEAST8_MIN; +int_least16_t c2 = INT16_C (0x7fff); +int_least16_t c2max = INT_LEAST16_MAX; +int_least16_t c2min = INT_LEAST16_MIN; +int_least32_t c3 = INT32_C (0x7fffffff); +int_least32_t c3max = INT_LEAST32_MAX; +int_least32_t c3min = INT_LEAST32_MIN; +int_least64_t c4 = INT64_C (0x7fffffffffffffff); +int_least64_t c4max = INT_LEAST64_MAX; +int_least64_t c4min = INT_LEAST64_MIN; +uint_least8_t d1 = UINT8_C (0xff); +uint_least8_t d1max = UINT_LEAST8_MAX; +uint_least16_t d2 = UINT16_C (0xffff); +uint_least16_t d2max = UINT_LEAST16_MAX; +uint_least32_t d3 = UINT32_C (0xffffffff); +uint_least32_t d3max = UINT_LEAST32_MAX; +uint_least64_t d4 = UINT64_C (0xffffffffffffffff); +uint_least64_t d4max = UINT_LEAST64_MAX; +int_fast8_t e1 = INT_FAST8_MAX; +int_fast8_t e1min = INT_FAST8_MIN; +int_fast16_t e2 = INT_FAST16_MAX; +int_fast16_t e2min = INT_FAST16_MIN; +int_fast32_t e3 = INT_FAST32_MAX; +int_fast32_t e3min = INT_FAST32_MIN; +int_fast64_t e4 = INT_FAST64_MAX; +int_fast64_t e4min = INT_FAST64_MIN; +uint_fast8_t f1 = UINT_FAST8_MAX; +uint_fast16_t f2 = UINT_FAST16_MAX; +uint_fast32_t f3 = UINT_FAST32_MAX; +uint_fast64_t f4 = UINT_FAST64_MAX; +#ifdef INTPTR_MAX +intptr_t g = INTPTR_MAX; +intptr_t gmin = INTPTR_MIN; +#endif +#ifdef UINTPTR_MAX +uintptr_t h = UINTPTR_MAX; +#endif +intmax_t i = INTMAX_MAX; +uintmax_t j = UINTMAX_MAX; + +/* Check that SIZE_MAX has the correct type, if possible. */ +#if 201112 <= __STDC_VERSION__ +int k = _Generic (SIZE_MAX, size_t: 0); +#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) +extern size_t k; +extern __typeof__ (SIZE_MAX) k; +#endif + +#include <limits.h> /* for CHAR_BIT */ +#define TYPE_MINIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) +#define TYPE_MAXIMUM(t) \ + ((t) ((t) 0 < (t) -1 \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) +struct s { + int check_PTRDIFF: + PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) + && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) + ? 1 : -1; + /* Detect bug in FreeBSD 6.0 / ia64. */ + int check_SIG_ATOMIC: + SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) + && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) + ? 1 : -1; + int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; + int check_WCHAR: + WCHAR_MIN == TYPE_MINIMUM (wchar_t) + && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) + ? 1 : -1; + /* Detect bug in mingw. */ + int check_WINT: + WINT_MIN == TYPE_MINIMUM (wint_t) + && WINT_MAX == TYPE_MAXIMUM (wint_t) + ? 1 : -1; + + /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ + int check_UINT8_C: + (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; + int check_UINT16_C: + (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; + + /* Detect bugs in OpenBSD 3.9 stdint.h. */ +#ifdef UINT8_MAX + int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; +#endif +#ifdef UINT16_MAX + int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; +#endif +#ifdef UINT32_MAX + int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; +#endif +#ifdef UINT64_MAX + int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; +#endif + int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; + int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; + int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; + int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; + int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; + int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; + int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; + int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; + int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; + int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; + int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; +}; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test "$cross_compiling" = yes +then : + gl_cv_header_working_stdint_h=yes + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 +#include <stdint.h> + + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + +#include <stdio.h> +#include <string.h> +#define MVAL(macro) MVAL1(macro) +#define MVAL1(expression) #expression +static const char *macro_values[] = + { +#ifdef INT8_MAX + MVAL (INT8_MAX), +#endif +#ifdef INT16_MAX + MVAL (INT16_MAX), +#endif +#ifdef INT32_MAX + MVAL (INT32_MAX), +#endif +#ifdef INT64_MAX + MVAL (INT64_MAX), +#endif +#ifdef UINT8_MAX + MVAL (UINT8_MAX), +#endif +#ifdef UINT16_MAX + MVAL (UINT16_MAX), +#endif +#ifdef UINT32_MAX + MVAL (UINT32_MAX), +#endif +#ifdef UINT64_MAX + MVAL (UINT64_MAX), +#endif + NULL + }; + +int +main (void) +{ + + const char **mv; + for (mv = macro_values; *mv != NULL; mv++) + { + const char *value = *mv; + /* Test whether it looks like a cast expression. */ + if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 + || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 + || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 + || strncmp (value, "((int)"/*)*/, 6) == 0 + || strncmp (value, "((signed short)"/*)*/, 15) == 0 + || strncmp (value, "((signed char)"/*)*/, 14) == 0) + return mv - macro_values + 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_header_working_stdint_h=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 +printf "%s\n" "$gl_cv_header_working_stdint_h" >&6; } + fi + + HAVE_C99_STDINT_H=0 + HAVE_SYS_BITYPES_H=0 + HAVE_SYS_INTTYPES_H=0 + STDINT_H=stdint.h + if test "$gl_cv_header_working_stdint_h" = yes; then + HAVE_C99_STDINT_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h predates C++11" >&5 +printf %s "checking whether stdint.h predates C++11... " >&6; } +if test ${gl_cv_header_stdint_predates_cxx11_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) gl_cv_header_stdint_predates_cxx11_h=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include <stdint.h> + + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + +intmax_t im = INTMAX_MAX; +int32_t i32 = INT32_C (0x7fffffff); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_stdint_predates_cxx11_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_predates_cxx11_h" >&5 +printf "%s\n" "$gl_cv_header_stdint_predates_cxx11_h" >&6; } + + if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + +printf "%s\n" "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h + + +printf "%s\n" "#define __STDC_LIMIT_MACROS 1" >>confdefs.h + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5 +printf %s "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; } +if test ${gl_cv_header_stdint_width+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) gl_cv_header_stdint_width=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 + #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include <stdint.h> + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + int iw = UINTMAX_WIDTH; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_stdint_width=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5 +printf "%s\n" "$gl_cv_header_stdint_width" >&6; } + if test "$gl_cv_header_stdint_width" = yes; then + STDINT_H= + fi + else + ac_fn_c_check_header_compile "$LINENO" "sys/inttypes.h" "ac_cv_header_sys_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_inttypes_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_INTTYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/bitypes.h" "ac_cv_header_sys_bitypes_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_bitypes_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_BITYPES_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_sys_inttypes_h = yes; then + HAVE_SYS_INTTYPES_H=1 + fi + if test $ac_cv_header_sys_bitypes_h = yes; then + HAVE_SYS_BITYPES_H=1 + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + + for gltype in ptrdiff_t size_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +printf %s "checking for bit size of $gltype... " >&6; } +if eval test \${gl_cv_bitsizeof_${gltype}+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + +#include <limits.h>" +then : + +else case e in #( + e) result=unknown ;; +esac +fi + + eval gl_cv_bitsizeof_${gltype}=\$result + ;; +esac +fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + printf "%s\n" "#define BITSIZEOF_${GLTYPE} $result" >>confdefs.h + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +printf %s "checking for bit size of $gltype... " >&6; } +if eval test \${gl_cv_bitsizeof_${gltype}+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + +#include <limits.h>" +then : + +else case e in #( + e) result=unknown ;; +esac +fi + + eval gl_cv_bitsizeof_${gltype}=\$result + ;; +esac +fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + printf "%s\n" "#define BITSIZEOF_${GLTYPE} $result" >>confdefs.h + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 +printf %s "checking whether $gltype is signed... " >&6; } +if eval test \${gl_cv_type_${gltype}_signed+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + result=yes +else case e in #( + e) result=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval gl_cv_type_${gltype}_signed=\$result + ;; +esac +fi +eval ac_res=\$gl_cv_type_${gltype}_signed + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval result=\$gl_cv_type_${gltype}_signed + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + if test "$result" = yes; then + printf "%s\n" "#define HAVE_SIGNED_${GLTYPE} 1" >>confdefs.h + + eval HAVE_SIGNED_${GLTYPE}=1 + else + eval HAVE_SIGNED_${GLTYPE}=0 + fi + done + + + gl_cv_type_ptrdiff_t_signed=yes + gl_cv_type_size_t_signed=no + if test $APPLE_UNIVERSAL_BUILD = 0; then + + + for gltype in ptrdiff_t size_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +printf %s "checking for $gltype integer literal suffix... " >&6; } +if eval test \${gl_cv_type_${gltype}_suffix+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + extern $gltype foo; + extern $gltype1 foo; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval gl_cv_type_${gltype}_suffix=\$glsuf +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done ;; +esac +fi +eval ac_res=\$gl_cv_type_${gltype}_suffix + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + printf "%s\n" "#define ${GLTYPE}_SUFFIX $result" >>confdefs.h + + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +printf %s "checking for $gltype integer literal suffix... " >&6; } +if eval test \${gl_cv_type_${gltype}_suffix+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + extern $gltype foo; + extern $gltype1 foo; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval gl_cv_type_${gltype}_suffix=\$glsuf +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done ;; +esac +fi +eval ac_res=\$gl_cv_type_${gltype}_suffix + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + printf "%s\n" "#define ${GLTYPE}_SUFFIX $result" >>confdefs.h + + done + + + + if test $GNULIB_OVERRIDES_WINT_T = 1; then + BITSIZEOF_WINT_T=32 + fi + + fi + + LIMITS_H=limits.h + if test -n "$LIMITS_H"; then + GL_GENERATE_LIMITS_H_TRUE= + GL_GENERATE_LIMITS_H_FALSE='#' +else + GL_GENERATE_LIMITS_H_TRUE='#' + GL_GENERATE_LIMITS_H_FALSE= +fi + + + + + + + if test -n "$STDINT_H"; then + GL_GENERATE_STDINT_H_TRUE= + GL_GENERATE_STDINT_H_FALSE='#' +else + GL_GENERATE_STDINT_H_TRUE='#' + GL_GENERATE_STDINT_H_FALSE= +fi + + + + GNULIB_IMAXABS=0; + GNULIB_IMAXDIV=0; + GNULIB_STRTOIMAX=0; + GNULIB_STRTOUMAX=0; + HAVE_DECL_IMAXABS=1; + HAVE_DECL_IMAXDIV=1; + HAVE_DECL_STRTOIMAX=1; + HAVE_DECL_STRTOUMAX=1; + REPLACE_STRTOIMAX=0; + REPLACE_STRTOUMAX=0; + INT32_MAX_LT_INTMAX_MAX=1; + INT64_MAX_EQ_LONG_MAX='defined _LP64'; + PRI_MACROS_BROKEN=0; + PRIPTR_PREFIX=__PRIPTR_PREFIX; + UINT32_MAX_LT_UINTMAX_MAX=1; + UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_inttypes_h='<'inttypes.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5 +printf %s "checking absolute name of <inttypes.h>... " >&6; } +if test ${gl_cv_next_inttypes_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_inttypes_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <inttypes.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'inttypes.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_inttypes_h + gl_cv_next_inttypes_h='"'$gl_header'"' + else + gl_cv_next_inttypes_h='<'inttypes.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5 +printf "%s\n" "$gl_cv_next_inttypes_h" >&6; } + fi + NEXT_INTTYPES_H=$gl_cv_next_inttypes_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'inttypes.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_inttypes_h + fi + NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive + + + + + + + + + for gl_func in imaxabs imaxdiv strtoimax strtoumax; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <inttypes.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + ac_fn_c_check_header_compile "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_inttypes_h" = xyes +then : + printf "%s\n" "#define HAVE_INTTYPES_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_inttypes_h = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5 +printf %s "checking whether the inttypes.h PRIxNN macros are broken... " >&6; } +if test ${gt_cv_inttypes_pri_broken+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <inttypes.h> +#ifdef PRId32 +char *p = PRId32; +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_inttypes_pri_broken=no +else case e in #( + e) gt_cv_inttypes_pri_broken=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5 +printf "%s\n" "$gt_cv_inttypes_pri_broken" >&6; } + fi + if test "$gt_cv_inttypes_pri_broken" = yes; then + +printf "%s\n" "#define PRI_MACROS_BROKEN 1" >>confdefs.h + + PRI_MACROS_BROKEN=1 + else + PRI_MACROS_BROKEN=0 + fi + + + + GNULIB_ISWBLANK=0; + GNULIB_WCTYPE=0; + GNULIB_ISWCTYPE=0; + GNULIB_WCTRANS=0; + GNULIB_TOWCTRANS=0; + HAVE_ISWBLANK=1; + HAVE_WCTYPE_T=1; + HAVE_WCTRANS_T=1; + REPLACE_ISWBLANK=0; + + + + + + if test $ac_cv_header_crtdefs_h = yes; then + HAVE_CRTDEFS_H=1 + else + HAVE_CRTDEFS_H=0 + fi + + + + + + + + if test $ac_cv_func_iswcntrl = yes; then + HAVE_ISWCNTRL=1 + else + HAVE_ISWCNTRL=0 + fi + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wctype_h='<'wctype.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5 +printf %s "checking absolute name of <wctype.h>... " >&6; } +if test ${gl_cv_next_wctype_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_wctype_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <wctype.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wctype_h + gl_cv_next_wctype_h='"'$gl_header'"' + else + gl_cv_next_wctype_h='<'wctype.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 +printf "%s\n" "$gl_cv_next_wctype_h" >&6; } + fi + NEXT_WCTYPE_H=$gl_cv_next_wctype_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'wctype.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_wctype_h + fi + NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_wctype_h = yes; then + if test $ac_cv_func_iswcntrl = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 +printf %s "checking whether iswcntrl works... " >&6; } +if test ${gl_cv_func_iswcntrl_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test "$cross_compiling" = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + #if __GNU_LIBRARY__ == 1 + Linux libc5 i18n is broken. + #endif +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_iswcntrl_works="guessing yes" +else case e in #( + e) gl_cv_func_iswcntrl_works="guessing no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #include <wctype.h> + int main () { return iswprint ('x') == 0; } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_iswcntrl_works=yes +else case e in #( + e) gl_cv_func_iswcntrl_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 +printf "%s\n" "$gl_cv_func_iswcntrl_works" >&6; } + fi + HAVE_WCTYPE_H=1 + else + HAVE_WCTYPE_H=0 + fi + + + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + fi + + if test $REPLACE_ISWCNTRL = 1; then + REPLACE_TOWLOWER=1 + else + ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" +if test "x$ac_cv_func_towlower" = xyes +then : + printf "%s\n" "#define HAVE_TOWLOWER 1" >>confdefs.h + +fi + + if test $ac_cv_func_towlower = yes; then + REPLACE_TOWLOWER=0 + else + ac_fn_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #if HAVE_WCTYPE_H + # include <wctype.h> + #endif + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_towlower" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_TOWLOWER $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_towlower = yes; then + REPLACE_TOWLOWER=1 + else + REPLACE_TOWLOWER=0 + fi + fi + fi + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then + : + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 +printf %s "checking for wctype_t... " >&6; } +if test ${gl_cv_type_wctype_t+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #if HAVE_WCTYPE_H + # include <wctype.h> + #endif + wctype_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctype_t=yes +else case e in #( + e) gl_cv_type_wctype_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 +printf "%s\n" "$gl_cv_type_wctype_t" >&6; } + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 +printf %s "checking for wctrans_t... " >&6; } +if test ${gl_cv_type_wctrans_t+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #include <wctype.h> + wctrans_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctrans_t=yes +else case e in #( + e) gl_cv_type_wctrans_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 +printf "%s\n" "$gl_cv_type_wctrans_t" >&6; } + if test $gl_cv_type_wctrans_t = no; then + HAVE_WCTRANS_T=0 + fi + + + for gl_func in wctype iswctype wctrans towctrans ; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <stddef.h> +# include <stdio.h> +# include <time.h> +# include <wchar.h> +#endif +#include <wctype.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + GNULIB_NL_LANGINFO=0; + HAVE_NL_LANGINFO=1; + REPLACE_NL_LANGINFO=0; + + +ac_fn_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getc_unlocked" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library >= 2.1 or uClibc" >&5 +printf %s "checking whether we are using the GNU C Library >= 2.1 or uClibc... " >&6; } +if test ${ac_cv_gnu_library_2_1+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <features.h> +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif +#ifdef __UCLIBC__ + Lucky user +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "Lucky" >/dev/null 2>&1 +then : + ac_cv_gnu_library_2_1=yes +else case e in #( + e) ac_cv_gnu_library_2_1=no ;; +esac +fi +rm -rf conftest* + + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5 +printf "%s\n" "$ac_cv_gnu_library_2_1" >&6; } + + GLIBC21="$ac_cv_gnu_library_2_1" + + + + GNULIB_LOCALECONV=0; + GNULIB_SETLOCALE=0; + GNULIB_DUPLOCALE=0; + HAVE_DUPLOCALE=1; + REPLACE_LOCALECONV=0; + REPLACE_SETLOCALE=0; + REPLACE_DUPLOCALE=0; + REPLACE_STRUCT_LCONV=0; + + + REPLACE_NULL=0; + HAVE_MAX_ALIGN_T=1; + HAVE_WCHAR_T=1; + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 +printf %s "checking for wchar_t... " >&6; } +if test ${gt_cv_c_wchar_t+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> + wchar_t foo = (wchar_t)'\0'; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_c_wchar_t=yes +else case e in #( + e) gt_cv_c_wchar_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 +printf "%s\n" "$gt_cv_c_wchar_t" >&6; } + if test $gt_cv_c_wchar_t = yes; then + +printf "%s\n" "#define HAVE_WCHAR_T 1" >>confdefs.h + + fi + + + + + STDDEF_H= + ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include <stddef.h> + +" +if test "x$ac_cv_type_max_align_t" = xyes +then : + +else case e in #( + e) HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h ;; +esac +fi + + if test $gt_cv_c_wchar_t = no; then + HAVE_WCHAR_T=0 + STDDEF_H=stddef.h + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 +printf %s "checking whether NULL can be used in arbitrary expressions... " >&6; } +if test ${gl_cv_decl_null_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> + int test[2 * (sizeof NULL == sizeof (void *)) -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_null_works=yes +else case e in #( + e) gl_cv_decl_null_works=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 +printf "%s\n" "$gl_cv_decl_null_works" >&6; } + if test $gl_cv_decl_null_works = no; then + REPLACE_NULL=1 + STDDEF_H=stddef.h + fi + + if test -n "$STDDEF_H"; then + GL_GENERATE_STDDEF_H_TRUE= + GL_GENERATE_STDDEF_H_FALSE='#' +else + GL_GENERATE_STDDEF_H_TRUE='#' + GL_GENERATE_STDDEF_H_FALSE= +fi + + if test -n "$STDDEF_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stddef_h='<'stddef.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5 +printf %s "checking absolute name of <stddef.h>... " >&6; } +if test ${gl_cv_next_stddef_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stddef.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stddef_h + gl_cv_next_stddef_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 +printf "%s\n" "$gl_cv_next_stddef_h" >&6; } + fi + NEXT_STDDEF_H=$gl_cv_next_stddef_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stddef.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stddef_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive + + + + + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 +printf %s "checking whether lstat correctly handles trailing slash... " >&6; } +if test ${gl_cv_func_lstat_dereferences_slashed_symlink+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) rm -f conftest.sym conftest.file + echo >conftest.file + if test "$cross_compiling" = yes +then : + case "$host_os" in + *-gnu*) + # Guess yes on glibc systems. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; + *) + # If we don't know, assume the worst. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ +struct stat sbuf; + if (symlink ("conftest.file", "conftest.sym") != 0) + return 1; + /* Linux will dereference the symlink and fail, as required by + POSIX. That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_lstat_dereferences_slashed_symlink=yes +else case e in #( + e) gl_cv_func_lstat_dereferences_slashed_symlink=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.sym conftest.file + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5 +printf "%s\n" "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; } + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *yes) + +printf "%s\n" "#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1" >>confdefs.h + + ;; + esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in #( +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + + + GNULIB__EXIT=0; + GNULIB_ATOLL=0; + GNULIB_CALLOC_POSIX=0; + GNULIB_CANONICALIZE_FILE_NAME=0; + GNULIB_GETLOADAVG=0; + GNULIB_GETSUBOPT=0; + GNULIB_GRANTPT=0; + GNULIB_MALLOC_POSIX=0; + GNULIB_MBTOWC=0; + GNULIB_MKDTEMP=0; + GNULIB_MKOSTEMP=0; + GNULIB_MKOSTEMPS=0; + GNULIB_MKSTEMP=0; + GNULIB_MKSTEMPS=0; + GNULIB_POSIX_OPENPT=0; + GNULIB_PTSNAME=0; + GNULIB_PTSNAME_R=0; + GNULIB_PUTENV=0; + GNULIB_QSORT_R=0; + GNULIB_RANDOM=0; + GNULIB_RANDOM_R=0; + GNULIB_REALLOC_POSIX=0; + GNULIB_REALPATH=0; + GNULIB_RPMATCH=0; + GNULIB_SECURE_GETENV=0; + GNULIB_SETENV=0; + GNULIB_STRTOD=0; + GNULIB_STRTOLL=0; + GNULIB_STRTOULL=0; + GNULIB_SYSTEM_POSIX=0; + GNULIB_UNLOCKPT=0; + GNULIB_UNSETENV=0; + GNULIB_WCTOMB=0; + HAVE__EXIT=1; + HAVE_ATOLL=1; + HAVE_CANONICALIZE_FILE_NAME=1; + HAVE_DECL_GETLOADAVG=1; + HAVE_GETSUBOPT=1; + HAVE_GRANTPT=1; + HAVE_MKDTEMP=1; + HAVE_MKOSTEMP=1; + HAVE_MKOSTEMPS=1; + HAVE_MKSTEMP=1; + HAVE_MKSTEMPS=1; + HAVE_POSIX_OPENPT=1; + HAVE_PTSNAME=1; + HAVE_PTSNAME_R=1; + HAVE_QSORT_R=1; + HAVE_RANDOM=1; + HAVE_RANDOM_H=1; + HAVE_RANDOM_R=1; + HAVE_REALPATH=1; + HAVE_RPMATCH=1; + HAVE_SECURE_GETENV=1; + HAVE_SETENV=1; + HAVE_DECL_SETENV=1; + HAVE_STRTOD=1; + HAVE_STRTOLL=1; + HAVE_STRTOULL=1; + HAVE_STRUCT_RANDOM_DATA=1; + HAVE_SYS_LOADAVG_H=0; + HAVE_UNLOCKPT=1; + HAVE_DECL_UNSETENV=1; + REPLACE_CALLOC=0; + REPLACE_CANONICALIZE_FILE_NAME=0; + REPLACE_MALLOC=0; + REPLACE_MBTOWC=0; + REPLACE_MKSTEMP=0; + REPLACE_PTSNAME=0; + REPLACE_PTSNAME_R=0; + REPLACE_PUTENV=0; + REPLACE_QSORT_R=0; + REPLACE_RANDOM_R=0; + REPLACE_REALLOC=0; + REPLACE_REALPATH=0; + REPLACE_SETENV=0; + REPLACE_STRTOD=0; + REPLACE_UNSETENV=0; + REPLACE_WCTOMB=0; + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5 +printf %s "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; } +if test ${gl_cv_func_malloc_posix+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + choke me + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_malloc_posix=yes +else case e in #( + e) gl_cv_func_malloc_posix=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5 +printf "%s\n" "$gl_cv_func_malloc_posix" >&6; } + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +printf %s "checking for GNU libc compatible malloc... " >&6; } +if test ${ac_cv_func_malloc_0_nonnull+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ + | hpux* | solaris* | cygwin* | mingw* | windows* | msys* ) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; + esac +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + +int +main (void) +{ +void *p = malloc (0); + int result = !p; + free (p); + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_malloc_0_nonnull=yes +else case e in #( + e) ac_cv_func_malloc_0_nonnull=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes +then : + gl_cv_func_malloc_0_nonnull=1 +else case e in #( + e) gl_cv_func_malloc_0_nonnull=0 ;; +esac +fi + + +printf "%s\n" "#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull" >>confdefs.h + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + GNULIB_FFSL=0; + GNULIB_FFSLL=0; + GNULIB_MEMCHR=0; + GNULIB_MEMMEM=0; + GNULIB_MEMPCPY=0; + GNULIB_MEMRCHR=0; + GNULIB_RAWMEMCHR=0; + GNULIB_STPCPY=0; + GNULIB_STPNCPY=0; + GNULIB_STRCHRNUL=0; + GNULIB_STRDUP=0; + GNULIB_STRNCAT=0; + GNULIB_STRNDUP=0; + GNULIB_STRNLEN=0; + GNULIB_STRPBRK=0; + GNULIB_STRSEP=0; + GNULIB_STRSTR=0; + GNULIB_STRCASESTR=0; + GNULIB_STRTOK_R=0; + GNULIB_MBSLEN=0; + GNULIB_MBSNLEN=0; + GNULIB_MBSCHR=0; + GNULIB_MBSRCHR=0; + GNULIB_MBSSTR=0; + GNULIB_MBSCASECMP=0; + GNULIB_MBSNCASECMP=0; + GNULIB_MBSPCASECMP=0; + GNULIB_MBSCASESTR=0; + GNULIB_MBSCSPN=0; + GNULIB_MBSPBRK=0; + GNULIB_MBSSPN=0; + GNULIB_MBSSEP=0; + GNULIB_MBSTOK_R=0; + GNULIB_STRERROR=0; + GNULIB_STRERROR_R=0; + GNULIB_STRSIGNAL=0; + GNULIB_STRVERSCMP=0; + HAVE_MBSLEN=0; + HAVE_FFSL=1; + HAVE_FFSLL=1; + HAVE_MEMCHR=1; + HAVE_DECL_MEMMEM=1; + HAVE_MEMPCPY=1; + HAVE_DECL_MEMRCHR=1; + HAVE_RAWMEMCHR=1; + HAVE_STPCPY=1; + HAVE_STPNCPY=1; + HAVE_STRCHRNUL=1; + HAVE_DECL_STRDUP=1; + HAVE_DECL_STRNDUP=1; + HAVE_DECL_STRNLEN=1; + HAVE_STRPBRK=1; + HAVE_STRSEP=1; + HAVE_STRCASESTR=1; + HAVE_DECL_STRTOK_R=1; + HAVE_DECL_STRERROR_R=1; + HAVE_DECL_STRSIGNAL=1; + HAVE_STRVERSCMP=1; + REPLACE_MEMCHR=0; + REPLACE_MEMMEM=0; + REPLACE_STPNCPY=0; + REPLACE_STRDUP=0; + REPLACE_STRSTR=0; + REPLACE_STRCASESTR=0; + REPLACE_STRCHRNUL=0; + REPLACE_STRERROR=0; + REPLACE_STRERROR_R=0; + REPLACE_STRNCAT=0; + REPLACE_STRNDUP=0; + REPLACE_STRNLEN=0; + REPLACE_STRSIGNAL=0; + REPLACE_STRTOK_R=0; + UNDEFINE_STRTOK_R=0; + + + + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in #( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + if test $HAVE_MEMCHR = 1; then + # Detect platform-specific bugs in some versions of glibc: + # memchr should not dereference anything with length 0 + # http://bugzilla.redhat.com/499689 + # memchr should not dereference overestimated length after a match + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 + # http://sourceware.org/bugzilla/show_bug.cgi?id=10162 + # Assume that memchr works on platforms that lack mprotect. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5 +printf %s "checking whether memchr works... " >&6; } +if test ${gl_cv_func_memchr_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_memchr_works="guessing no" +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <string.h> +#if HAVE_SYS_MMAN_H +# include <fcntl.h> +# include <unistd.h> +# include <sys/types.h> +# include <sys/mman.h> +# ifndef MAP_FILE +# define MAP_FILE 0 +# endif +#endif + +int +main (void) +{ + + int result = 0; + char *fence = NULL; +#if HAVE_SYS_MMAN_H && HAVE_MPROTECT +# if HAVE_MAP_ANONYMOUS + const int flags = MAP_ANONYMOUS | MAP_PRIVATE; + const int fd = -1; +# else /* !HAVE_MAP_ANONYMOUS */ + const int flags = MAP_FILE | MAP_PRIVATE; + int fd = open ("/dev/zero", O_RDONLY, 0666); + if (fd >= 0) +# endif + { + int pagesize = getpagesize (); + char *two_pages = + (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, + flags, fd, 0); + if (two_pages != (char *)(-1) + && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) + fence = two_pages + pagesize; + } +#endif + if (fence) + { + if (memchr (fence, 0, 0)) + result |= 1; + strcpy (fence - 9, "12345678"); + if (memchr (fence - 9, 0, 79) != fence - 1) + result |= 2; + if (memchr (fence - 1, 0, 3) != fence - 1) + result |= 4; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_memchr_works=yes +else case e in #( + e) gl_cv_func_memchr_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5 +printf "%s\n" "$gl_cv_func_memchr_works" >&6; } + if test "$gl_cv_func_memchr_works" != yes; then + REPLACE_MEMCHR=1 + fi + fi + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <limits.h> defines MIN and MAX" >&5 +printf %s "checking whether <limits.h> defines MIN and MAX... " >&6; } +if test ${gl_cv_minmax_in_limits_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + int x = MIN (42, 17); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_minmax_in_limits_h=yes +else case e in #( + e) gl_cv_minmax_in_limits_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5 +printf "%s\n" "$gl_cv_minmax_in_limits_h" >&6; } + if test $gl_cv_minmax_in_limits_h = yes; then + +printf "%s\n" "#define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h + + fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/param.h> defines MIN and MAX" >&5 +printf %s "checking whether <sys/param.h> defines MIN and MAX... " >&6; } +if test ${gl_cv_minmax_in_sys_param_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/param.h> + int x = MIN (42, 17); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_minmax_in_sys_param_h=yes +else case e in #( + e) gl_cv_minmax_in_sys_param_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5 +printf "%s\n" "$gl_cv_minmax_in_sys_param_h" >&6; } + if test $gl_cv_minmax_in_sys_param_h = yes; then + +printf "%s\n" "#define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h + + fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether time_t is signed" >&5 +printf %s "checking whether time_t is signed... " >&6; } +if test ${gl_cv_time_t_is_signed+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <time.h> + char time_t_signed[(time_t) -1 < 0 ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_time_t_is_signed=yes +else case e in #( + e) gl_cv_time_t_is_signed=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_t_is_signed" >&5 +printf "%s\n" "$gl_cv_time_t_is_signed" >&6; } + if test $gl_cv_time_t_is_signed = yes; then + +printf "%s\n" "#define TIME_T_IS_SIGNED 1" >>confdefs.h + + fi + +ac_fn_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_alarm" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_ALARM $ac_have_decl" >>confdefs.h + + + + + + + + + + if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple Mac OS X platforms. + # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode. + # But we need a configuration result that is valid in both modes. + gl_cv_func_working_mktime=no + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5 +printf %s "checking for working mktime... " >&6; } +if test ${gl_cv_func_working_mktime+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_working_mktime="guessing no" +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test program from Paul Eggert and Tony Leneis. */ +#include <limits.h> +#include <stdlib.h> +#include <time.h> + +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif + +#if HAVE_DECL_ALARM +# include <signal.h> +#endif + +/* Work around redefinition to rpl_putenv by other config tests. */ +#undef putenv + +static time_t time_t_max; +static time_t time_t_min; + +/* Values we'll use to set the TZ environment variable. */ +static char *tz_strings[] = { + (char *) 0, "TZ=GMT0", "TZ=JST-9", + "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" +}; +#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) + +/* Return 0 if mktime fails to convert a date in the spring-forward gap. + Based on a problem report from Andreas Jaeger. */ +static int +spring_forward_gap () +{ + /* glibc (up to about 1998-10-07) failed this test. */ + struct tm tm; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + tm.tm_year = 98; + tm.tm_mon = 3; + tm.tm_mday = 5; + tm.tm_hour = 2; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + return mktime (&tm) != (time_t) -1; +} + +static int +mktime_test1 (time_t now) +{ + struct tm *lt; + return ! (lt = localtime (&now)) || mktime (lt) == now; +} + +static int +mktime_test (time_t now) +{ + return (mktime_test1 (now) + && mktime_test1 ((time_t) (time_t_max - now)) + && mktime_test1 ((time_t) (time_t_min + now))); +} + +static int +irix_6_4_bug () +{ + /* Based on code from Ariel Faigon. */ + struct tm tm; + tm.tm_year = 96; + tm.tm_mon = 3; + tm.tm_mday = 0; + tm.tm_hour = 0; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + mktime (&tm); + return tm.tm_mon == 2 && tm.tm_mday == 31; +} + +static int +bigtime_test (int j) +{ + struct tm tm; + time_t now; + tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; + now = mktime (&tm); + if (now != (time_t) -1) + { + struct tm *lt = localtime (&now); + if (! (lt + && lt->tm_year == tm.tm_year + && lt->tm_mon == tm.tm_mon + && lt->tm_mday == tm.tm_mday + && lt->tm_hour == tm.tm_hour + && lt->tm_min == tm.tm_min + && lt->tm_sec == tm.tm_sec + && lt->tm_yday == tm.tm_yday + && lt->tm_wday == tm.tm_wday + && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) + == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) + return 0; + } + return 1; +} + +static int +year_2050_test () +{ + /* The correct answer for 2050-02-01 00:00:00 in Pacific time, + ignoring leap seconds. */ + unsigned long int answer = 2527315200UL; + + struct tm tm; + time_t t; + tm.tm_year = 2050 - 1900; + tm.tm_mon = 2 - 1; + tm.tm_mday = 1; + tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + tm.tm_isdst = -1; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + t = mktime (&tm); + + /* Check that the result is either a failure, or close enough + to the correct answer that we can assume the discrepancy is + due to leap seconds. */ + return (t == (time_t) -1 + || (0 < t && answer - 120 <= t && t <= answer + 120)); +} + +int +main () +{ + int result = 0; + time_t t, delta; + int i, j; + int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1; + +#if HAVE_DECL_ALARM + /* This test makes some buggy mktime implementations loop. + Give up after 60 seconds; a mktime slower than that + isn't worth using anyway. */ + signal (SIGALRM, SIG_DFL); + alarm (60); +#endif + + time_t_max = (! TIME_T_IS_SIGNED + ? (time_t) -1 + : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1) + * 2 + 1)); + time_t_min = (! TIME_T_IS_SIGNED + ? (time_t) 0 + : time_t_signed_magnitude + ? ~ (time_t) 0 + : ~ time_t_max); + + delta = time_t_max / 997; /* a suitable prime number */ + for (i = 0; i < N_STRINGS; i++) + { + if (tz_strings[i]) + putenv (tz_strings[i]); + + for (t = 0; t <= time_t_max - delta && (result & 1) == 0; t += delta) + if (! mktime_test (t)) + result |= 1; + if ((result & 2) == 0 + && ! (mktime_test ((time_t) 1) + && mktime_test ((time_t) (60 * 60)) + && mktime_test ((time_t) (60 * 60 * 24)))) + result |= 2; + + for (j = 1; (result & 4) == 0; j <<= 1) + { + if (! bigtime_test (j)) + result |= 4; + if (INT_MAX / 2 < j) + break; + } + if ((result & 8) == 0 && ! bigtime_test (INT_MAX)) + result |= 8; + } + if (! irix_6_4_bug ()) + result |= 16; + if (! spring_forward_gap ()) + result |= 32; + if (! year_2050_test ()) + result |= 64; + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_working_mktime=yes +else case e in #( + e) gl_cv_func_working_mktime=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mktime" >&5 +printf "%s\n" "$gl_cv_func_working_mktime" >&6; } + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5 +printf %s "checking for promoted mode_t type... " >&6; } +if test ${gl_cv_promoted_mode_t+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +int +main (void) +{ +typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_promoted_mode_t='int' +else case e in #( + e) gl_cv_promoted_mode_t='mode_t' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5 +printf "%s\n" "$gl_cv_promoted_mode_t" >&6; } + +printf "%s\n" "#define PROMOTED_MODE_T $gl_cv_promoted_mode_t" >>confdefs.h + + + + + GNULIB_PTHREAD_SIGMASK=0; + GNULIB_RAISE=0; + GNULIB_SIGNAL_H_SIGPIPE=0; + GNULIB_SIGPROCMASK=0; + GNULIB_SIGACTION=0; + HAVE_POSIX_SIGNALBLOCKING=1; + HAVE_PTHREAD_SIGMASK=1; + HAVE_RAISE=1; + HAVE_SIGSET_T=1; + HAVE_SIGINFO_T=1; + HAVE_SIGACTION=1; + HAVE_STRUCT_SIGACTION_SA_SIGACTION=1; + + HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1; + + HAVE_SIGHANDLER_T=1; + REPLACE_PTHREAD_SIGMASK=0; + REPLACE_RAISE=0; + + + ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" " + #include <signal.h> + /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */ + #include <sys/types.h> + +" +if test "x$ac_cv_type_sigset_t" = xyes +then : + +printf "%s\n" "#define HAVE_SIGSET_T 1" >>confdefs.h + +gl_cv_type_sigset_t=yes +else case e in #( + e) gl_cv_type_sigset_t=no ;; +esac +fi + + if test $gl_cv_type_sigset_t != yes; then + HAVE_SIGSET_T=0 + fi + + + + + + + + +ac_fn_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_setenv" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_SETENV $ac_have_decl" >>confdefs.h + + + + + + if test $ac_cv_have_decl_setenv = no; then + HAVE_DECL_SETENV=0 + fi + + + + + + ac_fn_c_check_header_compile "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default" +if test "x$ac_cv_header_search_h" = xyes +then : + printf "%s\n" "#define HAVE_SEARCH_H 1" >>confdefs.h + +fi + + ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch" +if test "x$ac_cv_func_tsearch" = xyes +then : + printf "%s\n" "#define HAVE_TSEARCH 1" >>confdefs.h + +fi + + + + +ac_fn_c_check_type "$LINENO" "uid_t" "ac_cv_type_uid_t" "$ac_includes_default" +if test "x$ac_cv_type_uid_t" = xyes +then : + +else case e in #( + e) +printf "%s\n" "#define uid_t int" >>confdefs.h + ;; +esac +fi + +ac_fn_c_check_type "$LINENO" "gid_t" "ac_cv_type_gid_t" "$ac_includes_default" +if test "x$ac_cv_type_gid_t" = xyes +then : + +else case e in #( + e) +printf "%s\n" "#define gid_t int" >>confdefs.h + ;; +esac +fi + +: + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +printf %s "checking for stdbool.h that conforms to C99... " >&6; } +if test ${ac_cv_header_stdbool_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <stdbool.h> + + #ifdef __cplusplus + typedef bool Bool; + #else + typedef _Bool Bool; + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #endif + + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + Bool q = true; + Bool *pq = &q; + bool *qq = &q; + +int +main (void) +{ + + bool e = &s; + *pq |= q; *pq |= ! q; + *qq |= q; *qq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq + !qq); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_header_stdbool_h=yes +else case e in #( + e) ac_cv_header_stdbool_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } + ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes +then : + +printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h + + +fi + + + + GNULIB_FFS=0; + HAVE_FFS=1; + HAVE_STRCASECMP=1; + HAVE_DECL_STRNCASECMP=1; + + + REPLACE_STRERROR_0=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5 +printf %s "checking whether strerror(0) succeeds... " >&6; } +if test ${gl_cv_func_strerror_0_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_strerror_0_works="guessing no" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + #include <errno.h> + +int +main (void) +{ +int result = 0; + char *str; + errno = 0; + str = strerror (0); + if (!*str) result |= 1; + if (errno) result |= 2; + if (strstr (str, "nknown") || strstr (str, "ndefined")) + result |= 4; + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strerror_0_works=yes +else case e in #( + e) gl_cv_func_strerror_0_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5 +printf "%s\n" "$gl_cv_func_strerror_0_works" >&6; } + case "$gl_cv_func_strerror_0_works" in + *yes) ;; + *) + REPLACE_STRERROR_0=1 + +printf "%s\n" "#define REPLACE_STRERROR_0 1" >>confdefs.h + + ;; + esac + + + + + + + + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5 +printf %s "checking for strerror_r with POSIX signature... " >&6; } +if test ${gl_cv_func_strerror_r_posix_signature+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + int strerror_r (int, char *, size_t); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_strerror_r_posix_signature=yes +else case e in #( + e) gl_cv_func_strerror_r_posix_signature=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_strerror_r_posix_signature" >&6; } + if test $gl_cv_func_strerror_r_posix_signature = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5 +printf %s "checking whether strerror_r works... " >&6; } +if test ${gl_cv_func_strerror_r_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on AIX. + aix*) gl_cv_func_strerror_r_works="guessing no";; + # Guess no on HP-UX. + hpux*) gl_cv_func_strerror_r_works="guessing no";; + # Guess no on BSD variants. + *bsd*) gl_cv_func_strerror_r_works="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_strerror_r_works="guessing yes";; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <errno.h> + #include <string.h> + +int +main (void) +{ +int result = 0; + char buf[79]; + if (strerror_r (EACCES, buf, 0) < 0) + result |= 1; + errno = 0; + if (strerror_r (EACCES, buf, sizeof buf) != 0) + result |= 2; + strcpy (buf, "Unknown"); + if (strerror_r (0, buf, sizeof buf) != 0) + result |= 4; + if (errno) + result |= 8; + if (strstr (buf, "nknown") || strstr (buf, "ndefined")) + result |= 0x10; + errno = 0; + *buf = 0; + if (strerror_r (-3, buf, sizeof buf) < 0) + result |= 0x20; + if (errno) + result |= 0x40; + if (!*buf) + result |= 0x80; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strerror_r_works=yes +else case e in #( + e) gl_cv_func_strerror_r_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5 +printf "%s\n" "$gl_cv_func_strerror_r_works" >&6; } + else + + if test $ac_cv_func___xpg_strerror_r = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5 +printf %s "checking whether __xpg_strerror_r works... " >&6; } +if test ${gl_cv_func_strerror_r_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_strerror_r_works="guessing no" + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <errno.h> + #include <string.h> + extern + #ifdef __cplusplus + "C" + #endif + int __xpg_strerror_r(int, char *, size_t); + +int +main (void) +{ +int result = 0; + char buf[256] = "^"; + char copy[256]; + char *str = strerror (-1); + strcpy (copy, str); + if (__xpg_strerror_r (-2, buf, 1) == 0) + result |= 1; + if (*buf) + result |= 2; + __xpg_strerror_r (-2, buf, 256); + if (strcmp (str, copy)) + result |= 4; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strerror_r_works=yes +else case e in #( + e) gl_cv_func_strerror_r_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5 +printf "%s\n" "$gl_cv_func_strerror_r_works" >&6; } + fi + fi + fi + fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +printf %s "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if test ${ac_cv_struct_tm+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <time.h> + +int +main (void) +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_struct_tm=time.h +else case e in #( + e) ac_cv_struct_tm=sys/time.h ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +printf "%s\n" "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +printf "%s\n" "#define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h> +#include <$ac_cv_struct_tm> + +" +if test "x$ac_cv_member_struct_tm_tm_zone" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_TM_TM_ZONE 1" >>confdefs.h + + +fi + +if test "$ac_cv_member_struct_tm_tm_zone" = yes; then + +printf "%s\n" "#define HAVE_TM_ZONE 1" >>confdefs.h + +else + ac_fn_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include <time.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_tzname" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_TZNAME $ac_have_decl" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 +printf %s "checking for tzname... " >&6; } +if test ${ac_cv_var_tzname+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <time.h> +#if !HAVE_DECL_TZNAME +extern char *tzname[]; +#endif + +int +main (void) +{ +return tzname[0][0]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_var_tzname=yes +else case e in #( + e) ac_cv_var_tzname=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5 +printf "%s\n" "$ac_cv_var_tzname" >&6; } + if test $ac_cv_var_tzname = yes; then + +printf "%s\n" "#define HAVE_TZNAME 1" >>confdefs.h + + fi +fi + + + ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include <time.h> +" +if test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes +then : + +printf "%s\n" "#define HAVE_TM_GMTOFF 1" >>confdefs.h + +fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_string_h='<'string.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5 +printf %s "checking absolute name of <string.h>... " >&6; } +if test ${gl_cv_next_string_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'string.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_string_h + gl_cv_next_string_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5 +printf "%s\n" "$gl_cv_next_string_h" >&6; } + fi + NEXT_STRING_H=$gl_cv_next_string_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'string.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_string_h + fi + NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive + + + + + + + for gl_func in ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r strerror_r strsignal strverscmp; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_strings_h='<'strings.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <strings.h>" >&5 +printf %s "checking absolute name of <strings.h>... " >&6; } +if test ${gl_cv_next_strings_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_strings_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <strings.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'strings.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_strings_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_strings_h + gl_cv_next_strings_h='"'$gl_header'"' + else + gl_cv_next_strings_h='<'strings.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_strings_h" >&5 +printf "%s\n" "$gl_cv_next_strings_h" >&6; } + fi + NEXT_STRINGS_H=$gl_cv_next_strings_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'strings.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_strings_h + fi + NEXT_AS_FIRST_DIRECTIVE_STRINGS_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_strings_h = yes; then + HAVE_STRINGS_H=1 + else + HAVE_STRINGS_H=0 + fi + + + + for gl_func in ffs strcasecmp strncasecmp; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Minix 3.1.8 has a bug: <sys/types.h> must be included before + <strings.h>. */ + #include <sys/types.h> + #include <strings.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + +ac_fn_check_decl "$LINENO" "strndup" "ac_cv_have_decl_strndup" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strndup" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_STRNDUP $ac_have_decl" >>confdefs.h + + +ac_fn_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strnlen" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_STRNLEN $ac_have_decl" >>confdefs.h + + + +ac_fn_check_decl "$LINENO" "strtoumax" "ac_cv_have_decl_strtoumax" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strtoumax" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_STRTOUMAX $ac_have_decl" >>confdefs.h + + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_types_h='<'sys/types.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5 +printf %s "checking absolute name of <sys/types.h>... " >&6; } +if test ${gl_cv_next_sys_types_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/types.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_types_h + gl_cv_next_sys_types_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5 +printf "%s\n" "$gl_cv_next_sys_types_h" >&6; } + fi + NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/types.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_types_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive + + + + + + + + + + + + + WINDOWS_STAT_INODES=0 + + + + + GNULIB_WAITPID=0; + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5 +printf %s "checking for struct timespec in <time.h>... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_time_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <time.h> + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_time_h=yes +else case e in #( + e) gl_cv_sys_struct_timespec_in_time_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_time_h" >&6; } + + TIME_H_DEFINES_STRUCT_TIMESPEC=0 + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 + UNISTD_H_DEFINES_STRUCT_TIMESPEC=0 + if test $gl_cv_sys_struct_timespec_in_time_h = yes; then + TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5 +printf %s "checking for struct timespec in <sys/time.h>... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_sys_time_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/time.h> + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_sys_time_h=yes +else case e in #( + e) gl_cv_sys_struct_timespec_in_sys_time_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5 +printf %s "checking for struct timespec in <pthread.h>... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_pthread_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <pthread.h> + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_pthread_h=yes +else case e in #( + e) gl_cv_sys_struct_timespec_in_pthread_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5 +printf %s "checking for struct timespec in <unistd.h>... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_unistd_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_unistd_h=yes +else case e in #( + e) gl_cv_sys_struct_timespec_in_unistd_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then + UNISTD_H_DEFINES_STRUCT_TIMESPEC=1 + fi + fi + fi + fi + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_time_h='<'time.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5 +printf %s "checking absolute name of <time.h>... " >&6; } +if test ${gl_cv_next_time_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <time.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'time.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_time_h + gl_cv_next_time_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5 +printf "%s\n" "$gl_cv_next_time_h" >&6; } + fi + NEXT_TIME_H=$gl_cv_next_time_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'time.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_time_h + fi + NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive + + + + + + + + + + + + + + +gl_libunistring_sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' + + + if test "$HAVE_LIBUNISTRING" = yes; then + LIBUNISTRING_VERSION_MAJOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_major"` + LIBUNISTRING_VERSION_MINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_minor"` + LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_subminor"` + fi + +ac_fn_check_decl "$LINENO" "clearerr_unlocked" "ac_cv_have_decl_clearerr_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_clearerr_unlocked" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_CLEARERR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "feof_unlocked" "ac_cv_have_decl_feof_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_feof_unlocked" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_FEOF_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "ferror_unlocked" "ac_cv_have_decl_ferror_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_ferror_unlocked" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_FERROR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fflush_unlocked" "ac_cv_have_decl_fflush_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fflush_unlocked" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_FFLUSH_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fgets_unlocked" "ac_cv_have_decl_fgets_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fgets_unlocked" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_FGETS_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fputc_unlocked" "ac_cv_have_decl_fputc_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fputc_unlocked" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_FPUTC_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fputs_unlocked" "ac_cv_have_decl_fputs_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fputs_unlocked" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_FPUTS_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fread_unlocked" "ac_cv_have_decl_fread_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fread_unlocked" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_FREAD_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "fwrite_unlocked" "ac_cv_have_decl_fwrite_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fwrite_unlocked" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_FWRITE_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "getchar_unlocked" "ac_cv_have_decl_getchar_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getchar_unlocked" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_GETCHAR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "putc_unlocked" "ac_cv_have_decl_putc_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_putc_unlocked" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_PUTC_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "putchar_unlocked" "ac_cv_have_decl_putchar_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_putchar_unlocked" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_PUTCHAR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_unsetenv" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_UNSETENV $ac_have_decl" >>confdefs.h + + + + + + if test $ac_cv_header_features_h = yes; then + HAVE_FEATURES_H=1 + else + HAVE_FEATURES_H=0 + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5 +printf %s "checking for inttypes.h... " >&6; } +if test ${gl_cv_header_inttypes_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/types.h> +#include <inttypes.h> + +int +main (void) +{ +uintmax_t i = (uintmax_t) -1; return !i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_inttypes_h=yes +else case e in #( + e) gl_cv_header_inttypes_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_inttypes_h" >&5 +printf "%s\n" "$gl_cv_header_inttypes_h" >&6; } + if test $gl_cv_header_inttypes_h = yes; then + +printf "%s\n" "#define HAVE_INTTYPES_H_WITH_UINTMAX 1" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5 +printf %s "checking for stdint.h... " >&6; } +if test ${gl_cv_header_stdint_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <stdint.h> +int +main (void) +{ +uintmax_t i = (uintmax_t) -1; return !i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_stdint_h=yes +else case e in #( + e) gl_cv_header_stdint_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_h" >&5 +printf "%s\n" "$gl_cv_header_stdint_h" >&6; } + if test $gl_cv_header_stdint_h = yes; then + +printf "%s\n" "#define HAVE_STDINT_H_WITH_UINTMAX 1" >>confdefs.h + + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5 +printf %s "checking for intmax_t... " >&6; } +if test ${gt_cv_c_intmax_t+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stddef.h> +#include <stdlib.h> +#if HAVE_STDINT_H_WITH_UINTMAX +#include <stdint.h> +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include <inttypes.h> +#endif + +int +main (void) +{ +intmax_t x = -1; return !x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_c_intmax_t=yes +else case e in #( + e) gt_cv_c_intmax_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_intmax_t" >&5 +printf "%s\n" "$gt_cv_c_intmax_t" >&6; } + if test $gt_cv_c_intmax_t = yes; then + +printf "%s\n" "#define HAVE_INTMAX_T 1" >>confdefs.h + + else + + test $ac_cv_type_long_long_int = yes \ + && ac_type='long long' \ + || ac_type='long' + +printf "%s\n" "#define intmax_t $ac_type" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5 +printf %s "checking where to find the exponent in a 'double'... " >&6; } +if test ${gl_cv_cc_double_expbit0+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test "$cross_compiling" = yes +then : + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined arm || defined __arm || defined __arm__ + mixed_endianness +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "mixed_endianness" >/dev/null 2>&1 +then : + gl_cv_cc_double_expbit0="unknown" +else case e in #( + e) + : +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> + +int +main (void) +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> + +int +main (void) +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + +int +main (void) +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + +int +main (void) +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes +then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +unsigned short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + unsigned short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + unsigned short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + unsigned short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else case e in #( + e) ac_cv_c_bigendian=yes ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi ;; +esac +fi +: + case $ac_cv_c_bigendian in #( + yes) + gl_cv_cc_double_expbit0="word 0 bit 20";; #( + no) + gl_cv_cc_double_expbit0="word 1 bit 20" ;; #( + universal) + +printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + gl_cv_cc_double_expbit0="unknown" ;; + esac + + ;; +esac +fi +rm -rf conftest* + + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { double value; unsigned int word[NWORDS]; } memory_double; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (double x) +{ + memory_double m; + size_t i; + /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ + memset (&m, 0, sizeof (memory_double)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25); + add_to_ored_words (0.5); + add_to_ored_words (1.0); + add_to_ored_words (2.0); + add_to_ored_words (4.0); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_cc_double_expbit0=`cat conftest.out` +else case e in #( + e) gl_cv_cc_double_expbit0="unknown" ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.out + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5 +printf "%s\n" "$gl_cv_cc_double_expbit0" >&6; } + case "$gl_cv_cc_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` + +printf "%s\n" "#define DBL_EXPBIT0_WORD $word" >>confdefs.h + + +printf "%s\n" "#define DBL_EXPBIT0_BIT $bit" >>confdefs.h + + ;; + esac + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether snprintf returns a byte count as in C99" >&5 +printf %s "checking whether snprintf returns a byte count as in C99... " >&6; } +if test ${gl_cv_func_snprintf_retval_c99+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";; + darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_retval_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";; + aix*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_retval_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_retval_c99="guessing no";; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char buf[100]; +int main () +{ + strcpy (buf, "ABCDEF"); + if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7) + return 1; + if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7) + return 2; + if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7) + return 3; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_snprintf_retval_c99=yes +else case e in #( + e) gl_cv_func_snprintf_retval_c99=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_retval_c99" >&5 +printf "%s\n" "$gl_cv_func_snprintf_retval_c99" >&6; } + + + + + + + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strnlen" "ac_cv_func_strnlen" +if test "x$ac_cv_func_strnlen" = xyes +then : + printf "%s\n" "#define HAVE_STRNLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcslen" "ac_cv_func_wcslen" +if test "x$ac_cv_func_wcslen" = xyes +then : + printf "%s\n" "#define HAVE_WCSLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcsnlen" "ac_cv_func_wcsnlen" +if test "x$ac_cv_func_wcsnlen" = xyes +then : + printf "%s\n" "#define HAVE_WCSNLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mbrtowc" "ac_cv_func_mbrtowc" +if test "x$ac_cv_func_mbrtowc" = xyes +then : + printf "%s\n" "#define HAVE_MBRTOWC 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcrtomb" "ac_cv_func_wcrtomb" +if test "x$ac_cv_func_wcrtomb" = xyes +then : + printf "%s\n" "#define HAVE_WCRTOMB 1" >>confdefs.h + +fi + + ac_fn_check_decl "$LINENO" "_snprintf" "ac_cv_have_decl__snprintf" "#include <stdio.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl__snprintf" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL__SNPRINTF $ac_have_decl" >>confdefs.h + + + + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + +printf "%s\n" "#define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h + + ;; + esac + + + + + GNULIB_SOCKET=0; + GNULIB_CONNECT=0; + GNULIB_ACCEPT=0; + GNULIB_BIND=0; + GNULIB_GETPEERNAME=0; + GNULIB_GETSOCKNAME=0; + GNULIB_GETSOCKOPT=0; + GNULIB_LISTEN=0; + GNULIB_RECV=0; + GNULIB_SEND=0; + GNULIB_RECVFROM=0; + GNULIB_SENDTO=0; + GNULIB_SETSOCKOPT=0; + GNULIB_SHUTDOWN=0; + GNULIB_ACCEPT4=0; + HAVE_STRUCT_SOCKADDR_STORAGE=1; + HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1; + + HAVE_SA_FAMILY_T=1; + HAVE_ACCEPT4=1; + + + if test $ac_cv_header_sys_socket_h = no; then + ac_fn_c_check_header_compile "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" +if test "x$ac_cv_header_ws2tcpip_h" = xyes +then : + printf "%s\n" "#define HAVE_WS2TCPIP_H 1" >>confdefs.h + +fi + + fi + + + + + + case "$host_os" in + osf*) + +printf "%s\n" "#define _POSIX_PII_SOCKET 1" >>confdefs.h + + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> is self-contained" >&5 +printf %s "checking whether <sys/socket.h> is self-contained... " >&6; } +if test ${gl_cv_header_sys_socket_h_selfcontained+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/socket.h> +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_sys_socket_h_selfcontained=yes +else case e in #( + e) gl_cv_header_sys_socket_h_selfcontained=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5 +printf "%s\n" "$gl_cv_header_sys_socket_h_selfcontained" >&6; } + if test $gl_cv_header_sys_socket_h_selfcontained = yes; then + ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown" +if test "x$ac_cv_func_shutdown" = xyes +then : + printf "%s\n" "#define HAVE_SHUTDOWN 1" >>confdefs.h + +fi + + if test $ac_cv_func_shutdown = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> defines the SHUT_* macros" >&5 +printf %s "checking whether <sys/socket.h> defines the SHUT_* macros... " >&6; } +if test ${gl_cv_header_sys_socket_h_shut+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/socket.h> +int +main (void) +{ +int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR }; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_sys_socket_h_shut=yes +else case e in #( + e) gl_cv_header_sys_socket_h_shut=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5 +printf "%s\n" "$gl_cv_header_sys_socket_h_shut" >&6; } + if test $gl_cv_header_sys_socket_h_shut = no; then + SYS_SOCKET_H='sys/socket.h' + fi + fi + fi + # We need to check for ws2tcpip.h now. + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_socket_h='<'sys/socket.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/socket.h>" >&5 +printf %s "checking absolute name of <sys/socket.h>... " >&6; } +if test ${gl_cv_next_sys_socket_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_sys_socket_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/socket.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/socket.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_socket_h + gl_cv_next_sys_socket_h='"'$gl_header'"' + else + gl_cv_next_sys_socket_h='<'sys/socket.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5 +printf "%s\n" "$gl_cv_next_sys_socket_h" >&6; } + fi + NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/socket.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_socket_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_sys_socket_h = yes; then + HAVE_SYS_SOCKET_H=1 + HAVE_WS2TCPIP_H=0 + else + HAVE_SYS_SOCKET_H=0 + if test $ac_cv_header_ws2tcpip_h = yes; then + HAVE_WS2TCPIP_H=1 + else + HAVE_WS2TCPIP_H=0 + fi + fi + + + + ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" " + /* sys/types.h is not needed according to POSIX, but the + sys/socket.h in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_WS2TCPIP_H +#include <ws2tcpip.h> +#endif + +" +if test "x$ac_cv_type_struct_sockaddr_storage" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h + + +fi +ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" " + /* sys/types.h is not needed according to POSIX, but the + sys/socket.h in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_WS2TCPIP_H +#include <ws2tcpip.h> +#endif + +" +if test "x$ac_cv_type_sa_family_t" = xyes +then : + +printf "%s\n" "#define HAVE_SA_FAMILY_T 1" >>confdefs.h + + +fi + + if test $ac_cv_type_struct_sockaddr_storage = no; then + HAVE_STRUCT_SOCKADDR_STORAGE=0 + fi + if test $ac_cv_type_sa_family_t = no; then + HAVE_SA_FAMILY_T=0 + fi + if test $ac_cv_type_struct_sockaddr_storage != no; then + ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h> + #ifdef HAVE_SYS_SOCKET_H + #include <sys/socket.h> + #endif + #ifdef HAVE_WS2TCPIP_H + #include <ws2tcpip.h> + #endif + +" +if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1" >>confdefs.h + + +else case e in #( + e) HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0 ;; +esac +fi + + fi + if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \ + || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then + SYS_SOCKET_H='sys/socket.h' + fi + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + + + for gl_func in socket connect accept bind getpeername getsockname getsockopt listen recv send recvfrom sendto setsockopt shutdown accept4; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Some systems require prerequisite headers. */ +#include <sys/types.h> +#include <sys/socket.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + GNULIB_INET_NTOP=0; + GNULIB_INET_PTON=0; + HAVE_DECL_INET_NTOP=1; + HAVE_DECL_INET_PTON=1; + REPLACE_INET_NTOP=0; + REPLACE_INET_PTON=0; + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5 +printf %s "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; } +if test ${gl_cv_func_getcwd_null+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_getcwd_null="guessing yes";; + # Guess yes on Cygwin. + cygwin*) gl_cv_func_getcwd_null="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_getcwd_null="guessing no";; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# include <stdlib.h> +# if HAVE_UNISTD_H +# include <unistd.h> +# else /* on Windows with MSVC */ +# include <direct.h> +# endif +# ifndef getcwd + char *getcwd (); +# endif + +int +main (void) +{ + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* mingw cwd does not start with '/', but getcwd does allocate. + However, mingw fails to honor non-zero size. */ +#else + if (chdir ("/") != 0) + return 1; + else + { + char *f = getcwd (NULL, 0); + if (! f) + return 2; + if (f[0] != '/') + return 3; + if (f[1] != '\0') + return 4; + free (f); + return 0; + } +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getcwd_null=yes +else case e in #( + e) gl_cv_func_getcwd_null=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5 +printf "%s\n" "$gl_cv_func_getcwd_null" >&6; } + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5 +printf %s "checking for getcwd with POSIX signature... " >&6; } +if test ${gl_cv_func_getcwd_posix_signature+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> +int +main (void) +{ +extern + #ifdef __cplusplus + "C" + #endif + char *getcwd (char *, size_t); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_getcwd_posix_signature=yes +else case e in #( + e) gl_cv_func_getcwd_posix_signature=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_getcwd_posix_signature" >&6; } + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5 +printf %s "checking for IPv4 sockets... " >&6; } + if test ${gl_cv_socket_ipv4+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_WINSOCK2_H +#include <winsock2.h> +#endif +int +main (void) +{ +int x = AF_INET; struct in_addr y; struct sockaddr_in z; + if (&x && &y && &z) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_socket_ipv4=yes +else case e in #( + e) gl_cv_socket_ipv4=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5 +printf "%s\n" "$gl_cv_socket_ipv4" >&6; } + if test $gl_cv_socket_ipv4 = yes; then + +printf "%s\n" "#define HAVE_IPV4 1" >>confdefs.h + + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5 +printf %s "checking for IPv6 sockets... " >&6; } + if test ${gl_cv_socket_ipv6+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_WINSOCK2_H +#include <winsock2.h> +#endif +#ifdef HAVE_WS2TCPIP_H +#include <ws2tcpip.h> +#endif +int +main (void) +{ +int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; + if (&x && &y && &z) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_socket_ipv6=yes +else case e in #( + e) gl_cv_socket_ipv6=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5 +printf "%s\n" "$gl_cv_socket_ipv6" >&6; } + if test $gl_cv_socket_ipv6 = yes; then + +printf "%s\n" "#define HAVE_IPV6 1" >>confdefs.h + + fi + + + + GNULIB_PSELECT=0; + GNULIB_SELECT=0; + HAVE_PSELECT=1; + REPLACE_PSELECT=0; + REPLACE_SELECT=0; + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/select.h> is self-contained" >&5 +printf %s "checking whether <sys/select.h> is self-contained... " >&6; } +if test ${gl_cv_header_sys_select_h_selfcontained+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/select.h> +int +main (void) +{ +struct timeval b; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_sys_select_h_selfcontained=yes +else case e in #( + e) gl_cv_header_sys_select_h_selfcontained=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $gl_cv_header_sys_select_h_selfcontained = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/select.h> +int +main (void) +{ +int memset; int bzero; + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/select.h> +int +main (void) +{ + + #undef memset + #define memset nonexistent_memset + extern + #ifdef __cplusplus + "C" + #endif + void *memset (void *, int, unsigned long); + #undef bzero + #define bzero nonexistent_bzero + extern + #ifdef __cplusplus + "C" + #endif + void bzero (void *, unsigned long); + fd_set fds; + FD_ZERO (&fds); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in #( + e) gl_cv_header_sys_select_h_selfcontained=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_select_h_selfcontained" >&5 +printf "%s\n" "$gl_cv_header_sys_select_h_selfcontained" >&6; } + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_select_h='<'sys/select.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/select.h>" >&5 +printf %s "checking absolute name of <sys/select.h>... " >&6; } +if test ${gl_cv_next_sys_select_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_sys_select_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/select.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/select.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_select_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_select_h + gl_cv_next_sys_select_h='"'$gl_header'"' + else + gl_cv_next_sys_select_h='<'sys/select.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_select_h" >&5 +printf "%s\n" "$gl_cv_next_sys_select_h" >&6; } + fi + NEXT_SYS_SELECT_H=$gl_cv_next_sys_select_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/select.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_select_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_sys_select_h = yes; then + HAVE_SYS_SELECT_H=1 + else + HAVE_SYS_SELECT_H=0 + fi + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + + + for gl_func in pselect select; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Some systems require prerequisite headers. */ +#include <sys/types.h> +#if !(defined __GLIBC__ && !defined __UCLIBC__) && HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +#include <sys/select.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + LIBSOCKET= + if test $HAVE_WINSOCK2_H = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we need to call WSAStartup in winsock2.h and -lws2_32" >&5 +printf %s "checking if we need to call WSAStartup in winsock2.h and -lws2_32... " >&6; } +if test ${gl_cv_func_wsastartup+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_WINSOCK2_H +# include <winsock2.h> +#endif +int +main (void) +{ + + WORD wVersionRequested = MAKEWORD(1, 1); + WSADATA wsaData; + int err = WSAStartup(wVersionRequested, &wsaData); + WSACleanup (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_func_wsastartup=yes +else case e in #( + e) gl_cv_func_wsastartup=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wsastartup" >&5 +printf "%s\n" "$gl_cv_func_wsastartup" >&6; } + if test "$gl_cv_func_wsastartup" = "yes"; then + +printf "%s\n" "#define WINDOWS_SOCKETS 1" >>confdefs.h + + LIBSOCKET='-lws2_32' + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5 +printf %s "checking for library containing setsockopt... " >&6; } +if test ${gl_cv_lib_socket+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_cv_lib_socket= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in #( + e) gl_save_LIBS="$LIBS" + LIBS="$gl_save_LIBS -lsocket" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_lib_socket="-lsocket" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$gl_cv_lib_socket"; then + LIBS="$gl_save_LIBS -lnetwork" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_lib_socket="-lnetwork" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$gl_cv_lib_socket"; then + LIBS="$gl_save_LIBS -lnet" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_lib_socket="-lnet" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + fi + LIBS="$gl_save_LIBS" + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$gl_cv_lib_socket"; then + gl_cv_lib_socket="none needed" + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_socket" >&5 +printf "%s\n" "$gl_cv_lib_socket" >&6; } + if test "$gl_cv_lib_socket" != "none needed"; then + LIBSOCKET="$gl_cv_lib_socket" + fi + fi + + + + + + + : + + + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + REPLACE_SELECT=1 + else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select supports a 0 argument" >&5 +printf %s "checking whether select supports a 0 argument... " >&6; } +if test ${gl_cv_func_select_supports0+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on Interix. + interix*) gl_cv_func_select_supports0="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_select_supports0="guessing yes";; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/types.h> +#include <sys/time.h> +#if HAVE_SYS_SELECT_H +#include <sys/select.h> +#endif +int main () +{ + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_supports0=yes +else case e in #( + e) gl_cv_func_select_supports0=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_supports0" >&5 +printf "%s\n" "$gl_cv_func_select_supports0" >&6; } + case "$gl_cv_func_select_supports0" in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select detects invalid fds" >&5 +printf %s "checking whether select detects invalid fds... " >&6; } +if test ${gl_cv_func_select_detects_ebadf+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_select_detects_ebadf="guessing no" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/types.h> +#include <sys/time.h> +#if HAVE_SYS_SELECT_H +# include <sys/select.h> +#endif +#include <unistd.h> +#include <errno.h> + +int +main (void) +{ + + fd_set set; + dup2(0, 16); + FD_ZERO(&set); + FD_SET(16, &set); + close(16); + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_detects_ebadf=yes +else case e in #( + e) gl_cv_func_select_detects_ebadf=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_detects_ebadf" >&5 +printf "%s\n" "$gl_cv_func_select_detects_ebadf" >&6; } + case $gl_cv_func_select_detects_ebadf in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + fi + + LIB_SELECT="$LIBSOCKET" + if test $REPLACE_SELECT = 1; then + case "$host_os" in + mingw*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +int +main () +{ + MsgWaitForMultipleObjects (0, NULL, 0, 0, 0); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in #( + e) LIB_SELECT="$LIB_SELECT -luser32" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ;; + esac + fi + + + + + + + + + + if test $ac_cv_have_decl_strerror_r = no; then + HAVE_DECL_STRERROR_R=0 + fi + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + if test $gl_cv_func_strerror_r_posix_signature = yes; then + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR_R=1 ;; + esac + else + REPLACE_STRERROR_R=1 + fi + else + REPLACE_STRERROR_R=1 + fi + fi + + + +ac_fn_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_snprintf" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_SNPRINTF $ac_have_decl" >>confdefs.h + + + + + + + + + + if false; then + GL_COND_LIBTOOL_TRUE= + GL_COND_LIBTOOL_FALSE='#' +else + GL_COND_LIBTOOL_TRUE='#' + GL_COND_LIBTOOL_FALSE= +fi + + gl_cond_libtool=false + gl_libdeps= + gl_ltlibdeps= + gl_m4_base='m4' + + + + + + + + + + gl_source_base='lib' + + + if test $ac_cv_func_alloca_works = no; then + : + fi + + # Define an additional variable used in the Makefile substitution. + if test $ac_cv_working_alloca_h = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5 +printf %s "checking for alloca as a compiler built-in... " >&6; } +if test ${gl_cv_rpl_alloca+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined __GNUC__ || defined _AIX || defined _MSC_VER + Need own alloca +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "Need own alloca" >/dev/null 2>&1 +then : + gl_cv_rpl_alloca=yes +else case e in #( + e) gl_cv_rpl_alloca=no ;; +esac +fi +rm -rf conftest* + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5 +printf "%s\n" "$gl_cv_rpl_alloca" >&6; } + if test $gl_cv_rpl_alloca = yes; then + +printf "%s\n" "#define HAVE_ALLOCA 1" >>confdefs.h + + ALLOCA_H=alloca.h + else + ALLOCA_H= + fi + else + ALLOCA_H=alloca.h + fi + + if test -n "$ALLOCA_H"; then + GL_GENERATE_ALLOCA_H_TRUE= + GL_GENERATE_ALLOCA_H_FALSE='#' +else + GL_GENERATE_ALLOCA_H_TRUE='#' + GL_GENERATE_ALLOCA_H_FALSE= +fi + + + + + + + + + if test $ac_cv_func_btowc = no; then + HAVE_BTOWC=0 + else + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether btowc(0) is correct" >&5 +printf %s "checking whether btowc(0) is correct... " >&6; } +if test ${gl_cv_func_btowc_nul+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on Cygwin. + cygwin*) gl_cv_func_btowc_nul="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_nul="guessing yes" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (btowc ('\0') != 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_btowc_nul=yes +else case e in #( + e) gl_cv_func_btowc_nul=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_nul" >&5 +printf "%s\n" "$gl_cv_func_btowc_nul" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5 +printf %s "checking whether btowc(EOF) is correct... " >&6; } +if test ${gl_cv_func_btowc_eof+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + case "$host_os" in + # Guess no on IRIX. + irix*) gl_cv_func_btowc_eof="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_eof="guessing yes" ;; + esac + if test $LOCALE_FR != none; then + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (btowc (EOF) != WEOF) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_btowc_eof=yes +else case e in #( + e) gl_cv_func_btowc_eof=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5 +printf "%s\n" "$gl_cv_func_btowc_eof" >&6; } + + case "$gl_cv_func_btowc_nul" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + case "$gl_cv_func_btowc_eof" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + fi + + if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS btowc.$ac_objext" + + + : + + fi + + + + + + GNULIB_BTOWC=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_BTOWC 1" >>confdefs.h + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5 +printf %s "checking for __builtin_expect... " >&6; } +if test ${gl_cv___builtin_expect+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int + main (int argc, char **argv) + { + argc = __builtin_expect (argc, 100); + return argv[argc != 100][0]; + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv___builtin_expect=yes +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <builtins.h> + int + main (int argc, char **argv) + { + argc = __builtin_expect (argc, 100); + return argv[argc != 100][0]; + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv___builtin_expect="in <builtins.h>" +else case e in #( + e) gl_cv___builtin_expect=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5 +printf "%s\n" "$gl_cv___builtin_expect" >&6; } + if test "$gl_cv___builtin_expect" = yes; then + printf "%s\n" "#define HAVE___BUILTIN_EXPECT 1" >>confdefs.h + + elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then + printf "%s\n" "#define HAVE___BUILTIN_EXPECT 2" >>confdefs.h + + fi + + + + + + + # for STACK_DIRECTION + + + + ac_fn_check_decl "$LINENO" "sigaltstack" "ac_cv_have_decl_sigaltstack" "#include <signal.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_sigaltstack" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_SIGALTSTACK $ac_have_decl" >>confdefs.h + + + + + ac_fn_c_check_type "$LINENO" "stack_t" "ac_cv_type_stack_t" "#include <signal.h> +" +if test "x$ac_cv_type_stack_t" = xyes +then : + +printf "%s\n" "#define HAVE_STACK_T 1" >>confdefs.h + + +fi + + + if test "$gl_cv_lib_sigsegv" = yes \ + && test $"ac_cv_sys_xsi_stack_overflow_heuristic" != yes ; then + LIBCSTACK=$LIBSIGSEGV + + LTLIBCSTACK=$LTLIBSIGSEGV + + fi + + + + + + + # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. + # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. + + # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* + # programs in the package would end up linked with that potentially-shared + # library, inducing unnecessary run-time overhead. + LIB_CLOCK_GETTIME= + + gl_saved_libs=$LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 +printf %s "checking for library containing clock_gettime... " >&6; } +if test ${ac_cv_search_clock_gettime+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (void); +int +main (void) +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt posix4 +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_clock_gettime=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_clock_gettime+y} +then : + break +fi +done +if test ${ac_cv_search_clock_gettime+y} +then : + +else case e in #( + e) ac_cv_search_clock_gettime=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 +printf "%s\n" "$ac_cv_search_clock_gettime" >&6; } +ac_res=$ac_cv_search_clock_gettime +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ac_cv_search_clock_gettime" = "none required" || + LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime +fi + + ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" +if test "x$ac_cv_func_clock_gettime" = xyes +then : + printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "clock_settime" "ac_cv_func_clock_settime" +if test "x$ac_cv_func_clock_settime" = xyes +then : + printf "%s\n" "#define HAVE_CLOCK_SETTIME 1" >>confdefs.h + +fi + + LIBS=$gl_saved_libs + + + + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_CLOSE=1 + fi + + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then + REPLACE_CLOSE=1 + fi + + + + if test $REPLACE_CLOSE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext" + + fi + + + + + + GNULIB_CLOSE=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_CLOSE 1" >>confdefs.h + + + + + + if test "x$datarootdir" = x; then + datarootdir='${datadir}' + + fi + if test "x$docdir" = x; then + docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' + + fi + if test "x$htmldir" = x; then + htmldir='${docdir}' + + fi + if test "x$dvidir" = x; then + dvidir='${docdir}' + + fi + if test "x$pdfdir" = x; then + pdfdir='${docdir}' + + fi + if test "x$psdir" = x; then + psdir='${docdir}' + + fi + if test "x$lispdir" = x; then + lispdir='${datarootdir}/emacs/site-lisp' + + fi + if test "x$localedir" = x; then + localedir='${datarootdir}/locale' + + fi + if test "x$runstatedir" = x; then + runstatedir='${localstatedir}/run' + + fi + + pkglibexecdir='${libexecdir}/${PACKAGE}' + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_ctype_h='<'ctype.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <ctype.h>" >&5 +printf %s "checking absolute name of <ctype.h>... " >&6; } +if test ${gl_cv_next_ctype_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ctype.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'ctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_ctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_ctype_h + gl_cv_next_ctype_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_ctype_h" >&5 +printf "%s\n" "$gl_cv_next_ctype_h" >&6; } + fi + NEXT_CTYPE_H=$gl_cv_next_ctype_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'ctype.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_ctype_h + fi + NEXT_AS_FIRST_DIRECTIVE_CTYPE_H=$gl_next_as_first_directive + + + + + + + for gl_func in isblank; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ctype.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + +printf "%s\n" "#define GNULIB_DIRNAME 1" >>confdefs.h + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 +printf %s "checking whether // is distinct from /... " >&6; } +if test ${gl_cv_double_slash_root+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # <bug-gnulib@gnu.org>. + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + gl_cv_double_slash_root='unknown, assuming no' ;; + esac + else + set x `ls -di / // 2>/dev/null` + if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 +printf "%s\n" "$gl_cv_double_slash_root" >&6; } + if test "$gl_cv_double_slash_root" = yes; then + +printf "%s\n" "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h + + fi + + + + + + +printf "%s\n" "#define HAVE_DUP2 1" >>confdefs.h + + + if test $HAVE_DUP2 = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5 +printf %s "checking whether dup2 works... " >&6; } +if test ${gl_cv_func_dup2_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + mingw*) # on this platform, dup2 always returns 0 for success + gl_cv_func_dup2_works="guessing no" ;; + cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 + gl_cv_func_dup2_works="guessing no" ;; + aix* | freebsd*) + # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE, + # not EBADF. + gl_cv_func_dup2_works="guessing no" ;; + haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. + gl_cv_func_dup2_works="guessing no" ;; + *-android*) # implemented using dup3(), which fails if oldfd == newfd + gl_cv_func_dup2_works="guessing no" ;; + os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd. + gl_cv_func_dup2_works="guessing no" ;; + *) gl_cv_func_dup2_works="guessing yes" ;; + esac +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <errno.h> + #include <fcntl.h> + #include <limits.h> + #include <sys/resource.h> + #include <unistd.h> + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + +int +main (void) +{ +int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + #ifdef FD_CLOEXEC + if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) + result |= 1; + #endif + if (dup2 (1, 1) != 1) + result |= 2; + #ifdef FD_CLOEXEC + if (fcntl (1, F_GETFD) != FD_CLOEXEC) + result |= 4; + #endif + close (0); + if (dup2 (0, 0) != -1) + result |= 8; + /* Many gnulib modules require POSIX conformance of EBADF. */ + if (dup2 (2, bad_fd) == -1 && errno != EBADF) + result |= 16; + /* Flush out some cygwin core dumps. */ + if (dup2 (2, -1) != -1 || errno != EBADF) + result |= 32; + dup2 (2, 255); + dup2 (2, 256); + /* On OS/2 kLIBC, dup2() does not work on a directory fd. */ + { + int fd = open (".", O_RDONLY); + if (fd == -1) + result |= 64; + else if (dup2 (fd, fd + 1) == -1) + result |= 128; + + close (fd); + } + return result; + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_dup2_works=yes +else case e in #( + e) gl_cv_func_dup2_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5 +printf "%s\n" "$gl_cv_func_dup2_works" >&6; } + case "$gl_cv_func_dup2_works" in + *yes) ;; + *) + REPLACE_DUP2=1 + ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize" +if test "x$ac_cv_func_setdtablesize" = xyes +then : + printf "%s\n" "#define HAVE_SETDTABLESIZE 1" >>confdefs.h + +fi + + ;; + esac + fi + + + if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext" + + + fi + + + + + + GNULIB_DUP2=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_DUP2 1" >>confdefs.h + + + + + + + + + + GNULIB_ENVIRON=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 +printf %s "checking for error_at_line... " >&6; } +if test ${ac_cv_lib_error_at_line+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <error.h> +int +main (void) +{ +error_at_line (0, 0, "", 0, "an error occurred"); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_error_at_line=yes +else case e in #( + e) ac_cv_lib_error_at_line=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 +printf "%s\n" "$ac_cv_lib_error_at_line" >&6; } + + if test $ac_cv_lib_error_at_line = no; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext" + + + + : + + fi + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error:3:c-format" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error_at_line:5:c-format" + + + + + + + + if test $ac_cv_func_fcntl = no; then + + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5 +printf %s "checking whether fcntl handles F_DUPFD correctly... " >&6; } +if test ${gl_cv_func_fcntl_f_dupfd_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + case $host_os in + aix* | cygwin* | haiku*) + gl_cv_func_fcntl_f_dupfd_works="guessing no" ;; + *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;; + esac +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <errno.h> + #include <fcntl.h> + #include <limits.h> + #include <sys/resource.h> + #include <unistd.h> + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + +int +main (void) +{ +int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + if (fcntl (0, F_DUPFD, -1) != -1) result |= 1; + if (errno != EINVAL) result |= 2; + if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4; + if (errno != EINVAL) result |= 8; + /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */ + { + int fd; + fd = open (".", O_RDONLY); + if (fd == -1) + result |= 16; + else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1) + result |= 32; + + close (fd); + } + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_fcntl_f_dupfd_works=yes +else case e in #( + e) gl_cv_func_fcntl_f_dupfd_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5 +printf "%s\n" "$gl_cv_func_fcntl_f_dupfd_works" >&6; } + case $gl_cv_func_fcntl_f_dupfd_works in + *yes) ;; + *) + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + +printf "%s\n" "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5 +printf %s "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; } +if test ${gl_cv_func_fcntl_f_dupfd_cloexec+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <fcntl.h> +#ifndef F_DUPFD_CLOEXEC +choke me +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __linux__ +/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace + it to support the semantics on older kernels that failed with EINVAL. */ +choke me +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_fcntl_f_dupfd_cloexec=yes +else case e in #( + e) gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +else case e in #( + e) gl_cv_func_fcntl_f_dupfd_cloexec=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5 +printf "%s\n" "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; } + if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then + + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + fi + fi + + + if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext" + + fi + + + + + + GNULIB_FCNTL=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_FCNTL 1" >>confdefs.h + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_fcntl_h='<'fcntl.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5 +printf %s "checking absolute name of <fcntl.h>... " >&6; } +if test ${gl_cv_next_fcntl_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <fcntl.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'fcntl.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_fcntl_h + gl_cv_next_fcntl_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5 +printf "%s\n" "$gl_cv_next_fcntl_h" >&6; } + fi + NEXT_FCNTL_H=$gl_cv_next_fcntl_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'fcntl.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_fcntl_h + fi + NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive + + + + + + + + + + + for gl_func in fcntl openat; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <fcntl.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + +printf "%s\n" "#define GNULIB_FILENAMECAT 1" >>confdefs.h + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5 +printf %s "checking for flexible array member... " >&6; } +if test ${ac_cv_c_flexmember+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + #include <stdio.h> + #include <stddef.h> + struct m { struct m *next, **list; char name[]; }; + struct s { struct s *p; struct m *m; int n; double d[]; }; +int +main (void) +{ +int m = getchar (); + size_t nbytes = offsetof (struct s, d) + m * sizeof (double); + nbytes += sizeof (struct s) - 1; + nbytes -= nbytes % sizeof (struct s); + struct s *p = malloc (nbytes); + p->p = p; + p->m = NULL; + p->d[0] = 0.0; + return p->d != (double *) NULL; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_flexmember=yes +else case e in #( + e) ac_cv_c_flexmember=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5 +printf "%s\n" "$ac_cv_c_flexmember" >&6; } + if test $ac_cv_c_flexmember = yes; then + +printf "%s\n" "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h + + else + printf "%s\n" "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h + + fi + + + + + FLOAT_H= + REPLACE_FLOAT_LDBL=0 + case "$host_os" in + aix* | beos* | openbsd* | mirbsd* | irix*) + FLOAT_H=float.h + ;; + freebsd*) + case "$host_cpu" in + i[34567]86 ) + FLOAT_H=float.h + ;; + x86_64 ) + # On x86_64 systems, the C compiler may still be generating + # 32-bit code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ || defined __x86_64__ || defined __amd64__ + yes + #endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + +else case e in #( + e) FLOAT_H=float.h ;; +esac +fi +rm -rf conftest* + + ;; + esac + ;; + linux*) + case "$host_cpu" in + powerpc*) + FLOAT_H=float.h + ;; + esac + ;; + esac + case "$host_os" in + aix* | freebsd* | linux*) + if test -n "$FLOAT_H"; then + REPLACE_FLOAT_LDBL=1 + fi + ;; + esac + + REPLACE_ITOLD=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5 +printf %s "checking whether conversion from 'int' to 'long double' works... " >&6; } +if test ${gl_cv_func_itold_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test "$cross_compiling" = yes +then : + case "$host" in + sparc*-*-linux*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ || defined __arch64__ + yes + #endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +then : + gl_cv_func_itold_works="guessing no" +else case e in #( + e) gl_cv_func_itold_works="guessing yes" ;; +esac +fi +rm -rf conftest* + + ;; + *) gl_cv_func_itold_works="guessing yes" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int i = -1; +volatile long double ld; +int main () +{ + ld += i * 1.0L; + if (ld > 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_itold_works=yes +else case e in #( + e) gl_cv_func_itold_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5 +printf "%s\n" "$gl_cv_func_itold_works" >&6; } + case "$gl_cv_func_itold_works" in + *no) + REPLACE_ITOLD=1 + FLOAT_H=float.h + ;; + esac + + if test -n "$FLOAT_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_float_h='<'float.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5 +printf %s "checking absolute name of <float.h>... " >&6; } +if test ${gl_cv_next_float_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <float.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'float.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_float_h + gl_cv_next_float_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5 +printf "%s\n" "$gl_cv_next_float_h" >&6; } + fi + NEXT_FLOAT_H=$gl_cv_next_float_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'float.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_float_h + fi + NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive + + + + + fi + + if test -n "$FLOAT_H"; then + GL_GENERATE_FLOAT_H_TRUE= + GL_GENERATE_FLOAT_H_FALSE='#' +else + GL_GENERATE_FLOAT_H_TRUE='#' + GL_GENERATE_FLOAT_H_FALSE= +fi + + + + if test $REPLACE_FLOAT_LDBL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext" + + fi + if test $REPLACE_ITOLD = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext" + + fi + + + + + + FNMATCH_H= + gl_fnmatch_required_lowercase=` + echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]' + ` + gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5 +printf %s "checking for working $gl_fnmatch_required fnmatch... " >&6; } +if eval test \${$gl_fnmatch_cache_var+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test $gl_fnmatch_required = GNU; then + gl_fnmatch_gnu_start= + gl_fnmatch_gnu_end= + else + gl_fnmatch_gnu_start='#if 0' + gl_fnmatch_gnu_end='#endif' + fi + if test "$cross_compiling" = yes +then : + eval "$gl_fnmatch_cache_var=\"guessing no\"" +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <fnmatch.h> + static int + y (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == 0; + } + static int + n (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == FNM_NOMATCH; + } + +int +main (void) +{ +char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]"; + char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]"; + static char const A_1[] = { 'A' - 1, 0 }; + static char const A01[] = { 'A' + 1, 0 }; + static char const a_1[] = { 'a' - 1, 0 }; + static char const a01[] = { 'a' + 1, 0 }; + static char const bs_1[] = { '\\\\' - 1, 0 }; + static char const bs01[] = { '\\\\' + 1, 0 }; + int result = 0; + if (!n ("a*", "", 0)) + return 1; + if (!y ("a*", "abc", 0)) + return 1; + if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */ + return 1; + if (!n ("d*/*1", "d/s/1", FNM_PATHNAME)) + return 2; + if (!y ("a\\\\bc", "abc", 0)) + return 3; + if (!n ("a\\\\bc", "abc", FNM_NOESCAPE)) + return 3; + if (!y ("*x", ".x", 0)) + return 4; + if (!n ("*x", ".x", FNM_PERIOD)) + return 4; + if (!y (Apat, "\\\\", 0)) + return 5; + if (!y (Apat, "A", 0)) + return 5; + if (!y (apat, "\\\\", 0)) + return 5; + if (!y (apat, "a", 0)) + return 5; + if (!(n (Apat, A_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, a_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, A01, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, a01, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, bs_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, bs_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(n (Apat, bs01, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, bs01, 0) == ('a' < '\\\\'))) + return 5; + $gl_fnmatch_gnu_start + if (!y ("xxXX", "xXxX", FNM_CASEFOLD)) + result |= 8; + if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)) + result |= 16; + if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME)) + result |= 32; + if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + $gl_fnmatch_gnu_end + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + eval "$gl_fnmatch_cache_var=yes" +else case e in #( + e) eval "$gl_fnmatch_cache_var=no" ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +eval ac_res=\$$gl_fnmatch_cache_var + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\"" + if test "$gl_fnmatch_result" = yes; then + rm -f "$gl_source_base/fnmatch.h" + else + FNMATCH_H=fnmatch.h + fi + + if test -n "$FNMATCH_H"; then + GL_GENERATE_FNMATCH_H_TRUE= + GL_GENERATE_FNMATCH_H_FALSE='#' +else + GL_GENERATE_FNMATCH_H_TRUE='#' + GL_GENERATE_FNMATCH_H_FALSE= +fi + + + if test -n "$FNMATCH_H"; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" + + + +printf "%s\n" "#define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch" >>confdefs.h + + + ac_fn_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_isblank" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h + + + + + fi + + + + + + if test -n "$FNMATCH_H"; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" + + + +printf "%s\n" "#define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch" >>confdefs.h + + + ac_fn_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_isblank" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h + + + + + fi + + + + case "$host_os" in + mingw* | pw* | os2*) + REPLACE_FREOPEN=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether freopen works on closed fds" >&5 +printf %s "checking whether freopen works on closed fds... " >&6; } +if test ${gl_cv_func_freopen_works_on_closed+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + case $host_os in + *gnu*) gl_cv_func_freopen_works_on_closed="guessing no" ;; + *) gl_cv_func_freopen_works_on_closed="guessing yes";; + esac +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> + #include <unistd.h> + +int +main (void) +{ +close (0); + return !(freopen ("/dev/null", "r", stdin) + && getchar () == EOF + && !ferror (stdin) && feof (stdin)); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_freopen_works_on_closed=yes +else case e in #( + e) gl_cv_func_freopen_works_on_closed=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_freopen_works_on_closed" >&5 +printf "%s\n" "$gl_cv_func_freopen_works_on_closed" >&6; } + case $gl_cv_func_freopen_works_on_closed in + *no) REPLACE_FREOPEN=1;; + esac + esac + + if test $REPLACE_FREOPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS freopen.$ac_objext" + + : + fi + + + + + + GNULIB_FREOPEN=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_FREOPEN 1" >>confdefs.h + + + + + +printf "%s\n" "#define GNULIB_FREOPEN_SAFER 1" >>confdefs.h + + + + + + + case "$host_os" in + mingw*) + REPLACE_FSTAT=1 + ;; + esac + + + + if test $REPLACE_FSTAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" + + + + : + + fi + + + + + + GNULIB_FSTAT=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_FSTAT 1" >>confdefs.h + + + + + + + + + if test $ac_cv_func_getdtablesize = yes && + test $ac_cv_have_decl_getdtablesize = yes; then + # Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft limit + # up to an unchangeable hard limit; all other platforms correctly + # require setrlimit before getdtablesize() can report a larger value. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5 +printf %s "checking whether getdtablesize works... " >&6; } +if test ${gl_cv_func_getdtablesize_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows + gl_cv_func_getdtablesize_works="guessing no" ;; + *) gl_cv_func_getdtablesize_works="guessing yes" ;; + esac +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <unistd.h> +int +main (void) +{ +int size = getdtablesize(); + if (dup2 (0, getdtablesize()) != -1) + return 1; + if (size != getdtablesize()) + return 2; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getdtablesize_works=yes +else case e in #( + e) gl_cv_func_getdtablesize_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5 +printf "%s\n" "$gl_cv_func_getdtablesize_works" >&6; } + case "$gl_cv_func_getdtablesize_works" in + *yes) ;; + *) REPLACE_GETDTABLESIZE=1 ;; + esac + else + HAVE_GETDTABLESIZE=0 + fi + + if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext" + + : + fi + + + + + + GNULIB_GETDTABLESIZE=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h + + + + + + + + + + + + + REPLACE_GETOPT=0 + if test -n "$gl_replace_getopt"; then + REPLACE_GETOPT=1 + fi + + if test $REPLACE_GETOPT = 1; then + + + if test $ac_cv_header_sys_cdefs_h = yes; then + HAVE_SYS_CDEFS_H=1 + else + HAVE_SYS_CDEFS_H=0 + fi + + + +printf "%s\n" "#define __GETOPT_PREFIX rpl_" >>confdefs.h + + GETOPT_H=getopt.h + GETOPT_CDEFS_H=getopt-cdefs.h + + + + fi + + if test $REPLACE_GETOPT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" + + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + + + + + ac_found=0 + ac_fn_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_program_invocation_name" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + ac_found=1 +fi + + ac_fn_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + ac_found=1 +fi + + ac_fn_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include <stdlib.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl___argv" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL___ARGV $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + ac_found=1 +fi + + + # Incur the cost of this test only if none of the above worked. + if test $ac_found = 0; then + # On OpenBSD 5.1, using the global __progname variable appears to be + # the only way to implement getprogname. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5 +printf %s "checking whether __progname is defined in default libraries... " >&6; } +if test ${gl_cv_var___progname+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_cv_var___progname= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char *__progname; +int +main (void) +{ +return *__progname; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_var___progname=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5 +printf "%s\n" "$gl_cv_var___progname" >&6; } + if test "$gl_cv_var___progname" = yes; then + +printf "%s\n" "#define HAVE_VAR___PROGNAME 1" >>confdefs.h + + fi + fi + + + + + + + + + + + + + + + + gl_gettimeofday_timezone=void + if test $ac_cv_func_gettimeofday != yes; then + HAVE_GETTIMEOFDAY=0 + else + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5 +printf %s "checking whether gettimeofday clobbers localtime buffer... " >&6; } +if test ${gl_cv_func_gettimeofday_clobber+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + # When cross-compiling: + case "$host_os" in + # Guess all is fine on glibc systems. + *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_gettimeofday_clobber="guessing yes" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + #include <sys/time.h> + #include <time.h> + #include <stdlib.h> + +int +main (void) +{ + + time_t t = 0; + struct tm *lt; + struct tm saved_lt; + struct timeval tv; + lt = localtime (&t); + saved_lt = *lt; + gettimeofday (&tv, NULL); + return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_gettimeofday_clobber=no +else case e in #( + e) gl_cv_func_gettimeofday_clobber=yes ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5 +printf "%s\n" "$gl_cv_func_gettimeofday_clobber" >&6; } + + case "$gl_cv_func_gettimeofday_clobber" in + *yes) + REPLACE_GETTIMEOFDAY=1 + +printf "%s\n" "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h + + + + + NEED_LOCALTIME_BUFFER=1 + REPLACE_GMTIME=1 + REPLACE_LOCALTIME=1 + + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5 +printf %s "checking for gettimeofday with POSIX signature... " >&6; } +if test ${gl_cv_func_gettimeofday_posix_signature+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/time.h> + struct timeval c; + int gettimeofday (struct timeval *restrict, void *restrict); + +int +main (void) +{ +/* glibc uses struct timezone * rather than the POSIX void * + if _GNU_SOURCE is defined. However, since the only portable + use of gettimeofday uses NULL as the second parameter, and + since the glibc definition is actually more typesafe, it is + not worth wrapping this to get a compliant signature. */ + int (*f) (struct timeval *restrict, void *restrict) + = gettimeofday; + int x = f (&c, 0); + return !(x | c.tv_sec | c.tv_usec); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_gettimeofday_posix_signature=yes +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/time.h> +int gettimeofday (struct timeval *restrict, struct timezone *restrict); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_gettimeofday_posix_signature=almost +else case e in #( + e) gl_cv_func_gettimeofday_posix_signature=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_gettimeofday_posix_signature" >&6; } + if test $gl_cv_func_gettimeofday_posix_signature = almost; then + gl_gettimeofday_timezone='struct timezone' + elif test $gl_cv_func_gettimeofday_posix_signature != yes; then + REPLACE_GETTIMEOFDAY=1 + fi + if test $REPLACE_STRUCT_TIMEVAL = 1; then + REPLACE_GETTIMEOFDAY=1 + fi + case "$host_os" in + mingw*) REPLACE_GETTIMEOFDAY=1 ;; + esac + fi + +printf "%s\n" "#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone" >>confdefs.h + + + if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" + + : + fi + + + + + + GNULIB_GETTIMEOFDAY=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h + + + + + if ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then + GNU_MAKE_TRUE= + GNU_MAKE_FALSE='#' +else + GNU_MAKE_TRUE='#' + GNU_MAKE_FALSE= +fi + + + # Autoconf 2.61a.99 and earlier don't support linking a file only + # in VPATH builds. But since GNUmakefile is for maintainer use + # only, it does not matter if we skip the link with older autoconf. + # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH + # builds, so use a shell variable to bypass this. + GNUmakefile=GNUmakefile + ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile" + + + : + + + + + + + + GNULIB_ICONV=1 + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_iconv_h='<'iconv.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <iconv.h>" >&5 +printf %s "checking absolute name of <iconv.h>... " >&6; } +if test ${gl_cv_next_iconv_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_iconv_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <iconv.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'iconv.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_iconv_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_iconv_h + gl_cv_next_iconv_h='"'$gl_header'"' + else + gl_cv_next_iconv_h='<'iconv.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_iconv_h" >&5 +printf "%s\n" "$gl_cv_next_iconv_h" >&6; } + fi + NEXT_ICONV_H=$gl_cv_next_iconv_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'iconv.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_iconv_h + fi + NEXT_AS_FIRST_DIRECTIVE_ICONV_H=$gl_next_as_first_directive + + + + + + + + + + if test "$am_cv_func_iconv" = yes; then + + + ICONV_H='iconv.h' + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <iconv.h> + #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__) + gnu_iconv + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "gnu_iconv" >/dev/null 2>&1 +then : + gl_func_iconv_gnu=yes +else case e in #( + e) gl_func_iconv_gnu=no ;; +esac +fi +rm -rf conftest* + + if test $gl_func_iconv_gnu = no; then + iconv_flavor= + case "$host_os" in + aix*) iconv_flavor=ICONV_FLAVOR_AIX ;; + irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;; + hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;; + osf*) iconv_flavor=ICONV_FLAVOR_OSF ;; + solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;; + esac + if test -n "$iconv_flavor"; then + +printf "%s\n" "#define ICONV_FLAVOR $iconv_flavor" >>confdefs.h + + + + + ICONV_H='iconv.h' + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + + + REPLACE_ICONV_OPEN=1 + + fi + fi + + fi + + if test $REPLACE_ICONV_OPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv_open.$ac_objext" + + fi + if test $REPLACE_ICONV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv_close.$ac_objext" + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler generally respects inline" >&5 +printf %s "checking whether the compiler generally respects inline... " >&6; } +if test ${gl_cv_c_inline_effective+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test $ac_cv_c_inline = no; then + gl_cv_c_inline_effective=no + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifdef __NO_INLINE__ + #error "inline is not effective" + #endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_c_inline_effective=yes +else case e in #( + e) gl_cv_c_inline_effective=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_inline_effective" >&5 +printf "%s\n" "$gl_cv_c_inline_effective" >&6; } + if test $gl_cv_c_inline_effective = yes; then + +printf "%s\n" "#define HAVE_INLINE 1" >>confdefs.h + + fi + + + + + : + + : + : + : + : + + + + + + + PRIPTR_PREFIX= + if test -n "$STDINT_H"; then + PRIPTR_PREFIX='"l"' + else + for glpfx in '' l ll I64; do + case $glpfx in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + I64) gltype1='__int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdint.h> + extern intptr_t foo; + extern $gltype1 foo; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + PRIPTR_PREFIX='"'$glpfx'"' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test -n "$PRIPTR_PREFIX" && break + done + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5 +printf %s "checking whether INT32_MAX < INTMAX_MAX... " >&6; } +if test ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include <limits.h> + #if HAVE_STDINT_H + #include <stdint.h> + #endif + + #if defined INT32_MAX && defined INTMAX_MAX + #define CONDITION (INT32_MAX < INTMAX_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (int) < sizeof (long long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes +else case e in #( + e) gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5 +printf "%s\n" "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; } + if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then + INT32_MAX_LT_INTMAX_MAX=1; + else + INT32_MAX_LT_INTMAX_MAX=0; + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5 +printf %s "checking whether INT64_MAX == LONG_MAX... " >&6; } +if test ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include <limits.h> + #if HAVE_STDINT_H + #include <stdint.h> + #endif + + #if defined INT64_MAX + #define CONDITION (INT64_MAX == LONG_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (long long int) == sizeof (long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes +else case e in #( + e) gl_cv_test_INT64_MAX_EQ_LONG_MAX=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5 +printf "%s\n" "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; } + if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then + INT64_MAX_EQ_LONG_MAX=1; + else + INT64_MAX_EQ_LONG_MAX=0; + fi + + + else + INT64_MAX_EQ_LONG_MAX=-1 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5 +printf %s "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; } +if test ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include <limits.h> + #if HAVE_STDINT_H + #include <stdint.h> + #endif + + #if defined UINT32_MAX && defined UINTMAX_MAX + #define CONDITION (UINT32_MAX < UINTMAX_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes +else case e in #( + e) gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5 +printf "%s\n" "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; } + if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then + UINT32_MAX_LT_UINTMAX_MAX=1; + else + UINT32_MAX_LT_UINTMAX_MAX=0; + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5 +printf %s "checking whether UINT64_MAX == ULONG_MAX... " >&6; } +if test ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include <limits.h> + #if HAVE_STDINT_H + #include <stdint.h> + #endif + + #if defined UINT64_MAX + #define CONDITION (UINT64_MAX == ULONG_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes +else case e in #( + e) gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5 +printf "%s\n" "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; } + if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then + UINT64_MAX_EQ_ULONG_MAX=1; + else + UINT64_MAX_EQ_ULONG_MAX=0; + fi + + + else + UINT64_MAX_EQ_ULONG_MAX=-1 + fi + + + + + + + + + if test $ac_cv_func_isblank = no; then + HAVE_ISBLANK=0 + fi + + if test $HAVE_ISBLANK = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS isblank.$ac_objext" + + fi + + + + + + GNULIB_ISBLANK=1 + + + + + + + + + + ac_fn_check_decl "$LINENO" "iswblank" "ac_cv_have_decl_iswblank" " +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +#include <wctype.h> + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_iswblank" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_ISWBLANK $ac_have_decl" >>confdefs.h + + if test $ac_cv_func_iswblank = no; then + HAVE_ISWBLANK=0 + if test $ac_cv_have_decl_iswblank = yes; then + REPLACE_ISWBLANK=1 + fi + fi + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + : + fi + fi + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iswblank.$ac_objext" + + fi + fi + + + + + + GNULIB_ISWBLANK=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_ISWBLANK 1" >>confdefs.h + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_langinfo_h='<'langinfo.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <langinfo.h>" >&5 +printf %s "checking absolute name of <langinfo.h>... " >&6; } +if test ${gl_cv_next_langinfo_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_langinfo_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'langinfo.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_langinfo_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_langinfo_h + gl_cv_next_langinfo_h='"'$gl_header'"' + else + gl_cv_next_langinfo_h='<'langinfo.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_langinfo_h" >&5 +printf "%s\n" "$gl_cv_next_langinfo_h" >&6; } + fi + NEXT_LANGINFO_H=$gl_cv_next_langinfo_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'langinfo.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_langinfo_h + fi + NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H=$gl_next_as_first_directive + + + + + + HAVE_LANGINFO_CODESET=0 + HAVE_LANGINFO_T_FMT_AMPM=0 + HAVE_LANGINFO_ERA=0 + HAVE_LANGINFO_YESEXPR=0 + + if test $ac_cv_header_langinfo_h = yes; then + HAVE_LANGINFO_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines CODESET" >&5 +printf %s "checking whether langinfo.h defines CODESET... " >&6; } +if test ${gl_cv_header_langinfo_codeset+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> +int a = CODESET; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_codeset=yes +else case e in #( + e) gl_cv_header_langinfo_codeset=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_codeset" >&5 +printf "%s\n" "$gl_cv_header_langinfo_codeset" >&6; } + if test $gl_cv_header_langinfo_codeset = yes; then + HAVE_LANGINFO_CODESET=1 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines T_FMT_AMPM" >&5 +printf %s "checking whether langinfo.h defines T_FMT_AMPM... " >&6; } +if test ${gl_cv_header_langinfo_t_fmt_ampm+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> +int a = T_FMT_AMPM; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_t_fmt_ampm=yes +else case e in #( + e) gl_cv_header_langinfo_t_fmt_ampm=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_t_fmt_ampm" >&5 +printf "%s\n" "$gl_cv_header_langinfo_t_fmt_ampm" >&6; } + if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then + HAVE_LANGINFO_T_FMT_AMPM=1 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ERA" >&5 +printf %s "checking whether langinfo.h defines ERA... " >&6; } +if test ${gl_cv_header_langinfo_era+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> +int a = ERA; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_era=yes +else case e in #( + e) gl_cv_header_langinfo_era=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_era" >&5 +printf "%s\n" "$gl_cv_header_langinfo_era" >&6; } + if test $gl_cv_header_langinfo_era = yes; then + HAVE_LANGINFO_ERA=1 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines YESEXPR" >&5 +printf %s "checking whether langinfo.h defines YESEXPR... " >&6; } +if test ${gl_cv_header_langinfo_yesexpr+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> +int a = YESEXPR; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_yesexpr=yes +else case e in #( + e) gl_cv_header_langinfo_yesexpr=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_yesexpr" >&5 +printf "%s\n" "$gl_cv_header_langinfo_yesexpr" >&6; } + if test $gl_cv_header_langinfo_yesexpr = yes; then + HAVE_LANGINFO_YESEXPR=1 + fi + else + HAVE_LANGINFO_H=0 + fi + + + + + + + + for gl_func in nl_langinfo; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libsigsegv-prefix was given. +if test ${with_libsigsegv_prefix+y} +then : + withval=$with_libsigsegv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBSIGSEGV= + LTLIBSIGSEGV= + INCSIGSEGV= + LIBSIGSEGV_PREFIX= + HAVE_LIBSIGSEGV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='sigsegv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_a" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCSIGSEGV="${INCSIGSEGV}${INCSIGSEGV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$dep" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$dep" + ;; + esac + done + fi + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-R$found_dir" + done + fi + + + + + + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCSIGSEGV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsigsegv" >&5 +printf %s "checking for libsigsegv... " >&6; } +if test ${ac_cv_libsigsegv+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + ac_save_LIBS="$LIBS" + case " $LIBSIGSEGV" in + *" -l"*) LIBS="$LIBS $LIBSIGSEGV" ;; + *) LIBS="$LIBSIGSEGV $LIBS" ;; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sigsegv.h> +int +main (void) +{ +sigsegv_deinstall_handler(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libsigsegv=yes +else case e in #( + e) ac_cv_libsigsegv='no, consider installing GNU libsigsegv' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libsigsegv" >&5 +printf "%s\n" "$ac_cv_libsigsegv" >&6; } + if test "$ac_cv_libsigsegv" = yes; then + HAVE_LIBSIGSEGV=yes + +printf "%s\n" "#define HAVE_LIBSIGSEGV 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libsigsegv" >&5 +printf %s "checking how to link with libsigsegv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBSIGSEGV" >&5 +printf "%s\n" "$LIBSIGSEGV" >&6; } + else + HAVE_LIBSIGSEGV=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBSIGSEGV= + LTLIBSIGSEGV= + LIBSIGSEGV_PREFIX= + fi + + + + + + + + gl_cv_lib_sigsegv="$ac_cv_libsigsegv" + + + + + + + + + + + LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" + + + + + + + + + + case "$host_os" in + solaris*) + +printf "%s\n" "#define _LCONV_C99 1" >>confdefs.h + + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5 +printf %s "checking whether locale.h conforms to POSIX:2001... " >&6; } +if test ${gl_cv_header_locale_h_posix2001+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <locale.h> + int x = LC_MESSAGES; + int y = sizeof (((struct lconv *) 0)->decimal_point); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_locale_h_posix2001=yes +else case e in #( + e) gl_cv_header_locale_h_posix2001=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5 +printf "%s\n" "$gl_cv_header_locale_h_posix2001" >&6; } + + + if test $ac_cv_header_xlocale_h = yes; then + HAVE_XLOCALE_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5 +printf %s "checking whether locale.h defines locale_t... " >&6; } +if test ${gl_cv_header_locale_has_locale_t+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <locale.h> + locale_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_locale_has_locale_t=yes +else case e in #( + e) gl_cv_header_locale_has_locale_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5 +printf "%s\n" "$gl_cv_header_locale_has_locale_t" >&6; } + if test $gl_cv_header_locale_has_locale_t = yes; then + gl_cv_header_locale_h_needs_xlocale_h=no + else + gl_cv_header_locale_h_needs_xlocale_h=yes + fi + else + HAVE_XLOCALE_H=0 + gl_cv_header_locale_h_needs_xlocale_h=no + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5 +printf %s "checking whether struct lconv is properly defined... " >&6; } +if test ${gl_cv_sys_struct_lconv_ok+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <locale.h> + struct lconv l; + int x = sizeof (l.decimal_point); + int y = sizeof (l.int_p_cs_precedes); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_lconv_ok=yes +else case e in #( + e) gl_cv_sys_struct_lconv_ok=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5 +printf "%s\n" "$gl_cv_sys_struct_lconv_ok" >&6; } + if test $gl_cv_sys_struct_lconv_ok = no; then + REPLACE_STRUCT_LCONV=1 + fi + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_locale_h='<'locale.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <locale.h>" >&5 +printf %s "checking absolute name of <locale.h>... " >&6; } +if test ${gl_cv_next_locale_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <locale.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'locale.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_locale_h + gl_cv_next_locale_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5 +printf "%s\n" "$gl_cv_next_locale_h" >&6; } + fi + NEXT_LOCALE_H=$gl_cv_next_locale_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'locale.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_locale_h + fi + NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive + + + + + + + for gl_func in setlocale duplocale; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <locale.h> +/* Some systems provide declarations in a non-standard header. */ +#if HAVE_XLOCALE_H +# include <xlocale.h> +#endif + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + if test $REPLACE_STRUCT_LCONV = 1; then + REPLACE_LOCALECONV=1 + fi + + if test $REPLACE_LOCALECONV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS localeconv.$ac_objext" + + + ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include <locale.h> +" +if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1" >>confdefs.h + + +fi + + + fi + + + + + + GNULIB_LOCALECONV=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_LOCALECONV 1" >>confdefs.h + + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS localtime-buffer.$ac_objext" + + + + + if test $ac_cv_func_lstat = yes; then + + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *no) + REPLACE_LSTAT=1 + ;; + esac + else + HAVE_LSTAT=0 + fi + + if test $REPLACE_LSTAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext" + + : + fi + + + + + + GNULIB_LSTAT=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_LSTAT 1" >>confdefs.h + + + + + + + + + if test $gl_cv_func_malloc_posix = yes; then + +printf "%s\n" "#define HAVE_MALLOC_POSIX 1" >>confdefs.h + + else + REPLACE_MALLOC=1 + fi + + if test $REPLACE_MALLOC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" + + fi + + + + + + GNULIB_MALLOC_POSIX=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h + + + + + + + + + + + + + : + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else case e in #( + e) gl_cv_func_mbrtowc_incomplete_state=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else case e in #( + e) gl_cv_func_mbrtowc_sanitycheck=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_mbrtowc = no; then + HAVE_MBRTOWC=0 + ac_fn_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" " +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_mbrtowc" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_MBRTOWC $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_mbrtowc = yes; then + REPLACE_MBRTOWC=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBRTOWC=1 + else + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5 +printf %s "checking whether mbrtowc handles a NULL pwc argument... " >&6; } +if test ${gl_cv_func_mbrtowc_null_arg1+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + case "$host_os" in + # Guess no on Solaris. + solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none; then + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + int result = 0; + + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "\303\237er"; + mbstate_t state; + wchar_t wc; + size_t ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 5, &state); + if (ret != 2) + result |= 1; + if (!mbsinit (&state)) + result |= 2; + + memset (&state, '\0', sizeof (mbstate_t)); + ret = mbrtowc (NULL, input, 5, &state); + if (ret != 2) /* Solaris 7 fails here: ret is -1. */ + result |= 4; + if (!mbsinit (&state)) + result |= 8; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_null_arg1=yes +else case e in #( + e) gl_cv_func_mbrtowc_null_arg1=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_null_arg1" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5 +printf %s "checking whether mbrtowc handles a NULL string argument... " >&6; } +if test ${gl_cv_func_mbrtowc_null_arg2+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + case "$host_os" in + # Guess no on OSF/1. + osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none; then + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + mbstate_t state; + wchar_t wc; + int ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + mbrtowc (&wc, NULL, 5, &state); + /* Check that wc was not modified. */ + if (wc != (wchar_t) 0xBADFACE) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_null_arg2=yes +else case e in #( + e) gl_cv_func_mbrtowc_null_arg2=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_null_arg2" >&6; } + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5 +printf %s "checking whether mbrtowc has a correct return value... " >&6; } +if test ${gl_cv_func_mbrtowc_retval+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + case "$host_os" in + # Guess no on HP-UX, Solaris, native Windows. + hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_retval="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \ + || { case "$host_os" in mingw*) true;; *) false;; esac; }; then + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + int result = 0; + int found_some_locale = 0; + /* This fails on Solaris. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "B\303\274\303\237er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 1) + result |= 1; + } + found_some_locale = 1; + } + /* This fails on HP-UX 11.11. */ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 2) + result |= 2; + } + found_some_locale = 1; + } + /* This fails on native Windows. */ + if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) + { + char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 4; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) + { + char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 8; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_China.936") != NULL) + { + char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 16; + } + found_some_locale = 1; + } + return (found_some_locale ? result : 77); +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_retval=yes +else case e in #( + e) if test $? != 77; then + gl_cv_func_mbrtowc_retval=no + fi + ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_retval" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5 +printf %s "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; } +if test ${gl_cv_func_mbrtowc_nul_retval+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + case "$host_os" in + # Guess no on Solaris 8 and 9. + solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris 8 and 9. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, "", 1, &state) != 0) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_nul_retval=yes +else case e in #( + e) gl_cv_func_mbrtowc_nul_retval=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_nul_retval" >&6; } + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5 +printf %s "checking whether mbrtowc works on empty input... " >&6; } +if test ${gl_cv_func_mbrtowc_empty_input+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + case "$host_os" in + # Guess no on AIX and glibc systems. + aix* | *-gnu*) + gl_cv_func_mbrtowc_empty_input="guessing no" ;; + *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; + esac + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <wchar.h> + static wchar_t wc; + static mbstate_t mbs; + int + main (void) + { + return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2; + } +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_empty_input=yes +else case e in #( + e) gl_cv_func_mbrtowc_empty_input=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_empty_input" >&6; } + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5 +printf %s "checking whether the C locale is free of encoding errors... " >&6; } +if test ${gl_cv_C_locale_sans_EILSEQ+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_cv_C_locale_sans_EILSEQ="guessing no" + + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + #include <locale.h> + #include <wchar.h> + +int +main (void) +{ + + int i; + char *locale = setlocale (LC_ALL, "C"); + if (! locale) + return 2; + for (i = CHAR_MIN; i <= CHAR_MAX; i++) + { + char c = i; + wchar_t wc; + mbstate_t mbs = { 0, }; + size_t ss = mbrtowc (&wc, &c, 1, &mbs); + if (1 < ss) + return 3; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_C_locale_sans_EILSEQ=yes +else case e in #( + e) gl_cv_C_locale_sans_EILSEQ=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_C_locale_sans_EILSEQ" >&5 +printf "%s\n" "$gl_cv_C_locale_sans_EILSEQ" >&6; } + + case "$gl_cv_func_mbrtowc_null_arg1" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_null_arg2" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_retval" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_nul_retval" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_empty_input" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case $gl_cv_C_locale_sans_EILSEQ in + *yes) ;; + *) +printf "%s\n" "#define C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + fi + fi + + if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBRTOWC=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h + + + + + + + + + GNULIB_MBSCASECMP=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBSCASECMP 1" >>confdefs.h + + + + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else case e in #( + e) gl_cv_func_mbrtowc_incomplete_state=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else case e in #( + e) gl_cv_func_mbrtowc_sanitycheck=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_mbsinit = no; then + HAVE_MBSINIT=0 + ac_fn_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" " +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_mbsinit" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_MBSINIT $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_mbsinit = yes; then + REPLACE_MBSINIT=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSINIT=1 + else + case "$host_os" in + mingw*) REPLACE_MBSINIT=1 ;; + esac + fi + fi + + if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBSINIT=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h + + + + + + + if test $ac_cv_func_mbslen = yes; then + HAVE_MBSLEN=1 + else + HAVE_MBSLEN=0 + fi + + + + + + + GNULIB_MBSLEN=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBSLEN 1" >>confdefs.h + + + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else case e in #( + e) gl_cv_func_mbrtowc_incomplete_state=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else case e in #( + e) gl_cv_func_mbrtowc_sanitycheck=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_mbsrtowcs = no; then + HAVE_MBSRTOWCS=0 + ac_fn_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" " +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_mbsrtowcs" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_MBSRTOWCS $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_mbsrtowcs = yes; then + REPLACE_MBSRTOWCS=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSRTOWCS=1 + else + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5 +printf %s "checking whether mbsrtowcs works... " >&6; } +if test ${gl_cv_func_mbsrtowcs_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + case "$host_os" in + # Guess no on HP-UX, Solaris, mingw. + hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbsrtowcs_works="guessing yes" ;; + esac + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + int result = 0; + /* Test whether the function supports a NULL destination argument. + This fails on native Windows. */ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + const char input[] = "\337er"; + const char *src = input; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbsrtowcs (NULL, &src, 1, &state) != 3 + || src != input) + result |= 1; + } + /* Test whether the function works when started with a conversion state + in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + const char input[] = "B\303\274\303\237er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + result |= 2; + } + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "<\306\374\313\334\270\354>"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 4; + if (mbsrtowcs (NULL, &src, 10, &state) != 3) + result |= 4; + } + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + const char input[] = "B\250\271\201\060\211\070er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + result |= 8; + } + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbsrtowcs_works=yes +else case e in #( + e) gl_cv_func_mbsrtowcs_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5 +printf "%s\n" "$gl_cv_func_mbsrtowcs_works" >&6; } + + case "$gl_cv_func_mbsrtowcs_works" in + *yes) ;; + *) REPLACE_MBSRTOWCS=1 ;; + esac + fi + fi + + if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBSRTOWCS=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h + + + + + + + + + GNULIB_MBSSTR=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBSSTR 1" >>confdefs.h + + + + + + + if false; then + REPLACE_MBTOWC=1 + fi + + if test $REPLACE_MBTOWC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbtowc.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBTOWC=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBTOWC 1" >>confdefs.h + + + + + + : + + + if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext" + + + ac_fn_c_check_header_compile "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default" +if test "x$ac_cv_header_bp_sym_h" = xyes +then : + printf "%s\n" "#define HAVE_BP_SYM_H 1" >>confdefs.h + +fi + + + fi + + + + + + GNULIB_MEMCHR=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h + + + + + + + + + + + if test $ac_cv_func_mkstemp = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working mkstemp" >&5 +printf %s "checking for working mkstemp... " >&6; } +if test ${gl_cv_func_working_mkstemp+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + mkdir conftest.mkstemp + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_working_mkstemp="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_mkstemp="guessing no" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ +int result = 0; + int i; + off_t large = (off_t) 4294967295u; + if (large < 0) + large = 2147483647; + umask (0); + for (i = 0; i < 70; i++) + { + char templ[] = "conftest.mkstemp/coXXXXXX"; + int (*mkstemp_function) (char *) = mkstemp; + int fd = mkstemp_function (templ); + if (fd < 0) + result |= 1; + else + { + struct stat st; + if (lseek (fd, large, SEEK_SET) != large) + result |= 2; + if (fstat (fd, &st) < 0) + result |= 4; + else if (st.st_mode & 0077) + result |= 8; + if (close (fd)) + result |= 16; + } + } + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_working_mkstemp=yes +else case e in #( + e) gl_cv_func_working_mkstemp=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -rf conftest.mkstemp + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mkstemp" >&5 +printf "%s\n" "$gl_cv_func_working_mkstemp" >&6; } + case "$gl_cv_func_working_mkstemp" in + *yes) ;; + *) + REPLACE_MKSTEMP=1 + ;; + esac + else + HAVE_MKSTEMP=0 + fi + + if test $HAVE_MKSTEMP = 0 || test $REPLACE_MKSTEMP = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mkstemp.$ac_objext" + + + + fi + + + + + + GNULIB_MKSTEMP=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MKSTEMP 1" >>confdefs.h + + + + + + + + + REPLACE_MKTIME=0 + if test "$gl_cv_func_working_mktime" != yes; then + REPLACE_MKTIME=1 + +printf "%s\n" "#define NEED_MKTIME_WORKING 1" >>confdefs.h + + fi + case "$host_os" in + mingw*) + REPLACE_MKTIME=1 + +printf "%s\n" "#define NEED_MKTIME_WINDOWS 1" >>confdefs.h + + ;; + esac + + if test $REPLACE_MKTIME = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext" + + : + fi + + + + + + GNULIB_MKTIME=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MKTIME 1" >>confdefs.h + + + + + + + WANT_MKTIME_INTERNAL=0 + ac_fn_c_check_func "$LINENO" "__mktime_internal" "ac_cv_func___mktime_internal" +if test "x$ac_cv_func___mktime_internal" = xyes +then : + +printf "%s\n" "#define mktime_internal __mktime_internal" >>confdefs.h + + +else case e in #( + e) WANT_MKTIME_INTERNAL=1 + +printf "%s\n" "#define NEED_MKTIME_INTERNAL 1" >>confdefs.h + + ;; +esac +fi + + + if test $WANT_MKTIME_INTERNAL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext" + + : + fi + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext" + + fi + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext" + + fi + + +printf "%s\n" "#define GNULIB_MSVC_NOTHROW 1" >>confdefs.h + + + + + + + + if test $ac_cv_func_nl_langinfo = yes; then + # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether YESEXPR works" >&5 +printf %s "checking whether YESEXPR works... " >&6; } +if test ${gl_cv_func_nl_langinfo_yesexpr_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on irix systems. + irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";; + # Guess yes elsewhere. + *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> + +int +main (void) +{ +return !*nl_langinfo(YESEXPR); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_nl_langinfo_yesexpr_works=yes +else case e in #( + e) gl_cv_func_nl_langinfo_yesexpr_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nl_langinfo_yesexpr_works" >&5 +printf "%s\n" "$gl_cv_func_nl_langinfo_yesexpr_works" >&6; } + case $gl_cv_func_nl_langinfo_yesexpr_works in + *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;; + *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;; + esac + +printf "%s\n" "#define FUNC_NL_LANGINFO_YESEXPR_WORKS $FUNC_NL_LANGINFO_YESEXPR_WORKS" >>confdefs.h + + if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \ + && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then + : + else + REPLACE_NL_LANGINFO=1 + +printf "%s\n" "#define REPLACE_NL_LANGINFO 1" >>confdefs.h + + fi + else + HAVE_NL_LANGINFO=0 + fi + + if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS nl_langinfo.$ac_objext" + + fi + + + + + + GNULIB_NL_LANGINFO=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_NL_LANGINFO 1" >>confdefs.h + + + + + + case "$host_os" in + mingw* | pw*) + REPLACE_OPEN=1 + ;; + *) + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5 +printf %s "checking whether open recognizes a trailing slash... " >&6; } +if test ${gl_cv_func_open_slash+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + touch conftest.tmp + ln -s conftest.tmp conftest.lnk + fi + if test "$cross_compiling" = yes +then : + + case "$host_os" in + freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*) + gl_cv_func_open_slash="guessing no" ;; + *) + gl_cv_func_open_slash="guessing yes" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <fcntl.h> +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +int main () +{ + int result = 0; +#if HAVE_LSTAT + if (open ("conftest.lnk/", O_RDONLY) != -1) + result |= 1; +#endif + if (open ("conftest.sl/", O_CREAT, 0600) >= 0) + result |= 2; + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_open_slash=yes +else case e in #( + e) gl_cv_func_open_slash=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.sl conftest.tmp conftest.lnk + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5 +printf "%s\n" "$gl_cv_func_open_slash" >&6; } + case "$gl_cv_func_open_slash" in + *no) + +printf "%s\n" "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h + + REPLACE_OPEN=1 + ;; + esac + ;; + esac + + + + if test $REPLACE_OPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext" + + + + : + + fi + + + + + + GNULIB_OPEN=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_OPEN 1" >>confdefs.h + + + + + + + ac_fn_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_program_invocation_name" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl" >>confdefs.h + + ac_fn_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl" >>confdefs.h + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"'" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"'" + + + : + + + : + + + + + ac_fn_c_check_func "$LINENO" "raise" "ac_cv_func_raise" +if test "x$ac_cv_func_raise" = xyes +then : + printf "%s\n" "#define HAVE_RAISE 1" >>confdefs.h + +fi + + if test $ac_cv_func_raise = no; then + HAVE_RAISE=0 + else + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_RAISE=1 + fi + + + + + + if test $gl_cv_type_sigset_t = yes; then + ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" +if test "x$ac_cv_func_sigprocmask" = xyes +then : + gl_cv_func_sigprocmask=1 +fi + + fi + if test -z "$gl_cv_func_sigprocmask"; then + HAVE_POSIX_SIGNALBLOCKING=0 + fi + + if test $HAVE_POSIX_SIGNALBLOCKING = 0; then + : + fi + + fi + + if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS raise.$ac_objext" + + : + fi + + + + + + GNULIB_RAISE=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_RAISE 1" >>confdefs.h + + + + + + + + ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr" +if test "x$ac_cv_func_rawmemchr" = xyes +then : + printf "%s\n" "#define HAVE_RAWMEMCHR 1" >>confdefs.h + +fi + + if test $ac_cv_func_rawmemchr = no; then + HAVE_RAWMEMCHR=0 + fi + + if test $HAVE_RAWMEMCHR = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext" + + : + fi + + + + + + GNULIB_RAWMEMCHR=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h + + + + + + + if test $ac_cv_func_readlink = no; then + HAVE_READLINK=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5 +printf %s "checking whether readlink signature is correct... " >&6; } +if test ${gl_cv_decl_readlink_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> + /* Cause compilation failure if original declaration has wrong type. */ + ssize_t readlink (const char *, char *, size_t); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_readlink_works=yes +else case e in #( + e) gl_cv_decl_readlink_works=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5 +printf "%s\n" "$gl_cv_decl_readlink_works" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5 +printf %s "checking whether readlink handles trailing slash correctly... " >&6; } +if test ${gl_cv_func_readlink_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) # We have readlink, so assume ln -s works. + ln -s conftest.no-such conftest.link + ln -s conftest.link conftest.lnk2 + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_readlink_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_readlink_works="guessing no" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> + +int +main (void) +{ +char buf[20]; + return readlink ("conftest.lnk2/", buf, sizeof buf) != -1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_readlink_works=yes +else case e in #( + e) gl_cv_func_readlink_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.link conftest.lnk2 ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_works" >&5 +printf "%s\n" "$gl_cv_func_readlink_works" >&6; } + case "$gl_cv_func_readlink_works" in + *yes) + if test "$gl_cv_decl_readlink_works" != yes; then + REPLACE_READLINK=1 + fi + ;; + *) + +printf "%s\n" "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h + + REPLACE_READLINK=1 + ;; + esac + fi + + if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext" + + + : + + fi + + + + + + GNULIB_READLINK=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_READLINK 1" >>confdefs.h + + + + + +# Check whether --with-included-regex was given. +if test ${with_included_regex+y} +then : + withval=$with_included_regex; +fi + + + case $with_included_regex in #( + yes|no) ac_use_included_regex=$with_included_regex + ;; + '') + # If the system regex support is good enough that it passes the + # following run test, then default to *not* using the included regex.c. + # If cross compiling, assume the test would fail and use the included + # regex.c. + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working re_compile_pattern" >&5 +printf %s "checking for working re_compile_pattern... " >&6; } +if test ${gl_cv_func_re_compile_pattern_working+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_re_compile_pattern_working=no +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <regex.h> + + #include <locale.h> + #include <limits.h> + #include <string.h> + + #if defined M_CHECK_ACTION || HAVE_DECL_ALARM + # include <signal.h> + # include <unistd.h> + #endif + + #if HAVE_MALLOC_H + # include <malloc.h> + #endif + + #ifdef M_CHECK_ACTION + /* Exit with distinguishable exit code. */ + static void sigabrt_no_core (int sig) { raise (SIGTERM); } + #endif + +int +main (void) +{ +int result = 0; + static struct re_pattern_buffer regex; + unsigned char folded_chars[UCHAR_MAX + 1]; + int i; + const char *s; + struct re_registers regs; + + /* Some builds of glibc go into an infinite loop on this + test. Use alarm to force death, and mallopt to avoid + malloc recursion in diagnosing the corrupted heap. */ +#if HAVE_DECL_ALARM + signal (SIGALRM, SIG_DFL); + alarm (2); +#endif +#ifdef M_CHECK_ACTION + signal (SIGABRT, sigabrt_no_core); + mallopt (M_CHECK_ACTION, 2); +#endif + + if (setlocale (LC_ALL, "en_US.UTF-8")) + { + { + /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html + This test needs valgrind to catch the bug on Debian + GNU/Linux 3.1 x86, but it might catch the bug better + on other platforms and it shouldn't hurt to try the + test here. */ + static char const pat[] = "insert into"; + static char const data[] = + "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK"; + re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE + | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else if (re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, ®s) + != -1) + result |= 1; + regfree (®ex); + } + + { + /* This test is from glibc bug 15078. + The test case is from Andreas Schwab in + <http://www.sourceware.org/ml/libc-alpha/2013-01/msg00967.html>. + */ + static char const pat[] = "[^x]x"; + static char const data[] = + /* <U1000><U103B><U103D><U1014><U103A><U102F><U1015><U103A> */ + "\xe1\x80\x80" + "\xe1\x80\xbb" + "\xe1\x80\xbd" + "\xe1\x80\x94" + "\xe1\x80\xba" + "\xe1\x80\xaf" + "\xe1\x80\x95" + "\xe1\x80\xba" + "x"; + re_set_syntax (0); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else + { + i = re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, 0); + if (i != 0 && i != 21) + result |= 1; + } + regfree (®ex); + } + + if (! setlocale (LC_ALL, "C")) + return 1; + } + + /* This test is from glibc bug 3957, reported by Andrew Mackey. */ + re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[^x]b", 6, ®ex); + if (s) + result |= 2; + /* This should fail, but succeeds for glibc-2.5. */ + else if (re_search (®ex, "a\nb", 3, 0, 3, ®s) != -1) + result |= 2; + + /* This regular expression is from Spencer ere test number 75 + in grep-2.3. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP); + memset (®ex, 0, sizeof regex); + for (i = 0; i <= UCHAR_MAX; i++) + folded_chars[i] = i; + regex.translate = folded_chars; + s = re_compile_pattern ("a[[:]:]]b\n", 11, ®ex); + /* This should fail with _Invalid character class name_ error. */ + if (!s) + result |= 4; + + /* Ensure that [b-a] is diagnosed as invalid, when + using RE_NO_EMPTY_RANGES. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[b-a]", 6, ®ex); + if (s == 0) + result |= 8; + + /* This should succeed, but does not for glibc-2.1.3. */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("{1", 2, ®ex); + if (s) + result |= 8; + + /* The following example is derived from a problem report + against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[an\371]*n", 7, ®ex); + if (s) + result |= 8; + /* This should match, but does not for glibc-2.2.1. */ + else if (re_match (®ex, "an", 2, 0, ®s) != 2) + result |= 8; + + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 8; + /* glibc-2.2.93 does not work with a negative RANGE argument. */ + else if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1) + result |= 8; + + /* The version of regex.c in older versions of gnulib + ignored RE_ICASE. Detect that problem too. */ + re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 16; + else if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0) + result |= 16; + + /* Catch a bug reported by Vin Shelton in + http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html + */ + re_set_syntax (RE_SYNTAX_POSIX_BASIC + & ~RE_CONTEXT_INVALID_DUP + & ~RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, ®ex); + if (s) + result |= 32; + + /* REG_STARTEND was added to glibc on 2004-01-15. + Reject older versions. */ + if (! REG_STARTEND) + result |= 64; + +#if 0 + /* It would be nice to reject hosts whose regoff_t values are too + narrow (including glibc on hosts with 64-bit ptrdiff_t and + 32-bit int), but we should wait until glibc implements this + feature. Otherwise, support for equivalence classes and + multibyte collation symbols would always be broken except + when compiling --without-included-regex. */ + if (sizeof (regoff_t) < sizeof (ptrdiff_t) + || sizeof (regoff_t) < sizeof (ssize_t)) + result |= 64; +#endif + + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_re_compile_pattern_working=yes +else case e in #( + e) gl_cv_func_re_compile_pattern_working=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_re_compile_pattern_working" >&5 +printf "%s\n" "$gl_cv_func_re_compile_pattern_working" >&6; } + case $gl_cv_func_re_compile_pattern_working in #( + yes) ac_use_included_regex=no;; #( + no) ac_use_included_regex=yes;; + esac + ;; + *) as_fn_error $? "Invalid value for --with-included-regex: $with_included_regex" "$LINENO" 5 + ;; + esac + + if test $ac_use_included_regex = yes; then + +printf "%s\n" "#define _REGEX_INCLUDE_LIMITS_H 1" >>confdefs.h + + +printf "%s\n" "#define _REGEX_LARGE_OFFSETS 1" >>confdefs.h + + +printf "%s\n" "#define re_syntax_options rpl_re_syntax_options" >>confdefs.h + + +printf "%s\n" "#define re_set_syntax rpl_re_set_syntax" >>confdefs.h + + +printf "%s\n" "#define re_compile_pattern rpl_re_compile_pattern" >>confdefs.h + + +printf "%s\n" "#define re_compile_fastmap rpl_re_compile_fastmap" >>confdefs.h + + +printf "%s\n" "#define re_search rpl_re_search" >>confdefs.h + + +printf "%s\n" "#define re_search_2 rpl_re_search_2" >>confdefs.h + + +printf "%s\n" "#define re_match rpl_re_match" >>confdefs.h + + +printf "%s\n" "#define re_match_2 rpl_re_match_2" >>confdefs.h + + +printf "%s\n" "#define re_set_registers rpl_re_set_registers" >>confdefs.h + + +printf "%s\n" "#define re_comp rpl_re_comp" >>confdefs.h + + +printf "%s\n" "#define re_exec rpl_re_exec" >>confdefs.h + + +printf "%s\n" "#define regcomp rpl_regcomp" >>confdefs.h + + +printf "%s\n" "#define regexec rpl_regexec" >>confdefs.h + + +printf "%s\n" "#define regerror rpl_regerror" >>confdefs.h + + +printf "%s\n" "#define regfree rpl_regfree" >>confdefs.h + + fi + + if test $ac_use_included_regex = yes; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS regex.$ac_objext" + + + + + + + + + ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBINTL_H 1" >>confdefs.h + +fi + + + ac_fn_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_isblank" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h + + + fi + + + + + + if test $ac_cv_func_secure_getenv = no; then + HAVE_SECURE_GETENV=0 + fi + + if test $HAVE_SECURE_GETENV = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS secure_getenv.$ac_objext" + + + ac_fn_c_check_func "$LINENO" "__secure_getenv" "ac_cv_func___secure_getenv" +if test "x$ac_cv_func___secure_getenv" = xyes +then : + printf "%s\n" "#define HAVE___SECURE_GETENV 1" >>confdefs.h + +fi + + if test $ac_cv_func___secure_getenv = no; then + ac_fn_c_check_func "$LINENO" "issetugid" "ac_cv_func_issetugid" +if test "x$ac_cv_func_issetugid" = xyes +then : + printf "%s\n" "#define HAVE_ISSETUGID 1" >>confdefs.h + +fi + + fi + + + fi + + + + + + GNULIB_SECURE_GETENV=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_SECURE_GETENV 1" >>confdefs.h + + + + + + if test $ac_cv_func_setenv = no; then + HAVE_SETENV=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5 +printf %s "checking whether setenv validates arguments... " >&6; } +if test ${gl_cv_func_setenv_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_setenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_setenv_works="guessing no" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <stdlib.h> + #include <errno.h> + #include <string.h> + +int +main (void) +{ + + int result = 0; + { + if (setenv ("", "", 0) != -1) + result |= 1; + else if (errno != EINVAL) + result |= 2; + } + { + if (setenv ("a", "=", 1) != 0) + result |= 4; + else if (strcmp (getenv ("a"), "=") != 0) + result |= 8; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_setenv_works=yes +else case e in #( + e) gl_cv_func_setenv_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5 +printf "%s\n" "$gl_cv_func_setenv_works" >&6; } + case "$gl_cv_func_setenv_works" in + *yes) ;; + *) + REPLACE_SETENV=1 + ;; + esac + fi + + if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext" + + fi + + + + + + GNULIB_SETENV=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_SETENV 1" >>confdefs.h + + + + + + + if test $ac_cv_func_sigaction = yes; then + ac_fn_c_check_member "$LINENO" "struct sigaction" "sa_sigaction" "ac_cv_member_struct_sigaction_sa_sigaction" "#include <signal.h> +" +if test "x$ac_cv_member_struct_sigaction_sa_sigaction" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1" >>confdefs.h + + +fi + + if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then + HAVE_STRUCT_SIGACTION_SA_SIGACTION=0 + fi + else + HAVE_SIGACTION=0 + fi + + if test $HAVE_SIGACTION = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS sigaction.$ac_objext" + + + + + + + + ac_fn_c_check_type "$LINENO" "siginfo_t" "ac_cv_type_siginfo_t" " +#include <signal.h> + +" +if test "x$ac_cv_type_siginfo_t" = xyes +then : + +printf "%s\n" "#define HAVE_SIGINFO_T 1" >>confdefs.h + + +fi + + if test $ac_cv_type_siginfo_t = no; then + HAVE_SIGINFO_T=0 + fi + + fi + + + + + + GNULIB_SIGACTION=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_SIGACTION 1" >>confdefs.h + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_signal_h='<'signal.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5 +printf %s "checking absolute name of <signal.h>... " >&6; } +if test ${gl_cv_next_signal_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <signal.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'signal.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_signal_h + gl_cv_next_signal_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5 +printf "%s\n" "$gl_cv_next_signal_h" >&6; } + fi + NEXT_SIGNAL_H=$gl_cv_next_signal_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'signal.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_signal_h + fi + NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive + + + + + +# AIX declares sig_atomic_t to already include volatile, and C89 compilers +# then choke on 'volatile sig_atomic_t'. C99 requires that it compile. + ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" " +#include <signal.h> + +" +if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes +then : + +else case e in #( + e) HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0 ;; +esac +fi + + + + + + + + ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" " +#include <signal.h> + +" +if test "x$ac_cv_type_sighandler_t" = xyes +then : + +else case e in #( + e) HAVE_SIGHANDLER_T=0 ;; +esac +fi + + + + for gl_func in pthread_sigmask sigaction sigaddset sigdelset sigemptyset sigfillset sigismember sigpending sigprocmask; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <signal.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + if test $gl_cv_type_sigset_t = yes; then + ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" +if test "x$ac_cv_func_sigprocmask" = xyes +then : + gl_cv_func_sigprocmask=1 +fi + + fi + if test -z "$gl_cv_func_sigprocmask"; then + HAVE_POSIX_SIGNALBLOCKING=0 + fi + + if test $HAVE_POSIX_SIGNALBLOCKING = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS sigprocmask.$ac_objext" + + : + fi + + + + + + GNULIB_SIGPROCMASK=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_SIGPROCMASK 1" >>confdefs.h + + + + + ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "#define HAVE_STDINT_H 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5 +printf %s "checking for SIZE_MAX... " >&6; } +if test ${gl_cv_size_max+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_cv_size_max= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <limits.h> +#if HAVE_STDINT_H +#include <stdint.h> +#endif +#ifdef SIZE_MAX +Found it +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "Found it" >/dev/null 2>&1 +then : + gl_cv_size_max=yes +fi +rm -rf conftest* + + if test -z "$gl_cv_size_max"; then + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) * CHAR_BIT - 1" "size_t_bits_minus_1" "#include <stddef.h> +#include <limits.h>" +then : + +else case e in #( + e) size_t_bits_minus_1= ;; +esac +fi + + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint" "#include <stddef.h>" +then : + +else case e in #( + e) fits_in_uint= ;; +esac +fi + + if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then + if test $fits_in_uint = 1; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> + extern size_t foo; + extern unsigned long foo; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + fits_in_uint=0 +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $fits_in_uint = 1; then + gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" + else + gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" + fi + else + gl_cv_size_max='((size_t)~(size_t)0)' + fi + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5 +printf "%s\n" "$gl_cv_size_max" >&6; } + if test "$gl_cv_size_max" != yes; then + +printf "%s\n" "#define SIZE_MAX $gl_cv_size_max" >>confdefs.h + + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 +printf %s "checking for ssize_t... " >&6; } +if test ${gt_cv_ssize_t+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +int +main (void) +{ +int x = sizeof (ssize_t *) + sizeof (ssize_t); + return !x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_ssize_t=yes +else case e in #( + e) gt_cv_ssize_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5 +printf "%s\n" "$gt_cv_ssize_t" >&6; } + if test $gt_cv_ssize_t = no; then + +printf "%s\n" "#define ssize_t int" >>confdefs.h + + fi + + + + + + case "$host_os" in + mingw*) + REPLACE_STAT=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5 +printf %s "checking whether stat handles trailing slashes on files... " >&6; } +if test ${gl_cv_func_stat_file_slash+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) touch conftest.tmp + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + ln -s conftest.tmp conftest.lnk + fi + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_stat_file_slash="guessing no" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> + +int +main (void) +{ +int result = 0; + struct stat st; + if (!stat ("conftest.tmp/", &st)) + result |= 1; +#if HAVE_LSTAT + if (!stat ("conftest.lnk/", &st)) + result |= 2; +#endif + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_stat_file_slash=yes +else case e in #( + e) gl_cv_func_stat_file_slash=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.tmp conftest.lnk ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5 +printf "%s\n" "$gl_cv_func_stat_file_slash" >&6; } + case $gl_cv_func_stat_file_slash in + *no) + REPLACE_STAT=1 + +printf "%s\n" "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h +;; + esac + ;; + esac + + if test $REPLACE_STAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" + + + + : + + fi + + + + + + GNULIB_STAT=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_STAT 1" >>confdefs.h + + + + + + + + ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1" >>confdefs.h + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5 +printf %s "checking whether struct stat.st_atim is of type struct timespec... " >&6; } +if test ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <sys/types.h> + #include <sys/stat.h> + #if HAVE_SYS_TIME_H + # include <sys/time.h> + #endif + #include <time.h> + struct timespec ts; + struct stat st; + +int +main (void) +{ + + st.st_atim = ts; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes +else case e in #( + e) ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5 +printf "%s\n" "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; } + if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then + +printf "%s\n" "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h + + fi +else case e in #( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1" >>confdefs.h + + +else case e in #( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1" >>confdefs.h + + +else case e in #( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1" >>confdefs.h + + +fi + ;; +esac +fi + ;; +esac +fi + ;; +esac +fi + + + + + + ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1" >>confdefs.h + + +else case e in #( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1" >>confdefs.h + + +else case e in #( + e) ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtim.tv_nsec" "ac_cv_member_struct_stat_st_birthtim_tv_nsec" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1" >>confdefs.h + + +fi + ;; +esac +fi + ;; +esac +fi + + + + STDARG_H='' + NEXT_STDARG_H='<stdarg.h>' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 +printf %s "checking for va_copy... " >&6; } + if test ${gl_cv_func_va_copy+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +int +main (void) +{ + +#ifndef va_copy +void (*func) (va_list, va_list) = va_copy; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_va_copy=yes +else case e in #( + e) gl_cv_func_va_copy=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_va_copy" >&5 +printf "%s\n" "$gl_cv_func_va_copy" >&6; } + if test $gl_cv_func_va_copy = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined _AIX && !defined __GNUC__ + AIX vaccine + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "vaccine" >/dev/null 2>&1 +then : + gl_aixcc=yes +else case e in #( + e) gl_aixcc=no ;; +esac +fi +rm -rf conftest* + + if test $gl_aixcc = yes; then + STDARG_H=stdarg.h + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdarg_h='<'stdarg.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdarg.h>" >&5 +printf %s "checking absolute name of <stdarg.h>... " >&6; } +if test ${gl_cv_next_stdarg_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdarg.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdarg_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdarg_h + gl_cv_next_stdarg_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdarg_h" >&5 +printf "%s\n" "$gl_cv_next_stdarg_h" >&6; } + fi + NEXT_STDARG_H=$gl_cv_next_stdarg_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdarg.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdarg_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDARG_H=$gl_next_as_first_directive + + + + + if test "$gl_cv_next_stdarg_h" = '""'; then + gl_cv_next_stdarg_h='"///usr/include/stdarg.h"' + NEXT_STDARG_H="$gl_cv_next_stdarg_h" + fi + else + + saved_as_echo_n="$as_echo_n" + as_echo_n=':' + if test ${gl_cv_func___va_copy+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +int +main (void) +{ + +#ifndef __va_copy +error, bail out +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func___va_copy=yes +else case e in #( + e) gl_cv_func___va_copy=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + as_echo_n="$saved_as_echo_n" + + if test $gl_cv_func___va_copy = yes; then + +printf "%s\n" "#define va_copy __va_copy" >>confdefs.h + + else + + +printf "%s\n" "#define va_copy gl_va_copy" >>confdefs.h + + fi + fi + fi + + if test -n "$STDARG_H"; then + GL_GENERATE_STDARG_H_TRUE= + GL_GENERATE_STDARG_H_FALSE='#' +else + GL_GENERATE_STDARG_H_TRUE='#' + GL_GENERATE_STDARG_H_FALSE= +fi + + + + + + + # Define two additional variables used in the Makefile substitution. + + if test "$ac_cv_header_stdbool_h" = yes; then + STDBOOL_H='' + else + STDBOOL_H='stdbool.h' + fi + + if test -n "$STDBOOL_H"; then + GL_GENERATE_STDBOOL_H_TRUE= + GL_GENERATE_STDBOOL_H_FALSE='#' +else + GL_GENERATE_STDBOOL_H_TRUE='#' + GL_GENERATE_STDBOOL_H_FALSE= +fi + + + if test "$ac_cv_type__Bool" = yes; then + HAVE__BOOL=1 + else + HAVE__BOOL=0 + fi + + + + + + STDDEF_H= + ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include <stddef.h> + +" +if test "x$ac_cv_type_max_align_t" = xyes +then : + +else case e in #( + e) HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h ;; +esac +fi + + if test $gt_cv_c_wchar_t = no; then + HAVE_WCHAR_T=0 + STDDEF_H=stddef.h + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 +printf %s "checking whether NULL can be used in arbitrary expressions... " >&6; } +if test ${gl_cv_decl_null_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> + int test[2 * (sizeof NULL == sizeof (void *)) -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_null_works=yes +else case e in #( + e) gl_cv_decl_null_works=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 +printf "%s\n" "$gl_cv_decl_null_works" >&6; } + if test $gl_cv_decl_null_works = no; then + REPLACE_NULL=1 + STDDEF_H=stddef.h + fi + + if test -n "$STDDEF_H"; then + GL_GENERATE_STDDEF_H_TRUE= + GL_GENERATE_STDDEF_H_FALSE='#' +else + GL_GENERATE_STDDEF_H_TRUE='#' + GL_GENERATE_STDDEF_H_FALSE= +fi + + if test -n "$STDDEF_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stddef_h='<'stddef.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5 +printf %s "checking absolute name of <stddef.h>... " >&6; } +if test ${gl_cv_next_stddef_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stddef.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stddef_h + gl_cv_next_stddef_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 +printf "%s\n" "$gl_cv_next_stddef_h" >&6; } + fi + NEXT_STDDEF_H=$gl_cv_next_stddef_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stddef.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stddef_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive + + + + + fi + + + + + printf "%s\n" "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdio_h='<'stdio.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5 +printf %s "checking absolute name of <stdio.h>... " >&6; } +if test ${gl_cv_next_stdio_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdio.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdio_h + gl_cv_next_stdio_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5 +printf "%s\n" "$gl_cv_next_stdio_h" >&6; } + fi + NEXT_STDIO_H=$gl_cv_next_stdio_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdio.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdio_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5 +printf %s "checking which flavor of printf attribute matches inttypes macros... " >&6; } +if test ${gl_cv_func_printf_attribute_flavor+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define __STDC_FORMAT_MACROS 1 + #include <stdio.h> + #include <inttypes.h> + /* For non-mingw systems, compilation will trivially succeed. + For mingw, compilation will succeed for older mingw (system + printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */ + #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_printf_attribute_flavor=system +else case e in #( + e) gl_cv_func_printf_attribute_flavor=gnu ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5 +printf "%s\n" "$gl_cv_func_printf_attribute_flavor" >&6; } + if test "$gl_cv_func_printf_attribute_flavor" = gnu; then + +printf "%s\n" "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h + + fi + + GNULIB_FSCANF=1 + + +printf "%s\n" "#define GNULIB_FSCANF 1" >>confdefs.h + + + GNULIB_SCANF=1 + + +printf "%s\n" "#define GNULIB_SCANF 1" >>confdefs.h + + + GNULIB_FGETC=1 + GNULIB_GETC=1 + GNULIB_GETCHAR=1 + GNULIB_FGETS=1 + GNULIB_FREAD=1 + + + GNULIB_FPRINTF=1 + GNULIB_PRINTF=1 + GNULIB_VFPRINTF=1 + GNULIB_VPRINTF=1 + GNULIB_FPUTC=1 + GNULIB_PUTC=1 + GNULIB_PUTCHAR=1 + GNULIB_FPUTS=1 + GNULIB_PUTS=1 + GNULIB_FWRITE=1 + + + + + for gl_func in dprintf fpurge fseeko ftello getdelim getline gets pclose popen renameat snprintf tmpfile vdprintf vsnprintf; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdlib_h='<'stdlib.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5 +printf %s "checking absolute name of <stdlib.h>... " >&6; } +if test ${gl_cv_next_stdlib_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdlib.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdlib_h + gl_cv_next_stdlib_h='"'$gl_header'"' + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5 +printf "%s\n" "$gl_cv_next_stdlib_h" >&6; } + fi + NEXT_STDLIB_H=$gl_cv_next_stdlib_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdlib.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdlib_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive + + + + + + + for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#if HAVE_SYS_LOADAVG_H +# include <sys/loadavg.h> +#endif +#if HAVE_RANDOM_H +# include <random.h> +#endif + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" +if test "x$ac_cv_func_strcasecmp" = xyes +then : + printf "%s\n" "#define HAVE_STRCASECMP 1" >>confdefs.h + +fi + + if test $ac_cv_func_strcasecmp = no; then + HAVE_STRCASECMP=0 + fi + + + + ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" +if test "x$ac_cv_func_strncasecmp" = xyes +then : + printf "%s\n" "#define HAVE_STRNCASECMP 1" >>confdefs.h + +fi + + if test $ac_cv_func_strncasecmp = yes; then + HAVE_STRNCASECMP=1 + else + HAVE_STRNCASECMP=0 + fi + ac_fn_check_decl "$LINENO" "strncasecmp" "ac_cv_have_decl_strncasecmp" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strncasecmp" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_STRNCASECMP $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_strncasecmp = no; then + HAVE_DECL_STRNCASECMP=0 + fi + + + if test $HAVE_STRCASECMP = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strcasecmp.$ac_objext" + + + : + + fi + if test $HAVE_STRNCASECMP = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strncasecmp.$ac_objext" + + + : + + fi + + + + + + + + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5 +printf %s "checking for working strerror function... " >&6; } +if test ${gl_cv_func_working_strerror+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_working_strerror="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_strerror="guessing no" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + +int +main (void) +{ +if (!*strerror (-2)) return 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_working_strerror=yes +else case e in #( + e) gl_cv_func_working_strerror=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5 +printf "%s\n" "$gl_cv_func_working_strerror" >&6; } + case "$gl_cv_func_working_strerror" in + *yes) ;; + *) + REPLACE_STRERROR=1 + ;; + esac + + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR=1 ;; + esac + + else + REPLACE_STRERROR=1 + fi + + if test $REPLACE_STRERROR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext" + + fi + + +printf "%s\n" "#define GNULIB_STRERROR 1" >>confdefs.h + + + + + + + + GNULIB_STRERROR=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_STRERROR 1" >>confdefs.h + + + + + + if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext" + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + fi + + # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE. + + + + + + + +printf "%s\n" "#define my_strftime nstrftime" >>confdefs.h + + + if test $gl_cond_libtool = false; then + gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV" + gl_libdeps="$gl_libdeps $LIBICONV" + fi + + + + + + + + + + + + + if test $ac_cv_have_decl_strndup = no; then + HAVE_DECL_STRNDUP=0 + fi + + if test $ac_cv_func_strndup = yes; then + HAVE_STRNDUP=1 + # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strndup" >&5 +printf %s "checking for working strndup... " >&6; } +if test ${gl_cv_func_strndup_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + + case $host_os in + aix | aix[3-6]*) gl_cv_func_strndup_works="guessing no";; + *) gl_cv_func_strndup_works="guessing yes";; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <string.h> + #include <stdlib.h> +int +main (void) +{ + +#if !HAVE_DECL_STRNDUP + extern + #ifdef __cplusplus + "C" + #endif + char *strndup (const char *, size_t); +#endif + int result; + char *s; + s = strndup ("some longer string", 15); + free (s); + s = strndup ("shorter string", 13); + result = s[13] != '\0'; + free (s); + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strndup_works=yes +else case e in #( + e) gl_cv_func_strndup_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strndup_works" >&5 +printf "%s\n" "$gl_cv_func_strndup_works" >&6; } + case $gl_cv_func_strndup_works in + *no) REPLACE_STRNDUP=1 ;; + esac + else + HAVE_STRNDUP=0 + fi + + if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strndup.$ac_objext" + + fi + + + + + + GNULIB_STRNDUP=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_STRNDUP 1" >>confdefs.h + + + + + + + + + + if test $ac_cv_have_decl_strnlen = no; then + HAVE_DECL_STRNLEN=0 + else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5 +printf %s "checking for working strnlen... " >&6; } +if test ${ac_cv_func_strnlen_working+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + # Guess no on AIX systems, yes otherwise. + case "$host_os" in + aix*) ac_cv_func_strnlen_working=no;; + *) ac_cv_func_strnlen_working=yes;; + esac +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + +#define S "foobar" +#define S_LEN (sizeof S - 1) + + /* At least one implementation is buggy: that of AIX 4.3 would + give strnlen (S, 1) == 3. */ + + int i; + for (i = 0; i < S_LEN + 1; ++i) + { + int expected = i <= S_LEN ? i : S_LEN; + if (strnlen (S, i) != expected) + return 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_strnlen_working=yes +else case e in #( + e) ac_cv_func_strnlen_working=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5 +printf "%s\n" "$ac_cv_func_strnlen_working" >&6; } +test $ac_cv_func_strnlen_working = no && : + + + if test $ac_cv_func_strnlen_working = no; then + REPLACE_STRNLEN=1 + fi + fi + + if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext" + + : + fi + + + + + + GNULIB_STRNLEN=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_STRNLEN 1" >>confdefs.h + + + + + + + + if test $ac_cv_func_strptime != yes; then + HAVE_STRPTIME=0 + fi + + if test $HAVE_STRPTIME = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strptime.$ac_objext" + + + + : + + fi + + + + + + GNULIB_STRPTIME=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_STRPTIME 1" >>confdefs.h + + + + + + + if test "$ac_cv_type_unsigned_long_long_int" = yes; then + ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull" +if test "x$ac_cv_func_strtoull" = xyes +then : + printf "%s\n" "#define HAVE_STRTOULL 1" >>confdefs.h + +fi + + if test $ac_cv_func_strtoull = no; then + HAVE_STRTOULL=0 + fi + fi + + if test $HAVE_STRTOULL = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strtoull.$ac_objext" + + + : + + fi + + + + + + GNULIB_STRTOULL=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_STRTOULL 1" >>confdefs.h + + + + + + + + + if test "$ac_cv_have_decl_strtoumax" = yes; then + if test "$ac_cv_func_strtoumax" != yes; then + # HP-UX 11.11 has "#define strtoimax(...) ..." but no function. + REPLACE_STRTOUMAX=1 + fi + else + HAVE_DECL_STRTOUMAX=0 + fi + + if test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strtoumax.$ac_objext" + + + ac_fn_check_decl "$LINENO" "strtoull" "ac_cv_have_decl_strtoull" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strtoull" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_STRTOULL $ac_have_decl" >>confdefs.h + + + + fi + + + + + + GNULIB_STRTOUMAX=1 + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5 +printf %s "checking absolute name of <sys/stat.h>... " >&6; } +if test ${gl_cv_next_sys_stat_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_sys_stat_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/stat.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_stat_h + gl_cv_next_sys_stat_h='"'$gl_header'"' + else + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 +printf "%s\n" "$gl_cv_next_sys_stat_h" >&6; } + fi + NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/stat.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_stat_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive + + + + + + + + + WINDOWS_STAT_TIMESPEC=0 + + + + + + + + + ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_type_nlink_t" = xyes +then : + +else case e in #( + e) +printf "%s\n" "#define nlink_t int" >>confdefs.h + ;; +esac +fi + + + + for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_wait_h='<'sys/wait.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/wait.h>" >&5 +printf %s "checking absolute name of <sys/wait.h>... " >&6; } +if test ${gl_cv_next_sys_wait_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_sys_wait_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/wait.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/wait.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_wait_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_wait_h + gl_cv_next_sys_wait_h='"'$gl_header'"' + else + gl_cv_next_sys_wait_h='<'sys/wait.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_wait_h" >&5 +printf "%s\n" "$gl_cv_next_sys_wait_h" >&6; } + fi + NEXT_SYS_WAIT_H=$gl_cv_next_sys_wait_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/wait.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_wait_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H=$gl_next_as_first_directive + + + + + + + + + for gl_func in waitpid; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/wait.h> +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + : + + + + + + + + + + + + ac_fn_check_decl "$LINENO" "localtime_r" "ac_cv_have_decl_localtime_r" "#include <time.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_localtime_r" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_LOCALTIME_R $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_localtime_r = no; then + HAVE_DECL_LOCALTIME_R=0 + fi + + + if test $ac_cv_func_localtime_r = yes; then + HAVE_LOCALTIME_R=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5 +printf %s "checking whether localtime_r is compatible with its POSIX signature... " >&6; } +if test ${gl_cv_time_r_posix+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <time.h> +int +main (void) +{ +/* We don't need to append 'restrict's to the argument types, + even though the POSIX signature has the 'restrict's, + since C99 says they can't affect type compatibility. */ + struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r; + if (ptr) return 0; + /* Check the return type is a pointer. + On HP-UX 10 it is 'int'. */ + *localtime_r (0, 0); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_time_r_posix=yes +else case e in #( + e) gl_cv_time_r_posix=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5 +printf "%s\n" "$gl_cv_time_r_posix" >&6; } + if test $gl_cv_time_r_posix = yes; then + REPLACE_LOCALTIME_R=0 + else + REPLACE_LOCALTIME_R=1 + fi + else + HAVE_LOCALTIME_R=0 + fi + + if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext" + + + : + + fi + + + + + + GNULIB_TIME_R=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_TIME_R 1" >>confdefs.h + + + + + + + + + ac_fn_c_check_type "$LINENO" "timezone_t" "ac_cv_type_timezone_t" "#include <time.h> +" +if test "x$ac_cv_type_timezone_t" = xyes +then : + +printf "%s\n" "#define HAVE_TIMEZONE_T 1" >>confdefs.h + + +fi + + if test "$ac_cv_type_timezone_t" = yes; then + HAVE_TIMEZONE_T=1 + fi + + if test $HAVE_TIMEZONE_T = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS time_rz.$ac_objext" + + fi + + + + + + GNULIB_TIME_RZ=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_TIME_RZ 1" >>confdefs.h + + + + + + + REPLACE_TIMEGM=0 + + if test $ac_cv_func_timegm = yes; then + if test "$gl_cv_func_working_mktime" != yes; then + # Assume that timegm is buggy if mktime is. + REPLACE_TIMEGM=1 + fi + else + HAVE_TIMEGM=0 + fi + + if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS timegm.$ac_objext" + + + : + + fi + + + + + + GNULIB_TIMEGM=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_TIMEGM 1" >>confdefs.h + + + + : + + + + + + if test $ac_cv_func_tzset = no; then + HAVE_TZSET=0 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether tzset clobbers localtime buffer" >&5 +printf %s "checking whether tzset clobbers localtime buffer... " >&6; } +if test ${gl_cv_func_tzset_clobber+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess all is fine on glibc systems. + *-gnu*) gl_cv_func_tzset_clobber="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_tzset_clobber="guessing yes" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <time.h> +#include <stdlib.h> + +int +main () +{ + time_t t1 = 853958121; + struct tm *p, s; + putenv ("TZ=GMT0"); + p = localtime (&t1); + s = *p; + putenv ("TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"); + tzset (); + return (p->tm_year != s.tm_year + || p->tm_mon != s.tm_mon + || p->tm_mday != s.tm_mday + || p->tm_hour != s.tm_hour + || p->tm_min != s.tm_min + || p->tm_sec != s.tm_sec); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_tzset_clobber=no +else case e in #( + e) gl_cv_func_tzset_clobber=yes ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_tzset_clobber" >&5 +printf "%s\n" "$gl_cv_func_tzset_clobber" >&6; } + + +printf "%s\n" "#define HAVE_RUN_TZSET_TEST 1" >>confdefs.h + + + REPLACE_TZSET=0 + case "$gl_cv_func_tzset_clobber" in + *yes) + REPLACE_TZSET=1 + +printf "%s\n" "#define TZSET_CLOBBERS_LOCALTIME 1" >>confdefs.h + + + + + NEED_LOCALTIME_BUFFER=1 + REPLACE_GMTIME=1 + REPLACE_LOCALTIME=1 + + ;; + esac + case "$host_os" in + mingw*) REPLACE_TZSET=1 ;; + esac + + if test $HAVE_TZSET = 0 || test $REPLACE_TZSET = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS tzset.$ac_objext" + + fi + + + + + + GNULIB_TZSET=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_TZSET 1" >>confdefs.h + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_unistd_h='<'unistd.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5 +printf %s "checking absolute name of <unistd.h>... " >&6; } +if test ${gl_cv_next_unistd_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_unistd_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'unistd.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_unistd_h + gl_cv_next_unistd_h='"'$gl_header'"' + else + gl_cv_next_unistd_h='<'unistd.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5 +printf "%s\n" "$gl_cv_next_unistd_h" >&6; } + fi + NEXT_UNISTD_H=$gl_cv_next_unistd_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'unistd.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_unistd_h + fi + NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_unistd_h = yes; then + HAVE_UNISTD_H=1 + else + HAVE_UNISTD_H=0 + fi + + + + + + + + for gl_func in chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell endusershell group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite readlink readlinkat rmdir sethostname sleep symlink symlinkat truncate ttyname_r unlink unlinkat usleep; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +/* Some systems declare various items in the wrong headers. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <fcntl.h> +# include <stdio.h> +# include <stdlib.h> +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include <io.h> +# endif +#endif + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 + } + } + } + + + + + } + }; then + LIBUNISTRING_UNISTR_H='unistr.h' + else + LIBUNISTRING_UNISTR_H= + fi + + + + +printf "%s\n" "#define GNULIB_UNISTR_U8_MBTOUCR 1" >>confdefs.h + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE= + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE='#' +else + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE='#' + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE= +fi + + + + +printf "%s\n" "#define GNULIB_UNISTR_U8_UCTOMB 1" >>confdefs.h + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE= + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE='#' +else + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE='#' + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE= +fi + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 + } + } + } + + + + + } + }; then + LIBUNISTRING_UNITYPES_H='unitypes.h' + else + LIBUNISTRING_UNITYPES_H= + fi + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 + } + } + } + + + + + } + }; then + LIBUNISTRING_UNIWIDTH_H='uniwidth.h' + else + LIBUNISTRING_UNIWIDTH_H= + fi + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 6 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE= + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE='#' +else + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE='#' + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE= +fi + + + + +printf "%s\n" "#define USE_UNLOCKED_IO 1" >>confdefs.h + + + + + + + + + + + + + + + + + + + + + + if test $ac_cv_have_decl_unsetenv = no; then + HAVE_DECL_UNSETENV=0 + fi + ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv" +if test "x$ac_cv_func_unsetenv" = xyes +then : + printf "%s\n" "#define HAVE_UNSETENV 1" >>confdefs.h + +fi + + if test $ac_cv_func_unsetenv = no; then + HAVE_UNSETENV=0 + else + HAVE_UNSETENV=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5 +printf %s "checking for unsetenv() return type... " >&6; } +if test ${gt_cv_func_unsetenv_ret+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#undef _BSD +#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */ +#include <stdlib.h> +extern +#ifdef __cplusplus +"C" +#endif +int unsetenv (const char *name); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_func_unsetenv_ret='int' +else case e in #( + e) gt_cv_func_unsetenv_ret='void' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5 +printf "%s\n" "$gt_cv_func_unsetenv_ret" >&6; } + if test $gt_cv_func_unsetenv_ret = 'void'; then + +printf "%s\n" "#define VOID_UNSETENV 1" >>confdefs.h + + REPLACE_UNSETENV=1 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5 +printf %s "checking whether unsetenv obeys POSIX... " >&6; } +if test ${gl_cv_func_unsetenv_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_unsetenv_works="guessing no" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <stdlib.h> + #include <errno.h> + extern char **environ; + +int +main (void) +{ + + char entry1[] = "a=1"; + char entry2[] = "b=2"; + char *env[] = { entry1, entry2, NULL }; + if (putenv ((char *) "a=1")) return 1; + if (putenv (entry2)) return 2; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 3; + if (!unsetenv ("") || errno != EINVAL) return 4; + entry2[0] = 'b'; + environ = env; + if (!getenv ("a")) return 5; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 6; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_unsetenv_works=yes +else case e in #( + e) gl_cv_func_unsetenv_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5 +printf "%s\n" "$gl_cv_func_unsetenv_works" >&6; } + case "$gl_cv_func_unsetenv_works" in + *yes) ;; + *) + REPLACE_UNSETENV=1 + ;; + esac + fi + + if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext" + + + + + + fi + + + + + + GNULIB_UNSETENV=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for variable-length arrays" >&5 +printf %s "checking for variable-length arrays... " >&6; } +if test ${ac_cv_c_vararrays+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC_NO_VLA__ + defined + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "defined" >/dev/null 2>&1 +then : + ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined' +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test for VLA support. This test is partly inspired + from examples in the C standard. Use at least two VLA + functions to detect the GCC 3.4.3 bug described in: + http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html + */ + #ifdef __STDC_NO_VLA__ + syntax error; + #else + extern int n; + int B[100]; + int fvla (int m, int C[m][m]); + + int + simple (int count, int all[static count]) + { + return all[count - 1]; + } + + int + fvla (int m, int C[m][m]) + { + typedef int VLA[m][m]; + VLA x; + int D[m]; + static int (*q)[m] = &B; + int (*s)[n] = q; + return C && &x[0][0] == &D[0] && &D[0] == s[0]; + } + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_vararrays=yes +else case e in #( + e) ac_cv_c_vararrays=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -rf conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_vararrays" >&5 +printf "%s\n" "$ac_cv_c_vararrays" >&6; } + if test "$ac_cv_c_vararrays" = yes; then + +printf "%s\n" "#define HAVE_C_VARARRAYS 1" >>confdefs.h + + elif test "$ac_cv_c_vararrays" = no; then + +printf "%s\n" "#define __STDC_NO_VLA__ 1" >>confdefs.h + + fi + + + + if test $ac_cv_func_vasnprintf = no; then + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + + if test $ac_cv_func_vasnprintf = yes; then + +printf "%s\n" "#define REPLACE_VASNPRINTF 1" >>confdefs.h + + fi + + + + + + + + + + + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes +then : + +else case e in #( + e) +printf "%s\n" "#define ptrdiff_t long" >>confdefs.h + + ;; +esac +fi + + + + + + + + fi + + + ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf" +if test "x$ac_cv_func_vasprintf" = xyes +then : + printf "%s\n" "#define HAVE_VASPRINTF 1" >>confdefs.h + +fi + + if test $ac_cv_func_vasprintf = no; then + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asprintf.$ac_objext" + + + if test $ac_cv_func_vasprintf = yes; then + REPLACE_VASPRINTF=1 + else + HAVE_VASPRINTF=0 + fi + + + + + + + + + fi + + + + + + + GNULIB_VASPRINTF=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_VASPRINTF 1" >>confdefs.h + + + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=asprintf:2:c-format" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=vasprintf:2:c-format" + + +# Check whether --with-packager was given. +if test ${with_packager+y} +then : + withval=$with_packager; case $withval in + yes|no) ;; + *) +printf "%s\n" "#define PACKAGE_PACKAGER \"$withval\"" >>confdefs.h + ;; + esac + +fi + + + +# Check whether --with-packager-version was given. +if test ${with_packager_version+y} +then : + withval=$with_packager_version; case $withval in + yes|no) ;; + *) +printf "%s\n" "#define PACKAGE_PACKAGER_VERSION \"$withval\"" >>confdefs.h + ;; + esac + +fi + + + +# Check whether --with-packager-bug-reports was given. +if test ${with_packager_bug_reports+y} +then : + withval=$with_packager_bug_reports; case $withval in + yes|no) ;; + *) +printf "%s\n" "#define PACKAGE_PACKAGER_BUG_REPORTS \"$withval\"" >>confdefs.h + ;; + esac + +fi + + + if test "X$with_packager" = "X" && \ + test "X$with_packager_version$with_packager_bug_reports" != "X" + then + as_fn_error $? "The --with-packager-{bug-reports,version} options require --with-packager" "$LINENO" 5 + fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wchar_h='<'wchar.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5 +printf %s "checking absolute name of <wchar.h>... " >&6; } +if test ${gl_cv_next_wchar_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_wchar_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <wchar.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wchar.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wchar_h + gl_cv_next_wchar_h='"'$gl_header'"' + else + gl_cv_next_wchar_h='<'wchar.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5 +printf "%s\n" "$gl_cv_next_wchar_h" >&6; } + fi + NEXT_WCHAR_H=$gl_cv_next_wchar_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'wchar.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_wchar_h + fi + NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + + + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + + + + for gl_func in btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime ; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <stddef.h> +# include <stdio.h> +# include <time.h> +#endif +#include <wchar.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else case e in #( + e) gl_cv_func_mbrtowc_incomplete_state=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else case e in #( + e) gl_cv_func_mbrtowc_sanitycheck=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_wcrtomb = no; then + HAVE_WCRTOMB=0 + ac_fn_check_decl "$LINENO" "wcrtomb" "ac_cv_have_decl_wcrtomb" " +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_wcrtomb" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_WCRTOMB $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_wcrtomb = yes; then + REPLACE_WCRTOMB=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_WCRTOMB=1 + else + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wcrtomb return value is correct" >&5 +printf %s "checking whether wcrtomb return value is correct... " >&6; } +if test ${gl_cv_func_wcrtomb_retval+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + case "$host_os" in + # Guess no on AIX 4, OSF/1 and Solaris. + aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wcrtomb_retval="guessing yes" ;; + esac + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + int result = 0; + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 1; + } + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 2; + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 4; + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 8; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_wcrtomb_retval=yes +else case e in #( + e) gl_cv_func_wcrtomb_retval=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcrtomb_retval" >&5 +printf "%s\n" "$gl_cv_func_wcrtomb_retval" >&6; } + case "$gl_cv_func_wcrtomb_retval" in + *yes) ;; + *) REPLACE_WCRTOMB=1 ;; + esac + fi + fi + + if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS wcrtomb.$ac_objext" + + + : + + fi + + + + + + GNULIB_WCRTOMB=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_WCRTOMB 1" >>confdefs.h + + + + + + + + + if test $ac_cv_func_iswcntrl = yes; then + HAVE_ISWCNTRL=1 + else + HAVE_ISWCNTRL=0 + fi + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wctype_h='<'wctype.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5 +printf %s "checking absolute name of <wctype.h>... " >&6; } +if test ${gl_cv_next_wctype_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_wctype_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <wctype.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wctype_h + gl_cv_next_wctype_h='"'$gl_header'"' + else + gl_cv_next_wctype_h='<'wctype.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 +printf "%s\n" "$gl_cv_next_wctype_h" >&6; } + fi + NEXT_WCTYPE_H=$gl_cv_next_wctype_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'wctype.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_wctype_h + fi + NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_wctype_h = yes; then + if test $ac_cv_func_iswcntrl = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 +printf %s "checking whether iswcntrl works... " >&6; } +if test ${gl_cv_func_iswcntrl_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test "$cross_compiling" = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + #if __GNU_LIBRARY__ == 1 + Linux libc5 i18n is broken. + #endif +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_iswcntrl_works="guessing yes" +else case e in #( + e) gl_cv_func_iswcntrl_works="guessing no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #include <wctype.h> + int main () { return iswprint ('x') == 0; } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_iswcntrl_works=yes +else case e in #( + e) gl_cv_func_iswcntrl_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 +printf "%s\n" "$gl_cv_func_iswcntrl_works" >&6; } + fi + HAVE_WCTYPE_H=1 + else + HAVE_WCTYPE_H=0 + fi + + + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + fi + + if test $REPLACE_ISWCNTRL = 1; then + REPLACE_TOWLOWER=1 + else + ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" +if test "x$ac_cv_func_towlower" = xyes +then : + printf "%s\n" "#define HAVE_TOWLOWER 1" >>confdefs.h + +fi + + if test $ac_cv_func_towlower = yes; then + REPLACE_TOWLOWER=0 + else + ac_fn_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #if HAVE_WCTYPE_H + # include <wctype.h> + #endif + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_towlower" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_TOWLOWER $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_towlower = yes; then + REPLACE_TOWLOWER=1 + else + REPLACE_TOWLOWER=0 + fi + fi + fi + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then + : + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 +printf %s "checking for wctype_t... " >&6; } +if test ${gl_cv_type_wctype_t+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #if HAVE_WCTYPE_H + # include <wctype.h> + #endif + wctype_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctype_t=yes +else case e in #( + e) gl_cv_type_wctype_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 +printf "%s\n" "$gl_cv_type_wctype_t" >&6; } + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 +printf %s "checking for wctrans_t... " >&6; } +if test ${gl_cv_type_wctrans_t+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #include <wctype.h> + wctrans_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctrans_t=yes +else case e in #( + e) gl_cv_type_wctrans_t=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 +printf "%s\n" "$gl_cv_type_wctrans_t" >&6; } + if test $gl_cv_type_wctrans_t = no; then + HAVE_WCTRANS_T=0 + fi + + + for gl_func in wctype iswctype wctrans towctrans ; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <stddef.h> +# include <stdio.h> +# include <time.h> +# include <wchar.h> +#endif +#include <wctype.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + ac_fn_check_decl "$LINENO" "wcwidth" "ac_cv_have_decl_wcwidth" " +/* AIX 3.2.5 declares wcwidth in <string.h>. */ +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_wcwidth" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_WCWIDTH $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_wcwidth != yes; then + HAVE_DECL_WCWIDTH=0 + fi + + if test $ac_cv_func_wcwidth = yes; then + HAVE_WCWIDTH=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wcwidth works reasonably in UTF-8 locales" >&5 +printf %s "checking whether wcwidth works reasonably in UTF-8 locales... " >&6; } +if test ${gl_cv_func_wcwidth_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc and AIX 7 systems. + *-gnu* | aix[7-9]*) gl_cv_func_wcwidth_works="guessing yes";; + *) gl_cv_func_wcwidth_works="guessing no";; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +/* AIX 3.2.5 declares wcwidth in <string.h>. */ +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +#if !HAVE_DECL_WCWIDTH +extern +# ifdef __cplusplus +"C" +# endif +int wcwidth (int); +#endif +int main () +{ + int result = 0; + if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL) + { + if (wcwidth (0x0301) > 0) + result |= 1; + if (wcwidth (0x05B0) > 0) + result |= 2; + if (wcwidth (0x200B) > 0) + result |= 4; + if (wcwidth (0xFF1A) == 0) + result |= 8; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_wcwidth_works=yes +else case e in #( + e) gl_cv_func_wcwidth_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcwidth_works" >&5 +printf "%s\n" "$gl_cv_func_wcwidth_works" >&6; } + case "$gl_cv_func_wcwidth_works" in + *yes) ;; + *no) REPLACE_WCWIDTH=1 ;; + esac + else + HAVE_WCWIDTH=0 + fi + + if test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS wcwidth.$ac_objext" + + fi + + + + + + GNULIB_WCWIDTH=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_WCWIDTH 1" >>confdefs.h + + + + : + + + ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "#define HAVE_STDINT_H 1" >>confdefs.h + +fi + + + + + : + + + + : + + : + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xasprintf:1:c-format" + + # End of code from modules + + + + + + + + + + gltests_libdeps= + gltests_ltlibdeps= + + + + + + + + + + gl_source_base='gnulib-tests' + gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS + + gl_module_indicator_condition=$gltests_WITNESS + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS accept.$ac_objext" + + fi + + + + + + if test "$GNULIB_ACCEPT" != 1; then + if test "$GNULIB_ACCEPT" = 0; then + GNULIB_ACCEPT=$gl_module_indicator_condition + else + GNULIB_ACCEPT="($GNULIB_ACCEPT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_ACCEPT 1" >>confdefs.h + + + + + + + + if test $ac_cv_header_arpa_inet_h = yes; then + HAVE_ARPA_INET_H=1 + else + HAVE_ARPA_INET_H=0 + fi + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <arpa/inet.h>" >&5 +printf %s "checking absolute name of <arpa/inet.h>... " >&6; } +if test ${gl_cv_next_arpa_inet_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_arpa_inet_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <arpa/inet.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'arpa/inet.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_arpa_inet_h + gl_cv_next_arpa_inet_h='"'$gl_header'"' + else + gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5 +printf "%s\n" "$gl_cv_next_arpa_inet_h" >&6; } + fi + NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'arpa/inet.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_arpa_inet_h + fi + NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive + + + + + + + + + for gl_func in inet_ntop inet_pton; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* On some systems, this header is not self-consistent. */ +#if !(defined __GLIBC__ || defined __UCLIBC__) +# include <sys/socket.h> +#endif +#ifdef __TANDEM +# include <netdb.h> +#endif +#include <arpa/inet.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS bind.$ac_objext" + + fi + + + + + + if test "$GNULIB_BIND" != 1; then + if test "$GNULIB_BIND" = 0; then + GNULIB_BIND=$gl_module_indicator_condition + else + GNULIB_BIND="($GNULIB_BIND || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_BIND 1" >>confdefs.h + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5 +printf %s "checking for a turkish Unicode locale... " >&6; } +if test ${gt_cv_locale_tr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. But BeOS does not + implement the Turkish upper-/lowercase mappings. Therefore, let this + program return 1 on BeOS. */ + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the eighth month, the second + character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f) + return 1; + /* Check whether the upper-/lowercase mappings are as expected for + Turkish. */ + if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i' + || towupper(0x0131) != 'I' || towlower ('I') != 0x0131) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=Turkish_Turkey.65001 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr.UTF-8 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + fi + fi + ;; + esac + else + gt_cv_locale_tr_utf8=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_tr_utf8" >&6; } + LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8 + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS connect.$ac_objext" + + fi + + + + + + if test "$GNULIB_CONNECT" != 1; then + if test "$GNULIB_CONNECT" = 0; then + GNULIB_CONNECT=$gl_module_indicator_condition + else + GNULIB_CONNECT="($GNULIB_CONNECT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_CONNECT 1" >>confdefs.h + + + + + + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_FDOPEN=1 + fi + + if test $REPLACE_FDOPEN = 0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fdopen sets errno" >&5 +printf %s "checking whether fdopen sets errno... " >&6; } +if test ${gl_cv_func_fdopen_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test "$cross_compiling" = yes +then : + case "$host_os" in + mingw*) gl_cv_func_fdopen_works="guessing no" ;; + *) gl_cv_func_fdopen_works="guessing yes" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <errno.h> +int +main (void) +{ + FILE *fp; + errno = 0; + fp = fdopen (-1, "r"); + if (fp == NULL && errno == 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_fdopen_works=yes +else case e in #( + e) gl_cv_func_fdopen_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopen_works" >&5 +printf "%s\n" "$gl_cv_func_fdopen_works" >&6; } + case "$gl_cv_func_fdopen_works" in + *no) REPLACE_FDOPEN=1 ;; + esac + fi + + if test $REPLACE_FDOPEN = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS fdopen.$ac_objext" + + + fi + + + + + + if test "$GNULIB_FDOPEN" != 1; then + if test "$GNULIB_FDOPEN" = 0; then + GNULIB_FDOPEN=$gl_module_indicator_condition + else + GNULIB_FDOPEN="($GNULIB_FDOPEN || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_FDOPEN 1" >>confdefs.h + + + + + + + if test $ac_cv_func_ftruncate = yes; then + + + case "$host_os" in + mingw*) + REPLACE_FTRUNCATE=1 + ;; + esac + + else + HAVE_FTRUNCATE=0 + fi + + if test $HAVE_FTRUNCATE = 0 || test $REPLACE_FTRUNCATE = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS ftruncate.$ac_objext" + + + ac_fn_c_check_func "$LINENO" "chsize" "ac_cv_func_chsize" +if test "x$ac_cv_func_chsize" = xyes +then : + printf "%s\n" "#define HAVE_CHSIZE 1" >>confdefs.h + +fi + + + fi + + + + + + if test "$GNULIB_FTRUNCATE" != 1; then + if test "$GNULIB_FTRUNCATE" = 0; then + GNULIB_FTRUNCATE=$gl_module_indicator_condition + else + GNULIB_FTRUNCATE="($GNULIB_FTRUNCATE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_FTRUNCATE 1" >>confdefs.h + + + + + + + + + case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in + *yes,yes) ;; + *) + REPLACE_GETCWD=1 + ;; + esac + + if test $REPLACE_GETCWD = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS getcwd-lgpl.$ac_objext" + + fi + + + + + + if test "$GNULIB_GETCWD" != 1; then + if test "$GNULIB_GETCWD" = 0; then + GNULIB_GETCWD=$gl_module_indicator_condition + else + GNULIB_GETCWD="($GNULIB_GETCWD || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_GETCWD 1" >>confdefs.h + + + + + + + ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = xyes +then : + printf "%s\n" "#define HAVE_GETPAGESIZE 1" >>confdefs.h + +fi + + if test $ac_cv_func_getpagesize = no; then + HAVE_GETPAGESIZE=0 + ac_fn_c_check_header_compile "$LINENO" "OS.h" "ac_cv_header_OS_h" "$ac_includes_default" +if test "x$ac_cv_header_OS_h" = xyes +then : + printf "%s\n" "#define HAVE_OS_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_OS_h = yes; then + HAVE_OS_H=1 + fi + ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_sys_param_h = yes; then + HAVE_SYS_PARAM_H=1 + fi + fi + case "$host_os" in + mingw*) + REPLACE_GETPAGESIZE=1 + ;; + esac + ac_fn_check_decl "$LINENO" "getpagesize" "ac_cv_have_decl_getpagesize" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getpagesize" = xyes +then : + +else case e in #( + e) HAVE_DECL_GETPAGESIZE=0 ;; +esac +fi + + if test $REPLACE_GETPAGESIZE = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS getpagesize.$ac_objext" + + fi + + + + + + if test "$GNULIB_GETPAGESIZE" != 1; then + if test "$GNULIB_GETPAGESIZE" = 0; then + GNULIB_GETPAGESIZE=$gl_module_indicator_condition + else + GNULIB_GETPAGESIZE="($GNULIB_GETPAGESIZE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_GETPAGESIZE 1" >>confdefs.h + + + + + + + + + + + HAVE_INET_PTON=1 + INET_PTON_LIB= + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + if test $HAVE_WINSOCK2_H = 1; then + ac_fn_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include <ws2tcpip.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_inet_pton" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_INET_PTON $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_inet_pton = yes; then + REPLACE_INET_PTON=1 + INET_PTON_LIB="-lws2_32" + else + HAVE_DECL_INET_PTON=0 + HAVE_INET_PTON=0 + fi + else + gl_save_LIBS=$LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing inet_pton" >&5 +printf %s "checking for library containing inet_pton... " >&6; } +if test ${ac_cv_search_inet_pton+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char inet_pton (void); +int +main (void) +{ +return inet_pton (); + ; + return 0; +} +_ACEOF +for ac_lib in '' nsl resolv +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_inet_pton=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_inet_pton+y} +then : + break +fi +done +if test ${ac_cv_search_inet_pton+y} +then : + +else case e in #( + e) ac_cv_search_inet_pton=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_pton" >&5 +printf "%s\n" "$ac_cv_search_inet_pton" >&6; } +ac_res=$ac_cv_search_inet_pton +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else case e in #( + e) ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton" +if test "x$ac_cv_func_inet_pton" = xyes +then : + printf "%s\n" "#define HAVE_INET_PTON 1" >>confdefs.h + +fi + + if test $ac_cv_func_inet_pton = no; then + HAVE_INET_PTON=0 + fi + ;; +esac +fi + + LIBS=$gl_save_LIBS + + if test "$ac_cv_search_inet_pton" != "no" \ + && test "$ac_cv_search_inet_pton" != "none required"; then + INET_PTON_LIB="$ac_cv_search_inet_pton" + fi + + + ac_fn_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include <arpa/inet.h> + #if HAVE_NETDB_H + # include <netdb.h> + #endif + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_inet_pton" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_INET_PTON $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_inet_pton = no; then + HAVE_DECL_INET_PTON=0 + fi + fi + + + if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS inet_pton.$ac_objext" + + + + + fi + + + + + + if test "$GNULIB_INET_PTON" != 1; then + if test "$GNULIB_INET_PTON" = 0; then + GNULIB_INET_PTON=$gl_module_indicator_condition + else + GNULIB_INET_PTON="($GNULIB_INET_PTON || $gl_module_indicator_condition)" + fi + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> + +int +main (void) +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> + +int +main (void) +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + +int +main (void) +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + +int +main (void) +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes +then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +unsigned short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + unsigned short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + unsigned short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + unsigned short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else case e in #( + e) ac_cv_c_bigendian=yes ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + + + + HAVE_IOCTL=1 + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_IOCTL=0 + else + ac_fn_c_check_func "$LINENO" "ioctl" "ac_cv_func_ioctl" +if test "x$ac_cv_func_ioctl" = xyes +then : + printf "%s\n" "#define HAVE_IOCTL 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ioctl with POSIX signature" >&5 +printf %s "checking for ioctl with POSIX signature... " >&6; } +if test ${gl_cv_func_ioctl_posix_signature+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/ioctl.h> +int +main (void) +{ +extern + #ifdef __cplusplus + "C" + #endif + int ioctl (int, int, ...); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_ioctl_posix_signature=yes +else case e in #( + e) gl_cv_func_ioctl_posix_signature=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ioctl_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_ioctl_posix_signature" >&6; } + if test $gl_cv_func_ioctl_posix_signature != yes; then + REPLACE_IOCTL=1 + fi + fi + + if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS ioctl.$ac_objext" + + fi + + + + + + if test "$GNULIB_IOCTL" != 1; then + if test "$GNULIB_IOCTL" = 0; then + GNULIB_IOCTL=$gl_module_indicator_condition + else + GNULIB_IOCTL="($GNULIB_IOCTL || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_IOCTL 1" >>confdefs.h + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS listen.$ac_objext" + + fi + + + + + + if test "$GNULIB_LISTEN" != 1; then + if test "$GNULIB_LISTEN" = 0; then + GNULIB_LISTEN=$gl_module_indicator_condition + else + GNULIB_LISTEN="($GNULIB_LISTEN || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_LISTEN 1" >>confdefs.h + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5 +printf %s "checking for a turkish Unicode locale... " >&6; } +if test ${gt_cv_locale_tr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. But BeOS does not + implement the Turkish upper-/lowercase mappings. Therefore, let this + program return 1 on BeOS. */ + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the eighth month, the second + character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f) + return 1; + /* Check whether the upper-/lowercase mappings are as expected for + Turkish. */ + if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i' + || towupper(0x0131) != 'I' || towlower ('I') != 0x0131) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=Turkish_Turkey.65001 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr.UTF-8 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + fi + fi + ;; + esac + else + gt_cv_locale_tr_utf8=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_tr_utf8" >&6; } + LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8 + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in #( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + + + + + + nanosleep_save_libs=$LIBS + + # Solaris 2.5.1 needs -lposix4 to get the nanosleep function. + # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. + LIB_NANOSLEEP= + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5 +printf %s "checking for library containing nanosleep... " >&6; } +if test ${ac_cv_search_nanosleep+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char nanosleep (void); +int +main (void) +{ +return nanosleep (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt posix4 +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_nanosleep=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_nanosleep+y} +then : + break +fi +done +if test ${ac_cv_search_nanosleep+y} +then : + +else case e in #( + e) ac_cv_search_nanosleep=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5 +printf "%s\n" "$ac_cv_search_nanosleep" >&6; } +ac_res=$ac_cv_search_nanosleep +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ac_cv_search_nanosleep" = "none required" || + LIB_NANOSLEEP=$ac_cv_search_nanosleep +fi + + if test "x$ac_cv_search_nanosleep" != xno; then + + + if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple Mac OS X platforms. + # The test result would be 'no (mishandles large arguments)' in 64-bit + # mode but 'yes' in 32-bit mode. But we need a configuration result that + # is valid in both modes. + gl_cv_func_nanosleep='no (mishandles large arguments)' + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working nanosleep" >&5 +printf %s "checking for working nanosleep... " >&6; } +if test ${gl_cv_func_nanosleep+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test "$cross_compiling" = yes +then : + case "$host_os" in linux*) # Guess it halfway works when the kernel is Linux. + gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;; + *) # If we don't know, assume the worst. + gl_cv_func_nanosleep='guessing no' ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <errno.h> + #include <limits.h> + #include <signal.h> + #if HAVE_SYS_TIME_H + #include <sys/time.h> + #endif + #include <time.h> + #include <unistd.h> + #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) + #define TYPE_MAXIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) + + static void + check_for_SIGALRM (int sig) + { + if (sig != SIGALRM) + _exit (1); + } + + int + main () + { + static struct timespec ts_sleep; + static struct timespec ts_remaining; + static struct sigaction act; + /* Test for major problems first. */ + if (! nanosleep) + return 2; + act.sa_handler = check_for_SIGALRM; + sigemptyset (&act.sa_mask); + sigaction (SIGALRM, &act, NULL); + ts_sleep.tv_sec = 0; + ts_sleep.tv_nsec = 1; + alarm (1); + if (nanosleep (&ts_sleep, NULL) != 0) + return 3; + /* Test for a minor problem: the handling of large arguments. */ + ts_sleep.tv_sec = TYPE_MAXIMUM (time_t); + ts_sleep.tv_nsec = 999999999; + alarm (1); + if (nanosleep (&ts_sleep, &ts_remaining) != -1) + return 4; + if (errno != EINTR) + return 5; + if (ts_remaining.tv_sec <= TYPE_MAXIMUM (time_t) - 10) + return 6; + return 0; + } +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_nanosleep=yes +else case e in #( + e) case $? in 4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)';; *) gl_cv_func_nanosleep=no;; + esac ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nanosleep" >&5 +printf "%s\n" "$gl_cv_func_nanosleep" >&6; } + case "$gl_cv_func_nanosleep" in + *yes) + REPLACE_NANOSLEEP=0 + ;; + *) + REPLACE_NANOSLEEP=1 + case "$gl_cv_func_nanosleep" in + *"mishandles large arguments"*) + +printf "%s\n" "#define HAVE_BUG_BIG_NANOSLEEP 1" >>confdefs.h + + ;; + *) + # The replacement uses select(). Add $LIBSOCKET to $LIB_NANOSLEEP. + for ac_lib in $LIBSOCKET; do + case " $LIB_NANOSLEEP " in + *" $ac_lib "*) ;; + *) LIB_NANOSLEEP="$LIB_NANOSLEEP $ac_lib";; + esac + done + ;; + esac + ;; + esac + else + HAVE_NANOSLEEP=0 + fi + LIBS=$nanosleep_save_libs + + if test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS nanosleep.$ac_objext" + + + + : + + fi + + + + + + if test "$GNULIB_NANOSLEEP" != 1; then + if test "$GNULIB_NANOSLEEP" = 0; then + GNULIB_NANOSLEEP=$gl_module_indicator_condition + else + GNULIB_NANOSLEEP="($GNULIB_NANOSLEEP || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_NANOSLEEP 1" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <netinet/in.h> is self-contained" >&5 +printf %s "checking whether <netinet/in.h> is self-contained... " >&6; } +if test ${gl_cv_header_netinet_in_h_selfcontained+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <netinet/in.h> +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_netinet_in_h_selfcontained=yes +else case e in #( + e) gl_cv_header_netinet_in_h_selfcontained=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5 +printf "%s\n" "$gl_cv_header_netinet_in_h_selfcontained" >&6; } + if test $gl_cv_header_netinet_in_h_selfcontained = yes; then + NETINET_IN_H='' + else + NETINET_IN_H='netinet/in.h' + ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h + +fi + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_netinet_in_h='<'netinet/in.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <netinet/in.h>" >&5 +printf %s "checking absolute name of <netinet/in.h>... " >&6; } +if test ${gl_cv_next_netinet_in_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_netinet_in_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <netinet/in.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'netinet/in.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_netinet_in_h + gl_cv_next_netinet_in_h='"'$gl_header'"' + else + gl_cv_next_netinet_in_h='<'netinet/in.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5 +printf "%s\n" "$gl_cv_next_netinet_in_h" >&6; } + fi + NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'netinet/in.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_netinet_in_h + fi + NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_netinet_in_h = yes; then + HAVE_NETINET_IN_H=1 + else + HAVE_NETINET_IN_H=0 + fi + + fi + + if test -n "$NETINET_IN_H"; then + GL_GENERATE_NETINET_IN_H_TRUE= + GL_GENERATE_NETINET_IN_H_FALSE='#' +else + GL_GENERATE_NETINET_IN_H_TRUE='#' + GL_GENERATE_NETINET_IN_H_FALSE= +fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + + + if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then + REPLACE_PERROR=1 + fi + case ${gl_cv_func_strerror_r_works-unset} in + unset|*yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether perror matches strerror" >&5 +printf %s "checking whether perror matches strerror... " >&6; } +if test ${gl_cv_func_perror_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + gl_cv_func_perror_works="guessing no" + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <errno.h> + #include <stdio.h> + #include <stdlib.h> + #include <string.h> + +int +main (void) +{ +char *str = strerror (-1); + if (!getenv("CONFTEST_OUTPUT")) return 0; + if (!str) str = ""; + puts (str); + errno = -1; + perror (""); + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + if CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2 \ + && cmp conftest.txt1 conftest.txt2 >/dev/null; then + gl_cv_func_perror_works=yes + else + gl_cv_func_perror_works=no + fi + rm -rf conftest.txt1 conftest.txt2 +else case e in #( + e) gl_cv_func_perror_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_perror_works" >&5 +printf "%s\n" "$gl_cv_func_perror_works" >&6; } + if test "$gl_cv_func_perror_works" != yes; then + REPLACE_PERROR=1 + fi + ;; + *) + REPLACE_PERROR=1 + ;; + esac + + if test $REPLACE_PERROR = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS perror.$ac_objext" + + fi + + + + + + if test "$GNULIB_PERROR" != 1; then + if test "$GNULIB_PERROR" = 0; then + GNULIB_PERROR=$gl_module_indicator_condition + else + GNULIB_PERROR="($GNULIB_PERROR || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_PERROR 1" >>confdefs.h + + + + + + + + if test $ac_cv_func_pipe != yes; then + HAVE_PIPE=0 + fi + + if test $HAVE_PIPE = 0; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS pipe.$ac_objext" + + fi + + + + + + if test "$GNULIB_PIPE" != 1; then + if test "$GNULIB_PIPE" = 0; then + GNULIB_PIPE=$gl_module_indicator_condition + else + GNULIB_PIPE="($GNULIB_PIPE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_PIPE 1" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for putenv compatible with GNU and SVID" >&5 +printf %s "checking for putenv compatible with GNU and SVID... " >&6; } +if test ${gl_cv_func_svid_putenv+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_svid_putenv="guessing no" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Put it in env. */ + if (putenv ("CONFTEST_putenv=val")) + return 1; + + /* Try to remove it. */ + if (putenv ("CONFTEST_putenv")) + return 2; + + /* Make sure it was deleted. */ + if (getenv ("CONFTEST_putenv") != 0) + return 3; + + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_svid_putenv=yes +else case e in #( + e) gl_cv_func_svid_putenv=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_svid_putenv" >&5 +printf "%s\n" "$gl_cv_func_svid_putenv" >&6; } + case "$gl_cv_func_svid_putenv" in + *yes) ;; + *) + REPLACE_PUTENV=1 + ;; + esac + + if test $REPLACE_PUTENV = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS putenv.$ac_objext" + + + ac_fn_check_decl "$LINENO" "_putenv" "ac_cv_have_decl__putenv" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl__putenv" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL__PUTENV $ac_have_decl" >>confdefs.h + + + fi + + + + + + if test "$GNULIB_PUTENV" != 1; then + if test "$GNULIB_PUTENV" = 0; then + GNULIB_PUTENV=$gl_module_indicator_condition + else + GNULIB_PUTENV="($GNULIB_PUTENV || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_PUTENV 1" >>confdefs.h + + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in #( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in #( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + REPLACE_SELECT=1 + else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select supports a 0 argument" >&5 +printf %s "checking whether select supports a 0 argument... " >&6; } +if test ${gl_cv_func_select_supports0+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on Interix. + interix*) gl_cv_func_select_supports0="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_select_supports0="guessing yes";; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/types.h> +#include <sys/time.h> +#if HAVE_SYS_SELECT_H +#include <sys/select.h> +#endif +int main () +{ + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_supports0=yes +else case e in #( + e) gl_cv_func_select_supports0=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_supports0" >&5 +printf "%s\n" "$gl_cv_func_select_supports0" >&6; } + case "$gl_cv_func_select_supports0" in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select detects invalid fds" >&5 +printf %s "checking whether select detects invalid fds... " >&6; } +if test ${gl_cv_func_select_detects_ebadf+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_select_detects_ebadf="guessing no" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/types.h> +#include <sys/time.h> +#if HAVE_SYS_SELECT_H +# include <sys/select.h> +#endif +#include <unistd.h> +#include <errno.h> + +int +main (void) +{ + + fd_set set; + dup2(0, 16); + FD_ZERO(&set); + FD_SET(16, &set); + close(16); + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_detects_ebadf=yes +else case e in #( + e) gl_cv_func_select_detects_ebadf=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_detects_ebadf" >&5 +printf "%s\n" "$gl_cv_func_select_detects_ebadf" >&6; } + case $gl_cv_func_select_detects_ebadf in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + fi + + LIB_SELECT="$LIBSOCKET" + if test $REPLACE_SELECT = 1; then + case "$host_os" in + mingw*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +int +main () +{ + MsgWaitForMultipleObjects (0, NULL, 0, 0, 0); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else case e in #( + e) LIB_SELECT="$LIB_SELECT -luser32" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ;; + esac + fi + + + if test $REPLACE_SELECT = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS select.$ac_objext" + + fi + + + + + + if test "$GNULIB_SELECT" != 1; then + if test "$GNULIB_SELECT" = 0; then + GNULIB_SELECT=$gl_module_indicator_condition + else + GNULIB_SELECT="($GNULIB_SELECT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_SELECT 1" >>confdefs.h + + + + + + + + case "$host_os" in + mingw*) REPLACE_SETLOCALE=1 ;; + cygwin*) + case `uname -r` in + 1.5.*) REPLACE_SETLOCALE=1 ;; + esac + ;; + esac + + if test $REPLACE_SETLOCALE = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS setlocale.$ac_objext" + + + : + + fi + + + + + + if test "$GNULIB_SETLOCALE" != 1; then + if test "$GNULIB_SETLOCALE" = 0; then + GNULIB_SETLOCALE=$gl_module_indicator_condition + else + GNULIB_SETLOCALE="($GNULIB_SETLOCALE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_SETLOCALE 1" >>confdefs.h + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS setsockopt.$ac_objext" + + fi + + + + + + if test "$GNULIB_SETSOCKOPT" != 1; then + if test "$GNULIB_SETSOCKOPT" = 0; then + GNULIB_SETSOCKOPT=$gl_module_indicator_condition + else + GNULIB_SETSOCKOPT="($GNULIB_SETSOCKOPT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_SETSOCKOPT 1" >>confdefs.h + + + + + + ac_fn_check_decl "$LINENO" "sleep" "ac_cv_have_decl_sleep" "#include <unistd.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_sleep" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_SLEEP $ac_have_decl" >>confdefs.h + + + if test $ac_cv_have_decl_sleep != yes; then + HAVE_SLEEP=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working sleep" >&5 +printf %s "checking for working sleep... " >&6; } +if test ${gl_cv_func_sleep_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_sleep_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_sleep_works="guessing no" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <errno.h> +#include <unistd.h> +#include <signal.h> +static void +handle_alarm (int sig) +{ + if (sig != SIGALRM) + _exit (2); +} + +int +main (void) +{ + + /* Failure to compile this test due to missing alarm is okay, + since all such platforms (mingw) also lack sleep. */ + unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days. */ + unsigned int remaining; + signal (SIGALRM, handle_alarm); + alarm (1); + remaining = sleep (pentecost); + if (remaining > pentecost) + return 3; + if (remaining <= pentecost - 10) + return 4; + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_sleep_works=yes +else case e in #( + e) gl_cv_func_sleep_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_sleep_works" >&5 +printf "%s\n" "$gl_cv_func_sleep_works" >&6; } + case "$gl_cv_func_sleep_works" in + *yes) ;; + *) + REPLACE_SLEEP=1 + ;; + esac + fi + + if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS sleep.$ac_objext" + + fi + + + + + + if test "$GNULIB_SLEEP" != 1; then + if test "$GNULIB_SLEEP" = 0; then + GNULIB_SLEEP=$gl_module_indicator_condition + else + GNULIB_SLEEP="($GNULIB_SLEEP || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_SLEEP 1" >>confdefs.h + + + + + + + gl_cv_func_snprintf_usable=no + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h + +fi + + if test $ac_cv_func_snprintf = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5 +printf %s "checking whether snprintf respects a size of 1... " >&6; } +if test ${gl_cv_func_snprintf_size1+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test "$cross_compiling" = yes +then : + gl_cv_func_snprintf_size1="guessing yes" +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + my_snprintf (buf, 1, "%d", 12345); + return buf[1] != 'E'; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_snprintf_size1=yes +else case e in #( + e) gl_cv_func_snprintf_size1=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_size1" >&5 +printf "%s\n" "$gl_cv_func_snprintf_size1" >&6; } + + case "$gl_cv_func_snprintf_size1" in + *yes) + + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5 +printf %s "checking whether printf supports POSIX/XSI format strings with positions... " >&6; } +if test ${gl_cv_func_printf_positions+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test "$cross_compiling" = yes +then : + + case "$host_os" in + netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) + gl_cv_func_printf_positions="guessing no";; + beos*) gl_cv_func_printf_positions="guessing no";; + mingw* | pw*) gl_cv_func_printf_positions="guessing no";; + *) gl_cv_func_printf_positions="guessing yes";; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +/* The string "%2$d %1$d", with dollar characters protected from the shell's + dollar expansion (possibly an autoconf bug). */ +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; +static char buf[100]; +int main () +{ + sprintf (buf, format, 33, 55); + return (strcmp (buf, "55 33") != 0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_printf_positions=yes +else case e in #( + e) gl_cv_func_printf_positions=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_positions" >&5 +printf "%s\n" "$gl_cv_func_printf_positions" >&6; } + + case "$gl_cv_func_printf_positions" in + *yes) + gl_cv_func_snprintf_usable=yes + ;; + esac + ;; + esac + ;; + esac + fi + if test $gl_cv_func_snprintf_usable = no; then + + + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS snprintf.$ac_objext" + + if test $ac_cv_func_snprintf = yes; then + REPLACE_SNPRINTF=1 + else + + if test $ac_cv_have_decl_snprintf = yes; then + REPLACE_SNPRINTF=1 + fi + fi + : + + fi + + if test $ac_cv_have_decl_snprintf = no; then + HAVE_DECL_SNPRINTF=0 + fi + + + + + + + if test "$GNULIB_SNPRINTF" != 1; then + if test "$GNULIB_SNPRINTF" = 0; then + GNULIB_SNPRINTF=$gl_module_indicator_condition + else + GNULIB_SNPRINTF="($GNULIB_SNPRINTF || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_SNPRINTF 1" >>confdefs.h + + + + + +printf "%s\n" "#define GNULIB_SNPRINTF $gl_module_indicator_condition" >>confdefs.h + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS socket.$ac_objext" + + fi + # When this module is used, sockets may actually occur as file descriptors, + # hence it is worth warning if the modules 'close' and 'ioctl' are not used. + + + + if test "$ac_cv_header_winsock2_h" = yes; then + UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 + fi + + + + + + if test "$GNULIB_SOCKET" != 1; then + if test "$GNULIB_SOCKET" = 0; then + GNULIB_SOCKET=$gl_module_indicator_condition + else + GNULIB_SOCKET="($GNULIB_SOCKET || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_SOCKET 1" >>confdefs.h + + + + + + ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " +/* <sys/types.h> is not needed according to POSIX, but the + <sys/socket.h> in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include <sys/types.h> +#if HAVE_SYS_SOCKET_H +# include <sys/socket.h> +#elif HAVE_WS2TCPIP_H +# include <ws2tcpip.h> +#endif + +" +if test "x$ac_cv_type_socklen_t" = xyes +then : + +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5 +printf %s "checking for socklen_t equivalent... " >&6; } + if test ${gl_cv_socklen_t_equiv+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) # Systems have either "struct sockaddr *" or + # "void *" as the second argument to getpeername + gl_cv_socklen_t_equiv= + for arg2 in "struct sockaddr" void; do + for t in int size_t "unsigned int" "long int" "unsigned long int"; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/socket.h> + + int getpeername (int, $arg2 *, $t *); +int +main (void) +{ +$t len; + getpeername (0, 0, &len); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_socklen_t_equiv="$t" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$gl_cv_socklen_t_equiv" != "" && break + done + test "$gl_cv_socklen_t_equiv" != "" && break + done + ;; +esac +fi + + if test "$gl_cv_socklen_t_equiv" = ""; then + as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5 +printf "%s\n" "$gl_cv_socklen_t_equiv" >&6; } + +printf "%s\n" "#define socklen_t $gl_cv_socklen_t_equiv" >>confdefs.h + ;; +esac +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5 +printf %s "checking for working stdalign.h... " >&6; } +if test ${gl_cv_header_working_stdalign_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdalign.h> + #include <stddef.h> + + /* Test that alignof yields a result consistent with offsetof. + This catches GCC bug 52023 + <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */ + #ifdef __cplusplus + template <class t> struct alignof_helper { char a; t b; }; + # define ao(type) offsetof (alignof_helper<type>, b) + #else + # define ao(type) offsetof (struct { char a; type b; }, b) + #endif + char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1]; + char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1]; + char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1]; + + /* Test _Alignas only on platforms where gnulib can help. */ + #if \ + ((defined __cplusplus && 201103 <= __cplusplus) \ + || (defined __APPLE__ && defined __MACH__ \ + ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ + : __GNUC__) \ + || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ + || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \ + || 1300 <= _MSC_VER) + struct alignas_test { char c; char alignas (8) alignas_8; }; + char test_alignas[offsetof (struct alignas_test, alignas_8) == 8 + ? 1 : -1]; + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_working_stdalign_h=yes +else case e in #( + e) gl_cv_header_working_stdalign_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5 +printf "%s\n" "$gl_cv_header_working_stdalign_h" >&6; } + + if test $gl_cv_header_working_stdalign_h = yes; then + STDALIGN_H='' + else + STDALIGN_H='stdalign.h' + fi + + + if test -n "$STDALIGN_H"; then + GL_GENERATE_STDALIGN_H_TRUE= + GL_GENERATE_STDALIGN_H_FALSE='#' +else + GL_GENERATE_STDALIGN_H_TRUE='#' + GL_GENERATE_STDALIGN_H_FALSE= +fi + + + + + + + + + + + + if test $ac_cv_have_decl_strerror_r = no; then + HAVE_DECL_STRERROR_R=0 + fi + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + if test $gl_cv_func_strerror_r_posix_signature = yes; then + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR_R=1 ;; + esac + else + REPLACE_STRERROR_R=1 + fi + else + REPLACE_STRERROR_R=1 + fi + fi + + if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS strerror_r.$ac_objext" + + + + + + + fi + + + + + + if test "$GNULIB_STRERROR_R" != 1; then + if test "$GNULIB_STRERROR_R" = 0; then + GNULIB_STRERROR_R=$gl_module_indicator_condition + else + GNULIB_STRERROR_R="($GNULIB_STRERROR_R || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_STRERROR_R 1" >>confdefs.h + + + + + +printf "%s\n" "#define GNULIB_STRERROR_R_POSIX $gl_module_indicator_condition" >>confdefs.h + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else case e in #( + e) gl_have_mmap=no ;; +esac +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + if test $ac_cv_func_symlink = no; then + HAVE_SYMLINK=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether symlink handles trailing slash correctly" >&5 +printf %s "checking whether symlink handles trailing slash correctly... " >&6; } +if test ${gl_cv_func_symlink_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_symlink_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_symlink_works="guessing no" ;; + esac + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> + +int +main (void) +{ +int result = 0; + if (!symlink ("a", "conftest.link/")) + result |= 1; + if (symlink ("conftest.f", "conftest.lnk2")) + result |= 2; + else if (!symlink ("a", "conftest.lnk2/")) + result |= 4; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_symlink_works=yes +else case e in #( + e) gl_cv_func_symlink_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + rm -f conftest.f conftest.link conftest.lnk2 ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_symlink_works" >&5 +printf "%s\n" "$gl_cv_func_symlink_works" >&6; } + case "$gl_cv_func_symlink_works" in + *yes) ;; + *) + REPLACE_SYMLINK=1 + ;; + esac + fi + + if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS symlink.$ac_objext" + + fi + + + + + + if test "$GNULIB_SYMLINK" != 1; then + if test "$GNULIB_SYMLINK" = 0; then + GNULIB_SYMLINK=$gl_module_indicator_condition + else + GNULIB_SYMLINK="($GNULIB_SYMLINK || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_SYMLINK 1" >>confdefs.h + + + + + + + + if test $ac_cv_header_sys_ioctl_h = yes; then + HAVE_SYS_IOCTL_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/ioctl.h> declares ioctl" >&5 +printf %s "checking whether <sys/ioctl.h> declares ioctl... " >&6; } +if test ${gl_cv_decl_ioctl_in_sys_ioctl_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/ioctl.h> + +int +main (void) +{ +(void) ioctl; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_ioctl_in_sys_ioctl_h=yes +else case e in #( + e) gl_cv_decl_ioctl_in_sys_ioctl_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_ioctl_in_sys_ioctl_h" >&5 +printf "%s\n" "$gl_cv_decl_ioctl_in_sys_ioctl_h" >&6; } + else + HAVE_SYS_IOCTL_H=0 + fi + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_ioctl_h='<'sys/ioctl.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/ioctl.h>" >&5 +printf %s "checking absolute name of <sys/ioctl.h>... " >&6; } +if test ${gl_cv_next_sys_ioctl_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_sys_ioctl_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/ioctl.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/ioctl.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_ioctl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_ioctl_h + gl_cv_next_sys_ioctl_h='"'$gl_header'"' + else + gl_cv_next_sys_ioctl_h='<'sys/ioctl.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_ioctl_h" >&5 +printf "%s\n" "$gl_cv_next_sys_ioctl_h" >&6; } + fi + NEXT_SYS_IOCTL_H=$gl_cv_next_sys_ioctl_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/ioctl.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_ioctl_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H=$gl_next_as_first_directive + + + + + + + for gl_func in ioctl; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | sed "$as_sed_sh"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/ioctl.h> +/* Some platforms declare ioctl in the wrong header. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <unistd.h> +#endif + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else case e in #( + e) eval "$as_gl_Symbol=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | sed "$as_sed_cpp"` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_uio_h='<'sys/uio.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/uio.h>" >&5 +printf %s "checking absolute name of <sys/uio.h>... " >&6; } +if test ${gl_cv_next_sys_uio_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + if test $ac_cv_header_sys_uio_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/uio.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/uio.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_uio_h + gl_cv_next_sys_uio_h='"'$gl_header'"' + else + gl_cv_next_sys_uio_h='<'sys/uio.h'>' + fi + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5 +printf "%s\n" "$gl_cv_next_sys_uio_h" >&6; } + fi + NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/uio.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_uio_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_sys_uio_h = yes; then + HAVE_SYS_UIO_H=1 + else + HAVE_SYS_UIO_H=0 + fi + + + + abs_aux_dir=`cd "$ac_aux_dir"; pwd` + + abs_aux_dir=`cd "$ac_aux_dir"; pwd` + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + + + if test $ac_cv_func_wctob = no; then + HAVE_WCTOB=0 + HAVE_DECL_WCTOB=0 + else + HAVE_WCTOB=1 + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wctob works" >&5 +printf %s "checking whether wctob works... " >&6; } +if test ${gl_cv_func_wctob_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + case "$host_os" in + # Guess no on Solaris <= 9 and Cygwin. + solaris2.[1-9] | solaris2.[1-9].* | cygwin*) + gl_cv_func_wctob_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wctob_works="guessing yes" ;; + esac + case "$host_os" in + cygwin*) + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +register long global __asm__ ("%ebx"); + +int main () +{ + setlocale (LC_ALL, "en_US.UTF-8"); + + global = 0x12345678; + if (wctob (0x00FC) != -1) + return 1; + if (global != 0x12345678) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + : +else case e in #( + e) gl_cv_func_wctob_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + ;; + esac + if test "$gl_cv_func_wctob_works" != no && test $LOCALE_FR != none; then + if test "$cross_compiling" = yes +then : + : +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + wchar_t wc; + + if (mbtowc (&wc, "\374", 1) == 1) + if (wctob (wc) != (unsigned char) '\374') + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_wctob_works=yes +else case e in #( + e) gl_cv_func_wctob_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wctob_works" >&5 +printf "%s\n" "$gl_cv_func_wctob_works" >&6; } + case "$gl_cv_func_wctob_works" in + *yes) ;; + *) REPLACE_WCTOB=1 ;; + esac + if test $REPLACE_WCTOB = 0; then + + ac_fn_check_decl "$LINENO" "wctob" "ac_cv_have_decl_wctob" " +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_wctob" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_WCTOB $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_wctob != yes; then + HAVE_DECL_WCTOB=0 + fi + fi + fi + + if test $HAVE_WCTOB = 0 || test $REPLACE_WCTOB = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS wctob.$ac_objext" + + + : + + fi + + + + + + if test "$GNULIB_WCTOB" != 1; then + if test "$GNULIB_WCTOB" = 0; then + GNULIB_WCTOB=$gl_module_indicator_condition + else + GNULIB_WCTOB="($GNULIB_WCTOB || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_WCTOB 1" >>confdefs.h + + + + + + + if false; then + REPLACE_WCTOMB=1 + fi + + if test $REPLACE_WCTOMB = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS wctomb.$ac_objext" + + + : + + fi + + + + + + if test "$GNULIB_WCTOMB" != 1; then + if test "$GNULIB_WCTOMB" = 0; then + GNULIB_WCTOMB=$gl_module_indicator_condition + else + GNULIB_WCTOMB="($GNULIB_WCTOMB || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_WCTOMB 1" >>confdefs.h + + + + + + + + + + + + + + LIBDIFFUTILS_LIBDEPS="$gl_libdeps" + + LIBDIFFUTILS_LTLIBDEPS="$gl_ltlibdeps" + + LIBTESTS_LIBDEPS="$gltests_libdeps" + + + +# Check whether --enable-gcc-warnings was given. +if test ${enable_gcc_warnings+y} +then : + enableval=$enable_gcc_warnings; case $enableval in + yes|no) ;; + *) as_fn_error $? "bad value $enableval for gcc-warnings option" "$LINENO" 5 ;; + esac + gl_gcc_warnings=$enableval +else case e in #( + e) if test -d "$srcdir"/.git; then + gl_gcc_warnings=yes + else + gl_gcc_warnings=no + fi + ;; +esac +fi + + +if test "$gl_gcc_warnings" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror -Wunknown-warning-option" >&5 +printf %s "checking whether C compiler handles -Werror -Wunknown-warning-option... " >&6; } +if test ${gl_cv_warn_c__Werror__Wunknown_warning_option+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Werror__Wunknown_warning_option=yes +else case e in #( + e) gl_cv_warn_c__Werror__Wunknown_warning_option=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror__Wunknown_warning_option" >&5 +printf "%s\n" "$gl_cv_warn_c__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_c__Werror__Wunknown_warning_option" = xyes +then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else case e in #( + e) gl_unknown_warnings_are_errors= ;; +esac +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror" >&5 +printf %s "checking whether C compiler handles -Werror... " >&6; } +if test ${gl_cv_warn_c__Werror+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Werror=yes +else case e in #( + e) gl_cv_warn_c__Werror=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror" >&5 +printf "%s\n" "$gl_cv_warn_c__Werror" >&6; } +if test "x$gl_cv_warn_c__Werror" = xyes +then : + as_fn_append WERROR_CFLAGS " -Werror" +fi + + + + + nw= + # This, $nw, is the list of warnings we disable. + nw="$nw -Wdeclaration-after-statement" # too useful to forbid + nw="$nw -Waggregate-return" # anachronistic + nw="$nw -Wlong-long" # C90 is anachronistic (lib/gethrxtime.h) + nw="$nw -Wc++-compat" # We don't care about C++ compilers + nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib + nw="$nw -Wtraditional" # Warns on #elif which we use often + nw="$nw -Wcast-qual" # Too many warnings for now + nw="$nw -Wconversion" # Too many warnings for now + nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings + nw="$nw -Wsign-conversion" # Too many warnings for now + nw="$nw -Wtraditional-conversion" # Too many warnings for now + nw="$nw -Wunreachable-code" # Too many warnings for now + nw="$nw -Wpadded" # Our structs are not padded + nw="$nw -Wredundant-decls" # openat.h declares e.g., mkdirat + nw="$nw -Wlogical-op" # any use of fwrite provokes this + nw="$nw -Wformat-nonliteral" # who.c and pinky.c strftime uses + nw="$nw -Wvla" # warnings in gettext.h + nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__ + nw="$nw -Wswitch-enum" # Too many warnings for now + nw="$nw -Wswitch-default" # Too many warnings for now + nw="$nw -Wstack-protector" # not worth working around + # things I might fix soon: + nw="$nw -Wfloat-equal" # sort.c, seq.c + nw="$nw -Wmissing-format-attribute" # copy.c + nw="$nw -Wunsafe-loop-optimizations" # a few src/*.c + nw="$nw -Winline" # system.h's readdir_ignoring_dot_and_dotdot + nw="$nw -Wstrict-overflow" # expr.c, pr.c, tr.c, factor.c + nw="$nw -Wformat-extra-args" # sdiff.c + # ?? -Wstrict-overflow + + + + if test -n "$GCC"; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is supported" >&5 +printf %s "checking whether -Wno-missing-field-initializers is supported... " >&6; } + if test ${gl_cv_cc_nomfi_supported+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_nomfi_supported=yes +else case e in #( + e) gl_cv_cc_nomfi_supported=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_supported" >&5 +printf "%s\n" "$gl_cv_cc_nomfi_supported" >&6; } + + if test "$gl_cv_cc_nomfi_supported" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is needed" >&5 +printf %s "checking whether -Wno-missing-field-initializers is needed... " >&6; } + if test ${gl_cv_cc_nomfi_needed+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int f (void) + { + typedef struct { int a; int b; } s_t; + s_t s1 = { 0, }; + return s1.b; + } + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_nomfi_needed=no +else case e in #( + e) gl_cv_cc_nomfi_needed=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" + ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_needed" >&5 +printf "%s\n" "$gl_cv_cc_nomfi_needed" >&6; } + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wuninitialized is supported" >&5 +printf %s "checking whether -Wuninitialized is supported... " >&6; } + if test ${gl_cv_cc_uninitialized_supported+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wuninitialized" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_uninitialized_supported=yes +else case e in #( + e) gl_cv_cc_uninitialized_supported=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_uninitialized_supported" >&5 +printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; } + + fi + + # List all gcc warning categories. + # To compare this list to your installed GCC's, run this Bash command: + # + # comm -3 \ + # <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \ + # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort | + # grep -v -x -F -f <( + # awk '/^[^#]/ {print ws}' ../build-aux/gcc-warning.spec)) + + gl_manywarn_set= + for gl_manywarn_item in -fno-common \ + -W \ + -Wabi \ + -Waddress \ + -Waggressive-loop-optimizations \ + -Wall \ + -Wattributes \ + -Wbad-function-cast \ + -Wbool-compare \ + -Wbool-operation \ + -Wbuiltin-declaration-mismatch \ + -Wbuiltin-macro-redefined \ + -Wcast-align \ + -Wchar-subscripts \ + -Wchkp \ + -Wclobbered \ + -Wcomment \ + -Wcomments \ + -Wcoverage-mismatch \ + -Wcpp \ + -Wdangling-else \ + -Wdate-time \ + -Wdeprecated \ + -Wdeprecated-declarations \ + -Wdesignated-init \ + -Wdisabled-optimization \ + -Wdiscarded-array-qualifiers \ + -Wdiscarded-qualifiers \ + -Wdiv-by-zero \ + -Wdouble-promotion \ + -Wduplicated-branches \ + -Wduplicated-cond \ + -Wduplicate-decl-specifier \ + -Wempty-body \ + -Wendif-labels \ + -Wenum-compare \ + -Wexpansion-to-defined \ + -Wextra \ + -Wformat-contains-nul \ + -Wformat-extra-args \ + -Wformat-nonliteral \ + -Wformat-security \ + -Wformat-signedness \ + -Wformat-y2k \ + -Wformat-zero-length \ + -Wframe-address \ + -Wfree-nonheap-object \ + -Whsa \ + -Wignored-attributes \ + -Wignored-qualifiers \ + -Wimplicit \ + -Wimplicit-function-declaration \ + -Wimplicit-int \ + -Wincompatible-pointer-types \ + -Winit-self \ + -Winline \ + -Wint-conversion \ + -Wint-in-bool-context \ + -Wint-to-pointer-cast \ + -Winvalid-memory-model \ + -Winvalid-pch \ + -Wjump-misses-init \ + -Wlogical-not-parentheses \ + -Wlogical-op \ + -Wmain \ + -Wmaybe-uninitialized \ + -Wmemset-elt-size \ + -Wmemset-transposed-args \ + -Wmisleading-indentation \ + -Wmissing-braces \ + -Wmissing-declarations \ + -Wmissing-field-initializers \ + -Wmissing-include-dirs \ + -Wmissing-parameter-type \ + -Wmissing-prototypes \ + -Wmultichar \ + -Wnarrowing \ + -Wnested-externs \ + -Wnonnull \ + -Wnonnull-compare \ + -Wnull-dereference \ + -Wodr \ + -Wold-style-declaration \ + -Wold-style-definition \ + -Wopenmp-simd \ + -Woverflow \ + -Woverlength-strings \ + -Woverride-init \ + -Wpacked \ + -Wpacked-bitfield-compat \ + -Wparentheses \ + -Wpointer-arith \ + -Wpointer-compare \ + -Wpointer-sign \ + -Wpointer-to-int-cast \ + -Wpragmas \ + -Wpsabi \ + -Wrestrict \ + -Wreturn-local-addr \ + -Wreturn-type \ + -Wscalar-storage-order \ + -Wsequence-point \ + -Wshadow \ + -Wshift-count-negative \ + -Wshift-count-overflow \ + -Wshift-negative-value \ + -Wsizeof-array-argument \ + -Wsizeof-pointer-memaccess \ + -Wstack-protector \ + -Wstrict-aliasing \ + -Wstrict-overflow \ + -Wstrict-prototypes \ + -Wsuggest-attribute=const \ + -Wsuggest-attribute=format \ + -Wsuggest-attribute=noreturn \ + -Wsuggest-attribute=pure \ + -Wsuggest-final-methods \ + -Wsuggest-final-types \ + -Wswitch \ + -Wswitch-bool \ + -Wswitch-default \ + -Wswitch-unreachable \ + -Wsync-nand \ + -Wsystem-headers \ + -Wtautological-compare \ + -Wtrampolines \ + -Wtrigraphs \ + -Wtype-limits \ + -Wuninitialized \ + -Wunknown-pragmas \ + -Wunsafe-loop-optimizations \ + -Wunused \ + -Wunused-but-set-parameter \ + -Wunused-but-set-variable \ + -Wunused-function \ + -Wunused-label \ + -Wunused-local-typedefs \ + -Wunused-macros \ + -Wunused-parameter \ + -Wunused-result \ + -Wunused-value \ + -Wunused-variable \ + -Wvarargs \ + -Wvariadic-macros \ + -Wvector-operation-performance \ + -Wvla \ + -Wvolatile-register-var \ + -Wwrite-strings \ + \ + ; do + gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" + done + + # gcc --help=warnings outputs an unusual form for these options; list + # them here so that the above 'comm' command doesn't report a false match. + # Would prefer "min (PTRDIFF_MAX, SIZE_MAX)", but it must be a literal: + ptrdiff_max_max=9223372036854775807 + gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$ptrdiff_max_max" + gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2" + gl_manywarn_set="$gl_manywarn_set -Wformat-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wformat-truncation=2" + gl_manywarn_set="$gl_manywarn_set -Wimplicit-fallthrough=5" + gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc" + gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wstringop-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2" + gl_manywarn_set="$gl_manywarn_set -Wvla-larger-than=4031" + + # These are needed for older GCC versions. + if test -n "$GCC"; then + case `($CC --version) 2>/dev/null` in + 'gcc (GCC) '[0-3].* | \ + 'gcc (GCC) '4.[0-7].*) + gl_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option" + gl_manywarn_set="$gl_manywarn_set -funit-at-a-time" + ;; + esac + fi + + # Disable specific options as needed. + if test "$gl_cv_cc_nomfi_needed" = yes; then + gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers" + fi + + if test "$gl_cv_cc_uninitialized_supported" = no; then + gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized" + fi + + ws=$gl_manywarn_set + + + gl_warn_set= + set x $ws; shift + for gl_warn_item + do + case " $nw " in + *" $gl_warn_item "*) + ;; + *) + gl_warn_set="$gl_warn_set $gl_warn_item" + ;; + esac + done + ws=$gl_warn_set + + for w in $ws; do + +as_gl_Warn=`printf "%s\n" "gl_cv_warn_c_$w" | sed "$as_sed_sh"` +gl_positive="$w" +case $gl_positive in + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles $w" >&5 +printf %s "checking whether C compiler handles $w... " >&6; } +if eval test \${$as_gl_Warn+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors $gl_positive" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_gl_Warn=yes" +else case e in #( + e) eval "$as_gl_Warn=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +eval ac_res=\$$as_gl_Warn + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_gl_Warn"\" = x"yes" +then : + as_fn_append WARN_CFLAGS " $w" +fi + + + done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-missing-field-initializers" >&5 +printf %s "checking whether C compiler handles -Wno-missing-field-initializers... " >&6; } +if test ${gl_cv_warn_c__Wno_missing_field_initializers+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wmissing-field-initializers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_missing_field_initializers=yes +else case e in #( + e) gl_cv_warn_c__Wno_missing_field_initializers=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_missing_field_initializers" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_missing_field_initializers" >&6; } +if test "x$gl_cv_warn_c__Wno_missing_field_initializers" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-missing-field-initializers" +fi + + # We need this one + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-sign-compare" >&5 +printf %s "checking whether C compiler handles -Wno-sign-compare... " >&6; } +if test ${gl_cv_warn_c__Wno_sign_compare+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wsign-compare" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_sign_compare=yes +else case e in #( + e) gl_cv_warn_c__Wno_sign_compare=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_sign_compare" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_sign_compare" >&6; } +if test "x$gl_cv_warn_c__Wno_sign_compare" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-sign-compare" +fi + + # Too many warnings for now + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-pointer-sign" >&5 +printf %s "checking whether C compiler handles -Wno-pointer-sign... " >&6; } +if test ${gl_cv_warn_c__Wno_pointer_sign+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wpointer-sign" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_pointer_sign=yes +else case e in #( + e) gl_cv_warn_c__Wno_pointer_sign=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_pointer_sign" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_pointer_sign" >&6; } +if test "x$gl_cv_warn_c__Wno_pointer_sign" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-pointer-sign" +fi + + # Too many warnings for now + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-unused-parameter" >&5 +printf %s "checking whether C compiler handles -Wno-unused-parameter... " >&6; } +if test ${gl_cv_warn_c__Wno_unused_parameter+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wunused-parameter" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_unused_parameter=yes +else case e in #( + e) gl_cv_warn_c__Wno_unused_parameter=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_unused_parameter" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_unused_parameter" >&6; } +if test "x$gl_cv_warn_c__Wno_unused_parameter" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-unused-parameter" +fi + + # Too many warnings for now + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-format-nonliteral" >&5 +printf %s "checking whether C compiler handles -Wno-format-nonliteral... " >&6; } +if test ${gl_cv_warn_c__Wno_format_nonliteral+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wformat-nonliteral" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_format_nonliteral=yes +else case e in #( + e) gl_cv_warn_c__Wno_format_nonliteral=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_format_nonliteral" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_format_nonliteral" >&6; } +if test "x$gl_cv_warn_c__Wno_format_nonliteral" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-format-nonliteral" +fi + + + + # In spite of excluding -Wlogical-op above, it is enabled, as of + # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-logical-op" >&5 +printf %s "checking whether C compiler handles -Wno-logical-op... " >&6; } +if test ${gl_cv_warn_c__Wno_logical_op+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wlogical-op" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_logical_op=yes +else case e in #( + e) gl_cv_warn_c__Wno_logical_op=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_logical_op" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_logical_op" >&6; } +if test "x$gl_cv_warn_c__Wno_logical_op" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-logical-op" +fi + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -fdiagnostics-show-option" >&5 +printf %s "checking whether C compiler handles -fdiagnostics-show-option... " >&6; } +if test ${gl_cv_warn_c__fdiagnostics_show_option+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -fdiagnostics-show-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__fdiagnostics_show_option=yes +else case e in #( + e) gl_cv_warn_c__fdiagnostics_show_option=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__fdiagnostics_show_option" >&5 +printf "%s\n" "$gl_cv_warn_c__fdiagnostics_show_option" >&6; } +if test "x$gl_cv_warn_c__fdiagnostics_show_option" = xyes +then : + as_fn_append WARN_CFLAGS " -fdiagnostics-show-option" +fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -funit-at-a-time" >&5 +printf %s "checking whether C compiler handles -funit-at-a-time... " >&6; } +if test ${gl_cv_warn_c__funit_at_a_time+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -funit-at-a-time" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__funit_at_a_time=yes +else case e in #( + e) gl_cv_warn_c__funit_at_a_time=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__funit_at_a_time" >&5 +printf "%s\n" "$gl_cv_warn_c__funit_at_a_time" >&6; } +if test "x$gl_cv_warn_c__funit_at_a_time" = xyes +then : + as_fn_append WARN_CFLAGS " -funit-at-a-time" +fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -fno-common" >&5 +printf %s "checking whether C compiler handles -fno-common... " >&6; } +if test ${gl_cv_warn_c__fno_common+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -fno-common" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__fno_common=yes +else case e in #( + e) gl_cv_warn_c__fno_common=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__fno_common" >&5 +printf "%s\n" "$gl_cv_warn_c__fno_common" >&6; } +if test "x$gl_cv_warn_c__fno_common" = xyes +then : + as_fn_append WARN_CFLAGS " -fno-common" +fi + + + + + + +printf "%s\n" "#define lint 1" >>confdefs.h + + +printf "%s\n" "#define _FORTIFY_SOURCE 2" >>confdefs.h + + +printf "%s\n" "#define GNULIB_PORTCHECK 1" >>confdefs.h + + + # We use a slightly smaller set of warning options for lib/. + # Remove the following and save the result in GNULIB_WARN_CFLAGS. + nw= + nw="$nw -Wunused-macros" + nw="$nw -Wmissing-prototypes" + nw="$nw -Wold-style-definition" + nw="$nw -Wsuggest-attribute=pure" + + gl_warn_set= + set x $WARN_CFLAGS; shift + for gl_warn_item + do + case " $nw " in + *" $gl_warn_item "*) + ;; + *) + gl_warn_set="$gl_warn_set $gl_warn_item" + ;; + esac + done + GNULIB_WARN_CFLAGS=$gl_warn_set + + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo (void) {return 0; } +$ac_kw foo_t foo (void) {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for variable-length arrays" >&5 +printf %s "checking for variable-length arrays... " >&6; } +if test ${ac_cv_c_vararrays+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC_NO_VLA__ + defined + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP_TRADITIONAL "defined" >/dev/null 2>&1 +then : + ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined' +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test for VLA support. This test is partly inspired + from examples in the C standard. Use at least two VLA + functions to detect the GCC 3.4.3 bug described in: + http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html + */ + #ifdef __STDC_NO_VLA__ + syntax error; + #else + extern int n; + int B[100]; + int fvla (int m, int C[m][m]); + + int + simple (int count, int all[static count]) + { + return all[count - 1]; + } + + int + fvla (int m, int C[m][m]) + { + typedef int VLA[m][m]; + VLA x; + int D[m]; + static int (*q)[m] = &B; + int (*s)[n] = q; + return C && &x[0][0] == &D[0] && &D[0] == s[0]; + } + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_vararrays=yes +else case e in #( + e) ac_cv_c_vararrays=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -rf conftest* + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_vararrays" >&5 +printf "%s\n" "$ac_cv_c_vararrays" >&6; } + if test "$ac_cv_c_vararrays" = yes; then + +printf "%s\n" "#define HAVE_C_VARARRAYS 1" >>confdefs.h + + elif test "$ac_cv_c_vararrays" = no; then + +printf "%s\n" "#define __STDC_NO_VLA__ 1" >>confdefs.h + + fi + + + +printf "%s\n" "#define DEFAULT_EDITOR_PROGRAM \"ed\"" >>confdefs.h + + +# Extract the first word of "pr", so it can be a program name with args. +set dummy pr; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PR_PROGRAM+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $PR_PROGRAM in + [\\/]* | ?:[\\/]*) + ac_cv_path_PR_PROGRAM="$PR_PROGRAM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PR_PROGRAM="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PR_PROGRAM" && ac_cv_path_PR_PROGRAM="""" + ;; +esac ;; +esac +fi +PR_PROGRAM=$ac_cv_path_PR_PROGRAM +if test -n "$PR_PROGRAM"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PR_PROGRAM" >&5 +printf "%s\n" "$PR_PROGRAM" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +printf "%s\n" "#define PR_PROGRAM \"$PR_PROGRAM\"" >>confdefs.h + + +ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_blksize" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLKSIZE 1" >>confdefs.h + + +fi + +ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_rdev" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_RDEV 1" >>confdefs.h + + +fi + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | sed "$as_sed_sh"` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +printf %s "checking for $ac_hdr that defines DIR... " >&6; } +if eval test \${$as_ac_Header+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <$ac_hdr> + +int +main (void) +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_ac_Header=yes" +else case e in #( + e) eval "$as_ac_Header=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$as_ac_Header + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_$ac_hdr" | sed "$as_sed_cpp"` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); +int +main (void) +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_opendir+y} +then : + break +fi +done +if test ${ac_cv_search_opendir+y} +then : + +else case e in #( + e) ac_cv_search_opendir=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); +int +main (void) +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_opendir+y} +then : + break +fi +done +if test ${ac_cv_search_opendir+y} +then : + +else case e in #( + e) ac_cv_search_opendir=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 +printf %s "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } +if test ${ac_cv_header_sys_wait_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <sys/wait.h> +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) +#endif +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif + +int +main (void) +{ + int s; + wait (&s); + s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_header_sys_wait_h=yes +else case e in #( + e) ac_cv_header_sys_wait_h=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 +printf "%s\n" "$ac_cv_header_sys_wait_h" >&6; } +if test $ac_cv_header_sys_wait_h = yes; then + +printf "%s\n" "#define HAVE_SYS_WAIT_H 1" >>confdefs.h + +fi + + + ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default +" +if test "x$ac_cv_type_pid_t" = xyes +then : + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_pid_type='int' +else case e in #( + e) ac_pid_type='__int64' ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h + + ;; +esac +fi + + + + + + + +if test $ac_cv_func_sigprocmask = no; then + ac_fn_c_check_func "$LINENO" "sigblock" "ac_cv_func_sigblock" +if test "x$ac_cv_func_sigblock" = xyes +then : + printf "%s\n" "#define HAVE_SIGBLOCK 1" >>confdefs.h + +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5 +printf %s "checking whether closedir returns void... " >&6; } +if test ${ac_cv_func_closedir_void+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <$ac_header_dirent> + +int +main (void) +{ + + return closedir(0); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_func_closedir_void=no +else case e in #( + e) ac_cv_func_closedir_void=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_closedir_void" >&5 +printf "%s\n" "$ac_cv_func_closedir_void" >&6; } +if test $ac_cv_func_closedir_void = yes; then + +printf "%s\n" "#define CLOSEDIR_VOID 1" >>confdefs.h + +fi + + + + + + +if test "x$ac_cv_func_fork" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 +printf %s "checking for working fork... " >&6; } +if test ${ac_cv_func_fork_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + ac_cv_func_fork_works=cross +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* By R. Kuhlmann. */ + return fork () < 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_fork_works=yes +else case e in #( + e) ac_cv_func_fork_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 +printf "%s\n" "$ac_cv_func_fork_works" >&6; } + +else + ac_cv_func_fork_works=$ac_cv_func_fork +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 +printf %s "checking for working vfork... " >&6; } +if test ${ac_cv_func_vfork_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + ac_cv_func_vfork_works=cross +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Thanks to Paul Eggert for this test. */ +$ac_includes_default +#include <signal.h> +#include <sys/wait.h> +#ifdef HAVE_VFORK_H +# include <vfork.h> +#endif + +static void +do_nothing (int sig) +{ + (void) sig; +} + +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include <vfork.h>, but some compilers + (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static void +sparc_address_test (int arg) +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} + +int +main (void) +{ + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (0); + + /* On Solaris 2.4, changes by the child to the signal handler + also munge signal handlers in the parent. To detect this, + start by putting the parent's handler in a known state. */ + signal (SIGTERM, SIG_DFL); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* Alter the child's signal handler. */ + if (signal (SIGTERM, do_nothing) != SIG_DFL) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + return ( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child munge the parent's signal handler? */ + || signal (SIGTERM, SIG_DFL) != SIG_DFL + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_vfork_works=yes +else case e in #( + e) ac_cv_func_vfork_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 +printf "%s\n" "$ac_cv_func_vfork_works" >&6; } + +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=$ac_cv_func_vfork + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} +fi + +if test "x$ac_cv_func_vfork_works" = xyes; then + +printf "%s\n" "#define HAVE_WORKING_VFORK 1" >>confdefs.h + +else + +printf "%s\n" "#define vfork fork" >>confdefs.h + +fi +if test "x$ac_cv_func_fork_works" = xyes; then + +printf "%s\n" "#define HAVE_WORKING_FORK 1" >>confdefs.h + +fi + + +# When .tarball-version exists, we're building from a tarball +# and must not make man/*.1 files depend on the generated src/version.c, +# because that would induce a requirement to run the help2man perl script. +# We are not yet prepared to make perl a build-from-tarball requirement. +# Hence, here we detect .tarball-version existence. When not present, +# we define a variable to be used in man/Makefile.am to induce the +# proper dependency (so that man/*.1 will be rebuilt upon any version change), +# but not when built from a tarball. + +test -f $srcdir/.tarball-version \ + && SRC_VERSION_C= \ + || SRC_VERSION_C=../src/version.c + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +printf %s "checking whether NLS is requested... " >&6; } + # Check whether --enable-nls was given. +if test ${enable_nls+y} +then : + enableval=$enable_nls; USE_NLS=$enableval +else case e in #( + e) USE_NLS=yes ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$USE_NLS" >&6; } + + + + + GETTEXT_MACRO_VERSION=0.19 + + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MSGFMT+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case "$MSGFMT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +printf "%s\n" "$MSGFMT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_GMSGFMT+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +printf "%s\n" "$GMSGFMT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; + *) MSGFMT_015=$MSGFMT ;; + esac + + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_XGETTEXT+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case "$XGETTEXT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +printf "%s\n" "$XGETTEXT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + rm -f messages.po + + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MSGMERGE+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case "$MSGMERGE" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" + ;; +esac ;; +esac +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 +printf "%s\n" "$MSGMERGE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$localedir" || localedir='${datadir}/locale' + + + test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + + + ac_config_commands="$ac_config_commands po-directories" + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 +printf %s "checking for CFPreferencesCopyAppValue... " >&6; } +if test ${gt_cv_func_CFPreferencesCopyAppValue+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <CoreFoundation/CFPreferences.h> +int +main (void) +{ +CFPreferencesCopyAppValue(NULL, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gt_cv_func_CFPreferencesCopyAppValue=yes +else case e in #( + e) gt_cv_func_CFPreferencesCopyAppValue=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 +printf "%s\n" "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + +printf "%s\n" "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 +printf %s "checking for CFLocaleCopyCurrent... " >&6; } +if test ${gt_cv_func_CFLocaleCopyCurrent+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <CoreFoundation/CFLocale.h> +int +main (void) +{ +CFLocaleCopyCurrent(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gt_cv_func_CFLocaleCopyCurrent=yes +else case e in #( + e) gt_cv_func_CFLocaleCopyCurrent=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 +printf "%s\n" "$gt_cv_func_CFLocaleCopyCurrent" >&6; } + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + +printf "%s\n" "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h + + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + fi + + + + + + + LIBINTL= + LTLIBINTL= + POSUB= + + case " $gt_needs " in + *" need-formatstring-macros "*) gt_api_version=3 ;; + *" need-ngettext "*) gt_api_version=2 ;; + *) gt_api_version=1 ;; + esac + gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" + gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + + + if test $gt_api_version -ge 3; then + gt_revision_test_code=' +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +' + else + gt_revision_test_code= + fi + if test $gt_api_version -ge 2; then + gt_expression_test_code=' + * ngettext ("", "", 0)' + else + gt_expression_test_code= + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 +printf %s "checking for GNU gettext in libc... " >&6; } +if eval test \${$gt_func_gnugettext_libc+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <libintl.h> +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$gt_func_gnugettext_libc=yes" +else case e in #( + e) eval "$gt_func_gnugettext_libc=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$gt_func_gnugettext_libc + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +printf %s "checking for iconv... " >&6; } +if test ${am_cv_func_iconv+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdlib.h> +#include <iconv.h> + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdlib.h> +#include <iconv.h> + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +printf "%s\n" "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +printf %s "checking for working iconv... " >&6; } +if test ${am_cv_func_iconv_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + if test "$cross_compiling" = yes +then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <iconv.h> +#include <string.h> + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + +int +main (void) +{ +int result = 0; + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\263"; + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + result |= 8; + iconv_close (cd_88591_to_utf8); + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + result |= 16; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + am_cv_func_iconv_works=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + test "$am_cv_func_iconv_works" = no || break + done + LIBS="$am_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +printf "%s\n" "$am_cv_func_iconv_works" >&6; } + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + +printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +printf %s "checking how to link with libiconv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +printf "%s\n" "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libintl-prefix was given. +if test ${with_libintl_prefix+y} +then : + withval=$with_libintl_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBINTL= + LTLIBINTL= + INCINTL= + LIBINTL_PREFIX= + HAVE_LIBINTL= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='intl ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" + ;; + esac + done + fi + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" + done + fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 +printf %s "checking for GNU gettext in libintl... " >&6; } +if eval test \${$gt_func_gnugettext_libintl+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <libintl.h> +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$gt_func_gnugettext_libintl=yes" +else case e in #( + e) eval "$gt_func_gnugettext_libintl=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <libintl.h> +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS" ;; +esac +fi +eval ac_res=\$$gt_func_gnugettext_libintl + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + fi + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ + || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + + + if test -n "$INTL_MACOSX_LIBS"; then + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" + LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" + fi + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + +printf "%s\n" "#define ENABLE_NLS 1" >>confdefs.h + + else + USE_NLS=no + fi + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 +printf %s "checking whether to use NLS... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$USE_NLS" >&6; } + if test "$USE_NLS" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 +printf %s "checking where the gettext function comes from... " >&6; } + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 +printf "%s\n" "$gt_source" >&6; } + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 +printf %s "checking how to link with libintl... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 +printf "%s\n" "$LIBINTL" >&6; } + + for element in $INCINTL; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + fi + + +printf "%s\n" "#define HAVE_GETTEXT 1" >>confdefs.h + + +printf "%s\n" "#define HAVE_DCGETTEXT 1" >>confdefs.h + + fi + + POSUB=po + fi + + + + INTLLIBS="$LIBINTL" + + + + + + + +XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT" + +ac_config_files="$ac_config_files Makefile doc/Makefile lib/Makefile src/Makefile tests/Makefile gnulib-tests/Makefile man/Makefile po/Makefile.in" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # 'set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # 'set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; +esac +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +# Check whether --enable-year2038 was given. +if test ${enable_year2038+y} +then : + enableval=$enable_year2038; +fi + +if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then + as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +test "X$DEFS" = X-DHAVE_CONFIG_H && DEFS= +if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GNU_MAKE_TRUE}" && test -z "${GNU_MAKE_FALSE}"; then + as_fn_error $? "conditional \"GNU_MAKE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +CONFIG_INCLUDE=lib/config.h + +if test -z "${GL_GENERATE_STDARG_H_TRUE}" && test -z "${GL_GENERATE_STDARG_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDARG_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE}"; then + as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE}"; then + as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE}"; then + as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + + gl_libobjs= + gl_ltlibobjs= + if test -n "$gl_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do + gl_libobjs="$gl_libobjs $i.$ac_objext" + gl_ltlibobjs="$gl_ltlibobjs $i.lo" + done + fi + gl_LIBOBJS=$gl_libobjs + + gl_LTLIBOBJS=$gl_ltlibobjs + + + +if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_NETINET_IN_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + gltests_libobjs= + gltests_ltlibobjs= + if test -n "$gltests_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do + gltests_libobjs="$gltests_libobjs $i.$ac_objext" + gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" + done + fi + gltests_LIBOBJS=$gltests_libobjs + + gltests_LTLIBOBJS=$gltests_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else case e in #( + e) case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi +if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as 'sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else case e in #( + e) as_fn_append () + { + eval $1=\$$1\$2 + } ;; +esac +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else case e in #( + e) as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } ;; +esac +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated + +# Sed expression to map a string onto a valid variable name. +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by GNU diffutils $as_me 3.6, which was +generated by GNU Autoconf 2.72. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_links="$ac_config_links" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +'$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration links: +$config_links + +Configuration commands: +$config_commands + +Report bugs to <bug-diffutils@gnu.org>. +GNU diffutils home page: <https://www.gnu.org/software/diffutils/>. +General help using GNU software: <https://www.gnu.org/gethelp/>." + +_ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config='$ac_cs_config_escaped' +ac_cs_version="\\ +GNU diffutils config.status 3.6 +configured by $0, generated by GNU Autoconf 2.72, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2023 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + printf "%s\n" "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + printf "%s\n" "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; + --help | --hel | -h ) + printf "%s\n" "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + printf "%s\n" "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" +GNUmakefile=$GNUmakefile +# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it + # from automake < 1.5. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "lib/config.h") CONFIG_HEADERS="$CONFIG_HEADERS lib/config.h:lib/config.hin" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "$GNUmakefile") CONFIG_LINKS="$CONFIG_LINKS $GNUmakefile:$GNUmakefile" ;; + "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "gnulib-tests/Makefile") CONFIG_FILES="$CONFIG_FILES gnulib-tests/Makefile" ;; + "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_LINKS+y} || CONFIG_LINKS=$config_links + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to '$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with './config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' <conf$$subs.awk | sed ' +/^[^""]/{ + N + s/\n// +} +' >>$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with './config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script 'defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' <confdefs.h | sed ' +s/'"$ac_delim"'/"\\\ +"/g' >>$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain ':'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is 'configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`printf "%s\n" "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when '$srcdir' = '.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + :L) + # + # CONFIG_LINK + # + + if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then + : + else + # Prefer the file from the source tree if names are identical. + if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then + ac_source=$srcdir/$ac_source + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5 +printf "%s\n" "$as_me: linking $ac_source to $ac_file" >&6;} + + if test ! -r "$ac_source"; then + as_fn_error $? "$ac_source: file not found" "$LINENO" 5 + fi + rm -f "$ac_file" + + # Try a relative symlink, then a hard link, then a copy. + case $ac_source in + [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; + *) ac_rel_source=$ac_top_build_prefix$ac_source ;; + esac + ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || + ln "$ac_source" "$ac_file" 2>/dev/null || + cp -p "$ac_source" "$ac_file" || + as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5 + fi + ;; + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See 'config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + "po-directories":C) + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + # Treat a directory as a PO directory if and only if it has a + # POTFILES.in file. This allows packages to have multiple PO + # directories under different names or in different locations. + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + diff --git a/local/recipes/tools/diffutils/source/configure.ac b/local/recipes/tools/diffutils/source/configure.ac new file mode 100644 index 0000000000..28e01077a4 --- /dev/null +++ b/local/recipes/tools/diffutils/source/configure.ac @@ -0,0 +1,180 @@ +# Configure template for GNU Diffutils. + +# Copyright (C) 1994-1995, 1998, 2001-2002, 2004, 2006, 2009-2013, 2015-2017 +# Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +AC_PREREQ(2.61) + +AC_INIT([GNU diffutils], + m4_esyscmd([build-aux/git-version-gen .tarball-version]), + [bug-diffutils@gnu.org]) + +AC_CONFIG_SRCDIR([src/diff.c]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_MACRO_DIR([m4]) + +AM_INIT_AUTOMAKE([1.11 dist-xz no-dist-gzip subdir-objects + color-tests parallel-tests]) +AM_SILENT_RULES([yes]) # make --enable-silent-rules the default. + +AC_CONFIG_HEADER([lib/config.h:lib/config.hin]) + +AC_PROG_AWK +AC_PROG_CC +AM_PROG_CC_C_O +AM_MISSING_PROG([HELP2MAN], [help2man]) +AC_PROG_RANLIB +gl_EARLY +gl_USE_SYSTEM_EXTENSIONS +gl_INIT + +AC_ARG_ENABLE([gcc-warnings], + [AS_HELP_STRING([--enable-gcc-warnings], + [turn on lots of GCC warnings (for developers)])], + [case $enableval in + yes|no) ;; + *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;; + esac + gl_gcc_warnings=$enableval], + [if test -d "$srcdir"/.git; then + gl_gcc_warnings=yes + else + gl_gcc_warnings=no + fi] +) + +if test "$gl_gcc_warnings" = yes; then + gl_WARN_ADD([-Werror], [WERROR_CFLAGS]) + AC_SUBST([WERROR_CFLAGS]) + + nw= + # This, $nw, is the list of warnings we disable. + nw="$nw -Wdeclaration-after-statement" # too useful to forbid + nw="$nw -Waggregate-return" # anachronistic + nw="$nw -Wlong-long" # C90 is anachronistic (lib/gethrxtime.h) + nw="$nw -Wc++-compat" # We don't care about C++ compilers + nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib + nw="$nw -Wtraditional" # Warns on #elif which we use often + nw="$nw -Wcast-qual" # Too many warnings for now + nw="$nw -Wconversion" # Too many warnings for now + nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings + nw="$nw -Wsign-conversion" # Too many warnings for now + nw="$nw -Wtraditional-conversion" # Too many warnings for now + nw="$nw -Wunreachable-code" # Too many warnings for now + nw="$nw -Wpadded" # Our structs are not padded + nw="$nw -Wredundant-decls" # openat.h declares e.g., mkdirat + nw="$nw -Wlogical-op" # any use of fwrite provokes this + nw="$nw -Wformat-nonliteral" # who.c and pinky.c strftime uses + nw="$nw -Wvla" # warnings in gettext.h + nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__ + nw="$nw -Wswitch-enum" # Too many warnings for now + nw="$nw -Wswitch-default" # Too many warnings for now + nw="$nw -Wstack-protector" # not worth working around + # things I might fix soon: + nw="$nw -Wfloat-equal" # sort.c, seq.c + nw="$nw -Wmissing-format-attribute" # copy.c + nw="$nw -Wunsafe-loop-optimizations" # a few src/*.c + nw="$nw -Winline" # system.h's readdir_ignoring_dot_and_dotdot + nw="$nw -Wstrict-overflow" # expr.c, pr.c, tr.c, factor.c + nw="$nw -Wformat-extra-args" # sdiff.c + # ?? -Wstrict-overflow + + gl_MANYWARN_ALL_GCC([ws]) + gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw]) + for w in $ws; do + gl_WARN_ADD([$w]) + done + gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one + gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now + gl_WARN_ADD([-Wno-pointer-sign]) # Too many warnings for now + gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now + gl_WARN_ADD([-Wno-format-nonliteral]) + + # In spite of excluding -Wlogical-op above, it is enabled, as of + # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c + gl_WARN_ADD([-Wno-logical-op]) + + gl_WARN_ADD([-fdiagnostics-show-option]) + gl_WARN_ADD([-funit-at-a-time]) + gl_WARN_ADD([-fno-common]) + + AC_SUBST([WARN_CFLAGS]) + + AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.]) + AC_DEFINE([_FORTIFY_SOURCE], [2], + [enable compile-time and run-time bounds-checking, and some warnings]) + AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks]) + + # We use a slightly smaller set of warning options for lib/. + # Remove the following and save the result in GNULIB_WARN_CFLAGS. + nw= + nw="$nw -Wunused-macros" + nw="$nw -Wmissing-prototypes" + nw="$nw -Wold-style-definition" + nw="$nw -Wsuggest-attribute=pure" + gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw]) + AC_SUBST([GNULIB_WARN_CFLAGS]) +fi + +AC_C_INLINE +AC_C_VARARRAYS + +AC_DEFINE([DEFAULT_EDITOR_PROGRAM], ["ed"], + [Name of editor program, unless overridden.]) + +AC_PATH_PROG([PR_PROGRAM], [pr], [""]) +AC_DEFINE_UNQUOTED([PR_PROGRAM], ["$PR_PROGRAM"], [Name of "pr" program.]) + +AC_CHECK_MEMBERS([struct stat.st_blksize]) +AC_CHECK_MEMBERS([struct stat.st_rdev]) +AC_HEADER_DIRENT +AC_HEADER_SYS_WAIT +AC_TYPE_PID_T + +AC_CHECK_FUNCS_ONCE([sigaction sigprocmask strcasecoll stricoll]) +if test $ac_cv_func_sigprocmask = no; then + AC_CHECK_FUNCS([sigblock]) +fi +AC_FUNC_CLOSEDIR_VOID +AC_FUNC_FORK + +# When .tarball-version exists, we're building from a tarball +# and must not make man/*.1 files depend on the generated src/version.c, +# because that would induce a requirement to run the help2man perl script. +# We are not yet prepared to make perl a build-from-tarball requirement. +# Hence, here we detect .tarball-version existence. When not present, +# we define a variable to be used in man/Makefile.am to induce the +# proper dependency (so that man/*.1 will be rebuilt upon any version change), +# but not when built from a tarball. +AC_SUBST([SRC_VERSION_C]) +test -f $srcdir/.tarball-version \ + && SRC_VERSION_C= \ + || SRC_VERSION_C=../src/version.c + +AM_GNU_GETTEXT([external], [need-ngettext]) +AM_GNU_GETTEXT_VERSION([0.19.2]) +XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT" + +AC_CONFIG_FILES([ + Makefile doc/Makefile + lib/Makefile + src/Makefile + tests/Makefile + gnulib-tests/Makefile + man/Makefile + po/Makefile.in +]) +AC_OUTPUT diff --git a/local/recipes/tools/diffutils/source/configure~ b/local/recipes/tools/diffutils/source/configure~ new file mode 100755 index 0000000000..3a45cf4348 --- /dev/null +++ b/local/recipes/tools/diffutils/source/configure~ @@ -0,0 +1,41980 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69.185-b502e for GNU diffutils 3.6. +# +# Report bugs to <bug-diffutils@gnu.org>. +# +# +# Copyright (C) 1992-1996, 1998-2017 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null +then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null +then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null +then : + break 2 +fi +fi + done;; + esac + as_found=false +done +IFS=$as_save_IFS +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } + + + if test "x$CONFIG_SHELL" != x +then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and +$0: bug-diffutils@gnu.org about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 </dev/null +exec 6>&1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='GNU diffutils' +PACKAGE_TARNAME='diffutils' +PACKAGE_VERSION='3.6' +PACKAGE_STRING='GNU diffutils 3.6' +PACKAGE_BUGREPORT='bug-diffutils@gnu.org' +PACKAGE_URL='http://www.gnu.org/software/diffutils/' + +ac_unique_file="src/diff.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif +#ifdef HAVE_STRINGS_H +# include <strings.h> +#endif +#ifdef HAVE_INTTYPES_H +# include <inttypes.h> +#endif +#ifdef HAVE_STDINT_H +# include <stdint.h> +#endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif" + +ac_header_c_list= +ac_func_c_list= +gl_fnmatch_required=POSIX +gl_getopt_required=POSIX +gt_needs= +ac_subst_vars='gltests_LTLIBOBJS +gltests_LIBOBJS +gl_LTLIBOBJS +gl_LIBOBJS +CONFIG_INCLUDE +am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +POSUB +INTLLIBS +INTL_MACOSX_LIBS +XGETTEXT_EXTRA_OPTIONS +MSGMERGE +XGETTEXT_015 +XGETTEXT +GMSGFMT_015 +MSGFMT_015 +GMSGFMT +MSGFMT +GETTEXT_MACRO_VERSION +USE_NLS +SRC_VERSION_C +PR_PROGRAM +GNULIB_WARN_CFLAGS +WARN_CFLAGS +WERROR_CFLAGS +LIBTESTS_LIBDEPS +LIBDIFFUTILS_LTLIBDEPS +LIBDIFFUTILS_LIBDEPS +abs_aux_dir +HAVE_SYS_UIO_H +NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H +NEXT_SYS_UIO_H +NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H +NEXT_SYS_IOCTL_H +HAVE_SYS_IOCTL_H +GL_GENERATE_STDALIGN_H_FALSE +GL_GENERATE_STDALIGN_H_TRUE +STDALIGN_H +GL_GENERATE_NETINET_IN_H_FALSE +GL_GENERATE_NETINET_IN_H_TRUE +NETINET_IN_H +HAVE_NETINET_IN_H +NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H +NEXT_NETINET_IN_H +LIB_NANOSLEEP +LIB_SELECT +LIBSOCKET +HAVE_SYS_SELECT_H +NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H +NEXT_SYS_SELECT_H +REPLACE_SELECT +REPLACE_PSELECT +HAVE_PSELECT +GNULIB_SELECT +GNULIB_PSELECT +INET_PTON_LIB +LOCALE_TR_UTF8 +NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H +NEXT_ARPA_INET_H +HAVE_ARPA_INET_H +REPLACE_INET_PTON +REPLACE_INET_NTOP +HAVE_DECL_INET_PTON +HAVE_DECL_INET_NTOP +GNULIB_INET_PTON +GNULIB_INET_NTOP +HAVE_WS2TCPIP_H +HAVE_SYS_SOCKET_H +NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H +NEXT_SYS_SOCKET_H +HAVE_ACCEPT4 +HAVE_SA_FAMILY_T +HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY +HAVE_STRUCT_SOCKADDR_STORAGE +GNULIB_ACCEPT4 +GNULIB_SHUTDOWN +GNULIB_SETSOCKOPT +GNULIB_SENDTO +GNULIB_RECVFROM +GNULIB_SEND +GNULIB_RECV +GNULIB_LISTEN +GNULIB_GETSOCKOPT +GNULIB_GETSOCKNAME +GNULIB_GETPEERNAME +GNULIB_BIND +GNULIB_ACCEPT +GNULIB_CONNECT +GNULIB_SOCKET +gltests_WITNESS +NEXT_AS_FIRST_DIRECTIVE_WCHAR_H +NEXT_WCHAR_H +HAVE_FEATURES_H +LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE +LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE +LIBUNISTRING_UNIWIDTH_H +LIBUNISTRING_UNITYPES_H +LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE +LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE +LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE +LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE +LIBUNISTRING_UNISTR_H +HAVE_UNISTD_H +NEXT_AS_FIRST_DIRECTIVE_UNISTD_H +NEXT_UNISTD_H +UNISTD_H_DEFINES_STRUCT_TIMESPEC +PTHREAD_H_DEFINES_STRUCT_TIMESPEC +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC +TIME_H_DEFINES_STRUCT_TIMESPEC +NEXT_AS_FIRST_DIRECTIVE_TIME_H +NEXT_TIME_H +NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H +NEXT_SYS_WAIT_H +GNULIB_WAITPID +WINDOWS_STAT_INODES +WINDOWS_64_BIT_OFF_T +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H +NEXT_SYS_TYPES_H +HAVE_STRINGS_H +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H +NEXT_STRINGS_H +NEXT_AS_FIRST_DIRECTIVE_STRING_H +NEXT_STRING_H +HAVE_DECL_STRNCASECMP +HAVE_STRCASECMP +HAVE_FFS +GNULIB_FFS +NEXT_AS_FIRST_DIRECTIVE_STDLIB_H +NEXT_STDLIB_H +NEXT_AS_FIRST_DIRECTIVE_STDIO_H +NEXT_STDIO_H +HAVE__BOOL +GL_GENERATE_STDBOOL_H_FALSE +GL_GENERATE_STDBOOL_H_TRUE +STDBOOL_H +GL_GENERATE_STDARG_H_FALSE +GL_GENERATE_STDARG_H_TRUE +STDARG_H +NEXT_AS_FIRST_DIRECTIVE_STDARG_H +NEXT_STDARG_H +NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H +NEXT_SIGNAL_H +REPLACE_RAISE +REPLACE_PTHREAD_SIGMASK +HAVE_SIGHANDLER_T +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T +HAVE_STRUCT_SIGACTION_SA_SIGACTION +HAVE_SIGACTION +HAVE_SIGINFO_T +HAVE_SIGSET_T +HAVE_RAISE +HAVE_PTHREAD_SIGMASK +HAVE_POSIX_SIGNALBLOCKING +GNULIB_SIGACTION +GNULIB_SIGPROCMASK +GNULIB_SIGNAL_H_SIGPIPE +GNULIB_RAISE +GNULIB_PTHREAD_SIGMASK +UNDEFINE_STRTOK_R +REPLACE_STRTOK_R +REPLACE_STRSIGNAL +REPLACE_STRNLEN +REPLACE_STRNDUP +REPLACE_STRNCAT +REPLACE_STRERROR_R +REPLACE_STRERROR +REPLACE_STRCHRNUL +REPLACE_STRCASESTR +REPLACE_STRSTR +REPLACE_STRDUP +REPLACE_STPNCPY +REPLACE_MEMMEM +REPLACE_MEMCHR +HAVE_STRVERSCMP +HAVE_DECL_STRSIGNAL +HAVE_DECL_STRERROR_R +HAVE_DECL_STRTOK_R +HAVE_STRCASESTR +HAVE_STRSEP +HAVE_STRPBRK +HAVE_DECL_STRNLEN +HAVE_DECL_STRNDUP +HAVE_DECL_STRDUP +HAVE_STRCHRNUL +HAVE_STPNCPY +HAVE_STPCPY +HAVE_RAWMEMCHR +HAVE_DECL_MEMRCHR +HAVE_MEMPCPY +HAVE_DECL_MEMMEM +HAVE_MEMCHR +HAVE_FFSLL +HAVE_FFSL +HAVE_MBSLEN +GNULIB_STRVERSCMP +GNULIB_STRSIGNAL +GNULIB_STRERROR_R +GNULIB_STRERROR +GNULIB_MBSTOK_R +GNULIB_MBSSEP +GNULIB_MBSSPN +GNULIB_MBSPBRK +GNULIB_MBSCSPN +GNULIB_MBSCASESTR +GNULIB_MBSPCASECMP +GNULIB_MBSNCASECMP +GNULIB_MBSCASECMP +GNULIB_MBSSTR +GNULIB_MBSRCHR +GNULIB_MBSCHR +GNULIB_MBSNLEN +GNULIB_MBSLEN +GNULIB_STRTOK_R +GNULIB_STRCASESTR +GNULIB_STRSTR +GNULIB_STRSEP +GNULIB_STRPBRK +GNULIB_STRNLEN +GNULIB_STRNDUP +GNULIB_STRNCAT +GNULIB_STRDUP +GNULIB_STRCHRNUL +GNULIB_STPNCPY +GNULIB_STPCPY +GNULIB_RAWMEMCHR +GNULIB_MEMRCHR +GNULIB_MEMPCPY +GNULIB_MEMMEM +GNULIB_MEMCHR +GNULIB_FFSLL +GNULIB_FFSL +LOCALE_FR_UTF8 +LOCALE_ZH_CN +LOCALE_JA +REPLACE_WCTOMB +REPLACE_UNSETENV +REPLACE_STRTOD +REPLACE_SETENV +REPLACE_REALPATH +REPLACE_REALLOC +REPLACE_RANDOM_R +REPLACE_QSORT_R +REPLACE_PUTENV +REPLACE_PTSNAME_R +REPLACE_PTSNAME +REPLACE_MKSTEMP +REPLACE_MBTOWC +REPLACE_MALLOC +REPLACE_CANONICALIZE_FILE_NAME +REPLACE_CALLOC +HAVE_DECL_UNSETENV +HAVE_UNLOCKPT +HAVE_SYS_LOADAVG_H +HAVE_STRUCT_RANDOM_DATA +HAVE_STRTOULL +HAVE_STRTOLL +HAVE_STRTOD +HAVE_DECL_SETENV +HAVE_SETENV +HAVE_SECURE_GETENV +HAVE_RPMATCH +HAVE_REALPATH +HAVE_RANDOM_R +HAVE_RANDOM_H +HAVE_RANDOM +HAVE_QSORT_R +HAVE_PTSNAME_R +HAVE_PTSNAME +HAVE_POSIX_OPENPT +HAVE_MKSTEMPS +HAVE_MKSTEMP +HAVE_MKOSTEMPS +HAVE_MKOSTEMP +HAVE_MKDTEMP +HAVE_GRANTPT +HAVE_GETSUBOPT +HAVE_DECL_GETLOADAVG +HAVE_CANONICALIZE_FILE_NAME +HAVE_ATOLL +HAVE__EXIT +GNULIB_WCTOMB +GNULIB_UNSETENV +GNULIB_UNLOCKPT +GNULIB_SYSTEM_POSIX +GNULIB_STRTOULL +GNULIB_STRTOLL +GNULIB_STRTOD +GNULIB_SETENV +GNULIB_SECURE_GETENV +GNULIB_RPMATCH +GNULIB_REALPATH +GNULIB_REALLOC_POSIX +GNULIB_RANDOM_R +GNULIB_RANDOM +GNULIB_QSORT_R +GNULIB_PUTENV +GNULIB_PTSNAME_R +GNULIB_PTSNAME +GNULIB_POSIX_OPENPT +GNULIB_MKSTEMPS +GNULIB_MKSTEMP +GNULIB_MKOSTEMPS +GNULIB_MKOSTEMP +GNULIB_MKDTEMP +GNULIB_MBTOWC +GNULIB_MALLOC_POSIX +GNULIB_GRANTPT +GNULIB_GETSUBOPT +GNULIB_GETLOADAVG +GNULIB_CANONICALIZE_FILE_NAME +GNULIB_CALLOC_POSIX +GNULIB_ATOLL +GNULIB__EXIT +SED +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H +NEXT_LOCALE_H +HAVE_XLOCALE_H +NEXT_AS_FIRST_DIRECTIVE_STDDEF_H +NEXT_STDDEF_H +GL_GENERATE_STDDEF_H_FALSE +GL_GENERATE_STDDEF_H_TRUE +STDDEF_H +HAVE_WCHAR_T +HAVE_MAX_ALIGN_T +REPLACE_NULL +REPLACE_STRUCT_LCONV +REPLACE_DUPLOCALE +REPLACE_SETLOCALE +REPLACE_LOCALECONV +HAVE_DUPLOCALE +GNULIB_DUPLOCALE +GNULIB_SETLOCALE +GNULIB_LOCALECONV +LOCALCHARSET_TESTS_ENVIRONMENT +GLIBC21 +HAVE_LANGINFO_YESEXPR +HAVE_LANGINFO_ERA +HAVE_LANGINFO_T_FMT_AMPM +HAVE_LANGINFO_CODESET +HAVE_LANGINFO_H +NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H +NEXT_LANGINFO_H +REPLACE_NL_LANGINFO +HAVE_NL_LANGINFO +GNULIB_NL_LANGINFO +REPLACE_TOWLOWER +REPLACE_ISWCNTRL +HAVE_WCTYPE_H +NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H +NEXT_WCTYPE_H +HAVE_CRTDEFS_H +HAVE_WINT_T +HAVE_ISWCNTRL +REPLACE_ISWBLANK +HAVE_WCTRANS_T +HAVE_WCTYPE_T +HAVE_ISWBLANK +GNULIB_TOWCTRANS +GNULIB_WCTRANS +GNULIB_ISWCTYPE +GNULIB_WCTYPE +GNULIB_ISWBLANK +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H +NEXT_INTTYPES_H +UINT64_MAX_EQ_ULONG_MAX +UINT32_MAX_LT_UINTMAX_MAX +PRIPTR_PREFIX +PRI_MACROS_BROKEN +INT64_MAX_EQ_LONG_MAX +INT32_MAX_LT_INTMAX_MAX +REPLACE_STRTOUMAX +REPLACE_STRTOIMAX +HAVE_DECL_STRTOUMAX +HAVE_DECL_STRTOIMAX +HAVE_DECL_IMAXDIV +HAVE_DECL_IMAXABS +GNULIB_STRTOUMAX +GNULIB_STRTOIMAX +GNULIB_IMAXDIV +GNULIB_IMAXABS +GL_GENERATE_STDINT_H_FALSE +GL_GENERATE_STDINT_H_TRUE +STDINT_H +HAVE_SYS_INTTYPES_H +HAVE_SYS_BITYPES_H +HAVE_C99_STDINT_H +WINT_T_SUFFIX +WCHAR_T_SUFFIX +SIG_ATOMIC_T_SUFFIX +SIZE_T_SUFFIX +PTRDIFF_T_SUFFIX +HAVE_SIGNED_WINT_T +HAVE_SIGNED_WCHAR_T +HAVE_SIGNED_SIG_ATOMIC_T +BITSIZEOF_WINT_T +BITSIZEOF_WCHAR_T +BITSIZEOF_SIG_ATOMIC_T +BITSIZEOF_SIZE_T +BITSIZEOF_PTRDIFF_T +APPLE_UNIVERSAL_BUILD +HAVE_STDINT_H +NEXT_AS_FIRST_DIRECTIVE_STDINT_H +NEXT_STDINT_H +HAVE_SYS_TYPES_H +HAVE_INTTYPES_H +HAVE_WCHAR_H +HAVE_UNSIGNED_LONG_LONG_INT +HAVE_LONG_LONG_INT +GNULIB_OVERRIDES_WINT_T +GL_GENERATE_LIMITS_H_FALSE +GL_GENERATE_LIMITS_H_TRUE +LIMITS_H +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H +NEXT_LIMITS_H +NEXT_AS_FIRST_DIRECTIVE_ICONV_H +NEXT_ICONV_H +GL_GENERATE_ICONV_H_FALSE +GL_GENERATE_ICONV_H_TRUE +ICONV_H +REPLACE_ICONV_UTF +REPLACE_ICONV_OPEN +REPLACE_ICONV +ICONV_CONST +GNULIB_ICONV +LTLIBICONV +LIBICONV +GNU_MAKE_FALSE +GNU_MAKE_TRUE +REPLACE_LOCALTIME +REPLACE_GMTIME +REPLACE_TZSET +REPLACE_TIMEGM +REPLACE_STRFTIME +REPLACE_NANOSLEEP +REPLACE_MKTIME +REPLACE_LOCALTIME_R +REPLACE_CTIME +HAVE_TIMEZONE_T +HAVE_TZSET +HAVE_TIMEGM +HAVE_STRPTIME +HAVE_NANOSLEEP +HAVE_DECL_LOCALTIME_R +GNULIB_TZSET +GNULIB_TIME_RZ +GNULIB_TIME_R +GNULIB_TIMEGM +GNULIB_STRPTIME +GNULIB_STRFTIME +GNULIB_NANOSLEEP +GNULIB_LOCALTIME +GNULIB_MKTIME +GNULIB_CTIME +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H +NEXT_SYS_TIME_H +REPLACE_STRUCT_TIMEVAL +REPLACE_GETTIMEOFDAY +HAVE_SYS_TIME_H +HAVE_STRUCT_TIMEVAL +HAVE_GETTIMEOFDAY +GNULIB_GETTIMEOFDAY +LTLIBINTL +LIBINTL +GNULIB_GL_UNISTD_H_GETOPT +GETOPT_CDEFS_H +GETOPT_H +HAVE_SYS_CDEFS_H +HAVE_GETOPT_H +NEXT_AS_FIRST_DIRECTIVE_GETOPT_H +NEXT_GETOPT_H +WINDOWS_64_BIT_ST_SIZE +WINDOWS_STAT_TIMESPEC +NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H +NEXT_SYS_STAT_H +REPLACE_UTIMENSAT +REPLACE_STAT +REPLACE_MKNOD +REPLACE_MKFIFO +REPLACE_MKDIR +REPLACE_LSTAT +REPLACE_FUTIMENS +REPLACE_FSTATAT +REPLACE_FSTAT +HAVE_UTIMENSAT +HAVE_MKNODAT +HAVE_MKNOD +HAVE_MKFIFOAT +HAVE_MKFIFO +HAVE_MKDIRAT +HAVE_LSTAT +HAVE_LCHMOD +HAVE_FUTIMENS +HAVE_FSTATAT +HAVE_FCHMODAT +GNULIB_OVERRIDES_STRUCT_STAT +GNULIB_UTIMENSAT +GNULIB_STAT +GNULIB_MKNODAT +GNULIB_MKNOD +GNULIB_MKFIFOAT +GNULIB_MKFIFO +GNULIB_MKDIRAT +GNULIB_LSTAT +GNULIB_LCHMOD +GNULIB_FUTIMENS +GNULIB_FSTATAT +GNULIB_FSTAT +GNULIB_FCHMODAT +REPLACE_VSPRINTF +REPLACE_VSNPRINTF +REPLACE_VPRINTF +REPLACE_VFPRINTF +REPLACE_VDPRINTF +REPLACE_VASPRINTF +REPLACE_TMPFILE +REPLACE_STDIO_WRITE_FUNCS +REPLACE_STDIO_READ_FUNCS +REPLACE_SPRINTF +REPLACE_SNPRINTF +REPLACE_RENAMEAT +REPLACE_RENAME +REPLACE_REMOVE +REPLACE_PRINTF +REPLACE_POPEN +REPLACE_PERROR +REPLACE_OBSTACK_PRINTF +REPLACE_GETLINE +REPLACE_GETDELIM +REPLACE_FTELLO +REPLACE_FTELL +REPLACE_FSEEKO +REPLACE_FSEEK +REPLACE_FREOPEN +REPLACE_FPURGE +REPLACE_FPRINTF +REPLACE_FOPEN +REPLACE_FFLUSH +REPLACE_FDOPEN +REPLACE_FCLOSE +REPLACE_DPRINTF +HAVE_VDPRINTF +HAVE_VASPRINTF +HAVE_RENAMEAT +HAVE_POPEN +HAVE_PCLOSE +HAVE_FTELLO +HAVE_FSEEKO +HAVE_DPRINTF +HAVE_DECL_VSNPRINTF +HAVE_DECL_SNPRINTF +HAVE_DECL_OBSTACK_PRINTF +HAVE_DECL_GETLINE +HAVE_DECL_GETDELIM +HAVE_DECL_FTELLO +HAVE_DECL_FSEEKO +HAVE_DECL_FPURGE +GNULIB_VSPRINTF_POSIX +GNULIB_VSNPRINTF +GNULIB_VPRINTF_POSIX +GNULIB_VPRINTF +GNULIB_VFPRINTF_POSIX +GNULIB_VFPRINTF +GNULIB_VDPRINTF +GNULIB_VSCANF +GNULIB_VFSCANF +GNULIB_VASPRINTF +GNULIB_TMPFILE +GNULIB_STDIO_H_SIGPIPE +GNULIB_STDIO_H_NONBLOCKING +GNULIB_SPRINTF_POSIX +GNULIB_SNPRINTF +GNULIB_SCANF +GNULIB_RENAMEAT +GNULIB_RENAME +GNULIB_REMOVE +GNULIB_PUTS +GNULIB_PUTCHAR +GNULIB_PUTC +GNULIB_PRINTF_POSIX +GNULIB_PRINTF +GNULIB_POPEN +GNULIB_PERROR +GNULIB_PCLOSE +GNULIB_OBSTACK_PRINTF_POSIX +GNULIB_OBSTACK_PRINTF +GNULIB_GETLINE +GNULIB_GETDELIM +GNULIB_GETCHAR +GNULIB_GETC +GNULIB_FWRITE +GNULIB_FTELLO +GNULIB_FTELL +GNULIB_FSEEKO +GNULIB_FSEEK +GNULIB_FSCANF +GNULIB_FREOPEN +GNULIB_FREAD +GNULIB_FPUTS +GNULIB_FPUTC +GNULIB_FPURGE +GNULIB_FPRINTF_POSIX +GNULIB_FPRINTF +GNULIB_FOPEN +GNULIB_FGETS +GNULIB_FGETC +GNULIB_FFLUSH +GNULIB_FDOPEN +GNULIB_FCLOSE +GNULIB_DPRINTF +GL_GENERATE_FNMATCH_H_FALSE +GL_GENERATE_FNMATCH_H_TRUE +FNMATCH_H +REPLACE_ITOLD +GL_GENERATE_FLOAT_H_FALSE +GL_GENERATE_FLOAT_H_TRUE +FLOAT_H +NEXT_AS_FIRST_DIRECTIVE_FLOAT_H +NEXT_FLOAT_H +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H +NEXT_FCNTL_H +REPLACE_OPENAT +REPLACE_OPEN +REPLACE_FCNTL +HAVE_OPENAT +HAVE_FCNTL +GNULIB_OPENAT +GNULIB_OPEN +GNULIB_NONBLOCKING +GNULIB_FCNTL +EOVERFLOW_VALUE +EOVERFLOW_HIDDEN +ENOLINK_VALUE +ENOLINK_HIDDEN +EMULTIHOP_VALUE +EMULTIHOP_HIDDEN +GL_GENERATE_ERRNO_H_FALSE +GL_GENERATE_ERRNO_H_TRUE +ERRNO_H +NEXT_AS_FIRST_DIRECTIVE_ERRNO_H +NEXT_ERRNO_H +NEXT_AS_FIRST_DIRECTIVE_CTYPE_H +NEXT_CTYPE_H +PRAGMA_COLUMNS +PRAGMA_SYSTEM_HEADER +INCLUDE_NEXT_AS_FIRST_DIRECTIVE +INCLUDE_NEXT +HAVE_ISBLANK +GNULIB_ISBLANK +pkglibexecdir +lispdir +HAVE_WINSOCK2_H +REPLACE_IOCTL +SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS +SYS_IOCTL_H_HAVE_WINSOCK2_H +GNULIB_IOCTL +HAVE_MSVC_INVALID_PARAMETER_HANDLER +UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS +UNISTD_H_HAVE_WINSOCK2_H +REPLACE_WRITE +REPLACE_USLEEP +REPLACE_UNLINKAT +REPLACE_UNLINK +REPLACE_TTYNAME_R +REPLACE_TRUNCATE +REPLACE_SYMLINKAT +REPLACE_SYMLINK +REPLACE_SLEEP +REPLACE_RMDIR +REPLACE_READLINKAT +REPLACE_READLINK +REPLACE_READ +REPLACE_PWRITE +REPLACE_PREAD +REPLACE_LSEEK +REPLACE_LINKAT +REPLACE_LINK +REPLACE_LCHOWN +REPLACE_ISATTY +REPLACE_GETPAGESIZE +REPLACE_GETGROUPS +REPLACE_GETLOGIN_R +REPLACE_GETDTABLESIZE +REPLACE_GETDOMAINNAME +REPLACE_GETCWD +REPLACE_FTRUNCATE +REPLACE_FCHOWNAT +REPLACE_DUP2 +REPLACE_DUP +REPLACE_CLOSE +REPLACE_CHOWN +HAVE_SYS_PARAM_H +HAVE_OS_H +HAVE_DECL_TTYNAME_R +HAVE_DECL_SETHOSTNAME +HAVE_DECL_GETUSERSHELL +HAVE_DECL_GETPAGESIZE +HAVE_DECL_GETLOGIN_R +HAVE_DECL_GETLOGIN +HAVE_DECL_GETDOMAINNAME +HAVE_DECL_FDATASYNC +HAVE_DECL_FCHDIR +HAVE_DECL_ENVIRON +HAVE_USLEEP +HAVE_UNLINKAT +HAVE_TRUNCATE +HAVE_SYMLINKAT +HAVE_SYMLINK +HAVE_SLEEP +HAVE_SETHOSTNAME +HAVE_READLINKAT +HAVE_READLINK +HAVE_PWRITE +HAVE_PREAD +HAVE_PIPE2 +HAVE_PIPE +HAVE_LINKAT +HAVE_LINK +HAVE_LCHOWN +HAVE_GROUP_MEMBER +HAVE_GETPAGESIZE +HAVE_GETLOGIN +HAVE_GETHOSTNAME +HAVE_GETGROUPS +HAVE_GETDTABLESIZE +HAVE_FTRUNCATE +HAVE_FSYNC +HAVE_FDATASYNC +HAVE_FCHOWNAT +HAVE_FCHDIR +HAVE_FACCESSAT +HAVE_EUIDACCESS +HAVE_DUP3 +HAVE_DUP2 +HAVE_CHOWN +GNULIB_WRITE +GNULIB_USLEEP +GNULIB_UNLINKAT +GNULIB_UNLINK +GNULIB_UNISTD_H_SIGPIPE +GNULIB_UNISTD_H_NONBLOCKING +GNULIB_TTYNAME_R +GNULIB_TRUNCATE +GNULIB_SYMLINKAT +GNULIB_SYMLINK +GNULIB_SLEEP +GNULIB_SETHOSTNAME +GNULIB_RMDIR +GNULIB_READLINKAT +GNULIB_READLINK +GNULIB_READ +GNULIB_PWRITE +GNULIB_PREAD +GNULIB_PIPE2 +GNULIB_PIPE +GNULIB_LSEEK +GNULIB_LINKAT +GNULIB_LINK +GNULIB_LCHOWN +GNULIB_ISATTY +GNULIB_GROUP_MEMBER +GNULIB_GETUSERSHELL +GNULIB_GETPAGESIZE +GNULIB_GETLOGIN_R +GNULIB_GETLOGIN +GNULIB_GETHOSTNAME +GNULIB_GETGROUPS +GNULIB_GETDTABLESIZE +GNULIB_GETDOMAINNAME +GNULIB_GETCWD +GNULIB_FTRUNCATE +GNULIB_FSYNC +GNULIB_FDATASYNC +GNULIB_FCHOWNAT +GNULIB_FCHDIR +GNULIB_FACCESSAT +GNULIB_EUIDACCESS +GNULIB_ENVIRON +GNULIB_DUP3 +GNULIB_DUP2 +GNULIB_DUP +GNULIB_CLOSE +GNULIB_CHOWN +GNULIB_CHDIR +LIB_CLOCK_GETTIME +LTLIBCSTACK +LIBCSTACK +LIBSIGSEGV_PREFIX +LTLIBSIGSEGV +LIBSIGSEGV +HAVE_LIBSIGSEGV +LOCALE_FR +REPLACE_WCSFTIME +REPLACE_WCSWIDTH +REPLACE_WCWIDTH +REPLACE_WCSNRTOMBS +REPLACE_WCSRTOMBS +REPLACE_WCRTOMB +REPLACE_MBSNRTOWCS +REPLACE_MBSRTOWCS +REPLACE_MBRLEN +REPLACE_MBRTOWC +REPLACE_MBSINIT +REPLACE_WCTOB +REPLACE_BTOWC +REPLACE_MBSTATE_T +HAVE_DECL_WCWIDTH +HAVE_DECL_WCTOB +HAVE_WCSFTIME +HAVE_WCSWIDTH +HAVE_WCSTOK +HAVE_WCSSTR +HAVE_WCSPBRK +HAVE_WCSSPN +HAVE_WCSCSPN +HAVE_WCSRCHR +HAVE_WCSCHR +HAVE_WCSDUP +HAVE_WCSXFRM +HAVE_WCSCOLL +HAVE_WCSNCASECMP +HAVE_WCSCASECMP +HAVE_WCSNCMP +HAVE_WCSCMP +HAVE_WCSNCAT +HAVE_WCSCAT +HAVE_WCPNCPY +HAVE_WCSNCPY +HAVE_WCPCPY +HAVE_WCSCPY +HAVE_WCSNLEN +HAVE_WCSLEN +HAVE_WMEMSET +HAVE_WMEMMOVE +HAVE_WMEMCPY +HAVE_WMEMCMP +HAVE_WMEMCHR +HAVE_WCSNRTOMBS +HAVE_WCSRTOMBS +HAVE_WCRTOMB +HAVE_MBSNRTOWCS +HAVE_MBSRTOWCS +HAVE_MBRLEN +HAVE_MBRTOWC +HAVE_MBSINIT +HAVE_BTOWC +GNULIB_WCSFTIME +GNULIB_WCSWIDTH +GNULIB_WCSTOK +GNULIB_WCSSTR +GNULIB_WCSPBRK +GNULIB_WCSSPN +GNULIB_WCSCSPN +GNULIB_WCSRCHR +GNULIB_WCSCHR +GNULIB_WCSDUP +GNULIB_WCSXFRM +GNULIB_WCSCOLL +GNULIB_WCSNCASECMP +GNULIB_WCSCASECMP +GNULIB_WCSNCMP +GNULIB_WCSCMP +GNULIB_WCSNCAT +GNULIB_WCSCAT +GNULIB_WCPNCPY +GNULIB_WCSNCPY +GNULIB_WCPCPY +GNULIB_WCSCPY +GNULIB_WCSNLEN +GNULIB_WCSLEN +GNULIB_WMEMSET +GNULIB_WMEMMOVE +GNULIB_WMEMCPY +GNULIB_WMEMCMP +GNULIB_WMEMCHR +GNULIB_WCWIDTH +GNULIB_WCSNRTOMBS +GNULIB_WCSRTOMBS +GNULIB_WCRTOMB +GNULIB_MBSNRTOWCS +GNULIB_MBSRTOWCS +GNULIB_MBRLEN +GNULIB_MBRTOWC +GNULIB_MBSINIT +GNULIB_WCTOB +GNULIB_BTOWC +GL_GENERATE_ALLOCA_H_FALSE +GL_GENERATE_ALLOCA_H_TRUE +ALLOCA_H +ALLOCA +GL_COND_LIBTOOL_FALSE +GL_COND_LIBTOOL_TRUE +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +ARFLAGS +AR +EGREP +GREP +CPP +RANLIB +HELP2MAN +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +SET_MAKE +AWK +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +mkdir_p +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +enable_largefile +with_gnu_ld +enable_rpath +with_libsigsegv_prefix +with_libiconv_prefix +with_included_regex +with_packager +with_packager_version +with_packager_bug_reports +enable_gcc_warnings +enable_nls +with_libintl_prefix +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures GNU diffutils 3.6 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/diffutils] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of GNU diffutils 3.6:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --disable-largefile omit support for large files + --disable-rpath do not hardcode runtime library paths + --enable-gcc-warnings turn on lots of GCC warnings (for developers) + --disable-nls do not use Native Language Support + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-libsigsegv-prefix[=DIR] search for libsigsegv in DIR/include and DIR/lib + --without-libsigsegv-prefix don't search for libsigsegv in includedir and libdir + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib + --without-libiconv-prefix don't search for libiconv in includedir and libdir + --without-included-regex + don't compile regex; this is the default on systems + with recent-enough versions of the GNU C Library + (use with caution on other systems). + --with-packager String identifying the packager of this software + --with-packager-version Packager-specific version information + --with-packager-bug-reports + Packager info for bug reports (URL/e-mail/...) + --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib + --without-libintl-prefix don't search for libintl in includedir and libdir + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a + nonstandard directory <lib dir> + LIBS libraries to pass to the linker, e.g. -l<library> + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if + you have headers in a nonstandard directory <include dir> + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to <bug-diffutils@gnu.org>. +GNU diffutils home page: <http://www.gnu.org/software/diffutils/>. +General help using GNU software: <http://www.gnu.org/gethelp/>. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +GNU diffutils configure 3.6 +generated by GNU Autoconf 2.69.185-b502e + +Copyright (C) 2017 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case <limits.h> declares $2. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. */ + +#include <limits.h> +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main (void) +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_c_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + # Initialize each $ac_[]_AC_LANG_ABBREV[]_decl_warn_flag once. + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else + ac_save_werror_flag=$ac_c_werror_flag + ac_c_werror_flag="$ac_c_decl_warn_flag$ac_c_werror_flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + ac_c_werror_flag=$ac_save_werror_flag + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_decl + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include <stdio.h> +#include <stdlib.h> +int +main (void) +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + echo >>conftest.val; read $3 <conftest.val; ac_retval=0 +else + ac_retval=1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f conftest.val + + fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_compute_int + +# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +# ---------------------------------------------------- +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +printf %s "checking for $2.$3... " >&6; } +if eval test \${$4+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$4=yes" +else + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_member +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by GNU diffutils $as_me 3.6, which was +generated by GNU Autoconf 2.69.185-b502e. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + { + echo + + printf "%s\n" "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + printf "%s\n" "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + printf "%s\n" "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + printf "%s\n" "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +printf "%s\n" "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +as_fn_append ac_func_c_list " btowc HAVE_BTOWC" +as_fn_append ac_func_c_list " setrlimit HAVE_SETRLIMIT" +as_fn_append ac_header_c_list " ucontext.h ucontext_h HAVE_UCONTEXT_H" +as_fn_append ac_func_c_list " sigaltstack HAVE_SIGALTSTACK" +as_fn_append ac_func_c_list " readlinkat HAVE_READLINKAT" +as_fn_append ac_func_c_list " _set_invalid_parameter_handler HAVE__SET_INVALID_PARAMETER_HANDLER" +as_fn_append ac_header_c_list " sys/socket.h sys_socket_h HAVE_SYS_SOCKET_H" +as_fn_append ac_func_c_list " strerror_r HAVE_STRERROR_R" +as_fn_append ac_func_c_list " fcntl HAVE_FCNTL" +as_fn_append ac_func_c_list " symlink HAVE_SYMLINK" +as_fn_append ac_func_c_list " mempcpy HAVE_MEMPCPY" +as_fn_append ac_func_c_list " isblank HAVE_ISBLANK" +as_fn_append ac_func_c_list " iswctype HAVE_ISWCTYPE" +as_fn_append ac_func_c_list " mbsrtowcs HAVE_MBSRTOWCS" +as_fn_append ac_func_c_list " wmemchr HAVE_WMEMCHR" +as_fn_append ac_func_c_list " wmemcpy HAVE_WMEMCPY" +as_fn_append ac_func_c_list " wmempcpy HAVE_WMEMPCPY" +as_fn_append ac_header_c_list " wctype.h wctype_h HAVE_WCTYPE_H" +gl_fnmatch_required=GNU +as_fn_append ac_func_c_list " getdtablesize HAVE_GETDTABLESIZE" +gl_getopt_required=GNU +as_fn_append ac_header_c_list " getopt.h getopt_h HAVE_GETOPT_H" +as_fn_append ac_header_c_list " sys/cdefs.h sys_cdefs_h HAVE_SYS_CDEFS_H" +as_fn_append ac_func_c_list " getprogname HAVE_GETPROGNAME" +as_fn_append ac_func_c_list " getexecname HAVE_GETEXECNAME" +as_fn_append ac_func_c_list " gettimeofday HAVE_GETTIMEOFDAY" +as_fn_append ac_func_c_list " nanotime HAVE_NANOTIME" +as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H" +as_fn_append ac_header_c_list " iconv.h iconv_h HAVE_ICONV_H" +as_fn_append ac_header_c_list " limits.h limits_h HAVE_LIMITS_H" +as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H" +as_fn_append ac_func_c_list " iswcntrl HAVE_ISWCNTRL" +as_fn_append ac_header_c_list " crtdefs.h crtdefs_h HAVE_CRTDEFS_H" +as_fn_append ac_func_c_list " iswblank HAVE_ISWBLANK" +as_fn_append ac_header_c_list " langinfo.h langinfo_h HAVE_LANGINFO_H" +as_fn_append ac_header_c_list " xlocale.h xlocale_h HAVE_XLOCALE_H" +as_fn_append ac_func_c_list " lstat HAVE_LSTAT" +as_fn_append ac_func_c_list " mbsinit HAVE_MBSINIT" +as_fn_append ac_func_c_list " mbrtowc HAVE_MBRTOWC" +as_fn_append ac_func_c_list " mbslen HAVE_MBSLEN" +as_fn_append ac_header_c_list " sys/mman.h sys_mman_h HAVE_SYS_MMAN_H" +as_fn_append ac_func_c_list " mprotect HAVE_MPROTECT" +as_fn_append ac_func_c_list " mkstemp HAVE_MKSTEMP" +as_fn_append ac_func_c_list " tzset HAVE_TZSET" +as_fn_append ac_func_c_list " nl_langinfo HAVE_NL_LANGINFO" +as_fn_append ac_header_c_list " sys/param.h sys_param_h HAVE_SYS_PARAM_H" +as_fn_append ac_func_c_list " readlink HAVE_READLINK" +as_fn_append ac_header_c_list " malloc.h malloc_h HAVE_MALLOC_H" +as_fn_append ac_func_c_list " secure_getenv HAVE_SECURE_GETENV" +as_fn_append ac_func_c_list " getuid HAVE_GETUID" +as_fn_append ac_func_c_list " geteuid HAVE_GETEUID" +as_fn_append ac_func_c_list " getgid HAVE_GETGID" +as_fn_append ac_func_c_list " getegid HAVE_GETEGID" +as_fn_append ac_func_c_list " setenv HAVE_SETENV" +as_fn_append ac_func_c_list " sigaction HAVE_SIGACTION" +as_fn_append ac_func_c_list " siginterrupt HAVE_SIGINTERRUPT" +as_fn_append ac_func_c_list " __xpg_strerror_r HAVE___XPG_STRERROR_R" +as_fn_append ac_func_c_list " strndup HAVE_STRNDUP" +as_fn_append ac_func_c_list " strptime HAVE_STRPTIME" +as_fn_append ac_func_c_list " strtoumax HAVE_STRTOUMAX" +as_fn_append ac_header_c_list " sys/wait.h sys_wait_h HAVE_SYS_WAIT_H" +as_fn_append ac_func_c_list " localtime_r HAVE_LOCALTIME_R" +as_fn_append ac_func_c_list " timegm HAVE_TIMEGM" +as_fn_append ac_func_c_list " vasnprintf HAVE_VASNPRINTF" +as_fn_append ac_header_c_list " features.h features_h HAVE_FEATURES_H" +as_fn_append ac_func_c_list " snprintf HAVE_SNPRINTF" +as_fn_append ac_func_c_list " wcrtomb HAVE_WCRTOMB" +as_fn_append ac_func_c_list " wcwidth HAVE_WCWIDTH" +as_fn_append ac_header_c_list " arpa/inet.h arpa_inet_h HAVE_ARPA_INET_H" +as_fn_append ac_func_c_list " ftruncate HAVE_FTRUNCATE" +as_fn_append ac_header_c_list " netdb.h netdb_h HAVE_NETDB_H" +as_fn_append ac_header_c_list " netinet/in.h netinet_in_h HAVE_NETINET_IN_H" +as_fn_append ac_func_c_list " newlocale HAVE_NEWLOCALE" +as_fn_append ac_header_c_list " sys/select.h sys_select_h HAVE_SYS_SELECT_H" +as_fn_append ac_func_c_list " pipe HAVE_PIPE" +as_fn_append ac_func_c_list " sleep HAVE_SLEEP" +as_fn_append ac_func_c_list " catgets HAVE_CATGETS" +as_fn_append ac_header_c_list " sys/ioctl.h sys_ioctl_h HAVE_SYS_IOCTL_H" +as_fn_append ac_func_c_list " shutdown HAVE_SHUTDOWN" +as_fn_append ac_header_c_list " sys/uio.h sys_uio_h HAVE_SYS_UIO_H" +as_fn_append ac_func_c_list " wctob HAVE_WCTOB" +as_fn_append ac_func_c_list " sigprocmask HAVE_SIGPROCMASK" +as_fn_append ac_func_c_list " strcasecoll HAVE_STRCASECOLL" +as_fn_append ac_func_c_list " stricoll HAVE_STRICOLL" +as_fn_append ac_header_c_list " vfork.h vfork_h HAVE_VFORK_H" +as_fn_append ac_func_c_list " fork HAVE_FORK" +as_fn_append ac_func_c_list " vfork HAVE_VFORK" +gt_needs="$gt_needs need-ngettext" +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +ac_aux_dir= +for ac_dir in build-aux "$srcdir"/build-aux +do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + + +am__api_version='1.99a' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test ${ac_cv_path_install+y}; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +printf %s "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + 'BusyBox '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test ${ac_cv_path_mkdir+y}; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +# Check whether --enable-silent-rules was given. +if test ${enable_silent_rules+y} +then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else + if printf "%s\n" 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +mkdir_p='$(MKDIR_P)' +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='diffutils' + VERSION='3.6' + + +printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h + + +printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: <http://www.gnu.org/software/coreutils/>. + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + +# Check whether --enable-silent-rules was given. +if test ${enable_silent_rules+y} +then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; +esac +am_make=${MAKE-make} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else + if printf "%s\n" 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + # make --enable-silent-rules the default. + +ac_config_headers="$ac_config_headers lib/config.h:lib/config.hin" + + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +int +main (void) +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" = maybe && test "x$build" != "x$host"; then + cross_compiling=yes +elif test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdlib.h> +#include <wchar.h> +#include <stdio.h> + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + your preprocessor is broken; +#endif +#if BIG_OK +#else + your preprocessor is broken; +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg (args_copy, const char *); + break; + case 'd': // int + number = va_arg (args_copy, int); + break; + case 'f': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; + +int +main (void) +{ + + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); + + v1.i = 2; + v1.w.k = 5; + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + + ; + return 0; +} +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +ac_prog_cc_stdc_options= +case "x$ac_cv_prog_cc_c11" in + x) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } ;; + xno) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } ;; + *) + ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c11" + CC=$CC$ac_prog_cc_stdc_options + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c11" != xno +then : + ac_prog_cc_stdc=c11 + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdlib.h> +#include <wchar.h> +#include <stdio.h> + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + your preprocessor is broken; +#endif +#if BIG_OK +#else + your preprocessor is broken; +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg (args_copy, const char *); + break; + case 'd': // int + number = va_arg (args_copy, int); + break; + case 'f': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +int +main (void) +{ + + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); + + ; + return 0; +} +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +ac_prog_cc_stdc_options= +case "x$ac_cv_prog_cc_c99" in + x) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } ;; + xno) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } ;; + *) + ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c99" + CC=$CC$ac_prog_cc_stdc_options + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c99" != xno +then : + ac_prog_cc_stdc=c99 + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main (void) +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +ac_prog_cc_stdc_options= +case "x$ac_cv_prog_cc_c89" in + x) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } ;; + xno) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } ;; + *) + ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c89" + CC=$CC$ac_prog_cc_stdc_options + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno +then : + ac_prog_cc_stdc=c89 + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 +else + ac_prog_cc_stdc=no + ac_cv_prog_cc_stdc=no +fi + +fi + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +DEPDIR=.deps + +ac_config_commands="$ac_config_commands depfiles" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } + +# Check whether --enable-dependency-tracking was given. +if test ${enable_dependency_tracking+y} +then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + + +HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"} + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + +printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h + +printf "%s\n" "#define HAVE_STRING_H 1" >>confdefs.h + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + + + ac_fn_c_check_header_compile "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes +then : + MINIX=yes +else + MINIX= +fi + + if test "$MINIX" = yes; then + +printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h + + +printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +printf "%s\n" "#define _MINIX 1" >>confdefs.h + + +printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test ${ac_cv_safe_to_define___extensions__+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h + + printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h + + printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 +printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } +if test ${ac_cv_should_define__xopen_source+y} +then : + printf %s "(cached) " >&6 +else + ac_cv_should_define__xopen_source=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <wchar.h> + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define _XOPEN_SOURCE 500 + #include <wchar.h> + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_should_define__xopen_source=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 +printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } + test $ac_cv_should_define__xopen_source = yes && + printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + +else + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5 +printf %s "checking for Minix Amsterdam compiler... " >&6; } +if test ${gl_cv_c_amsterdam_compiler+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __ACK__ +Amsterdam +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Amsterdam" >/dev/null 2>&1 +then : + gl_cv_c_amsterdam_compiler=yes +else + gl_cv_c_amsterdam_compiler=no +fi +rm -rf conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5 +printf "%s\n" "$gl_cv_c_amsterdam_compiler" >&6; } + + if test $gl_cv_c_amsterdam_compiler = yes; then + if test -z "$AR"; then + AR='cc -c.a' + fi + if test -z "$ARFLAGS"; then + ARFLAGS='-o' + fi + else + : + fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="ar" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + + if test -z "$ARFLAGS"; then + ARFLAGS='cr' + fi + + + + if test -z "$RANLIB"; then + if test $gl_cv_c_amsterdam_compiler = yes; then + RANLIB=':' + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + fi + fi + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + + + + # IEEE behaviour is the default on all CPUs except Alpha and SH + # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 + # and the GCC 4.1.2 manual). + case "$host_cpu" in + alpha*) + # On Alpha systems, a compiler option provides the behaviour. + # See the ieee(3) manual page, also available at + # <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/0600____.HTM> + if test -n "$GCC"; then + # GCC has the option -mieee. + # For full IEEE compliance (rarely needed), use option -mieee-with-inexact. + CPPFLAGS="$CPPFLAGS -mieee" + else + # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact. + # For full IEEE compliance (rarely needed), use option -ieee_with_inexact. + CPPFLAGS="$CPPFLAGS -ieee" + fi + ;; + sh*) + if test -n "$GCC"; then + # GCC has the option -mieee. + CPPFLAGS="$CPPFLAGS -mieee" + fi + ;; + esac + +# Check whether --enable-largefile was given. +if test ${enable_largefile+y} +then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +printf %s "checking for special C compiler options needed for large files... " >&6; } +if test ${ac_cv_sys_largefile_CC+y} +then : + printf %s "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO" +then : + break +fi +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test ${ac_cv_sys_file_offset_bits+y} +then : + printf %s "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } +if test ${ac_cv_sys_large_files+y} +then : + printf %s "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +printf "%s\n" "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h +;; +esac +rm -rf conftest* + fi + + +printf "%s\n" "#define _DARWIN_USE_64_BIT_INODE 1" >>confdefs.h + +fi + + + + + # Pre-early section. + + + + + # Code from module absolute-header: + # Code from module accept: + # Code from module accept-tests: + # Code from module alloca: + # Code from module alloca-opt: + # Code from module alloca-opt-tests: + # Code from module allocator: + # Code from module announce-gen: + # Code from module areadlink: + # Code from module areadlink-tests: + # Code from module argmatch: + # Code from module argmatch-tests: + # Code from module arpa_inet: + # Code from module arpa_inet-tests: + # Code from module assure: + # Code from module binary-io: + # Code from module binary-io-tests: + # Code from module bind: + # Code from module bind-tests: + # Code from module bitrotate: + # Code from module bitrotate-tests: + # Code from module btowc: + # Code from module btowc-tests: + # Code from module builtin-expect: + # Code from module c-ctype: + # Code from module c-ctype-tests: + # Code from module c-stack: + # Code from module c-stack-tests: + # Code from module c-strcase: + # Code from module c-strcase-tests: + # Code from module c-strcaseeq: + # Code from module careadlinkat: + # Code from module clock-time: + # Code from module close: + # Code from module close-tests: + # Code from module config-h: + # Code from module configmake: + # Code from module connect: + # Code from module connect-tests: + # Code from module ctype: + # Code from module ctype-tests: + # Code from module diffseq: + # Code from module dirname: + # Code from module dirname-lgpl: + # Code from module dirname-tests: + # Code from module do-release-commit-and-tag: + # Code from module dosname: + # Code from module double-slash-root: + # Code from module dtotimespec: + # Code from module dup2: + # Code from module dup2-tests: + # Code from module environ: + # Code from module environ-tests: + # Code from module errno: + # Code from module errno-tests: + # Code from module error: + # Code from module exclude: + # Code from module exclude-tests: + # Code from module exitfail: + # Code from module extensions: + # Code from module extern-inline: + # Code from module fcntl: + # Code from module fcntl-h: + # Code from module fcntl-h-tests: + # Code from module fcntl-tests: + # Code from module fd-hook: + # Code from module fdl: + # Code from module fdopen: + # Code from module fdopen-tests: + # Code from module fgetc-tests: + # Code from module file-type: + # Code from module filename: + # Code from module filenamecat: + # Code from module filenamecat-lgpl: + # Code from module filenamecat-tests: + # Code from module flexmember: + # Code from module float: + # Code from module float-tests: + # Code from module fnmatch: + # Code from module fnmatch-gnu: + # Code from module fnmatch-tests: + # Code from module fpieee: + + # Code from module fpucw: + # Code from module fputc-tests: + # Code from module fread-tests: + # Code from module freopen: + # Code from module freopen-safer: + # Code from module freopen-safer-tests: + # Code from module freopen-tests: + # Code from module fstat: + # Code from module fstat-tests: + # Code from module ftruncate: + # Code from module ftruncate-tests: + # Code from module fwrite-tests: + # Code from module gendocs: + # Code from module getcwd-lgpl: + # Code from module getcwd-lgpl-tests: + # Code from module getdtablesize: + # Code from module getdtablesize-tests: + # Code from module getopt: + # Code from module getopt-gnu: + # Code from module getopt-gnu-tests: + # Code from module getopt-posix: + # Code from module getopt-posix-tests: + # Code from module getpagesize: + # Code from module getprogname: + # Code from module getprogname-tests: + # Code from module gettext-h: + # Code from module gettime: + # Code from module gettimeofday: + # Code from module gettimeofday-tests: + # Code from module git-version-gen: + # Code from module gitlog-to-changelog: + # Code from module gnu-make: + # Code from module gnu-web-doc-update: + # Code from module gnumakefile: + # Code from module gnupload: + # Code from module gperf: + # Code from module hard-locale: + # Code from module hash: + # Code from module hash-pjw: + # Code from module hash-tests: + # Code from module havelib: + # Code from module iconv: + # Code from module iconv-h: + # Code from module iconv-h-tests: + # Code from module iconv-tests: + # Code from module iconv_open: + # Code from module ignore-value: + # Code from module ignore-value-tests: + # Code from module include_next: + # Code from module inet_pton: + # Code from module inet_pton-tests: + # Code from module inline: + # Code from module intprops: + # Code from module intprops-tests: + # Code from module inttostr: + # Code from module inttostr-tests: + # Code from module inttypes: + # Code from module inttypes-incomplete: + # Code from module inttypes-tests: + # Code from module ioctl: + # Code from module ioctl-tests: + # Code from module isblank: + # Code from module isblank-tests: + # Code from module iswblank: + # Code from module iswblank-tests: + # Code from module langinfo: + # Code from module langinfo-tests: + # Code from module largefile: + + # Code from module libsigsegv: + # Code from module limits-h: + # Code from module limits-h-tests: + # Code from module listen: + # Code from module listen-tests: + # Code from module localcharset: + # Code from module locale: + # Code from module locale-tests: + # Code from module localeconv: + # Code from module localeconv-tests: + # Code from module localtime-buffer: + # Code from module lstat: + # Code from module lstat-tests: + # Code from module maintainer-makefile: + # Code from module malloc-posix: + # Code from module malloca: + # Code from module malloca-tests: + # Code from module manywarnings: + # Code from module mbchar: + # Code from module mbiter: + # Code from module mbrtowc: + # Code from module mbrtowc-tests: + # Code from module mbscasecmp: + # Code from module mbscasecmp-tests: + # Code from module mbsinit: + # Code from module mbsinit-tests: + # Code from module mbslen: + # Code from module mbsrtowcs: + # Code from module mbsrtowcs-tests: + # Code from module mbsstr: + # Code from module mbsstr-tests: + # Code from module mbtowc: + # Code from module mbuiter: + # Code from module memchr: + # Code from module memchr-tests: + # Code from module minmax: + # Code from module mkstemp: + # Code from module mktime: + # Code from module mktime-internal: + # Code from module msvc-inval: + # Code from module msvc-nothrow: + # Code from module multiarch: + # Code from module nanosleep: + # Code from module nanosleep-tests: + # Code from module netinet_in: + # Code from module netinet_in-tests: + # Code from module nl_langinfo: + # Code from module nl_langinfo-tests: + # Code from module nocrash: + # Code from module open: + # Code from module open-tests: + # Code from module pathmax: + # Code from module pathmax-tests: + # Code from module perror: + # Code from module perror-tests: + # Code from module pipe-posix: + # Code from module pipe-posix-tests: + # Code from module progname: + # Code from module propername: + # Code from module putenv: + # Code from module quote: + # Code from module quotearg: + # Code from module quotearg-simple: + # Code from module quotearg-simple-tests: + # Code from module raise: + # Code from module raise-tests: + # Code from module rawmemchr: + # Code from module rawmemchr-tests: + # Code from module readlink: + # Code from module readlink-tests: + # Code from module readme-release: + # Code from module regex: + # Code from module regex-tests: + # Code from module same-inode: + # Code from module secure_getenv: + # Code from module select: + # Code from module select-tests: + # Code from module setenv: + # Code from module setenv-tests: + # Code from module setlocale: + # Code from module setlocale-tests: + # Code from module setsockopt: + # Code from module setsockopt-tests: + # Code from module sh-quote: + # Code from module sh-quote-tests: + # Code from module sigaction: + # Code from module sigaction-tests: + # Code from module signal: + # Code from module signal-h: + # Code from module signal-h-tests: + # Code from module sigprocmask: + # Code from module sigprocmask-tests: + # Code from module size_max: + # Code from module sleep: + # Code from module sleep-tests: + # Code from module snippet/_Noreturn: + # Code from module snippet/arg-nonnull: + # Code from module snippet/c++defs: + # Code from module snippet/unused-parameter: + # Code from module snippet/warn-on-use: + # Code from module snprintf: + # Code from module snprintf-tests: + # Code from module socket: + # Code from module socketlib: + # Code from module sockets: + # Code from module sockets-tests: + # Code from module socklen: + # Code from module ssize_t: + # Code from module stat: + # Code from module stat-macros: + # Code from module stat-tests: + # Code from module stat-time: + # Code from module stat-time-tests: + # Code from module stdalign: + # Code from module stdalign-tests: + # Code from module stdarg: + + + + # Code from module stdbool: + # Code from module stdbool-tests: + # Code from module stddef: + # Code from module stddef-tests: + # Code from module stdint: + # Code from module stdint-tests: + # Code from module stdio: + # Code from module stdio-tests: + # Code from module stdlib: + # Code from module stdlib-tests: + # Code from module strcase: + # Code from module streq: + # Code from module strerror: + # Code from module strerror-override: + # Code from module strerror-tests: + # Code from module strerror_r-posix: + # Code from module strerror_r-posix-tests: + # Code from module strftime: + # Code from module strftime-tests: + # Code from module striconv: + # Code from module striconv-tests: + # Code from module string: + # Code from module string-tests: + # Code from module strings: + # Code from module strings-tests: + # Code from module strndup: + # Code from module strnlen: + # Code from module strnlen-tests: + # Code from module strnlen1: + # Code from module strptime: + # Code from module strtoull: + # Code from module strtoull-tests: + # Code from module strtoumax: + # Code from module strtoumax-tests: + # Code from module symlink: + # Code from module symlink-tests: + # Code from module sys_ioctl: + # Code from module sys_ioctl-tests: + # Code from module sys_select: + # Code from module sys_select-tests: + # Code from module sys_socket: + # Code from module sys_socket-tests: + # Code from module sys_stat: + # Code from module sys_stat-tests: + # Code from module sys_time: + # Code from module sys_time-tests: + # Code from module sys_types: + # Code from module sys_types-tests: + # Code from module sys_uio: + # Code from module sys_uio-tests: + # Code from module sys_wait: + # Code from module sys_wait-tests: + # Code from module system-quote: + # Code from module tempname: + # Code from module test-framework-sh: + # Code from module test-framework-sh-tests: + # Code from module time: + # Code from module time-tests: + # Code from module time_r: + # Code from module time_rz: + # Code from module timegm: + # Code from module timespec: + # Code from module timespec-add: + # Code from module timespec-sub: + # Code from module timespec-tests: + # Code from module trim: + # Code from module tzset: + # Code from module unistd: + # Code from module unistd-tests: + # Code from module unistr/base: + # Code from module unistr/u8-mbtoucr: + # Code from module unistr/u8-mbtoucr-tests: + # Code from module unistr/u8-uctomb: + # Code from module unistr/u8-uctomb-tests: + # Code from module unitypes: + # Code from module uniwidth/base: + # Code from module uniwidth/width: + # Code from module uniwidth/width-tests: + # Code from module unlocked-io: + # Code from module unsetenv: + # Code from module unsetenv-tests: + # Code from module update-copyright: + # Code from module update-copyright-tests: + # Code from module useless-if-before-free: + # Code from module vararrays: + # Code from module vasnprintf: + # Code from module vasnprintf-tests: + # Code from module vasprintf: + # Code from module vasprintf-tests: + # Code from module vc-list-files: + # Code from module vc-list-files-tests: + # Code from module verify: + # Code from module verify-tests: + # Code from module version-etc: + # Code from module version-etc-fsf: + # Code from module version-etc-tests: + # Code from module warnings: + # Code from module wchar: + # Code from module wchar-tests: + # Code from module wcrtomb: + # Code from module wcrtomb-tests: + # Code from module wctob: + # Code from module wctomb: + # Code from module wctype-h: + # Code from module wctype-h-tests: + # Code from module wcwidth: + # Code from module wcwidth-tests: + # Code from module xalloc: + # Code from module xalloc-die: + # Code from module xalloc-die-tests: + # Code from module xalloc-oversized: + # Code from module xfreopen: + # Code from module xreadlink: + # Code from module xsize: + # Code from module xstriconv: + # Code from module xstrndup: + # Code from module xstrtol: + # Code from module xstrtol-tests: + # Code from module xstrtoumax: + # Code from module xstrtoumax-tests: + # Code from module xvasprintf: + # Code from module xvasprintf-tests: + + + + + + + + LIBC_FATAL_STDERR_=1 + export LIBC_FATAL_STDERR_ + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes +then : + +else + +printf "%s\n" "#define size_t unsigned int" >>confdefs.h + +fi + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +printf %s "checking for working alloca.h... " >&6; } +if test ${ac_cv_working_alloca_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <alloca.h> +int +main (void) +{ +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_working_alloca_h=yes +else + ac_cv_working_alloca_h=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +printf "%s\n" "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then + +printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +printf %s "checking for alloca... " >&6; } +if test ${ac_cv_func_alloca_works+y} +then : + printf %s "(cached) " >&6 +else + if test $ac_cv_working_alloca_h = yes; then + ac_cv_func_alloca_works=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#include <stddef.h> +#ifndef alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _MSC_VER +# include <malloc.h> +# define alloca _alloca +# else +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +# endif +#endif + +int +main (void) +{ +char *p = (char *) alloca (1); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_func_alloca_works=yes +else + ac_cv_func_alloca_works=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +printf "%s\n" "$ac_cv_func_alloca_works" >&6; } +fi + +if test $ac_cv_func_alloca_works = yes; then + +printf "%s\n" "#define HAVE_ALLOCA 1" >>confdefs.h + +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + + + + + +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext + +printf "%s\n" "#define C_ALLOCA 1" >>confdefs.h + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 +printf %s "checking whether \`alloca.c' needs Cray hooks... " >&6; } +if test ${ac_cv_os_cray+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined CRAY && ! defined CRAY2 +webecray +#else +wenotbecray +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "webecray" >/dev/null 2>&1 +then : + ac_cv_os_cray=yes +else + ac_cv_os_cray=no +fi +rm -rf conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 +printf "%s\n" "$ac_cv_os_cray" >&6; } +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes" +then : + +printf "%s\n" "#define CRAY_STACKSEG_END $ac_func" >>confdefs.h + + break +fi + + done +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +printf %s "checking stack direction for C alloca... " >&6; } +if test ${ac_cv_c_stack_direction+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + ac_cv_c_stack_direction=0 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction (int *addr, int depth) +{ + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; +} + +int +main (int argc, char **argv) +{ + return find_stack_direction (0, argc + !argv + 20) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_stack_direction=1 +else + ac_cv_c_stack_direction=-1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +printf "%s\n" "$ac_cv_c_stack_direction" >&6; } +printf "%s\n" "#define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h + + +fi + + + GNULIB_BTOWC=0; + GNULIB_WCTOB=0; + GNULIB_MBSINIT=0; + GNULIB_MBRTOWC=0; + GNULIB_MBRLEN=0; + GNULIB_MBSRTOWCS=0; + GNULIB_MBSNRTOWCS=0; + GNULIB_WCRTOMB=0; + GNULIB_WCSRTOMBS=0; + GNULIB_WCSNRTOMBS=0; + GNULIB_WCWIDTH=0; + GNULIB_WMEMCHR=0; + GNULIB_WMEMCMP=0; + GNULIB_WMEMCPY=0; + GNULIB_WMEMMOVE=0; + GNULIB_WMEMSET=0; + GNULIB_WCSLEN=0; + GNULIB_WCSNLEN=0; + GNULIB_WCSCPY=0; + GNULIB_WCPCPY=0; + GNULIB_WCSNCPY=0; + GNULIB_WCPNCPY=0; + GNULIB_WCSCAT=0; + GNULIB_WCSNCAT=0; + GNULIB_WCSCMP=0; + GNULIB_WCSNCMP=0; + GNULIB_WCSCASECMP=0; + GNULIB_WCSNCASECMP=0; + GNULIB_WCSCOLL=0; + GNULIB_WCSXFRM=0; + GNULIB_WCSDUP=0; + GNULIB_WCSCHR=0; + GNULIB_WCSRCHR=0; + GNULIB_WCSCSPN=0; + GNULIB_WCSSPN=0; + GNULIB_WCSPBRK=0; + GNULIB_WCSSTR=0; + GNULIB_WCSTOK=0; + GNULIB_WCSWIDTH=0; + GNULIB_WCSFTIME=0; + HAVE_BTOWC=1; + HAVE_MBSINIT=1; + HAVE_MBRTOWC=1; + HAVE_MBRLEN=1; + HAVE_MBSRTOWCS=1; + HAVE_MBSNRTOWCS=1; + HAVE_WCRTOMB=1; + HAVE_WCSRTOMBS=1; + HAVE_WCSNRTOMBS=1; + HAVE_WMEMCHR=1; + HAVE_WMEMCMP=1; + HAVE_WMEMCPY=1; + HAVE_WMEMMOVE=1; + HAVE_WMEMSET=1; + HAVE_WCSLEN=1; + HAVE_WCSNLEN=1; + HAVE_WCSCPY=1; + HAVE_WCPCPY=1; + HAVE_WCSNCPY=1; + HAVE_WCPNCPY=1; + HAVE_WCSCAT=1; + HAVE_WCSNCAT=1; + HAVE_WCSCMP=1; + HAVE_WCSNCMP=1; + HAVE_WCSCASECMP=1; + HAVE_WCSNCASECMP=1; + HAVE_WCSCOLL=1; + HAVE_WCSXFRM=1; + HAVE_WCSDUP=1; + HAVE_WCSCHR=1; + HAVE_WCSRCHR=1; + HAVE_WCSCSPN=1; + HAVE_WCSSPN=1; + HAVE_WCSPBRK=1; + HAVE_WCSSTR=1; + HAVE_WCSTOK=1; + HAVE_WCSWIDTH=1; + HAVE_WCSFTIME=1; + HAVE_DECL_WCTOB=1; + HAVE_DECL_WCWIDTH=1; + REPLACE_MBSTATE_T=0; + REPLACE_BTOWC=0; + REPLACE_WCTOB=0; + REPLACE_MBSINIT=0; + REPLACE_MBRTOWC=0; + REPLACE_MBRLEN=0; + REPLACE_MBSRTOWCS=0; + REPLACE_MBSNRTOWCS=0; + REPLACE_WCRTOMB=0; + REPLACE_WCSRTOMBS=0; + REPLACE_WCSNRTOMBS=0; + REPLACE_WCWIDTH=0; + REPLACE_WCSWIDTH=0; + REPLACE_WCSFTIME=0; + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5 +printf %s "checking whether <wchar.h> uses 'inline' correctly... " >&6; } +if test ${gl_cv_header_wchar_h_correct_inline+y} +then : + printf %s "(cached) " >&6 +else + gl_cv_header_wchar_h_correct_inline=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +extern int zero (void); +int main () { return zero(); } + +_ACEOF + save_ac_compile="$ac_compile" + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int zero (void) { return 0; } + +_ACEOF + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then + : + else + gl_cv_header_wchar_h_correct_inline=no + fi + fi + fi + ac_compile="$save_ac_compile" + rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5 +printf "%s\n" "$gl_cv_header_wchar_h_correct_inline" >&6; } + if test $gl_cv_header_wchar_h_correct_inline = no; then + as_fn_error $? "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). +This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in +C99 mode. You have four options: + - Add the flag -fgnu89-inline to CC and reconfigure, or + - Fix your include files, using parts of + <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or + - Use a gcc version older than 4.3, or + - Don't use the flags -std=c99 or -std=gnu99. +Configuration aborted." "$LINENO" 5 + fi + +ac_func= +for ac_item in $ac_func_c_list +do + if test $ac_func; then + ac_fn_c_check_func "$LINENO" $ac_func ac_cv_func_$ac_func + if eval test \"x\$ac_cv_func_$ac_func\" = xyes; then + echo "#define $ac_item 1" >> confdefs.h + fi + ac_func= + else + ac_func=$ac_item + fi +done + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 +printf %s "checking for nl_langinfo and CODESET... " >&6; } +if test ${am_cv_langinfo_codeset+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> +int +main (void) +{ +char* cs = nl_langinfo(CODESET); return !cs; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_langinfo_codeset=yes +else + am_cv_langinfo_codeset=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 +printf "%s\n" "$am_cv_langinfo_codeset" >&6; } + if test $am_cv_langinfo_codeset = yes; then + +printf "%s\n" "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h + + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + + + + + + case "$host_os" in + sunos4* | freebsd* | dragonfly* | openbsd* | mirbsd* | netbsd* | kfreebsd* | knetbsd*) # BSD systems + FAULT_YIELDS_SIGBUS=1 ;; + hpux*) # HP-UX + FAULT_YIELDS_SIGBUS=1 ;; + macos* | darwin*) # Mac OS X + FAULT_YIELDS_SIGBUS=1 ;; + gnu*) # Hurd + FAULT_YIELDS_SIGBUS=1 ;; + *) + FAULT_YIELDS_SIGBUS=0 ;; + esac + +printf "%s\n" "#define FAULT_YIELDS_SIGBUS $FAULT_YIELDS_SIGBUS" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working C stack overflow detection" >&5 +printf %s "checking for working C stack overflow detection... " >&6; } +if test ${ac_cv_sys_stack_overflow_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + ac_cv_sys_stack_overflow_works=cross-compiling +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <unistd.h> + #include <signal.h> + #if HAVE_SETRLIMIT + # include <sys/types.h> + # include <sys/time.h> + # include <sys/resource.h> + #endif + #ifndef SIGSTKSZ + # define SIGSTKSZ 16384 + #endif + + static union + { + char buffer[2 * SIGSTKSZ]; + long double ld; + long u; + void *p; + } alternate_signal_stack; + + static void + segv_handler (int signo) + { + _exit (0); + } + + static int + c_stack_action () + { + stack_t st; + struct sigaction act; + int r; + + st.ss_flags = 0; + /* Use the midpoint to avoid Irix sigaltstack bug. */ + st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; + st.ss_size = SIGSTKSZ; + r = sigaltstack (&st, 0); + if (r != 0) + return 1; + + sigemptyset (&act.sa_mask); + act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND; + act.sa_handler = segv_handler; + #if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, 0) < 0) + return 2; + #endif + if (sigaction (SIGSEGV, &act, 0) < 0) + return 3; + return 0; + } + static volatile int * + recurse_1 (volatile int n, volatile int *p) + { + if (n >= 0) + *recurse_1 (n + 1, p) += n; + return p; + } + static int + recurse (volatile int n) + { + int sum = 0; + return *recurse_1 (n, &sum); + } + int + main () + { + int result; + #if HAVE_SETRLIMIT && defined RLIMIT_STACK + /* Before starting the endless recursion, try to be friendly + to the user's machine. On some Linux 2.2.x systems, there + is no stack limit for user processes at all. We don't want + to kill such systems. */ + struct rlimit rl; + rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */ + setrlimit (RLIMIT_STACK, &rl); + #endif + + result = c_stack_action (); + if (result != 0) + return result; + return recurse (0); + } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_sys_stack_overflow_works=yes +else + ac_cv_sys_stack_overflow_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_stack_overflow_works" >&5 +printf "%s\n" "$ac_cv_sys_stack_overflow_works" >&6; } + + if test $ac_cv_sys_stack_overflow_works = yes; then + +printf "%s\n" "#define HAVE_STACK_OVERFLOW_HANDLING 1" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for correct stack_t interpretation" >&5 +printf %s "checking for correct stack_t interpretation... " >&6; } +if test ${gl_cv_sigaltstack_low_base+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + gl_cv_sigaltstack_low_base=cross-compiling +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#include <stdlib.h> +#include <signal.h> +#if HAVE_SYS_SIGNAL_H +# include <sys/signal.h> +#endif +#ifndef SIGSTKSZ +# define SIGSTKSZ 16384 +#endif +volatile char *stack_lower_bound; +volatile char *stack_upper_bound; +static void check_stack_location (volatile char *addr) +{ + if (addr >= stack_lower_bound && addr <= stack_upper_bound) + exit (0); + else + exit (1); +} +static void stackoverflow_handler (int sig) +{ + char dummy; + check_stack_location (&dummy); +} +int main () +{ + char mystack[2 * SIGSTKSZ]; + stack_t altstack; + struct sigaction action; + /* Install the alternate stack. */ + altstack.ss_sp = mystack + SIGSTKSZ; + altstack.ss_size = SIGSTKSZ; + stack_lower_bound = (char *) altstack.ss_sp; + stack_upper_bound = (char *) altstack.ss_sp + altstack.ss_size - 1; + altstack.ss_flags = 0; /* no SS_DISABLE */ + if (sigaltstack (&altstack, NULL) < 0) + exit (2); + /* Install the SIGSEGV handler. */ + sigemptyset (&action.sa_mask); + action.sa_handler = &stackoverflow_handler; + action.sa_flags = SA_ONSTACK; + if (sigaction (SIGSEGV, &action, (struct sigaction *) NULL) < 0) + exit(3); + /* Provoke a SIGSEGV. */ + raise (SIGSEGV); + exit (4); +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_sigaltstack_low_base=yes +else + gl_cv_sigaltstack_low_base=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sigaltstack_low_base" >&5 +printf "%s\n" "$gl_cv_sigaltstack_low_base" >&6; } + if test "$gl_cv_sigaltstack_low_base" = no; then + +printf "%s\n" "#define SIGALTSTACK_SS_REVERSED 1" >>confdefs.h + + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for precise C stack overflow detection" >&5 +printf %s "checking for precise C stack overflow detection... " >&6; } +if test ${ac_cv_sys_xsi_stack_overflow_heuristic+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <unistd.h> + #include <signal.h> + #if HAVE_UCONTEXT_H + # include <ucontext.h> + #endif + #if HAVE_SETRLIMIT + # include <sys/types.h> + # include <sys/time.h> + # include <sys/resource.h> + #endif + #ifndef SIGSTKSZ + # define SIGSTKSZ 16384 + #endif + + static union + { + char buffer[2 * SIGSTKSZ]; + long double ld; + long u; + void *p; + } alternate_signal_stack; + + #if STACK_DIRECTION + # define find_stack_direction(ptr) STACK_DIRECTION + #else + static int + find_stack_direction (char const *addr) + { + char dummy; + return (! addr ? find_stack_direction (&dummy) + : addr < &dummy ? 1 : -1); + } + #endif + + static void + segv_handler (int signo, siginfo_t *info, void *context) + { + if (0 < info->si_code) + { + /* For XSI heuristics to work, we need uc_stack to describe + the interrupted stack (as on Solaris), and not the + currently executing stack (as on Linux). */ + ucontext_t const *user_context = context; + char const *stack_min = user_context->uc_stack.ss_sp; + size_t stack_size = user_context->uc_stack.ss_size; + char const *faulting_address = info->si_addr; + size_t s = faulting_address - stack_min; + size_t page_size = sysconf (_SC_PAGESIZE); + if (find_stack_direction (0) < 0) + s += page_size; + if (s < stack_size + page_size) + _exit (0); + _exit (4); + } + _exit (5); + } + + static int + c_stack_action () + { + stack_t st; + struct sigaction act; + int r; + + st.ss_flags = 0; + /* Use the midpoint to avoid Irix sigaltstack bug. */ + st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; + st.ss_size = SIGSTKSZ; + r = sigaltstack (&st, 0); + if (r != 0) + return 1; + + sigemptyset (&act.sa_mask); + act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO; + act.sa_sigaction = segv_handler; + #if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, 0) < 0) + return 2; + #endif + if (sigaction (SIGSEGV, &act, 0) < 0) + return 3; + return 0; + } + static volatile int * + recurse_1 (volatile int n, volatile int *p) + { + if (n >= 0) + *recurse_1 (n + 1, p) += n; + return p; + } + static int + recurse (volatile int n) + { + int sum = 0; + return *recurse_1 (n, &sum); + } + int + main () + { + int result; + #if HAVE_SETRLIMIT && defined RLIMIT_STACK + /* Before starting the endless recursion, try to be friendly + to the user's machine. On some Linux 2.2.x systems, there + is no stack limit for user processes at all. We don't want + to kill such systems. */ + struct rlimit rl; + rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */ + setrlimit (RLIMIT_STACK, &rl); + #endif + + result = c_stack_action (); + if (result != 0) + return result; + return recurse (0); + } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_sys_xsi_stack_overflow_heuristic=yes +else + ac_cv_sys_xsi_stack_overflow_heuristic=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_xsi_stack_overflow_heuristic" >&5 +printf "%s\n" "$ac_cv_sys_xsi_stack_overflow_heuristic" >&6; } + + if test $ac_cv_sys_xsi_stack_overflow_heuristic = yes; then + +printf "%s\n" "#define HAVE_XSI_STACK_OVERFLOW_HEURISTIC 1" >>confdefs.h + + fi + fi + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + + +# Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld" >&5 +printf %s "checking for ld... " >&6; } +elif test "$GCC" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } +elif test "$with_gnu_ld" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test -n "$LD"; then + # Let the user override the test with a path. + : +else + if test ${acl_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else + + acl_cv_path_LD= # Final result of this test + ac_prog=ld # Program to search in $PATH + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + acl_output=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $acl_output in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` + while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do + acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` + done + # Got the pathname. No search in PATH is needed. + acl_cv_path_LD="$acl_output" + ac_prog= + ;; + "") + # If it fails, then pretend we aren't using GCC. + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac + fi + if test -n "$ac_prog"; then + # Search for $ac_prog in $PATH. + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$acl_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break + ;; + *) + test "$with_gnu_ld" != yes && break + ;; + esac + fi + done + IFS="$acl_save_ifs" + fi + case $host in + *-*-aix*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __powerpc64__ || defined _ARCH_PPC64 + yes + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1 +then : + # The compiler produces 64-bit code. Add option '-b64' so that the + # linker groks 64-bit object files. + case "$acl_cv_path_LD " in + *" -b64 "*) ;; + *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;; + esac + +fi +rm -rf conftest* + + ;; + esac + +fi + + LD="$acl_cv_path_LD" +fi +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${acl_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + acl_cv_prog_gnu_ld=yes + ;; +*) + acl_cv_prog_gnu_ld=no + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5 +printf "%s\n" "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +printf %s "checking for shared library run path origin... " >&6; } +if test ${acl_cv_rpath+y} +then : + printf %s "(cached) " >&6 +else + + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +printf "%s\n" "$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath was given. +if test ${enable_rpath+y} +then : + enableval=$enable_rpath; : +else + enable_rpath=yes +fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5 +printf %s "checking for the common suffixes of directories in the library search path... " >&6; } +if test ${acl_cv_libdirstems+y} +then : + printf %s "(cached) " >&6 +else + acl_libdirstem=lib + acl_libdirstem2= + case "$host_os" in + solaris*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 +printf %s "checking for 64-bit host... " >&6; } +if test ${gl_cv_solaris_64bit+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _LP64 +sixtyfour bits +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "sixtyfour bits" >/dev/null 2>&1 +then : + gl_cv_solaris_64bit=yes +else + gl_cv_solaris_64bit=no +fi +rm -rf conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 +printf "%s\n" "$gl_cv_solaris_64bit" >&6; } + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; + esac + fi + ;; + *) + searchpath=`(if test -f /usr/bin/gcc \ + && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \ + LC_ALL=C /usr/bin/gcc -print-search-dirs; \ + else \ + LC_ALL=C $CC -print-search-dirs; \ + fi) 2>/dev/null \ + | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_libdirstems" >&5 +printf "%s\n" "$acl_cv_libdirstems" >&6; } + # Decompose acl_cv_libdirstems into acl_libdirstem and acl_libdirstem2. + acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` + acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e '/,/s/.*,//'` + + + + + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libsigsegv-prefix was given. +if test ${with_libsigsegv_prefix+y} +then : + withval=$with_libsigsegv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBSIGSEGV= + LTLIBSIGSEGV= + INCSIGSEGV= + LIBSIGSEGV_PREFIX= + HAVE_LIBSIGSEGV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='sigsegv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_a" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCSIGSEGV="${INCSIGSEGV}${INCSIGSEGV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$dep" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$dep" + ;; + esac + done + fi + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-R$found_dir" + done + fi + + + + + + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCSIGSEGV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsigsegv" >&5 +printf %s "checking for libsigsegv... " >&6; } +if test ${ac_cv_libsigsegv+y} +then : + printf %s "(cached) " >&6 +else + + ac_save_LIBS="$LIBS" + case " $LIBSIGSEGV" in + *" -l"*) LIBS="$LIBS $LIBSIGSEGV" ;; + *) LIBS="$LIBSIGSEGV $LIBS" ;; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sigsegv.h> +int +main (void) +{ +sigsegv_deinstall_handler(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libsigsegv=yes +else + ac_cv_libsigsegv='no, consider installing GNU libsigsegv' +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libsigsegv" >&5 +printf "%s\n" "$ac_cv_libsigsegv" >&6; } + if test "$ac_cv_libsigsegv" = yes; then + HAVE_LIBSIGSEGV=yes + +printf "%s\n" "#define HAVE_LIBSIGSEGV 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libsigsegv" >&5 +printf %s "checking how to link with libsigsegv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBSIGSEGV" >&5 +printf "%s\n" "$LIBSIGSEGV" >&6; } + else + HAVE_LIBSIGSEGV=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBSIGSEGV= + LTLIBSIGSEGV= + LIBSIGSEGV_PREFIX= + fi + + + + + + + + gl_cv_lib_sigsegv="$ac_cv_libsigsegv" + + +# The Clang compiler raises a warning for an undeclared identifier that matches +# a compiler builtin function. All extant Clang versions are affected, as of +# Clang 3.6.0. Test a builtin known to every version. This problem affects the +# C and Objective C languages, but Clang does report an error under C++ and +# Objective C++. +# +# Passing -fno-builtin to the compiler would suppress this problem. That +# strategy would have the advantage of being insensitive to stray warnings, but +# it would make tests less realistic. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how $CC reports undeclared, standard C functions" >&5 +printf %s "checking how $CC reports undeclared, standard C functions... " >&6; } +if test ${ac_cv_c_decl_report+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test -s conftest.err +then : + # For AC_CHECK_DECL to react to warnings, the compiler must be silent on + # valid AC_CHECK_DECL input. No library function is consistently available + # on freestanding implementations, so test against a dummy declaration. + # Include always-available headers on the off chance that they somehow + # elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <float.h> +#include <limits.h> +#include <stdarg.h> +#include <stddef.h> +extern void ac_decl (int, char *); +int +main (void) +{ +#ifdef __cplusplus + (void) ac_decl ((int) 0, (char *) 0); + (void) ac_decl; +#else + (void) ac_decl; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test -s conftest.err +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot detect from compiler exit status or warnings +See \`config.log' for more details" "$LINENO" 5; } +else + ac_cv_c_decl_report=warning +fi +else + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compile a simple declaration test +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "compiler does not report undeclared identifiers +See \`config.log' for more details" "$LINENO" 5; } +fi +else + ac_cv_c_decl_report=error +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_decl_report" >&5 +printf "%s\n" "$ac_cv_c_decl_report" >&6; } + +case $ac_cv_c_decl_report in + warning) ac_c_decl_warn_flag=yes ;; + *) ac_c_decl_warn_flag= ;; +esac + + + + GNULIB_CHDIR=0; + GNULIB_CHOWN=0; + GNULIB_CLOSE=0; + GNULIB_DUP=0; + GNULIB_DUP2=0; + GNULIB_DUP3=0; + GNULIB_ENVIRON=0; + GNULIB_EUIDACCESS=0; + GNULIB_FACCESSAT=0; + GNULIB_FCHDIR=0; + GNULIB_FCHOWNAT=0; + GNULIB_FDATASYNC=0; + GNULIB_FSYNC=0; + GNULIB_FTRUNCATE=0; + GNULIB_GETCWD=0; + GNULIB_GETDOMAINNAME=0; + GNULIB_GETDTABLESIZE=0; + GNULIB_GETGROUPS=0; + GNULIB_GETHOSTNAME=0; + GNULIB_GETLOGIN=0; + GNULIB_GETLOGIN_R=0; + GNULIB_GETPAGESIZE=0; + GNULIB_GETUSERSHELL=0; + GNULIB_GROUP_MEMBER=0; + GNULIB_ISATTY=0; + GNULIB_LCHOWN=0; + GNULIB_LINK=0; + GNULIB_LINKAT=0; + GNULIB_LSEEK=0; + GNULIB_PIPE=0; + GNULIB_PIPE2=0; + GNULIB_PREAD=0; + GNULIB_PWRITE=0; + GNULIB_READ=0; + GNULIB_READLINK=0; + GNULIB_READLINKAT=0; + GNULIB_RMDIR=0; + GNULIB_SETHOSTNAME=0; + GNULIB_SLEEP=0; + GNULIB_SYMLINK=0; + GNULIB_SYMLINKAT=0; + GNULIB_TRUNCATE=0; + GNULIB_TTYNAME_R=0; + GNULIB_UNISTD_H_NONBLOCKING=0; + GNULIB_UNISTD_H_SIGPIPE=0; + GNULIB_UNLINK=0; + GNULIB_UNLINKAT=0; + GNULIB_USLEEP=0; + GNULIB_WRITE=0; + HAVE_CHOWN=1; + HAVE_DUP2=1; + HAVE_DUP3=1; + HAVE_EUIDACCESS=1; + HAVE_FACCESSAT=1; + HAVE_FCHDIR=1; + HAVE_FCHOWNAT=1; + HAVE_FDATASYNC=1; + HAVE_FSYNC=1; + HAVE_FTRUNCATE=1; + HAVE_GETDTABLESIZE=1; + HAVE_GETGROUPS=1; + HAVE_GETHOSTNAME=1; + HAVE_GETLOGIN=1; + HAVE_GETPAGESIZE=1; + HAVE_GROUP_MEMBER=1; + HAVE_LCHOWN=1; + HAVE_LINK=1; + HAVE_LINKAT=1; + HAVE_PIPE=1; + HAVE_PIPE2=1; + HAVE_PREAD=1; + HAVE_PWRITE=1; + HAVE_READLINK=1; + HAVE_READLINKAT=1; + HAVE_SETHOSTNAME=1; + HAVE_SLEEP=1; + HAVE_SYMLINK=1; + HAVE_SYMLINKAT=1; + HAVE_TRUNCATE=1; + HAVE_UNLINKAT=1; + HAVE_USLEEP=1; + HAVE_DECL_ENVIRON=1; + HAVE_DECL_FCHDIR=1; + HAVE_DECL_FDATASYNC=1; + HAVE_DECL_GETDOMAINNAME=1; + HAVE_DECL_GETLOGIN=1; + HAVE_DECL_GETLOGIN_R=1; + HAVE_DECL_GETPAGESIZE=1; + HAVE_DECL_GETUSERSHELL=1; + HAVE_DECL_SETHOSTNAME=1; + HAVE_DECL_TTYNAME_R=1; + HAVE_OS_H=0; + HAVE_SYS_PARAM_H=0; + REPLACE_CHOWN=0; + REPLACE_CLOSE=0; + REPLACE_DUP=0; + REPLACE_DUP2=0; + REPLACE_FCHOWNAT=0; + REPLACE_FTRUNCATE=0; + REPLACE_GETCWD=0; + REPLACE_GETDOMAINNAME=0; + REPLACE_GETDTABLESIZE=0; + REPLACE_GETLOGIN_R=0; + REPLACE_GETGROUPS=0; + REPLACE_GETPAGESIZE=0; + REPLACE_ISATTY=0; + REPLACE_LCHOWN=0; + REPLACE_LINK=0; + REPLACE_LINKAT=0; + REPLACE_LSEEK=0; + REPLACE_PREAD=0; + REPLACE_PWRITE=0; + REPLACE_READ=0; + REPLACE_READLINK=0; + REPLACE_READLINKAT=0; + REPLACE_RMDIR=0; + REPLACE_SLEEP=0; + REPLACE_SYMLINK=0; + REPLACE_SYMLINKAT=0; + REPLACE_TRUNCATE=0; + REPLACE_TTYNAME_R=0; + REPLACE_UNLINK=0; + REPLACE_UNLINKAT=0; + REPLACE_USLEEP=0; + REPLACE_WRITE=0; + UNISTD_H_HAVE_WINSOCK2_H=0; + UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; + + + + + + if test $ac_cv_func__set_invalid_parameter_handler = yes; then + HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 + +printf "%s\n" "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h + + else + HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 + fi + + + + GNULIB_IOCTL=0; + SYS_IOCTL_H_HAVE_WINSOCK2_H=0; + SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; + + REPLACE_IOCTL=0; + + + + GNULIB_ISBLANK=0; + HAVE_ISBLANK=1; + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5 +printf %s "checking whether the preprocessor supports include_next... " >&6; } +if test ${gl_cv_have_include_next+y} +then : + printf %s "(cached) " >&6 +else + rm -rf conftestd1a conftestd1b conftestd2 + mkdir conftestd1a conftestd1b conftestd2 + cat <<EOF > conftestd1a/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include_next <conftest.h> +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat <<EOF > conftestd1b/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include <stdio.h> +#include_next <conftest.h> +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat <<EOF > conftestd2/conftest.h +#ifndef DEFINED_IN_CONFTESTD1 +#error "include_next test doesn't work" +#endif +#define DEFINED_IN_CONFTESTD2 +EOF + gl_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <conftest.h> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_have_include_next=yes +else + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <conftest.h> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_have_include_next=buggy +else + gl_cv_have_include_next=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$gl_save_CPPFLAGS" + rm -rf conftestd1a conftestd1b conftestd2 + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5 +printf "%s\n" "$gl_cv_have_include_next" >&6; } + PRAGMA_SYSTEM_HEADER= + if test $gl_cv_have_include_next = yes; then + INCLUDE_NEXT=include_next + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + if test -n "$GCC"; then + PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' + fi + else + if test $gl_cv_have_include_next = buggy; then + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + else + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include + fi + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5 +printf %s "checking whether system header files limit the line length... " >&6; } +if test ${gl_cv_pragma_columns+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __TANDEM +choke me +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "choke me" >/dev/null 2>&1 +then : + gl_cv_pragma_columns=yes +else + gl_cv_pragma_columns=no +fi +rm -rf conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5 +printf "%s\n" "$gl_cv_pragma_columns" >&6; } + if test $gl_cv_pragma_columns = yes; then + PRAGMA_COLUMNS="#pragma COLUMNS 10000" + else + PRAGMA_COLUMNS= + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 +printf %s "checking whether // is distinct from /... " >&6; } +if test ${gl_cv_double_slash_root+y} +then : + printf %s "(cached) " >&6 +else + if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # <bug-gnulib@gnu.org>. + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + gl_cv_double_slash_root='unknown, assuming no' ;; + esac + else + set x `ls -di / // 2>/dev/null` + if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 +printf "%s\n" "$gl_cv_double_slash_root" >&6; } + if test "$gl_cv_double_slash_root" = yes; then + +printf "%s\n" "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h + + fi + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5 +printf %s "checking if environ is properly declared... " >&6; } + if test ${gt_cv_var_environ_declaration+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_UNISTD_H + #include <unistd.h> + #endif + /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */ + #include <stdlib.h> + + extern struct { int foo; } environ; +int +main (void) +{ +environ.foo = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_var_environ_declaration=no +else + gt_cv_var_environ_declaration=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5 +printf "%s\n" "$gt_cv_var_environ_declaration" >&6; } + if test $gt_cv_var_environ_declaration = yes; then + +printf "%s\n" "#define HAVE_ENVIRON_DECL 1" >>confdefs.h + + fi + + + if test $gt_cv_var_environ_declaration != yes; then + HAVE_DECL_ENVIRON=0 + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5 +printf %s "checking for complete errno.h... " >&6; } +if test ${gl_cv_header_errno_h_complete+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <errno.h> +#if !defined ETXTBSY +booboo +#endif +#if !defined ENOMSG +booboo +#endif +#if !defined EIDRM +booboo +#endif +#if !defined ENOLINK +booboo +#endif +#if !defined EPROTO +booboo +#endif +#if !defined EMULTIHOP +booboo +#endif +#if !defined EBADMSG +booboo +#endif +#if !defined EOVERFLOW +booboo +#endif +#if !defined ENOTSUP +booboo +#endif +#if !defined ENETRESET +booboo +#endif +#if !defined ECONNABORTED +booboo +#endif +#if !defined ESTALE +booboo +#endif +#if !defined EDQUOT +booboo +#endif +#if !defined ECANCELED +booboo +#endif +#if !defined EOWNERDEAD +booboo +#endif +#if !defined ENOTRECOVERABLE +booboo +#endif +#if !defined EILSEQ +booboo +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "booboo" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_complete=no +else + gl_cv_header_errno_h_complete=yes +fi +rm -rf conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5 +printf "%s\n" "$gl_cv_header_errno_h_complete" >&6; } + if test $gl_cv_header_errno_h_complete = yes; then + ERRNO_H='' + else + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_errno_h='<'errno.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5 +printf %s "checking absolute name of <errno.h>... " >&6; } +if test ${gl_cv_next_errno_h+y} +then : + printf %s "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <errno.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'errno.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_errno_h + gl_cv_next_errno_h='"'$gl_header'"' + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5 +printf "%s\n" "$gl_cv_next_errno_h" >&6; } + fi + NEXT_ERRNO_H=$gl_cv_next_errno_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'errno.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_errno_h + fi + NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive + + + + + ERRNO_H='errno.h' + fi + + if test -n "$ERRNO_H"; then + GL_GENERATE_ERRNO_H_TRUE= + GL_GENERATE_ERRNO_H_FALSE='#' +else + GL_GENERATE_ERRNO_H_TRUE='#' + GL_GENERATE_ERRNO_H_FALSE= +fi + + + if test -n "$ERRNO_H"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5 +printf %s "checking for EMULTIHOP value... " >&6; } +if test ${gl_cv_header_errno_h_EMULTIHOP+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <errno.h> +#ifdef EMULTIHOP +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EMULTIHOP=yes +else + gl_cv_header_errno_h_EMULTIHOP=no +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EMULTIHOP = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +#ifdef EMULTIHOP +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EMULTIHOP=hidden +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then + if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include <stdio.h> +#include <stdlib.h> +" +then : + +fi + + fi + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5 +printf "%s\n" "$gl_cv_header_errno_h_EMULTIHOP" >&6; } + case $gl_cv_header_errno_h_EMULTIHOP in + yes | no) + EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE= + ;; + *) + EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP" + ;; + esac + + + fi + + + if test -n "$ERRNO_H"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5 +printf %s "checking for ENOLINK value... " >&6; } +if test ${gl_cv_header_errno_h_ENOLINK+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <errno.h> +#ifdef ENOLINK +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_ENOLINK=yes +else + gl_cv_header_errno_h_ENOLINK=no +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_ENOLINK = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +#ifdef ENOLINK +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_ENOLINK=hidden +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_ENOLINK = hidden; then + if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include <stdio.h> +#include <stdlib.h> +" +then : + +fi + + fi + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5 +printf "%s\n" "$gl_cv_header_errno_h_ENOLINK" >&6; } + case $gl_cv_header_errno_h_ENOLINK in + yes | no) + ENOLINK_HIDDEN=0; ENOLINK_VALUE= + ;; + *) + ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK" + ;; + esac + + + fi + + + if test -n "$ERRNO_H"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5 +printf %s "checking for EOVERFLOW value... " >&6; } +if test ${gl_cv_header_errno_h_EOVERFLOW+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <errno.h> +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EOVERFLOW=yes +else + gl_cv_header_errno_h_EOVERFLOW=no +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EOVERFLOW = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1 +then : + gl_cv_header_errno_h_EOVERFLOW=hidden +fi +rm -rf conftest* + + if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then + if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include <stdio.h> +#include <stdlib.h> +" +then : + +fi + + fi + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5 +printf "%s\n" "$gl_cv_header_errno_h_EOVERFLOW" >&6; } + case $gl_cv_header_errno_h_EOVERFLOW in + yes | no) + EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE= + ;; + *) + EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW" + ;; + esac + + + fi + + +ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" +if test "x$ac_cv_have_decl_strerror_r" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_STRERROR_R $ac_have_decl" >>confdefs.h + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 +printf %s "checking whether strerror_r returns char *... " >&6; } +if test ${ac_cv_func_strerror_r_char_p+y} +then : + printf %s "(cached) " >&6 +else + + ac_cv_func_strerror_r_char_p=no + if test $ac_cv_have_decl_strerror_r = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + char *p = strerror_r (0, buf, sizeof buf); + return !p || x; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_func_strerror_r_char_p=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + else + # strerror_r is not declared. Choose between + # systems that have relatively inaccessible declarations for the + # function. BeOS and DEC UNIX 4.0 fall in this category, but the + # former has a strerror_r that returns char*, while the latter + # has a strerror_r that returns `int'. + # This test should segfault on the DEC system. + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + extern char *strerror_r (); +int +main (void) +{ +char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + return ! isalpha (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_strerror_r_char_p=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 +printf "%s\n" "$ac_cv_func_strerror_r_char_p" >&6; } +if test $ac_cv_func_strerror_r_char_p = yes; then + +printf "%s\n" "#define STRERROR_R_CHAR_P 1" >>confdefs.h + +fi + + + XGETTEXT_EXTRA_OPTIONS= + + + + + + GNULIB_FCNTL=0; + GNULIB_NONBLOCKING=0; + GNULIB_OPEN=0; + GNULIB_OPENAT=0; + HAVE_FCNTL=1; + HAVE_OPENAT=1; + REPLACE_FCNTL=0; + REPLACE_OPEN=0; + REPLACE_OPENAT=0; + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5 +printf %s "checking for working fcntl.h... " >&6; } +if test ${gl_cv_header_working_fcntl_h+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + gl_cv_header_working_fcntl_h=cross-compiling +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/stat.h> + #if HAVE_UNISTD_H + # include <unistd.h> + #else /* on Windows with MSVC */ + # include <io.h> + # include <stdlib.h> + # defined sleep(n) _sleep ((n) * 1000) + #endif + #include <fcntl.h> + #ifndef O_NOATIME + #define O_NOATIME 0 + #endif + #ifndef O_NOFOLLOW + #define O_NOFOLLOW 0 + #endif + static int const constants[] = + { + O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, + O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY + }; + +int +main (void) +{ + + int result = !constants; + #if HAVE_SYMLINK + { + static char const sym[] = "conftest.sym"; + if (symlink ("/dev/null", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + if (unlink (sym) != 0 || symlink (".", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_RDONLY | O_NOFOLLOW); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + unlink (sym); + } + #endif + { + static char const file[] = "confdefs.h"; + int fd = open (file, O_RDONLY | O_NOATIME); + if (fd < 0) + result |= 8; + else + { + struct stat st0; + if (fstat (fd, &st0) != 0) + result |= 16; + else + { + char c; + sleep (1); + if (read (fd, &c, 1) != 1) + result |= 24; + else + { + if (close (fd) != 0) + result |= 32; + else + { + struct stat st1; + if (stat (file, &st1) != 0) + result |= 40; + else + if (st0.st_atime != st1.st_atime) + result |= 64; + } + } + } + } + } + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_header_working_fcntl_h=yes +else + case $? in #( + 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( + 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( + 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( + *) gl_cv_header_working_fcntl_h='no';; + esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5 +printf "%s\n" "$gl_cv_header_working_fcntl_h" >&6; } + + case $gl_cv_header_working_fcntl_h in #( + *O_NOATIME* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + +printf "%s\n" "#define HAVE_WORKING_O_NOATIME $ac_val" >>confdefs.h + + + case $gl_cv_header_working_fcntl_h in #( + *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + +printf "%s\n" "#define HAVE_WORKING_O_NOFOLLOW $ac_val" >>confdefs.h + + +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = xyes +then : + +else + +printf "%s\n" "#define pid_t int" >>confdefs.h + +fi + +ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = xyes +then : + +else + +printf "%s\n" "#define mode_t int" >>confdefs.h + +fi + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 +printf %s "checking for mbstate_t... " >&6; } +if test ${ac_cv_type_mbstate_t+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int +main (void) +{ +mbstate_t x; return sizeof x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_type_mbstate_t=yes +else + ac_cv_type_mbstate_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5 +printf "%s\n" "$ac_cv_type_mbstate_t" >&6; } + if test $ac_cv_type_mbstate_t = yes; then + +printf "%s\n" "#define HAVE_MBSTATE_T 1" >>confdefs.h + + else + +printf "%s\n" "#define mbstate_t int" >>confdefs.h + + fi + + + + + + + + + + GNULIB_DPRINTF=0; + GNULIB_FCLOSE=0; + GNULIB_FDOPEN=0; + GNULIB_FFLUSH=0; + GNULIB_FGETC=0; + GNULIB_FGETS=0; + GNULIB_FOPEN=0; + GNULIB_FPRINTF=0; + GNULIB_FPRINTF_POSIX=0; + GNULIB_FPURGE=0; + GNULIB_FPUTC=0; + GNULIB_FPUTS=0; + GNULIB_FREAD=0; + GNULIB_FREOPEN=0; + GNULIB_FSCANF=0; + GNULIB_FSEEK=0; + GNULIB_FSEEKO=0; + GNULIB_FTELL=0; + GNULIB_FTELLO=0; + GNULIB_FWRITE=0; + GNULIB_GETC=0; + GNULIB_GETCHAR=0; + GNULIB_GETDELIM=0; + GNULIB_GETLINE=0; + GNULIB_OBSTACK_PRINTF=0; + GNULIB_OBSTACK_PRINTF_POSIX=0; + GNULIB_PCLOSE=0; + GNULIB_PERROR=0; + GNULIB_POPEN=0; + GNULIB_PRINTF=0; + GNULIB_PRINTF_POSIX=0; + GNULIB_PUTC=0; + GNULIB_PUTCHAR=0; + GNULIB_PUTS=0; + GNULIB_REMOVE=0; + GNULIB_RENAME=0; + GNULIB_RENAMEAT=0; + GNULIB_SCANF=0; + GNULIB_SNPRINTF=0; + GNULIB_SPRINTF_POSIX=0; + GNULIB_STDIO_H_NONBLOCKING=0; + GNULIB_STDIO_H_SIGPIPE=0; + GNULIB_TMPFILE=0; + GNULIB_VASPRINTF=0; + GNULIB_VFSCANF=0; + GNULIB_VSCANF=0; + GNULIB_VDPRINTF=0; + GNULIB_VFPRINTF=0; + GNULIB_VFPRINTF_POSIX=0; + GNULIB_VPRINTF=0; + GNULIB_VPRINTF_POSIX=0; + GNULIB_VSNPRINTF=0; + GNULIB_VSPRINTF_POSIX=0; + HAVE_DECL_FPURGE=1; + HAVE_DECL_FSEEKO=1; + HAVE_DECL_FTELLO=1; + HAVE_DECL_GETDELIM=1; + HAVE_DECL_GETLINE=1; + HAVE_DECL_OBSTACK_PRINTF=1; + HAVE_DECL_SNPRINTF=1; + HAVE_DECL_VSNPRINTF=1; + HAVE_DPRINTF=1; + HAVE_FSEEKO=1; + HAVE_FTELLO=1; + HAVE_PCLOSE=1; + HAVE_POPEN=1; + HAVE_RENAMEAT=1; + HAVE_VASPRINTF=1; + HAVE_VDPRINTF=1; + REPLACE_DPRINTF=0; + REPLACE_FCLOSE=0; + REPLACE_FDOPEN=0; + REPLACE_FFLUSH=0; + REPLACE_FOPEN=0; + REPLACE_FPRINTF=0; + REPLACE_FPURGE=0; + REPLACE_FREOPEN=0; + REPLACE_FSEEK=0; + REPLACE_FSEEKO=0; + REPLACE_FTELL=0; + REPLACE_FTELLO=0; + REPLACE_GETDELIM=0; + REPLACE_GETLINE=0; + REPLACE_OBSTACK_PRINTF=0; + REPLACE_PERROR=0; + REPLACE_POPEN=0; + REPLACE_PRINTF=0; + REPLACE_REMOVE=0; + REPLACE_RENAME=0; + REPLACE_RENAMEAT=0; + REPLACE_SNPRINTF=0; + REPLACE_SPRINTF=0; + REPLACE_STDIO_READ_FUNCS=0; + REPLACE_STDIO_WRITE_FUNCS=0; + REPLACE_TMPFILE=0; + REPLACE_VASPRINTF=0; + REPLACE_VDPRINTF=0; + REPLACE_VFPRINTF=0; + REPLACE_VPRINTF=0; + REPLACE_VSNPRINTF=0; + REPLACE_VSPRINTF=0; + + + GNULIB_FCHMODAT=0; + GNULIB_FSTAT=0; + GNULIB_FSTATAT=0; + GNULIB_FUTIMENS=0; + GNULIB_LCHMOD=0; + GNULIB_LSTAT=0; + GNULIB_MKDIRAT=0; + GNULIB_MKFIFO=0; + GNULIB_MKFIFOAT=0; + GNULIB_MKNOD=0; + GNULIB_MKNODAT=0; + GNULIB_STAT=0; + GNULIB_UTIMENSAT=0; + GNULIB_OVERRIDES_STRUCT_STAT=0; + HAVE_FCHMODAT=1; + HAVE_FSTATAT=1; + HAVE_FUTIMENS=1; + HAVE_LCHMOD=1; + HAVE_LSTAT=1; + HAVE_MKDIRAT=1; + HAVE_MKFIFO=1; + HAVE_MKFIFOAT=1; + HAVE_MKNOD=1; + HAVE_MKNODAT=1; + HAVE_UTIMENSAT=1; + REPLACE_FSTAT=0; + REPLACE_FSTATAT=0; + REPLACE_FUTIMENS=0; + REPLACE_LSTAT=0; + REPLACE_MKDIR=0; + REPLACE_MKFIFO=0; + REPLACE_MKNOD=0; + REPLACE_STAT=0; + REPLACE_UTIMENSAT=0; + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5 +printf %s "checking whether stat file-mode macros are broken... " >&6; } +if test ${ac_cv_header_stat_broken+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <sys/stat.h> + +#if defined S_ISBLK && defined S_IFDIR +extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; +#endif + +#if defined S_ISBLK && defined S_IFCHR +extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; +#endif + +#if defined S_ISLNK && defined S_IFREG +extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; +#endif + +#if defined S_ISSOCK && defined S_IFREG +extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_header_stat_broken=no +else + ac_cv_header_stat_broken=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 +printf "%s\n" "$ac_cv_header_stat_broken" >&6; } +if test $ac_cv_header_stat_broken = yes; then + +printf "%s\n" "#define STAT_MACROS_BROKEN 1" >>confdefs.h + +fi + + + + case "$host_os" in + mingw*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5 +printf %s "checking for 64-bit off_t... " >&6; } +if test ${gl_cv_type_off_t_64+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_off_t_64=yes +else + gl_cv_type_off_t_64=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5 +printf "%s\n" "$gl_cv_type_off_t_64" >&6; } + if test $gl_cv_type_off_t_64 = no; then + WINDOWS_64_BIT_OFF_T=1 + else + WINDOWS_64_BIT_OFF_T=0 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5 +printf %s "checking for 64-bit st_size... " >&6; } +if test ${gl_cv_member_st_size_64+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + struct stat buf; + int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_member_st_size_64=yes +else + gl_cv_member_st_size_64=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5 +printf "%s\n" "$gl_cv_member_st_size_64" >&6; } + if test $gl_cv_member_st_size_64 = no; then + WINDOWS_64_BIT_ST_SIZE=1 + else + WINDOWS_64_BIT_ST_SIZE=0 + fi + ;; + *) + WINDOWS_64_BIT_OFF_T=0 + WINDOWS_64_BIT_ST_SIZE=0 + ;; + esac + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5 +printf %s "checking absolute name of <sys/stat.h>... " >&6; } +if test ${gl_cv_next_sys_stat_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_sys_stat_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/stat.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_stat_h + gl_cv_next_sys_stat_h='"'$gl_header'"' + else + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 +printf "%s\n" "$gl_cv_next_sys_stat_h" >&6; } + fi + NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/stat.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_stat_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive + + + + + + + + + WINDOWS_STAT_TIMESPEC=0 + + + + + + + + + ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_type_nlink_t" = xyes +then : + +else + +printf "%s\n" "#define nlink_t int" >>confdefs.h + +fi + + + + for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + +ac_fn_c_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default" +if test "x$ac_cv_have_decl_getdtablesize" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_GETDTABLESIZE $ac_have_decl" >>confdefs.h + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_getopt_h='<'getopt.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <getopt.h>" >&5 +printf %s "checking absolute name of <getopt.h>... " >&6; } +if test ${gl_cv_next_getopt_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_getopt_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <getopt.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'getopt.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_getopt_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_getopt_h + gl_cv_next_getopt_h='"'$gl_header'"' + else + gl_cv_next_getopt_h='<'getopt.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_getopt_h" >&5 +printf "%s\n" "$gl_cv_next_getopt_h" >&6; } + fi + NEXT_GETOPT_H=$gl_cv_next_getopt_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'getopt.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_getopt_h + fi + NEXT_AS_FIRST_DIRECTIVE_GETOPT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_getopt_h = yes; then + HAVE_GETOPT_H=1 + else + HAVE_GETOPT_H=0 + fi + + + gl_replace_getopt= + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + for ac_header in getopt.h +do : + ac_fn_c_check_header_compile "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" +if test "x$ac_cv_header_getopt_h" = xyes +then : + printf "%s\n" "#define HAVE_GETOPT_H 1" >>confdefs.h + +else + gl_replace_getopt=yes +fi + +done + fi + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + for ac_func in getopt_long_only +do : + ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only" +if test "x$ac_cv_func_getopt_long_only" = xyes +then : + printf "%s\n" "#define HAVE_GETOPT_LONG_ONLY 1" >>confdefs.h + +else + gl_replace_getopt=yes +fi + +done + fi + + if test -z "$gl_replace_getopt"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getopt is POSIX compatible" >&5 +printf %s "checking whether getopt is POSIX compatible... " >&6; } +if test ${gl_cv_func_getopt_posix+y} +then : + printf %s "(cached) " >&6 +else + + if test $cross_compiling = no; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <unistd.h> +#include <stdlib.h> +#include <string.h> + +int +main () +{ + static char program[] = "program"; + static char a[] = "-a"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, a, foo, bar, NULL }; + int c; + + c = getopt (4, argv, "ab"); + if (!(c == 'a')) + return 1; + c = getopt (4, argv, "ab"); + if (!(c == -1)) + return 2; + if (!(optind == 2)) + return 3; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_posix=maybe +else + gl_cv_func_getopt_posix=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + if test $gl_cv_func_getopt_posix = maybe; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <unistd.h> +#include <stdlib.h> +#include <string.h> + +int +main () +{ + static char program[] = "program"; + static char donald[] = "donald"; + static char p[] = "-p"; + static char billy[] = "billy"; + static char duck[] = "duck"; + static char a[] = "-a"; + static char bar[] = "bar"; + char *argv[] = { program, donald, p, billy, duck, a, bar, NULL }; + int c; + + c = getopt (7, argv, "+abp:q:"); + if (!(c == -1)) + return 4; + if (!(strcmp (argv[0], "program") == 0)) + return 5; + if (!(strcmp (argv[1], "donald") == 0)) + return 6; + if (!(strcmp (argv[2], "-p") == 0)) + return 7; + if (!(strcmp (argv[3], "billy") == 0)) + return 8; + if (!(strcmp (argv[4], "duck") == 0)) + return 9; + if (!(strcmp (argv[5], "-a") == 0)) + return 10; + if (!(strcmp (argv[6], "bar") == 0)) + return 11; + if (!(optind == 1)) + return 12; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_posix=maybe +else + gl_cv_func_getopt_posix=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + if test $gl_cv_func_getopt_posix = maybe; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <unistd.h> +#include <stdlib.h> +#include <string.h> + +int +main () +{ + static char program[] = "program"; + static char ab[] = "-ab"; + char *argv[3] = { program, ab, NULL }; + if (getopt (2, argv, "ab:") != 'a') + return 13; + if (getopt (2, argv, "ab:") != '?') + return 14; + if (optopt != 'b') + return 15; + if (optind != 2) + return 16; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_posix=yes +else + gl_cv_func_getopt_posix=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + else + case "$host_os" in + darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";; + *) gl_cv_func_getopt_posix="guessing yes";; + esac + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_posix" >&5 +printf "%s\n" "$gl_cv_func_getopt_posix" >&6; } + case "$gl_cv_func_getopt_posix" in + *no) gl_replace_getopt=yes ;; + esac + fi + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5 +printf %s "checking for working GNU getopt function... " >&6; } +if test ${gl_cv_func_getopt_gnu+y} +then : + printf %s "(cached) " >&6 +else + # Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the + # optstring is necessary for programs like m4 that have POSIX-mandated + # semantics for supporting options interspersed with files. + # Also, since getopt_long is a GNU extension, we require optind=0. + # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT; + # so take care to revert to the correct (non-)export state. + gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }' + case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in + xx) gl_had_POSIXLY_CORRECT=exported ;; + x) gl_had_POSIXLY_CORRECT=yes ;; + *) gl_had_POSIXLY_CORRECT= ;; + esac + POSIXLY_CORRECT=1 + export POSIXLY_CORRECT + if test "$cross_compiling" = yes +then : + gl_cv_func_getopt_gnu="guessing no" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <getopt.h> + #include <stddef.h> + #include <string.h> + +#include <stdlib.h> +#if defined __MACH__ && defined __APPLE__ +/* Avoid a crash on Mac OS X. */ +#include <mach/mach.h> +#include <mach/mach_error.h> +#include <mach/thread_status.h> +#include <mach/exception.h> +#include <mach/task.h> +#include <pthread.h> +/* The exception port on which our thread listens. */ +static mach_port_t our_exception_port; +/* The main function of the thread listening for exceptions of type + EXC_BAD_ACCESS. */ +static void * +mach_exception_thread (void *arg) +{ + /* Buffer for a message to be received. */ + struct { + mach_msg_header_t head; + mach_msg_body_t msgh_body; + char data[1024]; + } msg; + mach_msg_return_t retval; + /* Wait for a message on the exception port. */ + retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), + our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + if (retval != MACH_MSG_SUCCESS) + abort (); + exit (1); +} +static void +nocrash_init (void) +{ + mach_port_t self = mach_task_self (); + /* Allocate a port on which the thread shall listen for exceptions. */ + if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) + == KERN_SUCCESS) { + /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ + if (mach_port_insert_right (self, our_exception_port, our_exception_port, + MACH_MSG_TYPE_MAKE_SEND) + == KERN_SUCCESS) { + /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting + for us. */ + exception_mask_t mask = EXC_MASK_BAD_ACCESS; + /* Create the thread listening on the exception port. */ + pthread_attr_t attr; + pthread_t thread; + if (pthread_attr_init (&attr) == 0 + && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 + && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { + pthread_attr_destroy (&attr); + /* Replace the exception port info for these exceptions with our own. + Note that we replace the exception port for the entire task, not only + for a particular thread. This has the effect that when our exception + port gets the message, the thread specific exception port has already + been asked, and we don't need to bother about it. + See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ + task_set_exception_ports (self, mask, our_exception_port, + EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); + } + } + } +} +#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Avoid a crash on native Windows. */ +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <winerror.h> +static LONG WINAPI +exception_filter (EXCEPTION_POINTERS *ExceptionInfo) +{ + switch (ExceptionInfo->ExceptionRecord->ExceptionCode) + { + case EXCEPTION_ACCESS_VIOLATION: + case EXCEPTION_IN_PAGE_ERROR: + case EXCEPTION_STACK_OVERFLOW: + case EXCEPTION_GUARD_PAGE: + case EXCEPTION_PRIV_INSTRUCTION: + case EXCEPTION_ILLEGAL_INSTRUCTION: + case EXCEPTION_DATATYPE_MISALIGNMENT: + case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: + case EXCEPTION_NONCONTINUABLE_EXCEPTION: + exit (1); + } + return EXCEPTION_CONTINUE_SEARCH; +} +static void +nocrash_init (void) +{ + SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter); +} +#else +/* Avoid a crash on POSIX systems. */ +#include <signal.h> +#include <unistd.h> +/* A POSIX signal handler. */ +static void +exception_handler (int sig) +{ + _exit (1); +} +static void +nocrash_init (void) +{ +#ifdef SIGSEGV + signal (SIGSEGV, exception_handler); +#endif +#ifdef SIGBUS + signal (SIGBUS, exception_handler); +#endif +} +#endif + + +int +main (void) +{ + + int result = 0; + + nocrash_init(); + + /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw, + and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5, + OSF/1 5.1, Solaris 10. */ + { + static char conftest[] = "conftest"; + static char plus[] = "-+"; + char *argv[3] = { conftest, plus, NULL }; + opterr = 0; + if (getopt (2, argv, "+a") != '?') + result |= 1; + } + /* This code succeeds on glibc 2.8, mingw, + and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11, + IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */ + { + static char program[] = "program"; + static char p[] = "-p"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, p, foo, bar, NULL }; + + optind = 1; + if (getopt (4, argv, "p::") != 'p') + result |= 2; + else if (optarg != NULL) + result |= 4; + else if (getopt (4, argv, "p::") != -1) + result |= 6; + else if (optind != 2) + result |= 8; + } + /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */ + { + static char program[] = "program"; + static char foo[] = "foo"; + static char p[] = "-p"; + char *argv[] = { program, foo, p, NULL }; + optind = 0; + if (getopt (3, argv, "-p") != 1) + result |= 16; + else if (getopt (3, argv, "-p") != 'p') + result |= 16; + } + /* This code fails on glibc 2.11. */ + { + static char program[] = "program"; + static char b[] = "-b"; + static char a[] = "-a"; + char *argv[] = { program, b, a, NULL }; + optind = opterr = 0; + if (getopt (3, argv, "+:a:b") != 'b') + result |= 32; + else if (getopt (3, argv, "+:a:b") != ':') + result |= 32; + } + /* This code dumps core on glibc 2.14. */ + { + static char program[] = "program"; + static char w[] = "-W"; + static char dummy[] = "dummy"; + char *argv[] = { program, w, dummy, NULL }; + optind = opterr = 1; + if (getopt (3, argv, "W;") != 'W') + result |= 64; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_gnu=yes +else + gl_cv_func_getopt_gnu=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + case $gl_had_POSIXLY_CORRECT in + exported) ;; + yes) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;}; POSIXLY_CORRECT=1 ;; + *) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;} ;; + esac + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5 +printf "%s\n" "$gl_cv_func_getopt_gnu" >&6; } + if test "$gl_cv_func_getopt_gnu" != yes; then + gl_replace_getopt=yes + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt_long function" >&5 +printf %s "checking for working GNU getopt_long function... " >&6; } +if test ${gl_cv_func_getopt_long_gnu+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + openbsd*) gl_cv_func_getopt_long_gnu="guessing no";; + *) gl_cv_func_getopt_long_gnu="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <getopt.h> + #include <stddef.h> + #include <string.h> + +int +main (void) +{ +static const struct option long_options[] = + { + { "xtremely-",no_argument, NULL, 1003 }, + { "xtra", no_argument, NULL, 1001 }, + { "xtreme", no_argument, NULL, 1002 }, + { "xtremely", no_argument, NULL, 1003 }, + { NULL, 0, NULL, 0 } + }; + /* This code fails on OpenBSD 5.0. */ + { + static char program[] = "program"; + static char xtremel[] = "--xtremel"; + char *argv[] = { program, xtremel, NULL }; + int option_index; + optind = 1; opterr = 0; + if (getopt_long (2, argv, "", long_options, &option_index) != 1003) + return 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getopt_long_gnu=yes +else + gl_cv_func_getopt_long_gnu=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_long_gnu" >&5 +printf "%s\n" "$gl_cv_func_getopt_long_gnu" >&6; } + case "$gl_cv_func_getopt_long_gnu" in + *yes) ;; + *) gl_replace_getopt=yes ;; + esac + fi + fi + + + + +: + + + + GNULIB_GETTIMEOFDAY=0; + HAVE_GETTIMEOFDAY=1; + HAVE_STRUCT_TIMEVAL=1; + HAVE_SYS_TIME_H=1; + REPLACE_GETTIMEOFDAY=0; + REPLACE_STRUCT_TIMEVAL=0; + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 +printf %s "checking for C/C++ restrict keyword... " >&6; } +if test ${ac_cv_c_restrict+y} +then : + printf %s "(cached) " >&6 +else + ac_cv_c_restrict=no + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +typedef int *int_ptr; + int foo (int_ptr $ac_kw ip) { return ip[0]; } + int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ + int bar (int ip[$ac_kw]) { return ip[0]; } + +int +main (void) +{ +int s[1]; + int *$ac_kw t = s; + t[0] = 0; + return foo (t) + bar (t); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_restrict=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_restrict" != no && break + done + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 +printf "%s\n" "$ac_cv_c_restrict" >&6; } + + case $ac_cv_c_restrict in + restrict) ;; + no) printf "%s\n" "#define restrict /**/" >>confdefs.h + ;; + *) printf "%s\n" "#define restrict $ac_cv_c_restrict" >>confdefs.h + ;; + esac + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_time_h='<'sys/time.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5 +printf %s "checking absolute name of <sys/time.h>... " >&6; } +if test ${gl_cv_next_sys_time_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_sys_time_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/time.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/time.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_time_h + gl_cv_next_sys_time_h='"'$gl_header'"' + else + gl_cv_next_sys_time_h='<'sys/time.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5 +printf "%s\n" "$gl_cv_next_sys_time_h" >&6; } + fi + NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/time.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_time_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive + + + + + + if test $ac_cv_header_sys_time_h != yes; then + HAVE_SYS_TIME_H=0 + fi + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5 +printf %s "checking for struct timeval... " >&6; } +if test ${gl_cv_sys_struct_timeval+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_SYS_TIME_H + #include <sys/time.h> + #endif + #include <time.h> + #if HAVE_WINSOCK2_H + # include <winsock2.h> + #endif + +int +main (void) +{ +static struct timeval x; x.tv_sec = x.tv_usec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timeval=yes +else + gl_cv_sys_struct_timeval=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5 +printf "%s\n" "$gl_cv_sys_struct_timeval" >&6; } + if test $gl_cv_sys_struct_timeval != yes; then + HAVE_STRUCT_TIMEVAL=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5 +printf %s "checking for wide-enough struct timeval.tv_sec member... " >&6; } +if test ${gl_cv_sys_struct_timeval_tv_sec+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_SYS_TIME_H + #include <sys/time.h> + #endif + #include <time.h> + #if HAVE_WINSOCK2_H + # include <winsock2.h> + #endif + +int +main (void) +{ +static struct timeval x; + typedef int verify_tv_sec_type[ + sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1 + ]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timeval_tv_sec=yes +else + gl_cv_sys_struct_timeval_tv_sec=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5 +printf "%s\n" "$gl_cv_sys_struct_timeval_tv_sec" >&6; } + if test $gl_cv_sys_struct_timeval_tv_sec != yes; then + REPLACE_STRUCT_TIMEVAL=1 + fi + fi + + + for gl_func in gettimeofday; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +#include <time.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + NEED_LOCALTIME_BUFFER=0 + + + GNULIB_CTIME=0; + GNULIB_MKTIME=0; + GNULIB_LOCALTIME=0; + GNULIB_NANOSLEEP=0; + GNULIB_STRFTIME=0; + GNULIB_STRPTIME=0; + GNULIB_TIMEGM=0; + GNULIB_TIME_R=0; + GNULIB_TIME_RZ=0; + GNULIB_TZSET=0; + HAVE_DECL_LOCALTIME_R=1; + HAVE_NANOSLEEP=1; + HAVE_STRPTIME=1; + HAVE_TIMEGM=1; + HAVE_TZSET=1; + HAVE_TIMEZONE_T=0; + REPLACE_CTIME=GNULIB_PORTCHECK; + REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; + REPLACE_MKTIME=GNULIB_PORTCHECK; + REPLACE_NANOSLEEP=GNULIB_PORTCHECK; + REPLACE_STRFTIME=GNULIB_PORTCHECK; + REPLACE_TIMEGM=GNULIB_PORTCHECK; + REPLACE_TZSET=GNULIB_PORTCHECK; + + : ${GNULIB_GETTIMEOFDAY=0}; + REPLACE_GMTIME=0; + REPLACE_LOCALTIME=0; + + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libiconv-prefix was given. +if test ${with_libiconv_prefix+y} +then : + withval=$with_libiconv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBICONV= + LTLIBICONV= + INCICONV= + LIBICONV_PREFIX= + HAVE_LIBICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + + + + + + + GNULIB_ICONV=0; + ICONV_CONST=; + REPLACE_ICONV=0; + REPLACE_ICONV_OPEN=0; + REPLACE_ICONV_UTF=0; + ICONV_H=''; + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + + + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +printf %s "checking for iconv... " >&6; } +if test ${am_cv_func_iconv+y} +then : + printf %s "(cached) " >&6 +else + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdlib.h> +#include <iconv.h> + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdlib.h> +#include <iconv.h> + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +printf "%s\n" "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +printf %s "checking for working iconv... " >&6; } +if test ${am_cv_func_iconv_works+y} +then : + printf %s "(cached) " >&6 +else + + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + if test "$cross_compiling" = yes +then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <iconv.h> +#include <string.h> + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + +int +main (void) +{ +int result = 0; + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\263"; + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + result |= 8; + iconv_close (cd_88591_to_utf8); + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + result |= 16; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + am_cv_func_iconv_works=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + test "$am_cv_func_iconv_works" = no || break + done + LIBS="$am_save_LIBS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +printf "%s\n" "$am_cv_func_iconv_works" >&6; } + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + +printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +printf %s "checking how to link with libiconv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +printf "%s\n" "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 +printf %s "checking for iconv declaration... " >&6; } + if test ${am_cv_proto_iconv+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdlib.h> +#include <iconv.h> +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + am_cv_proto_iconv_arg1="" +else + am_cv_proto_iconv_arg1="const" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" +fi + + am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: + $am_cv_proto_iconv" >&5 +printf "%s\n" " + $am_cv_proto_iconv" >&6; } + else + am_cv_proto_iconv_arg1="" + fi + +printf "%s\n" "#define ICONV_CONST $am_cv_proto_iconv_arg1" >>confdefs.h + + + if test -n "$am_cv_proto_iconv_arg1"; then + ICONV_CONST="const" + fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes +then : + +else + +printf "%s\n" "#define off_t long int" >>confdefs.h + +fi + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_limits_h='<'limits.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <limits.h>" >&5 +printf %s "checking absolute name of <limits.h>... " >&6; } +if test ${gl_cv_next_limits_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_limits_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'limits.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_limits_h + gl_cv_next_limits_h='"'$gl_header'"' + else + gl_cv_next_limits_h='<'limits.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5 +printf "%s\n" "$gl_cv_next_limits_h" >&6; } + fi + NEXT_LIMITS_H=$gl_cv_next_limits_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'limits.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_limits_h + fi + NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether limits.h has ULLONG_WIDTH etc." >&5 +printf %s "checking whether limits.h has ULLONG_WIDTH etc.... " >&6; } +if test ${gl_cv_header_limits_width+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include <limits.h> + int ullw = ULLONG_WIDTH; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_limits_width=yes +else + gl_cv_header_limits_width=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5 +printf "%s\n" "$gl_cv_header_limits_width" >&6; } + if test "$gl_cv_header_limits_width" = yes; then + LIMITS_H= + else + LIMITS_H=limits.h + fi + + if test -n "$LIMITS_H"; then + GL_GENERATE_LIMITS_H_TRUE= + GL_GENERATE_LIMITS_H_FALSE='#' +else + GL_GENERATE_LIMITS_H_TRUE='#' + GL_GENERATE_LIMITS_H_FALSE= +fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 +printf %s "checking for wint_t... " >&6; } +if test ${gt_cv_c_wint_t+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + wint_t foo = (wchar_t)'\0'; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_c_wint_t=yes +else + gt_cv_c_wint_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 +printf "%s\n" "$gt_cv_c_wint_t" >&6; } + if test $gt_cv_c_wint_t = yes; then + +printf "%s\n" "#define HAVE_WINT_T 1" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wint_t is too small" >&5 +printf %s "checking whether wint_t is too small... " >&6; } +if test ${gl_cv_type_wint_t_too_small+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <stddef.h> +# include <stdio.h> +# include <time.h> +#endif +#include <wchar.h> + int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wint_t_too_small=no +else + gl_cv_type_wint_t_too_small=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_too_small" >&5 +printf "%s\n" "$gl_cv_type_wint_t_too_small" >&6; } + if test $gl_cv_type_wint_t_too_small = yes; then + GNULIB_OVERRIDES_WINT_T=1 + else + GNULIB_OVERRIDES_WINT_T=0 + fi + else + GNULIB_OVERRIDES_WINT_T=0 + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 +printf %s "checking for unsigned long long int... " >&6; } +if test ${ac_cv_type_unsigned_long_long_int+y} +then : + printf %s "(cached) " >&6 +else + ac_cv_type_unsigned_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; +int +main (void) +{ +/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else + ac_cv_type_unsigned_long_long_int=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; } + if test $ac_cv_type_unsigned_long_long_int = yes; then + +printf "%s\n" "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h + + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 +printf %s "checking for long long int... " >&6; } +if test ${ac_cv_type_long_long_int+y} +then : + printf %s "(cached) " >&6 +else + ac_cv_type_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_long_long_int = yes; then + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + #ifndef LLONG_MAX + # define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + # define LLONG_MAX (HALF - 1 + HALF) + #endif +int +main (void) +{ +long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + +else + ac_cv_type_long_long_int=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_long_long_int" >&6; } + if test $ac_cv_type_long_long_int = yes; then + +printf "%s\n" "#define HAVE_LONG_LONG_INT 1" >>confdefs.h + + fi + + + + gl_cv_c_multiarch=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + arch= + prev= + for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do + if test -n "$prev"; then + case $word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$arch" || test "$arch" = "$word"; then + arch="$word" + else + gl_cv_c_multiarch=yes + fi + ;; + esac + prev= + else + if test "x$word" = "x-arch"; then + prev=arch + fi + fi + done + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $gl_cv_c_multiarch = yes; then + APPLE_UNIVERSAL_BUILD=1 + else + APPLE_UNIVERSAL_BUILD=0 + fi + + + + + + + + + if test $ac_cv_type_long_long_int = yes; then + HAVE_LONG_LONG_INT=1 + else + HAVE_LONG_LONG_INT=0 + fi + + + if test $ac_cv_type_unsigned_long_long_int = yes; then + HAVE_UNSIGNED_LONG_LONG_INT=1 + else + HAVE_UNSIGNED_LONG_LONG_INT=0 + fi + + + + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + + + if test $ac_cv_header_inttypes_h = yes; then + HAVE_INTTYPES_H=1 + else + HAVE_INTTYPES_H=0 + fi + + + if test $ac_cv_header_sys_types_h = yes; then + HAVE_SYS_TYPES_H=1 + else + HAVE_SYS_TYPES_H=0 + fi + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdint_h='<'stdint.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5 +printf %s "checking absolute name of <stdint.h>... " >&6; } +if test ${gl_cv_next_stdint_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_stdint_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdint.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdint.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdint_h + gl_cv_next_stdint_h='"'$gl_header'"' + else + gl_cv_next_stdint_h='<'stdint.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5 +printf "%s\n" "$gl_cv_next_stdint_h" >&6; } + fi + NEXT_STDINT_H=$gl_cv_next_stdint_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdint.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdint_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_stdint_h = yes; then + HAVE_STDINT_H=1 + else + HAVE_STDINT_H=0 + fi + + + if test $ac_cv_header_stdint_h = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5 +printf %s "checking whether stdint.h conforms to C99... " >&6; } +if test ${gl_cv_header_working_stdint_h+y} +then : + printf %s "(cached) " >&6 +else + gl_cv_header_working_stdint_h=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 +#include <stdint.h> +/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */ +#if !(defined WCHAR_MIN && defined WCHAR_MAX) +#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>" +#endif + + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + +#ifdef INT8_MAX +int8_t a1 = INT8_MAX; +int8_t a1min = INT8_MIN; +#endif +#ifdef INT16_MAX +int16_t a2 = INT16_MAX; +int16_t a2min = INT16_MIN; +#endif +#ifdef INT32_MAX +int32_t a3 = INT32_MAX; +int32_t a3min = INT32_MIN; +#endif +#ifdef INT64_MAX +int64_t a4 = INT64_MAX; +int64_t a4min = INT64_MIN; +#endif +#ifdef UINT8_MAX +uint8_t b1 = UINT8_MAX; +#else +typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; +#endif +#ifdef UINT16_MAX +uint16_t b2 = UINT16_MAX; +#endif +#ifdef UINT32_MAX +uint32_t b3 = UINT32_MAX; +#endif +#ifdef UINT64_MAX +uint64_t b4 = UINT64_MAX; +#endif +int_least8_t c1 = INT8_C (0x7f); +int_least8_t c1max = INT_LEAST8_MAX; +int_least8_t c1min = INT_LEAST8_MIN; +int_least16_t c2 = INT16_C (0x7fff); +int_least16_t c2max = INT_LEAST16_MAX; +int_least16_t c2min = INT_LEAST16_MIN; +int_least32_t c3 = INT32_C (0x7fffffff); +int_least32_t c3max = INT_LEAST32_MAX; +int_least32_t c3min = INT_LEAST32_MIN; +int_least64_t c4 = INT64_C (0x7fffffffffffffff); +int_least64_t c4max = INT_LEAST64_MAX; +int_least64_t c4min = INT_LEAST64_MIN; +uint_least8_t d1 = UINT8_C (0xff); +uint_least8_t d1max = UINT_LEAST8_MAX; +uint_least16_t d2 = UINT16_C (0xffff); +uint_least16_t d2max = UINT_LEAST16_MAX; +uint_least32_t d3 = UINT32_C (0xffffffff); +uint_least32_t d3max = UINT_LEAST32_MAX; +uint_least64_t d4 = UINT64_C (0xffffffffffffffff); +uint_least64_t d4max = UINT_LEAST64_MAX; +int_fast8_t e1 = INT_FAST8_MAX; +int_fast8_t e1min = INT_FAST8_MIN; +int_fast16_t e2 = INT_FAST16_MAX; +int_fast16_t e2min = INT_FAST16_MIN; +int_fast32_t e3 = INT_FAST32_MAX; +int_fast32_t e3min = INT_FAST32_MIN; +int_fast64_t e4 = INT_FAST64_MAX; +int_fast64_t e4min = INT_FAST64_MIN; +uint_fast8_t f1 = UINT_FAST8_MAX; +uint_fast16_t f2 = UINT_FAST16_MAX; +uint_fast32_t f3 = UINT_FAST32_MAX; +uint_fast64_t f4 = UINT_FAST64_MAX; +#ifdef INTPTR_MAX +intptr_t g = INTPTR_MAX; +intptr_t gmin = INTPTR_MIN; +#endif +#ifdef UINTPTR_MAX +uintptr_t h = UINTPTR_MAX; +#endif +intmax_t i = INTMAX_MAX; +uintmax_t j = UINTMAX_MAX; + +/* Check that SIZE_MAX has the correct type, if possible. */ +#if 201112 <= __STDC_VERSION__ +int k = _Generic (SIZE_MAX, size_t: 0); +#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) +extern size_t k; +extern __typeof__ (SIZE_MAX) k; +#endif + +#include <limits.h> /* for CHAR_BIT */ +#define TYPE_MINIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) +#define TYPE_MAXIMUM(t) \ + ((t) ((t) 0 < (t) -1 \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) +struct s { + int check_PTRDIFF: + PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) + && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) + ? 1 : -1; + /* Detect bug in FreeBSD 6.0 / ia64. */ + int check_SIG_ATOMIC: + SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) + && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) + ? 1 : -1; + int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; + int check_WCHAR: + WCHAR_MIN == TYPE_MINIMUM (wchar_t) + && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) + ? 1 : -1; + /* Detect bug in mingw. */ + int check_WINT: + WINT_MIN == TYPE_MINIMUM (wint_t) + && WINT_MAX == TYPE_MAXIMUM (wint_t) + ? 1 : -1; + + /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ + int check_UINT8_C: + (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; + int check_UINT16_C: + (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; + + /* Detect bugs in OpenBSD 3.9 stdint.h. */ +#ifdef UINT8_MAX + int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; +#endif +#ifdef UINT16_MAX + int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; +#endif +#ifdef UINT32_MAX + int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; +#endif +#ifdef UINT64_MAX + int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; +#endif + int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; + int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; + int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; + int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; + int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; + int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; + int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; + int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; + int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; + int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; + int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; +}; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test "$cross_compiling" = yes +then : + gl_cv_header_working_stdint_h=yes + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 +#include <stdint.h> + + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + +#include <stdio.h> +#include <string.h> +#define MVAL(macro) MVAL1(macro) +#define MVAL1(expression) #expression +static const char *macro_values[] = + { +#ifdef INT8_MAX + MVAL (INT8_MAX), +#endif +#ifdef INT16_MAX + MVAL (INT16_MAX), +#endif +#ifdef INT32_MAX + MVAL (INT32_MAX), +#endif +#ifdef INT64_MAX + MVAL (INT64_MAX), +#endif +#ifdef UINT8_MAX + MVAL (UINT8_MAX), +#endif +#ifdef UINT16_MAX + MVAL (UINT16_MAX), +#endif +#ifdef UINT32_MAX + MVAL (UINT32_MAX), +#endif +#ifdef UINT64_MAX + MVAL (UINT64_MAX), +#endif + NULL + }; + +int +main (void) +{ + + const char **mv; + for (mv = macro_values; *mv != NULL; mv++) + { + const char *value = *mv; + /* Test whether it looks like a cast expression. */ + if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 + || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 + || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 + || strncmp (value, "((int)"/*)*/, 6) == 0 + || strncmp (value, "((signed short)"/*)*/, 15) == 0 + || strncmp (value, "((signed char)"/*)*/, 14) == 0) + return mv - macro_values + 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_header_working_stdint_h=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 +printf "%s\n" "$gl_cv_header_working_stdint_h" >&6; } + fi + + HAVE_C99_STDINT_H=0 + HAVE_SYS_BITYPES_H=0 + HAVE_SYS_INTTYPES_H=0 + STDINT_H=stdint.h + if test "$gl_cv_header_working_stdint_h" = yes; then + HAVE_C99_STDINT_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h predates C++11" >&5 +printf %s "checking whether stdint.h predates C++11... " >&6; } +if test ${gl_cv_header_stdint_predates_cxx11_h+y} +then : + printf %s "(cached) " >&6 +else + gl_cv_header_stdint_predates_cxx11_h=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include <stdint.h> + + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + +intmax_t im = INTMAX_MAX; +int32_t i32 = INT32_C (0x7fffffff); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_stdint_predates_cxx11_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_predates_cxx11_h" >&5 +printf "%s\n" "$gl_cv_header_stdint_predates_cxx11_h" >&6; } + + if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + +printf "%s\n" "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h + + +printf "%s\n" "#define __STDC_LIMIT_MACROS 1" >>confdefs.h + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5 +printf %s "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; } +if test ${gl_cv_header_stdint_width+y} +then : + printf %s "(cached) " >&6 +else + gl_cv_header_stdint_width=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 + #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include <stdint.h> + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + int iw = UINTMAX_WIDTH; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_stdint_width=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5 +printf "%s\n" "$gl_cv_header_stdint_width" >&6; } + if test "$gl_cv_header_stdint_width" = yes; then + STDINT_H= + fi + else + ac_fn_c_check_header_compile "$LINENO" "sys/inttypes.h" "ac_cv_header_sys_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_inttypes_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_INTTYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/bitypes.h" "ac_cv_header_sys_bitypes_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_bitypes_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_BITYPES_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_sys_inttypes_h = yes; then + HAVE_SYS_INTTYPES_H=1 + fi + if test $ac_cv_header_sys_bitypes_h = yes; then + HAVE_SYS_BITYPES_H=1 + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + + for gltype in ptrdiff_t size_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +printf %s "checking for bit size of $gltype... " >&6; } +if eval test \${gl_cv_bitsizeof_${gltype}+y} +then : + printf %s "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + +#include <limits.h>" +then : + +else + result=unknown +fi + + eval gl_cv_bitsizeof_${gltype}=\$result + +fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + printf "%s\n" "#define BITSIZEOF_${GLTYPE} $result" >>confdefs.h + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +printf %s "checking for bit size of $gltype... " >&6; } +if eval test \${gl_cv_bitsizeof_${gltype}+y} +then : + printf %s "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + +#include <limits.h>" +then : + +else + result=unknown +fi + + eval gl_cv_bitsizeof_${gltype}=\$result + +fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + printf "%s\n" "#define BITSIZEOF_${GLTYPE} $result" >>confdefs.h + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 +printf %s "checking whether $gltype is signed... " >&6; } +if eval test \${gl_cv_type_${gltype}_signed+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + result=yes +else + result=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval gl_cv_type_${gltype}_signed=\$result + +fi +eval ac_res=\$gl_cv_type_${gltype}_signed + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval result=\$gl_cv_type_${gltype}_signed + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + if test "$result" = yes; then + printf "%s\n" "#define HAVE_SIGNED_${GLTYPE} 1" >>confdefs.h + + eval HAVE_SIGNED_${GLTYPE}=1 + else + eval HAVE_SIGNED_${GLTYPE}=0 + fi + done + + + gl_cv_type_ptrdiff_t_signed=yes + gl_cv_type_size_t_signed=no + if test $APPLE_UNIVERSAL_BUILD = 0; then + + + for gltype in ptrdiff_t size_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +printf %s "checking for $gltype integer literal suffix... " >&6; } +if eval test \${gl_cv_type_${gltype}_suffix+y} +then : + printf %s "(cached) " >&6 +else + eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + extern $gltype foo; + extern $gltype1 foo; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval gl_cv_type_${gltype}_suffix=\$glsuf +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done +fi +eval ac_res=\$gl_cv_type_${gltype}_suffix + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + printf "%s\n" "#define ${GLTYPE}_SUFFIX $result" >>confdefs.h + + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +printf %s "checking for $gltype integer literal suffix... " >&6; } +if eval test \${gl_cv_type_${gltype}_suffix+y} +then : + printf %s "(cached) " >&6 +else + eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + extern $gltype foo; + extern $gltype1 foo; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval gl_cv_type_${gltype}_suffix=\$glsuf +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done +fi +eval ac_res=\$gl_cv_type_${gltype}_suffix + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + printf "%s\n" "#define ${GLTYPE}_SUFFIX $result" >>confdefs.h + + done + + + + if test $GNULIB_OVERRIDES_WINT_T = 1; then + BITSIZEOF_WINT_T=32 + fi + + fi + + LIMITS_H=limits.h + if test -n "$LIMITS_H"; then + GL_GENERATE_LIMITS_H_TRUE= + GL_GENERATE_LIMITS_H_FALSE='#' +else + GL_GENERATE_LIMITS_H_TRUE='#' + GL_GENERATE_LIMITS_H_FALSE= +fi + + + + + + + if test -n "$STDINT_H"; then + GL_GENERATE_STDINT_H_TRUE= + GL_GENERATE_STDINT_H_FALSE='#' +else + GL_GENERATE_STDINT_H_TRUE='#' + GL_GENERATE_STDINT_H_FALSE= +fi + + + + GNULIB_IMAXABS=0; + GNULIB_IMAXDIV=0; + GNULIB_STRTOIMAX=0; + GNULIB_STRTOUMAX=0; + HAVE_DECL_IMAXABS=1; + HAVE_DECL_IMAXDIV=1; + HAVE_DECL_STRTOIMAX=1; + HAVE_DECL_STRTOUMAX=1; + REPLACE_STRTOIMAX=0; + REPLACE_STRTOUMAX=0; + INT32_MAX_LT_INTMAX_MAX=1; + INT64_MAX_EQ_LONG_MAX='defined _LP64'; + PRI_MACROS_BROKEN=0; + PRIPTR_PREFIX=__PRIPTR_PREFIX; + UINT32_MAX_LT_UINTMAX_MAX=1; + UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_inttypes_h='<'inttypes.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5 +printf %s "checking absolute name of <inttypes.h>... " >&6; } +if test ${gl_cv_next_inttypes_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_inttypes_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <inttypes.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'inttypes.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_inttypes_h + gl_cv_next_inttypes_h='"'$gl_header'"' + else + gl_cv_next_inttypes_h='<'inttypes.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5 +printf "%s\n" "$gl_cv_next_inttypes_h" >&6; } + fi + NEXT_INTTYPES_H=$gl_cv_next_inttypes_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'inttypes.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_inttypes_h + fi + NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive + + + + + + + + + for gl_func in imaxabs imaxdiv strtoimax strtoumax; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <inttypes.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + ac_fn_c_check_header_compile "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_inttypes_h" = xyes +then : + printf "%s\n" "#define HAVE_INTTYPES_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_inttypes_h = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5 +printf %s "checking whether the inttypes.h PRIxNN macros are broken... " >&6; } +if test ${gt_cv_inttypes_pri_broken+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <inttypes.h> +#ifdef PRId32 +char *p = PRId32; +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_inttypes_pri_broken=no +else + gt_cv_inttypes_pri_broken=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5 +printf "%s\n" "$gt_cv_inttypes_pri_broken" >&6; } + fi + if test "$gt_cv_inttypes_pri_broken" = yes; then + +printf "%s\n" "#define PRI_MACROS_BROKEN 1" >>confdefs.h + + PRI_MACROS_BROKEN=1 + else + PRI_MACROS_BROKEN=0 + fi + + + + GNULIB_ISWBLANK=0; + GNULIB_WCTYPE=0; + GNULIB_ISWCTYPE=0; + GNULIB_WCTRANS=0; + GNULIB_TOWCTRANS=0; + HAVE_ISWBLANK=1; + HAVE_WCTYPE_T=1; + HAVE_WCTRANS_T=1; + REPLACE_ISWBLANK=0; + + + + + + if test $ac_cv_header_crtdefs_h = yes; then + HAVE_CRTDEFS_H=1 + else + HAVE_CRTDEFS_H=0 + fi + + + + + + + + if test $ac_cv_func_iswcntrl = yes; then + HAVE_ISWCNTRL=1 + else + HAVE_ISWCNTRL=0 + fi + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wctype_h='<'wctype.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5 +printf %s "checking absolute name of <wctype.h>... " >&6; } +if test ${gl_cv_next_wctype_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_wctype_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <wctype.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wctype_h + gl_cv_next_wctype_h='"'$gl_header'"' + else + gl_cv_next_wctype_h='<'wctype.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 +printf "%s\n" "$gl_cv_next_wctype_h" >&6; } + fi + NEXT_WCTYPE_H=$gl_cv_next_wctype_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'wctype.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_wctype_h + fi + NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_wctype_h = yes; then + if test $ac_cv_func_iswcntrl = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 +printf %s "checking whether iswcntrl works... " >&6; } +if test ${gl_cv_func_iswcntrl_works+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + #if __GNU_LIBRARY__ == 1 + Linux libc5 i18n is broken. + #endif +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_iswcntrl_works="guessing yes" +else + gl_cv_func_iswcntrl_works="guessing no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #include <wctype.h> + int main () { return iswprint ('x') == 0; } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_iswcntrl_works=yes +else + gl_cv_func_iswcntrl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 +printf "%s\n" "$gl_cv_func_iswcntrl_works" >&6; } + fi + HAVE_WCTYPE_H=1 + else + HAVE_WCTYPE_H=0 + fi + + + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + fi + + if test $REPLACE_ISWCNTRL = 1; then + REPLACE_TOWLOWER=1 + else + ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" +if test "x$ac_cv_func_towlower" = xyes +then : + printf "%s\n" "#define HAVE_TOWLOWER 1" >>confdefs.h + +fi + + if test $ac_cv_func_towlower = yes; then + REPLACE_TOWLOWER=0 + else + ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #if HAVE_WCTYPE_H + # include <wctype.h> + #endif + +" +if test "x$ac_cv_have_decl_towlower" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_TOWLOWER $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_towlower = yes; then + REPLACE_TOWLOWER=1 + else + REPLACE_TOWLOWER=0 + fi + fi + fi + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then + : + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 +printf %s "checking for wctype_t... " >&6; } +if test ${gl_cv_type_wctype_t+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #if HAVE_WCTYPE_H + # include <wctype.h> + #endif + wctype_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctype_t=yes +else + gl_cv_type_wctype_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 +printf "%s\n" "$gl_cv_type_wctype_t" >&6; } + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 +printf %s "checking for wctrans_t... " >&6; } +if test ${gl_cv_type_wctrans_t+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #include <wctype.h> + wctrans_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctrans_t=yes +else + gl_cv_type_wctrans_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 +printf "%s\n" "$gl_cv_type_wctrans_t" >&6; } + if test $gl_cv_type_wctrans_t = no; then + HAVE_WCTRANS_T=0 + fi + + + for gl_func in wctype iswctype wctrans towctrans ; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <stddef.h> +# include <stdio.h> +# include <time.h> +# include <wchar.h> +#endif +#include <wctype.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + GNULIB_NL_LANGINFO=0; + HAVE_NL_LANGINFO=1; + REPLACE_NL_LANGINFO=0; + + +ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_getc_unlocked" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library >= 2.1 or uClibc" >&5 +printf %s "checking whether we are using the GNU C Library >= 2.1 or uClibc... " >&6; } +if test ${ac_cv_gnu_library_2_1+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <features.h> +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif +#ifdef __UCLIBC__ + Lucky user +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Lucky" >/dev/null 2>&1 +then : + ac_cv_gnu_library_2_1=yes +else + ac_cv_gnu_library_2_1=no +fi +rm -rf conftest* + + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5 +printf "%s\n" "$ac_cv_gnu_library_2_1" >&6; } + + GLIBC21="$ac_cv_gnu_library_2_1" + + + + GNULIB_LOCALECONV=0; + GNULIB_SETLOCALE=0; + GNULIB_DUPLOCALE=0; + HAVE_DUPLOCALE=1; + REPLACE_LOCALECONV=0; + REPLACE_SETLOCALE=0; + REPLACE_DUPLOCALE=0; + REPLACE_STRUCT_LCONV=0; + + + REPLACE_NULL=0; + HAVE_MAX_ALIGN_T=1; + HAVE_WCHAR_T=1; + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 +printf %s "checking for wchar_t... " >&6; } +if test ${gt_cv_c_wchar_t+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> + wchar_t foo = (wchar_t)'\0'; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_c_wchar_t=yes +else + gt_cv_c_wchar_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 +printf "%s\n" "$gt_cv_c_wchar_t" >&6; } + if test $gt_cv_c_wchar_t = yes; then + +printf "%s\n" "#define HAVE_WCHAR_T 1" >>confdefs.h + + fi + + + + + STDDEF_H= + ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include <stddef.h> + +" +if test "x$ac_cv_type_max_align_t" = xyes +then : + +else + HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h +fi + + if test $gt_cv_c_wchar_t = no; then + HAVE_WCHAR_T=0 + STDDEF_H=stddef.h + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 +printf %s "checking whether NULL can be used in arbitrary expressions... " >&6; } +if test ${gl_cv_decl_null_works+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> + int test[2 * (sizeof NULL == sizeof (void *)) -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_null_works=yes +else + gl_cv_decl_null_works=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 +printf "%s\n" "$gl_cv_decl_null_works" >&6; } + if test $gl_cv_decl_null_works = no; then + REPLACE_NULL=1 + STDDEF_H=stddef.h + fi + + if test -n "$STDDEF_H"; then + GL_GENERATE_STDDEF_H_TRUE= + GL_GENERATE_STDDEF_H_FALSE='#' +else + GL_GENERATE_STDDEF_H_TRUE='#' + GL_GENERATE_STDDEF_H_FALSE= +fi + + if test -n "$STDDEF_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stddef_h='<'stddef.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5 +printf %s "checking absolute name of <stddef.h>... " >&6; } +if test ${gl_cv_next_stddef_h+y} +then : + printf %s "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stddef.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stddef_h + gl_cv_next_stddef_h='"'$gl_header'"' + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 +printf "%s\n" "$gl_cv_next_stddef_h" >&6; } + fi + NEXT_STDDEF_H=$gl_cv_next_stddef_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stddef.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stddef_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive + + + + + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 +printf %s "checking whether lstat correctly handles trailing slash... " >&6; } +if test ${gl_cv_func_lstat_dereferences_slashed_symlink+y} +then : + printf %s "(cached) " >&6 +else + rm -f conftest.sym conftest.file + echo >conftest.file + if test "$cross_compiling" = yes +then : + case "$host_os" in + *-gnu*) + # Guess yes on glibc systems. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; + *) + # If we don't know, assume the worst. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ +struct stat sbuf; + if (symlink ("conftest.file", "conftest.sym") != 0) + return 1; + /* Linux will dereference the symlink and fail, as required by + POSIX. That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_lstat_dereferences_slashed_symlink=yes +else + gl_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.sym conftest.file + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5 +printf "%s\n" "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; } + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *yes) + +printf "%s\n" "#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1" >>confdefs.h + + ;; + esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + + + GNULIB__EXIT=0; + GNULIB_ATOLL=0; + GNULIB_CALLOC_POSIX=0; + GNULIB_CANONICALIZE_FILE_NAME=0; + GNULIB_GETLOADAVG=0; + GNULIB_GETSUBOPT=0; + GNULIB_GRANTPT=0; + GNULIB_MALLOC_POSIX=0; + GNULIB_MBTOWC=0; + GNULIB_MKDTEMP=0; + GNULIB_MKOSTEMP=0; + GNULIB_MKOSTEMPS=0; + GNULIB_MKSTEMP=0; + GNULIB_MKSTEMPS=0; + GNULIB_POSIX_OPENPT=0; + GNULIB_PTSNAME=0; + GNULIB_PTSNAME_R=0; + GNULIB_PUTENV=0; + GNULIB_QSORT_R=0; + GNULIB_RANDOM=0; + GNULIB_RANDOM_R=0; + GNULIB_REALLOC_POSIX=0; + GNULIB_REALPATH=0; + GNULIB_RPMATCH=0; + GNULIB_SECURE_GETENV=0; + GNULIB_SETENV=0; + GNULIB_STRTOD=0; + GNULIB_STRTOLL=0; + GNULIB_STRTOULL=0; + GNULIB_SYSTEM_POSIX=0; + GNULIB_UNLOCKPT=0; + GNULIB_UNSETENV=0; + GNULIB_WCTOMB=0; + HAVE__EXIT=1; + HAVE_ATOLL=1; + HAVE_CANONICALIZE_FILE_NAME=1; + HAVE_DECL_GETLOADAVG=1; + HAVE_GETSUBOPT=1; + HAVE_GRANTPT=1; + HAVE_MKDTEMP=1; + HAVE_MKOSTEMP=1; + HAVE_MKOSTEMPS=1; + HAVE_MKSTEMP=1; + HAVE_MKSTEMPS=1; + HAVE_POSIX_OPENPT=1; + HAVE_PTSNAME=1; + HAVE_PTSNAME_R=1; + HAVE_QSORT_R=1; + HAVE_RANDOM=1; + HAVE_RANDOM_H=1; + HAVE_RANDOM_R=1; + HAVE_REALPATH=1; + HAVE_RPMATCH=1; + HAVE_SECURE_GETENV=1; + HAVE_SETENV=1; + HAVE_DECL_SETENV=1; + HAVE_STRTOD=1; + HAVE_STRTOLL=1; + HAVE_STRTOULL=1; + HAVE_STRUCT_RANDOM_DATA=1; + HAVE_SYS_LOADAVG_H=0; + HAVE_UNLOCKPT=1; + HAVE_DECL_UNSETENV=1; + REPLACE_CALLOC=0; + REPLACE_CANONICALIZE_FILE_NAME=0; + REPLACE_MALLOC=0; + REPLACE_MBTOWC=0; + REPLACE_MKSTEMP=0; + REPLACE_PTSNAME=0; + REPLACE_PTSNAME_R=0; + REPLACE_PUTENV=0; + REPLACE_QSORT_R=0; + REPLACE_RANDOM_R=0; + REPLACE_REALLOC=0; + REPLACE_REALPATH=0; + REPLACE_SETENV=0; + REPLACE_STRTOD=0; + REPLACE_UNSETENV=0; + REPLACE_WCTOMB=0; + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5 +printf %s "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; } +if test ${gl_cv_func_malloc_posix+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + choke me + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_malloc_posix=yes +else + gl_cv_func_malloc_posix=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5 +printf "%s\n" "$gl_cv_func_malloc_posix" >&6; } + +# Autoupdate added the following line to ensure that your configure +# script's behavior did not change. It is probably safe to remove. + + + + ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes +then : + printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +printf %s "checking for GNU libc compatible malloc... " >&6; } +if test ${ac_cv_func_malloc_0_nonnull+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* \ + | hpux* | solaris* | cygwin* | mingw*) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H + # include <stdlib.h> + #else + char *malloc (); + #endif + +int +main (void) +{ +char *p = malloc (0); + int result = !p; + free (p); + return result; + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_malloc_0_nonnull=yes +else + ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } + if test $ac_cv_func_malloc_0_nonnull = yes +then : + gl_cv_func_malloc_0_nonnull=1 +else + gl_cv_func_malloc_0_nonnull=0 +fi + + +printf "%s\n" "#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull" >>confdefs.h + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + GNULIB_FFSL=0; + GNULIB_FFSLL=0; + GNULIB_MEMCHR=0; + GNULIB_MEMMEM=0; + GNULIB_MEMPCPY=0; + GNULIB_MEMRCHR=0; + GNULIB_RAWMEMCHR=0; + GNULIB_STPCPY=0; + GNULIB_STPNCPY=0; + GNULIB_STRCHRNUL=0; + GNULIB_STRDUP=0; + GNULIB_STRNCAT=0; + GNULIB_STRNDUP=0; + GNULIB_STRNLEN=0; + GNULIB_STRPBRK=0; + GNULIB_STRSEP=0; + GNULIB_STRSTR=0; + GNULIB_STRCASESTR=0; + GNULIB_STRTOK_R=0; + GNULIB_MBSLEN=0; + GNULIB_MBSNLEN=0; + GNULIB_MBSCHR=0; + GNULIB_MBSRCHR=0; + GNULIB_MBSSTR=0; + GNULIB_MBSCASECMP=0; + GNULIB_MBSNCASECMP=0; + GNULIB_MBSPCASECMP=0; + GNULIB_MBSCASESTR=0; + GNULIB_MBSCSPN=0; + GNULIB_MBSPBRK=0; + GNULIB_MBSSPN=0; + GNULIB_MBSSEP=0; + GNULIB_MBSTOK_R=0; + GNULIB_STRERROR=0; + GNULIB_STRERROR_R=0; + GNULIB_STRSIGNAL=0; + GNULIB_STRVERSCMP=0; + HAVE_MBSLEN=0; + HAVE_FFSL=1; + HAVE_FFSLL=1; + HAVE_MEMCHR=1; + HAVE_DECL_MEMMEM=1; + HAVE_MEMPCPY=1; + HAVE_DECL_MEMRCHR=1; + HAVE_RAWMEMCHR=1; + HAVE_STPCPY=1; + HAVE_STPNCPY=1; + HAVE_STRCHRNUL=1; + HAVE_DECL_STRDUP=1; + HAVE_DECL_STRNDUP=1; + HAVE_DECL_STRNLEN=1; + HAVE_STRPBRK=1; + HAVE_STRSEP=1; + HAVE_STRCASESTR=1; + HAVE_DECL_STRTOK_R=1; + HAVE_DECL_STRERROR_R=1; + HAVE_DECL_STRSIGNAL=1; + HAVE_STRVERSCMP=1; + REPLACE_MEMCHR=0; + REPLACE_MEMMEM=0; + REPLACE_STPNCPY=0; + REPLACE_STRDUP=0; + REPLACE_STRSTR=0; + REPLACE_STRCASESTR=0; + REPLACE_STRCHRNUL=0; + REPLACE_STRERROR=0; + REPLACE_STRERROR_R=0; + REPLACE_STRNCAT=0; + REPLACE_STRNDUP=0; + REPLACE_STRNLEN=0; + REPLACE_STRSIGNAL=0; + REPLACE_STRTOK_R=0; + UNDEFINE_STRTOK_R=0; + + + + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else + gl_have_mmap=no +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + if test $HAVE_MEMCHR = 1; then + # Detect platform-specific bugs in some versions of glibc: + # memchr should not dereference anything with length 0 + # http://bugzilla.redhat.com/499689 + # memchr should not dereference overestimated length after a match + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 + # http://sourceware.org/bugzilla/show_bug.cgi?id=10162 + # Assume that memchr works on platforms that lack mprotect. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5 +printf %s "checking whether memchr works... " >&6; } +if test ${gl_cv_func_memchr_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + gl_cv_func_memchr_works="guessing no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <string.h> +#if HAVE_SYS_MMAN_H +# include <fcntl.h> +# include <unistd.h> +# include <sys/types.h> +# include <sys/mman.h> +# ifndef MAP_FILE +# define MAP_FILE 0 +# endif +#endif + +int +main (void) +{ + + int result = 0; + char *fence = NULL; +#if HAVE_SYS_MMAN_H && HAVE_MPROTECT +# if HAVE_MAP_ANONYMOUS + const int flags = MAP_ANONYMOUS | MAP_PRIVATE; + const int fd = -1; +# else /* !HAVE_MAP_ANONYMOUS */ + const int flags = MAP_FILE | MAP_PRIVATE; + int fd = open ("/dev/zero", O_RDONLY, 0666); + if (fd >= 0) +# endif + { + int pagesize = getpagesize (); + char *two_pages = + (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, + flags, fd, 0); + if (two_pages != (char *)(-1) + && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) + fence = two_pages + pagesize; + } +#endif + if (fence) + { + if (memchr (fence, 0, 0)) + result |= 1; + strcpy (fence - 9, "12345678"); + if (memchr (fence - 9, 0, 79) != fence - 1) + result |= 2; + if (memchr (fence - 1, 0, 3) != fence - 1) + result |= 4; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_memchr_works=yes +else + gl_cv_func_memchr_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5 +printf "%s\n" "$gl_cv_func_memchr_works" >&6; } + if test "$gl_cv_func_memchr_works" != yes; then + REPLACE_MEMCHR=1 + fi + fi + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <limits.h> defines MIN and MAX" >&5 +printf %s "checking whether <limits.h> defines MIN and MAX... " >&6; } +if test ${gl_cv_minmax_in_limits_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + int x = MIN (42, 17); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_minmax_in_limits_h=yes +else + gl_cv_minmax_in_limits_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5 +printf "%s\n" "$gl_cv_minmax_in_limits_h" >&6; } + if test $gl_cv_minmax_in_limits_h = yes; then + +printf "%s\n" "#define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h + + fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/param.h> defines MIN and MAX" >&5 +printf %s "checking whether <sys/param.h> defines MIN and MAX... " >&6; } +if test ${gl_cv_minmax_in_sys_param_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/param.h> + int x = MIN (42, 17); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_minmax_in_sys_param_h=yes +else + gl_cv_minmax_in_sys_param_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5 +printf "%s\n" "$gl_cv_minmax_in_sys_param_h" >&6; } + if test $gl_cv_minmax_in_sys_param_h = yes; then + +printf "%s\n" "#define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h + + fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether time_t is signed" >&5 +printf %s "checking whether time_t is signed... " >&6; } +if test ${gl_cv_time_t_is_signed+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <time.h> + char time_t_signed[(time_t) -1 < 0 ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_time_t_is_signed=yes +else + gl_cv_time_t_is_signed=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_t_is_signed" >&5 +printf "%s\n" "$gl_cv_time_t_is_signed" >&6; } + if test $gl_cv_time_t_is_signed = yes; then + +printf "%s\n" "#define TIME_T_IS_SIGNED 1" >>confdefs.h + + fi + +ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default" +if test "x$ac_cv_have_decl_alarm" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_ALARM $ac_have_decl" >>confdefs.h + + + + + + + + + + if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple Mac OS X platforms. + # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode. + # But we need a configuration result that is valid in both modes. + gl_cv_func_working_mktime=no + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5 +printf %s "checking for working mktime... " >&6; } +if test ${gl_cv_func_working_mktime+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + gl_cv_func_working_mktime="guessing no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test program from Paul Eggert and Tony Leneis. */ +#include <limits.h> +#include <stdlib.h> +#include <time.h> + +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif + +#if HAVE_DECL_ALARM +# include <signal.h> +#endif + +/* Work around redefinition to rpl_putenv by other config tests. */ +#undef putenv + +static time_t time_t_max; +static time_t time_t_min; + +/* Values we'll use to set the TZ environment variable. */ +static char *tz_strings[] = { + (char *) 0, "TZ=GMT0", "TZ=JST-9", + "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" +}; +#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) + +/* Return 0 if mktime fails to convert a date in the spring-forward gap. + Based on a problem report from Andreas Jaeger. */ +static int +spring_forward_gap () +{ + /* glibc (up to about 1998-10-07) failed this test. */ + struct tm tm; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + tm.tm_year = 98; + tm.tm_mon = 3; + tm.tm_mday = 5; + tm.tm_hour = 2; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + return mktime (&tm) != (time_t) -1; +} + +static int +mktime_test1 (time_t now) +{ + struct tm *lt; + return ! (lt = localtime (&now)) || mktime (lt) == now; +} + +static int +mktime_test (time_t now) +{ + return (mktime_test1 (now) + && mktime_test1 ((time_t) (time_t_max - now)) + && mktime_test1 ((time_t) (time_t_min + now))); +} + +static int +irix_6_4_bug () +{ + /* Based on code from Ariel Faigon. */ + struct tm tm; + tm.tm_year = 96; + tm.tm_mon = 3; + tm.tm_mday = 0; + tm.tm_hour = 0; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + mktime (&tm); + return tm.tm_mon == 2 && tm.tm_mday == 31; +} + +static int +bigtime_test (int j) +{ + struct tm tm; + time_t now; + tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; + now = mktime (&tm); + if (now != (time_t) -1) + { + struct tm *lt = localtime (&now); + if (! (lt + && lt->tm_year == tm.tm_year + && lt->tm_mon == tm.tm_mon + && lt->tm_mday == tm.tm_mday + && lt->tm_hour == tm.tm_hour + && lt->tm_min == tm.tm_min + && lt->tm_sec == tm.tm_sec + && lt->tm_yday == tm.tm_yday + && lt->tm_wday == tm.tm_wday + && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) + == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) + return 0; + } + return 1; +} + +static int +year_2050_test () +{ + /* The correct answer for 2050-02-01 00:00:00 in Pacific time, + ignoring leap seconds. */ + unsigned long int answer = 2527315200UL; + + struct tm tm; + time_t t; + tm.tm_year = 2050 - 1900; + tm.tm_mon = 2 - 1; + tm.tm_mday = 1; + tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + tm.tm_isdst = -1; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + t = mktime (&tm); + + /* Check that the result is either a failure, or close enough + to the correct answer that we can assume the discrepancy is + due to leap seconds. */ + return (t == (time_t) -1 + || (0 < t && answer - 120 <= t && t <= answer + 120)); +} + +int +main () +{ + int result = 0; + time_t t, delta; + int i, j; + int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1; + +#if HAVE_DECL_ALARM + /* This test makes some buggy mktime implementations loop. + Give up after 60 seconds; a mktime slower than that + isn't worth using anyway. */ + signal (SIGALRM, SIG_DFL); + alarm (60); +#endif + + time_t_max = (! TIME_T_IS_SIGNED + ? (time_t) -1 + : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1) + * 2 + 1)); + time_t_min = (! TIME_T_IS_SIGNED + ? (time_t) 0 + : time_t_signed_magnitude + ? ~ (time_t) 0 + : ~ time_t_max); + + delta = time_t_max / 997; /* a suitable prime number */ + for (i = 0; i < N_STRINGS; i++) + { + if (tz_strings[i]) + putenv (tz_strings[i]); + + for (t = 0; t <= time_t_max - delta && (result & 1) == 0; t += delta) + if (! mktime_test (t)) + result |= 1; + if ((result & 2) == 0 + && ! (mktime_test ((time_t) 1) + && mktime_test ((time_t) (60 * 60)) + && mktime_test ((time_t) (60 * 60 * 24)))) + result |= 2; + + for (j = 1; (result & 4) == 0; j <<= 1) + { + if (! bigtime_test (j)) + result |= 4; + if (INT_MAX / 2 < j) + break; + } + if ((result & 8) == 0 && ! bigtime_test (INT_MAX)) + result |= 8; + } + if (! irix_6_4_bug ()) + result |= 16; + if (! spring_forward_gap ()) + result |= 32; + if (! year_2050_test ()) + result |= 64; + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_working_mktime=yes +else + gl_cv_func_working_mktime=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mktime" >&5 +printf "%s\n" "$gl_cv_func_working_mktime" >&6; } + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5 +printf %s "checking for promoted mode_t type... " >&6; } +if test ${gl_cv_promoted_mode_t+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +int +main (void) +{ +typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_promoted_mode_t='int' +else + gl_cv_promoted_mode_t='mode_t' +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5 +printf "%s\n" "$gl_cv_promoted_mode_t" >&6; } + +printf "%s\n" "#define PROMOTED_MODE_T $gl_cv_promoted_mode_t" >>confdefs.h + + + + + GNULIB_PTHREAD_SIGMASK=0; + GNULIB_RAISE=0; + GNULIB_SIGNAL_H_SIGPIPE=0; + GNULIB_SIGPROCMASK=0; + GNULIB_SIGACTION=0; + HAVE_POSIX_SIGNALBLOCKING=1; + HAVE_PTHREAD_SIGMASK=1; + HAVE_RAISE=1; + HAVE_SIGSET_T=1; + HAVE_SIGINFO_T=1; + HAVE_SIGACTION=1; + HAVE_STRUCT_SIGACTION_SA_SIGACTION=1; + + HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1; + + HAVE_SIGHANDLER_T=1; + REPLACE_PTHREAD_SIGMASK=0; + REPLACE_RAISE=0; + + + ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" " + #include <signal.h> + /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */ + #include <sys/types.h> + +" +if test "x$ac_cv_type_sigset_t" = xyes +then : + +printf "%s\n" "#define HAVE_SIGSET_T 1" >>confdefs.h + +gl_cv_type_sigset_t=yes +else + gl_cv_type_sigset_t=no +fi + + if test $gl_cv_type_sigset_t != yes; then + HAVE_SIGSET_T=0 + fi + + + + + + + + +ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default" +if test "x$ac_cv_have_decl_setenv" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_SETENV $ac_have_decl" >>confdefs.h + + + + + + if test $ac_cv_have_decl_setenv = no; then + HAVE_DECL_SETENV=0 + fi + + + + + + ac_fn_c_check_header_compile "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default" +if test "x$ac_cv_header_search_h" = xyes +then : + printf "%s\n" "#define HAVE_SEARCH_H 1" >>confdefs.h + +fi + + ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch" +if test "x$ac_cv_func_tsearch" = xyes +then : + printf "%s\n" "#define HAVE_TSEARCH 1" >>confdefs.h + +fi + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +printf %s "checking for uid_t in sys/types.h... " >&6; } +if test ${ac_cv_type_uid_t+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1 +then : + ac_cv_type_uid_t=yes +else + ac_cv_type_uid_t=no +fi +rm -rf conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +printf "%s\n" "$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then + +printf "%s\n" "#define uid_t int" >>confdefs.h + + +printf "%s\n" "#define gid_t int" >>confdefs.h + +fi + +: + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +printf %s "checking for stdbool.h that conforms to C99... " >&6; } +if test ${ac_cv_header_stdbool_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <stdbool.h> + + #ifdef __cplusplus + typedef bool Bool; + #else + typedef _Bool Bool; + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #endif + + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + Bool q = true; + Bool *pq = &q; + bool *qq = &q; + +int +main (void) +{ + + bool e = &s; + *pq |= q; *pq |= ! q; + *qq |= q; *qq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq + !qq); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_header_stdbool_h=yes +else + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } + ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes +then : + +printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h + + +fi + + + + GNULIB_FFS=0; + HAVE_FFS=1; + HAVE_STRCASECMP=1; + HAVE_DECL_STRNCASECMP=1; + + + REPLACE_STRERROR_0=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5 +printf %s "checking whether strerror(0) succeeds... " >&6; } +if test ${gl_cv_func_strerror_0_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_strerror_0_works="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + #include <errno.h> + +int +main (void) +{ +int result = 0; + char *str; + errno = 0; + str = strerror (0); + if (!*str) result |= 1; + if (errno) result |= 2; + if (strstr (str, "nknown") || strstr (str, "ndefined")) + result |= 4; + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strerror_0_works=yes +else + gl_cv_func_strerror_0_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5 +printf "%s\n" "$gl_cv_func_strerror_0_works" >&6; } + case "$gl_cv_func_strerror_0_works" in + *yes) ;; + *) + REPLACE_STRERROR_0=1 + +printf "%s\n" "#define REPLACE_STRERROR_0 1" >>confdefs.h + + ;; + esac + + + + + + + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5 +printf %s "checking for strerror_r with POSIX signature... " >&6; } +if test ${gl_cv_func_strerror_r_posix_signature+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + int strerror_r (int, char *, size_t); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_strerror_r_posix_signature=yes +else + gl_cv_func_strerror_r_posix_signature=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_strerror_r_posix_signature" >&6; } + if test $gl_cv_func_strerror_r_posix_signature = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5 +printf %s "checking whether strerror_r works... " >&6; } +if test ${gl_cv_func_strerror_r_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on AIX. + aix*) gl_cv_func_strerror_r_works="guessing no";; + # Guess no on HP-UX. + hpux*) gl_cv_func_strerror_r_works="guessing no";; + # Guess no on BSD variants. + *bsd*) gl_cv_func_strerror_r_works="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_strerror_r_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <errno.h> + #include <string.h> + +int +main (void) +{ +int result = 0; + char buf[79]; + if (strerror_r (EACCES, buf, 0) < 0) + result |= 1; + errno = 0; + if (strerror_r (EACCES, buf, sizeof buf) != 0) + result |= 2; + strcpy (buf, "Unknown"); + if (strerror_r (0, buf, sizeof buf) != 0) + result |= 4; + if (errno) + result |= 8; + if (strstr (buf, "nknown") || strstr (buf, "ndefined")) + result |= 0x10; + errno = 0; + *buf = 0; + if (strerror_r (-3, buf, sizeof buf) < 0) + result |= 0x20; + if (errno) + result |= 0x40; + if (!*buf) + result |= 0x80; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strerror_r_works=yes +else + gl_cv_func_strerror_r_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5 +printf "%s\n" "$gl_cv_func_strerror_r_works" >&6; } + else + + if test $ac_cv_func___xpg_strerror_r = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5 +printf %s "checking whether __xpg_strerror_r works... " >&6; } +if test ${gl_cv_func_strerror_r_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + gl_cv_func_strerror_r_works="guessing no" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <errno.h> + #include <string.h> + extern + #ifdef __cplusplus + "C" + #endif + int __xpg_strerror_r(int, char *, size_t); + +int +main (void) +{ +int result = 0; + char buf[256] = "^"; + char copy[256]; + char *str = strerror (-1); + strcpy (copy, str); + if (__xpg_strerror_r (-2, buf, 1) == 0) + result |= 1; + if (*buf) + result |= 2; + __xpg_strerror_r (-2, buf, 256); + if (strcmp (str, copy)) + result |= 4; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strerror_r_works=yes +else + gl_cv_func_strerror_r_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5 +printf "%s\n" "$gl_cv_func_strerror_r_works" >&6; } + fi + fi + fi + fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +printf %s "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if test ${ac_cv_struct_tm+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <time.h> + +int +main (void) +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_struct_tm=time.h +else + ac_cv_struct_tm=sys/time.h +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +printf "%s\n" "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +printf "%s\n" "#define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h> +#include <$ac_cv_struct_tm> + +" +if test "x$ac_cv_member_struct_tm_tm_zone" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_TM_TM_ZONE 1" >>confdefs.h + + +fi + +if test "$ac_cv_member_struct_tm_tm_zone" = yes; then + +printf "%s\n" "#define HAVE_TM_ZONE 1" >>confdefs.h + +else + ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include <time.h> +" +if test "x$ac_cv_have_decl_tzname" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_TZNAME $ac_have_decl" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 +printf %s "checking for tzname... " >&6; } +if test ${ac_cv_var_tzname+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <time.h> +#if !HAVE_DECL_TZNAME +extern char *tzname[]; +#endif + +int +main (void) +{ +return tzname[0][0]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_var_tzname=yes +else + ac_cv_var_tzname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5 +printf "%s\n" "$ac_cv_var_tzname" >&6; } + if test $ac_cv_var_tzname = yes; then + +printf "%s\n" "#define HAVE_TZNAME 1" >>confdefs.h + + fi +fi + + + ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include <time.h> +" +if test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes +then : + +printf "%s\n" "#define HAVE_TM_GMTOFF 1" >>confdefs.h + +fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_string_h='<'string.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5 +printf %s "checking absolute name of <string.h>... " >&6; } +if test ${gl_cv_next_string_h+y} +then : + printf %s "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'string.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_string_h + gl_cv_next_string_h='"'$gl_header'"' + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5 +printf "%s\n" "$gl_cv_next_string_h" >&6; } + fi + NEXT_STRING_H=$gl_cv_next_string_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'string.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_string_h + fi + NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive + + + + + + + for gl_func in ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r strerror_r strsignal strverscmp; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_strings_h='<'strings.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <strings.h>" >&5 +printf %s "checking absolute name of <strings.h>... " >&6; } +if test ${gl_cv_next_strings_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_strings_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <strings.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'strings.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_strings_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_strings_h + gl_cv_next_strings_h='"'$gl_header'"' + else + gl_cv_next_strings_h='<'strings.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_strings_h" >&5 +printf "%s\n" "$gl_cv_next_strings_h" >&6; } + fi + NEXT_STRINGS_H=$gl_cv_next_strings_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'strings.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_strings_h + fi + NEXT_AS_FIRST_DIRECTIVE_STRINGS_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_strings_h = yes; then + HAVE_STRINGS_H=1 + else + HAVE_STRINGS_H=0 + fi + + + + for gl_func in ffs strcasecmp strncasecmp; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Minix 3.1.8 has a bug: <sys/types.h> must be included before + <strings.h>. */ + #include <sys/types.h> + #include <strings.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + +ac_fn_c_check_decl "$LINENO" "strndup" "ac_cv_have_decl_strndup" "$ac_includes_default" +if test "x$ac_cv_have_decl_strndup" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_STRNDUP $ac_have_decl" >>confdefs.h + + +ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default" +if test "x$ac_cv_have_decl_strnlen" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_STRNLEN $ac_have_decl" >>confdefs.h + + + +ac_fn_c_check_decl "$LINENO" "strtoumax" "ac_cv_have_decl_strtoumax" "$ac_includes_default" +if test "x$ac_cv_have_decl_strtoumax" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_STRTOUMAX $ac_have_decl" >>confdefs.h + + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_types_h='<'sys/types.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5 +printf %s "checking absolute name of <sys/types.h>... " >&6; } +if test ${gl_cv_next_sys_types_h+y} +then : + printf %s "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/types.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_types_h + gl_cv_next_sys_types_h='"'$gl_header'"' + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5 +printf "%s\n" "$gl_cv_next_sys_types_h" >&6; } + fi + NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/types.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_types_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive + + + + + + + + + + + + + WINDOWS_STAT_INODES=0 + + + + + GNULIB_WAITPID=0; + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5 +printf %s "checking for struct timespec in <time.h>... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_time_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <time.h> + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_time_h=yes +else + gl_cv_sys_struct_timespec_in_time_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_time_h" >&6; } + + TIME_H_DEFINES_STRUCT_TIMESPEC=0 + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 + UNISTD_H_DEFINES_STRUCT_TIMESPEC=0 + if test $gl_cv_sys_struct_timespec_in_time_h = yes; then + TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5 +printf %s "checking for struct timespec in <sys/time.h>... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_sys_time_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/time.h> + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_sys_time_h=yes +else + gl_cv_sys_struct_timespec_in_sys_time_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5 +printf %s "checking for struct timespec in <pthread.h>... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_pthread_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <pthread.h> + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_pthread_h=yes +else + gl_cv_sys_struct_timespec_in_pthread_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5 +printf %s "checking for struct timespec in <unistd.h>... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_unistd_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> + +int +main (void) +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_timespec_in_unistd_h=yes +else + gl_cv_sys_struct_timespec_in_unistd_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5 +printf "%s\n" "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then + UNISTD_H_DEFINES_STRUCT_TIMESPEC=1 + fi + fi + fi + fi + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_time_h='<'time.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5 +printf %s "checking absolute name of <time.h>... " >&6; } +if test ${gl_cv_next_time_h+y} +then : + printf %s "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <time.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'time.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_time_h + gl_cv_next_time_h='"'$gl_header'"' + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5 +printf "%s\n" "$gl_cv_next_time_h" >&6; } + fi + NEXT_TIME_H=$gl_cv_next_time_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'time.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_time_h + fi + NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive + + + + + + + + + + + + + + +gl_libunistring_sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' + + + if test "$HAVE_LIBUNISTRING" = yes; then + LIBUNISTRING_VERSION_MAJOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_major"` + LIBUNISTRING_VERSION_MINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_minor"` + LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_subminor"` + fi + +ac_fn_c_check_decl "$LINENO" "clearerr_unlocked" "ac_cv_have_decl_clearerr_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_clearerr_unlocked" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_CLEARERR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_c_check_decl "$LINENO" "feof_unlocked" "ac_cv_have_decl_feof_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_feof_unlocked" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_FEOF_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_c_check_decl "$LINENO" "ferror_unlocked" "ac_cv_have_decl_ferror_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_ferror_unlocked" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_FERROR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_c_check_decl "$LINENO" "fflush_unlocked" "ac_cv_have_decl_fflush_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fflush_unlocked" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_FFLUSH_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_c_check_decl "$LINENO" "fgets_unlocked" "ac_cv_have_decl_fgets_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fgets_unlocked" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_FGETS_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_c_check_decl "$LINENO" "fputc_unlocked" "ac_cv_have_decl_fputc_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fputc_unlocked" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_FPUTC_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_c_check_decl "$LINENO" "fputs_unlocked" "ac_cv_have_decl_fputs_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fputs_unlocked" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_FPUTS_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_c_check_decl "$LINENO" "fread_unlocked" "ac_cv_have_decl_fread_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fread_unlocked" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_FREAD_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_c_check_decl "$LINENO" "fwrite_unlocked" "ac_cv_have_decl_fwrite_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fwrite_unlocked" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_FWRITE_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_c_check_decl "$LINENO" "getchar_unlocked" "ac_cv_have_decl_getchar_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_getchar_unlocked" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_GETCHAR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_c_check_decl "$LINENO" "putc_unlocked" "ac_cv_have_decl_putc_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_putc_unlocked" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_PUTC_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_c_check_decl "$LINENO" "putchar_unlocked" "ac_cv_have_decl_putchar_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_putchar_unlocked" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_PUTCHAR_UNLOCKED $ac_have_decl" >>confdefs.h + +ac_fn_c_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default" +if test "x$ac_cv_have_decl_unsetenv" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_UNSETENV $ac_have_decl" >>confdefs.h + + + + + + if test $ac_cv_header_features_h = yes; then + HAVE_FEATURES_H=1 + else + HAVE_FEATURES_H=0 + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5 +printf %s "checking for inttypes.h... " >&6; } +if test ${gl_cv_header_inttypes_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/types.h> +#include <inttypes.h> + +int +main (void) +{ +uintmax_t i = (uintmax_t) -1; return !i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_inttypes_h=yes +else + gl_cv_header_inttypes_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_inttypes_h" >&5 +printf "%s\n" "$gl_cv_header_inttypes_h" >&6; } + if test $gl_cv_header_inttypes_h = yes; then + +printf "%s\n" "#define HAVE_INTTYPES_H_WITH_UINTMAX 1" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5 +printf %s "checking for stdint.h... " >&6; } +if test ${gl_cv_header_stdint_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <stdint.h> +int +main (void) +{ +uintmax_t i = (uintmax_t) -1; return !i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_stdint_h=yes +else + gl_cv_header_stdint_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_h" >&5 +printf "%s\n" "$gl_cv_header_stdint_h" >&6; } + if test $gl_cv_header_stdint_h = yes; then + +printf "%s\n" "#define HAVE_STDINT_H_WITH_UINTMAX 1" >>confdefs.h + + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5 +printf %s "checking for intmax_t... " >&6; } +if test ${gt_cv_c_intmax_t+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stddef.h> +#include <stdlib.h> +#if HAVE_STDINT_H_WITH_UINTMAX +#include <stdint.h> +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include <inttypes.h> +#endif + +int +main (void) +{ +intmax_t x = -1; return !x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_c_intmax_t=yes +else + gt_cv_c_intmax_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_intmax_t" >&5 +printf "%s\n" "$gt_cv_c_intmax_t" >&6; } + if test $gt_cv_c_intmax_t = yes; then + +printf "%s\n" "#define HAVE_INTMAX_T 1" >>confdefs.h + + else + + test $ac_cv_type_long_long_int = yes \ + && ac_type='long long' \ + || ac_type='long' + +printf "%s\n" "#define intmax_t $ac_type" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5 +printf %s "checking where to find the exponent in a 'double'... " >&6; } +if test ${gl_cv_cc_double_expbit0+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined arm || defined __arm || defined __arm__ + mixed_endianness +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "mixed_endianness" >/dev/null 2>&1 +then : + gl_cv_cc_double_expbit0="unknown" +else + + : +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> + +int +main (void) +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> + +int +main (void) +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + +int +main (void) +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + +int +main (void) +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes +then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main (void) +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +: + case $ac_cv_c_bigendian in #( + yes) + gl_cv_cc_double_expbit0="word 0 bit 20";; #( + no) + gl_cv_cc_double_expbit0="word 1 bit 20" ;; #( + universal) + +printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + gl_cv_cc_double_expbit0="unknown" ;; + esac + + +fi +rm -rf conftest* + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { double value; unsigned int word[NWORDS]; } memory_double; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (double x) +{ + memory_double m; + size_t i; + /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ + memset (&m, 0, sizeof (memory_double)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25); + add_to_ored_words (0.5); + add_to_ored_words (1.0); + add_to_ored_words (2.0); + add_to_ored_words (4.0); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_cc_double_expbit0=`cat conftest.out` +else + gl_cv_cc_double_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5 +printf "%s\n" "$gl_cv_cc_double_expbit0" >&6; } + case "$gl_cv_cc_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` + +printf "%s\n" "#define DBL_EXPBIT0_WORD $word" >>confdefs.h + + +printf "%s\n" "#define DBL_EXPBIT0_BIT $bit" >>confdefs.h + + ;; + esac + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether snprintf returns a byte count as in C99" >&5 +printf %s "checking whether snprintf returns a byte count as in C99... " >&6; } +if test ${gl_cv_func_snprintf_retval_c99+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";; + darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_retval_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";; + aix*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_retval_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_retval_c99="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char buf[100]; +int main () +{ + strcpy (buf, "ABCDEF"); + if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7) + return 1; + if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7) + return 2; + if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7) + return 3; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_snprintf_retval_c99=yes +else + gl_cv_func_snprintf_retval_c99=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_retval_c99" >&5 +printf "%s\n" "$gl_cv_func_snprintf_retval_c99" >&6; } + + + + + + + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strnlen" "ac_cv_func_strnlen" +if test "x$ac_cv_func_strnlen" = xyes +then : + printf "%s\n" "#define HAVE_STRNLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcslen" "ac_cv_func_wcslen" +if test "x$ac_cv_func_wcslen" = xyes +then : + printf "%s\n" "#define HAVE_WCSLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcsnlen" "ac_cv_func_wcsnlen" +if test "x$ac_cv_func_wcsnlen" = xyes +then : + printf "%s\n" "#define HAVE_WCSNLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mbrtowc" "ac_cv_func_mbrtowc" +if test "x$ac_cv_func_mbrtowc" = xyes +then : + printf "%s\n" "#define HAVE_MBRTOWC 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcrtomb" "ac_cv_func_wcrtomb" +if test "x$ac_cv_func_wcrtomb" = xyes +then : + printf "%s\n" "#define HAVE_WCRTOMB 1" >>confdefs.h + +fi + + ac_fn_c_check_decl "$LINENO" "_snprintf" "ac_cv_have_decl__snprintf" "#include <stdio.h> +" +if test "x$ac_cv_have_decl__snprintf" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL__SNPRINTF $ac_have_decl" >>confdefs.h + + + + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + +printf "%s\n" "#define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h + + ;; + esac + + + + + GNULIB_SOCKET=0; + GNULIB_CONNECT=0; + GNULIB_ACCEPT=0; + GNULIB_BIND=0; + GNULIB_GETPEERNAME=0; + GNULIB_GETSOCKNAME=0; + GNULIB_GETSOCKOPT=0; + GNULIB_LISTEN=0; + GNULIB_RECV=0; + GNULIB_SEND=0; + GNULIB_RECVFROM=0; + GNULIB_SENDTO=0; + GNULIB_SETSOCKOPT=0; + GNULIB_SHUTDOWN=0; + GNULIB_ACCEPT4=0; + HAVE_STRUCT_SOCKADDR_STORAGE=1; + HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1; + + HAVE_SA_FAMILY_T=1; + HAVE_ACCEPT4=1; + + + if test $ac_cv_header_sys_socket_h = no; then + ac_fn_c_check_header_compile "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" +if test "x$ac_cv_header_ws2tcpip_h" = xyes +then : + printf "%s\n" "#define HAVE_WS2TCPIP_H 1" >>confdefs.h + +fi + + fi + + + + + + case "$host_os" in + osf*) + +printf "%s\n" "#define _POSIX_PII_SOCKET 1" >>confdefs.h + + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> is self-contained" >&5 +printf %s "checking whether <sys/socket.h> is self-contained... " >&6; } +if test ${gl_cv_header_sys_socket_h_selfcontained+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/socket.h> +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_sys_socket_h_selfcontained=yes +else + gl_cv_header_sys_socket_h_selfcontained=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5 +printf "%s\n" "$gl_cv_header_sys_socket_h_selfcontained" >&6; } + if test $gl_cv_header_sys_socket_h_selfcontained = yes; then + ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown" +if test "x$ac_cv_func_shutdown" = xyes +then : + printf "%s\n" "#define HAVE_SHUTDOWN 1" >>confdefs.h + +fi + + if test $ac_cv_func_shutdown = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> defines the SHUT_* macros" >&5 +printf %s "checking whether <sys/socket.h> defines the SHUT_* macros... " >&6; } +if test ${gl_cv_header_sys_socket_h_shut+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/socket.h> +int +main (void) +{ +int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR }; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_sys_socket_h_shut=yes +else + gl_cv_header_sys_socket_h_shut=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5 +printf "%s\n" "$gl_cv_header_sys_socket_h_shut" >&6; } + if test $gl_cv_header_sys_socket_h_shut = no; then + SYS_SOCKET_H='sys/socket.h' + fi + fi + fi + # We need to check for ws2tcpip.h now. + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_socket_h='<'sys/socket.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/socket.h>" >&5 +printf %s "checking absolute name of <sys/socket.h>... " >&6; } +if test ${gl_cv_next_sys_socket_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_sys_socket_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/socket.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/socket.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_socket_h + gl_cv_next_sys_socket_h='"'$gl_header'"' + else + gl_cv_next_sys_socket_h='<'sys/socket.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5 +printf "%s\n" "$gl_cv_next_sys_socket_h" >&6; } + fi + NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/socket.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_socket_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_sys_socket_h = yes; then + HAVE_SYS_SOCKET_H=1 + HAVE_WS2TCPIP_H=0 + else + HAVE_SYS_SOCKET_H=0 + if test $ac_cv_header_ws2tcpip_h = yes; then + HAVE_WS2TCPIP_H=1 + else + HAVE_WS2TCPIP_H=0 + fi + fi + + + + ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" " + /* sys/types.h is not needed according to POSIX, but the + sys/socket.h in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_WS2TCPIP_H +#include <ws2tcpip.h> +#endif + +" +if test "x$ac_cv_type_struct_sockaddr_storage" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h + + +fi +ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" " + /* sys/types.h is not needed according to POSIX, but the + sys/socket.h in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_WS2TCPIP_H +#include <ws2tcpip.h> +#endif + +" +if test "x$ac_cv_type_sa_family_t" = xyes +then : + +printf "%s\n" "#define HAVE_SA_FAMILY_T 1" >>confdefs.h + + +fi + + if test $ac_cv_type_struct_sockaddr_storage = no; then + HAVE_STRUCT_SOCKADDR_STORAGE=0 + fi + if test $ac_cv_type_sa_family_t = no; then + HAVE_SA_FAMILY_T=0 + fi + if test $ac_cv_type_struct_sockaddr_storage != no; then + ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h> + #ifdef HAVE_SYS_SOCKET_H + #include <sys/socket.h> + #endif + #ifdef HAVE_WS2TCPIP_H + #include <ws2tcpip.h> + #endif + +" +if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1" >>confdefs.h + + +else + HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0 +fi + + fi + if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \ + || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then + SYS_SOCKET_H='sys/socket.h' + fi + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + + + for gl_func in socket connect accept bind getpeername getsockname getsockopt listen recv send recvfrom sendto setsockopt shutdown accept4; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Some systems require prerequisite headers. */ +#include <sys/types.h> +#include <sys/socket.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + GNULIB_INET_NTOP=0; + GNULIB_INET_PTON=0; + HAVE_DECL_INET_NTOP=1; + HAVE_DECL_INET_PTON=1; + REPLACE_INET_NTOP=0; + REPLACE_INET_PTON=0; + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5 +printf %s "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; } +if test ${gl_cv_func_getcwd_null+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_getcwd_null="guessing yes";; + # Guess yes on Cygwin. + cygwin*) gl_cv_func_getcwd_null="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_getcwd_null="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# include <stdlib.h> +# if HAVE_UNISTD_H +# include <unistd.h> +# else /* on Windows with MSVC */ +# include <direct.h> +# endif +# ifndef getcwd + char *getcwd (); +# endif + +int +main (void) +{ + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* mingw cwd does not start with '/', but getcwd does allocate. + However, mingw fails to honor non-zero size. */ +#else + if (chdir ("/") != 0) + return 1; + else + { + char *f = getcwd (NULL, 0); + if (! f) + return 2; + if (f[0] != '/') + return 3; + if (f[1] != '\0') + return 4; + free (f); + return 0; + } +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getcwd_null=yes +else + gl_cv_func_getcwd_null=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5 +printf "%s\n" "$gl_cv_func_getcwd_null" >&6; } + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5 +printf %s "checking for getcwd with POSIX signature... " >&6; } +if test ${gl_cv_func_getcwd_posix_signature+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> +int +main (void) +{ +extern + #ifdef __cplusplus + "C" + #endif + char *getcwd (char *, size_t); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_getcwd_posix_signature=yes +else + gl_cv_func_getcwd_posix_signature=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_getcwd_posix_signature" >&6; } + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5 +printf %s "checking for IPv4 sockets... " >&6; } + if test ${gl_cv_socket_ipv4+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_WINSOCK2_H +#include <winsock2.h> +#endif +int +main (void) +{ +int x = AF_INET; struct in_addr y; struct sockaddr_in z; + if (&x && &y && &z) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_socket_ipv4=yes +else + gl_cv_socket_ipv4=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5 +printf "%s\n" "$gl_cv_socket_ipv4" >&6; } + if test $gl_cv_socket_ipv4 = yes; then + +printf "%s\n" "#define HAVE_IPV4 1" >>confdefs.h + + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5 +printf %s "checking for IPv6 sockets... " >&6; } + if test ${gl_cv_socket_ipv6+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_WINSOCK2_H +#include <winsock2.h> +#endif +#ifdef HAVE_WS2TCPIP_H +#include <ws2tcpip.h> +#endif +int +main (void) +{ +int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; + if (&x && &y && &z) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_socket_ipv6=yes +else + gl_cv_socket_ipv6=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5 +printf "%s\n" "$gl_cv_socket_ipv6" >&6; } + if test $gl_cv_socket_ipv6 = yes; then + +printf "%s\n" "#define HAVE_IPV6 1" >>confdefs.h + + fi + + + + GNULIB_PSELECT=0; + GNULIB_SELECT=0; + HAVE_PSELECT=1; + REPLACE_PSELECT=0; + REPLACE_SELECT=0; + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/select.h> is self-contained" >&5 +printf %s "checking whether <sys/select.h> is self-contained... " >&6; } +if test ${gl_cv_header_sys_select_h_selfcontained+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/select.h> +int +main (void) +{ +struct timeval b; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_sys_select_h_selfcontained=yes +else + gl_cv_header_sys_select_h_selfcontained=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $gl_cv_header_sys_select_h_selfcontained = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/select.h> +int +main (void) +{ +int memset; int bzero; + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/select.h> +int +main (void) +{ + + #undef memset + #define memset nonexistent_memset + extern + #ifdef __cplusplus + "C" + #endif + void *memset (void *, int, unsigned long); + #undef bzero + #define bzero nonexistent_bzero + extern + #ifdef __cplusplus + "C" + #endif + void bzero (void *, unsigned long); + fd_set fds; + FD_ZERO (&fds); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else + gl_cv_header_sys_select_h_selfcontained=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_select_h_selfcontained" >&5 +printf "%s\n" "$gl_cv_header_sys_select_h_selfcontained" >&6; } + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_select_h='<'sys/select.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/select.h>" >&5 +printf %s "checking absolute name of <sys/select.h>... " >&6; } +if test ${gl_cv_next_sys_select_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_sys_select_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/select.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/select.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_select_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_select_h + gl_cv_next_sys_select_h='"'$gl_header'"' + else + gl_cv_next_sys_select_h='<'sys/select.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_select_h" >&5 +printf "%s\n" "$gl_cv_next_sys_select_h" >&6; } + fi + NEXT_SYS_SELECT_H=$gl_cv_next_sys_select_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/select.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_select_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_sys_select_h = yes; then + HAVE_SYS_SELECT_H=1 + else + HAVE_SYS_SELECT_H=0 + fi + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + + + for gl_func in pselect select; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Some systems require prerequisite headers. */ +#include <sys/types.h> +#if !(defined __GLIBC__ && !defined __UCLIBC__) && HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +#include <sys/select.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + LIBSOCKET= + if test $HAVE_WINSOCK2_H = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we need to call WSAStartup in winsock2.h and -lws2_32" >&5 +printf %s "checking if we need to call WSAStartup in winsock2.h and -lws2_32... " >&6; } +if test ${gl_cv_func_wsastartup+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_WINSOCK2_H +# include <winsock2.h> +#endif +int +main (void) +{ + + WORD wVersionRequested = MAKEWORD(1, 1); + WSADATA wsaData; + int err = WSAStartup(wVersionRequested, &wsaData); + WSACleanup (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_func_wsastartup=yes +else + gl_cv_func_wsastartup=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wsastartup" >&5 +printf "%s\n" "$gl_cv_func_wsastartup" >&6; } + if test "$gl_cv_func_wsastartup" = "yes"; then + +printf "%s\n" "#define WINDOWS_SOCKETS 1" >>confdefs.h + + LIBSOCKET='-lws2_32' + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5 +printf %s "checking for library containing setsockopt... " >&6; } +if test ${gl_cv_lib_socket+y} +then : + printf %s "(cached) " >&6 +else + + gl_cv_lib_socket= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else + gl_save_LIBS="$LIBS" + LIBS="$gl_save_LIBS -lsocket" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_lib_socket="-lsocket" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$gl_cv_lib_socket"; then + LIBS="$gl_save_LIBS -lnetwork" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_lib_socket="-lnetwork" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$gl_cv_lib_socket"; then + LIBS="$gl_save_LIBS -lnet" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main (void) +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_lib_socket="-lnet" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi + fi + LIBS="$gl_save_LIBS" + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$gl_cv_lib_socket"; then + gl_cv_lib_socket="none needed" + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_socket" >&5 +printf "%s\n" "$gl_cv_lib_socket" >&6; } + if test "$gl_cv_lib_socket" != "none needed"; then + LIBSOCKET="$gl_cv_lib_socket" + fi + fi + + + + + + + : + + + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + REPLACE_SELECT=1 + else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select supports a 0 argument" >&5 +printf %s "checking whether select supports a 0 argument... " >&6; } +if test ${gl_cv_func_select_supports0+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on Interix. + interix*) gl_cv_func_select_supports0="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_select_supports0="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/types.h> +#include <sys/time.h> +#if HAVE_SYS_SELECT_H +#include <sys/select.h> +#endif +int main () +{ + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_supports0=yes +else + gl_cv_func_select_supports0=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_supports0" >&5 +printf "%s\n" "$gl_cv_func_select_supports0" >&6; } + case "$gl_cv_func_select_supports0" in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select detects invalid fds" >&5 +printf %s "checking whether select detects invalid fds... " >&6; } +if test ${gl_cv_func_select_detects_ebadf+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_select_detects_ebadf="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/types.h> +#include <sys/time.h> +#if HAVE_SYS_SELECT_H +# include <sys/select.h> +#endif +#include <unistd.h> +#include <errno.h> + +int +main (void) +{ + + fd_set set; + dup2(0, 16); + FD_ZERO(&set); + FD_SET(16, &set); + close(16); + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_detects_ebadf=yes +else + gl_cv_func_select_detects_ebadf=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_detects_ebadf" >&5 +printf "%s\n" "$gl_cv_func_select_detects_ebadf" >&6; } + case $gl_cv_func_select_detects_ebadf in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + fi + + LIB_SELECT="$LIBSOCKET" + if test $REPLACE_SELECT = 1; then + case "$host_os" in + mingw*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +int +main () +{ + MsgWaitForMultipleObjects (0, NULL, 0, 0, 0); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else + LIB_SELECT="$LIB_SELECT -luser32" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ;; + esac + fi + + + + + + + + + + if test $ac_cv_have_decl_strerror_r = no; then + HAVE_DECL_STRERROR_R=0 + fi + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + if test $gl_cv_func_strerror_r_posix_signature = yes; then + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR_R=1 ;; + esac + else + REPLACE_STRERROR_R=1 + fi + else + REPLACE_STRERROR_R=1 + fi + fi + + + +ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default" +if test "x$ac_cv_have_decl_snprintf" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_SNPRINTF $ac_have_decl" >>confdefs.h + + + + + + + + + + if false; then + GL_COND_LIBTOOL_TRUE= + GL_COND_LIBTOOL_FALSE='#' +else + GL_COND_LIBTOOL_TRUE='#' + GL_COND_LIBTOOL_FALSE= +fi + + gl_cond_libtool=false + gl_libdeps= + gl_ltlibdeps= + gl_m4_base='m4' + + + + + + + + + + gl_source_base='lib' + + + if test $ac_cv_func_alloca_works = no; then + : + fi + + # Define an additional variable used in the Makefile substitution. + if test $ac_cv_working_alloca_h = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5 +printf %s "checking for alloca as a compiler built-in... " >&6; } +if test ${gl_cv_rpl_alloca+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined __GNUC__ || defined _AIX || defined _MSC_VER + Need own alloca +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Need own alloca" >/dev/null 2>&1 +then : + gl_cv_rpl_alloca=yes +else + gl_cv_rpl_alloca=no +fi +rm -rf conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5 +printf "%s\n" "$gl_cv_rpl_alloca" >&6; } + if test $gl_cv_rpl_alloca = yes; then + +printf "%s\n" "#define HAVE_ALLOCA 1" >>confdefs.h + + ALLOCA_H=alloca.h + else + ALLOCA_H= + fi + else + ALLOCA_H=alloca.h + fi + + if test -n "$ALLOCA_H"; then + GL_GENERATE_ALLOCA_H_TRUE= + GL_GENERATE_ALLOCA_H_FALSE='#' +else + GL_GENERATE_ALLOCA_H_TRUE='#' + GL_GENERATE_ALLOCA_H_FALSE= +fi + + + + + + + + + if test $ac_cv_func_btowc = no; then + HAVE_BTOWC=0 + else + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether btowc(0) is correct" >&5 +printf %s "checking whether btowc(0) is correct... " >&6; } +if test ${gl_cv_func_btowc_nul+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on Cygwin. + cygwin*) gl_cv_func_btowc_nul="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_nul="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (btowc ('\0') != 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_btowc_nul=yes +else + gl_cv_func_btowc_nul=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_nul" >&5 +printf "%s\n" "$gl_cv_func_btowc_nul" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5 +printf %s "checking whether btowc(EOF) is correct... " >&6; } +if test ${gl_cv_func_btowc_eof+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on IRIX. + irix*) gl_cv_func_btowc_eof="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_eof="guessing yes" ;; + esac + if test $LOCALE_FR != none; then + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (btowc (EOF) != WEOF) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_btowc_eof=yes +else + gl_cv_func_btowc_eof=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5 +printf "%s\n" "$gl_cv_func_btowc_eof" >&6; } + + case "$gl_cv_func_btowc_nul" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + case "$gl_cv_func_btowc_eof" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + fi + + if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS btowc.$ac_objext" + + + : + + fi + + + + + + GNULIB_BTOWC=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_BTOWC 1" >>confdefs.h + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5 +printf %s "checking for __builtin_expect... " >&6; } +if test ${gl_cv___builtin_expect+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int + main (int argc, char **argv) + { + argc = __builtin_expect (argc, 100); + return argv[argc != 100][0]; + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv___builtin_expect=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <builtins.h> + int + main (int argc, char **argv) + { + argc = __builtin_expect (argc, 100); + return argv[argc != 100][0]; + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv___builtin_expect="in <builtins.h>" +else + gl_cv___builtin_expect=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5 +printf "%s\n" "$gl_cv___builtin_expect" >&6; } + if test "$gl_cv___builtin_expect" = yes; then + printf "%s\n" "#define HAVE___BUILTIN_EXPECT 1" >>confdefs.h + + elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then + printf "%s\n" "#define HAVE___BUILTIN_EXPECT 2" >>confdefs.h + + fi + + + + + + + # for STACK_DIRECTION + + + + ac_fn_c_check_decl "$LINENO" "sigaltstack" "ac_cv_have_decl_sigaltstack" "#include <signal.h> +" +if test "x$ac_cv_have_decl_sigaltstack" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_SIGALTSTACK $ac_have_decl" >>confdefs.h + + + + + ac_fn_c_check_type "$LINENO" "stack_t" "ac_cv_type_stack_t" "#include <signal.h> +" +if test "x$ac_cv_type_stack_t" = xyes +then : + +printf "%s\n" "#define HAVE_STACK_T 1" >>confdefs.h + + +fi + + + if test "$gl_cv_lib_sigsegv" = yes \ + && test $"ac_cv_sys_xsi_stack_overflow_heuristic" != yes ; then + LIBCSTACK=$LIBSIGSEGV + + LTLIBCSTACK=$LTLIBSIGSEGV + + fi + + + + + + + # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. + # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. + + # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* + # programs in the package would end up linked with that potentially-shared + # library, inducing unnecessary run-time overhead. + LIB_CLOCK_GETTIME= + + gl_saved_libs=$LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 +printf %s "checking for library containing clock_gettime... " >&6; } +if test ${ac_cv_search_clock_gettime+y} +then : + printf %s "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (); +int +main (void) +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt posix4 +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_clock_gettime=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test ${ac_cv_search_clock_gettime+y} +then : + break +fi +done +if test ${ac_cv_search_clock_gettime+y} +then : + +else + ac_cv_search_clock_gettime=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 +printf "%s\n" "$ac_cv_search_clock_gettime" >&6; } +ac_res=$ac_cv_search_clock_gettime +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ac_cv_search_clock_gettime" = "none required" || + LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime +fi + + ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" +if test "x$ac_cv_func_clock_gettime" = xyes +then : + printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "clock_settime" "ac_cv_func_clock_settime" +if test "x$ac_cv_func_clock_settime" = xyes +then : + printf "%s\n" "#define HAVE_CLOCK_SETTIME 1" >>confdefs.h + +fi + + LIBS=$gl_saved_libs + + + + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_CLOSE=1 + fi + + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then + REPLACE_CLOSE=1 + fi + + + + if test $REPLACE_CLOSE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext" + + fi + + + + + + GNULIB_CLOSE=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_CLOSE 1" >>confdefs.h + + + + + + if test "x$datarootdir" = x; then + datarootdir='${datadir}' + + fi + if test "x$docdir" = x; then + docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' + + fi + if test "x$htmldir" = x; then + htmldir='${docdir}' + + fi + if test "x$dvidir" = x; then + dvidir='${docdir}' + + fi + if test "x$pdfdir" = x; then + pdfdir='${docdir}' + + fi + if test "x$psdir" = x; then + psdir='${docdir}' + + fi + if test "x$lispdir" = x; then + lispdir='${datarootdir}/emacs/site-lisp' + + fi + if test "x$localedir" = x; then + localedir='${datarootdir}/locale' + + fi + if test "x$runstatedir" = x; then + runstatedir='${localstatedir}/run' + + fi + + pkglibexecdir='${libexecdir}/${PACKAGE}' + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_ctype_h='<'ctype.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <ctype.h>" >&5 +printf %s "checking absolute name of <ctype.h>... " >&6; } +if test ${gl_cv_next_ctype_h+y} +then : + printf %s "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ctype.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'ctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_ctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_ctype_h + gl_cv_next_ctype_h='"'$gl_header'"' + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_ctype_h" >&5 +printf "%s\n" "$gl_cv_next_ctype_h" >&6; } + fi + NEXT_CTYPE_H=$gl_cv_next_ctype_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'ctype.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_ctype_h + fi + NEXT_AS_FIRST_DIRECTIVE_CTYPE_H=$gl_next_as_first_directive + + + + + + + for gl_func in isblank; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ctype.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + +printf "%s\n" "#define GNULIB_DIRNAME 1" >>confdefs.h + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 +printf %s "checking whether // is distinct from /... " >&6; } +if test ${gl_cv_double_slash_root+y} +then : + printf %s "(cached) " >&6 +else + if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # <bug-gnulib@gnu.org>. + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + gl_cv_double_slash_root='unknown, assuming no' ;; + esac + else + set x `ls -di / // 2>/dev/null` + if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 +printf "%s\n" "$gl_cv_double_slash_root" >&6; } + if test "$gl_cv_double_slash_root" = yes; then + +printf "%s\n" "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h + + fi + + + + + + +printf "%s\n" "#define HAVE_DUP2 1" >>confdefs.h + + + if test $HAVE_DUP2 = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5 +printf %s "checking whether dup2 works... " >&6; } +if test ${gl_cv_func_dup2_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + mingw*) # on this platform, dup2 always returns 0 for success + gl_cv_func_dup2_works="guessing no" ;; + cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 + gl_cv_func_dup2_works="guessing no" ;; + aix* | freebsd*) + # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE, + # not EBADF. + gl_cv_func_dup2_works="guessing no" ;; + haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. + gl_cv_func_dup2_works="guessing no" ;; + *-android*) # implemented using dup3(), which fails if oldfd == newfd + gl_cv_func_dup2_works="guessing no" ;; + os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd. + gl_cv_func_dup2_works="guessing no" ;; + *) gl_cv_func_dup2_works="guessing yes" ;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <errno.h> + #include <fcntl.h> + #include <limits.h> + #include <sys/resource.h> + #include <unistd.h> + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + +int +main (void) +{ +int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + #ifdef FD_CLOEXEC + if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) + result |= 1; + #endif + if (dup2 (1, 1) != 1) + result |= 2; + #ifdef FD_CLOEXEC + if (fcntl (1, F_GETFD) != FD_CLOEXEC) + result |= 4; + #endif + close (0); + if (dup2 (0, 0) != -1) + result |= 8; + /* Many gnulib modules require POSIX conformance of EBADF. */ + if (dup2 (2, bad_fd) == -1 && errno != EBADF) + result |= 16; + /* Flush out some cygwin core dumps. */ + if (dup2 (2, -1) != -1 || errno != EBADF) + result |= 32; + dup2 (2, 255); + dup2 (2, 256); + /* On OS/2 kLIBC, dup2() does not work on a directory fd. */ + { + int fd = open (".", O_RDONLY); + if (fd == -1) + result |= 64; + else if (dup2 (fd, fd + 1) == -1) + result |= 128; + + close (fd); + } + return result; + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_dup2_works=yes +else + gl_cv_func_dup2_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5 +printf "%s\n" "$gl_cv_func_dup2_works" >&6; } + case "$gl_cv_func_dup2_works" in + *yes) ;; + *) + REPLACE_DUP2=1 + ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize" +if test "x$ac_cv_func_setdtablesize" = xyes +then : + printf "%s\n" "#define HAVE_SETDTABLESIZE 1" >>confdefs.h + +fi + + ;; + esac + fi + + + if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext" + + + fi + + + + + + GNULIB_DUP2=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_DUP2 1" >>confdefs.h + + + + + + + + + + GNULIB_ENVIRON=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 +printf %s "checking for error_at_line... " >&6; } +if test ${ac_cv_lib_error_at_line+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <error.h> +int +main (void) +{ +error_at_line (0, 0, "", 0, "an error occurred"); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_error_at_line=yes +else + ac_cv_lib_error_at_line=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 +printf "%s\n" "$ac_cv_lib_error_at_line" >&6; } + + if test $ac_cv_lib_error_at_line = no; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext" + + + + : + + fi + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error:3:c-format" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error_at_line:5:c-format" + + + + + + + + if test $ac_cv_func_fcntl = no; then + + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5 +printf %s "checking whether fcntl handles F_DUPFD correctly... " >&6; } +if test ${gl_cv_func_fcntl_f_dupfd_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case $host_os in + aix* | cygwin* | haiku*) + gl_cv_func_fcntl_f_dupfd_works="guessing no" ;; + *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <errno.h> + #include <fcntl.h> + #include <limits.h> + #include <sys/resource.h> + #include <unistd.h> + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + +int +main (void) +{ +int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + if (fcntl (0, F_DUPFD, -1) != -1) result |= 1; + if (errno != EINVAL) result |= 2; + if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4; + if (errno != EINVAL) result |= 8; + /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */ + { + int fd; + fd = open (".", O_RDONLY); + if (fd == -1) + result |= 16; + else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1) + result |= 32; + + close (fd); + } + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_fcntl_f_dupfd_works=yes +else + gl_cv_func_fcntl_f_dupfd_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5 +printf "%s\n" "$gl_cv_func_fcntl_f_dupfd_works" >&6; } + case $gl_cv_func_fcntl_f_dupfd_works in + *yes) ;; + *) + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + +printf "%s\n" "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5 +printf %s "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; } +if test ${gl_cv_func_fcntl_f_dupfd_cloexec+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <fcntl.h> +#ifndef F_DUPFD_CLOEXEC +choke me +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __linux__ +/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace + it to support the semantics on older kernels that failed with EINVAL. */ +choke me +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_fcntl_f_dupfd_cloexec=yes +else + gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + gl_cv_func_fcntl_f_dupfd_cloexec=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5 +printf "%s\n" "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; } + if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then + + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + fi + fi + + + if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext" + + fi + + + + + + GNULIB_FCNTL=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_FCNTL 1" >>confdefs.h + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_fcntl_h='<'fcntl.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5 +printf %s "checking absolute name of <fcntl.h>... " >&6; } +if test ${gl_cv_next_fcntl_h+y} +then : + printf %s "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <fcntl.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'fcntl.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_fcntl_h + gl_cv_next_fcntl_h='"'$gl_header'"' + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5 +printf "%s\n" "$gl_cv_next_fcntl_h" >&6; } + fi + NEXT_FCNTL_H=$gl_cv_next_fcntl_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'fcntl.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_fcntl_h + fi + NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive + + + + + + + + + + + for gl_func in fcntl openat; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <fcntl.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + +printf "%s\n" "#define GNULIB_FILENAMECAT 1" >>confdefs.h + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5 +printf %s "checking for flexible array member... " >&6; } +if test ${ac_cv_c_flexmember+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + #include <stdio.h> + #include <stddef.h> + struct m { struct m *next, **list; char name[]; }; + struct s { struct s *p; struct m *m; int n; double d[]; }; +int +main (void) +{ +int m = getchar (); + size_t nbytes = offsetof (struct s, d) + m * sizeof (double); + nbytes += sizeof (struct s) - 1; + nbytes -= nbytes % sizeof (struct s); + struct s *p = malloc (nbytes); + p->p = p; + p->m = NULL; + p->d[0] = 0.0; + return p->d != (double *) NULL; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_flexmember=yes +else + ac_cv_c_flexmember=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5 +printf "%s\n" "$ac_cv_c_flexmember" >&6; } + if test $ac_cv_c_flexmember = yes; then + +printf "%s\n" "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h + + else + printf "%s\n" "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h + + fi + + + + + FLOAT_H= + REPLACE_FLOAT_LDBL=0 + case "$host_os" in + aix* | beos* | openbsd* | mirbsd* | irix*) + FLOAT_H=float.h + ;; + freebsd*) + case "$host_cpu" in + i[34567]86 ) + FLOAT_H=float.h + ;; + x86_64 ) + # On x86_64 systems, the C compiler may still be generating + # 32-bit code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ || defined __x86_64__ || defined __amd64__ + yes + #endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1 +then : + +else + FLOAT_H=float.h +fi +rm -rf conftest* + + ;; + esac + ;; + linux*) + case "$host_cpu" in + powerpc*) + FLOAT_H=float.h + ;; + esac + ;; + esac + case "$host_os" in + aix* | freebsd* | linux*) + if test -n "$FLOAT_H"; then + REPLACE_FLOAT_LDBL=1 + fi + ;; + esac + + REPLACE_ITOLD=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5 +printf %s "checking whether conversion from 'int' to 'long double' works... " >&6; } +if test ${gl_cv_func_itold_works+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + case "$host" in + sparc*-*-linux*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ || defined __arch64__ + yes + #endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1 +then : + gl_cv_func_itold_works="guessing no" +else + gl_cv_func_itold_works="guessing yes" +fi +rm -rf conftest* + + ;; + *) gl_cv_func_itold_works="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int i = -1; +volatile long double ld; +int main () +{ + ld += i * 1.0L; + if (ld > 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_itold_works=yes +else + gl_cv_func_itold_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5 +printf "%s\n" "$gl_cv_func_itold_works" >&6; } + case "$gl_cv_func_itold_works" in + *no) + REPLACE_ITOLD=1 + FLOAT_H=float.h + ;; + esac + + if test -n "$FLOAT_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_float_h='<'float.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5 +printf %s "checking absolute name of <float.h>... " >&6; } +if test ${gl_cv_next_float_h+y} +then : + printf %s "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <float.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'float.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_float_h + gl_cv_next_float_h='"'$gl_header'"' + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5 +printf "%s\n" "$gl_cv_next_float_h" >&6; } + fi + NEXT_FLOAT_H=$gl_cv_next_float_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'float.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_float_h + fi + NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive + + + + + fi + + if test -n "$FLOAT_H"; then + GL_GENERATE_FLOAT_H_TRUE= + GL_GENERATE_FLOAT_H_FALSE='#' +else + GL_GENERATE_FLOAT_H_TRUE='#' + GL_GENERATE_FLOAT_H_FALSE= +fi + + + + if test $REPLACE_FLOAT_LDBL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext" + + fi + if test $REPLACE_ITOLD = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext" + + fi + + + + + + FNMATCH_H= + gl_fnmatch_required_lowercase=` + echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]' + ` + gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5 +printf %s "checking for working $gl_fnmatch_required fnmatch... " >&6; } +if eval test \${$gl_fnmatch_cache_var+y} +then : + printf %s "(cached) " >&6 +else + if test $gl_fnmatch_required = GNU; then + gl_fnmatch_gnu_start= + gl_fnmatch_gnu_end= + else + gl_fnmatch_gnu_start='#if 0' + gl_fnmatch_gnu_end='#endif' + fi + if test "$cross_compiling" = yes +then : + eval "$gl_fnmatch_cache_var=\"guessing no\"" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <fnmatch.h> + static int + y (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == 0; + } + static int + n (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == FNM_NOMATCH; + } + +int +main (void) +{ +char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]"; + char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]"; + static char const A_1[] = { 'A' - 1, 0 }; + static char const A01[] = { 'A' + 1, 0 }; + static char const a_1[] = { 'a' - 1, 0 }; + static char const a01[] = { 'a' + 1, 0 }; + static char const bs_1[] = { '\\\\' - 1, 0 }; + static char const bs01[] = { '\\\\' + 1, 0 }; + int result = 0; + if (!n ("a*", "", 0)) + return 1; + if (!y ("a*", "abc", 0)) + return 1; + if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */ + return 1; + if (!n ("d*/*1", "d/s/1", FNM_PATHNAME)) + return 2; + if (!y ("a\\\\bc", "abc", 0)) + return 3; + if (!n ("a\\\\bc", "abc", FNM_NOESCAPE)) + return 3; + if (!y ("*x", ".x", 0)) + return 4; + if (!n ("*x", ".x", FNM_PERIOD)) + return 4; + if (!y (Apat, "\\\\", 0)) + return 5; + if (!y (Apat, "A", 0)) + return 5; + if (!y (apat, "\\\\", 0)) + return 5; + if (!y (apat, "a", 0)) + return 5; + if (!(n (Apat, A_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, a_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, A01, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, a01, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, bs_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, bs_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(n (Apat, bs01, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, bs01, 0) == ('a' < '\\\\'))) + return 5; + $gl_fnmatch_gnu_start + if (!y ("xxXX", "xXxX", FNM_CASEFOLD)) + result |= 8; + if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)) + result |= 16; + if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME)) + result |= 32; + if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + $gl_fnmatch_gnu_end + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + eval "$gl_fnmatch_cache_var=yes" +else + eval "$gl_fnmatch_cache_var=no" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +eval ac_res=\$$gl_fnmatch_cache_var + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\"" + if test "$gl_fnmatch_result" = yes; then + rm -f "$gl_source_base/fnmatch.h" + else + FNMATCH_H=fnmatch.h + fi + + if test -n "$FNMATCH_H"; then + GL_GENERATE_FNMATCH_H_TRUE= + GL_GENERATE_FNMATCH_H_FALSE='#' +else + GL_GENERATE_FNMATCH_H_TRUE='#' + GL_GENERATE_FNMATCH_H_FALSE= +fi + + + if test -n "$FNMATCH_H"; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" + + + +printf "%s\n" "#define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch" >>confdefs.h + + + ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h> +" +if test "x$ac_cv_have_decl_isblank" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h + + + + + fi + + + + + + if test -n "$FNMATCH_H"; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" + + + +printf "%s\n" "#define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch" >>confdefs.h + + + ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h> +" +if test "x$ac_cv_have_decl_isblank" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h + + + + + fi + + + + case "$host_os" in + mingw* | pw* | os2*) + REPLACE_FREOPEN=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether freopen works on closed fds" >&5 +printf %s "checking whether freopen works on closed fds... " >&6; } +if test ${gl_cv_func_freopen_works_on_closed+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case $host_os in + *gnu*) gl_cv_func_freopen_works_on_closed="guessing no" ;; + *) gl_cv_func_freopen_works_on_closed="guessing yes";; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> + #include <unistd.h> + +int +main (void) +{ +close (0); + return !(freopen ("/dev/null", "r", stdin) + && getchar () == EOF + && !ferror (stdin) && feof (stdin)); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_freopen_works_on_closed=yes +else + gl_cv_func_freopen_works_on_closed=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_freopen_works_on_closed" >&5 +printf "%s\n" "$gl_cv_func_freopen_works_on_closed" >&6; } + case $gl_cv_func_freopen_works_on_closed in + *no) REPLACE_FREOPEN=1;; + esac + esac + + if test $REPLACE_FREOPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS freopen.$ac_objext" + + : + fi + + + + + + GNULIB_FREOPEN=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_FREOPEN 1" >>confdefs.h + + + + + +printf "%s\n" "#define GNULIB_FREOPEN_SAFER 1" >>confdefs.h + + + + + + + case "$host_os" in + mingw*) + REPLACE_FSTAT=1 + ;; + esac + + + + if test $REPLACE_FSTAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" + + + + : + + fi + + + + + + GNULIB_FSTAT=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_FSTAT 1" >>confdefs.h + + + + + + + + + if test $ac_cv_func_getdtablesize = yes && + test $ac_cv_have_decl_getdtablesize = yes; then + # Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft limit + # up to an unchangeable hard limit; all other platforms correctly + # require setrlimit before getdtablesize() can report a larger value. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5 +printf %s "checking whether getdtablesize works... " >&6; } +if test ${gl_cv_func_getdtablesize_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows + gl_cv_func_getdtablesize_works="guessing no" ;; + *) gl_cv_func_getdtablesize_works="guessing yes" ;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <unistd.h> +int +main (void) +{ +int size = getdtablesize(); + if (dup2 (0, getdtablesize()) != -1) + return 1; + if (size != getdtablesize()) + return 2; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getdtablesize_works=yes +else + gl_cv_func_getdtablesize_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5 +printf "%s\n" "$gl_cv_func_getdtablesize_works" >&6; } + case "$gl_cv_func_getdtablesize_works" in + *yes) ;; + *) REPLACE_GETDTABLESIZE=1 ;; + esac + else + HAVE_GETDTABLESIZE=0 + fi + + if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext" + + : + fi + + + + + + GNULIB_GETDTABLESIZE=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h + + + + + + + + + + + + + REPLACE_GETOPT=0 + if test -n "$gl_replace_getopt"; then + REPLACE_GETOPT=1 + fi + + if test $REPLACE_GETOPT = 1; then + + + if test $ac_cv_header_sys_cdefs_h = yes; then + HAVE_SYS_CDEFS_H=1 + else + HAVE_SYS_CDEFS_H=0 + fi + + + +printf "%s\n" "#define __GETOPT_PREFIX rpl_" >>confdefs.h + + GETOPT_H=getopt.h + GETOPT_CDEFS_H=getopt-cdefs.h + + + + fi + + if test $REPLACE_GETOPT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" + + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + + + + + ac_found=0 + ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h> +" +if test "x$ac_cv_have_decl_program_invocation_name" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + ac_found=1 +fi + + ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h> +" +if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + ac_found=1 +fi + + ac_fn_c_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include <stdlib.h> +" +if test "x$ac_cv_have_decl___argv" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL___ARGV $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + ac_found=1 +fi + + + # Incur the cost of this test only if none of the above worked. + if test $ac_found = 0; then + # On OpenBSD 5.1, using the global __progname variable appears to be + # the only way to implement getprogname. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5 +printf %s "checking whether __progname is defined in default libraries... " >&6; } +if test ${gl_cv_var___progname+y} +then : + printf %s "(cached) " >&6 +else + + gl_cv_var___progname= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char *__progname; +int +main (void) +{ +return *__progname; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_var___progname=yes + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5 +printf "%s\n" "$gl_cv_var___progname" >&6; } + if test "$gl_cv_var___progname" = yes; then + +printf "%s\n" "#define HAVE_VAR___PROGNAME 1" >>confdefs.h + + fi + fi + + + + + + + + + + + + + + + + gl_gettimeofday_timezone=void + if test $ac_cv_func_gettimeofday != yes; then + HAVE_GETTIMEOFDAY=0 + else + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5 +printf %s "checking whether gettimeofday clobbers localtime buffer... " >&6; } +if test ${gl_cv_func_gettimeofday_clobber+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + # When cross-compiling: + case "$host_os" in + # Guess all is fine on glibc systems. + *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_gettimeofday_clobber="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + #include <sys/time.h> + #include <time.h> + #include <stdlib.h> + +int +main (void) +{ + + time_t t = 0; + struct tm *lt; + struct tm saved_lt; + struct timeval tv; + lt = localtime (&t); + saved_lt = *lt; + gettimeofday (&tv, NULL); + return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_gettimeofday_clobber=no +else + gl_cv_func_gettimeofday_clobber=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5 +printf "%s\n" "$gl_cv_func_gettimeofday_clobber" >&6; } + + case "$gl_cv_func_gettimeofday_clobber" in + *yes) + REPLACE_GETTIMEOFDAY=1 + +printf "%s\n" "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h + + + + + NEED_LOCALTIME_BUFFER=1 + REPLACE_GMTIME=1 + REPLACE_LOCALTIME=1 + + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5 +printf %s "checking for gettimeofday with POSIX signature... " >&6; } +if test ${gl_cv_func_gettimeofday_posix_signature+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/time.h> + struct timeval c; + int gettimeofday (struct timeval *restrict, void *restrict); + +int +main (void) +{ +/* glibc uses struct timezone * rather than the POSIX void * + if _GNU_SOURCE is defined. However, since the only portable + use of gettimeofday uses NULL as the second parameter, and + since the glibc definition is actually more typesafe, it is + not worth wrapping this to get a compliant signature. */ + int (*f) (struct timeval *restrict, void *restrict) + = gettimeofday; + int x = f (&c, 0); + return !(x | c.tv_sec | c.tv_usec); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_gettimeofday_posix_signature=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/time.h> +int gettimeofday (struct timeval *restrict, struct timezone *restrict); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_gettimeofday_posix_signature=almost +else + gl_cv_func_gettimeofday_posix_signature=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_gettimeofday_posix_signature" >&6; } + if test $gl_cv_func_gettimeofday_posix_signature = almost; then + gl_gettimeofday_timezone='struct timezone' + elif test $gl_cv_func_gettimeofday_posix_signature != yes; then + REPLACE_GETTIMEOFDAY=1 + fi + if test $REPLACE_STRUCT_TIMEVAL = 1; then + REPLACE_GETTIMEOFDAY=1 + fi + case "$host_os" in + mingw*) REPLACE_GETTIMEOFDAY=1 ;; + esac + fi + +printf "%s\n" "#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone" >>confdefs.h + + + if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" + + : + fi + + + + + + GNULIB_GETTIMEOFDAY=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h + + + + + if ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then + GNU_MAKE_TRUE= + GNU_MAKE_FALSE='#' +else + GNU_MAKE_TRUE='#' + GNU_MAKE_FALSE= +fi + + + # Autoconf 2.61a.99 and earlier don't support linking a file only + # in VPATH builds. But since GNUmakefile is for maintainer use + # only, it does not matter if we skip the link with older autoconf. + # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH + # builds, so use a shell variable to bypass this. + GNUmakefile=GNUmakefile + ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile" + + + : + + + + + + + + GNULIB_ICONV=1 + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_iconv_h='<'iconv.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <iconv.h>" >&5 +printf %s "checking absolute name of <iconv.h>... " >&6; } +if test ${gl_cv_next_iconv_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_iconv_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <iconv.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'iconv.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_iconv_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_iconv_h + gl_cv_next_iconv_h='"'$gl_header'"' + else + gl_cv_next_iconv_h='<'iconv.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_iconv_h" >&5 +printf "%s\n" "$gl_cv_next_iconv_h" >&6; } + fi + NEXT_ICONV_H=$gl_cv_next_iconv_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'iconv.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_iconv_h + fi + NEXT_AS_FIRST_DIRECTIVE_ICONV_H=$gl_next_as_first_directive + + + + + + + + + + if test "$am_cv_func_iconv" = yes; then + + + ICONV_H='iconv.h' + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <iconv.h> + #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__) + gnu_iconv + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "gnu_iconv" >/dev/null 2>&1 +then : + gl_func_iconv_gnu=yes +else + gl_func_iconv_gnu=no +fi +rm -rf conftest* + + if test $gl_func_iconv_gnu = no; then + iconv_flavor= + case "$host_os" in + aix*) iconv_flavor=ICONV_FLAVOR_AIX ;; + irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;; + hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;; + osf*) iconv_flavor=ICONV_FLAVOR_OSF ;; + solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;; + esac + if test -n "$iconv_flavor"; then + +printf "%s\n" "#define ICONV_FLAVOR $iconv_flavor" >>confdefs.h + + + + + ICONV_H='iconv.h' + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + + + REPLACE_ICONV_OPEN=1 + + fi + fi + + fi + + if test $REPLACE_ICONV_OPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv_open.$ac_objext" + + fi + if test $REPLACE_ICONV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv_close.$ac_objext" + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler generally respects inline" >&5 +printf %s "checking whether the compiler generally respects inline... " >&6; } +if test ${gl_cv_c_inline_effective+y} +then : + printf %s "(cached) " >&6 +else + if test $ac_cv_c_inline = no; then + gl_cv_c_inline_effective=no + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifdef __NO_INLINE__ + #error "inline is not effective" + #endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_c_inline_effective=yes +else + gl_cv_c_inline_effective=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_inline_effective" >&5 +printf "%s\n" "$gl_cv_c_inline_effective" >&6; } + if test $gl_cv_c_inline_effective = yes; then + +printf "%s\n" "#define HAVE_INLINE 1" >>confdefs.h + + fi + + + + + : + + : + : + : + : + + + + + + + PRIPTR_PREFIX= + if test -n "$STDINT_H"; then + PRIPTR_PREFIX='"l"' + else + for glpfx in '' l ll I64; do + case $glpfx in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + I64) gltype1='__int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdint.h> + extern intptr_t foo; + extern $gltype1 foo; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + PRIPTR_PREFIX='"'$glpfx'"' +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test -n "$PRIPTR_PREFIX" && break + done + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5 +printf %s "checking whether INT32_MAX < INTMAX_MAX... " >&6; } +if test ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include <limits.h> + #if HAVE_STDINT_H + #include <stdint.h> + #endif + + #if defined INT32_MAX && defined INTMAX_MAX + #define CONDITION (INT32_MAX < INTMAX_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (int) < sizeof (long long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes +else + gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5 +printf "%s\n" "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; } + if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then + INT32_MAX_LT_INTMAX_MAX=1; + else + INT32_MAX_LT_INTMAX_MAX=0; + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5 +printf %s "checking whether INT64_MAX == LONG_MAX... " >&6; } +if test ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include <limits.h> + #if HAVE_STDINT_H + #include <stdint.h> + #endif + + #if defined INT64_MAX + #define CONDITION (INT64_MAX == LONG_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (long long int) == sizeof (long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes +else + gl_cv_test_INT64_MAX_EQ_LONG_MAX=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5 +printf "%s\n" "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; } + if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then + INT64_MAX_EQ_LONG_MAX=1; + else + INT64_MAX_EQ_LONG_MAX=0; + fi + + + else + INT64_MAX_EQ_LONG_MAX=-1 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5 +printf %s "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; } +if test ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include <limits.h> + #if HAVE_STDINT_H + #include <stdint.h> + #endif + + #if defined UINT32_MAX && defined UINTMAX_MAX + #define CONDITION (UINT32_MAX < UINTMAX_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes +else + gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5 +printf "%s\n" "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; } + if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then + UINT32_MAX_LT_UINTMAX_MAX=1; + else + UINT32_MAX_LT_UINTMAX_MAX=0; + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5 +printf %s "checking whether UINT64_MAX == ULONG_MAX... " >&6; } +if test ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include <limits.h> + #if HAVE_STDINT_H + #include <stdint.h> + #endif + + #if defined UINT64_MAX + #define CONDITION (UINT64_MAX == ULONG_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes +else + gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5 +printf "%s\n" "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; } + if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then + UINT64_MAX_EQ_ULONG_MAX=1; + else + UINT64_MAX_EQ_ULONG_MAX=0; + fi + + + else + UINT64_MAX_EQ_ULONG_MAX=-1 + fi + + + + + + + + + if test $ac_cv_func_isblank = no; then + HAVE_ISBLANK=0 + fi + + if test $HAVE_ISBLANK = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS isblank.$ac_objext" + + fi + + + + + + GNULIB_ISBLANK=1 + + + + + + + + + + ac_fn_c_check_decl "$LINENO" "iswblank" "ac_cv_have_decl_iswblank" " +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +#include <wctype.h> + +" +if test "x$ac_cv_have_decl_iswblank" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_ISWBLANK $ac_have_decl" >>confdefs.h + + if test $ac_cv_func_iswblank = no; then + HAVE_ISWBLANK=0 + if test $ac_cv_have_decl_iswblank = yes; then + REPLACE_ISWBLANK=1 + fi + fi + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + : + fi + fi + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iswblank.$ac_objext" + + fi + fi + + + + + + GNULIB_ISWBLANK=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_ISWBLANK 1" >>confdefs.h + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_langinfo_h='<'langinfo.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <langinfo.h>" >&5 +printf %s "checking absolute name of <langinfo.h>... " >&6; } +if test ${gl_cv_next_langinfo_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_langinfo_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'langinfo.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_langinfo_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_langinfo_h + gl_cv_next_langinfo_h='"'$gl_header'"' + else + gl_cv_next_langinfo_h='<'langinfo.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_langinfo_h" >&5 +printf "%s\n" "$gl_cv_next_langinfo_h" >&6; } + fi + NEXT_LANGINFO_H=$gl_cv_next_langinfo_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'langinfo.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_langinfo_h + fi + NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H=$gl_next_as_first_directive + + + + + + HAVE_LANGINFO_CODESET=0 + HAVE_LANGINFO_T_FMT_AMPM=0 + HAVE_LANGINFO_ERA=0 + HAVE_LANGINFO_YESEXPR=0 + + if test $ac_cv_header_langinfo_h = yes; then + HAVE_LANGINFO_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines CODESET" >&5 +printf %s "checking whether langinfo.h defines CODESET... " >&6; } +if test ${gl_cv_header_langinfo_codeset+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> +int a = CODESET; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_codeset=yes +else + gl_cv_header_langinfo_codeset=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_codeset" >&5 +printf "%s\n" "$gl_cv_header_langinfo_codeset" >&6; } + if test $gl_cv_header_langinfo_codeset = yes; then + HAVE_LANGINFO_CODESET=1 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines T_FMT_AMPM" >&5 +printf %s "checking whether langinfo.h defines T_FMT_AMPM... " >&6; } +if test ${gl_cv_header_langinfo_t_fmt_ampm+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> +int a = T_FMT_AMPM; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_t_fmt_ampm=yes +else + gl_cv_header_langinfo_t_fmt_ampm=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_t_fmt_ampm" >&5 +printf "%s\n" "$gl_cv_header_langinfo_t_fmt_ampm" >&6; } + if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then + HAVE_LANGINFO_T_FMT_AMPM=1 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ERA" >&5 +printf %s "checking whether langinfo.h defines ERA... " >&6; } +if test ${gl_cv_header_langinfo_era+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> +int a = ERA; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_era=yes +else + gl_cv_header_langinfo_era=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_era" >&5 +printf "%s\n" "$gl_cv_header_langinfo_era" >&6; } + if test $gl_cv_header_langinfo_era = yes; then + HAVE_LANGINFO_ERA=1 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines YESEXPR" >&5 +printf %s "checking whether langinfo.h defines YESEXPR... " >&6; } +if test ${gl_cv_header_langinfo_yesexpr+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> +int a = YESEXPR; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_yesexpr=yes +else + gl_cv_header_langinfo_yesexpr=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_yesexpr" >&5 +printf "%s\n" "$gl_cv_header_langinfo_yesexpr" >&6; } + if test $gl_cv_header_langinfo_yesexpr = yes; then + HAVE_LANGINFO_YESEXPR=1 + fi + else + HAVE_LANGINFO_H=0 + fi + + + + + + + + for gl_func in nl_langinfo; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libsigsegv-prefix was given. +if test ${with_libsigsegv_prefix+y} +then : + withval=$with_libsigsegv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBSIGSEGV= + LTLIBSIGSEGV= + INCSIGSEGV= + LIBSIGSEGV_PREFIX= + HAVE_LIBSIGSEGV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='sigsegv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_a" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCSIGSEGV="${INCSIGSEGV}${INCSIGSEGV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBSIGSEGV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$dep" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$dep" + ;; + esac + done + fi + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-R$found_dir" + done + fi + + + + + + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCSIGSEGV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsigsegv" >&5 +printf %s "checking for libsigsegv... " >&6; } +if test ${ac_cv_libsigsegv+y} +then : + printf %s "(cached) " >&6 +else + + ac_save_LIBS="$LIBS" + case " $LIBSIGSEGV" in + *" -l"*) LIBS="$LIBS $LIBSIGSEGV" ;; + *) LIBS="$LIBSIGSEGV $LIBS" ;; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sigsegv.h> +int +main (void) +{ +sigsegv_deinstall_handler(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libsigsegv=yes +else + ac_cv_libsigsegv='no, consider installing GNU libsigsegv' +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libsigsegv" >&5 +printf "%s\n" "$ac_cv_libsigsegv" >&6; } + if test "$ac_cv_libsigsegv" = yes; then + HAVE_LIBSIGSEGV=yes + +printf "%s\n" "#define HAVE_LIBSIGSEGV 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libsigsegv" >&5 +printf %s "checking how to link with libsigsegv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBSIGSEGV" >&5 +printf "%s\n" "$LIBSIGSEGV" >&6; } + else + HAVE_LIBSIGSEGV=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBSIGSEGV= + LTLIBSIGSEGV= + LIBSIGSEGV_PREFIX= + fi + + + + + + + + gl_cv_lib_sigsegv="$ac_cv_libsigsegv" + + + + + + + + + + + LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" + + + + + + + + + + case "$host_os" in + solaris*) + +printf "%s\n" "#define _LCONV_C99 1" >>confdefs.h + + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5 +printf %s "checking whether locale.h conforms to POSIX:2001... " >&6; } +if test ${gl_cv_header_locale_h_posix2001+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <locale.h> + int x = LC_MESSAGES; + int y = sizeof (((struct lconv *) 0)->decimal_point); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_locale_h_posix2001=yes +else + gl_cv_header_locale_h_posix2001=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5 +printf "%s\n" "$gl_cv_header_locale_h_posix2001" >&6; } + + + if test $ac_cv_header_xlocale_h = yes; then + HAVE_XLOCALE_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5 +printf %s "checking whether locale.h defines locale_t... " >&6; } +if test ${gl_cv_header_locale_has_locale_t+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <locale.h> + locale_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_locale_has_locale_t=yes +else + gl_cv_header_locale_has_locale_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5 +printf "%s\n" "$gl_cv_header_locale_has_locale_t" >&6; } + if test $gl_cv_header_locale_has_locale_t = yes; then + gl_cv_header_locale_h_needs_xlocale_h=no + else + gl_cv_header_locale_h_needs_xlocale_h=yes + fi + else + HAVE_XLOCALE_H=0 + gl_cv_header_locale_h_needs_xlocale_h=no + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5 +printf %s "checking whether struct lconv is properly defined... " >&6; } +if test ${gl_cv_sys_struct_lconv_ok+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <locale.h> + struct lconv l; + int x = sizeof (l.decimal_point); + int y = sizeof (l.int_p_cs_precedes); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_lconv_ok=yes +else + gl_cv_sys_struct_lconv_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5 +printf "%s\n" "$gl_cv_sys_struct_lconv_ok" >&6; } + if test $gl_cv_sys_struct_lconv_ok = no; then + REPLACE_STRUCT_LCONV=1 + fi + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_locale_h='<'locale.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <locale.h>" >&5 +printf %s "checking absolute name of <locale.h>... " >&6; } +if test ${gl_cv_next_locale_h+y} +then : + printf %s "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <locale.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'locale.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_locale_h + gl_cv_next_locale_h='"'$gl_header'"' + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5 +printf "%s\n" "$gl_cv_next_locale_h" >&6; } + fi + NEXT_LOCALE_H=$gl_cv_next_locale_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'locale.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_locale_h + fi + NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive + + + + + + + for gl_func in setlocale duplocale; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <locale.h> +/* Some systems provide declarations in a non-standard header. */ +#if HAVE_XLOCALE_H +# include <xlocale.h> +#endif + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + if test $REPLACE_STRUCT_LCONV = 1; then + REPLACE_LOCALECONV=1 + fi + + if test $REPLACE_LOCALECONV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS localeconv.$ac_objext" + + + ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include <locale.h> +" +if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1" >>confdefs.h + + +fi + + + fi + + + + + + GNULIB_LOCALECONV=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_LOCALECONV 1" >>confdefs.h + + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS localtime-buffer.$ac_objext" + + + + + if test $ac_cv_func_lstat = yes; then + + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *no) + REPLACE_LSTAT=1 + ;; + esac + else + HAVE_LSTAT=0 + fi + + if test $REPLACE_LSTAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext" + + : + fi + + + + + + GNULIB_LSTAT=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_LSTAT 1" >>confdefs.h + + + + + + + + + if test $gl_cv_func_malloc_posix = yes; then + +printf "%s\n" "#define HAVE_MALLOC_POSIX 1" >>confdefs.h + + else + REPLACE_MALLOC=1 + fi + + if test $REPLACE_MALLOC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" + + fi + + + + + + GNULIB_MALLOC_POSIX=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h + + + + + + + + + + + + + : + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else + gl_cv_func_mbrtowc_incomplete_state=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else + gl_cv_func_mbrtowc_sanitycheck=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_mbrtowc = no; then + HAVE_MBRTOWC=0 + ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" " +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +" +if test "x$ac_cv_have_decl_mbrtowc" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_MBRTOWC $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_mbrtowc = yes; then + REPLACE_MBRTOWC=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBRTOWC=1 + else + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5 +printf %s "checking whether mbrtowc handles a NULL pwc argument... " >&6; } +if test ${gl_cv_func_mbrtowc_null_arg1+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris. + solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none; then + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + int result = 0; + + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "\303\237er"; + mbstate_t state; + wchar_t wc; + size_t ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 5, &state); + if (ret != 2) + result |= 1; + if (!mbsinit (&state)) + result |= 2; + + memset (&state, '\0', sizeof (mbstate_t)); + ret = mbrtowc (NULL, input, 5, &state); + if (ret != 2) /* Solaris 7 fails here: ret is -1. */ + result |= 4; + if (!mbsinit (&state)) + result |= 8; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_null_arg1=yes +else + gl_cv_func_mbrtowc_null_arg1=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_null_arg1" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5 +printf %s "checking whether mbrtowc handles a NULL string argument... " >&6; } +if test ${gl_cv_func_mbrtowc_null_arg2+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on OSF/1. + osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none; then + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + mbstate_t state; + wchar_t wc; + int ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + mbrtowc (&wc, NULL, 5, &state); + /* Check that wc was not modified. */ + if (wc != (wchar_t) 0xBADFACE) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_null_arg2=yes +else + gl_cv_func_mbrtowc_null_arg2=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_null_arg2" >&6; } + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5 +printf %s "checking whether mbrtowc has a correct return value... " >&6; } +if test ${gl_cv_func_mbrtowc_retval+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on HP-UX, Solaris, native Windows. + hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_retval="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \ + || { case "$host_os" in mingw*) true;; *) false;; esac; }; then + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + int result = 0; + int found_some_locale = 0; + /* This fails on Solaris. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "B\303\274\303\237er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 1) + result |= 1; + } + found_some_locale = 1; + } + /* This fails on HP-UX 11.11. */ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 2) + result |= 2; + } + found_some_locale = 1; + } + /* This fails on native Windows. */ + if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) + { + char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 4; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) + { + char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 8; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_China.936") != NULL) + { + char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 16; + } + found_some_locale = 1; + } + return (found_some_locale ? result : 77); +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_retval=yes +else + if test $? != 77; then + gl_cv_func_mbrtowc_retval=no + fi + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_retval" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5 +printf %s "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; } +if test ${gl_cv_func_mbrtowc_nul_retval+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris 8 and 9. + solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris 8 and 9. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, "", 1, &state) != 0) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_nul_retval=yes +else + gl_cv_func_mbrtowc_nul_retval=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_nul_retval" >&6; } + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5 +printf %s "checking whether mbrtowc works on empty input... " >&6; } +if test ${gl_cv_func_mbrtowc_empty_input+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on AIX and glibc systems. + aix* | *-gnu*) + gl_cv_func_mbrtowc_empty_input="guessing no" ;; + *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; + esac + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <wchar.h> + static wchar_t wc; + static mbstate_t mbs; + int + main (void) + { + return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2; + } +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_empty_input=yes +else + gl_cv_func_mbrtowc_empty_input=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_empty_input" >&6; } + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5 +printf %s "checking whether the C locale is free of encoding errors... " >&6; } +if test ${gl_cv_C_locale_sans_EILSEQ+y} +then : + printf %s "(cached) " >&6 +else + + gl_cv_C_locale_sans_EILSEQ="guessing no" + + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + #include <locale.h> + #include <wchar.h> + +int +main (void) +{ + + int i; + char *locale = setlocale (LC_ALL, "C"); + if (! locale) + return 2; + for (i = CHAR_MIN; i <= CHAR_MAX; i++) + { + char c = i; + wchar_t wc; + mbstate_t mbs = { 0, }; + size_t ss = mbrtowc (&wc, &c, 1, &mbs); + if (1 < ss) + return 3; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_C_locale_sans_EILSEQ=yes +else + gl_cv_C_locale_sans_EILSEQ=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_C_locale_sans_EILSEQ" >&5 +printf "%s\n" "$gl_cv_C_locale_sans_EILSEQ" >&6; } + + case "$gl_cv_func_mbrtowc_null_arg1" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_null_arg2" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_retval" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_nul_retval" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_empty_input" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case $gl_cv_C_locale_sans_EILSEQ in + *yes) ;; + *) +printf "%s\n" "#define C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + fi + fi + + if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBRTOWC=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h + + + + + + + + + GNULIB_MBSCASECMP=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBSCASECMP 1" >>confdefs.h + + + + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else + gl_cv_func_mbrtowc_incomplete_state=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else + gl_cv_func_mbrtowc_sanitycheck=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_mbsinit = no; then + HAVE_MBSINIT=0 + ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" " +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +" +if test "x$ac_cv_have_decl_mbsinit" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_MBSINIT $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_mbsinit = yes; then + REPLACE_MBSINIT=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSINIT=1 + else + case "$host_os" in + mingw*) REPLACE_MBSINIT=1 ;; + esac + fi + fi + + if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBSINIT=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h + + + + + + + if test $ac_cv_func_mbslen = yes; then + HAVE_MBSLEN=1 + else + HAVE_MBSLEN=0 + fi + + + + + + + GNULIB_MBSLEN=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBSLEN 1" >>confdefs.h + + + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else + gl_cv_func_mbrtowc_incomplete_state=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else + gl_cv_func_mbrtowc_sanitycheck=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_mbsrtowcs = no; then + HAVE_MBSRTOWCS=0 + ac_fn_c_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" " +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +" +if test "x$ac_cv_have_decl_mbsrtowcs" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_MBSRTOWCS $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_mbsrtowcs = yes; then + REPLACE_MBSRTOWCS=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSRTOWCS=1 + else + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5 +printf %s "checking whether mbsrtowcs works... " >&6; } +if test ${gl_cv_func_mbsrtowcs_works+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on HP-UX, Solaris, mingw. + hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbsrtowcs_works="guessing yes" ;; + esac + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + int result = 0; + /* Test whether the function supports a NULL destination argument. + This fails on native Windows. */ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + const char input[] = "\337er"; + const char *src = input; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbsrtowcs (NULL, &src, 1, &state) != 3 + || src != input) + result |= 1; + } + /* Test whether the function works when started with a conversion state + in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + const char input[] = "B\303\274\303\237er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + result |= 2; + } + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "<\306\374\313\334\270\354>"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 4; + if (mbsrtowcs (NULL, &src, 10, &state) != 3) + result |= 4; + } + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + const char input[] = "B\250\271\201\060\211\070er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + result |= 8; + } + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbsrtowcs_works=yes +else + gl_cv_func_mbsrtowcs_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5 +printf "%s\n" "$gl_cv_func_mbsrtowcs_works" >&6; } + + case "$gl_cv_func_mbsrtowcs_works" in + *yes) ;; + *) REPLACE_MBSRTOWCS=1 ;; + esac + fi + fi + + if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBSRTOWCS=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h + + + + + + + + + GNULIB_MBSSTR=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBSSTR 1" >>confdefs.h + + + + + + + if false; then + REPLACE_MBTOWC=1 + fi + + if test $REPLACE_MBTOWC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbtowc.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBTOWC=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBTOWC 1" >>confdefs.h + + + + + + : + + + if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext" + + + ac_fn_c_check_header_compile "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default" +if test "x$ac_cv_header_bp_sym_h" = xyes +then : + printf "%s\n" "#define HAVE_BP_SYM_H 1" >>confdefs.h + +fi + + + fi + + + + + + GNULIB_MEMCHR=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h + + + + + + + + + + + if test $ac_cv_func_mkstemp = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working mkstemp" >&5 +printf %s "checking for working mkstemp... " >&6; } +if test ${gl_cv_func_working_mkstemp+y} +then : + printf %s "(cached) " >&6 +else + + mkdir conftest.mkstemp + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_working_mkstemp="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_mkstemp="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ +int result = 0; + int i; + off_t large = (off_t) 4294967295u; + if (large < 0) + large = 2147483647; + umask (0); + for (i = 0; i < 70; i++) + { + char templ[] = "conftest.mkstemp/coXXXXXX"; + int (*mkstemp_function) (char *) = mkstemp; + int fd = mkstemp_function (templ); + if (fd < 0) + result |= 1; + else + { + struct stat st; + if (lseek (fd, large, SEEK_SET) != large) + result |= 2; + if (fstat (fd, &st) < 0) + result |= 4; + else if (st.st_mode & 0077) + result |= 8; + if (close (fd)) + result |= 16; + } + } + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_working_mkstemp=yes +else + gl_cv_func_working_mkstemp=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -rf conftest.mkstemp + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mkstemp" >&5 +printf "%s\n" "$gl_cv_func_working_mkstemp" >&6; } + case "$gl_cv_func_working_mkstemp" in + *yes) ;; + *) + REPLACE_MKSTEMP=1 + ;; + esac + else + HAVE_MKSTEMP=0 + fi + + if test $HAVE_MKSTEMP = 0 || test $REPLACE_MKSTEMP = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mkstemp.$ac_objext" + + + + fi + + + + + + GNULIB_MKSTEMP=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MKSTEMP 1" >>confdefs.h + + + + + + + + + REPLACE_MKTIME=0 + if test "$gl_cv_func_working_mktime" != yes; then + REPLACE_MKTIME=1 + +printf "%s\n" "#define NEED_MKTIME_WORKING 1" >>confdefs.h + + fi + case "$host_os" in + mingw*) + REPLACE_MKTIME=1 + +printf "%s\n" "#define NEED_MKTIME_WINDOWS 1" >>confdefs.h + + ;; + esac + + if test $REPLACE_MKTIME = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext" + + : + fi + + + + + + GNULIB_MKTIME=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MKTIME 1" >>confdefs.h + + + + + + + WANT_MKTIME_INTERNAL=0 + ac_fn_c_check_func "$LINENO" "__mktime_internal" "ac_cv_func___mktime_internal" +if test "x$ac_cv_func___mktime_internal" = xyes +then : + +printf "%s\n" "#define mktime_internal __mktime_internal" >>confdefs.h + + +else + WANT_MKTIME_INTERNAL=1 + +printf "%s\n" "#define NEED_MKTIME_INTERNAL 1" >>confdefs.h + + +fi + + + if test $WANT_MKTIME_INTERNAL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext" + + : + fi + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext" + + fi + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext" + + fi + + +printf "%s\n" "#define GNULIB_MSVC_NOTHROW 1" >>confdefs.h + + + + + + + + if test $ac_cv_func_nl_langinfo = yes; then + # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether YESEXPR works" >&5 +printf %s "checking whether YESEXPR works... " >&6; } +if test ${gl_cv_func_nl_langinfo_yesexpr_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on irix systems. + irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";; + # Guess yes elsewhere. + *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> + +int +main (void) +{ +return !*nl_langinfo(YESEXPR); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_nl_langinfo_yesexpr_works=yes +else + gl_cv_func_nl_langinfo_yesexpr_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nl_langinfo_yesexpr_works" >&5 +printf "%s\n" "$gl_cv_func_nl_langinfo_yesexpr_works" >&6; } + case $gl_cv_func_nl_langinfo_yesexpr_works in + *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;; + *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;; + esac + +printf "%s\n" "#define FUNC_NL_LANGINFO_YESEXPR_WORKS $FUNC_NL_LANGINFO_YESEXPR_WORKS" >>confdefs.h + + if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \ + && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then + : + else + REPLACE_NL_LANGINFO=1 + +printf "%s\n" "#define REPLACE_NL_LANGINFO 1" >>confdefs.h + + fi + else + HAVE_NL_LANGINFO=0 + fi + + if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS nl_langinfo.$ac_objext" + + fi + + + + + + GNULIB_NL_LANGINFO=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_NL_LANGINFO 1" >>confdefs.h + + + + + + case "$host_os" in + mingw* | pw*) + REPLACE_OPEN=1 + ;; + *) + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5 +printf %s "checking whether open recognizes a trailing slash... " >&6; } +if test ${gl_cv_func_open_slash+y} +then : + printf %s "(cached) " >&6 +else + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + touch conftest.tmp + ln -s conftest.tmp conftest.lnk + fi + if test "$cross_compiling" = yes +then : + + case "$host_os" in + freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*) + gl_cv_func_open_slash="guessing no" ;; + *) + gl_cv_func_open_slash="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <fcntl.h> +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +int main () +{ + int result = 0; +#if HAVE_LSTAT + if (open ("conftest.lnk/", O_RDONLY) != -1) + result |= 1; +#endif + if (open ("conftest.sl/", O_CREAT, 0600) >= 0) + result |= 2; + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_open_slash=yes +else + gl_cv_func_open_slash=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.sl conftest.tmp conftest.lnk + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5 +printf "%s\n" "$gl_cv_func_open_slash" >&6; } + case "$gl_cv_func_open_slash" in + *no) + +printf "%s\n" "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h + + REPLACE_OPEN=1 + ;; + esac + ;; + esac + + + + if test $REPLACE_OPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext" + + + + : + + fi + + + + + + GNULIB_OPEN=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_OPEN 1" >>confdefs.h + + + + + + + ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h> +" +if test "x$ac_cv_have_decl_program_invocation_name" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl" >>confdefs.h + + ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h> +" +if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl" >>confdefs.h + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"'" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"'" + + + : + + + : + + + + + ac_fn_c_check_func "$LINENO" "raise" "ac_cv_func_raise" +if test "x$ac_cv_func_raise" = xyes +then : + printf "%s\n" "#define HAVE_RAISE 1" >>confdefs.h + +fi + + if test $ac_cv_func_raise = no; then + HAVE_RAISE=0 + else + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_RAISE=1 + fi + + + + + + if test $gl_cv_type_sigset_t = yes; then + ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" +if test "x$ac_cv_func_sigprocmask" = xyes +then : + gl_cv_func_sigprocmask=1 +fi + + fi + if test -z "$gl_cv_func_sigprocmask"; then + HAVE_POSIX_SIGNALBLOCKING=0 + fi + + if test $HAVE_POSIX_SIGNALBLOCKING = 0; then + : + fi + + fi + + if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS raise.$ac_objext" + + : + fi + + + + + + GNULIB_RAISE=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_RAISE 1" >>confdefs.h + + + + + + + + ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr" +if test "x$ac_cv_func_rawmemchr" = xyes +then : + printf "%s\n" "#define HAVE_RAWMEMCHR 1" >>confdefs.h + +fi + + if test $ac_cv_func_rawmemchr = no; then + HAVE_RAWMEMCHR=0 + fi + + if test $HAVE_RAWMEMCHR = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext" + + : + fi + + + + + + GNULIB_RAWMEMCHR=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h + + + + + + + if test $ac_cv_func_readlink = no; then + HAVE_READLINK=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5 +printf %s "checking whether readlink signature is correct... " >&6; } +if test ${gl_cv_decl_readlink_works+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> + /* Cause compilation failure if original declaration has wrong type. */ + ssize_t readlink (const char *, char *, size_t); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_readlink_works=yes +else + gl_cv_decl_readlink_works=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5 +printf "%s\n" "$gl_cv_decl_readlink_works" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5 +printf %s "checking whether readlink handles trailing slash correctly... " >&6; } +if test ${gl_cv_func_readlink_works+y} +then : + printf %s "(cached) " >&6 +else + # We have readlink, so assume ln -s works. + ln -s conftest.no-such conftest.link + ln -s conftest.link conftest.lnk2 + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_readlink_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_readlink_works="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> + +int +main (void) +{ +char buf[20]; + return readlink ("conftest.lnk2/", buf, sizeof buf) != -1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_readlink_works=yes +else + gl_cv_func_readlink_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.link conftest.lnk2 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_works" >&5 +printf "%s\n" "$gl_cv_func_readlink_works" >&6; } + case "$gl_cv_func_readlink_works" in + *yes) + if test "$gl_cv_decl_readlink_works" != yes; then + REPLACE_READLINK=1 + fi + ;; + *) + +printf "%s\n" "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h + + REPLACE_READLINK=1 + ;; + esac + fi + + if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext" + + + : + + fi + + + + + + GNULIB_READLINK=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_READLINK 1" >>confdefs.h + + + + + +# Check whether --with-included-regex was given. +if test ${with_included_regex+y} +then : + withval=$with_included_regex; +fi + + + case $with_included_regex in #( + yes|no) ac_use_included_regex=$with_included_regex + ;; + '') + # If the system regex support is good enough that it passes the + # following run test, then default to *not* using the included regex.c. + # If cross compiling, assume the test would fail and use the included + # regex.c. + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working re_compile_pattern" >&5 +printf %s "checking for working re_compile_pattern... " >&6; } +if test ${gl_cv_func_re_compile_pattern_working+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + gl_cv_func_re_compile_pattern_working=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <regex.h> + + #include <locale.h> + #include <limits.h> + #include <string.h> + + #if defined M_CHECK_ACTION || HAVE_DECL_ALARM + # include <signal.h> + # include <unistd.h> + #endif + + #if HAVE_MALLOC_H + # include <malloc.h> + #endif + + #ifdef M_CHECK_ACTION + /* Exit with distinguishable exit code. */ + static void sigabrt_no_core (int sig) { raise (SIGTERM); } + #endif + +int +main (void) +{ +int result = 0; + static struct re_pattern_buffer regex; + unsigned char folded_chars[UCHAR_MAX + 1]; + int i; + const char *s; + struct re_registers regs; + + /* Some builds of glibc go into an infinite loop on this + test. Use alarm to force death, and mallopt to avoid + malloc recursion in diagnosing the corrupted heap. */ +#if HAVE_DECL_ALARM + signal (SIGALRM, SIG_DFL); + alarm (2); +#endif +#ifdef M_CHECK_ACTION + signal (SIGABRT, sigabrt_no_core); + mallopt (M_CHECK_ACTION, 2); +#endif + + if (setlocale (LC_ALL, "en_US.UTF-8")) + { + { + /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html + This test needs valgrind to catch the bug on Debian + GNU/Linux 3.1 x86, but it might catch the bug better + on other platforms and it shouldn't hurt to try the + test here. */ + static char const pat[] = "insert into"; + static char const data[] = + "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK"; + re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE + | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else if (re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, ®s) + != -1) + result |= 1; + regfree (®ex); + } + + { + /* This test is from glibc bug 15078. + The test case is from Andreas Schwab in + <http://www.sourceware.org/ml/libc-alpha/2013-01/msg00967.html>. + */ + static char const pat[] = "[^x]x"; + static char const data[] = + /* <U1000><U103B><U103D><U1014><U103A><U102F><U1015><U103A> */ + "\xe1\x80\x80" + "\xe1\x80\xbb" + "\xe1\x80\xbd" + "\xe1\x80\x94" + "\xe1\x80\xba" + "\xe1\x80\xaf" + "\xe1\x80\x95" + "\xe1\x80\xba" + "x"; + re_set_syntax (0); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else + { + i = re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, 0); + if (i != 0 && i != 21) + result |= 1; + } + regfree (®ex); + } + + if (! setlocale (LC_ALL, "C")) + return 1; + } + + /* This test is from glibc bug 3957, reported by Andrew Mackey. */ + re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[^x]b", 6, ®ex); + if (s) + result |= 2; + /* This should fail, but succeeds for glibc-2.5. */ + else if (re_search (®ex, "a\nb", 3, 0, 3, ®s) != -1) + result |= 2; + + /* This regular expression is from Spencer ere test number 75 + in grep-2.3. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP); + memset (®ex, 0, sizeof regex); + for (i = 0; i <= UCHAR_MAX; i++) + folded_chars[i] = i; + regex.translate = folded_chars; + s = re_compile_pattern ("a[[:]:]]b\n", 11, ®ex); + /* This should fail with _Invalid character class name_ error. */ + if (!s) + result |= 4; + + /* Ensure that [b-a] is diagnosed as invalid, when + using RE_NO_EMPTY_RANGES. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[b-a]", 6, ®ex); + if (s == 0) + result |= 8; + + /* This should succeed, but does not for glibc-2.1.3. */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("{1", 2, ®ex); + if (s) + result |= 8; + + /* The following example is derived from a problem report + against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[an\371]*n", 7, ®ex); + if (s) + result |= 8; + /* This should match, but does not for glibc-2.2.1. */ + else if (re_match (®ex, "an", 2, 0, ®s) != 2) + result |= 8; + + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 8; + /* glibc-2.2.93 does not work with a negative RANGE argument. */ + else if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1) + result |= 8; + + /* The version of regex.c in older versions of gnulib + ignored RE_ICASE. Detect that problem too. */ + re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 16; + else if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0) + result |= 16; + + /* Catch a bug reported by Vin Shelton in + http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html + */ + re_set_syntax (RE_SYNTAX_POSIX_BASIC + & ~RE_CONTEXT_INVALID_DUP + & ~RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, ®ex); + if (s) + result |= 32; + + /* REG_STARTEND was added to glibc on 2004-01-15. + Reject older versions. */ + if (! REG_STARTEND) + result |= 64; + +#if 0 + /* It would be nice to reject hosts whose regoff_t values are too + narrow (including glibc on hosts with 64-bit ptrdiff_t and + 32-bit int), but we should wait until glibc implements this + feature. Otherwise, support for equivalence classes and + multibyte collation symbols would always be broken except + when compiling --without-included-regex. */ + if (sizeof (regoff_t) < sizeof (ptrdiff_t) + || sizeof (regoff_t) < sizeof (ssize_t)) + result |= 64; +#endif + + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_re_compile_pattern_working=yes +else + gl_cv_func_re_compile_pattern_working=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_re_compile_pattern_working" >&5 +printf "%s\n" "$gl_cv_func_re_compile_pattern_working" >&6; } + case $gl_cv_func_re_compile_pattern_working in #( + yes) ac_use_included_regex=no;; #( + no) ac_use_included_regex=yes;; + esac + ;; + *) as_fn_error $? "Invalid value for --with-included-regex: $with_included_regex" "$LINENO" 5 + ;; + esac + + if test $ac_use_included_regex = yes; then + +printf "%s\n" "#define _REGEX_INCLUDE_LIMITS_H 1" >>confdefs.h + + +printf "%s\n" "#define _REGEX_LARGE_OFFSETS 1" >>confdefs.h + + +printf "%s\n" "#define re_syntax_options rpl_re_syntax_options" >>confdefs.h + + +printf "%s\n" "#define re_set_syntax rpl_re_set_syntax" >>confdefs.h + + +printf "%s\n" "#define re_compile_pattern rpl_re_compile_pattern" >>confdefs.h + + +printf "%s\n" "#define re_compile_fastmap rpl_re_compile_fastmap" >>confdefs.h + + +printf "%s\n" "#define re_search rpl_re_search" >>confdefs.h + + +printf "%s\n" "#define re_search_2 rpl_re_search_2" >>confdefs.h + + +printf "%s\n" "#define re_match rpl_re_match" >>confdefs.h + + +printf "%s\n" "#define re_match_2 rpl_re_match_2" >>confdefs.h + + +printf "%s\n" "#define re_set_registers rpl_re_set_registers" >>confdefs.h + + +printf "%s\n" "#define re_comp rpl_re_comp" >>confdefs.h + + +printf "%s\n" "#define re_exec rpl_re_exec" >>confdefs.h + + +printf "%s\n" "#define regcomp rpl_regcomp" >>confdefs.h + + +printf "%s\n" "#define regexec rpl_regexec" >>confdefs.h + + +printf "%s\n" "#define regerror rpl_regerror" >>confdefs.h + + +printf "%s\n" "#define regfree rpl_regfree" >>confdefs.h + + fi + + if test $ac_use_included_regex = yes; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS regex.$ac_objext" + + + + + + + + + ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBINTL_H 1" >>confdefs.h + +fi + + + ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h> +" +if test "x$ac_cv_have_decl_isblank" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h + + + fi + + + + + + if test $ac_cv_func_secure_getenv = no; then + HAVE_SECURE_GETENV=0 + fi + + if test $HAVE_SECURE_GETENV = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS secure_getenv.$ac_objext" + + + ac_fn_c_check_func "$LINENO" "__secure_getenv" "ac_cv_func___secure_getenv" +if test "x$ac_cv_func___secure_getenv" = xyes +then : + printf "%s\n" "#define HAVE___SECURE_GETENV 1" >>confdefs.h + +fi + + if test $ac_cv_func___secure_getenv = no; then + ac_fn_c_check_func "$LINENO" "issetugid" "ac_cv_func_issetugid" +if test "x$ac_cv_func_issetugid" = xyes +then : + printf "%s\n" "#define HAVE_ISSETUGID 1" >>confdefs.h + +fi + + fi + + + fi + + + + + + GNULIB_SECURE_GETENV=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_SECURE_GETENV 1" >>confdefs.h + + + + + + if test $ac_cv_func_setenv = no; then + HAVE_SETENV=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5 +printf %s "checking whether setenv validates arguments... " >&6; } +if test ${gl_cv_func_setenv_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_setenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_setenv_works="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <stdlib.h> + #include <errno.h> + #include <string.h> + +int +main (void) +{ + + int result = 0; + { + if (setenv ("", "", 0) != -1) + result |= 1; + else if (errno != EINVAL) + result |= 2; + } + { + if (setenv ("a", "=", 1) != 0) + result |= 4; + else if (strcmp (getenv ("a"), "=") != 0) + result |= 8; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_setenv_works=yes +else + gl_cv_func_setenv_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5 +printf "%s\n" "$gl_cv_func_setenv_works" >&6; } + case "$gl_cv_func_setenv_works" in + *yes) ;; + *) + REPLACE_SETENV=1 + ;; + esac + fi + + if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext" + + fi + + + + + + GNULIB_SETENV=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_SETENV 1" >>confdefs.h + + + + + + + if test $ac_cv_func_sigaction = yes; then + ac_fn_c_check_member "$LINENO" "struct sigaction" "sa_sigaction" "ac_cv_member_struct_sigaction_sa_sigaction" "#include <signal.h> +" +if test "x$ac_cv_member_struct_sigaction_sa_sigaction" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1" >>confdefs.h + + +fi + + if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then + HAVE_STRUCT_SIGACTION_SA_SIGACTION=0 + fi + else + HAVE_SIGACTION=0 + fi + + if test $HAVE_SIGACTION = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS sigaction.$ac_objext" + + + + + + + + ac_fn_c_check_type "$LINENO" "siginfo_t" "ac_cv_type_siginfo_t" " +#include <signal.h> + +" +if test "x$ac_cv_type_siginfo_t" = xyes +then : + +printf "%s\n" "#define HAVE_SIGINFO_T 1" >>confdefs.h + + +fi + + if test $ac_cv_type_siginfo_t = no; then + HAVE_SIGINFO_T=0 + fi + + fi + + + + + + GNULIB_SIGACTION=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_SIGACTION 1" >>confdefs.h + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_signal_h='<'signal.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5 +printf %s "checking absolute name of <signal.h>... " >&6; } +if test ${gl_cv_next_signal_h+y} +then : + printf %s "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <signal.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'signal.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_signal_h + gl_cv_next_signal_h='"'$gl_header'"' + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5 +printf "%s\n" "$gl_cv_next_signal_h" >&6; } + fi + NEXT_SIGNAL_H=$gl_cv_next_signal_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'signal.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_signal_h + fi + NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive + + + + + +# AIX declares sig_atomic_t to already include volatile, and C89 compilers +# then choke on 'volatile sig_atomic_t'. C99 requires that it compile. + ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" " +#include <signal.h> + +" +if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes +then : + +else + HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0 +fi + + + + + + + + ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" " +#include <signal.h> + +" +if test "x$ac_cv_type_sighandler_t" = xyes +then : + +else + HAVE_SIGHANDLER_T=0 +fi + + + + for gl_func in pthread_sigmask sigaction sigaddset sigdelset sigemptyset sigfillset sigismember sigpending sigprocmask; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <signal.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + if test $gl_cv_type_sigset_t = yes; then + ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" +if test "x$ac_cv_func_sigprocmask" = xyes +then : + gl_cv_func_sigprocmask=1 +fi + + fi + if test -z "$gl_cv_func_sigprocmask"; then + HAVE_POSIX_SIGNALBLOCKING=0 + fi + + if test $HAVE_POSIX_SIGNALBLOCKING = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS sigprocmask.$ac_objext" + + : + fi + + + + + + GNULIB_SIGPROCMASK=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_SIGPROCMASK 1" >>confdefs.h + + + + + ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "#define HAVE_STDINT_H 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5 +printf %s "checking for SIZE_MAX... " >&6; } +if test ${gl_cv_size_max+y} +then : + printf %s "(cached) " >&6 +else + + gl_cv_size_max= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <limits.h> +#if HAVE_STDINT_H +#include <stdint.h> +#endif +#ifdef SIZE_MAX +Found it +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Found it" >/dev/null 2>&1 +then : + gl_cv_size_max=yes +fi +rm -rf conftest* + + if test -z "$gl_cv_size_max"; then + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) * CHAR_BIT - 1" "size_t_bits_minus_1" "#include <stddef.h> +#include <limits.h>" +then : + +else + size_t_bits_minus_1= +fi + + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint" "#include <stddef.h>" +then : + +else + fits_in_uint= +fi + + if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then + if test $fits_in_uint = 1; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> + extern size_t foo; + extern unsigned long foo; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + fits_in_uint=0 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $fits_in_uint = 1; then + gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" + else + gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" + fi + else + gl_cv_size_max='((size_t)~(size_t)0)' + fi + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5 +printf "%s\n" "$gl_cv_size_max" >&6; } + if test "$gl_cv_size_max" != yes; then + +printf "%s\n" "#define SIZE_MAX $gl_cv_size_max" >>confdefs.h + + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 +printf %s "checking for ssize_t... " >&6; } +if test ${gt_cv_ssize_t+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +int +main (void) +{ +int x = sizeof (ssize_t *) + sizeof (ssize_t); + return !x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_ssize_t=yes +else + gt_cv_ssize_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5 +printf "%s\n" "$gt_cv_ssize_t" >&6; } + if test $gt_cv_ssize_t = no; then + +printf "%s\n" "#define ssize_t int" >>confdefs.h + + fi + + + + + + case "$host_os" in + mingw*) + REPLACE_STAT=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5 +printf %s "checking whether stat handles trailing slashes on files... " >&6; } +if test ${gl_cv_func_stat_file_slash+y} +then : + printf %s "(cached) " >&6 +else + touch conftest.tmp + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + ln -s conftest.tmp conftest.lnk + fi + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_stat_file_slash="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> + +int +main (void) +{ +int result = 0; + struct stat st; + if (!stat ("conftest.tmp/", &st)) + result |= 1; +#if HAVE_LSTAT + if (!stat ("conftest.lnk/", &st)) + result |= 2; +#endif + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_stat_file_slash=yes +else + gl_cv_func_stat_file_slash=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.tmp conftest.lnk +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5 +printf "%s\n" "$gl_cv_func_stat_file_slash" >&6; } + case $gl_cv_func_stat_file_slash in + *no) + REPLACE_STAT=1 + +printf "%s\n" "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h +;; + esac + ;; + esac + + if test $REPLACE_STAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" + + + + : + + fi + + + + + + GNULIB_STAT=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_STAT 1" >>confdefs.h + + + + + + + + ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1" >>confdefs.h + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5 +printf %s "checking whether struct stat.st_atim is of type struct timespec... " >&6; } +if test ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <sys/types.h> + #include <sys/stat.h> + #if HAVE_SYS_TIME_H + # include <sys/time.h> + #endif + #include <time.h> + struct timespec ts; + struct stat st; + +int +main (void) +{ + + st.st_atim = ts; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes +else + ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5 +printf "%s\n" "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; } + if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then + +printf "%s\n" "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h + + fi +else + ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1" >>confdefs.h + + +else + ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1" >>confdefs.h + + +else + ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1" >>confdefs.h + + +fi + +fi + +fi + +fi + + + + + + ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1" >>confdefs.h + + +else + ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1" >>confdefs.h + + +else + ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtim.tv_nsec" "ac_cv_member_struct_stat_st_birthtim_tv_nsec" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1" >>confdefs.h + + +fi + +fi + +fi + + + + STDARG_H='' + NEXT_STDARG_H='<stdarg.h>' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 +printf %s "checking for va_copy... " >&6; } + if test ${gl_cv_func_va_copy+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +int +main (void) +{ + +#ifndef va_copy +void (*func) (va_list, va_list) = va_copy; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_va_copy=yes +else + gl_cv_func_va_copy=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_va_copy" >&5 +printf "%s\n" "$gl_cv_func_va_copy" >&6; } + if test $gl_cv_func_va_copy = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined _AIX && !defined __GNUC__ + AIX vaccine + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "vaccine" >/dev/null 2>&1 +then : + gl_aixcc=yes +else + gl_aixcc=no +fi +rm -rf conftest* + + if test $gl_aixcc = yes; then + STDARG_H=stdarg.h + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdarg_h='<'stdarg.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdarg.h>" >&5 +printf %s "checking absolute name of <stdarg.h>... " >&6; } +if test ${gl_cv_next_stdarg_h+y} +then : + printf %s "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdarg.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdarg_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdarg_h + gl_cv_next_stdarg_h='"'$gl_header'"' + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdarg_h" >&5 +printf "%s\n" "$gl_cv_next_stdarg_h" >&6; } + fi + NEXT_STDARG_H=$gl_cv_next_stdarg_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdarg.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdarg_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDARG_H=$gl_next_as_first_directive + + + + + if test "$gl_cv_next_stdarg_h" = '""'; then + gl_cv_next_stdarg_h='"///usr/include/stdarg.h"' + NEXT_STDARG_H="$gl_cv_next_stdarg_h" + fi + else + + saved_as_echo_n="$as_echo_n" + as_echo_n=':' + if test ${gl_cv_func___va_copy+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +int +main (void) +{ + +#ifndef __va_copy +error, bail out +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func___va_copy=yes +else + gl_cv_func___va_copy=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + as_echo_n="$saved_as_echo_n" + + if test $gl_cv_func___va_copy = yes; then + +printf "%s\n" "#define va_copy __va_copy" >>confdefs.h + + else + + +printf "%s\n" "#define va_copy gl_va_copy" >>confdefs.h + + fi + fi + fi + + if test -n "$STDARG_H"; then + GL_GENERATE_STDARG_H_TRUE= + GL_GENERATE_STDARG_H_FALSE='#' +else + GL_GENERATE_STDARG_H_TRUE='#' + GL_GENERATE_STDARG_H_FALSE= +fi + + + + + + + # Define two additional variables used in the Makefile substitution. + + if test "$ac_cv_header_stdbool_h" = yes; then + STDBOOL_H='' + else + STDBOOL_H='stdbool.h' + fi + + if test -n "$STDBOOL_H"; then + GL_GENERATE_STDBOOL_H_TRUE= + GL_GENERATE_STDBOOL_H_FALSE='#' +else + GL_GENERATE_STDBOOL_H_TRUE='#' + GL_GENERATE_STDBOOL_H_FALSE= +fi + + + if test "$ac_cv_type__Bool" = yes; then + HAVE__BOOL=1 + else + HAVE__BOOL=0 + fi + + + + + + STDDEF_H= + ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include <stddef.h> + +" +if test "x$ac_cv_type_max_align_t" = xyes +then : + +else + HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h +fi + + if test $gt_cv_c_wchar_t = no; then + HAVE_WCHAR_T=0 + STDDEF_H=stddef.h + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 +printf %s "checking whether NULL can be used in arbitrary expressions... " >&6; } +if test ${gl_cv_decl_null_works+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> + int test[2 * (sizeof NULL == sizeof (void *)) -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_null_works=yes +else + gl_cv_decl_null_works=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 +printf "%s\n" "$gl_cv_decl_null_works" >&6; } + if test $gl_cv_decl_null_works = no; then + REPLACE_NULL=1 + STDDEF_H=stddef.h + fi + + if test -n "$STDDEF_H"; then + GL_GENERATE_STDDEF_H_TRUE= + GL_GENERATE_STDDEF_H_FALSE='#' +else + GL_GENERATE_STDDEF_H_TRUE='#' + GL_GENERATE_STDDEF_H_FALSE= +fi + + if test -n "$STDDEF_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stddef_h='<'stddef.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5 +printf %s "checking absolute name of <stddef.h>... " >&6; } +if test ${gl_cv_next_stddef_h+y} +then : + printf %s "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stddef.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stddef_h + gl_cv_next_stddef_h='"'$gl_header'"' + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 +printf "%s\n" "$gl_cv_next_stddef_h" >&6; } + fi + NEXT_STDDEF_H=$gl_cv_next_stddef_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stddef.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stddef_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive + + + + + fi + + + + + printf "%s\n" "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdio_h='<'stdio.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5 +printf %s "checking absolute name of <stdio.h>... " >&6; } +if test ${gl_cv_next_stdio_h+y} +then : + printf %s "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdio.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdio_h + gl_cv_next_stdio_h='"'$gl_header'"' + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5 +printf "%s\n" "$gl_cv_next_stdio_h" >&6; } + fi + NEXT_STDIO_H=$gl_cv_next_stdio_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdio.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdio_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5 +printf %s "checking which flavor of printf attribute matches inttypes macros... " >&6; } +if test ${gl_cv_func_printf_attribute_flavor+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define __STDC_FORMAT_MACROS 1 + #include <stdio.h> + #include <inttypes.h> + /* For non-mingw systems, compilation will trivially succeed. + For mingw, compilation will succeed for older mingw (system + printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */ + #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_printf_attribute_flavor=system +else + gl_cv_func_printf_attribute_flavor=gnu +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5 +printf "%s\n" "$gl_cv_func_printf_attribute_flavor" >&6; } + if test "$gl_cv_func_printf_attribute_flavor" = gnu; then + +printf "%s\n" "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h + + fi + + GNULIB_FSCANF=1 + + +printf "%s\n" "#define GNULIB_FSCANF 1" >>confdefs.h + + + GNULIB_SCANF=1 + + +printf "%s\n" "#define GNULIB_SCANF 1" >>confdefs.h + + + GNULIB_FGETC=1 + GNULIB_GETC=1 + GNULIB_GETCHAR=1 + GNULIB_FGETS=1 + GNULIB_FREAD=1 + + + GNULIB_FPRINTF=1 + GNULIB_PRINTF=1 + GNULIB_VFPRINTF=1 + GNULIB_VPRINTF=1 + GNULIB_FPUTC=1 + GNULIB_PUTC=1 + GNULIB_PUTCHAR=1 + GNULIB_FPUTS=1 + GNULIB_PUTS=1 + GNULIB_FWRITE=1 + + + + + for gl_func in dprintf fpurge fseeko ftello getdelim getline gets pclose popen renameat snprintf tmpfile vdprintf vsnprintf; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdlib_h='<'stdlib.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5 +printf %s "checking absolute name of <stdlib.h>... " >&6; } +if test ${gl_cv_next_stdlib_h+y} +then : + printf %s "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdlib.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdlib_h + gl_cv_next_stdlib_h='"'$gl_header'"' + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5 +printf "%s\n" "$gl_cv_next_stdlib_h" >&6; } + fi + NEXT_STDLIB_H=$gl_cv_next_stdlib_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdlib.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdlib_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive + + + + + + + for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#if HAVE_SYS_LOADAVG_H +# include <sys/loadavg.h> +#endif +#if HAVE_RANDOM_H +# include <random.h> +#endif + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" +if test "x$ac_cv_func_strcasecmp" = xyes +then : + printf "%s\n" "#define HAVE_STRCASECMP 1" >>confdefs.h + +fi + + if test $ac_cv_func_strcasecmp = no; then + HAVE_STRCASECMP=0 + fi + + + + ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" +if test "x$ac_cv_func_strncasecmp" = xyes +then : + printf "%s\n" "#define HAVE_STRNCASECMP 1" >>confdefs.h + +fi + + if test $ac_cv_func_strncasecmp = yes; then + HAVE_STRNCASECMP=1 + else + HAVE_STRNCASECMP=0 + fi + ac_fn_c_check_decl "$LINENO" "strncasecmp" "ac_cv_have_decl_strncasecmp" "$ac_includes_default" +if test "x$ac_cv_have_decl_strncasecmp" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_STRNCASECMP $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_strncasecmp = no; then + HAVE_DECL_STRNCASECMP=0 + fi + + + if test $HAVE_STRCASECMP = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strcasecmp.$ac_objext" + + + : + + fi + if test $HAVE_STRNCASECMP = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strncasecmp.$ac_objext" + + + : + + fi + + + + + + + + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5 +printf %s "checking for working strerror function... " >&6; } +if test ${gl_cv_func_working_strerror+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_working_strerror="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_strerror="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + +int +main (void) +{ +if (!*strerror (-2)) return 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_working_strerror=yes +else + gl_cv_func_working_strerror=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5 +printf "%s\n" "$gl_cv_func_working_strerror" >&6; } + case "$gl_cv_func_working_strerror" in + *yes) ;; + *) + REPLACE_STRERROR=1 + ;; + esac + + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR=1 ;; + esac + + else + REPLACE_STRERROR=1 + fi + + if test $REPLACE_STRERROR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext" + + fi + + +printf "%s\n" "#define GNULIB_STRERROR 1" >>confdefs.h + + + + + + + + GNULIB_STRERROR=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_STRERROR 1" >>confdefs.h + + + + + + if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext" + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + fi + + # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE. + + + + + + + +printf "%s\n" "#define my_strftime nstrftime" >>confdefs.h + + + if test $gl_cond_libtool = false; then + gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV" + gl_libdeps="$gl_libdeps $LIBICONV" + fi + + + + + + + + + + + + + if test $ac_cv_have_decl_strndup = no; then + HAVE_DECL_STRNDUP=0 + fi + + if test $ac_cv_func_strndup = yes; then + HAVE_STRNDUP=1 + # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strndup" >&5 +printf %s "checking for working strndup... " >&6; } +if test ${gl_cv_func_strndup_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + + case $host_os in + aix | aix[3-6]*) gl_cv_func_strndup_works="guessing no";; + *) gl_cv_func_strndup_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <string.h> + #include <stdlib.h> +int +main (void) +{ + +#if !HAVE_DECL_STRNDUP + extern + #ifdef __cplusplus + "C" + #endif + char *strndup (const char *, size_t); +#endif + int result; + char *s; + s = strndup ("some longer string", 15); + free (s); + s = strndup ("shorter string", 13); + result = s[13] != '\0'; + free (s); + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strndup_works=yes +else + gl_cv_func_strndup_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strndup_works" >&5 +printf "%s\n" "$gl_cv_func_strndup_works" >&6; } + case $gl_cv_func_strndup_works in + *no) REPLACE_STRNDUP=1 ;; + esac + else + HAVE_STRNDUP=0 + fi + + if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strndup.$ac_objext" + + fi + + + + + + GNULIB_STRNDUP=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_STRNDUP 1" >>confdefs.h + + + + + + + + + + if test $ac_cv_have_decl_strnlen = no; then + HAVE_DECL_STRNLEN=0 + else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5 +printf %s "checking for working strnlen... " >&6; } +if test ${ac_cv_func_strnlen_working+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + # Guess no on AIX systems, yes otherwise. + case "$host_os" in + aix*) ac_cv_func_strnlen_working=no;; + *) ac_cv_func_strnlen_working=yes;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + +#define S "foobar" +#define S_LEN (sizeof S - 1) + + /* At least one implementation is buggy: that of AIX 4.3 would + give strnlen (S, 1) == 3. */ + + int i; + for (i = 0; i < S_LEN + 1; ++i) + { + int expected = i <= S_LEN ? i : S_LEN; + if (strnlen (S, i) != expected) + return 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_strnlen_working=yes +else + ac_cv_func_strnlen_working=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5 +printf "%s\n" "$ac_cv_func_strnlen_working" >&6; } +test $ac_cv_func_strnlen_working = no && : + + + if test $ac_cv_func_strnlen_working = no; then + REPLACE_STRNLEN=1 + fi + fi + + if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext" + + : + fi + + + + + + GNULIB_STRNLEN=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_STRNLEN 1" >>confdefs.h + + + + + + + + if test $ac_cv_func_strptime != yes; then + HAVE_STRPTIME=0 + fi + + if test $HAVE_STRPTIME = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strptime.$ac_objext" + + + + : + + fi + + + + + + GNULIB_STRPTIME=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_STRPTIME 1" >>confdefs.h + + + + + + + if test "$ac_cv_type_unsigned_long_long_int" = yes; then + ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull" +if test "x$ac_cv_func_strtoull" = xyes +then : + printf "%s\n" "#define HAVE_STRTOULL 1" >>confdefs.h + +fi + + if test $ac_cv_func_strtoull = no; then + HAVE_STRTOULL=0 + fi + fi + + if test $HAVE_STRTOULL = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strtoull.$ac_objext" + + + : + + fi + + + + + + GNULIB_STRTOULL=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_STRTOULL 1" >>confdefs.h + + + + + + + + + if test "$ac_cv_have_decl_strtoumax" = yes; then + if test "$ac_cv_func_strtoumax" != yes; then + # HP-UX 11.11 has "#define strtoimax(...) ..." but no function. + REPLACE_STRTOUMAX=1 + fi + else + HAVE_DECL_STRTOUMAX=0 + fi + + if test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strtoumax.$ac_objext" + + + ac_fn_c_check_decl "$LINENO" "strtoull" "ac_cv_have_decl_strtoull" "$ac_includes_default" +if test "x$ac_cv_have_decl_strtoull" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_STRTOULL $ac_have_decl" >>confdefs.h + + + + fi + + + + + + GNULIB_STRTOUMAX=1 + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5 +printf %s "checking absolute name of <sys/stat.h>... " >&6; } +if test ${gl_cv_next_sys_stat_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_sys_stat_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/stat.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_stat_h + gl_cv_next_sys_stat_h='"'$gl_header'"' + else + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 +printf "%s\n" "$gl_cv_next_sys_stat_h" >&6; } + fi + NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/stat.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_stat_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive + + + + + + + + + WINDOWS_STAT_TIMESPEC=0 + + + + + + + + + ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_type_nlink_t" = xyes +then : + +else + +printf "%s\n" "#define nlink_t int" >>confdefs.h + +fi + + + + for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_wait_h='<'sys/wait.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/wait.h>" >&5 +printf %s "checking absolute name of <sys/wait.h>... " >&6; } +if test ${gl_cv_next_sys_wait_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_sys_wait_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/wait.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/wait.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_wait_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_wait_h + gl_cv_next_sys_wait_h='"'$gl_header'"' + else + gl_cv_next_sys_wait_h='<'sys/wait.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_wait_h" >&5 +printf "%s\n" "$gl_cv_next_sys_wait_h" >&6; } + fi + NEXT_SYS_WAIT_H=$gl_cv_next_sys_wait_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/wait.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_wait_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H=$gl_next_as_first_directive + + + + + + + + + for gl_func in waitpid; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/wait.h> +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + : + + + + + + + + + + + + ac_fn_c_check_decl "$LINENO" "localtime_r" "ac_cv_have_decl_localtime_r" "#include <time.h> +" +if test "x$ac_cv_have_decl_localtime_r" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_LOCALTIME_R $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_localtime_r = no; then + HAVE_DECL_LOCALTIME_R=0 + fi + + + if test $ac_cv_func_localtime_r = yes; then + HAVE_LOCALTIME_R=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5 +printf %s "checking whether localtime_r is compatible with its POSIX signature... " >&6; } +if test ${gl_cv_time_r_posix+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <time.h> +int +main (void) +{ +/* We don't need to append 'restrict's to the argument types, + even though the POSIX signature has the 'restrict's, + since C99 says they can't affect type compatibility. */ + struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r; + if (ptr) return 0; + /* Check the return type is a pointer. + On HP-UX 10 it is 'int'. */ + *localtime_r (0, 0); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_time_r_posix=yes +else + gl_cv_time_r_posix=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5 +printf "%s\n" "$gl_cv_time_r_posix" >&6; } + if test $gl_cv_time_r_posix = yes; then + REPLACE_LOCALTIME_R=0 + else + REPLACE_LOCALTIME_R=1 + fi + else + HAVE_LOCALTIME_R=0 + fi + + if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext" + + + : + + fi + + + + + + GNULIB_TIME_R=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_TIME_R 1" >>confdefs.h + + + + + + + + + ac_fn_c_check_type "$LINENO" "timezone_t" "ac_cv_type_timezone_t" "#include <time.h> +" +if test "x$ac_cv_type_timezone_t" = xyes +then : + +printf "%s\n" "#define HAVE_TIMEZONE_T 1" >>confdefs.h + + +fi + + if test "$ac_cv_type_timezone_t" = yes; then + HAVE_TIMEZONE_T=1 + fi + + if test $HAVE_TIMEZONE_T = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS time_rz.$ac_objext" + + fi + + + + + + GNULIB_TIME_RZ=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_TIME_RZ 1" >>confdefs.h + + + + + + + REPLACE_TIMEGM=0 + + if test $ac_cv_func_timegm = yes; then + if test "$gl_cv_func_working_mktime" != yes; then + # Assume that timegm is buggy if mktime is. + REPLACE_TIMEGM=1 + fi + else + HAVE_TIMEGM=0 + fi + + if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS timegm.$ac_objext" + + + : + + fi + + + + + + GNULIB_TIMEGM=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_TIMEGM 1" >>confdefs.h + + + + : + + + + + + if test $ac_cv_func_tzset = no; then + HAVE_TZSET=0 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether tzset clobbers localtime buffer" >&5 +printf %s "checking whether tzset clobbers localtime buffer... " >&6; } +if test ${gl_cv_func_tzset_clobber+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess all is fine on glibc systems. + *-gnu*) gl_cv_func_tzset_clobber="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_tzset_clobber="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <time.h> +#include <stdlib.h> + +int +main () +{ + time_t t1 = 853958121; + struct tm *p, s; + putenv ("TZ=GMT0"); + p = localtime (&t1); + s = *p; + putenv ("TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"); + tzset (); + return (p->tm_year != s.tm_year + || p->tm_mon != s.tm_mon + || p->tm_mday != s.tm_mday + || p->tm_hour != s.tm_hour + || p->tm_min != s.tm_min + || p->tm_sec != s.tm_sec); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_tzset_clobber=no +else + gl_cv_func_tzset_clobber=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_tzset_clobber" >&5 +printf "%s\n" "$gl_cv_func_tzset_clobber" >&6; } + + +printf "%s\n" "#define HAVE_RUN_TZSET_TEST 1" >>confdefs.h + + + REPLACE_TZSET=0 + case "$gl_cv_func_tzset_clobber" in + *yes) + REPLACE_TZSET=1 + +printf "%s\n" "#define TZSET_CLOBBERS_LOCALTIME 1" >>confdefs.h + + + + + NEED_LOCALTIME_BUFFER=1 + REPLACE_GMTIME=1 + REPLACE_LOCALTIME=1 + + ;; + esac + case "$host_os" in + mingw*) REPLACE_TZSET=1 ;; + esac + + if test $HAVE_TZSET = 0 || test $REPLACE_TZSET = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS tzset.$ac_objext" + + fi + + + + + + GNULIB_TZSET=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_TZSET 1" >>confdefs.h + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_unistd_h='<'unistd.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5 +printf %s "checking absolute name of <unistd.h>... " >&6; } +if test ${gl_cv_next_unistd_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_unistd_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'unistd.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_unistd_h + gl_cv_next_unistd_h='"'$gl_header'"' + else + gl_cv_next_unistd_h='<'unistd.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5 +printf "%s\n" "$gl_cv_next_unistd_h" >&6; } + fi + NEXT_UNISTD_H=$gl_cv_next_unistd_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'unistd.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_unistd_h + fi + NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_unistd_h = yes; then + HAVE_UNISTD_H=1 + else + HAVE_UNISTD_H=0 + fi + + + + + + + + for gl_func in chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell endusershell group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite readlink readlinkat rmdir sethostname sleep symlink symlinkat truncate ttyname_r unlink unlinkat usleep; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +/* Some systems declare various items in the wrong headers. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <fcntl.h> +# include <stdio.h> +# include <stdlib.h> +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include <io.h> +# endif +#endif + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 + } + } + } + + + + + } + }; then + LIBUNISTRING_UNISTR_H='unistr.h' + else + LIBUNISTRING_UNISTR_H= + fi + + + + +printf "%s\n" "#define GNULIB_UNISTR_U8_MBTOUCR 1" >>confdefs.h + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE= + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE='#' +else + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE='#' + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE= +fi + + + + +printf "%s\n" "#define GNULIB_UNISTR_U8_UCTOMB 1" >>confdefs.h + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE= + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE='#' +else + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE='#' + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE= +fi + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 + } + } + } + + + + + } + }; then + LIBUNISTRING_UNITYPES_H='unitypes.h' + else + LIBUNISTRING_UNITYPES_H= + fi + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 + } + } + } + + + + + } + }; then + LIBUNISTRING_UNIWIDTH_H='uniwidth.h' + else + LIBUNISTRING_UNIWIDTH_H= + fi + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 6 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE= + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE='#' +else + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE='#' + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE= +fi + + + + +printf "%s\n" "#define USE_UNLOCKED_IO 1" >>confdefs.h + + + + + + + + + + + + + + + + + + + + + + if test $ac_cv_have_decl_unsetenv = no; then + HAVE_DECL_UNSETENV=0 + fi + ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv" +if test "x$ac_cv_func_unsetenv" = xyes +then : + printf "%s\n" "#define HAVE_UNSETENV 1" >>confdefs.h + +fi + + if test $ac_cv_func_unsetenv = no; then + HAVE_UNSETENV=0 + else + HAVE_UNSETENV=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5 +printf %s "checking for unsetenv() return type... " >&6; } +if test ${gt_cv_func_unsetenv_ret+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#undef _BSD +#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */ +#include <stdlib.h> +extern +#ifdef __cplusplus +"C" +#endif +int unsetenv (const char *name); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gt_cv_func_unsetenv_ret='int' +else + gt_cv_func_unsetenv_ret='void' +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5 +printf "%s\n" "$gt_cv_func_unsetenv_ret" >&6; } + if test $gt_cv_func_unsetenv_ret = 'void'; then + +printf "%s\n" "#define VOID_UNSETENV 1" >>confdefs.h + + REPLACE_UNSETENV=1 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5 +printf %s "checking whether unsetenv obeys POSIX... " >&6; } +if test ${gl_cv_func_unsetenv_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_unsetenv_works="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <stdlib.h> + #include <errno.h> + extern char **environ; + +int +main (void) +{ + + char entry1[] = "a=1"; + char entry2[] = "b=2"; + char *env[] = { entry1, entry2, NULL }; + if (putenv ((char *) "a=1")) return 1; + if (putenv (entry2)) return 2; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 3; + if (!unsetenv ("") || errno != EINVAL) return 4; + entry2[0] = 'b'; + environ = env; + if (!getenv ("a")) return 5; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 6; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_unsetenv_works=yes +else + gl_cv_func_unsetenv_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5 +printf "%s\n" "$gl_cv_func_unsetenv_works" >&6; } + case "$gl_cv_func_unsetenv_works" in + *yes) ;; + *) + REPLACE_UNSETENV=1 + ;; + esac + fi + + if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext" + + + + + + fi + + + + + + GNULIB_UNSETENV=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for variable-length arrays" >&5 +printf %s "checking for variable-length arrays... " >&6; } +if test ${ac_cv_c_vararrays+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC_NO_VLA__ + defined + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "defined" >/dev/null 2>&1 +then : + ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined' +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test for VLA support. This test is partly inspired + from examples in the C standard. Use at least two VLA + functions to detect the GCC 3.4.3 bug described in: + http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html + */ + #ifdef __STDC_NO_VLA__ + syntax error; + #else + extern int n; + int B[100]; + int fvla (int m, int C[m][m]); + + int + simple (int count, int all[static count]) + { + return all[count - 1]; + } + + int + fvla (int m, int C[m][m]) + { + typedef int VLA[m][m]; + VLA x; + int D[m]; + static int (*q)[m] = &B; + int (*s)[n] = q; + return C && &x[0][0] == &D[0] && &D[0] == s[0]; + } + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_vararrays=yes +else + ac_cv_c_vararrays=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -rf conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_vararrays" >&5 +printf "%s\n" "$ac_cv_c_vararrays" >&6; } + if test "$ac_cv_c_vararrays" = yes; then + +printf "%s\n" "#define HAVE_C_VARARRAYS 1" >>confdefs.h + + elif test "$ac_cv_c_vararrays" = no; then + +printf "%s\n" "#define __STDC_NO_VLA__ 1" >>confdefs.h + + fi + + + + if test $ac_cv_func_vasnprintf = no; then + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + + if test $ac_cv_func_vasnprintf = yes; then + +printf "%s\n" "#define REPLACE_VASNPRINTF 1" >>confdefs.h + + fi + + + + + + + + + + + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes +then : + +else + +printf "%s\n" "#define ptrdiff_t long" >>confdefs.h + + +fi + + + + + + + + fi + + + ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf" +if test "x$ac_cv_func_vasprintf" = xyes +then : + printf "%s\n" "#define HAVE_VASPRINTF 1" >>confdefs.h + +fi + + if test $ac_cv_func_vasprintf = no; then + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asprintf.$ac_objext" + + + if test $ac_cv_func_vasprintf = yes; then + REPLACE_VASPRINTF=1 + else + HAVE_VASPRINTF=0 + fi + + + + + + + + + fi + + + + + + + GNULIB_VASPRINTF=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_VASPRINTF 1" >>confdefs.h + + + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=asprintf:2:c-format" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=vasprintf:2:c-format" + + +# Check whether --with-packager was given. +if test ${with_packager+y} +then : + withval=$with_packager; case $withval in + yes|no) ;; + *) +printf "%s\n" "#define PACKAGE_PACKAGER \"$withval\"" >>confdefs.h + ;; + esac + +fi + + + +# Check whether --with-packager-version was given. +if test ${with_packager_version+y} +then : + withval=$with_packager_version; case $withval in + yes|no) ;; + *) +printf "%s\n" "#define PACKAGE_PACKAGER_VERSION \"$withval\"" >>confdefs.h + ;; + esac + +fi + + + +# Check whether --with-packager-bug-reports was given. +if test ${with_packager_bug_reports+y} +then : + withval=$with_packager_bug_reports; case $withval in + yes|no) ;; + *) +printf "%s\n" "#define PACKAGE_PACKAGER_BUG_REPORTS \"$withval\"" >>confdefs.h + ;; + esac + +fi + + + if test "X$with_packager" = "X" && \ + test "X$with_packager_version$with_packager_bug_reports" != "X" + then + as_fn_error $? "The --with-packager-{bug-reports,version} options require --with-packager" "$LINENO" 5 + fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wchar_h='<'wchar.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5 +printf %s "checking absolute name of <wchar.h>... " >&6; } +if test ${gl_cv_next_wchar_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_wchar_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <wchar.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wchar.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wchar_h + gl_cv_next_wchar_h='"'$gl_header'"' + else + gl_cv_next_wchar_h='<'wchar.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5 +printf "%s\n" "$gl_cv_next_wchar_h" >&6; } + fi + NEXT_WCHAR_H=$gl_cv_next_wchar_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'wchar.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_wchar_h + fi + NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + + + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + + + + for gl_func in btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime ; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <stddef.h> +# include <stdio.h> +# include <time.h> +#endif +#include <wchar.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_incomplete_state=yes +else + gl_cv_func_mbrtowc_incomplete_state=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbrtowc_sanitycheck=yes +else + gl_cv_func_mbrtowc_sanitycheck=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_wcrtomb = no; then + HAVE_WCRTOMB=0 + ac_fn_c_check_decl "$LINENO" "wcrtomb" "ac_cv_have_decl_wcrtomb" " +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +" +if test "x$ac_cv_have_decl_wcrtomb" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_WCRTOMB $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_wcrtomb = yes; then + REPLACE_WCRTOMB=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_WCRTOMB=1 + else + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wcrtomb return value is correct" >&5 +printf %s "checking whether wcrtomb return value is correct... " >&6; } +if test ${gl_cv_func_wcrtomb_retval+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on AIX 4, OSF/1 and Solaris. + aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wcrtomb_retval="guessing yes" ;; + esac + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + int result = 0; + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 1; + } + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 2; + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 4; + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 8; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_wcrtomb_retval=yes +else + gl_cv_func_wcrtomb_retval=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcrtomb_retval" >&5 +printf "%s\n" "$gl_cv_func_wcrtomb_retval" >&6; } + case "$gl_cv_func_wcrtomb_retval" in + *yes) ;; + *) REPLACE_WCRTOMB=1 ;; + esac + fi + fi + + if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS wcrtomb.$ac_objext" + + + : + + fi + + + + + + GNULIB_WCRTOMB=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_WCRTOMB 1" >>confdefs.h + + + + + + + + + if test $ac_cv_func_iswcntrl = yes; then + HAVE_ISWCNTRL=1 + else + HAVE_ISWCNTRL=0 + fi + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wctype_h='<'wctype.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5 +printf %s "checking absolute name of <wctype.h>... " >&6; } +if test ${gl_cv_next_wctype_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_wctype_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <wctype.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wctype_h + gl_cv_next_wctype_h='"'$gl_header'"' + else + gl_cv_next_wctype_h='<'wctype.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 +printf "%s\n" "$gl_cv_next_wctype_h" >&6; } + fi + NEXT_WCTYPE_H=$gl_cv_next_wctype_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'wctype.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_wctype_h + fi + NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_wctype_h = yes; then + if test $ac_cv_func_iswcntrl = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 +printf %s "checking whether iswcntrl works... " >&6; } +if test ${gl_cv_func_iswcntrl_works+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + #if __GNU_LIBRARY__ == 1 + Linux libc5 i18n is broken. + #endif +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_iswcntrl_works="guessing yes" +else + gl_cv_func_iswcntrl_works="guessing no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #include <wctype.h> + int main () { return iswprint ('x') == 0; } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_iswcntrl_works=yes +else + gl_cv_func_iswcntrl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 +printf "%s\n" "$gl_cv_func_iswcntrl_works" >&6; } + fi + HAVE_WCTYPE_H=1 + else + HAVE_WCTYPE_H=0 + fi + + + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + fi + + if test $REPLACE_ISWCNTRL = 1; then + REPLACE_TOWLOWER=1 + else + ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" +if test "x$ac_cv_func_towlower" = xyes +then : + printf "%s\n" "#define HAVE_TOWLOWER 1" >>confdefs.h + +fi + + if test $ac_cv_func_towlower = yes; then + REPLACE_TOWLOWER=0 + else + ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #if HAVE_WCTYPE_H + # include <wctype.h> + #endif + +" +if test "x$ac_cv_have_decl_towlower" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_TOWLOWER $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_towlower = yes; then + REPLACE_TOWLOWER=1 + else + REPLACE_TOWLOWER=0 + fi + fi + fi + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then + : + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 +printf %s "checking for wctype_t... " >&6; } +if test ${gl_cv_type_wctype_t+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #if HAVE_WCTYPE_H + # include <wctype.h> + #endif + wctype_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctype_t=yes +else + gl_cv_type_wctype_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 +printf "%s\n" "$gl_cv_type_wctype_t" >&6; } + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 +printf %s "checking for wctrans_t... " >&6; } +if test ${gl_cv_type_wctrans_t+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #include <wctype.h> + wctrans_t a; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wctrans_t=yes +else + gl_cv_type_wctrans_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 +printf "%s\n" "$gl_cv_type_wctrans_t" >&6; } + if test $gl_cv_type_wctrans_t = no; then + HAVE_WCTRANS_T=0 + fi + + + for gl_func in wctype iswctype wctrans towctrans ; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <stddef.h> +# include <stdio.h> +# include <time.h> +# include <wchar.h> +#endif +#include <wctype.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + ac_fn_c_check_decl "$LINENO" "wcwidth" "ac_cv_have_decl_wcwidth" " +/* AIX 3.2.5 declares wcwidth in <string.h>. */ +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +" +if test "x$ac_cv_have_decl_wcwidth" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_WCWIDTH $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_wcwidth != yes; then + HAVE_DECL_WCWIDTH=0 + fi + + if test $ac_cv_func_wcwidth = yes; then + HAVE_WCWIDTH=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wcwidth works reasonably in UTF-8 locales" >&5 +printf %s "checking whether wcwidth works reasonably in UTF-8 locales... " >&6; } +if test ${gl_cv_func_wcwidth_works+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc and AIX 7 systems. + *-gnu* | aix[7-9]*) gl_cv_func_wcwidth_works="guessing yes";; + *) gl_cv_func_wcwidth_works="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +/* AIX 3.2.5 declares wcwidth in <string.h>. */ +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +#if !HAVE_DECL_WCWIDTH +extern +# ifdef __cplusplus +"C" +# endif +int wcwidth (int); +#endif +int main () +{ + int result = 0; + if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL) + { + if (wcwidth (0x0301) > 0) + result |= 1; + if (wcwidth (0x05B0) > 0) + result |= 2; + if (wcwidth (0x200B) > 0) + result |= 4; + if (wcwidth (0xFF1A) == 0) + result |= 8; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_wcwidth_works=yes +else + gl_cv_func_wcwidth_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcwidth_works" >&5 +printf "%s\n" "$gl_cv_func_wcwidth_works" >&6; } + case "$gl_cv_func_wcwidth_works" in + *yes) ;; + *no) REPLACE_WCWIDTH=1 ;; + esac + else + HAVE_WCWIDTH=0 + fi + + if test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS wcwidth.$ac_objext" + + fi + + + + + + GNULIB_WCWIDTH=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_WCWIDTH 1" >>confdefs.h + + + + : + + + ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "#define HAVE_STDINT_H 1" >>confdefs.h + +fi + + + + + : + + + + : + + : + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xasprintf:1:c-format" + + # End of code from modules + + + + + + + + + + gltests_libdeps= + gltests_ltlibdeps= + + + + + + + + + + gl_source_base='gnulib-tests' + gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS + + gl_module_indicator_condition=$gltests_WITNESS + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS accept.$ac_objext" + + fi + + + + + + if test "$GNULIB_ACCEPT" != 1; then + if test "$GNULIB_ACCEPT" = 0; then + GNULIB_ACCEPT=$gl_module_indicator_condition + else + GNULIB_ACCEPT="($GNULIB_ACCEPT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_ACCEPT 1" >>confdefs.h + + + + + + + + if test $ac_cv_header_arpa_inet_h = yes; then + HAVE_ARPA_INET_H=1 + else + HAVE_ARPA_INET_H=0 + fi + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <arpa/inet.h>" >&5 +printf %s "checking absolute name of <arpa/inet.h>... " >&6; } +if test ${gl_cv_next_arpa_inet_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_arpa_inet_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <arpa/inet.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'arpa/inet.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_arpa_inet_h + gl_cv_next_arpa_inet_h='"'$gl_header'"' + else + gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5 +printf "%s\n" "$gl_cv_next_arpa_inet_h" >&6; } + fi + NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'arpa/inet.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_arpa_inet_h + fi + NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive + + + + + + + + + for gl_func in inet_ntop inet_pton; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* On some systems, this header is not self-consistent. */ +#if !(defined __GLIBC__ || defined __UCLIBC__) +# include <sys/socket.h> +#endif +#ifdef __TANDEM +# include <netdb.h> +#endif +#include <arpa/inet.h> + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS bind.$ac_objext" + + fi + + + + + + if test "$GNULIB_BIND" != 1; then + if test "$GNULIB_BIND" = 0; then + GNULIB_BIND=$gl_module_indicator_condition + else + GNULIB_BIND="($GNULIB_BIND || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_BIND 1" >>confdefs.h + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5 +printf %s "checking for a turkish Unicode locale... " >&6; } +if test ${gt_cv_locale_tr_utf8+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. But BeOS does not + implement the Turkish upper-/lowercase mappings. Therefore, let this + program return 1 on BeOS. */ + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the eighth month, the second + character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f) + return 1; + /* Check whether the upper-/lowercase mappings are as expected for + Turkish. */ + if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i' + || towupper(0x0131) != 'I' || towlower ('I') != 0x0131) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=Turkish_Turkey.65001 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr.UTF-8 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + fi + fi + ;; + esac + else + gt_cv_locale_tr_utf8=none + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_tr_utf8" >&6; } + LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8 + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS connect.$ac_objext" + + fi + + + + + + if test "$GNULIB_CONNECT" != 1; then + if test "$GNULIB_CONNECT" = 0; then + GNULIB_CONNECT=$gl_module_indicator_condition + else + GNULIB_CONNECT="($GNULIB_CONNECT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_CONNECT 1" >>confdefs.h + + + + + + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_FDOPEN=1 + fi + + if test $REPLACE_FDOPEN = 0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fdopen sets errno" >&5 +printf %s "checking whether fdopen sets errno... " >&6; } +if test ${gl_cv_func_fdopen_works+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + case "$host_os" in + mingw*) gl_cv_func_fdopen_works="guessing no" ;; + *) gl_cv_func_fdopen_works="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <errno.h> +int +main (void) +{ + FILE *fp; + errno = 0; + fp = fdopen (-1, "r"); + if (fp == NULL && errno == 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_fdopen_works=yes +else + gl_cv_func_fdopen_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopen_works" >&5 +printf "%s\n" "$gl_cv_func_fdopen_works" >&6; } + case "$gl_cv_func_fdopen_works" in + *no) REPLACE_FDOPEN=1 ;; + esac + fi + + if test $REPLACE_FDOPEN = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS fdopen.$ac_objext" + + + fi + + + + + + if test "$GNULIB_FDOPEN" != 1; then + if test "$GNULIB_FDOPEN" = 0; then + GNULIB_FDOPEN=$gl_module_indicator_condition + else + GNULIB_FDOPEN="($GNULIB_FDOPEN || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_FDOPEN 1" >>confdefs.h + + + + + + + if test $ac_cv_func_ftruncate = yes; then + + + case "$host_os" in + mingw*) + REPLACE_FTRUNCATE=1 + ;; + esac + + else + HAVE_FTRUNCATE=0 + fi + + if test $HAVE_FTRUNCATE = 0 || test $REPLACE_FTRUNCATE = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS ftruncate.$ac_objext" + + + ac_fn_c_check_func "$LINENO" "chsize" "ac_cv_func_chsize" +if test "x$ac_cv_func_chsize" = xyes +then : + printf "%s\n" "#define HAVE_CHSIZE 1" >>confdefs.h + +fi + + + fi + + + + + + if test "$GNULIB_FTRUNCATE" != 1; then + if test "$GNULIB_FTRUNCATE" = 0; then + GNULIB_FTRUNCATE=$gl_module_indicator_condition + else + GNULIB_FTRUNCATE="($GNULIB_FTRUNCATE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_FTRUNCATE 1" >>confdefs.h + + + + + + + + + case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in + *yes,yes) ;; + *) + REPLACE_GETCWD=1 + ;; + esac + + if test $REPLACE_GETCWD = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS getcwd-lgpl.$ac_objext" + + fi + + + + + + if test "$GNULIB_GETCWD" != 1; then + if test "$GNULIB_GETCWD" = 0; then + GNULIB_GETCWD=$gl_module_indicator_condition + else + GNULIB_GETCWD="($GNULIB_GETCWD || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_GETCWD 1" >>confdefs.h + + + + + + + ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = xyes +then : + printf "%s\n" "#define HAVE_GETPAGESIZE 1" >>confdefs.h + +fi + + if test $ac_cv_func_getpagesize = no; then + HAVE_GETPAGESIZE=0 + ac_fn_c_check_header_compile "$LINENO" "OS.h" "ac_cv_header_OS_h" "$ac_includes_default" +if test "x$ac_cv_header_OS_h" = xyes +then : + printf "%s\n" "#define HAVE_OS_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_OS_h = yes; then + HAVE_OS_H=1 + fi + ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_sys_param_h = yes; then + HAVE_SYS_PARAM_H=1 + fi + fi + case "$host_os" in + mingw*) + REPLACE_GETPAGESIZE=1 + ;; + esac + ac_fn_c_check_decl "$LINENO" "getpagesize" "ac_cv_have_decl_getpagesize" "$ac_includes_default" +if test "x$ac_cv_have_decl_getpagesize" = xyes +then : + +else + HAVE_DECL_GETPAGESIZE=0 +fi + + + if test $REPLACE_GETPAGESIZE = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS getpagesize.$ac_objext" + + fi + + + + + + if test "$GNULIB_GETPAGESIZE" != 1; then + if test "$GNULIB_GETPAGESIZE" = 0; then + GNULIB_GETPAGESIZE=$gl_module_indicator_condition + else + GNULIB_GETPAGESIZE="($GNULIB_GETPAGESIZE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_GETPAGESIZE 1" >>confdefs.h + + + + + + + + + + + HAVE_INET_PTON=1 + INET_PTON_LIB= + + + + + if test $ac_cv_header_sys_socket_h != yes; then + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + if test $HAVE_WINSOCK2_H = 1; then + ac_fn_c_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include <ws2tcpip.h> +" +if test "x$ac_cv_have_decl_inet_pton" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_INET_PTON $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_inet_pton = yes; then + REPLACE_INET_PTON=1 + INET_PTON_LIB="-lws2_32" + else + HAVE_DECL_INET_PTON=0 + HAVE_INET_PTON=0 + fi + else + gl_save_LIBS=$LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing inet_pton" >&5 +printf %s "checking for library containing inet_pton... " >&6; } +if test ${ac_cv_search_inet_pton+y} +then : + printf %s "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char inet_pton (); +int +main (void) +{ +return inet_pton (); + ; + return 0; +} +_ACEOF +for ac_lib in '' nsl resolv +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_inet_pton=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test ${ac_cv_search_inet_pton+y} +then : + break +fi +done +if test ${ac_cv_search_inet_pton+y} +then : + +else + ac_cv_search_inet_pton=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_pton" >&5 +printf "%s\n" "$ac_cv_search_inet_pton" >&6; } +ac_res=$ac_cv_search_inet_pton +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else + ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton" +if test "x$ac_cv_func_inet_pton" = xyes +then : + printf "%s\n" "#define HAVE_INET_PTON 1" >>confdefs.h + +fi + + if test $ac_cv_func_inet_pton = no; then + HAVE_INET_PTON=0 + fi + +fi + + LIBS=$gl_save_LIBS + + if test "$ac_cv_search_inet_pton" != "no" \ + && test "$ac_cv_search_inet_pton" != "none required"; then + INET_PTON_LIB="$ac_cv_search_inet_pton" + fi + + + ac_fn_c_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include <arpa/inet.h> + #if HAVE_NETDB_H + # include <netdb.h> + #endif + +" +if test "x$ac_cv_have_decl_inet_pton" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_INET_PTON $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_inet_pton = no; then + HAVE_DECL_INET_PTON=0 + fi + fi + + + if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS inet_pton.$ac_objext" + + + + + fi + + + + + + if test "$GNULIB_INET_PTON" != 1; then + if test "$GNULIB_INET_PTON" = 0; then + GNULIB_INET_PTON=$gl_module_indicator_condition + else + GNULIB_INET_PTON="($GNULIB_INET_PTON || $gl_module_indicator_condition)" + fi + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> + +int +main (void) +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> + +int +main (void) +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + +int +main (void) +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + +int +main (void) +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes +then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main (void) +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + + + + HAVE_IOCTL=1 + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_IOCTL=0 + else + ac_fn_c_check_func "$LINENO" "ioctl" "ac_cv_func_ioctl" +if test "x$ac_cv_func_ioctl" = xyes +then : + printf "%s\n" "#define HAVE_IOCTL 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ioctl with POSIX signature" >&5 +printf %s "checking for ioctl with POSIX signature... " >&6; } +if test ${gl_cv_func_ioctl_posix_signature+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/ioctl.h> +int +main (void) +{ +extern + #ifdef __cplusplus + "C" + #endif + int ioctl (int, int, ...); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_ioctl_posix_signature=yes +else + gl_cv_func_ioctl_posix_signature=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ioctl_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_ioctl_posix_signature" >&6; } + if test $gl_cv_func_ioctl_posix_signature != yes; then + REPLACE_IOCTL=1 + fi + fi + + if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS ioctl.$ac_objext" + + fi + + + + + + if test "$GNULIB_IOCTL" != 1; then + if test "$GNULIB_IOCTL" = 0; then + GNULIB_IOCTL=$gl_module_indicator_condition + else + GNULIB_IOCTL="($GNULIB_IOCTL || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_IOCTL 1" >>confdefs.h + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS listen.$ac_objext" + + fi + + + + + + if test "$GNULIB_LISTEN" != 1; then + if test "$GNULIB_LISTEN" = 0; then + GNULIB_LISTEN=$gl_module_indicator_condition + else + GNULIB_LISTEN="($GNULIB_LISTEN || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_LISTEN 1" >>confdefs.h + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5 +printf %s "checking for a turkish Unicode locale... " >&6; } +if test ${gt_cv_locale_tr_utf8+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. But BeOS does not + implement the Turkish upper-/lowercase mappings. Therefore, let this + program return 1 on BeOS. */ + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the eighth month, the second + character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f) + return 1; + /* Check whether the upper-/lowercase mappings are as expected for + Turkish. */ + if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i' + || towupper(0x0131) != 'I' || towlower ('I') != 0x0131) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=Turkish_Turkey.65001 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr.UTF-8 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + fi + fi + ;; + esac + else + gt_cv_locale_tr_utf8=none + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_tr_utf8" >&6; } + LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8 + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else + gl_have_mmap=no +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + + + + + + nanosleep_save_libs=$LIBS + + # Solaris 2.5.1 needs -lposix4 to get the nanosleep function. + # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. + LIB_NANOSLEEP= + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5 +printf %s "checking for library containing nanosleep... " >&6; } +if test ${ac_cv_search_nanosleep+y} +then : + printf %s "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char nanosleep (); +int +main (void) +{ +return nanosleep (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt posix4 +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_nanosleep=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test ${ac_cv_search_nanosleep+y} +then : + break +fi +done +if test ${ac_cv_search_nanosleep+y} +then : + +else + ac_cv_search_nanosleep=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5 +printf "%s\n" "$ac_cv_search_nanosleep" >&6; } +ac_res=$ac_cv_search_nanosleep +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ac_cv_search_nanosleep" = "none required" || + LIB_NANOSLEEP=$ac_cv_search_nanosleep +fi + + if test "x$ac_cv_search_nanosleep" != xno; then + + + if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple Mac OS X platforms. + # The test result would be 'no (mishandles large arguments)' in 64-bit + # mode but 'yes' in 32-bit mode. But we need a configuration result that + # is valid in both modes. + gl_cv_func_nanosleep='no (mishandles large arguments)' + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working nanosleep" >&5 +printf %s "checking for working nanosleep... " >&6; } +if test ${gl_cv_func_nanosleep+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + case "$host_os" in linux*) # Guess it halfway works when the kernel is Linux. + gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;; + *) # If we don't know, assume the worst. + gl_cv_func_nanosleep='guessing no' ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <errno.h> + #include <limits.h> + #include <signal.h> + #if HAVE_SYS_TIME_H + #include <sys/time.h> + #endif + #include <time.h> + #include <unistd.h> + #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) + #define TYPE_MAXIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) + + static void + check_for_SIGALRM (int sig) + { + if (sig != SIGALRM) + _exit (1); + } + + int + main () + { + static struct timespec ts_sleep; + static struct timespec ts_remaining; + static struct sigaction act; + /* Test for major problems first. */ + if (! nanosleep) + return 2; + act.sa_handler = check_for_SIGALRM; + sigemptyset (&act.sa_mask); + sigaction (SIGALRM, &act, NULL); + ts_sleep.tv_sec = 0; + ts_sleep.tv_nsec = 1; + alarm (1); + if (nanosleep (&ts_sleep, NULL) != 0) + return 3; + /* Test for a minor problem: the handling of large arguments. */ + ts_sleep.tv_sec = TYPE_MAXIMUM (time_t); + ts_sleep.tv_nsec = 999999999; + alarm (1); + if (nanosleep (&ts_sleep, &ts_remaining) != -1) + return 4; + if (errno != EINTR) + return 5; + if (ts_remaining.tv_sec <= TYPE_MAXIMUM (time_t) - 10) + return 6; + return 0; + } +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_nanosleep=yes +else + case $? in 4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)';; *) gl_cv_func_nanosleep=no;; + esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nanosleep" >&5 +printf "%s\n" "$gl_cv_func_nanosleep" >&6; } + case "$gl_cv_func_nanosleep" in + *yes) + REPLACE_NANOSLEEP=0 + ;; + *) + REPLACE_NANOSLEEP=1 + case "$gl_cv_func_nanosleep" in + *"mishandles large arguments"*) + +printf "%s\n" "#define HAVE_BUG_BIG_NANOSLEEP 1" >>confdefs.h + + ;; + *) + # The replacement uses select(). Add $LIBSOCKET to $LIB_NANOSLEEP. + for ac_lib in $LIBSOCKET; do + case " $LIB_NANOSLEEP " in + *" $ac_lib "*) ;; + *) LIB_NANOSLEEP="$LIB_NANOSLEEP $ac_lib";; + esac + done + ;; + esac + ;; + esac + else + HAVE_NANOSLEEP=0 + fi + LIBS=$nanosleep_save_libs + + if test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS nanosleep.$ac_objext" + + + + : + + fi + + + + + + if test "$GNULIB_NANOSLEEP" != 1; then + if test "$GNULIB_NANOSLEEP" = 0; then + GNULIB_NANOSLEEP=$gl_module_indicator_condition + else + GNULIB_NANOSLEEP="($GNULIB_NANOSLEEP || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_NANOSLEEP 1" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <netinet/in.h> is self-contained" >&5 +printf %s "checking whether <netinet/in.h> is self-contained... " >&6; } +if test ${gl_cv_header_netinet_in_h_selfcontained+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <netinet/in.h> +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_netinet_in_h_selfcontained=yes +else + gl_cv_header_netinet_in_h_selfcontained=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5 +printf "%s\n" "$gl_cv_header_netinet_in_h_selfcontained" >&6; } + if test $gl_cv_header_netinet_in_h_selfcontained = yes; then + NETINET_IN_H='' + else + NETINET_IN_H='netinet/in.h' + ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h + +fi + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_netinet_in_h='<'netinet/in.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <netinet/in.h>" >&5 +printf %s "checking absolute name of <netinet/in.h>... " >&6; } +if test ${gl_cv_next_netinet_in_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_netinet_in_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <netinet/in.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'netinet/in.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_netinet_in_h + gl_cv_next_netinet_in_h='"'$gl_header'"' + else + gl_cv_next_netinet_in_h='<'netinet/in.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5 +printf "%s\n" "$gl_cv_next_netinet_in_h" >&6; } + fi + NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'netinet/in.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_netinet_in_h + fi + NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_netinet_in_h = yes; then + HAVE_NETINET_IN_H=1 + else + HAVE_NETINET_IN_H=0 + fi + + fi + + if test -n "$NETINET_IN_H"; then + GL_GENERATE_NETINET_IN_H_TRUE= + GL_GENERATE_NETINET_IN_H_FALSE='#' +else + GL_GENERATE_NETINET_IN_H_TRUE='#' + GL_GENERATE_NETINET_IN_H_FALSE= +fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + + + if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then + REPLACE_PERROR=1 + fi + case ${gl_cv_func_strerror_r_works-unset} in + unset|*yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether perror matches strerror" >&5 +printf %s "checking whether perror matches strerror... " >&6; } +if test ${gl_cv_func_perror_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + gl_cv_func_perror_works="guessing no" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <errno.h> + #include <stdio.h> + #include <stdlib.h> + #include <string.h> + +int +main (void) +{ +char *str = strerror (-1); + if (!getenv("CONFTEST_OUTPUT")) return 0; + if (!str) str = ""; + puts (str); + errno = -1; + perror (""); + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + if CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2 \ + && cmp conftest.txt1 conftest.txt2 >/dev/null; then + gl_cv_func_perror_works=yes + else + gl_cv_func_perror_works=no + fi + rm -rf conftest.txt1 conftest.txt2 +else + gl_cv_func_perror_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_perror_works" >&5 +printf "%s\n" "$gl_cv_func_perror_works" >&6; } + if test "$gl_cv_func_perror_works" != yes; then + REPLACE_PERROR=1 + fi + ;; + *) + REPLACE_PERROR=1 + ;; + esac + + if test $REPLACE_PERROR = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS perror.$ac_objext" + + fi + + + + + + if test "$GNULIB_PERROR" != 1; then + if test "$GNULIB_PERROR" = 0; then + GNULIB_PERROR=$gl_module_indicator_condition + else + GNULIB_PERROR="($GNULIB_PERROR || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_PERROR 1" >>confdefs.h + + + + + + + + if test $ac_cv_func_pipe != yes; then + HAVE_PIPE=0 + fi + + if test $HAVE_PIPE = 0; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS pipe.$ac_objext" + + fi + + + + + + if test "$GNULIB_PIPE" != 1; then + if test "$GNULIB_PIPE" = 0; then + GNULIB_PIPE=$gl_module_indicator_condition + else + GNULIB_PIPE="($GNULIB_PIPE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_PIPE 1" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for putenv compatible with GNU and SVID" >&5 +printf %s "checking for putenv compatible with GNU and SVID... " >&6; } +if test ${gl_cv_func_svid_putenv+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_svid_putenv="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Put it in env. */ + if (putenv ("CONFTEST_putenv=val")) + return 1; + + /* Try to remove it. */ + if (putenv ("CONFTEST_putenv")) + return 2; + + /* Make sure it was deleted. */ + if (getenv ("CONFTEST_putenv") != 0) + return 3; + + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_svid_putenv=yes +else + gl_cv_func_svid_putenv=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_svid_putenv" >&5 +printf "%s\n" "$gl_cv_func_svid_putenv" >&6; } + case "$gl_cv_func_svid_putenv" in + *yes) ;; + *) + REPLACE_PUTENV=1 + ;; + esac + + if test $REPLACE_PUTENV = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS putenv.$ac_objext" + + + ac_fn_c_check_decl "$LINENO" "_putenv" "ac_cv_have_decl__putenv" "$ac_includes_default" +if test "x$ac_cv_have_decl__putenv" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL__PUTENV $ac_have_decl" >>confdefs.h + + + fi + + + + + + if test "$GNULIB_PUTENV" != 1; then + if test "$GNULIB_PUTENV" = 0; then + GNULIB_PUTENV=$gl_module_indicator_condition + else + GNULIB_PUTENV="($GNULIB_PUTENV || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_PUTENV 1" >>confdefs.h + + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else + gl_have_mmap=no +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else + gl_have_mmap=no +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + + if test "$ac_cv_header_winsock2_h" = yes; then + REPLACE_SELECT=1 + else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select supports a 0 argument" >&5 +printf %s "checking whether select supports a 0 argument... " >&6; } +if test ${gl_cv_func_select_supports0+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on Interix. + interix*) gl_cv_func_select_supports0="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_select_supports0="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/types.h> +#include <sys/time.h> +#if HAVE_SYS_SELECT_H +#include <sys/select.h> +#endif +int main () +{ + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_supports0=yes +else + gl_cv_func_select_supports0=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_supports0" >&5 +printf "%s\n" "$gl_cv_func_select_supports0" >&6; } + case "$gl_cv_func_select_supports0" in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select detects invalid fds" >&5 +printf %s "checking whether select detects invalid fds... " >&6; } +if test ${gl_cv_func_select_detects_ebadf+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_select_detects_ebadf="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/types.h> +#include <sys/time.h> +#if HAVE_SYS_SELECT_H +# include <sys/select.h> +#endif +#include <unistd.h> +#include <errno.h> + +int +main (void) +{ + + fd_set set; + dup2(0, 16); + FD_ZERO(&set); + FD_SET(16, &set); + close(16); + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_select_detects_ebadf=yes +else + gl_cv_func_select_detects_ebadf=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_detects_ebadf" >&5 +printf "%s\n" "$gl_cv_func_select_detects_ebadf" >&6; } + case $gl_cv_func_select_detects_ebadf in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + fi + + LIB_SELECT="$LIBSOCKET" + if test $REPLACE_SELECT = 1; then + case "$host_os" in + mingw*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +int +main () +{ + MsgWaitForMultipleObjects (0, NULL, 0, 0, 0); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +else + LIB_SELECT="$LIB_SELECT -luser32" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ;; + esac + fi + + + if test $REPLACE_SELECT = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS select.$ac_objext" + + fi + + + + + + if test "$GNULIB_SELECT" != 1; then + if test "$GNULIB_SELECT" = 0; then + GNULIB_SELECT=$gl_module_indicator_condition + else + GNULIB_SELECT="($GNULIB_SELECT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_SELECT 1" >>confdefs.h + + + + + + + + case "$host_os" in + mingw*) REPLACE_SETLOCALE=1 ;; + cygwin*) + case `uname -r` in + 1.5.*) REPLACE_SETLOCALE=1 ;; + esac + ;; + esac + + if test $REPLACE_SETLOCALE = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS setlocale.$ac_objext" + + + : + + fi + + + + + + if test "$GNULIB_SETLOCALE" != 1; then + if test "$GNULIB_SETLOCALE" = 0; then + GNULIB_SETLOCALE=$gl_module_indicator_condition + else + GNULIB_SETLOCALE="($GNULIB_SETLOCALE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_SETLOCALE 1" >>confdefs.h + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS setsockopt.$ac_objext" + + fi + + + + + + if test "$GNULIB_SETSOCKOPT" != 1; then + if test "$GNULIB_SETSOCKOPT" = 0; then + GNULIB_SETSOCKOPT=$gl_module_indicator_condition + else + GNULIB_SETSOCKOPT="($GNULIB_SETSOCKOPT || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_SETSOCKOPT 1" >>confdefs.h + + + + + + ac_fn_c_check_decl "$LINENO" "sleep" "ac_cv_have_decl_sleep" "#include <unistd.h> +" +if test "x$ac_cv_have_decl_sleep" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_SLEEP $ac_have_decl" >>confdefs.h + + + if test $ac_cv_have_decl_sleep != yes; then + HAVE_SLEEP=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working sleep" >&5 +printf %s "checking for working sleep... " >&6; } +if test ${gl_cv_func_sleep_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_sleep_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_sleep_works="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <errno.h> +#include <unistd.h> +#include <signal.h> +static void +handle_alarm (int sig) +{ + if (sig != SIGALRM) + _exit (2); +} + +int +main (void) +{ + + /* Failure to compile this test due to missing alarm is okay, + since all such platforms (mingw) also lack sleep. */ + unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days. */ + unsigned int remaining; + signal (SIGALRM, handle_alarm); + alarm (1); + remaining = sleep (pentecost); + if (remaining > pentecost) + return 3; + if (remaining <= pentecost - 10) + return 4; + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_sleep_works=yes +else + gl_cv_func_sleep_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_sleep_works" >&5 +printf "%s\n" "$gl_cv_func_sleep_works" >&6; } + case "$gl_cv_func_sleep_works" in + *yes) ;; + *) + REPLACE_SLEEP=1 + ;; + esac + fi + + if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS sleep.$ac_objext" + + fi + + + + + + if test "$GNULIB_SLEEP" != 1; then + if test "$GNULIB_SLEEP" = 0; then + GNULIB_SLEEP=$gl_module_indicator_condition + else + GNULIB_SLEEP="($GNULIB_SLEEP || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_SLEEP 1" >>confdefs.h + + + + + + + gl_cv_func_snprintf_usable=no + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h + +fi + + if test $ac_cv_func_snprintf = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5 +printf %s "checking whether snprintf respects a size of 1... " >&6; } +if test ${gl_cv_func_snprintf_size1+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + gl_cv_func_snprintf_size1="guessing yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + my_snprintf (buf, 1, "%d", 12345); + return buf[1] != 'E'; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_snprintf_size1=yes +else + gl_cv_func_snprintf_size1=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_size1" >&5 +printf "%s\n" "$gl_cv_func_snprintf_size1" >&6; } + + case "$gl_cv_func_snprintf_size1" in + *yes) + + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5 +printf %s "checking whether printf supports POSIX/XSI format strings with positions... " >&6; } +if test ${gl_cv_func_printf_positions+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + + case "$host_os" in + netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) + gl_cv_func_printf_positions="guessing no";; + beos*) gl_cv_func_printf_positions="guessing no";; + mingw* | pw*) gl_cv_func_printf_positions="guessing no";; + *) gl_cv_func_printf_positions="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +/* The string "%2$d %1$d", with dollar characters protected from the shell's + dollar expansion (possibly an autoconf bug). */ +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; +static char buf[100]; +int main () +{ + sprintf (buf, format, 33, 55); + return (strcmp (buf, "55 33") != 0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_printf_positions=yes +else + gl_cv_func_printf_positions=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_positions" >&5 +printf "%s\n" "$gl_cv_func_printf_positions" >&6; } + + case "$gl_cv_func_printf_positions" in + *yes) + gl_cv_func_snprintf_usable=yes + ;; + esac + ;; + esac + ;; + esac + fi + if test $gl_cv_func_snprintf_usable = no; then + + + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS snprintf.$ac_objext" + + if test $ac_cv_func_snprintf = yes; then + REPLACE_SNPRINTF=1 + else + + if test $ac_cv_have_decl_snprintf = yes; then + REPLACE_SNPRINTF=1 + fi + fi + : + + fi + + if test $ac_cv_have_decl_snprintf = no; then + HAVE_DECL_SNPRINTF=0 + fi + + + + + + + if test "$GNULIB_SNPRINTF" != 1; then + if test "$GNULIB_SNPRINTF" = 0; then + GNULIB_SNPRINTF=$gl_module_indicator_condition + else + GNULIB_SNPRINTF="($GNULIB_SNPRINTF || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_SNPRINTF 1" >>confdefs.h + + + + + +printf "%s\n" "#define GNULIB_SNPRINTF $gl_module_indicator_condition" >>confdefs.h + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS socket.$ac_objext" + + fi + # When this module is used, sockets may actually occur as file descriptors, + # hence it is worth warning if the modules 'close' and 'ioctl' are not used. + + + + if test "$ac_cv_header_winsock2_h" = yes; then + UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 + fi + + + + + + if test "$GNULIB_SOCKET" != 1; then + if test "$GNULIB_SOCKET" = 0; then + GNULIB_SOCKET=$gl_module_indicator_condition + else + GNULIB_SOCKET="($GNULIB_SOCKET || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_SOCKET 1" >>confdefs.h + + + + + + ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " +/* <sys/types.h> is not needed according to POSIX, but the + <sys/socket.h> in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include <sys/types.h> +#if HAVE_SYS_SOCKET_H +# include <sys/socket.h> +#elif HAVE_WS2TCPIP_H +# include <ws2tcpip.h> +#endif + +" +if test "x$ac_cv_type_socklen_t" = xyes +then : + +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5 +printf %s "checking for socklen_t equivalent... " >&6; } + if test ${gl_cv_socklen_t_equiv+y} +then : + printf %s "(cached) " >&6 +else + # Systems have either "struct sockaddr *" or + # "void *" as the second argument to getpeername + gl_cv_socklen_t_equiv= + for arg2 in "struct sockaddr" void; do + for t in int size_t "unsigned int" "long int" "unsigned long int"; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/socket.h> + + int getpeername (int, $arg2 *, $t *); +int +main (void) +{ +$t len; + getpeername (0, 0, &len); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_socklen_t_equiv="$t" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$gl_cv_socklen_t_equiv" != "" && break + done + test "$gl_cv_socklen_t_equiv" != "" && break + done + +fi + + if test "$gl_cv_socklen_t_equiv" = ""; then + as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5 +printf "%s\n" "$gl_cv_socklen_t_equiv" >&6; } + +printf "%s\n" "#define socklen_t $gl_cv_socklen_t_equiv" >>confdefs.h + +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5 +printf %s "checking for working stdalign.h... " >&6; } +if test ${gl_cv_header_working_stdalign_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdalign.h> + #include <stddef.h> + + /* Test that alignof yields a result consistent with offsetof. + This catches GCC bug 52023 + <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */ + #ifdef __cplusplus + template <class t> struct alignof_helper { char a; t b; }; + # define ao(type) offsetof (alignof_helper<type>, b) + #else + # define ao(type) offsetof (struct { char a; type b; }, b) + #endif + char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1]; + char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1]; + char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1]; + + /* Test _Alignas only on platforms where gnulib can help. */ + #if \ + ((defined __cplusplus && 201103 <= __cplusplus) \ + || (defined __APPLE__ && defined __MACH__ \ + ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ + : __GNUC__) \ + || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ + || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \ + || 1300 <= _MSC_VER) + struct alignas_test { char c; char alignas (8) alignas_8; }; + char test_alignas[offsetof (struct alignas_test, alignas_8) == 8 + ? 1 : -1]; + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_working_stdalign_h=yes +else + gl_cv_header_working_stdalign_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5 +printf "%s\n" "$gl_cv_header_working_stdalign_h" >&6; } + + if test $gl_cv_header_working_stdalign_h = yes; then + STDALIGN_H='' + else + STDALIGN_H='stdalign.h' + fi + + + if test -n "$STDALIGN_H"; then + GL_GENERATE_STDALIGN_H_TRUE= + GL_GENERATE_STDALIGN_H_FALSE='#' +else + GL_GENERATE_STDALIGN_H_TRUE='#' + GL_GENERATE_STDALIGN_H_FALSE= +fi + + + + + + + + + + + + if test $ac_cv_have_decl_strerror_r = no; then + HAVE_DECL_STRERROR_R=0 + fi + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + if test $gl_cv_func_strerror_r_posix_signature = yes; then + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR_R=1 ;; + esac + else + REPLACE_STRERROR_R=1 + fi + else + REPLACE_STRERROR_R=1 + fi + fi + + if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS strerror_r.$ac_objext" + + + + + + + fi + + + + + + if test "$GNULIB_STRERROR_R" != 1; then + if test "$GNULIB_STRERROR_R" = 0; then + GNULIB_STRERROR_R=$gl_module_indicator_condition + else + GNULIB_STRERROR_R="($GNULIB_STRERROR_R || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_STRERROR_R 1" >>confdefs.h + + + + + +printf "%s\n" "#define GNULIB_STRERROR_R_POSIX $gl_module_indicator_condition" >>confdefs.h + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + gl_have_mmap=yes +else + gl_have_mmap=no +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "I cannot identify this map" >/dev/null 2>&1 +then : + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "I cannot identify this map" >/dev/null 2>&1 +then : + +printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + if test $ac_cv_func_symlink = no; then + HAVE_SYMLINK=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether symlink handles trailing slash correctly" >&5 +printf %s "checking whether symlink handles trailing slash correctly... " >&6; } +if test ${gl_cv_func_symlink_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_symlink_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_symlink_works="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> + +int +main (void) +{ +int result = 0; + if (!symlink ("a", "conftest.link/")) + result |= 1; + if (symlink ("conftest.f", "conftest.lnk2")) + result |= 2; + else if (!symlink ("a", "conftest.lnk2/")) + result |= 4; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_symlink_works=yes +else + gl_cv_func_symlink_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.f conftest.link conftest.lnk2 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_symlink_works" >&5 +printf "%s\n" "$gl_cv_func_symlink_works" >&6; } + case "$gl_cv_func_symlink_works" in + *yes) ;; + *) + REPLACE_SYMLINK=1 + ;; + esac + fi + + if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS symlink.$ac_objext" + + fi + + + + + + if test "$GNULIB_SYMLINK" != 1; then + if test "$GNULIB_SYMLINK" = 0; then + GNULIB_SYMLINK=$gl_module_indicator_condition + else + GNULIB_SYMLINK="($GNULIB_SYMLINK || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_SYMLINK 1" >>confdefs.h + + + + + + + + if test $ac_cv_header_sys_ioctl_h = yes; then + HAVE_SYS_IOCTL_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/ioctl.h> declares ioctl" >&5 +printf %s "checking whether <sys/ioctl.h> declares ioctl... " >&6; } +if test ${gl_cv_decl_ioctl_in_sys_ioctl_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/ioctl.h> + +int +main (void) +{ +(void) ioctl; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_decl_ioctl_in_sys_ioctl_h=yes +else + gl_cv_decl_ioctl_in_sys_ioctl_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_ioctl_in_sys_ioctl_h" >&5 +printf "%s\n" "$gl_cv_decl_ioctl_in_sys_ioctl_h" >&6; } + else + HAVE_SYS_IOCTL_H=0 + fi + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_ioctl_h='<'sys/ioctl.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/ioctl.h>" >&5 +printf %s "checking absolute name of <sys/ioctl.h>... " >&6; } +if test ${gl_cv_next_sys_ioctl_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_sys_ioctl_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/ioctl.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/ioctl.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_ioctl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_ioctl_h + gl_cv_next_sys_ioctl_h='"'$gl_header'"' + else + gl_cv_next_sys_ioctl_h='<'sys/ioctl.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_ioctl_h" >&5 +printf "%s\n" "$gl_cv_next_sys_ioctl_h" >&6; } + fi + NEXT_SYS_IOCTL_H=$gl_cv_next_sys_ioctl_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/ioctl.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_ioctl_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H=$gl_next_as_first_directive + + + + + + + for gl_func in ioctl; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/ioctl.h> +/* Some platforms declare ioctl in the wrong header. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <unistd.h> +#endif + +int +main (void) +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_uio_h='<'sys/uio.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/uio.h>" >&5 +printf %s "checking absolute name of <sys/uio.h>... " >&6; } +if test ${gl_cv_next_sys_uio_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_sys_uio_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/uio.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/uio.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_uio_h + gl_cv_next_sys_uio_h='"'$gl_header'"' + else + gl_cv_next_sys_uio_h='<'sys/uio.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5 +printf "%s\n" "$gl_cv_next_sys_uio_h" >&6; } + fi + NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/uio.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_uio_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_sys_uio_h = yes; then + HAVE_SYS_UIO_H=1 + else + HAVE_SYS_UIO_H=0 + fi + + + + abs_aux_dir=`cd "$ac_aux_dir"; pwd` + + abs_aux_dir=`cd "$ac_aux_dir"; pwd` + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + + + if test $ac_cv_func_wctob = no; then + HAVE_WCTOB=0 + HAVE_DECL_WCTOB=0 + else + HAVE_WCTOB=1 + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wctob works" >&5 +printf %s "checking whether wctob works... " >&6; } +if test ${gl_cv_func_wctob_works+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris <= 9 and Cygwin. + solaris2.[1-9] | solaris2.[1-9].* | cygwin*) + gl_cv_func_wctob_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wctob_works="guessing yes" ;; + esac + case "$host_os" in + cygwin*) + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +register long global __asm__ ("%ebx"); + +int main () +{ + setlocale (LC_ALL, "en_US.UTF-8"); + + global = 0x12345678; + if (wctob (0x00FC) != -1) + return 1; + if (global != 0x12345678) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + : +else + gl_cv_func_wctob_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + ;; + esac + if test "$gl_cv_func_wctob_works" != no && test $LOCALE_FR != none; then + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + wchar_t wc; + + if (mbtowc (&wc, "\374", 1) == 1) + if (wctob (wc) != (unsigned char) '\374') + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_wctob_works=yes +else + gl_cv_func_wctob_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wctob_works" >&5 +printf "%s\n" "$gl_cv_func_wctob_works" >&6; } + case "$gl_cv_func_wctob_works" in + *yes) ;; + *) REPLACE_WCTOB=1 ;; + esac + if test $REPLACE_WCTOB = 0; then + + ac_fn_c_check_decl "$LINENO" "wctob" "ac_cv_have_decl_wctob" " +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +" +if test "x$ac_cv_have_decl_wctob" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_WCTOB $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_wctob != yes; then + HAVE_DECL_WCTOB=0 + fi + fi + fi + + if test $HAVE_WCTOB = 0 || test $REPLACE_WCTOB = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS wctob.$ac_objext" + + + : + + fi + + + + + + if test "$GNULIB_WCTOB" != 1; then + if test "$GNULIB_WCTOB" = 0; then + GNULIB_WCTOB=$gl_module_indicator_condition + else + GNULIB_WCTOB="($GNULIB_WCTOB || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_WCTOB 1" >>confdefs.h + + + + + + + if false; then + REPLACE_WCTOMB=1 + fi + + if test $REPLACE_WCTOMB = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS wctomb.$ac_objext" + + + : + + fi + + + + + + if test "$GNULIB_WCTOMB" != 1; then + if test "$GNULIB_WCTOMB" = 0; then + GNULIB_WCTOMB=$gl_module_indicator_condition + else + GNULIB_WCTOMB="($GNULIB_WCTOMB || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_WCTOMB 1" >>confdefs.h + + + + + + + + + + + + + + LIBDIFFUTILS_LIBDEPS="$gl_libdeps" + + LIBDIFFUTILS_LTLIBDEPS="$gl_ltlibdeps" + + LIBTESTS_LIBDEPS="$gltests_libdeps" + + + +# Check whether --enable-gcc-warnings was given. +if test ${enable_gcc_warnings+y} +then : + enableval=$enable_gcc_warnings; case $enableval in + yes|no) ;; + *) as_fn_error $? "bad value $enableval for gcc-warnings option" "$LINENO" 5 ;; + esac + gl_gcc_warnings=$enableval +else + if test -d "$srcdir"/.git; then + gl_gcc_warnings=yes + else + gl_gcc_warnings=no + fi + +fi + + +if test "$gl_gcc_warnings" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror -Wunknown-warning-option" >&5 +printf %s "checking whether C compiler handles -Werror -Wunknown-warning-option... " >&6; } +if test ${gl_cv_warn_c__Werror__Wunknown_warning_option+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Werror__Wunknown_warning_option=yes +else + gl_cv_warn_c__Werror__Wunknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror__Wunknown_warning_option" >&5 +printf "%s\n" "$gl_cv_warn_c__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_c__Werror__Wunknown_warning_option" = xyes +then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_unknown_warnings_are_errors= +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror" >&5 +printf %s "checking whether C compiler handles -Werror... " >&6; } +if test ${gl_cv_warn_c__Werror+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Werror=yes +else + gl_cv_warn_c__Werror=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror" >&5 +printf "%s\n" "$gl_cv_warn_c__Werror" >&6; } +if test "x$gl_cv_warn_c__Werror" = xyes +then : + as_fn_append WERROR_CFLAGS " -Werror" +fi + + + + + nw= + # This, $nw, is the list of warnings we disable. + nw="$nw -Wdeclaration-after-statement" # too useful to forbid + nw="$nw -Waggregate-return" # anachronistic + nw="$nw -Wlong-long" # C90 is anachronistic (lib/gethrxtime.h) + nw="$nw -Wc++-compat" # We don't care about C++ compilers + nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib + nw="$nw -Wtraditional" # Warns on #elif which we use often + nw="$nw -Wcast-qual" # Too many warnings for now + nw="$nw -Wconversion" # Too many warnings for now + nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings + nw="$nw -Wsign-conversion" # Too many warnings for now + nw="$nw -Wtraditional-conversion" # Too many warnings for now + nw="$nw -Wunreachable-code" # Too many warnings for now + nw="$nw -Wpadded" # Our structs are not padded + nw="$nw -Wredundant-decls" # openat.h declares e.g., mkdirat + nw="$nw -Wlogical-op" # any use of fwrite provokes this + nw="$nw -Wformat-nonliteral" # who.c and pinky.c strftime uses + nw="$nw -Wvla" # warnings in gettext.h + nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__ + nw="$nw -Wswitch-enum" # Too many warnings for now + nw="$nw -Wswitch-default" # Too many warnings for now + nw="$nw -Wstack-protector" # not worth working around + # things I might fix soon: + nw="$nw -Wfloat-equal" # sort.c, seq.c + nw="$nw -Wmissing-format-attribute" # copy.c + nw="$nw -Wunsafe-loop-optimizations" # a few src/*.c + nw="$nw -Winline" # system.h's readdir_ignoring_dot_and_dotdot + nw="$nw -Wstrict-overflow" # expr.c, pr.c, tr.c, factor.c + nw="$nw -Wformat-extra-args" # sdiff.c + # ?? -Wstrict-overflow + + + + if test -n "$GCC"; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is supported" >&5 +printf %s "checking whether -Wno-missing-field-initializers is supported... " >&6; } + if test ${gl_cv_cc_nomfi_supported+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_nomfi_supported=yes +else + gl_cv_cc_nomfi_supported=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_supported" >&5 +printf "%s\n" "$gl_cv_cc_nomfi_supported" >&6; } + + if test "$gl_cv_cc_nomfi_supported" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is needed" >&5 +printf %s "checking whether -Wno-missing-field-initializers is needed... " >&6; } + if test ${gl_cv_cc_nomfi_needed+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int f (void) + { + typedef struct { int a; int b; } s_t; + s_t s1 = { 0, }; + return s1.b; + } + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_nomfi_needed=no +else + gl_cv_cc_nomfi_needed=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_needed" >&5 +printf "%s\n" "$gl_cv_cc_nomfi_needed" >&6; } + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wuninitialized is supported" >&5 +printf %s "checking whether -Wuninitialized is supported... " >&6; } + if test ${gl_cv_cc_uninitialized_supported+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wuninitialized" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_uninitialized_supported=yes +else + gl_cv_cc_uninitialized_supported=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_uninitialized_supported" >&5 +printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; } + + fi + + # List all gcc warning categories. + # To compare this list to your installed GCC's, run this Bash command: + # + # comm -3 \ + # <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \ + # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort | + # grep -v -x -F -f <( + # awk '/^[^#]/ {print ws}' ../build-aux/gcc-warning.spec)) + + gl_manywarn_set= + for gl_manywarn_item in -fno-common \ + -W \ + -Wabi \ + -Waddress \ + -Waggressive-loop-optimizations \ + -Wall \ + -Wattributes \ + -Wbad-function-cast \ + -Wbool-compare \ + -Wbool-operation \ + -Wbuiltin-declaration-mismatch \ + -Wbuiltin-macro-redefined \ + -Wcast-align \ + -Wchar-subscripts \ + -Wchkp \ + -Wclobbered \ + -Wcomment \ + -Wcomments \ + -Wcoverage-mismatch \ + -Wcpp \ + -Wdangling-else \ + -Wdate-time \ + -Wdeprecated \ + -Wdeprecated-declarations \ + -Wdesignated-init \ + -Wdisabled-optimization \ + -Wdiscarded-array-qualifiers \ + -Wdiscarded-qualifiers \ + -Wdiv-by-zero \ + -Wdouble-promotion \ + -Wduplicated-branches \ + -Wduplicated-cond \ + -Wduplicate-decl-specifier \ + -Wempty-body \ + -Wendif-labels \ + -Wenum-compare \ + -Wexpansion-to-defined \ + -Wextra \ + -Wformat-contains-nul \ + -Wformat-extra-args \ + -Wformat-nonliteral \ + -Wformat-security \ + -Wformat-signedness \ + -Wformat-y2k \ + -Wformat-zero-length \ + -Wframe-address \ + -Wfree-nonheap-object \ + -Whsa \ + -Wignored-attributes \ + -Wignored-qualifiers \ + -Wimplicit \ + -Wimplicit-function-declaration \ + -Wimplicit-int \ + -Wincompatible-pointer-types \ + -Winit-self \ + -Winline \ + -Wint-conversion \ + -Wint-in-bool-context \ + -Wint-to-pointer-cast \ + -Winvalid-memory-model \ + -Winvalid-pch \ + -Wjump-misses-init \ + -Wlogical-not-parentheses \ + -Wlogical-op \ + -Wmain \ + -Wmaybe-uninitialized \ + -Wmemset-elt-size \ + -Wmemset-transposed-args \ + -Wmisleading-indentation \ + -Wmissing-braces \ + -Wmissing-declarations \ + -Wmissing-field-initializers \ + -Wmissing-include-dirs \ + -Wmissing-parameter-type \ + -Wmissing-prototypes \ + -Wmultichar \ + -Wnarrowing \ + -Wnested-externs \ + -Wnonnull \ + -Wnonnull-compare \ + -Wnull-dereference \ + -Wodr \ + -Wold-style-declaration \ + -Wold-style-definition \ + -Wopenmp-simd \ + -Woverflow \ + -Woverlength-strings \ + -Woverride-init \ + -Wpacked \ + -Wpacked-bitfield-compat \ + -Wparentheses \ + -Wpointer-arith \ + -Wpointer-compare \ + -Wpointer-sign \ + -Wpointer-to-int-cast \ + -Wpragmas \ + -Wpsabi \ + -Wrestrict \ + -Wreturn-local-addr \ + -Wreturn-type \ + -Wscalar-storage-order \ + -Wsequence-point \ + -Wshadow \ + -Wshift-count-negative \ + -Wshift-count-overflow \ + -Wshift-negative-value \ + -Wsizeof-array-argument \ + -Wsizeof-pointer-memaccess \ + -Wstack-protector \ + -Wstrict-aliasing \ + -Wstrict-overflow \ + -Wstrict-prototypes \ + -Wsuggest-attribute=const \ + -Wsuggest-attribute=format \ + -Wsuggest-attribute=noreturn \ + -Wsuggest-attribute=pure \ + -Wsuggest-final-methods \ + -Wsuggest-final-types \ + -Wswitch \ + -Wswitch-bool \ + -Wswitch-default \ + -Wswitch-unreachable \ + -Wsync-nand \ + -Wsystem-headers \ + -Wtautological-compare \ + -Wtrampolines \ + -Wtrigraphs \ + -Wtype-limits \ + -Wuninitialized \ + -Wunknown-pragmas \ + -Wunsafe-loop-optimizations \ + -Wunused \ + -Wunused-but-set-parameter \ + -Wunused-but-set-variable \ + -Wunused-function \ + -Wunused-label \ + -Wunused-local-typedefs \ + -Wunused-macros \ + -Wunused-parameter \ + -Wunused-result \ + -Wunused-value \ + -Wunused-variable \ + -Wvarargs \ + -Wvariadic-macros \ + -Wvector-operation-performance \ + -Wvla \ + -Wvolatile-register-var \ + -Wwrite-strings \ + \ + ; do + gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" + done + + # gcc --help=warnings outputs an unusual form for these options; list + # them here so that the above 'comm' command doesn't report a false match. + # Would prefer "min (PTRDIFF_MAX, SIZE_MAX)", but it must be a literal: + ptrdiff_max_max=9223372036854775807 + gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$ptrdiff_max_max" + gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2" + gl_manywarn_set="$gl_manywarn_set -Wformat-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wformat-truncation=2" + gl_manywarn_set="$gl_manywarn_set -Wimplicit-fallthrough=5" + gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc" + gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wstringop-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2" + gl_manywarn_set="$gl_manywarn_set -Wvla-larger-than=4031" + + # These are needed for older GCC versions. + if test -n "$GCC"; then + case `($CC --version) 2>/dev/null` in + 'gcc (GCC) '[0-3].* | \ + 'gcc (GCC) '4.[0-7].*) + gl_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option" + gl_manywarn_set="$gl_manywarn_set -funit-at-a-time" + ;; + esac + fi + + # Disable specific options as needed. + if test "$gl_cv_cc_nomfi_needed" = yes; then + gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers" + fi + + if test "$gl_cv_cc_uninitialized_supported" = no; then + gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized" + fi + + ws=$gl_manywarn_set + + + gl_warn_set= + set x $ws; shift + for gl_warn_item + do + case " $nw " in + *" $gl_warn_item "*) + ;; + *) + gl_warn_set="$gl_warn_set $gl_warn_item" + ;; + esac + done + ws=$gl_warn_set + + for w in $ws; do + +as_gl_Warn=`printf "%s\n" "gl_cv_warn_c_$w" | $as_tr_sh` +gl_positive="$w" +case $gl_positive in + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles $w" >&5 +printf %s "checking whether C compiler handles $w... " >&6; } +if eval test \${$as_gl_Warn+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors $gl_positive" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_gl_Warn=yes" +else + eval "$as_gl_Warn=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +eval ac_res=\$$as_gl_Warn + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_gl_Warn"\" = x"yes" +then : + as_fn_append WARN_CFLAGS " $w" +fi + + + done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-missing-field-initializers" >&5 +printf %s "checking whether C compiler handles -Wno-missing-field-initializers... " >&6; } +if test ${gl_cv_warn_c__Wno_missing_field_initializers+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wmissing-field-initializers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_missing_field_initializers=yes +else + gl_cv_warn_c__Wno_missing_field_initializers=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_missing_field_initializers" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_missing_field_initializers" >&6; } +if test "x$gl_cv_warn_c__Wno_missing_field_initializers" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-missing-field-initializers" +fi + + # We need this one + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-sign-compare" >&5 +printf %s "checking whether C compiler handles -Wno-sign-compare... " >&6; } +if test ${gl_cv_warn_c__Wno_sign_compare+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wsign-compare" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_sign_compare=yes +else + gl_cv_warn_c__Wno_sign_compare=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_sign_compare" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_sign_compare" >&6; } +if test "x$gl_cv_warn_c__Wno_sign_compare" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-sign-compare" +fi + + # Too many warnings for now + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-pointer-sign" >&5 +printf %s "checking whether C compiler handles -Wno-pointer-sign... " >&6; } +if test ${gl_cv_warn_c__Wno_pointer_sign+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wpointer-sign" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_pointer_sign=yes +else + gl_cv_warn_c__Wno_pointer_sign=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_pointer_sign" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_pointer_sign" >&6; } +if test "x$gl_cv_warn_c__Wno_pointer_sign" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-pointer-sign" +fi + + # Too many warnings for now + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-unused-parameter" >&5 +printf %s "checking whether C compiler handles -Wno-unused-parameter... " >&6; } +if test ${gl_cv_warn_c__Wno_unused_parameter+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wunused-parameter" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_unused_parameter=yes +else + gl_cv_warn_c__Wno_unused_parameter=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_unused_parameter" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_unused_parameter" >&6; } +if test "x$gl_cv_warn_c__Wno_unused_parameter" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-unused-parameter" +fi + + # Too many warnings for now + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-format-nonliteral" >&5 +printf %s "checking whether C compiler handles -Wno-format-nonliteral... " >&6; } +if test ${gl_cv_warn_c__Wno_format_nonliteral+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wformat-nonliteral" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_format_nonliteral=yes +else + gl_cv_warn_c__Wno_format_nonliteral=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_format_nonliteral" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_format_nonliteral" >&6; } +if test "x$gl_cv_warn_c__Wno_format_nonliteral" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-format-nonliteral" +fi + + + + # In spite of excluding -Wlogical-op above, it is enabled, as of + # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-logical-op" >&5 +printf %s "checking whether C compiler handles -Wno-logical-op... " >&6; } +if test ${gl_cv_warn_c__Wno_logical_op+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wlogical-op" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_logical_op=yes +else + gl_cv_warn_c__Wno_logical_op=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_logical_op" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_logical_op" >&6; } +if test "x$gl_cv_warn_c__Wno_logical_op" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-logical-op" +fi + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -fdiagnostics-show-option" >&5 +printf %s "checking whether C compiler handles -fdiagnostics-show-option... " >&6; } +if test ${gl_cv_warn_c__fdiagnostics_show_option+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -fdiagnostics-show-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__fdiagnostics_show_option=yes +else + gl_cv_warn_c__fdiagnostics_show_option=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__fdiagnostics_show_option" >&5 +printf "%s\n" "$gl_cv_warn_c__fdiagnostics_show_option" >&6; } +if test "x$gl_cv_warn_c__fdiagnostics_show_option" = xyes +then : + as_fn_append WARN_CFLAGS " -fdiagnostics-show-option" +fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -funit-at-a-time" >&5 +printf %s "checking whether C compiler handles -funit-at-a-time... " >&6; } +if test ${gl_cv_warn_c__funit_at_a_time+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -funit-at-a-time" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__funit_at_a_time=yes +else + gl_cv_warn_c__funit_at_a_time=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__funit_at_a_time" >&5 +printf "%s\n" "$gl_cv_warn_c__funit_at_a_time" >&6; } +if test "x$gl_cv_warn_c__funit_at_a_time" = xyes +then : + as_fn_append WARN_CFLAGS " -funit-at-a-time" +fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -fno-common" >&5 +printf %s "checking whether C compiler handles -fno-common... " >&6; } +if test ${gl_cv_warn_c__fno_common+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -fno-common" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__fno_common=yes +else + gl_cv_warn_c__fno_common=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__fno_common" >&5 +printf "%s\n" "$gl_cv_warn_c__fno_common" >&6; } +if test "x$gl_cv_warn_c__fno_common" = xyes +then : + as_fn_append WARN_CFLAGS " -fno-common" +fi + + + + + + +printf "%s\n" "#define lint 1" >>confdefs.h + + +printf "%s\n" "#define _FORTIFY_SOURCE 2" >>confdefs.h + + +printf "%s\n" "#define GNULIB_PORTCHECK 1" >>confdefs.h + + + # We use a slightly smaller set of warning options for lib/. + # Remove the following and save the result in GNULIB_WARN_CFLAGS. + nw= + nw="$nw -Wunused-macros" + nw="$nw -Wmissing-prototypes" + nw="$nw -Wold-style-definition" + nw="$nw -Wsuggest-attribute=pure" + + gl_warn_set= + set x $WARN_CFLAGS; shift + for gl_warn_item + do + case " $nw " in + *" $gl_warn_item "*) + ;; + *) + gl_warn_set="$gl_warn_set $gl_warn_item" + ;; + esac + done + GNULIB_WARN_CFLAGS=$gl_warn_set + + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for variable-length arrays" >&5 +printf %s "checking for variable-length arrays... " >&6; } +if test ${ac_cv_c_vararrays+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC_NO_VLA__ + defined + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "defined" >/dev/null 2>&1 +then : + ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined' +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test for VLA support. This test is partly inspired + from examples in the C standard. Use at least two VLA + functions to detect the GCC 3.4.3 bug described in: + http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html + */ + #ifdef __STDC_NO_VLA__ + syntax error; + #else + extern int n; + int B[100]; + int fvla (int m, int C[m][m]); + + int + simple (int count, int all[static count]) + { + return all[count - 1]; + } + + int + fvla (int m, int C[m][m]) + { + typedef int VLA[m][m]; + VLA x; + int D[m]; + static int (*q)[m] = &B; + int (*s)[n] = q; + return C && &x[0][0] == &D[0] && &D[0] == s[0]; + } + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_vararrays=yes +else + ac_cv_c_vararrays=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -rf conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_vararrays" >&5 +printf "%s\n" "$ac_cv_c_vararrays" >&6; } + if test "$ac_cv_c_vararrays" = yes; then + +printf "%s\n" "#define HAVE_C_VARARRAYS 1" >>confdefs.h + + elif test "$ac_cv_c_vararrays" = no; then + +printf "%s\n" "#define __STDC_NO_VLA__ 1" >>confdefs.h + + fi + + + +printf "%s\n" "#define DEFAULT_EDITOR_PROGRAM \"ed\"" >>confdefs.h + + +# Extract the first word of "pr", so it can be a program name with args. +set dummy pr; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PR_PROGRAM+y} +then : + printf %s "(cached) " >&6 +else + case $PR_PROGRAM in + [\\/]* | ?:[\\/]*) + ac_cv_path_PR_PROGRAM="$PR_PROGRAM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PR_PROGRAM="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PR_PROGRAM" && ac_cv_path_PR_PROGRAM="""" + ;; +esac +fi +PR_PROGRAM=$ac_cv_path_PR_PROGRAM +if test -n "$PR_PROGRAM"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PR_PROGRAM" >&5 +printf "%s\n" "$PR_PROGRAM" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +printf "%s\n" "#define PR_PROGRAM \"$PR_PROGRAM\"" >>confdefs.h + + +ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_blksize" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLKSIZE 1" >>confdefs.h + + +fi + +ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_rdev" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_RDEV 1" >>confdefs.h + + +fi + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +printf %s "checking for $ac_hdr that defines DIR... " >&6; } +if eval test \${$as_ac_Header+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <$ac_hdr> + +int +main (void) +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_ac_Header=yes" +else + eval "$as_ac_Header=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_ac_Header + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main (void) +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test ${ac_cv_search_opendir+y} +then : + break +fi +done +if test ${ac_cv_search_opendir+y} +then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main (void) +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test ${ac_cv_search_opendir+y} +then : + break +fi +done +if test ${ac_cv_search_opendir+y} +then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 +printf %s "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } +if test ${ac_cv_header_sys_wait_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <sys/wait.h> +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) +#endif +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif + +int +main (void) +{ + int s; + wait (&s); + s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_header_sys_wait_h=yes +else + ac_cv_header_sys_wait_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 +printf "%s\n" "$ac_cv_header_sys_wait_h" >&6; } +if test $ac_cv_header_sys_wait_h = yes; then + +printf "%s\n" "#define HAVE_SYS_WAIT_H 1" >>confdefs.h + +fi + +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = xyes +then : + +else + +printf "%s\n" "#define pid_t int" >>confdefs.h + +fi + + + + + + +if test $ac_cv_func_sigprocmask = no; then + ac_fn_c_check_func "$LINENO" "sigblock" "ac_cv_func_sigblock" +if test "x$ac_cv_func_sigblock" = xyes +then : + printf "%s\n" "#define HAVE_SIGBLOCK 1" >>confdefs.h + +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5 +printf %s "checking whether closedir returns void... " >&6; } +if test ${ac_cv_func_closedir_void+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + ac_cv_func_closedir_void=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header_dirent> +#ifndef __cplusplus +int closedir (); +#endif + +int +main (void) +{ +return closedir (opendir (".")) != 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_closedir_void=no +else + ac_cv_func_closedir_void=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_closedir_void" >&5 +printf "%s\n" "$ac_cv_func_closedir_void" >&6; } +if test $ac_cv_func_closedir_void = yes; then + +printf "%s\n" "#define CLOSEDIR_VOID 1" >>confdefs.h + +fi + + + + + + +if test "x$ac_cv_func_fork" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 +printf %s "checking for working fork... " >&6; } +if test ${ac_cv_func_fork_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + ac_cv_func_fork_works=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* By Ruediger Kuhlmann. */ + return fork () < 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_fork_works=yes +else + ac_cv_func_fork_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 +printf "%s\n" "$ac_cv_func_fork_works" >&6; } + +else + ac_cv_func_fork_works=$ac_cv_func_fork +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 +printf %s "checking for working vfork... " >&6; } +if test ${ac_cv_func_vfork_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + ac_cv_func_vfork_works=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Thanks to Paul Eggert for this test. */ +$ac_includes_default +#include <signal.h> +#include <sys/wait.h> +#ifdef HAVE_VFORK_H +# include <vfork.h> +#endif + +static void +do_nothing (int sig) +{ + (void) sig; +} + +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include <vfork.h>, but some compilers + (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static void +sparc_address_test (int arg) +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} + +int +main (void) +{ + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (0); + + /* On Solaris 2.4, changes by the child to the signal handler + also munge signal handlers in the parent. To detect this, + start by putting the parent's handler in a known state. */ + signal (SIGTERM, SIG_DFL); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* Alter the child's signal handler. */ + if (signal (SIGTERM, do_nothing) != SIG_DFL) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + return ( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child munge the parent's signal handler? */ + || signal (SIGTERM, SIG_DFL) != SIG_DFL + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_vfork_works=yes +else + ac_cv_func_vfork_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 +printf "%s\n" "$ac_cv_func_vfork_works" >&6; } + +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=$ac_cv_func_vfork + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} +fi + +if test "x$ac_cv_func_vfork_works" = xyes; then + +printf "%s\n" "#define HAVE_WORKING_VFORK 1" >>confdefs.h + +else + +printf "%s\n" "#define vfork fork" >>confdefs.h + +fi +if test "x$ac_cv_func_fork_works" = xyes; then + +printf "%s\n" "#define HAVE_WORKING_FORK 1" >>confdefs.h + +fi + + +# When .tarball-version exists, we're building from a tarball +# and must not make man/*.1 files depend on the generated src/version.c, +# because that would induce a requirement to run the help2man perl script. +# We are not yet prepared to make perl a build-from-tarball requirement. +# Hence, here we detect .tarball-version existence. When not present, +# we define a variable to be used in man/Makefile.am to induce the +# proper dependency (so that man/*.1 will be rebuilt upon any version change), +# but not when built from a tarball. + +test -f $srcdir/.tarball-version \ + && SRC_VERSION_C= \ + || SRC_VERSION_C=../src/version.c + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +printf %s "checking whether NLS is requested... " >&6; } + # Check whether --enable-nls was given. +if test ${enable_nls+y} +then : + enableval=$enable_nls; USE_NLS=$enableval +else + USE_NLS=yes +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$USE_NLS" >&6; } + + + + + GETTEXT_MACRO_VERSION=0.19 + + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MSGFMT+y} +then : + printf %s "(cached) " >&6 +else + case "$MSGFMT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +printf "%s\n" "$MSGFMT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_GMSGFMT+y} +then : + printf %s "(cached) " >&6 +else + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +printf "%s\n" "$GMSGFMT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; + *) MSGFMT_015=$MSGFMT ;; + esac + + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_XGETTEXT+y} +then : + printf %s "(cached) " >&6 +else + case "$XGETTEXT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +printf "%s\n" "$XGETTEXT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + rm -f messages.po + + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MSGMERGE+y} +then : + printf %s "(cached) " >&6 +else + case "$MSGMERGE" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" + ;; +esac +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 +printf "%s\n" "$MSGMERGE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$localedir" || localedir='${datadir}/locale' + + + test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + + + ac_config_commands="$ac_config_commands po-directories" + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 +printf %s "checking for CFPreferencesCopyAppValue... " >&6; } +if test ${gt_cv_func_CFPreferencesCopyAppValue+y} +then : + printf %s "(cached) " >&6 +else + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <CoreFoundation/CFPreferences.h> +int +main (void) +{ +CFPreferencesCopyAppValue(NULL, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gt_cv_func_CFPreferencesCopyAppValue=yes +else + gt_cv_func_CFPreferencesCopyAppValue=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 +printf "%s\n" "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + +printf "%s\n" "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 +printf %s "checking for CFLocaleCopyCurrent... " >&6; } +if test ${gt_cv_func_CFLocaleCopyCurrent+y} +then : + printf %s "(cached) " >&6 +else + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <CoreFoundation/CFLocale.h> +int +main (void) +{ +CFLocaleCopyCurrent(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gt_cv_func_CFLocaleCopyCurrent=yes +else + gt_cv_func_CFLocaleCopyCurrent=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 +printf "%s\n" "$gt_cv_func_CFLocaleCopyCurrent" >&6; } + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + +printf "%s\n" "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h + + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + fi + + + + + + + LIBINTL= + LTLIBINTL= + POSUB= + + case " $gt_needs " in + *" need-formatstring-macros "*) gt_api_version=3 ;; + *" need-ngettext "*) gt_api_version=2 ;; + *) gt_api_version=1 ;; + esac + gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" + gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + + + if test $gt_api_version -ge 3; then + gt_revision_test_code=' +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +' + else + gt_revision_test_code= + fi + if test $gt_api_version -ge 2; then + gt_expression_test_code=' + * ngettext ("", "", 0)' + else + gt_expression_test_code= + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 +printf %s "checking for GNU gettext in libc... " >&6; } +if eval test \${$gt_func_gnugettext_libc+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <libintl.h> +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$gt_func_gnugettext_libc=yes" +else + eval "$gt_func_gnugettext_libc=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$gt_func_gnugettext_libc + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +printf %s "checking for iconv... " >&6; } +if test ${am_cv_func_iconv+y} +then : + printf %s "(cached) " >&6 +else + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdlib.h> +#include <iconv.h> + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdlib.h> +#include <iconv.h> + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +printf "%s\n" "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +printf %s "checking for working iconv... " >&6; } +if test ${am_cv_func_iconv_works+y} +then : + printf %s "(cached) " >&6 +else + + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + if test "$cross_compiling" = yes +then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <iconv.h> +#include <string.h> + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + +int +main (void) +{ +int result = 0; + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\263"; + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + result |= 8; + iconv_close (cd_88591_to_utf8); + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + result |= 16; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + am_cv_func_iconv_works=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + test "$am_cv_func_iconv_works" = no || break + done + LIBS="$am_save_LIBS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +printf "%s\n" "$am_cv_func_iconv_works" >&6; } + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + +printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +printf %s "checking how to link with libiconv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +printf "%s\n" "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libintl-prefix was given. +if test ${with_libintl_prefix+y} +then : + withval=$with_libintl_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBINTL= + LTLIBINTL= + INCINTL= + LIBINTL_PREFIX= + HAVE_LIBINTL= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='intl ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" + ;; + esac + done + fi + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" + done + fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 +printf %s "checking for GNU gettext in libintl... " >&6; } +if eval test \${$gt_func_gnugettext_libintl+y} +then : + printf %s "(cached) " >&6 +else + gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <libintl.h> +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$gt_func_gnugettext_libintl=yes" +else + eval "$gt_func_gnugettext_libintl=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <libintl.h> +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS" +fi +eval ac_res=\$$gt_func_gnugettext_libintl + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + fi + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ + || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + + + if test -n "$INTL_MACOSX_LIBS"; then + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" + LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" + fi + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + +printf "%s\n" "#define ENABLE_NLS 1" >>confdefs.h + + else + USE_NLS=no + fi + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 +printf %s "checking whether to use NLS... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$USE_NLS" >&6; } + if test "$USE_NLS" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 +printf %s "checking where the gettext function comes from... " >&6; } + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 +printf "%s\n" "$gt_source" >&6; } + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 +printf %s "checking how to link with libintl... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 +printf "%s\n" "$LIBINTL" >&6; } + + for element in $INCINTL; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + fi + + +printf "%s\n" "#define HAVE_GETTEXT 1" >>confdefs.h + + +printf "%s\n" "#define HAVE_DCGETTEXT 1" >>confdefs.h + + fi + + POSUB=po + fi + + + + INTLLIBS="$LIBINTL" + + + + + + + +XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT" + +ac_config_files="$ac_config_files Makefile doc/Makefile lib/Makefile src/Makefile tests/Makefile gnulib-tests/Makefile man/Makefile po/Makefile.in" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then + as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +test "X$DEFS" = X-DHAVE_CONFIG_H && DEFS= +if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GNU_MAKE_TRUE}" && test -z "${GNU_MAKE_FALSE}"; then + as_fn_error $? "conditional \"GNU_MAKE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +CONFIG_INCLUDE=lib/config.h + +if test -z "${GL_GENERATE_STDARG_H_TRUE}" && test -z "${GL_GENERATE_STDARG_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDARG_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE}"; then + as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE}"; then + as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE}"; then + as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + + gl_libobjs= + gl_ltlibobjs= + if test -n "$gl_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do + gl_libobjs="$gl_libobjs $i.$ac_objext" + gl_ltlibobjs="$gl_ltlibobjs $i.lo" + done + fi + gl_LIBOBJS=$gl_libobjs + + gl_LTLIBOBJS=$gl_ltlibobjs + + + +if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_NETINET_IN_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + gltests_libobjs= + gltests_ltlibobjs= + if test -n "$gltests_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do + gltests_libobjs="$gltests_libobjs $i.$ac_objext" + gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" + done + fi + gltests_LIBOBJS=$gltests_libobjs + + gltests_LTLIBOBJS=$gltests_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by GNU diffutils $as_me 3.6, which was +generated by GNU Autoconf 2.69.185-b502e. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_links="$ac_config_links" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration links: +$config_links + +Configuration commands: +$config_commands + +Report bugs to <bug-diffutils@gnu.org>. +GNU diffutils home page: <http://www.gnu.org/software/diffutils/>. +General help using GNU software: <http://www.gnu.org/gethelp/>." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`printf "%s\n" "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +GNU diffutils config.status 3.6 +configured by $0, generated by GNU Autoconf 2.69.185-b502e, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2017 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + printf "%s\n" "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + printf "%s\n" "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + printf "%s\n" "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + printf "%s\n" "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" +GNUmakefile=$GNUmakefile +# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it + # from automake < 1.5. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "lib/config.h") CONFIG_HEADERS="$CONFIG_HEADERS lib/config.h:lib/config.hin" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "$GNUmakefile") CONFIG_LINKS="$CONFIG_LINKS $GNUmakefile:$GNUmakefile" ;; + "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "gnulib-tests/Makefile") CONFIG_FILES="$CONFIG_FILES gnulib-tests/Makefile" ;; + "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_LINKS+y} || CONFIG_LINKS=$config_links + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' <conf$$subs.awk | sed ' +/^[^""]/{ + N + s/\n// +} +' >>$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' <confdefs.h | sed ' +s/'"$ac_delim"'/"\\\ +"/g' >>$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`printf "%s\n" "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + printf "%s\n" "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + printf "%s\n" "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + :L) + # + # CONFIG_LINK + # + + if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then + : + else + # Prefer the file from the source tree if names are identical. + if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then + ac_source=$srcdir/$ac_source + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5 +printf "%s\n" "$as_me: linking $ac_source to $ac_file" >&6;} + + if test ! -r "$ac_source"; then + as_fn_error $? "$ac_source: file not found" "$LINENO" 5 + fi + rm -f "$ac_file" + + # Try a relative symlink, then a hard link, then a copy. + case $ac_source in + [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; + *) ac_rel_source=$ac_top_build_prefix$ac_source ;; + esac + ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || + ln "$ac_source" "$ac_file" 2>/dev/null || + cp -p "$ac_source" "$ac_file" || + as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5 + fi + ;; + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + "po-directories":C) + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + # Treat a directory as a PO directory if and only if it has a + # POTFILES.in file. This allows packages to have multiple PO + # directories under different names or in different locations. + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/local/recipes/tools/diffutils/source/dist-check.mk b/local/recipes/tools/diffutils/source/dist-check.mk new file mode 100644 index 0000000000..06d8d90e09 --- /dev/null +++ b/local/recipes/tools/diffutils/source/dist-check.mk @@ -0,0 +1,171 @@ +# Most of this is probably too coreutils-centric to be useful to other packages. + +bin=bin-$$$$ + +write_loser = printf '\#!%s\necho $$0: bad path 1>&2; exit 1\n' '$(SHELL)' + +tmpdir = $(abs_top_builddir)/tests/torture + +t=$(tmpdir)/$(PACKAGE)/test +pfx=$(t)/i + +built_programs = \ + $$(echo 'spy:;@echo $$(bin_PROGRAMS)' \ + | MAKEFLAGS= $(MAKE) -s -C src -f Makefile -f - spy \ + | fmt -1 | sed 's,$(EXEEXT)$$,,' | sort -u) + +# More than once, tainted build and source directory names would +# have caused at least one "make check" test to apply "chmod 700" +# to all directories under $HOME. Make sure it doesn't happen again. +tp = $(tmpdir)/taint +t_prefix = $(tp)/a +t_taint = '$(t_prefix) b' +fake_home = $(tp)/home + +# When extracting from a distribution tarball, extract using the fastest +# method possible. With dist-xz, that means using the *.xz file. +ifneq ('', $(filter *.xz, $(DIST_ARCHIVES))) + tar_decompress_opt_ = J + suffix_ = xz +else + ifneq ('', $(filter *.gz, $(DIST_ARCHIVES))) + tar_decompress_opt_ = z + suffix_ = gz + else + tar_decompress_opt_ = j + suffix_ = bz2 + endif +endif +amtar_extract_ = $(AMTAR) -$(tar_decompress_opt_)xf +preferred_tarball_ = $(distdir).tar.$(suffix_) + +# Ensure that tests run from tainted build and src dir names work, +# and don't affect anything in $HOME. Create witness files in $HOME, +# record their attributes, and build/test. Then ensure that the +# witnesses were not affected. +# Skip this test when using libtool, since libtool-generated scripts +# cannot deal with a space-tainted srcdir. +ALL_RECURSIVE_TARGETS += taint-distcheck +taint-distcheck: $(DIST_ARCHIVES) + grep '^[ ]*LT_INIT' configure.ac >/dev/null && exit 0 || : + test -d $(t_taint) && chmod -R 700 $(t_taint) || : + -rm -rf $(t_taint) $(fake_home) + mkdir -p $(t_prefix) $(t_taint) $(fake_home) + $(amtar_extract_) $(preferred_tarball_) -C $(t_taint) + mkfifo $(fake_home)/fifo + touch $(fake_home)/f + mkdir -p $(fake_home)/d/e + ls -lR $(fake_home) $(t_prefix) > $(tp)/.ls-before + HOME=$(fake_home); export HOME; \ + cd $(t_taint)/$(distdir) \ + && ./configure \ + && $(MAKE) \ + && $(MAKE) check \ + && ls -lR $(fake_home) $(t_prefix) > $(tp)/.ls-after \ + && diff $(tp)/.ls-before $(tp)/.ls-after \ + && test -d $(t_prefix) + rm -rf $(tp) + +# Verify that a twisted use of --program-transform-name=PROGRAM works. +define install-transform-check + echo running install-transform-check \ + && rm -rf $(pfx) \ + && $(MAKE) program_transform_name='s/.*/zyx/' \ + prefix=$(pfx) install \ + && test "$$(echo $(pfx)/bin/*)" = "$(pfx)/bin/zyx" \ + && test "$$(find $(pfx)/share/man -type f|sed 's,.*/,,;s,\..*,,')" = "zyx" +endef + +# Install, then verify that all binaries and man pages are in place. +# Note that neither the binary, ginstall, nor the [.1 man page is installed. +define my-instcheck + echo running my-instcheck; \ + $(MAKE) prefix=$(pfx) install \ + && test ! -f $(pfx)/bin/ginstall \ + && { fail=0; \ + for i in $(built_programs); do \ + test "$$i" = ginstall && i=install; \ + for j in "$(pfx)/bin/$$i" \ + "$(pfx)/share/man/man1/$$i.1"; do \ + case $$j in *'[.1') continue;; esac; \ + test -f "$$j" && : \ + || { echo "$$j not installed"; fail=1; }; \ + done; \ + done; \ + test $$fail = 1 && exit 1 || :; \ + } +endef + +# The hard-linking for-loop below ensures that there is a bin/ directory +# full of all of the programs under test (except the ones that are required +# for basic Makefile rules), all symlinked to the just-built "false" program. +# This is to ensure that if ever a test neglects to make PATH include +# the build srcdir, these always-failing programs will run. +# Otherwise, it is too easy to test the wrong programs. +# Note that "false" itself is a symlink to true, so it too will malfunction. +define coreutils-path-check + { \ + echo running coreutils-path-check; \ + if test -f $(srcdir)/src/true.c; then \ + fail=1; \ + mkdir $(bin) \ + && ($(write_loser)) > $(bin)/loser \ + && chmod a+x $(bin)/loser \ + && for i in $(built_programs); do \ + case $$i in \ + rm|expr|basename|echo|sort|ls|tr);; \ + cat|dirname|mv|wc);; \ + *) ln $(bin)/loser $(bin)/$$i;; \ + esac; \ + done \ + && ln -sf ../src/true $(bin)/false \ + && PATH=`pwd`/$(bin)$(PATH_SEPARATOR)$$PATH \ + $(MAKE) -C tests check \ + && { test -d gnulib-tests \ + && $(MAKE) -C gnulib-tests check \ + || :; } \ + && rm -rf $(bin) \ + && fail=0; \ + else \ + fail=0; \ + fi; \ + test $$fail = 1 && exit 1 || :; \ + } +endef + +# Use this to make sure we don't run these programs when building +# from a virgin compressed tarball file, below. +null_AM_MAKEFLAGS ?= \ + ACLOCAL=false \ + AUTOCONF=false \ + AUTOMAKE=false \ + AUTOHEADER=false \ + GPERF=false \ + MAKEINFO=false + +ALL_RECURSIVE_TARGETS += my-distcheck +my-distcheck: $(DIST_ARCHIVES) $(local-check) + $(MAKE) syntax-check + $(MAKE) check + -rm -rf $(t) + mkdir -p $(t) + $(amtar_extract_) $(preferred_tarball_) -C $(t) + (set -e; cd $(t)/$(distdir); \ + ./configure --quiet --enable-gcc-warnings --disable-nls; \ + $(MAKE) AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)'; \ + $(MAKE) dvi; \ + $(install-transform-check); \ + $(my-instcheck); \ + $(coreutils-path-check); \ + $(MAKE) distclean \ + ) + (cd $(t) && mv $(distdir) $(distdir).old \ + && $(amtar_extract_) - ) < $(preferred_tarball_) + find $(t)/$(distdir).old $(t)/$(distdir) -name .deps | xargs rm -rf + diff -ur $(t)/$(distdir).old $(t)/$(distdir) + -rm -rf $(t) + rmdir $(tmpdir)/$(PACKAGE) $(tmpdir) + @echo "========================"; \ + echo "ready for distribution:"; \ + for i in $(DIST_ARCHIVES); do echo " $$i"; done; \ + echo "========================" diff --git a/local/recipes/tools/diffutils/source/doc/Makefile.am b/local/recipes/tools/diffutils/source/doc/Makefile.am new file mode 100644 index 0000000000..2fbfc69efe --- /dev/null +++ b/local/recipes/tools/diffutils/source/doc/Makefile.am @@ -0,0 +1,23 @@ +# Makefile for GNU diffutils documentation. + +# Copyright (C) 2001-2002, 2009-2013, 2015-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +AM_MAKEINFOFLAGS = --no-split + +info_TEXINFOS = diffutils.texi +diffutils_TEXINFOS = fdl.texi + +EXTRA_DIST = diagmeet.note diff --git a/local/recipes/tools/diffutils/source/doc/Makefile.in b/local/recipes/tools/diffutils/source/doc/Makefile.in new file mode 100644 index 0000000000..6b487e5cea --- /dev/null +++ b/local/recipes/tools/diffutils/source/doc/Makefile.in @@ -0,0 +1,1737 @@ +# Makefile.in generated by automake 1.18.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2025 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile for GNU diffutils documentation. + +# Copyright (C) 2001-2002, 2009-2013, 2015-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +am__rm_f = rm -f $(am__rm_f_notfound) +am__rm_rf = rm -rf $(am__rm_f_notfound) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = doc +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ + $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \ + $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/btowc.m4 \ + $(top_srcdir)/m4/builtin-expect.m4 $(top_srcdir)/m4/c-stack.m4 \ + $(top_srcdir)/m4/clock_time.m4 $(top_srcdir)/m4/close.m4 \ + $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \ + $(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/ctype.m4 \ + $(top_srcdir)/m4/dirname.m4 \ + $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/extensions.m4 \ + $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fcntl-o.m4 \ + $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/filenamecat.m4 \ + $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \ + $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpieee.m4 \ + $(top_srcdir)/m4/freopen.m4 $(top_srcdir)/m4/fstat.m4 \ + $(top_srcdir)/m4/ftruncate.m4 $(top_srcdir)/m4/getcwd.m4 \ + $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/getpagesize.m4 \ + $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnu-make.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 \ + $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \ + $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \ + $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttostr.m4 \ + $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \ + $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \ + $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/iswblank.m4 \ + $(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ + $(top_srcdir)/m4/libunistring-base.m4 \ + $(top_srcdir)/m4/limits-h.m4 $(top_srcdir)/m4/localcharset.m4 \ + $(top_srcdir)/m4/locale-fr.m4 $(top_srcdir)/m4/locale-ja.m4 \ + $(top_srcdir)/m4/locale-tr.m4 $(top_srcdir)/m4/locale-zh.m4 \ + $(top_srcdir)/m4/locale_h.m4 $(top_srcdir)/m4/localeconv.m4 \ + $(top_srcdir)/m4/localtime-buffer.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ + $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/mbchar.m4 \ + $(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbslen.m4 \ + $(top_srcdir)/m4/mbsrtowcs.m4 $(top_srcdir)/m4/mbstate_t.m4 \ + $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \ + $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mkstemp.m4 \ + $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/mmap-anon.m4 \ + $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \ + $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \ + $(top_srcdir)/m4/nanosleep.m4 $(top_srcdir)/m4/netinet_in_h.m4 \ + $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \ + $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ + $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \ + $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/regex.m4 \ + $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/setlocale.m4 \ + $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/signalblocking.m4 \ + $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/socketlib.m4 \ + $(top_srcdir)/m4/sockets.m4 $(top_srcdir)/m4/socklen.m4 \ + $(top_srcdir)/m4/sockpfaf.m4 $(top_srcdir)/m4/ssize_t.m4 \ + $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \ + $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \ + $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/strcase.m4 $(top_srcdir)/m4/strerror.m4 \ + $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/strftime.m4 \ + $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strings_h.m4 \ + $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ + $(top_srcdir)/m4/strptime.m4 $(top_srcdir)/m4/strtoull.m4 \ + $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/symlink.m4 \ + $(top_srcdir)/m4/sys_ioctl_h.m4 \ + $(top_srcdir)/m4/sys_select_h.m4 \ + $(top_srcdir)/m4/sys_socket_h.m4 \ + $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ + $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \ + $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \ + $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \ + $(top_srcdir)/m4/time_rz.m4 $(top_srcdir)/m4/timegm.m4 \ + $(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \ + $(top_srcdir)/m4/tzset.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vararrays.m4 \ + $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vasprintf.m4 \ + $(top_srcdir)/m4/version-etc.m4 \ + $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \ + $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ + $(top_srcdir)/m4/wctomb.m4 $(top_srcdir)/m4/wctype_h.m4 \ + $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \ + $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xstrtol.m4 \ + $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/version.texi \ + $(srcdir)/stamp-vti $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/lib/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +AM_V_DVIPS = $(am__v_DVIPS_@AM_V@) +am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@) +am__v_DVIPS_0 = @echo " DVIPS " $@; +am__v_DVIPS_1 = +AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@) +am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@) +am__v_MAKEINFO_0 = @echo " MAKEINFO" $@; +am__v_MAKEINFO_1 = +AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@) +am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@) +am__v_INFOHTML_0 = @echo " INFOHTML" $@; +am__v_INFOHTML_1 = +AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@) +am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@) +am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@; +am__v_TEXI2DVI_1 = +AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@) +am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@) +am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@; +am__v_TEXI2PDF_1 = +AM_V_texinfo = $(am__v_texinfo_@AM_V@) +am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@) +am__v_texinfo_0 = -q +am__v_texinfo_1 = +AM_V_texidevnull = $(am__v_texidevnull_@AM_V@) +am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@) +am__v_texidevnull_0 = > /dev/null +am__v_texidevnull_1 = +INFO_DEPS = $(srcdir)/diffutils.info +TEXINFO_TEX = $(top_srcdir)/build-aux/texinfo.tex +am__TEXINFO_TEX_DIR = $(top_srcdir)/build-aux +DVIS = diffutils.dvi +PDFS = diffutils.pdf +PSS = diffutils.ps +HTMLS = diffutils.html +TEXINFOS = diffutils.texi +TEXI2DVI = texi2dvi +TEXI2PDF = $(TEXI2DVI) --pdf --batch +MAKEINFOHTML = $(MAKEINFO) --html +AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) +DVIPS = dvips +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__installdirs = "$(DESTDIR)$(infodir)" +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ + } +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(diffutils_TEXINFOS) $(srcdir)/Makefile.in \ + $(top_srcdir)/build-aux/mdate-sh \ + $(top_srcdir)/build-aux/texinfo.tex +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkglibexecdir = @pkglibexecdir@ +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_INCLUDE = @CONFIG_INCLUDE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ +EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ +ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ +ENOLINK_VALUE = @ENOLINK_VALUE@ +EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ +EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ +ERRNO_H = @ERRNO_H@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FLOAT_H = @FLOAT_H@ +FNMATCH_H = @FNMATCH_H@ +GETOPT_CDEFS_H = @GETOPT_CDEFS_H@ +GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIBC21 = @GLIBC21@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ +GNULIB_CHDIR = @GNULIB_CHDIR@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_CTIME = @GNULIB_CTIME@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ +GNULIB_DUP = @GNULIB_DUP@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_DUP3 = @GNULIB_DUP3@ +GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ +GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ +GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ +GNULIB_FCNTL = @GNULIB_FCNTL@ +GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ +GNULIB_FDOPEN = @GNULIB_FDOPEN@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FFS = @GNULIB_FFS@ +GNULIB_FFSL = @GNULIB_FFSL@ +GNULIB_FFSLL = @GNULIB_FFSLL@ +GNULIB_FGETC = @GNULIB_FGETC@ +GNULIB_FGETS = @GNULIB_FGETS@ +GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPURGE = @GNULIB_FPURGE@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ +GNULIB_FREAD = @GNULIB_FREAD@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ +GNULIB_FSCANF = @GNULIB_FSCANF@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSTAT = @GNULIB_FSTAT@ +GNULIB_FSTATAT = @GNULIB_FSTATAT@ +GNULIB_FSYNC = @GNULIB_FSYNC@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETC = @GNULIB_GETC@ +GNULIB_GETCHAR = @GNULIB_GETCHAR@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ +GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ +GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ +GNULIB_GRANTPT = @GNULIB_GRANTPT@ +GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ +GNULIB_ICONV = @GNULIB_ICONV@ +GNULIB_IMAXABS = @GNULIB_IMAXABS@ +GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ +GNULIB_IOCTL = @GNULIB_IOCTL@ +GNULIB_ISATTY = @GNULIB_ISATTY@ +GNULIB_ISBLANK = @GNULIB_ISBLANK@ +GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ +GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LINKAT = @GNULIB_LINKAT@ +GNULIB_LISTEN = @GNULIB_LISTEN@ +GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ +GNULIB_LOCALTIME = @GNULIB_LOCALTIME@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MBTOWC = @GNULIB_MBTOWC@ +GNULIB_MEMCHR = @GNULIB_MEMCHR@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKFIFO = @GNULIB_MKFIFO@ +GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ +GNULIB_MKNOD = @GNULIB_MKNOD@ +GNULIB_MKNODAT = @GNULIB_MKNODAT@ +GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ +GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ +GNULIB_MKTIME = @GNULIB_MKTIME@ +GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ +GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ +GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_OPENAT = @GNULIB_OPENAT@ +GNULIB_OVERRIDES_STRUCT_STAT = @GNULIB_OVERRIDES_STRUCT_STAT@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ +GNULIB_PCLOSE = @GNULIB_PCLOSE@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PIPE = @GNULIB_PIPE@ +GNULIB_PIPE2 = @GNULIB_PIPE2@ +GNULIB_POPEN = @GNULIB_POPEN@ +GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ +GNULIB_PREAD = @GNULIB_PREAD@ +GNULIB_PRINTF = @GNULIB_PRINTF@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PSELECT = @GNULIB_PSELECT@ +GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ +GNULIB_PTSNAME = @GNULIB_PTSNAME@ +GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ +GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ +GNULIB_RAISE = @GNULIB_RAISE@ +GNULIB_RANDOM = @GNULIB_RANDOM@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ +GNULIB_READ = @GNULIB_READ@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_READLINKAT = @GNULIB_READLINKAT@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_REALPATH = @GNULIB_REALPATH@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ +GNULIB_REMOVE = @GNULIB_REMOVE@ +GNULIB_RENAME = @GNULIB_RENAME@ +GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ +GNULIB_RMDIR = @GNULIB_RMDIR@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SCANF = @GNULIB_SCANF@ +GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ +GNULIB_SELECT = @GNULIB_SELECT@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ +GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ +GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ +GNULIB_SIGACTION = @GNULIB_SIGACTION@ +GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ +GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STAT = @GNULIB_STAT@ +GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ +GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ +GNULIB_STRFTIME = @GNULIB_STRFTIME@ +GNULIB_STRNCAT = @GNULIB_STRNCAT@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRPTIME = @GNULIB_STRPTIME@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ +GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ +GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ +GNULIB_SYMLINK = @GNULIB_SYMLINK@ +GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ +GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ +GNULIB_TIMEGM = @GNULIB_TIMEGM@ +GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ +GNULIB_TMPFILE = @GNULIB_TMPFILE@ +GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ +GNULIB_TRUNCATE = @GNULIB_TRUNCATE@ +GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ +GNULIB_TZSET = @GNULIB_TZSET@ +GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ +GNULIB_UNLINK = @GNULIB_UNLINK@ +GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ +GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ +GNULIB_USLEEP = @GNULIB_USLEEP@ +GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VFSCANF = @GNULIB_VFSCANF@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSCANF = @GNULIB_VSCANF@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WAITPID = @GNULIB_WAITPID@ +GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@ +GNULIB_WCPCPY = @GNULIB_WCPCPY@ +GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ +GNULIB_WCSCAT = @GNULIB_WCSCAT@ +GNULIB_WCSCHR = @GNULIB_WCSCHR@ +GNULIB_WCSCMP = @GNULIB_WCSCMP@ +GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ +GNULIB_WCSCPY = @GNULIB_WCSCPY@ +GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ +GNULIB_WCSDUP = @GNULIB_WCSDUP@ +GNULIB_WCSFTIME = @GNULIB_WCSFTIME@ +GNULIB_WCSLEN = @GNULIB_WCSLEN@ +GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ +GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ +GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ +GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ +GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ +GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCSSPN = @GNULIB_WCSSPN@ +GNULIB_WCSSTR = @GNULIB_WCSSTR@ +GNULIB_WCSTOK = @GNULIB_WCSTOK@ +GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ +GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ +GNULIB_WCTOB = @GNULIB_WCTOB@ +GNULIB_WCTOMB = @GNULIB_WCTOMB@ +GNULIB_WCTRANS = @GNULIB_WCTRANS@ +GNULIB_WCTYPE = @GNULIB_WCTYPE@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ +GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ +GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ +GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ +GNULIB_WMEMSET = @GNULIB_WMEMSET@ +GNULIB_WRITE = @GNULIB_WRITE@ +GNULIB__EXIT = @GNULIB__EXIT@ +HAVE_ACCEPT4 = @HAVE_ACCEPT4@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ +HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ +HAVE_CHOWN = @HAVE_CHOWN@ +HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ +HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ +HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ +HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ +HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ +HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ +HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ +HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_DUP3 = @HAVE_DUP3@ +HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_FACCESSAT = @HAVE_FACCESSAT@ +HAVE_FCHDIR = @HAVE_FCHDIR@ +HAVE_FCHMODAT = @HAVE_FCHMODAT@ +HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FCNTL = @HAVE_FCNTL@ +HAVE_FDATASYNC = @HAVE_FDATASYNC@ +HAVE_FEATURES_H = @HAVE_FEATURES_H@ +HAVE_FFS = @HAVE_FFS@ +HAVE_FFSL = @HAVE_FFSL@ +HAVE_FFSLL = @HAVE_FFSLL@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSTATAT = @HAVE_FSTATAT@ +HAVE_FSYNC = @HAVE_FSYNC@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_FUTIMENS = @HAVE_FUTIMENS@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETGROUPS = @HAVE_GETGROUPS@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ +HAVE_GETLOGIN = @HAVE_GETLOGIN@ +HAVE_GETOPT_H = @HAVE_GETOPT_H@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ +HAVE_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISBLANK = @HAVE_ISBLANK@ +HAVE_ISWBLANK = @HAVE_ISWBLANK@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ +HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ +HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ +HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ +HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LCHOWN = @HAVE_LCHOWN@ +HAVE_LIBSIGSEGV = @HAVE_LIBSIGSEGV@ +HAVE_LINK = @HAVE_LINK@ +HAVE_LINKAT = @HAVE_LINKAT@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSLEN = @HAVE_MBSLEN@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ +HAVE_MEMCHR = @HAVE_MEMCHR@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDIRAT = @HAVE_MKDIRAT@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_MKFIFO = @HAVE_MKFIFO@ +HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ +HAVE_MKNOD = @HAVE_MKNOD@ +HAVE_MKNODAT = @HAVE_MKNODAT@ +HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ +HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ +HAVE_MKSTEMP = @HAVE_MKSTEMP@ +HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ +HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ +HAVE_OPENAT = @HAVE_OPENAT@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_PCLOSE = @HAVE_PCLOSE@ +HAVE_PIPE = @HAVE_PIPE@ +HAVE_PIPE2 = @HAVE_PIPE2@ +HAVE_POPEN = @HAVE_POPEN@ +HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ +HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_PREAD = @HAVE_PREAD@ +HAVE_PSELECT = @HAVE_PSELECT@ +HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ +HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ +HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ +HAVE_RAISE = @HAVE_RAISE@ +HAVE_RANDOM = @HAVE_RANDOM@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_READLINKAT = @HAVE_READLINKAT@ +HAVE_REALPATH = @HAVE_REALPATH@ +HAVE_RENAMEAT = @HAVE_RENAMEAT@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ +HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SIGACTION = @HAVE_SIGACTION@ +HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ +HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ +HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ +HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ +HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_SIGSET_T = @HAVE_SIGSET_T@ +HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STPCPY = @HAVE_STPCPY@ +HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ +HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRINGS_H = @HAVE_STRINGS_H@ +HAVE_STRPBRK = @HAVE_STRPBRK@ +HAVE_STRPTIME = @HAVE_STRPTIME@ +HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ +HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ +HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ +HAVE_SYMLINK = @HAVE_SYMLINK@ +HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@ +HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ +HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ +HAVE_TRUNCATE = @HAVE_TRUNCATE@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ +HAVE_TZSET = @HAVE_TZSET@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNLINKAT = @HAVE_UNLINKAT@ +HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_USLEEP = @HAVE_USLEEP@ +HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCHAR_T = @HAVE_WCHAR_T@ +HAVE_WCPCPY = @HAVE_WCPCPY@ +HAVE_WCPNCPY = @HAVE_WCPNCPY@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ +HAVE_WCSCAT = @HAVE_WCSCAT@ +HAVE_WCSCHR = @HAVE_WCSCHR@ +HAVE_WCSCMP = @HAVE_WCSCMP@ +HAVE_WCSCOLL = @HAVE_WCSCOLL@ +HAVE_WCSCPY = @HAVE_WCSCPY@ +HAVE_WCSCSPN = @HAVE_WCSCSPN@ +HAVE_WCSDUP = @HAVE_WCSDUP@ +HAVE_WCSFTIME = @HAVE_WCSFTIME@ +HAVE_WCSLEN = @HAVE_WCSLEN@ +HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ +HAVE_WCSNCAT = @HAVE_WCSNCAT@ +HAVE_WCSNCMP = @HAVE_WCSNCMP@ +HAVE_WCSNCPY = @HAVE_WCSNCPY@ +HAVE_WCSNLEN = @HAVE_WCSNLEN@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSPBRK = @HAVE_WCSPBRK@ +HAVE_WCSRCHR = @HAVE_WCSRCHR@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ +HAVE_WCSSPN = @HAVE_WCSSPN@ +HAVE_WCSSTR = @HAVE_WCSSTR@ +HAVE_WCSTOK = @HAVE_WCSTOK@ +HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ +HAVE_WCSXFRM = @HAVE_WCSXFRM@ +HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE_WMEMCHR = @HAVE_WMEMCHR@ +HAVE_WMEMCMP = @HAVE_WMEMCMP@ +HAVE_WMEMCPY = @HAVE_WMEMCPY@ +HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ +HAVE_WMEMSET = @HAVE_WMEMSET@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ +HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ +HAVE__BOOL = @HAVE__BOOL@ +HAVE__EXIT = @HAVE__EXIT@ +HELP2MAN = @HELP2MAN@ +ICONV_CONST = @ICONV_CONST@ +ICONV_H = @ICONV_H@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ +INET_PTON_LIB = @INET_PTON_LIB@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ +INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBCSTACK = @LIBCSTACK@ +LIBDIFFUTILS_LIBDEPS = @LIBDIFFUTILS_LIBDEPS@ +LIBDIFFUTILS_LTLIBDEPS = @LIBDIFFUTILS_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSIGSEGV = @LIBSIGSEGV@ +LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@ +LIBSOCKET = @LIBSOCKET@ +LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ +LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@ +LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@ +LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIB_NANOSLEEP = @LIB_NANOSLEEP@ +LIB_SELECT = @LIB_SELECT@ +LIMITS_H = @LIMITS_H@ +LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ +LTLIBCSTACK = @LTLIBCSTACK@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBSIGSEGV = @LTLIBSIGSEGV@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ +NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@ +NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ +NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ +NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@ +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ +NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ +NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ +NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ +NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ +NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ +NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ +NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@ +NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@ +NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ +NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ +NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ +NEXT_CTYPE_H = @NEXT_CTYPE_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_ICONV_H = @NEXT_ICONV_H@ +NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ +NEXT_LOCALE_H = @NEXT_LOCALE_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ +NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_STDARG_H = @NEXT_STDARG_H@ +NEXT_STDDEF_H = @NEXT_STDDEF_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ +NEXT_STDIO_H = @NEXT_STDIO_H@ +NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRINGS_H = @NEXT_STRINGS_H@ +NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@ +NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@ +NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ +NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ +NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ +NEXT_TIME_H = @NEXT_TIME_H@ +NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ +NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSUB = @POSUB@ +PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ +PR_PROGRAM = @PR_PROGRAM@ +PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ +REPLACE_CALLOC = @REPLACE_CALLOC@ +REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_CTIME = @REPLACE_CTIME@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ +REPLACE_DUP = @REPLACE_DUP@ +REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ +REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FCNTL = @REPLACE_FCNTL@ +REPLACE_FDOPEN = @REPLACE_FDOPEN@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FSTAT = @REPLACE_FSTAT@ +REPLACE_FSTATAT = @REPLACE_FSTATAT@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ +REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETDELIM = @REPLACE_GETDELIM@ +REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ +REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@ +REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_GMTIME = @REPLACE_GMTIME@ +REPLACE_ICONV = @REPLACE_ICONV@ +REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@ +REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@ +REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ +REPLACE_INET_PTON = @REPLACE_INET_PTON@ +REPLACE_IOCTL = @REPLACE_IOCTL@ +REPLACE_ISATTY = @REPLACE_ISATTY@ +REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ +REPLACE_ITOLD = @REPLACE_ITOLD@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LINK = @REPLACE_LINK@ +REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ +REPLACE_LOCALTIME = @REPLACE_LOCALTIME@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MALLOC = @REPLACE_MALLOC@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MBTOWC = @REPLACE_MBTOWC@ +REPLACE_MEMCHR = @REPLACE_MEMCHR@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKDIR = @REPLACE_MKDIR@ +REPLACE_MKFIFO = @REPLACE_MKFIFO@ +REPLACE_MKNOD = @REPLACE_MKNOD@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_MKTIME = @REPLACE_MKTIME@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ +REPLACE_NULL = @REPLACE_NULL@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ +REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POPEN = @REPLACE_POPEN@ +REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PSELECT = @REPLACE_PSELECT@ +REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ +REPLACE_PTSNAME = @REPLACE_PTSNAME@ +REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ +REPLACE_RAISE = @REPLACE_RAISE@ +REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ +REPLACE_READ = @REPLACE_READ@ +REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ +REPLACE_REALLOC = @REPLACE_REALLOC@ +REPLACE_REALPATH = @REPLACE_REALPATH@ +REPLACE_REMOVE = @REPLACE_REMOVE@ +REPLACE_RENAME = @REPLACE_RENAME@ +REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ +REPLACE_RMDIR = @REPLACE_RMDIR@ +REPLACE_SELECT = @REPLACE_SELECT@ +REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ +REPLACE_SLEEP = @REPLACE_SLEEP@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STAT = @REPLACE_STAT@ +REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ +REPLACE_STPNCPY = @REPLACE_STPNCPY@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ +REPLACE_STRDUP = @REPLACE_STRDUP@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ +REPLACE_STRFTIME = @REPLACE_STRFTIME@ +REPLACE_STRNCAT = @REPLACE_STRNCAT@ +REPLACE_STRNDUP = @REPLACE_STRNDUP@ +REPLACE_STRNLEN = @REPLACE_STRNLEN@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ +REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ +REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ +REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ +REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ +REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TMPFILE = @REPLACE_TMPFILE@ +REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ +REPLACE_TRUNCATE = @REPLACE_TRUNCATE@ +REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ +REPLACE_TZSET = @REPLACE_TZSET@ +REPLACE_UNLINK = @REPLACE_UNLINK@ +REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ +REPLACE_UNSETENV = @REPLACE_UNSETENV@ +REPLACE_USLEEP = @REPLACE_USLEEP@ +REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSFTIME = @REPLACE_WCSFTIME@ +REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ +REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCTOMB = @REPLACE_WCTOMB@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SRC_VERSION_C = @SRC_VERSION_C@ +STDALIGN_H = @STDALIGN_H@ +STDARG_H = @STDARG_H@ +STDBOOL_H = @STDBOOL_H@ +STDDEF_H = @STDDEF_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@ +SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ +UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ +UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WERROR_CFLAGS = @WERROR_CFLAGS@ +WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ +WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@ +WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_aux_dir = @abs_aux_dir@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__rm_f_notfound = @am__rm_f_notfound@ +am__tar = @am__tar@ +am__untar = @am__untar@ +am__xargs_n = @am__xargs_n@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ +gltests_WITNESS = @gltests_WITNESS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +lispdir = @lispdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_MAKEINFOFLAGS = --no-split +info_TEXINFOS = diffutils.texi +diffutils_TEXINFOS = fdl.texi +EXTRA_DIST = diagmeet.note +all: all-am + +.SUFFIXES: +.SUFFIXES: .dvi .html .info .pdf .ps .texi +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu doc/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +.texi.info: + $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ + am__cwd=`pwd` && $(am__cd) $(srcdir) && \ + rm -rf $$backupdir && mkdir $$backupdir && \ + if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ + for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ + if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ + done; \ + else :; fi && \ + cd "$$am__cwd"; \ + if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $@ $<; \ + then \ + rc=0; \ + $(am__cd) $(srcdir); \ + else \ + rc=$$?; \ + $(am__cd) $(srcdir) && \ + $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ + fi; \ + rm -rf $$backupdir; exit $$rc + +.texi.dvi: + $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2DVI) $(AM_TEXI2FLAGS) -I $(srcdir) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ + $< + +.texi.pdf: + $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2PDF) $(AM_TEXI2FLAGS) -I $(srcdir) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ + $< + +.texi.html: + $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp) + $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $(@:.html=.htp) $<; \ + then \ + rm -rf $@ && mv $(@:.html=.htp) $@; \ + else \ + rm -rf $(@:.html=.htp); exit 1; \ + fi +$(srcdir)/diffutils.info: diffutils.texi $(srcdir)/version.texi $(diffutils_TEXINFOS) +diffutils.dvi: diffutils.texi $(srcdir)/version.texi $(diffutils_TEXINFOS) +diffutils.pdf: diffutils.texi $(srcdir)/version.texi $(diffutils_TEXINFOS) +diffutils.html: diffutils.texi $(srcdir)/version.texi $(diffutils_TEXINFOS) +$(srcdir)/version.texi: $(srcdir)/stamp-vti +$(srcdir)/stamp-vti: diffutils.texi $(top_srcdir)/configure + @(dir=.; test -f ./diffutils.texi || dir=$(srcdir); \ + set `$(SHELL) $(top_srcdir)/build-aux/mdate-sh $$dir/diffutils.texi`; \ + echo "@set UPDATED $$1 $$2 $$3"; \ + echo "@set UPDATED-MONTH $$2 $$3"; \ + echo "@set EDITION $(VERSION)"; \ + echo "@set VERSION $(VERSION)") > vti.tmp$$$$ && \ + (cmp -s vti.tmp$$$$ $(srcdir)/version.texi \ + || (echo "Updating $(srcdir)/version.texi" && \ + cp vti.tmp$$$$ $(srcdir)/version.texi.tmp$$$$ && \ + mv $(srcdir)/version.texi.tmp$$$$ $(srcdir)/version.texi)) && \ + rm -f vti.tmp$$$$ $(srcdir)/version.texi.$$$$ + @cp $(srcdir)/version.texi $@ + +mostlyclean-vti: + -rm -f vti.tmp* $(srcdir)/version.texi.tmp* + +maintainer-clean-vti: + -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi +.dvi.ps: + $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + $(DVIPS) $(AM_V_texinfo) -o $@ $< + +uninstall-dvi-am: + @$(NORMAL_UNINSTALL) + @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ + rm -f "$(DESTDIR)$(dvidir)/$$f"; \ + done + +uninstall-html-am: + @$(NORMAL_UNINSTALL) + @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ + rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ + done + +uninstall-info-am: + @$(PRE_UNINSTALL) + @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ + if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ + then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \ + done; \ + else :; fi + @$(NORMAL_UNINSTALL) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ + (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ + echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ + rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ + else :; fi); \ + done + +uninstall-pdf-am: + @$(NORMAL_UNINSTALL) + @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ + done + +uninstall-ps-am: + @$(NORMAL_UNINSTALL) + @list='$(PSS)'; test -n "$(psdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ + rm -f "$(DESTDIR)$(psdir)/$$f"; \ + done + +dist-info: $(INFO_DEPS) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(INFO_DEPS)'; \ + for base in $$list; do \ + case $$base in \ + $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + if test -f $$base; then d=.; else d=$(srcdir); fi; \ + base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ + for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ + if test -f $$file; then \ + relfile=`expr "$$file" : "$$d/\(.*\)"`; \ + test -f "$(distdir)/$$relfile" || \ + cp -p $$file "$(distdir)/$$relfile"; \ + else :; fi; \ + done; \ + done + +mostlyclean-aminfo: + -$(am__rm_rf) diffutils.t2d diffutils.t2p + +clean-aminfo: + -$(am__rm_rf) diffutils.dvi diffutils.pdf diffutils.ps diffutils.html + +maintainer-clean-aminfo: + @list='$(INFO_DEPS)'; for i in $$list; do \ + i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ + echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ + rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ + done +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-info +check-am: all-am +check: check-am +all-am: Makefile $(INFO_DEPS) +installdirs: + for dir in "$(DESTDIR)$(infodir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -$(am__rm_f) $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-aminfo clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: $(DVIS) + +html: html-am + +html-am: $(HTMLS) + +info: info-am + +info-am: $(INFO_DEPS) + +install-data-am: install-info-am + +install-dvi: install-dvi-am + +install-dvi-am: $(DVIS) + @$(NORMAL_INSTALL) + @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ + done +install-exec-am: + +install-html: install-html-am + +install-html-am: $(HTMLS) + @$(NORMAL_INSTALL) + @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ + $(am__strip_dir) \ + d2=$$d$$p; \ + if test -d "$$d2"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ + $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ + echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \ + $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ + else \ + list2="$$list2 $$d2"; \ + fi; \ + done; \ + test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ + done; } +install-info: install-info-am + +install-info-am: $(INFO_DEPS) + @$(NORMAL_INSTALL) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \ + fi; \ + for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ + for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ + $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ + if test -f $$ifile; then \ + echo "$$ifile"; \ + else : ; fi; \ + done; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done + @$(POST_INSTALL) + @if $(am__can_run_installinfo); then \ + list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ + install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ + done; \ + else : ; fi +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: $(PDFS) + @$(NORMAL_INSTALL) + @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done +install-ps: install-ps-am + +install-ps-am: $(PSS) + @$(NORMAL_INSTALL) + @list='$(PSS)'; test -n "$(psdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-aminfo \ + maintainer-clean-generic maintainer-clean-vti + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean-vti + +pdf: pdf-am + +pdf-am: $(PDFS) + +ps: ps-am + +ps-am: $(PSS) + +uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \ + uninstall-pdf-am uninstall-ps-am + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-aminfo clean-generic \ + cscopelist-am ctags-am dist-info distclean distclean-generic \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-aminfo \ + maintainer-clean-generic maintainer-clean-vti mostlyclean \ + mostlyclean-aminfo mostlyclean-generic mostlyclean-vti pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am \ + uninstall-dvi-am uninstall-html-am uninstall-info-am \ + uninstall-pdf-am uninstall-ps-am + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: + +# Tell GNU make to disable its built-in pattern rules. +%:: %,v +%:: RCS/%,v +%:: RCS/% +%:: s.% +%:: SCCS/s.% diff --git a/local/recipes/tools/diffutils/source/doc/diagmeet.note b/local/recipes/tools/diffutils/source/doc/diagmeet.note new file mode 100644 index 0000000000..2d30d21e3d --- /dev/null +++ b/local/recipes/tools/diffutils/source/doc/diagmeet.note @@ -0,0 +1,62 @@ +Here is a comparison matrix which shows a case in which +it is possible for the forward and backward scan in 'diag' +to meet along a nonzero length of diagonal simultaneous +(so that bdiag[d] and fdiag[d] are not equal) +even though there is no snake on that diagonal at the meeting point. + + + 85 1 1 1 159 1 1 17 + 1 2 3 4 +60 + 1 2 +1 + 2 2 3 4 +71 + 3 3 4 5 +85 + 4 3 4 5 +17 + 5 4 5 +1 + 6 4 5 6 +183 + 7 5 6 7 +10 + 8 6 7 +1 + 9 6 7 8 +12 + 7 8 9 10 +13 + 10 8 9 10 +14 + 10 9 10 +17 + 10 10 +1 + 10 9 10 +1 + 8 10 10 10 +183 + 8 7 9 9 9 +10 + 7 6 8 9 8 8 +1 + 6 5 7 7 +1 + 5 6 6 +1 + 5 5 5 +50 + 5 4 4 4 +1 + 4 3 3 +85 + 5 4 3 2 2 +1 + 2 1 +17 + 5 4 3 2 1 1 +1 + 1 0 + 85 1 1 1 159 1 1 17 diff --git a/local/recipes/tools/diffutils/source/doc/diffutils.info b/local/recipes/tools/diffutils/source/doc/diffutils.info new file mode 100644 index 0000000000..573a5dc86a --- /dev/null +++ b/local/recipes/tools/diffutils/source/doc/diffutils.info @@ -0,0 +1,5314 @@ +This is diffutils.info-t, produced by makeinfo version 6.3 from +diffutils.texi. + +This manual is for GNU Diffutils (version 3.6, 6 May 2017), and +documents the GNU 'diff', 'diff3', 'sdiff', and 'cmp' commands for +showing the differences between files and the GNU 'patch' command for +using their output to update files. + + Copyright (C) 1992-1994, 1998, 2001-2002, 2004, 2006, 2009-2017 Free +Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, and + no Back-Cover Texts. A copy of the license is included in the + section entitled "GNU Free Documentation License." +INFO-DIR-SECTION Individual utilities +START-INFO-DIR-ENTRY +* cmp: (diffutils)Invoking cmp. Compare 2 files byte by byte. +* diff: (diffutils)Invoking diff. Compare 2 files line by line. +* diff3: (diffutils)Invoking diff3. Compare 3 files line by line. +* patch: (diffutils)Invoking patch. Apply a patch to a file. +* sdiff: (diffutils)Invoking sdiff. Merge 2 files side-by-side. +END-INFO-DIR-ENTRY + +INFO-DIR-SECTION Text creation and manipulation +START-INFO-DIR-ENTRY +* Diffutils: (diffutils). Comparing and merging files. +END-INFO-DIR-ENTRY + + +File: diffutils.info-t, Node: Top, Next: Overview, Up: (dir) + +Comparing and Merging Files +*************************** + +This manual is for GNU Diffutils (version 3.6, 6 May 2017), and +documents the GNU 'diff', 'diff3', 'sdiff', and 'cmp' commands for +showing the differences between files and the GNU 'patch' command for +using their output to update files. + + Copyright (C) 1992-1994, 1998, 2001-2002, 2004, 2006, 2009-2017 Free +Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, and + no Back-Cover Texts. A copy of the license is included in the + section entitled "GNU Free Documentation License." + +* Menu: + +* Overview:: Preliminary information. +* Comparison:: What file comparison means. + +* Output Formats:: Formats for two-way difference reports. +* Incomplete Lines:: Lines that lack trailing newlines. +* Comparing Directories:: Comparing files and directories. +* Adjusting Output:: Making 'diff' output prettier. +* diff Performance:: Making 'diff' smarter or faster. + +* Comparing Three Files:: Formats for three-way difference reports. +* diff3 Merging:: Merging from a common ancestor. + +* Interactive Merging:: Interactive merging with 'sdiff'. + +* Merging with patch:: Using 'patch' to change old files into new ones. +* Making Patches:: Tips for making and using patch distributions. + +* Invoking cmp:: Compare two files byte by byte. +* Invoking diff:: Compare two files line by line. +* Invoking diff3:: Compare three files line by line. +* Invoking patch:: Apply a diff file to an original. +* Invoking sdiff:: Side-by-side merge of file differences. + +* Standards conformance:: Conformance to the POSIX standard. +* Projects:: If you've found a bug or other shortcoming. + +* Copying This Manual:: How to make copies of this manual. +* Translations:: Available translations of this manual. +* Index:: Index. + + +File: diffutils.info-t, Node: Overview, Next: Comparison, Prev: Top, Up: Top + +Overview +******** + +Computer users often find occasion to ask how two files differ. Perhaps +one file is a newer version of the other file. Or maybe the two files +started out as identical copies but were changed by different people. + + You can use the 'diff' command to show differences between two files, +or each corresponding file in two directories. 'diff' outputs +differences between files line by line in any of several formats, +selectable by command line options. This set of differences is often +called a "diff" or "patch". For files that are identical, 'diff' +normally produces no output; for binary (non-text) files, 'diff' +normally reports only that they are different. + + You can use the 'cmp' command to show the byte and line numbers where +two files differ. 'cmp' can also show all the bytes that differ between +the two files, side by side. A way to compare two files character by +character is the Emacs command 'M-x compare-windows'. *Note Other +Window: (emacs)Other Window, for more information on that command. + + You can use the 'diff3' command to show differences among three +files. When two people have made independent changes to a common +original, 'diff3' can report the differences between the original and +the two changed versions, and can produce a merged file that contains +both persons' changes together with warnings about conflicts. + + You can use the 'sdiff' command to merge two files interactively. + + You can use the set of differences produced by 'diff' to distribute +updates to text files (such as program source code) to other people. +This method is especially useful when the differences are small compared +to the complete files. Given 'diff' output, you can use the 'patch' +program to update, or "patch", a copy of the file. If you think of +'diff' as subtracting one file from another to produce their difference, +you can think of 'patch' as adding the difference to one file to +reproduce the other. + + This manual first concentrates on making diffs, and later shows how +to use diffs to update files. + + GNU 'diff' was written by Paul Eggert, Mike Haertel, David Hayes, +Richard Stallman, and Len Tower. Wayne Davison designed and implemented +the unified output format. The basic algorithm is described by Eugene +W. Myers in "An O(ND) Difference Algorithm and its Variations", +'Algorithmica' Vol. 1, 1986, pp. 251-266, +<http://dx.doi.org/10.1007/BF01840446>; and in "A File Comparison +Program", Webb Miller and Eugene W. Myers, 'Software--Practice and +Experience' Vol. 15, 1985, pp. 1025-1040, +<http://dx.doi.org/10.1002/spe.4380151102>. The algorithm was +independently discovered as described by Esko Ukkonen in "Algorithms for +Approximate String Matching", 'Information and Control' Vol. 64, 1985, +pp. 100-118, <http://dx.doi.org/10.1016/S0019-9958(85)80046-2>. Unless +the '--minimal' option is used, 'diff' uses a heuristic by Paul Eggert +that limits the cost to O(N^1.5 log N) at the price of producing +suboptimal output for large inputs with many differences. Related +algorithms are surveyed by Alfred V. Aho in section 6.3 of "Algorithms +for Finding Patterns in Strings", 'Handbook of Theoretical Computer +Science' (Jan Van Leeuwen, ed.), Vol. A, 'Algorithms and Complexity', +Elsevier/MIT Press, 1990, pp. 255-300. + + GNU 'diff3' was written by Randy Smith. GNU 'sdiff' was written by +Thomas Lord. GNU 'cmp' was written by Torbjo"rn Granlund and David +MacKenzie. + + GNU 'patch' was written mainly by Larry Wall and Paul Eggert; several +GNU enhancements were contributed by Wayne Davison and David MacKenzie. +Parts of this manual are adapted from a manual page written by Larry +Wall, with his permission. + + +File: diffutils.info-t, Node: Comparison, Next: Output Formats, Prev: Overview, Up: Top + +1 What Comparison Means +*********************** + +There are several ways to think about the differences between two files. +One way to think of the differences is as a series of lines that were +deleted from, inserted in, or changed in one file to produce the other +file. 'diff' compares two files line by line, finds groups of lines +that differ, and reports each group of differing lines. It can report +the differing lines in several formats, which have different purposes. + + GNU 'diff' can show whether files are different without detailing the +differences. It also provides ways to suppress certain kinds of +differences that are not important to you. Most commonly, such +differences are changes in the amount of white space between words or +lines. 'diff' also provides ways to suppress differences in alphabetic +case or in lines that match a regular expression that you provide. +These options can accumulate; for example, you can ignore changes in +both white space and alphabetic case. + + Another way to think of the differences between two files is as a +sequence of pairs of bytes that can be either identical or different. +'cmp' reports the differences between two files byte by byte, instead of +line by line. As a result, it is often more useful than 'diff' for +comparing binary files. For text files, 'cmp' is useful mainly when you +want to know only whether two files are identical, or whether one file +is a prefix of the other. + + To illustrate the effect that considering changes byte by byte can +have compared with considering them line by line, think of what happens +if a single newline character is added to the beginning of a file. If +that file is then compared with an otherwise identical file that lacks +the newline at the beginning, 'diff' will report that a blank line has +been added to the file, while 'cmp' will report that almost every byte +of the two files differs. + + 'diff3' normally compares three input files line by line, finds +groups of lines that differ, and reports each group of differing lines. +Its output is designed to make it easy to inspect two different sets of +changes to the same file. + + These commands compare input files without necessarily reading them. +For example, if 'diff' is asked simply to report whether two files +differ, and it discovers that the files have different sizes, it need +not read them to do its job. + +* Menu: + +* Hunks:: Groups of differing lines. +* White Space:: Suppressing differences in white space. +* Blank Lines:: Suppressing differences whose lines are all blank. +* Specified Lines:: Suppressing differences whose lines all match a pattern. +* Case Folding:: Suppressing differences in alphabetic case. +* Brief:: Summarizing which files are different. +* Binary:: Comparing binary files or forcing text comparisons. + + +File: diffutils.info-t, Node: Hunks, Next: White Space, Up: Comparison + +1.1 Hunks +========= + +When comparing two files, 'diff' finds sequences of lines common to both +files, interspersed with groups of differing lines called "hunks". +Comparing two identical files yields one sequence of common lines and no +hunks, because no lines differ. Comparing two entirely different files +yields no common lines and one large hunk that contains all lines of +both files. In general, there are many ways to match up lines between +two given files. 'diff' tries to minimize the total hunk size by +finding large sequences of common lines interspersed with small hunks of +differing lines. + + For example, suppose the file 'F' contains the three lines 'a', 'b', +'c', and the file 'G' contains the same three lines in reverse order +'c', 'b', 'a'. If 'diff' finds the line 'c' as common, then the command +'diff F G' produces this output: + + 1,2d0 + < a + < b + 3a2,3 + > b + > a + +But if 'diff' notices the common line 'b' instead, it produces this +output: + + 1c1 + < a + --- + > c + 3c3 + < c + --- + > a + +It is also possible to find 'a' as the common line. 'diff' does not +always find an optimal matching between the files; it takes shortcuts to +run faster. But its output is usually close to the shortest possible. +You can adjust this tradeoff with the '--minimal' ('-d') option (*note +diff Performance::). + + +File: diffutils.info-t, Node: White Space, Next: Blank Lines, Prev: Hunks, Up: Comparison + +1.2 Suppressing Differences in Blank and Tab Spacing +==================================================== + +The '--ignore-tab-expansion' ('-E') option ignores the distinction +between tabs and spaces on input. A tab is considered to be equivalent +to the number of spaces to the next tab stop (*note Tabs::). + + The '--ignore-trailing-space' ('-Z') option ignores white space at +line end. + + The '--ignore-space-change' ('-b') option is stronger than '-E' and +'-Z' combined. It ignores white space at line end, and considers all +other sequences of one or more white space characters within a line to +be equivalent. With this option, 'diff' considers the following two +lines to be equivalent, where '$' denotes the line end: + + Here lyeth muche rychnesse in lytell space. -- John Heywood$ + Here lyeth muche rychnesse in lytell space. -- John Heywood $ + + The '--ignore-all-space' ('-w') option is stronger still. It ignores +differences even if one line has white space where the other line has +none. "White space" characters include tab, vertical tab, form feed, +carriage return, and space; some locales may define additional +characters to be white space. With this option, 'diff' considers the +following two lines to be equivalent, where '$' denotes the line end and +'^M' denotes a carriage return: + + Here lyeth muche rychnesse in lytell space.-- John Heywood$ + He relyeth much erychnes seinly tells pace. --John Heywood ^M$ + + For many other programs newline is also a white space character, but +'diff' is a line-oriented program and a newline character always ends a +line. Hence the '-w' or '--ignore-all-space' option does not ignore +newline-related changes; it ignores only other white space changes. + + +File: diffutils.info-t, Node: Blank Lines, Next: Specified Lines, Prev: White Space, Up: Comparison + +1.3 Suppressing Differences Whose Lines Are All Blank +===================================================== + +The '--ignore-blank-lines' ('-B') option ignores changes that consist +entirely of blank lines. With this option, for example, a file +containing + 1. A point is that which has no part. + + 2. A line is breadthless length. + -- Euclid, The Elements, I +is considered identical to a file containing + 1. A point is that which has no part. + 2. A line is breadthless length. + + + -- Euclid, The Elements, I + + Normally this option affects only lines that are completely empty, +but if you also specify an option that ignores trailing spaces, lines +are also affected if they look empty but contain white space. In other +words, '-B' is equivalent to '-I '^$'' by default, but it is equivalent +to '-I '^[[:space:]]*$'' if '-b', '-w' or '-Z' is also specified. + + +File: diffutils.info-t, Node: Specified Lines, Next: Case Folding, Prev: Blank Lines, Up: Comparison + +1.4 Suppressing Differences Whose Lines All Match a Regular Expression +====================================================================== + +To ignore insertions and deletions of lines that match a 'grep'-style +regular expression, use the '--ignore-matching-lines=REGEXP' ('-I +REGEXP') option. You should escape regular expressions that contain +shell metacharacters to prevent the shell from expanding them. For +example, 'diff -I '^[[:digit:]]'' ignores all changes to lines beginning +with a digit. + + However, '-I' only ignores the insertion or deletion of lines that +contain the regular expression if every changed line in the hunk--every +insertion and every deletion--matches the regular expression. In other +words, for each nonignorable change, 'diff' prints the complete set of +changes in its vicinity, including the ignorable ones. + + You can specify more than one regular expression for lines to ignore +by using more than one '-I' option. 'diff' tries to match each line +against each regular expression. + + +File: diffutils.info-t, Node: Case Folding, Next: Brief, Prev: Specified Lines, Up: Comparison + +1.5 Suppressing Case Differences +================================ + +GNU 'diff' can treat lower case letters as equivalent to their upper +case counterparts, so that, for example, it considers 'Funky Stuff', +'funky STUFF', and 'fUNKy stuFf' to all be the same. To request this, +use the '-i' or '--ignore-case' option. + + +File: diffutils.info-t, Node: Brief, Next: Binary, Prev: Case Folding, Up: Comparison + +1.6 Summarizing Which Files Differ +================================== + +When you only want to find out whether files are different, and you +don't care what the differences are, you can use the summary output +format. In this format, instead of showing the differences between the +files, 'diff' simply reports whether files differ. The '--brief' ('-q') +option selects this output format. + + This format is especially useful when comparing the contents of two +directories. It is also much faster than doing the normal line by line +comparisons, because 'diff' can stop analyzing the files as soon as it +knows that there are any differences. + + You can also get a brief indication of whether two files differ by +using 'cmp'. For files that are identical, 'cmp' produces no output. +When the files differ, by default, 'cmp' outputs the byte and line +number where the first difference occurs, or reports that one file is a +prefix of the other. You can use the '-s', '--quiet', or '--silent' +option to suppress that information, so that 'cmp' produces no output +and reports whether the files differ using only its exit status (*note +Invoking cmp::). + + Unlike 'diff', 'cmp' cannot compare directories; it can only compare +two files. + + +File: diffutils.info-t, Node: Binary, Prev: Brief, Up: Comparison + +1.7 Binary Files and Forcing Text Comparisons +============================================= + +If 'diff' thinks that either of the two files it is comparing is binary +(a non-text file), it normally treats that pair of files much as if the +summary output format had been selected (*note Brief::), and reports +only that the binary files are different. This is because line by line +comparisons are usually not meaningful for binary files. This does not +count as trouble, even though the resulting output does not capture all +the differences. + + 'diff' determines whether a file is text or binary by checking the +first few bytes in the file; the exact number of bytes is system +dependent, but it is typically several thousand. If every byte in that +part of the file is non-null, 'diff' considers the file to be text; +otherwise it considers the file to be binary. + + Sometimes you might want to force 'diff' to consider files to be +text. For example, you might be comparing text files that contain null +characters; 'diff' would erroneously decide that those are non-text +files. Or you might be comparing documents that are in a format used by +a word processing system that uses null characters to indicate special +formatting. You can force 'diff' to consider all files to be text +files, and compare them line by line, by using the '--text' ('-a') +option. If the files you compare using this option do not in fact +contain text, they will probably contain few newline characters, and the +'diff' output will consist of hunks showing differences between long +lines of whatever characters the files contain. + + You can also force 'diff' to report only whether files differ (but +not how). Use the '--brief' ('-q') option for this. + + In operating systems that distinguish between text and binary files, +'diff' normally reads and writes all data as text. Use the '--binary' +option to force 'diff' to read and write binary data instead. This +option has no effect on a POSIX-compliant system like GNU or traditional +Unix. However, many personal computer operating systems represent the +end of a line with a carriage return followed by a newline. On such +systems, 'diff' normally ignores these carriage returns on input and +generates them at the end of each output line, but with the '--binary' +option 'diff' treats each carriage return as just another input +character, and does not generate a carriage return at the end of each +output line. This can be useful when dealing with non-text files that +are meant to be interchanged with POSIX-compliant systems. + + The '--strip-trailing-cr' causes 'diff' to treat input lines that end +in carriage return followed by newline as if they end in plain newline. +This can be useful when comparing text that is imperfectly imported from +many personal computer operating systems. This option affects how lines +are read, which in turn affects how they are compared and output. + + If you want to compare two files byte by byte, you can use the 'cmp' +program with the '--verbose' ('-l') option to show the values of each +differing byte in the two files. With GNU 'cmp', you can also use the +'-b' or '--print-bytes' option to show the ASCII representation of those +bytes. *Note Invoking cmp::, for more information. + + If 'diff3' thinks that any of the files it is comparing is binary (a +non-text file), it normally reports an error, because such comparisons +are usually not useful. 'diff3' uses the same test as 'diff' to decide +whether a file is binary. As with 'diff', if the input files contain a +few non-text bytes but otherwise are like text files, you can force +'diff3' to consider all files to be text files and compare them line by +line by using the '-a' or '--text' option. + + +File: diffutils.info-t, Node: Output Formats, Next: Incomplete Lines, Prev: Comparison, Up: Top + +2 'diff' Output Formats +*********************** + +'diff' has several mutually exclusive options for output format. The +following sections describe each format, illustrating how 'diff' reports +the differences between two sample input files. + +* Menu: + +* Sample diff Input:: Sample 'diff' input files for examples. +* Context:: Showing differences with the surrounding text. +* Side by Side:: Showing differences in two columns. +* Normal:: Showing differences without surrounding text. +* Scripts:: Generating scripts for other programs. +* If-then-else:: Merging files with if-then-else. + + +File: diffutils.info-t, Node: Sample diff Input, Next: Context, Up: Output Formats + +2.1 Two Sample Input Files +========================== + +Here are two sample files that we will use in numerous examples to +illustrate the output of 'diff' and how various options can change it. + + This is the file 'lao': + + The Way that can be told of is not the eternal Way; + The name that can be named is not the eternal name. + The Nameless is the origin of Heaven and Earth; + The Named is the mother of all things. + Therefore let there always be non-being, + so we may see their subtlety, + And let there always be being, + so we may see their outcome. + The two are the same, + But after they are produced, + they have different names. + + This is the file 'tzu': + + The Nameless is the origin of Heaven and Earth; + The named is the mother of all things. + + Therefore let there always be non-being, + so we may see their subtlety, + And let there always be being, + so we may see their outcome. + The two are the same, + But after they are produced, + they have different names. + They both may be called deep and profound. + Deeper and more profound, + The door of all subtleties! + + In this example, the first hunk contains just the first two lines of +'lao', the second hunk contains the fourth line of 'lao' opposing the +second and third lines of 'tzu', and the last hunk contains just the +last three lines of 'tzu'. + + +File: diffutils.info-t, Node: Context, Next: Side by Side, Prev: Sample diff Input, Up: Output Formats + +2.2 Showing Differences in Their Context +======================================== + +Usually, when you are looking at the differences between files, you will +also want to see the parts of the files near the lines that differ, to +help you understand exactly what has changed. These nearby parts of the +files are called the "context". + + GNU 'diff' provides two output formats that show context around the +differing lines: "context format" and "unified format". It can +optionally show in which function or section of the file the differing +lines are found. + + If you are distributing new versions of files to other people in the +form of 'diff' output, you should use one of the output formats that +show context so that they can apply the diffs even if they have made +small changes of their own to the files. 'patch' can apply the diffs in +this case by searching in the files for the lines of context around the +differing lines; if those lines are actually a few lines away from where +the diff says they are, 'patch' can adjust the line numbers accordingly +and still apply the diff correctly. *Note Imperfect::, for more +information on using 'patch' to apply imperfect diffs. + +* Menu: + +* Context Format:: An output format that shows surrounding lines. +* Unified Format:: A more compact output format that shows context. +* Sections:: Showing which sections of the files differences are in. +* Alternate Names:: Showing alternate file names in context headers. + + +File: diffutils.info-t, Node: Context Format, Next: Unified Format, Up: Context + +2.2.1 Context Format +-------------------- + +The context output format shows several lines of context around the +lines that differ. It is the standard format for distributing updates +to source code. + + To select this output format, use the '--context[=LINES]' ('-C +LINES') or '-c' option. The argument LINES that some of these options +take is the number of lines of context to show. If you do not specify +LINES, it defaults to three. For proper operation, 'patch' typically +needs at least two lines of context. + +* Menu: + +* Example Context:: Sample output in context format. +* Less Context:: Another sample with less context. +* Detailed Context:: A detailed description of the context output format. + + +File: diffutils.info-t, Node: Example Context, Next: Less Context, Up: Context Format + +2.2.1.1 An Example of Context Format +.................................... + +Here is the output of 'diff -c lao tzu' (*note Sample diff Input::, for +the complete contents of the two files). Notice that up to three lines +that are not different are shown around each line that is different; +they are the context lines. Also notice that the first two hunks have +run together, because their contents overlap. + + *** lao 2002-02-21 23:30:39.942229878 -0800 + --- tzu 2002-02-21 23:30:50.442260588 -0800 + *************** + *** 1,7 **** + - The Way that can be told of is not the eternal Way; + - The name that can be named is not the eternal name. + The Nameless is the origin of Heaven and Earth; + ! The Named is the mother of all things. + Therefore let there always be non-being, + so we may see their subtlety, + And let there always be being, + --- 1,6 ---- + The Nameless is the origin of Heaven and Earth; + ! The named is the mother of all things. + ! + Therefore let there always be non-being, + so we may see their subtlety, + And let there always be being, + *************** + *** 9,11 **** + --- 8,13 ---- + The two are the same, + But after they are produced, + they have different names. + + They both may be called deep and profound. + + Deeper and more profound, + + The door of all subtleties! + + +File: diffutils.info-t, Node: Less Context, Next: Detailed Context, Prev: Example Context, Up: Context Format + +2.2.1.2 An Example of Context Format with Less Context +...................................................... + +Here is the output of 'diff -C 1 lao tzu' (*note Sample diff Input::, +for the complete contents of the two files). Notice that at most one +context line is reported here. + + *** lao 2002-02-21 23:30:39.942229878 -0800 + --- tzu 2002-02-21 23:30:50.442260588 -0800 + *************** + *** 1,5 **** + - The Way that can be told of is not the eternal Way; + - The name that can be named is not the eternal name. + The Nameless is the origin of Heaven and Earth; + ! The Named is the mother of all things. + Therefore let there always be non-being, + --- 1,4 ---- + The Nameless is the origin of Heaven and Earth; + ! The named is the mother of all things. + ! + Therefore let there always be non-being, + *************** + *** 11 **** + --- 10,13 ---- + they have different names. + + They both may be called deep and profound. + + Deeper and more profound, + + The door of all subtleties! + + +File: diffutils.info-t, Node: Detailed Context, Prev: Less Context, Up: Context Format + +2.2.1.3 Detailed Description of Context Format +.............................................. + +The context output format starts with a two-line header, which looks +like this: + + *** FROM-FILE FROM-FILE-MODIFICATION-TIME + --- TO-FILE TO-FILE-MODIFICATION TIME + +The timestamp normally looks like '2002-02-21 23:30:39.942229878 -0800' +to indicate the date, time with fractional seconds, and time zone in +Internet RFC 2822 format (ftp://ftp.isi.edu/in-notes/rfc2822.txt). (The +fractional seconds are omitted on hosts that do not support fractional +timestamps.) However, a traditional timestamp like 'Thu Feb 21 23:30:39 +2002' is used if the 'LC_TIME' locale category is either 'C' or 'POSIX'. + + You can change the header's content with the '--label=LABEL' option; +see *note Alternate Names::. + + Next come one or more hunks of differences; each hunk shows one area +where the files differ. Context format hunks look like this: + + *************** + *** FROM-FILE-LINE-NUMBERS **** + FROM-FILE-LINE + FROM-FILE-LINE... + --- TO-FILE-LINE-NUMBERS ---- + TO-FILE-LINE + TO-FILE-LINE... + + If a hunk contains two or more lines, its line numbers look like +'START,END'. Otherwise only its end line number appears. An empty hunk +is considered to end at the line that precedes the hunk. + + The lines of context around the lines that differ start with two +space characters. The lines that differ between the two files start +with one of the following indicator characters, followed by a space +character: + +'!' + A line that is part of a group of one or more lines that changed + between the two files. There is a corresponding group of lines + marked with '!' in the part of this hunk for the other file. + +'+' + An "inserted" line in the second file that corresponds to nothing + in the first file. + +'-' + A "deleted" line in the first file that corresponds to nothing in + the second file. + + If all of the changes in a hunk are insertions, the lines of +FROM-FILE are omitted. If all of the changes are deletions, the lines +of TO-FILE are omitted. + + +File: diffutils.info-t, Node: Unified Format, Next: Sections, Prev: Context Format, Up: Context + +2.2.2 Unified Format +-------------------- + +The unified output format is a variation on the context format that is +more compact because it omits redundant context lines. To select this +output format, use the '--unified[=LINES]' ('-U LINES'), or '-u' option. +The argument LINES is the number of lines of context to show. When it +is not given, it defaults to three. + + At present, only GNU 'diff' can produce this format and only GNU +'patch' can automatically apply diffs in this format. For proper +operation, 'patch' typically needs at least three lines of context. + +* Menu: + +* Example Unified:: Sample output in unified format. +* Detailed Unified:: A detailed description of unified format. + + +File: diffutils.info-t, Node: Example Unified, Next: Detailed Unified, Up: Unified Format + +2.2.2.1 An Example of Unified Format +.................................... + +Here is the output of the command 'diff -u lao tzu' (*note Sample diff +Input::, for the complete contents of the two files): + + --- lao 2002-02-21 23:30:39.942229878 -0800 + +++ tzu 2002-02-21 23:30:50.442260588 -0800 + @@ -1,7 +1,6 @@ + -The Way that can be told of is not the eternal Way; + -The name that can be named is not the eternal name. + The Nameless is the origin of Heaven and Earth; + -The Named is the mother of all things. + +The named is the mother of all things. + + + Therefore let there always be non-being, + so we may see their subtlety, + And let there always be being, + @@ -9,3 +8,6 @@ + The two are the same, + But after they are produced, + they have different names. + +They both may be called deep and profound. + +Deeper and more profound, + +The door of all subtleties! + + +File: diffutils.info-t, Node: Detailed Unified, Prev: Example Unified, Up: Unified Format + +2.2.2.2 Detailed Description of Unified Format +.............................................. + +The unified output format starts with a two-line header, which looks +like this: + + --- FROM-FILE FROM-FILE-MODIFICATION-TIME + +++ TO-FILE TO-FILE-MODIFICATION-TIME + +The timestamp looks like '2002-02-21 23:30:39.942229878 -0800' to +indicate the date, time with fractional seconds, and time zone. The +fractional seconds are omitted on hosts that do not support fractional +timestamps. + + You can change the header's content with the '--label=LABEL' option. +*Note Alternate Names::. + + Next come one or more hunks of differences; each hunk shows one area +where the files differ. Unified format hunks look like this: + + @@ FROM-FILE-LINE-NUMBERS TO-FILE-LINE-NUMBERS @@ + LINE-FROM-EITHER-FILE + LINE-FROM-EITHER-FILE... + + If a hunk contains just one line, only its start line number appears. +Otherwise its line numbers look like 'START,COUNT'. An empty hunk is +considered to start at the line that follows the hunk. + + If a hunk and its context contain two or more lines, its line numbers +look like 'START,COUNT'. Otherwise only its end line number appears. +An empty hunk is considered to end at the line that precedes the hunk. + + The lines common to both files begin with a space character. The +lines that actually differ between the two files have one of the +following indicator characters in the left print column: + +'+' + A line was added here to the first file. + +'-' + A line was removed here from the first file. + + +File: diffutils.info-t, Node: Sections, Next: Alternate Names, Prev: Unified Format, Up: Context + +2.2.3 Showing Which Sections Differences Are in +----------------------------------------------- + +Sometimes you might want to know which part of the files each change +falls in. If the files are source code, this could mean which function +was changed. If the files are documents, it could mean which chapter or +appendix was changed. GNU 'diff' can show this by displaying the +nearest section heading line that precedes the differing lines. Which +lines are "section headings" is determined by a regular expression. + +* Menu: + +* Specified Headings:: Showing headings that match regular expressions. +* C Function Headings:: Showing headings of C functions. + + +File: diffutils.info-t, Node: Specified Headings, Next: C Function Headings, Up: Sections + +2.2.3.1 Showing Lines That Match Regular Expressions +.................................................... + +To show in which sections differences occur for files that are not +source code for C or similar languages, use the +'--show-function-line=REGEXP' ('-F REGEXP') option. 'diff' considers +lines that match the 'grep'-style regular expression REGEXP to be the +beginning of a section of the file. Here are suggested regular +expressions for some common languages: + +'^[[:alpha:]$_]' + C, C++, Prolog +'^(' + Lisp +'^@node' + Texinfo + + This option does not automatically select an output format; in order +to use it, you must select the context format (*note Context Format::) +or unified format (*note Unified Format::). In other output formats it +has no effect. + + The '--show-function-line' ('-F') option finds the nearest unchanged +line that precedes each hunk of differences and matches the given +regular expression. Then it adds that line to the end of the line of +asterisks in the context format, or to the '@@' line in unified format. +If no matching line exists, this option leaves the output for that hunk +unchanged. If that line is more than 40 characters long, it outputs +only the first 40 characters. You can specify more than one regular +expression for such lines; 'diff' tries to match each line against each +regular expression, starting with the last one given. This means that +you can use '-p' and '-F' together, if you wish. + + +File: diffutils.info-t, Node: C Function Headings, Prev: Specified Headings, Up: Sections + +2.2.3.2 Showing C Function Headings +................................... + +To show in which functions differences occur for C and similar +languages, you can use the '--show-c-function' ('-p') option. This +option automatically defaults to the context output format (*note +Context Format::), with the default number of lines of context. You can +override that number with '-C LINES' elsewhere in the command line. You +can override both the format and the number with '-U LINES' elsewhere in +the command line. + + The '--show-c-function' ('-p') option is equivalent to '-F +'^[[:alpha:]$_]'' if the unified format is specified, otherwise '-c -F +'^[[:alpha:]$_]'' (*note Specified Headings::). GNU 'diff' provides +this option for the sake of convenience. + + +File: diffutils.info-t, Node: Alternate Names, Prev: Sections, Up: Context + +2.2.4 Showing Alternate File Names +---------------------------------- + +If you are comparing two files that have meaningless or uninformative +names, you might want 'diff' to show alternate names in the header of +the context and unified output formats. To do this, use the +'--label=LABEL' option. The first time you give this option, its +argument replaces the name and date of the first file in the header; the +second time, its argument replaces the name and date of the second file. +If you give this option more than twice, 'diff' reports an error. The +'--label' option does not affect the file names in the 'pr' header when +the '-l' or '--paginate' option is used (*note Pagination::). + + Here are the first two lines of the output from 'diff -C 2 +--label=original --label=modified lao tzu': + + *** original + --- modified + + +File: diffutils.info-t, Node: Side by Side, Next: Normal, Prev: Context, Up: Output Formats + +2.3 Showing Differences Side by Side +==================================== + +'diff' can produce a side by side difference listing of two files. The +files are listed in two columns with a gutter between them. The gutter +contains one of the following markers: + +white space + The corresponding lines are in common. That is, either the lines + are identical, or the difference is ignored because of one of the + '--ignore' options (*note White Space::). + +'|' + The corresponding lines differ, and they are either both complete + or both incomplete. + +'<' + The files differ and only the first file contains the line. + +'>' + The files differ and only the second file contains the line. + +'(' + Only the first file contains the line, but the difference is + ignored. + +')' + Only the second file contains the line, but the difference is + ignored. + +'\' + The corresponding lines differ, and only the first line is + incomplete. + +'/' + The corresponding lines differ, and only the second line is + incomplete. + + Normally, an output line is incomplete if and only if the lines that +it contains are incomplete. *Note Incomplete Lines::. However, when an +output line represents two differing lines, one might be incomplete +while the other is not. In this case, the output line is complete, but +its the gutter is marked '\' if the first line is incomplete, '/' if the +second line is. + + Side by side format is sometimes easiest to read, but it has +limitations. It generates much wider output than usual, and truncates +lines that are too long to fit. Also, it relies on lining up output +more heavily than usual, so its output looks particularly bad if you use +varying width fonts, nonstandard tab stops, or nonprinting characters. + + You can use the 'sdiff' command to interactively merge side by side +differences. *Note Interactive Merging::, for more information on +merging files. + +* Menu: + +* Side by Side Format:: Controlling side by side output format. +* Example Side by Side:: Sample side by side output. + + +File: diffutils.info-t, Node: Side by Side Format, Next: Example Side by Side, Up: Side by Side + +2.3.1 Controlling Side by Side Format +------------------------------------- + +The '--side-by-side' ('-y') option selects side by side format. Because +side by side output lines contain two input lines, the output is wider +than usual: normally 130 print columns, which can fit onto a traditional +printer line. You can set the width of the output with the +'--width=COLUMNS' ('-W COLUMNS') option. The output is split into two +halves of equal width, separated by a small gutter to mark differences; +the right half is aligned to a tab stop so that tabs line up. Input +lines that are too long to fit in half of an output line are truncated +for output. + + The '--left-column' option prints only the left column of two common +lines. The '--suppress-common-lines' option suppresses common lines +entirely. + + +File: diffutils.info-t, Node: Example Side by Side, Prev: Side by Side Format, Up: Side by Side + +2.3.2 An Example of Side by Side Format +--------------------------------------- + +Here is the output of the command 'diff -y -W 72 lao tzu' (*note Sample +diff Input::, for the complete contents of the two files). + + The Way that can be told of is n < + The name that can be named is no < + The Nameless is the origin of He The Nameless is the origin of He + The Named is the mother of all t | The named is the mother of all t + > + Therefore let there always be no Therefore let there always be no + so we may see their subtlety, so we may see their subtlety, + And let there always be being, And let there always be being, + so we may see their outcome. so we may see their outcome. + The two are the same, The two are the same, + But after they are produced, But after they are produced, + they have different names. they have different names. + > They both may be called deep and + > Deeper and more profound, + > The door of all subtleties! + + +File: diffutils.info-t, Node: Normal, Next: Scripts, Prev: Side by Side, Up: Output Formats + +2.4 Showing Differences Without Context +======================================= + +The "normal" 'diff' output format shows each hunk of differences without +any surrounding context. Sometimes such output is the clearest way to +see how lines have changed, without the clutter of nearby unchanged +lines (although you can get similar results with the context or unified +formats by using 0 lines of context). However, this format is no longer +widely used for sending out patches; for that purpose, the context +format (*note Context Format::) and the unified format (*note Unified +Format::) are superior. Normal format is the default for compatibility +with older versions of 'diff' and the POSIX standard. Use the +'--normal' option to select this output format explicitly. + +* Menu: + +* Example Normal:: Sample output in the normal format. +* Detailed Normal:: A detailed description of normal output format. + + +File: diffutils.info-t, Node: Example Normal, Next: Detailed Normal, Up: Normal + +2.4.1 An Example of Normal Format +--------------------------------- + +Here is the output of the command 'diff lao tzu' (*note Sample diff +Input::, for the complete contents of the two files). Notice that it +shows only the lines that are different between the two files. + + 1,2d0 + < The Way that can be told of is not the eternal Way; + < The name that can be named is not the eternal name. + 4c2,3 + < The Named is the mother of all things. + --- + > The named is the mother of all things. + > + 11a11,13 + > They both may be called deep and profound. + > Deeper and more profound, + > The door of all subtleties! + + +File: diffutils.info-t, Node: Detailed Normal, Prev: Example Normal, Up: Normal + +2.4.2 Detailed Description of Normal Format +------------------------------------------- + +The normal output format consists of one or more hunks of differences; +each hunk shows one area where the files differ. Normal format hunks +look like this: + + CHANGE-COMMAND + < FROM-FILE-LINE + < FROM-FILE-LINE... + --- + > TO-FILE-LINE + > TO-FILE-LINE... + + There are three types of change commands. Each consists of a line +number or comma-separated range of lines in the first file, a single +character indicating the kind of change to make, and a line number or +comma-separated range of lines in the second file. All line numbers are +the original line numbers in each file. The types of change commands +are: + +'LaR' + Add the lines in range R of the second file after line L of the + first file. For example, '8a12,15' means append lines 12-15 of + file 2 after line 8 of file 1; or, if changing file 2 into file 1, + delete lines 12-15 of file 2. + +'FcT' + Replace the lines in range F of the first file with lines in range + T of the second file. This is like a combined add and delete, but + more compact. For example, '5,7c8,10' means change lines 5-7 of + file 1 to read as lines 8-10 of file 2; or, if changing file 2 into + file 1, change lines 8-10 of file 2 to read as lines 5-7 of file 1. + +'RdL' + Delete the lines in range R from the first file; line L is where + they would have appeared in the second file had they not been + deleted. For example, '5,7d3' means delete lines 5-7 of file 1; + or, if changing file 2 into file 1, append lines 5-7 of file 1 + after line 3 of file 2. + + +File: diffutils.info-t, Node: Scripts, Next: If-then-else, Prev: Normal, Up: Output Formats + +2.5 Making Edit Scripts +======================= + +Several output modes produce command scripts for editing FROM-FILE to +produce TO-FILE. + +* Menu: + +* ed Scripts:: Using 'diff' to produce commands for 'ed'. +* Forward ed:: Making forward 'ed' scripts. +* RCS:: A special 'diff' output format used by RCS. + + +File: diffutils.info-t, Node: ed Scripts, Next: Forward ed, Up: Scripts + +2.5.1 'ed' Scripts +------------------ + +'diff' can produce commands that direct the 'ed' text editor to change +the first file into the second file. Long ago, this was the only output +mode that was suitable for editing one file into another automatically; +today, with 'patch', it is almost obsolete. Use the '--ed' ('-e') +option to select this output format. + + Like the normal format (*note Normal::), this output format does not +show any context; unlike the normal format, it does not include the +information necessary to apply the diff in reverse (to produce the first +file if all you have is the second file and the diff). + + If the file 'd' contains the output of 'diff -e old new', then the +command '(cat d && echo w) | ed - old' edits 'old' to make it a copy of +'new'. More generally, if 'd1', 'd2', ..., 'dN' contain the outputs of +'diff -e old new1', 'diff -e new1 new2', ..., 'diff -e newN-1 newN', +respectively, then the command '(cat d1 d2 ... dN && echo w) | ed - old' +edits 'old' to make it a copy of 'newN'. + +* Menu: + +* Example ed:: A sample 'ed' script. +* Detailed ed:: A detailed description of 'ed' format. + + +File: diffutils.info-t, Node: Example ed, Next: Detailed ed, Up: ed Scripts + +2.5.1.1 Example 'ed' Script +........................... + +Here is the output of 'diff -e lao tzu' (*note Sample diff Input::, for +the complete contents of the two files): + + 11a + They both may be called deep and profound. + Deeper and more profound, + The door of all subtleties! + . + 4c + The named is the mother of all things. + + . + 1,2d + + +File: diffutils.info-t, Node: Detailed ed, Prev: Example ed, Up: ed Scripts + +2.5.1.2 Detailed Description of 'ed' Format +........................................... + +The 'ed' output format consists of one or more hunks of differences. +The changes closest to the ends of the files come first so that commands +that change the number of lines do not affect how 'ed' interprets line +numbers in succeeding commands. 'ed' format hunks look like this: + + CHANGE-COMMAND + TO-FILE-LINE + TO-FILE-LINE... + . + + Because 'ed' uses a single period on a line to indicate the end of +input, GNU 'diff' protects lines of changes that contain a single period +on a line by writing two periods instead, then writing a subsequent 'ed' +command to change the two periods into one. The 'ed' format cannot +represent an incomplete line, so if the second file ends in a changed +incomplete line, 'diff' reports an error and then pretends that a +newline was appended. + + There are three types of change commands. Each consists of a line +number or comma-separated range of lines in the first file and a single +character indicating the kind of change to make. All line numbers are +the original line numbers in the file. The types of change commands +are: + +'La' + Add text from the second file after line L in the first file. For + example, '8a' means to add the following lines after line 8 of file + 1. + +'Rc' + Replace the lines in range R in the first file with the following + lines. Like a combined add and delete, but more compact. For + example, '5,7c' means change lines 5-7 of file 1 to read as the + text file 2. + +'Rd' + Delete the lines in range R from the first file. For example, + '5,7d' means delete lines 5-7 of file 1. + + +File: diffutils.info-t, Node: Forward ed, Next: RCS, Prev: ed Scripts, Up: Scripts + +2.5.2 Forward 'ed' Scripts +-------------------------- + +'diff' can produce output that is like an 'ed' script, but with hunks in +forward (front to back) order. The format of the commands is also +changed slightly: command characters precede the lines they modify, +spaces separate line numbers in ranges, and no attempt is made to +disambiguate hunk lines consisting of a single period. Like 'ed' +format, forward 'ed' format cannot represent incomplete lines. + + Forward 'ed' format is not very useful, because neither 'ed' nor +'patch' can apply diffs in this format. It exists mainly for +compatibility with older versions of 'diff'. Use the '-f' or +'--forward-ed' option to select it. + + +File: diffutils.info-t, Node: RCS, Prev: Forward ed, Up: Scripts + +2.5.3 RCS Scripts +----------------- + +The RCS output format is designed specifically for use by the Revision +Control System, which is a set of free programs used for organizing +different versions and systems of files. Use the '--rcs' ('-n') option +to select this output format. It is like the forward 'ed' format (*note +Forward ed::), but it can represent arbitrary changes to the contents of +a file because it avoids the forward 'ed' format's problems with lines +consisting of a single period and with incomplete lines. Instead of +ending text sections with a line consisting of a single period, each +command specifies the number of lines it affects; a combination of the +'a' and 'd' commands are used instead of 'c'. Also, if the second file +ends in a changed incomplete line, then the output also ends in an +incomplete line. + + Here is the output of 'diff -n lao tzu' (*note Sample diff Input::, +for the complete contents of the two files): + + d1 2 + d4 1 + a4 2 + The named is the mother of all things. + + a11 3 + They both may be called deep and profound. + Deeper and more profound, + The door of all subtleties! + + +File: diffutils.info-t, Node: If-then-else, Prev: Scripts, Up: Output Formats + +2.6 Merging Files with If-then-else +=================================== + +You can use 'diff' to merge two files of C source code. The output of +'diff' in this format contains all the lines of both files. Lines +common to both files are output just once; the differing parts are +separated by the C preprocessor directives '#ifdef NAME' or '#ifndef +NAME', '#else', and '#endif'. When compiling the output, you select +which version to use by either defining or leaving undefined the macro +NAME. + + To merge two files, use 'diff' with the '-D NAME' or '--ifdef=NAME' +option. The argument NAME is the C preprocessor identifier to use in +the '#ifdef' and '#ifndef' directives. + + For example, if you change an instance of 'wait (&s)' to 'waitpid +(-1, &s, 0)' and then merge the old and new files with the +'--ifdef=HAVE_WAITPID' option, then the affected part of your code might +look like this: + + do { + #ifndef HAVE_WAITPID + if ((w = wait (&s)) < 0 && errno != EINTR) + #else /* HAVE_WAITPID */ + if ((w = waitpid (-1, &s, 0)) < 0 && errno != EINTR) + #endif /* HAVE_WAITPID */ + return w; + } while (w != child); + + You can specify formats for languages other than C by using line +group formats and line formats, as described in the next sections. + +* Menu: + +* Line Group Formats:: Formats for general if-then-else line groups. +* Line Formats:: Formats for each line in a line group. +* Example If-then-else:: Sample if-then-else format output. +* Detailed If-then-else:: A detailed description of if-then-else format. + + +File: diffutils.info-t, Node: Line Group Formats, Next: Line Formats, Up: If-then-else + +2.6.1 Line Group Formats +------------------------ + +Line group formats let you specify formats suitable for many +applications that allow if-then-else input, including programming +languages and text formatting languages. A line group format specifies +the output format for a contiguous group of similar lines. + + For example, the following command compares the TeX files 'old' and +'new', and outputs a merged file in which old regions are surrounded by +'\begin{em}'-'\end{em}' lines, and new regions are surrounded by +'\begin{bf}'-'\end{bf}' lines. + + diff \ + --old-group-format='\begin{em} + %<\end{em} + ' \ + --new-group-format='\begin{bf} + %>\end{bf} + ' \ + old new + + The following command is equivalent to the above example, but it is a +little more verbose, because it spells out the default line group +formats. + + diff \ + --old-group-format='\begin{em} + %<\end{em} + ' \ + --new-group-format='\begin{bf} + %>\end{bf} + ' \ + --unchanged-group-format='%=' \ + --changed-group-format='\begin{em} + %<\end{em} + \begin{bf} + %>\end{bf} + ' \ + old new + + Here is a more advanced example, which outputs a diff listing with +headers containing line numbers in a "plain English" style. + + diff \ + --unchanged-group-format='' \ + --old-group-format='-------- %dn line%(n=1?:s) deleted at %df: + %<' \ + --new-group-format='-------- %dN line%(N=1?:s) added after %de: + %>' \ + --changed-group-format='-------- %dn line%(n=1?:s) changed at %df: + %<-------- to: + %>' \ + old new + + To specify a line group format, use 'diff' with one of the options +listed below. You can specify up to four line group formats, one for +each kind of line group. You should quote FORMAT, because it typically +contains shell metacharacters. + +'--old-group-format=FORMAT' + These line groups are hunks containing only lines from the first + file. The default old group format is the same as the changed + group format if it is specified; otherwise it is a format that + outputs the line group as-is. + +'--new-group-format=FORMAT' + These line groups are hunks containing only lines from the second + file. The default new group format is same as the changed group + format if it is specified; otherwise it is a format that outputs + the line group as-is. + +'--changed-group-format=FORMAT' + These line groups are hunks containing lines from both files. The + default changed group format is the concatenation of the old and + new group formats. + +'--unchanged-group-format=FORMAT' + These line groups contain lines common to both files. The default + unchanged group format is a format that outputs the line group + as-is. + + In a line group format, ordinary characters represent themselves; +conversion specifications start with '%' and have one of the following +forms. + +'%<' + stands for the lines from the first file, including the trailing + newline. Each line is formatted according to the old line format + (*note Line Formats::). + +'%>' + stands for the lines from the second file, including the trailing + newline. Each line is formatted according to the new line format. + +'%=' + stands for the lines common to both files, including the trailing + newline. Each line is formatted according to the unchanged line + format. + +'%%' + stands for '%'. + +'%c'C'' + where C is a single character, stands for C. C may not be a + backslash or an apostrophe. For example, '%c':'' stands for a + colon, even inside the then-part of an if-then-else format, which a + colon would normally terminate. + +'%c'\O'' + where O is a string of 1, 2, or 3 octal digits, stands for the + character with octal code O. For example, '%c'\0'' stands for a + null character. + +'FN' + where F is a 'printf' conversion specification and N is one of the + following letters, stands for N's value formatted with F. + + 'e' + The line number of the line just before the group in the old + file. + + 'f' + The line number of the first line in the group in the old + file; equals E + 1. + + 'l' + The line number of the last line in the group in the old file. + + 'm' + The line number of the line just after the group in the old + file; equals L + 1. + + 'n' + The number of lines in the group in the old file; equals L - F + + 1. + + 'E, F, L, M, N' + Likewise, for lines in the new file. + + The 'printf' conversion specification can be '%d', '%o', '%x', or + '%X', specifying decimal, octal, lower case hexadecimal, or upper + case hexadecimal output respectively. After the '%' the following + options can appear in sequence: a series of zero or more flags; an + integer specifying the minimum field width; and a period followed + by an optional integer specifying the minimum number of digits. + The flags are '-' for left-justification, ''' for separating the + digit into groups as specified by the 'LC_NUMERIC' locale category, + and '0' for padding with zeros instead of spaces. For example, + '%5dN' prints the number of new lines in the group in a field of + width 5 characters, using the 'printf' format '"%5d"'. + +'(A=B?T:E)' + If A equals B then T else E. A and B are each either a decimal + constant or a single letter interpreted as above. This format spec + is equivalent to T if A's value equals B's; otherwise it is + equivalent to E. + + For example, '%(N=0?no:%dN) line%(N=1?:s)' is equivalent to 'no + lines' if N (the number of lines in the group in the new file) is + 0, to '1 line' if N is 1, and to '%dN lines' otherwise. + + +File: diffutils.info-t, Node: Line Formats, Next: Example If-then-else, Prev: Line Group Formats, Up: If-then-else + +2.6.2 Line Formats +------------------ + +Line formats control how each line taken from an input file is output as +part of a line group in if-then-else format. + + For example, the following command outputs text with a one-character +change indicator to the left of the text. The first character of output +is '-' for deleted lines, '|' for added lines, and a space for unchanged +lines. The formats contain newline characters where newlines are +desired on output. + + diff \ + --old-line-format='-%l + ' \ + --new-line-format='|%l + ' \ + --unchanged-line-format=' %l + ' \ + old new + + To specify a line format, use one of the following options. You +should quote FORMAT, since it often contains shell metacharacters. + +'--old-line-format=FORMAT' + formats lines just from the first file. + +'--new-line-format=FORMAT' + formats lines just from the second file. + +'--unchanged-line-format=FORMAT' + formats lines common to both files. + +'--line-format=FORMAT' + formats all lines; in effect, it sets all three above options + simultaneously. + + In a line format, ordinary characters represent themselves; +conversion specifications start with '%' and have one of the following +forms. + +'%l' + stands for the contents of the line, not counting its trailing + newline (if any). This format ignores whether the line is + incomplete; *Note Incomplete Lines::. + +'%L' + stands for the contents of the line, including its trailing newline + (if any). If a line is incomplete, this format preserves its + incompleteness. + +'%%' + stands for '%'. + +'%c'C'' + where C is a single character, stands for C. C may not be a + backslash or an apostrophe. For example, '%c':'' stands for a + colon. + +'%c'\O'' + where O is a string of 1, 2, or 3 octal digits, stands for the + character with octal code O. For example, '%c'\0'' stands for a + null character. + +'Fn' + where F is a 'printf' conversion specification, stands for the line + number formatted with F. For example, '%.5dn' prints the line + number using the 'printf' format '"%.5d"'. *Note Line Group + Formats::, for more about printf conversion specifications. + + The default line format is '%l' followed by a newline character. + + If the input contains tab characters and it is important that they +line up on output, you should ensure that '%l' or '%L' in a line format +is just after a tab stop (e.g. by preceding '%l' or '%L' with a tab +character), or you should use the '-t' or '--expand-tabs' option. + + Taken together, the line and line group formats let you specify many +different formats. For example, the following command uses a format +similar to normal 'diff' format. You can tailor this command to get +fine control over 'diff' output. + + diff \ + --old-line-format='< %l + ' \ + --new-line-format='> %l + ' \ + --old-group-format='%df%(f=l?:,%dl)d%dE + %<' \ + --new-group-format='%dea%dF%(F=L?:,%dL) + %>' \ + --changed-group-format='%df%(f=l?:,%dl)c%dF%(F=L?:,%dL) + %<--- + %>' \ + --unchanged-group-format='' \ + old new + + +File: diffutils.info-t, Node: Example If-then-else, Next: Detailed If-then-else, Prev: Line Formats, Up: If-then-else + +2.6.3 An Example of If-then-else Format +--------------------------------------- + +Here is the output of 'diff -DTWO lao tzu' (*note Sample diff Input::, +for the complete contents of the two files): + + #ifndef TWO + The Way that can be told of is not the eternal Way; + The name that can be named is not the eternal name. + #endif /* ! TWO */ + The Nameless is the origin of Heaven and Earth; + #ifndef TWO + The Named is the mother of all things. + #else /* TWO */ + The named is the mother of all things. + + #endif /* TWO */ + Therefore let there always be non-being, + so we may see their subtlety, + And let there always be being, + so we may see their outcome. + The two are the same, + But after they are produced, + they have different names. + #ifdef TWO + They both may be called deep and profound. + Deeper and more profound, + The door of all subtleties! + #endif /* TWO */ + + +File: diffutils.info-t, Node: Detailed If-then-else, Prev: Example If-then-else, Up: If-then-else + +2.6.4 Detailed Description of If-then-else Format +------------------------------------------------- + +For lines common to both files, 'diff' uses the unchanged line group +format. For each hunk of differences in the merged output format, if +the hunk contains only lines from the first file, 'diff' uses the old +line group format; if the hunk contains only lines from the second file, +'diff' uses the new group format; otherwise, 'diff' uses the changed +group format. + + The old, new, and unchanged line formats specify the output format of +lines from the first file, lines from the second file, and lines common +to both files, respectively. + + The option '--ifdef=NAME' is equivalent to the following sequence of +options using shell syntax: + + --old-group-format='#ifndef NAME + %<#endif /* ! NAME */ + ' \ + --new-group-format='#ifdef NAME + %>#endif /* NAME */ + ' \ + --unchanged-group-format='%=' \ + --changed-group-format='#ifndef NAME + %<#else /* NAME */ + %>#endif /* NAME */ + ' + + You should carefully check the 'diff' output for proper nesting. For +example, when using the '-D NAME' or '--ifdef=NAME' option, you should +check that if the differing lines contain any of the C preprocessor +directives '#ifdef', '#ifndef', '#else', '#elif', or '#endif', they are +nested properly and match. If they don't, you must make corrections +manually. It is a good idea to carefully check the resulting code +anyway to make sure that it really does what you want it to; depending +on how the input files were produced, the output might contain duplicate +or otherwise incorrect code. + + The 'patch' '-D NAME' option behaves like the 'diff' '-D NAME' +option, except it operates on a file and a diff to produce a merged +file. *Note patch Options::. + + +File: diffutils.info-t, Node: Incomplete Lines, Next: Comparing Directories, Prev: Output Formats, Up: Top + +3 Incomplete Lines +****************** + +When an input file ends in a non-newline character, its last line is +called an "incomplete line" because its last character is not a newline. +All other lines are called "full lines" and end in a newline character. +Incomplete lines do not match full lines unless differences in white +space are ignored (*note White Space::). + + An incomplete line is normally distinguished on output from a full +line by a following line that starts with '\'. However, the RCS format +(*note RCS::) outputs the incomplete line as-is, without any trailing +newline or following line. The side by side format normally represents +incomplete lines as-is, but in some cases uses a '\' or '/' gutter +marker. *Note Side by Side::. The if-then-else line format preserves a +line's incompleteness with '%L', and discards the newline with '%l'. +*Note Line Formats::. Finally, with the 'ed' and forward 'ed' output +formats (*note Output Formats::) 'diff' cannot represent an incomplete +line, so it pretends there was a newline and reports an error. + + For example, suppose 'F' and 'G' are one-byte files that contain just +'f' and 'g', respectively. Then 'diff F G' outputs + + 1c1 + < f + \ No newline at end of file + --- + > g + \ No newline at end of file + +(The exact message may differ in non-English locales.) 'diff -n F G' +outputs the following without a trailing newline: + + d1 1 + a1 1 + g + +'diff -e F G' reports two errors and outputs the following: + + 1c + g + . + + +File: diffutils.info-t, Node: Comparing Directories, Next: Adjusting Output, Prev: Incomplete Lines, Up: Top + +4 Comparing Directories +*********************** + +You can use 'diff' to compare some or all of the files in two directory +trees. When both file name arguments to 'diff' are directories, it +compares each file that is contained in both directories, examining file +names in alphabetical order as specified by the 'LC_COLLATE' locale +category. Normally 'diff' is silent about pairs of files that contain +no differences, but if you use the '--report-identical-files' ('-s') +option, it reports pairs of identical files. Normally 'diff' reports +subdirectories common to both directories without comparing +subdirectories' files, but if you use the '-r' or '--recursive' option, +it compares every corresponding pair of files in the directory trees, as +many levels deep as they go. + + If only one file exists, 'diff' normally does not show its contents; +it merely reports that one file exists but the other does not. You can +make 'diff' act as though the missing file is empty, so that it outputs +the entire contents of the file that actually exists. (It is output as +either an insertion or a deletion, depending on whether the missing file +is in the first or the second position.) To do this, use the +'--new-file' ('-N') option. This option affects command-line arguments +as well as files found via directory traversal; for example, 'diff -N a +b' treats 'a' as empty if 'a' does not exist but 'b' does, and similarly +'diff -N - b' treats standard input as empty if it is closed but 'b' +exists. + + If the older directory contains large files that are not in the newer +directory, you can make the patch smaller by using the +'--unidirectional-new-file' option instead of '-N'. This option is like +'-N' except that it inserts the contents only of files that appear in +the second directory but not the first (that is, files that were added). +At the top of the patch, write instructions for the user applying the +patch to remove the files that were deleted before applying the patch. +*Note Making Patches::, for more discussion of making patches for +distribution. + + To ignore some files while comparing directories, use the +'--exclude=PATTERN' ('-x PATTERN') option. This option ignores any +files or subdirectories whose base names match the shell pattern +PATTERN. Unlike in the shell, a period at the start of the base of a +file name matches a wildcard at the start of a pattern. You should +enclose PATTERN in quotes so that the shell does not expand it. For +example, the option '-x '*.[ao]'' ignores any file whose name ends with +'.a' or '.o'. + + This option accumulates if you specify it more than once. For +example, using the options '-x 'RCS' -x '*,v'' ignores any file or +subdirectory whose base name is 'RCS' or ends with ',v'. + + If you need to give this option many times, you can instead put the +patterns in a file, one pattern per line, and use the +'--exclude-from=FILE' ('-X FILE') option. Trailing white space and +empty lines are ignored in the pattern file. + + If you have been comparing two directories and stopped partway +through, later you might want to continue where you left off. You can +do this by using the '--starting-file=FILE' ('-S FILE') option. This +compares only the file FILE and all alphabetically later files in the +topmost directory level. + + If two directories differ only in that file names are lower case in +one directory and upper case in the upper, 'diff' normally reports many +differences because it compares file names in a case sensitive way. +With the '--ignore-file-name-case' option, 'diff' ignores case +differences in file names, so that for example the contents of the file +'Tao' in one directory are compared to the contents of the file 'TAO' in +the other. The '--no-ignore-file-name-case' option cancels the effect +of the '--ignore-file-name-case' option, reverting to the default +behavior. + + If an '--exclude=PATTERN' ('-x PATTERN') option, or an +'--exclude-from=FILE' ('-X FILE') option, is specified while the +'--ignore-file-name-case' option is in effect, case is ignored when +excluding file names matching the specified patterns. + + To tell 'diff' not to follow a symbolic link, use the +'--no-dereference' option. + + +File: diffutils.info-t, Node: Adjusting Output, Next: diff Performance, Prev: Comparing Directories, Up: Top + +5 Making 'diff' Output Prettier +******************************* + +'diff' provides several ways to adjust the appearance of its output. +These adjustments can be applied to any output format. + +* Menu: + +* Tabs:: Preserving the alignment of tab stops. +* Trailing Blanks:: Suppressing blanks before empty output lines. +* Pagination:: Page numbering and time-stamping 'diff' output. + + +File: diffutils.info-t, Node: Tabs, Next: Trailing Blanks, Up: Adjusting Output + +5.1 Preserving Tab Stop Alignment +================================= + +The lines of text in some of the 'diff' output formats are preceded by +one or two characters that indicate whether the text is inserted, +deleted, or changed. The addition of those characters can cause tabs to +move to the next tab stop, throwing off the alignment of columns in the +line. GNU 'diff' provides two ways to make tab-aligned columns line up +correctly. + + The first way is to have 'diff' convert all tabs into the correct +number of spaces before outputting them; select this method with the +'--expand-tabs' ('-t') option. To use this form of output with 'patch', +you must give 'patch' the '-l' or '--ignore-white-space' option (*note +Changed White Space::, for more information). 'diff' normally assumes +that tab stops are set every 8 print columns, but this can be altered by +the '--tabsize=COLUMNS' option. + + The other method for making tabs line up correctly is to add a tab +character instead of a space after the indicator character at the +beginning of the line. This ensures that all following tab characters +are in the same position relative to tab stops that they were in the +original files, so that the output is aligned correctly. Its +disadvantage is that it can make long lines too long to fit on one line +of the screen or the paper. It also does not work with the unified +output format, which does not have a space character after the change +type indicator character. Select this method with the '-T' or +'--initial-tab' option. + + +File: diffutils.info-t, Node: Trailing Blanks, Next: Pagination, Prev: Tabs, Up: Adjusting Output + +5.2 Omitting trailing blanks +============================ + +When outputting lines in normal or context format, or outputting an +unchanged line in unified format, 'diff' normally outputs a blank just +before each line. If the line is empty, the output of 'diff' therefore +contains trailing blanks even though the input does not contain them. +For example, when outputting an unchanged empty line in context format, +'diff' normally outputs a line with two leading spaces. + + Some text editors and email agents routinely delete trailing blanks, +so it can be a problem to deal with diff output files that contain them. +You can avoid this problem with the '--suppress-blank-empty' option. It +causes 'diff' to omit trailing blanks at the end of output lines in +normal, context, and unified format, unless the trailing blanks were +already present in the input. This changes the output format slightly, +so that output lines are guaranteed to never end in a blank unless an +input line ends in a blank. This format is less likely to be munged by +text editors or by transmission via email. It is accepted by GNU +'patch' as well. + + +File: diffutils.info-t, Node: Pagination, Prev: Trailing Blanks, Up: Adjusting Output + +5.3 Paginating 'diff' Output +============================ + +It can be convenient to have long output page-numbered and time-stamped. +The '--paginate' ('-l') option does this by sending the 'diff' output +through the 'pr' program. Here is what the page header might look like +for 'diff -lc lao tzu': + + 2002-02-22 14:20 diff -lc lao tzu Page 1 + + +File: diffutils.info-t, Node: diff Performance, Next: Comparing Three Files, Prev: Adjusting Output, Up: Top + +6 'diff' Performance Tradeoffs +****************************** + +GNU 'diff' runs quite efficiently; however, in some circumstances you +can cause it to run faster or produce a more compact set of changes. + + One way to improve 'diff' performance is to use hard or symbolic +links to files instead of copies. This improves performance because +'diff' normally does not need to read two hard or symbolic links to the +same file, since their contents must be identical. For example, suppose +you copy a large directory hierarchy, make a few changes to the copy, +and then often use 'diff -r' to compare the original to the copy. If +the original files are read-only, you can greatly improve performance by +creating the copy using hard or symbolic links (e.g., with GNU 'cp -lR' +or 'cp -sR'). Before editing a file in the copy for the first time, you +should break the link and replace it with a regular copy. + + You can also affect the performance of GNU 'diff' by giving it +options that change the way it compares files. Performance has more +than one dimension. These options improve one aspect of performance at +the cost of another, or they improve performance in some cases while +hurting it in others. + + The way that GNU 'diff' determines which lines have changed always +comes up with a near-minimal set of differences. Usually it is good +enough for practical purposes. If the 'diff' output is large, you might +want 'diff' to use a modified algorithm that sometimes produces a +smaller set of differences. The '--minimal' ('-d') option does this; +however, it can also cause 'diff' to run more slowly than usual, so it +is not the default behavior. + + When the files you are comparing are large and have small groups of +changes scattered throughout them, you can use the '--speed-large-files' +option to make a different modification to the algorithm that 'diff' +uses. If the input files have a constant small density of changes, this +option speeds up the comparisons without changing the output. If not, +'diff' might produce a larger set of differences; however, the output +will still be correct. + + Normally 'diff' discards the prefix and suffix that is common to both +files before it attempts to find a minimal set of differences. This +makes 'diff' run faster, but occasionally it may produce non-minimal +output. The '--horizon-lines=LINES' option prevents 'diff' from +discarding the last LINES lines of the prefix and the first LINES lines +of the suffix. This gives 'diff' further opportunities to find a +minimal output. + + Suppose a run of changed lines includes a sequence of lines at one +end and there is an identical sequence of lines just outside the other +end. The 'diff' command is free to choose which identical sequence is +included in the hunk. In this case, 'diff' normally shifts the hunk's +boundaries when this merges adjacent hunks, or shifts a hunk's lines +towards the end of the file. Merging hunks can make the output look +nicer in some cases. + + +File: diffutils.info-t, Node: Comparing Three Files, Next: diff3 Merging, Prev: diff Performance, Up: Top + +7 Comparing Three Files +*********************** + +Use the program 'diff3' to compare three files and show any differences +among them. ('diff3' can also merge files; see *note diff3 Merging::). + + The "normal" 'diff3' output format shows each hunk of differences +without surrounding context. Hunks are labeled depending on whether +they are two-way or three-way, and lines are annotated by their location +in the input files. + + *Note Invoking diff3::, for more information on how to run 'diff3'. + +* Menu: + +* Sample diff3 Input:: Sample 'diff3' input for examples. +* Example diff3 Normal:: Sample output in the normal format. +* Detailed diff3 Normal:: A detailed description of normal output format. +* diff3 Hunks:: The format of normal output format. + + +File: diffutils.info-t, Node: Sample diff3 Input, Next: Example diff3 Normal, Up: Comparing Three Files + +7.1 A Third Sample Input File +============================= + +Here is a third sample file that will be used in examples to illustrate +the output of 'diff3' and how various options can change it. The first +two files are the same that we used for 'diff' (*note Sample diff +Input::). This is the third sample file, called 'tao': + + The Way that can be told of is not the eternal Way; + The name that can be named is not the eternal name. + The Nameless is the origin of Heaven and Earth; + The named is the mother of all things. + + Therefore let there always be non-being, + so we may see their subtlety, + And let there always be being, + so we may see their result. + The two are the same, + But after they are produced, + they have different names. + + -- The Way of Lao-Tzu, tr. Wing-tsit Chan + + +File: diffutils.info-t, Node: Example diff3 Normal, Next: Detailed diff3 Normal, Prev: Sample diff3 Input, Up: Comparing Three Files + +7.2 An Example of 'diff3' Normal Format +======================================= + +Here is the output of the command 'diff3 lao tzu tao' (*note Sample +diff3 Input::, for the complete contents of the files). Notice that it +shows only the lines that are different among the three files. + + ====2 + 1:1,2c + 3:1,2c + The Way that can be told of is not the eternal Way; + The name that can be named is not the eternal name. + 2:0a + ====1 + 1:4c + The Named is the mother of all things. + 2:2,3c + 3:4,5c + The named is the mother of all things. + + ====3 + 1:8c + 2:7c + so we may see their outcome. + 3:9c + so we may see their result. + ==== + 1:11a + 2:11,13c + They both may be called deep and profound. + Deeper and more profound, + The door of all subtleties! + 3:13,14c + + -- The Way of Lao-Tzu, tr. Wing-tsit Chan + + +File: diffutils.info-t, Node: Detailed diff3 Normal, Next: diff3 Hunks, Prev: Example diff3 Normal, Up: Comparing Three Files + +7.3 Detailed Description of 'diff3' Normal Format +================================================= + +Each hunk begins with a line marked '===='. Three-way hunks have plain +'====' lines, and two-way hunks have '1', '2', or '3' appended to +specify which of the three input files differ in that hunk. The hunks +contain copies of two or three sets of input lines each preceded by one +or two commands identifying where the lines came from. + + Normally, two spaces precede each copy of an input line to +distinguish it from the commands. But with the '--initial-tab' ('-T') +option, 'diff3' uses a tab instead of two spaces; this lines up tabs +correctly. *Note Tabs::, for more information. + + Commands take the following forms: + +'FILE:La' + This hunk appears after line L of file FILE, and contains no lines + in that file. To edit this file to yield the other files, one must + append hunk lines taken from the other files. For example, '1:11a' + means that the hunk follows line 11 in the first file and contains + no lines from that file. + +'FILE:Rc' + This hunk contains the lines in the range R of file FILE. The + range R is a comma-separated pair of line numbers, or just one + number if there is only one line. To edit this file to yield the + other files, one must change the specified lines to be the lines + taken from the other files. For example, '2:11,13c' means that the + hunk contains lines 11 through 13 from the second file. + + If the last line in a set of input lines is incomplete (*note +Incomplete Lines::), it is distinguished on output from a full line by a +following line that starts with '\'. + + +File: diffutils.info-t, Node: diff3 Hunks, Prev: Detailed diff3 Normal, Up: Comparing Three Files + +7.4 'diff3' Hunks +================= + +Groups of lines that differ in two or three of the input files are +called "diff3 hunks", by analogy with 'diff' hunks (*note Hunks::). If +all three input files differ in a 'diff3' hunk, the hunk is called a +"three-way hunk"; if just two input files differ, it is a "two-way +hunk". + + As with 'diff', several solutions are possible. When comparing the +files 'A', 'B', and 'C', 'diff3' normally finds 'diff3' hunks by merging +the two-way hunks output by the two commands 'diff A B' and 'diff A C'. +This does not necessarily minimize the size of the output, but +exceptions should be rare. + + For example, suppose 'F' contains the three lines 'a', 'b', 'f', 'G' +contains the lines 'g', 'b', 'g', and 'H' contains the lines 'a', 'b', +'h'. 'diff3 F G H' might output the following: + + ====2 + 1:1c + 3:1c + a + 2:1c + g + ==== + 1:3c + f + 2:3c + g + 3:3c + h + +because it found a two-way hunk containing 'a' in the first and third +files and 'g' in the second file, then the single line 'b' common to all +three files, then a three-way hunk containing the last line of each +file. + + +File: diffutils.info-t, Node: diff3 Merging, Next: Interactive Merging, Prev: Comparing Three Files, Up: Top + +8 Merging From a Common Ancestor +******************************** + +When two people have made changes to copies of the same file, 'diff3' +can produce a merged output that contains both sets of changes together +with warnings about conflicts. + + One might imagine programs with names like 'diff4' and 'diff5' to +compare more than three files simultaneously, but in practice the need +rarely arises. You can use 'diff3' to merge three or more sets of +changes to a file by merging two change sets at a time. + + 'diff3' can incorporate changes from two modified versions into a +common preceding version. This lets you merge the sets of changes +represented by the two newer files. Specify the common ancestor version +as the second argument and the two newer versions as the first and third +arguments, like this: + + diff3 MINE OLDER YOURS + +You can remember the order of the arguments by noting that they are in +alphabetical order. + + You can think of this as subtracting OLDER from YOURS and adding the +result to MINE, or as merging into MINE the changes that would turn +OLDER into YOURS. This merging is well-defined as long as MINE and +OLDER match in the neighborhood of each such change. This fails to be +true when all three input files differ or when only OLDER differs; we +call this a "conflict". When all three input files differ, we call the +conflict an "overlap". + + 'diff3' gives you several ways to handle overlaps and conflicts. You +can omit overlaps or conflicts, or select only overlaps, or mark +conflicts with special '<<<<<<<' and '>>>>>>>' lines. + + 'diff3' can output the merge results as an 'ed' script that that can +be applied to the first file to yield the merged output. However, it is +usually better to have 'diff3' generate the merged output directly; this +bypasses some problems with 'ed'. + +* Menu: + +* Which Changes:: Selecting changes to incorporate. +* Marking Conflicts:: Marking conflicts. +* Bypassing ed:: Generating merged output directly. +* Merging Incomplete Lines:: How 'diff3' merges incomplete lines. +* Saving the Changed File:: Emulating System V behavior. + + +File: diffutils.info-t, Node: Which Changes, Next: Marking Conflicts, Up: diff3 Merging + +8.1 Selecting Which Changes to Incorporate +========================================== + +You can select all unmerged changes from OLDER to YOURS for merging into +MINE with the '--ed' ('-e') option. You can select only the +nonoverlapping unmerged changes with '--easy-only' ('-3'), and you can +select only the overlapping changes with '--overlap-only' ('-x'). + + The '-e', '-3' and '-x' options select only "unmerged changes", i.e. +changes where MINE and YOURS differ; they ignore changes from OLDER to +YOURS where MINE and YOURS are identical, because they assume that such +changes have already been merged. If this assumption is not a safe one, +you can use the '--show-all' ('-A') option (*note Marking Conflicts::). + + Here is the output of the command 'diff3' with each of these three +options (*note Sample diff3 Input::, for the complete contents of the +files). Notice that '-e' outputs the union of the disjoint sets of +changes output by '-3' and '-x'. + + Output of 'diff3 -e lao tzu tao': + 11a + + -- The Way of Lao-Tzu, tr. Wing-tsit Chan + . + 8c + so we may see their result. + . + + Output of 'diff3 -3 lao tzu tao': + 8c + so we may see their result. + . + + Output of 'diff3 -x lao tzu tao': + 11a + + -- The Way of Lao-Tzu, tr. Wing-tsit Chan + . + + +File: diffutils.info-t, Node: Marking Conflicts, Next: Bypassing ed, Prev: Which Changes, Up: diff3 Merging + +8.2 Marking Conflicts +===================== + +'diff3' can mark conflicts in the merged output by bracketing them with +special marker lines. A conflict that comes from two files A and B is +marked as follows: + + <<<<<<< A + lines from A + ======= + lines from B + >>>>>>> B + + A conflict that comes from three files A, B and C is marked as +follows: + + <<<<<<< A + lines from A + ||||||| B + lines from B + ======= + lines from C + >>>>>>> C + + The '--show-all' ('-A') option acts like the '-e' option, except that +it brackets conflicts, and it outputs all changes from OLDER to YOURS, +not just the unmerged changes. Thus, given the sample input files +(*note Sample diff3 Input::), 'diff3 -A lao tzu tao' puts brackets +around the conflict where only 'tzu' differs: + + <<<<<<< tzu + ======= + The Way that can be told of is not the eternal Way; + The name that can be named is not the eternal name. + >>>>>>> tao + + And it outputs the three-way conflict as follows: + + <<<<<<< lao + ||||||| tzu + They both may be called deep and profound. + Deeper and more profound, + The door of all subtleties! + ======= + + -- The Way of Lao-Tzu, tr. Wing-tsit Chan + >>>>>>> tao + + The '--show-overlap' ('-E') option outputs less information than the +'--show-all' ('-A') option, because it outputs only unmerged changes, +and it never outputs the contents of the second file. Thus the '-E' +option acts like the '-e' option, except that it brackets the first and +third files from three-way overlapping changes. Similarly, '-X' acts +like '-x', except it brackets all its (necessarily overlapping) changes. +For example, for the three-way overlapping change above, the '-E' and +'-X' options output the following: + + <<<<<<< lao + ======= + + -- The Way of Lao-Tzu, tr. Wing-tsit Chan + >>>>>>> tao + + If you are comparing files that have meaningless or uninformative +names, you can use the '--label=LABEL' option to show alternate names in +the '<<<<<<<', '|||||||' and '>>>>>>>' brackets. This option can be +given up to three times, once for each input file. Thus 'diff3 -A +--label X --label Y --label Z A B C' acts like 'diff3 -A A B C', except +that the output looks like it came from files named 'X', 'Y' and 'Z' +rather than from files named 'A', 'B' and 'C'. + + +File: diffutils.info-t, Node: Bypassing ed, Next: Merging Incomplete Lines, Prev: Marking Conflicts, Up: diff3 Merging + +8.3 Generating the Merged Output Directly +========================================= + +With the '--merge' ('-m') option, 'diff3' outputs the merged file +directly. This is more efficient than using 'ed' to generate it, and +works even with non-text files that 'ed' would reject. If you specify +'-m' without an 'ed' script option, '-A' is assumed. + + For example, the command 'diff3 -m lao tzu tao' (*note Sample diff3 +Input:: for a copy of the input files) would output the following: + + <<<<<<< tzu + ======= + The Way that can be told of is not the eternal Way; + The name that can be named is not the eternal name. + >>>>>>> tao + The Nameless is the origin of Heaven and Earth; + The Named is the mother of all things. + Therefore let there always be non-being, + so we may see their subtlety, + And let there always be being, + so we may see their result. + The two are the same, + But after they are produced, + they have different names. + <<<<<<< lao + ||||||| tzu + They both may be called deep and profound. + Deeper and more profound, + The door of all subtleties! + ======= + + -- The Way of Lao-Tzu, tr. Wing-tsit Chan + >>>>>>> tao + + +File: diffutils.info-t, Node: Merging Incomplete Lines, Next: Saving the Changed File, Prev: Bypassing ed, Up: diff3 Merging + +8.4 How 'diff3' Merges Incomplete Lines +======================================= + +With '-m', incomplete lines (*note Incomplete Lines::) are simply copied +to the output as they are found; if the merged output ends in an +conflict and one of the input files ends in an incomplete line, +succeeding '|||||||', '=======' or '>>>>>>>' brackets appear somewhere +other than the start of a line because they are appended to the +incomplete line. + + Without '-m', if an 'ed' script option is specified and an incomplete +line is found, 'diff3' generates a warning and acts as if a newline had +been present. + + +File: diffutils.info-t, Node: Saving the Changed File, Prev: Merging Incomplete Lines, Up: diff3 Merging + +8.5 Saving the Changed File +=========================== + +Traditional Unix 'diff3' generates an 'ed' script without the trailing +'w' and 'q' commands that save the changes. System V 'diff3' generates +these extra commands. GNU 'diff3' normally behaves like traditional +Unix 'diff3', but with the '-i' option it behaves like System V 'diff3' +and appends the 'w' and 'q' commands. + + The '-i' option requires one of the 'ed' script options '-AeExX3', +and is incompatible with the merged output option '-m'. + + +File: diffutils.info-t, Node: Interactive Merging, Next: Merging with patch, Prev: diff3 Merging, Up: Top + +9 Interactive Merging with 'sdiff' +********************************** + +With 'sdiff', you can merge two files interactively based on a +side-by-side '-y' format comparison (*note Side by Side::). Use +'--output=FILE' ('-o FILE') to specify where to put the merged text. +*Note Invoking sdiff::, for more details on the options to 'sdiff'. + + Another way to merge files interactively is to use the Emacs Lisp +package 'emerge'. *Note Emerge: (emacs)Emerge, for more information. + +* Menu: + +* sdiff Option Summary:: Summary of 'sdiff' options. +* Merge Commands:: Merging two files interactively. + + +File: diffutils.info-t, Node: sdiff Option Summary, Next: Merge Commands, Up: Interactive Merging + +9.1 Specifying 'diff' Options to 'sdiff' +======================================== + +The following 'sdiff' options have the same meaning as for 'diff'. +*Note diff Options::, for the use of these options. + + -a -b -d -i -t -v + -B -E -I REGEXP -Z + + --expand-tabs + --ignore-blank-lines --ignore-case + --ignore-matching-lines=REGEXP --ignore-space-change + --ignore-tab-expansion --ignore-trailing-space + --left-column --minimal --speed-large-files + --strip-trailing-cr --suppress-common-lines + --tabsize=COLUMNS --text --version --width=COLUMNS + + For historical reasons, 'sdiff' has alternate names for some options. +The '-l' option is equivalent to the '--left-column' option, and +similarly '-s' is equivalent to '--suppress-common-lines'. The meaning +of the 'sdiff' '-w' and '-W' options is interchanged from that of +'diff': with 'sdiff', '-w COLUMNS' is equivalent to '--width=COLUMNS', +and '-W' is equivalent to '--ignore-all-space'. 'sdiff' without the +'-o' option is equivalent to 'diff' with the '--side-by-side' ('-y') +option (*note Side by Side::). + + +File: diffutils.info-t, Node: Merge Commands, Prev: sdiff Option Summary, Up: Interactive Merging + +9.2 Merge Commands +================== + +Groups of common lines, with a blank gutter, are copied from the first +file to the output. After each group of differing lines, 'sdiff' +prompts with '%' and pauses, waiting for one of the following commands. +Follow each command with <RET>. + +'e' + Discard both versions. Invoke a text editor on an empty temporary + file, then copy the resulting file to the output. + +'eb' + Concatenate the two versions, edit the result in a temporary file, + then copy the edited result to the output. + +'ed' + Like 'eb', except precede each version with a header that shows + what file and lines the version came from. + +'el' +'e1' + Edit a copy of the left version, then copy the result to the + output. + +'er' +'e2' + Edit a copy of the right version, then copy the result to the + output. + +'l' +'1' + Copy the left version to the output. + +'q' + Quit. + +'r' +'2' + Copy the right version to the output. + +'s' + Silently copy common lines. + +'v' + Verbosely copy common lines. This is the default. + + The text editor invoked is specified by the 'EDITOR' environment +variable if it is set. The default is system-dependent. + + +File: diffutils.info-t, Node: Merging with patch, Next: Making Patches, Prev: Interactive Merging, Up: Top + +10 Merging with 'patch' +*********************** + +'patch' takes comparison output produced by 'diff' and applies the +differences to a copy of the original file, producing a patched version. +With 'patch', you can distribute just the changes to a set of files +instead of distributing the entire file set; your correspondents can +apply 'patch' to update their copy of the files with your changes. +'patch' automatically determines the diff format, skips any leading or +trailing headers, and uses the headers to determine which file to patch. +This lets your correspondents feed a mail message containing a +difference listing directly to 'patch'. + + 'patch' detects and warns about common problems like forward patches. +It saves any patches that it could not apply. It can also maintain a +'patchlevel.h' file to ensure that your correspondents apply diffs in +the proper order. + + 'patch' accepts a series of diffs in its standard input, usually +separated by headers that specify which file to patch. It applies +'diff' hunks (*note Hunks::) one by one. If a hunk does not exactly +match the original file, 'patch' uses heuristics to try to patch the +file as well as it can. If no approximate match can be found, 'patch' +rejects the hunk and skips to the next hunk. 'patch' normally replaces +each file F with its new version, putting reject hunks (if any) into +'F.rej'. + + *Note Invoking patch::, for detailed information on the options to +'patch'. + +* Menu: + +* patch Input:: Selecting the type of 'patch' input. +* Revision Control:: Getting files from RCS, SCCS, etc. +* Imperfect:: Dealing with imperfect patches. +* Creating and Removing:: Creating and removing files with a patch. +* Patching Timestamps:: Updating timestamps on patched files. +* Multiple Patches:: Handling multiple patches in a file. +* patch Directories:: Changing directory and stripping directories. +* Backups:: Whether backup files are made. +* Backup Names:: Backup file names. +* Reject Names:: Reject file names. +* patch Messages:: Messages and questions 'patch' can produce. +* patch and POSIX:: Conformance to the POSIX standard. +* patch and Tradition:: GNU versus traditional 'patch'. + + +File: diffutils.info-t, Node: patch Input, Next: Revision Control, Up: Merging with patch + +10.1 Selecting the 'patch' Input Format +======================================= + +'patch' normally determines which 'diff' format the patch file uses by +examining its contents. For patch files that contain particularly +confusing leading text, you might need to use one of the following +options to force 'patch' to interpret the patch file as a certain format +of diff. The output formats listed here are the only ones that 'patch' +can understand. + +'-c' +'--context' + context diff. + +'-e' +'--ed' + 'ed' script. + +'-n' +'--normal' + normal diff. + +'-u' +'--unified' + unified diff. + + +File: diffutils.info-t, Node: Revision Control, Next: Imperfect, Prev: patch Input, Up: Merging with patch + +10.2 Revision Control +===================== + +If a nonexistent input file is under a revision control system supported +by 'patch', 'patch' normally asks the user whether to get (or check out) +the file from the revision control system. Patch currently supports +RCS, ClearCase and SCCS. Under RCS and SCCS, 'patch' also asks when the +input file is read-only and matches the default version in the revision +control system. + + The '--get=NUM' ('-g NUM') option affects access to files under +supported revision control systems. If NUM is positive, 'patch' gets +the file without asking the user; if zero, 'patch' neither asks the user +nor gets the file; and if negative, 'patch' asks the user before getting +the file. The default value of NUM is given by the value of the +'PATCH_GET' environment variable if it is set; if not, the default value +is zero if 'patch' is conforming to POSIX, negative otherwise. *Note +patch and POSIX::. + + The choice of revision control system is unaffected by the +'VERSION_CONTROL' environment variable (*note Backup Names::). + + +File: diffutils.info-t, Node: Imperfect, Next: Creating and Removing, Prev: Revision Control, Up: Merging with patch + +10.3 Applying Imperfect Patches +=============================== + +'patch' tries to skip any leading text in the patch file, apply the +diff, and then skip any trailing text. Thus you can feed a mail message +directly to 'patch', and it should work. If the entire diff is indented +by a constant amount of white space, 'patch' automatically ignores the +indentation. If a context diff contains trailing carriage return on +each line, 'patch' automatically ignores the carriage return. If a +context diff has been encapsulated by prepending '- ' to lines beginning +with '-' as per Internet RFC 934 +(ftp://ftp.isi.edu/in-notes/rfc934.txt), 'patch' automatically +unencapsulates the input. + + However, certain other types of imperfect input require user +intervention or testing. + +* Menu: + +* Changed White Space:: When tabs and spaces don't match exactly. +* Reversed Patches:: Applying reversed patches correctly. +* Inexact:: Helping 'patch' find close matches. +* Dry Runs:: Predicting what 'patch' will do. + + +File: diffutils.info-t, Node: Changed White Space, Next: Reversed Patches, Up: Imperfect + +10.3.1 Applying Patches with Changed White Space +------------------------------------------------ + +Sometimes mailers, editors, or other programs change spaces into tabs, +or vice versa. If this happens to a patch file or an input file, the +files might look the same, but 'patch' will not be able to match them +properly. If this problem occurs, use the '-l' or +'--ignore-white-space' option, which makes 'patch' compare blank +characters (i.e. spaces and tabs) loosely so that any nonempty sequence +of blanks in the patch file matches any nonempty sequence of blanks in +the input files. Non-blank characters must still match exactly. Each +line of the context must still match a line in the input file. + + +File: diffutils.info-t, Node: Reversed Patches, Next: Inexact, Prev: Changed White Space, Up: Imperfect + +10.3.2 Applying Reversed Patches +-------------------------------- + +Sometimes people run 'diff' with the new file first instead of second. +This creates a diff that is "reversed". To apply such patches, give +'patch' the '--reverse' ('-R') option. 'patch' then attempts to swap +each hunk around before applying it. Rejects come out in the swapped +format. + + Often 'patch' can guess that the patch is reversed. If the first +hunk of a patch fails, 'patch' reverses the hunk to see if it can apply +it that way. If it can, 'patch' asks you if you want to have the '-R' +option set; if it can't, 'patch' continues to apply the patch normally. +This method cannot detect a reversed patch if it is a normal diff and +the first command is an append (which should have been a delete) since +appends always succeed, because a null context matches anywhere. But +most patches add or change lines rather than delete them, so most +reversed normal diffs begin with a delete, which fails, and 'patch' +notices. + + If you apply a patch that you have already applied, 'patch' thinks it +is a reversed patch and offers to un-apply the patch. This could be +construed as a feature. If you did this inadvertently and you don't +want to un-apply the patch, just answer 'n' to this offer and to the +subsequent "apply anyway" question--or type 'C-c' to kill the 'patch' +process. + + +File: diffutils.info-t, Node: Inexact, Next: Dry Runs, Prev: Reversed Patches, Up: Imperfect + +10.3.3 Helping 'patch' Find Inexact Matches +------------------------------------------- + +For context diffs, and to a lesser extent normal diffs, 'patch' can +detect when the line numbers mentioned in the patch are incorrect, and +it attempts to find the correct place to apply each hunk of the patch. +As a first guess, it takes the line number mentioned in the hunk, plus +or minus any offset used in applying the previous hunk. If that is not +the correct place, 'patch' scans both forward and backward for a set of +lines matching the context given in the hunk. + + First 'patch' looks for a place where all lines of the context match. +If it cannot find such a place, and it is reading a context or unified +diff, and the maximum fuzz factor is set to 1 or more, then 'patch' +makes another scan, ignoring the first and last line of context. If +that fails, and the maximum fuzz factor is set to 2 or more, it makes +another scan, ignoring the first two and last two lines of context are +ignored. It continues similarly if the maximum fuzz factor is larger. + + The '--fuzz=LINES' ('-F LINES') option sets the maximum fuzz factor +to LINES. This option only applies to context and unified diffs; it +ignores up to LINES lines while looking for the place to install a hunk. +Note that a larger fuzz factor increases the odds of making a faulty +patch. The default fuzz factor is 2; there is no point to setting it to +more than the number of lines of context in the diff, ordinarily 3. + + If 'patch' cannot find a place to install a hunk of the patch, it +writes the hunk out to a reject file (*note Reject Names::, for +information on how reject files are named). It writes out rejected +hunks in context format no matter what form the input patch is in. If +the input is a normal or 'ed' diff, many of the contexts are simply +null. The line numbers on the hunks in the reject file may be different +from those in the patch file: they show the approximate location where +'patch' thinks the failed hunks belong in the new file rather than in +the old one. + + If the '--verbose' option is given, then as it completes each hunk +'patch' tells you whether the hunk succeeded or failed, and if it +failed, on which line (in the new file) 'patch' thinks the hunk should +go. If this is different from the line number specified in the diff, it +tells you the offset. A single large offset _may_ indicate that 'patch' +installed a hunk in the wrong place. 'patch' also tells you if it used +a fuzz factor to make the match, in which case you should also be +slightly suspicious. + + 'patch' cannot tell if the line numbers are off in an 'ed' script, +and can only detect wrong line numbers in a normal diff when it finds a +change or delete command. It may have the same problem with a context +diff using a fuzz factor equal to or greater than the number of lines of +context shown in the diff (typically 3). In these cases, you should +probably look at a context diff between your original and patched input +files to see if the changes make sense. Compiling without errors is a +pretty good indication that the patch worked, but not a guarantee. + + A patch against an empty file applies to a nonexistent file, and vice +versa. *Note Creating and Removing::. + + 'patch' usually produces the correct results, even when it must make +many guesses. However, the results are guaranteed only when the patch +is applied to an exact copy of the file that the patch was generated +from. + + +File: diffutils.info-t, Node: Dry Runs, Prev: Inexact, Up: Imperfect + +10.3.4 Predicting what 'patch' will do +-------------------------------------- + +It may not be obvious in advance what 'patch' will do with a complicated +or poorly formatted patch. If you are concerned that the input might +cause 'patch' to modify the wrong files, you can use the '--dry-run' +option, which causes 'patch' to print the results of applying patches +without actually changing any files. You can then inspect the +diagnostics generated by the dry run to see whether 'patch' will modify +the files that you expect. If the patch does not do what you want, you +can modify the patch (or the other options to 'patch') and try another +dry run. Once you are satisfied with the proposed patch you can apply +it by invoking 'patch' as before, but this time without the '--dry-run' +option. + + +File: diffutils.info-t, Node: Creating and Removing, Next: Patching Timestamps, Prev: Imperfect, Up: Merging with patch + +10.4 Creating and Removing Files +================================ + +Sometimes when comparing two directories, a file may exist in one +directory but not the other. If you give 'diff' the '--new-file' ('-N') +option, or if you supply an old or new file that is named '/dev/null' or +is empty and is dated the Epoch (1970-01-01 00:00:00 UTC), 'diff' +outputs a patch that adds or deletes the contents of this file. When +given such a patch, 'patch' normally creates a new file or removes the +old file. However, when conforming to POSIX (*note patch and POSIX::), +'patch' does not remove the old file, but leaves it empty. The +'--remove-empty-files' ('-E') option causes 'patch' to remove output +files that are empty after applying a patch, even if the patch does not +appear to be one that removed the file. + + If the patch appears to create a file that already exists, 'patch' +asks for confirmation before applying the patch. + + +File: diffutils.info-t, Node: Patching Timestamps, Next: Multiple Patches, Prev: Creating and Removing, Up: Merging with patch + +10.5 Updating Timestamps on Patched Files +========================================= + +When 'patch' updates a file, it normally sets the file's last-modified +timestamp to the current time of day. If you are using 'patch' to track +a software distribution, this can cause 'make' to incorrectly conclude +that a patched file is out of date. For example, if 'syntax.c' depends +on 'syntax.y', and 'patch' updates 'syntax.c' and then 'syntax.y', then +'syntax.c' will normally appear to be out of date with respect to +'syntax.y' even though its contents are actually up to date. + + The '--set-utc' ('-Z') option causes 'patch' to set a patched file's +modification and access times to the timestamps given in context diff +headers. If the context diff headers do not specify a time zone, they +are assumed to use Coordinated Universal Time (UTC, often known as GMT). + + The '--set-time' ('-T') option acts like '-Z' or '--set-utc', except +that it assumes that the context diff headers' timestamps use local time +instead of UTC. This option is not recommended, because patches using +local time cannot easily be used by people in other time zones, and +because local timestamps are ambiguous when local clocks move backwards +during daylight-saving time adjustments. If the context diff headers +specify a time zone, this option is equivalent to '--set-utc' ('-Z'). + + 'patch' normally refrains from setting a file's timestamps if the +file's original last-modified timestamp does not match the time given in +the diff header, of if the file's contents do not exactly match the +patch. However, if the '--force' ('-f') option is given, the file's +timestamps are set regardless. + + Due to the limitations of the current 'diff' format, 'patch' cannot +update the times of files whose contents have not changed. Also, if you +set file timestamps to values other than the current time of day, you +should also remove (e.g., with 'make clean') all files that depend on +the patched files, so that later invocations of 'make' do not get +confused by the patched files' times. + + +File: diffutils.info-t, Node: Multiple Patches, Next: patch Directories, Prev: Patching Timestamps, Up: Merging with patch + +10.6 Multiple Patches in a File +=============================== + +If the patch file contains more than one patch, and if you do not +specify an input file on the command line, 'patch' tries to apply each +patch as if they came from separate patch files. This means that it +determines the name of the file to patch for each patch, and that it +examines the leading text before each patch for file names and +prerequisite revision level (*note Making Patches::, for more on that +topic). + + 'patch' uses the following rules to intuit a file name from the +leading text before a patch. First, 'patch' takes an ordered list of +candidate file names as follows: + + * If the header is that of a context diff, 'patch' takes the old and + new file names in the header. A name is ignored if it does not + have enough slashes to satisfy the '-pNUM' or '--strip=NUM' option. + The name '/dev/null' is also ignored. + + * If there is an 'Index:' line in the leading garbage and if either + the old and new names are both absent or if 'patch' is conforming + to POSIX, 'patch' takes the name in the 'Index:' line. + + * For the purpose of the following rules, the candidate file names + are considered to be in the order (old, new, index), regardless of + the order that they appear in the header. + +Then 'patch' selects a file name from the candidate list as follows: + + * If some of the named files exist, 'patch' selects the first name if + conforming to POSIX, and the best name otherwise. + + * If 'patch' is not ignoring RCS, ClearCase, and SCCS (*note Revision + Control::), and no named files exist but an RCS, ClearCase, or SCCS + master is found, 'patch' selects the first named file with an RCS, + ClearCase, or SCCS master. + + * If no named files exist, no RCS, ClearCase, or SCCS master was + found, some names are given, 'patch' is not conforming to POSIX, + and the patch appears to create a file, 'patch' selects the best + name requiring the creation of the fewest directories. + + * If no file name results from the above heuristics, you are asked + for the name of the file to patch, and 'patch' selects that name. + + To determine the "best" of a nonempty list of file names, 'patch' +first takes all the names with the fewest path name components; of +those, it then takes all the names with the shortest basename; of those, +it then takes all the shortest names; finally, it takes the first +remaining name. + + *Note patch and POSIX::, to see whether 'patch' is conforming to +POSIX. + + +File: diffutils.info-t, Node: patch Directories, Next: Backups, Prev: Multiple Patches, Up: Merging with patch + +10.7 Applying Patches in Other Directories +========================================== + +The '--directory=DIRECTORY' ('-d DIRECTORY') option to 'patch' makes +directory DIRECTORY the current directory for interpreting both file +names in the patch file, and file names given as arguments to other +options (such as '-B' and '-o'). For example, while in a mail reading +program, you can patch a file in the '/usr/src/emacs' directory directly +from a message containing the patch like this: + + | patch -d /usr/src/emacs + + Sometimes the file names given in a patch contain leading +directories, but you keep your files in a directory different from the +one given in the patch. In those cases, you can use the +'--strip=NUMBER' ('-pNUMBER') option to set the file name strip count to +NUMBER. The strip count tells 'patch' how many slashes, along with the +directory names between them, to strip from the front of file names. A +sequence of one or more adjacent slashes is counted as a single slash. +By default, 'patch' strips off all leading directories, leaving just the +base file names. + + For example, suppose the file name in the patch file is +'/gnu/src/emacs/etc/NEWS'. Using '-p0' gives the entire file name +unmodified, '-p1' gives 'gnu/src/emacs/etc/NEWS' (no leading slash), +'-p4' gives 'etc/NEWS', and not specifying '-p' at all gives 'NEWS'. + + 'patch' looks for each file (after any slashes have been stripped) in +the current directory, or if you used the '-d DIRECTORY' option, in that +directory. + + +File: diffutils.info-t, Node: Backups, Next: Backup Names, Prev: patch Directories, Up: Merging with patch + +10.8 Backup Files +================= + +Normally, 'patch' creates a backup file if the patch does not exactly +match the original input file, because in that case the original data +might not be recovered if you undo the patch with 'patch -R' (*note +Reversed Patches::). However, when conforming to POSIX, 'patch' does +not create backup files by default. *Note patch and POSIX::. + + The '--backup' ('-b') option causes 'patch' to make a backup file +regardless of whether the patch matches the original input. The +'--backup-if-mismatch' option causes 'patch' to create backup files for +mismatches files; this is the default when not conforming to POSIX. The +'--no-backup-if-mismatch' option causes 'patch' to not create backup +files, even for mismatched patches; this is the default when conforming +to POSIX. + + When backing up a file that does not exist, an empty, unreadable +backup file is created as a placeholder to represent the nonexistent +file. + + +File: diffutils.info-t, Node: Backup Names, Next: Reject Names, Prev: Backups, Up: Merging with patch + +10.9 Backup File Names +====================== + +Normally, 'patch' renames an original input file into a backup file by +appending to its name the extension '.orig', or '~' if using '.orig' +would make the backup file name too long.(1) The '-z BACKUP-SUFFIX' or +'--suffix=BACKUP-SUFFIX' option causes 'patch' to use BACKUP-SUFFIX as +the backup extension instead. + + Alternately, you can specify the extension for backup files with the +'SIMPLE_BACKUP_SUFFIX' environment variable, which the options override. + + 'patch' can also create numbered backup files the way GNU Emacs does. +With this method, instead of having a single backup of each file, +'patch' makes a new backup file name each time it patches a file. For +example, the backups of a file named 'sink' would be called, +successively, 'sink.~1~', 'sink.~2~', 'sink.~3~', etc. + + The '-V BACKUP-STYLE' or '--version-control=BACKUP-STYLE' option +takes as an argument a method for creating backup file names. You can +alternately control the type of backups that 'patch' makes with the +'PATCH_VERSION_CONTROL' environment variable, which the '-V' option +overrides. If 'PATCH_VERSION_CONTROL' is not set, the 'VERSION_CONTROL' +environment variable is used instead. Please note that these options +and variables control backup file names; they do not affect the choice +of revision control system (*note Revision Control::). + + The values of these environment variables and the argument to the +'-V' option are like the GNU Emacs 'version-control' variable (*note +(emacs)Backup Names::, for more information on backup versions in +Emacs). They also recognize synonyms that are more descriptive. The +valid values are listed below; unique abbreviations are acceptable. + +'t' +'numbered' + Always make numbered backups. + +'nil' +'existing' + Make numbered backups of files that already have them, simple + backups of the others. This is the default. + +'never' +'simple' + Always make simple backups. + + You can also tell 'patch' to prepend a prefix, such as a directory +name, to produce backup file names. The '--prefix=PREFIX' ('-B PREFIX') +option makes backup files by prepending PREFIX to them. The +'--basename-prefix=PREFIX' ('-Y PREFIX') prepends PREFIX to the last +file name component of backup file names instead; for example, '-Y ~' +causes the backup name for 'dir/file.c' to be 'dir/~file.c'. If you use +either of these prefix options, the suffix-based options are ignored. + + If you specify the output file with the '-o' option, that file is the +one that is backed up, not the input file. + + Options that affect the names of backup files do not affect whether +backups are made. For example, if you specify the +'--no-backup-if-mismatch' option, none of the options described in this +section have any affect, because no backups are made. + + ---------- Footnotes ---------- + + (1) A coding error in GNU 'patch' version 2.5.4 causes it to always +use '~', but this should be fixed in the next release. + + +File: diffutils.info-t, Node: Reject Names, Next: patch Messages, Prev: Backup Names, Up: Merging with patch + +10.10 Reject File Names +======================= + +The names for reject files (files containing patches that 'patch' could +not find a place to apply) are normally the name of the output file with +'.rej' appended (or '#' if using '.rej' would make the backup file name +too long). + + Alternatively, you can tell 'patch' to place all of the rejected +patches in a single file. The '-r REJECT-FILE' or +'--reject-file=REJECT-FILE' option uses REJECT-FILE as the reject file +name. + + +File: diffutils.info-t, Node: patch Messages, Next: patch and POSIX, Prev: Reject Names, Up: Merging with patch + +10.11 Messages and Questions from 'patch' +========================================= + +'patch' can produce a variety of messages, especially if it has trouble +decoding its input. In a few situations where it's not sure how to +proceed, 'patch' normally prompts you for more information from the +keyboard. There are options to produce more or fewer messages, to have +it not ask for keyboard input, and to affect the way that file names are +quoted in messages. + +* Menu: + +* More or Fewer Messages:: Controlling the verbosity of 'patch'. +* patch and Keyboard Input:: Inhibiting keyboard input. +* patch Quoting Style:: Quoting file names in diagnostics. + + 'patch' exits with status 0 if all hunks are applied successfully, 1 +if some hunks cannot be applied, and 2 if there is more serious trouble. +When applying a set of patches in a loop, you should check the exit +status, so you don't apply a later patch to a partially patched file. + + +File: diffutils.info-t, Node: More or Fewer Messages, Next: patch and Keyboard Input, Up: patch Messages + +10.11.1 Controlling the Verbosity of 'patch' +-------------------------------------------- + +You can cause 'patch' to produce more messages by using the '--verbose' +option. For example, when you give this option, the message 'Hmm...' +indicates that 'patch' is reading text in the patch file, attempting to +determine whether there is a patch in that text, and if so, what kind of +patch it is. + + You can inhibit all terminal output from 'patch', unless an error +occurs, by using the '-s', '--quiet', or '--silent' option. + + +File: diffutils.info-t, Node: patch and Keyboard Input, Next: patch Quoting Style, Prev: More or Fewer Messages, Up: patch Messages + +10.11.2 Inhibiting Keyboard Input +--------------------------------- + +There are two ways you can prevent 'patch' from asking you any +questions. The '--force' ('-f') option assumes that you know what you +are doing. It causes 'patch' to do the following: + + * Skip patches that do not contain file names in their headers. + + * Patch files even though they have the wrong version for the + 'Prereq:' line in the patch; + + * Assume that patches are not reversed even if they look like they + are. + +The '--batch' ('-t') option is similar to '-f', in that it suppresses +questions, but it makes somewhat different assumptions: + + * Skip patches that do not contain file names in their headers (the + same as '-f'). + + * Skip patches for which the file has the wrong version for the + 'Prereq:' line in the patch; + + * Assume that patches are reversed if they look like they are. + + +File: diffutils.info-t, Node: patch Quoting Style, Prev: patch and Keyboard Input, Up: patch Messages + +10.11.3 'patch' Quoting Style +----------------------------- + +When 'patch' outputs a file name in a diagnostic message, it can format +the name in any of several ways. This can be useful to output file +names unambiguously, even if they contain punctuation or special +characters like newlines. The '--quoting-style=WORD' option controls +how names are output. The WORD should be one of the following: + +'literal' + Output names as-is. +'shell' + Quote names for the shell if they contain shell metacharacters or + would cause ambiguous output. +'shell-always' + Quote names for the shell, even if they would normally not require + quoting. +'c' + Quote names as for a C language string. +'escape' + Quote as with 'c' except omit the surrounding double-quote + characters. + + You can specify the default value of the '--quoting-style' option +with the environment variable 'QUOTING_STYLE'. If that environment +variable is not set, the default value is 'shell', but this default may +change in a future version of 'patch'. + + +File: diffutils.info-t, Node: patch and POSIX, Next: patch and Tradition, Prev: patch Messages, Up: Merging with patch + +10.12 'patch' and the POSIX Standard +==================================== + +If you specify the '--posix' option, or set the 'POSIXLY_CORRECT' +environment variable, 'patch' conforms more strictly to the POSIX +standard, as follows: + + * Take the first existing file from the list (old, new, index) when + intuiting file names from diff headers. *Note Multiple Patches::. + + * Do not remove files that are removed by a diff. *Note Creating and + Removing::. + + * Do not ask whether to get files from RCS, ClearCase, or SCCS. *Note + Revision Control::. + + * Require that all options precede the files in the command line. + + * Do not backup files, even when there is a mismatch. *Note + Backups::. + + +File: diffutils.info-t, Node: patch and Tradition, Prev: patch and POSIX, Up: Merging with patch + +10.13 GNU 'patch' and Traditional 'patch' +========================================= + +The current version of GNU 'patch' normally follows the POSIX standard. +*Note patch and POSIX::, for the few exceptions to this general rule. + + Unfortunately, POSIX redefined the behavior of 'patch' in several +important ways. You should be aware of the following differences if you +must interoperate with traditional 'patch', or with GNU 'patch' version +2.1 and earlier. + + * In traditional 'patch', the '-p' option's operand was optional, and + a bare '-p' was equivalent to '-p0'. The '-p' option now requires + an operand, and '-p 0' is now equivalent to '-p0'. For maximum + compatibility, use options like '-p0' and '-p1'. + + Also, traditional 'patch' simply counted slashes when stripping + path prefixes; 'patch' now counts pathname components. That is, a + sequence of one or more adjacent slashes now counts as a single + slash. For maximum portability, avoid sending patches containing + '//' in file names. + + * In traditional 'patch', backups were enabled by default. This + behavior is now enabled with the '--backup' ('-b') option. + + Conversely, in POSIX 'patch', backups are never made, even when + there is a mismatch. In GNU 'patch', this behavior is enabled with + the '--no-backup-if-mismatch' option, or by conforming to POSIX. + + The '-b SUFFIX' option of traditional 'patch' is equivalent to the + '-b -z SUFFIX' options of GNU 'patch'. + + * Traditional 'patch' used a complicated (and incompletely + documented) method to intuit the name of the file to be patched + from the patch header. This method did not conform to POSIX, and + had a few gotchas. Now 'patch' uses a different, equally + complicated (but better documented) method that is optionally + POSIX-conforming; we hope it has fewer gotchas. The two methods + are compatible if the file names in the context diff header and the + 'Index:' line are all identical after prefix-stripping. Your patch + is normally compatible if each header's file names all contain the + same number of slashes. + + * When traditional 'patch' asked the user a question, it sent the + question to standard error and looked for an answer from the first + file in the following list that was a terminal: standard error, + standard output, '/dev/tty', and standard input. Now 'patch' sends + questions to standard output and gets answers from '/dev/tty'. + Defaults for some answers have been changed so that 'patch' never + goes into an infinite loop when using default answers. + + * Traditional 'patch' exited with a status value that counted the + number of bad hunks, or with status 1 if there was real trouble. + Now 'patch' exits with status 1 if some hunks failed, or with 2 if + there was real trouble. + + * Limit yourself to the following options when sending instructions + meant to be executed by anyone running GNU 'patch', traditional + 'patch', or a 'patch' that conforms to POSIX. Spaces are + significant in the following list, and operands are required. + + -c + -d DIR + -D DEFINE + -e + -l + -n + -N + -o OUTFILE + -pNUM + -R + -r REJECTFILE + + +File: diffutils.info-t, Node: Making Patches, Next: Invoking cmp, Prev: Merging with patch, Up: Top + +11 Tips for Making and Using Patches +************************************ + +Use some common sense when making and using patches. For example, when +sending bug fixes to a program's maintainer, send several small patches, +one per independent subject, instead of one large, harder-to-digest +patch that covers all the subjects. + + Here are some other things you should keep in mind if you are going +to distribute patches for updating a software package. + +* Menu: + +* Tips for Patch Producers:: Advice for making patches. +* Tips for Patch Consumers:: Advice for using patches. +* Avoiding Common Mistakes:: Avoiding common mistakes when using 'patch'. +* Generating Smaller Patches:: How to generate smaller patches. + + +File: diffutils.info-t, Node: Tips for Patch Producers, Next: Tips for Patch Consumers, Up: Making Patches + +11.1 Tips for Patch Producers +============================= + +To create a patch that changes an older version of a package into a +newer version, first make a copy of the older and newer versions in +adjacent subdirectories. It is common to do that by unpacking 'tar' +archives of the two versions. + + To generate the patch, use the command 'diff -Naur OLD NEW' where OLD +and NEW identify the old and new directories. The names OLD and NEW +should not contain any slashes. The '-N' option lets the patch create +and remove files; '-a' lets the patch update non-text files; '-u' +generates useful timestamps and enough context; and '-r' lets the patch +update subdirectories. Here is an example command, using Bourne shell +syntax: + + diff -Naur gcc-3.0.3 gcc-3.0.4 + + Tell your recipients how to apply the patches. This should include +which working directory to use, and which 'patch' options to use; the +option '-p1' is recommended. Test your procedure by pretending to be a +recipient and applying your patches to a copy of the original files. + + *Note Avoiding Common Mistakes::, for how to avoid common mistakes +when generating a patch. + + +File: diffutils.info-t, Node: Tips for Patch Consumers, Next: Avoiding Common Mistakes, Prev: Tips for Patch Producers, Up: Making Patches + +11.2 Tips for Patch Consumers +============================= + +A patch producer should tell recipients how to apply the patches, so the +first rule of thumb for a patch consumer is to follow the instructions +supplied with the patch. + + GNU 'diff' can analyze files with arbitrarily long lines and files +that end in incomplete lines. However, older versions of 'patch' cannot +patch such files. If you are having trouble applying such patches, try +upgrading to a recent version of GNU 'patch'. + + +File: diffutils.info-t, Node: Avoiding Common Mistakes, Next: Generating Smaller Patches, Prev: Tips for Patch Consumers, Up: Making Patches + +11.3 Avoiding Common Mistakes +============================= + +When producing a patch for multiple files, apply 'diff' to directories +whose names do not have slashes. This reduces confusion when the patch +consumer specifies the '-pNUMBER' option, since this option can have +surprising results when the old and new file names have different +numbers of slashes. For example, do not send a patch with a header that +looks like this: + + diff -Naur v2.0.29/prog/README prog/README + --- v2.0.29/prog/README 2002-03-10 23:30:39.942229878 -0800 + +++ prog/README 2002-03-17 20:49:32.442260588 -0800 + +because the two file names have different numbers of slashes, and +different versions of 'patch' interpret the file names differently. To +avoid confusion, send output that looks like this instead: + + diff -Naur v2.0.29/prog/README v2.0.30/prog/README + --- v2.0.29/prog/README 2002-03-10 23:30:39.942229878 -0800 + +++ v2.0.30/prog/README 2002-03-17 20:49:32.442260588 -0800 + + Make sure you have specified the file names correctly, either in a +context diff header or with an 'Index:' line. Take care to not send out +reversed patches, since these make people wonder whether they have +already applied the patch. + + Avoid sending patches that compare backup file names like +'README.orig' or 'README~', since this might confuse 'patch' into +patching a backup file instead of the real file. Instead, send patches +that compare the same base file names in different directories, e.g. +'old/README' and 'new/README'. + + To save people from partially applying a patch before other patches +that should have gone before it, you can make the first patch in the +patch file update a file with a name like 'patchlevel.h' or 'version.c', +which contains a patch level or version number. If the input file +contains the wrong version number, 'patch' will complain immediately. + + An even clearer way to prevent this problem is to put a 'Prereq:' +line before the patch. If the leading text in the patch file contains a +line that starts with 'Prereq:', 'patch' takes the next word from that +line (normally a version number) and checks whether the next input file +contains that word, preceded and followed by either white space or a +newline. If not, 'patch' prompts you for confirmation before +proceeding. This makes it difficult to accidentally apply patches in +the wrong order. + + +File: diffutils.info-t, Node: Generating Smaller Patches, Prev: Avoiding Common Mistakes, Up: Making Patches + +11.4 Generating Smaller Patches +=============================== + +The simplest way to generate a patch is to use 'diff -Naur' (*note Tips +for Patch Producers::), but you might be able to reduce the size of the +patch by renaming or removing some files before making the patch. If +the older version of the package contains any files that the newer +version does not, or if any files have been renamed between the two +versions, make a list of 'rm' and 'mv' commands for the user to execute +in the old version directory before applying the patch. Then run those +commands yourself in the scratch directory. + + If there are any files that you don't need to include in the patch +because they can easily be rebuilt from other files (for example, 'TAGS' +and output from 'yacc' and 'makeinfo'), exclude them from the patch by +giving 'diff' the '-x PATTERN' option (*note Comparing Directories::). +If you want your patch to modify a derived file because your recipients +lack tools to build it, make sure that the patch for the derived file +follows any patches for files that it depends on, so that the +recipients' timestamps will not confuse 'make'. + + Now you can create the patch using 'diff -Naur'. Make sure to +specify the scratch directory first and the newer directory second. + + Add to the top of the patch a note telling the user any 'rm' and 'mv' +commands to run before applying the patch. Then you can remove the +scratch directory. + + You can also shrink the patch size by using fewer lines of context, +but bear in mind that 'patch' typically needs at least two lines for +proper operation when patches do not exactly match the input files. + + +File: diffutils.info-t, Node: Invoking cmp, Next: Invoking diff, Prev: Making Patches, Up: Top + +12 Invoking 'cmp' +***************** + +The 'cmp' command compares two files, and if they differ, tells the +first byte and line number where they differ or reports that one file is +a prefix of the other. Bytes and lines are numbered starting with 1. +The arguments of 'cmp' are as follows: + + cmp OPTIONS... FROM-FILE [TO-FILE [FROM-SKIP [TO-SKIP]]] + + The file name '-' is always the standard input. 'cmp' also uses the +standard input if one file name is omitted. The FROM-SKIP and TO-SKIP +operands specify how many bytes to ignore at the start of each file; +they are equivalent to the '--ignore-initial=FROM-SKIP:TO-SKIP' option. + + By default, 'cmp' outputs nothing if the two files have the same +contents. If the two files have bytes that differ, 'cmp' reports the +location of the first difference to standard output: + + FROM-FILE TO-FILE differ: char BYTE-NUMBER, line LINE-NUMBER + +If one file is a prefix of the other, 'cmp' reports the shorter file's +name to standard error, followed by a blank and extra information about +the shorter file: + + cmp: EOF on SHORTER-FILE EXTRA-INFO + + The message formats can differ outside the POSIX locale. POSIX +allows but does not require the EOF diagnostic's file name to be +followed by a blank and additional information. + + An exit status of 0 means no differences were found, 1 means some +differences were found, and 2 means trouble. + +* Menu: + +* cmp Options:: Summary of options to 'cmp'. + + +File: diffutils.info-t, Node: cmp Options, Up: Invoking cmp + +12.1 Options to 'cmp' +===================== + +Below is a summary of all of the options that GNU 'cmp' accepts. Most +options have two equivalent names, one of which is a single letter +preceded by '-', and the other of which is a long name preceded by '--'. +Multiple single letter options (unless they take an argument) can be +combined into a single command line word: '-bl' is equivalent to '-b +-l'. + +'-b' +'--print-bytes' + Print the differing bytes. Display control bytes as a '^' followed + by a letter of the alphabet and precede bytes that have the high + bit set with 'M-' (which stands for "meta"). + +'--help' + Output a summary of usage and then exit. + +'-i SKIP' +'--ignore-initial=SKIP' + Ignore any differences in the first SKIP bytes of the input files. + Treat files with fewer than SKIP bytes as if they are empty. If + SKIP is of the form 'FROM-SKIP:TO-SKIP', skip the first FROM-SKIP + bytes of the first input file and the first TO-SKIP bytes of the + second. + +'-l' +'--verbose' + Output the (decimal) byte numbers and (octal) values of all + differing bytes, instead of the default standard output. Each + output line contains a differing byte's number relative to the + start of the input, followed by the differing byte values. Byte + numbers start at 1. Also, output the EOF message if one file is + shorter than the other. + +'-n COUNT' +'--bytes=COUNT' + Compare at most COUNT input bytes. + +'-s' +'--quiet' +'--silent' + Do not print anything; only return an exit status indicating + whether the files differ. + +'-v' +'--version' + Output version information and then exit. + + In the above table, operands that are byte counts are normally +decimal, but may be preceded by '0' for octal and '0x' for hexadecimal. + + A byte count can be followed by a suffix to specify a multiple of +that count; in this case an omitted integer is understood to be 1. A +bare size letter, or one followed by 'iB', specifies a multiple using +powers of 1024. A size letter followed by 'B' specifies powers of 1000 +instead. For example, '-n 4M' and '-n 4MiB' are equivalent to '-n +4194304', whereas '-n 4MB' is equivalent to '-n 4000000'. This notation +is upward compatible with the SI prefixes +(http://www.bipm.fr/enus/3_SI/si-prefixes.html) for decimal multiples +and with the IEC 60027-2 prefixes for binary multiples +(http://physics.nist.gov/cuu/Units/binary.html). + + The following suffixes are defined. Large sizes like '1Y' may be +rejected by your computer due to limitations of its arithmetic. + +'kB' + kilobyte: 10^3 = 1000. +'k' +'K' +'KiB' + kibibyte: 2^10 = 1024. 'K' is special: the SI prefix is 'k' and + the IEC 60027-2 prefix is 'Ki', but tradition and POSIX use 'k' to + mean 'KiB'. +'MB' + megabyte: 10^6 = 1,000,000. +'M' +'MiB' + mebibyte: 2^20 = 1,048,576. +'GB' + gigabyte: 10^9 = 1,000,000,000. +'G' +'GiB' + gibibyte: 2^30 = 1,073,741,824. +'TB' + terabyte: 10^12 = 1,000,000,000,000. +'T' +'TiB' + tebibyte: 2^40 = 1,099,511,627,776. +'PB' + petabyte: 10^15 = 1,000,000,000,000,000. +'P' +'PiB' + pebibyte: 2^50 = 1,125,899,906,842,624. +'EB' + exabyte: 10^18 = 1,000,000,000,000,000,000. +'E' +'EiB' + exbibyte: 2^60 = 1,152,921,504,606,846,976. +'ZB' + zettabyte: 10^21 = 1,000,000,000,000,000,000,000 +'Z' +'ZiB' + 2^70 = 1,180,591,620,717,411,303,424. ('Zi' is a GNU extension to + IEC 60027-2.) +'YB' + yottabyte: 10^24 = 1,000,000,000,000,000,000,000,000. +'Y' +'YiB' + 2^80 = 1,208,925,819,614,629,174,706,176. ('Yi' is a GNU extension + to IEC 60027-2.) + + +File: diffutils.info-t, Node: Invoking diff, Next: Invoking diff3, Prev: Invoking cmp, Up: Top + +13 Invoking 'diff' +****************** + +The format for running the 'diff' command is: + + diff OPTIONS... FILES... + + In the simplest case, two file names FROM-FILE and TO-FILE are given, +and 'diff' compares the contents of FROM-FILE and TO-FILE. A file name +of '-' stands for the standard input. + + If one file is a directory and the other is not, 'diff' compares the +file in the directory whose name is that of the non-directory. The +non-directory file must not be '-'. + + If two file names are given and both are directories, 'diff' compares +corresponding files in both directories, in alphabetical order; this +comparison is not recursive unless the '--recursive' ('-r') option is +given. 'diff' never compares the actual contents of a directory as if +it were a file. The file that is fully specified may not be standard +input, because standard input is nameless and the notion of "file with +the same name" does not apply. + + If the '--from-file=FILE' option is given, the number of file names +is arbitrary, and FILE is compared to each named file. Similarly, if +the '--to-file=FILE' option is given, each named file is compared to +FILE. + + 'diff' options begin with '-', so normally file names may not begin +with '-'. However, '--' as an argument by itself treats the remaining +arguments as file names even if they begin with '-'. + + An exit status of 0 means no differences were found, 1 means some +differences were found, and 2 means trouble. + +* Menu: + +* diff Options:: Summary of options to 'diff'. + + +File: diffutils.info-t, Node: diff Options, Up: Invoking diff + +13.1 Options to 'diff' +====================== + +Below is a summary of all of the options that GNU 'diff' accepts. Most +options have two equivalent names, one of which is a single letter +preceded by '-', and the other of which is a long name preceded by '--'. +Multiple single letter options (unless they take an argument) can be +combined into a single command line word: '-ac' is equivalent to '-a +-c'. Long named options can be abbreviated to any unique prefix of +their name. Brackets ([ and ]) indicate that an option takes an +optional argument. + +'-a' +'--text' + Treat all files as text and compare them line-by-line, even if they + do not seem to be text. *Note Binary::. + +'-b' +'--ignore-space-change' + Ignore changes in amount of white space. *Note White Space::. + +'-B' +'--ignore-blank-lines' + Ignore changes that just insert or delete blank lines. *Note Blank + Lines::. + +'--binary' + Read and write data in binary mode. *Note Binary::. + +'-c' + Use the context output format, showing three lines of context. + *Note Context Format::. + +'--color [=WHEN]' + Specify whether to use color for distinguishing different contexts, + like header, added or removed lines. WHEN may be omitted, or one + of: + * none Do not use color at all. This is the default when no + -color option is specified. + * auto Use color only if standard output is a terminal. + * always Always use color. + Specifying '--color' and no WHEN is equivalent to '--color=auto'. + +'-C LINES' +'--context[=LINES]' + Use the context output format, showing LINES (an integer) lines of + context, or three if LINES is not given. *Note Context Format::. + For proper operation, 'patch' typically needs at least two lines of + context. + + For compatibility 'diff' also supports an obsolete option syntax + '-LINES' that has effect when combined with '-c', '-p', or '-u'. + New scripts should use '-U LINES' ('-C LINES') instead. + +'--changed-group-format=FORMAT' + Use FORMAT to output a line group containing differing lines from + both files in if-then-else format. *Note Line Group Formats::. + +'-d' +'--minimal' + Change the algorithm perhaps find a smaller set of changes. This + makes 'diff' slower (sometimes much slower). *Note diff + Performance::. + +'-D NAME' +'--ifdef=NAME' + Make merged '#ifdef' format output, conditional on the preprocessor + macro NAME. *Note If-then-else::. + +'-e' +'--ed' + Make output that is a valid 'ed' script. *Note ed Scripts::. + +'-E' +'--ignore-tab-expansion' + Ignore changes due to tab expansion. *Note White Space::. + +'-f' +'--forward-ed' + Make output that looks vaguely like an 'ed' script but has changes + in the order they appear in the file. *Note Forward ed::. + +'-F REGEXP' +'--show-function-line=REGEXP' + In context and unified format, for each hunk of differences, show + some of the last preceding line that matches REGEXP. *Note + Specified Headings::. + +'--from-file=FILE' + Compare FILE to each operand; FILE may be a directory. + +'--help' + Output a summary of usage and then exit. + +'--horizon-lines=LINES' + Do not discard the last LINES lines of the common prefix and the + first LINES lines of the common suffix. *Note diff Performance::. + +'-i' +'--ignore-case' + Ignore changes in case; consider upper- and lower-case letters + equivalent. *Note Case Folding::. + +'-I REGEXP' +'--ignore-matching-lines=REGEXP' + Ignore changes that just insert or delete lines that match REGEXP. + *Note Specified Lines::. + +'--ignore-file-name-case' + Ignore case when comparing file names. For example, recursive + comparison of 'd' to 'e' might compare the contents of 'd/Init' and + 'e/inIt'. At the top level, 'diff d inIt' might compare the + contents of 'd/Init' and 'inIt'. *Note Comparing Directories::. + +'-l' +'--paginate' + Pass the output through 'pr' to paginate it. *Note Pagination::. + +'-L LABEL' +'--label=LABEL' + Use LABEL instead of the file name in the context format (*note + Context Format::) and unified format (*note Unified Format::) + headers. *Note RCS::. + +'--left-column' + Print only the left column of two common lines in side by side + format. *Note Side by Side Format::. + +'--line-format=FORMAT' + Use FORMAT to output all input lines in if-then-else format. *Note + Line Formats::. + +'-n' +'--rcs' + Output RCS-format diffs; like '-f' except that each command + specifies the number of lines affected. *Note RCS::. + +'-N' +'--new-file' + If one file is missing, treat it as present but empty. *Note + Comparing Directories::. + +'--new-group-format=FORMAT' + Use FORMAT to output a group of lines taken from just the second + file in if-then-else format. *Note Line Group Formats::. + +'--new-line-format=FORMAT' + Use FORMAT to output a line taken from just the second file in + if-then-else format. *Note Line Formats::. + +'--no-dereference' + Act on symbolic links themselves instead of what they point to. + Two symbolic links are deemed equal only when each points to + precisely the same name. + +'--old-group-format=FORMAT' + Use FORMAT to output a group of lines taken from just the first + file in if-then-else format. *Note Line Group Formats::. + +'--old-line-format=FORMAT' + Use FORMAT to output a line taken from just the first file in + if-then-else format. *Note Line Formats::. + +'-p' +'--show-c-function' + Show which C function each change is in. *Note C Function + Headings::. + +'--palette=PALETTE' + Specify what color palette to use when colored output is enabled. + It defaults to 'rs=0:hd=1:ad=32:de=31:ln=36' for red deleted lines, + green added lines, cyan line numbers, bold header. + + Supported capabilities are as follows. + + 'ad=32' + + SGR substring for added lines. The default is green + foreground. + + 'de=31' + + SGR substring for deleted lines. The default is red + foreground. + + 'hd=1' + + SGR substring for chunk header. The default is bold + foreground. + + 'ln=36' + + SGR substring for line numbers. The default is cyan + foreground. + +'-q' +'--brief' + Report only whether the files differ, not the details of the + differences. *Note Brief::. + +'-r' +'--recursive' + When comparing directories, recursively compare any subdirectories + found. *Note Comparing Directories::. + +'-s' +'--report-identical-files' + Report when two files are the same. *Note Comparing Directories::. + +'-S FILE' +'--starting-file=FILE' + When comparing directories, start with the file FILE. This is used + for resuming an aborted comparison. *Note Comparing Directories::. + +'--speed-large-files' + Use heuristics to speed handling of large files that have numerous + scattered small changes. *Note diff Performance::. + +'--strip-trailing-cr' + Strip any trailing carriage return at the end of an input line. + *Note Binary::. + +'--suppress-common-lines' + Do not print common lines in side by side format. *Note Side by + Side Format::. + +'-t' +'--expand-tabs' + Expand tabs to spaces in the output, to preserve the alignment of + tabs in the input files. *Note Tabs::. + +'-T' +'--initial-tab' + Output a tab rather than a space before the text of a line in + normal or context format. This causes the alignment of tabs in the + line to look normal. *Note Tabs::. + +'--tabsize=COLUMNS' + Assume that tab stops are set every COLUMNS (default 8) print + columns. *Note Tabs::. + +'--suppress-blank-empty' + Suppress any blanks before newlines when printing the + representation of an empty line, when outputting normal, context, + or unified format. *Note Trailing Blanks::. + +'--to-file=FILE' + Compare each operand to FILE; FILE may be a directory. + +'-u' + Use the unified output format, showing three lines of context. + *Note Unified Format::. + +'--unchanged-group-format=FORMAT' + Use FORMAT to output a group of common lines taken from both files + in if-then-else format. *Note Line Group Formats::. + +'--unchanged-line-format=FORMAT' + Use FORMAT to output a line common to both files in if-then-else + format. *Note Line Formats::. + +'--unidirectional-new-file' + If a first file is missing, treat it as present but empty. *Note + Comparing Directories::. + +'-U LINES' +'--unified[=LINES]' + Use the unified output format, showing LINES (an integer) lines of + context, or three if LINES is not given. *Note Unified Format::. + For proper operation, 'patch' typically needs at least two lines of + context. + + On older systems, 'diff' supports an obsolete option '-LINES' that + has effect when combined with '-u'. POSIX 1003.1-2001 (*note + Standards conformance::) does not allow this; use '-U LINES' + instead. + +'-v' +'--version' + Output version information and then exit. + +'-w' +'--ignore-all-space' + Ignore white space when comparing lines. *Note White Space::. + +'-W COLUMNS' +'--width=COLUMNS' + Output at most COLUMNS (default 130) print columns per line in side + by side format. *Note Side by Side Format::. + +'-x PATTERN' +'--exclude=PATTERN' + When comparing directories, ignore files and subdirectories whose + basenames match PATTERN. *Note Comparing Directories::. + +'-X FILE' +'--exclude-from=FILE' + When comparing directories, ignore files and subdirectories whose + basenames match any pattern contained in FILE. *Note Comparing + Directories::. + +'-y' +'--side-by-side' + Use the side by side output format. *Note Side by Side Format::. + +'-Z' +'--ignore-trailing-space' + Ignore white space at line end. *Note White Space::. + + +File: diffutils.info-t, Node: Invoking diff3, Next: Invoking patch, Prev: Invoking diff, Up: Top + +14 Invoking 'diff3' +******************* + +The 'diff3' command compares three files and outputs descriptions of +their differences. Its arguments are as follows: + + diff3 OPTIONS... MINE OLDER YOURS + + The files to compare are MINE, OLDER, and YOURS. At most one of +these three file names may be '-', which tells 'diff3' to read the +standard input for that file. + + An exit status of 0 means 'diff3' was successful, 1 means some +conflicts were found, and 2 means trouble. + +* Menu: + +* diff3 Options:: Summary of options to 'diff3'. + + +File: diffutils.info-t, Node: diff3 Options, Up: Invoking diff3 + +14.1 Options to 'diff3' +======================= + +Below is a summary of all of the options that GNU 'diff3' accepts. +Multiple single letter options (unless they take an argument) can be +combined into a single command line argument. + +'-a' +'--text' + Treat all files as text and compare them line-by-line, even if they + do not appear to be text. *Note Binary::. + +'-A' +'--show-all' + Incorporate all unmerged changes from OLDER to YOURS into MINE, + surrounding conflicts with bracket lines. *Note Marking + Conflicts::. + +'--diff-program=PROGRAM' + Use the compatible comparison program PROGRAM to compare files + instead of 'diff'. + +'-e' +'--ed' + Generate an 'ed' script that incorporates all the changes from + OLDER to YOURS into MINE. *Note Which Changes::. + +'-E' +'--show-overlap' + Like '-e', except bracket lines from overlapping changes' first and + third files. *Note Marking Conflicts::. With '-E', an overlapping + change looks like this: + + <<<<<<< MINE + lines from MINE + ======= + lines from YOURS + >>>>>>> YOURS + +'--help' + Output a summary of usage and then exit. + +'-i' + Generate 'w' and 'q' commands at the end of the 'ed' script for + System V compatibility. This option must be combined with one of + the '-AeExX3' options, and may not be combined with '-m'. *Note + Saving the Changed File::. + +'--label=LABEL' + Use the label LABEL for the brackets output by the '-A', '-E' and + '-X' options. This option may be given up to three times, one for + each input file. The default labels are the names of the input + files. Thus 'diff3 --label X --label Y --label Z -m A B C' acts + like 'diff3 -m A B C', except that the output looks like it came + from files named 'X', 'Y' and 'Z' rather than from files named 'A', + 'B' and 'C'. *Note Marking Conflicts::. + +'-m' +'--merge' + Apply the edit script to the first file and send the result to + standard output. Unlike piping the output from 'diff3' to 'ed', + this works even for binary files and incomplete lines. '-A' is + assumed if no edit script option is specified. *Note Bypassing + ed::. + +'--strip-trailing-cr' + Strip any trailing carriage return at the end of an input line. + *Note Binary::. + +'-T' +'--initial-tab' + Output a tab rather than two spaces before the text of a line in + normal format. This causes the alignment of tabs in the line to + look normal. *Note Tabs::. + +'-v' +'--version' + Output version information and then exit. + +'-x' +'--overlap-only' + Like '-e', except output only the overlapping changes. *Note Which + Changes::. + +'-X' + Like '-E', except output only the overlapping changes. In other + words, like '-x', except bracket changes as in '-E'. *Note Marking + Conflicts::. + +'-3' +'--easy-only' + Like '-e', except output only the nonoverlapping changes. *Note + Which Changes::. + + +File: diffutils.info-t, Node: Invoking patch, Next: Invoking sdiff, Prev: Invoking diff3, Up: Top + +15 Invoking 'patch' +******************* + +Normally 'patch' is invoked like this: + + patch <PATCHFILE + + The full format for invoking 'patch' is: + + patch OPTIONS... [ORIGFILE [PATCHFILE]] + + You can also specify where to read the patch from with the '-i +PATCHFILE' or '--input=PATCHFILE' option. If you do not specify +PATCHFILE, or if PATCHFILE is '-', 'patch' reads the patch (that is, the +'diff' output) from the standard input. + + If you do not specify an input file on the command line, 'patch' +tries to intuit from the "leading text" (any text in the patch that +comes before the 'diff' output) which file to edit. *Note Multiple +Patches::. + + By default, 'patch' replaces the original input file with the patched +version, possibly after renaming the original file into a backup file +(*note Backup Names::, for a description of how 'patch' names backup +files). You can also specify where to put the output with the '-o FILE' +or '--output=FILE' option; however, do not use this option if FILE is +one of the input files. + +* Menu: + +* patch Options:: Summary table of options to 'patch'. + + +File: diffutils.info-t, Node: patch Options, Up: Invoking patch + +15.1 Options to 'patch' +======================= + +Here is a summary of all of the options that GNU 'patch' accepts. *Note +patch and Tradition::, for which of these options are safe to use in +older versions of 'patch'. + + Multiple single-letter options that do not take an argument can be +combined into a single command line argument with only one dash. + +'-b' +'--backup' + Back up the original contents of each file, even if backups would + normally not be made. *Note Backups::. + +'-B PREFIX' +'--prefix=PREFIX' + Prepend PREFIX to backup file names. *Note Backup Names::. + +'--backup-if-mismatch' + Back up the original contents of each file if the patch does not + exactly match the file. This is the default behavior when not + conforming to POSIX. *Note Backups::. + +'--binary' + Read and write all files in binary mode, except for standard output + and '/dev/tty'. This option has no effect on POSIX-conforming + systems like GNU/Linux. On systems where this option makes a + difference, the patch should be generated by 'diff -a --binary'. + *Note Binary::. + +'-c' +'--context' + Interpret the patch file as a context diff. *Note patch Input::. + +'-d DIRECTORY' +'--directory=DIRECTORY' + Make directory DIRECTORY the current directory for interpreting + both file names in the patch file, and file names given as + arguments to other options. *Note patch Directories::. + +'-D NAME' +'--ifdef=NAME' + Make merged if-then-else output using NAME. *Note If-then-else::. + +'--dry-run' + Print the results of applying the patches without actually changing + any files. *Note Dry Runs::. + +'-e' +'--ed' + Interpret the patch file as an 'ed' script. *Note patch Input::. + +'-E' +'--remove-empty-files' + Remove output files that are empty after the patches have been + applied. *Note Creating and Removing::. + +'-f' +'--force' + Assume that the user knows exactly what he or she is doing, and do + not ask any questions. *Note patch Messages::. + +'-F LINES' +'--fuzz=LINES' + Set the maximum fuzz factor to LINES. *Note Inexact::. + +'-g NUM' +'--get=NUM' + If NUM is positive, get input files from a revision control system + as necessary; if zero, do not get the files; if negative, ask the + user whether to get the files. *Note Revision Control::. + +'--help' + Output a summary of usage and then exit. + +'-i PATCHFILE' +'--input=PATCHFILE' + Read the patch from PATCHFILE rather than from standard input. + *Note patch Options::. + +'-l' +'--ignore-white-space' + Let any sequence of blanks (spaces or tabs) in the patch file match + any sequence of blanks in the input file. *Note Changed White + Space::. + +'-n' +'--normal' + Interpret the patch file as a normal diff. *Note patch Input::. + +'-N' +'--forward' + Ignore patches that 'patch' thinks are reversed or already applied. + See also '-R'. *Note Reversed Patches::. + +'--no-backup-if-mismatch' + Do not back up the original contents of files. This is the default + behavior when conforming to POSIX. *Note Backups::. + +'-o FILE' +'--output=FILE' + Use FILE as the output file name. *Note patch Options::. + +'-pNUMBER' +'--strip=NUMBER' + Set the file name strip count to NUMBER. *Note patch + Directories::. + +'--posix' + Conform to POSIX, as if the 'POSIXLY_CORRECT' environment variable + had been set. *Note patch and POSIX::. + +'--quoting-style=WORD' + Use style WORD to quote names in diagnostics, as if the + 'QUOTING_STYLE' environment variable had been set to WORD. *Note + patch Quoting Style::. + +'-r REJECT-FILE' +'--reject-file=REJECT-FILE' + Use REJECT-FILE as the reject file name. *Note Reject Names::. + +'-R' +'--reverse' + Assume that this patch was created with the old and new files + swapped. *Note Reversed Patches::. + +'-s' +'--quiet' +'--silent' + Work silently unless an error occurs. *Note patch Messages::. + +'-t' +'--batch' + Do not ask any questions. *Note patch Messages::. + +'-T' +'--set-time' + Set the modification and access times of patched files from + timestamps given in context diff headers, assuming that the context + diff headers use local time. *Note Patching Timestamps::. + +'-u' +'--unified' + Interpret the patch file as a unified diff. *Note patch Input::. + +'-v' +'--version' + Output version information and then exit. + +'-V BACKUP-STYLE' +'--version=control=BACKUP-STYLE' + Select the naming convention for backup file names. *Note Backup + Names::. + +'--verbose' + Print more diagnostics than usual. *Note patch Messages::. + +'-x NUMBER' +'--debug=NUMBER' + Set internal debugging flags. Of interest only to 'patch' + patchers. + +'-Y PREFIX' +'--basename-prefix=PREFIX' + Prepend PREFIX to base names of backup files. *Note Backup + Names::. + +'-z SUFFIX' +'--suffix=SUFFIX' + Use SUFFIX as the backup extension instead of '.orig' or '~'. + *Note Backup Names::. + +'-Z' +'--set-utc' + Set the modification and access times of patched files from + timestamps given in context diff headers, assuming that the context + diff headers use UTC. *Note Patching Timestamps::. + + +File: diffutils.info-t, Node: Invoking sdiff, Next: Standards conformance, Prev: Invoking patch, Up: Top + +16 Invoking 'sdiff' +******************* + +The 'sdiff' command merges two files and interactively outputs the +results. Its arguments are as follows: + + sdiff -o OUTFILE OPTIONS... FROM-FILE TO-FILE + + This merges FROM-FILE with TO-FILE, with output to OUTFILE. If +FROM-FILE is a directory and TO-FILE is not, 'sdiff' compares the file +in FROM-FILE whose file name is that of TO-FILE, and vice versa. +FROM-FILE and TO-FILE may not both be directories. + + 'sdiff' options begin with '-', so normally FROM-FILE and TO-FILE may +not begin with '-'. However, '--' as an argument by itself treats the +remaining arguments as file names even if they begin with '-'. You may +not use '-' as an input file. + + 'sdiff' without '--output' ('-o') produces a side-by-side difference. +This usage is obsolete; use the '--side-by-side' ('-y') option of 'diff' +instead. + + An exit status of 0 means no differences were found, 1 means some +differences were found, and 2 means trouble. + +* Menu: + +* sdiff Options:: Summary of options to 'diff'. + + +File: diffutils.info-t, Node: sdiff Options, Up: Invoking sdiff + +16.1 Options to 'sdiff' +======================= + +Below is a summary of all of the options that GNU 'sdiff' accepts. Each +option has two equivalent names, one of which is a single letter +preceded by '-', and the other of which is a long name preceded by '--'. +Multiple single letter options (unless they take an argument) can be +combined into a single command line argument. Long named options can be +abbreviated to any unique prefix of their name. + +'-a' +'--text' + Treat all files as text and compare them line-by-line, even if they + do not appear to be text. *Note Binary::. + +'-b' +'--ignore-space-change' + Ignore changes in amount of white space. *Note White Space::. + +'-B' +'--ignore-blank-lines' + Ignore changes that just insert or delete blank lines. *Note Blank + Lines::. + +'-d' +'--minimal' + Change the algorithm to perhaps find a smaller set of changes. + This makes 'sdiff' slower (sometimes much slower). *Note diff + Performance::. + +'--diff-program=PROGRAM' + Use the compatible comparison program PROGRAM to compare files + instead of 'diff'. + +'-E' +'--ignore-tab-expansion' + Ignore changes due to tab expansion. *Note White Space::. + +'--help' + Output a summary of usage and then exit. + +'-i' +'--ignore-case' + Ignore changes in case; consider upper- and lower-case to be the + same. *Note Case Folding::. + +'-I REGEXP' +'--ignore-matching-lines=REGEXP' + Ignore changes that just insert or delete lines that match REGEXP. + *Note Specified Lines::. + +'-l' +'--left-column' + Print only the left column of two common lines. *Note Side by Side + Format::. + +'-o FILE' +'--output=FILE' + Put merged output into FILE. This option is required for merging. + +'-s' +'--suppress-common-lines' + Do not print common lines. *Note Side by Side Format::. + +'--speed-large-files' + Use heuristics to speed handling of large files that have numerous + scattered small changes. *Note diff Performance::. + +'--strip-trailing-cr' + Strip any trailing carriage return at the end of an input line. + *Note Binary::. + +'-t' +'--expand-tabs' + Expand tabs to spaces in the output, to preserve the alignment of + tabs in the input files. *Note Tabs::. + +'--tabsize=COLUMNS' + Assume that tab stops are set every COLUMNS (default 8) print + columns. *Note Tabs::. + +'-v' +'--version' + Output version information and then exit. + +'-w COLUMNS' +'--width=COLUMNS' + Output at most COLUMNS (default 130) print columns per line. *Note + Side by Side Format::. Note that for historical reasons, this + option is '-W' in 'diff', '-w' in 'sdiff'. + +'-W' +'--ignore-all-space' + Ignore white space when comparing lines. *Note White Space::. + Note that for historical reasons, this option is '-w' in 'diff', + '-W' in 'sdiff'. + +'-Z' +'--ignore-trailing-space' + Ignore white space at line end. *Note White Space::. + + +File: diffutils.info-t, Node: Standards conformance, Next: Projects, Prev: Invoking sdiff, Up: Top + +17 Standards conformance +************************ + +In a few cases, the GNU utilities' default behavior is incompatible with +the POSIX standard. To suppress these incompatibilities, define the +'POSIXLY_CORRECT' environment variable. Unless you are checking for +POSIX conformance, you probably do not need to define 'POSIXLY_CORRECT'. + + Normally options and operands can appear in any order, and programs +act as if all the options appear before any operands. For example, +'diff lao tzu -C 2' acts like 'diff -C 2 lao tzu', since '2' is an +option-argument of '-C'. However, if the 'POSIXLY_CORRECT' environment +variable is set, options must appear before operands, unless otherwise +specified for a particular command. + + Newer versions of POSIX are occasionally incompatible with older +versions. For example, older versions of POSIX allowed the command +'diff -c -10' to have the same meaning as 'diff -C 10', but POSIX +1003.1-2001 'diff' no longer allows digit-string options like '-10'. + + The GNU utilities normally conform to the version of POSIX that is +standard for your system. To cause them to conform to a different +version of POSIX, define the '_POSIX2_VERSION' environment variable to a +value of the form YYYYMM specifying the year and month the standard was +adopted. Two values are currently supported for '_POSIX2_VERSION': +'199209' stands for POSIX 1003.2-1992, and '200112' stands for POSIX +1003.1-2001. For example, if you are running older software that +assumes an older version of POSIX and uses 'diff -c -10', you can work +around the compatibility problems by setting '_POSIX2_VERSION=199209' in +your environment. + + +File: diffutils.info-t, Node: Projects, Next: Copying This Manual, Prev: Standards conformance, Up: Top + +18 Future Projects +****************** + +Here are some ideas for improving GNU 'diff' and 'patch'. The GNU +project has identified some improvements as potential programming +projects for volunteers. You can also help by reporting any bugs that +you find. + + If you are a programmer and would like to contribute something to the +GNU project, please consider volunteering for one of these projects. If +you are seriously contemplating work, please write to <gvc@gnu.org> to +coordinate with other volunteers. + +* Menu: + +* Shortcomings:: Suggested projects for improvements. +* Bugs:: Reporting bugs. + + +File: diffutils.info-t, Node: Shortcomings, Next: Bugs, Up: Projects + +18.1 Suggested Projects for Improving GNU 'diff' and 'patch' +============================================================ + +One should be able to use GNU 'diff' to generate a patch from any pair +of directory trees, and given the patch and a copy of one such tree, use +'patch' to generate a faithful copy of the other. Unfortunately, some +changes to directory trees cannot be expressed using current patch +formats; also, 'patch' does not handle some of the existing formats. +These shortcomings motivate the following suggested projects. + +* Menu: + +* Internationalization:: Handling multibyte and varying-width characters. +* Changing Structure:: Handling changes to the directory structure. +* Special Files:: Handling symbolic links, device special files, etc. +* Unusual File Names:: Handling file names that contain unusual characters. +* Timestamp Order:: Outputting diffs in timestamp order. +* Ignoring Changes:: Ignoring certain changes while showing others. +* Speedups:: Improving performance. + + +File: diffutils.info-t, Node: Internationalization, Next: Changing Structure, Up: Shortcomings + +18.1.1 Handling Multibyte and Varying-Width Characters +------------------------------------------------------ + +'diff', 'diff3' and 'sdiff' treat each line of input as a string of +unibyte characters. This can mishandle multibyte characters in some +cases. For example, when asked to ignore spaces, 'diff' does not +properly ignore a multibyte space character. + + Also, 'diff' currently assumes that each byte is one column wide, and +this assumption is incorrect in some locales, e.g., locales that use +UTF-8 encoding. This causes problems with the '-y' or '--side-by-side' +option of 'diff'. + + These problems need to be fixed without unduly affecting the +performance of the utilities in unibyte environments. + + The IBM GNU/Linux Technology Center Internationalization Team has +proposed patches to support internationalized 'diff' +(http://oss.software.ibm.com/developer/opensource/linux/patches/i18n/diffutils-2.7.2-i18n-0.1.patch.gz). +Unfortunately, these patches are incomplete and are to an older version +of 'diff', so more work needs to be done in this area. + + +File: diffutils.info-t, Node: Changing Structure, Next: Special Files, Prev: Internationalization, Up: Shortcomings + +18.1.2 Handling Changes to the Directory Structure +-------------------------------------------------- + +'diff' and 'patch' do not handle some changes to directory structure. +For example, suppose one directory tree contains a directory named 'D' +with some subsidiary files, and another contains a file with the same +name 'D'. 'diff -r' does not output enough information for 'patch' to +transform the directory subtree into the file. + + There should be a way to specify that a file has been removed without +having to include its entire contents in the patch file. There should +also be a way to tell 'patch' that a file was renamed, even if there is +no way for 'diff' to generate such information. There should be a way +to tell 'patch' that a file's timestamp has changed, even if its +contents have not changed. + + These problems can be fixed by extending the 'diff' output format to +represent changes in directory structure, and extending 'patch' to +understand these extensions. + + +File: diffutils.info-t, Node: Special Files, Next: Unusual File Names, Prev: Changing Structure, Up: Shortcomings + +18.1.3 Files that are Neither Directories Nor Regular Files +----------------------------------------------------------- + +Some files are neither directories nor regular files: they are unusual +files like symbolic links, device special files, named pipes, and +sockets. Currently, 'diff' treats symbolic links as if they were the +pointed-to files, except that a recursive 'diff' reports an error if it +detects infinite loops of symbolic links (e.g., symbolic links to '..'). +'diff' treats other special files like regular files if they are +specified at the top level, but simply reports their presence when +comparing directories. This means that 'patch' cannot represent changes +to such files. For example, if you change which file a symbolic link +points to, 'diff' outputs the difference between the two files, instead +of the change to the symbolic link. + + 'diff' should optionally report changes to special files specially, +and 'patch' should be extended to understand these extensions. + + +File: diffutils.info-t, Node: Unusual File Names, Next: Timestamp Order, Prev: Special Files, Up: Shortcomings + +18.1.4 File Names that Contain Unusual Characters +------------------------------------------------- + +When a file name contains an unusual character like a newline or white +space, 'diff -r' generates a patch that 'patch' cannot parse. The +problem is with format of 'diff' output, not just with 'patch', because +with odd enough file names one can cause 'diff' to generate a patch that +is syntactically correct but patches the wrong files. The format of +'diff' output should be extended to handle all possible file names. + + +File: diffutils.info-t, Node: Timestamp Order, Next: Ignoring Changes, Prev: Unusual File Names, Up: Shortcomings + +18.1.5 Outputting Diffs in Timestamp Order +------------------------------------------ + +Applying 'patch' to a multiple-file diff can result in files whose +timestamps are out of order. GNU 'patch' has options to restore the +timestamps of the updated files (*note Patching Timestamps::), but +sometimes it is useful to generate a patch that works even if the +recipient does not have GNU patch, or does not use these options. One +way to do this would be to implement a 'diff' option to output diffs in +timestamp order. + + +File: diffutils.info-t, Node: Ignoring Changes, Next: Speedups, Prev: Timestamp Order, Up: Shortcomings + +18.1.6 Ignoring Certain Changes +------------------------------- + +It would be nice to have a feature for specifying two strings, one in +FROM-FILE and one in TO-FILE, which should be considered to match. +Thus, if the two strings are 'foo' and 'bar', then if two lines differ +only in that 'foo' in file 1 corresponds to 'bar' in file 2, the lines +are treated as identical. + + It is not clear how general this feature can or should be, or what +syntax should be used for it. + + A partial substitute is to filter one or both files before comparing, +e.g.: + + sed 's/foo/bar/g' file1 | diff - file2 + + However, this outputs the filtered text, not the original. + + +File: diffutils.info-t, Node: Speedups, Prev: Ignoring Changes, Up: Shortcomings + +18.1.7 Improving Performance +---------------------------- + +When comparing two large directory structures, one of which was +originally copied from the other with timestamps preserved (e.g., with +'cp -pR'), it would greatly improve performance if an option told 'diff' +to assume that two files with the same size and timestamps have the same +content. *Note diff Performance::. + + +File: diffutils.info-t, Node: Bugs, Prev: Shortcomings, Up: Projects + +18.2 Reporting Bugs +=================== + +If you think you have found a bug in GNU 'cmp', 'diff', 'diff3', or +'sdiff', please report it by electronic mail to the GNU utilities bug +report mailing list (http://mail.gnu.org/mailman/listinfo/bug-diffutils) +<bug-diffutils@gnu.org>. Please send bug reports for GNU 'patch' to +<bug-patch@gnu.org>. Send as precise a description of the problem as +you can, including the output of the '--version' option and sample input +files that produce the bug, if applicable. If you have a nontrivial fix +for the bug, please send it as well. If you have a patch, please send +it too. It may simplify the maintainer's job if the patch is relative +to a recent test release, which you can find in the directory +<ftp://alpha.gnu.org/gnu/diffutils/>. + + +File: diffutils.info-t, Node: Copying This Manual, Next: Translations, Prev: Projects, Up: Top + +Appendix A Copying This Manual +****************************** + + Version 1.3, 3 November 2008 + + Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + <http://fsf.org/> + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document "free" in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. We + recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, + that contains a notice placed by the copyright holder saying it can + be distributed under the terms of this License. Such a notice + grants a world-wide, royalty-free license, unlimited in duration, + to use that work under the conditions stated herein. The + "Document", below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as "you". You accept + the license if you copy, modify or distribute the work in a way + requiring permission under copyright law. + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter section + of the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document's overall + subject (or to related matters) and contains nothing that could + fall directly within that overall subject. (Thus, if the Document + is in part a textbook of mathematics, a Secondary Section may not + explain any mathematics.) The relationship could be a matter of + historical connection with the subject or with related matters, or + of legal, commercial, philosophical, ethical or political position + regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in the + notice that says that the Document is released under this License. + If a section does not fit the above definition of Secondary then it + is not allowed to be designated as Invariant. The Document may + contain zero Invariant Sections. If the Document does not identify + any Invariant Sections then there are none. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. A + Front-Cover Text may be at most 5 words, and a Back-Cover Text may + be at most 25 words. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images composed + of pixels) generic paint programs or (for drawings) some widely + available drawing editor, and that is suitable for input to text + formatters or for automatic translation to a variety of formats + suitable for input to text formatters. A copy made in an otherwise + Transparent file format whose markup, or absence of markup, has + been arranged to thwart or discourage subsequent modification by + readers is not Transparent. An image format is not Transparent if + used for any substantial amount of text. A copy that is not + "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and standard-conforming + simple HTML, PostScript or PDF designed for human modification. + Examples of transparent image formats include PNG, XCF and JPG. + Opaque formats include proprietary formats that can be read and + edited only by proprietary word processors, SGML or XML for which + the DTD and/or processing tools are not generally available, and + the machine-generated HTML, PostScript or PDF produced by some word + processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + The "publisher" means any person or entity that distributes copies + of the Document to the public. + + A section "Entitled XYZ" means a named subunit of the Document + whose title either is precisely XYZ or contains XYZ in parentheses + following text that translates XYZ in another language. (Here XYZ + stands for a specific section name mentioned below, such as + "Acknowledgements", "Dedications", "Endorsements", or "History".) + To "Preserve the Title" of such a section when you modify the + Document means that it remains a section "Entitled XYZ" according + to this definition. + + The Document may include Warranty Disclaimers next to the notice + which states that this License applies to the Document. These + Warranty Disclaimers are considered to be included by reference in + this License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and + has no effect on the meaning of this License. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow the + conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly + have printed covers) of the Document, numbering more than 100, and + the Document's license notice requires Cover Texts, you must + enclose the copies in covers that carry, clearly and legibly, all + these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the title + equally prominent and visible. You may add other material on the + covers in addition. Copying with changes limited to the covers, as + long as they preserve the title of the Document and satisfy these + conditions, can be treated as verbatim copying in other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a machine-readable + Transparent copy along with each Opaque copy, or state in or with + each Opaque copy a computer-network location from which the general + network-using public has access to download using public-standard + network protocols a complete Transparent copy of the Document, free + of added material. If you use the latter option, you must take + reasonably prudent steps, when you begin distribution of Opaque + copies in quantity, to ensure that this Transparent copy will + remain thus accessible at the stated location until at least one + year after the last time you distribute an Opaque copy (directly or + through your agents or retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of copies, + to give them a chance to provide you with an updated version of the + Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with the + Modified Version filling the role of the Document, thus licensing + distribution and modification of the Modified Version to whoever + possesses a copy of it. In addition, you must do these things in + the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that + version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled "History", Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on the + Title Page. If there is no section Entitled "History" in the + Document, create one stating the title, year, authors, and + publisher of the Document as given on its Title Page, then add + an item describing the Modified Version as stated in the + previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + "History" section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + + K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section + all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, unaltered + in their text and in their titles. Section numbers or the + equivalent are not considered part of the section titles. + + M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + "Endorsements" or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option designate + some or all of these sections as invariant. To do this, add their + titles to the list of Invariant Sections in the Modified Version's + license notice. These titles must be distinct from any other + section titles. + + You may add a section Entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end of + the list of Cover Texts in the Modified Version. Only one passage + of Front-Cover Text and one of Back-Cover Text may be added by (or + through arrangements made by) any one entity. If the Document + already includes a cover text for the same cover, previously added + by you or by arrangement made by the same entity you are acting on + behalf of, you may not add another; but you may replace the old + one, on explicit permission from the previous publisher that added + the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination all + of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice, and that you preserve all + their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections Entitled + "History" in the various original documents, forming one section + Entitled "History"; likewise combine any sections Entitled + "Acknowledgements", and any sections Entitled "Dedications". You + must delete all sections Entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the documents + in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow this + License in all other respects regarding verbatim copying of that + document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of a + storage or distribution medium, is called an "aggregate" if the + copyright resulting from the compilation is not used to limit the + legal rights of the compilation's users beyond what the individual + works permit. When the Document is included in an aggregate, this + License does not apply to the other works in the aggregate which + are not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half + of the entire aggregate, the Document's Cover Texts may be placed + on covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic + form. Otherwise they must appear on printed covers that bracket + the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also + include the original English version of this License and the + original versions of those notices and disclaimers. In case of a + disagreement between the translation and the original version of + this License or a notice or disclaimer, the original version will + prevail. + + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to + Preserve its Title (section 1) will typically require changing the + actual title. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense, or distribute it is void, + and will automatically terminate your rights under this License. + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly and + finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from you + under this License. If your rights have been terminated and not + permanently reinstated, receipt of a copy of some or all of the + same material does not give you any rights to use it. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + <http://www.gnu.org/copyleft/>. + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If the + Document does not specify a version number of this License, you may + choose any version ever published (not as a draft) by the Free + Software Foundation. If the Document specifies that a proxy can + decide which future versions of this License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Document. + + 11. RELICENSING + + "Massive Multiauthor Collaboration Site" (or "MMC Site") means any + World Wide Web server that publishes copyrightable works and also + provides prominent facilities for anybody to edit those works. A + public wiki that anybody can edit is an example of such a server. + A "Massive Multiauthor Collaboration" (or "MMC") contained in the + site means any set of copyrightable works thus published on the MMC + site. + + "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 + license published by Creative Commons Corporation, a not-for-profit + corporation with a principal place of business in San Francisco, + California, as well as future copyleft versions of that license + published by that same organization. + + "Incorporate" means to publish or republish a Document, in whole or + in part, as part of another Document. + + An MMC is "eligible for relicensing" if it is licensed under this + License, and if all works that were first published under this + License somewhere other than this MMC, and subsequently + incorporated in whole or in part into the MMC, (1) had no cover + texts or invariant sections, and (2) were thus incorporated prior + to November 1, 2008. + + The operator of an MMC Site may republish an MMC contained in the + site under CC-BY-SA on the same site at any time before August 1, + 2009, provided the MMC is eligible for relicensing. + +ADDENDUM: How to use this License for your documents +==================================================== + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have Invariant Sections, Front-Cover Texts and Back-Cover +Texts, replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with + the Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. + + If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of free +software license, such as the GNU General Public License, to permit +their use in free software. + + +File: diffutils.info-t, Node: Translations, Next: Index, Prev: Copying This Manual, Up: Top + +Appendix B Translations of This Manual +************************************** + +Nishio Futoshi of the GNUjdoc project has prepared a Japanese +translation of this manual. Its most recent version can be found at +<http://openlab.ring.gr.jp/gnujdoc/cvsweb/cvsweb.cgi/gnujdoc/>. + + +File: diffutils.info-t, Node: Index, Prev: Translations, Up: Top + +Appendix C Index +**************** + +�[index�] +* Menu: + +* ! output format: Context. (line 6) +* +- output format: Unified Format. (line 6) +* < output format: Normal. (line 6) +* <<<<<<< for marking conflicts: Marking Conflicts. (line 6) +* _POSIX2_VERSION: Standards conformance. + (line 23) +* ad capability: diff Options. (line 179) +* aligning tab stops: Tabs. (line 6) +* alternate file names: Alternate Names. (line 6) +* always color option: diff Options. (line 43) +* auto color option: diff Options. (line 42) +* backup file names: Backup Names. (line 6) +* backup file strategy: Backups. (line 6) +* binary file diff: Binary. (line 6) +* blank and tab difference suppression: White Space. (line 6) +* blank line difference suppression: Blank Lines. (line 6) +* brief difference reports: Brief. (line 6) +* bug reports: Bugs. (line 6) +* C function headings: C Function Headings. (line 6) +* C if-then-else output format: If-then-else. (line 6) +* case difference suppression: Case Folding. (line 6) +* ClearCase: Revision Control. (line 6) +* cmp invocation: Invoking cmp. (line 6) +* cmp options: cmp Options. (line 6) +* color, distinguishing different context: diff Options. (line 37) +* columnar output: Side by Side. (line 6) +* common mistakes with patches: Avoiding Common Mistakes. + (line 6) +* comparing three files: Comparing Three Files. + (line 6) +* conflict: diff3 Merging. (line 26) +* conflict marking: Marking Conflicts. (line 6) +* context output format: Context. (line 6) +* creating files: Creating and Removing. + (line 6) +* de capability: diff Options. (line 184) +* diagnostics from patch: patch Messages. (line 6) +* diff invocation: Invoking diff. (line 6) +* diff merging: Interactive Merging. (line 6) +* diff options: diff Options. (line 6) +* diff sample input: Sample diff Input. (line 6) +* diff3 hunks: diff3 Hunks. (line 6) +* diff3 invocation: Invoking diff3. (line 6) +* diff3 options: diff3 Options. (line 6) +* diff3 sample input: Sample diff3 Input. (line 6) +* directories and patch: patch Directories. (line 6) +* directory structure changes: Changing Structure. (line 6) +* dry runs for patch: Dry Runs. (line 6) +* ed script output format: ed Scripts. (line 6) +* EDITOR: Merge Commands. (line 50) +* empty files, removing: Creating and Removing. + (line 6) +* exabyte, definition of: cmp Options. (line 99) +* exbibyte, definition of: cmp Options. (line 102) +* file name alternates: Alternate Names. (line 6) +* file names with unusual characters: Unusual File Names. (line 6) +* format of diff output: Output Formats. (line 6) +* format of diff3 output: Comparing Three Files. + (line 6) +* formats for if-then-else line groups: Line Group Formats. (line 6) +* forward ed script output format: Forward ed. (line 6) +* full lines: Incomplete Lines. (line 6) +* function headings, C: C Function Headings. (line 6) +* fuzz factor when patching: Inexact. (line 6) +* gibibyte, definition of: cmp Options. (line 87) +* gigabyte, definition of: cmp Options. (line 84) +* hd capability: diff Options. (line 189) +* headings: Sections. (line 6) +* hunks: Hunks. (line 6) +* hunks for diff3: diff3 Hunks. (line 6) +* if-then-else output format: If-then-else. (line 6) +* ifdef output format: If-then-else. (line 6) +* imperfect patch application: Imperfect. (line 6) +* incomplete line merging: Merging Incomplete Lines. + (line 6) +* incomplete lines: Incomplete Lines. (line 6) +* inexact patches: Inexact. (line 6) +* inhibit messages from patch: More or Fewer Messages. + (line 6) +* interactive merging: Interactive Merging. (line 6) +* introduction: Comparison. (line 6) +* intuiting file names from patches: Multiple Patches. (line 6) +* invoking cmp: Invoking cmp. (line 6) +* invoking diff: Invoking diff. (line 6) +* invoking diff3: Invoking diff3. (line 6) +* invoking patch: Invoking patch. (line 6) +* invoking sdiff: Invoking sdiff. (line 6) +* keyboard input to patch: patch and Keyboard Input. + (line 6) +* kibibyte, definition of: cmp Options. (line 75) +* kilobyte, definition of: cmp Options. (line 71) +* LC_COLLATE: Comparing Directories. + (line 6) +* LC_NUMERIC: Line Group Formats. (line 143) +* LC_TIME: Detailed Context. (line 12) +* line formats: Line Formats. (line 6) +* line group formats: Line Group Formats. (line 6) +* ln capability: diff Options. (line 194) +* mebibyte, definition of: cmp Options. (line 82) +* megabyte, definition of: cmp Options. (line 79) +* merge commands: Merge Commands. (line 6) +* merged diff3 format: Bypassing ed. (line 6) +* merged output format: If-then-else. (line 6) +* merging from a common ancestor: diff3 Merging. (line 6) +* merging interactively: Merge Commands. (line 6) +* messages from patch: patch Messages. (line 6) +* multibyte characters: Internationalization. + (line 6) +* multiple patches: Multiple Patches. (line 6) +* newline treatment by diff: Incomplete Lines. (line 6) +* none color option: diff Options. (line 40) +* normal output format: Normal. (line 6) +* options for cmp: cmp Options. (line 6) +* options for diff: diff Options. (line 6) +* options for diff3: diff3 Options. (line 6) +* options for patch: patch Options. (line 6) +* options for sdiff: sdiff Options. (line 6) +* output formats: Output Formats. (line 6) +* overlap: diff3 Merging. (line 26) +* overlapping change, selection of: Which Changes. (line 6) +* overview of diff and patch: Overview. (line 6) +* paginating diff output: Pagination. (line 6) +* patch consumer tips: Tips for Patch Consumers. + (line 6) +* patch input format: patch Input. (line 6) +* patch invocation: Invoking patch. (line 6) +* patch messages and questions: patch Messages. (line 6) +* patch options: patch Options. (line 6) +* patch producer tips: Tips for Patch Producers. + (line 6) +* patch, common mistakes: Avoiding Common Mistakes. + (line 6) +* patches, shrinking: Generating Smaller Patches. + (line 6) +* patching directories: patch Directories. (line 6) +* PATCH_GET: Revision Control. (line 13) +* PATCH_VERSION_CONTROL: Backup Names. (line 21) +* pebibyte, definition of: cmp Options. (line 97) +* performance of diff: diff Performance. (line 6) +* petabyte, definition of: cmp Options. (line 94) +* POSIX: patch and POSIX. (line 6) +* POSIX <1>: Standards conformance. + (line 6) +* POSIXLY_CORRECT: patch and POSIX. (line 6) +* POSIXLY_CORRECT <1>: Standards conformance. + (line 6) +* projects for directories: Shortcomings. (line 6) +* quoting style: patch Quoting Style. (line 6) +* QUOTING_STYLE: patch Quoting Style. (line 26) +* RCS: Revision Control. (line 6) +* RCS script output format: RCS. (line 6) +* regular expression matching headings: Specified Headings. (line 6) +* regular expression suppression: Specified Lines. (line 6) +* reject file names: Reject Names. (line 6) +* removing empty files: Creating and Removing. + (line 6) +* reporting bugs: Bugs. (line 6) +* reversed patches: Reversed Patches. (line 6) +* revision control: Revision Control. (line 6) +* sample input for diff: Sample diff Input. (line 6) +* sample input for diff3: Sample diff3 Input. (line 6) +* SCCS: Revision Control. (line 6) +* script output formats: Scripts. (line 6) +* sdiff invocation: Invoking sdiff. (line 6) +* sdiff options: sdiff Options. (line 6) +* sdiff output format: sdiff Option Summary. + (line 6) +* section headings: Sections. (line 6) +* side by side: Side by Side. (line 6) +* side by side format: Side by Side Format. (line 6) +* SIMPLE_BACKUP_SUFFIX: Backup Names. (line 12) +* special files: Special Files. (line 6) +* specified headings: Specified Headings. (line 6) +* summarizing which files differ: Brief. (line 6) +* System V diff3 compatibility: Saving the Changed File. + (line 6) +* tab and blank difference suppression: White Space. (line 6) +* tab stop alignment: Tabs. (line 6) +* tebibyte, definition of: cmp Options. (line 92) +* terabyte, definition of: cmp Options. (line 89) +* terminal, using color iff: diff Options. (line 42) +* testing patch: Dry Runs. (line 6) +* text versus binary diff: Binary. (line 6) +* timestamp format, context diffs: Detailed Context. (line 12) +* timestamp format, unified diffs: Detailed Unified. (line 12) +* timestamps on patched files: Patching Timestamps. (line 6) +* traditional patch: patch and Tradition. (line 6) +* trailing blanks: Trailing Blanks. (line 6) +* two-column output: Side by Side. (line 6) +* unified output format: Unified Format. (line 6) +* unmerged change: Which Changes. (line 6) +* varying-width characters: Internationalization. + (line 6) +* verbose messages from patch: More or Fewer Messages. + (line 6) +* version control: Revision Control. (line 6) +* VERSION_CONTROL: Revision Control. (line 22) +* VERSION_CONTROL <1>: Backup Names. (line 21) +* white space in patches: Changed White Space. (line 6) +* yottabyte, definition of: cmp Options. (line 110) +* zettabyte, definition of: cmp Options. (line 104) + + + +Tag Table: +Node: Top1429 +Node: Overview3640 +Node: Comparison7396 +Node: Hunks10340 +Node: White Space11783 +Node: Blank Lines13624 +Node: Specified Lines14615 +Node: Case Folding15743 +Node: Brief16162 +Node: Binary17487 +Node: Output Formats21286 +Node: Sample diff Input22013 +Node: Context23514 +Node: Context Format25093 +Node: Example Context25887 +Node: Less Context27397 +Node: Detailed Context28589 +Node: Unified Format30786 +Node: Example Unified31585 +Node: Detailed Unified32625 +Node: Sections34267 +Node: Specified Headings35028 +Node: C Function Headings36579 +Node: Alternate Names37427 +Node: Side by Side38342 +Node: Side by Side Format40494 +Node: Example Side by Side41398 +Node: Normal42740 +Node: Example Normal43743 +Node: Detailed Normal44482 +Node: Scripts46223 +Node: ed Scripts46630 +Node: Example ed47838 +Node: Detailed ed48290 +Node: Forward ed50051 +Node: RCS50829 +Node: If-then-else52047 +Node: Line Group Formats53727 +Node: Line Formats59610 +Node: Example If-then-else62881 +Node: Detailed If-then-else63962 +Node: Incomplete Lines65849 +Node: Comparing Directories67487 +Node: Adjusting Output71781 +Node: Tabs72290 +Node: Trailing Blanks73906 +Node: Pagination75133 +Node: diff Performance75603 +Node: Comparing Three Files78694 +Node: Sample diff3 Input79574 +Node: Example diff3 Normal80524 +Node: Detailed diff3 Normal81590 +Node: diff3 Hunks83380 +Node: diff3 Merging84648 +Node: Which Changes86895 +Node: Marking Conflicts88297 +Node: Bypassing ed90754 +Node: Merging Incomplete Lines92099 +Node: Saving the Changed File92827 +Node: Interactive Merging93445 +Node: sdiff Option Summary94156 +Node: Merge Commands95361 +Node: Merging with patch96652 +Node: patch Input99021 +Node: Revision Control99705 +Node: Imperfect100877 +Node: Changed White Space102028 +Node: Reversed Patches102827 +Node: Inexact104293 +Node: Dry Runs107851 +Node: Creating and Removing108717 +Node: Patching Timestamps109768 +Node: Multiple Patches111957 +Node: patch Directories114620 +Node: Backups116246 +Node: Backup Names117312 +Ref: Backup Names-Footnote-1120269 +Node: Reject Names120396 +Node: patch Messages120987 +Node: More or Fewer Messages122049 +Node: patch and Keyboard Input122682 +Node: patch Quoting Style123713 +Node: patch and POSIX124861 +Node: patch and Tradition125702 +Node: Making Patches129125 +Node: Tips for Patch Producers129953 +Node: Tips for Patch Consumers131210 +Node: Avoiding Common Mistakes131849 +Node: Generating Smaller Patches134376 +Node: Invoking cmp136137 +Node: cmp Options137689 +Node: Invoking diff141335 +Node: diff Options142956 +Node: Invoking diff3152807 +Node: diff3 Options153447 +Node: Invoking patch156482 +Node: patch Options157692 +Node: Invoking sdiff162914 +Node: sdiff Options164058 +Node: Standards conformance167032 +Node: Projects168780 +Node: Shortcomings169494 +Node: Internationalization170596 +Node: Changing Structure171764 +Node: Special Files172869 +Node: Unusual File Names173982 +Node: Timestamp Order174622 +Node: Ignoring Changes175260 +Node: Speedups176031 +Node: Bugs176495 +Node: Copying This Manual177350 +Node: Translations202471 +Node: Index202845 + +End Tag Table diff --git a/local/recipes/tools/diffutils/source/doc/diffutils.texi b/local/recipes/tools/diffutils/source/doc/diffutils.texi new file mode 100644 index 0000000000..8479b3f4f6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/doc/diffutils.texi @@ -0,0 +1,4764 @@ +\input texinfo @c -*-texinfo-*- +@comment %**start of header +@setfilename diffutils.info +@include version.texi +@settitle Comparing and Merging Files +@syncodeindex vr cp +@setchapternewpage odd +@comment %**end of header +@copying +This manual is for GNU Diffutils +(version @value{VERSION}, @value{UPDATED}), +and documents the GNU @command{diff}, @command{diff3}, +@command{sdiff}, and @command{cmp} commands for showing the +differences between files and the GNU @command{patch} command for +using their output to update files. + +Copyright @copyright{} 1992-1994, 1998, 2001-2002, 2004, 2006, 2009-2017 Free +Software Foundation, Inc. + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 or +any later version published by the Free Software Foundation; with no +Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +A copy of the license is included in the section entitled +``GNU Free Documentation License.'' +@end quotation +@end copying + +@c Debian install-info (up through at least version 1.9.20) uses only the +@c first dircategory. Put this one first, as it is more useful in practice. +@dircategory Individual utilities +@direntry +* cmp: (diffutils)Invoking cmp. Compare 2 files byte by byte. +* diff: (diffutils)Invoking diff. Compare 2 files line by line. +* diff3: (diffutils)Invoking diff3. Compare 3 files line by line. +* patch: (diffutils)Invoking patch. Apply a patch to a file. +* sdiff: (diffutils)Invoking sdiff. Merge 2 files side-by-side. +@end direntry + +@dircategory Text creation and manipulation +@direntry +* Diffutils: (diffutils). Comparing and merging files. +@end direntry + +@titlepage +@title Comparing and Merging Files +@subtitle for Diffutils @value{VERSION} and @code{patch} 2.5.4 +@subtitle @value{UPDATED} +@author David MacKenzie, Paul Eggert, and Richard Stallman +@page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage + +@shortcontents +@contents + +@ifnottex +@node Top +@top Comparing and Merging Files + +@insertcopying +@end ifnottex + +@menu +* Overview:: Preliminary information. +* Comparison:: What file comparison means. + +* Output Formats:: Formats for two-way difference reports. +* Incomplete Lines:: Lines that lack trailing newlines. +* Comparing Directories:: Comparing files and directories. +* Adjusting Output:: Making @command{diff} output prettier. +* diff Performance:: Making @command{diff} smarter or faster. + +* Comparing Three Files:: Formats for three-way difference reports. +* diff3 Merging:: Merging from a common ancestor. + +* Interactive Merging:: Interactive merging with @command{sdiff}. + +* Merging with patch:: Using @command{patch} to change old files into new ones. +* Making Patches:: Tips for making and using patch distributions. + +* Invoking cmp:: Compare two files byte by byte. +* Invoking diff:: Compare two files line by line. +* Invoking diff3:: Compare three files line by line. +* Invoking patch:: Apply a diff file to an original. +* Invoking sdiff:: Side-by-side merge of file differences. + +* Standards conformance:: Conformance to the POSIX standard. +* Projects:: If you've found a bug or other shortcoming. + +* Copying This Manual:: How to make copies of this manual. +* Translations:: Available translations of this manual. +* Index:: Index. +@end menu + +@node Overview +@unnumbered Overview +@cindex overview of @command{diff} and @command{patch} + +Computer users often find occasion to ask how two files differ. Perhaps +one file is a newer version of the other file. Or maybe the two files +started out as identical copies but were changed by different people. + +You can use the @command{diff} command to show differences between two +files, or each corresponding file in two directories. @command{diff} +outputs differences between files line by line in any of several +formats, selectable by command line options. This set of differences is +often called a @dfn{diff} or @dfn{patch}. For files that are identical, +@command{diff} normally produces no output; for binary (non-text) files, +@command{diff} normally reports only that they are different. + +You can use the @command{cmp} command to show the byte and line numbers +where two files differ. @command{cmp} can also show all the bytes +that differ between the two files, side by side. A way to compare +two files character by character is the Emacs command @kbd{M-x +compare-windows}. @xref{Other Window, , Other Window, emacs, The GNU +Emacs Manual}, for more information on that command. + +You can use the @command{diff3} command to show differences among three +files. When two people have made independent changes to a common +original, @command{diff3} can report the differences between the original +and the two changed versions, and can produce a merged file that +contains both persons' changes together with warnings about conflicts. + +You can use the @command{sdiff} command to merge two files interactively. + +You can use the set of differences produced by @command{diff} to distribute +updates to text files (such as program source code) to other people. +This method is especially useful when the differences are small compared +to the complete files. Given @command{diff} output, you can use the +@command{patch} program to update, or @dfn{patch}, a copy of the file. If you +think of @command{diff} as subtracting one file from another to produce +their difference, you can think of @command{patch} as adding the difference +to one file to reproduce the other. + +This manual first concentrates on making diffs, and later shows how to +use diffs to update files. + +GNU @command{diff} was written by Paul Eggert, Mike Haertel, +David Hayes, Richard Stallman, and Len Tower. Wayne Davison designed and +implemented the unified output format. The basic algorithm is described +by Eugene W. Myers in ``An O(ND) Difference Algorithm and its Variations'', +@cite{Algorithmica} Vol.@: 1, 1986, pp.@: 251--266, +@url{http://dx.doi.org/10.1007/BF01840446}; and in ``A File +Comparison Program'', Webb Miller and Eugene W. Myers, +@cite{Software---Practice and Experience} Vol.@: 15, 1985, +pp.@: 1025--1040, +@url{http://dx.doi.org/10.1002/spe.4380151102}. +@c From: "Gene Myers" <gene@cs.arizona.edu> +@c They are about the same basic algorithm; the Algorithmica +@c paper gives a rigorous treatment and the sub-algorithm for +@c delivering scripts and should be the primary reference, but +@c both should be mentioned. +The algorithm was independently discovered as described by Esko Ukkonen in +``Algorithms for Approximate String Matching'', +@cite{Information and Control} Vol.@: 64, 1985, pp.@: 100--118, +@url{http://dx.doi.org/10.1016/S0019-9958(85)80046-2}. +@c From: "Gene Myers" <gene@cs.arizona.edu> +@c Date: Wed, 29 Sep 1993 08:27:55 MST +@c Ukkonen should be given credit for also discovering the algorithm used +@c in GNU diff. +Unless the @option{--minimal} option is used, @command{diff} uses a +heuristic by Paul Eggert that limits the cost to @math{O(N^1.5 log N)} +at the price of producing suboptimal output for large inputs with many +differences. Related algorithms are surveyed by Alfred V. Aho in +section 6.3 of ``Algorithms for Finding Patterns in Strings'', +@cite{Handbook of Theoretical Computer Science} (Jan Van Leeuwen, +ed.), Vol.@: A, @cite{Algorithms and Complexity}, Elsevier/MIT Press, +1990, pp.@: 255--300. + +GNU @command{diff3} was written by Randy Smith. GNU +@command{sdiff} was written by Thomas Lord. GNU @command{cmp} +was written by Torbj@"orn Granlund and David MacKenzie. + +GNU @command{patch} was written mainly by Larry Wall and Paul Eggert; +several GNU enhancements were contributed by Wayne Davison and +David MacKenzie. Parts of this manual are adapted from a manual page +written by Larry Wall, with his permission. + +@node Comparison +@chapter What Comparison Means +@cindex introduction + +There are several ways to think about the differences between two files. +One way to think of the differences is as a series of lines that were +deleted from, inserted in, or changed in one file to produce the other +file. @command{diff} compares two files line by line, finds groups of +lines that differ, and reports each group of differing lines. It can +report the differing lines in several formats, which have different +purposes. + +GNU @command{diff} can show whether files are different +without detailing the differences. It also provides ways to suppress +certain kinds of differences that are not important to you. Most +commonly, such differences are changes in the amount of white space +between words or lines. @command{diff} also provides ways to suppress +differences in alphabetic case or in lines that match a regular +expression that you provide. These options can accumulate; for +example, you can ignore changes in both white space and alphabetic +case. + +Another way to think of the differences between two files is as a +sequence of pairs of bytes that can be either identical or +different. @command{cmp} reports the differences between two files +byte by byte, instead of line by line. As a result, it is often +more useful than @command{diff} for comparing binary files. For text +files, @command{cmp} is useful mainly when you want to know only whether +two files are identical, or whether one file is a prefix of the other. + +To illustrate the effect that considering changes byte by byte +can have compared with considering them line by line, think of what +happens if a single newline character is added to the beginning of a +file. If that file is then compared with an otherwise identical file +that lacks the newline at the beginning, @command{diff} will report that a +blank line has been added to the file, while @command{cmp} will report that +almost every byte of the two files differs. + +@command{diff3} normally compares three input files line by line, finds +groups of lines that differ, and reports each group of differing lines. +Its output is designed to make it easy to inspect two different sets of +changes to the same file. + +These commands compare input files without necessarily reading them. +For example, if @command{diff} is asked simply to report whether two +files differ, and it discovers that the files have different sizes, it +need not read them to do its job. + +@menu +* Hunks:: Groups of differing lines. +* White Space:: Suppressing differences in white space. +* Blank Lines:: Suppressing differences whose lines are all blank. +* Specified Lines:: Suppressing differences whose lines all match a pattern. +* Case Folding:: Suppressing differences in alphabetic case. +* Brief:: Summarizing which files are different. +* Binary:: Comparing binary files or forcing text comparisons. +@end menu + +@node Hunks +@section Hunks +@cindex hunks + +When comparing two files, @command{diff} finds sequences of lines common to +both files, interspersed with groups of differing lines called +@dfn{hunks}. Comparing two identical files yields one sequence of +common lines and no hunks, because no lines differ. Comparing two +entirely different files yields no common lines and one large hunk that +contains all lines of both files. In general, there are many ways to +match up lines between two given files. @command{diff} tries to minimize +the total hunk size by finding large sequences of common lines +interspersed with small hunks of differing lines. + +For example, suppose the file @file{F} contains the three lines +@samp{a}, @samp{b}, @samp{c}, and the file @file{G} contains the same +three lines in reverse order @samp{c}, @samp{b}, @samp{a}. If +@command{diff} finds the line @samp{c} as common, then the command +@samp{diff F G} produces this output: + +@example +1,2d0 +< a +< b +3a2,3 +> b +> a +@end example + +@noindent +But if @command{diff} notices the common line @samp{b} instead, it produces +this output: + +@example +1c1 +< a +--- +> c +3c3 +< c +--- +> a +@end example + +@noindent +It is also possible to find @samp{a} as the common line. @command{diff} +does not always find an optimal matching between the files; it takes +shortcuts to run faster. But its output is usually close to the +shortest possible. You can adjust this tradeoff with the +@option{--minimal} (@option{-d}) option (@pxref{diff Performance}). + +@node White Space +@section Suppressing Differences in Blank and Tab Spacing +@cindex blank and tab difference suppression +@cindex tab and blank difference suppression + +The @option{--ignore-tab-expansion} (@option{-E}) option ignores the +distinction between tabs and spaces on input. A tab is considered to be +equivalent to the number of spaces to the next tab stop (@pxref{Tabs}). + +The @option{--ignore-trailing-space} (@option{-Z}) option ignores white +space at line end. + +The @option{--ignore-space-change} (@option{-b}) option is stronger than +@option{-E} and @option{-Z} combined. +It ignores white space at line end, and considers all other sequences of +one or more white space characters within a line to be equivalent. With this +option, @command{diff} considers the following two lines to be equivalent, +where @samp{$} denotes the line end: + +@example +Here lyeth muche rychnesse in lytell space. -- John Heywood$ +Here lyeth muche rychnesse in lytell space. -- John Heywood $ +@end example + +The @option{--ignore-all-space} (@option{-w}) option is stronger still. +It ignores differences even if one line has white space where +the other line has none. @dfn{White space} characters include +tab, vertical tab, form feed, carriage return, and space; +some locales may define additional characters to be white space. +With this option, @command{diff} considers the +following two lines to be equivalent, where @samp{$} denotes the line +end and @samp{^M} denotes a carriage return: + +@example +Here lyeth muche rychnesse in lytell space.-- John Heywood$ + He relyeth much erychnes seinly tells pace. --John Heywood ^M$ +@end example + +For many other programs newline is also a white space character, but +@command{diff} is a line-oriented program and a newline character +always ends a line. Hence the @option{-w} or +@option{--ignore-all-space} option does not ignore newline-related +changes; it ignores only other white space changes. + +@node Blank Lines +@section Suppressing Differences Whose Lines Are All Blank +@cindex blank line difference suppression + +The @option{--ignore-blank-lines} (@option{-B}) option ignores changes +that consist entirely of blank lines. With this option, for example, a +file containing +@example +1. A point is that which has no part. + +2. A line is breadthless length. +-- Euclid, The Elements, I +@end example +@noindent +is considered identical to a file containing +@example +1. A point is that which has no part. +2. A line is breadthless length. + + +-- Euclid, The Elements, I +@end example + +Normally this option affects only lines that are completely empty, but +if you also specify an option that ignores trailing spaces, +lines are also affected if they look empty but contain white space. +In other words, @option{-B} is equivalent to @samp{-I '^$'} by +default, but it is equivalent to @option{-I '^[[:space:]]*$'} if +@option{-b}, @option{-w} or @option{-Z} is also specified. + +@node Specified Lines +@section Suppressing Differences Whose Lines All Match a Regular Expression +@cindex regular expression suppression + +To ignore insertions and deletions of lines that match a +@command{grep}-style regular expression, use the +@option{--ignore-matching-lines=@var{regexp}} (@option{-I @var{regexp}}) option. +You should escape +regular expressions that contain shell metacharacters to prevent the +shell from expanding them. For example, @samp{diff -I '^[[:digit:]]'} ignores +all changes to lines beginning with a digit. + +However, @option{-I} only ignores the insertion or deletion of lines that +contain the regular expression if every changed line in the hunk---every +insertion and every deletion---matches the regular expression. In other +words, for each nonignorable change, @command{diff} prints the complete set +of changes in its vicinity, including the ignorable ones. + +You can specify more than one regular expression for lines to ignore by +using more than one @option{-I} option. @command{diff} tries to match each +line against each regular expression. + +@node Case Folding +@section Suppressing Case Differences +@cindex case difference suppression + +GNU @command{diff} can treat lower case letters as +equivalent to their upper case counterparts, so that, for example, it +considers @samp{Funky Stuff}, @samp{funky STUFF}, and @samp{fUNKy +stuFf} to all be the same. To request this, use the @option{-i} or +@option{--ignore-case} option. + +@node Brief +@section Summarizing Which Files Differ +@cindex summarizing which files differ +@cindex brief difference reports + +When you only want to find out whether files are different, and you +don't care what the differences are, you can use the summary output +format. In this format, instead of showing the differences between the +files, @command{diff} simply reports whether files differ. The +@option{--brief} (@option{-q}) option selects this output format. + +This format is especially useful when comparing the contents of two +directories. It is also much faster than doing the normal line by line +comparisons, because @command{diff} can stop analyzing the files as soon as +it knows that there are any differences. + +You can also get a brief indication of whether two files differ by using +@command{cmp}. For files that are identical, @command{cmp} produces no +output. When the files differ, by default, @command{cmp} outputs the byte +and line number where the first difference occurs, or reports that one +file is a prefix of the other. You can use +the @option{-s}, @option{--quiet}, or @option{--silent} option to +suppress that information, so that @command{cmp} +produces no output and reports whether the files differ using only its +exit status (@pxref{Invoking cmp}). + +@c Fix this. +Unlike @command{diff}, @command{cmp} cannot compare directories; it can only +compare two files. + +@node Binary +@section Binary Files and Forcing Text Comparisons +@cindex binary file diff +@cindex text versus binary diff + +If @command{diff} thinks that either of the two files it is comparing is +binary (a non-text file), it normally treats that pair of files much as +if the summary output format had been selected (@pxref{Brief}), and +reports only that the binary files are different. This is because line +by line comparisons are usually not meaningful for binary files. +This does not count as trouble, even though the resulting output does +not capture all the differences. + +@command{diff} determines whether a file is text or binary by checking the +first few bytes in the file; the exact number of bytes is system +dependent, but it is typically several thousand. If every byte in +that part of the file is non-null, @command{diff} considers the file to be +text; otherwise it considers the file to be binary. + +Sometimes you might want to force @command{diff} to consider files to be +text. For example, you might be comparing text files that contain +null characters; @command{diff} would erroneously decide that those are +non-text files. Or you might be comparing documents that are in a +format used by a word processing system that uses null characters to +indicate special formatting. You can force @command{diff} to consider all +files to be text files, and compare them line by line, by using the +@option{--text} (@option{-a}) option. If the files you compare using this +option do not in fact contain text, they will probably contain few +newline characters, and the @command{diff} output will consist of hunks +showing differences between long lines of whatever characters the files +contain. + +You can also force @command{diff} to report only whether files differ +(but not how). Use the @option{--brief} (@option{-q}) option for +this. + +In operating systems that distinguish between text and binary files, +@command{diff} normally reads and writes all data as text. Use the +@option{--binary} option to force @command{diff} to read and write binary +data instead. This option has no effect on a POSIX-compliant system +like GNU or traditional Unix. However, many personal computer +operating systems represent the end of a line with a carriage return +followed by a newline. On such systems, @command{diff} normally ignores +these carriage returns on input and generates them at the end of each +output line, but with the @option{--binary} option @command{diff} treats +each carriage return as just another input character, and does not +generate a carriage return at the end of each output line. This can be +useful when dealing with non-text files that are meant to be +interchanged with POSIX-compliant systems. + +The @option{--strip-trailing-cr} causes @command{diff} to treat input +lines that end in carriage return followed by newline as if they end +in plain newline. This can be useful when comparing text that is +imperfectly imported from many personal computer operating systems. +This option affects how lines are read, which in turn affects how they +are compared and output. + +If you want to compare two files byte by byte, you can use the +@command{cmp} program with the @option{--verbose} (@option{-l}) +option to show the values of each differing byte in the two files. +With GNU @command{cmp}, you can also use the @option{-b} or +@option{--print-bytes} option to show the ASCII representation of +those bytes. @xref{Invoking cmp}, for more information. + +If @command{diff3} thinks that any of the files it is comparing is binary +(a non-text file), it normally reports an error, because such +comparisons are usually not useful. @command{diff3} uses the same test as +@command{diff} to decide whether a file is binary. As with @command{diff}, if +the input files contain a few non-text bytes but otherwise are like +text files, you can force @command{diff3} to consider all files to be text +files and compare them line by line by using the @option{-a} or +@option{--text} option. + +@node Output Formats +@chapter @command{diff} Output Formats +@cindex output formats +@cindex format of @command{diff} output + +@command{diff} has several mutually exclusive options for output format. +The following sections describe each format, illustrating how +@command{diff} reports the differences between two sample input files. + +@menu +* Sample diff Input:: Sample @command{diff} input files for examples. +* Context:: Showing differences with the surrounding text. +* Side by Side:: Showing differences in two columns. +* Normal:: Showing differences without surrounding text. +* Scripts:: Generating scripts for other programs. +* If-then-else:: Merging files with if-then-else. +@end menu + +@node Sample diff Input +@section Two Sample Input Files +@cindex @command{diff} sample input +@cindex sample input for @command{diff} + +Here are two sample files that we will use in numerous examples to +illustrate the output of @command{diff} and how various options can change +it. + +This is the file @file{lao}: + +@example +The Way that can be told of is not the eternal Way; +The name that can be named is not the eternal name. +The Nameless is the origin of Heaven and Earth; +The Named is the mother of all things. +Therefore let there always be non-being, + so we may see their subtlety, +And let there always be being, + so we may see their outcome. +The two are the same, +But after they are produced, + they have different names. +@end example + +This is the file @file{tzu}: + +@example +The Nameless is the origin of Heaven and Earth; +The named is the mother of all things. + +Therefore let there always be non-being, + so we may see their subtlety, +And let there always be being, + so we may see their outcome. +The two are the same, +But after they are produced, + they have different names. +They both may be called deep and profound. +Deeper and more profound, +The door of all subtleties! +@end example + +In this example, the first hunk contains just the first two lines of +@file{lao}, the second hunk contains the fourth line of @file{lao} +opposing the second and third lines of @file{tzu}, and the last hunk +contains just the last three lines of @file{tzu}. + +@node Context +@section Showing Differences in Their Context +@cindex context output format +@cindex @samp{!} output format + +Usually, when you are looking at the differences between files, you will +also want to see the parts of the files near the lines that differ, to +help you understand exactly what has changed. These nearby parts of the +files are called the @dfn{context}. + +GNU @command{diff} provides two output formats that show context +around the differing lines: @dfn{context format} and @dfn{unified +format}. It can optionally show in which function or section of the +file the differing lines are found. + +If you are distributing new versions of files to other people in the +form of @command{diff} output, you should use one of the output formats +that show context so that they can apply the diffs even if they have +made small changes of their own to the files. @command{patch} can apply +the diffs in this case by searching in the files for the lines of +context around the differing lines; if those lines are actually a few +lines away from where the diff says they are, @command{patch} can adjust +the line numbers accordingly and still apply the diff correctly. +@xref{Imperfect}, for more information on using @command{patch} to apply +imperfect diffs. + +@menu +* Context Format:: An output format that shows surrounding lines. +* Unified Format:: A more compact output format that shows context. +* Sections:: Showing which sections of the files differences are in. +* Alternate Names:: Showing alternate file names in context headers. +@end menu + +@node Context Format +@subsection Context Format + +The context output format shows several lines of context around the +lines that differ. It is the standard format for distributing updates +to source code. + +To select this output format, use the +@option{--context@r{[}=@var{lines}@r{]}} (@option{-C @var{lines}}) +or @option{-c} option. The +argument @var{lines} that some of these options take is the number of +lines of context to show. If you do not specify @var{lines}, it +defaults to three. For proper operation, @command{patch} typically needs +at least two lines of context. + +@menu +* Example Context:: Sample output in context format. +* Less Context:: Another sample with less context. +* Detailed Context:: A detailed description of the context output format. +@end menu + +@node Example Context +@subsubsection An Example of Context Format + +Here is the output of @samp{diff -c lao tzu} (@pxref{Sample diff Input}, +for the complete contents of the two files). Notice that up to three +lines that are not different are shown around each line that is +different; they are the context lines. Also notice that the first two +hunks have run together, because their contents overlap. + +@example +*** lao 2002-02-21 23:30:39.942229878 -0800 +--- tzu 2002-02-21 23:30:50.442260588 -0800 +*************** +*** 1,7 **** +- The Way that can be told of is not the eternal Way; +- The name that can be named is not the eternal name. + The Nameless is the origin of Heaven and Earth; +! The Named is the mother of all things. + Therefore let there always be non-being, + so we may see their subtlety, + And let there always be being, +--- 1,6 ---- + The Nameless is the origin of Heaven and Earth; +! The named is the mother of all things. +! @- + Therefore let there always be non-being, + so we may see their subtlety, + And let there always be being, +*************** +*** 9,11 **** +--- 8,13 ---- + The two are the same, + But after they are produced, + they have different names. ++ They both may be called deep and profound. ++ Deeper and more profound, ++ The door of all subtleties! +@end example + +@node Less Context +@subsubsection An Example of Context Format with Less Context + +Here is the output of @samp{diff -C 1 lao tzu} (@pxref{Sample diff +Input}, for the complete contents of the two files). Notice that at +most one context line is reported here. + +@example +*** lao 2002-02-21 23:30:39.942229878 -0800 +--- tzu 2002-02-21 23:30:50.442260588 -0800 +*************** +*** 1,5 **** +- The Way that can be told of is not the eternal Way; +- The name that can be named is not the eternal name. + The Nameless is the origin of Heaven and Earth; +! The Named is the mother of all things. + Therefore let there always be non-being, +--- 1,4 ---- + The Nameless is the origin of Heaven and Earth; +! The named is the mother of all things. +! @- + Therefore let there always be non-being, +*************** +*** 11 **** +--- 10,13 ---- + they have different names. ++ They both may be called deep and profound. ++ Deeper and more profound, ++ The door of all subtleties! +@end example + +@node Detailed Context +@subsubsection Detailed Description of Context Format + +The context output format starts with a two-line header, which looks +like this: + +@example +*** @var{from-file} @var{from-file-modification-time} +--- @var{to-file} @var{to-file-modification time} +@end example + +@noindent +@vindex LC_TIME +@cindex timestamp format, context diffs +The timestamp normally looks like @samp{2002-02-21 23:30:39.942229878 +-0800} to indicate the date, time with fractional seconds, and time +zone in @uref{ftp://ftp.isi.edu/in-notes/rfc2822.txt, Internet RFC +2822 format}. (The fractional seconds are omitted on hosts that do +not support fractional timestamps.) However, a traditional timestamp +like @samp{Thu Feb 21 23:30:39 2002} is used if the +@env{LC_TIME} locale category is either @samp{C} or @samp{POSIX}. + +You can change the header's content with the +@option{--label=@var{label}} option; see @ref{Alternate Names}. + +Next come one or more hunks of differences; each hunk shows one area +where the files differ. Context format hunks look like this: + +@example +*************** +*** @var{from-file-line-numbers} **** + @var{from-file-line} + @var{from-file-line}@dots{} +--- @var{to-file-line-numbers} ---- + @var{to-file-line} + @var{to-file-line}@dots{} +@end example + +If a hunk contains two or more lines, its line numbers look like +@samp{@var{start},@var{end}}. Otherwise only its end line number +appears. An empty hunk is considered to end at the line that precedes +the hunk. + +The lines of context around the lines that differ start with two space +characters. The lines that differ between the two files start with one +of the following indicator characters, followed by a space character: + +@table @samp +@item ! +A line that is part of a group of one or more lines that changed between +the two files. There is a corresponding group of lines marked with +@samp{!} in the part of this hunk for the other file. + +@item + +An ``inserted'' line in the second file that corresponds to nothing in +the first file. + +@item - +A ``deleted'' line in the first file that corresponds to nothing in the +second file. +@end table + +If all of the changes in a hunk are insertions, the lines of +@var{from-file} are omitted. If all of the changes are deletions, the +lines of @var{to-file} are omitted. + +@node Unified Format +@subsection Unified Format +@cindex unified output format +@cindex @samp{+-} output format + +The unified output format is a variation on the context format that is +more compact because it omits redundant context lines. To select this +output format, use the +@option{--unified@r{[}=@var{lines}@r{]}} (@option{-U @var{lines}}), +or @option{-u} option. +The argument @var{lines} is the number of lines of context to show. +When it is not given, it defaults to three. + +At present, only GNU @command{diff} can produce this format and +only GNU @command{patch} can automatically apply diffs in this +format. For proper operation, @command{patch} typically needs at +least three lines of context. + +@menu +* Example Unified:: Sample output in unified format. +* Detailed Unified:: A detailed description of unified format. +@end menu + +@node Example Unified +@subsubsection An Example of Unified Format + +Here is the output of the command @samp{diff -u lao tzu} +(@pxref{Sample diff Input}, for the complete contents of the two files): + +@example +--- lao 2002-02-21 23:30:39.942229878 -0800 ++++ tzu 2002-02-21 23:30:50.442260588 -0800 +@@@@ -1,7 +1,6 @@@@ +-The Way that can be told of is not the eternal Way; +-The name that can be named is not the eternal name. + The Nameless is the origin of Heaven and Earth; +-The Named is the mother of all things. ++The named is the mother of all things. ++ + Therefore let there always be non-being, + so we may see their subtlety, + And let there always be being, +@@@@ -9,3 +8,6 @@@@ + The two are the same, + But after they are produced, + they have different names. ++They both may be called deep and profound. ++Deeper and more profound, ++The door of all subtleties! +@end example + +@node Detailed Unified +@subsubsection Detailed Description of Unified Format + +The unified output format starts with a two-line header, which looks +like this: + +@example +--- @var{from-file} @var{from-file-modification-time} ++++ @var{to-file} @var{to-file-modification-time} +@end example + +@noindent +@cindex timestamp format, unified diffs +The timestamp looks like @samp{2002-02-21 23:30:39.942229878 -0800} +to indicate the date, time with fractional seconds, and time zone. +The fractional seconds are omitted on hosts that do not support +fractional timestamps. + +You can change the header's content with the +@option{--label=@var{label}} option. @xref{Alternate Names}. + +Next come one or more hunks of differences; each hunk shows one area +where the files differ. Unified format hunks look like this: + +@example +@@@@ @var{from-file-line-numbers} @var{to-file-line-numbers} @@@@ + @var{line-from-either-file} + @var{line-from-either-file}@dots{} +@end example + +If a hunk contains just one line, only its start line number appears. +Otherwise its line numbers look like @samp{@var{start},@var{count}}. +An empty hunk is considered to start at the line that follows the hunk. + +If a hunk and its context contain two or more lines, its +line numbers look like @samp{@var{start},@var{count}}. Otherwise only +its end line number appears. An empty hunk is considered to end at +the line that precedes the hunk. + +The lines common to both files begin with a space character. The lines +that actually differ between the two files have one of the following +indicator characters in the left print column: + +@table @samp +@item + +A line was added here to the first file. + +@item - +A line was removed here from the first file. +@end table + +@node Sections +@subsection Showing Which Sections Differences Are in +@cindex headings +@cindex section headings + +Sometimes you might want to know which part of the files each change +falls in. If the files are source code, this could mean which +function was changed. If the files are documents, it could mean which +chapter or appendix was changed. GNU @command{diff} can +show this by displaying the nearest section heading line that precedes +the differing lines. Which lines are ``section headings'' is +determined by a regular expression. + +@menu +* Specified Headings:: Showing headings that match regular expressions. +* C Function Headings:: Showing headings of C functions. +@end menu + +@node Specified Headings +@subsubsection Showing Lines That Match Regular Expressions +@cindex specified headings +@cindex regular expression matching headings + +To show in which sections differences occur for files that are not +source code for C or similar languages, use the +@option{--show-function-line=@var{regexp}} (@option{-F @var{regexp}}) option. +@command{diff} +considers lines that match the @command{grep}-style regular expression +@var{regexp} to be the beginning +of a section of the file. Here are suggested regular expressions for +some common languages: + +@c Please add to this list, e.g. Fortran, Pascal, Perl, Python. +@table @samp +@item ^[[:alpha:]$_] +C, C++, Prolog +@item ^( +Lisp +@item ^@@node +Texinfo +@end table + +This option does not automatically select an output format; in order to +use it, you must select the context format (@pxref{Context Format}) or +unified format (@pxref{Unified Format}). In other output formats it +has no effect. + +The @option{--show-function-line} (@option{-F}) option finds the nearest +unchanged line that precedes each hunk of differences and matches the +given regular expression. Then it adds that line to the end of the +line of asterisks in the context format, or to the @samp{@@@@} line in +unified format. If no matching line exists, this option leaves the output for +that hunk unchanged. If that line is more than 40 characters long, it +outputs only the first 40 characters. You can specify more than one +regular expression for such lines; @command{diff} tries to match each line +against each regular expression, starting with the last one given. This +means that you can use @option{-p} and @option{-F} together, if you wish. + +@node C Function Headings +@subsubsection Showing C Function Headings +@cindex C function headings +@cindex function headings, C + +To show in which functions differences occur for C and similar +languages, you can use the @option{--show-c-function} (@option{-p}) option. +This option automatically defaults to the context output format +(@pxref{Context Format}), with the default number of lines of context. +You can override that number with @option{-C @var{lines}} elsewhere in the +command line. You can override both the format and the number with +@option{-U @var{lines}} elsewhere in the command line. + +The @option{--show-c-function} (@option{-p}) option is equivalent to +@option{-F '^[[:alpha:]$_]'} if the unified format is specified, otherwise +@option{-c -F '^[[:alpha:]$_]'} (@pxref{Specified Headings}). GNU +@command{diff} provides this option for the sake of convenience. + +@node Alternate Names +@subsection Showing Alternate File Names +@cindex alternate file names +@cindex file name alternates + +If you are comparing two files that have meaningless or uninformative +names, you might want @command{diff} to show alternate names in the header +of the context and unified output formats. To do this, use the +@option{--label=@var{label}} option. The first time +you give this option, its argument replaces the name and date of the +first file in the header; the second time, its argument replaces the +name and date of the second file. If you give this option more than +twice, @command{diff} reports an error. The @option{--label} option does not +affect the file names in the @command{pr} header when the @option{-l} or +@option{--paginate} option is used (@pxref{Pagination}). + +Here are the first two lines of the output from @samp{diff -C 2 +--label=original --label=modified lao tzu}: + +@example +*** original +--- modified +@end example + +@node Side by Side +@section Showing Differences Side by Side +@cindex side by side +@cindex two-column output +@cindex columnar output + +@command{diff} can produce a side by side difference listing of two files. +The files are listed in two columns with a gutter between them. The +gutter contains one of the following markers: + +@table @asis +@item white space +The corresponding lines are in common. That is, either the lines are +identical, or the difference is ignored because of one of the +@option{--ignore} options (@pxref{White Space}). + +@item @samp{|} +The corresponding lines differ, and they are either both complete +or both incomplete. + +@item @samp{<} +The files differ and only the first file contains the line. + +@item @samp{>} +The files differ and only the second file contains the line. + +@item @samp{(} +Only the first file contains the line, but the difference is ignored. + +@item @samp{)} +Only the second file contains the line, but the difference is ignored. + +@item @samp{\} +The corresponding lines differ, and only the first line is incomplete. + +@item @samp{/} +The corresponding lines differ, and only the second line is incomplete. +@end table + +Normally, an output line is incomplete if and only if the lines that it +contains are incomplete. @xref{Incomplete Lines}. However, when an +output line represents two differing lines, one might be incomplete +while the other is not. In this case, the output line is complete, +but its the gutter is marked @samp{\} if the first line is incomplete, +@samp{/} if the second line is. + +Side by side format is sometimes easiest to read, but it has limitations. +It generates much wider output than usual, and truncates lines that are +too long to fit. Also, it relies on lining up output more heavily than +usual, so its output looks particularly bad if you use varying +width fonts, nonstandard tab stops, or nonprinting characters. + +You can use the @command{sdiff} command to interactively merge side by side +differences. @xref{Interactive Merging}, for more information on merging files. + +@menu +* Side by Side Format:: Controlling side by side output format. +* Example Side by Side:: Sample side by side output. +@end menu + +@node Side by Side Format +@subsection Controlling Side by Side Format +@cindex side by side format + +The @option{--side-by-side} (@option{-y}) option selects side by side +format. Because side by side output lines contain two input lines, the +output is wider than usual: normally 130 print columns, which can fit +onto a traditional printer line. You can set the width of the output +with the @option{--width=@var{columns}} (@option{-W @var{columns}}) +option. The output is split into two halves of equal width, separated by a +small gutter to mark differences; the right half is aligned to a tab +stop so that tabs line up. Input lines that are too long to fit in half +of an output line are truncated for output. + +The @option{--left-column} option prints only the left column of two +common lines. The @option{--suppress-common-lines} option suppresses +common lines entirely. + +@node Example Side by Side +@subsection An Example of Side by Side Format + +Here is the output of the command @samp{diff -y -W 72 lao tzu} +(@pxref{Sample diff Input}, for the complete contents of the two files). + +@example +The Way that can be told of is n < +The name that can be named is no < +The Nameless is the origin of He The Nameless is the origin of He +The Named is the mother of all t | The named is the mother of all t + > +Therefore let there always be no Therefore let there always be no + so we may see their subtlety, so we may see their subtlety, +And let there always be being, And let there always be being, + so we may see their outcome. so we may see their outcome. +The two are the same, The two are the same, +But after they are produced, But after they are produced, + they have different names. they have different names. + > They both may be called deep and + > Deeper and more profound, + > The door of all subtleties! +@end example + +@node Normal +@section Showing Differences Without Context +@cindex normal output format +@cindex @samp{<} output format + +The ``normal'' @command{diff} output format shows each hunk of differences +without any surrounding context. Sometimes such output is the clearest +way to see how lines have changed, without the clutter of nearby +unchanged lines (although you can get similar results with the context +or unified formats by using 0 lines of context). However, this format +is no longer widely used for sending out patches; for that purpose, the +context format (@pxref{Context Format}) and the unified format +(@pxref{Unified Format}) are superior. Normal format is the default for +compatibility with older versions of @command{diff} and the POSIX +standard. Use the @option{--normal} option to select this output +format explicitly. + +@menu +* Example Normal:: Sample output in the normal format. +* Detailed Normal:: A detailed description of normal output format. +@end menu + +@node Example Normal +@subsection An Example of Normal Format + +Here is the output of the command @samp{diff lao tzu} +(@pxref{Sample diff Input}, for the complete contents of the two files). +Notice that it shows only the lines that are different between the two +files. + +@example +1,2d0 +< The Way that can be told of is not the eternal Way; +< The name that can be named is not the eternal name. +4c2,3 +< The Named is the mother of all things. +--- +> The named is the mother of all things. +> @- +11a11,13 +> They both may be called deep and profound. +> Deeper and more profound, +> The door of all subtleties! +@end example + +@node Detailed Normal +@subsection Detailed Description of Normal Format + +The normal output format consists of one or more hunks of differences; +each hunk shows one area where the files differ. Normal format hunks +look like this: + +@example +@var{change-command} +< @var{from-file-line} +< @var{from-file-line}@dots{} +--- +> @var{to-file-line} +> @var{to-file-line}@dots{} +@end example + +There are three types of change commands. Each consists of a line +number or comma-separated range of lines in the first file, a single +character indicating the kind of change to make, and a line number or +comma-separated range of lines in the second file. All line numbers are +the original line numbers in each file. The types of change commands +are: + +@table @samp +@item @var{l}a@var{r} +Add the lines in range @var{r} of the second file after line @var{l} of +the first file. For example, @samp{8a12,15} means append lines 12--15 +of file 2 after line 8 of file 1; or, if changing file 2 into file 1, +delete lines 12--15 of file 2. + +@item @var{f}c@var{t} +Replace the lines in range @var{f} of the first file with lines in range +@var{t} of the second file. This is like a combined add and delete, but +more compact. For example, @samp{5,7c8,10} means change lines 5--7 of +file 1 to read as lines 8--10 of file 2; or, if changing file 2 into +file 1, change lines 8--10 of file 2 to read as lines 5--7 of file 1. + +@item @var{r}d@var{l} +Delete the lines in range @var{r} from the first file; line @var{l} is where +they would have appeared in the second file had they not been deleted. +For example, @samp{5,7d3} means delete lines 5--7 of file 1; or, if +changing file 2 into file 1, append lines 5--7 of file 1 after line 3 of +file 2. +@end table + +@node Scripts +@section Making Edit Scripts +@cindex script output formats + +Several output modes produce command scripts for editing @var{from-file} +to produce @var{to-file}. + +@menu +* ed Scripts:: Using @command{diff} to produce commands for @command{ed}. +* Forward ed:: Making forward @command{ed} scripts. +* RCS:: A special @command{diff} output format used by RCS. +@end menu + +@node ed Scripts +@subsection @command{ed} Scripts +@cindex @command{ed} script output format + +@command{diff} can produce commands that direct the @command{ed} text editor +to change the first file into the second file. Long ago, this was the +only output mode that was suitable for editing one file into another +automatically; today, with @command{patch}, it is almost obsolete. Use the +@option{--ed} (@option{-e}) option to select this output format. + +Like the normal format (@pxref{Normal}), this output format does not +show any context; unlike the normal format, it does not include the +information necessary to apply the diff in reverse (to produce the first +file if all you have is the second file and the diff). + +If the file @file{d} contains the output of @samp{diff -e old new}, then +the command @samp{(cat d && echo w) | ed - old} edits @file{old} to make +it a copy of @file{new}. More generally, if @file{d1}, @file{d2}, +@dots{}, @file{dN} contain the outputs of @samp{diff -e old new1}, +@samp{diff -e new1 new2}, @dots{}, @samp{diff -e newN-1 newN}, +respectively, then the command @samp{(cat d1 d2 @dots{} dN && echo w) | +ed - old} edits @file{old} to make it a copy of @file{newN}. + +@menu +* Example ed:: A sample @command{ed} script. +* Detailed ed:: A detailed description of @command{ed} format. +@end menu + +@node Example ed +@subsubsection Example @command{ed} Script + +Here is the output of @samp{diff -e lao tzu} (@pxref{Sample +diff Input}, for the complete contents of the two files): + +@example +11a +They both may be called deep and profound. +Deeper and more profound, +The door of all subtleties! +. +4c +The named is the mother of all things. + +. +1,2d +@end example + +@node Detailed ed +@subsubsection Detailed Description of @command{ed} Format + +The @command{ed} output format consists of one or more hunks of +differences. The changes closest to the ends of the files come first so +that commands that change the number of lines do not affect how +@command{ed} interprets line numbers in succeeding commands. @command{ed} +format hunks look like this: + +@example +@var{change-command} +@var{to-file-line} +@var{to-file-line}@dots{} +. +@end example + +Because @command{ed} uses a single period on a line to indicate the +end of input, GNU @command{diff} protects lines of changes +that contain a single period on a line by writing two periods instead, +then writing a subsequent @command{ed} command to change the two +periods into one. The @command{ed} format cannot represent an +incomplete line, so if the second file ends in a changed incomplete +line, @command{diff} reports an error and then pretends that a newline +was appended. + +There are three types of change commands. Each consists of a line +number or comma-separated range of lines in the first file and a single +character indicating the kind of change to make. All line numbers are +the original line numbers in the file. The types of change commands +are: + +@table @samp +@item @var{l}a +Add text from the second file after line @var{l} in the first file. For +example, @samp{8a} means to add the following lines after line 8 of file +1. + +@item @var{r}c +Replace the lines in range @var{r} in the first file with the following +lines. Like a combined add and delete, but more compact. For example, +@samp{5,7c} means change lines 5--7 of file 1 to read as the text file +2. + +@item @var{r}d +Delete the lines in range @var{r} from the first file. For example, +@samp{5,7d} means delete lines 5--7 of file 1. +@end table + +@node Forward ed +@subsection Forward @command{ed} Scripts +@cindex forward @command{ed} script output format + +@command{diff} can produce output that is like an @command{ed} script, but +with hunks in forward (front to back) order. The format of the commands +is also changed slightly: command characters precede the lines they +modify, spaces separate line numbers in ranges, and no attempt is made +to disambiguate hunk lines consisting of a single period. Like +@command{ed} format, forward @command{ed} format cannot represent incomplete +lines. + +Forward @command{ed} format is not very useful, because neither @command{ed} +nor @command{patch} can apply diffs in this format. It exists mainly for +compatibility with older versions of @command{diff}. Use the @option{-f} or +@option{--forward-ed} option to select it. + +@node RCS +@subsection RCS Scripts +@cindex RCS script output format + +The RCS output format is designed specifically for use by +the Revision Control System, which is a set of free programs used for +organizing different versions and systems of files. Use the +@option{--rcs} (@option{-n}) option to select this output format. It +is like the forward @command{ed} format (@pxref{Forward ed}), but it +can represent arbitrary changes to the contents of a file because it +avoids the forward @command{ed} format's problems with lines +consisting of a single period and with incomplete lines. Instead of +ending text sections with a line consisting of a single period, each +command specifies the number of lines it affects; a combination of the +@samp{a} and @samp{d} commands are used instead of @samp{c}. Also, if +the second file ends in a changed incomplete line, then the output +also ends in an incomplete line. + +Here is the output of @samp{diff -n lao tzu} (@pxref{Sample +diff Input}, for the complete contents of the two files): + +@example +d1 2 +d4 1 +a4 2 +The named is the mother of all things. + +a11 3 +They both may be called deep and profound. +Deeper and more profound, +The door of all subtleties! +@end example + +@node If-then-else +@section Merging Files with If-then-else +@cindex merged output format +@cindex if-then-else output format +@cindex C if-then-else output format +@cindex @command{ifdef} output format + +You can use @command{diff} to merge two files of C source code. The output +of @command{diff} in this format contains all the lines of both files. +Lines common to both files are output just once; the differing parts are +separated by the C preprocessor directives @code{#ifdef @var{name}} or +@code{#ifndef @var{name}}, @code{#else}, and @code{#endif}. When +compiling the output, you select which version to use by either defining +or leaving undefined the macro @var{name}. + +To merge two files, use @command{diff} with the @option{-D @var{name}} or +@option{--ifdef=@var{name}} option. The argument @var{name} is the C +preprocessor identifier to use in the @code{#ifdef} and @code{#ifndef} +directives. + +For example, if you change an instance of @code{wait (&s)} to +@code{waitpid (-1, &s, 0)} and then merge the old and new files with +the @option{--ifdef=HAVE_WAITPID} option, then the affected part of your code +might look like this: + +@example + do @{ +#ifndef HAVE_WAITPID + if ((w = wait (&s)) < 0 && errno != EINTR) +#else /* HAVE_WAITPID */ + if ((w = waitpid (-1, &s, 0)) < 0 && errno != EINTR) +#endif /* HAVE_WAITPID */ + return w; + @} while (w != child); +@end example + +You can specify formats for languages other than C by using line group +formats and line formats, as described in the next sections. + +@menu +* Line Group Formats:: Formats for general if-then-else line groups. +* Line Formats:: Formats for each line in a line group. +* Example If-then-else:: Sample if-then-else format output. +* Detailed If-then-else:: A detailed description of if-then-else format. +@end menu + +@node Line Group Formats +@subsection Line Group Formats +@cindex line group formats +@cindex formats for if-then-else line groups + +Line group formats let you specify formats suitable for many +applications that allow if-then-else input, including programming +languages and text formatting languages. A line group format specifies +the output format for a contiguous group of similar lines. + +For example, the following command compares the TeX files @file{old} +and @file{new}, and outputs a merged file in which old regions are +surrounded by @samp{\begin@{em@}}-@samp{\end@{em@}} lines, and new +regions are surrounded by @samp{\begin@{bf@}}-@samp{\end@{bf@}} lines. + +@example +diff \ + --old-group-format='\begin@{em@} +%<\end@{em@} +' \ + --new-group-format='\begin@{bf@} +%>\end@{bf@} +' \ + old new +@end example + +The following command is equivalent to the above example, but it is a +little more verbose, because it spells out the default line group formats. + +@example +diff \ + --old-group-format='\begin@{em@} +%<\end@{em@} +' \ + --new-group-format='\begin@{bf@} +%>\end@{bf@} +' \ + --unchanged-group-format='%=' \ + --changed-group-format='\begin@{em@} +%<\end@{em@} +\begin@{bf@} +%>\end@{bf@} +' \ + old new +@end example + +Here is a more advanced example, which outputs a diff listing with +headers containing line numbers in a ``plain English'' style. + +@example +diff \ + --unchanged-group-format='' \ + --old-group-format='-------- %dn line%(n=1?:s) deleted at %df: +%<' \ + --new-group-format='-------- %dN line%(N=1?:s) added after %de: +%>' \ + --changed-group-format='-------- %dn line%(n=1?:s) changed at %df: +%<-------- to: +%>' \ + old new +@end example + +To specify a line group format, use @command{diff} with one of the options +listed below. You can specify up to four line group formats, one for +each kind of line group. You should quote @var{format}, because it +typically contains shell metacharacters. + +@table @option +@item --old-group-format=@var{format} +These line groups are hunks containing only lines from the first file. +The default old group format is the same as the changed group format if +it is specified; otherwise it is a format that outputs the line group as-is. + +@item --new-group-format=@var{format} +These line groups are hunks containing only lines from the second +file. The default new group format is same as the changed group +format if it is specified; otherwise it is a format that outputs the +line group as-is. + +@item --changed-group-format=@var{format} +These line groups are hunks containing lines from both files. The +default changed group format is the concatenation of the old and new +group formats. + +@item --unchanged-group-format=@var{format} +These line groups contain lines common to both files. The default +unchanged group format is a format that outputs the line group as-is. +@end table + +In a line group format, ordinary characters represent themselves; +conversion specifications start with @samp{%} and have one of the +following forms. + +@table @samp +@item %< +stands for the lines from the first file, including the trailing newline. +Each line is formatted according to the old line format (@pxref{Line Formats}). + +@item %> +stands for the lines from the second file, including the trailing newline. +Each line is formatted according to the new line format. + +@item %= +stands for the lines common to both files, including the trailing newline. +Each line is formatted according to the unchanged line format. + +@item %% +stands for @samp{%}. + +@item %c'@var{C}' +where @var{C} is a single character, stands for @var{C}. +@var{C} may not be a backslash or an apostrophe. +For example, @samp{%c':'} stands for a colon, even inside +the then-part of an if-then-else format, which a colon would +normally terminate. + +@item %c'\@var{O}' +where @var{O} is a string of 1, 2, or 3 octal digits, +stands for the character with octal code @var{O}. +For example, @samp{%c'\0'} stands for a null character. + +@item @var{F}@var{n} +where @var{F} is a @code{printf} conversion specification and @var{n} is one +of the following letters, stands for @var{n}'s value formatted with @var{F}. + +@table @samp +@item e +The line number of the line just before the group in the old file. + +@item f +The line number of the first line in the group in the old file; +equals @var{e} + 1. + +@item l +The line number of the last line in the group in the old file. + +@item m +The line number of the line just after the group in the old file; +equals @var{l} + 1. + +@item n +The number of lines in the group in the old file; equals @var{l} - @var{f} + 1. + +@item E, F, L, M, N +Likewise, for lines in the new file. + +@end table + +@vindex LC_NUMERIC +The @code{printf} conversion specification can be @samp{%d}, +@samp{%o}, @samp{%x}, or @samp{%X}, specifying decimal, octal, +lower case hexadecimal, or upper case hexadecimal output +respectively. After the @samp{%} the following options can appear in +sequence: a series of zero or more flags; an integer +specifying the minimum field width; and a period followed by an +optional integer specifying the minimum number of digits. +The flags are @samp{-} for left-justification, @samp{'} for separating +the digit into groups as specified by the @env{LC_NUMERIC} locale category, +and @samp{0} for padding with zeros instead of spaces. +For example, @samp{%5dN} prints the number of new lines in the group +in a field of width 5 characters, using the @code{printf} format @code{"%5d"}. + +@item (@var{A}=@var{B}?@var{T}:@var{E}) +If @var{A} equals @var{B} then @var{T} else @var{E}. +@var{A} and @var{B} are each either a decimal constant +or a single letter interpreted as above. +This format spec is equivalent to @var{T} if +@var{A}'s value equals @var{B}'s; otherwise it is equivalent to @var{E}. + +For example, @samp{%(N=0?no:%dN) line%(N=1?:s)} is equivalent to +@samp{no lines} if @var{N} (the number of lines in the group in the +new file) is 0, to @samp{1 line} if @var{N} is 1, and to @samp{%dN lines} +otherwise. +@end table + +@node Line Formats +@subsection Line Formats +@cindex line formats + +Line formats control how each line taken from an input file is +output as part of a line group in if-then-else format. + +For example, the following command outputs text with a one-character +change indicator to the left of the text. The first character of output +is @samp{-} for deleted lines, @samp{|} for added lines, and a space for +unchanged lines. The formats contain newline characters where newlines +are desired on output. + +@example +diff \ + --old-line-format='-%l +' \ + --new-line-format='|%l +' \ + --unchanged-line-format=' %l +' \ + old new +@end example + +To specify a line format, use one of the following options. You should +quote @var{format}, since it often contains shell metacharacters. + +@table @option +@item --old-line-format=@var{format} +formats lines just from the first file. + +@item --new-line-format=@var{format} +formats lines just from the second file. + +@item --unchanged-line-format=@var{format} +formats lines common to both files. + +@item --line-format=@var{format} +formats all lines; in effect, it sets all three above options simultaneously. +@end table + +In a line format, ordinary characters represent themselves; +conversion specifications start with @samp{%} and have one of the +following forms. + +@table @samp +@item %l +stands for the contents of the line, not counting its trailing +newline (if any). This format ignores whether the line is incomplete; +@xref{Incomplete Lines}. + +@item %L +stands for the contents of the line, including its trailing newline +(if any). If a line is incomplete, this format preserves its +incompleteness. + +@item %% +stands for @samp{%}. + +@item %c'@var{C}' +where @var{C} is a single character, stands for @var{C}. +@var{C} may not be a backslash or an apostrophe. +For example, @samp{%c':'} stands for a colon. + +@item %c'\@var{O}' +where @var{O} is a string of 1, 2, or 3 octal digits, +stands for the character with octal code @var{O}. +For example, @samp{%c'\0'} stands for a null character. + +@item @var{F}n +where @var{F} is a @code{printf} conversion specification, +stands for the line number formatted with @var{F}. +For example, @samp{%.5dn} prints the line number using the +@code{printf} format @code{"%.5d"}. @xref{Line Group Formats}, for +more about printf conversion specifications. + +@end table + +The default line format is @samp{%l} followed by a newline character. + +If the input contains tab characters and it is important that they line +up on output, you should ensure that @samp{%l} or @samp{%L} in a line +format is just after a tab stop (e.g.@: by preceding @samp{%l} or +@samp{%L} with a tab character), or you should use the @option{-t} or +@option{--expand-tabs} option. + +Taken together, the line and line group formats let you specify many +different formats. For example, the following command uses a format +similar to normal @command{diff} format. You can tailor this command +to get fine control over @command{diff} output. + +@example +diff \ + --old-line-format='< %l +' \ + --new-line-format='> %l +' \ + --old-group-format='%df%(f=l?:,%dl)d%dE +%<' \ + --new-group-format='%dea%dF%(F=L?:,%dL) +%>' \ + --changed-group-format='%df%(f=l?:,%dl)c%dF%(F=L?:,%dL) +%<--- +%>' \ + --unchanged-group-format='' \ + old new +@end example + +@node Example If-then-else +@subsection An Example of If-then-else Format + +Here is the output of @samp{diff -DTWO lao tzu} (@pxref{Sample +diff Input}, for the complete contents of the two files): + +@example +#ifndef TWO +The Way that can be told of is not the eternal Way; +The name that can be named is not the eternal name. +#endif /* ! TWO */ +The Nameless is the origin of Heaven and Earth; +#ifndef TWO +The Named is the mother of all things. +#else /* TWO */ +The named is the mother of all things. + +#endif /* TWO */ +Therefore let there always be non-being, + so we may see their subtlety, +And let there always be being, + so we may see their outcome. +The two are the same, +But after they are produced, + they have different names. +#ifdef TWO +They both may be called deep and profound. +Deeper and more profound, +The door of all subtleties! +#endif /* TWO */ +@end example + +@node Detailed If-then-else +@subsection Detailed Description of If-then-else Format + +For lines common to both files, @command{diff} uses the unchanged line +group format. For each hunk of differences in the merged output +format, if the hunk contains only lines from the first file, +@command{diff} uses the old line group format; if the hunk contains only +lines from the second file, @command{diff} uses the new group format; +otherwise, @command{diff} uses the changed group format. + +The old, new, and unchanged line formats specify the output format of +lines from the first file, lines from the second file, and lines common +to both files, respectively. + +The option @option{--ifdef=@var{name}} is equivalent to +the following sequence of options using shell syntax: + +@example +--old-group-format='#ifndef @var{name} +%<#endif /* ! @var{name} */ +' \ +--new-group-format='#ifdef @var{name} +%>#endif /* @var{name} */ +' \ +--unchanged-group-format='%=' \ +--changed-group-format='#ifndef @var{name} +%<#else /* @var{name} */ +%>#endif /* @var{name} */ +' +@end example + +You should carefully check the @command{diff} output for proper nesting. +For example, when using the @option{-D @var{name}} or +@option{--ifdef=@var{name}} option, you should check that if the +differing lines contain any of the C preprocessor directives +@samp{#ifdef}, @samp{#ifndef}, @samp{#else}, @samp{#elif}, or +@samp{#endif}, they are nested properly and match. If they don't, you +must make corrections manually. It is a good idea to carefully check +the resulting code anyway to make sure that it really does what you +want it to; depending on how the input files were produced, the output +might contain duplicate or otherwise incorrect code. + +The @command{patch} @option{-D @var{name}} option behaves like +the @command{diff} @option{-D @var{name}} option, except it operates on +a file and a diff to produce a merged file. @xref{patch Options}. + +@node Incomplete Lines +@chapter Incomplete Lines +@cindex incomplete lines +@cindex full lines +@cindex newline treatment by @command{diff} + +When an input file ends in a non-newline character, its last line is +called an @dfn{incomplete line} because its last character is not a +newline. All other lines are called @dfn{full lines} and end in a +newline character. Incomplete lines do not match full lines unless +differences in white space are ignored (@pxref{White Space}). + +An incomplete line is normally distinguished on output from a full +line by a following line that starts with @samp{\}. However, the +RCS format (@pxref{RCS}) outputs the incomplete line as-is, +without any trailing newline or following line. The side by side +format normally represents incomplete lines as-is, but in some cases +uses a @samp{\} or @samp{/} gutter marker. @xref{Side by Side}. The +if-then-else line format preserves a line's incompleteness with +@samp{%L}, and discards the newline with @samp{%l}. @xref{Line Formats}. +Finally, with the @command{ed} and forward @command{ed} +output formats (@pxref{Output Formats}) @command{diff} cannot +represent an incomplete line, so it pretends there was a newline and +reports an error. + +For example, suppose @file{F} and @file{G} are one-byte files that +contain just @samp{f} and @samp{g}, respectively. Then @samp{diff F G} +outputs + +@example +1c1 +< f +\ No newline at end of file +--- +> g +\ No newline at end of file +@end example + +@noindent +(The exact message may differ in non-English locales.) +@samp{diff -n F G} outputs the following without a trailing newline: + +@example +d1 1 +a1 1 +g +@end example + +@noindent +@samp{diff -e F G} reports two errors and outputs the following: + +@example +1c +g +. +@end example + +@node Comparing Directories +@chapter Comparing Directories + +@vindex LC_COLLATE +You can use @command{diff} to compare some or all of the files in two +directory trees. When both file name arguments to @command{diff} are +directories, it compares each file that is contained in both +directories, examining file names in alphabetical order as specified by +the @env{LC_COLLATE} locale category. Normally +@command{diff} is silent about pairs of files that contain no differences, +but if you use the @option{--report-identical-files} (@option{-s}) option, +it reports pairs of identical files. Normally @command{diff} reports +subdirectories common to both directories without comparing +subdirectories' files, but if you use the @option{-r} or +@option{--recursive} option, it compares every corresponding pair of files +in the directory trees, as many levels deep as they go. + +If only one file exists, @command{diff} normally does not show its +contents; it merely reports that one file exists but the other does +not. You can make @command{diff} act as though the missing file is +empty, so that it outputs the entire contents of the file that +actually exists. (It is output as either an insertion or a +deletion, depending on whether the missing file is in the first or the +second position.) To do this, use the @option{--new-file} +(@option{-N}) option. This option affects command-line arguments as +well as files found via directory traversal; for example, @samp{diff +-N a b} treats @file{a} as empty if @file{a} does not exist but +@file{b} does, and similarly @samp{diff -N - b} treats standard input +as empty if it is closed but @file{b} exists. + +If the older directory contains large files that are not in +the newer directory, you can make the patch smaller by using the +@option{--unidirectional-new-file} option instead of @option{-N}. +This option is like @option{-N} except that it inserts the contents only +of files that appear in the second directory but not the first (that is, +files that were added). At the top of the patch, write instructions for +the user applying the patch to remove the files that were deleted before +applying the patch. @xref{Making Patches}, for more discussion of +making patches for distribution. + +To ignore some files while comparing directories, use the +@option{--exclude=@var{pattern}} (@option{-x @var{pattern}}) option. +This option +ignores any files or subdirectories whose base names match the shell +pattern @var{pattern}. Unlike in the shell, a period at the start of +the base of a file name matches a wildcard at the start of a pattern. +You should enclose @var{pattern} in quotes so that the shell does not +expand it. For example, the option @option{-x '*.[ao]'} ignores any file +whose name ends with @samp{.a} or @samp{.o}. + +This option accumulates if you specify it more than once. For example, +using the options @option{-x 'RCS' -x '*,v'} ignores any file or +subdirectory whose base name is @samp{RCS} or ends with @samp{,v}. + +If you need to give this option many times, you can instead put the +patterns in a file, one pattern per line, and use the +@option{--exclude-from=@var{file}} (@option{-X @var{file}}) option. +Trailing white space and empty lines are ignored in the pattern file. + +If you have been comparing two directories and stopped partway through, +later you might want to continue where you left off. You can do this by +using the @option{--starting-file=@var{file}} (@option{-S @var{file}}) +option. This compares only the file @var{file} and all alphabetically +later files in the topmost directory level. + +If two directories differ only in that file names are lower case in +one directory and upper case in the upper, @command{diff} normally +reports many differences because it compares file names in a +case sensitive way. With the @option{--ignore-file-name-case} option, +@command{diff} ignores case differences in file names, so that for example +the contents of the file @file{Tao} in one directory are compared to +the contents of the file @file{TAO} in the other. The +@option{--no-ignore-file-name-case} option cancels the effect of the +@option{--ignore-file-name-case} option, reverting to the default +behavior. + +If an @option{--exclude=@var{pattern}} (@option{-x @var{pattern}}) option, +or an @option{--exclude-from=@var{file}} (@option{-X @var{file}}) option, +is specified while the @option{--ignore-file-name-case} option is in +effect, case is ignored when excluding file names matching the +specified patterns. + +To tell @command{diff} not to follow a symbolic link, use the +@c later: @option{--no-dereference} (@option{-P}). +@option{--no-dereference} option. + +@node Adjusting Output +@chapter Making @command{diff} Output Prettier + +@command{diff} provides several ways to adjust the appearance of its output. +These adjustments can be applied to any output format. + +@menu +* Tabs:: Preserving the alignment of tab stops. +* Trailing Blanks:: Suppressing blanks before empty output lines. +* Pagination:: Page numbering and time-stamping @command{diff} output. +@end menu + +@node Tabs +@section Preserving Tab Stop Alignment +@cindex tab stop alignment +@cindex aligning tab stops + +The lines of text in some of the @command{diff} output formats are +preceded by one or two characters that indicate whether the text is +inserted, deleted, or changed. The addition of those characters can +cause tabs to move to the next tab stop, throwing off the alignment of +columns in the line. GNU @command{diff} provides two ways +to make tab-aligned columns line up correctly. + +The first way is to have @command{diff} convert all tabs into the correct +number of spaces before outputting them; select this method with the +@option{--expand-tabs} (@option{-t}) option. To use this form of output with +@command{patch}, you must give @command{patch} the @option{-l} or +@option{--ignore-white-space} option (@pxref{Changed White Space}, for more +information). @command{diff} normally assumes that tab stops are set +every 8 print columns, but this can be altered by the +@option{--tabsize=@var{columns}} option. + +The other method for making tabs line up correctly is to add a tab +character instead of a space after the indicator character at the +beginning of the line. This ensures that all following tab characters +are in the same position relative to tab stops that they were in the +original files, so that the output is aligned correctly. Its +disadvantage is that it can make long lines too long to fit on one line +of the screen or the paper. It also does not work with the unified +output format, which does not have a space character after the change +type indicator character. Select this method with the @option{-T} or +@option{--initial-tab} option. + +@node Trailing Blanks +@section Omitting trailing blanks +@cindex trailing blanks +When outputting lines in normal or context format, or outputting an +unchanged line in unified format, @command{diff} normally outputs a +blank just before each line. If the line is empty, the output of +@command{diff} therefore contains trailing blanks even though the +input does not contain them. For example, when outputting an +unchanged empty line in context format, @command{diff} normally +outputs a line with two leading spaces. + +Some text editors and email agents routinely delete trailing blanks, +so it can be a problem to deal with diff output files that contain +them. You can avoid this problem with the +@option{--suppress-blank-empty} option. It causes @command{diff} to +omit trailing blanks at the end of output lines in normal, context, +and unified format, unless the trailing blanks were already present in +the input. This changes the output format slightly, so that output +lines are guaranteed to never end in a blank unless an input line ends +in a blank. This format is less likely to be munged by text editors +or by transmission via email. It is accepted by GNU +@command{patch} as well. + +@node Pagination +@section Paginating @command{diff} Output +@cindex paginating @command{diff} output + +It can be convenient to have long output page-numbered and time-stamped. +The @option{--paginate} (@option{-l}) option does this by sending the +@command{diff} output through the @command{pr} program. Here is what the page +header might look like for @samp{diff -lc lao tzu}: + +@example +2002-02-22 14:20 diff -lc lao tzu Page 1 +@end example + +@node diff Performance +@chapter @command{diff} Performance Tradeoffs +@cindex performance of @command{diff} + +GNU @command{diff} runs quite efficiently; however, in some +circumstances you can cause it to run faster or produce a more compact +set of changes. + +One way to improve @command{diff} performance is to use hard or +symbolic links to files instead of copies. This improves performance +because @command{diff} normally does not need to read two hard or +symbolic links to the same file, since their contents must be +identical. For example, suppose you copy a large directory hierarchy, +make a few changes to the copy, and then often use @samp{diff -r} to +compare the original to the copy. If the original files are +read-only, you can greatly improve performance by creating the copy +using hard or symbolic links (e.g., with GNU @samp{cp -lR} or +@samp{cp -sR}). Before editing a file in the copy for the first time, +you should break the link and replace it with a regular copy. + +You can also affect the performance of GNU @command{diff} by +giving it options that change the way it compares files. +Performance has more than one dimension. These options improve one +aspect of performance at the cost of another, or they improve +performance in some cases while hurting it in others. + +The way that GNU @command{diff} determines which lines have +changed always comes up with a near-minimal set of differences. +Usually it is good enough for practical purposes. If the +@command{diff} output is large, you might want @command{diff} to use a +modified algorithm that sometimes produces a smaller set of +differences. The @option{--minimal} (@option{-d}) option does this; +however, it can also cause @command{diff} to run more slowly than +usual, so it is not the default behavior. + +When the files you are comparing are large and have small groups of +changes scattered throughout them, you can use the +@option{--speed-large-files} option to make a different modification to +the algorithm that @command{diff} uses. If the input files have a constant +small density of changes, this option speeds up the comparisons without +changing the output. If not, @command{diff} might produce a larger set of +differences; however, the output will still be correct. + +Normally @command{diff} discards the prefix and suffix that is common to +both files before it attempts to find a minimal set of differences. +This makes @command{diff} run faster, but occasionally it may produce +non-minimal output. The @option{--horizon-lines=@var{lines}} option +prevents @command{diff} from discarding the last @var{lines} lines of the +prefix and the first @var{lines} lines of the suffix. This gives +@command{diff} further opportunities to find a minimal output. + +Suppose a run of changed lines includes a sequence of lines at one end +and there is an identical sequence of lines just outside the other end. +The @command{diff} command is free to choose which identical sequence is +included in the hunk. In this case, @command{diff} normally shifts the +hunk's boundaries when this merges adjacent hunks, or shifts a hunk's +lines towards the end of the file. Merging hunks can make the output +look nicer in some cases. + +@node Comparing Three Files +@chapter Comparing Three Files +@cindex comparing three files +@cindex format of @command{diff3} output + +Use the program @command{diff3} to compare three files and show any +differences among them. (@command{diff3} can also merge files; see +@ref{diff3 Merging}). + +The ``normal'' @command{diff3} output format shows each hunk of +differences without surrounding context. Hunks are labeled depending +on whether they are two-way or three-way, and lines are annotated by +their location in the input files. + +@xref{Invoking diff3}, for more information on how to run @command{diff3}. + +@menu +* Sample diff3 Input:: Sample @command{diff3} input for examples. +* Example diff3 Normal:: Sample output in the normal format. +* Detailed diff3 Normal:: A detailed description of normal output format. +* diff3 Hunks:: The format of normal output format. +@end menu + +@node Sample diff3 Input +@section A Third Sample Input File +@cindex @command{diff3} sample input +@cindex sample input for @command{diff3} + +Here is a third sample file that will be used in examples to illustrate +the output of @command{diff3} and how various options can change it. The +first two files are the same that we used for @command{diff} (@pxref{Sample +diff Input}). This is the third sample file, called @file{tao}: + +@example +The Way that can be told of is not the eternal Way; +The name that can be named is not the eternal name. +The Nameless is the origin of Heaven and Earth; +The named is the mother of all things. + +Therefore let there always be non-being, + so we may see their subtlety, +And let there always be being, + so we may see their result. +The two are the same, +But after they are produced, + they have different names. + + -- The Way of Lao-Tzu, tr. Wing-tsit Chan +@end example + +@node Example diff3 Normal +@section An Example of @command{diff3} Normal Format + +Here is the output of the command @samp{diff3 lao tzu tao} +(@pxref{Sample diff3 Input}, for the complete contents of the files). +Notice that it shows only the lines that are different among the three +files. + +@example +====2 +1:1,2c +3:1,2c + The Way that can be told of is not the eternal Way; + The name that can be named is not the eternal name. +2:0a +====1 +1:4c + The Named is the mother of all things. +2:2,3c +3:4,5c + The named is the mother of all things. + @- +====3 +1:8c +2:7c + so we may see their outcome. +3:9c + so we may see their result. +==== +1:11a +2:11,13c + They both may be called deep and profound. + Deeper and more profound, + The door of all subtleties! +3:13,14c + @- + -- The Way of Lao-Tzu, tr. Wing-tsit Chan +@end example + +@node Detailed diff3 Normal +@section Detailed Description of @command{diff3} Normal Format + +Each hunk begins with a line marked @samp{====}. Three-way hunks have +plain @samp{====} lines, and two-way hunks have @samp{1}, @samp{2}, or +@samp{3} appended to specify which of the three input files differ in +that hunk. The hunks contain copies of two or three sets of input +lines each preceded by one or two commands identifying where the lines +came from. + +Normally, two spaces precede each copy of an input line to distinguish +it from the commands. But with the @option{--initial-tab} (@option{-T}) +option, @command{diff3} uses a tab instead of two spaces; this lines up +tabs correctly. @xref{Tabs}, for more information. + +Commands take the following forms: + +@table @samp +@item @var{file}:@var{l}a +This hunk appears after line @var{l} of file @var{file}, and +contains no lines in that file. To edit this file to yield the other +files, one must append hunk lines taken from the other files. For +example, @samp{1:11a} means that the hunk follows line 11 in the first +file and contains no lines from that file. + +@item @var{file}:@var{r}c +This hunk contains the lines in the range @var{r} of file @var{file}. +The range @var{r} is a comma-separated pair of line numbers, or just one +number if there is only one line. To edit this file to yield the +other files, one must change the specified lines to be the lines taken +from the other files. For example, @samp{2:11,13c} means that the hunk +contains lines 11 through 13 from the second file. +@end table + +If the last line in a set of input lines is incomplete +(@pxref{Incomplete Lines}), it is distinguished on output from a full +line by a following line that starts with @samp{\}. + +@node diff3 Hunks +@section @command{diff3} Hunks +@cindex hunks for @command{diff3} +@cindex @command{diff3} hunks + +Groups of lines that differ in two or three of the input files are +called @dfn{diff3 hunks}, by analogy with @command{diff} hunks +(@pxref{Hunks}). If all three input files differ in a @command{diff3} +hunk, the hunk is called a @dfn{three-way hunk}; if just two input files +differ, it is a @dfn{two-way hunk}. + +As with @command{diff}, several solutions are possible. When comparing the +files @samp{A}, @samp{B}, and @samp{C}, @command{diff3} normally finds +@command{diff3} hunks by merging the two-way hunks output by the two +commands @samp{diff A B} and @samp{diff A C}. This does not necessarily +minimize the size of the output, but exceptions should be rare. + +For example, suppose @file{F} contains the three lines @samp{a}, +@samp{b}, @samp{f}, @file{G} contains the lines @samp{g}, @samp{b}, +@samp{g}, and @file{H} contains the lines @samp{a}, @samp{b}, +@samp{h}. @samp{diff3 F G H} might output the following: + +@example +====2 +1:1c +3:1c + a +2:1c + g +==== +1:3c + f +2:3c + g +3:3c + h +@end example + +@noindent +because it found a two-way hunk containing @samp{a} in the first and +third files and @samp{g} in the second file, then the single line +@samp{b} common to all three files, then a three-way hunk containing +the last line of each file. + +@node diff3 Merging +@chapter Merging From a Common Ancestor +@cindex merging from a common ancestor + +When two people have made changes to copies of the same file, +@command{diff3} can produce a merged output that contains both sets of +changes together with warnings about conflicts. + +One might imagine programs with names like @command{diff4} and @command{diff5} +to compare more than three files simultaneously, but in practice the +need rarely arises. You can use @command{diff3} to merge three or more +sets of changes to a file by merging two change sets at a time. + +@command{diff3} can incorporate changes from two modified versions into a +common preceding version. This lets you merge the sets of changes +represented by the two newer files. Specify the common ancestor version +as the second argument and the two newer versions as the first and third +arguments, like this: + +@example +diff3 @var{mine} @var{older} @var{yours} +@end example + +@noindent +You can remember the order of the arguments by noting that they are in +alphabetical order. + +@cindex conflict +@cindex overlap +You can think of this as subtracting @var{older} from @var{yours} and +adding the result to @var{mine}, or as merging into @var{mine} the +changes that would turn @var{older} into @var{yours}. This merging is +well-defined as long as @var{mine} and @var{older} match in the +neighborhood of each such change. This fails to be true when all three +input files differ or when only @var{older} differs; we call this +a @dfn{conflict}. When all three input files differ, we call the +conflict an @dfn{overlap}. + +@command{diff3} gives you several ways to handle overlaps and conflicts. +You can omit overlaps or conflicts, or select only overlaps, +or mark conflicts with special @samp{<<<<<<<} and @samp{>>>>>>>} lines. + +@command{diff3} can output the merge results as an @command{ed} script that +that can be applied to the first file to yield the merged output. +However, it is usually better to have @command{diff3} generate the merged +output directly; this bypasses some problems with @command{ed}. + +@menu +* Which Changes:: Selecting changes to incorporate. +* Marking Conflicts:: Marking conflicts. +* Bypassing ed:: Generating merged output directly. +* Merging Incomplete Lines:: How @command{diff3} merges incomplete lines. +* Saving the Changed File:: Emulating System V behavior. +@end menu + +@node Which Changes +@section Selecting Which Changes to Incorporate +@cindex overlapping change, selection of +@cindex unmerged change + +You can select all unmerged changes from @var{older} to @var{yours} for merging +into @var{mine} with the @option{--ed} (@option{-e}) option. You can +select only the nonoverlapping unmerged changes with +@option{--easy-only} (@option{-3}), +and you can select only the overlapping changes with +@option{--overlap-only} (@option{-x}). + +The @option{-e}, @option{-3} and @option{-x} options select only +@dfn{unmerged changes}, i.e.@: changes where @var{mine} and @var{yours} +differ; they ignore changes from @var{older} to @var{yours} where +@var{mine} and @var{yours} are identical, because they assume that such +changes have already been merged. If this assumption is not a safe +one, you can use the @option{--show-all} (@option{-A}) option +(@pxref{Marking Conflicts}). + +Here is the output of the command @command{diff3} with each of these three +options (@pxref{Sample diff3 Input}, for the complete contents of the files). +Notice that @option{-e} outputs the union of the disjoint sets of changes +output by @option{-3} and @option{-x}. + +Output of @samp{diff3 -e lao tzu tao}: +@example +11a + + -- The Way of Lao-Tzu, tr. Wing-tsit Chan +. +8c + so we may see their result. +. +@end example + +Output of @samp{diff3 -3 lao tzu tao}: +@example +8c + so we may see their result. +. +@end example + +Output of @samp{diff3 -x lao tzu tao}: +@example +11a + + -- The Way of Lao-Tzu, tr. Wing-tsit Chan +. +@end example + +@node Marking Conflicts +@section Marking Conflicts +@cindex conflict marking +@cindex @samp{<<<<<<<} for marking conflicts + +@command{diff3} can mark conflicts in the merged output by +bracketing them with special marker lines. A conflict +that comes from two files @var{A} and @var{B} is marked as follows: + +@example +<<<<<<< @var{A} +@r{lines from @var{A}} +======= +@r{lines from @var{B}} +>>>>>>> @var{B} +@end example + +A conflict that comes from three files @var{A}, @var{B} and @var{C} is +marked as follows: + +@example +<<<<<<< @var{A} +@r{lines from @var{A}} +||||||| @var{B} +@r{lines from @var{B}} +======= +@r{lines from @var{C}} +>>>>>>> @var{C} +@end example + +The @option{--show-all} (@option{-A}) option acts like the @option{-e} +option, except that it brackets conflicts, and it outputs all changes +from @var{older} to @var{yours}, not just the unmerged changes. Thus, +given the sample input files (@pxref{Sample diff3 Input}), @samp{diff3 +-A lao tzu tao} puts brackets around the conflict where only @file{tzu} +differs: + +@example +<<<<<<< tzu +======= +The Way that can be told of is not the eternal Way; +The name that can be named is not the eternal name. +>>>>>>> tao +@end example + +And it outputs the three-way conflict as follows: + +@example +<<<<<<< lao +||||||| tzu +They both may be called deep and profound. +Deeper and more profound, +The door of all subtleties! +======= + + -- The Way of Lao-Tzu, tr. Wing-tsit Chan +>>>>>>> tao +@end example + +The @option{--show-overlap} (@option{-E}) option outputs less information +than the @option{--show-all} (@option{-A}) option, because it outputs only +unmerged changes, and it never outputs the contents of the second +file. Thus the @option{-E} option acts like the @option{-e} option, +except that it brackets the first and third files from three-way +overlapping changes. Similarly, @option{-X} acts like @option{-x}, except +it brackets all its (necessarily overlapping) changes. For example, +for the three-way overlapping change above, the @option{-E} and @option{-X} +options output the following: + +@example +<<<<<<< lao +======= + + -- The Way of Lao-Tzu, tr. Wing-tsit Chan +>>>>>>> tao +@end example + +If you are comparing files that have meaningless or uninformative names, +you can use the @option{--label=@var{label}} +option to show alternate names in the @samp{<<<<<<<}, @samp{|||||||} +and @samp{>>>>>>>} brackets. This option can be given up to three +times, once for each input file. Thus @samp{diff3 -A --label X +--label Y --label Z A +B C} acts like @samp{diff3 -A A B C}, except that the output looks like +it came from files named @samp{X}, @samp{Y} and @samp{Z} rather than +from files named @samp{A}, @samp{B} and @samp{C}. + +@node Bypassing ed +@section Generating the Merged Output Directly +@cindex merged @command{diff3} format + +With the @option{--merge} (@option{-m}) option, @command{diff3} outputs the +merged file directly. This is more efficient than using @command{ed} to +generate it, and works even with non-text files that @command{ed} would +reject. If you specify @option{-m} without an @command{ed} script option, +@option{-A} is assumed. + +For example, the command @samp{diff3 -m lao tzu tao} +(@pxref{Sample diff3 Input} for a copy of the input files) would output +the following: + +@example +<<<<<<< tzu +======= +The Way that can be told of is not the eternal Way; +The name that can be named is not the eternal name. +>>>>>>> tao +The Nameless is the origin of Heaven and Earth; +The Named is the mother of all things. +Therefore let there always be non-being, + so we may see their subtlety, +And let there always be being, + so we may see their result. +The two are the same, +But after they are produced, + they have different names. +<<<<<<< lao +||||||| tzu +They both may be called deep and profound. +Deeper and more profound, +The door of all subtleties! +======= + + -- The Way of Lao-Tzu, tr. Wing-tsit Chan +>>>>>>> tao +@end example + +@node Merging Incomplete Lines +@section How @command{diff3} Merges Incomplete Lines +@cindex incomplete line merging + +With @option{-m}, incomplete lines (@pxref{Incomplete Lines}) are simply +copied to the output as they are found; if the merged output ends in an +conflict and one of the input files ends in an incomplete +line, succeeding @samp{|||||||}, @samp{=======} or @samp{>>>>>>>} +brackets appear somewhere other than the start of a line because +they are appended to the incomplete line. + +Without @option{-m}, if an @command{ed} script option is specified and an +incomplete line is found, @command{diff3} generates a warning and acts as +if a newline had been present. + +@node Saving the Changed File +@section Saving the Changed File +@cindex System V @command{diff3} compatibility + +Traditional Unix @command{diff3} generates an @command{ed} script without the +trailing @samp{w} and @samp{q} commands that save the changes. +System V @command{diff3} generates these extra commands. GNU +@command{diff3} normally behaves like traditional Unix +@command{diff3}, but with the @option{-i} option it behaves like +System V @command{diff3} and appends the @samp{w} and @samp{q} +commands. + +The @option{-i} option requires one of the @command{ed} script options +@option{-AeExX3}, and is incompatible with the merged output option +@option{-m}. + +@node Interactive Merging +@chapter Interactive Merging with @command{sdiff} +@cindex diff merging +@cindex interactive merging + +With @command{sdiff}, you can merge two files interactively based on a +side-by-side @option{-y} format comparison (@pxref{Side by Side}). Use +@option{--output=@var{file}} (@option{-o @var{file}}) to specify where to +put the merged text. @xref{Invoking sdiff}, for more details on the +options to @command{sdiff}. + +Another way to merge files interactively is to use the Emacs Lisp +package @command{emerge}. @xref{Emerge, , Emerge, emacs, The +GNU Emacs Manual}, for more information. + +@menu +* sdiff Option Summary:: Summary of @command{sdiff} options. +* Merge Commands:: Merging two files interactively. +@end menu + +@node sdiff Option Summary +@section Specifying @command{diff} Options to @command{sdiff} +@cindex @command{sdiff} output format + +The following @command{sdiff} options have the same meaning as for +@command{diff}. @xref{diff Options}, for the use of these options. + +@example +-a -b -d -i -t -v +-B -E -I @var{regexp} -Z + +--expand-tabs +--ignore-blank-lines --ignore-case +--ignore-matching-lines=@var{regexp} --ignore-space-change +--ignore-tab-expansion --ignore-trailing-space +--left-column --minimal --speed-large-files +--strip-trailing-cr --suppress-common-lines +--tabsize=@var{columns} --text --version --width=@var{columns} +@end example + +For historical reasons, @command{sdiff} has alternate names for some +options. The @option{-l} option is equivalent to the +@option{--left-column} option, and similarly @option{-s} is equivalent +to @option{--suppress-common-lines}. The meaning of the @command{sdiff} +@option{-w} and @option{-W} options is interchanged from that of +@command{diff}: with @command{sdiff}, @option{-w @var{columns}} is +equivalent to @option{--width=@var{columns}}, and @option{-W} is +equivalent to @option{--ignore-all-space}. @command{sdiff} without the +@option{-o} option is equivalent to @command{diff} with the +@option{--side-by-side} (@option{-y}) option (@pxref{Side by Side}). + +@node Merge Commands +@section Merge Commands +@cindex merge commands +@cindex merging interactively + +Groups of common lines, with a blank gutter, are copied from the first +file to the output. After each group of differing lines, @command{sdiff} +prompts with @samp{%} and pauses, waiting for one of the following +commands. Follow each command with @key{RET}. + +@table @samp +@item e +Discard both versions. +Invoke a text editor on an empty temporary file, +then copy the resulting file to the output. + +@item eb +Concatenate the two versions, edit the result in a temporary file, +then copy the edited result to the output. + +@item ed +Like @samp{eb}, except precede each version with a header that +shows what file and lines the version came from. + +@item el +@itemx e1 +Edit a copy of the left version, then copy the result to the output. + +@item er +@itemx e2 +Edit a copy of the right version, then copy the result to the output. + +@item l +@itemx 1 +Copy the left version to the output. + +@item q +Quit. + +@item r +@itemx 2 +Copy the right version to the output. + +@item s +Silently copy common lines. + +@item v +Verbosely copy common lines. This is the default. +@end table + +@vindex EDITOR +The text editor invoked is specified by the @env{EDITOR} environment +variable if it is set. The default is system-dependent. + +@node Merging with patch +@chapter Merging with @command{patch} + +@command{patch} takes comparison output produced by @command{diff} and applies +the differences to a copy of the original file, producing a patched +version. With @command{patch}, you can distribute just the changes to a +set of files instead of distributing the entire file set; your +correspondents can apply @command{patch} to update their copy of the files +with your changes. @command{patch} automatically determines the diff +format, skips any leading or trailing headers, and uses the headers to +determine which file to patch. This lets your correspondents feed a +mail message containing a difference listing directly to +@command{patch}. + +@command{patch} detects and warns about common problems like forward +patches. It saves any patches that it could not apply. It can also maintain a +@code{patchlevel.h} file to ensure that your correspondents apply +diffs in the proper order. + +@command{patch} accepts a series of diffs in its standard input, usually +separated by headers that specify which file to patch. It applies +@command{diff} hunks (@pxref{Hunks}) one by one. If a hunk does not +exactly match the original file, @command{patch} uses heuristics to try to +patch the file as well as it can. If no approximate match can be found, +@command{patch} rejects the hunk and skips to the next hunk. @command{patch} +normally replaces each file @var{f} with its new version, putting reject +hunks (if any) into @samp{@var{f}.rej}. + +@xref{Invoking patch}, for detailed information on the options to +@command{patch}. + +@menu +* patch Input:: Selecting the type of @command{patch} input. +* Revision Control:: Getting files from RCS, SCCS, etc. +* Imperfect:: Dealing with imperfect patches. +* Creating and Removing:: Creating and removing files with a patch. +* Patching Timestamps:: Updating timestamps on patched files. +* Multiple Patches:: Handling multiple patches in a file. +* patch Directories:: Changing directory and stripping directories. +* Backups:: Whether backup files are made. +* Backup Names:: Backup file names. +* Reject Names:: Reject file names. +* patch Messages:: Messages and questions @command{patch} can produce. +* patch and POSIX:: Conformance to the POSIX standard. +* patch and Tradition:: GNU versus traditional @command{patch}. +@end menu + +@node patch Input +@section Selecting the @command{patch} Input Format +@cindex @command{patch} input format + +@command{patch} normally determines which @command{diff} format the patch +file uses by examining its contents. For patch files that contain +particularly confusing leading text, you might need to use one of the +following options to force @command{patch} to interpret the patch file as a +certain format of diff. The output formats listed here are the only +ones that @command{patch} can understand. + +@table @option +@item -c +@itemx --context +context diff. + +@item -e +@itemx --ed +@command{ed} script. + +@item -n +@itemx --normal +normal diff. + +@item -u +@itemx --unified +unified diff. +@end table + +@node Revision Control +@section Revision Control +@cindex revision control +@cindex version control +@cindex RCS +@cindex ClearCase +@cindex SCCS + +If a nonexistent input file is under a revision control system +supported by @command{patch}, @command{patch} normally asks the user +whether to get (or check out) the file from the revision control +system. Patch currently supports RCS, ClearCase and +SCCS. Under RCS and SCCS, +@command{patch} also asks when the input file is read-only and matches +the default version in the revision control system. + +@vindex PATCH_GET +The @option{--get=@var{num}} (@option{-g @var{num}}) option affects access +to files under supported revision control systems. If @var{num} is +positive, @command{patch} gets the file without asking the user; if +zero, @command{patch} neither asks the user nor gets the file; and if +negative, @command{patch} asks the user before getting the file. The +default value of @var{num} is given by the value of the +@env{PATCH_GET} environment variable if it is set; if not, the default +value is zero if @command{patch} is conforming to POSIX, negative +otherwise. @xref{patch and POSIX}. + +@vindex VERSION_CONTROL +The choice of revision control system is unaffected by the +@env{VERSION_CONTROL} environment variable (@pxref{Backup Names}). + +@node Imperfect +@section Applying Imperfect Patches +@cindex imperfect patch application + +@command{patch} tries to skip any leading text in the patch file, +apply the diff, and then skip any trailing text. Thus you can feed a +mail message directly to @command{patch}, and it should work. If the +entire diff is indented by a constant amount of white space, +@command{patch} automatically ignores the indentation. If a context +diff contains trailing carriage return on each line, @command{patch} +automatically ignores the carriage return. If a context diff has been +encapsulated by prepending @w{@samp{- }} to lines beginning with @samp{-} +as per @uref{ftp://ftp.isi.edu/in-notes/rfc934.txt, Internet RFC 934}, +@command{patch} automatically unencapsulates the input. + +However, certain other types of imperfect input require user +intervention or testing. + +@menu +* Changed White Space:: When tabs and spaces don't match exactly. +* Reversed Patches:: Applying reversed patches correctly. +* Inexact:: Helping @command{patch} find close matches. +* Dry Runs:: Predicting what @command{patch} will do. +@end menu + +@node Changed White Space +@subsection Applying Patches with Changed White Space +@cindex white space in patches + +Sometimes mailers, editors, or other programs change spaces into tabs, +or vice versa. If this happens to a patch file or an input file, the +files might look the same, but @command{patch} will not be able to match +them properly. If this problem occurs, use the @option{-l} or +@option{--ignore-white-space} option, which makes @command{patch} compare +blank characters (i.e.@: spaces and tabs) loosely so that any nonempty +sequence of blanks in the patch file matches any nonempty sequence of +blanks in the input files. Non-blank +characters must still match exactly. Each line of the context must +still match a line in the input file. + +@node Reversed Patches +@subsection Applying Reversed Patches +@cindex reversed patches + +Sometimes people run @command{diff} with the new file first instead of +second. This creates a diff that is ``reversed''. To apply such +patches, give @command{patch} the @option{--reverse} (@option{-R}) option. +@command{patch} then attempts to swap each hunk around before applying it. +Rejects come out in the swapped format. + +Often @command{patch} can guess that the patch is reversed. If the first +hunk of a patch fails, @command{patch} reverses the hunk to see if it can +apply it that way. If it can, @command{patch} asks you if you want to have +the @option{-R} option set; if it can't, @command{patch} continues to apply +the patch normally. This method cannot detect a reversed patch if it is +a normal diff and the first command is an append (which should have been +a delete) since appends always succeed, because a null context matches +anywhere. But most patches add or change lines rather than delete them, +so most reversed normal diffs begin with a delete, which fails, and +@command{patch} notices. + +If you apply a patch that you have already applied, @command{patch} thinks +it is a reversed patch and offers to un-apply the patch. This could be +construed as a feature. If you did this inadvertently and you don't +want to un-apply the patch, just answer @samp{n} to this offer and to +the subsequent ``apply anyway'' question---or type @kbd{C-c} to kill the +@command{patch} process. + +@node Inexact +@subsection Helping @command{patch} Find Inexact Matches +@cindex inexact patches +@cindex fuzz factor when patching + +For context diffs, and to a lesser extent normal diffs, @command{patch} can +detect when the line numbers mentioned in the patch are incorrect, and +it attempts to find the correct place to apply each hunk of the patch. +As a first guess, it takes the line number mentioned in the hunk, plus +or minus any offset used in applying the previous hunk. If that is not +the correct place, @command{patch} scans both forward and backward for a +set of lines matching the context given in the hunk. + +First @command{patch} looks for a place where all lines of the context +match. If it cannot find such a place, and it is reading a context or +unified diff, and the maximum fuzz factor is set to 1 or more, then +@command{patch} makes another scan, ignoring the first and last line of +context. If that fails, and the maximum fuzz factor is set to 2 or +more, it makes another scan, ignoring the first two and last two lines +of context are ignored. It continues similarly if the maximum fuzz +factor is larger. + +The @option{--fuzz=@var{lines}} (@option{-F @var{lines}}) option sets the +maximum fuzz factor to @var{lines}. This option only applies to context +and unified diffs; it ignores up to @var{lines} lines while looking for +the place to install a hunk. Note that a larger fuzz factor increases +the odds of making a faulty patch. The default fuzz factor is 2; there +is no point to setting it to more than the number of lines of context +in the diff, ordinarily 3. + +If @command{patch} cannot find a place to install a hunk of the patch, it +writes the hunk out to a reject file (@pxref{Reject Names}, for information +on how reject files are named). It writes out rejected hunks in context +format no matter what form the input patch is in. If the input is a +normal or @command{ed} diff, many of the contexts are simply null. The +line numbers on the hunks in the reject file may be different from those +in the patch file: they show the approximate location where @command{patch} +thinks the failed hunks belong in the new file rather than in the old +one. + +If the @option{--verbose} option is given, then +as it completes each hunk @command{patch} tells you whether the hunk +succeeded or failed, and if it failed, on which line (in the new file) +@command{patch} thinks the hunk should go. If this is different from the +line number specified in the diff, it tells you the offset. A single +large offset @emph{may} indicate that @command{patch} installed a hunk in +the wrong place. @command{patch} also tells you if it used a fuzz factor +to make the match, in which case you should also be slightly suspicious. + +@command{patch} cannot tell if the line numbers are off in an @command{ed} +script, and can only detect wrong line numbers in a normal diff when it +finds a change or delete command. It may have the same problem with a +context diff using a fuzz factor equal to or greater than the number of +lines of context shown in the diff (typically 3). In these cases, you +should probably look at a context diff between your original and patched +input files to see if the changes make sense. Compiling without errors +is a pretty good indication that the patch worked, but not a guarantee. + +A patch against an empty file applies to a nonexistent file, and vice +versa. @xref{Creating and Removing}. + +@command{patch} usually produces the correct results, even when it must +make many guesses. However, the results are guaranteed only when +the patch is applied to an exact copy of the file that the patch was +generated from. + +@node Dry Runs +@subsection Predicting what @command{patch} will do +@cindex testing @command{patch} +@cindex dry runs for @command{patch} + +It may not be obvious in advance what @command{patch} will do with a +complicated or poorly formatted patch. If you are concerned that the +input might cause @command{patch} to modify the wrong files, you can +use the @option{--dry-run} option, which causes @command{patch} to +print the results of applying patches without actually changing any +files. You can then inspect the diagnostics generated by the dry run +to see whether @command{patch} will modify the files that you expect. +If the patch does not do what you want, you can modify the patch (or +the other options to @command{patch}) and try another dry run. Once +you are satisfied with the proposed patch you can apply it by invoking +@command{patch} as before, but this time without the +@option{--dry-run} option. + +@node Creating and Removing +@section Creating and Removing Files +@cindex creating files +@cindex empty files, removing +@cindex removing empty files + +Sometimes when comparing two directories, a file may exist in one +directory but not the other. If you give @command{diff} the +@option{--new-file} (@option{-N}) option, or if you supply an old or +new file that is named @file{/dev/null} or is empty and is dated the +Epoch (1970-01-01 00:00:00 UTC), @command{diff} outputs a patch that +adds or deletes the contents of this file. When given such a patch, +@command{patch} normally creates a new file or removes the old file. +However, when conforming to POSIX (@pxref{patch and POSIX}), +@command{patch} does not remove the old file, but leaves it empty. +The @option{--remove-empty-files} (@option{-E}) option causes +@command{patch} to remove output files that are empty after applying a +patch, even if the patch does not appear to be one that removed the +file. + +If the patch appears to create a file that already exists, +@command{patch} asks for confirmation before applying the patch. + +@node Patching Timestamps +@section Updating Timestamps on Patched Files +@cindex timestamps on patched files + +When @command{patch} updates a file, it normally sets the file's +last-modified timestamp to the current time of day. If you are using +@command{patch} to track a software distribution, this can cause +@command{make} to incorrectly conclude that a patched file is out of +date. For example, if @file{syntax.c} depends on @file{syntax.y}, and +@command{patch} updates @file{syntax.c} and then @file{syntax.y}, then +@file{syntax.c} will normally appear to be out of date with respect to +@file{syntax.y} even though its contents are actually up to date. + +The @option{--set-utc} (@option{-Z}) option causes @command{patch} to +set a patched file's modification and access times to the timestamps +given in context diff headers. If the context diff headers do not +specify a time zone, they are assumed to use Coordinated Universal +Time (UTC, often known as GMT). + +The @option{--set-time} (@option{-T}) option acts like @option{-Z} or +@option{--set-utc}, except that it assumes that the context diff +headers' timestamps use local time instead of UTC. This option +is not recommended, because patches using local time cannot easily be +used by people in other time zones, and because local timestamps are +ambiguous when local clocks move backwards during daylight-saving time +adjustments. If the context diff headers specify a time zone, this +option is equivalent to @option{--set-utc} (@option{-Z}). + +@command{patch} normally refrains from setting a file's timestamps if +the file's original last-modified timestamp does not match the time +given in the diff header, of if the file's contents do not exactly +match the patch. However, if the @option{--force} (@option{-f}) +option is given, the file's timestamps are set regardless. + +Due to the limitations of the current @command{diff} format, +@command{patch} cannot update the times of files whose contents have +not changed. Also, if you set file timestamps to values other than +the current time of day, you should also remove (e.g., with @samp{make +clean}) all files that depend on the patched files, so that later +invocations of @command{make} do not get confused by the patched +files' times. + +@node Multiple Patches +@section Multiple Patches in a File +@cindex multiple patches +@cindex intuiting file names from patches + +If the patch file contains more than one patch, and if you do not +specify an input file on the command line, @command{patch} tries to +apply each patch as if they came from separate patch files. This +means that it determines the name of the file to patch for each patch, +and that it examines the leading text before each patch for file names +and prerequisite revision level (@pxref{Making Patches}, for more on +that topic). + +@command{patch} uses the following rules to intuit a file name from +the leading text before a patch. First, @command{patch} takes an +ordered list of candidate file names as follows: + +@itemize @bullet +@item +If the header is that of a context diff, @command{patch} takes the old +and new file names in the header. A name is ignored if it does not +have enough slashes to satisfy the @option{-p@var{num}} or +@option{--strip=@var{num}} option. The name @file{/dev/null} is also +ignored. + +@item +If there is an @samp{Index:} line in the leading garbage and if either +the old and new names are both absent or if @command{patch} is +conforming to POSIX, @command{patch} takes the name in the +@samp{Index:} line. + +@item +For the purpose of the following rules, the candidate file names are +considered to be in the order (old, new, index), regardless of the +order that they appear in the header. +@end itemize + +@noindent +Then @command{patch} selects a file name from the candidate list as +follows: + +@itemize @bullet +@item +If some of the named files exist, @command{patch} selects the first +name if conforming to POSIX, and the best name otherwise. + +@item +If @command{patch} is not ignoring RCS, ClearCase, and SCCS +(@pxref{Revision Control}), and no named files exist but an RCS, +ClearCase, or SCCS master is found, @command{patch} selects the +first named file with an RCS, ClearCase, or SCCS master. + +@item +If no named files exist, no RCS, ClearCase, or SCCS master +was found, some names are given, @command{patch} is not conforming to +POSIX, and the patch appears to create a file, @command{patch} +selects the best name requiring the creation of the fewest +directories. + +@item +If no file name results from the above heuristics, you are asked for +the name of the file to patch, and @command{patch} selects that name. +@end itemize + +To determine the @dfn{best} of a nonempty list of file names, +@command{patch} first takes all the names with the fewest path name +components; of those, it then takes all the names with the shortest +basename; of those, it then takes all the shortest names; finally, it +takes the first remaining name. + +@xref{patch and POSIX}, to see whether @command{patch} is conforming +to POSIX. + +@node patch Directories +@section Applying Patches in Other Directories +@cindex directories and patch +@cindex patching directories + +The @option{--directory=@var{directory}} (@option{-d @var{directory}}) +option to @command{patch} makes directory @var{directory} the current +directory for interpreting both file names in the patch file, and file +names given as arguments to other options (such as @option{-B} and +@option{-o}). For example, while in a mail reading program, you can patch +a file in the @file{/usr/src/emacs} directory directly from a message +containing the patch like this: + +@example +| patch -d /usr/src/emacs +@end example + +Sometimes the file names given in a patch contain leading directories, +but you keep your files in a directory different from the one given in +the patch. In those cases, you can use the +@option{--strip=@var{number}} (@option{-p@var{number}}) +option to set the file name strip count to @var{number}. The strip +count tells @command{patch} how many slashes, along with the directory +names between them, to strip from the front of file names. A sequence +of one or more adjacent slashes is counted as a single slash. By +default, @command{patch} strips off all leading directories, leaving +just the base file names. + +For example, suppose the file name in the patch file is +@file{/gnu/src/emacs/etc/NEWS}. Using @option{-p0} gives the +entire file name unmodified, @option{-p1} gives +@file{gnu/src/emacs/etc/NEWS} (no leading slash), @option{-p4} gives +@file{etc/NEWS}, and not specifying @option{-p} at all gives @file{NEWS}. + +@command{patch} looks for each file (after any slashes have been stripped) +in the current directory, or if you used the @option{-d @var{directory}} +option, in that directory. + +@node Backups +@section Backup Files +@cindex backup file strategy + +Normally, @command{patch} creates a backup file if the patch does not +exactly match the original input file, because in that case the +original data might not be recovered if you undo the patch with +@samp{patch -R} (@pxref{Reversed Patches}). However, when conforming +to POSIX, @command{patch} does not create backup files by +default. @xref{patch and POSIX}. + +The @option{--backup} (@option{-b}) option causes @command{patch} to +make a backup file regardless of whether the patch matches the +original input. The @option{--backup-if-mismatch} option causes +@command{patch} to create backup files for mismatches files; this is +the default when not conforming to POSIX. The +@option{--no-backup-if-mismatch} option causes @command{patch} to not +create backup files, even for mismatched patches; this is the default +when conforming to POSIX. + +When backing up a file that does not exist, an empty, unreadable +backup file is created as a placeholder to represent the nonexistent +file. + +@node Backup Names +@section Backup File Names +@cindex backup file names + +Normally, @command{patch} renames an original input file into a backup +file by appending to its name the extension @samp{.orig}, or @samp{~} +if using @samp{.orig} would make the backup file name too +long.@footnote{A coding error in GNU @command{patch} version +2.5.4 causes it to always use @samp{~}, but this should be fixed in +the next release.} The @option{-z @var{backup-suffix}} or +@option{--suffix=@var{backup-suffix}} option causes @command{patch} to +use @var{backup-suffix} as the backup extension instead. + +@vindex SIMPLE_BACKUP_SUFFIX +Alternately, you can specify the extension for backup files with the +@env{SIMPLE_BACKUP_SUFFIX} environment variable, which the options +override. + +@command{patch} can also create numbered backup files the way +GNU Emacs does. With this method, instead of having a +single backup of each file, @command{patch} makes a new backup file +name each time it patches a file. For example, the backups of a file +named @file{sink} would be called, successively, @file{sink.~1~}, +@file{sink.~2~}, @file{sink.~3~}, etc. + +@vindex PATCH_VERSION_CONTROL +@vindex VERSION_CONTROL +The @option{-V @var{backup-style}} or +@option{--version-control=@var{backup-style}} option takes as an +argument a method for creating backup file names. You can alternately +control the type of backups that @command{patch} makes with the +@env{PATCH_VERSION_CONTROL} environment variable, which the +@option{-V} option overrides. If @env{PATCH_VERSION_CONTROL} is not +set, the @env{VERSION_CONTROL} environment variable is used instead. +Please note that these options and variables control backup file +names; they do not affect the choice of revision control system +(@pxref{Revision Control}). + +The values of these environment variables and the argument to the +@option{-V} option are like the GNU Emacs @code{version-control} +variable (@pxref{Backup Names, , , emacs, The GNU Emacs Manual}, +for more information on backup versions in Emacs). They also +recognize synonyms that are more descriptive. The valid values are +listed below; unique abbreviations are acceptable. + +@table @option +@item t +@itemx numbered +Always make numbered backups. + +@item nil +@itemx existing +Make numbered backups of files that already have them, simple backups of +the others. This is the default. + +@item never +@itemx simple +Always make simple backups. +@end table + +You can also tell @command{patch} to prepend a prefix, such as a +directory name, to produce backup file names. The +@option{--prefix=@var{prefix}} (@option{-B @var{prefix}}) option makes backup +files by prepending @var{prefix} to them. The +@option{--basename-prefix=@var{prefix}} (@option{-Y @var{prefix}}) prepends +@var{prefix} to the last file name component of backup file names +instead; for example, @option{-Y ~} causes the backup name for +@file{dir/file.c} to be @file{dir/~file.c}. If you use either of +these prefix options, the suffix-based options are ignored. + +If you specify the output file with the @option{-o} option, that file is +the one that is backed up, not the input file. + +Options that affect the names of backup files do not affect whether +backups are made. For example, if you specify the +@option{--no-backup-if-mismatch} option, none of the options described +in this section have any affect, because no backups are made. + +@node Reject Names +@section Reject File Names +@cindex reject file names + +The names for reject files (files containing patches that +@command{patch} could not find a place to apply) are normally the name +of the output file with @samp{.rej} appended (or @samp{#} if using +@samp{.rej} would make the backup file name too long). + +Alternatively, you can tell @command{patch} to place all of the rejected +patches in a single file. The @option{-r @var{reject-file}} or +@option{--reject-file=@var{reject-file}} option uses @var{reject-file} as +the reject file name. + +@node patch Messages +@section Messages and Questions from @command{patch} +@cindex @command{patch} messages and questions +@cindex diagnostics from @command{patch} +@cindex messages from @command{patch} + +@command{patch} can produce a variety of messages, especially if it +has trouble decoding its input. In a few situations where it's not +sure how to proceed, @command{patch} normally prompts you for more +information from the keyboard. There are options to produce more or +fewer messages, to have it not ask for keyboard input, and to +affect the way that file names are quoted in messages. + +@menu +* More or Fewer Messages:: Controlling the verbosity of @command{patch}. +* patch and Keyboard Input:: Inhibiting keyboard input. +* patch Quoting Style:: Quoting file names in diagnostics. +@end menu + +@command{patch} exits with status 0 if all hunks are applied successfully, +1 if some hunks cannot be applied, and 2 if there is more serious trouble. +When applying a set of patches in a loop, you should check the +exit status, so you don't apply a later patch to a partially patched +file. + +@node More or Fewer Messages +@subsection Controlling the Verbosity of @command{patch} +@cindex verbose messages from @command{patch} +@cindex inhibit messages from @command{patch} + +You can cause @command{patch} to produce more messages by using the +@option{--verbose} option. For example, when you give this option, +the message @samp{Hmm...} indicates that @command{patch} is reading text in +the patch file, attempting to determine whether there is a patch in that +text, and if so, what kind of patch it is. + +You can inhibit all terminal output from @command{patch}, unless an error +occurs, by using the @option{-s}, @option{--quiet}, or @option{--silent} +option. + +@node patch and Keyboard Input +@subsection Inhibiting Keyboard Input +@cindex keyboard input to @command{patch} + +There are two ways you can prevent @command{patch} from asking you any +questions. The @option{--force} (@option{-f}) option assumes that you know +what you are doing. It causes @command{patch} to do the following: + +@itemize @bullet +@item +Skip patches that do not contain file names in their headers. + +@item +Patch files even though they have the wrong version for the +@samp{Prereq:} line in the patch; + +@item +Assume that patches are not reversed even if they look like they are. +@end itemize + +@noindent +The @option{--batch} (@option{-t}) option is similar to @option{-f}, in that +it suppresses questions, but it makes somewhat different assumptions: + +@itemize @bullet +@item +Skip patches that do not contain file names in their headers +(the same as @option{-f}). + +@item +Skip patches for which the file has the wrong version for the +@samp{Prereq:} line in the patch; + +@item +Assume that patches are reversed if they look like they are. +@end itemize + +@node patch Quoting Style +@subsection @command{patch} Quoting Style +@cindex quoting style + +When @command{patch} outputs a file name in a diagnostic message, it +can format the name in any of several ways. This can be useful to +output file names unambiguously, even if they contain punctuation or +special characters like newlines. The +@option{--quoting-style=@var{word}} option controls how names are +output. The @var{word} should be one of the following: + +@table @samp +@item literal +Output names as-is. +@item shell +Quote names for the shell if they contain shell metacharacters or would +cause ambiguous output. +@item shell-always +Quote names for the shell, even if they would normally not require quoting. +@item c +Quote names as for a C language string. +@item escape +Quote as with @samp{c} except omit the surrounding double-quote +characters. +@c The following are not yet implemented in patch 2.5.4. +@c @item clocale +@c Quote as with @samp{c} except use quotation marks appropriate for the +@c locale. +@c @item locale +@c @c Use @t instead of @samp to avoid duplicate quoting in some output styles. +@c Like @samp{clocale}, but quote @t{'like this'} instead of @t{"like +@c this"} in the default C locale. This looks nicer on many displays. +@end table + +@vindex QUOTING_STYLE +You can specify the default value of the @option{--quoting-style} +option with the environment variable @env{QUOTING_STYLE}. If that +environment variable is not set, the default value is @samp{shell}, +but this default may change in a future version of @command{patch}. + +@node patch and POSIX +@section @command{patch} and the POSIX Standard +@cindex POSIX + +@vindex POSIXLY_CORRECT +If you specify the @option{--posix} option, or set the +@env{POSIXLY_CORRECT} environment variable, @command{patch} conforms +more strictly to the POSIX standard, as follows: + +@itemize @bullet +@item +Take the first existing file from the list (old, new, index) +when intuiting file names from diff headers. @xref{Multiple Patches}. + +@item +Do not remove files that are removed by a diff. +@xref{Creating and Removing}. + +@item +Do not ask whether to get files from RCS, ClearCase, or +SCCS. @xref{Revision Control}. + +@item +Require that all options precede the files in the command line. + +@item +Do not backup files, even when there is a mismatch. @xref{Backups}. + +@end itemize + +@node patch and Tradition +@section GNU @command{patch} and Traditional @command{patch} +@cindex traditional @command{patch} + +The current version of GNU @command{patch} normally follows the +POSIX standard. @xref{patch and POSIX}, for the few exceptions +to this general rule. + +Unfortunately, POSIX redefined the behavior of @command{patch} in +several important ways. You should be aware of the following +differences if you must interoperate with traditional @command{patch}, +or with GNU @command{patch} version 2.1 and earlier. + +@itemize @bullet +@item +In traditional @command{patch}, the @option{-p} option's operand was +optional, and a bare @option{-p} was equivalent to @option{-p0}. The +@option{-p} option now requires an operand, and @option{-p@ 0} is now +equivalent to @option{-p0}. For maximum compatibility, use options +like @option{-p0} and @option{-p1}. + +Also, traditional @command{patch} simply counted slashes when +stripping path prefixes; @command{patch} now counts pathname +components. That is, a sequence of one or more adjacent slashes now +counts as a single slash. For maximum portability, avoid sending +patches containing @file{//} in file names. + +@item +In traditional @command{patch}, backups were enabled by default. This +behavior is now enabled with the @option{--backup} (@option{-b}) +option. + +Conversely, in POSIX @command{patch}, backups are never made, +even when there is a mismatch. In GNU @command{patch}, this +behavior is enabled with the @option{--no-backup-if-mismatch} option, +or by conforming to POSIX. + +The @option{-b@ @var{suffix}} option of traditional @command{patch} is +equivalent to the @samp{-b -z@ @var{suffix}} options of GNU +@command{patch}. + +@item +Traditional @command{patch} used a complicated (and incompletely +documented) method to intuit the name of the file to be patched from +the patch header. This method did not conform to POSIX, and had +a few gotchas. Now @command{patch} uses a different, equally +complicated (but better documented) method that is optionally +POSIX-conforming; we hope it has fewer gotchas. The two methods +are compatible if the file names in the context diff header and the +@samp{Index:} line are all identical after prefix-stripping. Your +patch is normally compatible if each header's file names all contain +the same number of slashes. + +@item +When traditional @command{patch} asked the user a question, it sent +the question to standard error and looked for an answer from the first +file in the following list that was a terminal: standard error, +standard output, @file{/dev/tty}, and standard input. Now +@command{patch} sends questions to standard output and gets answers +from @file{/dev/tty}. Defaults for some answers have been changed so +that @command{patch} never goes into an infinite loop when using +default answers. + +@item +Traditional @command{patch} exited with a status value that counted +the number of bad hunks, or with status 1 if there was real trouble. +Now @command{patch} exits with status 1 if some hunks failed, or with +2 if there was real trouble. + +@item +Limit yourself to the following options when sending instructions +meant to be executed by anyone running GNU @command{patch}, +traditional @command{patch}, or a @command{patch} that conforms to +POSIX. Spaces are significant in the following list, and +operands are required. + +@example +@option{-c} +@option{-d @var{dir}} +@option{-D @var{define}} +@option{-e} +@option{-l} +@option{-n} +@option{-N} +@option{-o @var{outfile}} +@option{-p@var{num}} +@option{-R} +@option{-r @var{rejectfile}} +@end example + +@end itemize + +@node Making Patches +@chapter Tips for Making and Using Patches + +Use some common sense when making and using patches. For example, +when sending bug fixes to a program's maintainer, send several small +patches, one per independent subject, instead of one large, +harder-to-digest patch that covers all the subjects. + +Here are some other things you should keep in mind if you are going to +distribute patches for updating a software package. + +@menu +* Tips for Patch Producers:: Advice for making patches. +* Tips for Patch Consumers:: Advice for using patches. +* Avoiding Common Mistakes:: Avoiding common mistakes when using @command{patch}. +* Generating Smaller Patches:: How to generate smaller patches. +@end menu + +@node Tips for Patch Producers +@section Tips for Patch Producers +@cindex patch producer tips + +To create a patch that changes an older version of a package into a +newer version, first make a copy of the older and newer versions in +adjacent subdirectories. It is common to do that by unpacking +@command{tar} archives of the two versions. + +To generate the patch, use the command @samp{diff -Naur @var{old} +@var{new}} where @var{old} and @var{new} identify the old and new +directories. The names @var{old} and @var{new} should not contain any +slashes. The @option{-N} option lets the patch create and remove +files; @option{-a} lets the patch update non-text files; @option{-u} +generates useful timestamps and enough context; and @option{-r} lets +the patch update subdirectories. Here is an example command, using +Bourne shell syntax: + +@example +diff -Naur gcc-3.0.3 gcc-3.0.4 +@end example + +Tell your recipients how to apply the patches. This should include +which working directory to use, and which @command{patch} options to +use; the option @samp{-p1} is recommended. Test your procedure by +pretending to be a recipient and applying your patches to a copy of +the original files. + +@xref{Avoiding Common Mistakes}, for how to avoid common mistakes when +generating a patch. + +@node Tips for Patch Consumers +@section Tips for Patch Consumers +@cindex patch consumer tips + +A patch producer should tell recipients how to apply the patches, so +the first rule of thumb for a patch consumer is to follow the +instructions supplied with the patch. + +GNU @command{diff} can analyze files with arbitrarily long lines +and files that end in incomplete lines. However, older versions of +@command{patch} cannot patch such files. If you are having trouble +applying such patches, try upgrading to a recent version of GNU +@command{patch}. + +@node Avoiding Common Mistakes +@section Avoiding Common Mistakes +@cindex common mistakes with patches +@cindex patch, common mistakes + +When producing a patch for multiple files, apply @command{diff} to +directories whose names do not have slashes. This reduces confusion +when the patch consumer specifies the @option{-p@var{number}} option, +since this option can have surprising results when the old and new +file names have different numbers of slashes. For example, do not +send a patch with a header that looks like this: + +@example +diff -Naur v2.0.29/prog/README prog/README +--- v2.0.29/prog/README 2002-03-10 23:30:39.942229878 -0800 ++++ prog/README 2002-03-17 20:49:32.442260588 -0800 +@end example + +@noindent +because the two file names have different numbers of slashes, and +different versions of @command{patch} interpret the file names +differently. To avoid confusion, send output that looks like this +instead: + +@example +diff -Naur v2.0.29/prog/README v2.0.30/prog/README +--- v2.0.29/prog/README 2002-03-10 23:30:39.942229878 -0800 ++++ v2.0.30/prog/README 2002-03-17 20:49:32.442260588 -0800 +@end example + +Make sure you have specified the file names correctly, either in a +context diff header or with an @samp{Index:} line. Take care to not send out +reversed patches, since these make people wonder whether they have +already applied the patch. + +Avoid sending patches that compare backup file names like +@file{README.orig} or @file{README~}, since this might confuse +@command{patch} into patching a backup file instead of the real file. +Instead, send patches that compare the same base file names in +different directories, e.g.@: @file{old/README} and @file{new/README}. + +To save people from partially applying a patch before other patches that +should have gone before it, you can make the first patch in the patch +file update a file with a name like @file{patchlevel.h} or +@file{version.c}, which contains a patch level or version number. If +the input file contains the wrong version number, @command{patch} will +complain immediately. + +An even clearer way to prevent this problem is to put a @samp{Prereq:} +line before the patch. If the leading text in the patch file contains a +line that starts with @samp{Prereq:}, @command{patch} takes the next word +from that line (normally a version number) and checks whether the next +input file contains that word, preceded and followed by either +white space or a newline. If not, @command{patch} prompts you for +confirmation before proceeding. This makes it difficult to accidentally +apply patches in the wrong order. + +@node Generating Smaller Patches +@section Generating Smaller Patches +@cindex patches, shrinking + +The simplest way to generate a patch is to use @samp{diff -Naur} +(@pxref{Tips for Patch Producers}), but you might be able to reduce +the size of the patch by renaming or removing some files before making +the patch. If the older version of the package contains any files +that the newer version does not, or if any files have been renamed +between the two versions, make a list of @command{rm} and @command{mv} +commands for the user to execute in the old version directory before +applying the patch. Then run those commands yourself in the scratch +directory. + +If there are any files that you don't need to include in the patch +because they can easily be rebuilt from other files (for example, +@file{TAGS} and output from @command{yacc} and @command{makeinfo}), +exclude them from the patch by giving @command{diff} the @option{-x +@var{pattern}} option (@pxref{Comparing Directories}). If you want +your patch to modify a derived file because your recipients lack tools +to build it, make sure that the patch for the derived file follows any +patches for files that it depends on, so that the recipients' +timestamps will not confuse @command{make}. + +Now you can create the patch using @samp{diff -Naur}. Make sure to +specify the scratch directory first and the newer directory second. + +Add to the top of the patch a note telling the user any @command{rm} and +@command{mv} commands to run before applying the patch. Then you can +remove the scratch directory. + +You can also shrink the patch size by using fewer lines of context, +but bear in mind that @command{patch} typically needs at least two +lines for proper operation when patches do not exactly match the input +files. + +@node Invoking cmp +@chapter Invoking @command{cmp} +@cindex invoking @command{cmp} +@cindex @command{cmp} invocation + +The @command{cmp} command compares two files, and if they differ, +tells the first byte and line number where they differ or reports +that one file is a prefix of the other. Bytes and +lines are numbered starting with 1. The arguments of @command{cmp} +are as follows: + +@example +cmp @var{options}@dots{} @var{from-file} @r{[}@var{to-file} @r{[}@var{from-skip} @r{[}@var{to-skip}@r{]}@r{]}@r{]} +@end example + +The file name @file{-} is always the standard input. @command{cmp} +also uses the standard input if one file name is omitted. The +@var{from-skip} and @var{to-skip} operands specify how many bytes to +ignore at the start of each file; they are equivalent to the +@option{--ignore-initial=@var{from-skip}:@var{to-skip}} option. + +By default, @command{cmp} outputs nothing if the two files have the +same contents. If the two files have bytes that differ, @command{cmp} +reports the location of the first difference to standard output: + +@example +@var{from-file} @var{to-file} differ: char @var{byte-number}, line @var{line-number} +@end example + +@noindent +If one file is a prefix of the other, @command{cmp} reports the +shorter file's name to standard error, followed by a blank and extra +information about the shorter file: + +@example +cmp: EOF on @var{shorter-file} @var{extra-info} +@end example + +The message formats can differ outside the POSIX locale. +POSIX allows but does not require the EOF diagnostic's file +name to be followed by a blank and additional information. + +An exit status of 0 means no differences were found, 1 means some +differences were found, and 2 means trouble. + +@menu +* cmp Options:: Summary of options to @command{cmp}. +@end menu + +@node cmp Options +@section Options to @command{cmp} +@cindex @command{cmp} options +@cindex options for @command{cmp} + +Below is a summary of all of the options that GNU +@command{cmp} accepts. Most options have two equivalent names, one of +which is a single letter preceded by @samp{-}, and the other of which +is a long name preceded by @samp{--}. Multiple single letter options +(unless they take an argument) can be combined into a single command +line word: @option{-bl} is equivalent to @option{-b -l}. + +@table @option +@item -b +@itemx --print-bytes +Print the differing bytes. Display control bytes as a +@samp{^} followed by a letter of the alphabet and precede bytes +that have the high bit set with @samp{M-} (which stands for ``meta''). + +@item --help +Output a summary of usage and then exit. + +@item -i @var{skip} +@itemx --ignore-initial=@var{skip} +Ignore any differences in the first @var{skip} bytes of the input +files. Treat files with fewer than @var{skip} bytes as if they are +empty. If @var{skip} is of the form +@option{@var{from-skip}:@var{to-skip}}, skip the first @var{from-skip} +bytes of the first input file and the first @var{to-skip} bytes of the +second. + +@item -l +@itemx --verbose +Output the (decimal) byte numbers and (octal) values of all differing bytes, +instead of the default standard output. +Each output line contains a differing byte's number relative to the +start of the input, followed by the differing byte values. +Byte numbers start at 1. +Also, output the EOF message if one file is shorter than the other. + +@item -n @var{count} +@itemx --bytes=@var{count} +Compare at most @var{count} input bytes. + +@item -s +@itemx --quiet +@itemx --silent +Do not print anything; only return an exit status indicating whether +the files differ. + +@item -v +@itemx --version +Output version information and then exit. +@end table + +In the above table, operands that are byte counts are normally +decimal, but may be preceded by @samp{0} for octal and @samp{0x} for +hexadecimal. + +A byte count can be followed by a suffix to specify a multiple of that +count; in this case an omitted integer is understood to be 1. A bare +size letter, or one followed by @samp{iB}, specifies a multiple using +powers of 1024. A size letter followed by @samp{B} specifies powers +of 1000 instead. For example, @option{-n 4M} and @option{-n 4MiB} are +equivalent to @option{-n 4194304}, whereas @option{-n 4MB} is +equivalent to @option{-n 4000000}. This notation is upward compatible +with the @uref{http://www.bipm.fr/enus/3_SI/si-prefixes.html, SI +prefixes} for decimal multiples and with the +@uref{http://physics.nist.gov/cuu/Units/binary.html, IEC 60027-2 +prefixes for binary multiples}. + +The following suffixes are defined. Large sizes like @code{1Y} may be +rejected by your computer due to limitations of its arithmetic. + +@table @samp +@item kB +@cindex kilobyte, definition of +kilobyte: @math{10^3 = 1000}. +@item k +@itemx K +@itemx KiB +@cindex kibibyte, definition of +kibibyte: @math{2^10 = 1024}. @samp{K} is special: the SI prefix is +@samp{k} and the IEC 60027-2 prefix is @samp{Ki}, but tradition and +POSIX use @samp{k} to mean @samp{KiB}. +@item MB +@cindex megabyte, definition of +megabyte: @math{10^6 = 1,000,000}. +@item M +@itemx MiB +@cindex mebibyte, definition of +mebibyte: @math{2^20 = 1,048,576}. +@item GB +@cindex gigabyte, definition of +gigabyte: @math{10^9 = 1,000,000,000}. +@item G +@itemx GiB +@cindex gibibyte, definition of +gibibyte: @math{2^30 = 1,073,741,824}. +@item TB +@cindex terabyte, definition of +terabyte: @math{10^12 = 1,000,000,000,000}. +@item T +@itemx TiB +@cindex tebibyte, definition of +tebibyte: @math{2^40 = 1,099,511,627,776}. +@item PB +@cindex petabyte, definition of +petabyte: @math{10^15 = 1,000,000,000,000,000}. +@item P +@itemx PiB +@cindex pebibyte, definition of +pebibyte: @math{2^50 = 1,125,899,906,842,624}. +@item EB +@cindex exabyte, definition of +exabyte: @math{10^18 = 1,000,000,000,000,000,000}. +@item E +@itemx EiB +@cindex exbibyte, definition of +exbibyte: @math{2^60 = 1,152,921,504,606,846,976}. +@item ZB +@cindex zettabyte, definition of +zettabyte: @math{10^21 = 1,000,000,000,000,000,000,000} +@item Z +@itemx ZiB +@math{2^70 = 1,180,591,620,717,411,303,424}. +(@samp{Zi} is a GNU extension to IEC 60027-2.) +@item YB +@cindex yottabyte, definition of +yottabyte: @math{10^24 = 1,000,000,000,000,000,000,000,000}. +@item Y +@itemx YiB +@math{2^80 = 1,208,925,819,614,629,174,706,176}. +(@samp{Yi} is a GNU extension to IEC 60027-2.) +@end table + +@node Invoking diff +@chapter Invoking @command{diff} +@cindex invoking @command{diff} +@cindex @command{diff} invocation + +The format for running the @command{diff} command is: + +@example +diff @var{options}@dots{} @var{files}@dots{} +@end example + +In the simplest case, two file names @var{from-file} and +@var{to-file} are given, and @command{diff} compares the contents of +@var{from-file} and @var{to-file}. A file name of @file{-} stands for +the standard input. + +If one file is a directory and the other is not, @command{diff} compares +the file in the directory whose name is that of the non-directory. +The non-directory file must not be @file{-}. + +If two file names are given and both are directories, +@command{diff} compares corresponding files in both directories, in +alphabetical order; this comparison is not recursive unless the +@option{--recursive} (@option{-r}) option is given. @command{diff} never +compares the actual contents of a directory as if it were a file. The +file that is fully specified may not be standard input, because standard +input is nameless and the notion of ``file with the same name'' does not +apply. + +If the @option{--from-file=@var{file}} option is given, the number of +file names is arbitrary, and @var{file} is compared to each named file. +Similarly, if the @option{--to-file=@var{file}} option is given, each +named file is compared to @var{file}. + +@command{diff} options begin with @samp{-}, so normally file names +may not begin with @samp{-}. However, @option{--} as an +argument by itself treats the remaining arguments as file names even if +they begin with @samp{-}. + +An exit status of 0 means no differences were found, 1 means some +differences were found, and 2 means trouble. + +@menu +* diff Options:: Summary of options to @command{diff}. +@end menu + +@node diff Options +@section Options to @command{diff} +@cindex @command{diff} options +@cindex options for @command{diff} + +Below is a summary of all of the options that GNU +@command{diff} accepts. Most options have two equivalent names, one +of which is a single letter preceded by @samp{-}, and the other of +which is a long name preceded by @samp{--}. Multiple single letter +options (unless they take an argument) can be combined into a single +command line word: @option{-ac} is equivalent to @option{-a -c}. Long +named options can be abbreviated to any unique prefix of their name. +Brackets ([ and ]) indicate that an option takes an optional argument. + +@table @option +@item -a +@itemx --text +Treat all files as text and compare them line-by-line, even if they +do not seem to be text. @xref{Binary}. + +@item -b +@itemx --ignore-space-change +Ignore changes in amount of white space. @xref{White Space}. + +@item -B +@itemx --ignore-blank-lines +Ignore changes that just insert or delete blank lines. @xref{Blank +Lines}. + +@item --binary +Read and write data in binary mode. @xref{Binary}. + +@item -c +Use the context output format, showing three lines of context. +@xref{Context Format}. + +@item --color [=@var{when}] +@cindex color, distinguishing different context +Specify whether to use color for distinguishing different contexts, +like header, added or removed lines. @var{when} may be omitted, or +one of: +@itemize @bullet +@item none +@vindex none @r{color option} +Do not use color at all. This is the default when no --color option +is specified. +@item auto +@vindex auto @r{color option} +@cindex terminal, using color iff +Use color only if standard output is a terminal. +@item always +@vindex always @r{color option} +Always use color. +@end itemize +Specifying @option{--color} and no @var{when} is equivalent to +@option{--color=auto}. + +@item -C @var{lines} +@itemx --context@r{[}=@var{lines}@r{]} +Use the context output format, showing @var{lines} (an integer) lines of +context, or three if @var{lines} is not given. @xref{Context Format}. +For proper operation, @command{patch} typically needs at least two lines of +context. + +For compatibility @command{diff} also supports an obsolete option +syntax @option{-@var{lines}} that has effect when combined with +@option{-c}, @option{-p}, or @option{-u}. New scripts should use +@option{-U @var{lines}} (@option{-C @var{lines}}) instead. + +@item --changed-group-format=@var{format} +Use @var{format} to output a line group containing differing lines from +both files in if-then-else format. @xref{Line Group Formats}. + +@item -d +@itemx --minimal +Change the algorithm perhaps find a smaller set of changes. This makes +@command{diff} slower (sometimes much slower). @xref{diff Performance}. + +@item -D @var{name} +@itemx --ifdef=@var{name} +Make merged @samp{#ifdef} format output, conditional on the preprocessor +macro @var{name}. @xref{If-then-else}. + +@item -e +@itemx --ed +Make output that is a valid @command{ed} script. @xref{ed Scripts}. + +@item -E +@itemx --ignore-tab-expansion +Ignore changes due to tab expansion. +@xref{White Space}. + +@item -f +@itemx --forward-ed +Make output that looks vaguely like an @command{ed} script but has changes +in the order they appear in the file. @xref{Forward ed}. + +@item -F @var{regexp} +@itemx --show-function-line=@var{regexp} +In context and unified format, for each hunk of differences, show some +of the last preceding line that matches @var{regexp}. @xref{Specified +Headings}. + +@item --from-file=@var{file} +Compare @var{file} to each operand; @var{file} may be a directory. + +@item --help +Output a summary of usage and then exit. + +@item --horizon-lines=@var{lines} +Do not discard the last @var{lines} lines of the common prefix +and the first @var{lines} lines of the common suffix. +@xref{diff Performance}. + +@item -i +@itemx --ignore-case +Ignore changes in case; consider upper- and lower-case letters +equivalent. @xref{Case Folding}. + +@item -I @var{regexp} +@itemx --ignore-matching-lines=@var{regexp} +Ignore changes that just insert or delete lines that match @var{regexp}. +@xref{Specified Lines}. + +@item --ignore-file-name-case +Ignore case when comparing file names. For example, recursive +comparison of @file{d} to @file{e} might compare the contents of +@file{d/Init} and @file{e/inIt}. At the top level, @samp{diff d inIt} +might compare the contents of @file{d/Init} and @file{inIt}. +@xref{Comparing Directories}. + +@item -l +@itemx --paginate +Pass the output through @command{pr} to paginate it. @xref{Pagination}. + +@item -L @var{label} +@itemx --label=@var{label} +Use @var{label} instead of the file name in the context format +(@pxref{Context Format}) and unified format (@pxref{Unified Format}) +headers. @xref{RCS}. + +@item --left-column +Print only the left column of two common lines in side by side format. +@xref{Side by Side Format}. + +@item --line-format=@var{format} +Use @var{format} to output all input lines in if-then-else format. +@xref{Line Formats}. + +@item -n +@itemx --rcs +Output RCS-format diffs; like @option{-f} except that each command +specifies the number of lines affected. @xref{RCS}. + +@item -N +@itemx --new-file +If one file is missing, treat it as present but empty. +@xref{Comparing Directories}. + +@item --new-group-format=@var{format} +Use @var{format} to output a group of lines taken from just the second +file in if-then-else format. @xref{Line Group Formats}. + +@item --new-line-format=@var{format} +Use @var{format} to output a line taken from just the second file in +if-then-else format. @xref{Line Formats}. + +@item --no-dereference +Act on symbolic links themselves instead of what they point to. +Two symbolic links are deemed equal only when each points to +precisely the same name. + +@item --old-group-format=@var{format} +Use @var{format} to output a group of lines taken from just the first +file in if-then-else format. @xref{Line Group Formats}. + +@item --old-line-format=@var{format} +Use @var{format} to output a line taken from just the first file in +if-then-else format. @xref{Line Formats}. + +@item -p +@itemx --show-c-function +Show which C function each change is in. @xref{C Function Headings}. + +@item --palette=@var{palette} +Specify what color palette to use when colored output is enabled. It +defaults to @samp{rs=0:hd=1:ad=32:de=31:ln=36} for red deleted lines, +green added lines, cyan line numbers, bold header. + +Supported capabilities are as follows. + +@table @code +@item ad=32 +@vindex ad @r{capability} + +SGR substring for added lines. +The default is green foreground. + +@item de=31 +@vindex de @r{capability} + +SGR substring for deleted lines. +The default is red foreground. + +@item hd=1 +@vindex hd @r{capability} + +SGR substring for chunk header. +The default is bold foreground. + +@item ln=36 +@vindex ln @r{capability} + +SGR substring for line numbers. +The default is cyan foreground. +@end table + + +@item -q +@itemx --brief +Report only whether the files differ, not the details of the +differences. @xref{Brief}. + +@item -r +@itemx --recursive +When comparing directories, recursively compare any subdirectories +found. @xref{Comparing Directories}. + +@item -s +@itemx --report-identical-files +Report when two files are the same. @xref{Comparing Directories}. + +@item -S @var{file} +@itemx --starting-file=@var{file} +When comparing directories, start with the file @var{file}. This is +used for resuming an aborted comparison. @xref{Comparing Directories}. + +@item --speed-large-files +Use heuristics to speed handling of large files that have numerous +scattered small changes. @xref{diff Performance}. + +@item --strip-trailing-cr +Strip any trailing carriage return at the end of an input line. +@xref{Binary}. + +@item --suppress-common-lines +Do not print common lines in side by side format. +@xref{Side by Side Format}. + +@item -t +@itemx --expand-tabs +Expand tabs to spaces in the output, to preserve the alignment of tabs +in the input files. @xref{Tabs}. + +@item -T +@itemx --initial-tab +Output a tab rather than a space before the text of a line in normal or +context format. This causes the alignment of tabs in the line to look +normal. @xref{Tabs}. + +@item --tabsize=@var{columns} +Assume that tab stops are set every @var{columns} (default 8) print +columns. @xref{Tabs}. + +@item --suppress-blank-empty +Suppress any blanks before newlines when printing the representation +of an empty line, when outputting normal, context, or unified format. +@xref{Trailing Blanks}. + +@item --to-file=@var{file} +Compare each operand to @var{file}; @var{file} may be a directory. + +@item -u +Use the unified output format, showing three lines of context. +@xref{Unified Format}. + +@item --unchanged-group-format=@var{format} +Use @var{format} to output a group of common lines taken from both files +in if-then-else format. @xref{Line Group Formats}. + +@item --unchanged-line-format=@var{format} +Use @var{format} to output a line common to both files in if-then-else +format. @xref{Line Formats}. + +@item --unidirectional-new-file +If a first file is missing, treat it as present but empty. +@xref{Comparing Directories}. + +@item -U @var{lines} +@itemx --unified@r{[}=@var{lines}@r{]} +Use the unified output format, showing @var{lines} (an integer) lines of +context, or three if @var{lines} is not given. @xref{Unified Format}. +For proper operation, @command{patch} typically needs at least two lines of +context. + +On older systems, @command{diff} supports an obsolete option +@option{-@var{lines}} that has effect when combined with @option{-u}. +POSIX 1003.1-2001 (@pxref{Standards conformance}) does not allow +this; use @option{-U @var{lines}} instead. + +@item -v +@itemx --version +Output version information and then exit. + +@item -w +@itemx --ignore-all-space +Ignore white space when comparing lines. @xref{White Space}. + +@item -W @var{columns} +@itemx --width=@var{columns} +Output at most @var{columns} (default 130) print columns per line in +side by side format. @xref{Side by Side Format}. + +@item -x @var{pattern} +@itemx --exclude=@var{pattern} +When comparing directories, ignore files and subdirectories whose basenames +match @var{pattern}. @xref{Comparing Directories}. + +@item -X @var{file} +@itemx --exclude-from=@var{file} +When comparing directories, ignore files and subdirectories whose basenames +match any pattern contained in @var{file}. @xref{Comparing Directories}. + +@item -y +@itemx --side-by-side +Use the side by side output format. @xref{Side by Side Format}. + +@item -Z +@itemx --ignore-trailing-space +Ignore white space at line end. @xref{White Space}. +@end table + +@node Invoking diff3 +@chapter Invoking @command{diff3} +@cindex invoking @command{diff3} +@cindex @command{diff3} invocation + +The @command{diff3} command compares three files and outputs descriptions +of their differences. Its arguments are as follows: + +@example +diff3 @var{options}@dots{} @var{mine} @var{older} @var{yours} +@end example + +The files to compare are @var{mine}, @var{older}, and @var{yours}. +At most one of these three file names may be @file{-}, +which tells @command{diff3} to read the standard input for that file. + +An exit status of 0 means @command{diff3} was successful, 1 means some +conflicts were found, and 2 means trouble. + +@menu +* diff3 Options:: Summary of options to @command{diff3}. +@end menu + +@node diff3 Options +@section Options to @command{diff3} +@cindex @command{diff3} options +@cindex options for @command{diff3} + +Below is a summary of all of the options that GNU @command{diff3} +accepts. Multiple single letter options (unless they take an argument) +can be combined into a single command line argument. + +@table @option +@item -a +@itemx --text +Treat all files as text and compare them line-by-line, even if they +do not appear to be text. @xref{Binary}. + +@item -A +@itemx --show-all +Incorporate all unmerged changes from @var{older} to @var{yours} into +@var{mine}, surrounding conflicts with bracket lines. +@xref{Marking Conflicts}. + +@item --diff-program=@var{program} +Use the compatible comparison program @var{program} to compare files +instead of @command{diff}. + +@item -e +@itemx --ed +Generate an @command{ed} script that incorporates all the changes from +@var{older} to @var{yours} into @var{mine}. @xref{Which Changes}. + +@item -E +@itemx --show-overlap +Like @option{-e}, except bracket lines from overlapping changes' first +and third files. +@xref{Marking Conflicts}. +With @option{-E}, an overlapping change looks like this: + +@example +<<<<<<< @var{mine} +@r{lines from @var{mine}} +======= +@r{lines from @var{yours}} +>>>>>>> @var{yours} +@end example + +@item --help +Output a summary of usage and then exit. + +@item -i +Generate @samp{w} and @samp{q} commands at the end of the @command{ed} +script for System V compatibility. This option must be combined with +one of the @option{-AeExX3} options, and may not be combined with @option{-m}. +@xref{Saving the Changed File}. + +@item --label=@var{label} +Use the label @var{label} for the brackets output by the @option{-A}, +@option{-E} and @option{-X} options. This option may be given up to three +times, one for each input file. The default labels are the names of +the input files. Thus @samp{diff3 --label X --label Y --label Z -m A +B C} acts like +@samp{diff3 -m A B C}, except that the output looks like it came from +files named @samp{X}, @samp{Y} and @samp{Z} rather than from files +named @samp{A}, @samp{B} and @samp{C}. @xref{Marking Conflicts}. + +@item -m +@itemx --merge +Apply the edit script to the first file and send the result to standard +output. Unlike piping the output from @command{diff3} to @command{ed}, this +works even for binary files and incomplete lines. @option{-A} is assumed +if no edit script option is specified. @xref{Bypassing ed}. + +@item --strip-trailing-cr +Strip any trailing carriage return at the end of an input line. +@xref{Binary}. + +@item -T +@itemx --initial-tab +Output a tab rather than two spaces before the text of a line in normal format. +This causes the alignment of tabs in the line to look normal. @xref{Tabs}. + +@item -v +@itemx --version +Output version information and then exit. + +@item -x +@itemx --overlap-only +Like @option{-e}, except output only the overlapping changes. +@xref{Which Changes}. + +@item -X +Like @option{-E}, except output only the overlapping changes. +In other words, like @option{-x}, except bracket changes as in @option{-E}. +@xref{Marking Conflicts}. + +@item -3 +@itemx --easy-only +Like @option{-e}, except output only the nonoverlapping changes. +@xref{Which Changes}. +@end table + +@node Invoking patch +@chapter Invoking @command{patch} +@cindex invoking @command{patch} +@cindex @command{patch} invocation + +Normally @command{patch} is invoked like this: + +@example +patch <@var{patchfile} +@end example + +The full format for invoking @command{patch} is: + +@example +patch @var{options}@dots{} @r{[}@var{origfile} @r{[}@var{patchfile}@r{]}@r{]} +@end example + +You can also specify where to read the patch from with the @option{-i +@var{patchfile}} or @option{--input=@var{patchfile}} option. +If you do not specify @var{patchfile}, or if @var{patchfile} is +@file{-}, @command{patch} reads the patch (that is, the @command{diff} output) +from the standard input. + +If you do not specify an input file on the command line, @command{patch} +tries to intuit from the @dfn{leading text} (any text in the patch +that comes before the @command{diff} output) which file to edit. +@xref{Multiple Patches}. + +By default, @command{patch} replaces the original input file with the +patched version, possibly after renaming the original file into a +backup file (@pxref{Backup Names}, for a description of how +@command{patch} names backup files). You can also specify where to +put the output with the @option{-o @var{file}} or +@option{--output=@var{file}} option; however, do not use this option +if @var{file} is one of the input files. + +@menu +* patch Options:: Summary table of options to @command{patch}. +@end menu + +@node patch Options +@section Options to @command{patch} +@cindex @command{patch} options +@cindex options for @command{patch} + +Here is a summary of all of the options that GNU @command{patch} +accepts. @xref{patch and Tradition}, for which of these options are +safe to use in older versions of @command{patch}. + +Multiple single-letter options that do not take an argument can be +combined into a single command line argument with only one dash. + +@table @option +@item -b +@itemx --backup +Back up the original contents of each file, even if backups would +normally not be made. @xref{Backups}. + +@item -B @var{prefix} +@itemx --prefix=@var{prefix} +Prepend @var{prefix} to backup file names. @xref{Backup Names}. + +@item --backup-if-mismatch +Back up the original contents of each file if the patch does not +exactly match the file. This is the default behavior when not +conforming to POSIX. @xref{Backups}. + +@item --binary +Read and write all files in binary mode, except for standard output +and @file{/dev/tty}. This option has no effect on +POSIX-conforming systems like GNU/Linux. On systems where +this option makes a difference, the patch should be generated by +@samp{diff -a --binary}. @xref{Binary}. + +@item -c +@itemx --context +Interpret the patch file as a context diff. @xref{patch Input}. + +@item -d @var{directory} +@itemx --directory=@var{directory} +Make directory @var{directory} the current directory for interpreting +both file names in the patch file, and file names given as arguments to +other options. @xref{patch Directories}. + +@item -D @var{name} +@itemx --ifdef=@var{name} +Make merged if-then-else output using @var{name}. @xref{If-then-else}. + +@item --dry-run +Print the results of applying the patches without actually changing +any files. @xref{Dry Runs}. + +@item -e +@itemx --ed +Interpret the patch file as an @command{ed} script. @xref{patch Input}. + +@item -E +@itemx --remove-empty-files +Remove output files that are empty after the patches have been applied. +@xref{Creating and Removing}. + +@item -f +@itemx --force +Assume that the user knows exactly what he or she is doing, and do not +ask any questions. @xref{patch Messages}. + +@item -F @var{lines} +@itemx --fuzz=@var{lines} +Set the maximum fuzz factor to @var{lines}. @xref{Inexact}. + +@item -g @var{num} +@itemx --get=@var{num} +If @var{num} is positive, get input files from a revision control +system as necessary; if zero, do not get the files; if negative, ask +the user whether to get the files. @xref{Revision Control}. + +@item --help +Output a summary of usage and then exit. + +@item -i @var{patchfile} +@itemx --input=@var{patchfile} +Read the patch from @var{patchfile} rather than from standard input. +@xref{patch Options}. + +@item -l +@itemx --ignore-white-space +Let any sequence of blanks (spaces or tabs) in the patch file match +any sequence of blanks in the input file. @xref{Changed White Space}. + +@item -n +@itemx --normal +Interpret the patch file as a normal diff. @xref{patch Input}. + +@item -N +@itemx --forward +Ignore patches that @command{patch} thinks are reversed or already applied. +See also @option{-R}. @xref{Reversed Patches}. + +@item --no-backup-if-mismatch +Do not back up the original contents of files. This is the default +behavior when conforming to POSIX. @xref{Backups}. + +@item -o @var{file} +@itemx --output=@var{file} +Use @var{file} as the output file name. @xref{patch Options}. + +@item -p@var{number} +@itemx --strip=@var{number} +Set the file name strip count to @var{number}. @xref{patch Directories}. + +@item --posix +Conform to POSIX, as if the @env{POSIXLY_CORRECT} environment +variable had been set. @xref{patch and POSIX}. + +@item --quoting-style=@var{word} +Use style @var{word} to quote names in diagnostics, as if the +@env{QUOTING_STYLE} environment variable had been set to @var{word}. +@xref{patch Quoting Style}. + +@item -r @var{reject-file} +@itemx --reject-file=@var{reject-file} +Use @var{reject-file} as the reject file name. @xref{Reject Names}. + +@item -R +@itemx --reverse +Assume that this patch was created with the old and new files swapped. +@xref{Reversed Patches}. + +@item -s +@itemx --quiet +@itemx --silent +Work silently unless an error occurs. @xref{patch Messages}. + +@item -t +@itemx --batch +Do not ask any questions. @xref{patch Messages}. + +@item -T +@itemx --set-time +Set the modification and access times of patched files from timestamps +given in context diff headers, assuming that the context diff +headers use local time. @xref{Patching Timestamps}. + +@item -u +@itemx --unified +Interpret the patch file as a unified diff. @xref{patch Input}. + +@item -v +@itemx --version +Output version information and then exit. + +@item -V @var{backup-style} +@itemx --version=control=@var{backup-style} +Select the naming convention for backup file names. @xref{Backup Names}. + +@item --verbose +Print more diagnostics than usual. @xref{patch Messages}. + +@item -x @var{number} +@itemx --debug=@var{number} +Set internal debugging flags. Of interest only to @command{patch} +patchers. + +@item -Y @var{prefix} +@itemx --basename-prefix=@var{prefix} +Prepend @var{prefix} to base names of backup files. @xref{Backup Names}. + +@item -z @var{suffix} +@itemx --suffix=@var{suffix} +Use @var{suffix} as the backup extension instead of @samp{.orig} or +@samp{~}. @xref{Backup Names}. + +@item -Z +@itemx --set-utc +Set the modification and access times of patched files from timestamps +given in context diff headers, assuming that the context diff +headers use UTC. @xref{Patching Timestamps}. + +@end table + +@node Invoking sdiff +@chapter Invoking @command{sdiff} +@cindex invoking @command{sdiff} +@cindex @command{sdiff} invocation + +The @command{sdiff} command merges two files and interactively outputs the +results. Its arguments are as follows: + +@example +sdiff -o @var{outfile} @var{options}@dots{} @var{from-file} @var{to-file} +@end example + +This merges @var{from-file} with @var{to-file}, with output to @var{outfile}. +If @var{from-file} is a directory and @var{to-file} is not, @command{sdiff} +compares the file in @var{from-file} whose file name is that of @var{to-file}, +and vice versa. @var{from-file} and @var{to-file} may not both be +directories. + +@command{sdiff} options begin with @samp{-}, so normally @var{from-file} +and @var{to-file} may not begin with @samp{-}. However, @option{--} as an +argument by itself treats the remaining arguments as file names even if +they begin with @samp{-}. You may not use @file{-} as an input file. + +@command{sdiff} without @option{--output} (@option{-o}) produces a +side-by-side difference. This usage is obsolete; use the +@option{--side-by-side} (@option{-y}) option of @command{diff} instead. + +An exit status of 0 means no differences were found, 1 means some +differences were found, and 2 means trouble. + +@menu +* sdiff Options:: Summary of options to @command{diff}. +@end menu + +@node sdiff Options +@section Options to @command{sdiff} +@cindex @command{sdiff} options +@cindex options for @command{sdiff} + +Below is a summary of all of the options that GNU +@command{sdiff} accepts. Each option has two equivalent names, one of +which is a single letter preceded by @samp{-}, and the other of which +is a long name preceded by @samp{--}. Multiple single letter options +(unless they take an argument) can be combined into a single command +line argument. Long named options can be abbreviated to any unique +prefix of their name. + +@table @option +@item -a +@itemx --text +Treat all files as text and compare them line-by-line, even if they +do not appear to be text. @xref{Binary}. + +@item -b +@itemx --ignore-space-change +Ignore changes in amount of white space. @xref{White Space}. + +@item -B +@itemx --ignore-blank-lines +Ignore changes that just insert or delete blank lines. @xref{Blank +Lines}. + +@item -d +@itemx --minimal +Change the algorithm to perhaps find a smaller set of changes. This +makes @command{sdiff} slower (sometimes much slower). @xref{diff +Performance}. + +@item --diff-program=@var{program} +Use the compatible comparison program @var{program} to compare files +instead of @command{diff}. + +@item -E +@itemx --ignore-tab-expansion +Ignore changes due to tab expansion. +@xref{White Space}. + +@item --help +Output a summary of usage and then exit. + +@item -i +@itemx --ignore-case +Ignore changes in case; consider upper- and lower-case to be the same. +@xref{Case Folding}. + +@item -I @var{regexp} +@itemx --ignore-matching-lines=@var{regexp} +Ignore changes that just insert or delete lines that match @var{regexp}. +@xref{Specified Lines}. + +@item -l +@itemx --left-column +Print only the left column of two common lines. +@xref{Side by Side Format}. + +@item -o @var{file} +@itemx --output=@var{file} +Put merged output into @var{file}. This option is required for merging. + +@item -s +@itemx --suppress-common-lines +Do not print common lines. @xref{Side by Side Format}. + +@item --speed-large-files +Use heuristics to speed handling of large files that have numerous +scattered small changes. @xref{diff Performance}. + +@item --strip-trailing-cr +Strip any trailing carriage return at the end of an input line. +@xref{Binary}. + +@item -t +@itemx --expand-tabs +Expand tabs to spaces in the output, to preserve the alignment of tabs +in the input files. @xref{Tabs}. + +@item --tabsize=@var{columns} +Assume that tab stops are set every @var{columns} (default 8) print +columns. @xref{Tabs}. + +@item -v +@itemx --version +Output version information and then exit. + +@item -w @var{columns} +@itemx --width=@var{columns} +Output at most @var{columns} (default 130) print columns per line. +@xref{Side by Side Format}. Note that for historical reasons, this +option is @option{-W} in @command{diff}, @option{-w} in @command{sdiff}. + +@item -W +@itemx --ignore-all-space +Ignore white space when comparing lines. @xref{White Space}. +Note that for historical reasons, this option is @option{-w} in @command{diff}, +@option{-W} in @command{sdiff}. + +@item -Z +@itemx --ignore-trailing-space +Ignore white space at line end. @xref{White Space}. +@end table + +@node Standards conformance +@chapter Standards conformance +@cindex POSIX + +@vindex POSIXLY_CORRECT +In a few cases, the GNU utilities' default behavior is +incompatible with the POSIX standard. To suppress these +incompatibilities, define the @env{POSIXLY_CORRECT} environment +variable. Unless you are checking for POSIX conformance, you +probably do not need to define @env{POSIXLY_CORRECT}. + +Normally options and operands can appear in any order, and programs act +as if all the options appear before any operands. For example, +@samp{diff lao tzu -C 2} acts like @samp{diff -C 2 lao tzu}, since +@samp{2} is an option-argument of @option{-C}. However, if the +@env{POSIXLY_CORRECT} environment variable is set, options must appear +before operands, unless otherwise specified for a particular command. + +Newer versions of POSIX are occasionally incompatible with older +versions. For example, older versions of POSIX allowed the +command @samp{diff -c -10} to have the same meaning as @samp{diff -C +10}, but POSIX 1003.1-2001 @samp{diff} no longer allows +digit-string options like @option{-10}. + +@vindex _POSIX2_VERSION +The GNU utilities normally conform to the version of POSIX +that is standard for your system. To cause them to conform to a +different version of POSIX, define the @env{_POSIX2_VERSION} +environment variable to a value of the form @var{yyyymm} specifying +the year and month the standard was adopted. Two values are currently +supported for @env{_POSIX2_VERSION}: @samp{199209} stands for +POSIX 1003.2-1992, and @samp{200112} stands for POSIX +1003.1-2001. For example, if you are running older software that +assumes an older version of POSIX and uses @samp{diff -c -10}, +you can work around the compatibility problems by setting +@samp{_POSIX2_VERSION=199209} in your environment. + +@node Projects +@chapter Future Projects + +Here are some ideas for improving GNU @command{diff} and +@command{patch}. The GNU project has identified some +improvements as potential programming projects for volunteers. You +can also help by reporting any bugs that you find. + +If you are a programmer and would like to contribute something to the +GNU project, please consider volunteering for one of these +projects. If you are seriously contemplating work, please write to +@email{gvc@@gnu.org} to coordinate with other volunteers. + +@menu +* Shortcomings:: Suggested projects for improvements. +* Bugs:: Reporting bugs. +@end menu + +@node Shortcomings +@section Suggested Projects for Improving GNU @command{diff} and @command{patch} +@cindex projects for directories + +One should be able to use GNU @command{diff} to generate a +patch from any pair of directory trees, and given the patch and a copy +of one such tree, use @command{patch} to generate a faithful copy of +the other. Unfortunately, some changes to directory trees cannot be +expressed using current patch formats; also, @command{patch} does not +handle some of the existing formats. These shortcomings motivate the +following suggested projects. + +@menu +* Internationalization:: Handling multibyte and varying-width characters. +* Changing Structure:: Handling changes to the directory structure. +* Special Files:: Handling symbolic links, device special files, etc. +* Unusual File Names:: Handling file names that contain unusual characters. +* Timestamp Order:: Outputting diffs in timestamp order. +* Ignoring Changes:: Ignoring certain changes while showing others. +* Speedups:: Improving performance. +@end menu + +@node Internationalization +@subsection Handling Multibyte and Varying-Width Characters +@cindex multibyte characters +@cindex varying-width characters + +@command{diff}, @command{diff3} and @command{sdiff} treat each line of +input as a string of unibyte characters. This can mishandle multibyte +characters in some cases. For example, when asked to ignore spaces, +@command{diff} does not properly ignore a multibyte space character. + +Also, @command{diff} currently assumes that each byte is one column +wide, and this assumption is incorrect in some locales, e.g., locales +that use UTF-8 encoding. This causes problems with the @option{-y} or +@option{--side-by-side} option of @command{diff}. + +These problems need to be fixed without unduly affecting the +performance of the utilities in unibyte environments. + +The IBM GNU/Linux Technology Center Internationalization Team has +proposed +@uref{http://oss.software.ibm.com/developer/opensource/linux/patches/i18n/diffutils-2.7.2-i18n-0.1.patch.gz,patches +to support internationalized @command{diff}}. +Unfortunately, these patches are incomplete and are to an older +version of @command{diff}, so more work needs to be done in this area. + +@node Changing Structure +@subsection Handling Changes to the Directory Structure +@cindex directory structure changes + +@command{diff} and @command{patch} do not handle some changes to directory +structure. For example, suppose one directory tree contains a directory +named @samp{D} with some subsidiary files, and another contains a file +with the same name @samp{D}. @samp{diff -r} does not output enough +information for @command{patch} to transform the directory subtree into +the file. + +There should be a way to specify that a file has been removed without +having to include its entire contents in the patch file. There should +also be a way to tell @command{patch} that a file was renamed, even if +there is no way for @command{diff} to generate such information. +There should be a way to tell @command{patch} that a file's timestamp +has changed, even if its contents have not changed. + +These problems can be fixed by extending the @command{diff} output format +to represent changes in directory structure, and extending @command{patch} +to understand these extensions. + +@node Special Files +@subsection Files that are Neither Directories Nor Regular Files +@cindex special files + +Some files are neither directories nor regular files: they are unusual +files like symbolic links, device special files, named pipes, and +sockets. Currently, @command{diff} treats symbolic links as if they +were the pointed-to files, except that a recursive @command{diff} +reports an error if it detects infinite loops of symbolic links (e.g., +symbolic links to @file{..}). @command{diff} treats other special +files like regular files if they are specified at the top level, but +simply reports their presence when comparing directories. This means +that @command{patch} cannot represent changes to such files. For +example, if you change which file a symbolic link points to, +@command{diff} outputs the difference between the two files, instead +of the change to the symbolic link. + +@c This might not be a good idea; is it wise for root to install devices +@c this way? +@command{diff} should optionally report changes to special files specially, +and @command{patch} should be extended to understand these extensions. + +@node Unusual File Names +@subsection File Names that Contain Unusual Characters +@cindex file names with unusual characters + +When a file name contains an unusual character like a newline or +white space, @samp{diff -r} generates a patch that @command{patch} cannot +parse. The problem is with format of @command{diff} output, not just with +@command{patch}, because with odd enough file names one can cause +@command{diff} to generate a patch that is syntactically correct but +patches the wrong files. The format of @command{diff} output should be +extended to handle all possible file names. + +@node Timestamp Order +@subsection Outputting Diffs in Timestamp Order + +Applying @command{patch} to a multiple-file diff can result in files +whose timestamps are out of order. GNU @command{patch} has +options to restore the timestamps of the updated files +(@pxref{Patching Timestamps}), but sometimes it is useful to generate +a patch that works even if the recipient does not have GNU patch, +or does not use these options. One way to do this would be to +implement a @command{diff} option to output diffs in timestamp order. + +@node Ignoring Changes +@subsection Ignoring Certain Changes + +It would be nice to have a feature for specifying two strings, one in +@var{from-file} and one in @var{to-file}, which should be considered to +match. Thus, if the two strings are @samp{foo} and @samp{bar}, then if +two lines differ only in that @samp{foo} in file 1 corresponds to +@samp{bar} in file 2, the lines are treated as identical. + +It is not clear how general this feature can or should be, or +what syntax should be used for it. + +A partial substitute is to filter one or both files before comparing, +e.g.: + +@example +sed 's/foo/bar/g' file1 | diff - file2 +@end example + +However, this outputs the filtered text, not the original. + +@node Speedups +@subsection Improving Performance + +When comparing two large directory structures, one of which was +originally copied from the other with timestamps preserved (e.g., +with @samp{cp -pR}), it would greatly improve performance if an option +told @command{diff} to assume that two files with the same size and +timestamps have the same content. @xref{diff Performance}. + +@node Bugs +@section Reporting Bugs +@cindex bug reports +@cindex reporting bugs + +If you think you have found a bug in GNU @command{cmp}, +@command{diff}, @command{diff3}, or @command{sdiff}, please report it +by electronic mail to the +@uref{http://mail.gnu.org/mailman/listinfo/bug-diffutils,GNU utilities +bug report mailing list} @email{bug-diffutils@@gnu.org}. Please send +bug reports for GNU @command{patch} to +@email{bug-patch@@gnu.org}. Send as precise a description of the +problem as you can, including the output of the @option{--version} +option and sample input files that produce the bug, if applicable. If +you have a nontrivial fix for the bug, please send it as well. If you +have a patch, please send it too. It may simplify the maintainer's +job if the patch is relative to a recent test release, which you can +find in the directory @uref{ftp://alpha.gnu.org/gnu/diffutils/}. + +@node Copying This Manual +@appendix Copying This Manual +@include fdl.texi + +@node Translations +@appendix Translations of This Manual + +Nishio Futoshi of the GNUjdoc project has prepared a Japanese +translation of this manual. Its most recent version can be found at +@uref{http://openlab.ring.gr.jp/gnujdoc/cvsweb/cvsweb.cgi/gnujdoc/}. + +@node Index +@appendix Index + +@printindex cp + +@bye diff --git a/local/recipes/tools/diffutils/source/doc/fdl.texi b/local/recipes/tools/diffutils/source/doc/fdl.texi new file mode 100644 index 0000000000..9c3bbe56e9 --- /dev/null +++ b/local/recipes/tools/diffutils/source/doc/fdl.texi @@ -0,0 +1,505 @@ +@c The GNU Free Documentation License. +@center Version 1.3, 3 November 2008 + +@c This file is intended to be included within another document, +@c hence no sectioning command or @node. + +@display +Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. +@uref{http://fsf.org/} + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +@end display + +@enumerate 0 +@item +PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +functional and useful document @dfn{free} in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of ``copyleft'', which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + +@item +APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The ``Document'', below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as ``you''. You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A ``Modified Version'' of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A ``Secondary Section'' is a named appendix or a front-matter section +of the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The ``Invariant Sections'' are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The ``Cover Texts'' are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A ``Transparent'' copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not ``Transparent'' is called ``Opaque''. + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, La@TeX{} input +format, SGML or XML using a publicly available +DTD, and standard-conforming simple HTML, +PostScript or PDF designed for human modification. Examples +of transparent image formats include PNG, XCF and +JPG@. Opaque formats include proprietary formats that can be +read and edited only by proprietary word processors, SGML or +XML for which the DTD and/or processing tools are +not generally available, and the machine-generated HTML, +PostScript or PDF produced by some word processors for +output purposes only. + +The ``Title Page'' means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, ``Title Page'' means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +The ``publisher'' means any person or entity that distributes copies +of the Document to the public. + +A section ``Entitled XYZ'' means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as ``Acknowledgements'', +``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' +of such a section when you modify the Document means that it remains a +section ``Entitled XYZ'' according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + +@item +VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + +@item +COPYING IN QUANTITY + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + +@item +MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +@enumerate A +@item +Use in the Title Page (and on the covers, if any) a title distinct +from that of the Document, and from those of previous versions +(which should, if there were any, be listed in the History section +of the Document). You may use the same title as a previous version +if the original publisher of that version gives permission. + +@item +List on the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has fewer than five), +unless they release you from this requirement. + +@item +State on the Title page the name of the publisher of the +Modified Version, as the publisher. + +@item +Preserve all the copyright notices of the Document. + +@item +Add an appropriate copyright notice for your modifications +adjacent to the other copyright notices. + +@item +Include, immediately after the copyright notices, a license notice +giving the public permission to use the Modified Version under the +terms of this License, in the form shown in the Addendum below. + +@item +Preserve in that license notice the full lists of Invariant Sections +and required Cover Texts given in the Document's license notice. + +@item +Include an unaltered copy of this License. + +@item +Preserve the section Entitled ``History'', Preserve its Title, and add +to it an item stating at least the title, year, new authors, and +publisher of the Modified Version as given on the Title Page. If +there is no section Entitled ``History'' in the Document, create one +stating the title, year, authors, and publisher of the Document as +given on its Title Page, then add an item describing the Modified +Version as stated in the previous sentence. + +@item +Preserve the network location, if any, given in the Document for +public access to a Transparent copy of the Document, and likewise +the network locations given in the Document for previous versions +it was based on. These may be placed in the ``History'' section. +You may omit a network location for a work that was published at +least four years before the Document itself, or if the original +publisher of the version it refers to gives permission. + +@item +For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve +the Title of the section, and preserve in the section all the +substance and tone of each of the contributor acknowledgements and/or +dedications given therein. + +@item +Preserve all the Invariant Sections of the Document, +unaltered in their text and in their titles. Section numbers +or the equivalent are not considered part of the section titles. + +@item +Delete any section Entitled ``Endorsements''. Such a section +may not be included in the Modified Version. + +@item +Do not retitle any existing section to be Entitled ``Endorsements'' or +to conflict in title with any Invariant Section. + +@item +Preserve any Warranty Disclaimers. +@end enumerate + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled ``Endorsements'', provided it contains +nothing but endorsements of your Modified Version by various +parties---for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + +@item +COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled ``History'' +in the various original documents, forming one section Entitled +``History''; likewise combine any sections Entitled ``Acknowledgements'', +and any sections Entitled ``Dedications''. You must delete all +sections Entitled ``Endorsements.'' + +@item +COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + +@item +AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an ``aggregate'' if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. + +@item +TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +If a section in the Document is Entitled ``Acknowledgements'', +``Dedications'', or ``History'', the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. + +@item +TERMINATION + +You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. + +@item +FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +@uref{http://www.gnu.org/copyleft/}. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License ``or any later version'' applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. + +@item +RELICENSING + +``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the +site means any set of copyrightable works thus published on the MMC +site. + +``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. + +``Incorporate'' means to publish or republish a Document, in whole or +in part, as part of another Document. + +An MMC is ``eligible for relicensing'' if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole +or in part into the MMC, (1) had no cover texts or invariant sections, +and (2) were thus incorporated prior to November 1, 2008. + +The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. + +@end enumerate + +@page +@heading ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + +@smallexample +@group + Copyright (C) @var{year} @var{your name}. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. +@end group +@end smallexample + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the ``with@dots{}Texts.''@: line with this: + +@smallexample +@group + with the Invariant Sections being @var{list their titles}, with + the Front-Cover Texts being @var{list}, and with the Back-Cover Texts + being @var{list}. +@end group +@end smallexample + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. + +@c Local Variables: +@c ispell-local-pdict: "ispell-dict" +@c End: diff --git a/local/recipes/tools/diffutils/source/doc/stamp-vti b/local/recipes/tools/diffutils/source/doc/stamp-vti new file mode 100644 index 0000000000..afaf160b10 --- /dev/null +++ b/local/recipes/tools/diffutils/source/doc/stamp-vti @@ -0,0 +1,4 @@ +@set UPDATED 6 May 2017 +@set UPDATED-MONTH May 2017 +@set EDITION 3.6 +@set VERSION 3.6 diff --git a/local/recipes/tools/diffutils/source/doc/version.texi b/local/recipes/tools/diffutils/source/doc/version.texi new file mode 100644 index 0000000000..afaf160b10 --- /dev/null +++ b/local/recipes/tools/diffutils/source/doc/version.texi @@ -0,0 +1,4 @@ +@set UPDATED 6 May 2017 +@set UPDATED-MONTH May 2017 +@set EDITION 3.6 +@set VERSION 3.6 diff --git a/local/recipes/tools/diffutils/source/exgettext b/local/recipes/tools/diffutils/source/exgettext new file mode 100755 index 0000000000..b825b1d6b8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/exgettext @@ -0,0 +1,114 @@ +#! /bin/sh +# Wrapper around gettext for programs using the msgid convention. + +# Copyright (C) 1998, 2001, 2004, 2009-2013, 2015-2017 Free Software +# Foundation, Inc. + +# Written by Paul Eggert <eggert@twinsun.com>. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Always operate in the C locale. +LANG=C +LANGUAGE=C +LC_ALL=C +export LANG LANGUAGE LC_ALL + +# Set AWK if environment has not already set it. +AWK=${AWK-awk} + +# The argument to this wrapper is the xgettext command to be executed. +# Extract the xgettext program name from the rest of the command. +xgettext=${1?} +shift + +# Save work if we're just wrapping a no-op. +case $xgettext in +:) exit;; +esac + +# Find the files to be scanned, and the directory to scan them from. +directory=. +files= +for i +do + case $i in + --directory=*) + directory=`expr " $i" : ' --directory=\(.*\)'`;; + --files-from=*) + files_from=`expr " $i" : ' --files-from=\(.*\)'` + files=`$AWK '/^[^#]/ { print }' $files_from`;; + esac +done + +# Generate keyword options for xgettext, +# by scanning for declarations of functions +# whose parameter names end in "msgid". +generate_keyword_options=' + /^[A-Z_a-z].*\(.*msgid[,)]/ { + + paren_index = index($0, "(") + + name = substr($0, 1, paren_index - 1) + sub(/[^0-9A-Z_a-z]*$/, "", name) + sub(/[ ]+PARAMS/, "", name) + sub(/[ ]+VPARAMS/, "", name) + sub(/.*[^0-9A-Z_a-z]/, "", name) + + args = substr($0, paren_index) + sub(/msgid[,)].*/, "", args) + for (n = 1; sub(/^[^,]*,/, "", args); n++) { + continue; + } + + if (n == 1) { + keyword = name + } else { + keyword = name ":" n + } + + if (! keyword_seen[keyword]++) { + print "--keyword=" keyword + } + } +' +keyword_options=`( + cd $directory && + $AWK "$generate_keyword_options" $files < /dev/null +)` || exit + +# Run the xgettext command, with extra input containing the extra +# msgids that it wouldn't normally find. +generate_emsgids=' + /%e.*}/ { + line = $0 + while ((percent_index = index(line, "%e")) != 0) { + line = substr(line, percent_index + 2) + bracket_index = index(line, "}") + if (bracket_index == 0) { + continue + } + msgid = substr(line, 1, bracket_index - 1) + if (index(msgid, "%") != 0) { + continue + } + printf "#line %d \"%s\"\n", FNR, FILENAME + printf "_(\"%s\")\n", msgid + line = substr(line, bracket_index + 1) + } + } +' +(cd $directory && + $AWK "$generate_emsgids" $files < /dev/null +) | "$xgettext" $keyword_options ${1+"$@"} - diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/Makefile.am b/local/recipes/tools/diffutils/source/gnulib-tests/Makefile.am new file mode 100644 index 0000000000..6635f70657 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/Makefile.am @@ -0,0 +1 @@ +include gnulib.mk diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/Makefile.in b/local/recipes/tools/diffutils/source/gnulib-tests/Makefile.in new file mode 100644 index 0000000000..e66ab6edf4 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/Makefile.in @@ -0,0 +1,5764 @@ +# Makefile.in generated by automake 1.18.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2025 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Copyright (C) 2002-2017 Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this file. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception to the GNU General Public License, +# this file may be distributed as part of a program that +# contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# Generated by gnulib-tool. + + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +am__rm_f = rm -f $(am__rm_f_notfound) +am__rm_rf = rm -rf $(am__rm_f_notfound) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +TESTS = test-accept$(EXEEXT) test-alloca-opt$(EXEEXT) \ + test-areadlink$(EXEEXT) test-argmatch$(EXEEXT) \ + test-arpa_inet$(EXEEXT) test-binary-io.sh test-bind$(EXEEXT) \ + test-bitrotate$(EXEEXT) test-btowc1.sh test-btowc2.sh \ + test-c-ctype$(EXEEXT) test-c-stack.sh test-c-stack2.sh \ + test-c-strcase.sh test-close$(EXEEXT) test-connect$(EXEEXT) \ + test-ctype$(EXEEXT) test-dirname$(EXEEXT) test-dup2$(EXEEXT) \ + test-environ$(EXEEXT) test-errno$(EXEEXT) test-exclude1.sh \ + test-exclude2.sh test-exclude3.sh test-exclude4.sh \ + test-exclude5.sh test-exclude6.sh test-exclude7.sh \ + test-exclude8.sh test-fcntl-h$(EXEEXT) test-fcntl$(EXEEXT) \ + test-fdopen$(EXEEXT) test-fgetc$(EXEEXT) \ + test-filenamecat$(EXEEXT) test-float$(EXEEXT) \ + test-fnmatch$(EXEEXT) test-fputc$(EXEEXT) test-fread$(EXEEXT) \ + test-freopen-safer$(EXEEXT) test-freopen$(EXEEXT) \ + test-fstat$(EXEEXT) test-ftruncate.sh test-fwrite$(EXEEXT) \ + test-getcwd-lgpl$(EXEEXT) test-getdtablesize$(EXEEXT) \ + test-getopt-gnu$(EXEEXT) test-getopt-posix$(EXEEXT) \ + test-getprogname$(EXEEXT) test-gettimeofday$(EXEEXT) \ + test-hash$(EXEEXT) test-iconv-h$(EXEEXT) test-iconv$(EXEEXT) \ + test-ignore-value$(EXEEXT) test-inet_pton$(EXEEXT) \ + test-intprops$(EXEEXT) test-inttostr$(EXEEXT) \ + test-inttypes$(EXEEXT) test-ioctl$(EXEEXT) \ + test-isblank$(EXEEXT) test-iswblank$(EXEEXT) \ + test-langinfo$(EXEEXT) test-limits-h$(EXEEXT) \ + test-listen$(EXEEXT) test-locale$(EXEEXT) \ + test-localeconv$(EXEEXT) test-lstat$(EXEEXT) \ + test-malloca$(EXEEXT) test-mbrtowc1.sh test-mbrtowc2.sh \ + test-mbrtowc3.sh test-mbrtowc4.sh test-mbrtowc5.sh \ + test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh \ + test-mbrtowc-w32-3.sh test-mbrtowc-w32-4.sh \ + test-mbrtowc-w32-5.sh test-mbscasecmp.sh test-mbsinit.sh \ + test-mbsrtowcs1.sh test-mbsrtowcs2.sh test-mbsrtowcs3.sh \ + test-mbsrtowcs4.sh test-mbsstr1$(EXEEXT) test-mbsstr2.sh \ + test-mbsstr3.sh test-memchr$(EXEEXT) test-nanosleep$(EXEEXT) \ + test-netinet_in$(EXEEXT) test-nl_langinfo.sh \ + test-open$(EXEEXT) test-pathmax$(EXEEXT) test-perror.sh \ + test-perror2$(EXEEXT) test-pipe$(EXEEXT) \ + test-quotearg-simple$(EXEEXT) test-raise$(EXEEXT) \ + test-rawmemchr$(EXEEXT) test-readlink$(EXEEXT) \ + test-regex$(EXEEXT) test-select$(EXEEXT) test-select-in.sh \ + test-select-out.sh test-setenv$(EXEEXT) test-setlocale1.sh \ + test-setlocale2.sh test-setsockopt$(EXEEXT) \ + test-sh-quote$(EXEEXT) test-sigaction$(EXEEXT) \ + test-signal-h$(EXEEXT) test-sigprocmask$(EXEEXT) \ + test-sleep$(EXEEXT) test-snprintf$(EXEEXT) \ + test-sockets$(EXEEXT) test-stat$(EXEEXT) \ + test-stat-time$(EXEEXT) test-stdalign$(EXEEXT) \ + test-stdbool$(EXEEXT) test-stddef$(EXEEXT) \ + test-stdint$(EXEEXT) test-stdio$(EXEEXT) test-stdlib$(EXEEXT) \ + test-strerror$(EXEEXT) test-strerror_r$(EXEEXT) \ + test-strftime$(EXEEXT) test-striconv$(EXEEXT) \ + test-string$(EXEEXT) test-strings$(EXEEXT) \ + test-strnlen$(EXEEXT) test-strtoull$(EXEEXT) \ + test-strtoumax$(EXEEXT) test-symlink$(EXEEXT) \ + test-sys_ioctl$(EXEEXT) test-sys_select$(EXEEXT) \ + test-sys_socket$(EXEEXT) test-sys_stat$(EXEEXT) \ + test-sys_time$(EXEEXT) test-sys_types$(EXEEXT) \ + test-sys_uio$(EXEEXT) test-sys_wait$(EXEEXT) test-init.sh \ + test-time$(EXEEXT) test-timespec$(EXEEXT) test-unistd$(EXEEXT) \ + test-u8-mbtoucr$(EXEEXT) test-u8-uctomb$(EXEEXT) \ + test-uc_width$(EXEEXT) uniwidth/test-uc_width2.sh \ + test-unsetenv$(EXEEXT) test-update-copyright.sh \ + test-vasnprintf$(EXEEXT) test-vasprintf$(EXEEXT) \ + test-vc-list-files-git.sh test-vc-list-files-cvs.sh \ + test-verify$(EXEEXT) test-verify.sh test-version-etc.sh \ + test-wchar$(EXEEXT) test-wcrtomb.sh test-wcrtomb-w32-1.sh \ + test-wcrtomb-w32-2.sh test-wcrtomb-w32-3.sh \ + test-wcrtomb-w32-4.sh test-wcrtomb-w32-5.sh \ + test-wctype-h$(EXEEXT) test-wcwidth$(EXEEXT) \ + test-xalloc-die.sh test-xstrtol.sh test-xstrtoumax.sh \ + test-xvasprintf$(EXEEXT) +XFAIL_TESTS = +noinst_PROGRAMS = +check_PROGRAMS = test-accept$(EXEEXT) test-alloca-opt$(EXEEXT) \ + test-areadlink$(EXEEXT) test-argmatch$(EXEEXT) \ + test-arpa_inet$(EXEEXT) test-binary-io$(EXEEXT) \ + test-bind$(EXEEXT) test-bitrotate$(EXEEXT) test-btowc$(EXEEXT) \ + test-c-ctype$(EXEEXT) test-c-stack$(EXEEXT) \ + test-c-strcasecmp$(EXEEXT) test-c-strncasecmp$(EXEEXT) \ + test-close$(EXEEXT) test-connect$(EXEEXT) test-ctype$(EXEEXT) \ + test-dirname$(EXEEXT) test-dup2$(EXEEXT) test-environ$(EXEEXT) \ + test-errno$(EXEEXT) test-exclude$(EXEEXT) \ + test-fcntl-h$(EXEEXT) test-fcntl$(EXEEXT) test-fdopen$(EXEEXT) \ + test-fgetc$(EXEEXT) test-filenamecat$(EXEEXT) \ + test-float$(EXEEXT) test-fnmatch$(EXEEXT) test-fputc$(EXEEXT) \ + test-fread$(EXEEXT) test-freopen-safer$(EXEEXT) \ + test-freopen$(EXEEXT) test-fstat$(EXEEXT) \ + test-ftruncate$(EXEEXT) test-fwrite$(EXEEXT) \ + test-getcwd-lgpl$(EXEEXT) test-getdtablesize$(EXEEXT) \ + test-getopt-gnu$(EXEEXT) test-getopt-posix$(EXEEXT) \ + test-getprogname$(EXEEXT) test-gettimeofday$(EXEEXT) \ + test-hash$(EXEEXT) test-iconv-h$(EXEEXT) test-iconv$(EXEEXT) \ + test-ignore-value$(EXEEXT) test-inet_pton$(EXEEXT) \ + test-intprops$(EXEEXT) test-inttostr$(EXEEXT) \ + test-inttypes$(EXEEXT) test-ioctl$(EXEEXT) \ + test-isblank$(EXEEXT) test-iswblank$(EXEEXT) \ + test-langinfo$(EXEEXT) test-limits-h$(EXEEXT) \ + test-listen$(EXEEXT) test-locale$(EXEEXT) \ + test-localeconv$(EXEEXT) test-lstat$(EXEEXT) \ + test-malloca$(EXEEXT) test-mbrtowc$(EXEEXT) \ + test-mbrtowc-w32$(EXEEXT) test-mbscasecmp$(EXEEXT) \ + test-mbsinit$(EXEEXT) test-mbsrtowcs$(EXEEXT) \ + test-mbsstr1$(EXEEXT) test-mbsstr2$(EXEEXT) \ + test-mbsstr3$(EXEEXT) test-memchr$(EXEEXT) \ + test-nanosleep$(EXEEXT) test-netinet_in$(EXEEXT) \ + test-nl_langinfo$(EXEEXT) test-open$(EXEEXT) \ + test-pathmax$(EXEEXT) test-perror$(EXEEXT) \ + test-perror2$(EXEEXT) test-pipe$(EXEEXT) \ + test-quotearg-simple$(EXEEXT) test-raise$(EXEEXT) \ + test-rawmemchr$(EXEEXT) test-readlink$(EXEEXT) \ + test-regex$(EXEEXT) test-select$(EXEEXT) \ + test-select-fd$(EXEEXT) test-select-stdin$(EXEEXT) \ + test-setenv$(EXEEXT) test-setlocale1$(EXEEXT) \ + test-setlocale2$(EXEEXT) test-setsockopt$(EXEEXT) \ + test-sh-quote$(EXEEXT) test-sigaction$(EXEEXT) \ + test-signal-h$(EXEEXT) test-sigprocmask$(EXEEXT) \ + test-sleep$(EXEEXT) test-snprintf$(EXEEXT) \ + test-sockets$(EXEEXT) test-stat$(EXEEXT) \ + test-stat-time$(EXEEXT) test-stdalign$(EXEEXT) \ + test-stdbool$(EXEEXT) test-stddef$(EXEEXT) \ + test-stdint$(EXEEXT) test-stdio$(EXEEXT) test-stdlib$(EXEEXT) \ + test-strerror$(EXEEXT) test-strerror_r$(EXEEXT) \ + test-strftime$(EXEEXT) test-striconv$(EXEEXT) \ + test-string$(EXEEXT) test-strings$(EXEEXT) \ + test-strnlen$(EXEEXT) test-strtoull$(EXEEXT) \ + test-strtoumax$(EXEEXT) test-symlink$(EXEEXT) \ + test-sys_ioctl$(EXEEXT) test-sys_select$(EXEEXT) \ + test-sys_socket$(EXEEXT) test-sys_stat$(EXEEXT) \ + test-sys_time$(EXEEXT) test-sys_types$(EXEEXT) \ + test-sys_uio$(EXEEXT) test-sys_wait$(EXEEXT) \ + test-time$(EXEEXT) test-timespec$(EXEEXT) test-unistd$(EXEEXT) \ + test-u8-mbtoucr$(EXEEXT) test-u8-uctomb$(EXEEXT) \ + test-uc_width$(EXEEXT) test-uc_width2$(EXEEXT) \ + test-unsetenv$(EXEEXT) test-vasnprintf$(EXEEXT) \ + test-vasprintf$(EXEEXT) test-verify$(EXEEXT) \ + test-version-etc$(EXEEXT) test-wchar$(EXEEXT) \ + test-wcrtomb$(EXEEXT) test-wcrtomb-w32$(EXEEXT) \ + test-wctype-h$(EXEEXT) test-wcwidth$(EXEEXT) \ + test-xalloc-die$(EXEEXT) test-xstrtol$(EXEEXT) \ + test-xstrtoul$(EXEEXT) test-xstrtoumax$(EXEEXT) \ + test-xvasprintf$(EXEEXT) +EXTRA_PROGRAMS = test-verify-try$(EXEEXT) +subdir = gnulib-tests +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ + $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \ + $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/btowc.m4 \ + $(top_srcdir)/m4/builtin-expect.m4 $(top_srcdir)/m4/c-stack.m4 \ + $(top_srcdir)/m4/clock_time.m4 $(top_srcdir)/m4/close.m4 \ + $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \ + $(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/ctype.m4 \ + $(top_srcdir)/m4/dirname.m4 \ + $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/extensions.m4 \ + $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fcntl-o.m4 \ + $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/filenamecat.m4 \ + $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \ + $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpieee.m4 \ + $(top_srcdir)/m4/freopen.m4 $(top_srcdir)/m4/fstat.m4 \ + $(top_srcdir)/m4/ftruncate.m4 $(top_srcdir)/m4/getcwd.m4 \ + $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/getpagesize.m4 \ + $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnu-make.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 \ + $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \ + $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \ + $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttostr.m4 \ + $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \ + $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \ + $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/iswblank.m4 \ + $(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ + $(top_srcdir)/m4/libunistring-base.m4 \ + $(top_srcdir)/m4/limits-h.m4 $(top_srcdir)/m4/localcharset.m4 \ + $(top_srcdir)/m4/locale-fr.m4 $(top_srcdir)/m4/locale-ja.m4 \ + $(top_srcdir)/m4/locale-tr.m4 $(top_srcdir)/m4/locale-zh.m4 \ + $(top_srcdir)/m4/locale_h.m4 $(top_srcdir)/m4/localeconv.m4 \ + $(top_srcdir)/m4/localtime-buffer.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ + $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/mbchar.m4 \ + $(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbslen.m4 \ + $(top_srcdir)/m4/mbsrtowcs.m4 $(top_srcdir)/m4/mbstate_t.m4 \ + $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \ + $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mkstemp.m4 \ + $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/mmap-anon.m4 \ + $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \ + $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \ + $(top_srcdir)/m4/nanosleep.m4 $(top_srcdir)/m4/netinet_in_h.m4 \ + $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \ + $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ + $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \ + $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/regex.m4 \ + $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/setlocale.m4 \ + $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/signalblocking.m4 \ + $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/socketlib.m4 \ + $(top_srcdir)/m4/sockets.m4 $(top_srcdir)/m4/socklen.m4 \ + $(top_srcdir)/m4/sockpfaf.m4 $(top_srcdir)/m4/ssize_t.m4 \ + $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \ + $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \ + $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/strcase.m4 $(top_srcdir)/m4/strerror.m4 \ + $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/strftime.m4 \ + $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strings_h.m4 \ + $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ + $(top_srcdir)/m4/strptime.m4 $(top_srcdir)/m4/strtoull.m4 \ + $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/symlink.m4 \ + $(top_srcdir)/m4/sys_ioctl_h.m4 \ + $(top_srcdir)/m4/sys_select_h.m4 \ + $(top_srcdir)/m4/sys_socket_h.m4 \ + $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ + $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \ + $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \ + $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \ + $(top_srcdir)/m4/time_rz.m4 $(top_srcdir)/m4/timegm.m4 \ + $(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \ + $(top_srcdir)/m4/tzset.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vararrays.m4 \ + $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vasprintf.m4 \ + $(top_srcdir)/m4/version-etc.m4 \ + $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \ + $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ + $(top_srcdir)/m4/wctomb.m4 $(top_srcdir)/m4/wctype_h.m4 \ + $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \ + $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xstrtol.m4 \ + $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ + $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/lib/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +LIBRARIES = $(noinst_LIBRARIES) +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +libtests_a_AR = $(AR) $(ARFLAGS) +libtests_a_RANLIB = $(RANLIB) +am__DEPENDENCIES_1 = +am_libtests_a_OBJECTS = dtotimespec.$(OBJEXT) hash-pjw.$(OBJEXT) \ + sockets.$(OBJEXT) sys_socket.$(OBJEXT) timespec-add.$(OBJEXT) \ + timespec-sub.$(OBJEXT) +libtests_a_OBJECTS = $(am_libtests_a_OBJECTS) +test_accept_SOURCES = test-accept.c +test_accept_OBJECTS = test-accept.$(OBJEXT) +am__DEPENDENCIES_2 = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_accept_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_alloca_opt_SOURCES = test-alloca-opt.c +test_alloca_opt_OBJECTS = test-alloca-opt.$(OBJEXT) +test_alloca_opt_LDADD = $(LDADD) +test_alloca_opt_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_areadlink_SOURCES = test-areadlink.c +test_areadlink_OBJECTS = test-areadlink.$(OBJEXT) +test_areadlink_LDADD = $(LDADD) +test_areadlink_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_argmatch_SOURCES = test-argmatch.c +test_argmatch_OBJECTS = test-argmatch.$(OBJEXT) +test_argmatch_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_arpa_inet_SOURCES = test-arpa_inet.c +test_arpa_inet_OBJECTS = test-arpa_inet.$(OBJEXT) +test_arpa_inet_LDADD = $(LDADD) +test_arpa_inet_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_binary_io_SOURCES = test-binary-io.c +test_binary_io_OBJECTS = test-binary-io.$(OBJEXT) +test_binary_io_LDADD = $(LDADD) +test_binary_io_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_bind_SOURCES = test-bind.c +test_bind_OBJECTS = test-bind.$(OBJEXT) +test_bind_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) +test_bitrotate_SOURCES = test-bitrotate.c +test_bitrotate_OBJECTS = test-bitrotate.$(OBJEXT) +test_bitrotate_LDADD = $(LDADD) +test_bitrotate_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_btowc_SOURCES = test-btowc.c +test_btowc_OBJECTS = test-btowc.$(OBJEXT) +test_btowc_LDADD = $(LDADD) +test_btowc_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_c_ctype_SOURCES = test-c-ctype.c +test_c_ctype_OBJECTS = test-c-ctype.$(OBJEXT) +test_c_ctype_LDADD = $(LDADD) +test_c_ctype_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_c_stack_SOURCES = test-c-stack.c +test_c_stack_OBJECTS = test-c-stack.$(OBJEXT) +test_c_stack_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) +test_c_strcasecmp_SOURCES = test-c-strcasecmp.c +test_c_strcasecmp_OBJECTS = test-c-strcasecmp.$(OBJEXT) +test_c_strcasecmp_LDADD = $(LDADD) +test_c_strcasecmp_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_c_strncasecmp_SOURCES = test-c-strncasecmp.c +test_c_strncasecmp_OBJECTS = test-c-strncasecmp.$(OBJEXT) +test_c_strncasecmp_LDADD = $(LDADD) +test_c_strncasecmp_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_close_SOURCES = test-close.c +test_close_OBJECTS = test-close.$(OBJEXT) +test_close_LDADD = $(LDADD) +test_close_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_connect_SOURCES = test-connect.c +test_connect_OBJECTS = test-connect.$(OBJEXT) +test_connect_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) +test_ctype_SOURCES = test-ctype.c +test_ctype_OBJECTS = test-ctype.$(OBJEXT) +test_ctype_LDADD = $(LDADD) +test_ctype_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_dirname_SOURCES = test-dirname.c +test_dirname_OBJECTS = test-dirname.$(OBJEXT) +test_dirname_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_dup2_SOURCES = test-dup2.c +test_dup2_OBJECTS = test-dup2.$(OBJEXT) +test_dup2_LDADD = $(LDADD) +test_dup2_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_environ_SOURCES = test-environ.c +test_environ_OBJECTS = test-environ.$(OBJEXT) +test_environ_LDADD = $(LDADD) +test_environ_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_errno_SOURCES = test-errno.c +test_errno_OBJECTS = test-errno.$(OBJEXT) +test_errno_LDADD = $(LDADD) +test_errno_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_exclude_SOURCES = test-exclude.c +test_exclude_OBJECTS = test-exclude.$(OBJEXT) +test_exclude_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_fcntl_SOURCES = test-fcntl.c +test_fcntl_OBJECTS = test-fcntl.$(OBJEXT) +test_fcntl_LDADD = $(LDADD) +test_fcntl_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_fcntl_h_SOURCES = test-fcntl-h.c +test_fcntl_h_OBJECTS = test-fcntl-h.$(OBJEXT) +test_fcntl_h_LDADD = $(LDADD) +test_fcntl_h_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_fdopen_SOURCES = test-fdopen.c +test_fdopen_OBJECTS = test-fdopen.$(OBJEXT) +test_fdopen_LDADD = $(LDADD) +test_fdopen_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_fgetc_SOURCES = test-fgetc.c +test_fgetc_OBJECTS = test-fgetc.$(OBJEXT) +test_fgetc_LDADD = $(LDADD) +test_fgetc_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_filenamecat_SOURCES = test-filenamecat.c +test_filenamecat_OBJECTS = test-filenamecat.$(OBJEXT) +test_filenamecat_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_float_SOURCES = test-float.c +test_float_OBJECTS = test-float.$(OBJEXT) +test_float_LDADD = $(LDADD) +test_float_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_fnmatch_SOURCES = test-fnmatch.c +test_fnmatch_OBJECTS = test-fnmatch.$(OBJEXT) +test_fnmatch_LDADD = $(LDADD) +test_fnmatch_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_fputc_SOURCES = test-fputc.c +test_fputc_OBJECTS = test-fputc.$(OBJEXT) +test_fputc_LDADD = $(LDADD) +test_fputc_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_fread_SOURCES = test-fread.c +test_fread_OBJECTS = test-fread.$(OBJEXT) +test_fread_LDADD = $(LDADD) +test_fread_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_freopen_SOURCES = test-freopen.c +test_freopen_OBJECTS = test-freopen.$(OBJEXT) +test_freopen_LDADD = $(LDADD) +test_freopen_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_freopen_safer_SOURCES = test-freopen-safer.c +test_freopen_safer_OBJECTS = test-freopen-safer.$(OBJEXT) +test_freopen_safer_LDADD = $(LDADD) +test_freopen_safer_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_fstat_SOURCES = test-fstat.c +test_fstat_OBJECTS = test-fstat.$(OBJEXT) +test_fstat_LDADD = $(LDADD) +test_fstat_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_ftruncate_SOURCES = test-ftruncate.c +test_ftruncate_OBJECTS = test-ftruncate.$(OBJEXT) +test_ftruncate_LDADD = $(LDADD) +test_ftruncate_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_fwrite_SOURCES = test-fwrite.c +test_fwrite_OBJECTS = test-fwrite.$(OBJEXT) +test_fwrite_LDADD = $(LDADD) +test_fwrite_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_getcwd_lgpl_SOURCES = test-getcwd-lgpl.c +test_getcwd_lgpl_OBJECTS = test-getcwd-lgpl.$(OBJEXT) +test_getcwd_lgpl_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) +test_getdtablesize_SOURCES = test-getdtablesize.c +test_getdtablesize_OBJECTS = test-getdtablesize.$(OBJEXT) +test_getdtablesize_LDADD = $(LDADD) +test_getdtablesize_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_getopt_gnu_SOURCES = test-getopt-gnu.c +test_getopt_gnu_OBJECTS = test-getopt-gnu.$(OBJEXT) +test_getopt_gnu_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) +test_getopt_posix_SOURCES = test-getopt-posix.c +test_getopt_posix_OBJECTS = test-getopt-posix.$(OBJEXT) +test_getopt_posix_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) +test_getprogname_SOURCES = test-getprogname.c +test_getprogname_OBJECTS = test-getprogname.$(OBJEXT) +test_getprogname_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_gettimeofday_SOURCES = test-gettimeofday.c +test_gettimeofday_OBJECTS = test-gettimeofday.$(OBJEXT) +test_gettimeofday_LDADD = $(LDADD) +test_gettimeofday_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_hash_SOURCES = test-hash.c +test_hash_OBJECTS = test-hash.$(OBJEXT) +test_hash_LDADD = $(LDADD) +test_hash_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_iconv_SOURCES = test-iconv.c +test_iconv_OBJECTS = test-iconv.$(OBJEXT) +test_iconv_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_iconv_h_SOURCES = test-iconv-h.c +test_iconv_h_OBJECTS = test-iconv-h.$(OBJEXT) +test_iconv_h_LDADD = $(LDADD) +test_iconv_h_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_ignore_value_SOURCES = test-ignore-value.c +test_ignore_value_OBJECTS = test-ignore-value.$(OBJEXT) +test_ignore_value_LDADD = $(LDADD) +test_ignore_value_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_inet_pton_SOURCES = test-inet_pton.c +test_inet_pton_OBJECTS = test-inet_pton.$(OBJEXT) +test_inet_pton_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_intprops_SOURCES = test-intprops.c +test_intprops_OBJECTS = test-intprops.$(OBJEXT) +test_intprops_LDADD = $(LDADD) +test_intprops_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_inttostr_SOURCES = test-inttostr.c +test_inttostr_OBJECTS = test-inttostr.$(OBJEXT) +test_inttostr_LDADD = $(LDADD) +test_inttostr_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_inttypes_SOURCES = test-inttypes.c +test_inttypes_OBJECTS = test-inttypes.$(OBJEXT) +test_inttypes_LDADD = $(LDADD) +test_inttypes_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_ioctl_SOURCES = test-ioctl.c +test_ioctl_OBJECTS = test-ioctl.$(OBJEXT) +test_ioctl_LDADD = $(LDADD) +test_ioctl_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_isblank_SOURCES = test-isblank.c +test_isblank_OBJECTS = test-isblank.$(OBJEXT) +test_isblank_LDADD = $(LDADD) +test_isblank_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_iswblank_SOURCES = test-iswblank.c +test_iswblank_OBJECTS = test-iswblank.$(OBJEXT) +test_iswblank_LDADD = $(LDADD) +test_iswblank_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_langinfo_SOURCES = test-langinfo.c +test_langinfo_OBJECTS = test-langinfo.$(OBJEXT) +test_langinfo_LDADD = $(LDADD) +test_langinfo_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_limits_h_SOURCES = test-limits-h.c +test_limits_h_OBJECTS = test-limits-h.$(OBJEXT) +test_limits_h_LDADD = $(LDADD) +test_limits_h_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_listen_SOURCES = test-listen.c +test_listen_OBJECTS = test-listen.$(OBJEXT) +test_listen_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_locale_SOURCES = test-locale.c +test_locale_OBJECTS = test-locale.$(OBJEXT) +test_locale_LDADD = $(LDADD) +test_locale_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_localeconv_SOURCES = test-localeconv.c +test_localeconv_OBJECTS = test-localeconv.$(OBJEXT) +test_localeconv_LDADD = $(LDADD) +test_localeconv_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_lstat_SOURCES = test-lstat.c +test_lstat_OBJECTS = test-lstat.$(OBJEXT) +test_lstat_LDADD = $(LDADD) +test_lstat_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_malloca_SOURCES = test-malloca.c +test_malloca_OBJECTS = test-malloca.$(OBJEXT) +test_malloca_LDADD = $(LDADD) +test_malloca_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_mbrtowc_SOURCES = test-mbrtowc.c +test_mbrtowc_OBJECTS = test-mbrtowc.$(OBJEXT) +test_mbrtowc_LDADD = $(LDADD) +test_mbrtowc_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_mbrtowc_w32_SOURCES = test-mbrtowc-w32.c +test_mbrtowc_w32_OBJECTS = test-mbrtowc-w32.$(OBJEXT) +test_mbrtowc_w32_LDADD = $(LDADD) +test_mbrtowc_w32_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_mbscasecmp_SOURCES = test-mbscasecmp.c +test_mbscasecmp_OBJECTS = test-mbscasecmp.$(OBJEXT) +test_mbscasecmp_LDADD = $(LDADD) +test_mbscasecmp_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_mbsinit_SOURCES = test-mbsinit.c +test_mbsinit_OBJECTS = test-mbsinit.$(OBJEXT) +test_mbsinit_LDADD = $(LDADD) +test_mbsinit_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_mbsrtowcs_SOURCES = test-mbsrtowcs.c +test_mbsrtowcs_OBJECTS = test-mbsrtowcs.$(OBJEXT) +test_mbsrtowcs_LDADD = $(LDADD) +test_mbsrtowcs_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_mbsstr1_SOURCES = test-mbsstr1.c +test_mbsstr1_OBJECTS = test-mbsstr1.$(OBJEXT) +test_mbsstr1_LDADD = $(LDADD) +test_mbsstr1_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_mbsstr2_SOURCES = test-mbsstr2.c +test_mbsstr2_OBJECTS = test-mbsstr2.$(OBJEXT) +test_mbsstr2_LDADD = $(LDADD) +test_mbsstr2_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_mbsstr3_SOURCES = test-mbsstr3.c +test_mbsstr3_OBJECTS = test-mbsstr3.$(OBJEXT) +test_mbsstr3_LDADD = $(LDADD) +test_mbsstr3_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_memchr_SOURCES = test-memchr.c +test_memchr_OBJECTS = test-memchr.$(OBJEXT) +test_memchr_LDADD = $(LDADD) +test_memchr_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_nanosleep_SOURCES = test-nanosleep.c +test_nanosleep_OBJECTS = test-nanosleep.$(OBJEXT) +test_nanosleep_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) +test_netinet_in_SOURCES = test-netinet_in.c +test_netinet_in_OBJECTS = test-netinet_in.$(OBJEXT) +test_netinet_in_LDADD = $(LDADD) +test_netinet_in_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_nl_langinfo_SOURCES = test-nl_langinfo.c +test_nl_langinfo_OBJECTS = test-nl_langinfo.$(OBJEXT) +test_nl_langinfo_LDADD = $(LDADD) +test_nl_langinfo_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_open_SOURCES = test-open.c +test_open_OBJECTS = test-open.$(OBJEXT) +test_open_LDADD = $(LDADD) +test_open_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_pathmax_SOURCES = test-pathmax.c +test_pathmax_OBJECTS = test-pathmax.$(OBJEXT) +test_pathmax_LDADD = $(LDADD) +test_pathmax_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_perror_SOURCES = test-perror.c +test_perror_OBJECTS = test-perror.$(OBJEXT) +test_perror_LDADD = $(LDADD) +test_perror_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_perror2_SOURCES = test-perror2.c +test_perror2_OBJECTS = test-perror2.$(OBJEXT) +test_perror2_LDADD = $(LDADD) +test_perror2_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_pipe_SOURCES = test-pipe.c +test_pipe_OBJECTS = test-pipe.$(OBJEXT) +test_pipe_LDADD = $(LDADD) +test_pipe_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_quotearg_simple_SOURCES = test-quotearg-simple.c +test_quotearg_simple_OBJECTS = test-quotearg-simple.$(OBJEXT) +test_quotearg_simple_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_raise_SOURCES = test-raise.c +test_raise_OBJECTS = test-raise.$(OBJEXT) +test_raise_LDADD = $(LDADD) +test_raise_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_rawmemchr_SOURCES = test-rawmemchr.c +test_rawmemchr_OBJECTS = test-rawmemchr.$(OBJEXT) +test_rawmemchr_LDADD = $(LDADD) +test_rawmemchr_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_readlink_SOURCES = test-readlink.c +test_readlink_OBJECTS = test-readlink.$(OBJEXT) +test_readlink_LDADD = $(LDADD) +test_readlink_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_regex_SOURCES = test-regex.c +test_regex_OBJECTS = test-regex.$(OBJEXT) +test_regex_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_select_SOURCES = test-select.c +test_select_OBJECTS = test-select.$(OBJEXT) +test_select_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) +test_select_fd_SOURCES = test-select-fd.c +test_select_fd_OBJECTS = test-select-fd.$(OBJEXT) +test_select_fd_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_select_stdin_SOURCES = test-select-stdin.c +test_select_stdin_OBJECTS = test-select-stdin.$(OBJEXT) +test_select_stdin_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_setenv_SOURCES = test-setenv.c +test_setenv_OBJECTS = test-setenv.$(OBJEXT) +test_setenv_LDADD = $(LDADD) +test_setenv_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_setlocale1_SOURCES = test-setlocale1.c +test_setlocale1_OBJECTS = test-setlocale1.$(OBJEXT) +test_setlocale1_LDADD = $(LDADD) +test_setlocale1_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_setlocale2_SOURCES = test-setlocale2.c +test_setlocale2_OBJECTS = test-setlocale2.$(OBJEXT) +test_setlocale2_LDADD = $(LDADD) +test_setlocale2_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_setsockopt_SOURCES = test-setsockopt.c +test_setsockopt_OBJECTS = test-setsockopt.$(OBJEXT) +test_setsockopt_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_sh_quote_SOURCES = test-sh-quote.c +test_sh_quote_OBJECTS = test-sh-quote.$(OBJEXT) +test_sh_quote_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_sigaction_SOURCES = test-sigaction.c +test_sigaction_OBJECTS = test-sigaction.$(OBJEXT) +test_sigaction_LDADD = $(LDADD) +test_sigaction_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_signal_h_SOURCES = test-signal-h.c +test_signal_h_OBJECTS = test-signal-h.$(OBJEXT) +test_signal_h_LDADD = $(LDADD) +test_signal_h_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_sigprocmask_SOURCES = test-sigprocmask.c +test_sigprocmask_OBJECTS = test-sigprocmask.$(OBJEXT) +test_sigprocmask_LDADD = $(LDADD) +test_sigprocmask_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_sleep_SOURCES = test-sleep.c +test_sleep_OBJECTS = test-sleep.$(OBJEXT) +test_sleep_LDADD = $(LDADD) +test_sleep_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_snprintf_SOURCES = test-snprintf.c +test_snprintf_OBJECTS = test-snprintf.$(OBJEXT) +test_snprintf_LDADD = $(LDADD) +test_snprintf_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_sockets_SOURCES = test-sockets.c +test_sockets_OBJECTS = test-sockets.$(OBJEXT) +test_sockets_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_stat_SOURCES = test-stat.c +test_stat_OBJECTS = test-stat.$(OBJEXT) +test_stat_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) +test_stat_time_SOURCES = test-stat-time.c +test_stat_time_OBJECTS = test-stat-time.$(OBJEXT) +test_stat_time_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) +test_stdalign_SOURCES = test-stdalign.c +test_stdalign_OBJECTS = test-stdalign.$(OBJEXT) +test_stdalign_LDADD = $(LDADD) +test_stdalign_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_stdbool_SOURCES = test-stdbool.c +test_stdbool_OBJECTS = test-stdbool.$(OBJEXT) +test_stdbool_LDADD = $(LDADD) +test_stdbool_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_stddef_SOURCES = test-stddef.c +test_stddef_OBJECTS = test-stddef.$(OBJEXT) +test_stddef_LDADD = $(LDADD) +test_stddef_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_stdint_SOURCES = test-stdint.c +test_stdint_OBJECTS = test-stdint.$(OBJEXT) +test_stdint_LDADD = $(LDADD) +test_stdint_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_stdio_SOURCES = test-stdio.c +test_stdio_OBJECTS = test-stdio.$(OBJEXT) +test_stdio_LDADD = $(LDADD) +test_stdio_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_stdlib_SOURCES = test-stdlib.c +test_stdlib_OBJECTS = test-stdlib.$(OBJEXT) +test_stdlib_LDADD = $(LDADD) +test_stdlib_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_strerror_SOURCES = test-strerror.c +test_strerror_OBJECTS = test-strerror.$(OBJEXT) +test_strerror_LDADD = $(LDADD) +test_strerror_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_strerror_r_SOURCES = test-strerror_r.c +test_strerror_r_OBJECTS = test-strerror_r.$(OBJEXT) +test_strerror_r_LDADD = $(LDADD) +test_strerror_r_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_strftime_SOURCES = test-strftime.c +test_strftime_OBJECTS = test-strftime.$(OBJEXT) +test_strftime_LDADD = $(LDADD) +test_strftime_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_striconv_SOURCES = test-striconv.c +test_striconv_OBJECTS = test-striconv.$(OBJEXT) +test_striconv_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_string_SOURCES = test-string.c +test_string_OBJECTS = test-string.$(OBJEXT) +test_string_LDADD = $(LDADD) +test_string_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_strings_SOURCES = test-strings.c +test_strings_OBJECTS = test-strings.$(OBJEXT) +test_strings_LDADD = $(LDADD) +test_strings_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_strnlen_SOURCES = test-strnlen.c +test_strnlen_OBJECTS = test-strnlen.$(OBJEXT) +test_strnlen_LDADD = $(LDADD) +test_strnlen_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_strtoull_SOURCES = test-strtoull.c +test_strtoull_OBJECTS = test-strtoull.$(OBJEXT) +test_strtoull_LDADD = $(LDADD) +test_strtoull_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_strtoumax_SOURCES = test-strtoumax.c +test_strtoumax_OBJECTS = test-strtoumax.$(OBJEXT) +test_strtoumax_LDADD = $(LDADD) +test_strtoumax_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_symlink_SOURCES = test-symlink.c +test_symlink_OBJECTS = test-symlink.$(OBJEXT) +test_symlink_LDADD = $(LDADD) +test_symlink_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_sys_ioctl_SOURCES = test-sys_ioctl.c +test_sys_ioctl_OBJECTS = test-sys_ioctl.$(OBJEXT) +test_sys_ioctl_LDADD = $(LDADD) +test_sys_ioctl_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_sys_select_SOURCES = test-sys_select.c +test_sys_select_OBJECTS = test-sys_select.$(OBJEXT) +test_sys_select_LDADD = $(LDADD) +test_sys_select_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_sys_socket_SOURCES = test-sys_socket.c +test_sys_socket_OBJECTS = test-sys_socket.$(OBJEXT) +test_sys_socket_LDADD = $(LDADD) +test_sys_socket_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_sys_stat_SOURCES = test-sys_stat.c +test_sys_stat_OBJECTS = test-sys_stat.$(OBJEXT) +test_sys_stat_LDADD = $(LDADD) +test_sys_stat_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_sys_time_SOURCES = test-sys_time.c +test_sys_time_OBJECTS = test-sys_time.$(OBJEXT) +test_sys_time_LDADD = $(LDADD) +test_sys_time_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_sys_types_SOURCES = test-sys_types.c +test_sys_types_OBJECTS = test-sys_types.$(OBJEXT) +test_sys_types_LDADD = $(LDADD) +test_sys_types_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_sys_uio_SOURCES = test-sys_uio.c +test_sys_uio_OBJECTS = test-sys_uio.$(OBJEXT) +test_sys_uio_LDADD = $(LDADD) +test_sys_uio_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_sys_wait_SOURCES = test-sys_wait.c +test_sys_wait_OBJECTS = test-sys_wait.$(OBJEXT) +test_sys_wait_LDADD = $(LDADD) +test_sys_wait_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_time_SOURCES = test-time.c +test_time_OBJECTS = test-time.$(OBJEXT) +test_time_LDADD = $(LDADD) +test_time_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_timespec_SOURCES = test-timespec.c +test_timespec_OBJECTS = test-timespec.$(OBJEXT) +test_timespec_LDADD = $(LDADD) +test_timespec_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +am__dirstamp = $(am__leading_dot)dirstamp +am_test_u8_mbtoucr_OBJECTS = unistr/test-u8-mbtoucr.$(OBJEXT) +test_u8_mbtoucr_OBJECTS = $(am_test_u8_mbtoucr_OBJECTS) +test_u8_mbtoucr_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_test_u8_uctomb_OBJECTS = unistr/test-u8-uctomb.$(OBJEXT) +test_u8_uctomb_OBJECTS = $(am_test_u8_uctomb_OBJECTS) +test_u8_uctomb_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_test_uc_width_OBJECTS = uniwidth/test-uc_width.$(OBJEXT) +test_uc_width_OBJECTS = $(am_test_uc_width_OBJECTS) +test_uc_width_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_test_uc_width2_OBJECTS = uniwidth/test-uc_width2.$(OBJEXT) +test_uc_width2_OBJECTS = $(am_test_uc_width2_OBJECTS) +test_uc_width2_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_unistd_SOURCES = test-unistd.c +test_unistd_OBJECTS = test-unistd.$(OBJEXT) +test_unistd_LDADD = $(LDADD) +test_unistd_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_unsetenv_SOURCES = test-unsetenv.c +test_unsetenv_OBJECTS = test-unsetenv.$(OBJEXT) +test_unsetenv_LDADD = $(LDADD) +test_unsetenv_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_vasnprintf_SOURCES = test-vasnprintf.c +test_vasnprintf_OBJECTS = test-vasnprintf.$(OBJEXT) +test_vasnprintf_LDADD = $(LDADD) +test_vasnprintf_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_vasprintf_SOURCES = test-vasprintf.c +test_vasprintf_OBJECTS = test-vasprintf.$(OBJEXT) +test_vasprintf_LDADD = $(LDADD) +test_vasprintf_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_verify_SOURCES = test-verify.c +test_verify_OBJECTS = test-verify.$(OBJEXT) +test_verify_LDADD = $(LDADD) +test_verify_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_verify_try_SOURCES = test-verify-try.c +test_verify_try_OBJECTS = test-verify-try.$(OBJEXT) +test_verify_try_LDADD = $(LDADD) +test_verify_try_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_version_etc_SOURCES = test-version-etc.c +test_version_etc_OBJECTS = test-version-etc.$(OBJEXT) +test_version_etc_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_wchar_SOURCES = test-wchar.c +test_wchar_OBJECTS = test-wchar.$(OBJEXT) +test_wchar_LDADD = $(LDADD) +test_wchar_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \ + $(am__DEPENDENCIES_1) +test_wcrtomb_SOURCES = test-wcrtomb.c +test_wcrtomb_OBJECTS = test-wcrtomb.$(OBJEXT) +test_wcrtomb_LDADD = $(LDADD) +test_wcrtomb_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_wcrtomb_w32_SOURCES = test-wcrtomb-w32.c +test_wcrtomb_w32_OBJECTS = test-wcrtomb-w32.$(OBJEXT) +test_wcrtomb_w32_LDADD = $(LDADD) +test_wcrtomb_w32_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_wctype_h_SOURCES = test-wctype-h.c +test_wctype_h_OBJECTS = test-wctype-h.$(OBJEXT) +test_wctype_h_LDADD = $(LDADD) +test_wctype_h_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_wcwidth_SOURCES = test-wcwidth.c +test_wcwidth_OBJECTS = test-wcwidth.$(OBJEXT) +test_wcwidth_LDADD = $(LDADD) +test_wcwidth_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \ + libtests.a $(am__DEPENDENCIES_1) +test_xalloc_die_SOURCES = test-xalloc-die.c +test_xalloc_die_OBJECTS = test-xalloc-die.$(OBJEXT) +test_xalloc_die_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_xstrtol_SOURCES = test-xstrtol.c +test_xstrtol_OBJECTS = test-xstrtol.$(OBJEXT) +test_xstrtol_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_xstrtoul_SOURCES = test-xstrtoul.c +test_xstrtoul_OBJECTS = test-xstrtoul.$(OBJEXT) +test_xstrtoul_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_xstrtoumax_SOURCES = test-xstrtoumax.c +test_xstrtoumax_OBJECTS = test-xstrtoumax.$(OBJEXT) +test_xstrtoumax_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_xvasprintf_SOURCES = test-xvasprintf.c +test_xvasprintf_OBJECTS = test-xvasprintf.$(OBJEXT) +test_xvasprintf_DEPENDENCIES = $(am__DEPENDENCIES_2) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/lib +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/accept.Po ./$(DEPDIR)/bind.Po \ + ./$(DEPDIR)/connect.Po ./$(DEPDIR)/dtotimespec.Po \ + ./$(DEPDIR)/fdopen.Po ./$(DEPDIR)/ftruncate.Po \ + ./$(DEPDIR)/getcwd-lgpl.Po ./$(DEPDIR)/getpagesize.Po \ + ./$(DEPDIR)/hash-pjw.Po ./$(DEPDIR)/inet_pton.Po \ + ./$(DEPDIR)/ioctl.Po ./$(DEPDIR)/listen.Po \ + ./$(DEPDIR)/nanosleep.Po ./$(DEPDIR)/perror.Po \ + ./$(DEPDIR)/pipe.Po ./$(DEPDIR)/putenv.Po \ + ./$(DEPDIR)/select.Po ./$(DEPDIR)/setlocale.Po \ + ./$(DEPDIR)/setsockopt.Po ./$(DEPDIR)/sleep.Po \ + ./$(DEPDIR)/snprintf.Po ./$(DEPDIR)/socket.Po \ + ./$(DEPDIR)/sockets.Po ./$(DEPDIR)/strerror_r.Po \ + ./$(DEPDIR)/symlink.Po ./$(DEPDIR)/sys_socket.Po \ + ./$(DEPDIR)/test-accept.Po ./$(DEPDIR)/test-alloca-opt.Po \ + ./$(DEPDIR)/test-areadlink.Po ./$(DEPDIR)/test-argmatch.Po \ + ./$(DEPDIR)/test-arpa_inet.Po ./$(DEPDIR)/test-binary-io.Po \ + ./$(DEPDIR)/test-bind.Po ./$(DEPDIR)/test-bitrotate.Po \ + ./$(DEPDIR)/test-btowc.Po ./$(DEPDIR)/test-c-ctype.Po \ + ./$(DEPDIR)/test-c-stack.Po ./$(DEPDIR)/test-c-strcasecmp.Po \ + ./$(DEPDIR)/test-c-strncasecmp.Po ./$(DEPDIR)/test-close.Po \ + ./$(DEPDIR)/test-connect.Po ./$(DEPDIR)/test-ctype.Po \ + ./$(DEPDIR)/test-dirname.Po ./$(DEPDIR)/test-dup2.Po \ + ./$(DEPDIR)/test-environ.Po ./$(DEPDIR)/test-errno.Po \ + ./$(DEPDIR)/test-exclude.Po ./$(DEPDIR)/test-fcntl-h.Po \ + ./$(DEPDIR)/test-fcntl.Po ./$(DEPDIR)/test-fdopen.Po \ + ./$(DEPDIR)/test-fgetc.Po ./$(DEPDIR)/test-filenamecat.Po \ + ./$(DEPDIR)/test-float.Po ./$(DEPDIR)/test-fnmatch.Po \ + ./$(DEPDIR)/test-fputc.Po ./$(DEPDIR)/test-fread.Po \ + ./$(DEPDIR)/test-freopen-safer.Po ./$(DEPDIR)/test-freopen.Po \ + ./$(DEPDIR)/test-fstat.Po ./$(DEPDIR)/test-ftruncate.Po \ + ./$(DEPDIR)/test-fwrite.Po ./$(DEPDIR)/test-getcwd-lgpl.Po \ + ./$(DEPDIR)/test-getdtablesize.Po \ + ./$(DEPDIR)/test-getopt-gnu.Po \ + ./$(DEPDIR)/test-getopt-posix.Po \ + ./$(DEPDIR)/test-getprogname.Po \ + ./$(DEPDIR)/test-gettimeofday.Po ./$(DEPDIR)/test-hash.Po \ + ./$(DEPDIR)/test-iconv-h.Po ./$(DEPDIR)/test-iconv.Po \ + ./$(DEPDIR)/test-ignore-value.Po ./$(DEPDIR)/test-inet_pton.Po \ + ./$(DEPDIR)/test-intprops.Po ./$(DEPDIR)/test-inttostr.Po \ + ./$(DEPDIR)/test-inttypes.Po ./$(DEPDIR)/test-ioctl.Po \ + ./$(DEPDIR)/test-isblank.Po ./$(DEPDIR)/test-iswblank.Po \ + ./$(DEPDIR)/test-langinfo.Po ./$(DEPDIR)/test-limits-h.Po \ + ./$(DEPDIR)/test-listen.Po ./$(DEPDIR)/test-locale.Po \ + ./$(DEPDIR)/test-localeconv.Po ./$(DEPDIR)/test-lstat.Po \ + ./$(DEPDIR)/test-malloca.Po ./$(DEPDIR)/test-mbrtowc-w32.Po \ + ./$(DEPDIR)/test-mbrtowc.Po ./$(DEPDIR)/test-mbscasecmp.Po \ + ./$(DEPDIR)/test-mbsinit.Po ./$(DEPDIR)/test-mbsrtowcs.Po \ + ./$(DEPDIR)/test-mbsstr1.Po ./$(DEPDIR)/test-mbsstr2.Po \ + ./$(DEPDIR)/test-mbsstr3.Po ./$(DEPDIR)/test-memchr.Po \ + ./$(DEPDIR)/test-nanosleep.Po ./$(DEPDIR)/test-netinet_in.Po \ + ./$(DEPDIR)/test-nl_langinfo.Po ./$(DEPDIR)/test-open.Po \ + ./$(DEPDIR)/test-pathmax.Po ./$(DEPDIR)/test-perror.Po \ + ./$(DEPDIR)/test-perror2.Po ./$(DEPDIR)/test-pipe.Po \ + ./$(DEPDIR)/test-quotearg-simple.Po ./$(DEPDIR)/test-raise.Po \ + ./$(DEPDIR)/test-rawmemchr.Po ./$(DEPDIR)/test-readlink.Po \ + ./$(DEPDIR)/test-regex.Po ./$(DEPDIR)/test-select-fd.Po \ + ./$(DEPDIR)/test-select-stdin.Po ./$(DEPDIR)/test-select.Po \ + ./$(DEPDIR)/test-setenv.Po ./$(DEPDIR)/test-setlocale1.Po \ + ./$(DEPDIR)/test-setlocale2.Po ./$(DEPDIR)/test-setsockopt.Po \ + ./$(DEPDIR)/test-sh-quote.Po ./$(DEPDIR)/test-sigaction.Po \ + ./$(DEPDIR)/test-signal-h.Po ./$(DEPDIR)/test-sigprocmask.Po \ + ./$(DEPDIR)/test-sleep.Po ./$(DEPDIR)/test-snprintf.Po \ + ./$(DEPDIR)/test-sockets.Po ./$(DEPDIR)/test-stat-time.Po \ + ./$(DEPDIR)/test-stat.Po ./$(DEPDIR)/test-stdalign.Po \ + ./$(DEPDIR)/test-stdbool.Po ./$(DEPDIR)/test-stddef.Po \ + ./$(DEPDIR)/test-stdint.Po ./$(DEPDIR)/test-stdio.Po \ + ./$(DEPDIR)/test-stdlib.Po ./$(DEPDIR)/test-strerror.Po \ + ./$(DEPDIR)/test-strerror_r.Po ./$(DEPDIR)/test-strftime.Po \ + ./$(DEPDIR)/test-striconv.Po ./$(DEPDIR)/test-string.Po \ + ./$(DEPDIR)/test-strings.Po ./$(DEPDIR)/test-strnlen.Po \ + ./$(DEPDIR)/test-strtoull.Po ./$(DEPDIR)/test-strtoumax.Po \ + ./$(DEPDIR)/test-symlink.Po ./$(DEPDIR)/test-sys_ioctl.Po \ + ./$(DEPDIR)/test-sys_select.Po ./$(DEPDIR)/test-sys_socket.Po \ + ./$(DEPDIR)/test-sys_stat.Po ./$(DEPDIR)/test-sys_time.Po \ + ./$(DEPDIR)/test-sys_types.Po ./$(DEPDIR)/test-sys_uio.Po \ + ./$(DEPDIR)/test-sys_wait.Po ./$(DEPDIR)/test-time.Po \ + ./$(DEPDIR)/test-timespec.Po ./$(DEPDIR)/test-unistd.Po \ + ./$(DEPDIR)/test-unsetenv.Po ./$(DEPDIR)/test-vasnprintf.Po \ + ./$(DEPDIR)/test-vasprintf.Po ./$(DEPDIR)/test-verify-try.Po \ + ./$(DEPDIR)/test-verify.Po ./$(DEPDIR)/test-version-etc.Po \ + ./$(DEPDIR)/test-wchar.Po ./$(DEPDIR)/test-wcrtomb-w32.Po \ + ./$(DEPDIR)/test-wcrtomb.Po ./$(DEPDIR)/test-wctype-h.Po \ + ./$(DEPDIR)/test-wcwidth.Po ./$(DEPDIR)/test-xalloc-die.Po \ + ./$(DEPDIR)/test-xstrtol.Po ./$(DEPDIR)/test-xstrtoul.Po \ + ./$(DEPDIR)/test-xstrtoumax.Po ./$(DEPDIR)/test-xvasprintf.Po \ + ./$(DEPDIR)/timespec-add.Po ./$(DEPDIR)/timespec-sub.Po \ + ./$(DEPDIR)/wctob.Po ./$(DEPDIR)/wctomb.Po \ + unistr/$(DEPDIR)/test-u8-mbtoucr.Po \ + unistr/$(DEPDIR)/test-u8-uctomb.Po \ + uniwidth/$(DEPDIR)/test-uc_width.Po \ + uniwidth/$(DEPDIR)/test-uc_width2.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libtests_a_SOURCES) $(EXTRA_libtests_a_SOURCES) \ + test-accept.c test-alloca-opt.c test-areadlink.c \ + test-argmatch.c test-arpa_inet.c test-binary-io.c test-bind.c \ + test-bitrotate.c test-btowc.c test-c-ctype.c test-c-stack.c \ + test-c-strcasecmp.c test-c-strncasecmp.c test-close.c \ + test-connect.c test-ctype.c test-dirname.c test-dup2.c \ + test-environ.c test-errno.c test-exclude.c test-fcntl.c \ + test-fcntl-h.c test-fdopen.c test-fgetc.c test-filenamecat.c \ + test-float.c test-fnmatch.c test-fputc.c test-fread.c \ + test-freopen.c test-freopen-safer.c test-fstat.c \ + test-ftruncate.c test-fwrite.c test-getcwd-lgpl.c \ + test-getdtablesize.c test-getopt-gnu.c test-getopt-posix.c \ + test-getprogname.c test-gettimeofday.c test-hash.c \ + test-iconv.c test-iconv-h.c test-ignore-value.c \ + test-inet_pton.c test-intprops.c test-inttostr.c \ + test-inttypes.c test-ioctl.c test-isblank.c test-iswblank.c \ + test-langinfo.c test-limits-h.c test-listen.c test-locale.c \ + test-localeconv.c test-lstat.c test-malloca.c test-mbrtowc.c \ + test-mbrtowc-w32.c test-mbscasecmp.c test-mbsinit.c \ + test-mbsrtowcs.c test-mbsstr1.c test-mbsstr2.c test-mbsstr3.c \ + test-memchr.c test-nanosleep.c test-netinet_in.c \ + test-nl_langinfo.c test-open.c test-pathmax.c test-perror.c \ + test-perror2.c test-pipe.c test-quotearg-simple.c test-raise.c \ + test-rawmemchr.c test-readlink.c test-regex.c test-select.c \ + test-select-fd.c test-select-stdin.c test-setenv.c \ + test-setlocale1.c test-setlocale2.c test-setsockopt.c \ + test-sh-quote.c test-sigaction.c test-signal-h.c \ + test-sigprocmask.c test-sleep.c test-snprintf.c test-sockets.c \ + test-stat.c test-stat-time.c test-stdalign.c test-stdbool.c \ + test-stddef.c test-stdint.c test-stdio.c test-stdlib.c \ + test-strerror.c test-strerror_r.c test-strftime.c \ + test-striconv.c test-string.c test-strings.c test-strnlen.c \ + test-strtoull.c test-strtoumax.c test-symlink.c \ + test-sys_ioctl.c test-sys_select.c test-sys_socket.c \ + test-sys_stat.c test-sys_time.c test-sys_types.c \ + test-sys_uio.c test-sys_wait.c test-time.c test-timespec.c \ + $(test_u8_mbtoucr_SOURCES) $(test_u8_uctomb_SOURCES) \ + $(test_uc_width_SOURCES) $(test_uc_width2_SOURCES) \ + test-unistd.c test-unsetenv.c test-vasnprintf.c \ + test-vasprintf.c test-verify.c test-verify-try.c \ + test-version-etc.c test-wchar.c test-wcrtomb.c \ + test-wcrtomb-w32.c test-wctype-h.c test-wcwidth.c \ + test-xalloc-die.c test-xstrtol.c test-xstrtoul.c \ + test-xstrtoumax.c test-xvasprintf.c +DIST_SOURCES = $(libtests_a_SOURCES) $(EXTRA_libtests_a_SOURCES) \ + test-accept.c test-alloca-opt.c test-areadlink.c \ + test-argmatch.c test-arpa_inet.c test-binary-io.c test-bind.c \ + test-bitrotate.c test-btowc.c test-c-ctype.c test-c-stack.c \ + test-c-strcasecmp.c test-c-strncasecmp.c test-close.c \ + test-connect.c test-ctype.c test-dirname.c test-dup2.c \ + test-environ.c test-errno.c test-exclude.c test-fcntl.c \ + test-fcntl-h.c test-fdopen.c test-fgetc.c test-filenamecat.c \ + test-float.c test-fnmatch.c test-fputc.c test-fread.c \ + test-freopen.c test-freopen-safer.c test-fstat.c \ + test-ftruncate.c test-fwrite.c test-getcwd-lgpl.c \ + test-getdtablesize.c test-getopt-gnu.c test-getopt-posix.c \ + test-getprogname.c test-gettimeofday.c test-hash.c \ + test-iconv.c test-iconv-h.c test-ignore-value.c \ + test-inet_pton.c test-intprops.c test-inttostr.c \ + test-inttypes.c test-ioctl.c test-isblank.c test-iswblank.c \ + test-langinfo.c test-limits-h.c test-listen.c test-locale.c \ + test-localeconv.c test-lstat.c test-malloca.c test-mbrtowc.c \ + test-mbrtowc-w32.c test-mbscasecmp.c test-mbsinit.c \ + test-mbsrtowcs.c test-mbsstr1.c test-mbsstr2.c test-mbsstr3.c \ + test-memchr.c test-nanosleep.c test-netinet_in.c \ + test-nl_langinfo.c test-open.c test-pathmax.c test-perror.c \ + test-perror2.c test-pipe.c test-quotearg-simple.c test-raise.c \ + test-rawmemchr.c test-readlink.c test-regex.c test-select.c \ + test-select-fd.c test-select-stdin.c test-setenv.c \ + test-setlocale1.c test-setlocale2.c test-setsockopt.c \ + test-sh-quote.c test-sigaction.c test-signal-h.c \ + test-sigprocmask.c test-sleep.c test-snprintf.c test-sockets.c \ + test-stat.c test-stat-time.c test-stdalign.c test-stdbool.c \ + test-stddef.c test-stdint.c test-stdio.c test-stdlib.c \ + test-strerror.c test-strerror_r.c test-strftime.c \ + test-striconv.c test-string.c test-strings.c test-strnlen.c \ + test-strtoull.c test-strtoumax.c test-symlink.c \ + test-sys_ioctl.c test-sys_select.c test-sys_socket.c \ + test-sys_stat.c test-sys_time.c test-sys_types.c \ + test-sys_uio.c test-sys_wait.c test-time.c test-timespec.c \ + $(test_u8_mbtoucr_SOURCES) $(test_u8_uctomb_SOURCES) \ + $(test_uc_width_SOURCES) $(test_uc_width2_SOURCES) \ + test-unistd.c test-unsetenv.c test-vasnprintf.c \ + test-vasprintf.c test-verify.c test-verify-try.c \ + test-version-etc.c test-wchar.c test-wcrtomb.c \ + test-wcrtomb-w32.c test-wctype-h.c test-wcwidth.c \ + test-xalloc-die.c test-xstrtol.c test-xstrtoul.c \ + test-xstrtoumax.c test-xvasprintf.c +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(noinst_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + check recheck distdir distdir-am +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + $$am__collect_skipped_logs \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer-defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(IGNORE_SKIPPED_LOGS)'; then \ + am__collect_skipped_logs='--collect-skipped-logs no'; \ +else \ + am__collect_skipped_logs=''; \ +fi; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/gnulib.mk \ + $(top_srcdir)/build-aux/depcomp \ + $(top_srcdir)/build-aux/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +pkglibexecdir = @pkglibexecdir@ +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_INCLUDE = @CONFIG_INCLUDE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ -DEXEEXT=\"@EXEEXT@\" +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ +EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ +ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ +ENOLINK_VALUE = @ENOLINK_VALUE@ +EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ +EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ +ERRNO_H = @ERRNO_H@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FLOAT_H = @FLOAT_H@ +FNMATCH_H = @FNMATCH_H@ +GETOPT_CDEFS_H = @GETOPT_CDEFS_H@ +GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIBC21 = @GLIBC21@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ +GNULIB_CHDIR = @GNULIB_CHDIR@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_CTIME = @GNULIB_CTIME@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ +GNULIB_DUP = @GNULIB_DUP@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_DUP3 = @GNULIB_DUP3@ +GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ +GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ +GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ +GNULIB_FCNTL = @GNULIB_FCNTL@ +GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ +GNULIB_FDOPEN = @GNULIB_FDOPEN@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FFS = @GNULIB_FFS@ +GNULIB_FFSL = @GNULIB_FFSL@ +GNULIB_FFSLL = @GNULIB_FFSLL@ +GNULIB_FGETC = @GNULIB_FGETC@ +GNULIB_FGETS = @GNULIB_FGETS@ +GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPURGE = @GNULIB_FPURGE@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ +GNULIB_FREAD = @GNULIB_FREAD@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ +GNULIB_FSCANF = @GNULIB_FSCANF@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSTAT = @GNULIB_FSTAT@ +GNULIB_FSTATAT = @GNULIB_FSTATAT@ +GNULIB_FSYNC = @GNULIB_FSYNC@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETC = @GNULIB_GETC@ +GNULIB_GETCHAR = @GNULIB_GETCHAR@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ +GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ +GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ +GNULIB_GRANTPT = @GNULIB_GRANTPT@ +GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ +GNULIB_ICONV = @GNULIB_ICONV@ +GNULIB_IMAXABS = @GNULIB_IMAXABS@ +GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ +GNULIB_IOCTL = @GNULIB_IOCTL@ +GNULIB_ISATTY = @GNULIB_ISATTY@ +GNULIB_ISBLANK = @GNULIB_ISBLANK@ +GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ +GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LINKAT = @GNULIB_LINKAT@ +GNULIB_LISTEN = @GNULIB_LISTEN@ +GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ +GNULIB_LOCALTIME = @GNULIB_LOCALTIME@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MBTOWC = @GNULIB_MBTOWC@ +GNULIB_MEMCHR = @GNULIB_MEMCHR@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKFIFO = @GNULIB_MKFIFO@ +GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ +GNULIB_MKNOD = @GNULIB_MKNOD@ +GNULIB_MKNODAT = @GNULIB_MKNODAT@ +GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ +GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ +GNULIB_MKTIME = @GNULIB_MKTIME@ +GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ +GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ +GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_OPENAT = @GNULIB_OPENAT@ +GNULIB_OVERRIDES_STRUCT_STAT = @GNULIB_OVERRIDES_STRUCT_STAT@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ +GNULIB_PCLOSE = @GNULIB_PCLOSE@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PIPE = @GNULIB_PIPE@ +GNULIB_PIPE2 = @GNULIB_PIPE2@ +GNULIB_POPEN = @GNULIB_POPEN@ +GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ +GNULIB_PREAD = @GNULIB_PREAD@ +GNULIB_PRINTF = @GNULIB_PRINTF@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PSELECT = @GNULIB_PSELECT@ +GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ +GNULIB_PTSNAME = @GNULIB_PTSNAME@ +GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ +GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ +GNULIB_RAISE = @GNULIB_RAISE@ +GNULIB_RANDOM = @GNULIB_RANDOM@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ +GNULIB_READ = @GNULIB_READ@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_READLINKAT = @GNULIB_READLINKAT@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_REALPATH = @GNULIB_REALPATH@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ +GNULIB_REMOVE = @GNULIB_REMOVE@ +GNULIB_RENAME = @GNULIB_RENAME@ +GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ +GNULIB_RMDIR = @GNULIB_RMDIR@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SCANF = @GNULIB_SCANF@ +GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ +GNULIB_SELECT = @GNULIB_SELECT@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ +GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ +GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ +GNULIB_SIGACTION = @GNULIB_SIGACTION@ +GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ +GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STAT = @GNULIB_STAT@ +GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ +GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ +GNULIB_STRFTIME = @GNULIB_STRFTIME@ +GNULIB_STRNCAT = @GNULIB_STRNCAT@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRPTIME = @GNULIB_STRPTIME@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ +GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ +GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ +GNULIB_SYMLINK = @GNULIB_SYMLINK@ +GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ +GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ +GNULIB_TIMEGM = @GNULIB_TIMEGM@ +GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ +GNULIB_TMPFILE = @GNULIB_TMPFILE@ +GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ +GNULIB_TRUNCATE = @GNULIB_TRUNCATE@ +GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ +GNULIB_TZSET = @GNULIB_TZSET@ +GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ +GNULIB_UNLINK = @GNULIB_UNLINK@ +GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ +GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ +GNULIB_USLEEP = @GNULIB_USLEEP@ +GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VFSCANF = @GNULIB_VFSCANF@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSCANF = @GNULIB_VSCANF@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WAITPID = @GNULIB_WAITPID@ +GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@ +GNULIB_WCPCPY = @GNULIB_WCPCPY@ +GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ +GNULIB_WCSCAT = @GNULIB_WCSCAT@ +GNULIB_WCSCHR = @GNULIB_WCSCHR@ +GNULIB_WCSCMP = @GNULIB_WCSCMP@ +GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ +GNULIB_WCSCPY = @GNULIB_WCSCPY@ +GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ +GNULIB_WCSDUP = @GNULIB_WCSDUP@ +GNULIB_WCSFTIME = @GNULIB_WCSFTIME@ +GNULIB_WCSLEN = @GNULIB_WCSLEN@ +GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ +GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ +GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ +GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ +GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ +GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCSSPN = @GNULIB_WCSSPN@ +GNULIB_WCSSTR = @GNULIB_WCSSTR@ +GNULIB_WCSTOK = @GNULIB_WCSTOK@ +GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ +GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ +GNULIB_WCTOB = @GNULIB_WCTOB@ +GNULIB_WCTOMB = @GNULIB_WCTOMB@ +GNULIB_WCTRANS = @GNULIB_WCTRANS@ +GNULIB_WCTYPE = @GNULIB_WCTYPE@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ +GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ +GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ +GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ +GNULIB_WMEMSET = @GNULIB_WMEMSET@ +GNULIB_WRITE = @GNULIB_WRITE@ +GNULIB__EXIT = @GNULIB__EXIT@ +HAVE_ACCEPT4 = @HAVE_ACCEPT4@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ +HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ +HAVE_CHOWN = @HAVE_CHOWN@ +HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ +HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ +HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ +HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ +HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ +HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ +HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ +HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_DUP3 = @HAVE_DUP3@ +HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_FACCESSAT = @HAVE_FACCESSAT@ +HAVE_FCHDIR = @HAVE_FCHDIR@ +HAVE_FCHMODAT = @HAVE_FCHMODAT@ +HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FCNTL = @HAVE_FCNTL@ +HAVE_FDATASYNC = @HAVE_FDATASYNC@ +HAVE_FEATURES_H = @HAVE_FEATURES_H@ +HAVE_FFS = @HAVE_FFS@ +HAVE_FFSL = @HAVE_FFSL@ +HAVE_FFSLL = @HAVE_FFSLL@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSTATAT = @HAVE_FSTATAT@ +HAVE_FSYNC = @HAVE_FSYNC@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_FUTIMENS = @HAVE_FUTIMENS@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETGROUPS = @HAVE_GETGROUPS@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ +HAVE_GETLOGIN = @HAVE_GETLOGIN@ +HAVE_GETOPT_H = @HAVE_GETOPT_H@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ +HAVE_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISBLANK = @HAVE_ISBLANK@ +HAVE_ISWBLANK = @HAVE_ISWBLANK@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ +HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ +HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ +HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ +HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LCHOWN = @HAVE_LCHOWN@ +HAVE_LIBSIGSEGV = @HAVE_LIBSIGSEGV@ +HAVE_LINK = @HAVE_LINK@ +HAVE_LINKAT = @HAVE_LINKAT@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSLEN = @HAVE_MBSLEN@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ +HAVE_MEMCHR = @HAVE_MEMCHR@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDIRAT = @HAVE_MKDIRAT@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_MKFIFO = @HAVE_MKFIFO@ +HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ +HAVE_MKNOD = @HAVE_MKNOD@ +HAVE_MKNODAT = @HAVE_MKNODAT@ +HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ +HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ +HAVE_MKSTEMP = @HAVE_MKSTEMP@ +HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ +HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ +HAVE_OPENAT = @HAVE_OPENAT@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_PCLOSE = @HAVE_PCLOSE@ +HAVE_PIPE = @HAVE_PIPE@ +HAVE_PIPE2 = @HAVE_PIPE2@ +HAVE_POPEN = @HAVE_POPEN@ +HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ +HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_PREAD = @HAVE_PREAD@ +HAVE_PSELECT = @HAVE_PSELECT@ +HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ +HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ +HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ +HAVE_RAISE = @HAVE_RAISE@ +HAVE_RANDOM = @HAVE_RANDOM@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_READLINKAT = @HAVE_READLINKAT@ +HAVE_REALPATH = @HAVE_REALPATH@ +HAVE_RENAMEAT = @HAVE_RENAMEAT@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ +HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SIGACTION = @HAVE_SIGACTION@ +HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ +HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ +HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ +HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ +HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_SIGSET_T = @HAVE_SIGSET_T@ +HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STPCPY = @HAVE_STPCPY@ +HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ +HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRINGS_H = @HAVE_STRINGS_H@ +HAVE_STRPBRK = @HAVE_STRPBRK@ +HAVE_STRPTIME = @HAVE_STRPTIME@ +HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ +HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ +HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ +HAVE_SYMLINK = @HAVE_SYMLINK@ +HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@ +HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ +HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ +HAVE_TRUNCATE = @HAVE_TRUNCATE@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ +HAVE_TZSET = @HAVE_TZSET@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNLINKAT = @HAVE_UNLINKAT@ +HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_USLEEP = @HAVE_USLEEP@ +HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCHAR_T = @HAVE_WCHAR_T@ +HAVE_WCPCPY = @HAVE_WCPCPY@ +HAVE_WCPNCPY = @HAVE_WCPNCPY@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ +HAVE_WCSCAT = @HAVE_WCSCAT@ +HAVE_WCSCHR = @HAVE_WCSCHR@ +HAVE_WCSCMP = @HAVE_WCSCMP@ +HAVE_WCSCOLL = @HAVE_WCSCOLL@ +HAVE_WCSCPY = @HAVE_WCSCPY@ +HAVE_WCSCSPN = @HAVE_WCSCSPN@ +HAVE_WCSDUP = @HAVE_WCSDUP@ +HAVE_WCSFTIME = @HAVE_WCSFTIME@ +HAVE_WCSLEN = @HAVE_WCSLEN@ +HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ +HAVE_WCSNCAT = @HAVE_WCSNCAT@ +HAVE_WCSNCMP = @HAVE_WCSNCMP@ +HAVE_WCSNCPY = @HAVE_WCSNCPY@ +HAVE_WCSNLEN = @HAVE_WCSNLEN@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSPBRK = @HAVE_WCSPBRK@ +HAVE_WCSRCHR = @HAVE_WCSRCHR@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ +HAVE_WCSSPN = @HAVE_WCSSPN@ +HAVE_WCSSTR = @HAVE_WCSSTR@ +HAVE_WCSTOK = @HAVE_WCSTOK@ +HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ +HAVE_WCSXFRM = @HAVE_WCSXFRM@ +HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE_WMEMCHR = @HAVE_WMEMCHR@ +HAVE_WMEMCMP = @HAVE_WMEMCMP@ +HAVE_WMEMCPY = @HAVE_WMEMCPY@ +HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ +HAVE_WMEMSET = @HAVE_WMEMSET@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ +HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ +HAVE__BOOL = @HAVE__BOOL@ +HAVE__EXIT = @HAVE__EXIT@ +HELP2MAN = @HELP2MAN@ +ICONV_CONST = @ICONV_CONST@ +ICONV_H = @ICONV_H@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ +INET_PTON_LIB = @INET_PTON_LIB@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ +INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBCSTACK = @LIBCSTACK@ +LIBDIFFUTILS_LIBDEPS = @LIBDIFFUTILS_LIBDEPS@ +LIBDIFFUTILS_LTLIBDEPS = @LIBDIFFUTILS_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSIGSEGV = @LIBSIGSEGV@ +LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@ +LIBSOCKET = @LIBSOCKET@ +LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ +LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@ +LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@ +LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIB_NANOSLEEP = @LIB_NANOSLEEP@ +LIB_SELECT = @LIB_SELECT@ +LIMITS_H = @LIMITS_H@ +LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ +LTLIBCSTACK = @LTLIBCSTACK@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBSIGSEGV = @LTLIBSIGSEGV@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ +NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@ +NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ +NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ +NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@ +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ +NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ +NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ +NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ +NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ +NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ +NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ +NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@ +NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@ +NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ +NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ +NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ +NEXT_CTYPE_H = @NEXT_CTYPE_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_ICONV_H = @NEXT_ICONV_H@ +NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ +NEXT_LOCALE_H = @NEXT_LOCALE_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ +NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_STDARG_H = @NEXT_STDARG_H@ +NEXT_STDDEF_H = @NEXT_STDDEF_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ +NEXT_STDIO_H = @NEXT_STDIO_H@ +NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRINGS_H = @NEXT_STRINGS_H@ +NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@ +NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@ +NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ +NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ +NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ +NEXT_TIME_H = @NEXT_TIME_H@ +NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ +NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSUB = @POSUB@ +PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ +PR_PROGRAM = @PR_PROGRAM@ +PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ +REPLACE_CALLOC = @REPLACE_CALLOC@ +REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_CTIME = @REPLACE_CTIME@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ +REPLACE_DUP = @REPLACE_DUP@ +REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ +REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FCNTL = @REPLACE_FCNTL@ +REPLACE_FDOPEN = @REPLACE_FDOPEN@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FSTAT = @REPLACE_FSTAT@ +REPLACE_FSTATAT = @REPLACE_FSTATAT@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ +REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETDELIM = @REPLACE_GETDELIM@ +REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ +REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@ +REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_GMTIME = @REPLACE_GMTIME@ +REPLACE_ICONV = @REPLACE_ICONV@ +REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@ +REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@ +REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ +REPLACE_INET_PTON = @REPLACE_INET_PTON@ +REPLACE_IOCTL = @REPLACE_IOCTL@ +REPLACE_ISATTY = @REPLACE_ISATTY@ +REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ +REPLACE_ITOLD = @REPLACE_ITOLD@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LINK = @REPLACE_LINK@ +REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ +REPLACE_LOCALTIME = @REPLACE_LOCALTIME@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MALLOC = @REPLACE_MALLOC@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MBTOWC = @REPLACE_MBTOWC@ +REPLACE_MEMCHR = @REPLACE_MEMCHR@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKDIR = @REPLACE_MKDIR@ +REPLACE_MKFIFO = @REPLACE_MKFIFO@ +REPLACE_MKNOD = @REPLACE_MKNOD@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_MKTIME = @REPLACE_MKTIME@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ +REPLACE_NULL = @REPLACE_NULL@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ +REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POPEN = @REPLACE_POPEN@ +REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PSELECT = @REPLACE_PSELECT@ +REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ +REPLACE_PTSNAME = @REPLACE_PTSNAME@ +REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ +REPLACE_RAISE = @REPLACE_RAISE@ +REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ +REPLACE_READ = @REPLACE_READ@ +REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ +REPLACE_REALLOC = @REPLACE_REALLOC@ +REPLACE_REALPATH = @REPLACE_REALPATH@ +REPLACE_REMOVE = @REPLACE_REMOVE@ +REPLACE_RENAME = @REPLACE_RENAME@ +REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ +REPLACE_RMDIR = @REPLACE_RMDIR@ +REPLACE_SELECT = @REPLACE_SELECT@ +REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ +REPLACE_SLEEP = @REPLACE_SLEEP@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STAT = @REPLACE_STAT@ +REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ +REPLACE_STPNCPY = @REPLACE_STPNCPY@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ +REPLACE_STRDUP = @REPLACE_STRDUP@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ +REPLACE_STRFTIME = @REPLACE_STRFTIME@ +REPLACE_STRNCAT = @REPLACE_STRNCAT@ +REPLACE_STRNDUP = @REPLACE_STRNDUP@ +REPLACE_STRNLEN = @REPLACE_STRNLEN@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ +REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ +REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ +REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ +REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ +REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TMPFILE = @REPLACE_TMPFILE@ +REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ +REPLACE_TRUNCATE = @REPLACE_TRUNCATE@ +REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ +REPLACE_TZSET = @REPLACE_TZSET@ +REPLACE_UNLINK = @REPLACE_UNLINK@ +REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ +REPLACE_UNSETENV = @REPLACE_UNSETENV@ +REPLACE_USLEEP = @REPLACE_USLEEP@ +REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSFTIME = @REPLACE_WCSFTIME@ +REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ +REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCTOMB = @REPLACE_WCTOMB@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SRC_VERSION_C = @SRC_VERSION_C@ +STDALIGN_H = @STDALIGN_H@ +STDARG_H = @STDARG_H@ +STDBOOL_H = @STDBOOL_H@ +STDDEF_H = @STDDEF_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@ +SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ +UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ +UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WERROR_CFLAGS = @WERROR_CFLAGS@ +WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ +WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@ +WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_aux_dir = @abs_aux_dir@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__rm_f_notfound = @am__rm_f_notfound@ +am__tar = @am__tar@ +am__untar = @am__untar@ +am__xargs_n = @am__xargs_n@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ +gltests_WITNESS = @gltests_WITNESS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +lispdir = @lispdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = 1.9.6 foreign subdir-objects +SUBDIRS = . +TESTS_ENVIRONMENT = EXEEXT='@EXEEXT@' srcdir='$(srcdir)' \ + LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \ + LIBSIGSEGV='@LIBSIGSEGV@' LOCALE_FR='@LOCALE_FR@' \ + LOCALE_TR_UTF8='@LOCALE_TR_UTF8@' LOCALE_FR='@LOCALE_FR@' \ + LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_JA='@LOCALE_JA@' \ + LOCALE_ZH_CN='@LOCALE_ZH_CN@' \ + LOCALE_TR_UTF8='@LOCALE_TR_UTF8@' \ + LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_FR='@LOCALE_FR@' \ + LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_JA='@LOCALE_JA@' \ + LOCALE_ZH_CN='@LOCALE_ZH_CN@' \ + LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \ + LOCALE_ZH_CN='@LOCALE_ZH_CN@' LOCALE_FR='@LOCALE_FR@' \ + LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_FR='@LOCALE_FR@' \ + LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_JA='@LOCALE_JA@' \ + LOCALE_ZH_CN='@LOCALE_ZH_CN@' abs_aux_dir='$(abs_aux_dir)' \ + abs_aux_dir='$(abs_aux_dir)' MAKE='$(MAKE)' \ + LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \ + LOCALE_JA='@LOCALE_JA@' LOCALE_ZH_CN='@LOCALE_ZH_CN@' +noinst_HEADERS = +noinst_LIBRARIES = +check_LIBRARIES = libtests.a +EXTRA_DIST = accept.c w32sock.h test-accept.c signature.h macros.h \ + test-alloca-opt.c test-areadlink.h test-areadlink.c macros.h \ + test-argmatch.c macros.h arpa_inet.in.h test-arpa_inet.c \ + test-binary-io.sh test-binary-io.c macros.h bind.c w32sock.h \ + test-bind.c signature.h macros.h test-bitrotate.c macros.h \ + test-btowc1.sh test-btowc2.sh test-btowc.c signature.h \ + macros.h test-c-ctype.c macros.h test-c-stack.c \ + test-c-stack.sh test-c-stack2.sh macros.h test-c-strcase.sh \ + test-c-strcasecmp.c test-c-strncasecmp.c macros.h test-close.c \ + signature.h macros.h connect.c w32sock.h test-connect.c \ + signature.h macros.h test-ctype.c test-dirname.c test-dup2.c \ + signature.h macros.h test-environ.c test-errno.c \ + test-exclude.c test-exclude1.sh test-exclude2.sh \ + test-exclude3.sh test-exclude4.sh test-exclude5.sh \ + test-exclude6.sh test-exclude7.sh test-exclude8.sh \ + test-fcntl-h.c test-fcntl.c signature.h macros.h fdopen.c \ + test-fdopen.c signature.h macros.h test-fgetc.c signature.h \ + macros.h test-filenamecat.c test-float.c macros.h \ + test-fnmatch.c signature.h macros.h fpucw.h test-fputc.c \ + signature.h macros.h test-fread.c signature.h macros.h \ + test-freopen-safer.c macros.h test-freopen.c signature.h \ + macros.h test-fstat.c signature.h macros.h ftruncate.c \ + test-ftruncate.c test-ftruncate.sh signature.h macros.h \ + test-fwrite.c signature.h macros.h getcwd-lgpl.c \ + test-getcwd-lgpl.c signature.h macros.h test-getdtablesize.c \ + signature.h macros.h macros.h signature.h test-getopt-gnu.c \ + test-getopt-main.h test-getopt.h test-getopt_long.h macros.h \ + signature.h test-getopt-posix.c test-getopt-main.h \ + test-getopt.h getpagesize.c test-getprogname.c signature.h \ + test-gettimeofday.c test-hash.c macros.h test-iconv-h.c \ + test-iconv.c signature.h macros.h test-ignore-value.c \ + inet_pton.c test-inet_pton.c signature.h macros.h \ + test-intprops.c macros.h macros.h test-inttostr.c \ + test-inttypes.c ioctl.c w32sock.h test-ioctl.c signature.h \ + macros.h test-isblank.c signature.h macros.h test-iswblank.c \ + macros.h test-langinfo.c test-limits-h.c listen.c w32sock.h \ + test-listen.c signature.h macros.h test-locale.c \ + test-localeconv.c signature.h macros.h test-lstat.h \ + test-lstat.c signature.h macros.h test-malloca.c \ + test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh \ + test-mbrtowc4.sh test-mbrtowc5.sh test-mbrtowc.c \ + test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh \ + test-mbrtowc-w32-3.sh test-mbrtowc-w32-4.sh \ + test-mbrtowc-w32-5.sh test-mbrtowc-w32.c signature.h macros.h \ + test-mbscasecmp.sh test-mbscasecmp.c macros.h test-mbsinit.sh \ + test-mbsinit.c signature.h macros.h test-mbsrtowcs1.sh \ + test-mbsrtowcs2.sh test-mbsrtowcs3.sh test-mbsrtowcs4.sh \ + test-mbsrtowcs.c signature.h macros.h test-mbsstr1.c \ + test-mbsstr2.sh test-mbsstr2.c test-mbsstr3.sh test-mbsstr3.c \ + macros.h test-memchr.c zerosize-ptr.h signature.h macros.h \ + nanosleep.c test-nanosleep.c signature.h macros.h \ + netinet_in.in.h test-netinet_in.c test-nl_langinfo.sh \ + test-nl_langinfo.c signature.h macros.h test-open.h \ + test-open.c signature.h macros.h test-pathmax.c perror.c \ + macros.h signature.h test-perror.c test-perror2.c \ + test-perror.sh pipe.c test-pipe.c signature.h macros.h \ + putenv.c test-quotearg-simple.c test-quotearg.h macros.h \ + zerosize-ptr.h test-raise.c signature.h macros.h \ + test-rawmemchr.c zerosize-ptr.h signature.h macros.h \ + test-readlink.h test-readlink.c signature.h macros.h \ + test-regex.c macros.h same-inode.h select.c macros.h \ + signature.h test-select.c test-select.h test-select-fd.c \ + test-select-in.sh test-select-out.sh test-select-stdin.c \ + test-setenv.c signature.h macros.h setlocale.c \ + test-setlocale1.sh test-setlocale1.c test-setlocale2.sh \ + test-setlocale2.c signature.h macros.h setsockopt.c w32sock.h \ + test-setsockopt.c signature.h macros.h test-sh-quote.c \ + test-sigaction.c signature.h macros.h test-signal-h.c \ + test-sigprocmask.c signature.h macros.h sleep.c test-sleep.c \ + signature.h macros.h _Noreturn.h arg-nonnull.h c++defs.h \ + unused-parameter.h warn-on-use.h snprintf.c test-snprintf.c \ + signature.h macros.h socket.c w32sock.h w32sock.h \ + test-sockets.c test-stat.h test-stat.c signature.h macros.h \ + test-stat-time.c macros.h nap.h stdalign.in.h test-stdalign.c \ + macros.h test-stdbool.c test-stddef.c test-stdint.c \ + test-stdio.c test-stdlib.c test-sys_wait.h test-strerror.c \ + signature.h macros.h strerror_r.c test-strerror_r.c \ + signature.h macros.h test-strftime.c macros.h test-striconv.c \ + macros.h test-string.c test-strings.c test-strnlen.c \ + zerosize-ptr.h signature.h macros.h test-strtoull.c \ + signature.h macros.h test-strtoumax.c signature.h macros.h \ + symlink.c test-symlink.h test-symlink.c signature.h macros.h \ + sys_ioctl.in.h test-sys_ioctl.c sys_select.in.h \ + test-sys_select.c signature.h sys_socket.in.h \ + test-sys_socket.c test-sys_stat.c test-sys_time.c \ + test-sys_types.c sys_uio.in.h test-sys_uio.c test-sys_wait.c \ + test-sys_wait.h init.sh test-init.sh test-time.c \ + test-timespec.c macros.h test-unistd.c \ + unistr/test-u8-mbtoucr.c macros.h unistr/test-u8-uctomb.c \ + macros.h uniwidth/test-uc_width.c uniwidth/test-uc_width2.c \ + uniwidth/test-uc_width2.sh macros.h test-unsetenv.c \ + signature.h macros.h test-update-copyright.sh \ + test-vasnprintf.c macros.h test-vasprintf.c signature.h \ + macros.h test-vc-list-files-git.sh test-vc-list-files-cvs.sh \ + test-verify.c test-verify-try.c test-verify.sh \ + test-version-etc.c test-version-etc.sh test-wchar.c \ + test-wcrtomb.sh test-wcrtomb.c test-wcrtomb-w32-1.sh \ + test-wcrtomb-w32-2.sh test-wcrtomb-w32-3.sh \ + test-wcrtomb-w32-4.sh test-wcrtomb-w32-5.sh test-wcrtomb-w32.c \ + signature.h macros.h wctob.c wctomb-impl.h wctomb.c \ + test-wctype-h.c macros.h test-wcwidth.c signature.h macros.h \ + test-xalloc-die.c test-xalloc-die.sh test-xstrtol.c \ + test-xstrtoul.c test-xstrtol.sh test-xstrtoumax.c \ + test-xstrtoumax.sh test-xvasprintf.c macros.h +BUILT_SOURCES = arpa/inet.h $(NETINET_IN_H) $(STDALIGN_H) sys/ioctl.h \ + sys/select.h sys/socket.h sys/uio.h +SUFFIXES = + +# This test expects compilation of test-verify-try.c to fail, and +# each time it fails, the makefile rule does not perform the usual +# "mv -f $name.Tpo $name.po, so tell make clean to remove that file. +MOSTLYCLEANFILES = core *.stackdump arpa/inet.h arpa/inet.h-t \ + t-c-stack.tmp t-c-stack2.tmp netinet/in.h netinet/in.h-t \ + stdalign.h stdalign.h-t sys/ioctl.h sys/ioctl.h-t sys/select.h \ + sys/select.h-t sys/socket.h sys/socket.h-t sys/uio.h \ + sys/uio.h-t .deps/test-verify-try.Tpo +MOSTLYCLEANDIRS = arpa netinet sys sys sys sys +CLEANFILES = +DISTCLEANFILES = +MAINTAINERCLEANFILES = +AM_CPPFLAGS = \ + -D@gltests_WITNESS@=1 \ + -I. -I$(srcdir) \ + -I.. -I$(srcdir)/.. \ + -I../lib -I$(srcdir)/../lib + +LDADD = libtests.a ../lib/libdiffutils.a libtests.a $(LIBTESTS_LIBDEPS) +libtests_a_SOURCES = dtotimespec.c hash-pjw.h hash-pjw.c sockets.h \ + sockets.c sys_socket.c timespec-add.c timespec-sub.c +libtests_a_LIBADD = $(gltests_LIBOBJS) +libtests_a_DEPENDENCIES = $(gltests_LIBOBJS) +EXTRA_libtests_a_SOURCES = accept.c bind.c connect.c fdopen.c \ + ftruncate.c getcwd-lgpl.c getpagesize.c inet_pton.c ioctl.c \ + listen.c nanosleep.c perror.c pipe.c putenv.c select.c \ + setlocale.c setsockopt.c sleep.c snprintf.c socket.c \ + strerror_r.c symlink.c wctob.c wctomb.c +AM_LIBTOOLFLAGS = --preserve-dup-deps +test_accept_LDADD = $(LDADD) @LIBSOCKET@ +test_argmatch_LDADD = $(LDADD) @LIBINTL@ +test_bind_LDADD = $(LDADD) @LIBSOCKET@ $(INET_PTON_LIB) +test_c_stack_LDADD = $(LDADD) $(LIBCSTACK) @LIBINTL@ +test_connect_LDADD = $(LDADD) @LIBSOCKET@ $(INET_PTON_LIB) +test_dirname_LDADD = $(LDADD) @LIBINTL@ +test_exclude_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD) +test_filenamecat_LDADD = $(LDADD) @LIBINTL@ +test_getcwd_lgpl_LDADD = $(LDADD) $(LIBINTL) +test_getopt_gnu_LDADD = $(LDADD) $(LIBINTL) +test_getopt_posix_LDADD = $(LDADD) $(LIBINTL) +test_getprogname_LDADD = $(LDADD) +test_iconv_LDADD = $(LDADD) @LIBICONV@ +test_inet_pton_LDADD = $(LDADD) @INET_PTON_LIB@ +test_listen_LDADD = $(LDADD) @LIBSOCKET@ +test_nanosleep_LDADD = $(LDADD) $(LIB_NANOSLEEP) +test_quotearg_simple_LDADD = $(LDADD) @LIBINTL@ +test_regex_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD) $(LIB_PTHREAD) +test_select_LDADD = $(LDADD) @LIB_SELECT@ @LIBSOCKET@ $(INET_PTON_LIB) +test_select_fd_LDADD = $(LDADD) @LIB_SELECT@ +test_select_stdin_LDADD = $(LDADD) @LIB_SELECT@ +test_setsockopt_LDADD = $(LDADD) @LIBSOCKET@ +test_sh_quote_LDADD = $(LDADD) @LIBINTL@ + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. +_NORETURN_H = $(srcdir)/_Noreturn.h + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. +ARG_NONNULL_H = $(srcdir)/arg-nonnull.h + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. +CXXDEFS_H = $(srcdir)/c++defs.h + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. +UNUSED_PARAMETER_H = $(srcdir)/unused-parameter.h + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. +WARN_ON_USE_H = $(srcdir)/warn-on-use.h +test_sockets_LDADD = $(LDADD) @LIBSOCKET@ +test_stat_LDADD = $(LDADD) $(LIBINTL) +test_stat_time_LDADD = $(LDADD) $(LIB_NANOSLEEP) +test_striconv_LDADD = $(LDADD) @LIBICONV@ +test_u8_mbtoucr_SOURCES = unistr/test-u8-mbtoucr.c +test_u8_mbtoucr_LDADD = $(LDADD) $(LIBUNISTRING) +test_u8_uctomb_SOURCES = unistr/test-u8-uctomb.c +test_u8_uctomb_LDADD = $(LDADD) $(LIBUNISTRING) +test_uc_width_SOURCES = uniwidth/test-uc_width.c +test_uc_width_LDADD = $(LDADD) $(LIBUNISTRING) +test_uc_width2_SOURCES = uniwidth/test-uc_width2.c +test_uc_width2_LDADD = $(LDADD) $(LIBUNISTRING) +test_version_etc_LDADD = $(LDADD) @LIBINTL@ +test_xalloc_die_LDADD = $(LDADD) @LIBINTL@ +test_xstrtol_LDADD = $(LDADD) @LIBINTL@ +test_xstrtoul_LDADD = $(LDADD) @LIBINTL@ +test_xstrtoumax_LDADD = $(LDADD) @LIBINTL@ +test_xvasprintf_LDADD = $(LDADD) @LIBINTL@ +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +.SUFFIXES: .c .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/gnulib.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gnulib-tests/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign gnulib-tests/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; +$(srcdir)/gnulib.mk $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -$(am__rm_f) $(check_PROGRAMS) + +clean-noinstPROGRAMS: + -$(am__rm_f) $(noinst_PROGRAMS) + +clean-checkLIBRARIES: + -$(am__rm_f) $(check_LIBRARIES) + +clean-noinstLIBRARIES: + -$(am__rm_f) $(noinst_LIBRARIES) + +libtests.a: $(libtests_a_OBJECTS) $(libtests_a_DEPENDENCIES) $(EXTRA_libtests_a_DEPENDENCIES) + $(AM_V_at)-rm -f libtests.a + $(AM_V_AR)$(libtests_a_AR) libtests.a $(libtests_a_OBJECTS) $(libtests_a_LIBADD) + $(AM_V_at)$(libtests_a_RANLIB) libtests.a + +test-accept$(EXEEXT): $(test_accept_OBJECTS) $(test_accept_DEPENDENCIES) $(EXTRA_test_accept_DEPENDENCIES) + @rm -f test-accept$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_accept_OBJECTS) $(test_accept_LDADD) $(LIBS) + +test-alloca-opt$(EXEEXT): $(test_alloca_opt_OBJECTS) $(test_alloca_opt_DEPENDENCIES) $(EXTRA_test_alloca_opt_DEPENDENCIES) + @rm -f test-alloca-opt$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_alloca_opt_OBJECTS) $(test_alloca_opt_LDADD) $(LIBS) + +test-areadlink$(EXEEXT): $(test_areadlink_OBJECTS) $(test_areadlink_DEPENDENCIES) $(EXTRA_test_areadlink_DEPENDENCIES) + @rm -f test-areadlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_areadlink_OBJECTS) $(test_areadlink_LDADD) $(LIBS) + +test-argmatch$(EXEEXT): $(test_argmatch_OBJECTS) $(test_argmatch_DEPENDENCIES) $(EXTRA_test_argmatch_DEPENDENCIES) + @rm -f test-argmatch$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_argmatch_OBJECTS) $(test_argmatch_LDADD) $(LIBS) + +test-arpa_inet$(EXEEXT): $(test_arpa_inet_OBJECTS) $(test_arpa_inet_DEPENDENCIES) $(EXTRA_test_arpa_inet_DEPENDENCIES) + @rm -f test-arpa_inet$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_arpa_inet_OBJECTS) $(test_arpa_inet_LDADD) $(LIBS) + +test-binary-io$(EXEEXT): $(test_binary_io_OBJECTS) $(test_binary_io_DEPENDENCIES) $(EXTRA_test_binary_io_DEPENDENCIES) + @rm -f test-binary-io$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_binary_io_OBJECTS) $(test_binary_io_LDADD) $(LIBS) + +test-bind$(EXEEXT): $(test_bind_OBJECTS) $(test_bind_DEPENDENCIES) $(EXTRA_test_bind_DEPENDENCIES) + @rm -f test-bind$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_bind_OBJECTS) $(test_bind_LDADD) $(LIBS) + +test-bitrotate$(EXEEXT): $(test_bitrotate_OBJECTS) $(test_bitrotate_DEPENDENCIES) $(EXTRA_test_bitrotate_DEPENDENCIES) + @rm -f test-bitrotate$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_bitrotate_OBJECTS) $(test_bitrotate_LDADD) $(LIBS) + +test-btowc$(EXEEXT): $(test_btowc_OBJECTS) $(test_btowc_DEPENDENCIES) $(EXTRA_test_btowc_DEPENDENCIES) + @rm -f test-btowc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_btowc_OBJECTS) $(test_btowc_LDADD) $(LIBS) + +test-c-ctype$(EXEEXT): $(test_c_ctype_OBJECTS) $(test_c_ctype_DEPENDENCIES) $(EXTRA_test_c_ctype_DEPENDENCIES) + @rm -f test-c-ctype$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_c_ctype_OBJECTS) $(test_c_ctype_LDADD) $(LIBS) + +test-c-stack$(EXEEXT): $(test_c_stack_OBJECTS) $(test_c_stack_DEPENDENCIES) $(EXTRA_test_c_stack_DEPENDENCIES) + @rm -f test-c-stack$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_c_stack_OBJECTS) $(test_c_stack_LDADD) $(LIBS) + +test-c-strcasecmp$(EXEEXT): $(test_c_strcasecmp_OBJECTS) $(test_c_strcasecmp_DEPENDENCIES) $(EXTRA_test_c_strcasecmp_DEPENDENCIES) + @rm -f test-c-strcasecmp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_c_strcasecmp_OBJECTS) $(test_c_strcasecmp_LDADD) $(LIBS) + +test-c-strncasecmp$(EXEEXT): $(test_c_strncasecmp_OBJECTS) $(test_c_strncasecmp_DEPENDENCIES) $(EXTRA_test_c_strncasecmp_DEPENDENCIES) + @rm -f test-c-strncasecmp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_c_strncasecmp_OBJECTS) $(test_c_strncasecmp_LDADD) $(LIBS) + +test-close$(EXEEXT): $(test_close_OBJECTS) $(test_close_DEPENDENCIES) $(EXTRA_test_close_DEPENDENCIES) + @rm -f test-close$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_close_OBJECTS) $(test_close_LDADD) $(LIBS) + +test-connect$(EXEEXT): $(test_connect_OBJECTS) $(test_connect_DEPENDENCIES) $(EXTRA_test_connect_DEPENDENCIES) + @rm -f test-connect$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_connect_OBJECTS) $(test_connect_LDADD) $(LIBS) + +test-ctype$(EXEEXT): $(test_ctype_OBJECTS) $(test_ctype_DEPENDENCIES) $(EXTRA_test_ctype_DEPENDENCIES) + @rm -f test-ctype$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_ctype_OBJECTS) $(test_ctype_LDADD) $(LIBS) + +test-dirname$(EXEEXT): $(test_dirname_OBJECTS) $(test_dirname_DEPENDENCIES) $(EXTRA_test_dirname_DEPENDENCIES) + @rm -f test-dirname$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_dirname_OBJECTS) $(test_dirname_LDADD) $(LIBS) + +test-dup2$(EXEEXT): $(test_dup2_OBJECTS) $(test_dup2_DEPENDENCIES) $(EXTRA_test_dup2_DEPENDENCIES) + @rm -f test-dup2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_dup2_OBJECTS) $(test_dup2_LDADD) $(LIBS) + +test-environ$(EXEEXT): $(test_environ_OBJECTS) $(test_environ_DEPENDENCIES) $(EXTRA_test_environ_DEPENDENCIES) + @rm -f test-environ$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_environ_OBJECTS) $(test_environ_LDADD) $(LIBS) + +test-errno$(EXEEXT): $(test_errno_OBJECTS) $(test_errno_DEPENDENCIES) $(EXTRA_test_errno_DEPENDENCIES) + @rm -f test-errno$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_errno_OBJECTS) $(test_errno_LDADD) $(LIBS) + +test-exclude$(EXEEXT): $(test_exclude_OBJECTS) $(test_exclude_DEPENDENCIES) $(EXTRA_test_exclude_DEPENDENCIES) + @rm -f test-exclude$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_exclude_OBJECTS) $(test_exclude_LDADD) $(LIBS) + +test-fcntl$(EXEEXT): $(test_fcntl_OBJECTS) $(test_fcntl_DEPENDENCIES) $(EXTRA_test_fcntl_DEPENDENCIES) + @rm -f test-fcntl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_fcntl_OBJECTS) $(test_fcntl_LDADD) $(LIBS) + +test-fcntl-h$(EXEEXT): $(test_fcntl_h_OBJECTS) $(test_fcntl_h_DEPENDENCIES) $(EXTRA_test_fcntl_h_DEPENDENCIES) + @rm -f test-fcntl-h$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_fcntl_h_OBJECTS) $(test_fcntl_h_LDADD) $(LIBS) + +test-fdopen$(EXEEXT): $(test_fdopen_OBJECTS) $(test_fdopen_DEPENDENCIES) $(EXTRA_test_fdopen_DEPENDENCIES) + @rm -f test-fdopen$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_fdopen_OBJECTS) $(test_fdopen_LDADD) $(LIBS) + +test-fgetc$(EXEEXT): $(test_fgetc_OBJECTS) $(test_fgetc_DEPENDENCIES) $(EXTRA_test_fgetc_DEPENDENCIES) + @rm -f test-fgetc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_fgetc_OBJECTS) $(test_fgetc_LDADD) $(LIBS) + +test-filenamecat$(EXEEXT): $(test_filenamecat_OBJECTS) $(test_filenamecat_DEPENDENCIES) $(EXTRA_test_filenamecat_DEPENDENCIES) + @rm -f test-filenamecat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_filenamecat_OBJECTS) $(test_filenamecat_LDADD) $(LIBS) + +test-float$(EXEEXT): $(test_float_OBJECTS) $(test_float_DEPENDENCIES) $(EXTRA_test_float_DEPENDENCIES) + @rm -f test-float$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_float_OBJECTS) $(test_float_LDADD) $(LIBS) + +test-fnmatch$(EXEEXT): $(test_fnmatch_OBJECTS) $(test_fnmatch_DEPENDENCIES) $(EXTRA_test_fnmatch_DEPENDENCIES) + @rm -f test-fnmatch$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_fnmatch_OBJECTS) $(test_fnmatch_LDADD) $(LIBS) + +test-fputc$(EXEEXT): $(test_fputc_OBJECTS) $(test_fputc_DEPENDENCIES) $(EXTRA_test_fputc_DEPENDENCIES) + @rm -f test-fputc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_fputc_OBJECTS) $(test_fputc_LDADD) $(LIBS) + +test-fread$(EXEEXT): $(test_fread_OBJECTS) $(test_fread_DEPENDENCIES) $(EXTRA_test_fread_DEPENDENCIES) + @rm -f test-fread$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_fread_OBJECTS) $(test_fread_LDADD) $(LIBS) + +test-freopen$(EXEEXT): $(test_freopen_OBJECTS) $(test_freopen_DEPENDENCIES) $(EXTRA_test_freopen_DEPENDENCIES) + @rm -f test-freopen$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_freopen_OBJECTS) $(test_freopen_LDADD) $(LIBS) + +test-freopen-safer$(EXEEXT): $(test_freopen_safer_OBJECTS) $(test_freopen_safer_DEPENDENCIES) $(EXTRA_test_freopen_safer_DEPENDENCIES) + @rm -f test-freopen-safer$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_freopen_safer_OBJECTS) $(test_freopen_safer_LDADD) $(LIBS) + +test-fstat$(EXEEXT): $(test_fstat_OBJECTS) $(test_fstat_DEPENDENCIES) $(EXTRA_test_fstat_DEPENDENCIES) + @rm -f test-fstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_fstat_OBJECTS) $(test_fstat_LDADD) $(LIBS) + +test-ftruncate$(EXEEXT): $(test_ftruncate_OBJECTS) $(test_ftruncate_DEPENDENCIES) $(EXTRA_test_ftruncate_DEPENDENCIES) + @rm -f test-ftruncate$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_ftruncate_OBJECTS) $(test_ftruncate_LDADD) $(LIBS) + +test-fwrite$(EXEEXT): $(test_fwrite_OBJECTS) $(test_fwrite_DEPENDENCIES) $(EXTRA_test_fwrite_DEPENDENCIES) + @rm -f test-fwrite$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_fwrite_OBJECTS) $(test_fwrite_LDADD) $(LIBS) + +test-getcwd-lgpl$(EXEEXT): $(test_getcwd_lgpl_OBJECTS) $(test_getcwd_lgpl_DEPENDENCIES) $(EXTRA_test_getcwd_lgpl_DEPENDENCIES) + @rm -f test-getcwd-lgpl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_getcwd_lgpl_OBJECTS) $(test_getcwd_lgpl_LDADD) $(LIBS) + +test-getdtablesize$(EXEEXT): $(test_getdtablesize_OBJECTS) $(test_getdtablesize_DEPENDENCIES) $(EXTRA_test_getdtablesize_DEPENDENCIES) + @rm -f test-getdtablesize$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_getdtablesize_OBJECTS) $(test_getdtablesize_LDADD) $(LIBS) + +test-getopt-gnu$(EXEEXT): $(test_getopt_gnu_OBJECTS) $(test_getopt_gnu_DEPENDENCIES) $(EXTRA_test_getopt_gnu_DEPENDENCIES) + @rm -f test-getopt-gnu$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_getopt_gnu_OBJECTS) $(test_getopt_gnu_LDADD) $(LIBS) + +test-getopt-posix$(EXEEXT): $(test_getopt_posix_OBJECTS) $(test_getopt_posix_DEPENDENCIES) $(EXTRA_test_getopt_posix_DEPENDENCIES) + @rm -f test-getopt-posix$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_getopt_posix_OBJECTS) $(test_getopt_posix_LDADD) $(LIBS) + +test-getprogname$(EXEEXT): $(test_getprogname_OBJECTS) $(test_getprogname_DEPENDENCIES) $(EXTRA_test_getprogname_DEPENDENCIES) + @rm -f test-getprogname$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_getprogname_OBJECTS) $(test_getprogname_LDADD) $(LIBS) + +test-gettimeofday$(EXEEXT): $(test_gettimeofday_OBJECTS) $(test_gettimeofday_DEPENDENCIES) $(EXTRA_test_gettimeofday_DEPENDENCIES) + @rm -f test-gettimeofday$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_gettimeofday_OBJECTS) $(test_gettimeofday_LDADD) $(LIBS) + +test-hash$(EXEEXT): $(test_hash_OBJECTS) $(test_hash_DEPENDENCIES) $(EXTRA_test_hash_DEPENDENCIES) + @rm -f test-hash$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_hash_OBJECTS) $(test_hash_LDADD) $(LIBS) + +test-iconv$(EXEEXT): $(test_iconv_OBJECTS) $(test_iconv_DEPENDENCIES) $(EXTRA_test_iconv_DEPENDENCIES) + @rm -f test-iconv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_iconv_OBJECTS) $(test_iconv_LDADD) $(LIBS) + +test-iconv-h$(EXEEXT): $(test_iconv_h_OBJECTS) $(test_iconv_h_DEPENDENCIES) $(EXTRA_test_iconv_h_DEPENDENCIES) + @rm -f test-iconv-h$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_iconv_h_OBJECTS) $(test_iconv_h_LDADD) $(LIBS) + +test-ignore-value$(EXEEXT): $(test_ignore_value_OBJECTS) $(test_ignore_value_DEPENDENCIES) $(EXTRA_test_ignore_value_DEPENDENCIES) + @rm -f test-ignore-value$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_ignore_value_OBJECTS) $(test_ignore_value_LDADD) $(LIBS) + +test-inet_pton$(EXEEXT): $(test_inet_pton_OBJECTS) $(test_inet_pton_DEPENDENCIES) $(EXTRA_test_inet_pton_DEPENDENCIES) + @rm -f test-inet_pton$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_inet_pton_OBJECTS) $(test_inet_pton_LDADD) $(LIBS) + +test-intprops$(EXEEXT): $(test_intprops_OBJECTS) $(test_intprops_DEPENDENCIES) $(EXTRA_test_intprops_DEPENDENCIES) + @rm -f test-intprops$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_intprops_OBJECTS) $(test_intprops_LDADD) $(LIBS) + +test-inttostr$(EXEEXT): $(test_inttostr_OBJECTS) $(test_inttostr_DEPENDENCIES) $(EXTRA_test_inttostr_DEPENDENCIES) + @rm -f test-inttostr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_inttostr_OBJECTS) $(test_inttostr_LDADD) $(LIBS) + +test-inttypes$(EXEEXT): $(test_inttypes_OBJECTS) $(test_inttypes_DEPENDENCIES) $(EXTRA_test_inttypes_DEPENDENCIES) + @rm -f test-inttypes$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_inttypes_OBJECTS) $(test_inttypes_LDADD) $(LIBS) + +test-ioctl$(EXEEXT): $(test_ioctl_OBJECTS) $(test_ioctl_DEPENDENCIES) $(EXTRA_test_ioctl_DEPENDENCIES) + @rm -f test-ioctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_ioctl_OBJECTS) $(test_ioctl_LDADD) $(LIBS) + +test-isblank$(EXEEXT): $(test_isblank_OBJECTS) $(test_isblank_DEPENDENCIES) $(EXTRA_test_isblank_DEPENDENCIES) + @rm -f test-isblank$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_isblank_OBJECTS) $(test_isblank_LDADD) $(LIBS) + +test-iswblank$(EXEEXT): $(test_iswblank_OBJECTS) $(test_iswblank_DEPENDENCIES) $(EXTRA_test_iswblank_DEPENDENCIES) + @rm -f test-iswblank$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_iswblank_OBJECTS) $(test_iswblank_LDADD) $(LIBS) + +test-langinfo$(EXEEXT): $(test_langinfo_OBJECTS) $(test_langinfo_DEPENDENCIES) $(EXTRA_test_langinfo_DEPENDENCIES) + @rm -f test-langinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_langinfo_OBJECTS) $(test_langinfo_LDADD) $(LIBS) + +test-limits-h$(EXEEXT): $(test_limits_h_OBJECTS) $(test_limits_h_DEPENDENCIES) $(EXTRA_test_limits_h_DEPENDENCIES) + @rm -f test-limits-h$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_limits_h_OBJECTS) $(test_limits_h_LDADD) $(LIBS) + +test-listen$(EXEEXT): $(test_listen_OBJECTS) $(test_listen_DEPENDENCIES) $(EXTRA_test_listen_DEPENDENCIES) + @rm -f test-listen$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_listen_OBJECTS) $(test_listen_LDADD) $(LIBS) + +test-locale$(EXEEXT): $(test_locale_OBJECTS) $(test_locale_DEPENDENCIES) $(EXTRA_test_locale_DEPENDENCIES) + @rm -f test-locale$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_locale_OBJECTS) $(test_locale_LDADD) $(LIBS) + +test-localeconv$(EXEEXT): $(test_localeconv_OBJECTS) $(test_localeconv_DEPENDENCIES) $(EXTRA_test_localeconv_DEPENDENCIES) + @rm -f test-localeconv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_localeconv_OBJECTS) $(test_localeconv_LDADD) $(LIBS) + +test-lstat$(EXEEXT): $(test_lstat_OBJECTS) $(test_lstat_DEPENDENCIES) $(EXTRA_test_lstat_DEPENDENCIES) + @rm -f test-lstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_lstat_OBJECTS) $(test_lstat_LDADD) $(LIBS) + +test-malloca$(EXEEXT): $(test_malloca_OBJECTS) $(test_malloca_DEPENDENCIES) $(EXTRA_test_malloca_DEPENDENCIES) + @rm -f test-malloca$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_malloca_OBJECTS) $(test_malloca_LDADD) $(LIBS) + +test-mbrtowc$(EXEEXT): $(test_mbrtowc_OBJECTS) $(test_mbrtowc_DEPENDENCIES) $(EXTRA_test_mbrtowc_DEPENDENCIES) + @rm -f test-mbrtowc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_mbrtowc_OBJECTS) $(test_mbrtowc_LDADD) $(LIBS) + +test-mbrtowc-w32$(EXEEXT): $(test_mbrtowc_w32_OBJECTS) $(test_mbrtowc_w32_DEPENDENCIES) $(EXTRA_test_mbrtowc_w32_DEPENDENCIES) + @rm -f test-mbrtowc-w32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_mbrtowc_w32_OBJECTS) $(test_mbrtowc_w32_LDADD) $(LIBS) + +test-mbscasecmp$(EXEEXT): $(test_mbscasecmp_OBJECTS) $(test_mbscasecmp_DEPENDENCIES) $(EXTRA_test_mbscasecmp_DEPENDENCIES) + @rm -f test-mbscasecmp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_mbscasecmp_OBJECTS) $(test_mbscasecmp_LDADD) $(LIBS) + +test-mbsinit$(EXEEXT): $(test_mbsinit_OBJECTS) $(test_mbsinit_DEPENDENCIES) $(EXTRA_test_mbsinit_DEPENDENCIES) + @rm -f test-mbsinit$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_mbsinit_OBJECTS) $(test_mbsinit_LDADD) $(LIBS) + +test-mbsrtowcs$(EXEEXT): $(test_mbsrtowcs_OBJECTS) $(test_mbsrtowcs_DEPENDENCIES) $(EXTRA_test_mbsrtowcs_DEPENDENCIES) + @rm -f test-mbsrtowcs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_mbsrtowcs_OBJECTS) $(test_mbsrtowcs_LDADD) $(LIBS) + +test-mbsstr1$(EXEEXT): $(test_mbsstr1_OBJECTS) $(test_mbsstr1_DEPENDENCIES) $(EXTRA_test_mbsstr1_DEPENDENCIES) + @rm -f test-mbsstr1$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_mbsstr1_OBJECTS) $(test_mbsstr1_LDADD) $(LIBS) + +test-mbsstr2$(EXEEXT): $(test_mbsstr2_OBJECTS) $(test_mbsstr2_DEPENDENCIES) $(EXTRA_test_mbsstr2_DEPENDENCIES) + @rm -f test-mbsstr2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_mbsstr2_OBJECTS) $(test_mbsstr2_LDADD) $(LIBS) + +test-mbsstr3$(EXEEXT): $(test_mbsstr3_OBJECTS) $(test_mbsstr3_DEPENDENCIES) $(EXTRA_test_mbsstr3_DEPENDENCIES) + @rm -f test-mbsstr3$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_mbsstr3_OBJECTS) $(test_mbsstr3_LDADD) $(LIBS) + +test-memchr$(EXEEXT): $(test_memchr_OBJECTS) $(test_memchr_DEPENDENCIES) $(EXTRA_test_memchr_DEPENDENCIES) + @rm -f test-memchr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_memchr_OBJECTS) $(test_memchr_LDADD) $(LIBS) + +test-nanosleep$(EXEEXT): $(test_nanosleep_OBJECTS) $(test_nanosleep_DEPENDENCIES) $(EXTRA_test_nanosleep_DEPENDENCIES) + @rm -f test-nanosleep$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_nanosleep_OBJECTS) $(test_nanosleep_LDADD) $(LIBS) + +test-netinet_in$(EXEEXT): $(test_netinet_in_OBJECTS) $(test_netinet_in_DEPENDENCIES) $(EXTRA_test_netinet_in_DEPENDENCIES) + @rm -f test-netinet_in$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_netinet_in_OBJECTS) $(test_netinet_in_LDADD) $(LIBS) + +test-nl_langinfo$(EXEEXT): $(test_nl_langinfo_OBJECTS) $(test_nl_langinfo_DEPENDENCIES) $(EXTRA_test_nl_langinfo_DEPENDENCIES) + @rm -f test-nl_langinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_nl_langinfo_OBJECTS) $(test_nl_langinfo_LDADD) $(LIBS) + +test-open$(EXEEXT): $(test_open_OBJECTS) $(test_open_DEPENDENCIES) $(EXTRA_test_open_DEPENDENCIES) + @rm -f test-open$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_open_OBJECTS) $(test_open_LDADD) $(LIBS) + +test-pathmax$(EXEEXT): $(test_pathmax_OBJECTS) $(test_pathmax_DEPENDENCIES) $(EXTRA_test_pathmax_DEPENDENCIES) + @rm -f test-pathmax$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_pathmax_OBJECTS) $(test_pathmax_LDADD) $(LIBS) + +test-perror$(EXEEXT): $(test_perror_OBJECTS) $(test_perror_DEPENDENCIES) $(EXTRA_test_perror_DEPENDENCIES) + @rm -f test-perror$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_perror_OBJECTS) $(test_perror_LDADD) $(LIBS) + +test-perror2$(EXEEXT): $(test_perror2_OBJECTS) $(test_perror2_DEPENDENCIES) $(EXTRA_test_perror2_DEPENDENCIES) + @rm -f test-perror2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_perror2_OBJECTS) $(test_perror2_LDADD) $(LIBS) + +test-pipe$(EXEEXT): $(test_pipe_OBJECTS) $(test_pipe_DEPENDENCIES) $(EXTRA_test_pipe_DEPENDENCIES) + @rm -f test-pipe$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_pipe_OBJECTS) $(test_pipe_LDADD) $(LIBS) + +test-quotearg-simple$(EXEEXT): $(test_quotearg_simple_OBJECTS) $(test_quotearg_simple_DEPENDENCIES) $(EXTRA_test_quotearg_simple_DEPENDENCIES) + @rm -f test-quotearg-simple$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_quotearg_simple_OBJECTS) $(test_quotearg_simple_LDADD) $(LIBS) + +test-raise$(EXEEXT): $(test_raise_OBJECTS) $(test_raise_DEPENDENCIES) $(EXTRA_test_raise_DEPENDENCIES) + @rm -f test-raise$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_raise_OBJECTS) $(test_raise_LDADD) $(LIBS) + +test-rawmemchr$(EXEEXT): $(test_rawmemchr_OBJECTS) $(test_rawmemchr_DEPENDENCIES) $(EXTRA_test_rawmemchr_DEPENDENCIES) + @rm -f test-rawmemchr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_rawmemchr_OBJECTS) $(test_rawmemchr_LDADD) $(LIBS) + +test-readlink$(EXEEXT): $(test_readlink_OBJECTS) $(test_readlink_DEPENDENCIES) $(EXTRA_test_readlink_DEPENDENCIES) + @rm -f test-readlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_readlink_OBJECTS) $(test_readlink_LDADD) $(LIBS) + +test-regex$(EXEEXT): $(test_regex_OBJECTS) $(test_regex_DEPENDENCIES) $(EXTRA_test_regex_DEPENDENCIES) + @rm -f test-regex$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_regex_OBJECTS) $(test_regex_LDADD) $(LIBS) + +test-select$(EXEEXT): $(test_select_OBJECTS) $(test_select_DEPENDENCIES) $(EXTRA_test_select_DEPENDENCIES) + @rm -f test-select$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_select_OBJECTS) $(test_select_LDADD) $(LIBS) + +test-select-fd$(EXEEXT): $(test_select_fd_OBJECTS) $(test_select_fd_DEPENDENCIES) $(EXTRA_test_select_fd_DEPENDENCIES) + @rm -f test-select-fd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_select_fd_OBJECTS) $(test_select_fd_LDADD) $(LIBS) + +test-select-stdin$(EXEEXT): $(test_select_stdin_OBJECTS) $(test_select_stdin_DEPENDENCIES) $(EXTRA_test_select_stdin_DEPENDENCIES) + @rm -f test-select-stdin$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_select_stdin_OBJECTS) $(test_select_stdin_LDADD) $(LIBS) + +test-setenv$(EXEEXT): $(test_setenv_OBJECTS) $(test_setenv_DEPENDENCIES) $(EXTRA_test_setenv_DEPENDENCIES) + @rm -f test-setenv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_setenv_OBJECTS) $(test_setenv_LDADD) $(LIBS) + +test-setlocale1$(EXEEXT): $(test_setlocale1_OBJECTS) $(test_setlocale1_DEPENDENCIES) $(EXTRA_test_setlocale1_DEPENDENCIES) + @rm -f test-setlocale1$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_setlocale1_OBJECTS) $(test_setlocale1_LDADD) $(LIBS) + +test-setlocale2$(EXEEXT): $(test_setlocale2_OBJECTS) $(test_setlocale2_DEPENDENCIES) $(EXTRA_test_setlocale2_DEPENDENCIES) + @rm -f test-setlocale2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_setlocale2_OBJECTS) $(test_setlocale2_LDADD) $(LIBS) + +test-setsockopt$(EXEEXT): $(test_setsockopt_OBJECTS) $(test_setsockopt_DEPENDENCIES) $(EXTRA_test_setsockopt_DEPENDENCIES) + @rm -f test-setsockopt$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_setsockopt_OBJECTS) $(test_setsockopt_LDADD) $(LIBS) + +test-sh-quote$(EXEEXT): $(test_sh_quote_OBJECTS) $(test_sh_quote_DEPENDENCIES) $(EXTRA_test_sh_quote_DEPENDENCIES) + @rm -f test-sh-quote$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_sh_quote_OBJECTS) $(test_sh_quote_LDADD) $(LIBS) + +test-sigaction$(EXEEXT): $(test_sigaction_OBJECTS) $(test_sigaction_DEPENDENCIES) $(EXTRA_test_sigaction_DEPENDENCIES) + @rm -f test-sigaction$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_sigaction_OBJECTS) $(test_sigaction_LDADD) $(LIBS) + +test-signal-h$(EXEEXT): $(test_signal_h_OBJECTS) $(test_signal_h_DEPENDENCIES) $(EXTRA_test_signal_h_DEPENDENCIES) + @rm -f test-signal-h$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_signal_h_OBJECTS) $(test_signal_h_LDADD) $(LIBS) + +test-sigprocmask$(EXEEXT): $(test_sigprocmask_OBJECTS) $(test_sigprocmask_DEPENDENCIES) $(EXTRA_test_sigprocmask_DEPENDENCIES) + @rm -f test-sigprocmask$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_sigprocmask_OBJECTS) $(test_sigprocmask_LDADD) $(LIBS) + +test-sleep$(EXEEXT): $(test_sleep_OBJECTS) $(test_sleep_DEPENDENCIES) $(EXTRA_test_sleep_DEPENDENCIES) + @rm -f test-sleep$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_sleep_OBJECTS) $(test_sleep_LDADD) $(LIBS) + +test-snprintf$(EXEEXT): $(test_snprintf_OBJECTS) $(test_snprintf_DEPENDENCIES) $(EXTRA_test_snprintf_DEPENDENCIES) + @rm -f test-snprintf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_snprintf_OBJECTS) $(test_snprintf_LDADD) $(LIBS) + +test-sockets$(EXEEXT): $(test_sockets_OBJECTS) $(test_sockets_DEPENDENCIES) $(EXTRA_test_sockets_DEPENDENCIES) + @rm -f test-sockets$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_sockets_OBJECTS) $(test_sockets_LDADD) $(LIBS) + +test-stat$(EXEEXT): $(test_stat_OBJECTS) $(test_stat_DEPENDENCIES) $(EXTRA_test_stat_DEPENDENCIES) + @rm -f test-stat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_stat_OBJECTS) $(test_stat_LDADD) $(LIBS) + +test-stat-time$(EXEEXT): $(test_stat_time_OBJECTS) $(test_stat_time_DEPENDENCIES) $(EXTRA_test_stat_time_DEPENDENCIES) + @rm -f test-stat-time$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_stat_time_OBJECTS) $(test_stat_time_LDADD) $(LIBS) + +test-stdalign$(EXEEXT): $(test_stdalign_OBJECTS) $(test_stdalign_DEPENDENCIES) $(EXTRA_test_stdalign_DEPENDENCIES) + @rm -f test-stdalign$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_stdalign_OBJECTS) $(test_stdalign_LDADD) $(LIBS) + +test-stdbool$(EXEEXT): $(test_stdbool_OBJECTS) $(test_stdbool_DEPENDENCIES) $(EXTRA_test_stdbool_DEPENDENCIES) + @rm -f test-stdbool$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_stdbool_OBJECTS) $(test_stdbool_LDADD) $(LIBS) + +test-stddef$(EXEEXT): $(test_stddef_OBJECTS) $(test_stddef_DEPENDENCIES) $(EXTRA_test_stddef_DEPENDENCIES) + @rm -f test-stddef$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_stddef_OBJECTS) $(test_stddef_LDADD) $(LIBS) + +test-stdint$(EXEEXT): $(test_stdint_OBJECTS) $(test_stdint_DEPENDENCIES) $(EXTRA_test_stdint_DEPENDENCIES) + @rm -f test-stdint$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_stdint_OBJECTS) $(test_stdint_LDADD) $(LIBS) + +test-stdio$(EXEEXT): $(test_stdio_OBJECTS) $(test_stdio_DEPENDENCIES) $(EXTRA_test_stdio_DEPENDENCIES) + @rm -f test-stdio$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_stdio_OBJECTS) $(test_stdio_LDADD) $(LIBS) + +test-stdlib$(EXEEXT): $(test_stdlib_OBJECTS) $(test_stdlib_DEPENDENCIES) $(EXTRA_test_stdlib_DEPENDENCIES) + @rm -f test-stdlib$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_stdlib_OBJECTS) $(test_stdlib_LDADD) $(LIBS) + +test-strerror$(EXEEXT): $(test_strerror_OBJECTS) $(test_strerror_DEPENDENCIES) $(EXTRA_test_strerror_DEPENDENCIES) + @rm -f test-strerror$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_strerror_OBJECTS) $(test_strerror_LDADD) $(LIBS) + +test-strerror_r$(EXEEXT): $(test_strerror_r_OBJECTS) $(test_strerror_r_DEPENDENCIES) $(EXTRA_test_strerror_r_DEPENDENCIES) + @rm -f test-strerror_r$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_strerror_r_OBJECTS) $(test_strerror_r_LDADD) $(LIBS) + +test-strftime$(EXEEXT): $(test_strftime_OBJECTS) $(test_strftime_DEPENDENCIES) $(EXTRA_test_strftime_DEPENDENCIES) + @rm -f test-strftime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_strftime_OBJECTS) $(test_strftime_LDADD) $(LIBS) + +test-striconv$(EXEEXT): $(test_striconv_OBJECTS) $(test_striconv_DEPENDENCIES) $(EXTRA_test_striconv_DEPENDENCIES) + @rm -f test-striconv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_striconv_OBJECTS) $(test_striconv_LDADD) $(LIBS) + +test-string$(EXEEXT): $(test_string_OBJECTS) $(test_string_DEPENDENCIES) $(EXTRA_test_string_DEPENDENCIES) + @rm -f test-string$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_string_OBJECTS) $(test_string_LDADD) $(LIBS) + +test-strings$(EXEEXT): $(test_strings_OBJECTS) $(test_strings_DEPENDENCIES) $(EXTRA_test_strings_DEPENDENCIES) + @rm -f test-strings$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_strings_OBJECTS) $(test_strings_LDADD) $(LIBS) + +test-strnlen$(EXEEXT): $(test_strnlen_OBJECTS) $(test_strnlen_DEPENDENCIES) $(EXTRA_test_strnlen_DEPENDENCIES) + @rm -f test-strnlen$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_strnlen_OBJECTS) $(test_strnlen_LDADD) $(LIBS) + +test-strtoull$(EXEEXT): $(test_strtoull_OBJECTS) $(test_strtoull_DEPENDENCIES) $(EXTRA_test_strtoull_DEPENDENCIES) + @rm -f test-strtoull$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_strtoull_OBJECTS) $(test_strtoull_LDADD) $(LIBS) + +test-strtoumax$(EXEEXT): $(test_strtoumax_OBJECTS) $(test_strtoumax_DEPENDENCIES) $(EXTRA_test_strtoumax_DEPENDENCIES) + @rm -f test-strtoumax$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_strtoumax_OBJECTS) $(test_strtoumax_LDADD) $(LIBS) + +test-symlink$(EXEEXT): $(test_symlink_OBJECTS) $(test_symlink_DEPENDENCIES) $(EXTRA_test_symlink_DEPENDENCIES) + @rm -f test-symlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_symlink_OBJECTS) $(test_symlink_LDADD) $(LIBS) + +test-sys_ioctl$(EXEEXT): $(test_sys_ioctl_OBJECTS) $(test_sys_ioctl_DEPENDENCIES) $(EXTRA_test_sys_ioctl_DEPENDENCIES) + @rm -f test-sys_ioctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_sys_ioctl_OBJECTS) $(test_sys_ioctl_LDADD) $(LIBS) + +test-sys_select$(EXEEXT): $(test_sys_select_OBJECTS) $(test_sys_select_DEPENDENCIES) $(EXTRA_test_sys_select_DEPENDENCIES) + @rm -f test-sys_select$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_sys_select_OBJECTS) $(test_sys_select_LDADD) $(LIBS) + +test-sys_socket$(EXEEXT): $(test_sys_socket_OBJECTS) $(test_sys_socket_DEPENDENCIES) $(EXTRA_test_sys_socket_DEPENDENCIES) + @rm -f test-sys_socket$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_sys_socket_OBJECTS) $(test_sys_socket_LDADD) $(LIBS) + +test-sys_stat$(EXEEXT): $(test_sys_stat_OBJECTS) $(test_sys_stat_DEPENDENCIES) $(EXTRA_test_sys_stat_DEPENDENCIES) + @rm -f test-sys_stat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_sys_stat_OBJECTS) $(test_sys_stat_LDADD) $(LIBS) + +test-sys_time$(EXEEXT): $(test_sys_time_OBJECTS) $(test_sys_time_DEPENDENCIES) $(EXTRA_test_sys_time_DEPENDENCIES) + @rm -f test-sys_time$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_sys_time_OBJECTS) $(test_sys_time_LDADD) $(LIBS) + +test-sys_types$(EXEEXT): $(test_sys_types_OBJECTS) $(test_sys_types_DEPENDENCIES) $(EXTRA_test_sys_types_DEPENDENCIES) + @rm -f test-sys_types$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_sys_types_OBJECTS) $(test_sys_types_LDADD) $(LIBS) + +test-sys_uio$(EXEEXT): $(test_sys_uio_OBJECTS) $(test_sys_uio_DEPENDENCIES) $(EXTRA_test_sys_uio_DEPENDENCIES) + @rm -f test-sys_uio$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_sys_uio_OBJECTS) $(test_sys_uio_LDADD) $(LIBS) + +test-sys_wait$(EXEEXT): $(test_sys_wait_OBJECTS) $(test_sys_wait_DEPENDENCIES) $(EXTRA_test_sys_wait_DEPENDENCIES) + @rm -f test-sys_wait$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_sys_wait_OBJECTS) $(test_sys_wait_LDADD) $(LIBS) + +test-time$(EXEEXT): $(test_time_OBJECTS) $(test_time_DEPENDENCIES) $(EXTRA_test_time_DEPENDENCIES) + @rm -f test-time$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_time_OBJECTS) $(test_time_LDADD) $(LIBS) + +test-timespec$(EXEEXT): $(test_timespec_OBJECTS) $(test_timespec_DEPENDENCIES) $(EXTRA_test_timespec_DEPENDENCIES) + @rm -f test-timespec$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_timespec_OBJECTS) $(test_timespec_LDADD) $(LIBS) +unistr/$(am__dirstamp): + @$(MKDIR_P) unistr + @: >>unistr/$(am__dirstamp) +unistr/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) unistr/$(DEPDIR) + @: >>unistr/$(DEPDIR)/$(am__dirstamp) +unistr/test-u8-mbtoucr.$(OBJEXT): unistr/$(am__dirstamp) \ + unistr/$(DEPDIR)/$(am__dirstamp) + +test-u8-mbtoucr$(EXEEXT): $(test_u8_mbtoucr_OBJECTS) $(test_u8_mbtoucr_DEPENDENCIES) $(EXTRA_test_u8_mbtoucr_DEPENDENCIES) + @rm -f test-u8-mbtoucr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_u8_mbtoucr_OBJECTS) $(test_u8_mbtoucr_LDADD) $(LIBS) +unistr/test-u8-uctomb.$(OBJEXT): unistr/$(am__dirstamp) \ + unistr/$(DEPDIR)/$(am__dirstamp) + +test-u8-uctomb$(EXEEXT): $(test_u8_uctomb_OBJECTS) $(test_u8_uctomb_DEPENDENCIES) $(EXTRA_test_u8_uctomb_DEPENDENCIES) + @rm -f test-u8-uctomb$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_u8_uctomb_OBJECTS) $(test_u8_uctomb_LDADD) $(LIBS) +uniwidth/$(am__dirstamp): + @$(MKDIR_P) uniwidth + @: >>uniwidth/$(am__dirstamp) +uniwidth/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) uniwidth/$(DEPDIR) + @: >>uniwidth/$(DEPDIR)/$(am__dirstamp) +uniwidth/test-uc_width.$(OBJEXT): uniwidth/$(am__dirstamp) \ + uniwidth/$(DEPDIR)/$(am__dirstamp) + +test-uc_width$(EXEEXT): $(test_uc_width_OBJECTS) $(test_uc_width_DEPENDENCIES) $(EXTRA_test_uc_width_DEPENDENCIES) + @rm -f test-uc_width$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_uc_width_OBJECTS) $(test_uc_width_LDADD) $(LIBS) +uniwidth/test-uc_width2.$(OBJEXT): uniwidth/$(am__dirstamp) \ + uniwidth/$(DEPDIR)/$(am__dirstamp) + +test-uc_width2$(EXEEXT): $(test_uc_width2_OBJECTS) $(test_uc_width2_DEPENDENCIES) $(EXTRA_test_uc_width2_DEPENDENCIES) + @rm -f test-uc_width2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_uc_width2_OBJECTS) $(test_uc_width2_LDADD) $(LIBS) + +test-unistd$(EXEEXT): $(test_unistd_OBJECTS) $(test_unistd_DEPENDENCIES) $(EXTRA_test_unistd_DEPENDENCIES) + @rm -f test-unistd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_unistd_OBJECTS) $(test_unistd_LDADD) $(LIBS) + +test-unsetenv$(EXEEXT): $(test_unsetenv_OBJECTS) $(test_unsetenv_DEPENDENCIES) $(EXTRA_test_unsetenv_DEPENDENCIES) + @rm -f test-unsetenv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_unsetenv_OBJECTS) $(test_unsetenv_LDADD) $(LIBS) + +test-vasnprintf$(EXEEXT): $(test_vasnprintf_OBJECTS) $(test_vasnprintf_DEPENDENCIES) $(EXTRA_test_vasnprintf_DEPENDENCIES) + @rm -f test-vasnprintf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_vasnprintf_OBJECTS) $(test_vasnprintf_LDADD) $(LIBS) + +test-vasprintf$(EXEEXT): $(test_vasprintf_OBJECTS) $(test_vasprintf_DEPENDENCIES) $(EXTRA_test_vasprintf_DEPENDENCIES) + @rm -f test-vasprintf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_vasprintf_OBJECTS) $(test_vasprintf_LDADD) $(LIBS) + +test-verify$(EXEEXT): $(test_verify_OBJECTS) $(test_verify_DEPENDENCIES) $(EXTRA_test_verify_DEPENDENCIES) + @rm -f test-verify$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_verify_OBJECTS) $(test_verify_LDADD) $(LIBS) + +test-verify-try$(EXEEXT): $(test_verify_try_OBJECTS) $(test_verify_try_DEPENDENCIES) $(EXTRA_test_verify_try_DEPENDENCIES) + @rm -f test-verify-try$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_verify_try_OBJECTS) $(test_verify_try_LDADD) $(LIBS) + +test-version-etc$(EXEEXT): $(test_version_etc_OBJECTS) $(test_version_etc_DEPENDENCIES) $(EXTRA_test_version_etc_DEPENDENCIES) + @rm -f test-version-etc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_version_etc_OBJECTS) $(test_version_etc_LDADD) $(LIBS) + +test-wchar$(EXEEXT): $(test_wchar_OBJECTS) $(test_wchar_DEPENDENCIES) $(EXTRA_test_wchar_DEPENDENCIES) + @rm -f test-wchar$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_wchar_OBJECTS) $(test_wchar_LDADD) $(LIBS) + +test-wcrtomb$(EXEEXT): $(test_wcrtomb_OBJECTS) $(test_wcrtomb_DEPENDENCIES) $(EXTRA_test_wcrtomb_DEPENDENCIES) + @rm -f test-wcrtomb$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_wcrtomb_OBJECTS) $(test_wcrtomb_LDADD) $(LIBS) + +test-wcrtomb-w32$(EXEEXT): $(test_wcrtomb_w32_OBJECTS) $(test_wcrtomb_w32_DEPENDENCIES) $(EXTRA_test_wcrtomb_w32_DEPENDENCIES) + @rm -f test-wcrtomb-w32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_wcrtomb_w32_OBJECTS) $(test_wcrtomb_w32_LDADD) $(LIBS) + +test-wctype-h$(EXEEXT): $(test_wctype_h_OBJECTS) $(test_wctype_h_DEPENDENCIES) $(EXTRA_test_wctype_h_DEPENDENCIES) + @rm -f test-wctype-h$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_wctype_h_OBJECTS) $(test_wctype_h_LDADD) $(LIBS) + +test-wcwidth$(EXEEXT): $(test_wcwidth_OBJECTS) $(test_wcwidth_DEPENDENCIES) $(EXTRA_test_wcwidth_DEPENDENCIES) + @rm -f test-wcwidth$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_wcwidth_OBJECTS) $(test_wcwidth_LDADD) $(LIBS) + +test-xalloc-die$(EXEEXT): $(test_xalloc_die_OBJECTS) $(test_xalloc_die_DEPENDENCIES) $(EXTRA_test_xalloc_die_DEPENDENCIES) + @rm -f test-xalloc-die$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_xalloc_die_OBJECTS) $(test_xalloc_die_LDADD) $(LIBS) + +test-xstrtol$(EXEEXT): $(test_xstrtol_OBJECTS) $(test_xstrtol_DEPENDENCIES) $(EXTRA_test_xstrtol_DEPENDENCIES) + @rm -f test-xstrtol$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_xstrtol_OBJECTS) $(test_xstrtol_LDADD) $(LIBS) + +test-xstrtoul$(EXEEXT): $(test_xstrtoul_OBJECTS) $(test_xstrtoul_DEPENDENCIES) $(EXTRA_test_xstrtoul_DEPENDENCIES) + @rm -f test-xstrtoul$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_xstrtoul_OBJECTS) $(test_xstrtoul_LDADD) $(LIBS) + +test-xstrtoumax$(EXEEXT): $(test_xstrtoumax_OBJECTS) $(test_xstrtoumax_DEPENDENCIES) $(EXTRA_test_xstrtoumax_DEPENDENCIES) + @rm -f test-xstrtoumax$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_xstrtoumax_OBJECTS) $(test_xstrtoumax_LDADD) $(LIBS) + +test-xvasprintf$(EXEEXT): $(test_xvasprintf_OBJECTS) $(test_xvasprintf_DEPENDENCIES) $(EXTRA_test_xvasprintf_DEPENDENCIES) + @rm -f test-xvasprintf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_xvasprintf_OBJECTS) $(test_xvasprintf_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f unistr/*.$(OBJEXT) + -rm -f uniwidth/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bind.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connect.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtotimespec.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdopen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd-lgpl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpagesize.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash-pjw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_pton.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nanosleep.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perror.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/putenv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setlocale.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setsockopt.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleep.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockets.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror_r.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sys_socket.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-accept.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-alloca-opt.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-areadlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-argmatch.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-arpa_inet.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-binary-io.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-bind.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-bitrotate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-btowc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-c-ctype.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-c-stack.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-c-strcasecmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-c-strncasecmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-close.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-connect.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ctype.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dirname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dup2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-environ.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-errno.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-exclude.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fcntl-h.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fcntl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fdopen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fgetc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-filenamecat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-float.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fnmatch.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fputc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fread.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-freopen-safer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-freopen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ftruncate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fwrite.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getcwd-lgpl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getdtablesize.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getopt-gnu.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getopt-posix.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getprogname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-gettimeofday.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-hash.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iconv-h.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iconv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ignore-value.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-inet_pton.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-intprops.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-inttostr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-inttypes.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ioctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-isblank.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iswblank.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-langinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-limits-h.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-listen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-locale.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-localeconv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-lstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-malloca.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbrtowc-w32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbrtowc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbscasecmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbsinit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbsrtowcs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbsstr1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbsstr2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbsstr3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-memchr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-nanosleep.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-netinet_in.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-nl_langinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-open.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pathmax.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-perror.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-perror2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pipe.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-quotearg-simple.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-raise.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-rawmemchr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-readlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-regex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-select-fd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-select-stdin.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-select.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setenv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setlocale1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setlocale2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setsockopt.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sh-quote.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sigaction.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-signal-h.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sigprocmask.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sleep.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-snprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sockets.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stat-time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdalign.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdbool.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stddef.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdint.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdlib.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strerror.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strerror_r.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strftime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-striconv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-string.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strings.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strnlen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strtoull.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strtoumax.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-symlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_ioctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_select.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_socket.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_stat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_types.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_uio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_wait.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-timespec.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unistd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unsetenv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-vasnprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-vasprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-verify-try.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-verify.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-version-etc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wchar.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wcrtomb-w32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wcrtomb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wctype-h.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wcwidth.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-xalloc-die.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-xstrtol.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-xstrtoul.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-xstrtoumax.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-xvasprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timespec-add.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timespec-sub.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wctob.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wctomb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unistr/$(DEPDIR)/test-u8-mbtoucr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unistr/$(DEPDIR)/test-u8-uctomb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@uniwidth/$(DEPDIR)/test-uc_width.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@uniwidth/$(DEPDIR)/test-uc_width2.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @: >>$@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + output_system_information () \ + { \ + echo; \ + { uname -a | $(AWK) '{ \ + printf "System information (uname -a):"; \ + for (i = 1; i < NF; ++i) \ + { \ + if (i != 2) \ + printf " %s", $$i; \ + } \ + printf "\n"; \ +}'; } 2>&1; \ + if test -r /etc/os-release; then \ + echo "Distribution information (/etc/os-release):"; \ + sed 8q /etc/os-release; \ + elif test -r /etc/issue; then \ + echo "Distribution information (/etc/issue):"; \ + cat /etc/issue; \ + fi; \ + }; \ + please_report () \ + { \ +echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \ +echo "together with the test-suite.log file (gzipped) and your system"; \ +echo "information. Thanks."; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + output_system_information; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: $(check_PROGRAMS) $(check_LIBRARIES) + @$(am__rm_f) $(RECHECK_LOGS) + @$(am__rm_f) $(RECHECK_LOGS:.log=.trs) + @$(am__rm_f) $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_PROGRAMS) $(check_LIBRARIES) + @$(am__rm_f) $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +test-accept.log: test-accept$(EXEEXT) + @p='test-accept$(EXEEXT)'; \ + b='test-accept'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-alloca-opt.log: test-alloca-opt$(EXEEXT) + @p='test-alloca-opt$(EXEEXT)'; \ + b='test-alloca-opt'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-areadlink.log: test-areadlink$(EXEEXT) + @p='test-areadlink$(EXEEXT)'; \ + b='test-areadlink'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-argmatch.log: test-argmatch$(EXEEXT) + @p='test-argmatch$(EXEEXT)'; \ + b='test-argmatch'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-arpa_inet.log: test-arpa_inet$(EXEEXT) + @p='test-arpa_inet$(EXEEXT)'; \ + b='test-arpa_inet'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-binary-io.sh.log: test-binary-io.sh + @p='test-binary-io.sh'; \ + b='test-binary-io.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-bind.log: test-bind$(EXEEXT) + @p='test-bind$(EXEEXT)'; \ + b='test-bind'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-bitrotate.log: test-bitrotate$(EXEEXT) + @p='test-bitrotate$(EXEEXT)'; \ + b='test-bitrotate'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-btowc1.sh.log: test-btowc1.sh + @p='test-btowc1.sh'; \ + b='test-btowc1.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-btowc2.sh.log: test-btowc2.sh + @p='test-btowc2.sh'; \ + b='test-btowc2.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-c-ctype.log: test-c-ctype$(EXEEXT) + @p='test-c-ctype$(EXEEXT)'; \ + b='test-c-ctype'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-c-stack.sh.log: test-c-stack.sh + @p='test-c-stack.sh'; \ + b='test-c-stack.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-c-stack2.sh.log: test-c-stack2.sh + @p='test-c-stack2.sh'; \ + b='test-c-stack2.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-c-strcase.sh.log: test-c-strcase.sh + @p='test-c-strcase.sh'; \ + b='test-c-strcase.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-close.log: test-close$(EXEEXT) + @p='test-close$(EXEEXT)'; \ + b='test-close'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-connect.log: test-connect$(EXEEXT) + @p='test-connect$(EXEEXT)'; \ + b='test-connect'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-ctype.log: test-ctype$(EXEEXT) + @p='test-ctype$(EXEEXT)'; \ + b='test-ctype'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-dirname.log: test-dirname$(EXEEXT) + @p='test-dirname$(EXEEXT)'; \ + b='test-dirname'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-dup2.log: test-dup2$(EXEEXT) + @p='test-dup2$(EXEEXT)'; \ + b='test-dup2'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-environ.log: test-environ$(EXEEXT) + @p='test-environ$(EXEEXT)'; \ + b='test-environ'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-errno.log: test-errno$(EXEEXT) + @p='test-errno$(EXEEXT)'; \ + b='test-errno'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-exclude1.sh.log: test-exclude1.sh + @p='test-exclude1.sh'; \ + b='test-exclude1.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-exclude2.sh.log: test-exclude2.sh + @p='test-exclude2.sh'; \ + b='test-exclude2.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-exclude3.sh.log: test-exclude3.sh + @p='test-exclude3.sh'; \ + b='test-exclude3.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-exclude4.sh.log: test-exclude4.sh + @p='test-exclude4.sh'; \ + b='test-exclude4.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-exclude5.sh.log: test-exclude5.sh + @p='test-exclude5.sh'; \ + b='test-exclude5.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-exclude6.sh.log: test-exclude6.sh + @p='test-exclude6.sh'; \ + b='test-exclude6.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-exclude7.sh.log: test-exclude7.sh + @p='test-exclude7.sh'; \ + b='test-exclude7.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-exclude8.sh.log: test-exclude8.sh + @p='test-exclude8.sh'; \ + b='test-exclude8.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-fcntl-h.log: test-fcntl-h$(EXEEXT) + @p='test-fcntl-h$(EXEEXT)'; \ + b='test-fcntl-h'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-fcntl.log: test-fcntl$(EXEEXT) + @p='test-fcntl$(EXEEXT)'; \ + b='test-fcntl'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-fdopen.log: test-fdopen$(EXEEXT) + @p='test-fdopen$(EXEEXT)'; \ + b='test-fdopen'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-fgetc.log: test-fgetc$(EXEEXT) + @p='test-fgetc$(EXEEXT)'; \ + b='test-fgetc'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-filenamecat.log: test-filenamecat$(EXEEXT) + @p='test-filenamecat$(EXEEXT)'; \ + b='test-filenamecat'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-float.log: test-float$(EXEEXT) + @p='test-float$(EXEEXT)'; \ + b='test-float'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-fnmatch.log: test-fnmatch$(EXEEXT) + @p='test-fnmatch$(EXEEXT)'; \ + b='test-fnmatch'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-fputc.log: test-fputc$(EXEEXT) + @p='test-fputc$(EXEEXT)'; \ + b='test-fputc'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-fread.log: test-fread$(EXEEXT) + @p='test-fread$(EXEEXT)'; \ + b='test-fread'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-freopen-safer.log: test-freopen-safer$(EXEEXT) + @p='test-freopen-safer$(EXEEXT)'; \ + b='test-freopen-safer'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-freopen.log: test-freopen$(EXEEXT) + @p='test-freopen$(EXEEXT)'; \ + b='test-freopen'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-fstat.log: test-fstat$(EXEEXT) + @p='test-fstat$(EXEEXT)'; \ + b='test-fstat'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-ftruncate.sh.log: test-ftruncate.sh + @p='test-ftruncate.sh'; \ + b='test-ftruncate.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-fwrite.log: test-fwrite$(EXEEXT) + @p='test-fwrite$(EXEEXT)'; \ + b='test-fwrite'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-getcwd-lgpl.log: test-getcwd-lgpl$(EXEEXT) + @p='test-getcwd-lgpl$(EXEEXT)'; \ + b='test-getcwd-lgpl'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-getdtablesize.log: test-getdtablesize$(EXEEXT) + @p='test-getdtablesize$(EXEEXT)'; \ + b='test-getdtablesize'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-getopt-gnu.log: test-getopt-gnu$(EXEEXT) + @p='test-getopt-gnu$(EXEEXT)'; \ + b='test-getopt-gnu'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-getopt-posix.log: test-getopt-posix$(EXEEXT) + @p='test-getopt-posix$(EXEEXT)'; \ + b='test-getopt-posix'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-getprogname.log: test-getprogname$(EXEEXT) + @p='test-getprogname$(EXEEXT)'; \ + b='test-getprogname'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-gettimeofday.log: test-gettimeofday$(EXEEXT) + @p='test-gettimeofday$(EXEEXT)'; \ + b='test-gettimeofday'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-hash.log: test-hash$(EXEEXT) + @p='test-hash$(EXEEXT)'; \ + b='test-hash'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-iconv-h.log: test-iconv-h$(EXEEXT) + @p='test-iconv-h$(EXEEXT)'; \ + b='test-iconv-h'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-iconv.log: test-iconv$(EXEEXT) + @p='test-iconv$(EXEEXT)'; \ + b='test-iconv'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-ignore-value.log: test-ignore-value$(EXEEXT) + @p='test-ignore-value$(EXEEXT)'; \ + b='test-ignore-value'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-inet_pton.log: test-inet_pton$(EXEEXT) + @p='test-inet_pton$(EXEEXT)'; \ + b='test-inet_pton'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-intprops.log: test-intprops$(EXEEXT) + @p='test-intprops$(EXEEXT)'; \ + b='test-intprops'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-inttostr.log: test-inttostr$(EXEEXT) + @p='test-inttostr$(EXEEXT)'; \ + b='test-inttostr'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-inttypes.log: test-inttypes$(EXEEXT) + @p='test-inttypes$(EXEEXT)'; \ + b='test-inttypes'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-ioctl.log: test-ioctl$(EXEEXT) + @p='test-ioctl$(EXEEXT)'; \ + b='test-ioctl'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-isblank.log: test-isblank$(EXEEXT) + @p='test-isblank$(EXEEXT)'; \ + b='test-isblank'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-iswblank.log: test-iswblank$(EXEEXT) + @p='test-iswblank$(EXEEXT)'; \ + b='test-iswblank'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-langinfo.log: test-langinfo$(EXEEXT) + @p='test-langinfo$(EXEEXT)'; \ + b='test-langinfo'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-limits-h.log: test-limits-h$(EXEEXT) + @p='test-limits-h$(EXEEXT)'; \ + b='test-limits-h'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-listen.log: test-listen$(EXEEXT) + @p='test-listen$(EXEEXT)'; \ + b='test-listen'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-locale.log: test-locale$(EXEEXT) + @p='test-locale$(EXEEXT)'; \ + b='test-locale'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-localeconv.log: test-localeconv$(EXEEXT) + @p='test-localeconv$(EXEEXT)'; \ + b='test-localeconv'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-lstat.log: test-lstat$(EXEEXT) + @p='test-lstat$(EXEEXT)'; \ + b='test-lstat'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-malloca.log: test-malloca$(EXEEXT) + @p='test-malloca$(EXEEXT)'; \ + b='test-malloca'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbrtowc1.sh.log: test-mbrtowc1.sh + @p='test-mbrtowc1.sh'; \ + b='test-mbrtowc1.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbrtowc2.sh.log: test-mbrtowc2.sh + @p='test-mbrtowc2.sh'; \ + b='test-mbrtowc2.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbrtowc3.sh.log: test-mbrtowc3.sh + @p='test-mbrtowc3.sh'; \ + b='test-mbrtowc3.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbrtowc4.sh.log: test-mbrtowc4.sh + @p='test-mbrtowc4.sh'; \ + b='test-mbrtowc4.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbrtowc5.sh.log: test-mbrtowc5.sh + @p='test-mbrtowc5.sh'; \ + b='test-mbrtowc5.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbrtowc-w32-1.sh.log: test-mbrtowc-w32-1.sh + @p='test-mbrtowc-w32-1.sh'; \ + b='test-mbrtowc-w32-1.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbrtowc-w32-2.sh.log: test-mbrtowc-w32-2.sh + @p='test-mbrtowc-w32-2.sh'; \ + b='test-mbrtowc-w32-2.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbrtowc-w32-3.sh.log: test-mbrtowc-w32-3.sh + @p='test-mbrtowc-w32-3.sh'; \ + b='test-mbrtowc-w32-3.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbrtowc-w32-4.sh.log: test-mbrtowc-w32-4.sh + @p='test-mbrtowc-w32-4.sh'; \ + b='test-mbrtowc-w32-4.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbrtowc-w32-5.sh.log: test-mbrtowc-w32-5.sh + @p='test-mbrtowc-w32-5.sh'; \ + b='test-mbrtowc-w32-5.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbscasecmp.sh.log: test-mbscasecmp.sh + @p='test-mbscasecmp.sh'; \ + b='test-mbscasecmp.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbsinit.sh.log: test-mbsinit.sh + @p='test-mbsinit.sh'; \ + b='test-mbsinit.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbsrtowcs1.sh.log: test-mbsrtowcs1.sh + @p='test-mbsrtowcs1.sh'; \ + b='test-mbsrtowcs1.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbsrtowcs2.sh.log: test-mbsrtowcs2.sh + @p='test-mbsrtowcs2.sh'; \ + b='test-mbsrtowcs2.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbsrtowcs3.sh.log: test-mbsrtowcs3.sh + @p='test-mbsrtowcs3.sh'; \ + b='test-mbsrtowcs3.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbsrtowcs4.sh.log: test-mbsrtowcs4.sh + @p='test-mbsrtowcs4.sh'; \ + b='test-mbsrtowcs4.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbsstr1.log: test-mbsstr1$(EXEEXT) + @p='test-mbsstr1$(EXEEXT)'; \ + b='test-mbsstr1'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbsstr2.sh.log: test-mbsstr2.sh + @p='test-mbsstr2.sh'; \ + b='test-mbsstr2.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbsstr3.sh.log: test-mbsstr3.sh + @p='test-mbsstr3.sh'; \ + b='test-mbsstr3.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-memchr.log: test-memchr$(EXEEXT) + @p='test-memchr$(EXEEXT)'; \ + b='test-memchr'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-nanosleep.log: test-nanosleep$(EXEEXT) + @p='test-nanosleep$(EXEEXT)'; \ + b='test-nanosleep'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-netinet_in.log: test-netinet_in$(EXEEXT) + @p='test-netinet_in$(EXEEXT)'; \ + b='test-netinet_in'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-nl_langinfo.sh.log: test-nl_langinfo.sh + @p='test-nl_langinfo.sh'; \ + b='test-nl_langinfo.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-open.log: test-open$(EXEEXT) + @p='test-open$(EXEEXT)'; \ + b='test-open'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-pathmax.log: test-pathmax$(EXEEXT) + @p='test-pathmax$(EXEEXT)'; \ + b='test-pathmax'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-perror.sh.log: test-perror.sh + @p='test-perror.sh'; \ + b='test-perror.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-perror2.log: test-perror2$(EXEEXT) + @p='test-perror2$(EXEEXT)'; \ + b='test-perror2'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-pipe.log: test-pipe$(EXEEXT) + @p='test-pipe$(EXEEXT)'; \ + b='test-pipe'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-quotearg-simple.log: test-quotearg-simple$(EXEEXT) + @p='test-quotearg-simple$(EXEEXT)'; \ + b='test-quotearg-simple'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-raise.log: test-raise$(EXEEXT) + @p='test-raise$(EXEEXT)'; \ + b='test-raise'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-rawmemchr.log: test-rawmemchr$(EXEEXT) + @p='test-rawmemchr$(EXEEXT)'; \ + b='test-rawmemchr'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-readlink.log: test-readlink$(EXEEXT) + @p='test-readlink$(EXEEXT)'; \ + b='test-readlink'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-regex.log: test-regex$(EXEEXT) + @p='test-regex$(EXEEXT)'; \ + b='test-regex'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-select.log: test-select$(EXEEXT) + @p='test-select$(EXEEXT)'; \ + b='test-select'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-select-in.sh.log: test-select-in.sh + @p='test-select-in.sh'; \ + b='test-select-in.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-select-out.sh.log: test-select-out.sh + @p='test-select-out.sh'; \ + b='test-select-out.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-setenv.log: test-setenv$(EXEEXT) + @p='test-setenv$(EXEEXT)'; \ + b='test-setenv'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-setlocale1.sh.log: test-setlocale1.sh + @p='test-setlocale1.sh'; \ + b='test-setlocale1.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-setlocale2.sh.log: test-setlocale2.sh + @p='test-setlocale2.sh'; \ + b='test-setlocale2.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-setsockopt.log: test-setsockopt$(EXEEXT) + @p='test-setsockopt$(EXEEXT)'; \ + b='test-setsockopt'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-sh-quote.log: test-sh-quote$(EXEEXT) + @p='test-sh-quote$(EXEEXT)'; \ + b='test-sh-quote'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-sigaction.log: test-sigaction$(EXEEXT) + @p='test-sigaction$(EXEEXT)'; \ + b='test-sigaction'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-signal-h.log: test-signal-h$(EXEEXT) + @p='test-signal-h$(EXEEXT)'; \ + b='test-signal-h'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-sigprocmask.log: test-sigprocmask$(EXEEXT) + @p='test-sigprocmask$(EXEEXT)'; \ + b='test-sigprocmask'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-sleep.log: test-sleep$(EXEEXT) + @p='test-sleep$(EXEEXT)'; \ + b='test-sleep'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-snprintf.log: test-snprintf$(EXEEXT) + @p='test-snprintf$(EXEEXT)'; \ + b='test-snprintf'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-sockets.log: test-sockets$(EXEEXT) + @p='test-sockets$(EXEEXT)'; \ + b='test-sockets'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-stat.log: test-stat$(EXEEXT) + @p='test-stat$(EXEEXT)'; \ + b='test-stat'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-stat-time.log: test-stat-time$(EXEEXT) + @p='test-stat-time$(EXEEXT)'; \ + b='test-stat-time'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-stdalign.log: test-stdalign$(EXEEXT) + @p='test-stdalign$(EXEEXT)'; \ + b='test-stdalign'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-stdbool.log: test-stdbool$(EXEEXT) + @p='test-stdbool$(EXEEXT)'; \ + b='test-stdbool'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-stddef.log: test-stddef$(EXEEXT) + @p='test-stddef$(EXEEXT)'; \ + b='test-stddef'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-stdint.log: test-stdint$(EXEEXT) + @p='test-stdint$(EXEEXT)'; \ + b='test-stdint'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-stdio.log: test-stdio$(EXEEXT) + @p='test-stdio$(EXEEXT)'; \ + b='test-stdio'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-stdlib.log: test-stdlib$(EXEEXT) + @p='test-stdlib$(EXEEXT)'; \ + b='test-stdlib'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-strerror.log: test-strerror$(EXEEXT) + @p='test-strerror$(EXEEXT)'; \ + b='test-strerror'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-strerror_r.log: test-strerror_r$(EXEEXT) + @p='test-strerror_r$(EXEEXT)'; \ + b='test-strerror_r'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-strftime.log: test-strftime$(EXEEXT) + @p='test-strftime$(EXEEXT)'; \ + b='test-strftime'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-striconv.log: test-striconv$(EXEEXT) + @p='test-striconv$(EXEEXT)'; \ + b='test-striconv'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-string.log: test-string$(EXEEXT) + @p='test-string$(EXEEXT)'; \ + b='test-string'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-strings.log: test-strings$(EXEEXT) + @p='test-strings$(EXEEXT)'; \ + b='test-strings'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-strnlen.log: test-strnlen$(EXEEXT) + @p='test-strnlen$(EXEEXT)'; \ + b='test-strnlen'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-strtoull.log: test-strtoull$(EXEEXT) + @p='test-strtoull$(EXEEXT)'; \ + b='test-strtoull'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-strtoumax.log: test-strtoumax$(EXEEXT) + @p='test-strtoumax$(EXEEXT)'; \ + b='test-strtoumax'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-symlink.log: test-symlink$(EXEEXT) + @p='test-symlink$(EXEEXT)'; \ + b='test-symlink'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-sys_ioctl.log: test-sys_ioctl$(EXEEXT) + @p='test-sys_ioctl$(EXEEXT)'; \ + b='test-sys_ioctl'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-sys_select.log: test-sys_select$(EXEEXT) + @p='test-sys_select$(EXEEXT)'; \ + b='test-sys_select'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-sys_socket.log: test-sys_socket$(EXEEXT) + @p='test-sys_socket$(EXEEXT)'; \ + b='test-sys_socket'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-sys_stat.log: test-sys_stat$(EXEEXT) + @p='test-sys_stat$(EXEEXT)'; \ + b='test-sys_stat'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-sys_time.log: test-sys_time$(EXEEXT) + @p='test-sys_time$(EXEEXT)'; \ + b='test-sys_time'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-sys_types.log: test-sys_types$(EXEEXT) + @p='test-sys_types$(EXEEXT)'; \ + b='test-sys_types'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-sys_uio.log: test-sys_uio$(EXEEXT) + @p='test-sys_uio$(EXEEXT)'; \ + b='test-sys_uio'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-sys_wait.log: test-sys_wait$(EXEEXT) + @p='test-sys_wait$(EXEEXT)'; \ + b='test-sys_wait'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-init.sh.log: test-init.sh + @p='test-init.sh'; \ + b='test-init.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-time.log: test-time$(EXEEXT) + @p='test-time$(EXEEXT)'; \ + b='test-time'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-timespec.log: test-timespec$(EXEEXT) + @p='test-timespec$(EXEEXT)'; \ + b='test-timespec'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-unistd.log: test-unistd$(EXEEXT) + @p='test-unistd$(EXEEXT)'; \ + b='test-unistd'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-u8-mbtoucr.log: test-u8-mbtoucr$(EXEEXT) + @p='test-u8-mbtoucr$(EXEEXT)'; \ + b='test-u8-mbtoucr'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-u8-uctomb.log: test-u8-uctomb$(EXEEXT) + @p='test-u8-uctomb$(EXEEXT)'; \ + b='test-u8-uctomb'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-uc_width.log: test-uc_width$(EXEEXT) + @p='test-uc_width$(EXEEXT)'; \ + b='test-uc_width'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +uniwidth/test-uc_width2.sh.log: uniwidth/test-uc_width2.sh + @p='uniwidth/test-uc_width2.sh'; \ + b='uniwidth/test-uc_width2.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-unsetenv.log: test-unsetenv$(EXEEXT) + @p='test-unsetenv$(EXEEXT)'; \ + b='test-unsetenv'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-update-copyright.sh.log: test-update-copyright.sh + @p='test-update-copyright.sh'; \ + b='test-update-copyright.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-vasnprintf.log: test-vasnprintf$(EXEEXT) + @p='test-vasnprintf$(EXEEXT)'; \ + b='test-vasnprintf'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-vasprintf.log: test-vasprintf$(EXEEXT) + @p='test-vasprintf$(EXEEXT)'; \ + b='test-vasprintf'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-vc-list-files-git.sh.log: test-vc-list-files-git.sh + @p='test-vc-list-files-git.sh'; \ + b='test-vc-list-files-git.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-vc-list-files-cvs.sh.log: test-vc-list-files-cvs.sh + @p='test-vc-list-files-cvs.sh'; \ + b='test-vc-list-files-cvs.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-verify.log: test-verify$(EXEEXT) + @p='test-verify$(EXEEXT)'; \ + b='test-verify'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-verify.sh.log: test-verify.sh + @p='test-verify.sh'; \ + b='test-verify.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-version-etc.sh.log: test-version-etc.sh + @p='test-version-etc.sh'; \ + b='test-version-etc.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-wchar.log: test-wchar$(EXEEXT) + @p='test-wchar$(EXEEXT)'; \ + b='test-wchar'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-wcrtomb.sh.log: test-wcrtomb.sh + @p='test-wcrtomb.sh'; \ + b='test-wcrtomb.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-wcrtomb-w32-1.sh.log: test-wcrtomb-w32-1.sh + @p='test-wcrtomb-w32-1.sh'; \ + b='test-wcrtomb-w32-1.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-wcrtomb-w32-2.sh.log: test-wcrtomb-w32-2.sh + @p='test-wcrtomb-w32-2.sh'; \ + b='test-wcrtomb-w32-2.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-wcrtomb-w32-3.sh.log: test-wcrtomb-w32-3.sh + @p='test-wcrtomb-w32-3.sh'; \ + b='test-wcrtomb-w32-3.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-wcrtomb-w32-4.sh.log: test-wcrtomb-w32-4.sh + @p='test-wcrtomb-w32-4.sh'; \ + b='test-wcrtomb-w32-4.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-wcrtomb-w32-5.sh.log: test-wcrtomb-w32-5.sh + @p='test-wcrtomb-w32-5.sh'; \ + b='test-wcrtomb-w32-5.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-wctype-h.log: test-wctype-h$(EXEEXT) + @p='test-wctype-h$(EXEEXT)'; \ + b='test-wctype-h'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-wcwidth.log: test-wcwidth$(EXEEXT) + @p='test-wcwidth$(EXEEXT)'; \ + b='test-wcwidth'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-xalloc-die.sh.log: test-xalloc-die.sh + @p='test-xalloc-die.sh'; \ + b='test-xalloc-die.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-xstrtol.sh.log: test-xstrtol.sh + @p='test-xstrtol.sh'; \ + b='test-xstrtol.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-xstrtoumax.sh.log: test-xstrtoumax.sh + @p='test-xstrtoumax.sh'; \ + b='test-xstrtoumax.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-xvasprintf.log: test-xvasprintf$(EXEEXT) + @p='test-xvasprintf$(EXEEXT)'; \ + b='test-xvasprintf'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_LIBRARIES) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive +all-am: Makefile $(PROGRAMS) $(LIBRARIES) $(HEADERS) +installdirs: installdirs-recursive +installdirs-am: +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-recursive +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -$(am__rm_f) $(MOSTLYCLEANFILES) + -$(am__rm_f) $(TEST_LOGS) + -$(am__rm_f) $(TEST_LOGS:.log=.trs) + -$(am__rm_f) $(TEST_SUITE_LOG) + +clean-generic: + -$(am__rm_f) $(CLEANFILES) + +distclean-generic: + -$(am__rm_f) $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) + -$(am__rm_f) $(DISTCLEANFILES) + -$(am__rm_f) unistr/$(DEPDIR)/$(am__dirstamp) + -$(am__rm_f) unistr/$(am__dirstamp) + -$(am__rm_f) uniwidth/$(DEPDIR)/$(am__dirstamp) + -$(am__rm_f) uniwidth/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -$(am__rm_f) $(BUILT_SOURCES) + -$(am__rm_f) $(MAINTAINERCLEANFILES) +clean: clean-recursive + +clean-am: clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ + clean-local clean-noinstLIBRARIES clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-recursive + -rm -f ./$(DEPDIR)/accept.Po + -rm -f ./$(DEPDIR)/bind.Po + -rm -f ./$(DEPDIR)/connect.Po + -rm -f ./$(DEPDIR)/dtotimespec.Po + -rm -f ./$(DEPDIR)/fdopen.Po + -rm -f ./$(DEPDIR)/ftruncate.Po + -rm -f ./$(DEPDIR)/getcwd-lgpl.Po + -rm -f ./$(DEPDIR)/getpagesize.Po + -rm -f ./$(DEPDIR)/hash-pjw.Po + -rm -f ./$(DEPDIR)/inet_pton.Po + -rm -f ./$(DEPDIR)/ioctl.Po + -rm -f ./$(DEPDIR)/listen.Po + -rm -f ./$(DEPDIR)/nanosleep.Po + -rm -f ./$(DEPDIR)/perror.Po + -rm -f ./$(DEPDIR)/pipe.Po + -rm -f ./$(DEPDIR)/putenv.Po + -rm -f ./$(DEPDIR)/select.Po + -rm -f ./$(DEPDIR)/setlocale.Po + -rm -f ./$(DEPDIR)/setsockopt.Po + -rm -f ./$(DEPDIR)/sleep.Po + -rm -f ./$(DEPDIR)/snprintf.Po + -rm -f ./$(DEPDIR)/socket.Po + -rm -f ./$(DEPDIR)/sockets.Po + -rm -f ./$(DEPDIR)/strerror_r.Po + -rm -f ./$(DEPDIR)/symlink.Po + -rm -f ./$(DEPDIR)/sys_socket.Po + -rm -f ./$(DEPDIR)/test-accept.Po + -rm -f ./$(DEPDIR)/test-alloca-opt.Po + -rm -f ./$(DEPDIR)/test-areadlink.Po + -rm -f ./$(DEPDIR)/test-argmatch.Po + -rm -f ./$(DEPDIR)/test-arpa_inet.Po + -rm -f ./$(DEPDIR)/test-binary-io.Po + -rm -f ./$(DEPDIR)/test-bind.Po + -rm -f ./$(DEPDIR)/test-bitrotate.Po + -rm -f ./$(DEPDIR)/test-btowc.Po + -rm -f ./$(DEPDIR)/test-c-ctype.Po + -rm -f ./$(DEPDIR)/test-c-stack.Po + -rm -f ./$(DEPDIR)/test-c-strcasecmp.Po + -rm -f ./$(DEPDIR)/test-c-strncasecmp.Po + -rm -f ./$(DEPDIR)/test-close.Po + -rm -f ./$(DEPDIR)/test-connect.Po + -rm -f ./$(DEPDIR)/test-ctype.Po + -rm -f ./$(DEPDIR)/test-dirname.Po + -rm -f ./$(DEPDIR)/test-dup2.Po + -rm -f ./$(DEPDIR)/test-environ.Po + -rm -f ./$(DEPDIR)/test-errno.Po + -rm -f ./$(DEPDIR)/test-exclude.Po + -rm -f ./$(DEPDIR)/test-fcntl-h.Po + -rm -f ./$(DEPDIR)/test-fcntl.Po + -rm -f ./$(DEPDIR)/test-fdopen.Po + -rm -f ./$(DEPDIR)/test-fgetc.Po + -rm -f ./$(DEPDIR)/test-filenamecat.Po + -rm -f ./$(DEPDIR)/test-float.Po + -rm -f ./$(DEPDIR)/test-fnmatch.Po + -rm -f ./$(DEPDIR)/test-fputc.Po + -rm -f ./$(DEPDIR)/test-fread.Po + -rm -f ./$(DEPDIR)/test-freopen-safer.Po + -rm -f ./$(DEPDIR)/test-freopen.Po + -rm -f ./$(DEPDIR)/test-fstat.Po + -rm -f ./$(DEPDIR)/test-ftruncate.Po + -rm -f ./$(DEPDIR)/test-fwrite.Po + -rm -f ./$(DEPDIR)/test-getcwd-lgpl.Po + -rm -f ./$(DEPDIR)/test-getdtablesize.Po + -rm -f ./$(DEPDIR)/test-getopt-gnu.Po + -rm -f ./$(DEPDIR)/test-getopt-posix.Po + -rm -f ./$(DEPDIR)/test-getprogname.Po + -rm -f ./$(DEPDIR)/test-gettimeofday.Po + -rm -f ./$(DEPDIR)/test-hash.Po + -rm -f ./$(DEPDIR)/test-iconv-h.Po + -rm -f ./$(DEPDIR)/test-iconv.Po + -rm -f ./$(DEPDIR)/test-ignore-value.Po + -rm -f ./$(DEPDIR)/test-inet_pton.Po + -rm -f ./$(DEPDIR)/test-intprops.Po + -rm -f ./$(DEPDIR)/test-inttostr.Po + -rm -f ./$(DEPDIR)/test-inttypes.Po + -rm -f ./$(DEPDIR)/test-ioctl.Po + -rm -f ./$(DEPDIR)/test-isblank.Po + -rm -f ./$(DEPDIR)/test-iswblank.Po + -rm -f ./$(DEPDIR)/test-langinfo.Po + -rm -f ./$(DEPDIR)/test-limits-h.Po + -rm -f ./$(DEPDIR)/test-listen.Po + -rm -f ./$(DEPDIR)/test-locale.Po + -rm -f ./$(DEPDIR)/test-localeconv.Po + -rm -f ./$(DEPDIR)/test-lstat.Po + -rm -f ./$(DEPDIR)/test-malloca.Po + -rm -f ./$(DEPDIR)/test-mbrtowc-w32.Po + -rm -f ./$(DEPDIR)/test-mbrtowc.Po + -rm -f ./$(DEPDIR)/test-mbscasecmp.Po + -rm -f ./$(DEPDIR)/test-mbsinit.Po + -rm -f ./$(DEPDIR)/test-mbsrtowcs.Po + -rm -f ./$(DEPDIR)/test-mbsstr1.Po + -rm -f ./$(DEPDIR)/test-mbsstr2.Po + -rm -f ./$(DEPDIR)/test-mbsstr3.Po + -rm -f ./$(DEPDIR)/test-memchr.Po + -rm -f ./$(DEPDIR)/test-nanosleep.Po + -rm -f ./$(DEPDIR)/test-netinet_in.Po + -rm -f ./$(DEPDIR)/test-nl_langinfo.Po + -rm -f ./$(DEPDIR)/test-open.Po + -rm -f ./$(DEPDIR)/test-pathmax.Po + -rm -f ./$(DEPDIR)/test-perror.Po + -rm -f ./$(DEPDIR)/test-perror2.Po + -rm -f ./$(DEPDIR)/test-pipe.Po + -rm -f ./$(DEPDIR)/test-quotearg-simple.Po + -rm -f ./$(DEPDIR)/test-raise.Po + -rm -f ./$(DEPDIR)/test-rawmemchr.Po + -rm -f ./$(DEPDIR)/test-readlink.Po + -rm -f ./$(DEPDIR)/test-regex.Po + -rm -f ./$(DEPDIR)/test-select-fd.Po + -rm -f ./$(DEPDIR)/test-select-stdin.Po + -rm -f ./$(DEPDIR)/test-select.Po + -rm -f ./$(DEPDIR)/test-setenv.Po + -rm -f ./$(DEPDIR)/test-setlocale1.Po + -rm -f ./$(DEPDIR)/test-setlocale2.Po + -rm -f ./$(DEPDIR)/test-setsockopt.Po + -rm -f ./$(DEPDIR)/test-sh-quote.Po + -rm -f ./$(DEPDIR)/test-sigaction.Po + -rm -f ./$(DEPDIR)/test-signal-h.Po + -rm -f ./$(DEPDIR)/test-sigprocmask.Po + -rm -f ./$(DEPDIR)/test-sleep.Po + -rm -f ./$(DEPDIR)/test-snprintf.Po + -rm -f ./$(DEPDIR)/test-sockets.Po + -rm -f ./$(DEPDIR)/test-stat-time.Po + -rm -f ./$(DEPDIR)/test-stat.Po + -rm -f ./$(DEPDIR)/test-stdalign.Po + -rm -f ./$(DEPDIR)/test-stdbool.Po + -rm -f ./$(DEPDIR)/test-stddef.Po + -rm -f ./$(DEPDIR)/test-stdint.Po + -rm -f ./$(DEPDIR)/test-stdio.Po + -rm -f ./$(DEPDIR)/test-stdlib.Po + -rm -f ./$(DEPDIR)/test-strerror.Po + -rm -f ./$(DEPDIR)/test-strerror_r.Po + -rm -f ./$(DEPDIR)/test-strftime.Po + -rm -f ./$(DEPDIR)/test-striconv.Po + -rm -f ./$(DEPDIR)/test-string.Po + -rm -f ./$(DEPDIR)/test-strings.Po + -rm -f ./$(DEPDIR)/test-strnlen.Po + -rm -f ./$(DEPDIR)/test-strtoull.Po + -rm -f ./$(DEPDIR)/test-strtoumax.Po + -rm -f ./$(DEPDIR)/test-symlink.Po + -rm -f ./$(DEPDIR)/test-sys_ioctl.Po + -rm -f ./$(DEPDIR)/test-sys_select.Po + -rm -f ./$(DEPDIR)/test-sys_socket.Po + -rm -f ./$(DEPDIR)/test-sys_stat.Po + -rm -f ./$(DEPDIR)/test-sys_time.Po + -rm -f ./$(DEPDIR)/test-sys_types.Po + -rm -f ./$(DEPDIR)/test-sys_uio.Po + -rm -f ./$(DEPDIR)/test-sys_wait.Po + -rm -f ./$(DEPDIR)/test-time.Po + -rm -f ./$(DEPDIR)/test-timespec.Po + -rm -f ./$(DEPDIR)/test-unistd.Po + -rm -f ./$(DEPDIR)/test-unsetenv.Po + -rm -f ./$(DEPDIR)/test-vasnprintf.Po + -rm -f ./$(DEPDIR)/test-vasprintf.Po + -rm -f ./$(DEPDIR)/test-verify-try.Po + -rm -f ./$(DEPDIR)/test-verify.Po + -rm -f ./$(DEPDIR)/test-version-etc.Po + -rm -f ./$(DEPDIR)/test-wchar.Po + -rm -f ./$(DEPDIR)/test-wcrtomb-w32.Po + -rm -f ./$(DEPDIR)/test-wcrtomb.Po + -rm -f ./$(DEPDIR)/test-wctype-h.Po + -rm -f ./$(DEPDIR)/test-wcwidth.Po + -rm -f ./$(DEPDIR)/test-xalloc-die.Po + -rm -f ./$(DEPDIR)/test-xstrtol.Po + -rm -f ./$(DEPDIR)/test-xstrtoul.Po + -rm -f ./$(DEPDIR)/test-xstrtoumax.Po + -rm -f ./$(DEPDIR)/test-xvasprintf.Po + -rm -f ./$(DEPDIR)/timespec-add.Po + -rm -f ./$(DEPDIR)/timespec-sub.Po + -rm -f ./$(DEPDIR)/wctob.Po + -rm -f ./$(DEPDIR)/wctomb.Po + -rm -f unistr/$(DEPDIR)/test-u8-mbtoucr.Po + -rm -f unistr/$(DEPDIR)/test-u8-uctomb.Po + -rm -f uniwidth/$(DEPDIR)/test-uc_width.Po + -rm -f uniwidth/$(DEPDIR)/test-uc_width2.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f ./$(DEPDIR)/accept.Po + -rm -f ./$(DEPDIR)/bind.Po + -rm -f ./$(DEPDIR)/connect.Po + -rm -f ./$(DEPDIR)/dtotimespec.Po + -rm -f ./$(DEPDIR)/fdopen.Po + -rm -f ./$(DEPDIR)/ftruncate.Po + -rm -f ./$(DEPDIR)/getcwd-lgpl.Po + -rm -f ./$(DEPDIR)/getpagesize.Po + -rm -f ./$(DEPDIR)/hash-pjw.Po + -rm -f ./$(DEPDIR)/inet_pton.Po + -rm -f ./$(DEPDIR)/ioctl.Po + -rm -f ./$(DEPDIR)/listen.Po + -rm -f ./$(DEPDIR)/nanosleep.Po + -rm -f ./$(DEPDIR)/perror.Po + -rm -f ./$(DEPDIR)/pipe.Po + -rm -f ./$(DEPDIR)/putenv.Po + -rm -f ./$(DEPDIR)/select.Po + -rm -f ./$(DEPDIR)/setlocale.Po + -rm -f ./$(DEPDIR)/setsockopt.Po + -rm -f ./$(DEPDIR)/sleep.Po + -rm -f ./$(DEPDIR)/snprintf.Po + -rm -f ./$(DEPDIR)/socket.Po + -rm -f ./$(DEPDIR)/sockets.Po + -rm -f ./$(DEPDIR)/strerror_r.Po + -rm -f ./$(DEPDIR)/symlink.Po + -rm -f ./$(DEPDIR)/sys_socket.Po + -rm -f ./$(DEPDIR)/test-accept.Po + -rm -f ./$(DEPDIR)/test-alloca-opt.Po + -rm -f ./$(DEPDIR)/test-areadlink.Po + -rm -f ./$(DEPDIR)/test-argmatch.Po + -rm -f ./$(DEPDIR)/test-arpa_inet.Po + -rm -f ./$(DEPDIR)/test-binary-io.Po + -rm -f ./$(DEPDIR)/test-bind.Po + -rm -f ./$(DEPDIR)/test-bitrotate.Po + -rm -f ./$(DEPDIR)/test-btowc.Po + -rm -f ./$(DEPDIR)/test-c-ctype.Po + -rm -f ./$(DEPDIR)/test-c-stack.Po + -rm -f ./$(DEPDIR)/test-c-strcasecmp.Po + -rm -f ./$(DEPDIR)/test-c-strncasecmp.Po + -rm -f ./$(DEPDIR)/test-close.Po + -rm -f ./$(DEPDIR)/test-connect.Po + -rm -f ./$(DEPDIR)/test-ctype.Po + -rm -f ./$(DEPDIR)/test-dirname.Po + -rm -f ./$(DEPDIR)/test-dup2.Po + -rm -f ./$(DEPDIR)/test-environ.Po + -rm -f ./$(DEPDIR)/test-errno.Po + -rm -f ./$(DEPDIR)/test-exclude.Po + -rm -f ./$(DEPDIR)/test-fcntl-h.Po + -rm -f ./$(DEPDIR)/test-fcntl.Po + -rm -f ./$(DEPDIR)/test-fdopen.Po + -rm -f ./$(DEPDIR)/test-fgetc.Po + -rm -f ./$(DEPDIR)/test-filenamecat.Po + -rm -f ./$(DEPDIR)/test-float.Po + -rm -f ./$(DEPDIR)/test-fnmatch.Po + -rm -f ./$(DEPDIR)/test-fputc.Po + -rm -f ./$(DEPDIR)/test-fread.Po + -rm -f ./$(DEPDIR)/test-freopen-safer.Po + -rm -f ./$(DEPDIR)/test-freopen.Po + -rm -f ./$(DEPDIR)/test-fstat.Po + -rm -f ./$(DEPDIR)/test-ftruncate.Po + -rm -f ./$(DEPDIR)/test-fwrite.Po + -rm -f ./$(DEPDIR)/test-getcwd-lgpl.Po + -rm -f ./$(DEPDIR)/test-getdtablesize.Po + -rm -f ./$(DEPDIR)/test-getopt-gnu.Po + -rm -f ./$(DEPDIR)/test-getopt-posix.Po + -rm -f ./$(DEPDIR)/test-getprogname.Po + -rm -f ./$(DEPDIR)/test-gettimeofday.Po + -rm -f ./$(DEPDIR)/test-hash.Po + -rm -f ./$(DEPDIR)/test-iconv-h.Po + -rm -f ./$(DEPDIR)/test-iconv.Po + -rm -f ./$(DEPDIR)/test-ignore-value.Po + -rm -f ./$(DEPDIR)/test-inet_pton.Po + -rm -f ./$(DEPDIR)/test-intprops.Po + -rm -f ./$(DEPDIR)/test-inttostr.Po + -rm -f ./$(DEPDIR)/test-inttypes.Po + -rm -f ./$(DEPDIR)/test-ioctl.Po + -rm -f ./$(DEPDIR)/test-isblank.Po + -rm -f ./$(DEPDIR)/test-iswblank.Po + -rm -f ./$(DEPDIR)/test-langinfo.Po + -rm -f ./$(DEPDIR)/test-limits-h.Po + -rm -f ./$(DEPDIR)/test-listen.Po + -rm -f ./$(DEPDIR)/test-locale.Po + -rm -f ./$(DEPDIR)/test-localeconv.Po + -rm -f ./$(DEPDIR)/test-lstat.Po + -rm -f ./$(DEPDIR)/test-malloca.Po + -rm -f ./$(DEPDIR)/test-mbrtowc-w32.Po + -rm -f ./$(DEPDIR)/test-mbrtowc.Po + -rm -f ./$(DEPDIR)/test-mbscasecmp.Po + -rm -f ./$(DEPDIR)/test-mbsinit.Po + -rm -f ./$(DEPDIR)/test-mbsrtowcs.Po + -rm -f ./$(DEPDIR)/test-mbsstr1.Po + -rm -f ./$(DEPDIR)/test-mbsstr2.Po + -rm -f ./$(DEPDIR)/test-mbsstr3.Po + -rm -f ./$(DEPDIR)/test-memchr.Po + -rm -f ./$(DEPDIR)/test-nanosleep.Po + -rm -f ./$(DEPDIR)/test-netinet_in.Po + -rm -f ./$(DEPDIR)/test-nl_langinfo.Po + -rm -f ./$(DEPDIR)/test-open.Po + -rm -f ./$(DEPDIR)/test-pathmax.Po + -rm -f ./$(DEPDIR)/test-perror.Po + -rm -f ./$(DEPDIR)/test-perror2.Po + -rm -f ./$(DEPDIR)/test-pipe.Po + -rm -f ./$(DEPDIR)/test-quotearg-simple.Po + -rm -f ./$(DEPDIR)/test-raise.Po + -rm -f ./$(DEPDIR)/test-rawmemchr.Po + -rm -f ./$(DEPDIR)/test-readlink.Po + -rm -f ./$(DEPDIR)/test-regex.Po + -rm -f ./$(DEPDIR)/test-select-fd.Po + -rm -f ./$(DEPDIR)/test-select-stdin.Po + -rm -f ./$(DEPDIR)/test-select.Po + -rm -f ./$(DEPDIR)/test-setenv.Po + -rm -f ./$(DEPDIR)/test-setlocale1.Po + -rm -f ./$(DEPDIR)/test-setlocale2.Po + -rm -f ./$(DEPDIR)/test-setsockopt.Po + -rm -f ./$(DEPDIR)/test-sh-quote.Po + -rm -f ./$(DEPDIR)/test-sigaction.Po + -rm -f ./$(DEPDIR)/test-signal-h.Po + -rm -f ./$(DEPDIR)/test-sigprocmask.Po + -rm -f ./$(DEPDIR)/test-sleep.Po + -rm -f ./$(DEPDIR)/test-snprintf.Po + -rm -f ./$(DEPDIR)/test-sockets.Po + -rm -f ./$(DEPDIR)/test-stat-time.Po + -rm -f ./$(DEPDIR)/test-stat.Po + -rm -f ./$(DEPDIR)/test-stdalign.Po + -rm -f ./$(DEPDIR)/test-stdbool.Po + -rm -f ./$(DEPDIR)/test-stddef.Po + -rm -f ./$(DEPDIR)/test-stdint.Po + -rm -f ./$(DEPDIR)/test-stdio.Po + -rm -f ./$(DEPDIR)/test-stdlib.Po + -rm -f ./$(DEPDIR)/test-strerror.Po + -rm -f ./$(DEPDIR)/test-strerror_r.Po + -rm -f ./$(DEPDIR)/test-strftime.Po + -rm -f ./$(DEPDIR)/test-striconv.Po + -rm -f ./$(DEPDIR)/test-string.Po + -rm -f ./$(DEPDIR)/test-strings.Po + -rm -f ./$(DEPDIR)/test-strnlen.Po + -rm -f ./$(DEPDIR)/test-strtoull.Po + -rm -f ./$(DEPDIR)/test-strtoumax.Po + -rm -f ./$(DEPDIR)/test-symlink.Po + -rm -f ./$(DEPDIR)/test-sys_ioctl.Po + -rm -f ./$(DEPDIR)/test-sys_select.Po + -rm -f ./$(DEPDIR)/test-sys_socket.Po + -rm -f ./$(DEPDIR)/test-sys_stat.Po + -rm -f ./$(DEPDIR)/test-sys_time.Po + -rm -f ./$(DEPDIR)/test-sys_types.Po + -rm -f ./$(DEPDIR)/test-sys_uio.Po + -rm -f ./$(DEPDIR)/test-sys_wait.Po + -rm -f ./$(DEPDIR)/test-time.Po + -rm -f ./$(DEPDIR)/test-timespec.Po + -rm -f ./$(DEPDIR)/test-unistd.Po + -rm -f ./$(DEPDIR)/test-unsetenv.Po + -rm -f ./$(DEPDIR)/test-vasnprintf.Po + -rm -f ./$(DEPDIR)/test-vasprintf.Po + -rm -f ./$(DEPDIR)/test-verify-try.Po + -rm -f ./$(DEPDIR)/test-verify.Po + -rm -f ./$(DEPDIR)/test-version-etc.Po + -rm -f ./$(DEPDIR)/test-wchar.Po + -rm -f ./$(DEPDIR)/test-wcrtomb-w32.Po + -rm -f ./$(DEPDIR)/test-wcrtomb.Po + -rm -f ./$(DEPDIR)/test-wctype-h.Po + -rm -f ./$(DEPDIR)/test-wcwidth.Po + -rm -f ./$(DEPDIR)/test-xalloc-die.Po + -rm -f ./$(DEPDIR)/test-xstrtol.Po + -rm -f ./$(DEPDIR)/test-xstrtoul.Po + -rm -f ./$(DEPDIR)/test-xstrtoumax.Po + -rm -f ./$(DEPDIR)/test-xvasprintf.Po + -rm -f ./$(DEPDIR)/timespec-add.Po + -rm -f ./$(DEPDIR)/timespec-sub.Po + -rm -f ./$(DEPDIR)/wctob.Po + -rm -f ./$(DEPDIR)/wctomb.Po + -rm -f unistr/$(DEPDIR)/test-u8-mbtoucr.Po + -rm -f unistr/$(DEPDIR)/test-u8-uctomb.Po + -rm -f uniwidth/$(DEPDIR)/test-uc_width.Po + -rm -f uniwidth/$(DEPDIR)/test-uc_width2.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-local + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) all check check-am install install-am \ + install-exec install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--depfiles check check-TESTS check-am clean \ + clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ + clean-local clean-noinstLIBRARIES clean-noinstPROGRAMS \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-local pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# We need the following in order to create <arpa/inet.h> when the system +# doesn't have one. +arpa/inet.h: arpa_inet.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_at)$(MKDIR_P) arpa + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \ + -e 's|@''NEXT_ARPA_INET_H''@|$(NEXT_ARPA_INET_H)|g' \ + -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \ + -e 's/@''GNULIB_INET_NTOP''@/$(GNULIB_INET_NTOP)/g' \ + -e 's/@''GNULIB_INET_PTON''@/$(GNULIB_INET_PTON)/g' \ + -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \ + -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \ + -e 's|@''REPLACE_INET_NTOP''@|$(REPLACE_INET_NTOP)|g' \ + -e 's|@''REPLACE_INET_PTON''@|$(REPLACE_INET_PTON)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/arpa_inet.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create <netinet/in.h> when the system +# doesn't have one. +@GL_GENERATE_NETINET_IN_H_TRUE@netinet/in.h: netinet_in.in.h $(top_builddir)/config.status +@GL_GENERATE_NETINET_IN_H_TRUE@ $(AM_V_at)$(MKDIR_P) netinet +@GL_GENERATE_NETINET_IN_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_NETINET_IN_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_NETINET_IN_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_NETINET_IN_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_NETINET_IN_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_NETINET_IN_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_NETINET_IN_H_TRUE@ -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \ +@GL_GENERATE_NETINET_IN_H_TRUE@ -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \ +@GL_GENERATE_NETINET_IN_H_TRUE@ < $(srcdir)/netinet_in.in.h; \ +@GL_GENERATE_NETINET_IN_H_TRUE@ } > $@-t && \ +@GL_GENERATE_NETINET_IN_H_TRUE@ mv $@-t $@ +@GL_GENERATE_NETINET_IN_H_FALSE@netinet/in.h: $(top_builddir)/config.status +@GL_GENERATE_NETINET_IN_H_FALSE@ rm -f $@ + +# We need the following in order to create <stdalign.h> when the system +# doesn't have one that works. +@GL_GENERATE_STDALIGN_H_TRUE@stdalign.h: stdalign.in.h $(top_builddir)/config.status +@GL_GENERATE_STDALIGN_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_STDALIGN_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_STDALIGN_H_TRUE@ cat $(srcdir)/stdalign.in.h; \ +@GL_GENERATE_STDALIGN_H_TRUE@ } > $@-t && \ +@GL_GENERATE_STDALIGN_H_TRUE@ mv $@-t $@ +@GL_GENERATE_STDALIGN_H_FALSE@stdalign.h: $(top_builddir)/config.status +@GL_GENERATE_STDALIGN_H_FALSE@ rm -f $@ + +# We need the following in order to create <sys/ioctl.h> when the system +# does not have a complete one. +sys/ioctl.h: sys_ioctl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_SYS_IOCTL_H''@|$(HAVE_SYS_IOCTL_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_IOCTL_H''@|$(NEXT_SYS_IOCTL_H)|g' \ + -e 's/@''GNULIB_IOCTL''@/$(GNULIB_IOCTL)/g' \ + -e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H)|g' \ + -e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \ + -e 's|@''REPLACE_IOCTL''@|$(REPLACE_IOCTL)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_ioctl.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create <sys/select.h> when the system +# doesn't have one that works with the given compiler. +sys/select.h: sys_select.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_SELECT_H''@|$(NEXT_SYS_SELECT_H)|g' \ + -e 's|@''HAVE_SYS_SELECT_H''@|$(HAVE_SYS_SELECT_H)|g' \ + -e 's/@''GNULIB_PSELECT''@/$(GNULIB_PSELECT)/g' \ + -e 's/@''GNULIB_SELECT''@/$(GNULIB_SELECT)/g' \ + -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ + -e 's|@''HAVE_PSELECT''@|$(HAVE_PSELECT)|g' \ + -e 's|@''REPLACE_PSELECT''@|$(REPLACE_PSELECT)|g' \ + -e 's|@''REPLACE_SELECT''@|$(REPLACE_SELECT)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_select.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create <sys/socket.h> when the system +# doesn't have one that works with the given compiler. +sys/socket.h: sys_socket.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \ + -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \ + -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \ + -e 's/@''GNULIB_SOCKET''@/$(GNULIB_SOCKET)/g' \ + -e 's/@''GNULIB_CONNECT''@/$(GNULIB_CONNECT)/g' \ + -e 's/@''GNULIB_ACCEPT''@/$(GNULIB_ACCEPT)/g' \ + -e 's/@''GNULIB_BIND''@/$(GNULIB_BIND)/g' \ + -e 's/@''GNULIB_GETPEERNAME''@/$(GNULIB_GETPEERNAME)/g' \ + -e 's/@''GNULIB_GETSOCKNAME''@/$(GNULIB_GETSOCKNAME)/g' \ + -e 's/@''GNULIB_GETSOCKOPT''@/$(GNULIB_GETSOCKOPT)/g' \ + -e 's/@''GNULIB_LISTEN''@/$(GNULIB_LISTEN)/g' \ + -e 's/@''GNULIB_RECV''@/$(GNULIB_RECV)/g' \ + -e 's/@''GNULIB_SEND''@/$(GNULIB_SEND)/g' \ + -e 's/@''GNULIB_RECVFROM''@/$(GNULIB_RECVFROM)/g' \ + -e 's/@''GNULIB_SENDTO''@/$(GNULIB_SENDTO)/g' \ + -e 's/@''GNULIB_SETSOCKOPT''@/$(GNULIB_SETSOCKOPT)/g' \ + -e 's/@''GNULIB_SHUTDOWN''@/$(GNULIB_SHUTDOWN)/g' \ + -e 's/@''GNULIB_ACCEPT4''@/$(GNULIB_ACCEPT4)/g' \ + -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ + -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \ + -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \ + -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY''@|$(HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)|g' \ + -e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \ + -e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_socket.in.h; \ + } > $@-t && \ + mv -f $@-t $@ + +# We need the following in order to create <sys/uio.h> when the system +# doesn't have one that works with the given compiler. +sys/uio.h: sys_uio.in.h $(top_builddir)/config.status + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_UIO_H''@|$(NEXT_SYS_UIO_H)|g' \ + -e 's|@''HAVE_SYS_UIO_H''@|$(HAVE_SYS_UIO_H)|g' \ + < $(srcdir)/sys_uio.in.h; \ + } > $@-t && \ + mv -f $@-t $@ + +# Clean up after Solaris cc. +clean-local: + rm -rf SunWS_cache + +mostlyclean-local: mostlyclean-generic + @for dir in '' $(MOSTLYCLEANDIRS); do \ + if test -n "$$dir" && test -d $$dir; then \ + echo "rmdir $$dir"; rmdir $$dir; \ + fi; \ + done; \ + : + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: + +# Tell GNU make to disable its built-in pattern rules. +%:: %,v +%:: RCS/%,v +%:: RCS/% +%:: s.% +%:: SCCS/s.% diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/_Noreturn.h b/local/recipes/tools/diffutils/source/gnulib-tests/_Noreturn.h new file mode 100644 index 0000000000..c44ad89b7c --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/_Noreturn.h @@ -0,0 +1,10 @@ +#if !defined _Noreturn && __STDC_VERSION__ < 201112 +# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ + || 0x5110 <= __SUNPRO_C) +# define _Noreturn __attribute__ ((__noreturn__)) +# elif 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn +# endif +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/accept.c b/local/recipes/tools/diffutils/source/gnulib-tests/accept.c new file mode 100644 index 0000000000..08bb4d9ad3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/accept.c @@ -0,0 +1,52 @@ +/* accept.c --- wrappers for Windows accept function + + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paolo Bonzini */ + +#include <config.h> + +#define WIN32_LEAN_AND_MEAN +/* Get winsock2.h. */ +#include <sys/socket.h> + +/* Get set_winsock_errno, FD_TO_SOCKET etc. */ +#include "w32sock.h" + +#undef accept + +int +rpl_accept (int fd, struct sockaddr *addr, socklen_t *addrlen) +{ + SOCKET sock = FD_TO_SOCKET (fd); + + if (sock == INVALID_SOCKET) + { + errno = EBADF; + return -1; + } + else + { + SOCKET fh = accept (sock, addr, addrlen); + if (fh == INVALID_SOCKET) + { + set_winsock_errno (); + return -1; + } + else + return SOCKET_TO_FD (fh); + } +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/arg-nonnull.h b/local/recipes/tools/diffutils/source/gnulib-tests/arg-nonnull.h new file mode 100644 index 0000000000..1e62cc8982 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/arg-nonnull.h @@ -0,0 +1,26 @@ +/* A C macro for declaring that specific arguments must not be NULL. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools + that the values passed as arguments n, ..., m must be non-NULL pointers. + n = 1 stands for the first argument, n = 2 for the second argument etc. */ +#ifndef _GL_ARG_NONNULL +# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 +# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) +# else +# define _GL_ARG_NONNULL(params) +# endif +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/arpa_inet.in.h b/local/recipes/tools/diffutils/source/gnulib-tests/arpa_inet.in.h new file mode 100644 index 0000000000..dc3d2bdbbc --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/arpa_inet.in.h @@ -0,0 +1,140 @@ +/* A GNU-like <arpa/inet.h>. + + Copyright (C) 2005-2006, 2008-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _@GUARD_PREFIX@_ARPA_INET_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#if @HAVE_FEATURES_H@ +# include <features.h> /* for __GLIBC__ */ +#endif + +/* Gnulib's sys/socket.h is responsible for defining socklen_t (used below) and + for pulling in winsock2.h etc. under MinGW. + But avoid namespace pollution on glibc systems. */ +#ifndef __GLIBC__ +# include <sys/socket.h> +#endif + +/* On NonStop Kernel, inet_ntop and inet_pton are declared in <netdb.h>. + But avoid namespace pollution on glibc systems. */ +#if defined __TANDEM && !defined __GLIBC__ +# include <netdb.h> +#endif + +#if @HAVE_ARPA_INET_H@ + +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_ARPA_INET_H@ + +#endif + +#ifndef _@GUARD_PREFIX@_ARPA_INET_H +#define _@GUARD_PREFIX@_ARPA_INET_H + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + + +#if @GNULIB_INET_NTOP@ +/* Converts an internet address from internal format to a printable, + presentable format. + AF is an internet address family, such as AF_INET or AF_INET6. + SRC points to a 'struct in_addr' (for AF_INET) or 'struct in6_addr' + (for AF_INET6). + DST points to a buffer having room for CNT bytes. + The printable representation of the address (in numeric form, not + surrounded by [...], no reverse DNS is done) is placed in DST, and + DST is returned. If an error occurs, the return value is NULL and + errno is set. If CNT bytes are not sufficient to hold the result, + the return value is NULL and errno is set to ENOSPC. A good value + for CNT is 46. + + For more details, see the POSIX:2001 specification + <http://www.opengroup.org/susv3xsh/inet_ntop.html>. */ +# if @REPLACE_INET_NTOP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef inet_ntop +# define inet_ntop rpl_inet_ntop +# endif +_GL_FUNCDECL_RPL (inet_ntop, const char *, + (int af, const void *restrict src, + char *restrict dst, socklen_t cnt) + _GL_ARG_NONNULL ((2, 3))); +_GL_CXXALIAS_RPL (inet_ntop, const char *, + (int af, const void *restrict src, + char *restrict dst, socklen_t cnt)); +# else +# if !@HAVE_DECL_INET_NTOP@ +_GL_FUNCDECL_SYS (inet_ntop, const char *, + (int af, const void *restrict src, + char *restrict dst, socklen_t cnt) + _GL_ARG_NONNULL ((2, 3))); +# endif +/* Need to cast, because on NonStop Kernel, the fourth parameter is + size_t cnt. */ +_GL_CXXALIAS_SYS_CAST (inet_ntop, const char *, + (int af, const void *restrict src, + char *restrict dst, socklen_t cnt)); +# endif +_GL_CXXALIASWARN (inet_ntop); +#elif defined GNULIB_POSIXCHECK +# undef inet_ntop +# if HAVE_RAW_DECL_INET_NTOP +_GL_WARN_ON_USE (inet_ntop, "inet_ntop is unportable - " + "use gnulib module inet_ntop for portability"); +# endif +#endif + +#if @GNULIB_INET_PTON@ +# if @REPLACE_INET_PTON@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef inet_pton +# define inet_pton rpl_inet_pton +# endif +_GL_FUNCDECL_RPL (inet_pton, int, + (int af, const char *restrict src, void *restrict dst) + _GL_ARG_NONNULL ((2, 3))); +_GL_CXXALIAS_RPL (inet_pton, int, + (int af, const char *restrict src, void *restrict dst)); +# else +# if !@HAVE_DECL_INET_PTON@ +_GL_FUNCDECL_SYS (inet_pton, int, + (int af, const char *restrict src, void *restrict dst) + _GL_ARG_NONNULL ((2, 3))); +# endif +_GL_CXXALIAS_SYS (inet_pton, int, + (int af, const char *restrict src, void *restrict dst)); +# endif +_GL_CXXALIASWARN (inet_pton); +#elif defined GNULIB_POSIXCHECK +# undef inet_pton +# if HAVE_RAW_DECL_INET_PTON +_GL_WARN_ON_USE (inet_pton, "inet_pton is unportable - " + "use gnulib module inet_pton for portability"); +# endif +#endif + + +#endif /* _@GUARD_PREFIX@_ARPA_INET_H */ +#endif /* _@GUARD_PREFIX@_ARPA_INET_H */ diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/bind.c b/local/recipes/tools/diffutils/source/gnulib-tests/bind.c new file mode 100644 index 0000000000..bde82d3a57 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/bind.c @@ -0,0 +1,49 @@ +/* bind.c --- wrappers for Windows bind function + + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paolo Bonzini */ + +#include <config.h> + +#define WIN32_LEAN_AND_MEAN +/* Get winsock2.h. */ +#include <sys/socket.h> + +/* Get set_winsock_errno, FD_TO_SOCKET etc. */ +#include "w32sock.h" + +#undef bind + +int +rpl_bind (int fd, const struct sockaddr *sockaddr, socklen_t len) +{ + SOCKET sock = FD_TO_SOCKET (fd); + + if (sock == INVALID_SOCKET) + { + errno = EBADF; + return -1; + } + else + { + int r = bind (sock, sockaddr, len); + if (r < 0) + set_winsock_errno (); + + return r; + } +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/c++defs.h b/local/recipes/tools/diffutils/source/gnulib-tests/c++defs.h new file mode 100644 index 0000000000..f03f3591c3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/c++defs.h @@ -0,0 +1,316 @@ +/* C++ compatible function declaration macros. + Copyright (C) 2010-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _GL_CXXDEFS_H +#define _GL_CXXDEFS_H + +/* Begin/end the GNULIB_NAMESPACE namespace. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE { +# define _GL_END_NAMESPACE } +#else +# define _GL_BEGIN_NAMESPACE +# define _GL_END_NAMESPACE +#endif + +/* The three most frequent use cases of these macros are: + + * For providing a substitute for a function that is missing on some + platforms, but is declared and works fine on the platforms on which + it exists: + + #if @GNULIB_FOO@ + # if !@HAVE_FOO@ + _GL_FUNCDECL_SYS (foo, ...); + # endif + _GL_CXXALIAS_SYS (foo, ...); + _GL_CXXALIASWARN (foo); + #elif defined GNULIB_POSIXCHECK + ... + #endif + + * For providing a replacement for a function that exists on all platforms, + but is broken/insufficient and needs to be replaced on some platforms: + + #if @GNULIB_FOO@ + # if @REPLACE_FOO@ + # if !(defined __cplusplus && defined GNULIB_NAMESPACE) + # undef foo + # define foo rpl_foo + # endif + _GL_FUNCDECL_RPL (foo, ...); + _GL_CXXALIAS_RPL (foo, ...); + # else + _GL_CXXALIAS_SYS (foo, ...); + # endif + _GL_CXXALIASWARN (foo); + #elif defined GNULIB_POSIXCHECK + ... + #endif + + * For providing a replacement for a function that exists on some platforms + but is broken/insufficient and needs to be replaced on some of them and + is additionally either missing or undeclared on some other platforms: + + #if @GNULIB_FOO@ + # if @REPLACE_FOO@ + # if !(defined __cplusplus && defined GNULIB_NAMESPACE) + # undef foo + # define foo rpl_foo + # endif + _GL_FUNCDECL_RPL (foo, ...); + _GL_CXXALIAS_RPL (foo, ...); + # else + # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@ + _GL_FUNCDECL_SYS (foo, ...); + # endif + _GL_CXXALIAS_SYS (foo, ...); + # endif + _GL_CXXALIASWARN (foo); + #elif defined GNULIB_POSIXCHECK + ... + #endif +*/ + +/* _GL_EXTERN_C declaration; + performs the declaration with C linkage. */ +#if defined __cplusplus +# define _GL_EXTERN_C extern "C" +#else +# define _GL_EXTERN_C extern +#endif + +/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes); + declares a replacement function, named rpl_func, with the given prototype, + consisting of return type, parameters, and attributes. + Example: + _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) + _GL_ARG_NONNULL ((1))); + */ +#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \ + _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes) +#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \ + _GL_EXTERN_C rettype rpl_func parameters_and_attributes + +/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes); + declares the system function, named func, with the given prototype, + consisting of return type, parameters, and attributes. + Example: + _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...) + _GL_ARG_NONNULL ((1))); + */ +#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ + _GL_EXTERN_C rettype func parameters_and_attributes + +/* _GL_CXXALIAS_RPL (func, rettype, parameters); + declares a C++ alias called GNULIB_NAMESPACE::func + that redirects to rpl_func, if GNULIB_NAMESPACE is defined. + Example: + _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); + + Wrapping rpl_func in an object with an inline conversion operator + avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is + actually used in the program. */ +#define _GL_CXXALIAS_RPL(func,rettype,parameters) \ + _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ + namespace GNULIB_NAMESPACE \ + { \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return ::rpl_func; \ + } \ + } func = {}; \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); + is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); + except that the C function rpl_func may have a slightly different + declaration. A cast is used to silence the "invalid conversion" error + that would otherwise occur. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ + namespace GNULIB_NAMESPACE \ + { \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return reinterpret_cast<type>(::rpl_func); \ + } \ + } func = {}; \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIAS_SYS (func, rettype, parameters); + declares a C++ alias called GNULIB_NAMESPACE::func + that redirects to the system provided function func, if GNULIB_NAMESPACE + is defined. + Example: + _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); + + Wrapping func in an object with an inline conversion operator + avoids a reference to func unless GNULIB_NAMESPACE::func is + actually used in the program. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ + namespace GNULIB_NAMESPACE \ + { \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return ::func; \ + } \ + } func = {}; \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters); + is like _GL_CXXALIAS_SYS (func, rettype, parameters); + except that the C function func may have a slightly different declaration. + A cast is used to silence the "invalid conversion" error that would + otherwise occur. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ + namespace GNULIB_NAMESPACE \ + { \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return reinterpret_cast<type>(::func); \ + } \ + } func = {}; \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2); + is like _GL_CXXALIAS_SYS (func, rettype, parameters); + except that the C function is picked among a set of overloaded functions, + namely the one with rettype2 and parameters2. Two consecutive casts + are used to silence the "cannot find a match" and "invalid conversion" + errors that would otherwise occur. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE + /* The outer cast must be a reinterpret_cast. + The inner cast: When the function is defined as a set of overloaded + functions, it works as a static_cast<>, choosing the designated variant. + When the function is defined as a single variant, it works as a + reinterpret_cast<>. The parenthesized cast syntax works both ways. */ +# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ + namespace GNULIB_NAMESPACE \ + { \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \ + } \ + } func = {}; \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIASWARN (func); + causes a warning to be emitted when ::func is used but not when + GNULIB_NAMESPACE::func is used. func must be defined without overloaded + variants. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIASWARN(func) \ + _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) +# define _GL_CXXALIASWARN_1(func,namespace) \ + _GL_CXXALIASWARN_2 (func, namespace) +/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, + we enable the warning only when not optimizing. */ +# if !__OPTIMIZE__ +# define _GL_CXXALIASWARN_2(func,namespace) \ + _GL_WARN_ON_USE (func, \ + "The symbol ::" #func " refers to the system function. " \ + "Use " #namespace "::" #func " instead.") +# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING +# define _GL_CXXALIASWARN_2(func,namespace) \ + extern __typeof__ (func) func +# else +# define _GL_CXXALIASWARN_2(func,namespace) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +# endif +#else +# define _GL_CXXALIASWARN(func) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes); + causes a warning to be emitted when the given overloaded variant of ::func + is used but not when GNULIB_NAMESPACE::func is used. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ + _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ + GNULIB_NAMESPACE) +# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ + _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) +/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, + we enable the warning only when not optimizing. */ +# if !__OPTIMIZE__ +# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ + _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ + "The symbol ::" #func " refers to the system function. " \ + "Use " #namespace "::" #func " instead.") +# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING +# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ + extern __typeof__ (func) func +# else +# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +# endif +#else +# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +#endif /* _GL_CXXDEFS_H */ diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/connect.c b/local/recipes/tools/diffutils/source/gnulib-tests/connect.c new file mode 100644 index 0000000000..9e2a36eda3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/connect.c @@ -0,0 +1,56 @@ +/* connect.c --- wrappers for Windows connect function + + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paolo Bonzini */ + +#include <config.h> + +#define WIN32_LEAN_AND_MEAN +/* Get winsock2.h. */ +#include <sys/socket.h> + +/* Get set_winsock_errno, FD_TO_SOCKET etc. */ +#include "w32sock.h" + +#undef connect + +int +rpl_connect (int fd, const struct sockaddr *sockaddr, socklen_t len) +{ + SOCKET sock = FD_TO_SOCKET (fd); + + if (sock == INVALID_SOCKET) + { + errno = EBADF; + return -1; + } + else + { + int r = connect (sock, sockaddr, len); + if (r < 0) + { + /* EINPROGRESS is not returned by WinSock 2.0; for backwards + compatibility, connect(2) uses EWOULDBLOCK. */ + if (WSAGetLastError () == WSAEWOULDBLOCK) + WSASetLastError (WSAEINPROGRESS); + + set_winsock_errno (); + } + + return r; + } +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/dtotimespec.c b/local/recipes/tools/diffutils/source/gnulib-tests/dtotimespec.c new file mode 100644 index 0000000000..3ca5a9cfd3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/dtotimespec.c @@ -0,0 +1,53 @@ +/* Convert double to timespec. + + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* written by Paul Eggert */ + +/* Convert the double value SEC to a struct timespec. Round toward + positive infinity. On overflow, return an extremal value. */ + +#include <config.h> + +#include "timespec.h" + +#include "intprops.h" + +struct timespec +dtotimespec (double sec) +{ + if (! (TYPE_MINIMUM (time_t) < sec)) + return make_timespec (TYPE_MINIMUM (time_t), 0); + else if (! (sec < 1.0 + TYPE_MAXIMUM (time_t))) + return make_timespec (TYPE_MAXIMUM (time_t), TIMESPEC_RESOLUTION - 1); + else + { + time_t s = sec; + double frac = TIMESPEC_RESOLUTION * (sec - s); + long ns = frac; + ns += ns < frac; + s += ns / TIMESPEC_RESOLUTION; + ns %= TIMESPEC_RESOLUTION; + + if (ns < 0) + { + s--; + ns += TIMESPEC_RESOLUTION; + } + + return make_timespec (s, ns); + } +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/fdopen.c b/local/recipes/tools/diffutils/source/gnulib-tests/fdopen.c new file mode 100644 index 0000000000..2ee87eb022 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/fdopen.c @@ -0,0 +1,69 @@ +/* Open a stream with a given file descriptor. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <stdio.h> + +#include <errno.h> + +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER +# include "msvc-inval.h" +#endif + +#undef fdopen + +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER +static FILE * +fdopen_nothrow (int fd, const char *mode) +{ + FILE *result; + + TRY_MSVC_INVAL + { + result = fdopen (fd, mode); + } + CATCH_MSVC_INVAL + { + result = NULL; + } + DONE_MSVC_INVAL; + + return result; +} +#else +# define fdopen_nothrow fdopen +#endif + +FILE * +rpl_fdopen (int fd, const char *mode) +{ + int saved_errno = errno; + FILE *fp; + + errno = 0; + fp = fdopen_nothrow (fd, mode); + if (fp == NULL) + { + if (errno == 0) + errno = EBADF; + } + else + errno = saved_errno; + + return fp; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/fpucw.h b/local/recipes/tools/diffutils/source/gnulib-tests/fpucw.h new file mode 100644 index 0000000000..dc30dd6eae --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/fpucw.h @@ -0,0 +1,108 @@ +/* Manipulating the FPU control word. -*- coding: utf-8 -*- + Copyright (C) 2007-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2007. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _FPUCW_H +#define _FPUCW_H + +/* The i386 floating point hardware (the 387 compatible FPU, not the modern + SSE/SSE2 hardware) has a controllable rounding precision. It is specified + through the 'PC' bits in the FPU control word ('fctrl' register). (See + the GNU libc i386 <fpu_control.h> header for details.) + + On some platforms, such as Linux or Solaris, the default precision setting + is set to "extended precision". This means that 'long double' instructions + operate correctly, but 'double' computations often produce slightly + different results as on strictly IEEE 754 conforming systems. + + On some platforms, such as NetBSD, the default precision is set to + "double precision". This means that 'long double' instructions will operate + only as 'double', i.e. lead to wrong results. Similarly on FreeBSD 6.4, at + least for the division of 'long double' numbers. + + The FPU control word is under control of the application, i.e. it is + not required to be set either way by the ABI. (In fact, the i386 ABI + http://refspecs.freestandards.org/elf/abi386-4.pdf page 3-12 = page 38 + is not clear about it. But in any case, gcc treats the control word + like a "preserved" register: it emits code that assumes that the control + word is preserved across calls, and it restores the control word at the + end of functions that modify it.) + + See Vincent Lefèvre's page http://www.vinc17.org/research/extended.en.html + for a good explanation. + See http://www.uwsg.iu.edu/hypermail/linux/kernel/0103.0/0453.html for + some argumentation which setting should be the default. */ + +/* This header file provides the following facilities: + fpucw_t integral type holding the value of 'fctrl' + FPU_PC_MASK bit mask denoting the precision control + FPU_PC_DOUBLE precision control for 53 bits mantissa + FPU_PC_EXTENDED precision control for 64 bits mantissa + GET_FPUCW () yields the current FPU control word + SET_FPUCW (word) sets the FPU control word + DECL_LONG_DOUBLE_ROUNDING variable declaration for + BEGIN/END_LONG_DOUBLE_ROUNDING + BEGIN_LONG_DOUBLE_ROUNDING () starts a sequence of instructions with + 'long double' safe operation precision + END_LONG_DOUBLE_ROUNDING () ends a sequence of instructions with + 'long double' safe operation precision + */ + +/* Inline assembler like this works only with GNU C. */ +#if (defined __i386__ || defined __x86_64__) && defined __GNUC__ + +typedef unsigned short fpucw_t; /* glibc calls this fpu_control_t */ + +# define FPU_PC_MASK 0x0300 +# define FPU_PC_DOUBLE 0x200 /* glibc calls this _FPU_DOUBLE */ +# define FPU_PC_EXTENDED 0x300 /* glibc calls this _FPU_EXTENDED */ + +# define GET_FPUCW() \ + ({ fpucw_t _cw; \ + __asm__ __volatile__ ("fnstcw %0" : "=m" (*&_cw)); \ + _cw; \ + }) +# define SET_FPUCW(word) \ + (void)({ fpucw_t _ncw = (word); \ + __asm__ __volatile__ ("fldcw %0" : : "m" (*&_ncw)); \ + }) + +# define DECL_LONG_DOUBLE_ROUNDING \ + fpucw_t oldcw; +# define BEGIN_LONG_DOUBLE_ROUNDING() \ + (void)(oldcw = GET_FPUCW (), \ + SET_FPUCW ((oldcw & ~FPU_PC_MASK) | FPU_PC_EXTENDED)) +# define END_LONG_DOUBLE_ROUNDING() \ + SET_FPUCW (oldcw) + +#else + +typedef unsigned int fpucw_t; + +# define FPU_PC_MASK 0 +# define FPU_PC_DOUBLE 0 +# define FPU_PC_EXTENDED 0 + +# define GET_FPUCW() 0 +# define SET_FPUCW(word) (void)(word) + +# define DECL_LONG_DOUBLE_ROUNDING +# define BEGIN_LONG_DOUBLE_ROUNDING() +# define END_LONG_DOUBLE_ROUNDING() + +#endif + +#endif /* _FPUCW_H */ diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/ftruncate.c b/local/recipes/tools/diffutils/source/gnulib-tests/ftruncate.c new file mode 100644 index 0000000000..3dac017513 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/ftruncate.c @@ -0,0 +1,193 @@ +/* ftruncate emulations for native Windows. + Copyright (C) 1992-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <unistd.h> + +#if HAVE_CHSIZE +/* A native Windows platform. */ + +# include <errno.h> + +# if _GL_WINDOWS_64_BIT_OFF_T + +/* Large File Support: off_t is 64-bit, but chsize() takes only a 32-bit + argument. So, define a 64-bit safe SetFileSize function ourselves. */ + +/* Ensure that <windows.h> declares GetFileSizeEx. */ +# undef _WIN32_WINNT +# define _WIN32_WINNT _WIN32_WINNT_WIN2K + +/* Get declarations of the native Windows API functions. */ +# define WIN32_LEAN_AND_MEAN +# include <windows.h> + +/* Get _get_osfhandle. */ +# if GNULIB_MSVC_NOTHROW +# include "msvc-nothrow.h" +# else +# include <io.h> +# endif + +static BOOL +SetFileSize (HANDLE h, LONGLONG size) +{ + LARGE_INTEGER old_size; + + if (!GetFileSizeEx (h, &old_size)) + return FALSE; + + if (size != old_size.QuadPart) + { + /* Duplicate the handle, so we are free to modify its file position. */ + HANDLE curr_process = GetCurrentProcess (); + HANDLE tmph; + + if (!DuplicateHandle (curr_process, /* SourceProcessHandle */ + h, /* SourceHandle */ + curr_process, /* TargetProcessHandle */ + (PHANDLE) &tmph, /* TargetHandle */ + (DWORD) 0, /* DesiredAccess */ + FALSE, /* InheritHandle */ + DUPLICATE_SAME_ACCESS)) /* Options */ + return FALSE; + + if (size < old_size.QuadPart) + { + /* Reduce the size. */ + LONG size_hi = (LONG) (size >> 32); + if (SetFilePointer (tmph, (LONG) size, &size_hi, FILE_BEGIN) + == INVALID_SET_FILE_POINTER + && GetLastError() != NO_ERROR) + { + CloseHandle (tmph); + return FALSE; + } + if (!SetEndOfFile (tmph)) + { + CloseHandle (tmph); + return FALSE; + } + } + else + { + /* Increase the size by adding zero bytes at the end. */ + static char zero_bytes[1024]; + LONG pos_hi = 0; + LONG pos_lo = SetFilePointer (tmph, (LONG) 0, &pos_hi, FILE_END); + LONGLONG pos; + if (pos_lo == INVALID_SET_FILE_POINTER + && GetLastError() != NO_ERROR) + { + CloseHandle (tmph); + return FALSE; + } + pos = ((LONGLONG) pos_hi << 32) | (ULONGLONG) (ULONG) pos_lo; + while (pos < size) + { + DWORD written; + LONGLONG count = size - pos; + if (count > sizeof (zero_bytes)) + count = sizeof (zero_bytes); + if (!WriteFile (tmph, zero_bytes, (DWORD) count, &written, NULL) + || written == 0) + { + CloseHandle (tmph); + return FALSE; + } + pos += (ULONGLONG) (ULONG) written; + } + } + /* Close the handle. */ + CloseHandle (tmph); + } + return TRUE; +} + +int +ftruncate (int fd, off_t length) +{ + HANDLE handle = (HANDLE) _get_osfhandle (fd); + + if (handle == INVALID_HANDLE_VALUE) + { + errno = EBADF; + return -1; + } + if (length < 0) + { + errno = EINVAL; + return -1; + } + if (!SetFileSize (handle, length)) + { + switch (GetLastError ()) + { + case ERROR_ACCESS_DENIED: + errno = EACCES; + break; + case ERROR_HANDLE_DISK_FULL: + case ERROR_DISK_FULL: + case ERROR_DISK_TOO_FRAGMENTED: + errno = ENOSPC; + break; + default: + errno = EIO; + break; + } + return -1; + } + return 0; +} + +# else + +# include <io.h> + +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER +# include "msvc-inval.h" +static int +chsize_nothrow (int fd, long length) +{ + int result; + + TRY_MSVC_INVAL + { + result = chsize (fd, length); + } + CATCH_MSVC_INVAL + { + result = -1; + errno = EBADF; + } + DONE_MSVC_INVAL; + + return result; +} +# else +# define chsize_nothrow chsize +# endif + +int +ftruncate (int fd, off_t length) +{ + return chsize_nothrow (fd, length); +} + +# endif +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/getcwd-lgpl.c b/local/recipes/tools/diffutils/source/gnulib-tests/getcwd-lgpl.c new file mode 100644 index 0000000000..34603c191b --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/getcwd-lgpl.c @@ -0,0 +1,126 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of gnulib. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification */ +#include <unistd.h> + +#include <errno.h> +#include <stdlib.h> +#include <string.h> + +#if GNULIB_GETCWD +/* Favor GPL getcwd.c if both getcwd and getcwd-lgpl modules are in use. */ +typedef int dummy; +#else + +/* Get the name of the current working directory, and put it in SIZE + bytes of BUF. Returns NULL if the directory couldn't be determined + (perhaps because the absolute name was longer than PATH_MAX, or + because of missing read/search permissions on parent directories) + or SIZE was too small. If successful, returns BUF. If BUF is + NULL, an array is allocated with 'malloc'; the array is SIZE bytes + long, unless SIZE == 0, in which case it is as big as + necessary. */ + +# undef getcwd +char * +rpl_getcwd (char *buf, size_t size) +{ + char *ptr; + char *result; + + /* Handle single size operations. */ + if (buf) + { + if (!size) + { + errno = EINVAL; + return NULL; + } + return getcwd (buf, size); + } + + if (size) + { + buf = malloc (size); + if (!buf) + { + errno = ENOMEM; + return NULL; + } + result = getcwd (buf, size); + if (!result) + { + int saved_errno = errno; + free (buf); + errno = saved_errno; + } + return result; + } + + /* Flexible sizing requested. Avoid over-allocation for the common + case of a name that fits within a 4k page, minus some space for + local variables, to be sure we don't skip over a guard page. */ + { + char tmp[4032]; + size = sizeof tmp; + ptr = getcwd (tmp, size); + if (ptr) + { + result = strdup (ptr); + if (!result) + errno = ENOMEM; + return result; + } + if (errno != ERANGE) + return NULL; + } + + /* My what a large directory name we have. */ + do + { + size <<= 1; + ptr = realloc (buf, size); + if (ptr == NULL) + { + free (buf); + errno = ENOMEM; + return NULL; + } + buf = ptr; + result = getcwd (buf, size); + } + while (!result && errno == ERANGE); + + if (!result) + { + int saved_errno = errno; + free (buf); + errno = saved_errno; + } + else + { + /* Trim to fit, if possible. */ + result = realloc (buf, strlen (buf) + 1); + if (!result) + result = buf; + } + return result; +} + +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/getpagesize.c b/local/recipes/tools/diffutils/source/gnulib-tests/getpagesize.c new file mode 100644 index 0000000000..9e91315e3c --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/getpagesize.c @@ -0,0 +1,39 @@ +/* getpagesize emulation for systems where it cannot be done in a C macro. + + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible and Martin Lambers. */ + +#include <config.h> + +/* Specification. */ +#include <unistd.h> + +/* This implementation is only for native Windows systems. */ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +# define WIN32_LEAN_AND_MEAN +# include <windows.h> + +int +getpagesize (void) +{ + SYSTEM_INFO system_info; + GetSystemInfo (&system_info); + return system_info.dwPageSize; +} + +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/gnulib.mk b/local/recipes/tools/diffutils/source/gnulib-tests/gnulib.mk new file mode 100644 index 0000000000..73326aacee --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/gnulib.mk @@ -0,0 +1,1825 @@ +## DO NOT EDIT! GENERATED AUTOMATICALLY! +## Process this file with automake to produce Makefile.in. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this file. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception to the GNU General Public License, +# this file may be distributed as part of a program that +# contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# Generated by gnulib-tool. + +AUTOMAKE_OPTIONS = 1.9.6 foreign subdir-objects + +SUBDIRS = . +TESTS = +XFAIL_TESTS = +TESTS_ENVIRONMENT = +noinst_PROGRAMS = +check_PROGRAMS = +EXTRA_PROGRAMS = +noinst_HEADERS = +noinst_LIBRARIES = +check_LIBRARIES = libtests.a +EXTRA_DIST = +BUILT_SOURCES = +SUFFIXES = +MOSTLYCLEANFILES = core *.stackdump +MOSTLYCLEANDIRS = +CLEANFILES = +DISTCLEANFILES = +MAINTAINERCLEANFILES = + +AM_CPPFLAGS = \ + -D@gltests_WITNESS@=1 \ + -I. -I$(srcdir) \ + -I.. -I$(srcdir)/.. \ + -I../lib -I$(srcdir)/../lib + +LDADD = libtests.a ../lib/libdiffutils.a libtests.a $(LIBTESTS_LIBDEPS) + +libtests_a_SOURCES = +libtests_a_LIBADD = $(gltests_LIBOBJS) +libtests_a_DEPENDENCIES = $(gltests_LIBOBJS) +EXTRA_libtests_a_SOURCES = +AM_LIBTOOLFLAGS = --preserve-dup-deps + +TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' srcdir='$(srcdir)' + +## begin gnulib module accept + + +EXTRA_DIST += accept.c w32sock.h + +EXTRA_libtests_a_SOURCES += accept.c + +## end gnulib module accept + +## begin gnulib module accept-tests + +TESTS += test-accept +check_PROGRAMS += test-accept +test_accept_LDADD = $(LDADD) @LIBSOCKET@ +EXTRA_DIST += test-accept.c signature.h macros.h + +## end gnulib module accept-tests + +## begin gnulib module alloca-opt-tests + +TESTS += test-alloca-opt +check_PROGRAMS += test-alloca-opt + +EXTRA_DIST += test-alloca-opt.c + +## end gnulib module alloca-opt-tests + +## begin gnulib module areadlink-tests + +TESTS += test-areadlink +check_PROGRAMS += test-areadlink +EXTRA_DIST += test-areadlink.h test-areadlink.c macros.h + +## end gnulib module areadlink-tests + +## begin gnulib module argmatch-tests + +TESTS += test-argmatch +check_PROGRAMS += test-argmatch +test_argmatch_LDADD = $(LDADD) @LIBINTL@ + +EXTRA_DIST += test-argmatch.c macros.h + +## end gnulib module argmatch-tests + +## begin gnulib module arpa_inet + +BUILT_SOURCES += arpa/inet.h + +# We need the following in order to create <arpa/inet.h> when the system +# doesn't have one. +arpa/inet.h: arpa_inet.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_at)$(MKDIR_P) arpa + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \ + -e 's|@''NEXT_ARPA_INET_H''@|$(NEXT_ARPA_INET_H)|g' \ + -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \ + -e 's/@''GNULIB_INET_NTOP''@/$(GNULIB_INET_NTOP)/g' \ + -e 's/@''GNULIB_INET_PTON''@/$(GNULIB_INET_PTON)/g' \ + -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \ + -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \ + -e 's|@''REPLACE_INET_NTOP''@|$(REPLACE_INET_NTOP)|g' \ + -e 's|@''REPLACE_INET_PTON''@|$(REPLACE_INET_PTON)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/arpa_inet.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t +MOSTLYCLEANDIRS += arpa + +EXTRA_DIST += arpa_inet.in.h + +## end gnulib module arpa_inet + +## begin gnulib module arpa_inet-tests + +TESTS += test-arpa_inet +check_PROGRAMS += test-arpa_inet +EXTRA_DIST += test-arpa_inet.c + +## end gnulib module arpa_inet-tests + +## begin gnulib module binary-io-tests + +TESTS += test-binary-io.sh +check_PROGRAMS += test-binary-io + +EXTRA_DIST += test-binary-io.sh test-binary-io.c macros.h + +## end gnulib module binary-io-tests + +## begin gnulib module bind + + +EXTRA_DIST += bind.c w32sock.h + +EXTRA_libtests_a_SOURCES += bind.c + +## end gnulib module bind + +## begin gnulib module bind-tests + +TESTS += test-bind +check_PROGRAMS += test-bind +test_bind_LDADD = $(LDADD) @LIBSOCKET@ $(INET_PTON_LIB) +EXTRA_DIST += test-bind.c signature.h macros.h + +## end gnulib module bind-tests + +## begin gnulib module bitrotate-tests + +TESTS += test-bitrotate +check_PROGRAMS += test-bitrotate +EXTRA_DIST += test-bitrotate.c macros.h + +## end gnulib module bitrotate-tests + +## begin gnulib module btowc-tests + +TESTS += test-btowc1.sh test-btowc2.sh +TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' +check_PROGRAMS += test-btowc + +EXTRA_DIST += test-btowc1.sh test-btowc2.sh test-btowc.c signature.h macros.h + +## end gnulib module btowc-tests + +## begin gnulib module c-ctype-tests + +TESTS += test-c-ctype +check_PROGRAMS += test-c-ctype +EXTRA_DIST += test-c-ctype.c macros.h + +## end gnulib module c-ctype-tests + +## begin gnulib module c-stack-tests + +TESTS += test-c-stack.sh test-c-stack2.sh +TESTS_ENVIRONMENT += LIBSIGSEGV='@LIBSIGSEGV@' +check_PROGRAMS += test-c-stack +test_c_stack_LDADD = $(LDADD) $(LIBCSTACK) @LIBINTL@ +MOSTLYCLEANFILES += t-c-stack.tmp t-c-stack2.tmp +EXTRA_DIST += test-c-stack.c test-c-stack.sh test-c-stack2.sh macros.h + +## end gnulib module c-stack-tests + +## begin gnulib module c-strcase-tests + +TESTS += test-c-strcase.sh +TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_TR_UTF8='@LOCALE_TR_UTF8@' +check_PROGRAMS += test-c-strcasecmp test-c-strncasecmp +EXTRA_DIST += test-c-strcase.sh test-c-strcasecmp.c test-c-strncasecmp.c macros.h + +## end gnulib module c-strcase-tests + +## begin gnulib module close-tests + +TESTS += test-close +check_PROGRAMS += test-close +EXTRA_DIST += test-close.c signature.h macros.h + +## end gnulib module close-tests + +## begin gnulib module connect + + +EXTRA_DIST += connect.c w32sock.h + +EXTRA_libtests_a_SOURCES += connect.c + +## end gnulib module connect + +## begin gnulib module connect-tests + +TESTS += test-connect +check_PROGRAMS += test-connect +test_connect_LDADD = $(LDADD) @LIBSOCKET@ $(INET_PTON_LIB) +EXTRA_DIST += test-connect.c signature.h macros.h + +## end gnulib module connect-tests + +## begin gnulib module ctype-tests + +TESTS += test-ctype +check_PROGRAMS += test-ctype +EXTRA_DIST += test-ctype.c + +## end gnulib module ctype-tests + +## begin gnulib module dirname-tests + +TESTS += test-dirname +check_PROGRAMS += test-dirname +test_dirname_LDADD = $(LDADD) @LIBINTL@ +EXTRA_DIST += test-dirname.c + +## end gnulib module dirname-tests + +## begin gnulib module dtotimespec + +libtests_a_SOURCES += dtotimespec.c + +## end gnulib module dtotimespec + +## begin gnulib module dup2-tests + +TESTS += test-dup2 +check_PROGRAMS += test-dup2 +EXTRA_DIST += test-dup2.c signature.h macros.h + +## end gnulib module dup2-tests + +## begin gnulib module environ-tests + +TESTS += test-environ +check_PROGRAMS += test-environ + +EXTRA_DIST += test-environ.c + +## end gnulib module environ-tests + +## begin gnulib module errno-tests + +TESTS += test-errno +check_PROGRAMS += test-errno + +EXTRA_DIST += test-errno.c + +## end gnulib module errno-tests + +## begin gnulib module exclude-tests + +TESTS += \ + test-exclude1.sh\ + test-exclude2.sh\ + test-exclude3.sh\ + test-exclude4.sh\ + test-exclude5.sh\ + test-exclude6.sh\ + test-exclude7.sh\ + test-exclude8.sh + +check_PROGRAMS += test-exclude +test_exclude_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD) +EXTRA_DIST += test-exclude.c test-exclude1.sh test-exclude2.sh test-exclude3.sh test-exclude4.sh test-exclude5.sh test-exclude6.sh test-exclude7.sh test-exclude8.sh + +## end gnulib module exclude-tests + +## begin gnulib module fcntl-h-tests + +TESTS += test-fcntl-h +check_PROGRAMS += test-fcntl-h +EXTRA_DIST += test-fcntl-h.c + +## end gnulib module fcntl-h-tests + +## begin gnulib module fcntl-tests + +TESTS += test-fcntl +check_PROGRAMS += test-fcntl +EXTRA_DIST += test-fcntl.c signature.h macros.h + +## end gnulib module fcntl-tests + +## begin gnulib module fdopen + + +EXTRA_DIST += fdopen.c + +EXTRA_libtests_a_SOURCES += fdopen.c + +## end gnulib module fdopen + +## begin gnulib module fdopen-tests + +TESTS += test-fdopen +check_PROGRAMS += test-fdopen +EXTRA_DIST += test-fdopen.c signature.h macros.h + +## end gnulib module fdopen-tests + +## begin gnulib module fgetc-tests + +TESTS += test-fgetc +check_PROGRAMS += test-fgetc +EXTRA_DIST += test-fgetc.c signature.h macros.h + +## end gnulib module fgetc-tests + +## begin gnulib module filenamecat-tests + +TESTS += test-filenamecat +check_PROGRAMS += test-filenamecat +test_filenamecat_LDADD = $(LDADD) @LIBINTL@ +EXTRA_DIST += test-filenamecat.c + +## end gnulib module filenamecat-tests + +## begin gnulib module float-tests + +TESTS += test-float +check_PROGRAMS += test-float +EXTRA_DIST += test-float.c macros.h + +## end gnulib module float-tests + +## begin gnulib module fnmatch-tests + +TESTS += test-fnmatch +check_PROGRAMS += test-fnmatch +EXTRA_DIST += test-fnmatch.c signature.h macros.h + +## end gnulib module fnmatch-tests + +## begin gnulib module fpucw + + +EXTRA_DIST += fpucw.h + +## end gnulib module fpucw + +## begin gnulib module fputc-tests + +TESTS += test-fputc +check_PROGRAMS += test-fputc +EXTRA_DIST += test-fputc.c signature.h macros.h + +## end gnulib module fputc-tests + +## begin gnulib module fread-tests + +TESTS += test-fread +check_PROGRAMS += test-fread +EXTRA_DIST += test-fread.c signature.h macros.h + +## end gnulib module fread-tests + +## begin gnulib module freopen-safer-tests + +TESTS += test-freopen-safer +check_PROGRAMS += test-freopen-safer +EXTRA_DIST += test-freopen-safer.c macros.h + +## end gnulib module freopen-safer-tests + +## begin gnulib module freopen-tests + +TESTS += test-freopen +check_PROGRAMS += test-freopen + +EXTRA_DIST += test-freopen.c signature.h macros.h + +## end gnulib module freopen-tests + +## begin gnulib module fstat-tests + +TESTS += test-fstat +check_PROGRAMS += test-fstat +EXTRA_DIST += test-fstat.c signature.h macros.h + +## end gnulib module fstat-tests + +## begin gnulib module ftruncate + + +EXTRA_DIST += ftruncate.c + +EXTRA_libtests_a_SOURCES += ftruncate.c + +## end gnulib module ftruncate + +## begin gnulib module ftruncate-tests + +TESTS += test-ftruncate.sh +check_PROGRAMS += test-ftruncate +EXTRA_DIST += test-ftruncate.c test-ftruncate.sh signature.h macros.h + +## end gnulib module ftruncate-tests + +## begin gnulib module fwrite-tests + +TESTS += test-fwrite +check_PROGRAMS += test-fwrite +EXTRA_DIST += test-fwrite.c signature.h macros.h + +## end gnulib module fwrite-tests + +## begin gnulib module getcwd-lgpl + + +EXTRA_DIST += getcwd-lgpl.c + +EXTRA_libtests_a_SOURCES += getcwd-lgpl.c + +## end gnulib module getcwd-lgpl + +## begin gnulib module getcwd-lgpl-tests + +TESTS += test-getcwd-lgpl +check_PROGRAMS += test-getcwd-lgpl +test_getcwd_lgpl_LDADD = $(LDADD) $(LIBINTL) +EXTRA_DIST += test-getcwd-lgpl.c signature.h macros.h + +## end gnulib module getcwd-lgpl-tests + +## begin gnulib module getdtablesize-tests + +TESTS += test-getdtablesize +check_PROGRAMS += test-getdtablesize +EXTRA_DIST += test-getdtablesize.c signature.h macros.h + +## end gnulib module getdtablesize-tests + +## begin gnulib module getopt-gnu-tests + +TESTS += test-getopt-gnu +check_PROGRAMS += test-getopt-gnu +test_getopt_gnu_LDADD = $(LDADD) $(LIBINTL) +EXTRA_DIST += macros.h signature.h test-getopt-gnu.c test-getopt-main.h test-getopt.h test-getopt_long.h + +## end gnulib module getopt-gnu-tests + +## begin gnulib module getopt-posix-tests + +TESTS += test-getopt-posix +check_PROGRAMS += test-getopt-posix +test_getopt_posix_LDADD = $(LDADD) $(LIBINTL) +EXTRA_DIST += macros.h signature.h test-getopt-posix.c test-getopt-main.h test-getopt.h + +## end gnulib module getopt-posix-tests + +## begin gnulib module getpagesize + + +EXTRA_DIST += getpagesize.c + +EXTRA_libtests_a_SOURCES += getpagesize.c + +## end gnulib module getpagesize + +## begin gnulib module getprogname-tests + +DEFS += -DEXEEXT=\"@EXEEXT@\" +TESTS += test-getprogname +check_PROGRAMS += test-getprogname +test_getprogname_LDADD = $(LDADD) +EXTRA_DIST += test-getprogname.c + +## end gnulib module getprogname-tests + +## begin gnulib module gettimeofday-tests + +TESTS += test-gettimeofday +check_PROGRAMS += test-gettimeofday + +EXTRA_DIST += signature.h test-gettimeofday.c + +## end gnulib module gettimeofday-tests + +## begin gnulib module hash-pjw + +libtests_a_SOURCES += hash-pjw.h hash-pjw.c + +## end gnulib module hash-pjw + +## begin gnulib module hash-tests + +TESTS += test-hash +check_PROGRAMS += test-hash +EXTRA_DIST += test-hash.c macros.h + +## end gnulib module hash-tests + +## begin gnulib module iconv-h-tests + +TESTS += test-iconv-h +check_PROGRAMS += test-iconv-h +EXTRA_DIST += test-iconv-h.c + +## end gnulib module iconv-h-tests + +## begin gnulib module iconv-tests + +TESTS += test-iconv +check_PROGRAMS += test-iconv +test_iconv_LDADD = $(LDADD) @LIBICONV@ + +EXTRA_DIST += test-iconv.c signature.h macros.h + +## end gnulib module iconv-tests + +## begin gnulib module ignore-value-tests + +TESTS += test-ignore-value +check_PROGRAMS += test-ignore-value +EXTRA_DIST += test-ignore-value.c + +## end gnulib module ignore-value-tests + +## begin gnulib module inet_pton + + +EXTRA_DIST += inet_pton.c + +EXTRA_libtests_a_SOURCES += inet_pton.c + +## end gnulib module inet_pton + +## begin gnulib module inet_pton-tests + +TESTS += test-inet_pton +check_PROGRAMS += test-inet_pton +test_inet_pton_LDADD = $(LDADD) @INET_PTON_LIB@ +EXTRA_DIST += test-inet_pton.c signature.h macros.h + +## end gnulib module inet_pton-tests + +## begin gnulib module intprops-tests + +TESTS += test-intprops +check_PROGRAMS += test-intprops +EXTRA_DIST += test-intprops.c macros.h + +## end gnulib module intprops-tests + +## begin gnulib module inttostr-tests + +TESTS += test-inttostr +check_PROGRAMS += test-inttostr +EXTRA_DIST += macros.h test-inttostr.c + +## end gnulib module inttostr-tests + +## begin gnulib module inttypes-tests + +TESTS += test-inttypes +check_PROGRAMS += test-inttypes +EXTRA_DIST += test-inttypes.c + +## end gnulib module inttypes-tests + +## begin gnulib module ioctl + + +EXTRA_DIST += ioctl.c w32sock.h + +EXTRA_libtests_a_SOURCES += ioctl.c + +## end gnulib module ioctl + +## begin gnulib module ioctl-tests + +TESTS += test-ioctl +check_PROGRAMS += test-ioctl +EXTRA_DIST += test-ioctl.c signature.h macros.h + +## end gnulib module ioctl-tests + +## begin gnulib module isblank-tests + +TESTS += test-isblank +check_PROGRAMS += test-isblank +EXTRA_DIST += test-isblank.c signature.h macros.h + +## end gnulib module isblank-tests + +## begin gnulib module iswblank-tests + +TESTS += test-iswblank +check_PROGRAMS += test-iswblank +EXTRA_DIST += test-iswblank.c macros.h + +## end gnulib module iswblank-tests + +## begin gnulib module langinfo-tests + +TESTS += test-langinfo +check_PROGRAMS += test-langinfo +EXTRA_DIST += test-langinfo.c + +## end gnulib module langinfo-tests + +## begin gnulib module limits-h-tests + +TESTS += test-limits-h +check_PROGRAMS += test-limits-h +EXTRA_DIST += test-limits-h.c + +## end gnulib module limits-h-tests + +## begin gnulib module listen + + +EXTRA_DIST += listen.c w32sock.h + +EXTRA_libtests_a_SOURCES += listen.c + +## end gnulib module listen + +## begin gnulib module listen-tests + +TESTS += test-listen +check_PROGRAMS += test-listen +test_listen_LDADD = $(LDADD) @LIBSOCKET@ +EXTRA_DIST += test-listen.c signature.h macros.h + +## end gnulib module listen-tests + +## begin gnulib module locale-tests + +TESTS += test-locale +check_PROGRAMS += test-locale +EXTRA_DIST += test-locale.c + +## end gnulib module locale-tests + +## begin gnulib module localeconv-tests + +TESTS += test-localeconv +check_PROGRAMS += test-localeconv +EXTRA_DIST += test-localeconv.c signature.h macros.h + +## end gnulib module localeconv-tests + +## begin gnulib module lstat-tests + +TESTS += test-lstat +check_PROGRAMS += test-lstat +EXTRA_DIST += test-lstat.h test-lstat.c signature.h macros.h + +## end gnulib module lstat-tests + +## begin gnulib module malloca-tests + +TESTS += test-malloca +check_PROGRAMS += test-malloca + +EXTRA_DIST += test-malloca.c + +## end gnulib module malloca-tests + +## begin gnulib module mbrtowc-tests + +TESTS += \ + test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.sh \ + test-mbrtowc5.sh \ + test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh test-mbrtowc-w32-3.sh \ + test-mbrtowc-w32-4.sh test-mbrtowc-w32-5.sh +TESTS_ENVIRONMENT += \ + LOCALE_FR='@LOCALE_FR@' \ + LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \ + LOCALE_JA='@LOCALE_JA@' \ + LOCALE_ZH_CN='@LOCALE_ZH_CN@' +check_PROGRAMS += test-mbrtowc test-mbrtowc-w32 +EXTRA_DIST += test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.sh test-mbrtowc5.sh test-mbrtowc.c test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh test-mbrtowc-w32-3.sh test-mbrtowc-w32-4.sh test-mbrtowc-w32-5.sh test-mbrtowc-w32.c signature.h macros.h + +## end gnulib module mbrtowc-tests + +## begin gnulib module mbscasecmp-tests + +TESTS += test-mbscasecmp.sh +TESTS_ENVIRONMENT += LOCALE_TR_UTF8='@LOCALE_TR_UTF8@' +check_PROGRAMS += test-mbscasecmp + +EXTRA_DIST += test-mbscasecmp.sh test-mbscasecmp.c macros.h + +## end gnulib module mbscasecmp-tests + +## begin gnulib module mbsinit-tests + +TESTS += test-mbsinit.sh +TESTS_ENVIRONMENT += LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' +check_PROGRAMS += test-mbsinit + +EXTRA_DIST += test-mbsinit.sh test-mbsinit.c signature.h macros.h + +## end gnulib module mbsinit-tests + +## begin gnulib module mbsrtowcs-tests + +TESTS += test-mbsrtowcs1.sh test-mbsrtowcs2.sh test-mbsrtowcs3.sh test-mbsrtowcs4.sh +TESTS_ENVIRONMENT += \ + LOCALE_FR='@LOCALE_FR@' \ + LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \ + LOCALE_JA='@LOCALE_JA@' \ + LOCALE_ZH_CN='@LOCALE_ZH_CN@' +check_PROGRAMS += test-mbsrtowcs + +EXTRA_DIST += test-mbsrtowcs1.sh test-mbsrtowcs2.sh test-mbsrtowcs3.sh test-mbsrtowcs4.sh test-mbsrtowcs.c signature.h macros.h + +## end gnulib module mbsrtowcs-tests + +## begin gnulib module mbsstr-tests + +TESTS += test-mbsstr1 test-mbsstr2.sh test-mbsstr3.sh +TESTS_ENVIRONMENT += LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_ZH_CN='@LOCALE_ZH_CN@' +check_PROGRAMS += test-mbsstr1 test-mbsstr2 test-mbsstr3 + +EXTRA_DIST += test-mbsstr1.c test-mbsstr2.sh test-mbsstr2.c test-mbsstr3.sh test-mbsstr3.c macros.h + +## end gnulib module mbsstr-tests + +## begin gnulib module memchr-tests + +TESTS += test-memchr +check_PROGRAMS += test-memchr +EXTRA_DIST += test-memchr.c zerosize-ptr.h signature.h macros.h + +## end gnulib module memchr-tests + +## begin gnulib module nanosleep + + +EXTRA_DIST += nanosleep.c + +EXTRA_libtests_a_SOURCES += nanosleep.c + +## end gnulib module nanosleep + +## begin gnulib module nanosleep-tests + +TESTS += test-nanosleep +check_PROGRAMS += test-nanosleep +test_nanosleep_LDADD = $(LDADD) $(LIB_NANOSLEEP) +EXTRA_DIST += test-nanosleep.c signature.h macros.h + +## end gnulib module nanosleep-tests + +## begin gnulib module netinet_in + +BUILT_SOURCES += $(NETINET_IN_H) + +# We need the following in order to create <netinet/in.h> when the system +# doesn't have one. +if GL_GENERATE_NETINET_IN_H +netinet/in.h: netinet_in.in.h $(top_builddir)/config.status + $(AM_V_at)$(MKDIR_P) netinet + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \ + -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \ + < $(srcdir)/netinet_in.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +netinet/in.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t +MOSTLYCLEANDIRS += netinet + +EXTRA_DIST += netinet_in.in.h + +## end gnulib module netinet_in + +## begin gnulib module netinet_in-tests + +TESTS += test-netinet_in +check_PROGRAMS += test-netinet_in +EXTRA_DIST += test-netinet_in.c + +## end gnulib module netinet_in-tests + +## begin gnulib module nl_langinfo-tests + +TESTS += test-nl_langinfo.sh +TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' +check_PROGRAMS += test-nl_langinfo +EXTRA_DIST += test-nl_langinfo.sh test-nl_langinfo.c signature.h macros.h + +## end gnulib module nl_langinfo-tests + +## begin gnulib module open-tests + +TESTS += test-open +check_PROGRAMS += test-open +EXTRA_DIST += test-open.h test-open.c signature.h macros.h + +## end gnulib module open-tests + +## begin gnulib module pathmax-tests + +TESTS += test-pathmax +check_PROGRAMS += test-pathmax +EXTRA_DIST += test-pathmax.c + +## end gnulib module pathmax-tests + +## begin gnulib module perror + + +EXTRA_DIST += perror.c + +EXTRA_libtests_a_SOURCES += perror.c + +## end gnulib module perror + +## begin gnulib module perror-tests + +TESTS += test-perror.sh test-perror2 +check_PROGRAMS += test-perror test-perror2 +EXTRA_DIST += macros.h signature.h test-perror.c test-perror2.c test-perror.sh + +## end gnulib module perror-tests + +## begin gnulib module pipe-posix + + +EXTRA_DIST += pipe.c + +EXTRA_libtests_a_SOURCES += pipe.c + +## end gnulib module pipe-posix + +## begin gnulib module pipe-posix-tests + +TESTS += test-pipe +check_PROGRAMS += test-pipe +EXTRA_DIST += test-pipe.c signature.h macros.h + +## end gnulib module pipe-posix-tests + +## begin gnulib module putenv + + +EXTRA_DIST += putenv.c + +EXTRA_libtests_a_SOURCES += putenv.c + +## end gnulib module putenv + +## begin gnulib module quotearg-simple-tests + +TESTS += test-quotearg-simple +check_PROGRAMS += test-quotearg-simple +test_quotearg_simple_LDADD = $(LDADD) @LIBINTL@ +EXTRA_DIST += test-quotearg-simple.c test-quotearg.h macros.h zerosize-ptr.h + +## end gnulib module quotearg-simple-tests + +## begin gnulib module raise-tests + +TESTS += test-raise +check_PROGRAMS += test-raise +EXTRA_DIST += test-raise.c signature.h macros.h + +## end gnulib module raise-tests + +## begin gnulib module rawmemchr-tests + +TESTS += test-rawmemchr +check_PROGRAMS += test-rawmemchr +EXTRA_DIST += test-rawmemchr.c zerosize-ptr.h signature.h macros.h + +## end gnulib module rawmemchr-tests + +## begin gnulib module readlink-tests + +TESTS += test-readlink +check_PROGRAMS += test-readlink +EXTRA_DIST += test-readlink.h test-readlink.c signature.h macros.h + +## end gnulib module readlink-tests + +## begin gnulib module regex-tests + +TESTS += test-regex +check_PROGRAMS += test-regex +test_regex_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD) $(LIB_PTHREAD) +EXTRA_DIST += test-regex.c macros.h + +## end gnulib module regex-tests + +## begin gnulib module same-inode + + +EXTRA_DIST += same-inode.h + +## end gnulib module same-inode + +## begin gnulib module select + + +EXTRA_DIST += select.c + +EXTRA_libtests_a_SOURCES += select.c + +## end gnulib module select + +## begin gnulib module select-tests + +TESTS += test-select test-select-in.sh test-select-out.sh +# test-select-stdin has to be run by hand. +check_PROGRAMS += test-select test-select-fd test-select-stdin +test_select_LDADD = $(LDADD) @LIB_SELECT@ @LIBSOCKET@ $(INET_PTON_LIB) +test_select_fd_LDADD = $(LDADD) @LIB_SELECT@ +test_select_stdin_LDADD = $(LDADD) @LIB_SELECT@ +EXTRA_DIST += macros.h signature.h test-select.c test-select.h test-select-fd.c test-select-in.sh test-select-out.sh test-select-stdin.c + +## end gnulib module select-tests + +## begin gnulib module setenv-tests + +TESTS += test-setenv +check_PROGRAMS += test-setenv +EXTRA_DIST += test-setenv.c signature.h macros.h + +## end gnulib module setenv-tests + +## begin gnulib module setlocale + + +EXTRA_DIST += setlocale.c + +EXTRA_libtests_a_SOURCES += setlocale.c + +## end gnulib module setlocale + +## begin gnulib module setlocale-tests + +TESTS += test-setlocale1.sh test-setlocale2.sh +TESTS_ENVIRONMENT += \ + LOCALE_FR='@LOCALE_FR@' \ + LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \ + LOCALE_JA='@LOCALE_JA@' \ + LOCALE_ZH_CN='@LOCALE_ZH_CN@' +check_PROGRAMS += test-setlocale1 test-setlocale2 +EXTRA_DIST += test-setlocale1.sh test-setlocale1.c test-setlocale2.sh test-setlocale2.c signature.h macros.h + +## end gnulib module setlocale-tests + +## begin gnulib module setsockopt + + +EXTRA_DIST += setsockopt.c w32sock.h + +EXTRA_libtests_a_SOURCES += setsockopt.c + +## end gnulib module setsockopt + +## begin gnulib module setsockopt-tests + +TESTS += test-setsockopt +check_PROGRAMS += test-setsockopt +test_setsockopt_LDADD = $(LDADD) @LIBSOCKET@ +EXTRA_DIST += test-setsockopt.c signature.h macros.h + +## end gnulib module setsockopt-tests + +## begin gnulib module sh-quote-tests + +TESTS += test-sh-quote +check_PROGRAMS += test-sh-quote +test_sh_quote_LDADD = $(LDADD) @LIBINTL@ +EXTRA_DIST += test-sh-quote.c + +## end gnulib module sh-quote-tests + +## begin gnulib module sigaction-tests + +TESTS += test-sigaction +check_PROGRAMS += test-sigaction +EXTRA_DIST += test-sigaction.c signature.h macros.h + +## end gnulib module sigaction-tests + +## begin gnulib module signal-h-tests + +TESTS += test-signal-h +check_PROGRAMS += test-signal-h +EXTRA_DIST += test-signal-h.c + +## end gnulib module signal-h-tests + +## begin gnulib module sigprocmask-tests + +TESTS += test-sigprocmask +check_PROGRAMS += test-sigprocmask +EXTRA_DIST += test-sigprocmask.c signature.h macros.h + +## end gnulib module sigprocmask-tests + +## begin gnulib module sleep + + +EXTRA_DIST += sleep.c + +EXTRA_libtests_a_SOURCES += sleep.c + +## end gnulib module sleep + +## begin gnulib module sleep-tests + +TESTS += test-sleep +check_PROGRAMS += test-sleep +EXTRA_DIST += test-sleep.c signature.h macros.h + +## end gnulib module sleep-tests + +## begin gnulib module snippet/_Noreturn + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. + +_NORETURN_H=$(srcdir)/_Noreturn.h + +EXTRA_DIST += _Noreturn.h + +## end gnulib module snippet/_Noreturn + +## begin gnulib module snippet/arg-nonnull + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. + +ARG_NONNULL_H=$(srcdir)/arg-nonnull.h + +EXTRA_DIST += arg-nonnull.h + +## end gnulib module snippet/arg-nonnull + +## begin gnulib module snippet/c++defs + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. + +CXXDEFS_H=$(srcdir)/c++defs.h + +EXTRA_DIST += c++defs.h + +## end gnulib module snippet/c++defs + +## begin gnulib module snippet/unused-parameter + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. + +UNUSED_PARAMETER_H=$(srcdir)/unused-parameter.h + +EXTRA_DIST += unused-parameter.h + +## end gnulib module snippet/unused-parameter + +## begin gnulib module snippet/warn-on-use + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. + +WARN_ON_USE_H=$(srcdir)/warn-on-use.h + +EXTRA_DIST += warn-on-use.h + +## end gnulib module snippet/warn-on-use + +## begin gnulib module snprintf + + +EXTRA_DIST += snprintf.c + +EXTRA_libtests_a_SOURCES += snprintf.c + +## end gnulib module snprintf + +## begin gnulib module snprintf-tests + +TESTS += test-snprintf +check_PROGRAMS += test-snprintf + +EXTRA_DIST += test-snprintf.c signature.h macros.h + +## end gnulib module snprintf-tests + +## begin gnulib module socket + + +EXTRA_DIST += socket.c w32sock.h + +EXTRA_libtests_a_SOURCES += socket.c + +## end gnulib module socket + +## begin gnulib module sockets + +libtests_a_SOURCES += sockets.h sockets.c + +EXTRA_DIST += w32sock.h + +## end gnulib module sockets + +## begin gnulib module sockets-tests + +TESTS += test-sockets +check_PROGRAMS += test-sockets +test_sockets_LDADD = $(LDADD) @LIBSOCKET@ +EXTRA_DIST += test-sockets.c + +## end gnulib module sockets-tests + +## begin gnulib module stat-tests + +TESTS += test-stat +check_PROGRAMS += test-stat +test_stat_LDADD = $(LDADD) $(LIBINTL) +EXTRA_DIST += test-stat.h test-stat.c signature.h macros.h + +## end gnulib module stat-tests + +## begin gnulib module stat-time-tests + +TESTS += test-stat-time +check_PROGRAMS += test-stat-time +test_stat_time_LDADD = $(LDADD) $(LIB_NANOSLEEP) +EXTRA_DIST += test-stat-time.c macros.h nap.h + +## end gnulib module stat-time-tests + +## begin gnulib module stdalign + +BUILT_SOURCES += $(STDALIGN_H) + +# We need the following in order to create <stdalign.h> when the system +# doesn't have one that works. +if GL_GENERATE_STDALIGN_H +stdalign.h: stdalign.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/stdalign.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +stdalign.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += stdalign.h stdalign.h-t + +EXTRA_DIST += stdalign.in.h + +## end gnulib module stdalign + +## begin gnulib module stdalign-tests + +TESTS += test-stdalign +check_PROGRAMS += test-stdalign +EXTRA_DIST += test-stdalign.c macros.h + +## end gnulib module stdalign-tests + +## begin gnulib module stdbool-tests + +TESTS += test-stdbool +check_PROGRAMS += test-stdbool +EXTRA_DIST += test-stdbool.c + +## end gnulib module stdbool-tests + +## begin gnulib module stddef-tests + +TESTS += test-stddef +check_PROGRAMS += test-stddef +EXTRA_DIST += test-stddef.c + +## end gnulib module stddef-tests + +## begin gnulib module stdint-tests + +TESTS += test-stdint +check_PROGRAMS += test-stdint +EXTRA_DIST += test-stdint.c + +## end gnulib module stdint-tests + +## begin gnulib module stdio-tests + +TESTS += test-stdio +check_PROGRAMS += test-stdio +EXTRA_DIST += test-stdio.c + +## end gnulib module stdio-tests + +## begin gnulib module stdlib-tests + +TESTS += test-stdlib +check_PROGRAMS += test-stdlib +EXTRA_DIST += test-stdlib.c test-sys_wait.h + +## end gnulib module stdlib-tests + +## begin gnulib module strerror-tests + +TESTS += test-strerror +check_PROGRAMS += test-strerror +EXTRA_DIST += test-strerror.c signature.h macros.h + +## end gnulib module strerror-tests + +## begin gnulib module strerror_r-posix + + +EXTRA_DIST += strerror_r.c + +EXTRA_libtests_a_SOURCES += strerror_r.c + +## end gnulib module strerror_r-posix + +## begin gnulib module strerror_r-posix-tests + +TESTS += test-strerror_r +check_PROGRAMS += test-strerror_r +EXTRA_DIST += test-strerror_r.c signature.h macros.h + +## end gnulib module strerror_r-posix-tests + +## begin gnulib module strftime-tests + +TESTS += test-strftime +check_PROGRAMS += test-strftime +EXTRA_DIST += test-strftime.c macros.h + +## end gnulib module strftime-tests + +## begin gnulib module striconv-tests + +TESTS += test-striconv +check_PROGRAMS += test-striconv +test_striconv_LDADD = $(LDADD) @LIBICONV@ + +EXTRA_DIST += test-striconv.c macros.h + +## end gnulib module striconv-tests + +## begin gnulib module string-tests + +TESTS += test-string +check_PROGRAMS += test-string +EXTRA_DIST += test-string.c + +## end gnulib module string-tests + +## begin gnulib module strings-tests + +TESTS += test-strings +check_PROGRAMS += test-strings +EXTRA_DIST += test-strings.c + +## end gnulib module strings-tests + +## begin gnulib module strnlen-tests + +TESTS += test-strnlen +check_PROGRAMS += test-strnlen +EXTRA_DIST += test-strnlen.c zerosize-ptr.h signature.h macros.h + +## end gnulib module strnlen-tests + +## begin gnulib module strtoull-tests + +TESTS += test-strtoull +check_PROGRAMS += test-strtoull +EXTRA_DIST += test-strtoull.c signature.h macros.h + +## end gnulib module strtoull-tests + +## begin gnulib module strtoumax-tests + +TESTS += test-strtoumax +check_PROGRAMS += test-strtoumax +EXTRA_DIST += test-strtoumax.c signature.h macros.h + +## end gnulib module strtoumax-tests + +## begin gnulib module symlink + + +EXTRA_DIST += symlink.c + +EXTRA_libtests_a_SOURCES += symlink.c + +## end gnulib module symlink + +## begin gnulib module symlink-tests + +TESTS += test-symlink +check_PROGRAMS += test-symlink +EXTRA_DIST += test-symlink.h test-symlink.c signature.h macros.h + +## end gnulib module symlink-tests + +## begin gnulib module sys_ioctl + +BUILT_SOURCES += sys/ioctl.h + +# We need the following in order to create <sys/ioctl.h> when the system +# does not have a complete one. +sys/ioctl.h: sys_ioctl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_SYS_IOCTL_H''@|$(HAVE_SYS_IOCTL_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_IOCTL_H''@|$(NEXT_SYS_IOCTL_H)|g' \ + -e 's/@''GNULIB_IOCTL''@/$(GNULIB_IOCTL)/g' \ + -e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H)|g' \ + -e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \ + -e 's|@''REPLACE_IOCTL''@|$(REPLACE_IOCTL)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_ioctl.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += sys/ioctl.h sys/ioctl.h-t +MOSTLYCLEANDIRS += sys + +EXTRA_DIST += sys_ioctl.in.h + +## end gnulib module sys_ioctl + +## begin gnulib module sys_ioctl-tests + +TESTS += test-sys_ioctl +check_PROGRAMS += test-sys_ioctl +EXTRA_DIST += test-sys_ioctl.c + +## end gnulib module sys_ioctl-tests + +## begin gnulib module sys_select + +BUILT_SOURCES += sys/select.h + +# We need the following in order to create <sys/select.h> when the system +# doesn't have one that works with the given compiler. +sys/select.h: sys_select.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_SELECT_H''@|$(NEXT_SYS_SELECT_H)|g' \ + -e 's|@''HAVE_SYS_SELECT_H''@|$(HAVE_SYS_SELECT_H)|g' \ + -e 's/@''GNULIB_PSELECT''@/$(GNULIB_PSELECT)/g' \ + -e 's/@''GNULIB_SELECT''@/$(GNULIB_SELECT)/g' \ + -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ + -e 's|@''HAVE_PSELECT''@|$(HAVE_PSELECT)|g' \ + -e 's|@''REPLACE_PSELECT''@|$(REPLACE_PSELECT)|g' \ + -e 's|@''REPLACE_SELECT''@|$(REPLACE_SELECT)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_select.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += sys/select.h sys/select.h-t +MOSTLYCLEANDIRS += sys + +EXTRA_DIST += sys_select.in.h + +## end gnulib module sys_select + +## begin gnulib module sys_select-tests + +TESTS += test-sys_select +check_PROGRAMS += test-sys_select +EXTRA_DIST += test-sys_select.c signature.h + +## end gnulib module sys_select-tests + +## begin gnulib module sys_socket + +BUILT_SOURCES += sys/socket.h +libtests_a_SOURCES += sys_socket.c + +# We need the following in order to create <sys/socket.h> when the system +# doesn't have one that works with the given compiler. +sys/socket.h: sys_socket.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \ + -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \ + -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \ + -e 's/@''GNULIB_SOCKET''@/$(GNULIB_SOCKET)/g' \ + -e 's/@''GNULIB_CONNECT''@/$(GNULIB_CONNECT)/g' \ + -e 's/@''GNULIB_ACCEPT''@/$(GNULIB_ACCEPT)/g' \ + -e 's/@''GNULIB_BIND''@/$(GNULIB_BIND)/g' \ + -e 's/@''GNULIB_GETPEERNAME''@/$(GNULIB_GETPEERNAME)/g' \ + -e 's/@''GNULIB_GETSOCKNAME''@/$(GNULIB_GETSOCKNAME)/g' \ + -e 's/@''GNULIB_GETSOCKOPT''@/$(GNULIB_GETSOCKOPT)/g' \ + -e 's/@''GNULIB_LISTEN''@/$(GNULIB_LISTEN)/g' \ + -e 's/@''GNULIB_RECV''@/$(GNULIB_RECV)/g' \ + -e 's/@''GNULIB_SEND''@/$(GNULIB_SEND)/g' \ + -e 's/@''GNULIB_RECVFROM''@/$(GNULIB_RECVFROM)/g' \ + -e 's/@''GNULIB_SENDTO''@/$(GNULIB_SENDTO)/g' \ + -e 's/@''GNULIB_SETSOCKOPT''@/$(GNULIB_SETSOCKOPT)/g' \ + -e 's/@''GNULIB_SHUTDOWN''@/$(GNULIB_SHUTDOWN)/g' \ + -e 's/@''GNULIB_ACCEPT4''@/$(GNULIB_ACCEPT4)/g' \ + -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ + -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \ + -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \ + -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY''@|$(HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)|g' \ + -e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \ + -e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_socket.in.h; \ + } > $@-t && \ + mv -f $@-t $@ +MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t +MOSTLYCLEANDIRS += sys + +EXTRA_DIST += sys_socket.in.h + +## end gnulib module sys_socket + +## begin gnulib module sys_socket-tests + +TESTS += test-sys_socket +check_PROGRAMS += test-sys_socket +EXTRA_DIST += test-sys_socket.c + +## end gnulib module sys_socket-tests + +## begin gnulib module sys_stat-tests + +TESTS += test-sys_stat +check_PROGRAMS += test-sys_stat +EXTRA_DIST += test-sys_stat.c + +## end gnulib module sys_stat-tests + +## begin gnulib module sys_time-tests + +TESTS += test-sys_time +check_PROGRAMS += test-sys_time +EXTRA_DIST += test-sys_time.c + +## end gnulib module sys_time-tests + +## begin gnulib module sys_types-tests + +TESTS += test-sys_types +check_PROGRAMS += test-sys_types +EXTRA_DIST += test-sys_types.c + +## end gnulib module sys_types-tests + +## begin gnulib module sys_uio + +BUILT_SOURCES += sys/uio.h + +# We need the following in order to create <sys/uio.h> when the system +# doesn't have one that works with the given compiler. +sys/uio.h: sys_uio.in.h $(top_builddir)/config.status + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_UIO_H''@|$(NEXT_SYS_UIO_H)|g' \ + -e 's|@''HAVE_SYS_UIO_H''@|$(HAVE_SYS_UIO_H)|g' \ + < $(srcdir)/sys_uio.in.h; \ + } > $@-t && \ + mv -f $@-t $@ +MOSTLYCLEANFILES += sys/uio.h sys/uio.h-t +MOSTLYCLEANDIRS += sys + +EXTRA_DIST += sys_uio.in.h + +## end gnulib module sys_uio + +## begin gnulib module sys_uio-tests + +TESTS += test-sys_uio +check_PROGRAMS += test-sys_uio +EXTRA_DIST += test-sys_uio.c + +## end gnulib module sys_uio-tests + +## begin gnulib module sys_wait-tests + +TESTS += test-sys_wait +check_PROGRAMS += test-sys_wait +EXTRA_DIST += test-sys_wait.c test-sys_wait.h + +## end gnulib module sys_wait-tests + +## begin gnulib module test-framework-sh-tests + +TESTS += test-init.sh +EXTRA_DIST += init.sh +EXTRA_DIST += test-init.sh + +## end gnulib module test-framework-sh-tests + +## begin gnulib module time-tests + +TESTS += test-time +check_PROGRAMS += test-time +EXTRA_DIST += test-time.c + +## end gnulib module time-tests + +## begin gnulib module timespec-add + +libtests_a_SOURCES += timespec-add.c + +## end gnulib module timespec-add + +## begin gnulib module timespec-sub + +libtests_a_SOURCES += timespec-sub.c + +## end gnulib module timespec-sub + +## begin gnulib module timespec-tests + +TESTS += test-timespec +check_PROGRAMS += test-timespec +EXTRA_DIST += test-timespec.c macros.h + +## end gnulib module timespec-tests + +## begin gnulib module unistd-tests + +TESTS += test-unistd +check_PROGRAMS += test-unistd +EXTRA_DIST += test-unistd.c + +## end gnulib module unistd-tests + +## begin gnulib module unistr/u8-mbtoucr-tests + +TESTS += test-u8-mbtoucr +check_PROGRAMS += test-u8-mbtoucr +test_u8_mbtoucr_SOURCES = unistr/test-u8-mbtoucr.c +test_u8_mbtoucr_LDADD = $(LDADD) $(LIBUNISTRING) +EXTRA_DIST += unistr/test-u8-mbtoucr.c macros.h + +## end gnulib module unistr/u8-mbtoucr-tests + +## begin gnulib module unistr/u8-uctomb-tests + +TESTS += test-u8-uctomb +check_PROGRAMS += test-u8-uctomb +test_u8_uctomb_SOURCES = unistr/test-u8-uctomb.c +test_u8_uctomb_LDADD = $(LDADD) $(LIBUNISTRING) +EXTRA_DIST += unistr/test-u8-uctomb.c macros.h + +## end gnulib module unistr/u8-uctomb-tests + +## begin gnulib module uniwidth/width-tests + +TESTS += test-uc_width uniwidth/test-uc_width2.sh +check_PROGRAMS += test-uc_width test-uc_width2 +test_uc_width_SOURCES = uniwidth/test-uc_width.c +test_uc_width_LDADD = $(LDADD) $(LIBUNISTRING) +test_uc_width2_SOURCES = uniwidth/test-uc_width2.c +test_uc_width2_LDADD = $(LDADD) $(LIBUNISTRING) +EXTRA_DIST += uniwidth/test-uc_width.c uniwidth/test-uc_width2.c uniwidth/test-uc_width2.sh macros.h + +## end gnulib module uniwidth/width-tests + +## begin gnulib module unsetenv-tests + +TESTS += test-unsetenv +check_PROGRAMS += test-unsetenv +EXTRA_DIST += test-unsetenv.c signature.h macros.h + +## end gnulib module unsetenv-tests + +## begin gnulib module update-copyright-tests + +TESTS += test-update-copyright.sh +TESTS_ENVIRONMENT += abs_aux_dir='$(abs_aux_dir)' +EXTRA_DIST += test-update-copyright.sh + +## end gnulib module update-copyright-tests + +## begin gnulib module vasnprintf-tests + +TESTS += test-vasnprintf +check_PROGRAMS += test-vasnprintf + +EXTRA_DIST += test-vasnprintf.c macros.h + +## end gnulib module vasnprintf-tests + +## begin gnulib module vasprintf-tests + +TESTS += test-vasprintf +check_PROGRAMS += test-vasprintf + +EXTRA_DIST += test-vasprintf.c signature.h macros.h + +## end gnulib module vasprintf-tests + +## begin gnulib module vc-list-files-tests + +TESTS += test-vc-list-files-git.sh +TESTS += test-vc-list-files-cvs.sh +TESTS_ENVIRONMENT += abs_aux_dir='$(abs_aux_dir)' +EXTRA_DIST += test-vc-list-files-git.sh test-vc-list-files-cvs.sh + +## end gnulib module vc-list-files-tests + +## begin gnulib module verify-tests + +TESTS_ENVIRONMENT += MAKE='$(MAKE)' +TESTS += test-verify test-verify.sh +check_PROGRAMS += test-verify +# test-verify-try is never built, but test-verify.sh needs a rule to +# build test-verify-try.o. +EXTRA_PROGRAMS += test-verify-try + +# This test expects compilation of test-verify-try.c to fail, and +# each time it fails, the makefile rule does not perform the usual +# "mv -f $name.Tpo $name.po, so tell make clean to remove that file. +MOSTLYCLEANFILES += .deps/test-verify-try.Tpo +EXTRA_DIST += test-verify.c test-verify-try.c test-verify.sh + +## end gnulib module verify-tests + +## begin gnulib module version-etc-tests + +TESTS += test-version-etc.sh +check_PROGRAMS += test-version-etc +test_version_etc_LDADD = $(LDADD) @LIBINTL@ +EXTRA_DIST += test-version-etc.c test-version-etc.sh + +## end gnulib module version-etc-tests + +## begin gnulib module wchar-tests + +TESTS += test-wchar +check_PROGRAMS += test-wchar +EXTRA_DIST += test-wchar.c + +## end gnulib module wchar-tests + +## begin gnulib module wcrtomb-tests + +TESTS += \ + test-wcrtomb.sh \ + test-wcrtomb-w32-1.sh test-wcrtomb-w32-2.sh test-wcrtomb-w32-3.sh \ + test-wcrtomb-w32-4.sh test-wcrtomb-w32-5.sh +TESTS_ENVIRONMENT += \ + LOCALE_FR='@LOCALE_FR@' \ + LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \ + LOCALE_JA='@LOCALE_JA@' \ + LOCALE_ZH_CN='@LOCALE_ZH_CN@' +check_PROGRAMS += test-wcrtomb test-wcrtomb-w32 + +EXTRA_DIST += test-wcrtomb.sh test-wcrtomb.c test-wcrtomb-w32-1.sh test-wcrtomb-w32-2.sh test-wcrtomb-w32-3.sh test-wcrtomb-w32-4.sh test-wcrtomb-w32-5.sh test-wcrtomb-w32.c signature.h macros.h + +## end gnulib module wcrtomb-tests + +## begin gnulib module wctob + + +EXTRA_DIST += wctob.c + +EXTRA_libtests_a_SOURCES += wctob.c + +## end gnulib module wctob + +## begin gnulib module wctomb + + +EXTRA_DIST += wctomb-impl.h wctomb.c + +EXTRA_libtests_a_SOURCES += wctomb.c + +## end gnulib module wctomb + +## begin gnulib module wctype-h-tests + +TESTS += test-wctype-h +check_PROGRAMS += test-wctype-h +EXTRA_DIST += test-wctype-h.c macros.h + +## end gnulib module wctype-h-tests + +## begin gnulib module wcwidth-tests + +TESTS += test-wcwidth +check_PROGRAMS += test-wcwidth +EXTRA_DIST += test-wcwidth.c signature.h macros.h + +## end gnulib module wcwidth-tests + +## begin gnulib module xalloc-die-tests + +TESTS += test-xalloc-die.sh +check_PROGRAMS += test-xalloc-die +test_xalloc_die_LDADD = $(LDADD) @LIBINTL@ +EXTRA_DIST += test-xalloc-die.c test-xalloc-die.sh + +## end gnulib module xalloc-die-tests + +## begin gnulib module xstrtol-tests + +TESTS += test-xstrtol.sh +check_PROGRAMS += test-xstrtol test-xstrtoul +test_xstrtol_LDADD = $(LDADD) @LIBINTL@ +test_xstrtoul_LDADD = $(LDADD) @LIBINTL@ +EXTRA_DIST += test-xstrtol.c test-xstrtoul.c test-xstrtol.sh + +## end gnulib module xstrtol-tests + +## begin gnulib module xstrtoumax-tests + +TESTS += test-xstrtoumax.sh +check_PROGRAMS += test-xstrtoumax +test_xstrtoumax_LDADD = $(LDADD) @LIBINTL@ +EXTRA_DIST += test-xstrtoumax.c test-xstrtoumax.sh + +## end gnulib module xstrtoumax-tests + +## begin gnulib module xvasprintf-tests + +TESTS += test-xvasprintf +check_PROGRAMS += test-xvasprintf +test_xvasprintf_LDADD = $(LDADD) @LIBINTL@ + +EXTRA_DIST += test-xvasprintf.c macros.h + +## end gnulib module xvasprintf-tests + +# Clean up after Solaris cc. +clean-local: + rm -rf SunWS_cache + +mostlyclean-local: mostlyclean-generic + @for dir in '' $(MOSTLYCLEANDIRS); do \ + if test -n "$$dir" && test -d $$dir; then \ + echo "rmdir $$dir"; rmdir $$dir; \ + fi; \ + done; \ + : diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/hash-pjw.c b/local/recipes/tools/diffutils/source/gnulib-tests/hash-pjw.c new file mode 100644 index 0000000000..a886b499c9 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/hash-pjw.c @@ -0,0 +1,40 @@ +/* hash-pjw.c -- compute a hash value from a NUL-terminated string. + + Copyright (C) 2001, 2003, 2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "hash-pjw.h" + +#include <limits.h> + +#define SIZE_BITS (sizeof (size_t) * CHAR_BIT) + +/* A hash function for NUL-terminated char* strings using + the method described by Bruno Haible. + See http://www.haible.de/bruno/hashfunc.html. */ + +size_t +hash_pjw (const void *x, size_t tablesize) +{ + const char *s; + size_t h = 0; + + for (s = x; *s; s++) + h = *s + ((h << 9) | (h >> (SIZE_BITS - 9))); + + return h % tablesize; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/hash-pjw.h b/local/recipes/tools/diffutils/source/gnulib-tests/hash-pjw.h new file mode 100644 index 0000000000..2e7d2307fd --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/hash-pjw.h @@ -0,0 +1,23 @@ +/* hash-pjw.h -- declaration for a simple hash function + Copyright (C) 2001, 2003, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <stddef.h> + +/* Compute a hash code for a NUL-terminated string starting at X, + and return the hash code modulo TABLESIZE. + The result is platform dependent: it depends on the size of the 'size_t' + type and on the signedness of the 'char' type. */ +extern size_t hash_pjw (void const *x, size_t tablesize) _GL_ATTRIBUTE_PURE; diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/inet_pton.c b/local/recipes/tools/diffutils/source/gnulib-tests/inet_pton.c new file mode 100644 index 0000000000..f730d84a0e --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/inet_pton.c @@ -0,0 +1,268 @@ +/* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form + + Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* + * Copyright (c) 1996,1999 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +#include <config.h> + +/* Specification. */ +#include <arpa/inet.h> + +#if HAVE_DECL_INET_PTON + +# undef inet_pton + +int +rpl_inet_pton (int af, const char *restrict src, void *restrict dst) +{ + return inet_pton (af, src, dst); +} + +#else + +# include <c-ctype.h> +# include <string.h> +# include <errno.h> + +# define NS_INADDRSZ 4 +# define NS_IN6ADDRSZ 16 +# define NS_INT16SZ 2 + +/* + * WARNING: Don't even consider trying to compile this on a system where + * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. + */ + +static int inet_pton4 (const char *src, unsigned char *dst); +# if HAVE_IPV6 +static int inet_pton6 (const char *src, unsigned char *dst); +# endif + +/* int + * inet_pton(af, src, dst) + * convert from presentation format (which usually means ASCII printable) + * to network format (which is usually some kind of binary format). + * return: + * 1 if the address was valid for the specified address family + * 0 if the address wasn't valid ('dst' is untouched in this case) + * -1 if some other error occurred ('dst' is untouched in this case, too) + * author: + * Paul Vixie, 1996. + */ +int +inet_pton (int af, const char *restrict src, void *restrict dst) +{ + switch (af) + { + case AF_INET: + return (inet_pton4 (src, dst)); + +# if HAVE_IPV6 + case AF_INET6: + return (inet_pton6 (src, dst)); +# endif + + default: + errno = EAFNOSUPPORT; + return (-1); + } + /* NOTREACHED */ +} + +/* int + * inet_pton4(src, dst) + * like inet_aton() but without all the hexadecimal, octal (with the + * exception of 0) and shorthand. + * return: + * 1 if 'src' is a valid dotted quad, else 0. + * notice: + * does not touch 'dst' unless it's returning 1. + * author: + * Paul Vixie, 1996. + */ +static int +inet_pton4 (const char *restrict src, unsigned char *restrict dst) +{ + int saw_digit, octets, ch; + unsigned char tmp[NS_INADDRSZ], *tp; + + saw_digit = 0; + octets = 0; + *(tp = tmp) = 0; + while ((ch = *src++) != '\0') + { + + if (ch >= '0' && ch <= '9') + { + unsigned new = *tp * 10 + (ch - '0'); + + if (saw_digit && *tp == 0) + return (0); + if (new > 255) + return (0); + *tp = new; + if (!saw_digit) + { + if (++octets > 4) + return (0); + saw_digit = 1; + } + } + else if (ch == '.' && saw_digit) + { + if (octets == 4) + return (0); + *++tp = 0; + saw_digit = 0; + } + else + return (0); + } + if (octets < 4) + return (0); + memcpy (dst, tmp, NS_INADDRSZ); + return (1); +} + +# if HAVE_IPV6 + +/* int + * inet_pton6(src, dst) + * convert presentation level address to network order binary form. + * return: + * 1 if 'src' is a valid [RFC1884 2.2] address, else 0. + * notice: + * (1) does not touch 'dst' unless it's returning 1. + * (2) :: in a full address is silently ignored. + * credit: + * inspired by Mark Andrews. + * author: + * Paul Vixie, 1996. + */ +static int +inet_pton6 (const char *restrict src, unsigned char *restrict dst) +{ + static const char xdigits[] = "0123456789abcdef"; + unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; + const char *curtok; + int ch, saw_xdigit; + unsigned val; + + tp = memset (tmp, '\0', NS_IN6ADDRSZ); + endp = tp + NS_IN6ADDRSZ; + colonp = NULL; + /* Leading :: requires some special handling. */ + if (*src == ':') + if (*++src != ':') + return (0); + curtok = src; + saw_xdigit = 0; + val = 0; + while ((ch = c_tolower (*src++)) != '\0') + { + const char *pch; + + pch = strchr (xdigits, ch); + if (pch != NULL) + { + val <<= 4; + val |= (pch - xdigits); + if (val > 0xffff) + return (0); + saw_xdigit = 1; + continue; + } + if (ch == ':') + { + curtok = src; + if (!saw_xdigit) + { + if (colonp) + return (0); + colonp = tp; + continue; + } + else if (*src == '\0') + { + return (0); + } + if (tp + NS_INT16SZ > endp) + return (0); + *tp++ = (u_char) (val >> 8) & 0xff; + *tp++ = (u_char) val & 0xff; + saw_xdigit = 0; + val = 0; + continue; + } + if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) && + inet_pton4 (curtok, tp) > 0) + { + tp += NS_INADDRSZ; + saw_xdigit = 0; + break; /* '\0' was seen by inet_pton4(). */ + } + return (0); + } + if (saw_xdigit) + { + if (tp + NS_INT16SZ > endp) + return (0); + *tp++ = (u_char) (val >> 8) & 0xff; + *tp++ = (u_char) val & 0xff; + } + if (colonp != NULL) + { + /* + * Since some memmove()'s erroneously fail to handle + * overlapping regions, we'll do the shift by hand. + */ + const int n = tp - colonp; + int i; + + if (tp == endp) + return (0); + for (i = 1; i <= n; i++) + { + endp[-i] = colonp[n - i]; + colonp[n - i] = 0; + } + tp = endp; + } + if (tp != endp) + return (0); + memcpy (dst, tmp, NS_IN6ADDRSZ); + return (1); +} + +# endif + +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/init.sh b/local/recipes/tools/diffutils/source/gnulib-tests/init.sh new file mode 100644 index 0000000000..584194f0e8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/init.sh @@ -0,0 +1,605 @@ +# source this file; set up for tests + +# Copyright (C) 2009-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Using this file in a test +# ========================= +# +# The typical skeleton of a test looks like this: +# +# #!/bin/sh +# . "${srcdir=.}/init.sh"; path_prepend_ . +# Execute some commands. +# Note that these commands are executed in a subdirectory, therefore you +# need to prepend "../" to relative filenames in the build directory. +# Note that the "path_prepend_ ." is useful only if the body of your +# test invokes programs residing in the initial directory. +# For example, if the programs you want to test are in src/, and this test +# script is named tests/test-1, then you would use "path_prepend_ ../src", +# or perhaps export PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH" +# to all tests via automake's TESTS_ENVIRONMENT. +# Set the exit code 0 for success, 77 for skipped, or 1 or other for failure. +# Use the skip_ and fail_ functions to print a diagnostic and then exit +# with the corresponding exit code. +# Exit $? + +# Executing a test that uses this file +# ==================================== +# +# Running a single test: +# $ make check TESTS=test-foo.sh +# +# Running a single test, with verbose output: +# $ make check TESTS=test-foo.sh VERBOSE=yes +# +# Running a single test, keeping the temporary directory: +# $ make check TESTS=test-foo.sh KEEP=yes +# +# Running a single test, with single-stepping: +# 1. Go into a sub-shell: +# $ bash +# 2. Set relevant environment variables from TESTS_ENVIRONMENT in the +# Makefile: +# $ export srcdir=../../tests # this is an example +# 3. Execute the commands from the test, copy&pasting them one by one: +# $ . "$srcdir/init.sh"; path_prepend_ . +# ... +# 4. Finally +# $ exit + +ME_=`expr "./$0" : '.*/\(.*\)$'` + +# We use a trap below for cleanup. This requires us to go through +# hoops to get the right exit status transported through the handler. +# So use 'Exit STATUS' instead of 'exit STATUS' inside of the tests. +# Turn off errexit here so that we don't trip the bug with OSF1/Tru64 +# sh inside this function. +Exit () { set +e; (exit $1); exit $1; } + +# Print warnings (e.g., about skipped and failed tests) to this file number. +# Override by defining to say, 9, in init.cfg, and putting say, +# export ...ENVVAR_SETTINGS...; $(SHELL) 9>&2 +# in the definition of TESTS_ENVIRONMENT in your tests/Makefile.am file. +# This is useful when using automake's parallel tests mode, to print +# the reason for skip/failure to console, rather than to the .log files. +: ${stderr_fileno_=2} + +# Note that correct expansion of "$*" depends on IFS starting with ' '. +# Always write the full diagnostic to stderr. +# When stderr_fileno_ is not 2, also emit the first line of the +# diagnostic to that file descriptor. +warn_ () +{ + # If IFS does not start with ' ', set it and emit the warning in a subshell. + case $IFS in + ' '*) printf '%s\n' "$*" >&2 + test $stderr_fileno_ = 2 \ + || { printf '%s\n' "$*" | sed 1q >&$stderr_fileno_ ; } ;; + *) (IFS=' '; warn_ "$@");; + esac +} +fail_ () { warn_ "$ME_: failed test: $@"; Exit 1; } +skip_ () { warn_ "$ME_: skipped test: $@"; Exit 77; } +fatal_ () { warn_ "$ME_: hard error: $@"; Exit 99; } +framework_failure_ () { warn_ "$ME_: set-up failure: $@"; Exit 99; } + +# This is used to simplify checking of the return value +# which is useful when ensuring a command fails as desired. +# I.e., just doing `command ... &&fail=1` will not catch +# a segfault in command for example. With this helper you +# instead check an explicit exit code like +# returns_ 1 command ... || fail +returns_ () { + # Disable tracing so it doesn't interfere with stderr of the wrapped command + { set +x; } 2>/dev/null + + local exp_exit="$1" + shift + "$@" + test $? -eq $exp_exit && ret_=0 || ret_=1 + + if test "$VERBOSE" = yes && test "$gl_set_x_corrupts_stderr_" = false; then + set -x + fi + { return $ret_; } 2>/dev/null +} + +# Sanitize this shell to POSIX mode, if possible. +DUALCASE=1; export DUALCASE +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; + esac +fi + +# We require $(...) support unconditionally. +# We require non-surprising "local" semantics (this eliminates dash). +# This takes the admittedly draconian step of eliminating dash, because the +# assignment tab=$(printf '\t') works fine, yet preceding it with "local " +# transforms it into an assignment that sets the variable to the empty string. +# That is too counter-intuitive, and can lead to subtle run-time malfunction. +# The example below is less subtle in that with dash, it evokes the run-time +# exception "dash: 1: local: 1: bad variable name". +# We require a few additional shell features only when $EXEEXT is nonempty, +# in order to support automatic $EXEEXT emulation: +# - hyphen-containing alias names +# - we prefer to use ${var#...} substitution, rather than having +# to work around lack of support for that feature. +# The following code attempts to find a shell with support for these features. +# If the current shell passes the test, we're done. Otherwise, test other +# shells until we find one that passes. If one is found, re-exec it. +# If no acceptable shell is found, skip the current test. +# +# The "...set -x; P=1 true 2>err..." test is to disqualify any shell that +# emits "P=1" into err, as /bin/sh from SunOS 5.11 and OpenBSD 4.7 do. +# +# Use "9" to indicate success (rather than 0), in case some shell acts +# like Solaris 10's /bin/sh but exits successfully instead of with status 2. + +# Eval this code in a subshell to determine a shell's suitability. +# 10 - passes all tests; ok to use +# 9 - ok, but enabling "set -x" corrupts app stderr; prefer higher score +# ? - not ok +gl_shell_test_script_=' +test $(echo y) = y || exit 1 +f_local_() { local v=1; }; f_local_ || exit 1 +f_dash_local_fail_() { local t=$(printf " 1"); }; f_dash_local_fail_ +score_=10 +if test "$VERBOSE" = yes; then + test -n "$( (exec 3>&1; set -x; P=1 true 2>&3) 2> /dev/null)" && score_=9 +fi +test -z "$EXEEXT" && exit $score_ +shopt -s expand_aliases +alias a-b="echo zoo" +v=abx + test ${v%x} = ab \ + && test ${v#a} = bx \ + && test $(a-b) = zoo \ + && exit $score_ +' + +if test "x$1" = "x--no-reexec"; then + shift +else + # Assume a working shell. Export to subshells (setup_ needs this). + gl_set_x_corrupts_stderr_=false + export gl_set_x_corrupts_stderr_ + + # Record the first marginally acceptable shell. + marginal_= + + # Search for a shell that meets our requirements. + for re_shell_ in __current__ "${CONFIG_SHELL:-no_shell}" \ + /bin/sh bash dash zsh pdksh fail + do + test "$re_shell_" = no_shell && continue + + # If we've made it all the way to the sentinel, "fail" without + # finding even a marginal shell, skip this test. + if test "$re_shell_" = fail; then + test -z "$marginal_" && skip_ failed to find an adequate shell + re_shell_=$marginal_ + break + fi + + # When testing the current shell, simply "eval" the test code. + # Otherwise, run it via $re_shell_ -c ... + if test "$re_shell_" = __current__; then + # 'eval'ing this code makes Solaris 10's /bin/sh exit with + # $? set to 2. It does not evaluate any of the code after the + # "unexpected" first '('. Thus, we must run it in a subshell. + ( eval "$gl_shell_test_script_" ) > /dev/null 2>&1 + else + "$re_shell_" -c "$gl_shell_test_script_" 2>/dev/null + fi + + st_=$? + + # $re_shell_ works just fine. Use it. + if test $st_ = 10; then + gl_set_x_corrupts_stderr_=false + break + fi + + # If this is our first marginally acceptable shell, remember it. + if test "$st_:$marginal_" = 9: ; then + marginal_="$re_shell_" + gl_set_x_corrupts_stderr_=true + fi + done + + if test "$re_shell_" != __current__; then + # Found a usable shell. Preserve -v and -x. + case $- in + *v*x* | *x*v*) opts_=-vx ;; + *v*) opts_=-v ;; + *x*) opts_=-x ;; + *) opts_= ;; + esac + re_shell=$re_shell_ + export re_shell + exec "$re_shell_" $opts_ "$0" --no-reexec "$@" + echo "$ME_: exec failed" 1>&2 + exit 127 + fi +fi + +# If this is bash, turn off all aliases. +test -n "$BASH_VERSION" && unalias -a + +# Note that when supporting $EXEEXT (transparently mapping from PROG_NAME to +# PROG_NAME.exe), we want to support hyphen-containing names like test-acos. +# That is part of the shell-selection test above. Why use aliases rather +# than functions? Because support for hyphen-containing aliases is more +# widespread than that for hyphen-containing function names. +test -n "$EXEEXT" && shopt -s expand_aliases + +# Enable glibc's malloc-perturbing option. +# This is useful for exposing code that depends on the fact that +# malloc-related functions often return memory that is mostly zeroed. +# If you have the time and cycles, use valgrind to do an even better job. +: ${MALLOC_PERTURB_=87} +export MALLOC_PERTURB_ + +# This is a stub function that is run upon trap (upon regular exit and +# interrupt). Override it with a per-test function, e.g., to unmount +# a partition, or to undo any other global state changes. +cleanup_ () { :; } + +# Emit a header similar to that from diff -u; Print the simulated "diff" +# command so that the order of arguments is clear. Don't bother with @@ lines. +emit_diff_u_header_ () +{ + printf '%s\n' "diff -u $*" \ + "--- $1 1970-01-01" \ + "+++ $2 1970-01-01" +} + +# Arrange not to let diff or cmp operate on /dev/null, +# since on some systems (at least OSF/1 5.1), that doesn't work. +# When there are not two arguments, or no argument is /dev/null, return 2. +# When one argument is /dev/null and the other is not empty, +# cat the nonempty file to stderr and return 1. +# Otherwise, return 0. +compare_dev_null_ () +{ + test $# = 2 || return 2 + + if test "x$1" = x/dev/null; then + test -s "$2" || return 0 + emit_diff_u_header_ "$@"; sed 's/^/+/' "$2" + return 1 + fi + + if test "x$2" = x/dev/null; then + test -s "$1" || return 0 + emit_diff_u_header_ "$@"; sed 's/^/-/' "$1" + return 1 + fi + + return 2 +} + +for diff_opt_ in -u -U3 -c '' no; do + test "$diff_opt_" != no && + diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" < /dev/null` && + break +done +if test "$diff_opt_" != no; then + if test -z "$diff_out_"; then + compare_ () { diff $diff_opt_ "$@"; } + else + compare_ () + { + # If no differences were found, AIX and HP-UX 'diff' produce output + # like "No differences encountered". Hide this output. + diff $diff_opt_ "$@" > diff.out + diff_status_=$? + test $diff_status_ -eq 0 || cat diff.out || diff_status_=2 + rm -f diff.out || diff_status_=2 + return $diff_status_ + } + fi +elif cmp -s /dev/null /dev/null 2>/dev/null; then + compare_ () { cmp -s "$@"; } +else + compare_ () { cmp "$@"; } +fi + +# Usage: compare EXPECTED ACTUAL +# +# Given compare_dev_null_'s preprocessing, defer to compare_ if 2 or more. +# Otherwise, propagate $? to caller: any diffs have already been printed. +compare () +{ + # This looks like it can be factored to use a simple "case $?" + # after unchecked compare_dev_null_ invocation, but that would + # fail in a "set -e" environment. + if compare_dev_null_ "$@"; then + return 0 + else + case $? in + 1) return 1;; + *) compare_ "$@";; + esac + fi +} + +# An arbitrary prefix to help distinguish test directories. +testdir_prefix_ () { printf gt; } + +# Run the user-overridable cleanup_ function, remove the temporary +# directory and exit with the incoming value of $?. +remove_tmp_ () +{ + __st=$? + cleanup_ + if test "$KEEP" = yes; then + echo "Not removing temporary directory $test_dir_" + else + # cd out of the directory we're about to remove + cd "$initial_cwd_" || cd / || cd /tmp + chmod -R u+rwx "$test_dir_" + # If removal fails and exit status was to be 0, then change it to 1. + rm -rf "$test_dir_" || { test $__st = 0 && __st=1; } + fi + exit $__st +} + +# Given a directory name, DIR, if every entry in it that matches *.exe +# contains only the specified bytes (see the case stmt below), then print +# a space-separated list of those names and return 0. Otherwise, don't +# print anything and return 1. Naming constraints apply also to DIR. +find_exe_basenames_ () +{ + feb_dir_=$1 + feb_fail_=0 + feb_result_= + feb_sp_= + for feb_file_ in $feb_dir_/*.exe; do + # If there was no *.exe file, or there existed a file named "*.exe" that + # was deleted between the above glob expansion and the existence test + # below, just skip it. + test "x$feb_file_" = "x$feb_dir_/*.exe" && test ! -f "$feb_file_" \ + && continue + # Exempt [.exe, since we can't create a function by that name, yet + # we can't invoke [ by PATH search anyways due to shell builtins. + test "x$feb_file_" = "x$feb_dir_/[.exe" && continue + case $feb_file_ in + *[!-a-zA-Z/0-9_.+]*) feb_fail_=1; break;; + *) # Remove leading file name components as well as the .exe suffix. + feb_file_=${feb_file_##*/} + feb_file_=${feb_file_%.exe} + feb_result_="$feb_result_$feb_sp_$feb_file_";; + esac + feb_sp_=' ' + done + test $feb_fail_ = 0 && printf %s "$feb_result_" + return $feb_fail_ +} + +# Consider the files in directory, $1. +# For each file name of the form PROG.exe, create an alias named +# PROG that simply invokes PROG.exe, then return 0. If any selected +# file name or the directory name, $1, contains an unexpected character, +# define no alias and return 1. +create_exe_shims_ () +{ + case $EXEEXT in + '') return 0 ;; + .exe) ;; + *) echo "$0: unexpected \$EXEEXT value: $EXEEXT" 1>&2; return 1 ;; + esac + + base_names_=`find_exe_basenames_ $1` \ + || { echo "$0 (exe_shim): skipping directory: $1" 1>&2; return 0; } + + if test -n "$base_names_"; then + for base_ in $base_names_; do + alias "$base_"="$base_$EXEEXT" + done + fi + + return 0 +} + +# Use this function to prepend to PATH an absolute name for each +# specified, possibly-$initial_cwd_-relative, directory. +path_prepend_ () +{ + while test $# != 0; do + path_dir_=$1 + case $path_dir_ in + '') fail_ "invalid path dir: '$1'";; + /*) abs_path_dir_=$path_dir_;; + *) abs_path_dir_=$initial_cwd_/$path_dir_;; + esac + case $abs_path_dir_ in + *:*) fail_ "invalid path dir: '$abs_path_dir_'";; + esac + PATH="$abs_path_dir_:$PATH" + + # Create an alias, FOO, for each FOO.exe in this directory. + create_exe_shims_ "$abs_path_dir_" \ + || fail_ "something failed (above): $abs_path_dir_" + shift + done + export PATH +} + +setup_ () +{ + if test "$VERBOSE" = yes; then + # Test whether set -x may cause the selected shell to corrupt an + # application's stderr. Many do, including zsh-4.3.10 and the /bin/sh + # from SunOS 5.11, OpenBSD 4.7 and Irix 5.x and 6.5. + # If enabling verbose output this way would cause trouble, simply + # issue a warning and refrain. + if $gl_set_x_corrupts_stderr_; then + warn_ "using SHELL=$SHELL with 'set -x' corrupts stderr" + else + set -x + fi + fi + + initial_cwd_=$PWD + + pfx_=`testdir_prefix_` + test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \ + || fail_ "failed to create temporary directory in $initial_cwd_" + cd "$test_dir_" || fail_ "failed to cd to temporary directory" + + # As autoconf-generated configure scripts do, ensure that IFS + # is defined initially, so that saving and restoring $IFS works. + gl_init_sh_nl_=' +' + IFS=" "" $gl_init_sh_nl_" + + # This trap statement, along with a trap on 0 below, ensure that the + # temporary directory, $test_dir_, is removed upon exit as well as + # upon receipt of any of the listed signals. + for sig_ in 1 2 3 13 15; do + eval "trap 'Exit $(expr $sig_ + 128)' $sig_" + done +} + +# Create a temporary directory, much like mktemp -d does. +# Written by Jim Meyering. +# +# Usage: mktempd_ /tmp phoey.XXXXXXXXXX +# +# First, try to use the mktemp program. +# Failing that, we'll roll our own mktemp-like function: +# - try to get random bytes from /dev/urandom +# - failing that, generate output from a combination of quickly-varying +# sources and gzip. Ignore non-varying gzip header, and extract +# "random" bits from there. +# - given those bits, map to file-name bytes using tr, and try to create +# the desired directory. +# - make only $MAX_TRIES_ attempts + +# Helper function. Print $N pseudo-random bytes from a-zA-Z0-9. +rand_bytes_ () +{ + n_=$1 + + # Maybe try openssl rand -base64 $n_prime_|tr '+/=\012' abcd first? + # But if they have openssl, they probably have mktemp, too. + + chars_=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 + dev_rand_=/dev/urandom + if test -r "$dev_rand_"; then + # Note: 256-length($chars_) == 194; 3 copies of $chars_ is 186 + 8 = 194. + dd ibs=$n_ count=1 if=$dev_rand_ 2>/dev/null \ + | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_ + return + fi + + n_plus_50_=`expr $n_ + 50` + cmds_='date; date +%N; free; who -a; w; ps auxww; ps ef; netstat -n' + data_=` (eval "$cmds_") 2>&1 | gzip ` + + # Ensure that $data_ has length at least 50+$n_ + while :; do + len_=`echo "$data_"|wc -c` + test $n_plus_50_ -le $len_ && break; + data_=` (echo "$data_"; eval "$cmds_") 2>&1 | gzip ` + done + + echo "$data_" \ + | dd bs=1 skip=50 count=$n_ 2>/dev/null \ + | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_ +} + +mktempd_ () +{ + case $# in + 2);; + *) fail_ "Usage: mktempd_ DIR TEMPLATE";; + esac + + destdir_=$1 + template_=$2 + + MAX_TRIES_=4 + + # Disallow any trailing slash on specified destdir: + # it would subvert the post-mktemp "case"-based destdir test. + case $destdir_ in + / | //) destdir_slash_=$destdir;; + */) fail_ "invalid destination dir: remove trailing slash(es)";; + *) destdir_slash_=$destdir_/;; + esac + + case $template_ in + *XXXX) ;; + *) fail_ \ + "invalid template: $template_ (must have a suffix of at least 4 X's)";; + esac + + # First, try to use mktemp. + d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` && + + # The resulting name must be in the specified directory. + case $d in "$destdir_slash_"*) :;; *) false;; esac && + + # It must have created the directory. + test -d "$d" && + + # It must have 0700 permissions. Handle sticky "S" bits. + perms=`ls -dgo "$d" 2>/dev/null` && + case $perms in drwx--[-S]---*) :;; *) false;; esac && { + echo "$d" + return + } + + # If we reach this point, we'll have to create a directory manually. + + # Get a copy of the template without its suffix of X's. + base_template_=`echo "$template_"|sed 's/XX*$//'` + + # Calculate how many X's we've just removed. + template_length_=`echo "$template_" | wc -c` + nx_=`echo "$base_template_" | wc -c` + nx_=`expr $template_length_ - $nx_` + + err_= + i_=1 + while :; do + X_=`rand_bytes_ $nx_` + candidate_dir_="$destdir_slash_$base_template_$X_" + err_=`mkdir -m 0700 "$candidate_dir_" 2>&1` \ + && { echo "$candidate_dir_"; return; } + test $MAX_TRIES_ -le $i_ && break; + i_=`expr $i_ + 1` + done + fail_ "$err_" +} + +# If you want to override the testdir_prefix_ function, +# or to add more utility functions, use this file. +test -f "$srcdir/init.cfg" \ + && . "$srcdir/init.cfg" + +setup_ "$@" +# This trap is here, rather than in the setup_ function, because some +# shells run the exit trap at shell function exit, rather than script exit. +trap remove_tmp_ 0 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/ioctl.c b/local/recipes/tools/diffutils/source/gnulib-tests/ioctl.c new file mode 100644 index 0000000000..f1425589cf --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/ioctl.c @@ -0,0 +1,92 @@ +/* ioctl.c --- wrappers for Windows ioctl function + + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paolo Bonzini */ + +#include <config.h> + +#include <sys/ioctl.h> + +#include <stdarg.h> + +#if HAVE_IOCTL + +/* Provide a wrapper with the POSIX prototype. */ +# undef ioctl +int +rpl_ioctl (int fd, int request, ... /* {void *,char *} arg */) +{ + void *buf; + va_list args; + + va_start (args, request); + buf = va_arg (args, void *); + va_end (args); + + /* Cast 'request' so that when the system's ioctl function takes a 64-bit + request argument, the value gets zero-extended, not sign-extended. */ + return ioctl (fd, (unsigned int) request, buf); +} + +#else /* mingw */ + +# include <errno.h> + +/* Get HANDLE. */ +# define WIN32_LEAN_AND_MEAN +# include <windows.h> + +# include "fd-hook.h" +/* Get _get_osfhandle. */ +# if GNULIB_MSVC_NOTHROW +# include "msvc-nothrow.h" +# else +# include <io.h> +# endif + +static int +primary_ioctl (int fd, int request, void *arg) +{ + /* We don't support FIONBIO on pipes here. If you want to make pipe + fds non-blocking, use the gnulib 'nonblocking' module, until + gnulib implements fcntl F_GETFL / F_SETFL with O_NONBLOCK. */ + + if ((HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE) + errno = ENOSYS; + else + errno = EBADF; + return -1; +} + +int +ioctl (int fd, int request, ... /* {void *,char *} arg */) +{ + void *arg; + va_list args; + + va_start (args, request); + arg = va_arg (args, void *); + va_end (args); + +# if WINDOWS_SOCKETS + return execute_all_ioctl_hooks (primary_ioctl, fd, request, arg); +# else + return primary_ioctl (fd, request, arg); +# endif +} + +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/listen.c b/local/recipes/tools/diffutils/source/gnulib-tests/listen.c new file mode 100644 index 0000000000..81936f03ce --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/listen.c @@ -0,0 +1,49 @@ +/* listen.c --- wrappers for Windows listen function + + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paolo Bonzini */ + +#include <config.h> + +#define WIN32_LEAN_AND_MEAN +/* Get winsock2.h. */ +#include <sys/socket.h> + +/* Get set_winsock_errno, FD_TO_SOCKET etc. */ +#include "w32sock.h" + +#undef listen + +int +rpl_listen (int fd, int backlog) +{ + SOCKET sock = FD_TO_SOCKET (fd); + + if (sock == INVALID_SOCKET) + { + errno = EBADF; + return -1; + } + else + { + int r = listen (sock, backlog); + if (r < 0) + set_winsock_errno (); + + return r; + } +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/macros.h b/local/recipes/tools/diffutils/source/gnulib-tests/macros.h new file mode 100644 index 0000000000..0423d06104 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/macros.h @@ -0,0 +1,81 @@ +/* Common macros used by gnulib tests. + Copyright (C) 2006-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + + +/* This file contains macros that are used by many gnulib tests. + Put here only frequently used macros, say, used by 10 tests or more. */ + +#include <stdio.h> +#include <stdlib.h> + +#ifndef FALLTHROUGH +# if __GNUC__ < 7 +# define FALLTHROUGH ((void) 0) +# else +# define FALLTHROUGH __attribute__ ((__fallthrough__)) +# endif +#endif + +/* Define ASSERT_STREAM before including this file if ASSERT must + target a stream other than stderr. */ +#ifndef ASSERT_STREAM +# define ASSERT_STREAM stderr +#endif + +/* ASSERT (condition); + verifies that the specified condition is fulfilled. If not, a message + is printed to ASSERT_STREAM if defined (defaulting to stderr if + undefined) and the program is terminated with an error code. + + This macro has the following properties: + - The programmer specifies the expected condition, not the failure + condition. This simplifies thinking. + - The condition is tested always, regardless of compilation flags. + (Unlike the macro from <assert.h>.) + - On Unix platforms, the tester can debug the test program with a + debugger (provided core dumps are enabled: "ulimit -c unlimited"). + - For the sake of platforms where no debugger is available (such as + some mingw systems), an error message is printed on the error + stream that includes the source location of the ASSERT invocation. + */ +#define ASSERT(expr) \ + do \ + { \ + if (!(expr)) \ + { \ + fprintf (ASSERT_STREAM, "%s:%d: assertion '%s' failed\n", \ + __FILE__, __LINE__, #expr); \ + fflush (ASSERT_STREAM); \ + abort (); \ + } \ + } \ + while (0) + +/* SIZEOF (array) + returns the number of elements of an array. It works for arrays that are + declared outside functions and for local variables of array type. It does + *not* work for function parameters of array type, because they are actually + parameters of pointer type. */ +#define SIZEOF(array) (sizeof (array) / sizeof (array[0])) + +/* STREQ (str1, str2) + Return true if two strings compare equal. */ +#define STREQ(a, b) (strcmp (a, b) == 0) + +/* Some numbers in the interval [0,1). */ +extern const float randomf[1000]; +extern const double randomd[1000]; +extern const long double randoml[1000]; diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/nanosleep.c b/local/recipes/tools/diffutils/source/gnulib-tests/nanosleep.c new file mode 100644 index 0000000000..4f65802ebe --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/nanosleep.c @@ -0,0 +1,276 @@ +/* Provide a replacement for the POSIX nanosleep function. + + Copyright (C) 1999-2000, 2002, 2004-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* written by Jim Meyering + and Bruno Haible for the native Windows part */ + +#include <config.h> + +#include <time.h> + +#include "intprops.h" +#include "sig-handler.h" +#include "verify.h" + +#include <stdbool.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/select.h> +#include <signal.h> + +#include <sys/time.h> +#include <errno.h> + +#include <unistd.h> + + +enum { BILLION = 1000 * 1000 * 1000 }; + +#if HAVE_BUG_BIG_NANOSLEEP + +int +nanosleep (const struct timespec *requested_delay, + struct timespec *remaining_delay) +# undef nanosleep +{ + /* nanosleep mishandles large sleeps due to internal overflow problems. + The worst known case of this is Linux 2.6.9 with glibc 2.3.4, which + can't sleep more than 24.85 days (2^31 milliseconds). Similarly, + cygwin 1.5.x, which can't sleep more than 49.7 days (2^32 milliseconds). + Solve this by breaking the sleep up into smaller chunks. */ + + if (requested_delay->tv_nsec < 0 || BILLION <= requested_delay->tv_nsec) + { + errno = EINVAL; + return -1; + } + + { + /* Verify that time_t is large enough. */ + verify (TYPE_MAXIMUM (time_t) / 24 / 24 / 60 / 60); + const time_t limit = 24 * 24 * 60 * 60; + time_t seconds = requested_delay->tv_sec; + struct timespec intermediate; + intermediate.tv_nsec = requested_delay->tv_nsec; + + while (limit < seconds) + { + int result; + intermediate.tv_sec = limit; + result = nanosleep (&intermediate, remaining_delay); + seconds -= limit; + if (result) + { + if (remaining_delay) + remaining_delay->tv_sec += seconds; + return result; + } + intermediate.tv_nsec = 0; + } + intermediate.tv_sec = seconds; + return nanosleep (&intermediate, remaining_delay); + } +} + +#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Native Windows platforms. */ + +# define WIN32_LEAN_AND_MEAN +# include <windows.h> + +/* The Windows API function Sleep() has a resolution of about 15 ms and takes + at least 5 ms to execute. We use this function for longer time periods. + Additionally, we use busy-looping over short time periods, to get a + resolution of about 0.01 ms. In order to measure such short timespans, + we use the QueryPerformanceCounter() function. */ + +int +nanosleep (const struct timespec *requested_delay, + struct timespec *remaining_delay) +{ + static bool initialized; + /* Number of performance counter increments per nanosecond, + or zero if it could not be determined. */ + static double ticks_per_nanosecond; + + if (requested_delay->tv_nsec < 0 || BILLION <= requested_delay->tv_nsec) + { + errno = EINVAL; + return -1; + } + + /* For requested delays of one second or more, 15ms resolution is + sufficient. */ + if (requested_delay->tv_sec == 0) + { + if (!initialized) + { + /* Initialize ticks_per_nanosecond. */ + LARGE_INTEGER ticks_per_second; + + if (QueryPerformanceFrequency (&ticks_per_second)) + ticks_per_nanosecond = + (double) ticks_per_second.QuadPart / 1000000000.0; + + initialized = true; + } + if (ticks_per_nanosecond) + { + /* QueryPerformanceFrequency worked. We can use + QueryPerformanceCounter. Use a combination of Sleep and + busy-looping. */ + /* Number of milliseconds to pass to the Sleep function. + Since Sleep can take up to 8 ms less or 8 ms more than requested + (or maybe more if the system is loaded), we subtract 10 ms. */ + int sleep_millis = (int) requested_delay->tv_nsec / 1000000 - 10; + /* Determine how many ticks to delay. */ + LONGLONG wait_ticks = requested_delay->tv_nsec * ticks_per_nanosecond; + /* Start. */ + LARGE_INTEGER counter_before; + if (QueryPerformanceCounter (&counter_before)) + { + /* Wait until the performance counter has reached this value. + We don't need to worry about overflow, because the performance + counter is reset at reboot, and with a frequency of 3.6E6 + ticks per second 63 bits suffice for over 80000 years. */ + LONGLONG wait_until = counter_before.QuadPart + wait_ticks; + /* Use Sleep for the longest part. */ + if (sleep_millis > 0) + Sleep (sleep_millis); + /* Busy-loop for the rest. */ + for (;;) + { + LARGE_INTEGER counter_after; + if (!QueryPerformanceCounter (&counter_after)) + /* QueryPerformanceCounter failed, but succeeded earlier. + Should not happen. */ + break; + if (counter_after.QuadPart >= wait_until) + /* The requested time has elapsed. */ + break; + } + goto done; + } + } + } + /* Implementation for long delays and as fallback. */ + Sleep (requested_delay->tv_sec * 1000 + requested_delay->tv_nsec / 1000000); + + done: + /* Sleep is not interruptible. So there is no remaining delay. */ + if (remaining_delay != NULL) + { + remaining_delay->tv_sec = 0; + remaining_delay->tv_nsec = 0; + } + return 0; +} + +#else +/* Unix platforms lacking nanosleep. */ + +/* Some systems (MSDOS) don't have SIGCONT. + Using SIGTERM here turns the signal-handling code below + into a no-op on such systems. */ +# ifndef SIGCONT +# define SIGCONT SIGTERM +# endif + +static sig_atomic_t volatile suspended; + +/* Handle SIGCONT. */ + +static void +sighandler (int sig) +{ + suspended = 1; +} + +/* Suspend execution for at least *TS_DELAY seconds. */ + +static int +my_usleep (const struct timespec *ts_delay) +{ + struct timeval tv_delay; + tv_delay.tv_sec = ts_delay->tv_sec; + tv_delay.tv_usec = (ts_delay->tv_nsec + 999) / 1000; + if (tv_delay.tv_usec == 1000000) + { + if (tv_delay.tv_sec == TYPE_MAXIMUM (time_t)) + tv_delay.tv_usec = 1000000 - 1; /* close enough */ + else + { + tv_delay.tv_sec++; + tv_delay.tv_usec = 0; + } + } + return select (0, NULL, NULL, NULL, &tv_delay); +} + +/* Suspend execution for at least *REQUESTED_DELAY seconds. The + *REMAINING_DELAY part isn't implemented yet. */ + +int +nanosleep (const struct timespec *requested_delay, + struct timespec *remaining_delay) +{ + static bool initialized; + + if (requested_delay->tv_nsec < 0 || BILLION <= requested_delay->tv_nsec) + { + errno = EINVAL; + return -1; + } + + /* set up sig handler */ + if (! initialized) + { + struct sigaction oldact; + + sigaction (SIGCONT, NULL, &oldact); + if (get_handler (&oldact) != SIG_IGN) + { + struct sigaction newact; + + newact.sa_handler = sighandler; + sigemptyset (&newact.sa_mask); + newact.sa_flags = 0; + sigaction (SIGCONT, &newact, NULL); + } + initialized = true; + } + + suspended = 0; + + if (my_usleep (requested_delay) == -1) + { + if (suspended) + { + /* Calculate time remaining. */ + /* FIXME: the code in sleep doesn't use this, so there's no + rush to implement it. */ + + errno = EINTR; + } + return -1; + } + + /* FIXME: Restore sig handler? */ + + return 0; +} +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/nap.h b/local/recipes/tools/diffutils/source/gnulib-tests/nap.h new file mode 100644 index 0000000000..a49befc0aa --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/nap.h @@ -0,0 +1,150 @@ +/* Assist in file system timestamp tests. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +#ifndef GLTEST_NAP_H +# define GLTEST_NAP_H + +# include <limits.h> +# include <stdbool.h> + +/* Name of the witness file. */ +#define TEMPFILE BASE "nap.tmp" + +/* File descriptor used for the witness file. */ +static int nap_fd = -1; + +/* Return A - B, in ns. + Return 0 if the true result would be negative. + Return INT_MAX if the true result would be greater than INT_MAX. */ +static int +diff_timespec (struct timespec a, struct timespec b) +{ + time_t as = a.tv_sec; + time_t bs = b.tv_sec; + int ans = a.tv_nsec; + int bns = b.tv_nsec; + + if (! (bs < as || (bs == as && bns < ans))) + return 0; + if (as - bs <= INT_MAX / 1000000000) + { + int sdiff = (as - bs) * 1000000000; + int usdiff = ans - bns; + if (usdiff < INT_MAX - sdiff) + return sdiff + usdiff; + } + return INT_MAX; +} + +/* If DO_WRITE, bump the modification time of the file designated by NAP_FD. + Then fetch the new STAT information of NAP_FD. */ +static void +nap_get_stat (struct stat *st, int do_write) +{ + if (do_write) + { + ASSERT (write (nap_fd, "\n", 1) == 1); +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* On native Windows, the modification times are not changed until NAP_FD + is closed. See + https://msdn.microsoft.com/en-us/library/windows/desktop/aa365747(v=vs.85).aspx */ + close (nap_fd); + nap_fd = open (TEMPFILE, O_RDWR, 0600); + ASSERT (nap_fd != -1); + lseek (nap_fd, 0, SEEK_END); +#endif + } + ASSERT (fstat (nap_fd, st) == 0); +} + +/* Given a file whose descriptor is FD, see whether delaying by DELAY + nanoseconds causes a change in a file's mtime. + OLD_ST is the file's status, recently gotten. */ +static bool +nap_works (int delay, struct stat old_st) +{ + struct stat st; + struct timespec delay_spec; + delay_spec.tv_sec = delay / 1000000000; + delay_spec.tv_nsec = delay % 1000000000; + ASSERT (nanosleep (&delay_spec, 0) == 0); + nap_get_stat (&st, 1); + + if (diff_timespec (get_stat_mtime (&st), get_stat_mtime (&old_st))) + return true; + + return false; +} + +static void +clear_temp_file (void) +{ + if (0 <= nap_fd) + { + ASSERT (close (nap_fd) != -1); + ASSERT (unlink (TEMPFILE) != -1); + } +} + +/* Sleep long enough to notice a timestamp difference on the file + system in the current directory. Use an adaptive approach, trying + to find the smallest delay which works on the current file system + to make the timestamp difference appear. Assert a maximum delay of + ~2 seconds, more precisely sum(2^n) from 0 to 30 = 2^31 - 1 = 2.1s. + Assumes that BASE is defined, and requires that the test module + depends on nanosleep. */ +static void +nap (void) +{ + struct stat old_st; + static int delay = 1; + + if (-1 == nap_fd) + { + atexit (clear_temp_file); + ASSERT ((nap_fd = creat (TEMPFILE, 0600)) != -1); + nap_get_stat (&old_st, 0); + } + else + { + ASSERT (0 <= nap_fd); + nap_get_stat (&old_st, 1); + } + + if (1 < delay) + delay = delay / 2; /* Try half of the previous delay. */ + ASSERT (0 < delay); + + for (;;) + { + if (nap_works (delay, old_st)) + return; + if (delay <= (2147483647 - 1) / 2) + { + delay = delay * 2 + 1; + continue; + } + else + break; + } + + /* Bummer: even the highest nap delay didn't work. */ + ASSERT (0); +} + +#endif /* GLTEST_NAP_H */ diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/netinet_in.in.h b/local/recipes/tools/diffutils/source/gnulib-tests/netinet_in.in.h new file mode 100644 index 0000000000..9411b9fae7 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/netinet_in.in.h @@ -0,0 +1,47 @@ +/* Substitute for <netinet/in.h>. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _@GUARD_PREFIX@_NETINET_IN_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#if @HAVE_NETINET_IN_H@ + +/* On many platforms, <netinet/in.h> assumes prior inclusion of + <sys/types.h>. */ +# include <sys/types.h> + +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_NETINET_IN_H@ + +#endif + +#ifndef _@GUARD_PREFIX@_NETINET_IN_H +#define _@GUARD_PREFIX@_NETINET_IN_H + +#if !@HAVE_NETINET_IN_H@ + +/* A platform that lacks <netinet/in.h>. */ + +# include <sys/socket.h> + +#endif + +#endif /* _@GUARD_PREFIX@_NETINET_IN_H */ +#endif /* _@GUARD_PREFIX@_NETINET_IN_H */ diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/perror.c b/local/recipes/tools/diffutils/source/gnulib-tests/perror.c new file mode 100644 index 0000000000..6f1e7448a5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/perror.c @@ -0,0 +1,49 @@ +/* Print a message describing error code. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + Written by Bruno Haible and Simon Josefsson. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <stdio.h> + +#include <errno.h> +#include <stdlib.h> +#include <string.h> + +#include "strerror-override.h" + +/* Use the system functions, not the gnulib overrides in this file. */ +#undef fprintf + +void +perror (const char *string) +{ + char stackbuf[STACKBUF_LEN]; + int ret; + + /* Our implementation guarantees that this will be a non-empty + string, even if it returns EINVAL; and stackbuf should be sized + large enough to avoid ERANGE. */ + ret = strerror_r (errno, stackbuf, sizeof stackbuf); + if (ret == ERANGE) + abort (); + + if (string != NULL && *string != '\0') + fprintf (stderr, "%s: %s\n", string, stackbuf); + else + fprintf (stderr, "%s\n", stackbuf); +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/pipe.c b/local/recipes/tools/diffutils/source/gnulib-tests/pipe.c new file mode 100644 index 0000000000..2a6e38fc9a --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/pipe.c @@ -0,0 +1,50 @@ +/* Create a pipe. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <unistd.h> + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Native Windows API. */ + +/* Get _pipe(). */ +# include <io.h> + +/* Get _O_BINARY. */ +# include <fcntl.h> + +int +pipe (int fd[2]) +{ + /* Mingw changes fd to {-1,-1} on failure, but this violates + http://austingroupbugs.net/view.php?id=467 */ + int tmp[2]; + int result = _pipe (tmp, 4096, _O_BINARY); + if (!result) + { + fd[0] = tmp[0]; + fd[1] = tmp[1]; + } + return result; +} + +#else + +# error "This platform lacks a pipe function, and Gnulib doesn't provide a replacement. This is a bug in Gnulib." + +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/putenv.c b/local/recipes/tools/diffutils/source/gnulib-tests/putenv.c new file mode 100644 index 0000000000..b55e262093 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/putenv.c @@ -0,0 +1,194 @@ +/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2017 Free Software + Foundation, Inc. + + NOTE: The canonical source of this file is maintained with the GNU C + Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3 of the License, or any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <stdlib.h> + +#include <stddef.h> + +/* Include errno.h *after* sys/types.h to work around header problems + on AIX 3.2.5. */ +#include <errno.h> +#ifndef __set_errno +# define __set_errno(ev) ((errno) = (ev)) +#endif + +#include <string.h> +#include <unistd.h> + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# define WIN32_LEAN_AND_MEAN +# include <windows.h> +#endif + +#if _LIBC +# if HAVE_GNU_LD +# define environ __environ +# else +extern char **environ; +# endif +#endif + +#if _LIBC +/* This lock protects against simultaneous modifications of 'environ'. */ +# include <bits/libc-lock.h> +__libc_lock_define_initialized (static, envlock) +# define LOCK __libc_lock_lock (envlock) +# define UNLOCK __libc_lock_unlock (envlock) +#else +# define LOCK +# define UNLOCK +#endif + +static int +_unsetenv (const char *name) +{ + size_t len; +#if !HAVE_DECL__PUTENV + char **ep; +#endif + + if (name == NULL || *name == '\0' || strchr (name, '=') != NULL) + { + __set_errno (EINVAL); + return -1; + } + + len = strlen (name); + +#if HAVE_DECL__PUTENV + { + int putenv_result, putenv_errno; + char *name_ = malloc (len + 2); + memcpy (name_, name, len); + name_[len] = '='; + name_[len + 1] = 0; + putenv_result = _putenv (name_); + putenv_errno = errno; + free (name_); + __set_errno (putenv_errno); + return putenv_result; + } +#else + + LOCK; + + ep = environ; + while (*ep != NULL) + if (!strncmp (*ep, name, len) && (*ep)[len] == '=') + { + /* Found it. Remove this pointer by moving later ones back. */ + char **dp = ep; + + do + dp[0] = dp[1]; + while (*dp++); + /* Continue the loop in case NAME appears again. */ + } + else + ++ep; + + UNLOCK; + + return 0; +#endif +} + + +/* Put STRING, which is of the form "NAME=VALUE", in the environment. + If STRING contains no '=', then remove STRING from the environment. */ +int +putenv (char *string) +{ + const char *name_end = strchr (string, '='); + char **ep; + + if (name_end == NULL) + { + /* Remove the variable from the environment. */ + return _unsetenv (string); + } + +#if HAVE_DECL__PUTENV + /* Rely on _putenv to allocate the new environment. If other + parts of the application use _putenv, the !HAVE_DECL__PUTENV code + would fight over who owns the environ vector, causing a crash. */ + if (name_end[1]) + return _putenv (string); + else + { + /* _putenv ("NAME=") unsets NAME, so invoke _putenv ("NAME= ") + to allocate the environ vector and then replace the new + entry with "NAME=". */ + int putenv_result, putenv_errno; + char *name_x = malloc (name_end - string + sizeof "= "); + if (!name_x) + return -1; + memcpy (name_x, string, name_end - string + 1); + name_x[name_end - string + 1] = ' '; + name_x[name_end - string + 2] = 0; + putenv_result = _putenv (name_x); + putenv_errno = errno; + for (ep = environ; *ep; ep++) + if (strcmp (*ep, name_x) == 0) + { + *ep = string; + break; + } +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + if (putenv_result == 0) + { + /* _putenv propagated "NAME= " into the subprocess environment; + fix that by calling SetEnvironmentVariable directly. */ + name_x[name_end - string] = 0; + putenv_result = SetEnvironmentVariable (name_x, "") ? 0 : -1; + putenv_errno = ENOMEM; /* ENOMEM is the only way to fail. */ + } +# endif + free (name_x); + __set_errno (putenv_errno); + return putenv_result; + } +#else + for (ep = environ; *ep; ep++) + if (strncmp (*ep, string, name_end - string) == 0 + && (*ep)[name_end - string] == '=') + break; + + if (*ep) + *ep = string; + else + { + static char **last_environ = NULL; + size_t size = ep - environ; + char **new_environ = malloc ((size + 2) * sizeof *new_environ); + if (! new_environ) + return -1; + new_environ[0] = string; + memcpy (new_environ + 1, environ, (size + 1) * sizeof *new_environ); + free (last_environ); + last_environ = new_environ; + environ = new_environ; + } + + return 0; +#endif +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/same-inode.h b/local/recipes/tools/diffutils/source/gnulib-tests/same-inode.h new file mode 100644 index 0000000000..a08bc4ec0d --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/same-inode.h @@ -0,0 +1,47 @@ +/* Determine whether two stat buffers are known to refer to the same file. + + Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef SAME_INODE_H +# define SAME_INODE_H 1 + +# include <sys/types.h> + +# ifdef __VMS +# define SAME_INODE(a, b) \ + ((a).st_ino[0] == (b).st_ino[0] \ + && (a).st_ino[1] == (b).st_ino[1] \ + && (a).st_ino[2] == (b).st_ino[2] \ + && (a).st_dev == (b).st_dev) +# elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* Native Windows. */ +# if _GL_WINDOWS_STAT_INODES + /* stat() and fstat() set st_dev and st_ino to 0 if information about + the inode is not available. */ +# define SAME_INODE(a, b) \ + (!((a).st_ino == 0 && (a).st_dev == 0) \ + && (a).st_ino == (b).st_ino && (a).st_dev == (b).st_dev) +# else + /* stat() and fstat() set st_ino to 0 always. */ +# define SAME_INODE(a, b) 0 +# endif +# else +# define SAME_INODE(a, b) \ + ((a).st_ino == (b).st_ino \ + && (a).st_dev == (b).st_dev) +# endif + +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/select.c b/local/recipes/tools/diffutils/source/gnulib-tests/select.c new file mode 100644 index 0000000000..cba802dc24 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/select.c @@ -0,0 +1,579 @@ +/* Emulation for select(2) + Contributed by Paolo Bonzini. + + Copyright 2008-2017 Free Software Foundation, Inc. + + This file is part of gnulib. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> +#include <alloca.h> +#include <assert.h> + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Native Windows. */ + +#include <sys/types.h> +#include <errno.h> +#include <limits.h> + +#include <winsock2.h> +#include <windows.h> +#include <io.h> +#include <stdio.h> +#include <conio.h> +#include <time.h> + +/* Get the overridden 'struct timeval'. */ +#include <sys/time.h> + +#if GNULIB_MSVC_NOTHROW +# include "msvc-nothrow.h" +#else +# include <io.h> +#endif + +#undef select + +struct bitset { + unsigned char in[FD_SETSIZE / CHAR_BIT]; + unsigned char out[FD_SETSIZE / CHAR_BIT]; +}; + +/* Declare data structures for ntdll functions. */ +typedef struct _FILE_PIPE_LOCAL_INFORMATION { + ULONG NamedPipeType; + ULONG NamedPipeConfiguration; + ULONG MaximumInstances; + ULONG CurrentInstances; + ULONG InboundQuota; + ULONG ReadDataAvailable; + ULONG OutboundQuota; + ULONG WriteQuotaAvailable; + ULONG NamedPipeState; + ULONG NamedPipeEnd; +} FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION; + +typedef struct _IO_STATUS_BLOCK +{ + union { + DWORD Status; + PVOID Pointer; + } u; + ULONG_PTR Information; +} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK; + +typedef enum _FILE_INFORMATION_CLASS { + FilePipeLocalInformation = 24 +} FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS; + +typedef DWORD (WINAPI *PNtQueryInformationFile) + (HANDLE, IO_STATUS_BLOCK *, VOID *, ULONG, FILE_INFORMATION_CLASS); + +#ifndef PIPE_BUF +#define PIPE_BUF 512 +#endif + +static BOOL IsConsoleHandle (HANDLE h) +{ + DWORD mode; + return GetConsoleMode (h, &mode) != 0; +} + +static BOOL +IsSocketHandle (HANDLE h) +{ + WSANETWORKEVENTS ev; + + if (IsConsoleHandle (h)) + return FALSE; + + /* Under Wine, it seems that getsockopt returns 0 for pipes too. + WSAEnumNetworkEvents instead distinguishes the two correctly. */ + ev.lNetworkEvents = 0xDEADBEEF; + WSAEnumNetworkEvents ((SOCKET) h, NULL, &ev); + return ev.lNetworkEvents != 0xDEADBEEF; +} + +/* Compute output fd_sets for libc descriptor FD (whose Windows handle is + H). */ + +static int +windows_poll_handle (HANDLE h, int fd, + struct bitset *rbits, + struct bitset *wbits, + struct bitset *xbits) +{ + BOOL read, write, except; + int i, ret; + INPUT_RECORD *irbuffer; + DWORD avail, nbuffer; + BOOL bRet; + IO_STATUS_BLOCK iosb; + FILE_PIPE_LOCAL_INFORMATION fpli; + static PNtQueryInformationFile NtQueryInformationFile; + static BOOL once_only; + + read = write = except = FALSE; + switch (GetFileType (h)) + { + case FILE_TYPE_DISK: + read = TRUE; + write = TRUE; + break; + + case FILE_TYPE_PIPE: + if (!once_only) + { + NtQueryInformationFile = (PNtQueryInformationFile) + GetProcAddress (GetModuleHandle ("ntdll.dll"), + "NtQueryInformationFile"); + once_only = TRUE; + } + + if (PeekNamedPipe (h, NULL, 0, NULL, &avail, NULL) != 0) + { + if (avail) + read = TRUE; + } + else if (GetLastError () == ERROR_BROKEN_PIPE) + ; + + else + { + /* It was the write-end of the pipe. Check if it is writable. + If NtQueryInformationFile fails, optimistically assume the pipe is + writable. This could happen on Windows 9x, where + NtQueryInformationFile is not available, or if we inherit a pipe + that doesn't permit FILE_READ_ATTRIBUTES access on the write end + (I think this should not happen since Windows XP SP2; WINE seems + fine too). Otherwise, ensure that enough space is available for + atomic writes. */ + memset (&iosb, 0, sizeof (iosb)); + memset (&fpli, 0, sizeof (fpli)); + + if (!NtQueryInformationFile + || NtQueryInformationFile (h, &iosb, &fpli, sizeof (fpli), + FilePipeLocalInformation) + || fpli.WriteQuotaAvailable >= PIPE_BUF + || (fpli.OutboundQuota < PIPE_BUF && + fpli.WriteQuotaAvailable == fpli.OutboundQuota)) + write = TRUE; + } + break; + + case FILE_TYPE_CHAR: + write = TRUE; + if (!(rbits->in[fd / CHAR_BIT] & (1 << (fd & (CHAR_BIT - 1))))) + break; + + ret = WaitForSingleObject (h, 0); + if (ret == WAIT_OBJECT_0) + { + if (!IsConsoleHandle (h)) + { + read = TRUE; + break; + } + + nbuffer = avail = 0; + bRet = GetNumberOfConsoleInputEvents (h, &nbuffer); + + /* Screen buffers handles are filtered earlier. */ + assert (bRet); + if (nbuffer == 0) + { + except = TRUE; + break; + } + + irbuffer = (INPUT_RECORD *) alloca (nbuffer * sizeof (INPUT_RECORD)); + bRet = PeekConsoleInput (h, irbuffer, nbuffer, &avail); + if (!bRet || avail == 0) + { + except = TRUE; + break; + } + + for (i = 0; i < avail; i++) + if (irbuffer[i].EventType == KEY_EVENT) + read = TRUE; + } + break; + + default: + ret = WaitForSingleObject (h, 0); + write = TRUE; + if (ret == WAIT_OBJECT_0) + read = TRUE; + + break; + } + + ret = 0; + if (read && (rbits->in[fd / CHAR_BIT] & (1 << (fd & (CHAR_BIT - 1))))) + { + rbits->out[fd / CHAR_BIT] |= (1 << (fd & (CHAR_BIT - 1))); + ret++; + } + + if (write && (wbits->in[fd / CHAR_BIT] & (1 << (fd & (CHAR_BIT - 1))))) + { + wbits->out[fd / CHAR_BIT] |= (1 << (fd & (CHAR_BIT - 1))); + ret++; + } + + if (except && (xbits->in[fd / CHAR_BIT] & (1 << (fd & (CHAR_BIT - 1))))) + { + xbits->out[fd / CHAR_BIT] |= (1 << (fd & (CHAR_BIT - 1))); + ret++; + } + + return ret; +} + +int +rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds, + struct timeval *timeout) +#undef timeval +{ + static struct timeval tv0; + static HANDLE hEvent; + HANDLE h, handle_array[FD_SETSIZE + 2]; + fd_set handle_rfds, handle_wfds, handle_xfds; + struct bitset rbits, wbits, xbits; + unsigned char anyfds_in[FD_SETSIZE / CHAR_BIT]; + DWORD ret, wait_timeout, nhandles, nsock, nbuffer; + MSG msg; + int i, fd, rc; + clock_t tend; + + if (nfds > FD_SETSIZE) + nfds = FD_SETSIZE; + + if (!timeout) + wait_timeout = INFINITE; + else + { + wait_timeout = timeout->tv_sec * 1000 + timeout->tv_usec / 1000; + + /* select is also used as a portable usleep. */ + if (!rfds && !wfds && !xfds) + { + Sleep (wait_timeout); + return 0; + } + } + + if (!hEvent) + hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); + + handle_array[0] = hEvent; + nhandles = 1; + nsock = 0; + + /* Copy descriptors to bitsets. At the same time, eliminate + bits in the "wrong" direction for console input buffers + and screen buffers, because screen buffers are waitable + and they will block until a character is available. */ + memset (&rbits, 0, sizeof (rbits)); + memset (&wbits, 0, sizeof (wbits)); + memset (&xbits, 0, sizeof (xbits)); + memset (anyfds_in, 0, sizeof (anyfds_in)); + if (rfds) + for (i = 0; i < rfds->fd_count; i++) + { + fd = rfds->fd_array[i]; + h = (HANDLE) _get_osfhandle (fd); + if (IsConsoleHandle (h) + && !GetNumberOfConsoleInputEvents (h, &nbuffer)) + continue; + + rbits.in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1)); + anyfds_in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1)); + } + else + rfds = (fd_set *) alloca (sizeof (fd_set)); + + if (wfds) + for (i = 0; i < wfds->fd_count; i++) + { + fd = wfds->fd_array[i]; + h = (HANDLE) _get_osfhandle (fd); + if (IsConsoleHandle (h) + && GetNumberOfConsoleInputEvents (h, &nbuffer)) + continue; + + wbits.in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1)); + anyfds_in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1)); + } + else + wfds = (fd_set *) alloca (sizeof (fd_set)); + + if (xfds) + for (i = 0; i < xfds->fd_count; i++) + { + fd = xfds->fd_array[i]; + xbits.in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1)); + anyfds_in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1)); + } + else + xfds = (fd_set *) alloca (sizeof (fd_set)); + + /* Zero all the fd_sets, including the application's. */ + FD_ZERO (rfds); + FD_ZERO (wfds); + FD_ZERO (xfds); + FD_ZERO (&handle_rfds); + FD_ZERO (&handle_wfds); + FD_ZERO (&handle_xfds); + + /* Classify handles. Create fd sets for sockets, poll the others. */ + for (i = 0; i < nfds; i++) + { + if ((anyfds_in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) == 0) + continue; + + h = (HANDLE) _get_osfhandle (i); + if (!h) + { + errno = EBADF; + return -1; + } + + if (IsSocketHandle (h)) + { + int requested = FD_CLOSE; + + /* See above; socket handles are mapped onto select, but we + need to map descriptors to handles. */ + if (rbits.in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) + { + requested |= FD_READ | FD_ACCEPT; + FD_SET ((SOCKET) h, rfds); + FD_SET ((SOCKET) h, &handle_rfds); + } + if (wbits.in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) + { + requested |= FD_WRITE | FD_CONNECT; + FD_SET ((SOCKET) h, wfds); + FD_SET ((SOCKET) h, &handle_wfds); + } + if (xbits.in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) + { + requested |= FD_OOB; + FD_SET ((SOCKET) h, xfds); + FD_SET ((SOCKET) h, &handle_xfds); + } + + WSAEventSelect ((SOCKET) h, hEvent, requested); + nsock++; + } + else + { + handle_array[nhandles++] = h; + + /* Poll now. If we get an event, do not wait below. */ + if (wait_timeout != 0 + && windows_poll_handle (h, i, &rbits, &wbits, &xbits)) + wait_timeout = 0; + } + } + + /* Place a sentinel at the end of the array. */ + handle_array[nhandles] = NULL; + + /* When will the waiting period expire? */ + if (wait_timeout != INFINITE) + tend = clock () + wait_timeout; + +restart: + if (wait_timeout == 0 || nsock == 0) + rc = 0; + else + { + /* See if we need to wait in the loop below. If any select is ready, + do MsgWaitForMultipleObjects anyway to dispatch messages, but + no need to call select again. */ + rc = select (0, &handle_rfds, &handle_wfds, &handle_xfds, &tv0); + if (rc == 0) + { + /* Restore the fd_sets for the other select we do below. */ + memcpy (&handle_rfds, rfds, sizeof (fd_set)); + memcpy (&handle_wfds, wfds, sizeof (fd_set)); + memcpy (&handle_xfds, xfds, sizeof (fd_set)); + } + else + wait_timeout = 0; + } + + /* How much is left to wait? */ + if (wait_timeout != INFINITE) + { + clock_t tnow = clock (); + if (tend >= tnow) + wait_timeout = tend - tnow; + else + wait_timeout = 0; + } + + for (;;) + { + ret = MsgWaitForMultipleObjects (nhandles, handle_array, FALSE, + wait_timeout, QS_ALLINPUT); + + if (ret == WAIT_OBJECT_0 + nhandles) + { + /* new input of some other kind */ + BOOL bRet; + while ((bRet = PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) != 0) + { + TranslateMessage (&msg); + DispatchMessage (&msg); + } + } + else + break; + } + + /* If we haven't done it yet, check the status of the sockets. */ + if (rc == 0 && nsock > 0) + rc = select (0, &handle_rfds, &handle_wfds, &handle_xfds, &tv0); + + if (nhandles > 1) + { + /* Count results that are not counted in the return value of select. */ + nhandles = 1; + for (i = 0; i < nfds; i++) + { + if ((anyfds_in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) == 0) + continue; + + h = (HANDLE) _get_osfhandle (i); + if (h == handle_array[nhandles]) + { + /* Not a socket. */ + nhandles++; + windows_poll_handle (h, i, &rbits, &wbits, &xbits); + if (rbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1))) + || wbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1))) + || xbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) + rc++; + } + } + + if (rc == 0 + && (wait_timeout == INFINITE + /* If NHANDLES > 1, but no bits are set, it means we've + been told incorrectly that some handle was signaled. + This happens with anonymous pipes, which always cause + MsgWaitForMultipleObjects to exit immediately, but no + data is found ready to be read by windows_poll_handle. + To avoid a total failure (whereby we return zero and + don't wait at all), let's poll in a more busy loop. */ + || (wait_timeout != 0 && nhandles > 1))) + { + /* Sleep 1 millisecond to avoid busy wait and retry with the + original fd_sets. */ + memcpy (&handle_rfds, rfds, sizeof (fd_set)); + memcpy (&handle_wfds, wfds, sizeof (fd_set)); + memcpy (&handle_xfds, xfds, sizeof (fd_set)); + SleepEx (1, TRUE); + goto restart; + } + if (timeout && wait_timeout == 0 && rc == 0) + timeout->tv_sec = timeout->tv_usec = 0; + } + + /* Now fill in the results. */ + FD_ZERO (rfds); + FD_ZERO (wfds); + FD_ZERO (xfds); + nhandles = 1; + for (i = 0; i < nfds; i++) + { + if ((anyfds_in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) == 0) + continue; + + h = (HANDLE) _get_osfhandle (i); + if (h != handle_array[nhandles]) + { + /* Perform handle->descriptor mapping. */ + WSAEventSelect ((SOCKET) h, NULL, 0); + if (FD_ISSET (h, &handle_rfds)) + FD_SET (i, rfds); + if (FD_ISSET (h, &handle_wfds)) + FD_SET (i, wfds); + if (FD_ISSET (h, &handle_xfds)) + FD_SET (i, xfds); + } + else + { + /* Not a socket. */ + nhandles++; + if (rbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) + FD_SET (i, rfds); + if (wbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) + FD_SET (i, wfds); + if (xbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) + FD_SET (i, xfds); + } + } + + return rc; +} + +#else /* ! Native Windows. */ + +#include <sys/select.h> +#include <stddef.h> /* NULL */ +#include <errno.h> +#include <unistd.h> + +#undef select + +int +rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds, + struct timeval *timeout) +{ + int i; + + /* FreeBSD 8.2 has a bug: it does not always detect invalid fds. */ + if (nfds < 0 || nfds > FD_SETSIZE) + { + errno = EINVAL; + return -1; + } + for (i = 0; i < nfds; i++) + { + if (((rfds && FD_ISSET (i, rfds)) + || (wfds && FD_ISSET (i, wfds)) + || (xfds && FD_ISSET (i, xfds))) + && dup2 (i, i) != i) + return -1; + } + + /* Interix 3.5 has a bug: it does not support nfds == 0. */ + if (nfds == 0) + { + nfds = 1; + rfds = NULL; + wfds = NULL; + xfds = NULL; + } + return select (nfds, rfds, wfds, xfds, timeout); +} + +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/setlocale.c b/local/recipes/tools/diffutils/source/gnulib-tests/setlocale.c new file mode 100644 index 0000000000..d2f203ed7a --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/setlocale.c @@ -0,0 +1,946 @@ +/* Set the current locale. -*- coding: utf-8 -*- + Copyright (C) 2009, 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2009. */ + +#include <config.h> + +/* Override setlocale() so that when the default locale is requested + (locale = ""), the environment variables LC_ALL, LC_*, and LANG are + considered. + Also include all the functionality from libintl's setlocale() override. */ + +/* Please keep this file in sync with + gettext/gettext-runtime/intl/setlocale.c ! */ + +/* Specification. */ +#include <locale.h> + +#include <stdlib.h> +#include <string.h> + +#include "localename.h" + +#if 1 + +# undef setlocale + +/* Return string representation of locale category CATEGORY. */ +static const char * +category_to_name (int category) +{ + const char *retval; + + switch (category) + { + case LC_COLLATE: + retval = "LC_COLLATE"; + break; + case LC_CTYPE: + retval = "LC_CTYPE"; + break; + case LC_MONETARY: + retval = "LC_MONETARY"; + break; + case LC_NUMERIC: + retval = "LC_NUMERIC"; + break; + case LC_TIME: + retval = "LC_TIME"; + break; + case LC_MESSAGES: + retval = "LC_MESSAGES"; + break; + default: + /* If you have a better idea for a default value let me know. */ + retval = "LC_XXX"; + } + + return retval; +} + +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +/* The native Windows setlocale() function expects locale names of the form + "German" or "German_Germany" or "DEU", but not "de" or "de_DE". We need + to convert the names from the form with ISO 639 language code and ISO 3166 + country code to the form with English names or with three-letter identifier. + The three-letter identifiers known by a Windows XP SP2 or SP3 are: + AFK Afrikaans_South Africa.1252 + ARA Arabic_Saudi Arabia.1256 + ARB Arabic_Lebanon.1256 + ARE Arabic_Egypt.1256 + ARG Arabic_Algeria.1256 + ARH Arabic_Bahrain.1256 + ARI Arabic_Iraq.1256 + ARJ Arabic_Jordan.1256 + ARK Arabic_Kuwait.1256 + ARL Arabic_Libya.1256 + ARM Arabic_Morocco.1256 + ARO Arabic_Oman.1256 + ARQ Arabic_Qatar.1256 + ARS Arabic_Syria.1256 + ART Arabic_Tunisia.1256 + ARU Arabic_U.A.E..1256 + ARY Arabic_Yemen.1256 + AZE Azeri (Latin)_Azerbaijan.1254 + BEL Belarusian_Belarus.1251 + BGR Bulgarian_Bulgaria.1251 + BSB Bosnian_Bosnia and Herzegovina.1250 + BSC Bosnian (Cyrillic)_Bosnia and Herzegovina.1250 (wrong encoding!) + CAT Catalan_Spain.1252 + CHH Chinese_Hong Kong S.A.R..950 + CHI Chinese_Singapore.936 + CHS Chinese_People's Republic of China.936 + CHT Chinese_Taiwan.950 + CSY Czech_Czech Republic.1250 + CYM Welsh_United Kingdom.1252 + DAN Danish_Denmark.1252 + DEA German_Austria.1252 + DEC German_Liechtenstein.1252 + DEL German_Luxembourg.1252 + DES German_Switzerland.1252 + DEU German_Germany.1252 + ELL Greek_Greece.1253 + ENA English_Australia.1252 + ENB English_Caribbean.1252 + ENC English_Canada.1252 + ENG English_United Kingdom.1252 + ENI English_Ireland.1252 + ENJ English_Jamaica.1252 + ENL English_Belize.1252 + ENP English_Republic of the Philippines.1252 + ENS English_South Africa.1252 + ENT English_Trinidad and Tobago.1252 + ENU English_United States.1252 + ENW English_Zimbabwe.1252 + ENZ English_New Zealand.1252 + ESA Spanish_Panama.1252 + ESB Spanish_Bolivia.1252 + ESC Spanish_Costa Rica.1252 + ESD Spanish_Dominican Republic.1252 + ESE Spanish_El Salvador.1252 + ESF Spanish_Ecuador.1252 + ESG Spanish_Guatemala.1252 + ESH Spanish_Honduras.1252 + ESI Spanish_Nicaragua.1252 + ESL Spanish_Chile.1252 + ESM Spanish_Mexico.1252 + ESN Spanish_Spain.1252 + ESO Spanish_Colombia.1252 + ESP Spanish_Spain.1252 + ESR Spanish_Peru.1252 + ESS Spanish_Argentina.1252 + ESU Spanish_Puerto Rico.1252 + ESV Spanish_Venezuela.1252 + ESY Spanish_Uruguay.1252 + ESZ Spanish_Paraguay.1252 + ETI Estonian_Estonia.1257 + EUQ Basque_Spain.1252 + FAR Farsi_Iran.1256 + FIN Finnish_Finland.1252 + FOS Faroese_Faroe Islands.1252 + FPO Filipino_Philippines.1252 + FRA French_France.1252 + FRB French_Belgium.1252 + FRC French_Canada.1252 + FRL French_Luxembourg.1252 + FRM French_Principality of Monaco.1252 + FRS French_Switzerland.1252 + FYN Frisian_Netherlands.1252 + GLC Galician_Spain.1252 + HEB Hebrew_Israel.1255 + HRB Croatian_Bosnia and Herzegovina.1250 + HRV Croatian_Croatia.1250 + HUN Hungarian_Hungary.1250 + IND Indonesian_Indonesia.1252 + IRE Irish_Ireland.1252 + ISL Icelandic_Iceland.1252 + ITA Italian_Italy.1252 + ITS Italian_Switzerland.1252 + IUK Inuktitut (Latin)_Canada.1252 + JPN Japanese_Japan.932 + KKZ Kazakh_Kazakhstan.1251 + KOR Korean_Korea.949 + KYR Kyrgyz_Kyrgyzstan.1251 + LBX Luxembourgish_Luxembourg.1252 + LTH Lithuanian_Lithuania.1257 + LVI Latvian_Latvia.1257 + MKI FYRO Macedonian_Former Yugoslav Republic of Macedonia.1251 + MON Mongolian_Mongolia.1251 + MPD Mapudungun_Chile.1252 + MSB Malay_Brunei Darussalam.1252 + MSL Malay_Malaysia.1252 + MWK Mohawk_Canada.1252 + NLB Dutch_Belgium.1252 + NLD Dutch_Netherlands.1252 + NON Norwegian-Nynorsk_Norway.1252 + NOR Norwegian (Bokmål)_Norway.1252 + NSO Northern Sotho_South Africa.1252 + PLK Polish_Poland.1250 + PTB Portuguese_Brazil.1252 + PTG Portuguese_Portugal.1252 + QUB Quechua_Bolivia.1252 + QUE Quechua_Ecuador.1252 + QUP Quechua_Peru.1252 + RMC Romansh_Switzerland.1252 + ROM Romanian_Romania.1250 + RUS Russian_Russia.1251 + SKY Slovak_Slovakia.1250 + SLV Slovenian_Slovenia.1250 + SMA Sami (Southern)_Norway.1252 + SMB Sami (Southern)_Sweden.1252 + SME Sami (Northern)_Norway.1252 + SMF Sami (Northern)_Sweden.1252 + SMG Sami (Northern)_Finland.1252 + SMJ Sami (Lule)_Norway.1252 + SMK Sami (Lule)_Sweden.1252 + SMN Sami (Inari)_Finland.1252 + SMS Sami (Skolt)_Finland.1252 + SQI Albanian_Albania.1250 + SRB Serbian (Cyrillic)_Serbia and Montenegro.1251 + SRL Serbian (Latin)_Serbia and Montenegro.1250 + SRN Serbian (Cyrillic)_Bosnia and Herzegovina.1251 + SRS Serbian (Latin)_Bosnia and Herzegovina.1250 + SVE Swedish_Sweden.1252 + SVF Swedish_Finland.1252 + SWK Swahili_Kenya.1252 + THA Thai_Thailand.874 + TRK Turkish_Turkey.1254 + TSN Tswana_South Africa.1252 + TTT Tatar_Russia.1251 + UKR Ukrainian_Ukraine.1251 + URD Urdu_Islamic Republic of Pakistan.1256 + USA English_United States.1252 + UZB Uzbek (Latin)_Uzbekistan.1254 + VIT Vietnamese_Viet Nam.1258 + XHO Xhosa_South Africa.1252 + ZHH Chinese_Hong Kong S.A.R..950 + ZHI Chinese_Singapore.936 + ZHM Chinese_Macau S.A.R..950 + ZUL Zulu_South Africa.1252 + */ + +/* Table from ISO 639 language code, optionally with country or script suffix, + to English name. + Keep in sync with the gl_locale_name_from_win32_LANGID function in + localename.c! */ +struct table_entry +{ + const char *code; + const char *english; +}; +static const struct table_entry language_table[] = + { + { "af", "Afrikaans" }, + { "am", "Amharic" }, + { "ar", "Arabic" }, + { "arn", "Mapudungun" }, + { "as", "Assamese" }, + { "az@cyrillic", "Azeri (Cyrillic)" }, + { "az@latin", "Azeri (Latin)" }, + { "ba", "Bashkir" }, + { "be", "Belarusian" }, + { "ber", "Tamazight" }, + { "ber@arabic", "Tamazight (Arabic)" }, + { "ber@latin", "Tamazight (Latin)" }, + { "bg", "Bulgarian" }, + { "bin", "Edo" }, + { "bn", "Bengali" }, + { "bn_BD", "Bengali (Bangladesh)" }, + { "bn_IN", "Bengali (India)" }, + { "bnt", "Sutu" }, + { "bo", "Tibetan" }, + { "br", "Breton" }, + { "bs", "BSB" }, /* "Bosnian (Latin)" */ + { "bs@cyrillic", "BSC" }, /* Bosnian (Cyrillic) */ + { "ca", "Catalan" }, + { "chr", "Cherokee" }, + { "co", "Corsican" }, + { "cpe", "Hawaiian" }, + { "cs", "Czech" }, + { "cy", "Welsh" }, + { "da", "Danish" }, + { "de", "German" }, + { "dsb", "Lower Sorbian" }, + { "dv", "Divehi" }, + { "el", "Greek" }, + { "en", "English" }, + { "es", "Spanish" }, + { "et", "Estonian" }, + { "eu", "Basque" }, + { "fa", "Farsi" }, + { "ff", "Fulfulde" }, + { "fi", "Finnish" }, + { "fo", "Faroese" }, /* "Faeroese" does not work */ + { "fr", "French" }, + { "fy", "Frisian" }, + { "ga", "IRE" }, /* Gaelic (Ireland) */ + { "gd", "Gaelic (Scotland)" }, + { "gd", "Scottish Gaelic" }, + { "gl", "Galician" }, + { "gn", "Guarani" }, + { "gsw", "Alsatian" }, + { "gu", "Gujarati" }, + { "ha", "Hausa" }, + { "he", "Hebrew" }, + { "hi", "Hindi" }, + { "hr", "Croatian" }, + { "hsb", "Upper Sorbian" }, + { "hu", "Hungarian" }, + { "hy", "Armenian" }, + { "id", "Indonesian" }, + { "ig", "Igbo" }, + { "ii", "Yi" }, + { "is", "Icelandic" }, + { "it", "Italian" }, + { "iu", "IUK" }, /* Inuktitut */ + { "ja", "Japanese" }, + { "ka", "Georgian" }, + { "kk", "Kazakh" }, + { "kl", "Greenlandic" }, + { "km", "Cambodian" }, + { "km", "Khmer" }, + { "kn", "Kannada" }, + { "ko", "Korean" }, + { "kok", "Konkani" }, + { "kr", "Kanuri" }, + { "ks", "Kashmiri" }, + { "ks_IN", "Kashmiri_India" }, + { "ks_PK", "Kashmiri (Arabic)_Pakistan" }, + { "ky", "Kyrgyz" }, + { "la", "Latin" }, + { "lb", "Luxembourgish" }, + { "lo", "Lao" }, + { "lt", "Lithuanian" }, + { "lv", "Latvian" }, + { "mi", "Maori" }, + { "mk", "FYRO Macedonian" }, + { "mk", "Macedonian" }, + { "ml", "Malayalam" }, + { "mn", "Mongolian" }, + { "mni", "Manipuri" }, + { "moh", "Mohawk" }, + { "mr", "Marathi" }, + { "ms", "Malay" }, + { "mt", "Maltese" }, + { "my", "Burmese" }, + { "nb", "NOR" }, /* Norwegian Bokmål */ + { "ne", "Nepali" }, + { "nic", "Ibibio" }, + { "nl", "Dutch" }, + { "nn", "NON" }, /* Norwegian Nynorsk */ + { "no", "Norwegian" }, + { "nso", "Northern Sotho" }, + { "nso", "Sepedi" }, + { "oc", "Occitan" }, + { "om", "Oromo" }, + { "or", "Oriya" }, + { "pa", "Punjabi" }, + { "pap", "Papiamentu" }, + { "pl", "Polish" }, + { "prs", "Dari" }, + { "ps", "Pashto" }, + { "pt", "Portuguese" }, + { "qu", "Quechua" }, + { "qut", "K'iche'" }, + { "rm", "Romansh" }, + { "ro", "Romanian" }, + { "ru", "Russian" }, + { "rw", "Kinyarwanda" }, + { "sa", "Sanskrit" }, + { "sah", "Yakut" }, + { "sd", "Sindhi" }, + { "se", "Sami (Northern)" }, + { "se", "Northern Sami" }, + { "si", "Sinhalese" }, + { "sk", "Slovak" }, + { "sl", "Slovenian" }, + { "sma", "Sami (Southern)" }, + { "sma", "Southern Sami" }, + { "smj", "Sami (Lule)" }, + { "smj", "Lule Sami" }, + { "smn", "Sami (Inari)" }, + { "smn", "Inari Sami" }, + { "sms", "Sami (Skolt)" }, + { "sms", "Skolt Sami" }, + { "so", "Somali" }, + { "sq", "Albanian" }, + { "sr", "Serbian (Latin)" }, + { "sr@cyrillic", "SRB" }, /* Serbian (Cyrillic) */ + { "sv", "Swedish" }, + { "sw", "Swahili" }, + { "syr", "Syriac" }, + { "ta", "Tamil" }, + { "te", "Telugu" }, + { "tg", "Tajik" }, + { "th", "Thai" }, + { "ti", "Tigrinya" }, + { "tk", "Turkmen" }, + { "tl", "Filipino" }, + { "tn", "Tswana" }, + { "tr", "Turkish" }, + { "ts", "Tsonga" }, + { "tt", "Tatar" }, + { "ug", "Uighur" }, + { "uk", "Ukrainian" }, + { "ur", "Urdu" }, + { "uz", "Uzbek" }, + { "uz", "Uzbek (Latin)" }, + { "uz@cyrillic", "Uzbek (Cyrillic)" }, + { "ve", "Venda" }, + { "vi", "Vietnamese" }, + { "wen", "Sorbian" }, + { "wo", "Wolof" }, + { "xh", "Xhosa" }, + { "yi", "Yiddish" }, + { "yo", "Yoruba" }, + { "zh", "Chinese" }, + { "zu", "Zulu" } + }; + +/* Table from ISO 3166 country code to English name. + Keep in sync with the gl_locale_name_from_win32_LANGID function in + localename.c! */ +static const struct table_entry country_table[] = + { + { "AE", "U.A.E." }, + { "AF", "Afghanistan" }, + { "AL", "Albania" }, + { "AM", "Armenia" }, + { "AN", "Netherlands Antilles" }, + { "AR", "Argentina" }, + { "AT", "Austria" }, + { "AU", "Australia" }, + { "AZ", "Azerbaijan" }, + { "BA", "Bosnia and Herzegovina" }, + { "BD", "Bangladesh" }, + { "BE", "Belgium" }, + { "BG", "Bulgaria" }, + { "BH", "Bahrain" }, + { "BN", "Brunei Darussalam" }, + { "BO", "Bolivia" }, + { "BR", "Brazil" }, + { "BT", "Bhutan" }, + { "BY", "Belarus" }, + { "BZ", "Belize" }, + { "CA", "Canada" }, + { "CG", "Congo" }, + { "CH", "Switzerland" }, + { "CI", "Cote d'Ivoire" }, + { "CL", "Chile" }, + { "CM", "Cameroon" }, + { "CN", "People's Republic of China" }, + { "CO", "Colombia" }, + { "CR", "Costa Rica" }, + { "CS", "Serbia and Montenegro" }, + { "CZ", "Czech Republic" }, + { "DE", "Germany" }, + { "DK", "Denmark" }, + { "DO", "Dominican Republic" }, + { "DZ", "Algeria" }, + { "EC", "Ecuador" }, + { "EE", "Estonia" }, + { "EG", "Egypt" }, + { "ER", "Eritrea" }, + { "ES", "Spain" }, + { "ET", "Ethiopia" }, + { "FI", "Finland" }, + { "FO", "Faroe Islands" }, + { "FR", "France" }, + { "GB", "United Kingdom" }, + { "GD", "Caribbean" }, + { "GE", "Georgia" }, + { "GL", "Greenland" }, + { "GR", "Greece" }, + { "GT", "Guatemala" }, + { "HK", "Hong Kong" }, + { "HK", "Hong Kong S.A.R." }, + { "HN", "Honduras" }, + { "HR", "Croatia" }, + { "HT", "Haiti" }, + { "HU", "Hungary" }, + { "ID", "Indonesia" }, + { "IE", "Ireland" }, + { "IL", "Israel" }, + { "IN", "India" }, + { "IQ", "Iraq" }, + { "IR", "Iran" }, + { "IS", "Iceland" }, + { "IT", "Italy" }, + { "JM", "Jamaica" }, + { "JO", "Jordan" }, + { "JP", "Japan" }, + { "KE", "Kenya" }, + { "KG", "Kyrgyzstan" }, + { "KH", "Cambodia" }, + { "KR", "South Korea" }, + { "KW", "Kuwait" }, + { "KZ", "Kazakhstan" }, + { "LA", "Laos" }, + { "LB", "Lebanon" }, + { "LI", "Liechtenstein" }, + { "LK", "Sri Lanka" }, + { "LT", "Lithuania" }, + { "LU", "Luxembourg" }, + { "LV", "Latvia" }, + { "LY", "Libya" }, + { "MA", "Morocco" }, + { "MC", "Principality of Monaco" }, + { "MD", "Moldava" }, + { "MD", "Moldova" }, + { "ME", "Montenegro" }, + { "MK", "Former Yugoslav Republic of Macedonia" }, + { "ML", "Mali" }, + { "MM", "Myanmar" }, + { "MN", "Mongolia" }, + { "MO", "Macau S.A.R." }, + { "MT", "Malta" }, + { "MV", "Maldives" }, + { "MX", "Mexico" }, + { "MY", "Malaysia" }, + { "NG", "Nigeria" }, + { "NI", "Nicaragua" }, + { "NL", "Netherlands" }, + { "NO", "Norway" }, + { "NP", "Nepal" }, + { "NZ", "New Zealand" }, + { "OM", "Oman" }, + { "PA", "Panama" }, + { "PE", "Peru" }, + { "PH", "Philippines" }, + { "PK", "Islamic Republic of Pakistan" }, + { "PL", "Poland" }, + { "PR", "Puerto Rico" }, + { "PT", "Portugal" }, + { "PY", "Paraguay" }, + { "QA", "Qatar" }, + { "RE", "Reunion" }, + { "RO", "Romania" }, + { "RS", "Serbia" }, + { "RU", "Russia" }, + { "RW", "Rwanda" }, + { "SA", "Saudi Arabia" }, + { "SE", "Sweden" }, + { "SG", "Singapore" }, + { "SI", "Slovenia" }, + { "SK", "Slovak" }, + { "SN", "Senegal" }, + { "SO", "Somalia" }, + { "SR", "Suriname" }, + { "SV", "El Salvador" }, + { "SY", "Syria" }, + { "TH", "Thailand" }, + { "TJ", "Tajikistan" }, + { "TM", "Turkmenistan" }, + { "TN", "Tunisia" }, + { "TR", "Turkey" }, + { "TT", "Trinidad and Tobago" }, + { "TW", "Taiwan" }, + { "TZ", "Tanzania" }, + { "UA", "Ukraine" }, + { "US", "United States" }, + { "UY", "Uruguay" }, + { "VA", "Vatican" }, + { "VE", "Venezuela" }, + { "VN", "Viet Nam" }, + { "YE", "Yemen" }, + { "ZA", "South Africa" }, + { "ZW", "Zimbabwe" } + }; + +/* Given a string STRING, find the set of indices i such that TABLE[i].code is + the given STRING. It is a range [lo,hi-1]. */ +typedef struct { size_t lo; size_t hi; } range_t; +static void +search (const struct table_entry *table, size_t table_size, const char *string, + range_t *result) +{ + /* The table is sorted. Perform a binary search. */ + size_t hi = table_size; + size_t lo = 0; + while (lo < hi) + { + /* Invariant: + for i < lo, strcmp (table[i].code, string) < 0, + for i >= hi, strcmp (table[i].code, string) > 0. */ + size_t mid = (hi + lo) >> 1; /* >= lo, < hi */ + int cmp = strcmp (table[mid].code, string); + if (cmp < 0) + lo = mid + 1; + else if (cmp > 0) + hi = mid; + else + { + /* Found an i with + strcmp (language_table[i].code, string) == 0. + Find the entire interval of such i. */ + { + size_t i; + + for (i = mid; i > lo; ) + { + i--; + if (strcmp (table[i].code, string) < 0) + { + lo = i + 1; + break; + } + } + } + { + size_t i; + + for (i = mid; i < hi; i++) + { + if (strcmp (table[i].code, string) > 0) + { + hi = i; + break; + } + } + } + /* The set of i with + strcmp (language_table[i].code, string) == 0 + is the interval [lo, hi-1]. */ + break; + } + } + result->lo = lo; + result->hi = hi; +} + +/* Like setlocale, but accept also locale names in the form ll or ll_CC, + where ll is an ISO 639 language code and CC is an ISO 3166 country code. */ +static char * +setlocale_unixlike (int category, const char *locale) +{ + char *result; + char llCC_buf[64]; + char ll_buf[64]; + char CC_buf[64]; + + /* The native Windows implementation of setlocale understands the special + locale name "C", but not "POSIX". Therefore map "POSIX" to "C". */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + if (locale != NULL && strcmp (locale, "POSIX") == 0) + locale = "C"; +#endif + + /* First, try setlocale with the original argument unchanged. */ + result = setlocale (category, locale); + if (result != NULL) + return result; + + /* Otherwise, assume the argument is in the form + language[_territory][.codeset][@modifier] + and try to map it using the tables. */ + if (strlen (locale) < sizeof (llCC_buf)) + { + /* Second try: Remove the codeset part. */ + { + const char *p = locale; + char *q = llCC_buf; + + /* Copy the part before the dot. */ + for (; *p != '\0' && *p != '.'; p++, q++) + *q = *p; + if (*p == '.') + /* Skip the part up to the '@', if any. */ + for (; *p != '\0' && *p != '@'; p++) + ; + /* Copy the part starting with '@', if any. */ + for (; *p != '\0'; p++, q++) + *q = *p; + *q = '\0'; + } + /* llCC_buf now contains + language[_territory][@modifier] + */ + if (strcmp (llCC_buf, locale) != 0) + { + result = setlocale (category, llCC_buf); + if (result != NULL) + return result; + } + /* Look it up in language_table. */ + { + range_t range; + size_t i; + + search (language_table, + sizeof (language_table) / sizeof (language_table[0]), + llCC_buf, + &range); + + for (i = range.lo; i < range.hi; i++) + { + /* Try the replacement in language_table[i]. */ + result = setlocale (category, language_table[i].english); + if (result != NULL) + return result; + } + } + /* Split language[_territory][@modifier] + into ll_buf = language[@modifier] + and CC_buf = territory + */ + { + const char *underscore = strchr (llCC_buf, '_'); + if (underscore != NULL) + { + const char *territory_start = underscore + 1; + const char *territory_end = strchr (territory_start, '@'); + if (territory_end == NULL) + territory_end = territory_start + strlen (territory_start); + + memcpy (ll_buf, llCC_buf, underscore - llCC_buf); + strcpy (ll_buf + (underscore - llCC_buf), territory_end); + + memcpy (CC_buf, territory_start, territory_end - territory_start); + CC_buf[territory_end - territory_start] = '\0'; + + { + /* Look up ll_buf in language_table + and CC_buf in country_table. */ + range_t language_range; + + search (language_table, + sizeof (language_table) / sizeof (language_table[0]), + ll_buf, + &language_range); + if (language_range.lo < language_range.hi) + { + range_t country_range; + + search (country_table, + sizeof (country_table) / sizeof (country_table[0]), + CC_buf, + &country_range); + if (country_range.lo < country_range.hi) + { + size_t i; + size_t j; + + for (i = language_range.lo; i < language_range.hi; i++) + for (j = country_range.lo; j < country_range.hi; j++) + { + /* Concatenate the replacements. */ + const char *part1 = language_table[i].english; + size_t part1_len = strlen (part1); + const char *part2 = country_table[j].english; + size_t part2_len = strlen (part2) + 1; + char buf[64+64]; + + if (!(part1_len + 1 + part2_len <= sizeof (buf))) + abort (); + memcpy (buf, part1, part1_len); + buf[part1_len] = '_'; + memcpy (buf + part1_len + 1, part2, part2_len); + + /* Try the concatenated replacements. */ + result = setlocale (category, buf); + if (result != NULL) + return result; + } + } + + /* Try omitting the country entirely. This may set a locale + corresponding to the wrong country, but is better than + failing entirely. */ + { + size_t i; + + for (i = language_range.lo; i < language_range.hi; i++) + { + /* Try only the language replacement. */ + result = + setlocale (category, language_table[i].english); + if (result != NULL) + return result; + } + } + } + } + } + } + } + + /* Failed. */ + return NULL; +} + +# else +# define setlocale_unixlike setlocale +# endif + +# if LC_MESSAGES == 1729 + +/* The system does not store an LC_MESSAGES locale category. Do it here. */ +static char lc_messages_name[64] = "C"; + +/* Like setlocale, but support also LC_MESSAGES. */ +static char * +setlocale_single (int category, const char *locale) +{ + if (category == LC_MESSAGES) + { + if (locale != NULL) + { + lc_messages_name[sizeof (lc_messages_name) - 1] = '\0'; + strncpy (lc_messages_name, locale, sizeof (lc_messages_name) - 1); + } + return lc_messages_name; + } + else + return setlocale_unixlike (category, locale); +} + +# else +# define setlocale_single setlocale_unixlike +# endif + +char * +rpl_setlocale (int category, const char *locale) +{ + if (locale != NULL && locale[0] == '\0') + { + /* A request to the set the current locale to the default locale. */ + if (category == LC_ALL) + { + /* Set LC_CTYPE first. Then the other categories. */ + static int const categories[] = + { + LC_NUMERIC, + LC_TIME, + LC_COLLATE, + LC_MONETARY, + LC_MESSAGES + }; + char *saved_locale; + const char *base_name; + unsigned int i; + + /* Back up the old locale, in case one of the steps fails. */ + saved_locale = setlocale (LC_ALL, NULL); + if (saved_locale == NULL) + return NULL; + saved_locale = strdup (saved_locale); + if (saved_locale == NULL) + return NULL; + + /* Set LC_CTYPE category. Set all other categories (except possibly + LC_MESSAGES) to the same value in the same call; this is likely to + save calls. */ + base_name = + gl_locale_name_environ (LC_CTYPE, category_to_name (LC_CTYPE)); + if (base_name == NULL) + base_name = gl_locale_name_default (); + + if (setlocale_unixlike (LC_ALL, base_name) == NULL) + goto fail; +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* On native Windows, setlocale(LC_ALL,...) may succeed but set the + LC_CTYPE category to an invalid value ("C") when it does not + support the specified encoding. Report a failure instead. */ + if (strchr (base_name, '.') != NULL + && strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + goto fail; +# endif + + for (i = 0; i < sizeof (categories) / sizeof (categories[0]); i++) + { + int cat = categories[i]; + const char *name; + + name = gl_locale_name_environ (cat, category_to_name (cat)); + if (name == NULL) + name = gl_locale_name_default (); + + /* If name is the same as base_name, it has already been set + through the setlocale call before the loop. */ + if (strcmp (name, base_name) != 0 +# if LC_MESSAGES == 1729 + || cat == LC_MESSAGES +# endif + ) + if (setlocale_single (cat, name) == NULL) + goto fail; + } + + /* All steps were successful. */ + free (saved_locale); + return setlocale (LC_ALL, NULL); + + fail: + if (saved_locale[0] != '\0') /* don't risk an endless recursion */ + setlocale (LC_ALL, saved_locale); + free (saved_locale); + return NULL; + } + else + { + const char *name = + gl_locale_name_environ (category, category_to_name (category)); + if (name == NULL) + name = gl_locale_name_default (); + + return setlocale_single (category, name); + } + } + else + { +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + if (category == LC_ALL && locale != NULL && strchr (locale, '.') != NULL) + { + char *saved_locale; + + /* Back up the old locale. */ + saved_locale = setlocale (LC_ALL, NULL); + if (saved_locale == NULL) + return NULL; + saved_locale = strdup (saved_locale); + if (saved_locale == NULL) + return NULL; + + if (setlocale_unixlike (LC_ALL, locale) == NULL) + { + free (saved_locale); + return NULL; + } + + /* On native Windows, setlocale(LC_ALL,...) may succeed but set the + LC_CTYPE category to an invalid value ("C") when it does not + support the specified encoding. Report a failure instead. */ + if (strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + { + if (saved_locale[0] != '\0') /* don't risk an endless recursion */ + setlocale (LC_ALL, saved_locale); + free (saved_locale); + return NULL; + } + + /* It was really successful. */ + free (saved_locale); + return setlocale (LC_ALL, NULL); + } + else +# endif + return setlocale_single (category, locale); + } +} + +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/setsockopt.c b/local/recipes/tools/diffutils/source/gnulib-tests/setsockopt.c new file mode 100644 index 0000000000..157e4b6b1a --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/setsockopt.c @@ -0,0 +1,65 @@ +/* setsockopt.c --- wrappers for Windows setsockopt function + + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paolo Bonzini */ + +#include <config.h> + +#define WIN32_LEAN_AND_MEAN +/* Get winsock2.h. */ +#include <sys/socket.h> + +/* Get struct timeval. */ +#include <sys/time.h> + +/* Get set_winsock_errno, FD_TO_SOCKET etc. */ +#include "w32sock.h" + +#undef setsockopt + +int +rpl_setsockopt (int fd, int level, int optname, const void *optval, socklen_t optlen) +{ + SOCKET sock = FD_TO_SOCKET (fd); + int r; + + if (sock == INVALID_SOCKET) + { + errno = EBADF; + return -1; + } + else + { + if (level == SOL_SOCKET + && (optname == SO_RCVTIMEO || optname == SO_SNDTIMEO)) + { + const struct timeval *tv = optval; + int milliseconds = tv->tv_sec * 1000 + tv->tv_usec / 1000; + optval = &milliseconds; + r = setsockopt (sock, level, optname, optval, sizeof (int)); + } + else + { + r = setsockopt (sock, level, optname, optval, optlen); + } + + if (r < 0) + set_winsock_errno (); + + return r; + } +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/signature.h b/local/recipes/tools/diffutils/source/gnulib-tests/signature.h new file mode 100644 index 0000000000..0fdfc1155e --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/signature.h @@ -0,0 +1,48 @@ +/* Macro for checking that a function declaration is compliant. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef SIGNATURE_CHECK + +/* Check that the function FN takes the specified arguments ARGS with + a return type of RET. This header is designed to be included after + <config.h> and the one system header that is supposed to contain + the function being checked, but prior to any other system headers + that are necessary for the unit test. Therefore, this file does + not include any system headers, nor reference anything outside of + the macro arguments. For an example, if foo.h should provide: + + extern int foo (char, float); + + then the unit test named test-foo.c would start out with: + + #include <config.h> + #include <foo.h> + #include "signature.h" + SIGNATURE_CHECK (foo, int, (char, float)); + #include <other.h> + ... +*/ +# define SIGNATURE_CHECK(fn, ret, args) \ + SIGNATURE_CHECK1 (fn, ret, args, __LINE__) + +/* Necessary to allow multiple SIGNATURE_CHECK lines in a unit test. + Note that the checks must not occupy the same line. */ +# define SIGNATURE_CHECK1(fn, ret, args, id) \ + SIGNATURE_CHECK2 (fn, ret, args, id) /* macroexpand line */ +# define SIGNATURE_CHECK2(fn, ret, args, id) \ + static ret (* _GL_UNUSED signature_check ## id) args = fn + +#endif /* SIGNATURE_CHECK */ diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/sleep.c b/local/recipes/tools/diffutils/source/gnulib-tests/sleep.c new file mode 100644 index 0000000000..8a8fe7c25e --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/sleep.c @@ -0,0 +1,76 @@ +/* Pausing execution of the current thread. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2007. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <unistd.h> + +#include <limits.h> + +#include "verify.h" + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +# define WIN32_LEAN_AND_MEAN /* avoid including junk */ +# include <windows.h> + +unsigned int +sleep (unsigned int seconds) +{ + unsigned int remaining; + + /* Sleep for 1 second many times, because + 1. Sleep is not interruptible by Ctrl-C, + 2. we want to avoid arithmetic overflow while multiplying with 1000. */ + for (remaining = seconds; remaining > 0; remaining--) + Sleep (1000); + + return remaining; +} + +#elif HAVE_SLEEP + +# undef sleep + +/* Guarantee unlimited sleep and a reasonable return value. Cygwin + 1.5.x rejects attempts to sleep more than 49.7 days (2**32 + milliseconds), but uses uninitialized memory which results in a + garbage answer. Similarly, Linux 2.6.9 with glibc 2.3.4 has a too + small return value when asked to sleep more than 24.85 days. */ +unsigned int +rpl_sleep (unsigned int seconds) +{ + /* This requires int larger than 16 bits. */ + verify (UINT_MAX / 24 / 24 / 60 / 60); + const unsigned int limit = 24 * 24 * 60 * 60; + while (limit < seconds) + { + unsigned int result; + seconds -= limit; + result = sleep (limit); + if (result) + return seconds + result; + } + return sleep (seconds); +} + +#else /* !HAVE_SLEEP */ + + #error "Please port gnulib sleep.c to your platform, possibly using usleep() or select(), then report this to bug-gnulib." + +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/snprintf.c b/local/recipes/tools/diffutils/source/gnulib-tests/snprintf.c new file mode 100644 index 0000000000..d66302f5e0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/snprintf.c @@ -0,0 +1,71 @@ +/* Formatted output to strings. + Copyright (C) 2004, 2006-2017 Free Software Foundation, Inc. + Written by Simon Josefsson and Paul Eggert. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <stdio.h> + +#include <errno.h> +#include <limits.h> +#include <stdarg.h> +#include <stdlib.h> +#include <string.h> + +#include "vasnprintf.h" + +/* Print formatted output to string STR. Similar to sprintf, but + additional length SIZE limit how much is written into STR. Returns + string length of formatted string (which may be larger than SIZE). + STR may be NULL, in which case nothing will be written. On error, + return a negative value. */ +int +snprintf (char *str, size_t size, const char *format, ...) +{ + char *output; + size_t len; + size_t lenbuf = size; + va_list args; + + va_start (args, format); + output = vasnprintf (str, &lenbuf, format, args); + len = lenbuf; + va_end (args); + + if (!output) + return -1; + + if (output != str) + { + if (size) + { + size_t pruned_len = (len < size ? len : size - 1); + memcpy (str, output, pruned_len); + str[pruned_len] = '\0'; + } + + free (output); + } + + if (INT_MAX < len) + { + errno = EOVERFLOW; + return -1; + } + + return len; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/socket.c b/local/recipes/tools/diffutils/source/gnulib-tests/socket.c new file mode 100644 index 0000000000..47aa557356 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/socket.c @@ -0,0 +1,49 @@ +/* socket.c --- wrappers for Windows socket function + + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paolo Bonzini */ + +#include <config.h> + +#define WIN32_LEAN_AND_MEAN +/* Get winsock2.h. */ +#include <sys/socket.h> + +/* Get set_winsock_errno, FD_TO_SOCKET etc. */ +#include "w32sock.h" + +#include "sockets.h" + +int +rpl_socket (int domain, int type, int protocol) +{ + SOCKET fh; + + gl_sockets_startup (SOCKETS_1_1); + + /* We have to use WSASocket() to create non-overlapped IO sockets. + Overlapped IO sockets cannot be used with read/write. */ + fh = WSASocket (domain, type, protocol, NULL, 0, 0); + + if (fh == INVALID_SOCKET) + { + set_winsock_errno (); + return -1; + } + else + return SOCKET_TO_FD (fh); +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/sockets.c b/local/recipes/tools/diffutils/source/gnulib-tests/sockets.c new file mode 100644 index 0000000000..028e20ec0e --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/sockets.c @@ -0,0 +1,161 @@ +/* sockets.c --- wrappers for Windows socket functions + + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Simon Josefsson */ + +#include <config.h> + +/* Specification. */ +#include "sockets.h" + +#if WINDOWS_SOCKETS + +/* This includes winsock2.h on MinGW. */ +# include <sys/socket.h> + +# include "fd-hook.h" +# if GNULIB_MSVC_NOTHROW +# include "msvc-nothrow.h" +# else +# include <io.h> +# endif + +/* Get set_winsock_errno, FD_TO_SOCKET etc. */ +# include "w32sock.h" + +static int +close_fd_maybe_socket (const struct fd_hook *remaining_list, + gl_close_fn primary, + int fd) +{ + /* Note about multithread-safety: There is a race condition where, between + our calls to closesocket() and the primary close(), some other thread + could make system calls that allocate precisely the same HANDLE value + as sock; then the primary close() would call CloseHandle() on it. */ + SOCKET sock; + WSANETWORKEVENTS ev; + + /* Test whether fd refers to a socket. */ + sock = FD_TO_SOCKET (fd); + ev.lNetworkEvents = 0xDEADBEEF; + WSAEnumNetworkEvents (sock, NULL, &ev); + if (ev.lNetworkEvents != 0xDEADBEEF) + { + /* fd refers to a socket. */ + /* FIXME: other applications, like squid, use an undocumented + _free_osfhnd free function. But this is not enough: The 'osfile' + flags for fd also needs to be cleared, but it is hard to access it. + Instead, here we just close twice the file descriptor. */ + if (closesocket (sock)) + { + set_winsock_errno (); + return -1; + } + else + { + /* This call frees the file descriptor and does a + CloseHandle ((HANDLE) _get_osfhandle (fd)), which fails. */ + _close (fd); + return 0; + } + } + else + /* Some other type of file descriptor. */ + return execute_close_hooks (remaining_list, primary, fd); +} + +static int +ioctl_fd_maybe_socket (const struct fd_hook *remaining_list, + gl_ioctl_fn primary, + int fd, int request, void *arg) +{ + SOCKET sock; + WSANETWORKEVENTS ev; + + /* Test whether fd refers to a socket. */ + sock = FD_TO_SOCKET (fd); + ev.lNetworkEvents = 0xDEADBEEF; + WSAEnumNetworkEvents (sock, NULL, &ev); + if (ev.lNetworkEvents != 0xDEADBEEF) + { + /* fd refers to a socket. */ + if (ioctlsocket (sock, request, arg) < 0) + { + set_winsock_errno (); + return -1; + } + else + return 0; + } + else + /* Some other type of file descriptor. */ + return execute_ioctl_hooks (remaining_list, primary, fd, request, arg); +} + +static struct fd_hook fd_sockets_hook; + +static int initialized_sockets_version /* = 0 */; + +#endif /* WINDOWS_SOCKETS */ + +int +gl_sockets_startup (int version _GL_UNUSED) +{ +#if WINDOWS_SOCKETS + if (version > initialized_sockets_version) + { + WSADATA data; + int err; + + err = WSAStartup (version, &data); + if (err != 0) + return 1; + + if (data.wVersion != version) + { + WSACleanup (); + return 2; + } + + if (initialized_sockets_version == 0) + register_fd_hook (close_fd_maybe_socket, ioctl_fd_maybe_socket, + &fd_sockets_hook); + + initialized_sockets_version = version; + } +#endif + + return 0; +} + +int +gl_sockets_cleanup (void) +{ +#if WINDOWS_SOCKETS + int err; + + initialized_sockets_version = 0; + + unregister_fd_hook (&fd_sockets_hook); + + err = WSACleanup (); + if (err != 0) + return 1; +#endif + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/sockets.h b/local/recipes/tools/diffutils/source/gnulib-tests/sockets.h new file mode 100644 index 0000000000..23ad74d2fa --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/sockets.h @@ -0,0 +1,66 @@ +/* sockets.h - wrappers for Windows socket functions + + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Simon Josefsson */ + +#ifndef SOCKETS_H +#define SOCKETS_H 1 + +#define SOCKETS_1_0 0x0001 +#define SOCKETS_1_1 0x0101 +#define SOCKETS_2_0 0x0002 +#define SOCKETS_2_1 0x0102 +#define SOCKETS_2_2 0x0202 + +int gl_sockets_startup (int version) +#ifndef WINDOWS_SOCKETS + _GL_ATTRIBUTE_CONST +#endif + ; + +int gl_sockets_cleanup (void) +#ifndef WINDOWS_SOCKETS + _GL_ATTRIBUTE_CONST +#endif + ; + +/* This function is useful it you create a socket using gnulib's + Winsock wrappers but needs to pass on the socket handle to some + other library that only accepts sockets. */ +#ifdef WINDOWS_SOCKETS + +# include <sys/socket.h> + +# if GNULIB_MSVC_NOTHROW +# include "msvc-nothrow.h" +# else +# include <io.h> +# endif + +static inline SOCKET +gl_fd_to_handle (int fd) +{ + return _get_osfhandle (fd); +} + +#else + +# define gl_fd_to_handle(x) (x) + +#endif /* WINDOWS_SOCKETS */ + +#endif /* SOCKETS_H */ diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/stdalign.in.h b/local/recipes/tools/diffutils/source/gnulib-tests/stdalign.in.h new file mode 100644 index 0000000000..ea24823170 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/stdalign.in.h @@ -0,0 +1,121 @@ +/* A substitute for ISO C11 <stdalign.h>. + + Copyright 2011-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert and Bruno Haible. */ + +#ifndef _GL_STDALIGN_H +#define _GL_STDALIGN_H + +/* ISO C11 <stdalign.h> for platforms that lack it. + + References: + ISO C11 (latest free draft + <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf>) + sections 6.5.3.4, 6.7.5, 7.15. + C++11 (latest free draft + <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf>) + section 18.10. */ + +/* alignof (TYPE), also known as _Alignof (TYPE), yields the alignment + requirement of a structure member (i.e., slot or field) that is of + type TYPE, as an integer constant expression. + + This differs from GCC's __alignof__ operator, which can yield a + better-performing alignment for an object of that type. For + example, on x86 with GCC, __alignof__ (double) and __alignof__ + (long long) are 8, whereas alignof (double) and alignof (long long) + are 4 unless the option '-malign-double' is used. + + The result cannot be used as a value for an 'enum' constant, if you + want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc. + + Include <stddef.h> for offsetof. */ +#include <stddef.h> + +/* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other + standard headers, defines conflicting implementations of _Alignas + and _Alignof that are no better than ours; override them. */ +#undef _Alignas +#undef _Alignof + +/* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023 + <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */ +#if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \ + || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9))) +# ifdef __cplusplus +# if 201103 <= __cplusplus +# define _Alignof(type) alignof (type) +# else + template <class __t> struct __alignof_helper { char __a; __t __b; }; +# define _Alignof(type) offsetof (__alignof_helper<type>, __b) +# endif +# else +# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b) +# endif +#endif +#if ! (defined __cplusplus && 201103 <= __cplusplus) +# define alignof _Alignof +#endif +#define __alignof_is_defined 1 + +/* alignas (A), also known as _Alignas (A), aligns a variable or type + to the alignment A, where A is an integer constant expression. For + example: + + int alignas (8) foo; + struct s { int a; int alignas (8) bar; }; + + aligns the address of FOO and the offset of BAR to be multiples of 8. + + A should be a power of two that is at least the type's alignment + and at most the implementation's alignment limit. This limit is + 2**28 on typical GNUish hosts, and 2**13 on MSVC. To be portable + to MSVC through at least version 10.0, A should be an integer + constant, as MSVC does not support expressions such as 1 << 3. + To be portable to Sun C 5.11, do not align auto variables to + anything stricter than their default alignment. + + The following C11 requirements are not supported here: + + - If A is zero, alignas has no effect. + - alignas can be used multiple times; the strictest one wins. + - alignas (TYPE) is equivalent to alignas (alignof (TYPE)). + + */ + +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 +# if defined __cplusplus && 201103 <= __cplusplus +# define _Alignas(a) alignas (a) +# elif ((defined __APPLE__ && defined __MACH__ \ + ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ + : __GNUC__) \ + || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ + || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__) +# define _Alignas(a) __attribute__ ((__aligned__ (a))) +# elif 1300 <= _MSC_VER +# define _Alignas(a) __declspec (align (a)) +# endif +#endif +#if ((defined _Alignas && ! (defined __cplusplus && 201103 <= __cplusplus)) \ + || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) +# define alignas _Alignas +#endif +#if defined alignas || (defined __cplusplus && 201103 <= __cplusplus) +# define __alignas_is_defined 1 +#endif + +#endif /* _GL_STDALIGN_H */ diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/strerror_r.c b/local/recipes/tools/diffutils/source/gnulib-tests/strerror_r.c new file mode 100644 index 0000000000..650751fc8d --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/strerror_r.c @@ -0,0 +1,450 @@ +/* strerror_r.c --- POSIX compatible system error routine + + Copyright (C) 2010-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2010. */ + +#include <config.h> + +/* Enable declaration of sys_nerr and sys_errlist in <errno.h> on NetBSD. */ +#define _NETBSD_SOURCE 1 + +/* Specification. */ +#include <string.h> + +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> +#if !HAVE_SNPRINTF +# include <stdarg.h> +#endif + +#include "strerror-override.h" + +#if (__GLIBC__ >= 2 || defined __UCLIBC__ || defined __CYGWIN__) && HAVE___XPG_STRERROR_R /* glibc >= 2.3.4, cygwin >= 1.7.9 */ + +# define USE_XPG_STRERROR_R 1 +extern +#ifdef __cplusplus +"C" +#endif +int __xpg_strerror_r (int errnum, char *buf, size_t buflen); + +#elif HAVE_DECL_STRERROR_R && !(__GLIBC__ >= 2 || defined __UCLIBC__ || defined __CYGWIN__) + +/* The system's strerror_r function is OK, except that its third argument + is 'int', not 'size_t', or its return type is wrong. */ + +# include <limits.h> + +# define USE_SYSTEM_STRERROR_R 1 + +#else /* (__GLIBC__ >= 2 || defined __UCLIBC__ || defined __CYGWIN__ ? !HAVE___XPG_STRERROR_R : !HAVE_DECL_STRERROR_R) */ + +/* Use the system's strerror(). Exclude glibc and cygwin because the + system strerror_r has the wrong return type, and cygwin 1.7.9 + strerror_r clobbers strerror. */ +# undef strerror + +# define USE_SYSTEM_STRERROR 1 + +# if defined __NetBSD__ || defined __hpux || ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __sgi || (defined __sun && !defined _LP64) || defined __CYGWIN__ + +/* No locking needed. */ + +/* Get catgets internationalization functions. */ +# if HAVE_CATGETS +# include <nl_types.h> +# endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Get sys_nerr, sys_errlist on HP-UX (otherwise only declared in C++ mode). + Get sys_nerr, sys_errlist on IRIX (otherwise only declared with _SGIAPI). */ +# if defined __hpux || defined __sgi +extern int sys_nerr; +extern char *sys_errlist[]; +# endif + +/* Get sys_nerr on Solaris. */ +# if defined __sun && !defined _LP64 +extern int sys_nerr; +# endif + +#ifdef __cplusplus +} +#endif + +# else + +# include "glthread/lock.h" + +/* This lock protects the buffer returned by strerror(). We assume that + no other uses of strerror() exist in the program. */ +gl_lock_define_initialized(static, strerror_lock) + +# endif + +#endif + +/* On MSVC, there is no snprintf() function, just a _snprintf(). + It is of lower quality, but sufficient for the simple use here. + We only have to make sure to NUL terminate the result (_snprintf + does not NUL terminate, like strncpy). */ +#if !HAVE_SNPRINTF +static int +local_snprintf (char *buf, size_t buflen, const char *format, ...) +{ + va_list args; + int result; + + va_start (args, format); + result = _vsnprintf (buf, buflen, format, args); + va_end (args); + if (buflen > 0 && (result < 0 || result >= buflen)) + buf[buflen - 1] = '\0'; + return result; +} +# define snprintf local_snprintf +#endif + +/* Copy as much of MSG into BUF as possible, without corrupting errno. + Return 0 if MSG fit in BUFLEN, otherwise return ERANGE. */ +static int +safe_copy (char *buf, size_t buflen, const char *msg) +{ + size_t len = strlen (msg); + int ret; + + if (len < buflen) + { + /* Although POSIX allows memcpy() to corrupt errno, we don't + know of any implementation where this is a real problem. */ + memcpy (buf, msg, len + 1); + ret = 0; + } + else + { + memcpy (buf, msg, buflen - 1); + buf[buflen - 1] = '\0'; + ret = ERANGE; + } + return ret; +} + + +int +strerror_r (int errnum, char *buf, size_t buflen) +#undef strerror_r +{ + /* Filter this out now, so that rest of this replacement knows that + there is room for a non-empty message and trailing NUL. */ + if (buflen <= 1) + { + if (buflen) + *buf = '\0'; + return ERANGE; + } + *buf = '\0'; + + /* Check for gnulib overrides. */ + { + char const *msg = strerror_override (errnum); + + if (msg) + return safe_copy (buf, buflen, msg); + } + + { + int ret; + int saved_errno = errno; + +#if USE_XPG_STRERROR_R + + { + ret = __xpg_strerror_r (errnum, buf, buflen); + if (ret < 0) + ret = errno; + if (!*buf) + { + /* glibc 2.13 would not touch buf on err, so we have to fall + back to GNU strerror_r which always returns a thread-safe + untruncated string to (partially) copy into our buf. */ + safe_copy (buf, buflen, strerror_r (errnum, buf, buflen)); + } + } + +#elif USE_SYSTEM_STRERROR_R + + if (buflen > INT_MAX) + buflen = INT_MAX; + +# ifdef __hpux + /* On HP-UX 11.31, strerror_r always fails when buflen < 80; it + also fails to change buf on EINVAL. */ + { + char stackbuf[80]; + + if (buflen < sizeof stackbuf) + { + ret = strerror_r (errnum, stackbuf, sizeof stackbuf); + if (ret == 0) + ret = safe_copy (buf, buflen, stackbuf); + } + else + ret = strerror_r (errnum, buf, buflen); + } +# else + ret = strerror_r (errnum, buf, buflen); + + /* Some old implementations may return (-1, EINVAL) instead of EINVAL. */ + if (ret < 0) + ret = errno; +# endif + +# ifdef _AIX + /* AIX returns 0 rather than ERANGE when truncating strings; try + again until we are sure we got the entire string. */ + if (!ret && strlen (buf) == buflen - 1) + { + char stackbuf[STACKBUF_LEN]; + size_t len; + strerror_r (errnum, stackbuf, sizeof stackbuf); + len = strlen (stackbuf); + /* STACKBUF_LEN should have been large enough. */ + if (len + 1 == sizeof stackbuf) + abort (); + if (buflen <= len) + ret = ERANGE; + } +# else + /* Solaris 10 does not populate buf on ERANGE. OpenBSD 4.7 + truncates early on ERANGE rather than return a partial integer. + We prefer the maximal string. We set buf[0] earlier, and we + know of no implementation that modifies buf to be an + unterminated string, so this strlen should be portable in + practice (rather than pulling in a safer strnlen). */ + if (ret == ERANGE && strlen (buf) < buflen - 1) + { + char stackbuf[STACKBUF_LEN]; + + /* STACKBUF_LEN should have been large enough. */ + if (strerror_r (errnum, stackbuf, sizeof stackbuf) == ERANGE) + abort (); + safe_copy (buf, buflen, stackbuf); + } +# endif + +#else /* USE_SYSTEM_STRERROR */ + + /* Try to do what strerror (errnum) does, but without clobbering the + buffer used by strerror(). */ + +# if defined __NetBSD__ || defined __hpux || ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __CYGWIN__ /* NetBSD, HP-UX, native Windows, Cygwin */ + + /* NetBSD: sys_nerr, sys_errlist are declared through _NETBSD_SOURCE + and <errno.h> above. + HP-UX: sys_nerr, sys_errlist are declared explicitly above. + native Windows: sys_nerr, sys_errlist are declared in <stdlib.h>. + Cygwin: sys_nerr, sys_errlist are declared in <errno.h>. */ + if (errnum >= 0 && errnum < sys_nerr) + { +# if HAVE_CATGETS && (defined __NetBSD__ || defined __hpux) +# if defined __NetBSD__ + nl_catd catd = catopen ("libc", NL_CAT_LOCALE); + const char *errmsg = + (catd != (nl_catd)-1 + ? catgets (catd, 1, errnum, sys_errlist[errnum]) + : sys_errlist[errnum]); +# endif +# if defined __hpux + nl_catd catd = catopen ("perror", NL_CAT_LOCALE); + const char *errmsg = + (catd != (nl_catd)-1 + ? catgets (catd, 1, 1 + errnum, sys_errlist[errnum]) + : sys_errlist[errnum]); +# endif +# else + const char *errmsg = sys_errlist[errnum]; +# endif + if (errmsg == NULL || *errmsg == '\0') + ret = EINVAL; + else + ret = safe_copy (buf, buflen, errmsg); +# if HAVE_CATGETS && (defined __NetBSD__ || defined __hpux) + if (catd != (nl_catd)-1) + catclose (catd); +# endif + } + else + ret = EINVAL; + +# elif defined __sgi || (defined __sun && !defined _LP64) /* IRIX, Solaris <= 9 32-bit */ + + /* For a valid error number, the system's strerror() function returns + a pointer to a not copied string, not to a buffer. */ + if (errnum >= 0 && errnum < sys_nerr) + { + char *errmsg = strerror (errnum); + + if (errmsg == NULL || *errmsg == '\0') + ret = EINVAL; + else + ret = safe_copy (buf, buflen, errmsg); + } + else + ret = EINVAL; + +# else + + gl_lock_lock (strerror_lock); + + { + char *errmsg = strerror (errnum); + + /* For invalid error numbers, strerror() on + - IRIX 6.5 returns NULL, + - HP-UX 11 returns an empty string. */ + if (errmsg == NULL || *errmsg == '\0') + ret = EINVAL; + else + ret = safe_copy (buf, buflen, errmsg); + } + + gl_lock_unlock (strerror_lock); + +# endif + +#endif + +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* MSVC 14 defines names for many error codes in the range 100..140, + but _sys_errlist contains strings only for the error codes + < _sys_nerr = 43. */ + if (ret == EINVAL) + { + const char *errmsg; + + switch (errnum) + { + case 100 /* EADDRINUSE */: + errmsg = "Address already in use"; + break; + case 101 /* EADDRNOTAVAIL */: + errmsg = "Cannot assign requested address"; + break; + case 102 /* EAFNOSUPPORT */: + errmsg = "Address family not supported by protocol"; + break; + case 103 /* EALREADY */: + errmsg = "Operation already in progress"; + break; + case 105 /* ECANCELED */: + errmsg = "Operation canceled"; + break; + case 106 /* ECONNABORTED */: + errmsg = "Software caused connection abort"; + break; + case 107 /* ECONNREFUSED */: + errmsg = "Connection refused"; + break; + case 108 /* ECONNRESET */: + errmsg = "Connection reset by peer"; + break; + case 109 /* EDESTADDRREQ */: + errmsg = "Destination address required"; + break; + case 110 /* EHOSTUNREACH */: + errmsg = "No route to host"; + break; + case 112 /* EINPROGRESS */: + errmsg = "Operation now in progress"; + break; + case 113 /* EISCONN */: + errmsg = "Transport endpoint is already connected"; + break; + case 114 /* ELOOP */: + errmsg = "Too many levels of symbolic links"; + break; + case 115 /* EMSGSIZE */: + errmsg = "Message too long"; + break; + case 116 /* ENETDOWN */: + errmsg = "Network is down"; + break; + case 117 /* ENETRESET */: + errmsg = "Network dropped connection on reset"; + break; + case 118 /* ENETUNREACH */: + errmsg = "Network is unreachable"; + break; + case 119 /* ENOBUFS */: + errmsg = "No buffer space available"; + break; + case 123 /* ENOPROTOOPT */: + errmsg = "Protocol not available"; + break; + case 126 /* ENOTCONN */: + errmsg = "Transport endpoint is not connected"; + break; + case 128 /* ENOTSOCK */: + errmsg = "Socket operation on non-socket"; + break; + case 129 /* ENOTSUP */: + errmsg = "Not supported"; + break; + case 130 /* EOPNOTSUPP */: + errmsg = "Operation not supported"; + break; + case 132 /* EOVERFLOW */: + errmsg = "Value too large for defined data type"; + break; + case 133 /* EOWNERDEAD */: + errmsg = "Owner died"; + break; + case 134 /* EPROTO */: + errmsg = "Protocol error"; + break; + case 135 /* EPROTONOSUPPORT */: + errmsg = "Protocol not supported"; + break; + case 136 /* EPROTOTYPE */: + errmsg = "Protocol wrong type for socket"; + break; + case 138 /* ETIMEDOUT */: + errmsg = "Connection timed out"; + break; + case 140 /* EWOULDBLOCK */: + errmsg = "Operation would block"; + break; + default: + errmsg = NULL; + break; + } + if (errmsg != NULL) + ret = safe_copy (buf, buflen, errmsg); + } +#endif + + if (ret == EINVAL && !*buf) + snprintf (buf, buflen, "Unknown error %d", errnum); + + errno = saved_errno; + return ret; + } +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/symlink.c b/local/recipes/tools/diffutils/source/gnulib-tests/symlink.c new file mode 100644 index 0000000000..60d4c14fea --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/symlink.c @@ -0,0 +1,57 @@ +/* Stub for symlink(). + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <unistd.h> + +#include <errno.h> +#include <string.h> +#include <sys/stat.h> + + +#if HAVE_SYMLINK + +# undef symlink + +/* Create a symlink, but reject trailing slash. */ +int +rpl_symlink (char const *contents, char const *name) +{ + size_t len = strlen (name); + if (len && name[len - 1] == '/') + { + struct stat st; + if (lstat (name, &st) == 0) + errno = EEXIST; + return -1; + } + return symlink (contents, name); +} + +#else /* !HAVE_SYMLINK */ + +/* The system does not support symlinks. */ +int +symlink (char const *contents _GL_UNUSED, + char const *name _GL_UNUSED) +{ + errno = ENOSYS; + return -1; +} + +#endif /* !HAVE_SYMLINK */ diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/sys_ioctl.in.h b/local/recipes/tools/diffutils/source/gnulib-tests/sys_ioctl.in.h new file mode 100644 index 0000000000..7d410cdb8c --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/sys_ioctl.in.h @@ -0,0 +1,78 @@ +/* Substitute for and wrapper around <sys/ioctl.h>. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _@GUARD_PREFIX@_SYS_IOCTL_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_SYS_IOCTL_H@ +# @INCLUDE_NEXT@ @NEXT_SYS_IOCTL_H@ +#endif + +#ifndef _@GUARD_PREFIX@_SYS_IOCTL_H +#define _@GUARD_PREFIX@_SYS_IOCTL_H + +/* AIX 5.1 and Solaris 10 declare ioctl() in <unistd.h> and in <stropts.h>, + but not in <sys/ioctl.h>. + But avoid namespace pollution on glibc systems. */ +#ifndef __GLIBC__ +# include <unistd.h> +#endif + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + + +/* Declare overridden functions. */ + +#if @GNULIB_IOCTL@ +# if @REPLACE_IOCTL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef ioctl +# define ioctl rpl_ioctl +# endif +_GL_FUNCDECL_RPL (ioctl, int, + (int fd, int request, ... /* {void *,char *} arg */)); +_GL_CXXALIAS_RPL (ioctl, int, + (int fd, int request, ... /* {void *,char *} arg */)); +# else +# if @SYS_IOCTL_H_HAVE_WINSOCK2_H@ || 1 +_GL_FUNCDECL_SYS (ioctl, int, + (int fd, int request, ... /* {void *,char *} arg */)); +# endif +_GL_CXXALIAS_SYS (ioctl, int, + (int fd, int request, ... /* {void *,char *} arg */)); +# endif +_GL_CXXALIASWARN (ioctl); +#elif @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +# undef ioctl +# define ioctl ioctl_used_without_requesting_gnulib_module_ioctl +#elif defined GNULIB_POSIXCHECK +# undef ioctl +# if HAVE_RAW_DECL_IOCTL +_GL_WARN_ON_USE (ioctl, "ioctl does not portably work on sockets - " + "use gnulib module ioctl for portability"); +# endif +#endif + + +#endif /* _@GUARD_PREFIX@_SYS_IOCTL_H */ +#endif /* _@GUARD_PREFIX@_SYS_IOCTL_H */ diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/sys_select.in.h b/local/recipes/tools/diffutils/source/gnulib-tests/sys_select.in.h new file mode 100644 index 0000000000..616e77dd4c --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/sys_select.in.h @@ -0,0 +1,319 @@ +/* Substitute for <sys/select.h>. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +# if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +# endif +@PRAGMA_COLUMNS@ + +/* On OSF/1 and Solaris 2.6, <sys/types.h> and <sys/time.h> + both include <sys/select.h>. + On Cygwin, <sys/time.h> includes <sys/select.h>. + Simply delegate to the system's header in this case. */ +#if (@HAVE_SYS_SELECT_H@ \ + && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H \ + && ((defined __osf__ && defined _SYS_TYPES_H_ \ + && defined _OSF_SOURCE) \ + || (defined __sun && defined _SYS_TYPES_H \ + && (! (defined _XOPEN_SOURCE || defined _POSIX_C_SOURCE) \ + || defined __EXTENSIONS__)))) + +# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H +# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@ + +#elif (@HAVE_SYS_SELECT_H@ \ + && (defined _CYGWIN_SYS_TIME_H \ + || (!defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H \ + && ((defined __osf__ && defined _SYS_TIME_H_ \ + && defined _OSF_SOURCE) \ + || (defined __sun && defined _SYS_TIME_H \ + && (! (defined _XOPEN_SOURCE \ + || defined _POSIX_C_SOURCE) \ + || defined __EXTENSIONS__)))))) + +# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H +# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@ + +/* On IRIX 6.5, <sys/timespec.h> includes <sys/types.h>, which includes + <sys/bsd_types.h>, which includes <sys/select.h>. At this point we cannot + include <signal.h>, because that includes <internal/signal_core.h>, which + gives a syntax error because <sys/timespec.h> has not been completely + processed. Simply delegate to the system's header in this case. */ +#elif @HAVE_SYS_SELECT_H@ && defined __sgi && (defined _SYS_BSD_TYPES_H && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_BSD_TYPES_H) + +# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_BSD_TYPES_H +# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@ + +/* On OpenBSD 5.0, <pthread.h> includes <sys/types.h>, which includes + <sys/select.h>. At this point we cannot include <signal.h>, because that + includes gnulib's pthread.h override, which gives a syntax error because + /usr/include/pthread.h has not been completely processed. Simply delegate + to the system's header in this case. */ +#elif @HAVE_SYS_SELECT_H@ && defined __OpenBSD__ && (defined _PTHREAD_H_ && !defined PTHREAD_MUTEX_INITIALIZER) + +# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@ + +#else + +#ifndef _@GUARD_PREFIX@_SYS_SELECT_H + +/* On many platforms, <sys/select.h> assumes prior inclusion of + <sys/types.h>. Also, mingw defines sigset_t there, instead of + in <signal.h> where it belongs. */ +#include <sys/types.h> + +#if @HAVE_SYS_SELECT_H@ + +/* On OSF/1 4.0, <sys/select.h> provides only a forward declaration + of 'struct timeval', and no definition of this type. + Also, Mac OS X, AIX, HP-UX, IRIX, Solaris, Interix declare select() + in <sys/time.h>. + But avoid namespace pollution on glibc systems and "unknown type + name" problems on Cygwin. */ +# if !(defined __GLIBC__ || defined __CYGWIN__) +# include <sys/time.h> +# endif + +/* On AIX 7 and Solaris 10, <sys/select.h> provides an FD_ZERO implementation + that relies on memset(), but without including <string.h>. + But in any case avoid namespace pollution on glibc systems. */ +# if (defined __OpenBSD__ || defined _AIX || defined __sun || defined __osf__ || defined __BEOS__) \ + && ! defined __GLIBC__ +# include <string.h> +# endif + +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@ + +#endif + +/* Get definition of 'sigset_t'. + But avoid namespace pollution on glibc systems and "unknown type + name" problems on Cygwin. + Do this after the include_next (for the sake of OpenBSD 5.0) but before + the split double-inclusion guard (for the sake of Solaris). */ +#if !((defined __GLIBC__ || defined __CYGWIN__) && !defined __UCLIBC__) +# include <signal.h> +#endif + +#ifndef _@GUARD_PREFIX@_SYS_SELECT_H +#define _@GUARD_PREFIX@_SYS_SELECT_H + +#if !@HAVE_SYS_SELECT_H@ +/* A platform that lacks <sys/select.h>. */ +/* Get the 'struct timeval' and 'fd_set' types and the FD_* macros + on most platforms. */ +# include <sys/time.h> +/* On HP-UX 11, <sys/time.h> provides an FD_ZERO implementation + that relies on memset(), but without including <string.h>. */ +# if defined __hpux +# include <string.h> +# endif +/* On native Windows platforms: + Get the 'fd_set' type. + Get the close() declaration before we override it. */ +# if @HAVE_WINSOCK2_H@ +# if !defined _GL_INCLUDING_WINSOCK2_H +# define _GL_INCLUDING_WINSOCK2_H +# include <winsock2.h> +# undef _GL_INCLUDING_WINSOCK2_H +# endif +# include <io.h> +# endif +#endif + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + + +/* Fix some definitions from <winsock2.h>. */ + +#if @HAVE_WINSOCK2_H@ + +# if !GNULIB_defined_rpl_fd_isset + +/* Re-define FD_ISSET to avoid a WSA call while we are not using + network sockets. */ +static int +rpl_fd_isset (SOCKET fd, fd_set * set) +{ + u_int i; + if (set == NULL) + return 0; + + for (i = 0; i < set->fd_count; i++) + if (set->fd_array[i] == fd) + return 1; + + return 0; +} + +# define GNULIB_defined_rpl_fd_isset 1 +# endif + +# undef FD_ISSET +# define FD_ISSET(fd, set) rpl_fd_isset(fd, set) + +#endif + +/* Hide some function declarations from <winsock2.h>. */ + +#if @HAVE_WINSOCK2_H@ +# if !defined _@GUARD_PREFIX@_UNISTD_H +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef close +# define close close_used_without_including_unistd_h +# else + _GL_WARN_ON_USE (close, + "close() used without including <unistd.h>"); +# endif +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef gethostname +# define gethostname gethostname_used_without_including_unistd_h +# else + _GL_WARN_ON_USE (gethostname, + "gethostname() used without including <unistd.h>"); +# endif +# endif +# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef socket +# define socket socket_used_without_including_sys_socket_h +# undef connect +# define connect connect_used_without_including_sys_socket_h +# undef accept +# define accept accept_used_without_including_sys_socket_h +# undef bind +# define bind bind_used_without_including_sys_socket_h +# undef getpeername +# define getpeername getpeername_used_without_including_sys_socket_h +# undef getsockname +# define getsockname getsockname_used_without_including_sys_socket_h +# undef getsockopt +# define getsockopt getsockopt_used_without_including_sys_socket_h +# undef listen +# define listen listen_used_without_including_sys_socket_h +# undef recv +# define recv recv_used_without_including_sys_socket_h +# undef send +# define send send_used_without_including_sys_socket_h +# undef recvfrom +# define recvfrom recvfrom_used_without_including_sys_socket_h +# undef sendto +# define sendto sendto_used_without_including_sys_socket_h +# undef setsockopt +# define setsockopt setsockopt_used_without_including_sys_socket_h +# undef shutdown +# define shutdown shutdown_used_without_including_sys_socket_h +# else + _GL_WARN_ON_USE (socket, + "socket() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (connect, + "connect() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (accept, + "accept() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (bind, + "bind() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (getpeername, + "getpeername() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (getsockname, + "getsockname() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (getsockopt, + "getsockopt() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (listen, + "listen() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (recv, + "recv() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (send, + "send() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (recvfrom, + "recvfrom() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (sendto, + "sendto() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (setsockopt, + "setsockopt() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (shutdown, + "shutdown() used without including <sys/socket.h>"); +# endif +# endif +#endif + + +#if @GNULIB_PSELECT@ +# if @REPLACE_PSELECT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pselect +# define pselect rpl_pselect +# endif +_GL_FUNCDECL_RPL (pselect, int, + (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, + struct timespec const *restrict, const sigset_t *restrict)); +_GL_CXXALIAS_RPL (pselect, int, + (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, + struct timespec const *restrict, const sigset_t *restrict)); +# else +# if !@HAVE_PSELECT@ +_GL_FUNCDECL_SYS (pselect, int, + (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, + struct timespec const *restrict, const sigset_t *restrict)); +# endif +_GL_CXXALIAS_SYS (pselect, int, + (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, + struct timespec const *restrict, const sigset_t *restrict)); +# endif +_GL_CXXALIASWARN (pselect); +#elif defined GNULIB_POSIXCHECK +# undef pselect +# if HAVE_RAW_DECL_PSELECT +_GL_WARN_ON_USE (pselect, "pselect is not portable - " + "use gnulib module pselect for portability"); +# endif +#endif + +#if @GNULIB_SELECT@ +# if @REPLACE_SELECT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef select +# define select rpl_select +# endif +_GL_FUNCDECL_RPL (select, int, + (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, + struct timeval *restrict)); +_GL_CXXALIAS_RPL (select, int, + (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, + struct timeval *restrict)); +# else +_GL_CXXALIAS_SYS (select, int, + (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, + struct timeval *restrict)); +# endif +_GL_CXXALIASWARN (select); +#elif @HAVE_WINSOCK2_H@ +# undef select +# define select select_used_without_requesting_gnulib_module_select +#elif defined GNULIB_POSIXCHECK +# undef select +# if HAVE_RAW_DECL_SELECT +_GL_WARN_ON_USE (select, "select is not always POSIX compliant - " + "use gnulib module select for portability"); +# endif +#endif + + +#endif /* _@GUARD_PREFIX@_SYS_SELECT_H */ +#endif /* _@GUARD_PREFIX@_SYS_SELECT_H */ +#endif /* OSF/1 */ diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/sys_socket.c b/local/recipes/tools/diffutils/source/gnulib-tests/sys_socket.c new file mode 100644 index 0000000000..3b261da039 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/sys_socket.c @@ -0,0 +1,4 @@ +#include <config.h> +#define _GL_SYS_SOCKET_INLINE _GL_EXTERN_INLINE +#include "sys/socket.h" +typedef int dummy; diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/sys_socket.in.h b/local/recipes/tools/diffutils/source/gnulib-tests/sys_socket.in.h new file mode 100644 index 0000000000..cf4f7bc2aa --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/sys_socket.in.h @@ -0,0 +1,697 @@ +/* Provide a sys/socket header file for systems lacking it (read: MinGW) + and for systems where it is incomplete. + Copyright (C) 2005-2017 Free Software Foundation, Inc. + Written by Simon Josefsson. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* This file is supposed to be used on platforms that lack <sys/socket.h>, + on platforms where <sys/socket.h> cannot be included standalone, and on + platforms where <sys/socket.h> does not provide all necessary definitions. + It is intended to provide definitions and prototypes needed by an + application. */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#if defined _GL_ALREADY_INCLUDING_SYS_SOCKET_H +/* Special invocation convention: + - On Cygwin 1.5.x we have a sequence of nested includes + <sys/socket.h> -> <cygwin/socket.h> -> <asm/socket.h> -> <cygwin/if.h>, + and the latter includes <sys/socket.h>. In this situation, the functions + are not yet declared, therefore we cannot provide the C++ aliases. */ + +#@INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_SYS_SOCKET_H + +#if @HAVE_SYS_SOCKET_H@ + +# define _GL_ALREADY_INCLUDING_SYS_SOCKET_H + +/* On many platforms, <sys/socket.h> assumes prior inclusion of + <sys/types.h>. */ +# include <sys/types.h> + +/* On FreeBSD 6.4, <sys/socket.h> defines some macros that assume that NULL + is defined. */ +# include <stddef.h> + +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@ + +# undef _GL_ALREADY_INCLUDING_SYS_SOCKET_H + +#endif + +#ifndef _@GUARD_PREFIX@_SYS_SOCKET_H +#define _@GUARD_PREFIX@_SYS_SOCKET_H + +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef _GL_SYS_SOCKET_INLINE +# define _GL_SYS_SOCKET_INLINE _GL_INLINE +#endif + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +#if !@HAVE_SA_FAMILY_T@ +# if !GNULIB_defined_sa_family_t +/* On OS/2 kLIBC, sa_family_t is unsigned char unless TCPV40HDRS is defined. */ +# if !defined __KLIBC__ || defined TCPV40HDRS +typedef unsigned short sa_family_t; +# else +typedef unsigned char sa_family_t; +# endif +# define GNULIB_defined_sa_family_t 1 +# endif +#endif + +#if @HAVE_STRUCT_SOCKADDR_STORAGE@ +/* Make the 'struct sockaddr_storage' field 'ss_family' visible on AIX 7.1. */ +# if !@HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ +# ifndef ss_family +# define ss_family __ss_family +# endif +# endif +#else +# include <stdalign.h> +/* Code taken from glibc sysdeps/unix/sysv/linux/bits/socket.h on + 2009-05-08, licensed under LGPLv2.1+, plus portability fixes. */ +# define __ss_aligntype unsigned long int +# define _SS_SIZE 256 +# define _SS_PADSIZE \ + (_SS_SIZE - ((sizeof (sa_family_t) >= alignof (__ss_aligntype) \ + ? sizeof (sa_family_t) \ + : alignof (__ss_aligntype)) \ + + sizeof (__ss_aligntype))) + +# if !GNULIB_defined_struct_sockaddr_storage +struct sockaddr_storage +{ + sa_family_t ss_family; /* Address family, etc. */ + __ss_aligntype __ss_align; /* Force desired alignment. */ + char __ss_padding[_SS_PADSIZE]; +}; +# define GNULIB_defined_struct_sockaddr_storage 1 +# endif + +#endif + +/* Get struct iovec. */ +/* But avoid namespace pollution on glibc systems. */ +#if ! defined __GLIBC__ +# include <sys/uio.h> +#endif + +#if @HAVE_SYS_SOCKET_H@ + +/* A platform that has <sys/socket.h>. */ + +/* For shutdown(). */ +# if !defined SHUT_RD +# define SHUT_RD 0 +# endif +# if !defined SHUT_WR +# define SHUT_WR 1 +# endif +# if !defined SHUT_RDWR +# define SHUT_RDWR 2 +# endif + +#else + +# ifdef __CYGWIN__ +# error "Cygwin does have a sys/socket.h, doesn't it?!?" +# endif + +/* A platform that lacks <sys/socket.h>. + + Currently only MinGW is supported. See the gnulib manual regarding + Windows sockets. MinGW has the header files winsock2.h and + ws2tcpip.h that declare the sys/socket.h definitions we need. Note + that you can influence which definitions you get by setting the + WINVER symbol before including these two files. For example, + getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that + symbol is set indirectly through WINVER). You can set this by + adding AC_DEFINE(WINVER, 0x0501) to configure.ac. Note that your + code may not run on older Windows releases then. My Windows 2000 + box was not able to run the code, for example. The situation is + slightly confusing because + <http://msdn.microsoft.com/en-us/library/ms738520> + suggests that getaddrinfo should be available on all Windows + releases. */ + +# if @HAVE_WINSOCK2_H@ +# include <winsock2.h> +# endif +# if @HAVE_WS2TCPIP_H@ +# include <ws2tcpip.h> +# endif + +/* For shutdown(). */ +# if !defined SHUT_RD && defined SD_RECEIVE +# define SHUT_RD SD_RECEIVE +# endif +# if !defined SHUT_WR && defined SD_SEND +# define SHUT_WR SD_SEND +# endif +# if !defined SHUT_RDWR && defined SD_BOTH +# define SHUT_RDWR SD_BOTH +# endif + +# if @HAVE_WINSOCK2_H@ +/* Include headers needed by the emulation code. */ +# include <sys/types.h> +# include <io.h> + +# if !GNULIB_defined_socklen_t +typedef int socklen_t; +# define GNULIB_defined_socklen_t 1 +# endif + +# endif + +/* Rudimentary 'struct msghdr'; this works as long as you don't try to + access msg_control or msg_controllen. */ +struct msghdr { + void *msg_name; + socklen_t msg_namelen; + struct iovec *msg_iov; + int msg_iovlen; + int msg_flags; +}; + +#endif + +/* Fix some definitions from <winsock2.h>. */ + +#if @HAVE_WINSOCK2_H@ + +# if !GNULIB_defined_rpl_fd_isset + +/* Re-define FD_ISSET to avoid a WSA call while we are not using + network sockets. */ +_GL_SYS_SOCKET_INLINE int +rpl_fd_isset (SOCKET fd, fd_set * set) +{ + u_int i; + if (set == NULL) + return 0; + + for (i = 0; i < set->fd_count; i++) + if (set->fd_array[i] == fd) + return 1; + + return 0; +} + +# define GNULIB_defined_rpl_fd_isset 1 +# endif + +# undef FD_ISSET +# define FD_ISSET(fd, set) rpl_fd_isset(fd, set) + +#endif + +/* Hide some function declarations from <winsock2.h>. */ + +#if @HAVE_WINSOCK2_H@ +# if !defined _@GUARD_PREFIX@_UNISTD_H +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef close +# define close close_used_without_including_unistd_h +# else + _GL_WARN_ON_USE (close, + "close() used without including <unistd.h>"); +# endif +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef gethostname +# define gethostname gethostname_used_without_including_unistd_h +# else + _GL_WARN_ON_USE (gethostname, + "gethostname() used without including <unistd.h>"); +# endif +# endif +# if !defined _@GUARD_PREFIX@_SYS_SELECT_H +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef select +# define select select_used_without_including_sys_select_h +# else + _GL_WARN_ON_USE (select, + "select() used without including <sys/select.h>"); +# endif +# endif +#endif + +/* Wrap everything else to use libc file descriptors for sockets. */ + +#if @GNULIB_SOCKET@ +# if @HAVE_WINSOCK2_H@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef socket +# define socket rpl_socket +# endif +_GL_FUNCDECL_RPL (socket, int, (int domain, int type, int protocol)); +_GL_CXXALIAS_RPL (socket, int, (int domain, int type, int protocol)); +# else +_GL_CXXALIAS_SYS (socket, int, (int domain, int type, int protocol)); +# endif +_GL_CXXALIASWARN (socket); +#elif @HAVE_WINSOCK2_H@ +# undef socket +# define socket socket_used_without_requesting_gnulib_module_socket +#elif defined GNULIB_POSIXCHECK +# undef socket +# if HAVE_RAW_DECL_SOCKET +_GL_WARN_ON_USE (socket, "socket is not always POSIX compliant - " + "use gnulib module socket for portability"); +# endif +#endif + +#if @GNULIB_CONNECT@ +# if @HAVE_WINSOCK2_H@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef connect +# define connect rpl_connect +# endif +_GL_FUNCDECL_RPL (connect, int, + (int fd, const struct sockaddr *addr, socklen_t addrlen) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (connect, int, + (int fd, const struct sockaddr *addr, socklen_t addrlen)); +# else +/* Need to cast, because on NonStop Kernel, the third parameter is + size_t addrlen. */ +_GL_CXXALIAS_SYS_CAST (connect, int, + (int fd, + const struct sockaddr *addr, socklen_t addrlen)); +# endif +_GL_CXXALIASWARN (connect); +#elif @HAVE_WINSOCK2_H@ +# undef connect +# define connect socket_used_without_requesting_gnulib_module_connect +#elif defined GNULIB_POSIXCHECK +# undef connect +# if HAVE_RAW_DECL_CONNECT +_GL_WARN_ON_USE (connect, "connect is not always POSIX compliant - " + "use gnulib module connect for portability"); +# endif +#endif + +#if @GNULIB_ACCEPT@ +# if @HAVE_WINSOCK2_H@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef accept +# define accept rpl_accept +# endif +_GL_FUNCDECL_RPL (accept, int, + (int fd, struct sockaddr *addr, socklen_t *addrlen)); +_GL_CXXALIAS_RPL (accept, int, + (int fd, struct sockaddr *addr, socklen_t *addrlen)); +# else +/* Need to cast, because on Solaris 10 systems, the third parameter is + void *addrlen. */ +_GL_CXXALIAS_SYS_CAST (accept, int, + (int fd, struct sockaddr *addr, socklen_t *addrlen)); +# endif +_GL_CXXALIASWARN (accept); +#elif @HAVE_WINSOCK2_H@ +# undef accept +# define accept accept_used_without_requesting_gnulib_module_accept +#elif defined GNULIB_POSIXCHECK +# undef accept +# if HAVE_RAW_DECL_ACCEPT +_GL_WARN_ON_USE (accept, "accept is not always POSIX compliant - " + "use gnulib module accept for portability"); +# endif +#endif + +#if @GNULIB_BIND@ +# if @HAVE_WINSOCK2_H@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef bind +# define bind rpl_bind +# endif +_GL_FUNCDECL_RPL (bind, int, + (int fd, const struct sockaddr *addr, socklen_t addrlen) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (bind, int, + (int fd, const struct sockaddr *addr, socklen_t addrlen)); +# else +/* Need to cast, because on NonStop Kernel, the third parameter is + size_t addrlen. */ +_GL_CXXALIAS_SYS_CAST (bind, int, + (int fd, + const struct sockaddr *addr, socklen_t addrlen)); +# endif +_GL_CXXALIASWARN (bind); +#elif @HAVE_WINSOCK2_H@ +# undef bind +# define bind bind_used_without_requesting_gnulib_module_bind +#elif defined GNULIB_POSIXCHECK +# undef bind +# if HAVE_RAW_DECL_BIND +_GL_WARN_ON_USE (bind, "bind is not always POSIX compliant - " + "use gnulib module bind for portability"); +# endif +#endif + +#if @GNULIB_GETPEERNAME@ +# if @HAVE_WINSOCK2_H@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getpeername +# define getpeername rpl_getpeername +# endif +_GL_FUNCDECL_RPL (getpeername, int, + (int fd, struct sockaddr *addr, socklen_t *addrlen) + _GL_ARG_NONNULL ((2, 3))); +_GL_CXXALIAS_RPL (getpeername, int, + (int fd, struct sockaddr *addr, socklen_t *addrlen)); +# else +/* Need to cast, because on Solaris 10 systems, the third parameter is + void *addrlen. */ +_GL_CXXALIAS_SYS_CAST (getpeername, int, + (int fd, struct sockaddr *addr, socklen_t *addrlen)); +# endif +_GL_CXXALIASWARN (getpeername); +#elif @HAVE_WINSOCK2_H@ +# undef getpeername +# define getpeername getpeername_used_without_requesting_gnulib_module_getpeername +#elif defined GNULIB_POSIXCHECK +# undef getpeername +# if HAVE_RAW_DECL_GETPEERNAME +_GL_WARN_ON_USE (getpeername, "getpeername is not always POSIX compliant - " + "use gnulib module getpeername for portability"); +# endif +#endif + +#if @GNULIB_GETSOCKNAME@ +# if @HAVE_WINSOCK2_H@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getsockname +# define getsockname rpl_getsockname +# endif +_GL_FUNCDECL_RPL (getsockname, int, + (int fd, struct sockaddr *addr, socklen_t *addrlen) + _GL_ARG_NONNULL ((2, 3))); +_GL_CXXALIAS_RPL (getsockname, int, + (int fd, struct sockaddr *addr, socklen_t *addrlen)); +# else +/* Need to cast, because on Solaris 10 systems, the third parameter is + void *addrlen. */ +_GL_CXXALIAS_SYS_CAST (getsockname, int, + (int fd, struct sockaddr *addr, socklen_t *addrlen)); +# endif +_GL_CXXALIASWARN (getsockname); +#elif @HAVE_WINSOCK2_H@ +# undef getsockname +# define getsockname getsockname_used_without_requesting_gnulib_module_getsockname +#elif defined GNULIB_POSIXCHECK +# undef getsockname +# if HAVE_RAW_DECL_GETSOCKNAME +_GL_WARN_ON_USE (getsockname, "getsockname is not always POSIX compliant - " + "use gnulib module getsockname for portability"); +# endif +#endif + +#if @GNULIB_GETSOCKOPT@ +# if @HAVE_WINSOCK2_H@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getsockopt +# define getsockopt rpl_getsockopt +# endif +_GL_FUNCDECL_RPL (getsockopt, int, (int fd, int level, int optname, + void *optval, socklen_t *optlen) + _GL_ARG_NONNULL ((4, 5))); +_GL_CXXALIAS_RPL (getsockopt, int, (int fd, int level, int optname, + void *optval, socklen_t *optlen)); +# else +/* Need to cast, because on Solaris 10 systems, the fifth parameter is + void *optlen. */ +_GL_CXXALIAS_SYS_CAST (getsockopt, int, (int fd, int level, int optname, + void *optval, socklen_t *optlen)); +# endif +_GL_CXXALIASWARN (getsockopt); +#elif @HAVE_WINSOCK2_H@ +# undef getsockopt +# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt +#elif defined GNULIB_POSIXCHECK +# undef getsockopt +# if HAVE_RAW_DECL_GETSOCKOPT +_GL_WARN_ON_USE (getsockopt, "getsockopt is not always POSIX compliant - " + "use gnulib module getsockopt for portability"); +# endif +#endif + +#if @GNULIB_LISTEN@ +# if @HAVE_WINSOCK2_H@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef listen +# define listen rpl_listen +# endif +_GL_FUNCDECL_RPL (listen, int, (int fd, int backlog)); +_GL_CXXALIAS_RPL (listen, int, (int fd, int backlog)); +# else +_GL_CXXALIAS_SYS (listen, int, (int fd, int backlog)); +# endif +_GL_CXXALIASWARN (listen); +#elif @HAVE_WINSOCK2_H@ +# undef listen +# define listen listen_used_without_requesting_gnulib_module_listen +#elif defined GNULIB_POSIXCHECK +# undef listen +# if HAVE_RAW_DECL_LISTEN +_GL_WARN_ON_USE (listen, "listen is not always POSIX compliant - " + "use gnulib module listen for portability"); +# endif +#endif + +#if @GNULIB_RECV@ +# if @HAVE_WINSOCK2_H@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef recv +# define recv rpl_recv +# endif +_GL_FUNCDECL_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags)); +# else +_GL_CXXALIAS_SYS (recv, ssize_t, (int fd, void *buf, size_t len, int flags)); +# endif +_GL_CXXALIASWARN (recv); +#elif @HAVE_WINSOCK2_H@ +# undef recv +# define recv recv_used_without_requesting_gnulib_module_recv +#elif defined GNULIB_POSIXCHECK +# undef recv +# if HAVE_RAW_DECL_RECV +_GL_WARN_ON_USE (recv, "recv is not always POSIX compliant - " + "use gnulib module recv for portability"); +# endif +#endif + +#if @GNULIB_SEND@ +# if @HAVE_WINSOCK2_H@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef send +# define send rpl_send +# endif +_GL_FUNCDECL_RPL (send, ssize_t, + (int fd, const void *buf, size_t len, int flags) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (send, ssize_t, + (int fd, const void *buf, size_t len, int flags)); +# else +_GL_CXXALIAS_SYS (send, ssize_t, + (int fd, const void *buf, size_t len, int flags)); +# endif +_GL_CXXALIASWARN (send); +#elif @HAVE_WINSOCK2_H@ +# undef send +# define send send_used_without_requesting_gnulib_module_send +#elif defined GNULIB_POSIXCHECK +# undef send +# if HAVE_RAW_DECL_SEND +_GL_WARN_ON_USE (send, "send is not always POSIX compliant - " + "use gnulib module send for portability"); +# endif +#endif + +#if @GNULIB_RECVFROM@ +# if @HAVE_WINSOCK2_H@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef recvfrom +# define recvfrom rpl_recvfrom +# endif +_GL_FUNCDECL_RPL (recvfrom, ssize_t, + (int fd, void *buf, size_t len, int flags, + struct sockaddr *from, socklen_t *fromlen) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (recvfrom, ssize_t, + (int fd, void *buf, size_t len, int flags, + struct sockaddr *from, socklen_t *fromlen)); +# else +/* Need to cast, because on Solaris 10 systems, the sixth parameter is + void *fromlen. */ +_GL_CXXALIAS_SYS_CAST (recvfrom, ssize_t, + (int fd, void *buf, size_t len, int flags, + struct sockaddr *from, socklen_t *fromlen)); +# endif +_GL_CXXALIASWARN (recvfrom); +#elif @HAVE_WINSOCK2_H@ +# undef recvfrom +# define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom +#elif defined GNULIB_POSIXCHECK +# undef recvfrom +# if HAVE_RAW_DECL_RECVFROM +_GL_WARN_ON_USE (recvfrom, "recvfrom is not always POSIX compliant - " + "use gnulib module recvfrom for portability"); +# endif +#endif + +#if @GNULIB_SENDTO@ +# if @HAVE_WINSOCK2_H@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef sendto +# define sendto rpl_sendto +# endif +_GL_FUNCDECL_RPL (sendto, ssize_t, + (int fd, const void *buf, size_t len, int flags, + const struct sockaddr *to, socklen_t tolen) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (sendto, ssize_t, + (int fd, const void *buf, size_t len, int flags, + const struct sockaddr *to, socklen_t tolen)); +# else +/* Need to cast, because on NonStop Kernel, the sixth parameter is + size_t tolen. */ +_GL_CXXALIAS_SYS_CAST (sendto, ssize_t, + (int fd, const void *buf, size_t len, int flags, + const struct sockaddr *to, socklen_t tolen)); +# endif +_GL_CXXALIASWARN (sendto); +#elif @HAVE_WINSOCK2_H@ +# undef sendto +# define sendto sendto_used_without_requesting_gnulib_module_sendto +#elif defined GNULIB_POSIXCHECK +# undef sendto +# if HAVE_RAW_DECL_SENDTO +_GL_WARN_ON_USE (sendto, "sendto is not always POSIX compliant - " + "use gnulib module sendto for portability"); +# endif +#endif + +#if @GNULIB_SETSOCKOPT@ +# if @HAVE_WINSOCK2_H@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef setsockopt +# define setsockopt rpl_setsockopt +# endif +_GL_FUNCDECL_RPL (setsockopt, int, (int fd, int level, int optname, + const void * optval, socklen_t optlen) + _GL_ARG_NONNULL ((4))); +_GL_CXXALIAS_RPL (setsockopt, int, (int fd, int level, int optname, + const void * optval, socklen_t optlen)); +# else +/* Need to cast, because on NonStop Kernel, the fifth parameter is + size_t optlen. */ +_GL_CXXALIAS_SYS_CAST (setsockopt, int, + (int fd, int level, int optname, + const void * optval, socklen_t optlen)); +# endif +_GL_CXXALIASWARN (setsockopt); +#elif @HAVE_WINSOCK2_H@ +# undef setsockopt +# define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt +#elif defined GNULIB_POSIXCHECK +# undef setsockopt +# if HAVE_RAW_DECL_SETSOCKOPT +_GL_WARN_ON_USE (setsockopt, "setsockopt is not always POSIX compliant - " + "use gnulib module setsockopt for portability"); +# endif +#endif + +#if @GNULIB_SHUTDOWN@ +# if @HAVE_WINSOCK2_H@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef shutdown +# define shutdown rpl_shutdown +# endif +_GL_FUNCDECL_RPL (shutdown, int, (int fd, int how)); +_GL_CXXALIAS_RPL (shutdown, int, (int fd, int how)); +# else +_GL_CXXALIAS_SYS (shutdown, int, (int fd, int how)); +# endif +_GL_CXXALIASWARN (shutdown); +#elif @HAVE_WINSOCK2_H@ +# undef shutdown +# define shutdown shutdown_used_without_requesting_gnulib_module_shutdown +#elif defined GNULIB_POSIXCHECK +# undef shutdown +# if HAVE_RAW_DECL_SHUTDOWN +_GL_WARN_ON_USE (shutdown, "shutdown is not always POSIX compliant - " + "use gnulib module shutdown for portability"); +# endif +#endif + +#if @GNULIB_ACCEPT4@ +/* Accept a connection on a socket, with specific opening flags. + The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>) + and O_TEXT, O_BINARY (defined in "binary-io.h"). + See also the Linux man page at + <http://www.kernel.org/doc/man-pages/online/pages/man2/accept4.2.html>. */ +# if @HAVE_ACCEPT4@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define accept4 rpl_accept4 +# endif +_GL_FUNCDECL_RPL (accept4, int, + (int sockfd, struct sockaddr *addr, socklen_t *addrlen, + int flags)); +_GL_CXXALIAS_RPL (accept4, int, + (int sockfd, struct sockaddr *addr, socklen_t *addrlen, + int flags)); +# else +_GL_FUNCDECL_SYS (accept4, int, + (int sockfd, struct sockaddr *addr, socklen_t *addrlen, + int flags)); +_GL_CXXALIAS_SYS (accept4, int, + (int sockfd, struct sockaddr *addr, socklen_t *addrlen, + int flags)); +# endif +_GL_CXXALIASWARN (accept4); +#elif defined GNULIB_POSIXCHECK +# undef accept4 +# if HAVE_RAW_DECL_ACCEPT4 +_GL_WARN_ON_USE (accept4, "accept4 is unportable - " + "use gnulib module accept4 for portability"); +# endif +#endif + +_GL_INLINE_HEADER_END + +#endif /* _@GUARD_PREFIX@_SYS_SOCKET_H */ +#endif /* _@GUARD_PREFIX@_SYS_SOCKET_H */ +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/sys_uio.in.h b/local/recipes/tools/diffutils/source/gnulib-tests/sys_uio.in.h new file mode 100644 index 0000000000..d45d8462a3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/sys_uio.in.h @@ -0,0 +1,63 @@ +/* Substitute for <sys/uio.h>. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +# if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +# endif +@PRAGMA_COLUMNS@ + +#ifndef _@GUARD_PREFIX@_SYS_UIO_H + +#if @HAVE_SYS_UIO_H@ + +/* On OpenBSD 4.4, <sys/uio.h> assumes prior inclusion of <sys/types.h>. */ +# include <sys/types.h> + +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_SYS_UIO_H@ + +#endif + +#ifndef _@GUARD_PREFIX@_SYS_UIO_H +#define _@GUARD_PREFIX@_SYS_UIO_H + +#if !@HAVE_SYS_UIO_H@ +/* A platform that lacks <sys/uio.h>. */ +/* Get 'size_t' and 'ssize_t'. */ +# include <sys/types.h> + +# ifdef __cplusplus +extern "C" { +# endif + +# if !GNULIB_defined_struct_iovec +/* All known platforms that lack <sys/uio.h> also lack any declaration + of struct iovec in any other header. */ +struct iovec { + void *iov_base; + size_t iov_len; +}; +# define GNULIB_defined_struct_iovec 1 +# endif + +# ifdef __cplusplus +} +# endif + +#endif + +#endif /* _@GUARD_PREFIX@_SYS_UIO_H */ +#endif /* _@GUARD_PREFIX@_SYS_UIO_H */ diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-accept.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-accept.c new file mode 100644 index 0000000000..5e4081b23d --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-accept.c @@ -0,0 +1,56 @@ +/* Test accepting a connection to a server socket. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <sys/socket.h> + +#include "signature.h" +SIGNATURE_CHECK (accept, int, (int, struct sockaddr *, socklen_t *)); + +#include <errno.h> +#include <netinet/in.h> +#include <unistd.h> + +#include "sockets.h" +#include "macros.h" + +int +main (void) +{ + (void) gl_sockets_startup (SOCKETS_1_1); + + /* Test behaviour for invalid file descriptors. */ + { + struct sockaddr_in addr; + socklen_t addrlen = sizeof (addr); + + errno = 0; + ASSERT (accept (-1, (struct sockaddr *) &addr, &addrlen) == -1); + ASSERT (errno == EBADF); + } + { + struct sockaddr_in addr; + socklen_t addrlen = sizeof (addr); + + close (99); + errno = 0; + ASSERT (accept (99, (struct sockaddr *) &addr, &addrlen) == -1); + ASSERT (errno == EBADF); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-alloca-opt.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-alloca-opt.c new file mode 100644 index 0000000000..4c5b3bdcc5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-alloca-opt.c @@ -0,0 +1,62 @@ +/* Test of optional automatic memory allocation. + Copyright (C) 2005, 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <alloca.h> + +#if HAVE_ALLOCA + +static void +do_allocation (int n) +{ + void *ptr = alloca (n); + (void) ptr; +} + +void (*func) (int) = do_allocation; + +#endif + +int +main () +{ +#if HAVE_ALLOCA + int i; + + /* Repeat a lot of times, to make sure there's no memory leak. */ + for (i = 0; i < 100000; i++) + { + /* Try various values. + n = 0 gave a crash on Alpha with gcc-2.5.8. + Some versions of Mac OS X have a stack size limit of 512 KB. */ + func (34); + func (134); + func (399); + func (510823); + func (129321); + func (0); + func (4070); + func (4095); + func (1); + func (16582); + } +#endif + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-areadlink.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-areadlink.c new file mode 100644 index 0000000000..2a826c4b2d --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-areadlink.c @@ -0,0 +1,53 @@ +/* Tests of areadlink. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +#include <config.h> + +#include "areadlink.h" + +#include <fcntl.h> +#include <errno.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/stat.h> +#include <unistd.h> + +#include "ignore-value.h" +#include "macros.h" + +#define BASE "test-areadlink.t" + +#include "test-areadlink.h" + +/* Wrapper for testing areadlink. */ +static char * +do_areadlink (char const *name, size_t ignored _GL_UNUSED) +{ + return areadlink (name); +} + +int +main (void) +{ + /* Remove any leftovers from a previous partial run. */ + ignore_value (system ("rm -rf " BASE "*")); + + return test_areadlink (do_areadlink, true); +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-areadlink.h b/local/recipes/tools/diffutils/source/gnulib-tests/test-areadlink.h new file mode 100644 index 0000000000..efaf07be00 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-areadlink.h @@ -0,0 +1,83 @@ +/* Tests of areadlink and friends. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +/* This file is designed to test areadlink(a), + areadlink_with_size(a,b), and areadlinkat(AT_FDCWD,a). FUNC is the + function to test; a length is always supplied, but may be ignored. + Assumes that BASE and ASSERT are already defined, and that + appropriate headers are already included. If PRINT, warn before + skipping symlink tests with status 77. */ + +static int +test_areadlink (char * (*func) (char const *, size_t), bool print) +{ + /* Sanity checks of failures. Mingw lacks symlink, but areadlink can + still distinguish between various errors. */ + errno = 0; + ASSERT (func ("no_such", 1) == NULL); + ASSERT (errno == ENOENT); + errno = 0; + ASSERT (func ("no_such/", 1) == NULL); + ASSERT (errno == ENOENT); + errno = 0; + ASSERT (func ("", 1) == NULL); + ASSERT (errno == ENOENT || errno == EINVAL); + errno = 0; + ASSERT (func (".", 1) == NULL); + ASSERT (errno == EINVAL); + errno = 0; + ASSERT (func ("./", 1) == NULL); + ASSERT (errno == EINVAL); + ASSERT (close (creat (BASE "file", 0600)) == 0); + errno = 0; + ASSERT (func (BASE "file", 1) == NULL); + ASSERT (errno == EINVAL); + errno = 0; + ASSERT (func (BASE "file/", 1) == NULL); + ASSERT (errno == ENOTDIR || errno == EINVAL); /* AIX yields EINVAL */ + ASSERT (unlink (BASE "file") == 0); + + /* Now test actual symlinks. */ + if (symlink (BASE "dir", BASE "link")) + { + if (print) + fputs ("skipping test: symlinks not supported on this file system\n", + stderr); + return 77; + } + ASSERT (mkdir (BASE "dir", 0700) == 0); + errno = 0; + ASSERT (func (BASE "link/", 1) == NULL); + ASSERT (errno == EINVAL); + { + /* Too small a guess is okay. */ + char *buf = func (BASE "link", 1); + ASSERT (buf); + ASSERT (strcmp (buf, BASE "dir") == 0); + free (buf); + /* Too large a guess is okay. */ + buf = func (BASE "link", 10000000); + ASSERT (buf); + ASSERT (strcmp (buf, BASE "dir") == 0); + free (buf); + } + ASSERT (rmdir (BASE "dir") == 0); + ASSERT (unlink (BASE "link") == 0); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-argmatch.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-argmatch.c new file mode 100644 index 0000000000..5fe0df73db --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-argmatch.c @@ -0,0 +1,98 @@ +/* Test of exact or abbreviated match search. + Copyright (C) 1990, 1998-1999, 2001-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007, based on test code + by David MacKenzie <djm@gnu.ai.mit.edu>. */ + +#include <config.h> + +#include "argmatch.h" + +#include <stdlib.h> + +#include "macros.h" + +/* Some packages define ARGMATCH_DIE and ARGMATCH_DIE_DECL in <config.h>, and + thus must link with a definition of that function. Provide it here. */ +#ifdef ARGMATCH_DIE_DECL + +_Noreturn ARGMATCH_DIE_DECL; +ARGMATCH_DIE_DECL { exit (1); } + +#endif + +enum backup_type +{ + no_backups, + simple_backups, + numbered_existing_backups, + numbered_backups +}; + +static const char *const backup_args[] = +{ + "no", "none", "off", + "simple", "never", "single", + "existing", "nil", "numbered-existing", + "numbered", "t", "newstyle", + NULL +}; + +static const enum backup_type backup_vals[] = +{ + no_backups, no_backups, no_backups, + simple_backups, simple_backups, simple_backups, + numbered_existing_backups, numbered_existing_backups, numbered_existing_backups, + numbered_backups, numbered_backups, numbered_backups +}; + +int +main (int argc, char *argv[]) +{ + /* Not found. */ + ASSERT (ARGMATCH ("klingon", backup_args, backup_vals) == -1); + + /* Exact match. */ + ASSERT (ARGMATCH ("none", backup_args, backup_vals) == 1); + ASSERT (ARGMATCH ("nil", backup_args, backup_vals) == 7); + + /* Too long. */ + ASSERT (ARGMATCH ("nilpotent", backup_args, backup_vals) == -1); + + /* Abbreviated. */ + ASSERT (ARGMATCH ("simpl", backup_args, backup_vals) == 3); + ASSERT (ARGMATCH ("simp", backup_args, backup_vals) == 3); + ASSERT (ARGMATCH ("sim", backup_args, backup_vals) == 3); + + /* Exact match and abbreviated. */ + ASSERT (ARGMATCH ("numbered", backup_args, backup_vals) == 9); + ASSERT (ARGMATCH ("numbere", backup_args, backup_vals) == -2); + ASSERT (ARGMATCH ("number", backup_args, backup_vals) == -2); + ASSERT (ARGMATCH ("numbe", backup_args, backup_vals) == -2); + ASSERT (ARGMATCH ("numb", backup_args, backup_vals) == -2); + ASSERT (ARGMATCH ("num", backup_args, backup_vals) == -2); + ASSERT (ARGMATCH ("nu", backup_args, backup_vals) == -2); + ASSERT (ARGMATCH ("n", backup_args, backup_vals) == -2); + + /* Ambiguous abbreviated. */ + ASSERT (ARGMATCH ("ne", backup_args, backup_vals) == -2); + + /* Ambiguous abbreviated, but same value. */ + ASSERT (ARGMATCH ("si", backup_args, backup_vals) == 3); + ASSERT (ARGMATCH ("s", backup_args, backup_vals) == 3); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-arpa_inet.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-arpa_inet.c new file mode 100644 index 0000000000..8e37a4138a --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-arpa_inet.c @@ -0,0 +1,27 @@ +/* Test of <arpa/inet.h> substitute. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <arpa/inet.h> + +int +main (void) +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-binary-io.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-binary-io.c new file mode 100644 index 0000000000..46ccce588e --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-binary-io.c @@ -0,0 +1,63 @@ +/* Test of binary mode I/O. + Copyright (C) 2005, 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2005. */ + +#include <config.h> + +#include "binary-io.h" + +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + +#include "macros.h" + +int +main (int argc, char *argv[]) +{ + /* Test the O_BINARY macro. */ + { + int fd = + open ("t-bin-out0.tmp", O_CREAT | O_TRUNC | O_RDWR | O_BINARY, 0600); + if (write (fd, "Hello\n", 6) < 0) + exit (1); + close (fd); + } + { + struct stat statbuf; + if (stat ("t-bin-out0.tmp", &statbuf) < 0) + exit (1); + ASSERT (statbuf.st_size == 6); + } + + switch (argv[1][0]) + { + case '1': + /* Test the set_binary_mode() function. */ + set_binary_mode (1, O_BINARY); + fputs ("Hello\n", stdout); + break; + + default: + break; + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-binary-io.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-binary-io.sh new file mode 100755 index 0000000000..38af09957b --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-binary-io.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles t-bin-out0.tmp t-bin-out1.tmp" +./test-binary-io${EXEEXT} 1 > t-bin-out1.tmp || exit 1 +cmp t-bin-out0.tmp t-bin-out1.tmp > /dev/null || exit 1 + +rm -fr $tmpfiles + +exit 0 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-bind.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-bind.c new file mode 100644 index 0000000000..9ee49778cf --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-bind.c @@ -0,0 +1,58 @@ +/* Test binding a server socket to a port. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <sys/socket.h> + +#include "signature.h" +SIGNATURE_CHECK (bind, int, (int, const struct sockaddr *, socklen_t)); + +#include <errno.h> +#include <netinet/in.h> +#include <arpa/inet.h> +#include <unistd.h> + +#include "sockets.h" +#include "macros.h" + +int +main (void) +{ + (void) gl_sockets_startup (SOCKETS_1_1); + + /* Test behaviour for invalid file descriptors. */ + { + struct sockaddr_in addr; + + addr.sin_family = AF_INET; + inet_pton (AF_INET, "127.0.0.1", &addr.sin_addr); + addr.sin_port = htons (80); + { + errno = 0; + ASSERT (bind (-1, (const struct sockaddr *) &addr, sizeof (addr)) == -1); + ASSERT (errno == EBADF); + } + { + close (99); + errno = 0; + ASSERT (bind (99, (const struct sockaddr *) &addr, sizeof (addr)) == -1); + ASSERT (errno == EBADF); + } + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-bitrotate.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-bitrotate.c new file mode 100644 index 0000000000..c87e56c51f --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-bitrotate.c @@ -0,0 +1,279 @@ +/* Test of <bitrotate.h> substitute. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Simon Josefsson <simon@josefsson.org>, 2008. */ + +#include <config.h> + +#include "bitrotate.h" + +#include "macros.h" + +int +main (void) +{ + ASSERT (rotl8 (42, 0) == 42); + ASSERT (rotl8 (42, 1) == 84); + ASSERT (rotl8 (42, 2) == 168); + ASSERT (rotl8 (42, 3) == 81); + ASSERT (rotl8 (42, 4) == 162); + ASSERT (rotl8 (42, 5) == 69); + ASSERT (rotl8 (42, 6) == 138); + ASSERT (rotl8 (42, 7) == 21); + ASSERT (rotl8 (42, 8) == 42); + + ASSERT (rotr8 (42, 0) == 42); + ASSERT (rotr8 (42, 1) == 21); + ASSERT (rotr8 (42, 2) == 138); + ASSERT (rotr8 (42, 3) == 69); + ASSERT (rotr8 (42, 4) == 162); + ASSERT (rotr8 (42, 5) == 81); + ASSERT (rotr8 (42, 6) == 168); + ASSERT (rotr8 (42, 7) == 84); + ASSERT (rotr8 (42, 8) == 42); + + ASSERT (rotl16 (43981, 0) == 43981); + ASSERT (rotl16 (43981, 1) == 22427); + ASSERT (rotl16 (43981, 2) == 44854); + ASSERT (rotl16 (43981, 3) == 24173); + ASSERT (rotl16 (43981, 4) == 48346); + ASSERT (rotl16 (43981, 5) == 31157); + ASSERT (rotl16 (43981, 6) == 62314); + ASSERT (rotl16 (43981, 7) == 59093); + ASSERT (rotl16 (43981, 8) == 52651); + ASSERT (rotl16 (43981, 9) == 39767); + ASSERT (rotl16 (43981, 10) == 13999); + ASSERT (rotl16 (43981, 11) == 27998); + ASSERT (rotl16 (43981, 12) == 55996); + ASSERT (rotl16 (43981, 13) == 46457); + ASSERT (rotl16 (43981, 14) == 27379); + ASSERT (rotl16 (43981, 15) == 54758); + ASSERT (rotl16 (43981, 16) == 43981); + + ASSERT (rotr16 (43981, 0) == 43981); + ASSERT (rotr16 (43981, 1) == 54758); + ASSERT (rotr16 (43981, 2) == 27379); + ASSERT (rotr16 (43981, 3) == 46457); + ASSERT (rotr16 (43981, 4) == 55996); + ASSERT (rotr16 (43981, 5) == 27998); + ASSERT (rotr16 (43981, 6) == 13999); + ASSERT (rotr16 (43981, 7) == 39767); + ASSERT (rotr16 (43981, 8) == 52651); + ASSERT (rotr16 (43981, 9) == 59093); + ASSERT (rotr16 (43981, 10) == 62314); + ASSERT (rotr16 (43981, 11) == 31157); + ASSERT (rotr16 (43981, 12) == 48346); + ASSERT (rotr16 (43981, 13) == 24173); + ASSERT (rotr16 (43981, 14) == 44854); + ASSERT (rotr16 (43981, 15) == 22427); + ASSERT (rotr16 (43981, 16) == 43981); + + ASSERT (rotl32 (2309737967U, 1) == 324508639U); + ASSERT (rotl32 (2309737967U, 2) == 649017278U); + ASSERT (rotl32 (2309737967U, 3) == 1298034556U); + ASSERT (rotl32 (2309737967U, 4) == 2596069112U); + ASSERT (rotl32 (2309737967U, 5) == 897170929U); + ASSERT (rotl32 (2309737967U, 6) == 1794341858U); + ASSERT (rotl32 (2309737967U, 7) == 3588683716U); + ASSERT (rotl32 (2309737967U, 8) == 2882400137U); + ASSERT (rotl32 (2309737967U, 9) == 1469832979U); + ASSERT (rotl32 (2309737967U, 10) == 2939665958U); + ASSERT (rotl32 (2309737967U, 11) == 1584364621U); + ASSERT (rotl32 (2309737967U, 12) == 3168729242U); + ASSERT (rotl32 (2309737967U, 13) == 2042491189U); + ASSERT (rotl32 (2309737967U, 14) == 4084982378U); + ASSERT (rotl32 (2309737967U, 15) == 3874997461U); + ASSERT (rotl32 (2309737967U, 16) == 3455027627U); + ASSERT (rotl32 (2309737967U, 17) == 2615087959U); + ASSERT (rotl32 (2309737967U, 18) == 935208623U); + ASSERT (rotl32 (2309737967U, 19) == 1870417246U); + ASSERT (rotl32 (2309737967U, 20) == 3740834492U); + ASSERT (rotl32 (2309737967U, 21) == 3186701689U); + ASSERT (rotl32 (2309737967U, 22) == 2078436083U); + ASSERT (rotl32 (2309737967U, 23) == 4156872166U); + ASSERT (rotl32 (2309737967U, 24) == 4018777037U); + ASSERT (rotl32 (2309737967U, 25) == 3742586779U); + ASSERT (rotl32 (2309737967U, 26) == 3190206263U); + ASSERT (rotl32 (2309737967U, 27) == 2085445231U); + ASSERT (rotl32 (2309737967U, 28) == 4170890462U); + ASSERT (rotl32 (2309737967U, 29) == 4046813629U); + ASSERT (rotl32 (2309737967U, 30) == 3798659963U); + ASSERT (rotl32 (2309737967U, 31) == 3302352631U); + + ASSERT (rotr32 (2309737967U, 1) == 3302352631lU); + ASSERT (rotr32 (2309737967U, 2) == 3798659963lU); + ASSERT (rotr32 (2309737967U, 3) == 4046813629lU); + ASSERT (rotr32 (2309737967U, 4) == 4170890462lU); + ASSERT (rotr32 (2309737967U, 5) == 2085445231lU); + ASSERT (rotr32 (2309737967U, 6) == 3190206263lU); + ASSERT (rotr32 (2309737967U, 7) == 3742586779lU); + ASSERT (rotr32 (2309737967U, 8) == 4018777037lU); + ASSERT (rotr32 (2309737967U, 9) == 4156872166lU); + ASSERT (rotr32 (2309737967U, 10) == 2078436083lU); + ASSERT (rotr32 (2309737967U, 11) == 3186701689lU); + ASSERT (rotr32 (2309737967U, 12) == 3740834492lU); + ASSERT (rotr32 (2309737967U, 13) == 1870417246lU); + ASSERT (rotr32 (2309737967U, 14) == 935208623lU); + ASSERT (rotr32 (2309737967U, 15) == 2615087959lU); + ASSERT (rotr32 (2309737967U, 16) == 3455027627lU); + ASSERT (rotr32 (2309737967U, 17) == 3874997461lU); + ASSERT (rotr32 (2309737967U, 18) == 4084982378lU); + ASSERT (rotr32 (2309737967U, 19) == 2042491189lU); + ASSERT (rotr32 (2309737967U, 20) == 3168729242lU); + ASSERT (rotr32 (2309737967U, 21) == 1584364621lU); + ASSERT (rotr32 (2309737967U, 22) == 2939665958lU); + ASSERT (rotr32 (2309737967U, 23) == 1469832979lU); + ASSERT (rotr32 (2309737967U, 24) == 2882400137lU); + ASSERT (rotr32 (2309737967U, 25) == 3588683716lU); + ASSERT (rotr32 (2309737967U, 26) == 1794341858lU); + ASSERT (rotr32 (2309737967U, 27) == 897170929lU); + ASSERT (rotr32 (2309737967U, 28) == 2596069112lU); + ASSERT (rotr32 (2309737967U, 29) == 1298034556lU); + ASSERT (rotr32 (2309737967U, 30) == 649017278lU); + ASSERT (rotr32 (2309737967U, 31) == 324508639lU); + +#ifdef UINT64_MAX + ASSERT (rotl64 (16045690984503098046ULL, 1) == 13644637895296644477ULL); + ASSERT (rotl64 (16045690984503098046ULL, 2) == 8842531716883737339ULL); + ASSERT (rotl64 (16045690984503098046ULL, 3) == 17685063433767474678ULL); + ASSERT (rotl64 (16045690984503098046ULL, 4) == 16923382793825397741ULL); + ASSERT (rotl64 (16045690984503098046ULL, 5) == 15400021513941243867ULL); + ASSERT (rotl64 (16045690984503098046ULL, 6) == 12353298954172936119ULL); + ASSERT (rotl64 (16045690984503098046ULL, 7) == 6259853834636320623ULL); + ASSERT (rotl64 (16045690984503098046ULL, 8) == 12519707669272641246ULL); + ASSERT (rotl64 (16045690984503098046ULL, 9) == 6592671264835730877ULL); + ASSERT (rotl64 (16045690984503098046ULL, 10) == 13185342529671461754ULL); + ASSERT (rotl64 (16045690984503098046ULL, 11) == 7923940985633371893ULL); + ASSERT (rotl64 (16045690984503098046ULL, 12) == 15847881971266743786ULL); + ASSERT (rotl64 (16045690984503098046ULL, 13) == 13249019868823935957ULL); + ASSERT (rotl64 (16045690984503098046ULL, 14) == 8051295663938320299ULL); + ASSERT (rotl64 (16045690984503098046ULL, 15) == 16102591327876640598ULL); + ASSERT (rotl64 (16045690984503098046ULL, 16) == 13758438582043729581ULL); + ASSERT (rotl64 (16045690984503098046ULL, 17) == 9070133090377907547ULL); + ASSERT (rotl64 (16045690984503098046ULL, 18) == 18140266180755815094ULL); + ASSERT (rotl64 (16045690984503098046ULL, 19) == 17833788287802078573ULL); + ASSERT (rotl64 (16045690984503098046ULL, 20) == 17220832501894605531ULL); + ASSERT (rotl64 (16045690984503098046ULL, 21) == 15994920930079659447ULL); + ASSERT (rotl64 (16045690984503098046ULL, 22) == 13543097786449767279ULL); + ASSERT (rotl64 (16045690984503098046ULL, 23) == 8639451499189982943ULL); + ASSERT (rotl64 (16045690984503098046ULL, 24) == 17278902998379965886ULL); + ASSERT (rotl64 (16045690984503098046ULL, 25) == 16111061923050380157ULL); + ASSERT (rotl64 (16045690984503098046ULL, 26) == 13775379772391208699ULL); + ASSERT (rotl64 (16045690984503098046ULL, 27) == 9104015471072865783ULL); + ASSERT (rotl64 (16045690984503098046ULL, 28) == 18208030942145731566ULL); + ASSERT (rotl64 (16045690984503098046ULL, 29) == 17969317810581911517ULL); + ASSERT (rotl64 (16045690984503098046ULL, 30) == 17491891547454271419ULL); + ASSERT (rotl64 (16045690984503098046ULL, 31) == 16537039021198991223ULL); + ASSERT (rotl64 (16045690984503098046ULL, 32) == 14627333968688430831ULL); + ASSERT (rotl64 (16045690984503098046ULL, 33) == 10807923863667310047ULL); + ASSERT (rotl64 (16045690984503098046ULL, 34) == 3169103653625068479ULL); + ASSERT (rotl64 (16045690984503098046ULL, 35) == 6338207307250136958ULL); + ASSERT (rotl64 (16045690984503098046ULL, 36) == 12676414614500273916ULL); + ASSERT (rotl64 (16045690984503098046ULL, 37) == 6906085155290996217ULL); + ASSERT (rotl64 (16045690984503098046ULL, 38) == 13812170310581992434ULL); + ASSERT (rotl64 (16045690984503098046ULL, 39) == 9177596547454433253ULL); + ASSERT (rotl64 (16045690984503098046ULL, 40) == 18355193094908866506ULL); + ASSERT (rotl64 (16045690984503098046ULL, 41) == 18263642116108181397ULL); + ASSERT (rotl64 (16045690984503098046ULL, 42) == 18080540158506811179ULL); + ASSERT (rotl64 (16045690984503098046ULL, 43) == 17714336243304070743ULL); + ASSERT (rotl64 (16045690984503098046ULL, 44) == 16981928412898589871ULL); + ASSERT (rotl64 (16045690984503098046ULL, 45) == 15517112752087628127ULL); + ASSERT (rotl64 (16045690984503098046ULL, 46) == 12587481430465704639ULL); + ASSERT (rotl64 (16045690984503098046ULL, 47) == 6728218787221857663ULL); + ASSERT (rotl64 (16045690984503098046ULL, 48) == 13456437574443715326ULL); + ASSERT (rotl64 (16045690984503098046ULL, 49) == 8466131075177879037ULL); + ASSERT (rotl64 (16045690984503098046ULL, 50) == 16932262150355758074ULL); + ASSERT (rotl64 (16045690984503098046ULL, 51) == 15417780227001964533ULL); + ASSERT (rotl64 (16045690984503098046ULL, 52) == 12388816380294377451ULL); + ASSERT (rotl64 (16045690984503098046ULL, 53) == 6330888686879203287ULL); + ASSERT (rotl64 (16045690984503098046ULL, 54) == 12661777373758406574ULL); + ASSERT (rotl64 (16045690984503098046ULL, 55) == 6876810673807261533ULL); + ASSERT (rotl64 (16045690984503098046ULL, 56) == 13753621347614523066ULL); + ASSERT (rotl64 (16045690984503098046ULL, 57) == 9060498621519494517ULL); + ASSERT (rotl64 (16045690984503098046ULL, 58) == 18120997243038989034ULL); + ASSERT (rotl64 (16045690984503098046ULL, 59) == 17795250412368426453ULL); + ASSERT (rotl64 (16045690984503098046ULL, 60) == 17143756751027301291ULL); + ASSERT (rotl64 (16045690984503098046ULL, 61) == 15840769428345050967ULL); + ASSERT (rotl64 (16045690984503098046ULL, 62) == 13234794782980550319ULL); + ASSERT (rotl64 (16045690984503098046ULL, 63) == 8022845492251549023ULL); + + ASSERT (rotr64 (16045690984503098046ULL, 1) == 8022845492251549023ULL); + ASSERT (rotr64 (16045690984503098046ULL, 2) == 13234794782980550319ULL); + ASSERT (rotr64 (16045690984503098046ULL, 3) == 15840769428345050967ULL); + ASSERT (rotr64 (16045690984503098046ULL, 4) == 17143756751027301291ULL); + ASSERT (rotr64 (16045690984503098046ULL, 5) == 17795250412368426453ULL); + ASSERT (rotr64 (16045690984503098046ULL, 6) == 18120997243038989034ULL); + ASSERT (rotr64 (16045690984503098046ULL, 7) == 9060498621519494517ULL); + ASSERT (rotr64 (16045690984503098046ULL, 8) == 13753621347614523066ULL); + ASSERT (rotr64 (16045690984503098046ULL, 9) == 6876810673807261533ULL); + ASSERT (rotr64 (16045690984503098046ULL, 10) == 12661777373758406574ULL); + ASSERT (rotr64 (16045690984503098046ULL, 11) == 6330888686879203287ULL); + ASSERT (rotr64 (16045690984503098046ULL, 12) == 12388816380294377451ULL); + ASSERT (rotr64 (16045690984503098046ULL, 13) == 15417780227001964533ULL); + ASSERT (rotr64 (16045690984503098046ULL, 14) == 16932262150355758074ULL); + ASSERT (rotr64 (16045690984503098046ULL, 15) == 8466131075177879037ULL); + ASSERT (rotr64 (16045690984503098046ULL, 16) == 13456437574443715326ULL); + ASSERT (rotr64 (16045690984503098046ULL, 17) == 6728218787221857663ULL); + ASSERT (rotr64 (16045690984503098046ULL, 18) == 12587481430465704639ULL); + ASSERT (rotr64 (16045690984503098046ULL, 19) == 15517112752087628127ULL); + ASSERT (rotr64 (16045690984503098046ULL, 20) == 16981928412898589871ULL); + ASSERT (rotr64 (16045690984503098046ULL, 21) == 17714336243304070743ULL); + ASSERT (rotr64 (16045690984503098046ULL, 22) == 18080540158506811179ULL); + ASSERT (rotr64 (16045690984503098046ULL, 23) == 18263642116108181397ULL); + ASSERT (rotr64 (16045690984503098046ULL, 24) == 18355193094908866506ULL); + ASSERT (rotr64 (16045690984503098046ULL, 25) == 9177596547454433253ULL); + ASSERT (rotr64 (16045690984503098046ULL, 26) == 13812170310581992434ULL); + ASSERT (rotr64 (16045690984503098046ULL, 27) == 6906085155290996217ULL); + ASSERT (rotr64 (16045690984503098046ULL, 28) == 12676414614500273916ULL); + ASSERT (rotr64 (16045690984503098046ULL, 29) == 6338207307250136958ULL); + ASSERT (rotr64 (16045690984503098046ULL, 30) == 3169103653625068479ULL); + ASSERT (rotr64 (16045690984503098046ULL, 31) == 10807923863667310047ULL); + ASSERT (rotr64 (16045690984503098046ULL, 32) == 14627333968688430831ULL); + ASSERT (rotr64 (16045690984503098046ULL, 33) == 16537039021198991223ULL); + ASSERT (rotr64 (16045690984503098046ULL, 34) == 17491891547454271419ULL); + ASSERT (rotr64 (16045690984503098046ULL, 35) == 17969317810581911517ULL); + ASSERT (rotr64 (16045690984503098046ULL, 36) == 18208030942145731566ULL); + ASSERT (rotr64 (16045690984503098046ULL, 37) == 9104015471072865783ULL); + ASSERT (rotr64 (16045690984503098046ULL, 38) == 13775379772391208699ULL); + ASSERT (rotr64 (16045690984503098046ULL, 39) == 16111061923050380157ULL); + ASSERT (rotr64 (16045690984503098046ULL, 40) == 17278902998379965886ULL); + ASSERT (rotr64 (16045690984503098046ULL, 41) == 8639451499189982943ULL); + ASSERT (rotr64 (16045690984503098046ULL, 42) == 13543097786449767279ULL); + ASSERT (rotr64 (16045690984503098046ULL, 43) == 15994920930079659447ULL); + ASSERT (rotr64 (16045690984503098046ULL, 44) == 17220832501894605531ULL); + ASSERT (rotr64 (16045690984503098046ULL, 45) == 17833788287802078573ULL); + ASSERT (rotr64 (16045690984503098046ULL, 46) == 18140266180755815094ULL); + ASSERT (rotr64 (16045690984503098046ULL, 47) == 9070133090377907547ULL); + ASSERT (rotr64 (16045690984503098046ULL, 48) == 13758438582043729581ULL); + ASSERT (rotr64 (16045690984503098046ULL, 49) == 16102591327876640598ULL); + ASSERT (rotr64 (16045690984503098046ULL, 50) == 8051295663938320299ULL); + ASSERT (rotr64 (16045690984503098046ULL, 51) == 13249019868823935957ULL); + ASSERT (rotr64 (16045690984503098046ULL, 52) == 15847881971266743786ULL); + ASSERT (rotr64 (16045690984503098046ULL, 53) == 7923940985633371893ULL); + ASSERT (rotr64 (16045690984503098046ULL, 54) == 13185342529671461754ULL); + ASSERT (rotr64 (16045690984503098046ULL, 55) == 6592671264835730877ULL); + ASSERT (rotr64 (16045690984503098046ULL, 56) == 12519707669272641246ULL); + ASSERT (rotr64 (16045690984503098046ULL, 57) == 6259853834636320623ULL); + ASSERT (rotr64 (16045690984503098046ULL, 58) == 12353298954172936119ULL); + ASSERT (rotr64 (16045690984503098046ULL, 59) == 15400021513941243867ULL); + ASSERT (rotr64 (16045690984503098046ULL, 60) == 16923382793825397741ULL); + ASSERT (rotr64 (16045690984503098046ULL, 61) == 17685063433767474678ULL); + ASSERT (rotr64 (16045690984503098046ULL, 62) == 8842531716883737339ULL); + ASSERT (rotr64 (16045690984503098046ULL, 63) == 13644637895296644477ULL); +#endif /* UINT64_MAX */ + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-btowc.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-btowc.c new file mode 100644 index 0000000000..7d3a7b6a58 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-btowc.c @@ -0,0 +1,63 @@ +/* Test of conversion of unibyte character to wide character. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <wchar.h> + +#include "signature.h" +SIGNATURE_CHECK (btowc, wint_t, (int)); + +#include <locale.h> +#include <stdio.h> + +#include "macros.h" + +int +main (int argc, char *argv[]) +{ + int c; + + /* configure should already have checked that the locale is supported. */ + if (setlocale (LC_ALL, "") == NULL) + return 1; + + ASSERT (btowc (EOF) == WEOF); + + if (argc > 1) + switch (argv[1][0]) + { + case '1': + /* Locale encoding is ISO-8859-1 or ISO-8859-15. */ + for (c = 0; c < 0x80; c++) + ASSERT (btowc (c) == c); + for (c = 0xA0; c < 0x100; c++) + ASSERT (btowc (c) != WEOF); + return 0; + + case '2': + /* Locale encoding is UTF-8. */ + for (c = 0; c < 0x80; c++) + ASSERT (btowc (c) == c); + for (c = 0x80; c < 0x100; c++) + ASSERT (btowc (c) == WEOF); + return 0; + } + + return 1; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-btowc1.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-btowc1.sh new file mode 100755 index 0000000000..aaef48d214 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-btowc1.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test in an ISO-8859-1 or ISO-8859-15 locale. +: ${LOCALE_FR=fr_FR} +if test $LOCALE_FR = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no traditional french locale is installed" + else + echo "Skipping test: no traditional french locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_FR \ +./test-btowc${EXEEXT} 1 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-btowc2.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-btowc2.sh new file mode 100755 index 0000000000..2e060384cb --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-btowc2.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test whether a specific UTF-8 locale is installed. +: ${LOCALE_FR_UTF8=fr_FR.UTF-8} +if test $LOCALE_FR_UTF8 = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no french Unicode locale is installed" + else + echo "Skipping test: no french Unicode locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_FR_UTF8 \ +./test-btowc${EXEEXT} 2 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-c-ctype.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-c-ctype.c new file mode 100644 index 0000000000..d9780358ba --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-c-ctype.c @@ -0,0 +1,228 @@ +/* Test of character handling in C locale. + Copyright (C) 2005, 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2005. */ + +#include <config.h> + +#include "c-ctype.h" + +#include <ctype.h> +#include <limits.h> +#include <locale.h> + +#include "macros.h" + +static void +test_agree_with_C_locale (void) +{ + int c; + + for (c = 0; c <= UCHAR_MAX; c++) + { + ASSERT (c_isascii (c) == (isascii (c) != 0)); + if (c_isascii (c)) + { + ASSERT (c_isalnum (c) == (isalnum (c) != 0)); + ASSERT (c_isalpha (c) == (isalpha (c) != 0)); + ASSERT (c_isblank (c) == (isblank (c) != 0)); + ASSERT (c_iscntrl (c) == (iscntrl (c) != 0)); + ASSERT (c_isdigit (c) == (isdigit (c) != 0)); + ASSERT (c_islower (c) == (islower (c) != 0)); + ASSERT (c_isgraph (c) == (isgraph (c) != 0)); + ASSERT (c_isprint (c) == (isprint (c) != 0)); + ASSERT (c_ispunct (c) == (ispunct (c) != 0)); + ASSERT (c_isspace (c) == (isspace (c) != 0)); + ASSERT (c_isupper (c) == (isupper (c) != 0)); + ASSERT (c_isxdigit (c) == (isxdigit (c) != 0)); + ASSERT (c_tolower (c) == tolower (c)); + ASSERT (c_toupper (c) == toupper (c)); + } + } +} + +static void +test_all (void) +{ + int c; + int n_isascii = 0; + + for (c = CHAR_MIN; c <= UCHAR_MAX; c++) + { + if (! (0 <= c && c <= CHAR_MAX)) + { + ASSERT (! c_isascii (c)); + ASSERT (! c_isalnum (c)); + ASSERT (! c_isalpha (c)); + ASSERT (! c_isblank (c)); + ASSERT (! c_iscntrl (c)); + ASSERT (! c_isdigit (c)); + ASSERT (! c_islower (c)); + ASSERT (! c_isgraph (c)); + ASSERT (! c_isprint (c)); + ASSERT (! c_ispunct (c)); + ASSERT (! c_isspace (c)); + ASSERT (! c_isupper (c)); + ASSERT (! c_isxdigit (c)); + ASSERT (c_tolower (c) == c); + ASSERT (c_toupper (c) == c); + } + + n_isascii += c_isascii (c); + +#ifdef C_CTYPE_ASCII + ASSERT (c_isascii (c) == (0 <= c && c <= 0x7f)); +#endif + + ASSERT (c_isascii (c) == (c_isprint (c) || c_iscntrl (c))); + + ASSERT (c_isalnum (c) == (c_isalpha (c) || c_isdigit (c))); + + ASSERT (c_isalpha (c) == (c_islower (c) || c_isupper (c))); + + switch (c) + { + case '\t': case ' ': + ASSERT (c_isblank (c) == 1); + break; + default: + ASSERT (c_isblank (c) == 0); + break; + } + +#ifdef C_CTYPE_ASCII + ASSERT (c_iscntrl (c) == ((c >= 0 && c < 0x20) || c == 0x7f)); +#endif + + switch (c) + { + case '\a': case '\b': case '\f': case '\n': + case '\r': case '\t': case '\v': + ASSERT (c_iscntrl (c)); + break; + } + + ASSERT (! (c_iscntrl (c) && c_isprint (c))); + + switch (c) + { + case '0': case '1': case '2': case '3': case '4': case '5': + case '6': case '7': case '8': case '9': + ASSERT (c_isdigit (c) == 1); + break; + default: + ASSERT (c_isdigit (c) == 0); + break; + } + + switch (c) + { + case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': + case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': + case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': + case 's': case 't': case 'u': case 'v': case 'w': case 'x': + case 'y': case 'z': + ASSERT (c_islower (c) == 1); + ASSERT (c_toupper (c) == c - 'a' + 'A'); + break; + default: + ASSERT (c_islower (c) == 0); + ASSERT (c_toupper (c) == c); + break; + } + +#ifdef C_CTYPE_ASCII + ASSERT (c_isgraph (c) == ((c >= 0x20 && c < 0x7f) && c != ' ')); + + ASSERT (c_isprint (c) == (c >= 0x20 && c < 0x7f)); +#endif + + ASSERT (c_isgraph (c) == (c_isalnum (c) || c_ispunct (c))); + + ASSERT (c_isprint (c) == (c_isgraph (c) || c == ' ')); + + switch (c) + { + case '!': case '"': case '#': case '$': case '%': case '&': case '\'': + case '(': case ')': case '*': case '+': case ',': case '-': case '.': + case '/': case ':': case ';': case '<': case '=': case '>': case '?': + case '@': case '[': case'\\': case ']': case '^': case '_': case '`': + case '{': case '|': case '}': case '~': + ASSERT (c_ispunct (c) == 1); + break; + default: + ASSERT (c_ispunct (c) == 0); + break; + } + + switch (c) + { + case ' ': case '\t': case '\n': case '\v': case '\f': case '\r': + ASSERT (c_isspace (c) == 1); + break; + default: + ASSERT (c_isspace (c) == 0); + break; + } + + switch (c) + { + case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': + case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': + case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': + case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': + case 'Y': case 'Z': + ASSERT (c_isupper (c) == 1); + ASSERT (c_tolower (c) == c - 'A' + 'a'); + break; + default: + ASSERT (c_isupper (c) == 0); + ASSERT (c_tolower (c) == c); + break; + } + + switch (c) + { + case '0': case '1': case '2': case '3': case '4': case '5': + case '6': case '7': case '8': case '9': + case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': + case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': + ASSERT (c_isxdigit (c) == 1); + break; + default: + ASSERT (c_isxdigit (c) == 0); + break; + } + } + + ASSERT (n_isascii == 128); +} + +int +main () +{ + test_agree_with_C_locale (); + + test_all (); + + setlocale (LC_ALL, "de_DE"); + test_all (); + + setlocale (LC_ALL, "ja_JP.EUC-JP"); + test_all (); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-c-stack.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-c-stack.c new file mode 100644 index 0000000000..7da4e4f571 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-c-stack.c @@ -0,0 +1,73 @@ +/* Test of c-stack module. + Copyright (C) 2002, 2004, 2006, 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "c-stack.h" + +#include "exitfail.h" +#include <stdio.h> +#if HAVE_SETRLIMIT +/* At least FreeBSD 5.0 needs extra headers before <sys/resource.h> + will compile. */ +# include <sys/types.h> +# include <sys/time.h> +# include <sys/resource.h> +#endif + +#include "macros.h" + +static volatile int * +recurse_1 (volatile int n, volatile int *p) +{ + if (n >= 0) + *recurse_1 (n + 1, p) += n; + return p; +} + +static int +recurse (volatile int n) +{ + int sum = 0; + return *recurse_1 (n, &sum); +} + +int +main (int argc, char **argv) +{ +#if HAVE_SETRLIMIT && defined RLIMIT_STACK + /* Before starting the endless recursion, try to be friendly to the + user's machine. On some Linux 2.2.x systems, there is no stack + limit for user processes at all. We don't want to kill such + systems. */ + struct rlimit rl; + rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */ + setrlimit (RLIMIT_STACK, &rl); +#endif + + if (c_stack_action (NULL) == 0) + { + if (1 < argc) + { + exit_failure = 77; + ++*argv[argc]; /* Intentionally dereference NULL. */ + } + return recurse (0); + } + fputs ("skipping test: ", stderr); + perror ("c_stack_action"); + return 77; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-c-stack.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-c-stack.sh new file mode 100755 index 0000000000..f979065627 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-c-stack.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="t-c-stack.tmp" +./test-c-stack${EXEEXT} 2> t-c-stack.tmp +case $? in + 77) cat t-c-stack.tmp >&2; (exit 77); exit 77 ;; + 1) ;; + *) (exit 1); exit 1 ;; +esac +if grep 'stack overflow' t-c-stack.tmp >/dev/null ; then + : +else + (exit 1); exit 1 +fi + +rm -fr $tmpfiles + +exit 0 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-c-stack2.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-c-stack2.sh new file mode 100755 index 0000000000..0cd49c969b --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-c-stack2.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="t-c-stack2.tmp" + +# Sanitize exit status within a subshell, since some shells fail to +# redirect stderr on their message about death due to signal. +(./test-c-stack${EXEEXT} 1; exit $?) 2> t-c-stack2.tmp + +case $? in + 77) if grep 'stack overflow' t-c-stack2.tmp >/dev/null ; then + if test -z "$LIBSIGSEGV"; then + echo 'cannot tell stack overflow from crash; consider installing libsigsegv' >&2 + exit 77 + else + echo 'cannot tell stack overflow from crash, in spite of libsigsegv' >&2 + exit 1 + fi + else + cat t-c-stack2.tmp >&2 + exit 77 + fi + ;; + 0) (exit 1); exit 1 ;; +esac +if grep 'program error' t-c-stack2.tmp >/dev/null ; then + : +else + (exit 1); exit 1 +fi + +rm -fr $tmpfiles + +exit 0 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-c-strcase.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-c-strcase.sh new file mode 100755 index 0000000000..5fcf906b66 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-c-strcase.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# Test in the C locale. +./test-c-strcasecmp${EXEEXT} || exit 1 +./test-c-strncasecmp${EXEEXT} || exit 1 + +# Test in an ISO-8859-1 or ISO-8859-15 locale. +: ${LOCALE_FR=fr_FR} +if test $LOCALE_FR != none; then + LC_ALL=$LOCALE_FR ./test-c-strcasecmp${EXEEXT} locale || exit 1 + LC_ALL=$LOCALE_FR ./test-c-strncasecmp${EXEEXT} locale || exit 1 +fi + +# Test in a Turkish UTF-8 locale. +: ${LOCALE_TR_UTF8=tr_TR.UTF-8} +if test $LOCALE_TR_UTF8 != none; then + LC_ALL=$LOCALE_TR_UTF8 ./test-c-strcasecmp${EXEEXT} locale || exit 1 + LC_ALL=$LOCALE_TR_UTF8 ./test-c-strncasecmp${EXEEXT} locale || exit 1 +fi + +exit 0 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-c-strcasecmp.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-c-strcasecmp.c new file mode 100644 index 0000000000..8eb5fd59ad --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-c-strcasecmp.c @@ -0,0 +1,68 @@ +/* Test of case-insensitive string comparison function. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include "c-strcase.h" +#include "c-ctype.h" + +#include <locale.h> +#include <string.h> + +#include "macros.h" + +int +main (int argc, char *argv[]) +{ + if (argc > 1) + { + /* configure should already have checked that the locale is supported. */ + if (setlocale (LC_ALL, "") == NULL) + return 1; + } + + ASSERT (c_strcasecmp ("paragraph", "Paragraph") == 0); + + ASSERT (c_strcasecmp ("paragrapH", "parAgRaph") == 0); + + ASSERT (c_strcasecmp ("paragraph", "paraLyzed") < 0); + ASSERT (c_strcasecmp ("paraLyzed", "paragraph") > 0); + + ASSERT (c_strcasecmp ("para", "paragraph") < 0); + ASSERT (c_strcasecmp ("paragraph", "para") > 0); + + /* The following tests shows how c_strcasecmp() is different from + strcasecmp(). */ + + ASSERT (c_strcasecmp ("\311mile", "\351mile") < 0); + ASSERT (c_strcasecmp ("\351mile", "\311mile") > 0); + + /* The following tests shows how c_strcasecmp() is different from + mbscasecmp(). */ + + ASSERT (c_strcasecmp ("\303\266zg\303\274r", "\303\226ZG\303\234R") > 0); /* özgür */ + ASSERT (c_strcasecmp ("\303\226ZG\303\234R", "\303\266zg\303\274r") < 0); /* özgür */ + +#if C_CTYPE_ASCII + /* This test shows how strings of different size cannot compare equal. */ + ASSERT (c_strcasecmp ("turkish", "TURK\304\260SH") < 0); + ASSERT (c_strcasecmp ("TURK\304\260SH", "turkish") > 0); +#endif + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-c-strncasecmp.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-c-strncasecmp.c new file mode 100644 index 0000000000..6aea06c410 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-c-strncasecmp.c @@ -0,0 +1,82 @@ +/* Test of case-insensitive string comparison function. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include "c-strcase.h" +#include "c-ctype.h" + +#include <locale.h> +#include <string.h> + +#include "macros.h" + +int +main (int argc, char *argv[]) +{ + if (argc > 1) + { + /* configure should already have checked that the locale is supported. */ + if (setlocale (LC_ALL, "") == NULL) + return 1; + } + + ASSERT (c_strncasecmp ("paragraph", "Paragraph", 1000000) == 0); + ASSERT (c_strncasecmp ("paragraph", "Paragraph", 9) == 0); + + ASSERT (c_strncasecmp ("paragrapH", "parAgRaph", 1000000) == 0); + ASSERT (c_strncasecmp ("paragrapH", "parAgRaph", 9) == 0); + + ASSERT (c_strncasecmp ("paragraph", "paraLyzed", 10) < 0); + ASSERT (c_strncasecmp ("paragraph", "paraLyzed", 9) < 0); + ASSERT (c_strncasecmp ("paragraph", "paraLyzed", 5) < 0); + ASSERT (c_strncasecmp ("paragraph", "paraLyzed", 4) == 0); + ASSERT (c_strncasecmp ("paraLyzed", "paragraph", 10) > 0); + ASSERT (c_strncasecmp ("paraLyzed", "paragraph", 9) > 0); + ASSERT (c_strncasecmp ("paraLyzed", "paragraph", 5) > 0); + ASSERT (c_strncasecmp ("paraLyzed", "paragraph", 4) == 0); + + ASSERT (c_strncasecmp ("para", "paragraph", 10) < 0); + ASSERT (c_strncasecmp ("para", "paragraph", 9) < 0); + ASSERT (c_strncasecmp ("para", "paragraph", 5) < 0); + ASSERT (c_strncasecmp ("para", "paragraph", 4) == 0); + ASSERT (c_strncasecmp ("paragraph", "para", 10) > 0); + ASSERT (c_strncasecmp ("paragraph", "para", 9) > 0); + ASSERT (c_strncasecmp ("paragraph", "para", 5) > 0); + ASSERT (c_strncasecmp ("paragraph", "para", 4) == 0); + + /* The following tests shows how c_strncasecmp() is different from + strncasecmp(). */ + + ASSERT (c_strncasecmp ("\311mily", "\351mile", 4) < 0); + ASSERT (c_strncasecmp ("\351mile", "\311mily", 4) > 0); + + /* The following tests shows how c_strncasecmp() is different from + mbsncasecmp(). */ + + ASSERT (c_strncasecmp ("\303\266zg\303\274r", "\303\226ZG\303\234R", 99) > 0); /* özgür */ + ASSERT (c_strncasecmp ("\303\226ZG\303\234R", "\303\266zg\303\274r", 99) < 0); /* özgür */ + +#if C_CTYPE_ASCII + /* This test shows how strings of different size cannot compare equal. */ + ASSERT (c_strncasecmp ("turkish", "TURK\304\260SH", 7) < 0); + ASSERT (c_strncasecmp ("TURK\304\260SH", "turkish", 7) > 0); +#endif + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-close.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-close.c new file mode 100644 index 0000000000..c8565aa488 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-close.c @@ -0,0 +1,45 @@ +/* Test closing a file or socket. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <unistd.h> + +#include "signature.h" +SIGNATURE_CHECK (close, int, (int)); + +#include <errno.h> + +#include "macros.h" + +int +main (void) +{ + /* Test behaviour for invalid file descriptors. */ + { + errno = 0; + ASSERT (close (-1) == -1); + ASSERT (errno == EBADF); + } + { + close (99); + errno = 0; + ASSERT (close (99) == -1); + ASSERT (errno == EBADF); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-connect.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-connect.c new file mode 100644 index 0000000000..46e2f7e286 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-connect.c @@ -0,0 +1,60 @@ +/* Test connecting a client socket. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <sys/socket.h> + +#include "signature.h" +SIGNATURE_CHECK (connect, int, (int, const struct sockaddr *, socklen_t)); + +#include <errno.h> +#include <netinet/in.h> +#include <arpa/inet.h> +#include <unistd.h> + +#include "sockets.h" +#include "macros.h" + +int +main (void) +{ + (void) gl_sockets_startup (SOCKETS_1_1); + + /* Test behaviour for invalid file descriptors. */ + { + struct sockaddr_in addr; + + addr.sin_family = AF_INET; + inet_pton (AF_INET, "127.0.0.1", &addr.sin_addr); + addr.sin_port = htons (80); + { + errno = 0; + ASSERT (connect (-1, (const struct sockaddr *) &addr, sizeof (addr)) + == -1); + ASSERT (errno == EBADF); + } + { + close (99); + errno = 0; + ASSERT (connect (99, (const struct sockaddr *) &addr, sizeof (addr)) + == -1); + ASSERT (errno == EBADF); + } + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-ctype.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-ctype.c new file mode 100644 index 0000000000..66e1026a68 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-ctype.c @@ -0,0 +1,27 @@ +/* Test of <ctype.h> substitute. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +#include <config.h> + +#include <ctype.h> + +int +main (void) +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-dirname.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-dirname.c new file mode 100644 index 0000000000..bbd135e368 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-dirname.c @@ -0,0 +1,193 @@ +/* Test the gnulib dirname module. + Copyright (C) 2005-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "dirname.h" + +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +struct test { + const char *name; /* Name under test. */ + const char *dir; /* dir_name (name). */ + const char *last; /* last_component (name). */ + const char *base; /* base_name (name). */ + const char *stripped; /* name after strip_trailing_slashes (name). */ + bool modified; /* result of strip_trailing_slashes (name). */ + bool absolute; /* IS_ABSOLUTE_FILE_NAME (name). */ +}; + +static struct test tests[] = { + {"d/f", "d", "f", "f", "d/f", false, false}, + {"/d/f", "/d", "f", "f", "/d/f", false, true}, + {"d/f/", "d", "f/", "f/", "d/f", true, false}, + {"d/f//", "d", "f//", "f/", "d/f", true, false}, + {"f", ".", "f", "f", "f", false, false}, + {"/", "/", "", "/", "/", false, true}, +#if DOUBLE_SLASH_IS_DISTINCT_ROOT + {"//", "//", "", "//", "//", false, true}, + {"//d", "//", "d", "d", "//d", false, true}, +#else + {"//", "/", "", "/", "/", true, true}, + {"//d", "/", "d", "d", "//d", false, true}, +#endif + {"///", "/", "", "/", "/", true, true}, + {"///a///", "/", "a///", "a/", "///a", true, true}, + /* POSIX requires dirname("") and basename("") to both return ".", + but dir_name and base_name are defined differently. */ + {"", ".", "", "", "", false, false}, + {".", ".", ".", ".", ".", false, false}, + {"..", ".", "..", "..", "..", false, false}, +#if ISSLASH ('\\') + {"a\\", ".", "a\\", "a\\", "a", true, false}, + {"a\\b", "a", "b", "b", "a\\b", false, false}, + {"\\", "\\", "", "\\", "\\", false, true}, + {"\\/\\", "\\", "", "\\", "\\", true, true}, + {"\\\\/", "\\", "", "\\", "\\", true, true}, + {"\\//", "\\", "", "\\", "\\", true, true}, + {"//\\", "/", "", "/", "/", true, true}, +#else + {"a\\", ".", "a\\", "a\\", "a\\", false, false}, + {"a\\b", ".", "a\\b", "a\\b", "a\\b", false, false}, + {"\\", ".", "\\", "\\", "\\", false, false}, + {"\\/\\", "\\", "\\", "\\", "\\/\\",false, false}, + {"\\\\/", ".", "\\\\/","\\\\/","\\\\", true, false}, + {"\\//", ".", "\\//", "\\/", "\\", true, false}, +# if DOUBLE_SLASH_IS_DISTINCT_ROOT + {"//\\", "//", "\\", "\\", "//\\", false, true}, +# else + {"//\\", "/", "\\", "\\", "//\\", false, true}, +# endif +#endif +#if ISSLASH ('\\') +# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE + {"c:", "c:", "", "c:", "c:", false, false}, + {"c:/", "c:/", "", "c:/", "c:/", false, true}, + {"c://", "c:/", "", "c:/", "c:/", true, true}, + {"c:/d", "c:/", "d", "d", "c:/d", false, true}, + {"c://d", "c:/", "d", "d", "c://d",false, true}, + {"c:/d/", "c:/", "d/", "d/", "c:/d", true, true}, + {"c:/d/f", "c:/d", "f", "f", "c:/d/f",false, true}, + {"c:d", "c:.", "d", "d", "c:d", false, false}, + {"c:d/", "c:.", "d/", "d/", "c:d", true, false}, + {"c:d/f", "c:d", "f", "f", "c:d/f",false, false}, + {"a:b:c", "a:.", "b:c", "./b:c","a:b:c",false, false}, + {"a/b:c", "a", "b:c", "./b:c","a/b:c",false, false}, + {"a/b:c/", "a", "b:c/", "./b:c/","a/b:c",true, false}, +# else /* ! FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE */ + {"c:", "c:", "", "c:", "c:", false, true}, + {"c:/", "c:", "", "c:", "c:", true, true}, + {"c://", "c:", "", "c:", "c:", true, true}, + {"c:/d", "c:", "d", "d", "c:/d", false, true}, + {"c://d", "c:", "d", "d", "c://d",false, true}, + {"c:/d/", "c:", "d/", "d/", "c:/d", true, true}, + {"c:/d/f", "c:/d", "f", "f", "c:/d/f",false, true}, + {"c:d", "c:", "d", "d", "c:d", false, true}, + {"c:d/", "c:", "d/", "d/", "c:d", true, true}, + {"c:d/f", "c:d", "f", "f", "c:d/f",false, true}, + {"a:b:c", "a:", "b:c", "./b:c","a:b:c",false, true}, + {"a/b:c", "a", "b:c", "./b:c","a/b:c",false, false}, + {"a/b:c/", "a", "b:c/", "./b:c/","a/b:c",true, false}, +# endif +#else /* ! ISSLASH ('\\') */ + {"c:", ".", "c:", "c:", "c:", false, false}, + {"c:/", ".", "c:/", "c:/", "c:", true, false}, + {"c://", ".", "c://", "c:/", "c:", true, false}, + {"c:/d", "c:", "d", "d", "c:/d", false, false}, + {"c://d", "c:", "d", "d", "c://d",false, false}, + {"c:/d/", "c:", "d/", "d/", "c:/d", true, false}, + {"c:/d/f", "c:/d", "f", "f", "c:/d/f",false, false}, + {"c:d", ".", "c:d", "c:d", "c:d", false, false}, + {"c:d/", ".", "c:d/", "c:d/", "c:d", true, false}, + {"c:d/f", "c:d", "f", "f", "c:d/f",false, false}, + {"a:b:c", ".", "a:b:c","a:b:c","a:b:c",false, false}, + {"a/b:c", "a", "b:c", "b:c", "a/b:c",false, false}, + {"a/b:c/", "a", "b:c/", "b:c/", "a/b:c",true, false}, +#endif + {"1:", ".", "1:", "1:", "1:", false, false}, + {"1:/", ".", "1:/", "1:/", "1:", true, false}, + {"/:", "/", ":", ":", "/:", false, true}, + {"/:/", "/", ":/", ":/", "/:", true, true}, + /* End sentinel. */ + {NULL, NULL, NULL, NULL, NULL, false, false} +}; + +int +main (void) +{ + struct test *t; + bool ok = true; + + for (t = tests; t->name; t++) + { + char *dir = dir_name (t->name); + int dirlen = dir_len (t->name); + char *last = last_component (t->name); + char *base = base_name (t->name); + int baselen = base_len (base); + char *stripped = strdup (t->name); + bool modified = strip_trailing_slashes (stripped); + bool absolute = IS_ABSOLUTE_FILE_NAME (t->name); + if (! (strcmp (dir, t->dir) == 0 + && (dirlen == strlen (dir) + || (dirlen + 1 == strlen (dir) && dir[dirlen] == '.')))) + { + ok = false; + printf ("dir_name '%s': got '%s' len %d," + " expected '%s' len %lu\n", + t->name, dir, dirlen, + t->dir, (unsigned long) strlen (t->dir)); + } + if (strcmp (last, t->last)) + { + ok = false; + printf ("last_component '%s': got '%s', expected '%s'\n", + t->name, last, t->last); + } + if (! (strcmp (base, t->base) == 0 + && (baselen == strlen (base) + || (baselen + 1 == strlen (base) + && ISSLASH (base[baselen]))))) + { + ok = false; + printf ("base_name '%s': got '%s' len %d," + " expected '%s' len %lu\n", + t->name, base, baselen, + t->base, (unsigned long) strlen (t->base)); + } + if (strcmp (stripped, t->stripped) || modified != t->modified) + { + ok = false; + printf ("strip_trailing_slashes '%s': got %s %s, expected %s %s\n", + t->name, stripped, modified ? "changed" : "unchanged", + t->stripped, t->modified ? "changed" : "unchanged"); + } + if (t->absolute != absolute) + { + ok = false; + printf ("'%s': got %s, expected %s\n", t->name, + absolute ? "absolute" : "relative", + t->absolute ? "absolute" : "relative"); + } + free (dir); + free (base); + free (stripped); + } + return ok ? 0 : 1; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-dup2.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-dup2.c new file mode 100644 index 0000000000..f98486a810 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-dup2.c @@ -0,0 +1,222 @@ +/* Test duplicating file descriptors. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +#include <config.h> + +#include <unistd.h> + +#include "signature.h" +SIGNATURE_CHECK (dup2, int, (int, int)); + +#include <errno.h> +#include <fcntl.h> + +#if HAVE_SYS_RESOURCE_H +# include <sys/resource.h> +#endif + +#include "binary-io.h" + +#if GNULIB_TEST_CLOEXEC +# include "cloexec.h" +#endif + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Get declarations of the native Windows API functions. */ +# define WIN32_LEAN_AND_MEAN +# include <windows.h> +/* Get _get_osfhandle. */ +# if GNULIB_MSVC_NOTHROW +# include "msvc-nothrow.h" +# else +# include <io.h> +# endif +#endif + +#include "macros.h" + +/* Return non-zero if FD is open. */ +static int +is_open (int fd) +{ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* On native Windows, the initial state of unassigned standard file + descriptors is that they are open but point to an + INVALID_HANDLE_VALUE, and there is no fcntl. */ + return (HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE; +#else +# ifndef F_GETFL +# error Please port fcntl to your platform +# endif + return 0 <= fcntl (fd, F_GETFL); +#endif +} + +#if GNULIB_TEST_CLOEXEC +/* Return non-zero if FD is open and inheritable across exec/spawn. */ +static int +is_inheritable (int fd) +{ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* On native Windows, the initial state of unassigned standard file + descriptors is that they are open but point to an + INVALID_HANDLE_VALUE, and there is no fcntl. */ + HANDLE h = (HANDLE) _get_osfhandle (fd); + DWORD flags; + if (h == INVALID_HANDLE_VALUE || GetHandleInformation (h, &flags) == 0) + return 0; + return (flags & HANDLE_FLAG_INHERIT) != 0; +# else +# ifndef F_GETFD +# error Please port fcntl to your platform +# endif + int i = fcntl (fd, F_GETFD); + return 0 <= i && (i & FD_CLOEXEC) == 0; +# endif +} +#endif /* GNULIB_TEST_CLOEXEC */ + +#if !O_BINARY +# define setmode(f,m) zero () +static int zero (void) { return 0; } +#endif + +/* Return non-zero if FD is open in the given MODE, which is either + O_TEXT or O_BINARY. */ +static int +is_mode (int fd, int mode) +{ + int value = setmode (fd, O_BINARY); + setmode (fd, value); + return mode == value; +} + +int +main (void) +{ + const char *file = "test-dup2.tmp"; + char buffer[1]; + int bad_fd = getdtablesize (); + int fd = open (file, O_CREAT | O_TRUNC | O_RDWR, 0600); + + /* Assume std descriptors were provided by invoker. */ + ASSERT (STDERR_FILENO < fd); + ASSERT (is_open (fd)); + /* Ignore any other fd's leaked into this process. */ + close (fd + 1); + close (fd + 2); + ASSERT (!is_open (fd + 1)); + ASSERT (!is_open (fd + 2)); + + /* Assigning to self must be a no-op. */ + ASSERT (dup2 (fd, fd) == fd); + ASSERT (is_open (fd)); + + /* The source must be valid. */ + errno = 0; + ASSERT (dup2 (-1, fd) == -1); + ASSERT (errno == EBADF); + close (99); + errno = 0; + ASSERT (dup2 (99, fd) == -1); + ASSERT (errno == EBADF); + errno = 0; + ASSERT (dup2 (AT_FDCWD, fd) == -1); + ASSERT (errno == EBADF); + ASSERT (is_open (fd)); + + /* If the source is not open, then the destination is unaffected. */ + errno = 0; + ASSERT (dup2 (fd + 1, fd + 1) == -1); + ASSERT (errno == EBADF); + ASSERT (!is_open (fd + 1)); + errno = 0; + ASSERT (dup2 (fd + 1, fd) == -1); + ASSERT (errno == EBADF); + ASSERT (is_open (fd)); + + /* The destination must be valid. */ + errno = 0; + ASSERT (dup2 (fd, -2) == -1); + ASSERT (errno == EBADF); + if (bad_fd > 256) + { + ASSERT (dup2 (fd, 255) == 255); + ASSERT (dup2 (fd, 256) == 256); + ASSERT (close (255) == 0); + ASSERT (close (256) == 0); + } + ASSERT (dup2 (fd, bad_fd - 1) == bad_fd - 1); + ASSERT (close (bad_fd - 1) == 0); + errno = 0; + ASSERT (dup2 (fd, bad_fd) == -1); + ASSERT (errno == EBADF); + + /* Using dup2 can skip fds. */ + ASSERT (dup2 (fd, fd + 2) == fd + 2); + ASSERT (is_open (fd)); + ASSERT (!is_open (fd + 1)); + ASSERT (is_open (fd + 2)); + + /* Verify that dup2 closes the previous occupant of a fd. */ + ASSERT (open ("/dev/null", O_WRONLY, 0600) == fd + 1); + ASSERT (dup2 (fd + 1, fd) == fd); + ASSERT (close (fd + 1) == 0); + ASSERT (write (fd, "1", 1) == 1); + ASSERT (dup2 (fd + 2, fd) == fd); + ASSERT (lseek (fd, 0, SEEK_END) == 0); + ASSERT (write (fd + 2, "2", 1) == 1); + ASSERT (lseek (fd, 0, SEEK_SET) == 0); + ASSERT (read (fd, buffer, 1) == 1); + ASSERT (*buffer == '2'); + +#if GNULIB_TEST_CLOEXEC + /* Any new fd created by dup2 must not be cloexec. */ + ASSERT (close (fd + 2) == 0); + ASSERT (dup_cloexec (fd) == fd + 1); + ASSERT (!is_inheritable (fd + 1)); + ASSERT (dup2 (fd + 1, fd + 1) == fd + 1); + ASSERT (!is_inheritable (fd + 1)); + ASSERT (dup2 (fd + 1, fd + 2) == fd + 2); + ASSERT (!is_inheritable (fd + 1)); + ASSERT (is_inheritable (fd + 2)); + errno = 0; + ASSERT (dup2 (fd + 1, -1) == -1); + ASSERT (errno == EBADF); + ASSERT (!is_inheritable (fd + 1)); +#endif + + /* On systems that distinguish between text and binary mode, dup2 + reuses the mode of the source. */ + setmode (fd, O_BINARY); + ASSERT (is_mode (fd, O_BINARY)); + ASSERT (dup2 (fd, fd + 1) == fd + 1); + ASSERT (is_mode (fd + 1, O_BINARY)); + setmode (fd, O_TEXT); + ASSERT (is_mode (fd, O_TEXT)); + ASSERT (dup2 (fd, fd + 1) == fd + 1); + ASSERT (is_mode (fd + 1, O_TEXT)); + + /* Clean up. */ + ASSERT (close (fd + 2) == 0); + ASSERT (close (fd + 1) == 0); + ASSERT (close (fd) == 0); + ASSERT (unlink (file) == 0); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-environ.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-environ.c new file mode 100644 index 0000000000..97a268a9ac --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-environ.c @@ -0,0 +1,44 @@ +/* Test of environ variable. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <unistd.h> + +#include <string.h> + +int +main () +{ + /* The environment variables that are set even in the weirdest situations + are HOME and PATH. + POSIX says that HOME is initialized by the system, and that PATH may be + unset. But in practice it's more frequent to see HOME unset and PATH + set. So we test the presence of PATH. */ + char **remaining_variables = environ; + char *string; + + for (; (string = *remaining_variables) != NULL; remaining_variables++) + { + if (strncmp (string, "PATH=", 5) == 0) + /* Found the PATH environment variable. */ + return 0; + } + /* Failed to find the PATH environment variable. */ + return 1; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-errno.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-errno.c new file mode 100644 index 0000000000..8accfdac26 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-errno.c @@ -0,0 +1,119 @@ +/* Test of <errno.h> substitute. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <errno.h> + +/* Verify that the POSIX mandated errno values exist and can be used as + initializers outside of a function. + The variable names happen to match the Linux/x86 error numbers. */ +int e1 = EPERM; +int e2 = ENOENT; +int e3 = ESRCH; +int e4 = EINTR; +int e5 = EIO; +int e6 = ENXIO; +int e7 = E2BIG; +int e8 = ENOEXEC; +int e9 = EBADF; +int e10 = ECHILD; +int e11 = EAGAIN; +int e11a = EWOULDBLOCK; +int e12 = ENOMEM; +int e13 = EACCES; +int e14 = EFAULT; +int e16 = EBUSY; +int e17 = EEXIST; +int e18 = EXDEV; +int e19 = ENODEV; +int e20 = ENOTDIR; +int e21 = EISDIR; +int e22 = EINVAL; +int e23 = ENFILE; +int e24 = EMFILE; +int e25 = ENOTTY; +int e26 = ETXTBSY; +int e27 = EFBIG; +int e28 = ENOSPC; +int e29 = ESPIPE; +int e30 = EROFS; +int e31 = EMLINK; +int e32 = EPIPE; +int e33 = EDOM; +int e34 = ERANGE; +int e35 = EDEADLK; +int e36 = ENAMETOOLONG; +int e37 = ENOLCK; +int e38 = ENOSYS; +int e39 = ENOTEMPTY; +int e40 = ELOOP; +int e42 = ENOMSG; +int e43 = EIDRM; +int e67 = ENOLINK; +int e71 = EPROTO; +int e72 = EMULTIHOP; +int e74 = EBADMSG; +int e75 = EOVERFLOW; +int e84 = EILSEQ; +int e88 = ENOTSOCK; +int e89 = EDESTADDRREQ; +int e90 = EMSGSIZE; +int e91 = EPROTOTYPE; +int e92 = ENOPROTOOPT; +int e93 = EPROTONOSUPPORT; +int e95 = EOPNOTSUPP; +int e95a = ENOTSUP; +int e97 = EAFNOSUPPORT; +int e98 = EADDRINUSE; +int e99 = EADDRNOTAVAIL; +int e100 = ENETDOWN; +int e101 = ENETUNREACH; +int e102 = ENETRESET; +int e103 = ECONNABORTED; +int e104 = ECONNRESET; +int e105 = ENOBUFS; +int e106 = EISCONN; +int e107 = ENOTCONN; +int e110 = ETIMEDOUT; +int e111 = ECONNREFUSED; +int e113 = EHOSTUNREACH; +int e114 = EALREADY; +int e115 = EINPROGRESS; +int e116 = ESTALE; +int e122 = EDQUOT; +int e125 = ECANCELED; +int e130 = EOWNERDEAD; +int e131 = ENOTRECOVERABLE; + +/* Don't verify that these errno values are all different, except for possibly + EWOULDBLOCK == EAGAIN. Even Linux/x86 does not pass this check: it has + ENOTSUP == EOPNOTSUPP. */ + +int +main () +{ + /* Verify that errno can be assigned. */ + errno = EOVERFLOW; + + /* snprintf() callers want to distinguish EINVAL and EOVERFLOW. */ + if (errno == EINVAL) + return 1; + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude.c new file mode 100644 index 0000000000..cfeb647860 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude.c @@ -0,0 +1,128 @@ +/* Test suite for exclude. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + This file is part of the GNUlib Library. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> +#include <string.h> +#include <stdbool.h> +#include <fnmatch.h> + +#include "exclude.h" +#include "error.h" +#include "argmatch.h" + +#ifndef FNM_CASEFOLD +# define FNM_CASEFOLD 0 +#endif +#ifndef FNM_LEADING_DIR +# define FNM_LEADING_DIR 0 +#endif + +char const * const exclude_keywords[] = { + "noescape", + "pathname", + "period", + "leading_dir", + "casefold", + "anchored", + "include", + "wildcards", + NULL +}; + +int exclude_flags[] = { + FNM_NOESCAPE, + FNM_PATHNAME, + FNM_PERIOD, + FNM_LEADING_DIR, + FNM_CASEFOLD, + EXCLUDE_ANCHORED, + EXCLUDE_INCLUDE, + EXCLUDE_WILDCARDS +}; + +ARGMATCH_VERIFY (exclude_keywords, exclude_flags); + +/* Some packages define ARGMATCH_DIE and ARGMATCH_DIE_DECL in <config.h>, and + thus must link with a definition of that function. Provide it here. */ +#ifdef ARGMATCH_DIE_DECL + +_Noreturn ARGMATCH_DIE_DECL; +ARGMATCH_DIE_DECL { exit (1); } + +#endif + +int +main (int argc, char **argv) +{ + int exclude_options = 0; + struct exclude *exclude = new_exclude (); + + if (argc == 1) + error (1, 0, "usage: %s file -- words...", argv[0]); + + while (--argc) + { + char *opt = *++argv; + if (opt[0] == '-') + { + int neg = 0; + int flag; + char *s = opt + 1; + + if (opt[1] == '-' && opt[2] == 0) + { + argc--; + break; + } + if (strlen (s) > 3 && memcmp (s, "no-", 3) == 0) + { + neg = 1; + s += 3; + } + flag = XARGMATCH (opt, s, exclude_keywords, exclude_flags); + if (neg) + exclude_options &= ~flag; + else + exclude_options |= flag; + + /* Skip this test if invoked with -leading-dir on a system that + lacks support for FNM_LEADING_DIR. */ + if (strcmp (s, "leading_dir") == 0 && FNM_LEADING_DIR == 0) + exit (77); + + /* Likewise for -casefold and FNM_CASEFOLD. */ + if (strcmp (s, "casefold") == 0 && FNM_CASEFOLD == 0) + exit (77); + } + else if (add_exclude_file (add_exclude, exclude, opt, + exclude_options, '\n') != 0) + error (1, errno, "error loading %s", opt); + } + + for (; argc; --argc) + { + char *word = *++argv; + + printf ("%s: %d\n", word, excluded_file_name (exclude, word)); + } + + free_exclude (exclude); + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude1.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude1.sh new file mode 100755 index 0000000000..fba7153f56 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude1.sh @@ -0,0 +1,50 @@ +#! /bin/sh +# Test suite for exclude. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# This file is part of the GNUlib Library. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. "${srcdir=.}/init.sh"; path_prepend_ . +fail=0 + +# Test literal matches + +cat > in <<EOT +foo* +bar +Baz +EOT + +cat > expected <<EOT +foo: 0 +foo*: 1 +bar: 1 +foobar: 0 +baz: 0 +bar/qux: 0 +EOT + +test-exclude in -- foo 'foo*' bar foobar baz bar/qux > out || exit $? + +# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr +# does not understand '\r'. +case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac + +# normalize output +LC_ALL=C tr -d "$cr" < out > k && mv k out + +compare expected out || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude2.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude2.sh new file mode 100755 index 0000000000..e626c6294f --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude2.sh @@ -0,0 +1,50 @@ +#! /bin/sh +# Test suite for exclude. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# This file is part of the GNUlib Library. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. "${srcdir=.}/init.sh"; path_prepend_ . +fail=0 + +cat > in <<EOT +foo* +bar +Baz +EOT + +# Test case-insensitive literal matches + +cat > expected <<EOT +foo: 0 +foo*: 1 +bar: 1 +foobar: 0 +baz: 1 +bar/qux: 0 +EOT + +test-exclude -casefold in -- foo 'foo*' bar foobar baz bar/qux > out || exit $? + +# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr +# does not understand '\r'. +case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac + +# normalize output +LC_ALL=C tr -d "$cr" < out > k && mv k out + +compare expected out || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude3.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude3.sh new file mode 100755 index 0000000000..38c8b6430a --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude3.sh @@ -0,0 +1,50 @@ +#! /bin/sh +# Test suite for exclude. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# This file is part of the GNUlib Library. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. "${srcdir=.}/init.sh"; path_prepend_ . +fail=0 + +# Test include + +cat > in <<EOT +foo* +bar +Baz +EOT + +cat > expected <<EOT +foo: 1 +foo*: 0 +bar: 0 +foobar: 1 +baz: 1 +bar/qux: 1 +EOT + +test-exclude -include in -- foo 'foo*' bar foobar baz bar/qux > out || exit $? + +# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr +# does not understand '\r'. +case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac + +# normalize output +LC_ALL=C tr -d "$cr" < out > k && mv k out + +compare expected out || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude4.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude4.sh new file mode 100755 index 0000000000..42fa633db2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude4.sh @@ -0,0 +1,45 @@ +#! /bin/sh +# Test suite for exclude. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# This file is part of the GNUlib Library. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. "${srcdir=.}/init.sh"; path_prepend_ . +fail=0 + +# Test wildcard matching + +cat > in <<EOT +foo* +bar +Baz +EOT + +cat > expected <<EOT +foobar: 1 +EOT + +test-exclude -wildcards in -- foobar > out || exit $? + +# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr +# does not understand '\r'. +case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac + +# normalize output +LC_ALL=C tr -d "$cr" < out > k && mv k out + +compare expected out || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude5.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude5.sh new file mode 100755 index 0000000000..75521794ce --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude5.sh @@ -0,0 +1,48 @@ +#! /bin/sh +# Test suite for exclude. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# This file is part of the GNUlib Library. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. "${srcdir=.}/init.sh"; path_prepend_ . +fail=0 + +# Test FNM_LEADING_DIR + +cat > in <<EOT +foo* +bar +Baz +EOT + +cat > expected <<EOT +bar: 1 +bar/qux: 1 +barz: 0 +foo/bar: 1 +EOT + +test-exclude -leading_dir in -- bar bar/qux barz foo/bar > out || exit $? + +# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr +# does not understand '\r'. +case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac + +# normalize output +LC_ALL=C tr -d "$cr" < out > k && mv k out + +compare expected out || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude6.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude6.sh new file mode 100755 index 0000000000..11016c445e --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude6.sh @@ -0,0 +1,46 @@ +#! /bin/sh +# Test suite for exclude. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# This file is part of the GNUlib Library. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. "${srcdir=.}/init.sh"; path_prepend_ . +fail=0 + +# Test anchored + +cat > in <<EOT +foo* +bar +Baz +EOT + +cat > expected <<EOT +bar: 1 +foo/bar: 0 +EOT + +test-exclude -anchored in -- bar foo/bar > out || exit $? + +# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr +# does not understand '\r'. +case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac + +# normalize output +LC_ALL=C tr -d "$cr" < out > k && mv k out + +compare expected out || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude7.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude7.sh new file mode 100755 index 0000000000..6b9de77848 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude7.sh @@ -0,0 +1,47 @@ +#! /bin/sh +# Test suite for exclude. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# This file is part of the GNUlib Library. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. "${srcdir=.}/init.sh"; path_prepend_ . +fail=0 + +# Test exclude precedence + +cat > in <<EOT +foo* +bar +Baz +EOT + +cat > expected <<EOT +bar: 0 +bar: 1 +EOT + +test-exclude in -include in -- bar > out || exit $? +test-exclude -include in -no-include in -- bar >> out || exit $? + +# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr +# does not understand '\r'. +case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac + +# normalize output +LC_ALL=C tr -d "$cr" < out > k && mv k out + +compare expected out || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude8.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude8.sh new file mode 100755 index 0000000000..6585a4ea74 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-exclude8.sh @@ -0,0 +1,46 @@ +#! /bin/sh +# Test suite for exclude. +# Copyright (C) 2010-2017 Free Software Foundation, Inc. +# This file is part of the GNUlib Library. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. "${srcdir=.}/init.sh"; path_prepend_ . +fail=0 + +# Test escaped metacharacters. + +cat > in <<'EOT' +f\*e +b[a\*]r +EOT + +cat > expected <<'EOT' +f*e: 1 +file: 0 +bar: 1 +EOT + +test-exclude -wildcards in -- 'f*e' 'file' 'bar' > out || exit $? + +# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr +# does not understand '\r'. +case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac + +# normalize output +LC_ALL=C tr -d "$cr" < out > k && mv k out + +compare expected out || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-fcntl-h.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-fcntl-h.c new file mode 100644 index 0000000000..4c17fdf9bf --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-fcntl-h.c @@ -0,0 +1,130 @@ +/* Test of <fcntl.h> substitute. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <fcntl.h> + +/* Check that the various O_* macros are defined. */ +int o = (O_DIRECT | O_DIRECTORY | O_DSYNC | O_IGNORE_CTTY | O_NDELAY | O_NOATIME + | O_NONBLOCK | O_NOCTTY | O_NOFOLLOW | O_NOLINK | O_NOLINKS | O_NOTRANS + | O_RSYNC | O_SYNC | O_TTY_INIT | O_BINARY | O_TEXT); + +/* Check that the various SEEK_* macros are defined. */ +int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET }; + +/* Check that the FD_* macros are defined. */ +int i = FD_CLOEXEC; + +/* Check that the types are all defined. */ +pid_t t1; +off_t t2; +mode_t t3; + +int +main (void) +{ + /* Ensure no overlap in SEEK_*. */ + switch (0) + { + case SEEK_CUR: + case SEEK_END: + case SEEK_SET: + ; + } + + /* Ensure no dangerous overlap in non-zero gnulib-defined replacements. */ + switch (O_RDONLY) + { + /* Access modes */ + case O_RDONLY: + case O_WRONLY: + case O_RDWR: +#if O_EXEC && O_EXEC != O_RDONLY + case O_EXEC: +#endif +#if O_SEARCH && O_EXEC != O_SEARCH && O_SEARCH != O_RDONLY + case O_SEARCH: +#endif + i = ! (~O_ACCMODE & (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)); + break; + + /* Everyone should have these */ + case O_CREAT: + case O_EXCL: + case O_TRUNC: + case O_APPEND: + break; + + /* These might be 0 or O_RDONLY, only test non-zero versions. */ +#if O_CLOEXEC + case O_CLOEXEC: +#endif +#if O_DIRECT + case O_DIRECT: +#endif +#if O_DIRECTORY + case O_DIRECTORY: +#endif +#if O_DSYNC + case O_DSYNC: +#endif +#if O_IGNORE_CTTY + case O_IGNORE_CTTY: +#endif +#if O_NOATIME + case O_NOATIME: +#endif +#if O_NONBLOCK + case O_NONBLOCK: +#endif +#if O_NOCTTY + case O_NOCTTY: +#endif +#if O_NOFOLLOW + case O_NOFOLLOW: +#endif +#if O_NOLINK + case O_NOLINK: +#endif +#if O_NOLINKS + case O_NOLINKS: +#endif +#if O_NOTRANS + case O_NOTRANS: +#endif +#if O_RSYNC && O_RSYNC != O_DSYNC + case O_RSYNC: +#endif +#if O_SYNC && O_SYNC != O_DSYNC && O_SYNC != O_RSYNC + case O_SYNC: +#endif +#if O_TTY_INIT + case O_TTY_INIT: +#endif +#if O_BINARY + case O_BINARY: +#endif +#if O_TEXT + case O_TEXT: +#endif + ; + } + + return !i; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-fcntl.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-fcntl.c new file mode 100644 index 0000000000..a249f9ab01 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-fcntl.c @@ -0,0 +1,413 @@ +/* Test of fcntl(2). + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +#include <config.h> + +/* Specification. */ +#include <fcntl.h> + +#include "signature.h" +SIGNATURE_CHECK (fcntl, int, (int, int, ...)); + +/* Helpers. */ +#include <errno.h> +#include <stdarg.h> +#include <stdbool.h> +#include <unistd.h> + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Get declarations of the native Windows API functions. */ +# define WIN32_LEAN_AND_MEAN +# include <windows.h> +/* Get _get_osfhandle. */ +# if GNULIB_MSVC_NOTHROW +# include "msvc-nothrow.h" +# else +# include <io.h> +# endif +#endif + +#include "binary-io.h" +#include "macros.h" + +#if !O_BINARY +# define setmode(f,m) zero () +static int zero (void) { return 0; } +#endif + +/* Return true if FD is open. */ +static bool +is_open (int fd) +{ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* On native Windows, the initial state of unassigned standard file + descriptors is that they are open but point to an + INVALID_HANDLE_VALUE, and there is no fcntl. */ + return (HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE; +#else +# ifndef F_GETFL +# error Please port fcntl to your platform +# endif + return 0 <= fcntl (fd, F_GETFL); +#endif +} + +/* Return true if FD is open and inheritable across exec/spawn. */ +static bool +is_inheritable (int fd) +{ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* On native Windows, the initial state of unassigned standard file + descriptors is that they are open but point to an + INVALID_HANDLE_VALUE, and there is no fcntl. */ + HANDLE h = (HANDLE) _get_osfhandle (fd); + DWORD flags; + if (h == INVALID_HANDLE_VALUE || GetHandleInformation (h, &flags) == 0) + return false; + return (flags & HANDLE_FLAG_INHERIT) != 0; +#else +# ifndef F_GETFD +# error Please port fcntl to your platform +# endif + int i = fcntl (fd, F_GETFD); + return 0 <= i && (i & FD_CLOEXEC) == 0; +#endif +} + +/* Return non-zero if FD is open in the given MODE, which is either + O_TEXT or O_BINARY. */ +static bool +is_mode (int fd, int mode) +{ + int value = setmode (fd, O_BINARY); + setmode (fd, value); + return mode == value; +} + +/* Since native fcntl can have more supported operations than our + replacement is aware of, and since various operations assign + different types to the vararg argument, a wrapper around fcntl must + be able to pass a vararg of unknown type on through to the original + fcntl. Make sure that this works properly: func1 behaves like the + original fcntl interpreting the vararg as an int or a pointer to a + struct, and func2 behaves like rpl_fcntl that doesn't know what + type to forward. */ +struct dummy_struct +{ + long filler; + int value; +}; +static int +func1 (int a, ...) +{ + va_list arg; + int i; + va_start (arg, a); + if (a < 4) + i = va_arg (arg, int); + else + { + struct dummy_struct *s = va_arg (arg, struct dummy_struct *); + i = s->value; + } + va_end (arg); + return i; +} +static int +func2 (int a, ...) +{ + va_list arg; + void *p; + va_start (arg, a); + p = va_arg (arg, void *); + va_end (arg); + return func1 (a, p); +} + +/* Ensure that all supported fcntl actions are distinct, and + usable in preprocessor expressions. */ +static void +check_flags (void) +{ + switch (0) + { + case F_DUPFD: +#if F_DUPFD +#endif + + case F_DUPFD_CLOEXEC: +#if F_DUPFD_CLOEXEC +#endif + + case F_GETFD: +#if F_GETFD +#endif + +#ifdef F_SETFD + case F_SETFD: +# if F_SETFD +# endif +#endif + +#ifdef F_GETFL + case F_GETFL: +# if F_GETFL +# endif +#endif + +#ifdef F_SETFL + case F_SETFL: +# if F_SETFL +# endif +#endif + +#ifdef F_GETOWN + case F_GETOWN: +# if F_GETOWN +# endif +#endif + +#ifdef F_SETOWN + case F_SETOWN: +# if F_SETOWN +# endif +#endif + +#ifdef F_GETLK + case F_GETLK: +# if F_GETLK +# endif +#endif + +#ifdef F_SETLK + case F_SETLK: +# if F_SETLK +# endif +#endif + +#ifdef F_SETLKW + case F_SETLKW: +# if F_SETLKW +# endif +#endif + + ; + } +} + +int +main (void) +{ + const char *file = "test-fcntl.tmp"; + int fd; + int bad_fd = getdtablesize (); + + /* Sanity check that rpl_fcntl is likely to work. */ + ASSERT (func2 (1, 2) == 2); + ASSERT (func2 (2, -2) == -2); + ASSERT (func2 (3, 0x80000000) == 0x80000000); + { + struct dummy_struct s = { 0L, 4 }; + ASSERT (func2 (4, &s) == 4); + } + check_flags (); + + /* Assume std descriptors were provided by invoker, and ignore fds + that might have been inherited. */ + fd = creat (file, 0600); + ASSERT (STDERR_FILENO < fd); + close (fd + 1); + close (fd + 2); + + /* For F_DUPFD*, the source must be valid. */ + errno = 0; + ASSERT (fcntl (-1, F_DUPFD, 0) == -1); + ASSERT (errno == EBADF); + errno = 0; + ASSERT (fcntl (fd + 1, F_DUPFD, 0) == -1); + ASSERT (errno == EBADF); + errno = 0; + ASSERT (fcntl (bad_fd, F_DUPFD, 0) == -1); + ASSERT (errno == EBADF); + errno = 0; + ASSERT (fcntl (-1, F_DUPFD_CLOEXEC, 0) == -1); + ASSERT (errno == EBADF); + errno = 0; + ASSERT (fcntl (fd + 1, F_DUPFD_CLOEXEC, 0) == -1); + ASSERT (errno == EBADF); + errno = 0; + ASSERT (fcntl (bad_fd, F_DUPFD_CLOEXEC, 0) == -1); + ASSERT (errno == EBADF); + + /* For F_DUPFD*, the destination must be valid. */ + errno = 0; + ASSERT (fcntl (fd, F_DUPFD, -1) == -1); + ASSERT (errno == EINVAL); + errno = 0; + ASSERT (fcntl (fd, F_DUPFD, bad_fd) == -1); + ASSERT (errno == EINVAL); + errno = 0; + ASSERT (fcntl (fd, F_DUPFD_CLOEXEC, -1) == -1); + ASSERT (errno == EINVAL); + errno = 0; + ASSERT (fcntl (fd, F_DUPFD_CLOEXEC, bad_fd) == -1); + ASSERT (errno == EINVAL); + + /* For F_DUPFD*, check for correct inheritance, as well as + preservation of text vs. binary. */ + setmode (fd, O_BINARY); + ASSERT (is_open (fd)); + ASSERT (!is_open (fd + 1)); + ASSERT (!is_open (fd + 2)); + ASSERT (is_inheritable (fd)); + ASSERT (is_mode (fd, O_BINARY)); + + ASSERT (fcntl (fd, F_DUPFD, fd) == fd + 1); + ASSERT (is_open (fd)); + ASSERT (is_open (fd + 1)); + ASSERT (!is_open (fd + 2)); + ASSERT (is_inheritable (fd + 1)); + ASSERT (is_mode (fd, O_BINARY)); + ASSERT (is_mode (fd + 1, O_BINARY)); + ASSERT (close (fd + 1) == 0); + + ASSERT (fcntl (fd, F_DUPFD_CLOEXEC, fd + 2) == fd + 2); + ASSERT (is_open (fd)); + ASSERT (!is_open (fd + 1)); + ASSERT (is_open (fd + 2)); + ASSERT (is_inheritable (fd)); + ASSERT (!is_inheritable (fd + 2)); + ASSERT (is_mode (fd, O_BINARY)); + ASSERT (is_mode (fd + 2, O_BINARY)); + ASSERT (close (fd) == 0); + + setmode (fd + 2, O_TEXT); + ASSERT (fcntl (fd + 2, F_DUPFD, fd + 1) == fd + 1); + ASSERT (!is_open (fd)); + ASSERT (is_open (fd + 1)); + ASSERT (is_open (fd + 2)); + ASSERT (is_inheritable (fd + 1)); + ASSERT (!is_inheritable (fd + 2)); + ASSERT (is_mode (fd + 1, O_TEXT)); + ASSERT (is_mode (fd + 2, O_TEXT)); + ASSERT (close (fd + 1) == 0); + + ASSERT (fcntl (fd + 2, F_DUPFD_CLOEXEC, 0) == fd); + ASSERT (is_open (fd)); + ASSERT (!is_open (fd + 1)); + ASSERT (is_open (fd + 2)); + ASSERT (!is_inheritable (fd)); + ASSERT (!is_inheritable (fd + 2)); + ASSERT (is_mode (fd, O_TEXT)); + ASSERT (is_mode (fd + 2, O_TEXT)); + ASSERT (close (fd + 2) == 0); + + /* Test F_GETFD on invalid file descriptors. */ + errno = 0; + ASSERT (fcntl (-1, F_GETFD) == -1); + ASSERT (errno == EBADF); + errno = 0; + ASSERT (fcntl (fd + 1, F_GETFD) == -1); + ASSERT (errno == EBADF); + errno = 0; + ASSERT (fcntl (bad_fd, F_GETFD) == -1); + ASSERT (errno == EBADF); + + /* Test F_GETFD, the FD_CLOEXEC bit. */ + { + int result = fcntl (fd, F_GETFD); + ASSERT (0 <= result); + ASSERT ((result & FD_CLOEXEC) == FD_CLOEXEC); + ASSERT (dup (fd) == fd + 1); + result = fcntl (fd + 1, F_GETFD); + ASSERT (0 <= result); + ASSERT ((result & FD_CLOEXEC) == 0); + ASSERT (close (fd + 1) == 0); + } + +#ifdef F_SETFD + /* Test F_SETFD on invalid file descriptors. */ + errno = 0; + ASSERT (fcntl (-1, F_SETFD, 0) == -1); + ASSERT (errno == EBADF); + errno = 0; + ASSERT (fcntl (fd + 1, F_SETFD, 0) == -1); + ASSERT (errno == EBADF); + errno = 0; + ASSERT (fcntl (bad_fd, F_SETFD, 0) == -1); + ASSERT (errno == EBADF); +#endif + +#ifdef F_GETFL + /* Test F_GETFL on invalid file descriptors. */ + errno = 0; + ASSERT (fcntl (-1, F_GETFL) == -1); + ASSERT (errno == EBADF); + errno = 0; + ASSERT (fcntl (fd + 1, F_GETFL) == -1); + ASSERT (errno == EBADF); + errno = 0; + ASSERT (fcntl (bad_fd, F_GETFL) == -1); + ASSERT (errno == EBADF); +#endif + +#ifdef F_SETFL + /* Test F_SETFL on invalid file descriptors. */ + errno = 0; + ASSERT (fcntl (-1, F_SETFL, 0) == -1); + ASSERT (errno == EBADF); + errno = 0; + ASSERT (fcntl (fd + 1, F_SETFL, 0) == -1); + ASSERT (errno == EBADF); + errno = 0; + ASSERT (fcntl (bad_fd, F_SETFL, 0) == -1); + ASSERT (errno == EBADF); +#endif + +#ifdef F_GETOWN + /* Test F_GETOWN on invalid file descriptors. */ + errno = 0; + ASSERT (fcntl (-1, F_GETOWN) == -1); + ASSERT (errno == EBADF); + errno = 0; + ASSERT (fcntl (fd + 1, F_GETOWN) == -1); + ASSERT (errno == EBADF); + errno = 0; + ASSERT (fcntl (bad_fd, F_GETOWN) == -1); + ASSERT (errno == EBADF); +#endif + +#ifdef F_SETOWN + /* Test F_SETFL on invalid file descriptors. */ + errno = 0; + ASSERT (fcntl (-1, F_SETOWN, 0) == -1); + ASSERT (errno == EBADF); + errno = 0; + ASSERT (fcntl (fd + 1, F_SETOWN, 0) == -1); + ASSERT (errno == EBADF); + errno = 0; + ASSERT (fcntl (bad_fd, F_SETOWN, 0) == -1); + ASSERT (errno == EBADF); +#endif + + /* Cleanup. */ + ASSERT (close (fd) == 0); + ASSERT (unlink (file) == 0); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-fdopen.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-fdopen.c new file mode 100644 index 0000000000..c4ce344371 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-fdopen.c @@ -0,0 +1,49 @@ +/* Test opening a stream with a file descriptor. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <stdio.h> + +#include "signature.h" +SIGNATURE_CHECK (fdopen, FILE *, (int, const char *)); + +#include <errno.h> +#include <unistd.h> + +#include "macros.h" + +int +main (void) +{ + /* Test behavior on failure. POSIX makes it hard to check for + failure, since the behavior is not well-defined on invalid file + descriptors, so try fdopen 1000 times and if that's not enough to + fail due to EMFILE, so be it. */ + + int i; + for (i = 0; i < 1000; i++) + { + errno = 0; + if (! fdopen (STDOUT_FILENO, "w")) + { + ASSERT (errno != 0); + break; + } + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-fgetc.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-fgetc.c new file mode 100644 index 0000000000..17edf13759 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-fgetc.c @@ -0,0 +1,99 @@ +/* Test of fgetc() function. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <stdio.h> + +#include "signature.h" +SIGNATURE_CHECK (fgetc, int, (FILE *)); + +#include <errno.h> +#include <fcntl.h> +#include <unistd.h> + +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER +# include "msvc-inval.h" +#endif + +#include "macros.h" + +int +main (int argc, char **argv) +{ + const char *filename = "test-fgetc.txt"; + + /* We don't have an fgetc() function that installs an invalid parameter + handler so far. So install that handler here, explicitly. */ +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \ + && MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING + gl_msvc_inval_ensure_handler (); +#endif + + /* Prepare a file. */ + { + const char text[] = "hello world"; + int fd = open (filename, O_RDWR | O_CREAT | O_TRUNC, 0600); + ASSERT (fd >= 0); + ASSERT (write (fd, text, sizeof (text)) == sizeof (text)); + ASSERT (close (fd) == 0); + } + + /* Test that fgetc() sets errno if someone else closes the stream + fd behind the back of stdio. */ + { + FILE *fp = fopen (filename, "r"); + ASSERT (fp != NULL); + ASSERT (close (fileno (fp)) == 0); + errno = 0; + ASSERT (fgetc (fp) == EOF); + ASSERT (errno == EBADF); + ASSERT (ferror (fp)); + fclose (fp); + } + + /* Test that fgetc() sets errno if the stream was constructed with + an invalid file descriptor. */ + { + FILE *fp = fdopen (-1, "r"); + if (fp != NULL) + { + errno = 0; + ASSERT (fgetc (fp) == EOF); + ASSERT (errno == EBADF); + ASSERT (ferror (fp)); + fclose (fp); + } + } + { + FILE *fp; + close (99); + fp = fdopen (99, "r"); + if (fp != NULL) + { + errno = 0; + ASSERT (fgetc (fp) == EOF); + ASSERT (errno == EBADF); + ASSERT (ferror (fp)); + fclose (fp); + } + } + + /* Clean up. */ + unlink (filename); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-filenamecat.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-filenamecat.c new file mode 100644 index 0000000000..b4d65817ec --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-filenamecat.c @@ -0,0 +1,63 @@ +/* Test of concatenation of two arbitrary file names. + + Copyright (C) 1996-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Jim Meyering. */ + +#include <config.h> + +#include "filenamecat.h" + +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + + +int +main (int argc _GL_UNUSED, char *argv[]) +{ + static char const *const tests[][3] = + { + {"a", "b", "a/b"}, + {"a/", "b", "a/b"}, + {"a/", "/b", "a/b"}, + {"a", "/b", "a/b"}, + + {"/", "b", "/b"}, + {"/", "/b", "/b"}, + {"/", "/", "/"}, + {"a", "/", "a/"}, /* this might deserve a diagnostic */ + {"/a", "/", "/a/"}, /* this might deserve a diagnostic */ + {"a", "//b", "a/b"}, + {"", "a", "a"}, /* this might deserve a diagnostic */ + }; + unsigned int i; + bool fail = false; + + for (i = 0; i < sizeof tests / sizeof tests[0]; i++) + { + char *base_in_result; + char const *const *t = tests[i]; + char *res = file_name_concat (t[0], t[1], &base_in_result); + if (strcmp (res, t[2]) != 0) + { + fprintf (stderr, "test #%u: got %s, expected %s\n", i, res, t[2]); + fail = true; + } + } + exit (fail ? EXIT_FAILURE : EXIT_SUCCESS); +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-float.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-float.c new file mode 100644 index 0000000000..71df8458a2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-float.c @@ -0,0 +1,384 @@ +/* Test of <float.h> substitute. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2011. */ + +#include <config.h> + +#include <float.h> + +#include "fpucw.h" +#include "macros.h" + +/* Check that FLT_RADIX is a constant expression. */ +int a[] = { FLT_RADIX }; + +#if FLT_RADIX == 2 + +/* Return 2^n. */ +static float +pow2f (int n) +{ + int k = n; + volatile float x = 1; + volatile float y = 2; + /* Invariant: 2^n == x * y^k. */ + if (k < 0) + { + y = 0.5f; + k = - k; + } + while (k > 0) + { + if (k != 2 * (k / 2)) + { + x = x * y; + k = k - 1; + } + if (k == 0) + break; + y = y * y; + k = k / 2; + } + /* Now k == 0, hence x == 2^n. */ + return x; +} + +/* Return 2^n. */ +static double +pow2d (int n) +{ + int k = n; + volatile double x = 1; + volatile double y = 2; + /* Invariant: 2^n == x * y^k. */ + if (k < 0) + { + y = 0.5; + k = - k; + } + while (k > 0) + { + if (k != 2 * (k / 2)) + { + x = x * y; + k = k - 1; + } + if (k == 0) + break; + y = y * y; + k = k / 2; + } + /* Now k == 0, hence x == 2^n. */ + return x; +} + +/* Return 2^n. */ +static long double +pow2l (int n) +{ + int k = n; + volatile long double x = 1; + volatile long double y = 2; + /* Invariant: 2^n == x * y^k. */ + if (k < 0) + { + y = 0.5L; + k = - k; + } + while (k > 0) + { + if (k != 2 * (k / 2)) + { + x = x * y; + k = k - 1; + } + if (k == 0) + break; + y = y * y; + k = k / 2; + } + /* Now k == 0, hence x == 2^n. */ + return x; +} + +/* ----------------------- Check macros for 'float' ----------------------- */ + +/* Check that the FLT_* macros expand to constant expressions. */ +int fb[] = + { + FLT_MANT_DIG, FLT_MIN_EXP, FLT_MAX_EXP, + FLT_DIG, FLT_MIN_10_EXP, FLT_MAX_10_EXP + }; +float fc[] = { FLT_EPSILON, FLT_MIN, FLT_MAX }; + +static void +test_float (void) +{ + /* Check that the value of FLT_MIN_EXP is well parenthesized. */ + ASSERT ((FLT_MIN_EXP % 101111) == (FLT_MIN_EXP) % 101111); + + /* Check that the value of DBL_MIN_10_EXP is well parenthesized. */ + ASSERT ((FLT_MIN_10_EXP % 101111) == (FLT_MIN_10_EXP) % 101111); + + /* Check that 'float' is as specified in IEEE 754. */ + ASSERT (FLT_MANT_DIG == 24); + ASSERT (FLT_MIN_EXP == -125); + ASSERT (FLT_MAX_EXP == 128); + + /* Check the value of FLT_MIN_10_EXP. */ + ASSERT (FLT_MIN_10_EXP == - (int) (- (FLT_MIN_EXP - 1) * 0.30103)); + + /* Check the value of FLT_DIG. */ + ASSERT (FLT_DIG == (int) ((FLT_MANT_DIG - 1) * 0.30103)); + + /* Check the value of FLT_MIN_10_EXP. */ + ASSERT (FLT_MIN_10_EXP == - (int) (- (FLT_MIN_EXP - 1) * 0.30103)); + + /* Check the value of FLT_MAX_10_EXP. */ + ASSERT (FLT_MAX_10_EXP == (int) (FLT_MAX_EXP * 0.30103)); + + /* Check the value of FLT_MAX. */ + { + volatile float m = FLT_MAX; + int n; + + ASSERT (m + m > m); + for (n = 0; n <= 2 * FLT_MANT_DIG; n++) + { + volatile float pow2_n = pow2f (n); /* 2^n */ + volatile float x = m + (m / pow2_n); + if (x > m) + ASSERT (x + x == x); + else + ASSERT (!(x + x == x)); + } + } + + /* Check the value of FLT_MIN. */ + { + volatile float m = FLT_MIN; + volatile float x = pow2f (FLT_MIN_EXP - 1); + ASSERT (m == x); + } + + /* Check the value of FLT_EPSILON. */ + { + volatile float e = FLT_EPSILON; + volatile float me; + int n; + + me = 1.0f + e; + ASSERT (me > 1.0f); + ASSERT (me - 1.0f == e); + for (n = 0; n <= 2 * FLT_MANT_DIG; n++) + { + volatile float half_n = pow2f (- n); /* 2^-n */ + volatile float x = me - half_n; + if (x < me) + ASSERT (x <= 1.0f); + } + } +} + +/* ----------------------- Check macros for 'double' ----------------------- */ + +/* Check that the DBL_* macros expand to constant expressions. */ +int db[] = + { + DBL_MANT_DIG, DBL_MIN_EXP, DBL_MAX_EXP, + DBL_DIG, DBL_MIN_10_EXP, DBL_MAX_10_EXP + }; +double dc[] = { DBL_EPSILON, DBL_MIN, DBL_MAX }; + +static void +test_double (void) +{ + /* Check that the value of DBL_MIN_EXP is well parenthesized. */ + ASSERT ((DBL_MIN_EXP % 101111) == (DBL_MIN_EXP) % 101111); + + /* Check that the value of DBL_MIN_10_EXP is well parenthesized. */ + ASSERT ((DBL_MIN_10_EXP % 101111) == (DBL_MIN_10_EXP) % 101111); + + /* Check that 'double' is as specified in IEEE 754. */ + ASSERT (DBL_MANT_DIG == 53); + ASSERT (DBL_MIN_EXP == -1021); + ASSERT (DBL_MAX_EXP == 1024); + + /* Check the value of DBL_MIN_10_EXP. */ + ASSERT (DBL_MIN_10_EXP == - (int) (- (DBL_MIN_EXP - 1) * 0.30103)); + + /* Check the value of DBL_DIG. */ + ASSERT (DBL_DIG == (int) ((DBL_MANT_DIG - 1) * 0.30103)); + + /* Check the value of DBL_MIN_10_EXP. */ + ASSERT (DBL_MIN_10_EXP == - (int) (- (DBL_MIN_EXP - 1) * 0.30103)); + + /* Check the value of DBL_MAX_10_EXP. */ + ASSERT (DBL_MAX_10_EXP == (int) (DBL_MAX_EXP * 0.30103)); + + /* Check the value of DBL_MAX. */ + { + volatile double m = DBL_MAX; + int n; + + ASSERT (m + m > m); + for (n = 0; n <= 2 * DBL_MANT_DIG; n++) + { + volatile double pow2_n = pow2d (n); /* 2^n */ + volatile double x = m + (m / pow2_n); + if (x > m) + ASSERT (x + x == x); + else + ASSERT (!(x + x == x)); + } + } + + /* Check the value of DBL_MIN. */ + { + volatile double m = DBL_MIN; + volatile double x = pow2d (DBL_MIN_EXP - 1); + ASSERT (m == x); + } + + /* Check the value of DBL_EPSILON. */ + { + volatile double e = DBL_EPSILON; + volatile double me; + int n; + + me = 1.0 + e; + ASSERT (me > 1.0); + ASSERT (me - 1.0 == e); + for (n = 0; n <= 2 * DBL_MANT_DIG; n++) + { + volatile double half_n = pow2d (- n); /* 2^-n */ + volatile double x = me - half_n; + if (x < me) + ASSERT (x <= 1.0); + } + } +} + +/* -------------------- Check macros for 'long double' -------------------- */ + +/* Check that the LDBL_* macros expand to constant expressions. */ +int lb[] = + { + LDBL_MANT_DIG, LDBL_MIN_EXP, LDBL_MAX_EXP, + LDBL_DIG, LDBL_MIN_10_EXP, LDBL_MAX_10_EXP + }; +long double lc1 = LDBL_EPSILON; +long double lc2 = LDBL_MIN; +#if 0 /* LDBL_MAX is not a constant expression on some platforms. */ +long double lc3 = LDBL_MAX; +#endif + +static void +test_long_double (void) +{ + /* Check that the value of LDBL_MIN_EXP is well parenthesized. */ + ASSERT ((LDBL_MIN_EXP % 101111) == (LDBL_MIN_EXP) % 101111); + + /* Check that the value of LDBL_MIN_10_EXP is well parenthesized. */ + ASSERT ((LDBL_MIN_10_EXP % 101111) == (LDBL_MIN_10_EXP) % 101111); + + /* Check that 'long double' is at least as wide as 'double'. */ + ASSERT (LDBL_MANT_DIG >= DBL_MANT_DIG); + ASSERT (LDBL_MIN_EXP - LDBL_MANT_DIG <= DBL_MIN_EXP - DBL_MANT_DIG); + ASSERT (LDBL_MAX_EXP >= DBL_MAX_EXP); + + /* Check the value of LDBL_DIG. */ + ASSERT (LDBL_DIG == (int)((LDBL_MANT_DIG - 1) * 0.30103)); + + /* Check the value of LDBL_MIN_10_EXP. */ + ASSERT (LDBL_MIN_10_EXP == - (int) (- (LDBL_MIN_EXP - 1) * 0.30103)); + + /* Check the value of LDBL_MAX_10_EXP. */ + ASSERT (LDBL_MAX_10_EXP == (int) (LDBL_MAX_EXP * 0.30103)); + + /* Check the value of LDBL_MAX. */ + { + volatile long double m = LDBL_MAX; + int n; + + ASSERT (m + m > m); + for (n = 0; n <= 2 * LDBL_MANT_DIG; n++) + { + volatile long double pow2_n = pow2l (n); /* 2^n */ + volatile long double x = m + (m / pow2_n); + if (x > m) + ASSERT (x + x == x); + else + ASSERT (!(x + x == x)); + } + } + + /* Check the value of LDBL_MIN. */ + { + volatile long double m = LDBL_MIN; + volatile long double x = pow2l (LDBL_MIN_EXP - 1); + ASSERT (m == x); + } + + /* Check the value of LDBL_EPSILON. */ + { + volatile long double e = LDBL_EPSILON; + volatile long double me; + int n; + + me = 1.0L + e; + ASSERT (me > 1.0L); + ASSERT (me - 1.0L == e); + for (n = 0; n <= 2 * LDBL_MANT_DIG; n++) + { + volatile long double half_n = pow2l (- n); /* 2^-n */ + volatile long double x = me - half_n; + if (x < me) + ASSERT (x <= 1.0L); + } + } +} + +int +main () +{ + test_float (); + test_double (); + + { + DECL_LONG_DOUBLE_ROUNDING + + BEGIN_LONG_DOUBLE_ROUNDING (); + + test_long_double (); + + END_LONG_DOUBLE_ROUNDING (); + } + + return 0; +} + +#else + +int +main () +{ + fprintf (stderr, "Skipping test: FLT_RADIX is not 2.\n"); + return 77; +} + +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-fnmatch.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-fnmatch.c new file mode 100644 index 0000000000..e5eb3e9766 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-fnmatch.c @@ -0,0 +1,56 @@ +/* Test of fnmatch string matching function. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Simon Josefsson <simon@josefsson.org>, 2009. */ + +#include <config.h> + +#include <fnmatch.h> + +#include "signature.h" +SIGNATURE_CHECK (fnmatch, int, (char const *, char const *, int)); + +#include "macros.h" + +int +main () +{ + int res; + + ASSERT (res = fnmatch ("", "", 0) == 0); + + ASSERT (res = fnmatch ("*", "", 0) == 0); + ASSERT (res = fnmatch ("*", "foo", 0) == 0); + ASSERT (res = fnmatch ("*", "bar", 0) == 0); + ASSERT (res = fnmatch ("*", "*", 0) == 0); + ASSERT (res = fnmatch ("**", "f", 0) == 0); + ASSERT (res = fnmatch ("**", "foo.txt", 0) == 0); + ASSERT (res = fnmatch ("*.*", "foo.txt", 0) == 0); + + ASSERT (res = fnmatch ("foo*.txt", "foobar.txt", 0) == 0); + + ASSERT (res = fnmatch ("foo.txt", "foo.txt", 0) == 0); + ASSERT (res = fnmatch ("foo\\.txt", "foo.txt", 0) == 0); + ASSERT (res = fnmatch ("foo\\.txt", "foo.txt", FNM_NOESCAPE) == FNM_NOMATCH); + + /* Verify that an unmatched [ is treated as a literal, as POSIX + requires. This test ensures that glibc Bugzilla bug #12378 stays + fixed. + */ + ASSERT (res = fnmatch ("[/b", "[/b", 0) == 0); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-fputc.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-fputc.c new file mode 100644 index 0000000000..448e5f2989 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-fputc.c @@ -0,0 +1,93 @@ +/* Test of fputc() function. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <stdio.h> + +#include "signature.h" +SIGNATURE_CHECK (fputc, int, (int, FILE *)); + +#include <errno.h> +#include <fcntl.h> +#include <unistd.h> + +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER +# include "msvc-inval.h" +#endif + +#include "macros.h" + +int +main (int argc, char **argv) +{ + const char *filename = "test-fputc.txt"; + + /* We don't have an fputc() function that installs an invalid parameter + handler so far. So install that handler here, explicitly. */ +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \ + && MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING + gl_msvc_inval_ensure_handler (); +#endif + + /* Test that fputc() on an unbuffered stream sets errno if someone else + closes the stream fd behind the back of stdio. */ + { + FILE *fp = fopen (filename, "w"); + ASSERT (fp != NULL); + setvbuf (fp, NULL, _IONBF, 0); + ASSERT (close (fileno (fp)) == 0); + errno = 0; + ASSERT (fputc ('x', fp) == EOF); + ASSERT (errno == EBADF); + ASSERT (ferror (fp)); + fclose (fp); + } + + /* Test that fputc() on an unbuffered stream sets errno if the stream + was constructed with an invalid file descriptor. */ + { + FILE *fp = fdopen (-1, "w"); + if (fp != NULL) + { + setvbuf (fp, NULL, _IONBF, 0); + errno = 0; + ASSERT (fputc ('x', fp) == EOF); + ASSERT (errno == EBADF); + ASSERT (ferror (fp)); + fclose (fp); + } + } + { + FILE *fp; + close (99); + fp = fdopen (99, "w"); + if (fp != NULL) + { + setvbuf (fp, NULL, _IONBF, 0); + errno = 0; + ASSERT (fputc ('x', fp) == EOF); + ASSERT (errno == EBADF); + ASSERT (ferror (fp)); + fclose (fp); + } + } + + /* Clean up. */ + unlink (filename); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-fread.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-fread.c new file mode 100644 index 0000000000..751774daa6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-fread.c @@ -0,0 +1,102 @@ +/* Test of fread() function. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <stdio.h> + +#include "signature.h" +SIGNATURE_CHECK (fread, size_t, (void *, size_t, size_t, FILE *)); + +#include <errno.h> +#include <fcntl.h> +#include <unistd.h> + +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER +# include "msvc-inval.h" +#endif + +#include "macros.h" + +int +main (int argc, char **argv) +{ + const char *filename = "test-fread.txt"; + + /* We don't have an fread() function that installs an invalid parameter + handler so far. So install that handler here, explicitly. */ +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \ + && MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING + gl_msvc_inval_ensure_handler (); +#endif + + /* Prepare a file. */ + { + const char text[] = "hello world"; + int fd = open (filename, O_RDWR | O_CREAT | O_TRUNC, 0600); + ASSERT (fd >= 0); + ASSERT (write (fd, text, sizeof (text)) == sizeof (text)); + ASSERT (close (fd) == 0); + } + + /* Test that fread() sets errno if someone else closes the stream + fd behind the back of stdio. */ + { + FILE *fp = fopen (filename, "r"); + char buf[5]; + ASSERT (fp != NULL); + ASSERT (close (fileno (fp)) == 0); + errno = 0; + ASSERT (fread (buf, 1, sizeof (buf), fp) == 0); + ASSERT (errno == EBADF); + ASSERT (ferror (fp)); + fclose (fp); + } + + /* Test that fread() sets errno if the stream was constructed with + an invalid file descriptor. */ + { + FILE *fp = fdopen (-1, "r"); + if (fp != NULL) + { + char buf[1]; + errno = 0; + ASSERT (fread (buf, 1, 1, fp) == 0); + ASSERT (errno == EBADF); + ASSERT (ferror (fp)); + fclose (fp); + } + } + { + FILE *fp; + close (99); + fp = fdopen (99, "r"); + if (fp != NULL) + { + char buf[1]; + errno = 0; + ASSERT (fread (buf, 1, 1, fp) == 0); + ASSERT (errno == EBADF); + ASSERT (ferror (fp)); + fclose (fp); + } + } + + /* Clean up. */ + unlink (filename); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-freopen-safer.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-freopen-safer.c new file mode 100644 index 0000000000..5e46e91330 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-freopen-safer.c @@ -0,0 +1,97 @@ +/* Test of reopening a stream. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +#include <config.h> + +/* Specification. */ +#include "stdio--.h" + +/* Helpers. */ +#include <unistd.h> + +/* This test intentionally closes stderr. So, we arrange to have fd 10 + (outside the range of interesting fd's during the test) set up to + duplicate the original stderr. */ + +#define BACKUP_STDERR_FILENO 10 +#define ASSERT_STREAM myerr +#include "macros.h" + +static FILE *myerr; + +int +main (void) +{ + FILE *fp; + + /* We close fd 2 later, so save it in fd 10. */ + if (dup2 (STDERR_FILENO, BACKUP_STDERR_FILENO) != BACKUP_STDERR_FILENO + || (myerr = fdopen (BACKUP_STDERR_FILENO, "w")) == NULL) + return 2; + + { + FILE *tmp; + ASSERT (tmp = fopen ("/dev/null", "r")); + ASSERT (STDERR_FILENO < fileno (tmp)); + ASSERT (fp = fopen ("/dev/null", "w")); + ASSERT (fileno (tmp) < fileno (fp)); + ASSERT (fclose (tmp) == 0); + } + + /* Gap in fds. */ + ASSERT (freopen ("/dev/null", "r+", fp) == fp); + ASSERT (STDERR_FILENO < fileno (fp)); + + ASSERT (freopen ("/dev/null", "r", stdin) == stdin); + ASSERT (STDIN_FILENO == fileno (stdin)); + + ASSERT (freopen ("/dev/null", "w", stdout) == stdout); + ASSERT (STDOUT_FILENO == fileno (stdout)); + + ASSERT (freopen ("/dev/null", "w", stderr) == stderr); + ASSERT (STDERR_FILENO == fileno (stderr)); + + /* fd 0 closed. */ + ASSERT (close (STDIN_FILENO) == 0); + + ASSERT (freopen ("/dev/null", "w", stdout) == stdout); + ASSERT (STDOUT_FILENO == fileno (stdout)); + + ASSERT (freopen ("/dev/null", "w", stderr) == stderr); + ASSERT (STDERR_FILENO == fileno (stderr)); + + ASSERT (freopen ("/dev/null", "a", fp) == fp); + ASSERT (STDERR_FILENO < fileno (fp)); + + /* fd 1 closed. */ + ASSERT (close (STDOUT_FILENO) == 0); + + ASSERT (freopen ("/dev/null", "w", stderr) == stderr); + ASSERT (STDERR_FILENO == fileno (stderr)); + + ASSERT (freopen ("/dev/null", "a+", fp) == fp); + ASSERT (STDERR_FILENO < fileno (fp)); + + /* fd 2 closed. */ + ASSERT (close (STDERR_FILENO) == 0); + + ASSERT (freopen ("/dev/null", "w+", fp) == fp); + ASSERT (STDERR_FILENO < fileno (fp)); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-freopen.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-freopen.c new file mode 100644 index 0000000000..717502e689 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-freopen.c @@ -0,0 +1,86 @@ +/* Test of opening a file stream. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <stdio.h> + +#include "signature.h" +SIGNATURE_CHECK (freopen, FILE *, (char const *, char const *, FILE *)); + +#include <errno.h> +#include <unistd.h> + +#include "macros.h" + +int +main () +{ + const char *filename = "test-freopen.txt"; + + close (STDIN_FILENO); + ASSERT (freopen ("/dev/null", "r", stdin) != NULL); + ASSERT (getchar () == EOF); + ASSERT (!ferror (stdin)); + ASSERT (feof (stdin)); + +#if 0 /* freopen (NULL, ...) is unsupported on most platforms. */ + /* Test that freopen() sets errno if someone else closes the stream + fd behind the back of stdio. */ + { + FILE *fp = fopen (filename, "w+"); + ASSERT (fp != NULL); + ASSERT (close (fileno (fp)) == 0); + errno = 0; + ASSERT (freopen (NULL, "r", fp) == NULL); + perror("freopen"); + ASSERT (errno == EBADF); + fclose (fp); + } + + /* Test that freopen() sets errno if the stream was constructed with + an invalid file descriptor. */ + { + FILE *fp = fdopen (-1, "w+"); + if (fp != NULL) + { + errno = 0; + ASSERT (freopen (NULL, "r", fp) == NULL); + ASSERT (errno == EBADF); + fclose (fp); + } + } + { + FILE *fp; + close (99); + fp = fdopen (99, "w+"); + if (fp != NULL) + { + errno = 0; + ASSERT (freopen (NULL, "r", fp) == NULL); + ASSERT (errno == EBADF); + fclose (fp); + } + } +#endif + + /* Clean up. */ + unlink (filename); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-fstat.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-fstat.c new file mode 100644 index 0000000000..35479facea --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-fstat.c @@ -0,0 +1,50 @@ +/* Tests of fstat() function. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <sys/stat.h> + +#include "signature.h" +SIGNATURE_CHECK (fstat, int, (int, struct stat *)); + +#include <errno.h> +#include <unistd.h> + +#include "macros.h" + +int +main (int argc, char *argv[]) +{ + /* Test behaviour for invalid file descriptors. */ + { + struct stat statbuf; + + errno = 0; + ASSERT (fstat (-1, &statbuf) == -1); + ASSERT (errno == EBADF); + } + { + struct stat statbuf; + + close (99); + errno = 0; + ASSERT (fstat (99, &statbuf) == -1); + ASSERT (errno == EBADF); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-ftruncate.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-ftruncate.c new file mode 100644 index 0000000000..47b6070b1b --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-ftruncate.c @@ -0,0 +1,60 @@ +/* Test truncating a file. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <unistd.h> + +#include "signature.h" +SIGNATURE_CHECK (ftruncate, int, (int, off_t)); + +#include <errno.h> +#include <fcntl.h> + +#include "macros.h" + +int +main (int argc, char *argv[]) +{ + const char *filename = argv[1]; + + /* Test behaviour for invalid file descriptors. */ + { + errno = 0; + ASSERT (ftruncate (-1, 0) == -1); + ASSERT (errno == EBADF); + } + { + close (99); + errno = 0; + ASSERT (ftruncate (99, 0) == -1); + ASSERT (errno == EBADF); + } + + /* Test behaviour for read-only file descriptors. */ + { + int fd = open (filename, O_RDONLY); + ASSERT (fd >= 0); + errno = 0; + ASSERT (ftruncate (fd, 0) == -1); + ASSERT (errno == EBADF || errno == EINVAL + || errno == EACCES /* seen on mingw */ + ); + close (fd); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-ftruncate.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-ftruncate.sh new file mode 100755 index 0000000000..d7394d2bfe --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-ftruncate.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec ./test-ftruncate${EXEEXT} "$srcdir/test-ftruncate.sh" diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-fwrite.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-fwrite.c new file mode 100644 index 0000000000..0dfb15b895 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-fwrite.c @@ -0,0 +1,96 @@ +/* Test of fwrite() function. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <stdio.h> + +#include "signature.h" +SIGNATURE_CHECK (fwrite, size_t, (const void *, size_t, size_t, FILE *)); + +#include <errno.h> +#include <fcntl.h> +#include <unistd.h> + +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER +# include "msvc-inval.h" +#endif + +#include "macros.h" + +int +main (int argc, char **argv) +{ + const char *filename = "test-fwrite.txt"; + + /* We don't have an fwrite() function that installs an invalid parameter + handler so far. So install that handler here, explicitly. */ +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \ + && MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING + gl_msvc_inval_ensure_handler (); +#endif + + /* Test that fwrite() on an unbuffered stream sets errno if someone else + closes the stream fd behind the back of stdio. */ + { + FILE *fp = fopen (filename, "w"); + char buf[5] = "world"; + ASSERT (fp != NULL); + setvbuf (fp, NULL, _IONBF, 0); + ASSERT (close (fileno (fp)) == 0); + errno = 0; + ASSERT (fwrite (buf, 1, sizeof (buf), fp) == 0); + ASSERT (errno == EBADF); + ASSERT (ferror (fp)); + fclose (fp); + } + + /* Test that fwrite() on an unbuffered stream sets errno if the stream + was constructed with an invalid file descriptor. */ + { + FILE *fp = fdopen (-1, "w"); + if (fp != NULL) + { + char buf[5] = "world"; + setvbuf (fp, NULL, _IONBF, 0); + errno = 0; + ASSERT (fwrite (buf, 1, sizeof (buf), fp) == 0); + ASSERT (errno == EBADF); + ASSERT (ferror (fp)); + fclose (fp); + } + } + { + FILE *fp; + close (99); + fp = fdopen (99, "w"); + if (fp != NULL) + { + char buf[5] = "world"; + setvbuf (fp, NULL, _IONBF, 0); + errno = 0; + ASSERT (fwrite (buf, 1, sizeof (buf), fp) == 0); + ASSERT (errno == EBADF); + ASSERT (ferror (fp)); + fclose (fp); + } + } + + /* Clean up. */ + unlink (filename); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-getcwd-lgpl.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-getcwd-lgpl.c new file mode 100644 index 0000000000..7c0688c59a --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-getcwd-lgpl.c @@ -0,0 +1,102 @@ +/* Test of getcwd() function. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <unistd.h> + +#include "signature.h" +SIGNATURE_CHECK (getcwd, char *, (char *, size_t)); + +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "macros.h" + +int +main (int argc, char **argv) +{ + char *pwd1; + char *pwd2; + /* If the user provides an argument, attempt to chdir there first. */ + if (1 < argc) + { + if (chdir (argv[1]) == 0) + printf ("changed to directory %s\n", argv[1]); + } + + pwd1 = getcwd (NULL, 0); + ASSERT (pwd1 && *pwd1); + if (1 < argc) + printf ("cwd=%s\n", pwd1); + + /* Make sure the result is usable. */ + ASSERT (chdir (pwd1) == 0); + ASSERT (chdir (".//./.") == 0); + + /* Make sure that result is normalized. */ + pwd2 = getcwd (NULL, 0); + ASSERT (pwd2); + ASSERT (strcmp (pwd1, pwd2) == 0); + free (pwd2); + { + size_t len = strlen (pwd1); + ssize_t i = len - 10; + if (i < 1) + i = 1; + pwd2 = getcwd (NULL, len + 1); + ASSERT (pwd2); + free (pwd2); + pwd2 = malloc (len + 2); + for ( ; i <= len; i++) + { + char *tmp; + errno = 0; + ASSERT (getcwd (pwd2, i) == NULL); + ASSERT (errno == ERANGE); + /* Allow either glibc or BSD behavior, since POSIX allows both. */ + errno = 0; + tmp = getcwd (NULL, i); + if (tmp) + { + ASSERT (strcmp (pwd1, tmp) == 0); + free (tmp); + } + else + { + ASSERT (errno == ERANGE); + } + } + ASSERT (getcwd (pwd2, len + 1) == pwd2); + pwd2[len] = '/'; + pwd2[len + 1] = '\0'; + } + ASSERT (strstr (pwd2, "/./") == NULL); + ASSERT (strstr (pwd2, "/../") == NULL); + ASSERT (strstr (pwd2 + 1 + (pwd2[1] == '/'), "//") == NULL); + + /* Validate a POSIX requirement on size. */ + errno = 0; + ASSERT (getcwd(pwd2, 0) == NULL); + ASSERT (errno == EINVAL); + + free (pwd1); + free (pwd2); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-getdtablesize.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-getdtablesize.c new file mode 100644 index 0000000000..885010f36c --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-getdtablesize.c @@ -0,0 +1,36 @@ +/* Test of getdtablesize() function. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <unistd.h> + +#include "signature.h" +SIGNATURE_CHECK (getdtablesize, int, (void)); + +#include "macros.h" + +int +main (int argc, char *argv[]) +{ + ASSERT (getdtablesize () >= 3); + ASSERT (dup2 (0, getdtablesize() - 1) == getdtablesize () - 1); + ASSERT (dup2 (0, getdtablesize()) == -1); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-getopt-gnu.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-getopt-gnu.c new file mode 100644 index 0000000000..c26e7f1a49 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-getopt-gnu.c @@ -0,0 +1,45 @@ +/* Test of command line argument processing. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2009. */ + +#include <config.h> + +/* None of the files accessed by this test are large, so disable the + ftell link warning if we are not using the gnulib ftell module. */ +#define _GL_NO_LARGE_FILES + +/* POSIX and glibc provide the getopt() function in <unistd.h>, see + http://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html + https://www.gnu.org/software/libc/manual/html_node/Using-Getopt.html + But gnulib provides the getopt() function in <getopt.h>, not in <unistd.h>. + This is what we are testing here. */ +#include <getopt.h> + +#ifndef __getopt_argv_const +# define __getopt_argv_const const +#endif +#include "signature.h" +SIGNATURE_CHECK (getopt_long, int, (int, char *__getopt_argv_const *, + char const *, struct option const *, + int *)); +SIGNATURE_CHECK (getopt_long_only, int, (int, char *__getopt_argv_const *, + char const *, struct option const *, + int *)); + +#define TEST_GETOPT_GNU 1 +#define TEST_GETOPT_TMP_NAME "test-getopt-gnu.tmp" +#include "test-getopt-main.h" diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-getopt-main.h b/local/recipes/tools/diffutils/source/gnulib-tests/test-getopt-main.h new file mode 100644 index 0000000000..4e3cd2d737 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-getopt-main.h @@ -0,0 +1,76 @@ +/* Test of command line argument processing. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2009. */ + +#include "signature.h" +SIGNATURE_CHECK (getopt, int, (int, char * const[], char const *)); + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +/* This test intentionally remaps stderr. So, we arrange to have fd 10 + (outside the range of interesting fd's during the test) set up to + duplicate the original stderr. */ + +#define BACKUP_STDERR_FILENO 10 +#define ASSERT_STREAM myerr +#include "macros.h" + +static FILE *myerr; + +#include "test-getopt.h" +#if TEST_GETOPT_GNU +# include "test-getopt_long.h" +#endif + +int +main (void) +{ + /* This test validates that stderr is used correctly, so move the + original into fd 10. */ + if (dup2 (STDERR_FILENO, BACKUP_STDERR_FILENO) != BACKUP_STDERR_FILENO + || (myerr = fdopen (BACKUP_STDERR_FILENO, "w")) == NULL) + return 2; + + ASSERT (freopen (TEST_GETOPT_TMP_NAME, "w", stderr) == stderr); + + /* These default values are required by POSIX. */ + ASSERT (optind == 1); + ASSERT (opterr != 0); + + setenv ("POSIXLY_CORRECT", "1", 1); + test_getopt (); + +#if TEST_GETOPT_GNU + test_getopt_long_posix (); +#endif + + unsetenv ("POSIXLY_CORRECT"); + test_getopt (); + +#if TEST_GETOPT_GNU + test_getopt_long (); + test_getopt_long_only (); +#endif + + ASSERT (fclose (stderr) == 0); + ASSERT (remove (TEST_GETOPT_TMP_NAME) == 0); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-getopt-posix.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-getopt-posix.c new file mode 100644 index 0000000000..216912de6d --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-getopt-posix.c @@ -0,0 +1,34 @@ +/* Test of command line argument processing. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2009. */ + +#include <config.h> + +/* None of the files accessed by this test are large, so disable the + ftell link warning if we are not using the gnulib ftell module. */ +#define _GL_NO_LARGE_FILES + +/* POSIX and glibc provide the getopt() function in <unistd.h>, see + http://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html + https://www.gnu.org/software/libc/manual/html_node/Using-Getopt.html + But gnulib provides the getopt() function in <getopt.h>, not in <unistd.h>. + Nevertheless the getopt() function should also be found in <unistd.h>. */ +#include <unistd.h> + +#define TEST_GETOPT_GNU 0 +#define TEST_GETOPT_TMP_NAME "test-getopt-posix.tmp" +#include "test-getopt-main.h" diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-getopt.h b/local/recipes/tools/diffutils/source/gnulib-tests/test-getopt.h new file mode 100644 index 0000000000..5c0e5b5aa3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-getopt.h @@ -0,0 +1,1392 @@ +/* Test of command line argument processing. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2009. */ + +#include <stdbool.h> +#include "macros.h" + +/* The glibc/gnulib implementation of getopt supports setting optind = + 0, but not all other implementations do. This matters for getopt. + But for getopt_long, we require GNU compatibility. */ +#if defined __GETOPT_PREFIX || (__GLIBC__ >= 2 && !defined __UCLIBC__) +# define OPTIND_MIN 0 +#elif HAVE_DECL_OPTRESET +# define OPTIND_MIN (optreset = 1) +#else +# define OPTIND_MIN 1 +#endif + +static void +getopt_loop (int argc, const char **argv, + const char *options, + int *a_seen, int *b_seen, + const char **p_value, const char **q_value, + int *non_options_count, const char **non_options, + int *unrecognized, bool *message_issued) +{ + int c; + int pos = ftell (stderr); + + while ((c = getopt (argc, (char **) argv, options)) != -1) + { + switch (c) + { + case 'a': + (*a_seen)++; + break; + case 'b': + (*b_seen)++; + break; + case 'p': + *p_value = optarg; + break; + case 'q': + *q_value = optarg; + break; + case '\1': + /* Must only happen with option '-' at the beginning. */ + ASSERT (options[0] == '-'); + non_options[(*non_options_count)++] = optarg; + break; + case ':': + /* Must only happen with option ':' at the beginning. */ + ASSERT (options[0] == ':' + || ((options[0] == '-' || options[0] == '+') + && options[1] == ':')); + FALLTHROUGH; + case '?': + *unrecognized = optopt; + break; + default: + *unrecognized = c; + break; + } + } + + *message_issued = pos < ftell (stderr); +} + +static void +test_getopt (void) +{ + int start; + bool posixly = !!getenv ("POSIXLY_CORRECT"); + /* See comment in getopt.c: + glibc gets a LSB-compliant getopt. + Standalone applications get a POSIX-compliant getopt. */ +#if defined __GETOPT_PREFIX || !(__GLIBC__ >= 2 || defined __MINGW32__) + /* Using getopt from gnulib or from a non-glibc system. */ + posixly = true; +#endif + + /* Test processing of boolean options. */ + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-a"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "ab", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + ASSERT (!output); + } + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-b"; + argv[argc++] = "-a"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "ab", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 1); + ASSERT (b_seen == 1); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 3); + ASSERT (!output); + } + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-ba"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "ab", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 1); + ASSERT (b_seen == 1); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + ASSERT (!output); + } + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-ab"; + argv[argc++] = "-a"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "ab", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 2); + ASSERT (b_seen == 1); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 3); + ASSERT (!output); + } + + /* Test processing of options with arguments. */ + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-pfoo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "p:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + ASSERT (!output); + } + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-p"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "p:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 3); + ASSERT (!output); + } + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-ab"; + argv[argc++] = "-q"; + argv[argc++] = "baz"; + argv[argc++] = "-pfoo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 1); + ASSERT (b_seen == 1); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value != NULL && strcmp (q_value, "baz") == 0); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 5); + ASSERT (!output); + } + +#if GNULIB_TEST_GETOPT_GNU + /* Test processing of options with optional arguments. */ + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-pfoo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "p::q::", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + ASSERT (!output); + } + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-p"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "p::q::", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + ASSERT (!output); + } + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-p"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "abp::q::", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 3); + ASSERT (!output); + } +#endif /* GNULIB_TEST_GETOPT_GNU */ + + /* Check that invalid options are recognized; and that both opterr + and leading ':' can silence output. */ + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-p"; + argv[argc++] = "foo"; + argv[argc++] = "-x"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 42; + getopt_loop (argc, argv, "abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 'x'); + ASSERT (optind == 5); + ASSERT (output); + } + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-p"; + argv[argc++] = "foo"; + argv[argc++] = "-x"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 0; + getopt_loop (argc, argv, "abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 'x'); + ASSERT (optind == 5); + ASSERT (!output); + } + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-p"; + argv[argc++] = "foo"; + argv[argc++] = "-x"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, ":abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 'x'); + ASSERT (optind == 5); + ASSERT (!output); + } + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-p"; + argv[argc++] = "foo"; + argv[argc++] = "-:"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 42; + getopt_loop (argc, argv, "abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == ':'); + ASSERT (optind == 5); + ASSERT (output); + } + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-p"; + argv[argc++] = "foo"; + argv[argc++] = "-:"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 0; + getopt_loop (argc, argv, "abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == ':'); + ASSERT (optind == 5); + ASSERT (!output); + } + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-p"; + argv[argc++] = "foo"; + argv[argc++] = "-:"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, ":abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == ':'); + ASSERT (optind == 5); + ASSERT (!output); + } + + /* Check for missing argument behavior. */ + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-ap"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 'p'); + ASSERT (optind == 2); + ASSERT (output); + } + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-ap"; + argv[argc] = NULL; + optind = start; + opterr = 0; + getopt_loop (argc, argv, "abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 'p'); + ASSERT (optind == 2); + ASSERT (!output); + } + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-ap"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, ":abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 'p'); + ASSERT (optind == 2); + ASSERT (!output); + } + + /* Check that by default, non-options arguments are moved to the end. */ + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "donald"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc++] = "duck"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + if (posixly) + { + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "donald") == 0); + ASSERT (strcmp (argv[2], "-p") == 0); + ASSERT (strcmp (argv[3], "billy") == 0); + ASSERT (strcmp (argv[4], "duck") == 0); + ASSERT (strcmp (argv[5], "-a") == 0); + ASSERT (strcmp (argv[6], "bar") == 0); + ASSERT (argv[7] == NULL); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 1); + ASSERT (!output); + } + else + { + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "-p") == 0); + ASSERT (strcmp (argv[2], "billy") == 0); + ASSERT (strcmp (argv[3], "-a") == 0); + ASSERT (strcmp (argv[4], "donald") == 0); + ASSERT (strcmp (argv[5], "duck") == 0); + ASSERT (strcmp (argv[6], "bar") == 0); + ASSERT (argv[7] == NULL); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 4); + ASSERT (!output); + } + } + + /* Check that '--' ends the argument processing. */ + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[20]; + + argv[argc++] = "program"; + argv[argc++] = "donald"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc++] = "duck"; + argv[argc++] = "-a"; + argv[argc++] = "--"; + argv[argc++] = "-b"; + argv[argc++] = "foo"; + argv[argc++] = "-q"; + argv[argc++] = "johnny"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + if (posixly) + { + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "donald") == 0); + ASSERT (strcmp (argv[2], "-p") == 0); + ASSERT (strcmp (argv[3], "billy") == 0); + ASSERT (strcmp (argv[4], "duck") == 0); + ASSERT (strcmp (argv[5], "-a") == 0); + ASSERT (strcmp (argv[6], "--") == 0); + ASSERT (strcmp (argv[7], "-b") == 0); + ASSERT (strcmp (argv[8], "foo") == 0); + ASSERT (strcmp (argv[9], "-q") == 0); + ASSERT (strcmp (argv[10], "johnny") == 0); + ASSERT (strcmp (argv[11], "bar") == 0); + ASSERT (argv[12] == NULL); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 1); + ASSERT (!output); + } + else + { + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "-p") == 0); + ASSERT (strcmp (argv[2], "billy") == 0); + ASSERT (strcmp (argv[3], "-a") == 0); + ASSERT (strcmp (argv[4], "--") == 0); + ASSERT (strcmp (argv[5], "donald") == 0); + ASSERT (strcmp (argv[6], "duck") == 0); + ASSERT (strcmp (argv[7], "-b") == 0); + ASSERT (strcmp (argv[8], "foo") == 0); + ASSERT (strcmp (argv[9], "-q") == 0); + ASSERT (strcmp (argv[10], "johnny") == 0); + ASSERT (strcmp (argv[11], "bar") == 0); + ASSERT (argv[12] == NULL); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 5); + ASSERT (!output); + } + } + +#if GNULIB_TEST_GETOPT_GNU + /* Check that the '-' flag causes non-options to be returned in order. */ + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "donald"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc++] = "duck"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "-abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "donald") == 0); + ASSERT (strcmp (argv[2], "-p") == 0); + ASSERT (strcmp (argv[3], "billy") == 0); + ASSERT (strcmp (argv[4], "duck") == 0); + ASSERT (strcmp (argv[5], "-a") == 0); + ASSERT (strcmp (argv[6], "bar") == 0); + ASSERT (argv[7] == NULL); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 3); + ASSERT (strcmp (non_options[0], "donald") == 0); + ASSERT (strcmp (non_options[1], "duck") == 0); + ASSERT (strcmp (non_options[2], "bar") == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 7); + ASSERT (!output); + } + + /* Check that '--' ends the argument processing. */ + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[20]; + + argv[argc++] = "program"; + argv[argc++] = "donald"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc++] = "duck"; + argv[argc++] = "-a"; + argv[argc++] = "--"; + argv[argc++] = "-b"; + argv[argc++] = "foo"; + argv[argc++] = "-q"; + argv[argc++] = "johnny"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "-abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "donald") == 0); + ASSERT (strcmp (argv[2], "-p") == 0); + ASSERT (strcmp (argv[3], "billy") == 0); + ASSERT (strcmp (argv[4], "duck") == 0); + ASSERT (strcmp (argv[5], "-a") == 0); + ASSERT (strcmp (argv[6], "--") == 0); + ASSERT (strcmp (argv[7], "-b") == 0); + ASSERT (strcmp (argv[8], "foo") == 0); + ASSERT (strcmp (argv[9], "-q") == 0); + ASSERT (strcmp (argv[10], "johnny") == 0); + ASSERT (strcmp (argv[11], "bar") == 0); + ASSERT (argv[12] == NULL); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0); + ASSERT (q_value == NULL); + ASSERT (!output); + if (non_options_count == 2) + { + /* glibc behaviour. */ + ASSERT (non_options_count == 2); + ASSERT (strcmp (non_options[0], "donald") == 0); + ASSERT (strcmp (non_options[1], "duck") == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 7); + } + else + { + /* Another valid behaviour. */ + ASSERT (non_options_count == 7); + ASSERT (strcmp (non_options[0], "donald") == 0); + ASSERT (strcmp (non_options[1], "duck") == 0); + ASSERT (strcmp (non_options[2], "-b") == 0); + ASSERT (strcmp (non_options[3], "foo") == 0); + ASSERT (strcmp (non_options[4], "-q") == 0); + ASSERT (strcmp (non_options[5], "johnny") == 0); + ASSERT (strcmp (non_options[6], "bar") == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 12); + } + } + + /* Check that the '-' flag has to come first. */ + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "donald"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc++] = "duck"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "abp:q:-", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + if (posixly) + { + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "donald") == 0); + ASSERT (strcmp (argv[2], "-p") == 0); + ASSERT (strcmp (argv[3], "billy") == 0); + ASSERT (strcmp (argv[4], "duck") == 0); + ASSERT (strcmp (argv[5], "-a") == 0); + ASSERT (strcmp (argv[6], "bar") == 0); + ASSERT (argv[7] == NULL); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 1); + ASSERT (!output); + } + else + { + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "-p") == 0); + ASSERT (strcmp (argv[2], "billy") == 0); + ASSERT (strcmp (argv[3], "-a") == 0); + ASSERT (strcmp (argv[4], "donald") == 0); + ASSERT (strcmp (argv[5], "duck") == 0); + ASSERT (strcmp (argv[6], "bar") == 0); + ASSERT (argv[7] == NULL); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 4); + ASSERT (!output); + } + } + + /* Check that the '+' flag causes the first non-option to terminate the + loop. */ + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "donald"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc++] = "duck"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "+abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "donald") == 0); + ASSERT (strcmp (argv[2], "-p") == 0); + ASSERT (strcmp (argv[3], "billy") == 0); + ASSERT (strcmp (argv[4], "duck") == 0); + ASSERT (strcmp (argv[5], "-a") == 0); + ASSERT (strcmp (argv[6], "bar") == 0); + ASSERT (argv[7] == NULL); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 1); + ASSERT (!output); + } + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-+"; + argv[argc] = NULL; + optind = start; + getopt_loop (argc, argv, "+abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == '+'); + ASSERT (optind == 2); + ASSERT (output); + } + + /* Check that '--' ends the argument processing. */ + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[20]; + + argv[argc++] = "program"; + argv[argc++] = "donald"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc++] = "duck"; + argv[argc++] = "-a"; + argv[argc++] = "--"; + argv[argc++] = "-b"; + argv[argc++] = "foo"; + argv[argc++] = "-q"; + argv[argc++] = "johnny"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "+abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "donald") == 0); + ASSERT (strcmp (argv[2], "-p") == 0); + ASSERT (strcmp (argv[3], "billy") == 0); + ASSERT (strcmp (argv[4], "duck") == 0); + ASSERT (strcmp (argv[5], "-a") == 0); + ASSERT (strcmp (argv[6], "--") == 0); + ASSERT (strcmp (argv[7], "-b") == 0); + ASSERT (strcmp (argv[8], "foo") == 0); + ASSERT (strcmp (argv[9], "-q") == 0); + ASSERT (strcmp (argv[10], "johnny") == 0); + ASSERT (strcmp (argv[11], "bar") == 0); + ASSERT (argv[12] == NULL); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 1); + ASSERT (!output); + } +#endif /* GNULIB_TEST_GETOPT_GNU */ + + /* Check that the '+' flag has to come first. */ + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "donald"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc++] = "duck"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "abp:q:+", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + if (posixly) + { + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "donald") == 0); + ASSERT (strcmp (argv[2], "-p") == 0); + ASSERT (strcmp (argv[3], "billy") == 0); + ASSERT (strcmp (argv[4], "duck") == 0); + ASSERT (strcmp (argv[5], "-a") == 0); + ASSERT (strcmp (argv[6], "bar") == 0); + ASSERT (argv[7] == NULL); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 1); + ASSERT (!output); + } + else + { + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "-p") == 0); + ASSERT (strcmp (argv[2], "billy") == 0); + ASSERT (strcmp (argv[3], "-a") == 0); + ASSERT (strcmp (argv[4], "donald") == 0); + ASSERT (strcmp (argv[5], "duck") == 0); + ASSERT (strcmp (argv[6], "bar") == 0); + ASSERT (argv[7] == NULL); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 4); + ASSERT (!output); + } + } + +#if GNULIB_TEST_GETOPT_GNU + /* If GNU extensions are supported, require compliance with POSIX + interpretation on leading '+' behavior. + http://austingroupbugs.net/view.php?id=191 */ + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "donald"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc++] = "duck"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + opterr = 1; + getopt_loop (argc, argv, "+:abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "donald") == 0); + ASSERT (strcmp (argv[2], "-p") == 0); + ASSERT (strcmp (argv[3], "billy") == 0); + ASSERT (strcmp (argv[4], "duck") == 0); + ASSERT (strcmp (argv[5], "-a") == 0); + ASSERT (strcmp (argv[6], "bar") == 0); + ASSERT (argv[7] == NULL); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 1); + ASSERT (!output); + } + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-p"; + argv[argc] = NULL; + optind = start; + getopt_loop (argc, argv, "+:abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 'p'); + ASSERT (optind == 2); + ASSERT (!output); + } + for (start = OPTIND_MIN; start <= 1; start++) + { + int a_seen = 0; + int b_seen = 0; + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + bool output; + int argc = 0; + const char *argv[10]; + + argv[argc++] = "program"; + argv[argc++] = "-b"; + argv[argc++] = "-p"; + argv[argc] = NULL; + optind = start; + getopt_loop (argc, argv, "+:abp:q:", + &a_seen, &b_seen, &p_value, &q_value, + &non_options_count, non_options, &unrecognized, &output); + ASSERT (a_seen == 0); + ASSERT (b_seen == 1); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 'p'); + ASSERT (optind == 3); + ASSERT (!output); + } + + /* Check that 'W' does not dump core: + http://sourceware.org/bugzilla/show_bug.cgi?id=12922 + Technically, POSIX says the presence of ';' in the opt-string + gives unspecified behavior, so we only test this when GNU compliance + is desired. */ + for (start = OPTIND_MIN; start <= 1; start++) + { + int argc = 0; + const char *argv[10]; + int pos = ftell (stderr); + + argv[argc++] = "program"; + argv[argc++] = "-W"; + argv[argc++] = "dummy"; + argv[argc] = NULL; + optind = start; + opterr = 1; + ASSERT (getopt (argc, (char **) argv, "W;") == 'W'); + ASSERT (ftell (stderr) == pos); + ASSERT (optind == 2); + } +#endif /* GNULIB_TEST_GETOPT_GNU */ +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-getopt_long.h b/local/recipes/tools/diffutils/source/gnulib-tests/test-getopt_long.h new file mode 100644 index 0000000000..e90ebed984 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-getopt_long.h @@ -0,0 +1,2144 @@ +/* Test of command line argument processing. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2009. */ + +static int a_seen; +static int b_seen; +static int q_seen; + +static const struct option long_options_required[] = + { + { "alpha", no_argument, NULL, 'a' }, + { "beta", no_argument, &b_seen, 1 }, + { "prune", required_argument, NULL, 'p' }, + { "quetsche", required_argument, &q_seen, 1 }, + { "xtremely-",no_argument, NULL, 1003 }, + { "xtra", no_argument, NULL, 1001 }, + { "xtreme", no_argument, NULL, 1002 }, + { "xtremely", no_argument, NULL, 1003 }, + { NULL, 0, NULL, 0 } + }; + +static const struct option long_options_optional[] = + { + { "alpha", no_argument, NULL, 'a' }, + { "beta", no_argument, &b_seen, 1 }, + { "prune", optional_argument, NULL, 'p' }, + { "quetsche", optional_argument, &q_seen, 1 }, + { NULL, 0, NULL, 0 } + }; + +static void +getopt_long_loop (int argc, const char **argv, + const char *options, const struct option *long_options, + const char **p_value, const char **q_value, + int *non_options_count, const char **non_options, + int *unrecognized) +{ + int option_index = -1; + int c; + + opterr = 0; + q_seen = 0; + while ((c = getopt_long (argc, (char **) argv, options, long_options, + &option_index)) + != -1) + { + switch (c) + { + case 0: + /* An option with a non-NULL flag pointer was processed. */ + if (q_seen) + *q_value = optarg; + break; + case 'a': + a_seen++; + break; + case 'b': + b_seen = 1; + break; + case 'p': + *p_value = optarg; + break; + case 'q': + *q_value = optarg; + break; + case '\1': + /* Must only happen with option '-' at the beginning. */ + ASSERT (options[0] == '-'); + non_options[(*non_options_count)++] = optarg; + break; + case ':': + /* Must only happen with option ':' at the beginning. */ + ASSERT (options[0] == ':' + || ((options[0] == '-' || options[0] == '+') + && options[1] == ':')); + FALLTHROUGH; + case '?': + *unrecognized = optopt; + break; + default: + *unrecognized = c; + break; + } + } +} + +/* Reduce casting, so we can use string literals elsewhere. + getopt_long takes an array of char*, but luckily does not modify + those elements, so we can pass const char*. */ +static int +do_getopt_long (int argc, const char **argv, const char *shortopts, + const struct option *longopts, int *longind) +{ + return getopt_long (argc, (char **) argv, shortopts, longopts, longind); +} + +static void +test_getopt_long (void) +{ + int start; + + /* Test disambiguation of options. */ + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "--x"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index); + ASSERT (c == '?'); + ASSERT (optopt == 0); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "--xt"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index); + ASSERT (c == '?'); + ASSERT (optopt == 0); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "--xtr"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index); + ASSERT (c == '?'); + ASSERT (optopt == 0); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "--xtra"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index); + ASSERT (c == 1001); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "--xtre"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index); + ASSERT (c == '?'); + ASSERT (optopt == 0); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "--xtrem"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index); + ASSERT (c == '?'); + ASSERT (optopt == 0); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "--xtreme"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index); + ASSERT (c == 1002); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "--xtremel"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index); + ASSERT (c == 1003); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "--xtremely"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index); + ASSERT (c == 1003); + } + + /* Check that -W handles unknown options. */ + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "-W"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long (argc, argv, "W;", long_options_required, &option_index); + ASSERT (c == '?'); + ASSERT (optopt == 'W'); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "-Wunknown"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long (argc, argv, "W;", long_options_required, &option_index); + /* glibc and BSD behave differently here, but for now, we allow + both behaviors since W support is not frequently used. */ + if (c == '?') + { + ASSERT (optopt == 0); + ASSERT (optarg == NULL); + } + else + { + ASSERT (c == 'W'); + ASSERT (strcmp (optarg, "unknown") == 0); + } + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "-W"; + argv[argc++] = "unknown"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long (argc, argv, "W;", long_options_required, &option_index); + /* glibc and BSD behave differently here, but for now, we allow + both behaviors since W support is not frequently used. */ + if (c == '?') + { + ASSERT (optopt == 0); + ASSERT (optarg == NULL); + } + else + { + ASSERT (c == 'W'); + ASSERT (strcmp (optarg, "unknown") == 0); + } + } + + /* Test that 'W' does not dump core: + http://sourceware.org/bugzilla/show_bug.cgi?id=12922 */ + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "-W"; + argv[argc++] = "dummy"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long (argc, argv, "W;", NULL, &option_index); + ASSERT (c == 'W'); + ASSERT (optind == 2); + } + + /* Test processing of boolean short options. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-a"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "ab", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-b"; + argv[argc++] = "-a"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "ab", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 1); + ASSERT (b_seen == 1); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 3); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-ba"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "ab", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 1); + ASSERT (b_seen == 1); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-ab"; + argv[argc++] = "-a"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "ab", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 2); + ASSERT (b_seen == 1); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 3); + } + + /* Test processing of boolean long options. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "--alpha"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "ab", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "--beta"; + argv[argc++] = "--alpha"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "ab", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 1); + ASSERT (b_seen == 1); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 3); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "--alpha"; + argv[argc++] = "--beta"; + argv[argc++] = "--alpha"; + argv[argc++] = "--beta"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "ab", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 2); + ASSERT (b_seen == 1); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 5); + } + + /* Test processing of boolean long options via -W. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-Walpha"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "abW;", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-W"; + argv[argc++] = "beta"; + argv[argc++] = "-W"; + argv[argc++] = "alpha"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "aW;b", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 1); + ASSERT (b_seen == 1); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 5); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-Walpha"; + argv[argc++] = "-Wbeta"; + argv[argc++] = "-Walpha"; + argv[argc++] = "-Wbeta"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "W;ab", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 2); + ASSERT (b_seen == 1); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 5); + } + + /* Test processing of short options with arguments. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-pfoo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "p:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-p"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "p:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 3); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-ab"; + argv[argc++] = "-q"; + argv[argc++] = "baz"; + argv[argc++] = "-pfoo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "abp:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 1); + ASSERT (b_seen == 1); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value != NULL && strcmp (q_value, "baz") == 0); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 5); + } + + /* Test processing of long options with arguments. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "--p=foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "p:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "--p"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "p:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 3); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-ab"; + argv[argc++] = "--q"; + argv[argc++] = "baz"; + argv[argc++] = "--p=foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "abp:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 1); + ASSERT (b_seen == 1); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value != NULL && strcmp (q_value, "baz") == 0); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 5); + } + + /* Test processing of long options with arguments via -W. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-Wp=foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "p:q:W;", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-W"; + argv[argc++] = "p"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "p:W;q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 4); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-ab"; + argv[argc++] = "-Wq"; + argv[argc++] = "baz"; + argv[argc++] = "-W"; + argv[argc++] = "p=foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "W;abp:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 1); + ASSERT (b_seen == 1); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value != NULL && strcmp (q_value, "baz") == 0); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 6); + } + + /* Test processing of short options with optional arguments. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-pfoo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "p::q::", long_options_optional, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-p"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "p::q::", long_options_optional, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-p"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "abp::q::", long_options_optional, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 3); + } + + /* Test processing of long options with optional arguments. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "--p=foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "p::q::", long_options_optional, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "--p"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "p::q::", long_options_optional, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "--p="; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "p::q::", long_options_optional, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && *p_value == '\0'); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "--p"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "abp::q::", long_options_optional, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 3); + } + + /* Test processing of long options with optional arguments via -W. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-Wp=foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "p::q::W;", long_options_optional, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-Wp"; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "p::q::W;", long_options_optional, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-Wp="; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "W;p::q::", long_options_optional, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && *p_value == '\0'); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-W"; + argv[argc++] = "p="; + argv[argc++] = "foo"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "W;p::q::", long_options_optional, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && *p_value == '\0'); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 3); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-W"; + argv[argc++] = "p"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "W;abp::q::", long_options_optional, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + /* ASSERT (p_value == NULL); */ + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 4); + } + + /* Check that invalid options are recognized. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-p"; + argv[argc++] = "foo"; + argv[argc++] = "-x"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "abp:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 'x'); + ASSERT (optind == 5); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-p"; + argv[argc++] = "foo"; + argv[argc++] = "-:"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "abp:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == ':'); + ASSERT (optind == 5); + } + + /* Check that unexpected arguments are recognized. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-p"; + argv[argc++] = "foo"; + argv[argc++] = "--a="; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "abp:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 'a'); + ASSERT (optind == 4); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-p"; + argv[argc++] = "foo"; + argv[argc++] = "--b="; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "abp:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + /* When flag is non-zero, glibc sets optopt anyway, but BSD + leaves optopt unchanged. */ + ASSERT (unrecognized == 1 || unrecognized == 0); + ASSERT (optind == 4); + } + + /* Check that by default, non-options arguments are moved to the end. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "donald"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc++] = "duck"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "abp:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "-p") == 0); + ASSERT (strcmp (argv[2], "billy") == 0); + ASSERT (strcmp (argv[3], "-a") == 0); + ASSERT (strcmp (argv[4], "donald") == 0); + ASSERT (strcmp (argv[5], "duck") == 0); + ASSERT (strcmp (argv[6], "bar") == 0); + ASSERT (argv[7] == NULL); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 4); + } + + /* Check that '--' ends the argument processing. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[20]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "donald"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc++] = "duck"; + argv[argc++] = "-a"; + argv[argc++] = "--"; + argv[argc++] = "-b"; + argv[argc++] = "foo"; + argv[argc++] = "-q"; + argv[argc++] = "johnny"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "abp:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "-p") == 0); + ASSERT (strcmp (argv[2], "billy") == 0); + ASSERT (strcmp (argv[3], "-a") == 0); + ASSERT (strcmp (argv[4], "--") == 0); + ASSERT (strcmp (argv[5], "donald") == 0); + ASSERT (strcmp (argv[6], "duck") == 0); + ASSERT (strcmp (argv[7], "-b") == 0); + ASSERT (strcmp (argv[8], "foo") == 0); + ASSERT (strcmp (argv[9], "-q") == 0); + ASSERT (strcmp (argv[10], "johnny") == 0); + ASSERT (strcmp (argv[11], "bar") == 0); + ASSERT (argv[12] == NULL); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 5); + } + + /* Check that the '-' flag causes non-options to be returned in order. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "donald"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc++] = "duck"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "-abp:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "donald") == 0); + ASSERT (strcmp (argv[2], "-p") == 0); + ASSERT (strcmp (argv[3], "billy") == 0); + ASSERT (strcmp (argv[4], "duck") == 0); + ASSERT (strcmp (argv[5], "-a") == 0); + ASSERT (strcmp (argv[6], "bar") == 0); + ASSERT (argv[7] == NULL); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 3); + ASSERT (strcmp (non_options[0], "donald") == 0); + ASSERT (strcmp (non_options[1], "duck") == 0); + ASSERT (strcmp (non_options[2], "bar") == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 7); + } + + /* Check that '--' ends the argument processing. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[20]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "donald"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc++] = "duck"; + argv[argc++] = "-a"; + argv[argc++] = "--"; + argv[argc++] = "-b"; + argv[argc++] = "foo"; + argv[argc++] = "-q"; + argv[argc++] = "johnny"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "-abp:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "donald") == 0); + ASSERT (strcmp (argv[2], "-p") == 0); + ASSERT (strcmp (argv[3], "billy") == 0); + ASSERT (strcmp (argv[4], "duck") == 0); + ASSERT (strcmp (argv[5], "-a") == 0); + ASSERT (strcmp (argv[6], "--") == 0); + ASSERT (strcmp (argv[7], "-b") == 0); + ASSERT (strcmp (argv[8], "foo") == 0); + ASSERT (strcmp (argv[9], "-q") == 0); + ASSERT (strcmp (argv[10], "johnny") == 0); + ASSERT (strcmp (argv[11], "bar") == 0); + ASSERT (argv[12] == NULL); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0); + ASSERT (q_value == NULL); + if (non_options_count == 2) + { + /* glibc behaviour. */ + ASSERT (non_options_count == 2); + ASSERT (strcmp (non_options[0], "donald") == 0); + ASSERT (strcmp (non_options[1], "duck") == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 7); + } + else + { + /* Another valid behaviour. */ + ASSERT (non_options_count == 7); + ASSERT (strcmp (non_options[0], "donald") == 0); + ASSERT (strcmp (non_options[1], "duck") == 0); + ASSERT (strcmp (non_options[2], "-b") == 0); + ASSERT (strcmp (non_options[3], "foo") == 0); + ASSERT (strcmp (non_options[4], "-q") == 0); + ASSERT (strcmp (non_options[5], "johnny") == 0); + ASSERT (strcmp (non_options[6], "bar") == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 12); + } + } + + /* Check that the '-' flag has to come first. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "donald"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc++] = "duck"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "abp:q:-", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "-p") == 0); + ASSERT (strcmp (argv[2], "billy") == 0); + ASSERT (strcmp (argv[3], "-a") == 0); + ASSERT (strcmp (argv[4], "donald") == 0); + ASSERT (strcmp (argv[5], "duck") == 0); + ASSERT (strcmp (argv[6], "bar") == 0); + ASSERT (argv[7] == NULL); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 4); + } + + /* Check that the '+' flag causes the first non-option to terminate the + loop. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "donald"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc++] = "duck"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "+abp:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "donald") == 0); + ASSERT (strcmp (argv[2], "-p") == 0); + ASSERT (strcmp (argv[3], "billy") == 0); + ASSERT (strcmp (argv[4], "duck") == 0); + ASSERT (strcmp (argv[5], "-a") == 0); + ASSERT (strcmp (argv[6], "bar") == 0); + ASSERT (argv[7] == NULL); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 1); + } + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-+"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "+abp:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == '+'); + ASSERT (optind == 2); + } + + /* Check that '--' ends the argument processing. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[20]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "donald"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc++] = "duck"; + argv[argc++] = "-a"; + argv[argc++] = "--"; + argv[argc++] = "-b"; + argv[argc++] = "foo"; + argv[argc++] = "-q"; + argv[argc++] = "johnny"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "+abp:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "donald") == 0); + ASSERT (strcmp (argv[2], "-p") == 0); + ASSERT (strcmp (argv[3], "billy") == 0); + ASSERT (strcmp (argv[4], "duck") == 0); + ASSERT (strcmp (argv[5], "-a") == 0); + ASSERT (strcmp (argv[6], "--") == 0); + ASSERT (strcmp (argv[7], "-b") == 0); + ASSERT (strcmp (argv[8], "foo") == 0); + ASSERT (strcmp (argv[9], "-q") == 0); + ASSERT (strcmp (argv[10], "johnny") == 0); + ASSERT (strcmp (argv[11], "bar") == 0); + ASSERT (argv[12] == NULL); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 1); + } + + /* Check that the '+' flag has to come first. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "donald"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc++] = "duck"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "abp:q:+", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "-p") == 0); + ASSERT (strcmp (argv[2], "billy") == 0); + ASSERT (strcmp (argv[3], "-a") == 0); + ASSERT (strcmp (argv[4], "donald") == 0); + ASSERT (strcmp (argv[5], "duck") == 0); + ASSERT (strcmp (argv[6], "bar") == 0); + ASSERT (argv[7] == NULL); + ASSERT (a_seen == 1); + ASSERT (b_seen == 0); + ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 4); + } +} + +/* Test behavior of getopt_long when POSIXLY_CORRECT is set in the + environment. Options with optional arguments should not change + behavior just because of an environment variable. + http://lists.gnu.org/archive/html/bug-m4/2006-09/msg00028.html */ +static void +test_getopt_long_posix (void) +{ + int start; + + /* Check that POSIXLY_CORRECT stops parsing the same as leading '+'. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "donald"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc++] = "duck"; + argv[argc++] = "-a"; + argv[argc++] = "bar"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "abp:q:", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (strcmp (argv[0], "program") == 0); + ASSERT (strcmp (argv[1], "donald") == 0); + ASSERT (strcmp (argv[2], "-p") == 0); + ASSERT (strcmp (argv[3], "billy") == 0); + ASSERT (strcmp (argv[4], "duck") == 0); + ASSERT (strcmp (argv[5], "-a") == 0); + ASSERT (strcmp (argv[6], "bar") == 0); + ASSERT (argv[7] == NULL); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 1); + } + + /* Check that POSIXLY_CORRECT doesn't change optional arguments. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-p"; + argv[argc++] = "billy"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "p::", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 0); + ASSERT (b_seen == 0); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 2); + } + + /* Check that leading - still sees options after non-options. */ + for (start = 0; start <= 1; start++) + { + const char *p_value = NULL; + const char *q_value = NULL; + int non_options_count = 0; + const char *non_options[10]; + int unrecognized = 0; + int argc = 0; + const char *argv[10]; + a_seen = 0; + b_seen = 0; + + argv[argc++] = "program"; + argv[argc++] = "-a"; + argv[argc++] = "billy"; + argv[argc++] = "-b"; + argv[argc] = NULL; + optind = start; + getopt_long_loop (argc, argv, "-ab", long_options_required, + &p_value, &q_value, + &non_options_count, non_options, &unrecognized); + ASSERT (a_seen == 1); + ASSERT (b_seen == 1); + ASSERT (p_value == NULL); + ASSERT (q_value == NULL); + ASSERT (non_options_count == 1); + ASSERT (strcmp (non_options[0], "billy") == 0); + ASSERT (unrecognized == 0); + ASSERT (optind == 4); + } +} + +/* Reduce casting, so we can use string literals elsewhere. + getopt_long_only takes an array of char*, but luckily does not + modify those elements, so we can pass const char*. */ +static int +do_getopt_long_only (int argc, const char **argv, const char *shortopts, + const struct option *longopts, int *longind) +{ + return getopt_long_only (argc, (char **) argv, shortopts, longopts, longind); +} + +static void +test_getopt_long_only (void) +{ + /* Test disambiguation of options. */ + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "-x"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long_only (argc, argv, "ab", long_options_required, + &option_index); + ASSERT (c == '?'); + ASSERT (optopt == 0); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "-x"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long_only (argc, argv, "abx", long_options_required, + &option_index); + ASSERT (c == 'x'); + ASSERT (optopt == 0); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "--x"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long_only (argc, argv, "abx", long_options_required, + &option_index); + ASSERT (c == '?'); + ASSERT (optopt == 0); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "-b"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + b_seen = 0; + c = do_getopt_long_only (argc, argv, "abx", long_options_required, + &option_index); + ASSERT (c == 'b'); + ASSERT (b_seen == 0); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "--b"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + b_seen = 0; + c = do_getopt_long_only (argc, argv, "abx", long_options_required, + &option_index); + ASSERT (c == 0); + ASSERT (b_seen == 1); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "-xt"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long_only (argc, argv, "ab", long_options_required, + &option_index); + ASSERT (c == '?'); + ASSERT (optopt == 0); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "-xt"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long_only (argc, argv, "abx", long_options_required, + &option_index); + ASSERT (c == '?'); + ASSERT (optopt == 0); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "-xtra"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long_only (argc, argv, "ab", long_options_required, + &option_index); + ASSERT (c == 1001); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "-xtreme"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long_only (argc, argv, "abx:", long_options_required, + &option_index); + ASSERT (c == 1002); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "-xtremel"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long_only (argc, argv, "ab", long_options_required, + &option_index); + /* glibc getopt_long_only is intentionally different from + getopt_long when handling a prefix that is common to two + spellings, when both spellings have the same option directives. + BSD getopt_long_only treats both cases the same. */ + ASSERT (c == 1003 || c == '?'); + ASSERT (optind == 2); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "-xtremel"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long_only (argc, argv, "abx::", long_options_required, + &option_index); + /* glibc getopt_long_only is intentionally different from + getopt_long when handling a prefix that is common to two + spellings, when both spellings have the same option directives. + BSD getopt_long_only treats both cases the same. */ + ASSERT (c == 1003 || c == '?'); + ASSERT (optind == 2); + ASSERT (optarg == NULL); + } + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "-xtras"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long_only (argc, argv, "abx::", long_options_required, + &option_index); + ASSERT (c == 'x'); + ASSERT (strcmp (optarg, "tras") == 0); + } +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-getprogname.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-getprogname.c new file mode 100644 index 0000000000..299ca3d929 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-getprogname.c @@ -0,0 +1,58 @@ +/* Test the gnulib getprogname module. + Copyright (C) 2016-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "getprogname.h" +#include <string.h> +#include <assert.h> + +#ifdef __hpux +# define STREQ(a, b) (strncmp (a, b, 14) == 0) +#else +# define STREQ(a, b) (strcmp (a, b) == 0) +#endif + +int +main (void) +{ + char const *p = getprogname (); + + /* libtool creates a temporary executable whose name is sometimes prefixed + with "lt-" (depends on the platform). But the name of the temporary + executable is a detail that should not be visible to the end user and to + the test suite. Remove this "lt-" prefix here. */ + if (strncmp (p, "lt-", 3) == 0) + p += 3; + + /* Note: You can make this test fail + a) by running it on a case-insensitive file system (such as on Windows, + Cygwin, or on Mac OS X with a case-insensitive HFS+ file system), + with an invocation that contains upper case characters, e.g. + test-GETPROGNAME, + b) by hardlinking or symlinking it to a different name (e.g. test-foo) + and invoking it through that name. + That's not the intended use. The Makefile always invokes it as + 'test-getprogname${EXEEXT}'. */ +#if defined __CYGWIN__ + /* The Cygwin getprogname() function strips the ".exe" suffix. */ + assert (STREQ (p, "test-getprogname")); +#else + assert (STREQ (p, "test-getprogname" EXEEXT)); +#endif + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-gettimeofday.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-gettimeofday.c new file mode 100644 index 0000000000..124d991ced --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-gettimeofday.c @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2005, 2007, 2009-2017 Free Software Foundation, Inc. + * Written by Jim Meyering. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <sys/time.h> + +#include "signature.h" +SIGNATURE_CHECK (gettimeofday, int, + (struct timeval *, GETTIMEOFDAY_TIMEZONE *)); + +#include <time.h> + +#include <stdio.h> +#include <string.h> + +int +main (void) +{ + time_t t = 0; + struct tm *lt; + struct tm saved_lt; + struct timeval tv; + lt = localtime (&t); + saved_lt = *lt; + gettimeofday (&tv, NULL); + if (memcmp (lt, &saved_lt, sizeof (struct tm)) != 0) + { + fprintf (stderr, "gettimeofday still clobbers the localtime buffer!\n"); + return 1; + } + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-hash.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-hash.c new file mode 100644 index 0000000000..97926270fc --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-hash.c @@ -0,0 +1,263 @@ +/* + * Copyright (C) 2009-2017 Free Software Foundation, Inc. + * Written by Jim Meyering + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "hash.h" +#include "hash-pjw.h" +#include "inttostr.h" + +#include <stdio.h> +#include <stdlib.h> +#include <stdbool.h> +#include <string.h> +#include <unistd.h> + +#include "macros.h" + +#define STREQ(a, b) (strcmp (a, b) == 0) +#define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array)) + +static bool +hash_compare_strings (void const *x, void const *y) +{ + ASSERT (x != y); + return STREQ (x, y) ? true : false; +} + +static void +hash_freer (void *x) +{ + free (x); +} + +static void +insert_new (Hash_table *ht, const void *ent) +{ + void *e = hash_insert (ht, ent); + ASSERT (e == ent); +} + +static bool +walk (void *ent, void *data) +{ + char *str = ent; + unsigned int *map = data; + switch (*str) + { + case 'a': *map |= 1; return true; + case 'b': *map |= 2; return true; + case 'c': *map |= 4; return true; + } + *map |= 8; + return false; +} + +static int +get_seed (char const *str, unsigned int *seed) +{ + size_t len = strlen (str); + if (len == 0 || strspn (str, "0123456789") != len || 10 < len) + return 1; + + *seed = atoi (str); + return 0; +} + +int +main (int argc, char **argv) +{ + unsigned int i; + unsigned int k; + unsigned int table_size[] = {1, 2, 3, 4, 5, 23, 53}; + Hash_table *ht; + Hash_tuning tuning; + + hash_reset_tuning (&tuning); + tuning.shrink_threshold = 0.3; + tuning.shrink_factor = 0.707; + tuning.growth_threshold = 1.5; + tuning.growth_factor = 2.0; + tuning.is_n_buckets = true; + + if (1 < argc) + { + unsigned int seed; + if (get_seed (argv[1], &seed) != 0) + { + fprintf (stderr, "invalid seed: %s\n", argv[1]); + exit (EXIT_FAILURE); + } + + srand (seed); + } + + for (i = 0; i < ARRAY_CARDINALITY (table_size); i++) + { + size_t sz = table_size[i]; + ht = hash_initialize (sz, NULL, hash_pjw, hash_compare_strings, NULL); + ASSERT (ht); + insert_new (ht, "a"); + { + char *str1 = strdup ("a"); + char *str2; + ASSERT (str1); + str2 = hash_insert (ht, str1); + ASSERT (str1 != str2); + ASSERT (STREQ (str1, str2)); + free (str1); + } + insert_new (ht, "b"); + insert_new (ht, "c"); + i = 0; + ASSERT (hash_do_for_each (ht, walk, &i) == 3); + ASSERT (i == 7); + { + void *buf[5] = { NULL }; + ASSERT (hash_get_entries (ht, NULL, 0) == 0); + ASSERT (hash_get_entries (ht, buf, 5) == 3); + ASSERT (STREQ (buf[0], "a") || STREQ (buf[0], "b") || STREQ (buf[0], "c")); + } + ASSERT (hash_delete (ht, "a")); + ASSERT (hash_delete (ht, "a") == NULL); + ASSERT (hash_delete (ht, "b")); + ASSERT (hash_delete (ht, "c")); + + ASSERT (hash_rehash (ht, 47)); + ASSERT (hash_rehash (ht, 467)); + + /* Free an empty table. */ + hash_clear (ht); + hash_free (ht); + + ht = hash_initialize (sz, NULL, hash_pjw, hash_compare_strings, NULL); + ASSERT (ht); + + insert_new (ht, "z"); + insert_new (ht, "y"); + insert_new (ht, "x"); + insert_new (ht, "w"); + insert_new (ht, "v"); + insert_new (ht, "u"); + + hash_clear (ht); + ASSERT (hash_get_n_entries (ht) == 0); + hash_free (ht); + + /* Test pointer hashing. */ + ht = hash_initialize (sz, NULL, NULL, NULL, NULL); + ASSERT (ht); + { + char *str = strdup ("a"); + ASSERT (str); + insert_new (ht, "a"); + insert_new (ht, str); + ASSERT (hash_lookup (ht, str) == str); + free (str); + } + hash_free (ht); + } + + hash_reset_tuning (&tuning); + tuning.shrink_threshold = 0.3; + tuning.shrink_factor = 0.707; + tuning.growth_threshold = 1.5; + tuning.growth_factor = 2.0; + tuning.is_n_buckets = true; + /* Invalid tuning. */ + ht = hash_initialize (4651, &tuning, hash_pjw, hash_compare_strings, + hash_freer); + ASSERT (!ht); + + /* Alternate tuning. */ + tuning.growth_threshold = 0.89; + + /* Run with default tuning, then with custom tuning settings. */ + for (k = 0; k < 2; k++) + { + Hash_tuning const *tune = (k == 0 ? NULL : &tuning); + /* Now, each entry is malloc'd. */ + ht = hash_initialize (4651, tune, hash_pjw, + hash_compare_strings, hash_freer); + ASSERT (ht); + for (i = 0; i < 10000; i++) + { + unsigned int op = rand () % 10; + switch (op) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + { + char buf[50]; + char const *p = uinttostr (i, buf); + char *p_dup = strdup (p); + ASSERT (p_dup); + insert_new (ht, p_dup); + } + break; + + case 6: + { + size_t n = hash_get_n_entries (ht); + ASSERT (hash_rehash (ht, n + rand () % 20)); + } + break; + + case 7: + { + size_t n = hash_get_n_entries (ht); + size_t delta = rand () % 20; + if (delta < n) + ASSERT (hash_rehash (ht, n - delta)); + } + break; + + case 8: + case 9: + { + /* Delete a random entry. */ + size_t n = hash_get_n_entries (ht); + if (n) + { + size_t kk = rand () % n; + void const *p; + void *v; + for (p = hash_get_first (ht); kk; + --kk, p = hash_get_next (ht, p)) + { + /* empty */ + } + ASSERT (p); + v = hash_delete (ht, p); + ASSERT (v); + free (v); + } + break; + } + } + ASSERT (hash_table_ok (ht)); + } + + hash_free (ht); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-iconv-h.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-iconv-h.c new file mode 100644 index 0000000000..fb121f3f7d --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-iconv-h.c @@ -0,0 +1,27 @@ +/* Test of <iconv.h> substitute. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#if HAVE_ICONV +# include <iconv.h> +#endif + +int +main () +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-iconv.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-iconv.c new file mode 100644 index 0000000000..dcb5b3d127 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-iconv.c @@ -0,0 +1,159 @@ +/* Test of character set conversion. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#if HAVE_ICONV +# include <iconv.h> + +# ifndef ICONV_CONST +# define ICONV_CONST /* empty */ +# endif + +#include "signature.h" +SIGNATURE_CHECK (iconv, size_t, (iconv_t, ICONV_CONST char **, size_t *, + char **, size_t *)); +SIGNATURE_CHECK (iconv_close, int, (iconv_t x)); +SIGNATURE_CHECK (iconv_open, iconv_t, (char const *, char const *)); + +#endif + +#include <errno.h> +#include <string.h> + +#include "macros.h" + +int +main () +{ +#if HAVE_ICONV + /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1, + and UTF-8. */ + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO8859-1"); + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + +#if defined __MVS__ && defined __IBMC__ + /* String literals below are in ASCII, not EBCDIC. */ +# pragma convert("ISO8859-1") +# define CONVERT_ENABLED +#endif + + ASSERT (cd_88591_to_utf8 != (iconv_t)(-1)); + ASSERT (cd_utf8_to_88591 != (iconv_t)(-1)); + + /* Test conversion from ISO-8859-1 to UTF-8 with no errors. */ + { + static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + static const char expected[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237"; + char buf[50]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + (ICONV_CONST char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + ASSERT (res == 0 && inbytesleft == 0); + ASSERT (outptr == buf + strlen (expected)); + ASSERT (memcmp (buf, expected, strlen (expected)) == 0); + } + + /* Test conversion from ISO-8859-1 to UTF-8 with E2BIG. */ + { + static const char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + const char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + (ICONV_CONST char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + ASSERT (res == (size_t)(-1) && errno == E2BIG); + ASSERT (inbytesleft == 1); + ASSERT (outbytesleft == 1); + ASSERT ((unsigned char) buf[1] == 0xAD); + ASSERT ((unsigned char) buf[0] == 0xDE); + } + + /* Test conversion from UTF-8 to ISO-8859-1 with no errors. */ + { + static const char input[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237"; + static const char expected[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + (ICONV_CONST char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + ASSERT (res == 0 && inbytesleft == 0); + ASSERT (outptr == buf + strlen (expected)); + ASSERT (memcmp (buf, expected, strlen (expected)) == 0); + } + + /* Test conversion from UTF-8 to ISO-8859-1 with EILSEQ. */ + { + static const char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + (ICONV_CONST char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == (size_t)(-1)) + { + ASSERT (errno == EILSEQ); + ASSERT (inbytesleft == strlen (input) && outptr == buf); + } + else + { + ASSERT (res == 1); + ASSERT (inbytesleft == 0); + } + } + + /* Test conversion from UTF-8 to ISO-8859-1 with EINVAL. */ + { + static const char input[] = "\342"; + char buf[10]; + const char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + (ICONV_CONST char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + ASSERT (res == (size_t)(-1) && errno == EINVAL); + ASSERT (inbytesleft == 1 && outptr == buf); + } + + iconv_close (cd_88591_to_utf8); + iconv_close (cd_utf8_to_88591); + +#ifdef CONVERT_ENABLED +# pragma convert(pop) +#endif + +#endif /* HAVE_ICONV */ + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-ignore-value.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-ignore-value.c new file mode 100644 index 0000000000..ca772941c6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-ignore-value.c @@ -0,0 +1,84 @@ +/* Test the "ignore-value" module. + + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake. */ + +#include <config.h> + +#include "ignore-value.h" + +#include <stdio.h> + +#ifndef _GL_ATTRIBUTE_RETURN_CHECK +# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4) +# define _GL_ATTRIBUTE_RETURN_CHECK +# else +# define _GL_ATTRIBUTE_RETURN_CHECK __attribute__((__warn_unused_result__)) +# endif +#endif + +struct s { int i; }; +static char doChar (void) _GL_ATTRIBUTE_RETURN_CHECK; +static int doInt (void) _GL_ATTRIBUTE_RETURN_CHECK; +static off_t doOff (void) _GL_ATTRIBUTE_RETURN_CHECK; +static void *doPtr (void) _GL_ATTRIBUTE_RETURN_CHECK; +static struct s doStruct (void) _GL_ATTRIBUTE_RETURN_CHECK; + +static char +doChar (void) +{ + return 0; +} + +static int +doInt (void) +{ + return 0; +} + +static off_t +doOff (void) +{ + return 0; +} + +static void * +doPtr (void) +{ + return NULL; +} + +static struct s +doStruct (void) +{ + static struct s s1; + return s1; +} + +int +main (void) +{ + /* If this test can compile with -Werror and the same warnings as + the rest of the project, then we are properly silencing warnings + about ignored return values. */ + ignore_value (doChar ()); + ignore_value (doInt ()); + ignore_value (doOff ()); + ignore_value (doPtr ()); + ignore_value (doStruct ()); + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-inet_pton.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-inet_pton.c new file mode 100644 index 0000000000..fea261eb22 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-inet_pton.c @@ -0,0 +1,58 @@ +/* Test of inet_pton function. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2009. */ + +#include <config.h> + +#include <arpa/inet.h> + +#include "signature.h" +SIGNATURE_CHECK (inet_pton, int, (int, const char *, void *)); + +#include <netinet/in.h> +#include <sys/socket.h> + +#include "macros.h" + +int +main (void) +{ +#if defined AF_INET /* HAVE_IPV4 */ + { + /* This machine was for a long time known as + ma2s2.mathematik.uni-karlsruhe.de. */ + const char printable[] = "129.13.115.2"; + struct in_addr internal; + int ret; + + ret = inet_pton (AF_INET, printable, &internal); + ASSERT (ret == 1); + /* Verify that internal is filled in network byte order. */ + ASSERT (((unsigned char *) &internal)[0] == 0x81); + ASSERT (((unsigned char *) &internal)[1] == 0x0D); + ASSERT (((unsigned char *) &internal)[2] == 0x73); + ASSERT (((unsigned char *) &internal)[3] == 0x02); +# ifdef WORDS_BIGENDIAN + ASSERT (internal.s_addr == 0x810D7302); +# else + ASSERT (internal.s_addr == 0x02730D81); +# endif + } +#endif + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-init.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-init.sh new file mode 100755 index 0000000000..98fe2c030b --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-init.sh @@ -0,0 +1,74 @@ +#!/bin/sh +# Unit tests for init.sh +# Copyright (C) 2011-2017 Free Software Foundation, Inc. +# This file is part of the GNUlib Library. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +: ${srcdir=.} +. "$srcdir/init.sh"; path_prepend_ . + +fail=0 + +test_compare() +{ + touch empty || fail=1 + echo xyz > in || fail=1 + + compare /dev/null /dev/null >out 2>err || fail=1 + test -s out && fail_ "out not empty: $(cat out)" + # "err" should be empty, too, but has "set -x" output when VERBOSE=yes + case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac + + compare /dev/null empty >out 2>err || fail=1 + test -s out && fail_ "out not empty: $(cat out)" + case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac + + compare in in >out 2>err || fail=1 + test -s out && fail_ "out not empty: $(cat out)" + case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac + + compare /dev/null in >out 2>err && fail=1 + cat <<\EOF > exp +diff -u /dev/null in +--- /dev/null 1970-01-01 ++++ in 1970-01-01 ++xyz +EOF + compare exp out || fail=1 + case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac + + compare empty in >out 2>err && fail=1 + # Compare against expected output only if compare is using diff -u. + if grep @ out >/dev/null; then + # Remove the TAB-date suffix on each --- and +++ line, + # for both the expected and the actual output files. + # Also remove the @@ line, since Solaris 5.10 and GNU diff formats differ: + # -@@ -0,0 +1 @@ + # +@@ -1,0 +1,1 @@ + # Also, remove space after leading '+', since AIX 7.1 diff outputs a space. + sed 's/ .*//;/^@@/d;s/^+ /+/' out > k && mv k out + cat <<\EOF > exp +--- empty ++++ in ++xyz +EOF + compare exp out || fail=1 + fi + case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac +} + +test_compare + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-intprops.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-intprops.c new file mode 100644 index 0000000000..a030e733ab --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-intprops.c @@ -0,0 +1,391 @@ +/* Test intprops.h. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +/* Tell gcc not to warn about the long expressions that the overflow + macros expand to, or about the (X < 0) expressions. */ +#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__) +# pragma GCC diagnostic ignored "-Woverlength-strings" +# pragma GCC diagnostic ignored "-Wtype-limits" + +/* Work around a bug in GCC 6.1 and earlier; see: + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68971 */ +# pragma GCC diagnostic ignored "-Woverflow" + +#endif + +#include <config.h> + +#include "intprops.h" +#include "verify.h" + +#include <stdbool.h> +#include <inttypes.h> +#include <limits.h> + +#include "macros.h" + +/* VERIFY (X) uses a static assertion for compilers that are known to work, + and falls back on a dynamic assertion for other compilers. + These tests should be checkable via 'verify' rather than 'ASSERT', but + using 'verify' would run into a bug with HP-UX 11.23 cc; see + <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00401.html>. */ +#if __GNUC__ || __SUNPRO_C +# define VERIFY(x) do { verify (x); } while (0) +#else +# define VERIFY(x) ASSERT (x) +#endif + +#define DONTCARE __LINE__ + +int +main (void) +{ + /* Use VERIFY for tests that must be integer constant expressions, + ASSERT otherwise. */ + + /* TYPE_IS_INTEGER. */ + ASSERT (TYPE_IS_INTEGER (bool)); + ASSERT (TYPE_IS_INTEGER (char)); + ASSERT (TYPE_IS_INTEGER (signed char)); + ASSERT (TYPE_IS_INTEGER (unsigned char)); + ASSERT (TYPE_IS_INTEGER (short int)); + ASSERT (TYPE_IS_INTEGER (unsigned short int)); + ASSERT (TYPE_IS_INTEGER (int)); + ASSERT (TYPE_IS_INTEGER (unsigned int)); + ASSERT (TYPE_IS_INTEGER (long int)); + ASSERT (TYPE_IS_INTEGER (unsigned long int)); + ASSERT (TYPE_IS_INTEGER (intmax_t)); + ASSERT (TYPE_IS_INTEGER (uintmax_t)); + ASSERT (! TYPE_IS_INTEGER (float)); + ASSERT (! TYPE_IS_INTEGER (double)); + ASSERT (! TYPE_IS_INTEGER (long double)); + + /* TYPE_SIGNED. */ + /* VERIFY (! TYPE_SIGNED (bool)); // not guaranteed by gnulib substitute */ + VERIFY (TYPE_SIGNED (signed char)); + VERIFY (! TYPE_SIGNED (unsigned char)); + VERIFY (TYPE_SIGNED (short int)); + VERIFY (! TYPE_SIGNED (unsigned short int)); + VERIFY (TYPE_SIGNED (int)); + VERIFY (! TYPE_SIGNED (unsigned int)); + VERIFY (TYPE_SIGNED (long int)); + VERIFY (! TYPE_SIGNED (unsigned long int)); + VERIFY (TYPE_SIGNED (intmax_t)); + VERIFY (! TYPE_SIGNED (uintmax_t)); + ASSERT (TYPE_SIGNED (float)); + ASSERT (TYPE_SIGNED (double)); + ASSERT (TYPE_SIGNED (long double)); + + /* Integer representation. Check that it is two's complement. */ + VERIFY (INT_MIN + INT_MAX < 0); + + /* TYPE_MINIMUM, TYPE_MAXIMUM. */ + VERIFY (TYPE_MINIMUM (char) == CHAR_MIN); + VERIFY (TYPE_MAXIMUM (char) == CHAR_MAX); + VERIFY (TYPE_MINIMUM (unsigned char) == 0); + VERIFY (TYPE_MAXIMUM (unsigned char) == UCHAR_MAX); + VERIFY (TYPE_MINIMUM (signed char) == SCHAR_MIN); + VERIFY (TYPE_MAXIMUM (signed char) == SCHAR_MAX); + VERIFY (TYPE_MINIMUM (short int) == SHRT_MIN); + VERIFY (TYPE_MAXIMUM (short int) == SHRT_MAX); + VERIFY (TYPE_MINIMUM (unsigned short int) == 0); + VERIFY (TYPE_MAXIMUM (unsigned short int) == USHRT_MAX); + VERIFY (TYPE_MINIMUM (int) == INT_MIN); + VERIFY (TYPE_MAXIMUM (int) == INT_MAX); + VERIFY (TYPE_MINIMUM (unsigned int) == 0); + VERIFY (TYPE_MAXIMUM (unsigned int) == UINT_MAX); + VERIFY (TYPE_MINIMUM (long int) == LONG_MIN); + VERIFY (TYPE_MAXIMUM (long int) == LONG_MAX); + VERIFY (TYPE_MINIMUM (unsigned long int) == 0); + VERIFY (TYPE_MAXIMUM (unsigned long int) == ULONG_MAX); + #ifdef LLONG_MAX + verify (TYPE_MINIMUM (long long int) == LLONG_MIN); + verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); + #endif + VERIFY (TYPE_MINIMUM (intmax_t) == INTMAX_MIN); + VERIFY (TYPE_MAXIMUM (intmax_t) == INTMAX_MAX); + VERIFY (TYPE_MINIMUM (uintmax_t) == 0); + VERIFY (TYPE_MAXIMUM (uintmax_t) == UINTMAX_MAX); + + /* TYPE_WIDTH. */ + #ifdef CHAR_WIDTH + verify (TYPE_WIDTH (char) == CHAR_WIDTH); + verify (TYPE_WIDTH (signed char) == SCHAR_WIDTH); + verify (TYPE_WIDTH (unsigned char) == UCHAR_WIDTH); + verify (TYPE_WIDTH (short int) == SHRT_WIDTH); + verify (TYPE_WIDTH (unsigned short int) == USHRT_WIDTH); + verify (TYPE_WIDTH (int) == INT_WIDTH); + verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH); + verify (TYPE_WIDTH (long int) == LONG_WIDTH); + verify (TYPE_WIDTH (unsigned long int) == ULONG_WIDTH); + #ifdef LLONG_WIDTH + verify (TYPE_WIDTH (long long int) == LLONG_WIDTH); + verify (TYPE_WIDTH (unsigned long long int) == ULLONG_WIDTH); + #endif + #endif + + /* INT_BITS_STRLEN_BOUND. */ + VERIFY (INT_BITS_STRLEN_BOUND (1) == 1); + VERIFY (INT_BITS_STRLEN_BOUND (2620) == 789); + + /* INT_STRLEN_BOUND, INT_BUFSIZE_BOUND. */ + #ifdef INT32_MAX /* POSIX guarantees int32_t; this ports to non-POSIX. */ + VERIFY (INT_STRLEN_BOUND (int32_t) == sizeof ("-2147483648") - 1); + VERIFY (INT_BUFSIZE_BOUND (int32_t) == sizeof ("-2147483648")); + #endif + #ifdef INT64_MAX + VERIFY (INT_STRLEN_BOUND (int64_t) == sizeof ("-9223372036854775808") - 1); + VERIFY (INT_BUFSIZE_BOUND (int64_t) == sizeof ("-9223372036854775808")); + #endif + + /* All the INT_<op>_RANGE_OVERFLOW tests are equally valid as + INT_<op>_OVERFLOW tests, so define macros to do both. OP is the + operation, OPNAME its symbolic name, A and B its operands, T the + result type, V the overflow flag, and VRES the result if V and if + two's complement. CHECK_BINOP is for most binary operatinos, + CHECK_SBINOP for binary +, -, * when the result type is signed, + and CHECK_UNOP for unary operations. */ + #define CHECK_BINOP(op, opname, a, b, t, v, vres) \ + VERIFY (INT_##opname##_RANGE_OVERFLOW (a, b, TYPE_MINIMUM (t), \ + TYPE_MAXIMUM (t)) \ + == (v)); \ + VERIFY (INT_##opname##_OVERFLOW (a, b) == (v)) + #define CHECK_SBINOP(op, opname, a, b, t, v, vres) \ + CHECK_BINOP(op, opname, a, b, t, v, vres); \ + { \ + t result; \ + ASSERT (INT_##opname##_WRAPV (a, b, &result) == (v)); \ + ASSERT (result == ((v) ? (vres) : ((a) op (b)))); \ + } + #define CHECK_UNOP(op, opname, a, t, v) \ + VERIFY (INT_##opname##_RANGE_OVERFLOW (a, TYPE_MINIMUM (t), \ + TYPE_MAXIMUM (t)) \ + == (v)); \ + VERIFY (INT_##opname##_OVERFLOW (a) == (v)) + + /* INT_<op>_RANGE_OVERFLOW, INT_<op>_OVERFLOW. */ + VERIFY (INT_ADD_RANGE_OVERFLOW (INT_MAX, 1, INT_MIN, INT_MAX)); + VERIFY (INT_ADD_OVERFLOW (INT_MAX, 1)); + + CHECK_SBINOP (+, ADD, INT_MAX, 1, int, true, INT_MIN); + CHECK_SBINOP (+, ADD, INT_MAX, -1, int, false, INT_MAX - 1); + CHECK_SBINOP (+, ADD, INT_MIN, 1, int, false, INT_MIN + 1); + CHECK_SBINOP (+, ADD, INT_MIN, -1, int, true, INT_MAX); + CHECK_BINOP (+, ADD, UINT_MAX, 1u, unsigned int, true, 0u); + CHECK_BINOP (+, ADD, 0u, 1u, unsigned int, false, 1u); + + CHECK_SBINOP (-, SUBTRACT, INT_MAX, 1, int, false, INT_MAX - 1); + CHECK_SBINOP (-, SUBTRACT, INT_MAX, -1, int, true, INT_MIN); + CHECK_SBINOP (-, SUBTRACT, INT_MIN, 1, int, true, INT_MAX); + CHECK_SBINOP (-, SUBTRACT, INT_MIN, -1, int, false, INT_MIN - -1); + CHECK_BINOP (-, SUBTRACT, UINT_MAX, 1u, unsigned int, false, UINT_MAX - 1u); + CHECK_BINOP (-, SUBTRACT, 0u, 1u, unsigned int, true, 0u - 1u); + + CHECK_UNOP (-, NEGATE, INT_MIN, int, true); + CHECK_UNOP (-, NEGATE, 0, int, false); + CHECK_UNOP (-, NEGATE, INT_MAX, int, false); + CHECK_UNOP (-, NEGATE, 0u, unsigned int, false); + CHECK_UNOP (-, NEGATE, 1u, unsigned int, true); + CHECK_UNOP (-, NEGATE, UINT_MAX, unsigned int, true); + + CHECK_SBINOP (*, MULTIPLY, INT_MAX, INT_MAX, int, true, 1); + CHECK_SBINOP (*, MULTIPLY, INT_MAX, INT_MIN, int, true, INT_MIN); + CHECK_SBINOP (*, MULTIPLY, INT_MIN, INT_MAX, int, true, INT_MIN); + CHECK_SBINOP (*, MULTIPLY, INT_MIN, INT_MIN, int, true, 0); + CHECK_SBINOP (*, MULTIPLY, -1, INT_MIN, int, + INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN); + CHECK_SBINOP (*, MULTIPLY, LONG_MIN / INT_MAX, (long int) INT_MAX, + long int, false, LONG_MIN - LONG_MIN % INT_MAX); + + CHECK_BINOP (/, DIVIDE, INT_MIN, -1, int, + INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN); + CHECK_BINOP (/, DIVIDE, INT_MAX, 1, int, false, INT_MAX); + CHECK_BINOP (/, DIVIDE, (unsigned int) INT_MIN, -1u, unsigned int, + false, INT_MIN / -1u); + + CHECK_BINOP (%, REMAINDER, INT_MIN, -1, int, INT_NEGATE_OVERFLOW (INT_MIN), 0); + CHECK_BINOP (%, REMAINDER, INT_MAX, 1, int, false, 0); + CHECK_BINOP (%, REMAINDER, (unsigned int) INT_MIN, -1u, unsigned int, + false, INT_MIN % -1u); + + CHECK_BINOP (<<, LEFT_SHIFT, UINT_MAX, 1, unsigned int, true, UINT_MAX << 1); + CHECK_BINOP (<<, LEFT_SHIFT, UINT_MAX / 2 + 1, 1, unsigned int, true, + (UINT_MAX / 2 + 1) << 1); + CHECK_BINOP (<<, LEFT_SHIFT, UINT_MAX / 2, 1, unsigned int, false, + (UINT_MAX / 2) << 1); + + /* INT_<op>_OVERFLOW and INT_<op>_WRAPV with mixed types. */ + #define CHECK_SUM(a, b, t, v, vres) \ + CHECK_SUM1(a, b, t, v, vres); \ + CHECK_SUM1(b, a, t, v, vres) + #define CHECK_SSUM(a, b, t, v, vres) \ + CHECK_SSUM1(a, b, t, v, vres); \ + CHECK_SSUM1(b, a, t, v, vres) + #define CHECK_SUM1(a, b, t, v, vres) \ + VERIFY (INT_ADD_OVERFLOW (a, b) == (v)) + #define CHECK_SSUM1(a, b, t, v, vres) \ + CHECK_SUM1(a, b, t, v, vres); \ + { \ + t result; \ + ASSERT (INT_ADD_WRAPV (a, b, &result) == (v)); \ + ASSERT (result == ((v) ? (vres) : ((a) + (b)))); \ + } + CHECK_SSUM (-1, LONG_MIN, long int, true, LONG_MAX); + CHECK_SUM (-1, UINT_MAX, unsigned int, false, DONTCARE); + CHECK_SSUM (-1L, INT_MIN, long int, INT_MIN == LONG_MIN, + INT_MIN == LONG_MIN ? INT_MAX : DONTCARE); + CHECK_SUM (0u, -1, unsigned int, true, 0u + -1); + CHECK_SUM (0u, 0, unsigned int, false, DONTCARE); + CHECK_SUM (0u, 1, unsigned int, false, DONTCARE); + CHECK_SSUM (1, LONG_MAX, long int, true, LONG_MIN); + CHECK_SUM (1, UINT_MAX, unsigned int, true, 0u); + CHECK_SSUM (1L, INT_MAX, long int, INT_MAX == LONG_MAX, + INT_MAX == LONG_MAX ? INT_MIN : DONTCARE); + CHECK_SUM (1u, INT_MAX, unsigned int, INT_MAX == UINT_MAX, 1u + INT_MAX); + CHECK_SUM (1u, INT_MIN, unsigned int, true, 1u + INT_MIN); + { + long int result; + ASSERT (INT_ADD_WRAPV (1, INT_MAX, &result) == (INT_MAX == LONG_MAX)); + ASSERT (INT_ADD_WRAPV (-1, INT_MIN, &result) == (INT_MIN == LONG_MIN)); + } + + #define CHECK_DIFFERENCE(a, b, t, v, vres) \ + VERIFY (INT_SUBTRACT_OVERFLOW (a, b) == (v)) + #define CHECK_SDIFFERENCE(a, b, t, v, vres) \ + CHECK_DIFFERENCE(a, b, t, v, vres); \ + { \ + t result; \ + ASSERT (INT_SUBTRACT_WRAPV (a, b, &result) == (v)); \ + ASSERT (result == ((v) ? (vres) : ((a) - (b)))); \ + } + CHECK_DIFFERENCE (INT_MAX, 1u, unsigned int, UINT_MAX < INT_MAX - 1, + INT_MAX - 1u); + CHECK_DIFFERENCE (UINT_MAX, 1, unsigned int, false, UINT_MAX - 1); + CHECK_DIFFERENCE (0u, -1, unsigned int, false, 0u - -1); + CHECK_DIFFERENCE (UINT_MAX, -1, unsigned int, true, UINT_MAX - -1); + CHECK_DIFFERENCE (INT_MIN, 1u, unsigned int, true, INT_MIN - 1u); + CHECK_DIFFERENCE (-1, 0u, unsigned int, true, -1 - 0u); + CHECK_SDIFFERENCE (-1, INT_MIN, int, false, -1 - INT_MIN); + CHECK_SDIFFERENCE (-1, INT_MAX, int, false, -1 - INT_MAX); + CHECK_SDIFFERENCE (0, INT_MIN, int, INT_MIN < -INT_MAX, INT_MIN); + CHECK_SDIFFERENCE (0, INT_MAX, int, false, 0 - INT_MAX); + { + long int result; + ASSERT (INT_SUBTRACT_WRAPV (INT_MAX, -1, &result) == (INT_MAX == LONG_MAX)); + ASSERT (INT_SUBTRACT_WRAPV (INT_MIN, 1, &result) == (INT_MAX == LONG_MAX)); + } + + #define CHECK_PRODUCT(a, b, t, v, vres) \ + CHECK_PRODUCT1(a, b, t, v, vres); \ + CHECK_PRODUCT1(b, a, t, v, vres) + #define CHECK_SPRODUCT(a, b, t, v, vres) \ + CHECK_SPRODUCT1(a, b, t, v, vres); \ + CHECK_SPRODUCT1(b, a, t, v, vres) + #define CHECK_PRODUCT1(a, b, t, v, vres) \ + VERIFY (INT_MULTIPLY_OVERFLOW (a, b) == (v)) + #define CHECK_SPRODUCT1(a, b, t, v, vres) \ + CHECK_PRODUCT1(a, b, t, v, vres); \ + { \ + t result; \ + ASSERT (INT_MULTIPLY_WRAPV (a, b, &result) == (v)); \ + ASSERT (result == ((v) ? (vres) : ((a) * (b)))); \ + } + CHECK_PRODUCT (-1, 1u, unsigned int, true, -1 * 1u); + CHECK_SPRODUCT (-1, INT_MIN, int, INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN); + CHECK_PRODUCT (-1, UINT_MAX, unsigned int, true, -1 * UINT_MAX); + CHECK_SPRODUCT (-32768, LONG_MAX / -32768 - 1, long int, true, LONG_MIN); + CHECK_SPRODUCT (-12345, LONG_MAX / -12345, long int, false, DONTCARE); + CHECK_SPRODUCT (0, -1, int, false, DONTCARE); + CHECK_SPRODUCT (0, 0, int, false, DONTCARE); + CHECK_PRODUCT (0, 0u, unsigned int, false, DONTCARE); + CHECK_SPRODUCT (0, 1, int, false, DONTCARE); + CHECK_SPRODUCT (0, INT_MAX, int, false, DONTCARE); + CHECK_SPRODUCT (0, INT_MIN, int, false, DONTCARE); + CHECK_PRODUCT (0, UINT_MAX, unsigned int, false, DONTCARE); + CHECK_PRODUCT (0u, -1, unsigned int, false, DONTCARE); + CHECK_PRODUCT (0u, 0, unsigned int, false, DONTCARE); + CHECK_PRODUCT (0u, 0u, unsigned int, false, DONTCARE); + CHECK_PRODUCT (0u, 1, unsigned int, false, DONTCARE); + CHECK_PRODUCT (0u, INT_MAX, unsigned int, false, DONTCARE); + CHECK_PRODUCT (0u, INT_MIN, unsigned int, false, DONTCARE); + CHECK_PRODUCT (0u, UINT_MAX, unsigned int, false, DONTCARE); + CHECK_SPRODUCT (1, INT_MAX, int, false, DONTCARE); + CHECK_SPRODUCT (1, INT_MIN, int, false, DONTCARE); + CHECK_PRODUCT (1, UINT_MAX, unsigned int, false, DONTCARE); + CHECK_PRODUCT (1u, INT_MIN, unsigned int, true, 1u * INT_MIN); + CHECK_PRODUCT (1u, INT_MAX, unsigned int, UINT_MAX < INT_MAX, 1u * INT_MAX); + CHECK_PRODUCT (INT_MAX, UINT_MAX, unsigned int, true, INT_MAX * UINT_MAX); + CHECK_PRODUCT (INT_MAX, ULONG_MAX, unsigned long int, true, + INT_MAX * ULONG_MAX); + CHECK_SPRODUCT (INT_MIN, LONG_MAX / INT_MIN - 1, long int, true, LONG_MIN); + CHECK_SPRODUCT (INT_MIN, LONG_MAX / INT_MIN, long int, false, DONTCARE); + CHECK_PRODUCT (INT_MIN, UINT_MAX, unsigned int, true, INT_MIN * UINT_MAX); + CHECK_PRODUCT (INT_MIN, ULONG_MAX, unsigned long int, true, + INT_MIN * ULONG_MAX); + { + long int result; + ASSERT (INT_MULTIPLY_WRAPV (INT_MAX, INT_MAX, &result) + == (LONG_MAX / INT_MAX < INT_MAX)); + ASSERT (INT_MULTIPLY_WRAPV (INT_MAX, INT_MAX, &result) + || result == INT_MAX * (long int) INT_MAX); + ASSERT (INT_MULTIPLY_WRAPV (INT_MIN, INT_MIN, &result) + || result == INT_MIN * (long int) INT_MIN); + } + +# ifdef LLONG_MAX + { + long long int result; + ASSERT (INT_MULTIPLY_WRAPV (LONG_MAX, LONG_MAX, &result) + == (LLONG_MAX / LONG_MAX < LONG_MAX)); + ASSERT (INT_MULTIPLY_WRAPV (LONG_MAX, LONG_MAX, &result) + || result == LONG_MAX * (long long int) LONG_MAX); + ASSERT (INT_MULTIPLY_WRAPV (LONG_MIN, LONG_MIN, &result) + || result == LONG_MIN * (long long int) LONG_MIN); + } +# endif + + #define CHECK_QUOTIENT(a, b, v) VERIFY (INT_DIVIDE_OVERFLOW (a, b) == (v)) + + CHECK_QUOTIENT (INT_MIN, -1L, INT_MIN == LONG_MIN); + CHECK_QUOTIENT (INT_MIN, UINT_MAX, false); + CHECK_QUOTIENT (INTMAX_MIN, UINTMAX_MAX, false); + CHECK_QUOTIENT (INTMAX_MIN, UINT_MAX, false); + CHECK_QUOTIENT (-11, 10u, true); + CHECK_QUOTIENT (-10, 10u, true); + CHECK_QUOTIENT (-9, 10u, false); + CHECK_QUOTIENT (11u, -10, true); + CHECK_QUOTIENT (10u, -10, true); + CHECK_QUOTIENT (9u, -10, false); + + #define CHECK_REMAINDER(a, b, v) VERIFY (INT_REMAINDER_OVERFLOW (a, b) == (v)) + + CHECK_REMAINDER (INT_MIN, -1L, INT_MIN == LONG_MIN); + CHECK_REMAINDER (-1, UINT_MAX, true); + CHECK_REMAINDER ((intmax_t) -1, UINTMAX_MAX, true); + CHECK_REMAINDER (INTMAX_MIN, UINT_MAX, + (INTMAX_MAX < UINT_MAX + && - (unsigned int) INTMAX_MIN % UINT_MAX != 0)); + CHECK_REMAINDER (INT_MIN, ULONG_MAX, INT_MIN % ULONG_MAX != 1); + CHECK_REMAINDER (1u, -1, false); + CHECK_REMAINDER (37*39u, -39, false); + CHECK_REMAINDER (37*39u + 1, -39, true); + CHECK_REMAINDER (37*39u - 1, -39, true); + CHECK_REMAINDER (LONG_MAX, -INT_MAX, false); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-inttostr.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-inttostr.c new file mode 100644 index 0000000000..19c6d8a3d7 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-inttostr.c @@ -0,0 +1,94 @@ +/* Test inttostr functions, and incidentally, INT_BUFSIZE_BOUND + Copyright (C) 2010-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Jim Meyering. */ + +#include <config.h> + +#include "inttostr.h" +#include "intprops.h" +#include <inttypes.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "macros.h" + +#define STREQ(a, b) (strcmp (a, b) == 0) +#define IS_TIGHT(T) (_GL_SIGNED_TYPE_OR_EXPR (T) == TYPE_SIGNED (T)) +#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9) + +/* Verify that an inttostr function works as advertised. + Convert maximum and minimum (per-type, T) values using both snprintf -- + with a cast to intmax_t or uintmax_t -- and FN, and compare the + resulting strings. Use malloc for the inttostr buffer, so that if + we ever exceed the usually-tight INT_BUFSIZE_BOUND, tools like + valgrind will detect the failure. */ +#define CK(T, Fn) \ + do \ + { \ + char ref[100]; \ + char *buf = malloc (INT_BUFSIZE_BOUND (T)); \ + char const *p; \ + ASSERT (buf); \ + *buf = '\0'; \ + ASSERT \ + ((TYPE_SIGNED (T) \ + ? snprintf (ref, sizeof ref, "%jd", (intmax_t) TYPE_MINIMUM (T)) \ + : snprintf (ref, sizeof ref, "%ju", (uintmax_t) TYPE_MINIMUM (T))) \ + < sizeof ref); \ + ASSERT (STREQ ((p = Fn (TYPE_MINIMUM (T), buf)), ref)); \ + /* Ensure that INT_BUFSIZE_BOUND is tight for signed types. */ \ + ASSERT (! TYPE_SIGNED (T) || (p == buf && *p == '-')); \ + ASSERT \ + ((TYPE_SIGNED (T) \ + ? snprintf (ref, sizeof ref, "%jd", (intmax_t) TYPE_MAXIMUM (T)) \ + : snprintf (ref, sizeof ref, "%ju", (uintmax_t) TYPE_MAXIMUM (T))) \ + < sizeof ref); \ + ASSERT (STREQ ((p = Fn (TYPE_MAXIMUM (T), buf)), ref)); \ + /* For unsigned types, the bound is not always tight. */ \ + ASSERT (! IS_TIGHT (T) || TYPE_SIGNED (T) \ + || (p == buf && ISDIGIT (*p))); \ + free (buf); \ + } \ + while (0) + +int +main (void) +{ + size_t b_size = 2; + char *b = malloc (b_size); + ASSERT (b); + + /* Ideally we would rely on the snprintf-posix module, in which case + this guard would not be required, but due to limitations in gnulib's + implementation (see modules/snprintf-posix), we cannot. */ + if (snprintf (b, b_size, "%ju", (uintmax_t) 3) == 1 + && b[0] == '3' && b[1] == '\0') + { + CK (int, inttostr); + CK (unsigned int, uinttostr); + CK (off_t, offtostr); + CK (uintmax_t, umaxtostr); + CK (intmax_t, imaxtostr); + free (b); + return 0; + } + + /* snprintf doesn't accept %ju; skip this test. */ + free (b); + return 77; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-inttypes.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-inttypes.c new file mode 100644 index 0000000000..d6524c799c --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-inttypes.c @@ -0,0 +1,118 @@ +/* Test of <inttypes.h> substitute. + Copyright (C) 2006-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <inttypes.h> + +#include <stddef.h> + +/* Tests for macros supposed to be defined in inttypes.h. */ + +const char *k = /* implicit string concatenation */ +#ifdef INT8_MAX + PRId8 PRIi8 +#endif +#ifdef UINT8_MAX + PRIo8 PRIu8 PRIx8 PRIX8 +#endif +#ifdef INT16_MAX + PRId16 PRIi16 +#endif +#ifdef UINT16_MAX + PRIo16 PRIu16 PRIx16 PRIX16 +#endif +#ifdef INT32_MAX + PRId32 PRIi32 +#endif +#ifdef UINT32_MAX + PRIo32 PRIu32 PRIx32 PRIX32 +#endif +#ifdef INT64_MAX + PRId64 PRIi64 +#endif +#ifdef UINT64_MAX + PRIo64 PRIu64 PRIx64 PRIX64 +#endif + PRIdLEAST8 PRIiLEAST8 PRIoLEAST8 PRIuLEAST8 PRIxLEAST8 PRIXLEAST8 + PRIdLEAST16 PRIiLEAST16 PRIoLEAST16 PRIuLEAST16 PRIxLEAST16 PRIXLEAST16 + PRIdLEAST32 PRIiLEAST32 PRIoLEAST32 PRIuLEAST32 PRIxLEAST32 PRIXLEAST32 + PRIdLEAST64 PRIiLEAST64 + PRIoLEAST64 PRIuLEAST64 PRIxLEAST64 PRIXLEAST64 + PRIdFAST8 PRIiFAST8 PRIoFAST8 PRIuFAST8 PRIxFAST8 PRIXFAST8 + PRIdFAST16 PRIiFAST16 PRIoFAST16 PRIuFAST16 PRIxFAST16 PRIXFAST16 + PRIdFAST32 PRIiFAST32 PRIoFAST32 PRIuFAST32 PRIxFAST32 PRIXFAST32 + PRIdFAST64 PRIiFAST64 + PRIoFAST64 PRIuFAST64 PRIxFAST64 PRIXFAST64 + PRIdMAX PRIiMAX PRIoMAX PRIuMAX PRIxMAX PRIXMAX +#ifdef INTPTR_MAX + PRIdPTR PRIiPTR +#endif +#ifdef UINTPTR_MAX + PRIoPTR PRIuPTR PRIxPTR PRIXPTR +#endif + ; +const char *l = /* implicit string concatenation */ +#ifdef INT8_MAX + SCNd8 SCNi8 +#endif +#ifdef UINT8_MAX + SCNo8 SCNu8 SCNx8 +#endif +#ifdef INT16_MAX + SCNd16 SCNi16 +#endif +#ifdef UINT16_MAX + SCNo16 SCNu16 SCNx16 +#endif +#ifdef INT32_MAX + SCNd32 SCNi32 +#endif +#ifdef UINT32_MAX + SCNo32 SCNu32 SCNx32 +#endif +#ifdef INT64_MAX + SCNd64 SCNi64 +#endif +#ifdef UINT64_MAX + SCNo64 SCNu64 SCNx64 +#endif + SCNdLEAST8 SCNiLEAST8 SCNoLEAST8 SCNuLEAST8 SCNxLEAST8 + SCNdLEAST16 SCNiLEAST16 SCNoLEAST16 SCNuLEAST16 SCNxLEAST16 + SCNdLEAST32 SCNiLEAST32 SCNoLEAST32 SCNuLEAST32 SCNxLEAST32 + SCNdLEAST64 SCNiLEAST64 + SCNoLEAST64 SCNuLEAST64 SCNxLEAST64 + SCNdFAST8 SCNiFAST8 SCNoFAST8 SCNuFAST8 SCNxFAST8 + SCNdFAST16 SCNiFAST16 SCNoFAST16 SCNuFAST16 SCNxFAST16 + SCNdFAST32 SCNiFAST32 SCNoFAST32 SCNuFAST32 SCNxFAST32 + SCNdFAST64 SCNiFAST64 + SCNoFAST64 SCNuFAST64 SCNxFAST64 + SCNdMAX SCNiMAX SCNoMAX SCNuMAX SCNxMAX +#ifdef INTPTR_MAX + SCNdPTR SCNiPTR +#endif +#ifdef UINTPTR_MAX + SCNoPTR SCNuPTR SCNxPTR +#endif + ; + +int +main (void) +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-ioctl.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-ioctl.c new file mode 100644 index 0000000000..8709104681 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-ioctl.c @@ -0,0 +1,51 @@ +/* Test of ioctl() function. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <sys/ioctl.h> + +#include "signature.h" +SIGNATURE_CHECK (ioctl, int, (int, int, ...)); + +#include <errno.h> +#include <unistd.h> + +#include "macros.h" + +int +main (void) +{ +#ifdef FIONREAD + /* Test behaviour for invalid file descriptors. */ + { + int value; + errno = 0; + ASSERT (ioctl (-1, FIONREAD, &value) == -1); + ASSERT (errno == EBADF); + } + { + int value; + close (99); + errno = 0; + ASSERT (ioctl (99, FIONREAD, &value) == -1); + ASSERT (errno == EBADF); + } +#endif + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-isblank.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-isblank.c new file mode 100644 index 0000000000..54769dde70 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-isblank.c @@ -0,0 +1,50 @@ +/* Test of isblank() function. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2009. */ + +#include <config.h> + +#include <ctype.h> + +#include "signature.h" +SIGNATURE_CHECK (isblank, int, (int)); + +#include <limits.h> +#include <stdio.h> + +#include "macros.h" + +int +main (int argc, char *argv[]) +{ + unsigned int c; + + /* Verify the property in the "C" locale. + POSIX specifies in + <http://www.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html> + that + - in all locales, the blank characters include the <space> and <tab> + characters, + - in the "POSIX" locale (which is usually the same as the "C" locale), + the blank characters include only the ASCII <space> and <tab> + characters. */ + for (c = 0; c <= UCHAR_MAX; c++) + ASSERT (!isblank (c) == !(c == ' ' || c == '\t')); + ASSERT (!isblank (EOF)); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-iswblank.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-iswblank.c new file mode 100644 index 0000000000..9175f0c7e0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-iswblank.c @@ -0,0 +1,35 @@ +/* Test of iswblank() function. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <wctype.h> + +#include "macros.h" + +/* Check that WEOF is defined. */ +wint_t e = WEOF; + +int +main (void) +{ + /* Check that the function exist as a function or as a macro. */ + (void) iswblank (0); + /* Check that the isw* functions map WEOF to 0. */ + ASSERT (!iswblank (e)); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-langinfo.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-langinfo.c new file mode 100644 index 0000000000..f1c9429074 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-langinfo.c @@ -0,0 +1,92 @@ +/* Test of <langinfo.h> substitute. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2009. */ + +#include <config.h> + +#include <langinfo.h> + +/* Check that all the nl_item values are defined. */ +int items[] = + { + /* nl_langinfo items of the LC_CTYPE category */ + CODESET, + /* nl_langinfo items of the LC_NUMERIC category */ + RADIXCHAR, + THOUSEP, + /* nl_langinfo items of the LC_TIME category */ + D_T_FMT, + D_FMT, + T_FMT, + T_FMT_AMPM, + AM_STR, + PM_STR, + DAY_1, + DAY_2, + DAY_3, + DAY_4, + DAY_5, + DAY_6, + DAY_7, + ABDAY_1, + ABDAY_2, + ABDAY_3, + ABDAY_4, + ABDAY_5, + ABDAY_6, + ABDAY_7, + MON_1, + MON_2, + MON_3, + MON_4, + MON_5, + MON_6, + MON_7, + MON_8, + MON_9, + MON_10, + MON_11, + MON_12, + ABMON_1, + ABMON_2, + ABMON_3, + ABMON_4, + ABMON_5, + ABMON_6, + ABMON_7, + ABMON_8, + ABMON_9, + ABMON_10, + ABMON_11, + ABMON_12, + ERA, + ERA_D_FMT, + ERA_D_T_FMT, + ERA_T_FMT, + ALT_DIGITS, + /* nl_langinfo items of the LC_MONETARY category */ + CRNCYSTR, + /* nl_langinfo items of the LC_MESSAGES category */ + YESEXPR, + NOEXPR + }; + +int +main (void) +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-limits-h.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-limits-h.c new file mode 100644 index 0000000000..15a291f9fc --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-limits-h.c @@ -0,0 +1,50 @@ +/* Test of <limits.h> substitute. + Copyright 2016-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +#include <config.h> + +#include <limits.h> + +#include "verify.h" + +#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__) +# pragma GCC diagnostic ignored "-Woverlength-strings" +#endif + +/* Macros specified by ISO/IEC TS 18661-1:2014. */ + +#define verify_width(width, min, max) \ + verify ((max) >> ((width) - 1 - ((min) < 0)) == 1) + +verify_width (CHAR_WIDTH, CHAR_MIN, CHAR_MAX); +verify_width (SCHAR_WIDTH, SCHAR_MIN, SCHAR_MAX); +verify_width (UCHAR_WIDTH, 0, UCHAR_MAX); +verify_width (SHRT_WIDTH, SHRT_MIN, SHRT_MAX); +verify_width (USHRT_WIDTH, 0, USHRT_MAX); +verify_width (INT_WIDTH, INT_MIN, INT_MAX); +verify_width (UINT_WIDTH, 0, UINT_MAX); +verify_width (LONG_WIDTH, LONG_MIN, LONG_MAX); +verify_width (ULONG_WIDTH, 0, ULONG_MAX); +verify_width (LLONG_WIDTH, LLONG_MIN, LLONG_MAX); +verify_width (ULLONG_WIDTH, 0, ULLONG_MAX); + +int +main (void) +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-listen.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-listen.c new file mode 100644 index 0000000000..e67b3b6e71 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-listen.c @@ -0,0 +1,49 @@ +/* Test listen() function. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <sys/socket.h> + +#include "signature.h" +SIGNATURE_CHECK (listen, int, (int, int)); + +#include <errno.h> +#include <unistd.h> + +#include "sockets.h" +#include "macros.h" + +int +main (void) +{ + (void) gl_sockets_startup (SOCKETS_1_1); + + /* Test behaviour for invalid file descriptors. */ + { + errno = 0; + ASSERT (listen (-1, 1) == -1); + ASSERT (errno == EBADF); + } + { + close (99); + errno = 0; + ASSERT (listen (99 ,1) == -1); + ASSERT (errno == EBADF); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-locale.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-locale.c new file mode 100644 index 0000000000..749adf388e --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-locale.c @@ -0,0 +1,80 @@ +/* Test of <locale.h> substitute. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <locale.h> + +#include "verify.h" + +int a[] = + { + LC_ALL, + LC_COLLATE, + LC_CTYPE, + LC_MESSAGES, + LC_MONETARY, + LC_NUMERIC, + LC_TIME + }; + +/* Check that the 'struct lconv' type is defined. */ +struct lconv l; +int ls; + +/* Check that NULL can be passed through varargs as a pointer type, + per POSIX 2008. */ +verify (sizeof NULL == sizeof (void *)); + +int +main () +{ +#if HAVE_NEWLOCALE + /* Check that the locale_t type and the LC_GLOBAL_LOCALE macro are defined. */ + locale_t b = LC_GLOBAL_LOCALE; + (void) b; +#endif + + /* Check that 'struct lconv' has the ISO C and POSIX specified members. */ + ls += sizeof (*l.decimal_point); + ls += sizeof (*l.thousands_sep); + ls += sizeof (*l.grouping); + ls += sizeof (*l.mon_decimal_point); + ls += sizeof (*l.mon_thousands_sep); + ls += sizeof (*l.mon_grouping); + ls += sizeof (*l.positive_sign); + ls += sizeof (*l.negative_sign); + ls += sizeof (*l.currency_symbol); + ls += sizeof (l.frac_digits); + ls += sizeof (l.p_cs_precedes); + ls += sizeof (l.p_sign_posn); + ls += sizeof (l.p_sep_by_space); + ls += sizeof (l.n_cs_precedes); + ls += sizeof (l.n_sign_posn); + ls += sizeof (l.n_sep_by_space); + ls += sizeof (*l.int_curr_symbol); + ls += sizeof (l.int_frac_digits); + ls += sizeof (l.int_p_cs_precedes); + ls += sizeof (l.int_p_sign_posn); + ls += sizeof (l.int_p_sep_by_space); + ls += sizeof (l.int_n_cs_precedes); + ls += sizeof (l.int_n_sign_posn); + ls += sizeof (l.int_n_sep_by_space); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-localeconv.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-localeconv.c new file mode 100644 index 0000000000..2fb5c41964 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-localeconv.c @@ -0,0 +1,72 @@ +/* Test of localeconv() function. + Copyright (C) 2012-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2012. */ + +#include <config.h> + +#include <locale.h> + +#include "signature.h" +SIGNATURE_CHECK (localeconv, struct lconv *, (void)); + +#include <limits.h> +#include <string.h> + +#include "macros.h" + +int +main () +{ + /* Test localeconv() result in the "C" locale. */ + { + struct lconv *l = localeconv (); + + ASSERT (STREQ (l->decimal_point, ".")); + ASSERT (STREQ (l->thousands_sep, "")); +#if !((defined __FreeBSD__ || defined __DragonFly__) || defined __sun) + ASSERT (STREQ (l->grouping, "")); +#endif + + ASSERT (STREQ (l->mon_decimal_point, "")); + ASSERT (STREQ (l->mon_thousands_sep, "")); +#if !((defined __FreeBSD__ || defined __DragonFly__) || defined __sun) + ASSERT (STREQ (l->mon_grouping, "")); +#endif + ASSERT (STREQ (l->positive_sign, "")); + ASSERT (STREQ (l->negative_sign, "")); + + ASSERT (STREQ (l->currency_symbol, "")); + ASSERT (l->frac_digits == CHAR_MAX); + ASSERT (l->p_cs_precedes == CHAR_MAX); + ASSERT (l->p_sign_posn == CHAR_MAX); + ASSERT (l->p_sep_by_space == CHAR_MAX); + ASSERT (l->n_cs_precedes == CHAR_MAX); + ASSERT (l->n_sign_posn == CHAR_MAX); + ASSERT (l->n_sep_by_space == CHAR_MAX); + + ASSERT (STREQ (l->int_curr_symbol, "")); + ASSERT (l->int_frac_digits == CHAR_MAX); + ASSERT (l->int_p_cs_precedes == CHAR_MAX); + ASSERT (l->int_p_sign_posn == CHAR_MAX); + ASSERT (l->int_p_sep_by_space == CHAR_MAX); + ASSERT (l->int_n_cs_precedes == CHAR_MAX); + ASSERT (l->int_n_sign_posn == CHAR_MAX); + ASSERT (l->int_n_sep_by_space == CHAR_MAX); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-lstat.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-lstat.c new file mode 100644 index 0000000000..20e83a6f0e --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-lstat.c @@ -0,0 +1,60 @@ +/* Test of lstat() function. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Simon Josefsson, 2008; and Eric Blake, 2009. */ + +#include <config.h> + +#include <sys/stat.h> + +/* Caution: lstat may be a function-like macro. Although this + signature check must pass, it may be the signature of the real (and + broken) lstat rather than rpl_lstat. Most code should not use the + address of lstat. */ +#include "signature.h" +SIGNATURE_CHECK (lstat, int, (char const *, struct stat *)); + +#include <fcntl.h> +#include <errno.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + +#include "same-inode.h" +#include "ignore-value.h" +#include "macros.h" + +#define BASE "test-lstat.t" + +#include "test-lstat.h" + +/* Wrapper around lstat, which works even if lstat is a function-like + macro, where test_lstat_func(lstat) would do the wrong thing. */ +static int +do_lstat (char const *name, struct stat *st) +{ + return lstat (name, st); +} + +int +main (void) +{ + /* Remove any leftovers from a previous partial run. */ + ignore_value (system ("rm -rf " BASE "*")); + + return test_lstat_func (do_lstat, true); +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-lstat.h b/local/recipes/tools/diffutils/source/gnulib-tests/test-lstat.h new file mode 100644 index 0000000000..b5815f6950 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-lstat.h @@ -0,0 +1,116 @@ +/* Test of lstat() function. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Simon Josefsson, 2008; and Eric Blake, 2009. */ + +/* This file is designed to test both lstat(n,buf) and + fstatat(AT_FDCWD,n,buf,AT_SYMLINK_NOFOLLOW). FUNC is the function + to test. Assumes that BASE and ASSERT are already defined, and + that appropriate headers are already included. If PRINT, warn + before skipping symlink tests with status 77. */ + +static int +test_lstat_func (int (*func) (char const *, struct stat *), bool print) +{ + struct stat st1; + struct stat st2; + + /* Test for common directories. */ + ASSERT (func (".", &st1) == 0); + ASSERT (func ("./", &st2) == 0); + ASSERT (SAME_INODE (st1, st2)); + ASSERT (S_ISDIR (st1.st_mode)); + ASSERT (S_ISDIR (st2.st_mode)); + ASSERT (func ("/", &st1) == 0); + ASSERT (func ("///", &st2) == 0); + ASSERT (SAME_INODE (st1, st2)); + ASSERT (S_ISDIR (st1.st_mode)); + ASSERT (S_ISDIR (st2.st_mode)); + ASSERT (func ("..", &st1) == 0); + ASSERT (S_ISDIR (st1.st_mode)); + + /* Test for error conditions. */ + errno = 0; + ASSERT (func ("", &st1) == -1); + ASSERT (errno == ENOENT); + errno = 0; + ASSERT (func ("nosuch", &st1) == -1); + ASSERT (errno == ENOENT); + errno = 0; + ASSERT (func ("nosuch/", &st1) == -1); + ASSERT (errno == ENOENT); + + ASSERT (close (creat (BASE "file", 0600)) == 0); + ASSERT (func (BASE "file", &st1) == 0); + ASSERT (S_ISREG (st1.st_mode)); + errno = 0; + ASSERT (func (BASE "file/", &st1) == -1); + ASSERT (errno == ENOTDIR); + + /* Now for some symlink tests, where supported. We set up: + link1 -> directory + link2 -> file + link3 -> dangling + link4 -> loop + then test behavior both with and without trailing slash. + */ + if (symlink (".", BASE "link1") != 0) + { + ASSERT (unlink (BASE "file") == 0); + if (print) + fputs ("skipping test: symlinks not supported on this file system\n", + stderr); + return 77; + } + ASSERT (symlink (BASE "file", BASE "link2") == 0); + ASSERT (symlink (BASE "nosuch", BASE "link3") == 0); + ASSERT (symlink (BASE "link4", BASE "link4") == 0); + + ASSERT (func (BASE "link1", &st1) == 0); + ASSERT (S_ISLNK (st1.st_mode)); + ASSERT (func (BASE "link1/", &st1) == 0); + ASSERT (stat (BASE "link1", &st2) == 0); + ASSERT (S_ISDIR (st1.st_mode)); + ASSERT (S_ISDIR (st2.st_mode)); + ASSERT (SAME_INODE (st1, st2)); + + ASSERT (func (BASE "link2", &st1) == 0); + ASSERT (S_ISLNK (st1.st_mode)); + errno = 0; + ASSERT (func (BASE "link2/", &st1) == -1); + ASSERT (errno == ENOTDIR); + + ASSERT (func (BASE "link3", &st1) == 0); + ASSERT (S_ISLNK (st1.st_mode)); + errno = 0; + ASSERT (func (BASE "link3/", &st1) == -1); + ASSERT (errno == ENOENT); + + ASSERT (func (BASE "link4", &st1) == 0); + ASSERT (S_ISLNK (st1.st_mode)); + errno = 0; + ASSERT (func (BASE "link4/", &st1) == -1); + ASSERT (errno == ELOOP); + + /* Cleanup. */ + ASSERT (unlink (BASE "file") == 0); + ASSERT (unlink (BASE "link1") == 0); + ASSERT (unlink (BASE "link2") == 0); + ASSERT (unlink (BASE "link3") == 0); + ASSERT (unlink (BASE "link4") == 0); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-malloca.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-malloca.c new file mode 100644 index 0000000000..11f0f7929f --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-malloca.c @@ -0,0 +1,62 @@ +/* Test of safe automatic memory allocation. + Copyright (C) 2005, 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2005. */ + +#include <config.h> + +#include "malloca.h" + +#include <stdlib.h> + +static void +do_allocation (int n) +{ + void *ptr = malloca (n); + freea (ptr); + safe_alloca (n); +} + +void (*func) (int) = do_allocation; + +int +main () +{ + int i; + + /* This slows down malloc a lot. */ + unsetenv ("MALLOC_PERTURB_"); + + /* Repeat a lot of times, to make sure there's no memory leak. */ + for (i = 0; i < 50000; i++) + { + /* Try various values. + n = 0 gave a crash on Alpha with gcc-2.5.8. + Some versions of Mac OS X have a stack size limit of 512 KB. */ + func (34); + func (134); + func (399); + func (510823); + func (129321); + func (0); + func (4070); + func (4095); + func (1); + func (16582); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc-w32-1.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc-w32-1.sh new file mode 100755 index 0000000000..3f12e44e19 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc-w32-1.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Test a CP1252 locale. +./test-mbrtowc-w32${EXEEXT} French_France 1252 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc-w32-2.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc-w32-2.sh new file mode 100755 index 0000000000..9e1a7650d5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc-w32-2.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Test a CP1256 locale. +./test-mbrtowc-w32${EXEEXT} "Arabic_Saudi Arabia" 1256 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc-w32-3.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc-w32-3.sh new file mode 100755 index 0000000000..782c2d07ee --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc-w32-3.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Test a CP932 locale. +./test-mbrtowc-w32${EXEEXT} Japanese_Japan 932 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc-w32-4.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc-w32-4.sh new file mode 100755 index 0000000000..0630f30173 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc-w32-4.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Test a CP950 locale. +./test-mbrtowc-w32${EXEEXT} Chinese_Taiwan 950 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc-w32-5.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc-w32-5.sh new file mode 100755 index 0000000000..7d7faa9ab6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc-w32-5.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Test a CP936 locale. +./test-mbrtowc-w32${EXEEXT} Chinese_China 936 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc-w32.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc-w32.c new file mode 100644 index 0000000000..70afc87f46 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc-w32.c @@ -0,0 +1,729 @@ +/* Test of conversion of multibyte character to wide character. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <wchar.h> + +#include <errno.h> +#include <locale.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "macros.h" + +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + +static int +test_one_locale (const char *name, int codepage) +{ + mbstate_t state; + wchar_t wc; + size_t ret; + +# if 1 + /* Portable code to set the locale. */ + { + char name_with_codepage[1024]; + + sprintf (name_with_codepage, "%s.%d", name, codepage); + + /* Set the locale. */ + if (setlocale (LC_ALL, name_with_codepage) == NULL) + return 77; + } +# else + /* Hacky way to set a locale.codepage combination that setlocale() refuses + to set. */ + { + /* Codepage of the current locale, set with setlocale(). + Not necessarily the same as GetACP(). */ + extern __declspec(dllimport) unsigned int __lc_codepage; + + /* Set the locale. */ + if (setlocale (LC_ALL, name) == NULL) + return 77; + + /* Clobber the codepage and MB_CUR_MAX, both set by setlocale(). */ + __lc_codepage = codepage; + switch (codepage) + { + case 1252: + case 1256: + MB_CUR_MAX = 1; + break; + case 932: + case 950: + case 936: + MB_CUR_MAX = 2; + break; + case 54936: + case 65001: + MB_CUR_MAX = 4; + break; + } + + /* Test whether the codepage is really available. */ + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, " ", 1, &state) == (size_t)(-1)) + return 77; + } +# endif + + /* Test zero-length input. */ + { + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "x", 0, &state); + /* gnulib's implementation returns (size_t)(-2). + The AIX 5.1 implementation returns (size_t)(-1). + glibc's implementation returns 0. */ + ASSERT (ret == (size_t)(-2) || ret == (size_t)(-1) || ret == 0); + ASSERT (mbsinit (&state)); + } + + /* Test NUL byte input. */ + { + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "", 1, &state); + ASSERT (ret == 0); + ASSERT (wc == 0); + ASSERT (mbsinit (&state)); + ret = mbrtowc (NULL, "", 1, &state); + ASSERT (ret == 0); + ASSERT (mbsinit (&state)); + } + + /* Test single-byte input. */ + { + int c; + char buf[1]; + + memset (&state, '\0', sizeof (mbstate_t)); + for (c = 0; c < 0x100; c++) + switch (c) + { + case '\t': case '\v': case '\f': + case ' ': case '!': case '"': case '#': case '%': + case '&': case '\'': case '(': case ')': case '*': + case '+': case ',': case '-': case '.': case '/': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + case ':': case ';': case '<': case '=': case '>': + case '?': + case 'A': case 'B': case 'C': case 'D': case 'E': + case 'F': case 'G': case 'H': case 'I': case 'J': + case 'K': case 'L': case 'M': case 'N': case 'O': + case 'P': case 'Q': case 'R': case 'S': case 'T': + case 'U': case 'V': case 'W': case 'X': case 'Y': + case 'Z': + case '[': case '\\': case ']': case '^': case '_': + case 'a': case 'b': case 'c': case 'd': case 'e': + case 'f': case 'g': case 'h': case 'i': case 'j': + case 'k': case 'l': case 'm': case 'n': case 'o': + case 'p': case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'y': + case 'z': case '{': case '|': case '}': case '~': + /* c is in the ISO C "basic character set". */ + buf[0] = c; + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, buf, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == c); + ASSERT (mbsinit (&state)); + ret = mbrtowc (NULL, buf, 1, &state); + ASSERT (ret == 1); + ASSERT (mbsinit (&state)); + break; + } + } + + /* Test special calling convention, passing a NULL pointer. */ + { + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, NULL, 5, &state); + ASSERT (ret == 0); + ASSERT (wc == (wchar_t) 0xBADFACE); + ASSERT (mbsinit (&state)); + } + + switch (codepage) + { + case 1252: + /* Locale encoding is CP1252, an extension of ISO-8859-1. */ + { + char input[] = "B\374\337er"; /* "Büßer" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'B'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 1, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == (unsigned char) '\374'); + ASSERT (wc == 0x00FC); + ASSERT (mbsinit (&state)); + input[1] = '\0'; + + /* Test support of NULL first argument. */ + ret = mbrtowc (NULL, input + 2, 3, &state); + ASSERT (ret == 1); + ASSERT (mbsinit (&state)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 2, 3, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == (unsigned char) '\337'); + ASSERT (wc == 0x00DF); + ASSERT (mbsinit (&state)); + input[2] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 3, 2, &state); + ASSERT (ret == 1); + ASSERT (wc == 'e'); + ASSERT (mbsinit (&state)); + input[3] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 4, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'r'); + ASSERT (mbsinit (&state)); + } + return 0; + + case 1256: + /* Locale encoding is CP1256, not the same as ISO-8859-6. */ + { + char input[] = "x\302\341\346y"; /* "xآلوy" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'x'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 1, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == (unsigned char) '\302'); + ASSERT (wc == 0x0622); + ASSERT (mbsinit (&state)); + input[1] = '\0'; + + /* Test support of NULL first argument. */ + ret = mbrtowc (NULL, input + 2, 3, &state); + ASSERT (ret == 1); + ASSERT (mbsinit (&state)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 2, 3, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == (unsigned char) '\341'); + ASSERT (wc == 0x0644); + ASSERT (mbsinit (&state)); + input[2] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 3, 2, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == (unsigned char) '\346'); + ASSERT (wc == 0x0648); + ASSERT (mbsinit (&state)); + input[3] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 4, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'y'); + ASSERT (mbsinit (&state)); + } + return 0; + + case 932: + /* Locale encoding is CP932, similar to Shift_JIS. */ + { + char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == '<'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 2, &state); + ASSERT (ret == 2); + ASSERT (wctob (wc) == EOF); + ASSERT (wc == 0x65E5); + ASSERT (mbsinit (&state)); + input[1] = '\0'; + input[2] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 3, 1, &state); + ASSERT (ret == (size_t)(-2)); + ASSERT (wc == (wchar_t) 0xBADFACE); + ASSERT (!mbsinit (&state)); + input[3] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 4, 4, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == EOF); + ASSERT (wc == 0x672C); + ASSERT (mbsinit (&state)); + input[4] = '\0'; + + /* Test support of NULL first argument. */ + ret = mbrtowc (NULL, input + 5, 3, &state); + ASSERT (ret == 2); + ASSERT (mbsinit (&state)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 5, 3, &state); + ASSERT (ret == 2); + ASSERT (wctob (wc) == EOF); + ASSERT (wc == 0x8A9E); + ASSERT (mbsinit (&state)); + input[5] = '\0'; + input[6] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 7, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == '>'); + ASSERT (mbsinit (&state)); + + /* Test some invalid input. */ + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\377", 1, &state); /* 0xFF */ + ASSERT ((ret == (size_t)-1 && errno == EILSEQ) || ret == (size_t)-2); + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\225\377", 2, &state); /* 0x95 0xFF */ + ASSERT ((ret == (size_t)-1 && errno == EILSEQ) || (ret == 2 && wc == 0x30FB)); + } + return 0; + + case 950: + /* Locale encoding is CP950, similar to Big5. */ + { + char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == '<'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 2, &state); + ASSERT (ret == 2); + ASSERT (wctob (wc) == EOF); + ASSERT (wc == 0x65E5); + ASSERT (mbsinit (&state)); + input[1] = '\0'; + input[2] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 3, 1, &state); + ASSERT (ret == (size_t)(-2)); + ASSERT (wc == (wchar_t) 0xBADFACE); + ASSERT (!mbsinit (&state)); + input[3] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 4, 4, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == EOF); + ASSERT (wc == 0x672C); + ASSERT (mbsinit (&state)); + input[4] = '\0'; + + /* Test support of NULL first argument. */ + ret = mbrtowc (NULL, input + 5, 3, &state); + ASSERT (ret == 2); + ASSERT (mbsinit (&state)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 5, 3, &state); + ASSERT (ret == 2); + ASSERT (wctob (wc) == EOF); + ASSERT (wc == 0x8A9E); + ASSERT (mbsinit (&state)); + input[5] = '\0'; + input[6] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 7, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == '>'); + ASSERT (mbsinit (&state)); + + /* Test some invalid input. */ + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\377", 1, &state); /* 0xFF */ + ASSERT ((ret == (size_t)-1 && errno == EILSEQ) || ret == (size_t)-2); + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\225\377", 2, &state); /* 0x95 0xFF */ + ASSERT ((ret == (size_t)-1 && errno == EILSEQ) || (ret == 2 && wc == '?')); + } + return 0; + + case 936: + /* Locale encoding is CP936 = GBK, an extension of GB2312. */ + { + char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == '<'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 2, &state); + ASSERT (ret == 2); + ASSERT (wctob (wc) == EOF); + ASSERT (wc == 0x65E5); + ASSERT (mbsinit (&state)); + input[1] = '\0'; + input[2] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 3, 1, &state); + ASSERT (ret == (size_t)(-2)); + ASSERT (wc == (wchar_t) 0xBADFACE); + ASSERT (!mbsinit (&state)); + input[3] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 4, 4, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == EOF); + ASSERT (wc == 0x672C); + ASSERT (mbsinit (&state)); + input[4] = '\0'; + + /* Test support of NULL first argument. */ + ret = mbrtowc (NULL, input + 5, 3, &state); + ASSERT (ret == 2); + ASSERT (mbsinit (&state)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 5, 3, &state); + ASSERT (ret == 2); + ASSERT (wctob (wc) == EOF); + ASSERT (wc == 0x8A9E); + ASSERT (mbsinit (&state)); + input[5] = '\0'; + input[6] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 7, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == '>'); + ASSERT (mbsinit (&state)); + + /* Test some invalid input. */ + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\377", 1, &state); /* 0xFF */ + ASSERT ((ret == (size_t)-1 && errno == EILSEQ) || ret == (size_t)-2); + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\225\377", 2, &state); /* 0x95 0xFF */ + ASSERT ((ret == (size_t)-1 && errno == EILSEQ) || (ret == 2 && wc == '?')); + } + return 0; + + case 54936: + /* Locale encoding is CP54936 = GB18030. */ + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'B'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 1, &state); + ASSERT (ret == (size_t)(-2)); + ASSERT (wc == (wchar_t) 0xBADFACE); + ASSERT (!mbsinit (&state)); + input[1] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 2, 7, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == EOF); + ASSERT (wc == 0x00FC); + ASSERT (mbsinit (&state)); + input[2] = '\0'; + + /* Test support of NULL first argument. */ + ret = mbrtowc (NULL, input + 3, 6, &state); + ASSERT (ret == 4); + ASSERT (mbsinit (&state)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 3, 6, &state); + ASSERT (ret == 4); + ASSERT (wctob (wc) == EOF); + ASSERT (wc == 0x00DF); + ASSERT (mbsinit (&state)); + input[3] = '\0'; + input[4] = '\0'; + input[5] = '\0'; + input[6] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 7, 2, &state); + ASSERT (ret == 1); + ASSERT (wc == 'e'); + ASSERT (mbsinit (&state)); + input[5] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 8, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'r'); + ASSERT (mbsinit (&state)); + + /* Test some invalid input. */ + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\377", 1, &state); /* 0xFF */ + ASSERT (ret == (size_t)-1); + ASSERT (errno == EILSEQ); + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\225\377", 2, &state); /* 0x95 0xFF */ + ASSERT (ret == (size_t)-1); + ASSERT (errno == EILSEQ); + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\201\045", 2, &state); /* 0x81 0x25 */ + ASSERT (ret == (size_t)-1); + ASSERT (errno == EILSEQ); + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\201\060\377", 3, &state); /* 0x81 0x30 0xFF */ + ASSERT (ret == (size_t)-1); + ASSERT (errno == EILSEQ); + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\201\060\377\064", 4, &state); /* 0x81 0x30 0xFF 0x34 */ + ASSERT (ret == (size_t)-1); + ASSERT (errno == EILSEQ); + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\201\060\211\072", 4, &state); /* 0x81 0x30 0x89 0x3A */ + ASSERT (ret == (size_t)-1); + ASSERT (errno == EILSEQ); + } + return 0; + + case 65001: + /* Locale encoding is CP65001 = UTF-8. */ + { + char input[] = "B\303\274\303\237er"; /* "Büßer" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'B'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 1, &state); + ASSERT (ret == (size_t)(-2)); + ASSERT (wc == (wchar_t) 0xBADFACE); + ASSERT (!mbsinit (&state)); + input[1] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 2, 5, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == EOF); + ASSERT (wc == 0x00FC); + ASSERT (mbsinit (&state)); + input[2] = '\0'; + + /* Test support of NULL first argument. */ + ret = mbrtowc (NULL, input + 3, 4, &state); + ASSERT (ret == 2); + ASSERT (mbsinit (&state)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 3, 4, &state); + ASSERT (ret == 2); + ASSERT (wctob (wc) == EOF); + ASSERT (wc == 0x00DF); + ASSERT (mbsinit (&state)); + input[3] = '\0'; + input[4] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 5, 2, &state); + ASSERT (ret == 1); + ASSERT (wc == 'e'); + ASSERT (mbsinit (&state)); + input[5] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 6, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'r'); + ASSERT (mbsinit (&state)); + + /* Test some invalid input. */ + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\377", 1, &state); /* 0xFF */ + ASSERT (ret == (size_t)-1); + ASSERT (errno == EILSEQ); + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\303\300", 2, &state); /* 0xC3 0xC0 */ + ASSERT (ret == (size_t)-1); + ASSERT (errno == EILSEQ); + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\343\300", 2, &state); /* 0xE3 0xC0 */ + ASSERT (ret == (size_t)-1); + ASSERT (errno == EILSEQ); + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\343\300\200", 3, &state); /* 0xE3 0xC0 0x80 */ + ASSERT (ret == (size_t)-1); + ASSERT (errno == EILSEQ); + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\343\200\300", 3, &state); /* 0xE3 0x80 0xC0 */ + ASSERT (ret == (size_t)-1); + ASSERT (errno == EILSEQ); + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\363\300", 2, &state); /* 0xF3 0xC0 */ + ASSERT (ret == (size_t)-1); + ASSERT (errno == EILSEQ); + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\363\300\200\200", 4, &state); /* 0xF3 0xC0 0x80 0x80 */ + ASSERT (ret == (size_t)-1); + ASSERT (errno == EILSEQ); + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\363\200\300", 3, &state); /* 0xF3 0x80 0xC0 */ + ASSERT (ret == (size_t)-1); + ASSERT (errno == EILSEQ); + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\363\200\300\200", 4, &state); /* 0xF3 0x80 0xC0 0x80 */ + ASSERT (ret == (size_t)-1); + ASSERT (errno == EILSEQ); + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "\363\200\200\300", 4, &state); /* 0xF3 0x80 0x80 0xC0 */ + ASSERT (ret == (size_t)-1); + ASSERT (errno == EILSEQ); + } + return 0; + + default: + return 1; + } +} + +int +main (int argc, char *argv[]) +{ + int codepage = atoi (argv[argc - 1]); + int result; + int i; + + result = 77; + for (i = 1; i < argc - 1; i++) + { + int ret = test_one_locale (argv[i], codepage); + + if (ret != 77) + result = ret; + } + + if (result == 77) + { + fprintf (stderr, "Skipping test: found no locale with codepage %d\n", + codepage); + } + return result; +} + +#else + +int +main (int argc, char *argv[]) +{ + fputs ("Skipping test: not a native Windows system\n", stderr); + return 77; +} + +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc.c new file mode 100644 index 0000000000..70c8a2a6bf --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc.c @@ -0,0 +1,349 @@ +/* Test of conversion of multibyte character to wide character. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <wchar.h> + +#include "signature.h" +SIGNATURE_CHECK (mbrtowc, size_t, (wchar_t *, char const *, size_t, + mbstate_t *)); + +#include <locale.h> +#include <stdio.h> +#include <string.h> + +#include "macros.h" + +int +main (int argc, char *argv[]) +{ + mbstate_t state; + wchar_t wc; + size_t ret; + + /* configure should already have checked that the locale is supported. */ + if (setlocale (LC_ALL, "") == NULL) + return 1; + + /* Test zero-length input. */ + { + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "x", 0, &state); + ASSERT (ret == (size_t)(-2)); + ASSERT (mbsinit (&state)); + } + + /* Test NUL byte input. */ + { + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "", 1, &state); + ASSERT (ret == 0); + ASSERT (wc == 0); + ASSERT (mbsinit (&state)); + ret = mbrtowc (NULL, "", 1, &state); + ASSERT (ret == 0); + ASSERT (mbsinit (&state)); + } + + /* Test single-byte input. */ + { + int c; + char buf[1]; + + memset (&state, '\0', sizeof (mbstate_t)); + for (c = 0; c < 0x100; c++) + switch (c) + { + default: + if (! (c && 1 < argc && argv[1][0] == '5')) + break; + FALLTHROUGH; + case '\t': case '\v': case '\f': + case ' ': case '!': case '"': case '#': case '%': + case '&': case '\'': case '(': case ')': case '*': + case '+': case ',': case '-': case '.': case '/': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + case ':': case ';': case '<': case '=': case '>': + case '?': + case 'A': case 'B': case 'C': case 'D': case 'E': + case 'F': case 'G': case 'H': case 'I': case 'J': + case 'K': case 'L': case 'M': case 'N': case 'O': + case 'P': case 'Q': case 'R': case 'S': case 'T': + case 'U': case 'V': case 'W': case 'X': case 'Y': + case 'Z': + case '[': case '\\': case ']': case '^': case '_': + case 'a': case 'b': case 'c': case 'd': case 'e': + case 'f': case 'g': case 'h': case 'i': case 'j': + case 'k': case 'l': case 'm': case 'n': case 'o': + case 'p': case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'y': + case 'z': case '{': case '|': case '}': case '~': + /* c is in the ISO C "basic character set", or argv[1] starts + with '5' so we are testing all nonnull bytes. */ + buf[0] = c; + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, buf, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == c); + ASSERT (mbsinit (&state)); + ret = mbrtowc (NULL, buf, 1, &state); + ASSERT (ret == 1); + ASSERT (mbsinit (&state)); + break; + } + } + + /* Test special calling convention, passing a NULL pointer. */ + { + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, NULL, 5, &state); + ASSERT (ret == 0); + ASSERT (wc == (wchar_t) 0xBADFACE); + ASSERT (mbsinit (&state)); + } + + if (argc > 1) + switch (argv[1][0]) + { + case '1': + /* Locale encoding is ISO-8859-1 or ISO-8859-15. */ + { + char input[] = "B\374\337er"; /* "Büßer" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'B'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 1, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == (unsigned char) '\374'); + ASSERT (mbsinit (&state)); + input[1] = '\0'; + + /* Test support of NULL first argument. */ + ret = mbrtowc (NULL, input + 2, 3, &state); + ASSERT (ret == 1); + ASSERT (mbsinit (&state)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 2, 3, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == (unsigned char) '\337'); + ASSERT (mbsinit (&state)); + input[2] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 3, 2, &state); + ASSERT (ret == 1); + ASSERT (wc == 'e'); + ASSERT (mbsinit (&state)); + input[3] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 4, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'r'); + ASSERT (mbsinit (&state)); + } + return 0; + + case '2': + /* Locale encoding is UTF-8. */ + { + char input[] = "B\303\274\303\237er"; /* "Büßer" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'B'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 1, &state); + ASSERT (ret == (size_t)(-2)); + ASSERT (wc == (wchar_t) 0xBADFACE); + ASSERT (!mbsinit (&state)); + input[1] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 2, 5, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == EOF); + ASSERT (mbsinit (&state)); + input[2] = '\0'; + + /* Test support of NULL first argument. */ + ret = mbrtowc (NULL, input + 3, 4, &state); + ASSERT (ret == 2); + ASSERT (mbsinit (&state)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 3, 4, &state); + ASSERT (ret == 2); + ASSERT (wctob (wc) == EOF); + ASSERT (mbsinit (&state)); + input[3] = '\0'; + input[4] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 5, 2, &state); + ASSERT (ret == 1); + ASSERT (wc == 'e'); + ASSERT (mbsinit (&state)); + input[5] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 6, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'r'); + ASSERT (mbsinit (&state)); + } + return 0; + + case '3': + /* Locale encoding is EUC-JP. */ + { + char input[] = "<\306\374\313\334\270\354>"; /* "<日本語>" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == '<'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 2, &state); + ASSERT (ret == 2); + ASSERT (wctob (wc) == EOF); + ASSERT (mbsinit (&state)); + input[1] = '\0'; + input[2] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 3, 1, &state); + ASSERT (ret == (size_t)(-2)); + ASSERT (wc == (wchar_t) 0xBADFACE); + ASSERT (!mbsinit (&state)); + input[3] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 4, 4, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == EOF); + ASSERT (mbsinit (&state)); + input[4] = '\0'; + + /* Test support of NULL first argument. */ + ret = mbrtowc (NULL, input + 5, 3, &state); + ASSERT (ret == 2); + ASSERT (mbsinit (&state)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 5, 3, &state); + ASSERT (ret == 2); + ASSERT (wctob (wc) == EOF); + ASSERT (mbsinit (&state)); + input[5] = '\0'; + input[6] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 7, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == '>'); + ASSERT (mbsinit (&state)); + } + return 0; + + case '4': + /* Locale encoding is GB18030. */ + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'B'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 1, &state); + ASSERT (ret == (size_t)(-2)); + ASSERT (wc == (wchar_t) 0xBADFACE); + ASSERT (!mbsinit (&state)); + input[1] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 2, 7, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == EOF); + ASSERT (mbsinit (&state)); + input[2] = '\0'; + + /* Test support of NULL first argument. */ + ret = mbrtowc (NULL, input + 3, 6, &state); + ASSERT (ret == 4); + ASSERT (mbsinit (&state)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 3, 6, &state); + ASSERT (ret == 4); + ASSERT (wctob (wc) == EOF); + ASSERT (mbsinit (&state)); + input[3] = '\0'; + input[4] = '\0'; + input[5] = '\0'; + input[6] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 7, 2, &state); + ASSERT (ret == 1); + ASSERT (wc == 'e'); + ASSERT (mbsinit (&state)); + input[5] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 8, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'r'); + ASSERT (mbsinit (&state)); + } + return 0; + + case '5': + /* C locale; tested above. */ + return 0; + } + + return 1; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc1.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc1.sh new file mode 100755 index 0000000000..3becba3a50 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc1.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test in an ISO-8859-1 or ISO-8859-15 locale. +: ${LOCALE_FR=fr_FR} +if test $LOCALE_FR = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no traditional french locale is installed" + else + echo "Skipping test: no traditional french locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_FR \ +./test-mbrtowc${EXEEXT} 1 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc2.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc2.sh new file mode 100755 index 0000000000..0405abafea --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc2.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test whether a specific UTF-8 locale is installed. +: ${LOCALE_FR_UTF8=fr_FR.UTF-8} +if test $LOCALE_FR_UTF8 = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no french Unicode locale is installed" + else + echo "Skipping test: no french Unicode locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_FR_UTF8 \ +./test-mbrtowc${EXEEXT} 2 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc3.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc3.sh new file mode 100755 index 0000000000..63a89a2e34 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc3.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test whether a specific EUC-JP locale is installed. +: ${LOCALE_JA=ja_JP} +if test $LOCALE_JA = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no traditional japanese locale is installed" + else + echo "Skipping test: no traditional japanese locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_JA \ +./test-mbrtowc${EXEEXT} 3 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc4.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc4.sh new file mode 100755 index 0000000000..b299a2c48e --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc4.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test whether a specific GB18030 locale is installed. +: ${LOCALE_ZH_CN=zh_CN.GB18030} +if test $LOCALE_ZH_CN = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no transitional chinese locale is installed" + else + echo "Skipping test: no transitional chinese locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_ZH_CN \ +./test-mbrtowc${EXEEXT} 4 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc5.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc5.sh new file mode 100755 index 0000000000..c10b228c8e --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbrtowc5.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# Test whether the POSIX locale has encoding errors. +LC_ALL=C \ +./test-mbrtowc${EXEEXT} 5 || exit +LC_ALL=POSIX \ +./test-mbrtowc${EXEEXT} 5 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbscasecmp.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbscasecmp.c new file mode 100644 index 0000000000..4b15726c74 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbscasecmp.c @@ -0,0 +1,55 @@ +/* Test of case-insensitive string comparison function. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <string.h> + +#include <locale.h> + +#include "macros.h" + +int +main () +{ + /* configure should already have checked that the locale is supported. */ + if (setlocale (LC_ALL, "") == NULL) + return 1; + + ASSERT (mbscasecmp ("paragraph", "Paragraph") == 0); + + ASSERT (mbscasecmp ("paragrapH", "parAgRaph") == 0); + + ASSERT (mbscasecmp ("paragraph", "paraLyzed") < 0); + ASSERT (mbscasecmp ("paraLyzed", "paragraph") > 0); + + ASSERT (mbscasecmp ("para", "paragraph") < 0); + ASSERT (mbscasecmp ("paragraph", "para") > 0); + + /* The following tests shows how mbscasecmp() is different from + strcasecmp(). */ + + ASSERT (mbscasecmp ("\303\266zg\303\274r", "\303\226ZG\303\234R") == 0); /* özgür */ + ASSERT (mbscasecmp ("\303\226ZG\303\234R", "\303\266zg\303\274r") == 0); /* özgür */ + + /* This test shows how strings of different size can compare equal. */ + ASSERT (mbscasecmp ("turkish", "TURK\304\260SH") == 0); + ASSERT (mbscasecmp ("TURK\304\260SH", "turkish") == 0); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbscasecmp.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbscasecmp.sh new file mode 100755 index 0000000000..1ec7d5e807 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbscasecmp.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test whether a specific Turkish locale is installed. +: ${LOCALE_TR_UTF8=tr_TR.UTF-8} +if test $LOCALE_TR_UTF8 = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no turkish Unicode locale is installed" + else + echo "Skipping test: no turkish Unicode locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_TR_UTF8 \ +./test-mbscasecmp${EXEEXT} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsinit.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsinit.c new file mode 100644 index 0000000000..315937c484 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsinit.c @@ -0,0 +1,55 @@ +/* Test of test for initial conversion state. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <wchar.h> + +#include "signature.h" +SIGNATURE_CHECK (mbsinit, int, (const mbstate_t *)); + +#include <locale.h> + +#include "macros.h" + +int +main (int argc, char *argv[]) +{ + static mbstate_t state; + + ASSERT (mbsinit (NULL)); + + ASSERT (mbsinit (&state)); + + if (argc > 1) + { + static const char input[1] = "\303"; + wchar_t wc; + size_t ret; + + /* configure should already have checked that the locale is supported. */ + if (setlocale (LC_ALL, "") == NULL) + return 1; + + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == (size_t)(-2)); + ASSERT (!mbsinit (&state)); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsinit.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsinit.sh new file mode 100755 index 0000000000..bbda48d2c2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsinit.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test whether a specific UTF-8 locale is installed. +: ${LOCALE_FR_UTF8=fr_FR.UTF-8} +if test $LOCALE_FR_UTF8 = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no french Unicode locale is installed" + else + echo "Skipping test: no french Unicode locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_FR_UTF8 \ +./test-mbsinit${EXEEXT} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsrtowcs.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsrtowcs.c new file mode 100644 index 0000000000..4a47a3f6b2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsrtowcs.c @@ -0,0 +1,293 @@ +/* Test of conversion of string to wide string. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <wchar.h> + +#include "signature.h" +SIGNATURE_CHECK (mbsrtowcs, size_t, (wchar_t *, char const **, size_t, + mbstate_t *)); + +#include <locale.h> +#include <stdio.h> +#include <string.h> + +#include "macros.h" + +int +main (int argc, char *argv[]) +{ + mbstate_t state; + wchar_t wc; + size_t ret; + + /* configure should already have checked that the locale is supported. */ + if (setlocale (LC_ALL, "") == NULL) + return 1; + + /* Test NUL byte input. */ + { + const char *src; + + memset (&state, '\0', sizeof (mbstate_t)); + + src = ""; + ret = mbsrtowcs (NULL, &src, 0, &state); + ASSERT (ret == 0); + ASSERT (mbsinit (&state)); + + src = ""; + ret = mbsrtowcs (NULL, &src, 1, &state); + ASSERT (ret == 0); + ASSERT (mbsinit (&state)); + + wc = (wchar_t) 0xBADFACE; + src = ""; + ret = mbsrtowcs (&wc, &src, 0, &state); + ASSERT (ret == 0); + ASSERT (wc == (wchar_t) 0xBADFACE); + ASSERT (mbsinit (&state)); + + wc = (wchar_t) 0xBADFACE; + src = ""; + ret = mbsrtowcs (&wc, &src, 1, &state); + ASSERT (ret == 0); + ASSERT (wc == 0); + ASSERT (mbsinit (&state)); + } + + if (argc > 1) + { + int unlimited; + + for (unlimited = 0; unlimited < 2; unlimited++) + { + #define BUFSIZE 10 + wchar_t buf[BUFSIZE]; + const char *src; + mbstate_t temp_state; + + { + size_t i; + for (i = 0; i < BUFSIZE; i++) + buf[i] = (wchar_t) 0xBADFACE; + } + + switch (argv[1][0]) + { + case '1': + /* Locale encoding is ISO-8859-1 or ISO-8859-15. */ + { + char input[] = "B\374\337er"; /* "Büßer" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'B'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 1, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == (unsigned char) '\374'); + ASSERT (mbsinit (&state)); + input[1] = '\0'; + + src = input + 2; + temp_state = state; + ret = mbsrtowcs (NULL, &src, unlimited ? BUFSIZE : 1, &temp_state); + ASSERT (ret == 3); + ASSERT (src == input + 2); + ASSERT (mbsinit (&state)); + + src = input + 2; + ret = mbsrtowcs (buf, &src, unlimited ? BUFSIZE : 1, &state); + ASSERT (ret == (unlimited ? 3 : 1)); + ASSERT (src == (unlimited ? NULL : input + 3)); + ASSERT (wctob (buf[0]) == (unsigned char) '\337'); + if (unlimited) + { + ASSERT (buf[1] == 'e'); + ASSERT (buf[2] == 'r'); + ASSERT (buf[3] == 0); + ASSERT (buf[4] == (wchar_t) 0xBADFACE); + } + else + ASSERT (buf[1] == (wchar_t) 0xBADFACE); + ASSERT (mbsinit (&state)); + } + break; + + case '2': + /* Locale encoding is UTF-8. */ + { + char input[] = "B\303\274\303\237er"; /* "Büßer" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'B'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 1, &state); + ASSERT (ret == (size_t)(-2)); + ASSERT (wc == (wchar_t) 0xBADFACE); + ASSERT (!mbsinit (&state)); + input[1] = '\0'; + + src = input + 2; + temp_state = state; + ret = mbsrtowcs (NULL, &src, unlimited ? BUFSIZE : 2, &temp_state); + ASSERT (ret == 4); + ASSERT (src == input + 2); + ASSERT (!mbsinit (&state)); + + src = input + 2; + ret = mbsrtowcs (buf, &src, unlimited ? BUFSIZE : 2, &state); + ASSERT (ret == (unlimited ? 4 : 2)); + ASSERT (src == (unlimited ? NULL : input + 5)); + ASSERT (wctob (buf[0]) == EOF); + ASSERT (wctob (buf[1]) == EOF); + if (unlimited) + { + ASSERT (buf[2] == 'e'); + ASSERT (buf[3] == 'r'); + ASSERT (buf[4] == 0); + ASSERT (buf[5] == (wchar_t) 0xBADFACE); + } + else + ASSERT (buf[2] == (wchar_t) 0xBADFACE); + ASSERT (mbsinit (&state)); + } + break; + + case '3': + /* Locale encoding is EUC-JP. */ + { + char input[] = "<\306\374\313\334\270\354>"; /* "<日本語>" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == '<'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 2, &state); + ASSERT (ret == 2); + ASSERT (wctob (wc) == EOF); + ASSERT (mbsinit (&state)); + input[1] = '\0'; + input[2] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 3, 1, &state); + ASSERT (ret == (size_t)(-2)); + ASSERT (wc == (wchar_t) 0xBADFACE); + ASSERT (!mbsinit (&state)); + input[3] = '\0'; + + src = input + 4; + temp_state = state; + ret = mbsrtowcs (NULL, &src, unlimited ? BUFSIZE : 2, &temp_state); + ASSERT (ret == 3); + ASSERT (src == input + 4); + ASSERT (!mbsinit (&state)); + + src = input + 4; + ret = mbsrtowcs (buf, &src, unlimited ? BUFSIZE : 2, &state); + ASSERT (ret == (unlimited ? 3 : 2)); + ASSERT (src == (unlimited ? NULL : input + 7)); + ASSERT (wctob (buf[0]) == EOF); + ASSERT (wctob (buf[1]) == EOF); + if (unlimited) + { + ASSERT (buf[2] == '>'); + ASSERT (buf[3] == 0); + ASSERT (buf[4] == (wchar_t) 0xBADFACE); + } + else + ASSERT (buf[2] == (wchar_t) 0xBADFACE); + ASSERT (mbsinit (&state)); + } + break; + + case '4': + /* Locale encoding is GB18030. */ + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'B'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 1, &state); + ASSERT (ret == (size_t)(-2)); + ASSERT (wc == (wchar_t) 0xBADFACE); + ASSERT (!mbsinit (&state)); + input[1] = '\0'; + + src = input + 2; + temp_state = state; + ret = mbsrtowcs (NULL, &src, unlimited ? BUFSIZE : 2, &temp_state); + ASSERT (ret == 4); + ASSERT (src == input + 2); + ASSERT (!mbsinit (&state)); + + src = input + 2; + ret = mbsrtowcs (buf, &src, unlimited ? BUFSIZE : 2, &state); + ASSERT (ret == (unlimited ? 4 : 2)); + ASSERT (src == (unlimited ? NULL : input + 7)); + ASSERT (wctob (buf[0]) == EOF); + ASSERT (wctob (buf[1]) == EOF); + if (unlimited) + { + ASSERT (buf[2] == 'e'); + ASSERT (buf[3] == 'r'); + ASSERT (buf[4] == 0); + ASSERT (buf[5] == (wchar_t) 0xBADFACE); + } + else + ASSERT (buf[2] == (wchar_t) 0xBADFACE); + ASSERT (mbsinit (&state)); + } + break; + + default: + return 1; + } + } + + return 0; + } + + return 1; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsrtowcs1.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsrtowcs1.sh new file mode 100755 index 0000000000..01916e77c2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsrtowcs1.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test in an ISO-8859-1 or ISO-8859-15 locale. +: ${LOCALE_FR=fr_FR} +if test $LOCALE_FR = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no traditional french locale is installed" + else + echo "Skipping test: no traditional french locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_FR \ +./test-mbsrtowcs${EXEEXT} 1 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsrtowcs2.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsrtowcs2.sh new file mode 100755 index 0000000000..f72ceb6772 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsrtowcs2.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test whether a specific UTF-8 locale is installed. +: ${LOCALE_FR_UTF8=fr_FR.UTF-8} +if test $LOCALE_FR_UTF8 = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no french Unicode locale is installed" + else + echo "Skipping test: no french Unicode locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_FR_UTF8 \ +./test-mbsrtowcs${EXEEXT} 2 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsrtowcs3.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsrtowcs3.sh new file mode 100755 index 0000000000..b3c01d4cd1 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsrtowcs3.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test whether a specific EUC-JP locale is installed. +: ${LOCALE_JA=ja_JP} +if test $LOCALE_JA = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no traditional japanese locale is installed" + else + echo "Skipping test: no traditional japanese locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_JA \ +./test-mbsrtowcs${EXEEXT} 3 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsrtowcs4.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsrtowcs4.sh new file mode 100755 index 0000000000..226d6ff477 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsrtowcs4.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test whether a specific GB18030 locale is installed. +: ${LOCALE_ZH_CN=zh_CN.GB18030} +if test $LOCALE_ZH_CN = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no transitional chinese locale is installed" + else + echo "Skipping test: no transitional chinese locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_ZH_CN \ +./test-mbsrtowcs${EXEEXT} 4 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsstr1.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsstr1.c new file mode 100644 index 0000000000..eb1b90e75c --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsstr1.c @@ -0,0 +1,128 @@ +/* Test of searching in a string. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <string.h> + +#include <stdlib.h> + +#include "macros.h" + +int +main () +{ + /* This test is executed in the C locale. */ + + { + const char input[] = "foo"; + const char *result = mbsstr (input, ""); + ASSERT (result == input); + } + + { + const char input[] = "foo"; + const char *result = mbsstr (input, "o"); + ASSERT (result == input + 1); + } + + { + const char input[] = "ABC ABCDAB ABCDABCDABDE"; + const char *result = mbsstr (input, "ABCDABD"); + ASSERT (result == input + 15); + } + + { + const char input[] = "ABC ABCDAB ABCDABCDABDE"; + const char *result = mbsstr (input, "ABCDABE"); + ASSERT (result == NULL); + } + + /* Check that a very long haystack is handled quickly if the needle is + short and occurs near the beginning. */ + { + size_t repeat = 10000; + size_t m = 1000000; + const char *needle = + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; + char *haystack = (char *) malloc (m + 1); + if (haystack != NULL) + { + memset (haystack, 'A', m); + haystack[0] = 'B'; + haystack[m] = '\0'; + + for (; repeat > 0; repeat--) + { + ASSERT (mbsstr (haystack, needle) == haystack + 1); + } + + free (haystack); + } + } + + /* Check that a very long needle is discarded quickly if the haystack is + short. */ + { + size_t repeat = 10000; + size_t m = 1000000; + const char *haystack = + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB"; + char *needle = (char *) malloc (m + 1); + if (needle != NULL) + { + memset (needle, 'A', m); + needle[m] = '\0'; + + for (; repeat > 0; repeat--) + { + ASSERT (mbsstr (haystack, needle) == NULL); + } + + free (needle); + } + } + + /* Check that the asymptotic worst-case complexity is not quadratic. */ + { + size_t m = 1000000; + char *haystack = (char *) malloc (2 * m + 2); + char *needle = (char *) malloc (m + 2); + if (haystack != NULL && needle != NULL) + { + const char *result; + + memset (haystack, 'A', 2 * m); + haystack[2 * m] = 'B'; + haystack[2 * m + 1] = '\0'; + + memset (needle, 'A', m); + needle[m] = 'B'; + needle[m + 1] = '\0'; + + result = mbsstr (haystack, needle); + ASSERT (result == haystack + m); + } + free (needle); + free (haystack); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsstr2.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsstr2.c new file mode 100644 index 0000000000..96078fe13d --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsstr2.c @@ -0,0 +1,141 @@ +/* Test of searching in a string. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <string.h> + +#include <locale.h> +#include <stdlib.h> + +#include "macros.h" + +int +main () +{ + /* configure should already have checked that the locale is supported. */ + if (setlocale (LC_ALL, "") == NULL) + return 1; + + { + const char input[] = "f\303\266\303\266"; + const char *result = mbsstr (input, ""); + ASSERT (result == input); + } + + { + const char input[] = "f\303\266\303\266"; + const char *result = mbsstr (input, "\303\266"); + ASSERT (result == input + 1); + } + + { + const char input[] = "f\303\266\303\266"; + const char *result = mbsstr (input, "\266\303"); + ASSERT (result == NULL); + } + + { + const char input[] = "\303\204BC \303\204BCD\303\204B \303\204BCD\303\204BCD\303\204BDE"; /* "ÄBC ÄBCDÄB ÄBCDÄBCDÄBDE" */ + const char *result = mbsstr (input, "\303\204BCD\303\204BD"); /* "ÄBCDÄBD" */ + ASSERT (result == input + 19); + } + + { + const char input[] = "\303\204BC \303\204BCD\303\204B \303\204BCD\303\204BCD\303\204BDE"; /* "ÄBC ÄBCDÄB ÄBCDÄBCDÄBDE" */ + const char *result = mbsstr (input, "\303\204BCD\303\204BE"); /* "ÄBCDÄBE" */ + ASSERT (result == NULL); + } + + /* Check that a very long haystack is handled quickly if the needle is + short and occurs near the beginning. */ + { + size_t repeat = 10000; + size_t m = 1000000; + const char *needle = + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; + char *haystack = (char *) malloc (m + 1); + if (haystack != NULL) + { + memset (haystack, 'A', m); + haystack[0] = '\303'; haystack[1] = '\204'; + haystack[m] = '\0'; + + for (; repeat > 0; repeat--) + { + ASSERT (mbsstr (haystack, needle) == haystack + 2); + } + + free (haystack); + } + } + + /* Check that a very long needle is discarded quickly if the haystack is + short. */ + { + size_t repeat = 10000; + size_t m = 1000000; + const char *haystack = + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207" + "A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207" + "A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207" + "A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207" + "A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207"; + char *needle = (char *) malloc (m + 1); + if (needle != NULL) + { + memset (needle, 'A', m); + needle[m] = '\0'; + + for (; repeat > 0; repeat--) + { + ASSERT (mbsstr (haystack, needle) == NULL); + } + + free (needle); + } + } + + /* Check that the asymptotic worst-case complexity is not quadratic. */ + { + size_t m = 1000000; + char *haystack = (char *) malloc (2 * m + 3); + char *needle = (char *) malloc (m + 3); + if (haystack != NULL && needle != NULL) + { + const char *result; + + memset (haystack, 'A', 2 * m); + haystack[2 * m] = '\303'; haystack[2 * m + 1] = '\207'; + haystack[2 * m + 2] = '\0'; + + memset (needle, 'A', m); + needle[m] = '\303'; needle[m + 1] = '\207'; + needle[m + 2] = '\0'; + + result = mbsstr (haystack, needle); + ASSERT (result == haystack + m); + } + free (needle); + free (haystack); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsstr2.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsstr2.sh new file mode 100755 index 0000000000..79d06df649 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsstr2.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test whether a specific UTF-8 locale is installed. +: ${LOCALE_FR_UTF8=fr_FR.UTF-8} +if test $LOCALE_FR_UTF8 = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no french Unicode locale is installed" + else + echo "Skipping test: no french Unicode locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_FR_UTF8 \ +./test-mbsstr2${EXEEXT} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsstr3.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsstr3.c new file mode 100644 index 0000000000..ffa24dc4b1 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsstr3.c @@ -0,0 +1,81 @@ +/* Test of searching in a string. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <string.h> + +#include <locale.h> + +#include "macros.h" + +int +main () +{ + /* configure should already have checked that the locale is supported. */ + if (setlocale (LC_ALL, "") == NULL) + return 1; + + /* Tests with a character < 0x30. */ + { + const char input[] = "\312\276\300\375 \312\276\300\375 \312\276\300\375"; /* "示例 示例 示例" */ + const char *result = mbsstr (input, " "); + ASSERT (result == input + 4); + } + + { + const char input[] = "\312\276\300\375"; /* "示例" */ + const char *result = mbsstr (input, " "); + ASSERT (result == NULL); + } + + /* Tests with a character >= 0x30. */ + { + const char input[] = "\272\305123\324\313\320\320\241\243"; /* "号123运行。" */ + const char *result = mbsstr (input, "2"); + ASSERT (result == input + 3); + } + + /* The following tests show how mbsstr() is different from strstr(). */ + + { + const char input[] = "\313\320\320\320"; /* "诵行" */ + const char *result = mbsstr (input, "\320\320"); /* "行" */ + ASSERT (result == input + 2); + } + + { + const char input[] = "\203\062\332\066123\324\313\320\320\241\243"; /* "씋123运行。" */ + const char *result = mbsstr (input, "2"); + ASSERT (result == input + 5); + } + + { + const char input[] = "\312\276\300\375 \312\276\300\375 \312\276\300\375"; /* "示例 示例 示例" */ + const char *result = mbsstr (input, "\276\300"); /* "纠" */ + ASSERT (result == NULL); + } + + { + const char input[] = "\312\276\300\375 \312\276\300\375 \312\276\300\375"; /* "示例 示例 示例" */ + const char *result = mbsstr (input, "\375 "); /* invalid multibyte sequence */ + ASSERT (result == NULL); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsstr3.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsstr3.sh new file mode 100755 index 0000000000..732c01fd05 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-mbsstr3.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test whether a specific GB18030 locale is installed. +: ${LOCALE_ZH_CN=zh_CN.GB18030} +if test $LOCALE_ZH_CN = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no chinese GB18030 locale is installed" + else + echo "Skipping test: no chinese GB18030 locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_ZH_CN \ +./test-mbsstr3${EXEEXT} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-memchr.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-memchr.c new file mode 100644 index 0000000000..f31bf8c9aa --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-memchr.c @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2008-2017 Free Software Foundation, Inc. + * Written by Eric Blake and Bruno Haible + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <string.h> + +#include "signature.h" +SIGNATURE_CHECK (memchr, void *, (void const *, int, size_t)); + +#include <stdlib.h> + +#include "zerosize-ptr.h" +#include "macros.h" + +/* Calculating void * + int is not portable, so this wrapper converts + to char * to make the tests easier to write. */ +#define MEMCHR (char *) memchr + +int +main (void) +{ + size_t n = 0x100000; + char *input = malloc (n); + ASSERT (input); + + input[0] = 'a'; + input[1] = 'b'; + memset (input + 2, 'c', 1024); + memset (input + 1026, 'd', n - 1028); + input[n - 2] = 'e'; + input[n - 1] = 'a'; + + /* Basic behavior tests. */ + ASSERT (MEMCHR (input, 'a', n) == input); + + ASSERT (MEMCHR (input, 'a', 0) == NULL); + ASSERT (MEMCHR (zerosize_ptr (), 'a', 0) == NULL); + + ASSERT (MEMCHR (input, 'b', n) == input + 1); + ASSERT (MEMCHR (input, 'c', n) == input + 2); + ASSERT (MEMCHR (input, 'd', n) == input + 1026); + + ASSERT (MEMCHR (input + 1, 'a', n - 1) == input + n - 1); + ASSERT (MEMCHR (input + 1, 'e', n - 1) == input + n - 2); + ASSERT (MEMCHR (input + 1, 0x789abc00 | 'e', n - 1) == input + n - 2); + + ASSERT (MEMCHR (input, 'f', n) == NULL); + ASSERT (MEMCHR (input, '\0', n) == NULL); + + /* Check that a very long haystack is handled quickly if the byte is + found near the beginning. */ + { + size_t repeat = 10000; + for (; repeat > 0; repeat--) + { + ASSERT (MEMCHR (input, 'c', n) == input + 2); + } + } + + /* Alignment tests. */ + { + int i, j; + for (i = 0; i < 32; i++) + { + for (j = 0; j < 256; j++) + input[i + j] = j; + for (j = 0; j < 256; j++) + { + ASSERT (MEMCHR (input + i, j, 256) == input + i + j); + } + } + } + + /* Check that memchr() does not read past the first occurrence of the + byte being searched. See the Austin Group's clarification + <http://www.opengroup.org/austin/docs/austin_454.txt>. + Test both '\0' and something else, since some implementations + special-case searching for NUL. + */ + { + char *page_boundary = (char *) zerosize_ptr (); + /* Too small, and we miss cache line boundary tests; too large, + and the test takes cubically longer to complete. */ + int limit = 257; + + if (page_boundary != NULL) + { + for (n = 1; n <= limit; n++) + { + char *mem = page_boundary - n; + memset (mem, 'X', n); + ASSERT (MEMCHR (mem, 'U', n) == NULL); + ASSERT (MEMCHR (mem, 0, n) == NULL); + + { + size_t i; + size_t k; + + for (i = 0; i < n; i++) + { + mem[i] = 'U'; + for (k = i + 1; k < n + limit; k++) + ASSERT (MEMCHR (mem, 'U', k) == mem + i); + mem[i] = 0; + for (k = i + 1; k < n + limit; k++) + ASSERT (MEMCHR (mem, 0, k) == mem + i); + mem[i] = 'X'; + } + } + } + } + } + + free (input); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-nanosleep.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-nanosleep.c new file mode 100644 index 0000000000..04b3229050 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-nanosleep.c @@ -0,0 +1,83 @@ +/* Test of nanosleep() function. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +#include <config.h> + +#include <time.h> + +#include "signature.h" +SIGNATURE_CHECK (nanosleep, int, (struct timespec const *, struct timespec *)); + +#include <errno.h> +#include <signal.h> +#include <unistd.h> + +#include "macros.h" + +#if HAVE_DECL_ALARM +static void +handle_alarm (int sig) +{ + if (sig != SIGALRM) + _exit (1); +} +#endif + +int +main (void) +{ + struct timespec ts; + + ts.tv_sec = 1000; + ts.tv_nsec = -1; + errno = 0; + ASSERT (nanosleep (&ts, NULL) == -1); + ASSERT (errno == EINVAL); + ts.tv_nsec = 1000000000; + errno = 0; + ASSERT (nanosleep (&ts, NULL) == -1); + ASSERT (errno == EINVAL); + + ts.tv_sec = 0; + ts.tv_nsec = 1; + ASSERT (nanosleep (&ts, &ts) == 0); + /* Remaining time is only defined on EINTR failure; but on success, + it is typically either 0 or unchanged from input. At any rate, + it shouldn't be randomly changed to unrelated values. */ + ASSERT (ts.tv_sec == 0); + ASSERT (ts.tv_nsec == 0 || ts.tv_nsec == 1); + ts.tv_nsec = 0; + ASSERT (nanosleep (&ts, NULL) == 0); + +#if HAVE_DECL_ALARM + { + const time_t pentecost = 50 * 24 * 60 * 60; /* 50 days. */ + signal (SIGALRM, handle_alarm); + alarm (1); + ts.tv_sec = pentecost; + ts.tv_nsec = 999999999; + errno = 0; + ASSERT (nanosleep (&ts, &ts) == -1); + ASSERT (errno == EINTR); + ASSERT (pentecost - 10 < ts.tv_sec && ts.tv_sec <= pentecost); + ASSERT (0 <= ts.tv_nsec && ts.tv_nsec <= 999999999); + } +#endif + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-netinet_in.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-netinet_in.c new file mode 100644 index 0000000000..20710d7a78 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-netinet_in.c @@ -0,0 +1,27 @@ +/* Test of <netinet/in.h> substitute. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <netinet/in.h> + +int +main (void) +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-nl_langinfo.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-nl_langinfo.c new file mode 100644 index 0000000000..69a088542e --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-nl_langinfo.c @@ -0,0 +1,126 @@ +/* Test of nl_langinfo replacement. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2009. */ + +#include <config.h> + +#include <langinfo.h> + +#include "signature.h" +SIGNATURE_CHECK (nl_langinfo, char *, (nl_item)); + +#include <locale.h> +#include <stdlib.h> +#include <string.h> + +#include "c-strcase.h" +#include "macros.h" + +/* For GCC >= 4.3, silence the warnings + "comparison of unsigned expression >= 0 is always true" + in this file. */ +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +# pragma GCC diagnostic ignored "-Wtype-limits" +#endif + +int +main (int argc, char *argv[]) +{ + int pass = atoi (argv[1]); + /* pass locale + 0 C + 1 traditional French locale + 2 French UTF-8 locale + */ + + setlocale (LC_ALL, ""); + + /* nl_langinfo items of the LC_CTYPE category */ + ASSERT (strlen (nl_langinfo (CODESET)) > 0); + if (pass == 2) + { + const char *codeset = nl_langinfo (CODESET); + ASSERT (c_strcasecmp (codeset, "UTF-8") == 0 || c_strcasecmp (codeset, "UTF8") == 0); + } + /* nl_langinfo items of the LC_NUMERIC category */ + ASSERT (strlen (nl_langinfo (RADIXCHAR)) > 0); + ASSERT (strlen (nl_langinfo (THOUSEP)) >= 0); + /* nl_langinfo items of the LC_TIME category */ + ASSERT (strlen (nl_langinfo (D_T_FMT)) > 0); + ASSERT (strlen (nl_langinfo (D_FMT)) > 0); + ASSERT (strlen (nl_langinfo (T_FMT)) > 0); + ASSERT (strlen (nl_langinfo (T_FMT_AMPM)) >= (pass == 0 ? 1 : 0)); + ASSERT (strlen (nl_langinfo (AM_STR)) >= (pass == 0 ? 1 : 0)); + ASSERT (strlen (nl_langinfo (PM_STR)) >= (pass == 0 ? 1 : 0)); + ASSERT (strlen (nl_langinfo (DAY_1)) > 0); + ASSERT (strlen (nl_langinfo (DAY_2)) > 0); + ASSERT (strlen (nl_langinfo (DAY_3)) > 0); + ASSERT (strlen (nl_langinfo (DAY_4)) > 0); + ASSERT (strlen (nl_langinfo (DAY_5)) > 0); + ASSERT (strlen (nl_langinfo (DAY_6)) > 0); + ASSERT (strlen (nl_langinfo (DAY_7)) > 0); + ASSERT (strlen (nl_langinfo (ABDAY_1)) > 0); + ASSERT (strlen (nl_langinfo (ABDAY_2)) > 0); + ASSERT (strlen (nl_langinfo (ABDAY_3)) > 0); + ASSERT (strlen (nl_langinfo (ABDAY_4)) > 0); + ASSERT (strlen (nl_langinfo (ABDAY_5)) > 0); + ASSERT (strlen (nl_langinfo (ABDAY_6)) > 0); + ASSERT (strlen (nl_langinfo (ABDAY_7)) > 0); + ASSERT (strlen (nl_langinfo (MON_1)) > 0); + ASSERT (strlen (nl_langinfo (MON_2)) > 0); + ASSERT (strlen (nl_langinfo (MON_3)) > 0); + ASSERT (strlen (nl_langinfo (MON_4)) > 0); + ASSERT (strlen (nl_langinfo (MON_5)) > 0); + ASSERT (strlen (nl_langinfo (MON_6)) > 0); + ASSERT (strlen (nl_langinfo (MON_7)) > 0); + ASSERT (strlen (nl_langinfo (MON_8)) > 0); + ASSERT (strlen (nl_langinfo (MON_9)) > 0); + ASSERT (strlen (nl_langinfo (MON_10)) > 0); + ASSERT (strlen (nl_langinfo (MON_11)) > 0); + ASSERT (strlen (nl_langinfo (MON_12)) > 0); + ASSERT (strlen (nl_langinfo (ABMON_1)) > 0); + ASSERT (strlen (nl_langinfo (ABMON_2)) > 0); + ASSERT (strlen (nl_langinfo (ABMON_3)) > 0); + ASSERT (strlen (nl_langinfo (ABMON_4)) > 0); + ASSERT (strlen (nl_langinfo (ABMON_5)) > 0); + ASSERT (strlen (nl_langinfo (ABMON_6)) > 0); + ASSERT (strlen (nl_langinfo (ABMON_7)) > 0); + ASSERT (strlen (nl_langinfo (ABMON_8)) > 0); + ASSERT (strlen (nl_langinfo (ABMON_9)) > 0); + ASSERT (strlen (nl_langinfo (ABMON_10)) > 0); + ASSERT (strlen (nl_langinfo (ABMON_11)) > 0); + ASSERT (strlen (nl_langinfo (ABMON_12)) > 0); + ASSERT (strlen (nl_langinfo (ERA)) >= 0); + ASSERT (strlen (nl_langinfo (ERA_D_FMT)) >= 0); + ASSERT (strlen (nl_langinfo (ERA_D_T_FMT)) >= 0); + ASSERT (strlen (nl_langinfo (ERA_T_FMT)) >= 0); + ASSERT (nl_langinfo (ALT_DIGITS) != NULL); + /* nl_langinfo items of the LC_MONETARY category */ + { + const char *currency = nl_langinfo (CRNCYSTR); + ASSERT (strlen (currency) >= 0); +#if !defined __NetBSD__ + if (pass > 0) + ASSERT (strlen (currency) >= 1); +#endif + } + /* nl_langinfo items of the LC_MESSAGES category */ + ASSERT (strlen (nl_langinfo (YESEXPR)) > 0); + ASSERT (strlen (nl_langinfo (NOEXPR)) > 0); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-nl_langinfo.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-nl_langinfo.sh new file mode 100755 index 0000000000..3168f426f2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-nl_langinfo.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +LC_ALL=C ./test-nl_langinfo${EXEEXT} 0 || exit 1 + +# Test whether a specific traditional locale is installed. +: ${LOCALE_FR=fr_FR} +if test $LOCALE_FR != none; then + LC_ALL=$LOCALE_FR ./test-nl_langinfo${EXEEXT} 1 || exit 1 +fi + +# Test whether a specific UTF-8 locale is installed. +: ${LOCALE_FR_UTF8=fr_FR.UTF-8} +if test $LOCALE_FR_UTF8 != none; then + LC_ALL=$LOCALE_FR_UTF8 ./test-nl_langinfo${EXEEXT} 2 || exit 1 +fi + +exit 0 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-open.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-open.c new file mode 100644 index 0000000000..cfcad6aeef --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-open.c @@ -0,0 +1,41 @@ +/* Test of opening a file descriptor. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <fcntl.h> + +#include "signature.h" +SIGNATURE_CHECK (open, int, (char const *, int, ...)); + +#include <errno.h> +#include <stdbool.h> +#include <stdio.h> +#include <unistd.h> + +#include "macros.h" + +#define BASE "test-open.t" + +#include "test-open.h" + +int +main (void) +{ + return test_open (open, true); +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-open.h b/local/recipes/tools/diffutils/source/gnulib-tests/test-open.h new file mode 100644 index 0000000000..6d01dd9294 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-open.h @@ -0,0 +1,104 @@ +/* Test of opening a file descriptor. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +/* Make test_open always inline if we're using Fortify, which defines + __always_inline to do that. Do nothing otherwise. This works + around a glibc bug whereby 'open' cannot be used as a function + pointer when _FORTIFY_SOURCE is positive. */ + +#if __GLIBC__ && defined __always_inline +# define ALWAYS_INLINE __always_inline +#else +# define ALWAYS_INLINE +#endif + +/* This file is designed to test both open(n,buf[,mode]) and + openat(AT_FDCWD,n,buf[,mode]). FUNC is the function to test. + Assumes that BASE and ASSERT are already defined, and that + appropriate headers are already included. If PRINT, warn before + skipping symlink tests with status 77. */ + +static ALWAYS_INLINE int +test_open (int (*func) (char const *, int, ...), bool print) +{ + int fd; + /* Remove anything from prior partial run. */ + unlink (BASE "file"); + + /* Cannot create directory. */ + errno = 0; + ASSERT (func ("nonexist.ent/", O_CREAT | O_RDONLY, 0600) == -1); + ASSERT (errno == ENOTDIR || errno == EISDIR || errno == ENOENT + || errno == EINVAL); + + /* Create a regular file. */ + fd = func (BASE "file", O_CREAT | O_RDONLY, 0600); + ASSERT (0 <= fd); + ASSERT (close (fd) == 0); + + /* Trailing slash handling. */ + errno = 0; + ASSERT (func (BASE "file/", O_RDONLY) == -1); + ASSERT (errno == ENOTDIR || errno == EISDIR || errno == EINVAL); + + /* Directories cannot be opened for writing. */ + errno = 0; + ASSERT (func (".", O_WRONLY) == -1); + ASSERT (errno == EISDIR || errno == EACCES); + + /* /dev/null must exist, and be writable. */ + fd = func ("/dev/null", O_RDONLY); + ASSERT (0 <= fd); + { + char c; + ASSERT (read (fd, &c, 1) == 0); + } + ASSERT (close (fd) == 0); + fd = func ("/dev/null", O_WRONLY); + ASSERT (0 <= fd); + ASSERT (write (fd, "c", 1) == 1); + ASSERT (close (fd) == 0); + + /* Although O_NONBLOCK on regular files can be ignored, it must not + cause a failure. */ + fd = func (BASE "file", O_NONBLOCK | O_RDONLY); + ASSERT (0 <= fd); + ASSERT (close (fd) == 0); + + /* Symlink handling, where supported. */ + if (symlink (BASE "file", BASE "link") != 0) + { + ASSERT (unlink (BASE "file") == 0); + if (print) + fputs ("skipping test: symlinks not supported on this file system\n", + stderr); + return 77; + } + errno = 0; + ASSERT (func (BASE "link/", O_RDONLY) == -1); + ASSERT (errno == ENOTDIR); + fd = func (BASE "link", O_RDONLY); + ASSERT (0 <= fd); + ASSERT (close (fd) == 0); + + /* Cleanup. */ + ASSERT (unlink (BASE "file") == 0); + ASSERT (unlink (BASE "link") == 0); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-pathmax.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-pathmax.c new file mode 100644 index 0000000000..7b3510cee3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-pathmax.c @@ -0,0 +1,32 @@ +/* Test of "pathmax.h". + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2011. */ + +#include <config.h> + +#include "pathmax.h" + +/* Check that PATH_MAX is a constant if it is defined. */ +#ifdef PATH_MAX +int a = PATH_MAX; +#endif + +int +main (void) +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-perror.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-perror.c new file mode 100644 index 0000000000..140e05bb20 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-perror.c @@ -0,0 +1,36 @@ +/* Test of perror() function. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <stdio.h> + +#include "signature.h" +SIGNATURE_CHECK (perror, void, (char const *)); + +#include <errno.h> + +int +main (int argc, char **argv) +{ + const char *prefix = (argc > 1 ? argv[1] : NULL); + + errno = EACCES; perror (prefix); + errno = ETIMEDOUT; perror (prefix); + errno = EOVERFLOW; perror (prefix); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-perror.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-perror.sh new file mode 100755 index 0000000000..40a3034b28 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-perror.sh @@ -0,0 +1,26 @@ +#!/bin/sh +: ${srcdir=.} +. "$srcdir/init.sh"; path_prepend_ . + +# Test NULL prefix. Result should not contain a number, except in lines that +# start with 'EDC' (IBM z/OS libc produces an error identifier before the +# error message). +test-perror 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror.tmp +grep -v '^EDC' t-perror.tmp | grep '[0-9]' > /dev/null \ + && fail_ "result should not contain a number" + +# Test empty prefix. Result should be the same. +test-perror '' 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror1.tmp +diff t-perror.tmp t-perror1.tmp \ + || fail_ "empty prefix should behave like NULL argument" + +# Test non-empty prefix. +test-perror foo 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror3.tmp +sed -e 's/^/foo: /' < t-perror.tmp > t-perror2.tmp +diff t-perror2.tmp t-perror3.tmp || fail_ "prefix applied incorrectly" + +# Test exit status. +test-perror >out 2>/dev/null || fail_ "unexpected exit status" +test -s out && fail_ "unexpected output" + +Exit 0 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-perror2.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-perror2.c new file mode 100644 index 0000000000..125961e998 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-perror2.c @@ -0,0 +1,136 @@ +/* Test of perror() function. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <stdio.h> + +#include <errno.h> +#include <string.h> +#include <unistd.h> + +/* This test intentionally parses stderr. So, we arrange to have fd 10 + (outside the range of interesting fd's during the test) set up to + duplicate the original stderr. */ +#define BACKUP_STDERR_FILENO 10 +#define ASSERT_STREAM myerr +#include "macros.h" + +static FILE *myerr; + +#define BASE "test-perror2" + +int +main (void) +{ + /* We change fd 2 later, so save it in fd 10. */ + if (dup2 (STDERR_FILENO, BACKUP_STDERR_FILENO) != BACKUP_STDERR_FILENO + || (myerr = fdopen (BACKUP_STDERR_FILENO, "w")) == NULL) + return 2; + + ASSERT (freopen (BASE ".tmp", "w+", stderr) == stderr); + + /* Test that perror does not clobber strerror buffer. */ + { + const char *msg1; + const char *msg2; + const char *msg3; + const char *msg4; + char *str1; + char *str2; + char *str3; + char *str4; + + msg1 = strerror (ENOENT); + ASSERT (msg1); + str1 = strdup (msg1); + ASSERT (str1); + + msg2 = strerror (ERANGE); + ASSERT (msg2); + str2 = strdup (msg2); + ASSERT (str2); + + msg3 = strerror (-4); + ASSERT (msg3); + str3 = strdup (msg3); + ASSERT (str3); + + msg4 = strerror (1729576); + ASSERT (msg4); + str4 = strdup (msg4); + ASSERT (str4); + + errno = EACCES; + perror (""); + errno = -5; + perror (""); + ASSERT (!ferror (stderr)); + ASSERT (msg1 == msg2 || msg1 == msg4 || STREQ (msg1, str1)); + ASSERT (msg2 == msg4 || STREQ (msg2, str2)); + ASSERT (msg3 == msg4 || STREQ (msg3, str3)); + ASSERT (STREQ (msg4, str4)); + + free (str1); + free (str2); + free (str3); + free (str4); + } + + /* Test that perror uses the same message as strerror. */ + { + int errs[] = { EACCES, 0, -3, }; + int i; + for (i = 0; i < SIZEOF (errs); i++) + { + char buf[256]; + char *err = strerror (errs[i]); + + ASSERT (err); + ASSERT (strlen (err) < sizeof buf); + rewind (stderr); + ASSERT (ftruncate (fileno (stderr), 0) == 0); + errno = errs[i]; + perror (NULL); + ASSERT (!ferror (stderr)); + rewind (stderr); + ASSERT (fgets (buf, sizeof buf, stderr) == buf); + ASSERT (strstr (buf, err)); + } + } + + /* Test that perror reports write failure. */ + { + ASSERT (freopen (BASE ".tmp", "r", stderr) == stderr); + ASSERT (setvbuf (stderr, NULL, _IONBF, BUFSIZ) == 0); + errno = -1; + ASSERT (!ferror (stderr)); + perror (NULL); +#if 0 + /* Commented out until cygwin behaves: + http://sourceware.org/ml/newlib/2011/msg00228.html */ + ASSERT (errno > 0); + /* Commented out until glibc behaves: + http://sourceware.org/bugzilla/show_bug.cgi?id=12792 */ + ASSERT (ferror (stderr)); +#endif + } + + ASSERT (fclose (stderr) == 0); + ASSERT (remove (BASE ".tmp") == 0); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-pipe.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-pipe.c new file mode 100644 index 0000000000..08cfe92e44 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-pipe.c @@ -0,0 +1,108 @@ +/* Test of pipe. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <unistd.h> + +#include "signature.h" +SIGNATURE_CHECK (pipe, int, (int[2])); + +#include <fcntl.h> +#include <stdbool.h> + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Get declarations of the native Windows API functions. */ +# define WIN32_LEAN_AND_MEAN +# include <windows.h> +/* Get _get_osfhandle. */ +# if GNULIB_MSVC_NOTHROW +# include "msvc-nothrow.h" +# else +# include <io.h> +# endif +#endif + +#include "binary-io.h" +#include "macros.h" + +/* Return true if FD is open. */ +static bool +is_open (int fd) +{ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* On native Windows, the initial state of unassigned standard file + descriptors is that they are open but point to an + INVALID_HANDLE_VALUE, and there is no fcntl. */ + return (HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE; +#else +# ifndef F_GETFL +# error Please port fcntl to your platform +# endif + return 0 <= fcntl (fd, F_GETFL); +#endif +} + +/* Return true if FD is not inherited to child processes. */ +static bool +is_cloexec (int fd) +{ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + HANDLE h = (HANDLE) _get_osfhandle (fd); + DWORD flags; + ASSERT (GetHandleInformation (h, &flags)); + return (flags & HANDLE_FLAG_INHERIT) == 0; +#else + int flags; + ASSERT ((flags = fcntl (fd, F_GETFD)) >= 0); + return (flags & FD_CLOEXEC) != 0; +#endif +} + +/* Return true if FD is in non-blocking mode. */ +static bool +is_nonblocking (int fd) +{ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* We don't use the non-blocking mode for sockets here. */ + return 0; +#else + int flags; + ASSERT ((flags = fcntl (fd, F_GETFL)) >= 0); + return (flags & O_NONBLOCK) != 0; +#endif +} + +int +main () +{ + int fd[2]; + + fd[0] = -1; + fd[1] = -1; + ASSERT (pipe (fd) >= 0); + ASSERT (fd[0] >= 0); + ASSERT (fd[1] >= 0); + ASSERT (fd[0] != fd[1]); + ASSERT (is_open (fd[0])); + ASSERT (is_open (fd[1])); + ASSERT (!is_cloexec (fd[0])); + ASSERT (!is_cloexec (fd[1])); + ASSERT (!is_nonblocking (fd[0])); + ASSERT (!is_nonblocking (fd[1])); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-quotearg-simple.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-quotearg-simple.c new file mode 100644 index 0000000000..4bd23123f0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-quotearg-simple.c @@ -0,0 +1,366 @@ +/* Test of quotearg family of functions. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2008. */ + +#include <config.h> + +#include "quotearg.h" + +#include <ctype.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> + +#include "localcharset.h" +#include "macros.h" +#include "zerosize-ptr.h" + +#include "test-quotearg.h" + +static struct result_groups results_g[] = { + /* literal_quoting_style */ + { { "", "\0""1\0", 3, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b", + "a' b", LQ RQ, LQ RQ }, + { "", "1", 1, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b", + "a' b", LQ RQ, LQ RQ }, + { "", "1", 1, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b", + "a' b", LQ RQ, LQ RQ } }, + + /* shell_quoting_style */ + { { "''", "\0""1\0", 3, "simple", "' \t\n'\\''\"\033?""?/\\'", "a:b", + "'a\\b'", "\"a' b\"", LQ RQ, LQ RQ }, + { "''", "1", 1, "simple", "' \t\n'\\''\"\033?""?/\\'", "a:b", + "'a\\b'", "\"a' b\"", LQ RQ, LQ RQ }, + { "''", "1", 1, "simple", "' \t\n'\\''\"\033?""?/\\'", "'a:b'", + "'a\\b'", "\"a' b\"", LQ RQ, LQ RQ } }, + + /* shell_always_quoting_style */ + { { "''", "'\0""1\0'", 5, "'simple'", "' \t\n'\\''\"\033?""?/\\'", "'a:b'", + "'a\\b'", "\"a' b\"", "'" LQ RQ "'", "'" LQ RQ "'" }, + { "''", "'1'", 3, "'simple'", "' \t\n'\\''\"\033?""?/\\'", "'a:b'", + "'a\\b'", "\"a' b\"", "'" LQ RQ "'", "'" LQ RQ "'" }, + { "''", "'1'", 3, "'simple'", "' \t\n'\\''\"\033?""?/\\'", "'a:b'", + "'a\\b'", "\"a' b\"", "'" LQ RQ "'", "'" LQ RQ "'" } }, + + /* shell_escape_quoting_style */ + { { "''", "''$'\\0''1'$'\\0'", 15, "simple", + "' '$'\\t\\n'\\''\"'$'\\033''?""?/\\'", "a:b", + "'a\\b'", "\"a' b\"", "''$'" LQ_ENC RQ_ENC "'", LQ RQ }, + { "''", "''$'\\0''1'$'\\0'", 15, "simple", + "' '$'\\t\\n'\\''\"'$'\\033''?""?/\\'", "a:b", + "'a\\b'", "\"a' b\"", "''$'" LQ_ENC RQ_ENC "'", LQ RQ }, + { "''", "''$'\\0''1'$'\\0'", 15, "simple", + "' '$'\\t\\n'\\''\"'$'\\033''?""?/\\'", "'a:b'", + "'a\\b'", "\"a' b\"", "''$'" LQ_ENC RQ_ENC "'", LQ RQ } }, + + /* shell_escape_always_quoting_style */ + { { "''", "''$'\\0''1'$'\\0'", 15, "'simple'", + "' '$'\\t\\n'\\''\"'$'\\033''?""?/\\'", "'a:b'", + "'a\\b'", "\"a' b\"", "''$'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" }, + { "''", "''$'\\0''1'$'\\0'", 15, "'simple'", + "' '$'\\t\\n'\\''\"'$'\\033''?""?/\\'", "'a:b'", + "'a\\b'", "\"a' b\"", "''$'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" }, + { "''", "''$'\\0''1'$'\\0'", 15, "'simple'", + "' '$'\\t\\n'\\''\"'$'\\033''?""?/\\'", "'a:b'", + "'a\\b'", "\"a' b\"", "''$'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" } }, + + /* c_quoting_style */ + { { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"", + "\" \\t\\n'\\\"\\033?""?/\\\\\"", "\"a:b\"", "\"a\\\\b\"", + "\"a' b\"", "\"" LQ_ENC RQ_ENC "\"", "\"" LQ RQ "\"" }, + { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"", + "\" \\t\\n'\\\"\\033?""?/\\\\\"", "\"a:b\"", "\"a\\\\b\"", + "\"a' b\"", "\"" LQ_ENC RQ_ENC "\"", "\"" LQ RQ "\"" }, + { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"", + "\" \\t\\n'\\\"\\033?""?/\\\\\"", "\"a\\:b\"", "\"a\\\\b\"", + "\"a' b\"", "\"" LQ_ENC RQ_ENC "\"", "\"" LQ RQ "\"" } }, + + /* c_maybe_quoting_style */ + { { "", "\"\\0001\\0\"", 9, "simple", "\" \\t\\n'\\\"\\033?""?/\\\\\"", + "a:b", "a\\b", "a' b", "\"" LQ_ENC RQ_ENC "\"", LQ RQ }, + { "", "\"\\0001\\0\"", 9, "simple", "\" \\t\\n'\\\"\\033?""?/\\\\\"", + "a:b", "a\\b", "a' b", "\"" LQ_ENC RQ_ENC "\"", LQ RQ }, + { "", "\"\\0001\\0\"", 9, "simple", "\" \\t\\n'\\\"\\033?""?/\\\\\"", + "\"a:b\"", "a\\b", "a' b", "\"" LQ_ENC RQ_ENC "\"", LQ RQ } }, + + /* escape_quoting_style */ + { { "", "\\0001\\0", 7, "simple", " \\t\\n'\"\\033?""?/\\\\", "a:b", + "a\\\\b", "a' b", LQ_ENC RQ_ENC, LQ RQ }, + { "", "\\0001\\0", 7, "simple", " \\t\\n'\"\\033?""?/\\\\", "a:b", + "a\\\\b", "a' b", LQ_ENC RQ_ENC, LQ RQ }, + { "", "\\0001\\0", 7, "simple", " \\t\\n'\"\\033?""?/\\\\", "a\\:b", + "a\\\\b", "a' b", LQ_ENC RQ_ENC, LQ RQ } }, + + /* locale_quoting_style */ + { { "''", "'\\0001\\0'", 9, "'simple'", "' \\t\\n\\'\"\\033?""?/\\\\'", + "'a:b'", "'a\\\\b'", "'a\\' b'", "'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" }, + { "''", "'\\0001\\0'", 9, "'simple'", "' \\t\\n\\'\"\\033?""?/\\\\'", + "'a:b'", "'a\\\\b'", "'a\\' b'", "'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" }, + { "''", "'\\0001\\0'", 9, "'simple'", "' \\t\\n\\'\"\\033?""?/\\\\'", + "'a\\:b'", "'a\\\\b'", "'a\\' b'", + "'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" } }, + + /* clocale_quoting_style */ + { { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"", + "\" \\t\\n'\\\"\\033?""?/\\\\\"", "\"a:b\"", "\"a\\\\b\"", + "\"a' b\"", "\"" LQ_ENC RQ_ENC "\"", "\"" LQ RQ "\"" }, + { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"", + "\" \\t\\n'\\\"\\033?""?/\\\\\"", "\"a:b\"", "\"a\\\\b\"", + "\"a' b\"", "\"" LQ_ENC RQ_ENC "\"", "\"" LQ RQ "\"" }, + { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"", + "\" \\t\\n'\\\"\\033?""?/\\\\\"", "\"a\\:b\"", "\"a\\\\b\"", + "\"a' b\"", "\"" LQ_ENC RQ_ENC "\"", "\"" LQ RQ "\"" } } +}; + +static struct result_groups flag_results[] = { + /* literal_quoting_style and QA_ELIDE_NULL_BYTES */ + { { "", "1", 1, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b", "a' b", + LQ RQ, LQ RQ }, + { "", "1", 1, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b", "a' b", + LQ RQ, LQ RQ }, + { "", "1", 1, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b", "a' b", + LQ RQ, LQ RQ } }, + + /* c_quoting_style and QA_ELIDE_OUTER_QUOTES */ + { { "", "\"\\0001\\0\"", 9, "simple", "\" \\t\\n'\\\"\\033?""?/\\\\\"", + "a:b", "a\\b", "a' b", "\"" LQ_ENC RQ_ENC "\"", LQ RQ }, + { "", "\"\\0001\\0\"", 9, "simple", "\" \\t\\n'\\\"\\033?""?/\\\\\"", + "a:b", "a\\b", "a' b", "\"" LQ_ENC RQ_ENC "\"", LQ RQ }, + { "", "\"\\0001\\0\"", 9, "simple", "\" \\t\\n'\\\"\\033?""?/\\\\\"", + "\"a:b\"", "a\\b", "a' b", "\"" LQ_ENC RQ_ENC "\"", LQ RQ } }, + + /* c_quoting_style and QA_SPLIT_TRIGRAPHS */ + { { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"", + "\" \\t\\n'\\\"\\033?\"\"?/\\\\\"", "\"a:b\"", "\"a\\\\b\"", + "\"a' b\"", "\"" LQ_ENC RQ_ENC "\"", "\"" LQ RQ "\"" }, + { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"", + "\" \\t\\n'\\\"\\033?\"\"?/\\\\\"", "\"a:b\"", "\"a\\\\b\"", + "\"a' b\"", "\"" LQ_ENC RQ_ENC "\"", "\"" LQ RQ "\"" }, + { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"", + "\" \\t\\n'\\\"\\033?\"\"?/\\\\\"", "\"a\\:b\"", "\"a\\\\b\"", + "\"a' b\"", "\"" LQ_ENC RQ_ENC "\"", "\"" LQ RQ "\"" } } +}; + +static char const *custom_quotes[][2] = { + { "", "" }, + { "'", "'" }, + { "(", ")" }, + { ":", " " }, + { " ", ":" }, + { "# ", "\n" }, + { "\"'", "'\"" } +}; + +static struct result_groups custom_results[] = { + /* left_quote = right_quote = "" */ + { { "", "\\0001\\0", 7, "simple", + " \\t\\n'\"\\033?""?/\\\\", "a:b", "a\\\\b", + "a' b", LQ_ENC RQ_ENC, LQ RQ }, + { "", "\\0001\\0", 7, "simple", + " \\t\\n'\"\\033?""?/\\\\", "a:b", "a\\\\b", + "a' b", LQ_ENC RQ_ENC, LQ RQ }, + { "", "\\0001\\0", 7, "simple", + " \\t\\n'\"\\033?""?/\\\\", "a\\:b", "a\\\\b", + "a' b", LQ_ENC RQ_ENC, LQ RQ } }, + + /* left_quote = right_quote = "'" */ + { { "''", "'\\0001\\0'", 9, "'simple'", + "' \\t\\n\\'\"\\033?""?/\\\\'", "'a:b'", "'a\\\\b'", + "'a\\' b'", "'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" }, + { "''", "'\\0001\\0'", 9, "'simple'", + "' \\t\\n\\'\"\\033?""?/\\\\'", "'a:b'", "'a\\\\b'", + "'a\\' b'", "'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" }, + { "''", "'\\0001\\0'", 9, "'simple'", + "' \\t\\n\\'\"\\033?""?/\\\\'", "'a\\:b'", "'a\\\\b'", + "'a\\' b'", "'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" } }, + + /* left_quote = "(" and right_quote = ")" */ + { { "()", "(\\0001\\0)", 9, "(simple)", + "( \\t\\n'\"\\033?""?/\\\\)", "(a:b)", "(a\\\\b)", + "(a' b)", "(" LQ_ENC RQ_ENC ")", "(" LQ RQ ")" }, + { "()", "(\\0001\\0)", 9, "(simple)", + "( \\t\\n'\"\\033?""?/\\\\)", "(a:b)", "(a\\\\b)", + "(a' b)", "(" LQ_ENC RQ_ENC ")", "(" LQ RQ ")" }, + { "()", "(\\0001\\0)", 9, "(simple)", + "( \\t\\n'\"\\033?""?/\\\\)", "(a\\:b)", "(a\\\\b)", + "(a' b)", "(" LQ_ENC RQ_ENC ")", "(" LQ RQ ")" } }, + + /* left_quote = ":" and right_quote = " " */ + { { ": ", ":\\0001\\0 ", 9, ":simple ", + ":\\ \\t\\n'\"\\033?""?/\\\\ ", ":a:b ", ":a\\\\b ", + ":a'\\ b ", ":" LQ_ENC RQ_ENC " ", ":" LQ RQ " " }, + { ": ", ":\\0001\\0 ", 9, ":simple ", + ":\\ \\t\\n'\"\\033?""?/\\\\ ", ":a:b ", ":a\\\\b ", + ":a'\\ b ", ":" LQ_ENC RQ_ENC " ", ":" LQ RQ " " }, + { ": ", ":\\0001\\0 ", 9, ":simple ", + ":\\ \\t\\n'\"\\033?""?/\\\\ ", ":a\\:b ", ":a\\\\b ", + ":a'\\ b ", ":" LQ_ENC RQ_ENC " ", ":" LQ RQ " " } }, + + /* left_quote = " " and right_quote = ":" */ + { { " :", " \\0001\\0:", 9, " simple:", + " \\t\\n'\"\\033?""?/\\\\:", " a\\:b:", " a\\\\b:", + " a' b:", " " LQ_ENC RQ_ENC ":", " " LQ RQ ":" }, + { " :", " \\0001\\0:", 9, " simple:", + " \\t\\n'\"\\033?""?/\\\\:", " a\\:b:", " a\\\\b:", + " a' b:", " " LQ_ENC RQ_ENC ":", " " LQ RQ ":" }, + { " :", " \\0001\\0:", 9, " simple:", + " \\t\\n'\"\\033?""?/\\\\:", " a\\:b:", " a\\\\b:", + " a' b:", " " LQ_ENC RQ_ENC ":", " " LQ RQ ":" } }, + + /* left_quote = "# " and right_quote = "\n" */ + { { "# \n", "# \\0001\\0\n", 10, "# simple\n", + "# \\t\\n'\"\\033?""?/\\\\\n", "# a:b\n", "# a\\\\b\n", + "# a' b\n", "# " LQ_ENC RQ_ENC "\n", "# " LQ RQ "\n" }, + { "# \n", "# \\0001\\0\n", 10, "# simple\n", + "# \\t\\n'\"\\033?""?/\\\\\n", "# a:b\n", "# a\\\\b\n", + "# a' b\n", "# " LQ_ENC RQ_ENC "\n", "# " LQ RQ "\n" }, + { "# \n", "# \\0001\\0\n", 10, "# simple\n", + "# \\t\\n'\"\\033?""?/\\\\\n", "# a\\:b\n", "# a\\\\b\n", + "# a' b\n", "# " LQ_ENC RQ_ENC "\n", "# " LQ RQ "\n" } }, + + /* left_quote = "\"'" and right_quote = "'\"" */ + { { "\"''\"", "\"'\\0001\\0'\"", 11, "\"'simple'\"", + "\"' \\t\\n\\'\"\\033?""?/\\\\'\"", "\"'a:b'\"", "\"'a\\\\b'\"", + "\"'a' b'\"", "\"'" LQ_ENC RQ_ENC "'\"", "\"'" LQ RQ "'\"" }, + { "\"''\"", "\"'\\0001\\0'\"", 11, "\"'simple'\"", + "\"' \\t\\n\\'\"\\033?""?/\\\\'\"", "\"'a:b'\"", "\"'a\\\\b'\"", + "\"'a' b'\"", "\"'" LQ_ENC RQ_ENC "'\"", "\"'" LQ RQ "'\"" }, + { "\"''\"", "\"'\\0001\\0'\"", 11, "\"'simple'\"", + "\"' \\t\\n\\'\"\\033?""?/\\\\'\"", "\"'a\\:b'\"", "\"'a\\\\b'\"", + "\"'a' b'\"", "\"'" LQ_ENC RQ_ENC "'\"", "\"'" LQ RQ "'\"" } } +}; + +static char * +use_quote_double_quotes (const char *str, size_t *len) +{ + char *p = *len == SIZE_MAX ? quotearg_char (str, '"') + : quotearg_char_mem (str, *len, '"'); + *len = strlen (p); + return p; +} + +int +main (int argc _GL_UNUSED, char *argv[]) +{ + int i; + bool ascii_only = MB_CUR_MAX == 1 && !isprint ((unsigned char) LQ[0]); + + /* This part of the program is hard-wired to the C locale since it + does not call setlocale. However, according to POSIX, the use of + 8-bit bytes in a character context in the C locale gives + unspecified results (that is, the C locale charset is allowed to + be unibyte with 8-bit bytes rejected [ASCII], unibyte with 8-bit + bytes being characters [often ISO-8859-1], or multibyte [often + UTF-8]). We assume that the latter two cases will be + indistinguishable in this test - that is, the LQ and RQ sequences + will pass through unchanged in either type of charset. So when + testing for quoting of str7, use the ascii_only flag to decide + what to expect for the 8-bit data being quoted. */ + ASSERT (!isprint ('\033')); + for (i = literal_quoting_style; i <= clocale_quoting_style; i++) + { + set_quoting_style (NULL, (enum quoting_style) i); + if (!(i == locale_quoting_style || i == clocale_quoting_style) + || (strcmp (locale_charset (), "ASCII") == 0 + || strcmp (locale_charset (), "ANSI_X3.4-1968") == 0)) + { + compare_strings (use_quotearg_buffer, &results_g[i].group1, + ascii_only); + compare_strings (use_quotearg, &results_g[i].group2, + ascii_only); + if (i == c_quoting_style) + compare_strings (use_quote_double_quotes, &results_g[i].group2, + ascii_only); + compare_strings (use_quotearg_colon, &results_g[i].group3, + ascii_only); + } + } + + set_quoting_style (NULL, literal_quoting_style); + ASSERT (set_quoting_flags (NULL, QA_ELIDE_NULL_BYTES) == 0); + compare_strings (use_quotearg_buffer, &flag_results[0].group1, ascii_only); + compare_strings (use_quotearg, &flag_results[0].group2, ascii_only); + compare_strings (use_quotearg_colon, &flag_results[0].group3, ascii_only); + + set_quoting_style (NULL, c_quoting_style); + ASSERT (set_quoting_flags (NULL, QA_ELIDE_OUTER_QUOTES) + == QA_ELIDE_NULL_BYTES); + compare_strings (use_quotearg_buffer, &flag_results[1].group1, ascii_only); + compare_strings (use_quotearg, &flag_results[1].group2, ascii_only); + compare_strings (use_quote_double_quotes, &flag_results[1].group2, + ascii_only); + compare_strings (use_quotearg_colon, &flag_results[1].group3, ascii_only); + + ASSERT (set_quoting_flags (NULL, QA_SPLIT_TRIGRAPHS) + == QA_ELIDE_OUTER_QUOTES); + compare_strings (use_quotearg_buffer, &flag_results[2].group1, ascii_only); + compare_strings (use_quotearg, &flag_results[2].group2, ascii_only); + compare_strings (use_quote_double_quotes, &flag_results[2].group2, + ascii_only); + compare_strings (use_quotearg_colon, &flag_results[2].group3, ascii_only); + + ASSERT (set_quoting_flags (NULL, 0) == QA_SPLIT_TRIGRAPHS); + + for (i = 0; i < sizeof custom_quotes / sizeof *custom_quotes; ++i) + { + set_custom_quoting (NULL, + custom_quotes[i][0], custom_quotes[i][1]); + compare_strings (use_quotearg_buffer, &custom_results[i].group1, + ascii_only); + compare_strings (use_quotearg, &custom_results[i].group2, ascii_only); + compare_strings (use_quotearg_colon, &custom_results[i].group3, + ascii_only); + } + + { + /* Trigger the bug whereby quotearg_buffer would read beyond the NUL + that defines the end of the string being quoted. Use an input + string whose NUL is the last byte before an unreadable page. */ + char *z = zerosize_ptr (); + + if (z) + { + size_t q_len = 1024; + char *q = malloc (q_len + 1); + char buf[10]; + memset (q, 'Q', q_len); + q[q_len] = 0; + + /* Z points to the boundary between a readable/writable page + and one that is neither readable nor writable. Position + our string so its NUL is at the end of the writable one. */ + char const *str = "____"; + size_t s_len = strlen (str); + z -= s_len + 1; + memcpy (z, str, s_len + 1); + + set_custom_quoting (NULL, q, q); + /* Whether this actually triggers a SEGV depends on the + implementation of memcmp: whether it compares only byte-at- + a-time, and from left to right (no SEGV) or some other way. */ + size_t n = quotearg_buffer (buf, sizeof buf, z, SIZE_MAX, NULL); + ASSERT (n == s_len + 2 * q_len); + ASSERT (memcmp (buf, q, sizeof buf) == 0); + free (q); + } + } + + quotearg_free (); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-quotearg.h b/local/recipes/tools/diffutils/source/gnulib-tests/test-quotearg.h new file mode 100644 index 0000000000..5aee78966d --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-quotearg.h @@ -0,0 +1,128 @@ +/* Test of quotearg family of functions. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2008. */ + +struct result_strings { + char const *str1; /* Translation of "". */ + char const *str2; /* Translation of "\0""1\0". */ + size_t len2; /* Length of str2. */ + char const *str3; /* Translation of "simple". */ + char const *str4; /* Translation of " \t\n'\"\033?""?/\\". */ + char const *str5; /* Translation of "a:b". */ + char const *str6; /* Translation of "a\\b". */ + char const *str7; /* Translation of "a' b". */ + char const *str8a; /* Translation of LQ RQ, in ASCII charset. */ + char const *str8b; /* Translation of LQ RQ, in Latin1 or UTF-8 charset. */ +}; + +struct result_groups { + struct result_strings group1; /* Via quotearg_buffer. */ + struct result_strings group2; /* Via quotearg{,_mem}. */ + struct result_strings group3; /* Via quotearg_colon{,_mem}. */ +}; + +/* These quotes are borrowed from a pt_PT.utf8 translation. */ +# define LQ "\302\253" +# define RQ "\302\273" +# define LQ_ENC "\\302\\253" +# define RQ_ENC "\\302\\273" +# define RQ_ESC "\\\302\273" + +static struct result_strings inputs = { + "", "\0001\0", 3, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b", + "a' b", LQ RQ, NULL +}; + +static void +compare (char const *a, size_t la, char const *b, size_t lb) +{ + ASSERT (la == lb); + ASSERT (memcmp (a, b, la) == 0); + ASSERT (b[lb] == '\0'); +} + +static void +compare_strings (char *(func) (char const *, size_t *), + struct result_strings *results, bool ascii_only) +{ + size_t len; + char *p; + + len = 0; + p = func (inputs.str1, &len); + compare (results->str1, strlen (results->str1), p, len); + + len = inputs.len2; + p = func (inputs.str2, &len); + compare (results->str2, results->len2, p, len); + + len = SIZE_MAX; + p = func (inputs.str3, &len); + compare (results->str3, strlen (results->str3), p, len); + + len = strlen (inputs.str4); + p = func (inputs.str4, &len); + compare (results->str4, strlen (results->str4), p, len); + + len = SIZE_MAX; + p = func (inputs.str5, &len); + compare (results->str5, strlen (results->str5), p, len); + + len = strlen (inputs.str6); + p = func (inputs.str6, &len); + compare (results->str6, strlen (results->str6), p, len); + + len = strlen (inputs.str7); + p = func (inputs.str7, &len); + compare (results->str7, strlen (results->str7), p, len); + + len = strlen (inputs.str8a); + p = func (inputs.str8a, &len); + if (ascii_only) + compare (results->str8a, strlen (results->str8a), p, len); + else + compare (results->str8b, strlen (results->str8b), p, len); +} + +static char * +use_quotearg_buffer (const char *str, size_t *len) +{ + static char buf[100]; + size_t size; + memset (buf, 0xa5, 100); + size = quotearg_buffer (buf, 100, str, *len, NULL); + *len = size; + ASSERT ((unsigned char) buf[size + 1] == 0xa5); + return buf; +} + +static char * +use_quotearg (const char *str, size_t *len) +{ + char *p = *len == SIZE_MAX ? quotearg (str) : quotearg_mem (str, *len); + *len = strlen (p); + return p; +} + +static char * +use_quotearg_colon (const char *str, size_t *len) +{ + char *p = (*len == SIZE_MAX ? quotearg_colon (str) + : quotearg_colon_mem (str, *len)); + *len = strlen (p); + return p; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-raise.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-raise.c new file mode 100644 index 0000000000..47c34ce9d6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-raise.c @@ -0,0 +1,50 @@ +/* Test raising a signal. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <signal.h> + +#include "signature.h" +SIGNATURE_CHECK (raise, int, (int)); + +#include <stdlib.h> + +#include "macros.h" + +/* It is safe to use _Noreturn here: exit() never returns, and GCC knows that + exit() is a non-returning function, even on platforms where its declaration + in <stdlib.h> does not have the 'noreturn' attribute. */ +static _Noreturn void +handler (int sig) +{ + exit (0); +} + +int +main (void) +{ + /* Test behaviour for invalid argument. */ + ASSERT (raise (-1) != 0); + + /* Test behaviour for SIGINT. */ + ASSERT (signal (SIGINT, handler) != SIG_ERR); + + raise (SIGINT); + + /* We should not get here, because the handler takes away the control. */ + exit (1); +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-rawmemchr.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-rawmemchr.c new file mode 100644 index 0000000000..5480f43c78 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-rawmemchr.c @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2008-2017 Free Software Foundation, Inc. + * Written by Eric Blake and Bruno Haible + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <string.h> + +#include "signature.h" +SIGNATURE_CHECK (rawmemchr, void *, (void const *, int)); + +#include <stdlib.h> + +#include "zerosize-ptr.h" +#include "macros.h" + +/* Calculating void * + int is not portable, so this wrapper converts + to char * to make the tests easier to write. */ +#define RAWMEMCHR (char *) rawmemchr + +int +main (void) +{ + size_t n = 0x100000; + char *input = malloc (n + 1); + ASSERT (input); + + input[0] = 'a'; + input[1] = 'b'; + memset (input + 2, 'c', 1024); + memset (input + 1026, 'd', n - 1028); + input[n - 2] = 'e'; + input[n - 1] = 'a'; + input[n] = '\0'; + + /* Basic behavior tests. */ + ASSERT (RAWMEMCHR (input, 'a') == input); + ASSERT (RAWMEMCHR (input, 'b') == input + 1); + ASSERT (RAWMEMCHR (input, 'c') == input + 2); + ASSERT (RAWMEMCHR (input, 'd') == input + 1026); + + ASSERT (RAWMEMCHR (input + 1, 'a') == input + n - 1); + ASSERT (RAWMEMCHR (input + 1, 'e') == input + n - 2); + ASSERT (RAWMEMCHR (input + 1, 0x789abc00 | 'e') == input + n - 2); + + ASSERT (RAWMEMCHR (input, '\0') == input + n); + + /* Alignment tests. */ + { + int i, j; + for (i = 0; i < 32; i++) + { + for (j = 0; j < 256; j++) + input[i + j] = j; + for (j = 0; j < 256; j++) + { + ASSERT (RAWMEMCHR (input + i, j) == input + i + j); + } + } + } + + /* Ensure that no unaligned oversized reads occur. */ + { + char *page_boundary = (char *) zerosize_ptr (); + size_t i; + + if (!page_boundary) + page_boundary = input + 4096; + memset (page_boundary - 512, '1', 511); + page_boundary[-1] = '2'; + for (i = 1; i <= 512; i++) + ASSERT (RAWMEMCHR (page_boundary - i, (i * 0x01010100) | '2') + == page_boundary - 1); + } + + free (input); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-readlink.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-readlink.c new file mode 100644 index 0000000000..7911cf404c --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-readlink.c @@ -0,0 +1,48 @@ +/* Tests of readlink. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +#include <config.h> + +#include <unistd.h> + +#include "signature.h" +SIGNATURE_CHECK (readlink, ssize_t, (char const *, char *, size_t)); + +#include <fcntl.h> +#include <errno.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/stat.h> + +#include "ignore-value.h" +#include "macros.h" + +#define BASE "test-readlink.t" + +#include "test-readlink.h" + +int +main (void) +{ + /* Remove any leftovers from a previous partial run. */ + ignore_value (system ("rm -rf " BASE "*")); + + return test_readlink (readlink, true); +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-readlink.h b/local/recipes/tools/diffutils/source/gnulib-tests/test-readlink.h new file mode 100644 index 0000000000..674aef8141 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-readlink.h @@ -0,0 +1,119 @@ +/* Tests of readlink. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +/* This file is designed to test both readlink(a,b,c) and + readlinkat(AT_FDCWD,a,b,c). FUNC is the function to test. Assumes + that BASE and ASSERT are already defined, and that appropriate + headers are already included. If PRINT, warn before skipping + symlink tests with status 77. */ + +static int +test_readlink (ssize_t (*func) (char const *, char *, size_t), bool print) +{ + char buf[80]; + + /* Sanity checks of failures. Mingw lacks symlink, but readlink can + still distinguish between various errors. */ + memset (buf, 0xff, sizeof buf); + errno = 0; + ASSERT (func ("no_such", buf, sizeof buf) == -1); + ASSERT (errno == ENOENT); + errno = 0; + ASSERT (func ("no_such/", buf, sizeof buf) == -1); + ASSERT (errno == ENOENT); + errno = 0; + ASSERT (func ("", buf, sizeof buf) == -1); + ASSERT (errno == ENOENT || errno == EINVAL); + errno = 0; + ASSERT (func (".", buf, sizeof buf) == -1); + ASSERT (errno == EINVAL); + errno = 0; + ASSERT (func ("./", buf, sizeof buf) == -1); + ASSERT (errno == EINVAL); + ASSERT (close (creat (BASE "file", 0600)) == 0); + errno = 0; + ASSERT (func (BASE "file", buf, sizeof buf) == -1); + ASSERT (errno == EINVAL); + errno = 0; + ASSERT (func (BASE "file/", buf, sizeof buf) == -1); + ASSERT (errno == ENOTDIR || errno == EINVAL); /* AIX yields EINVAL */ + + /* Now test actual symlinks. */ + if (symlink (BASE "dir", BASE "link")) + { + ASSERT (unlink (BASE "file") == 0); + if (print) + fputs ("skipping test: symlinks not supported on this file system\n", + stderr); + return 77; + } + ASSERT (mkdir (BASE "dir", 0700) == 0); + errno = 0; + ASSERT (func (BASE "link/", buf, sizeof buf) == -1); + ASSERT (errno == EINVAL); + ASSERT (symlink (BASE "link", BASE "link2") == 0); + errno = 0; + ASSERT (func (BASE "link2/", buf, sizeof buf) == -1); + ASSERT (errno == EINVAL); + ASSERT (unlink (BASE "link2") == 0); + ASSERT (symlink (BASE "file", BASE "link2") == 0); + errno = 0; + ASSERT (func (BASE "link2/", buf, sizeof buf) == -1); + ASSERT (errno == ENOTDIR || errno == EINVAL); /* AIX yields EINVAL */ + ASSERT (unlink (BASE "file") == 0); + ASSERT (unlink (BASE "link2") == 0); + { + /* Up till now, no readlink has been successful, so buf should be + unchanged. */ + int i; + for (i = 0; i < sizeof buf; i++) + ASSERT (buf[i] == (char) 0xff); + } + { + size_t len = strlen (BASE "dir"); + /* When passing too small of a buffer, expect the truncated + length, or an ERANGE failure. However, a size of 0 is not + portable enough to test. */ + ssize_t result; + errno = 0; + result = readlink (BASE "link", buf, 1); + if (result == -1) + { + ASSERT (errno == ERANGE); + ASSERT (buf[0] == (char) 0xff); + } + else + { + ASSERT (result == 1); + ASSERT (buf[0] == BASE[0]); + } + ASSERT (buf[1] == (char) 0xff); + ASSERT (func (BASE "link", buf, len) == len); + ASSERT (strncmp (buf, BASE "dir", len) == 0); + ASSERT (buf[len] == (char) 0xff); + ASSERT (func (BASE "link", buf, sizeof buf) == len); + ASSERT (strncmp (buf, BASE "dir", len) == 0); + /* POSIX says rest of buf is unspecified; but in practice, it is + either left alone, or NUL-terminated. */ + ASSERT (buf[len] == '\0' || buf[len] == (char) 0xff); + } + ASSERT (rmdir (BASE "dir") == 0); + ASSERT (unlink (BASE "link") == 0); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-regex.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-regex.c new file mode 100644 index 0000000000..9173fe8e2d --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-regex.c @@ -0,0 +1,253 @@ +/* Test regular expressions + Copyright 1996-2001, 2003-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "regex.h" + +#include <locale.h> +#include <limits.h> +#include <stdlib.h> +#include <string.h> +#if HAVE_DECL_ALARM +# include <unistd.h> +# include <signal.h> +#endif + +#include "localcharset.h" + +int +main (void) +{ + int result = 0; + static struct re_pattern_buffer regex; + unsigned char folded_chars[UCHAR_MAX + 1]; + int i; + const char *s; + struct re_registers regs; + +#if HAVE_DECL_ALARM + /* Some builds of glibc go into an infinite loop on this test. */ + int alarm_value = 2; + signal (SIGALRM, SIG_DFL); + alarm (alarm_value); +#endif + if (setlocale (LC_ALL, "en_US.UTF-8")) + { + { + /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html + This test needs valgrind to catch the bug on Debian + GNU/Linux 3.1 x86, but it might catch the bug better + on other platforms and it shouldn't hurt to try the + test here. */ + static char const pat[] = "insert into"; + static char const data[] = + "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK"; + re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE + | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else + { + memset (®s, 0, sizeof regs); + if (re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, ®s) + != -1) + result |= 1; + regfree (®ex); + free (regs.start); + free (regs.end); + } + } + + /* Check whether it's really a UTF-8 locale. + On mingw, the setlocale call succeeds but returns + "English_United States.1252", with locale_charset() returning + "CP1252". */ + if (strcmp (locale_charset (), "UTF-8") == 0) + { + /* This test is from glibc bug 15078. + The test case is from Andreas Schwab in + <http://www.sourceware.org/ml/libc-alpha/2013-01/msg00967.html>. + */ + static char const pat[] = "[^x]x"; + static char const data[] = + /* <U1000><U103B><U103D><U1014><U103A><U102F><U1015><U103A> */ + "\xe1\x80\x80" + "\xe1\x80\xbb" + "\xe1\x80\xbd" + "\xe1\x80\x94" + "\xe1\x80\xba" + "\xe1\x80\xaf" + "\xe1\x80\x95" + "\xe1\x80\xba" + "x"; + re_set_syntax (0); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else + { + memset (®s, 0, sizeof regs); + i = re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, 0); + if (i != 0 && i != 21) + result |= 1; + regfree (®ex); + free (regs.start); + free (regs.end); + } + } + + if (! setlocale (LC_ALL, "C")) + return 1; + } + + /* This test is from glibc bug 3957, reported by Andrew Mackey. */ + re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[^x]b", 6, ®ex); + if (s) + result |= 2; + /* This should fail, but succeeds for glibc-2.5. */ + else + { + memset (®s, 0, sizeof regs); + if (re_search (®ex, "a\nb", 3, 0, 3, ®s) != -1) + result |= 2; + regfree (®ex); + free (regs.start); + free (regs.end); + } + + /* This regular expression is from Spencer ere test number 75 + in grep-2.3. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP); + memset (®ex, 0, sizeof regex); + for (i = 0; i <= UCHAR_MAX; i++) + folded_chars[i] = i; + regex.translate = folded_chars; + s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, ®ex); + /* This should fail with _Invalid character class name_ error. */ + if (!s) + { + result |= 4; + regfree (®ex); + } + + /* Ensure that [b-a] is diagnosed as invalid, when + using RE_NO_EMPTY_RANGES. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[b-a]", 6, ®ex); + if (s == 0) + { + result |= 8; + regfree (®ex); + } + + /* This should succeed, but does not for glibc-2.1.3. */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("{1", 2, ®ex); + if (s) + result |= 8; + else + regfree (®ex); + + /* The following example is derived from a problem report + against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[an\371]*n", 7, ®ex); + if (s) + result |= 8; + /* This should match, but does not for glibc-2.2.1. */ + else + { + memset (®s, 0, sizeof regs); + if (re_match (®ex, "an", 2, 0, ®s) != 2) + result |= 8; + regfree (®ex); + free (regs.start); + free (regs.end); + } + + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 8; + /* glibc-2.2.93 does not work with a negative RANGE argument. */ + else + { + memset (®s, 0, sizeof regs); + if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1) + result |= 8; + regfree (®ex); + free (regs.start); + free (regs.end); + } + + /* The version of regex.c in older versions of gnulib + ignored RE_ICASE. Detect that problem too. */ + re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 16; + else + { + memset (®s, 0, sizeof regs); + if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0) + result |= 16; + regfree (®ex); + free (regs.start); + free (regs.end); + } + + /* Catch a bug reported by Vin Shelton in + http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html + */ + re_set_syntax (RE_SYNTAX_POSIX_BASIC + & ~RE_CONTEXT_INVALID_DUP + & ~RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, ®ex); + if (s) + result |= 32; + else + regfree (®ex); + + /* REG_STARTEND was added to glibc on 2004-01-15. + Reject older versions. */ + if (! REG_STARTEND) + result |= 64; + +#if 0 + /* It would be nice to reject hosts whose regoff_t values are too + narrow (including glibc on hosts with 64-bit ptrdiff_t and + 32-bit int), but we should wait until glibc implements this + feature. Otherwise, support for equivalence classes and + multibyte collation symbols would always be broken except + when compiling --without-included-regex. */ + if (sizeof (regoff_t) < sizeof (ptrdiff_t) + || sizeof (regoff_t) < sizeof (ssize_t)) + result |= 64; +#endif + + return result; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-select-fd.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-select-fd.c new file mode 100644 index 0000000000..d375fc3ffe --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-select-fd.c @@ -0,0 +1,72 @@ +/* Test of select() substitute, reading or writing from a given file descriptor. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <stdio.h> +#include <stdlib.h> +#include <sys/select.h> + +int +main (int argc, char *argv[]) +{ + if (argc == 4) + { + char mode = argv[1][0]; + + if (mode == 'r' || mode == 'w') + { + int fd = atoi (argv[2]); + + if (fd >= 0) + { + const char *result_file_name = argv[3]; + FILE *result_file = fopen (result_file_name, "wb"); + + if (result_file != NULL) + { + fd_set fds; + struct timeval timeout; + int ret; + + FD_ZERO (&fds); + FD_SET (fd, &fds); + timeout.tv_sec = 0; + timeout.tv_usec = 10000; + ret = (mode == 'r' + ? select (fd + 1, &fds, NULL, NULL, &timeout) + : select (fd + 1, NULL, &fds, NULL, &timeout)); + if (ret < 0) + { + perror ("select failed"); + exit (1); + } + if ((ret == 0) != ! FD_ISSET (fd, &fds)) + { + fprintf (stderr, "incorrect return value\n"); + exit (1); + } + fprintf (result_file, "%d\n", ret); + exit (0); + } + } + } + } + fprintf (stderr, "Usage: test-select-fd mode fd result-file-name\n"); + exit (1); +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-select-in.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-select-in.sh new file mode 100755 index 0000000000..44f5dbb8e8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-select-in.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# Test select() on file descriptors opened for reading. + +# This test is known to fail on Solaris 2.6 and older, due to its handling +# of /dev/null. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles t-select-in.tmp" + +# Regular files. + +rm -f t-select-in.tmp +./test-select-fd${EXEEXT} r 0 t-select-in.tmp < ./test-select-fd${EXEEXT} +test `cat t-select-in.tmp` = "1" || exit 1 + +# Pipes. + +rm -f t-select-in.tmp +{ sleep 1; echo abc; } | \ + { ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; cat > /dev/null; } +test `cat t-select-in.tmp` = "0" || exit 1 + +rm -f t-select-in.tmp +echo abc | { sleep 1; ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; } +test `cat t-select-in.tmp` = "1" || exit 1 + +# Special files. +# This part of the test is known to fail on Solaris 2.6 and older. + +rm -f t-select-in.tmp +./test-select-fd${EXEEXT} r 0 t-select-in.tmp < /dev/null +test `cat t-select-in.tmp` = "1" || exit 1 + +rm -fr $tmpfiles + +exit 0 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-select-out.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-select-out.sh new file mode 100755 index 0000000000..c5fd8619f6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-select-out.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# Test select() on file descriptors opened for writing. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles t-select-out.out t-select-out.tmp" + +# Regular files. + +rm -f t-select-out.tmp +./test-select-fd${EXEEXT} w 1 t-select-out.tmp > t-select-out.out +test `cat t-select-out.tmp` = "1" || exit 1 + +# Pipes. + +if false; then # This test fails on some platforms. + rm -f t-select-out.tmp + ( { echo abc; ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | { sleep 1; cat; } ) > /dev/null + test `cat t-select-out.tmp` = "0" || exit 1 +fi + +rm -f t-select-out.tmp +( { sleep 1; echo abc; ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | cat) > /dev/null +test `cat t-select-out.tmp` = "1" || exit 1 + +# Special files. + +rm -f t-select-out.tmp +./test-select-fd${EXEEXT} w 1 t-select-out.tmp > /dev/null +test `cat t-select-out.tmp` = "1" || exit 1 + +rm -fr $tmpfiles + +exit 0 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-select-stdin.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-select-stdin.c new file mode 100644 index 0000000000..698ed5b69b --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-select-stdin.c @@ -0,0 +1,83 @@ +/* Test of select() substitute, reading from stdin. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <stdio.h> +#include <stdlib.h> +#include <sys/select.h> +#include <sys/time.h> +#include <unistd.h> + +#include "macros.h" + +int +main (void) +{ + printf ("Applying select() from standard input. Press Ctrl-C to abort.\n"); + for (;;) + { + struct timeval before; + struct timeval after; + unsigned long spent_usec; + fd_set readfds; + struct timeval timeout; + int ret; + + gettimeofday (&before, NULL); + + FD_ZERO (&readfds); + FD_SET (0, &readfds); + timeout.tv_sec = 0; + timeout.tv_usec = 500000; + ret = select (1, &readfds, NULL, NULL, &timeout); + + gettimeofday (&after, NULL); + spent_usec = (after.tv_sec - before.tv_sec) * 1000000 + + after.tv_usec - before.tv_usec; + + if (ret < 0) + { + perror ("select failed"); + exit (1); + } + if ((ret == 0) != ! FD_ISSET (0, &readfds)) + { + fprintf (stderr, "incorrect return value\n"); + exit (1); + } + if (ret == 0) + { + if (spent_usec < 250000) + { + fprintf (stderr, "returned too early\n"); + exit (1); + } + /* Timeout */ + printf ("."); + ASSERT (fflush (stdout) == 0); + } + else + { + char c; + + printf ("Input available! Trying to read 1 byte...\n"); + ASSERT (read (0, &c, 1) == 1); + } + } +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-select.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-select.c new file mode 100644 index 0000000000..e7bf488168 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-select.c @@ -0,0 +1,34 @@ +/* Test of select() substitute. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paolo Bonzini, 2008. */ + +#include <config.h> + +#include <sys/select.h> + +#include "signature.h" + +SIGNATURE_CHECK (select, int, (int, fd_set *, fd_set *, fd_set *, + struct timeval *)); + +#include "test-select.h" + +int +main (void) +{ + return test_function (select); +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-select.h b/local/recipes/tools/diffutils/source/gnulib-tests/test-select.h new file mode 100644 index 0000000000..aa67ca0c10 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-select.h @@ -0,0 +1,462 @@ +/* Test of select() substitute. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paolo Bonzini, 2008. */ + +#include <stdio.h> +#include <string.h> +#include <netinet/in.h> +#include <arpa/inet.h> +#include <unistd.h> +#include <fcntl.h> +#include <stdlib.h> +#include <stdbool.h> +#include <sys/ioctl.h> +#include <errno.h> + +#include "macros.h" + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# define WINDOWS_NATIVE +#endif + +#ifdef HAVE_SYS_WAIT_H +# include <sys/wait.h> +#endif + +#ifndef SO_REUSEPORT +# define SO_REUSEPORT SO_REUSEADDR +#endif + +#define TEST_PORT 12345 + + +typedef int (*select_fn) (int, fd_set *, fd_set *, fd_set *, struct timeval *); + + +/* Minimal testing infrastructure. */ + +static int failures; + +static void +failed (const char *reason) +{ + if (++failures > 1) + printf (" "); + printf ("failed (%s)\n", reason); +} + +static int +test (void (*fn) (select_fn), select_fn my_select, const char *msg) +{ + failures = 0; + printf ("%s... ", msg); + fflush (stdout); + fn (my_select); + + if (!failures) + printf ("passed\n"); + + return failures; +} + + +/* Funny socket code. */ + +static int +open_server_socket (void) +{ + int s, x; + struct sockaddr_in ia; + + s = socket (AF_INET, SOCK_STREAM, 0); + + x = 1; + setsockopt (s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof (x)); + + memset (&ia, 0, sizeof (ia)); + ia.sin_family = AF_INET; + inet_pton (AF_INET, "127.0.0.1", &ia.sin_addr); + ia.sin_port = htons (TEST_PORT); + if (bind (s, (struct sockaddr *) &ia, sizeof (ia)) < 0) + { + perror ("bind"); + exit (77); + } + + if (listen (s, 1) < 0) + { + perror ("listen"); + exit (77); + } + + return s; +} + +static int +connect_to_socket (bool blocking) +{ + int s; + struct sockaddr_in ia; + + s = socket (AF_INET, SOCK_STREAM, 0); + + memset (&ia, 0, sizeof (ia)); + ia.sin_family = AF_INET; + inet_pton (AF_INET, "127.0.0.1", &ia.sin_addr); + ia.sin_port = htons (TEST_PORT); + + if (!blocking) + { +#ifdef WINDOWS_NATIVE + unsigned long iMode = 1; + ioctl (s, FIONBIO, (char *) &iMode); + +#elif defined F_GETFL + int oldflags = fcntl (s, F_GETFL, NULL); + + if (!(oldflags & O_NONBLOCK)) + fcntl (s, F_SETFL, oldflags | O_NONBLOCK); +#endif + } + + if (connect (s, (struct sockaddr *) &ia, sizeof (ia)) < 0 + && (blocking || errno != EINPROGRESS)) + { + perror ("connect"); + exit (77); + } + + return s; +} + + +/* A slightly more convenient interface to select(2). + Waits until a specific event occurs on a file descriptor FD. + EV is a bit mask of events to look for: + SEL_IN - input can be polled without blocking, + SEL_OUT - output can be provided without blocking, + SEL_EXC - an exception occurred, + A maximum wait time is specified by TIMEOUT. + *TIMEOUT = { 0, 0 } means to return immediately, + TIMEOUT = NULL means to wait indefinitely. */ + +enum { SEL_IN = 1, SEL_OUT = 2, SEL_EXC = 4 }; + +static int +do_select (int fd, int ev, struct timeval *timeout, select_fn my_select) +{ + fd_set rfds, wfds, xfds; + int r, rev; + + FD_ZERO (&rfds); + FD_ZERO (&wfds); + FD_ZERO (&xfds); + if (ev & SEL_IN) + FD_SET (fd, &rfds); + if (ev & SEL_OUT) + FD_SET (fd, &wfds); + if (ev & SEL_EXC) + FD_SET (fd, &xfds); + r = my_select (fd + 1, &rfds, &wfds, &xfds, timeout); + if (r < 0) + return r; + + rev = 0; + if (FD_ISSET (fd, &rfds)) + rev |= SEL_IN; + if (FD_ISSET (fd, &wfds)) + rev |= SEL_OUT; + if (FD_ISSET (fd, &xfds)) + rev |= SEL_EXC; + if (rev && r == 0) + failed ("select returned 0"); + if (rev & ~ev) + failed ("select returned unrequested events"); + + return rev; +} + +static int +do_select_nowait (int fd, int ev, select_fn my_select) +{ + struct timeval tv0; + tv0.tv_sec = 0; + tv0.tv_usec = 0; + return do_select (fd, ev, &tv0, my_select); +} + +static int +do_select_wait (int fd, int ev, select_fn my_select) +{ + return do_select (fd, ev, NULL, my_select); +} + + +/* Test select(2) for TTYs. */ + +#ifdef INTERACTIVE +static void +test_tty (select_fn my_select) +{ + if (do_select_nowait (0, SEL_IN, my_select) != 0) + failed ("can read"); + if (do_select_nowait (0, SEL_OUT, my_select) == 0) + failed ("cannot write"); + + if (do_select_wait (0, SEL_IN, my_select) == 0) + failed ("return with infinite timeout"); + + getchar (); + if (do_select_nowait (0, SEL_IN, my_select) != 0) + failed ("can read after getc"); +} +#endif + + +static int +do_select_bad_nfd_nowait (int nfd, select_fn my_select) +{ + struct timeval tv0; + tv0.tv_sec = 0; + tv0.tv_usec = 0; + errno = 0; + return my_select (nfd, NULL, NULL, NULL, &tv0); +} + +static void +test_bad_nfd (select_fn my_select) +{ + if (do_select_bad_nfd_nowait (-1, my_select) != -1 || errno != EINVAL) + failed ("invalid errno after negative nfds"); + /* Can't test FD_SETSIZE + 1 for EINVAL, since some systems allow + dynamically larger set size by redefining FD_SETSIZE anywhere up + to the actual maximum fd. */ + /* if (do_select_bad_nfd_nowait (FD_SETSIZE + 1, my_select) != -1 */ + /* || errno != EINVAL) */ + /* failed ("invalid errno after bogus nfds"); */ +} + +/* Test select(2) on invalid file descriptors. */ + +static int +do_select_bad_fd (int fd, int ev, struct timeval *timeout, select_fn my_select) +{ + fd_set rfds, wfds, xfds; + + FD_ZERO (&rfds); + FD_ZERO (&wfds); + FD_ZERO (&xfds); + if (ev & SEL_IN) + FD_SET (fd, &rfds); + if (ev & SEL_OUT) + FD_SET (fd, &wfds); + if (ev & SEL_EXC) + FD_SET (fd, &xfds); + errno = 0; + return my_select (fd + 1, &rfds, &wfds, &xfds, timeout); + /* In this case, when fd is invalid, on some platforms, the bit for fd + is left alone in the fd_set, whereas on other platforms it is cleared. + So, don't check the bit for fd here. */ +} + +static int +do_select_bad_fd_nowait (int fd, int ev, select_fn my_select) +{ + struct timeval tv0; + tv0.tv_sec = 0; + tv0.tv_usec = 0; + return do_select_bad_fd (fd, ev, &tv0, my_select); +} + +static void +test_bad_fd (select_fn my_select) +{ + /* This tests fails on OSF/1 and native Windows, even with fd = 16. */ +#if !(defined __osf__ || defined WINDOWS_NATIVE) + int fd; + + /* On Linux, Mac OS X, *BSD, values of fd like 99 or 399 are discarded + by the kernel early and therefore do *not* lead to EBADF, as required + by POSIX. */ +# if defined __linux__ || (defined __APPLE__ && defined __MACH__) || (defined __FreeBSD__ || defined __DragonFly__) || defined __OpenBSD__ || defined __NetBSD__ + fd = 14; +# else + fd = 99; +# endif + close (fd); + + if (do_select_bad_fd_nowait (fd, SEL_IN, my_select) == 0 || errno != EBADF) + failed ("invalid fd among rfds"); + if (do_select_bad_fd_nowait (fd, SEL_OUT, my_select) == 0 || errno != EBADF) + failed ("invalid fd among wfds"); + if (do_select_bad_fd_nowait (fd, SEL_EXC, my_select) == 0 || errno != EBADF) + failed ("invalid fd among xfds"); +#endif +} + + +/* Test select(2) for unconnected nonblocking sockets. */ + +static void +test_connect_first (select_fn my_select) +{ + int s = open_server_socket (); + struct sockaddr_in ia; + socklen_t addrlen; + + int c1, c2; + + if (do_select_nowait (s, SEL_IN | SEL_EXC, my_select) != 0) + failed ("can read, socket not connected"); + + c1 = connect_to_socket (false); + + if (do_select_wait (s, SEL_IN | SEL_EXC, my_select) != SEL_IN) + failed ("expecting readability on passive socket"); + if (do_select_nowait (s, SEL_IN | SEL_EXC, my_select) != SEL_IN) + failed ("expecting readability on passive socket"); + + addrlen = sizeof (ia); + c2 = accept (s, (struct sockaddr *) &ia, &addrlen); + ASSERT (close (s) == 0); + ASSERT (close (c1) == 0); + ASSERT (close (c2) == 0); +} + + +/* Test select(2) for unconnected blocking sockets. */ + +static void +test_accept_first (select_fn my_select) +{ +#ifndef WINDOWS_NATIVE + int s = open_server_socket (); + struct sockaddr_in ia; + socklen_t addrlen; + char buf[3]; + int c, pid; + + pid = fork (); + if (pid < 0) + return; + + if (pid == 0) + { + addrlen = sizeof (ia); + c = accept (s, (struct sockaddr *) &ia, &addrlen); + ASSERT (close (s) == 0); + ASSERT (write (c, "foo", 3) == 3); + ASSERT (read (c, buf, 3) == 3); + shutdown (c, SHUT_RD); + ASSERT (close (c) == 0); + exit (0); + } + else + { + ASSERT (close (s) == 0); + c = connect_to_socket (true); + if (do_select_nowait (c, SEL_OUT, my_select) != SEL_OUT) + failed ("cannot write after blocking connect"); + ASSERT (write (c, "foo", 3) == 3); + wait (&pid); + if (do_select_wait (c, SEL_IN, my_select) != SEL_IN) + failed ("cannot read data left in the socket by closed process"); + ASSERT (read (c, buf, 3) == 3); + ASSERT (write (c, "foo", 3) == 3); + (void) close (c); /* may fail with errno = ECONNRESET */ + } +#endif +} + + +/* Common code for pipes and connected sockets. */ + +static void +test_pair (int rd, int wd, select_fn my_select) +{ + char buf[3]; + if (do_select_wait (wd, SEL_IN | SEL_OUT | SEL_EXC, my_select) != SEL_OUT) + failed ("expecting writability before writing"); + if (do_select_nowait (wd, SEL_IN | SEL_OUT | SEL_EXC, my_select) != SEL_OUT) + failed ("expecting writability before writing"); + + ASSERT (write (wd, "foo", 3) == 3); + if (do_select_wait (rd, SEL_IN, my_select) != SEL_IN) + failed ("expecting readability after writing"); + if (do_select_nowait (rd, SEL_IN, my_select) != SEL_IN) + failed ("expecting readability after writing"); + + ASSERT (read (rd, buf, 3) == 3); +} + + +/* Test select(2) on connected sockets. */ + +static void +test_socket_pair (select_fn my_select) +{ + struct sockaddr_in ia; + + socklen_t addrlen = sizeof (ia); + int s = open_server_socket (); + int c1 = connect_to_socket (false); + int c2 = accept (s, (struct sockaddr *) &ia, &addrlen); + + ASSERT (close (s) == 0); + + test_pair (c1, c2, my_select); + ASSERT (close (c1) == 0); + ASSERT (write (c2, "foo", 3) == 3); + (void) close (c2); /* may fail with errno = ECONNRESET */ +} + + +/* Test select(2) on pipes. */ + +static void +test_pipe (select_fn my_select) +{ + int fd[2]; + + ASSERT (pipe (fd) == 0); + test_pair (fd[0], fd[1], my_select); + ASSERT (close (fd[0]) == 0); + ASSERT (close (fd[1]) == 0); +} + + +/* Do them all. */ + +static int +test_function (select_fn my_select) +{ + int result = 0; + +#ifdef INTERACTIVE + printf ("Please press Enter\n"); + test (test_tty, "TTY", my_select); +#endif + + result += test (test_bad_nfd, my_select, "Invalid nfd test"); + result += test (test_bad_fd, my_select, "Invalid fd test"); + result += test (test_connect_first, my_select, "Unconnected socket test"); + result += test (test_socket_pair, my_select, "Connected sockets test"); + result += test (test_accept_first, my_select, "General socket test with fork"); + result += test (test_pipe, my_select, "Pipe test"); + + return result; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-setenv.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-setenv.c new file mode 100644 index 0000000000..d5e628f028 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-setenv.c @@ -0,0 +1,56 @@ +/* Tests of setenv. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +#include <config.h> + +#include <stdlib.h> + +#include "signature.h" +SIGNATURE_CHECK (setenv, int, (char const *, char const *, int)); + +#include <errno.h> +#include <string.h> +#include <unistd.h> + +#include "macros.h" + +int +main (void) +{ + /* Test overwriting. */ + ASSERT (setenv ("a", "==", -1) == 0); + ASSERT (setenv ("a", "2", 0) == 0); + ASSERT (strcmp (getenv ("a"), "==") == 0); + + /* Required to fail with EINVAL. */ + errno = 0; + ASSERT (setenv ("", "", 1) == -1); + ASSERT (errno == EINVAL); + errno = 0; + ASSERT (setenv ("a=b", "", 0) == -1); + ASSERT (errno == EINVAL); +#if 0 + /* glibc and gnulib's implementation guarantee this, but POSIX no + longer requires it: http://austingroupbugs.net/view.php?id=185 */ + errno = 0; + ASSERT (setenv (NULL, "", 0) == -1); + ASSERT (errno == EINVAL); +#endif + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-setlocale1.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-setlocale1.c new file mode 100644 index 0000000000..69e17cb60a --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-setlocale1.c @@ -0,0 +1,61 @@ +/* Test of setting the current locale. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <locale.h> + +#include "signature.h" +SIGNATURE_CHECK (setlocale, char *, (int, const char *)); + +#include <stdlib.h> +#include <string.h> + +#include "macros.h" + +int +main (int argc, char *argv[]) +{ + char *name1; + char *name2; + + /* Try to set the locale by implicitly looking at the LC_ALL environment + variable. + configure should already have checked that the locale is supported. */ + if (setlocale (LC_ALL, "") == NULL) + return 1; + + name1 = strdup (setlocale (LC_ALL, NULL)); + + /* Reset the locale. */ + if (setlocale (LC_ALL, "C") == NULL) + return 1; + + /* Try to set the locale by explicitly looking at the LC_ALL environment + variable. + configure should already have checked that the locale is supported. */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL) + return 1; + + name2 = strdup (setlocale (LC_ALL, NULL)); + + /* Test that the two results are the same. */ + ASSERT (strcmp (name1, name2) == 0); + free (name1); + free (name2); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-setlocale1.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-setlocale1.sh new file mode 100755 index 0000000000..59a0532dde --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-setlocale1.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +: ${LOCALE_FR=fr_FR} +: ${LOCALE_FR_UTF8=fr_FR.UTF-8} +: ${LOCALE_JA=ja_JP} +: ${LOCALE_ZH_CN=zh_CN.GB18030} + +if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none \ + && test $LOCALE_JA = none && test $LOCALE_ZH_CN = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no locale for testing is installed" + else + echo "Skipping test: no locale for testing is supported" + fi + exit 77 +fi + +if test $LOCALE_FR != none; then + LC_ALL=$LOCALE_FR ./test-setlocale1${EXEEXT} || exit 1 +fi + +if test $LOCALE_FR_UTF8 != none; then + LC_ALL=$LOCALE_FR_UTF8 ./test-setlocale1${EXEEXT} || exit 1 +fi + +if test $LOCALE_JA != none; then + LC_ALL=$LOCALE_JA ./test-setlocale1${EXEEXT} || exit 1 +fi + +if test $LOCALE_ZH_CN != none; then + LC_ALL=$LOCALE_ZH_CN ./test-setlocale1${EXEEXT} || exit 1 +fi + +exit 0 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-setlocale2.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-setlocale2.c new file mode 100644 index 0000000000..32d7bb30a7 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-setlocale2.c @@ -0,0 +1,55 @@ +/* Test of setting the current locale. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <locale.h> + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +int +main () +{ + /* Try to set the locale by implicitly looking at the LC_ALL environment + variable. */ + if (setlocale (LC_ALL, "") != NULL) + /* It was successful. Check whether LC_CTYPE is non-trivial. */ + if (strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + { + fprintf (stderr, "setlocale did not fail for implicit %s\n", + getenv ("LC_ALL")); + return 1; + } + + /* Reset the locale. */ + if (setlocale (LC_ALL, "C") == NULL) + return 1; + + /* Try to set the locale by explicitly looking at the LC_ALL environment + variable. */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) != NULL) + /* It was successful. Check whether LC_CTYPE is non-trivial. */ + if (strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + { + fprintf (stderr, "setlocale did not fail for explicit %s\n", + getenv ("LC_ALL")); + return 1; + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-setlocale2.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-setlocale2.sh new file mode 100755 index 0000000000..904e147f4a --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-setlocale2.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# Test locale names with likely unsupported encoding in Unix syntax. +for name in ar_SA.ISO-8859-1 fr_FR.CP1251 zh_TW.GB18030 zh_CN.BIG5; do + env LC_ALL=$name ./test-setlocale2${EXEEXT} 1 || exit 1 +done + +# Test locale names with likely unsupported encoding in native Windows syntax. +for name in "Arabic_Saudi Arabia.1252" "Arabic_Saudi Arabia.65001" \ + French_France.65001 Japanese_Japan.65001 Turkish_Turkey.65001 \ + Chinese_Taiwan.65001 Chinese_China.54936 Chinese_China.65001; do + # Here we use 'env' to set the LC_ALL environment variable, because on + # Solaris 11 2011-11, the /bin/sh refuses to do it for Turkish_Turkey.65001. + env LC_ALL="$name" ./test-setlocale2${EXEEXT} 1 || exit 1 +done + +exit 0 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-setsockopt.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-setsockopt.c new file mode 100644 index 0000000000..0347076cd0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-setsockopt.c @@ -0,0 +1,55 @@ +/* Test setsockopt() function. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <sys/socket.h> + +#include "signature.h" +SIGNATURE_CHECK (setsockopt, int, (int, int, int, const void *, socklen_t)); + +#include <errno.h> +#include <unistd.h> + +#include "sockets.h" +#include "macros.h" + +int +main (void) +{ + (void) gl_sockets_startup (SOCKETS_1_1); + + /* Test behaviour for invalid file descriptors. */ + { + int value = 1; + + errno = 0; + ASSERT (setsockopt (-1, SOL_SOCKET, SO_REUSEADDR, &value, sizeof (value)) + == -1); + ASSERT (errno == EBADF); + } + { + int value = 1; + + close (99); + errno = 0; + ASSERT (setsockopt (99, SOL_SOCKET, SO_REUSEADDR, &value, sizeof (value)) + == -1); + ASSERT (errno == EBADF); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-sh-quote.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-sh-quote.c new file mode 100644 index 0000000000..a7db744ac7 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-sh-quote.c @@ -0,0 +1,203 @@ +/* Test of sh-quote module. + Copyright (C) 2012-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2012. */ + +#include <config.h> + +/* Specification. */ +#include "sh-quote.h" + +#include <limits.h> +#include <string.h> + +#include "macros.h" + +static void +check_one (const char *input, const char *expected) +{ + char buf[1000]; + size_t output_len; + char *output; + char *bufend; + + output_len = shell_quote_length (input); + + output = shell_quote (input); + ASSERT (strlen (output) == output_len); + + ASSERT (output_len <= sizeof (buf) - 2); + memset (buf, '\0', output_len + 1); + buf[output_len + 1] = '%'; + bufend = shell_quote_copy (buf, input); + ASSERT (bufend == buf + output_len); + ASSERT (memcmp (buf, output, output_len + 1) == 0); + ASSERT (buf[output_len + 1] == '%'); + + ASSERT (strcmp (output, expected) == 0); + + free (output); +} + +int +main (void) +{ + /* Check the shell_quote_length, shell_quote_copy, shell_quote functions. */ + { + int c; + + /* Empty argument. */ + check_one ("", "''"); + + /* Identifier or number. */ + check_one ("foo", "foo"); + check_one ("phr0ck", "phr0ck"); + + /* Whitespace would be interpreted as argument separator by the shell. */ + check_one ("foo\tbar", "'foo\tbar'"); + check_one ("foo\nbar", "'foo\nbar'"); + check_one ("foo\rbar", "'foo\rbar'"); + check_one ("foo bar", "'foo bar'"); + + /* '!' at the beginning of argv[0] would introduce a negated command. */ + check_one ("!foo", "'!foo'"); + + /* '"' would be interpreted as the start of a string. */ + check_one ("\"foo\"bar", "'\"foo\"bar'"); + + /* '#' at the beginning of an argument would be interpreted as the start + of a comment. */ + check_one ("#foo", "'#foo'"); + + /* '$' at the beginning of an argument would be interpreted as a variable + reference. */ + check_one ("$foo", "'$foo'"); + + /* '&' at the beginning of an argument would be interpreted as a background + task indicator. */ + check_one ("&", "'&'"); + + /* "'" would be interpreted as the start of a string. */ + check_one ("'foo'bar", "\"'foo'bar\""); + + /* '(' at the beginning of argv[0] would introduce a subshell command. */ + check_one ("(", "'('"); + + /* ')' at the beginning of an argument would be interpreted as the end of + the command. */ + check_one (")", "')'"); + + /* '*' would be interpreted as a wildcard character. */ + check_one ("*", "'*'"); + check_one ("*foo", "'*foo'"); + + /* ';' at the beginning of an argument would be interpreted as an empty + statement in argv[0] and as the end of the command otherwise. */ + check_one (";", "';'"); + check_one ("foo;", "'foo;'"); + + /* '<' would be interpreted as a redirection of stdin. */ + check_one ("<", "'<'"); + + /* '=' inside argv[0] would be interpreted as an environment variable + assignment. */ + check_one ("foo=bar", "'foo=bar'"); + + /* '>' would be interpreted as a redirection of stdout. */ + check_one (">", "'>'"); + + /* '?' would be interpreted as a wildcard character. */ + check_one ("?", "'?'"); + check_one ("foo?bar", "'foo?bar'"); + + /* '^' would be interpreted in old /bin/sh, e.g. SunOS 4.1.4. */ + check_one ("^", "'^'"); + + /* "[...]" would be interpreted as a wildcard pattern. */ + check_one ("[", "'['"); + check_one ("]", "]"); /* or "']'" */ + + /* '\' would be interpreted as an escape character. */ + check_one ("\\foo", "'\\foo'"); + + /* '`' would be interpreted as the start of a command substitution. */ + check_one ("`foo", "'`foo'"); + + /* '{' at the beginning of argv[0] would introduce a complex command. */ + check_one ("{", "'{'"); + + /* '|' at the beginning of an argument would be interpreted as a pipe + between commands. */ + check_one ("|", "'|'"); + + /* '}' at the beginning of an argument would be interpreted as the end of + the command. */ + check_one ("}", "'}'"); + + /* '~' at the beginning of an argument would be interpreted as a reference + to a user's home directory. */ + check_one ("~", "'~'"); + check_one ("~foo", "'~foo'"); + + /* A string that contains both ' and ". */ + check_one ("foo'bar\"baz", "'foo'\\''bar\"baz'"); /* or "\"foo'bar\\\"baz\"" */ + + /* All other characters don't need quoting. */ + for (c = 1; c <= UCHAR_MAX; c++) + if (strchr ("\t\n\r !\"#$&'()*;<=>?^[\\]`{|}~", c) == NULL) + { + char s[5]; + s[0] = 'a'; + s[1] = (char) c; + s[2] = 'z'; + s[3] = (char) c; + s[4] = '\0'; + + check_one (s, s); + } + } + + /* Check the shell_quote_argv function. */ + { + char *argv[1]; + char *result; + argv[0] = NULL; + result = shell_quote_argv (argv); + ASSERT (strcmp (result, "") == 0); + free (result); + } + { + char *argv[2]; + char *result; + argv[0] = (char *) "foo bar/baz"; + argv[1] = NULL; + result = shell_quote_argv (argv); + ASSERT (strcmp (result, "'foo bar/baz'") == 0); /* or "\"foo bar/baz\"" */ + free (result); + } + { + char *argv[3]; + char *result; + argv[0] = (char *) "foo bar/baz"; + argv[1] = (char *) "$"; + argv[2] = NULL; + result = shell_quote_argv (argv); + ASSERT (strcmp (result, "'foo bar/baz' '$'") == 0); /* or "\"foo bar/baz\" \"\\$\"" */ + free (result); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-sigaction.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-sigaction.c new file mode 100644 index 0000000000..b664e11a70 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-sigaction.c @@ -0,0 +1,122 @@ +/* Test of sigaction() function. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2008. */ + +#include <config.h> + +#include <signal.h> + +#include "signature.h" +SIGNATURE_CHECK (sigaction, int, (int, struct sigaction const *, + struct sigaction *)); + +#include <stddef.h> + +#include "macros.h" + +#ifndef SA_NOCLDSTOP +# define SA_NOCLDSTOP 0 +#endif +#ifndef SA_ONSTACK +# define SA_ONSTACK 0 +#endif +#ifndef SA_RESETHAND +# define SA_RESETHAND 0 +#endif +#ifndef SA_RESTART +# define SA_RESTART 0 +#endif +#ifndef SA_SIGINFO +# define SA_SIGINFO 0 +#endif +#ifndef SA_NOCLDWAIT +# define SA_NOCLDWAIT 0 +#endif + +/* Define a mask of flags required by POSIX. Some implementations + provide other flags as extensions, such as SA_RESTORER, that we + must ignore in this test. */ +#define MASK_SA_FLAGS (SA_NOCLDSTOP | SA_ONSTACK | SA_RESETHAND | SA_RESTART \ + | SA_SIGINFO | SA_NOCLDWAIT | SA_NODEFER) + +/* This test is unsafe in the presence of an asynchronous SIGABRT, + because we install a signal-handler that is intentionally not + async-safe. Hopefully, this does not lead to too many reports of + false failures, since people don't generally use 'kill -s SIGABRT' + to end a runaway program. */ + +static void +handler (int sig) +{ + static int entry_count; + struct sigaction sa; + ASSERT (sig == SIGABRT); + ASSERT (sigaction (SIGABRT, NULL, &sa) == 0); + ASSERT ((sa.sa_flags & SA_SIGINFO) == 0); + switch (entry_count++) + { + case 0: + ASSERT ((sa.sa_flags & SA_RESETHAND) == 0); + ASSERT (sa.sa_handler == handler); + break; + case 1: + /* This assertion fails on glibc-2.3.6 systems with LinuxThreads, + when this program is linked with -lpthread, due to the sigaction() + override in libpthread.so. */ +#if !(defined __GLIBC__ || defined __UCLIBC__) + ASSERT (sa.sa_handler == SIG_DFL); +#endif + break; + default: + ASSERT (0); + } +} + +int +main (void) +{ + struct sigaction sa; + struct sigaction old_sa; + sa.sa_handler = handler; + + sa.sa_flags = 0; + ASSERT (sigemptyset (&sa.sa_mask) == 0); + ASSERT (sigaction (SIGABRT, &sa, NULL) == 0); + ASSERT (raise (SIGABRT) == 0); + + sa.sa_flags = SA_RESETHAND | SA_NODEFER; + ASSERT (sigaction (SIGABRT, &sa, &old_sa) == 0); + ASSERT ((old_sa.sa_flags & MASK_SA_FLAGS) == 0); + ASSERT (old_sa.sa_handler == handler); + ASSERT (raise (SIGABRT) == 0); + + sa.sa_handler = SIG_DFL; + ASSERT (sigaction (SIGABRT, &sa, &old_sa) == 0); + ASSERT ((old_sa.sa_flags & SA_SIGINFO) == 0); +#if !(defined __GLIBC__ || defined __UCLIBC__) /* see above */ + ASSERT (old_sa.sa_handler == SIG_DFL); +#endif + + sa.sa_handler = SIG_IGN; + ASSERT (sigaction (SIGABRT, &sa, NULL) == 0); + ASSERT (raise (SIGABRT) == 0); + ASSERT (sigaction (SIGABRT, NULL, &old_sa) == 0); + ASSERT (old_sa.sa_handler == SIG_IGN); + ASSERT (raise (SIGABRT) == 0); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-signal-h.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-signal-h.c new file mode 100644 index 0000000000..9ef589bc76 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-signal-h.c @@ -0,0 +1,129 @@ +/* Test of <signal.h> substitute. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +#include <config.h> + +#include <signal.h> + +/* Check for required types. */ +struct +{ + size_t a; + uid_t b; + volatile sig_atomic_t c; + sigset_t d; + pid_t e; +#if 0 + /* Not guaranteed by gnulib. */ + pthread_t f; + struct timespec g; +#endif +} s; + +/* Check that NSIG is defined. */ +int nsig = NSIG; + +int +main (void) +{ + switch (0) + { + /* The following are guaranteed by C. */ + case 0: + case SIGABRT: + case SIGFPE: + case SIGILL: + case SIGINT: + case SIGSEGV: + case SIGTERM: + /* The following is guaranteed by gnulib. */ +#if GNULIB_SIGPIPE || defined SIGPIPE + case SIGPIPE: +#endif + /* Ensure no conflict with other standardized names. */ +#ifdef SIGALRM + case SIGALRM: +#endif + /* On Haiku, SIGBUS is mistakenly equal to SIGSEGV. */ +#if defined SIGBUS && SIGBUS != SIGSEGV + case SIGBUS: +#endif +#ifdef SIGCHLD + case SIGCHLD: +#endif +#ifdef SIGCONT + case SIGCONT: +#endif +#ifdef SIGHUP + case SIGHUP: +#endif +#ifdef SIGKILL + case SIGKILL: +#endif +#ifdef SIGQUIT + case SIGQUIT: +#endif +#ifdef SIGSTOP + case SIGSTOP: +#endif +#ifdef SIGTSTP + case SIGTSTP: +#endif +#ifdef SIGTTIN + case SIGTTIN: +#endif +#ifdef SIGTTOU + case SIGTTOU: +#endif +#ifdef SIGUSR1 + case SIGUSR1: +#endif +#ifdef SIGUSR2 + case SIGUSR2: +#endif +#ifdef SIGSYS + case SIGSYS: +#endif +#ifdef SIGTRAP + case SIGTRAP: +#endif +#ifdef SIGURG + case SIGURG: +#endif +#ifdef SIGVTALRM + case SIGVTALRM: +#endif +#ifdef SIGXCPU + case SIGXCPU: +#endif +#ifdef SIGXFSZ + case SIGXFSZ: +#endif + /* SIGRTMIN and SIGRTMAX need not be compile-time constants. */ +#if 0 +# ifdef SIGRTMIN + case SIGRTMIN: +# endif +# ifdef SIGRTMAX + case SIGRTMAX: +# endif +#endif + ; + } + return s.a + s.b + s.c + s.e; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-sigprocmask.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-sigprocmask.c new file mode 100644 index 0000000000..7c0da7fe85 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-sigprocmask.c @@ -0,0 +1,102 @@ +/* Test of sigprocmask. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2011. */ + +#include <config.h> + +#include <signal.h> + +#include "signature.h" +SIGNATURE_CHECK (sigprocmask, int, (int, const sigset_t *, sigset_t *)); + +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + +#include "macros.h" + +#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) + +static volatile int sigint_occurred; + +static void +sigint_handler (int sig) +{ + sigint_occurred++; +} + +int +main (int argc, char *argv[]) +{ + sigset_t set; + pid_t pid = getpid (); + char command[80]; + + if (sizeof (int) < sizeof pid && 0x7fffffff < pid) + { + fputs ("Skipping test: pid too large\n", stderr); + return 77; + } + + signal (SIGINT, sigint_handler); + + sigemptyset (&set); + sigaddset (&set, SIGINT); + + /* Check error handling. */ + ASSERT (sigprocmask (1729, &set, NULL) == -1); + ASSERT (errno == EINVAL); + + /* Block SIGINT. */ + ASSERT (sigprocmask (SIG_BLOCK, &set, NULL) == 0); + + /* Request a SIGINT signal from outside. */ + sprintf (command, "sh -c 'sleep 1; kill -%d %d' &", SIGINT, (int) pid); + ASSERT (system (command) == 0); + + /* Wait. */ + sleep (2); + + /* The signal should not have arrived yet, because it is blocked. */ + ASSERT (sigint_occurred == 0); + + /* Unblock SIGINT. */ + ASSERT (sigprocmask (SIG_UNBLOCK, &set, NULL) == 0); + + /* The signal should have arrived now, because POSIX says + "If there are any pending unblocked signals after the call to + sigprocmask(), at least one of those signals shall be delivered + before the call to sigprocmask() returns." */ + ASSERT (sigint_occurred == 1); + + return 0; +} + +#else + +/* On native Windows, getpid() values and the arguments that are passed to + the (Cygwin?) 'kill' program are not necessarily related. */ + +int +main () +{ + fputs ("Skipping test: native Windows platform\n", stderr); + return 77; +} + +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-sleep.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-sleep.c new file mode 100644 index 0000000000..84567cfd0a --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-sleep.c @@ -0,0 +1,58 @@ +/* Test of sleep() function. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <unistd.h> + +#include "signature.h" +SIGNATURE_CHECK (sleep, unsigned int, (unsigned int)); + +#include <signal.h> + +#include "macros.h" + +#if HAVE_DECL_ALARM +static void +handle_alarm (int sig) +{ + if (sig != SIGALRM) + _exit (1); +} +#endif + +int +main (void) +{ + ASSERT (sleep (1) <= 1); + + ASSERT (sleep (0) == 0); + +#if HAVE_DECL_ALARM + { + const unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days. */ + unsigned int remaining; + signal (SIGALRM, handle_alarm); + alarm (1); + remaining = sleep (pentecost); + ASSERT (pentecost - 10 < remaining && remaining <= pentecost); + } +#endif + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-snprintf.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-snprintf.c new file mode 100644 index 0000000000..06d48be194 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-snprintf.c @@ -0,0 +1,72 @@ +/* Test of snprintf() function. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <stdio.h> + +#include "signature.h" +SIGNATURE_CHECK (snprintf, int, (char *, size_t, char const *, ...)); + +#include <string.h> + +#include "macros.h" + +int +main (int argc, char *argv[]) +{ + char buf[8]; + int size; + int retval; + + retval = snprintf (NULL, 0, "%d", 12345); + ASSERT (retval == 5); + + for (size = 0; size <= 8; size++) + { + memcpy (buf, "DEADBEEF", 8); + retval = snprintf (buf, size, "%d", 12345); + ASSERT (retval == 5); + if (size < 6) + { + if (size > 0) + { + ASSERT (memcmp (buf, "12345", size - 1) == 0); + ASSERT (buf[size - 1] == '\0' || buf[size - 1] == '0' + size); + } +#if !CHECK_SNPRINTF_POSIX + if (size > 0) +#endif + ASSERT (memcmp (buf + size, &"DEADBEEF"[size], 8 - size) == 0); + } + else + { + ASSERT (memcmp (buf, "12345\0EF", 8) == 0); + } + } + + /* Test the support of the POSIX/XSI format strings with positions. */ + { + char result[100]; + retval = snprintf (result, sizeof (result), "%2$d %1$d", 33, 55); + ASSERT (strcmp (result, "55 33") == 0); + ASSERT (retval == strlen (result)); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-sockets.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-sockets.c new file mode 100644 index 0000000000..cf56968d25 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-sockets.c @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2008-2017 Free Software Foundation, Inc. + * Written by Simon Josefsson. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <stdio.h> + +#include "sockets.h" + +int +main (void) +{ + int err; + + err = gl_sockets_startup (SOCKETS_1_1); + if (err != 0) + { + printf ("wsastartup failed %d\n", err); + return 1; + } + + err = gl_sockets_cleanup (); + if (err != 0) + { + printf ("wsacleanup failed %d\n", err); + return 1; + } + + (void) gl_fd_to_handle (0); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-stat-time.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-stat-time.c new file mode 100644 index 0000000000..47849de526 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-stat-time.c @@ -0,0 +1,248 @@ +/* Test of <stat-time.h>. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by James Youngman <jay@gnu.org>, 2007. */ + +#include <config.h> + +#include "stat-time.h" + +#include <fcntl.h> +#include <signal.h> +#include <stdio.h> +#include <sys/stat.h> +#include <unistd.h> +#include <time.h> + +#include "macros.h" + +#define BASE "test-stat-time.t" +#include "nap.h" + +enum { NFILES = 4 }; + +static char filename_stamp1[50]; +static char filename_testfile[50]; +static char filename_stamp2[50]; +static char filename_stamp3[50]; + +/* Use file names that are different at each run. + This is necessary for test_birthtime() to pass on native Windows: + On this platform, the file system apparently remembers the creation time + of a file even after it is removed and created anew. See + "Windows NT Contains File System Tunneling Capabilities" + <https://support.microsoft.com/en-us/help/172190/> */ +static void +initialize_filenames (void) +{ + long t = (long) time (NULL); + sprintf (filename_stamp1, "t-stt-%ld-stamp1", t); + sprintf (filename_testfile, "t-stt-%ld-testfile", t); + sprintf (filename_stamp2, "t-stt-%ld-stamp2", t); + sprintf (filename_stamp3, "t-stt-%ld-stamp3", t); +} + +static int +force_unlink (const char *filename) +{ + /* This chmod is necessary on mingw, where unlink() of a read-only file + fails with EPERM. */ + chmod (filename, 0600); + return unlink (filename); +} + +static void +cleanup (int sig) +{ + /* Remove temporary files. */ + force_unlink (filename_stamp1); + force_unlink (filename_testfile); + force_unlink (filename_stamp2); + force_unlink (filename_stamp3); + + if (sig != 0) + _exit (1); +} + +static int +open_file (const char *filename, int flags) +{ + int fd = open (filename, flags | O_WRONLY, 0500); + if (fd >= 0) + { + close (fd); + return 1; + } + else + { + return 0; + } +} + +static void +create_file (const char *filename) +{ + ASSERT (open_file (filename, O_CREAT | O_EXCL)); +} + +static void +do_stat (const char *filename, struct stat *p) +{ + ASSERT (stat (filename, p) == 0); +} + +static void +prepare_test (struct stat *statinfo, struct timespec *modtimes) +{ + int i; + + create_file (filename_stamp1); + nap (); + create_file (filename_testfile); + nap (); + create_file (filename_stamp2); + nap (); + ASSERT (chmod (filename_testfile, 0400) == 0); + nap (); + create_file (filename_stamp3); + + do_stat (filename_stamp1, &statinfo[0]); + do_stat (filename_testfile, &statinfo[1]); + do_stat (filename_stamp2, &statinfo[2]); + do_stat (filename_stamp3, &statinfo[3]); + + /* Now use our access functions. */ + for (i = 0; i < NFILES; ++i) + { + modtimes[i] = get_stat_mtime (&statinfo[i]); + } +} + +static void +test_mtime (const struct stat *statinfo, struct timespec *modtimes) +{ + int i; + + /* Use the struct stat fields directly. */ + /* mtime(stamp1) < mtime(stamp2) */ + ASSERT (statinfo[0].st_mtime < statinfo[2].st_mtime + || (statinfo[0].st_mtime == statinfo[2].st_mtime + && (get_stat_mtime_ns (&statinfo[0]) + < get_stat_mtime_ns (&statinfo[2])))); + /* mtime(stamp2) < mtime(stamp3) */ + ASSERT (statinfo[2].st_mtime < statinfo[3].st_mtime + || (statinfo[2].st_mtime == statinfo[3].st_mtime + && (get_stat_mtime_ns (&statinfo[2]) + < get_stat_mtime_ns (&statinfo[3])))); + + /* Now check the result of the access functions. */ + /* mtime(stamp1) < mtime(stamp2) */ + ASSERT (modtimes[0].tv_sec < modtimes[2].tv_sec + || (modtimes[0].tv_sec == modtimes[2].tv_sec + && modtimes[0].tv_nsec < modtimes[2].tv_nsec)); + /* mtime(stamp2) < mtime(stamp3) */ + ASSERT (modtimes[2].tv_sec < modtimes[3].tv_sec + || (modtimes[2].tv_sec == modtimes[3].tv_sec + && modtimes[2].tv_nsec < modtimes[3].tv_nsec)); + + /* verify equivalence */ + for (i = 0; i < NFILES; ++i) + { + struct timespec ts; + ts = get_stat_mtime (&statinfo[i]); + ASSERT (ts.tv_sec == statinfo[i].st_mtime); + } +} + +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ +/* Skip the ctime tests on native Windows platforms, because their + st_ctime is either the same as st_mtime (plus or minus an offset) + or set to the file _creation_ time, and is not influenced by rename + or chmod. */ +# define test_ctime(ignored) ((void) 0) +#else +static void +test_ctime (const struct stat *statinfo) +{ + /* On some buggy NFS clients, mtime and ctime are disproportionately + skewed from one another. Skip this test in that case. */ + if (statinfo[0].st_mtime != statinfo[0].st_ctime) + return; + + /* mtime(stamp2) < ctime(testfile) */ + ASSERT (statinfo[2].st_mtime < statinfo[1].st_ctime + || (statinfo[2].st_mtime == statinfo[1].st_ctime + && (get_stat_mtime_ns (&statinfo[2]) + < get_stat_ctime_ns (&statinfo[1])))); +} +#endif + +static void +test_birthtime (const struct stat *statinfo, + const struct timespec *modtimes, + struct timespec *birthtimes) +{ + int i; + + /* Collect the birth times. */ + for (i = 0; i < NFILES; ++i) + { + birthtimes[i] = get_stat_birthtime (&statinfo[i]); + if (birthtimes[i].tv_nsec < 0) + return; + } + + /* mtime(stamp1) < birthtime(testfile) */ + ASSERT (modtimes[0].tv_sec < birthtimes[1].tv_sec + || (modtimes[0].tv_sec == birthtimes[1].tv_sec + && modtimes[0].tv_nsec < birthtimes[1].tv_nsec)); + /* birthtime(testfile) < mtime(stamp2) */ + ASSERT (birthtimes[1].tv_sec < modtimes[2].tv_sec + || (birthtimes[1].tv_sec == modtimes[2].tv_sec + && birthtimes[1].tv_nsec < modtimes[2].tv_nsec)); +} + +int +main (void) +{ + struct stat statinfo[NFILES]; + struct timespec modtimes[NFILES]; + struct timespec birthtimes[NFILES]; + + initialize_filenames (); + +#ifdef SIGHUP + signal (SIGHUP, cleanup); +#endif +#ifdef SIGINT + signal (SIGINT, cleanup); +#endif +#ifdef SIGQUIT + signal (SIGQUIT, cleanup); +#endif +#ifdef SIGTERM + signal (SIGTERM, cleanup); +#endif + + cleanup (0); + prepare_test (statinfo, modtimes); + test_mtime (statinfo, modtimes); + test_ctime (statinfo); + test_birthtime (statinfo, modtimes, birthtimes); + + cleanup (0); + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-stat.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-stat.c new file mode 100644 index 0000000000..225edaa17b --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-stat.c @@ -0,0 +1,56 @@ +/* Tests of stat. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +#include <config.h> + +#include <sys/stat.h> + +/* Caution: stat may be a function-like macro. Although this + signature check must pass, it may be the signature of the real (and + broken) stat rather than rpl_stat. Most code should not use the + address of stat. */ +#include "signature.h" +SIGNATURE_CHECK (stat, int, (char const *, struct stat *)); + +#include <fcntl.h> +#include <errno.h> +#include <stdbool.h> +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> + +#include "same-inode.h" +#include "macros.h" + +#define BASE "test-stat.t" + +#include "test-stat.h" + +/* Wrapper around stat, which works even if stat is a function-like + macro, where test_stat_func(stat) would do the wrong thing. */ +static int +do_stat (char const *name, struct stat *st) +{ + return stat (name, st); +} + +int +main (void) +{ + return test_stat_func (do_stat, true); +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-stat.h b/local/recipes/tools/diffutils/source/gnulib-tests/test-stat.h new file mode 100644 index 0000000000..234ec77619 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-stat.h @@ -0,0 +1,101 @@ +/* Tests of stat. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +/* This file is designed to test both stat(n,buf) and + fstatat(AT_FDCWD,n,buf,0). FUNC is the function to test. Assumes + that BASE and ASSERT are already defined, and that appropriate + headers are already included. If PRINT, warn before skipping + symlink tests with status 77. */ + +static int +test_stat_func (int (*func) (char const *, struct stat *), bool print) +{ + struct stat st1; + struct stat st2; + char *cwd = getcwd (NULL, 0); + + ASSERT (cwd); + ASSERT (func (".", &st1) == 0); + ASSERT (func ("./", &st2) == 0); + ASSERT (SAME_INODE (st1, st2)); + ASSERT (func (cwd, &st2) == 0); + ASSERT (SAME_INODE (st1, st2)); + ASSERT (func ("/", &st1) == 0); + ASSERT (func ("///", &st2) == 0); + ASSERT (SAME_INODE (st1, st2)); + + errno = 0; + ASSERT (func ("", &st1) == -1); + ASSERT (errno == ENOENT); + errno = 0; + ASSERT (func ("nosuch", &st1) == -1); + ASSERT (errno == ENOENT); + errno = 0; + ASSERT (func ("nosuch/", &st1) == -1); + ASSERT (errno == ENOENT); + + ASSERT (close (creat (BASE "file", 0600)) == 0); + ASSERT (func (BASE "file", &st1) == 0); + errno = 0; + ASSERT (func (BASE "file/", &st1) == -1); + ASSERT (errno == ENOTDIR); + + /* Now for some symlink tests, where supported. We set up: + link1 -> directory + link2 -> file + link3 -> dangling + link4 -> loop + then test behavior with trailing slash. + */ + if (symlink (".", BASE "link1") != 0) + { + ASSERT (unlink (BASE "file") == 0); + if (print) + fputs ("skipping test: symlinks not supported on this file system\n", + stderr); + return 77; + } + ASSERT (symlink (BASE "file", BASE "link2") == 0); + ASSERT (symlink (BASE "nosuch", BASE "link3") == 0); + ASSERT (symlink (BASE "link4", BASE "link4") == 0); + + ASSERT (func (BASE "link1/", &st1) == 0); + ASSERT (S_ISDIR (st1.st_mode)); + + errno = 0; + ASSERT (func (BASE "link2/", &st1) == -1); + ASSERT (errno == ENOTDIR); + + errno = 0; + ASSERT (func (BASE "link3/", &st1) == -1); + ASSERT (errno == ENOENT); + + errno = 0; + ASSERT (func (BASE "link4/", &st1) == -1); + ASSERT (errno == ELOOP); + + /* Cleanup. */ + ASSERT (unlink (BASE "file") == 0); + ASSERT (unlink (BASE "link1") == 0); + ASSERT (unlink (BASE "link2") == 0); + ASSERT (unlink (BASE "link3") == 0); + ASSERT (unlink (BASE "link4") == 0); + free (cwd); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-stdalign.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-stdalign.c new file mode 100644 index 0000000000..c4b70e1d73 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-stdalign.c @@ -0,0 +1,121 @@ +/* Test of <stdalign.h>. + Copyright 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert, inspired by Bruno Haible's test-alignof.c. */ + +#include <config.h> + +#include <stdalign.h> + +#include <stddef.h> +#include <stdint.h> + +#include "verify.h" + +#include "macros.h" + +typedef long double longdouble; +typedef struct { char a[1]; } struct1; +typedef struct { char a[2]; } struct2; +typedef struct { char a[3]; } struct3; +typedef struct { char a[4]; } struct4; + +verify (__alignof_is_defined == 1); +#ifndef alignof +# error "alignof is not a macro" +#endif + +#if __alignas_is_defined +verify (__alignas_is_defined == 1); +# ifndef alignas +# error "alignas is not a macro" +# endif +/* mingw can go up only to 8. 8 is all that GNU Emacs needs, so let's + limit the test to 8 for now. */ +# define TEST_ALIGNMENT 8 +#else +# define _Alignas(alignment) +# define alignas(alignment) +# define TEST_ALIGNMENT 1 +#endif + +#define CHECK_STATIC(type) \ + typedef struct { char slot1; type slot2; } type##_helper; \ + verify (alignof (type) == offsetof (type##_helper, slot2)); \ + verify (_Alignof (type) == alignof (type)); \ + const int type##_alignment = alignof (type); \ + type alignas (TEST_ALIGNMENT) static_##type##_alignas; \ + type _Alignas (TEST_ALIGNMENT) static_##type##_Alignas + +#define CHECK_ALIGNED(var) ASSERT ((uintptr_t) &(var) % TEST_ALIGNMENT == 0) + +CHECK_STATIC (char); +CHECK_STATIC (short); +CHECK_STATIC (int); +CHECK_STATIC (long); +#ifdef INT64_MAX +CHECK_STATIC (int64_t); +#endif +CHECK_STATIC (float); +CHECK_STATIC (double); +/* CHECK_STATIC (longdouble); */ +CHECK_STATIC (struct1); +CHECK_STATIC (struct2); +CHECK_STATIC (struct3); +CHECK_STATIC (struct4); + +int +main () +{ +#if defined __SUNPRO_C + /* Avoid a test failure due to Sun Studio Developer Bug Report #2125432. */ + fputs ("Skipping test: known Sun C compiler bug\n", stderr); + return 77; +#elif defined __HP_cc && __ia64 + /* Avoid a test failure due to HP-UX Itanium cc bug; see: + http://lists.gnu.org/archive/html/bug-gnulib/2017-03/msg00078.html */ + fputs ("Skipping test: known HP-UX Itanium cc compiler bug\n", stderr); + return 77; +#else + CHECK_ALIGNED (static_char_alignas); + CHECK_ALIGNED (static_char_Alignas); + CHECK_ALIGNED (static_short_alignas); + CHECK_ALIGNED (static_short_Alignas); + CHECK_ALIGNED (static_int_alignas); + CHECK_ALIGNED (static_int_Alignas); + CHECK_ALIGNED (static_long_alignas); + CHECK_ALIGNED (static_long_Alignas); +# ifdef INT64_MAX + CHECK_ALIGNED (static_int64_t_alignas); + CHECK_ALIGNED (static_int64_t_Alignas); +# endif + CHECK_ALIGNED (static_float_alignas); + CHECK_ALIGNED (static_float_Alignas); + CHECK_ALIGNED (static_double_alignas); + CHECK_ALIGNED (static_double_Alignas); + /* CHECK_ALIGNED (static_longdouble_alignas); */ + /* CHECK_ALIGNED (static_longdouble_Alignas); */ + CHECK_ALIGNED (static_struct1_alignas); + CHECK_ALIGNED (static_struct1_Alignas); + CHECK_ALIGNED (static_struct2_alignas); + CHECK_ALIGNED (static_struct2_Alignas); + CHECK_ALIGNED (static_struct3_alignas); + CHECK_ALIGNED (static_struct3_Alignas); + CHECK_ALIGNED (static_struct4_alignas); + CHECK_ALIGNED (static_struct4_Alignas); + return 0; +#endif +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-stdbool.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-stdbool.c new file mode 100644 index 0000000000..507af830f0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-stdbool.c @@ -0,0 +1,118 @@ +/* Test of <stdbool.h> substitute. + Copyright (C) 2002-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +/* We want this test to succeed even when using gcc's -Werror; but to + do that requires a pragma that didn't exist before 4.3.0. */ +#ifndef __GNUC__ +# define ADDRESS_CHECK_OKAY +#elif __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) +/* No way to silence -Waddress. */ +#else +# pragma GCC diagnostic ignored "-Waddress" +# define ADDRESS_CHECK_OKAY +#endif + +#include <config.h> + +#include <stdbool.h> + +#ifndef bool + "error: bool is not defined" +#endif +#ifndef false + "error: false is not defined" +#endif +#if false + "error: false is not 0" +#endif +#ifndef true + "error: true is not defined" +#endif +#if true != 1 + "error: true is not 1" +#endif +#ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" +#endif + +/* Several tests cannot be guaranteed with gnulib's <stdbool.h>, at + least, not for all compilers and compiler options. */ +#if HAVE_STDBOOL_H || 3 <= __GNUC__ +struct s { _Bool s: 1; _Bool t; } s; +#endif + +char a[true == 1 ? 1 : -1]; +char b[false == 0 ? 1 : -1]; +char c[__bool_true_false_are_defined == 1 ? 1 : -1]; +#if HAVE_STDBOOL_H || 3 <= __GNUC__ /* See above. */ +char d[(bool) 0.5 == true ? 1 : -1]; +# ifdef ADDRESS_CHECK_OKAY /* Avoid gcc warning. */ +/* C99 may plausibly be interpreted as not requiring support for a cast from + a variable's address to bool in a static initializer. So treat it like a + GCC extension. */ +# ifdef __GNUC__ +bool e = &s; +# endif +# endif +char f[(_Bool) 0.0 == false ? 1 : -1]; +#endif +char g[true]; +char h[sizeof (_Bool)]; +#if HAVE_STDBOOL_H || 3 <= __GNUC__ /* See above. */ +char i[sizeof s.t]; +#endif +enum { j = false, k = true, l = false * true, m = true * 256 }; +_Bool n[m]; +char o[sizeof n == m * sizeof n[0] ? 1 : -1]; +char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; +/* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ +_Bool q = true; +_Bool *pq = &q; + +int +main () +{ + int error = 0; + +#if HAVE_STDBOOL_H || 3 <= __GNUC__ /* See above. */ +# ifdef ADDRESS_CHECK_OKAY /* Avoid gcc warning. */ + /* A cast from a variable's address to bool is valid in expressions. */ + { + bool e1 = &s; + if (!e1) + error = 1; + } +# endif +#endif + + /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 + reported by James Lemley on 2005-10-05; see + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html + This is a runtime test, since a corresponding compile-time + test would rely on initializer extensions. */ + { + char digs[] = "0123456789"; + if (&(digs + 5)[-2 + (bool) 1] != &digs[4]) + error = 1; + } + + return error; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-stddef.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-stddef.c new file mode 100644 index 0000000000..8bf3793015 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-stddef.c @@ -0,0 +1,77 @@ +/* Test of <stddef.h> substitute. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +#include <config.h> + +#include <stddef.h> +#include <limits.h> +#include <stdalign.h> +#include "verify.h" + +/* Check that appropriate types are defined. */ +wchar_t a = 'c'; +ptrdiff_t b = 1; +size_t c = 2; +max_align_t x; + +/* Check that NULL can be passed through varargs as a pointer type, + per POSIX 2008. */ +verify (sizeof NULL == sizeof (void *)); + +/* Check that offsetof produces integer constants with correct type. */ +struct d +{ + char e; + char f; +}; +/* Solaris 10 has a bug where offsetof is under-parenthesized, and + cannot be used as an arbitrary expression. However, since it is + unlikely to bite real code, we ignore that short-coming. */ +/* verify (sizeof offsetof (struct d, e) == sizeof (size_t)); */ +verify (sizeof (offsetof (struct d, e)) == sizeof (size_t)); +verify (offsetof (struct d, f) == 1); + +/* offsetof promotes to an unsigned integer if and only if sizes do + not fit in int. */ +verify ((offsetof (struct d, e) < -1) == (INT_MAX < (size_t) -1)); + +/* Check max_align_t's alignment. */ +verify (alignof (double) <= alignof (max_align_t)); +verify (alignof (int) <= alignof (max_align_t)); +verify (alignof (long double) <= alignof (max_align_t)); +verify (alignof (long int) <= alignof (max_align_t)); +verify (alignof (ptrdiff_t) <= alignof (max_align_t)); +verify (alignof (size_t) <= alignof (max_align_t)); +verify (alignof (wchar_t) <= alignof (max_align_t)); +verify (alignof (struct d) <= alignof (max_align_t)); +#if defined __GNUC__ || defined __IBM__ALIGNOF__ +verify (__alignof__ (double) <= __alignof__ (max_align_t)); +verify (__alignof__ (int) <= __alignof__ (max_align_t)); +verify (__alignof__ (long double) <= __alignof__ (max_align_t)); +verify (__alignof__ (long int) <= __alignof__ (max_align_t)); +verify (__alignof__ (ptrdiff_t) <= __alignof__ (max_align_t)); +verify (__alignof__ (size_t) <= __alignof__ (max_align_t)); +verify (__alignof__ (wchar_t) <= __alignof__ (max_align_t)); +verify (__alignof__ (struct d) <= __alignof__ (max_align_t)); +#endif + +int +main (void) +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-stdint.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-stdint.c new file mode 100644 index 0000000000..73522153da --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-stdint.c @@ -0,0 +1,426 @@ +/* Test of <stdint.h> substitute. + Copyright (C) 2006-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2006. */ + +#include <config.h> + +/* Whether to enable pedantic checks. */ +#define DO_PEDANTIC 0 + +#include <stdint.h> + +#include "verify.h" +#include "intprops.h" + +#if __GNUC__ >= 2 && DO_PEDANTIC +# define verify_same_types(expr1,expr2) \ + extern void _verify_func(__LINE__) (__typeof__ (expr1) *); \ + extern void _verify_func(__LINE__) (__typeof__ (expr2) *); +# define _verify_func(line) _verify_func2(line) +# define _verify_func2(line) verify_func_ ## line +#else +# define verify_same_types(expr1,expr2) extern void verify_func (int) +#endif + +/* 7.18.1.1. Exact-width integer types */ +/* 7.18.2.1. Limits of exact-width integer types */ + +int8_t a1[3] = { INT8_C (17), INT8_MIN, INT8_MAX }; +verify (TYPE_MINIMUM (int8_t) == INT8_MIN); +verify (TYPE_MAXIMUM (int8_t) == INT8_MAX); +verify_same_types (INT8_MIN, (int8_t) 0 + 0); +verify_same_types (INT8_MAX, (int8_t) 0 + 0); + +int16_t a2[3] = { INT16_C (17), INT16_MIN, INT16_MAX }; +verify (TYPE_MINIMUM (int16_t) == INT16_MIN); +verify (TYPE_MAXIMUM (int16_t) == INT16_MAX); +verify_same_types (INT16_MIN, (int16_t) 0 + 0); +verify_same_types (INT16_MAX, (int16_t) 0 + 0); + +int32_t a3[3] = { INT32_C (17), INT32_MIN, INT32_MAX }; +verify (TYPE_MINIMUM (int32_t) == INT32_MIN); +verify (TYPE_MAXIMUM (int32_t) == INT32_MAX); +verify_same_types (INT32_MIN, (int32_t) 0 + 0); +verify_same_types (INT32_MAX, (int32_t) 0 + 0); + +#ifdef INT64_MAX +int64_t a4[3] = { INT64_C (17), INT64_MIN, INT64_MAX }; +verify (TYPE_MINIMUM (int64_t) == INT64_MIN); +verify (TYPE_MAXIMUM (int64_t) == INT64_MAX); +verify_same_types (INT64_MIN, (int64_t) 0 + 0); +verify_same_types (INT64_MAX, (int64_t) 0 + 0); +#endif + +uint8_t b1[2] = { UINT8_C (17), UINT8_MAX }; +verify (TYPE_MAXIMUM (uint8_t) == UINT8_MAX); +verify_same_types (UINT8_MAX, (uint8_t) 0 + 0); + +uint16_t b2[2] = { UINT16_C (17), UINT16_MAX }; +verify (TYPE_MAXIMUM (uint16_t) == UINT16_MAX); +verify_same_types (UINT16_MAX, (uint16_t) 0 + 0); + +uint32_t b3[2] = { UINT32_C (17), UINT32_MAX }; +verify (TYPE_MAXIMUM (uint32_t) == UINT32_MAX); +verify_same_types (UINT32_MAX, (uint32_t) 0 + 0); + +#ifdef UINT64_MAX +uint64_t b4[2] = { UINT64_C (17), UINT64_MAX }; +verify (TYPE_MAXIMUM (uint64_t) == UINT64_MAX); +verify_same_types (UINT64_MAX, (uint64_t) 0 + 0); +#endif + +#if INT8_MIN && INT8_MAX && INT16_MIN && INT16_MAX && INT32_MIN && INT32_MAX +/* ok */ +#else +err or; +#endif + +#if UINT8_MAX && UINT16_MAX && UINT32_MAX +/* ok */ +#else +err or; +#endif + +/* 7.18.1.2. Minimum-width integer types */ +/* 7.18.2.2. Limits of minimum-width integer types */ + +int_least8_t c1[3] = { 17, INT_LEAST8_MIN, INT_LEAST8_MAX }; +verify (TYPE_MINIMUM (int_least8_t) == INT_LEAST8_MIN); +verify (TYPE_MAXIMUM (int_least8_t) == INT_LEAST8_MAX); +verify_same_types (INT_LEAST8_MIN, (int_least8_t) 0 + 0); +verify_same_types (INT_LEAST8_MAX, (int_least8_t) 0 + 0); + +int_least16_t c2[3] = { 17, INT_LEAST16_MIN, INT_LEAST16_MAX }; +verify (TYPE_MINIMUM (int_least16_t) == INT_LEAST16_MIN); +verify (TYPE_MAXIMUM (int_least16_t) == INT_LEAST16_MAX); +verify_same_types (INT_LEAST16_MIN, (int_least16_t) 0 + 0); +verify_same_types (INT_LEAST16_MAX, (int_least16_t) 0 + 0); + +int_least32_t c3[3] = { 17, INT_LEAST32_MIN, INT_LEAST32_MAX }; +verify (TYPE_MINIMUM (int_least32_t) == INT_LEAST32_MIN); +verify (TYPE_MAXIMUM (int_least32_t) == INT_LEAST32_MAX); +verify_same_types (INT_LEAST32_MIN, (int_least32_t) 0 + 0); +verify_same_types (INT_LEAST32_MAX, (int_least32_t) 0 + 0); + +#ifdef INT_LEAST64_MAX +int_least64_t c4[3] = { 17, INT_LEAST64_MIN, INT_LEAST64_MAX }; +verify (TYPE_MINIMUM (int_least64_t) == INT_LEAST64_MIN); +verify (TYPE_MAXIMUM (int_least64_t) == INT_LEAST64_MAX); +verify_same_types (INT_LEAST64_MIN, (int_least64_t) 0 + 0); +verify_same_types (INT_LEAST64_MAX, (int_least64_t) 0 + 0); +#endif + +uint_least8_t d1[2] = { 17, UINT_LEAST8_MAX }; +verify (TYPE_MAXIMUM (uint_least8_t) == UINT_LEAST8_MAX); +verify_same_types (UINT_LEAST8_MAX, (uint_least8_t) 0 + 0); + +uint_least16_t d2[2] = { 17, UINT_LEAST16_MAX }; +verify (TYPE_MAXIMUM (uint_least16_t) == UINT_LEAST16_MAX); +verify_same_types (UINT_LEAST16_MAX, (uint_least16_t) 0 + 0); + +uint_least32_t d3[2] = { 17, UINT_LEAST32_MAX }; +verify (TYPE_MAXIMUM (uint_least32_t) == UINT_LEAST32_MAX); +verify_same_types (UINT_LEAST32_MAX, (uint_least32_t) 0 + 0); + +#ifdef UINT_LEAST64_MAX +uint_least64_t d4[2] = { 17, UINT_LEAST64_MAX }; +verify (TYPE_MAXIMUM (uint_least64_t) == UINT_LEAST64_MAX); +verify_same_types (UINT_LEAST64_MAX, (uint_least64_t) 0 + 0); +#endif + +#if INT_LEAST8_MIN && INT_LEAST8_MAX && INT_LEAST16_MIN && INT_LEAST16_MAX && INT_LEAST32_MIN && INT_LEAST32_MAX +/* ok */ +#else +err or; +#endif + +#if UINT_LEAST8_MAX && UINT_LEAST16_MAX && UINT_LEAST32_MAX +/* ok */ +#else +err or; +#endif + +/* 7.18.1.3. Fastest minimum-width integer types */ +/* 7.18.2.3. Limits of fastest minimum-width integer types */ + +int_fast8_t e1[3] = { 17, INT_FAST8_MIN, INT_FAST8_MAX }; +verify (TYPE_MINIMUM (int_fast8_t) == INT_FAST8_MIN); +verify (TYPE_MAXIMUM (int_fast8_t) == INT_FAST8_MAX); +verify_same_types (INT_FAST8_MIN, (int_fast8_t) 0 + 0); +verify_same_types (INT_FAST8_MAX, (int_fast8_t) 0 + 0); + +int_fast16_t e2[3] = { 17, INT_FAST16_MIN, INT_FAST16_MAX }; +verify (TYPE_MINIMUM (int_fast16_t) == INT_FAST16_MIN); +verify (TYPE_MAXIMUM (int_fast16_t) == INT_FAST16_MAX); +verify_same_types (INT_FAST16_MIN, (int_fast16_t) 0 + 0); +verify_same_types (INT_FAST16_MAX, (int_fast16_t) 0 + 0); + +int_fast32_t e3[3] = { 17, INT_FAST32_MIN, INT_FAST32_MAX }; +verify (TYPE_MINIMUM (int_fast32_t) == INT_FAST32_MIN); +verify (TYPE_MAXIMUM (int_fast32_t) == INT_FAST32_MAX); +verify_same_types (INT_FAST32_MIN, (int_fast32_t) 0 + 0); +verify_same_types (INT_FAST32_MAX, (int_fast32_t) 0 + 0); + +#ifdef INT_FAST64_MAX +int_fast64_t e4[3] = { 17, INT_FAST64_MIN, INT_FAST64_MAX }; +verify (TYPE_MINIMUM (int_fast64_t) == INT_FAST64_MIN); +verify (TYPE_MAXIMUM (int_fast64_t) == INT_FAST64_MAX); +verify_same_types (INT_FAST64_MIN, (int_fast64_t) 0 + 0); +verify_same_types (INT_FAST64_MAX, (int_fast64_t) 0 + 0); +#endif + +uint_fast8_t f1[2] = { 17, UINT_FAST8_MAX }; +verify (TYPE_MAXIMUM (uint_fast8_t) == UINT_FAST8_MAX); +verify_same_types (UINT_FAST8_MAX, (uint_fast8_t) 0 + 0); + +uint_fast16_t f2[2] = { 17, UINT_FAST16_MAX }; +verify (TYPE_MAXIMUM (uint_fast16_t) == UINT_FAST16_MAX); +verify_same_types (UINT_FAST16_MAX, (uint_fast16_t) 0 + 0); + +uint_fast32_t f3[2] = { 17, UINT_FAST32_MAX }; +verify (TYPE_MAXIMUM (uint_fast32_t) == UINT_FAST32_MAX); +verify_same_types (UINT_FAST32_MAX, (uint_fast32_t) 0 + 0); + +#ifdef UINT_FAST64_MAX +uint_fast64_t f4[2] = { 17, UINT_FAST64_MAX }; +verify (TYPE_MAXIMUM (uint_fast64_t) == UINT_FAST64_MAX); +verify_same_types (UINT_FAST64_MAX, (uint_fast64_t) 0 + 0); +#endif + +#if INT_FAST8_MIN && INT_FAST8_MAX && INT_FAST16_MIN && INT_FAST16_MAX && INT_FAST32_MIN && INT_FAST32_MAX +/* ok */ +#else +err or; +#endif + +#if UINT_FAST8_MAX && UINT_FAST16_MAX && UINT_FAST32_MAX +/* ok */ +#else +err or; +#endif + +/* 7.18.1.4. Integer types capable of holding object pointers */ +/* 7.18.2.4. Limits of integer types capable of holding object pointers */ + +intptr_t g[3] = { 17, INTPTR_MIN, INTPTR_MAX }; +verify (TYPE_MINIMUM (intptr_t) == INTPTR_MIN); +verify (TYPE_MAXIMUM (intptr_t) == INTPTR_MAX); +verify_same_types (INTPTR_MIN, (intptr_t) 0 + 0); +verify_same_types (INTPTR_MAX, (intptr_t) 0 + 0); + +uintptr_t h[2] = { 17, UINTPTR_MAX }; +verify (TYPE_MAXIMUM (uintptr_t) == UINTPTR_MAX); +verify_same_types (UINTPTR_MAX, (uintptr_t) 0 + 0); + +#if INTPTR_MIN && INTPTR_MAX && UINTPTR_MAX +/* ok */ +#else +err or; +#endif + +/* 7.18.1.5. Greatest-width integer types */ +/* 7.18.2.5. Limits of greatest-width integer types */ + +intmax_t i[3] = { INTMAX_C (17), INTMAX_MIN, INTMAX_MAX }; +verify (TYPE_MINIMUM (intmax_t) == INTMAX_MIN); +verify (TYPE_MAXIMUM (intmax_t) == INTMAX_MAX); +verify_same_types (INTMAX_MIN, (intmax_t) 0 + 0); +verify_same_types (INTMAX_MAX, (intmax_t) 0 + 0); + +uintmax_t j[2] = { UINTMAX_C (17), UINTMAX_MAX }; +verify (TYPE_MAXIMUM (uintmax_t) == UINTMAX_MAX); +verify_same_types (UINTMAX_MAX, (uintmax_t) 0 + 0); + +/* As of 2007, Sun C and HP-UX 10.20 cc don't support 'long long' constants in + the preprocessor. */ +#if !(defined __SUNPRO_C || (defined __hpux && !defined __GNUC__)) +#if INTMAX_MIN && INTMAX_MAX && UINTMAX_MAX +/* ok */ +#else +err or; +#endif +#endif + +/* 7.18.3. Limits of other integer types */ + +#include <stddef.h> + +verify (TYPE_MINIMUM (ptrdiff_t) == PTRDIFF_MIN); +verify (TYPE_MAXIMUM (ptrdiff_t) == PTRDIFF_MAX); +verify_same_types (PTRDIFF_MIN, (ptrdiff_t) 0 + 0); +verify_same_types (PTRDIFF_MAX, (ptrdiff_t) 0 + 0); + +#if PTRDIFF_MIN && PTRDIFF_MAX +/* ok */ +#else +err or; +#endif + +#include <signal.h> + +verify (TYPE_MINIMUM (sig_atomic_t) == SIG_ATOMIC_MIN); +verify (TYPE_MAXIMUM (sig_atomic_t) == SIG_ATOMIC_MAX); +verify_same_types (SIG_ATOMIC_MIN, (sig_atomic_t) 0 + 0); +verify_same_types (SIG_ATOMIC_MAX, (sig_atomic_t) 0 + 0); + +#if SIG_ATOMIC_MIN != 17 && SIG_ATOMIC_MAX +/* ok */ +#else +err or; +#endif + +verify (TYPE_MAXIMUM (size_t) == SIZE_MAX); +verify_same_types (SIZE_MAX, (size_t) 0 + 0); + +#if SIZE_MAX +/* ok */ +#else +err or; +#endif + +#if HAVE_WCHAR_T +verify (TYPE_MINIMUM (wchar_t) == WCHAR_MIN); +verify (TYPE_MAXIMUM (wchar_t) == WCHAR_MAX); +verify_same_types (WCHAR_MIN, (wchar_t) 0 + 0); +verify_same_types (WCHAR_MAX, (wchar_t) 0 + 0); + +# if WCHAR_MIN != 17 && WCHAR_MAX +/* ok */ +# else +err or; +# endif +#endif + +#if HAVE_WINT_T +# include <wchar.h> + +verify (TYPE_MINIMUM (wint_t) == WINT_MIN); +verify (TYPE_MAXIMUM (wint_t) == WINT_MAX); +verify_same_types (WINT_MIN, (wint_t) 0 + 0); +verify_same_types (WINT_MAX, (wint_t) 0 + 0); + +# if WINT_MIN != 17 && WINT_MAX +/* ok */ +# else +err or; +# endif +#endif + +/* 7.18.4. Macros for integer constants */ + +verify (INT8_C (17) == 17); +verify_same_types (INT8_C (17), (int_least8_t)0 + 0); +verify (UINT8_C (17) == 17); +verify_same_types (UINT8_C (17), (uint_least8_t)0 + 0); + +verify (INT16_C (17) == 17); +verify_same_types (INT16_C (17), (int_least16_t)0 + 0); +verify (UINT16_C (17) == 17); +verify_same_types (UINT16_C (17), (uint_least16_t)0 + 0); + +verify (INT32_C (17) == 17); +verify_same_types (INT32_C (17), (int_least32_t)0 + 0); +verify (UINT32_C (17) == 17); +verify_same_types (UINT32_C (17), (uint_least32_t)0 + 0); + +#ifdef INT64_C +verify (INT64_C (17) == 17); +verify_same_types (INT64_C (17), (int_least64_t)0 + 0); +#endif +#ifdef UINT64_C +verify (UINT64_C (17) == 17); +verify_same_types (UINT64_C (17), (uint_least64_t)0 + 0); +#endif + +verify (INTMAX_C (17) == 17); +verify_same_types (INTMAX_C (17), (intmax_t)0 + 0); +verify (UINTMAX_C (17) == 17); +verify_same_types (UINTMAX_C (17), (uintmax_t)0 + 0); + +/* Use _GL_VERIFY (with a fixed-length diagnostic string) rather than verify, + because the latter would require forming each stringified expression, and + many of these would be so long as to trigger a warning/error like this: + + test-stdint.c:407:1: error: string length '6980' is greater than the \ + length '4095' ISO C99 compilers are required to support \ + [-Werror=overlength-strings] + */ +#define verify_width(width, min, max) \ + _GL_VERIFY ((max) >> ((width) - 1 - ((min) < 0)) == 1, \ + "verify_width check") + +/* Macros specified by ISO/IEC TS 18661-1:2014. */ + +#ifdef INT8_MAX +verify_width (INT8_WIDTH, INT8_MIN, INT8_MAX); +#endif +#ifdef UINT8_MAX +verify_width (UINT8_WIDTH, 0, UINT8_MAX); +#endif +#ifdef INT16_MAX +verify_width (INT16_WIDTH, INT16_MIN, INT16_MAX); +#endif +#ifdef UINT16_MAX +verify_width (UINT16_WIDTH, 0, UINT16_MAX); +#endif +#ifdef INT32_MAX +verify_width (INT32_WIDTH, INT32_MIN, INT32_MAX); +#endif +#ifdef UINT32_MAX +verify_width (UINT32_WIDTH, 0, UINT32_MAX); +#endif +#ifdef INT64_MAX +verify_width (INT64_WIDTH, INT64_MIN, INT64_MAX); +#endif +#ifdef UINT64_MAX +verify_width (UINT64_WIDTH, 0, UINT64_MAX); +#endif +verify_width (INT_LEAST8_WIDTH, INT_LEAST8_MIN, INT_LEAST8_MAX); +verify_width (UINT_LEAST8_WIDTH, 0, UINT_LEAST8_MAX); +verify_width (INT_LEAST16_WIDTH, INT_LEAST16_MIN, INT_LEAST16_MAX); +verify_width (UINT_LEAST16_WIDTH, 0, UINT_LEAST16_MAX); +verify_width (INT_LEAST32_WIDTH, INT_LEAST32_MIN, INT_LEAST32_MAX); +verify_width (UINT_LEAST32_WIDTH, 0, UINT_LEAST32_MAX); +verify_width (INT_LEAST64_WIDTH, INT_LEAST64_MIN, INT_LEAST64_MAX); +verify_width (UINT_LEAST64_WIDTH, 0, UINT_LEAST64_MAX); +verify_width (INT_FAST8_WIDTH, INT_FAST8_MIN, INT_FAST8_MAX); +verify_width (UINT_FAST8_WIDTH, 0, UINT_FAST8_MAX); +verify_width (INT_FAST16_WIDTH, INT_FAST16_MIN, INT_FAST16_MAX); +verify_width (UINT_FAST16_WIDTH, 0, UINT_FAST16_MAX); +verify_width (INT_FAST32_WIDTH, INT_FAST32_MIN, INT_FAST32_MAX); +verify_width (UINT_FAST32_WIDTH, 0, UINT_FAST32_MAX); +verify_width (INT_FAST64_WIDTH, INT_FAST64_MIN, INT_FAST64_MAX); +verify_width (UINT_FAST64_WIDTH, 0, UINT_FAST64_MAX); +verify_width (INTPTR_WIDTH, INTPTR_MIN, INTPTR_MAX); +verify_width (UINTPTR_WIDTH, 0, UINTPTR_MAX); +verify_width (INTMAX_WIDTH, INTMAX_MIN, INTMAX_MAX); +verify_width (UINTMAX_WIDTH, 0, UINTMAX_MAX); +verify_width (PTRDIFF_WIDTH, PTRDIFF_MIN, PTRDIFF_MAX); +verify_width (SIZE_WIDTH, 0, SIZE_MAX); +verify_width (WCHAR_WIDTH, WCHAR_MIN, WCHAR_MAX); +#ifdef WINT_MAX +verify_width (WINT_WIDTH, WINT_MIN, WINT_MAX); +#endif +#ifdef SIG_ATOMIC_MAX +verify_width (SIG_ATOMIC_WIDTH, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX); +#endif + +int +main (void) +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-stdio.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-stdio.c new file mode 100644 index 0000000000..46d75e24ba --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-stdio.c @@ -0,0 +1,43 @@ +/* Test of <stdio.h> substitute. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <stdio.h> + +#include "verify.h" + +/* Check that the various SEEK_* macros are defined. */ +int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET }; + +/* Check that NULL can be passed through varargs as a pointer type, + per POSIX 2008. */ +verify (sizeof NULL == sizeof (void *)); + +/* Check that the types are all defined. */ +fpos_t t1; +off_t t2; +size_t t3; +ssize_t t4; +va_list t5; + +int +main (void) +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-stdlib.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-stdlib.c new file mode 100644 index 0000000000..3c1d7fbf51 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-stdlib.c @@ -0,0 +1,54 @@ +/* Test of <stdlib.h> substitute. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <stdlib.h> + +#include "verify.h" + +/* Check that EXIT_SUCCESS is 0, per POSIX. */ +static int exitcode = EXIT_SUCCESS; +#if EXIT_SUCCESS +"oops" +#endif + +/* Check for GNU value (not guaranteed by POSIX, but is guaranteed by + gnulib). */ +#if EXIT_FAILURE != 1 +"oops" +#endif + +/* Check that NULL can be passed through varargs as a pointer type, + per POSIX 2008. */ +verify (sizeof NULL == sizeof (void *)); + +#if GNULIB_TEST_SYSTEM_POSIX +# include "test-sys_wait.h" +#else +# define test_sys_wait_macros() 0 +#endif + +int +main (void) +{ + if (test_sys_wait_macros ()) + return 1; + + return exitcode; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-strerror.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-strerror.c new file mode 100644 index 0000000000..6b2b4fa2d6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-strerror.c @@ -0,0 +1,75 @@ +/* Test of strerror() function. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2007. */ + +#include <config.h> + +#include <string.h> + +#include "signature.h" +SIGNATURE_CHECK (strerror, char *, (int)); + +#include <errno.h> + +#include "macros.h" + +int +main (void) +{ + char *str; + + errno = 0; + str = strerror (EACCES); + ASSERT (str); + ASSERT (*str); + ASSERT (errno == 0); + + errno = 0; + str = strerror (ETIMEDOUT); + ASSERT (str); + ASSERT (*str); + ASSERT (errno == 0); + + errno = 0; + str = strerror (EOVERFLOW); + ASSERT (str); + ASSERT (*str); + ASSERT (errno == 0); + + /* POSIX requires strerror (0) to succeed. Reject use of "Unknown + error", but allow "Success", "No error", or even Solaris' "Error + 0" which are distinct patterns from true out-of-range strings. + http://austingroupbugs.net/view.php?id=382 */ + errno = 0; + str = strerror (0); + ASSERT (str); + ASSERT (*str); + ASSERT (errno == 0); + ASSERT (strstr (str, "nknown") == NULL); + ASSERT (strstr (str, "ndefined") == NULL); + + /* POSIX requires strerror to produce a non-NULL result for all + inputs; as an extension, we also guarantee a non-empty result. + Reporting EINVAL is optional. */ + errno = 0; + str = strerror (-3); + ASSERT (str); + ASSERT (*str); + ASSERT (errno == 0 || errno == EINVAL); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-strerror_r.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-strerror_r.c new file mode 100644 index 0000000000..286e6abab8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-strerror_r.c @@ -0,0 +1,181 @@ +/* Test of strerror_r() function. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <string.h> + +#include "signature.h" +SIGNATURE_CHECK (strerror_r, int, (int, char *, size_t)); + +#include <errno.h> + +#include "macros.h" + +int +main (void) +{ + char buf[100]; + int ret; + + /* Test results with valid errnum and enough room. */ + + errno = 0; + buf[0] = '\0'; + ASSERT (strerror_r (EACCES, buf, sizeof buf) == 0); + ASSERT (buf[0] != '\0'); + ASSERT (errno == 0); + ASSERT (strlen (buf) < sizeof buf); + + errno = 0; + buf[0] = '\0'; + ASSERT (strerror_r (ETIMEDOUT, buf, sizeof buf) == 0); + ASSERT (buf[0] != '\0'); + ASSERT (errno == 0); + ASSERT (strlen (buf) < sizeof buf); + + errno = 0; + buf[0] = '\0'; + ASSERT (strerror_r (EOVERFLOW, buf, sizeof buf) == 0); + ASSERT (buf[0] != '\0'); + ASSERT (errno == 0); + ASSERT (strlen (buf) < sizeof buf); + + /* POSIX requires strerror (0) to succeed. Reject use of "Unknown + error", but allow "Success", "No error", or even Solaris' "Error + 0" which are distinct patterns from true out-of-range strings. + http://austingroupbugs.net/view.php?id=382 */ + errno = 0; + buf[0] = '\0'; + ret = strerror_r (0, buf, sizeof buf); + ASSERT (ret == 0); + ASSERT (buf[0]); + ASSERT (errno == 0); + ASSERT (strstr (buf, "nknown") == NULL); + ASSERT (strstr (buf, "ndefined") == NULL); + + /* Test results with out-of-range errnum and enough room. POSIX + allows an empty string on success, and allows an unchanged buf on + error, but these are not useful, so we guarantee contents. */ + errno = 0; + buf[0] = '^'; + ret = strerror_r (-3, buf, sizeof buf); + ASSERT (ret == 0 || ret == EINVAL); + ASSERT (buf[0] != '^'); + ASSERT (*buf); + ASSERT (errno == 0); + ASSERT (strlen (buf) < sizeof buf); + + /* Test results with a too small buffer. POSIX requires an error; + only ERANGE for 0 and valid errors, and a choice of ERANGE or + EINVAL for out-of-range values. On error, POSIX permits buf to + be empty, unchanged, or unterminated, but these are not useful, + so we guarantee NUL-terminated truncated contents for all but + size 0. http://austingroupbugs.net/view.php?id=398. Also ensure + that no out-of-bounds writes occur. */ + { + int errs[] = { EACCES, 0, -3, }; + int j; + + buf[sizeof buf - 1] = '\0'; + for (j = 0; j < SIZEOF (errs); j++) + { + int err = errs[j]; + char buf2[sizeof buf] = ""; + size_t len; + size_t i; + + strerror_r (err, buf2, sizeof buf2); + len = strlen (buf2); + ASSERT (len < sizeof buf); + + for (i = 0; i <= len; i++) + { + memset (buf, '^', sizeof buf - 1); + errno = 0; + ret = strerror_r (err, buf, i); + ASSERT (errno == 0); + if (err < 0) + ASSERT (ret == ERANGE || ret == EINVAL); + else + ASSERT (ret == ERANGE); + if (i) + { + ASSERT (strncmp (buf, buf2, i - 1) == 0); + ASSERT (buf[i - 1] == '\0'); + } + ASSERT (strspn (buf + i, "^") == sizeof buf - 1 - i); + } + + strcpy (buf, "BADFACE"); + errno = 0; + ret = strerror_r (err, buf, len + 1); + ASSERT (ret != ERANGE); + ASSERT (errno == 0); + ASSERT (strcmp (buf, buf2) == 0); + } + } + +#if GNULIB_STRERROR + /* Test that strerror_r does not clobber strerror buffer. On some + platforms, this test can only succeed if gnulib also replaces + strerror. */ + { + const char *msg1; + const char *msg2; + const char *msg3; + const char *msg4; + char *str1; + char *str2; + char *str3; + char *str4; + + msg1 = strerror (ENOENT); + ASSERT (msg1); + str1 = strdup (msg1); + ASSERT (str1); + + msg2 = strerror (ERANGE); + ASSERT (msg2); + str2 = strdup (msg2); + ASSERT (str2); + + msg3 = strerror (-4); + ASSERT (msg3); + str3 = strdup (msg3); + ASSERT (str3); + + msg4 = strerror (1729576); + ASSERT (msg4); + str4 = strdup (msg4); + ASSERT (str4); + + strerror_r (EACCES, buf, sizeof buf); + strerror_r (-5, buf, sizeof buf); + ASSERT (msg1 == msg2 || msg1 == msg4 || STREQ (msg1, str1)); + ASSERT (msg2 == msg4 || STREQ (msg2, str2)); + ASSERT (msg3 == msg4 || STREQ (msg3, str3)); + ASSERT (STREQ (msg4, str4)); + + free (str1); + free (str2); + free (str3); + free (str4); + } +#endif + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-strftime.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-strftime.c new file mode 100644 index 0000000000..102e168051 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-strftime.c @@ -0,0 +1,257 @@ +/* Test that posixtime works as required. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Jim Meyering. */ + +#include <config.h> + +#include "strftime.h" + +#include <errno.h> +#include <stdio.h> +#include <time.h> +#include <string.h> + +#include "macros.h" +#define STREQ(a, b) (strcmp (a, b) == 0) + +struct posixtm_test +{ + time_t in; + int in_ns; + char const *fmt; + char const *exp; +}; + +static struct posixtm_test const T[] = + { + { 1300000000, 0, "%F", "2011-03-13" }, + { 0, 10, "%T.%N", "00:00:00.000000010" }, + { 0, 0, NULL, NULL } + }; + +static int +posixtm_test (void) +{ + int fail = 0; + unsigned int i; + + for (i = 0; T[i].fmt; i++) + { + char buf[1000]; + time_t t = T[i].in; + struct tm *tm = gmtime (&t); + size_t n; + + ASSERT (tm); + + n = nstrftime (buf, sizeof buf, T[i].fmt, tm, 0, T[i].in_ns); + if (n == 0) + { + fail = 1; + printf ("nstrftime failed with format %s\n", T[i].fmt); + } + + if (! STREQ (buf, T[i].exp)) + { + fail = 1; + printf ("%s: result mismatch: got %s, expected %s\n", + T[i].fmt, buf, T[i].exp); + } + } + + return fail; +} + +struct tzalloc_test +{ + timezone_t tz; + char const *setting; +}; + +static struct tzalloc_test TZ[] = + { +#define Pacific 0 + { 0, "PST8PDT,M3.2.0,M11.1.0" }, +#define Arizona 1 + { 0, "MST7" }, +#define UTC 2 + { 0, 0 }, +#define CentEur 3 + { 0, "CET-1CEST,M3.5.0,M10.5.0/3" }, +#define Japan 4 + { 0, "JST-9" }, +#define NZ 5 + { 0, "NZST-12NZDT,M9.5.0,M4.1.0/3" }, +#define Unknown 6 + { 0, "<-00>0" }, + { 0 } + }; + +struct localtime_rz_test +{ + /* Input parameters. */ + struct tzalloc_test *tza; + time_t t; + + /* Expected result. */ + char const *exp; + + /* Determines if an incorrectly unset tm_isdst + results in failure or just a warning. */ + int ahistorical; +}; + +static struct localtime_rz_test LT[] = + { + { TZ+Pacific, 0, "1969-12-31 16:00:00 -0800 (PST)", 0 }, + { TZ+Arizona, 0, "1969-12-31 17:00:00 -0700 (MST)", 0 }, + { TZ+UTC , 0, "1970-01-01 00:00:00 +0000 (UTC)", 0 }, + { TZ+CentEur, 0, "1970-01-01 01:00:00 +0100 (CET)", 0 }, + { TZ+Japan , 0, "1970-01-01 09:00:00 +0900 (JST)", 0 }, + { TZ+NZ , 0, "1970-01-01 13:00:00 +1300 (NZDT)", 1 }, + { TZ+Unknown, 0, "1970-01-01 00:00:00 -0000 (-00)", 0 }, + { TZ+Pacific, 500000001, "1985-11-04 16:53:21 -0800 (PST)", 0 }, + { TZ+Arizona, 500000001, "1985-11-04 17:53:21 -0700 (MST)", 0 }, + { TZ+UTC , 500000001, "1985-11-05 00:53:21 +0000 (UTC)", 0 }, + { TZ+CentEur, 500000001, "1985-11-05 01:53:21 +0100 (CET)", 1 }, + { TZ+Japan , 500000001, "1985-11-05 09:53:21 +0900 (JST)", 0 }, + { TZ+NZ , 500000001, "1985-11-05 13:53:21 +1300 (NZDT)", 0 }, + { TZ+Unknown, 500000001, "1985-11-05 00:53:21 -0000 (-00)", 0 }, + { TZ+Pacific, 1000000002, "2001-09-08 18:46:42 -0700 (PDT)", 0 }, + { TZ+Arizona, 1000000002, "2001-09-08 18:46:42 -0700 (MST)", 0 }, + { TZ+UTC , 1000000002, "2001-09-09 01:46:42 +0000 (UTC)", 0 }, + { TZ+CentEur, 1000000002, "2001-09-09 03:46:42 +0200 (CEST)", 0 }, + { TZ+Japan , 1000000002, "2001-09-09 10:46:42 +0900 (JST)", 0 }, + { TZ+NZ , 1000000002, "2001-09-09 13:46:42 +1200 (NZST)", 0 }, + { TZ+Unknown, 1000000002, "2001-09-09 01:46:42 -0000 (-00)", 0 }, + { 0 } + }; + +static int +tzalloc_test (void) +{ + int fail = 0; + int i; + + for (i = 0; LT[i].tza; i++) + { + struct tzalloc_test *tza = LT[i].tza; + long lt = LT[i].t; + timezone_t tz = tza->tz; + char const *setting; + static char const format[] = "%Y-%m-%d %H:%M:%S %z (%Z)"; + char buf[1000]; + struct tm tm; + size_t n; + + if (!tz && tza->setting) + { + tz = tzalloc (tza->setting); + if (!tz) + { + fail = 1; + printf ("%s: tzalloc: %s\n", TZ[i].setting, strerror (errno)); + continue; + } + tza->tz = tz; + } + + setting = tza->setting ? tza->setting : "UTC0"; + + if (!localtime_rz (tz, <[i].t, &tm)) + { + fail = 1; + printf ("%s: %ld: localtime_rz: %s\n", setting, lt, + strerror (errno)); + continue; + } + + n = nstrftime (buf, sizeof buf, format, &tm, tz, 0); + if (n == 0) + { + fail = 1; + printf ("%s: %ld: nstrftime failed\n", setting, lt); + continue; + } + + if (! (STREQ (buf, LT[i].exp) + || (!tz && n == strlen (LT[i].exp) + && memcmp (buf, LT[i].exp, n - sizeof "(GMT)" + 1) == 0 + && STREQ (buf + n - sizeof "(GMT)" + 1, "(GMT)")))) + { + /* Don't fail for unhandled dst in ahistorical entries, + as gnulib doesn't currently fix that issue, seen on Darwin 14. */ + if (!LT[i].ahistorical || tm.tm_isdst) + fail = 1; + printf ("%s: expected \"%s\", got \"%s\"\n", + setting, LT[i].exp, buf); + } + } + + return fail; +} + + +static int +quarter_test (void) +{ + int result = 0; + size_t mon; + + /* Check %q. */ + for (mon = 1; mon <= 12; mon++) + { + char out[2]; + char exp[2] = {0,}; + struct tm qtm = { .tm_mon = mon - 1 }; + char fmt[3] = {'%','q','\0'}; + + size_t r = nstrftime (out, sizeof (out), fmt, &qtm, 0, 0); + if (r == 0) + { + puts ("nstrftime(\"%q\") failed"); + result = 1; + break; + } + + exp[0] = mon < 4 ? '1' : mon < 7 ? '2' : mon < 10 ? '3' : '4'; + if (strcmp (out, exp) != 0) + { + printf ("nstrftime %%q: expected \"%s\", got \"%s\"\n", exp, out); + result = 1; + break; + } + } + + return result; +} + +int +main (void) +{ + int fail = 0; + fail |= posixtm_test (); + fail |= tzalloc_test (); + fail |= quarter_test (); + return fail; +} + +/* +Local Variables: +indent-tabs-mode: nil +End: +*/ diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-striconv.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-striconv.c new file mode 100644 index 0000000000..700231512a --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-striconv.c @@ -0,0 +1,180 @@ +/* Test of character set conversion. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include "striconv.h" + +#if HAVE_ICONV +# include <iconv.h> +#endif + +#include <errno.h> +#include <stdlib.h> +#include <string.h> + +#include "macros.h" + +int +main () +{ +#if HAVE_ICONV + /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1, + and UTF-8. */ + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + iconv_t cd_utf8_to_88591 = iconv_open ("ISO-8859-1", "UTF-8"); + + ASSERT (cd_88591_to_utf8 != (iconv_t)(-1)); + ASSERT (cd_utf8_to_88591 != (iconv_t)(-1)); + + /* ------------------------- Test mem_cd_iconv() ------------------------- */ + + /* Test conversion from ISO-8859-1 to UTF-8 with no errors. */ + { + static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + static const char expected[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237"; + char *result = NULL; + size_t length = 0; + int retval = mem_cd_iconv (input, strlen (input), cd_88591_to_utf8, + &result, &length); + ASSERT (retval == 0); + ASSERT (length == strlen (expected)); + ASSERT (result != NULL && memcmp (result, expected, strlen (expected)) == 0); + free (result); + } + + /* Test conversion from UTF-8 to ISO-8859-1 with no errors. */ + { + static const char input[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237"; + static const char expected[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char *result = NULL; + size_t length = 0; + int retval = mem_cd_iconv (input, strlen (input), cd_utf8_to_88591, + &result, &length); + ASSERT (retval == 0); + ASSERT (length == strlen (expected)); + ASSERT (result != NULL && memcmp (result, expected, strlen (expected)) == 0); + free (result); + } + + /* Test conversion from UTF-8 to ISO-8859-1 with EILSEQ. */ + { + static const char input[] = "\342\202\254"; /* EURO SIGN */ + char *result = NULL; + size_t length = 0; + int retval = mem_cd_iconv (input, strlen (input), cd_utf8_to_88591, + &result, &length); + ASSERT (retval == -1 && errno == EILSEQ); + ASSERT (result == NULL); + } + + /* Test conversion from UTF-8 to ISO-8859-1 with EINVAL. */ + { + static const char input[] = "\342"; + char *result = NULL; + size_t length = 0; + int retval = mem_cd_iconv (input, strlen (input), cd_utf8_to_88591, + &result, &length); + ASSERT (retval == 0); + ASSERT (length == 0); + free (result); + } + + /* ------------------------- Test str_cd_iconv() ------------------------- */ + + /* Test conversion from ISO-8859-1 to UTF-8 with no errors. */ + { + static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + static const char expected[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237"; + char *result = str_cd_iconv (input, cd_88591_to_utf8); + ASSERT (result != NULL); + ASSERT (strcmp (result, expected) == 0); + free (result); + } + + /* Test conversion from UTF-8 to ISO-8859-1 with no errors. */ + { + static const char input[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237"; + static const char expected[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char *result = str_cd_iconv (input, cd_utf8_to_88591); + ASSERT (result != NULL); + ASSERT (strcmp (result, expected) == 0); + free (result); + } + + /* Test conversion from UTF-8 to ISO-8859-1 with EILSEQ. */ + { + static const char input[] = "Costs: 27 \342\202\254"; /* EURO SIGN */ + char *result = str_cd_iconv (input, cd_utf8_to_88591); + ASSERT (result == NULL && errno == EILSEQ); + } + + /* Test conversion from UTF-8 to ISO-8859-1 with EINVAL. */ + { + static const char input[] = "\342"; + char *result = str_cd_iconv (input, cd_utf8_to_88591); + ASSERT (result != NULL); + ASSERT (strcmp (result, "") == 0); + free (result); + } + + iconv_close (cd_88591_to_utf8); + iconv_close (cd_utf8_to_88591); + + /* -------------------------- Test str_iconv() -------------------------- */ + + /* Test conversion from ISO-8859-1 to UTF-8 with no errors. */ + { + static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + static const char expected[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237"; + char *result = str_iconv (input, "ISO-8859-1", "UTF-8"); + ASSERT (result != NULL); + ASSERT (strcmp (result, expected) == 0); + free (result); + } + + /* Test conversion from UTF-8 to ISO-8859-1 with no errors. */ + { + static const char input[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237"; + static const char expected[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char *result = str_iconv (input, "UTF-8", "ISO-8859-1"); + ASSERT (result != NULL); + ASSERT (strcmp (result, expected) == 0); + free (result); + } + + /* Test conversion from UTF-8 to ISO-8859-1 with EILSEQ. */ + { + static const char input[] = "Costs: 27 \342\202\254"; /* EURO SIGN */ + char *result = str_iconv (input, "UTF-8", "ISO-8859-1"); + ASSERT (result == NULL && errno == EILSEQ); + } + + /* Test conversion from UTF-8 to ISO-8859-1 with EINVAL. */ + { + static const char input[] = "\342"; + char *result = str_iconv (input, "UTF-8", "ISO-8859-1"); + ASSERT (result != NULL); + ASSERT (strcmp (result, "") == 0); + free (result); + } + +#endif + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-string.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-string.c new file mode 100644 index 0000000000..f10005d387 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-string.c @@ -0,0 +1,33 @@ +/* Test of <string.h> substitute. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <string.h> + +#include "verify.h" + +/* Check that NULL can be passed through varargs as a pointer type, + per POSIX 2008. */ +verify (sizeof NULL == sizeof (void *)); + +int +main (void) +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-strings.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-strings.c new file mode 100644 index 0000000000..d658a29d88 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-strings.c @@ -0,0 +1,27 @@ +/* Test of <strings.h> substitute. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <strings.h> + +int +main () +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-strnlen.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-strnlen.c new file mode 100644 index 0000000000..bceb05950f --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-strnlen.c @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2010-2017 Free Software Foundation, Inc. + * Written by Eric Blake + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <string.h> + +#include "signature.h" +SIGNATURE_CHECK (strnlen, size_t, (char const *, size_t)); + +#include <stdlib.h> + +#include "zerosize-ptr.h" +#include "macros.h" + +int +main (void) +{ + size_t i; + char *page_boundary = (char *) zerosize_ptr (); + if (!page_boundary) + { + page_boundary = malloc (0x1000); + ASSERT (page_boundary); + page_boundary += 0x1000; + } + + /* Basic behavior tests. */ + ASSERT (strnlen ("a", 0) == 0); + ASSERT (strnlen ("a", 1) == 1); + ASSERT (strnlen ("a", 2) == 1); + ASSERT (strnlen ("", 0x100000) == 0); + + /* Memory fence and alignment testing. */ + for (i = 0; i < 512; i++) + { + char *start = page_boundary - i; + size_t j = i; + memset (start, 'x', i); + do + { + if (i != j) + { + start[j] = 0; + ASSERT (strnlen (start, i + j) == j); + } + ASSERT (strnlen (start, i) == j); + ASSERT (strnlen (start, j) == j); + } + while (j--); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-strtoull.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-strtoull.c new file mode 100644 index 0000000000..d7dc35c9ab --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-strtoull.c @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2011-2017 Free Software Foundation, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <stdlib.h> + +#include "signature.h" +#ifndef strtoull +SIGNATURE_CHECK (strtoull, unsigned long long, (const char *, char **, int)); +#endif + +#include <errno.h> + +#include "macros.h" + +int +main (void) +{ + /* Subject sequence empty or invalid. */ + { + const char input[] = ""; + char *ptr; + unsigned long long result; + errno = 0; + result = strtoull (input, &ptr, 10); + ASSERT (result == 0); + ASSERT (ptr == input); + ASSERT (errno == 0 || errno == EINVAL); + } + { + const char input[] = " "; + char *ptr; + unsigned long long result; + errno = 0; + result = strtoull (input, &ptr, 10); + ASSERT (result == 0); + ASSERT (ptr == input); + ASSERT (errno == 0 || errno == EINVAL); + } + { + const char input[] = " +"; + char *ptr; + unsigned long long result; + errno = 0; + result = strtoull (input, &ptr, 10); + ASSERT (result == 0); + ASSERT (ptr == input); + ASSERT (errno == 0 || errno == EINVAL); + } + { + const char input[] = " -"; + char *ptr; + unsigned long long result; + errno = 0; + result = strtoull (input, &ptr, 10); + ASSERT (result == 0); + ASSERT (ptr == input); + ASSERT (errno == 0 || errno == EINVAL); + } + + /* Simple integer values. */ + { + const char input[] = "0"; + char *ptr; + unsigned long long result; + errno = 0; + result = strtoull (input, &ptr, 10); + ASSERT (result == 0); + ASSERT (ptr == input + 1); + ASSERT (errno == 0); + } + { + const char input[] = "+0"; + char *ptr; + unsigned long long result; + errno = 0; + result = strtoull (input, &ptr, 10); + ASSERT (result == 0); + ASSERT (ptr == input + 2); + ASSERT (errno == 0); + } + { + const char input[] = "-0"; + char *ptr; + unsigned long long result; + errno = 0; + result = strtoull (input, &ptr, 10); + ASSERT (result == 0); + ASSERT (ptr == input + 2); + ASSERT (errno == 0); + } + { + const char input[] = "23"; + char *ptr; + unsigned long long result; + errno = 0; + result = strtoull (input, &ptr, 10); + ASSERT (result == 23); + ASSERT (ptr == input + 2); + ASSERT (errno == 0); + } + { + const char input[] = " 23"; + char *ptr; + unsigned long long result; + errno = 0; + result = strtoull (input, &ptr, 10); + ASSERT (result == 23); + ASSERT (ptr == input + 3); + ASSERT (errno == 0); + } + { + const char input[] = "+23"; + char *ptr; + unsigned long long result; + errno = 0; + result = strtoull (input, &ptr, 10); + ASSERT (result == 23); + ASSERT (ptr == input + 3); + ASSERT (errno == 0); + } + { + const char input[] = "-23"; + char *ptr; + unsigned long long result; + errno = 0; + result = strtoull (input, &ptr, 10); + ASSERT (result == - 23ULL); + ASSERT (ptr == input + 3); + ASSERT (errno == 0); + } + + /* Large integer values. */ + { + const char input[] = "2147483647"; + char *ptr; + unsigned long long result; + errno = 0; + result = strtoull (input, &ptr, 10); + ASSERT (result == 2147483647); + ASSERT (ptr == input + 10); + ASSERT (errno == 0); + } + { + const char input[] = "-2147483648"; + char *ptr; + unsigned long long result; + errno = 0; + result = strtoull (input, &ptr, 10); + ASSERT (result == - 2147483648ULL); + ASSERT (ptr == input + 11); + ASSERT (errno == 0); + } + { + const char input[] = "4294967295"; + char *ptr; + unsigned long long result; + errno = 0; + result = strtoull (input, &ptr, 10); + ASSERT (result == 4294967295U); + ASSERT (ptr == input + 10); + ASSERT (errno == 0); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-strtoumax.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-strtoumax.c new file mode 100644 index 0000000000..a917c172fb --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-strtoumax.c @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2011-2017 Free Software Foundation, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <inttypes.h> + +#include "signature.h" +#ifndef strtoumax +SIGNATURE_CHECK (strtoumax, uintmax_t, (const char *, char **, int)); +#endif + +#include <errno.h> + +#include "macros.h" + +int +main (void) +{ + /* Subject sequence empty or invalid. */ + { + const char input[] = ""; + char *ptr; + uintmax_t result; + errno = 0; + result = strtoumax (input, &ptr, 10); + ASSERT (result == 0); + ASSERT (ptr == input); + ASSERT (errno == 0 || errno == EINVAL); + } + { + const char input[] = " "; + char *ptr; + uintmax_t result; + errno = 0; + result = strtoumax (input, &ptr, 10); + ASSERT (result == 0); + ASSERT (ptr == input); + ASSERT (errno == 0 || errno == EINVAL); + } + { + const char input[] = " +"; + char *ptr; + uintmax_t result; + errno = 0; + result = strtoumax (input, &ptr, 10); + ASSERT (result == 0); + ASSERT (ptr == input); + ASSERT (errno == 0 || errno == EINVAL); + } + { + const char input[] = " -"; + char *ptr; + uintmax_t result; + errno = 0; + result = strtoumax (input, &ptr, 10); + ASSERT (result == 0); + ASSERT (ptr == input); + ASSERT (errno == 0 || errno == EINVAL); + } + + /* Simple integer values. */ + { + const char input[] = "0"; + char *ptr; + uintmax_t result; + errno = 0; + result = strtoumax (input, &ptr, 10); + ASSERT (result == 0); + ASSERT (ptr == input + 1); + ASSERT (errno == 0); + } + { + const char input[] = "+0"; + char *ptr; + uintmax_t result; + errno = 0; + result = strtoumax (input, &ptr, 10); + ASSERT (result == 0); + ASSERT (ptr == input + 2); + ASSERT (errno == 0); + } + { + const char input[] = "-0"; + char *ptr; + uintmax_t result; + errno = 0; + result = strtoumax (input, &ptr, 10); + ASSERT (result == 0); + ASSERT (ptr == input + 2); + ASSERT (errno == 0); + } + { + const char input[] = "23"; + char *ptr; + uintmax_t result; + errno = 0; + result = strtoumax (input, &ptr, 10); + ASSERT (result == 23); + ASSERT (ptr == input + 2); + ASSERT (errno == 0); + } + { + const char input[] = " 23"; + char *ptr; + uintmax_t result; + errno = 0; + result = strtoumax (input, &ptr, 10); + ASSERT (result == 23); + ASSERT (ptr == input + 3); + ASSERT (errno == 0); + } + { + const char input[] = "+23"; + char *ptr; + uintmax_t result; + errno = 0; + result = strtoumax (input, &ptr, 10); + ASSERT (result == 23); + ASSERT (ptr == input + 3); + ASSERT (errno == 0); + } + { + const char input[] = "-23"; + char *ptr; + uintmax_t result; + errno = 0; + result = strtoumax (input, &ptr, 10); + ASSERT (result == - (uintmax_t) 23); + ASSERT (ptr == input + 3); + ASSERT (errno == 0); + } + + /* Large integer values. */ + { + const char input[] = "2147483647"; + char *ptr; + uintmax_t result; + errno = 0; + result = strtoumax (input, &ptr, 10); + ASSERT (result == 2147483647); + ASSERT (ptr == input + 10); + ASSERT (errno == 0); + } + { + const char input[] = "-2147483648"; + char *ptr; + uintmax_t result; + errno = 0; + result = strtoumax (input, &ptr, 10); + ASSERT (result == - (uintmax_t) 2147483648U); + ASSERT (ptr == input + 11); + ASSERT (errno == 0); + } + { + const char input[] = "4294967295"; + char *ptr; + uintmax_t result; + errno = 0; + result = strtoumax (input, &ptr, 10); + ASSERT (result == 4294967295U); + ASSERT (ptr == input + 10); + ASSERT (errno == 0); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-symlink.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-symlink.c new file mode 100644 index 0000000000..6b025a8601 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-symlink.c @@ -0,0 +1,47 @@ +/* Tests of symlink. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +#include <config.h> + +#include <unistd.h> + +#include "signature.h" +SIGNATURE_CHECK (symlink, int, (char const *, char const *)); + +#include <fcntl.h> +#include <errno.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <sys/stat.h> + +#include "ignore-value.h" +#include "macros.h" + +#define BASE "test-symlink.t" + +#include "test-symlink.h" + +int +main (void) +{ + /* Remove any leftovers from a previous partial run. */ + ignore_value (system ("rm -rf " BASE "*")); + + return test_symlink (symlink, true); +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-symlink.h b/local/recipes/tools/diffutils/source/gnulib-tests/test-symlink.h new file mode 100644 index 0000000000..8b16f4ad3b --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-symlink.h @@ -0,0 +1,95 @@ +/* Tests of symlink. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +/* This file is designed to test both symlink(a,b) and + symlinkat(a,AT_FDCWD,b). FUNC is the function to test. Assumes + that BASE and ASSERT are already defined, and that appropriate + headers are already included. If PRINT, warn before skipping + symlink tests with status 77. */ + +static int +test_symlink (int (*func) (char const *, char const *), bool print) +{ + if (func ("nowhere", BASE "link1")) + { + if (print) + fputs ("skipping test: symlinks not supported on this file system\n", + stderr); + return 77; + } + + /* Some systems allow the creation of 0-length symlinks as a synonym + for "."; but most reject it. */ + { + int status; + errno = 0; + status = func ("", BASE "link2"); + if (status == -1) + ASSERT (errno == ENOENT || errno == EINVAL); + else + { + ASSERT (status == 0); + ASSERT (unlink (BASE "link2") == 0); + } + } + + /* Sanity checks of failures. */ + errno = 0; + ASSERT (func ("nowhere", "") == -1); + ASSERT (errno == ENOENT); + errno = 0; + ASSERT (func ("nowhere", ".") == -1); + ASSERT (errno == EEXIST || errno == EINVAL); + errno = 0; + ASSERT (func ("somewhere", BASE "link1") == -1); + ASSERT (errno == EEXIST); + errno = 0; + ASSERT (func ("nowhere", BASE "link2/") == -1); + ASSERT (errno == ENOTDIR || errno == ENOENT); + ASSERT (mkdir (BASE "dir", 0700) == 0); + errno = 0; + ASSERT (func ("nowhere", BASE "dir") == -1); + ASSERT (errno == EEXIST); + errno = 0; + ASSERT (func ("nowhere", BASE "dir/") == -1); + ASSERT (errno == EEXIST || errno == EINVAL); + ASSERT (close (creat (BASE "file", 0600)) == 0); + errno = 0; + ASSERT (func ("nowhere", BASE "file") == -1); + ASSERT (errno == EEXIST); + errno = 0; + ASSERT (func ("nowhere", BASE "file/") == -1); + ASSERT (errno == EEXIST || errno == ENOTDIR || errno == ENOENT); + + /* Trailing slash must always be rejected. */ + ASSERT (unlink (BASE "link1") == 0); + ASSERT (func (BASE "link2", BASE "link1") == 0); + errno = 0; + ASSERT (func (BASE "nowhere", BASE "link1/") == -1); + ASSERT (errno == EEXIST || errno == ENOTDIR || errno == ENOENT); + errno = 0; + ASSERT (unlink (BASE "link2") == -1); + ASSERT (errno == ENOENT); + + /* Cleanup. */ + ASSERT (rmdir (BASE "dir") == 0); + ASSERT (unlink (BASE "file") == 0); + ASSERT (unlink (BASE "link1") == 0); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_ioctl.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_ioctl.c new file mode 100644 index 0000000000..41d9462403 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_ioctl.c @@ -0,0 +1,27 @@ +/* Test of <sys/ioctl.h> substitute. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +#include <config.h> + +#include <sys/ioctl.h> + +int +main (void) +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_select.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_select.c new file mode 100644 index 0000000000..34793c5fff --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_select.c @@ -0,0 +1,59 @@ +/* Test of <sys/select.h> substitute. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <sys/select.h> + +#include "signature.h" + +/* The following may be macros without underlying functions, so only + check signature if they are not macros. */ +#ifndef FD_CLR +SIGNATURE_CHECK (FD_CLR, void, (int, fd_set *)); +#endif +#ifndef FD_ISSET +SIGNATURE_CHECK (FD_ISSET, void, (int, fd_set *)); +#endif +#ifndef FD_SET +SIGNATURE_CHECK (FD_SET, int, (int, fd_set *)); +#endif +#ifndef FD_ZERO +SIGNATURE_CHECK (FD_ZERO, void, (fd_set *)); +#endif + +/* Check that the 'struct timeval' type is defined. */ +struct timeval a; + +/* Check that a.tv_sec is wide enough to hold a time_t, ignoring + signedness issues. */ +typedef int verify_tv_sec_type[sizeof (time_t) <= sizeof (a.tv_sec) ? 1 : -1]; + +/* Check that sigset_t is defined. */ +sigset_t t2; + +int +main (void) +{ + /* Check that FD_ZERO can be used. This should not yield a warning + such as "warning: implicit declaration of function 'memset'". */ + fd_set fds; + FD_ZERO (&fds); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_socket.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_socket.c new file mode 100644 index 0000000000..35c198bb7b --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_socket.c @@ -0,0 +1,68 @@ +/* Test of <sys/socket.h> substitute. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <sys/socket.h> + +#include <errno.h> + +#if HAVE_SHUTDOWN +/* Check some integer constant expressions. */ +int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR }; +#endif + +/* Check that the 'socklen_t' type is defined. */ +socklen_t t1; + +/* Check that the 'size_t' and 'ssize_t' types are defined. */ +size_t t2; +ssize_t t3; + +/* Check that 'struct iovec' is defined. */ +struct iovec io; + +/* Check that a minimal set of 'struct msghdr' is defined. */ +struct msghdr msg; + +int +main (void) +{ + struct sockaddr_storage x; + sa_family_t i; + + /* Check some errno values. */ + switch (ENOTSOCK) + { + case ENOTSOCK: + case EADDRINUSE: + case ENETRESET: + case ECONNABORTED: + case ECONNRESET: + case ENOTCONN: + case ESHUTDOWN: + break; + } + + x.ss_family = 42; + i = 42; + msg.msg_iov = &io; + + return (x.ss_family - i + msg.msg_namelen + msg.msg_iov->iov_len + + msg.msg_iovlen); +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_stat.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_stat.c new file mode 100644 index 0000000000..df1972f3cc --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_stat.c @@ -0,0 +1,340 @@ +/* Test of <sys/stat.h> substitute. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <sys/stat.h> + +#include "verify.h" + +/* Check the existence of some macros. */ +int a[] = + { + S_IFMT, +#ifdef S_IFBLK /* missing on MSVC */ + S_IFBLK, +#endif + S_IFCHR, S_IFDIR, S_IFIFO, S_IFREG, +#ifdef S_IFLNK /* missing on native Windows and DJGPP */ + S_IFLNK, +#endif +#ifdef S_IFSOCK /* missing on native Windows and DJGPP */ + S_IFSOCK, +#endif + S_IRWXU, S_IRUSR, S_IWUSR, S_IXUSR, + S_IRWXG, S_IRGRP, S_IWGRP, S_IXGRP, + S_IRWXO, S_IROTH, S_IWOTH, S_IXOTH, + S_ISUID, S_ISGID, S_ISVTX, + S_ISBLK (S_IFREG), + S_ISCHR (S_IFREG), + S_ISDIR (S_IFREG), + S_ISFIFO (S_IFREG), + S_ISREG (S_IFREG), + S_ISLNK (S_IFREG), + S_ISSOCK (S_IFREG), + S_ISDOOR (S_IFREG), + S_ISMPB (S_IFREG), + S_ISMPX (S_IFREG), + S_ISNAM (S_IFREG), + S_ISNWK (S_IFREG), + S_ISPORT (S_IFREG), + S_ISCTG (S_IFREG), + S_ISOFD (S_IFREG), + S_ISOFL (S_IFREG), + S_ISWHT (S_IFREG) + }; + +/* Sanity checks. */ + +verify (S_IRWXU == (S_IRUSR | S_IWUSR | S_IXUSR)); +verify (S_IRWXG == (S_IRGRP | S_IWGRP | S_IXGRP)); +verify (S_IRWXO == (S_IROTH | S_IWOTH | S_IXOTH)); + +#ifdef S_IFBLK +verify (S_ISBLK (S_IFBLK)); +#endif +verify (!S_ISBLK (S_IFCHR)); +verify (!S_ISBLK (S_IFDIR)); +verify (!S_ISBLK (S_IFIFO)); +verify (!S_ISBLK (S_IFREG)); +#ifdef S_IFLNK +verify (!S_ISBLK (S_IFLNK)); +#endif +#ifdef S_IFSOCK +verify (!S_ISBLK (S_IFSOCK)); +#endif + +#ifdef S_IFBLK +verify (!S_ISCHR (S_IFBLK)); +#endif +verify (S_ISCHR (S_IFCHR)); +verify (!S_ISCHR (S_IFDIR)); +verify (!S_ISCHR (S_IFIFO)); +verify (!S_ISCHR (S_IFREG)); +#ifdef S_IFLNK +verify (!S_ISCHR (S_IFLNK)); +#endif +#ifdef S_IFSOCK +verify (!S_ISCHR (S_IFSOCK)); +#endif + +#ifdef S_IFBLK +verify (!S_ISDIR (S_IFBLK)); +#endif +verify (!S_ISDIR (S_IFCHR)); +verify (S_ISDIR (S_IFDIR)); +verify (!S_ISDIR (S_IFIFO)); +verify (!S_ISDIR (S_IFREG)); +#ifdef S_IFLNK +verify (!S_ISDIR (S_IFLNK)); +#endif +#ifdef S_IFSOCK +verify (!S_ISDIR (S_IFSOCK)); +#endif + +#ifdef S_IFBLK +verify (!S_ISFIFO (S_IFBLK)); +#endif +verify (!S_ISFIFO (S_IFCHR)); +verify (!S_ISFIFO (S_IFDIR)); +verify (S_ISFIFO (S_IFIFO)); +verify (!S_ISFIFO (S_IFREG)); +#ifdef S_IFLNK +verify (!S_ISFIFO (S_IFLNK)); +#endif +#ifdef S_IFSOCK +verify (!S_ISFIFO (S_IFSOCK)); +#endif + +#ifdef S_IFBLK +verify (!S_ISREG (S_IFBLK)); +#endif +verify (!S_ISREG (S_IFCHR)); +verify (!S_ISREG (S_IFDIR)); +verify (!S_ISREG (S_IFIFO)); +verify (S_ISREG (S_IFREG)); +#ifdef S_IFLNK +verify (!S_ISREG (S_IFLNK)); +#endif +#ifdef S_IFSOCK +verify (!S_ISREG (S_IFSOCK)); +#endif + +#ifdef S_IFBLK +verify (!S_ISLNK (S_IFBLK)); +#endif +verify (!S_ISLNK (S_IFCHR)); +verify (!S_ISLNK (S_IFDIR)); +verify (!S_ISLNK (S_IFIFO)); +verify (!S_ISLNK (S_IFREG)); +#ifdef S_IFLNK +verify (S_ISLNK (S_IFLNK)); +#endif +#ifdef S_IFSOCK +verify (!S_ISLNK (S_IFSOCK)); +#endif + +#ifdef S_IFBLK +verify (!S_ISSOCK (S_IFBLK)); +#endif +verify (!S_ISSOCK (S_IFCHR)); +verify (!S_ISSOCK (S_IFDIR)); +verify (!S_ISSOCK (S_IFIFO)); +verify (!S_ISSOCK (S_IFREG)); +#ifdef S_IFLNK +verify (!S_ISSOCK (S_IFLNK)); +#endif +#ifdef S_IFSOCK +verify (S_ISSOCK (S_IFSOCK)); +#endif + +#ifdef S_IFBLK +verify (!S_ISDOOR (S_IFBLK)); +#endif +verify (!S_ISDOOR (S_IFCHR)); +verify (!S_ISDOOR (S_IFDIR)); +verify (!S_ISDOOR (S_IFIFO)); +verify (!S_ISDOOR (S_IFREG)); +#ifdef S_IFLNK +verify (!S_ISDOOR (S_IFLNK)); +#endif +#ifdef S_IFSOCK +verify (!S_ISDOOR (S_IFSOCK)); +#endif + +#ifdef S_IFBLK +verify (!S_ISMPB (S_IFBLK)); +#endif +verify (!S_ISMPB (S_IFCHR)); +verify (!S_ISMPB (S_IFDIR)); +verify (!S_ISMPB (S_IFIFO)); +verify (!S_ISMPB (S_IFREG)); +#ifdef S_IFLNK +verify (!S_ISMPB (S_IFLNK)); +#endif +#ifdef S_IFSOCK +verify (!S_ISMPB (S_IFSOCK)); +#endif + +#ifdef S_IFBLK +verify (!S_ISMPX (S_IFBLK)); +#endif +verify (!S_ISMPX (S_IFCHR)); +verify (!S_ISMPX (S_IFDIR)); +verify (!S_ISMPX (S_IFIFO)); +verify (!S_ISMPX (S_IFREG)); +#ifdef S_IFLNK +verify (!S_ISMPX (S_IFLNK)); +#endif +#ifdef S_IFSOCK +verify (!S_ISMPX (S_IFSOCK)); +#endif + +#ifdef S_IFBLK +verify (!S_ISNAM (S_IFBLK)); +#endif +verify (!S_ISNAM (S_IFCHR)); +verify (!S_ISNAM (S_IFDIR)); +verify (!S_ISNAM (S_IFIFO)); +verify (!S_ISNAM (S_IFREG)); +#ifdef S_IFLNK +verify (!S_ISNAM (S_IFLNK)); +#endif +#ifdef S_IFSOCK +verify (!S_ISNAM (S_IFSOCK)); +#endif + +#ifdef S_IFBLK +verify (!S_ISNWK (S_IFBLK)); +#endif +verify (!S_ISNWK (S_IFCHR)); +verify (!S_ISNWK (S_IFDIR)); +verify (!S_ISNWK (S_IFIFO)); +verify (!S_ISNWK (S_IFREG)); +#ifdef S_IFLNK +verify (!S_ISNWK (S_IFLNK)); +#endif +#ifdef S_IFSOCK +verify (!S_ISNWK (S_IFSOCK)); +#endif + +#ifdef S_IFBLK +verify (!S_ISPORT (S_IFBLK)); +#endif +verify (!S_ISPORT (S_IFCHR)); +verify (!S_ISPORT (S_IFDIR)); +verify (!S_ISPORT (S_IFIFO)); +verify (!S_ISPORT (S_IFREG)); +#ifdef S_IFLNK +verify (!S_ISPORT (S_IFLNK)); +#endif +#ifdef S_IFSOCK +verify (!S_ISPORT (S_IFSOCK)); +#endif + +#ifdef S_IFBLK +verify (!S_ISCTG (S_IFBLK)); +#endif +verify (!S_ISCTG (S_IFCHR)); +verify (!S_ISCTG (S_IFDIR)); +verify (!S_ISCTG (S_IFIFO)); +verify (!S_ISCTG (S_IFREG)); +#ifdef S_IFLNK +verify (!S_ISCTG (S_IFLNK)); +#endif +#ifdef S_IFSOCK +verify (!S_ISCTG (S_IFSOCK)); +#endif + +#ifdef S_IFBLK +verify (!S_ISOFD (S_IFBLK)); +#endif +verify (!S_ISOFD (S_IFCHR)); +verify (!S_ISOFD (S_IFDIR)); +verify (!S_ISOFD (S_IFIFO)); +verify (!S_ISOFD (S_IFREG)); +#ifdef S_IFLNK +verify (!S_ISOFD (S_IFLNK)); +#endif +#ifdef S_IFSOCK +verify (!S_ISOFD (S_IFSOCK)); +#endif + +#ifdef S_IFBLK +verify (!S_ISOFL (S_IFBLK)); +#endif +verify (!S_ISOFL (S_IFCHR)); +verify (!S_ISOFL (S_IFDIR)); +verify (!S_ISOFL (S_IFIFO)); +verify (!S_ISOFL (S_IFREG)); +#ifdef S_IFLNK +verify (!S_ISOFL (S_IFLNK)); +#endif +#ifdef S_IFSOCK +verify (!S_ISOFL (S_IFSOCK)); +#endif + +#ifdef S_IFBLK +verify (!S_ISWHT (S_IFBLK)); +#endif +verify (!S_ISWHT (S_IFCHR)); +verify (!S_ISWHT (S_IFDIR)); +verify (!S_ISWHT (S_IFIFO)); +verify (!S_ISWHT (S_IFREG)); +#ifdef S_IFLNK +verify (!S_ISWHT (S_IFLNK)); +#endif +#ifdef S_IFSOCK +verify (!S_ISWHT (S_IFSOCK)); +#endif + +/* POSIX 2008 requires traditional encoding of permission constants. */ +verify (S_IRWXU == 00700); +verify (S_IRUSR == 00400); +verify (S_IWUSR == 00200); +verify (S_IXUSR == 00100); +verify (S_IRWXG == 00070); +verify (S_IRGRP == 00040); +verify (S_IWGRP == 00020); +verify (S_IXGRP == 00010); +verify (S_IRWXO == 00007); +verify (S_IROTH == 00004); +verify (S_IWOTH == 00002); +verify (S_IXOTH == 00001); +verify (S_ISUID == 04000); +verify (S_ISGID == 02000); +verify (S_ISVTX == 01000); + +#if ((0 <= UTIME_NOW && UTIME_NOW < 1000000000) \ + || (0 <= UTIME_OMIT && UTIME_OMIT < 1000000000) \ + || UTIME_NOW == UTIME_OMIT) +invalid UTIME macros +#endif + +/* Check the existence of some types. */ +nlink_t t1; +off_t t2; +mode_t t3; + +struct timespec st; + +int +main (void) +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_time.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_time.c new file mode 100644 index 0000000000..ea38e847c0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_time.c @@ -0,0 +1,34 @@ +/* Test of <sys/time.h> substitute. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <sys/time.h> + +/* Check that the 'struct timeval' type is defined. */ +struct timeval a; + +/* Check that a.tv_sec is wide enough to hold a time_t, ignoring + signedness issues. */ +typedef int verify_tv_sec_type[sizeof (time_t) <= sizeof (a.tv_sec) ? 1 : -1]; + +int +main (void) +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_types.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_types.c new file mode 100644 index 0000000000..30a6b9db1f --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_types.c @@ -0,0 +1,34 @@ +/* Test of <sys/types.h> substitute. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2011. */ + +#include <config.h> + +#include <sys/types.h> + +/* Check that the types are all defined. */ +pid_t t1; +size_t t2; +ssize_t t3; +off_t t4; +mode_t t5; + +int +main (void) +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_uio.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_uio.c new file mode 100644 index 0000000000..713eafb92d --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_uio.c @@ -0,0 +1,32 @@ +/* Test of <sys/uio.h> substitute. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <eblake@redhat.com>, 2011. */ + +#include <config.h> + +#include <sys/uio.h> + +/* Check that necessary types are defined. */ +size_t a; +ssize_t b; +struct iovec c; + +int +main (void) +{ + return a + b + !!c.iov_base + c.iov_len; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_wait.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_wait.c new file mode 100644 index 0000000000..d3b6804914 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_wait.c @@ -0,0 +1,47 @@ +/* Test of <sys/wait.h> substitute. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +#include <config.h> + +#include <sys/wait.h> + +/* Check for existence of required types. */ +static pid_t a; + +#include "test-sys_wait.h" + +int +main (void) +{ + if (test_sys_wait_macros ()) + return 1; + +#if 0 + switch (WCONTINUED) + { + /* Gnulib doesn't guarantee these, yet. */ + case WCONTINUED: + case WEXITED: + case WNOWAIT: + case WSTOPPED: + break; + } +#endif + + return a ? 1 : 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_wait.h b/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_wait.h new file mode 100644 index 0000000000..00cb1c0500 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-sys_wait.h @@ -0,0 +1,53 @@ +/* Test of macros shared between <sys/wait.h> and <stdlib.h>. + Copyright (C) 2010-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2010. */ + +static int +test_sys_wait_macros (void) +{ + /* Check subset of <sys/wait.h> macros that must be visible here. + Note that some of these macros are only portable when operating + on an lvalue. */ + int i; + for (i = 0; i < 0x8000; i = (i ? i << 1 : 1)) + { + /* POSIX requires that for all valid process statuses, that + exactly one of these three macros is true. But not all + possible 16-bit values map to valid process status. + Traditionally, 8 of the bits are for WIFEXITED, 7 of the bits + to tell between WIFSIGNALED and WIFSTOPPED, and either 0x80 + or 0x8000 to flag that core was also dumped. Since we don't + know which byte is WIFEXITED, we skip the both possible bits + that can signal core dump. */ + if (i == 0x80) + continue; + if (!!WIFSIGNALED (i) + !!WIFEXITED (i) + !!WIFSTOPPED (i) != 1) + return 1; + } + i = WEXITSTATUS (i) + WSTOPSIG (i) + WTERMSIG (i); + + switch (i) + { +#if 0 + /* Gnulib doesn't guarantee these, yet. */ + case WNOHANG: + case WUNTRACED: +#endif + break; + } + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-time.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-time.c new file mode 100644 index 0000000000..ff9ffeea4e --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-time.c @@ -0,0 +1,41 @@ +/* Test of <time.h> substitute. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <time.h> + +#include "verify.h" + +/* Check that the types are all defined. */ +struct timespec t1; +#if 0 +/* POSIX:2008 does not require pid_t in <time.h> unconditionally, and indeed + it's missing on Mac OS X 10.5, FreeBSD 6.4, OpenBSD 4.9, mingw. */ +pid_t t2; +#endif + +/* Check that NULL can be passed through varargs as a pointer type, + per POSIX 2008. */ +verify (sizeof NULL == sizeof (void *)); + +int +main (void) +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-timespec.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-timespec.c new file mode 100644 index 0000000000..de8e29d464 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-timespec.c @@ -0,0 +1,167 @@ +/* Test timespec functions. + Copyright 2015-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +#include <config.h> + +#include "timespec.h" + +#include "intprops.h" +#include "macros.h" + +#include <stdbool.h> +#include <limits.h> + +static struct { int s; int ns; } const prototype[] = + { + { INT_MIN, 0 }, + { INT_MIN, 1 }, + { INT_MIN, TIMESPEC_RESOLUTION - 1 }, + { INT_MIN + 1, 0 }, + { INT_MIN + 1, 1 }, + { INT_MIN + 1, TIMESPEC_RESOLUTION - 1 }, + { -1, 0 }, + { -1, 1 }, + { -1, TIMESPEC_RESOLUTION - 1 }, + { 0, 0 }, + { 0, 1 }, + { 0, TIMESPEC_RESOLUTION - 1 }, + { 1, 0 }, + { 1, 1 }, + { 1, TIMESPEC_RESOLUTION - 1 }, + { 1234567890, 0 }, + { 1234567890, 1 }, + { 1234567890, TIMESPEC_RESOLUTION - 1 }, + { INT_MAX - 1, 0 }, + { INT_MAX - 1, 1 }, + { INT_MAX - 1, TIMESPEC_RESOLUTION - 1 }, + { INT_MAX, 0 }, + { INT_MAX, 1 }, + { INT_MAX, TIMESPEC_RESOLUTION - 1 }, + { INT_MAX, 2 * TIMESPEC_RESOLUTION } + }; +enum { nprototypes = sizeof prototype / sizeof *prototype }; + +static bool +valid (struct timespec a) +{ + return 0 <= a.tv_nsec && a.tv_nsec < TIMESPEC_RESOLUTION; +} + +static int +sign (int i) +{ + return i < 0 ? -1 : 0 < i; +} + +static int +cmp (struct timespec a, struct timespec b) +{ + return sign (timespec_cmp (a, b)); +} + +static bool +eq (struct timespec a, struct timespec b) +{ + return timespec_cmp (a, b) == 0; +} + +static bool +extremal (struct timespec a) +{ + return ((a.tv_sec == TYPE_MINIMUM (time_t) && a.tv_nsec == 0) + || (a.tv_sec == TYPE_MAXIMUM (time_t) + && a.tv_nsec == TIMESPEC_RESOLUTION - 1)); +} + +int +main (void) +{ + int i, j, k; + struct timespec test[nprototypes + 1]; + int ntests; + int computed_resolution = 1; + struct timespec prevroundtrip; + + test[0] = make_timespec (TYPE_MINIMUM (time_t), -1); + ntests = 1; + for (i = 0; i < nprototypes; i++) + { + int s = prototype[i].s; + if (TYPE_SIGNED (time_t) || 0 <= s) + { + time_t t = (s <= INT_MIN + 1 ? s - INT_MIN + TYPE_MINIMUM (time_t) + : INT_MAX - 1 <= s ? s - INT_MAX + TYPE_MAXIMUM (time_t) + : s); + test[ntests++] = make_timespec (t, prototype[i].ns); + } + } + + for (i = 0; i < LOG10_TIMESPEC_RESOLUTION; i++) + computed_resolution *= 10; + ASSERT (computed_resolution == TIMESPEC_RESOLUTION); + + for (i = 0; i < ntests; i++) + { + struct timespec a = test[i]; + + struct timespec roundtrip = dtotimespec (timespectod (a)); + if (i != 0) + ASSERT (cmp (prevroundtrip, roundtrip) <= 0); + prevroundtrip = roundtrip; + + ASSERT (sign (timespec_sign (a)) == cmp (a, make_timespec (0, 0))); + + if (valid (a)) + for (j = 0; j < ntests; j++) + { + struct timespec b = test[j]; + if (valid (b)) + { + struct timespec sum = timespec_add (a, b); + struct timespec diff = timespec_sub (a, b); + struct timespec rdiff = timespec_sub (b, a); + ASSERT (cmp (a, b) == sign (i - j)); + ASSERT (eq (sum, timespec_add (b, a))); + if (! extremal (sum)) + { + ASSERT (eq (a, timespec_sub (sum, b))); + ASSERT (eq (b, timespec_sub (sum, a))); + + for (k = 0; k < ntests; k++) + { + struct timespec c = test[k]; + if (valid (c)) + { + struct timespec sumbc = timespec_add (b, c); + if (! extremal (sumbc)) + ASSERT (eq (timespec_add (a, sumbc), + timespec_add (sum, c))); + } + } + } + if (! extremal (diff)) + ASSERT (eq (a, timespec_add (diff, b))); + if (! extremal (rdiff)) + ASSERT (eq (b, timespec_add (rdiff, a))); + + } + } + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-unistd.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-unistd.c new file mode 100644 index 0000000000..ce7f59a25e --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-unistd.c @@ -0,0 +1,56 @@ +/* Test of <unistd.h> substitute. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <unistd.h> + +#include "verify.h" + +/* Check that NULL can be passed through varargs as a pointer type, + per POSIX 2008. */ +verify (sizeof NULL == sizeof (void *)); + +/* Check that the various SEEK_* macros are defined. */ +int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET }; + +/* Check that the various *_FILENO macros are defined. */ +#if ! (defined STDIN_FILENO \ + && (STDIN_FILENO + STDOUT_FILENO + STDERR_FILENO == 3)) +missing or broken *_FILENO macros +#endif + +/* Check that the types are all defined. */ +size_t t1; +ssize_t t2; +#ifdef TODO /* Not implemented in gnulib yet */ +uid_t t3; +gid_t t4; +#endif +off_t t5; +pid_t t6; +#ifdef TODO +useconds_t t7; +intptr_t t8; +#endif + +int +main (void) +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-unsetenv.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-unsetenv.c new file mode 100644 index 0000000000..d7d7d05a49 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-unsetenv.c @@ -0,0 +1,61 @@ +/* Tests of unsetenv. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +#include <config.h> + +#include <stdlib.h> + +#include "signature.h" +SIGNATURE_CHECK (unsetenv, int, (char const *)); + +#include <errno.h> +#include <string.h> +#include <unistd.h> + +#include "macros.h" + +int +main (void) +{ + char entry[] = "b=2"; + + /* Test removal when multiple entries present. */ + ASSERT (putenv ((char *) "a=1") == 0); + ASSERT (putenv (entry) == 0); + entry[0] = 'a'; /* Unspecified what getenv("a") would be at this point. */ + ASSERT (unsetenv ("a") == 0); /* Both entries will be removed. */ + ASSERT (getenv ("a") == NULL); + ASSERT (unsetenv ("a") == 0); + + /* Required to fail with EINVAL. */ + errno = 0; + ASSERT (unsetenv ("") == -1); + ASSERT (errno == EINVAL); + errno = 0; + ASSERT (unsetenv ("a=b") == -1); + ASSERT (errno == EINVAL); +#if 0 + /* glibc and gnulib's implementation guarantee this, but POSIX no + longer requires it: http://austingroupbugs.net/view.php?id=185 */ + errno = 0; + ASSERT (unsetenv (NULL) == -1); + ASSERT (errno == EINVAL); +#endif + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-update-copyright.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-update-copyright.sh new file mode 100755 index 0000000000..0df54e2a73 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-update-copyright.sh @@ -0,0 +1,547 @@ +#!/bin/sh +# Test suite for update-copyright. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# This file is part of the GNUlib Library. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +diffout=`diff -u /dev/null /dev/null 2>&1` +if test x"$diffout" = x"" && test $? -eq 0; then + compare() { diff -u "$@"; } +else + compare() { cmp "$@"; } +fi + +# Ensure the update-copyright program gets found. +PATH=$abs_aux_dir:$PATH +export PATH + +TMP_BASE=update-copyright.test +trap 'rm -f $TMP_BASE*' 0 1 2 3 15 + +## --------------------------------- ## +## Skip if user does not have perl. ## +## --------------------------------- ## + +TMP=$TMP_BASE +s=$TMP-script +cat <<\EOF > $s +eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"' + & eval 'exec perl -wS -0777 -pi "$0" $argv:q' + if 0; +s/a/b/ +EOF +chmod a+x $s +echo a > $TMP-in +./$s $TMP-in 2>/dev/null && test b = "`cat $TMP-in 2>/dev/null`" || + { + printf '%s\n' "$0: skipping this test;" \ + 'your system has insufficient support for Perl' 1>&2 + exit 77 + } + +# Skip this test if Perl is too old. FIXME: 5.8.0 is just a guess. +# We have a report that 5.6.1 is inadequate and that 5.8.0 works. +perl -e 'require 5.8.0' || { + echo '$0: skipping this test; Perl version is too old' 1>&2 + exit 77 +} + +# Do not let a different envvar setting perturb results. +UPDATE_COPYRIGHT_MAX_LINE_LENGTH=72 +export UPDATE_COPYRIGHT_MAX_LINE_LENGTH + +## ----------------------------- ## +## Examples from documentation. ## +## ----------------------------- ## + +TMP=$TMP_BASE-ex +cat > $TMP.1 <<EOF +Copyright @copyright{} 1990-2005, 2007-2009 Free Software +Foundation, Inc. +EOF +cat > $TMP.2 <<EOF +# Copyright (C) 1990-2005, 2007-2009 Free Software +# Foundation, Inc. +EOF +cat > $TMP.3 <<EOF +/* + * Copyright © 90,2005,2007-2009 + * Free Software Foundation, Inc. + */ +EOF +cat > $TMP.4 <<EOF +## Copyright (C) 1990-2005, 2007-2009 Free Software +# Foundation, Inc. +EOF +cat > $TMP.5 <<EOF +Copyright (C) 1990-2005, 2007-2009 Acme, Inc. +EOF +cat > $TMP.6 <<EOF +## Copyright (C) 1990-2005, 2007-2009 Free Software +# Foundation, Inc. + +Copyright (C) 1990-2005, 2007-2009 Free Software Foundation, +Inc. +EOF +cat > $TMP.7 <<EOF +Copyright (C) 1990-2005, 2007-2009 Acme, Inc. + +# Copyright (C) 1990-2005, 2007-2009 Free Software +# Foundation, Inc. +EOF + +UPDATE_COPYRIGHT_YEAR=2009 \ + update-copyright $TMP.? 1> $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare - $TMP-stderr <<EOF || exit 1 +$TMP.4: warning: copyright statement not found +$TMP.5: warning: copyright statement not found +EOF +compare - $TMP.1 <<EOF || exit 1 +Copyright @copyright{} 1990-2005, 2007-2009 Free Software +Foundation, Inc. +EOF +compare - $TMP.2 <<EOF || exit 1 +# Copyright (C) 1990-2005, 2007-2009 Free Software +# Foundation, Inc. +EOF +compare - $TMP.3 <<EOF || exit 1 +/* + * Copyright © 90,2005,2007-2009 + * Free Software Foundation, Inc. + */ +EOF +compare - $TMP.4 <<EOF || exit 1 +## Copyright (C) 1990-2005, 2007-2009 Free Software +# Foundation, Inc. +EOF +compare - $TMP.5 <<EOF || exit 1 +Copyright (C) 1990-2005, 2007-2009 Acme, Inc. +EOF +compare - $TMP.6 <<EOF || exit 1 +## Copyright (C) 1990-2005, 2007-2009 Free Software +# Foundation, Inc. + +Copyright (C) 1990-2005, 2007-2009 Free Software Foundation, +Inc. +EOF +compare - $TMP.7 <<EOF || exit 1 +Copyright (C) 1990-2005, 2007-2009 Acme, Inc. + +# Copyright (C) 1990-2005, 2007-2009 Free Software +# Foundation, Inc. +EOF + +UPDATE_COPYRIGHT_YEAR=2010 UPDATE_COPYRIGHT_USE_INTERVALS=1 \ + update-copyright $TMP.? 1> $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare - $TMP-stderr <<EOF || exit 1 +$TMP.4: warning: copyright statement not found +$TMP.5: warning: copyright statement not found +EOF +compare - $TMP.1 <<EOF || exit 1 +Copyright @copyright{} 1990-2005, 2007-2010 Free Software Foundation, +Inc. +EOF +compare - $TMP.2 <<EOF || exit 1 +# Copyright (C) 1990-2005, 2007-2010 Free Software Foundation, Inc. +EOF +compare - $TMP.3 <<EOF || exit 1 +/* + * Copyright © 1990, 2005, 2007-2010 Free Software Foundation, Inc. + */ +EOF +compare - $TMP.4 <<EOF || exit 1 +## Copyright (C) 1990-2005, 2007-2009 Free Software +# Foundation, Inc. +EOF +compare - $TMP.5 <<EOF || exit 1 +Copyright (C) 1990-2005, 2007-2009 Acme, Inc. +EOF +compare - $TMP.6 <<EOF || exit 1 +## Copyright (C) 1990-2005, 2007-2009 Free Software +# Foundation, Inc. + +Copyright (C) 1990-2005, 2007-2010 Free Software Foundation, Inc. +EOF +compare - $TMP.7 <<EOF || exit 1 +Copyright (C) 1990-2005, 2007-2009 Acme, Inc. + +# Copyright (C) 1990-2005, 2007-2010 Free Software Foundation, Inc. +EOF + +UPDATE_COPYRIGHT_YEAR=2010 UPDATE_COPYRIGHT_FORCE=1 \ + update-copyright $TMP.? 1> $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare - $TMP-stderr <<EOF || exit 1 +$TMP.4: warning: copyright statement not found +$TMP.5: warning: copyright statement not found +EOF +compare - $TMP.1 <<EOF || exit 1 +Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, +1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 +Free Software Foundation, Inc. +EOF +compare - $TMP.2 <<EOF || exit 1 +# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, +# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free +# Software Foundation, Inc. +EOF +compare - $TMP.3 <<EOF || exit 1 +/* + * Copyright © 1990, 2005, 2007, 2008, 2009, 2010 Free Software + * Foundation, Inc. + */ +EOF +compare - $TMP.4 <<EOF || exit 1 +## Copyright (C) 1990-2005, 2007-2009 Free Software +# Foundation, Inc. +EOF +compare - $TMP.5 <<EOF || exit 1 +Copyright (C) 1990-2005, 2007-2009 Acme, Inc. +EOF +compare - $TMP.6 <<EOF || exit 1 +## Copyright (C) 1990-2005, 2007-2009 Free Software +# Foundation, Inc. + +Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, +1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. +EOF +compare - $TMP.7 <<EOF || exit 1 +Copyright (C) 1990-2005, 2007-2009 Acme, Inc. + +# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, +# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free +# Software Foundation, Inc. +EOF + +rm $TMP* + +## -------------- ## +## Current year. ## +## -------------- ## + +TMP=$TMP_BASE-current-year +YEAR=`date +%Y` +cat > $TMP <<EOF +'\" Copyright (C) 2006 +'\" Free Software Foundation, +'\" Inc. +EOF +update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +compare - $TMP <<EOF || exit 1 +'\" Copyright (C) 2006, $YEAR Free Software Foundation, Inc. +EOF +UPDATE_COPYRIGHT_USE_INTERVALS=1 \ + update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +compare - $TMP <<EOF || exit 1 +'\" Copyright (C) 2006, $YEAR Free Software Foundation, Inc. +EOF +rm $TMP* + +## ------------------ ## +## Surrounding text. ## +## ------------------ ## + +TMP=$TMP_BASE-surrounding-text +cat > $TMP <<EOF + Undisturbed text. +dnl Undisturbed text. +dnl Copyright (C) 89 +dnl Free Software Foundation, Inc. +dnl Undisturbed text. +EOF +UPDATE_COPYRIGHT_YEAR=2010 \ + update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +compare - $TMP <<EOF || exit 1 + Undisturbed text. +dnl Undisturbed text. +dnl Copyright (C) 1989, 2010 Free Software Foundation, Inc. +dnl Undisturbed text. +EOF +rm $TMP* + +## --------------- ## +## Widest prefix. ## +## --------------- ## + +TMP=$TMP_BASE-widest-prefix +cat > $TMP <<EOF +#### Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, +#### 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +#### 2008 Free Software Foundation, Inc. +EOF +UPDATE_COPYRIGHT_YEAR=2010 \ + update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +compare - $TMP <<EOF || exit 1 +#### Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, +#### 1985, 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, +#### 2006, 2007, 2008, 2010 Free Software Foundation, Inc. +EOF +UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=1 \ + update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +compare - $TMP <<EOF || exit 1 +#### Copyright (C) 1976-1988, 1999-2008, 2010-2011 Free Software +#### Foundation, Inc. +EOF +rm $TMP* + +## ------------------- ## +## Prefix too large. ## +## ------------------- ## + +TMP=$TMP_BASE-prefix-too-large +cat > $TMP <<EOF +#### Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, +#### 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +#### 2008 Free Software Foundation, Inc. +EOF +UPDATE_COPYRIGHT_YEAR=2010 \ + update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare - $TMP-stderr <<EOF || exit 1 +$TMP: warning: copyright statement not found +EOF +compare - $TMP <<EOF || exit 1 +#### Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, +#### 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +#### 2008 Free Software Foundation, Inc. +EOF +rm $TMP* + +## ------------- ## +## Blank lines. ## +## ------------- ## + +TMP=$TMP_BASE-blank-lines +cat > $TMP <<EOF +#Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, +# +#1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +#2008 Free Software Foundation, Inc. + +Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, + +1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +2008 Free Software Foundation, Inc. +EOF +UPDATE_COPYRIGHT_YEAR=2010 \ + update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare - $TMP-stderr <<EOF || exit 1 +$TMP: warning: copyright statement not found +EOF +compare - $TMP <<EOF || exit 1 +#Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, +# +#1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +#2008 Free Software Foundation, Inc. + +Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, + +1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +2008 Free Software Foundation, Inc. +EOF +rm $TMP* + +## -------------- ## +## Leading tabs. ## +## -------------- ## + +TMP=$TMP_BASE-leading-tabs +cat > $TMP <<EOF + Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 98, + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free + Software Foundation, Inc. +EOF +UPDATE_COPYRIGHT_YEAR=2010 \ + update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +compare - $TMP <<EOF || exit 1 + Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, + 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +EOF +UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=1 \ + update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +compare - $TMP <<EOF || exit 1 + Copyright (C) 1987-1988, 1991-2011 Free Software Foundation, + Inc. +EOF +rm $TMP* + +## -------------------- ## +## Unusual whitespace. ## +## -------------------- ## + +TMP=$TMP_BASE-unusual-ws +cat > $TMP <<EOF + # Copyright (C) 87-88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, + # 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, + # 2009 Free Software Foundation, Inc. +EOF +UPDATE_COPYRIGHT_YEAR=2010 \ + update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +compare - $TMP <<EOF || exit 1 + # Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, + # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, + # 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software + # Foundation, Inc. +EOF +UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=1 \ + update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +compare - $TMP <<EOF || exit 1 + # Copyright (C) 1987-1988, 1991-2011 Free Software + # Foundation, Inc. +EOF +UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=2 \ + UPDATE_COPYRIGHT_FORCE=1 update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +compare - $TMP <<EOF || exit 1 + # Copyright (C) 1987-2011 Free Software Foundation, Inc. +EOF +rm $TMP* + +## --------- ## +## DOS EOL. ## +## --------- ## + +TMP=$TMP_BASE-dos-eol +tr @ '\015' > $TMP <<\EOF +Rem Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,@ +Rem 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,@ +Rem 2009 Free Software Foundation, Inc.@ +EOF +UPDATE_COPYRIGHT_YEAR=2010 \ + update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +tr @ '\015' > $TMP-exp <<\EOF +Rem Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,@ +Rem 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,@ +Rem 2009, 2010 Free Software Foundation, Inc.@ +EOF +compare $TMP-exp $TMP || exit 1 +rm $TMP* + +## --------------- ## +## Omitted "(C)". ## +## --------------- ## + +TMP=$TMP_BASE-omitted-circle-c +cat > $TMP <<EOF + Copyright 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, + 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, + 2009 Free Software Foundation, Inc. +EOF +UPDATE_COPYRIGHT_YEAR=2010 \ + update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +compare - $TMP <<EOF || exit 1 + Copyright 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. +EOF +rm $TMP* + +## ------------------ ## +## C-style comments. ## +## ------------------ ## + +TMP=$TMP_BASE-c-style-comments +cat > $TMP.star <<EOF +/* Copyright 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, + * 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, + * 2009 Free Software Foundation, Inc. */ +EOF +cat > $TMP.space <<EOF + /*Copyright 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, + 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, + 2009 Free Software Foundation, Inc. */ +EOF +cat > $TMP.single-line <<EOF +/* Copyright 87, 1991, 1992 Free Software Foundation, Inc. */ +EOF +cat > $TMP.single-line-wrapped <<EOF + /* Copyright 1988, 1991, 1992, 1993 Free Software Foundation, Inc. */ +EOF +cat > $TMP.extra-text-star <<EOF + /* Copyright 1987, 1988, 1991, 1992 Free Software Foundation, Inc. End + * More comments. */ +EOF +cat > $TMP.extra-text-space <<EOF + /* Copyright 1987, 1988, 1991, 1992 Free Software Foundation, Inc. *** + * End of comments. */ +EOF +cat > $TMP.two-digit-final-is-substr-of-first <<EOF + /* Copyright 1991, 99 Free Software Foundation, Inc. */ +EOF +UPDATE_COPYRIGHT_YEAR=2010 \ + update-copyright $TMP.* 1> $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +compare - $TMP.star <<EOF || exit 1 +/* Copyright 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, + * 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, + * 2009, 2010 Free Software Foundation, Inc. */ +EOF +compare - $TMP.space <<EOF || exit 1 + /*Copyright 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, + 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, + 2009, 2010 Free Software Foundation, Inc. */ +EOF +compare - $TMP.single-line <<EOF || exit 1 +/* Copyright 1987, 1991, 1992, 2010 Free Software Foundation, Inc. */ +EOF +compare - $TMP.single-line-wrapped <<EOF || exit 1 + /* Copyright 1988, 1991, 1992, 1993, 2010 Free Software Foundation, + * Inc. */ +EOF +compare - $TMP.extra-text-star <<EOF || exit 1 + /* Copyright 1987, 1988, 1991, 1992, 2010 Free Software Foundation, + * Inc. End + * More comments. */ +EOF +compare - $TMP.extra-text-space <<EOF || exit 1 + /* Copyright 1987, 1988, 1991, 1992, 2010 Free Software Foundation, + Inc. *** + * End of comments. */ +EOF +compare - $TMP.two-digit-final-is-substr-of-first <<EOF || exit 1 + /* Copyright 1991, 1999, 2010 Free Software Foundation, Inc. */ +EOF +rm $TMP* + +exit 0 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-vasnprintf.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-vasnprintf.c new file mode 100644 index 0000000000..2dd869f9e5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-vasnprintf.c @@ -0,0 +1,94 @@ +/* Test of vasnprintf() and asnprintf() functions. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include "vasnprintf.h" + +#include <stdarg.h> +#include <stdlib.h> +#include <string.h> + +#include "macros.h" + +static void +test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) +{ + char buf[8]; + int size; + + for (size = 0; size <= 8; size++) + { + size_t length = size; + char *result = my_asnprintf (NULL, &length, "%d", 12345); + ASSERT (result != NULL); + ASSERT (strcmp (result, "12345") == 0); + ASSERT (length == 5); + free (result); + } + + for (size = 0; size <= 8; size++) + { + size_t length; + char *result; + + memcpy (buf, "DEADBEEF", 8); + length = size; + result = my_asnprintf (buf, &length, "%d", 12345); + ASSERT (result != NULL); + ASSERT (strcmp (result, "12345") == 0); + ASSERT (length == 5); + if (size < 6) + ASSERT (result != buf); + ASSERT (memcmp (buf + size, &"DEADBEEF"[size], 8 - size) == 0); + if (result != buf) + free (result); + } +} + +static char * +my_asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) +{ + va_list args; + char *ret; + + va_start (args, format); + ret = vasnprintf (resultbuf, lengthp, format, args); + va_end (args); + return ret; +} + +static void +test_vasnprintf () +{ + test_function (my_asnprintf); +} + +static void +test_asnprintf () +{ + test_function (asnprintf); +} + +int +main (int argc, char *argv[]) +{ + test_vasnprintf (); + test_asnprintf (); + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-vasprintf.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-vasprintf.c new file mode 100644 index 0000000000..2cab30743a --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-vasprintf.c @@ -0,0 +1,103 @@ +/* Test of vasprintf() and asprintf() functions. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <stdio.h> + +#include "signature.h" +SIGNATURE_CHECK (asprintf, int, (char **, char const *, ...)); +SIGNATURE_CHECK (vasprintf, int, (char **, char const *, va_list)); + +#include <stdarg.h> +#include <stdlib.h> +#include <string.h> + +#include "macros.h" + +static int +my_asprintf (char **result, const char *format, ...) +{ + va_list args; + int ret; + + va_start (args, format); + ret = vasprintf (result, format, args); + va_end (args); + return ret; +} + +static void +test_vasprintf () +{ + int repeat; + + for (repeat = 0; repeat <= 8; repeat++) + { + char *result; + int retval = my_asprintf (&result, "%d", 12345); + ASSERT (retval == 5); + ASSERT (result != NULL); + ASSERT (strcmp (result, "12345") == 0); + free (result); + } + + for (repeat = 0; repeat <= 8; repeat++) + { + char *result; + int retval = my_asprintf (&result, "%08lx", 12345UL); + ASSERT (retval == 8); + ASSERT (result != NULL); + ASSERT (strcmp (result, "00003039") == 0); + free (result); + } +} + +static void +test_asprintf () +{ + int repeat; + + for (repeat = 0; repeat <= 8; repeat++) + { + char *result; + int retval = asprintf (&result, "%d", 12345); + ASSERT (retval == 5); + ASSERT (result != NULL); + ASSERT (strcmp (result, "12345") == 0); + free (result); + } + + for (repeat = 0; repeat <= 8; repeat++) + { + char *result; + int retval = asprintf (&result, "%08lx", 12345UL); + ASSERT (retval == 8); + ASSERT (result != NULL); + ASSERT (strcmp (result, "00003039") == 0); + free (result); + } +} + +int +main (int argc, char *argv[]) +{ + test_vasprintf (); + test_asprintf (); + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-vc-list-files-cvs.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-vc-list-files-cvs.sh new file mode 100755 index 0000000000..f04fe9c3a9 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-vc-list-files-cvs.sh @@ -0,0 +1,53 @@ +#!/bin/sh +# Unit tests for vc-list-files +# Copyright (C) 2008-2017 Free Software Foundation, Inc. +# This file is part of the GNUlib Library. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +: ${srcdir=.} +. "$srcdir/init.sh"; path_prepend_ "$abs_aux_dir" . + +tmpdir=vc-cvs +repo=`pwd`/$tmpdir/repo + +fail=0 +for i in with-cvsu without; do + # On the first iteration, test using cvsu, if it's in your path. + # On the second iteration, ensure that cvsu fails, so we'll + # exercise the awk-using code. + if test $i = without; then + printf '%s\n' '#!/bin/sh' 'exit 1' > cvsu + chmod a+x cvsu + PATH=`pwd`:$PATH + export PATH + fi + ok=0 + mkdir $tmpdir && cd $tmpdir && + # without cvs, skip the test + { ( cvs -Q -d "$repo" init ) > /dev/null 2>&1 \ + || skip_ "cvs not found in PATH"; } && + mkdir w && cd w && + mkdir d && + touch d/a b c && + cvs -Q -d "$repo" import -m imp m M M0 && + cvs -Q -d "$repo" co m && cd m && + printf '%s\n' b c d/a > expected && + vc-list-files | sort > actual && + compare expected actual && + ok=1 + test $ok = 0 && fail=1 +done + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-vc-list-files-git.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-vc-list-files-git.sh new file mode 100755 index 0000000000..8249017ed0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-vc-list-files-git.sh @@ -0,0 +1,42 @@ +#!/bin/sh +# Unit tests for vc-list-files +# Copyright (C) 2008-2017 Free Software Foundation, Inc. +# This file is part of the GNUlib Library. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +: ${srcdir=.} +. "$srcdir/init.sh"; path_prepend_ "$abs_aux_dir" . + +tmpdir=vc-git-$$ +GIT_DIR= GIT_WORK_TREE=; unset GIT_DIR GIT_WORK_TREE + +fail=1 +mkdir $tmpdir && cd $tmpdir && + # without git, skip the test + # The double use of 'exit' is needed for the reference to $? inside the trap. + { ( git init -q ) > /dev/null 2>&1 \ + || skip_ "git not found in PATH"; } && + mkdir d && + touch d/a b c && + git config user.email "you@example.com" && + git config user.name "Your Name" && + git add . > /dev/null && + git commit -q -a -m log && + printf '%s\n' b c d/a > expected && + vc-list-files > actual && + compare expected actual && + fail=0 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-verify-try.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-verify-try.c new file mode 100644 index 0000000000..362fb0107f --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-verify-try.c @@ -0,0 +1,21 @@ +/* Test the "verify" module. + + Copyright (C) 2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* This is a separate source file, so that the execution of test-verify.sh + does not interfere with the building of the 'test-verify' program. */ + +#include "test-verify.c" diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-verify.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-verify.c new file mode 100644 index 0000000000..92b750100c --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-verify.c @@ -0,0 +1,69 @@ +/* Test the "verify" module. + + Copyright (C) 2005, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible. */ + +#include <config.h> + +#include "verify.h" + +#ifndef EXP_FAIL +# define EXP_FAIL 0 +#endif + +int x; +enum { a, b, c }; + +#if EXP_FAIL == 1 +verify (x >= 0); /* should give ERROR: non-constant expression */ +#endif +verify (c == 2); /* should be ok */ +#if EXP_FAIL == 2 +verify (1 + 1 == 3); /* should give ERROR */ +#endif +verify (1 == 1); verify (1 == 1); /* should be ok */ + +enum +{ + item = verify_true (1 == 1) * 0 + 17 /* should be ok */ +}; + +static int +function (int n) +{ +#if EXP_FAIL == 3 + verify (n >= 0); /* should give ERROR: non-constant expression */ +#endif + verify (c == 2); /* should be ok */ +#if EXP_FAIL == 4 + verify (1 + 1 == 3); /* should give ERROR */ +#endif + verify (1 == 1); verify (1 == 1); /* should be ok */ + + if (n) + return ((void) verify_expr (1 == 1, 1), verify_expr (1 == 1, 8)); /* should be ok */ +#if EXP_FAIL == 5 + return verify_expr (1 == 2, 5); /* should give ERROR */ +#endif + return 0; +} + +int +main (void) +{ + return !(function (0) == 0 && function (1) == 8); +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-verify.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-verify.sh new file mode 100755 index 0000000000..1e75d55a26 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-verify.sh @@ -0,0 +1,25 @@ +#!/bin/sh +. "${srcdir=.}/init.sh" + +# We are not interested in triggering bugs in the compilers and tools +# (such as gcc 4.3.1 on openSUSE 11.0). +unset MALLOC_PERTURB_ + +# Rather than figure out how to invoke the compiler with the right +# include path ourselves, we let make do it: +(cd "$initial_cwd_" \ + && rm -f test-verify-try.o \ + && $MAKE test-verify-try.o >/dev/null 2>&1) \ + || skip_ "cannot compile error-free" + +# Now, prove that we encounter all expected compilation failures: +: >out +: >err +for i in 1 2 3 4 5; do + (cd "$initial_cwd_" + rm -f test-verify-try.o + $MAKE CFLAGS=-DEXP_FAIL=$i test-verify-try.o) >>out 2>>err \ + && { warn_ "compiler didn't detect verification failure $i"; fail=1; } +done + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-version-etc.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-version-etc.c new file mode 100644 index 0000000000..ad8221ab21 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-version-etc.c @@ -0,0 +1,31 @@ +/* Test suite for version-etc. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + This file is part of the GNUlib Library. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "version-etc.h" + + +#define AUTHORS "Sergey Poznyakoff", "Eric Blake" + +int +main (int argc _GL_UNUSED, char **argv) +{ + version_etc (stdout, "test-version-etc", "dummy", "0", AUTHORS, + (const char *) NULL); + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-version-etc.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-version-etc.sh new file mode 100755 index 0000000000..e7de3b7c82 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-version-etc.sh @@ -0,0 +1,43 @@ +#! /bin/sh +# Test suite for version-etc. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# This file is part of the GNUlib Library. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +TMP=ve-expected.tmp +LC_ALL=C +export LC_ALL +ERR=0 + +cat > $TMP <<EOT +test-version-etc (PROJECT) VERSION +COPYRIGHT Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. + +Written by Sergey Poznyakoff and Eric Blake. +EOT + +./test-version-etc${EXEEXT} --version | + sed '1s/test-version-etc (.*) .*/test-version-etc (PROJECT) VERSION/ + /^Packaged by/d + 2,3 s/Copyright (C) [0-9]\{4,4\}/COPYRIGHT/' | + tr -d '\015' | + diff -c $TMP - || ERR=1 + +rm $TMP + +exit $ERR diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-wchar.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-wchar.c new file mode 100644 index 0000000000..2463aebacc --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-wchar.c @@ -0,0 +1,37 @@ +/* Test of <wchar.h> substitute. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <wchar.h> + +#include "verify.h" + +/* Check that the types wchar_t and wint_t are defined. */ +wchar_t a = 'c'; +wint_t b = 'x'; + +/* Check that NULL can be passed through varargs as a pointer type, + per POSIX 2008. */ +verify (sizeof NULL == sizeof (void *)); + +int +main (void) +{ + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb-w32-1.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb-w32-1.sh new file mode 100755 index 0000000000..50c82f59fa --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb-w32-1.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Test a CP1252 locale. +./test-wcrtomb-w32${EXEEXT} French_France 1252 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb-w32-2.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb-w32-2.sh new file mode 100755 index 0000000000..783c70cb97 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb-w32-2.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Test a CP1256 locale. +./test-wcrtomb-w32${EXEEXT} "Arabic_Saudi Arabia" 1256 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb-w32-3.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb-w32-3.sh new file mode 100755 index 0000000000..619ea644a2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb-w32-3.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Test a CP932 locale. +./test-wcrtomb-w32${EXEEXT} Japanese_Japan 932 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb-w32-4.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb-w32-4.sh new file mode 100755 index 0000000000..67b6803016 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb-w32-4.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Test a CP950 locale. +./test-wcrtomb-w32${EXEEXT} Chinese_Taiwan 950 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb-w32-5.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb-w32-5.sh new file mode 100755 index 0000000000..9841fa9417 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb-w32-5.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Test a CP936 locale. +./test-wcrtomb-w32${EXEEXT} Chinese_China 936 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb-w32.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb-w32.c new file mode 100644 index 0000000000..e7d0803fad --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb-w32.c @@ -0,0 +1,332 @@ +/* Test of conversion of wide character to multibyte character. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <wchar.h> + +#include <locale.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "macros.h" + +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + +static int +test_one_locale (const char *name, int codepage) +{ + char buf[64]; + size_t ret; + +# if 1 + /* Portable code to set the locale. */ + { + char name_with_codepage[1024]; + + sprintf (name_with_codepage, "%s.%d", name, codepage); + + /* Set the locale. */ + if (setlocale (LC_ALL, name_with_codepage) == NULL) + return 77; + } +# else + /* Hacky way to set a locale.codepage combination that setlocale() refuses + to set. */ + { + /* Codepage of the current locale, set with setlocale(). + Not necessarily the same as GetACP(). */ + extern __declspec(dllimport) unsigned int __lc_codepage; + + /* Set the locale. */ + if (setlocale (LC_ALL, name) == NULL) + return 77; + + /* Clobber the codepage and MB_CUR_MAX, both set by setlocale(). */ + __lc_codepage = codepage; + switch (codepage) + { + case 1252: + case 1256: + MB_CUR_MAX = 1; + break; + case 932: + case 950: + case 936: + MB_CUR_MAX = 2; + break; + case 54936: + case 65001: + MB_CUR_MAX = 4; + break; + } + + /* Test whether the codepage is really available. */ + { + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, " ", 1, &state) == (size_t)(-1)) + return 77; + } + } +# endif + + /* Test NUL character. */ + { + buf[0] = 'x'; + ret = wcrtomb (buf, 0, NULL); + ASSERT (ret == 1); + ASSERT (buf[0] == '\0'); + } + + /* Test single bytes. */ + { + int c; + + for (c = 0; c < 0x100; c++) + switch (c) + { + case '\t': case '\v': case '\f': + case ' ': case '!': case '"': case '#': case '%': + case '&': case '\'': case '(': case ')': case '*': + case '+': case ',': case '-': case '.': case '/': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + case ':': case ';': case '<': case '=': case '>': + case '?': + case 'A': case 'B': case 'C': case 'D': case 'E': + case 'F': case 'G': case 'H': case 'I': case 'J': + case 'K': case 'L': case 'M': case 'N': case 'O': + case 'P': case 'Q': case 'R': case 'S': case 'T': + case 'U': case 'V': case 'W': case 'X': case 'Y': + case 'Z': + case '[': case '\\': case ']': case '^': case '_': + case 'a': case 'b': case 'c': case 'd': case 'e': + case 'f': case 'g': case 'h': case 'i': case 'j': + case 'k': case 'l': case 'm': case 'n': case 'o': + case 'p': case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'y': + case 'z': case '{': case '|': case '}': case '~': + /* c is in the ISO C "basic character set". */ + ret = wcrtomb (buf, btowc (c), NULL); + ASSERT (ret == 1); + ASSERT (buf[0] == (char) c); + break; + } + } + + /* Test special calling convention, passing a NULL pointer. */ + { + ret = wcrtomb (NULL, '\0', NULL); + ASSERT (ret == 1); + ret = wcrtomb (NULL, btowc ('x'), NULL); + ASSERT (ret == 1); + } + + switch (codepage) + { + case 1252: + /* Locale encoding is CP1252, an extension of ISO-8859-1. */ + { + /* Convert "B\374\337er": "Büßer" */ + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x00FC, NULL); + ASSERT (ret == 1); + ASSERT (memcmp (buf, "\374", 1) == 0); + ASSERT (buf[1] == 'x'); + + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x00DF, NULL); + ASSERT (ret == 1); + ASSERT (memcmp (buf, "\337", 1) == 0); + ASSERT (buf[1] == 'x'); + } + return 0; + + case 1256: + /* Locale encoding is CP1256, not the same as ISO-8859-6. */ + { + /* Convert "x\302\341\346y": "xآلوy" */ + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x0622, NULL); + ASSERT (ret == 1); + ASSERT (memcmp (buf, "\302", 1) == 0); + ASSERT (buf[1] == 'x'); + + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x0644, NULL); + ASSERT (ret == 1); + ASSERT (memcmp (buf, "\341", 1) == 0); + ASSERT (buf[1] == 'x'); + + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x0648, NULL); + ASSERT (ret == 1); + ASSERT (memcmp (buf, "\346", 1) == 0); + ASSERT (buf[1] == 'x'); + } + return 0; + + case 932: + /* Locale encoding is CP932, similar to Shift_JIS. */ + { + /* Convert "<\223\372\226\173\214\352>": "<日本語>" */ + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x65E5, NULL); + ASSERT (ret == 2); + ASSERT (memcmp (buf, "\223\372", 2) == 0); + ASSERT (buf[2] == 'x'); + + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x672C, NULL); + ASSERT (ret == 2); + ASSERT (memcmp (buf, "\226\173", 2) == 0); + ASSERT (buf[2] == 'x'); + + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x8A9E, NULL); + ASSERT (ret == 2); + ASSERT (memcmp (buf, "\214\352", 2) == 0); + ASSERT (buf[2] == 'x'); + } + return 0; + + case 950: + /* Locale encoding is CP950, similar to Big5. */ + { + /* Convert "<\244\351\245\273\273\171>": "<日本語>" */ + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x65E5, NULL); + ASSERT (ret == 2); + ASSERT (memcmp (buf, "\244\351", 2) == 0); + ASSERT (buf[2] == 'x'); + + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x672C, NULL); + ASSERT (ret == 2); + ASSERT (memcmp (buf, "\245\273", 2) == 0); + ASSERT (buf[2] == 'x'); + + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x8A9E, NULL); + ASSERT (ret == 2); + ASSERT (memcmp (buf, "\273\171", 2) == 0); + ASSERT (buf[2] == 'x'); + } + return 0; + + case 936: + /* Locale encoding is CP936 = GBK, an extension of GB2312. */ + { + /* Convert "<\310\325\261\276\325\132>": "<日本語>" */ + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x65E5, NULL); + ASSERT (ret == 2); + ASSERT (memcmp (buf, "\310\325", 2) == 0); + ASSERT (buf[2] == 'x'); + + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x672C, NULL); + ASSERT (ret == 2); + ASSERT (memcmp (buf, "\261\276", 2) == 0); + ASSERT (buf[2] == 'x'); + + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x8A9E, NULL); + ASSERT (ret == 2); + ASSERT (memcmp (buf, "\325\132", 2) == 0); + ASSERT (buf[2] == 'x'); + } + return 0; + + case 54936: + /* Locale encoding is CP54936 = GB18030. */ + { + /* Convert "B\250\271\201\060\211\070er": "Büßer" */ + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x00FC, NULL); + ASSERT (ret == 2); + ASSERT (memcmp (buf, "\250\271", 2) == 0); + ASSERT (buf[2] == 'x'); + + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x00DF, NULL); + ASSERT (ret == 4); + ASSERT (memcmp (buf, "\201\060\211\070", 4) == 0); + ASSERT (buf[4] == 'x'); + } + return 0; + + case 65001: + /* Locale encoding is CP65001 = UTF-8. */ + { + /* Convert "B\303\274\303\237er": "Büßer" */ + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x00FC, NULL); + ASSERT (ret == 2); + ASSERT (memcmp (buf, "\303\274", 2) == 0); + ASSERT (buf[2] == 'x'); + + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x00DF, NULL); + ASSERT (ret == 2); + ASSERT (memcmp (buf, "\303\237", 2) == 0); + ASSERT (buf[2] == 'x'); + } + return 0; + + default: + return 1; + } +} + +int +main (int argc, char *argv[]) +{ + int codepage = atoi (argv[argc - 1]); + int result; + int i; + + result = 77; + for (i = 1; i < argc - 1; i++) + { + int ret = test_one_locale (argv[i], codepage); + + if (ret != 77) + result = ret; + } + + if (result == 77) + { + fprintf (stderr, "Skipping test: found no locale with codepage %d\n", + codepage); + } + return result; +} + +#else + +int +main (int argc, char *argv[]) +{ + fputs ("Skipping test: not a native Windows system\n", stderr); + return 77; +} + +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb.c new file mode 100644 index 0000000000..1458c76b73 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb.c @@ -0,0 +1,162 @@ +/* Test of conversion of wide character to multibyte character. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <wchar.h> + +#include "signature.h" +SIGNATURE_CHECK (wcrtomb, size_t, (char *, wchar_t, mbstate_t *)); + +#include <locale.h> +#include <stdlib.h> +#include <string.h> + +#include "macros.h" + +/* Check the multibyte character s[0..n-1]. */ +static void +check_character (const char *s, size_t n) +{ + wchar_t wc; + char buf[64]; + int iret; + size_t ret; + + wc = (wchar_t) 0xBADFACE; + iret = mbtowc (&wc, s, n); + ASSERT (iret == n); + + ret = wcrtomb (buf, wc, NULL); + ASSERT (ret == n); + ASSERT (memcmp (buf, s, n) == 0); + + /* Test special calling convention, passing a NULL pointer. */ + ret = wcrtomb (NULL, wc, NULL); + ASSERT (ret == 1); +} + +int +main (int argc, char *argv[]) +{ + char buf[64]; + size_t ret; + + /* configure should already have checked that the locale is supported. */ + if (setlocale (LC_ALL, "") == NULL) + return 1; + + /* Test NUL character. */ + { + buf[0] = 'x'; + ret = wcrtomb (buf, 0, NULL); + ASSERT (ret == 1); + ASSERT (buf[0] == '\0'); + } + + /* Test single bytes. */ + { + int c; + + for (c = 0; c < 0x100; c++) + switch (c) + { + case '\t': case '\v': case '\f': + case ' ': case '!': case '"': case '#': case '%': + case '&': case '\'': case '(': case ')': case '*': + case '+': case ',': case '-': case '.': case '/': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + case ':': case ';': case '<': case '=': case '>': + case '?': + case 'A': case 'B': case 'C': case 'D': case 'E': + case 'F': case 'G': case 'H': case 'I': case 'J': + case 'K': case 'L': case 'M': case 'N': case 'O': + case 'P': case 'Q': case 'R': case 'S': case 'T': + case 'U': case 'V': case 'W': case 'X': case 'Y': + case 'Z': + case '[': case '\\': case ']': case '^': case '_': + case 'a': case 'b': case 'c': case 'd': case 'e': + case 'f': case 'g': case 'h': case 'i': case 'j': + case 'k': case 'l': case 'm': case 'n': case 'o': + case 'p': case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'y': + case 'z': case '{': case '|': case '}': case '~': + /* c is in the ISO C "basic character set". */ + ret = wcrtomb (buf, btowc (c), NULL); + ASSERT (ret == 1); + ASSERT (buf[0] == (char) c); + break; + } + } + + /* Test special calling convention, passing a NULL pointer. */ + { + ret = wcrtomb (NULL, '\0', NULL); + ASSERT (ret == 1); + ret = wcrtomb (NULL, btowc ('x'), NULL); + ASSERT (ret == 1); + } + + if (argc > 1) + switch (argv[1][0]) + { + case '1': + /* Locale encoding is ISO-8859-1 or ISO-8859-15. */ + { + const char input[] = "B\374\337er"; /* "Büßer" */ + + check_character (input + 1, 1); + check_character (input + 2, 1); + } + return 0; + + case '2': + /* Locale encoding is UTF-8. */ + { + const char input[] = "B\303\274\303\237er"; /* "Büßer" */ + + check_character (input + 1, 2); + check_character (input + 3, 2); + } + return 0; + + case '3': + /* Locale encoding is EUC-JP. */ + { + const char input[] = "<\306\374\313\334\270\354>"; /* "<日本語>" */ + + check_character (input + 1, 2); + check_character (input + 3, 2); + check_character (input + 5, 2); + } + return 0; + + case '4': + /* Locale encoding is GB18030. */ + { + const char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + + check_character (input + 1, 2); + check_character (input + 3, 4); + } + return 0; + } + + return 1; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb.sh new file mode 100755 index 0000000000..3eda8f338c --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-wcrtomb.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +# Test in an ISO-8859-1 or ISO-8859-15 locale. +: ${LOCALE_FR=fr_FR} +if test $LOCALE_FR != none; then + LC_ALL=$LOCALE_FR \ + ./test-wcrtomb${EXEEXT} 1 \ + || exit 1 +fi + +# Test whether a specific UTF-8 locale is installed. +: ${LOCALE_FR_UTF8=fr_FR.UTF-8} +if test $LOCALE_FR_UTF8 != none; then + LC_ALL=$LOCALE_FR_UTF8 \ + ./test-wcrtomb${EXEEXT} 2 \ + || exit 1 +fi + +# Test whether a specific EUC-JP locale is installed. +: ${LOCALE_JA=ja_JP} +if test $LOCALE_JA != none; then + LC_ALL=$LOCALE_JA \ + ./test-wcrtomb${EXEEXT} 3 \ + || exit 1 +fi + +# Test whether a specific GB18030 locale is installed. +: ${LOCALE_ZH_CN=zh_CN.GB18030} +if test $LOCALE_ZH_CN != none; then + LC_ALL=$LOCALE_ZH_CN \ + ./test-wcrtomb${EXEEXT} 4 \ + || exit 1 +fi + +exit 0 diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-wctype-h.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-wctype-h.c new file mode 100644 index 0000000000..6d1b2b6ece --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-wctype-h.c @@ -0,0 +1,74 @@ +/* Test of <wctype.h> substitute. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <wctype.h> + +#include "macros.h" + +/* Check that the type wint_t is defined. */ +wint_t a = 'x'; +/* Check that WEOF is defined. */ +wint_t e = WEOF; + +/* Check that the type wctype_t is defined. */ +wctype_t p; + +/* Check that the type wctrans_t is defined. */ +wctrans_t q; + +int +main (void) +{ + /* Check that the isw* functions exist as functions or as macros. */ + (void) iswalnum (0); + (void) iswalpha (0); + (void) iswcntrl (0); + (void) iswdigit (0); + (void) iswgraph (0); + (void) iswlower (0); + (void) iswprint (0); + (void) iswpunct (0); + (void) iswspace (0); + (void) iswupper (0); + (void) iswxdigit (0); + + /* Check that the isw* functions map WEOF to 0. */ + ASSERT (!iswalnum (e)); + ASSERT (!iswalpha (e)); + ASSERT (!iswcntrl (e)); + ASSERT (!iswdigit (e)); + ASSERT (!iswgraph (e)); + ASSERT (!iswlower (e)); + ASSERT (!iswprint (e)); + ASSERT (!iswpunct (e)); + ASSERT (!iswspace (e)); + ASSERT (!iswupper (e)); + ASSERT (!iswxdigit (e)); + + /* Check that the tow* functions exist as functions or as macros. */ + (void) towlower (0); + (void) towupper (0); + + /* Check that the tow* functions map WEOF to WEOF. */ + ASSERT (towlower (e) == e); + ASSERT (towupper (e) == e); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-wcwidth.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-wcwidth.c new file mode 100644 index 0000000000..5290cf74d4 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-wcwidth.c @@ -0,0 +1,84 @@ +/* Test of wcwidth() function. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include <wchar.h> + +#include "signature.h" +SIGNATURE_CHECK (wcwidth, int, (wchar_t)); + +#include <locale.h> +#include <string.h> + +#include "c-ctype.h" +#include "localcharset.h" +#include "macros.h" + +int +main () +{ + wchar_t wc; + +#ifdef C_CTYPE_ASCII + /* Test width of ASCII characters. */ + for (wc = 0x20; wc < 0x7F; wc++) + ASSERT (wcwidth (wc) == 1); +#endif + + /* Switch to an UTF-8 locale. */ + if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL + /* Check whether it's really an UTF-8 locale. + On OpenBSD 4.0, the setlocale call succeeds only for the LC_CTYPE + category and therefore returns "C/fr_FR.UTF-8/C/C/C/C", but the + LC_CTYPE category is effectively set to an ASCII LC_CTYPE category; + in particular, locale_charset() returns "ASCII". */ + && strcmp (locale_charset (), "UTF-8") == 0) + { + /* Test width of ASCII characters. */ + for (wc = 0x20; wc < 0x7F; wc++) + ASSERT (wcwidth (wc) == 1); + + /* Test width of some non-spacing characters. */ + ASSERT (wcwidth (0x0301) == 0); + ASSERT (wcwidth (0x05B0) == 0); + + /* Test width of some format control characters. */ + ASSERT (wcwidth (0x200E) <= 0); + ASSERT (wcwidth (0x2060) <= 0); +#if 0 /* wchar_t may be only 16 bits. */ + ASSERT (wcwidth (0xE0001) <= 0); + ASSERT (wcwidth (0xE0044) <= 0); +#endif + + /* Test width of some zero width characters. */ + ASSERT (wcwidth (0x200B) == 0); + ASSERT (wcwidth (0xFEFF) <= 0); + + /* Test width of some CJK characters. */ + ASSERT (wcwidth (0x3000) == 2); + ASSERT (wcwidth (0xB250) == 2); + ASSERT (wcwidth (0xFF1A) == 2); +#if 0 /* wchar_t may be only 16 bits. */ + ASSERT (wcwidth (0x20369) == 2); + ASSERT (wcwidth (0x2F876) == 2); +#endif + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-xalloc-die.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-xalloc-die.c new file mode 100644 index 0000000000..66eb9a9591 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-xalloc-die.c @@ -0,0 +1,28 @@ +/* Test of xalloc_die() function. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Simon Josefsson <simon@josefsson.org>, 2009. */ + +#include <config.h> + +#include "xalloc.h" + +int +main (int argc _GL_UNUSED, char **argv) +{ + xalloc_die (); + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-xalloc-die.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-xalloc-die.sh new file mode 100755 index 0000000000..0538d9f8d4 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-xalloc-die.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# Test suite for xalloc_die. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# This file is part of the GNUlib Library. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. "${srcdir=.}/init.sh"; path_prepend_ . + +test-xalloc-die${EXEEXT} > out 2> err +case $? in + 1) ;; + *) Exit 1;; +esac + +tr -d '\015' < err \ + | sed 's,.*test-xalloc-die[.ex]*:,test-xalloc-die:,' > err2 || Exit 1 + +compare - err2 <<\EOF || Exit 1 +test-xalloc-die: memory exhausted +EOF + +test -s out && Exit 1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-xstrtol.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-xstrtol.c new file mode 100644 index 0000000000..6d7b4a0a35 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-xstrtol.c @@ -0,0 +1,62 @@ +/* Test of xstrtol module. + Copyright (C) 1995-1996, 1998-2001, 2003-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <inttypes.h> +#include <stdlib.h> +#include <stdio.h> + +#include "xstrtol.h" +#include "error.h" + +#ifndef __xstrtol +# define __xstrtol xstrtol +# define __strtol_t long int +# define __spec "ld" +#endif + +/* Don't show the program name in error messages. */ +static void +print_no_progname (void) +{ +} + +int +main (int argc, char **argv) +{ + strtol_error s_err; + int i; + + error_print_progname = print_no_progname; + + for (i = 1; i < argc; i++) + { + char *p; + __strtol_t val; + + s_err = __xstrtol (argv[i], &p, 0, &val, "bckMw0"); + if (s_err == LONGINT_OK) + { + printf ("%s->%" __spec " (%s)\n", argv[i], val, p); + } + else + { + xstrtol_fatal (s_err, -2, 'X', NULL, argv[i]); + } + } + exit (0); +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-xstrtol.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-xstrtol.sh new file mode 100755 index 0000000000..5425bc79dc --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-xstrtol.sh @@ -0,0 +1,71 @@ +#!/bin/sh +: ${srcdir=.} +. "$srcdir/init.sh"; path_prepend_ . + +too_big=99999999999999999999999999999999999999999999999999999999999999999999 +result=0 + +# test xstrtol +test-xstrtol 1 >> out 2>&1 || result=1 +test-xstrtol -1 >> out 2>&1 || result=1 +test-xstrtol 1k >> out 2>&1 || result=1 +test-xstrtol ${too_big}h >> out 2>&1 && result=1 +test-xstrtol $too_big >> out 2>&1 && result=1 +test-xstrtol x >> out 2>&1 && result=1 +test-xstrtol 9x >> out 2>&1 && result=1 +test-xstrtol 010 >> out 2>&1 || result=1 +# suffix without integer is valid +test-xstrtol MiB >> out 2>&1 || result=1 +test-xstrtol 1bB >> out 2>&1 && result=1 + +# test xstrtoul +test-xstrtoul 1 >> out 2>&1 || result=1 +test-xstrtoul -1 >> out 2>&1 && result=1 +test-xstrtoul 1k >> out 2>&1 || result=1 +test-xstrtoul ${too_big}h >> out 2>&1 && result=1 +test-xstrtoul $too_big >> out 2>&1 && result=1 +test-xstrtoul x >> out 2>&1 && result=1 +test-xstrtoul 9x >> out 2>&1 && result=1 +test-xstrtoul 010 >> out 2>&1 || result=1 +test-xstrtoul MiB >> out 2>&1 || result=1 +test-xstrtoul 1bB >> out 2>&1 && result=1 + +# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr +# does not understand '\r'. +if echo solaris | tr -d '\r' | grep solais > /dev/null; then + cr='\015' +else + cr='\r' +fi + +# normalize output +LC_ALL=C tr -d "$cr" < out > k +mv k out + +# compare expected output +cat > expected <<EOF +1->1 () +-1->-1 () +1k->1024 () +invalid suffix in X argument '${too_big}h' +X argument '$too_big' too large +invalid X argument 'x' +invalid suffix in X argument '9x' +010->8 () +MiB->1048576 () +invalid suffix in X argument '1bB' +1->1 () +invalid X argument '-1' +1k->1024 () +invalid suffix in X argument '${too_big}h' +X argument '$too_big' too large +invalid X argument 'x' +invalid suffix in X argument '9x' +010->8 () +MiB->1048576 () +invalid suffix in X argument '1bB' +EOF + +compare expected out || result=1 + +Exit $result diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-xstrtoul.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-xstrtoul.c new file mode 100644 index 0000000000..9dda9ee67e --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-xstrtoul.c @@ -0,0 +1,4 @@ +#define __xstrtol xstrtoul +#define __strtol_t unsigned long int +#define __spec "lu" +#include "test-xstrtol.c" diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-xstrtoumax.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-xstrtoumax.c new file mode 100644 index 0000000000..2e68c2e5d8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-xstrtoumax.c @@ -0,0 +1,4 @@ +#define __xstrtol xstrtoumax +#define __strtol_t uintmax_t +#define __spec PRIuMAX +#include "test-xstrtol.c" diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-xstrtoumax.sh b/local/recipes/tools/diffutils/source/gnulib-tests/test-xstrtoumax.sh new file mode 100755 index 0000000000..bdbdbf5538 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-xstrtoumax.sh @@ -0,0 +1,46 @@ +#!/bin/sh +: ${srcdir=.} +. "$srcdir/init.sh"; path_prepend_ . + +too_big=99999999999999999999999999999999999999999999999999999999999999999999 +result=0 + +# test xstrtoumax +test-xstrtoumax 1 >> out 2>&1 || result=1 +test-xstrtoumax -1 >> out 2>&1 && result=1 +test-xstrtoumax 1k >> out 2>&1 || result=1 +test-xstrtoumax ${too_big}h >> out 2>&1 && result=1 +test-xstrtoumax $too_big >> out 2>&1 && result=1 +test-xstrtoumax x >> out 2>&1 && result=1 +test-xstrtoumax 9x >> out 2>&1 && result=1 +test-xstrtoumax 010 >> out 2>&1 || result=1 +test-xstrtoumax MiB >> out 2>&1 || result=1 + +# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr +# does not understand '\r'. +if echo solaris | tr -d '\r' | grep solais > /dev/null; then + cr='\015' +else + cr='\r' +fi + +# normalize output +LC_ALL=C tr -d "$cr" < out > k +mv k out + +# compare expected output +cat > exp <<EOF +1->1 () +invalid X argument '-1' +1k->1024 () +invalid suffix in X argument '${too_big}h' +X argument '$too_big' too large +invalid X argument 'x' +invalid suffix in X argument '9x' +010->8 () +MiB->1048576 () +EOF + +compare exp out || result=1 + +Exit $result diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/test-xvasprintf.c b/local/recipes/tools/diffutils/source/gnulib-tests/test-xvasprintf.c new file mode 100644 index 0000000000..922f4cead5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/test-xvasprintf.c @@ -0,0 +1,135 @@ +/* Test of xvasprintf() and xasprintf() functions. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +/* Tell GCC not to warn about the specific edge cases tested here. */ +#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__ +# pragma GCC diagnostic ignored "-Wformat-zero-length" +# pragma GCC diagnostic ignored "-Wformat-nonliteral" +# pragma GCC diagnostic ignored "-Wformat-security" +#endif + +#include <config.h> + +#include "xvasprintf.h" + +#include <stdarg.h> +#include <stdlib.h> +#include <string.h> + +#include "macros.h" + +static char * +my_xasprintf (const char *format, ...) +{ + va_list args; + char *ret; + + va_start (args, format); + ret = xvasprintf (format, args); + va_end (args); + return ret; +} + +static void +test_xvasprintf (void) +{ + int repeat; + char *result; + + for (repeat = 0; repeat <= 8; repeat++) + { + result = my_xasprintf ("%d", 12345); + ASSERT (result != NULL); + ASSERT (strcmp (result, "12345") == 0); + free (result); + } + + { + /* Silence gcc warning about zero-length format string. */ + const char *empty = ""; + result = my_xasprintf (empty); + ASSERT (result != NULL); + ASSERT (strcmp (result, "") == 0); + free (result); + } + + result = my_xasprintf ("%s", "foo"); + ASSERT (result != NULL); + ASSERT (strcmp (result, "foo") == 0); + free (result); + + result = my_xasprintf ("%s%s", "foo", "bar"); + ASSERT (result != NULL); + ASSERT (strcmp (result, "foobar") == 0); + free (result); + + result = my_xasprintf ("%s%sbaz", "foo", "bar"); + ASSERT (result != NULL); + ASSERT (strcmp (result, "foobarbaz") == 0); + free (result); +} + +static void +test_xasprintf (void) +{ + int repeat; + char *result; + + for (repeat = 0; repeat <= 8; repeat++) + { + result = xasprintf ("%d", 12345); + ASSERT (result != NULL); + ASSERT (strcmp (result, "12345") == 0); + free (result); + } + + { + /* Silence gcc warning about zero-length format string, + and about "format not a string literal and no format" + (whatever that means) . */ + const char *empty = ""; + result = xasprintf (empty, empty); + ASSERT (result != NULL); + ASSERT (strcmp (result, "") == 0); + free (result); + } + + result = xasprintf ("%s", "foo"); + ASSERT (result != NULL); + ASSERT (strcmp (result, "foo") == 0); + free (result); + + result = xasprintf ("%s%s", "foo", "bar"); + ASSERT (result != NULL); + ASSERT (strcmp (result, "foobar") == 0); + free (result); + + result = my_xasprintf ("%s%sbaz", "foo", "bar"); + ASSERT (result != NULL); + ASSERT (strcmp (result, "foobarbaz") == 0); + free (result); +} + +int +main (int argc _GL_UNUSED, char *argv[]) +{ + test_xvasprintf (); + test_xasprintf (); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/timespec-add.c b/local/recipes/tools/diffutils/source/gnulib-tests/timespec-add.c new file mode 100644 index 0000000000..e6c87c6568 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/timespec-add.c @@ -0,0 +1,71 @@ +/* Add two struct timespec values. + + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +/* Return the sum of two timespec values A and B. On overflow, return + an extremal value. This assumes 0 <= tv_nsec < TIMESPEC_RESOLUTION. */ + +#include <config.h> +#include "timespec.h" + +#include "intprops.h" + +struct timespec +timespec_add (struct timespec a, struct timespec b) +{ + time_t rs = a.tv_sec; + time_t bs = b.tv_sec; + int ns = a.tv_nsec + b.tv_nsec; + int nsd = ns - TIMESPEC_RESOLUTION; + int rns = ns; + time_t tmin = TYPE_MINIMUM (time_t); + time_t tmax = TYPE_MAXIMUM (time_t); + + if (0 <= nsd) + { + rns = nsd; + if (bs < tmax) + bs++; + else if (rs < 0) + rs++; + else + goto high_overflow; + } + + /* INT_ADD_WRAPV is not appropriate since time_t might be unsigned. + In theory time_t might be narrower than int, so plain + INT_ADD_OVERFLOW does not suffice. */ + if (! INT_ADD_OVERFLOW (rs, bs) && tmin <= rs + bs && rs + bs <= tmax) + rs += bs; + else + { + if (rs < 0) + { + rs = tmin; + rns = 0; + } + else + { + high_overflow: + rs = tmax; + rns = TIMESPEC_RESOLUTION - 1; + } + } + + return make_timespec (rs, rns); +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/timespec-sub.c b/local/recipes/tools/diffutils/source/gnulib-tests/timespec-sub.c new file mode 100644 index 0000000000..5d9276dd0f --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/timespec-sub.c @@ -0,0 +1,71 @@ +/* Subtract two struct timespec values. + + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +/* Return the difference between two timespec values A and B. On + overflow, return an extremal value. This assumes 0 <= tv_nsec < + TIMESPEC_RESOLUTION. */ + +#include <config.h> +#include "timespec.h" + +#include "intprops.h" + +struct timespec +timespec_sub (struct timespec a, struct timespec b) +{ + time_t rs = a.tv_sec; + time_t bs = b.tv_sec; + int ns = a.tv_nsec - b.tv_nsec; + int rns = ns; + time_t tmin = TYPE_MINIMUM (time_t); + time_t tmax = TYPE_MAXIMUM (time_t); + + if (ns < 0) + { + rns = ns + TIMESPEC_RESOLUTION; + if (bs < tmax) + bs++; + else if (- TYPE_SIGNED (time_t) < rs) + rs--; + else + goto low_overflow; + } + + /* INT_SUBTRACT_WRAPV is not appropriate since time_t might be unsigned. + In theory time_t might be narrower than int, so plain + INT_SUBTRACT_OVERFLOW does not suffice. */ + if (! INT_SUBTRACT_OVERFLOW (rs, bs) && tmin <= rs - bs && rs - bs <= tmax) + rs -= bs; + else + { + if (rs < 0) + { + low_overflow: + rs = tmin; + rns = 0; + } + else + { + rs = tmax; + rns = TIMESPEC_RESOLUTION - 1; + } + } + + return make_timespec (rs, rns); +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/unistr/test-u8-mbtoucr.c b/local/recipes/tools/diffutils/source/gnulib-tests/unistr/test-u8-mbtoucr.c new file mode 100644 index 0000000000..08bfdb4e05 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/unistr/test-u8-mbtoucr.c @@ -0,0 +1,187 @@ +/* Test of u8_mbtoucr() function. + Copyright (C) 2010-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2010. */ + +#include <config.h> + +#include "unistr.h" + +#include "macros.h" + +int +main () +{ + ucs4_t uc; + int ret; + + /* Test NUL unit input. */ + { + static const uint8_t input[] = ""; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, input, 1); + ASSERT (ret == 1); + ASSERT (uc == 0); + } + + /* Test ISO 646 unit input. */ + { + ucs4_t c; + uint8_t buf[1]; + + for (c = 0; c < 0x80; c++) + { + buf[0] = c; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, buf, 1); + ASSERT (ret == 1); + ASSERT (uc == c); + } + } + + /* Test 2-byte character input. */ + { + static const uint8_t input[] = { 0xC3, 0x97 }; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, input, 2); + ASSERT (ret == 2); + ASSERT (uc == 0x00D7); + } + + /* Test 3-byte character input. */ + { + static const uint8_t input[] = { 0xE2, 0x82, 0xAC }; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, input, 3); + ASSERT (ret == 3); + ASSERT (uc == 0x20AC); + } + + /* Test 4-byte character input. */ + { + static const uint8_t input[] = { 0xF4, 0x8F, 0xBF, 0xBD }; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, input, 4); + ASSERT (ret == 4); + ASSERT (uc == 0x10FFFD); + } + + /* Test incomplete/invalid 1-byte input. */ + { + static const uint8_t input[] = { 0xC1 }; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, input, 1); + ASSERT (ret == -1); + ASSERT (uc == 0xFFFD); + } + { + static const uint8_t input[] = { 0xC3 }; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, input, 1); + ASSERT (ret == -2); + ASSERT (uc == 0xFFFD); + } + { + static const uint8_t input[] = { 0xE2 }; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, input, 1); + ASSERT (ret == -2); + ASSERT (uc == 0xFFFD); + } + { + static const uint8_t input[] = { 0xF4 }; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, input, 1); + ASSERT (ret == -2); + ASSERT (uc == 0xFFFD); + } + { + static const uint8_t input[] = { 0xFE }; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, input, 1); + ASSERT (ret == -1); + ASSERT (uc == 0xFFFD); + } + + /* Test incomplete/invalid 2-byte input. */ + { + static const uint8_t input[] = { 0xE0, 0x9F }; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, input, 2); + ASSERT (ret == -1); + ASSERT (uc == 0xFFFD); + } + { + static const uint8_t input[] = { 0xE2, 0x82 }; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, input, 2); + ASSERT (ret == -2); + ASSERT (uc == 0xFFFD); + } + { + static const uint8_t input[] = { 0xE2, 0xD0 }; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, input, 2); + ASSERT (ret == -1); + ASSERT (uc == 0xFFFD); + } + { + static const uint8_t input[] = { 0xF0, 0x8F }; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, input, 2); + ASSERT (ret == -1); + ASSERT (uc == 0xFFFD); + } + { + static const uint8_t input[] = { 0xF3, 0x8F }; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, input, 2); + ASSERT (ret == -2); + ASSERT (uc == 0xFFFD); + } + { + static const uint8_t input[] = { 0xF3, 0xD0 }; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, input, 2); + ASSERT (ret == -1); + ASSERT (uc == 0xFFFD); + } + + /* Test incomplete/invalid 3-byte input. */ + { + static const uint8_t input[] = { 0xF3, 0x8F, 0xBF }; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, input, 3); + ASSERT (ret == -2); + ASSERT (uc == 0xFFFD); + } + { + static const uint8_t input[] = { 0xF3, 0xD0, 0xBF }; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, input, 3); + ASSERT (ret == -1); + ASSERT (uc == 0xFFFD); + } + { + static const uint8_t input[] = { 0xF3, 0x8F, 0xD0 }; + uc = 0xBADFACE; + ret = u8_mbtoucr (&uc, input, 3); + ASSERT (ret == -1); + ASSERT (uc == 0xFFFD); + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/unistr/test-u8-uctomb.c b/local/recipes/tools/diffutils/source/gnulib-tests/unistr/test-u8-uctomb.c new file mode 100644 index 0000000000..5c36fb95bf --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/unistr/test-u8-uctomb.c @@ -0,0 +1,157 @@ +/* Test of u8_uctomb() function. + Copyright (C) 2010-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2010. */ + +#include <config.h> + +#include "unistr.h" + +#include "macros.h" + +#define MAGIC 0xBA + +int +main () +{ + /* Test ISO 646 character, in particular the NUL character. */ + { + ucs4_t uc; + + for (uc = 0; uc < 0x80; uc++) + { + uint8_t buf[5] = { MAGIC, MAGIC, MAGIC, MAGIC, MAGIC }; + int ret; + + ret = u8_uctomb (buf, uc, 0); + ASSERT (ret == -2); + ASSERT (buf[0] == MAGIC); + + ret = u8_uctomb (buf, uc, 1); + ASSERT (ret == 1); + ASSERT (buf[0] == uc); + ASSERT (buf[1] == MAGIC); + } + } + + /* Test 2-byte character. */ + { + ucs4_t uc = 0x00D7; + uint8_t buf[5] = { MAGIC, MAGIC, MAGIC, MAGIC, MAGIC }; + int ret; + + ret = u8_uctomb (buf, uc, 0); + ASSERT (ret == -2); + ASSERT (buf[0] == MAGIC); + + ret = u8_uctomb (buf, uc, 1); + ASSERT (ret == -2); + ASSERT (buf[0] == MAGIC); + + ret = u8_uctomb (buf, uc, 2); + ASSERT (ret == 2); + ASSERT (buf[0] == 0xC3); + ASSERT (buf[1] == 0x97); + ASSERT (buf[2] == MAGIC); + } + + /* Test 3-byte character. */ + { + ucs4_t uc = 0x20AC; + uint8_t buf[5] = { MAGIC, MAGIC, MAGIC, MAGIC, MAGIC }; + int ret; + + ret = u8_uctomb (buf, uc, 0); + ASSERT (ret == -2); + ASSERT (buf[0] == MAGIC); + + ret = u8_uctomb (buf, uc, 1); + ASSERT (ret == -2); + ASSERT (buf[0] == MAGIC); + + ret = u8_uctomb (buf, uc, 2); + ASSERT (ret == -2); + ASSERT (buf[0] == MAGIC); + ASSERT (buf[1] == MAGIC); + + ret = u8_uctomb (buf, uc, 3); + ASSERT (ret == 3); + ASSERT (buf[0] == 0xE2); + ASSERT (buf[1] == 0x82); + ASSERT (buf[2] == 0xAC); + ASSERT (buf[3] == MAGIC); + } + + /* Test 4-byte character. */ + { + ucs4_t uc = 0x10FFFD; + uint8_t buf[5] = { MAGIC, MAGIC, MAGIC, MAGIC, MAGIC }; + int ret; + + ret = u8_uctomb (buf, uc, 0); + ASSERT (ret == -2); + ASSERT (buf[0] == MAGIC); + + ret = u8_uctomb (buf, uc, 1); + ASSERT (ret == -2); + ASSERT (buf[0] == MAGIC); + + ret = u8_uctomb (buf, uc, 2); + ASSERT (ret == -2); + ASSERT (buf[0] == MAGIC); + ASSERT (buf[1] == MAGIC); + + ret = u8_uctomb (buf, uc, 3); + ASSERT (ret == -2); + ASSERT (buf[0] == MAGIC); + ASSERT (buf[1] == MAGIC); + ASSERT (buf[2] == MAGIC); + + ret = u8_uctomb (buf, uc, 4); + ASSERT (ret == 4); + ASSERT (buf[0] == 0xF4); + ASSERT (buf[1] == 0x8F); + ASSERT (buf[2] == 0xBF); + ASSERT (buf[3] == 0xBD); + ASSERT (buf[4] == MAGIC); + } + + /* Test invalid characters. */ + { + ucs4_t invalid[] = { 0x110000, 0xD800, 0xDBFF, 0xDC00, 0xDFFF }; + uint8_t buf[5] = { MAGIC, MAGIC, MAGIC, MAGIC, MAGIC }; + size_t i; + + for (i = 0; i < SIZEOF (invalid); i++) + { + ucs4_t uc = invalid[i]; + int n; + + for (n = 0; n <= 4; n++) + { + int ret = u8_uctomb (buf, uc, n); + ASSERT (ret == -1); + ASSERT (buf[0] == MAGIC); + ASSERT (buf[1] == MAGIC); + ASSERT (buf[2] == MAGIC); + ASSERT (buf[3] == MAGIC); + ASSERT (buf[4] == MAGIC); + } + } + } + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/uniwidth/test-uc_width.c b/local/recipes/tools/diffutils/source/gnulib-tests/uniwidth/test-uc_width.c new file mode 100644 index 0000000000..6a3fafb534 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/uniwidth/test-uc_width.c @@ -0,0 +1,56 @@ +/* Test of uc_width() function. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +#include <config.h> + +#include "uniwidth.h" + +#include "macros.h" + +int +main () +{ + ucs4_t uc; + + /* Test width of ASCII characters. */ + for (uc = 0x0020; uc < 0x007F; uc++) + ASSERT (uc_width (uc, "ISO-8859-2") == 1); + + /* Test width of some non-spacing characters. */ + ASSERT (uc_width (0x0301, "UTF-8") == 0); + ASSERT (uc_width (0x05B0, "UTF-8") == 0); + + /* Test width of some format control characters. */ + ASSERT (uc_width (0x200E, "UTF-8") == 0); + ASSERT (uc_width (0x2060, "UTF-8") == 0); + ASSERT (uc_width (0xE0001, "UTF-8") == 0); + ASSERT (uc_width (0xE0044, "UTF-8") == 0); + + /* Test width of some zero width characters. */ + ASSERT (uc_width (0x200B, "UTF-8") == 0); + ASSERT (uc_width (0xFEFF, "UTF-8") == 0); + + /* Test width of some CJK characters. */ + ASSERT (uc_width (0x3000, "UTF-8") == 2); + ASSERT (uc_width (0xB250, "UTF-8") == 2); + ASSERT (uc_width (0xFF1A, "UTF-8") == 2); + ASSERT (uc_width (0x20369, "UTF-8") == 2); + ASSERT (uc_width (0x2F876, "UTF-8") == 2); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/uniwidth/test-uc_width2.c b/local/recipes/tools/diffutils/source/gnulib-tests/uniwidth/test-uc_width2.c new file mode 100644 index 0000000000..1792dafca9 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/uniwidth/test-uc_width2.c @@ -0,0 +1,86 @@ +/* Test of uc_width() function. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include "uniwidth.h" + +#include <stdio.h> + +#include "macros.h" + +/* One of 0, '0', '1', 'A', '2'. */ +static char current_width; +/* The interval for which the current_width holds. */ +static ucs4_t current_start; +static ucs4_t current_end; + +static void +finish_interval (void) +{ + if (current_width != 0) + { + if (current_start == current_end) + printf ("%04X\t\t%c\n", (unsigned) current_start, current_width); + else + printf ("%04X..%04X\t%c\n", (unsigned) current_start, + (unsigned) current_end, current_width); + current_width = 0; + } +} + +static void +add_to_interval (ucs4_t uc, char width) +{ + if (current_width == width && uc == current_end + 1) + current_end = uc; + else + { + finish_interval (); + current_width = width; + current_start = current_end = uc; + } +} + +int +main () +{ + ucs4_t uc; + + for (uc = 0; uc < 0x110000; uc++) + { + int w1 = uc_width (uc, "UTF-8"); + int w2 = uc_width (uc, "GBK"); + char width = + (w1 == 0 && w2 == 0 ? '0' : + w1 == 1 && w2 == 1 ? '1' : + w1 == 1 && w2 == 2 ? 'A' : + w1 == 2 && w2 == 2 ? '2' : + 0); + if (width == 0) + { + /* uc must be a control character. */ + ASSERT (w1 < 0 && w2 < 0); + } + else + add_to_interval (uc, width); + } + finish_interval (); + + return 0; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/uniwidth/test-uc_width2.sh b/local/recipes/tools/diffutils/source/gnulib-tests/uniwidth/test-uc_width2.sh new file mode 100755 index 0000000000..1463d3454b --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/uniwidth/test-uc_width2.sh @@ -0,0 +1,597 @@ +#!/bin/sh + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles uc_width.out" +./test-uc_width2${EXEEXT} | LC_ALL=C tr -d '\r' > uc_width.out + +tmpfiles="$tmpfiles uc_width.ok" +cat > uc_width.ok <<\EOF +0000 0 +0020..007E 1 +00A0 1 +00A1..00AC A +00AD 0 +00AE..02FF A +0300..036F 0 +0370..0482 A +0483..0489 0 +048A..0590 A +0591..05BD 0 +05BE A +05BF 0 +05C0 A +05C1..05C2 0 +05C3 A +05C4..05C5 0 +05C6 A +05C7 0 +05C8..05FF A +0600..0605 0 +0606..060F A +0610..061A 0 +061B A +061C 0 +061D..064A A +064B..065F 0 +0660..066F A +0670 0 +0671..06D5 A +06D6..06DD 0 +06DE A +06DF..06E4 0 +06E5..06E6 A +06E7..06E8 0 +06E9 A +06EA..06ED 0 +06EE..070E A +070F 0 +0710 A +0711 0 +0712..072F A +0730..074A 0 +074B..07A5 A +07A6..07B0 0 +07B1..07EA A +07EB..07F3 0 +07F4..0815 A +0816..0819 0 +081A A +081B..0823 0 +0824 A +0825..0827 0 +0828 A +0829..082D 0 +082E..0858 A +0859..085B 0 +085C..08E2 A +08E3..0902 0 +0903..0939 A +093A 0 +093B A +093C 0 +093D..0940 A +0941..0948 0 +0949..094C A +094D 0 +094E..0950 A +0951..0957 0 +0958..0961 A +0962..0963 0 +0964..0980 A +0981 0 +0982..09BB A +09BC 0 +09BD..09C0 A +09C1..09C4 0 +09C5..09CC A +09CD 0 +09CE..09E1 A +09E2..09E3 0 +09E4..0A00 A +0A01..0A02 0 +0A03..0A3B A +0A3C 0 +0A3D..0A40 A +0A41..0A42 0 +0A43..0A46 A +0A47..0A48 0 +0A49..0A4A A +0A4B..0A4D 0 +0A4E..0A50 A +0A51 0 +0A52..0A6F A +0A70..0A71 0 +0A72..0A74 A +0A75 0 +0A76..0A80 A +0A81..0A82 0 +0A83..0ABB A +0ABC 0 +0ABD..0AC0 A +0AC1..0AC5 0 +0AC6 A +0AC7..0AC8 0 +0AC9..0ACC A +0ACD 0 +0ACE..0AE1 A +0AE2..0AE3 0 +0AE4..0B00 A +0B01 0 +0B02..0B3B A +0B3C 0 +0B3D..0B3E A +0B3F 0 +0B40 A +0B41..0B44 0 +0B45..0B4C A +0B4D 0 +0B4E..0B55 A +0B56 0 +0B57..0B61 A +0B62..0B63 0 +0B64..0B81 A +0B82 0 +0B83..0BBF A +0BC0 0 +0BC1..0BCC A +0BCD 0 +0BCE..0BFF A +0C00 0 +0C01..0C3D A +0C3E..0C40 0 +0C41..0C45 A +0C46..0C48 0 +0C49 A +0C4A..0C4D 0 +0C4E..0C54 A +0C55..0C56 0 +0C57..0C61 A +0C62..0C63 0 +0C64..0C80 A +0C81 0 +0C82..0CBB A +0CBC 0 +0CBD..0CCB A +0CCC..0CCD 0 +0CCE..0CE1 A +0CE2..0CE3 0 +0CE4..0D00 A +0D01 0 +0D02..0D40 A +0D41..0D44 0 +0D45..0D4C A +0D4D 0 +0D4E..0D61 A +0D62..0D63 0 +0D64..0DC9 A +0DCA 0 +0DCB..0DD1 A +0DD2..0DD4 0 +0DD5 A +0DD6 0 +0DD7..0E30 A +0E31 0 +0E32..0E33 A +0E34..0E3A 0 +0E3B..0E46 A +0E47..0E4E 0 +0E4F..0EB0 A +0EB1 0 +0EB2..0EB3 A +0EB4..0EB9 0 +0EBA A +0EBB..0EBC 0 +0EBD..0EC7 A +0EC8..0ECD 0 +0ECE..0F17 A +0F18..0F19 0 +0F1A..0F34 A +0F35 0 +0F36 A +0F37 0 +0F38 A +0F39 0 +0F3A..0F70 A +0F71..0F7E 0 +0F7F A +0F80..0F84 0 +0F85 A +0F86..0F87 0 +0F88..0F8C A +0F8D..0F97 0 +0F98 A +0F99..0FBC 0 +0FBD..0FC5 A +0FC6 0 +0FC7..102C A +102D..1030 0 +1031 A +1032..1037 0 +1038 A +1039..103A 0 +103B..103C A +103D..103E 0 +103F..1057 A +1058..1059 0 +105A..105D A +105E..1060 0 +1061..1070 A +1071..1074 0 +1075..1081 A +1082 0 +1083..1084 A +1085..1086 0 +1087..108C A +108D 0 +108E..109C A +109D 0 +109E..10FF A +1100..115F 2 +1160..135C A +135D..135F 0 +1360..1711 A +1712..1714 0 +1715..1731 A +1732..1734 0 +1735..1751 A +1752..1753 0 +1754..1771 A +1772..1773 0 +1774..17B3 A +17B4..17B5 0 +17B6 A +17B7..17BD 0 +17BE..17C5 A +17C6 0 +17C7..17C8 A +17C9..17D3 0 +17D4..17DC A +17DD 0 +17DE..180A A +180B..180E 0 +180F..18A8 A +18A9 0 +18AA..191F A +1920..1922 0 +1923..1926 A +1927..1928 0 +1929..1931 A +1932 0 +1933..1938 A +1939..193B 0 +193C..1A16 A +1A17..1A18 0 +1A19..1A1A A +1A1B 0 +1A1C..1A55 A +1A56 0 +1A57 A +1A58..1A5E 0 +1A5F A +1A60 0 +1A61 A +1A62 0 +1A63..1A64 A +1A65..1A6C 0 +1A6D..1A72 A +1A73..1A7C 0 +1A7D..1A7E A +1A7F 0 +1A80..1AAF A +1AB0..1ABE 0 +1ABF..1AFF A +1B00..1B03 0 +1B04..1B33 A +1B34 0 +1B35 A +1B36..1B3A 0 +1B3B A +1B3C 0 +1B3D..1B41 A +1B42 0 +1B43..1B6A A +1B6B..1B73 0 +1B74..1B7F A +1B80..1B81 0 +1B82..1BA1 A +1BA2..1BA5 0 +1BA6..1BA7 A +1BA8..1BA9 0 +1BAA A +1BAB..1BAD 0 +1BAE..1BE5 A +1BE6 0 +1BE7 A +1BE8..1BE9 0 +1BEA..1BEC A +1BED 0 +1BEE A +1BEF..1BF1 0 +1BF2..1C2B A +1C2C..1C33 0 +1C34..1C35 A +1C36..1C37 0 +1C38..1CCF A +1CD0..1CD2 0 +1CD3 A +1CD4..1CE0 0 +1CE1 A +1CE2..1CE8 0 +1CE9..1CEC A +1CED 0 +1CEE..1CF3 A +1CF4 0 +1CF5..1CF7 A +1CF8..1CF9 0 +1CFA..1DBF A +1DC0..1DF5 0 +1DF6..1DFB A +1DFC..1DFF 0 +1E00..200A A +200B..200F 0 +2010..2029 A +202A..202E 0 +202F..205F A +2060..2064 0 +2065 A +2066..206F 0 +2070..20A8 A +20A9 1 +20AA..20CF A +20D0..20F0 0 +20F1..2328 A +2329..232A 2 +232B..2CEE A +2CEF..2CF1 0 +2CF2..2D7E A +2D7F 0 +2D80..2DDF A +2DE0..2DFF 0 +2E00..2E7F A +2E80..3029 2 +302A..302D 0 +302E..303E 2 +303F A +3040..3098 2 +3099..309A 0 +309B..4DBF 2 +4DC0..4DFF A +4E00..A4CF 2 +A4D0..A66E A +A66F..A672 0 +A673 A +A674..A67D 0 +A67E..A69D A +A69E..A69F 0 +A6A0..A6EF A +A6F0..A6F1 0 +A6F2..A801 A +A802 0 +A803..A805 A +A806 0 +A807..A80A A +A80B 0 +A80C..A824 A +A825..A826 0 +A827..A8C3 A +A8C4 0 +A8C5..A8DF A +A8E0..A8F1 0 +A8F2..A925 A +A926..A92D 0 +A92E..A946 A +A947..A951 0 +A952..A97F A +A980..A982 0 +A983..A9B2 A +A9B3 0 +A9B4..A9B5 A +A9B6..A9B9 0 +A9BA..A9BB A +A9BC 0 +A9BD..A9E4 A +A9E5 0 +A9E6..AA28 A +AA29..AA2E 0 +AA2F..AA30 A +AA31..AA32 0 +AA33..AA34 A +AA35..AA36 0 +AA37..AA42 A +AA43 0 +AA44..AA4B A +AA4C 0 +AA4D..AA7B A +AA7C 0 +AA7D..AAAF A +AAB0 0 +AAB1 A +AAB2..AAB4 0 +AAB5..AAB6 A +AAB7..AAB8 0 +AAB9..AABD A +AABE..AABF 0 +AAC0 A +AAC1 0 +AAC2..AAEB A +AAEC..AAED 0 +AAEE..AAF5 A +AAF6 0 +AAF7..ABE4 A +ABE5 0 +ABE6..ABE7 A +ABE8 0 +ABE9..ABEC A +ABED 0 +ABEE..ABFF A +AC00..D7A3 2 +D7A4..F8FF A +F900..FAFF 2 +FB00..FB1D A +FB1E 0 +FB1F..FDFF A +FE00..FE0F 0 +FE10..FE1F 2 +FE20..FE2F 0 +FE30..FE6F 2 +FE70..FEFE A +FEFF 0 +FF00..FF60 2 +FF61..FFDF 1 +FFE0..FFE6 2 +FFE7..FFF8 1 +FFF9..FFFB 0 +FFFC..101FC 1 +101FD 0 +101FE..102DF 1 +102E0 0 +102E1..10375 1 +10376..1037A 0 +1037B..10A00 1 +10A01..10A03 0 +10A04 1 +10A05..10A06 0 +10A07..10A0B 1 +10A0C..10A0F 0 +10A10..10A37 1 +10A38..10A3A 0 +10A3B..10A3E 1 +10A3F 0 +10A40..10AE4 1 +10AE5..10AE6 0 +10AE7..11000 1 +11001 0 +11002..11037 1 +11038..11046 0 +11047..1107E 1 +1107F..11081 0 +11082..110B2 1 +110B3..110B6 0 +110B7..110B8 1 +110B9..110BA 0 +110BB..110BC 1 +110BD 0 +110BE..110FF 1 +11100..11102 0 +11103..11126 1 +11127..1112B 0 +1112C 1 +1112D..11134 0 +11135..11172 1 +11173 0 +11174..1117F 1 +11180..11181 0 +11182..111B5 1 +111B6..111BE 0 +111BF..111C9 1 +111CA..111CC 0 +111CD..1122E 1 +1122F..11231 0 +11232..11233 1 +11234 0 +11235 1 +11236..11237 0 +11238..112DE 1 +112DF 0 +112E0..112E2 1 +112E3..112EA 0 +112EB..112FF 1 +11300..11301 0 +11302..1133B 1 +1133C 0 +1133D..1133F 1 +11340 0 +11341..11365 1 +11366..1136C 0 +1136D..1136F 1 +11370..11374 0 +11375..114B2 1 +114B3..114B8 0 +114B9 1 +114BA 0 +114BB..114BE 1 +114BF..114C0 0 +114C1 1 +114C2..114C3 0 +114C4..115B1 1 +115B2..115B5 0 +115B6..115BB 1 +115BC..115BD 0 +115BE 1 +115BF..115C0 0 +115C1..115DB 1 +115DC..115DD 0 +115DE..11632 1 +11633..1163A 0 +1163B..1163C 1 +1163D 0 +1163E 1 +1163F..11640 0 +11641..116AA 1 +116AB 0 +116AC 1 +116AD 0 +116AE..116AF 1 +116B0..116B5 0 +116B6 1 +116B7 0 +116B8..1171C 1 +1171D..1171F 0 +11720..11721 1 +11722..11725 0 +11726 1 +11727..1172B 0 +1172C..16AEF 1 +16AF0..16AF4 0 +16AF5..16B2F 1 +16B30..16B36 0 +16B37..16F8E 1 +16F8F..16F92 0 +16F93..1BC9C 1 +1BC9D..1BC9E 0 +1BC9F 1 +1BCA0..1BCA3 0 +1BCA4..1D166 1 +1D167..1D169 0 +1D16A..1D172 1 +1D173..1D182 0 +1D183..1D184 1 +1D185..1D18B 0 +1D18C..1D1A9 1 +1D1AA..1D1AD 0 +1D1AE..1D241 1 +1D242..1D244 0 +1D245..1D9FF 1 +1DA00..1DA36 0 +1DA37..1DA3A 1 +1DA3B..1DA6C 0 +1DA6D..1DA74 1 +1DA75 0 +1DA76..1DA83 1 +1DA84 0 +1DA85..1DA9A 1 +1DA9B..1DA9F 0 +1DAA0 1 +1DAA1..1DAAF 0 +1DAB0..1E8CF 1 +1E8D0..1E8D6 0 +1E8D7..1FFFF 1 +20000..3FFFF 2 +40000..E0000 1 +E0001 0 +E0002..E001F 1 +E0020..E007F 0 +E0080..E00FF 1 +E0100..E01EF 0 +E01F0..10FFFF 1 +EOF + +: ${DIFF=diff} +${DIFF} uc_width.ok uc_width.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/unused-parameter.h b/local/recipes/tools/diffutils/source/gnulib-tests/unused-parameter.h new file mode 100644 index 0000000000..b300055a1d --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/unused-parameter.h @@ -0,0 +1,36 @@ +/* A C macro for declaring that specific function parameters are not used. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* _GL_UNUSED_PARAMETER is a marker that can be appended to function parameter + declarations for parameters that are not used. This helps to reduce + warnings, such as from GCC -Wunused-parameter. The syntax is as follows: + type param _GL_UNUSED_PARAMETER + or more generally + param_decl _GL_UNUSED_PARAMETER + For example: + int param _GL_UNUSED_PARAMETER + int *(*param)(void) _GL_UNUSED_PARAMETER + Other possible, but obscure and discouraged syntaxes: + int _GL_UNUSED_PARAMETER *(*param)(void) + _GL_UNUSED_PARAMETER int *(*param)(void) + */ +#ifndef _GL_UNUSED_PARAMETER +# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _GL_UNUSED_PARAMETER __attribute__ ((__unused__)) +# else +# define _GL_UNUSED_PARAMETER +# endif +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/w32sock.h b/local/recipes/tools/diffutils/source/gnulib-tests/w32sock.h new file mode 100644 index 0000000000..2f753fb4c9 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/w32sock.h @@ -0,0 +1,140 @@ +/* w32sock.h --- internal auxiliary functions for Windows socket functions + + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paolo Bonzini */ + +#include <errno.h> + +/* Get O_RDWR and O_BINARY. */ +#include <fcntl.h> + +/* Get _open_osfhandle(). */ +#include <io.h> + +/* Get _get_osfhandle(). */ +#if GNULIB_MSVC_NOTHROW +# include "msvc-nothrow.h" +#else +# include <io.h> +#endif + +#define FD_TO_SOCKET(fd) ((SOCKET) _get_osfhandle ((fd))) +#define SOCKET_TO_FD(fh) (_open_osfhandle ((intptr_t) (fh), O_RDWR | O_BINARY)) + +static inline void +set_winsock_errno (void) +{ + int err = WSAGetLastError (); + + /* Map some WSAE* errors to the runtime library's error codes. */ + switch (err) + { + case WSA_INVALID_HANDLE: + errno = EBADF; + break; + case WSA_NOT_ENOUGH_MEMORY: + errno = ENOMEM; + break; + case WSA_INVALID_PARAMETER: + errno = EINVAL; + break; + case WSAENAMETOOLONG: + errno = ENAMETOOLONG; + break; + case WSAENOTEMPTY: + errno = ENOTEMPTY; + break; + case WSAEWOULDBLOCK: + errno = EWOULDBLOCK; + break; + case WSAEINPROGRESS: + errno = EINPROGRESS; + break; + case WSAEALREADY: + errno = EALREADY; + break; + case WSAENOTSOCK: + errno = ENOTSOCK; + break; + case WSAEDESTADDRREQ: + errno = EDESTADDRREQ; + break; + case WSAEMSGSIZE: + errno = EMSGSIZE; + break; + case WSAEPROTOTYPE: + errno = EPROTOTYPE; + break; + case WSAENOPROTOOPT: + errno = ENOPROTOOPT; + break; + case WSAEPROTONOSUPPORT: + errno = EPROTONOSUPPORT; + break; + case WSAEOPNOTSUPP: + errno = EOPNOTSUPP; + break; + case WSAEAFNOSUPPORT: + errno = EAFNOSUPPORT; + break; + case WSAEADDRINUSE: + errno = EADDRINUSE; + break; + case WSAEADDRNOTAVAIL: + errno = EADDRNOTAVAIL; + break; + case WSAENETDOWN: + errno = ENETDOWN; + break; + case WSAENETUNREACH: + errno = ENETUNREACH; + break; + case WSAENETRESET: + errno = ENETRESET; + break; + case WSAECONNABORTED: + errno = ECONNABORTED; + break; + case WSAECONNRESET: + errno = ECONNRESET; + break; + case WSAENOBUFS: + errno = ENOBUFS; + break; + case WSAEISCONN: + errno = EISCONN; + break; + case WSAENOTCONN: + errno = ENOTCONN; + break; + case WSAETIMEDOUT: + errno = ETIMEDOUT; + break; + case WSAECONNREFUSED: + errno = ECONNREFUSED; + break; + case WSAELOOP: + errno = ELOOP; + break; + case WSAEHOSTUNREACH: + errno = EHOSTUNREACH; + break; + default: + errno = (err > 10000 && err < 10025) ? err - 10000 : err; + break; + } +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/warn-on-use.h b/local/recipes/tools/diffutils/source/gnulib-tests/warn-on-use.h new file mode 100644 index 0000000000..3c0eb579fa --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/warn-on-use.h @@ -0,0 +1,109 @@ +/* A C macro for emitting warnings if a function is used. + Copyright (C) 2010-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* _GL_WARN_ON_USE (function, "literal string") issues a declaration + for FUNCTION which will then trigger a compiler warning containing + the text of "literal string" anywhere that function is called, if + supported by the compiler. If the compiler does not support this + feature, the macro expands to an unused extern declaration. + + This macro is useful for marking a function as a potential + portability trap, with the intent that "literal string" include + instructions on the replacement function that should be used + instead. However, one of the reasons that a function is a + portability trap is if it has the wrong signature. Declaring + FUNCTION with a different signature in C is a compilation error, so + this macro must use the same type as any existing declaration so + that programs that avoid the problematic FUNCTION do not fail to + compile merely because they included a header that poisoned the + function. But this implies that _GL_WARN_ON_USE is only safe to + use if FUNCTION is known to already have a declaration. Use of + this macro implies that there must not be any other macro hiding + the declaration of FUNCTION; but undefining FUNCTION first is part + of the poisoning process anyway (although for symbols that are + provided only via a macro, the result is a compilation error rather + than a warning containing "literal string"). Also note that in + C++, it is only safe to use if FUNCTION has no overloads. + + For an example, it is possible to poison 'getline' by: + - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]], + [getline]) in configure.ac, which potentially defines + HAVE_RAW_DECL_GETLINE + - adding this code to a header that wraps the system <stdio.h>: + #undef getline + #if HAVE_RAW_DECL_GETLINE + _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but" + "not universally present; use the gnulib module getline"); + #endif + + It is not possible to directly poison global variables. But it is + possible to write a wrapper accessor function, and poison that + (less common usage, like &environ, will cause a compilation error + rather than issue the nice warning, but the end result of informing + the developer about their portability problem is still achieved): + #if HAVE_RAW_DECL_ENVIRON + static char ***rpl_environ (void) { return &environ; } + _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared"); + # undef environ + # define environ (*rpl_environ ()) + #endif + */ +#ifndef _GL_WARN_ON_USE + +# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) +/* A compiler attribute is available in gcc versions 4.3.0 and later. */ +# define _GL_WARN_ON_USE(function, message) \ +extern __typeof__ (function) function __attribute__ ((__warning__ (message))) +# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING +/* Verify the existence of the function. */ +# define _GL_WARN_ON_USE(function, message) \ +extern __typeof__ (function) function +# else /* Unsupported. */ +# define _GL_WARN_ON_USE(function, message) \ +_GL_WARN_EXTERN_C int _gl_warn_on_use +# endif +#endif + +/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string") + is like _GL_WARN_ON_USE (function, "string"), except that the function is + declared with the given prototype, consisting of return type, parameters, + and attributes. + This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does + not work in this case. */ +#ifndef _GL_WARN_ON_USE_CXX +# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) +# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ +extern rettype function parameters_and_attributes \ + __attribute__ ((__warning__ (msg))) +# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING +/* Verify the existence of the function. */ +# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ +extern rettype function parameters_and_attributes +# else /* Unsupported. */ +# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ +_GL_WARN_EXTERN_C int _gl_warn_on_use +# endif +#endif + +/* _GL_WARN_EXTERN_C declaration; + performs the declaration with C linkage. */ +#ifndef _GL_WARN_EXTERN_C +# if defined __cplusplus +# define _GL_WARN_EXTERN_C extern "C" +# else +# define _GL_WARN_EXTERN_C extern +# endif +#endif diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/wctob.c b/local/recipes/tools/diffutils/source/gnulib-tests/wctob.c new file mode 100644 index 0000000000..ab320cf0f6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/wctob.c @@ -0,0 +1,38 @@ +/* Convert wide character to unibyte character. + Copyright (C) 2008, 2010-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <wchar.h> + +#include <stdio.h> +#include <stdlib.h> + +int +wctob (wint_t wc) +{ + char buf[64]; + + if (!(MB_CUR_MAX <= sizeof (buf))) + abort (); + /* Handle the case where WEOF is a value that does not fit in a wchar_t. */ + if (wc == (wchar_t)wc) + if (wctomb (buf, (wchar_t)wc) == 1) + return (unsigned char) buf[0]; + return EOF; +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/wctomb-impl.h b/local/recipes/tools/diffutils/source/gnulib-tests/wctomb-impl.h new file mode 100644 index 0000000000..f76b59566b --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/wctomb-impl.h @@ -0,0 +1,34 @@ +/* Convert wide character to multibyte character. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2011. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +int +wctomb (char *s, wchar_t wc) +{ + if (s == NULL) + return 0; + else + { + mbstate_t state; + size_t result; + + memset (&state, 0, sizeof (mbstate_t)); + result = wcrtomb (s, wc, &state); + if (result == (size_t)-1) + return -1; + return result; + } +} diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/wctomb.c b/local/recipes/tools/diffutils/source/gnulib-tests/wctomb.c new file mode 100644 index 0000000000..724ce4f24d --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/wctomb.c @@ -0,0 +1,25 @@ +/* Convert wide character to multibyte character. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2011. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <stdlib.h> + +#include <string.h> +#include <wchar.h> + +#include "wctomb-impl.h" diff --git a/local/recipes/tools/diffutils/source/gnulib-tests/zerosize-ptr.h b/local/recipes/tools/diffutils/source/gnulib-tests/zerosize-ptr.h new file mode 100644 index 0000000000..e097ccdcf5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/gnulib-tests/zerosize-ptr.h @@ -0,0 +1,68 @@ +/* Return a pointer to a zero-size object in memory. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* ISO C 99 does not allow memcmp(), memchr() etc. to be invoked with a NULL + argument. Therefore this file produces a non-NULL pointer which cannot + be dereferenced, if possible. */ + +#include <stdlib.h> + +/* Test whether mmap() and mprotect() are available. + We don't use HAVE_MMAP, because AC_FUNC_MMAP would not define it on HP-UX. + HAVE_MPROTECT is not enough, because mingw does not have mmap() but has an + mprotect() function in libgcc.a. */ +#if HAVE_SYS_MMAN_H && HAVE_MPROTECT +# include <fcntl.h> +# include <unistd.h> +# include <sys/types.h> +# include <sys/mman.h> +/* Define MAP_FILE when it isn't otherwise. */ +# ifndef MAP_FILE +# define MAP_FILE 0 +# endif +#endif + +/* Return a pointer to a zero-size object in memory (that is, actually, a + pointer to a page boundary where the previous page is readable and writable + and the next page is neither readable not writable), if possible. + Return NULL otherwise. */ + +static void * +zerosize_ptr (void) +{ +/* Use mmap and mprotect when they exist. Don't test HAVE_MMAP, because it is + not defined on HP-UX 11 (since it does not support MAP_FIXED). */ +#if HAVE_SYS_MMAN_H && HAVE_MPROTECT +# if HAVE_MAP_ANONYMOUS + const int flags = MAP_ANONYMOUS | MAP_PRIVATE; + const int fd = -1; +# else /* !HAVE_MAP_ANONYMOUS */ + const int flags = MAP_FILE | MAP_PRIVATE; + int fd = open ("/dev/zero", O_RDONLY, 0666); + if (fd >= 0) +# endif + { + int pagesize = getpagesize (); + char *two_pages = + (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, + flags, fd, 0); + if (two_pages != (char *)(-1) + && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) + return two_pages + pagesize; + } +#endif + return NULL; +} diff --git a/local/recipes/tools/diffutils/source/lib/Makefile.am b/local/recipes/tools/diffutils/source/lib/Makefile.am new file mode 100644 index 0000000000..ce32659a9f --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/Makefile.am @@ -0,0 +1,35 @@ +# Automakefile for GNU Diffutils library. + +# Copyright (C) 2001-2002, 2004, 2006, 2009-2013, 2015-2017 Free Software +# Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +AM_CFLAGS = +BUILT_SOURCES = +CLEANFILES = +EXTRA_DIST = +MOSTLYCLEANDIRS = +MOSTLYCLEANFILES = +MAINTAINERCLEANFILES = +SUFFIXES = +noinst_LIBRARIES = +noinst_HEADERS = + +include gnulib.mk + +noinst_HEADERS += cmpbuf.h prepargs.h +libdiffutils_a_SOURCES += cmpbuf.c prepargs.c + +AM_CFLAGS += $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) diff --git a/local/recipes/tools/diffutils/source/lib/Makefile.in b/local/recipes/tools/diffutils/source/lib/Makefile.in new file mode 100644 index 0000000000..d626917b7d --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/Makefile.in @@ -0,0 +1,3675 @@ +# Makefile.in generated by automake 1.18.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2025 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Automakefile for GNU Diffutils library. + +# Copyright (C) 2001-2002, 2004, 2006, 2009-2013, 2015-2017 Free Software +# Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Copyright (C) 2002-2017 Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this file. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception to the GNU General Public License, +# this file may be distributed as part of a program that +# contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# Generated by gnulib-tool. +# Reproduce by: gnulib-tool --import --local-dir=gl --lib=libdiffutils --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=gnulib-tests --aux-dir=build-aux --with-tests --avoid=localename --avoid=lock --makefile-name=gnulib.mk --no-conditional-dependencies --no-libtool --macro-prefix=gl announce-gen argmatch binary-io c-stack config-h diffseq dirname do-release-commit-and-tag dup2 error exclude exitfail extensions fcntl fdl file-type filenamecat fnmatch-gnu getopt gettext-h gettime git-version-gen gitlog-to-changelog gnu-make gnu-web-doc-update gnumakefile gnupload hard-locale inttostr inttypes isblank largefile lstat maintainer-makefile manywarnings mbrtowc mkstemp mktime progname propername rawmemchr readme-release regex sh-quote signal stat stat-macros stat-time stdint strcase strftime strptime strtoumax sys_wait system-quote unistd unlocked-io update-copyright vararrays verify version-etc version-etc-fsf wcwidth xalloc xfreopen xreadlink xstrtoumax xvasprintf + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +am__rm_f = rm -f $(am__rm_f_notfound) +am__rm_rf = rm -rf $(am__rm_f_notfound) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE@am__append_1 = unistr/u8-mbtoucr.c +@LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE@am__append_2 = unistr/u8-uctomb.c unistr/u8-uctomb-aux.c +@LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE@am__append_3 = uniwidth/width.c +subdir = lib +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ + $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \ + $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/btowc.m4 \ + $(top_srcdir)/m4/builtin-expect.m4 $(top_srcdir)/m4/c-stack.m4 \ + $(top_srcdir)/m4/clock_time.m4 $(top_srcdir)/m4/close.m4 \ + $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \ + $(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/ctype.m4 \ + $(top_srcdir)/m4/dirname.m4 \ + $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/extensions.m4 \ + $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fcntl-o.m4 \ + $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/filenamecat.m4 \ + $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \ + $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpieee.m4 \ + $(top_srcdir)/m4/freopen.m4 $(top_srcdir)/m4/fstat.m4 \ + $(top_srcdir)/m4/ftruncate.m4 $(top_srcdir)/m4/getcwd.m4 \ + $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/getpagesize.m4 \ + $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnu-make.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 \ + $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \ + $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \ + $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttostr.m4 \ + $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \ + $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \ + $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/iswblank.m4 \ + $(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ + $(top_srcdir)/m4/libunistring-base.m4 \ + $(top_srcdir)/m4/limits-h.m4 $(top_srcdir)/m4/localcharset.m4 \ + $(top_srcdir)/m4/locale-fr.m4 $(top_srcdir)/m4/locale-ja.m4 \ + $(top_srcdir)/m4/locale-tr.m4 $(top_srcdir)/m4/locale-zh.m4 \ + $(top_srcdir)/m4/locale_h.m4 $(top_srcdir)/m4/localeconv.m4 \ + $(top_srcdir)/m4/localtime-buffer.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ + $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/mbchar.m4 \ + $(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbslen.m4 \ + $(top_srcdir)/m4/mbsrtowcs.m4 $(top_srcdir)/m4/mbstate_t.m4 \ + $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \ + $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mkstemp.m4 \ + $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/mmap-anon.m4 \ + $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \ + $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \ + $(top_srcdir)/m4/nanosleep.m4 $(top_srcdir)/m4/netinet_in_h.m4 \ + $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \ + $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ + $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \ + $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/regex.m4 \ + $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/setlocale.m4 \ + $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/signalblocking.m4 \ + $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/socketlib.m4 \ + $(top_srcdir)/m4/sockets.m4 $(top_srcdir)/m4/socklen.m4 \ + $(top_srcdir)/m4/sockpfaf.m4 $(top_srcdir)/m4/ssize_t.m4 \ + $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \ + $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \ + $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/strcase.m4 $(top_srcdir)/m4/strerror.m4 \ + $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/strftime.m4 \ + $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strings_h.m4 \ + $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ + $(top_srcdir)/m4/strptime.m4 $(top_srcdir)/m4/strtoull.m4 \ + $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/symlink.m4 \ + $(top_srcdir)/m4/sys_ioctl_h.m4 \ + $(top_srcdir)/m4/sys_select_h.m4 \ + $(top_srcdir)/m4/sys_socket_h.m4 \ + $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ + $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \ + $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \ + $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \ + $(top_srcdir)/m4/time_rz.m4 $(top_srcdir)/m4/timegm.m4 \ + $(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \ + $(top_srcdir)/m4/tzset.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vararrays.m4 \ + $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vasprintf.m4 \ + $(top_srcdir)/m4/version-etc.m4 \ + $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \ + $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ + $(top_srcdir)/m4/wctomb.m4 $(top_srcdir)/m4/wctype_h.m4 \ + $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \ + $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xstrtol.m4 \ + $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ + $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LIBRARIES = $(noinst_LIBRARIES) +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +libdiffutils_a_AR = $(AR) $(ARFLAGS) +libdiffutils_a_RANLIB = $(RANLIB) +am__DEPENDENCIES_1 = +am__libdiffutils_a_SOURCES_DIST = allocator.c areadlink.c argmatch.c \ + binary-io.h binary-io.c bitrotate.h bitrotate.c c-ctype.h \ + c-ctype.c c-stack.h c-stack.c c-strcase.h c-strcasecmp.c \ + c-strncasecmp.c careadlinkat.c diffseq.h dirname.c basename.c \ + dirname-lgpl.c basename-lgpl.c stripslash.c exclude.c \ + exitfail.c fd-hook.c file-type.c filenamecat.c \ + filenamecat-lgpl.c freopen-safer.c getprogname.h getprogname.c \ + gettext.h gettime.c hard-locale.c hash.c imaxtostr.c \ + inttostr.c offtostr.c uinttostr.c umaxtostr.c localcharset.h \ + localcharset.c malloca.c mbchar.c mbiter.h mbiter.c \ + mbscasecmp.c mbslen.c mbsstr.c mbuiter.h mbuiter.c minmax.h \ + progname.h progname.c propername.h propername.c quotearg.c \ + sh-quote.h sh-quote.c sig-handler.c size_max.h stat-time.c \ + strftime.c striconv.h striconv.c strnlen1.h strnlen1.c \ + system-quote.h system-quote.c tempname.c timespec.c trim.c \ + unistd.c unistr/u8-mbtoucr.c unistr/u8-uctomb.c \ + unistr/u8-uctomb-aux.c uniwidth/width.c version-etc.h \ + version-etc.c version-etc-fsf.c wctype-h.c xmalloc.c \ + xalloc-die.c xfreopen.c xfreopen.h xreadlink.c xsize.h xsize.c \ + xstriconv.h xstriconv.c xstrndup.h xstrndup.c xstrtol.c \ + xstrtoul.c xstrtol-error.c xstrtoumax.c xvasprintf.h \ + xvasprintf.c xasprintf.c cmpbuf.c prepargs.c +am__dirstamp = $(am__leading_dot)dirstamp +@LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE@am__objects_1 = unistr/u8-mbtoucr.$(OBJEXT) +@LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE@am__objects_2 = unistr/u8-uctomb.$(OBJEXT) \ +@LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE@ unistr/u8-uctomb-aux.$(OBJEXT) +@LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE@am__objects_3 = uniwidth/width.$(OBJEXT) +am_libdiffutils_a_OBJECTS = allocator.$(OBJEXT) areadlink.$(OBJEXT) \ + argmatch.$(OBJEXT) binary-io.$(OBJEXT) bitrotate.$(OBJEXT) \ + c-ctype.$(OBJEXT) c-stack.$(OBJEXT) c-strcasecmp.$(OBJEXT) \ + c-strncasecmp.$(OBJEXT) careadlinkat.$(OBJEXT) \ + dirname.$(OBJEXT) basename.$(OBJEXT) dirname-lgpl.$(OBJEXT) \ + basename-lgpl.$(OBJEXT) stripslash.$(OBJEXT) exclude.$(OBJEXT) \ + exitfail.$(OBJEXT) fd-hook.$(OBJEXT) file-type.$(OBJEXT) \ + filenamecat.$(OBJEXT) filenamecat-lgpl.$(OBJEXT) \ + freopen-safer.$(OBJEXT) getprogname.$(OBJEXT) \ + gettime.$(OBJEXT) hard-locale.$(OBJEXT) hash.$(OBJEXT) \ + imaxtostr.$(OBJEXT) inttostr.$(OBJEXT) offtostr.$(OBJEXT) \ + uinttostr.$(OBJEXT) umaxtostr.$(OBJEXT) localcharset.$(OBJEXT) \ + malloca.$(OBJEXT) mbchar.$(OBJEXT) mbiter.$(OBJEXT) \ + mbscasecmp.$(OBJEXT) mbslen.$(OBJEXT) mbsstr.$(OBJEXT) \ + mbuiter.$(OBJEXT) progname.$(OBJEXT) propername.$(OBJEXT) \ + quotearg.$(OBJEXT) sh-quote.$(OBJEXT) sig-handler.$(OBJEXT) \ + stat-time.$(OBJEXT) strftime.$(OBJEXT) striconv.$(OBJEXT) \ + strnlen1.$(OBJEXT) system-quote.$(OBJEXT) tempname.$(OBJEXT) \ + timespec.$(OBJEXT) trim.$(OBJEXT) unistd.$(OBJEXT) \ + $(am__objects_1) $(am__objects_2) $(am__objects_3) \ + version-etc.$(OBJEXT) version-etc-fsf.$(OBJEXT) \ + wctype-h.$(OBJEXT) xmalloc.$(OBJEXT) xalloc-die.$(OBJEXT) \ + xfreopen.$(OBJEXT) xreadlink.$(OBJEXT) xsize.$(OBJEXT) \ + xstriconv.$(OBJEXT) xstrndup.$(OBJEXT) xstrtol.$(OBJEXT) \ + xstrtoul.$(OBJEXT) xstrtol-error.$(OBJEXT) \ + xstrtoumax.$(OBJEXT) xvasprintf.$(OBJEXT) xasprintf.$(OBJEXT) \ + cmpbuf.$(OBJEXT) prepargs.$(OBJEXT) +libdiffutils_a_OBJECTS = $(am_libdiffutils_a_OBJECTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/alloca.Po ./$(DEPDIR)/allocator.Po \ + ./$(DEPDIR)/anytostr.Po ./$(DEPDIR)/areadlink.Po \ + ./$(DEPDIR)/argmatch.Po ./$(DEPDIR)/asnprintf.Po \ + ./$(DEPDIR)/asprintf.Po ./$(DEPDIR)/basename-lgpl.Po \ + ./$(DEPDIR)/basename.Po ./$(DEPDIR)/binary-io.Po \ + ./$(DEPDIR)/bitrotate.Po ./$(DEPDIR)/btowc.Po \ + ./$(DEPDIR)/c-ctype.Po ./$(DEPDIR)/c-stack.Po \ + ./$(DEPDIR)/c-strcasecmp.Po ./$(DEPDIR)/c-strncasecmp.Po \ + ./$(DEPDIR)/careadlinkat.Po ./$(DEPDIR)/close.Po \ + ./$(DEPDIR)/cmpbuf.Po ./$(DEPDIR)/dirname-lgpl.Po \ + ./$(DEPDIR)/dirname.Po ./$(DEPDIR)/dup2.Po \ + ./$(DEPDIR)/error.Po ./$(DEPDIR)/exclude.Po \ + ./$(DEPDIR)/exitfail.Po ./$(DEPDIR)/fcntl.Po \ + ./$(DEPDIR)/fd-hook.Po ./$(DEPDIR)/file-type.Po \ + ./$(DEPDIR)/filenamecat-lgpl.Po ./$(DEPDIR)/filenamecat.Po \ + ./$(DEPDIR)/float.Po ./$(DEPDIR)/fnmatch.Po \ + ./$(DEPDIR)/fnmatch_loop.Po ./$(DEPDIR)/freopen-safer.Po \ + ./$(DEPDIR)/freopen.Po ./$(DEPDIR)/fstat.Po \ + ./$(DEPDIR)/getdtablesize.Po ./$(DEPDIR)/getopt.Po \ + ./$(DEPDIR)/getopt1.Po ./$(DEPDIR)/getprogname.Po \ + ./$(DEPDIR)/gettime.Po ./$(DEPDIR)/gettimeofday.Po \ + ./$(DEPDIR)/hard-locale.Po ./$(DEPDIR)/hash.Po \ + ./$(DEPDIR)/iconv.Po ./$(DEPDIR)/iconv_close.Po \ + ./$(DEPDIR)/iconv_open.Po ./$(DEPDIR)/imaxtostr.Po \ + ./$(DEPDIR)/inttostr.Po ./$(DEPDIR)/isblank.Po \ + ./$(DEPDIR)/iswblank.Po ./$(DEPDIR)/itold.Po \ + ./$(DEPDIR)/localcharset.Po ./$(DEPDIR)/localeconv.Po \ + ./$(DEPDIR)/localtime-buffer.Po ./$(DEPDIR)/lstat.Po \ + ./$(DEPDIR)/malloc.Po ./$(DEPDIR)/malloca.Po \ + ./$(DEPDIR)/mbchar.Po ./$(DEPDIR)/mbiter.Po \ + ./$(DEPDIR)/mbrtowc.Po ./$(DEPDIR)/mbscasecmp.Po \ + ./$(DEPDIR)/mbsinit.Po ./$(DEPDIR)/mbslen.Po \ + ./$(DEPDIR)/mbsrtowcs-state.Po ./$(DEPDIR)/mbsrtowcs.Po \ + ./$(DEPDIR)/mbsstr.Po ./$(DEPDIR)/mbtowc.Po \ + ./$(DEPDIR)/mbuiter.Po ./$(DEPDIR)/memchr.Po \ + ./$(DEPDIR)/mkstemp.Po ./$(DEPDIR)/mktime.Po \ + ./$(DEPDIR)/msvc-inval.Po ./$(DEPDIR)/msvc-nothrow.Po \ + ./$(DEPDIR)/nl_langinfo.Po ./$(DEPDIR)/offtostr.Po \ + ./$(DEPDIR)/open.Po ./$(DEPDIR)/prepargs.Po \ + ./$(DEPDIR)/printf-args.Po ./$(DEPDIR)/printf-parse.Po \ + ./$(DEPDIR)/progname.Po ./$(DEPDIR)/propername.Po \ + ./$(DEPDIR)/quotearg.Po ./$(DEPDIR)/raise.Po \ + ./$(DEPDIR)/rawmemchr.Po ./$(DEPDIR)/readlink.Po \ + ./$(DEPDIR)/regcomp.Po ./$(DEPDIR)/regex.Po \ + ./$(DEPDIR)/regex_internal.Po ./$(DEPDIR)/regexec.Po \ + ./$(DEPDIR)/secure_getenv.Po ./$(DEPDIR)/setenv.Po \ + ./$(DEPDIR)/sh-quote.Po ./$(DEPDIR)/sig-handler.Po \ + ./$(DEPDIR)/sigaction.Po ./$(DEPDIR)/sigprocmask.Po \ + ./$(DEPDIR)/stat-time.Po ./$(DEPDIR)/stat-w32.Po \ + ./$(DEPDIR)/stat.Po ./$(DEPDIR)/strcasecmp.Po \ + ./$(DEPDIR)/strerror-override.Po ./$(DEPDIR)/strerror.Po \ + ./$(DEPDIR)/strftime.Po ./$(DEPDIR)/striconv.Po \ + ./$(DEPDIR)/stripslash.Po ./$(DEPDIR)/strncasecmp.Po \ + ./$(DEPDIR)/strndup.Po ./$(DEPDIR)/strnlen.Po \ + ./$(DEPDIR)/strnlen1.Po ./$(DEPDIR)/strptime.Po \ + ./$(DEPDIR)/strtoimax.Po ./$(DEPDIR)/strtol.Po \ + ./$(DEPDIR)/strtoul.Po ./$(DEPDIR)/strtoull.Po \ + ./$(DEPDIR)/strtoumax.Po ./$(DEPDIR)/system-quote.Po \ + ./$(DEPDIR)/tempname.Po ./$(DEPDIR)/time_r.Po \ + ./$(DEPDIR)/time_rz.Po ./$(DEPDIR)/timegm.Po \ + ./$(DEPDIR)/timespec.Po ./$(DEPDIR)/trim.Po \ + ./$(DEPDIR)/tzset.Po ./$(DEPDIR)/uinttostr.Po \ + ./$(DEPDIR)/umaxtostr.Po ./$(DEPDIR)/unistd.Po \ + ./$(DEPDIR)/unsetenv.Po ./$(DEPDIR)/vasnprintf.Po \ + ./$(DEPDIR)/vasprintf.Po ./$(DEPDIR)/version-etc-fsf.Po \ + ./$(DEPDIR)/version-etc.Po ./$(DEPDIR)/wcrtomb.Po \ + ./$(DEPDIR)/wctype-h.Po ./$(DEPDIR)/wcwidth.Po \ + ./$(DEPDIR)/xalloc-die.Po ./$(DEPDIR)/xasprintf.Po \ + ./$(DEPDIR)/xfreopen.Po ./$(DEPDIR)/xmalloc.Po \ + ./$(DEPDIR)/xreadlink.Po ./$(DEPDIR)/xsize.Po \ + ./$(DEPDIR)/xstriconv.Po ./$(DEPDIR)/xstrndup.Po \ + ./$(DEPDIR)/xstrtol-error.Po ./$(DEPDIR)/xstrtol.Po \ + ./$(DEPDIR)/xstrtoul.Po ./$(DEPDIR)/xstrtoumax.Po \ + ./$(DEPDIR)/xvasprintf.Po unistr/$(DEPDIR)/u8-mbtoucr.Po \ + unistr/$(DEPDIR)/u8-uctomb-aux.Po \ + unistr/$(DEPDIR)/u8-uctomb.Po uniwidth/$(DEPDIR)/width.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libdiffutils_a_SOURCES) $(EXTRA_libdiffutils_a_SOURCES) +DIST_SOURCES = $(am__libdiffutils_a_SOURCES_DIST) \ + $(EXTRA_libdiffutils_a_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ + config.hin +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.hin \ + $(srcdir)/gnulib.mk $(top_srcdir)/build-aux/depcomp alloca.c +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkglibexecdir = @pkglibexecdir@ +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_INCLUDE = @CONFIG_INCLUDE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ +EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ +ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ +ENOLINK_VALUE = @ENOLINK_VALUE@ +EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ +EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ +ERRNO_H = @ERRNO_H@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FLOAT_H = @FLOAT_H@ +FNMATCH_H = @FNMATCH_H@ +GETOPT_CDEFS_H = @GETOPT_CDEFS_H@ +GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIBC21 = @GLIBC21@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ +GNULIB_CHDIR = @GNULIB_CHDIR@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_CTIME = @GNULIB_CTIME@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ +GNULIB_DUP = @GNULIB_DUP@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_DUP3 = @GNULIB_DUP3@ +GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ +GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ +GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ +GNULIB_FCNTL = @GNULIB_FCNTL@ +GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ +GNULIB_FDOPEN = @GNULIB_FDOPEN@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FFS = @GNULIB_FFS@ +GNULIB_FFSL = @GNULIB_FFSL@ +GNULIB_FFSLL = @GNULIB_FFSLL@ +GNULIB_FGETC = @GNULIB_FGETC@ +GNULIB_FGETS = @GNULIB_FGETS@ +GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPURGE = @GNULIB_FPURGE@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ +GNULIB_FREAD = @GNULIB_FREAD@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ +GNULIB_FSCANF = @GNULIB_FSCANF@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSTAT = @GNULIB_FSTAT@ +GNULIB_FSTATAT = @GNULIB_FSTATAT@ +GNULIB_FSYNC = @GNULIB_FSYNC@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETC = @GNULIB_GETC@ +GNULIB_GETCHAR = @GNULIB_GETCHAR@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ +GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ +GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ +GNULIB_GRANTPT = @GNULIB_GRANTPT@ +GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ +GNULIB_ICONV = @GNULIB_ICONV@ +GNULIB_IMAXABS = @GNULIB_IMAXABS@ +GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ +GNULIB_IOCTL = @GNULIB_IOCTL@ +GNULIB_ISATTY = @GNULIB_ISATTY@ +GNULIB_ISBLANK = @GNULIB_ISBLANK@ +GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ +GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LINKAT = @GNULIB_LINKAT@ +GNULIB_LISTEN = @GNULIB_LISTEN@ +GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ +GNULIB_LOCALTIME = @GNULIB_LOCALTIME@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MBTOWC = @GNULIB_MBTOWC@ +GNULIB_MEMCHR = @GNULIB_MEMCHR@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKFIFO = @GNULIB_MKFIFO@ +GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ +GNULIB_MKNOD = @GNULIB_MKNOD@ +GNULIB_MKNODAT = @GNULIB_MKNODAT@ +GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ +GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ +GNULIB_MKTIME = @GNULIB_MKTIME@ +GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ +GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ +GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_OPENAT = @GNULIB_OPENAT@ +GNULIB_OVERRIDES_STRUCT_STAT = @GNULIB_OVERRIDES_STRUCT_STAT@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ +GNULIB_PCLOSE = @GNULIB_PCLOSE@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PIPE = @GNULIB_PIPE@ +GNULIB_PIPE2 = @GNULIB_PIPE2@ +GNULIB_POPEN = @GNULIB_POPEN@ +GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ +GNULIB_PREAD = @GNULIB_PREAD@ +GNULIB_PRINTF = @GNULIB_PRINTF@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PSELECT = @GNULIB_PSELECT@ +GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ +GNULIB_PTSNAME = @GNULIB_PTSNAME@ +GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ +GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ +GNULIB_RAISE = @GNULIB_RAISE@ +GNULIB_RANDOM = @GNULIB_RANDOM@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ +GNULIB_READ = @GNULIB_READ@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_READLINKAT = @GNULIB_READLINKAT@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_REALPATH = @GNULIB_REALPATH@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ +GNULIB_REMOVE = @GNULIB_REMOVE@ +GNULIB_RENAME = @GNULIB_RENAME@ +GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ +GNULIB_RMDIR = @GNULIB_RMDIR@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SCANF = @GNULIB_SCANF@ +GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ +GNULIB_SELECT = @GNULIB_SELECT@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ +GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ +GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ +GNULIB_SIGACTION = @GNULIB_SIGACTION@ +GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ +GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STAT = @GNULIB_STAT@ +GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ +GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ +GNULIB_STRFTIME = @GNULIB_STRFTIME@ +GNULIB_STRNCAT = @GNULIB_STRNCAT@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRPTIME = @GNULIB_STRPTIME@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ +GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ +GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ +GNULIB_SYMLINK = @GNULIB_SYMLINK@ +GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ +GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ +GNULIB_TIMEGM = @GNULIB_TIMEGM@ +GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ +GNULIB_TMPFILE = @GNULIB_TMPFILE@ +GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ +GNULIB_TRUNCATE = @GNULIB_TRUNCATE@ +GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ +GNULIB_TZSET = @GNULIB_TZSET@ +GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ +GNULIB_UNLINK = @GNULIB_UNLINK@ +GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ +GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ +GNULIB_USLEEP = @GNULIB_USLEEP@ +GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VFSCANF = @GNULIB_VFSCANF@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSCANF = @GNULIB_VSCANF@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WAITPID = @GNULIB_WAITPID@ +GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@ +GNULIB_WCPCPY = @GNULIB_WCPCPY@ +GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ +GNULIB_WCSCAT = @GNULIB_WCSCAT@ +GNULIB_WCSCHR = @GNULIB_WCSCHR@ +GNULIB_WCSCMP = @GNULIB_WCSCMP@ +GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ +GNULIB_WCSCPY = @GNULIB_WCSCPY@ +GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ +GNULIB_WCSDUP = @GNULIB_WCSDUP@ +GNULIB_WCSFTIME = @GNULIB_WCSFTIME@ +GNULIB_WCSLEN = @GNULIB_WCSLEN@ +GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ +GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ +GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ +GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ +GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ +GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCSSPN = @GNULIB_WCSSPN@ +GNULIB_WCSSTR = @GNULIB_WCSSTR@ +GNULIB_WCSTOK = @GNULIB_WCSTOK@ +GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ +GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ +GNULIB_WCTOB = @GNULIB_WCTOB@ +GNULIB_WCTOMB = @GNULIB_WCTOMB@ +GNULIB_WCTRANS = @GNULIB_WCTRANS@ +GNULIB_WCTYPE = @GNULIB_WCTYPE@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ +GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ +GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ +GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ +GNULIB_WMEMSET = @GNULIB_WMEMSET@ +GNULIB_WRITE = @GNULIB_WRITE@ +GNULIB__EXIT = @GNULIB__EXIT@ +HAVE_ACCEPT4 = @HAVE_ACCEPT4@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ +HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ +HAVE_CHOWN = @HAVE_CHOWN@ +HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ +HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ +HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ +HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ +HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ +HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ +HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ +HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_DUP3 = @HAVE_DUP3@ +HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_FACCESSAT = @HAVE_FACCESSAT@ +HAVE_FCHDIR = @HAVE_FCHDIR@ +HAVE_FCHMODAT = @HAVE_FCHMODAT@ +HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FCNTL = @HAVE_FCNTL@ +HAVE_FDATASYNC = @HAVE_FDATASYNC@ +HAVE_FEATURES_H = @HAVE_FEATURES_H@ +HAVE_FFS = @HAVE_FFS@ +HAVE_FFSL = @HAVE_FFSL@ +HAVE_FFSLL = @HAVE_FFSLL@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSTATAT = @HAVE_FSTATAT@ +HAVE_FSYNC = @HAVE_FSYNC@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_FUTIMENS = @HAVE_FUTIMENS@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETGROUPS = @HAVE_GETGROUPS@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ +HAVE_GETLOGIN = @HAVE_GETLOGIN@ +HAVE_GETOPT_H = @HAVE_GETOPT_H@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ +HAVE_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISBLANK = @HAVE_ISBLANK@ +HAVE_ISWBLANK = @HAVE_ISWBLANK@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ +HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ +HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ +HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ +HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LCHOWN = @HAVE_LCHOWN@ +HAVE_LIBSIGSEGV = @HAVE_LIBSIGSEGV@ +HAVE_LINK = @HAVE_LINK@ +HAVE_LINKAT = @HAVE_LINKAT@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSLEN = @HAVE_MBSLEN@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ +HAVE_MEMCHR = @HAVE_MEMCHR@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDIRAT = @HAVE_MKDIRAT@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_MKFIFO = @HAVE_MKFIFO@ +HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ +HAVE_MKNOD = @HAVE_MKNOD@ +HAVE_MKNODAT = @HAVE_MKNODAT@ +HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ +HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ +HAVE_MKSTEMP = @HAVE_MKSTEMP@ +HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ +HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ +HAVE_OPENAT = @HAVE_OPENAT@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_PCLOSE = @HAVE_PCLOSE@ +HAVE_PIPE = @HAVE_PIPE@ +HAVE_PIPE2 = @HAVE_PIPE2@ +HAVE_POPEN = @HAVE_POPEN@ +HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ +HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_PREAD = @HAVE_PREAD@ +HAVE_PSELECT = @HAVE_PSELECT@ +HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ +HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ +HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ +HAVE_RAISE = @HAVE_RAISE@ +HAVE_RANDOM = @HAVE_RANDOM@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_READLINKAT = @HAVE_READLINKAT@ +HAVE_REALPATH = @HAVE_REALPATH@ +HAVE_RENAMEAT = @HAVE_RENAMEAT@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ +HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SIGACTION = @HAVE_SIGACTION@ +HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ +HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ +HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ +HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ +HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_SIGSET_T = @HAVE_SIGSET_T@ +HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STPCPY = @HAVE_STPCPY@ +HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ +HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRINGS_H = @HAVE_STRINGS_H@ +HAVE_STRPBRK = @HAVE_STRPBRK@ +HAVE_STRPTIME = @HAVE_STRPTIME@ +HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ +HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ +HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ +HAVE_SYMLINK = @HAVE_SYMLINK@ +HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@ +HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ +HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ +HAVE_TRUNCATE = @HAVE_TRUNCATE@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ +HAVE_TZSET = @HAVE_TZSET@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNLINKAT = @HAVE_UNLINKAT@ +HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_USLEEP = @HAVE_USLEEP@ +HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCHAR_T = @HAVE_WCHAR_T@ +HAVE_WCPCPY = @HAVE_WCPCPY@ +HAVE_WCPNCPY = @HAVE_WCPNCPY@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ +HAVE_WCSCAT = @HAVE_WCSCAT@ +HAVE_WCSCHR = @HAVE_WCSCHR@ +HAVE_WCSCMP = @HAVE_WCSCMP@ +HAVE_WCSCOLL = @HAVE_WCSCOLL@ +HAVE_WCSCPY = @HAVE_WCSCPY@ +HAVE_WCSCSPN = @HAVE_WCSCSPN@ +HAVE_WCSDUP = @HAVE_WCSDUP@ +HAVE_WCSFTIME = @HAVE_WCSFTIME@ +HAVE_WCSLEN = @HAVE_WCSLEN@ +HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ +HAVE_WCSNCAT = @HAVE_WCSNCAT@ +HAVE_WCSNCMP = @HAVE_WCSNCMP@ +HAVE_WCSNCPY = @HAVE_WCSNCPY@ +HAVE_WCSNLEN = @HAVE_WCSNLEN@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSPBRK = @HAVE_WCSPBRK@ +HAVE_WCSRCHR = @HAVE_WCSRCHR@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ +HAVE_WCSSPN = @HAVE_WCSSPN@ +HAVE_WCSSTR = @HAVE_WCSSTR@ +HAVE_WCSTOK = @HAVE_WCSTOK@ +HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ +HAVE_WCSXFRM = @HAVE_WCSXFRM@ +HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE_WMEMCHR = @HAVE_WMEMCHR@ +HAVE_WMEMCMP = @HAVE_WMEMCMP@ +HAVE_WMEMCPY = @HAVE_WMEMCPY@ +HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ +HAVE_WMEMSET = @HAVE_WMEMSET@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ +HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ +HAVE__BOOL = @HAVE__BOOL@ +HAVE__EXIT = @HAVE__EXIT@ +HELP2MAN = @HELP2MAN@ +ICONV_CONST = @ICONV_CONST@ +ICONV_H = @ICONV_H@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ +INET_PTON_LIB = @INET_PTON_LIB@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ +INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBCSTACK = @LIBCSTACK@ +LIBDIFFUTILS_LIBDEPS = @LIBDIFFUTILS_LIBDEPS@ +LIBDIFFUTILS_LTLIBDEPS = @LIBDIFFUTILS_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSIGSEGV = @LIBSIGSEGV@ +LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@ +LIBSOCKET = @LIBSOCKET@ +LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ +LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@ +LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@ +LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIB_NANOSLEEP = @LIB_NANOSLEEP@ +LIB_SELECT = @LIB_SELECT@ +LIMITS_H = @LIMITS_H@ +LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ +LTLIBCSTACK = @LTLIBCSTACK@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBSIGSEGV = @LTLIBSIGSEGV@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ +NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@ +NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ +NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ +NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@ +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ +NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ +NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ +NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ +NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ +NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ +NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ +NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@ +NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@ +NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ +NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ +NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ +NEXT_CTYPE_H = @NEXT_CTYPE_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_ICONV_H = @NEXT_ICONV_H@ +NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ +NEXT_LOCALE_H = @NEXT_LOCALE_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ +NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_STDARG_H = @NEXT_STDARG_H@ +NEXT_STDDEF_H = @NEXT_STDDEF_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ +NEXT_STDIO_H = @NEXT_STDIO_H@ +NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRINGS_H = @NEXT_STRINGS_H@ +NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@ +NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@ +NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ +NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ +NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ +NEXT_TIME_H = @NEXT_TIME_H@ +NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ +NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSUB = @POSUB@ +PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ +PR_PROGRAM = @PR_PROGRAM@ +PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ +REPLACE_CALLOC = @REPLACE_CALLOC@ +REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_CTIME = @REPLACE_CTIME@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ +REPLACE_DUP = @REPLACE_DUP@ +REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ +REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FCNTL = @REPLACE_FCNTL@ +REPLACE_FDOPEN = @REPLACE_FDOPEN@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FSTAT = @REPLACE_FSTAT@ +REPLACE_FSTATAT = @REPLACE_FSTATAT@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ +REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETDELIM = @REPLACE_GETDELIM@ +REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ +REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@ +REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_GMTIME = @REPLACE_GMTIME@ +REPLACE_ICONV = @REPLACE_ICONV@ +REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@ +REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@ +REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ +REPLACE_INET_PTON = @REPLACE_INET_PTON@ +REPLACE_IOCTL = @REPLACE_IOCTL@ +REPLACE_ISATTY = @REPLACE_ISATTY@ +REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ +REPLACE_ITOLD = @REPLACE_ITOLD@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LINK = @REPLACE_LINK@ +REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ +REPLACE_LOCALTIME = @REPLACE_LOCALTIME@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MALLOC = @REPLACE_MALLOC@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MBTOWC = @REPLACE_MBTOWC@ +REPLACE_MEMCHR = @REPLACE_MEMCHR@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKDIR = @REPLACE_MKDIR@ +REPLACE_MKFIFO = @REPLACE_MKFIFO@ +REPLACE_MKNOD = @REPLACE_MKNOD@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_MKTIME = @REPLACE_MKTIME@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ +REPLACE_NULL = @REPLACE_NULL@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ +REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POPEN = @REPLACE_POPEN@ +REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PSELECT = @REPLACE_PSELECT@ +REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ +REPLACE_PTSNAME = @REPLACE_PTSNAME@ +REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ +REPLACE_RAISE = @REPLACE_RAISE@ +REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ +REPLACE_READ = @REPLACE_READ@ +REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ +REPLACE_REALLOC = @REPLACE_REALLOC@ +REPLACE_REALPATH = @REPLACE_REALPATH@ +REPLACE_REMOVE = @REPLACE_REMOVE@ +REPLACE_RENAME = @REPLACE_RENAME@ +REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ +REPLACE_RMDIR = @REPLACE_RMDIR@ +REPLACE_SELECT = @REPLACE_SELECT@ +REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ +REPLACE_SLEEP = @REPLACE_SLEEP@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STAT = @REPLACE_STAT@ +REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ +REPLACE_STPNCPY = @REPLACE_STPNCPY@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ +REPLACE_STRDUP = @REPLACE_STRDUP@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ +REPLACE_STRFTIME = @REPLACE_STRFTIME@ +REPLACE_STRNCAT = @REPLACE_STRNCAT@ +REPLACE_STRNDUP = @REPLACE_STRNDUP@ +REPLACE_STRNLEN = @REPLACE_STRNLEN@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ +REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ +REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ +REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ +REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ +REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TMPFILE = @REPLACE_TMPFILE@ +REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ +REPLACE_TRUNCATE = @REPLACE_TRUNCATE@ +REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ +REPLACE_TZSET = @REPLACE_TZSET@ +REPLACE_UNLINK = @REPLACE_UNLINK@ +REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ +REPLACE_UNSETENV = @REPLACE_UNSETENV@ +REPLACE_USLEEP = @REPLACE_USLEEP@ +REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSFTIME = @REPLACE_WCSFTIME@ +REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ +REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCTOMB = @REPLACE_WCTOMB@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SRC_VERSION_C = @SRC_VERSION_C@ +STDALIGN_H = @STDALIGN_H@ +STDARG_H = @STDARG_H@ +STDBOOL_H = @STDBOOL_H@ +STDDEF_H = @STDDEF_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@ +SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ +UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ +UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WERROR_CFLAGS = @WERROR_CFLAGS@ +WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ +WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@ +WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_aux_dir = @abs_aux_dir@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__rm_f_notfound = @am__rm_f_notfound@ +am__tar = @am__tar@ +am__untar = @am__untar@ +am__xargs_n = @am__xargs_n@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ +gltests_WITNESS = @gltests_WITNESS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +lispdir = @lispdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CFLAGS = $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) +BUILT_SOURCES = $(ALLOCA_H) configmake.h ctype.h $(ERRNO_H) fcntl.h \ + $(FLOAT_H) $(FNMATCH_H) $(GETOPT_H) $(GETOPT_CDEFS_H) \ + $(ICONV_H) iconv_open-aix.h iconv_open-hpux.h \ + iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h \ + inttypes.h langinfo.h $(LIMITS_H) locale.h signal.h \ + $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h \ + stdlib.h string.h strings.h sys/stat.h sys/time.h sys/types.h \ + sys/wait.h time.h unistd.h $(LIBUNISTRING_UNISTR_H) \ + $(LIBUNISTRING_UNITYPES_H) $(LIBUNISTRING_UNIWIDTH_H) wchar.h \ + wctype.h +CLEANFILES = configmake.h configmake.h-t charset.alias ref-add.sed \ + ref-del.sed + +#if GNU_MAKE +# [nicer features that work only with GNU Make] +#else +# [fallback features that work in any 'make' implementation; see +# http://www.opengroup.org/susv3/utilities/make.html +# for the 2004 POSIX specification] +#endif +EXTRA_DIST = alloca.c alloca.in.h allocator.h \ + $(top_srcdir)/build-aux/announce-gen areadlink.h argmatch.h \ + assure.h btowc.c c-strcaseeq.h careadlinkat.h close.c \ + ctype.in.h stripslash.c dirname.h \ + $(top_srcdir)/build-aux/do-release-commit-and-tag dosname.h \ + dup2.c errno.in.h error.c error.h exclude.h exitfail.h fcntl.c \ + fcntl.in.h fd-hook.h file-type.h filename.h filenamecat.h \ + flexmember.h float.c float.in.h itold.c fnmatch.c fnmatch.in.h \ + fnmatch_loop.c freopen.c stdio--.h stdio-safer.h fstat.c \ + stat-w32.c stat-w32.h $(top_srcdir)/build-aux/gendocs.sh \ + getdtablesize.c getopt-cdefs.in.h getopt-core.h getopt-ext.h \ + getopt-pfx-core.h getopt-pfx-ext.h getopt.c getopt.in.h \ + getopt1.c getopt_int.h gettimeofday.c \ + $(top_srcdir)/build-aux/git-version-gen \ + $(top_srcdir)/build-aux/gitlog-to-changelog \ + $(top_srcdir)/build-aux/gnu-web-doc-update \ + $(top_srcdir)/GNUmakefile $(top_srcdir)/build-aux/gnupload \ + hard-locale.h hash.h $(top_srcdir)/build-aux/config.rpath \ + iconv.in.h iconv_open-aix.h iconv_open-hpux.h \ + iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h \ + iconv.c iconv_close.c iconv_open-aix.gperf \ + iconv_open-hpux.gperf iconv_open-irix.gperf \ + iconv_open-osf.gperf iconv_open-solaris.gperf iconv_open.c \ + ignore-value.h intprops.h anytostr.c inttostr.h inttypes.in.h \ + isblank.c iswblank.c langinfo.in.h limits.in.h config.charset \ + ref-add.sin ref-del.sin locale.in.h localeconv.c \ + localtime-buffer.c localtime-buffer.h lstat.c \ + $(top_srcdir)/maint.mk malloc.c malloca.h malloca.valgrind \ + mbchar.h mbrtowc.c mbsinit.c mbsrtowcs-impl.h \ + mbsrtowcs-state.c mbsrtowcs.c str-kmp.h mbtowc-impl.h mbtowc.c \ + memchr.c memchr.valgrind mkstemp.c mktime-internal.h mktime.c \ + mktime-internal.h mktime.c msvc-inval.c msvc-inval.h \ + msvc-nothrow.c msvc-nothrow.h nl_langinfo.c open.c pathmax.h \ + quote.h quote.h quotearg.h raise.c rawmemchr.c \ + rawmemchr.valgrind readlink.c regcomp.c regex.c regex.h \ + regex_internal.c regex_internal.h regexec.c secure_getenv.c \ + setenv.c sig-handler.h sigaction.c signal.in.h sigprocmask.c \ + _Noreturn.h arg-nonnull.h c++defs.h unused-parameter.h \ + warn-on-use.h stat-w32.c stat-w32.h stat.c stat-macros.h \ + stat-time.h stdarg.in.h stdbool.in.h stddef.in.h stdint.in.h \ + stdio.in.h stdlib.in.h strcasecmp.c strncasecmp.c streq.h \ + strerror.c strerror-override.c strerror-override.h strftime.h \ + string.in.h strings.in.h strndup.c strnlen.c strptime.c \ + strtol.c strtoul.c strtoull.c strtoimax.c strtoumax.c \ + sys_stat.in.h sys_time.in.h sys_types.in.h sys_wait.in.h \ + tempname.h time.in.h time_r.c time-internal.h time_rz.c \ + mktime-internal.h timegm.c timespec.h trim.h tzset.c \ + unistd.in.h unistr.in.h unitypes.in.h localcharset.h \ + uniwidth.in.h uniwidth/cjk.h unlocked-io.h unsetenv.c \ + $(top_srcdir)/build-aux/update-copyright \ + $(top_srcdir)/build-aux/useless-if-before-free asnprintf.c \ + float+.h printf-args.c printf-args.h printf-parse.c \ + printf-parse.h vasnprintf.c vasnprintf.h asprintf.c \ + vasprintf.c $(top_srcdir)/build-aux/vc-list-files verify.h \ + wchar.in.h wcrtomb.c wctype.in.h wcwidth.c xalloc.h \ + xalloc-oversized.h xreadlink.h xstrtol.h xalloc.h +MOSTLYCLEANDIRS = sys sys +MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t ctype.h \ + ctype.h-t errno.h errno.h-t fcntl.h fcntl.h-t float.h \ + float.h-t fnmatch.h fnmatch.h-t getopt.h getopt.h-t \ + getopt-cdefs.h getopt-cdefs.h-t iconv.h iconv.h-t \ + iconv_open-aix.h-t iconv_open-hpux.h-t iconv_open-irix.h-t \ + iconv_open-osf.h-t iconv_open-solaris.h-t inttypes.h \ + inttypes.h-t langinfo.h langinfo.h-t limits.h limits.h-t \ + locale.h locale.h-t signal.h signal.h-t stdarg.h stdarg.h-t \ + stdbool.h stdbool.h-t stddef.h stddef.h-t stdint.h stdint.h-t \ + stdio.h stdio.h-t stdlib.h stdlib.h-t string.h string.h-t \ + strings.h strings.h-t sys/stat.h sys/stat.h-t sys/time.h \ + sys/time.h-t sys/types.h sys/types.h-t sys/wait.h sys/wait.h-t \ + time.h time.h-t unistd.h unistd.h-t unistr.h unistr.h-t \ + unitypes.h unitypes.h-t uniwidth.h uniwidth.h-t wchar.h \ + wchar.h-t wctype.h wctype.h-t +MAINTAINERCLEANFILES = iconv_open-aix.h iconv_open-hpux.h \ + iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h +SUFFIXES = .sed .sin +# No GNU Make output. +noinst_LIBRARIES = libdiffutils.a +noinst_HEADERS = cmpbuf.h prepargs.h +libdiffutils_a_SOURCES = allocator.c areadlink.c argmatch.c \ + binary-io.h binary-io.c bitrotate.h bitrotate.c c-ctype.h \ + c-ctype.c c-stack.h c-stack.c c-strcase.h c-strcasecmp.c \ + c-strncasecmp.c careadlinkat.c diffseq.h dirname.c basename.c \ + dirname-lgpl.c basename-lgpl.c stripslash.c exclude.c \ + exitfail.c fd-hook.c file-type.c filenamecat.c \ + filenamecat-lgpl.c freopen-safer.c getprogname.h getprogname.c \ + gettext.h gettime.c hard-locale.c hash.c imaxtostr.c \ + inttostr.c offtostr.c uinttostr.c umaxtostr.c localcharset.h \ + localcharset.c malloca.c mbchar.c mbiter.h mbiter.c \ + mbscasecmp.c mbslen.c mbsstr.c mbuiter.h mbuiter.c minmax.h \ + progname.h progname.c propername.h propername.c quotearg.c \ + sh-quote.h sh-quote.c sig-handler.c size_max.h stat-time.c \ + strftime.c striconv.h striconv.c strnlen1.h strnlen1.c \ + system-quote.h system-quote.c tempname.c timespec.c trim.c \ + unistd.c $(am__append_1) $(am__append_2) $(am__append_3) \ + version-etc.h version-etc.c version-etc-fsf.c wctype-h.c \ + xmalloc.c xalloc-die.c xfreopen.c xfreopen.h xreadlink.c \ + xsize.h xsize.c xstriconv.h xstriconv.c xstrndup.h xstrndup.c \ + xstrtol.c xstrtoul.c xstrtol-error.c xstrtoumax.c xvasprintf.h \ + xvasprintf.c xasprintf.c cmpbuf.c prepargs.c +libdiffutils_a_LIBADD = $(gl_LIBOBJS) @ALLOCA@ +libdiffutils_a_DEPENDENCIES = $(gl_LIBOBJS) @ALLOCA@ +EXTRA_libdiffutils_a_SOURCES = alloca.c btowc.c close.c stripslash.c \ + dup2.c error.c fcntl.c float.c itold.c fnmatch.c \ + fnmatch_loop.c freopen.c fstat.c stat-w32.c getdtablesize.c \ + getopt.c getopt1.c gettimeofday.c iconv.c iconv_close.c \ + iconv_open.c anytostr.c isblank.c iswblank.c localeconv.c \ + localtime-buffer.c lstat.c malloc.c mbrtowc.c mbsinit.c \ + mbsrtowcs-state.c mbsrtowcs.c mbtowc.c memchr.c mkstemp.c \ + mktime.c mktime.c msvc-inval.c msvc-nothrow.c nl_langinfo.c \ + open.c raise.c rawmemchr.c readlink.c regcomp.c regex.c \ + regex_internal.c regexec.c secure_getenv.c setenv.c \ + sigaction.c sigprocmask.c stat-w32.c stat.c strcasecmp.c \ + strncasecmp.c strerror.c strerror-override.c strndup.c \ + strnlen.c strptime.c strtol.c strtoul.c strtoull.c strtoimax.c \ + strtoumax.c time_r.c time_rz.c timegm.c tzset.c unsetenv.c \ + asnprintf.c printf-args.c printf-parse.c vasnprintf.c \ + asprintf.c vasprintf.c wcrtomb.c wcwidth.c + +# Use this preprocessor expression to decide whether #include_next works. +# Do not rely on a 'configure'-time test for this, since the expression +# might appear in an installed header, which is used by some other compiler. +HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER) +GPERF = gperf +V_GPERF = $(V_GPERF_@AM_V@) +V_GPERF_ = $(V_GPERF_@AM_DEFAULT_V@) +V_GPERF_0 = @echo " GPERF " $@; +charset_alias = $(DESTDIR)$(libdir)/charset.alias +charset_tmp = $(DESTDIR)$(libdir)/charset.tmp + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. +_NORETURN_H = $(srcdir)/_Noreturn.h + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. +ARG_NONNULL_H = $(srcdir)/arg-nonnull.h + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. +CXXDEFS_H = $(srcdir)/c++defs.h + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. +UNUSED_PARAMETER_H = $(srcdir)/unused-parameter.h + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. +WARN_ON_USE_H = $(srcdir)/warn-on-use.h +all: $(BUILT_SOURCES) config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .sed .sin .c .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/gnulib.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; +$(srcdir)/gnulib.mk $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/config.hin $(top_builddir)/config.status + $(AM_V_at)rm -f stamp-h1 + $(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status lib/config.h +$(srcdir)/config.hin: $(am__configure_deps) + $(AM_V_GEN)($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + $(AM_V_at)rm -f stamp-h1 + $(AM_V_at)touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 + +clean-noinstLIBRARIES: + -$(am__rm_f) $(noinst_LIBRARIES) +unistr/$(am__dirstamp): + @$(MKDIR_P) unistr + @: >>unistr/$(am__dirstamp) +unistr/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) unistr/$(DEPDIR) + @: >>unistr/$(DEPDIR)/$(am__dirstamp) +unistr/u8-mbtoucr.$(OBJEXT): unistr/$(am__dirstamp) \ + unistr/$(DEPDIR)/$(am__dirstamp) +unistr/u8-uctomb.$(OBJEXT): unistr/$(am__dirstamp) \ + unistr/$(DEPDIR)/$(am__dirstamp) +unistr/u8-uctomb-aux.$(OBJEXT): unistr/$(am__dirstamp) \ + unistr/$(DEPDIR)/$(am__dirstamp) +uniwidth/$(am__dirstamp): + @$(MKDIR_P) uniwidth + @: >>uniwidth/$(am__dirstamp) +uniwidth/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) uniwidth/$(DEPDIR) + @: >>uniwidth/$(DEPDIR)/$(am__dirstamp) +uniwidth/width.$(OBJEXT): uniwidth/$(am__dirstamp) \ + uniwidth/$(DEPDIR)/$(am__dirstamp) + +libdiffutils.a: $(libdiffutils_a_OBJECTS) $(libdiffutils_a_DEPENDENCIES) $(EXTRA_libdiffutils_a_DEPENDENCIES) + $(AM_V_at)-rm -f libdiffutils.a + $(AM_V_AR)$(libdiffutils_a_AR) libdiffutils.a $(libdiffutils_a_OBJECTS) $(libdiffutils_a_LIBADD) + $(AM_V_at)$(libdiffutils_a_RANLIB) libdiffutils.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f unistr/*.$(OBJEXT) + -rm -f uniwidth/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloca.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/allocator.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anytostr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/areadlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argmatch.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asnprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename-lgpl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binary-io.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitrotate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btowc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-ctype.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-stack.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-strcasecmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-strncasecmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/careadlinkat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmpbuf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirname-lgpl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exclude.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exitfail.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd-hook.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file-type.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filenamecat-lgpl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filenamecat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/float.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnmatch.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnmatch_loop.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freopen-safer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freopen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdtablesize.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getprogname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettimeofday.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hard-locale.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconv_close.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconv_open.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imaxtostr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inttostr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isblank.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iswblank.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/itold.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localcharset.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localeconv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localtime-buffer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloca.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbchar.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbiter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbrtowc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbscasecmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsinit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbslen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsrtowcs-state.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsrtowcs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsstr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbtowc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbuiter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkstemp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msvc-inval.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msvc-nothrow.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nl_langinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/offtostr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prepargs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-args.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-parse.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/progname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/propername.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotearg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raise.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rawmemchr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regcomp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex_internal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regexec.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secure_getenv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setenv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh-quote.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sig-handler.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaction.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigprocmask.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat-time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat-w32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strcasecmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror-override.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strftime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/striconv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stripslash.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strncasecmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strndup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnlen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnlen1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strptime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoimax.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtol.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoul.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoull.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoumax.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/system-quote.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tempname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_r.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_rz.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timegm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timespec.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trim.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tzset.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uinttostr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umaxtostr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unistd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unsetenv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasnprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version-etc-fsf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version-etc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wcrtomb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wctype-h.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wcwidth.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xalloc-die.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xasprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfreopen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xreadlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsize.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstriconv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrndup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtol-error.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtol.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtoul.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtoumax.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xvasprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unistr/$(DEPDIR)/u8-mbtoucr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unistr/$(DEPDIR)/u8-uctomb-aux.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unistr/$(DEPDIR)/u8-uctomb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@uniwidth/$(DEPDIR)/width.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @: >>$@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LIBRARIES) $(HEADERS) config.h all-local +installdirs: +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -$(am__rm_f) $(MOSTLYCLEANFILES) + +clean-generic: + -$(am__rm_f) $(CLEANFILES) + +distclean-generic: + -$(am__rm_f) $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) + -$(am__rm_f) unistr/$(DEPDIR)/$(am__dirstamp) + -$(am__rm_f) unistr/$(am__dirstamp) + -$(am__rm_f) uniwidth/$(DEPDIR)/$(am__dirstamp) + -$(am__rm_f) uniwidth/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -$(am__rm_f) $(BUILT_SOURCES) + -$(am__rm_f) $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/alloca.Po + -rm -f ./$(DEPDIR)/allocator.Po + -rm -f ./$(DEPDIR)/anytostr.Po + -rm -f ./$(DEPDIR)/areadlink.Po + -rm -f ./$(DEPDIR)/argmatch.Po + -rm -f ./$(DEPDIR)/asnprintf.Po + -rm -f ./$(DEPDIR)/asprintf.Po + -rm -f ./$(DEPDIR)/basename-lgpl.Po + -rm -f ./$(DEPDIR)/basename.Po + -rm -f ./$(DEPDIR)/binary-io.Po + -rm -f ./$(DEPDIR)/bitrotate.Po + -rm -f ./$(DEPDIR)/btowc.Po + -rm -f ./$(DEPDIR)/c-ctype.Po + -rm -f ./$(DEPDIR)/c-stack.Po + -rm -f ./$(DEPDIR)/c-strcasecmp.Po + -rm -f ./$(DEPDIR)/c-strncasecmp.Po + -rm -f ./$(DEPDIR)/careadlinkat.Po + -rm -f ./$(DEPDIR)/close.Po + -rm -f ./$(DEPDIR)/cmpbuf.Po + -rm -f ./$(DEPDIR)/dirname-lgpl.Po + -rm -f ./$(DEPDIR)/dirname.Po + -rm -f ./$(DEPDIR)/dup2.Po + -rm -f ./$(DEPDIR)/error.Po + -rm -f ./$(DEPDIR)/exclude.Po + -rm -f ./$(DEPDIR)/exitfail.Po + -rm -f ./$(DEPDIR)/fcntl.Po + -rm -f ./$(DEPDIR)/fd-hook.Po + -rm -f ./$(DEPDIR)/file-type.Po + -rm -f ./$(DEPDIR)/filenamecat-lgpl.Po + -rm -f ./$(DEPDIR)/filenamecat.Po + -rm -f ./$(DEPDIR)/float.Po + -rm -f ./$(DEPDIR)/fnmatch.Po + -rm -f ./$(DEPDIR)/fnmatch_loop.Po + -rm -f ./$(DEPDIR)/freopen-safer.Po + -rm -f ./$(DEPDIR)/freopen.Po + -rm -f ./$(DEPDIR)/fstat.Po + -rm -f ./$(DEPDIR)/getdtablesize.Po + -rm -f ./$(DEPDIR)/getopt.Po + -rm -f ./$(DEPDIR)/getopt1.Po + -rm -f ./$(DEPDIR)/getprogname.Po + -rm -f ./$(DEPDIR)/gettime.Po + -rm -f ./$(DEPDIR)/gettimeofday.Po + -rm -f ./$(DEPDIR)/hard-locale.Po + -rm -f ./$(DEPDIR)/hash.Po + -rm -f ./$(DEPDIR)/iconv.Po + -rm -f ./$(DEPDIR)/iconv_close.Po + -rm -f ./$(DEPDIR)/iconv_open.Po + -rm -f ./$(DEPDIR)/imaxtostr.Po + -rm -f ./$(DEPDIR)/inttostr.Po + -rm -f ./$(DEPDIR)/isblank.Po + -rm -f ./$(DEPDIR)/iswblank.Po + -rm -f ./$(DEPDIR)/itold.Po + -rm -f ./$(DEPDIR)/localcharset.Po + -rm -f ./$(DEPDIR)/localeconv.Po + -rm -f ./$(DEPDIR)/localtime-buffer.Po + -rm -f ./$(DEPDIR)/lstat.Po + -rm -f ./$(DEPDIR)/malloc.Po + -rm -f ./$(DEPDIR)/malloca.Po + -rm -f ./$(DEPDIR)/mbchar.Po + -rm -f ./$(DEPDIR)/mbiter.Po + -rm -f ./$(DEPDIR)/mbrtowc.Po + -rm -f ./$(DEPDIR)/mbscasecmp.Po + -rm -f ./$(DEPDIR)/mbsinit.Po + -rm -f ./$(DEPDIR)/mbslen.Po + -rm -f ./$(DEPDIR)/mbsrtowcs-state.Po + -rm -f ./$(DEPDIR)/mbsrtowcs.Po + -rm -f ./$(DEPDIR)/mbsstr.Po + -rm -f ./$(DEPDIR)/mbtowc.Po + -rm -f ./$(DEPDIR)/mbuiter.Po + -rm -f ./$(DEPDIR)/memchr.Po + -rm -f ./$(DEPDIR)/mkstemp.Po + -rm -f ./$(DEPDIR)/mktime.Po + -rm -f ./$(DEPDIR)/msvc-inval.Po + -rm -f ./$(DEPDIR)/msvc-nothrow.Po + -rm -f ./$(DEPDIR)/nl_langinfo.Po + -rm -f ./$(DEPDIR)/offtostr.Po + -rm -f ./$(DEPDIR)/open.Po + -rm -f ./$(DEPDIR)/prepargs.Po + -rm -f ./$(DEPDIR)/printf-args.Po + -rm -f ./$(DEPDIR)/printf-parse.Po + -rm -f ./$(DEPDIR)/progname.Po + -rm -f ./$(DEPDIR)/propername.Po + -rm -f ./$(DEPDIR)/quotearg.Po + -rm -f ./$(DEPDIR)/raise.Po + -rm -f ./$(DEPDIR)/rawmemchr.Po + -rm -f ./$(DEPDIR)/readlink.Po + -rm -f ./$(DEPDIR)/regcomp.Po + -rm -f ./$(DEPDIR)/regex.Po + -rm -f ./$(DEPDIR)/regex_internal.Po + -rm -f ./$(DEPDIR)/regexec.Po + -rm -f ./$(DEPDIR)/secure_getenv.Po + -rm -f ./$(DEPDIR)/setenv.Po + -rm -f ./$(DEPDIR)/sh-quote.Po + -rm -f ./$(DEPDIR)/sig-handler.Po + -rm -f ./$(DEPDIR)/sigaction.Po + -rm -f ./$(DEPDIR)/sigprocmask.Po + -rm -f ./$(DEPDIR)/stat-time.Po + -rm -f ./$(DEPDIR)/stat-w32.Po + -rm -f ./$(DEPDIR)/stat.Po + -rm -f ./$(DEPDIR)/strcasecmp.Po + -rm -f ./$(DEPDIR)/strerror-override.Po + -rm -f ./$(DEPDIR)/strerror.Po + -rm -f ./$(DEPDIR)/strftime.Po + -rm -f ./$(DEPDIR)/striconv.Po + -rm -f ./$(DEPDIR)/stripslash.Po + -rm -f ./$(DEPDIR)/strncasecmp.Po + -rm -f ./$(DEPDIR)/strndup.Po + -rm -f ./$(DEPDIR)/strnlen.Po + -rm -f ./$(DEPDIR)/strnlen1.Po + -rm -f ./$(DEPDIR)/strptime.Po + -rm -f ./$(DEPDIR)/strtoimax.Po + -rm -f ./$(DEPDIR)/strtol.Po + -rm -f ./$(DEPDIR)/strtoul.Po + -rm -f ./$(DEPDIR)/strtoull.Po + -rm -f ./$(DEPDIR)/strtoumax.Po + -rm -f ./$(DEPDIR)/system-quote.Po + -rm -f ./$(DEPDIR)/tempname.Po + -rm -f ./$(DEPDIR)/time_r.Po + -rm -f ./$(DEPDIR)/time_rz.Po + -rm -f ./$(DEPDIR)/timegm.Po + -rm -f ./$(DEPDIR)/timespec.Po + -rm -f ./$(DEPDIR)/trim.Po + -rm -f ./$(DEPDIR)/tzset.Po + -rm -f ./$(DEPDIR)/uinttostr.Po + -rm -f ./$(DEPDIR)/umaxtostr.Po + -rm -f ./$(DEPDIR)/unistd.Po + -rm -f ./$(DEPDIR)/unsetenv.Po + -rm -f ./$(DEPDIR)/vasnprintf.Po + -rm -f ./$(DEPDIR)/vasprintf.Po + -rm -f ./$(DEPDIR)/version-etc-fsf.Po + -rm -f ./$(DEPDIR)/version-etc.Po + -rm -f ./$(DEPDIR)/wcrtomb.Po + -rm -f ./$(DEPDIR)/wctype-h.Po + -rm -f ./$(DEPDIR)/wcwidth.Po + -rm -f ./$(DEPDIR)/xalloc-die.Po + -rm -f ./$(DEPDIR)/xasprintf.Po + -rm -f ./$(DEPDIR)/xfreopen.Po + -rm -f ./$(DEPDIR)/xmalloc.Po + -rm -f ./$(DEPDIR)/xreadlink.Po + -rm -f ./$(DEPDIR)/xsize.Po + -rm -f ./$(DEPDIR)/xstriconv.Po + -rm -f ./$(DEPDIR)/xstrndup.Po + -rm -f ./$(DEPDIR)/xstrtol-error.Po + -rm -f ./$(DEPDIR)/xstrtol.Po + -rm -f ./$(DEPDIR)/xstrtoul.Po + -rm -f ./$(DEPDIR)/xstrtoumax.Po + -rm -f ./$(DEPDIR)/xvasprintf.Po + -rm -f unistr/$(DEPDIR)/u8-mbtoucr.Po + -rm -f unistr/$(DEPDIR)/u8-uctomb-aux.Po + -rm -f unistr/$(DEPDIR)/u8-uctomb.Po + -rm -f uniwidth/$(DEPDIR)/width.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-local distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-exec-local + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/alloca.Po + -rm -f ./$(DEPDIR)/allocator.Po + -rm -f ./$(DEPDIR)/anytostr.Po + -rm -f ./$(DEPDIR)/areadlink.Po + -rm -f ./$(DEPDIR)/argmatch.Po + -rm -f ./$(DEPDIR)/asnprintf.Po + -rm -f ./$(DEPDIR)/asprintf.Po + -rm -f ./$(DEPDIR)/basename-lgpl.Po + -rm -f ./$(DEPDIR)/basename.Po + -rm -f ./$(DEPDIR)/binary-io.Po + -rm -f ./$(DEPDIR)/bitrotate.Po + -rm -f ./$(DEPDIR)/btowc.Po + -rm -f ./$(DEPDIR)/c-ctype.Po + -rm -f ./$(DEPDIR)/c-stack.Po + -rm -f ./$(DEPDIR)/c-strcasecmp.Po + -rm -f ./$(DEPDIR)/c-strncasecmp.Po + -rm -f ./$(DEPDIR)/careadlinkat.Po + -rm -f ./$(DEPDIR)/close.Po + -rm -f ./$(DEPDIR)/cmpbuf.Po + -rm -f ./$(DEPDIR)/dirname-lgpl.Po + -rm -f ./$(DEPDIR)/dirname.Po + -rm -f ./$(DEPDIR)/dup2.Po + -rm -f ./$(DEPDIR)/error.Po + -rm -f ./$(DEPDIR)/exclude.Po + -rm -f ./$(DEPDIR)/exitfail.Po + -rm -f ./$(DEPDIR)/fcntl.Po + -rm -f ./$(DEPDIR)/fd-hook.Po + -rm -f ./$(DEPDIR)/file-type.Po + -rm -f ./$(DEPDIR)/filenamecat-lgpl.Po + -rm -f ./$(DEPDIR)/filenamecat.Po + -rm -f ./$(DEPDIR)/float.Po + -rm -f ./$(DEPDIR)/fnmatch.Po + -rm -f ./$(DEPDIR)/fnmatch_loop.Po + -rm -f ./$(DEPDIR)/freopen-safer.Po + -rm -f ./$(DEPDIR)/freopen.Po + -rm -f ./$(DEPDIR)/fstat.Po + -rm -f ./$(DEPDIR)/getdtablesize.Po + -rm -f ./$(DEPDIR)/getopt.Po + -rm -f ./$(DEPDIR)/getopt1.Po + -rm -f ./$(DEPDIR)/getprogname.Po + -rm -f ./$(DEPDIR)/gettime.Po + -rm -f ./$(DEPDIR)/gettimeofday.Po + -rm -f ./$(DEPDIR)/hard-locale.Po + -rm -f ./$(DEPDIR)/hash.Po + -rm -f ./$(DEPDIR)/iconv.Po + -rm -f ./$(DEPDIR)/iconv_close.Po + -rm -f ./$(DEPDIR)/iconv_open.Po + -rm -f ./$(DEPDIR)/imaxtostr.Po + -rm -f ./$(DEPDIR)/inttostr.Po + -rm -f ./$(DEPDIR)/isblank.Po + -rm -f ./$(DEPDIR)/iswblank.Po + -rm -f ./$(DEPDIR)/itold.Po + -rm -f ./$(DEPDIR)/localcharset.Po + -rm -f ./$(DEPDIR)/localeconv.Po + -rm -f ./$(DEPDIR)/localtime-buffer.Po + -rm -f ./$(DEPDIR)/lstat.Po + -rm -f ./$(DEPDIR)/malloc.Po + -rm -f ./$(DEPDIR)/malloca.Po + -rm -f ./$(DEPDIR)/mbchar.Po + -rm -f ./$(DEPDIR)/mbiter.Po + -rm -f ./$(DEPDIR)/mbrtowc.Po + -rm -f ./$(DEPDIR)/mbscasecmp.Po + -rm -f ./$(DEPDIR)/mbsinit.Po + -rm -f ./$(DEPDIR)/mbslen.Po + -rm -f ./$(DEPDIR)/mbsrtowcs-state.Po + -rm -f ./$(DEPDIR)/mbsrtowcs.Po + -rm -f ./$(DEPDIR)/mbsstr.Po + -rm -f ./$(DEPDIR)/mbtowc.Po + -rm -f ./$(DEPDIR)/mbuiter.Po + -rm -f ./$(DEPDIR)/memchr.Po + -rm -f ./$(DEPDIR)/mkstemp.Po + -rm -f ./$(DEPDIR)/mktime.Po + -rm -f ./$(DEPDIR)/msvc-inval.Po + -rm -f ./$(DEPDIR)/msvc-nothrow.Po + -rm -f ./$(DEPDIR)/nl_langinfo.Po + -rm -f ./$(DEPDIR)/offtostr.Po + -rm -f ./$(DEPDIR)/open.Po + -rm -f ./$(DEPDIR)/prepargs.Po + -rm -f ./$(DEPDIR)/printf-args.Po + -rm -f ./$(DEPDIR)/printf-parse.Po + -rm -f ./$(DEPDIR)/progname.Po + -rm -f ./$(DEPDIR)/propername.Po + -rm -f ./$(DEPDIR)/quotearg.Po + -rm -f ./$(DEPDIR)/raise.Po + -rm -f ./$(DEPDIR)/rawmemchr.Po + -rm -f ./$(DEPDIR)/readlink.Po + -rm -f ./$(DEPDIR)/regcomp.Po + -rm -f ./$(DEPDIR)/regex.Po + -rm -f ./$(DEPDIR)/regex_internal.Po + -rm -f ./$(DEPDIR)/regexec.Po + -rm -f ./$(DEPDIR)/secure_getenv.Po + -rm -f ./$(DEPDIR)/setenv.Po + -rm -f ./$(DEPDIR)/sh-quote.Po + -rm -f ./$(DEPDIR)/sig-handler.Po + -rm -f ./$(DEPDIR)/sigaction.Po + -rm -f ./$(DEPDIR)/sigprocmask.Po + -rm -f ./$(DEPDIR)/stat-time.Po + -rm -f ./$(DEPDIR)/stat-w32.Po + -rm -f ./$(DEPDIR)/stat.Po + -rm -f ./$(DEPDIR)/strcasecmp.Po + -rm -f ./$(DEPDIR)/strerror-override.Po + -rm -f ./$(DEPDIR)/strerror.Po + -rm -f ./$(DEPDIR)/strftime.Po + -rm -f ./$(DEPDIR)/striconv.Po + -rm -f ./$(DEPDIR)/stripslash.Po + -rm -f ./$(DEPDIR)/strncasecmp.Po + -rm -f ./$(DEPDIR)/strndup.Po + -rm -f ./$(DEPDIR)/strnlen.Po + -rm -f ./$(DEPDIR)/strnlen1.Po + -rm -f ./$(DEPDIR)/strptime.Po + -rm -f ./$(DEPDIR)/strtoimax.Po + -rm -f ./$(DEPDIR)/strtol.Po + -rm -f ./$(DEPDIR)/strtoul.Po + -rm -f ./$(DEPDIR)/strtoull.Po + -rm -f ./$(DEPDIR)/strtoumax.Po + -rm -f ./$(DEPDIR)/system-quote.Po + -rm -f ./$(DEPDIR)/tempname.Po + -rm -f ./$(DEPDIR)/time_r.Po + -rm -f ./$(DEPDIR)/time_rz.Po + -rm -f ./$(DEPDIR)/timegm.Po + -rm -f ./$(DEPDIR)/timespec.Po + -rm -f ./$(DEPDIR)/trim.Po + -rm -f ./$(DEPDIR)/tzset.Po + -rm -f ./$(DEPDIR)/uinttostr.Po + -rm -f ./$(DEPDIR)/umaxtostr.Po + -rm -f ./$(DEPDIR)/unistd.Po + -rm -f ./$(DEPDIR)/unsetenv.Po + -rm -f ./$(DEPDIR)/vasnprintf.Po + -rm -f ./$(DEPDIR)/vasprintf.Po + -rm -f ./$(DEPDIR)/version-etc-fsf.Po + -rm -f ./$(DEPDIR)/version-etc.Po + -rm -f ./$(DEPDIR)/wcrtomb.Po + -rm -f ./$(DEPDIR)/wctype-h.Po + -rm -f ./$(DEPDIR)/wcwidth.Po + -rm -f ./$(DEPDIR)/xalloc-die.Po + -rm -f ./$(DEPDIR)/xasprintf.Po + -rm -f ./$(DEPDIR)/xfreopen.Po + -rm -f ./$(DEPDIR)/xmalloc.Po + -rm -f ./$(DEPDIR)/xreadlink.Po + -rm -f ./$(DEPDIR)/xsize.Po + -rm -f ./$(DEPDIR)/xstriconv.Po + -rm -f ./$(DEPDIR)/xstrndup.Po + -rm -f ./$(DEPDIR)/xstrtol-error.Po + -rm -f ./$(DEPDIR)/xstrtol.Po + -rm -f ./$(DEPDIR)/xstrtoul.Po + -rm -f ./$(DEPDIR)/xstrtoumax.Po + -rm -f ./$(DEPDIR)/xvasprintf.Po + -rm -f unistr/$(DEPDIR)/u8-mbtoucr.Po + -rm -f unistr/$(DEPDIR)/u8-uctomb-aux.Po + -rm -f unistr/$(DEPDIR)/u8-uctomb.Po + -rm -f uniwidth/$(DEPDIR)/width.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-local + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-local + +.MAKE: all check install install-am install-exec install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am all-local am--depfiles check \ + check-am clean clean-generic clean-noinstLIBRARIES \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-hdr distclean-local distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-exec-local \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-local pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-local + +.PRECIOUS: Makefile + + +# We need the following in order to create <alloca.h> when the system +# doesn't have one that works with the given compiler. +@GL_GENERATE_ALLOCA_H_TRUE@alloca.h: alloca.in.h $(top_builddir)/config.status +@GL_GENERATE_ALLOCA_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_ALLOCA_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_ALLOCA_H_TRUE@ cat $(srcdir)/alloca.in.h; \ +@GL_GENERATE_ALLOCA_H_TRUE@ } > $@-t && \ +@GL_GENERATE_ALLOCA_H_TRUE@ mv -f $@-t $@ +@GL_GENERATE_ALLOCA_H_FALSE@alloca.h: $(top_builddir)/config.status +@GL_GENERATE_ALLOCA_H_FALSE@ rm -f $@ + +# Listed in the same order as the GNU makefile conventions, and +# provided by autoconf 2.59c+ or 2.70. +# The Automake-defined pkg* macros are appended, in the order +# listed in the Automake 1.10a+ documentation. +configmake.h: Makefile + $(AM_V_GEN)rm -f $@-t && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + echo '#define PREFIX "$(prefix)"'; \ + echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ + echo '#define BINDIR "$(bindir)"'; \ + echo '#define SBINDIR "$(sbindir)"'; \ + echo '#define LIBEXECDIR "$(libexecdir)"'; \ + echo '#define DATAROOTDIR "$(datarootdir)"'; \ + echo '#define DATADIR "$(datadir)"'; \ + echo '#define SYSCONFDIR "$(sysconfdir)"'; \ + echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \ + echo '#define LOCALSTATEDIR "$(localstatedir)"'; \ + echo '#define RUNSTATEDIR "$(runstatedir)"'; \ + echo '#define INCLUDEDIR "$(includedir)"'; \ + echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \ + echo '#define DOCDIR "$(docdir)"'; \ + echo '#define INFODIR "$(infodir)"'; \ + echo '#define HTMLDIR "$(htmldir)"'; \ + echo '#define DVIDIR "$(dvidir)"'; \ + echo '#define PDFDIR "$(pdfdir)"'; \ + echo '#define PSDIR "$(psdir)"'; \ + echo '#define LIBDIR "$(libdir)"'; \ + echo '#define LISPDIR "$(lispdir)"'; \ + echo '#define LOCALEDIR "$(localedir)"'; \ + echo '#define MANDIR "$(mandir)"'; \ + echo '#define MANEXT "$(manext)"'; \ + echo '#define PKGDATADIR "$(pkgdatadir)"'; \ + echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \ + echo '#define PKGLIBDIR "$(pkglibdir)"'; \ + echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ + } | sed '/""/d' > $@-t && \ + mv -f $@-t $@ + +# We need the following in order to create <ctype.h> when the system +# doesn't have one that works with the given compiler. +ctype.h: ctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_CTYPE_H''@|$(NEXT_CTYPE_H)|g' \ + -e 's/@''GNULIB_ISBLANK''@/$(GNULIB_ISBLANK)/g' \ + -e 's/@''HAVE_ISBLANK''@/$(HAVE_ISBLANK)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/ctype.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create <errno.h> when the system +# doesn't have one that is POSIX compliant. +@GL_GENERATE_ERRNO_H_TRUE@errno.h: errno.in.h $(top_builddir)/config.status +@GL_GENERATE_ERRNO_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_ERRNO_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_ERRNO_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ < $(srcdir)/errno.in.h; \ +@GL_GENERATE_ERRNO_H_TRUE@ } > $@-t && \ +@GL_GENERATE_ERRNO_H_TRUE@ mv $@-t $@ +@GL_GENERATE_ERRNO_H_FALSE@errno.h: $(top_builddir)/config.status +@GL_GENERATE_ERRNO_H_FALSE@ rm -f $@ + +# We need the following in order to create <fcntl.h> when the system +# doesn't have one that works with the given compiler. +fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \ + -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \ + -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \ + -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \ + -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \ + -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \ + -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \ + -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \ + -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \ + -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/fcntl.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create <float.h> when the system +# doesn't have one that works with the given compiler. +@GL_GENERATE_FLOAT_H_TRUE@float.h: float.in.h $(top_builddir)/config.status +@GL_GENERATE_FLOAT_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_FLOAT_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_FLOAT_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \ +@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \ +@GL_GENERATE_FLOAT_H_TRUE@ < $(srcdir)/float.in.h; \ +@GL_GENERATE_FLOAT_H_TRUE@ } > $@-t && \ +@GL_GENERATE_FLOAT_H_TRUE@ mv $@-t $@ +@GL_GENERATE_FLOAT_H_FALSE@float.h: $(top_builddir)/config.status +@GL_GENERATE_FLOAT_H_FALSE@ rm -f $@ + +# We need the following in order to create <fnmatch.h> when the system +# doesn't have one that supports the required API. +@GL_GENERATE_FNMATCH_H_TRUE@fnmatch.h: fnmatch.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) +@GL_GENERATE_FNMATCH_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_FNMATCH_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_FNMATCH_H_TRUE@ sed -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ +@GL_GENERATE_FNMATCH_H_TRUE@ < $(srcdir)/fnmatch.in.h; \ +@GL_GENERATE_FNMATCH_H_TRUE@ } > $@-t && \ +@GL_GENERATE_FNMATCH_H_TRUE@ mv -f $@-t $@ +@GL_GENERATE_FNMATCH_H_FALSE@fnmatch.h: $(top_builddir)/config.status +@GL_GENERATE_FNMATCH_H_FALSE@ rm -f $@ + +# We need the following in order to create <getopt.h> when the system +# doesn't have one that works with the given compiler. +getopt.h: getopt.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + < $(srcdir)/getopt.in.h; \ + } > $@-t && \ + mv -f $@-t $@ + +getopt-cdefs.h: getopt-cdefs.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \ + < $(srcdir)/getopt-cdefs.in.h; \ + } > $@-t && \ + mv -f $@-t $@ +distclean-local: clean-GNUmakefile +clean-GNUmakefile: + test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile + +# We need the following in order to create <iconv.h> when the system +# doesn't have one that works with the given compiler. +@GL_GENERATE_ICONV_H_TRUE@iconv.h: iconv.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +@GL_GENERATE_ICONV_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_ICONV_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_ICONV_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_ICONV_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_ICONV_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_ICONV_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_ICONV_H_TRUE@ -e 's|@''NEXT_ICONV_H''@|$(NEXT_ICONV_H)|g' \ +@GL_GENERATE_ICONV_H_TRUE@ -e 's/@''GNULIB_ICONV''@/$(GNULIB_ICONV)/g' \ +@GL_GENERATE_ICONV_H_TRUE@ -e 's|@''ICONV_CONST''@|$(ICONV_CONST)|g' \ +@GL_GENERATE_ICONV_H_TRUE@ -e 's|@''REPLACE_ICONV''@|$(REPLACE_ICONV)|g' \ +@GL_GENERATE_ICONV_H_TRUE@ -e 's|@''REPLACE_ICONV_OPEN''@|$(REPLACE_ICONV_OPEN)|g' \ +@GL_GENERATE_ICONV_H_TRUE@ -e 's|@''REPLACE_ICONV_UTF''@|$(REPLACE_ICONV_UTF)|g' \ +@GL_GENERATE_ICONV_H_TRUE@ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ +@GL_GENERATE_ICONV_H_TRUE@ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ +@GL_GENERATE_ICONV_H_TRUE@ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ +@GL_GENERATE_ICONV_H_TRUE@ < $(srcdir)/iconv.in.h; \ +@GL_GENERATE_ICONV_H_TRUE@ } > $@-t && \ +@GL_GENERATE_ICONV_H_TRUE@ mv $@-t $@ +@GL_GENERATE_ICONV_H_FALSE@iconv.h: $(top_builddir)/config.status +@GL_GENERATE_ICONV_H_FALSE@ rm -f $@ + +iconv_open-aix.h: iconv_open-aix.gperf + $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-aix.gperf > $(srcdir)/iconv_open-aix.h-t && \ + mv $(srcdir)/iconv_open-aix.h-t $(srcdir)/iconv_open-aix.h +iconv_open-hpux.h: iconv_open-hpux.gperf + $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-hpux.gperf > $(srcdir)/iconv_open-hpux.h-t && \ + mv $(srcdir)/iconv_open-hpux.h-t $(srcdir)/iconv_open-hpux.h +iconv_open-irix.h: iconv_open-irix.gperf + $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-irix.gperf > $(srcdir)/iconv_open-irix.h-t && \ + mv $(srcdir)/iconv_open-irix.h-t $(srcdir)/iconv_open-irix.h +iconv_open-osf.h: iconv_open-osf.gperf + $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-osf.gperf > $(srcdir)/iconv_open-osf.h-t && \ + mv $(srcdir)/iconv_open-osf.h-t $(srcdir)/iconv_open-osf.h +iconv_open-solaris.h: iconv_open-solaris.gperf + $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-solaris.gperf > $(srcdir)/iconv_open-solaris.h-t && \ + mv $(srcdir)/iconv_open-solaris.h-t $(srcdir)/iconv_open-solaris.h + +# We need the following in order to create <inttypes.h> when the system +# doesn't have one that works with the given compiler. +inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \ + -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \ + -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ + -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ + -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ + -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \ + -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \ + -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \ + -e 's/@''GNULIB_STRTOIMAX''@/$(GNULIB_STRTOIMAX)/g' \ + -e 's/@''GNULIB_STRTOUMAX''@/$(GNULIB_STRTOUMAX)/g' \ + -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \ + -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \ + -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \ + -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \ + -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \ + -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \ + -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \ + -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \ + -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \ + -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/inttypes.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create an empty placeholder for +# <langinfo.h> when the system doesn't have one. +langinfo.h: langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \ + -e 's/@''GNULIB_NL_LANGINFO''@/$(GNULIB_NL_LANGINFO)/g' \ + -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \ + -e 's|@''HAVE_LANGINFO_T_FMT_AMPM''@|$(HAVE_LANGINFO_T_FMT_AMPM)|g' \ + -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \ + -e 's|@''HAVE_LANGINFO_YESEXPR''@|$(HAVE_LANGINFO_YESEXPR)|g' \ + -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \ + -e 's|@''REPLACE_NL_LANGINFO''@|$(REPLACE_NL_LANGINFO)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/langinfo.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create <limits.h> when the system +# doesn't have one that is compatible with GNU. +@GL_GENERATE_LIMITS_H_TRUE@limits.h: limits.in.h $(top_builddir)/config.status +@GL_GENERATE_LIMITS_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_LIMITS_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_LIMITS_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ < $(srcdir)/limits.in.h; \ +@GL_GENERATE_LIMITS_H_TRUE@ } > $@-t && \ +@GL_GENERATE_LIMITS_H_TRUE@ mv $@-t $@ +@GL_GENERATE_LIMITS_H_FALSE@limits.h: $(top_builddir)/config.status +@GL_GENERATE_LIMITS_H_FALSE@ rm -f $@ + +# We need the following in order to install a simple file in $(libdir) +# which is shared with other installed packages. We use a list of referencing +# packages so that "make uninstall" will remove the file if and only if it +# is not used by another installed package. +# On systems with glibc-2.1 or newer, the file is redundant, therefore we +# avoid installing it. + +all-local: charset.alias ref-add.sed ref-del.sed +install-exec-local: install-exec-localcharset +install-exec-localcharset: all-local + if test $(GLIBC21) = no; then \ + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ + darwin* | cygwin* | mingw* | pw32* | cegcc*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ + esac ; \ + else \ + need_charset_alias=false ; \ + fi ; \ + if $$need_charset_alias; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir) ; \ + fi ; \ + if test -f $(charset_alias); then \ + sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ + rm -f $(charset_tmp) ; \ + else \ + if $$need_charset_alias; then \ + sed -f ref-add.sed charset.alias > $(charset_tmp) ; \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ + rm -f $(charset_tmp) ; \ + fi ; \ + fi + +uninstall-local: uninstall-localcharset +uninstall-localcharset: all-local + if test -f $(charset_alias); then \ + sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \ + if grep '^# Packages using this file: $$' $(charset_tmp) \ + > /dev/null; then \ + rm -f $(charset_alias); \ + else \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \ + fi; \ + rm -f $(charset_tmp); \ + fi + +charset.alias: config.charset + $(AM_V_GEN)rm -f t-$@ $@ && \ + $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ && \ + mv t-$@ $@ +.sin.sed: + $(AM_V_GEN)rm -f t-$@ $@ && \ + sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \ + mv t-$@ $@ + +# We need the following in order to create <locale.h> when the system +# doesn't have one that provides all definitions. +locale.h: locale.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_LOCALE_H''@|$(NEXT_LOCALE_H)|g' \ + -e 's/@''GNULIB_LOCALECONV''@/$(GNULIB_LOCALECONV)/g' \ + -e 's/@''GNULIB_SETLOCALE''@/$(GNULIB_SETLOCALE)/g' \ + -e 's/@''GNULIB_DUPLOCALE''@/$(GNULIB_DUPLOCALE)/g' \ + -e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|g' \ + -e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \ + -e 's|@''REPLACE_LOCALECONV''@|$(REPLACE_LOCALECONV)|g' \ + -e 's|@''REPLACE_SETLOCALE''@|$(REPLACE_SETLOCALE)|g' \ + -e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \ + -e 's|@''REPLACE_STRUCT_LCONV''@|$(REPLACE_STRUCT_LCONV)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/locale.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create <signal.h> when the system +# doesn't have a complete one. +signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \ + -e 's|@''GNULIB_PTHREAD_SIGMASK''@|$(GNULIB_PTHREAD_SIGMASK)|g' \ + -e 's|@''GNULIB_RAISE''@|$(GNULIB_RAISE)|g' \ + -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \ + -e 's/@''GNULIB_SIGACTION''@/$(GNULIB_SIGACTION)/g' \ + -e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|$(HAVE_POSIX_SIGNALBLOCKING)|g' \ + -e 's|@''HAVE_PTHREAD_SIGMASK''@|$(HAVE_PTHREAD_SIGMASK)|g' \ + -e 's|@''HAVE_RAISE''@|$(HAVE_RAISE)|g' \ + -e 's|@''HAVE_SIGSET_T''@|$(HAVE_SIGSET_T)|g' \ + -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \ + -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \ + -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \ + -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \ + -e 's|@''HAVE_SIGHANDLER_T''@|$(HAVE_SIGHANDLER_T)|g' \ + -e 's|@''REPLACE_PTHREAD_SIGMASK''@|$(REPLACE_PTHREAD_SIGMASK)|g' \ + -e 's|@''REPLACE_RAISE''@|$(REPLACE_RAISE)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/signal.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create <stdarg.h> when the system +# doesn't have one that works with the given compiler. +@GL_GENERATE_STDARG_H_TRUE@stdarg.h: stdarg.in.h $(top_builddir)/config.status +@GL_GENERATE_STDARG_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_STDARG_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_STDARG_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_STDARG_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_STDARG_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_STDARG_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_STDARG_H_TRUE@ -e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \ +@GL_GENERATE_STDARG_H_TRUE@ < $(srcdir)/stdarg.in.h; \ +@GL_GENERATE_STDARG_H_TRUE@ } > $@-t && \ +@GL_GENERATE_STDARG_H_TRUE@ mv $@-t $@ +@GL_GENERATE_STDARG_H_FALSE@stdarg.h: $(top_builddir)/config.status +@GL_GENERATE_STDARG_H_FALSE@ rm -f $@ + +# We need the following in order to create <stdbool.h> when the system +# doesn't have one that works. +@GL_GENERATE_STDBOOL_H_TRUE@stdbool.h: stdbool.in.h $(top_builddir)/config.status +@GL_GENERATE_STDBOOL_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_STDBOOL_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_STDBOOL_H_TRUE@ sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \ +@GL_GENERATE_STDBOOL_H_TRUE@ } > $@-t && \ +@GL_GENERATE_STDBOOL_H_TRUE@ mv $@-t $@ +@GL_GENERATE_STDBOOL_H_FALSE@stdbool.h: $(top_builddir)/config.status +@GL_GENERATE_STDBOOL_H_FALSE@ rm -f $@ + +# We need the following in order to create <stddef.h> when the system +# doesn't have one that works with the given compiler. +@GL_GENERATE_STDDEF_H_TRUE@stddef.h: stddef.in.h $(top_builddir)/config.status +@GL_GENERATE_STDDEF_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_STDDEF_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_STDDEF_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ < $(srcdir)/stddef.in.h; \ +@GL_GENERATE_STDDEF_H_TRUE@ } > $@-t && \ +@GL_GENERATE_STDDEF_H_TRUE@ mv $@-t $@ +@GL_GENERATE_STDDEF_H_FALSE@stddef.h: $(top_builddir)/config.status +@GL_GENERATE_STDDEF_H_FALSE@ rm -f $@ + +# We need the following in order to create <stdint.h> when the system +# doesn't have one that works with the given compiler. +@GL_GENERATE_STDINT_H_TRUE@stdint.h: stdint.in.h $(top_builddir)/config.status +@GL_GENERATE_STDINT_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_STDINT_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_STDINT_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ < $(srcdir)/stdint.in.h; \ +@GL_GENERATE_STDINT_H_TRUE@ } > $@-t && \ +@GL_GENERATE_STDINT_H_TRUE@ mv $@-t $@ +@GL_GENERATE_STDINT_H_FALSE@stdint.h: $(top_builddir)/config.status +@GL_GENERATE_STDINT_H_FALSE@ rm -f $@ + +# We need the following in order to create <stdio.h> when the system +# doesn't have one that works with the given compiler. +stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \ + -e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \ + -e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \ + -e 's/@''GNULIB_FDOPEN''@/$(GNULIB_FDOPEN)/g' \ + -e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \ + -e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \ + -e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \ + -e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \ + -e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \ + -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \ + -e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \ + -e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \ + -e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \ + -e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \ + -e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \ + -e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \ + -e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \ + -e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \ + -e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \ + -e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \ + -e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \ + -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \ + -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \ + -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \ + -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \ + -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \ + -e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \ + -e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \ + -e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \ + -e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \ + -e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \ + -e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \ + -e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \ + -e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \ + -e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \ + -e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \ + -e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \ + -e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \ + -e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \ + -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \ + -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \ + -e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \ + -e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \ + -e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \ + -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \ + -e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \ + -e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \ + -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \ + -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \ + < $(srcdir)/stdio.in.h | \ + sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \ + -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \ + -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \ + -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \ + -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \ + -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \ + -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \ + -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \ + -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \ + -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \ + -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \ + -e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \ + -e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \ + -e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \ + -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ + -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \ + -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \ + -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \ + -e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \ + -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \ + -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \ + -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \ + -e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \ + -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \ + -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \ + -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \ + -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \ + -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \ + -e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \ + -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \ + -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \ + -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \ + -e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \ + -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \ + -e 's|@''REPLACE_REMOVE''@|$(REPLACE_REMOVE)|g' \ + -e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \ + -e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \ + -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \ + -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \ + -e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \ + -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \ + -e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \ + -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \ + -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \ + -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \ + -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \ + -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \ + -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ + -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create <stdlib.h> when the system +# doesn't have one that works with the given compiler. +stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ + $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ + -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \ + -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \ + -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \ + -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \ + -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \ + -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \ + -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \ + -e 's/@''GNULIB_MALLOC_POSIX''@/$(GNULIB_MALLOC_POSIX)/g' \ + -e 's/@''GNULIB_MBTOWC''@/$(GNULIB_MBTOWC)/g' \ + -e 's/@''GNULIB_MKDTEMP''@/$(GNULIB_MKDTEMP)/g' \ + -e 's/@''GNULIB_MKOSTEMP''@/$(GNULIB_MKOSTEMP)/g' \ + -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \ + -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \ + -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \ + -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \ + -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \ + -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \ + -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \ + -e 's/@''GNULIB_QSORT_R''@/$(GNULIB_QSORT_R)/g' \ + -e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \ + -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \ + -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \ + -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \ + -e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \ + -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \ + -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \ + -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \ + -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \ + -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \ + -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \ + -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \ + -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \ + -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \ + < $(srcdir)/stdlib.in.h | \ + sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \ + -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ + -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ + -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ + -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \ + -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ + -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \ + -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \ + -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \ + -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \ + -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ + -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ + -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ + -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \ + -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \ + -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ + -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ + -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \ + -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ + -e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \ + -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \ + -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ + -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ + -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ + -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ + -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ + -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \ + -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \ + -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \ + -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \ + -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \ + -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \ + -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ + -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ + -e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \ + -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \ + -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \ + -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \ + -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ + -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ + -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ + -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _Noreturn/r $(_NORETURN_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create <string.h> when the system +# doesn't have one that works with the given compiler. +string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \ + -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \ + -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \ + -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \ + -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \ + -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \ + -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \ + -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \ + -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \ + -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \ + -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \ + -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \ + -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \ + -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \ + -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \ + -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \ + -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \ + -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \ + -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \ + -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \ + -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \ + -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \ + -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \ + -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \ + -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \ + -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \ + -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \ + -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \ + -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \ + -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \ + -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \ + -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \ + -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \ + -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \ + -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \ + -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \ + -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \ + -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \ + < $(srcdir)/string.in.h | \ + sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \ + -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \ + -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \ + -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \ + -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ + -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ + -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ + -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \ + -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \ + -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \ + -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \ + -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \ + -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \ + -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \ + -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \ + -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \ + -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ + -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ + -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \ + -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ + -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ + -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \ + -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \ + -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ + -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \ + -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \ + -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \ + -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \ + -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ + -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \ + -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \ + -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \ + -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \ + -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ + -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ + -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + < $(srcdir)/string.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create <strings.h> when the system +# doesn't have one that works with the given compiler. +strings.h: strings.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_STRINGS_H''@|$(HAVE_STRINGS_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STRINGS_H''@|$(NEXT_STRINGS_H)|g' \ + -e 's|@''GNULIB_FFS''@|$(GNULIB_FFS)|g' \ + -e 's|@''HAVE_FFS''@|$(HAVE_FFS)|g' \ + -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \ + -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/strings.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create <sys/stat.h> when the system +# has one that is incomplete. +sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \ + -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \ + -e 's|@''WINDOWS_STAT_TIMESPEC''@|$(WINDOWS_STAT_TIMESPEC)|g' \ + -e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \ + -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \ + -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \ + -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \ + -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \ + -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \ + -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \ + -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \ + -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \ + -e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \ + -e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \ + -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \ + -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \ + -e 's/@''GNULIB_OVERRIDES_STRUCT_STAT''@/$(GNULIB_OVERRIDES_STRUCT_STAT)/g' \ + -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \ + -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \ + -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \ + -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \ + -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ + -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \ + -e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \ + -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \ + -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \ + -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \ + -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \ + -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \ + -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \ + -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \ + -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \ + -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \ + -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \ + -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \ + -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \ + -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_stat.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create <sys/time.h> when the system +# doesn't have one that works with the given compiler. +sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \ + -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \ + -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ + -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \ + -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ + -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ + -e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_time.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create <sys/types.h> when the system +# doesn't have one that works with the given compiler. +sys/types.h: sys_types.in.h $(top_builddir)/config.status + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \ + -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ + -e 's|@''WINDOWS_STAT_INODES''@|$(WINDOWS_STAT_INODES)|g' \ + < $(srcdir)/sys_types.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create <sys/wait.h> when the system +# has one that is incomplete. +sys/wait.h: sys_wait.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \ + -e 's/@''GNULIB_WAITPID''@/$(GNULIB_WAITPID)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_wait.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create <time.h> when the system +# doesn't have one that works with the given compiler. +time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \ + -e 's/@''GNULIB_CTIME''@/$(GNULIB_CTIME)/g' \ + -e 's/@''GNULIB_LOCALTIME''@/$(GNULIB_LOCALTIME)/g' \ + -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \ + -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \ + -e 's/@''GNULIB_STRFTIME''@/$(GNULIB_STRFTIME)/g' \ + -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \ + -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \ + -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \ + -e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/g' \ + -e 's/@''GNULIB_TZSET''@/$(GNULIB_TZSET)/g' \ + -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \ + -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \ + -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \ + -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \ + -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \ + -e 's|@''HAVE_TZSET''@|$(HAVE_TZSET)|g' \ + -e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \ + -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \ + -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \ + -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ + -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \ + -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ + -e 's|@''REPLACE_STRFTIME''@|$(REPLACE_STRFTIME)|g' \ + -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \ + -e 's|@''REPLACE_TZSET''@|$(REPLACE_TZSET)|g' \ + -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/time.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create an empty placeholder for +# <unistd.h> when the system doesn't have one. +unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ + -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ + -e 's/@''GNULIB_CHDIR''@/$(GNULIB_CHDIR)/g' \ + -e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \ + -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \ + -e 's/@''GNULIB_DUP''@/$(GNULIB_DUP)/g' \ + -e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \ + -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \ + -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \ + -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \ + -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \ + -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \ + -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \ + -e 's/@''GNULIB_FDATASYNC''@/$(GNULIB_FDATASYNC)/g' \ + -e 's/@''GNULIB_FSYNC''@/$(GNULIB_FSYNC)/g' \ + -e 's/@''GNULIB_FTRUNCATE''@/$(GNULIB_FTRUNCATE)/g' \ + -e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \ + -e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \ + -e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \ + -e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \ + -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \ + -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \ + -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \ + -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \ + -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \ + -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \ + -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \ + -e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \ + -e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \ + -e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \ + -e 's/@''GNULIB_LSEEK''@/$(GNULIB_LSEEK)/g' \ + -e 's/@''GNULIB_PIPE''@/$(GNULIB_PIPE)/g' \ + -e 's/@''GNULIB_PIPE2''@/$(GNULIB_PIPE2)/g' \ + -e 's/@''GNULIB_PREAD''@/$(GNULIB_PREAD)/g' \ + -e 's/@''GNULIB_PWRITE''@/$(GNULIB_PWRITE)/g' \ + -e 's/@''GNULIB_READ''@/$(GNULIB_READ)/g' \ + -e 's/@''GNULIB_READLINK''@/$(GNULIB_READLINK)/g' \ + -e 's/@''GNULIB_READLINKAT''@/$(GNULIB_READLINKAT)/g' \ + -e 's/@''GNULIB_RMDIR''@/$(GNULIB_RMDIR)/g' \ + -e 's/@''GNULIB_SETHOSTNAME''@/$(GNULIB_SETHOSTNAME)/g' \ + -e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \ + -e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \ + -e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \ + -e 's/@''GNULIB_TRUNCATE''@/$(GNULIB_TRUNCATE)/g' \ + -e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \ + -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_GL_UNISTD_H_GETOPT)/g' \ + -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \ + -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \ + -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \ + -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \ + -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \ + < $(srcdir)/unistd.in.h | \ + sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \ + -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ + -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \ + -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ + -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \ + -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \ + -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \ + -e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \ + -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ + -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ + -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \ + -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ + -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \ + -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ + -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ + -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \ + -e 's|@''HAVE_PIPE''@|$(HAVE_PIPE)|g' \ + -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \ + -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \ + -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \ + -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ + -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \ + -e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \ + -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ + -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \ + -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \ + -e 's|@''HAVE_TRUNCATE''@|$(HAVE_TRUNCATE)|g' \ + -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \ + -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ + -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ + -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \ + -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \ + -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN''@|$(HAVE_DECL_GETLOGIN)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ + -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ + -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \ + -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \ + -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \ + -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ + -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ + | \ + sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ + -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ + -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ + -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ + -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \ + -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \ + -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ + -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \ + -e 's|@''REPLACE_GETDTABLESIZE''@|$(REPLACE_GETDTABLESIZE)|g' \ + -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \ + -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \ + -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ + -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \ + -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ + -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \ + -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \ + -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ + -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \ + -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \ + -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \ + -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \ + -e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \ + -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \ + -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \ + -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \ + -e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \ + -e 's|@''REPLACE_TRUNCATE''@|$(REPLACE_TRUNCATE)|g' \ + -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \ + -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \ + -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \ + -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \ + -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \ + -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \ + -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ + +unistr.h: unistr.in.h + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/unistr.in.h; \ + } > $@-t && \ + mv -f $@-t $@ + +unitypes.h: unitypes.in.h + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/unitypes.in.h; \ + } > $@-t && \ + mv -f $@-t $@ + +uniwidth.h: uniwidth.in.h + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/uniwidth.in.h; \ + } > $@-t && \ + mv -f $@-t $@ + +# We need the following in order to create <wchar.h> when the system +# version does not work standalone. +wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \ + -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \ + -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \ + -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \ + -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ + -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \ + -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \ + -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \ + -e 's/@''GNULIB_MBRTOWC''@/$(GNULIB_MBRTOWC)/g' \ + -e 's/@''GNULIB_MBRLEN''@/$(GNULIB_MBRLEN)/g' \ + -e 's/@''GNULIB_MBSRTOWCS''@/$(GNULIB_MBSRTOWCS)/g' \ + -e 's/@''GNULIB_MBSNRTOWCS''@/$(GNULIB_MBSNRTOWCS)/g' \ + -e 's/@''GNULIB_WCRTOMB''@/$(GNULIB_WCRTOMB)/g' \ + -e 's/@''GNULIB_WCSRTOMBS''@/$(GNULIB_WCSRTOMBS)/g' \ + -e 's/@''GNULIB_WCSNRTOMBS''@/$(GNULIB_WCSNRTOMBS)/g' \ + -e 's/@''GNULIB_WCWIDTH''@/$(GNULIB_WCWIDTH)/g' \ + -e 's/@''GNULIB_WMEMCHR''@/$(GNULIB_WMEMCHR)/g' \ + -e 's/@''GNULIB_WMEMCMP''@/$(GNULIB_WMEMCMP)/g' \ + -e 's/@''GNULIB_WMEMCPY''@/$(GNULIB_WMEMCPY)/g' \ + -e 's/@''GNULIB_WMEMMOVE''@/$(GNULIB_WMEMMOVE)/g' \ + -e 's/@''GNULIB_WMEMSET''@/$(GNULIB_WMEMSET)/g' \ + -e 's/@''GNULIB_WCSLEN''@/$(GNULIB_WCSLEN)/g' \ + -e 's/@''GNULIB_WCSNLEN''@/$(GNULIB_WCSNLEN)/g' \ + -e 's/@''GNULIB_WCSCPY''@/$(GNULIB_WCSCPY)/g' \ + -e 's/@''GNULIB_WCPCPY''@/$(GNULIB_WCPCPY)/g' \ + -e 's/@''GNULIB_WCSNCPY''@/$(GNULIB_WCSNCPY)/g' \ + -e 's/@''GNULIB_WCPNCPY''@/$(GNULIB_WCPNCPY)/g' \ + -e 's/@''GNULIB_WCSCAT''@/$(GNULIB_WCSCAT)/g' \ + -e 's/@''GNULIB_WCSNCAT''@/$(GNULIB_WCSNCAT)/g' \ + -e 's/@''GNULIB_WCSCMP''@/$(GNULIB_WCSCMP)/g' \ + -e 's/@''GNULIB_WCSNCMP''@/$(GNULIB_WCSNCMP)/g' \ + -e 's/@''GNULIB_WCSCASECMP''@/$(GNULIB_WCSCASECMP)/g' \ + -e 's/@''GNULIB_WCSNCASECMP''@/$(GNULIB_WCSNCASECMP)/g' \ + -e 's/@''GNULIB_WCSCOLL''@/$(GNULIB_WCSCOLL)/g' \ + -e 's/@''GNULIB_WCSXFRM''@/$(GNULIB_WCSXFRM)/g' \ + -e 's/@''GNULIB_WCSDUP''@/$(GNULIB_WCSDUP)/g' \ + -e 's/@''GNULIB_WCSCHR''@/$(GNULIB_WCSCHR)/g' \ + -e 's/@''GNULIB_WCSRCHR''@/$(GNULIB_WCSRCHR)/g' \ + -e 's/@''GNULIB_WCSCSPN''@/$(GNULIB_WCSCSPN)/g' \ + -e 's/@''GNULIB_WCSSPN''@/$(GNULIB_WCSSPN)/g' \ + -e 's/@''GNULIB_WCSPBRK''@/$(GNULIB_WCSPBRK)/g' \ + -e 's/@''GNULIB_WCSSTR''@/$(GNULIB_WCSSTR)/g' \ + -e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \ + -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \ + -e 's/@''GNULIB_WCSFTIME''@/$(GNULIB_WCSFTIME)/g' \ + < $(srcdir)/wchar.in.h | \ + sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \ + -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \ + -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \ + -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \ + -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \ + -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \ + -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \ + -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \ + -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \ + -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \ + -e 's|@''HAVE_WMEMCHR''@|$(HAVE_WMEMCHR)|g' \ + -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \ + -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \ + -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \ + -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \ + -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \ + -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \ + -e 's|@''HAVE_WCSCPY''@|$(HAVE_WCSCPY)|g' \ + -e 's|@''HAVE_WCPCPY''@|$(HAVE_WCPCPY)|g' \ + -e 's|@''HAVE_WCSNCPY''@|$(HAVE_WCSNCPY)|g' \ + -e 's|@''HAVE_WCPNCPY''@|$(HAVE_WCPNCPY)|g' \ + -e 's|@''HAVE_WCSCAT''@|$(HAVE_WCSCAT)|g' \ + -e 's|@''HAVE_WCSNCAT''@|$(HAVE_WCSNCAT)|g' \ + -e 's|@''HAVE_WCSCMP''@|$(HAVE_WCSCMP)|g' \ + -e 's|@''HAVE_WCSNCMP''@|$(HAVE_WCSNCMP)|g' \ + -e 's|@''HAVE_WCSCASECMP''@|$(HAVE_WCSCASECMP)|g' \ + -e 's|@''HAVE_WCSNCASECMP''@|$(HAVE_WCSNCASECMP)|g' \ + -e 's|@''HAVE_WCSCOLL''@|$(HAVE_WCSCOLL)|g' \ + -e 's|@''HAVE_WCSXFRM''@|$(HAVE_WCSXFRM)|g' \ + -e 's|@''HAVE_WCSDUP''@|$(HAVE_WCSDUP)|g' \ + -e 's|@''HAVE_WCSCHR''@|$(HAVE_WCSCHR)|g' \ + -e 's|@''HAVE_WCSRCHR''@|$(HAVE_WCSRCHR)|g' \ + -e 's|@''HAVE_WCSCSPN''@|$(HAVE_WCSCSPN)|g' \ + -e 's|@''HAVE_WCSSPN''@|$(HAVE_WCSSPN)|g' \ + -e 's|@''HAVE_WCSPBRK''@|$(HAVE_WCSPBRK)|g' \ + -e 's|@''HAVE_WCSSTR''@|$(HAVE_WCSSTR)|g' \ + -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \ + -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \ + -e 's|@''HAVE_WCSFTIME''@|$(HAVE_WCSFTIME)|g' \ + -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ + -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ + | \ + sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \ + -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \ + -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \ + -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \ + -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \ + -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \ + -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \ + -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \ + -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \ + -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \ + -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \ + -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ + -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \ + -e 's|@''REPLACE_WCSFTIME''@|$(REPLACE_WCSFTIME)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create <wctype.h> when the system +# doesn't have one that works with the given compiler. +wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \ + -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \ + -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ + -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \ + -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \ + -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \ + -e 's/@''GNULIB_WCTRANS''@/$(GNULIB_WCTRANS)/g' \ + -e 's/@''GNULIB_TOWCTRANS''@/$(GNULIB_TOWCTRANS)/g' \ + -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \ + -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \ + -e 's/@''HAVE_WCTYPE_T''@/$(HAVE_WCTYPE_T)/g' \ + -e 's/@''HAVE_WCTRANS_T''@/$(HAVE_WCTRANS_T)/g' \ + -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ + -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \ + -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \ + -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/wctype.in.h; \ + } > $@-t && \ + mv $@-t $@ + +mostlyclean-local: mostlyclean-generic + @for dir in '' $(MOSTLYCLEANDIRS); do \ + if test -n "$$dir" && test -d $$dir; then \ + echo "rmdir $$dir"; rmdir $$dir; \ + fi; \ + done; \ + : + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: + +# Tell GNU make to disable its built-in pattern rules. +%:: %,v +%:: RCS/%,v +%:: RCS/% +%:: s.% +%:: SCCS/s.% diff --git a/local/recipes/tools/diffutils/source/lib/_Noreturn.h b/local/recipes/tools/diffutils/source/lib/_Noreturn.h new file mode 100644 index 0000000000..c44ad89b7c --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/_Noreturn.h @@ -0,0 +1,10 @@ +#if !defined _Noreturn && __STDC_VERSION__ < 201112 +# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ + || 0x5110 <= __SUNPRO_C) +# define _Noreturn __attribute__ ((__noreturn__)) +# elif 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn +# endif +#endif diff --git a/local/recipes/tools/diffutils/source/lib/alloca.c b/local/recipes/tools/diffutils/source/lib/alloca.c new file mode 100644 index 0000000000..ee0f018868 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/alloca.c @@ -0,0 +1,478 @@ +/* alloca.c -- allocate automatically reclaimed memory + (Mostly) portable public-domain implementation -- D A Gwyn + + This implementation of the PWB library alloca function, + which is used to allocate space off the run-time stack so + that it is automatically reclaimed upon procedure exit, + was inspired by discussions with J. Q. Johnson of Cornell. + J.Otto Tennant <jot@cray.com> contributed the Cray support. + + There are some preprocessor constants that can + be defined when compiling for your specific system, for + improved efficiency; however, the defaults should be okay. + + The general concept of this implementation is to keep + track of all alloca-allocated blocks, and reclaim any + that are found to be deeper in the stack than the current + invocation. This heuristic does not reclaim storage as + soon as it becomes invalid, but it will do so eventually. + + As a special case, alloca(0) reclaims storage without + allocating any. It is a good idea to use alloca(0) in + your main control loop, etc. to force garbage collection. */ + +#include <config.h> + +#include <alloca.h> + +#include <string.h> +#include <stdlib.h> + +#ifdef emacs +# include "lisp.h" +# include "blockinput.h" +# ifdef EMACS_FREE +# undef free +# define free EMACS_FREE +# endif +#else +# define memory_full() abort () +#endif + +/* If compiling with GCC 2, this file's not needed. */ +#if !defined (__GNUC__) || __GNUC__ < 2 + +/* If someone has defined alloca as a macro, + there must be some other way alloca is supposed to work. */ +# ifndef alloca + +# ifdef emacs +# ifdef static +/* actually, only want this if static is defined as "" + -- this is for usg, in which emacs must undefine static + in order to make unexec workable + */ +# ifndef STACK_DIRECTION +you +lose +-- must know STACK_DIRECTION at compile-time +/* Using #error here is not wise since this file should work for + old and obscure compilers. */ +# endif /* STACK_DIRECTION undefined */ +# endif /* static */ +# endif /* emacs */ + +/* If your stack is a linked list of frames, you have to + provide an "address metric" ADDRESS_FUNCTION macro. */ + +# if defined (CRAY) && defined (CRAY_STACKSEG_END) +long i00afunc (); +# define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) +# else +# define ADDRESS_FUNCTION(arg) &(arg) +# endif + +/* Define STACK_DIRECTION if you know the direction of stack + growth for your system; otherwise it will be automatically + deduced at run-time. + + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ + +# ifndef STACK_DIRECTION +# define STACK_DIRECTION 0 /* Direction unknown. */ +# endif + +# if STACK_DIRECTION != 0 + +# define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ + +# else /* STACK_DIRECTION == 0; need run-time code. */ + +static int stack_dir; /* 1 or -1 once known. */ +# define STACK_DIR stack_dir + +static int +find_stack_direction (int *addr, int depth) +{ + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; +} + +# endif /* STACK_DIRECTION == 0 */ + +/* An "alloca header" is used to: + (a) chain together all alloca'ed blocks; + (b) keep track of stack depth. + + It is very important that sizeof(header) agree with malloc + alignment chunk size. The following default should work okay. */ + +# ifndef ALIGN_SIZE +# define ALIGN_SIZE sizeof(double) +# endif + +typedef union hdr +{ + char align[ALIGN_SIZE]; /* To force sizeof(header). */ + struct + { + union hdr *next; /* For chaining headers. */ + char *deep; /* For stack depth measure. */ + } h; +} header; + +static header *last_alloca_header = NULL; /* -> last alloca header. */ + +/* Return a pointer to at least SIZE bytes of storage, + which will be automatically reclaimed upon exit from + the procedure that called alloca. Originally, this space + was supposed to be taken from the current stack frame of the + caller, but that method cannot be made to work for some + implementations of C, for example under Gould's UTX/32. */ + +void * +alloca (size_t size) +{ + auto char probe; /* Probes stack depth: */ + register char *depth = ADDRESS_FUNCTION (probe); + +# if STACK_DIRECTION == 0 + if (STACK_DIR == 0) /* Unknown growth direction. */ + STACK_DIR = find_stack_direction (NULL, (size & 1) + 20); +# endif + + /* Reclaim garbage, defined as all alloca'd storage that + was allocated from deeper in the stack than currently. */ + + { + register header *hp; /* Traverses linked list. */ + +# ifdef emacs + BLOCK_INPUT; +# endif + + for (hp = last_alloca_header; hp != NULL;) + if ((STACK_DIR > 0 && hp->h.deep > depth) + || (STACK_DIR < 0 && hp->h.deep < depth)) + { + register header *np = hp->h.next; + + free (hp); /* Collect garbage. */ + + hp = np; /* -> next header. */ + } + else + break; /* Rest are not deeper. */ + + last_alloca_header = hp; /* -> last valid storage. */ + +# ifdef emacs + UNBLOCK_INPUT; +# endif + } + + if (size == 0) + return NULL; /* No allocation required. */ + + /* Allocate combined header + user data storage. */ + + { + /* Address of header. */ + register header *new; + + size_t combined_size = sizeof (header) + size; + if (combined_size < sizeof (header)) + memory_full (); + + new = malloc (combined_size); + + if (! new) + memory_full (); + + new->h.next = last_alloca_header; + new->h.deep = depth; + + last_alloca_header = new; + + /* User storage begins just after header. */ + + return (void *) (new + 1); + } +} + +# if defined (CRAY) && defined (CRAY_STACKSEG_END) + +# ifdef DEBUG_I00AFUNC +# include <stdio.h> +# endif + +# ifndef CRAY_STACK +# define CRAY_STACK +# ifndef CRAY2 +/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ +struct stack_control_header + { + long shgrow:32; /* Number of times stack has grown. */ + long shaseg:32; /* Size of increments to stack. */ + long shhwm:32; /* High water mark of stack. */ + long shsize:32; /* Current size of stack (all segments). */ + }; + +/* The stack segment linkage control information occurs at + the high-address end of a stack segment. (The stack + grows from low addresses to high addresses.) The initial + part of the stack segment linkage control information is + 0200 (octal) words. This provides for register storage + for the routine which overflows the stack. */ + +struct stack_segment_linkage + { + long ss[0200]; /* 0200 overflow words. */ + long sssize:32; /* Number of words in this segment. */ + long ssbase:32; /* Offset to stack base. */ + long:32; + long sspseg:32; /* Offset to linkage control of previous + segment of stack. */ + long:32; + long sstcpt:32; /* Pointer to task common address block. */ + long sscsnm; /* Private control structure number for + microtasking. */ + long ssusr1; /* Reserved for user. */ + long ssusr2; /* Reserved for user. */ + long sstpid; /* Process ID for pid based multi-tasking. */ + long ssgvup; /* Pointer to multitasking thread giveup. */ + long sscray[7]; /* Reserved for Cray Research. */ + long ssa0; + long ssa1; + long ssa2; + long ssa3; + long ssa4; + long ssa5; + long ssa6; + long ssa7; + long sss0; + long sss1; + long sss2; + long sss3; + long sss4; + long sss5; + long sss6; + long sss7; + }; + +# else /* CRAY2 */ +/* The following structure defines the vector of words + returned by the STKSTAT library routine. */ +struct stk_stat + { + long now; /* Current total stack size. */ + long maxc; /* Amount of contiguous space which would + be required to satisfy the maximum + stack demand to date. */ + long high_water; /* Stack high-water mark. */ + long overflows; /* Number of stack overflow ($STKOFEN) calls. */ + long hits; /* Number of internal buffer hits. */ + long extends; /* Number of block extensions. */ + long stko_mallocs; /* Block allocations by $STKOFEN. */ + long underflows; /* Number of stack underflow calls ($STKRETN). */ + long stko_free; /* Number of deallocations by $STKRETN. */ + long stkm_free; /* Number of deallocations by $STKMRET. */ + long segments; /* Current number of stack segments. */ + long maxs; /* Maximum number of stack segments so far. */ + long pad_size; /* Stack pad size. */ + long current_address; /* Current stack segment address. */ + long current_size; /* Current stack segment size. This + number is actually corrupted by STKSTAT to + include the fifteen word trailer area. */ + long initial_address; /* Address of initial segment. */ + long initial_size; /* Size of initial segment. */ + }; + +/* The following structure describes the data structure which trails + any stack segment. I think that the description in 'asdef' is + out of date. I only describe the parts that I am sure about. */ + +struct stk_trailer + { + long this_address; /* Address of this block. */ + long this_size; /* Size of this block (does not include + this trailer). */ + long unknown2; + long unknown3; + long link; /* Address of trailer block of previous + segment. */ + long unknown5; + long unknown6; + long unknown7; + long unknown8; + long unknown9; + long unknown10; + long unknown11; + long unknown12; + long unknown13; + long unknown14; + }; + +# endif /* CRAY2 */ +# endif /* not CRAY_STACK */ + +# ifdef CRAY2 +/* Determine a "stack measure" for an arbitrary ADDRESS. + I doubt that "lint" will like this much. */ + +static long +i00afunc (long *address) +{ + struct stk_stat status; + struct stk_trailer *trailer; + long *block, size; + long result = 0; + + /* We want to iterate through all of the segments. The first + step is to get the stack status structure. We could do this + more quickly and more directly, perhaps, by referencing the + $LM00 common block, but I know that this works. */ + + STKSTAT (&status); + + /* Set up the iteration. */ + + trailer = (struct stk_trailer *) (status.current_address + + status.current_size + - 15); + + /* There must be at least one stack segment. Therefore it is + a fatal error if "trailer" is null. */ + + if (trailer == 0) + abort (); + + /* Discard segments that do not contain our argument address. */ + + while (trailer != 0) + { + block = (long *) trailer->this_address; + size = trailer->this_size; + if (block == 0 || size == 0) + abort (); + trailer = (struct stk_trailer *) trailer->link; + if ((block <= address) && (address < (block + size))) + break; + } + + /* Set the result to the offset in this segment and add the sizes + of all predecessor segments. */ + + result = address - block; + + if (trailer == 0) + { + return result; + } + + do + { + if (trailer->this_size <= 0) + abort (); + result += trailer->this_size; + trailer = (struct stk_trailer *) trailer->link; + } + while (trailer != 0); + + /* We are done. Note that if you present a bogus address (one + not in any segment), you will get a different number back, formed + from subtracting the address of the first block. This is probably + not what you want. */ + + return (result); +} + +# else /* not CRAY2 */ +/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. + Determine the number of the cell within the stack, + given the address of the cell. The purpose of this + routine is to linearize, in some sense, stack addresses + for alloca. */ + +static long +i00afunc (long address) +{ + long stkl = 0; + + long size, pseg, this_segment, stack; + long result = 0; + + struct stack_segment_linkage *ssptr; + + /* Register B67 contains the address of the end of the + current stack segment. If you (as a subprogram) store + your registers on the stack and find that you are past + the contents of B67, you have overflowed the segment. + + B67 also points to the stack segment linkage control + area, which is what we are really interested in. */ + + stkl = CRAY_STACKSEG_END (); + ssptr = (struct stack_segment_linkage *) stkl; + + /* If one subtracts 'size' from the end of the segment, + one has the address of the first word of the segment. + + If this is not the first segment, 'pseg' will be + nonzero. */ + + pseg = ssptr->sspseg; + size = ssptr->sssize; + + this_segment = stkl - size; + + /* It is possible that calling this routine itself caused + a stack overflow. Discard stack segments which do not + contain the target address. */ + + while (!(this_segment <= address && address <= stkl)) + { +# ifdef DEBUG_I00AFUNC + fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); +# endif + if (pseg == 0) + break; + stkl = stkl - pseg; + ssptr = (struct stack_segment_linkage *) stkl; + size = ssptr->sssize; + pseg = ssptr->sspseg; + this_segment = stkl - size; + } + + result = address - this_segment; + + /* If you subtract pseg from the current end of the stack, + you get the address of the previous stack segment's end. + This seems a little convoluted to me, but I'll bet you save + a cycle somewhere. */ + + while (pseg != 0) + { +# ifdef DEBUG_I00AFUNC + fprintf (stderr, "%011o %011o\n", pseg, size); +# endif + stkl = stkl - pseg; + ssptr = (struct stack_segment_linkage *) stkl; + size = ssptr->sssize; + pseg = ssptr->sspseg; + result += size; + } + return (result); +} + +# endif /* not CRAY2 */ +# endif /* CRAY */ + +# endif /* no alloca */ +#endif /* not GCC 2 */ diff --git a/local/recipes/tools/diffutils/source/lib/alloca.in.h b/local/recipes/tools/diffutils/source/lib/alloca.in.h new file mode 100644 index 0000000000..c3dc38a5b9 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/alloca.in.h @@ -0,0 +1,65 @@ +/* Memory allocation on the stack. + + Copyright (C) 1995, 1999, 2001-2004, 2006-2017 Free Software Foundation, + Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program; if not, see + <http://www.gnu.org/licenses/>. + */ + +/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H + means there is a real alloca function. */ +#ifndef _GL_ALLOCA_H +#define _GL_ALLOCA_H + +/* alloca (N) returns a pointer to N bytes of memory + allocated on the stack, which will last until the function returns. + Use of alloca should be avoided: + - inside arguments of function calls - undefined behaviour, + - in inline functions - the allocation may actually last until the + calling function returns, + - for huge N (say, N >= 65536) - you never know how large (or small) + the stack is, and when the stack cannot fulfill the memory allocation + request, the program just crashes. + */ + +#ifndef alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _AIX +# define alloca __alloca +# elif defined _MSC_VER +# include <malloc.h> +# define alloca _alloca +# elif defined __DECC && defined __VMS +# define alloca __ALLOCA +# elif defined __TANDEM && defined _TNS_E_TARGET +# ifdef __cplusplus +extern "C" +# endif +void *_alloca (unsigned short); +# pragma intrinsic (_alloca) +# define alloca _alloca +# elif defined __MVS__ +# include <stdlib.h> +# else +# include <stddef.h> +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +# endif +#endif + +#endif /* _GL_ALLOCA_H */ diff --git a/local/recipes/tools/diffutils/source/lib/allocator.c b/local/recipes/tools/diffutils/source/lib/allocator.c new file mode 100644 index 0000000000..2c1a3da03a --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/allocator.c @@ -0,0 +1,5 @@ +#define _GL_USE_STDLIB_ALLOC 1 +#include <config.h> +#include "allocator.h" +#include <stdlib.h> +struct allocator const stdlib_allocator = { malloc, realloc, free, NULL }; diff --git a/local/recipes/tools/diffutils/source/lib/allocator.h b/local/recipes/tools/diffutils/source/lib/allocator.h new file mode 100644 index 0000000000..650f8e071e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/allocator.h @@ -0,0 +1,58 @@ +/* Memory allocators such as malloc+free. + + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +#ifndef _GL_ALLOCATOR_H +#define _GL_ALLOCATOR_H + +#include <stddef.h> + +/* An object describing a memory allocator family. */ + +struct allocator +{ + /* Do not use GCC attributes such as __attribute__ ((malloc)) with + the function types pointed at by these members, because these + attributes do not work with pointers to functions. See + <http://lists.gnu.org/archive/html/bug-gnulib/2011-04/msg00007.html>. */ + + /* Call ALLOCATE to allocate memory, like 'malloc'. On failure ALLOCATE + should return NULL, though not necessarily set errno. When given + a zero size it may return NULL even if successful. */ + void *(*allocate) (size_t); + + /* If nonnull, call REALLOCATE to reallocate memory, like 'realloc'. + On failure REALLOCATE should return NULL, though not necessarily set + errno. When given a zero size it may return NULL even if + successful. */ + void *(*reallocate) (void *, size_t); + + /* Call FREE to free memory, like 'free'. */ + void (*free) (void *); + + /* If nonnull, call DIE (SIZE) if MALLOC (SIZE) or REALLOC (..., + SIZE) fails. DIE should not return. SIZE should equal SIZE_MAX + if size_t overflow was detected while calculating sizes to be + passed to MALLOC or REALLOC. */ + void (*die) (size_t); +}; + +/* An allocator using the stdlib functions and a null DIE function. */ +extern struct allocator const stdlib_allocator; + +#endif /* _GL_ALLOCATOR_H */ diff --git a/local/recipes/tools/diffutils/source/lib/anytostr.c b/local/recipes/tools/diffutils/source/lib/anytostr.c new file mode 100644 index 0000000000..74a3f1fd14 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/anytostr.c @@ -0,0 +1,57 @@ +/* anytostr.c -- convert integers to printable strings + + Copyright (C) 2001, 2006, 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert */ + +/* Tell gcc not to warn about the (i < 0) test, below. */ +#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__ +# pragma GCC diagnostic ignored "-Wtype-limits" +#elif defined __clang__ +# pragma clang diagnostic ignored "-Wtautological-compare" +#endif + +#include <config.h> + +#include "inttostr.h" + +/* Convert I to a printable string in BUF, which must be at least + INT_BUFSIZE_BOUND (INTTYPE) bytes long. Return the address of the + printable string, which need not start at BUF. */ + +char * __attribute_warn_unused_result__ +anytostr (inttype i, char *buf) +{ + char *p = buf + INT_STRLEN_BOUND (inttype); + *p = 0; + + if (i < 0) + { + do + *--p = '0' - i % 10; + while ((i /= 10) != 0); + + *--p = '-'; + } + else + { + do + *--p = '0' + i % 10; + while ((i /= 10) != 0); + } + + return p; +} diff --git a/local/recipes/tools/diffutils/source/lib/areadlink.c b/local/recipes/tools/diffutils/source/lib/areadlink.c new file mode 100644 index 0000000000..78afb3a4c0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/areadlink.c @@ -0,0 +1,56 @@ +/* areadlink.c -- readlink wrapper to return the link name in malloc'd storage + Unlike xreadlink and xreadlink_with_size, don't ever call exit. + + Copyright (C) 2001, 2003-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Jim Meyering <jim@meyering.net> + and Bruno Haible <bruno@clisp.org>. */ + +#include <config.h> + +/* Specification. */ +#include "areadlink.h" + +#include "careadlinkat.h" + +#include <stdlib.h> +#include <unistd.h> + +/* Get the symbolic link value of FILENAME and put it into BUFFER, with + size BUFFER_SIZE. This function acts like readlink but has + readlinkat's signature. */ +static ssize_t +careadlinkatcwd (int fd, char const *filename, char *buffer, + size_t buffer_size) +{ + /* FD must be AT_FDCWD here, otherwise the caller is using this + function in contexts it was not meant for. */ + if (fd != AT_FDCWD) + abort (); + return readlink (filename, buffer, buffer_size); +} + +/* Call readlink to get the symbolic link value of FILENAME. + Return a pointer to that NUL-terminated string in malloc'd storage. + If readlink fails, return NULL and set errno. + If allocation fails, or if the link value is longer than SIZE_MAX :-), + return NULL and set errno to ENOMEM. */ + +char * +areadlink (char const *filename) +{ + return careadlinkat (AT_FDCWD, filename, NULL, 0, NULL, careadlinkatcwd); +} diff --git a/local/recipes/tools/diffutils/source/lib/areadlink.h b/local/recipes/tools/diffutils/source/lib/areadlink.h new file mode 100644 index 0000000000..cb3b5e2910 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/areadlink.h @@ -0,0 +1,33 @@ +/* Read symbolic links without size limitation. + + Copyright (C) 2001, 2003-2004, 2007, 2009-2017 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Jim Meyering <jim@meyering.net> */ + +#include <stddef.h> + +extern char *areadlink (char const *filename); +extern char *areadlink_with_size (char const *filename, size_t size_hint); + +#if GNULIB_AREADLINKAT +extern char *areadlinkat (int fd, char const *filename); +#endif + +#if GNULIB_AREADLINKAT_WITH_SIZE +extern char *areadlinkat_with_size (int fd, char const *filename, + size_t size_hint); +#endif diff --git a/local/recipes/tools/diffutils/source/lib/arg-nonnull.h b/local/recipes/tools/diffutils/source/lib/arg-nonnull.h new file mode 100644 index 0000000000..1e62cc8982 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/arg-nonnull.h @@ -0,0 +1,26 @@ +/* A C macro for declaring that specific arguments must not be NULL. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools + that the values passed as arguments n, ..., m must be non-NULL pointers. + n = 1 stands for the first argument, n = 2 for the second argument etc. */ +#ifndef _GL_ARG_NONNULL +# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 +# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) +# else +# define _GL_ARG_NONNULL(params) +# endif +#endif diff --git a/local/recipes/tools/diffutils/source/lib/argmatch.c b/local/recipes/tools/diffutils/source/lib/argmatch.c new file mode 100644 index 0000000000..67ef88c10c --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/argmatch.c @@ -0,0 +1,275 @@ +/* argmatch.c -- find a match for a string in an array + + Copyright (C) 1990, 1998-1999, 2001-2007, 2009-2017 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by David MacKenzie <djm@ai.mit.edu> + Modified by Akim Demaille <demaille@inf.enst.fr> */ + +#include <config.h> + +/* Specification. */ +#include "argmatch.h" + +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "gettext.h" +#define _(msgid) gettext (msgid) + +#include "error.h" +#include "quotearg.h" +#include "quote.h" +#include "getprogname.h" + +#if USE_UNLOCKED_IO +# include "unlocked-io.h" +#endif + +/* When reporting an invalid argument, show nonprinting characters + by using the quoting style ARGMATCH_QUOTING_STYLE. Do not use + literal_quoting_style. */ +#ifndef ARGMATCH_QUOTING_STYLE +# define ARGMATCH_QUOTING_STYLE locale_quoting_style +#endif + +/* Non failing version of argmatch call this function after failing. */ +#ifndef ARGMATCH_DIE +# include "exitfail.h" +# define ARGMATCH_DIE exit (exit_failure) +#endif + +#ifdef ARGMATCH_DIE_DECL +ARGMATCH_DIE_DECL; +#endif + +static void +__argmatch_die (void) +{ + ARGMATCH_DIE; +} + +/* Used by XARGMATCH and XARGCASEMATCH. See description in argmatch.h. + Default to __argmatch_die, but allow caller to change this at run-time. */ +argmatch_exit_fn argmatch_die = __argmatch_die; + + +/* If ARG is an unambiguous match for an element of the + NULL-terminated array ARGLIST, return the index in ARGLIST + of the matched element, else -1 if it does not match any element + or -2 if it is ambiguous (is a prefix of more than one element). + + If VALLIST is none null, use it to resolve ambiguities limited to + synonyms, i.e., for + "yes", "yop" -> 0 + "no", "nope" -> 1 + "y" is a valid argument, for 0, and "n" for 1. */ + +ptrdiff_t +argmatch (const char *arg, const char *const *arglist, + const char *vallist, size_t valsize) +{ + size_t i; /* Temporary index in ARGLIST. */ + size_t arglen; /* Length of ARG. */ + ptrdiff_t matchind = -1; /* Index of first nonexact match. */ + bool ambiguous = false; /* If true, multiple nonexact match(es). */ + + arglen = strlen (arg); + + /* Test all elements for either exact match or abbreviated matches. */ + for (i = 0; arglist[i]; i++) + { + if (!strncmp (arglist[i], arg, arglen)) + { + if (strlen (arglist[i]) == arglen) + /* Exact match found. */ + return i; + else if (matchind == -1) + /* First nonexact match found. */ + matchind = i; + else + { + /* Second nonexact match found. */ + if (vallist == NULL + || memcmp (vallist + valsize * matchind, + vallist + valsize * i, valsize)) + { + /* There is a real ambiguity, or we could not + disambiguate. */ + ambiguous = true; + } + } + } + } + if (ambiguous) + return -2; + else + return matchind; +} + +/* Error reporting for argmatch. + CONTEXT is a description of the type of entity that was being matched. + VALUE is the invalid value that was given. + PROBLEM is the return value from argmatch. */ + +void +argmatch_invalid (const char *context, const char *value, ptrdiff_t problem) +{ + char const *format = (problem == -1 + ? _("invalid argument %s for %s") + : _("ambiguous argument %s for %s")); + + error (0, 0, format, quotearg_n_style (0, ARGMATCH_QUOTING_STYLE, value), + quote_n (1, context)); +} + +/* List the valid arguments for argmatch. + ARGLIST is the same as in argmatch. + VALLIST is a pointer to an array of values. + VALSIZE is the size of the elements of VALLIST */ +void +argmatch_valid (const char *const *arglist, + const char *vallist, size_t valsize) +{ + size_t i; + const char *last_val = NULL; + + /* We try to put synonyms on the same line. The assumption is that + synonyms follow each other */ + fputs (_("Valid arguments are:"), stderr); + for (i = 0; arglist[i]; i++) + if ((i == 0) + || memcmp (last_val, vallist + valsize * i, valsize)) + { + fprintf (stderr, "\n - %s", quote (arglist[i])); + last_val = vallist + valsize * i; + } + else + { + fprintf (stderr, ", %s", quote (arglist[i])); + } + putc ('\n', stderr); +} + +/* Never failing versions of the previous functions. + + CONTEXT is the context for which argmatch is called (e.g., + "--version-control", or "$VERSION_CONTROL" etc.). Upon failure, + calls the (supposed never to return) function EXIT_FN. */ + +ptrdiff_t +__xargmatch_internal (const char *context, + const char *arg, const char *const *arglist, + const char *vallist, size_t valsize, + argmatch_exit_fn exit_fn) +{ + ptrdiff_t res = argmatch (arg, arglist, vallist, valsize); + if (res >= 0) + /* Success. */ + return res; + + /* We failed. Explain why. */ + argmatch_invalid (context, arg, res); + argmatch_valid (arglist, vallist, valsize); + (*exit_fn) (); + + return -1; /* To please the compilers. */ +} + +/* Look for VALUE in VALLIST, an array of objects of size VALSIZE and + return the first corresponding argument in ARGLIST */ +const char * +argmatch_to_argument (const char *value, + const char *const *arglist, + const char *vallist, size_t valsize) +{ + size_t i; + + for (i = 0; arglist[i]; i++) + if (!memcmp (value, vallist + valsize * i, valsize)) + return arglist[i]; + return NULL; +} + +#ifdef TEST +/* + * Based on "getversion.c" by David MacKenzie <djm@gnu.ai.mit.edu> + */ + +/* When to make backup files. */ +enum backup_type +{ + /* Never make backups. */ + no_backups, + + /* Make simple backups of every file. */ + simple_backups, + + /* Make numbered backups of files that already have numbered backups, + and simple backups of the others. */ + numbered_existing_backups, + + /* Make numbered backups of every file. */ + numbered_backups +}; + +/* Two tables describing arguments (keys) and their corresponding + values */ +static const char *const backup_args[] = +{ + "no", "none", "off", + "simple", "never", + "existing", "nil", + "numbered", "t", + 0 +}; + +static const enum backup_type backup_vals[] = +{ + no_backups, no_backups, no_backups, + simple_backups, simple_backups, + numbered_existing_backups, numbered_existing_backups, + numbered_backups, numbered_backups +}; + +int +main (int argc, const char *const *argv) +{ + const char *cp; + enum backup_type backup_type = no_backups; + + if (argc > 2) + { + fprintf (stderr, "Usage: %s [VERSION_CONTROL]\n", getprogname ()); + exit (1); + } + + if ((cp = getenv ("VERSION_CONTROL"))) + backup_type = XARGMATCH ("$VERSION_CONTROL", cp, + backup_args, backup_vals); + + if (argc == 2) + backup_type = XARGMATCH (getprogname (), argv[1], + backup_args, backup_vals); + + printf ("The version control is '%s'\n", + ARGMATCH_TO_ARGUMENT (backup_type, backup_args, backup_vals)); + + return 0; +} +#endif diff --git a/local/recipes/tools/diffutils/source/lib/argmatch.h b/local/recipes/tools/diffutils/source/lib/argmatch.h new file mode 100644 index 0000000000..c7215c8efc --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/argmatch.h @@ -0,0 +1,111 @@ +/* argmatch.h -- definitions and prototypes for argmatch.c + + Copyright (C) 1990, 1998-1999, 2001-2002, 2004-2005, 2009-2017 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by David MacKenzie <djm@ai.mit.edu> + Modified by Akim Demaille <demaille@inf.enst.fr> */ + +#ifndef ARGMATCH_H_ +# define ARGMATCH_H_ 1 + +# include <stddef.h> + +# include "verify.h" + +#ifdef __cplusplus +extern "C" { +#endif + +# define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array)) + +/* Assert there are as many real arguments as there are values + (argument list ends with a NULL guard). */ + +# define ARGMATCH_VERIFY(Arglist, Vallist) \ + verify (ARRAY_CARDINALITY (Arglist) == ARRAY_CARDINALITY (Vallist) + 1) + +/* Return the index of the element of ARGLIST (NULL terminated) that + matches with ARG. If VALLIST is not NULL, then use it to resolve + false ambiguities (i.e., different matches of ARG but corresponding + to the same values in VALLIST). */ + +ptrdiff_t argmatch (char const *arg, char const *const *arglist, + char const *vallist, size_t valsize) _GL_ATTRIBUTE_PURE; + +# define ARGMATCH(Arg, Arglist, Vallist) \ + argmatch (Arg, Arglist, (char const *) (Vallist), sizeof *(Vallist)) + +/* xargmatch calls this function when it fails. This function should not + return. By default, this is a function that calls ARGMATCH_DIE which + in turn defaults to 'exit (exit_failure)'. */ +typedef void (*argmatch_exit_fn) (void); +extern argmatch_exit_fn argmatch_die; + +/* Report on stderr why argmatch failed. Report correct values. */ + +void argmatch_invalid (char const *context, char const *value, + ptrdiff_t problem); + +/* Left for compatibility with the old name invalid_arg */ + +# define invalid_arg(Context, Value, Problem) \ + argmatch_invalid (Context, Value, Problem) + + + +/* Report on stderr the list of possible arguments. */ + +void argmatch_valid (char const *const *arglist, + char const *vallist, size_t valsize); + +# define ARGMATCH_VALID(Arglist, Vallist) \ + argmatch_valid (Arglist, (char const *) (Vallist), sizeof *(Vallist)) + + + +/* Same as argmatch, but upon failure, report an explanation of the + failure, and exit using the function EXIT_FN. */ + +ptrdiff_t __xargmatch_internal (char const *context, + char const *arg, char const *const *arglist, + char const *vallist, size_t valsize, + argmatch_exit_fn exit_fn); + +/* Programmer friendly interface to __xargmatch_internal. */ + +# define XARGMATCH(Context, Arg, Arglist, Vallist) \ + ((Vallist) [__xargmatch_internal (Context, Arg, Arglist, \ + (char const *) (Vallist), \ + sizeof *(Vallist), \ + argmatch_die)]) + +/* Convert a value into a corresponding argument. */ + +char const *argmatch_to_argument (char const *value, + char const *const *arglist, + char const *vallist, size_t valsize) + _GL_ATTRIBUTE_PURE; + +# define ARGMATCH_TO_ARGUMENT(Value, Arglist, Vallist) \ + argmatch_to_argument (Value, Arglist, \ + (char const *) (Vallist), sizeof *(Vallist)) + +#ifdef __cplusplus +} +#endif + +#endif /* ARGMATCH_H_ */ diff --git a/local/recipes/tools/diffutils/source/lib/asnprintf.c b/local/recipes/tools/diffutils/source/lib/asnprintf.c new file mode 100644 index 0000000000..14ab3e8797 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/asnprintf.c @@ -0,0 +1,34 @@ +/* Formatted output to strings. + Copyright (C) 1999, 2002, 2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "vasnprintf.h" + +#include <stdarg.h> + +char * +asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) +{ + va_list args; + char *result; + + va_start (args, format); + result = vasnprintf (resultbuf, lengthp, format, args); + va_end (args); + return result; +} diff --git a/local/recipes/tools/diffutils/source/lib/asprintf.c b/local/recipes/tools/diffutils/source/lib/asprintf.c new file mode 100644 index 0000000000..6635f49500 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/asprintf.c @@ -0,0 +1,39 @@ +/* Formatted output to strings. + Copyright (C) 1999, 2002, 2006-2007, 2009-2017 Free Software Foundation, + Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#ifdef IN_LIBASPRINTF +# include "vasprintf.h" +#else +# include <stdio.h> +#endif + +#include <stdarg.h> + +int +asprintf (char **resultp, const char *format, ...) +{ + va_list args; + int result; + + va_start (args, format); + result = vasprintf (resultp, format, args); + va_end (args); + return result; +} diff --git a/local/recipes/tools/diffutils/source/lib/assure.h b/local/recipes/tools/diffutils/source/lib/assure.h new file mode 100644 index 0000000000..2fc30432a5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/assure.h @@ -0,0 +1,37 @@ +/* Run-time assert-like macros. + + Copyright (C) 2014-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +#ifndef _GL_ASSURE_H +#define _GL_ASSURE_H + +#include <assert.h> + +/* Check E's value at runtime, and report an error and abort if not. + However, do nothng if NDEBUG is defined. + + Unlike standard 'assert', this macro always compiles E even when NDEBUG + is defined, so as to catch typos and avoid some GCC warnings. */ + +#ifdef NDEBUG +# define assure(E) ((void) (0 && (E))) +#else +# define assure(E) assert (E) +#endif + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/basename-lgpl.c b/local/recipes/tools/diffutils/source/lib/basename-lgpl.c new file mode 100644 index 0000000000..54d3cc0af3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/basename-lgpl.c @@ -0,0 +1,75 @@ +/* basename.c -- return the last element in a file name + + Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2017 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "dirname.h" + +#include <string.h> + +/* Return the address of the last file name component of NAME. If + NAME has no relative file name components because it is a file + system root, return the empty string. */ + +char * +last_component (char const *name) +{ + char const *base = name + FILE_SYSTEM_PREFIX_LEN (name); + char const *p; + bool saw_slash = false; + + while (ISSLASH (*base)) + base++; + + for (p = base; *p; p++) + { + if (ISSLASH (*p)) + saw_slash = true; + else if (saw_slash) + { + base = p; + saw_slash = false; + } + } + + return (char *) base; +} + +/* Return the length of the basename NAME. Typically NAME is the + value returned by base_name or last_component. Act like strlen + (NAME), except omit all trailing slashes. */ + +size_t +base_len (char const *name) +{ + size_t len; + size_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name); + + for (len = strlen (name); 1 < len && ISSLASH (name[len - 1]); len--) + continue; + + if (DOUBLE_SLASH_IS_DISTINCT_ROOT && len == 1 + && ISSLASH (name[0]) && ISSLASH (name[1]) && ! name[2]) + return 2; + + if (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE && prefix_len + && len == prefix_len && ISSLASH (name[prefix_len])) + return prefix_len + 1; + + return len; +} diff --git a/local/recipes/tools/diffutils/source/lib/basename.c b/local/recipes/tools/diffutils/source/lib/basename.c new file mode 100644 index 0000000000..03536354a3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/basename.c @@ -0,0 +1,58 @@ +/* basename.c -- return the last element in a file name + + Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2017 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "dirname.h" + +#include <string.h> +#include "xalloc.h" +#include "xstrndup.h" + +char * +base_name (char const *name) +{ + char const *base = last_component (name); + size_t length; + + /* If there is no last component, then name is a file system root or the + empty string. */ + if (! *base) + return xstrndup (name, base_len (name)); + + /* Collapse a sequence of trailing slashes into one. */ + length = base_len (base); + if (ISSLASH (base[length])) + length++; + + /* On systems with drive letters, "a/b:c" must return "./b:c" rather + than "b:c" to avoid confusion with a drive letter. On systems + with pure POSIX semantics, this is not an issue. */ + if (FILE_SYSTEM_PREFIX_LEN (base)) + { + char *p = xmalloc (length + 3); + p[0] = '.'; + p[1] = '/'; + memcpy (p + 2, base, length); + p[length + 2] = '\0'; + return p; + } + + /* Finally, copy the basename. */ + return xstrndup (base, length); +} diff --git a/local/recipes/tools/diffutils/source/lib/binary-io.c b/local/recipes/tools/diffutils/source/lib/binary-io.c new file mode 100644 index 0000000000..a7558b20fd --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/binary-io.c @@ -0,0 +1,37 @@ +/* Binary mode I/O. + Copyright 2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#define BINARY_IO_INLINE _GL_EXTERN_INLINE +#include "binary-io.h" + +#if defined __DJGPP__ || defined __EMX__ +# include <errno.h> +# include <unistd.h> + +int +__gl_setmode_check (int fd) +{ + if (isatty (fd)) + { + errno = EINVAL; + return -1; + } + else + return 0; +} +#endif diff --git a/local/recipes/tools/diffutils/source/lib/binary-io.h b/local/recipes/tools/diffutils/source/lib/binary-io.h new file mode 100644 index 0000000000..9f1dde108e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/binary-io.h @@ -0,0 +1,83 @@ +/* Binary mode I/O. + Copyright (C) 2001, 2003, 2005, 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _BINARY_H +#define _BINARY_H + +/* For systems that distinguish between text and binary I/O. + O_BINARY is guaranteed by the gnulib <fcntl.h>. */ +#include <fcntl.h> + +/* The MSVC7 <stdio.h> doesn't like to be included after '#define fileno ...', + so we include it here first. */ +#include <stdio.h> + +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef BINARY_IO_INLINE +# define BINARY_IO_INLINE _GL_INLINE +#endif + +#if O_BINARY +# if defined __EMX__ || defined __DJGPP__ || defined __CYGWIN__ +# include <io.h> /* declares setmode() */ +# define __gl_setmode setmode +# else +# define __gl_setmode _setmode +# undef fileno +# define fileno _fileno +# endif +#else + /* On reasonable systems, binary I/O is the only choice. */ + /* Use a function rather than a macro, to avoid gcc warnings + "warning: statement with no effect". */ +BINARY_IO_INLINE int +__gl_setmode (int fd, int mode) +{ + (void) fd; + (void) mode; + return O_BINARY; +} +#endif + +#if defined __DJGPP__ || defined __EMX__ +extern int __gl_setmode_check (int); +#else +BINARY_IO_INLINE int +__gl_setmode_check (int fd) { return 0; } +#endif + +/* Set FD's mode to MODE, which should be either O_TEXT or O_BINARY. + Return the old mode if successful, -1 (setting errno) on failure. + Ordinarily this function would be called 'setmode', since that is + its name on MS-Windows, but it is called 'set_binary_mode' here + to avoid colliding with a BSD function of another name. */ + +BINARY_IO_INLINE int +set_binary_mode (int fd, int mode) +{ + int r = __gl_setmode_check (fd); + return r != 0 ? r : __gl_setmode (fd, mode); +} + +/* This macro is obsolescent. */ +#define SET_BINARY(fd) ((void) set_binary_mode (fd, O_BINARY)) + +_GL_INLINE_HEADER_END + +#endif /* _BINARY_H */ diff --git a/local/recipes/tools/diffutils/source/lib/bitrotate.c b/local/recipes/tools/diffutils/source/lib/bitrotate.c new file mode 100644 index 0000000000..a8f602889d --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/bitrotate.c @@ -0,0 +1,3 @@ +#include <config.h> +#define BITROTATE_INLINE _GL_EXTERN_INLINE +#include "bitrotate.h" diff --git a/local/recipes/tools/diffutils/source/lib/bitrotate.h b/local/recipes/tools/diffutils/source/lib/bitrotate.h new file mode 100644 index 0000000000..ea14afbe3f --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/bitrotate.h @@ -0,0 +1,136 @@ +/* bitrotate.h - Rotate bits in integers + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Simon Josefsson <simon@josefsson.org>, 2008. */ + +#ifndef _GL_BITROTATE_H +#define _GL_BITROTATE_H + +#include <limits.h> +#include <stdint.h> +#include <sys/types.h> + +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef BITROTATE_INLINE +# define BITROTATE_INLINE _GL_INLINE +#endif + +#ifdef UINT64_MAX +/* Given an unsigned 64-bit argument X, return the value corresponding + to rotating the bits N steps to the left. N must be between 1 and + 63 inclusive. */ +BITROTATE_INLINE uint64_t +rotl64 (uint64_t x, int n) +{ + return ((x << n) | (x >> (64 - n))) & UINT64_MAX; +} + +/* Given an unsigned 64-bit argument X, return the value corresponding + to rotating the bits N steps to the right. N must be between 1 to + 63 inclusive.*/ +BITROTATE_INLINE uint64_t +rotr64 (uint64_t x, int n) +{ + return ((x >> n) | (x << (64 - n))) & UINT64_MAX; +} +#endif + +/* Given an unsigned 32-bit argument X, return the value corresponding + to rotating the bits N steps to the left. N must be between 1 and + 31 inclusive. */ +BITROTATE_INLINE uint32_t +rotl32 (uint32_t x, int n) +{ + return ((x << n) | (x >> (32 - n))) & UINT32_MAX; +} + +/* Given an unsigned 32-bit argument X, return the value corresponding + to rotating the bits N steps to the right. N must be between 1 to + 31 inclusive.*/ +BITROTATE_INLINE uint32_t +rotr32 (uint32_t x, int n) +{ + return ((x >> n) | (x << (32 - n))) & UINT32_MAX; +} + +/* Given a size_t argument X, return the value corresponding + to rotating the bits N steps to the left. N must be between 1 and + (CHAR_BIT * sizeof (size_t) - 1) inclusive. */ +BITROTATE_INLINE size_t +rotl_sz (size_t x, int n) +{ + return ((x << n) | (x >> ((CHAR_BIT * sizeof x) - n))) & SIZE_MAX; +} + +/* Given a size_t argument X, return the value corresponding + to rotating the bits N steps to the right. N must be between 1 to + (CHAR_BIT * sizeof (size_t) - 1) inclusive. */ +BITROTATE_INLINE size_t +rotr_sz (size_t x, int n) +{ + return ((x >> n) | (x << ((CHAR_BIT * sizeof x) - n))) & SIZE_MAX; +} + +/* Given an unsigned 16-bit argument X, return the value corresponding + to rotating the bits N steps to the left. N must be between 1 to + 15 inclusive, but on most relevant targets N can also be 0 and 16 + because 'int' is at least 32 bits and the arguments must widen + before shifting. */ +BITROTATE_INLINE uint16_t +rotl16 (uint16_t x, int n) +{ + return ((x << n) | (x >> (16 - n))) & UINT16_MAX; +} + +/* Given an unsigned 16-bit argument X, return the value corresponding + to rotating the bits N steps to the right. N must be in 1 to 15 + inclusive, but on most relevant targets N can also be 0 and 16 + because 'int' is at least 32 bits and the arguments must widen + before shifting. */ +BITROTATE_INLINE uint16_t +rotr16 (uint16_t x, int n) +{ + return ((x >> n) | (x << (16 - n))) & UINT16_MAX; +} + +/* Given an unsigned 8-bit argument X, return the value corresponding + to rotating the bits N steps to the left. N must be between 1 to 7 + inclusive, but on most relevant targets N can also be 0 and 8 + because 'int' is at least 32 bits and the arguments must widen + before shifting. */ +BITROTATE_INLINE uint8_t +rotl8 (uint8_t x, int n) +{ + return ((x << n) | (x >> (8 - n))) & UINT8_MAX; +} + +/* Given an unsigned 8-bit argument X, return the value corresponding + to rotating the bits N steps to the right. N must be in 1 to 7 + inclusive, but on most relevant targets N can also be 0 and 8 + because 'int' is at least 32 bits and the arguments must widen + before shifting. */ +BITROTATE_INLINE uint8_t +rotr8 (uint8_t x, int n) +{ + return ((x >> n) | (x << (8 - n))) & UINT8_MAX; +} + +_GL_INLINE_HEADER_END + +#endif /* _GL_BITROTATE_H */ diff --git a/local/recipes/tools/diffutils/source/lib/btowc.c b/local/recipes/tools/diffutils/source/lib/btowc.c new file mode 100644 index 0000000000..214d2b7fc8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/btowc.c @@ -0,0 +1,39 @@ +/* Convert unibyte character to wide character. + Copyright (C) 2008, 2010-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <wchar.h> + +#include <stdio.h> +#include <stdlib.h> + +wint_t +btowc (int c) +{ + if (c != EOF) + { + char buf[1]; + wchar_t wc; + + buf[0] = c; + if (mbtowc (&wc, buf, 1) >= 0) + return wc; + } + return WEOF; +} diff --git a/local/recipes/tools/diffutils/source/lib/c++defs.h b/local/recipes/tools/diffutils/source/lib/c++defs.h new file mode 100644 index 0000000000..f03f3591c3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/c++defs.h @@ -0,0 +1,316 @@ +/* C++ compatible function declaration macros. + Copyright (C) 2010-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _GL_CXXDEFS_H +#define _GL_CXXDEFS_H + +/* Begin/end the GNULIB_NAMESPACE namespace. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE { +# define _GL_END_NAMESPACE } +#else +# define _GL_BEGIN_NAMESPACE +# define _GL_END_NAMESPACE +#endif + +/* The three most frequent use cases of these macros are: + + * For providing a substitute for a function that is missing on some + platforms, but is declared and works fine on the platforms on which + it exists: + + #if @GNULIB_FOO@ + # if !@HAVE_FOO@ + _GL_FUNCDECL_SYS (foo, ...); + # endif + _GL_CXXALIAS_SYS (foo, ...); + _GL_CXXALIASWARN (foo); + #elif defined GNULIB_POSIXCHECK + ... + #endif + + * For providing a replacement for a function that exists on all platforms, + but is broken/insufficient and needs to be replaced on some platforms: + + #if @GNULIB_FOO@ + # if @REPLACE_FOO@ + # if !(defined __cplusplus && defined GNULIB_NAMESPACE) + # undef foo + # define foo rpl_foo + # endif + _GL_FUNCDECL_RPL (foo, ...); + _GL_CXXALIAS_RPL (foo, ...); + # else + _GL_CXXALIAS_SYS (foo, ...); + # endif + _GL_CXXALIASWARN (foo); + #elif defined GNULIB_POSIXCHECK + ... + #endif + + * For providing a replacement for a function that exists on some platforms + but is broken/insufficient and needs to be replaced on some of them and + is additionally either missing or undeclared on some other platforms: + + #if @GNULIB_FOO@ + # if @REPLACE_FOO@ + # if !(defined __cplusplus && defined GNULIB_NAMESPACE) + # undef foo + # define foo rpl_foo + # endif + _GL_FUNCDECL_RPL (foo, ...); + _GL_CXXALIAS_RPL (foo, ...); + # else + # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@ + _GL_FUNCDECL_SYS (foo, ...); + # endif + _GL_CXXALIAS_SYS (foo, ...); + # endif + _GL_CXXALIASWARN (foo); + #elif defined GNULIB_POSIXCHECK + ... + #endif +*/ + +/* _GL_EXTERN_C declaration; + performs the declaration with C linkage. */ +#if defined __cplusplus +# define _GL_EXTERN_C extern "C" +#else +# define _GL_EXTERN_C extern +#endif + +/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes); + declares a replacement function, named rpl_func, with the given prototype, + consisting of return type, parameters, and attributes. + Example: + _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) + _GL_ARG_NONNULL ((1))); + */ +#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \ + _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes) +#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \ + _GL_EXTERN_C rettype rpl_func parameters_and_attributes + +/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes); + declares the system function, named func, with the given prototype, + consisting of return type, parameters, and attributes. + Example: + _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...) + _GL_ARG_NONNULL ((1))); + */ +#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ + _GL_EXTERN_C rettype func parameters_and_attributes + +/* _GL_CXXALIAS_RPL (func, rettype, parameters); + declares a C++ alias called GNULIB_NAMESPACE::func + that redirects to rpl_func, if GNULIB_NAMESPACE is defined. + Example: + _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); + + Wrapping rpl_func in an object with an inline conversion operator + avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is + actually used in the program. */ +#define _GL_CXXALIAS_RPL(func,rettype,parameters) \ + _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ + namespace GNULIB_NAMESPACE \ + { \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return ::rpl_func; \ + } \ + } func = {}; \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); + is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); + except that the C function rpl_func may have a slightly different + declaration. A cast is used to silence the "invalid conversion" error + that would otherwise occur. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ + namespace GNULIB_NAMESPACE \ + { \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return reinterpret_cast<type>(::rpl_func); \ + } \ + } func = {}; \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIAS_SYS (func, rettype, parameters); + declares a C++ alias called GNULIB_NAMESPACE::func + that redirects to the system provided function func, if GNULIB_NAMESPACE + is defined. + Example: + _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); + + Wrapping func in an object with an inline conversion operator + avoids a reference to func unless GNULIB_NAMESPACE::func is + actually used in the program. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ + namespace GNULIB_NAMESPACE \ + { \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return ::func; \ + } \ + } func = {}; \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters); + is like _GL_CXXALIAS_SYS (func, rettype, parameters); + except that the C function func may have a slightly different declaration. + A cast is used to silence the "invalid conversion" error that would + otherwise occur. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ + namespace GNULIB_NAMESPACE \ + { \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return reinterpret_cast<type>(::func); \ + } \ + } func = {}; \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2); + is like _GL_CXXALIAS_SYS (func, rettype, parameters); + except that the C function is picked among a set of overloaded functions, + namely the one with rettype2 and parameters2. Two consecutive casts + are used to silence the "cannot find a match" and "invalid conversion" + errors that would otherwise occur. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE + /* The outer cast must be a reinterpret_cast. + The inner cast: When the function is defined as a set of overloaded + functions, it works as a static_cast<>, choosing the designated variant. + When the function is defined as a single variant, it works as a + reinterpret_cast<>. The parenthesized cast syntax works both ways. */ +# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ + namespace GNULIB_NAMESPACE \ + { \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \ + } \ + } func = {}; \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIASWARN (func); + causes a warning to be emitted when ::func is used but not when + GNULIB_NAMESPACE::func is used. func must be defined without overloaded + variants. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIASWARN(func) \ + _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) +# define _GL_CXXALIASWARN_1(func,namespace) \ + _GL_CXXALIASWARN_2 (func, namespace) +/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, + we enable the warning only when not optimizing. */ +# if !__OPTIMIZE__ +# define _GL_CXXALIASWARN_2(func,namespace) \ + _GL_WARN_ON_USE (func, \ + "The symbol ::" #func " refers to the system function. " \ + "Use " #namespace "::" #func " instead.") +# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING +# define _GL_CXXALIASWARN_2(func,namespace) \ + extern __typeof__ (func) func +# else +# define _GL_CXXALIASWARN_2(func,namespace) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +# endif +#else +# define _GL_CXXALIASWARN(func) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes); + causes a warning to be emitted when the given overloaded variant of ::func + is used but not when GNULIB_NAMESPACE::func is used. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ + _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ + GNULIB_NAMESPACE) +# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ + _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) +/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, + we enable the warning only when not optimizing. */ +# if !__OPTIMIZE__ +# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ + _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ + "The symbol ::" #func " refers to the system function. " \ + "Use " #namespace "::" #func " instead.") +# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING +# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ + extern __typeof__ (func) func +# else +# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +# endif +#else +# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +#endif /* _GL_CXXDEFS_H */ diff --git a/local/recipes/tools/diffutils/source/lib/c-ctype.c b/local/recipes/tools/diffutils/source/lib/c-ctype.c new file mode 100644 index 0000000000..5d9d4d87a6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/c-ctype.c @@ -0,0 +1,3 @@ +#include <config.h> +#define C_CTYPE_INLINE _GL_EXTERN_INLINE +#include "c-ctype.h" diff --git a/local/recipes/tools/diffutils/source/lib/c-ctype.h b/local/recipes/tools/diffutils/source/lib/c-ctype.h new file mode 100644 index 0000000000..bcdba6b996 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/c-ctype.h @@ -0,0 +1,366 @@ +/* Character handling in C locale. + + These functions work like the corresponding functions in <ctype.h>, + except that they have the C (POSIX) locale hardwired, whereas the + <ctype.h> functions' behaviour depends on the current locale set via + setlocale. + + Copyright (C) 2000-2003, 2006, 2008-2017 Free Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef C_CTYPE_H +#define C_CTYPE_H + +#include <stdbool.h> + +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef C_CTYPE_INLINE +# define C_CTYPE_INLINE _GL_INLINE +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/* The functions defined in this file assume the "C" locale and a character + set without diacritics (ASCII-US or EBCDIC-US or something like that). + Even if the "C" locale on a particular system is an extension of the ASCII + character set (like on BeOS, where it is UTF-8, or on AmigaOS, where it + is ISO-8859-1), the functions in this file recognize only the ASCII + characters. */ + + +#if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126) +/* The character set is ASCII or one of its variants or extensions, not EBCDIC. + Testing the value of '\n' and '\r' is not relevant. */ +# define C_CTYPE_ASCII 1 +#elif ! (' ' == '\x40' && '0' == '\xf0' \ + && 'A' == '\xc1' && 'J' == '\xd1' && 'S' == '\xe2' \ + && 'a' == '\x81' && 'j' == '\x91' && 's' == '\xa2') +# error "Only ASCII and EBCDIC are supported" +#endif + +#if 'A' < 0 +# error "EBCDIC and char is signed -- not supported" +#endif + +/* Cases for control characters. */ + +#define _C_CTYPE_CNTRL \ + case '\a': case '\b': case '\f': case '\n': \ + case '\r': case '\t': case '\v': \ + _C_CTYPE_OTHER_CNTRL + +/* ASCII control characters other than those with \-letter escapes. */ + +#if C_CTYPE_ASCII +# define _C_CTYPE_OTHER_CNTRL \ + case '\x00': case '\x01': case '\x02': case '\x03': \ + case '\x04': case '\x05': case '\x06': case '\x0e': \ + case '\x0f': case '\x10': case '\x11': case '\x12': \ + case '\x13': case '\x14': case '\x15': case '\x16': \ + case '\x17': case '\x18': case '\x19': case '\x1a': \ + case '\x1b': case '\x1c': case '\x1d': case '\x1e': \ + case '\x1f': case '\x7f' +#else + /* Use EBCDIC code page 1047's assignments for ASCII control chars; + assume all EBCDIC code pages agree about these assignments. */ +# define _C_CTYPE_OTHER_CNTRL \ + case '\x00': case '\x01': case '\x02': case '\x03': \ + case '\x07': case '\x0e': case '\x0f': case '\x10': \ + case '\x11': case '\x12': case '\x13': case '\x18': \ + case '\x19': case '\x1c': case '\x1d': case '\x1e': \ + case '\x1f': case '\x26': case '\x27': case '\x2d': \ + case '\x2e': case '\x32': case '\x37': case '\x3c': \ + case '\x3d': case '\x3f' +#endif + +/* Cases for lowercase hex letters, and lowercase letters, all offset by N. */ + +#define _C_CTYPE_LOWER_A_THRU_F_N(N) \ + case 'a' + (N): case 'b' + (N): case 'c' + (N): case 'd' + (N): \ + case 'e' + (N): case 'f' + (N) +#define _C_CTYPE_LOWER_N(N) \ + _C_CTYPE_LOWER_A_THRU_F_N(N): \ + case 'g' + (N): case 'h' + (N): case 'i' + (N): case 'j' + (N): \ + case 'k' + (N): case 'l' + (N): case 'm' + (N): case 'n' + (N): \ + case 'o' + (N): case 'p' + (N): case 'q' + (N): case 'r' + (N): \ + case 's' + (N): case 't' + (N): case 'u' + (N): case 'v' + (N): \ + case 'w' + (N): case 'x' + (N): case 'y' + (N): case 'z' + (N) + +/* Cases for hex letters, digits, lower, punct, and upper. */ + +#define _C_CTYPE_A_THRU_F \ + _C_CTYPE_LOWER_A_THRU_F_N (0): \ + _C_CTYPE_LOWER_A_THRU_F_N ('A' - 'a') +#define _C_CTYPE_DIGIT \ + case '0': case '1': case '2': case '3': \ + case '4': case '5': case '6': case '7': \ + case '8': case '9' +#define _C_CTYPE_LOWER _C_CTYPE_LOWER_N (0) +#define _C_CTYPE_PUNCT \ + case '!': case '"': case '#': case '$': \ + case '%': case '&': case '\'': case '(': \ + case ')': case '*': case '+': case ',': \ + case '-': case '.': case '/': case ':': \ + case ';': case '<': case '=': case '>': \ + case '?': case '@': case '[': case '\\': \ + case ']': case '^': case '_': case '`': \ + case '{': case '|': case '}': case '~' +#define _C_CTYPE_UPPER _C_CTYPE_LOWER_N ('A' - 'a') + + +/* Function definitions. */ + +/* Unlike the functions in <ctype.h>, which require an argument in the range + of the 'unsigned char' type, the functions here operate on values that are + in the 'unsigned char' range or in the 'char' range. In other words, + when you have a 'char' value, you need to cast it before using it as + argument to a <ctype.h> function: + + const char *s = ...; + if (isalpha ((unsigned char) *s)) ... + + but you don't need to cast it for the functions defined in this file: + + const char *s = ...; + if (c_isalpha (*s)) ... + */ + +C_CTYPE_INLINE bool +c_isalnum (int c) +{ + switch (c) + { + _C_CTYPE_DIGIT: + _C_CTYPE_LOWER: + _C_CTYPE_UPPER: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_isalpha (int c) +{ + switch (c) + { + _C_CTYPE_LOWER: + _C_CTYPE_UPPER: + return true; + default: + return false; + } +} + +/* The function isascii is not locale dependent. + Its use in EBCDIC is questionable. */ +C_CTYPE_INLINE bool +c_isascii (int c) +{ + switch (c) + { + case ' ': + _C_CTYPE_CNTRL: + _C_CTYPE_DIGIT: + _C_CTYPE_LOWER: + _C_CTYPE_PUNCT: + _C_CTYPE_UPPER: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_isblank (int c) +{ + return c == ' ' || c == '\t'; +} + +C_CTYPE_INLINE bool +c_iscntrl (int c) +{ + switch (c) + { + _C_CTYPE_CNTRL: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_isdigit (int c) +{ + switch (c) + { + _C_CTYPE_DIGIT: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_isgraph (int c) +{ + switch (c) + { + _C_CTYPE_DIGIT: + _C_CTYPE_LOWER: + _C_CTYPE_PUNCT: + _C_CTYPE_UPPER: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_islower (int c) +{ + switch (c) + { + _C_CTYPE_LOWER: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_isprint (int c) +{ + switch (c) + { + case ' ': + _C_CTYPE_DIGIT: + _C_CTYPE_LOWER: + _C_CTYPE_PUNCT: + _C_CTYPE_UPPER: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_ispunct (int c) +{ + switch (c) + { + _C_CTYPE_PUNCT: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_isspace (int c) +{ + switch (c) + { + case ' ': case '\t': case '\n': case '\v': case '\f': case '\r': + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_isupper (int c) +{ + switch (c) + { + _C_CTYPE_UPPER: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_isxdigit (int c) +{ + switch (c) + { + _C_CTYPE_DIGIT: + _C_CTYPE_A_THRU_F: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE int +c_tolower (int c) +{ + switch (c) + { + _C_CTYPE_UPPER: + return c - 'A' + 'a'; + default: + return c; + } +} + +C_CTYPE_INLINE int +c_toupper (int c) +{ + switch (c) + { + _C_CTYPE_LOWER: + return c - 'a' + 'A'; + default: + return c; + } +} + +#ifdef __cplusplus +} +#endif + +_GL_INLINE_HEADER_END + +#endif /* C_CTYPE_H */ diff --git a/local/recipes/tools/diffutils/source/lib/c-stack.c b/local/recipes/tools/diffutils/source/lib/c-stack.c new file mode 100644 index 0000000000..656675ec87 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/c-stack.c @@ -0,0 +1,329 @@ +/* Stack overflow handling. + + Copyright (C) 2002, 2004, 2006, 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +/* NOTES: + + A program that uses alloca, dynamic arrays, or large local + variables may extend the stack by more than a page at a time. If + so, when the stack overflows the operating system may not detect + the overflow until the program uses the array, and this module may + incorrectly report a program error instead of a stack overflow. + + To avoid this problem, allocate only small objects on the stack; a + program should be OK if it limits single allocations to a page or + less. Allocate larger arrays in static storage, or on the heap + (e.g., with malloc). Yes, this is a pain, but we don't know of any + better solution that is portable. + + No attempt has been made to deal with multithreaded applications. */ + +#include <config.h> + +#ifndef __attribute__ +# if __GNUC__ < 3 +# define __attribute__(x) +# endif +#endif + +#include "gettext.h" +#define _(msgid) gettext (msgid) + +#include <errno.h> + +#include <signal.h> +#if ! HAVE_STACK_T && ! defined stack_t +typedef struct sigaltstack stack_t; +#endif +#ifndef SIGSTKSZ +# define SIGSTKSZ 16384 +#elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384 +/* libsigsegv 2.6 through 2.8 have a bug where some architectures use + more than the Linux default of an 8k alternate stack when deciding + if a fault was caused by stack overflow. */ +# undef SIGSTKSZ +# define SIGSTKSZ 16384 +#endif + +#include <stdlib.h> +#include <string.h> + +/* Posix 2001 declares ucontext_t in <ucontext.h>, Posix 200x in + <signal.h>. */ +#if HAVE_UCONTEXT_H +# include <ucontext.h> +#endif + +#include <unistd.h> + +#if HAVE_LIBSIGSEGV +# include <sigsegv.h> +#endif + +#include "c-stack.h" +#include "exitfail.h" +#include "ignore-value.h" +#include "getprogname.h" + +#if defined SA_ONSTACK && defined SA_SIGINFO +# define SIGINFO_WORKS 1 +#else +# define SIGINFO_WORKS 0 +# ifndef SA_ONSTACK +# define SA_ONSTACK 0 +# endif +#endif + +/* The user-specified action to take when a SEGV-related program error + or stack overflow occurs. */ +static void (* volatile segv_action) (int); + +/* Translated messages for program errors and stack overflow. Do not + translate them in the signal handler, since gettext is not + async-signal-safe. */ +static char const * volatile program_error_message; +static char const * volatile stack_overflow_message; + +/* Output an error message, then exit with status EXIT_FAILURE if it + appears to have been a stack overflow, or with a core dump + otherwise. This function is async-signal-safe. */ + +static _Noreturn void +die (int signo) +{ + char const *message; +#if !SIGINFO_WORKS && !HAVE_LIBSIGSEGV + /* We can't easily determine whether it is a stack overflow; so + assume that the rest of our program is perfect (!) and that + this segmentation violation is a stack overflow. */ + signo = 0; +#endif /* !SIGINFO_WORKS && !HAVE_LIBSIGSEGV */ + segv_action (signo); + message = signo ? program_error_message : stack_overflow_message; + ignore_value (write (STDERR_FILENO, getprogname (), strlen (getprogname ()))); + ignore_value (write (STDERR_FILENO, ": ", 2)); + ignore_value (write (STDERR_FILENO, message, strlen (message))); + ignore_value (write (STDERR_FILENO, "\n", 1)); + if (! signo) + _exit (exit_failure); + raise (signo); + abort (); +} + +#if (HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK \ + && HAVE_STACK_OVERFLOW_HANDLING) || HAVE_LIBSIGSEGV + +/* Storage for the alternate signal stack. */ +static union +{ + char buffer[SIGSTKSZ]; + + /* These other members are for proper alignment. There's no + standard way to guarantee stack alignment, but this seems enough + in practice. */ + long double ld; + long l; + void *p; +} alternate_signal_stack; + +static void +null_action (int signo __attribute__ ((unused))) +{ +} + +#endif /* SIGALTSTACK || LIBSIGSEGV */ + +/* Only use libsigsegv if we need it; platforms like Solaris can + detect stack overflow without the overhead of an external + library. */ +#if HAVE_LIBSIGSEGV && ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC + +/* Nonzero if general segv handler could not be installed. */ +static volatile int segv_handler_missing; + +/* Handle a segmentation violation and exit if it cannot be stack + overflow. This function is async-signal-safe. */ + +static int segv_handler (void *address __attribute__ ((unused)), + int serious) +{ +# if DEBUG + { + char buf[1024]; + sprintf (buf, "segv_handler serious=%d\n", serious); + write (STDERR_FILENO, buf, strlen (buf)); + } +# endif + + /* If this fault is not serious, return 0 to let the stack overflow + handler take a shot at it. */ + if (!serious) + return 0; + die (SIGSEGV); +} + +/* Handle a segmentation violation that is likely to be a stack + overflow and exit. This function is async-signal-safe. */ + +static _Noreturn void +overflow_handler (int emergency, + stackoverflow_context_t context __attribute__ ((unused))) +{ +# if DEBUG + { + char buf[1024]; + sprintf (buf, "overflow_handler emergency=%d segv_handler_missing=%d\n", + emergency, segv_handler_missing); + write (STDERR_FILENO, buf, strlen (buf)); + } +# endif + + die ((!emergency || segv_handler_missing) ? 0 : SIGSEGV); +} + +int +c_stack_action (void (*action) (int)) +{ + segv_action = action ? action : null_action; + program_error_message = _("program error"); + stack_overflow_message = _("stack overflow"); + + /* Always install the overflow handler. */ + if (stackoverflow_install_handler (overflow_handler, + alternate_signal_stack.buffer, + sizeof alternate_signal_stack.buffer)) + { + errno = ENOTSUP; + return -1; + } + /* Try installing a general handler; if it fails, then treat all + segv as stack overflow. */ + segv_handler_missing = sigsegv_install_handler (segv_handler); + return 0; +} + +#elif HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK && HAVE_STACK_OVERFLOW_HANDLING + +# if SIGINFO_WORKS + +/* Handle a segmentation violation and exit. This function is + async-signal-safe. */ + +static _Noreturn void +segv_handler (int signo, siginfo_t *info, + void *context __attribute__ ((unused))) +{ + /* Clear SIGNO if it seems to have been a stack overflow. */ +# if ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC + /* We can't easily determine whether it is a stack overflow; so + assume that the rest of our program is perfect (!) and that + this segmentation violation is a stack overflow. + + Note that although both Linux and Solaris provide + sigaltstack, SA_ONSTACK, and SA_SIGINFO, currently only + Solaris satisfies the XSI heuristic. This is because + Solaris populates uc_stack with the details of the + interrupted stack, while Linux populates it with the details + of the current stack. */ + signo = 0; +# else + if (0 < info->si_code) + { + /* If the faulting address is within the stack, or within one + page of the stack, assume that it is a stack overflow. */ + ucontext_t const *user_context = context; + char const *stack_base = user_context->uc_stack.ss_sp; + size_t stack_size = user_context->uc_stack.ss_size; + char const *faulting_address = info->si_addr; + size_t page_size = sysconf (_SC_PAGESIZE); + size_t s = faulting_address - stack_base + page_size; + if (s < stack_size + 2 * page_size) + signo = 0; + +# if DEBUG + { + char buf[1024]; + sprintf (buf, + "segv_handler fault=%p base=%p size=%lx page=%lx signo=%d\n", + faulting_address, stack_base, (unsigned long) stack_size, + (unsigned long) page_size, signo); + write (STDERR_FILENO, buf, strlen (buf)); + } +# endif + } +# endif + + die (signo); +} +# endif + +int +c_stack_action (void (*action) (int)) +{ + int r; + stack_t st; + struct sigaction act; + st.ss_flags = 0; +# if SIGALTSTACK_SS_REVERSED + /* Irix mistakenly treats ss_sp as the upper bound, rather than + lower bound, of the alternate stack. */ + st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ - sizeof (void *); + st.ss_size = sizeof alternate_signal_stack.buffer - sizeof (void *); +# else + st.ss_sp = alternate_signal_stack.buffer; + st.ss_size = sizeof alternate_signal_stack.buffer; +# endif + r = sigaltstack (&st, NULL); + if (r != 0) + return r; + + segv_action = action ? action : null_action; + program_error_message = _("program error"); + stack_overflow_message = _("stack overflow"); + + sigemptyset (&act.sa_mask); + +# if SIGINFO_WORKS + /* POSIX 1003.1-2001 says SA_RESETHAND implies SA_NODEFER, but + this is not true on Solaris 8 at least. It doesn't hurt to use + SA_NODEFER here, so leave it in. */ + act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO; + act.sa_sigaction = segv_handler; +# else + act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND; + act.sa_handler = die; +# endif + +# if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, NULL) < 0) + return -1; +# endif + return sigaction (SIGSEGV, &act, NULL); +} + +#else /* ! ((HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK + && HAVE_STACK_OVERFLOW_HANDLING) || HAVE_LIBSIGSEGV) */ + +int +c_stack_action (void (*action) (int) __attribute__ ((unused))) +{ + errno = ENOTSUP; + return -1; +} + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/c-stack.h b/local/recipes/tools/diffutils/source/lib/c-stack.h new file mode 100644 index 0000000000..813e9d7996 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/c-stack.h @@ -0,0 +1,44 @@ +/* Stack overflow handling. + + Copyright (C) 2002, 2004, 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + + +/* Set up ACTION so that it is invoked on C stack overflow and on other, + stack-unrelated, segmentation violation. + Return -1 (setting errno) if this cannot be done. + + When a stack overflow or segmentation violation occurs: + 1) ACTION is called. It is passed an argument equal to + - 0, for a stack overflow, + - SIGSEGV, for a segmentation violation that does not appear related + to stack overflow. + On many platforms the two cases are hard to distinguish; when in doubt, + zero is passed. + 2) If ACTION returns, a message is written to standard error, and the + program is terminated: in the case of stack overflow, with exit code + exit_failure (see "exitfail.h"), otherwise through a signal SIGSEGV. + + A null ACTION acts like an action that does nothing. + + ACTION must be async-signal-safe. ACTION together with its callees + must not require more than SIGSTKSZ bytes of stack space. Also, + ACTION should not call longjmp, because this implementation does + not guarantee that it is safe to return to the original stack. + + This function may install a handler for the SIGSEGV signal or for the SIGBUS + signal or exercise other system dependent exception handling APIs. */ + +extern int c_stack_action (void (* /*action*/) (int)); diff --git a/local/recipes/tools/diffutils/source/lib/c-strcase.h b/local/recipes/tools/diffutils/source/lib/c-strcase.h new file mode 100644 index 0000000000..c82dab1dbe --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/c-strcase.h @@ -0,0 +1,56 @@ +/* Case-insensitive string comparison functions in C locale. + Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2017 Free Software + Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef C_STRCASE_H +#define C_STRCASE_H + +#include <stddef.h> + + +/* The functions defined in this file assume the "C" locale and a character + set without diacritics (ASCII-US or EBCDIC-US or something like that). + Even if the "C" locale on a particular system is an extension of the ASCII + character set (like on BeOS, where it is UTF-8, or on AmigaOS, where it + is ISO-8859-1), the functions in this file recognize only the ASCII + characters. More precisely, one of the string arguments must be an ASCII + string; the other one can also contain non-ASCII characters (but then + the comparison result will be nonzero). */ + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Compare strings S1 and S2, ignoring case, returning less than, equal to or + greater than zero if S1 is lexicographically less than, equal to or greater + than S2. */ +extern int c_strcasecmp (const char *s1, const char *s2) _GL_ATTRIBUTE_PURE; + +/* Compare no more than N characters of strings S1 and S2, ignoring case, + returning less than, equal to or greater than zero if S1 is + lexicographically less than, equal to or greater than S2. */ +extern int c_strncasecmp (const char *s1, const char *s2, size_t n) + _GL_ATTRIBUTE_PURE; + + +#ifdef __cplusplus +} +#endif + + +#endif /* C_STRCASE_H */ diff --git a/local/recipes/tools/diffutils/source/lib/c-strcasecmp.c b/local/recipes/tools/diffutils/source/lib/c-strcasecmp.c new file mode 100644 index 0000000000..5bce873d7b --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/c-strcasecmp.c @@ -0,0 +1,56 @@ +/* c-strcasecmp.c -- case insensitive string comparator in C locale + Copyright (C) 1998-1999, 2005-2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "c-strcase.h" + +#include <limits.h> + +#include "c-ctype.h" + +int +c_strcasecmp (const char *s1, const char *s2) +{ + register const unsigned char *p1 = (const unsigned char *) s1; + register const unsigned char *p2 = (const unsigned char *) s2; + unsigned char c1, c2; + + if (p1 == p2) + return 0; + + do + { + c1 = c_tolower (*p1); + c2 = c_tolower (*p2); + + if (c1 == '\0') + break; + + ++p1; + ++p2; + } + while (c1 == c2); + + if (UCHAR_MAX <= INT_MAX) + return c1 - c2; + else + /* On machines where 'char' and 'int' are types of the same size, the + difference of two 'unsigned char' values - including the sign bit - + doesn't fit in an 'int'. */ + return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0); +} diff --git a/local/recipes/tools/diffutils/source/lib/c-strcaseeq.h b/local/recipes/tools/diffutils/source/lib/c-strcaseeq.h new file mode 100644 index 0000000000..aa5e71f6b2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/c-strcaseeq.h @@ -0,0 +1,181 @@ +/* Optimized case-insensitive string comparison in C locale. + Copyright (C) 2001-2002, 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>. */ + +#include "c-strcase.h" +#include "c-ctype.h" + +/* STRCASEEQ allows to optimize string comparison with a small literal string. + STRCASEEQ (s, "UTF-8", 'U','T','F','-','8',0,0,0,0) + is semantically equivalent to + c_strcasecmp (s, "UTF-8") == 0 + just faster. */ + +/* Help GCC to generate good code for string comparisons with + immediate strings. */ +#if defined (__GNUC__) && defined (__OPTIMIZE__) + +/* Case insensitive comparison of ASCII characters. */ +# if C_CTYPE_ASCII +# define CASEEQ(other,upper) \ + (c_isupper (upper) ? ((other) & ~0x20) == (upper) : (other) == (upper)) +# else +# define CASEEQ(other,upper) \ + (c_toupper (other) == (upper)) +# endif + +static inline int +strcaseeq9 (const char *s1, const char *s2) +{ + return c_strcasecmp (s1 + 9, s2 + 9) == 0; +} + +static inline int +strcaseeq8 (const char *s1, const char *s2, char s28) +{ + if (CASEEQ (s1[8], s28)) + { + if (s28 == 0) + return 1; + else + return strcaseeq9 (s1, s2); + } + else + return 0; +} + +static inline int +strcaseeq7 (const char *s1, const char *s2, char s27, char s28) +{ + if (CASEEQ (s1[7], s27)) + { + if (s27 == 0) + return 1; + else + return strcaseeq8 (s1, s2, s28); + } + else + return 0; +} + +static inline int +strcaseeq6 (const char *s1, const char *s2, char s26, char s27, char s28) +{ + if (CASEEQ (s1[6], s26)) + { + if (s26 == 0) + return 1; + else + return strcaseeq7 (s1, s2, s27, s28); + } + else + return 0; +} + +static inline int +strcaseeq5 (const char *s1, const char *s2, char s25, char s26, char s27, char s28) +{ + if (CASEEQ (s1[5], s25)) + { + if (s25 == 0) + return 1; + else + return strcaseeq6 (s1, s2, s26, s27, s28); + } + else + return 0; +} + +static inline int +strcaseeq4 (const char *s1, const char *s2, char s24, char s25, char s26, char s27, char s28) +{ + if (CASEEQ (s1[4], s24)) + { + if (s24 == 0) + return 1; + else + return strcaseeq5 (s1, s2, s25, s26, s27, s28); + } + else + return 0; +} + +static inline int +strcaseeq3 (const char *s1, const char *s2, char s23, char s24, char s25, char s26, char s27, char s28) +{ + if (CASEEQ (s1[3], s23)) + { + if (s23 == 0) + return 1; + else + return strcaseeq4 (s1, s2, s24, s25, s26, s27, s28); + } + else + return 0; +} + +static inline int +strcaseeq2 (const char *s1, const char *s2, char s22, char s23, char s24, char s25, char s26, char s27, char s28) +{ + if (CASEEQ (s1[2], s22)) + { + if (s22 == 0) + return 1; + else + return strcaseeq3 (s1, s2, s23, s24, s25, s26, s27, s28); + } + else + return 0; +} + +static inline int +strcaseeq1 (const char *s1, const char *s2, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28) +{ + if (CASEEQ (s1[1], s21)) + { + if (s21 == 0) + return 1; + else + return strcaseeq2 (s1, s2, s22, s23, s24, s25, s26, s27, s28); + } + else + return 0; +} + +static inline int +strcaseeq0 (const char *s1, const char *s2, char s20, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28) +{ + if (CASEEQ (s1[0], s20)) + { + if (s20 == 0) + return 1; + else + return strcaseeq1 (s1, s2, s21, s22, s23, s24, s25, s26, s27, s28); + } + else + return 0; +} + +#define STRCASEEQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \ + strcaseeq0 (s1, s2, s20, s21, s22, s23, s24, s25, s26, s27, s28) + +#else + +#define STRCASEEQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \ + (c_strcasecmp (s1, s2) == 0) + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/c-strncasecmp.c b/local/recipes/tools/diffutils/source/lib/c-strncasecmp.c new file mode 100644 index 0000000000..ada62d70b7 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/c-strncasecmp.c @@ -0,0 +1,56 @@ +/* c-strncasecmp.c -- case insensitive string comparator in C locale + Copyright (C) 1998-1999, 2005-2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "c-strcase.h" + +#include <limits.h> + +#include "c-ctype.h" + +int +c_strncasecmp (const char *s1, const char *s2, size_t n) +{ + register const unsigned char *p1 = (const unsigned char *) s1; + register const unsigned char *p2 = (const unsigned char *) s2; + unsigned char c1, c2; + + if (p1 == p2 || n == 0) + return 0; + + do + { + c1 = c_tolower (*p1); + c2 = c_tolower (*p2); + + if (--n == 0 || c1 == '\0') + break; + + ++p1; + ++p2; + } + while (c1 == c2); + + if (UCHAR_MAX <= INT_MAX) + return c1 - c2; + else + /* On machines where 'char' and 'int' are types of the same size, the + difference of two 'unsigned char' values - including the sign bit - + doesn't fit in an 'int'. */ + return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0); +} diff --git a/local/recipes/tools/diffutils/source/lib/careadlinkat.c b/local/recipes/tools/diffutils/source/lib/careadlinkat.c new file mode 100644 index 0000000000..455e00efe0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/careadlinkat.c @@ -0,0 +1,160 @@ +/* Read symbolic links into a buffer without size limitation, relative to fd. + + Copyright (C) 2001, 2003-2004, 2007, 2009-2017 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */ + +#include <config.h> + +#include "careadlinkat.h" + +#include <errno.h> +#include <limits.h> +#include <string.h> +#include <unistd.h> + +/* Define this independently so that stdint.h is not a prerequisite. */ +#ifndef SIZE_MAX +# define SIZE_MAX ((size_t) -1) +#endif + +#ifndef SSIZE_MAX +# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) +#endif + +#include "allocator.h" + +/* Assuming the current directory is FD, get the symbolic link value + of FILENAME as a null-terminated string and put it into a buffer. + If FD is AT_FDCWD, FILENAME is interpreted relative to the current + working directory, as in openat. + + If the link is small enough to fit into BUFFER put it there. + BUFFER's size is BUFFER_SIZE, and BUFFER can be null + if BUFFER_SIZE is zero. + + If the link is not small, put it into a dynamically allocated + buffer managed by ALLOC. It is the caller's responsibility to free + the returned value if it is nonnull and is not BUFFER. A null + ALLOC stands for the standard allocator. + + The PREADLINKAT function specifies how to read links. It operates + like POSIX readlinkat() + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html> + but can assume that its first argument is the same as FD. + + If successful, return the buffer address; otherwise return NULL and + set errno. */ + +char * +careadlinkat (int fd, char const *filename, + char *buffer, size_t buffer_size, + struct allocator const *alloc, + ssize_t (*preadlinkat) (int, char const *, char *, size_t)) +{ + char *buf; + size_t buf_size; + size_t buf_size_max = + SSIZE_MAX < SIZE_MAX ? (size_t) SSIZE_MAX + 1 : SIZE_MAX; + char stack_buf[1024]; + + if (! alloc) + alloc = &stdlib_allocator; + + if (! buffer_size) + { + /* Allocate the initial buffer on the stack. This way, in the + common case of a symlink of small size, we get away with a + single small malloc() instead of a big malloc() followed by a + shrinking realloc(). */ + buffer = stack_buf; + buffer_size = sizeof stack_buf; + } + + buf = buffer; + buf_size = buffer_size; + + do + { + /* Attempt to read the link into the current buffer. */ + ssize_t link_length = preadlinkat (fd, filename, buf, buf_size); + size_t link_size; + if (link_length < 0) + { + /* On AIX 5L v5.3 and HP-UX 11i v2 04/09, readlink returns -1 + with errno == ERANGE if the buffer is too small. */ + int readlinkat_errno = errno; + if (readlinkat_errno != ERANGE) + { + if (buf != buffer) + { + alloc->free (buf); + errno = readlinkat_errno; + } + return NULL; + } + } + + link_size = link_length; + + if (link_size < buf_size) + { + buf[link_size++] = '\0'; + + if (buf == stack_buf) + { + char *b = (char *) alloc->allocate (link_size); + buf_size = link_size; + if (! b) + break; + memcpy (b, buf, link_size); + buf = b; + } + else if (link_size < buf_size && buf != buffer && alloc->reallocate) + { + /* Shrink BUF before returning it. */ + char *b = (char *) alloc->reallocate (buf, link_size); + if (b) + buf = b; + } + + return buf; + } + + if (buf != buffer) + alloc->free (buf); + + if (buf_size <= buf_size_max / 2) + buf_size *= 2; + else if (buf_size < buf_size_max) + buf_size = buf_size_max; + else if (buf_size_max < SIZE_MAX) + { + errno = ENAMETOOLONG; + return NULL; + } + else + break; + buf = (char *) alloc->allocate (buf_size); + } + while (buf); + + if (alloc->die) + alloc->die (buf_size); + errno = ENOMEM; + return NULL; +} diff --git a/local/recipes/tools/diffutils/source/lib/careadlinkat.h b/local/recipes/tools/diffutils/source/lib/careadlinkat.h new file mode 100644 index 0000000000..528a8289e5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/careadlinkat.h @@ -0,0 +1,67 @@ +/* Read symbolic links into a buffer without size limitation, relative to fd. + + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */ + +#ifndef _GL_CAREADLINKAT_H +#define _GL_CAREADLINKAT_H + +#include <fcntl.h> +#include <unistd.h> + +struct allocator; + +/* Assuming the current directory is FD, get the symbolic link value + of FILENAME as a null-terminated string and put it into a buffer. + If FD is AT_FDCWD, FILENAME is interpreted relative to the current + working directory, as in openat. + + If the link is small enough to fit into BUFFER put it there. + BUFFER's size is BUFFER_SIZE, and BUFFER can be null + if BUFFER_SIZE is zero. + + If the link is not small, put it into a dynamically allocated + buffer managed by ALLOC. It is the caller's responsibility to free + the returned value if it is nonnull and is not BUFFER. + + The PREADLINKAT function specifies how to read links. It operates + like POSIX readlinkat() + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html> + but can assume that its first argument is the same as FD. + + If successful, return the buffer address; otherwise return NULL and + set errno. */ + +char *careadlinkat (int fd, char const *filename, + char *buffer, size_t buffer_size, + struct allocator const *alloc, + ssize_t (*preadlinkat) (int, char const *, + char *, size_t)); + +/* Suitable value for careadlinkat's FD argument. */ +#if HAVE_READLINKAT +/* AT_FDCWD is declared in <fcntl.h>. */ +#else +/* Define AT_FDCWD independently, so that the careadlinkat module does + not depend on the fcntl-h module. We might as well use the same value + as fcntl-h. */ +# ifndef AT_FDCWD +# define AT_FDCWD (-3041965) +# endif +#endif + +#endif /* _GL_CAREADLINKAT_H */ diff --git a/local/recipes/tools/diffutils/source/lib/close.c b/local/recipes/tools/diffutils/source/lib/close.c new file mode 100644 index 0000000000..6a72c32299 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/close.c @@ -0,0 +1,71 @@ +/* close replacement. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <unistd.h> + +#include <errno.h> + +#include "fd-hook.h" +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER +# include "msvc-inval.h" +#endif + +#undef close + +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER +static int +close_nothrow (int fd) +{ + int result; + + TRY_MSVC_INVAL + { + result = close (fd); + } + CATCH_MSVC_INVAL + { + result = -1; + errno = EBADF; + } + DONE_MSVC_INVAL; + + return result; +} +#else +# define close_nothrow close +#endif + +/* Override close() to call into other gnulib modules. */ + +int +rpl_close (int fd) +{ +#if WINDOWS_SOCKETS + int retval = execute_all_close_hooks (close_nothrow, fd); +#else + int retval = close_nothrow (fd); +#endif + +#if REPLACE_FCHDIR + if (retval >= 0) + _gl_unregister_fd (fd); +#endif + + return retval; +} diff --git a/local/recipes/tools/diffutils/source/lib/cmpbuf.c b/local/recipes/tools/diffutils/source/lib/cmpbuf.c new file mode 100644 index 0000000000..437731e42e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/cmpbuf.c @@ -0,0 +1,109 @@ +/* Buffer primitives for comparison operations. + + Copyright (C) 1993, 1995, 1998, 2001-2002, 2006, 2009-2013, 2015-2017 Free + Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <errno.h> +#include <limits.h> +#include <signal.h> +#include <unistd.h> +#include <stdint.h> +#include <inttypes.h> +#include <sys/types.h> +#include "cmpbuf.h" +#include "intprops.h" + +#ifndef SSIZE_MAX +# define SSIZE_MAX TYPE_MAXIMUM (ssize_t) +#endif + +#undef MIN +#define MIN(a, b) ((a) <= (b) ? (a) : (b)) + +/* Read NBYTES bytes from descriptor FD into BUF. + NBYTES must not be SIZE_MAX. + Return the number of characters successfully read. + On error, return SIZE_MAX, setting errno. + The number returned is always NBYTES unless end-of-file or error. */ + +size_t +block_read (int fd, char *buf, size_t nbytes) +{ + char *bp = buf; + char const *buflim = buf + nbytes; + size_t readlim = MIN (SSIZE_MAX, SIZE_MAX); + + do + { + size_t bytes_remaining = buflim - bp; + size_t bytes_to_read = MIN (bytes_remaining, readlim); + ssize_t nread = read (fd, bp, bytes_to_read); + if (nread <= 0) + { + if (nread == 0) + break; + + /* Accommodate Tru64 5.1, which can't read more than INT_MAX + bytes at a time. They call that a 64-bit OS? */ + if (errno == EINVAL && INT_MAX < bytes_to_read) + { + readlim = INT_MAX; + continue; + } + + /* This is needed for programs that have signal handlers on + older hosts without SA_RESTART. It also accommodates + ancient AIX hosts that set errno to EINTR after uncaught + SIGCONT. See <news:1r77ojINN85n@ftp.UU.NET> + (1993-04-22). */ + //if (! SA_RESTART && errno == EINTR) + // continue; + + return SIZE_MAX; + } + bp += nread; + } + while (bp < buflim); + + return bp - buf; +} + +/* Least common multiple of two buffer sizes A and B. However, if + either A or B is zero, or if the multiple is greater than LCM_MAX, + return a reasonable buffer size. */ + +size_t +buffer_lcm (size_t a, size_t b, size_t lcm_max) +{ + size_t lcm, m, n, q, r; + + /* Yield reasonable values if buffer sizes are zero. */ + if (!a) + return b ? b : 8 * 1024; + if (!b) + return a; + + /* n = gcd (a, b) */ + for (m = a, n = b; (r = m % n) != 0; m = n, n = r) + continue; + + /* Yield a if there is an overflow. */ + q = a / n; + lcm = q * b; + return lcm <= lcm_max && lcm / b == q ? lcm : a; +} diff --git a/local/recipes/tools/diffutils/source/lib/cmpbuf.h b/local/recipes/tools/diffutils/source/lib/cmpbuf.h new file mode 100644 index 0000000000..cf63a3b4e7 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/cmpbuf.h @@ -0,0 +1,19 @@ +/* Buffer primitives for comparison operations. + + Copyright (C) 2002, 2009-2013, 2015-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +size_t block_read (int, char *, size_t); +size_t buffer_lcm (size_t, size_t, size_t) _GL_ATTRIBUTE_CONST; diff --git a/local/recipes/tools/diffutils/source/lib/config.charset b/local/recipes/tools/diffutils/source/lib/config.charset new file mode 100644 index 0000000000..8bedbf362e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/config.charset @@ -0,0 +1,682 @@ +#! /bin/sh +# Output a system dependent table of character encoding aliases. +# +# Copyright (C) 2000-2004, 2006-2017 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, see <http://www.gnu.org/licenses/>. +# +# The table consists of lines of the form +# ALIAS CANONICAL +# +# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)". +# ALIAS is compared in a case sensitive way. +# +# CANONICAL is the GNU canonical name for this character encoding. +# It must be an encoding supported by libiconv. Support by GNU libc is +# also desirable. CANONICAL is case insensitive. Usually an upper case +# MIME charset name is preferred. +# The current list of GNU canonical charset names is as follows. +# +# name MIME? used by which systems +# (darwin = Mac OS X, woe32 = native Windows) +# +# ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin cygwin +# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin +# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin +# ISO-8859-3 Y glibc solaris cygwin +# ISO-8859-4 Y osf solaris freebsd netbsd openbsd darwin +# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin +# ISO-8859-6 Y glibc aix hpux solaris cygwin +# ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd openbsd darwin cygwin +# ISO-8859-8 Y glibc aix hpux osf solaris cygwin +# ISO-8859-9 Y glibc aix hpux irix osf solaris darwin cygwin +# ISO-8859-13 glibc netbsd openbsd darwin cygwin +# ISO-8859-14 glibc cygwin +# ISO-8859-15 glibc aix osf solaris freebsd netbsd openbsd darwin cygwin +# KOI8-R Y glibc solaris freebsd netbsd openbsd darwin +# KOI8-U Y glibc freebsd netbsd openbsd darwin cygwin +# KOI8-T glibc +# CP437 dos +# CP775 dos +# CP850 aix osf dos +# CP852 dos +# CP855 dos +# CP856 aix +# CP857 dos +# CP861 dos +# CP862 dos +# CP864 dos +# CP865 dos +# CP866 freebsd netbsd openbsd darwin dos +# CP869 dos +# CP874 woe32 dos +# CP922 aix +# CP932 aix cygwin woe32 dos +# CP943 aix +# CP949 osf darwin woe32 dos +# CP950 woe32 dos +# CP1046 aix +# CP1124 aix +# CP1125 dos +# CP1129 aix +# CP1131 darwin +# CP1250 woe32 +# CP1251 glibc solaris netbsd openbsd darwin cygwin woe32 +# CP1252 aix woe32 +# CP1253 woe32 +# CP1254 woe32 +# CP1255 glibc woe32 +# CP1256 woe32 +# CP1257 woe32 +# GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin +# EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin +# EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin +# EUC-TW glibc aix hpux irix osf solaris netbsd +# BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin cygwin +# BIG5-HKSCS glibc solaris darwin +# GBK glibc aix osf solaris darwin cygwin woe32 dos +# GB18030 glibc solaris netbsd darwin +# SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin +# JOHAB glibc solaris woe32 +# TIS-620 glibc aix hpux osf solaris cygwin +# VISCII Y glibc +# TCVN5712-1 glibc +# ARMSCII-8 glibc darwin +# GEORGIAN-PS glibc cygwin +# PT154 glibc +# HP-ROMAN8 hpux +# HP-ARABIC8 hpux +# HP-GREEK8 hpux +# HP-HEBREW8 hpux +# HP-TURKISH8 hpux +# HP-KANA8 hpux +# DEC-KANJI osf +# DEC-HANYU osf +# UTF-8 Y glibc aix hpux osf solaris netbsd darwin cygwin +# +# Note: Names which are not marked as being a MIME name should not be used in +# Internet protocols for information interchange (mail, news, etc.). +# +# Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications +# must understand both names and treat them as equivalent. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM + +host="$1" +os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'` +echo "# This file contains a table of character encoding aliases," +echo "# suitable for operating system '${os}'." +echo "# It was automatically generated from config.charset." +# List of references, updated during installation: +echo "# Packages using this file: " +case "$os" in + linux-gnulibc1*) + # Linux libc5 doesn't have nl_langinfo(CODESET); therefore + # localcharset.c falls back to using the full locale name + # from the environment variables. + echo "C ASCII" + echo "POSIX ASCII" + for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \ + en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \ + en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \ + es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \ + et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \ + fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \ + it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \ + sv_FI sv_SE; do + echo "$l ISO-8859-1" + echo "$l.iso-8859-1 ISO-8859-1" + echo "$l.iso-8859-15 ISO-8859-15" + echo "$l.iso-8859-15@euro ISO-8859-15" + echo "$l@euro ISO-8859-15" + echo "$l.cp-437 CP437" + echo "$l.cp-850 CP850" + echo "$l.cp-1252 CP1252" + echo "$l.cp-1252@euro CP1252" + #echo "$l.atari-st ATARI-ST" # not a commonly used encoding + echo "$l.utf-8 UTF-8" + echo "$l.utf-8@euro UTF-8" + done + for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \ + sl_SI sr sr_CS sr_YU; do + echo "$l ISO-8859-2" + echo "$l.iso-8859-2 ISO-8859-2" + echo "$l.cp-852 CP852" + echo "$l.cp-1250 CP1250" + echo "$l.utf-8 UTF-8" + done + for l in mk mk_MK ru ru_RU; do + echo "$l ISO-8859-5" + echo "$l.iso-8859-5 ISO-8859-5" + echo "$l.koi8-r KOI8-R" + echo "$l.cp-866 CP866" + echo "$l.cp-1251 CP1251" + echo "$l.utf-8 UTF-8" + done + for l in ar ar_SA; do + echo "$l ISO-8859-6" + echo "$l.iso-8859-6 ISO-8859-6" + echo "$l.cp-864 CP864" + #echo "$l.cp-868 CP868" # not a commonly used encoding + echo "$l.cp-1256 CP1256" + echo "$l.utf-8 UTF-8" + done + for l in el el_GR gr gr_GR; do + echo "$l ISO-8859-7" + echo "$l.iso-8859-7 ISO-8859-7" + echo "$l.cp-869 CP869" + echo "$l.cp-1253 CP1253" + echo "$l.cp-1253@euro CP1253" + echo "$l.utf-8 UTF-8" + echo "$l.utf-8@euro UTF-8" + done + for l in he he_IL iw iw_IL; do + echo "$l ISO-8859-8" + echo "$l.iso-8859-8 ISO-8859-8" + echo "$l.cp-862 CP862" + echo "$l.cp-1255 CP1255" + echo "$l.utf-8 UTF-8" + done + for l in tr tr_TR; do + echo "$l ISO-8859-9" + echo "$l.iso-8859-9 ISO-8859-9" + echo "$l.cp-857 CP857" + echo "$l.cp-1254 CP1254" + echo "$l.utf-8 UTF-8" + done + for l in lt lt_LT lv lv_LV; do + #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name + echo "$l ISO-8859-13" + done + for l in ru_UA uk uk_UA; do + echo "$l KOI8-U" + done + for l in zh zh_CN; do + #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name + echo "$l GB2312" + done + for l in ja ja_JP ja_JP.EUC; do + echo "$l EUC-JP" + done + for l in ko ko_KR; do + echo "$l EUC-KR" + done + for l in th th_TH; do + echo "$l TIS-620" + done + for l in fa fa_IR; do + #echo "$l ISIRI-3342" # a broken encoding + echo "$l.utf-8 UTF-8" + done + ;; + linux* | *-gnu*) + # With glibc-2.1 or newer, we don't need any canonicalization, + # because glibc has iconv and both glibc and libiconv support all + # GNU canonical names directly. Therefore, the Makefile does not + # need to install the alias file at all. + # The following applies only to glibc-2.0.x and older libcs. + echo "ISO_646.IRV:1983 ASCII" + ;; + aix*) + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-6 ISO-8859-6" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-8 ISO-8859-8" + echo "ISO8859-9 ISO-8859-9" + echo "ISO8859-15 ISO-8859-15" + echo "IBM-850 CP850" + echo "IBM-856 CP856" + echo "IBM-921 ISO-8859-13" + echo "IBM-922 CP922" + echo "IBM-932 CP932" + echo "IBM-943 CP943" + echo "IBM-1046 CP1046" + echo "IBM-1124 CP1124" + echo "IBM-1129 CP1129" + echo "IBM-1252 CP1252" + echo "IBM-eucCN GB2312" + echo "IBM-eucJP EUC-JP" + echo "IBM-eucKR EUC-KR" + echo "IBM-eucTW EUC-TW" + echo "big5 BIG5" + echo "GBK GBK" + echo "TIS-620 TIS-620" + echo "UTF-8 UTF-8" + ;; + hpux*) + echo "iso88591 ISO-8859-1" + echo "iso88592 ISO-8859-2" + echo "iso88595 ISO-8859-5" + echo "iso88596 ISO-8859-6" + echo "iso88597 ISO-8859-7" + echo "iso88598 ISO-8859-8" + echo "iso88599 ISO-8859-9" + echo "iso885915 ISO-8859-15" + echo "roman8 HP-ROMAN8" + echo "arabic8 HP-ARABIC8" + echo "greek8 HP-GREEK8" + echo "hebrew8 HP-HEBREW8" + echo "turkish8 HP-TURKISH8" + echo "kana8 HP-KANA8" + echo "tis620 TIS-620" + echo "big5 BIG5" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" + echo "hp15CN GB2312" + #echo "ccdc ?" # what is this? + echo "SJIS SHIFT_JIS" + echo "utf8 UTF-8" + ;; + irix*) + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-9 ISO-8859-9" + echo "eucCN GB2312" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" + ;; + osf*) + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-4 ISO-8859-4" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-8 ISO-8859-8" + echo "ISO8859-9 ISO-8859-9" + echo "ISO8859-15 ISO-8859-15" + echo "cp850 CP850" + echo "big5 BIG5" + echo "dechanyu DEC-HANYU" + echo "dechanzi GB2312" + echo "deckanji DEC-KANJI" + echo "deckorean EUC-KR" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" + echo "GBK GBK" + echo "KSC5601 CP949" + echo "sdeckanji EUC-JP" + echo "SJIS SHIFT_JIS" + echo "TACTIS TIS-620" + echo "UTF-8 UTF-8" + ;; + solaris*) + echo "646 ASCII" + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-3 ISO-8859-3" + echo "ISO8859-4 ISO-8859-4" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-6 ISO-8859-6" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-8 ISO-8859-8" + echo "ISO8859-9 ISO-8859-9" + echo "ISO8859-15 ISO-8859-15" + echo "koi8-r KOI8-R" + echo "ansi-1251 CP1251" + echo "BIG5 BIG5" + echo "Big5-HKSCS BIG5-HKSCS" + echo "gb2312 GB2312" + echo "GBK GBK" + echo "GB18030 GB18030" + echo "cns11643 EUC-TW" + echo "5601 EUC-KR" + echo "ko_KR.johap92 JOHAB" + echo "eucJP EUC-JP" + echo "PCK SHIFT_JIS" + echo "TIS620.2533 TIS-620" + #echo "sun_eu_greek ?" # what is this? + echo "UTF-8 UTF-8" + ;; + freebsd*) + # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore + # localcharset.c falls back to using the full locale name + # from the environment variables. + echo "C ASCII" + echo "US-ASCII ASCII" + for l in la_LN lt_LN; do + echo "$l.ASCII ASCII" + done + for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \ + fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \ + lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do + echo "$l.ISO_8859-1 ISO-8859-1" + echo "$l.DIS_8859-15 ISO-8859-15" + done + for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do + echo "$l.ISO_8859-2 ISO-8859-2" + done + for l in la_LN lt_LT; do + echo "$l.ISO_8859-4 ISO-8859-4" + done + for l in ru_RU ru_SU; do + echo "$l.KOI8-R KOI8-R" + echo "$l.ISO_8859-5 ISO-8859-5" + echo "$l.CP866 CP866" + done + echo "uk_UA.KOI8-U KOI8-U" + echo "zh_TW.BIG5 BIG5" + echo "zh_TW.Big5 BIG5" + echo "zh_CN.EUC GB2312" + echo "ja_JP.EUC EUC-JP" + echo "ja_JP.SJIS SHIFT_JIS" + echo "ja_JP.Shift_JIS SHIFT_JIS" + echo "ko_KR.EUC EUC-KR" + ;; + netbsd*) + echo "646 ASCII" + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-4 ISO-8859-4" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-13 ISO-8859-13" + echo "ISO8859-15 ISO-8859-15" + echo "eucCN GB2312" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" + echo "BIG5 BIG5" + echo "SJIS SHIFT_JIS" + ;; + openbsd*) + echo "646 ASCII" + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-4 ISO-8859-4" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-13 ISO-8859-13" + echo "ISO8859-15 ISO-8859-15" + ;; + darwin[56]*) + # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore + # localcharset.c falls back to using the full locale name + # from the environment variables. + echo "C ASCII" + for l in en_AU en_CA en_GB en_US la_LN; do + echo "$l.US-ASCII ASCII" + done + for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \ + fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \ + nl_NL no_NO pt_PT sv_SE; do + echo "$l ISO-8859-1" + echo "$l.ISO8859-1 ISO-8859-1" + echo "$l.ISO8859-15 ISO-8859-15" + done + for l in la_LN; do + echo "$l.ISO8859-1 ISO-8859-1" + echo "$l.ISO8859-15 ISO-8859-15" + done + for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do + echo "$l.ISO8859-2 ISO-8859-2" + done + for l in la_LN lt_LT; do + echo "$l.ISO8859-4 ISO-8859-4" + done + for l in ru_RU; do + echo "$l.KOI8-R KOI8-R" + echo "$l.ISO8859-5 ISO-8859-5" + echo "$l.CP866 CP866" + done + for l in bg_BG; do + echo "$l.CP1251 CP1251" + done + echo "uk_UA.KOI8-U KOI8-U" + echo "zh_TW.BIG5 BIG5" + echo "zh_TW.Big5 BIG5" + echo "zh_CN.EUC GB2312" + echo "ja_JP.EUC EUC-JP" + echo "ja_JP.SJIS SHIFT_JIS" + echo "ko_KR.EUC EUC-KR" + ;; + darwin*) + # Darwin 7.5 has nl_langinfo(CODESET), but sometimes its value is + # useless: + # - It returns the empty string when LANG is set to a locale of the + # form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8 + # LC_CTYPE file. + # - The environment variables LANG, LC_CTYPE, LC_ALL are not set by + # the system; nl_langinfo(CODESET) returns "US-ASCII" in this case. + # - The documentation says: + # "... all code that calls BSD system routines should ensure + # that the const *char parameters of these routines are in UTF-8 + # encoding. All BSD system functions expect their string + # parameters to be in UTF-8 encoding and nothing else." + # It also says + # "An additional caveat is that string parameters for files, + # paths, and other file-system entities must be in canonical + # UTF-8. In a canonical UTF-8 Unicode string, all decomposable + # characters are decomposed ..." + # but this is not true: You can pass non-decomposed UTF-8 strings + # to file system functions, and it is the OS which will convert + # them to decomposed UTF-8 before accessing the file system. + # - The Apple Terminal application displays UTF-8 by default. + # - However, other applications are free to use different encodings: + # - xterm uses ISO-8859-1 by default. + # - TextEdit uses MacRoman by default. + # We prefer UTF-8 over decomposed UTF-8-MAC because one should + # minimize the use of decomposed Unicode. Unfortunately, through the + # Darwin file system, decomposed UTF-8 strings are leaked into user + # space nevertheless. + # Then there are also the locales with encodings other than US-ASCII + # and UTF-8. These locales can be occasionally useful to users (e.g. + # when grepping through ISO-8859-1 encoded text files), when all their + # file names are in US-ASCII. + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-4 ISO-8859-4" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-9 ISO-8859-9" + echo "ISO8859-13 ISO-8859-13" + echo "ISO8859-15 ISO-8859-15" + echo "KOI8-R KOI8-R" + echo "KOI8-U KOI8-U" + echo "CP866 CP866" + echo "CP949 CP949" + echo "CP1131 CP1131" + echo "CP1251 CP1251" + echo "eucCN GB2312" + echo "GB2312 GB2312" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "Big5 BIG5" + echo "Big5HKSCS BIG5-HKSCS" + echo "GBK GBK" + echo "GB18030 GB18030" + echo "SJIS SHIFT_JIS" + echo "ARMSCII-8 ARMSCII-8" + echo "PT154 PT154" + #echo "ISCII-DEV ?" + echo "* UTF-8" + ;; + beos* | haiku*) + # BeOS and Haiku have a single locale, and it has UTF-8 encoding. + echo "* UTF-8" + ;; + msdosdjgpp*) + # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore + # localcharset.c falls back to using the full locale name + # from the environment variables. + echo "#" + echo "# The encodings given here may not all be correct." + echo "# If you find that the encoding given for your language and" + echo "# country is not the one your DOS machine actually uses, just" + echo "# correct it in this file, and send a mail to" + echo "# Juan Manuel Guerrero <juan.guerrero@gmx.de>" + echo "# and Bruno Haible <bruno@clisp.org>." + echo "#" + echo "C ASCII" + # ISO-8859-1 languages + echo "ca CP850" + echo "ca_ES CP850" + echo "da CP865" # not CP850 ?? + echo "da_DK CP865" # not CP850 ?? + echo "de CP850" + echo "de_AT CP850" + echo "de_CH CP850" + echo "de_DE CP850" + echo "en CP850" + echo "en_AU CP850" # not CP437 ?? + echo "en_CA CP850" + echo "en_GB CP850" + echo "en_NZ CP437" + echo "en_US CP437" + echo "en_ZA CP850" # not CP437 ?? + echo "es CP850" + echo "es_AR CP850" + echo "es_BO CP850" + echo "es_CL CP850" + echo "es_CO CP850" + echo "es_CR CP850" + echo "es_CU CP850" + echo "es_DO CP850" + echo "es_EC CP850" + echo "es_ES CP850" + echo "es_GT CP850" + echo "es_HN CP850" + echo "es_MX CP850" + echo "es_NI CP850" + echo "es_PA CP850" + echo "es_PY CP850" + echo "es_PE CP850" + echo "es_SV CP850" + echo "es_UY CP850" + echo "es_VE CP850" + echo "et CP850" + echo "et_EE CP850" + echo "eu CP850" + echo "eu_ES CP850" + echo "fi CP850" + echo "fi_FI CP850" + echo "fr CP850" + echo "fr_BE CP850" + echo "fr_CA CP850" + echo "fr_CH CP850" + echo "fr_FR CP850" + echo "ga CP850" + echo "ga_IE CP850" + echo "gd CP850" + echo "gd_GB CP850" + echo "gl CP850" + echo "gl_ES CP850" + echo "id CP850" # not CP437 ?? + echo "id_ID CP850" # not CP437 ?? + echo "is CP861" # not CP850 ?? + echo "is_IS CP861" # not CP850 ?? + echo "it CP850" + echo "it_CH CP850" + echo "it_IT CP850" + echo "lt CP775" + echo "lt_LT CP775" + echo "lv CP775" + echo "lv_LV CP775" + echo "nb CP865" # not CP850 ?? + echo "nb_NO CP865" # not CP850 ?? + echo "nl CP850" + echo "nl_BE CP850" + echo "nl_NL CP850" + echo "nn CP865" # not CP850 ?? + echo "nn_NO CP865" # not CP850 ?? + echo "no CP865" # not CP850 ?? + echo "no_NO CP865" # not CP850 ?? + echo "pt CP850" + echo "pt_BR CP850" + echo "pt_PT CP850" + echo "sv CP850" + echo "sv_SE CP850" + # ISO-8859-2 languages + echo "cs CP852" + echo "cs_CZ CP852" + echo "hr CP852" + echo "hr_HR CP852" + echo "hu CP852" + echo "hu_HU CP852" + echo "pl CP852" + echo "pl_PL CP852" + echo "ro CP852" + echo "ro_RO CP852" + echo "sk CP852" + echo "sk_SK CP852" + echo "sl CP852" + echo "sl_SI CP852" + echo "sq CP852" + echo "sq_AL CP852" + echo "sr CP852" # CP852 or CP866 or CP855 ?? + echo "sr_CS CP852" # CP852 or CP866 or CP855 ?? + echo "sr_YU CP852" # CP852 or CP866 or CP855 ?? + # ISO-8859-3 languages + echo "mt CP850" + echo "mt_MT CP850" + # ISO-8859-5 languages + echo "be CP866" + echo "be_BE CP866" + echo "bg CP866" # not CP855 ?? + echo "bg_BG CP866" # not CP855 ?? + echo "mk CP866" # not CP855 ?? + echo "mk_MK CP866" # not CP855 ?? + echo "ru CP866" + echo "ru_RU CP866" + echo "uk CP1125" + echo "uk_UA CP1125" + # ISO-8859-6 languages + echo "ar CP864" + echo "ar_AE CP864" + echo "ar_DZ CP864" + echo "ar_EG CP864" + echo "ar_IQ CP864" + echo "ar_IR CP864" + echo "ar_JO CP864" + echo "ar_KW CP864" + echo "ar_MA CP864" + echo "ar_OM CP864" + echo "ar_QA CP864" + echo "ar_SA CP864" + echo "ar_SY CP864" + # ISO-8859-7 languages + echo "el CP869" + echo "el_GR CP869" + # ISO-8859-8 languages + echo "he CP862" + echo "he_IL CP862" + # ISO-8859-9 languages + echo "tr CP857" + echo "tr_TR CP857" + # Japanese + echo "ja CP932" + echo "ja_JP CP932" + # Chinese + echo "zh_CN GBK" + echo "zh_TW CP950" # not CP938 ?? + # Korean + echo "kr CP949" # not CP934 ?? + echo "kr_KR CP949" # not CP934 ?? + # Thai + echo "th CP874" + echo "th_TH CP874" + # Other + echo "eo CP850" + echo "eo_EO CP850" + ;; +esac diff --git a/local/recipes/tools/diffutils/source/lib/config.hin b/local/recipes/tools/diffutils/source/lib/config.hin new file mode 100644 index 0000000000..6261cb8b1a --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/config.hin @@ -0,0 +1,2342 @@ +/* lib/config.hin. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* Define to the number of bits in type 'ptrdiff_t'. */ +#undef BITSIZEOF_PTRDIFF_T + +/* Define to the number of bits in type 'sig_atomic_t'. */ +#undef BITSIZEOF_SIG_ATOMIC_T + +/* Define to the number of bits in type 'size_t'. */ +#undef BITSIZEOF_SIZE_T + +/* Define to the number of bits in type 'wchar_t'. */ +#undef BITSIZEOF_WCHAR_T + +/* Define to the number of bits in type 'wint_t'. */ +#undef BITSIZEOF_WINT_T + +/* Define to 1 if the 'closedir' function returns void instead of int. */ +#undef CLOSEDIR_VOID + +/* Define to 1 if using 'alloca.c'. */ +#undef C_ALLOCA + +/* Define to 1 if the C locale may have encoding errors. */ +#undef C_LOCALE_MAYBE_EILSEQ + +/* Define as the bit index in the word where to find bit 0 of the exponent of + 'double'. */ +#undef DBL_EXPBIT0_BIT + +/* Define as the word index where to find the exponent of 'double'. */ +#undef DBL_EXPBIT0_WORD + +/* Name of editor program, unless overridden. */ +#undef DEFAULT_EDITOR_PROGRAM + +/* Define to 1 if // is a file system root distinct from /. */ +#undef DOUBLE_SLASH_IS_DISTINCT_ROOT + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#undef ENABLE_NLS + +/* Define to 1 if an invalid memory address access may yield a SIGBUS. */ +#undef FAULT_YIELDS_SIGBUS + +/* Define this to 1 if F_DUPFD behavior does not match POSIX */ +#undef FCNTL_DUPFD_BUGGY + +/* Define to nothing if C supports flexible array members, and to 1 if it does + not. That way, with a declaration like 'struct s { int n; double + d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99 + compilers. When computing the size of such an object, don't use 'sizeof + (struct s)' as it overestimates the size. Use 'offsetof (struct s, d)' + instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with + MSVC and with C++ compilers. */ +#undef FLEXIBLE_ARRAY_MEMBER + +/* Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string. */ +#undef FUNC_NL_LANGINFO_YESEXPR_WORKS + +/* Define if gettimeofday clobbers the localtime buffer. */ +#undef GETTIMEOFDAY_CLOBBERS_LOCALTIME + +/* Define this to 'void' or 'struct timezone' to match the system's + declaration of the second argument to gettimeofday. */ +#undef GETTIMEOFDAY_TIMEZONE + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module dirname shall be considered present. */ +#undef GNULIB_DIRNAME + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module filenamecat shall be considered present. */ +#undef GNULIB_FILENAMECAT + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module freopen-safer shall be considered present. */ +#undef GNULIB_FREOPEN_SAFER + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module fscanf shall be considered present. */ +#undef GNULIB_FSCANF + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module msvc-nothrow shall be considered present. */ +#undef GNULIB_MSVC_NOTHROW + +/* enable some gnulib portability checks */ +#undef GNULIB_PORTCHECK + +/* Define to 1 if printf and friends should be labeled with attribute + "__gnu_printf__" instead of "__printf__" */ +#undef GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module scanf shall be considered present. */ +#undef GNULIB_SCANF + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module snprintf shall be considered present. */ +#undef GNULIB_SNPRINTF + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module strerror shall be considered present. */ +#undef GNULIB_STRERROR + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module strerror_r-posix shall be considered present. */ +#undef GNULIB_STRERROR_R_POSIX + +/* Define to 1 when the gnulib module accept should be tested. */ +#undef GNULIB_TEST_ACCEPT + +/* Define to 1 when the gnulib module bind should be tested. */ +#undef GNULIB_TEST_BIND + +/* Define to 1 when the gnulib module btowc should be tested. */ +#undef GNULIB_TEST_BTOWC + +/* Define to 1 when the gnulib module close should be tested. */ +#undef GNULIB_TEST_CLOSE + +/* Define to 1 when the gnulib module connect should be tested. */ +#undef GNULIB_TEST_CONNECT + +/* Define to 1 when the gnulib module dup2 should be tested. */ +#undef GNULIB_TEST_DUP2 + +/* Define to 1 when the gnulib module environ should be tested. */ +#undef GNULIB_TEST_ENVIRON + +/* Define to 1 when the gnulib module fcntl should be tested. */ +#undef GNULIB_TEST_FCNTL + +/* Define to 1 when the gnulib module fdopen should be tested. */ +#undef GNULIB_TEST_FDOPEN + +/* Define to 1 when the gnulib module freopen should be tested. */ +#undef GNULIB_TEST_FREOPEN + +/* Define to 1 when the gnulib module fstat should be tested. */ +#undef GNULIB_TEST_FSTAT + +/* Define to 1 when the gnulib module ftruncate should be tested. */ +#undef GNULIB_TEST_FTRUNCATE + +/* Define to 1 when the gnulib module getcwd should be tested. */ +#undef GNULIB_TEST_GETCWD + +/* Define to 1 when the gnulib module getdtablesize should be tested. */ +#undef GNULIB_TEST_GETDTABLESIZE + +/* Define to 1 when the gnulib module getpagesize should be tested. */ +#undef GNULIB_TEST_GETPAGESIZE + +/* Define to 1 when the gnulib module gettimeofday should be tested. */ +#undef GNULIB_TEST_GETTIMEOFDAY + +/* Define to 1 when the gnulib module ioctl should be tested. */ +#undef GNULIB_TEST_IOCTL + +/* Define to 1 when the gnulib module iswblank should be tested. */ +#undef GNULIB_TEST_ISWBLANK + +/* Define to 1 when the gnulib module listen should be tested. */ +#undef GNULIB_TEST_LISTEN + +/* Define to 1 when the gnulib module localeconv should be tested. */ +#undef GNULIB_TEST_LOCALECONV + +/* Define to 1 when the gnulib module lstat should be tested. */ +#undef GNULIB_TEST_LSTAT + +/* Define to 1 when the gnulib module malloc-posix should be tested. */ +#undef GNULIB_TEST_MALLOC_POSIX + +/* Define to 1 when the gnulib module mbrtowc should be tested. */ +#undef GNULIB_TEST_MBRTOWC + +/* Define to 1 when the gnulib module mbscasecmp should be tested. */ +#undef GNULIB_TEST_MBSCASECMP + +/* Define to 1 when the gnulib module mbsinit should be tested. */ +#undef GNULIB_TEST_MBSINIT + +/* Define to 1 when the gnulib module mbslen should be tested. */ +#undef GNULIB_TEST_MBSLEN + +/* Define to 1 when the gnulib module mbsrtowcs should be tested. */ +#undef GNULIB_TEST_MBSRTOWCS + +/* Define to 1 when the gnulib module mbsstr should be tested. */ +#undef GNULIB_TEST_MBSSTR + +/* Define to 1 when the gnulib module mbtowc should be tested. */ +#undef GNULIB_TEST_MBTOWC + +/* Define to 1 when the gnulib module memchr should be tested. */ +#undef GNULIB_TEST_MEMCHR + +/* Define to 1 when the gnulib module mkstemp should be tested. */ +#undef GNULIB_TEST_MKSTEMP + +/* Define to 1 when the gnulib module mktime should be tested. */ +#undef GNULIB_TEST_MKTIME + +/* Define to 1 when the gnulib module nanosleep should be tested. */ +#undef GNULIB_TEST_NANOSLEEP + +/* Define to 1 when the gnulib module nl_langinfo should be tested. */ +#undef GNULIB_TEST_NL_LANGINFO + +/* Define to 1 when the gnulib module open should be tested. */ +#undef GNULIB_TEST_OPEN + +/* Define to 1 when the gnulib module perror should be tested. */ +#undef GNULIB_TEST_PERROR + +/* Define to 1 when the gnulib module pipe should be tested. */ +#undef GNULIB_TEST_PIPE + +/* Define to 1 when the gnulib module putenv should be tested. */ +#undef GNULIB_TEST_PUTENV + +/* Define to 1 when the gnulib module raise should be tested. */ +#undef GNULIB_TEST_RAISE + +/* Define to 1 when the gnulib module rawmemchr should be tested. */ +#undef GNULIB_TEST_RAWMEMCHR + +/* Define to 1 when the gnulib module readlink should be tested. */ +#undef GNULIB_TEST_READLINK + +/* Define to 1 when the gnulib module secure_getenv should be tested. */ +#undef GNULIB_TEST_SECURE_GETENV + +/* Define to 1 when the gnulib module select should be tested. */ +#undef GNULIB_TEST_SELECT + +/* Define to 1 when the gnulib module setenv should be tested. */ +#undef GNULIB_TEST_SETENV + +/* Define to 1 when the gnulib module setlocale should be tested. */ +#undef GNULIB_TEST_SETLOCALE + +/* Define to 1 when the gnulib module setsockopt should be tested. */ +#undef GNULIB_TEST_SETSOCKOPT + +/* Define to 1 when the gnulib module sigaction should be tested. */ +#undef GNULIB_TEST_SIGACTION + +/* Define to 1 when the gnulib module sigprocmask should be tested. */ +#undef GNULIB_TEST_SIGPROCMASK + +/* Define to 1 when the gnulib module sleep should be tested. */ +#undef GNULIB_TEST_SLEEP + +/* Define to 1 when the gnulib module snprintf should be tested. */ +#undef GNULIB_TEST_SNPRINTF + +/* Define to 1 when the gnulib module socket should be tested. */ +#undef GNULIB_TEST_SOCKET + +/* Define to 1 when the gnulib module stat should be tested. */ +#undef GNULIB_TEST_STAT + +/* Define to 1 when the gnulib module strerror should be tested. */ +#undef GNULIB_TEST_STRERROR + +/* Define to 1 when the gnulib module strerror_r should be tested. */ +#undef GNULIB_TEST_STRERROR_R + +/* Define to 1 when the gnulib module strndup should be tested. */ +#undef GNULIB_TEST_STRNDUP + +/* Define to 1 when the gnulib module strnlen should be tested. */ +#undef GNULIB_TEST_STRNLEN + +/* Define to 1 when the gnulib module strptime should be tested. */ +#undef GNULIB_TEST_STRPTIME + +/* Define to 1 when the gnulib module strtoull should be tested. */ +#undef GNULIB_TEST_STRTOULL + +/* Define to 1 when the gnulib module symlink should be tested. */ +#undef GNULIB_TEST_SYMLINK + +/* Define to 1 when the gnulib module timegm should be tested. */ +#undef GNULIB_TEST_TIMEGM + +/* Define to 1 when the gnulib module time_r should be tested. */ +#undef GNULIB_TEST_TIME_R + +/* Define to 1 when the gnulib module time_rz should be tested. */ +#undef GNULIB_TEST_TIME_RZ + +/* Define to 1 when the gnulib module tzset should be tested. */ +#undef GNULIB_TEST_TZSET + +/* Define to 1 when the gnulib module unsetenv should be tested. */ +#undef GNULIB_TEST_UNSETENV + +/* Define to 1 when the gnulib module vasprintf should be tested. */ +#undef GNULIB_TEST_VASPRINTF + +/* Define to 1 when the gnulib module wcrtomb should be tested. */ +#undef GNULIB_TEST_WCRTOMB + +/* Define to 1 when the gnulib module wctob should be tested. */ +#undef GNULIB_TEST_WCTOB + +/* Define to 1 when the gnulib module wctomb should be tested. */ +#undef GNULIB_TEST_WCTOMB + +/* Define to 1 when the gnulib module wcwidth should be tested. */ +#undef GNULIB_TEST_WCWIDTH + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module unistr/u8-mbtoucr shall be considered present. */ +#undef GNULIB_UNISTR_U8_MBTOUCR + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module unistr/u8-uctomb shall be considered present. */ +#undef GNULIB_UNISTR_U8_UCTOMB + +/* Define to 1 if you have 'alloca' after including <alloca.h>, a header that + may be supplied by this distribution. */ +#undef HAVE_ALLOCA + +/* Define to 1 if <alloca.h> works. */ +#undef HAVE_ALLOCA_H + +/* Define to 1 if you have the <arpa/inet.h> header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if you have the <bp-sym.h> header file. */ +#undef HAVE_BP_SYM_H + +/* Define to 1 if you have the 'btowc' function. */ +#undef HAVE_BTOWC + +/* Define to 1 if nanosleep mishandles large arguments. */ +#undef HAVE_BUG_BIG_NANOSLEEP + +/* Define to 1 if you have the 'catgets' function. */ +#undef HAVE_CATGETS + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +#undef HAVE_CFLOCALECOPYCURRENT + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +#undef HAVE_CFPREFERENCESCOPYAPPVALUE + +/* Define to 1 if you have the 'chsize' function. */ +#undef HAVE_CHSIZE + +/* Define to 1 if you have the 'clock_gettime' function. */ +#undef HAVE_CLOCK_GETTIME + +/* Define to 1 if you have the 'clock_settime' function. */ +#undef HAVE_CLOCK_SETTIME + +/* Define to 1 if you have the <crtdefs.h> header file. */ +#undef HAVE_CRTDEFS_H + +/* Define to 1 if C supports variable-length arrays. */ +#undef HAVE_C_VARARRAYS + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#undef HAVE_DCGETTEXT + +/* Define to 1 if you have the declaration of 'alarm', and to 0 if you don't. + */ +#undef HAVE_DECL_ALARM + +/* Define to 1 if you have the declaration of 'clearerr_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_CLEARERR_UNLOCKED + +/* Define to 1 if you have the declaration of 'feof_unlocked', and to 0 if you + don't. */ +#undef HAVE_DECL_FEOF_UNLOCKED + +/* Define to 1 if you have the declaration of 'ferror_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FERROR_UNLOCKED + +/* Define to 1 if you have the declaration of 'fflush_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FFLUSH_UNLOCKED + +/* Define to 1 if you have the declaration of 'fgets_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FGETS_UNLOCKED + +/* Define to 1 if you have the declaration of 'fputc_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FPUTC_UNLOCKED + +/* Define to 1 if you have the declaration of 'fputs_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FPUTS_UNLOCKED + +/* Define to 1 if you have the declaration of 'fread_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FREAD_UNLOCKED + +/* Define to 1 if you have the declaration of 'fwrite_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FWRITE_UNLOCKED + +/* Define to 1 if you have the declaration of 'getchar_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_GETCHAR_UNLOCKED + +/* Define to 1 if you have the declaration of 'getc_unlocked', and to 0 if you + don't. */ +#undef HAVE_DECL_GETC_UNLOCKED + +/* Define to 1 if you have the declaration of 'getdtablesize', and to 0 if you + don't. */ +#undef HAVE_DECL_GETDTABLESIZE + +/* Define to 1 if you have the declaration of 'inet_pton', and to 0 if you + don't. */ +#undef HAVE_DECL_INET_PTON + +/* Define to 1 if you have the declaration of 'isblank', and to 0 if you + don't. */ +#undef HAVE_DECL_ISBLANK + +/* Define to 1 if you have the declaration of 'iswblank', and to 0 if you + don't. */ +#undef HAVE_DECL_ISWBLANK + +/* Define to 1 if you have the declaration of 'localtime_r', and to 0 if you + don't. */ +#undef HAVE_DECL_LOCALTIME_R + +/* Define to 1 if you have the declaration of 'mbrtowc', and to 0 if you + don't. */ +#undef HAVE_DECL_MBRTOWC + +/* Define to 1 if you have the declaration of 'mbsinit', and to 0 if you + don't. */ +#undef HAVE_DECL_MBSINIT + +/* Define to 1 if you have the declaration of 'mbsrtowcs', and to 0 if you + don't. */ +#undef HAVE_DECL_MBSRTOWCS + +/* Define to 1 if you have the declaration of 'program_invocation_name', and + to 0 if you don't. */ +#undef HAVE_DECL_PROGRAM_INVOCATION_NAME + +/* Define to 1 if you have the declaration of 'program_invocation_short_name', + and to 0 if you don't. */ +#undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME + +/* Define to 1 if you have the declaration of 'putchar_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_PUTCHAR_UNLOCKED + +/* Define to 1 if you have the declaration of 'putc_unlocked', and to 0 if you + don't. */ +#undef HAVE_DECL_PUTC_UNLOCKED + +/* Define to 1 if you have the declaration of 'setenv', and to 0 if you don't. + */ +#undef HAVE_DECL_SETENV + +/* Define to 1 if you have the declaration of 'sigaltstack', and to 0 if you + don't. */ +#undef HAVE_DECL_SIGALTSTACK + +/* Define to 1 if you have the declaration of 'sleep', and to 0 if you don't. + */ +#undef HAVE_DECL_SLEEP + +/* Define to 1 if you have the declaration of 'snprintf', and to 0 if you + don't. */ +#undef HAVE_DECL_SNPRINTF + +/* Define to 1 if you have the declaration of 'strerror_r', and to 0 if you + don't. */ +#undef HAVE_DECL_STRERROR_R + +/* Define to 1 if you have the declaration of 'strncasecmp', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNCASECMP + +/* Define to 1 if you have the declaration of 'strndup', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNDUP + +/* Define to 1 if you have the declaration of 'strnlen', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNLEN + +/* Define to 1 if you have the declaration of 'strtoull', and to 0 if you + don't. */ +#undef HAVE_DECL_STRTOULL + +/* Define to 1 if you have the declaration of 'strtoumax', and to 0 if you + don't. */ +#undef HAVE_DECL_STRTOUMAX + +/* Define to 1 if you have the declaration of 'towlower', and to 0 if you + don't. */ +#undef HAVE_DECL_TOWLOWER + +/* Define to 1 if you have the declaration of 'tzname', and to 0 if you don't. + */ +#undef HAVE_DECL_TZNAME + +/* Define to 1 if you have the declaration of 'unsetenv', and to 0 if you + don't. */ +#undef HAVE_DECL_UNSETENV + +/* Define to 1 if you have the declaration of 'wcrtomb', and to 0 if you + don't. */ +#undef HAVE_DECL_WCRTOMB + +/* Define to 1 if you have the declaration of 'wctob', and to 0 if you don't. + */ +#undef HAVE_DECL_WCTOB + +/* Define to 1 if you have the declaration of 'wcwidth', and to 0 if you + don't. */ +#undef HAVE_DECL_WCWIDTH + +/* Define to 1 if you have the declaration of '_putenv', and to 0 if you + don't. */ +#undef HAVE_DECL__PUTENV + +/* Define to 1 if you have the declaration of '_snprintf', and to 0 if you + don't. */ +#undef HAVE_DECL__SNPRINTF + +/* Define to 1 if you have the declaration of '__argv', and to 0 if you don't. + */ +#undef HAVE_DECL___ARGV + +/* Define to 1 if you have the <dirent.h> header file, and it defines 'DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the 'dup2' function. */ +#undef HAVE_DUP2 + +/* Define if you have the declaration of environ. */ +#undef HAVE_ENVIRON_DECL + +/* Define to 1 if you have the 'fcntl' function. */ +#undef HAVE_FCNTL + +/* Define to 1 if you have the <features.h> header file. */ +#undef HAVE_FEATURES_H + +/* Define to 1 if you have the 'fork' function. */ +#undef HAVE_FORK + +/* Define to 1 if you have the 'ftruncate' function. */ +#undef HAVE_FTRUNCATE + +/* Define to 1 if you have the 'getdtablesize' function. */ +#undef HAVE_GETDTABLESIZE + +/* Define to 1 if you have the 'getegid' function. */ +#undef HAVE_GETEGID + +/* Define to 1 if you have the 'geteuid' function. */ +#undef HAVE_GETEUID + +/* Define to 1 if you have the 'getexecname' function. */ +#undef HAVE_GETEXECNAME + +/* Define to 1 if you have the 'getgid' function. */ +#undef HAVE_GETGID + +/* Define to 1 if you have the <getopt.h> header file. */ +#undef HAVE_GETOPT_H + +/* Define to 1 if you have the 'getopt_long_only' function. */ +#undef HAVE_GETOPT_LONG_ONLY + +/* Define to 1 if you have the 'getpagesize' function. */ +#undef HAVE_GETPAGESIZE + +/* Define to 1 if you have the 'getprogname' function. */ +#undef HAVE_GETPROGNAME + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT + +/* Define to 1 if you have the 'gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the 'getuid' function. */ +#undef HAVE_GETUID + +/* Define if you have the iconv() function and it works. */ +#undef HAVE_ICONV + +/* Define to 1 if you have the <iconv.h> header file. */ +#undef HAVE_ICONV_H + +/* Define to 1 if you have the 'inet_pton' function. */ +#undef HAVE_INET_PTON + +/* Define to 1 if the compiler supports one of the keywords 'inline', + '__inline__', '__inline' and effectively inlines functions marked as such. + */ +#undef HAVE_INLINE + +/* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */ +#undef HAVE_INTMAX_T + +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H + +/* Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and + declares uintmax_t. */ +#undef HAVE_INTTYPES_H_WITH_UINTMAX + +/* Define to 1 if you have the 'ioctl' function. */ +#undef HAVE_IOCTL + +/* Define to 1 if <sys/socket.h> defines AF_INET. */ +#undef HAVE_IPV4 + +/* Define to 1 if <sys/socket.h> defines AF_INET6. */ +#undef HAVE_IPV6 + +/* Define to 1 if you have the 'isblank' function. */ +#undef HAVE_ISBLANK + +/* Define to 1 if you have the 'issetugid' function. */ +#undef HAVE_ISSETUGID + +/* Define to 1 if you have the 'iswblank' function. */ +#undef HAVE_ISWBLANK + +/* Define to 1 if you have the 'iswcntrl' function. */ +#undef HAVE_ISWCNTRL + +/* Define to 1 if you have the 'iswctype' function. */ +#undef HAVE_ISWCTYPE + +/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */ +#undef HAVE_LANGINFO_CODESET + +/* Define to 1 if you have the <langinfo.h> header file. */ +#undef HAVE_LANGINFO_H + +/* Define to 1 if you have the <libintl.h> header file. */ +#undef HAVE_LIBINTL_H + +/* Define if you have the libsigsegv library. */ +#undef HAVE_LIBSIGSEGV + +/* Define to 1 if you have the <limits.h> header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the 'localtime_r' function. */ +#undef HAVE_LOCALTIME_R + +/* Define to 1 if the system has the type 'long long int'. */ +#undef HAVE_LONG_LONG_INT + +/* Define to 1 if you have the 'lstat' function. */ +#undef HAVE_LSTAT + +/* Define to 1 if you have the <malloc.h> header file. */ +#undef HAVE_MALLOC_H + +/* Define if the 'malloc' function is POSIX compliant. */ +#undef HAVE_MALLOC_POSIX + +/* Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including + config.h and <sys/mman.h>. */ +#undef HAVE_MAP_ANONYMOUS + +/* Define to 1 if you have the 'mbrtowc' function. */ +#undef HAVE_MBRTOWC + +/* Define to 1 if you have the 'mbsinit' function. */ +#undef HAVE_MBSINIT + +/* Define to 1 if you have the 'mbslen' function. */ +#undef HAVE_MBSLEN + +/* Define to 1 if you have the 'mbsrtowcs' function. */ +#undef HAVE_MBSRTOWCS + +/* Define to 1 if <wchar.h> declares mbstate_t. */ +#undef HAVE_MBSTATE_T + +/* Define to 1 if you have the 'mempcpy' function. */ +#undef HAVE_MEMPCPY + +/* Define to 1 if <limits.h> defines the MIN and MAX macros. */ +#undef HAVE_MINMAX_IN_LIMITS_H + +/* Define to 1 if <sys/param.h> defines the MIN and MAX macros. */ +#undef HAVE_MINMAX_IN_SYS_PARAM_H + +/* Define to 1 if you have the 'mkstemp' function. */ +#undef HAVE_MKSTEMP + +/* Define to 1 if you have the 'mprotect' function. */ +#undef HAVE_MPROTECT + +/* Define to 1 on MSVC platforms that have the "invalid parameter handler" + concept. */ +#undef HAVE_MSVC_INVALID_PARAMETER_HANDLER + +/* Define to 1 if you have the 'nanotime' function. */ +#undef HAVE_NANOTIME + +/* Define to 1 if you have the <ndir.h> header file, and it defines 'DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have the <netdb.h> header file. */ +#undef HAVE_NETDB_H + +/* Define to 1 if you have the <netinet/in.h> header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the 'newlocale' function. */ +#undef HAVE_NEWLOCALE + +/* Define to 1 if you have the 'nl_langinfo' function. */ +#undef HAVE_NL_LANGINFO + +/* Define to 1 if you have the <OS.h> header file. */ +#undef HAVE_OS_H + +/* Define to 1 if you have the 'pipe' function. */ +#undef HAVE_PIPE + +/* Define to 1 if you have the 'raise' function. */ +#undef HAVE_RAISE + +/* Define to 1 if you have the 'rawmemchr' function. */ +#undef HAVE_RAWMEMCHR + +/* Define to 1 if accept is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ACCEPT + +/* Define to 1 if accept4 is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ACCEPT4 + +/* Define to 1 if atoll is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ATOLL + +/* Define to 1 if bind is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_BIND + +/* Define to 1 if btowc is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_BTOWC + +/* Define to 1 if canonicalize_file_name is declared even after undefining + macros. */ +#undef HAVE_RAW_DECL_CANONICALIZE_FILE_NAME + +/* Define to 1 if chdir is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_CHDIR + +/* Define to 1 if chown is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_CHOWN + +/* Define to 1 if connect is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_CONNECT + +/* Define to 1 if dprintf is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_DPRINTF + +/* Define to 1 if dup is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_DUP + +/* Define to 1 if dup2 is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_DUP2 + +/* Define to 1 if dup3 is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_DUP3 + +/* Define to 1 if duplocale is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_DUPLOCALE + +/* Define to 1 if endusershell is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ENDUSERSHELL + +/* Define to 1 if environ is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ENVIRON + +/* Define to 1 if euidaccess is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_EUIDACCESS + +/* Define to 1 if faccessat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FACCESSAT + +/* Define to 1 if fchdir is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FCHDIR + +/* Define to 1 if fchmodat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FCHMODAT + +/* Define to 1 if fchownat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FCHOWNAT + +/* Define to 1 if fcntl is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FCNTL + +/* Define to 1 if fdatasync is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FDATASYNC + +/* Define to 1 if ffs is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FFS + +/* Define to 1 if ffsl is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FFSL + +/* Define to 1 if ffsll is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FFSLL + +/* Define to 1 if fpurge is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FPURGE + +/* Define to 1 if fseeko is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FSEEKO + +/* Define to 1 if fstat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FSTAT + +/* Define to 1 if fstatat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FSTATAT + +/* Define to 1 if fsync is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FSYNC + +/* Define to 1 if ftello is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FTELLO + +/* Define to 1 if ftruncate is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FTRUNCATE + +/* Define to 1 if futimens is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FUTIMENS + +/* Define to 1 if getcwd is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETCWD + +/* Define to 1 if getdelim is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETDELIM + +/* Define to 1 if getdomainname is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETDOMAINNAME + +/* Define to 1 if getdtablesize is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETDTABLESIZE + +/* Define to 1 if getgroups is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETGROUPS + +/* Define to 1 if gethostname is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETHOSTNAME + +/* Define to 1 if getline is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETLINE + +/* Define to 1 if getloadavg is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETLOADAVG + +/* Define to 1 if getlogin is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETLOGIN + +/* Define to 1 if getlogin_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETLOGIN_R + +/* Define to 1 if getpagesize is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETPAGESIZE + +/* Define to 1 if getpeername is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETPEERNAME + +/* Define to 1 if gets is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETS + +/* Define to 1 if getsockname is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETSOCKNAME + +/* Define to 1 if getsockopt is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETSOCKOPT + +/* Define to 1 if getsubopt is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETSUBOPT + +/* Define to 1 if gettimeofday is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETTIMEOFDAY + +/* Define to 1 if getusershell is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETUSERSHELL + +/* Define to 1 if grantpt is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GRANTPT + +/* Define to 1 if group_member is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GROUP_MEMBER + +/* Define to 1 if imaxabs is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_IMAXABS + +/* Define to 1 if imaxdiv is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_IMAXDIV + +/* Define to 1 if inet_ntop is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_INET_NTOP + +/* Define to 1 if inet_pton is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_INET_PTON + +/* Define to 1 if initstate is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_INITSTATE + +/* Define to 1 if initstate_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_INITSTATE_R + +/* Define to 1 if ioctl is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_IOCTL + +/* Define to 1 if isatty is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ISATTY + +/* Define to 1 if isblank is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ISBLANK + +/* Define to 1 if iswctype is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ISWCTYPE + +/* Define to 1 if lchmod is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LCHMOD + +/* Define to 1 if lchown is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LCHOWN + +/* Define to 1 if link is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LINK + +/* Define to 1 if linkat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LINKAT + +/* Define to 1 if listen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LISTEN + +/* Define to 1 if lseek is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LSEEK + +/* Define to 1 if lstat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LSTAT + +/* Define to 1 if mbrlen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MBRLEN + +/* Define to 1 if mbrtowc is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MBRTOWC + +/* Define to 1 if mbsinit is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MBSINIT + +/* Define to 1 if mbsnrtowcs is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MBSNRTOWCS + +/* Define to 1 if mbsrtowcs is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MBSRTOWCS + +/* Define to 1 if memmem is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MEMMEM + +/* Define to 1 if mempcpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MEMPCPY + +/* Define to 1 if memrchr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MEMRCHR + +/* Define to 1 if mkdirat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKDIRAT + +/* Define to 1 if mkdtemp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKDTEMP + +/* Define to 1 if mkfifo is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKFIFO + +/* Define to 1 if mkfifoat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKFIFOAT + +/* Define to 1 if mknod is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKNOD + +/* Define to 1 if mknodat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKNODAT + +/* Define to 1 if mkostemp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKOSTEMP + +/* Define to 1 if mkostemps is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKOSTEMPS + +/* Define to 1 if mkstemp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKSTEMP + +/* Define to 1 if mkstemps is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKSTEMPS + +/* Define to 1 if nl_langinfo is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_NL_LANGINFO + +/* Define to 1 if openat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_OPENAT + +/* Define to 1 if pclose is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PCLOSE + +/* Define to 1 if pipe is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PIPE + +/* Define to 1 if pipe2 is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PIPE2 + +/* Define to 1 if popen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_POPEN + +/* Define to 1 if posix_openpt is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_POSIX_OPENPT + +/* Define to 1 if pread is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PREAD + +/* Define to 1 if pselect is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PSELECT + +/* Define to 1 if pthread_sigmask is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PTHREAD_SIGMASK + +/* Define to 1 if ptsname is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PTSNAME + +/* Define to 1 if ptsname_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PTSNAME_R + +/* Define to 1 if pwrite is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PWRITE + +/* Define to 1 if qsort_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_QSORT_R + +/* Define to 1 if random is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RANDOM + +/* Define to 1 if random_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RANDOM_R + +/* Define to 1 if rawmemchr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RAWMEMCHR + +/* Define to 1 if readlink is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_READLINK + +/* Define to 1 if readlinkat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_READLINKAT + +/* Define to 1 if realpath is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_REALPATH + +/* Define to 1 if recv is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RECV + +/* Define to 1 if recvfrom is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RECVFROM + +/* Define to 1 if renameat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RENAMEAT + +/* Define to 1 if rmdir is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RMDIR + +/* Define to 1 if rpmatch is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RPMATCH + +/* Define to 1 if secure_getenv is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SECURE_GETENV + +/* Define to 1 if select is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SELECT + +/* Define to 1 if send is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SEND + +/* Define to 1 if sendto is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SENDTO + +/* Define to 1 if setenv is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETENV + +/* Define to 1 if sethostname is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETHOSTNAME + +/* Define to 1 if setlocale is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETLOCALE + +/* Define to 1 if setsockopt is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETSOCKOPT + +/* Define to 1 if setstate is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETSTATE + +/* Define to 1 if setstate_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETSTATE_R + +/* Define to 1 if setusershell is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETUSERSHELL + +/* Define to 1 if shutdown is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SHUTDOWN + +/* Define to 1 if sigaction is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SIGACTION + +/* Define to 1 if sigaddset is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SIGADDSET + +/* Define to 1 if sigdelset is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SIGDELSET + +/* Define to 1 if sigemptyset is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SIGEMPTYSET + +/* Define to 1 if sigfillset is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SIGFILLSET + +/* Define to 1 if sigismember is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SIGISMEMBER + +/* Define to 1 if sigpending is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SIGPENDING + +/* Define to 1 if sigprocmask is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SIGPROCMASK + +/* Define to 1 if sleep is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SLEEP + +/* Define to 1 if snprintf is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SNPRINTF + +/* Define to 1 if socket is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SOCKET + +/* Define to 1 if srandom is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SRANDOM + +/* Define to 1 if srandom_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SRANDOM_R + +/* Define to 1 if stat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STAT + +/* Define to 1 if stpcpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STPCPY + +/* Define to 1 if stpncpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STPNCPY + +/* Define to 1 if strcasecmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRCASECMP + +/* Define to 1 if strcasestr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRCASESTR + +/* Define to 1 if strchrnul is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRCHRNUL + +/* Define to 1 if strdup is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRDUP + +/* Define to 1 if strerror_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRERROR_R + +/* Define to 1 if strncasecmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRNCASECMP + +/* Define to 1 if strncat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRNCAT + +/* Define to 1 if strndup is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRNDUP + +/* Define to 1 if strnlen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRNLEN + +/* Define to 1 if strpbrk is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRPBRK + +/* Define to 1 if strsep is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRSEP + +/* Define to 1 if strsignal is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRSIGNAL + +/* Define to 1 if strtod is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRTOD + +/* Define to 1 if strtoimax is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRTOIMAX + +/* Define to 1 if strtok_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRTOK_R + +/* Define to 1 if strtoll is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRTOLL + +/* Define to 1 if strtoull is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRTOULL + +/* Define to 1 if strtoumax is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRTOUMAX + +/* Define to 1 if strverscmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRVERSCMP + +/* Define to 1 if symlink is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SYMLINK + +/* Define to 1 if symlinkat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SYMLINKAT + +/* Define to 1 if tmpfile is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_TMPFILE + +/* Define to 1 if towctrans is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_TOWCTRANS + +/* Define to 1 if truncate is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_TRUNCATE + +/* Define to 1 if ttyname_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_TTYNAME_R + +/* Define to 1 if unlink is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_UNLINK + +/* Define to 1 if unlinkat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_UNLINKAT + +/* Define to 1 if unlockpt is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_UNLOCKPT + +/* Define to 1 if unsetenv is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_UNSETENV + +/* Define to 1 if usleep is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_USLEEP + +/* Define to 1 if utimensat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_UTIMENSAT + +/* Define to 1 if vdprintf is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_VDPRINTF + +/* Define to 1 if vsnprintf is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_VSNPRINTF + +/* Define to 1 if waitpid is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WAITPID + +/* Define to 1 if wcpcpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCPCPY + +/* Define to 1 if wcpncpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCPNCPY + +/* Define to 1 if wcrtomb is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCRTOMB + +/* Define to 1 if wcscasecmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCASECMP + +/* Define to 1 if wcscat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCAT + +/* Define to 1 if wcschr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCHR + +/* Define to 1 if wcscmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCMP + +/* Define to 1 if wcscoll is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCOLL + +/* Define to 1 if wcscpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCPY + +/* Define to 1 if wcscspn is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCSPN + +/* Define to 1 if wcsdup is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSDUP + +/* Define to 1 if wcsftime is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSFTIME + +/* Define to 1 if wcslen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSLEN + +/* Define to 1 if wcsncasecmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNCASECMP + +/* Define to 1 if wcsncat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNCAT + +/* Define to 1 if wcsncmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNCMP + +/* Define to 1 if wcsncpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNCPY + +/* Define to 1 if wcsnlen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNLEN + +/* Define to 1 if wcsnrtombs is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNRTOMBS + +/* Define to 1 if wcspbrk is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSPBRK + +/* Define to 1 if wcsrchr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSRCHR + +/* Define to 1 if wcsrtombs is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSRTOMBS + +/* Define to 1 if wcsspn is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSSPN + +/* Define to 1 if wcsstr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSSTR + +/* Define to 1 if wcstok is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSTOK + +/* Define to 1 if wcswidth is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSWIDTH + +/* Define to 1 if wcsxfrm is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSXFRM + +/* Define to 1 if wctob is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCTOB + +/* Define to 1 if wctrans is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCTRANS + +/* Define to 1 if wctype is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCTYPE + +/* Define to 1 if wcwidth is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCWIDTH + +/* Define to 1 if wmemchr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMCHR + +/* Define to 1 if wmemcmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMCMP + +/* Define to 1 if wmemcpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMCPY + +/* Define to 1 if wmemmove is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMMOVE + +/* Define to 1 if wmemset is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMSET + +/* Define to 1 if _Exit is declared even after undefining macros. */ +#undef HAVE_RAW_DECL__EXIT + +/* Define to 1 if you have the 'readlink' function. */ +#undef HAVE_READLINK + +/* Define to 1 if you have the 'readlinkat' function. */ +#undef HAVE_READLINKAT + +/* Define to 1 if you have run the test for working tzset. */ +#undef HAVE_RUN_TZSET_TEST + +/* Define to 1 if the system has the type 'sa_family_t'. */ +#undef HAVE_SA_FAMILY_T + +/* Define to 1 if you have the <search.h> header file. */ +#undef HAVE_SEARCH_H + +/* Define to 1 if you have the 'secure_getenv' function. */ +#undef HAVE_SECURE_GETENV + +/* Define to 1 if you have the 'setdtablesize' function. */ +#undef HAVE_SETDTABLESIZE + +/* Define to 1 if you have the 'setenv' function. */ +#undef HAVE_SETENV + +/* Define to 1 if you have the 'setrlimit' function. */ +#undef HAVE_SETRLIMIT + +/* Define to 1 if you have the 'shutdown' function. */ +#undef HAVE_SHUTDOWN + +/* Define to 1 if you have the 'sigaction' function. */ +#undef HAVE_SIGACTION + +/* Define to 1 if you have the 'sigaltstack' function. */ +#undef HAVE_SIGALTSTACK + +/* Define to 1 if you have the 'sigblock' function. */ +#undef HAVE_SIGBLOCK + +/* Define to 1 if the system has the type 'siginfo_t'. */ +#undef HAVE_SIGINFO_T + +/* Define to 1 if you have the 'siginterrupt' function. */ +#undef HAVE_SIGINTERRUPT + +/* Define to 1 if 'sig_atomic_t' is a signed integer type. */ +#undef HAVE_SIGNED_SIG_ATOMIC_T + +/* Define to 1 if 'wchar_t' is a signed integer type. */ +#undef HAVE_SIGNED_WCHAR_T + +/* Define to 1 if 'wint_t' is a signed integer type. */ +#undef HAVE_SIGNED_WINT_T + +/* Define to 1 if you have the 'sigprocmask' function. */ +#undef HAVE_SIGPROCMASK + +/* Define to 1 if the system has the type 'sigset_t'. */ +#undef HAVE_SIGSET_T + +/* Define to 1 if you have the 'sleep' function. */ +#undef HAVE_SLEEP + +/* Define to 1 if you have the 'snprintf' function. */ +#undef HAVE_SNPRINTF + +/* Define if the return value of the snprintf function is the number of of + bytes (excluding the terminating NUL) that would have been produced if the + buffer had been large enough. */ +#undef HAVE_SNPRINTF_RETVAL_C99 + +/* Define to 1 if extending the stack slightly past the limit causes a SIGSEGV + which can be handled on an alternate stack established with sigaltstack. */ +#undef HAVE_STACK_OVERFLOW_HANDLING + +/* Define to 1 if the system has the type 'stack_t'. */ +#undef HAVE_STACK_T + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares + uintmax_t. */ +#undef HAVE_STDINT_H_WITH_UINTMAX + +/* Define to 1 if you have the <stdio.h> header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the 'strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the 'strcasecoll' function. */ +#undef HAVE_STRCASECOLL + +/* Define to 1 if you have the 'strerror_r' function. */ +#undef HAVE_STRERROR_R + +/* Define to 1 if you have the 'stricoll' function. */ +#undef HAVE_STRICOLL + +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the 'strncasecmp' function. */ +#undef HAVE_STRNCASECMP + +/* Define to 1 if you have the 'strndup' function. */ +#undef HAVE_STRNDUP + +/* Define to 1 if you have the 'strnlen' function. */ +#undef HAVE_STRNLEN + +/* Define to 1 if you have the 'strptime' function. */ +#undef HAVE_STRPTIME + +/* Define to 1 if you have the 'strtoull' function. */ +#undef HAVE_STRTOULL + +/* Define to 1 if you have the 'strtoumax' function. */ +#undef HAVE_STRTOUMAX + +/* Define to 1 if 'decimal_point' is a member of 'struct lconv'. */ +#undef HAVE_STRUCT_LCONV_DECIMAL_POINT + +/* Define to 1 if 'sa_sigaction' is a member of 'struct sigaction'. */ +#undef HAVE_STRUCT_SIGACTION_SA_SIGACTION + +/* Define to 1 if the system has the type 'struct sockaddr_storage'. */ +#undef HAVE_STRUCT_SOCKADDR_STORAGE + +/* Define to 1 if 'ss_family' is a member of 'struct sockaddr_storage'. */ +#undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY + +/* Define to 1 if 'st_atimensec' is a member of 'struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIMENSEC + +/* Define to 1 if 'st_atimespec.tv_nsec' is a member of 'struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC + +/* Define to 1 if 'st_atim.st__tim.tv_nsec' is a member of 'struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC + +/* Define to 1 if 'st_atim.tv_nsec' is a member of 'struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC + +/* Define to 1 if 'st_birthtimensec' is a member of 'struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC + +/* Define to 1 if 'st_birthtimespec.tv_nsec' is a member of 'struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC + +/* Define to 1 if 'st_birthtim.tv_nsec' is a member of 'struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC + +/* Define to 1 if 'st_blksize' is a member of 'struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_BLKSIZE + +/* Define to 1 if 'st_rdev' is a member of 'struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_RDEV + +/* Define to 1 if 'tm_zone' is a member of 'struct tm'. */ +#undef HAVE_STRUCT_TM_TM_ZONE + +/* Define to 1 if you have the 'symlink' function. */ +#undef HAVE_SYMLINK + +/* Define to 1 if you have the <sys/bitypes.h> header file. */ +#undef HAVE_SYS_BITYPES_H + +/* Define to 1 if you have the <sys/cdefs.h> header file. */ +#undef HAVE_SYS_CDEFS_H + +/* Define to 1 if you have the <sys/dir.h> header file, and it defines 'DIR'. + */ +#undef HAVE_SYS_DIR_H + +/* Define to 1 if you have the <sys/inttypes.h> header file. */ +#undef HAVE_SYS_INTTYPES_H + +/* Define to 1 if you have the <sys/ioctl.h> header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the <sys/mman.h> header file. */ +#undef HAVE_SYS_MMAN_H + +/* Define to 1 if you have the <sys/ndir.h> header file, and it defines 'DIR'. + */ +#undef HAVE_SYS_NDIR_H + +/* Define to 1 if you have the <sys/param.h> header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the <sys/select.h> header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the <sys/time.h> header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the <sys/uio.h> header file. */ +#undef HAVE_SYS_UIO_H + +/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if you have the 'timegm' function. */ +#undef HAVE_TIMEGM + +/* Define to 1 if the system has the type 'timezone_t'. */ +#undef HAVE_TIMEZONE_T + +/* Define if struct tm has the tm_gmtoff member. */ +#undef HAVE_TM_GMTOFF + +/* Define to 1 if your 'struct tm' has 'tm_zone'. Deprecated, use + 'HAVE_STRUCT_TM_TM_ZONE' instead. */ +#undef HAVE_TM_ZONE + +/* Define to 1 if you have the 'towlower' function. */ +#undef HAVE_TOWLOWER + +/* Define to 1 if you have the 'tsearch' function. */ +#undef HAVE_TSEARCH + +/* Define to 1 if you don't have 'tm_zone' but do have the external array + 'tzname'. */ +#undef HAVE_TZNAME + +/* Define to 1 if you have the 'tzset' function. */ +#undef HAVE_TZSET + +/* Define to 1 if you have the <ucontext.h> header file. */ +#undef HAVE_UCONTEXT_H + +/* Define to 1 if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the 'unsetenv' function. */ +#undef HAVE_UNSETENV + +/* Define to 1 if the system has the type 'unsigned long long int'. */ +#undef HAVE_UNSIGNED_LONG_LONG_INT + +/* Define if you have a global __progname variable */ +#undef HAVE_VAR___PROGNAME + +/* Define to 1 if you have the 'vasnprintf' function. */ +#undef HAVE_VASNPRINTF + +/* Define to 1 if you have the 'vasprintf' function. */ +#undef HAVE_VASPRINTF + +/* Define to 1 if you have the 'vfork' function. */ +#undef HAVE_VFORK + +/* Define to 1 if you have the <vfork.h> header file. */ +#undef HAVE_VFORK_H + +/* Define to 1 if you have the <wchar.h> header file. */ +#undef HAVE_WCHAR_H + +/* Define if you have the 'wchar_t' type. */ +#undef HAVE_WCHAR_T + +/* Define to 1 if you have the 'wcrtomb' function. */ +#undef HAVE_WCRTOMB + +/* Define to 1 if you have the 'wcslen' function. */ +#undef HAVE_WCSLEN + +/* Define to 1 if you have the 'wcsnlen' function. */ +#undef HAVE_WCSNLEN + +/* Define to 1 if you have the 'wctob' function. */ +#undef HAVE_WCTOB + +/* Define to 1 if you have the <wctype.h> header file. */ +#undef HAVE_WCTYPE_H + +/* Define to 1 if you have the 'wcwidth' function. */ +#undef HAVE_WCWIDTH + +/* Define to 1 if you have the <winsock2.h> header file. */ +#undef HAVE_WINSOCK2_H + +/* Define if you have the 'wint_t' type. */ +#undef HAVE_WINT_T + +/* Define to 1 if you have the 'wmemchr' function. */ +#undef HAVE_WMEMCHR + +/* Define to 1 if you have the 'wmemcpy' function. */ +#undef HAVE_WMEMCPY + +/* Define to 1 if you have the 'wmempcpy' function. */ +#undef HAVE_WMEMPCPY + +/* Define to 1 if 'fork' works. */ +#undef HAVE_WORKING_FORK + +/* Define to 1 if O_NOATIME works. */ +#undef HAVE_WORKING_O_NOATIME + +/* Define to 1 if O_NOFOLLOW works. */ +#undef HAVE_WORKING_O_NOFOLLOW + +/* Define to 1 if 'vfork' works. */ +#undef HAVE_WORKING_VFORK + +/* Define to 1 if you have the <ws2tcpip.h> header file. */ +#undef HAVE_WS2TCPIP_H + +/* Define to 1 if you have the <xlocale.h> header file. */ +#undef HAVE_XLOCALE_H + +/* Define to 1 if extending the stack slightly past the limit causes a + SIGSEGV, and an alternate stack can be established with sigaltstack, and + the signal handler is passed a context that specifies the run time stack. + This behavior is defined by POSIX 1003.1-2001 with the X/Open System + Interface (XSI) option and is a standardized way to implement a SEGV-based + stack overflow detection heuristic. */ +#undef HAVE_XSI_STACK_OVERFLOW_HEURISTIC + +/* Define to 1 if the system has the type '_Bool'. */ +#undef HAVE__BOOL + +/* Define to 1 if you have the '_set_invalid_parameter_handler' function. */ +#undef HAVE__SET_INVALID_PARAMETER_HANDLER + +/* Define to 1 if the compiler supports __builtin_expect, + and to 2 if <builtins.h> does. */ +#undef HAVE___BUILTIN_EXPECT +#ifndef HAVE___BUILTIN_EXPECT +# define __builtin_expect(e, c) (e) +#elif HAVE___BUILTIN_EXPECT == 2 +# include <builtins.h> +#endif + + +/* Define to 1 if you have the '__secure_getenv' function. */ +#undef HAVE___SECURE_GETENV + +/* Define to 1 if you have the '__xpg_strerror_r' function. */ +#undef HAVE___XPG_STRERROR_R + +/* Define as const if the declaration of iconv() needs const. */ +#undef ICONV_CONST + +/* Define to a symbolic name denoting the flavor of iconv_open() + implementation. */ +#undef ICONV_FLAVOR + +/* Define to 1 if 'lstat' dereferences a symlink specified with a trailing + slash. */ +#undef LSTAT_FOLLOWS_SLASHED_SYMLINK + +/* If malloc(0) is != NULL, define this to 1. Otherwise define this to 0. */ +#undef MALLOC_0_IS_NONNULL + +/* Define to a substitute value for mmap()'s MAP_ANONYMOUS flag. */ +#undef MAP_ANONYMOUS + +/* Define if the mbrtowc function does not return (size_t) -2 for empty input. + */ +#undef MBRTOWC_EMPTY_INPUT_BUG + +/* Define if the mbrtowc function has the NULL pwc argument bug. */ +#undef MBRTOWC_NULL_ARG1_BUG + +/* Define if the mbrtowc function has the NULL string argument bug. */ +#undef MBRTOWC_NULL_ARG2_BUG + +/* Define if the mbrtowc function does not return 0 for a NUL character. */ +#undef MBRTOWC_NUL_RETVAL_BUG + +/* Define if the mbrtowc function returns a wrong return value. */ +#undef MBRTOWC_RETVAL_BUG + +/* Use GNU style printf and scanf. */ +#ifndef __USE_MINGW_ANSI_STDIO +# undef __USE_MINGW_ANSI_STDIO +#endif + + +/* Define if the compilation of mktime.c should define 'mktime_internal'. */ +#undef NEED_MKTIME_INTERNAL + +/* Define if the compilation of mktime.c should define 'mktime' with the + native Windows TZ workaround. */ +#undef NEED_MKTIME_WINDOWS + +/* Define if the compilation of mktime.c should define 'mktime' with the + algorithmic workarounds. */ +#undef NEED_MKTIME_WORKING + +/* Define to 1 if open() fails to recognize a trailing slash. */ +#undef OPEN_TRAILING_SLASH_BUG + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* String identifying the packager of this software */ +#undef PACKAGE_PACKAGER + +/* Packager info for bug reports (URL/e-mail/...) */ +#undef PACKAGE_PACKAGER_BUG_REPORTS + +/* Packager-specific version information */ +#undef PACKAGE_PACKAGER_VERSION + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define if <inttypes.h> exists and defines unusable PRI* macros. */ +#undef PRI_MACROS_BROKEN + +/* Define to the type that is the result of default argument promotions of + type mode_t. */ +#undef PROMOTED_MODE_T + +/* Name of "pr" program. */ +#undef PR_PROGRAM + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'ptrdiff_t'. */ +#undef PTRDIFF_T_SUFFIX + +/* Define to 1 if readlink fails to recognize a trailing slash. */ +#undef READLINK_TRAILING_SLASH_BUG + +/* Define to 1 if stat needs help when passed a file name with a trailing + slash */ +#undef REPLACE_FUNC_STAT_FILE + +/* Define if nl_langinfo exists but is overridden by gnulib. */ +#undef REPLACE_NL_LANGINFO + +/* Define to 1 if strerror(0) does not return a message implying success. */ +#undef REPLACE_STRERROR_0 + +/* Define if vasnprintf exists but is overridden by gnulib. */ +#undef REPLACE_VASNPRINTF + +/* Define if sigaltstack() interprets the stack_t.ss_sp field incorrectly, as + the highest address of the alternate stack range rather than as the lowest + address. */ +#undef SIGALTSTACK_SS_REVERSED + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'sig_atomic_t'. */ +#undef SIG_ATOMIC_T_SUFFIX + +/* Define as the maximum value of type 'size_t', if the system doesn't define + it. */ +#ifndef SIZE_MAX +# undef SIZE_MAX +#endif + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'size_t'. */ +#undef SIZE_T_SUFFIX + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define to 1 if the 'S_IS*' macros in <sys/stat.h> do not work properly. */ +#undef STAT_MACROS_BROKEN + +/* Define to 1 if all of the C89 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#undef STDC_HEADERS + +/* Define to 1 if strerror_r returns char *. */ +#undef STRERROR_R_CHAR_P + +/* Define to 1 if time_t is signed. */ +#undef TIME_T_IS_SIGNED + +/* Define to 1 if your <sys/time.h> declares 'struct tm'. */ +#undef TM_IN_SYS_TIME + +/* Define to 1 if the type of the st_atim member of a struct stat is struct + timespec. */ +#undef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC + +/* Define if tzset clobbers localtime's static buffer. */ +#undef TZSET_CLOBBERS_LOCALTIME + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable general extensions on macOS. */ +#ifndef _DARWIN_C_SOURCE +# undef _DARWIN_C_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# undef __STDC_WANT_IEC_60559_BFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# undef __STDC_WANT_IEC_60559_DFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# undef __STDC_WANT_IEC_60559_TYPES_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# undef __STDC_WANT_LIB_EXT2__ +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# undef __STDC_WANT_MATH_SPEC_FUNCS__ +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable X/Open extensions if necessary. HP-UX 11.11 defines + mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of + whether compiling with -Ae or -D_HPUX_SOURCE=1. */ +#ifndef _XOPEN_SOURCE +# undef _XOPEN_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + +/* Define to 1 if you want getc etc. to use unlocked I/O if available. + Unlocked I/O can improve performance in unithreaded apps, but it is not + safe for multithreaded apps. */ +#undef USE_UNLOCKED_IO + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if unsetenv returns void instead of int. */ +#undef VOID_UNSETENV + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'wchar_t'. */ +#undef WCHAR_T_SUFFIX + +/* Define if WSAStartup is needed. */ +#undef WINDOWS_SOCKETS + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'wint_t'. */ +#undef WINT_T_SUFFIX + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* enable compile-time and run-time bounds-checking, and some warnings */ +#undef _FORTIFY_SOURCE + +/* Define to 1 on platforms where this makes off_t a 64-bit type. */ +#undef _LARGE_FILES + +/* Define to 1 on Solaris. */ +#undef _LCONV_C99 + +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 1 to make NetBSD features available. MINIX 3 needs this. */ +#undef _NETBSD_SOURCE + +/* The _Noreturn keyword of C11. */ +#if ! (defined _Noreturn \ + || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) +# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ + || 0x5110 <= __SUNPRO_C) +# define _Noreturn __attribute__ ((__noreturn__)) +# elif defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn +# endif +#endif + + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 in order to get the POSIX compatible declarations of socket + functions. */ +#undef _POSIX_PII_SOCKET + +/* Define to 1 if you need to in order for 'stat' and other things to work. */ +#undef _POSIX_SOURCE + +/* Define if you want <regex.h> to include <limits.h>, so that it consistently + overrides <limits.h>'s RE_DUP_MAX. */ +#undef _REGEX_INCLUDE_LIMITS_H + +/* Define if you want regoff_t to be at least as wide POSIX requires. */ +#undef _REGEX_LARGE_OFFSETS + +/* Number of bits in time_t, on hosts where this is settable. */ +#undef _TIME_BITS + +/* Define to rpl_ if the getopt replacement functions and variables should be + used. */ +#undef __GETOPT_PREFIX + +/* Define to 1 on platforms where this makes time_t a 64-bit type. */ +#undef __MINGW_USE_VC2005_COMPAT + +/* Define to 1 if the system <stdint.h> predates C++11. */ +#undef __STDC_CONSTANT_MACROS + +/* Define to 1 if the system <stdint.h> predates C++11. */ +#undef __STDC_LIMIT_MACROS + +/* Define to 1 if C does not support variable-length arrays, and if the + compiler does not already define this. */ +#undef __STDC_NO_VLA__ + +/* Please see the Gnulib manual for how to use these macros. + + Suppress extern inline with HP-UX cc, as it appears to be broken; see + <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>. + + Suppress extern inline with Sun C in standards-conformance mode, as it + mishandles inline functions that call each other. E.g., for 'inline void f + (void) { } inline void g (void) { f (); }', c99 incorrectly complains + 'reference to static identifier "f" in extern inline function'. + This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. + + Suppress extern inline (with or without __attribute__ ((__gnu_inline__))) + on configurations that mistakenly use 'static inline' to implement + functions or macros in standard C headers like <ctype.h>. For example, + if isdigit is mistakenly implemented via a static inline function, + a program containing an extern inline function that calls isdigit + may not work since the C standard prohibits extern inline functions + from calling static functions. This bug is known to occur on: + + OS X 10.8 and earlier; see: + http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html + + DragonFly; see + http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log + + FreeBSD; see: + http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html + + OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and + for clang but remains for g++; see <http://trac.macports.org/ticket/41033>. + Assume DragonFly and FreeBSD will be similar. */ +#if (((defined __APPLE__ && defined __MACH__) \ + || defined __DragonFly__ || defined __FreeBSD__) \ + && (defined __header_inline \ + ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \ + && ! defined __clang__) \ + : ((! defined _DONT_USE_CTYPE_INLINE_ \ + && (defined __GNUC__ || defined __cplusplus)) \ + || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \ + && defined __GNUC__ && ! defined __cplusplus)))) +# define _GL_EXTERN_INLINE_STDHEADER_BUG +#endif +#if ((__GNUC__ \ + ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ + : (199901L <= __STDC_VERSION__ \ + && !defined __HP_cc \ + && !defined __PGI \ + && !(defined __SUNPRO_C && __STDC__))) \ + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) +# define _GL_INLINE inline +# define _GL_EXTERN_INLINE extern inline +# define _GL_EXTERN_INLINE_IN_USE +#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \ + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) +# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__ + /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ +# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) +# else +# define _GL_INLINE extern inline +# endif +# define _GL_EXTERN_INLINE extern +# define _GL_EXTERN_INLINE_IN_USE +#else +# define _GL_INLINE static _GL_UNUSED +# define _GL_EXTERN_INLINE static _GL_UNUSED +#endif + +/* In GCC 4.6 (inclusive) to 5.1 (exclusive), + suppress bogus "no previous prototype for 'FOO'" + and "no previous declaration for 'FOO'" diagnostics, + when FOO is an inline function in the header; see + <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and + <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>. */ +#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__ +# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ +# define _GL_INLINE_HEADER_CONST_PRAGMA +# else +# define _GL_INLINE_HEADER_CONST_PRAGMA \ + _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") +# endif +# define _GL_INLINE_HEADER_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \ + _GL_INLINE_HEADER_CONST_PRAGMA +# define _GL_INLINE_HEADER_END \ + _Pragma ("GCC diagnostic pop") +#else +# define _GL_INLINE_HEADER_BEGIN +# define _GL_INLINE_HEADER_END +#endif + +/* Define to a replacement function name for fnmatch(). */ +#undef fnmatch + +/* Define as 'int' if <sys/types.h> doesn't define. */ +#undef gid_t + +/* A replacement for va_copy, if needed. */ +#define gl_va_copy(a,b) ((a) = (b)) + +/* Define to '__inline__' or '__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to long or long long if <stdint.h> and <inttypes.h> don't define. */ +#undef intmax_t + +/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports + the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of + earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. + __APPLE__ && __MACH__ test for Mac OS X. + __APPLE_CC__ tests for the Apple compiler and its version. + __STDC_VERSION__ tests for the C99 mode. */ +#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ +# define __GNUC_STDC_INLINE__ 1 +#endif + +/* Define to 1 if the compiler is checking for lint. */ +#undef lint + +/* Define to a type if <wchar.h> does not define. */ +#undef mbstate_t + +/* Define to the real name of the mktime_internal function. */ +#undef mktime_internal + +/* Define to 'int' if <sys/types.h> does not define. */ +#undef mode_t + +/* Define to the name of the strftime replacement function. */ +#undef my_strftime + +/* Define to the type of st_nlink in struct stat, or a supertype. */ +#undef nlink_t + +/* Define to 'long int' if <sys/types.h> does not define. */ +#undef off_t + +/* Define as a signed integer type capable of holding a process identifier. */ +#undef pid_t + +/* Define as the type of the result of subtracting two pointers, if the system + doesn't define it. */ +#undef ptrdiff_t + +/* Define to rpl_re_comp if the replacement should be used. */ +#undef re_comp + +/* Define to rpl_re_compile_fastmap if the replacement should be used. */ +#undef re_compile_fastmap + +/* Define to rpl_re_compile_pattern if the replacement should be used. */ +#undef re_compile_pattern + +/* Define to rpl_re_exec if the replacement should be used. */ +#undef re_exec + +/* Define to rpl_re_match if the replacement should be used. */ +#undef re_match + +/* Define to rpl_re_match_2 if the replacement should be used. */ +#undef re_match_2 + +/* Define to rpl_re_search if the replacement should be used. */ +#undef re_search + +/* Define to rpl_re_search_2 if the replacement should be used. */ +#undef re_search_2 + +/* Define to rpl_re_set_registers if the replacement should be used. */ +#undef re_set_registers + +/* Define to rpl_re_set_syntax if the replacement should be used. */ +#undef re_set_syntax + +/* Define to rpl_re_syntax_options if the replacement should be used. */ +#undef re_syntax_options + +/* Define to rpl_regcomp if the replacement should be used. */ +#undef regcomp + +/* Define to rpl_regerror if the replacement should be used. */ +#undef regerror + +/* Define to rpl_regexec if the replacement should be used. */ +#undef regexec + +/* Define to rpl_regfree if the replacement should be used. */ +#undef regfree + +/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#undef restrict +/* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the + previous line. Perhaps some future version of Sun C++ will work with + restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +# define _Restrict +# define __restrict__ +#endif + +/* Define as 'unsigned int' if <stddef.h> doesn't define. */ +#undef size_t + +/* type to use in place of socklen_t if not defined */ +#undef socklen_t + +/* Define as a signed type of the same size as size_t. */ +#undef ssize_t + +/* Define as 'int' if <sys/types.h> doesn't define. */ +#undef uid_t + +/* Define as a marker that can be attached to declarations that might not + be used. This helps to reduce warnings, such as from + GCC -Wunused-parameter. */ +#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _GL_UNUSED __attribute__ ((__unused__)) +#else +# define _GL_UNUSED +#endif +/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name + is a misnomer outside of parameter lists. */ +#define _UNUSED_PARAMETER_ _GL_UNUSED + +/* gcc supports the "unused" attribute on possibly unused labels, and + g++ has since version 4.5. Note to support C++ as well as C, + _GL_UNUSED_LABEL should be used with a trailing ; */ +#if !defined __cplusplus || __GNUC__ > 4 \ + || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# define _GL_UNUSED_LABEL _GL_UNUSED +#else +# define _GL_UNUSED_LABEL +#endif + +/* The __pure__ attribute was added in gcc 2.96. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE /* empty */ +#endif + +/* The __const__ attribute was added in gcc 2.95. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) +#else +# define _GL_ATTRIBUTE_CONST /* empty */ +#endif + + +/* Define as a macro for copying va_list variables. */ +#undef va_copy + +/* Define as 'fork' if 'vfork' does not work. */ +#undef vfork diff --git a/local/recipes/tools/diffutils/source/lib/config.hin~ b/local/recipes/tools/diffutils/source/lib/config.hin~ new file mode 100644 index 0000000000..e28f15d1ec --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/config.hin~ @@ -0,0 +1,2341 @@ +/* lib/config.hin. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* Define to the number of bits in type 'ptrdiff_t'. */ +#undef BITSIZEOF_PTRDIFF_T + +/* Define to the number of bits in type 'sig_atomic_t'. */ +#undef BITSIZEOF_SIG_ATOMIC_T + +/* Define to the number of bits in type 'size_t'. */ +#undef BITSIZEOF_SIZE_T + +/* Define to the number of bits in type 'wchar_t'. */ +#undef BITSIZEOF_WCHAR_T + +/* Define to the number of bits in type 'wint_t'. */ +#undef BITSIZEOF_WINT_T + +/* Define to 1 if the `closedir' function returns void instead of `int'. */ +#undef CLOSEDIR_VOID + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#undef CRAY_STACKSEG_END + +/* Define to 1 if using `alloca.c'. */ +#undef C_ALLOCA + +/* Define to 1 if the C locale may have encoding errors. */ +#undef C_LOCALE_MAYBE_EILSEQ + +/* Define as the bit index in the word where to find bit 0 of the exponent of + 'double'. */ +#undef DBL_EXPBIT0_BIT + +/* Define as the word index where to find the exponent of 'double'. */ +#undef DBL_EXPBIT0_WORD + +/* Name of editor program, unless overridden. */ +#undef DEFAULT_EDITOR_PROGRAM + +/* Define to 1 if // is a file system root distinct from /. */ +#undef DOUBLE_SLASH_IS_DISTINCT_ROOT + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#undef ENABLE_NLS + +/* Define to 1 if an invalid memory address access may yield a SIGBUS. */ +#undef FAULT_YIELDS_SIGBUS + +/* Define this to 1 if F_DUPFD behavior does not match POSIX */ +#undef FCNTL_DUPFD_BUGGY + +/* Define to nothing if C supports flexible array members, and to 1 if it does + not. That way, with a declaration like 'struct s { int n; double + d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99 + compilers. When computing the size of such an object, don't use 'sizeof + (struct s)' as it overestimates the size. Use 'offsetof (struct s, d)' + instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with + MSVC and with C++ compilers. */ +#undef FLEXIBLE_ARRAY_MEMBER + +/* Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string. */ +#undef FUNC_NL_LANGINFO_YESEXPR_WORKS + +/* Define if gettimeofday clobbers the localtime buffer. */ +#undef GETTIMEOFDAY_CLOBBERS_LOCALTIME + +/* Define this to 'void' or 'struct timezone' to match the system's + declaration of the second argument to gettimeofday. */ +#undef GETTIMEOFDAY_TIMEZONE + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module dirname shall be considered present. */ +#undef GNULIB_DIRNAME + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module filenamecat shall be considered present. */ +#undef GNULIB_FILENAMECAT + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module freopen-safer shall be considered present. */ +#undef GNULIB_FREOPEN_SAFER + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module fscanf shall be considered present. */ +#undef GNULIB_FSCANF + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module msvc-nothrow shall be considered present. */ +#undef GNULIB_MSVC_NOTHROW + +/* enable some gnulib portability checks */ +#undef GNULIB_PORTCHECK + +/* Define to 1 if printf and friends should be labeled with attribute + "__gnu_printf__" instead of "__printf__" */ +#undef GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module scanf shall be considered present. */ +#undef GNULIB_SCANF + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module snprintf shall be considered present. */ +#undef GNULIB_SNPRINTF + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module strerror shall be considered present. */ +#undef GNULIB_STRERROR + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module strerror_r-posix shall be considered present. */ +#undef GNULIB_STRERROR_R_POSIX + +/* Define to 1 when the gnulib module accept should be tested. */ +#undef GNULIB_TEST_ACCEPT + +/* Define to 1 when the gnulib module bind should be tested. */ +#undef GNULIB_TEST_BIND + +/* Define to 1 when the gnulib module btowc should be tested. */ +#undef GNULIB_TEST_BTOWC + +/* Define to 1 when the gnulib module close should be tested. */ +#undef GNULIB_TEST_CLOSE + +/* Define to 1 when the gnulib module connect should be tested. */ +#undef GNULIB_TEST_CONNECT + +/* Define to 1 when the gnulib module dup2 should be tested. */ +#undef GNULIB_TEST_DUP2 + +/* Define to 1 when the gnulib module environ should be tested. */ +#undef GNULIB_TEST_ENVIRON + +/* Define to 1 when the gnulib module fcntl should be tested. */ +#undef GNULIB_TEST_FCNTL + +/* Define to 1 when the gnulib module fdopen should be tested. */ +#undef GNULIB_TEST_FDOPEN + +/* Define to 1 when the gnulib module freopen should be tested. */ +#undef GNULIB_TEST_FREOPEN + +/* Define to 1 when the gnulib module fstat should be tested. */ +#undef GNULIB_TEST_FSTAT + +/* Define to 1 when the gnulib module ftruncate should be tested. */ +#undef GNULIB_TEST_FTRUNCATE + +/* Define to 1 when the gnulib module getcwd should be tested. */ +#undef GNULIB_TEST_GETCWD + +/* Define to 1 when the gnulib module getdtablesize should be tested. */ +#undef GNULIB_TEST_GETDTABLESIZE + +/* Define to 1 when the gnulib module getpagesize should be tested. */ +#undef GNULIB_TEST_GETPAGESIZE + +/* Define to 1 when the gnulib module gettimeofday should be tested. */ +#undef GNULIB_TEST_GETTIMEOFDAY + +/* Define to 1 when the gnulib module ioctl should be tested. */ +#undef GNULIB_TEST_IOCTL + +/* Define to 1 when the gnulib module iswblank should be tested. */ +#undef GNULIB_TEST_ISWBLANK + +/* Define to 1 when the gnulib module listen should be tested. */ +#undef GNULIB_TEST_LISTEN + +/* Define to 1 when the gnulib module localeconv should be tested. */ +#undef GNULIB_TEST_LOCALECONV + +/* Define to 1 when the gnulib module lstat should be tested. */ +#undef GNULIB_TEST_LSTAT + +/* Define to 1 when the gnulib module malloc-posix should be tested. */ +#undef GNULIB_TEST_MALLOC_POSIX + +/* Define to 1 when the gnulib module mbrtowc should be tested. */ +#undef GNULIB_TEST_MBRTOWC + +/* Define to 1 when the gnulib module mbscasecmp should be tested. */ +#undef GNULIB_TEST_MBSCASECMP + +/* Define to 1 when the gnulib module mbsinit should be tested. */ +#undef GNULIB_TEST_MBSINIT + +/* Define to 1 when the gnulib module mbslen should be tested. */ +#undef GNULIB_TEST_MBSLEN + +/* Define to 1 when the gnulib module mbsrtowcs should be tested. */ +#undef GNULIB_TEST_MBSRTOWCS + +/* Define to 1 when the gnulib module mbsstr should be tested. */ +#undef GNULIB_TEST_MBSSTR + +/* Define to 1 when the gnulib module mbtowc should be tested. */ +#undef GNULIB_TEST_MBTOWC + +/* Define to 1 when the gnulib module memchr should be tested. */ +#undef GNULIB_TEST_MEMCHR + +/* Define to 1 when the gnulib module mkstemp should be tested. */ +#undef GNULIB_TEST_MKSTEMP + +/* Define to 1 when the gnulib module mktime should be tested. */ +#undef GNULIB_TEST_MKTIME + +/* Define to 1 when the gnulib module nanosleep should be tested. */ +#undef GNULIB_TEST_NANOSLEEP + +/* Define to 1 when the gnulib module nl_langinfo should be tested. */ +#undef GNULIB_TEST_NL_LANGINFO + +/* Define to 1 when the gnulib module open should be tested. */ +#undef GNULIB_TEST_OPEN + +/* Define to 1 when the gnulib module perror should be tested. */ +#undef GNULIB_TEST_PERROR + +/* Define to 1 when the gnulib module pipe should be tested. */ +#undef GNULIB_TEST_PIPE + +/* Define to 1 when the gnulib module putenv should be tested. */ +#undef GNULIB_TEST_PUTENV + +/* Define to 1 when the gnulib module raise should be tested. */ +#undef GNULIB_TEST_RAISE + +/* Define to 1 when the gnulib module rawmemchr should be tested. */ +#undef GNULIB_TEST_RAWMEMCHR + +/* Define to 1 when the gnulib module readlink should be tested. */ +#undef GNULIB_TEST_READLINK + +/* Define to 1 when the gnulib module secure_getenv should be tested. */ +#undef GNULIB_TEST_SECURE_GETENV + +/* Define to 1 when the gnulib module select should be tested. */ +#undef GNULIB_TEST_SELECT + +/* Define to 1 when the gnulib module setenv should be tested. */ +#undef GNULIB_TEST_SETENV + +/* Define to 1 when the gnulib module setlocale should be tested. */ +#undef GNULIB_TEST_SETLOCALE + +/* Define to 1 when the gnulib module setsockopt should be tested. */ +#undef GNULIB_TEST_SETSOCKOPT + +/* Define to 1 when the gnulib module sigaction should be tested. */ +#undef GNULIB_TEST_SIGACTION + +/* Define to 1 when the gnulib module sigprocmask should be tested. */ +#undef GNULIB_TEST_SIGPROCMASK + +/* Define to 1 when the gnulib module sleep should be tested. */ +#undef GNULIB_TEST_SLEEP + +/* Define to 1 when the gnulib module snprintf should be tested. */ +#undef GNULIB_TEST_SNPRINTF + +/* Define to 1 when the gnulib module socket should be tested. */ +#undef GNULIB_TEST_SOCKET + +/* Define to 1 when the gnulib module stat should be tested. */ +#undef GNULIB_TEST_STAT + +/* Define to 1 when the gnulib module strerror should be tested. */ +#undef GNULIB_TEST_STRERROR + +/* Define to 1 when the gnulib module strerror_r should be tested. */ +#undef GNULIB_TEST_STRERROR_R + +/* Define to 1 when the gnulib module strndup should be tested. */ +#undef GNULIB_TEST_STRNDUP + +/* Define to 1 when the gnulib module strnlen should be tested. */ +#undef GNULIB_TEST_STRNLEN + +/* Define to 1 when the gnulib module strptime should be tested. */ +#undef GNULIB_TEST_STRPTIME + +/* Define to 1 when the gnulib module strtoull should be tested. */ +#undef GNULIB_TEST_STRTOULL + +/* Define to 1 when the gnulib module symlink should be tested. */ +#undef GNULIB_TEST_SYMLINK + +/* Define to 1 when the gnulib module timegm should be tested. */ +#undef GNULIB_TEST_TIMEGM + +/* Define to 1 when the gnulib module time_r should be tested. */ +#undef GNULIB_TEST_TIME_R + +/* Define to 1 when the gnulib module time_rz should be tested. */ +#undef GNULIB_TEST_TIME_RZ + +/* Define to 1 when the gnulib module tzset should be tested. */ +#undef GNULIB_TEST_TZSET + +/* Define to 1 when the gnulib module unsetenv should be tested. */ +#undef GNULIB_TEST_UNSETENV + +/* Define to 1 when the gnulib module vasprintf should be tested. */ +#undef GNULIB_TEST_VASPRINTF + +/* Define to 1 when the gnulib module wcrtomb should be tested. */ +#undef GNULIB_TEST_WCRTOMB + +/* Define to 1 when the gnulib module wctob should be tested. */ +#undef GNULIB_TEST_WCTOB + +/* Define to 1 when the gnulib module wctomb should be tested. */ +#undef GNULIB_TEST_WCTOMB + +/* Define to 1 when the gnulib module wcwidth should be tested. */ +#undef GNULIB_TEST_WCWIDTH + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module unistr/u8-mbtoucr shall be considered present. */ +#undef GNULIB_UNISTR_U8_MBTOUCR + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module unistr/u8-uctomb shall be considered present. */ +#undef GNULIB_UNISTR_U8_UCTOMB + +/* Define to 1 if you have 'alloca' after including <alloca.h>, a header that + may be supplied by this distribution. */ +#undef HAVE_ALLOCA + +/* Define to 1 if <alloca.h> works. */ +#undef HAVE_ALLOCA_H + +/* Define to 1 if you have the <arpa/inet.h> header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if you have the <bp-sym.h> header file. */ +#undef HAVE_BP_SYM_H + +/* Define to 1 if you have the `btowc' function. */ +#undef HAVE_BTOWC + +/* Define to 1 if nanosleep mishandles large arguments. */ +#undef HAVE_BUG_BIG_NANOSLEEP + +/* Define to 1 if you have the `catgets' function. */ +#undef HAVE_CATGETS + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +#undef HAVE_CFLOCALECOPYCURRENT + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +#undef HAVE_CFPREFERENCESCOPYAPPVALUE + +/* Define to 1 if you have the `chsize' function. */ +#undef HAVE_CHSIZE + +/* Define to 1 if you have the `clock_gettime' function. */ +#undef HAVE_CLOCK_GETTIME + +/* Define to 1 if you have the `clock_settime' function. */ +#undef HAVE_CLOCK_SETTIME + +/* Define to 1 if you have the <crtdefs.h> header file. */ +#undef HAVE_CRTDEFS_H + +/* Define to 1 if C supports variable-length arrays. */ +#undef HAVE_C_VARARRAYS + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#undef HAVE_DCGETTEXT + +/* Define to 1 if you have the declaration of `alarm', and to 0 if you don't. + */ +#undef HAVE_DECL_ALARM + +/* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_CLEARERR_UNLOCKED + +/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you + don't. */ +#undef HAVE_DECL_FEOF_UNLOCKED + +/* Define to 1 if you have the declaration of `ferror_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FERROR_UNLOCKED + +/* Define to 1 if you have the declaration of `fflush_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FFLUSH_UNLOCKED + +/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FGETS_UNLOCKED + +/* Define to 1 if you have the declaration of `fputc_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FPUTC_UNLOCKED + +/* Define to 1 if you have the declaration of `fputs_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FPUTS_UNLOCKED + +/* Define to 1 if you have the declaration of `fread_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FREAD_UNLOCKED + +/* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FWRITE_UNLOCKED + +/* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_GETCHAR_UNLOCKED + +/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you + don't. */ +#undef HAVE_DECL_GETC_UNLOCKED + +/* Define to 1 if you have the declaration of `getdtablesize', and to 0 if you + don't. */ +#undef HAVE_DECL_GETDTABLESIZE + +/* Define to 1 if you have the declaration of `inet_pton', and to 0 if you + don't. */ +#undef HAVE_DECL_INET_PTON + +/* Define to 1 if you have the declaration of `isblank', and to 0 if you + don't. */ +#undef HAVE_DECL_ISBLANK + +/* Define to 1 if you have the declaration of `iswblank', and to 0 if you + don't. */ +#undef HAVE_DECL_ISWBLANK + +/* Define to 1 if you have the declaration of `localtime_r', and to 0 if you + don't. */ +#undef HAVE_DECL_LOCALTIME_R + +/* Define to 1 if you have the declaration of `mbrtowc', and to 0 if you + don't. */ +#undef HAVE_DECL_MBRTOWC + +/* Define to 1 if you have the declaration of `mbsinit', and to 0 if you + don't. */ +#undef HAVE_DECL_MBSINIT + +/* Define to 1 if you have the declaration of `mbsrtowcs', and to 0 if you + don't. */ +#undef HAVE_DECL_MBSRTOWCS + +/* Define to 1 if you have the declaration of `program_invocation_name', and + to 0 if you don't. */ +#undef HAVE_DECL_PROGRAM_INVOCATION_NAME + +/* Define to 1 if you have the declaration of `program_invocation_short_name', + and to 0 if you don't. */ +#undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME + +/* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_PUTCHAR_UNLOCKED + +/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you + don't. */ +#undef HAVE_DECL_PUTC_UNLOCKED + +/* Define to 1 if you have the declaration of `setenv', and to 0 if you don't. + */ +#undef HAVE_DECL_SETENV + +/* Define to 1 if you have the declaration of `sigaltstack', and to 0 if you + don't. */ +#undef HAVE_DECL_SIGALTSTACK + +/* Define to 1 if you have the declaration of `sleep', and to 0 if you don't. + */ +#undef HAVE_DECL_SLEEP + +/* Define to 1 if you have the declaration of `snprintf', and to 0 if you + don't. */ +#undef HAVE_DECL_SNPRINTF + +/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you + don't. */ +#undef HAVE_DECL_STRERROR_R + +/* Define to 1 if you have the declaration of `strncasecmp', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNCASECMP + +/* Define to 1 if you have the declaration of `strndup', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNDUP + +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNLEN + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#undef HAVE_DECL_STRTOULL + +/* Define to 1 if you have the declaration of `strtoumax', and to 0 if you + don't. */ +#undef HAVE_DECL_STRTOUMAX + +/* Define to 1 if you have the declaration of `towlower', and to 0 if you + don't. */ +#undef HAVE_DECL_TOWLOWER + +/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. + */ +#undef HAVE_DECL_TZNAME + +/* Define to 1 if you have the declaration of `unsetenv', and to 0 if you + don't. */ +#undef HAVE_DECL_UNSETENV + +/* Define to 1 if you have the declaration of `wcrtomb', and to 0 if you + don't. */ +#undef HAVE_DECL_WCRTOMB + +/* Define to 1 if you have the declaration of `wctob', and to 0 if you don't. + */ +#undef HAVE_DECL_WCTOB + +/* Define to 1 if you have the declaration of `wcwidth', and to 0 if you + don't. */ +#undef HAVE_DECL_WCWIDTH + +/* Define to 1 if you have the declaration of `_putenv', and to 0 if you + don't. */ +#undef HAVE_DECL__PUTENV + +/* Define to 1 if you have the declaration of `_snprintf', and to 0 if you + don't. */ +#undef HAVE_DECL__SNPRINTF + +/* Define to 1 if you have the declaration of `__argv', and to 0 if you don't. + */ +#undef HAVE_DECL___ARGV + +/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the 'dup2' function. */ +#undef HAVE_DUP2 + +/* Define if you have the declaration of environ. */ +#undef HAVE_ENVIRON_DECL + +/* Define to 1 if you have the `fcntl' function. */ +#undef HAVE_FCNTL + +/* Define to 1 if you have the <features.h> header file. */ +#undef HAVE_FEATURES_H + +/* Define to 1 if you have the `fork' function. */ +#undef HAVE_FORK + +/* Define to 1 if you have the `ftruncate' function. */ +#undef HAVE_FTRUNCATE + +/* Define to 1 if you have the `getdtablesize' function. */ +#undef HAVE_GETDTABLESIZE + +/* Define to 1 if you have the `getegid' function. */ +#undef HAVE_GETEGID + +/* Define to 1 if you have the `geteuid' function. */ +#undef HAVE_GETEUID + +/* Define to 1 if you have the `getexecname' function. */ +#undef HAVE_GETEXECNAME + +/* Define to 1 if you have the `getgid' function. */ +#undef HAVE_GETGID + +/* Define to 1 if you have the <getopt.h> header file. */ +#undef HAVE_GETOPT_H + +/* Define to 1 if you have the `getopt_long_only' function. */ +#undef HAVE_GETOPT_LONG_ONLY + +/* Define to 1 if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE + +/* Define to 1 if you have the `getprogname' function. */ +#undef HAVE_GETPROGNAME + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the `getuid' function. */ +#undef HAVE_GETUID + +/* Define if you have the iconv() function and it works. */ +#undef HAVE_ICONV + +/* Define to 1 if you have the <iconv.h> header file. */ +#undef HAVE_ICONV_H + +/* Define to 1 if you have the `inet_pton' function. */ +#undef HAVE_INET_PTON + +/* Define to 1 if the compiler supports one of the keywords 'inline', + '__inline__', '__inline' and effectively inlines functions marked as such. + */ +#undef HAVE_INLINE + +/* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */ +#undef HAVE_INTMAX_T + +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H + +/* Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and + declares uintmax_t. */ +#undef HAVE_INTTYPES_H_WITH_UINTMAX + +/* Define to 1 if you have the `ioctl' function. */ +#undef HAVE_IOCTL + +/* Define to 1 if <sys/socket.h> defines AF_INET. */ +#undef HAVE_IPV4 + +/* Define to 1 if <sys/socket.h> defines AF_INET6. */ +#undef HAVE_IPV6 + +/* Define to 1 if you have the `isblank' function. */ +#undef HAVE_ISBLANK + +/* Define to 1 if you have the `issetugid' function. */ +#undef HAVE_ISSETUGID + +/* Define to 1 if you have the `iswblank' function. */ +#undef HAVE_ISWBLANK + +/* Define to 1 if you have the `iswcntrl' function. */ +#undef HAVE_ISWCNTRL + +/* Define to 1 if you have the `iswctype' function. */ +#undef HAVE_ISWCTYPE + +/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */ +#undef HAVE_LANGINFO_CODESET + +/* Define to 1 if you have the <langinfo.h> header file. */ +#undef HAVE_LANGINFO_H + +/* Define to 1 if you have the <libintl.h> header file. */ +#undef HAVE_LIBINTL_H + +/* Define if you have the libsigsegv library. */ +#undef HAVE_LIBSIGSEGV + +/* Define to 1 if you have the <limits.h> header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the `localtime_r' function. */ +#undef HAVE_LOCALTIME_R + +/* Define to 1 if the system has the type 'long long int'. */ +#undef HAVE_LONG_LONG_INT + +/* Define to 1 if you have the `lstat' function. */ +#undef HAVE_LSTAT + +/* Define to 1 if you have the <malloc.h> header file. */ +#undef HAVE_MALLOC_H + +/* Define if the 'malloc' function is POSIX compliant. */ +#undef HAVE_MALLOC_POSIX + +/* Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including + config.h and <sys/mman.h>. */ +#undef HAVE_MAP_ANONYMOUS + +/* Define to 1 if you have the `mbrtowc' function. */ +#undef HAVE_MBRTOWC + +/* Define to 1 if you have the `mbsinit' function. */ +#undef HAVE_MBSINIT + +/* Define to 1 if you have the `mbslen' function. */ +#undef HAVE_MBSLEN + +/* Define to 1 if you have the `mbsrtowcs' function. */ +#undef HAVE_MBSRTOWCS + +/* Define to 1 if <wchar.h> declares mbstate_t. */ +#undef HAVE_MBSTATE_T + +/* Define to 1 if you have the `mempcpy' function. */ +#undef HAVE_MEMPCPY + +/* Define to 1 if <limits.h> defines the MIN and MAX macros. */ +#undef HAVE_MINMAX_IN_LIMITS_H + +/* Define to 1 if <sys/param.h> defines the MIN and MAX macros. */ +#undef HAVE_MINMAX_IN_SYS_PARAM_H + +/* Define to 1 if you have the `mkstemp' function. */ +#undef HAVE_MKSTEMP + +/* Define to 1 if you have the `mprotect' function. */ +#undef HAVE_MPROTECT + +/* Define to 1 on MSVC platforms that have the "invalid parameter handler" + concept. */ +#undef HAVE_MSVC_INVALID_PARAMETER_HANDLER + +/* Define to 1 if you have the `nanotime' function. */ +#undef HAVE_NANOTIME + +/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have the <netdb.h> header file. */ +#undef HAVE_NETDB_H + +/* Define to 1 if you have the <netinet/in.h> header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the `newlocale' function. */ +#undef HAVE_NEWLOCALE + +/* Define to 1 if you have the `nl_langinfo' function. */ +#undef HAVE_NL_LANGINFO + +/* Define to 1 if you have the <OS.h> header file. */ +#undef HAVE_OS_H + +/* Define to 1 if you have the `pipe' function. */ +#undef HAVE_PIPE + +/* Define to 1 if you have the `raise' function. */ +#undef HAVE_RAISE + +/* Define to 1 if you have the `rawmemchr' function. */ +#undef HAVE_RAWMEMCHR + +/* Define to 1 if accept is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ACCEPT + +/* Define to 1 if accept4 is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ACCEPT4 + +/* Define to 1 if atoll is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ATOLL + +/* Define to 1 if bind is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_BIND + +/* Define to 1 if btowc is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_BTOWC + +/* Define to 1 if canonicalize_file_name is declared even after undefining + macros. */ +#undef HAVE_RAW_DECL_CANONICALIZE_FILE_NAME + +/* Define to 1 if chdir is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_CHDIR + +/* Define to 1 if chown is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_CHOWN + +/* Define to 1 if connect is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_CONNECT + +/* Define to 1 if dprintf is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_DPRINTF + +/* Define to 1 if dup is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_DUP + +/* Define to 1 if dup2 is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_DUP2 + +/* Define to 1 if dup3 is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_DUP3 + +/* Define to 1 if duplocale is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_DUPLOCALE + +/* Define to 1 if endusershell is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ENDUSERSHELL + +/* Define to 1 if environ is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ENVIRON + +/* Define to 1 if euidaccess is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_EUIDACCESS + +/* Define to 1 if faccessat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FACCESSAT + +/* Define to 1 if fchdir is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FCHDIR + +/* Define to 1 if fchmodat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FCHMODAT + +/* Define to 1 if fchownat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FCHOWNAT + +/* Define to 1 if fcntl is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FCNTL + +/* Define to 1 if fdatasync is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FDATASYNC + +/* Define to 1 if ffs is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FFS + +/* Define to 1 if ffsl is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FFSL + +/* Define to 1 if ffsll is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FFSLL + +/* Define to 1 if fpurge is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FPURGE + +/* Define to 1 if fseeko is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FSEEKO + +/* Define to 1 if fstat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FSTAT + +/* Define to 1 if fstatat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FSTATAT + +/* Define to 1 if fsync is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FSYNC + +/* Define to 1 if ftello is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FTELLO + +/* Define to 1 if ftruncate is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FTRUNCATE + +/* Define to 1 if futimens is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FUTIMENS + +/* Define to 1 if getcwd is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETCWD + +/* Define to 1 if getdelim is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETDELIM + +/* Define to 1 if getdomainname is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETDOMAINNAME + +/* Define to 1 if getdtablesize is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETDTABLESIZE + +/* Define to 1 if getgroups is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETGROUPS + +/* Define to 1 if gethostname is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETHOSTNAME + +/* Define to 1 if getline is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETLINE + +/* Define to 1 if getloadavg is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETLOADAVG + +/* Define to 1 if getlogin is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETLOGIN + +/* Define to 1 if getlogin_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETLOGIN_R + +/* Define to 1 if getpagesize is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETPAGESIZE + +/* Define to 1 if getpeername is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETPEERNAME + +/* Define to 1 if gets is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETS + +/* Define to 1 if getsockname is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETSOCKNAME + +/* Define to 1 if getsockopt is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETSOCKOPT + +/* Define to 1 if getsubopt is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETSUBOPT + +/* Define to 1 if gettimeofday is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETTIMEOFDAY + +/* Define to 1 if getusershell is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETUSERSHELL + +/* Define to 1 if grantpt is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GRANTPT + +/* Define to 1 if group_member is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GROUP_MEMBER + +/* Define to 1 if imaxabs is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_IMAXABS + +/* Define to 1 if imaxdiv is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_IMAXDIV + +/* Define to 1 if inet_ntop is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_INET_NTOP + +/* Define to 1 if inet_pton is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_INET_PTON + +/* Define to 1 if initstate is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_INITSTATE + +/* Define to 1 if initstate_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_INITSTATE_R + +/* Define to 1 if ioctl is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_IOCTL + +/* Define to 1 if isatty is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ISATTY + +/* Define to 1 if isblank is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ISBLANK + +/* Define to 1 if iswctype is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ISWCTYPE + +/* Define to 1 if lchmod is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LCHMOD + +/* Define to 1 if lchown is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LCHOWN + +/* Define to 1 if link is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LINK + +/* Define to 1 if linkat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LINKAT + +/* Define to 1 if listen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LISTEN + +/* Define to 1 if lseek is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LSEEK + +/* Define to 1 if lstat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LSTAT + +/* Define to 1 if mbrlen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MBRLEN + +/* Define to 1 if mbrtowc is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MBRTOWC + +/* Define to 1 if mbsinit is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MBSINIT + +/* Define to 1 if mbsnrtowcs is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MBSNRTOWCS + +/* Define to 1 if mbsrtowcs is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MBSRTOWCS + +/* Define to 1 if memmem is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MEMMEM + +/* Define to 1 if mempcpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MEMPCPY + +/* Define to 1 if memrchr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MEMRCHR + +/* Define to 1 if mkdirat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKDIRAT + +/* Define to 1 if mkdtemp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKDTEMP + +/* Define to 1 if mkfifo is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKFIFO + +/* Define to 1 if mkfifoat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKFIFOAT + +/* Define to 1 if mknod is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKNOD + +/* Define to 1 if mknodat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKNODAT + +/* Define to 1 if mkostemp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKOSTEMP + +/* Define to 1 if mkostemps is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKOSTEMPS + +/* Define to 1 if mkstemp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKSTEMP + +/* Define to 1 if mkstemps is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKSTEMPS + +/* Define to 1 if nl_langinfo is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_NL_LANGINFO + +/* Define to 1 if openat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_OPENAT + +/* Define to 1 if pclose is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PCLOSE + +/* Define to 1 if pipe is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PIPE + +/* Define to 1 if pipe2 is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PIPE2 + +/* Define to 1 if popen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_POPEN + +/* Define to 1 if posix_openpt is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_POSIX_OPENPT + +/* Define to 1 if pread is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PREAD + +/* Define to 1 if pselect is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PSELECT + +/* Define to 1 if pthread_sigmask is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PTHREAD_SIGMASK + +/* Define to 1 if ptsname is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PTSNAME + +/* Define to 1 if ptsname_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PTSNAME_R + +/* Define to 1 if pwrite is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PWRITE + +/* Define to 1 if qsort_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_QSORT_R + +/* Define to 1 if random is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RANDOM + +/* Define to 1 if random_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RANDOM_R + +/* Define to 1 if rawmemchr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RAWMEMCHR + +/* Define to 1 if readlink is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_READLINK + +/* Define to 1 if readlinkat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_READLINKAT + +/* Define to 1 if realpath is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_REALPATH + +/* Define to 1 if recv is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RECV + +/* Define to 1 if recvfrom is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RECVFROM + +/* Define to 1 if renameat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RENAMEAT + +/* Define to 1 if rmdir is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RMDIR + +/* Define to 1 if rpmatch is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RPMATCH + +/* Define to 1 if secure_getenv is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SECURE_GETENV + +/* Define to 1 if select is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SELECT + +/* Define to 1 if send is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SEND + +/* Define to 1 if sendto is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SENDTO + +/* Define to 1 if setenv is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETENV + +/* Define to 1 if sethostname is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETHOSTNAME + +/* Define to 1 if setlocale is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETLOCALE + +/* Define to 1 if setsockopt is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETSOCKOPT + +/* Define to 1 if setstate is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETSTATE + +/* Define to 1 if setstate_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETSTATE_R + +/* Define to 1 if setusershell is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETUSERSHELL + +/* Define to 1 if shutdown is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SHUTDOWN + +/* Define to 1 if sigaction is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SIGACTION + +/* Define to 1 if sigaddset is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SIGADDSET + +/* Define to 1 if sigdelset is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SIGDELSET + +/* Define to 1 if sigemptyset is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SIGEMPTYSET + +/* Define to 1 if sigfillset is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SIGFILLSET + +/* Define to 1 if sigismember is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SIGISMEMBER + +/* Define to 1 if sigpending is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SIGPENDING + +/* Define to 1 if sigprocmask is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SIGPROCMASK + +/* Define to 1 if sleep is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SLEEP + +/* Define to 1 if snprintf is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SNPRINTF + +/* Define to 1 if socket is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SOCKET + +/* Define to 1 if srandom is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SRANDOM + +/* Define to 1 if srandom_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SRANDOM_R + +/* Define to 1 if stat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STAT + +/* Define to 1 if stpcpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STPCPY + +/* Define to 1 if stpncpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STPNCPY + +/* Define to 1 if strcasecmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRCASECMP + +/* Define to 1 if strcasestr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRCASESTR + +/* Define to 1 if strchrnul is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRCHRNUL + +/* Define to 1 if strdup is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRDUP + +/* Define to 1 if strerror_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRERROR_R + +/* Define to 1 if strncasecmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRNCASECMP + +/* Define to 1 if strncat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRNCAT + +/* Define to 1 if strndup is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRNDUP + +/* Define to 1 if strnlen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRNLEN + +/* Define to 1 if strpbrk is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRPBRK + +/* Define to 1 if strsep is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRSEP + +/* Define to 1 if strsignal is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRSIGNAL + +/* Define to 1 if strtod is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRTOD + +/* Define to 1 if strtoimax is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRTOIMAX + +/* Define to 1 if strtok_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRTOK_R + +/* Define to 1 if strtoll is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRTOLL + +/* Define to 1 if strtoull is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRTOULL + +/* Define to 1 if strtoumax is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRTOUMAX + +/* Define to 1 if strverscmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRVERSCMP + +/* Define to 1 if symlink is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SYMLINK + +/* Define to 1 if symlinkat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SYMLINKAT + +/* Define to 1 if tmpfile is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_TMPFILE + +/* Define to 1 if towctrans is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_TOWCTRANS + +/* Define to 1 if truncate is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_TRUNCATE + +/* Define to 1 if ttyname_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_TTYNAME_R + +/* Define to 1 if unlink is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_UNLINK + +/* Define to 1 if unlinkat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_UNLINKAT + +/* Define to 1 if unlockpt is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_UNLOCKPT + +/* Define to 1 if unsetenv is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_UNSETENV + +/* Define to 1 if usleep is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_USLEEP + +/* Define to 1 if utimensat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_UTIMENSAT + +/* Define to 1 if vdprintf is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_VDPRINTF + +/* Define to 1 if vsnprintf is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_VSNPRINTF + +/* Define to 1 if waitpid is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WAITPID + +/* Define to 1 if wcpcpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCPCPY + +/* Define to 1 if wcpncpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCPNCPY + +/* Define to 1 if wcrtomb is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCRTOMB + +/* Define to 1 if wcscasecmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCASECMP + +/* Define to 1 if wcscat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCAT + +/* Define to 1 if wcschr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCHR + +/* Define to 1 if wcscmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCMP + +/* Define to 1 if wcscoll is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCOLL + +/* Define to 1 if wcscpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCPY + +/* Define to 1 if wcscspn is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCSPN + +/* Define to 1 if wcsdup is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSDUP + +/* Define to 1 if wcsftime is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSFTIME + +/* Define to 1 if wcslen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSLEN + +/* Define to 1 if wcsncasecmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNCASECMP + +/* Define to 1 if wcsncat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNCAT + +/* Define to 1 if wcsncmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNCMP + +/* Define to 1 if wcsncpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNCPY + +/* Define to 1 if wcsnlen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNLEN + +/* Define to 1 if wcsnrtombs is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNRTOMBS + +/* Define to 1 if wcspbrk is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSPBRK + +/* Define to 1 if wcsrchr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSRCHR + +/* Define to 1 if wcsrtombs is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSRTOMBS + +/* Define to 1 if wcsspn is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSSPN + +/* Define to 1 if wcsstr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSSTR + +/* Define to 1 if wcstok is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSTOK + +/* Define to 1 if wcswidth is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSWIDTH + +/* Define to 1 if wcsxfrm is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSXFRM + +/* Define to 1 if wctob is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCTOB + +/* Define to 1 if wctrans is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCTRANS + +/* Define to 1 if wctype is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCTYPE + +/* Define to 1 if wcwidth is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCWIDTH + +/* Define to 1 if wmemchr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMCHR + +/* Define to 1 if wmemcmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMCMP + +/* Define to 1 if wmemcpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMCPY + +/* Define to 1 if wmemmove is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMMOVE + +/* Define to 1 if wmemset is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMSET + +/* Define to 1 if _Exit is declared even after undefining macros. */ +#undef HAVE_RAW_DECL__EXIT + +/* Define to 1 if you have the `readlink' function. */ +#undef HAVE_READLINK + +/* Define to 1 if you have the `readlinkat' function. */ +#undef HAVE_READLINKAT + +/* Define to 1 if you have run the test for working tzset. */ +#undef HAVE_RUN_TZSET_TEST + +/* Define to 1 if the system has the type `sa_family_t'. */ +#undef HAVE_SA_FAMILY_T + +/* Define to 1 if you have the <search.h> header file. */ +#undef HAVE_SEARCH_H + +/* Define to 1 if you have the `secure_getenv' function. */ +#undef HAVE_SECURE_GETENV + +/* Define to 1 if you have the `setdtablesize' function. */ +#undef HAVE_SETDTABLESIZE + +/* Define to 1 if you have the `setenv' function. */ +#undef HAVE_SETENV + +/* Define to 1 if you have the `setrlimit' function. */ +#undef HAVE_SETRLIMIT + +/* Define to 1 if you have the `shutdown' function. */ +#undef HAVE_SHUTDOWN + +/* Define to 1 if you have the `sigaction' function. */ +#undef HAVE_SIGACTION + +/* Define to 1 if you have the `sigaltstack' function. */ +#undef HAVE_SIGALTSTACK + +/* Define to 1 if you have the `sigblock' function. */ +#undef HAVE_SIGBLOCK + +/* Define to 1 if the system has the type `siginfo_t'. */ +#undef HAVE_SIGINFO_T + +/* Define to 1 if you have the `siginterrupt' function. */ +#undef HAVE_SIGINTERRUPT + +/* Define to 1 if 'sig_atomic_t' is a signed integer type. */ +#undef HAVE_SIGNED_SIG_ATOMIC_T + +/* Define to 1 if 'wchar_t' is a signed integer type. */ +#undef HAVE_SIGNED_WCHAR_T + +/* Define to 1 if 'wint_t' is a signed integer type. */ +#undef HAVE_SIGNED_WINT_T + +/* Define to 1 if you have the `sigprocmask' function. */ +#undef HAVE_SIGPROCMASK + +/* Define to 1 if the system has the type `sigset_t'. */ +#undef HAVE_SIGSET_T + +/* Define to 1 if you have the `sleep' function. */ +#undef HAVE_SLEEP + +/* Define to 1 if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* Define if the return value of the snprintf function is the number of of + bytes (excluding the terminating NUL) that would have been produced if the + buffer had been large enough. */ +#undef HAVE_SNPRINTF_RETVAL_C99 + +/* Define to 1 if extending the stack slightly past the limit causes a SIGSEGV + which can be handled on an alternate stack established with sigaltstack. */ +#undef HAVE_STACK_OVERFLOW_HANDLING + +/* Define to 1 if the system has the type `stack_t'. */ +#undef HAVE_STACK_T + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares + uintmax_t. */ +#undef HAVE_STDINT_H_WITH_UINTMAX + +/* Define to 1 if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the `strcasecoll' function. */ +#undef HAVE_STRCASECOLL + +/* Define to 1 if you have the `strerror_r' function. */ +#undef HAVE_STRERROR_R + +/* Define to 1 if you have the `stricoll' function. */ +#undef HAVE_STRICOLL + +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Always define to 1, for backward compatibility. You can assume <string.h> + exists. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strncasecmp' function. */ +#undef HAVE_STRNCASECMP + +/* Define to 1 if you have the `strndup' function. */ +#undef HAVE_STRNDUP + +/* Define to 1 if you have the `strnlen' function. */ +#undef HAVE_STRNLEN + +/* Define to 1 if you have the `strptime' function. */ +#undef HAVE_STRPTIME + +/* Define to 1 if you have the `strtoull' function. */ +#undef HAVE_STRTOULL + +/* Define to 1 if you have the `strtoumax' function. */ +#undef HAVE_STRTOUMAX + +/* Define to 1 if `decimal_point' is a member of `struct lconv'. */ +#undef HAVE_STRUCT_LCONV_DECIMAL_POINT + +/* Define to 1 if `sa_sigaction' is a member of `struct sigaction'. */ +#undef HAVE_STRUCT_SIGACTION_SA_SIGACTION + +/* Define to 1 if the system has the type `struct sockaddr_storage'. */ +#undef HAVE_STRUCT_SOCKADDR_STORAGE + +/* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */ +#undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY + +/* Define to 1 if `st_atimensec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIMENSEC + +/* Define to 1 if `st_atimespec.tv_nsec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC + +/* Define to 1 if `st_atim.st__tim.tv_nsec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC + +/* Define to 1 if `st_atim.tv_nsec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC + +/* Define to 1 if `st_birthtimensec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC + +/* Define to 1 if `st_birthtimespec.tv_nsec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC + +/* Define to 1 if `st_birthtim.tv_nsec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC + +/* Define to 1 if `st_blksize' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_BLKSIZE + +/* Define to 1 if `st_rdev' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_RDEV + +/* Define to 1 if `tm_zone' is a member of `struct tm'. */ +#undef HAVE_STRUCT_TM_TM_ZONE + +/* Define to 1 if you have the `symlink' function. */ +#undef HAVE_SYMLINK + +/* Define to 1 if you have the <sys/bitypes.h> header file. */ +#undef HAVE_SYS_BITYPES_H + +/* Define to 1 if you have the <sys/cdefs.h> header file. */ +#undef HAVE_SYS_CDEFS_H + +/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. + */ +#undef HAVE_SYS_DIR_H + +/* Define to 1 if you have the <sys/inttypes.h> header file. */ +#undef HAVE_SYS_INTTYPES_H + +/* Define to 1 if you have the <sys/ioctl.h> header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the <sys/mman.h> header file. */ +#undef HAVE_SYS_MMAN_H + +/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. + */ +#undef HAVE_SYS_NDIR_H + +/* Define to 1 if you have the <sys/param.h> header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the <sys/select.h> header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the <sys/time.h> header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the <sys/uio.h> header file. */ +#undef HAVE_SYS_UIO_H + +/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if you have the `timegm' function. */ +#undef HAVE_TIMEGM + +/* Define to 1 if the system has the type `timezone_t'. */ +#undef HAVE_TIMEZONE_T + +/* Define if struct tm has the tm_gmtoff member. */ +#undef HAVE_TM_GMTOFF + +/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use + `HAVE_STRUCT_TM_TM_ZONE' instead. */ +#undef HAVE_TM_ZONE + +/* Define to 1 if you have the `towlower' function. */ +#undef HAVE_TOWLOWER + +/* Define to 1 if you have the `tsearch' function. */ +#undef HAVE_TSEARCH + +/* Define to 1 if you don't have `tm_zone' but do have the external array + `tzname'. */ +#undef HAVE_TZNAME + +/* Define to 1 if you have the `tzset' function. */ +#undef HAVE_TZSET + +/* Define to 1 if you have the <ucontext.h> header file. */ +#undef HAVE_UCONTEXT_H + +/* Define to 1 if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `unsetenv' function. */ +#undef HAVE_UNSETENV + +/* Define to 1 if the system has the type 'unsigned long long int'. */ +#undef HAVE_UNSIGNED_LONG_LONG_INT + +/* Define if you have a global __progname variable */ +#undef HAVE_VAR___PROGNAME + +/* Define to 1 if you have the `vasnprintf' function. */ +#undef HAVE_VASNPRINTF + +/* Define to 1 if you have the `vasprintf' function. */ +#undef HAVE_VASPRINTF + +/* Define to 1 if you have the `vfork' function. */ +#undef HAVE_VFORK + +/* Define to 1 if you have the <vfork.h> header file. */ +#undef HAVE_VFORK_H + +/* Define to 1 if you have the <wchar.h> header file. */ +#undef HAVE_WCHAR_H + +/* Define if you have the 'wchar_t' type. */ +#undef HAVE_WCHAR_T + +/* Define to 1 if you have the `wcrtomb' function. */ +#undef HAVE_WCRTOMB + +/* Define to 1 if you have the `wcslen' function. */ +#undef HAVE_WCSLEN + +/* Define to 1 if you have the `wcsnlen' function. */ +#undef HAVE_WCSNLEN + +/* Define to 1 if you have the `wctob' function. */ +#undef HAVE_WCTOB + +/* Define to 1 if you have the <wctype.h> header file. */ +#undef HAVE_WCTYPE_H + +/* Define to 1 if you have the `wcwidth' function. */ +#undef HAVE_WCWIDTH + +/* Define to 1 if you have the <winsock2.h> header file. */ +#undef HAVE_WINSOCK2_H + +/* Define if you have the 'wint_t' type. */ +#undef HAVE_WINT_T + +/* Define to 1 if you have the `wmemchr' function. */ +#undef HAVE_WMEMCHR + +/* Define to 1 if you have the `wmemcpy' function. */ +#undef HAVE_WMEMCPY + +/* Define to 1 if you have the `wmempcpy' function. */ +#undef HAVE_WMEMPCPY + +/* Define to 1 if `fork' works. */ +#undef HAVE_WORKING_FORK + +/* Define to 1 if O_NOATIME works. */ +#undef HAVE_WORKING_O_NOATIME + +/* Define to 1 if O_NOFOLLOW works. */ +#undef HAVE_WORKING_O_NOFOLLOW + +/* Define to 1 if `vfork' works. */ +#undef HAVE_WORKING_VFORK + +/* Define to 1 if you have the <ws2tcpip.h> header file. */ +#undef HAVE_WS2TCPIP_H + +/* Define to 1 if you have the <xlocale.h> header file. */ +#undef HAVE_XLOCALE_H + +/* Define to 1 if extending the stack slightly past the limit causes a + SIGSEGV, and an alternate stack can be established with sigaltstack, and + the signal handler is passed a context that specifies the run time stack. + This behavior is defined by POSIX 1003.1-2001 with the X/Open System + Interface (XSI) option and is a standardized way to implement a SEGV-based + stack overflow detection heuristic. */ +#undef HAVE_XSI_STACK_OVERFLOW_HEURISTIC + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Define to 1 if you have the `_set_invalid_parameter_handler' function. */ +#undef HAVE__SET_INVALID_PARAMETER_HANDLER + +/* Define to 1 if the compiler supports __builtin_expect, + and to 2 if <builtins.h> does. */ +#undef HAVE___BUILTIN_EXPECT +#ifndef HAVE___BUILTIN_EXPECT +# define __builtin_expect(e, c) (e) +#elif HAVE___BUILTIN_EXPECT == 2 +# include <builtins.h> +#endif + + +/* Define to 1 if you have the `__secure_getenv' function. */ +#undef HAVE___SECURE_GETENV + +/* Define to 1 if you have the `__xpg_strerror_r' function. */ +#undef HAVE___XPG_STRERROR_R + +/* Define as const if the declaration of iconv() needs const. */ +#undef ICONV_CONST + +/* Define to a symbolic name denoting the flavor of iconv_open() + implementation. */ +#undef ICONV_FLAVOR + +/* Define to 1 if 'lstat' dereferences a symlink specified with a trailing + slash. */ +#undef LSTAT_FOLLOWS_SLASHED_SYMLINK + +/* If malloc(0) is != NULL, define this to 1. Otherwise define this to 0. */ +#undef MALLOC_0_IS_NONNULL + +/* Define to a substitute value for mmap()'s MAP_ANONYMOUS flag. */ +#undef MAP_ANONYMOUS + +/* Define if the mbrtowc function does not return (size_t) -2 for empty input. + */ +#undef MBRTOWC_EMPTY_INPUT_BUG + +/* Define if the mbrtowc function has the NULL pwc argument bug. */ +#undef MBRTOWC_NULL_ARG1_BUG + +/* Define if the mbrtowc function has the NULL string argument bug. */ +#undef MBRTOWC_NULL_ARG2_BUG + +/* Define if the mbrtowc function does not return 0 for a NUL character. */ +#undef MBRTOWC_NUL_RETVAL_BUG + +/* Define if the mbrtowc function returns a wrong return value. */ +#undef MBRTOWC_RETVAL_BUG + +/* Use GNU style printf and scanf. */ +#ifndef __USE_MINGW_ANSI_STDIO +# undef __USE_MINGW_ANSI_STDIO +#endif + + +/* Define if the compilation of mktime.c should define 'mktime_internal'. */ +#undef NEED_MKTIME_INTERNAL + +/* Define if the compilation of mktime.c should define 'mktime' with the + native Windows TZ workaround. */ +#undef NEED_MKTIME_WINDOWS + +/* Define if the compilation of mktime.c should define 'mktime' with the + algorithmic workarounds. */ +#undef NEED_MKTIME_WORKING + +/* Define to 1 if open() fails to recognize a trailing slash. */ +#undef OPEN_TRAILING_SLASH_BUG + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* String identifying the packager of this software */ +#undef PACKAGE_PACKAGER + +/* Packager info for bug reports (URL/e-mail/...) */ +#undef PACKAGE_PACKAGER_BUG_REPORTS + +/* Packager-specific version information */ +#undef PACKAGE_PACKAGER_VERSION + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define if <inttypes.h> exists and defines unusable PRI* macros. */ +#undef PRI_MACROS_BROKEN + +/* Define to the type that is the result of default argument promotions of + type mode_t. */ +#undef PROMOTED_MODE_T + +/* Name of "pr" program. */ +#undef PR_PROGRAM + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'ptrdiff_t'. */ +#undef PTRDIFF_T_SUFFIX + +/* Define to 1 if readlink fails to recognize a trailing slash. */ +#undef READLINK_TRAILING_SLASH_BUG + +/* Define to 1 if stat needs help when passed a file name with a trailing + slash */ +#undef REPLACE_FUNC_STAT_FILE + +/* Define if nl_langinfo exists but is overridden by gnulib. */ +#undef REPLACE_NL_LANGINFO + +/* Define to 1 if strerror(0) does not return a message implying success. */ +#undef REPLACE_STRERROR_0 + +/* Define if vasnprintf exists but is overridden by gnulib. */ +#undef REPLACE_VASNPRINTF + +/* Define if sigaltstack() interprets the stack_t.ss_sp field incorrectly, as + the highest address of the alternate stack range rather than as the lowest + address. */ +#undef SIGALTSTACK_SS_REVERSED + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'sig_atomic_t'. */ +#undef SIG_ATOMIC_T_SUFFIX + +/* Define as the maximum value of type 'size_t', if the system doesn't define + it. */ +#ifndef SIZE_MAX +# undef SIZE_MAX +#endif + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'size_t'. */ +#undef SIZE_T_SUFFIX + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */ +#undef STAT_MACROS_BROKEN + +/* Always define to 1, for backward compatibility. You can assume the C90 + standard headers exist. */ +#undef STDC_HEADERS + +/* Define to 1 if strerror_r returns char *. */ +#undef STRERROR_R_CHAR_P + +/* Define to 1 if time_t is signed. */ +#undef TIME_T_IS_SIGNED + +/* Define to 1 if your <sys/time.h> declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* Define to 1 if the type of the st_atim member of a struct stat is struct + timespec. */ +#undef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC + +/* Define if tzset clobbers localtime's static buffer. */ +#undef TZSET_CLOBBERS_LOCALTIME + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable general extensions on macOS. */ +#ifndef _DARWIN_C_SOURCE +# undef _DARWIN_C_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# undef __STDC_WANT_IEC_60559_BFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# undef __STDC_WANT_IEC_60559_DFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# undef __STDC_WANT_IEC_60559_TYPES_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# undef __STDC_WANT_LIB_EXT2__ +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# undef __STDC_WANT_MATH_SPEC_FUNCS__ +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable X/Open extensions if necessary. HP-UX 11.11 defines + mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of + whether compiling with -Ae or -D_HPUX_SOURCE=1. */ +#ifndef _XOPEN_SOURCE +# undef _XOPEN_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + +/* Define to 1 if you want getc etc. to use unlocked I/O if available. + Unlocked I/O can improve performance in unithreaded apps, but it is not + safe for multithreaded apps. */ +#undef USE_UNLOCKED_IO + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if unsetenv returns void instead of int. */ +#undef VOID_UNSETENV + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'wchar_t'. */ +#undef WCHAR_T_SUFFIX + +/* Define if WSAStartup is needed. */ +#undef WINDOWS_SOCKETS + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'wint_t'. */ +#undef WINT_T_SUFFIX + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#undef _DARWIN_USE_64_BIT_INODE + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* enable compile-time and run-time bounds-checking, and some warnings */ +#undef _FORTIFY_SOURCE + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* Define to 1 on Solaris. */ +#undef _LCONV_C99 + +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 1 to make NetBSD features available. MINIX 3 needs this. */ +#undef _NETBSD_SOURCE + +/* The _Noreturn keyword of C11. */ +#if ! (defined _Noreturn \ + || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) +# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ + || 0x5110 <= __SUNPRO_C) +# define _Noreturn __attribute__ ((__noreturn__)) +# elif defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn +# endif +#endif + + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 in order to get the POSIX compatible declarations of socket + functions. */ +#undef _POSIX_PII_SOCKET + +/* Define to 1 if you need to in order for 'stat' and other things to work. */ +#undef _POSIX_SOURCE + +/* Define if you want <regex.h> to include <limits.h>, so that it consistently + overrides <limits.h>'s RE_DUP_MAX. */ +#undef _REGEX_INCLUDE_LIMITS_H + +/* Define if you want regoff_t to be at least as wide POSIX requires. */ +#undef _REGEX_LARGE_OFFSETS + +/* Define to rpl_ if the getopt replacement functions and variables should be + used. */ +#undef __GETOPT_PREFIX + +/* Define to 1 if the system <stdint.h> predates C++11. */ +#undef __STDC_CONSTANT_MACROS + +/* Define to 1 if the system <stdint.h> predates C++11. */ +#undef __STDC_LIMIT_MACROS + +/* Define to 1 if C does not support variable-length arrays, and if the + compiler does not already define this. */ +#undef __STDC_NO_VLA__ + +/* Please see the Gnulib manual for how to use these macros. + + Suppress extern inline with HP-UX cc, as it appears to be broken; see + <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>. + + Suppress extern inline with Sun C in standards-conformance mode, as it + mishandles inline functions that call each other. E.g., for 'inline void f + (void) { } inline void g (void) { f (); }', c99 incorrectly complains + 'reference to static identifier "f" in extern inline function'. + This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. + + Suppress extern inline (with or without __attribute__ ((__gnu_inline__))) + on configurations that mistakenly use 'static inline' to implement + functions or macros in standard C headers like <ctype.h>. For example, + if isdigit is mistakenly implemented via a static inline function, + a program containing an extern inline function that calls isdigit + may not work since the C standard prohibits extern inline functions + from calling static functions. This bug is known to occur on: + + OS X 10.8 and earlier; see: + http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html + + DragonFly; see + http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log + + FreeBSD; see: + http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html + + OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and + for clang but remains for g++; see <http://trac.macports.org/ticket/41033>. + Assume DragonFly and FreeBSD will be similar. */ +#if (((defined __APPLE__ && defined __MACH__) \ + || defined __DragonFly__ || defined __FreeBSD__) \ + && (defined __header_inline \ + ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \ + && ! defined __clang__) \ + : ((! defined _DONT_USE_CTYPE_INLINE_ \ + && (defined __GNUC__ || defined __cplusplus)) \ + || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \ + && defined __GNUC__ && ! defined __cplusplus)))) +# define _GL_EXTERN_INLINE_STDHEADER_BUG +#endif +#if ((__GNUC__ \ + ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ + : (199901L <= __STDC_VERSION__ \ + && !defined __HP_cc \ + && !defined __PGI \ + && !(defined __SUNPRO_C && __STDC__))) \ + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) +# define _GL_INLINE inline +# define _GL_EXTERN_INLINE extern inline +# define _GL_EXTERN_INLINE_IN_USE +#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \ + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) +# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__ + /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ +# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) +# else +# define _GL_INLINE extern inline +# endif +# define _GL_EXTERN_INLINE extern +# define _GL_EXTERN_INLINE_IN_USE +#else +# define _GL_INLINE static _GL_UNUSED +# define _GL_EXTERN_INLINE static _GL_UNUSED +#endif + +/* In GCC 4.6 (inclusive) to 5.1 (exclusive), + suppress bogus "no previous prototype for 'FOO'" + and "no previous declaration for 'FOO'" diagnostics, + when FOO is an inline function in the header; see + <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and + <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>. */ +#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__ +# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ +# define _GL_INLINE_HEADER_CONST_PRAGMA +# else +# define _GL_INLINE_HEADER_CONST_PRAGMA \ + _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") +# endif +# define _GL_INLINE_HEADER_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \ + _GL_INLINE_HEADER_CONST_PRAGMA +# define _GL_INLINE_HEADER_END \ + _Pragma ("GCC diagnostic pop") +#else +# define _GL_INLINE_HEADER_BEGIN +# define _GL_INLINE_HEADER_END +#endif + +/* Define to a replacement function name for fnmatch(). */ +#undef fnmatch + +/* Define to `int' if <sys/types.h> doesn't define. */ +#undef gid_t + +/* A replacement for va_copy, if needed. */ +#define gl_va_copy(a,b) ((a) = (b)) + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to long or long long if <stdint.h> and <inttypes.h> don't define. */ +#undef intmax_t + +/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports + the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of + earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. + __APPLE__ && __MACH__ test for Mac OS X. + __APPLE_CC__ tests for the Apple compiler and its version. + __STDC_VERSION__ tests for the C99 mode. */ +#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ +# define __GNUC_STDC_INLINE__ 1 +#endif + +/* Define to 1 if the compiler is checking for lint. */ +#undef lint + +/* Define to a type if <wchar.h> does not define. */ +#undef mbstate_t + +/* Define to the real name of the mktime_internal function. */ +#undef mktime_internal + +/* Define to `int' if <sys/types.h> does not define. */ +#undef mode_t + +/* Define to the name of the strftime replacement function. */ +#undef my_strftime + +/* Define to the type of st_nlink in struct stat, or a supertype. */ +#undef nlink_t + +/* Define to `long int' if <sys/types.h> does not define. */ +#undef off_t + +/* Define to `int' if <sys/types.h> does not define. */ +#undef pid_t + +/* Define as the type of the result of subtracting two pointers, if the system + doesn't define it. */ +#undef ptrdiff_t + +/* Define to rpl_re_comp if the replacement should be used. */ +#undef re_comp + +/* Define to rpl_re_compile_fastmap if the replacement should be used. */ +#undef re_compile_fastmap + +/* Define to rpl_re_compile_pattern if the replacement should be used. */ +#undef re_compile_pattern + +/* Define to rpl_re_exec if the replacement should be used. */ +#undef re_exec + +/* Define to rpl_re_match if the replacement should be used. */ +#undef re_match + +/* Define to rpl_re_match_2 if the replacement should be used. */ +#undef re_match_2 + +/* Define to rpl_re_search if the replacement should be used. */ +#undef re_search + +/* Define to rpl_re_search_2 if the replacement should be used. */ +#undef re_search_2 + +/* Define to rpl_re_set_registers if the replacement should be used. */ +#undef re_set_registers + +/* Define to rpl_re_set_syntax if the replacement should be used. */ +#undef re_set_syntax + +/* Define to rpl_re_syntax_options if the replacement should be used. */ +#undef re_syntax_options + +/* Define to rpl_regcomp if the replacement should be used. */ +#undef regcomp + +/* Define to rpl_regerror if the replacement should be used. */ +#undef regerror + +/* Define to rpl_regexec if the replacement should be used. */ +#undef regexec + +/* Define to rpl_regfree if the replacement should be used. */ +#undef regfree + +/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#undef restrict +/* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the + previous line. Perhaps some future version of Sun C++ will work with + restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +# define _Restrict +# define __restrict__ +#endif + +/* Define to `unsigned int' if <sys/types.h> does not define. */ +#undef size_t + +/* type to use in place of socklen_t if not defined */ +#undef socklen_t + +/* Define as a signed type of the same size as size_t. */ +#undef ssize_t + +/* Define to `int' if <sys/types.h> doesn't define. */ +#undef uid_t + +/* Define as a marker that can be attached to declarations that might not + be used. This helps to reduce warnings, such as from + GCC -Wunused-parameter. */ +#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _GL_UNUSED __attribute__ ((__unused__)) +#else +# define _GL_UNUSED +#endif +/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name + is a misnomer outside of parameter lists. */ +#define _UNUSED_PARAMETER_ _GL_UNUSED + +/* gcc supports the "unused" attribute on possibly unused labels, and + g++ has since version 4.5. Note to support C++ as well as C, + _GL_UNUSED_LABEL should be used with a trailing ; */ +#if !defined __cplusplus || __GNUC__ > 4 \ + || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# define _GL_UNUSED_LABEL _GL_UNUSED +#else +# define _GL_UNUSED_LABEL +#endif + +/* The __pure__ attribute was added in gcc 2.96. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE /* empty */ +#endif + +/* The __const__ attribute was added in gcc 2.95. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) +#else +# define _GL_ATTRIBUTE_CONST /* empty */ +#endif + + +/* Define as a macro for copying va_list variables. */ +#undef va_copy + +/* Define as `fork' if `vfork' does not work. */ +#undef vfork diff --git a/local/recipes/tools/diffutils/source/lib/ctype.in.h b/local/recipes/tools/diffutils/source/lib/ctype.in.h new file mode 100644 index 0000000000..0bb2721b48 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/ctype.in.h @@ -0,0 +1,57 @@ +/* A substitute for ISO C99 <ctype.h>, for platforms on which it is incomplete. + + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible. */ + +/* + * ISO C 99 <ctype.h> for platforms on which it is incomplete. + * <http://www.opengroup.org/onlinepubs/9699919799/basedefs/ctype.h.html> + */ + +#ifndef _@GUARD_PREFIX@_CTYPE_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* Include the original <ctype.h>. */ +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_CTYPE_H@ + +#ifndef _@GUARD_PREFIX@_CTYPE_H +#define _@GUARD_PREFIX@_CTYPE_H + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +/* Return non-zero if c is a blank, i.e. a space or tab character. */ +#if @GNULIB_ISBLANK@ +# if !@HAVE_ISBLANK@ +_GL_EXTERN_C int isblank (int c); +# endif +#elif defined GNULIB_POSIXCHECK +# undef isblank +# if HAVE_RAW_DECL_ISBLANK +_GL_WARN_ON_USE (isblank, "isblank is unportable - " + "use gnulib module isblank for portability"); +# endif +#endif + +#endif /* _@GUARD_PREFIX@_CTYPE_H */ +#endif /* _@GUARD_PREFIX@_CTYPE_H */ diff --git a/local/recipes/tools/diffutils/source/lib/diffseq.h b/local/recipes/tools/diffutils/source/lib/diffseq.h new file mode 100644 index 0000000000..d7a374357c --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/diffseq.h @@ -0,0 +1,525 @@ +/* Analyze differences between two vectors. + + Copyright (C) 1988-1989, 1992-1995, 2001-2004, 2006-2017 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + + +/* The basic idea is to consider two vectors as similar if, when + transforming the first vector into the second vector through a + sequence of edits (inserts and deletes of one element each), + this sequence is short - or equivalently, if the ordered list + of elements that are untouched by these edits is long. For a + good introduction to the subject, read about the "Levenshtein + distance" in Wikipedia. + + The basic algorithm is described in: + "An O(ND) Difference Algorithm and its Variations", Eugene W. Myers, + Algorithmica Vol. 1, 1986, pp. 251-266, + <http://dx.doi.org/10.1007/BF01840446>. + See especially section 4.2, which describes the variation used below. + + The basic algorithm was independently discovered as described in: + "Algorithms for Approximate String Matching", Esko Ukkonen, + Information and Control Vol. 64, 1985, pp. 100-118, + <http://dx.doi.org/10.1016/S0019-9958(85)80046-2>. + + Unless the 'find_minimal' flag is set, this code uses the TOO_EXPENSIVE + heuristic, by Paul Eggert, to limit the cost to O(N**1.5 log N) + at the price of producing suboptimal output for large inputs with + many differences. */ + +/* Before including this file, you need to define: + ELEMENT The element type of the vectors being compared. + EQUAL A two-argument macro that tests two elements for + equality. + OFFSET A signed integer type sufficient to hold the + difference between two indices. Usually + something like ptrdiff_t. + EXTRA_CONTEXT_FIELDS Declarations of fields for 'struct context'. + NOTE_DELETE(ctxt, xoff) Record the removal of the object xvec[xoff]. + NOTE_INSERT(ctxt, yoff) Record the insertion of the object yvec[yoff]. + EARLY_ABORT(ctxt) (Optional) A boolean expression that triggers an + early abort of the computation. + USE_HEURISTIC (Optional) Define if you want to support the + heuristic for large vectors. + It is also possible to use this file with abstract arrays. In this case, + xvec and yvec are not represented in memory. They only exist conceptually. + In this case, the list of defines above is amended as follows: + ELEMENT Undefined. + EQUAL Undefined. + XVECREF_YVECREF_EQUAL(ctxt, xoff, yoff) + A three-argument macro: References xvec[xoff] and + yvec[yoff] and tests these elements for equality. + Before including this file, you also need to include: + #include <limits.h> + #include <stdbool.h> + #include "minmax.h" + */ + +/* Maximum value of type OFFSET. */ +#define OFFSET_MAX \ + ((((OFFSET)1 << (sizeof (OFFSET) * CHAR_BIT - 2)) - 1) * 2 + 1) + +/* Default to no early abort. */ +#ifndef EARLY_ABORT +# define EARLY_ABORT(ctxt) false +#endif + +/* Use this to suppress gcc's "...may be used before initialized" warnings. + Beware: The Code argument must not contain commas. */ +#ifndef IF_LINT +# if defined GCC_LINT || defined lint +# define IF_LINT(Code) Code +# else +# define IF_LINT(Code) /* empty */ +# endif +#endif + +/* As above, but when Code must contain one comma. */ +#ifndef IF_LINT2 +# if defined GCC_LINT || defined lint +# define IF_LINT2(Code1, Code2) Code1, Code2 +# else +# define IF_LINT2(Code1, Code2) /* empty */ +# endif +#endif + +/* + * Context of comparison operation. + */ +struct context +{ + #ifdef ELEMENT + /* Vectors being compared. */ + ELEMENT const *xvec; + ELEMENT const *yvec; + #endif + + /* Extra fields. */ + EXTRA_CONTEXT_FIELDS + + /* Vector, indexed by diagonal, containing 1 + the X coordinate of the point + furthest along the given diagonal in the forward search of the edit + matrix. */ + OFFSET *fdiag; + + /* Vector, indexed by diagonal, containing the X coordinate of the point + furthest along the given diagonal in the backward search of the edit + matrix. */ + OFFSET *bdiag; + + #ifdef USE_HEURISTIC + /* This corresponds to the diff --speed-large-files flag. With this + heuristic, for vectors with a constant small density of changes, + the algorithm is linear in the vector size. */ + bool heuristic; + #endif + + /* Edit scripts longer than this are too expensive to compute. */ + OFFSET too_expensive; + + /* Snakes bigger than this are considered "big". */ + #define SNAKE_LIMIT 20 +}; + +struct partition +{ + /* Midpoints of this partition. */ + OFFSET xmid; + OFFSET ymid; + + /* True if low half will be analyzed minimally. */ + bool lo_minimal; + + /* Likewise for high half. */ + bool hi_minimal; +}; + + +/* Find the midpoint of the shortest edit script for a specified portion + of the two vectors. + + Scan from the beginnings of the vectors, and simultaneously from the ends, + doing a breadth-first search through the space of edit-sequence. + When the two searches meet, we have found the midpoint of the shortest + edit sequence. + + If FIND_MINIMAL is true, find the minimal edit script regardless of + expense. Otherwise, if the search is too expensive, use heuristics to + stop the search and report a suboptimal answer. + + Set PART->(xmid,ymid) to the midpoint (XMID,YMID). The diagonal number + XMID - YMID equals the number of inserted elements minus the number + of deleted elements (counting only elements before the midpoint). + + Set PART->lo_minimal to true iff the minimal edit script for the + left half of the partition is known; similarly for PART->hi_minimal. + + This function assumes that the first elements of the specified portions + of the two vectors do not match, and likewise that the last elements do not + match. The caller must trim matching elements from the beginning and end + of the portions it is going to specify. + + If we return the "wrong" partitions, the worst this can do is cause + suboptimal diff output. It cannot cause incorrect diff output. */ + +static void +diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, bool find_minimal, + struct partition *part, struct context *ctxt) +{ + OFFSET *const fd = ctxt->fdiag; /* Give the compiler a chance. */ + OFFSET *const bd = ctxt->bdiag; /* Additional help for the compiler. */ +#ifdef ELEMENT + ELEMENT const *const xv = ctxt->xvec; /* Still more help for the compiler. */ + ELEMENT const *const yv = ctxt->yvec; /* And more and more . . . */ + #define XREF_YREF_EQUAL(x,y) EQUAL (xv[x], yv[y]) +#else + #define XREF_YREF_EQUAL(x,y) XVECREF_YVECREF_EQUAL (ctxt, x, y) +#endif + const OFFSET dmin = xoff - ylim; /* Minimum valid diagonal. */ + const OFFSET dmax = xlim - yoff; /* Maximum valid diagonal. */ + const OFFSET fmid = xoff - yoff; /* Center diagonal of top-down search. */ + const OFFSET bmid = xlim - ylim; /* Center diagonal of bottom-up search. */ + OFFSET fmin = fmid; + OFFSET fmax = fmid; /* Limits of top-down search. */ + OFFSET bmin = bmid; + OFFSET bmax = bmid; /* Limits of bottom-up search. */ + OFFSET c; /* Cost. */ + bool odd = (fmid - bmid) & 1; /* True if southeast corner is on an odd + diagonal with respect to the northwest. */ + + fd[fmid] = xoff; + bd[bmid] = xlim; + + for (c = 1;; ++c) + { + OFFSET d; /* Active diagonal. */ + bool big_snake = false; + + /* Extend the top-down search by an edit step in each diagonal. */ + if (fmin > dmin) + fd[--fmin - 1] = -1; + else + ++fmin; + if (fmax < dmax) + fd[++fmax + 1] = -1; + else + --fmax; + for (d = fmax; d >= fmin; d -= 2) + { + OFFSET x; + OFFSET y; + OFFSET tlo = fd[d - 1]; + OFFSET thi = fd[d + 1]; + OFFSET x0 = tlo < thi ? thi : tlo + 1; + + for (x = x0, y = x0 - d; + x < xlim && y < ylim && XREF_YREF_EQUAL (x, y); + x++, y++) + continue; + if (x - x0 > SNAKE_LIMIT) + big_snake = true; + fd[d] = x; + if (odd && bmin <= d && d <= bmax && bd[d] <= x) + { + part->xmid = x; + part->ymid = y; + part->lo_minimal = part->hi_minimal = true; + return; + } + } + + /* Similarly extend the bottom-up search. */ + if (bmin > dmin) + bd[--bmin - 1] = OFFSET_MAX; + else + ++bmin; + if (bmax < dmax) + bd[++bmax + 1] = OFFSET_MAX; + else + --bmax; + for (d = bmax; d >= bmin; d -= 2) + { + OFFSET x; + OFFSET y; + OFFSET tlo = bd[d - 1]; + OFFSET thi = bd[d + 1]; + OFFSET x0 = tlo < thi ? tlo : thi - 1; + + for (x = x0, y = x0 - d; + xoff < x && yoff < y && XREF_YREF_EQUAL (x - 1, y - 1); + x--, y--) + continue; + if (x0 - x > SNAKE_LIMIT) + big_snake = true; + bd[d] = x; + if (!odd && fmin <= d && d <= fmax && x <= fd[d]) + { + part->xmid = x; + part->ymid = y; + part->lo_minimal = part->hi_minimal = true; + return; + } + } + + if (find_minimal) + continue; + +#ifdef USE_HEURISTIC + /* Heuristic: check occasionally for a diagonal that has made lots + of progress compared with the edit distance. If we have any + such, find the one that has made the most progress and return it + as if it had succeeded. + + With this heuristic, for vectors with a constant small density + of changes, the algorithm is linear in the vector size. */ + + if (200 < c && big_snake && ctxt->heuristic) + { + { + OFFSET best = 0; + + for (d = fmax; d >= fmin; d -= 2) + { + OFFSET dd = d - fmid; + OFFSET x = fd[d]; + OFFSET y = x - d; + OFFSET v = (x - xoff) * 2 - dd; + + if (v > 12 * (c + (dd < 0 ? -dd : dd))) + { + if (v > best + && xoff + SNAKE_LIMIT <= x && x < xlim + && yoff + SNAKE_LIMIT <= y && y < ylim) + { + /* We have a good enough best diagonal; now insist + that it end with a significant snake. */ + int k; + + for (k = 1; XREF_YREF_EQUAL (x - k, y - k); k++) + if (k == SNAKE_LIMIT) + { + best = v; + part->xmid = x; + part->ymid = y; + break; + } + } + } + } + if (best > 0) + { + part->lo_minimal = true; + part->hi_minimal = false; + return; + } + } + + { + OFFSET best = 0; + + for (d = bmax; d >= bmin; d -= 2) + { + OFFSET dd = d - bmid; + OFFSET x = bd[d]; + OFFSET y = x - d; + OFFSET v = (xlim - x) * 2 + dd; + + if (v > 12 * (c + (dd < 0 ? -dd : dd))) + { + if (v > best + && xoff < x && x <= xlim - SNAKE_LIMIT + && yoff < y && y <= ylim - SNAKE_LIMIT) + { + /* We have a good enough best diagonal; now insist + that it end with a significant snake. */ + int k; + + for (k = 0; XREF_YREF_EQUAL (x + k, y + k); k++) + if (k == SNAKE_LIMIT - 1) + { + best = v; + part->xmid = x; + part->ymid = y; + break; + } + } + } + } + if (best > 0) + { + part->lo_minimal = false; + part->hi_minimal = true; + return; + } + } + } +#endif /* USE_HEURISTIC */ + + /* Heuristic: if we've gone well beyond the call of duty, give up + and report halfway between our best results so far. */ + if (c >= ctxt->too_expensive) + { + OFFSET fxybest; + OFFSET fxbest IF_LINT (= 0); + OFFSET bxybest; + OFFSET bxbest IF_LINT (= 0); + + /* Find forward diagonal that maximizes X + Y. */ + fxybest = -1; + for (d = fmax; d >= fmin; d -= 2) + { + OFFSET x = MIN (fd[d], xlim); + OFFSET y = x - d; + if (ylim < y) + { + x = ylim + d; + y = ylim; + } + if (fxybest < x + y) + { + fxybest = x + y; + fxbest = x; + } + } + + /* Find backward diagonal that minimizes X + Y. */ + bxybest = OFFSET_MAX; + for (d = bmax; d >= bmin; d -= 2) + { + OFFSET x = MAX (xoff, bd[d]); + OFFSET y = x - d; + if (y < yoff) + { + x = yoff + d; + y = yoff; + } + if (x + y < bxybest) + { + bxybest = x + y; + bxbest = x; + } + } + + /* Use the better of the two diagonals. */ + if ((xlim + ylim) - bxybest < fxybest - (xoff + yoff)) + { + part->xmid = fxbest; + part->ymid = fxybest - fxbest; + part->lo_minimal = true; + part->hi_minimal = false; + } + else + { + part->xmid = bxbest; + part->ymid = bxybest - bxbest; + part->lo_minimal = false; + part->hi_minimal = true; + } + return; + } + } + #undef XREF_YREF_EQUAL +} + + +/* Compare in detail contiguous subsequences of the two vectors + which are known, as a whole, to match each other. + + The subsequence of vector 0 is [XOFF, XLIM) and likewise for vector 1. + + Note that XLIM, YLIM are exclusive bounds. All indices into the vectors + are origin-0. + + If FIND_MINIMAL, find a minimal difference no matter how + expensive it is. + + The results are recorded by invoking NOTE_DELETE and NOTE_INSERT. + + Return false if terminated normally, or true if terminated through early + abort. */ + +static bool +compareseq (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, + bool find_minimal, struct context *ctxt) +{ +#ifdef ELEMENT + ELEMENT const *xv = ctxt->xvec; /* Help the compiler. */ + ELEMENT const *yv = ctxt->yvec; + #define XREF_YREF_EQUAL(x,y) EQUAL (xv[x], yv[y]) +#else + #define XREF_YREF_EQUAL(x,y) XVECREF_YVECREF_EQUAL (ctxt, x, y) +#endif + + /* Slide down the bottom initial diagonal. */ + while (xoff < xlim && yoff < ylim && XREF_YREF_EQUAL (xoff, yoff)) + { + xoff++; + yoff++; + } + + /* Slide up the top initial diagonal. */ + while (xoff < xlim && yoff < ylim && XREF_YREF_EQUAL (xlim - 1, ylim - 1)) + { + xlim--; + ylim--; + } + + /* Handle simple cases. */ + if (xoff == xlim) + while (yoff < ylim) + { + NOTE_INSERT (ctxt, yoff); + if (EARLY_ABORT (ctxt)) + return true; + yoff++; + } + else if (yoff == ylim) + while (xoff < xlim) + { + NOTE_DELETE (ctxt, xoff); + if (EARLY_ABORT (ctxt)) + return true; + xoff++; + } + else + { + struct partition part IF_LINT2 (= { .xmid = 0, .ymid = 0 }); + + /* Find a point of correspondence in the middle of the vectors. */ + diag (xoff, xlim, yoff, ylim, find_minimal, &part, ctxt); + + /* Use the partitions to split this problem into subproblems. */ + if (compareseq (xoff, part.xmid, yoff, part.ymid, part.lo_minimal, ctxt)) + return true; + if (compareseq (part.xmid, xlim, part.ymid, ylim, part.hi_minimal, ctxt)) + return true; + } + + return false; + #undef XREF_YREF_EQUAL +} + +#undef ELEMENT +#undef EQUAL +#undef OFFSET +#undef EXTRA_CONTEXT_FIELDS +#undef NOTE_DELETE +#undef NOTE_INSERT +#undef EARLY_ABORT +#undef USE_HEURISTIC +#undef XVECREF_YVECREF_EQUAL +#undef OFFSET_MAX diff --git a/local/recipes/tools/diffutils/source/lib/dirname-lgpl.c b/local/recipes/tools/diffutils/source/lib/dirname-lgpl.c new file mode 100644 index 0000000000..b549ca9764 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/dirname-lgpl.c @@ -0,0 +1,86 @@ +/* dirname.c -- return all but the last element in a file name + + Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2017 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "dirname.h" + +#include <stdlib.h> +#include <string.h> + +/* Return the length of the prefix of FILE that will be used by + dir_name. If FILE is in the working directory, this returns zero + even though 'dir_name (FILE)' will return ".". Works properly even + if there are trailing slashes (by effectively ignoring them). */ + +size_t +dir_len (char const *file) +{ + size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (file); + size_t length; + + /* Advance prefix_length beyond important leading slashes. */ + prefix_length += (prefix_length != 0 + ? (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE + && ISSLASH (file[prefix_length])) + : (ISSLASH (file[0]) + ? ((DOUBLE_SLASH_IS_DISTINCT_ROOT + && ISSLASH (file[1]) && ! ISSLASH (file[2]) + ? 2 : 1)) + : 0)); + + /* Strip the basename and any redundant slashes before it. */ + for (length = last_component (file) - file; + prefix_length < length; length--) + if (! ISSLASH (file[length - 1])) + break; + return length; +} + + +/* In general, we can't use the builtin 'dirname' function if available, + since it has different meanings in different environments. + In some environments the builtin 'dirname' modifies its argument. + + Return the leading directories part of FILE, allocated with malloc. + Works properly even if there are trailing slashes (by effectively + ignoring them). Return NULL on failure. + + If lstat (FILE) would succeed, then { chdir (dir_name (FILE)); + lstat (base_name (FILE)); } will access the same file. Likewise, + if the sequence { chdir (dir_name (FILE)); + rename (base_name (FILE), "foo"); } succeeds, you have renamed FILE + to "foo" in the same directory FILE was in. */ + +char * +mdir_name (char const *file) +{ + size_t length = dir_len (file); + bool append_dot = (length == 0 + || (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE + && length == FILE_SYSTEM_PREFIX_LEN (file) + && file[2] != '\0' && ! ISSLASH (file[2]))); + char *dir = malloc (length + append_dot + 1); + if (!dir) + return NULL; + memcpy (dir, file, length); + if (append_dot) + dir[length++] = '.'; + dir[length] = '\0'; + return dir; +} diff --git a/local/recipes/tools/diffutils/source/lib/dirname.c b/local/recipes/tools/diffutils/source/lib/dirname.c new file mode 100644 index 0000000000..ed57557462 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/dirname.c @@ -0,0 +1,38 @@ +/* dirname.c -- return all but the last element in a file name + + Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2017 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "dirname.h" + +#include <stdlib.h> +#include <string.h> +#include "xalloc.h" + +/* Just like mdir_name (dirname-lgpl.c), except, rather than + returning NULL upon malloc failure, here, we report the + "memory exhausted" condition and exit. */ + +char * +dir_name (char const *file) +{ + char *result = mdir_name (file); + if (!result) + xalloc_die (); + return result; +} diff --git a/local/recipes/tools/diffutils/source/lib/dirname.h b/local/recipes/tools/diffutils/source/lib/dirname.h new file mode 100644 index 0000000000..dbf920b190 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/dirname.h @@ -0,0 +1,54 @@ +/* Take file names apart into directory and base names. + + Copyright (C) 1998, 2001, 2003-2006, 2009-2017 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef DIRNAME_H_ +# define DIRNAME_H_ 1 + +# include <stdbool.h> +# include <stddef.h> +# include "dosname.h" + +# ifndef DIRECTORY_SEPARATOR +# define DIRECTORY_SEPARATOR '/' +# endif + +# ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT +# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0 +# endif + +#ifdef __cplusplus +extern "C" { +#endif + +# if GNULIB_DIRNAME +char *base_name (char const *file); +char *dir_name (char const *file); +# endif + +char *mdir_name (char const *file); +size_t base_len (char const *file) _GL_ATTRIBUTE_PURE; +size_t dir_len (char const *file) _GL_ATTRIBUTE_PURE; +char *last_component (char const *file) _GL_ATTRIBUTE_PURE; + +bool strip_trailing_slashes (char *file); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* not DIRNAME_H_ */ diff --git a/local/recipes/tools/diffutils/source/lib/dosname.h b/local/recipes/tools/diffutils/source/lib/dosname.h new file mode 100644 index 0000000000..dd5c177725 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/dosname.h @@ -0,0 +1,53 @@ +/* File names on MS-DOS/Windows systems. + + Copyright (C) 2000-2001, 2004-2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + From Paul Eggert and Jim Meyering. */ + +#ifndef _DOSNAME_H +#define _DOSNAME_H + +#if (defined _WIN32 || defined __WIN32__ || \ + defined __MSDOS__ || defined __CYGWIN__ || \ + defined __EMX__ || defined __DJGPP__) + /* This internal macro assumes ASCII, but all hosts that support drive + letters use ASCII. */ +# define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a' \ + <= 'z' - 'a') +# define FILE_SYSTEM_PREFIX_LEN(Filename) \ + (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0) +# ifndef __CYGWIN__ +# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1 +# endif +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +#else +# define FILE_SYSTEM_PREFIX_LEN(Filename) 0 +# define ISSLASH(C) ((C) == '/') +#endif + +#ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE +# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0 +#endif + +#if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE +# define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)]) +# else +# define IS_ABSOLUTE_FILE_NAME(F) \ + (ISSLASH ((F)[0]) || FILE_SYSTEM_PREFIX_LEN (F) != 0) +#endif +#define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F)) + +#endif /* DOSNAME_H_ */ diff --git a/local/recipes/tools/diffutils/source/lib/dup2.c b/local/recipes/tools/diffutils/source/lib/dup2.c new file mode 100644 index 0000000000..002dc8c76c --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/dup2.c @@ -0,0 +1,235 @@ +/* Duplicate an open file descriptor to a specified file descriptor. + + Copyright (C) 1999, 2004-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* written by Paul Eggert */ + +#include <config.h> + +/* Specification. */ +#include <unistd.h> + +#include <errno.h> +#include <fcntl.h> + +#if HAVE_DUP2 + +# undef dup2 + +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +/* Get declarations of the native Windows API functions. */ +# define WIN32_LEAN_AND_MEAN +# include <windows.h> + +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER +# include "msvc-inval.h" +# endif + +/* Get _get_osfhandle. */ +# if GNULIB_MSVC_NOTHROW +# include "msvc-nothrow.h" +# else +# include <io.h> +# endif + +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER +static int +dup2_nothrow (int fd, int desired_fd) +{ + int result; + + TRY_MSVC_INVAL + { + result = dup2 (fd, desired_fd); + } + CATCH_MSVC_INVAL + { + errno = EBADF; + result = -1; + } + DONE_MSVC_INVAL; + + return result; +} +# else +# define dup2_nothrow dup2 +# endif + +static int +ms_windows_dup2 (int fd, int desired_fd) +{ + int result; + + /* If fd is closed, mingw hangs on dup2 (fd, fd). If fd is open, + dup2 (fd, fd) returns 0, but all further attempts to use fd in + future dup2 calls will hang. */ + if (fd == desired_fd) + { + if ((HANDLE) _get_osfhandle (fd) == INVALID_HANDLE_VALUE) + { + errno = EBADF; + return -1; + } + return fd; + } + + /* Wine 1.0.1 return 0 when desired_fd is negative but not -1: + http://bugs.winehq.org/show_bug.cgi?id=21289 */ + if (desired_fd < 0) + { + errno = EBADF; + return -1; + } + + result = dup2_nothrow (fd, desired_fd); + + if (result == 0) + result = desired_fd; + + return result; +} + +# define dup2 ms_windows_dup2 + +# elif defined __KLIBC__ + +# include <InnoTekLIBC/backend.h> + +static int +klibc_dup2dirfd (int fd, int desired_fd) +{ + int tempfd; + int dupfd; + + tempfd = open ("NUL", O_RDONLY); + if (tempfd == -1) + return -1; + + if (tempfd == desired_fd) + { + close (tempfd); + + char path[_MAX_PATH]; + if (__libc_Back_ioFHToPath (fd, path, sizeof (path))) + return -1; + + return open(path, O_RDONLY); + } + + dupfd = klibc_dup2dirfd (fd, desired_fd); + + close (tempfd); + + return dupfd; +} + +static int +klibc_dup2 (int fd, int desired_fd) +{ + int dupfd; + struct stat sbuf; + + dupfd = dup2 (fd, desired_fd); + if (dupfd == -1 && errno == ENOTSUP \ + && !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode)) + { + close (desired_fd); + + return klibc_dup2dirfd (fd, desired_fd); + } + + return dupfd; +} + +# define dup2 klibc_dup2 +# endif + +int +rpl_dup2 (int fd, int desired_fd) +{ + int result; + +# ifdef F_GETFL + /* On Linux kernels 2.6.26-2.6.29, dup2 (fd, fd) returns -EBADF. + On Cygwin 1.5.x, dup2 (1, 1) returns 0. + On Cygwin 1.7.17, dup2 (1, -1) dumps core. + On Cygwin 1.7.25, dup2 (1, 256) can dump core. + On Haiku, dup2 (fd, fd) mistakenly clears FD_CLOEXEC. */ +# if HAVE_SETDTABLESIZE + setdtablesize (desired_fd + 1); +# endif + if (desired_fd < 0) + fd = desired_fd; + if (fd == desired_fd) + return fcntl (fd, F_GETFL) == -1 ? -1 : fd; +# endif + + result = dup2 (fd, desired_fd); + + /* Correct an errno value on FreeBSD 6.1 and Cygwin 1.5.x. */ + if (result == -1 && errno == EMFILE) + errno = EBADF; +# if REPLACE_FCHDIR + if (fd != desired_fd && result != -1) + result = _gl_register_dup (fd, result); +# endif + return result; +} + +#else /* !HAVE_DUP2 */ + +/* On older platforms, dup2 did not exist. */ + +# ifndef F_DUPFD +static int +dupfd (int fd, int desired_fd) +{ + int duplicated_fd = dup (fd); + if (duplicated_fd < 0 || duplicated_fd == desired_fd) + return duplicated_fd; + else + { + int r = dupfd (fd, desired_fd); + int e = errno; + close (duplicated_fd); + errno = e; + return r; + } +} +# endif + +int +dup2 (int fd, int desired_fd) +{ + int result = fcntl (fd, F_GETFL) < 0 ? -1 : fd; + if (result == -1 || fd == desired_fd) + return result; + close (desired_fd); +# ifdef F_DUPFD + result = fcntl (fd, F_DUPFD, desired_fd); +# if REPLACE_FCHDIR + if (0 <= result) + result = _gl_register_dup (fd, result); +# endif +# else + result = dupfd (fd, desired_fd); +# endif + if (result == -1 && (errno == EMFILE || errno == EINVAL)) + errno = EBADF; + return result; +} +#endif /* !HAVE_DUP2 */ diff --git a/local/recipes/tools/diffutils/source/lib/errno.in.h b/local/recipes/tools/diffutils/source/lib/errno.in.h new file mode 100644 index 0000000000..13194f9d29 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/errno.in.h @@ -0,0 +1,279 @@ +/* A POSIX-like <errno.h>. + + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _@GUARD_PREFIX@_ERRNO_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_ERRNO_H@ + +#ifndef _@GUARD_PREFIX@_ERRNO_H +#define _@GUARD_PREFIX@_ERRNO_H + + +/* On native Windows platforms, many macros are not defined. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +/* These are the same values as defined by MSVC 10, for interoperability. */ + +# ifndef ENOMSG +# define ENOMSG 122 +# define GNULIB_defined_ENOMSG 1 +# endif + +# ifndef EIDRM +# define EIDRM 111 +# define GNULIB_defined_EIDRM 1 +# endif + +# ifndef ENOLINK +# define ENOLINK 121 +# define GNULIB_defined_ENOLINK 1 +# endif + +# ifndef EPROTO +# define EPROTO 134 +# define GNULIB_defined_EPROTO 1 +# endif + +# ifndef EBADMSG +# define EBADMSG 104 +# define GNULIB_defined_EBADMSG 1 +# endif + +# ifndef EOVERFLOW +# define EOVERFLOW 132 +# define GNULIB_defined_EOVERFLOW 1 +# endif + +# ifndef ENOTSUP +# define ENOTSUP 129 +# define GNULIB_defined_ENOTSUP 1 +# endif + +# ifndef ENETRESET +# define ENETRESET 117 +# define GNULIB_defined_ENETRESET 1 +# endif + +# ifndef ECONNABORTED +# define ECONNABORTED 106 +# define GNULIB_defined_ECONNABORTED 1 +# endif + +# ifndef ECANCELED +# define ECANCELED 105 +# define GNULIB_defined_ECANCELED 1 +# endif + +# ifndef EOWNERDEAD +# define EOWNERDEAD 133 +# define GNULIB_defined_EOWNERDEAD 1 +# endif + +# ifndef ENOTRECOVERABLE +# define ENOTRECOVERABLE 127 +# define GNULIB_defined_ENOTRECOVERABLE 1 +# endif + +# ifndef EINPROGRESS +# define EINPROGRESS 112 +# define EALREADY 103 +# define ENOTSOCK 128 +# define EDESTADDRREQ 109 +# define EMSGSIZE 115 +# define EPROTOTYPE 136 +# define ENOPROTOOPT 123 +# define EPROTONOSUPPORT 135 +# define EOPNOTSUPP 130 +# define EAFNOSUPPORT 102 +# define EADDRINUSE 100 +# define EADDRNOTAVAIL 101 +# define ENETDOWN 116 +# define ENETUNREACH 118 +# define ECONNRESET 108 +# define ENOBUFS 119 +# define EISCONN 113 +# define ENOTCONN 126 +# define ETIMEDOUT 138 +# define ECONNREFUSED 107 +# define ELOOP 114 +# define EHOSTUNREACH 110 +# define EWOULDBLOCK 140 +# define GNULIB_defined_ESOCK 1 +# endif + +# ifndef ETXTBSY +# define ETXTBSY 139 +# define ENODATA 120 /* not required by POSIX */ +# define ENOSR 124 /* not required by POSIX */ +# define ENOSTR 125 /* not required by POSIX */ +# define ETIME 137 /* not required by POSIX */ +# define EOTHER 131 /* not required by POSIX */ +# define GNULIB_defined_ESTREAMS 1 +# endif + +/* These are intentionally the same values as the WSA* error numbers, defined + in <winsock2.h>. */ +# define ESOCKTNOSUPPORT 10044 /* not required by POSIX */ +# define EPFNOSUPPORT 10046 /* not required by POSIX */ +# define ESHUTDOWN 10058 /* not required by POSIX */ +# define ETOOMANYREFS 10059 /* not required by POSIX */ +# define EHOSTDOWN 10064 /* not required by POSIX */ +# define EPROCLIM 10067 /* not required by POSIX */ +# define EUSERS 10068 /* not required by POSIX */ +# define EDQUOT 10069 +# define ESTALE 10070 +# define EREMOTE 10071 /* not required by POSIX */ +# define GNULIB_defined_EWINSOCK 1 + +# endif + + +/* On OSF/1 5.1, when _XOPEN_SOURCE_EXTENDED is not defined, the macros + EMULTIHOP, ENOLINK, EOVERFLOW are not defined. */ +# if @EMULTIHOP_HIDDEN@ +# define EMULTIHOP @EMULTIHOP_VALUE@ +# define GNULIB_defined_EMULTIHOP 1 +# endif +# if @ENOLINK_HIDDEN@ +# define ENOLINK @ENOLINK_VALUE@ +# define GNULIB_defined_ENOLINK 1 +# endif +# if @EOVERFLOW_HIDDEN@ +# define EOVERFLOW @EOVERFLOW_VALUE@ +# define GNULIB_defined_EOVERFLOW 1 +# endif + + +/* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK, + EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined. + Likewise, on NonStop Kernel, EDQUOT is not defined. + Define them here. Values >= 2000 seem safe to use: Solaris ESTALE = 151, + HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133. + + Note: When one of these systems defines some of these macros some day, + binaries will have to be recompiled so that they recognizes the new + errno values from the system. */ + +# ifndef ENOMSG +# define ENOMSG 2000 +# define GNULIB_defined_ENOMSG 1 +# endif + +# ifndef EIDRM +# define EIDRM 2001 +# define GNULIB_defined_EIDRM 1 +# endif + +# ifndef ENOLINK +# define ENOLINK 2002 +# define GNULIB_defined_ENOLINK 1 +# endif + +# ifndef EPROTO +# define EPROTO 2003 +# define GNULIB_defined_EPROTO 1 +# endif + +# ifndef EMULTIHOP +# define EMULTIHOP 2004 +# define GNULIB_defined_EMULTIHOP 1 +# endif + +# ifndef EBADMSG +# define EBADMSG 2005 +# define GNULIB_defined_EBADMSG 1 +# endif + +# ifndef EOVERFLOW +# define EOVERFLOW 2006 +# define GNULIB_defined_EOVERFLOW 1 +# endif + +# ifndef ENOTSUP +# define ENOTSUP 2007 +# define GNULIB_defined_ENOTSUP 1 +# endif + +# ifndef ENETRESET +# define ENETRESET 2011 +# define GNULIB_defined_ENETRESET 1 +# endif + +# ifndef ECONNABORTED +# define ECONNABORTED 2012 +# define GNULIB_defined_ECONNABORTED 1 +# endif + +# ifndef ESTALE +# define ESTALE 2009 +# define GNULIB_defined_ESTALE 1 +# endif + +# ifndef EDQUOT +# define EDQUOT 2010 +# define GNULIB_defined_EDQUOT 1 +# endif + +# ifndef ECANCELED +# define ECANCELED 2008 +# define GNULIB_defined_ECANCELED 1 +# endif + +/* On many platforms, the macros EOWNERDEAD and ENOTRECOVERABLE are not + defined. */ + +# ifndef EOWNERDEAD +# if defined __sun + /* Use the same values as defined for Solaris >= 8, for + interoperability. */ +# define EOWNERDEAD 58 +# define ENOTRECOVERABLE 59 +# elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* We have a conflict here: pthreads-win32 defines these values + differently than MSVC 10. It's hairy to decide which one to use. */ +# if defined __MINGW32__ && !defined USE_WINDOWS_THREADS + /* Use the same values as defined by pthreads-win32, for + interoperability. */ +# define EOWNERDEAD 43 +# define ENOTRECOVERABLE 44 +# else + /* Use the same values as defined by MSVC 10, for + interoperability. */ +# define EOWNERDEAD 133 +# define ENOTRECOVERABLE 127 +# endif +# else +# define EOWNERDEAD 2013 +# define ENOTRECOVERABLE 2014 +# endif +# define GNULIB_defined_EOWNERDEAD 1 +# define GNULIB_defined_ENOTRECOVERABLE 1 +# endif + +# ifndef EILSEQ +# define EILSEQ 2015 +# define GNULIB_defined_EILSEQ 1 +# endif + +#endif /* _@GUARD_PREFIX@_ERRNO_H */ +#endif /* _@GUARD_PREFIX@_ERRNO_H */ diff --git a/local/recipes/tools/diffutils/source/lib/error.c b/local/recipes/tools/diffutils/source/lib/error.c new file mode 100644 index 0000000000..418d1ab8de --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/error.c @@ -0,0 +1,410 @@ +/* Error handler for noninteractive utilities + Copyright (C) 1990-1998, 2000-2007, 2009-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */ + +#if !_LIBC +# include <config.h> +#endif + +#include "error.h" + +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#if !_LIBC && ENABLE_NLS +# include "gettext.h" +# define _(msgid) gettext (msgid) +#endif + +#ifdef _LIBC +# include <libintl.h> +# include <stdbool.h> +# include <stdint.h> +# include <wchar.h> +# define mbsrtowcs __mbsrtowcs +# define USE_UNLOCKED_IO 0 +# define _GL_ATTRIBUTE_FORMAT_PRINTF(a, b) +# define _GL_ARG_NONNULL(a) +#else +# include "getprogname.h" +#endif + +#if USE_UNLOCKED_IO +# include "unlocked-io.h" +#endif + +#ifndef _ +# define _(String) String +#endif + +/* If NULL, error will flush stdout, then print on stderr the program + name, a colon and a space. Otherwise, error will call this + function without parameters instead. */ +void (*error_print_progname) (void); + +/* This variable is incremented each time 'error' is called. */ +unsigned int error_message_count; + +#ifdef _LIBC +/* In the GNU C library, there is a predefined variable for this. */ + +# define program_name program_invocation_name +# include <errno.h> +# include <limits.h> +# include <libio/libioP.h> + +/* In GNU libc we want do not want to use the common name 'error' directly. + Instead make it a weak alias. */ +extern void __error (int status, int errnum, const char *message, ...) + __attribute__ ((__format__ (__printf__, 3, 4))); +extern void __error_at_line (int status, int errnum, const char *file_name, + unsigned int line_number, const char *message, + ...) + __attribute__ ((__format__ (__printf__, 5, 6))); +# define error __error +# define error_at_line __error_at_line + +# include <libio/iolibio.h> +# define fflush(s) _IO_fflush (s) +# undef putc +# define putc(c, fp) _IO_putc (c, fp) + +# include <bits/libc-lock.h> + +#else /* not _LIBC */ + +# include <fcntl.h> +# include <unistd.h> + +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Get declarations of the native Windows API functions. */ +# define WIN32_LEAN_AND_MEAN +# include <windows.h> +/* Get _get_osfhandle. */ +# if GNULIB_MSVC_NOTHROW +# include "msvc-nothrow.h" +# else +# include <io.h> +# endif +# endif + +/* The gnulib override of fcntl is not needed in this file. */ +# undef fcntl + +# if !(GNULIB_STRERROR_R_POSIX || HAVE_DECL_STRERROR_R) +# ifndef HAVE_DECL_STRERROR_R +"this configure-time declaration test was not run" +# endif +# if STRERROR_R_CHAR_P +char *strerror_r (int errnum, char *buf, size_t buflen); +# else +int strerror_r (int errnum, char *buf, size_t buflen); +# endif +# endif + +#define program_name getprogname () + +# if GNULIB_STRERROR_R_POSIX || HAVE_STRERROR_R || defined strerror_r +# define __strerror_r strerror_r +# endif /* GNULIB_STRERROR_R_POSIX || HAVE_STRERROR_R || defined strerror_r */ +#endif /* not _LIBC */ + +#if !_LIBC +/* Return non-zero if FD is open. */ +static int +is_open (int fd) +{ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* On native Windows: The initial state of unassigned standard file + descriptors is that they are open but point to an INVALID_HANDLE_VALUE. + There is no fcntl, and the gnulib replacement fcntl does not support + F_GETFL. */ + return (HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE; +# else +# ifndef F_GETFL +# error Please port fcntl to your platform +# endif + return 0 <= fcntl (fd, F_GETFL); +# endif +} +#endif + +static void +flush_stdout (void) +{ +#if !_LIBC + int stdout_fd; + +# if GNULIB_FREOPEN_SAFER + /* Use of gnulib's freopen-safer module normally ensures that + fileno (stdout) == 1 + whenever stdout is open. */ + stdout_fd = STDOUT_FILENO; +# else + /* POSIX states that fileno (stdout) after fclose is unspecified. But in + practice it is not a problem, because stdout is statically allocated and + the fd of a FILE stream is stored as a field in its allocated memory. */ + stdout_fd = fileno (stdout); +# endif + /* POSIX states that fflush (stdout) after fclose is unspecified; it + is safe in glibc, but not on all other platforms. fflush (NULL) + is always defined, but too draconian. */ + if (0 <= stdout_fd && is_open (stdout_fd)) +#endif + fflush (stdout); +} + +static void +print_errno_message (int errnum) +{ + char const *s; + +#if _LIBC || GNULIB_STRERROR_R_POSIX || defined HAVE_STRERROR_R + char errbuf[1024]; +# if _LIBC || (!GNULIB_STRERROR_R_POSIX && STRERROR_R_CHAR_P) + s = __strerror_r (errnum, errbuf, sizeof errbuf); +# else + if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0) + s = errbuf; + else + s = 0; +# endif +#else + s = strerror (errnum); +#endif + +#if !_LIBC + if (! s) + s = _("Unknown system error"); +#endif + +#if _LIBC + __fxprintf (NULL, ": %s", s); +#else + fprintf (stderr, ": %s", s); +#endif +} + +static void _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) _GL_ARG_NONNULL ((3)) +error_tail (int status, int errnum, const char *message, va_list args) +{ +#if _LIBC + if (_IO_fwide (stderr, 0) > 0) + { + size_t len = strlen (message) + 1; + wchar_t *wmessage = NULL; + mbstate_t st; + size_t res; + const char *tmp; + bool use_malloc = false; + + while (1) + { + if (__libc_use_alloca (len * sizeof (wchar_t))) + wmessage = (wchar_t *) alloca (len * sizeof (wchar_t)); + else + { + if (!use_malloc) + wmessage = NULL; + + wchar_t *p = (wchar_t *) realloc (wmessage, + len * sizeof (wchar_t)); + if (p == NULL) + { + free (wmessage); + fputws_unlocked (L"out of memory\n", stderr); + return; + } + wmessage = p; + use_malloc = true; + } + + memset (&st, '\0', sizeof (st)); + tmp = message; + + res = mbsrtowcs (wmessage, &tmp, len, &st); + if (res != len) + break; + + if (__builtin_expect (len >= SIZE_MAX / sizeof (wchar_t) / 2, 0)) + { + /* This really should not happen if everything is fine. */ + res = (size_t) -1; + break; + } + + len *= 2; + } + + if (res == (size_t) -1) + { + /* The string cannot be converted. */ + if (use_malloc) + { + free (wmessage); + use_malloc = false; + } + wmessage = (wchar_t *) L"???"; + } + + __vfwprintf (stderr, wmessage, args); + + if (use_malloc) + free (wmessage); + } + else +#endif + vfprintf (stderr, message, args); + va_end (args); + + ++error_message_count; + if (errnum) + print_errno_message (errnum); +#if _LIBC + __fxprintf (NULL, "\n"); +#else + putc ('\n', stderr); +#endif + fflush (stderr); + if (status) + exit (status); +} + + +/* Print the program name and error message MESSAGE, which is a printf-style + format string with optional args. + If ERRNUM is nonzero, print its corresponding system error message. + Exit with status STATUS if it is nonzero. */ +void +error (int status, int errnum, const char *message, ...) +{ + va_list args; + +#if defined _LIBC && defined __libc_ptf_call + /* We do not want this call to be cut short by a thread + cancellation. Therefore disable cancellation for now. */ + int state = PTHREAD_CANCEL_ENABLE; + __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state), + 0); +#endif + + flush_stdout (); +#ifdef _LIBC + _IO_flockfile (stderr); +#endif + if (error_print_progname) + (*error_print_progname) (); + else + { +#if _LIBC + __fxprintf (NULL, "%s: ", program_name); +#else + fprintf (stderr, "%s: ", program_name); +#endif + } + + va_start (args, message); + error_tail (status, errnum, message, args); + +#ifdef _LIBC + _IO_funlockfile (stderr); +# ifdef __libc_ptf_call + __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0); +# endif +#endif +} + +/* Sometimes we want to have at most one error per line. This + variable controls whether this mode is selected or not. */ +int error_one_per_line; + +void +error_at_line (int status, int errnum, const char *file_name, + unsigned int line_number, const char *message, ...) +{ + va_list args; + + if (error_one_per_line) + { + static const char *old_file_name; + static unsigned int old_line_number; + + if (old_line_number == line_number + && (file_name == old_file_name + || (old_file_name != NULL + && file_name != NULL + && strcmp (old_file_name, file_name) == 0))) + + /* Simply return and print nothing. */ + return; + + old_file_name = file_name; + old_line_number = line_number; + } + +#if defined _LIBC && defined __libc_ptf_call + /* We do not want this call to be cut short by a thread + cancellation. Therefore disable cancellation for now. */ + int state = PTHREAD_CANCEL_ENABLE; + __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state), + 0); +#endif + + flush_stdout (); +#ifdef _LIBC + _IO_flockfile (stderr); +#endif + if (error_print_progname) + (*error_print_progname) (); + else + { +#if _LIBC + __fxprintf (NULL, "%s:", program_name); +#else + fprintf (stderr, "%s:", program_name); +#endif + } + +#if _LIBC + __fxprintf (NULL, file_name != NULL ? "%s:%u: " : " ", + file_name, line_number); +#else + fprintf (stderr, file_name != NULL ? "%s:%u: " : " ", + file_name, line_number); +#endif + + va_start (args, message); + error_tail (status, errnum, message, args); + +#ifdef _LIBC + _IO_funlockfile (stderr); +# ifdef __libc_ptf_call + __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0); +# endif +#endif +} + +#ifdef _LIBC +/* Make the weak alias. */ +# undef error +# undef error_at_line +weak_alias (__error, error) +weak_alias (__error_at_line, error_at_line) +#endif diff --git a/local/recipes/tools/diffutils/source/lib/error.h b/local/recipes/tools/diffutils/source/lib/error.h new file mode 100644 index 0000000000..ef024d9d14 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/error.h @@ -0,0 +1,75 @@ +/* Declaration for error-reporting function + Copyright (C) 1995-1997, 2003, 2006, 2008-2017 Free Software Foundation, + Inc. + This file is part of the GNU C Library. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _ERROR_H +#define _ERROR_H 1 + +/* The __attribute__ feature is available in gcc versions 2.5 and later. + The __-protected variants of the attributes 'format' and 'printf' are + accepted by gcc versions 2.6.4 (effectively 2.7) and later. + We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because + gnulib and libintl do '#define printf __printf__' when they override + the 'printf' function. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) +#else +# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ +#endif + +/* On mingw, the flavor of printf depends on whether the extensions module + * is in use; the check for <stdio.h> determines the witness macro. */ +#ifndef _GL_ATTRIBUTE_SPEC_PRINTF +# if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU +# define _GL_ATTRIBUTE_SPEC_PRINTF __gnu_printf__ +# else +# define _GL_ATTRIBUTE_SPEC_PRINTF __printf__ +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Print a message with 'fprintf (stderr, FORMAT, ...)'; + if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). + If STATUS is nonzero, terminate the program with 'exit (STATUS)'. */ + +extern void error (int __status, int __errnum, const char *__format, ...) + _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF, 3, 4)); + +extern void error_at_line (int __status, int __errnum, const char *__fname, + unsigned int __lineno, const char *__format, ...) + _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF, 5, 6)); + +/* If NULL, error will flush stdout, then print on stderr the program + name, a colon and a space. Otherwise, error will call this + function without parameters instead. */ +extern void (*error_print_progname) (void); + +/* This variable is incremented each time 'error' is called. */ +extern unsigned int error_message_count; + +/* Sometimes we want to have at most one error per line. This + variable controls whether this mode is selected or not. */ +extern int error_one_per_line; + +#ifdef __cplusplus +} +#endif + +#endif /* error.h */ diff --git a/local/recipes/tools/diffutils/source/lib/exclude.c b/local/recipes/tools/diffutils/source/lib/exclude.c new file mode 100644 index 0000000000..fb3bbc2225 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/exclude.c @@ -0,0 +1,695 @@ +/* exclude.c -- exclude file names + + Copyright (C) 1992-1994, 1997, 1999-2007, 2009-2017 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert <eggert@twinsun.com> + and Sergey Poznyakoff <gray@gnu.org>. + Thanks to Phil Proudman <phil@proudman51.freeserve.co.uk> + for improvement suggestions. */ + +#include <config.h> + +#include <stdbool.h> + +#include <ctype.h> +#include <errno.h> +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <wctype.h> +#include <regex.h> + +#include "exclude.h" +#include "hash.h" +#include "mbuiter.h" +#include "fnmatch.h" +#include "xalloc.h" +#include "verify.h" +#include "filename.h" + +#if USE_UNLOCKED_IO +# include "unlocked-io.h" +#endif + +/* Non-GNU systems lack these options, so we don't need to check them. */ +#ifndef FNM_CASEFOLD +# define FNM_CASEFOLD 0 +#endif +#ifndef FNM_EXTMATCH +# define FNM_EXTMATCH 0 +#endif +#ifndef FNM_LEADING_DIR +# define FNM_LEADING_DIR 0 +#endif + +verify (((EXCLUDE_ANCHORED | EXCLUDE_INCLUDE | EXCLUDE_WILDCARDS) + & (FNM_PATHNAME | FNM_NOESCAPE | FNM_PERIOD | FNM_LEADING_DIR + | FNM_CASEFOLD | FNM_EXTMATCH)) + == 0); + + +/* Exclusion patterns are grouped into a singly-linked list of + "exclusion segments". Each segment represents a set of patterns + that can be matches using the same algorithm. Non-wildcard + patterns are kept in hash tables, to speed up searches. Wildcard + patterns are stored as arrays of patterns. */ + + +/* An exclude pattern-options pair. The options are fnmatch options + ORed with EXCLUDE_* options. */ + +struct patopts + { + int options; + union + { + char const *pattern; + regex_t re; + } v; + }; + +/* An array of pattern-options pairs. */ + +struct exclude_pattern + { + struct patopts *exclude; + size_t exclude_alloc; + size_t exclude_count; + }; + +enum exclude_type + { + exclude_hash, /* a hash table of excluded names */ + exclude_pattern /* an array of exclude patterns */ + }; + +struct exclude_segment + { + struct exclude_segment *next; /* next segment in list */ + enum exclude_type type; /* type of this segment */ + int options; /* common options for this segment */ + union + { + Hash_table *table; /* for type == exclude_hash */ + struct exclude_pattern pat; /* for type == exclude_pattern */ + } v; + }; + +struct pattern_buffer + { + struct pattern_buffer *next; + char *base; + }; + +/* The exclude structure keeps a singly-linked list of exclude segments, + maintained in reverse order. */ +struct exclude + { + struct exclude_segment *head; + struct pattern_buffer *patbuf; + }; + +/* Register BUF in the pattern buffer list of EX. ADD_FUNC (see + add_exclude_file and add_exclude_fp below) can use this function + if it modifies the pattern, to ensure the allocated memory will be + properly reclaimed upon calling free_exclude. */ +void +exclude_add_pattern_buffer (struct exclude *ex, char *buf) +{ + struct pattern_buffer *pbuf = xmalloc (sizeof *pbuf); + pbuf->base = buf; + pbuf->next = ex->patbuf; + ex->patbuf = pbuf; +} + +/* Return true if STR has or may have wildcards, when matched with OPTIONS. + Return false if STR definitely does not have wildcards. */ +bool +fnmatch_pattern_has_wildcards (const char *str, int options) +{ + while (1) + { + switch (*str++) + { + case '.': + case '{': + case '}': + case '(': + case ')': + if (options & EXCLUDE_REGEX) + return true; + break; + + case '\\': + if (options & EXCLUDE_REGEX) + continue; + else + str += ! (options & FNM_NOESCAPE) && *str; + break; + + case '+': case '@': case '!': + if (options & FNM_EXTMATCH && *str == '(') + return true; + break; + + case '?': case '*': case '[': + return true; + + case '\0': + return false; + } + } +} + +static void +unescape_pattern (char *str) +{ + char const *q = str; + do + q += *q == '\\' && q[1]; + while ((*str++ = *q++)); +} + +/* Return a newly allocated and empty exclude list. */ + +struct exclude * +new_exclude (void) +{ + return xzalloc (sizeof *new_exclude ()); +} + +/* Calculate the hash of string. */ +static size_t +string_hasher (void const *data, size_t n_buckets) +{ + char const *p = data; + return hash_string (p, n_buckets); +} + +/* Ditto, for case-insensitive hashes */ +static size_t +string_hasher_ci (void const *data, size_t n_buckets) +{ + char const *p = data; + mbui_iterator_t iter; + size_t value = 0; + + for (mbui_init (iter, p); mbui_avail (iter); mbui_advance (iter)) + { + mbchar_t m = mbui_cur (iter); + wchar_t wc; + + if (m.wc_valid) + wc = towlower (m.wc); + else + wc = *m.ptr; + + value = (value * 31 + wc) % n_buckets; + } + + return value; +} + +/* compare two strings for equality */ +static bool +string_compare (void const *data1, void const *data2) +{ + char const *p1 = data1; + char const *p2 = data2; + return strcmp (p1, p2) == 0; +} + +/* compare two strings for equality, case-insensitive */ +static bool +string_compare_ci (void const *data1, void const *data2) +{ + char const *p1 = data1; + char const *p2 = data2; + return mbscasecmp (p1, p2) == 0; +} + +static void +string_free (void *data) +{ + free (data); +} + +/* Create new exclude segment of given TYPE and OPTIONS, and attach it + to the head of EX. */ +static void +new_exclude_segment (struct exclude *ex, enum exclude_type type, int options) +{ + struct exclude_segment *sp = xzalloc (sizeof (struct exclude_segment)); + sp->type = type; + sp->options = options; + switch (type) + { + case exclude_pattern: + break; + + case exclude_hash: + sp->v.table = hash_initialize (0, NULL, + (options & FNM_CASEFOLD) ? + string_hasher_ci + : string_hasher, + (options & FNM_CASEFOLD) ? + string_compare_ci + : string_compare, + string_free); + break; + } + sp->next = ex->head; + ex->head = sp; +} + +/* Free a single exclude segment */ +static void +free_exclude_segment (struct exclude_segment *seg) +{ + size_t i; + + switch (seg->type) + { + case exclude_pattern: + for (i = 0; i < seg->v.pat.exclude_count; i++) + { + if (seg->v.pat.exclude[i].options & EXCLUDE_REGEX) + regfree (&seg->v.pat.exclude[i].v.re); + } + free (seg->v.pat.exclude); + break; + + case exclude_hash: + hash_free (seg->v.table); + break; + } + free (seg); +} + +/* Free the storage associated with an exclude list. */ +void +free_exclude (struct exclude *ex) +{ + struct exclude_segment *seg; + struct pattern_buffer *pbuf; + + for (seg = ex->head; seg; ) + { + struct exclude_segment *next = seg->next; + free_exclude_segment (seg); + seg = next; + } + + for (pbuf = ex->patbuf; pbuf; ) + { + struct pattern_buffer *next = pbuf->next; + free (pbuf->base); + free (pbuf); + pbuf = next; + } + + free (ex); +} + +/* Return zero if PATTERN matches F, obeying OPTIONS, except that + (unlike fnmatch) wildcards are disabled in PATTERN. */ + +static int +fnmatch_no_wildcards (char const *pattern, char const *f, int options) +{ + if (! (options & FNM_LEADING_DIR)) + return ((options & FNM_CASEFOLD) + ? mbscasecmp (pattern, f) + : strcmp (pattern, f)); + else if (! (options & FNM_CASEFOLD)) + { + size_t patlen = strlen (pattern); + int r = strncmp (pattern, f, patlen); + if (! r) + { + r = f[patlen]; + if (r == '/') + r = 0; + } + return r; + } + else + { + /* Walk through a copy of F, seeing whether P matches any prefix + of F. + + FIXME: This is an O(N**2) algorithm; it should be O(N). + Also, the copy should not be necessary. However, fixing this + will probably involve a change to the mbs* API. */ + + char *fcopy = xstrdup (f); + char *p; + int r; + for (p = fcopy; ; *p++ = '/') + { + p = strchr (p, '/'); + if (p) + *p = '\0'; + r = mbscasecmp (pattern, fcopy); + if (!p || r <= 0) + break; + } + free (fcopy); + return r; + } +} + +bool +exclude_fnmatch (char const *pattern, char const *f, int options) +{ + int (*matcher) (char const *, char const *, int) = + (options & EXCLUDE_WILDCARDS + ? fnmatch + : fnmatch_no_wildcards); + bool matched = ((*matcher) (pattern, f, options) == 0); + char const *p; + + if (! (options & EXCLUDE_ANCHORED)) + for (p = f; *p && ! matched; p++) + if (*p == '/' && p[1] != '/') + matched = ((*matcher) (pattern, p + 1, options) == 0); + + return matched; +} + +static bool +exclude_patopts (struct patopts const *opts, char const *f) +{ + int options = opts->options; + + return (options & EXCLUDE_REGEX) + ? regexec (&opts->v.re, f, 0, NULL, 0) == 0 + : exclude_fnmatch (opts->v.pattern, f, options); +} + +/* Return true if the exclude_pattern segment SEG matches F. */ + +static bool +file_pattern_matches (struct exclude_segment const *seg, char const *f) +{ + size_t exclude_count = seg->v.pat.exclude_count; + struct patopts const *exclude = seg->v.pat.exclude; + size_t i; + + for (i = 0; i < exclude_count; i++) + { + if (exclude_patopts (exclude + i, f)) + return true; + } + return false; +} + +/* Return true if the exclude_hash segment SEG matches F. + BUFFER is an auxiliary storage of the same length as F (with nul + terminator included) */ +static bool +file_name_matches (struct exclude_segment const *seg, char const *f, + char *buffer) +{ + int options = seg->options; + Hash_table *table = seg->v.table; + + do + { + /* initialize the pattern */ + strcpy (buffer, f); + + while (1) + { + if (hash_lookup (table, buffer)) + return true; + if (options & FNM_LEADING_DIR) + { + char *p = strrchr (buffer, '/'); + if (p) + { + *p = 0; + continue; + } + } + break; + } + + if (!(options & EXCLUDE_ANCHORED)) + { + f = strchr (f, '/'); + if (f) + f++; + } + else + break; + } + while (f); + + return false; +} + +/* Return true if EX excludes F. */ + +bool +excluded_file_name (struct exclude const *ex, char const *f) +{ + struct exclude_segment *seg; + bool invert = false; + char *filename = NULL; + + /* If no patterns are given, the default is to include. */ + if (!ex->head) + return false; + + /* Scan through the segments, reporting the status of the first match. + The segments are in reverse order, so this reports the status of + the last match in the original option list. */ + for (seg = ex->head; ; seg = seg->next) + { + if (seg->type == exclude_hash) + { + if (!filename) + filename = xmalloc (strlen (f) + 1); + if (file_name_matches (seg, f, filename)) + break; + } + else + { + if (file_pattern_matches (seg, f)) + break; + } + + if (! seg->next) + { + /* If patterns are given but none match, the default is the + opposite of the last segment (i.e., the first in the + original option list). For example, in the command + 'grep -r --exclude="a*" --include="*b" pat dir', the + first option is --exclude so any file name matching + neither a* nor *b is included. */ + invert = true; + break; + } + } + + free (filename); + return invert ^ ! (seg->options & EXCLUDE_INCLUDE); +} + +/* Append to EX the exclusion PATTERN with OPTIONS. */ + +void +add_exclude (struct exclude *ex, char const *pattern, int options) +{ + struct exclude_segment *seg; + struct exclude_pattern *pat; + struct patopts *patopts; + + if ((options & (EXCLUDE_REGEX|EXCLUDE_WILDCARDS)) + && fnmatch_pattern_has_wildcards (pattern, options)) + { + if (! (ex->head && ex->head->type == exclude_pattern + && ((ex->head->options & EXCLUDE_INCLUDE) + == (options & EXCLUDE_INCLUDE)))) + new_exclude_segment (ex, exclude_pattern, options); + + seg = ex->head; + + pat = &seg->v.pat; + if (pat->exclude_count == pat->exclude_alloc) + pat->exclude = x2nrealloc (pat->exclude, &pat->exclude_alloc, + sizeof *pat->exclude); + patopts = &pat->exclude[pat->exclude_count++]; + + patopts->options = options; + if (options & EXCLUDE_REGEX) + { + int rc; + int cflags = REG_NOSUB|REG_EXTENDED| + ((options & FNM_CASEFOLD) ? REG_ICASE : 0); + + if (options & FNM_LEADING_DIR) + { + char *tmp; + size_t len = strlen (pattern); + + while (len > 0 && ISSLASH (pattern[len-1])) + --len; + + if (len == 0) + rc = 1; + else + { + tmp = xmalloc (len + 7); + memcpy (tmp, pattern, len); + strcpy (tmp + len, "(/.*)?"); + rc = regcomp (&patopts->v.re, tmp, cflags); + free (tmp); + } + } + else + rc = regcomp (&patopts->v.re, pattern, cflags); + + if (rc) + { + pat->exclude_count--; + return; + } + } + else + { + if (options & EXCLUDE_ALLOC) + { + pattern = xstrdup (pattern); + exclude_add_pattern_buffer (ex, (char*) pattern); + } + patopts->v.pattern = pattern; + } + } + else + { + char *str, *p; + int exclude_hash_flags = (EXCLUDE_INCLUDE | EXCLUDE_ANCHORED + | FNM_LEADING_DIR | FNM_CASEFOLD); + if (! (ex->head && ex->head->type == exclude_hash + && ((ex->head->options & exclude_hash_flags) + == (options & exclude_hash_flags)))) + new_exclude_segment (ex, exclude_hash, options); + seg = ex->head; + + str = xstrdup (pattern); + if ((options & (EXCLUDE_WILDCARDS | FNM_NOESCAPE)) == EXCLUDE_WILDCARDS) + unescape_pattern (str); + p = hash_insert (seg->v.table, str); + if (p != str) + free (str); + } +} + +/* Use ADD_FUNC to append to EX the patterns in FILE_NAME, each with + OPTIONS. LINE_END terminates each pattern in the file. If + LINE_END is a space character, ignore trailing spaces and empty + lines in FP. Return -1 on failure, 0 on success. */ + +int +add_exclude_fp (void (*add_func) (struct exclude *, char const *, int, void *), + struct exclude *ex, FILE *fp, int options, + char line_end, + void *data) +{ + char *buf = NULL; + char *p; + char *pattern; + char const *lim; + size_t buf_alloc = 0; + size_t buf_count = 0; + int c; + int e = 0; + + while ((c = getc (fp)) != EOF) + { + if (buf_count == buf_alloc) + buf = x2realloc (buf, &buf_alloc); + buf[buf_count++] = c; + } + + if (ferror (fp)) + e = errno; + + buf = xrealloc (buf, buf_count + 1); + buf[buf_count] = line_end; + lim = buf + buf_count + ! (buf_count == 0 || buf[buf_count - 1] == line_end); + + exclude_add_pattern_buffer (ex, buf); + + pattern = buf; + + for (p = buf; p < lim; p++) + if (*p == line_end) + { + char *pattern_end = p; + + if (isspace ((unsigned char) line_end)) + { + for (; ; pattern_end--) + if (pattern_end == pattern) + goto next_pattern; + else if (! isspace ((unsigned char) pattern_end[-1])) + break; + } + + *pattern_end = '\0'; + (*add_func) (ex, pattern, options, data); + + next_pattern: + pattern = p + 1; + } + + errno = e; + return e ? -1 : 0; +} + +static void +call_addfn (struct exclude *ex, char const *pattern, int options, void *data) +{ + void (**addfnptr) (struct exclude *, char const *, int) = data; + (*addfnptr) (ex, pattern, options); +} + +int +add_exclude_file (void (*add_func) (struct exclude *, char const *, int), + struct exclude *ex, char const *file_name, int options, + char line_end) +{ + bool use_stdin = file_name[0] == '-' && !file_name[1]; + FILE *in; + int rc = 0; + + if (use_stdin) + in = stdin; + else if (! (in = fopen (file_name, "r"))) + return -1; + + rc = add_exclude_fp (call_addfn, ex, in, options, line_end, &add_func); + + if (!use_stdin && fclose (in) != 0) + rc = -1; + + return rc; +} diff --git a/local/recipes/tools/diffutils/source/lib/exclude.h b/local/recipes/tools/diffutils/source/lib/exclude.h new file mode 100644 index 0000000000..f95ee89683 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/exclude.h @@ -0,0 +1,62 @@ +/* exclude.h -- declarations for excluding file names + + Copyright (C) 1992-1994, 1997, 1999, 2001-2003, 2005-2006, 2009-2017 Free + Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _GL_EXCLUDE_H +#define _GL_EXCLUDE_H 1 + +#include <stdbool.h> +#include <stdio.h> + +/* Written by Paul Eggert <eggert@twinsun.com> + and Sergey Poznyakoff <gray@gnu.org> */ + +/* Exclude options, which can be ORed with fnmatch options. */ + +/* Patterns must match the start of file names, instead of matching + anywhere after a '/'. */ +#define EXCLUDE_ANCHORED (1 << 30) + +/* Include instead of exclude. */ +#define EXCLUDE_INCLUDE (1 << 29) + +/* '?', '*', '[', and '\\' are special in patterns. Without this + option, these characters are ordinary and fnmatch is not used. */ +#define EXCLUDE_WILDCARDS (1 << 28) + +/* Patterns are POSIX extended regular expressions */ +#define EXCLUDE_REGEX (1 << 27) + +/* Allocate storage for the pattern */ +#define EXCLUDE_ALLOC (1 << 26) + +struct exclude; + +bool fnmatch_pattern_has_wildcards (const char *, int) _GL_ATTRIBUTE_PURE; + +struct exclude *new_exclude (void); +void free_exclude (struct exclude *); +void add_exclude (struct exclude *, char const *, int); +int add_exclude_file (void (*) (struct exclude *, char const *, int), + struct exclude *, char const *, int, char); +int add_exclude_fp (void (*) (struct exclude *, char const *, int, void *), + struct exclude *, FILE *, int, char, void *); +bool excluded_file_name (struct exclude const *, char const *); +void exclude_add_pattern_buffer (struct exclude *ex, char *buf); +bool exclude_fnmatch (char const *, char const *, int); + +#endif /* _GL_EXCLUDE_H */ diff --git a/local/recipes/tools/diffutils/source/lib/exitfail.c b/local/recipes/tools/diffutils/source/lib/exitfail.c new file mode 100644 index 0000000000..524eb5c315 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/exitfail.c @@ -0,0 +1,24 @@ +/* Failure exit status + + Copyright (C) 2002-2003, 2005-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "exitfail.h" + +#include <stdlib.h> + +int volatile exit_failure = EXIT_FAILURE; diff --git a/local/recipes/tools/diffutils/source/lib/exitfail.h b/local/recipes/tools/diffutils/source/lib/exitfail.h new file mode 100644 index 0000000000..895511f49f --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/exitfail.h @@ -0,0 +1,18 @@ +/* Failure exit status + + Copyright (C) 2002, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +extern int volatile exit_failure; diff --git a/local/recipes/tools/diffutils/source/lib/fcntl.c b/local/recipes/tools/diffutils/source/lib/fcntl.c new file mode 100644 index 0000000000..d4dd144e05 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/fcntl.c @@ -0,0 +1,418 @@ +/* Provide file descriptor control. + + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>. */ + +#include <config.h> + +/* Specification. */ +#include <fcntl.h> + +#include <errno.h> +#include <limits.h> +#include <stdarg.h> +#include <unistd.h> + +#if !HAVE_FCNTL +# define rpl_fcntl fcntl +#endif +#undef fcntl + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Get declarations of the native Windows API functions. */ +# define WIN32_LEAN_AND_MEAN +# include <windows.h> + +/* Get _get_osfhandle. */ +# if GNULIB_MSVC_NOTHROW +# include "msvc-nothrow.h" +# else +# include <io.h> +# endif + +/* Upper bound on getdtablesize(). See lib/getdtablesize.c. */ +# define OPEN_MAX_MAX 0x10000 + +/* Duplicate OLDFD into the first available slot of at least NEWFD, + which must be positive, with FLAGS determining whether the duplicate + will be inheritable. */ +static int +dupfd (int oldfd, int newfd, int flags) +{ + /* Mingw has no way to create an arbitrary fd. Iterate until all + file descriptors less than newfd are filled up. */ + HANDLE curr_process = GetCurrentProcess (); + HANDLE old_handle = (HANDLE) _get_osfhandle (oldfd); + unsigned char fds_to_close[OPEN_MAX_MAX / CHAR_BIT]; + unsigned int fds_to_close_bound = 0; + int result; + BOOL inherit = flags & O_CLOEXEC ? FALSE : TRUE; + int mode; + + if (newfd < 0 || getdtablesize () <= newfd) + { + errno = EINVAL; + return -1; + } + if (old_handle == INVALID_HANDLE_VALUE + || (mode = setmode (oldfd, O_BINARY)) == -1) + { + /* oldfd is not open, or is an unassigned standard file + descriptor. */ + errno = EBADF; + return -1; + } + setmode (oldfd, mode); + flags |= mode; + + for (;;) + { + HANDLE new_handle; + int duplicated_fd; + unsigned int index; + + if (!DuplicateHandle (curr_process, /* SourceProcessHandle */ + old_handle, /* SourceHandle */ + curr_process, /* TargetProcessHandle */ + (PHANDLE) &new_handle, /* TargetHandle */ + (DWORD) 0, /* DesiredAccess */ + inherit, /* InheritHandle */ + DUPLICATE_SAME_ACCESS)) /* Options */ + { + switch (GetLastError ()) + { + case ERROR_TOO_MANY_OPEN_FILES: + errno = EMFILE; + break; + case ERROR_INVALID_HANDLE: + case ERROR_INVALID_TARGET_HANDLE: + case ERROR_DIRECT_ACCESS_HANDLE: + errno = EBADF; + break; + case ERROR_INVALID_PARAMETER: + case ERROR_INVALID_FUNCTION: + case ERROR_INVALID_ACCESS: + errno = EINVAL; + break; + default: + errno = EACCES; + break; + } + result = -1; + break; + } + duplicated_fd = _open_osfhandle ((intptr_t) new_handle, flags); + if (duplicated_fd < 0) + { + CloseHandle (new_handle); + result = -1; + break; + } + if (newfd <= duplicated_fd) + { + result = duplicated_fd; + break; + } + + /* Set the bit duplicated_fd in fds_to_close[]. */ + index = (unsigned int) duplicated_fd / CHAR_BIT; + if (fds_to_close_bound <= index) + { + if (sizeof fds_to_close <= index) + /* Need to increase OPEN_MAX_MAX. */ + abort (); + memset (fds_to_close + fds_to_close_bound, '\0', + index + 1 - fds_to_close_bound); + fds_to_close_bound = index + 1; + } + fds_to_close[index] |= 1 << ((unsigned int) duplicated_fd % CHAR_BIT); + } + + /* Close the previous fds that turned out to be too small. */ + { + int saved_errno = errno; + unsigned int duplicated_fd; + + for (duplicated_fd = 0; + duplicated_fd < fds_to_close_bound * CHAR_BIT; + duplicated_fd++) + if ((fds_to_close[duplicated_fd / CHAR_BIT] + >> (duplicated_fd % CHAR_BIT)) + & 1) + close (duplicated_fd); + + errno = saved_errno; + } + +# if REPLACE_FCHDIR + if (0 <= result) + result = _gl_register_dup (oldfd, result); +# endif + return result; +} +#endif /* W32 */ + +#ifdef __KLIBC__ + +# define INCL_DOS +# include <os2.h> + +static int +klibc_fcntl (int fd, int action, /* arg */...) +{ + va_list arg_ptr; + int arg; + struct stat sbuf; + int result = -1; + + va_start (arg_ptr, action); + arg = va_arg (arg_ptr, int); + result = fcntl (fd, action, arg); + /* EPERM for F_DUPFD, ENOTSUP for others */ + if (result == -1 && (errno == EPERM || errno == ENOTSUP) + && !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode)) + { + ULONG ulMode; + + switch (action) + { + case F_DUPFD: + /* Find available fd */ + while (fcntl (arg, F_GETFL) != -1 || errno != EBADF) + arg++; + + result = dup2 (fd, arg); + break; + + /* Using underlying APIs is right ? */ + case F_GETFD: + if (DosQueryFHState (fd, &ulMode)) + break; + + result = (ulMode & OPEN_FLAGS_NOINHERIT) ? FD_CLOEXEC : 0; + break; + + case F_SETFD: + if (arg & ~FD_CLOEXEC) + break; + + if (DosQueryFHState (fd, &ulMode)) + break; + + if (arg & FD_CLOEXEC) + ulMode |= OPEN_FLAGS_NOINHERIT; + else + ulMode &= ~OPEN_FLAGS_NOINHERIT; + + /* Filter supported flags. */ + ulMode &= (OPEN_FLAGS_WRITE_THROUGH | OPEN_FLAGS_FAIL_ON_ERROR + | OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_NOINHERIT); + + if (DosSetFHState (fd, ulMode)) + break; + + result = 0; + break; + + case F_GETFL: + result = 0; + break; + + case F_SETFL: + if (arg != 0) + break; + + result = 0; + break; + + default : + errno = EINVAL; + break; + } + } + + va_end (arg_ptr); + + return result; +} + +# define fcntl klibc_fcntl +#endif + +/* Perform the specified ACTION on the file descriptor FD, possibly + using the argument ARG further described below. This replacement + handles the following actions, and forwards all others on to the + native fcntl. An unrecognized ACTION returns -1 with errno set to + EINVAL. + + F_DUPFD - duplicate FD, with int ARG being the minimum target fd. + If successful, return the duplicate, which will be inheritable; + otherwise return -1 and set errno. + + F_DUPFD_CLOEXEC - duplicate FD, with int ARG being the minimum + target fd. If successful, return the duplicate, which will not be + inheritable; otherwise return -1 and set errno. + + F_GETFD - ARG need not be present. If successful, return a + non-negative value containing the descriptor flags of FD (only + FD_CLOEXEC is portable, but other flags may be present); otherwise + return -1 and set errno. */ + +int +rpl_fcntl (int fd, int action, /* arg */...) +{ + va_list arg; + int result = -1; + va_start (arg, action); + switch (action) + { + +#if !HAVE_FCNTL + case F_DUPFD: + { + int target = va_arg (arg, int); + result = dupfd (fd, target, 0); + break; + } +#elif FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR + case F_DUPFD: + { + int target = va_arg (arg, int); + /* Detect invalid target; needed for cygwin 1.5.x. */ + if (target < 0 || getdtablesize () <= target) + errno = EINVAL; + else + { + /* Haiku alpha 2 loses fd flags on original. */ + int flags = fcntl (fd, F_GETFD); + if (flags < 0) + { + result = -1; + break; + } + result = fcntl (fd, action, target); + if (0 <= result && fcntl (fd, F_SETFD, flags) == -1) + { + int saved_errno = errno; + close (result); + result = -1; + errno = saved_errno; + } +# if REPLACE_FCHDIR + if (0 <= result) + result = _gl_register_dup (fd, result); +# endif + } + break; + } /* F_DUPFD */ +#endif /* FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR */ + + case F_DUPFD_CLOEXEC: + { + int target = va_arg (arg, int); + +#if !HAVE_FCNTL + result = dupfd (fd, target, O_CLOEXEC); + break; +#else /* HAVE_FCNTL */ + /* Try the system call first, if the headers claim it exists + (that is, if GNULIB_defined_F_DUPFD_CLOEXEC is 0), since we + may be running with a glibc that has the macro but with an + older kernel that does not support it. Cache the + information on whether the system call really works, but + avoid caching failure if the corresponding F_DUPFD fails + for any reason. 0 = unknown, 1 = yes, -1 = no. */ + static int have_dupfd_cloexec = GNULIB_defined_F_DUPFD_CLOEXEC ? -1 : 0; + if (0 <= have_dupfd_cloexec) + { + result = fcntl (fd, action, target); + if (0 <= result || errno != EINVAL) + { + have_dupfd_cloexec = 1; +# if REPLACE_FCHDIR + if (0 <= result) + result = _gl_register_dup (fd, result); +# endif + } + else + { + result = rpl_fcntl (fd, F_DUPFD, target); + if (result < 0) + break; + have_dupfd_cloexec = -1; + } + } + else + result = rpl_fcntl (fd, F_DUPFD, target); + if (0 <= result && have_dupfd_cloexec == -1) + { + int flags = fcntl (result, F_GETFD); + if (flags < 0 || fcntl (result, F_SETFD, flags | FD_CLOEXEC) == -1) + { + int saved_errno = errno; + close (result); + errno = saved_errno; + result = -1; + } + } + break; +#endif /* HAVE_FCNTL */ + } /* F_DUPFD_CLOEXEC */ + +#if !HAVE_FCNTL + case F_GETFD: + { +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + HANDLE handle = (HANDLE) _get_osfhandle (fd); + DWORD flags; + if (handle == INVALID_HANDLE_VALUE + || GetHandleInformation (handle, &flags) == 0) + errno = EBADF; + else + result = (flags & HANDLE_FLAG_INHERIT) ? 0 : FD_CLOEXEC; +# else /* !W32 */ + /* Use dup2 to reject invalid file descriptors. No way to + access this information, so punt. */ + if (0 <= dup2 (fd, fd)) + result = 0; +# endif /* !W32 */ + break; + } /* F_GETFD */ +#endif /* !HAVE_FCNTL */ + + /* Implementing F_SETFD on mingw is not trivial - there is no + API for changing the O_NOINHERIT bit on an fd, and merely + changing the HANDLE_FLAG_INHERIT bit on the underlying handle + can lead to odd state. It may be possible by duplicating the + handle, using _open_osfhandle with the right flags, then + using dup2 to move the duplicate onto the original, but that + is not supported for now. */ + + default: + { +#if HAVE_FCNTL + void *p = va_arg (arg, void *); + result = fcntl (fd, action, p); +#else + errno = EINVAL; +#endif + break; + } + } + va_end (arg); + return result; +} diff --git a/local/recipes/tools/diffutils/source/lib/fcntl.in.h b/local/recipes/tools/diffutils/source/lib/fcntl.in.h new file mode 100644 index 0000000000..4a1d40af6d --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/fcntl.in.h @@ -0,0 +1,363 @@ +/* Like <fcntl.h>, but with non-working flags defined to 0. + + Copyright (C) 2006-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* written by Paul Eggert */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#if defined __need_system_fcntl_h +/* Special invocation convention. */ + +/* Needed before <sys/stat.h>. + May also define off_t to a 64-bit type on native Windows. */ +#include <sys/types.h> +/* On some systems other than glibc, <sys/stat.h> is a prerequisite of + <fcntl.h>. On glibc systems, we would like to avoid namespace pollution. + But on glibc systems, <fcntl.h> includes <sys/stat.h> inside an + extern "C" { ... } block, which leads to errors in C++ mode with the + overridden <sys/stat.h> from gnulib. These errors are known to be gone + with g++ version >= 4.3. */ +#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && (defined __ICC || !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))) +# include <sys/stat.h> +#endif +#@INCLUDE_NEXT@ @NEXT_FCNTL_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_FCNTL_H + +/* Needed before <sys/stat.h>. + May also define off_t to a 64-bit type on native Windows. */ +#include <sys/types.h> +/* On some systems other than glibc, <sys/stat.h> is a prerequisite of + <fcntl.h>. On glibc systems, we would like to avoid namespace pollution. + But on glibc systems, <fcntl.h> includes <sys/stat.h> inside an + extern "C" { ... } block, which leads to errors in C++ mode with the + overridden <sys/stat.h> from gnulib. These errors are known to be gone + with g++ version >= 4.3. */ +#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && (defined __ICC || !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))) +# include <sys/stat.h> +#endif +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_FCNTL_H@ + +#ifndef _@GUARD_PREFIX@_FCNTL_H +#define _@GUARD_PREFIX@_FCNTL_H + +#ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */ +# include <unistd.h> +#endif + +/* Native Windows platforms declare open(), creat() in <io.h>. */ +#if (@GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \ + && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +# include <io.h> +#endif + + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + + +/* Declare overridden functions. */ + +#if @GNULIB_FCNTL@ +# if @REPLACE_FCNTL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fcntl +# define fcntl rpl_fcntl +# endif +_GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...)); +_GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...)); +# else +# if !@HAVE_FCNTL@ +_GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...)); +# endif +_GL_CXXALIAS_SYS (fcntl, int, (int fd, int action, ...)); +# endif +_GL_CXXALIASWARN (fcntl); +#elif defined GNULIB_POSIXCHECK +# undef fcntl +# if HAVE_RAW_DECL_FCNTL +_GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - " + "use gnulib module fcntl for portability"); +# endif +#endif + +#if @GNULIB_OPEN@ +# if @REPLACE_OPEN@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef open +# define open rpl_open +# endif +_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); +# else +_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); +# endif +/* On HP-UX 11, in C++ mode, open() is defined as an inline function with a + default argument. _GL_CXXALIASWARN does not work in this case. */ +# if !defined __hpux +_GL_CXXALIASWARN (open); +# endif +#elif defined GNULIB_POSIXCHECK +# undef open +/* Assume open is always declared. */ +_GL_WARN_ON_USE (open, "open is not always POSIX compliant - " + "use gnulib module open for portability"); +#endif + +#if @GNULIB_OPENAT@ +# if @REPLACE_OPENAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef openat +# define openat rpl_openat +# endif +_GL_FUNCDECL_RPL (openat, int, + (int fd, char const *file, int flags, /* mode_t mode */ ...) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (openat, int, + (int fd, char const *file, int flags, /* mode_t mode */ ...)); +# else +# if !@HAVE_OPENAT@ +_GL_FUNCDECL_SYS (openat, int, + (int fd, char const *file, int flags, /* mode_t mode */ ...) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (openat, int, + (int fd, char const *file, int flags, /* mode_t mode */ ...)); +# endif +_GL_CXXALIASWARN (openat); +#elif defined GNULIB_POSIXCHECK +# undef openat +# if HAVE_RAW_DECL_OPENAT +_GL_WARN_ON_USE (openat, "openat is not portable - " + "use gnulib module openat for portability"); +# endif +#endif + + +/* Fix up the FD_* macros, only known to be missing on mingw. */ + +#ifndef FD_CLOEXEC +# define FD_CLOEXEC 1 +#endif + +/* Fix up the supported F_* macros. Intentionally leave other F_* + macros undefined. Only known to be missing on mingw. */ + +#ifndef F_DUPFD_CLOEXEC +# define F_DUPFD_CLOEXEC 0x40000000 +/* Witness variable: 1 if gnulib defined F_DUPFD_CLOEXEC, 0 otherwise. */ +# define GNULIB_defined_F_DUPFD_CLOEXEC 1 +#else +# define GNULIB_defined_F_DUPFD_CLOEXEC 0 +#endif + +#ifndef F_DUPFD +# define F_DUPFD 1 +#endif + +#ifndef F_GETFD +# define F_GETFD 2 +#endif + +/* Fix up the O_* macros. */ + +/* AIX 7.1 with XL C 12.1 defines O_CLOEXEC, O_NOFOLLOW, and O_TTY_INIT + to values outside 'int' range, so omit these misdefinitions. + But avoid namespace pollution on non-AIX systems. */ +#ifdef _AIX +# include <limits.h> +# if defined O_CLOEXEC && ! (INT_MIN <= O_CLOEXEC && O_CLOEXEC <= INT_MAX) +# undef O_CLOEXEC +# endif +# if defined O_NOFOLLOW && ! (INT_MIN <= O_NOFOLLOW && O_NOFOLLOW <= INT_MAX) +# undef O_NOFOLLOW +# endif +# if defined O_TTY_INIT && ! (INT_MIN <= O_TTY_INIT && O_TTY_INIT <= INT_MAX) +# undef O_TTY_INIT +# endif +#endif + +#if !defined O_DIRECT && defined O_DIRECTIO +/* Tru64 spells it 'O_DIRECTIO'. */ +# define O_DIRECT O_DIRECTIO +#endif + +#if !defined O_CLOEXEC && defined O_NOINHERIT +/* Mingw spells it 'O_NOINHERIT'. */ +# define O_CLOEXEC O_NOINHERIT +#endif + +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + +#ifndef O_DIRECT +# define O_DIRECT 0 +#endif + +#ifndef O_DIRECTORY +# define O_DIRECTORY 0 +#endif + +#ifndef O_DSYNC +# define O_DSYNC 0 +#endif + +#ifndef O_EXEC +# define O_EXEC O_RDONLY /* This is often close enough in older systems. */ +#endif + +#ifndef O_IGNORE_CTTY +# define O_IGNORE_CTTY 0 +#endif + +#ifndef O_NDELAY +# define O_NDELAY 0 +#endif + +#ifndef O_NOATIME +# define O_NOATIME 0 +#endif + +#ifndef O_NONBLOCK +# define O_NONBLOCK O_NDELAY +#endif + +/* If the gnulib module 'nonblocking' is in use, guarantee a working non-zero + value of O_NONBLOCK. Otherwise, O_NONBLOCK is defined (above) to O_NDELAY + or to 0 as fallback. */ +#if @GNULIB_NONBLOCKING@ +# if O_NONBLOCK +# define GNULIB_defined_O_NONBLOCK 0 +# else +# define GNULIB_defined_O_NONBLOCK 1 +# undef O_NONBLOCK +# define O_NONBLOCK 0x40000000 +# endif +#endif + +#ifndef O_NOCTTY +# define O_NOCTTY 0 +#endif + +#ifndef O_NOFOLLOW +# define O_NOFOLLOW 0 +#endif + +#ifndef O_NOLINK +# define O_NOLINK 0 +#endif + +#ifndef O_NOLINKS +# define O_NOLINKS 0 +#endif + +#ifndef O_NOTRANS +# define O_NOTRANS 0 +#endif + +#ifndef O_RSYNC +# define O_RSYNC 0 +#endif + +#ifndef O_SEARCH +# define O_SEARCH O_RDONLY /* This is often close enough in older systems. */ +#endif + +#ifndef O_SYNC +# define O_SYNC 0 +#endif + +#ifndef O_TTY_INIT +# define O_TTY_INIT 0 +#endif + +#if ~O_ACCMODE & (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH) +# undef O_ACCMODE +# define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH) +#endif + +/* For systems that distinguish between text and binary I/O. + O_BINARY is usually declared in fcntl.h */ +#if !defined O_BINARY && defined _O_BINARY + /* For MSC-compatible compilers. */ +# define O_BINARY _O_BINARY +# define O_TEXT _O_TEXT +#endif + +#if defined __BEOS__ || defined __HAIKU__ + /* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect. */ +# undef O_BINARY +# undef O_TEXT +#endif + +#ifndef O_BINARY +# define O_BINARY 0 +# define O_TEXT 0 +#endif + +/* Fix up the AT_* macros. */ + +/* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its + value exceeds INT_MAX, so its use as an int doesn't conform to the + C standard, and GCC and Sun C complain in some cases. If the bug + is present, undef AT_FDCWD here, so it can be redefined below. */ +#if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553 +# undef AT_FDCWD +#endif + +/* Use the same bit pattern as Solaris 9, but with the proper + signedness. The bit pattern is important, in case this actually is + Solaris with the above workaround. */ +#ifndef AT_FDCWD +# define AT_FDCWD (-3041965) +#endif + +/* Use the same values as Solaris 9. This shouldn't matter, but + there's no real reason to differ. */ +#ifndef AT_SYMLINK_NOFOLLOW +# define AT_SYMLINK_NOFOLLOW 4096 +#endif + +#ifndef AT_REMOVEDIR +# define AT_REMOVEDIR 1 +#endif + +/* Solaris 9 lacks these two, so just pick unique values. */ +#ifndef AT_SYMLINK_FOLLOW +# define AT_SYMLINK_FOLLOW 2 +#endif + +#ifndef AT_EACCESS +# define AT_EACCESS 4 +#endif + + +#endif /* _@GUARD_PREFIX@_FCNTL_H */ +#endif /* _@GUARD_PREFIX@_FCNTL_H */ +#endif diff --git a/local/recipes/tools/diffutils/source/lib/fd-hook.c b/local/recipes/tools/diffutils/source/lib/fd-hook.c new file mode 100644 index 0000000000..ab5847ac63 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/fd-hook.c @@ -0,0 +1,116 @@ +/* Hook for making making file descriptor functions close(), ioctl() extensible. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2009. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "fd-hook.h" + +#include <stdlib.h> + +/* Currently, this entire code is only needed for the handling of sockets + on native Windows platforms. */ +#if WINDOWS_SOCKETS + +/* The first and last link in the doubly linked list. + Initially the list is empty. */ +static struct fd_hook anchor = { &anchor, &anchor, NULL, NULL }; + +int +execute_close_hooks (const struct fd_hook *remaining_list, gl_close_fn primary, + int fd) +{ + if (remaining_list == &anchor) + /* End of list reached. */ + return primary (fd); + else + return remaining_list->private_close_fn (remaining_list->private_next, + primary, fd); +} + +int +execute_all_close_hooks (gl_close_fn primary, int fd) +{ + return execute_close_hooks (anchor.private_next, primary, fd); +} + +int +execute_ioctl_hooks (const struct fd_hook *remaining_list, gl_ioctl_fn primary, + int fd, int request, void *arg) +{ + if (remaining_list == &anchor) + /* End of list reached. */ + return primary (fd, request, arg); + else + return remaining_list->private_ioctl_fn (remaining_list->private_next, + primary, fd, request, arg); +} + +int +execute_all_ioctl_hooks (gl_ioctl_fn primary, + int fd, int request, void *arg) +{ + return execute_ioctl_hooks (anchor.private_next, primary, fd, request, arg); +} + +void +register_fd_hook (close_hook_fn close_hook, ioctl_hook_fn ioctl_hook, struct fd_hook *link) +{ + if (close_hook == NULL) + close_hook = execute_close_hooks; + if (ioctl_hook == NULL) + ioctl_hook = execute_ioctl_hooks; + + if (link->private_next == NULL && link->private_prev == NULL) + { + /* Add the link to the doubly linked list. */ + link->private_next = anchor.private_next; + link->private_prev = &anchor; + link->private_close_fn = close_hook; + link->private_ioctl_fn = ioctl_hook; + anchor.private_next->private_prev = link; + anchor.private_next = link; + } + else + { + /* The link is already in use. */ + if (link->private_close_fn != close_hook + || link->private_ioctl_fn != ioctl_hook) + abort (); + } +} + +void +unregister_fd_hook (struct fd_hook *link) +{ + struct fd_hook *next = link->private_next; + struct fd_hook *prev = link->private_prev; + + if (next != NULL && prev != NULL) + { + /* The link is in use. Remove it from the doubly linked list. */ + prev->private_next = next; + next->private_prev = prev; + /* Clear the link, to mark it unused. */ + link->private_next = NULL; + link->private_prev = NULL; + link->private_close_fn = NULL; + link->private_ioctl_fn = NULL; + } +} + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/fd-hook.h b/local/recipes/tools/diffutils/source/lib/fd-hook.h new file mode 100644 index 0000000000..fe0d1b04e6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/fd-hook.h @@ -0,0 +1,119 @@ +/* Hook for making making file descriptor functions close(), ioctl() extensible. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + + +#ifndef FD_HOOK_H +#define FD_HOOK_H + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Currently, this entire code is only needed for the handling of sockets + on native Windows platforms. */ +#if WINDOWS_SOCKETS + + +/* Type of function that closes FD. */ +typedef int (*gl_close_fn) (int fd); + +/* Type of function that applies a control request to FD. */ +typedef int (*gl_ioctl_fn) (int fd, int request, void *arg); + +/* An element of the list of file descriptor hooks. + In CLOS (Common Lisp Object System) speak, it consists of an "around" + method for the close() function and an "around" method for the ioctl() + function. + The fields of this structure are considered private. */ +struct fd_hook +{ + /* Doubly linked list. */ + struct fd_hook *private_next; + struct fd_hook *private_prev; + /* Function that treats the types of FD that it knows about and calls + execute_close_hooks (REMAINING_LIST, PRIMARY, FD) as a fallback. */ + int (*private_close_fn) (const struct fd_hook *remaining_list, + gl_close_fn primary, + int fd); + /* Function that treats the types of FD that it knows about and calls + execute_ioctl_hooks (REMAINING_LIST, PRIMARY, FD, REQUEST, ARG) as a + fallback. */ + int (*private_ioctl_fn) (const struct fd_hook *remaining_list, + gl_ioctl_fn primary, + int fd, int request, void *arg); +}; + +/* This type of function closes FD, applying special knowledge for the FD + types it knows about, and calls + execute_close_hooks (REMAINING_LIST, PRIMARY, FD) + for the other FD types. + In CLOS speak, REMAINING_LIST is the remaining list of "around" methods, + and PRIMARY is the "primary" method for close(). */ +typedef int (*close_hook_fn) (const struct fd_hook *remaining_list, + gl_close_fn primary, + int fd); + +/* Execute the close hooks in REMAINING_LIST, with PRIMARY as "primary" method. + Return 0 or -1, like close() would do. */ +extern int execute_close_hooks (const struct fd_hook *remaining_list, + gl_close_fn primary, + int fd); + +/* Execute all close hooks, with PRIMARY as "primary" method. + Return 0 or -1, like close() would do. */ +extern int execute_all_close_hooks (gl_close_fn primary, int fd); + +/* This type of function applies a control request to FD, applying special + knowledge for the FD types it knows about, and calls + execute_ioctl_hooks (REMAINING_LIST, PRIMARY, FD, REQUEST, ARG) + for the other FD types. + In CLOS speak, REMAINING_LIST is the remaining list of "around" methods, + and PRIMARY is the "primary" method for ioctl(). */ +typedef int (*ioctl_hook_fn) (const struct fd_hook *remaining_list, + gl_ioctl_fn primary, + int fd, int request, void *arg); + +/* Execute the ioctl hooks in REMAINING_LIST, with PRIMARY as "primary" method. + Return 0 or -1, like ioctl() would do. */ +extern int execute_ioctl_hooks (const struct fd_hook *remaining_list, + gl_ioctl_fn primary, + int fd, int request, void *arg); + +/* Execute all ioctl hooks, with PRIMARY as "primary" method. + Return 0 or -1, like ioctl() would do. */ +extern int execute_all_ioctl_hooks (gl_ioctl_fn primary, + int fd, int request, void *arg); + +/* Add a function pair to the list of file descriptor hooks. + CLOSE_HOOK and IOCTL_HOOK may be NULL, indicating no change. + The LINK variable points to a piece of memory which is guaranteed to be + accessible until the corresponding call to unregister_fd_hook. */ +extern void register_fd_hook (close_hook_fn close_hook, ioctl_hook_fn ioctl_hook, + struct fd_hook *link); + +/* Removes a hook from the list of file descriptor hooks. */ +extern void unregister_fd_hook (struct fd_hook *link); + + +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* FD_HOOK_H */ diff --git a/local/recipes/tools/diffutils/source/lib/file-type.c b/local/recipes/tools/diffutils/source/lib/file-type.c new file mode 100644 index 0000000000..1c1f49bef3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/file-type.c @@ -0,0 +1,111 @@ +/* Return a string describing the type of a file. + + Copyright (C) 1993-1994, 2001-2002, 2004-2006, 2009-2017 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +#include <config.h> + +#include "file-type.h" + +#include <gettext.h> +#define _(text) gettext (text) + +char const * +file_type (struct stat const *st) +{ + /* See POSIX 1003.1-2001 XCU Table 4-8 lines 17093-17107 for some of + these formats. + + To keep diagnostics grammatical in English, the returned string + must start with a consonant. */ + + /* Do these three first, as they're the most common. */ + + if (S_ISREG (st->st_mode)) + return st->st_size == 0 ? _("regular empty file") : _("regular file"); + + if (S_ISDIR (st->st_mode)) + return _("directory"); + + if (S_ISLNK (st->st_mode)) + return _("symbolic link"); + + /* Do the S_TYPEIS* macros next, as they may be implemented in terms + of S_ISNAM, and we want the more-specialized interpretation. */ + + if (S_TYPEISMQ (st)) + return _("message queue"); + + if (S_TYPEISSEM (st)) + return _("semaphore"); + + if (S_TYPEISSHM (st)) + return _("shared memory object"); + + if (S_TYPEISTMO (st)) + return _("typed memory object"); + + /* The remaining are in alphabetical order. */ + + if (S_ISBLK (st->st_mode)) + return _("block special file"); + + if (S_ISCHR (st->st_mode)) + return _("character special file"); + + if (S_ISCTG (st->st_mode)) + return _("contiguous data"); + + if (S_ISFIFO (st->st_mode)) + return _("fifo"); + + if (S_ISDOOR (st->st_mode)) + return _("door"); + + if (S_ISMPB (st->st_mode)) + return _("multiplexed block special file"); + + if (S_ISMPC (st->st_mode)) + return _("multiplexed character special file"); + + if (S_ISMPX (st->st_mode)) + return _("multiplexed file"); + + if (S_ISNAM (st->st_mode)) + return _("named file"); + + if (S_ISNWK (st->st_mode)) + return _("network special file"); + + if (S_ISOFD (st->st_mode)) + return _("migrated file with data"); + + if (S_ISOFL (st->st_mode)) + return _("migrated file without data"); + + if (S_ISPORT (st->st_mode)) + return _("port"); + + if (S_ISSOCK (st->st_mode)) + return _("socket"); + + if (S_ISWHT (st->st_mode)) + return _("whiteout"); + + return _("weird file"); +} diff --git a/local/recipes/tools/diffutils/source/lib/file-type.h b/local/recipes/tools/diffutils/source/lib/file-type.h new file mode 100644 index 0000000000..de66cf7263 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/file-type.h @@ -0,0 +1,29 @@ +/* Return a string describing the type of a file. + + Copyright (C) 1993-1994, 2001-2002, 2004-2005, 2009-2017 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert and Jim Meyering. */ + +#ifndef FILE_TYPE_H +# define FILE_TYPE_H 1 + +# include <sys/types.h> +# include <sys/stat.h> + +char const *file_type (struct stat const *) _GL_ATTRIBUTE_PURE; + +#endif /* FILE_TYPE_H */ diff --git a/local/recipes/tools/diffutils/source/lib/filename.h b/local/recipes/tools/diffutils/source/lib/filename.h new file mode 100644 index 0000000000..0ea7e95600 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/filename.h @@ -0,0 +1,54 @@ +/* Basic filename support macros. + Copyright (C) 2001-2004, 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _FILENAME_H +#define _FILENAME_H + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Pathname support. + ISSLASH(C) tests whether C is a directory separator character. + IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not, + it may be concatenated to a directory pathname. + IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. + */ +#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ + /* Native Windows, Cygwin, OS/2, DOS */ +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +# define HAS_DEVICE(P) \ + ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ + && (P)[1] == ':') +# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P)) +# define IS_PATH_WITH_DIR(P) \ + (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P)) +# define FILE_SYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0) +#else + /* Unix */ +# define ISSLASH(C) ((C) == '/') +# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0]) +# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) +# define FILE_SYSTEM_PREFIX_LEN(P) 0 +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _FILENAME_H */ diff --git a/local/recipes/tools/diffutils/source/lib/filenamecat-lgpl.c b/local/recipes/tools/diffutils/source/lib/filenamecat-lgpl.c new file mode 100644 index 0000000000..6dade120be --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/filenamecat-lgpl.c @@ -0,0 +1,88 @@ +/* Concatenate two arbitrary file names. + + Copyright (C) 1996-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Jim Meyering. */ + +#include <config.h> + +/* Specification. */ +#include "filenamecat.h" + +#include <stdlib.h> +#include <string.h> + +#include "dirname.h" + +#if ! HAVE_MEMPCPY && ! defined mempcpy +# define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N))) +#endif + +/* Return the longest suffix of F that is a relative file name. + If it has no such suffix, return the empty string. */ + +static char const * _GL_ATTRIBUTE_PURE +longest_relative_suffix (char const *f) +{ + for (f += FILE_SYSTEM_PREFIX_LEN (f); ISSLASH (*f); f++) + continue; + return f; +} + +/* Concatenate two file name components, DIR and ABASE, in + newly-allocated storage and return the result. + The resulting file name F is such that the commands "ls F" and "(cd + DIR; ls BASE)" refer to the same file, where BASE is ABASE with any + file system prefixes and leading separators removed. + Arrange for a directory separator if necessary between DIR and BASE + in the result, removing any redundant separators. + In any case, if BASE_IN_RESULT is non-NULL, set + *BASE_IN_RESULT to point to the copy of ABASE in the returned + concatenation. However, if ABASE begins with more than one slash, + set *BASE_IN_RESULT to point to the sole corresponding slash that + is copied into the result buffer. + + Return NULL if malloc fails. */ + +char * +mfile_name_concat (char const *dir, char const *abase, char **base_in_result) +{ + char const *dirbase = last_component (dir); + size_t dirbaselen = base_len (dirbase); + size_t dirlen = dirbase - dir + dirbaselen; + size_t needs_separator = (dirbaselen && ! ISSLASH (dirbase[dirbaselen - 1])); + + char const *base = longest_relative_suffix (abase); + size_t baselen = strlen (base); + + char *p_concat = malloc (dirlen + needs_separator + baselen + 1); + char *p; + + if (p_concat == NULL) + return NULL; + + p = mempcpy (p_concat, dir, dirlen); + *p = DIRECTORY_SEPARATOR; + p += needs_separator; + + if (base_in_result) + *base_in_result = p - IS_ABSOLUTE_FILE_NAME (abase); + + p = mempcpy (p, base, baselen); + *p = '\0'; + + return p_concat; +} diff --git a/local/recipes/tools/diffutils/source/lib/filenamecat.c b/local/recipes/tools/diffutils/source/lib/filenamecat.c new file mode 100644 index 0000000000..e245973fb9 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/filenamecat.c @@ -0,0 +1,41 @@ +/* Concatenate two arbitrary file names. + + Copyright (C) 1996-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Jim Meyering. */ + +#include <config.h> + +/* Specification. */ +#include "filenamecat.h" + +#include <stdlib.h> +#include <string.h> + +#include "xalloc.h" + +/* Just like mfile_name_concat (filenamecat-lgpl.c), except, rather than + returning NULL upon malloc failure, here, we report the + "memory exhausted" condition and exit. */ + +char * +file_name_concat (char const *dir, char const *abase, char **base_in_result) +{ + char *p = mfile_name_concat (dir, abase, base_in_result); + if (p == NULL) + xalloc_die (); + return p; +} diff --git a/local/recipes/tools/diffutils/source/lib/filenamecat.h b/local/recipes/tools/diffutils/source/lib/filenamecat.h new file mode 100644 index 0000000000..feb906af02 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/filenamecat.h @@ -0,0 +1,27 @@ +/* Concatenate two arbitrary file names. + + Copyright (C) 1996-1997, 2003, 2005, 2007, 2009-2017 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Jim Meyering. */ + +#if GNULIB_FILENAMECAT +char *file_name_concat (char const *dir, char const *base, + char **base_in_result); +#endif + +char *mfile_name_concat (char const *dir, char const *base, + char **base_in_result); diff --git a/local/recipes/tools/diffutils/source/lib/flexmember.h b/local/recipes/tools/diffutils/source/lib/flexmember.h new file mode 100644 index 0000000000..c71ea65103 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/flexmember.h @@ -0,0 +1,42 @@ +/* Sizes of structs with flexible array members. + + Copyright 2016-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + Written by Paul Eggert. */ + +#include <stddef.h> + +/* Nonzero multiple of alignment of TYPE, suitable for FLEXSIZEOF below. + On older platforms without _Alignof, use a pessimistic bound that is + safe in practice even if FLEXIBLE_ARRAY_MEMBER is 1. + On newer platforms, use _Alignof to get a tighter bound. */ + +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 +# define FLEXALIGNOF(type) (sizeof (type) & ~ (sizeof (type) - 1)) +#else +# define FLEXALIGNOF(type) _Alignof (type) +#endif + +/* Upper bound on the size of a struct of type TYPE with a flexible + array member named MEMBER that is followed by N bytes of other data. + This is not simply sizeof (TYPE) + N, since it may require + alignment on unusually picky C11 platforms, and + FLEXIBLE_ARRAY_MEMBER may be 1 on pre-C11 platforms. + Yield a value less than N if and only if arithmetic overflow occurs. */ + +#define FLEXSIZEOF(type, member, n) \ + ((offsetof (type, member) + FLEXALIGNOF (type) - 1 + (n)) \ + & ~ (FLEXALIGNOF (type) - 1)) diff --git a/local/recipes/tools/diffutils/source/lib/float+.h b/local/recipes/tools/diffutils/source/lib/float+.h new file mode 100644 index 0000000000..ba8ecb7b5e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/float+.h @@ -0,0 +1,147 @@ +/* Supplemental information about the floating-point formats. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2007. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _FLOATPLUS_H +#define _FLOATPLUS_H + +#include <float.h> +#include <limits.h> + +/* Number of bits in the mantissa of a floating-point number, including the + "hidden bit". */ +#if FLT_RADIX == 2 +# define FLT_MANT_BIT FLT_MANT_DIG +# define DBL_MANT_BIT DBL_MANT_DIG +# define LDBL_MANT_BIT LDBL_MANT_DIG +#elif FLT_RADIX == 4 +# define FLT_MANT_BIT (FLT_MANT_DIG * 2) +# define DBL_MANT_BIT (DBL_MANT_DIG * 2) +# define LDBL_MANT_BIT (LDBL_MANT_DIG * 2) +#elif FLT_RADIX == 16 +# define FLT_MANT_BIT (FLT_MANT_DIG * 4) +# define DBL_MANT_BIT (DBL_MANT_DIG * 4) +# define LDBL_MANT_BIT (LDBL_MANT_DIG * 4) +#endif + +/* Bit mask that can be used to mask the exponent, as an unsigned number. */ +#define FLT_EXP_MASK ((FLT_MAX_EXP - FLT_MIN_EXP) | 7) +#define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7) +#define LDBL_EXP_MASK ((LDBL_MAX_EXP - LDBL_MIN_EXP) | 7) + +/* Number of bits used for the exponent of a floating-point number, including + the exponent's sign. */ +#define FLT_EXP_BIT \ + (FLT_EXP_MASK < 0x100 ? 8 : \ + FLT_EXP_MASK < 0x200 ? 9 : \ + FLT_EXP_MASK < 0x400 ? 10 : \ + FLT_EXP_MASK < 0x800 ? 11 : \ + FLT_EXP_MASK < 0x1000 ? 12 : \ + FLT_EXP_MASK < 0x2000 ? 13 : \ + FLT_EXP_MASK < 0x4000 ? 14 : \ + FLT_EXP_MASK < 0x8000 ? 15 : \ + FLT_EXP_MASK < 0x10000 ? 16 : \ + FLT_EXP_MASK < 0x20000 ? 17 : \ + FLT_EXP_MASK < 0x40000 ? 18 : \ + FLT_EXP_MASK < 0x80000 ? 19 : \ + FLT_EXP_MASK < 0x100000 ? 20 : \ + FLT_EXP_MASK < 0x200000 ? 21 : \ + FLT_EXP_MASK < 0x400000 ? 22 : \ + FLT_EXP_MASK < 0x800000 ? 23 : \ + FLT_EXP_MASK < 0x1000000 ? 24 : \ + FLT_EXP_MASK < 0x2000000 ? 25 : \ + FLT_EXP_MASK < 0x4000000 ? 26 : \ + FLT_EXP_MASK < 0x8000000 ? 27 : \ + FLT_EXP_MASK < 0x10000000 ? 28 : \ + FLT_EXP_MASK < 0x20000000 ? 29 : \ + FLT_EXP_MASK < 0x40000000 ? 30 : \ + FLT_EXP_MASK <= 0x7fffffff ? 31 : \ + 32) +#define DBL_EXP_BIT \ + (DBL_EXP_MASK < 0x100 ? 8 : \ + DBL_EXP_MASK < 0x200 ? 9 : \ + DBL_EXP_MASK < 0x400 ? 10 : \ + DBL_EXP_MASK < 0x800 ? 11 : \ + DBL_EXP_MASK < 0x1000 ? 12 : \ + DBL_EXP_MASK < 0x2000 ? 13 : \ + DBL_EXP_MASK < 0x4000 ? 14 : \ + DBL_EXP_MASK < 0x8000 ? 15 : \ + DBL_EXP_MASK < 0x10000 ? 16 : \ + DBL_EXP_MASK < 0x20000 ? 17 : \ + DBL_EXP_MASK < 0x40000 ? 18 : \ + DBL_EXP_MASK < 0x80000 ? 19 : \ + DBL_EXP_MASK < 0x100000 ? 20 : \ + DBL_EXP_MASK < 0x200000 ? 21 : \ + DBL_EXP_MASK < 0x400000 ? 22 : \ + DBL_EXP_MASK < 0x800000 ? 23 : \ + DBL_EXP_MASK < 0x1000000 ? 24 : \ + DBL_EXP_MASK < 0x2000000 ? 25 : \ + DBL_EXP_MASK < 0x4000000 ? 26 : \ + DBL_EXP_MASK < 0x8000000 ? 27 : \ + DBL_EXP_MASK < 0x10000000 ? 28 : \ + DBL_EXP_MASK < 0x20000000 ? 29 : \ + DBL_EXP_MASK < 0x40000000 ? 30 : \ + DBL_EXP_MASK <= 0x7fffffff ? 31 : \ + 32) +#define LDBL_EXP_BIT \ + (LDBL_EXP_MASK < 0x100 ? 8 : \ + LDBL_EXP_MASK < 0x200 ? 9 : \ + LDBL_EXP_MASK < 0x400 ? 10 : \ + LDBL_EXP_MASK < 0x800 ? 11 : \ + LDBL_EXP_MASK < 0x1000 ? 12 : \ + LDBL_EXP_MASK < 0x2000 ? 13 : \ + LDBL_EXP_MASK < 0x4000 ? 14 : \ + LDBL_EXP_MASK < 0x8000 ? 15 : \ + LDBL_EXP_MASK < 0x10000 ? 16 : \ + LDBL_EXP_MASK < 0x20000 ? 17 : \ + LDBL_EXP_MASK < 0x40000 ? 18 : \ + LDBL_EXP_MASK < 0x80000 ? 19 : \ + LDBL_EXP_MASK < 0x100000 ? 20 : \ + LDBL_EXP_MASK < 0x200000 ? 21 : \ + LDBL_EXP_MASK < 0x400000 ? 22 : \ + LDBL_EXP_MASK < 0x800000 ? 23 : \ + LDBL_EXP_MASK < 0x1000000 ? 24 : \ + LDBL_EXP_MASK < 0x2000000 ? 25 : \ + LDBL_EXP_MASK < 0x4000000 ? 26 : \ + LDBL_EXP_MASK < 0x8000000 ? 27 : \ + LDBL_EXP_MASK < 0x10000000 ? 28 : \ + LDBL_EXP_MASK < 0x20000000 ? 29 : \ + LDBL_EXP_MASK < 0x40000000 ? 30 : \ + LDBL_EXP_MASK <= 0x7fffffff ? 31 : \ + 32) + +/* Number of bits used for a floating-point number: the mantissa (not + counting the "hidden bit", since it may or may not be explicit), the + exponent, and the sign. */ +#define FLT_TOTAL_BIT ((FLT_MANT_BIT - 1) + FLT_EXP_BIT + 1) +#define DBL_TOTAL_BIT ((DBL_MANT_BIT - 1) + DBL_EXP_BIT + 1) +#define LDBL_TOTAL_BIT ((LDBL_MANT_BIT - 1) + LDBL_EXP_BIT + 1) + +/* Number of bytes used for a floating-point number. + This can be smaller than the 'sizeof'. For example, on i386 systems, + 'long double' most often have LDBL_MANT_BIT = 64, LDBL_EXP_BIT = 16, hence + LDBL_TOTAL_BIT = 80 bits, i.e. 10 bytes of consecutive memory, but + sizeof (long double) = 12 or = 16. */ +#define SIZEOF_FLT ((FLT_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT) +#define SIZEOF_DBL ((DBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT) +#define SIZEOF_LDBL ((LDBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT) + +/* Verify that SIZEOF_FLT <= sizeof (float) etc. */ +typedef int verify_sizeof_flt[SIZEOF_FLT <= sizeof (float) ? 1 : -1]; +typedef int verify_sizeof_dbl[SIZEOF_DBL <= sizeof (double) ? 1 : - 1]; +typedef int verify_sizeof_ldbl[SIZEOF_LDBL <= sizeof (long double) ? 1 : - 1]; + +#endif /* _FLOATPLUS_H */ diff --git a/local/recipes/tools/diffutils/source/lib/float.c b/local/recipes/tools/diffutils/source/lib/float.c new file mode 100644 index 0000000000..b9103ecff2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/float.c @@ -0,0 +1,33 @@ +/* Auxiliary definitions for <float.h>. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2011. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <float.h> + +#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__ +const union gl_long_double_union gl_LDBL_MAX = + { { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL } }; +#elif defined __i386__ +const union gl_long_double_union gl_LDBL_MAX = + { { 0xFFFFFFFF, 0xFFFFFFFF, 32766 } }; +#else +/* This declaration is solely to ensure that after preprocessing + this file is never empty. */ +typedef int dummy; +#endif diff --git a/local/recipes/tools/diffutils/source/lib/float.in.h b/local/recipes/tools/diffutils/source/lib/float.in.h new file mode 100644 index 0000000000..3e012003fc --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/float.in.h @@ -0,0 +1,188 @@ +/* A correct <float.h>. + + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _@GUARD_PREFIX@_FLOAT_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_FLOAT_H@ + +#ifndef _@GUARD_PREFIX@_FLOAT_H +#define _@GUARD_PREFIX@_FLOAT_H + +/* 'long double' properties. */ + +#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__) +/* Number of mantissa units, in base FLT_RADIX. */ +# undef LDBL_MANT_DIG +# define LDBL_MANT_DIG 64 +/* Number of decimal digits that is sufficient for representing a number. */ +# undef LDBL_DIG +# define LDBL_DIG 18 +/* x-1 where x is the smallest representable number > 1. */ +# undef LDBL_EPSILON +# define LDBL_EPSILON 1.0842021724855044340E-19L +/* Minimum e such that FLT_RADIX^(e-1) is a normalized number. */ +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP (-16381) +/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number. */ +# undef LDBL_MAX_EXP +# define LDBL_MAX_EXP 16384 +/* Minimum positive normalized number. */ +# undef LDBL_MIN +# define LDBL_MIN 3.3621031431120935063E-4932L +/* Maximum representable finite number. */ +# undef LDBL_MAX +# define LDBL_MAX 1.1897314953572317650E+4932L +/* Minimum e such that 10^e is in the range of normalized numbers. */ +# undef LDBL_MIN_10_EXP +# define LDBL_MIN_10_EXP (-4931) +/* Maximum e such that 10^e is in the range of representable finite numbers. */ +# undef LDBL_MAX_10_EXP +# define LDBL_MAX_10_EXP 4932 +#endif + +/* On FreeBSD/x86 6.4, the 'long double' type really has only 53 bits of + precision in the compiler but 64 bits of precision at runtime. See + <http://lists.gnu.org/archive/html/bug-gnulib/2008-07/msg00063.html>. */ +#if defined __i386__ && defined __FreeBSD__ +/* Number of mantissa units, in base FLT_RADIX. */ +# undef LDBL_MANT_DIG +# define LDBL_MANT_DIG 64 +/* Number of decimal digits that is sufficient for representing a number. */ +# undef LDBL_DIG +# define LDBL_DIG 18 +/* x-1 where x is the smallest representable number > 1. */ +# undef LDBL_EPSILON +# define LDBL_EPSILON 1.084202172485504434007452800869941711426e-19L /* 2^-63 */ +/* Minimum e such that FLT_RADIX^(e-1) is a normalized number. */ +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP (-16381) +/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number. */ +# undef LDBL_MAX_EXP +# define LDBL_MAX_EXP 16384 +/* Minimum positive normalized number. */ +# undef LDBL_MIN +# define LDBL_MIN 3.3621031431120935E-4932L /* = 0x1p-16382L */ +/* Maximum representable finite number. */ +# undef LDBL_MAX +/* LDBL_MAX is represented as { 0xFFFFFFFF, 0xFFFFFFFF, 32766 }. + But the largest literal that GCC allows us to write is + 0x0.fffffffffffff8p16384L = { 0xFFFFF800, 0xFFFFFFFF, 32766 }. + So, define it like this through a reference to an external variable + + const unsigned int LDBL_MAX[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 32766 }; + extern const long double LDBL_MAX; + + Unfortunately, this is not a constant expression. */ +union gl_long_double_union + { + struct { unsigned int lo; unsigned int hi; unsigned int exponent; } xd; + long double ld; + }; +extern const union gl_long_double_union gl_LDBL_MAX; +# define LDBL_MAX (gl_LDBL_MAX.ld) +/* Minimum e such that 10^e is in the range of normalized numbers. */ +# undef LDBL_MIN_10_EXP +# define LDBL_MIN_10_EXP (-4931) +/* Maximum e such that 10^e is in the range of representable finite numbers. */ +# undef LDBL_MAX_10_EXP +# define LDBL_MAX_10_EXP 4932 +#endif + +/* On AIX 7.1 with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_MAX are + wrong. + On Linux/PowerPC with gcc 4.4, the value of LDBL_MAX is wrong. */ +#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__ +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP DBL_MIN_EXP +# undef LDBL_MIN_10_EXP +# define LDBL_MIN_10_EXP DBL_MIN_10_EXP +# undef LDBL_MIN +# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */ +#endif +#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__ +# undef LDBL_MAX +/* LDBL_MAX is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xFFFFFFFF }. + It is not easy to define: + #define LDBL_MAX 1.79769313486231580793728971405302307166e308L + is too small, whereas + #define LDBL_MAX 1.79769313486231580793728971405302307167e308L + is too large. Apparently a bug in GCC decimal-to-binary conversion. + Also, I can't get values larger than + #define LDBL63 ((long double) (1ULL << 63)) + #define LDBL882 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63) + #define LDBL945 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63) + #define LDBL1008 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63) + #define LDBL_MAX (LDBL1008 * 65535.0L + LDBL945 * (long double) 9223372036821221375ULL + LDBL882 * (long double) 4611686018427387904ULL) + which is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xF8000000 }. + So, define it like this through a reference to an external variable + + const double LDBL_MAX[2] = { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL }; + extern const long double LDBL_MAX; + + or through a pointer cast + + #define LDBL_MAX \ + (*(const long double *) (double[]) { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL }) + + Unfortunately, this is not a constant expression, and the latter expression + does not work well when GCC is optimizing.. */ +union gl_long_double_union + { + struct { double hi; double lo; } dd; + long double ld; + }; +extern const union gl_long_double_union gl_LDBL_MAX; +# define LDBL_MAX (gl_LDBL_MAX.ld) +#endif + +/* On IRIX 6.5, with cc, the value of LDBL_MANT_DIG is wrong. + On IRIX 6.5, with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_EPSILON + are wrong. */ +#if defined __sgi && (LDBL_MANT_DIG >= 106) +# undef LDBL_MANT_DIG +# define LDBL_MANT_DIG 106 +# if defined __GNUC__ +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP DBL_MIN_EXP +# undef LDBL_MIN_10_EXP +# define LDBL_MIN_10_EXP DBL_MIN_10_EXP +# undef LDBL_MIN +# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */ +# undef LDBL_EPSILON +# define LDBL_EPSILON 2.46519032881566189191165176650870696773e-32L /* 2^-105 */ +# endif +#endif + +#if @REPLACE_ITOLD@ +/* Pull in a function that fixes the 'int' to 'long double' conversion + of glibc 2.7. */ +extern +# ifdef __cplusplus +"C" +# endif +void _Qp_itoq (long double *, int); +static void (*_gl_float_fix_itold) (long double *, int) = _Qp_itoq; +#endif + +#endif /* _@GUARD_PREFIX@_FLOAT_H */ +#endif /* _@GUARD_PREFIX@_FLOAT_H */ diff --git a/local/recipes/tools/diffutils/source/lib/fnmatch.c b/local/recipes/tools/diffutils/source/lib/fnmatch.c new file mode 100644 index 0000000000..5559ba27f8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/fnmatch.c @@ -0,0 +1,356 @@ +/* Copyright (C) 1991-1993, 1996-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _LIBC +# include <config.h> +#endif + +/* Enable GNU extensions in fnmatch.h. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#include <fnmatch.h> + +#include <alloca.h> +#include <assert.h> +#include <ctype.h> +#include <errno.h> +#include <stddef.h> +#include <stdbool.h> +#include <stdlib.h> +#include <string.h> + +#define WIDE_CHAR_SUPPORT \ + (HAVE_WCTYPE_H && HAVE_BTOWC && HAVE_ISWCTYPE \ + && HAVE_WMEMCHR && (HAVE_WMEMCPY || HAVE_WMEMPCPY)) + +/* For platform which support the ISO C amendment 1 functionality we + support user defined character classes. */ +#if defined _LIBC || WIDE_CHAR_SUPPORT +# include <wctype.h> +# include <wchar.h> +#endif + +/* We need some of the locale data (the collation sequence information) + but there is no interface to get this information in general. Therefore + we support a correct implementation only in glibc. */ +#ifdef _LIBC +# include "../locale/localeinfo.h" +# include "../locale/elem-hash.h" +# include "../locale/coll-lookup.h" +# include <shlib-compat.h> + +# define CONCAT(a,b) __CONCAT(a,b) +# define mbsrtowcs __mbsrtowcs +# define fnmatch __fnmatch +extern int fnmatch (const char *pattern, const char *string, int flags); +#endif + +#ifndef SIZE_MAX +# define SIZE_MAX ((size_t) -1) +#endif + +#include "flexmember.h" + +#ifndef FALLTHROUGH +# if __GNUC__ < 7 +# define FALLTHROUGH ((void) 0) +# else +# define FALLTHROUGH __attribute__ ((__fallthrough__)) +# endif +#endif + +/* We often have to test for FNM_FILE_NAME and FNM_PERIOD being both set. */ +#define NO_LEADING_PERIOD(flags) \ + ((flags & (FNM_FILE_NAME | FNM_PERIOD)) == (FNM_FILE_NAME | FNM_PERIOD)) + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself, and have not detected a bug + in the library. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand 'configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#if defined _LIBC || !defined __GNU_LIBRARY__ || !HAVE_FNMATCH_GNU + + +# if ! (defined isblank || (HAVE_ISBLANK && HAVE_DECL_ISBLANK)) +# define isblank(c) ((c) == ' ' || (c) == '\t') +# endif + +# define STREQ(s1, s2) (strcmp (s1, s2) == 0) + +# if defined _LIBC || WIDE_CHAR_SUPPORT +/* The GNU C library provides support for user-defined character classes + and the functions from ISO C amendment 1. */ +# ifdef CHARCLASS_NAME_MAX +# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX +# else +/* This shouldn't happen but some implementation might still have this + problem. Use a reasonable default value. */ +# define CHAR_CLASS_MAX_LENGTH 256 +# endif + +# ifdef _LIBC +# define IS_CHAR_CLASS(string) __wctype (string) +# else +# define IS_CHAR_CLASS(string) wctype (string) +# endif + +# ifdef _LIBC +# define ISWCTYPE(WC, WT) __iswctype (WC, WT) +# else +# define ISWCTYPE(WC, WT) iswctype (WC, WT) +# endif + +# if (HAVE_MBSTATE_T && HAVE_MBSRTOWCS) || _LIBC +/* In this case we are implementing the multibyte character handling. */ +# define HANDLE_MULTIBYTE 1 +# endif + +# else +# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, 'xdigit'. */ + +# define IS_CHAR_CLASS(string) \ + (STREQ (string, "alpha") || STREQ (string, "upper") \ + || STREQ (string, "lower") || STREQ (string, "digit") \ + || STREQ (string, "alnum") || STREQ (string, "xdigit") \ + || STREQ (string, "space") || STREQ (string, "print") \ + || STREQ (string, "punct") || STREQ (string, "graph") \ + || STREQ (string, "cntrl") || STREQ (string, "blank")) +# endif + +/* Avoid depending on library functions or files + whose names are inconsistent. */ + +/* Global variable. */ +static int posixly_correct; + +# ifndef internal_function +/* Inside GNU libc we mark some function in a special way. In other + environments simply ignore the marking. */ +# define internal_function +# endif + +/* Note that this evaluates C many times. */ +# define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c)) +# define CHAR char +# define UCHAR unsigned char +# define INT int +# define FCT internal_fnmatch +# define EXT ext_match +# define END end_pattern +# define L_(CS) CS +# ifdef _LIBC +# define BTOWC(C) __btowc (C) +# else +# define BTOWC(C) btowc (C) +# endif +# define STRLEN(S) strlen (S) +# define STRCAT(D, S) strcat (D, S) +# ifdef _LIBC +# define MEMPCPY(D, S, N) __mempcpy (D, S, N) +# else +# if HAVE_MEMPCPY +# define MEMPCPY(D, S, N) mempcpy (D, S, N) +# else +# define MEMPCPY(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N))) +# endif +# endif +# define MEMCHR(S, C, N) memchr (S, C, N) +# include "fnmatch_loop.c" + + +# if HANDLE_MULTIBYTE +# define FOLD(c) ((flags & FNM_CASEFOLD) ? towlower (c) : (c)) +# define CHAR wchar_t +# define UCHAR wint_t +# define INT wint_t +# define FCT internal_fnwmatch +# define EXT ext_wmatch +# define END end_wpattern +# define L_(CS) L##CS +# define BTOWC(C) (C) +# ifdef _LIBC +# define STRLEN(S) __wcslen (S) +# define STRCAT(D, S) __wcscat (D, S) +# define MEMPCPY(D, S, N) __wmempcpy (D, S, N) +# else +# define STRLEN(S) wcslen (S) +# define STRCAT(D, S) wcscat (D, S) +# if HAVE_WMEMPCPY +# define MEMPCPY(D, S, N) wmempcpy (D, S, N) +# else +# define MEMPCPY(D, S, N) (wmemcpy (D, S, N) + (N)) +# endif +# endif +# define MEMCHR(S, C, N) wmemchr (S, C, N) +# define WIDE_CHAR_VERSION 1 + +# undef IS_CHAR_CLASS +/* We have to convert the wide character string in a multibyte string. But + we know that the character class names consist of alphanumeric characters + from the portable character set, and since the wide character encoding + for a member of the portable character set is the same code point as + its single-byte encoding, we can use a simplified method to convert the + string to a multibyte character string. */ +static wctype_t +is_char_class (const wchar_t *wcs) +{ + char s[CHAR_CLASS_MAX_LENGTH + 1]; + char *cp = s; + + do + { + /* Test for a printable character from the portable character set. */ +# ifdef _LIBC + if (*wcs < 0x20 || *wcs > 0x7e + || *wcs == 0x24 || *wcs == 0x40 || *wcs == 0x60) + return (wctype_t) 0; +# else + switch (*wcs) + { + case L' ': case L'!': case L'"': case L'#': case L'%': + case L'&': case L'\'': case L'(': case L')': case L'*': + case L'+': case L',': case L'-': case L'.': case L'/': + case L'0': case L'1': case L'2': case L'3': case L'4': + case L'5': case L'6': case L'7': case L'8': case L'9': + case L':': case L';': case L'<': case L'=': case L'>': + case L'?': + case L'A': case L'B': case L'C': case L'D': case L'E': + case L'F': case L'G': case L'H': case L'I': case L'J': + case L'K': case L'L': case L'M': case L'N': case L'O': + case L'P': case L'Q': case L'R': case L'S': case L'T': + case L'U': case L'V': case L'W': case L'X': case L'Y': + case L'Z': + case L'[': case L'\\': case L']': case L'^': case L'_': + case L'a': case L'b': case L'c': case L'd': case L'e': + case L'f': case L'g': case L'h': case L'i': case L'j': + case L'k': case L'l': case L'm': case L'n': case L'o': + case L'p': case L'q': case L'r': case L's': case L't': + case L'u': case L'v': case L'w': case L'x': case L'y': + case L'z': case L'{': case L'|': case L'}': case L'~': + break; + default: + return (wctype_t) 0; + } +# endif + + /* Avoid overrunning the buffer. */ + if (cp == s + CHAR_CLASS_MAX_LENGTH) + return (wctype_t) 0; + + *cp++ = (char) *wcs++; + } + while (*wcs != L'\0'); + + *cp = '\0'; + +# ifdef _LIBC + return __wctype (s); +# else + return wctype (s); +# endif +} +# define IS_CHAR_CLASS(string) is_char_class (string) + +# include "fnmatch_loop.c" +# endif + + +int +fnmatch (const char *pattern, const char *string, int flags) +{ +# if HANDLE_MULTIBYTE +# define ALLOCA_LIMIT 2000 + if (__builtin_expect (MB_CUR_MAX, 1) != 1) + { + mbstate_t ps; + size_t patsize; + size_t strsize; + size_t totsize; + wchar_t *wpattern; + wchar_t *wstring; + int res; + + /* Calculate the size needed to convert the strings to + wide characters. */ + memset (&ps, '\0', sizeof (ps)); + patsize = mbsrtowcs (NULL, &pattern, 0, &ps) + 1; + if (__builtin_expect (patsize != 0, 1)) + { + assert (mbsinit (&ps)); + strsize = mbsrtowcs (NULL, &string, 0, &ps) + 1; + if (__builtin_expect (strsize != 0, 1)) + { + assert (mbsinit (&ps)); + totsize = patsize + strsize; + if (__builtin_expect (! (patsize <= totsize + && totsize <= SIZE_MAX / sizeof (wchar_t)), + 0)) + { + errno = ENOMEM; + return -1; + } + + /* Allocate room for the wide characters. */ + if (__builtin_expect (totsize < ALLOCA_LIMIT, 1)) + wpattern = (wchar_t *) alloca (totsize * sizeof (wchar_t)); + else + { + wpattern = malloc (totsize * sizeof (wchar_t)); + if (__builtin_expect (! wpattern, 0)) + { + errno = ENOMEM; + return -1; + } + } + wstring = wpattern + patsize; + + /* Convert the strings into wide characters. */ + mbsrtowcs (wpattern, &pattern, patsize, &ps); + assert (mbsinit (&ps)); + mbsrtowcs (wstring, &string, strsize, &ps); + + res = internal_fnwmatch (wpattern, wstring, wstring + strsize - 1, + flags & FNM_PERIOD, flags); + + if (__builtin_expect (! (totsize < ALLOCA_LIMIT), 0)) + free (wpattern); + return res; + } + } + } + +# endif /* HANDLE_MULTIBYTE */ + + return internal_fnmatch (pattern, string, string + strlen (string), + flags & FNM_PERIOD, flags); +} + +# ifdef _LIBC +# undef fnmatch +versioned_symbol (libc, __fnmatch, fnmatch, GLIBC_2_2_3); +# if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_3) +strong_alias (__fnmatch, __fnmatch_old) +compat_symbol (libc, __fnmatch_old, fnmatch, GLIBC_2_0); +# endif +libc_hidden_ver (__fnmatch, fnmatch) +# endif + +#endif /* _LIBC or not __GNU_LIBRARY__. */ diff --git a/local/recipes/tools/diffutils/source/lib/fnmatch.in.h b/local/recipes/tools/diffutils/source/lib/fnmatch.in.h new file mode 100644 index 0000000000..1782ad2d04 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/fnmatch.in.h @@ -0,0 +1,67 @@ +/* Copyright (C) 1991-1993, 1996-1999, 2001-2003, 2005, 2007, 2009-2017 Free + Software Foundation, Inc. + + This file is part of the GNU C Library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _FNMATCH_H +#define _FNMATCH_H 1 + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* We #undef these before defining them because some losing systems + (HP-UX A.08.07 for example) define these in <unistd.h>. */ +#undef FNM_PATHNAME +#undef FNM_NOESCAPE +#undef FNM_PERIOD + +/* Bits set in the FLAGS argument to 'fnmatch'. */ +#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match '/'. */ +#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ +#define FNM_PERIOD (1 << 2) /* Leading '.' is matched only explicitly. */ + +#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE +# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ +# define FNM_LEADING_DIR (1 << 3) /* Ignore '/...' after a match. */ +# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ +# define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */ +#endif + +/* Value returned by 'fnmatch' if STRING does not match PATTERN. */ +#define FNM_NOMATCH 1 + +/* This value is returned if the implementation does not support + 'fnmatch'. Since this is not the case here it will never be + returned but the conformance test suites still require the symbol + to be defined. */ +#ifdef _XOPEN_SOURCE +# define FNM_NOSYS (-1) +#endif + +/* Match NAME against the file name pattern PATTERN, + returning zero if it matches, FNM_NOMATCH if not. */ +extern int fnmatch (const char *__pattern, const char *__name, + int __flags) + _GL_ARG_NONNULL ((1, 2)); + +#ifdef __cplusplus +} +#endif + +#endif /* fnmatch.h */ diff --git a/local/recipes/tools/diffutils/source/lib/fnmatch_loop.c b/local/recipes/tools/diffutils/source/lib/fnmatch_loop.c new file mode 100644 index 0000000000..7c2c6604f0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/fnmatch_loop.c @@ -0,0 +1,1217 @@ +/* Copyright (C) 1991-1993, 1996-2006, 2009-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* Match STRING against the file name pattern PATTERN, returning zero if + it matches, nonzero if not. */ +static int EXT (INT opt, const CHAR *pattern, const CHAR *string, + const CHAR *string_end, bool no_leading_period, int flags) + internal_function; +static const CHAR *END (const CHAR *patternp) internal_function; + +static int +internal_function +FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end, + bool no_leading_period, int flags) +{ + register const CHAR *p = pattern, *n = string; + register UCHAR c; +#ifdef _LIBC +# if WIDE_CHAR_VERSION + const char *collseq = (const char *) + _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQWC); +# else + const UCHAR *collseq = (const UCHAR *) + _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQMB); +# endif +#endif + + while ((c = *p++) != L_('\0')) + { + bool new_no_leading_period = false; + c = FOLD (c); + + switch (c) + { + case L_('?'): + if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(') + { + int res; + + res = EXT (c, p, n, string_end, no_leading_period, + flags); + if (res != -1) + return res; + } + + if (n == string_end) + return FNM_NOMATCH; + else if (*n == L_('/') && (flags & FNM_FILE_NAME)) + return FNM_NOMATCH; + else if (*n == L_('.') && no_leading_period) + return FNM_NOMATCH; + break; + + case L_('\\'): + if (!(flags & FNM_NOESCAPE)) + { + c = *p++; + if (c == L_('\0')) + /* Trailing \ loses. */ + return FNM_NOMATCH; + c = FOLD (c); + } + if (n == string_end || FOLD ((UCHAR) *n) != c) + return FNM_NOMATCH; + break; + + case L_('*'): + if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(') + { + int res; + + res = EXT (c, p, n, string_end, no_leading_period, + flags); + if (res != -1) + return res; + } + + if (n != string_end && *n == L_('.') && no_leading_period) + return FNM_NOMATCH; + + for (c = *p++; c == L_('?') || c == L_('*'); c = *p++) + { + if (*p == L_('(') && (flags & FNM_EXTMATCH) != 0) + { + const CHAR *endp = END (p); + if (endp != p) + { + /* This is a pattern. Skip over it. */ + p = endp; + continue; + } + } + + if (c == L_('?')) + { + /* A ? needs to match one character. */ + if (n == string_end) + /* There isn't another character; no match. */ + return FNM_NOMATCH; + else if (*n == L_('/') + && __builtin_expect (flags & FNM_FILE_NAME, 0)) + /* A slash does not match a wildcard under + FNM_FILE_NAME. */ + return FNM_NOMATCH; + else + /* One character of the string is consumed in matching + this ? wildcard, so *??? won't match if there are + less than three characters. */ + ++n; + } + } + + if (c == L_('\0')) + /* The wildcard(s) is/are the last element of the pattern. + If the name is a file name and contains another slash + this means it cannot match, unless the FNM_LEADING_DIR + flag is set. */ + { + int result = (flags & FNM_FILE_NAME) == 0 ? 0 : FNM_NOMATCH; + + if (flags & FNM_FILE_NAME) + { + if (flags & FNM_LEADING_DIR) + result = 0; + else + { + if (MEMCHR (n, L_('/'), string_end - n) == NULL) + result = 0; + } + } + + return result; + } + else + { + const CHAR *endp; + + endp = MEMCHR (n, (flags & FNM_FILE_NAME) ? L_('/') : L_('\0'), + string_end - n); + if (endp == NULL) + endp = string_end; + + if (c == L_('[') + || (__builtin_expect (flags & FNM_EXTMATCH, 0) != 0 + && (c == L_('@') || c == L_('+') || c == L_('!')) + && *p == L_('('))) + { + int flags2 = ((flags & FNM_FILE_NAME) + ? flags : (flags & ~FNM_PERIOD)); + bool no_leading_period2 = no_leading_period; + + for (--p; n < endp; ++n, no_leading_period2 = false) + if (FCT (p, n, string_end, no_leading_period2, flags2) + == 0) + return 0; + } + else if (c == L_('/') && (flags & FNM_FILE_NAME)) + { + while (n < string_end && *n != L_('/')) + ++n; + if (n < string_end && *n == L_('/') + && (FCT (p, n + 1, string_end, flags & FNM_PERIOD, flags) + == 0)) + return 0; + } + else + { + int flags2 = ((flags & FNM_FILE_NAME) + ? flags : (flags & ~FNM_PERIOD)); + int no_leading_period2 = no_leading_period; + + if (c == L_('\\') && !(flags & FNM_NOESCAPE)) + c = *p; + c = FOLD (c); + for (--p; n < endp; ++n, no_leading_period2 = false) + if (FOLD ((UCHAR) *n) == c + && (FCT (p, n, string_end, no_leading_period2, flags2) + == 0)) + return 0; + } + } + + /* If we come here no match is possible with the wildcard. */ + return FNM_NOMATCH; + + case L_('['): + { + /* Nonzero if the sense of the character class is inverted. */ + const CHAR *p_init = p; + const CHAR *n_init = n; + register bool not; + CHAR cold; + UCHAR fn; + + if (posixly_correct == 0) + posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; + + if (n == string_end) + return FNM_NOMATCH; + + if (*n == L_('.') && no_leading_period) + return FNM_NOMATCH; + + if (*n == L_('/') && (flags & FNM_FILE_NAME)) + /* '/' cannot be matched. */ + return FNM_NOMATCH; + + not = (*p == L_('!') || (posixly_correct < 0 && *p == L_('^'))); + if (not) + ++p; + + fn = FOLD ((UCHAR) *n); + + c = *p++; + for (;;) + { + bool is_range = false; + + if (!(flags & FNM_NOESCAPE) && c == L_('\\')) + { + if (*p == L_('\0')) + return FNM_NOMATCH; + c = FOLD ((UCHAR) *p); + ++p; + + goto normal_bracket; + } + else if (c == L_('[') && *p == L_(':')) + { + /* Leave room for the null. */ + CHAR str[CHAR_CLASS_MAX_LENGTH + 1]; + size_t c1 = 0; +#if defined _LIBC || WIDE_CHAR_SUPPORT + wctype_t wt; +#endif + const CHAR *startp = p; + + for (;;) + { + if (c1 == CHAR_CLASS_MAX_LENGTH) + /* The name is too long and therefore the pattern + is ill-formed. */ + return FNM_NOMATCH; + + c = *++p; + if (c == L_(':') && p[1] == L_(']')) + { + p += 2; + break; + } + if (c < L_('a') || c >= L_('z')) + { + /* This cannot possibly be a character class name. + Match it as a normal range. */ + p = startp; + c = L_('['); + goto normal_bracket; + } + str[c1++] = c; + } + str[c1] = L_('\0'); + +#if defined _LIBC || WIDE_CHAR_SUPPORT + wt = IS_CHAR_CLASS (str); + if (wt == 0) + /* Invalid character class name. */ + return FNM_NOMATCH; + +# if defined _LIBC && ! WIDE_CHAR_VERSION + /* The following code is glibc specific but does + there a good job in speeding up the code since + we can avoid the btowc() call. */ + if (_ISCTYPE ((UCHAR) *n, wt)) + goto matched; +# else + if (ISWCTYPE (BTOWC ((UCHAR) *n), wt)) + goto matched; +# endif +#else + if ((STREQ (str, L_("alnum")) && isalnum ((UCHAR) *n)) + || (STREQ (str, L_("alpha")) && isalpha ((UCHAR) *n)) + || (STREQ (str, L_("blank")) && isblank ((UCHAR) *n)) + || (STREQ (str, L_("cntrl")) && iscntrl ((UCHAR) *n)) + || (STREQ (str, L_("digit")) && isdigit ((UCHAR) *n)) + || (STREQ (str, L_("graph")) && isgraph ((UCHAR) *n)) + || (STREQ (str, L_("lower")) && islower ((UCHAR) *n)) + || (STREQ (str, L_("print")) && isprint ((UCHAR) *n)) + || (STREQ (str, L_("punct")) && ispunct ((UCHAR) *n)) + || (STREQ (str, L_("space")) && isspace ((UCHAR) *n)) + || (STREQ (str, L_("upper")) && isupper ((UCHAR) *n)) + || (STREQ (str, L_("xdigit")) && isxdigit ((UCHAR) *n))) + goto matched; +#endif + c = *p++; + } +#ifdef _LIBC + else if (c == L_('[') && *p == L_('=')) + { + UCHAR str[1]; + uint32_t nrules = + _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); + const CHAR *startp = p; + + c = *++p; + if (c == L_('\0')) + { + p = startp; + c = L_('['); + goto normal_bracket; + } + str[0] = c; + + c = *++p; + if (c != L_('=') || p[1] != L_(']')) + { + p = startp; + c = L_('['); + goto normal_bracket; + } + p += 2; + + if (nrules == 0) + { + if ((UCHAR) *n == str[0]) + goto matched; + } + else + { + const int32_t *table; +# if WIDE_CHAR_VERSION + const int32_t *weights; + const int32_t *extra; +# else + const unsigned char *weights; + const unsigned char *extra; +# endif + const int32_t *indirect; + int32_t idx; + const UCHAR *cp = (const UCHAR *) str; + + /* This #include defines a local function! */ +# if WIDE_CHAR_VERSION +# include <locale/weightwc.h> +# else +# include <locale/weight.h> +# endif + +# if WIDE_CHAR_VERSION + table = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEWC); + weights = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTWC); + extra = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAWC); + indirect = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTWC); +# else + table = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB); + weights = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTMB); + extra = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB); + indirect = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); +# endif + + idx = findidx (&cp); + if (idx != 0) + { + /* We found a table entry. Now see whether the + character we are currently at has the same + equivalence class value. */ + int len = weights[idx & 0xffffff]; + int32_t idx2; + const UCHAR *np = (const UCHAR *) n; + + idx2 = findidx (&np); + if (idx2 != 0 + && (idx >> 24) == (idx2 >> 24) + && len == weights[idx2 & 0xffffff]) + { + int cnt = 0; + + idx &= 0xffffff; + idx2 &= 0xffffff; + + while (cnt < len + && (weights[idx + 1 + cnt] + == weights[idx2 + 1 + cnt])) + ++cnt; + + if (cnt == len) + goto matched; + } + } + } + + c = *p++; + } +#endif + else if (c == L_('\0')) + { + /* [ unterminated, treat as normal character. */ + p = p_init; + n = n_init; + c = L_('['); + goto normal_match; + } + else + { +#ifdef _LIBC + bool is_seqval = false; + + if (c == L_('[') && *p == L_('.')) + { + uint32_t nrules = + _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); + const CHAR *startp = p; + size_t c1 = 0; + + while (1) + { + c = *++p; + if (c == L_('.') && p[1] == L_(']')) + { + p += 2; + break; + } + if (c == '\0') + return FNM_NOMATCH; + ++c1; + } + + /* We have to handling the symbols differently in + ranges since then the collation sequence is + important. */ + is_range = *p == L_('-') && p[1] != L_('\0'); + + if (nrules == 0) + { + /* There are no names defined in the collation + data. Therefore we only accept the trivial + names consisting of the character itself. */ + if (c1 != 1) + return FNM_NOMATCH; + + if (!is_range && *n == startp[1]) + goto matched; + + cold = startp[1]; + c = *p++; + } + else + { + int32_t table_size; + const int32_t *symb_table; +# ifdef WIDE_CHAR_VERSION + char str[c1]; + size_t strcnt; +# else +# define str (startp + 1) +# endif + const unsigned char *extra; + int32_t idx; + int32_t elem; + int32_t second; + int32_t hash; + +# ifdef WIDE_CHAR_VERSION + /* We have to convert the name to a single-byte + string. This is possible since the names + consist of ASCII characters and the internal + representation is UCS4. */ + for (strcnt = 0; strcnt < c1; ++strcnt) + str[strcnt] = startp[1 + strcnt]; +# endif + + table_size = + _NL_CURRENT_WORD (LC_COLLATE, + _NL_COLLATE_SYMB_HASH_SIZEMB); + symb_table = (const int32_t *) + _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_SYMB_TABLEMB); + extra = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_SYMB_EXTRAMB); + + /* Locate the character in the hashing table. */ + hash = elem_hash (str, c1); + + idx = 0; + elem = hash % table_size; + if (symb_table[2 * elem] != 0) + { + second = hash % (table_size - 2) + 1; + + do + { + /* First compare the hashing value. */ + if (symb_table[2 * elem] == hash + && (c1 + == extra[symb_table[2 * elem + 1]]) + && memcmp (str, + &extra[symb_table[2 * elem + + 1] + + 1], c1) == 0) + { + /* Yep, this is the entry. */ + idx = symb_table[2 * elem + 1]; + idx += 1 + extra[idx]; + break; + } + + /* Next entry. */ + elem += second; + } + while (symb_table[2 * elem] != 0); + } + + if (symb_table[2 * elem] != 0) + { + /* Compare the byte sequence but only if + this is not part of a range. */ +# ifdef WIDE_CHAR_VERSION + int32_t *wextra; + + idx += 1 + extra[idx]; + /* Adjust for the alignment. */ + idx = (idx + 3) & ~3; + + wextra = (int32_t *) &extra[idx + 4]; +# endif + + if (! is_range) + { +# ifdef WIDE_CHAR_VERSION + for (c1 = 0; + (int32_t) c1 < wextra[idx]; + ++c1) + if (n[c1] != wextra[1 + c1]) + break; + + if ((int32_t) c1 == wextra[idx]) + goto matched; +# else + for (c1 = 0; c1 < extra[idx]; ++c1) + if (n[c1] != extra[1 + c1]) + break; + + if (c1 == extra[idx]) + goto matched; +# endif + } + + /* Get the collation sequence value. */ + is_seqval = true; +# ifdef WIDE_CHAR_VERSION + cold = wextra[1 + wextra[idx]]; +# else + /* Adjust for the alignment. */ + idx += 1 + extra[idx]; + idx = (idx + 3) & ~4; + cold = *((int32_t *) &extra[idx]); +# endif + + c = *p++; + } + else if (c1 == 1) + { + /* No valid character. Match it as a + single byte. */ + if (!is_range && *n == str[0]) + goto matched; + + cold = str[0]; + c = *p++; + } + else + return FNM_NOMATCH; + } + } + else +# undef str +#endif + { + c = FOLD (c); + normal_bracket: + + /* We have to handling the symbols differently in + ranges since then the collation sequence is + important. */ + is_range = (*p == L_('-') && p[1] != L_('\0') + && p[1] != L_(']')); + + if (!is_range && c == fn) + goto matched; + +#if _LIBC + /* This is needed if we goto normal_bracket; from + outside of is_seqval's scope. */ + is_seqval = false; +#endif + + cold = c; + c = *p++; + } + + if (c == L_('-') && *p != L_(']')) + { +#if _LIBC + /* We have to find the collation sequence + value for C. Collation sequence is nothing + we can regularly access. The sequence + value is defined by the order in which the + definitions of the collation values for the + various characters appear in the source + file. A strange concept, nowhere + documented. */ + uint32_t fcollseq; + uint32_t lcollseq; + UCHAR cend = *p++; + +# ifdef WIDE_CHAR_VERSION + /* Search in the 'names' array for the characters. */ + fcollseq = __collseq_table_lookup (collseq, fn); + if (fcollseq == ~((uint32_t) 0)) + /* XXX We don't know anything about the character + we are supposed to match. This means we are + failing. */ + goto range_not_matched; + + if (is_seqval) + lcollseq = cold; + else + lcollseq = __collseq_table_lookup (collseq, cold); +# else + fcollseq = collseq[fn]; + lcollseq = is_seqval ? cold : collseq[(UCHAR) cold]; +# endif + + is_seqval = false; + if (cend == L_('[') && *p == L_('.')) + { + uint32_t nrules = + _NL_CURRENT_WORD (LC_COLLATE, + _NL_COLLATE_NRULES); + const CHAR *startp = p; + size_t c1 = 0; + + while (1) + { + c = *++p; + if (c == L_('.') && p[1] == L_(']')) + { + p += 2; + break; + } + if (c == '\0') + return FNM_NOMATCH; + ++c1; + } + + if (nrules == 0) + { + /* There are no names defined in the + collation data. Therefore we only + accept the trivial names consisting + of the character itself. */ + if (c1 != 1) + return FNM_NOMATCH; + + cend = startp[1]; + } + else + { + int32_t table_size; + const int32_t *symb_table; +# ifdef WIDE_CHAR_VERSION + char str[c1]; + size_t strcnt; +# else +# define str (startp + 1) +# endif + const unsigned char *extra; + int32_t idx; + int32_t elem; + int32_t second; + int32_t hash; + +# ifdef WIDE_CHAR_VERSION + /* We have to convert the name to a single-byte + string. This is possible since the names + consist of ASCII characters and the internal + representation is UCS4. */ + for (strcnt = 0; strcnt < c1; ++strcnt) + str[strcnt] = startp[1 + strcnt]; +# endif + + table_size = + _NL_CURRENT_WORD (LC_COLLATE, + _NL_COLLATE_SYMB_HASH_SIZEMB); + symb_table = (const int32_t *) + _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_SYMB_TABLEMB); + extra = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_SYMB_EXTRAMB); + + /* Locate the character in the hashing + table. */ + hash = elem_hash (str, c1); + + idx = 0; + elem = hash % table_size; + if (symb_table[2 * elem] != 0) + { + second = hash % (table_size - 2) + 1; + + do + { + /* First compare the hashing value. */ + if (symb_table[2 * elem] == hash + && (c1 + == extra[symb_table[2 * elem + 1]]) + && memcmp (str, + &extra[symb_table[2 * elem + 1] + + 1], c1) == 0) + { + /* Yep, this is the entry. */ + idx = symb_table[2 * elem + 1]; + idx += 1 + extra[idx]; + break; + } + + /* Next entry. */ + elem += second; + } + while (symb_table[2 * elem] != 0); + } + + if (symb_table[2 * elem] != 0) + { + /* Compare the byte sequence but only if + this is not part of a range. */ +# ifdef WIDE_CHAR_VERSION + int32_t *wextra; + + idx += 1 + extra[idx]; + /* Adjust for the alignment. */ + idx = (idx + 3) & ~4; + + wextra = (int32_t *) &extra[idx + 4]; +# endif + /* Get the collation sequence value. */ + is_seqval = true; +# ifdef WIDE_CHAR_VERSION + cend = wextra[1 + wextra[idx]]; +# else + /* Adjust for the alignment. */ + idx += 1 + extra[idx]; + idx = (idx + 3) & ~4; + cend = *((int32_t *) &extra[idx]); +# endif + } + else if (symb_table[2 * elem] != 0 && c1 == 1) + { + cend = str[0]; + c = *p++; + } + else + return FNM_NOMATCH; + } +# undef str + } + else + { + if (!(flags & FNM_NOESCAPE) && cend == L_('\\')) + cend = *p++; + if (cend == L_('\0')) + return FNM_NOMATCH; + cend = FOLD (cend); + } + + /* XXX It is not entirely clear to me how to handle + characters which are not mentioned in the + collation specification. */ + if ( +# ifdef WIDE_CHAR_VERSION + lcollseq == 0xffffffff || +# endif + lcollseq <= fcollseq) + { + /* We have to look at the upper bound. */ + uint32_t hcollseq; + + if (is_seqval) + hcollseq = cend; + else + { +# ifdef WIDE_CHAR_VERSION + hcollseq = + __collseq_table_lookup (collseq, cend); + if (hcollseq == ~((uint32_t) 0)) + { + /* Hum, no information about the upper + bound. The matching succeeds if the + lower bound is matched exactly. */ + if (lcollseq != fcollseq) + goto range_not_matched; + + goto matched; + } +# else + hcollseq = collseq[cend]; +# endif + } + + if (lcollseq <= hcollseq && fcollseq <= hcollseq) + goto matched; + } +# ifdef WIDE_CHAR_VERSION + range_not_matched: +# endif +#else + /* We use a boring value comparison of the character + values. This is better than comparing using + 'strcoll' since the latter would have surprising + and sometimes fatal consequences. */ + UCHAR cend = *p++; + + if (!(flags & FNM_NOESCAPE) && cend == L_('\\')) + cend = *p++; + if (cend == L_('\0')) + return FNM_NOMATCH; + + /* It is a range. */ + if (cold <= fn && fn <= cend) + goto matched; +#endif + + c = *p++; + } + } + + if (c == L_(']')) + break; + } + + if (!not) + return FNM_NOMATCH; + break; + + matched: + /* Skip the rest of the [...] that already matched. */ + do + { + ignore_next: + c = *p++; + + if (c == L_('\0')) + /* [... (unterminated) loses. */ + return FNM_NOMATCH; + + if (!(flags & FNM_NOESCAPE) && c == L_('\\')) + { + if (*p == L_('\0')) + return FNM_NOMATCH; + /* XXX 1003.2d11 is unclear if this is right. */ + ++p; + } + else if (c == L_('[') && *p == L_(':')) + { + int c1 = 0; + const CHAR *startp = p; + + while (1) + { + c = *++p; + if (++c1 == CHAR_CLASS_MAX_LENGTH) + return FNM_NOMATCH; + + if (*p == L_(':') && p[1] == L_(']')) + break; + + if (c < L_('a') || c >= L_('z')) + { + p = startp; + goto ignore_next; + } + } + p += 2; + c = *p++; + } + else if (c == L_('[') && *p == L_('=')) + { + c = *++p; + if (c == L_('\0')) + return FNM_NOMATCH; + c = *++p; + if (c != L_('=') || p[1] != L_(']')) + return FNM_NOMATCH; + p += 2; + c = *p++; + } + else if (c == L_('[') && *p == L_('.')) + { + ++p; + while (1) + { + c = *++p; + if (c == '\0') + return FNM_NOMATCH; + + if (*p == L_('.') && p[1] == L_(']')) + break; + } + p += 2; + c = *p++; + } + } + while (c != L_(']')); + if (not) + return FNM_NOMATCH; + } + break; + + case L_('+'): + case L_('@'): + case L_('!'): + if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(') + { + int res; + + res = EXT (c, p, n, string_end, no_leading_period, flags); + if (res != -1) + return res; + } + goto normal_match; + + case L_('/'): + if (NO_LEADING_PERIOD (flags)) + { + if (n == string_end || c != (UCHAR) *n) + return FNM_NOMATCH; + + new_no_leading_period = true; + break; + } + FALLTHROUGH; + default: + normal_match: + if (n == string_end || c != FOLD ((UCHAR) *n)) + return FNM_NOMATCH; + } + + no_leading_period = new_no_leading_period; + ++n; + } + + if (n == string_end) + return 0; + + if ((flags & FNM_LEADING_DIR) && n != string_end && *n == L_('/')) + /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */ + return 0; + + return FNM_NOMATCH; +} + + +static const CHAR * +internal_function +END (const CHAR *pattern) +{ + const CHAR *p = pattern; + + while (1) + if (*++p == L_('\0')) + /* This is an invalid pattern. */ + return pattern; + else if (*p == L_('[')) + { + /* Handle brackets special. */ + if (posixly_correct == 0) + posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; + + /* Skip the not sign. We have to recognize it because of a possibly + following ']'. */ + if (*++p == L_('!') || (posixly_correct < 0 && *p == L_('^'))) + ++p; + /* A leading ']' is recognized as such. */ + if (*p == L_(']')) + ++p; + /* Skip over all characters of the list. */ + while (*p != L_(']')) + if (*p++ == L_('\0')) + /* This is no valid pattern. */ + return pattern; + } + else if ((*p == L_('?') || *p == L_('*') || *p == L_('+') || *p == L_('@') + || *p == L_('!')) && p[1] == L_('(')) + p = END (p + 1); + else if (*p == L_(')')) + break; + + return p + 1; +} + + +static int +internal_function +EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end, + bool no_leading_period, int flags) +{ + const CHAR *startp; + size_t level; + struct patternlist + { + struct patternlist *next; + CHAR str[FLEXIBLE_ARRAY_MEMBER]; + } *list = NULL; + struct patternlist **lastp = &list; + size_t pattern_len = STRLEN (pattern); + const CHAR *p; + const CHAR *rs; + enum { ALLOCA_LIMIT = 8000 }; + + /* Parse the pattern. Store the individual parts in the list. */ + level = 0; + for (startp = p = pattern + 1; ; ++p) + if (*p == L_('\0')) + /* This is an invalid pattern. */ + return -1; + else if (*p == L_('[')) + { + /* Handle brackets special. */ + if (posixly_correct == 0) + posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; + + /* Skip the not sign. We have to recognize it because of a possibly + following ']'. */ + if (*++p == L_('!') || (posixly_correct < 0 && *p == L_('^'))) + ++p; + /* A leading ']' is recognized as such. */ + if (*p == L_(']')) + ++p; + /* Skip over all characters of the list. */ + while (*p != L_(']')) + if (*p++ == L_('\0')) + /* This is no valid pattern. */ + return -1; + } + else if ((*p == L_('?') || *p == L_('*') || *p == L_('+') || *p == L_('@') + || *p == L_('!')) && p[1] == L_('(')) + /* Remember the nesting level. */ + ++level; + else if (*p == L_(')')) + { + if (level-- == 0) + { + /* This means we found the end of the pattern. */ +#define NEW_PATTERN \ + struct patternlist *newp; \ + size_t plen; \ + size_t plensize; \ + size_t newpsize; \ + \ + plen = (opt == L_('?') || opt == L_('@') \ + ? pattern_len \ + : p - startp + 1UL); \ + plensize = plen * sizeof (CHAR); \ + newpsize = FLEXSIZEOF (struct patternlist, str, plensize); \ + if ((size_t) -1 / sizeof (CHAR) < plen \ + || newpsize < offsetof (struct patternlist, str) \ + || ALLOCA_LIMIT <= newpsize) \ + return -1; \ + newp = (struct patternlist *) alloca (newpsize); \ + *((CHAR *) MEMPCPY (newp->str, startp, p - startp)) = L_('\0'); \ + newp->next = NULL; \ + *lastp = newp; \ + lastp = &newp->next + NEW_PATTERN; + break; + } + } + else if (*p == L_('|')) + { + if (level == 0) + { + NEW_PATTERN; + startp = p + 1; + } + } + assert (list != NULL); + assert (p[-1] == L_(')')); +#undef NEW_PATTERN + + switch (opt) + { + case L_('*'): + if (FCT (p, string, string_end, no_leading_period, flags) == 0) + return 0; + FALLTHROUGH; + case L_('+'): + do + { + for (rs = string; rs <= string_end; ++rs) + /* First match the prefix with the current pattern with the + current pattern. */ + if (FCT (list->str, string, rs, no_leading_period, + flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0 + /* This was successful. Now match the rest with the rest + of the pattern. */ + && (FCT (p, rs, string_end, + rs == string + ? no_leading_period + : rs[-1] == '/' && NO_LEADING_PERIOD (flags), + flags & FNM_FILE_NAME + ? flags : flags & ~FNM_PERIOD) == 0 + /* This didn't work. Try the whole pattern. */ + || (rs != string + && FCT (pattern - 1, rs, string_end, + rs == string + ? no_leading_period + : rs[-1] == '/' && NO_LEADING_PERIOD (flags), + flags & FNM_FILE_NAME + ? flags : flags & ~FNM_PERIOD) == 0))) + /* It worked. Signal success. */ + return 0; + } + while ((list = list->next) != NULL); + + /* None of the patterns lead to a match. */ + return FNM_NOMATCH; + + case L_('?'): + if (FCT (p, string, string_end, no_leading_period, flags) == 0) + return 0; + FALLTHROUGH; + case L_('@'): + do + /* I cannot believe it but 'strcat' is actually acceptable + here. Match the entire string with the prefix from the + pattern list and the rest of the pattern following the + pattern list. */ + if (FCT (STRCAT (list->str, p), string, string_end, + no_leading_period, + flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0) + /* It worked. Signal success. */ + return 0; + while ((list = list->next) != NULL); + + /* None of the patterns lead to a match. */ + return FNM_NOMATCH; + + case L_('!'): + for (rs = string; rs <= string_end; ++rs) + { + struct patternlist *runp; + + for (runp = list; runp != NULL; runp = runp->next) + if (FCT (runp->str, string, rs, no_leading_period, + flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0) + break; + + /* If none of the patterns matched see whether the rest does. */ + if (runp == NULL + && (FCT (p, rs, string_end, + rs == string + ? no_leading_period + : rs[-1] == '/' && NO_LEADING_PERIOD (flags), + flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) + == 0)) + /* This is successful. */ + return 0; + } + + /* None of the patterns together with the rest of the pattern + lead to a match. */ + return FNM_NOMATCH; + + default: + assert (! "Invalid extended matching operator"); + break; + } + + return -1; +} + + +#undef FOLD +#undef CHAR +#undef UCHAR +#undef INT +#undef FCT +#undef EXT +#undef END +#undef MEMPCPY +#undef MEMCHR +#undef STRLEN +#undef STRCAT +#undef L_ +#undef BTOWC diff --git a/local/recipes/tools/diffutils/source/lib/freopen-safer.c b/local/recipes/tools/diffutils/source/lib/freopen-safer.c new file mode 100644 index 0000000000..be84ae68a2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/freopen-safer.c @@ -0,0 +1,111 @@ +/* Invoke freopen, but avoid some glitches. + + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake. */ + +#include <config.h> + +#include "stdio-safer.h" + +#include <errno.h> +#include <fcntl.h> +#include <stdbool.h> +#include <unistd.h> + +#ifndef FALLTHROUGH +# if __GNUC__ < 7 +# define FALLTHROUGH ((void) 0) +# else +# define FALLTHROUGH __attribute__ ((__fallthrough__)) +# endif +#endif + +/* Guarantee that FD is open; all smaller FDs must already be open. + Return true if successful. */ +static bool +protect_fd (int fd) +{ + int value = open ("/dev/null", O_RDONLY); + if (value != fd) + { + if (0 <= value) + { + close (value); + errno = EBADF; /* Unexpected; this is as good as anything else. */ + } + return false; + } + return true; +} + +/* Like freopen, but guarantee that reopening stdin, stdout, or stderr + preserves the invariant that STDxxx_FILENO==fileno(stdxxx), and + that no other stream will interfere with the standard streams. + This is necessary because most freopen implementations will change + the associated fd of a stream to the lowest available slot. */ + +FILE * +freopen_safer (char const *name, char const *mode, FILE *f) +{ + /* Unfortunately, we cannot use the fopen_safer approach of using + fdopen (dup_safer (fileno (freopen (cmd, mode, f)))), because we + need to return f itself. The implementation of freopen(NULL,m,f) + is system-dependent, so the best we can do is guarantee that all + lower-valued standard fds are open prior to the freopen call, + even though this puts more pressure on open fds. */ + bool protect_in = false; + bool protect_out = false; + bool protect_err = false; + int saved_errno; + + switch (fileno (f)) + { + default: /* -1 or not a standard stream. */ + if (dup2 (STDERR_FILENO, STDERR_FILENO) != STDERR_FILENO) + protect_err = true; + FALLTHROUGH; + case STDERR_FILENO: + if (dup2 (STDOUT_FILENO, STDOUT_FILENO) != STDOUT_FILENO) + protect_out = true; + FALLTHROUGH; + case STDOUT_FILENO: + if (dup2 (STDIN_FILENO, STDIN_FILENO) != STDIN_FILENO) + protect_in = true; + FALLTHROUGH; + case STDIN_FILENO: + /* Nothing left to protect. */ + break; + } + if (protect_in && !protect_fd (STDIN_FILENO)) + f = NULL; + else if (protect_out && !protect_fd (STDOUT_FILENO)) + f = NULL; + else if (protect_err && !protect_fd (STDERR_FILENO)) + f = NULL; + else + f = freopen (name, mode, f); + saved_errno = errno; + if (protect_err) + close (STDERR_FILENO); + if (protect_out) + close (STDOUT_FILENO); + if (protect_in) + close (STDIN_FILENO); + if (!f) + errno = saved_errno; + return f; +} diff --git a/local/recipes/tools/diffutils/source/lib/freopen.c b/local/recipes/tools/diffutils/source/lib/freopen.c new file mode 100644 index 0000000000..cf270ffa02 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/freopen.c @@ -0,0 +1,92 @@ +/* Open a stream to a file. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +/* If the user's config.h happens to include <stdio.h>, let it include only + the system's <stdio.h> here, so that orig_freopen doesn't recurse to + rpl_freopen. */ +#define _GL_ALREADY_INCLUDING_STDIO_H +#include <config.h> + +/* Get the original definition of freopen. It might be defined as a macro. */ +#include <stdio.h> +#undef _GL_ALREADY_INCLUDING_STDIO_H + +#include <errno.h> + +static FILE * +orig_freopen (const char *filename, const char *mode, FILE *stream) +{ + return freopen (filename, mode, stream); +} + +/* Specification. */ +/* Write "stdio.h" here, not <stdio.h>, otherwise OSF/1 5.1 DTK cc eliminates + this include because of the preliminary #include <stdio.h> above. */ +#include "stdio.h" + +#include <fcntl.h> +#include <string.h> +#include <unistd.h> + +FILE * +rpl_freopen (const char *filename, const char *mode, FILE *stream) +{ + FILE *result; +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + char const *null_device = "NUL"; + if (filename && strcmp (filename, "/dev/null") == 0) + filename = null_device; +#else + char const *null_device = "/dev/null"; +#endif + +#ifdef __KLIBC__ + errno = 0; +#endif + + result = orig_freopen (filename, mode, stream); + + if (!result) + { +#ifdef __KLIBC__ + /* On OS/2 kLIBC, freopen returns NULL even if it is successful + if filename is NULL. */ + if (!filename && !errno) + result = stream; +#endif + } + else if (filename) + { + int fd = fileno (result); + if (dup2 (fd, fd) < 0 && errno == EBADF) + { + int nullfd = open (null_device, O_RDONLY | O_CLOEXEC); + int err = 0; + if (nullfd != fd) + { + if (dup2 (nullfd, fd) < 0) + err = 1; + close (nullfd); + } + if (!err) + result = orig_freopen (filename, mode, result); + } + } + + return result; +} diff --git a/local/recipes/tools/diffutils/source/lib/fstat.c b/local/recipes/tools/diffutils/source/lib/fstat.c new file mode 100644 index 0000000000..d2e04688f2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/fstat.c @@ -0,0 +1,88 @@ +/* fstat() replacement. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* If the user's config.h happens to include <sys/stat.h>, let it include only + the system's <sys/stat.h> here, so that orig_fstat doesn't recurse to + rpl_fstat. */ +#define __need_system_sys_stat_h +#include <config.h> + +/* Get the original definition of fstat. It might be defined as a macro. */ +#include <sys/types.h> +#include <sys/stat.h> +#undef __need_system_sys_stat_h + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# define WINDOWS_NATIVE +#endif + +#if !defined WINDOWS_NATIVE + +static int +orig_fstat (int fd, struct stat *buf) +{ + return fstat (fd, buf); +} + +#endif + +/* Specification. */ +/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc + eliminates this include because of the preliminary #include <sys/stat.h> + above. */ +#include "sys/stat.h" + +#include <errno.h> +#include <unistd.h> +#ifdef WINDOWS_NATIVE +# define WIN32_LEAN_AND_MEAN +# include <windows.h> +# if GNULIB_MSVC_NOTHROW +# include "msvc-nothrow.h" +# else +# include <io.h> +# endif +# include "stat-w32.h" +#endif + +int +rpl_fstat (int fd, struct stat *buf) +{ +#if REPLACE_FCHDIR && REPLACE_OPEN_DIRECTORY + /* Handle the case when rpl_open() used a dummy file descriptor to work + around an open() that can't normally visit directories. */ + const char *name = _gl_directory_name (fd); + if (name != NULL) + return stat (name, buf); +#endif + +#ifdef WINDOWS_NATIVE + /* Fill the fields ourselves, because the original fstat function returns + values for st_atime, st_mtime, st_ctime that depend on the current time + zone. See + <https://lists.gnu.org/archive/html/bug-gnulib/2017-04/msg00134.html> */ + HANDLE h = (HANDLE) _get_osfhandle (fd); + + if (h == INVALID_HANDLE_VALUE) + { + errno = EBADF; + return -1; + } + return _gl_fstat_by_handle (h, NULL, buf); +#else + return orig_fstat (fd, buf); +#endif +} diff --git a/local/recipes/tools/diffutils/source/lib/getdtablesize.c b/local/recipes/tools/diffutils/source/lib/getdtablesize.c new file mode 100644 index 0000000000..4a0a9d0d64 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/getdtablesize.c @@ -0,0 +1,126 @@ +/* getdtablesize() function for platforms that don't have it. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <unistd.h> + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +# include <stdio.h> + +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER +# include "msvc-inval.h" +# endif + +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER +static int +_setmaxstdio_nothrow (int newmax) +{ + int result; + + TRY_MSVC_INVAL + { + result = _setmaxstdio (newmax); + } + CATCH_MSVC_INVAL + { + result = -1; + } + DONE_MSVC_INVAL; + + return result; +} +# else +# define _setmaxstdio_nothrow _setmaxstdio +# endif + +/* Cache for the previous getdtablesize () result. Safe to cache because + Windows also lacks setrlimit. */ +static int dtablesize; + +int +getdtablesize (void) +{ + if (dtablesize == 0) + { + /* We are looking for the number N such that the valid file descriptors + are 0..N-1. It can be obtained through a loop as follows: + { + int fd; + for (fd = 3; fd < 65536; fd++) + if (dup2 (0, fd) == -1) + break; + return fd; + } + On Windows XP, the result is 2048. + The drawback of this loop is that it allocates memory for a libc + internal array that is never freed. + + The number N can also be obtained as the upper bound for + _getmaxstdio (). _getmaxstdio () returns the maximum number of open + FILE objects. The sanity check in _setmaxstdio reveals the maximum + number of file descriptors. This too allocates memory, but it is + freed when we call _setmaxstdio with the original value. */ + int orig_max_stdio = _getmaxstdio (); + unsigned int bound; + for (bound = 0x10000; _setmaxstdio_nothrow (bound) < 0; bound = bound / 2) + ; + _setmaxstdio_nothrow (orig_max_stdio); + dtablesize = bound; + } + return dtablesize; +} + +#else + +# include <limits.h> +# include <sys/resource.h> + +# ifndef RLIM_SAVED_CUR +# define RLIM_SAVED_CUR RLIM_INFINITY +# endif +# ifndef RLIM_SAVED_MAX +# define RLIM_SAVED_MAX RLIM_INFINITY +# endif + +# ifdef __CYGWIN__ + /* Cygwin 1.7.25 auto-increases the RLIMIT_NOFILE soft limit until it + hits the compile-time constant hard limit of 3200. We might as + well just report the hard limit. */ +# define rlim_cur rlim_max +# endif + +int +getdtablesize (void) +{ +#if !defined(__redox__) + struct rlimit lim; + + if (getrlimit (RLIMIT_NOFILE, &lim) == 0 + && 0 <= lim.rlim_cur && lim.rlim_cur <= INT_MAX + && lim.rlim_cur != RLIM_INFINITY + && lim.rlim_cur != RLIM_SAVED_CUR + && lim.rlim_cur != RLIM_SAVED_MAX) + return lim.rlim_cur; +#endif + + return INT_MAX; +} + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/getopt-cdefs.in.h b/local/recipes/tools/diffutils/source/lib/getopt-cdefs.in.h new file mode 100644 index 0000000000..c71a4f11f6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/getopt-cdefs.in.h @@ -0,0 +1,67 @@ +/* getopt-on-non-glibc compatibility macros. + Copyright (C) 1989-2017 Free Software Foundation, Inc. + This file is part of gnulib. + Unlike most of the getopt implementation, it is NOT shared + with the GNU C Library. + + gnulib is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + gnulib is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with gnulib; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _GETOPT_CDEFS_H +#define _GETOPT_CDEFS_H 1 + +/* This header should not be used directly; include getopt.h or + unistd.h instead. It does not have a protective #error, because + the guard macro for getopt.h in gnulib is not fixed. */ + +/* getopt-core.h and getopt-ext.h are shared with GNU libc, and expect + a number of the internal macros supplied to GNU libc's headers by + sys/cdefs.h. Provide fallback definitions for all of them. */ +#if @HAVE_SYS_CDEFS_H@ +# include <sys/cdefs.h> +#endif + +#ifndef __BEGIN_DECLS +# ifdef __cplusplus +# define __BEGIN_DECLS extern "C" { +# else +# define __BEGIN_DECLS /* nothing */ +# endif +#endif +#ifndef __END_DECLS +# ifdef __cplusplus +# define __END_DECLS } +# else +# define __END_DECLS /* nothing */ +# endif +#endif + +#ifndef __GNUC_PREREQ +# if defined __GNUC__ && defined __GNUC_VERSION__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +# else +# define __GNUC_PREREQ(maj, min) 0 +# endif +#endif + +#ifndef __THROW +# if defined __cplusplus && __GNUC_PREREQ (2,8) +# define __THROW throw () +# else +# define __THROW +# endif +#endif + +#endif /* _GETOPT_CDEFS_H */ diff --git a/local/recipes/tools/diffutils/source/lib/getopt-core.h b/local/recipes/tools/diffutils/source/lib/getopt-core.h new file mode 100644 index 0000000000..d315891aef --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/getopt-core.h @@ -0,0 +1,96 @@ +/* Declarations for getopt (basic, portable features only). + Copyright (C) 1989-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library and is also part of gnulib. + Patches to this file should be submitted to both projects. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _GETOPT_CORE_H +#define _GETOPT_CORE_H 1 + +/* This header should not be used directly; include getopt.h or + unistd.h instead. Unlike most bits headers, it does not have + a protective #error, because the guard macro for getopt.h in + gnulib is not fixed. */ + +__BEGIN_DECLS + +/* For communication from 'getopt' to the caller. + When 'getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when 'ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to 'getopt'. + + On entry to 'getopt', zero means this is the first call; initialize. + + When 'getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, 'optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message 'getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +/* Get definitions and prototypes for functions to process the + arguments in ARGV (ARGC of them, minus the program name) for + options given in OPTS. + + Return the option character from OPTS just read. Return -1 when + there are no more options. For unrecognized options, or options + missing arguments, 'optopt' is set to the option letter, and '?' is + returned. + + The OPTS string is a list of characters which are recognized option + letters, optionally followed by colons, specifying that that letter + takes an argument, to be placed in 'optarg'. + + If a letter in OPTS is followed by two colons, its argument is + optional. This behavior is specific to the GNU 'getopt'. + + The argument '--' causes premature termination of argument + scanning, explicitly telling 'getopt' that there are no more + options. + + If OPTS begins with '-', then non-option arguments are treated as + arguments to the option '\1'. This behavior is specific to the GNU + 'getopt'. If OPTS begins with '+', or POSIXLY_CORRECT is set in + the environment, then do not permute arguments. + + For standards compliance, the 'argv' argument has the type + char *const *, but this is inaccurate; if argument permutation is + enabled, the argv array (not the strings it points to) must be + writable. */ + +extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) + __THROW _GL_ARG_NONNULL ((2, 3)); + +__END_DECLS + +#endif /* _GETOPT_CORE_H */ diff --git a/local/recipes/tools/diffutils/source/lib/getopt-ext.h b/local/recipes/tools/diffutils/source/lib/getopt-ext.h new file mode 100644 index 0000000000..e4da22f54f --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/getopt-ext.h @@ -0,0 +1,77 @@ +/* Declarations for getopt (GNU extensions). + Copyright (C) 1989-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library and is also part of gnulib. + Patches to this file should be submitted to both projects. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _GETOPT_EXT_H +#define _GETOPT_EXT_H 1 + +/* This header should not be used directly; include getopt.h instead. + Unlike most bits headers, it does not have a protective #error, + because the guard macro for getopt.h in gnulib is not fixed. */ + +__BEGIN_DECLS + +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of 'struct option' terminated by an element containing a name which is + zero. + + The field 'has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field 'flag' is not NULL, it points to a variable that is set + to the value given in the field 'val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an 'int' to + a compiled-in constant, such as set a value from 'optarg', set the + option's 'flag' field to zero and its 'val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero 'flag' field, 'getopt' + returns the contents of the 'val' field. */ + +struct option +{ + const char *name; + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the 'has_arg' field of 'struct option'. */ + +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + +extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind) + __THROW _GL_ARG_NONNULL ((2, 3)); +extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind) + __THROW _GL_ARG_NONNULL ((2, 3)); + +__END_DECLS + +#endif /* _GETOPT_EXT_H */ diff --git a/local/recipes/tools/diffutils/source/lib/getopt-pfx-core.h b/local/recipes/tools/diffutils/source/lib/getopt-pfx-core.h new file mode 100644 index 0000000000..4dc427dc3e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/getopt-pfx-core.h @@ -0,0 +1,54 @@ +/* getopt (basic, portable features) gnulib wrapper header. + Copyright (C) 1989-2017 Free Software Foundation, Inc. + This file is part of gnulib. + Unlike most of the getopt implementation, it is NOT shared + with the GNU C Library. + + gnulib is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + gnulib is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with gnulib; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _GETOPT_PFX_CORE_H +#define _GETOPT_PFX_CORE_H 1 + +/* This header should not be used directly; include getopt.h or + unistd.h instead. It does not have a protective #error, because + the guard macro for getopt.h in gnulib is not fixed. */ + +/* Standalone applications should #define __GETOPT_PREFIX to an + identifier that prefixes the external functions and variables + defined in getopt-core.h and getopt-ext.h. Systematically + rename identifiers so that they do not collide with the system + functions and variables. Renaming avoids problems with some + compilers and linkers. */ +#ifdef __GETOPT_PREFIX +# ifndef __GETOPT_ID +# define __GETOPT_CONCAT(x, y) x ## y +# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y) +# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y) +# endif +# undef getopt +# undef optarg +# undef opterr +# undef optind +# undef optopt +# define getopt __GETOPT_ID (getopt) +# define optarg __GETOPT_ID (optarg) +# define opterr __GETOPT_ID (opterr) +# define optind __GETOPT_ID (optind) +# define optopt __GETOPT_ID (optopt) +#endif + +#include <getopt-core.h> + +#endif /* _GETOPT_PFX_CORE_H */ diff --git a/local/recipes/tools/diffutils/source/lib/getopt-pfx-ext.h b/local/recipes/tools/diffutils/source/lib/getopt-pfx-ext.h new file mode 100644 index 0000000000..0839759179 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/getopt-pfx-ext.h @@ -0,0 +1,66 @@ +/* getopt (GNU extensions) gnulib wrapper header. + Copyright (C) 1989-2017 Free Software Foundation, Inc. + This file is part of gnulib. + Unlike most of the getopt implementation, it is NOT shared + with the GNU C Library. + + gnulib is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + gnulib is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with gnulib; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _GETOPT_PFX_EXT_H +#define _GETOPT_PFX_EXT_H 1 + +/* This header should not be used directly; include getopt.h instead. + It does not have a protective #error, because the guard macro for + getopt.h in gnulib is not fixed. */ + +/* Standalone applications should #define __GETOPT_PREFIX to an + identifier that prefixes the external functions and variables + defined in getopt-core.h and getopt-ext.h. Systematically + rename identifiers so that they do not collide with the system + functions and variables. Renaming avoids problems with some + compilers and linkers. */ +#ifdef __GETOPT_PREFIX +# ifndef __GETOPT_ID +# define __GETOPT_CONCAT(x, y) x ## y +# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y) +# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y) +# endif +# undef getopt_long +# undef getopt_long_only +# undef option +# undef _getopt_internal +# define getopt_long __GETOPT_ID (getopt_long) +# define getopt_long_only __GETOPT_ID (getopt_long_only) +# define option __GETOPT_ID (option) +# define _getopt_internal __GETOPT_ID (getopt_internal) +#endif + +/* Standalone applications get correct prototypes for getopt_long and + getopt_long_only; they declare "char **argv". For backward + compatibility with old applications, if __GETOPT_PREFIX is not + defined, we supply GNU-libc-compatible, but incorrect, prototypes + using "char *const *argv". (GNU libc is stuck with the incorrect + prototypes, as they are baked into older versions of LSB.) */ +#ifndef __getopt_argv_const +# if defined __GETOPT_PREFIX +# define __getopt_argv_const /* empty */ +# else +# define __getopt_argv_const const +# endif +#endif + +#include <getopt-ext.h> + +#endif /* _GETOPT_PFX_EXT_H */ diff --git a/local/recipes/tools/diffutils/source/lib/getopt.c b/local/recipes/tools/diffutils/source/lib/getopt.c new file mode 100644 index 0000000000..9a2867db27 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/getopt.c @@ -0,0 +1,811 @@ +/* Getopt for GNU. + Copyright (C) 1987-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library and is also part of gnulib. + Patches to this file should be submitted to both projects. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LIBC +# include <config.h> +#endif + +#include "getopt.h" + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#ifdef _LIBC +/* When used as part of glibc, error printing must be done differently + for standards compliance. getopt is not a cancellation point, so + it must not call functions that are, and it is specified by an + older standard than stdio locking, so it must not refer to + functions in the "user namespace" related to stdio locking. + Finally, it must use glibc's internal message translation so that + the messages are looked up in the proper text domain. */ +# include <libintl.h> +# define fprintf __fxprintf_nocancel +# define flockfile(fp) _IO_flockfile (fp) +# define funlockfile(fp) _IO_funlockfile (fp) +#else +# include "gettext.h" +# define _(msgid) gettext (msgid) +/* When used standalone, flockfile and funlockfile might not be + available. */ +# if (!defined _POSIX_THREAD_SAFE_FUNCTIONS \ + || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) +# define flockfile(fp) /* nop */ +# define funlockfile(fp) /* nop */ +# endif +/* When used standalone, do not attempt to use alloca. */ +# define __libc_use_alloca(size) 0 +# undef alloca +# define alloca(size) (abort (), (void *)0) +#endif + +/* This implementation of 'getopt' has three modes for handling + options interspersed with non-option arguments. It can stop + scanning for options at the first non-option argument encountered, + as POSIX specifies. It can continue scanning for options after the + first non-option argument, but permute 'argv' as it goes so that, + after 'getopt' is done, all the options precede all the non-option + arguments and 'optind' points to the first non-option argument. + Or, it can report non-option arguments as if they were arguments to + the option character '\x01'. + + The default behavior of 'getopt_long' is to permute the argument list. + When this implementation is used standalone, the default behavior of + 'getopt' is to stop at the first non-option argument, but when it is + used as part of GNU libc it also permutes the argument list. In both + cases, setting the environment variable POSIXLY_CORRECT to any value + disables permutation. + + If the first character of the OPTSTRING argument to 'getopt' or + 'getopt_long' is '+', both functions will stop at the first + non-option argument. If it is '-', both functions will report + non-option arguments as arguments to the option character '\x01'. */ + +#include "getopt_int.h" + +/* For communication from 'getopt' to the caller. + When 'getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when 'ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to 'getopt'. + + On entry to 'getopt', zero means this is the first call; initialize. + + When 'getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, 'optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +/* 1003.2 says this must be 1 before any call. */ +int optind = 1; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +int optopt = '?'; + +/* Keep a global copy of all internal members of getopt_data. */ + +static struct _getopt_data getopt_data; + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + 'first_nonopt' and 'last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. */ + +static void +exchange (char **argv, struct _getopt_data *d) +{ + int bottom = d->__first_nonopt; + int middle = d->__last_nonopt; + int top = d->optind; + char *tem; + + /* Exchange the shorter segment with the far end of the longer segment. + That puts the shorter segment into the right place. + It leaves the longer segment in the right place overall, + but it consists of two parts that need to be swapped next. */ + + while (top > middle && middle > bottom) + { + if (top - middle > middle - bottom) + { + /* Bottom segment is the short one. */ + int len = middle - bottom; + int i; + + /* Swap it with the top part of the top segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[top - (middle - bottom) + i]; + argv[top - (middle - bottom) + i] = tem; + } + /* Exclude the moved bottom segment from further swapping. */ + top -= len; + } + else + { + /* Top segment is the short one. */ + int len = top - middle; + int i; + + /* Swap it with the bottom part of the bottom segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[middle + i]; + argv[middle + i] = tem; + } + /* Exclude the moved top segment from further swapping. */ + bottom += len; + } + } + + /* Update records for the slots the non-options now occupy. */ + + d->__first_nonopt += (d->optind - d->__last_nonopt); + d->__last_nonopt = d->optind; +} + +/* Process the argument starting with d->__nextchar as a long option. + d->optind should *not* have been advanced over this argument. + + If the value returned is -1, it was not actually a long option, the + state is unchanged, and the argument should be processed as a set + of short options (this can only happen when long_only is true). + Otherwise, the option (and its argument, if any) have been consumed + and the return value is the value to return from _getopt_internal_r. */ +static int +process_long_option (int argc, char **argv, const char *optstring, + const struct option *longopts, int *longind, + int long_only, struct _getopt_data *d, + int print_errors, const char *prefix) +{ + char *nameend; + size_t namelen; + const struct option *p; + const struct option *pfound = NULL; + int n_options; + int option_index; + + for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + namelen = nameend - d->__nextchar; + + /* First look for an exact match, counting the options as a side + effect. */ + for (p = longopts, n_options = 0; p->name; p++, n_options++) + if (!strncmp (p->name, d->__nextchar, namelen) + && namelen == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + option_index = n_options; + break; + } + + if (pfound == NULL) + { + /* Didn't find an exact match, so look for abbreviations. */ + unsigned char *ambig_set = NULL; + int ambig_malloced = 0; + int ambig_fallback = 0; + int indfound = -1; + + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, d->__nextchar, namelen)) + { + if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else if (long_only + || pfound->has_arg != p->has_arg + || pfound->flag != p->flag + || pfound->val != p->val) + { + /* Second or later nonexact match found. */ + if (!ambig_fallback) + { + if (!print_errors) + /* Don't waste effort tracking the ambig set if + we're not going to print it anyway. */ + ambig_fallback = 1; + else if (!ambig_set) + { + if (__libc_use_alloca (n_options)) + ambig_set = alloca (n_options); + else if ((ambig_set = malloc (n_options)) == NULL) + /* Fall back to simpler error message. */ + ambig_fallback = 1; + else + ambig_malloced = 1; + + if (ambig_set) + { + memset (ambig_set, 0, n_options); + ambig_set[indfound] = 1; + } + } + if (ambig_set) + ambig_set[option_index] = 1; + } + } + } + + if (ambig_set || ambig_fallback) + { + if (print_errors) + { + if (ambig_fallback) + fprintf (stderr, _("%s: option '%s%s' is ambiguous\n"), + argv[0], prefix, d->__nextchar); + else + { + flockfile (stderr); + fprintf (stderr, + _("%s: option '%s%s' is ambiguous; possibilities:"), + argv[0], prefix, d->__nextchar); + + for (option_index = 0; option_index < n_options; option_index++) + if (ambig_set[option_index]) + fprintf (stderr, " '%s%s'", + prefix, longopts[option_index].name); + + /* This must use 'fprintf' even though it's only + printing a single character, so that it goes through + __fxprintf_nocancel when compiled as part of glibc. */ + fprintf (stderr, "\n"); + funlockfile (stderr); + } + } + if (ambig_malloced) + free (ambig_set); + d->__nextchar += strlen (d->__nextchar); + d->optind++; + d->optopt = 0; + return '?'; + } + + option_index = indfound; + } + + if (pfound == NULL) + { + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short option, + then it's an error. */ + if (!long_only || argv[d->optind][1] == '-' + || strchr (optstring, *d->__nextchar) == NULL) + { + if (print_errors) + fprintf (stderr, _("%s: unrecognized option '%s%s'\n"), + argv[0], prefix, d->__nextchar); + + d->__nextchar = NULL; + d->optind++; + d->optopt = 0; + return '?'; + } + + /* Otherwise interpret it as a short option. */ + return -1; + } + + /* We have found a matching long option. Consume it. */ + d->optind++; + d->__nextchar = NULL; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + d->optarg = nameend + 1; + else + { + if (print_errors) + fprintf (stderr, + _("%s: option '%s%s' doesn't allow an argument\n"), + argv[0], prefix, pfound->name); + + d->optopt = pfound->val; + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (d->optind < argc) + d->optarg = argv[d->optind++]; + else + { + if (print_errors) + fprintf (stderr, + _("%s: option '%s%s' requires an argument\n"), + argv[0], prefix, pfound->name); + + d->optopt = pfound->val; + return optstring[0] == ':' ? ':' : '?'; + } + } + + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; +} + +/* Initialize internal data upon the first call to getopt. */ + +static const char * +_getopt_initialize (int argc _GL_UNUSED, + char **argv _GL_UNUSED, const char *optstring, + struct _getopt_data *d, int posixly_correct) +{ + /* Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + if (d->optind == 0) + d->optind = 1; + + d->__first_nonopt = d->__last_nonopt = d->optind; + d->__nextchar = NULL; + + /* Determine how to handle the ordering of options and nonoptions. */ + if (optstring[0] == '-') + { + d->__ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + d->__ordering = REQUIRE_ORDER; + ++optstring; + } + else if (posixly_correct || !!getenv ("POSIXLY_CORRECT")) + d->__ordering = REQUIRE_ORDER; + else + d->__ordering = PERMUTE; + + d->__initialized = 1; + return optstring; +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If 'getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If 'getopt' finds another option character, it returns that character, + updating 'optind' and 'nextchar' so that the next call to 'getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, 'getopt' returns -1. + Then 'optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return '?' after printing an error message. If you set 'opterr' to + zero, the error message is suppressed but we still return '?'. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in 'optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in 'optarg', otherwise 'optarg' is set to zero. + + If OPTSTRING starts with '-' or '+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with '--' instead of '-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a '=', or else the in next ARGV-element. + When 'getopt' finds a long-named option, it returns 0 if that option's + 'flag' field is nonzero, the value of the option's 'val' field + if the 'flag' field is zero. + + The elements of ARGV aren't really const, because we permute them. + But we pretend they're const in the prototype to be compatible + with other systems. + + LONGOPTS is a vector of 'struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. */ + +int +_getopt_internal_r (int argc, char **argv, const char *optstring, + const struct option *longopts, int *longind, + int long_only, struct _getopt_data *d, int posixly_correct) +{ + int print_errors = d->opterr; + + if (argc < 1) + return -1; + + d->optarg = NULL; + + if (d->optind == 0 || !d->__initialized) + optstring = _getopt_initialize (argc, argv, optstring, d, posixly_correct); + else if (optstring[0] == '-' || optstring[0] == '+') + optstring++; + + if (optstring[0] == ':') + print_errors = 0; + + /* Test whether ARGV[optind] points to a non-option argument. */ +#define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0') + + if (d->__nextchar == NULL || *d->__nextchar == '\0') + { + /* Advance to the next ARGV-element. */ + + /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been + moved back by the user (who may also have changed the arguments). */ + if (d->__last_nonopt > d->optind) + d->__last_nonopt = d->optind; + if (d->__first_nonopt > d->optind) + d->__first_nonopt = d->optind; + + if (d->__ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (d->__first_nonopt != d->__last_nonopt + && d->__last_nonopt != d->optind) + exchange (argv, d); + else if (d->__last_nonopt != d->optind) + d->__first_nonopt = d->optind; + + /* Skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (d->optind < argc && NONOPTION_P) + d->optind++; + d->__last_nonopt = d->optind; + } + + /* The special ARGV-element '--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (d->optind != argc && !strcmp (argv[d->optind], "--")) + { + d->optind++; + + if (d->__first_nonopt != d->__last_nonopt + && d->__last_nonopt != d->optind) + exchange (argv, d); + else if (d->__first_nonopt == d->__last_nonopt) + d->__first_nonopt = d->optind; + d->__last_nonopt = argc; + + d->optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (d->optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (d->__first_nonopt != d->__last_nonopt) + d->optind = d->__first_nonopt; + return -1; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if (NONOPTION_P) + { + if (d->__ordering == REQUIRE_ORDER) + return -1; + d->optarg = argv[d->optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Check whether it might be a long option. */ + if (longopts) + { + if (argv[d->optind][1] == '-') + { + /* "--foo" is always a long option. The special option + "--" was handled above. */ + d->__nextchar = argv[d->optind] + 2; + return process_long_option (argc, argv, optstring, longopts, + longind, long_only, d, + print_errors, "--"); + } + + /* If long_only and the ARGV-element has the form "-f", + where f is a valid short option, don't consider it an + abbreviated form of a long option that starts with f. + Otherwise there would be no way to give the -f short + option. + + On the other hand, if there's a long option "fubar" and + the ARGV-element is "-fu", do consider that an + abbreviation of the long option, just like "--fu", and + not "-f" with arg "u". + + This distinction seems to be the most useful approach. */ + if (long_only && (argv[d->optind][2] + || !strchr (optstring, argv[d->optind][1]))) + { + int code; + d->__nextchar = argv[d->optind] + 1; + code = process_long_option (argc, argv, optstring, longopts, + longind, long_only, d, + print_errors, "-"); + if (code != -1) + return code; + } + } + + /* It is not a long option. Skip the initial punctuation. */ + d->__nextchar = argv[d->optind] + 1; + } + + /* Look at and handle the next short option-character. */ + + { + char c = *d->__nextchar++; + const char *temp = strchr (optstring, c); + + /* Increment 'optind' when we start to process its last character. */ + if (*d->__nextchar == '\0') + ++d->optind; + + if (temp == NULL || c == ':' || c == ';') + { + if (print_errors) + fprintf (stderr, _("%s: invalid option -- '%c'\n"), argv[0], c); + d->optopt = c; + return '?'; + } + + /* Convenience. Treat POSIX -W foo same as long option --foo */ + if (temp[0] == 'W' && temp[1] == ';' && longopts != NULL) + { + /* This is an option that requires an argument. */ + if (*d->__nextchar != '\0') + d->optarg = d->__nextchar; + else if (d->optind == argc) + { + if (print_errors) + fprintf (stderr, + _("%s: option requires an argument -- '%c'\n"), + argv[0], c); + + d->optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + return c; + } + else + d->optarg = argv[d->optind]; + + d->__nextchar = d->optarg; + d->optarg = NULL; + return process_long_option (argc, argv, optstring, longopts, longind, + 0 /* long_only */, d, print_errors, "-W "); + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*d->__nextchar != '\0') + { + d->optarg = d->__nextchar; + d->optind++; + } + else + d->optarg = NULL; + d->__nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*d->__nextchar != '\0') + { + d->optarg = d->__nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + d->optind++; + } + else if (d->optind == argc) + { + if (print_errors) + fprintf (stderr, + _("%s: option requires an argument -- '%c'\n"), + argv[0], c); + + d->optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented 'optind' once; + increment it again when taking next ARGV-elt as argument. */ + d->optarg = argv[d->optind++]; + d->__nextchar = NULL; + } + } + return c; + } +} + +int +_getopt_internal (int argc, char **argv, const char *optstring, + const struct option *longopts, int *longind, int long_only, + int posixly_correct) +{ + int result; + + getopt_data.optind = optind; + getopt_data.opterr = opterr; + + result = _getopt_internal_r (argc, argv, optstring, longopts, + longind, long_only, &getopt_data, + posixly_correct); + + optind = getopt_data.optind; + optarg = getopt_data.optarg; + optopt = getopt_data.optopt; + + return result; +} + +/* glibc gets a LSB-compliant getopt and a POSIX-complaint __posix_getopt. + Standalone applications just get a POSIX-compliant getopt. + POSIX and LSB both require these functions to take 'char *const *argv' + even though this is incorrect (because of the permutation). */ +#define GETOPT_ENTRY(NAME, POSIXLY_CORRECT) \ + int \ + NAME (int argc, char *const *argv, const char *optstring) \ + { \ + return _getopt_internal (argc, (char **)argv, optstring, \ + 0, 0, 0, POSIXLY_CORRECT); \ + } + +#ifdef _LIBC +GETOPT_ENTRY(getopt, 0) +GETOPT_ENTRY(__posix_getopt, 1) +#else +GETOPT_ENTRY(getopt, 1) +#endif + + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of 'getopt'. */ + +int +main (int argc, char **argv) +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == -1) + break; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value '%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/local/recipes/tools/diffutils/source/lib/getopt.in.h b/local/recipes/tools/diffutils/source/lib/getopt.in.h new file mode 100644 index 0000000000..4ce1eb485a --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/getopt.in.h @@ -0,0 +1,61 @@ +/* Declarations for getopt. + Copyright (C) 1989-2017 Free Software Foundation, Inc. + This file is part of gnulib. + Unlike most of the getopt implementation, it is NOT shared + with the GNU C Library, which supplies a different version of + this file. + + gnulib is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + gnulib is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with gnulib; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _@GUARD_PREFIX@_GETOPT_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* The include_next requires a split double-inclusion guard. We must + also inform the replacement unistd.h to not recursively use + <getopt.h>; our definitions will be present soon enough. */ +#if @HAVE_GETOPT_H@ +# define _GL_SYSTEM_GETOPT +# @INCLUDE_NEXT@ @NEXT_GETOPT_H@ +# undef _GL_SYSTEM_GETOPT +#endif + +#define _@GUARD_PREFIX@_GETOPT_H 1 + +/* Standalone applications should #define __GETOPT_PREFIX to an + identifier that prefixes the external functions and variables + defined in getopt-core.h and getopt-ext.h. When this happens, + include the headers that might declare getopt so that they will not + cause confusion if included after this file (if the system had + <getopt.h>, we have already included it). */ +#if defined __GETOPT_PREFIX +# if !@HAVE_GETOPT_H@ +# define __need_system_stdlib_h +# include <stdlib.h> +# undef __need_system_stdlib_h +# include <stdio.h> +# include <unistd.h> +# endif +#endif + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +#include <getopt-cdefs.h> +#include <getopt-pfx-core.h> +#include <getopt-pfx-ext.h> + +#endif /* _@GUARD_PREFIX@_GETOPT_H */ diff --git a/local/recipes/tools/diffutils/source/lib/getopt1.c b/local/recipes/tools/diffutils/source/lib/getopt1.c new file mode 100644 index 0000000000..2bc5926016 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/getopt1.c @@ -0,0 +1,159 @@ +/* getopt_long and getopt_long_only entry points for GNU getopt. + Copyright (C) 1987-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library and is also part of gnulib. + Patches to this file should be submitted to both projects. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LIBC +# include <config.h> +#endif + +#include "getopt.h" +#include "getopt_int.h" + +int +getopt_long (int argc, char *__getopt_argv_const *argv, const char *options, + const struct option *long_options, int *opt_index) +{ + return _getopt_internal (argc, (char **) argv, options, long_options, + opt_index, 0, 0); +} + +int +_getopt_long_r (int argc, char **argv, const char *options, + const struct option *long_options, int *opt_index, + struct _getopt_data *d) +{ + return _getopt_internal_r (argc, argv, options, long_options, opt_index, + 0, d, 0); +} + +/* Like getopt_long, but '-' as well as '--' can indicate a long option. + If an option that starts with '-' (not '--') doesn't match a long option, + but does match a short option, it is parsed as a short option + instead. */ + +int +getopt_long_only (int argc, char *__getopt_argv_const *argv, + const char *options, + const struct option *long_options, int *opt_index) +{ + return _getopt_internal (argc, (char **) argv, options, long_options, + opt_index, 1, 0); +} + +int +_getopt_long_only_r (int argc, char **argv, const char *options, + const struct option *long_options, int *opt_index, + struct _getopt_data *d) +{ + return _getopt_internal_r (argc, argv, options, long_options, opt_index, + 1, d, 0); +} + + +#ifdef TEST + +#include <stdio.h> +#include <stdlib.h> + +int +main (int argc, char **argv) +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + int option_index = 0; + static const struct option long_options[] = + { + {"add", 1, 0, 0}, + {"append", 0, 0, 0}, + {"delete", 1, 0, 0}, + {"verbose", 0, 0, 0}, + {"create", 0, 0, 0}, + {"file", 1, 0, 0}, + {0, 0, 0, 0} + }; + + c = getopt_long (argc, argv, "abc:d:0123456789", + long_options, &option_index); + if (c == -1) + break; + + switch (c) + { + case 0: + printf ("option %s", long_options[option_index].name); + if (optarg) + printf (" with arg %s", optarg); + printf ("\n"); + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value '%s'\n", optarg); + break; + + case 'd': + printf ("option d with value '%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/local/recipes/tools/diffutils/source/lib/getopt_int.h b/local/recipes/tools/diffutils/source/lib/getopt_int.h new file mode 100644 index 0000000000..a556219512 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/getopt_int.h @@ -0,0 +1,118 @@ +/* Internal declarations for getopt. + Copyright (C) 1989-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library and is also part of gnulib. + Patches to this file should be submitted to both projects. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _GETOPT_INT_H +#define _GETOPT_INT_H 1 + +#include <getopt.h> + +extern int _getopt_internal (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only, int __posixly_correct); + + +/* Reentrant versions which can handle parsing multiple argument + vectors at the same time. */ + +/* Describe how to deal with options that follow non-option ARGV-elements. + + REQUIRE_ORDER means don't recognize them as options; stop option + processing when the first non-option is seen. This is what POSIX + specifies should happen. + + PERMUTE means permute the contents of ARGV as we scan, so that + eventually all the non-options are at the end. This allows options + to be given in any order, even with programs that were not written + to expect this. + + RETURN_IN_ORDER is an option available to programs that were + written to expect options and other ARGV-elements in any order + and that care about the ordering of the two. We describe each + non-option ARGV-element as if it were the argument of an option + with character code 1. + + The special argument '--' forces an end of option-scanning regardless + of the value of 'ordering'. In the case of RETURN_IN_ORDER, only + '--' can cause 'getopt' to return -1 with 'optind' != ARGC. */ + +enum __ord + { + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER + }; + +/* Data type for reentrant functions. */ +struct _getopt_data +{ + /* These have exactly the same meaning as the corresponding global + variables, except that they are used for the reentrant + versions of getopt. */ + int optind; + int opterr; + int optopt; + char *optarg; + + /* Internal members. */ + + /* True if the internal members have been initialized. */ + int __initialized; + + /* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + char *__nextchar; + + /* See __ord above. */ + enum __ord __ordering; + + /* Handle permutation of arguments. */ + + /* Describe the part of ARGV that contains non-options that have + been skipped. 'first_nonopt' is the index in ARGV of the first + of them; 'last_nonopt' is the index after the last of them. */ + + int __first_nonopt; + int __last_nonopt; +}; + +/* The initializer is necessary to set OPTIND and OPTERR to their + default values and to clear the initialization flag. */ +#define _GETOPT_DATA_INITIALIZER { 1, 1 } + +extern int _getopt_internal_r (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only, struct _getopt_data *__data, + int __posixly_correct); + +extern int _getopt_long_r (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + struct _getopt_data *__data); + +extern int _getopt_long_only_r (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, + int *__longind, + struct _getopt_data *__data); + +#endif /* getopt_int.h */ diff --git a/local/recipes/tools/diffutils/source/lib/getprogname.c b/local/recipes/tools/diffutils/source/lib/getprogname.c new file mode 100644 index 0000000000..7c655aea8d --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/getprogname.c @@ -0,0 +1,204 @@ +/* Program name management. + Copyright (C) 2016-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "getprogname.h" + +#include <errno.h> /* get program_invocation_name declaration */ +#include <stdlib.h> /* get __argv declaration */ + +#ifdef _AIX +# include <unistd.h> +# include <procinfo.h> +# include <string.h> +#endif + +#ifdef __MVS__ +# ifndef _OPEN_SYS +# define _OPEN_SYS +# endif +# include <string.h> +# include <sys/ps.h> +#endif + +#ifdef __hpux +# include <unistd.h> +# include <sys/param.h> +# include <sys/pstat.h> +# include <string.h> +#endif + +#ifdef __sgi +# include <string.h> +# include <unistd.h> +# include <stdio.h> +# include <fcntl.h> +# include <sys/procfs.h> +#endif + +#if defined(__redox__) +# include <string.h> +# include <unistd.h> +# include <stdio.h> +# include <fcntl.h> +# include <limits.h> +#endif + +#include "dirname.h" + +#ifndef HAVE_GETPROGNAME /* not Mac OS X, FreeBSD, NetBSD, OpenBSD >= 5.4, Cygwin */ +char const * +getprogname (void) +{ +# if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME /* glibc, BeOS */ + /* https://www.gnu.org/software/libc/manual/html_node/Error-Messages.html */ + return program_invocation_short_name; +# elif HAVE_DECL_PROGRAM_INVOCATION_NAME /* glibc, BeOS */ + /* https://www.gnu.org/software/libc/manual/html_node/Error-Messages.html */ + return last_component (program_invocation_name); +# elif HAVE_GETEXECNAME /* Solaris */ + /* http://docs.oracle.com/cd/E19253-01/816-5168/6mbb3hrb1/index.html */ + const char *p = getexecname (); + if (!p) + p = "?"; + return last_component (p); +# elif HAVE_DECL___ARGV /* mingw, MSVC */ + /* https://msdn.microsoft.com/en-us/library/dn727674.aspx */ + const char *p = __argv && __argv[0] ? __argv[0] : "?"; + return last_component (p); +# elif HAVE_VAR___PROGNAME /* OpenBSD, QNX */ + /* http://man.openbsd.org/style.9 */ + /* http://www.qnx.de/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.neutrino_lib_ref%2Fp%2F__progname.html */ + /* Be careful to declare this only when we absolutely need it + (OpenBSD 5.1), rather than when it's available. Otherwise, + its mere declaration makes program_invocation_short_name + malfunction (have zero length) with Fedora 25's glibc. */ + extern char *__progname; + const char *p = __progname; + return p && p[0] ? p : "?"; +# elif _AIX /* AIX */ + /* Idea by Bastien ROUCARIÈS, + http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00095.html + Reference: http:// + ibm.biz/knowctr#ssw_aix_53/com.ibm.aix.basetechref/doc/basetrf1/getprocs.htm + */ + static char *p; + static int first = 1; + if (first) + { + first = 0; + pid_t pid = getpid (); + struct procentry64 procs; + p = (0 < getprocs64 (&procs, sizeof procs, NULL, 0, &pid, 1) + ? strdup (procs.pi_comm) + : NULL); + if (!p) + p = "?"; + } + return p; +# elif defined __hpux + static char *p; + static int first = 1; + if (first) + { + first = 0; + pid_t pid = getpid (); + struct pst_status status; + p = (0 < pstat_getproc (&status, sizeof status, 0, pid) + ? strdup (status.pst_ucomm) + : NULL); + if (!p) + p = "?"; + } + return p; +# elif __MVS__ /* z/OS */ + /* https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxbd00/rtwgetp.htm */ + static char *p = "?"; + static int first = 1; + if (first) + { + pid_t pid = getpid (); + int token; + W_PSPROC buf; + first = 0; + memset (&buf, 0, sizeof(buf)); + buf.ps_cmdptr = (char *) malloc (buf.ps_cmdlen = PS_CMDBLEN_LONG); + buf.ps_conttyptr = (char *) malloc (buf.ps_conttylen = PS_CONTTYBLEN); + buf.ps_pathptr = (char *) malloc (buf.ps_pathlen = PS_PATHBLEN); + if (buf.ps_cmdptr && buf.ps_conttyptr && buf.ps_pathptr) + { + for (token = 0; token >= 0; + token = w_getpsent (token, &buf, sizeof(buf))) + { + if (token > 0 && buf.ps_pid == pid) + { + char *s = strdup (last_component (buf.ps_pathptr)); + if (s) + p = s; + break; + } + } + } + free (buf.ps_cmdptr); + free (buf.ps_conttyptr); + free (buf.ps_pathptr); + } + return p; +# elif defined __sgi /* IRIX */ + char filename[50]; + int fd; + + sprintf (filename, "/proc/pinfo/%d", (int) getpid ()); + fd = open (filename, O_RDONLY); + if (0 <= fd) + { + prpsinfo_t buf; + int ioctl_ok = 0 <= ioctl (fd, PIOCPSINFO, &buf); + close (fd); + if (ioctl_ok) + { + char *name = buf.pr_fname; + char *namesize = sizeof buf.pr_fname; + char *namenul = memchr (name, '\0', namesize); + size_t namelen = namenul ? namenul - name : namesize; + char *namecopy = malloc (namelen + 1); + if (namecopy) + { + namecopy[namelen] = 0; + return memcpy (namecopy, name, namelen); + } + } + } + return NULL; +# elif defined(__redox__) + char filename[PATH_MAX]; + int fd = open ("sys:exe", O_RDONLY); + if (fd > 0) { + int len = read(fd, filename, PATH_MAX-1); + if (len > 0) { + filename[len] = '\0'; + return strdup(filename); + } + } + return NULL; +# else +# error "getprogname module not ported to this OS" +# endif +} + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/getprogname.h b/local/recipes/tools/diffutils/source/lib/getprogname.h new file mode 100644 index 0000000000..9ab924ca4b --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/getprogname.h @@ -0,0 +1,40 @@ +/* Program name management. + Copyright (C) 2016-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _GL_GETPROGNAME_H +#define _GL_GETPROGNAME_H + +#include <stdlib.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* Return the base name of the executing program. + On native Windows this will usually end in ".exe" or ".EXE". */ +#ifndef HAVE_GETPROGNAME +extern char const *getprogname (void) +# ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME + _GL_ATTRIBUTE_PURE +# endif + ; +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/gettext.h b/local/recipes/tools/diffutils/source/lib/gettext.h new file mode 100644 index 0000000000..e7520af252 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/gettext.h @@ -0,0 +1,293 @@ +/* Convenience header for conditional use of GNU <libintl.h>. + Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2017 Free Software + Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _LIBGETTEXT_H +#define _LIBGETTEXT_H 1 + +/* NLS can be disabled through the configure --disable-nls option + or through "#define ENABLE NLS 0" before including this file. */ +#if defined ENABLE_NLS && ENABLE_NLS + +/* Get declarations of GNU message catalog functions. */ +# include <libintl.h> + +/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by + the gettext() and ngettext() macros. This is an alternative to calling + textdomain(), and is useful for libraries. */ +# ifdef DEFAULT_TEXT_DOMAIN +# undef gettext +# define gettext(Msgid) \ + dgettext (DEFAULT_TEXT_DOMAIN, Msgid) +# undef ngettext +# define ngettext(Msgid1, Msgid2, N) \ + dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) +# endif + +#else + +/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which + chokes if dcgettext is defined as a macro. So include it now, to make + later inclusions of <locale.h> a NOP. We don't include <libintl.h> + as well because people using "gettext.h" will not include <libintl.h>, + and also including <libintl.h> would fail on SunOS 4, whereas <locale.h> + is OK. */ +#if defined(__sun) +# include <locale.h> +#endif + +/* Many header files from the libstdc++ coming with g++ 3.3 or newer include + <libintl.h>, which chokes if dcgettext is defined as a macro. So include + it now, to make later inclusions of <libintl.h> a NOP. */ +#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) +# include <cstdlib> +# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || _GLIBCXX_HAVE_LIBINTL_H +# include <libintl.h> +# endif +#endif + +/* Disabled NLS. + The casts to 'const char *' serve the purpose of producing warnings + for invalid uses of the value returned from these functions. + On pre-ANSI systems without 'const', the config.h file is supposed to + contain "#define const". */ +# undef gettext +# define gettext(Msgid) ((const char *) (Msgid)) +# undef dgettext +# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) +# undef dcgettext +# define dcgettext(Domainname, Msgid, Category) \ + ((void) (Category), dgettext (Domainname, Msgid)) +# undef ngettext +# define ngettext(Msgid1, Msgid2, N) \ + ((N) == 1 \ + ? ((void) (Msgid2), (const char *) (Msgid1)) \ + : ((void) (Msgid1), (const char *) (Msgid2))) +# undef dngettext +# define dngettext(Domainname, Msgid1, Msgid2, N) \ + ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) +# undef dcngettext +# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ + ((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N)) +# undef textdomain +# define textdomain(Domainname) ((const char *) (Domainname)) +# undef bindtextdomain +# define bindtextdomain(Domainname, Dirname) \ + ((void) (Domainname), (const char *) (Dirname)) +# undef bind_textdomain_codeset +# define bind_textdomain_codeset(Domainname, Codeset) \ + ((void) (Domainname), (const char *) (Codeset)) + +#endif + +/* Prefer gnulib's setlocale override over libintl's setlocale override. */ +#ifdef GNULIB_defined_setlocale +# undef setlocale +# define setlocale rpl_setlocale +#endif + +/* A pseudo function call that serves as a marker for the automated + extraction of messages, but does not call gettext(). The run-time + translation is done at a different place in the code. + The argument, String, should be a literal string. Concatenated strings + and other string expressions won't work. + The macro's expansion is not parenthesized, so that it is suitable as + initializer for static 'char[]' or 'const char[]' variables. */ +#define gettext_noop(String) String + +/* The separator between msgctxt and msgid in a .mo file. */ +#define GETTEXT_CONTEXT_GLUE "\004" + +/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a + MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be + short and rarely need to change. + The letter 'p' stands for 'particular' or 'special'. */ +#ifdef DEFAULT_TEXT_DOMAIN +# define pgettext(Msgctxt, Msgid) \ + pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#else +# define pgettext(Msgctxt, Msgid) \ + pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#endif +#define dpgettext(Domainname, Msgctxt, Msgid) \ + pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ + pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) +#ifdef DEFAULT_TEXT_DOMAIN +# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#else +# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#endif +#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ + npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category) + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +pgettext_aux (const char *domain, + const char *msg_ctxt_id, const char *msgid, + int category) +{ + const char *translation = dcgettext (domain, msg_ctxt_id, category); + if (translation == msg_ctxt_id) + return msgid; + else + return translation; +} + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +npgettext_aux (const char *domain, + const char *msg_ctxt_id, const char *msgid, + const char *msgid_plural, unsigned long int n, + int category) +{ + const char *translation = + dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); + if (translation == msg_ctxt_id || translation == msgid_plural) + return (n == 1 ? msgid : msgid_plural); + else + return translation; +} + +/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID + can be arbitrary expressions. But for string literals these macros are + less efficient than those above. */ + +#include <string.h> + +#if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \ + /* || __STDC_VERSION__ >= 199901L */ ) +# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1 +#else +# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0 +#endif + +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS +#include <stdlib.h> +#endif + +#define pgettext_expr(Msgctxt, Msgid) \ + dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) +#define dpgettext_expr(Domainname, Msgctxt, Msgid) \ + dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +dcpgettext_expr (const char *domain, + const char *msgctxt, const char *msgid, + int category) +{ + size_t msgctxt_len = strlen (msgctxt) + 1; + size_t msgid_len = strlen (msgid) + 1; + const char *translation; +#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + char msg_ctxt_id[msgctxt_len + msgid_len]; +#else + char buf[1024]; + char *msg_ctxt_id = + (msgctxt_len + msgid_len <= sizeof (buf) + ? buf + : (char *) malloc (msgctxt_len + msgid_len)); + if (msg_ctxt_id != NULL) +#endif + { + int found_translation; + memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); + msg_ctxt_id[msgctxt_len - 1] = '\004'; + memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); + translation = dcgettext (domain, msg_ctxt_id, category); + found_translation = (translation != msg_ctxt_id); +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + if (msg_ctxt_id != buf) + free (msg_ctxt_id); +#endif + if (found_translation) + return translation; + } + return msgid; +} + +#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ + dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) +#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ + dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +dcnpgettext_expr (const char *domain, + const char *msgctxt, const char *msgid, + const char *msgid_plural, unsigned long int n, + int category) +{ + size_t msgctxt_len = strlen (msgctxt) + 1; + size_t msgid_len = strlen (msgid) + 1; + const char *translation; +#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + char msg_ctxt_id[msgctxt_len + msgid_len]; +#else + char buf[1024]; + char *msg_ctxt_id = + (msgctxt_len + msgid_len <= sizeof (buf) + ? buf + : (char *) malloc (msgctxt_len + msgid_len)); + if (msg_ctxt_id != NULL) +#endif + { + int found_translation; + memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); + msg_ctxt_id[msgctxt_len - 1] = '\004'; + memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); + translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); + found_translation = !(translation == msg_ctxt_id || translation == msgid_plural); +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + if (msg_ctxt_id != buf) + free (msg_ctxt_id); +#endif + if (found_translation) + return translation; + } + return (n == 1 ? msgid : msgid_plural); +} + +#endif /* _LIBGETTEXT_H */ diff --git a/local/recipes/tools/diffutils/source/lib/gettime.c b/local/recipes/tools/diffutils/source/lib/gettime.c new file mode 100644 index 0000000000..4ae313e78e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/gettime.c @@ -0,0 +1,48 @@ +/* gettime -- get the system clock + + Copyright (C) 2002, 2004-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +#include <config.h> + +#include "timespec.h" + +#include <sys/time.h> + +/* Get the system time into *TS. */ + +void +gettime (struct timespec *ts) +{ +#if HAVE_NANOTIME + nanotime (ts); +#else + +# if defined CLOCK_REALTIME && HAVE_CLOCK_GETTIME + if (clock_gettime (CLOCK_REALTIME, ts) == 0) + return; +# endif + + { + struct timeval tv; + gettimeofday (&tv, NULL); + ts->tv_sec = tv.tv_sec; + ts->tv_nsec = tv.tv_usec * 1000; + } + +#endif +} diff --git a/local/recipes/tools/diffutils/source/lib/gettimeofday.c b/local/recipes/tools/diffutils/source/lib/gettimeofday.c new file mode 100644 index 0000000000..8ae7622af3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/gettimeofday.c @@ -0,0 +1,146 @@ +/* Provide gettimeofday for systems that don't have it or for which it's broken. + + Copyright (C) 2001-2003, 2005-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* written by Jim Meyering */ + +#include <config.h> + +/* Specification. */ +#include <sys/time.h> + +#include <time.h> + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# define WINDOWS_NATIVE +# include <windows.h> +#endif + +#include "localtime-buffer.h" + +#ifdef WINDOWS_NATIVE + +/* GetSystemTimePreciseAsFileTime was introduced only in Windows 8. */ +typedef void (WINAPI * GetSystemTimePreciseAsFileTimeFuncType) (FILETIME *lpTime); +static GetSystemTimePreciseAsFileTimeFuncType GetSystemTimePreciseAsFileTimeFunc = NULL; +static BOOL initialized = FALSE; + +static void +initialize (void) +{ + HMODULE kernel32 = LoadLibrary ("kernel32.dll"); + if (kernel32 != NULL) + { + GetSystemTimePreciseAsFileTimeFunc = + (GetSystemTimePreciseAsFileTimeFuncType) GetProcAddress (kernel32, "GetSystemTimePreciseAsFileTime"); + } + initialized = TRUE; +} + +#endif + +/* This is a wrapper for gettimeofday. It is used only on systems + that lack this function, or whose implementation of this function + causes problems. + Work around the bug in some systems whereby gettimeofday clobbers + the static buffer that localtime uses for its return value. The + gettimeofday function from Mac OS X 10.0.4 (i.e., Darwin 1.3.7) has + this problem. */ + +int +gettimeofday (struct timeval *restrict tv, void *restrict tz) +{ +#undef gettimeofday +#ifdef WINDOWS_NATIVE + + /* On native Windows, there are two ways to get the current time: + GetSystemTimeAsFileTime + <https://msdn.microsoft.com/en-us/library/ms724397.aspx> + or + GetSystemTimePreciseAsFileTime + <https://msdn.microsoft.com/en-us/library/hh706895.aspx>. + GetSystemTimeAsFileTime produces values that jump by increments of + 15.627 milliseconds (!) on average. + Whereas GetSystemTimePreciseAsFileTime values usually jump by 1 or 2 + microseconds. + More discussion on this topic: + <http://www.windowstimestamp.com/description>. */ + FILETIME current_time; + + if (!initialized) + initialize (); + if (GetSystemTimePreciseAsFileTimeFunc != NULL) + GetSystemTimePreciseAsFileTimeFunc (¤t_time); + else + GetSystemTimeAsFileTime (¤t_time); + + /* Convert from FILETIME to 'struct timeval'. */ + /* FILETIME: <https://msdn.microsoft.com/en-us/library/ms724284.aspx> */ + ULONGLONG since_1601 = + ((ULONGLONG) current_time.dwHighDateTime << 32) + | (ULONGLONG) current_time.dwLowDateTime; + /* Between 1601-01-01 and 1970-01-01 there were 280 normal years and 89 leap + years, in total 134774 days. */ + ULONGLONG since_1970 = + since_1601 - (ULONGLONG) 134774 * (ULONGLONG) 86400 * (ULONGLONG) 10000000; + ULONGLONG microseconds_since_1970 = since_1970 / (ULONGLONG) 10; + tv->tv_sec = microseconds_since_1970 / (ULONGLONG) 1000000; + tv->tv_usec = microseconds_since_1970 % (ULONGLONG) 1000000; + + return 0; + +#else + +# if HAVE_GETTIMEOFDAY +# if GETTIMEOFDAY_CLOBBERS_LOCALTIME + /* Save and restore the contents of the buffer used for localtime's + result around the call to gettimeofday. */ + struct tm save = *localtime_buffer_addr; +# endif + +# if defined timeval /* 'struct timeval' overridden by gnulib? */ +# undef timeval + struct timeval otv; + int result = gettimeofday (&otv, (struct timezone *) tz); + if (result == 0) + { + tv->tv_sec = otv.tv_sec; + tv->tv_usec = otv.tv_usec; + } +# else + int result = gettimeofday (tv, (struct timezone *) tz); +# endif + +# if GETTIMEOFDAY_CLOBBERS_LOCALTIME + *localtime_buffer_addr = save; +# endif + + return result; + +# else + +# if !defined OK_TO_USE_1S_CLOCK +# error "Only 1-second nominal clock resolution found. Is that intended?" \ + "If so, compile with the -DOK_TO_USE_1S_CLOCK option." +# endif + tv->tv_sec = time (NULL); + tv->tv_usec = 0; + + return 0; + +# endif +#endif +} diff --git a/local/recipes/tools/diffutils/source/lib/gnulib.mk b/local/recipes/tools/diffutils/source/lib/gnulib.mk new file mode 100644 index 0000000000..325c25c974 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/gnulib.mk @@ -0,0 +1,2907 @@ +## DO NOT EDIT! GENERATED AUTOMATICALLY! +## Process this file with automake to produce Makefile.in. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this file. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception to the GNU General Public License, +# this file may be distributed as part of a program that +# contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# Generated by gnulib-tool. +# Reproduce by: gnulib-tool --import --local-dir=gl --lib=libdiffutils --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=gnulib-tests --aux-dir=build-aux --with-tests --avoid=localename --avoid=lock --makefile-name=gnulib.mk --no-conditional-dependencies --no-libtool --macro-prefix=gl announce-gen argmatch binary-io c-stack config-h diffseq dirname do-release-commit-and-tag dup2 error exclude exitfail extensions fcntl fdl file-type filenamecat fnmatch-gnu getopt gettext-h gettime git-version-gen gitlog-to-changelog gnu-make gnu-web-doc-update gnumakefile gnupload hard-locale inttostr inttypes isblank largefile lstat maintainer-makefile manywarnings mbrtowc mkstemp mktime progname propername rawmemchr readme-release regex sh-quote signal stat stat-macros stat-time stdint strcase strftime strptime strtoumax sys_wait system-quote unistd unlocked-io update-copyright vararrays verify version-etc version-etc-fsf wcwidth xalloc xfreopen xreadlink xstrtoumax xvasprintf + + +MOSTLYCLEANFILES += core *.stackdump +# No GNU Make output. + +noinst_LIBRARIES += libdiffutils.a + +libdiffutils_a_SOURCES = +libdiffutils_a_LIBADD = $(gl_LIBOBJS) +libdiffutils_a_DEPENDENCIES = $(gl_LIBOBJS) +EXTRA_libdiffutils_a_SOURCES = + +## begin gnulib module absolute-header + +# Use this preprocessor expression to decide whether #include_next works. +# Do not rely on a 'configure'-time test for this, since the expression +# might appear in an installed header, which is used by some other compiler. +HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER) + +## end gnulib module absolute-header + +## begin gnulib module alloca + + +libdiffutils_a_LIBADD += @ALLOCA@ +libdiffutils_a_DEPENDENCIES += @ALLOCA@ +EXTRA_DIST += alloca.c + +EXTRA_libdiffutils_a_SOURCES += alloca.c + +## end gnulib module alloca + +## begin gnulib module alloca-opt + +BUILT_SOURCES += $(ALLOCA_H) + +# We need the following in order to create <alloca.h> when the system +# doesn't have one that works with the given compiler. +if GL_GENERATE_ALLOCA_H +alloca.h: alloca.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/alloca.in.h; \ + } > $@-t && \ + mv -f $@-t $@ +else +alloca.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += alloca.h alloca.h-t + +EXTRA_DIST += alloca.in.h + +## end gnulib module alloca-opt + +## begin gnulib module allocator + +libdiffutils_a_SOURCES += allocator.c + +EXTRA_DIST += allocator.h + +## end gnulib module allocator + +## begin gnulib module announce-gen + + +EXTRA_DIST += $(top_srcdir)/build-aux/announce-gen + +## end gnulib module announce-gen + +## begin gnulib module areadlink + +libdiffutils_a_SOURCES += areadlink.c + +EXTRA_DIST += areadlink.h + +## end gnulib module areadlink + +## begin gnulib module argmatch + +libdiffutils_a_SOURCES += argmatch.c + +EXTRA_DIST += argmatch.h + +## end gnulib module argmatch + +## begin gnulib module assure + + +EXTRA_DIST += assure.h + +## end gnulib module assure + +## begin gnulib module binary-io + +libdiffutils_a_SOURCES += binary-io.h binary-io.c + +## end gnulib module binary-io + +## begin gnulib module bitrotate + +libdiffutils_a_SOURCES += bitrotate.h bitrotate.c + +## end gnulib module bitrotate + +## begin gnulib module btowc + + +EXTRA_DIST += btowc.c + +EXTRA_libdiffutils_a_SOURCES += btowc.c + +## end gnulib module btowc + +## begin gnulib module c-ctype + +libdiffutils_a_SOURCES += c-ctype.h c-ctype.c + +## end gnulib module c-ctype + +## begin gnulib module c-stack + +libdiffutils_a_SOURCES += c-stack.h c-stack.c + +## end gnulib module c-stack + +## begin gnulib module c-strcase + +libdiffutils_a_SOURCES += c-strcase.h c-strcasecmp.c c-strncasecmp.c + +## end gnulib module c-strcase + +## begin gnulib module c-strcaseeq + + +EXTRA_DIST += c-strcaseeq.h + +## end gnulib module c-strcaseeq + +## begin gnulib module careadlinkat + +libdiffutils_a_SOURCES += careadlinkat.c + +EXTRA_DIST += careadlinkat.h + +## end gnulib module careadlinkat + +## begin gnulib module close + + +EXTRA_DIST += close.c + +EXTRA_libdiffutils_a_SOURCES += close.c + +## end gnulib module close + +## begin gnulib module configmake + +# Listed in the same order as the GNU makefile conventions, and +# provided by autoconf 2.59c+ or 2.70. +# The Automake-defined pkg* macros are appended, in the order +# listed in the Automake 1.10a+ documentation. +configmake.h: Makefile + $(AM_V_GEN)rm -f $@-t && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + echo '#define PREFIX "$(prefix)"'; \ + echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ + echo '#define BINDIR "$(bindir)"'; \ + echo '#define SBINDIR "$(sbindir)"'; \ + echo '#define LIBEXECDIR "$(libexecdir)"'; \ + echo '#define DATAROOTDIR "$(datarootdir)"'; \ + echo '#define DATADIR "$(datadir)"'; \ + echo '#define SYSCONFDIR "$(sysconfdir)"'; \ + echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \ + echo '#define LOCALSTATEDIR "$(localstatedir)"'; \ + echo '#define RUNSTATEDIR "$(runstatedir)"'; \ + echo '#define INCLUDEDIR "$(includedir)"'; \ + echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \ + echo '#define DOCDIR "$(docdir)"'; \ + echo '#define INFODIR "$(infodir)"'; \ + echo '#define HTMLDIR "$(htmldir)"'; \ + echo '#define DVIDIR "$(dvidir)"'; \ + echo '#define PDFDIR "$(pdfdir)"'; \ + echo '#define PSDIR "$(psdir)"'; \ + echo '#define LIBDIR "$(libdir)"'; \ + echo '#define LISPDIR "$(lispdir)"'; \ + echo '#define LOCALEDIR "$(localedir)"'; \ + echo '#define MANDIR "$(mandir)"'; \ + echo '#define MANEXT "$(manext)"'; \ + echo '#define PKGDATADIR "$(pkgdatadir)"'; \ + echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \ + echo '#define PKGLIBDIR "$(pkglibdir)"'; \ + echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ + } | sed '/""/d' > $@-t && \ + mv -f $@-t $@ + +BUILT_SOURCES += configmake.h +CLEANFILES += configmake.h configmake.h-t + +## end gnulib module configmake + +## begin gnulib module ctype + +BUILT_SOURCES += ctype.h + +# We need the following in order to create <ctype.h> when the system +# doesn't have one that works with the given compiler. +ctype.h: ctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_CTYPE_H''@|$(NEXT_CTYPE_H)|g' \ + -e 's/@''GNULIB_ISBLANK''@/$(GNULIB_ISBLANK)/g' \ + -e 's/@''HAVE_ISBLANK''@/$(HAVE_ISBLANK)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/ctype.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += ctype.h ctype.h-t + +EXTRA_DIST += ctype.in.h + +## end gnulib module ctype + +## begin gnulib module diffseq + +libdiffutils_a_SOURCES += diffseq.h + +## end gnulib module diffseq + +## begin gnulib module dirname + +libdiffutils_a_SOURCES += dirname.c basename.c + +EXTRA_DIST += stripslash.c + +EXTRA_libdiffutils_a_SOURCES += stripslash.c + +## end gnulib module dirname + +## begin gnulib module dirname-lgpl + +libdiffutils_a_SOURCES += dirname-lgpl.c basename-lgpl.c stripslash.c + +EXTRA_DIST += dirname.h + +## end gnulib module dirname-lgpl + +## begin gnulib module do-release-commit-and-tag + + +EXTRA_DIST += $(top_srcdir)/build-aux/do-release-commit-and-tag + +## end gnulib module do-release-commit-and-tag + +## begin gnulib module dosname + + +EXTRA_DIST += dosname.h + +## end gnulib module dosname + +## begin gnulib module dup2 + + +EXTRA_DIST += dup2.c + +EXTRA_libdiffutils_a_SOURCES += dup2.c + +## end gnulib module dup2 + +## begin gnulib module errno + +BUILT_SOURCES += $(ERRNO_H) + +# We need the following in order to create <errno.h> when the system +# doesn't have one that is POSIX compliant. +if GL_GENERATE_ERRNO_H +errno.h: errno.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \ + -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \ + -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \ + -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \ + -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \ + -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \ + -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \ + < $(srcdir)/errno.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +errno.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += errno.h errno.h-t + +EXTRA_DIST += errno.in.h + +## end gnulib module errno + +## begin gnulib module error + + +EXTRA_DIST += error.c error.h + +EXTRA_libdiffutils_a_SOURCES += error.c + +## end gnulib module error + +## begin gnulib module exclude + +libdiffutils_a_SOURCES += exclude.c + +EXTRA_DIST += exclude.h + +## end gnulib module exclude + +## begin gnulib module exitfail + +libdiffutils_a_SOURCES += exitfail.c + +EXTRA_DIST += exitfail.h + +## end gnulib module exitfail + +## begin gnulib module fcntl + + +EXTRA_DIST += fcntl.c + +EXTRA_libdiffutils_a_SOURCES += fcntl.c + +## end gnulib module fcntl + +## begin gnulib module fcntl-h + +BUILT_SOURCES += fcntl.h + +# We need the following in order to create <fcntl.h> when the system +# doesn't have one that works with the given compiler. +fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \ + -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \ + -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \ + -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \ + -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \ + -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \ + -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \ + -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \ + -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \ + -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/fcntl.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += fcntl.h fcntl.h-t + +EXTRA_DIST += fcntl.in.h + +## end gnulib module fcntl-h + +## begin gnulib module fd-hook + +libdiffutils_a_SOURCES += fd-hook.c + +EXTRA_DIST += fd-hook.h + +## end gnulib module fd-hook + +## begin gnulib module file-type + +libdiffutils_a_SOURCES += file-type.c + +EXTRA_DIST += file-type.h + +## end gnulib module file-type + +## begin gnulib module filename + + +EXTRA_DIST += filename.h + +## end gnulib module filename + +## begin gnulib module filenamecat + +libdiffutils_a_SOURCES += filenamecat.c + +## end gnulib module filenamecat + +## begin gnulib module filenamecat-lgpl + +libdiffutils_a_SOURCES += filenamecat-lgpl.c + +EXTRA_DIST += filenamecat.h + +## end gnulib module filenamecat-lgpl + +## begin gnulib module flexmember + + +EXTRA_DIST += flexmember.h + +## end gnulib module flexmember + +## begin gnulib module float + +BUILT_SOURCES += $(FLOAT_H) + +# We need the following in order to create <float.h> when the system +# doesn't have one that works with the given compiler. +if GL_GENERATE_FLOAT_H +float.h: float.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \ + -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \ + < $(srcdir)/float.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +float.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += float.h float.h-t + +EXTRA_DIST += float.c float.in.h itold.c + +EXTRA_libdiffutils_a_SOURCES += float.c itold.c + +## end gnulib module float + +## begin gnulib module fnmatch + +BUILT_SOURCES += $(FNMATCH_H) + +# We need the following in order to create <fnmatch.h> when the system +# doesn't have one that supports the required API. +if GL_GENERATE_FNMATCH_H +fnmatch.h: fnmatch.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + < $(srcdir)/fnmatch.in.h; \ + } > $@-t && \ + mv -f $@-t $@ +else +fnmatch.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t + +EXTRA_DIST += fnmatch.c fnmatch.in.h fnmatch_loop.c + +EXTRA_libdiffutils_a_SOURCES += fnmatch.c fnmatch_loop.c + +## end gnulib module fnmatch + +## begin gnulib module freopen + + +EXTRA_DIST += freopen.c + +EXTRA_libdiffutils_a_SOURCES += freopen.c + +## end gnulib module freopen + +## begin gnulib module freopen-safer + +libdiffutils_a_SOURCES += freopen-safer.c + +EXTRA_DIST += stdio--.h stdio-safer.h + +## end gnulib module freopen-safer + +## begin gnulib module fstat + + +EXTRA_DIST += fstat.c stat-w32.c stat-w32.h + +EXTRA_libdiffutils_a_SOURCES += fstat.c stat-w32.c + +## end gnulib module fstat + +## begin gnulib module gendocs + + +EXTRA_DIST += $(top_srcdir)/build-aux/gendocs.sh + +## end gnulib module gendocs + +## begin gnulib module getdtablesize + + +EXTRA_DIST += getdtablesize.c + +EXTRA_libdiffutils_a_SOURCES += getdtablesize.c + +## end gnulib module getdtablesize + +## begin gnulib module getopt-posix + +BUILT_SOURCES += $(GETOPT_H) $(GETOPT_CDEFS_H) + +# We need the following in order to create <getopt.h> when the system +# doesn't have one that works with the given compiler. +getopt.h: getopt.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + < $(srcdir)/getopt.in.h; \ + } > $@-t && \ + mv -f $@-t $@ + +getopt-cdefs.h: getopt-cdefs.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \ + < $(srcdir)/getopt-cdefs.in.h; \ + } > $@-t && \ + mv -f $@-t $@ + +MOSTLYCLEANFILES += getopt.h getopt.h-t getopt-cdefs.h getopt-cdefs.h-t + +EXTRA_DIST += getopt-cdefs.in.h getopt-core.h getopt-ext.h getopt-pfx-core.h getopt-pfx-ext.h getopt.c getopt.in.h getopt1.c getopt_int.h + +EXTRA_libdiffutils_a_SOURCES += getopt.c getopt1.c + +## end gnulib module getopt-posix + +## begin gnulib module getprogname + +libdiffutils_a_SOURCES += getprogname.h getprogname.c + +## end gnulib module getprogname + +## begin gnulib module gettext-h + +libdiffutils_a_SOURCES += gettext.h + +## end gnulib module gettext-h + +## begin gnulib module gettime + +libdiffutils_a_SOURCES += gettime.c + +## end gnulib module gettime + +## begin gnulib module gettimeofday + + +EXTRA_DIST += gettimeofday.c + +EXTRA_libdiffutils_a_SOURCES += gettimeofday.c + +## end gnulib module gettimeofday + +## begin gnulib module git-version-gen + + +EXTRA_DIST += $(top_srcdir)/build-aux/git-version-gen + +## end gnulib module git-version-gen + +## begin gnulib module gitlog-to-changelog + + +EXTRA_DIST += $(top_srcdir)/build-aux/gitlog-to-changelog + +## end gnulib module gitlog-to-changelog + +## begin gnulib module gnu-make + +##Sample usage of gnu-make module: +#if GNU_MAKE +# [nicer features that work only with GNU Make] +#else +# [fallback features that work in any 'make' implementation; see +# http://www.opengroup.org/susv3/utilities/make.html +# for the 2004 POSIX specification] +#endif + +## end gnulib module gnu-make + +## begin gnulib module gnu-web-doc-update + + +EXTRA_DIST += $(top_srcdir)/build-aux/gnu-web-doc-update + +## end gnulib module gnu-web-doc-update + +## begin gnulib module gnumakefile + +EXTRA_DIST += $(top_srcdir)/GNUmakefile +distclean-local: clean-GNUmakefile +clean-GNUmakefile: + test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile + +## end gnulib module gnumakefile + +## begin gnulib module gnupload + + +EXTRA_DIST += $(top_srcdir)/build-aux/gnupload + +## end gnulib module gnupload + +## begin gnulib module gperf + +GPERF = gperf +V_GPERF = $(V_GPERF_@AM_V@) +V_GPERF_ = $(V_GPERF_@AM_DEFAULT_V@) +V_GPERF_0 = @echo " GPERF " $@; + +## end gnulib module gperf + +## begin gnulib module hard-locale + +libdiffutils_a_SOURCES += hard-locale.c + +EXTRA_DIST += hard-locale.h + +## end gnulib module hard-locale + +## begin gnulib module hash + +libdiffutils_a_SOURCES += hash.c + +EXTRA_DIST += hash.h + +## end gnulib module hash + +## begin gnulib module havelib + + +EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath + +## end gnulib module havelib + +## begin gnulib module iconv-h + +BUILT_SOURCES += $(ICONV_H) + +# We need the following in order to create <iconv.h> when the system +# doesn't have one that works with the given compiler. +if GL_GENERATE_ICONV_H +iconv.h: iconv.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_ICONV_H''@|$(NEXT_ICONV_H)|g' \ + -e 's/@''GNULIB_ICONV''@/$(GNULIB_ICONV)/g' \ + -e 's|@''ICONV_CONST''@|$(ICONV_CONST)|g' \ + -e 's|@''REPLACE_ICONV''@|$(REPLACE_ICONV)|g' \ + -e 's|@''REPLACE_ICONV_OPEN''@|$(REPLACE_ICONV_OPEN)|g' \ + -e 's|@''REPLACE_ICONV_UTF''@|$(REPLACE_ICONV_UTF)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/iconv.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +iconv.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += iconv.h iconv.h-t + +EXTRA_DIST += iconv.in.h + +## end gnulib module iconv-h + +## begin gnulib module iconv_open + +iconv_open-aix.h: iconv_open-aix.gperf + $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-aix.gperf > $(srcdir)/iconv_open-aix.h-t && \ + mv $(srcdir)/iconv_open-aix.h-t $(srcdir)/iconv_open-aix.h +iconv_open-hpux.h: iconv_open-hpux.gperf + $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-hpux.gperf > $(srcdir)/iconv_open-hpux.h-t && \ + mv $(srcdir)/iconv_open-hpux.h-t $(srcdir)/iconv_open-hpux.h +iconv_open-irix.h: iconv_open-irix.gperf + $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-irix.gperf > $(srcdir)/iconv_open-irix.h-t && \ + mv $(srcdir)/iconv_open-irix.h-t $(srcdir)/iconv_open-irix.h +iconv_open-osf.h: iconv_open-osf.gperf + $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-osf.gperf > $(srcdir)/iconv_open-osf.h-t && \ + mv $(srcdir)/iconv_open-osf.h-t $(srcdir)/iconv_open-osf.h +iconv_open-solaris.h: iconv_open-solaris.gperf + $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-solaris.gperf > $(srcdir)/iconv_open-solaris.h-t && \ + mv $(srcdir)/iconv_open-solaris.h-t $(srcdir)/iconv_open-solaris.h +BUILT_SOURCES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h +MOSTLYCLEANFILES += iconv_open-aix.h-t iconv_open-hpux.h-t iconv_open-irix.h-t iconv_open-osf.h-t iconv_open-solaris.h-t +MAINTAINERCLEANFILES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h +EXTRA_DIST += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h + +EXTRA_DIST += iconv.c iconv_close.c iconv_open-aix.gperf iconv_open-hpux.gperf iconv_open-irix.gperf iconv_open-osf.gperf iconv_open-solaris.gperf iconv_open.c + +EXTRA_libdiffutils_a_SOURCES += iconv.c iconv_close.c iconv_open.c + +## end gnulib module iconv_open + +## begin gnulib module ignore-value + + +EXTRA_DIST += ignore-value.h + +## end gnulib module ignore-value + +## begin gnulib module intprops + + +EXTRA_DIST += intprops.h + +## end gnulib module intprops + +## begin gnulib module inttostr + +libdiffutils_a_SOURCES += imaxtostr.c inttostr.c offtostr.c uinttostr.c umaxtostr.c + +EXTRA_DIST += anytostr.c inttostr.h + +EXTRA_libdiffutils_a_SOURCES += anytostr.c + +## end gnulib module inttostr + +## begin gnulib module inttypes-incomplete + +BUILT_SOURCES += inttypes.h + +# We need the following in order to create <inttypes.h> when the system +# doesn't have one that works with the given compiler. +inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \ + -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \ + -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ + -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ + -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ + -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \ + -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \ + -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \ + -e 's/@''GNULIB_STRTOIMAX''@/$(GNULIB_STRTOIMAX)/g' \ + -e 's/@''GNULIB_STRTOUMAX''@/$(GNULIB_STRTOUMAX)/g' \ + -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \ + -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \ + -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \ + -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \ + -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \ + -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \ + -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \ + -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \ + -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \ + -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/inttypes.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += inttypes.h inttypes.h-t + +EXTRA_DIST += inttypes.in.h + +## end gnulib module inttypes-incomplete + +## begin gnulib module isblank + + +EXTRA_DIST += isblank.c + +EXTRA_libdiffutils_a_SOURCES += isblank.c + +## end gnulib module isblank + +## begin gnulib module iswblank + + +EXTRA_DIST += iswblank.c + +EXTRA_libdiffutils_a_SOURCES += iswblank.c + +## end gnulib module iswblank + +## begin gnulib module langinfo + +BUILT_SOURCES += langinfo.h + +# We need the following in order to create an empty placeholder for +# <langinfo.h> when the system doesn't have one. +langinfo.h: langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \ + -e 's/@''GNULIB_NL_LANGINFO''@/$(GNULIB_NL_LANGINFO)/g' \ + -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \ + -e 's|@''HAVE_LANGINFO_T_FMT_AMPM''@|$(HAVE_LANGINFO_T_FMT_AMPM)|g' \ + -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \ + -e 's|@''HAVE_LANGINFO_YESEXPR''@|$(HAVE_LANGINFO_YESEXPR)|g' \ + -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \ + -e 's|@''REPLACE_NL_LANGINFO''@|$(REPLACE_NL_LANGINFO)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/langinfo.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += langinfo.h langinfo.h-t + +EXTRA_DIST += langinfo.in.h + +## end gnulib module langinfo + +## begin gnulib module limits-h + +BUILT_SOURCES += $(LIMITS_H) + +# We need the following in order to create <limits.h> when the system +# doesn't have one that is compatible with GNU. +if GL_GENERATE_LIMITS_H +limits.h: limits.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \ + < $(srcdir)/limits.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +limits.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += limits.h limits.h-t + +EXTRA_DIST += limits.in.h + +## end gnulib module limits-h + +## begin gnulib module localcharset + +libdiffutils_a_SOURCES += localcharset.h localcharset.c + +# We need the following in order to install a simple file in $(libdir) +# which is shared with other installed packages. We use a list of referencing +# packages so that "make uninstall" will remove the file if and only if it +# is not used by another installed package. +# On systems with glibc-2.1 or newer, the file is redundant, therefore we +# avoid installing it. + +all-local: charset.alias ref-add.sed ref-del.sed + +charset_alias = $(DESTDIR)$(libdir)/charset.alias +charset_tmp = $(DESTDIR)$(libdir)/charset.tmp +install-exec-local: install-exec-localcharset +install-exec-localcharset: all-local + if test $(GLIBC21) = no; then \ + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ + darwin* | cygwin* | mingw* | pw32* | cegcc*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ + esac ; \ + else \ + need_charset_alias=false ; \ + fi ; \ + if $$need_charset_alias; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir) ; \ + fi ; \ + if test -f $(charset_alias); then \ + sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ + rm -f $(charset_tmp) ; \ + else \ + if $$need_charset_alias; then \ + sed -f ref-add.sed charset.alias > $(charset_tmp) ; \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ + rm -f $(charset_tmp) ; \ + fi ; \ + fi + +uninstall-local: uninstall-localcharset +uninstall-localcharset: all-local + if test -f $(charset_alias); then \ + sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \ + if grep '^# Packages using this file: $$' $(charset_tmp) \ + > /dev/null; then \ + rm -f $(charset_alias); \ + else \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \ + fi; \ + rm -f $(charset_tmp); \ + fi + +charset.alias: config.charset + $(AM_V_GEN)rm -f t-$@ $@ && \ + $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ && \ + mv t-$@ $@ + +SUFFIXES += .sed .sin +.sin.sed: + $(AM_V_GEN)rm -f t-$@ $@ && \ + sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \ + mv t-$@ $@ + +CLEANFILES += charset.alias ref-add.sed ref-del.sed + +EXTRA_DIST += config.charset ref-add.sin ref-del.sin + +## end gnulib module localcharset + +## begin gnulib module locale + +BUILT_SOURCES += locale.h + +# We need the following in order to create <locale.h> when the system +# doesn't have one that provides all definitions. +locale.h: locale.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_LOCALE_H''@|$(NEXT_LOCALE_H)|g' \ + -e 's/@''GNULIB_LOCALECONV''@/$(GNULIB_LOCALECONV)/g' \ + -e 's/@''GNULIB_SETLOCALE''@/$(GNULIB_SETLOCALE)/g' \ + -e 's/@''GNULIB_DUPLOCALE''@/$(GNULIB_DUPLOCALE)/g' \ + -e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|g' \ + -e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \ + -e 's|@''REPLACE_LOCALECONV''@|$(REPLACE_LOCALECONV)|g' \ + -e 's|@''REPLACE_SETLOCALE''@|$(REPLACE_SETLOCALE)|g' \ + -e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \ + -e 's|@''REPLACE_STRUCT_LCONV''@|$(REPLACE_STRUCT_LCONV)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/locale.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += locale.h locale.h-t + +EXTRA_DIST += locale.in.h + +## end gnulib module locale + +## begin gnulib module localeconv + + +EXTRA_DIST += localeconv.c + +EXTRA_libdiffutils_a_SOURCES += localeconv.c + +## end gnulib module localeconv + +## begin gnulib module localtime-buffer + + +EXTRA_DIST += localtime-buffer.c localtime-buffer.h + +EXTRA_libdiffutils_a_SOURCES += localtime-buffer.c + +## end gnulib module localtime-buffer + +## begin gnulib module lstat + + +EXTRA_DIST += lstat.c + +EXTRA_libdiffutils_a_SOURCES += lstat.c + +## end gnulib module lstat + +## begin gnulib module maintainer-makefile + +EXTRA_DIST += $(top_srcdir)/maint.mk + +## end gnulib module maintainer-makefile + +## begin gnulib module malloc-posix + + +EXTRA_DIST += malloc.c + +EXTRA_libdiffutils_a_SOURCES += malloc.c + +## end gnulib module malloc-posix + +## begin gnulib module malloca + +libdiffutils_a_SOURCES += malloca.c + +EXTRA_DIST += malloca.h malloca.valgrind + +## end gnulib module malloca + +## begin gnulib module mbchar + +libdiffutils_a_SOURCES += mbchar.c + +EXTRA_DIST += mbchar.h + +## end gnulib module mbchar + +## begin gnulib module mbiter + +libdiffutils_a_SOURCES += mbiter.h mbiter.c + +## end gnulib module mbiter + +## begin gnulib module mbrtowc + + +EXTRA_DIST += mbrtowc.c + +EXTRA_libdiffutils_a_SOURCES += mbrtowc.c + +## end gnulib module mbrtowc + +## begin gnulib module mbscasecmp + +libdiffutils_a_SOURCES += mbscasecmp.c + +## end gnulib module mbscasecmp + +## begin gnulib module mbsinit + + +EXTRA_DIST += mbsinit.c + +EXTRA_libdiffutils_a_SOURCES += mbsinit.c + +## end gnulib module mbsinit + +## begin gnulib module mbslen + +libdiffutils_a_SOURCES += mbslen.c + +## end gnulib module mbslen + +## begin gnulib module mbsrtowcs + + +EXTRA_DIST += mbsrtowcs-impl.h mbsrtowcs-state.c mbsrtowcs.c + +EXTRA_libdiffutils_a_SOURCES += mbsrtowcs-state.c mbsrtowcs.c + +## end gnulib module mbsrtowcs + +## begin gnulib module mbsstr + +libdiffutils_a_SOURCES += mbsstr.c + +EXTRA_DIST += str-kmp.h + +## end gnulib module mbsstr + +## begin gnulib module mbtowc + + +EXTRA_DIST += mbtowc-impl.h mbtowc.c + +EXTRA_libdiffutils_a_SOURCES += mbtowc.c + +## end gnulib module mbtowc + +## begin gnulib module mbuiter + +libdiffutils_a_SOURCES += mbuiter.h mbuiter.c + +## end gnulib module mbuiter + +## begin gnulib module memchr + + +EXTRA_DIST += memchr.c memchr.valgrind + +EXTRA_libdiffutils_a_SOURCES += memchr.c + +## end gnulib module memchr + +## begin gnulib module minmax + +libdiffutils_a_SOURCES += minmax.h + +## end gnulib module minmax + +## begin gnulib module mkstemp + + +EXTRA_DIST += mkstemp.c + +EXTRA_libdiffutils_a_SOURCES += mkstemp.c + +## end gnulib module mkstemp + +## begin gnulib module mktime + + +EXTRA_DIST += mktime-internal.h mktime.c + +EXTRA_libdiffutils_a_SOURCES += mktime.c + +## end gnulib module mktime + +## begin gnulib module mktime-internal + + +EXTRA_DIST += mktime-internal.h mktime.c + +EXTRA_libdiffutils_a_SOURCES += mktime.c + +## end gnulib module mktime-internal + +## begin gnulib module msvc-inval + + +EXTRA_DIST += msvc-inval.c msvc-inval.h + +EXTRA_libdiffutils_a_SOURCES += msvc-inval.c + +## end gnulib module msvc-inval + +## begin gnulib module msvc-nothrow + + +EXTRA_DIST += msvc-nothrow.c msvc-nothrow.h + +EXTRA_libdiffutils_a_SOURCES += msvc-nothrow.c + +## end gnulib module msvc-nothrow + +## begin gnulib module nl_langinfo + + +EXTRA_DIST += nl_langinfo.c + +EXTRA_libdiffutils_a_SOURCES += nl_langinfo.c + +## end gnulib module nl_langinfo + +## begin gnulib module open + + +EXTRA_DIST += open.c + +EXTRA_libdiffutils_a_SOURCES += open.c + +## end gnulib module open + +## begin gnulib module pathmax + + +EXTRA_DIST += pathmax.h + +## end gnulib module pathmax + +## begin gnulib module progname + +libdiffutils_a_SOURCES += progname.h progname.c + +## end gnulib module progname + +## begin gnulib module propername + +libdiffutils_a_SOURCES += propername.h propername.c + +## end gnulib module propername + +## begin gnulib module quote + + +EXTRA_DIST += quote.h + +## end gnulib module quote + +## begin gnulib module quotearg + +libdiffutils_a_SOURCES += quotearg.c + +EXTRA_DIST += quote.h quotearg.h + +## end gnulib module quotearg + +## begin gnulib module raise + + +EXTRA_DIST += raise.c + +EXTRA_libdiffutils_a_SOURCES += raise.c + +## end gnulib module raise + +## begin gnulib module rawmemchr + + +EXTRA_DIST += rawmemchr.c rawmemchr.valgrind + +EXTRA_libdiffutils_a_SOURCES += rawmemchr.c + +## end gnulib module rawmemchr + +## begin gnulib module readlink + + +EXTRA_DIST += readlink.c + +EXTRA_libdiffutils_a_SOURCES += readlink.c + +## end gnulib module readlink + +## begin gnulib module regex + + +EXTRA_DIST += regcomp.c regex.c regex.h regex_internal.c regex_internal.h regexec.c + +EXTRA_libdiffutils_a_SOURCES += regcomp.c regex.c regex_internal.c regexec.c + +## end gnulib module regex + +## begin gnulib module secure_getenv + + +EXTRA_DIST += secure_getenv.c + +EXTRA_libdiffutils_a_SOURCES += secure_getenv.c + +## end gnulib module secure_getenv + +## begin gnulib module setenv + + +EXTRA_DIST += setenv.c + +EXTRA_libdiffutils_a_SOURCES += setenv.c + +## end gnulib module setenv + +## begin gnulib module sh-quote + +libdiffutils_a_SOURCES += sh-quote.h sh-quote.c + +## end gnulib module sh-quote + +## begin gnulib module sigaction + +libdiffutils_a_SOURCES += sig-handler.c + +EXTRA_DIST += sig-handler.h sigaction.c + +EXTRA_libdiffutils_a_SOURCES += sigaction.c + +## end gnulib module sigaction + +## begin gnulib module signal-h + +BUILT_SOURCES += signal.h + +# We need the following in order to create <signal.h> when the system +# doesn't have a complete one. +signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \ + -e 's|@''GNULIB_PTHREAD_SIGMASK''@|$(GNULIB_PTHREAD_SIGMASK)|g' \ + -e 's|@''GNULIB_RAISE''@|$(GNULIB_RAISE)|g' \ + -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \ + -e 's/@''GNULIB_SIGACTION''@/$(GNULIB_SIGACTION)/g' \ + -e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|$(HAVE_POSIX_SIGNALBLOCKING)|g' \ + -e 's|@''HAVE_PTHREAD_SIGMASK''@|$(HAVE_PTHREAD_SIGMASK)|g' \ + -e 's|@''HAVE_RAISE''@|$(HAVE_RAISE)|g' \ + -e 's|@''HAVE_SIGSET_T''@|$(HAVE_SIGSET_T)|g' \ + -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \ + -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \ + -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \ + -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \ + -e 's|@''HAVE_SIGHANDLER_T''@|$(HAVE_SIGHANDLER_T)|g' \ + -e 's|@''REPLACE_PTHREAD_SIGMASK''@|$(REPLACE_PTHREAD_SIGMASK)|g' \ + -e 's|@''REPLACE_RAISE''@|$(REPLACE_RAISE)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/signal.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += signal.h signal.h-t + +EXTRA_DIST += signal.in.h + +## end gnulib module signal-h + +## begin gnulib module sigprocmask + + +EXTRA_DIST += sigprocmask.c + +EXTRA_libdiffutils_a_SOURCES += sigprocmask.c + +## end gnulib module sigprocmask + +## begin gnulib module size_max + +libdiffutils_a_SOURCES += size_max.h + +## end gnulib module size_max + +## begin gnulib module snippet/_Noreturn + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. + +_NORETURN_H=$(srcdir)/_Noreturn.h + +EXTRA_DIST += _Noreturn.h + +## end gnulib module snippet/_Noreturn + +## begin gnulib module snippet/arg-nonnull + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. + +ARG_NONNULL_H=$(srcdir)/arg-nonnull.h + +EXTRA_DIST += arg-nonnull.h + +## end gnulib module snippet/arg-nonnull + +## begin gnulib module snippet/c++defs + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. + +CXXDEFS_H=$(srcdir)/c++defs.h + +EXTRA_DIST += c++defs.h + +## end gnulib module snippet/c++defs + +## begin gnulib module snippet/unused-parameter + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. + +UNUSED_PARAMETER_H=$(srcdir)/unused-parameter.h + +EXTRA_DIST += unused-parameter.h + +## end gnulib module snippet/unused-parameter + +## begin gnulib module snippet/warn-on-use + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. + +WARN_ON_USE_H=$(srcdir)/warn-on-use.h + +EXTRA_DIST += warn-on-use.h + +## end gnulib module snippet/warn-on-use + +## begin gnulib module stat + + +EXTRA_DIST += stat-w32.c stat-w32.h stat.c + +EXTRA_libdiffutils_a_SOURCES += stat-w32.c stat.c + +## end gnulib module stat + +## begin gnulib module stat-macros + + +EXTRA_DIST += stat-macros.h + +## end gnulib module stat-macros + +## begin gnulib module stat-time + +libdiffutils_a_SOURCES += stat-time.c + +EXTRA_DIST += stat-time.h + +## end gnulib module stat-time + +## begin gnulib module stdarg + +BUILT_SOURCES += $(STDARG_H) + +# We need the following in order to create <stdarg.h> when the system +# doesn't have one that works with the given compiler. +if GL_GENERATE_STDARG_H +stdarg.h: stdarg.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \ + < $(srcdir)/stdarg.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +stdarg.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += stdarg.h stdarg.h-t + +EXTRA_DIST += stdarg.in.h + +## end gnulib module stdarg + +## begin gnulib module stdbool + +BUILT_SOURCES += $(STDBOOL_H) + +# We need the following in order to create <stdbool.h> when the system +# doesn't have one that works. +if GL_GENERATE_STDBOOL_H +stdbool.h: stdbool.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +stdbool.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += stdbool.h stdbool.h-t + +EXTRA_DIST += stdbool.in.h + +## end gnulib module stdbool + +## begin gnulib module stddef + +BUILT_SOURCES += $(STDDEF_H) + +# We need the following in order to create <stddef.h> when the system +# doesn't have one that works with the given compiler. +if GL_GENERATE_STDDEF_H +stddef.h: stddef.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \ + -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \ + -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \ + -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \ + < $(srcdir)/stddef.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +stddef.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += stddef.h stddef.h-t + +EXTRA_DIST += stddef.in.h + +## end gnulib module stddef + +## begin gnulib module stdint + +BUILT_SOURCES += $(STDINT_H) + +# We need the following in order to create <stdint.h> when the system +# doesn't have one that works with the given compiler. +if GL_GENERATE_STDINT_H +stdint.h: stdint.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ + -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \ + -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ + -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ + -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ + -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ + -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ + -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ + -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ + -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ + -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ + -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ + -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \ + -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \ + -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \ + -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \ + -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \ + -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \ + -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \ + -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \ + -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ + -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ + -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ + -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ + < $(srcdir)/stdint.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +stdint.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += stdint.h stdint.h-t + +EXTRA_DIST += stdint.in.h + +## end gnulib module stdint + +## begin gnulib module stdio + +BUILT_SOURCES += stdio.h + +# We need the following in order to create <stdio.h> when the system +# doesn't have one that works with the given compiler. +stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \ + -e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \ + -e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \ + -e 's/@''GNULIB_FDOPEN''@/$(GNULIB_FDOPEN)/g' \ + -e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \ + -e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \ + -e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \ + -e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \ + -e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \ + -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \ + -e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \ + -e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \ + -e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \ + -e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \ + -e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \ + -e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \ + -e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \ + -e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \ + -e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \ + -e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \ + -e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \ + -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \ + -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \ + -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \ + -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \ + -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \ + -e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \ + -e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \ + -e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \ + -e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \ + -e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \ + -e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \ + -e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \ + -e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \ + -e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \ + -e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \ + -e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \ + -e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \ + -e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \ + -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \ + -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \ + -e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \ + -e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \ + -e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \ + -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \ + -e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \ + -e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \ + -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \ + -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \ + < $(srcdir)/stdio.in.h | \ + sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \ + -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \ + -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \ + -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \ + -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \ + -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \ + -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \ + -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \ + -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \ + -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \ + -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \ + -e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \ + -e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \ + -e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \ + -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ + -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \ + -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \ + -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \ + -e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \ + -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \ + -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \ + -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \ + -e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \ + -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \ + -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \ + -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \ + -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \ + -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \ + -e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \ + -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \ + -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \ + -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \ + -e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \ + -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \ + -e 's|@''REPLACE_REMOVE''@|$(REPLACE_REMOVE)|g' \ + -e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \ + -e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \ + -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \ + -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \ + -e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \ + -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \ + -e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \ + -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \ + -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \ + -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \ + -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \ + -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \ + -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ + -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += stdio.h stdio.h-t + +EXTRA_DIST += stdio.in.h + +## end gnulib module stdio + +## begin gnulib module stdlib + +BUILT_SOURCES += stdlib.h + +# We need the following in order to create <stdlib.h> when the system +# doesn't have one that works with the given compiler. +stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ + $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ + -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \ + -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \ + -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \ + -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \ + -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \ + -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \ + -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \ + -e 's/@''GNULIB_MALLOC_POSIX''@/$(GNULIB_MALLOC_POSIX)/g' \ + -e 's/@''GNULIB_MBTOWC''@/$(GNULIB_MBTOWC)/g' \ + -e 's/@''GNULIB_MKDTEMP''@/$(GNULIB_MKDTEMP)/g' \ + -e 's/@''GNULIB_MKOSTEMP''@/$(GNULIB_MKOSTEMP)/g' \ + -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \ + -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \ + -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \ + -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \ + -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \ + -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \ + -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \ + -e 's/@''GNULIB_QSORT_R''@/$(GNULIB_QSORT_R)/g' \ + -e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \ + -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \ + -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \ + -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \ + -e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \ + -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \ + -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \ + -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \ + -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \ + -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \ + -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \ + -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \ + -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \ + -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \ + < $(srcdir)/stdlib.in.h | \ + sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \ + -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ + -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ + -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ + -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \ + -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ + -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \ + -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \ + -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \ + -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \ + -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ + -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ + -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ + -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \ + -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \ + -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ + -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ + -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \ + -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ + -e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \ + -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \ + -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ + -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ + -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ + -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ + -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ + -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \ + -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \ + -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \ + -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \ + -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \ + -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \ + -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ + -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ + -e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \ + -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \ + -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \ + -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \ + -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ + -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ + -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ + -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _Noreturn/r $(_NORETURN_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += stdlib.h stdlib.h-t + +EXTRA_DIST += stdlib.in.h + +## end gnulib module stdlib + +## begin gnulib module strcase + + +EXTRA_DIST += strcasecmp.c strncasecmp.c + +EXTRA_libdiffutils_a_SOURCES += strcasecmp.c strncasecmp.c + +## end gnulib module strcase + +## begin gnulib module streq + + +EXTRA_DIST += streq.h + +## end gnulib module streq + +## begin gnulib module strerror + + +EXTRA_DIST += strerror.c + +EXTRA_libdiffutils_a_SOURCES += strerror.c + +## end gnulib module strerror + +## begin gnulib module strerror-override + + +EXTRA_DIST += strerror-override.c strerror-override.h + +EXTRA_libdiffutils_a_SOURCES += strerror-override.c + +## end gnulib module strerror-override + +## begin gnulib module strftime + +libdiffutils_a_SOURCES += strftime.c + +EXTRA_DIST += strftime.h + +## end gnulib module strftime + +## begin gnulib module striconv + +libdiffutils_a_SOURCES += striconv.h striconv.c +if GL_COND_LIBTOOL +endif + +## end gnulib module striconv + +## begin gnulib module string + +BUILT_SOURCES += string.h + +# We need the following in order to create <string.h> when the system +# doesn't have one that works with the given compiler. +string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \ + -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \ + -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \ + -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \ + -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \ + -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \ + -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \ + -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \ + -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \ + -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \ + -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \ + -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \ + -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \ + -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \ + -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \ + -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \ + -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \ + -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \ + -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \ + -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \ + -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \ + -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \ + -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \ + -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \ + -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \ + -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \ + -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \ + -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \ + -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \ + -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \ + -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \ + -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \ + -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \ + -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \ + -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \ + -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \ + -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \ + -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \ + < $(srcdir)/string.in.h | \ + sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \ + -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \ + -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \ + -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \ + -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ + -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ + -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ + -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \ + -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \ + -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \ + -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \ + -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \ + -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \ + -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \ + -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \ + -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \ + -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ + -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ + -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \ + -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ + -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ + -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \ + -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \ + -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ + -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \ + -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \ + -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \ + -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \ + -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ + -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \ + -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \ + -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \ + -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \ + -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ + -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ + -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + < $(srcdir)/string.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += string.h string.h-t + +EXTRA_DIST += string.in.h + +## end gnulib module string + +## begin gnulib module strings + +BUILT_SOURCES += strings.h + +# We need the following in order to create <strings.h> when the system +# doesn't have one that works with the given compiler. +strings.h: strings.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_STRINGS_H''@|$(HAVE_STRINGS_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STRINGS_H''@|$(NEXT_STRINGS_H)|g' \ + -e 's|@''GNULIB_FFS''@|$(GNULIB_FFS)|g' \ + -e 's|@''HAVE_FFS''@|$(HAVE_FFS)|g' \ + -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \ + -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/strings.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += strings.h strings.h-t + +EXTRA_DIST += strings.in.h + +## end gnulib module strings + +## begin gnulib module strndup + + +EXTRA_DIST += strndup.c + +EXTRA_libdiffutils_a_SOURCES += strndup.c + +## end gnulib module strndup + +## begin gnulib module strnlen + + +EXTRA_DIST += strnlen.c + +EXTRA_libdiffutils_a_SOURCES += strnlen.c + +## end gnulib module strnlen + +## begin gnulib module strnlen1 + +libdiffutils_a_SOURCES += strnlen1.h strnlen1.c + +## end gnulib module strnlen1 + +## begin gnulib module strptime + + +EXTRA_DIST += strptime.c + +EXTRA_libdiffutils_a_SOURCES += strptime.c + +## end gnulib module strptime + +## begin gnulib module strtoull + + +EXTRA_DIST += strtol.c strtoul.c strtoull.c + +EXTRA_libdiffutils_a_SOURCES += strtol.c strtoul.c strtoull.c + +## end gnulib module strtoull + +## begin gnulib module strtoumax + + +EXTRA_DIST += strtoimax.c strtoumax.c + +EXTRA_libdiffutils_a_SOURCES += strtoimax.c strtoumax.c + +## end gnulib module strtoumax + +## begin gnulib module sys_stat + +BUILT_SOURCES += sys/stat.h + +# We need the following in order to create <sys/stat.h> when the system +# has one that is incomplete. +sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \ + -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \ + -e 's|@''WINDOWS_STAT_TIMESPEC''@|$(WINDOWS_STAT_TIMESPEC)|g' \ + -e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \ + -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \ + -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \ + -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \ + -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \ + -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \ + -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \ + -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \ + -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \ + -e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \ + -e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \ + -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \ + -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \ + -e 's/@''GNULIB_OVERRIDES_STRUCT_STAT''@/$(GNULIB_OVERRIDES_STRUCT_STAT)/g' \ + -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \ + -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \ + -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \ + -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \ + -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ + -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \ + -e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \ + -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \ + -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \ + -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \ + -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \ + -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \ + -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \ + -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \ + -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \ + -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \ + -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \ + -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \ + -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \ + -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_stat.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t +MOSTLYCLEANDIRS += sys + +EXTRA_DIST += sys_stat.in.h + +## end gnulib module sys_stat + +## begin gnulib module sys_time + +BUILT_SOURCES += sys/time.h + +# We need the following in order to create <sys/time.h> when the system +# doesn't have one that works with the given compiler. +sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \ + -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \ + -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ + -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \ + -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ + -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ + -e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_time.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += sys/time.h sys/time.h-t + +EXTRA_DIST += sys_time.in.h + +## end gnulib module sys_time + +## begin gnulib module sys_types + +BUILT_SOURCES += sys/types.h + +# We need the following in order to create <sys/types.h> when the system +# doesn't have one that works with the given compiler. +sys/types.h: sys_types.in.h $(top_builddir)/config.status + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \ + -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ + -e 's|@''WINDOWS_STAT_INODES''@|$(WINDOWS_STAT_INODES)|g' \ + < $(srcdir)/sys_types.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += sys/types.h sys/types.h-t + +EXTRA_DIST += sys_types.in.h + +## end gnulib module sys_types + +## begin gnulib module sys_wait + +BUILT_SOURCES += sys/wait.h + +# We need the following in order to create <sys/wait.h> when the system +# has one that is incomplete. +sys/wait.h: sys_wait.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \ + -e 's/@''GNULIB_WAITPID''@/$(GNULIB_WAITPID)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_wait.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += sys/wait.h sys/wait.h-t +MOSTLYCLEANDIRS += sys + +EXTRA_DIST += sys_wait.in.h + +## end gnulib module sys_wait + +## begin gnulib module system-quote + +libdiffutils_a_SOURCES += system-quote.h system-quote.c + +## end gnulib module system-quote + +## begin gnulib module tempname + +libdiffutils_a_SOURCES += tempname.c + +EXTRA_DIST += tempname.h + +## end gnulib module tempname + +## begin gnulib module time + +BUILT_SOURCES += time.h + +# We need the following in order to create <time.h> when the system +# doesn't have one that works with the given compiler. +time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \ + -e 's/@''GNULIB_CTIME''@/$(GNULIB_CTIME)/g' \ + -e 's/@''GNULIB_LOCALTIME''@/$(GNULIB_LOCALTIME)/g' \ + -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \ + -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \ + -e 's/@''GNULIB_STRFTIME''@/$(GNULIB_STRFTIME)/g' \ + -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \ + -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \ + -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \ + -e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/g' \ + -e 's/@''GNULIB_TZSET''@/$(GNULIB_TZSET)/g' \ + -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \ + -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \ + -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \ + -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \ + -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \ + -e 's|@''HAVE_TZSET''@|$(HAVE_TZSET)|g' \ + -e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \ + -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \ + -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \ + -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ + -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \ + -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ + -e 's|@''REPLACE_STRFTIME''@|$(REPLACE_STRFTIME)|g' \ + -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \ + -e 's|@''REPLACE_TZSET''@|$(REPLACE_TZSET)|g' \ + -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/time.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += time.h time.h-t + +EXTRA_DIST += time.in.h + +## end gnulib module time + +## begin gnulib module time_r + + +EXTRA_DIST += time_r.c + +EXTRA_libdiffutils_a_SOURCES += time_r.c + +## end gnulib module time_r + +## begin gnulib module time_rz + + +EXTRA_DIST += time-internal.h time_rz.c + +EXTRA_libdiffutils_a_SOURCES += time_rz.c + +## end gnulib module time_rz + +## begin gnulib module timegm + + +EXTRA_DIST += mktime-internal.h timegm.c + +EXTRA_libdiffutils_a_SOURCES += timegm.c + +## end gnulib module timegm + +## begin gnulib module timespec + +libdiffutils_a_SOURCES += timespec.c + +EXTRA_DIST += timespec.h + +## end gnulib module timespec + +## begin gnulib module trim + +libdiffutils_a_SOURCES += trim.c + +EXTRA_DIST += trim.h + +## end gnulib module trim + +## begin gnulib module tzset + + +EXTRA_DIST += tzset.c + +EXTRA_libdiffutils_a_SOURCES += tzset.c + +## end gnulib module tzset + +## begin gnulib module unistd + +BUILT_SOURCES += unistd.h +libdiffutils_a_SOURCES += unistd.c + +# We need the following in order to create an empty placeholder for +# <unistd.h> when the system doesn't have one. +unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ + -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ + -e 's/@''GNULIB_CHDIR''@/$(GNULIB_CHDIR)/g' \ + -e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \ + -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \ + -e 's/@''GNULIB_DUP''@/$(GNULIB_DUP)/g' \ + -e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \ + -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \ + -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \ + -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \ + -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \ + -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \ + -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \ + -e 's/@''GNULIB_FDATASYNC''@/$(GNULIB_FDATASYNC)/g' \ + -e 's/@''GNULIB_FSYNC''@/$(GNULIB_FSYNC)/g' \ + -e 's/@''GNULIB_FTRUNCATE''@/$(GNULIB_FTRUNCATE)/g' \ + -e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \ + -e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \ + -e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \ + -e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \ + -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \ + -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \ + -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \ + -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \ + -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \ + -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \ + -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \ + -e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \ + -e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \ + -e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \ + -e 's/@''GNULIB_LSEEK''@/$(GNULIB_LSEEK)/g' \ + -e 's/@''GNULIB_PIPE''@/$(GNULIB_PIPE)/g' \ + -e 's/@''GNULIB_PIPE2''@/$(GNULIB_PIPE2)/g' \ + -e 's/@''GNULIB_PREAD''@/$(GNULIB_PREAD)/g' \ + -e 's/@''GNULIB_PWRITE''@/$(GNULIB_PWRITE)/g' \ + -e 's/@''GNULIB_READ''@/$(GNULIB_READ)/g' \ + -e 's/@''GNULIB_READLINK''@/$(GNULIB_READLINK)/g' \ + -e 's/@''GNULIB_READLINKAT''@/$(GNULIB_READLINKAT)/g' \ + -e 's/@''GNULIB_RMDIR''@/$(GNULIB_RMDIR)/g' \ + -e 's/@''GNULIB_SETHOSTNAME''@/$(GNULIB_SETHOSTNAME)/g' \ + -e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \ + -e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \ + -e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \ + -e 's/@''GNULIB_TRUNCATE''@/$(GNULIB_TRUNCATE)/g' \ + -e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \ + -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_GL_UNISTD_H_GETOPT)/g' \ + -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \ + -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \ + -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \ + -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \ + -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \ + < $(srcdir)/unistd.in.h | \ + sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \ + -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ + -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \ + -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ + -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \ + -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \ + -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \ + -e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \ + -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ + -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ + -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \ + -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ + -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \ + -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ + -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ + -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \ + -e 's|@''HAVE_PIPE''@|$(HAVE_PIPE)|g' \ + -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \ + -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \ + -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \ + -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ + -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \ + -e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \ + -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ + -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \ + -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \ + -e 's|@''HAVE_TRUNCATE''@|$(HAVE_TRUNCATE)|g' \ + -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \ + -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ + -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ + -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \ + -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \ + -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN''@|$(HAVE_DECL_GETLOGIN)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ + -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ + -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \ + -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \ + -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \ + -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ + -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ + | \ + sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ + -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ + -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ + -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ + -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \ + -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \ + -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ + -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \ + -e 's|@''REPLACE_GETDTABLESIZE''@|$(REPLACE_GETDTABLESIZE)|g' \ + -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \ + -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \ + -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ + -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \ + -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ + -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \ + -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \ + -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ + -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \ + -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \ + -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \ + -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \ + -e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \ + -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \ + -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \ + -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \ + -e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \ + -e 's|@''REPLACE_TRUNCATE''@|$(REPLACE_TRUNCATE)|g' \ + -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \ + -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \ + -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \ + -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \ + -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \ + -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \ + -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += unistd.h unistd.h-t + +EXTRA_DIST += unistd.in.h + +## end gnulib module unistd + +## begin gnulib module unistr/base + +BUILT_SOURCES += $(LIBUNISTRING_UNISTR_H) + +unistr.h: unistr.in.h + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/unistr.in.h; \ + } > $@-t && \ + mv -f $@-t $@ +MOSTLYCLEANFILES += unistr.h unistr.h-t + +EXTRA_DIST += unistr.in.h + +## end gnulib module unistr/base + +## begin gnulib module unistr/u8-mbtoucr + +if LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR +libdiffutils_a_SOURCES += unistr/u8-mbtoucr.c +endif + +## end gnulib module unistr/u8-mbtoucr + +## begin gnulib module unistr/u8-uctomb + +if LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB +libdiffutils_a_SOURCES += unistr/u8-uctomb.c unistr/u8-uctomb-aux.c +endif + +## end gnulib module unistr/u8-uctomb + +## begin gnulib module unitypes + +BUILT_SOURCES += $(LIBUNISTRING_UNITYPES_H) + +unitypes.h: unitypes.in.h + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/unitypes.in.h; \ + } > $@-t && \ + mv -f $@-t $@ +MOSTLYCLEANFILES += unitypes.h unitypes.h-t + +EXTRA_DIST += unitypes.in.h + +## end gnulib module unitypes + +## begin gnulib module uniwidth/base + +BUILT_SOURCES += $(LIBUNISTRING_UNIWIDTH_H) + +uniwidth.h: uniwidth.in.h + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/uniwidth.in.h; \ + } > $@-t && \ + mv -f $@-t $@ +MOSTLYCLEANFILES += uniwidth.h uniwidth.h-t + +EXTRA_DIST += localcharset.h uniwidth.in.h + +## end gnulib module uniwidth/base + +## begin gnulib module uniwidth/width + +if LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH +libdiffutils_a_SOURCES += uniwidth/width.c +endif + +EXTRA_DIST += uniwidth/cjk.h + +## end gnulib module uniwidth/width + +## begin gnulib module unlocked-io + + +EXTRA_DIST += unlocked-io.h + +## end gnulib module unlocked-io + +## begin gnulib module unsetenv + + +EXTRA_DIST += unsetenv.c + +EXTRA_libdiffutils_a_SOURCES += unsetenv.c + +## end gnulib module unsetenv + +## begin gnulib module update-copyright + + +EXTRA_DIST += $(top_srcdir)/build-aux/update-copyright + +## end gnulib module update-copyright + +## begin gnulib module useless-if-before-free + + +EXTRA_DIST += $(top_srcdir)/build-aux/useless-if-before-free + +## end gnulib module useless-if-before-free + +## begin gnulib module vasnprintf + + +EXTRA_DIST += asnprintf.c float+.h printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h + +EXTRA_libdiffutils_a_SOURCES += asnprintf.c printf-args.c printf-parse.c vasnprintf.c + +## end gnulib module vasnprintf + +## begin gnulib module vasprintf + + +EXTRA_DIST += asprintf.c vasprintf.c + +EXTRA_libdiffutils_a_SOURCES += asprintf.c vasprintf.c + +## end gnulib module vasprintf + +## begin gnulib module vc-list-files + + +EXTRA_DIST += $(top_srcdir)/build-aux/vc-list-files + +## end gnulib module vc-list-files + +## begin gnulib module verify + + +EXTRA_DIST += verify.h + +## end gnulib module verify + +## begin gnulib module version-etc + +libdiffutils_a_SOURCES += version-etc.h version-etc.c + +## end gnulib module version-etc + +## begin gnulib module version-etc-fsf + +libdiffutils_a_SOURCES += version-etc-fsf.c + +## end gnulib module version-etc-fsf + +## begin gnulib module wchar + +BUILT_SOURCES += wchar.h + +# We need the following in order to create <wchar.h> when the system +# version does not work standalone. +wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \ + -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \ + -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \ + -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \ + -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ + -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \ + -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \ + -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \ + -e 's/@''GNULIB_MBRTOWC''@/$(GNULIB_MBRTOWC)/g' \ + -e 's/@''GNULIB_MBRLEN''@/$(GNULIB_MBRLEN)/g' \ + -e 's/@''GNULIB_MBSRTOWCS''@/$(GNULIB_MBSRTOWCS)/g' \ + -e 's/@''GNULIB_MBSNRTOWCS''@/$(GNULIB_MBSNRTOWCS)/g' \ + -e 's/@''GNULIB_WCRTOMB''@/$(GNULIB_WCRTOMB)/g' \ + -e 's/@''GNULIB_WCSRTOMBS''@/$(GNULIB_WCSRTOMBS)/g' \ + -e 's/@''GNULIB_WCSNRTOMBS''@/$(GNULIB_WCSNRTOMBS)/g' \ + -e 's/@''GNULIB_WCWIDTH''@/$(GNULIB_WCWIDTH)/g' \ + -e 's/@''GNULIB_WMEMCHR''@/$(GNULIB_WMEMCHR)/g' \ + -e 's/@''GNULIB_WMEMCMP''@/$(GNULIB_WMEMCMP)/g' \ + -e 's/@''GNULIB_WMEMCPY''@/$(GNULIB_WMEMCPY)/g' \ + -e 's/@''GNULIB_WMEMMOVE''@/$(GNULIB_WMEMMOVE)/g' \ + -e 's/@''GNULIB_WMEMSET''@/$(GNULIB_WMEMSET)/g' \ + -e 's/@''GNULIB_WCSLEN''@/$(GNULIB_WCSLEN)/g' \ + -e 's/@''GNULIB_WCSNLEN''@/$(GNULIB_WCSNLEN)/g' \ + -e 's/@''GNULIB_WCSCPY''@/$(GNULIB_WCSCPY)/g' \ + -e 's/@''GNULIB_WCPCPY''@/$(GNULIB_WCPCPY)/g' \ + -e 's/@''GNULIB_WCSNCPY''@/$(GNULIB_WCSNCPY)/g' \ + -e 's/@''GNULIB_WCPNCPY''@/$(GNULIB_WCPNCPY)/g' \ + -e 's/@''GNULIB_WCSCAT''@/$(GNULIB_WCSCAT)/g' \ + -e 's/@''GNULIB_WCSNCAT''@/$(GNULIB_WCSNCAT)/g' \ + -e 's/@''GNULIB_WCSCMP''@/$(GNULIB_WCSCMP)/g' \ + -e 's/@''GNULIB_WCSNCMP''@/$(GNULIB_WCSNCMP)/g' \ + -e 's/@''GNULIB_WCSCASECMP''@/$(GNULIB_WCSCASECMP)/g' \ + -e 's/@''GNULIB_WCSNCASECMP''@/$(GNULIB_WCSNCASECMP)/g' \ + -e 's/@''GNULIB_WCSCOLL''@/$(GNULIB_WCSCOLL)/g' \ + -e 's/@''GNULIB_WCSXFRM''@/$(GNULIB_WCSXFRM)/g' \ + -e 's/@''GNULIB_WCSDUP''@/$(GNULIB_WCSDUP)/g' \ + -e 's/@''GNULIB_WCSCHR''@/$(GNULIB_WCSCHR)/g' \ + -e 's/@''GNULIB_WCSRCHR''@/$(GNULIB_WCSRCHR)/g' \ + -e 's/@''GNULIB_WCSCSPN''@/$(GNULIB_WCSCSPN)/g' \ + -e 's/@''GNULIB_WCSSPN''@/$(GNULIB_WCSSPN)/g' \ + -e 's/@''GNULIB_WCSPBRK''@/$(GNULIB_WCSPBRK)/g' \ + -e 's/@''GNULIB_WCSSTR''@/$(GNULIB_WCSSTR)/g' \ + -e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \ + -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \ + -e 's/@''GNULIB_WCSFTIME''@/$(GNULIB_WCSFTIME)/g' \ + < $(srcdir)/wchar.in.h | \ + sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \ + -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \ + -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \ + -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \ + -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \ + -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \ + -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \ + -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \ + -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \ + -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \ + -e 's|@''HAVE_WMEMCHR''@|$(HAVE_WMEMCHR)|g' \ + -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \ + -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \ + -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \ + -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \ + -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \ + -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \ + -e 's|@''HAVE_WCSCPY''@|$(HAVE_WCSCPY)|g' \ + -e 's|@''HAVE_WCPCPY''@|$(HAVE_WCPCPY)|g' \ + -e 's|@''HAVE_WCSNCPY''@|$(HAVE_WCSNCPY)|g' \ + -e 's|@''HAVE_WCPNCPY''@|$(HAVE_WCPNCPY)|g' \ + -e 's|@''HAVE_WCSCAT''@|$(HAVE_WCSCAT)|g' \ + -e 's|@''HAVE_WCSNCAT''@|$(HAVE_WCSNCAT)|g' \ + -e 's|@''HAVE_WCSCMP''@|$(HAVE_WCSCMP)|g' \ + -e 's|@''HAVE_WCSNCMP''@|$(HAVE_WCSNCMP)|g' \ + -e 's|@''HAVE_WCSCASECMP''@|$(HAVE_WCSCASECMP)|g' \ + -e 's|@''HAVE_WCSNCASECMP''@|$(HAVE_WCSNCASECMP)|g' \ + -e 's|@''HAVE_WCSCOLL''@|$(HAVE_WCSCOLL)|g' \ + -e 's|@''HAVE_WCSXFRM''@|$(HAVE_WCSXFRM)|g' \ + -e 's|@''HAVE_WCSDUP''@|$(HAVE_WCSDUP)|g' \ + -e 's|@''HAVE_WCSCHR''@|$(HAVE_WCSCHR)|g' \ + -e 's|@''HAVE_WCSRCHR''@|$(HAVE_WCSRCHR)|g' \ + -e 's|@''HAVE_WCSCSPN''@|$(HAVE_WCSCSPN)|g' \ + -e 's|@''HAVE_WCSSPN''@|$(HAVE_WCSSPN)|g' \ + -e 's|@''HAVE_WCSPBRK''@|$(HAVE_WCSPBRK)|g' \ + -e 's|@''HAVE_WCSSTR''@|$(HAVE_WCSSTR)|g' \ + -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \ + -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \ + -e 's|@''HAVE_WCSFTIME''@|$(HAVE_WCSFTIME)|g' \ + -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ + -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ + | \ + sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \ + -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \ + -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \ + -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \ + -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \ + -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \ + -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \ + -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \ + -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \ + -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \ + -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \ + -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ + -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \ + -e 's|@''REPLACE_WCSFTIME''@|$(REPLACE_WCSFTIME)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += wchar.h wchar.h-t + +EXTRA_DIST += wchar.in.h + +## end gnulib module wchar + +## begin gnulib module wcrtomb + + +EXTRA_DIST += wcrtomb.c + +EXTRA_libdiffutils_a_SOURCES += wcrtomb.c + +## end gnulib module wcrtomb + +## begin gnulib module wctype-h + +BUILT_SOURCES += wctype.h +libdiffutils_a_SOURCES += wctype-h.c + +# We need the following in order to create <wctype.h> when the system +# doesn't have one that works with the given compiler. +wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \ + -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \ + -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ + -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \ + -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \ + -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \ + -e 's/@''GNULIB_WCTRANS''@/$(GNULIB_WCTRANS)/g' \ + -e 's/@''GNULIB_TOWCTRANS''@/$(GNULIB_TOWCTRANS)/g' \ + -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \ + -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \ + -e 's/@''HAVE_WCTYPE_T''@/$(HAVE_WCTYPE_T)/g' \ + -e 's/@''HAVE_WCTRANS_T''@/$(HAVE_WCTRANS_T)/g' \ + -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ + -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \ + -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \ + -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/wctype.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += wctype.h wctype.h-t + +EXTRA_DIST += wctype.in.h + +## end gnulib module wctype-h + +## begin gnulib module wcwidth + + +EXTRA_DIST += wcwidth.c + +EXTRA_libdiffutils_a_SOURCES += wcwidth.c + +## end gnulib module wcwidth + +## begin gnulib module xalloc + +libdiffutils_a_SOURCES += xmalloc.c + +EXTRA_DIST += xalloc.h + +## end gnulib module xalloc + +## begin gnulib module xalloc-die + +libdiffutils_a_SOURCES += xalloc-die.c + +## end gnulib module xalloc-die + +## begin gnulib module xalloc-oversized + + +EXTRA_DIST += xalloc-oversized.h + +## end gnulib module xalloc-oversized + +## begin gnulib module xfreopen + +libdiffutils_a_SOURCES += xfreopen.c xfreopen.h + +## end gnulib module xfreopen + +## begin gnulib module xreadlink + +libdiffutils_a_SOURCES += xreadlink.c + +EXTRA_DIST += xreadlink.h + +## end gnulib module xreadlink + +## begin gnulib module xsize + +libdiffutils_a_SOURCES += xsize.h xsize.c + +## end gnulib module xsize + +## begin gnulib module xstriconv + +libdiffutils_a_SOURCES += xstriconv.h xstriconv.c + +## end gnulib module xstriconv + +## begin gnulib module xstrndup + +libdiffutils_a_SOURCES += xstrndup.h xstrndup.c + +## end gnulib module xstrndup + +## begin gnulib module xstrtol + +libdiffutils_a_SOURCES += xstrtol.c xstrtoul.c xstrtol-error.c + +EXTRA_DIST += xstrtol.h + +## end gnulib module xstrtol + +## begin gnulib module xstrtoumax + +libdiffutils_a_SOURCES += xstrtoumax.c + +## end gnulib module xstrtoumax + +## begin gnulib module xvasprintf + +libdiffutils_a_SOURCES += xvasprintf.h xvasprintf.c xasprintf.c + +EXTRA_DIST += xalloc.h + +## end gnulib module xvasprintf + + +mostlyclean-local: mostlyclean-generic + @for dir in '' $(MOSTLYCLEANDIRS); do \ + if test -n "$$dir" && test -d $$dir; then \ + echo "rmdir $$dir"; rmdir $$dir; \ + fi; \ + done; \ + : diff --git a/local/recipes/tools/diffutils/source/lib/hard-locale.c b/local/recipes/tools/diffutils/source/lib/hard-locale.c new file mode 100644 index 0000000000..57ed42bff1 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/hard-locale.c @@ -0,0 +1,72 @@ +/* hard-locale.c -- Determine whether a locale is hard. + + Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2017 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "hard-locale.h" + +#include <locale.h> +#include <stdlib.h> +#include <string.h> + +#ifdef __GLIBC__ +# define GLIBC_VERSION __GLIBC__ +#elif defined __UCLIBC__ +# define GLIBC_VERSION 2 +#else +# define GLIBC_VERSION 0 +#endif + +/* Return true if the current CATEGORY locale is hard, i.e. if you + can't get away with assuming traditional C or POSIX behavior. */ +bool +hard_locale (int category) +{ + bool hard = true; + char const *p = setlocale (category, NULL); + + if (p) + { + if (2 <= GLIBC_VERSION) + { + if (strcmp (p, "C") == 0 || strcmp (p, "POSIX") == 0) + hard = false; + } + else + { + char *locale = strdup (p); + if (locale) + { + /* Temporarily set the locale to the "C" and "POSIX" locales + to find their names, so that we can determine whether one + or the other is the caller's locale. */ + if (((p = setlocale (category, "C")) + && strcmp (p, locale) == 0) + || ((p = setlocale (category, "POSIX")) + && strcmp (p, locale) == 0)) + hard = false; + + /* Restore the caller's locale. */ + setlocale (category, locale); + free (locale); + } + } + } + + return hard; +} diff --git a/local/recipes/tools/diffutils/source/lib/hard-locale.h b/local/recipes/tools/diffutils/source/lib/hard-locale.h new file mode 100644 index 0000000000..ba424afc77 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/hard-locale.h @@ -0,0 +1,25 @@ +/* Determine whether a locale is hard. + + Copyright (C) 1999, 2003-2004, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef HARD_LOCALE_H_ +# define HARD_LOCALE_H_ 1 + +# include <stdbool.h> + +bool hard_locale (int); + +#endif /* HARD_LOCALE_H_ */ diff --git a/local/recipes/tools/diffutils/source/lib/hash.c b/local/recipes/tools/diffutils/source/lib/hash.c new file mode 100644 index 0000000000..04f64d1517 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/hash.c @@ -0,0 +1,1225 @@ +/* hash - hashing table processing. + + Copyright (C) 1998-2004, 2006-2007, 2009-2017 Free Software Foundation, Inc. + + Written by Jim Meyering, 1992. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* A generic hash table package. */ + +/* Define USE_OBSTACK to 1 if you want the allocator to use obstacks instead + of malloc. If you change USE_OBSTACK, you have to recompile! */ + +#include <config.h> + +#include "hash.h" + +#include "bitrotate.h" +#include "xalloc-oversized.h" + +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> + +#if USE_OBSTACK +# include "obstack.h" +# ifndef obstack_chunk_alloc +# define obstack_chunk_alloc malloc +# endif +# ifndef obstack_chunk_free +# define obstack_chunk_free free +# endif +#endif + +struct hash_entry + { + void *data; + struct hash_entry *next; + }; + +struct hash_table + { + /* The array of buckets starts at BUCKET and extends to BUCKET_LIMIT-1, + for a possibility of N_BUCKETS. Among those, N_BUCKETS_USED buckets + are not empty, there are N_ENTRIES active entries in the table. */ + struct hash_entry *bucket; + struct hash_entry const *bucket_limit; + size_t n_buckets; + size_t n_buckets_used; + size_t n_entries; + + /* Tuning arguments, kept in a physically separate structure. */ + const Hash_tuning *tuning; + + /* Three functions are given to 'hash_initialize', see the documentation + block for this function. In a word, HASHER randomizes a user entry + into a number up from 0 up to some maximum minus 1; COMPARATOR returns + true if two user entries compare equally; and DATA_FREER is the cleanup + function for a user entry. */ + Hash_hasher hasher; + Hash_comparator comparator; + Hash_data_freer data_freer; + + /* A linked list of freed struct hash_entry structs. */ + struct hash_entry *free_entry_list; + +#if USE_OBSTACK + /* Whenever obstacks are used, it is possible to allocate all overflowed + entries into a single stack, so they all can be freed in a single + operation. It is not clear if the speedup is worth the trouble. */ + struct obstack entry_stack; +#endif + }; + +/* A hash table contains many internal entries, each holding a pointer to + some user-provided data (also called a user entry). An entry indistinctly + refers to both the internal entry and its associated user entry. A user + entry contents may be hashed by a randomization function (the hashing + function, or just "hasher" for short) into a number (or "slot") between 0 + and the current table size. At each slot position in the hash table, + starts a linked chain of entries for which the user data all hash to this + slot. A bucket is the collection of all entries hashing to the same slot. + + A good "hasher" function will distribute entries rather evenly in buckets. + In the ideal case, the length of each bucket is roughly the number of + entries divided by the table size. Finding the slot for a data is usually + done in constant time by the "hasher", and the later finding of a precise + entry is linear in time with the size of the bucket. Consequently, a + larger hash table size (that is, a larger number of buckets) is prone to + yielding shorter chains, *given* the "hasher" function behaves properly. + + Long buckets slow down the lookup algorithm. One might use big hash table + sizes in hope to reduce the average length of buckets, but this might + become inordinate, as unused slots in the hash table take some space. The + best bet is to make sure you are using a good "hasher" function (beware + that those are not that easy to write! :-), and to use a table size + larger than the actual number of entries. */ + +/* If an insertion makes the ratio of nonempty buckets to table size larger + than the growth threshold (a number between 0.0 and 1.0), then increase + the table size by multiplying by the growth factor (a number greater than + 1.0). The growth threshold defaults to 0.8, and the growth factor + defaults to 1.414, meaning that the table will have doubled its size + every second time 80% of the buckets get used. */ +#define DEFAULT_GROWTH_THRESHOLD 0.8f +#define DEFAULT_GROWTH_FACTOR 1.414f + +/* If a deletion empties a bucket and causes the ratio of used buckets to + table size to become smaller than the shrink threshold (a number between + 0.0 and 1.0), then shrink the table by multiplying by the shrink factor (a + number greater than the shrink threshold but smaller than 1.0). The shrink + threshold and factor default to 0.0 and 1.0, meaning that the table never + shrinks. */ +#define DEFAULT_SHRINK_THRESHOLD 0.0f +#define DEFAULT_SHRINK_FACTOR 1.0f + +/* Use this to initialize or reset a TUNING structure to + some sensible values. */ +static const Hash_tuning default_tuning = + { + DEFAULT_SHRINK_THRESHOLD, + DEFAULT_SHRINK_FACTOR, + DEFAULT_GROWTH_THRESHOLD, + DEFAULT_GROWTH_FACTOR, + false + }; + +/* Information and lookup. */ + +/* The following few functions provide information about the overall hash + table organization: the number of entries, number of buckets and maximum + length of buckets. */ + +/* Return the number of buckets in the hash table. The table size, the total + number of buckets (used plus unused), or the maximum number of slots, are + the same quantity. */ + +size_t +hash_get_n_buckets (const Hash_table *table) +{ + return table->n_buckets; +} + +/* Return the number of slots in use (non-empty buckets). */ + +size_t +hash_get_n_buckets_used (const Hash_table *table) +{ + return table->n_buckets_used; +} + +/* Return the number of active entries. */ + +size_t +hash_get_n_entries (const Hash_table *table) +{ + return table->n_entries; +} + +/* Return the length of the longest chain (bucket). */ + +size_t +hash_get_max_bucket_length (const Hash_table *table) +{ + struct hash_entry const *bucket; + size_t max_bucket_length = 0; + + for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) + { + if (bucket->data) + { + struct hash_entry const *cursor = bucket; + size_t bucket_length = 1; + + while (cursor = cursor->next, cursor) + bucket_length++; + + if (bucket_length > max_bucket_length) + max_bucket_length = bucket_length; + } + } + + return max_bucket_length; +} + +/* Do a mild validation of a hash table, by traversing it and checking two + statistics. */ + +bool +hash_table_ok (const Hash_table *table) +{ + struct hash_entry const *bucket; + size_t n_buckets_used = 0; + size_t n_entries = 0; + + for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) + { + if (bucket->data) + { + struct hash_entry const *cursor = bucket; + + /* Count bucket head. */ + n_buckets_used++; + n_entries++; + + /* Count bucket overflow. */ + while (cursor = cursor->next, cursor) + n_entries++; + } + } + + if (n_buckets_used == table->n_buckets_used && n_entries == table->n_entries) + return true; + + return false; +} + +void +hash_print_statistics (const Hash_table *table, FILE *stream) +{ + size_t n_entries = hash_get_n_entries (table); + size_t n_buckets = hash_get_n_buckets (table); + size_t n_buckets_used = hash_get_n_buckets_used (table); + size_t max_bucket_length = hash_get_max_bucket_length (table); + + fprintf (stream, "# entries: %lu\n", (unsigned long int) n_entries); + fprintf (stream, "# buckets: %lu\n", (unsigned long int) n_buckets); + fprintf (stream, "# buckets used: %lu (%.2f%%)\n", + (unsigned long int) n_buckets_used, + (100.0 * n_buckets_used) / n_buckets); + fprintf (stream, "max bucket length: %lu\n", + (unsigned long int) max_bucket_length); +} + +/* Hash KEY and return a pointer to the selected bucket. + If TABLE->hasher misbehaves, abort. */ +static struct hash_entry * +safe_hasher (const Hash_table *table, const void *key) +{ + size_t n = table->hasher (key, table->n_buckets); + if (! (n < table->n_buckets)) + abort (); + return table->bucket + n; +} + +/* If ENTRY matches an entry already in the hash table, return the + entry from the table. Otherwise, return NULL. */ + +void * +hash_lookup (const Hash_table *table, const void *entry) +{ + struct hash_entry const *bucket = safe_hasher (table, entry); + struct hash_entry const *cursor; + + if (bucket->data == NULL) + return NULL; + + for (cursor = bucket; cursor; cursor = cursor->next) + if (entry == cursor->data || table->comparator (entry, cursor->data)) + return cursor->data; + + return NULL; +} + +/* Walking. */ + +/* The functions in this page traverse the hash table and process the + contained entries. For the traversal to work properly, the hash table + should not be resized nor modified while any particular entry is being + processed. In particular, entries should not be added, and an entry + may be removed only if there is no shrink threshold and the entry being + removed has already been passed to hash_get_next. */ + +/* Return the first data in the table, or NULL if the table is empty. */ + +void * +hash_get_first (const Hash_table *table) +{ + struct hash_entry const *bucket; + + if (table->n_entries == 0) + return NULL; + + for (bucket = table->bucket; ; bucket++) + if (! (bucket < table->bucket_limit)) + abort (); + else if (bucket->data) + return bucket->data; +} + +/* Return the user data for the entry following ENTRY, where ENTRY has been + returned by a previous call to either 'hash_get_first' or 'hash_get_next'. + Return NULL if there are no more entries. */ + +void * +hash_get_next (const Hash_table *table, const void *entry) +{ + struct hash_entry const *bucket = safe_hasher (table, entry); + struct hash_entry const *cursor; + + /* Find next entry in the same bucket. */ + cursor = bucket; + do + { + if (cursor->data == entry && cursor->next) + return cursor->next->data; + cursor = cursor->next; + } + while (cursor != NULL); + + /* Find first entry in any subsequent bucket. */ + while (++bucket < table->bucket_limit) + if (bucket->data) + return bucket->data; + + /* None found. */ + return NULL; +} + +/* Fill BUFFER with pointers to active user entries in the hash table, then + return the number of pointers copied. Do not copy more than BUFFER_SIZE + pointers. */ + +size_t +hash_get_entries (const Hash_table *table, void **buffer, + size_t buffer_size) +{ + size_t counter = 0; + struct hash_entry const *bucket; + struct hash_entry const *cursor; + + for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) + { + if (bucket->data) + { + for (cursor = bucket; cursor; cursor = cursor->next) + { + if (counter >= buffer_size) + return counter; + buffer[counter++] = cursor->data; + } + } + } + + return counter; +} + +/* Call a PROCESSOR function for each entry of a hash table, and return the + number of entries for which the processor function returned success. A + pointer to some PROCESSOR_DATA which will be made available to each call to + the processor function. The PROCESSOR accepts two arguments: the first is + the user entry being walked into, the second is the value of PROCESSOR_DATA + as received. The walking continue for as long as the PROCESSOR function + returns nonzero. When it returns zero, the walking is interrupted. */ + +size_t +hash_do_for_each (const Hash_table *table, Hash_processor processor, + void *processor_data) +{ + size_t counter = 0; + struct hash_entry const *bucket; + struct hash_entry const *cursor; + + for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) + { + if (bucket->data) + { + for (cursor = bucket; cursor; cursor = cursor->next) + { + if (! processor (cursor->data, processor_data)) + return counter; + counter++; + } + } + } + + return counter; +} + +/* Allocation and clean-up. */ + +/* Return a hash index for a NUL-terminated STRING between 0 and N_BUCKETS-1. + This is a convenience routine for constructing other hashing functions. */ + +#if USE_DIFF_HASH + +/* About hashings, Paul Eggert writes to me (FP), on 1994-01-01: "Please see + B. J. McKenzie, R. Harries & T. Bell, Selecting a hashing algorithm, + Software--practice & experience 20, 2 (Feb 1990), 209-224. Good hash + algorithms tend to be domain-specific, so what's good for [diffutils'] io.c + may not be good for your application." */ + +size_t +hash_string (const char *string, size_t n_buckets) +{ +# define HASH_ONE_CHAR(Value, Byte) \ + ((Byte) + rotl_sz (Value, 7)) + + size_t value = 0; + unsigned char ch; + + for (; (ch = *string); string++) + value = HASH_ONE_CHAR (value, ch); + return value % n_buckets; + +# undef HASH_ONE_CHAR +} + +#else /* not USE_DIFF_HASH */ + +/* This one comes from 'recode', and performs a bit better than the above as + per a few experiments. It is inspired from a hashing routine found in the + very old Cyber 'snoop', itself written in typical Greg Mansfield style. + (By the way, what happened to this excellent man? Is he still alive?) */ + +size_t +hash_string (const char *string, size_t n_buckets) +{ + size_t value = 0; + unsigned char ch; + + for (; (ch = *string); string++) + value = (value * 31 + ch) % n_buckets; + return value; +} + +#endif /* not USE_DIFF_HASH */ + +/* Return true if CANDIDATE is a prime number. CANDIDATE should be an odd + number at least equal to 11. */ + +static bool _GL_ATTRIBUTE_CONST +is_prime (size_t candidate) +{ + size_t divisor = 3; + size_t square = divisor * divisor; + + while (square < candidate && (candidate % divisor)) + { + divisor++; + square += 4 * divisor; + divisor++; + } + + return (candidate % divisor ? true : false); +} + +/* Round a given CANDIDATE number up to the nearest prime, and return that + prime. Primes lower than 10 are merely skipped. */ + +static size_t _GL_ATTRIBUTE_CONST +next_prime (size_t candidate) +{ + /* Skip small primes. */ + if (candidate < 10) + candidate = 10; + + /* Make it definitely odd. */ + candidate |= 1; + + while (SIZE_MAX != candidate && !is_prime (candidate)) + candidate += 2; + + return candidate; +} + +void +hash_reset_tuning (Hash_tuning *tuning) +{ + *tuning = default_tuning; +} + +/* If the user passes a NULL hasher, we hash the raw pointer. */ +static size_t +raw_hasher (const void *data, size_t n) +{ + /* When hashing unique pointers, it is often the case that they were + generated by malloc and thus have the property that the low-order + bits are 0. As this tends to give poorer performance with small + tables, we rotate the pointer value before performing division, + in an attempt to improve hash quality. */ + size_t val = rotr_sz ((size_t) data, 3); + return val % n; +} + +/* If the user passes a NULL comparator, we use pointer comparison. */ +static bool +raw_comparator (const void *a, const void *b) +{ + return a == b; +} + + +/* For the given hash TABLE, check the user supplied tuning structure for + reasonable values, and return true if there is no gross error with it. + Otherwise, definitively reset the TUNING field to some acceptable default + in the hash table (that is, the user loses the right of further modifying + tuning arguments), and return false. */ + +static bool +check_tuning (Hash_table *table) +{ + const Hash_tuning *tuning = table->tuning; + float epsilon; + if (tuning == &default_tuning) + return true; + + /* Be a bit stricter than mathematics would require, so that + rounding errors in size calculations do not cause allocations to + fail to grow or shrink as they should. The smallest allocation + is 11 (due to next_prime's algorithm), so an epsilon of 0.1 + should be good enough. */ + epsilon = 0.1f; + + if (epsilon < tuning->growth_threshold + && tuning->growth_threshold < 1 - epsilon + && 1 + epsilon < tuning->growth_factor + && 0 <= tuning->shrink_threshold + && tuning->shrink_threshold + epsilon < tuning->shrink_factor + && tuning->shrink_factor <= 1 + && tuning->shrink_threshold + epsilon < tuning->growth_threshold) + return true; + + table->tuning = &default_tuning; + return false; +} + +/* Compute the size of the bucket array for the given CANDIDATE and + TUNING, or return 0 if there is no possible way to allocate that + many entries. */ + +static size_t _GL_ATTRIBUTE_PURE +compute_bucket_size (size_t candidate, const Hash_tuning *tuning) +{ + if (!tuning->is_n_buckets) + { + float new_candidate = candidate / tuning->growth_threshold; + if (SIZE_MAX <= new_candidate) + return 0; + candidate = new_candidate; + } + candidate = next_prime (candidate); + if (xalloc_oversized (candidate, sizeof (struct hash_entry *))) + return 0; + return candidate; +} + +/* Allocate and return a new hash table, or NULL upon failure. The initial + number of buckets is automatically selected so as to _guarantee_ that you + may insert at least CANDIDATE different user entries before any growth of + the hash table size occurs. So, if have a reasonably tight a-priori upper + bound on the number of entries you intend to insert in the hash table, you + may save some table memory and insertion time, by specifying it here. If + the IS_N_BUCKETS field of the TUNING structure is true, the CANDIDATE + argument has its meaning changed to the wanted number of buckets. + + TUNING points to a structure of user-supplied values, in case some fine + tuning is wanted over the default behavior of the hasher. If TUNING is + NULL, the default tuning parameters are used instead. If TUNING is + provided but the values requested are out of bounds or might cause + rounding errors, return NULL. + + The user-supplied HASHER function, when not NULL, accepts two + arguments ENTRY and TABLE_SIZE. It computes, by hashing ENTRY contents, a + slot number for that entry which should be in the range 0..TABLE_SIZE-1. + This slot number is then returned. + + The user-supplied COMPARATOR function, when not NULL, accepts two + arguments pointing to user data, it then returns true for a pair of entries + that compare equal, or false otherwise. This function is internally called + on entries which are already known to hash to the same bucket index, + but which are distinct pointers. + + The user-supplied DATA_FREER function, when not NULL, may be later called + with the user data as an argument, just before the entry containing the + data gets freed. This happens from within 'hash_free' or 'hash_clear'. + You should specify this function only if you want these functions to free + all of your 'data' data. This is typically the case when your data is + simply an auxiliary struct that you have malloc'd to aggregate several + values. */ + +Hash_table * +hash_initialize (size_t candidate, const Hash_tuning *tuning, + Hash_hasher hasher, Hash_comparator comparator, + Hash_data_freer data_freer) +{ + Hash_table *table; + + if (hasher == NULL) + hasher = raw_hasher; + if (comparator == NULL) + comparator = raw_comparator; + + table = malloc (sizeof *table); + if (table == NULL) + return NULL; + + if (!tuning) + tuning = &default_tuning; + table->tuning = tuning; + if (!check_tuning (table)) + { + /* Fail if the tuning options are invalid. This is the only occasion + when the user gets some feedback about it. Once the table is created, + if the user provides invalid tuning options, we silently revert to + using the defaults, and ignore further request to change the tuning + options. */ + goto fail; + } + + table->n_buckets = compute_bucket_size (candidate, tuning); + if (!table->n_buckets) + goto fail; + + table->bucket = calloc (table->n_buckets, sizeof *table->bucket); + if (table->bucket == NULL) + goto fail; + table->bucket_limit = table->bucket + table->n_buckets; + table->n_buckets_used = 0; + table->n_entries = 0; + + table->hasher = hasher; + table->comparator = comparator; + table->data_freer = data_freer; + + table->free_entry_list = NULL; +#if USE_OBSTACK + obstack_init (&table->entry_stack); +#endif + return table; + + fail: + free (table); + return NULL; +} + +/* Make all buckets empty, placing any chained entries on the free list. + Apply the user-specified function data_freer (if any) to the datas of any + affected entries. */ + +void +hash_clear (Hash_table *table) +{ + struct hash_entry *bucket; + + for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) + { + if (bucket->data) + { + struct hash_entry *cursor; + struct hash_entry *next; + + /* Free the bucket overflow. */ + for (cursor = bucket->next; cursor; cursor = next) + { + if (table->data_freer) + table->data_freer (cursor->data); + cursor->data = NULL; + + next = cursor->next; + /* Relinking is done one entry at a time, as it is to be expected + that overflows are either rare or short. */ + cursor->next = table->free_entry_list; + table->free_entry_list = cursor; + } + + /* Free the bucket head. */ + if (table->data_freer) + table->data_freer (bucket->data); + bucket->data = NULL; + bucket->next = NULL; + } + } + + table->n_buckets_used = 0; + table->n_entries = 0; +} + +/* Reclaim all storage associated with a hash table. If a data_freer + function has been supplied by the user when the hash table was created, + this function applies it to the data of each entry before freeing that + entry. */ + +void +hash_free (Hash_table *table) +{ + struct hash_entry *bucket; + struct hash_entry *cursor; + struct hash_entry *next; + + /* Call the user data_freer function. */ + if (table->data_freer && table->n_entries) + { + for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) + { + if (bucket->data) + { + for (cursor = bucket; cursor; cursor = cursor->next) + table->data_freer (cursor->data); + } + } + } + +#if USE_OBSTACK + + obstack_free (&table->entry_stack, NULL); + +#else + + /* Free all bucket overflowed entries. */ + for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) + { + for (cursor = bucket->next; cursor; cursor = next) + { + next = cursor->next; + free (cursor); + } + } + + /* Also reclaim the internal list of previously freed entries. */ + for (cursor = table->free_entry_list; cursor; cursor = next) + { + next = cursor->next; + free (cursor); + } + +#endif + + /* Free the remainder of the hash table structure. */ + free (table->bucket); + free (table); +} + +/* Insertion and deletion. */ + +/* Get a new hash entry for a bucket overflow, possibly by recycling a + previously freed one. If this is not possible, allocate a new one. */ + +static struct hash_entry * +allocate_entry (Hash_table *table) +{ + struct hash_entry *new; + + if (table->free_entry_list) + { + new = table->free_entry_list; + table->free_entry_list = new->next; + } + else + { +#if USE_OBSTACK + new = obstack_alloc (&table->entry_stack, sizeof *new); +#else + new = malloc (sizeof *new); +#endif + } + + return new; +} + +/* Free a hash entry which was part of some bucket overflow, + saving it for later recycling. */ + +static void +free_entry (Hash_table *table, struct hash_entry *entry) +{ + entry->data = NULL; + entry->next = table->free_entry_list; + table->free_entry_list = entry; +} + +/* This private function is used to help with insertion and deletion. When + ENTRY matches an entry in the table, return a pointer to the corresponding + user data and set *BUCKET_HEAD to the head of the selected bucket. + Otherwise, return NULL. When DELETE is true and ENTRY matches an entry in + the table, unlink the matching entry. */ + +static void * +hash_find_entry (Hash_table *table, const void *entry, + struct hash_entry **bucket_head, bool delete) +{ + struct hash_entry *bucket = safe_hasher (table, entry); + struct hash_entry *cursor; + + *bucket_head = bucket; + + /* Test for empty bucket. */ + if (bucket->data == NULL) + return NULL; + + /* See if the entry is the first in the bucket. */ + if (entry == bucket->data || table->comparator (entry, bucket->data)) + { + void *data = bucket->data; + + if (delete) + { + if (bucket->next) + { + struct hash_entry *next = bucket->next; + + /* Bump the first overflow entry into the bucket head, then save + the previous first overflow entry for later recycling. */ + *bucket = *next; + free_entry (table, next); + } + else + { + bucket->data = NULL; + } + } + + return data; + } + + /* Scan the bucket overflow. */ + for (cursor = bucket; cursor->next; cursor = cursor->next) + { + if (entry == cursor->next->data + || table->comparator (entry, cursor->next->data)) + { + void *data = cursor->next->data; + + if (delete) + { + struct hash_entry *next = cursor->next; + + /* Unlink the entry to delete, then save the freed entry for later + recycling. */ + cursor->next = next->next; + free_entry (table, next); + } + + return data; + } + } + + /* No entry found. */ + return NULL; +} + +/* Internal helper, to move entries from SRC to DST. Both tables must + share the same free entry list. If SAFE, only move overflow + entries, saving bucket heads for later, so that no allocations will + occur. Return false if the free entry list is exhausted and an + allocation fails. */ + +static bool +transfer_entries (Hash_table *dst, Hash_table *src, bool safe) +{ + struct hash_entry *bucket; + struct hash_entry *cursor; + struct hash_entry *next; + for (bucket = src->bucket; bucket < src->bucket_limit; bucket++) + if (bucket->data) + { + void *data; + struct hash_entry *new_bucket; + + /* Within each bucket, transfer overflow entries first and + then the bucket head, to minimize memory pressure. After + all, the only time we might allocate is when moving the + bucket head, but moving overflow entries first may create + free entries that can be recycled by the time we finally + get to the bucket head. */ + for (cursor = bucket->next; cursor; cursor = next) + { + data = cursor->data; + new_bucket = safe_hasher (dst, data); + + next = cursor->next; + + if (new_bucket->data) + { + /* Merely relink an existing entry, when moving from a + bucket overflow into a bucket overflow. */ + cursor->next = new_bucket->next; + new_bucket->next = cursor; + } + else + { + /* Free an existing entry, when moving from a bucket + overflow into a bucket header. */ + new_bucket->data = data; + dst->n_buckets_used++; + free_entry (dst, cursor); + } + } + /* Now move the bucket head. Be sure that if we fail due to + allocation failure that the src table is in a consistent + state. */ + data = bucket->data; + bucket->next = NULL; + if (safe) + continue; + new_bucket = safe_hasher (dst, data); + + if (new_bucket->data) + { + /* Allocate or recycle an entry, when moving from a bucket + header into a bucket overflow. */ + struct hash_entry *new_entry = allocate_entry (dst); + + if (new_entry == NULL) + return false; + + new_entry->data = data; + new_entry->next = new_bucket->next; + new_bucket->next = new_entry; + } + else + { + /* Move from one bucket header to another. */ + new_bucket->data = data; + dst->n_buckets_used++; + } + bucket->data = NULL; + src->n_buckets_used--; + } + return true; +} + +/* For an already existing hash table, change the number of buckets through + specifying CANDIDATE. The contents of the hash table are preserved. The + new number of buckets is automatically selected so as to _guarantee_ that + the table may receive at least CANDIDATE different user entries, including + those already in the table, before any other growth of the hash table size + occurs. If TUNING->IS_N_BUCKETS is true, then CANDIDATE specifies the + exact number of buckets desired. Return true iff the rehash succeeded. */ + +bool +hash_rehash (Hash_table *table, size_t candidate) +{ + Hash_table storage; + Hash_table *new_table; + size_t new_size = compute_bucket_size (candidate, table->tuning); + + if (!new_size) + return false; + if (new_size == table->n_buckets) + return true; + new_table = &storage; + new_table->bucket = calloc (new_size, sizeof *new_table->bucket); + if (new_table->bucket == NULL) + return false; + new_table->n_buckets = new_size; + new_table->bucket_limit = new_table->bucket + new_size; + new_table->n_buckets_used = 0; + new_table->n_entries = 0; + new_table->tuning = table->tuning; + new_table->hasher = table->hasher; + new_table->comparator = table->comparator; + new_table->data_freer = table->data_freer; + + /* In order for the transfer to successfully complete, we need + additional overflow entries when distinct buckets in the old + table collide into a common bucket in the new table. The worst + case possible is a hasher that gives a good spread with the old + size, but returns a constant with the new size; if we were to + guarantee table->n_buckets_used-1 free entries in advance, then + the transfer would be guaranteed to not allocate memory. + However, for large tables, a guarantee of no further allocation + introduces a lot of extra memory pressure, all for an unlikely + corner case (most rehashes reduce, rather than increase, the + number of overflow entries needed). So, we instead ensure that + the transfer process can be reversed if we hit a memory + allocation failure mid-transfer. */ + + /* Merely reuse the extra old space into the new table. */ +#if USE_OBSTACK + new_table->entry_stack = table->entry_stack; +#endif + new_table->free_entry_list = table->free_entry_list; + + if (transfer_entries (new_table, table, false)) + { + /* Entries transferred successfully; tie up the loose ends. */ + free (table->bucket); + table->bucket = new_table->bucket; + table->bucket_limit = new_table->bucket_limit; + table->n_buckets = new_table->n_buckets; + table->n_buckets_used = new_table->n_buckets_used; + table->free_entry_list = new_table->free_entry_list; + /* table->n_entries and table->entry_stack already hold their value. */ + return true; + } + + /* We've allocated new_table->bucket (and possibly some entries), + exhausted the free list, and moved some but not all entries into + new_table. We must undo the partial move before returning + failure. The only way to get into this situation is if new_table + uses fewer buckets than the old table, so we will reclaim some + free entries as overflows in the new table are put back into + distinct buckets in the old table. + + There are some pathological cases where a single pass through the + table requires more intermediate overflow entries than using two + passes. Two passes give worse cache performance and takes + longer, but at this point, we're already out of memory, so slow + and safe is better than failure. */ + table->free_entry_list = new_table->free_entry_list; + if (! (transfer_entries (table, new_table, true) + && transfer_entries (table, new_table, false))) + abort (); + /* table->n_entries already holds its value. */ + free (new_table->bucket); + return false; +} + +/* Insert ENTRY into hash TABLE if there is not already a matching entry. + + Return -1 upon memory allocation failure. + Return 1 if insertion succeeded. + Return 0 if there is already a matching entry in the table, + and in that case, if MATCHED_ENT is non-NULL, set *MATCHED_ENT + to that entry. + + This interface is easier to use than hash_insert when you must + distinguish between the latter two cases. More importantly, + hash_insert is unusable for some types of ENTRY values. When using + hash_insert, the only way to distinguish those cases is to compare + the return value and ENTRY. That works only when you can have two + different ENTRY values that point to data that compares "equal". Thus, + when the ENTRY value is a simple scalar, you must use + hash_insert_if_absent. ENTRY must not be NULL. */ +int +hash_insert_if_absent (Hash_table *table, void const *entry, + void const **matched_ent) +{ + void *data; + struct hash_entry *bucket; + + /* The caller cannot insert a NULL entry, since hash_lookup returns NULL + to indicate "not found", and hash_find_entry uses "bucket->data == NULL" + to indicate an empty bucket. */ + if (! entry) + abort (); + + /* If there's a matching entry already in the table, return that. */ + if ((data = hash_find_entry (table, entry, &bucket, false)) != NULL) + { + if (matched_ent) + *matched_ent = data; + return 0; + } + + /* If the growth threshold of the buckets in use has been reached, increase + the table size and rehash. There's no point in checking the number of + entries: if the hashing function is ill-conditioned, rehashing is not + likely to improve it. */ + + if (table->n_buckets_used + > table->tuning->growth_threshold * table->n_buckets) + { + /* Check more fully, before starting real work. If tuning arguments + became invalid, the second check will rely on proper defaults. */ + check_tuning (table); + if (table->n_buckets_used + > table->tuning->growth_threshold * table->n_buckets) + { + const Hash_tuning *tuning = table->tuning; + float candidate = + (tuning->is_n_buckets + ? (table->n_buckets * tuning->growth_factor) + : (table->n_buckets * tuning->growth_factor + * tuning->growth_threshold)); + + if (SIZE_MAX <= candidate) + return -1; + + /* If the rehash fails, arrange to return NULL. */ + if (!hash_rehash (table, candidate)) + return -1; + + /* Update the bucket we are interested in. */ + if (hash_find_entry (table, entry, &bucket, false) != NULL) + abort (); + } + } + + /* ENTRY is not matched, it should be inserted. */ + + if (bucket->data) + { + struct hash_entry *new_entry = allocate_entry (table); + + if (new_entry == NULL) + return -1; + + /* Add ENTRY in the overflow of the bucket. */ + + new_entry->data = (void *) entry; + new_entry->next = bucket->next; + bucket->next = new_entry; + table->n_entries++; + return 1; + } + + /* Add ENTRY right in the bucket head. */ + + bucket->data = (void *) entry; + table->n_entries++; + table->n_buckets_used++; + + return 1; +} + +/* If ENTRY matches an entry already in the hash table, return the pointer + to the entry from the table. Otherwise, insert ENTRY and return ENTRY. + Return NULL if the storage required for insertion cannot be allocated. + This implementation does not support duplicate entries or insertion of + NULL. */ + +void * +hash_insert (Hash_table *table, void const *entry) +{ + void const *matched_ent; + int err = hash_insert_if_absent (table, entry, &matched_ent); + return (err == -1 + ? NULL + : (void *) (err == 0 ? matched_ent : entry)); +} + +/* If ENTRY is already in the table, remove it and return the just-deleted + data (the user may want to deallocate its storage). If ENTRY is not in the + table, don't modify the table and return NULL. */ + +void * +hash_delete (Hash_table *table, const void *entry) +{ + void *data; + struct hash_entry *bucket; + + data = hash_find_entry (table, entry, &bucket, true); + if (!data) + return NULL; + + table->n_entries--; + if (!bucket->data) + { + table->n_buckets_used--; + + /* If the shrink threshold of the buckets in use has been reached, + rehash into a smaller table. */ + + if (table->n_buckets_used + < table->tuning->shrink_threshold * table->n_buckets) + { + /* Check more fully, before starting real work. If tuning arguments + became invalid, the second check will rely on proper defaults. */ + check_tuning (table); + if (table->n_buckets_used + < table->tuning->shrink_threshold * table->n_buckets) + { + const Hash_tuning *tuning = table->tuning; + size_t candidate = + (tuning->is_n_buckets + ? table->n_buckets * tuning->shrink_factor + : (table->n_buckets * tuning->shrink_factor + * tuning->growth_threshold)); + + if (!hash_rehash (table, candidate)) + { + /* Failure to allocate memory in an attempt to + shrink the table is not fatal. But since memory + is low, we can at least be kind and free any + spare entries, rather than keeping them tied up + in the free entry list. */ +#if ! USE_OBSTACK + struct hash_entry *cursor = table->free_entry_list; + struct hash_entry *next; + while (cursor) + { + next = cursor->next; + free (cursor); + cursor = next; + } + table->free_entry_list = NULL; +#endif + } + } + } + } + + return data; +} + +/* Testing. */ + +#if TESTING + +void +hash_print (const Hash_table *table) +{ + struct hash_entry *bucket = (struct hash_entry *) table->bucket; + + for ( ; bucket < table->bucket_limit; bucket++) + { + struct hash_entry *cursor; + + if (bucket) + printf ("%lu:\n", (unsigned long int) (bucket - table->bucket)); + + for (cursor = bucket; cursor; cursor = cursor->next) + { + char const *s = cursor->data; + /* FIXME */ + if (s) + printf (" %s\n", s); + } + } +} + +#endif /* TESTING */ diff --git a/local/recipes/tools/diffutils/source/lib/hash.h b/local/recipes/tools/diffutils/source/lib/hash.h new file mode 100644 index 0000000000..cc5e2b4416 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/hash.h @@ -0,0 +1,103 @@ +/* hash - hashing table processing. + Copyright (C) 1998-1999, 2001, 2003, 2009-2017 Free Software Foundation, + Inc. + Written by Jim Meyering <meyering@ascend.com>, 1998. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* A generic hash table package. */ + +/* Make sure USE_OBSTACK is defined to 1 if you want the allocator to use + obstacks instead of malloc, and recompile 'hash.c' with same setting. */ + +#ifndef HASH_H_ +# define HASH_H_ + +# include <stdio.h> +# include <stdbool.h> + +/* The __attribute__ feature is available in gcc versions 2.5 and later. + The warn_unused_result attribute appeared first in gcc-3.4.0. */ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# define _GL_ATTRIBUTE_WUR __attribute__ ((__warn_unused_result__)) +# else +# define _GL_ATTRIBUTE_WUR /* empty */ +# endif + +# ifndef _GL_ATTRIBUTE_DEPRECATED +/* The __attribute__((__deprecated__)) feature + is available in gcc versions 3.1 and newer. */ +# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 1) +# define _GL_ATTRIBUTE_DEPRECATED /* empty */ +# else +# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__)) +# endif +# endif + +typedef size_t (*Hash_hasher) (const void *, size_t); +typedef bool (*Hash_comparator) (const void *, const void *); +typedef void (*Hash_data_freer) (void *); +typedef bool (*Hash_processor) (void *, void *); + +struct hash_tuning + { + /* This structure is mainly used for 'hash_initialize', see the block + documentation of 'hash_reset_tuning' for more complete comments. */ + + float shrink_threshold; /* ratio of used buckets to trigger a shrink */ + float shrink_factor; /* ratio of new smaller size to original size */ + float growth_threshold; /* ratio of used buckets to trigger a growth */ + float growth_factor; /* ratio of new bigger size to original size */ + bool is_n_buckets; /* if CANDIDATE really means table size */ + }; + +typedef struct hash_tuning Hash_tuning; + +struct hash_table; + +typedef struct hash_table Hash_table; + +/* Information and lookup. */ +size_t hash_get_n_buckets (const Hash_table *) _GL_ATTRIBUTE_PURE; +size_t hash_get_n_buckets_used (const Hash_table *) _GL_ATTRIBUTE_PURE; +size_t hash_get_n_entries (const Hash_table *) _GL_ATTRIBUTE_PURE; +size_t hash_get_max_bucket_length (const Hash_table *) _GL_ATTRIBUTE_PURE; +bool hash_table_ok (const Hash_table *) _GL_ATTRIBUTE_PURE; +void hash_print_statistics (const Hash_table *, FILE *); +void *hash_lookup (const Hash_table *, const void *); + +/* Walking. */ +void *hash_get_first (const Hash_table *) _GL_ATTRIBUTE_PURE; +void *hash_get_next (const Hash_table *, const void *); +size_t hash_get_entries (const Hash_table *, void **, size_t); +size_t hash_do_for_each (const Hash_table *, Hash_processor, void *); + +/* Allocation and clean-up. */ +size_t hash_string (const char *, size_t) _GL_ATTRIBUTE_PURE; +void hash_reset_tuning (Hash_tuning *); +Hash_table *hash_initialize (size_t, const Hash_tuning *, + Hash_hasher, Hash_comparator, + Hash_data_freer) _GL_ATTRIBUTE_WUR; +void hash_clear (Hash_table *); +void hash_free (Hash_table *); + +/* Insertion and deletion. */ +bool hash_rehash (Hash_table *, size_t) _GL_ATTRIBUTE_WUR; +void *hash_insert (Hash_table *, const void *) _GL_ATTRIBUTE_WUR; + +int hash_insert_if_absent (Hash_table *table, const void *entry, + const void **matched_ent); +void *hash_delete (Hash_table *, const void *); + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/iconv.c b/local/recipes/tools/diffutils/source/lib/iconv.c new file mode 100644 index 0000000000..89951cb2d6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/iconv.c @@ -0,0 +1,449 @@ +/* Character set conversion. + Copyright (C) 1999-2001, 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <iconv.h> + +#include <stddef.h> + +#if REPLACE_ICONV_UTF +# include <errno.h> +# include <stdint.h> +# include <stdlib.h> +# include "unistr.h" +# ifndef uintptr_t +# define uintptr_t unsigned long +# endif +#endif + +#if REPLACE_ICONV_UTF + +/* UTF-{16,32}{BE,LE} converters taken from GNU libiconv 1.11. */ + +/* Return code if invalid. (xxx_mbtowc) */ +# define RET_ILSEQ -1 +/* Return code if no bytes were read. (xxx_mbtowc) */ +# define RET_TOOFEW -2 + +/* Return code if invalid. (xxx_wctomb) */ +# define RET_ILUNI -1 +/* Return code if output buffer is too small. (xxx_wctomb, xxx_reset) */ +# define RET_TOOSMALL -2 + +/* + * UTF-16BE + */ + +/* Specification: RFC 2781 */ + +static int +utf16be_mbtowc (ucs4_t *pwc, const unsigned char *s, size_t n) +{ + if (n >= 2) + { + ucs4_t wc = (s[0] << 8) + s[1]; + if (wc >= 0xd800 && wc < 0xdc00) + { + if (n >= 4) + { + ucs4_t wc2 = (s[2] << 8) + s[3]; + if (!(wc2 >= 0xdc00 && wc2 < 0xe000)) + return RET_ILSEQ; + *pwc = 0x10000 + ((wc - 0xd800) << 10) + (wc2 - 0xdc00); + return 4; + } + } + else if (wc >= 0xdc00 && wc < 0xe000) + { + return RET_ILSEQ; + } + else + { + *pwc = wc; + return 2; + } + } + return RET_TOOFEW; +} + +static int +utf16be_wctomb (unsigned char *r, ucs4_t wc, size_t n) +{ + if (!(wc >= 0xd800 && wc < 0xe000)) + { + if (wc < 0x10000) + { + if (n >= 2) + { + r[0] = (unsigned char) (wc >> 8); + r[1] = (unsigned char) wc; + return 2; + } + else + return RET_TOOSMALL; + } + else if (wc < 0x110000) + { + if (n >= 4) + { + ucs4_t wc1 = 0xd800 + ((wc - 0x10000) >> 10); + ucs4_t wc2 = 0xdc00 + ((wc - 0x10000) & 0x3ff); + r[0] = (unsigned char) (wc1 >> 8); + r[1] = (unsigned char) wc1; + r[2] = (unsigned char) (wc2 >> 8); + r[3] = (unsigned char) wc2; + return 4; + } + else + return RET_TOOSMALL; + } + } + return RET_ILUNI; +} + +/* + * UTF-16LE + */ + +/* Specification: RFC 2781 */ + +static int +utf16le_mbtowc (ucs4_t *pwc, const unsigned char *s, size_t n) +{ + if (n >= 2) + { + ucs4_t wc = s[0] + (s[1] << 8); + if (wc >= 0xd800 && wc < 0xdc00) + { + if (n >= 4) + { + ucs4_t wc2 = s[2] + (s[3] << 8); + if (!(wc2 >= 0xdc00 && wc2 < 0xe000)) + return RET_ILSEQ; + *pwc = 0x10000 + ((wc - 0xd800) << 10) + (wc2 - 0xdc00); + return 4; + } + } + else if (wc >= 0xdc00 && wc < 0xe000) + { + return RET_ILSEQ; + } + else + { + *pwc = wc; + return 2; + } + } + return RET_TOOFEW; +} + +static int +utf16le_wctomb (unsigned char *r, ucs4_t wc, size_t n) +{ + if (!(wc >= 0xd800 && wc < 0xe000)) + { + if (wc < 0x10000) + { + if (n >= 2) + { + r[0] = (unsigned char) wc; + r[1] = (unsigned char) (wc >> 8); + return 2; + } + else + return RET_TOOSMALL; + } + else if (wc < 0x110000) + { + if (n >= 4) + { + ucs4_t wc1 = 0xd800 + ((wc - 0x10000) >> 10); + ucs4_t wc2 = 0xdc00 + ((wc - 0x10000) & 0x3ff); + r[0] = (unsigned char) wc1; + r[1] = (unsigned char) (wc1 >> 8); + r[2] = (unsigned char) wc2; + r[3] = (unsigned char) (wc2 >> 8); + return 4; + } + else + return RET_TOOSMALL; + } + } + return RET_ILUNI; +} + +/* + * UTF-32BE + */ + +/* Specification: Unicode 3.1 Standard Annex #19 */ + +static int +utf32be_mbtowc (ucs4_t *pwc, const unsigned char *s, size_t n) +{ + if (n >= 4) + { + ucs4_t wc = (s[0] << 24) + (s[1] << 16) + (s[2] << 8) + s[3]; + if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000)) + { + *pwc = wc; + return 4; + } + else + return RET_ILSEQ; + } + return RET_TOOFEW; +} + +static int +utf32be_wctomb (unsigned char *r, ucs4_t wc, size_t n) +{ + if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000)) + { + if (n >= 4) + { + r[0] = 0; + r[1] = (unsigned char) (wc >> 16); + r[2] = (unsigned char) (wc >> 8); + r[3] = (unsigned char) wc; + return 4; + } + else + return RET_TOOSMALL; + } + return RET_ILUNI; +} + +/* + * UTF-32LE + */ + +/* Specification: Unicode 3.1 Standard Annex #19 */ + +static int +utf32le_mbtowc (ucs4_t *pwc, const unsigned char *s, size_t n) +{ + if (n >= 4) + { + ucs4_t wc = s[0] + (s[1] << 8) + (s[2] << 16) + (s[3] << 24); + if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000)) + { + *pwc = wc; + return 4; + } + else + return RET_ILSEQ; + } + return RET_TOOFEW; +} + +static int +utf32le_wctomb (unsigned char *r, ucs4_t wc, size_t n) +{ + if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000)) + { + if (n >= 4) + { + r[0] = (unsigned char) wc; + r[1] = (unsigned char) (wc >> 8); + r[2] = (unsigned char) (wc >> 16); + r[3] = 0; + return 4; + } + else + return RET_TOOSMALL; + } + return RET_ILUNI; +} + +#endif + +size_t +rpl_iconv (iconv_t cd, + ICONV_CONST char **inbuf, size_t *inbytesleft, + char **outbuf, size_t *outbytesleft) +#undef iconv +{ +#if REPLACE_ICONV_UTF + switch ((uintptr_t) cd) + { + { + int (*xxx_wctomb) (unsigned char *, ucs4_t, size_t); + + case (uintptr_t) _ICONV_UTF8_UTF16BE: + xxx_wctomb = utf16be_wctomb; + goto loop_from_utf8; + case (uintptr_t) _ICONV_UTF8_UTF16LE: + xxx_wctomb = utf16le_wctomb; + goto loop_from_utf8; + case (uintptr_t) _ICONV_UTF8_UTF32BE: + xxx_wctomb = utf32be_wctomb; + goto loop_from_utf8; + case (uintptr_t) _ICONV_UTF8_UTF32LE: + xxx_wctomb = utf32le_wctomb; + goto loop_from_utf8; + + loop_from_utf8: + if (inbuf == NULL || *inbuf == NULL) + return 0; + { + ICONV_CONST char *inptr = *inbuf; + size_t inleft = *inbytesleft; + char *outptr = *outbuf; + size_t outleft = *outbytesleft; + size_t res = 0; + while (inleft > 0) + { + ucs4_t uc; + int m = u8_mbtoucr (&uc, (const uint8_t *) inptr, inleft); + if (m <= 0) + { + if (m == -1) + { + errno = EILSEQ; + res = (size_t)(-1); + break; + } + if (m == -2) + { + errno = EINVAL; + res = (size_t)(-1); + break; + } + abort (); + } + else + { + int n = xxx_wctomb ((uint8_t *) outptr, uc, outleft); + if (n < 0) + { + if (n == RET_ILUNI) + { + errno = EILSEQ; + res = (size_t)(-1); + break; + } + if (n == RET_TOOSMALL) + { + errno = E2BIG; + res = (size_t)(-1); + break; + } + abort (); + } + else + { + inptr += m; + inleft -= m; + outptr += n; + outleft -= n; + } + } + } + *inbuf = inptr; + *inbytesleft = inleft; + *outbuf = outptr; + *outbytesleft = outleft; + return res; + } + } + + { + int (*xxx_mbtowc) (ucs4_t *, const unsigned char *, size_t); + + case (uintptr_t) _ICONV_UTF16BE_UTF8: + xxx_mbtowc = utf16be_mbtowc; + goto loop_to_utf8; + case (uintptr_t) _ICONV_UTF16LE_UTF8: + xxx_mbtowc = utf16le_mbtowc; + goto loop_to_utf8; + case (uintptr_t) _ICONV_UTF32BE_UTF8: + xxx_mbtowc = utf32be_mbtowc; + goto loop_to_utf8; + case (uintptr_t) _ICONV_UTF32LE_UTF8: + xxx_mbtowc = utf32le_mbtowc; + goto loop_to_utf8; + + loop_to_utf8: + if (inbuf == NULL || *inbuf == NULL) + return 0; + { + ICONV_CONST char *inptr = *inbuf; + size_t inleft = *inbytesleft; + char *outptr = *outbuf; + size_t outleft = *outbytesleft; + size_t res = 0; + while (inleft > 0) + { + ucs4_t uc; + int m = xxx_mbtowc (&uc, (const uint8_t *) inptr, inleft); + if (m <= 0) + { + if (m == RET_ILSEQ) + { + errno = EILSEQ; + res = (size_t)(-1); + break; + } + if (m == RET_TOOFEW) + { + errno = EINVAL; + res = (size_t)(-1); + break; + } + abort (); + } + else + { + int n = u8_uctomb ((uint8_t *) outptr, uc, outleft); + if (n < 0) + { + if (n == -1) + { + errno = EILSEQ; + res = (size_t)(-1); + break; + } + if (n == -2) + { + errno = E2BIG; + res = (size_t)(-1); + break; + } + abort (); + } + else + { + inptr += m; + inleft -= m; + outptr += n; + outleft -= n; + } + } + } + *inbuf = inptr; + *inbytesleft = inleft; + *outbuf = outptr; + *outbytesleft = outleft; + return res; + } + } + } +#endif + return iconv (cd, inbuf, inbytesleft, outbuf, outbytesleft); +} diff --git a/local/recipes/tools/diffutils/source/lib/iconv.in.h b/local/recipes/tools/diffutils/source/lib/iconv.in.h new file mode 100644 index 0000000000..ddaae67e45 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/iconv.in.h @@ -0,0 +1,110 @@ +/* A GNU-like <iconv.h>. + + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _@GUARD_PREFIX@_ICONV_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_ICONV_H@ + +#ifndef _@GUARD_PREFIX@_ICONV_H +#define _@GUARD_PREFIX@_ICONV_H + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + + +#if @GNULIB_ICONV@ +# if @REPLACE_ICONV_OPEN@ +/* An iconv_open wrapper that supports the IANA standardized encoding names + ("ISO-8859-1" etc.) as far as possible. */ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define iconv_open rpl_iconv_open +# endif +_GL_FUNCDECL_RPL (iconv_open, iconv_t, + (const char *tocode, const char *fromcode) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (iconv_open, iconv_t, + (const char *tocode, const char *fromcode)); +# else +_GL_CXXALIAS_SYS (iconv_open, iconv_t, + (const char *tocode, const char *fromcode)); +# endif +_GL_CXXALIASWARN (iconv_open); +#endif + +#if @REPLACE_ICONV_UTF@ +/* Special constants for supporting UTF-{16,32}{BE,LE} encodings. + Not public. */ +# define _ICONV_UTF8_UTF16BE (iconv_t)(-161) +# define _ICONV_UTF8_UTF16LE (iconv_t)(-162) +# define _ICONV_UTF8_UTF32BE (iconv_t)(-163) +# define _ICONV_UTF8_UTF32LE (iconv_t)(-164) +# define _ICONV_UTF16BE_UTF8 (iconv_t)(-165) +# define _ICONV_UTF16LE_UTF8 (iconv_t)(-166) +# define _ICONV_UTF32BE_UTF8 (iconv_t)(-167) +# define _ICONV_UTF32LE_UTF8 (iconv_t)(-168) +#endif + +#if @GNULIB_ICONV@ +# if @REPLACE_ICONV@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define iconv rpl_iconv +# endif +_GL_FUNCDECL_RPL (iconv, size_t, + (iconv_t cd, + @ICONV_CONST@ char **inbuf, size_t *inbytesleft, + char **outbuf, size_t *outbytesleft)); +_GL_CXXALIAS_RPL (iconv, size_t, + (iconv_t cd, + @ICONV_CONST@ char **inbuf, size_t *inbytesleft, + char **outbuf, size_t *outbytesleft)); +# else +_GL_CXXALIAS_SYS (iconv, size_t, + (iconv_t cd, + @ICONV_CONST@ char **inbuf, size_t *inbytesleft, + char **outbuf, size_t *outbytesleft)); +# endif +_GL_CXXALIASWARN (iconv); +# ifndef ICONV_CONST +# define ICONV_CONST @ICONV_CONST@ +# endif +#endif + +#if @GNULIB_ICONV@ +# if @REPLACE_ICONV@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define iconv_close rpl_iconv_close +# endif +_GL_FUNCDECL_RPL (iconv_close, int, (iconv_t cd)); +_GL_CXXALIAS_RPL (iconv_close, int, (iconv_t cd)); +# else +_GL_CXXALIAS_SYS (iconv_close, int, (iconv_t cd)); +# endif +_GL_CXXALIASWARN (iconv_close); +#endif + + +#endif /* _@GUARD_PREFIX@_ICONV_H */ +#endif /* _@GUARD_PREFIX@_ICONV_H */ diff --git a/local/recipes/tools/diffutils/source/lib/iconv_close.c b/local/recipes/tools/diffutils/source/lib/iconv_close.c new file mode 100644 index 0000000000..ddadf6a6a8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/iconv_close.c @@ -0,0 +1,46 @@ +/* Character set conversion. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <iconv.h> + +#include <stdint.h> +#ifndef uintptr_t +# define uintptr_t unsigned long +#endif + +int +rpl_iconv_close (iconv_t cd) +#undef iconv_close +{ +#if REPLACE_ICONV_UTF + switch ((uintptr_t) cd) + { + case (uintptr_t) _ICONV_UTF8_UTF16BE: + case (uintptr_t) _ICONV_UTF8_UTF16LE: + case (uintptr_t) _ICONV_UTF8_UTF32BE: + case (uintptr_t) _ICONV_UTF8_UTF32LE: + case (uintptr_t) _ICONV_UTF16BE_UTF8: + case (uintptr_t) _ICONV_UTF16LE_UTF8: + case (uintptr_t) _ICONV_UTF32BE_UTF8: + case (uintptr_t) _ICONV_UTF32LE_UTF8: + return 0; + } +#endif + return iconv_close (cd); +} diff --git a/local/recipes/tools/diffutils/source/lib/iconv_open-aix.gperf b/local/recipes/tools/diffutils/source/lib/iconv_open-aix.gperf new file mode 100644 index 0000000000..6782b9956c --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/iconv_open-aix.gperf @@ -0,0 +1,44 @@ +struct mapping { int standard_name; const char vendor_name[10 + 1]; }; +%struct-type +%language=ANSI-C +%define slot-name standard_name +%define hash-function-name mapping_hash +%define lookup-function-name mapping_lookup +%readonly-tables +%global-table +%define word-array-name mappings +%pic +%% +# On AIX 5.1, look in /usr/lib/nls/loc/uconvTable. +ISO-8859-1, "ISO8859-1" +ISO-8859-2, "ISO8859-2" +ISO-8859-3, "ISO8859-3" +ISO-8859-4, "ISO8859-4" +ISO-8859-5, "ISO8859-5" +ISO-8859-6, "ISO8859-6" +ISO-8859-7, "ISO8859-7" +ISO-8859-8, "ISO8859-8" +ISO-8859-9, "ISO8859-9" +ISO-8859-15, "ISO8859-15" +CP437, "IBM-437" +CP850, "IBM-850" +CP852, "IBM-852" +CP856, "IBM-856" +CP857, "IBM-857" +CP861, "IBM-861" +CP865, "IBM-865" +CP869, "IBM-869" +ISO-8859-13, "IBM-921" +CP922, "IBM-922" +CP932, "IBM-932" +CP943, "IBM-943" +CP1046, "IBM-1046" +CP1124, "IBM-1124" +CP1125, "IBM-1125" +CP1129, "IBM-1129" +CP1252, "IBM-1252" +GB2312, "IBM-eucCN" +EUC-JP, "IBM-eucJP" +EUC-KR, "IBM-eucKR" +EUC-TW, "IBM-eucTW" +BIG5, "big5" diff --git a/local/recipes/tools/diffutils/source/lib/iconv_open-aix.h b/local/recipes/tools/diffutils/source/lib/iconv_open-aix.h new file mode 100644 index 0000000000..129e03084b --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/iconv_open-aix.h @@ -0,0 +1,256 @@ +/* ANSI-C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -m 10 ./iconv_open-aix.gperf */ +/* Computed positions: -k'4,$' */ + +#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>." +#endif + +#line 1 "./iconv_open-aix.gperf" +struct mapping { int standard_name; const char vendor_name[10 + 1]; }; + +#define TOTAL_KEYWORDS 32 +#define MIN_WORD_LENGTH 4 +#define MAX_WORD_LENGTH 11 +#define MIN_HASH_VALUE 6 +#define MAX_HASH_VALUE 44 +/* maximum key range = 39, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static unsigned int +mapping_hash (register const char *str, register unsigned int len) +{ + static const unsigned char asso_values[] = + { + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 0, 4, 25, + 0, 11, 24, 9, 17, 3, 14, 21, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 3, 45, 1, 45, 45, 45, 45, 0, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45 + }; + return len + asso_values[(unsigned char)str[3]+2] + asso_values[(unsigned char)str[len - 1]]; +} + +struct stringpool_t + { + char stringpool_str6[sizeof("EUC-TW")]; + char stringpool_str7[sizeof("EUC-KR")]; + char stringpool_str8[sizeof("CP852")]; + char stringpool_str9[sizeof("EUC-JP")]; + char stringpool_str10[sizeof("ISO-8859-2")]; + char stringpool_str11[sizeof("CP857")]; + char stringpool_str12[sizeof("CP850")]; + char stringpool_str13[sizeof("ISO-8859-7")]; + char stringpool_str14[sizeof("CP932")]; + char stringpool_str15[sizeof("GB2312")]; + char stringpool_str16[sizeof("BIG5")]; + char stringpool_str17[sizeof("CP437")]; + char stringpool_str19[sizeof("ISO-8859-5")]; + char stringpool_str20[sizeof("ISO-8859-15")]; + char stringpool_str21[sizeof("ISO-8859-3")]; + char stringpool_str22[sizeof("ISO-8859-13")]; + char stringpool_str23[sizeof("CP1046")]; + char stringpool_str24[sizeof("ISO-8859-8")]; + char stringpool_str25[sizeof("CP856")]; + char stringpool_str26[sizeof("CP1125")]; + char stringpool_str27[sizeof("ISO-8859-6")]; + char stringpool_str28[sizeof("CP865")]; + char stringpool_str29[sizeof("CP922")]; + char stringpool_str30[sizeof("CP1252")]; + char stringpool_str31[sizeof("ISO-8859-9")]; + char stringpool_str33[sizeof("CP943")]; + char stringpool_str34[sizeof("ISO-8859-4")]; + char stringpool_str35[sizeof("ISO-8859-1")]; + char stringpool_str38[sizeof("CP1129")]; + char stringpool_str40[sizeof("CP869")]; + char stringpool_str41[sizeof("CP1124")]; + char stringpool_str44[sizeof("CP861")]; + }; +static const struct stringpool_t stringpool_contents = + { + "EUC-TW", + "EUC-KR", + "CP852", + "EUC-JP", + "ISO-8859-2", + "CP857", + "CP850", + "ISO-8859-7", + "CP932", + "GB2312", + "BIG5", + "CP437", + "ISO-8859-5", + "ISO-8859-15", + "ISO-8859-3", + "ISO-8859-13", + "CP1046", + "ISO-8859-8", + "CP856", + "CP1125", + "ISO-8859-6", + "CP865", + "CP922", + "CP1252", + "ISO-8859-9", + "CP943", + "ISO-8859-4", + "ISO-8859-1", + "CP1129", + "CP869", + "CP1124", + "CP861" + }; +#define stringpool ((const char *) &stringpool_contents) + +static const struct mapping mappings[] = + { + {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +#line 43 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "IBM-eucTW"}, +#line 42 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "IBM-eucKR"}, +#line 25 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "IBM-852"}, +#line 41 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "IBM-eucJP"}, +#line 14 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-2"}, +#line 27 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "IBM-857"}, +#line 24 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "IBM-850"}, +#line 19 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-7"}, +#line 33 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "IBM-932"}, +#line 40 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "IBM-eucCN"}, +#line 44 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "big5"}, +#line 23 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "IBM-437"}, + {-1}, +#line 17 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-5"}, +#line 22 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "ISO8859-15"}, +#line 15 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "ISO8859-3"}, +#line 31 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "IBM-921"}, +#line 35 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "IBM-1046"}, +#line 20 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str24, "ISO8859-8"}, +#line 26 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str25, "IBM-856"}, +#line 37 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str26, "IBM-1125"}, +#line 18 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str27, "ISO8859-6"}, +#line 29 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str28, "IBM-865"}, +#line 32 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str29, "IBM-922"}, +#line 39 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str30, "IBM-1252"}, +#line 21 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str31, "ISO8859-9"}, + {-1}, +#line 34 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str33, "IBM-943"}, +#line 16 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str34, "ISO8859-4"}, +#line 13 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str35, "ISO8859-1"}, + {-1}, {-1}, +#line 38 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str38, "IBM-1129"}, + {-1}, +#line 30 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str40, "IBM-869"}, +#line 36 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str41, "IBM-1124"}, + {-1}, {-1}, +#line 28 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str44, "IBM-861"} + }; + +#ifdef __GNUC__ +__inline +#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif +#endif +const struct mapping * +mapping_lookup (register const char *str, register unsigned int len) +{ + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = mapping_hash (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register int o = mappings[key].standard_name; + if (o >= 0) + { + register const char *s = o + stringpool; + + if (*str == *s && !strcmp (str + 1, s + 1)) + return &mappings[key]; + } + } + } + return 0; +} diff --git a/local/recipes/tools/diffutils/source/lib/iconv_open-hpux.gperf b/local/recipes/tools/diffutils/source/lib/iconv_open-hpux.gperf new file mode 100644 index 0000000000..5a35c83e1e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/iconv_open-hpux.gperf @@ -0,0 +1,56 @@ +struct mapping { int standard_name; const char vendor_name[9 + 1]; }; +%struct-type +%language=ANSI-C +%define slot-name standard_name +%define hash-function-name mapping_hash +%define lookup-function-name mapping_lookup +%readonly-tables +%global-table +%define word-array-name mappings +%pic +%% +# On HP-UX 11.11, look in /usr/lib/nls/iconv. +ISO-8859-1, "iso88591" +ISO-8859-2, "iso88592" +ISO-8859-5, "iso88595" +ISO-8859-6, "iso88596" +ISO-8859-7, "iso88597" +ISO-8859-8, "iso88598" +ISO-8859-9, "iso88599" +ISO-8859-15, "iso885915" +CP437, "cp437" +CP775, "cp775" +CP850, "cp850" +CP852, "cp852" +CP855, "cp855" +CP857, "cp857" +CP861, "cp861" +CP862, "cp862" +CP864, "cp864" +CP865, "cp865" +CP866, "cp866" +CP869, "cp869" +CP874, "cp874" +CP1250, "cp1250" +CP1251, "cp1251" +CP1252, "cp1252" +CP1253, "cp1253" +CP1254, "cp1254" +CP1255, "cp1255" +CP1256, "cp1256" +CP1257, "cp1257" +CP1258, "cp1258" +HP-ROMAN8, "roman8" +HP-ARABIC8, "arabic8" +HP-GREEK8, "greek8" +HP-HEBREW8, "hebrew8" +HP-TURKISH8, "turkish8" +HP-KANA8, "kana8" +TIS-620, "tis620" +GB2312, "hp15CN" +EUC-JP, "eucJP" +EUC-KR, "eucKR" +EUC-TW, "eucTW" +BIG5, "big5" +SHIFT_JIS, "sjis" +UTF-8, "utf8" diff --git a/local/recipes/tools/diffutils/source/lib/iconv_open-hpux.h b/local/recipes/tools/diffutils/source/lib/iconv_open-hpux.h new file mode 100644 index 0000000000..3bcff76a79 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/iconv_open-hpux.h @@ -0,0 +1,299 @@ +/* ANSI-C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -m 10 ./iconv_open-hpux.gperf */ +/* Computed positions: -k'4,$' */ + +#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>." +#endif + +#line 1 "./iconv_open-hpux.gperf" +struct mapping { int standard_name; const char vendor_name[9 + 1]; }; + +#define TOTAL_KEYWORDS 44 +#define MIN_WORD_LENGTH 4 +#define MAX_WORD_LENGTH 11 +#define MIN_HASH_VALUE 6 +#define MAX_HASH_VALUE 49 +/* maximum key range = 44, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static unsigned int +mapping_hash (register const char *str, register unsigned int len) +{ + static const unsigned char asso_values[] = + { + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 1, 2, + 24, 43, 5, 10, 0, 13, 32, 3, 19, 18, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 5, + 50, 50, 50, 50, 14, 5, 0, 50, 50, 0, + 27, 50, 12, 14, 50, 50, 0, 5, 2, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50 + }; + return len + asso_values[(unsigned char)str[3]+4] + asso_values[(unsigned char)str[len - 1]]; +} + +struct stringpool_t + { + char stringpool_str6[sizeof("CP1256")]; + char stringpool_str7[sizeof("CP1250")]; + char stringpool_str8[sizeof("CP1251")]; + char stringpool_str9[sizeof("CP850")]; + char stringpool_str10[sizeof("TIS-620")]; + char stringpool_str11[sizeof("CP1254")]; + char stringpool_str12[sizeof("ISO-8859-6")]; + char stringpool_str13[sizeof("EUC-TW")]; + char stringpool_str14[sizeof("ISO-8859-1")]; + char stringpool_str15[sizeof("ISO-8859-9")]; + char stringpool_str16[sizeof("CP1255")]; + char stringpool_str17[sizeof("BIG5")]; + char stringpool_str18[sizeof("CP855")]; + char stringpool_str19[sizeof("CP1257")]; + char stringpool_str20[sizeof("EUC-KR")]; + char stringpool_str21[sizeof("CP857")]; + char stringpool_str22[sizeof("ISO-8859-5")]; + char stringpool_str23[sizeof("ISO-8859-15")]; + char stringpool_str24[sizeof("CP866")]; + char stringpool_str25[sizeof("ISO-8859-7")]; + char stringpool_str26[sizeof("CP861")]; + char stringpool_str27[sizeof("CP869")]; + char stringpool_str28[sizeof("CP874")]; + char stringpool_str29[sizeof("CP864")]; + char stringpool_str30[sizeof("CP1252")]; + char stringpool_str31[sizeof("CP437")]; + char stringpool_str32[sizeof("CP852")]; + char stringpool_str33[sizeof("CP775")]; + char stringpool_str34[sizeof("CP865")]; + char stringpool_str35[sizeof("EUC-JP")]; + char stringpool_str36[sizeof("ISO-8859-2")]; + char stringpool_str37[sizeof("SHIFT_JIS")]; + char stringpool_str38[sizeof("CP1258")]; + char stringpool_str39[sizeof("UTF-8")]; + char stringpool_str40[sizeof("HP-KANA8")]; + char stringpool_str41[sizeof("HP-ROMAN8")]; + char stringpool_str42[sizeof("HP-HEBREW8")]; + char stringpool_str43[sizeof("GB2312")]; + char stringpool_str44[sizeof("ISO-8859-8")]; + char stringpool_str45[sizeof("HP-TURKISH8")]; + char stringpool_str46[sizeof("HP-GREEK8")]; + char stringpool_str47[sizeof("HP-ARABIC8")]; + char stringpool_str48[sizeof("CP862")]; + char stringpool_str49[sizeof("CP1253")]; + }; +static const struct stringpool_t stringpool_contents = + { + "CP1256", + "CP1250", + "CP1251", + "CP850", + "TIS-620", + "CP1254", + "ISO-8859-6", + "EUC-TW", + "ISO-8859-1", + "ISO-8859-9", + "CP1255", + "BIG5", + "CP855", + "CP1257", + "EUC-KR", + "CP857", + "ISO-8859-5", + "ISO-8859-15", + "CP866", + "ISO-8859-7", + "CP861", + "CP869", + "CP874", + "CP864", + "CP1252", + "CP437", + "CP852", + "CP775", + "CP865", + "EUC-JP", + "ISO-8859-2", + "SHIFT_JIS", + "CP1258", + "UTF-8", + "HP-KANA8", + "HP-ROMAN8", + "HP-HEBREW8", + "GB2312", + "ISO-8859-8", + "HP-TURKISH8", + "HP-GREEK8", + "HP-ARABIC8", + "CP862", + "CP1253" + }; +#define stringpool ((const char *) &stringpool_contents) + +static const struct mapping mappings[] = + { + {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +#line 40 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "cp1256"}, +#line 34 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "cp1250"}, +#line 35 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "cp1251"}, +#line 23 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "cp850"}, +#line 49 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "tis620"}, +#line 38 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "cp1254"}, +#line 16 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "iso88596"}, +#line 53 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "eucTW"}, +#line 13 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "iso88591"}, +#line 19 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "iso88599"}, +#line 39 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "cp1255"}, +#line 54 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "big5"}, +#line 25 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "cp855"}, +#line 41 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "cp1257"}, +#line 52 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "eucKR"}, +#line 26 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "cp857"}, +#line 15 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "iso88595"}, +#line 20 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "iso885915"}, +#line 31 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str24, "cp866"}, +#line 17 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str25, "iso88597"}, +#line 27 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str26, "cp861"}, +#line 32 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str27, "cp869"}, +#line 33 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str28, "cp874"}, +#line 29 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str29, "cp864"}, +#line 36 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str30, "cp1252"}, +#line 21 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str31, "cp437"}, +#line 24 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str32, "cp852"}, +#line 22 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str33, "cp775"}, +#line 30 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str34, "cp865"}, +#line 51 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str35, "eucJP"}, +#line 14 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str36, "iso88592"}, +#line 55 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str37, "sjis"}, +#line 42 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str38, "cp1258"}, +#line 56 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str39, "utf8"}, +#line 48 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str40, "kana8"}, +#line 43 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str41, "roman8"}, +#line 46 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str42, "hebrew8"}, +#line 50 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str43, "hp15CN"}, +#line 18 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str44, "iso88598"}, +#line 47 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str45, "turkish8"}, +#line 45 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str46, "greek8"}, +#line 44 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str47, "arabic8"}, +#line 28 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str48, "cp862"}, +#line 37 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str49, "cp1253"} + }; + +#ifdef __GNUC__ +__inline +#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif +#endif +const struct mapping * +mapping_lookup (register const char *str, register unsigned int len) +{ + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = mapping_hash (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register int o = mappings[key].standard_name; + if (o >= 0) + { + register const char *s = o + stringpool; + + if (*str == *s && !strcmp (str + 1, s + 1)) + return &mappings[key]; + } + } + } + return 0; +} diff --git a/local/recipes/tools/diffutils/source/lib/iconv_open-irix.gperf b/local/recipes/tools/diffutils/source/lib/iconv_open-irix.gperf new file mode 100644 index 0000000000..3672a80137 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/iconv_open-irix.gperf @@ -0,0 +1,31 @@ +struct mapping { int standard_name; const char vendor_name[10 + 1]; }; +%struct-type +%language=ANSI-C +%define slot-name standard_name +%define hash-function-name mapping_hash +%define lookup-function-name mapping_lookup +%readonly-tables +%global-table +%define word-array-name mappings +%pic +%% +# On IRIX 6.5, look in /usr/lib/iconv and /usr/lib/international/encodings. +ISO-8859-1, "ISO8859-1" +ISO-8859-2, "ISO8859-2" +ISO-8859-3, "ISO8859-3" +ISO-8859-4, "ISO8859-4" +ISO-8859-5, "ISO8859-5" +ISO-8859-6, "ISO8859-6" +ISO-8859-7, "ISO8859-7" +ISO-8859-8, "ISO8859-8" +ISO-8859-9, "ISO8859-9" +ISO-8859-15, "ISO8859-15" +KOI8-R, "KOI8" +CP855, "DOS855" +CP1251, "WIN1251" +GB2312, "eucCN" +EUC-JP, "eucJP" +EUC-KR, "eucKR" +EUC-TW, "eucTW" +SHIFT_JIS, "sjis" +TIS-620, "TIS620" diff --git a/local/recipes/tools/diffutils/source/lib/iconv_open-irix.h b/local/recipes/tools/diffutils/source/lib/iconv_open-irix.h new file mode 100644 index 0000000000..74ceb8f57a --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/iconv_open-irix.h @@ -0,0 +1,199 @@ +/* ANSI-C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -m 10 ./iconv_open-irix.gperf */ +/* Computed positions: -k'1,$' */ + +#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>." +#endif + +#line 1 "./iconv_open-irix.gperf" +struct mapping { int standard_name; const char vendor_name[10 + 1]; }; + +#define TOTAL_KEYWORDS 19 +#define MIN_WORD_LENGTH 5 +#define MAX_WORD_LENGTH 11 +#define MIN_HASH_VALUE 5 +#define MAX_HASH_VALUE 23 +/* maximum key range = 19, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static unsigned int +mapping_hash (register const char *str, register unsigned int len) +{ + static const unsigned char asso_values[] = + { + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 8, 2, + 5, 12, 11, 0, 10, 9, 8, 7, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 0, 24, 0, + 24, 5, 24, 0, 24, 7, 24, 24, 24, 24, + 7, 24, 1, 0, 8, 24, 24, 0, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24 + }; + return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]]; +} + +struct stringpool_t + { + char stringpool_str5[sizeof("CP855")]; + char stringpool_str6[sizeof("EUC-TW")]; + char stringpool_str7[sizeof("EUC-KR")]; + char stringpool_str8[sizeof("CP1251")]; + char stringpool_str9[sizeof("SHIFT_JIS")]; + char stringpool_str10[sizeof("ISO-8859-5")]; + char stringpool_str11[sizeof("ISO-8859-15")]; + char stringpool_str12[sizeof("ISO-8859-1")]; + char stringpool_str13[sizeof("EUC-JP")]; + char stringpool_str14[sizeof("KOI8-R")]; + char stringpool_str15[sizeof("ISO-8859-2")]; + char stringpool_str16[sizeof("GB2312")]; + char stringpool_str17[sizeof("ISO-8859-9")]; + char stringpool_str18[sizeof("ISO-8859-8")]; + char stringpool_str19[sizeof("ISO-8859-7")]; + char stringpool_str20[sizeof("ISO-8859-6")]; + char stringpool_str21[sizeof("ISO-8859-4")]; + char stringpool_str22[sizeof("ISO-8859-3")]; + char stringpool_str23[sizeof("TIS-620")]; + }; +static const struct stringpool_t stringpool_contents = + { + "CP855", + "EUC-TW", + "EUC-KR", + "CP1251", + "SHIFT_JIS", + "ISO-8859-5", + "ISO-8859-15", + "ISO-8859-1", + "EUC-JP", + "KOI8-R", + "ISO-8859-2", + "GB2312", + "ISO-8859-9", + "ISO-8859-8", + "ISO-8859-7", + "ISO-8859-6", + "ISO-8859-4", + "ISO-8859-3", + "TIS-620" + }; +#define stringpool ((const char *) &stringpool_contents) + +static const struct mapping mappings[] = + { + {-1}, {-1}, {-1}, {-1}, {-1}, +#line 24 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str5, "DOS855"}, +#line 29 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "eucTW"}, +#line 28 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "eucKR"}, +#line 25 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "WIN1251"}, +#line 30 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "sjis"}, +#line 17 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-5"}, +#line 22 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "ISO8859-15"}, +#line 13 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-1"}, +#line 27 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "eucJP"}, +#line 23 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "KOI8"}, +#line 14 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "ISO8859-2"}, +#line 26 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "eucCN"}, +#line 21 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "ISO8859-9"}, +#line 20 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-8"}, +#line 19 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-7"}, +#line 18 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "ISO8859-6"}, +#line 16 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "ISO8859-4"}, +#line 15 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "ISO8859-3"}, +#line 31 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "TIS620"} + }; + +#ifdef __GNUC__ +__inline +#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif +#endif +const struct mapping * +mapping_lookup (register const char *str, register unsigned int len) +{ + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = mapping_hash (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register int o = mappings[key].standard_name; + if (o >= 0) + { + register const char *s = o + stringpool; + + if (*str == *s && !strcmp (str + 1, s + 1)) + return &mappings[key]; + } + } + } + return 0; +} diff --git a/local/recipes/tools/diffutils/source/lib/iconv_open-osf.gperf b/local/recipes/tools/diffutils/source/lib/iconv_open-osf.gperf new file mode 100644 index 0000000000..f468ff6093 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/iconv_open-osf.gperf @@ -0,0 +1,50 @@ +struct mapping { int standard_name; const char vendor_name[10 + 1]; }; +%struct-type +%language=ANSI-C +%define slot-name standard_name +%define hash-function-name mapping_hash +%define lookup-function-name mapping_lookup +%readonly-tables +%global-table +%define word-array-name mappings +%pic +%% +# On OSF/1 5.1, look in /usr/lib/nls/loc/iconv. +ISO-8859-1, "ISO8859-1" +ISO-8859-2, "ISO8859-2" +ISO-8859-3, "ISO8859-3" +ISO-8859-4, "ISO8859-4" +ISO-8859-5, "ISO8859-5" +ISO-8859-6, "ISO8859-6" +ISO-8859-7, "ISO8859-7" +ISO-8859-8, "ISO8859-8" +ISO-8859-9, "ISO8859-9" +ISO-8859-15, "ISO8859-15" +CP437, "cp437" +CP775, "cp775" +CP850, "cp850" +CP852, "cp852" +CP855, "cp855" +CP857, "cp857" +CP861, "cp861" +CP862, "cp862" +CP865, "cp865" +CP866, "cp866" +CP869, "cp869" +CP874, "cp874" +CP949, "KSC5601" +CP1250, "cp1250" +CP1251, "cp1251" +CP1252, "cp1252" +CP1253, "cp1253" +CP1254, "cp1254" +CP1255, "cp1255" +CP1256, "cp1256" +CP1257, "cp1257" +CP1258, "cp1258" +EUC-JP, "eucJP" +EUC-KR, "eucKR" +EUC-TW, "eucTW" +BIG5, "big5" +SHIFT_JIS, "SJIS" +TIS-620, "TACTIS" diff --git a/local/recipes/tools/diffutils/source/lib/iconv_open-osf.h b/local/recipes/tools/diffutils/source/lib/iconv_open-osf.h new file mode 100644 index 0000000000..4d35764952 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/iconv_open-osf.h @@ -0,0 +1,278 @@ +/* ANSI-C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -m 10 ./iconv_open-osf.gperf */ +/* Computed positions: -k'4,$' */ + +#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>." +#endif + +#line 1 "./iconv_open-osf.gperf" +struct mapping { int standard_name; const char vendor_name[10 + 1]; }; + +#define TOTAL_KEYWORDS 38 +#define MIN_WORD_LENGTH 4 +#define MAX_WORD_LENGTH 11 +#define MIN_HASH_VALUE 6 +#define MAX_HASH_VALUE 47 +/* maximum key range = 42, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static unsigned int +mapping_hash (register const char *str, register unsigned int len) +{ + static const unsigned char asso_values[] = + { + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 2, 29, + 24, 34, 31, 0, 15, 14, 10, 13, 2, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 7, 48, 48, 48, 48, 48, 48, + 11, 48, 2, 7, 48, 48, 48, 1, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48 + }; + return len + asso_values[(unsigned char)str[3]+3] + asso_values[(unsigned char)str[len - 1]]; +} + +struct stringpool_t + { + char stringpool_str6[sizeof("CP1255")]; + char stringpool_str7[sizeof("CP775")]; + char stringpool_str8[sizeof("CP1250")]; + char stringpool_str9[sizeof("EUC-TW")]; + char stringpool_str10[sizeof("EUC-KR")]; + char stringpool_str11[sizeof("TIS-620")]; + char stringpool_str12[sizeof("ISO-8859-5")]; + char stringpool_str13[sizeof("ISO-8859-15")]; + char stringpool_str14[sizeof("BIG5")]; + char stringpool_str15[sizeof("CP855")]; + char stringpool_str16[sizeof("CP1258")]; + char stringpool_str17[sizeof("CP850")]; + char stringpool_str18[sizeof("CP865")]; + char stringpool_str19[sizeof("EUC-JP")]; + char stringpool_str20[sizeof("CP1257")]; + char stringpool_str21[sizeof("CP1256")]; + char stringpool_str22[sizeof("ISO-8859-8")]; + char stringpool_str23[sizeof("SHIFT_JIS")]; + char stringpool_str25[sizeof("ISO-8859-9")]; + char stringpool_str26[sizeof("ISO-8859-7")]; + char stringpool_str27[sizeof("ISO-8859-6")]; + char stringpool_str29[sizeof("CP857")]; + char stringpool_str30[sizeof("CP1252")]; + char stringpool_str31[sizeof("CP869")]; + char stringpool_str32[sizeof("CP949")]; + char stringpool_str33[sizeof("CP866")]; + char stringpool_str34[sizeof("CP437")]; + char stringpool_str35[sizeof("CP1251")]; + char stringpool_str36[sizeof("ISO-8859-2")]; + char stringpool_str37[sizeof("CP1254")]; + char stringpool_str38[sizeof("CP874")]; + char stringpool_str39[sizeof("CP852")]; + char stringpool_str40[sizeof("CP1253")]; + char stringpool_str41[sizeof("ISO-8859-1")]; + char stringpool_str42[sizeof("CP862")]; + char stringpool_str43[sizeof("ISO-8859-4")]; + char stringpool_str46[sizeof("ISO-8859-3")]; + char stringpool_str47[sizeof("CP861")]; + }; +static const struct stringpool_t stringpool_contents = + { + "CP1255", + "CP775", + "CP1250", + "EUC-TW", + "EUC-KR", + "TIS-620", + "ISO-8859-5", + "ISO-8859-15", + "BIG5", + "CP855", + "CP1258", + "CP850", + "CP865", + "EUC-JP", + "CP1257", + "CP1256", + "ISO-8859-8", + "SHIFT_JIS", + "ISO-8859-9", + "ISO-8859-7", + "ISO-8859-6", + "CP857", + "CP1252", + "CP869", + "CP949", + "CP866", + "CP437", + "CP1251", + "ISO-8859-2", + "CP1254", + "CP874", + "CP852", + "CP1253", + "ISO-8859-1", + "CP862", + "ISO-8859-4", + "ISO-8859-3", + "CP861" + }; +#define stringpool ((const char *) &stringpool_contents) + +static const struct mapping mappings[] = + { + {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +#line 41 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "cp1255"}, +#line 24 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "cp775"}, +#line 36 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "cp1250"}, +#line 47 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "eucTW"}, +#line 46 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "eucKR"}, +#line 50 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "TACTIS"}, +#line 17 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-5"}, +#line 22 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-15"}, +#line 48 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "big5"}, +#line 27 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "cp855"}, +#line 44 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "cp1258"}, +#line 25 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "cp850"}, +#line 31 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "cp865"}, +#line 45 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "eucJP"}, +#line 43 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "cp1257"}, +#line 42 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "cp1256"}, +#line 20 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "ISO8859-8"}, +#line 49 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "SJIS"}, + {-1}, +#line 21 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str25, "ISO8859-9"}, +#line 19 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str26, "ISO8859-7"}, +#line 18 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str27, "ISO8859-6"}, + {-1}, +#line 28 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str29, "cp857"}, +#line 38 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str30, "cp1252"}, +#line 33 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str31, "cp869"}, +#line 35 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str32, "KSC5601"}, +#line 32 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str33, "cp866"}, +#line 23 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str34, "cp437"}, +#line 37 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str35, "cp1251"}, +#line 14 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str36, "ISO8859-2"}, +#line 40 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str37, "cp1254"}, +#line 34 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str38, "cp874"}, +#line 26 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str39, "cp852"}, +#line 39 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str40, "cp1253"}, +#line 13 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str41, "ISO8859-1"}, +#line 30 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str42, "cp862"}, +#line 16 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str43, "ISO8859-4"}, + {-1}, {-1}, +#line 15 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str46, "ISO8859-3"}, +#line 29 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str47, "cp861"} + }; + +#ifdef __GNUC__ +__inline +#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif +#endif +const struct mapping * +mapping_lookup (register const char *str, register unsigned int len) +{ + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = mapping_hash (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register int o = mappings[key].standard_name; + if (o >= 0) + { + register const char *s = o + stringpool; + + if (*str == *s && !strcmp (str + 1, s + 1)) + return &mappings[key]; + } + } + } + return 0; +} diff --git a/local/recipes/tools/diffutils/source/lib/iconv_open-solaris.gperf b/local/recipes/tools/diffutils/source/lib/iconv_open-solaris.gperf new file mode 100644 index 0000000000..7d7da38e6e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/iconv_open-solaris.gperf @@ -0,0 +1,30 @@ +struct mapping { int standard_name; const char vendor_name[10 + 1]; }; +%struct-type +%language=ANSI-C +%define slot-name standard_name +%define hash-function-name mapping_hash +%define lookup-function-name mapping_lookup +%readonly-tables +%global-table +%define word-array-name mappings +%pic +%% +# On Solaris 10, look in the "iconv -l" output. Some aliases are advertised but +# not actually supported by the iconv() function and by the 'iconv' program. +# For example: +# $ echo abc | iconv -f 646 -t ISO-8859-1 +# Not supported 646 to ISO-8859-1 +# $ echo abc | iconv -f 646 -t ISO8859-1 +$ abc +ASCII, "646" +ISO-8859-1, "ISO8859-1" +ISO-8859-2, "ISO8859-2" +ISO-8859-3, "ISO8859-3" +ISO-8859-4, "ISO8859-4" +ISO-8859-5, "ISO8859-5" +ISO-8859-6, "ISO8859-6" +ISO-8859-7, "ISO8859-7" +ISO-8859-8, "ISO8859-8" +ISO-8859-9, "ISO8859-9" +ISO-8859-15, "ISO8859-15" +CP1251, "ansi-1251" diff --git a/local/recipes/tools/diffutils/source/lib/iconv_open-solaris.h b/local/recipes/tools/diffutils/source/lib/iconv_open-solaris.h new file mode 100644 index 0000000000..630cde16b7 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/iconv_open-solaris.h @@ -0,0 +1,190 @@ +/* ANSI-C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -m 10 ./iconv_open-solaris.gperf */ +/* Computed positions: -k'10' */ + +#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>." +#endif + +#line 1 "./iconv_open-solaris.gperf" +struct mapping { int standard_name; const char vendor_name[10 + 1]; }; + +#define TOTAL_KEYWORDS 13 +#define MIN_WORD_LENGTH 5 +#define MAX_WORD_LENGTH 11 +#define MIN_HASH_VALUE 5 +#define MAX_HASH_VALUE 19 +/* maximum key range = 15, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static unsigned int +mapping_hash (register const char *str, register unsigned int len) +{ + static const unsigned char asso_values[] = + { + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, + 9, 8, 7, 6, 5, 4, 3, 2, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20 + }; + register int hval = len; + + switch (hval) + { + default: + hval += asso_values[(unsigned char)str[9]]; + /*FALLTHROUGH*/ + case 9: + case 8: + case 7: + case 6: + case 5: + break; + } + return hval; +} + +struct stringpool_t + { + char stringpool_str5[sizeof("ASCII")]; + char stringpool_str6[sizeof("CP1251")]; + char stringpool_str7[sizeof("$ abc")]; + char stringpool_str10[sizeof("ISO-8859-1")]; + char stringpool_str11[sizeof("ISO-8859-15")]; + char stringpool_str12[sizeof("ISO-8859-9")]; + char stringpool_str13[sizeof("ISO-8859-8")]; + char stringpool_str14[sizeof("ISO-8859-7")]; + char stringpool_str15[sizeof("ISO-8859-6")]; + char stringpool_str16[sizeof("ISO-8859-5")]; + char stringpool_str17[sizeof("ISO-8859-4")]; + char stringpool_str18[sizeof("ISO-8859-3")]; + char stringpool_str19[sizeof("ISO-8859-2")]; + }; +static const struct stringpool_t stringpool_contents = + { + "ASCII", + "CP1251", + "$ abc", + "ISO-8859-1", + "ISO-8859-15", + "ISO-8859-9", + "ISO-8859-8", + "ISO-8859-7", + "ISO-8859-6", + "ISO-8859-5", + "ISO-8859-4", + "ISO-8859-3", + "ISO-8859-2" + }; +#define stringpool ((const char *) &stringpool_contents) + +static const struct mapping mappings[] = + { + {-1}, {-1}, {-1}, {-1}, {-1}, +#line 19 "./iconv_open-solaris.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str5, "646"}, +#line 30 "./iconv_open-solaris.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "ansi-1251"}, +#line 18 "./iconv_open-solaris.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str7}, + {-1}, {-1}, +#line 20 "./iconv_open-solaris.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-1"}, +#line 29 "./iconv_open-solaris.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "ISO8859-15"}, +#line 28 "./iconv_open-solaris.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-9"}, +#line 27 "./iconv_open-solaris.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-8"}, +#line 26 "./iconv_open-solaris.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "ISO8859-7"}, +#line 25 "./iconv_open-solaris.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "ISO8859-6"}, +#line 24 "./iconv_open-solaris.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "ISO8859-5"}, +#line 23 "./iconv_open-solaris.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "ISO8859-4"}, +#line 22 "./iconv_open-solaris.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-3"}, +#line 21 "./iconv_open-solaris.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-2"} + }; + +#ifdef __GNUC__ +__inline +#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif +#endif +const struct mapping * +mapping_lookup (register const char *str, register unsigned int len) +{ + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = mapping_hash (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register int o = mappings[key].standard_name; + if (o >= 0) + { + register const char *s = o + stringpool; + + if (*str == *s && !strcmp (str + 1, s + 1)) + return &mappings[key]; + } + } + } + return 0; +} diff --git a/local/recipes/tools/diffutils/source/lib/iconv_open.c b/local/recipes/tools/diffutils/source/lib/iconv_open.c new file mode 100644 index 0000000000..376dc41635 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/iconv_open.c @@ -0,0 +1,172 @@ +/* Character set conversion. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <iconv.h> + +#include <errno.h> +#include <string.h> +#include "c-ctype.h" +#include "c-strcase.h" + +#define SIZEOF(a) (sizeof(a) / sizeof(a[0])) + +/* Namespace cleanliness. */ +#define mapping_lookup rpl_iconv_open_mapping_lookup + +/* The macro ICONV_FLAVOR is defined to one of these or undefined. */ + +#define ICONV_FLAVOR_AIX "iconv_open-aix.h" +#define ICONV_FLAVOR_HPUX "iconv_open-hpux.h" +#define ICONV_FLAVOR_IRIX "iconv_open-irix.h" +#define ICONV_FLAVOR_OSF "iconv_open-osf.h" +#define ICONV_FLAVOR_SOLARIS "iconv_open-solaris.h" + +#ifdef ICONV_FLAVOR +# include ICONV_FLAVOR +#endif + +iconv_t +rpl_iconv_open (const char *tocode, const char *fromcode) +#undef iconv_open +{ + char fromcode_upper[32]; + char tocode_upper[32]; + char *fromcode_upper_end; + char *tocode_upper_end; + +#if REPLACE_ICONV_UTF + /* Special handling of conversion between UTF-8 and UTF-{16,32}{BE,LE}. + Do this here, before calling the real iconv_open(), because OSF/1 5.1 + iconv() to these encoding inserts a BOM, which is wrong. + We do not need to handle conversion between arbitrary encodings and + UTF-{16,32}{BE,LE}, because the 'striconveh' module implements two-step + conversion through UTF-8. + The _ICONV_* constants are chosen to be disjoint from any iconv_t + returned by the system's iconv_open() functions. Recall that iconv_t + is a scalar type. */ + if (c_toupper (fromcode[0]) == 'U' + && c_toupper (fromcode[1]) == 'T' + && c_toupper (fromcode[2]) == 'F' + && fromcode[3] == '-') + { + if (c_toupper (tocode[0]) == 'U' + && c_toupper (tocode[1]) == 'T' + && c_toupper (tocode[2]) == 'F' + && tocode[3] == '-') + { + if (strcmp (fromcode + 4, "8") == 0) + { + if (c_strcasecmp (tocode + 4, "16BE") == 0) + return _ICONV_UTF8_UTF16BE; + if (c_strcasecmp (tocode + 4, "16LE") == 0) + return _ICONV_UTF8_UTF16LE; + if (c_strcasecmp (tocode + 4, "32BE") == 0) + return _ICONV_UTF8_UTF32BE; + if (c_strcasecmp (tocode + 4, "32LE") == 0) + return _ICONV_UTF8_UTF32LE; + } + else if (strcmp (tocode + 4, "8") == 0) + { + if (c_strcasecmp (fromcode + 4, "16BE") == 0) + return _ICONV_UTF16BE_UTF8; + if (c_strcasecmp (fromcode + 4, "16LE") == 0) + return _ICONV_UTF16LE_UTF8; + if (c_strcasecmp (fromcode + 4, "32BE") == 0) + return _ICONV_UTF32BE_UTF8; + if (c_strcasecmp (fromcode + 4, "32LE") == 0) + return _ICONV_UTF32LE_UTF8; + } + } + } +#endif + + /* Do *not* add special support for 8-bit encodings like ASCII or ISO-8859-1 + here. This would lead to programs that work in some locales (such as the + "C" or "en_US" locales) but do not work in East Asian locales. It is + better if programmers make their programs depend on GNU libiconv (except + on glibc systems), e.g. by using the AM_ICONV macro and documenting the + dependency in an INSTALL or DEPENDENCIES file. */ + + /* Try with the original names first. + This covers the case when fromcode or tocode is a lowercase encoding name + that is understood by the system's iconv_open but not listed in our + mappings table. */ + { + iconv_t cd = iconv_open (tocode, fromcode); + if (cd != (iconv_t)(-1)) + return cd; + } + + /* Convert the encodings to upper case, because + 1. in the arguments of iconv_open() on AIX, HP-UX, and OSF/1 the case + matters, + 2. it makes searching in the table faster. */ + { + const char *p = fromcode; + char *q = fromcode_upper; + while ((*q = c_toupper (*p)) != '\0') + { + p++; + q++; + if (q == &fromcode_upper[SIZEOF (fromcode_upper)]) + { + errno = EINVAL; + return (iconv_t)(-1); + } + } + fromcode_upper_end = q; + } + + { + const char *p = tocode; + char *q = tocode_upper; + while ((*q = c_toupper (*p)) != '\0') + { + p++; + q++; + if (q == &tocode_upper[SIZEOF (tocode_upper)]) + { + errno = EINVAL; + return (iconv_t)(-1); + } + } + tocode_upper_end = q; + } + +#ifdef ICONV_FLAVOR + /* Apply the mappings. */ + { + const struct mapping *m = + mapping_lookup (fromcode_upper, fromcode_upper_end - fromcode_upper); + + fromcode = (m != NULL ? m->vendor_name : fromcode_upper); + } + { + const struct mapping *m = + mapping_lookup (tocode_upper, tocode_upper_end - tocode_upper); + + tocode = (m != NULL ? m->vendor_name : tocode_upper); + } +#else + fromcode = fromcode_upper; + tocode = tocode_upper; +#endif + + return iconv_open (tocode, fromcode); +} diff --git a/local/recipes/tools/diffutils/source/lib/ignore-value.h b/local/recipes/tools/diffutils/source/lib/ignore-value.h new file mode 100644 index 0000000000..2439d9506a --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/ignore-value.h @@ -0,0 +1,50 @@ +/* ignore a function return without a compiler warning. -*- coding: utf-8 -*- + + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Jim Meyering, Eric Blake and Pádraig Brady. */ + +/* Use "ignore_value" to avoid a warning when using a function declared with + gcc's warn_unused_result attribute, but for which you really do want to + ignore the result. Traditionally, people have used a "(void)" cast to + indicate that a function's return value is deliberately unused. However, + if the function is declared with __attribute__((warn_unused_result)), + gcc issues a warning even with the cast. + + Caution: most of the time, you really should heed gcc's warning, and + check the return value. However, in those exceptional cases in which + you're sure you know what you're doing, use this function. + + For the record, here's one of the ignorable warnings: + "copy.c:233: warning: ignoring return value of 'fchown', + declared with attribute warn_unused_result". */ + +#ifndef _GL_IGNORE_VALUE_H +#define _GL_IGNORE_VALUE_H + +/* Normally casting an expression to void discards its value, but GCC + versions 3.4 and newer have __attribute__ ((__warn_unused_result__)) + which may cause unwanted diagnostics in that case. Use __typeof__ + and __extension__ to work around the problem, if the workaround is + known to be needed. */ +#if 3 < __GNUC__ + (4 <= __GNUC_MINOR__) +# define ignore_value(x) \ + (__extension__ ({ __typeof__ (x) __x = (x); (void) __x; })) +#else +# define ignore_value(x) ((void) (x)) +#endif + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/imaxtostr.c b/local/recipes/tools/diffutils/source/lib/imaxtostr.c new file mode 100644 index 0000000000..b91ac98c4e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/imaxtostr.c @@ -0,0 +1,3 @@ +#define anytostr imaxtostr +#define inttype intmax_t +#include "anytostr.c" diff --git a/local/recipes/tools/diffutils/source/lib/intprops.h b/local/recipes/tools/diffutils/source/lib/intprops.h new file mode 100644 index 0000000000..8f5ad54515 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/intprops.h @@ -0,0 +1,449 @@ +/* intprops.h -- properties of integer types + + Copyright (C) 2001-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +#ifndef _GL_INTPROPS_H +#define _GL_INTPROPS_H + +#include <limits.h> + +/* Return a value with the common real type of E and V and the value of V. */ +#define _GL_INT_CONVERT(e, v) (0 * (e) + (v)) + +/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see + <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00406.html>. */ +#define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v)) + +/* The extra casts in the following macros work around compiler bugs, + e.g., in Cray C 5.0.3.0. */ + +/* True if the arithmetic type T is an integer type. bool counts as + an integer. */ +#define TYPE_IS_INTEGER(t) ((t) 1.5 == 1) + +/* True if the real type T is signed. */ +#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) + +/* Return 1 if the real expression E, after promotion, has a + signed or floating type. */ +#define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0) + + +/* Minimum and maximum values for integer types and expressions. */ + +/* The width in bits of the integer type or expression T. + Padding bits are not supported; this is checked at compile-time below. */ +#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) + +/* The maximum and minimum values for the integer type T. */ +#define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t)) +#define TYPE_MAXIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) -1 \ + : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1))) + +/* The maximum and minimum values for the type of the expression E, + after integer promotion. E should not have side effects. */ +#define _GL_INT_MINIMUM(e) \ + (EXPR_SIGNED (e) \ + ? ~ _GL_SIGNED_INT_MAXIMUM (e) \ + : _GL_INT_CONVERT (e, 0)) +#define _GL_INT_MAXIMUM(e) \ + (EXPR_SIGNED (e) \ + ? _GL_SIGNED_INT_MAXIMUM (e) \ + : _GL_INT_NEGATE_CONVERT (e, 1)) +#define _GL_SIGNED_INT_MAXIMUM(e) \ + (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1) + +/* Work around OpenVMS incompatibility with C99. */ +#if !defined LLONG_MAX && defined __INT64_MAX +# define LLONG_MAX __INT64_MAX +# define LLONG_MIN __INT64_MIN +#endif + +/* This include file assumes that signed types are two's complement without + padding bits; the above macros have undefined behavior otherwise. + If this is a problem for you, please let us know how to fix it for your host. + This assumption is tested by the intprops-tests module. */ + +/* Does the __typeof__ keyword work? This could be done by + 'configure', but for now it's easier to do it by hand. */ +#if (2 <= __GNUC__ \ + || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) +# define _GL_HAVE___TYPEOF__ 1 +#else +# define _GL_HAVE___TYPEOF__ 0 +#endif + +/* Return 1 if the integer type or expression T might be signed. Return 0 + if it is definitely unsigned. This macro does not evaluate its argument, + and expands to an integer constant expression. */ +#if _GL_HAVE___TYPEOF__ +# define _GL_SIGNED_TYPE_OR_EXPR(t) TYPE_SIGNED (__typeof__ (t)) +#else +# define _GL_SIGNED_TYPE_OR_EXPR(t) 1 +#endif + +/* Bound on length of the string representing an unsigned integer + value representable in B bits. log10 (2.0) < 146/485. The + smallest value of B where this bound is not tight is 2621. */ +#define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485) + +/* Bound on length of the string representing an integer type or expression T. + Subtract 1 for the sign bit if T is signed, and then add 1 more for + a minus sign if needed. + + Because _GL_SIGNED_TYPE_OR_EXPR sometimes returns 0 when its argument is + signed, this macro may overestimate the true bound by one byte when + applied to unsigned types of size 2, 4, 16, ... bytes. */ +#define INT_STRLEN_BOUND(t) \ + (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \ + + _GL_SIGNED_TYPE_OR_EXPR (t)) + +/* Bound on buffer size needed to represent an integer type or expression T, + including the terminating null. */ +#define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1) + + +/* Range overflow checks. + + The INT_<op>_RANGE_OVERFLOW macros return 1 if the corresponding C + operators might not yield numerically correct answers due to + arithmetic overflow. They do not rely on undefined or + implementation-defined behavior. Their implementations are simple + and straightforward, but they are a bit harder to use than the + INT_<op>_OVERFLOW macros described below. + + Example usage: + + long int i = ...; + long int j = ...; + if (INT_MULTIPLY_RANGE_OVERFLOW (i, j, LONG_MIN, LONG_MAX)) + printf ("multiply would overflow"); + else + printf ("product is %ld", i * j); + + Restrictions on *_RANGE_OVERFLOW macros: + + These macros do not check for all possible numerical problems or + undefined or unspecified behavior: they do not check for division + by zero, for bad shift counts, or for shifting negative numbers. + + These macros may evaluate their arguments zero or multiple times, + so the arguments should not have side effects. The arithmetic + arguments (including the MIN and MAX arguments) must be of the same + integer type after the usual arithmetic conversions, and the type + must have minimum value MIN and maximum MAX. Unsigned types should + use a zero MIN of the proper type. + + These macros are tuned for constant MIN and MAX. For commutative + operations such as A + B, they are also tuned for constant B. */ + +/* Return 1 if A + B would overflow in [MIN,MAX] arithmetic. + See above for restrictions. */ +#define INT_ADD_RANGE_OVERFLOW(a, b, min, max) \ + ((b) < 0 \ + ? (a) < (min) - (b) \ + : (max) - (b) < (a)) + +/* Return 1 if A - B would overflow in [MIN,MAX] arithmetic. + See above for restrictions. */ +#define INT_SUBTRACT_RANGE_OVERFLOW(a, b, min, max) \ + ((b) < 0 \ + ? (max) + (b) < (a) \ + : (a) < (min) + (b)) + +/* Return 1 if - A would overflow in [MIN,MAX] arithmetic. + See above for restrictions. */ +#define INT_NEGATE_RANGE_OVERFLOW(a, min, max) \ + ((min) < 0 \ + ? (a) < - (max) \ + : 0 < (a)) + +/* Return 1 if A * B would overflow in [MIN,MAX] arithmetic. + See above for restrictions. Avoid && and || as they tickle + bugs in Sun C 5.11 2010/08/13 and other compilers; see + <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00401.html>. */ +#define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max) \ + ((b) < 0 \ + ? ((a) < 0 \ + ? (a) < (max) / (b) \ + : (b) == -1 \ + ? 0 \ + : (min) / (b) < (a)) \ + : (b) == 0 \ + ? 0 \ + : ((a) < 0 \ + ? (a) < (min) / (b) \ + : (max) / (b) < (a))) + +/* Return 1 if A / B would overflow in [MIN,MAX] arithmetic. + See above for restrictions. Do not check for division by zero. */ +#define INT_DIVIDE_RANGE_OVERFLOW(a, b, min, max) \ + ((min) < 0 && (b) == -1 && (a) < - (max)) + +/* Return 1 if A % B would overflow in [MIN,MAX] arithmetic. + See above for restrictions. Do not check for division by zero. + Mathematically, % should never overflow, but on x86-like hosts + INT_MIN % -1 traps, and the C standard permits this, so treat this + as an overflow too. */ +#define INT_REMAINDER_RANGE_OVERFLOW(a, b, min, max) \ + INT_DIVIDE_RANGE_OVERFLOW (a, b, min, max) + +/* Return 1 if A << B would overflow in [MIN,MAX] arithmetic. + See above for restrictions. Here, MIN and MAX are for A only, and B need + not be of the same type as the other arguments. The C standard says that + behavior is undefined for shifts unless 0 <= B < wordwidth, and that when + A is negative then A << B has undefined behavior and A >> B has + implementation-defined behavior, but do not check these other + restrictions. */ +#define INT_LEFT_SHIFT_RANGE_OVERFLOW(a, b, min, max) \ + ((a) < 0 \ + ? (a) < (min) >> (b) \ + : (max) >> (b) < (a)) + +/* True if __builtin_add_overflow (A, B, P) works when P is non-null. */ +#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__) + +/* True if __builtin_add_overflow_p (A, B, C) works. */ +#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__) + +/* The _GL*_OVERFLOW macros have the same restrictions as the + *_RANGE_OVERFLOW macros, except that they do not assume that operands + (e.g., A and B) have the same type as MIN and MAX. Instead, they assume + that the result (e.g., A + B) has that type. */ +#if _GL_HAS_BUILTIN_OVERFLOW_P +# define _GL_ADD_OVERFLOW(a, b, min, max) \ + __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0) +# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \ + __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0) +# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \ + __builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0) +#else +# define _GL_ADD_OVERFLOW(a, b, min, max) \ + ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max) \ + : (a) < 0 ? (b) <= (a) + (b) \ + : (b) < 0 ? (a) <= (a) + (b) \ + : (a) + (b) < (b)) +# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \ + ((min) < 0 ? INT_SUBTRACT_RANGE_OVERFLOW (a, b, min, max) \ + : (a) < 0 ? 1 \ + : (b) < 0 ? (a) - (b) <= (a) \ + : (a) < (b)) +# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \ + (((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a)))) \ + || INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max)) +#endif +#define _GL_DIVIDE_OVERFLOW(a, b, min, max) \ + ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \ + : (a) < 0 ? (b) <= (a) + (b) - 1 \ + : (b) < 0 && (a) + (b) <= (a)) +#define _GL_REMAINDER_OVERFLOW(a, b, min, max) \ + ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \ + : (a) < 0 ? (a) % (b) != ((max) - (b) + 1) % (b) \ + : (b) < 0 && ! _GL_UNSIGNED_NEG_MULTIPLE (a, b, max)) + +/* Return a nonzero value if A is a mathematical multiple of B, where + A is unsigned, B is negative, and MAX is the maximum value of A's + type. A's type must be the same as (A % B)'s type. Normally (A % + -B == 0) suffices, but things get tricky if -B would overflow. */ +#define _GL_UNSIGNED_NEG_MULTIPLE(a, b, max) \ + (((b) < -_GL_SIGNED_INT_MAXIMUM (b) \ + ? (_GL_SIGNED_INT_MAXIMUM (b) == (max) \ + ? (a) \ + : (a) % (_GL_INT_CONVERT (a, _GL_SIGNED_INT_MAXIMUM (b)) + 1)) \ + : (a) % - (b)) \ + == 0) + +/* Check for integer overflow, and report low order bits of answer. + + The INT_<op>_OVERFLOW macros return 1 if the corresponding C operators + might not yield numerically correct answers due to arithmetic overflow. + The INT_<op>_WRAPV macros also store the low-order bits of the answer. + These macros work correctly on all known practical hosts, and do not rely + on undefined behavior due to signed arithmetic overflow. + + Example usage, assuming A and B are long int: + + if (INT_MULTIPLY_OVERFLOW (a, b)) + printf ("result would overflow\n"); + else + printf ("result is %ld (no overflow)\n", a * b); + + Example usage with WRAPV flavor: + + long int result; + bool overflow = INT_MULTIPLY_WRAPV (a, b, &result); + printf ("result is %ld (%s)\n", result, + overflow ? "after overflow" : "no overflow"); + + Restrictions on these macros: + + These macros do not check for all possible numerical problems or + undefined or unspecified behavior: they do not check for division + by zero, for bad shift counts, or for shifting negative numbers. + + These macros may evaluate their arguments zero or multiple times, so the + arguments should not have side effects. + + The WRAPV macros are not constant expressions. They support only + +, binary -, and *. The result type must be signed. + + These macros are tuned for their last argument being a constant. + + Return 1 if the integer expressions A * B, A - B, -A, A * B, A / B, + A % B, and A << B would overflow, respectively. */ + +#define INT_ADD_OVERFLOW(a, b) \ + _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW) +#define INT_SUBTRACT_OVERFLOW(a, b) \ + _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW) +#if _GL_HAS_BUILTIN_OVERFLOW_P +# define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a) +#else +# define INT_NEGATE_OVERFLOW(a) \ + INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a)) +#endif +#define INT_MULTIPLY_OVERFLOW(a, b) \ + _GL_BINARY_OP_OVERFLOW (a, b, _GL_MULTIPLY_OVERFLOW) +#define INT_DIVIDE_OVERFLOW(a, b) \ + _GL_BINARY_OP_OVERFLOW (a, b, _GL_DIVIDE_OVERFLOW) +#define INT_REMAINDER_OVERFLOW(a, b) \ + _GL_BINARY_OP_OVERFLOW (a, b, _GL_REMAINDER_OVERFLOW) +#define INT_LEFT_SHIFT_OVERFLOW(a, b) \ + INT_LEFT_SHIFT_RANGE_OVERFLOW (a, b, \ + _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a)) + +/* Return 1 if the expression A <op> B would overflow, + where OP_RESULT_OVERFLOW (A, B, MIN, MAX) does the actual test, + assuming MIN and MAX are the minimum and maximum for the result type. + Arguments should be free of side effects. */ +#define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow) \ + op_result_overflow (a, b, \ + _GL_INT_MINIMUM (0 * (b) + (a)), \ + _GL_INT_MAXIMUM (0 * (b) + (a))) + +/* Store the low-order bits of A + B, A - B, A * B, respectively, into *R. + Return 1 if the result overflows. See above for restrictions. */ +#define INT_ADD_WRAPV(a, b, r) \ + _GL_INT_OP_WRAPV (a, b, r, +, __builtin_add_overflow, INT_ADD_OVERFLOW) +#define INT_SUBTRACT_WRAPV(a, b, r) \ + _GL_INT_OP_WRAPV (a, b, r, -, __builtin_sub_overflow, INT_SUBTRACT_OVERFLOW) +#define INT_MULTIPLY_WRAPV(a, b, r) \ + _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW) + +/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See: + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193 + https://llvm.org/bugs/show_bug.cgi?id=25390 + For now, assume all versions of GCC-like compilers generate bogus + warnings for _Generic. This matters only for older compilers that + lack __builtin_add_overflow. */ +#if __GNUC__ +# define _GL__GENERIC_BOGUS 1 +#else +# define _GL__GENERIC_BOGUS 0 +#endif + +/* Store the low-order bits of A <op> B into *R, where OP specifies + the operation. BUILTIN is the builtin operation, and OVERFLOW the + overflow predicate. Return 1 if the result overflows. See above + for restrictions. */ +#if _GL_HAS_BUILTIN_OVERFLOW +# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r) +#elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS +# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \ + (_Generic \ + (*(r), \ + signed char: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ + signed char, SCHAR_MIN, SCHAR_MAX), \ + short int: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ + short int, SHRT_MIN, SHRT_MAX), \ + int: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ + int, INT_MIN, INT_MAX), \ + long int: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ + long int, LONG_MIN, LONG_MAX), \ + long long int: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \ + long long int, LLONG_MIN, LLONG_MAX))) +#else +# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \ + (sizeof *(r) == sizeof (signed char) \ + ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ + signed char, SCHAR_MIN, SCHAR_MAX) \ + : sizeof *(r) == sizeof (short int) \ + ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ + short int, SHRT_MIN, SHRT_MAX) \ + : sizeof *(r) == sizeof (int) \ + ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ + int, INT_MIN, INT_MAX) \ + : _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow)) +# ifdef LLONG_MAX +# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \ + (sizeof *(r) == sizeof (long int) \ + ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ + long int, LONG_MIN, LONG_MAX) \ + : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \ + long long int, LLONG_MIN, LLONG_MAX)) +# else +# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ + long int, LONG_MIN, LONG_MAX) +# endif +#endif + +/* Store the low-order bits of A <op> B into *R, where the operation + is given by OP. Use the unsigned type UT for calculation to avoid + overflow problems. *R's type is T, with extrema TMIN and TMAX. + T must be a signed integer type. Return 1 if the result overflows. */ +#define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \ + (sizeof ((a) op (b)) < sizeof (t) \ + ? _GL_INT_OP_CALC1 ((t) (a), (t) (b), r, op, overflow, ut, t, tmin, tmax) \ + : _GL_INT_OP_CALC1 (a, b, r, op, overflow, ut, t, tmin, tmax)) +#define _GL_INT_OP_CALC1(a, b, r, op, overflow, ut, t, tmin, tmax) \ + ((overflow (a, b) \ + || (EXPR_SIGNED ((a) op (b)) && ((a) op (b)) < (tmin)) \ + || (tmax) < ((a) op (b))) \ + ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 1) \ + : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 0)) + +/* Return the low-order bits of A <op> B, where the operation is given + by OP. Use the unsigned type UT for calculation to avoid undefined + behavior on signed integer overflow, and convert the result to type T. + UT is at least as wide as T and is no narrower than unsigned int, + T is two's complement, and there is no padding or trap representations. + Assume that converting UT to T yields the low-order bits, as is + done in all known two's-complement C compilers. E.g., see: + https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html + + According to the C standard, converting UT to T yields an + implementation-defined result or signal for values outside T's + range. However, code that works around this theoretical problem + runs afoul of a compiler bug in Oracle Studio 12.3 x86. See: + http://lists.gnu.org/archive/html/bug-gnulib/2017-04/msg00049.html + As the compiler bug is real, don't try to work around the + theoretical problem. */ + +#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t) \ + ((t) ((ut) (a) op (ut) (b))) + +#endif /* _GL_INTPROPS_H */ diff --git a/local/recipes/tools/diffutils/source/lib/inttostr.c b/local/recipes/tools/diffutils/source/lib/inttostr.c new file mode 100644 index 0000000000..c96b5ca39b --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/inttostr.c @@ -0,0 +1,3 @@ +#define anytostr inttostr +#define inttype int +#include "anytostr.c" diff --git a/local/recipes/tools/diffutils/source/lib/inttostr.h b/local/recipes/tools/diffutils/source/lib/inttostr.h new file mode 100644 index 0000000000..a322260eb0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/inttostr.h @@ -0,0 +1,46 @@ +/* inttostr.h -- convert integers to printable strings + + Copyright (C) 2001-2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert */ + +#include <stdint.h> +#include <sys/types.h> + +#include "intprops.h" + +#ifndef __GNUC_PREREQ +# if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +# else +# define __GNUC_PREREQ(maj, min) 0 +# endif +#endif + +#if __GNUC_PREREQ (3,4) +# undef __attribute_warn_unused_result__ +# define __attribute_warn_unused_result__ \ + __attribute__ ((__warn_unused_result__)) +#else +# define __attribute_warn_unused_result__ /* empty */ +#endif + +char *imaxtostr (intmax_t, char *) __attribute_warn_unused_result__; +char *inttostr (int, char *) __attribute_warn_unused_result__; +char *offtostr (off_t, char *) __attribute_warn_unused_result__; +char *uinttostr (unsigned int, char *) __attribute_warn_unused_result__; +char *umaxtostr (uintmax_t, char *) __attribute_warn_unused_result__; diff --git a/local/recipes/tools/diffutils/source/lib/inttypes.in.h b/local/recipes/tools/diffutils/source/lib/inttypes.in.h new file mode 100644 index 0000000000..69b12a839a --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/inttypes.in.h @@ -0,0 +1,1144 @@ +/* Copyright (C) 2006-2017 Free Software Foundation, Inc. + Written by Paul Eggert, Bruno Haible, Derek Price. + This file is part of gnulib. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* + * ISO C 99 <inttypes.h> for platforms that lack it. + * <http://www.opengroup.org/susv3xbd/inttypes.h.html> + */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* Include the original <inttypes.h> if it exists, and if this file + has not been included yet or if this file includes gnulib stdint.h + which in turn includes this file. + The include_next requires a split double-inclusion guard. */ +#if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H +# if @HAVE_INTTYPES_H@ + + /* Some pre-C++11 <stdint.h> implementations need this. */ +# if defined __cplusplus && ! defined __STDC_FORMAT_MACROS +# define __STDC_FORMAT_MACROS 1 +# endif + +# @INCLUDE_NEXT@ @NEXT_INTTYPES_H@ +# endif +#endif + +#if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H +#define INTTYPES_H + +/* Include <stdint.h> or the gnulib replacement. + But avoid namespace pollution on glibc systems. */ +#ifndef __GLIBC__ +# include <stdint.h> +#endif +/* Get CHAR_BIT. */ +#include <limits.h> +/* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include <stdio.h> +#endif + +#if !(INT_MIN == INT32_MIN && INT_MAX == INT32_MAX) +# error "This file assumes that 'int' has exactly 32 bits. Please report your platform and compiler to <bug-gnulib@gnu.org>." +#endif + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +/* 7.8.1 Macros for format specifiers */ + +#if defined _TNS_R_TARGET + /* Tandem NonStop R series and compatible platforms released before + July 2005 support %Ld but not %lld. */ +# define _LONG_LONG_FORMAT_PREFIX "L" +#else +# define _LONG_LONG_FORMAT_PREFIX "ll" +#endif + +#if !defined PRId8 || @PRI_MACROS_BROKEN@ +# undef PRId8 +# ifdef INT8_MAX +# define PRId8 "d" +# endif +#endif +#if !defined PRIi8 || @PRI_MACROS_BROKEN@ +# undef PRIi8 +# ifdef INT8_MAX +# define PRIi8 "i" +# endif +#endif +#if !defined PRIo8 || @PRI_MACROS_BROKEN@ +# undef PRIo8 +# ifdef UINT8_MAX +# define PRIo8 "o" +# endif +#endif +#if !defined PRIu8 || @PRI_MACROS_BROKEN@ +# undef PRIu8 +# ifdef UINT8_MAX +# define PRIu8 "u" +# endif +#endif +#if !defined PRIx8 || @PRI_MACROS_BROKEN@ +# undef PRIx8 +# ifdef UINT8_MAX +# define PRIx8 "x" +# endif +#endif +#if !defined PRIX8 || @PRI_MACROS_BROKEN@ +# undef PRIX8 +# ifdef UINT8_MAX +# define PRIX8 "X" +# endif +#endif +#if !defined PRId16 || @PRI_MACROS_BROKEN@ +# undef PRId16 +# ifdef INT16_MAX +# define PRId16 "d" +# endif +#endif +#if !defined PRIi16 || @PRI_MACROS_BROKEN@ +# undef PRIi16 +# ifdef INT16_MAX +# define PRIi16 "i" +# endif +#endif +#if !defined PRIo16 || @PRI_MACROS_BROKEN@ +# undef PRIo16 +# ifdef UINT16_MAX +# define PRIo16 "o" +# endif +#endif +#if !defined PRIu16 || @PRI_MACROS_BROKEN@ +# undef PRIu16 +# ifdef UINT16_MAX +# define PRIu16 "u" +# endif +#endif +#if !defined PRIx16 || @PRI_MACROS_BROKEN@ +# undef PRIx16 +# ifdef UINT16_MAX +# define PRIx16 "x" +# endif +#endif +#if !defined PRIX16 || @PRI_MACROS_BROKEN@ +# undef PRIX16 +# ifdef UINT16_MAX +# define PRIX16 "X" +# endif +#endif +#if !defined PRId32 || @PRI_MACROS_BROKEN@ +# undef PRId32 +# ifdef INT32_MAX +# define PRId32 "d" +# endif +#endif +#if !defined PRIi32 || @PRI_MACROS_BROKEN@ +# undef PRIi32 +# ifdef INT32_MAX +# define PRIi32 "i" +# endif +#endif +#if !defined PRIo32 || @PRI_MACROS_BROKEN@ +# undef PRIo32 +# ifdef UINT32_MAX +# define PRIo32 "o" +# endif +#endif +#if !defined PRIu32 || @PRI_MACROS_BROKEN@ +# undef PRIu32 +# ifdef UINT32_MAX +# define PRIu32 "u" +# endif +#endif +#if !defined PRIx32 || @PRI_MACROS_BROKEN@ +# undef PRIx32 +# ifdef UINT32_MAX +# define PRIx32 "x" +# endif +#endif +#if !defined PRIX32 || @PRI_MACROS_BROKEN@ +# undef PRIX32 +# ifdef UINT32_MAX +# define PRIX32 "X" +# endif +#endif +#ifdef INT64_MAX +# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@) +# define _PRI64_PREFIX "l" +# elif defined _MSC_VER || defined __MINGW32__ +# define _PRI64_PREFIX "I64" +# elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX +# endif +# if !defined PRId64 || @PRI_MACROS_BROKEN@ +# undef PRId64 +# define PRId64 _PRI64_PREFIX "d" +# endif +# if !defined PRIi64 || @PRI_MACROS_BROKEN@ +# undef PRIi64 +# define PRIi64 _PRI64_PREFIX "i" +# endif +#endif +#ifdef UINT64_MAX +# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@) +# define _PRIu64_PREFIX "l" +# elif defined _MSC_VER || defined __MINGW32__ +# define _PRIu64_PREFIX "I64" +# elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX +# endif +# if !defined PRIo64 || @PRI_MACROS_BROKEN@ +# undef PRIo64 +# define PRIo64 _PRIu64_PREFIX "o" +# endif +# if !defined PRIu64 || @PRI_MACROS_BROKEN@ +# undef PRIu64 +# define PRIu64 _PRIu64_PREFIX "u" +# endif +# if !defined PRIx64 || @PRI_MACROS_BROKEN@ +# undef PRIx64 +# define PRIx64 _PRIu64_PREFIX "x" +# endif +# if !defined PRIX64 || @PRI_MACROS_BROKEN@ +# undef PRIX64 +# define PRIX64 _PRIu64_PREFIX "X" +# endif +#endif + +#if !defined PRIdLEAST8 || @PRI_MACROS_BROKEN@ +# undef PRIdLEAST8 +# define PRIdLEAST8 "d" +#endif +#if !defined PRIiLEAST8 || @PRI_MACROS_BROKEN@ +# undef PRIiLEAST8 +# define PRIiLEAST8 "i" +#endif +#if !defined PRIoLEAST8 || @PRI_MACROS_BROKEN@ +# undef PRIoLEAST8 +# define PRIoLEAST8 "o" +#endif +#if !defined PRIuLEAST8 || @PRI_MACROS_BROKEN@ +# undef PRIuLEAST8 +# define PRIuLEAST8 "u" +#endif +#if !defined PRIxLEAST8 || @PRI_MACROS_BROKEN@ +# undef PRIxLEAST8 +# define PRIxLEAST8 "x" +#endif +#if !defined PRIXLEAST8 || @PRI_MACROS_BROKEN@ +# undef PRIXLEAST8 +# define PRIXLEAST8 "X" +#endif +#if !defined PRIdLEAST16 || @PRI_MACROS_BROKEN@ +# undef PRIdLEAST16 +# define PRIdLEAST16 "d" +#endif +#if !defined PRIiLEAST16 || @PRI_MACROS_BROKEN@ +# undef PRIiLEAST16 +# define PRIiLEAST16 "i" +#endif +#if !defined PRIoLEAST16 || @PRI_MACROS_BROKEN@ +# undef PRIoLEAST16 +# define PRIoLEAST16 "o" +#endif +#if !defined PRIuLEAST16 || @PRI_MACROS_BROKEN@ +# undef PRIuLEAST16 +# define PRIuLEAST16 "u" +#endif +#if !defined PRIxLEAST16 || @PRI_MACROS_BROKEN@ +# undef PRIxLEAST16 +# define PRIxLEAST16 "x" +#endif +#if !defined PRIXLEAST16 || @PRI_MACROS_BROKEN@ +# undef PRIXLEAST16 +# define PRIXLEAST16 "X" +#endif +#if !defined PRIdLEAST32 || @PRI_MACROS_BROKEN@ +# undef PRIdLEAST32 +# define PRIdLEAST32 "d" +#endif +#if !defined PRIiLEAST32 || @PRI_MACROS_BROKEN@ +# undef PRIiLEAST32 +# define PRIiLEAST32 "i" +#endif +#if !defined PRIoLEAST32 || @PRI_MACROS_BROKEN@ +# undef PRIoLEAST32 +# define PRIoLEAST32 "o" +#endif +#if !defined PRIuLEAST32 || @PRI_MACROS_BROKEN@ +# undef PRIuLEAST32 +# define PRIuLEAST32 "u" +#endif +#if !defined PRIxLEAST32 || @PRI_MACROS_BROKEN@ +# undef PRIxLEAST32 +# define PRIxLEAST32 "x" +#endif +#if !defined PRIXLEAST32 || @PRI_MACROS_BROKEN@ +# undef PRIXLEAST32 +# define PRIXLEAST32 "X" +#endif +#ifdef INT64_MAX +# if !defined PRIdLEAST64 || @PRI_MACROS_BROKEN@ +# undef PRIdLEAST64 +# define PRIdLEAST64 PRId64 +# endif +# if !defined PRIiLEAST64 || @PRI_MACROS_BROKEN@ +# undef PRIiLEAST64 +# define PRIiLEAST64 PRIi64 +# endif +#endif +#ifdef UINT64_MAX +# if !defined PRIoLEAST64 || @PRI_MACROS_BROKEN@ +# undef PRIoLEAST64 +# define PRIoLEAST64 PRIo64 +# endif +# if !defined PRIuLEAST64 || @PRI_MACROS_BROKEN@ +# undef PRIuLEAST64 +# define PRIuLEAST64 PRIu64 +# endif +# if !defined PRIxLEAST64 || @PRI_MACROS_BROKEN@ +# undef PRIxLEAST64 +# define PRIxLEAST64 PRIx64 +# endif +# if !defined PRIXLEAST64 || @PRI_MACROS_BROKEN@ +# undef PRIXLEAST64 +# define PRIXLEAST64 PRIX64 +# endif +#endif + +#if !defined PRIdFAST8 || @PRI_MACROS_BROKEN@ +# undef PRIdFAST8 +# if INT_FAST8_MAX > INT32_MAX +# define PRIdFAST8 PRId64 +# else +# define PRIdFAST8 "d" +# endif +#endif +#if !defined PRIiFAST8 || @PRI_MACROS_BROKEN@ +# undef PRIiFAST8 +# if INT_FAST8_MAX > INT32_MAX +# define PRIiFAST8 PRIi64 +# else +# define PRIiFAST8 "i" +# endif +#endif +#if !defined PRIoFAST8 || @PRI_MACROS_BROKEN@ +# undef PRIoFAST8 +# if UINT_FAST8_MAX > UINT32_MAX +# define PRIoFAST8 PRIo64 +# else +# define PRIoFAST8 "o" +# endif +#endif +#if !defined PRIuFAST8 || @PRI_MACROS_BROKEN@ +# undef PRIuFAST8 +# if UINT_FAST8_MAX > UINT32_MAX +# define PRIuFAST8 PRIu64 +# else +# define PRIuFAST8 "u" +# endif +#endif +#if !defined PRIxFAST8 || @PRI_MACROS_BROKEN@ +# undef PRIxFAST8 +# if UINT_FAST8_MAX > UINT32_MAX +# define PRIxFAST8 PRIx64 +# else +# define PRIxFAST8 "x" +# endif +#endif +#if !defined PRIXFAST8 || @PRI_MACROS_BROKEN@ +# undef PRIXFAST8 +# if UINT_FAST8_MAX > UINT32_MAX +# define PRIXFAST8 PRIX64 +# else +# define PRIXFAST8 "X" +# endif +#endif +#if !defined PRIdFAST16 || @PRI_MACROS_BROKEN@ +# undef PRIdFAST16 +# if INT_FAST16_MAX > INT32_MAX +# define PRIdFAST16 PRId64 +# else +# define PRIdFAST16 "d" +# endif +#endif +#if !defined PRIiFAST16 || @PRI_MACROS_BROKEN@ +# undef PRIiFAST16 +# if INT_FAST16_MAX > INT32_MAX +# define PRIiFAST16 PRIi64 +# else +# define PRIiFAST16 "i" +# endif +#endif +#if !defined PRIoFAST16 || @PRI_MACROS_BROKEN@ +# undef PRIoFAST16 +# if UINT_FAST16_MAX > UINT32_MAX +# define PRIoFAST16 PRIo64 +# else +# define PRIoFAST16 "o" +# endif +#endif +#if !defined PRIuFAST16 || @PRI_MACROS_BROKEN@ +# undef PRIuFAST16 +# if UINT_FAST16_MAX > UINT32_MAX +# define PRIuFAST16 PRIu64 +# else +# define PRIuFAST16 "u" +# endif +#endif +#if !defined PRIxFAST16 || @PRI_MACROS_BROKEN@ +# undef PRIxFAST16 +# if UINT_FAST16_MAX > UINT32_MAX +# define PRIxFAST16 PRIx64 +# else +# define PRIxFAST16 "x" +# endif +#endif +#if !defined PRIXFAST16 || @PRI_MACROS_BROKEN@ +# undef PRIXFAST16 +# if UINT_FAST16_MAX > UINT32_MAX +# define PRIXFAST16 PRIX64 +# else +# define PRIXFAST16 "X" +# endif +#endif +#if !defined PRIdFAST32 || @PRI_MACROS_BROKEN@ +# undef PRIdFAST32 +# if INT_FAST32_MAX > INT32_MAX +# define PRIdFAST32 PRId64 +# else +# define PRIdFAST32 "d" +# endif +#endif +#if !defined PRIiFAST32 || @PRI_MACROS_BROKEN@ +# undef PRIiFAST32 +# if INT_FAST32_MAX > INT32_MAX +# define PRIiFAST32 PRIi64 +# else +# define PRIiFAST32 "i" +# endif +#endif +#if !defined PRIoFAST32 || @PRI_MACROS_BROKEN@ +# undef PRIoFAST32 +# if UINT_FAST32_MAX > UINT32_MAX +# define PRIoFAST32 PRIo64 +# else +# define PRIoFAST32 "o" +# endif +#endif +#if !defined PRIuFAST32 || @PRI_MACROS_BROKEN@ +# undef PRIuFAST32 +# if UINT_FAST32_MAX > UINT32_MAX +# define PRIuFAST32 PRIu64 +# else +# define PRIuFAST32 "u" +# endif +#endif +#if !defined PRIxFAST32 || @PRI_MACROS_BROKEN@ +# undef PRIxFAST32 +# if UINT_FAST32_MAX > UINT32_MAX +# define PRIxFAST32 PRIx64 +# else +# define PRIxFAST32 "x" +# endif +#endif +#if !defined PRIXFAST32 || @PRI_MACROS_BROKEN@ +# undef PRIXFAST32 +# if UINT_FAST32_MAX > UINT32_MAX +# define PRIXFAST32 PRIX64 +# else +# define PRIXFAST32 "X" +# endif +#endif +#ifdef INT64_MAX +# if !defined PRIdFAST64 || @PRI_MACROS_BROKEN@ +# undef PRIdFAST64 +# define PRIdFAST64 PRId64 +# endif +# if !defined PRIiFAST64 || @PRI_MACROS_BROKEN@ +# undef PRIiFAST64 +# define PRIiFAST64 PRIi64 +# endif +#endif +#ifdef UINT64_MAX +# if !defined PRIoFAST64 || @PRI_MACROS_BROKEN@ +# undef PRIoFAST64 +# define PRIoFAST64 PRIo64 +# endif +# if !defined PRIuFAST64 || @PRI_MACROS_BROKEN@ +# undef PRIuFAST64 +# define PRIuFAST64 PRIu64 +# endif +# if !defined PRIxFAST64 || @PRI_MACROS_BROKEN@ +# undef PRIxFAST64 +# define PRIxFAST64 PRIx64 +# endif +# if !defined PRIXFAST64 || @PRI_MACROS_BROKEN@ +# undef PRIXFAST64 +# define PRIXFAST64 PRIX64 +# endif +#endif + +#if !defined PRIdMAX || @PRI_MACROS_BROKEN@ +# undef PRIdMAX +# if @INT32_MAX_LT_INTMAX_MAX@ +# define PRIdMAX PRId64 +# else +# define PRIdMAX "ld" +# endif +#endif +#if !defined PRIiMAX || @PRI_MACROS_BROKEN@ +# undef PRIiMAX +# if @INT32_MAX_LT_INTMAX_MAX@ +# define PRIiMAX PRIi64 +# else +# define PRIiMAX "li" +# endif +#endif +#if !defined PRIoMAX || @PRI_MACROS_BROKEN@ +# undef PRIoMAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ +# define PRIoMAX PRIo64 +# else +# define PRIoMAX "lo" +# endif +#endif +#if !defined PRIuMAX || @PRI_MACROS_BROKEN@ +# undef PRIuMAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ +# define PRIuMAX PRIu64 +# else +# define PRIuMAX "lu" +# endif +#endif +#if !defined PRIxMAX || @PRI_MACROS_BROKEN@ +# undef PRIxMAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ +# define PRIxMAX PRIx64 +# else +# define PRIxMAX "lx" +# endif +#endif +#if !defined PRIXMAX || @PRI_MACROS_BROKEN@ +# undef PRIXMAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ +# define PRIXMAX PRIX64 +# else +# define PRIXMAX "lX" +# endif +#endif + +#if !defined PRIdPTR || @PRI_MACROS_BROKEN@ +# undef PRIdPTR +# ifdef INTPTR_MAX +# define PRIdPTR @PRIPTR_PREFIX@ "d" +# endif +#endif +#if !defined PRIiPTR || @PRI_MACROS_BROKEN@ +# undef PRIiPTR +# ifdef INTPTR_MAX +# define PRIiPTR @PRIPTR_PREFIX@ "i" +# endif +#endif +#if !defined PRIoPTR || @PRI_MACROS_BROKEN@ +# undef PRIoPTR +# ifdef UINTPTR_MAX +# define PRIoPTR @PRIPTR_PREFIX@ "o" +# endif +#endif +#if !defined PRIuPTR || @PRI_MACROS_BROKEN@ +# undef PRIuPTR +# ifdef UINTPTR_MAX +# define PRIuPTR @PRIPTR_PREFIX@ "u" +# endif +#endif +#if !defined PRIxPTR || @PRI_MACROS_BROKEN@ +# undef PRIxPTR +# ifdef UINTPTR_MAX +# define PRIxPTR @PRIPTR_PREFIX@ "x" +# endif +#endif +#if !defined PRIXPTR || @PRI_MACROS_BROKEN@ +# undef PRIXPTR +# ifdef UINTPTR_MAX +# define PRIXPTR @PRIPTR_PREFIX@ "X" +# endif +#endif + +#if !defined SCNd8 || @PRI_MACROS_BROKEN@ +# undef SCNd8 +# ifdef INT8_MAX +# define SCNd8 "hhd" +# endif +#endif +#if !defined SCNi8 || @PRI_MACROS_BROKEN@ +# undef SCNi8 +# ifdef INT8_MAX +# define SCNi8 "hhi" +# endif +#endif +#if !defined SCNo8 || @PRI_MACROS_BROKEN@ +# undef SCNo8 +# ifdef UINT8_MAX +# define SCNo8 "hho" +# endif +#endif +#if !defined SCNu8 || @PRI_MACROS_BROKEN@ +# undef SCNu8 +# ifdef UINT8_MAX +# define SCNu8 "hhu" +# endif +#endif +#if !defined SCNx8 || @PRI_MACROS_BROKEN@ +# undef SCNx8 +# ifdef UINT8_MAX +# define SCNx8 "hhx" +# endif +#endif +#if !defined SCNd16 || @PRI_MACROS_BROKEN@ +# undef SCNd16 +# ifdef INT16_MAX +# define SCNd16 "hd" +# endif +#endif +#if !defined SCNi16 || @PRI_MACROS_BROKEN@ +# undef SCNi16 +# ifdef INT16_MAX +# define SCNi16 "hi" +# endif +#endif +#if !defined SCNo16 || @PRI_MACROS_BROKEN@ +# undef SCNo16 +# ifdef UINT16_MAX +# define SCNo16 "ho" +# endif +#endif +#if !defined SCNu16 || @PRI_MACROS_BROKEN@ +# undef SCNu16 +# ifdef UINT16_MAX +# define SCNu16 "hu" +# endif +#endif +#if !defined SCNx16 || @PRI_MACROS_BROKEN@ +# undef SCNx16 +# ifdef UINT16_MAX +# define SCNx16 "hx" +# endif +#endif +#if !defined SCNd32 || @PRI_MACROS_BROKEN@ +# undef SCNd32 +# ifdef INT32_MAX +# define SCNd32 "d" +# endif +#endif +#if !defined SCNi32 || @PRI_MACROS_BROKEN@ +# undef SCNi32 +# ifdef INT32_MAX +# define SCNi32 "i" +# endif +#endif +#if !defined SCNo32 || @PRI_MACROS_BROKEN@ +# undef SCNo32 +# ifdef UINT32_MAX +# define SCNo32 "o" +# endif +#endif +#if !defined SCNu32 || @PRI_MACROS_BROKEN@ +# undef SCNu32 +# ifdef UINT32_MAX +# define SCNu32 "u" +# endif +#endif +#if !defined SCNx32 || @PRI_MACROS_BROKEN@ +# undef SCNx32 +# ifdef UINT32_MAX +# define SCNx32 "x" +# endif +#endif +#ifdef INT64_MAX +# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@) +# define _SCN64_PREFIX "l" +# elif defined _MSC_VER || defined __MINGW32__ +# define _SCN64_PREFIX "I64" +# elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX +# endif +# if !defined SCNd64 || @PRI_MACROS_BROKEN@ +# undef SCNd64 +# define SCNd64 _SCN64_PREFIX "d" +# endif +# if !defined SCNi64 || @PRI_MACROS_BROKEN@ +# undef SCNi64 +# define SCNi64 _SCN64_PREFIX "i" +# endif +#endif +#ifdef UINT64_MAX +# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@) +# define _SCNu64_PREFIX "l" +# elif defined _MSC_VER || defined __MINGW32__ +# define _SCNu64_PREFIX "I64" +# elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX +# endif +# if !defined SCNo64 || @PRI_MACROS_BROKEN@ +# undef SCNo64 +# define SCNo64 _SCNu64_PREFIX "o" +# endif +# if !defined SCNu64 || @PRI_MACROS_BROKEN@ +# undef SCNu64 +# define SCNu64 _SCNu64_PREFIX "u" +# endif +# if !defined SCNx64 || @PRI_MACROS_BROKEN@ +# undef SCNx64 +# define SCNx64 _SCNu64_PREFIX "x" +# endif +#endif + +#if !defined SCNdLEAST8 || @PRI_MACROS_BROKEN@ +# undef SCNdLEAST8 +# define SCNdLEAST8 "hhd" +#endif +#if !defined SCNiLEAST8 || @PRI_MACROS_BROKEN@ +# undef SCNiLEAST8 +# define SCNiLEAST8 "hhi" +#endif +#if !defined SCNoLEAST8 || @PRI_MACROS_BROKEN@ +# undef SCNoLEAST8 +# define SCNoLEAST8 "hho" +#endif +#if !defined SCNuLEAST8 || @PRI_MACROS_BROKEN@ +# undef SCNuLEAST8 +# define SCNuLEAST8 "hhu" +#endif +#if !defined SCNxLEAST8 || @PRI_MACROS_BROKEN@ +# undef SCNxLEAST8 +# define SCNxLEAST8 "hhx" +#endif +#if !defined SCNdLEAST16 || @PRI_MACROS_BROKEN@ +# undef SCNdLEAST16 +# define SCNdLEAST16 "hd" +#endif +#if !defined SCNiLEAST16 || @PRI_MACROS_BROKEN@ +# undef SCNiLEAST16 +# define SCNiLEAST16 "hi" +#endif +#if !defined SCNoLEAST16 || @PRI_MACROS_BROKEN@ +# undef SCNoLEAST16 +# define SCNoLEAST16 "ho" +#endif +#if !defined SCNuLEAST16 || @PRI_MACROS_BROKEN@ +# undef SCNuLEAST16 +# define SCNuLEAST16 "hu" +#endif +#if !defined SCNxLEAST16 || @PRI_MACROS_BROKEN@ +# undef SCNxLEAST16 +# define SCNxLEAST16 "hx" +#endif +#if !defined SCNdLEAST32 || @PRI_MACROS_BROKEN@ +# undef SCNdLEAST32 +# define SCNdLEAST32 "d" +#endif +#if !defined SCNiLEAST32 || @PRI_MACROS_BROKEN@ +# undef SCNiLEAST32 +# define SCNiLEAST32 "i" +#endif +#if !defined SCNoLEAST32 || @PRI_MACROS_BROKEN@ +# undef SCNoLEAST32 +# define SCNoLEAST32 "o" +#endif +#if !defined SCNuLEAST32 || @PRI_MACROS_BROKEN@ +# undef SCNuLEAST32 +# define SCNuLEAST32 "u" +#endif +#if !defined SCNxLEAST32 || @PRI_MACROS_BROKEN@ +# undef SCNxLEAST32 +# define SCNxLEAST32 "x" +#endif +#ifdef INT64_MAX +# if !defined SCNdLEAST64 || @PRI_MACROS_BROKEN@ +# undef SCNdLEAST64 +# define SCNdLEAST64 SCNd64 +# endif +# if !defined SCNiLEAST64 || @PRI_MACROS_BROKEN@ +# undef SCNiLEAST64 +# define SCNiLEAST64 SCNi64 +# endif +#endif +#ifdef UINT64_MAX +# if !defined SCNoLEAST64 || @PRI_MACROS_BROKEN@ +# undef SCNoLEAST64 +# define SCNoLEAST64 SCNo64 +# endif +# if !defined SCNuLEAST64 || @PRI_MACROS_BROKEN@ +# undef SCNuLEAST64 +# define SCNuLEAST64 SCNu64 +# endif +# if !defined SCNxLEAST64 || @PRI_MACROS_BROKEN@ +# undef SCNxLEAST64 +# define SCNxLEAST64 SCNx64 +# endif +#endif + +#if !defined SCNdFAST8 || @PRI_MACROS_BROKEN@ +# undef SCNdFAST8 +# if INT_FAST8_MAX > INT32_MAX +# define SCNdFAST8 SCNd64 +# elif INT_FAST8_MAX == 0x7fff +# define SCNdFAST8 "hd" +# elif INT_FAST8_MAX == 0x7f +# define SCNdFAST8 "hhd" +# else +# define SCNdFAST8 "d" +# endif +#endif +#if !defined SCNiFAST8 || @PRI_MACROS_BROKEN@ +# undef SCNiFAST8 +# if INT_FAST8_MAX > INT32_MAX +# define SCNiFAST8 SCNi64 +# elif INT_FAST8_MAX == 0x7fff +# define SCNiFAST8 "hi" +# elif INT_FAST8_MAX == 0x7f +# define SCNiFAST8 "hhi" +# else +# define SCNiFAST8 "i" +# endif +#endif +#if !defined SCNoFAST8 || @PRI_MACROS_BROKEN@ +# undef SCNoFAST8 +# if UINT_FAST8_MAX > UINT32_MAX +# define SCNoFAST8 SCNo64 +# elif UINT_FAST8_MAX == 0xffff +# define SCNoFAST8 "ho" +# elif UINT_FAST8_MAX == 0xff +# define SCNoFAST8 "hho" +# else +# define SCNoFAST8 "o" +# endif +#endif +#if !defined SCNuFAST8 || @PRI_MACROS_BROKEN@ +# undef SCNuFAST8 +# if UINT_FAST8_MAX > UINT32_MAX +# define SCNuFAST8 SCNu64 +# elif UINT_FAST8_MAX == 0xffff +# define SCNuFAST8 "hu" +# elif UINT_FAST8_MAX == 0xff +# define SCNuFAST8 "hhu" +# else +# define SCNuFAST8 "u" +# endif +#endif +#if !defined SCNxFAST8 || @PRI_MACROS_BROKEN@ +# undef SCNxFAST8 +# if UINT_FAST8_MAX > UINT32_MAX +# define SCNxFAST8 SCNx64 +# elif UINT_FAST8_MAX == 0xffff +# define SCNxFAST8 "hx" +# elif UINT_FAST8_MAX == 0xff +# define SCNxFAST8 "hhx" +# else +# define SCNxFAST8 "x" +# endif +#endif +#if !defined SCNdFAST16 || @PRI_MACROS_BROKEN@ +# undef SCNdFAST16 +# if INT_FAST16_MAX > INT32_MAX +# define SCNdFAST16 SCNd64 +# elif INT_FAST16_MAX == 0x7fff +# define SCNdFAST16 "hd" +# else +# define SCNdFAST16 "d" +# endif +#endif +#if !defined SCNiFAST16 || @PRI_MACROS_BROKEN@ +# undef SCNiFAST16 +# if INT_FAST16_MAX > INT32_MAX +# define SCNiFAST16 SCNi64 +# elif INT_FAST16_MAX == 0x7fff +# define SCNiFAST16 "hi" +# else +# define SCNiFAST16 "i" +# endif +#endif +#if !defined SCNoFAST16 || @PRI_MACROS_BROKEN@ +# undef SCNoFAST16 +# if UINT_FAST16_MAX > UINT32_MAX +# define SCNoFAST16 SCNo64 +# elif UINT_FAST16_MAX == 0xffff +# define SCNoFAST16 "ho" +# else +# define SCNoFAST16 "o" +# endif +#endif +#if !defined SCNuFAST16 || @PRI_MACROS_BROKEN@ +# undef SCNuFAST16 +# if UINT_FAST16_MAX > UINT32_MAX +# define SCNuFAST16 SCNu64 +# elif UINT_FAST16_MAX == 0xffff +# define SCNuFAST16 "hu" +# else +# define SCNuFAST16 "u" +# endif +#endif +#if !defined SCNxFAST16 || @PRI_MACROS_BROKEN@ +# undef SCNxFAST16 +# if UINT_FAST16_MAX > UINT32_MAX +# define SCNxFAST16 SCNx64 +# elif UINT_FAST16_MAX == 0xffff +# define SCNxFAST16 "hx" +# else +# define SCNxFAST16 "x" +# endif +#endif +#if !defined SCNdFAST32 || @PRI_MACROS_BROKEN@ +# undef SCNdFAST32 +# if INT_FAST32_MAX > INT32_MAX +# define SCNdFAST32 SCNd64 +# else +# define SCNdFAST32 "d" +# endif +#endif +#if !defined SCNiFAST32 || @PRI_MACROS_BROKEN@ +# undef SCNiFAST32 +# if INT_FAST32_MAX > INT32_MAX +# define SCNiFAST32 SCNi64 +# else +# define SCNiFAST32 "i" +# endif +#endif +#if !defined SCNoFAST32 || @PRI_MACROS_BROKEN@ +# undef SCNoFAST32 +# if UINT_FAST32_MAX > UINT32_MAX +# define SCNoFAST32 SCNo64 +# else +# define SCNoFAST32 "o" +# endif +#endif +#if !defined SCNuFAST32 || @PRI_MACROS_BROKEN@ +# undef SCNuFAST32 +# if UINT_FAST32_MAX > UINT32_MAX +# define SCNuFAST32 SCNu64 +# else +# define SCNuFAST32 "u" +# endif +#endif +#if !defined SCNxFAST32 || @PRI_MACROS_BROKEN@ +# undef SCNxFAST32 +# if UINT_FAST32_MAX > UINT32_MAX +# define SCNxFAST32 SCNx64 +# else +# define SCNxFAST32 "x" +# endif +#endif +#ifdef INT64_MAX +# if !defined SCNdFAST64 || @PRI_MACROS_BROKEN@ +# undef SCNdFAST64 +# define SCNdFAST64 SCNd64 +# endif +# if !defined SCNiFAST64 || @PRI_MACROS_BROKEN@ +# undef SCNiFAST64 +# define SCNiFAST64 SCNi64 +# endif +#endif +#ifdef UINT64_MAX +# if !defined SCNoFAST64 || @PRI_MACROS_BROKEN@ +# undef SCNoFAST64 +# define SCNoFAST64 SCNo64 +# endif +# if !defined SCNuFAST64 || @PRI_MACROS_BROKEN@ +# undef SCNuFAST64 +# define SCNuFAST64 SCNu64 +# endif +# if !defined SCNxFAST64 || @PRI_MACROS_BROKEN@ +# undef SCNxFAST64 +# define SCNxFAST64 SCNx64 +# endif +#endif + +#if !defined SCNdMAX || @PRI_MACROS_BROKEN@ +# undef SCNdMAX +# if @INT32_MAX_LT_INTMAX_MAX@ +# define SCNdMAX SCNd64 +# else +# define SCNdMAX "ld" +# endif +#endif +#if !defined SCNiMAX || @PRI_MACROS_BROKEN@ +# undef SCNiMAX +# if @INT32_MAX_LT_INTMAX_MAX@ +# define SCNiMAX SCNi64 +# else +# define SCNiMAX "li" +# endif +#endif +#if !defined SCNoMAX || @PRI_MACROS_BROKEN@ +# undef SCNoMAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ +# define SCNoMAX SCNo64 +# else +# define SCNoMAX "lo" +# endif +#endif +#if !defined SCNuMAX || @PRI_MACROS_BROKEN@ +# undef SCNuMAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ +# define SCNuMAX SCNu64 +# else +# define SCNuMAX "lu" +# endif +#endif +#if !defined SCNxMAX || @PRI_MACROS_BROKEN@ +# undef SCNxMAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ +# define SCNxMAX SCNx64 +# else +# define SCNxMAX "lx" +# endif +#endif + +#if !defined SCNdPTR || @PRI_MACROS_BROKEN@ +# undef SCNdPTR +# ifdef INTPTR_MAX +# define SCNdPTR @PRIPTR_PREFIX@ "d" +# endif +#endif +#if !defined SCNiPTR || @PRI_MACROS_BROKEN@ +# undef SCNiPTR +# ifdef INTPTR_MAX +# define SCNiPTR @PRIPTR_PREFIX@ "i" +# endif +#endif +#if !defined SCNoPTR || @PRI_MACROS_BROKEN@ +# undef SCNoPTR +# ifdef UINTPTR_MAX +# define SCNoPTR @PRIPTR_PREFIX@ "o" +# endif +#endif +#if !defined SCNuPTR || @PRI_MACROS_BROKEN@ +# undef SCNuPTR +# ifdef UINTPTR_MAX +# define SCNuPTR @PRIPTR_PREFIX@ "u" +# endif +#endif +#if !defined SCNxPTR || @PRI_MACROS_BROKEN@ +# undef SCNxPTR +# ifdef UINTPTR_MAX +# define SCNxPTR @PRIPTR_PREFIX@ "x" +# endif +#endif + +/* 7.8.2 Functions for greatest-width integer types */ + +#ifdef __cplusplus +extern "C" { +#endif + +#if @GNULIB_IMAXABS@ +# if !@HAVE_DECL_IMAXABS@ +extern intmax_t imaxabs (intmax_t); +# endif +#elif defined GNULIB_POSIXCHECK +# undef imaxabs +# if HAVE_RAW_DECL_IMAXABS +_GL_WARN_ON_USE (imaxabs, "imaxabs is unportable - " + "use gnulib module imaxabs for portability"); +# endif +#endif + +#if @GNULIB_IMAXDIV@ +# if !@HAVE_DECL_IMAXDIV@ +# if !GNULIB_defined_imaxdiv_t +typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t; +# define GNULIB_defined_imaxdiv_t 1 +# endif +extern imaxdiv_t imaxdiv (intmax_t, intmax_t); +# endif +#elif defined GNULIB_POSIXCHECK +# undef imaxdiv +# if HAVE_RAW_DECL_IMAXDIV +_GL_WARN_ON_USE (imaxdiv, "imaxdiv is unportable - " + "use gnulib module imaxdiv for portability"); +# endif +#endif + +#if @GNULIB_STRTOIMAX@ +# if @REPLACE_STRTOIMAX@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strtoimax +# define strtoimax rpl_strtoimax +# endif +_GL_FUNCDECL_RPL (strtoimax, intmax_t, + (const char *, char **, int) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (strtoimax, intmax_t, (const char *, char **, int)); +# else +# if !@HAVE_DECL_STRTOIMAX@ +# undef strtoimax +_GL_FUNCDECL_SYS (strtoimax, intmax_t, + (const char *, char **, int) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (strtoimax, intmax_t, (const char *, char **, int)); +# endif +_GL_CXXALIASWARN (strtoimax); +#elif defined GNULIB_POSIXCHECK +# undef strtoimax +# if HAVE_RAW_DECL_STRTOIMAX +_GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - " + "use gnulib module strtoimax for portability"); +# endif +#endif + +#if @GNULIB_STRTOUMAX@ +# if @REPLACE_STRTOUMAX@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strtoumax +# define strtoumax rpl_strtoumax +# endif +_GL_FUNCDECL_RPL (strtoumax, uintmax_t, + (const char *, char **, int) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (strtoumax, uintmax_t, (const char *, char **, int)); +# else +# if !@HAVE_DECL_STRTOUMAX@ +# undef strtoumax +_GL_FUNCDECL_SYS (strtoumax, uintmax_t, + (const char *, char **, int) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (strtoumax, uintmax_t, (const char *, char **, int)); +# endif +_GL_CXXALIASWARN (strtoumax); +#elif defined GNULIB_POSIXCHECK +# undef strtoumax +# if HAVE_RAW_DECL_STRTOUMAX +_GL_WARN_ON_USE (strtoumax, "strtoumax is unportable - " + "use gnulib module strtoumax for portability"); +# endif +#endif + +/* Don't bother defining or declaring wcstoimax and wcstoumax, since + wide-character functions like this are hardly ever useful. */ + +#ifdef __cplusplus +} +#endif + +#endif /* !defined INTTYPES_H && !defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H */ diff --git a/local/recipes/tools/diffutils/source/lib/isblank.c b/local/recipes/tools/diffutils/source/lib/isblank.c new file mode 100644 index 0000000000..63ed962770 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/isblank.c @@ -0,0 +1,33 @@ +/* Test whether a character is a blank. + + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <ctype.h> + +int +isblank (int c) +{ + /* On all known platforms, in all predefined locales, isblank(c) is likely + equivalent with (c == ' ' || c == '\t'). Look at the glibc definition + (in glibc/localedata/locales/i18n): The "blank" characters are '\t', ' ', + U+1680, U+180E, U+2000..U+2006, U+2008..U+200A, U+205F, U+3000, and none + except the first two is present in a common 8-bit encoding. Therefore + the substitute for other platforms is not more complicated than this. */ + return (c == ' ' || c == '\t'); +} diff --git a/local/recipes/tools/diffutils/source/lib/iswblank.c b/local/recipes/tools/diffutils/source/lib/iswblank.c new file mode 100644 index 0000000000..14f459542d --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/iswblank.c @@ -0,0 +1,26 @@ +/* Test wide character for being blank. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <wctype.h> + +int +iswblank (wint_t wc) +{ + return wc == ' ' || wc == '\t'; +} diff --git a/local/recipes/tools/diffutils/source/lib/itold.c b/local/recipes/tools/diffutils/source/lib/itold.c new file mode 100644 index 0000000000..9eb9507f26 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/itold.c @@ -0,0 +1,28 @@ +/* Replacement for 'int' to 'long double' conversion routine. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2011. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <float.h> + +void +_Qp_itoq (long double *result, int a) +{ + /* Convert from 'int' to 'double', then from 'double' to 'long double'. */ + *result = (double) a; +} diff --git a/local/recipes/tools/diffutils/source/lib/langinfo.in.h b/local/recipes/tools/diffutils/source/lib/langinfo.in.h new file mode 100644 index 0000000000..7981cbf7be --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/langinfo.in.h @@ -0,0 +1,194 @@ +/* Substitute for and wrapper around <langinfo.h>. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* + * POSIX <langinfo.h> for platforms that lack it or have an incomplete one. + * <http://www.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html> + */ + +#ifndef _@GUARD_PREFIX@_LANGINFO_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_LANGINFO_H@ +# @INCLUDE_NEXT@ @NEXT_LANGINFO_H@ +#endif + +#ifndef _@GUARD_PREFIX@_LANGINFO_H +#define _@GUARD_PREFIX@_LANGINFO_H + + +#if !@HAVE_LANGINFO_H@ + +/* A platform that lacks <langinfo.h>. */ + +/* Assume that it also lacks <nl_types.h> and the nl_item type. */ +# if !GNULIB_defined_nl_item +typedef int nl_item; +# define GNULIB_defined_nl_item 1 +# endif + +/* nl_langinfo items of the LC_CTYPE category */ +# define CODESET 10000 +/* nl_langinfo items of the LC_NUMERIC category */ +# define RADIXCHAR 10001 +# define DECIMAL_POINT RADIXCHAR +# define THOUSEP 10002 +# define THOUSANDS_SEP THOUSEP +# define GROUPING 10114 +/* nl_langinfo items of the LC_TIME category */ +# define D_T_FMT 10003 +# define D_FMT 10004 +# define T_FMT 10005 +# define T_FMT_AMPM 10006 +# define AM_STR 10007 +# define PM_STR 10008 +# define DAY_1 10009 +# define DAY_2 (DAY_1 + 1) +# define DAY_3 (DAY_1 + 2) +# define DAY_4 (DAY_1 + 3) +# define DAY_5 (DAY_1 + 4) +# define DAY_6 (DAY_1 + 5) +# define DAY_7 (DAY_1 + 6) +# define ABDAY_1 10016 +# define ABDAY_2 (ABDAY_1 + 1) +# define ABDAY_3 (ABDAY_1 + 2) +# define ABDAY_4 (ABDAY_1 + 3) +# define ABDAY_5 (ABDAY_1 + 4) +# define ABDAY_6 (ABDAY_1 + 5) +# define ABDAY_7 (ABDAY_1 + 6) +# define MON_1 10023 +# define MON_2 (MON_1 + 1) +# define MON_3 (MON_1 + 2) +# define MON_4 (MON_1 + 3) +# define MON_5 (MON_1 + 4) +# define MON_6 (MON_1 + 5) +# define MON_7 (MON_1 + 6) +# define MON_8 (MON_1 + 7) +# define MON_9 (MON_1 + 8) +# define MON_10 (MON_1 + 9) +# define MON_11 (MON_1 + 10) +# define MON_12 (MON_1 + 11) +# define ABMON_1 10035 +# define ABMON_2 (ABMON_1 + 1) +# define ABMON_3 (ABMON_1 + 2) +# define ABMON_4 (ABMON_1 + 3) +# define ABMON_5 (ABMON_1 + 4) +# define ABMON_6 (ABMON_1 + 5) +# define ABMON_7 (ABMON_1 + 6) +# define ABMON_8 (ABMON_1 + 7) +# define ABMON_9 (ABMON_1 + 8) +# define ABMON_10 (ABMON_1 + 9) +# define ABMON_11 (ABMON_1 + 10) +# define ABMON_12 (ABMON_1 + 11) +# define ERA 10047 +# define ERA_D_FMT 10048 +# define ERA_D_T_FMT 10049 +# define ERA_T_FMT 10050 +# define ALT_DIGITS 10051 +/* nl_langinfo items of the LC_MONETARY category */ +# define CRNCYSTR 10052 +# define CURRENCY_SYMBOL CRNCYSTR +# define INT_CURR_SYMBOL 10100 +# define MON_DECIMAL_POINT 10101 +# define MON_THOUSANDS_SEP 10102 +# define MON_GROUPING 10103 +# define POSITIVE_SIGN 10104 +# define NEGATIVE_SIGN 10105 +# define FRAC_DIGITS 10106 +# define INT_FRAC_DIGITS 10107 +# define P_CS_PRECEDES 10108 +# define N_CS_PRECEDES 10109 +# define P_SEP_BY_SPACE 10110 +# define N_SEP_BY_SPACE 10111 +# define P_SIGN_POSN 10112 +# define N_SIGN_POSN 10113 +/* nl_langinfo items of the LC_MESSAGES category */ +# define YESEXPR 10053 +# define NOEXPR 10054 + +#else + +/* A platform that has <langinfo.h>. */ + +# if !@HAVE_LANGINFO_CODESET@ +# define CODESET 10000 +# define GNULIB_defined_CODESET 1 +# endif + +# if !@HAVE_LANGINFO_T_FMT_AMPM@ +# define T_FMT_AMPM 10006 +# define GNULIB_defined_T_FMT_AMPM 1 +# endif + +# if !@HAVE_LANGINFO_ERA@ +# define ERA 10047 +# define ERA_D_FMT 10048 +# define ERA_D_T_FMT 10049 +# define ERA_T_FMT 10050 +# define ALT_DIGITS 10051 +# define GNULIB_defined_ERA 1 +# endif + +# if !@HAVE_LANGINFO_YESEXPR@ +# define YESEXPR 10053 +# define NOEXPR 10054 +# define GNULIB_defined_YESEXPR 1 +# endif + +#endif + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +/* Declare overridden functions. */ + + +/* Return a piece of locale dependent information. + Note: The difference between nl_langinfo (CODESET) and locale_charset () + is that the latter normalizes the encoding names to GNU conventions. */ + +#if @GNULIB_NL_LANGINFO@ +# if @REPLACE_NL_LANGINFO@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef nl_langinfo +# define nl_langinfo rpl_nl_langinfo +# endif +_GL_FUNCDECL_RPL (nl_langinfo, char *, (nl_item item)); +_GL_CXXALIAS_RPL (nl_langinfo, char *, (nl_item item)); +# else +# if !@HAVE_NL_LANGINFO@ +_GL_FUNCDECL_SYS (nl_langinfo, char *, (nl_item item)); +# endif +_GL_CXXALIAS_SYS (nl_langinfo, char *, (nl_item item)); +# endif +_GL_CXXALIASWARN (nl_langinfo); +#elif defined GNULIB_POSIXCHECK +# undef nl_langinfo +# if HAVE_RAW_DECL_NL_LANGINFO +_GL_WARN_ON_USE (nl_langinfo, "nl_langinfo is not portable - " + "use gnulib module nl_langinfo for portability"); +# endif +#endif + + +#endif /* _@GUARD_PREFIX@_LANGINFO_H */ +#endif /* _@GUARD_PREFIX@_LANGINFO_H */ diff --git a/local/recipes/tools/diffutils/source/lib/limits.in.h b/local/recipes/tools/diffutils/source/lib/limits.in.h new file mode 100644 index 0000000000..08d3c328c4 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/limits.in.h @@ -0,0 +1,74 @@ +/* A GNU-like <limits.h>. + + Copyright 2016-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _@GUARD_PREFIX@_LIMITS_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_LIMITS_H@ + +#ifndef _@GUARD_PREFIX@_LIMITS_H +#define _@GUARD_PREFIX@_LIMITS_H + +/* For HP-UX 11.31. */ +#if defined LONG_LONG_MIN && !defined LLONG_MIN +# define LLONG_MIN LONG_LONG_MIN +#endif +#if defined LONG_LONG_MAX && !defined LLONG_MAX +# define LLONG_MAX LONG_LONG_MAX +#endif +#if defined ULONG_LONG_MAX && !defined ULLONG_MAX +# define ULLONG_MAX ULONG_LONG_MAX +#endif + +/* The number of usable bits in an unsigned or signed integer type + with minimum value MIN and maximum value MAX, as an int expression + suitable in #if. Cover all known practical hosts. This + implementation exploits the fact that MAX is 1 less than a power of + 2, and merely counts the number of 1 bits in MAX; "COBn" means + "count the number of 1 bits in the low-order n bits"). */ +#define _GL_INTEGER_WIDTH(min, max) (((min) < 0) + _GL_COB128 (max)) +#define _GL_COB128(n) (_GL_COB64 ((n) >> 31 >> 31 >> 2) + _GL_COB64 (n)) +#define _GL_COB64(n) (_GL_COB32 ((n) >> 31 >> 1) + _GL_COB32 (n)) +#define _GL_COB32(n) (_GL_COB16 ((n) >> 16) + _GL_COB16 (n)) +#define _GL_COB16(n) (_GL_COB8 ((n) >> 8) + _GL_COB8 (n)) +#define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n)) +#define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1)) + +/* Macros specified by ISO/IEC TS 18661-1:2014. */ + +#if (! defined ULLONG_WIDTH \ + && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__)) +# define CHAR_WIDTH _GL_INTEGER_WIDTH (CHAR_MIN, CHAR_MAX) +# define SCHAR_WIDTH _GL_INTEGER_WIDTH (SCHAR_MIN, SCHAR_MAX) +# define UCHAR_WIDTH _GL_INTEGER_WIDTH (0, UCHAR_MAX) +# define SHRT_WIDTH _GL_INTEGER_WIDTH (SHRT_MIN, SHRT_MAX) +# define USHRT_WIDTH _GL_INTEGER_WIDTH (0, USHRT_MAX) +# define INT_WIDTH _GL_INTEGER_WIDTH (INT_MIN, INT_MAX) +# define UINT_WIDTH _GL_INTEGER_WIDTH (0, UINT_MAX) +# define LONG_WIDTH _GL_INTEGER_WIDTH (LONG_MIN, LONG_MAX) +# define ULONG_WIDTH _GL_INTEGER_WIDTH (0, ULONG_MAX) +# define LLONG_WIDTH _GL_INTEGER_WIDTH (LLONG_MIN, LLONG_MAX) +# define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX) +#endif /* !ULLONG_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */ + +#endif /* _@GUARD_PREFIX@_LIMITS_H */ +#endif /* _@GUARD_PREFIX@_LIMITS_H */ diff --git a/local/recipes/tools/diffutils/source/lib/localcharset.c b/local/recipes/tools/diffutils/source/lib/localcharset.c new file mode 100644 index 0000000000..9b7e6cb745 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/localcharset.c @@ -0,0 +1,617 @@ +/* Determine a canonical name for the current locale's character encoding. + + Copyright (C) 2000-2006, 2008-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>. */ + +#include <config.h> + +/* Specification. */ +#include "localcharset.h" + +#include <fcntl.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + +#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET +# define DARWIN7 /* Darwin 7 or newer, i.e. Mac OS X 10.3 or newer */ +#endif + +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ +# define WINDOWS_NATIVE +# include <locale.h> +#endif + +#if defined __EMX__ +/* Assume EMX program runs on OS/2, even if compiled under DOS. */ +# ifndef OS2 +# define OS2 +# endif +#endif + +#if !defined WINDOWS_NATIVE +# include <unistd.h> +# if HAVE_LANGINFO_CODESET +# include <langinfo.h> +# else +# if 0 /* see comment below */ +# include <locale.h> +# endif +# endif +# ifdef __CYGWIN__ +# define WIN32_LEAN_AND_MEAN +# include <windows.h> +# endif +#elif defined WINDOWS_NATIVE +# define WIN32_LEAN_AND_MEAN +# include <windows.h> +#endif +#if defined OS2 +# define INCL_DOS +# include <os2.h> +#endif + +/* For MB_CUR_MAX_L */ +#if defined DARWIN7 +# include <xlocale.h> +#endif + +#if ENABLE_RELOCATABLE +# include "relocatable.h" +#else +# define relocate(pathname) (pathname) +# define relocate2(pathname,allocatedp) (*(allocatedp) = NULL, (pathname)) +#endif + +/* Get LIBDIR. */ +#ifndef LIBDIR +# include "configmake.h" +#endif + +/* Define O_NOFOLLOW to 0 on platforms where it does not exist. */ +#ifndef O_NOFOLLOW +# define O_NOFOLLOW 0 +#endif + +#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ + /* Native Windows, Cygwin, OS/2, DOS */ +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +#endif + +#ifndef DIRECTORY_SEPARATOR +# define DIRECTORY_SEPARATOR '/' +#endif + +#ifndef ISSLASH +# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR) +#endif + +#if HAVE_DECL_GETC_UNLOCKED +# undef getc +# define getc getc_unlocked +#endif + +/* The following static variable is declared 'volatile' to avoid a + possible multithread problem in the function get_charset_aliases. If we + are running in a threaded environment, and if two threads initialize + 'charset_aliases' simultaneously, both will produce the same value, + and everything will be ok if the two assignments to 'charset_aliases' + are atomic. But I don't know what will happen if the two assignments mix. */ +#if __STDC__ != 1 +# define volatile /* empty */ +#endif +/* Pointer to the contents of the charset.alias file, if it has already been + read, else NULL. Its format is: + ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */ +static const char * volatile charset_aliases; + +/* Return a pointer to the contents of the charset.alias file. */ +static const char * +get_charset_aliases (void) +{ + const char *cp; + + cp = charset_aliases; + if (cp == NULL) + { +#if !(defined DARWIN7 || defined VMS || defined WINDOWS_NATIVE || defined __CYGWIN__ || defined OS2) + char *malloc_dir = NULL; + const char *dir; + const char *base = "charset.alias"; + char *file_name; + + /* Make it possible to override the charset.alias location. This is + necessary for running the testsuite before "make install". */ + dir = getenv ("CHARSETALIASDIR"); + if (dir == NULL || dir[0] == '\0') + dir = relocate2 (LIBDIR, &malloc_dir); + + /* Concatenate dir and base into freshly allocated file_name. */ + { + size_t dir_len = strlen (dir); + size_t base_len = strlen (base); + int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1])); + file_name = (char *) malloc (dir_len + add_slash + base_len + 1); + if (file_name != NULL) + { + memcpy (file_name, dir, dir_len); + if (add_slash) + file_name[dir_len] = DIRECTORY_SEPARATOR; + memcpy (file_name + dir_len + add_slash, base, base_len + 1); + } + } + + free (malloc_dir); + + if (file_name == NULL) + /* Out of memory. Treat the file as empty. */ + cp = ""; + else + { + int fd; + + /* Open the file. Reject symbolic links on platforms that support + O_NOFOLLOW. This is a security feature. Without it, an attacker + could retrieve parts of the contents (namely, the tail of the + first line that starts with "* ") of an arbitrary file by placing + a symbolic link to that file under the name "charset.alias" in + some writable directory and defining the environment variable + CHARSETALIASDIR to point to that directory. */ + fd = open (file_name, + O_RDONLY | (HAVE_WORKING_O_NOFOLLOW ? O_NOFOLLOW : 0)); + if (fd < 0) + /* File not found. Treat it as empty. */ + cp = ""; + else + { + FILE *fp; + + fp = fdopen (fd, "r"); + if (fp == NULL) + { + /* Out of memory. Treat the file as empty. */ + close (fd); + cp = ""; + } + else + { + /* Parse the file's contents. */ + char *res_ptr = NULL; + size_t res_size = 0; + + for (;;) + { + int c; + char buf1[50+1]; + char buf2[50+1]; + size_t l1, l2; + char *old_res_ptr; + + c = getc (fp); + if (c == EOF) + break; + if (c == '\n' || c == ' ' || c == '\t') + continue; + if (c == '#') + { + /* Skip comment, to end of line. */ + do + c = getc (fp); + while (!(c == EOF || c == '\n')); + if (c == EOF) + break; + continue; + } + ungetc (c, fp); + if (fscanf (fp, "%50s %50s", buf1, buf2) < 2) + break; + l1 = strlen (buf1); + l2 = strlen (buf2); + old_res_ptr = res_ptr; + if (res_size == 0) + { + res_size = l1 + 1 + l2 + 1; + res_ptr = (char *) malloc (res_size + 1); + } + else + { + res_size += l1 + 1 + l2 + 1; + res_ptr = (char *) realloc (res_ptr, res_size + 1); + } + if (res_ptr == NULL) + { + /* Out of memory. */ + res_size = 0; + free (old_res_ptr); + break; + } + strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1); + strcpy (res_ptr + res_size - (l2 + 1), buf2); + } + fclose (fp); + if (res_size == 0) + cp = ""; + else + { + *(res_ptr + res_size) = '\0'; + cp = res_ptr; + } + } + } + + free (file_name); + } + +#else + +# if defined DARWIN7 + /* To avoid the trouble of installing a file that is shared by many + GNU packages -- many packaging systems have problems with this --, + simply inline the aliases here. */ + cp = "ISO8859-1" "\0" "ISO-8859-1" "\0" + "ISO8859-2" "\0" "ISO-8859-2" "\0" + "ISO8859-4" "\0" "ISO-8859-4" "\0" + "ISO8859-5" "\0" "ISO-8859-5" "\0" + "ISO8859-7" "\0" "ISO-8859-7" "\0" + "ISO8859-9" "\0" "ISO-8859-9" "\0" + "ISO8859-13" "\0" "ISO-8859-13" "\0" + "ISO8859-15" "\0" "ISO-8859-15" "\0" + "KOI8-R" "\0" "KOI8-R" "\0" + "KOI8-U" "\0" "KOI8-U" "\0" + "CP866" "\0" "CP866" "\0" + "CP949" "\0" "CP949" "\0" + "CP1131" "\0" "CP1131" "\0" + "CP1251" "\0" "CP1251" "\0" + "eucCN" "\0" "GB2312" "\0" + "GB2312" "\0" "GB2312" "\0" + "eucJP" "\0" "EUC-JP" "\0" + "eucKR" "\0" "EUC-KR" "\0" + "Big5" "\0" "BIG5" "\0" + "Big5HKSCS" "\0" "BIG5-HKSCS" "\0" + "GBK" "\0" "GBK" "\0" + "GB18030" "\0" "GB18030" "\0" + "SJIS" "\0" "SHIFT_JIS" "\0" + "ARMSCII-8" "\0" "ARMSCII-8" "\0" + "PT154" "\0" "PT154" "\0" + /*"ISCII-DEV" "\0" "?" "\0"*/ + "*" "\0" "UTF-8" "\0"; +# endif + +# if defined VMS + /* To avoid the troubles of an extra file charset.alias_vms in the + sources of many GNU packages, simply inline the aliases here. */ + /* The list of encodings is taken from the OpenVMS 7.3-1 documentation + "Compaq C Run-Time Library Reference Manual for OpenVMS systems" + section 10.7 "Handling Different Character Sets". */ + cp = "ISO8859-1" "\0" "ISO-8859-1" "\0" + "ISO8859-2" "\0" "ISO-8859-2" "\0" + "ISO8859-5" "\0" "ISO-8859-5" "\0" + "ISO8859-7" "\0" "ISO-8859-7" "\0" + "ISO8859-8" "\0" "ISO-8859-8" "\0" + "ISO8859-9" "\0" "ISO-8859-9" "\0" + /* Japanese */ + "eucJP" "\0" "EUC-JP" "\0" + "SJIS" "\0" "SHIFT_JIS" "\0" + "DECKANJI" "\0" "DEC-KANJI" "\0" + "SDECKANJI" "\0" "EUC-JP" "\0" + /* Chinese */ + "eucTW" "\0" "EUC-TW" "\0" + "DECHANYU" "\0" "DEC-HANYU" "\0" + "DECHANZI" "\0" "GB2312" "\0" + /* Korean */ + "DECKOREAN" "\0" "EUC-KR" "\0"; +# endif + +# if defined WINDOWS_NATIVE || defined __CYGWIN__ + /* To avoid the troubles of installing a separate file in the same + directory as the DLL and of retrieving the DLL's directory at + runtime, simply inline the aliases here. */ + + cp = "CP936" "\0" "GBK" "\0" + "CP1361" "\0" "JOHAB" "\0" + "CP20127" "\0" "ASCII" "\0" + "CP20866" "\0" "KOI8-R" "\0" + "CP20936" "\0" "GB2312" "\0" + "CP21866" "\0" "KOI8-RU" "\0" + "CP28591" "\0" "ISO-8859-1" "\0" + "CP28592" "\0" "ISO-8859-2" "\0" + "CP28593" "\0" "ISO-8859-3" "\0" + "CP28594" "\0" "ISO-8859-4" "\0" + "CP28595" "\0" "ISO-8859-5" "\0" + "CP28596" "\0" "ISO-8859-6" "\0" + "CP28597" "\0" "ISO-8859-7" "\0" + "CP28598" "\0" "ISO-8859-8" "\0" + "CP28599" "\0" "ISO-8859-9" "\0" + "CP28605" "\0" "ISO-8859-15" "\0" + "CP38598" "\0" "ISO-8859-8" "\0" + "CP51932" "\0" "EUC-JP" "\0" + "CP51936" "\0" "GB2312" "\0" + "CP51949" "\0" "EUC-KR" "\0" + "CP51950" "\0" "EUC-TW" "\0" + "CP54936" "\0" "GB18030" "\0" + "CP65001" "\0" "UTF-8" "\0"; +# endif +# if defined OS2 + /* To avoid the troubles of installing a separate file in the same + directory as the DLL and of retrieving the DLL's directory at + runtime, simply inline the aliases here. */ + + /* The list of encodings is taken from "List of OS/2 Codepages" + by Alex Taylor: + <http://altsan.org/os2/toolkits/uls/index.html#codepages>. + See also "IBM Globalization - Code page identifiers": + <http://www-01.ibm.com/software/globalization/cp/cp_cpgid.html>. */ + cp = "CP813" "\0" "ISO-8859-7" "\0" + "CP878" "\0" "KOI8-R" "\0" + "CP819" "\0" "ISO-8859-1" "\0" + "CP912" "\0" "ISO-8859-2" "\0" + "CP913" "\0" "ISO-8859-3" "\0" + "CP914" "\0" "ISO-8859-4" "\0" + "CP915" "\0" "ISO-8859-5" "\0" + "CP916" "\0" "ISO-8859-8" "\0" + "CP920" "\0" "ISO-8859-9" "\0" + "CP921" "\0" "ISO-8859-13" "\0" + "CP923" "\0" "ISO-8859-15" "\0" + "CP954" "\0" "EUC-JP" "\0" + "CP964" "\0" "EUC-TW" "\0" + "CP970" "\0" "EUC-KR" "\0" + "CP1089" "\0" "ISO-8859-6" "\0" + "CP1208" "\0" "UTF-8" "\0" + "CP1381" "\0" "GB2312" "\0" + "CP1386" "\0" "GBK" "\0" + "CP3372" "\0" "EUC-JP" "\0"; +# endif +#endif + + charset_aliases = cp; + } + + return cp; +} + +/* Determine the current locale's character encoding, and canonicalize it + into one of the canonical names listed in config.charset. + The result must not be freed; it is statically allocated. + If the canonical name cannot be determined, the result is a non-canonical + name. */ + +#ifdef STATIC +STATIC +#endif +const char * +locale_charset (void) +{ + const char *codeset; + const char *aliases; + +#if !(defined WINDOWS_NATIVE || defined OS2) + +# if HAVE_LANGINFO_CODESET + + /* Most systems support nl_langinfo (CODESET) nowadays. */ + codeset = nl_langinfo (CODESET); + +# ifdef __CYGWIN__ + /* Cygwin < 1.7 does not have locales. nl_langinfo (CODESET) always + returns "US-ASCII". Return the suffix of the locale name from the + environment variables (if present) or the codepage as a number. */ + if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0) + { + const char *locale; + static char buf[2 + 10 + 1]; + + locale = getenv ("LC_ALL"); + if (locale == NULL || locale[0] == '\0') + { + locale = getenv ("LC_CTYPE"); + if (locale == NULL || locale[0] == '\0') + locale = getenv ("LANG"); + } + if (locale != NULL && locale[0] != '\0') + { + /* If the locale name contains an encoding after the dot, return + it. */ + const char *dot = strchr (locale, '.'); + + if (dot != NULL) + { + const char *modifier; + + dot++; + /* Look for the possible @... trailer and remove it, if any. */ + modifier = strchr (dot, '@'); + if (modifier == NULL) + return dot; + if (modifier - dot < sizeof (buf)) + { + memcpy (buf, dot, modifier - dot); + buf [modifier - dot] = '\0'; + return buf; + } + } + } + + /* The Windows API has a function returning the locale's codepage as a + number: GetACP(). This encoding is used by Cygwin, unless the user + has set the environment variable CYGWIN=codepage:oem (which very few + people do). + Output directed to console windows needs to be converted (to + GetOEMCP() if the console is using a raster font, or to + GetConsoleOutputCP() if it is using a TrueType font). Cygwin does + this conversion transparently (see winsup/cygwin/fhandler_console.cc), + converting to GetConsoleOutputCP(). This leads to correct results, + except when SetConsoleOutputCP has been called and a raster font is + in use. */ + sprintf (buf, "CP%u", GetACP ()); + codeset = buf; + } +# endif + +# else + + /* On old systems which lack it, use setlocale or getenv. */ + const char *locale = NULL; + + /* But most old systems don't have a complete set of locales. Some + (like SunOS 4 or DJGPP) have only the C locale. Therefore we don't + use setlocale here; it would return "C" when it doesn't support the + locale name the user has set. */ +# if 0 + locale = setlocale (LC_CTYPE, NULL); +# endif + if (locale == NULL || locale[0] == '\0') + { + locale = getenv ("LC_ALL"); + if (locale == NULL || locale[0] == '\0') + { + locale = getenv ("LC_CTYPE"); + if (locale == NULL || locale[0] == '\0') + locale = getenv ("LANG"); + } + } + + /* On some old systems, one used to set locale = "iso8859_1". On others, + you set it to "language_COUNTRY.charset". In any case, we resolve it + through the charset.alias file. */ + codeset = locale; + +# endif + +#elif defined WINDOWS_NATIVE + + static char buf[2 + 10 + 1]; + + /* The Windows API has a function returning the locale's codepage as + a number, but the value doesn't change according to what the + 'setlocale' call specified. So we use it as a last resort, in + case the string returned by 'setlocale' doesn't specify the + codepage. */ + char *current_locale = setlocale (LC_ALL, NULL); + char *pdot; + + /* If they set different locales for different categories, + 'setlocale' will return a semi-colon separated list of locale + values. To make sure we use the correct one, we choose LC_CTYPE. */ + if (strchr (current_locale, ';')) + current_locale = setlocale (LC_CTYPE, NULL); + + pdot = strrchr (current_locale, '.'); + if (pdot && 2 + strlen (pdot + 1) + 1 <= sizeof (buf)) + sprintf (buf, "CP%s", pdot + 1); + else + { + /* The Windows API has a function returning the locale's codepage as a + number: GetACP(). + When the output goes to a console window, it needs to be provided in + GetOEMCP() encoding if the console is using a raster font, or in + GetConsoleOutputCP() encoding if it is using a TrueType font. + But in GUI programs and for output sent to files and pipes, GetACP() + encoding is the best bet. */ + sprintf (buf, "CP%u", GetACP ()); + } + codeset = buf; + +#elif defined OS2 + + const char *locale; + static char buf[2 + 10 + 1]; + ULONG cp[3]; + ULONG cplen; + + codeset = NULL; + + /* Allow user to override the codeset, as set in the operating system, + with standard language environment variables. */ + locale = getenv ("LC_ALL"); + if (locale == NULL || locale[0] == '\0') + { + locale = getenv ("LC_CTYPE"); + if (locale == NULL || locale[0] == '\0') + locale = getenv ("LANG"); + } + if (locale != NULL && locale[0] != '\0') + { + /* If the locale name contains an encoding after the dot, return it. */ + const char *dot = strchr (locale, '.'); + + if (dot != NULL) + { + const char *modifier; + + dot++; + /* Look for the possible @... trailer and remove it, if any. */ + modifier = strchr (dot, '@'); + if (modifier == NULL) + return dot; + if (modifier - dot < sizeof (buf)) + { + memcpy (buf, dot, modifier - dot); + buf [modifier - dot] = '\0'; + return buf; + } + } + + /* For the POSIX locale, don't use the system's codepage. */ + if (strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0) + codeset = ""; + } + + if (codeset == NULL) + { + /* OS/2 has a function returning the locale's codepage as a number. */ + if (DosQueryCp (sizeof (cp), cp, &cplen)) + codeset = ""; + else + { + sprintf (buf, "CP%u", cp[0]); + codeset = buf; + } + } + +#endif + + if (codeset == NULL) + /* The canonical name cannot be determined. */ + codeset = ""; + + /* Resolve alias. */ + for (aliases = get_charset_aliases (); + *aliases != '\0'; + aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1) + if (strcmp (codeset, aliases) == 0 + || (aliases[0] == '*' && aliases[1] == '\0')) + { + codeset = aliases + strlen (aliases) + 1; + break; + } + + /* Don't return an empty string. GNU libc and GNU libiconv interpret + the empty string as denoting "the locale's character encoding", + thus GNU libiconv would call this function a second time. */ + if (codeset[0] == '\0') + codeset = "ASCII"; + +#ifdef DARWIN7 + /* Mac OS X sets MB_CUR_MAX to 1 when LC_ALL=C, and "UTF-8" + (the default codeset) does not work when MB_CUR_MAX is 1. */ + if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX_L (uselocale (NULL)) <= 1) + codeset = "ASCII"; +#endif + + return codeset; +} diff --git a/local/recipes/tools/diffutils/source/lib/localcharset.h b/local/recipes/tools/diffutils/source/lib/localcharset.h new file mode 100644 index 0000000000..a2e2a7be46 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/localcharset.h @@ -0,0 +1,40 @@ +/* Determine a canonical name for the current locale's character encoding. + Copyright (C) 2000-2003, 2009-2017 Free Software Foundation, Inc. + This file is part of the GNU CHARSET Library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _LOCALCHARSET_H +#define _LOCALCHARSET_H + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Determine the current locale's character encoding, and canonicalize it + into one of the canonical names listed in config.charset. + The result must not be freed; it is statically allocated. + If the canonical name cannot be determined, the result is a non-canonical + name. */ +extern const char * locale_charset (void); + + +#ifdef __cplusplus +} +#endif + + +#endif /* _LOCALCHARSET_H */ diff --git a/local/recipes/tools/diffutils/source/lib/locale.in.h b/local/recipes/tools/diffutils/source/lib/locale.in.h new file mode 100644 index 0000000000..9eb43f987c --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/locale.in.h @@ -0,0 +1,216 @@ +/* A POSIX <locale.h>. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#ifdef _GL_ALREADY_INCLUDING_LOCALE_H + +/* Special invocation conventions to handle Solaris header files + (through Solaris 10) when combined with gettext's libintl.h. */ + +#@INCLUDE_NEXT@ @NEXT_LOCALE_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_LOCALE_H + +#define _GL_ALREADY_INCLUDING_LOCALE_H + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_LOCALE_H@ + +#undef _GL_ALREADY_INCLUDING_LOCALE_H + +#ifndef _@GUARD_PREFIX@_LOCALE_H +#define _@GUARD_PREFIX@_LOCALE_H + +/* NetBSD 5.0 mis-defines NULL. */ +#include <stddef.h> + +/* Mac OS X 10.5 defines the locale_t type in <xlocale.h>. */ +#if @HAVE_XLOCALE_H@ +# include <xlocale.h> +#endif + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +/* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C. + On systems that don't define it, use the same value as GNU libintl. */ +#if !defined LC_MESSAGES +# define LC_MESSAGES 1729 +#endif + +/* Bionic libc's 'struct lconv' is just a dummy. */ +#if @REPLACE_STRUCT_LCONV@ +# define lconv rpl_lconv +struct lconv +{ + /* All 'char *' are actually 'const char *'. */ + + /* Members that depend on the LC_NUMERIC category of the locale. See + <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_04> */ + + /* Symbol used as decimal point. */ + char *decimal_point; + /* Symbol used to separate groups of digits to the left of the decimal + point. */ + char *thousands_sep; + /* Definition of the size of groups of digits to the left of the decimal + point. */ + char *grouping; + + /* Members that depend on the LC_MONETARY category of the locale. See + <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_03> */ + + /* Symbol used as decimal point. */ + char *mon_decimal_point; + /* Symbol used to separate groups of digits to the left of the decimal + point. */ + char *mon_thousands_sep; + /* Definition of the size of groups of digits to the left of the decimal + point. */ + char *mon_grouping; + /* Sign used to indicate a value >= 0. */ + char *positive_sign; + /* Sign used to indicate a value < 0. */ + char *negative_sign; + + /* For formatting local currency. */ + /* Currency symbol (3 characters) followed by separator (1 character). */ + char *currency_symbol; + /* Number of digits after the decimal point. */ + char frac_digits; + /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it + comes after the number. */ + char p_cs_precedes; + /* For values >= 0: Position of the sign. */ + char p_sign_posn; + /* For values >= 0: Placement of spaces between currency symbol, sign, and + number. */ + char p_sep_by_space; + /* For values < 0: 1 if the currency symbol precedes the number, 0 if it + comes after the number. */ + char n_cs_precedes; + /* For values < 0: Position of the sign. */ + char n_sign_posn; + /* For values < 0: Placement of spaces between currency symbol, sign, and + number. */ + char n_sep_by_space; + + /* For formatting international currency. */ + /* Currency symbol (3 characters) followed by separator (1 character). */ + char *int_curr_symbol; + /* Number of digits after the decimal point. */ + char int_frac_digits; + /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it + comes after the number. */ + char int_p_cs_precedes; + /* For values >= 0: Position of the sign. */ + char int_p_sign_posn; + /* For values >= 0: Placement of spaces between currency symbol, sign, and + number. */ + char int_p_sep_by_space; + /* For values < 0: 1 if the currency symbol precedes the number, 0 if it + comes after the number. */ + char int_n_cs_precedes; + /* For values < 0: Position of the sign. */ + char int_n_sign_posn; + /* For values < 0: Placement of spaces between currency symbol, sign, and + number. */ + char int_n_sep_by_space; +}; +#endif + +#if @GNULIB_LOCALECONV@ +# if @REPLACE_LOCALECONV@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef localeconv +# define localeconv rpl_localeconv +# endif +_GL_FUNCDECL_RPL (localeconv, struct lconv *, (void)); +_GL_CXXALIAS_RPL (localeconv, struct lconv *, (void)); +# else +_GL_CXXALIAS_SYS (localeconv, struct lconv *, (void)); +# endif +_GL_CXXALIASWARN (localeconv); +#elif @REPLACE_STRUCT_LCONV@ +# undef localeconv +# define localeconv localeconv_used_without_requesting_gnulib_module_localeconv +#elif defined GNULIB_POSIXCHECK +# undef localeconv +# if HAVE_RAW_DECL_LOCALECONV +_GL_WARN_ON_USE (localeconv, + "localeconv returns too few information on some platforms - " + "use gnulib module localeconv for portability"); +# endif +#endif + +#if @GNULIB_SETLOCALE@ +# if @REPLACE_SETLOCALE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef setlocale +# define setlocale rpl_setlocale +# define GNULIB_defined_setlocale 1 +# endif +_GL_FUNCDECL_RPL (setlocale, char *, (int category, const char *locale)); +_GL_CXXALIAS_RPL (setlocale, char *, (int category, const char *locale)); +# else +_GL_CXXALIAS_SYS (setlocale, char *, (int category, const char *locale)); +# endif +_GL_CXXALIASWARN (setlocale); +#elif defined GNULIB_POSIXCHECK +# undef setlocale +# if HAVE_RAW_DECL_SETLOCALE +_GL_WARN_ON_USE (setlocale, "setlocale works differently on native Windows - " + "use gnulib module setlocale for portability"); +# endif +#endif + +#if @GNULIB_DUPLOCALE@ +# if @REPLACE_DUPLOCALE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef duplocale +# define duplocale rpl_duplocale +# endif +_GL_FUNCDECL_RPL (duplocale, locale_t, (locale_t locale) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (duplocale, locale_t, (locale_t locale)); +# else +# if @HAVE_DUPLOCALE@ +_GL_CXXALIAS_SYS (duplocale, locale_t, (locale_t locale)); +# endif +# endif +# if @HAVE_DUPLOCALE@ +_GL_CXXALIASWARN (duplocale); +# endif +#elif defined GNULIB_POSIXCHECK +# undef duplocale +# if HAVE_RAW_DECL_DUPLOCALE +_GL_WARN_ON_USE (duplocale, "duplocale is buggy on some glibc systems - " + "use gnulib module duplocale for portability"); +# endif +#endif + +#endif /* _@GUARD_PREFIX@_LOCALE_H */ +#endif /* ! _GL_ALREADY_INCLUDING_LOCALE_H */ +#endif /* _@GUARD_PREFIX@_LOCALE_H */ diff --git a/local/recipes/tools/diffutils/source/lib/localeconv.c b/local/recipes/tools/diffutils/source/lib/localeconv.c new file mode 100644 index 0000000000..bc1960b9b2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/localeconv.c @@ -0,0 +1,103 @@ +/* Query locale dependent information for formatting numbers. + Copyright (C) 2012-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <locale.h> + +#if HAVE_STRUCT_LCONV_DECIMAL_POINT + +/* Override for platforms where 'struct lconv' lacks the int_p_*, int_n_* + members. */ + +struct lconv * +localeconv (void) +{ + static struct lconv result; +# undef lconv +# undef localeconv + struct lconv *sys_result = localeconv (); + + result.decimal_point = sys_result->decimal_point; + result.thousands_sep = sys_result->thousands_sep; + result.grouping = sys_result->grouping; + result.mon_decimal_point = sys_result->mon_decimal_point; + result.mon_thousands_sep = sys_result->mon_thousands_sep; + result.mon_grouping = sys_result->mon_grouping; + result.positive_sign = sys_result->positive_sign; + result.negative_sign = sys_result->negative_sign; + result.currency_symbol = sys_result->currency_symbol; + result.frac_digits = sys_result->frac_digits; + result.p_cs_precedes = sys_result->p_cs_precedes; + result.p_sign_posn = sys_result->p_sign_posn; + result.p_sep_by_space = sys_result->p_sep_by_space; + result.n_cs_precedes = sys_result->n_cs_precedes; + result.n_sign_posn = sys_result->n_sign_posn; + result.n_sep_by_space = sys_result->n_sep_by_space; + result.int_curr_symbol = sys_result->int_curr_symbol; + result.int_frac_digits = sys_result->int_frac_digits; + result.int_p_cs_precedes = sys_result->p_cs_precedes; + result.int_p_sign_posn = sys_result->p_sign_posn; + result.int_p_sep_by_space = sys_result->p_sep_by_space; + result.int_n_cs_precedes = sys_result->n_cs_precedes; + result.int_n_sign_posn = sys_result->n_sign_posn; + result.int_n_sep_by_space = sys_result->n_sep_by_space; + + return &result; +} + +#else + +/* Override for platforms where 'struct lconv' is a dummy. */ + +# include <limits.h> + +struct lconv * +localeconv (void) +{ + static /*const*/ struct lconv result = + { + /* decimal_point */ ".", + /* thousands_sep */ "", + /* grouping */ "", + /* mon_decimal_point */ "", + /* mon_thousands_sep */ "", + /* mon_grouping */ "", + /* positive_sign */ "", + /* negative_sign */ "", + /* currency_symbol */ "", + /* frac_digits */ CHAR_MAX, + /* p_cs_precedes */ CHAR_MAX, + /* p_sign_posn */ CHAR_MAX, + /* p_sep_by_space */ CHAR_MAX, + /* n_cs_precedes */ CHAR_MAX, + /* n_sign_posn */ CHAR_MAX, + /* n_sep_by_space */ CHAR_MAX, + /* int_curr_symbol */ "", + /* int_frac_digits */ CHAR_MAX, + /* int_p_cs_precedes */ CHAR_MAX, + /* int_p_sign_posn */ CHAR_MAX, + /* int_p_sep_by_space */ CHAR_MAX, + /* int_n_cs_precedes */ CHAR_MAX, + /* int_n_sign_posn */ CHAR_MAX, + /* int_n_sep_by_space */ CHAR_MAX + }; + + return &result; +} + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/localtime-buffer.c b/local/recipes/tools/diffutils/source/lib/localtime-buffer.c new file mode 100644 index 0000000000..f84ad3e823 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/localtime-buffer.c @@ -0,0 +1,58 @@ +/* Provide access to the last buffer returned by localtime() or gmtime(). + + Copyright (C) 2001-2003, 2005-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* written by Jim Meyering */ + +#include <config.h> + +/* Specification. */ +#include "localtime-buffer.h" + +#if GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME + +static struct tm tm_zero_buffer; +struct tm *localtime_buffer_addr = &tm_zero_buffer; + +/* This is a wrapper for localtime. + + On the first call, record the address of the static buffer that + localtime uses for its result. */ + +struct tm * +rpl_localtime (time_t const *timep) +{ + struct tm *tm = localtime (timep); + + if (localtime_buffer_addr == &tm_zero_buffer) + localtime_buffer_addr = tm; + + return tm; +} + +/* Same as above, since gmtime and localtime use the same buffer. */ +struct tm * +rpl_gmtime (time_t const *timep) +{ + struct tm *tm = gmtime (timep); + + if (localtime_buffer_addr == &tm_zero_buffer) + localtime_buffer_addr = tm; + + return tm; +} + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/localtime-buffer.h b/local/recipes/tools/diffutils/source/lib/localtime-buffer.h new file mode 100644 index 0000000000..483a579bda --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/localtime-buffer.h @@ -0,0 +1,27 @@ +/* Provide access to the last buffer returned by localtime() or gmtime(). + + Copyright (C) 2001-2003, 2005-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* written by Jim Meyering */ + +#include <time.h> + +#if GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME + +/* The address of the last buffer returned by localtime() or gmtime(). */ +extern struct tm *localtime_buffer_addr; + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/lstat.c b/local/recipes/tools/diffutils/source/lib/lstat.c new file mode 100644 index 0000000000..f4dc43ec64 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/lstat.c @@ -0,0 +1,97 @@ +/* Work around a bug of lstat on some systems + + Copyright (C) 1997-2006, 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* written by Jim Meyering */ + +/* If the user's config.h happens to include <sys/stat.h>, let it include only + the system's <sys/stat.h> here, so that orig_lstat doesn't recurse to + rpl_lstat. */ +#define __need_system_sys_stat_h +#include <config.h> + +#if !HAVE_LSTAT +/* On systems that lack symlinks, our replacement <sys/stat.h> already + defined lstat as stat, so there is nothing further to do other than + avoid an empty file. */ +typedef int dummy; +#else /* HAVE_LSTAT */ + +/* Get the original definition of lstat. It might be defined as a macro. */ +# include <sys/types.h> +# include <sys/stat.h> +# undef __need_system_sys_stat_h + +static int +orig_lstat (const char *filename, struct stat *buf) +{ + return lstat (filename, buf); +} + +/* Specification. */ +/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc + eliminates this include because of the preliminary #include <sys/stat.h> + above. */ +# include "sys/stat.h" + +# include <string.h> +# include <errno.h> + +/* lstat works differently on Linux and Solaris systems. POSIX (see + "pathname resolution" in the glossary) requires that programs like + 'ls' take into consideration the fact that FILE has a trailing slash + when FILE is a symbolic link. On Linux and Solaris 10 systems, the + lstat function already has the desired semantics (in treating + 'lstat ("symlink/", sbuf)' just like 'lstat ("symlink/.", sbuf)', + but on Solaris 9 and earlier it does not. + + If FILE has a trailing slash and specifies a symbolic link, + then use stat() to get more info on the referent of FILE. + If the referent is a non-directory, then set errno to ENOTDIR + and return -1. Otherwise, return stat's result. */ + +int +rpl_lstat (const char *file, struct stat *sbuf) +{ + size_t len; + int lstat_result = orig_lstat (file, sbuf); + + if (lstat_result != 0) + return lstat_result; + + /* This replacement file can blindly check against '/' rather than + using the ISSLASH macro, because all platforms with '\\' either + lack symlinks (mingw) or have working lstat (cygwin) and thus do + not compile this file. 0 len should have already been filtered + out above, with a failure return of ENOENT. */ + len = strlen (file); + if (file[len - 1] != '/' || S_ISDIR (sbuf->st_mode)) + return 0; + + /* At this point, a trailing slash is only permitted on + symlink-to-dir; but it should have found information on the + directory, not the symlink. Call stat() to get info about the + link's referent. Our replacement stat guarantees valid results, + even if the symlink is not pointing to a directory. */ + if (!S_ISLNK (sbuf->st_mode)) + { + errno = ENOTDIR; + return -1; + } + return stat (file, sbuf); +} + +#endif /* HAVE_LSTAT */ diff --git a/local/recipes/tools/diffutils/source/lib/malloc.c b/local/recipes/tools/diffutils/source/lib/malloc.c new file mode 100644 index 0000000000..eeaf12baf3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/malloc.c @@ -0,0 +1,56 @@ +/* malloc() function that is glibc compatible. + + Copyright (C) 1997-1998, 2006-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* written by Jim Meyering and Bruno Haible */ + +#define _GL_USE_STDLIB_ALLOC 1 +#include <config.h> +/* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */ +#ifdef malloc +# define NEED_MALLOC_GNU 1 +# undef malloc +/* Whereas the gnulib module 'malloc-gnu' defines HAVE_MALLOC_GNU. */ +#elif GNULIB_MALLOC_GNU && !HAVE_MALLOC_GNU +# define NEED_MALLOC_GNU 1 +#endif + +#include <stdlib.h> + +#include <errno.h> + +/* Allocate an N-byte block of memory from the heap. + If N is zero, allocate a 1-byte block. */ + +void * +rpl_malloc (size_t n) +{ + void *result; + +#if NEED_MALLOC_GNU + if (n == 0) + n = 1; +#endif + + result = malloc (n); + +#if !HAVE_MALLOC_POSIX + if (result == NULL) + errno = ENOMEM; +#endif + + return result; +} diff --git a/local/recipes/tools/diffutils/source/lib/malloca.c b/local/recipes/tools/diffutils/source/lib/malloca.c new file mode 100644 index 0000000000..0bf4adc06f --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/malloca.c @@ -0,0 +1,149 @@ +/* Safe automatic memory allocation. + Copyright (C) 2003, 2006-2007, 2009-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2003. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#define _GL_USE_STDLIB_ALLOC 1 +#include <config.h> + +/* Specification. */ +#include "malloca.h" + +#include <stdint.h> + +#include "verify.h" + +/* The speed critical point in this file is freea() applied to an alloca() + result: it must be fast, to match the speed of alloca(). The speed of + mmalloca() and freea() in the other case are not critical, because they + are only invoked for big memory sizes. */ + +#if HAVE_ALLOCA + +/* Store the mmalloca() results in a hash table. This is needed to reliably + distinguish a mmalloca() result and an alloca() result. + + Although it is possible that the same pointer is returned by alloca() and + by mmalloca() at different times in the same application, it does not lead + to a bug in freea(), because: + - Before a pointer returned by alloca() can point into malloc()ed memory, + the function must return, and once this has happened the programmer must + not call freea() on it anyway. + - Before a pointer returned by mmalloca() can point into the stack, it + must be freed. The only function that can free it is freea(), and + when freea() frees it, it also removes it from the hash table. */ + +#define MAGIC_NUMBER 0x1415fb4a +#define MAGIC_SIZE sizeof (int) +/* This is how the header info would look like without any alignment + considerations. */ +struct preliminary_header { void *next; int magic; }; +/* But the header's size must be a multiple of sa_alignment_max. */ +#define HEADER_SIZE \ + (((sizeof (struct preliminary_header) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max) +union header { + void *next; + struct { + char room[HEADER_SIZE - MAGIC_SIZE]; + int word; + } magic; +}; +verify (HEADER_SIZE == sizeof (union header)); +/* We make the hash table quite big, so that during lookups the probability + of empty hash buckets is quite high. There is no need to make the hash + table resizable, because when the hash table gets filled so much that the + lookup becomes slow, it means that the application has memory leaks. */ +#define HASH_TABLE_SIZE 257 +static void * mmalloca_results[HASH_TABLE_SIZE]; + +#endif + +void * +mmalloca (size_t n) +{ +#if HAVE_ALLOCA + /* Allocate one more word, that serves as an indicator for malloc()ed + memory, so that freea() of an alloca() result is fast. */ + size_t nplus = n + HEADER_SIZE; + + if (nplus >= n) + { + void *p = malloc (nplus); + + if (p != NULL) + { + size_t slot; + union header *h = p; + + p = h + 1; + + /* Put a magic number into the indicator word. */ + h->magic.word = MAGIC_NUMBER; + + /* Enter p into the hash table. */ + slot = (uintptr_t) p % HASH_TABLE_SIZE; + h->next = mmalloca_results[slot]; + mmalloca_results[slot] = p; + + return p; + } + } + /* Out of memory. */ + return NULL; +#else +# if !MALLOC_0_IS_NONNULL + if (n == 0) + n = 1; +# endif + return malloc (n); +#endif +} + +#if HAVE_ALLOCA +void +freea (void *p) +{ + /* mmalloca() may have returned NULL. */ + if (p != NULL) + { + /* Attempt to quickly distinguish the mmalloca() result - which has + a magic indicator word - and the alloca() result - which has an + uninitialized indicator word. It is for this test that sa_increment + additional bytes are allocated in the alloca() case. */ + if (((int *) p)[-1] == MAGIC_NUMBER) + { + /* Looks like a mmalloca() result. To see whether it really is one, + perform a lookup in the hash table. */ + size_t slot = (uintptr_t) p % HASH_TABLE_SIZE; + void **chain = &mmalloca_results[slot]; + for (; *chain != NULL;) + { + union header *h = p; + if (*chain == p) + { + /* Found it. Remove it from the hash table and free it. */ + union header *p_begin = h - 1; + *chain = p_begin->next; + free (p_begin); + return; + } + h = *chain; + chain = &h[-1].next; + } + } + /* At this point, we know it was not a mmalloca() result. */ + } +} +#endif diff --git a/local/recipes/tools/diffutils/source/lib/malloca.h b/local/recipes/tools/diffutils/source/lib/malloca.h new file mode 100644 index 0000000000..a9078fc426 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/malloca.h @@ -0,0 +1,128 @@ +/* Safe automatic memory allocation. + Copyright (C) 2003-2007, 2009-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2003. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _MALLOCA_H +#define _MALLOCA_H + +#include <alloca.h> +#include <stddef.h> +#include <stdlib.h> +#include <stdint.h> + +#include "xalloc-oversized.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* safe_alloca(N) is equivalent to alloca(N) when it is safe to call + alloca(N); otherwise it returns NULL. It either returns N bytes of + memory allocated on the stack, that lasts until the function returns, + or NULL. + Use of safe_alloca should be avoided: + - inside arguments of function calls - undefined behaviour, + - in inline functions - the allocation may actually last until the + calling function returns. +*/ +#if HAVE_ALLOCA +/* The OS usually guarantees only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + allocate anything larger than 4096 bytes. Also care for the possibility + of a few compiler-allocated temporary stack slots. + This must be a macro, not a function. */ +# define safe_alloca(N) ((N) < 4032 ? alloca (N) : NULL) +#else +# define safe_alloca(N) ((void) (N), NULL) +#endif + +/* malloca(N) is a safe variant of alloca(N). It allocates N bytes of + memory allocated on the stack, that must be freed using freea() before + the function returns. Upon failure, it returns NULL. */ +#if HAVE_ALLOCA +# define malloca(N) \ + ((N) < 4032 - sa_increment \ + ? (void *) ((char *) alloca ((N) + sa_increment) + sa_increment) \ + : mmalloca (N)) +#else +# define malloca(N) \ + mmalloca (N) +#endif +extern void * mmalloca (size_t n); + +/* Free a block of memory allocated through malloca(). */ +#if HAVE_ALLOCA +extern void freea (void *p); +#else +# define freea free +#endif + +/* nmalloca(N,S) is an overflow-safe variant of malloca (N * S). + It allocates an array of N objects, each with S bytes of memory, + on the stack. S must be positive and N must be nonnegative. + The array must be freed using freea() before the function returns. */ +#define nmalloca(n, s) (xalloc_oversized (n, s) ? NULL : malloca ((n) * (s))) + + +#ifdef __cplusplus +} +#endif + + +/* ------------------- Auxiliary, non-public definitions ------------------- */ + +/* Determine the alignment of a type at compile time. */ +#if defined __GNUC__ || defined __IBM__ALIGNOF__ +# define sa_alignof __alignof__ +#elif defined __cplusplus + template <class type> struct sa_alignof_helper { char __slot1; type __slot2; }; +# define sa_alignof(type) offsetof (sa_alignof_helper<type>, __slot2) +#elif defined __hpux + /* Work around a HP-UX 10.20 cc bug with enums constants defined as offsetof + values. */ +# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8) +#elif defined _AIX + /* Work around an AIX 3.2.5 xlc bug with enums constants defined as offsetof + values. */ +# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8) +#else +# define sa_alignof(type) offsetof (struct { char __slot1; type __slot2; }, __slot2) +#endif + +enum +{ +/* The desired alignment of memory allocations is the maximum alignment + among all elementary types. */ + sa_alignment_long = sa_alignof (long), + sa_alignment_double = sa_alignof (double), +#if HAVE_LONG_LONG_INT + sa_alignment_longlong = sa_alignof (long long), +#endif + sa_alignment_longdouble = sa_alignof (long double), + sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1) +#if HAVE_LONG_LONG_INT + | (sa_alignment_longlong - 1) +#endif + | (sa_alignment_longdouble - 1) + ) + 1, +/* The increment that guarantees room for a magic word must be >= sizeof (int) + and a multiple of sa_alignment_max. */ + sa_increment = ((sizeof (int) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max +}; + +#endif /* _MALLOCA_H */ diff --git a/local/recipes/tools/diffutils/source/lib/malloca.valgrind b/local/recipes/tools/diffutils/source/lib/malloca.valgrind new file mode 100644 index 0000000000..52f0a50f57 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/malloca.valgrind @@ -0,0 +1,7 @@ +# Suppress a valgrind message about use of uninitialized memory in freea(). +# This use is OK because it provides only a speedup. +{ + freea + Memcheck:Cond + fun:freea +} diff --git a/local/recipes/tools/diffutils/source/lib/mbchar.c b/local/recipes/tools/diffutils/source/lib/mbchar.c new file mode 100644 index 0000000000..69675bfbcb --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mbchar.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2001, 2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + + +#include <config.h> + +#define MBCHAR_INLINE _GL_EXTERN_INLINE + +#include <limits.h> + +#include "mbchar.h" + +#if IS_BASIC_ASCII + +/* Bit table of characters in the ISO C "basic character set". */ +const unsigned int is_basic_table [UCHAR_MAX / 32 + 1] = +{ + 0x00001a00, /* '\t' '\v' '\f' */ + 0xffffffef, /* ' '...'#' '%'...'?' */ + 0xfffffffe, /* 'A'...'Z' '[' '\\' ']' '^' '_' */ + 0x7ffffffe /* 'a'...'z' '{' '|' '}' '~' */ + /* The remaining bits are 0. */ +}; + +#endif /* IS_BASIC_ASCII */ diff --git a/local/recipes/tools/diffutils/source/lib/mbchar.h b/local/recipes/tools/diffutils/source/lib/mbchar.h new file mode 100644 index 0000000000..ec24068f71 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mbchar.h @@ -0,0 +1,360 @@ +/* Multibyte character data type. + Copyright (C) 2001, 2005-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>. */ + +/* A multibyte character is a short subsequence of a char* string, + representing a single wide character. + + We use multibyte characters instead of wide characters because of + the following goals: + 1) correct multibyte handling, i.e. operate according to the LC_CTYPE + locale, + 2) ease of maintenance, i.e. the maintainer needs not know all details + of the ISO C 99 standard, + 3) don't fail grossly if the input is not in the encoding set by the + locale, because often different encodings are in use in the same + countries (ISO-8859-1/UTF-8, EUC-JP/Shift_JIS, ...), + 4) fast in the case of ASCII characters, + 5) portability, i.e. don't make unportable assumptions about wchar_t. + + Multibyte characters are only accessed through the mb* macros. + + mb_ptr (mbc) + return a pointer to the beginning of the multibyte sequence. + + mb_len (mbc) + returns the number of bytes occupied by the multibyte sequence. + Always > 0. + + mb_iseq (mbc, sc) + returns true if mbc is the standard ASCII character sc. + + mb_isnul (mbc) + returns true if mbc is the nul character. + + mb_cmp (mbc1, mbc2) + returns a positive, zero, or negative value depending on whether mbc1 + sorts after, same or before mbc2. + + mb_casecmp (mbc1, mbc2) + returns a positive, zero, or negative value depending on whether mbc1 + sorts after, same or before mbc2, modulo upper/lowercase conversion. + + mb_equal (mbc1, mbc2) + returns true if mbc1 and mbc2 are equal. + + mb_caseequal (mbc1, mbc2) + returns true if mbc1 and mbc2 are equal modulo upper/lowercase conversion. + + mb_isalnum (mbc) + returns true if mbc is alphanumeric. + + mb_isalpha (mbc) + returns true if mbc is alphabetic. + + mb_isascii(mbc) + returns true if mbc is plain ASCII. + + mb_isblank (mbc) + returns true if mbc is a blank. + + mb_iscntrl (mbc) + returns true if mbc is a control character. + + mb_isdigit (mbc) + returns true if mbc is a decimal digit. + + mb_isgraph (mbc) + returns true if mbc is a graphic character. + + mb_islower (mbc) + returns true if mbc is lowercase. + + mb_isprint (mbc) + returns true if mbc is a printable character. + + mb_ispunct (mbc) + returns true if mbc is a punctuation character. + + mb_isspace (mbc) + returns true if mbc is a space character. + + mb_isupper (mbc) + returns true if mbc is uppercase. + + mb_isxdigit (mbc) + returns true if mbc is a hexadecimal digit. + + mb_width (mbc) + returns the number of columns on the output device occupied by mbc. + Always >= 0. + + mb_putc (mbc, stream) + outputs mbc on stream, a byte oriented FILE stream opened for output. + + mb_setascii (&mbc, sc) + assigns the standard ASCII character sc to mbc. + + mb_copy (&destmbc, &srcmbc) + copies srcmbc to destmbc. + + Here are the function prototypes of the macros. + + extern const char * mb_ptr (const mbchar_t mbc); + extern size_t mb_len (const mbchar_t mbc); + extern bool mb_iseq (const mbchar_t mbc, char sc); + extern bool mb_isnul (const mbchar_t mbc); + extern int mb_cmp (const mbchar_t mbc1, const mbchar_t mbc2); + extern int mb_casecmp (const mbchar_t mbc1, const mbchar_t mbc2); + extern bool mb_equal (const mbchar_t mbc1, const mbchar_t mbc2); + extern bool mb_caseequal (const mbchar_t mbc1, const mbchar_t mbc2); + extern bool mb_isalnum (const mbchar_t mbc); + extern bool mb_isalpha (const mbchar_t mbc); + extern bool mb_isascii (const mbchar_t mbc); + extern bool mb_isblank (const mbchar_t mbc); + extern bool mb_iscntrl (const mbchar_t mbc); + extern bool mb_isdigit (const mbchar_t mbc); + extern bool mb_isgraph (const mbchar_t mbc); + extern bool mb_islower (const mbchar_t mbc); + extern bool mb_isprint (const mbchar_t mbc); + extern bool mb_ispunct (const mbchar_t mbc); + extern bool mb_isspace (const mbchar_t mbc); + extern bool mb_isupper (const mbchar_t mbc); + extern bool mb_isxdigit (const mbchar_t mbc); + extern int mb_width (const mbchar_t mbc); + extern void mb_putc (const mbchar_t mbc, FILE *stream); + extern void mb_setascii (mbchar_t *new, char sc); + extern void mb_copy (mbchar_t *new, const mbchar_t *old); + */ + +#ifndef _MBCHAR_H +#define _MBCHAR_H 1 + +#include <stdbool.h> +#include <string.h> + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before + <wchar.h>. */ +#include <stdio.h> +#include <time.h> +#include <wchar.h> +#include <wctype.h> + +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef MBCHAR_INLINE +# define MBCHAR_INLINE _GL_INLINE +#endif + +#define MBCHAR_BUF_SIZE 24 + +struct mbchar +{ + const char *ptr; /* pointer to current character */ + size_t bytes; /* number of bytes of current character, > 0 */ + bool wc_valid; /* true if wc is a valid wide character */ + wchar_t wc; /* if wc_valid: the current character */ + char buf[MBCHAR_BUF_SIZE]; /* room for the bytes, used for file input only */ +}; + +/* EOF (not a real character) is represented with bytes = 0 and + wc_valid = false. */ + +typedef struct mbchar mbchar_t; + +/* Access the current character. */ +#define mb_ptr(mbc) ((mbc).ptr) +#define mb_len(mbc) ((mbc).bytes) + +/* Comparison of characters. */ +#define mb_iseq(mbc, sc) ((mbc).wc_valid && (mbc).wc == (sc)) +#define mb_isnul(mbc) ((mbc).wc_valid && (mbc).wc == 0) +#define mb_cmp(mbc1, mbc2) \ + ((mbc1).wc_valid \ + ? ((mbc2).wc_valid \ + ? (int) (mbc1).wc - (int) (mbc2).wc \ + : -1) \ + : ((mbc2).wc_valid \ + ? 1 \ + : (mbc1).bytes == (mbc2).bytes \ + ? memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) \ + : (mbc1).bytes < (mbc2).bytes \ + ? (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) > 0 ? 1 : -1) \ + : (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc2).bytes) >= 0 ? 1 : -1))) +#define mb_casecmp(mbc1, mbc2) \ + ((mbc1).wc_valid \ + ? ((mbc2).wc_valid \ + ? (int) towlower ((mbc1).wc) - (int) towlower ((mbc2).wc) \ + : -1) \ + : ((mbc2).wc_valid \ + ? 1 \ + : (mbc1).bytes == (mbc2).bytes \ + ? memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) \ + : (mbc1).bytes < (mbc2).bytes \ + ? (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) > 0 ? 1 : -1) \ + : (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc2).bytes) >= 0 ? 1 : -1))) +#define mb_equal(mbc1, mbc2) \ + ((mbc1).wc_valid && (mbc2).wc_valid \ + ? (mbc1).wc == (mbc2).wc \ + : (mbc1).bytes == (mbc2).bytes \ + && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0) +#define mb_caseequal(mbc1, mbc2) \ + ((mbc1).wc_valid && (mbc2).wc_valid \ + ? towlower ((mbc1).wc) == towlower ((mbc2).wc) \ + : (mbc1).bytes == (mbc2).bytes \ + && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0) + +/* <ctype.h>, <wctype.h> classification. */ +#define mb_isascii(mbc) \ + ((mbc).wc_valid && (mbc).wc >= 0 && (mbc).wc <= 127) +#define mb_isalnum(mbc) ((mbc).wc_valid && iswalnum ((mbc).wc)) +#define mb_isalpha(mbc) ((mbc).wc_valid && iswalpha ((mbc).wc)) +#define mb_isblank(mbc) ((mbc).wc_valid && iswblank ((mbc).wc)) +#define mb_iscntrl(mbc) ((mbc).wc_valid && iswcntrl ((mbc).wc)) +#define mb_isdigit(mbc) ((mbc).wc_valid && iswdigit ((mbc).wc)) +#define mb_isgraph(mbc) ((mbc).wc_valid && iswgraph ((mbc).wc)) +#define mb_islower(mbc) ((mbc).wc_valid && iswlower ((mbc).wc)) +#define mb_isprint(mbc) ((mbc).wc_valid && iswprint ((mbc).wc)) +#define mb_ispunct(mbc) ((mbc).wc_valid && iswpunct ((mbc).wc)) +#define mb_isspace(mbc) ((mbc).wc_valid && iswspace ((mbc).wc)) +#define mb_isupper(mbc) ((mbc).wc_valid && iswupper ((mbc).wc)) +#define mb_isxdigit(mbc) ((mbc).wc_valid && iswxdigit ((mbc).wc)) + +/* Extra <wchar.h> function. */ + +/* Unprintable characters appear as a small box of width 1. */ +#define MB_UNPRINTABLE_WIDTH 1 + +MBCHAR_INLINE int +mb_width_aux (wint_t wc) +{ + int w = wcwidth (wc); + /* For unprintable characters, arbitrarily return 0 for control characters + and MB_UNPRINTABLE_WIDTH otherwise. */ + return (w >= 0 ? w : iswcntrl (wc) ? 0 : MB_UNPRINTABLE_WIDTH); +} + +#define mb_width(mbc) \ + ((mbc).wc_valid ? mb_width_aux ((mbc).wc) : MB_UNPRINTABLE_WIDTH) + +/* Output. */ +#define mb_putc(mbc, stream) fwrite ((mbc).ptr, 1, (mbc).bytes, (stream)) + +/* Assignment. */ +#define mb_setascii(mbc, sc) \ + ((mbc)->ptr = (mbc)->buf, (mbc)->bytes = 1, (mbc)->wc_valid = 1, \ + (mbc)->wc = (mbc)->buf[0] = (sc)) + +/* Copying a character. */ +MBCHAR_INLINE void +mb_copy (mbchar_t *new_mbc, const mbchar_t *old_mbc) +{ + if (old_mbc->ptr == &old_mbc->buf[0]) + { + memcpy (&new_mbc->buf[0], &old_mbc->buf[0], old_mbc->bytes); + new_mbc->ptr = &new_mbc->buf[0]; + } + else + new_mbc->ptr = old_mbc->ptr; + new_mbc->bytes = old_mbc->bytes; + if ((new_mbc->wc_valid = old_mbc->wc_valid)) + new_mbc->wc = old_mbc->wc; +} + + +/* is_basic(c) tests whether the single-byte character c is in the + ISO C "basic character set". + This is a convenience function, and is in this file only to share code + between mbiter_multi.h and mbfile_multi.h. */ +#if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126) +/* The character set is ISO-646, not EBCDIC. */ +# define IS_BASIC_ASCII 1 + +extern const unsigned int is_basic_table[]; + +MBCHAR_INLINE bool +is_basic (char c) +{ + return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31)) + & 1; +} + +#else + +MBCHAR_INLINE bool +is_basic (char c) +{ + switch (c) + { + case '\t': case '\v': case '\f': + case ' ': case '!': case '"': case '#': case '%': + case '&': case '\'': case '(': case ')': case '*': + case '+': case ',': case '-': case '.': case '/': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + case ':': case ';': case '<': case '=': case '>': + case '?': + case 'A': case 'B': case 'C': case 'D': case 'E': + case 'F': case 'G': case 'H': case 'I': case 'J': + case 'K': case 'L': case 'M': case 'N': case 'O': + case 'P': case 'Q': case 'R': case 'S': case 'T': + case 'U': case 'V': case 'W': case 'X': case 'Y': + case 'Z': + case '[': case '\\': case ']': case '^': case '_': + case 'a': case 'b': case 'c': case 'd': case 'e': + case 'f': case 'g': case 'h': case 'i': case 'j': + case 'k': case 'l': case 'm': case 'n': case 'o': + case 'p': case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'y': + case 'z': case '{': case '|': case '}': case '~': + return 1; + default: + return 0; + } +} + +#endif + +_GL_INLINE_HEADER_END + +#endif /* _MBCHAR_H */ diff --git a/local/recipes/tools/diffutils/source/lib/mbiter.c b/local/recipes/tools/diffutils/source/lib/mbiter.c new file mode 100644 index 0000000000..22a1ff8d2e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mbiter.c @@ -0,0 +1,3 @@ +#include <config.h> +#define MBITER_INLINE _GL_EXTERN_INLINE +#include "mbiter.h" diff --git a/local/recipes/tools/diffutils/source/lib/mbiter.h b/local/recipes/tools/diffutils/source/lib/mbiter.h new file mode 100644 index 0000000000..c3e6f76895 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mbiter.h @@ -0,0 +1,225 @@ +/* Iterating through multibyte strings: macros for multi-byte encodings. + Copyright (C) 2001, 2005, 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>. */ + +/* The macros in this file implement forward iteration through a + multi-byte string. + + With these macros, an iteration loop that looks like + + char *iter; + for (iter = buf; iter < buf + buflen; iter++) + { + do_something (*iter); + } + + becomes + + mbi_iterator_t iter; + for (mbi_init (iter, buf, buflen); mbi_avail (iter); mbi_advance (iter)) + { + do_something (mbi_cur_ptr (iter), mb_len (mbi_cur (iter))); + } + + The benefit of these macros over plain use of mbrtowc is: + - Handling of invalid multibyte sequences is possible without + making the code more complicated, while still preserving the + invalid multibyte sequences. + + mbi_iterator_t + is a type usable for variable declarations. + + mbi_init (iter, startptr, length) + initializes the iterator, starting at startptr and crossing length bytes. + + mbi_avail (iter) + returns true if there are more multibyte characters available before + the end of string is reached. In this case, mbi_cur (iter) is + initialized to the next multibyte character. + + mbi_advance (iter) + advances the iterator by one multibyte character. + + mbi_cur (iter) + returns the current multibyte character, of type mbchar_t. All the + macros defined in mbchar.h can be used on it. + + mbi_cur_ptr (iter) + return a pointer to the beginning of the current multibyte character. + + mbi_reloc (iter, ptrdiff) + relocates iterator when the string is moved by ptrdiff bytes. + + mbi_copy (&destiter, &srciter) + copies srciter to destiter. + + Here are the function prototypes of the macros. + + extern void mbi_init (mbi_iterator_t iter, + const char *startptr, size_t length); + extern bool mbi_avail (mbi_iterator_t iter); + extern void mbi_advance (mbi_iterator_t iter); + extern mbchar_t mbi_cur (mbi_iterator_t iter); + extern const char * mbi_cur_ptr (mbi_iterator_t iter); + extern void mbi_reloc (mbi_iterator_t iter, ptrdiff_t ptrdiff); + extern void mbi_copy (mbi_iterator_t *new, const mbi_iterator_t *old); + */ + +#ifndef _MBITER_H +#define _MBITER_H 1 + +#include <assert.h> +#include <stdbool.h> +#include <stddef.h> +#include <string.h> + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before + <wchar.h>. */ +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +#include "mbchar.h" + +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef MBITER_INLINE +# define MBITER_INLINE _GL_INLINE +#endif + +struct mbiter_multi +{ + const char *limit; /* pointer to end of string */ + bool in_shift; /* true if next byte may not be interpreted as ASCII */ + mbstate_t state; /* if in_shift: current shift state */ + bool next_done; /* true if mbi_avail has already filled the following */ + struct mbchar cur; /* the current character: + const char *cur.ptr pointer to current character + The following are only valid after mbi_avail. + size_t cur.bytes number of bytes of current character + bool cur.wc_valid true if wc is a valid wide character + wchar_t cur.wc if wc_valid: the current character + */ +}; + +MBITER_INLINE void +mbiter_multi_next (struct mbiter_multi *iter) +{ + if (iter->next_done) + return; + if (iter->in_shift) + goto with_shift; + /* Handle most ASCII characters quickly, without calling mbrtowc(). */ + if (is_basic (*iter->cur.ptr)) + { + /* These characters are part of the basic character set. ISO C 99 + guarantees that their wide character code is identical to their + char code. */ + iter->cur.bytes = 1; + iter->cur.wc = *iter->cur.ptr; + iter->cur.wc_valid = true; + } + else + { + assert (mbsinit (&iter->state)); + iter->in_shift = true; + with_shift: + iter->cur.bytes = mbrtowc (&iter->cur.wc, iter->cur.ptr, + iter->limit - iter->cur.ptr, &iter->state); + if (iter->cur.bytes == (size_t) -1) + { + /* An invalid multibyte sequence was encountered. */ + iter->cur.bytes = 1; + iter->cur.wc_valid = false; + /* Whether to set iter->in_shift = false and reset iter->state + or not is not very important; the string is bogus anyway. */ + } + else if (iter->cur.bytes == (size_t) -2) + { + /* An incomplete multibyte character at the end. */ + iter->cur.bytes = iter->limit - iter->cur.ptr; + iter->cur.wc_valid = false; + /* Whether to set iter->in_shift = false and reset iter->state + or not is not important; the string end is reached anyway. */ + } + else + { + if (iter->cur.bytes == 0) + { + /* A null wide character was encountered. */ + iter->cur.bytes = 1; + assert (*iter->cur.ptr == '\0'); + assert (iter->cur.wc == 0); + } + iter->cur.wc_valid = true; + + /* When in the initial state, we can go back treating ASCII + characters more quickly. */ + if (mbsinit (&iter->state)) + iter->in_shift = false; + } + } + iter->next_done = true; +} + +MBITER_INLINE void +mbiter_multi_reloc (struct mbiter_multi *iter, ptrdiff_t ptrdiff) +{ + iter->cur.ptr += ptrdiff; + iter->limit += ptrdiff; +} + +MBITER_INLINE void +mbiter_multi_copy (struct mbiter_multi *new_iter, const struct mbiter_multi *old_iter) +{ + new_iter->limit = old_iter->limit; + if ((new_iter->in_shift = old_iter->in_shift)) + memcpy (&new_iter->state, &old_iter->state, sizeof (mbstate_t)); + else + memset (&new_iter->state, 0, sizeof (mbstate_t)); + new_iter->next_done = old_iter->next_done; + mb_copy (&new_iter->cur, &old_iter->cur); +} + +/* Iteration macros. */ +typedef struct mbiter_multi mbi_iterator_t; +#define mbi_init(iter, startptr, length) \ + ((iter).cur.ptr = (startptr), (iter).limit = (iter).cur.ptr + (length), \ + (iter).in_shift = false, memset (&(iter).state, '\0', sizeof (mbstate_t)), \ + (iter).next_done = false) +#define mbi_avail(iter) \ + ((iter).cur.ptr < (iter).limit && (mbiter_multi_next (&(iter)), true)) +#define mbi_advance(iter) \ + ((iter).cur.ptr += (iter).cur.bytes, (iter).next_done = false) + +/* Access to the current character. */ +#define mbi_cur(iter) (iter).cur +#define mbi_cur_ptr(iter) (iter).cur.ptr + +/* Relocation. */ +#define mbi_reloc(iter, ptrdiff) mbiter_multi_reloc (&iter, ptrdiff) + +/* Copying an iterator. */ +#define mbi_copy mbiter_multi_copy + +_GL_INLINE_HEADER_END + +#endif /* _MBITER_H */ diff --git a/local/recipes/tools/diffutils/source/lib/mbrtowc.c b/local/recipes/tools/diffutils/source/lib/mbrtowc.c new file mode 100644 index 0000000000..7415ffffd5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mbrtowc.c @@ -0,0 +1,414 @@ +/* Convert multibyte character to wide character. + Copyright (C) 1999-2002, 2005-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <wchar.h> + +#if C_LOCALE_MAYBE_EILSEQ +# include "hard-locale.h" +# include <locale.h> +#endif + +#if GNULIB_defined_mbstate_t +/* Implement mbrtowc() on top of mbtowc(). */ + +# include <errno.h> +# include <stdlib.h> + +# include "localcharset.h" +# include "streq.h" +# include "verify.h" + +#ifndef FALLTHROUGH +# if __GNUC__ < 7 +# define FALLTHROUGH ((void) 0) +# else +# define FALLTHROUGH __attribute__ ((__fallthrough__)) +# endif +#endif + +verify (sizeof (mbstate_t) >= 4); + +static char internal_state[4]; + +size_t +mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) +{ + char *pstate = (char *)ps; + + if (s == NULL) + { + pwc = NULL; + s = ""; + n = 1; + } + + if (n == 0) + return (size_t)(-2); + + /* Here n > 0. */ + + if (pstate == NULL) + pstate = internal_state; + + { + size_t nstate = pstate[0]; + char buf[4]; + const char *p; + size_t m; + + switch (nstate) + { + case 0: + p = s; + m = n; + break; + case 3: + buf[2] = pstate[3]; + FALLTHROUGH; + case 2: + buf[1] = pstate[2]; + FALLTHROUGH; + case 1: + buf[0] = pstate[1]; + p = buf; + m = nstate; + buf[m++] = s[0]; + if (n >= 2 && m < 4) + { + buf[m++] = s[1]; + if (n >= 3 && m < 4) + buf[m++] = s[2]; + } + break; + default: + errno = EINVAL; + return (size_t)(-1); + } + + /* Here m > 0. */ + +# if __GLIBC__ || defined __UCLIBC__ + /* Work around bug <http://sourceware.org/bugzilla/show_bug.cgi?id=9674> */ + mbtowc (NULL, NULL, 0); +# endif + { + int res = mbtowc (pwc, p, m); + + if (res >= 0) + { + if (pwc != NULL && ((*pwc == 0) != (res == 0))) + abort (); + if (nstate >= (res > 0 ? res : 1)) + abort (); + res -= nstate; + pstate[0] = 0; + return res; + } + + /* mbtowc does not distinguish between invalid and incomplete multibyte + sequences. But mbrtowc needs to make this distinction. + There are two possible approaches: + - Use iconv() and its return value. + - Use built-in knowledge about the possible encodings. + Given the low quality of implementation of iconv() on the systems that + lack mbrtowc(), we use the second approach. + The possible encodings are: + - 8-bit encodings, + - EUC-JP, EUC-KR, GB2312, EUC-TW, BIG5, GB18030, SJIS, + - UTF-8. + Use specialized code for each. */ + if (m >= 4 || m >= MB_CUR_MAX) + goto invalid; + /* Here MB_CUR_MAX > 1 and 0 < m < 4. */ + { + const char *encoding = locale_charset (); + + if (STREQ_OPT (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0)) + { + /* Cf. unistr/u8-mblen.c. */ + unsigned char c = (unsigned char) p[0]; + + if (c >= 0xc2) + { + if (c < 0xe0) + { + if (m == 1) + goto incomplete; + } + else if (c < 0xf0) + { + if (m == 1) + goto incomplete; + if (m == 2) + { + unsigned char c2 = (unsigned char) p[1]; + + if ((c2 ^ 0x80) < 0x40 + && (c >= 0xe1 || c2 >= 0xa0) + && (c != 0xed || c2 < 0xa0)) + goto incomplete; + } + } + else if (c <= 0xf4) + { + if (m == 1) + goto incomplete; + else /* m == 2 || m == 3 */ + { + unsigned char c2 = (unsigned char) p[1]; + + if ((c2 ^ 0x80) < 0x40 + && (c >= 0xf1 || c2 >= 0x90) + && (c < 0xf4 || (c == 0xf4 && c2 < 0x90))) + { + if (m == 2) + goto incomplete; + else /* m == 3 */ + { + unsigned char c3 = (unsigned char) p[2]; + + if ((c3 ^ 0x80) < 0x40) + goto incomplete; + } + } + } + } + } + goto invalid; + } + + /* As a reference for this code, you can use the GNU libiconv + implementation. Look for uses of the RET_TOOFEW macro. */ + + if (STREQ_OPT (encoding, + "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0)) + { + if (m == 1) + { + unsigned char c = (unsigned char) p[0]; + + if ((c >= 0xa1 && c < 0xff) || c == 0x8e || c == 0x8f) + goto incomplete; + } + if (m == 2) + { + unsigned char c = (unsigned char) p[0]; + + if (c == 0x8f) + { + unsigned char c2 = (unsigned char) p[1]; + + if (c2 >= 0xa1 && c2 < 0xff) + goto incomplete; + } + } + goto invalid; + } + if (STREQ_OPT (encoding, + "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0) + || STREQ_OPT (encoding, + "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0) + || STREQ_OPT (encoding, + "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0)) + { + if (m == 1) + { + unsigned char c = (unsigned char) p[0]; + + if (c >= 0xa1 && c < 0xff) + goto incomplete; + } + goto invalid; + } + if (STREQ_OPT (encoding, + "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0)) + { + if (m == 1) + { + unsigned char c = (unsigned char) p[0]; + + if ((c >= 0xa1 && c < 0xff) || c == 0x8e) + goto incomplete; + } + else /* m == 2 || m == 3 */ + { + unsigned char c = (unsigned char) p[0]; + + if (c == 0x8e) + goto incomplete; + } + goto invalid; + } + if (STREQ_OPT (encoding, + "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0)) + { + if (m == 1) + { + unsigned char c = (unsigned char) p[0]; + + if ((c >= 0x90 && c <= 0xe3) || (c >= 0xf8 && c <= 0xfe)) + goto incomplete; + } + else /* m == 2 || m == 3 */ + { + unsigned char c = (unsigned char) p[0]; + + if (c >= 0x90 && c <= 0xe3) + { + unsigned char c2 = (unsigned char) p[1]; + + if (c2 >= 0x30 && c2 <= 0x39) + { + if (m == 2) + goto incomplete; + else /* m == 3 */ + { + unsigned char c3 = (unsigned char) p[2]; + + if (c3 >= 0x81 && c3 <= 0xfe) + goto incomplete; + } + } + } + } + goto invalid; + } + if (STREQ_OPT (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0)) + { + if (m == 1) + { + unsigned char c = (unsigned char) p[0]; + + if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea) + || (c >= 0xf0 && c <= 0xf9)) + goto incomplete; + } + goto invalid; + } + + /* An unknown multibyte encoding. */ + goto incomplete; + } + + incomplete: + { + size_t k = nstate; + /* Here 0 <= k < m < 4. */ + pstate[++k] = s[0]; + if (k < m) + { + pstate[++k] = s[1]; + if (k < m) + pstate[++k] = s[2]; + } + if (k != m) + abort (); + } + pstate[0] = m; + return (size_t)(-2); + + invalid: + errno = EILSEQ; + /* The conversion state is undefined, says POSIX. */ + return (size_t)(-1); + } + } +} + +#else +/* Override the system's mbrtowc() function. */ + +# undef mbrtowc + +size_t +rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) +{ + size_t ret; + wchar_t wc; + +# if MBRTOWC_NULL_ARG2_BUG || MBRTOWC_RETVAL_BUG || MBRTOWC_EMPTY_INPUT_BUG + if (s == NULL) + { + pwc = NULL; + s = ""; + n = 1; + } +# endif + +# if MBRTOWC_EMPTY_INPUT_BUG + if (n == 0) + return (size_t) -2; +# endif + + if (! pwc) + pwc = &wc; + +# if MBRTOWC_RETVAL_BUG + { + static mbstate_t internal_state; + + /* Override mbrtowc's internal state. We cannot call mbsinit() on the + hidden internal state, but we can call it on our variable. */ + if (ps == NULL) + ps = &internal_state; + + if (!mbsinit (ps)) + { + /* Parse the rest of the multibyte character byte for byte. */ + size_t count = 0; + for (; n > 0; s++, n--) + { + ret = mbrtowc (&wc, s, 1, ps); + + if (ret == (size_t)(-1)) + return (size_t)(-1); + count++; + if (ret != (size_t)(-2)) + { + /* The multibyte character has been completed. */ + *pwc = wc; + return (wc == 0 ? 0 : count); + } + } + return (size_t)(-2); + } + } +# endif + + ret = mbrtowc (pwc, s, n, ps); + +# if MBRTOWC_NUL_RETVAL_BUG + if (ret < (size_t) -2 && !*pwc) + return 0; +# endif + +# if C_LOCALE_MAYBE_EILSEQ + if ((size_t) -2 <= ret && n != 0 && ! hard_locale (LC_CTYPE)) + { + unsigned char uc = *s; + *pwc = uc; + return 1; + } +# endif + + return ret; +} + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/mbscasecmp.c b/local/recipes/tools/diffutils/source/lib/mbscasecmp.c new file mode 100644 index 0000000000..f14a7c0730 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mbscasecmp.c @@ -0,0 +1,98 @@ +/* Case-insensitive string comparison function. + Copyright (C) 1998-1999, 2005-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2005, + based on earlier glibc code. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <string.h> + +#include <ctype.h> +#include <limits.h> + +#include "mbuiter.h" + +#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) + +/* Compare the character strings S1 and S2, ignoring case, returning less than, + equal to or greater than zero if S1 is lexicographically less than, equal to + or greater than S2. + Note: This function may, in multibyte locales, return 0 for strings of + different lengths! */ +int +mbscasecmp (const char *s1, const char *s2) +{ + if (s1 == s2) + return 0; + + /* Be careful not to look at the entire extent of s1 or s2 until needed. + This is useful because when two strings differ, the difference is + most often already in the very few first characters. */ + if (MB_CUR_MAX > 1) + { + mbui_iterator_t iter1; + mbui_iterator_t iter2; + + mbui_init (iter1, s1); + mbui_init (iter2, s2); + + while (mbui_avail (iter1) && mbui_avail (iter2)) + { + int cmp = mb_casecmp (mbui_cur (iter1), mbui_cur (iter2)); + + if (cmp != 0) + return cmp; + + mbui_advance (iter1); + mbui_advance (iter2); + } + if (mbui_avail (iter1)) + /* s2 terminated before s1. */ + return 1; + if (mbui_avail (iter2)) + /* s1 terminated before s2. */ + return -1; + return 0; + } + else + { + const unsigned char *p1 = (const unsigned char *) s1; + const unsigned char *p2 = (const unsigned char *) s2; + unsigned char c1, c2; + + do + { + c1 = TOLOWER (*p1); + c2 = TOLOWER (*p2); + + if (c1 == '\0') + break; + + ++p1; + ++p2; + } + while (c1 == c2); + + if (UCHAR_MAX <= INT_MAX) + return c1 - c2; + else + /* On machines where 'char' and 'int' are types of the same size, the + difference of two 'unsigned char' values - including the sign bit - + doesn't fit in an 'int'. */ + return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0); + } +} diff --git a/local/recipes/tools/diffutils/source/lib/mbsinit.c b/local/recipes/tools/diffutils/source/lib/mbsinit.c new file mode 100644 index 0000000000..758012668f --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mbsinit.c @@ -0,0 +1,73 @@ +/* Test for initial conversion state. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <wchar.h> + +#include "verify.h" + +#if GNULIB_defined_mbstate_t + +/* Platforms that lack mbsinit() also lack mbrlen(), mbrtowc(), mbsrtowcs() + and wcrtomb(), wcsrtombs(). + We assume that + - sizeof (mbstate_t) >= 4, + - only stateless encodings are supported (such as UTF-8 and EUC-JP, but + not ISO-2022 variants), + - for each encoding, the number of bytes for a wide character is <= 4. + (This maximum is attained for UTF-8, GB18030, EUC-TW.) + We define the meaning of mbstate_t as follows: + - In mb -> wc direction, mbstate_t's first byte contains the number of + buffered bytes (in the range 0..3), followed by up to 3 buffered bytes. + See mbrtowc.c. + - In wc -> mb direction, mbstate_t contains no information. In other + words, it is always in the initial state. */ + +verify (sizeof (mbstate_t) >= 4); + +int +mbsinit (const mbstate_t *ps) +{ + const char *pstate = (const char *)ps; + + return pstate == NULL || pstate[0] == 0; +} + +#else + +int +mbsinit (const mbstate_t *ps) +{ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* Native Windows. */ +# ifdef __MINGW32__ + /* On mingw, 'mbstate_t' is defined as 'int'. */ + return ps == NULL || *ps == 0; +# else + /* MSVC defines 'mbstate_t' as an 8-byte struct; the first 4-bytes matter. */ + return ps == NULL || *(const unsigned int *)ps == 0; +# endif +# else + /* Minix, HP-UX 11.00, Solaris 2.6, Interix, ... */ + /* Maybe this definition works, maybe not... */ + return ps == NULL || *(const char *)ps == 0; +# endif +} + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/mbslen.c b/local/recipes/tools/diffutils/source/lib/mbslen.c new file mode 100644 index 0000000000..29f412d6ee --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mbslen.c @@ -0,0 +1,44 @@ +/* Counting the multibyte characters in a string. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2007. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <string.h> + +#include <stdlib.h> + +#include "mbuiter.h" + +/* Return the number of multibyte characters in the character string STRING. */ +size_t +mbslen (const char *string) +{ + if (MB_CUR_MAX > 1) + { + size_t count; + mbui_iterator_t iter; + + count = 0; + for (mbui_init (iter, string); mbui_avail (iter); mbui_advance (iter)) + count++; + + return count; + } + else + return strlen (string); +} diff --git a/local/recipes/tools/diffutils/source/lib/mbsrtowcs-impl.h b/local/recipes/tools/diffutils/source/lib/mbsrtowcs-impl.h new file mode 100644 index 0000000000..d787c07e11 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mbsrtowcs-impl.h @@ -0,0 +1,122 @@ +/* Convert string to wide string. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +size_t +mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps) +{ + if (ps == NULL) + ps = &_gl_mbsrtowcs_state; + { + const char *src = *srcp; + + if (dest != NULL) + { + wchar_t *destptr = dest; + + for (; len > 0; destptr++, len--) + { + size_t src_avail; + size_t ret; + + /* An optimized variant of + src_avail = strnlen1 (src, MB_LEN_MAX); */ + if (src[0] == '\0') + src_avail = 1; + else if (src[1] == '\0') + src_avail = 2; + else if (src[2] == '\0') + src_avail = 3; + else if (MB_LEN_MAX <= 4 || src[3] == '\0') + src_avail = 4; + else + src_avail = 4 + strnlen1 (src + 4, MB_LEN_MAX - 4); + + /* Parse the next multibyte character. */ + ret = mbrtowc (destptr, src, src_avail, ps); + + if (ret == (size_t)(-2)) + /* Encountered a multibyte character that extends past a '\0' byte + or that is longer than MB_LEN_MAX bytes. Cannot happen. */ + abort (); + + if (ret == (size_t)(-1)) + goto bad_input; + if (ret == 0) + { + src = NULL; + /* Here mbsinit (ps). */ + break; + } + src += ret; + } + + *srcp = src; + return destptr - dest; + } + else + { + /* Ignore dest and len, don't store *srcp at the end, and + don't clobber *ps. */ + mbstate_t state = *ps; + size_t totalcount = 0; + + for (;; totalcount++) + { + size_t src_avail; + size_t ret; + + /* An optimized variant of + src_avail = strnlen1 (src, MB_LEN_MAX); */ + if (src[0] == '\0') + src_avail = 1; + else if (src[1] == '\0') + src_avail = 2; + else if (src[2] == '\0') + src_avail = 3; + else if (MB_LEN_MAX <= 4 || src[3] == '\0') + src_avail = 4; + else + src_avail = 4 + strnlen1 (src + 4, MB_LEN_MAX - 4); + + /* Parse the next multibyte character. */ + ret = mbrtowc (NULL, src, src_avail, &state); + + if (ret == (size_t)(-2)) + /* Encountered a multibyte character that extends past a '\0' byte + or that is longer than MB_LEN_MAX bytes. Cannot happen. */ + abort (); + + if (ret == (size_t)(-1)) + goto bad_input2; + if (ret == 0) + { + /* Here mbsinit (&state). */ + break; + } + src += ret; + } + + return totalcount; + } + + bad_input: + *srcp = src; + bad_input2: + errno = EILSEQ; + return (size_t)(-1); + } +} diff --git a/local/recipes/tools/diffutils/source/lib/mbsrtowcs-state.c b/local/recipes/tools/diffutils/source/lib/mbsrtowcs-state.c new file mode 100644 index 0000000000..4c213e459b --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mbsrtowcs-state.c @@ -0,0 +1,37 @@ +/* Convert string to wide string. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <wchar.h> + +/* Internal state used by the functions mbsrtowcs() and mbsnrtowcs(). */ +mbstate_t _gl_mbsrtowcs_state +/* The state must initially be in the "initial state"; so, zero-initialize it. + On most systems, putting it into BSS is sufficient. Not so on Mac OS X 10.3, + see <http://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00329.html>. + When it needs an initializer, use 0 or {0} as initializer? 0 only works + when mbstate_t is a scalar type (such as when gnulib defines it, or on + AIX, IRIX, mingw). {0} works as an initializer in all cases: for a struct + or union type, but also for a scalar type (ISO C 99, 6.7.8.(11)). */ +#if defined __ELF__ + /* On ELF systems, variables in BSS behave well. */ +#else + /* Use braces, to be on the safe side. */ + = { 0 } +#endif + ; diff --git a/local/recipes/tools/diffutils/source/lib/mbsrtowcs.c b/local/recipes/tools/diffutils/source/lib/mbsrtowcs.c new file mode 100644 index 0000000000..7896e948ea --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mbsrtowcs.c @@ -0,0 +1,32 @@ +/* Convert string to wide string. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <wchar.h> + +#include <errno.h> +#include <limits.h> +#include <stdlib.h> + +#include "strnlen1.h" + + +extern mbstate_t _gl_mbsrtowcs_state; + +#include "mbsrtowcs-impl.h" diff --git a/local/recipes/tools/diffutils/source/lib/mbsstr.c b/local/recipes/tools/diffutils/source/lib/mbsstr.c new file mode 100644 index 0000000000..ab3d2632eb --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mbsstr.c @@ -0,0 +1,384 @@ +/* Searching in a string. -*- coding: utf-8 -*- + Copyright (C) 2005-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2005. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <string.h> + +#include <stdbool.h> +#include <stddef.h> /* for NULL, in case a nonstandard string.h lacks it */ + +#include "malloca.h" +#include "mbuiter.h" + +/* Knuth-Morris-Pratt algorithm. */ +#define UNIT unsigned char +#define CANON_ELEMENT(c) c +#include "str-kmp.h" + +/* Knuth-Morris-Pratt algorithm. + See http://en.wikipedia.org/wiki/Knuth-Morris-Pratt_algorithm + Return a boolean indicating success: + Return true and set *RESULTP if the search was completed. + Return false if it was aborted because not enough memory was available. */ +static bool +knuth_morris_pratt_multibyte (const char *haystack, const char *needle, + const char **resultp) +{ + size_t m = mbslen (needle); + mbchar_t *needle_mbchars; + size_t *table; + + /* Allocate room for needle_mbchars and the table. */ + void *memory = nmalloca (m, sizeof (mbchar_t) + sizeof (size_t)); + void *table_memory; + if (memory == NULL) + return false; + needle_mbchars = memory; + table_memory = needle_mbchars + m; + table = table_memory; + + /* Fill needle_mbchars. */ + { + mbui_iterator_t iter; + size_t j; + + j = 0; + for (mbui_init (iter, needle); mbui_avail (iter); mbui_advance (iter), j++) + mb_copy (&needle_mbchars[j], &mbui_cur (iter)); + } + + /* Fill the table. + For 0 < i < m: + 0 < table[i] <= i is defined such that + forall 0 < x < table[i]: needle[x..i-1] != needle[0..i-1-x], + and table[i] is as large as possible with this property. + This implies: + 1) For 0 < i < m: + If table[i] < i, + needle[table[i]..i-1] = needle[0..i-1-table[i]]. + 2) For 0 < i < m: + rhaystack[0..i-1] == needle[0..i-1] + and exists h, i <= h < m: rhaystack[h] != needle[h] + implies + forall 0 <= x < table[i]: rhaystack[x..x+m-1] != needle[0..m-1]. + table[0] remains uninitialized. */ + { + size_t i, j; + + /* i = 1: Nothing to verify for x = 0. */ + table[1] = 1; + j = 0; + + for (i = 2; i < m; i++) + { + /* Here: j = i-1 - table[i-1]. + The inequality needle[x..i-1] != needle[0..i-1-x] is known to hold + for x < table[i-1], by induction. + Furthermore, if j>0: needle[i-1-j..i-2] = needle[0..j-1]. */ + mbchar_t *b = &needle_mbchars[i - 1]; + + for (;;) + { + /* Invariants: The inequality needle[x..i-1] != needle[0..i-1-x] + is known to hold for x < i-1-j. + Furthermore, if j>0: needle[i-1-j..i-2] = needle[0..j-1]. */ + if (mb_equal (*b, needle_mbchars[j])) + { + /* Set table[i] := i-1-j. */ + table[i] = i - ++j; + break; + } + /* The inequality needle[x..i-1] != needle[0..i-1-x] also holds + for x = i-1-j, because + needle[i-1] != needle[j] = needle[i-1-x]. */ + if (j == 0) + { + /* The inequality holds for all possible x. */ + table[i] = i; + break; + } + /* The inequality needle[x..i-1] != needle[0..i-1-x] also holds + for i-1-j < x < i-1-j+table[j], because for these x: + needle[x..i-2] + = needle[x-(i-1-j)..j-1] + != needle[0..j-1-(x-(i-1-j))] (by definition of table[j]) + = needle[0..i-2-x], + hence needle[x..i-1] != needle[0..i-1-x]. + Furthermore + needle[i-1-j+table[j]..i-2] + = needle[table[j]..j-1] + = needle[0..j-1-table[j]] (by definition of table[j]). */ + j = j - table[j]; + } + /* Here: j = i - table[i]. */ + } + } + + /* Search, using the table to accelerate the processing. */ + { + size_t j; + mbui_iterator_t rhaystack; + mbui_iterator_t phaystack; + + *resultp = NULL; + j = 0; + mbui_init (rhaystack, haystack); + mbui_init (phaystack, haystack); + /* Invariant: phaystack = rhaystack + j. */ + while (mbui_avail (phaystack)) + if (mb_equal (needle_mbchars[j], mbui_cur (phaystack))) + { + j++; + mbui_advance (phaystack); + if (j == m) + { + /* The entire needle has been found. */ + *resultp = mbui_cur_ptr (rhaystack); + break; + } + } + else if (j > 0) + { + /* Found a match of needle[0..j-1], mismatch at needle[j]. */ + size_t count = table[j]; + j -= count; + for (; count > 0; count--) + { + if (!mbui_avail (rhaystack)) + abort (); + mbui_advance (rhaystack); + } + } + else + { + /* Found a mismatch at needle[0] already. */ + if (!mbui_avail (rhaystack)) + abort (); + mbui_advance (rhaystack); + mbui_advance (phaystack); + } + } + + freea (memory); + return true; +} + +/* Find the first occurrence of the character string NEEDLE in the character + string HAYSTACK. Return NULL if NEEDLE is not found in HAYSTACK. */ +char * +mbsstr (const char *haystack, const char *needle) +{ + /* Be careful not to look at the entire extent of haystack or needle + until needed. This is useful because of these two cases: + - haystack may be very long, and a match of needle found early, + - needle may be very long, and not even a short initial segment of + needle may be found in haystack. */ + if (MB_CUR_MAX > 1) + { + mbui_iterator_t iter_needle; + + mbui_init (iter_needle, needle); + if (mbui_avail (iter_needle)) + { + /* Minimizing the worst-case complexity: + Let n = mbslen(haystack), m = mbslen(needle). + The naïve algorithm is O(n*m) worst-case. + The Knuth-Morris-Pratt algorithm is O(n) worst-case but it needs a + memory allocation. + To achieve linear complexity and yet amortize the cost of the + memory allocation, we activate the Knuth-Morris-Pratt algorithm + only once the naïve algorithm has already run for some time; more + precisely, when + - the outer loop count is >= 10, + - the average number of comparisons per outer loop is >= 5, + - the total number of comparisons is >= m. + But we try it only once. If the memory allocation attempt failed, + we don't retry it. */ + bool try_kmp = true; + size_t outer_loop_count = 0; + size_t comparison_count = 0; + size_t last_ccount = 0; /* last comparison count */ + mbui_iterator_t iter_needle_last_ccount; /* = needle + last_ccount */ + + mbui_iterator_t iter_haystack; + + mbui_init (iter_needle_last_ccount, needle); + mbui_init (iter_haystack, haystack); + for (;; mbui_advance (iter_haystack)) + { + if (!mbui_avail (iter_haystack)) + /* No match. */ + return NULL; + + /* See whether it's advisable to use an asymptotically faster + algorithm. */ + if (try_kmp + && outer_loop_count >= 10 + && comparison_count >= 5 * outer_loop_count) + { + /* See if needle + comparison_count now reaches the end of + needle. */ + size_t count = comparison_count - last_ccount; + for (; + count > 0 && mbui_avail (iter_needle_last_ccount); + count--) + mbui_advance (iter_needle_last_ccount); + last_ccount = comparison_count; + if (!mbui_avail (iter_needle_last_ccount)) + { + /* Try the Knuth-Morris-Pratt algorithm. */ + const char *result; + bool success = + knuth_morris_pratt_multibyte (haystack, needle, + &result); + if (success) + return (char *) result; + try_kmp = false; + } + } + + outer_loop_count++; + comparison_count++; + if (mb_equal (mbui_cur (iter_haystack), mbui_cur (iter_needle))) + /* The first character matches. */ + { + mbui_iterator_t rhaystack; + mbui_iterator_t rneedle; + + memcpy (&rhaystack, &iter_haystack, sizeof (mbui_iterator_t)); + mbui_advance (rhaystack); + + mbui_init (rneedle, needle); + if (!mbui_avail (rneedle)) + abort (); + mbui_advance (rneedle); + + for (;; mbui_advance (rhaystack), mbui_advance (rneedle)) + { + if (!mbui_avail (rneedle)) + /* Found a match. */ + return (char *) mbui_cur_ptr (iter_haystack); + if (!mbui_avail (rhaystack)) + /* No match. */ + return NULL; + comparison_count++; + if (!mb_equal (mbui_cur (rhaystack), mbui_cur (rneedle))) + /* Nothing in this round. */ + break; + } + } + } + } + else + return (char *) haystack; + } + else + { + if (*needle != '\0') + { + /* Minimizing the worst-case complexity: + Let n = strlen(haystack), m = strlen(needle). + The naïve algorithm is O(n*m) worst-case. + The Knuth-Morris-Pratt algorithm is O(n) worst-case but it needs a + memory allocation. + To achieve linear complexity and yet amortize the cost of the + memory allocation, we activate the Knuth-Morris-Pratt algorithm + only once the naïve algorithm has already run for some time; more + precisely, when + - the outer loop count is >= 10, + - the average number of comparisons per outer loop is >= 5, + - the total number of comparisons is >= m. + But we try it only once. If the memory allocation attempt failed, + we don't retry it. */ + bool try_kmp = true; + size_t outer_loop_count = 0; + size_t comparison_count = 0; + size_t last_ccount = 0; /* last comparison count */ + const char *needle_last_ccount = needle; /* = needle + last_ccount */ + + /* Speed up the following searches of needle by caching its first + character. */ + char b = *needle++; + + for (;; haystack++) + { + if (*haystack == '\0') + /* No match. */ + return NULL; + + /* See whether it's advisable to use an asymptotically faster + algorithm. */ + if (try_kmp + && outer_loop_count >= 10 + && comparison_count >= 5 * outer_loop_count) + { + /* See if needle + comparison_count now reaches the end of + needle. */ + if (needle_last_ccount != NULL) + { + needle_last_ccount += + strnlen (needle_last_ccount, + comparison_count - last_ccount); + if (*needle_last_ccount == '\0') + needle_last_ccount = NULL; + last_ccount = comparison_count; + } + if (needle_last_ccount == NULL) + { + /* Try the Knuth-Morris-Pratt algorithm. */ + const unsigned char *result; + bool success = + knuth_morris_pratt ((const unsigned char *) haystack, + (const unsigned char *) (needle - 1), + strlen (needle - 1), + &result); + if (success) + return (char *) result; + try_kmp = false; + } + } + + outer_loop_count++; + comparison_count++; + if (*haystack == b) + /* The first character matches. */ + { + const char *rhaystack = haystack + 1; + const char *rneedle = needle; + + for (;; rhaystack++, rneedle++) + { + if (*rneedle == '\0') + /* Found a match. */ + return (char *) haystack; + if (*rhaystack == '\0') + /* No match. */ + return NULL; + comparison_count++; + if (*rhaystack != *rneedle) + /* Nothing in this round. */ + break; + } + } + } + } + else + return (char *) haystack; + } +} diff --git a/local/recipes/tools/diffutils/source/lib/mbtowc-impl.h b/local/recipes/tools/diffutils/source/lib/mbtowc-impl.h new file mode 100644 index 0000000000..b53b2eb053 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mbtowc-impl.h @@ -0,0 +1,44 @@ +/* Convert multibyte character to wide character. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2011. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* We don't need a static internal state, because the encoding is not state + dependent, and when mbrtowc returns (size_t)(-2). we throw the result + away. */ + +int +mbtowc (wchar_t *pwc, const char *s, size_t n) +{ + if (s == NULL) + return 0; + else + { + mbstate_t state; + wchar_t wc; + size_t result; + + memset (&state, 0, sizeof (mbstate_t)); + result = mbrtowc (&wc, s, n, &state); + if (result == (size_t)-1 || result == (size_t)-2) + { + errno = EILSEQ; + return -1; + } + if (pwc != NULL) + *pwc = wc; + return (wc == 0 ? 0 : result); + } +} diff --git a/local/recipes/tools/diffutils/source/lib/mbtowc.c b/local/recipes/tools/diffutils/source/lib/mbtowc.c new file mode 100644 index 0000000000..118754f305 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mbtowc.c @@ -0,0 +1,26 @@ +/* Convert multibyte character to wide character. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2011. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <stdlib.h> + +#include <errno.h> +#include <string.h> +#include <wchar.h> + +#include "mbtowc-impl.h" diff --git a/local/recipes/tools/diffutils/source/lib/mbuiter.c b/local/recipes/tools/diffutils/source/lib/mbuiter.c new file mode 100644 index 0000000000..9167580d0d --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mbuiter.c @@ -0,0 +1,3 @@ +#include <config.h> +#define MBUITER_INLINE _GL_EXTERN_INLINE +#include "mbuiter.h" diff --git a/local/recipes/tools/diffutils/source/lib/mbuiter.h b/local/recipes/tools/diffutils/source/lib/mbuiter.h new file mode 100644 index 0000000000..c025e442b4 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mbuiter.h @@ -0,0 +1,232 @@ +/* Iterating through multibyte strings: macros for multi-byte encodings. + Copyright (C) 2001, 2005, 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>. */ + +/* The macros in this file implement forward iteration through a + multi-byte string, without knowing its length a-priori. + + With these macros, an iteration loop that looks like + + char *iter; + for (iter = buf; *iter != '\0'; iter++) + { + do_something (*iter); + } + + becomes + + mbui_iterator_t iter; + for (mbui_init (iter, buf); mbui_avail (iter); mbui_advance (iter)) + { + do_something (mbui_cur_ptr (iter), mb_len (mbui_cur (iter))); + } + + The benefit of these macros over plain use of mbrtowc is: + - Handling of invalid multibyte sequences is possible without + making the code more complicated, while still preserving the + invalid multibyte sequences. + + Compared to mbiter.h, the macros here don't need to know the string's + length a-priori. The downside is that at each step, the look-ahead + that guards against overrunning the terminating '\0' is more expensive. + The mbui_* macros are therefore suitable when there is a high probability + that only the first few multibyte characters need to be inspected. + Whereas the mbi_* macros are better if usually the iteration runs + through the entire string. + + mbui_iterator_t + is a type usable for variable declarations. + + mbui_init (iter, startptr) + initializes the iterator, starting at startptr. + + mbui_avail (iter) + returns true if there are more multibyte characters available before + the end of string is reached. In this case, mbui_cur (iter) is + initialized to the next multibyte character. + + mbui_advance (iter) + advances the iterator by one multibyte character. + + mbui_cur (iter) + returns the current multibyte character, of type mbchar_t. All the + macros defined in mbchar.h can be used on it. + + mbui_cur_ptr (iter) + return a pointer to the beginning of the current multibyte character. + + mbui_reloc (iter, ptrdiff) + relocates iterator when the string is moved by ptrdiff bytes. + + mbui_copy (&destiter, &srciter) + copies srciter to destiter. + + Here are the function prototypes of the macros. + + extern void mbui_init (mbui_iterator_t iter, const char *startptr); + extern bool mbui_avail (mbui_iterator_t iter); + extern void mbui_advance (mbui_iterator_t iter); + extern mbchar_t mbui_cur (mbui_iterator_t iter); + extern const char * mbui_cur_ptr (mbui_iterator_t iter); + extern void mbui_reloc (mbui_iterator_t iter, ptrdiff_t ptrdiff); + extern void mbui_copy (mbui_iterator_t *new, const mbui_iterator_t *old); + */ + +#ifndef _MBUITER_H +#define _MBUITER_H 1 + +#include <assert.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdlib.h> +#include <string.h> + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before + <wchar.h>. */ +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +#include "mbchar.h" +#include "strnlen1.h" + +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef MBUITER_INLINE +# define MBUITER_INLINE _GL_INLINE +#endif + +struct mbuiter_multi +{ + bool in_shift; /* true if next byte may not be interpreted as ASCII */ + mbstate_t state; /* if in_shift: current shift state */ + bool next_done; /* true if mbui_avail has already filled the following */ + struct mbchar cur; /* the current character: + const char *cur.ptr pointer to current character + The following are only valid after mbui_avail. + size_t cur.bytes number of bytes of current character + bool cur.wc_valid true if wc is a valid wide character + wchar_t cur.wc if wc_valid: the current character + */ +}; + +MBUITER_INLINE void +mbuiter_multi_next (struct mbuiter_multi *iter) +{ + if (iter->next_done) + return; + if (iter->in_shift) + goto with_shift; + /* Handle most ASCII characters quickly, without calling mbrtowc(). */ + if (is_basic (*iter->cur.ptr)) + { + /* These characters are part of the basic character set. ISO C 99 + guarantees that their wide character code is identical to their + char code. */ + iter->cur.bytes = 1; + iter->cur.wc = *iter->cur.ptr; + iter->cur.wc_valid = true; + } + else + { + assert (mbsinit (&iter->state)); + iter->in_shift = true; + with_shift: + iter->cur.bytes = mbrtowc (&iter->cur.wc, iter->cur.ptr, + strnlen1 (iter->cur.ptr, MB_CUR_MAX), + &iter->state); + if (iter->cur.bytes == (size_t) -1) + { + /* An invalid multibyte sequence was encountered. */ + iter->cur.bytes = 1; + iter->cur.wc_valid = false; + /* Whether to set iter->in_shift = false and reset iter->state + or not is not very important; the string is bogus anyway. */ + } + else if (iter->cur.bytes == (size_t) -2) + { + /* An incomplete multibyte character at the end. */ + iter->cur.bytes = strlen (iter->cur.ptr); + iter->cur.wc_valid = false; + /* Whether to set iter->in_shift = false and reset iter->state + or not is not important; the string end is reached anyway. */ + } + else + { + if (iter->cur.bytes == 0) + { + /* A null wide character was encountered. */ + iter->cur.bytes = 1; + assert (*iter->cur.ptr == '\0'); + assert (iter->cur.wc == 0); + } + iter->cur.wc_valid = true; + + /* When in the initial state, we can go back treating ASCII + characters more quickly. */ + if (mbsinit (&iter->state)) + iter->in_shift = false; + } + } + iter->next_done = true; +} + +MBUITER_INLINE void +mbuiter_multi_reloc (struct mbuiter_multi *iter, ptrdiff_t ptrdiff) +{ + iter->cur.ptr += ptrdiff; +} + +MBUITER_INLINE void +mbuiter_multi_copy (struct mbuiter_multi *new_iter, const struct mbuiter_multi *old_iter) +{ + if ((new_iter->in_shift = old_iter->in_shift)) + memcpy (&new_iter->state, &old_iter->state, sizeof (mbstate_t)); + else + memset (&new_iter->state, 0, sizeof (mbstate_t)); + new_iter->next_done = old_iter->next_done; + mb_copy (&new_iter->cur, &old_iter->cur); +} + +/* Iteration macros. */ +typedef struct mbuiter_multi mbui_iterator_t; +#define mbui_init(iter, startptr) \ + ((iter).cur.ptr = (startptr), \ + (iter).in_shift = false, memset (&(iter).state, '\0', sizeof (mbstate_t)), \ + (iter).next_done = false) +#define mbui_avail(iter) \ + (mbuiter_multi_next (&(iter)), !mb_isnul ((iter).cur)) +#define mbui_advance(iter) \ + ((iter).cur.ptr += (iter).cur.bytes, (iter).next_done = false) + +/* Access to the current character. */ +#define mbui_cur(iter) (iter).cur +#define mbui_cur_ptr(iter) (iter).cur.ptr + +/* Relocation. */ +#define mbui_reloc(iter, ptrdiff) mbuiter_multi_reloc (&iter, ptrdiff) + +/* Copying an iterator. */ +#define mbui_copy mbuiter_multi_copy + +_GL_INLINE_HEADER_END + +#endif /* _MBUITER_H */ diff --git a/local/recipes/tools/diffutils/source/lib/memchr.c b/local/recipes/tools/diffutils/source/lib/memchr.c new file mode 100644 index 0000000000..34812609fb --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/memchr.c @@ -0,0 +1,172 @@ +/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2017 + Free Software Foundation, Inc. + + Based on strlen implementation by Torbjorn Granlund (tege@sics.se), + with help from Dan Sahlin (dan@sics.se) and + commentary by Jim Blandy (jimb@ai.mit.edu); + adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu), + and implemented by Roland McGrath (roland@ai.mit.edu). + +NOTE: The canonical source of this file is maintained with the GNU C Library. +Bugs can be reported to bug-glibc@prep.ai.mit.edu. + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or any +later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _LIBC +# include <config.h> +#endif + +#include <string.h> + +#include <stddef.h> + +#if defined _LIBC +# include <memcopy.h> +#else +# define reg_char char +#endif + +#include <limits.h> + +#if HAVE_BP_SYM_H || defined _LIBC +# include <bp-sym.h> +#else +# define BP_SYM(sym) sym +#endif + +#undef __memchr +#ifdef _LIBC +# undef memchr +#endif + +#ifndef weak_alias +# define __memchr memchr +#endif + +/* Search no more than N bytes of S for C. */ +void * +__memchr (void const *s, int c_in, size_t n) +{ + /* On 32-bit hardware, choosing longword to be a 32-bit unsigned + long instead of a 64-bit uintmax_t tends to give better + performance. On 64-bit hardware, unsigned long is generally 64 + bits already. Change this typedef to experiment with + performance. */ + typedef unsigned long int longword; + + const unsigned char *char_ptr; + const longword *longword_ptr; + longword repeated_one; + longword repeated_c; + unsigned reg_char c; + + c = (unsigned char) c_in; + + /* Handle the first few bytes by reading one byte at a time. + Do this until CHAR_PTR is aligned on a longword boundary. */ + for (char_ptr = (const unsigned char *) s; + n > 0 && (size_t) char_ptr % sizeof (longword) != 0; + --n, ++char_ptr) + if (*char_ptr == c) + return (void *) char_ptr; + + longword_ptr = (const longword *) char_ptr; + + /* All these elucidatory comments refer to 4-byte longwords, + but the theory applies equally well to any size longwords. */ + + /* Compute auxiliary longword values: + repeated_one is a value which has a 1 in every byte. + repeated_c has c in every byte. */ + repeated_one = 0x01010101; + repeated_c = c | (c << 8); + repeated_c |= repeated_c << 16; + if (0xffffffffU < (longword) -1) + { + repeated_one |= repeated_one << 31 << 1; + repeated_c |= repeated_c << 31 << 1; + if (8 < sizeof (longword)) + { + size_t i; + + for (i = 64; i < sizeof (longword) * 8; i *= 2) + { + repeated_one |= repeated_one << i; + repeated_c |= repeated_c << i; + } + } + } + + /* Instead of the traditional loop which tests each byte, we will test a + longword at a time. The tricky part is testing if *any of the four* + bytes in the longword in question are equal to c. We first use an xor + with repeated_c. This reduces the task to testing whether *any of the + four* bytes in longword1 is zero. + + We compute tmp = + ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7). + That is, we perform the following operations: + 1. Subtract repeated_one. + 2. & ~longword1. + 3. & a mask consisting of 0x80 in every byte. + Consider what happens in each byte: + - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff, + and step 3 transforms it into 0x80. A carry can also be propagated + to more significant bytes. + - If a byte of longword1 is nonzero, let its lowest 1 bit be at + position k (0 <= k <= 7); so the lowest k bits are 0. After step 1, + the byte ends in a single bit of value 0 and k bits of value 1. + After step 2, the result is just k bits of value 1: 2^k - 1. After + step 3, the result is 0. And no carry is produced. + So, if longword1 has only non-zero bytes, tmp is zero. + Whereas if longword1 has a zero byte, call j the position of the least + significant zero byte. Then the result has a zero at positions 0, ..., + j-1 and a 0x80 at position j. We cannot predict the result at the more + significant bytes (positions j+1..3), but it does not matter since we + already have a non-zero bit at position 8*j+7. + + So, the test whether any byte in longword1 is zero is equivalent to + testing whether tmp is nonzero. */ + + while (n >= sizeof (longword)) + { + longword longword1 = *longword_ptr ^ repeated_c; + + if ((((longword1 - repeated_one) & ~longword1) + & (repeated_one << 7)) != 0) + break; + longword_ptr++; + n -= sizeof (longword); + } + + char_ptr = (const unsigned char *) longword_ptr; + + /* At this point, we know that either n < sizeof (longword), or one of the + sizeof (longword) bytes starting at char_ptr is == c. On little-endian + machines, we could determine the first such byte without any further + memory accesses, just by looking at the tmp result from the last loop + iteration. But this does not work on big-endian machines. Choose code + that works in both cases. */ + + for (; n > 0; --n, ++char_ptr) + { + if (*char_ptr == c) + return (void *) char_ptr; + } + + return NULL; +} +#ifdef weak_alias +weak_alias (__memchr, BP_SYM (memchr)) +#endif diff --git a/local/recipes/tools/diffutils/source/lib/memchr.valgrind b/local/recipes/tools/diffutils/source/lib/memchr.valgrind new file mode 100644 index 0000000000..60f247e10d --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/memchr.valgrind @@ -0,0 +1,14 @@ +# Suppress a valgrind message about use of uninitialized memory in memchr(). +# POSIX states that when the character is found, memchr must not read extra +# bytes in an overestimated length (for example, where memchr is used to +# implement strnlen). However, we use a safe word read to provide a speedup. +{ + memchr-value4 + Memcheck:Value4 + fun:rpl_memchr +} +{ + memchr-value8 + Memcheck:Value8 + fun:rpl_memchr +} diff --git a/local/recipes/tools/diffutils/source/lib/minmax.h b/local/recipes/tools/diffutils/source/lib/minmax.h new file mode 100644 index 0000000000..6b602a94fd --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/minmax.h @@ -0,0 +1,60 @@ +/* MIN, MAX macros. + Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2017 Free Software + Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _MINMAX_H +#define _MINMAX_H + +/* Note: MIN, MAX are also defined in <sys/param.h> on some systems + (glibc, IRIX, HP-UX, OSF/1). Therefore you might get warnings about + MIN, MAX macro redefinitions on some systems; the workaround is to + #include this file as the last one among the #include list. */ + +/* Before we define the following symbols we get the <limits.h> file + since otherwise we get redefinitions on some systems if <limits.h> is + included after this file. Likewise for <sys/param.h>. + If more than one of these system headers define MIN and MAX, pick just + one of the headers (because the definitions most likely are the same). */ +#if HAVE_MINMAX_IN_LIMITS_H +# include <limits.h> +#elif HAVE_MINMAX_IN_SYS_PARAM_H +# include <sys/param.h> +#endif + +/* Note: MIN and MAX should be used with two arguments of the + same type. They might not return the minimum and maximum of their two + arguments, if the arguments have different types or have unusual + floating-point values. For example, on a typical host with 32-bit 'int', + 64-bit 'long long', and 64-bit IEEE 754 'double' types: + + MAX (-1, 2147483648) returns 4294967295. + MAX (9007199254740992.0, 9007199254740993) returns 9007199254740992.0. + MAX (NaN, 0.0) returns 0.0. + MAX (+0.0, -0.0) returns -0.0. + + and in each case the answer is in some sense bogus. */ + +/* MAX(a,b) returns the maximum of A and B. */ +#ifndef MAX +# define MAX(a,b) ((a) > (b) ? (a) : (b)) +#endif + +/* MIN(a,b) returns the minimum of A and B. */ +#ifndef MIN +# define MIN(a,b) ((a) < (b) ? (a) : (b)) +#endif + +#endif /* _MINMAX_H */ diff --git a/local/recipes/tools/diffutils/source/lib/mkstemp.c b/local/recipes/tools/diffutils/source/lib/mkstemp.c new file mode 100644 index 0000000000..8083e1864d --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mkstemp.c @@ -0,0 +1,50 @@ +/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2017 Free Software + Foundation, Inc. + This file is derived from the one in the GNU C Library. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#if !_LIBC +# include <config.h> +#endif + +#include <stdlib.h> + +#if !_LIBC +# include "tempname.h" +# define __gen_tempname gen_tempname +# ifndef __GT_FILE +# define __GT_FILE GT_FILE +# endif +#endif + +#include <stdio.h> + +#ifndef __GT_FILE +# define __GT_FILE 0 +#endif + +/* Generate a unique temporary file name from XTEMPLATE. + The last six characters of XTEMPLATE must be "XXXXXX"; + they are replaced with a string that makes the file name unique. + Then open the file and return a fd. + + If you are creating temporary files which will later be removed, + consider using the clean-temp module, which avoids several pitfalls + of using mkstemp directly. */ +int +mkstemp (char *xtemplate) +{ + return __gen_tempname (xtemplate, 0, 0, __GT_FILE); +} diff --git a/local/recipes/tools/diffutils/source/lib/mktime-internal.h b/local/recipes/tools/diffutils/source/lib/mktime-internal.h new file mode 100644 index 0000000000..6c8b2e7f52 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mktime-internal.h @@ -0,0 +1,37 @@ +/* mktime variant that also uses an offset guess + + Copyright 2016-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <time.h> + +/* mktime_offset_t is a signed type wide enough to hold a UTC offset + in seconds, and used as part of the type of the offset-guess + argument to mktime_internal. Use time_t on platforms where time_t + is signed, to be compatible with platforms like BeOS that export + this implementation detail of mktime. On platforms where time_t is + unsigned, GNU and POSIX code can assume 'int' is at least 32 bits + which is wide enough for a UTC offset. */ + +#if TIME_T_IS_SIGNED +typedef time_t mktime_offset_t; +#else +typedef int mktime_offset_t; +#endif + +time_t mktime_internal (struct tm *, + struct tm * (*) (time_t const *, struct tm *), + mktime_offset_t *); diff --git a/local/recipes/tools/diffutils/source/lib/mktime.c b/local/recipes/tools/diffutils/source/lib/mktime.c new file mode 100644 index 0000000000..058ab65c03 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/mktime.c @@ -0,0 +1,690 @@ +/* Convert a 'struct tm' to a time_t value. + Copyright (C) 1993-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Paul Eggert <eggert@twinsun.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* Define this to 1 to have a standalone program to test this implementation of + mktime. */ +#ifndef DEBUG_MKTIME +# define DEBUG_MKTIME 0 +#endif + +/* The following macros influence what gets defined when this file is compiled: + + Macro/expression Which gnulib module This compilation unit + should define + + NEED_MKTIME_WORKING mktime rpl_mktime + || NEED_MKTIME_WINDOWS + + NEED_MKTIME_INTERNAL mktime-internal mktime_internal + + DEBUG_MKTIME (defined manually) my_mktime, main + */ + +#if !defined _LIBC && !DEBUG_MKTIME +# include <config.h> +#endif + +/* Assume that leap seconds are possible, unless told otherwise. + If the host has a 'zic' command with a '-L leapsecondfilename' option, + then it supports leap seconds; otherwise it probably doesn't. */ +#ifndef LEAP_SECONDS_POSSIBLE +# define LEAP_SECONDS_POSSIBLE 1 +#endif + +#include <time.h> + +#include <limits.h> +#include <stdbool.h> + +#include <intprops.h> +#include <verify.h> + +#if DEBUG_MKTIME +# include <stdio.h> +# include <stdlib.h> +# include <string.h> +/* Make it work even if the system's libc has its own mktime routine. */ +# undef mktime +# define mktime my_mktime +#endif + +#if NEED_MKTIME_WINDOWS /* on native Windows */ +# include <stdlib.h> +# include <string.h> +#endif + +#if NEED_MKTIME_WORKING || NEED_MKTIME_INTERNAL || DEBUG_MKTIME + +/* A signed type that can represent an integer number of years + multiplied by three times the number of seconds in a year. It is + needed when converting a tm_year value times the number of seconds + in a year. The factor of three comes because these products need + to be subtracted from each other, and sometimes with an offset + added to them, without worrying about overflow. + + Much of the code uses long_int to represent time_t values, to + lessen the hassle of dealing with platforms where time_t is + unsigned, and because long_int should suffice to represent all + time_t values that mktime can generate even on platforms where + time_t is excessively wide. */ + +#if INT_MAX <= LONG_MAX / 3 / 366 / 24 / 60 / 60 +typedef long int long_int; +#else +typedef long long int long_int; +#endif +verify (INT_MAX <= TYPE_MAXIMUM (long_int) / 3 / 366 / 24 / 60 / 60); + +/* Shift A right by B bits portably, by dividing A by 2**B and + truncating towards minus infinity. B should be in the range 0 <= B + <= LONG_INT_BITS - 2, where LONG_INT_BITS is the number of useful + bits in a long_int. LONG_INT_BITS is at least 32. + + ISO C99 says that A >> B is implementation-defined if A < 0. Some + implementations (e.g., UNICOS 9.0 on a Cray Y-MP EL) don't shift + right in the usual way when A < 0, so SHR falls back on division if + ordinary A >> B doesn't seem to be the usual signed shift. */ + +static long_int +shr (long_int a, int b) +{ + long_int one = 1; + return (-one >> 1 == -1 + ? a >> b + : a / (one << b) - (a % (one << b) < 0)); +} + +/* Bounds for the intersection of time_t and long_int. */ + +static long_int const mktime_min + = ((TYPE_SIGNED (time_t) && TYPE_MINIMUM (time_t) < TYPE_MINIMUM (long_int)) + ? TYPE_MINIMUM (long_int) : TYPE_MINIMUM (time_t)); +static long_int const mktime_max + = (TYPE_MAXIMUM (long_int) < TYPE_MAXIMUM (time_t) + ? TYPE_MAXIMUM (long_int) : TYPE_MAXIMUM (time_t)); + +verify (TYPE_IS_INTEGER (time_t)); + +#define EPOCH_YEAR 1970 +#define TM_YEAR_BASE 1900 +verify (TM_YEAR_BASE % 100 == 0); + +/* Is YEAR + TM_YEAR_BASE a leap year? */ +static bool +leapyear (long_int year) +{ + /* Don't add YEAR to TM_YEAR_BASE, as that might overflow. + Also, work even if YEAR is negative. */ + return + ((year & 3) == 0 + && (year % 100 != 0 + || ((year / 100) & 3) == (- (TM_YEAR_BASE / 100) & 3))); +} + +/* How many days come before each month (0-12). */ +#ifndef _LIBC +static +#endif +const unsigned short int __mon_yday[2][13] = + { + /* Normal years. */ + { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, + /* Leap years. */ + { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } + }; + + +#ifdef _LIBC +typedef time_t mktime_offset_t; +#else +/* Portable standalone applications should supply a <time.h> that + declares a POSIX-compliant localtime_r, for the benefit of older + implementations that lack localtime_r or have a nonstandard one. + See the gnulib time_r module for one way to implement this. */ +# undef __localtime_r +# define __localtime_r localtime_r +# define __mktime_internal mktime_internal +# include "mktime-internal.h" +#endif + +/* Do the values A and B differ according to the rules for tm_isdst? + A and B differ if one is zero and the other positive. */ +static bool +isdst_differ (int a, int b) +{ + return (!a != !b) && (0 <= a) && (0 <= b); +} + +/* Return an integer value measuring (YEAR1-YDAY1 HOUR1:MIN1:SEC1) - + (YEAR0-YDAY0 HOUR0:MIN0:SEC0) in seconds, assuming that the clocks + were not adjusted between the timestamps. + + The YEAR values uses the same numbering as TP->tm_year. Values + need not be in the usual range. However, YEAR1 must not overflow + when multiplied by three times the number of seconds in a year, and + likewise for YDAY1 and three times the number of seconds in a day. */ + +static long_int +ydhms_diff (long_int year1, long_int yday1, int hour1, int min1, int sec1, + int year0, int yday0, int hour0, int min0, int sec0) +{ + verify (-1 / 2 == 0); + + /* Compute intervening leap days correctly even if year is negative. + Take care to avoid integer overflow here. */ + int a4 = shr (year1, 2) + shr (TM_YEAR_BASE, 2) - ! (year1 & 3); + int b4 = shr (year0, 2) + shr (TM_YEAR_BASE, 2) - ! (year0 & 3); + int a100 = a4 / 25 - (a4 % 25 < 0); + int b100 = b4 / 25 - (b4 % 25 < 0); + int a400 = shr (a100, 2); + int b400 = shr (b100, 2); + int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400); + + /* Compute the desired time without overflowing. */ + long_int years = year1 - year0; + long_int days = 365 * years + yday1 - yday0 + intervening_leap_days; + long_int hours = 24 * days + hour1 - hour0; + long_int minutes = 60 * hours + min1 - min0; + long_int seconds = 60 * minutes + sec1 - sec0; + return seconds; +} + +/* Return the average of A and B, even if A + B would overflow. + Round toward positive infinity. */ +static long_int +long_int_avg (long_int a, long_int b) +{ + return shr (a, 1) + shr (b, 1) + ((a | b) & 1); +} + +/* Return a time_t value corresponding to (YEAR-YDAY HOUR:MIN:SEC), + assuming that T corresponds to *TP and that no clock adjustments + occurred between *TP and the desired time. + Although T and the returned value are of type long_int, + they represent time_t values and must be in time_t range. + If TP is null, return a value not equal to T; this avoids false matches. + YEAR and YDAY must not be so large that multiplying them by three times the + number of seconds in a year (or day, respectively) would overflow long_int. + If the returned value would be out of range, yield the minimal or + maximal in-range value, except do not yield a value equal to T. */ +static long_int +guess_time_tm (long_int year, long_int yday, int hour, int min, int sec, + long_int t, const struct tm *tp) +{ + if (tp) + { + long_int result; + long_int d = ydhms_diff (year, yday, hour, min, sec, + tp->tm_year, tp->tm_yday, + tp->tm_hour, tp->tm_min, tp->tm_sec); + if (! INT_ADD_WRAPV (t, d, &result)) + return result; + } + + /* Overflow occurred one way or another. Return the nearest result + that is actually in range, except don't report a zero difference + if the actual difference is nonzero, as that would cause a false + match; and don't oscillate between two values, as that would + confuse the spring-forward gap detector. */ + return (t < long_int_avg (mktime_min, mktime_max) + ? (t <= mktime_min + 1 ? t + 1 : mktime_min) + : (mktime_max - 1 <= t ? t - 1 : mktime_max)); +} + +/* Use CONVERT to convert T to a struct tm value in *TM. T must be in + range for time_t. Return TM if successful, NULL if T is out of + range for CONVERT. */ +static struct tm * +convert_time (struct tm *(*convert) (const time_t *, struct tm *), + long_int t, struct tm *tm) +{ + time_t x = t; + return convert (&x, tm); +} + +/* Use CONVERT to convert *T to a broken down time in *TP. + If *T is out of range for conversion, adjust it so that + it is the nearest in-range value and then convert that. + A value is in range if it fits in both time_t and long_int. */ +static struct tm * +ranged_convert (struct tm *(*convert) (const time_t *, struct tm *), + long_int *t, struct tm *tp) +{ + struct tm *r; + if (*t < mktime_min) + *t = mktime_min; + else if (mktime_max < *t) + *t = mktime_max; + r = convert_time (convert, *t, tp); + + if (!r && *t) + { + long_int bad = *t; + long_int ok = 0; + + /* BAD is a known unconvertible value, and OK is a known good one. + Use binary search to narrow the range between BAD and OK until + they differ by 1. */ + while (true) + { + long_int mid = long_int_avg (ok, bad); + if (mid != ok && mid != bad) + break; + r = convert_time (convert, mid, tp); + if (r) + ok = mid; + else + bad = mid; + } + + if (!r && ok) + { + /* The last conversion attempt failed; + revert to the most recent successful attempt. */ + r = convert_time (convert, ok, tp); + } + } + + return r; +} + +/* Convert *TP to a time_t value, inverting + the monotonic and mostly-unit-linear conversion function CONVERT. + Use *OFFSET to keep track of a guess at the offset of the result, + compared to what the result would be for UTC without leap seconds. + If *OFFSET's guess is correct, only one CONVERT call is needed. + This function is external because it is used also by timegm.c. */ +time_t +__mktime_internal (struct tm *tp, + struct tm *(*convert) (const time_t *, struct tm *), + mktime_offset_t *offset) +{ + long_int t, gt, t0, t1, t2, dt; + struct tm tm; + + /* The maximum number of probes (calls to CONVERT) should be enough + to handle any combinations of time zone rule changes, solar time, + leap seconds, and oscillations around a spring-forward gap. + POSIX.1 prohibits leap seconds, but some hosts have them anyway. */ + int remaining_probes = 6; + + /* Time requested. Copy it in case CONVERT modifies *TP; this can + occur if TP is localtime's returned value and CONVERT is localtime. */ + int sec = tp->tm_sec; + int min = tp->tm_min; + int hour = tp->tm_hour; + int mday = tp->tm_mday; + int mon = tp->tm_mon; + int year_requested = tp->tm_year; + int isdst = tp->tm_isdst; + + /* 1 if the previous probe was DST. */ + int dst2; + + /* Ensure that mon is in range, and set year accordingly. */ + int mon_remainder = mon % 12; + int negative_mon_remainder = mon_remainder < 0; + int mon_years = mon / 12 - negative_mon_remainder; + long_int lyear_requested = year_requested; + long_int year = lyear_requested + mon_years; + + /* The other values need not be in range: + the remaining code handles overflows correctly. */ + + /* Calculate day of year from year, month, and day of month. + The result need not be in range. */ + int mon_yday = ((__mon_yday[leapyear (year)] + [mon_remainder + 12 * negative_mon_remainder]) + - 1); + long_int lmday = mday; + long_int yday = mon_yday + lmday; + + int negative_offset_guess; + + int sec_requested = sec; + + if (LEAP_SECONDS_POSSIBLE) + { + /* Handle out-of-range seconds specially, + since ydhms_tm_diff assumes every minute has 60 seconds. */ + if (sec < 0) + sec = 0; + if (59 < sec) + sec = 59; + } + + /* Invert CONVERT by probing. First assume the same offset as last + time. */ + + INT_SUBTRACT_WRAPV (0, *offset, &negative_offset_guess); + t0 = ydhms_diff (year, yday, hour, min, sec, + EPOCH_YEAR - TM_YEAR_BASE, 0, 0, 0, negative_offset_guess); + + /* Repeatedly use the error to improve the guess. */ + + for (t = t1 = t2 = t0, dst2 = 0; + (gt = guess_time_tm (year, yday, hour, min, sec, t, + ranged_convert (convert, &t, &tm)), + t != gt); + t1 = t2, t2 = t, t = gt, dst2 = tm.tm_isdst != 0) + if (t == t1 && t != t2 + && (tm.tm_isdst < 0 + || (isdst < 0 + ? dst2 <= (tm.tm_isdst != 0) + : (isdst != 0) != (tm.tm_isdst != 0)))) + /* We can't possibly find a match, as we are oscillating + between two values. The requested time probably falls + within a spring-forward gap of size GT - T. Follow the common + practice in this case, which is to return a time that is GT - T + away from the requested time, preferring a time whose + tm_isdst differs from the requested value. (If no tm_isdst + was requested and only one of the two values has a nonzero + tm_isdst, prefer that value.) In practice, this is more + useful than returning -1. */ + goto offset_found; + else if (--remaining_probes == 0) + return -1; + + /* We have a match. Check whether tm.tm_isdst has the requested + value, if any. */ + if (isdst_differ (isdst, tm.tm_isdst)) + { + /* tm.tm_isdst has the wrong value. Look for a neighboring + time with the right value, and use its UTC offset. + + Heuristic: probe the adjacent timestamps in both directions, + looking for the desired isdst. This should work for all real + time zone histories in the tz database. */ + + /* Distance between probes when looking for a DST boundary. In + tzdata2003a, the shortest period of DST is 601200 seconds + (e.g., America/Recife starting 2000-10-08 01:00), and the + shortest period of non-DST surrounded by DST is 694800 + seconds (Africa/Tunis starting 1943-04-17 01:00). Use the + minimum of these two values, so we don't miss these short + periods when probing. */ + int stride = 601200; + + /* The longest period of DST in tzdata2003a is 536454000 seconds + (e.g., America/Jujuy starting 1946-10-01 01:00). The longest + period of non-DST is much longer, but it makes no real sense + to search for more than a year of non-DST, so use the DST + max. */ + int duration_max = 536454000; + + /* Search in both directions, so the maximum distance is half + the duration; add the stride to avoid off-by-1 problems. */ + int delta_bound = duration_max / 2 + stride; + + int delta, direction; + + for (delta = stride; delta < delta_bound; delta += stride) + for (direction = -1; direction <= 1; direction += 2) + { + long_int ot; + if (! INT_ADD_WRAPV (t, delta * direction, &ot)) + { + struct tm otm; + ranged_convert (convert, &ot, &otm); + if (! isdst_differ (isdst, otm.tm_isdst)) + { + /* We found the desired tm_isdst. + Extrapolate back to the desired time. */ + t = guess_time_tm (year, yday, hour, min, sec, ot, &otm); + ranged_convert (convert, &t, &tm); + goto offset_found; + } + } + } + } + + offset_found: + /* Set *OFFSET to the low-order bits of T - T0 - NEGATIVE_OFFSET_GUESS. + This is just a heuristic to speed up the next mktime call, and + correctness is unaffected if integer overflow occurs here. */ + INT_SUBTRACT_WRAPV (t, t0, &dt); + INT_SUBTRACT_WRAPV (dt, negative_offset_guess, offset); + + if (LEAP_SECONDS_POSSIBLE && sec_requested != tm.tm_sec) + { + /* Adjust time to reflect the tm_sec requested, not the normalized value. + Also, repair any damage from a false match due to a leap second. */ + long_int sec_adjustment = sec == 0 && tm.tm_sec == 60; + sec_adjustment -= sec; + sec_adjustment += sec_requested; + if (INT_ADD_WRAPV (t, sec_adjustment, &t) + || ! (mktime_min <= t && t <= mktime_max) + || ! convert_time (convert, t, &tm)) + return -1; + } + + *tp = tm; + return t; +} + +#endif /* NEED_MKTIME_WORKING || NEED_MKTIME_INTERNAL || DEBUG_MKTIME */ + +#if NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS || DEBUG_MKTIME + +# if NEED_MKTIME_WORKING || DEBUG_MKTIME +static mktime_offset_t localtime_offset; +# endif + +/* Convert *TP to a time_t value. */ +time_t +mktime (struct tm *tp) +{ +# if NEED_MKTIME_WINDOWS + /* Rectify the value of the environment variable TZ. + There are four possible kinds of such values: + - Traditional US time zone names, e.g. "PST8PDT". Syntax: see + <https://msdn.microsoft.com/en-us/library/90s5c885.aspx> + - Time zone names based on geography, that contain one or more + slashes, e.g. "Europe/Moscow". + - Time zone names based on geography, without slashes, e.g. + "Singapore". + - Time zone names that contain explicit DST rules. Syntax: see + <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03> + The Microsoft CRT understands only the first kind. It produces incorrect + results if the value of TZ is of the other kinds. + But in a Cygwin environment, /etc/profile.d/tzset.sh sets TZ to a value + of the second kind for most geographies, or of the first kind in a few + other geographies. If it is of the second kind, neutralize it. For the + Microsoft CRT, an absent or empty TZ means the time zone that the user + has set in the Windows Control Panel. + If the value of TZ is of the third or fourth kind -- Cygwin programs + understand these syntaxes as well --, it does not matter whether we + neutralize it or not, since these values occur only when a Cygwin user + has set TZ explicitly; this case is 1. rare and 2. under the user's + responsibility. */ + const char *tz = getenv ("TZ"); + if (tz != NULL && strchr (tz, '/') != NULL) + _putenv ("TZ="); +# endif + +# if NEED_MKTIME_WORKING || DEBUG_MKTIME +# ifdef _LIBC + /* POSIX.1 8.1.1 requires that whenever mktime() is called, the + time zone names contained in the external variable 'tzname' shall + be set as if the tzset() function had been called. */ + __tzset (); +# elif HAVE_TZSET + tzset (); +# endif + + return __mktime_internal (tp, __localtime_r, &localtime_offset); +# else +# undef mktime + return mktime (tp); +# endif +} + +#endif /* NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS || DEBUG_MKTIME */ + +#ifdef weak_alias +weak_alias (mktime, timelocal) +#endif + +#ifdef _LIBC +libc_hidden_def (mktime) +libc_hidden_weak (timelocal) +#endif + +#if DEBUG_MKTIME + +static int +not_equal_tm (const struct tm *a, const struct tm *b) +{ + return ((a->tm_sec ^ b->tm_sec) + | (a->tm_min ^ b->tm_min) + | (a->tm_hour ^ b->tm_hour) + | (a->tm_mday ^ b->tm_mday) + | (a->tm_mon ^ b->tm_mon) + | (a->tm_year ^ b->tm_year) + | (a->tm_yday ^ b->tm_yday) + | isdst_differ (a->tm_isdst, b->tm_isdst)); +} + +static void +print_tm (const struct tm *tp) +{ + if (tp) + printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d", + tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday, + tp->tm_hour, tp->tm_min, tp->tm_sec, + tp->tm_yday, tp->tm_wday, tp->tm_isdst); + else + printf ("0"); +} + +static int +check_result (time_t tk, struct tm tmk, time_t tl, const struct tm *lt) +{ + if (tk != tl || !lt || not_equal_tm (&tmk, lt)) + { + printf ("mktime ("); + print_tm (lt); + printf (")\nyields ("); + print_tm (&tmk); + printf (") == %ld, should be %ld\n", (long int) tk, (long int) tl); + return 1; + } + + return 0; +} + +int +main (int argc, char **argv) +{ + int status = 0; + struct tm tm, tmk, tml; + struct tm *lt; + time_t tk, tl, tl1; + char trailer; + + /* Sanity check, plus call tzset. */ + tl = 0; + if (! localtime (&tl)) + { + printf ("localtime (0) fails\n"); + status = 1; + } + + if ((argc == 3 || argc == 4) + && (sscanf (argv[1], "%d-%d-%d%c", + &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer) + == 3) + && (sscanf (argv[2], "%d:%d:%d%c", + &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer) + == 3)) + { + tm.tm_year -= TM_YEAR_BASE; + tm.tm_mon--; + tm.tm_isdst = argc == 3 ? -1 : atoi (argv[3]); + tmk = tm; + tl = mktime (&tmk); + lt = localtime_r (&tl, &tml); + printf ("mktime returns %ld == ", (long int) tl); + print_tm (&tmk); + printf ("\n"); + status = check_result (tl, tmk, tl, lt); + } + else if (argc == 4 || (argc == 5 && strcmp (argv[4], "-") == 0)) + { + time_t from = atol (argv[1]); + time_t by = atol (argv[2]); + time_t to = atol (argv[3]); + + if (argc == 4) + for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1) + { + lt = localtime_r (&tl, &tml); + if (lt) + { + tmk = tml; + tk = mktime (&tmk); + status |= check_result (tk, tmk, tl, &tml); + } + else + { + printf ("localtime_r (%ld) yields 0\n", (long int) tl); + status = 1; + } + tl1 = tl + by; + if ((tl1 < tl) != (by < 0)) + break; + } + else + for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1) + { + /* Null benchmark. */ + lt = localtime_r (&tl, &tml); + if (lt) + { + tmk = tml; + tk = tl; + status |= check_result (tk, tmk, tl, &tml); + } + else + { + printf ("localtime_r (%ld) yields 0\n", (long int) tl); + status = 1; + } + tl1 = tl + by; + if ((tl1 < tl) != (by < 0)) + break; + } + } + else + printf ("Usage:\ +\t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\ +\t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\ +\t%s FROM BY TO - # Do not test those values (for benchmark).\n", + argv[0], argv[0], argv[0]); + + return status; +} + +#endif /* DEBUG_MKTIME */ + +/* +Local Variables: +compile-command: "gcc -DDEBUG_MKTIME -I. -Wall -W -O2 -g mktime.c -o mktime" +End: +*/ diff --git a/local/recipes/tools/diffutils/source/lib/msvc-inval.c b/local/recipes/tools/diffutils/source/lib/msvc-inval.c new file mode 100644 index 0000000000..7139e93fca --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/msvc-inval.c @@ -0,0 +1,129 @@ +/* Invalid parameter handler for MSVC runtime libraries. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "msvc-inval.h" + +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \ + && !(MSVC_INVALID_PARAMETER_HANDLING == SANE_LIBRARY_HANDLING) + +/* Get _invalid_parameter_handler type and _set_invalid_parameter_handler + declaration. */ +# include <stdlib.h> + +# if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING + +static void __cdecl +gl_msvc_invalid_parameter_handler (const wchar_t *expression, + const wchar_t *function, + const wchar_t *file, + unsigned int line, + uintptr_t dummy) +{ +} + +# else + +/* Get declarations of the native Windows API functions. */ +# define WIN32_LEAN_AND_MEAN +# include <windows.h> + +# if defined _MSC_VER + +static void __cdecl +gl_msvc_invalid_parameter_handler (const wchar_t *expression, + const wchar_t *function, + const wchar_t *file, + unsigned int line, + uintptr_t dummy) +{ + RaiseException (STATUS_GNULIB_INVALID_PARAMETER, 0, 0, NULL); +} + +# else + +/* An index to thread-local storage. */ +static DWORD tls_index; +static int tls_initialized /* = 0 */; + +/* Used as a fallback only. */ +static struct gl_msvc_inval_per_thread not_per_thread; + +struct gl_msvc_inval_per_thread * +gl_msvc_inval_current (void) +{ + if (!tls_initialized) + { + tls_index = TlsAlloc (); + tls_initialized = 1; + } + if (tls_index == TLS_OUT_OF_INDEXES) + /* TlsAlloc had failed. */ + return ¬_per_thread; + else + { + struct gl_msvc_inval_per_thread *pointer = + (struct gl_msvc_inval_per_thread *) TlsGetValue (tls_index); + if (pointer == NULL) + { + /* First call. Allocate a new 'struct gl_msvc_inval_per_thread'. */ + pointer = + (struct gl_msvc_inval_per_thread *) + malloc (sizeof (struct gl_msvc_inval_per_thread)); + if (pointer == NULL) + /* Could not allocate memory. Use the global storage. */ + pointer = ¬_per_thread; + TlsSetValue (tls_index, pointer); + } + return pointer; + } +} + +static void __cdecl +gl_msvc_invalid_parameter_handler (const wchar_t *expression, + const wchar_t *function, + const wchar_t *file, + unsigned int line, + uintptr_t dummy) +{ + struct gl_msvc_inval_per_thread *current = gl_msvc_inval_current (); + if (current->restart_valid) + longjmp (current->restart, 1); + else + /* An invalid parameter notification from outside the gnulib code. + Give the caller a chance to intervene. */ + RaiseException (STATUS_GNULIB_INVALID_PARAMETER, 0, 0, NULL); +} + +# endif + +# endif + +static int gl_msvc_inval_initialized /* = 0 */; + +void +gl_msvc_inval_ensure_handler (void) +{ + if (gl_msvc_inval_initialized == 0) + { + _set_invalid_parameter_handler (gl_msvc_invalid_parameter_handler); + gl_msvc_inval_initialized = 1; + } +} + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/msvc-inval.h b/local/recipes/tools/diffutils/source/lib/msvc-inval.h new file mode 100644 index 0000000000..6e216d6449 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/msvc-inval.h @@ -0,0 +1,222 @@ +/* Invalid parameter handler for MSVC runtime libraries. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _MSVC_INVAL_H +#define _MSVC_INVAL_H + +/* With MSVC runtime libraries with the "invalid parameter handler" concept, + functions like fprintf(), dup2(), or close() crash when the caller passes + an invalid argument. But POSIX wants error codes (such as EINVAL or EBADF) + instead. + This file defines macros that turn such an invalid parameter notification + into a non-local exit. An error code can then be produced at the target + of this exit. You can thus write code like + + TRY_MSVC_INVAL + { + <Code that can trigger an invalid parameter notification + but does not do 'return', 'break', 'continue', nor 'goto'.> + } + CATCH_MSVC_INVAL + { + <Code that handles an invalid parameter notification + but does not do 'return', 'break', 'continue', nor 'goto'.> + } + DONE_MSVC_INVAL; + + This entire block expands to a single statement. + + The handling of invalid parameters can be done in three ways: + + * The default way, which is reasonable for programs (not libraries): + AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [DEFAULT_HANDLING]) + + * The way for libraries that make "hairy" calls (like close(-1), or + fclose(fp) where fileno(fp) is closed, or simply getdtablesize()): + AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [HAIRY_LIBRARY_HANDLING]) + + * The way for libraries that make no "hairy" calls: + AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [SANE_LIBRARY_HANDLING]) + */ + +#define DEFAULT_HANDLING 0 +#define HAIRY_LIBRARY_HANDLING 1 +#define SANE_LIBRARY_HANDLING 2 + +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \ + && !(MSVC_INVALID_PARAMETER_HANDLING == SANE_LIBRARY_HANDLING) +/* A native Windows platform with the "invalid parameter handler" concept, + and either DEFAULT_HANDLING or HAIRY_LIBRARY_HANDLING. */ + +# if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING +/* Default handling. */ + +# ifdef __cplusplus +extern "C" { +# endif + +/* Ensure that the invalid parameter handler in installed that just returns. + Because we assume no other part of the program installs a different + invalid parameter handler, this solution is multithread-safe. */ +extern void gl_msvc_inval_ensure_handler (void); + +# ifdef __cplusplus +} +# endif + +# define TRY_MSVC_INVAL \ + do \ + { \ + gl_msvc_inval_ensure_handler (); \ + if (1) +# define CATCH_MSVC_INVAL \ + else +# define DONE_MSVC_INVAL \ + } \ + while (0) + +# else +/* Handling for hairy libraries. */ + +# include <excpt.h> + +/* Gnulib can define its own status codes, as described in the page + "Raising Software Exceptions" on microsoft.com + <http://msdn.microsoft.com/en-us/library/het71c37.aspx>. + Our status codes are composed of + - 0xE0000000, mandatory for all user-defined status codes, + - 0x474E550, a API identifier ("GNU"), + - 0, 1, 2, ..., used to distinguish different status codes from the + same API. */ +# define STATUS_GNULIB_INVALID_PARAMETER (0xE0000000 + 0x474E550 + 0) + +# if defined _MSC_VER +/* A compiler that supports __try/__except, as described in the page + "try-except statement" on microsoft.com + <http://msdn.microsoft.com/en-us/library/s58ftw19.aspx>. + With __try/__except, we can use the multithread-safe exception handling. */ + +# ifdef __cplusplus +extern "C" { +# endif + +/* Ensure that the invalid parameter handler in installed that raises a + software exception with code STATUS_GNULIB_INVALID_PARAMETER. + Because we assume no other part of the program installs a different + invalid parameter handler, this solution is multithread-safe. */ +extern void gl_msvc_inval_ensure_handler (void); + +# ifdef __cplusplus +} +# endif + +# define TRY_MSVC_INVAL \ + do \ + { \ + gl_msvc_inval_ensure_handler (); \ + __try +# define CATCH_MSVC_INVAL \ + __except (GetExceptionCode () == STATUS_GNULIB_INVALID_PARAMETER \ + ? EXCEPTION_EXECUTE_HANDLER \ + : EXCEPTION_CONTINUE_SEARCH) +# define DONE_MSVC_INVAL \ + } \ + while (0) + +# else +/* Any compiler. + We can only use setjmp/longjmp. */ + +# include <setjmp.h> + +# ifdef __cplusplus +extern "C" { +# endif + +struct gl_msvc_inval_per_thread +{ + /* The restart that will resume execution at the code between + CATCH_MSVC_INVAL and DONE_MSVC_INVAL. It is enabled only between + TRY_MSVC_INVAL and CATCH_MSVC_INVAL. */ + jmp_buf restart; + + /* Tells whether the contents of restart is valid. */ + int restart_valid; +}; + +/* Ensure that the invalid parameter handler in installed that passes + control to the gl_msvc_inval_restart if it is valid, or raises a + software exception with code STATUS_GNULIB_INVALID_PARAMETER otherwise. + Because we assume no other part of the program installs a different + invalid parameter handler, this solution is multithread-safe. */ +extern void gl_msvc_inval_ensure_handler (void); + +/* Return a pointer to the per-thread data for the current thread. */ +extern struct gl_msvc_inval_per_thread *gl_msvc_inval_current (void); + +# ifdef __cplusplus +} +# endif + +# define TRY_MSVC_INVAL \ + do \ + { \ + struct gl_msvc_inval_per_thread *msvc_inval_current; \ + gl_msvc_inval_ensure_handler (); \ + msvc_inval_current = gl_msvc_inval_current (); \ + /* First, initialize gl_msvc_inval_restart. */ \ + if (setjmp (msvc_inval_current->restart) == 0) \ + { \ + /* Then, mark it as valid. */ \ + msvc_inval_current->restart_valid = 1; +# define CATCH_MSVC_INVAL \ + /* Execution completed. \ + Mark gl_msvc_inval_restart as invalid. */ \ + msvc_inval_current->restart_valid = 0; \ + } \ + else \ + { \ + /* Execution triggered an invalid parameter notification. \ + Mark gl_msvc_inval_restart as invalid. */ \ + msvc_inval_current->restart_valid = 0; +# define DONE_MSVC_INVAL \ + } \ + } \ + while (0) + +# endif + +# endif + +#else +/* A platform that does not need to the invalid parameter handler, + or when SANE_LIBRARY_HANDLING is desired. */ + +/* The braces here avoid GCC warnings like + "warning: suggest explicit braces to avoid ambiguous 'else'". */ +# define TRY_MSVC_INVAL \ + do \ + { \ + if (1) +# define CATCH_MSVC_INVAL \ + else +# define DONE_MSVC_INVAL \ + } \ + while (0) + +#endif + +#endif /* _MSVC_INVAL_H */ diff --git a/local/recipes/tools/diffutils/source/lib/msvc-nothrow.c b/local/recipes/tools/diffutils/source/lib/msvc-nothrow.c new file mode 100644 index 0000000000..3e1eba39df --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/msvc-nothrow.c @@ -0,0 +1,51 @@ +/* Wrappers that don't throw invalid parameter notifications + with MSVC runtime libraries. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "msvc-nothrow.h" + +/* Get declarations of the native Windows API functions. */ +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER +# include "msvc-inval.h" +#endif + +#undef _get_osfhandle + +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER +intptr_t +_gl_nothrow_get_osfhandle (int fd) +{ + intptr_t result; + + TRY_MSVC_INVAL + { + result = _get_osfhandle (fd); + } + CATCH_MSVC_INVAL + { + result = (intptr_t) INVALID_HANDLE_VALUE; + } + DONE_MSVC_INVAL; + + return result; +} +#endif diff --git a/local/recipes/tools/diffutils/source/lib/msvc-nothrow.h b/local/recipes/tools/diffutils/source/lib/msvc-nothrow.h new file mode 100644 index 0000000000..c70efc79b0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/msvc-nothrow.h @@ -0,0 +1,43 @@ +/* Wrappers that don't throw invalid parameter notifications + with MSVC runtime libraries. + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _MSVC_NOTHROW_H +#define _MSVC_NOTHROW_H + +/* With MSVC runtime libraries with the "invalid parameter handler" concept, + functions like fprintf(), dup2(), or close() crash when the caller passes + an invalid argument. But POSIX wants error codes (such as EINVAL or EBADF) + instead. + This file defines wrappers that turn such an invalid parameter notification + into an error code. */ + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +/* Get original declaration of _get_osfhandle. */ +# include <io.h> + +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER + +/* Override _get_osfhandle. */ +extern intptr_t _gl_nothrow_get_osfhandle (int fd); +# define _get_osfhandle _gl_nothrow_get_osfhandle + +# endif + +#endif + +#endif /* _MSVC_NOTHROW_H */ diff --git a/local/recipes/tools/diffutils/source/lib/nl_langinfo.c b/local/recipes/tools/diffutils/source/lib/nl_langinfo.c new file mode 100644 index 0000000000..270570f7f0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/nl_langinfo.c @@ -0,0 +1,321 @@ +/* nl_langinfo() replacement: query locale dependent information. + + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <langinfo.h> + +#include <locale.h> +#include <string.h> +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# define WIN32_LEAN_AND_MEAN /* avoid including junk */ +# include <windows.h> +# include <stdio.h> +#endif + +/* Return the codeset of the current locale, if this is easily deducible. + Otherwise, return "". */ +static char * +ctype_codeset (void) +{ + static char buf[2 + 10 + 1]; + char const *locale = setlocale (LC_CTYPE, NULL); + char *codeset = buf; + size_t codesetlen; + codeset[0] = '\0'; + + if (locale && locale[0]) + { + /* If the locale name contains an encoding after the dot, return it. */ + char *dot = strchr (locale, '.'); + + if (dot) + { + /* Look for the possible @... trailer and remove it, if any. */ + char *codeset_start = dot + 1; + char const *modifier = strchr (codeset_start, '@'); + + if (! modifier) + codeset = codeset_start; + else + { + codesetlen = modifier - codeset_start; + if (codesetlen < sizeof buf) + { + codeset = memcpy (buf, codeset_start, codesetlen); + codeset[codesetlen] = '\0'; + } + } + } + } + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* If setlocale is successful, it returns the number of the + codepage, as a string. Otherwise, fall back on Windows API + GetACP, which returns the locale's codepage as a number (although + this doesn't change according to what the 'setlocale' call specified). + Either way, prepend "CP" to make it a valid codeset name. */ + codesetlen = strlen (codeset); + if (0 < codesetlen && codesetlen < sizeof buf - 2) + memmove (buf + 2, codeset, codesetlen + 1); + else + sprintf (buf + 2, "%u", GetACP ()); + codeset = memcpy (buf, "CP", 2); +#endif + return codeset; +} + + +#if REPLACE_NL_LANGINFO + +/* Override nl_langinfo with support for added nl_item values. */ + +# undef nl_langinfo + +char * +rpl_nl_langinfo (nl_item item) +{ + switch (item) + { +# if GNULIB_defined_CODESET + case CODESET: + return ctype_codeset (); +# endif +# if GNULIB_defined_T_FMT_AMPM + case T_FMT_AMPM: + return (char *) "%I:%M:%S %p"; +# endif +# if GNULIB_defined_ERA + case ERA: + /* The format is not standardized. In glibc it is a sequence of strings + of the form "direction:offset:start_date:end_date:era_name:era_format" + with an empty string at the end. */ + return (char *) ""; + case ERA_D_FMT: + /* The %Ex conversion in strftime behaves like %x if the locale does not + have an alternative time format. */ + item = D_FMT; + break; + case ERA_D_T_FMT: + /* The %Ec conversion in strftime behaves like %c if the locale does not + have an alternative time format. */ + item = D_T_FMT; + break; + case ERA_T_FMT: + /* The %EX conversion in strftime behaves like %X if the locale does not + have an alternative time format. */ + item = T_FMT; + break; + case ALT_DIGITS: + /* The format is not standardized. In glibc it is a sequence of 10 + strings, appended in memory. */ + return (char *) "\0\0\0\0\0\0\0\0\0\0"; +# endif +# if GNULIB_defined_YESEXPR || !FUNC_NL_LANGINFO_YESEXPR_WORKS + case YESEXPR: + return (char *) "^[yY]"; + case NOEXPR: + return (char *) "^[nN]"; +# endif + default: + break; + } + return nl_langinfo (item); +} + +#else + +/* Provide nl_langinfo from scratch, either for native MS-Windows, or + for old Unix platforms without locales, such as Linux libc5 or + BeOS. */ + +# include <time.h> + +char * +nl_langinfo (nl_item item) +{ + static char nlbuf[100]; + struct tm tmm = { 0 }; + + switch (item) + { + /* nl_langinfo items of the LC_CTYPE category */ + case CODESET: + { + char *codeset = ctype_codeset (); + if (*codeset) + return codeset; + } +# ifdef __BEOS__ + return (char *) "UTF-8"; +# else + return (char *) "ISO-8859-1"; +# endif + /* nl_langinfo items of the LC_NUMERIC category */ + case RADIXCHAR: + return localeconv () ->decimal_point; + case THOUSEP: + return localeconv () ->thousands_sep; + case GROUPING: + return localeconv () ->grouping; + /* nl_langinfo items of the LC_TIME category. + TODO: Really use the locale. */ + case D_T_FMT: + case ERA_D_T_FMT: + return (char *) "%a %b %e %H:%M:%S %Y"; + case D_FMT: + case ERA_D_FMT: + return (char *) "%m/%d/%y"; + case T_FMT: + case ERA_T_FMT: + return (char *) "%H:%M:%S"; + case T_FMT_AMPM: + return (char *) "%I:%M:%S %p"; + case AM_STR: + if (!strftime (nlbuf, sizeof nlbuf, "%p", &tmm)) + return (char *) "AM"; + return nlbuf; + case PM_STR: + tmm.tm_hour = 12; + if (!strftime (nlbuf, sizeof nlbuf, "%p", &tmm)) + return (char *) "PM"; + return nlbuf; + case DAY_1: + case DAY_2: + case DAY_3: + case DAY_4: + case DAY_5: + case DAY_6: + case DAY_7: + { + static char const days[][sizeof "Wednesday"] = { + "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", + "Friday", "Saturday" + }; + tmm.tm_wday = item - DAY_1; + if (!strftime (nlbuf, sizeof nlbuf, "%A", &tmm)) + return (char *) days[item - DAY_1]; + return nlbuf; + } + case ABDAY_1: + case ABDAY_2: + case ABDAY_3: + case ABDAY_4: + case ABDAY_5: + case ABDAY_6: + case ABDAY_7: + { + static char const abdays[][sizeof "Sun"] = { + "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" + }; + tmm.tm_wday = item - ABDAY_1; + if (!strftime (nlbuf, sizeof nlbuf, "%a", &tmm)) + return (char *) abdays[item - ABDAY_1]; + return nlbuf; + } + case MON_1: + case MON_2: + case MON_3: + case MON_4: + case MON_5: + case MON_6: + case MON_7: + case MON_8: + case MON_9: + case MON_10: + case MON_11: + case MON_12: + { + static char const months[][sizeof "September"] = { + "January", "February", "March", "April", "May", "June", "July", + "September", "October", "November", "December" + }; + tmm.tm_mon = item - MON_1; + if (!strftime (nlbuf, sizeof nlbuf, "%B", &tmm)) + return (char *) months[item - MON_1]; + return nlbuf; + } + case ABMON_1: + case ABMON_2: + case ABMON_3: + case ABMON_4: + case ABMON_5: + case ABMON_6: + case ABMON_7: + case ABMON_8: + case ABMON_9: + case ABMON_10: + case ABMON_11: + case ABMON_12: + { + static char const abmonths[][sizeof "Jan"] = { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", + "Sep", "Oct", "Nov", "Dec" + }; + tmm.tm_mon = item - ABMON_1; + if (!strftime (nlbuf, sizeof nlbuf, "%b", &tmm)) + return (char *) abmonths[item - ABMON_1]; + return nlbuf; + } + case ERA: + return (char *) ""; + case ALT_DIGITS: + return (char *) "\0\0\0\0\0\0\0\0\0\0"; + /* nl_langinfo items of the LC_MONETARY category. */ + case CRNCYSTR: + return localeconv () ->currency_symbol; + case INT_CURR_SYMBOL: + return localeconv () ->int_curr_symbol; + case MON_DECIMAL_POINT: + return localeconv () ->mon_decimal_point; + case MON_THOUSANDS_SEP: + return localeconv () ->mon_thousands_sep; + case MON_GROUPING: + return localeconv () ->mon_grouping; + case POSITIVE_SIGN: + return localeconv () ->positive_sign; + case NEGATIVE_SIGN: + return localeconv () ->negative_sign; + case FRAC_DIGITS: + return & localeconv () ->frac_digits; + case INT_FRAC_DIGITS: + return & localeconv () ->int_frac_digits; + case P_CS_PRECEDES: + return & localeconv () ->p_cs_precedes; + case N_CS_PRECEDES: + return & localeconv () ->n_cs_precedes; + case P_SEP_BY_SPACE: + return & localeconv () ->p_sep_by_space; + case N_SEP_BY_SPACE: + return & localeconv () ->n_sep_by_space; + case P_SIGN_POSN: + return & localeconv () ->p_sign_posn; + case N_SIGN_POSN: + return & localeconv () ->n_sign_posn; + /* nl_langinfo items of the LC_MESSAGES category + TODO: Really use the locale. */ + case YESEXPR: + return (char *) "^[yY]"; + case NOEXPR: + return (char *) "^[nN]"; + default: + return (char *) ""; + } +} + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/offtostr.c b/local/recipes/tools/diffutils/source/lib/offtostr.c new file mode 100644 index 0000000000..96082aafc0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/offtostr.c @@ -0,0 +1,3 @@ +#define anytostr offtostr +#define inttype off_t +#include "anytostr.c" diff --git a/local/recipes/tools/diffutils/source/lib/open.c b/local/recipes/tools/diffutils/source/lib/open.c new file mode 100644 index 0000000000..193dc45f6d --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/open.c @@ -0,0 +1,181 @@ +/* Open a descriptor to a file. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */ + +/* If the user's config.h happens to include <fcntl.h>, let it include only + the system's <fcntl.h> here, so that orig_open doesn't recurse to + rpl_open. */ +#define __need_system_fcntl_h +#include <config.h> + +/* Get the original definition of open. It might be defined as a macro. */ +#include <fcntl.h> +#include <sys/types.h> +#undef __need_system_fcntl_h + +static int +orig_open (const char *filename, int flags, mode_t mode) +{ + return open (filename, flags, mode); +} + +/* Specification. */ +/* Write "fcntl.h" here, not <fcntl.h>, otherwise OSF/1 5.1 DTK cc eliminates + this include because of the preliminary #include <fcntl.h> above. */ +#include "fcntl.h" + +#include <errno.h> +#include <stdarg.h> +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> + +#ifndef REPLACE_OPEN_DIRECTORY +# define REPLACE_OPEN_DIRECTORY 0 +#endif + +int +open (const char *filename, int flags, ...) +{ + mode_t mode; + int fd; + + mode = 0; + if (flags & O_CREAT) + { + va_list arg; + va_start (arg, flags); + + /* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4 + creates crashing code when 'mode_t' is smaller than 'int'. */ + mode = va_arg (arg, PROMOTED_MODE_T); + + va_end (arg); + } + +#if GNULIB_defined_O_NONBLOCK + /* The only known platform that lacks O_NONBLOCK is mingw, but it + also lacks named pipes and Unix sockets, which are the only two + file types that require non-blocking handling in open(). + Therefore, it is safe to ignore O_NONBLOCK here. It is handy + that mingw also lacks openat(), so that is also covered here. */ + flags &= ~O_NONBLOCK; +#endif + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + if (strcmp (filename, "/dev/null") == 0) + filename = "NUL"; +#endif + +#if OPEN_TRAILING_SLASH_BUG + /* If the filename ends in a slash and one of O_CREAT, O_WRONLY, O_RDWR + is specified, then fail. + Rationale: POSIX <http://www.opengroup.org/susv3/basedefs/xbd_chap04.html> + says that + "A pathname that contains at least one non-slash character and that + ends with one or more trailing slashes shall be resolved as if a + single dot character ( '.' ) were appended to the pathname." + and + "The special filename dot shall refer to the directory specified by + its predecessor." + If the named file already exists as a directory, then + - if O_CREAT is specified, open() must fail because of the semantics + of O_CREAT, + - if O_WRONLY or O_RDWR is specified, open() must fail because POSIX + <http://www.opengroup.org/susv3/functions/open.html> says that it + fails with errno = EISDIR in this case. + If the named file does not exist or does not name a directory, then + - if O_CREAT is specified, open() must fail since open() cannot create + directories, + - if O_WRONLY or O_RDWR is specified, open() must fail because the + file does not contain a '.' directory. */ + if (flags & (O_CREAT | O_WRONLY | O_RDWR)) + { + size_t len = strlen (filename); + if (len > 0 && filename[len - 1] == '/') + { + errno = EISDIR; + return -1; + } + } +#endif + + fd = orig_open (filename, flags, mode); + +#if REPLACE_FCHDIR + /* Implementing fchdir and fdopendir requires the ability to open a + directory file descriptor. If open doesn't support that (as on + mingw), we use a dummy file that behaves the same as directories + on Linux (ie. always reports EOF on attempts to read()), and + override fstat() in fchdir.c to hide the fact that we have a + dummy. */ + if (REPLACE_OPEN_DIRECTORY && fd < 0 && errno == EACCES + && ((flags & O_ACCMODE) == O_RDONLY + || (O_SEARCH != O_RDONLY && (flags & O_ACCMODE) == O_SEARCH))) + { + struct stat statbuf; + if (stat (filename, &statbuf) == 0 && S_ISDIR (statbuf.st_mode)) + { + /* Maximum recursion depth of 1. */ + fd = open ("/dev/null", flags, mode); + if (0 <= fd) + fd = _gl_register_fd (fd, filename); + } + else + errno = EACCES; + } +#endif + +#if OPEN_TRAILING_SLASH_BUG + /* If the filename ends in a slash and fd does not refer to a directory, + then fail. + Rationale: POSIX <http://www.opengroup.org/susv3/basedefs/xbd_chap04.html> + says that + "A pathname that contains at least one non-slash character and that + ends with one or more trailing slashes shall be resolved as if a + single dot character ( '.' ) were appended to the pathname." + and + "The special filename dot shall refer to the directory specified by + its predecessor." + If the named file without the slash is not a directory, open() must fail + with ENOTDIR. */ + if (fd >= 0) + { + /* We know len is positive, since open did not fail with ENOENT. */ + size_t len = strlen (filename); + if (filename[len - 1] == '/') + { + struct stat statbuf; + + if (fstat (fd, &statbuf) >= 0 && !S_ISDIR (statbuf.st_mode)) + { + close (fd); + errno = ENOTDIR; + return -1; + } + } + } +#endif + +#if REPLACE_FCHDIR + if (!REPLACE_OPEN_DIRECTORY && 0 <= fd) + fd = _gl_register_fd (fd, filename); +#endif + + return fd; +} diff --git a/local/recipes/tools/diffutils/source/lib/pathmax.h b/local/recipes/tools/diffutils/source/lib/pathmax.h new file mode 100644 index 0000000000..aa0730e27a --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/pathmax.h @@ -0,0 +1,83 @@ +/* Define PATH_MAX somehow. Requires sys/types.h. + Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2017 Free Software + Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _PATHMAX_H +# define _PATHMAX_H + +/* POSIX:2008 defines PATH_MAX to be the maximum number of bytes in a filename, + including the terminating NUL byte. + <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html> + PATH_MAX is not defined on systems which have no limit on filename length, + such as GNU/Hurd. + + This file does *not* define PATH_MAX always. Programs that use this file + can handle the GNU/Hurd case in several ways: + - Either with a package-wide handling, or with a per-file handling, + - Either through a + #ifdef PATH_MAX + or through a fallback like + #ifndef PATH_MAX + # define PATH_MAX 8192 + #endif + or through a fallback like + #ifndef PATH_MAX + # define PATH_MAX pathconf ("/", _PC_PATH_MAX) + #endif + */ + +# include <unistd.h> + +# include <limits.h> + +# ifndef _POSIX_PATH_MAX +# define _POSIX_PATH_MAX 256 +# endif + +/* Don't include sys/param.h if it already has been. */ +# if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN +# include <sys/param.h> +# endif + +# if !defined PATH_MAX && defined MAXPATHLEN +# define PATH_MAX MAXPATHLEN +# endif + +# ifdef __hpux +/* On HP-UX, PATH_MAX designates the maximum number of bytes in a filename, + *not* including the terminating NUL byte, and is set to 1023. + Additionally, when _XOPEN_SOURCE is defined to 500 or more, PATH_MAX is + not defined at all any more. */ +# undef PATH_MAX +# define PATH_MAX 1024 +# endif + +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* The page "Naming Files, Paths, and Namespaces" on msdn.microsoft.com, + section "Maximum Path Length Limitation", + <http://msdn.microsoft.com/en-us/library/aa365247(v=vs.85).aspx#maxpath> + explains that the maximum size of a filename, including the terminating + NUL byte, is 260 = 3 + 256 + 1. + This is the same value as + - FILENAME_MAX in <stdio.h>, + - _MAX_PATH in <stdlib.h>, + - MAX_PATH in <windef.h>. + Undefine the original value, because mingw's <limits.h> gets it wrong. */ +# undef PATH_MAX +# define PATH_MAX 260 +# endif + +#endif /* _PATHMAX_H */ diff --git a/local/recipes/tools/diffutils/source/lib/prepargs.c b/local/recipes/tools/diffutils/source/lib/prepargs.c new file mode 100644 index 0000000000..c4928cd9e7 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/prepargs.c @@ -0,0 +1,91 @@ +/* Parse arguments from a string and prepend them to an argv. + + Copyright (C) 1999-2002, 2006, 2009-2013, 2015-2017 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert <eggert@twinsun.com>. */ + +#include <config.h> + +#include "prepargs.h" +#include <string.h> +#include <sys/types.h> +#include <xalloc.h> + +#include <ctype.h> + +/* IN_CTYPE_DOMAIN (C) is nonzero if the unsigned char C can safely be given + as an argument to <ctype.h> macros like "isspace". */ +#ifdef STDC_HEADERS +# define IN_CTYPE_DOMAIN(c) 1 +#else +# define IN_CTYPE_DOMAIN(c) ((c) <= 0177) +#endif + +#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c)) + +/* Find the white-space-separated options specified by OPTIONS, and + using BUF to store copies of these options, set ARGV[0], ARGV[1], + etc. to the option copies. Return the number N of options found. + Do not set ARGV[N]. If ARGV is zero, do not store ARGV[0] etc. + Backslash can be used to escape whitespace (and backslashes). */ +static int +prepend_args (char const *options, char *buf, char **argv) +{ + char const *o = options; + char *b = buf; + int n = 0; + + for (;;) + { + while (ISSPACE ((unsigned char) *o)) + o++; + if (!*o) + return n; + if (argv) + argv[n] = b; + n++; + + do + if ((*b++ = *o++) == '\\' && *o) + b[-1] = *o++; + while (*o && ! ISSPACE ((unsigned char) *o)); + + *b++ = '\0'; + } +} + +/* Prepend the whitespace-separated options in OPTIONS to the argument + vector of a main program with argument count *PARGC and argument + vector *PARGV. */ +void +prepend_default_options (char const *options, int *pargc, char ***pargv) +{ + if (options) + { + char *buf = xmalloc (strlen (options) + 1); + int prepended = prepend_args (options, buf, (char **) 0); + int argc = *pargc; + char * const *argv = *pargv; + char **pp = xmalloc ((prepended + argc + 1) * sizeof *pp); + *pargc = prepended + argc; + *pargv = pp; + *pp++ = *argv++; + pp += prepend_args (options, buf, pp); + while ((*pp++ = *argv++)) + continue; + } +} diff --git a/local/recipes/tools/diffutils/source/lib/prepargs.h b/local/recipes/tools/diffutils/source/lib/prepargs.h new file mode 100644 index 0000000000..ce93ea870c --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/prepargs.h @@ -0,0 +1,3 @@ +/* Parse arguments from a string and prepend them to an argv. */ + +void prepend_default_options (char const *, int *, char ***); diff --git a/local/recipes/tools/diffutils/source/lib/printf-args.c b/local/recipes/tools/diffutils/source/lib/printf-args.c new file mode 100644 index 0000000000..fec7e6214f --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/printf-args.c @@ -0,0 +1,187 @@ +/* Decomposed printf argument list. + Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2017 Free Software + Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* This file can be parametrized with the following macros: + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. + PRINTF_FETCHARGS Name of the function to be defined. + STATIC Set to 'static' to declare the function static. */ + +#ifndef PRINTF_FETCHARGS +# include <config.h> +#endif + +/* Specification. */ +#ifndef PRINTF_FETCHARGS +# include "printf-args.h" +#endif + +#ifdef STATIC +STATIC +#endif +int +PRINTF_FETCHARGS (va_list args, arguments *a) +{ + size_t i; + argument *ap; + + for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++) + switch (ap->type) + { + case TYPE_SCHAR: + ap->a.a_schar = va_arg (args, /*signed char*/ int); + break; + case TYPE_UCHAR: + ap->a.a_uchar = va_arg (args, /*unsigned char*/ int); + break; + case TYPE_SHORT: + ap->a.a_short = va_arg (args, /*short*/ int); + break; + case TYPE_USHORT: + ap->a.a_ushort = va_arg (args, /*unsigned short*/ int); + break; + case TYPE_INT: + ap->a.a_int = va_arg (args, int); + break; + case TYPE_UINT: + ap->a.a_uint = va_arg (args, unsigned int); + break; + case TYPE_LONGINT: + ap->a.a_longint = va_arg (args, long int); + break; + case TYPE_ULONGINT: + ap->a.a_ulongint = va_arg (args, unsigned long int); + break; +#if HAVE_LONG_LONG_INT + case TYPE_LONGLONGINT: + ap->a.a_longlongint = va_arg (args, long long int); + break; + case TYPE_ULONGLONGINT: + ap->a.a_ulonglongint = va_arg (args, unsigned long long int); + break; +#endif + case TYPE_DOUBLE: + ap->a.a_double = va_arg (args, double); + break; + case TYPE_LONGDOUBLE: + ap->a.a_longdouble = va_arg (args, long double); + break; + case TYPE_CHAR: + ap->a.a_char = va_arg (args, int); + break; +#if HAVE_WINT_T + case TYPE_WIDE_CHAR: + /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by + default argument promotions", this is not the case in mingw32, + where wint_t is 'unsigned short'. */ + ap->a.a_wide_char = + (sizeof (wint_t) < sizeof (int) + ? (wint_t) va_arg (args, int) + : va_arg (args, wint_t)); + break; +#endif + case TYPE_STRING: + ap->a.a_string = va_arg (args, const char *); + /* A null pointer is an invalid argument for "%s", but in practice + it occurs quite frequently in printf statements that produce + debug output. Use a fallback in this case. */ + if (ap->a.a_string == NULL) + ap->a.a_string = "(NULL)"; + break; +#if HAVE_WCHAR_T + case TYPE_WIDE_STRING: + ap->a.a_wide_string = va_arg (args, const wchar_t *); + /* A null pointer is an invalid argument for "%ls", but in practice + it occurs quite frequently in printf statements that produce + debug output. Use a fallback in this case. */ + if (ap->a.a_wide_string == NULL) + { + static const wchar_t wide_null_string[] = + { + (wchar_t)'(', + (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L', + (wchar_t)')', + (wchar_t)0 + }; + ap->a.a_wide_string = wide_null_string; + } + break; +#endif + case TYPE_POINTER: + ap->a.a_pointer = va_arg (args, void *); + break; + case TYPE_COUNT_SCHAR_POINTER: + ap->a.a_count_schar_pointer = va_arg (args, signed char *); + break; + case TYPE_COUNT_SHORT_POINTER: + ap->a.a_count_short_pointer = va_arg (args, short *); + break; + case TYPE_COUNT_INT_POINTER: + ap->a.a_count_int_pointer = va_arg (args, int *); + break; + case TYPE_COUNT_LONGINT_POINTER: + ap->a.a_count_longint_pointer = va_arg (args, long int *); + break; +#if HAVE_LONG_LONG_INT + case TYPE_COUNT_LONGLONGINT_POINTER: + ap->a.a_count_longlongint_pointer = va_arg (args, long long int *); + break; +#endif +#if ENABLE_UNISTDIO + /* The unistdio extensions. */ + case TYPE_U8_STRING: + ap->a.a_u8_string = va_arg (args, const uint8_t *); + /* A null pointer is an invalid argument for "%U", but in practice + it occurs quite frequently in printf statements that produce + debug output. Use a fallback in this case. */ + if (ap->a.a_u8_string == NULL) + { + static const uint8_t u8_null_string[] = + { '(', 'N', 'U', 'L', 'L', ')', 0 }; + ap->a.a_u8_string = u8_null_string; + } + break; + case TYPE_U16_STRING: + ap->a.a_u16_string = va_arg (args, const uint16_t *); + /* A null pointer is an invalid argument for "%lU", but in practice + it occurs quite frequently in printf statements that produce + debug output. Use a fallback in this case. */ + if (ap->a.a_u16_string == NULL) + { + static const uint16_t u16_null_string[] = + { '(', 'N', 'U', 'L', 'L', ')', 0 }; + ap->a.a_u16_string = u16_null_string; + } + break; + case TYPE_U32_STRING: + ap->a.a_u32_string = va_arg (args, const uint32_t *); + /* A null pointer is an invalid argument for "%llU", but in practice + it occurs quite frequently in printf statements that produce + debug output. Use a fallback in this case. */ + if (ap->a.a_u32_string == NULL) + { + static const uint32_t u32_null_string[] = + { '(', 'N', 'U', 'L', 'L', ')', 0 }; + ap->a.a_u32_string = u32_null_string; + } + break; +#endif + default: + /* Unknown type. */ + return -1; + } + return 0; +} diff --git a/local/recipes/tools/diffutils/source/lib/printf-args.h b/local/recipes/tools/diffutils/source/lib/printf-args.h new file mode 100644 index 0000000000..36cab2af4a --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/printf-args.h @@ -0,0 +1,158 @@ +/* Decomposed printf argument list. + Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2017 Free Software + Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _PRINTF_ARGS_H +#define _PRINTF_ARGS_H + +/* This file can be parametrized with the following macros: + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. + PRINTF_FETCHARGS Name of the function to be declared. + STATIC Set to 'static' to declare the function static. */ + +/* Default parameters. */ +#ifndef PRINTF_FETCHARGS +# define PRINTF_FETCHARGS printf_fetchargs +#endif + +/* Get size_t. */ +#include <stddef.h> + +/* Get wchar_t. */ +#if HAVE_WCHAR_T +# include <stddef.h> +#endif + +/* Get wint_t. */ +#if HAVE_WINT_T +# include <wchar.h> +#endif + +/* Get va_list. */ +#include <stdarg.h> + + +/* Argument types */ +typedef enum +{ + TYPE_NONE, + TYPE_SCHAR, + TYPE_UCHAR, + TYPE_SHORT, + TYPE_USHORT, + TYPE_INT, + TYPE_UINT, + TYPE_LONGINT, + TYPE_ULONGINT, +#if HAVE_LONG_LONG_INT + TYPE_LONGLONGINT, + TYPE_ULONGLONGINT, +#endif + TYPE_DOUBLE, + TYPE_LONGDOUBLE, + TYPE_CHAR, +#if HAVE_WINT_T + TYPE_WIDE_CHAR, +#endif + TYPE_STRING, +#if HAVE_WCHAR_T + TYPE_WIDE_STRING, +#endif + TYPE_POINTER, + TYPE_COUNT_SCHAR_POINTER, + TYPE_COUNT_SHORT_POINTER, + TYPE_COUNT_INT_POINTER, + TYPE_COUNT_LONGINT_POINTER +#if HAVE_LONG_LONG_INT +, TYPE_COUNT_LONGLONGINT_POINTER +#endif +#if ENABLE_UNISTDIO + /* The unistdio extensions. */ +, TYPE_U8_STRING +, TYPE_U16_STRING +, TYPE_U32_STRING +#endif +} arg_type; + +/* Polymorphic argument */ +typedef struct +{ + arg_type type; + union + { + signed char a_schar; + unsigned char a_uchar; + short a_short; + unsigned short a_ushort; + int a_int; + unsigned int a_uint; + long int a_longint; + unsigned long int a_ulongint; +#if HAVE_LONG_LONG_INT + long long int a_longlongint; + unsigned long long int a_ulonglongint; +#endif + float a_float; + double a_double; + long double a_longdouble; + int a_char; +#if HAVE_WINT_T + wint_t a_wide_char; +#endif + const char* a_string; +#if HAVE_WCHAR_T + const wchar_t* a_wide_string; +#endif + void* a_pointer; + signed char * a_count_schar_pointer; + short * a_count_short_pointer; + int * a_count_int_pointer; + long int * a_count_longint_pointer; +#if HAVE_LONG_LONG_INT + long long int * a_count_longlongint_pointer; +#endif +#if ENABLE_UNISTDIO + /* The unistdio extensions. */ + const uint8_t * a_u8_string; + const uint16_t * a_u16_string; + const uint32_t * a_u32_string; +#endif + } + a; +} +argument; + +/* Number of directly allocated arguments (no malloc() needed). */ +#define N_DIRECT_ALLOC_ARGUMENTS 7 + +typedef struct +{ + size_t count; + argument *arg; + argument direct_alloc_arg[N_DIRECT_ALLOC_ARGUMENTS]; +} +arguments; + + +/* Fetch the arguments, putting them into a. */ +#ifdef STATIC +STATIC +#else +extern +#endif +int PRINTF_FETCHARGS (va_list args, arguments *a); + +#endif /* _PRINTF_ARGS_H */ diff --git a/local/recipes/tools/diffutils/source/lib/printf-parse.c b/local/recipes/tools/diffutils/source/lib/printf-parse.c new file mode 100644 index 0000000000..b9e04aef46 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/printf-parse.c @@ -0,0 +1,638 @@ +/* Formatted output to strings. + Copyright (C) 1999-2000, 2002-2003, 2006-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* This file can be parametrized with the following macros: + CHAR_T The element type of the format string. + CHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters + in the format string are ASCII. + DIRECTIVE Structure denoting a format directive. + Depends on CHAR_T. + DIRECTIVES Structure denoting the set of format directives of a + format string. Depends on CHAR_T. + PRINTF_PARSE Function that parses a format string. + Depends on CHAR_T. + STATIC Set to 'static' to declare the function static. + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. */ + +#ifndef PRINTF_PARSE +# include <config.h> +#endif + +/* Specification. */ +#ifndef PRINTF_PARSE +# include "printf-parse.h" +#endif + +/* Default parameters. */ +#ifndef PRINTF_PARSE +# define PRINTF_PARSE printf_parse +# define CHAR_T char +# define DIRECTIVE char_directive +# define DIRECTIVES char_directives +#endif + +/* Get size_t, NULL. */ +#include <stddef.h> + +/* Get intmax_t. */ +#if defined IN_LIBINTL || defined IN_LIBASPRINTF +# if HAVE_STDINT_H_WITH_UINTMAX +# include <stdint.h> +# endif +# if HAVE_INTTYPES_H_WITH_UINTMAX +# include <inttypes.h> +# endif +#else +# include <stdint.h> +#endif + +/* malloc(), realloc(), free(). */ +#include <stdlib.h> + +/* memcpy(). */ +#include <string.h> + +/* errno. */ +#include <errno.h> + +/* Checked size_t computations. */ +#include "xsize.h" + +#if CHAR_T_ONLY_ASCII +/* c_isascii(). */ +# include "c-ctype.h" +#endif + +#ifdef STATIC +STATIC +#endif +int +PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) +{ + const CHAR_T *cp = format; /* pointer into format */ + size_t arg_posn = 0; /* number of regular arguments consumed */ + size_t d_allocated; /* allocated elements of d->dir */ + size_t a_allocated; /* allocated elements of a->arg */ + size_t max_width_length = 0; + size_t max_precision_length = 0; + + d->count = 0; + d_allocated = N_DIRECT_ALLOC_DIRECTIVES; + d->dir = d->direct_alloc_dir; + + a->count = 0; + a_allocated = N_DIRECT_ALLOC_ARGUMENTS; + a->arg = a->direct_alloc_arg; + +#define REGISTER_ARG(_index_,_type_) \ + { \ + size_t n = (_index_); \ + if (n >= a_allocated) \ + { \ + size_t memory_size; \ + argument *memory; \ + \ + a_allocated = xtimes (a_allocated, 2); \ + if (a_allocated <= n) \ + a_allocated = xsum (n, 1); \ + memory_size = xtimes (a_allocated, sizeof (argument)); \ + if (size_overflow_p (memory_size)) \ + /* Overflow, would lead to out of memory. */ \ + goto out_of_memory; \ + memory = (argument *) (a->arg != a->direct_alloc_arg \ + ? realloc (a->arg, memory_size) \ + : malloc (memory_size)); \ + if (memory == NULL) \ + /* Out of memory. */ \ + goto out_of_memory; \ + if (a->arg == a->direct_alloc_arg) \ + memcpy (memory, a->arg, a->count * sizeof (argument)); \ + a->arg = memory; \ + } \ + while (a->count <= n) \ + a->arg[a->count++].type = TYPE_NONE; \ + if (a->arg[n].type == TYPE_NONE) \ + a->arg[n].type = (_type_); \ + else if (a->arg[n].type != (_type_)) \ + /* Ambiguous type for positional argument. */ \ + goto error; \ + } + + while (*cp != '\0') + { + CHAR_T c = *cp++; + if (c == '%') + { + size_t arg_index = ARG_NONE; + DIRECTIVE *dp = &d->dir[d->count]; /* pointer to next directive */ + + /* Initialize the next directive. */ + dp->dir_start = cp - 1; + dp->flags = 0; + dp->width_start = NULL; + dp->width_end = NULL; + dp->width_arg_index = ARG_NONE; + dp->precision_start = NULL; + dp->precision_end = NULL; + dp->precision_arg_index = ARG_NONE; + dp->arg_index = ARG_NONE; + + /* Test for positional argument. */ + if (*cp >= '0' && *cp <= '9') + { + const CHAR_T *np; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + ; + if (*np == '$') + { + size_t n = 0; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + n = xsum (xtimes (n, 10), *np - '0'); + if (n == 0) + /* Positional argument 0. */ + goto error; + if (size_overflow_p (n)) + /* n too large, would lead to out of memory later. */ + goto error; + arg_index = n - 1; + cp = np + 1; + } + } + + /* Read the flags. */ + for (;;) + { + if (*cp == '\'') + { + dp->flags |= FLAG_GROUP; + cp++; + } + else if (*cp == '-') + { + dp->flags |= FLAG_LEFT; + cp++; + } + else if (*cp == '+') + { + dp->flags |= FLAG_SHOWSIGN; + cp++; + } + else if (*cp == ' ') + { + dp->flags |= FLAG_SPACE; + cp++; + } + else if (*cp == '#') + { + dp->flags |= FLAG_ALT; + cp++; + } + else if (*cp == '0') + { + dp->flags |= FLAG_ZERO; + cp++; + } +#if __GLIBC__ >= 2 && !defined __UCLIBC__ + else if (*cp == 'I') + { + dp->flags |= FLAG_LOCALIZED; + cp++; + } +#endif + else + break; + } + + /* Parse the field width. */ + if (*cp == '*') + { + dp->width_start = cp; + cp++; + dp->width_end = cp; + if (max_width_length < 1) + max_width_length = 1; + + /* Test for positional argument. */ + if (*cp >= '0' && *cp <= '9') + { + const CHAR_T *np; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + ; + if (*np == '$') + { + size_t n = 0; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + n = xsum (xtimes (n, 10), *np - '0'); + if (n == 0) + /* Positional argument 0. */ + goto error; + if (size_overflow_p (n)) + /* n too large, would lead to out of memory later. */ + goto error; + dp->width_arg_index = n - 1; + cp = np + 1; + } + } + if (dp->width_arg_index == ARG_NONE) + { + dp->width_arg_index = arg_posn++; + if (dp->width_arg_index == ARG_NONE) + /* arg_posn wrapped around. */ + goto error; + } + REGISTER_ARG (dp->width_arg_index, TYPE_INT); + } + else if (*cp >= '0' && *cp <= '9') + { + size_t width_length; + + dp->width_start = cp; + for (; *cp >= '0' && *cp <= '9'; cp++) + ; + dp->width_end = cp; + width_length = dp->width_end - dp->width_start; + if (max_width_length < width_length) + max_width_length = width_length; + } + + /* Parse the precision. */ + if (*cp == '.') + { + cp++; + if (*cp == '*') + { + dp->precision_start = cp - 1; + cp++; + dp->precision_end = cp; + if (max_precision_length < 2) + max_precision_length = 2; + + /* Test for positional argument. */ + if (*cp >= '0' && *cp <= '9') + { + const CHAR_T *np; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + ; + if (*np == '$') + { + size_t n = 0; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + n = xsum (xtimes (n, 10), *np - '0'); + if (n == 0) + /* Positional argument 0. */ + goto error; + if (size_overflow_p (n)) + /* n too large, would lead to out of memory + later. */ + goto error; + dp->precision_arg_index = n - 1; + cp = np + 1; + } + } + if (dp->precision_arg_index == ARG_NONE) + { + dp->precision_arg_index = arg_posn++; + if (dp->precision_arg_index == ARG_NONE) + /* arg_posn wrapped around. */ + goto error; + } + REGISTER_ARG (dp->precision_arg_index, TYPE_INT); + } + else + { + size_t precision_length; + + dp->precision_start = cp - 1; + for (; *cp >= '0' && *cp <= '9'; cp++) + ; + dp->precision_end = cp; + precision_length = dp->precision_end - dp->precision_start; + if (max_precision_length < precision_length) + max_precision_length = precision_length; + } + } + + { + arg_type type; + + /* Parse argument type/size specifiers. */ + { + int flags = 0; + + for (;;) + { + if (*cp == 'h') + { + flags |= (1 << (flags & 1)); + cp++; + } + else if (*cp == 'L') + { + flags |= 4; + cp++; + } + else if (*cp == 'l') + { + flags += 8; + cp++; + } + else if (*cp == 'j') + { + if (sizeof (intmax_t) > sizeof (long)) + { + /* intmax_t = long long */ + flags += 16; + } + else if (sizeof (intmax_t) > sizeof (int)) + { + /* intmax_t = long */ + flags += 8; + } + cp++; + } + else if (*cp == 'z' || *cp == 'Z') + { + /* 'z' is standardized in ISO C 99, but glibc uses 'Z' + because the warning facility in gcc-2.95.2 understands + only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */ + if (sizeof (size_t) > sizeof (long)) + { + /* size_t = long long */ + flags += 16; + } + else if (sizeof (size_t) > sizeof (int)) + { + /* size_t = long */ + flags += 8; + } + cp++; + } + else if (*cp == 't') + { + if (sizeof (ptrdiff_t) > sizeof (long)) + { + /* ptrdiff_t = long long */ + flags += 16; + } + else if (sizeof (ptrdiff_t) > sizeof (int)) + { + /* ptrdiff_t = long */ + flags += 8; + } + cp++; + } +#if defined __APPLE__ && defined __MACH__ + /* On Mac OS X 10.3, PRIdMAX is defined as "qd". + We cannot change it to "lld" because PRIdMAX must also + be understood by the system's printf routines. */ + else if (*cp == 'q') + { + if (64 / 8 > sizeof (long)) + { + /* int64_t = long long */ + flags += 16; + } + else + { + /* int64_t = long */ + flags += 8; + } + cp++; + } +#endif +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* On native Windows, PRIdMAX is defined as "I64d". + We cannot change it to "lld" because PRIdMAX must also + be understood by the system's printf routines. */ + else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4') + { + if (64 / 8 > sizeof (long)) + { + /* __int64 = long long */ + flags += 16; + } + else + { + /* __int64 = long */ + flags += 8; + } + cp += 3; + } +#endif + else + break; + } + + /* Read the conversion character. */ + c = *cp++; + switch (c) + { + case 'd': case 'i': +#if HAVE_LONG_LONG_INT + /* If 'long long' exists and is larger than 'long': */ + if (flags >= 16 || (flags & 4)) + type = TYPE_LONGLONGINT; + else +#endif + /* If 'long long' exists and is the same as 'long', we parse + "lld" into TYPE_LONGINT. */ + if (flags >= 8) + type = TYPE_LONGINT; + else if (flags & 2) + type = TYPE_SCHAR; + else if (flags & 1) + type = TYPE_SHORT; + else + type = TYPE_INT; + break; + case 'o': case 'u': case 'x': case 'X': +#if HAVE_LONG_LONG_INT + /* If 'long long' exists and is larger than 'long': */ + if (flags >= 16 || (flags & 4)) + type = TYPE_ULONGLONGINT; + else +#endif + /* If 'unsigned long long' exists and is the same as + 'unsigned long', we parse "llu" into TYPE_ULONGINT. */ + if (flags >= 8) + type = TYPE_ULONGINT; + else if (flags & 2) + type = TYPE_UCHAR; + else if (flags & 1) + type = TYPE_USHORT; + else + type = TYPE_UINT; + break; + case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': + case 'a': case 'A': + if (flags >= 16 || (flags & 4)) + type = TYPE_LONGDOUBLE; + else + type = TYPE_DOUBLE; + break; + case 'c': + if (flags >= 8) +#if HAVE_WINT_T + type = TYPE_WIDE_CHAR; +#else + goto error; +#endif + else + type = TYPE_CHAR; + break; +#if HAVE_WINT_T + case 'C': + type = TYPE_WIDE_CHAR; + c = 'c'; + break; +#endif + case 's': + if (flags >= 8) +#if HAVE_WCHAR_T + type = TYPE_WIDE_STRING; +#else + goto error; +#endif + else + type = TYPE_STRING; + break; +#if HAVE_WCHAR_T + case 'S': + type = TYPE_WIDE_STRING; + c = 's'; + break; +#endif + case 'p': + type = TYPE_POINTER; + break; + case 'n': +#if HAVE_LONG_LONG_INT + /* If 'long long' exists and is larger than 'long': */ + if (flags >= 16 || (flags & 4)) + type = TYPE_COUNT_LONGLONGINT_POINTER; + else +#endif + /* If 'long long' exists and is the same as 'long', we parse + "lln" into TYPE_COUNT_LONGINT_POINTER. */ + if (flags >= 8) + type = TYPE_COUNT_LONGINT_POINTER; + else if (flags & 2) + type = TYPE_COUNT_SCHAR_POINTER; + else if (flags & 1) + type = TYPE_COUNT_SHORT_POINTER; + else + type = TYPE_COUNT_INT_POINTER; + break; +#if ENABLE_UNISTDIO + /* The unistdio extensions. */ + case 'U': + if (flags >= 16) + type = TYPE_U32_STRING; + else if (flags >= 8) + type = TYPE_U16_STRING; + else + type = TYPE_U8_STRING; + break; +#endif + case '%': + type = TYPE_NONE; + break; + default: + /* Unknown conversion character. */ + goto error; + } + } + + if (type != TYPE_NONE) + { + dp->arg_index = arg_index; + if (dp->arg_index == ARG_NONE) + { + dp->arg_index = arg_posn++; + if (dp->arg_index == ARG_NONE) + /* arg_posn wrapped around. */ + goto error; + } + REGISTER_ARG (dp->arg_index, type); + } + dp->conversion = c; + dp->dir_end = cp; + } + + d->count++; + if (d->count >= d_allocated) + { + size_t memory_size; + DIRECTIVE *memory; + + d_allocated = xtimes (d_allocated, 2); + memory_size = xtimes (d_allocated, sizeof (DIRECTIVE)); + if (size_overflow_p (memory_size)) + /* Overflow, would lead to out of memory. */ + goto out_of_memory; + memory = (DIRECTIVE *) (d->dir != d->direct_alloc_dir + ? realloc (d->dir, memory_size) + : malloc (memory_size)); + if (memory == NULL) + /* Out of memory. */ + goto out_of_memory; + if (d->dir == d->direct_alloc_dir) + memcpy (memory, d->dir, d->count * sizeof (DIRECTIVE)); + d->dir = memory; + } + } +#if CHAR_T_ONLY_ASCII + else if (!c_isascii (c)) + { + /* Non-ASCII character. Not supported. */ + goto error; + } +#endif + } + d->dir[d->count].dir_start = cp; + + d->max_width_length = max_width_length; + d->max_precision_length = max_precision_length; + return 0; + +error: + if (a->arg != a->direct_alloc_arg) + free (a->arg); + if (d->dir != d->direct_alloc_dir) + free (d->dir); + errno = EINVAL; + return -1; + +out_of_memory: + if (a->arg != a->direct_alloc_arg) + free (a->arg); + if (d->dir != d->direct_alloc_dir) + free (d->dir); + errno = ENOMEM; + return -1; +} + +#undef PRINTF_PARSE +#undef DIRECTIVES +#undef DIRECTIVE +#undef CHAR_T_ONLY_ASCII +#undef CHAR_T diff --git a/local/recipes/tools/diffutils/source/lib/printf-parse.h b/local/recipes/tools/diffutils/source/lib/printf-parse.h new file mode 100644 index 0000000000..b9bfa85bd5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/printf-parse.h @@ -0,0 +1,193 @@ +/* Parse printf format string. + Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2017 Free Software + Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _PRINTF_PARSE_H +#define _PRINTF_PARSE_H + +/* This file can be parametrized with the following macros: + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. + STATIC Set to 'static' to declare the function static. */ + +#if HAVE_FEATURES_H +# include <features.h> /* for __GLIBC__, __UCLIBC__ */ +#endif + +#include "printf-args.h" + + +/* Flags */ +#define FLAG_GROUP 1 /* ' flag */ +#define FLAG_LEFT 2 /* - flag */ +#define FLAG_SHOWSIGN 4 /* + flag */ +#define FLAG_SPACE 8 /* space flag */ +#define FLAG_ALT 16 /* # flag */ +#define FLAG_ZERO 32 +#if __GLIBC__ >= 2 && !defined __UCLIBC__ +# define FLAG_LOCALIZED 64 /* I flag, uses localized digits */ +#endif + +/* arg_index value indicating that no argument is consumed. */ +#define ARG_NONE (~(size_t)0) + +/* xxx_directive: A parsed directive. + xxx_directives: A parsed format string. */ + +/* Number of directly allocated directives (no malloc() needed). */ +#define N_DIRECT_ALLOC_DIRECTIVES 7 + +/* A parsed directive. */ +typedef struct +{ + const char* dir_start; + const char* dir_end; + int flags; + const char* width_start; + const char* width_end; + size_t width_arg_index; + const char* precision_start; + const char* precision_end; + size_t precision_arg_index; + char conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */ + size_t arg_index; +} +char_directive; + +/* A parsed format string. */ +typedef struct +{ + size_t count; + char_directive *dir; + size_t max_width_length; + size_t max_precision_length; + char_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES]; +} +char_directives; + +#if ENABLE_UNISTDIO + +/* A parsed directive. */ +typedef struct +{ + const uint8_t* dir_start; + const uint8_t* dir_end; + int flags; + const uint8_t* width_start; + const uint8_t* width_end; + size_t width_arg_index; + const uint8_t* precision_start; + const uint8_t* precision_end; + size_t precision_arg_index; + uint8_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */ + size_t arg_index; +} +u8_directive; + +/* A parsed format string. */ +typedef struct +{ + size_t count; + u8_directive *dir; + size_t max_width_length; + size_t max_precision_length; + u8_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES]; +} +u8_directives; + +/* A parsed directive. */ +typedef struct +{ + const uint16_t* dir_start; + const uint16_t* dir_end; + int flags; + const uint16_t* width_start; + const uint16_t* width_end; + size_t width_arg_index; + const uint16_t* precision_start; + const uint16_t* precision_end; + size_t precision_arg_index; + uint16_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */ + size_t arg_index; +} +u16_directive; + +/* A parsed format string. */ +typedef struct +{ + size_t count; + u16_directive *dir; + size_t max_width_length; + size_t max_precision_length; + u16_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES]; +} +u16_directives; + +/* A parsed directive. */ +typedef struct +{ + const uint32_t* dir_start; + const uint32_t* dir_end; + int flags; + const uint32_t* width_start; + const uint32_t* width_end; + size_t width_arg_index; + const uint32_t* precision_start; + const uint32_t* precision_end; + size_t precision_arg_index; + uint32_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */ + size_t arg_index; +} +u32_directive; + +/* A parsed format string. */ +typedef struct +{ + size_t count; + u32_directive *dir; + size_t max_width_length; + size_t max_precision_length; + u32_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES]; +} +u32_directives; + +#endif + + +/* Parses the format string. Fills in the number N of directives, and fills + in directives[0], ..., directives[N-1], and sets directives[N].dir_start + to the end of the format string. Also fills in the arg_type fields of the + arguments and the needed count of arguments. */ +#if ENABLE_UNISTDIO +extern int + ulc_printf_parse (const char *format, char_directives *d, arguments *a); +extern int + u8_printf_parse (const uint8_t *format, u8_directives *d, arguments *a); +extern int + u16_printf_parse (const uint16_t *format, u16_directives *d, + arguments *a); +extern int + u32_printf_parse (const uint32_t *format, u32_directives *d, + arguments *a); +#else +# ifdef STATIC +STATIC +# else +extern +# endif +int printf_parse (const char *format, char_directives *d, arguments *a); +#endif + +#endif /* _PRINTF_PARSE_H */ diff --git a/local/recipes/tools/diffutils/source/lib/progname.c b/local/recipes/tools/diffutils/source/lib/progname.c new file mode 100644 index 0000000000..05b2a7f57e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/progname.c @@ -0,0 +1,92 @@ +/* Program name management. + Copyright (C) 2001-2003, 2005-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2001. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + + +#include <config.h> + +/* Specification. */ +#undef ENABLE_RELOCATABLE /* avoid defining set_program_name as a macro */ +#include "progname.h" + +#include <errno.h> /* get program_invocation_name declaration */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + + +/* String containing name the program is called with. + To be initialized by main(). */ +const char *program_name = NULL; + +/* Set program_name, based on argv[0]. + argv0 must be a string allocated with indefinite extent, and must not be + modified after this call. */ +void +set_program_name (const char *argv0) +{ + /* libtool creates a temporary executable whose name is sometimes prefixed + with "lt-" (depends on the platform). It also makes argv[0] absolute. + But the name of the temporary executable is a detail that should not be + visible to the end user and to the test suite. + Remove this "<dirname>/.libs/" or "<dirname>/.libs/lt-" prefix here. */ + const char *slash; + const char *base; + + /* Sanity check. POSIX requires the invoking process to pass a non-NULL + argv[0]. */ + if (argv0 == NULL) + { + /* It's a bug in the invoking program. Help diagnosing it. */ + fputs ("A NULL argv[0] was passed through an exec system call.\n", + stderr); + abort (); + } + + slash = strrchr (argv0, '/'); + base = (slash != NULL ? slash + 1 : argv0); + if (base - argv0 >= 7 && strncmp (base - 7, "/.libs/", 7) == 0) + { + argv0 = base; + if (strncmp (base, "lt-", 3) == 0) + { + argv0 = base + 3; + /* On glibc systems, remove the "lt-" prefix from the variable + program_invocation_short_name. */ +#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME + program_invocation_short_name = (char *) argv0; +#endif + } + } + + /* But don't strip off a leading <dirname>/ in general, because when the user + runs + /some/hidden/place/bin/cp foo foo + he should get the error message + /some/hidden/place/bin/cp: `foo' and `foo' are the same file + not + cp: `foo' and `foo' are the same file + */ + + program_name = argv0; + + /* On glibc systems, the error() function comes from libc and uses the + variable program_invocation_name, not program_name. So set this variable + as well. */ +#if HAVE_DECL_PROGRAM_INVOCATION_NAME + program_invocation_name = (char *) argv0; +#endif +} diff --git a/local/recipes/tools/diffutils/source/lib/progname.h b/local/recipes/tools/diffutils/source/lib/progname.h new file mode 100644 index 0000000000..f33881c598 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/progname.h @@ -0,0 +1,62 @@ +/* Program name management. + Copyright (C) 2001-2004, 2006, 2009-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2001. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _PROGNAME_H +#define _PROGNAME_H + +/* Programs using this file should do the following in main(): + set_program_name (argv[0]); + */ + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* String containing name the program is called with. */ +extern const char *program_name; + +/* Set program_name, based on argv[0]. + argv0 must be a string allocated with indefinite extent, and must not be + modified after this call. */ +extern void set_program_name (const char *argv0); + +#if ENABLE_RELOCATABLE + +/* Set program_name, based on argv[0], and original installation prefix and + directory, for relocatability. */ +extern void set_program_name_and_installdir (const char *argv0, + const char *orig_installprefix, + const char *orig_installdir); +#undef set_program_name +#define set_program_name(ARG0) \ + set_program_name_and_installdir (ARG0, INSTALLPREFIX, INSTALLDIR) + +/* Return the full pathname of the current executable, based on the earlier + call to set_program_name_and_installdir. Return NULL if unknown. */ +extern char *get_full_program_name (void); + +#endif + + +#ifdef __cplusplus +} +#endif + + +#endif /* _PROGNAME_H */ diff --git a/local/recipes/tools/diffutils/source/lib/propername.c b/local/recipes/tools/diffutils/source/lib/propername.c new file mode 100644 index 0000000000..1e5e28b8e3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/propername.c @@ -0,0 +1,318 @@ +/* Localization of proper names. + Copyright (C) 2006-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2006. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Without this pragma, gcc 4.7.0 20111124 mistakenly suggests that + the proper_name function might be candidate for attribute 'const' */ +#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ +# pragma GCC diagnostic ignored "-Wsuggest-attribute=const" +#endif + +#include <config.h> + +/* Specification. */ +#include "propername.h" + +#include <ctype.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#if HAVE_ICONV +# include <iconv.h> +#endif + +#include "trim.h" +#include "mbchar.h" +#include "mbuiter.h" +#include "localcharset.h" +#include "c-strcase.h" +#include "xstriconv.h" +#include "xalloc.h" +#include "gettext.h" + + +/* Tests whether STRING contains trim (SUB), starting and ending at word + boundaries. + Here, instead of implementing Unicode Standard Annex #29 for determining + word boundaries, we assume that trim (SUB) starts and ends with words and + only test whether the part before it ends with a non-word and the part + after it starts with a non-word. */ +static bool +mbsstr_trimmed_wordbounded (const char *string, const char *sub) +{ + char *tsub = trim (sub); + bool found = false; + + for (; *string != '\0';) + { + const char *tsub_in_string = mbsstr (string, tsub); + if (tsub_in_string == NULL) + break; + else + { + if (MB_CUR_MAX > 1) + { + mbui_iterator_t string_iter; + bool word_boundary_before; + bool word_boundary_after; + + mbui_init (string_iter, string); + word_boundary_before = true; + if (mbui_cur_ptr (string_iter) < tsub_in_string) + { + mbchar_t last_char_before_tsub; + do + { + if (!mbui_avail (string_iter)) + abort (); + last_char_before_tsub = mbui_cur (string_iter); + mbui_advance (string_iter); + } + while (mbui_cur_ptr (string_iter) < tsub_in_string); + if (mb_isalnum (last_char_before_tsub)) + word_boundary_before = false; + } + + mbui_init (string_iter, tsub_in_string); + { + mbui_iterator_t tsub_iter; + + for (mbui_init (tsub_iter, tsub); + mbui_avail (tsub_iter); + mbui_advance (tsub_iter)) + { + if (!mbui_avail (string_iter)) + abort (); + mbui_advance (string_iter); + } + } + word_boundary_after = true; + if (mbui_avail (string_iter)) + { + mbchar_t first_char_after_tsub = mbui_cur (string_iter); + if (mb_isalnum (first_char_after_tsub)) + word_boundary_after = false; + } + + if (word_boundary_before && word_boundary_after) + { + found = true; + break; + } + + mbui_init (string_iter, tsub_in_string); + if (!mbui_avail (string_iter)) + break; + string = tsub_in_string + mb_len (mbui_cur (string_iter)); + } + else + { + bool word_boundary_before; + const char *p; + bool word_boundary_after; + + word_boundary_before = true; + if (string < tsub_in_string) + if (isalnum ((unsigned char) tsub_in_string[-1])) + word_boundary_before = false; + + p = tsub_in_string + strlen (tsub); + word_boundary_after = true; + if (*p != '\0') + if (isalnum ((unsigned char) *p)) + word_boundary_after = false; + + if (word_boundary_before && word_boundary_after) + { + found = true; + break; + } + + if (*tsub_in_string == '\0') + break; + string = tsub_in_string + 1; + } + } + } + free (tsub); + return found; +} + +/* Return the localization of NAME. NAME is written in ASCII. */ + +const char * +proper_name (const char *name) +{ + /* See whether there is a translation. */ + const char *translation = gettext (name); + + if (translation != name) + { + /* See whether the translation contains the original name. */ + if (mbsstr_trimmed_wordbounded (translation, name)) + return translation; + else + { + /* Return "TRANSLATION (NAME)". */ + char *result = + XNMALLOC (strlen (translation) + 2 + strlen (name) + 1 + 1, char); + + sprintf (result, "%s (%s)", translation, name); + return result; + } + } + else + return name; +} + +/* Return the localization of a name whose original writing is not ASCII. + NAME_UTF8 is the real name, written in UTF-8 with octal or hexadecimal + escape sequences. NAME_ASCII is a fallback written only with ASCII + characters. */ + +const char * +proper_name_utf8 (const char *name_ascii, const char *name_utf8) +{ + /* See whether there is a translation. */ + const char *translation = gettext (name_ascii); + + /* Try to convert NAME_UTF8 to the locale encoding. */ + const char *locale_code = locale_charset (); + char *alloc_name_converted = NULL; + char *alloc_name_converted_translit = NULL; + const char *name_converted = NULL; + const char *name_converted_translit = NULL; + const char *name; + + if (c_strcasecmp (locale_code, "UTF-8") != 0) + { +#if HAVE_ICONV + name_converted = alloc_name_converted = + xstr_iconv (name_utf8, "UTF-8", locale_code); + +# if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \ + && !defined __UCLIBC__) \ + || _LIBICONV_VERSION >= 0x0105 + { + char *converted_translit; + + size_t len = strlen (locale_code); + char *locale_code_translit = XNMALLOC (len + 10 + 1, char); + memcpy (locale_code_translit, locale_code, len); + memcpy (locale_code_translit + len, "//TRANSLIT", 10 + 1); + + converted_translit = + xstr_iconv (name_utf8, "UTF-8", locale_code_translit); + + free (locale_code_translit); + + if (converted_translit != NULL) + { +# if !_LIBICONV_VERSION + /* Don't use the transliteration if it added question marks. + glibc's transliteration falls back to question marks; libiconv's + transliteration does not. + mbschr is equivalent to strchr in this case. */ + if (strchr (converted_translit, '?') != NULL) + free (converted_translit); + else +# endif + name_converted_translit = alloc_name_converted_translit = + converted_translit; + } + } +# endif +#endif + } + else + { + name_converted = name_utf8; + name_converted_translit = name_utf8; + } + + /* The name in locale encoding. */ + name = (name_converted != NULL ? name_converted : + name_converted_translit != NULL ? name_converted_translit : + name_ascii); + + /* See whether we have a translation. Some translators have not understood + that they should use the UTF-8 form of the name, if possible. So if the + translator provided a no-op translation, we ignore it. */ + if (strcmp (translation, name_ascii) != 0) + { + /* See whether the translation contains the original name. */ + if (mbsstr_trimmed_wordbounded (translation, name_ascii) + || (name_converted != NULL + && mbsstr_trimmed_wordbounded (translation, name_converted)) + || (name_converted_translit != NULL + && mbsstr_trimmed_wordbounded (translation, name_converted_translit))) + { + if (alloc_name_converted != NULL) + free (alloc_name_converted); + if (alloc_name_converted_translit != NULL) + free (alloc_name_converted_translit); + return translation; + } + else + { + /* Return "TRANSLATION (NAME)". */ + char *result = + XNMALLOC (strlen (translation) + 2 + strlen (name) + 1 + 1, char); + + sprintf (result, "%s (%s)", translation, name); + + if (alloc_name_converted != NULL) + free (alloc_name_converted); + if (alloc_name_converted_translit != NULL) + free (alloc_name_converted_translit); + return result; + } + } + else + { + if (alloc_name_converted != NULL && alloc_name_converted != name) + free (alloc_name_converted); + if (alloc_name_converted_translit != NULL + && alloc_name_converted_translit != name) + free (alloc_name_converted_translit); + return name; + } +} + +#ifdef TEST1 +# include <locale.h> +int +main (int argc, char *argv[]) +{ + setlocale (LC_ALL, ""); + if (mbsstr_trimmed_wordbounded (argv[1], argv[2])) + printf("found\n"); + return 0; +} +#endif + +#ifdef TEST2 +# include <locale.h> +# include <stdio.h> +int +main (int argc, char *argv[]) +{ + setlocale (LC_ALL, ""); + printf ("%s\n", proper_name_utf8 ("Franc,ois Pinard", "Fran\303\247ois Pinard")); + return 0; +} +#endif diff --git a/local/recipes/tools/diffutils/source/lib/propername.h b/local/recipes/tools/diffutils/source/lib/propername.h new file mode 100644 index 0000000000..dcacb8cab4 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/propername.h @@ -0,0 +1,106 @@ +/* Localization of proper names. -*- coding: utf-8 -*- + Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2006. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* INTRODUCTION + + What do + + Torbjörn Granlund (coreutils) + François Pinard (coreutils) + Danilo Šegan (gettext) + + have in common? + + A non-ASCII name. This causes trouble in the --version output. The simple + "solution" unfortunately mutilates the name. + + $ du --version | grep Granlund + Écrit par Torbjorn Granlund, David MacKenzie, Paul Eggert et Jim Meyering. + + $ ptx --version | grep Pinard + Écrit par F. Pinard. + + What is desirable, is to print the full name if the output character set + allows it, and the ASCIIfied name only as a fallback. + + $ recode-sr-latin --version + ... + Written by Danilo Šegan and Bruno Haible. + + $ LC_ALL=C recode-sr-latin --version + ... + Written by Danilo Segan and Bruno Haible. + + The 'propername' module does exactly this. Plus, for languages that use + a different writing system than the Latin alphabet, it allows a translator + to write the name using that different writing system. In that case the + output will look like this: + <translated name> (<original name in English>) + + To use the 'propername' module requires three simple steps: + + 1) Add it to the list of gnulib modules to import, + + 2) Change the arguments of version_etc(), + + from "Paul Eggert" + to proper_name ("Paul Eggert") + + from "Torbjorn Granlund" + to proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund") + + from "F. Pinard" + to proper_name_utf8 ("Franc,ois Pinard", "Fran\303\247ois Pinard") + + (Optionally, here you can also add / * TRANSLATORS: ... * / comments + explaining how the name is written or pronounced.) + + 3) If you are using GNU gettext version 0.16.1 or older, in po/Makevars, + in the definition of the XGETTEXT_OPTIONS variable, add: + + --keyword='proper_name:1,"This is a proper name. See the gettext manual, section Names."' + --keyword='proper_name_utf8:1,"This is a proper name. See the gettext manual, section Names."' + + This specifies automatic comments for the translator. (Requires + xgettext >= 0.15. The double-quotes inside the quoted string are on + purpose: they are part of the --keyword argument syntax.) + */ + +#ifndef _PROPERNAME_H +#define _PROPERNAME_H + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Return the localization of NAME. NAME is written in ASCII. */ +extern const char * proper_name (const char *name) /* NOT attribute const */; + +/* Return the localization of a name whose original writing is not ASCII. + NAME_UTF8 is the real name, written in UTF-8 with octal or hexadecimal + escape sequences. NAME_ASCII is a fallback written only with ASCII + characters. */ +extern const char * proper_name_utf8 (const char *name_ascii, + const char *name_utf8); + +#ifdef __cplusplus +} +#endif + + +#endif /* _PROPERNAME_H */ diff --git a/local/recipes/tools/diffutils/source/lib/quote.h b/local/recipes/tools/diffutils/source/lib/quote.h new file mode 100644 index 0000000000..2e58fb5f6d --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/quote.h @@ -0,0 +1,46 @@ +/* quote.h - prototypes for quote.c + + Copyright (C) 1998-2001, 2003, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef QUOTE_H_ +# define QUOTE_H_ 1 + +# include <stddef.h> + +/* The quoting options used by quote_n and quote. Its type is incomplete, + so it's useful only in expressions like '"e_quoting_options'. */ +extern struct quoting_options quote_quoting_options; + +/* Return an unambiguous printable representation of ARG (of size + ARGSIZE), allocated in slot N, suitable for diagnostics. If + ARGSIZE is SIZE_MAX, use the string length of the argument for + ARGSIZE. */ +char const *quote_n_mem (int n, char const *arg, size_t argsize); + +/* Return an unambiguous printable representation of ARG (of size + ARGSIZE), suitable for diagnostics. If ARGSIZE is SIZE_MAX, use + the string length of the argument for ARGSIZE. */ +char const *quote_mem (char const *arg, size_t argsize); + +/* Return an unambiguous printable representation of ARG, allocated in + slot N, suitable for diagnostics. */ +char const *quote_n (int n, char const *arg); + +/* Return an unambiguous printable representation of ARG, suitable for + diagnostics. */ +char const *quote (char const *arg); + +#endif /* !QUOTE_H_ */ diff --git a/local/recipes/tools/diffutils/source/lib/quotearg.c b/local/recipes/tools/diffutils/source/lib/quotearg.c new file mode 100644 index 0000000000..f6570330b9 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/quotearg.c @@ -0,0 +1,1080 @@ +/* quotearg.c - quote arguments for output + + Copyright (C) 1998-2002, 2004-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert <eggert@twinsun.com> */ + +/* Without this pragma, gcc 4.7.0 20111124 mistakenly suggests that + the quoting_options_from_style function might be candidate for + attribute 'pure' */ +#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ +# pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" +#endif + +#include <config.h> + +#include "quotearg.h" +#include "quote.h" + +#include "minmax.h" +#include "xalloc.h" +#include "c-strcaseeq.h" +#include "localcharset.h" + +#include <ctype.h> +#include <errno.h> +#include <limits.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> +#include <wchar.h> +#include <wctype.h> + +#include "gettext.h" +#define _(msgid) gettext (msgid) +#define N_(msgid) msgid + +#ifndef SIZE_MAX +# define SIZE_MAX ((size_t) -1) +#endif + +#define INT_BITS (sizeof (int) * CHAR_BIT) + +#ifndef FALLTHROUGH +# if __GNUC__ < 7 +# define FALLTHROUGH ((void) 0) +# else +# define FALLTHROUGH __attribute__ ((__fallthrough__)) +# endif +#endif + +struct quoting_options +{ + /* Basic quoting style. */ + enum quoting_style style; + + /* Additional flags. Bitwise combination of enum quoting_flags. */ + int flags; + + /* Quote the characters indicated by this bit vector even if the + quoting style would not normally require them to be quoted. */ + unsigned int quote_these_too[(UCHAR_MAX / INT_BITS) + 1]; + + /* The left quote for custom_quoting_style. */ + char const *left_quote; + + /* The right quote for custom_quoting_style. */ + char const *right_quote; +}; + +/* Names of quoting styles. */ +char const *const quoting_style_args[] = +{ + "literal", + "shell", + "shell-always", + "shell-escape", + "shell-escape-always", + "c", + "c-maybe", + "escape", + "locale", + "clocale", + 0 +}; + +/* Correspondences to quoting style names. */ +enum quoting_style const quoting_style_vals[] = +{ + literal_quoting_style, + shell_quoting_style, + shell_always_quoting_style, + shell_escape_quoting_style, + shell_escape_always_quoting_style, + c_quoting_style, + c_maybe_quoting_style, + escape_quoting_style, + locale_quoting_style, + clocale_quoting_style +}; + +/* The default quoting options. */ +static struct quoting_options default_quoting_options; + +/* Allocate a new set of quoting options, with contents initially identical + to O if O is not null, or to the default if O is null. + It is the caller's responsibility to free the result. */ +struct quoting_options * +clone_quoting_options (struct quoting_options *o) +{ + int e = errno; + struct quoting_options *p = xmemdup (o ? o : &default_quoting_options, + sizeof *o); + errno = e; + return p; +} + +/* Get the value of O's quoting style. If O is null, use the default. */ +enum quoting_style +get_quoting_style (struct quoting_options const *o) +{ + return (o ? o : &default_quoting_options)->style; +} + +/* In O (or in the default if O is null), + set the value of the quoting style to S. */ +void +set_quoting_style (struct quoting_options *o, enum quoting_style s) +{ + (o ? o : &default_quoting_options)->style = s; +} + +/* In O (or in the default if O is null), + set the value of the quoting options for character C to I. + Return the old value. Currently, the only values defined for I are + 0 (the default) and 1 (which means to quote the character even if + it would not otherwise be quoted). */ +int +set_char_quoting (struct quoting_options *o, char c, int i) +{ + unsigned char uc = c; + unsigned int *p = + (o ? o : &default_quoting_options)->quote_these_too + uc / INT_BITS; + int shift = uc % INT_BITS; + int r = (*p >> shift) & 1; + *p ^= ((i & 1) ^ r) << shift; + return r; +} + +/* In O (or in the default if O is null), + set the value of the quoting options flag to I, which can be a + bitwise combination of enum quoting_flags, or 0 for default + behavior. Return the old value. */ +int +set_quoting_flags (struct quoting_options *o, int i) +{ + int r; + if (!o) + o = &default_quoting_options; + r = o->flags; + o->flags = i; + return r; +} + +void +set_custom_quoting (struct quoting_options *o, + char const *left_quote, char const *right_quote) +{ + if (!o) + o = &default_quoting_options; + o->style = custom_quoting_style; + if (!left_quote || !right_quote) + abort (); + o->left_quote = left_quote; + o->right_quote = right_quote; +} + +/* Return quoting options for STYLE, with no extra quoting. */ +static struct quoting_options /* NOT PURE!! */ +quoting_options_from_style (enum quoting_style style) +{ + struct quoting_options o = { literal_quoting_style, 0, { 0 }, NULL, NULL }; + if (style == custom_quoting_style) + abort (); + o.style = style; + return o; +} + +/* MSGID approximates a quotation mark. Return its translation if it + has one; otherwise, return either it or "\"", depending on S. + + S is either clocale_quoting_style or locale_quoting_style. */ +static char const * +gettext_quote (char const *msgid, enum quoting_style s) +{ + char const *translation = _(msgid); + char const *locale_code; + + if (translation != msgid) + return translation; + + /* For UTF-8 and GB-18030, use single quotes U+2018 and U+2019. + Here is a list of other locales that include U+2018 and U+2019: + + ISO-8859-7 0xA1 KOI8-T 0x91 + CP869 0x8B CP874 0x91 + CP932 0x81 0x65 CP936 0xA1 0xAE + CP949 0xA1 0xAE CP950 0xA1 0xA5 + CP1250 0x91 CP1251 0x91 + CP1252 0x91 CP1253 0x91 + CP1254 0x91 CP1255 0x91 + CP1256 0x91 CP1257 0x91 + EUC-JP 0xA1 0xC6 EUC-KR 0xA1 0xAE + EUC-TW 0xA1 0xE4 BIG5 0xA1 0xA5 + BIG5-HKSCS 0xA1 0xA5 EUC-CN 0xA1 0xAE + GBK 0xA1 0xAE Georgian-PS 0x91 + PT154 0x91 + + None of these is still in wide use; using iconv is overkill. */ + locale_code = locale_charset (); + if (STRCASEEQ (locale_code, "UTF-8", 'U','T','F','-','8',0,0,0,0)) + return msgid[0] == '`' ? "\xe2\x80\x98": "\xe2\x80\x99"; + if (STRCASEEQ (locale_code, "GB18030", 'G','B','1','8','0','3','0',0,0)) + return msgid[0] == '`' ? "\xa1\ae": "\xa1\xaf"; + + return (s == clocale_quoting_style ? "\"" : "'"); +} + +/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of + argument ARG (of size ARGSIZE), using QUOTING_STYLE, FLAGS, and + QUOTE_THESE_TOO to control quoting. + Terminate the output with a null character, and return the written + size of the output, not counting the terminating null. + If BUFFERSIZE is too small to store the output string, return the + value that would have been returned had BUFFERSIZE been large enough. + If ARGSIZE is SIZE_MAX, use the string length of the argument for ARGSIZE. + + This function acts like quotearg_buffer (BUFFER, BUFFERSIZE, ARG, + ARGSIZE, O), except it breaks O into its component pieces and is + not careful about errno. */ + +static size_t +quotearg_buffer_restyled (char *buffer, size_t buffersize, + char const *arg, size_t argsize, + enum quoting_style quoting_style, int flags, + unsigned int const *quote_these_too, + char const *left_quote, + char const *right_quote) +{ + size_t i; + size_t len = 0; + size_t orig_buffersize = 0; + char const *quote_string = 0; + size_t quote_string_len = 0; + bool backslash_escapes = false; + bool unibyte_locale = MB_CUR_MAX == 1; + bool elide_outer_quotes = (flags & QA_ELIDE_OUTER_QUOTES) != 0; + bool pending_shell_escape_end = false; + bool encountered_single_quote = false; + bool all_c_and_shell_quote_compat = true; + +#define STORE(c) \ + do \ + { \ + if (len < buffersize) \ + buffer[len] = (c); \ + len++; \ + } \ + while (0) + +#define START_ESC() \ + do \ + { \ + if (elide_outer_quotes) \ + goto force_outer_quoting_style; \ + escaping = true; \ + if (quoting_style == shell_always_quoting_style \ + && ! pending_shell_escape_end) \ + { \ + STORE ('\''); \ + STORE ('$'); \ + STORE ('\''); \ + pending_shell_escape_end = true; \ + } \ + STORE ('\\'); \ + } \ + while (0) + +#define END_ESC() \ + do \ + { \ + if (pending_shell_escape_end && ! escaping) \ + { \ + STORE ('\''); \ + STORE ('\''); \ + pending_shell_escape_end = false; \ + } \ + } \ + while (0) + + process_input: + + switch (quoting_style) + { + case c_maybe_quoting_style: + quoting_style = c_quoting_style; + elide_outer_quotes = true; + FALLTHROUGH; + case c_quoting_style: + if (!elide_outer_quotes) + STORE ('"'); + backslash_escapes = true; + quote_string = "\""; + quote_string_len = 1; + break; + + case escape_quoting_style: + backslash_escapes = true; + elide_outer_quotes = false; + break; + + case locale_quoting_style: + case clocale_quoting_style: + case custom_quoting_style: + { + if (quoting_style != custom_quoting_style) + { + /* TRANSLATORS: + Get translations for open and closing quotation marks. + The message catalog should translate "`" to a left + quotation mark suitable for the locale, and similarly for + "'". For example, a French Unicode local should translate + these to U+00AB (LEFT-POINTING DOUBLE ANGLE + QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE + QUOTATION MARK), respectively. + + If the catalog has no translation, we will try to + use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and + Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the + current locale is not Unicode, locale_quoting_style + will quote 'like this', and clocale_quoting_style will + quote "like this". You should always include translations + for "`" and "'" even if U+2018 and U+2019 are appropriate + for your locale. + + If you don't know what to put here, please see + <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> + and use glyphs suitable for your language. */ + left_quote = gettext_quote (N_("`"), quoting_style); + right_quote = gettext_quote (N_("'"), quoting_style); + } + if (!elide_outer_quotes) + for (quote_string = left_quote; *quote_string; quote_string++) + STORE (*quote_string); + backslash_escapes = true; + quote_string = right_quote; + quote_string_len = strlen (quote_string); + } + break; + + case shell_escape_quoting_style: + backslash_escapes = true; + FALLTHROUGH; + case shell_quoting_style: + elide_outer_quotes = true; + FALLTHROUGH; + case shell_escape_always_quoting_style: + if (!elide_outer_quotes) + backslash_escapes = true; + FALLTHROUGH; + case shell_always_quoting_style: + quoting_style = shell_always_quoting_style; + if (!elide_outer_quotes) + STORE ('\''); + quote_string = "'"; + quote_string_len = 1; + break; + + case literal_quoting_style: + elide_outer_quotes = false; + break; + + default: + abort (); + } + + for (i = 0; ! (argsize == SIZE_MAX ? arg[i] == '\0' : i == argsize); i++) + { + unsigned char c; + unsigned char esc; + bool is_right_quote = false; + bool escaping = false; + bool c_and_shell_quote_compat = false; + + if (backslash_escapes + && quoting_style != shell_always_quoting_style + && quote_string_len + && (i + quote_string_len + <= (argsize == SIZE_MAX && 1 < quote_string_len + /* Use strlen only if we must: when argsize is SIZE_MAX, + and when the quote string is more than 1 byte long. + If we do call strlen, save the result. */ + ? (argsize = strlen (arg)) : argsize)) + && memcmp (arg + i, quote_string, quote_string_len) == 0) + { + if (elide_outer_quotes) + goto force_outer_quoting_style; + is_right_quote = true; + } + + c = arg[i]; + switch (c) + { + case '\0': + if (backslash_escapes) + { + START_ESC (); + /* If quote_string were to begin with digits, we'd need to + test for the end of the arg as well. However, it's + hard to imagine any locale that would use digits in + quotes, and set_custom_quoting is documented not to + accept them. Use only a single \0 with shell-escape + as currently digits are not printed within $'...' */ + if (quoting_style != shell_always_quoting_style + && i + 1 < argsize && '0' <= arg[i + 1] && arg[i + 1] <= '9') + { + STORE ('0'); + STORE ('0'); + } + c = '0'; + /* We don't have to worry that this last '0' will be + backslash-escaped because, again, quote_string should + not start with it and because quote_these_too is + documented as not accepting it. */ + } + else if (flags & QA_ELIDE_NULL_BYTES) + continue; + break; + + case '?': + switch (quoting_style) + { + case shell_always_quoting_style: + if (elide_outer_quotes) + goto force_outer_quoting_style; + break; + + case c_quoting_style: + if ((flags & QA_SPLIT_TRIGRAPHS) + && i + 2 < argsize && arg[i + 1] == '?') + switch (arg[i + 2]) + { + case '!': case '\'': + case '(': case ')': case '-': case '/': + case '<': case '=': case '>': + /* Escape the second '?' in what would otherwise be + a trigraph. */ + if (elide_outer_quotes) + goto force_outer_quoting_style; + c = arg[i + 2]; + i += 2; + STORE ('?'); + STORE ('"'); + STORE ('"'); + STORE ('?'); + break; + + default: + break; + } + break; + + default: + break; + } + break; + + case '\a': esc = 'a'; goto c_escape; + case '\b': esc = 'b'; goto c_escape; + case '\f': esc = 'f'; goto c_escape; + case '\n': esc = 'n'; goto c_and_shell_escape; + case '\r': esc = 'r'; goto c_and_shell_escape; + case '\t': esc = 't'; goto c_and_shell_escape; + case '\v': esc = 'v'; goto c_escape; + case '\\': esc = c; + /* Never need to escape '\' in shell case. */ + if (quoting_style == shell_always_quoting_style) + { + if (elide_outer_quotes) + goto force_outer_quoting_style; + goto store_c; + } + + /* No need to escape the escape if we are trying to elide + outer quotes and nothing else is problematic. */ + if (backslash_escapes && elide_outer_quotes && quote_string_len) + goto store_c; + + c_and_shell_escape: + if (quoting_style == shell_always_quoting_style + && elide_outer_quotes) + goto force_outer_quoting_style; + c_escape: + if (backslash_escapes) + { + c = esc; + goto store_escape; + } + break; + + case '{': case '}': /* sometimes special if isolated */ + if (! (argsize == SIZE_MAX ? arg[1] == '\0' : argsize == 1)) + break; + FALLTHROUGH; + case '#': case '~': + if (i != 0) + break; + FALLTHROUGH; + case ' ': + c_and_shell_quote_compat = true; + FALLTHROUGH; + case '!': /* special in bash */ + case '"': case '$': case '&': + case '(': case ')': case '*': case ';': + case '<': + case '=': /* sometimes special in 0th or (with "set -k") later args */ + case '>': case '[': + case '^': /* special in old /bin/sh, e.g. SunOS 4.1.4 */ + case '`': case '|': + /* A shell special character. In theory, '$' and '`' could + be the first bytes of multibyte characters, which means + we should check them with mbrtowc, but in practice this + doesn't happen so it's not worth worrying about. */ + if (quoting_style == shell_always_quoting_style + && elide_outer_quotes) + goto force_outer_quoting_style; + break; + + case '\'': + encountered_single_quote = true; + c_and_shell_quote_compat = true; + if (quoting_style == shell_always_quoting_style) + { + if (elide_outer_quotes) + goto force_outer_quoting_style; + + if (buffersize && ! orig_buffersize) + { + /* Just scan string to see if supports a more concise + representation, rather than writing a longer string + but returning the length of the more concise form. */ + orig_buffersize = buffersize; + buffersize = 0; + } + + STORE ('\''); + STORE ('\\'); + STORE ('\''); + pending_shell_escape_end = false; + } + break; + + case '%': case '+': case ',': case '-': case '.': case '/': + case '0': case '1': case '2': case '3': case '4': case '5': + case '6': case '7': case '8': case '9': case ':': + case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': + case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': + case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': + case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': + case 'Y': case 'Z': case ']': case '_': case 'a': case 'b': + case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': + case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': + case 'o': case 'p': case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': + /* These characters don't cause problems, no matter what the + quoting style is. They cannot start multibyte sequences. + A digit or a special letter would cause trouble if it + appeared at the beginning of quote_string because we'd then + escape by prepending a backslash. However, it's hard to + imagine any locale that would use digits or letters as + quotes, and set_custom_quoting is documented not to accept + them. Also, a digit or a special letter would cause + trouble if it appeared in quote_these_too, but that's also + documented as not accepting them. */ + c_and_shell_quote_compat = true; + break; + + default: + /* If we have a multibyte sequence, copy it until we reach + its end, find an error, or come back to the initial shift + state. For C-like styles, if the sequence has + unprintable characters, escape the whole sequence, since + we can't easily escape single characters within it. */ + { + /* Length of multibyte sequence found so far. */ + size_t m; + + bool printable; + + if (unibyte_locale) + { + m = 1; + printable = isprint (c) != 0; + } + else + { + mbstate_t mbstate; + memset (&mbstate, 0, sizeof mbstate); + + m = 0; + printable = true; + if (argsize == SIZE_MAX) + argsize = strlen (arg); + + do + { + wchar_t w; + size_t bytes = mbrtowc (&w, &arg[i + m], + argsize - (i + m), &mbstate); + if (bytes == 0) + break; + else if (bytes == (size_t) -1) + { + printable = false; + break; + } + else if (bytes == (size_t) -2) + { + printable = false; + while (i + m < argsize && arg[i + m]) + m++; + break; + } + else + { + /* Work around a bug with older shells that "see" a '\' + that is really the 2nd byte of a multibyte character. + In practice the problem is limited to ASCII + chars >= '@' that are shell special chars. */ + if ('[' == 0x5b && elide_outer_quotes + && quoting_style == shell_always_quoting_style) + { + size_t j; + for (j = 1; j < bytes; j++) + switch (arg[i + m + j]) + { + case '[': case '\\': case '^': + case '`': case '|': + goto force_outer_quoting_style; + + default: + break; + } + } + + if (! iswprint (w)) + printable = false; + m += bytes; + } + } + while (! mbsinit (&mbstate)); + } + + c_and_shell_quote_compat = printable; + + if (1 < m || (backslash_escapes && ! printable)) + { + /* Output a multibyte sequence, or an escaped + unprintable unibyte character. */ + size_t ilim = i + m; + + for (;;) + { + if (backslash_escapes && ! printable) + { + START_ESC (); + STORE ('0' + (c >> 6)); + STORE ('0' + ((c >> 3) & 7)); + c = '0' + (c & 7); + } + else if (is_right_quote) + { + STORE ('\\'); + is_right_quote = false; + } + if (ilim <= i + 1) + break; + END_ESC (); + STORE (c); + c = arg[++i]; + } + + goto store_c; + } + } + } + + if (! (((backslash_escapes && quoting_style != shell_always_quoting_style) + || elide_outer_quotes) + && quote_these_too + && quote_these_too[c / INT_BITS] >> (c % INT_BITS) & 1) + && !is_right_quote) + goto store_c; + + store_escape: + START_ESC (); + + store_c: + END_ESC (); + STORE (c); + + if (! c_and_shell_quote_compat) + all_c_and_shell_quote_compat = false; + } + + if (len == 0 && quoting_style == shell_always_quoting_style + && elide_outer_quotes) + goto force_outer_quoting_style; + + /* Single shell quotes (') are commonly enough used as an apostrophe, + that we attempt to minimize the quoting in this case. Note itʼs + better to use the apostrophe modifier "\u02BC" if possible, as that + renders better and works with the word match regex \W+ etc. */ + if (quoting_style == shell_always_quoting_style && ! elide_outer_quotes + && encountered_single_quote) + { + if (all_c_and_shell_quote_compat) + return quotearg_buffer_restyled (buffer, orig_buffersize, arg, argsize, + c_quoting_style, + flags, quote_these_too, + left_quote, right_quote); + else if (! buffersize && orig_buffersize) + { + /* Disable read-only scan, and reprocess to write quoted string. */ + buffersize = orig_buffersize; + len = 0; + goto process_input; + } + } + + if (quote_string && !elide_outer_quotes) + for (; *quote_string; quote_string++) + STORE (*quote_string); + + if (len < buffersize) + buffer[len] = '\0'; + return len; + + force_outer_quoting_style: + /* Don't reuse quote_these_too, since the addition of outer quotes + sufficiently quotes the specified characters. */ + if (quoting_style == shell_always_quoting_style && backslash_escapes) + quoting_style = shell_escape_always_quoting_style; + return quotearg_buffer_restyled (buffer, buffersize, arg, argsize, + quoting_style, + flags & ~QA_ELIDE_OUTER_QUOTES, NULL, + left_quote, right_quote); +} + +/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of + argument ARG (of size ARGSIZE), using O to control quoting. + If O is null, use the default. + Terminate the output with a null character, and return the written + size of the output, not counting the terminating null. + If BUFFERSIZE is too small to store the output string, return the + value that would have been returned had BUFFERSIZE been large enough. + If ARGSIZE is SIZE_MAX, use the string length of the argument for + ARGSIZE. */ +size_t +quotearg_buffer (char *buffer, size_t buffersize, + char const *arg, size_t argsize, + struct quoting_options const *o) +{ + struct quoting_options const *p = o ? o : &default_quoting_options; + int e = errno; + size_t r = quotearg_buffer_restyled (buffer, buffersize, arg, argsize, + p->style, p->flags, p->quote_these_too, + p->left_quote, p->right_quote); + errno = e; + return r; +} + +/* Equivalent to quotearg_alloc (ARG, ARGSIZE, NULL, O). */ +char * +quotearg_alloc (char const *arg, size_t argsize, + struct quoting_options const *o) +{ + return quotearg_alloc_mem (arg, argsize, NULL, o); +} + +/* Like quotearg_buffer (..., ARG, ARGSIZE, O), except return newly + allocated storage containing the quoted string, and store the + resulting size into *SIZE, if non-NULL. The result can contain + embedded null bytes only if ARGSIZE is not SIZE_MAX, SIZE is not + NULL, and set_quoting_flags has not set the null byte elision + flag. */ +char * +quotearg_alloc_mem (char const *arg, size_t argsize, size_t *size, + struct quoting_options const *o) +{ + struct quoting_options const *p = o ? o : &default_quoting_options; + int e = errno; + /* Elide embedded null bytes if we can't return a size. */ + int flags = p->flags | (size ? 0 : QA_ELIDE_NULL_BYTES); + size_t bufsize = quotearg_buffer_restyled (0, 0, arg, argsize, p->style, + flags, p->quote_these_too, + p->left_quote, + p->right_quote) + 1; + char *buf = xcharalloc (bufsize); + quotearg_buffer_restyled (buf, bufsize, arg, argsize, p->style, flags, + p->quote_these_too, + p->left_quote, p->right_quote); + errno = e; + if (size) + *size = bufsize - 1; + return buf; +} + +/* A storage slot with size and pointer to a value. */ +struct slotvec +{ + size_t size; + char *val; +}; + +/* Preallocate a slot 0 buffer, so that the caller can always quote + one small component of a "memory exhausted" message in slot 0. */ +static char slot0[256]; +static int nslots = 1; +static struct slotvec slotvec0 = {sizeof slot0, slot0}; +static struct slotvec *slotvec = &slotvec0; + +void +quotearg_free (void) +{ + struct slotvec *sv = slotvec; + int i; + for (i = 1; i < nslots; i++) + free (sv[i].val); + if (sv[0].val != slot0) + { + free (sv[0].val); + slotvec0.size = sizeof slot0; + slotvec0.val = slot0; + } + if (sv != &slotvec0) + { + free (sv); + slotvec = &slotvec0; + } + nslots = 1; +} + +/* Use storage slot N to return a quoted version of argument ARG. + ARG is of size ARGSIZE, but if that is SIZE_MAX, ARG is a + null-terminated string. + OPTIONS specifies the quoting options. + The returned value points to static storage that can be + reused by the next call to this function with the same value of N. + N must be nonnegative. N is deliberately declared with type "int" + to allow for future extensions (using negative values). */ +static char * +quotearg_n_options (int n, char const *arg, size_t argsize, + struct quoting_options const *options) +{ + int e = errno; + + struct slotvec *sv = slotvec; + + if (n < 0) + abort (); + + if (nslots <= n) + { + bool preallocated = (sv == &slotvec0); + + if (MIN (INT_MAX, MIN (PTRDIFF_MAX, SIZE_MAX) / sizeof *sv) <= n) + xalloc_die (); + + slotvec = sv = xrealloc (preallocated ? NULL : sv, (n + 1) * sizeof *sv); + if (preallocated) + *sv = slotvec0; + memset (sv + nslots, 0, (n + 1 - nslots) * sizeof *sv); + nslots = n + 1; + } + + { + size_t size = sv[n].size; + char *val = sv[n].val; + /* Elide embedded null bytes since we don't return a size. */ + int flags = options->flags | QA_ELIDE_NULL_BYTES; + size_t qsize = quotearg_buffer_restyled (val, size, arg, argsize, + options->style, flags, + options->quote_these_too, + options->left_quote, + options->right_quote); + + if (size <= qsize) + { + sv[n].size = size = qsize + 1; + if (val != slot0) + free (val); + sv[n].val = val = xcharalloc (size); + quotearg_buffer_restyled (val, size, arg, argsize, options->style, + flags, options->quote_these_too, + options->left_quote, + options->right_quote); + } + + errno = e; + return val; + } +} + +char * +quotearg_n (int n, char const *arg) +{ + return quotearg_n_options (n, arg, SIZE_MAX, &default_quoting_options); +} + +char * +quotearg_n_mem (int n, char const *arg, size_t argsize) +{ + return quotearg_n_options (n, arg, argsize, &default_quoting_options); +} + +char * +quotearg (char const *arg) +{ + return quotearg_n (0, arg); +} + +char * +quotearg_mem (char const *arg, size_t argsize) +{ + return quotearg_n_mem (0, arg, argsize); +} + +char * +quotearg_n_style (int n, enum quoting_style s, char const *arg) +{ + struct quoting_options const o = quoting_options_from_style (s); + return quotearg_n_options (n, arg, SIZE_MAX, &o); +} + +char * +quotearg_n_style_mem (int n, enum quoting_style s, + char const *arg, size_t argsize) +{ + struct quoting_options const o = quoting_options_from_style (s); + return quotearg_n_options (n, arg, argsize, &o); +} + +char * +quotearg_style (enum quoting_style s, char const *arg) +{ + return quotearg_n_style (0, s, arg); +} + +char * +quotearg_style_mem (enum quoting_style s, char const *arg, size_t argsize) +{ + return quotearg_n_style_mem (0, s, arg, argsize); +} + +char * +quotearg_char_mem (char const *arg, size_t argsize, char ch) +{ + struct quoting_options options; + options = default_quoting_options; + set_char_quoting (&options, ch, 1); + return quotearg_n_options (0, arg, argsize, &options); +} + +char * +quotearg_char (char const *arg, char ch) +{ + return quotearg_char_mem (arg, SIZE_MAX, ch); +} + +char * +quotearg_colon (char const *arg) +{ + return quotearg_char (arg, ':'); +} + +char * +quotearg_colon_mem (char const *arg, size_t argsize) +{ + return quotearg_char_mem (arg, argsize, ':'); +} + +char * +quotearg_n_style_colon (int n, enum quoting_style s, char const *arg) +{ + struct quoting_options options; + options = quoting_options_from_style (s); + set_char_quoting (&options, ':', 1); + return quotearg_n_options (n, arg, SIZE_MAX, &options); +} + +char * +quotearg_n_custom (int n, char const *left_quote, + char const *right_quote, char const *arg) +{ + return quotearg_n_custom_mem (n, left_quote, right_quote, arg, + SIZE_MAX); +} + +char * +quotearg_n_custom_mem (int n, char const *left_quote, + char const *right_quote, + char const *arg, size_t argsize) +{ + struct quoting_options o = default_quoting_options; + set_custom_quoting (&o, left_quote, right_quote); + return quotearg_n_options (n, arg, argsize, &o); +} + +char * +quotearg_custom (char const *left_quote, char const *right_quote, + char const *arg) +{ + return quotearg_n_custom (0, left_quote, right_quote, arg); +} + +char * +quotearg_custom_mem (char const *left_quote, char const *right_quote, + char const *arg, size_t argsize) +{ + return quotearg_n_custom_mem (0, left_quote, right_quote, arg, + argsize); +} + + +/* The quoting option used by the functions of quote.h. */ +struct quoting_options quote_quoting_options = + { + locale_quoting_style, + 0, + { 0 }, + NULL, NULL + }; + +char const * +quote_n_mem (int n, char const *arg, size_t argsize) +{ + return quotearg_n_options (n, arg, argsize, "e_quoting_options); +} + +char const * +quote_mem (char const *arg, size_t argsize) +{ + return quote_n_mem (0, arg, argsize); +} + +char const * +quote_n (int n, char const *arg) +{ + return quote_n_mem (n, arg, SIZE_MAX); +} + +char const * +quote (char const *arg) +{ + return quote_n (0, arg); +} diff --git a/local/recipes/tools/diffutils/source/lib/quotearg.h b/local/recipes/tools/diffutils/source/lib/quotearg.h new file mode 100644 index 0000000000..b82aa0085a --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/quotearg.h @@ -0,0 +1,425 @@ +/* quotearg.h - quote arguments for output + + Copyright (C) 1998-2002, 2004, 2006, 2008-2017 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert <eggert@twinsun.com> */ + +#ifndef QUOTEARG_H_ +# define QUOTEARG_H_ 1 + +# include <stddef.h> + +/* Basic quoting styles. For each style, an example is given on the + input strings "simple", "\0 \t\n'\"\033?""?/\\", and "a:b", using + quotearg_buffer, quotearg_mem, and quotearg_colon_mem with that + style and the default flags and quoted characters. Note that the + examples are shown here as valid C strings rather than what + displays on a terminal (with "??/" as a trigraph for "\\"). */ +enum quoting_style + { + /* Output names as-is (ls --quoting-style=literal). Can result in + embedded null bytes if QA_ELIDE_NULL_BYTES is not in + effect. + + quotearg_buffer: + "simple", "\0 \t\n'\"\033??/\\", "a:b" + quotearg: + "simple", " \t\n'\"\033??/\\", "a:b" + quotearg_colon: + "simple", " \t\n'\"\033??/\\", "a:b" + */ + literal_quoting_style, + + /* Quote names for the shell if they contain shell metacharacters + or would cause ambiguous output (ls --quoting-style=shell). + Can result in embedded null bytes if QA_ELIDE_NULL_BYTES is not + in effect. + + quotearg_buffer: + "simple", "'\0 \t\n'\\''\"\033??/\\'", "a:b" + quotearg: + "simple", "' \t\n'\\''\"\033??/\\'", "a:b" + quotearg_colon: + "simple", "' \t\n'\\''\"\033??/\\'", "'a:b'" + */ + shell_quoting_style, + + /* Quote names for the shell, even if they would normally not + require quoting (ls --quoting-style=shell-always). Can result + in embedded null bytes if QA_ELIDE_NULL_BYTES is not in effect. + Behaves like shell_quoting_style if QA_ELIDE_OUTER_QUOTES is in + effect. + + quotearg_buffer: + "'simple'", "'\0 \t\n'\\''\"\033??/\\'", "'a:b'" + quotearg: + "'simple'", "' \t\n'\\''\"\033??/\\'", "'a:b'" + quotearg_colon: + "'simple'", "' \t\n'\\''\"\033??/\\'", "'a:b'" + */ + shell_always_quoting_style, + + /* Quote names for the shell if they contain shell metacharacters + or other problematic characters (ls --quoting-style=shell-escape). + Non printable characters are quoted using the $'...' syntax, + which originated in ksh93 and is widely supported by most shells, + and proposed for inclusion in POSIX. + + quotearg_buffer: + "simple", "''$'\\0'' '$'\\t\\n'\\''\"'$'\\033''??/\\'", "a:b" + quotearg: + "simple", "''$'\\0'' '$'\\t\\n'\\''\"'$'\\033''??/\\'", "a:b" + quotearg_colon: + "simple", "''$'\\0'' '$'\\t\\n'\\''\"'$'\\033''??/\\'", "'a:b'" + */ + shell_escape_quoting_style, + + /* Quote names for the shell even if they would normally not + require quoting (ls --quoting-style=shell-escape). + Non printable characters are quoted using the $'...' syntax, + which originated in ksh93 and is widely supported by most shells, + and proposed for inclusion in POSIX. Behaves like + shell_escape_quoting_style if QA_ELIDE_OUTER_QUOTES is in effect. + + quotearg_buffer: + "simple", "''$'\\0'' '$'\\t\\n'\\''\"'$'\\033''??/\'", "a:b" + quotearg: + "simple", "''$'\\0'' '$'\\t\\n'\\''\"'$'\\033''??/\'", "a:b" + quotearg_colon: + "simple", "''$'\\0'' '$'\\t\\n'\\''\"'$'\\033''??/\'", "'a:b'" + */ + shell_escape_always_quoting_style, + + /* Quote names as for a C language string (ls --quoting-style=c). + Behaves like c_maybe_quoting_style if QA_ELIDE_OUTER_QUOTES is + in effect. Split into consecutive strings if + QA_SPLIT_TRIGRAPHS. + + quotearg_buffer: + "\"simple\"", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a:b\"" + quotearg: + "\"simple\"", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a:b\"" + quotearg_colon: + "\"simple\"", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a\\:b\"" + */ + c_quoting_style, + + /* Like c_quoting_style except omit the surrounding double-quote + characters if no quoted characters are encountered. + + quotearg_buffer: + "simple", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "a:b" + quotearg: + "simple", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "a:b" + quotearg_colon: + "simple", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a:b\"" + */ + c_maybe_quoting_style, + + /* Like c_quoting_style except always omit the surrounding + double-quote characters and ignore QA_SPLIT_TRIGRAPHS + (ls --quoting-style=escape). + + quotearg_buffer: + "simple", "\\0 \\t\\n'\"\\033??/\\\\", "a:b" + quotearg: + "simple", "\\0 \\t\\n'\"\\033??/\\\\", "a:b" + quotearg_colon: + "simple", "\\0 \\t\\n'\"\\033??/\\\\", "a\\:b" + */ + escape_quoting_style, + + /* Like clocale_quoting_style, but use single quotes in the + default C locale or if the program does not use gettext + (ls --quoting-style=locale). For UTF-8 locales, quote + characters will use Unicode. + + LC_MESSAGES=C + quotearg_buffer: + "`simple'", "`\\0 \\t\\n\\'\"\\033??/\\\\'", "`a:b'" + quotearg: + "`simple'", "`\\0 \\t\\n\\'\"\\033??/\\\\'", "`a:b'" + quotearg_colon: + "`simple'", "`\\0 \\t\\n\\'\"\\033??/\\\\'", "`a\\:b'" + + LC_MESSAGES=pt_PT.utf8 + quotearg_buffer: + "\302\253simple\302\273", + "\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a:b\302\273" + quotearg: + "\302\253simple\302\273", + "\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a:b\302\273" + quotearg_colon: + "\302\253simple\302\273", + "\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a\\:b\302\273" + */ + locale_quoting_style, + + /* Like c_quoting_style except use quotation marks appropriate for + the locale and ignore QA_SPLIT_TRIGRAPHS + (ls --quoting-style=clocale). + + LC_MESSAGES=C + quotearg_buffer: + "\"simple\"", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a:b\"" + quotearg: + "\"simple\"", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a:b\"" + quotearg_colon: + "\"simple\"", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a\\:b\"" + + LC_MESSAGES=pt_PT.utf8 + quotearg_buffer: + "\302\253simple\302\273", + "\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a:b\302\273" + quotearg: + "\302\253simple\302\273", + "\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a:b\302\273" + quotearg_colon: + "\302\253simple\302\273", + "\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a\\:b\302\273" + */ + clocale_quoting_style, + + /* Like clocale_quoting_style except use the custom quotation marks + set by set_custom_quoting. If custom quotation marks are not + set, the behavior is undefined. + + left_quote = right_quote = "'" + quotearg_buffer: + "'simple'", "'\\0 \\t\\n\\'\"\\033??/\\\\'", "'a:b'" + quotearg: + "'simple'", "'\\0 \\t\\n\\'\"\\033??/\\\\'", "'a:b'" + quotearg_colon: + "'simple'", "'\\0 \\t\\n\\'\"\\033??/\\\\'", "'a\\:b'" + + left_quote = "(" and right_quote = ")" + quotearg_buffer: + "(simple)", "(\\0 \\t\\n'\"\\033??/\\\\)", "(a:b)" + quotearg: + "(simple)", "(\\0 \\t\\n'\"\\033??/\\\\)", "(a:b)" + quotearg_colon: + "(simple)", "(\\0 \\t\\n'\"\\033??/\\\\)", "(a\\:b)" + + left_quote = ":" and right_quote = " " + quotearg_buffer: + ":simple ", ":\\0\\ \\t\\n'\"\\033??/\\\\ ", ":a:b " + quotearg: + ":simple ", ":\\0\\ \\t\\n'\"\\033??/\\\\ ", ":a:b " + quotearg_colon: + ":simple ", ":\\0\\ \\t\\n'\"\\033??/\\\\ ", ":a\\:b " + + left_quote = "\"'" and right_quote = "'\"" + Notice that this is treated as a single level of quotes or two + levels where the outer quote need not be escaped within the inner + quotes. For two levels where the outer quote must be escaped + within the inner quotes, you must use separate quotearg + invocations. + quotearg_buffer: + "\"'simple'\"", "\"'\\0 \\t\\n\\'\"\\033??/\\\\'\"", "\"'a:b'\"" + quotearg: + "\"'simple'\"", "\"'\\0 \\t\\n\\'\"\\033??/\\\\'\"", "\"'a:b'\"" + quotearg_colon: + "\"'simple'\"", "\"'\\0 \\t\\n\\'\"\\033??/\\\\'\"", "\"'a\\:b'\"" + */ + custom_quoting_style + }; + +/* Flags for use in set_quoting_flags. */ +enum quoting_flags + { + /* Always elide null bytes from styles that do not quote them, + even when the length of the result is available to the + caller. */ + QA_ELIDE_NULL_BYTES = 0x01, + + /* Omit the surrounding quote characters if no escaped characters + are encountered. Note that if no other character needs + escaping, then neither does the escape character. */ + QA_ELIDE_OUTER_QUOTES = 0x02, + + /* In the c_quoting_style and c_maybe_quoting_style, split ANSI + trigraph sequences into concatenated strings (for example, + "?""?/" rather than "??/", which could be confused with + "\\"). */ + QA_SPLIT_TRIGRAPHS = 0x04 + }; + +/* For now, --quoting-style=literal is the default, but this may change. */ +# ifndef DEFAULT_QUOTING_STYLE +# define DEFAULT_QUOTING_STYLE literal_quoting_style +# endif + +/* Names of quoting styles and their corresponding values. */ +extern char const *const quoting_style_args[]; +extern enum quoting_style const quoting_style_vals[]; + +struct quoting_options; + +/* The functions listed below set and use a hidden variable + that contains the default quoting style options. */ + +/* Allocate a new set of quoting options, with contents initially identical + to O if O is not null, or to the default if O is null. + It is the caller's responsibility to free the result. */ +struct quoting_options *clone_quoting_options (struct quoting_options *o); + +/* Get the value of O's quoting style. If O is null, use the default. */ +enum quoting_style get_quoting_style (struct quoting_options const *o); + +/* In O (or in the default if O is null), + set the value of the quoting style to S. */ +void set_quoting_style (struct quoting_options *o, enum quoting_style s); + +/* In O (or in the default if O is null), + set the value of the quoting options for character C to I. + Return the old value. Currently, the only values defined for I are + 0 (the default) and 1 (which means to quote the character even if + it would not otherwise be quoted). C must never be a digit or a + letter that has special meaning after a backslash (for example, "\t" + for tab). */ +int set_char_quoting (struct quoting_options *o, char c, int i); + +/* In O (or in the default if O is null), + set the value of the quoting options flag to I, which can be a + bitwise combination of enum quoting_flags, or 0 for default + behavior. Return the old value. */ +int set_quoting_flags (struct quoting_options *o, int i); + +/* In O (or in the default if O is null), + set the value of the quoting style to custom_quoting_style, + set the left quote to LEFT_QUOTE, and set the right quote to + RIGHT_QUOTE. Each of LEFT_QUOTE and RIGHT_QUOTE must be + null-terminated and can be the empty string. Because backslashes are + used for escaping, it does not make sense for RIGHT_QUOTE to contain + a backslash. RIGHT_QUOTE must not begin with a digit or a letter + that has special meaning after a backslash (for example, "\t" for + tab). */ +void set_custom_quoting (struct quoting_options *o, + char const *left_quote, + char const *right_quote); + +/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of + argument ARG (of size ARGSIZE), using O to control quoting. + If O is null, use the default. + Terminate the output with a null character, and return the written + size of the output, not counting the terminating null. + If BUFFERSIZE is too small to store the output string, return the + value that would have been returned had BUFFERSIZE been large enough. + If ARGSIZE is -1, use the string length of the argument for ARGSIZE. + On output, BUFFER might contain embedded null bytes if ARGSIZE was + not -1, the style of O does not use backslash escapes, and the + flags of O do not request elision of null bytes.*/ +size_t quotearg_buffer (char *buffer, size_t buffersize, + char const *arg, size_t argsize, + struct quoting_options const *o); + +/* Like quotearg_buffer, except return the result in a newly allocated + buffer. It is the caller's responsibility to free the result. The + result will not contain embedded null bytes. */ +char *quotearg_alloc (char const *arg, size_t argsize, + struct quoting_options const *o); + +/* Like quotearg_alloc, except that the length of the result, + excluding the terminating null byte, is stored into SIZE if it is + non-NULL. The result might contain embedded null bytes if ARGSIZE + was not -1, SIZE was not NULL, the style of O does not use + backslash escapes, and the flags of O do not request elision of + null bytes.*/ +char *quotearg_alloc_mem (char const *arg, size_t argsize, + size_t *size, struct quoting_options const *o); + +/* Use storage slot N to return a quoted version of the string ARG. + Use the default quoting options. + The returned value points to static storage that can be + reused by the next call to this function with the same value of N. + N must be nonnegative. The output of all functions in the + quotearg_n family are guaranteed to not contain embedded null + bytes.*/ +char *quotearg_n (int n, char const *arg); + +/* Equivalent to quotearg_n (0, ARG). */ +char *quotearg (char const *arg); + +/* Use storage slot N to return a quoted version of the argument ARG + of size ARGSIZE. This is like quotearg_n (N, ARG), except it can + quote null bytes. */ +char *quotearg_n_mem (int n, char const *arg, size_t argsize); + +/* Equivalent to quotearg_n_mem (0, ARG, ARGSIZE). */ +char *quotearg_mem (char const *arg, size_t argsize); + +/* Use style S and storage slot N to return a quoted version of the string ARG. + This is like quotearg_n (N, ARG), except that it uses S with no other + options to specify the quoting method. */ +char *quotearg_n_style (int n, enum quoting_style s, char const *arg); + +/* Use style S and storage slot N to return a quoted version of the + argument ARG of size ARGSIZE. This is like quotearg_n_style + (N, S, ARG), except it can quote null bytes. */ +char *quotearg_n_style_mem (int n, enum quoting_style s, + char const *arg, size_t argsize); + +/* Equivalent to quotearg_n_style (0, S, ARG). */ +char *quotearg_style (enum quoting_style s, char const *arg); + +/* Equivalent to quotearg_n_style_mem (0, S, ARG, ARGSIZE). */ +char *quotearg_style_mem (enum quoting_style s, + char const *arg, size_t argsize); + +/* Like quotearg (ARG), except also quote any instances of CH. + See set_char_quoting for a description of acceptable CH values. */ +char *quotearg_char (char const *arg, char ch); + +/* Like quotearg_char (ARG, CH), except it can quote null bytes. */ +char *quotearg_char_mem (char const *arg, size_t argsize, char ch); + +/* Equivalent to quotearg_char (ARG, ':'). */ +char *quotearg_colon (char const *arg); + +/* Like quotearg_colon (ARG), except it can quote null bytes. */ +char *quotearg_colon_mem (char const *arg, size_t argsize); + +/* Like quotearg_n_style, except with ':' quoting enabled. */ +char *quotearg_n_style_colon (int n, enum quoting_style s, char const *arg); + +/* Like quotearg_n_style (N, S, ARG) but with S as custom_quoting_style + with left quote as LEFT_QUOTE and right quote as RIGHT_QUOTE. See + set_custom_quoting for a description of acceptable LEFT_QUOTE and + RIGHT_QUOTE values. */ +char *quotearg_n_custom (int n, char const *left_quote, + char const *right_quote, char const *arg); + +/* Like quotearg_n_custom (N, LEFT_QUOTE, RIGHT_QUOTE, ARG) except it + can quote null bytes. */ +char *quotearg_n_custom_mem (int n, char const *left_quote, + char const *right_quote, + char const *arg, size_t argsize); + +/* Equivalent to quotearg_n_custom (0, LEFT_QUOTE, RIGHT_QUOTE, ARG). */ +char *quotearg_custom (char const *left_quote, char const *right_quote, + char const *arg); + +/* Equivalent to quotearg_n_custom_mem (0, LEFT_QUOTE, RIGHT_QUOTE, ARG, + ARGSIZE). */ +char *quotearg_custom_mem (char const *left_quote, + char const *right_quote, + char const *arg, size_t argsize); + +/* Free any dynamically allocated memory. */ +void quotearg_free (void); + +#endif /* !QUOTEARG_H_ */ diff --git a/local/recipes/tools/diffutils/source/lib/raise.c b/local/recipes/tools/diffutils/source/lib/raise.c new file mode 100644 index 0000000000..0a6d8ca9d8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/raise.c @@ -0,0 +1,81 @@ +/* Provide a non-threads replacement for the POSIX raise function. + + Copyright (C) 2002-2003, 2005-2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* written by Jim Meyering and Bruno Haible */ + +#include <config.h> + +/* Specification. */ +#include <signal.h> + +#if HAVE_RAISE +/* Native Windows platform. */ + +# include <errno.h> + +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER +# include "msvc-inval.h" +# endif + +# undef raise + +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER +static int +raise_nothrow (int sig) +{ + int result; + + TRY_MSVC_INVAL + { + result = raise (sig); + } + CATCH_MSVC_INVAL + { + result = -1; + errno = EINVAL; + } + DONE_MSVC_INVAL; + + return result; +} +# else +# define raise_nothrow raise +# endif + +#else +/* An old Unix platform. */ + +# include <unistd.h> + +# define rpl_raise raise + +#endif + +int +rpl_raise (int sig) +{ +#if GNULIB_defined_signal_blocking && GNULIB_defined_SIGPIPE + if (sig == SIGPIPE) + return _gl_raise_SIGPIPE (); +#endif + +#if HAVE_RAISE + return raise_nothrow (sig); +#else + return kill (getpid (), sig); +#endif +} diff --git a/local/recipes/tools/diffutils/source/lib/rawmemchr.c b/local/recipes/tools/diffutils/source/lib/rawmemchr.c new file mode 100644 index 0000000000..bba95b62f0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/rawmemchr.c @@ -0,0 +1,136 @@ +/* Searching in a string. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <string.h> + +/* Find the first occurrence of C in S. */ +void * +rawmemchr (const void *s, int c_in) +{ + /* On 32-bit hardware, choosing longword to be a 32-bit unsigned + long instead of a 64-bit uintmax_t tends to give better + performance. On 64-bit hardware, unsigned long is generally 64 + bits already. Change this typedef to experiment with + performance. */ + typedef unsigned long int longword; + + const unsigned char *char_ptr; + const longword *longword_ptr; + longword repeated_one; + longword repeated_c; + unsigned char c; + + c = (unsigned char) c_in; + + /* Handle the first few bytes by reading one byte at a time. + Do this until CHAR_PTR is aligned on a longword boundary. */ + for (char_ptr = (const unsigned char *) s; + (size_t) char_ptr % sizeof (longword) != 0; + ++char_ptr) + if (*char_ptr == c) + return (void *) char_ptr; + + longword_ptr = (const longword *) char_ptr; + + /* All these elucidatory comments refer to 4-byte longwords, + but the theory applies equally well to any size longwords. */ + + /* Compute auxiliary longword values: + repeated_one is a value which has a 1 in every byte. + repeated_c has c in every byte. */ + repeated_one = 0x01010101; + repeated_c = c | (c << 8); + repeated_c |= repeated_c << 16; + if (0xffffffffU < (longword) -1) + { + repeated_one |= repeated_one << 31 << 1; + repeated_c |= repeated_c << 31 << 1; + if (8 < sizeof (longword)) + { + size_t i; + + for (i = 64; i < sizeof (longword) * 8; i *= 2) + { + repeated_one |= repeated_one << i; + repeated_c |= repeated_c << i; + } + } + } + + /* Instead of the traditional loop which tests each byte, we will + test a longword at a time. The tricky part is testing if *any of + the four* bytes in the longword in question are equal to NUL or + c. We first use an xor with repeated_c. This reduces the task + to testing whether *any of the four* bytes in longword1 is zero. + + We compute tmp = + ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7). + That is, we perform the following operations: + 1. Subtract repeated_one. + 2. & ~longword1. + 3. & a mask consisting of 0x80 in every byte. + Consider what happens in each byte: + - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff, + and step 3 transforms it into 0x80. A carry can also be propagated + to more significant bytes. + - If a byte of longword1 is nonzero, let its lowest 1 bit be at + position k (0 <= k <= 7); so the lowest k bits are 0. After step 1, + the byte ends in a single bit of value 0 and k bits of value 1. + After step 2, the result is just k bits of value 1: 2^k - 1. After + step 3, the result is 0. And no carry is produced. + So, if longword1 has only non-zero bytes, tmp is zero. + Whereas if longword1 has a zero byte, call j the position of the least + significant zero byte. Then the result has a zero at positions 0, ..., + j-1 and a 0x80 at position j. We cannot predict the result at the more + significant bytes (positions j+1..3), but it does not matter since we + already have a non-zero bit at position 8*j+7. + + The test whether any byte in longword1 is zero is equivalent + to testing whether tmp is nonzero. + + This test can read beyond the end of a string, depending on where + C_IN is encountered. However, this is considered safe since the + initialization phase ensured that the read will be aligned, + therefore, the read will not cross page boundaries and will not + cause a fault. */ + + while (1) + { + longword longword1 = *longword_ptr ^ repeated_c; + + if ((((longword1 - repeated_one) & ~longword1) + & (repeated_one << 7)) != 0) + break; + longword_ptr++; + } + + char_ptr = (const unsigned char *) longword_ptr; + + /* At this point, we know that one of the sizeof (longword) bytes + starting at char_ptr is == c. On little-endian machines, we + could determine the first such byte without any further memory + accesses, just by looking at the tmp result from the last loop + iteration. But this does not work on big-endian machines. + Choose code that works in both cases. */ + + char_ptr = (unsigned char *) longword_ptr; + while (*char_ptr != c) + char_ptr++; + return (void *) char_ptr; +} diff --git a/local/recipes/tools/diffutils/source/lib/rawmemchr.valgrind b/local/recipes/tools/diffutils/source/lib/rawmemchr.valgrind new file mode 100644 index 0000000000..6363923680 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/rawmemchr.valgrind @@ -0,0 +1,12 @@ +# Suppress a valgrind message about use of uninitialized memory in rawmemchr(). +# This use is OK because it provides only a speedup. +{ + rawmemchr-value4 + Memcheck:Value4 + fun:rawmemchr +} +{ + rawmemchr-value8 + Memcheck:Value8 + fun:rawmemchr +} diff --git a/local/recipes/tools/diffutils/source/lib/readlink.c b/local/recipes/tools/diffutils/source/lib/readlink.c new file mode 100644 index 0000000000..bf0cedc5fa --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/readlink.c @@ -0,0 +1,74 @@ +/* Stub for readlink(). + Copyright (C) 2003-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <unistd.h> + +#include <errno.h> +#include <string.h> +#include <sys/stat.h> + +#if !HAVE_READLINK + +/* readlink() substitute for systems that don't have a readlink() function, + such as DJGPP 2.03 and mingw32. */ + +ssize_t +readlink (const char *name, char *buf _GL_UNUSED, + size_t bufsize _GL_UNUSED) +{ + struct stat statbuf; + + /* In general we should use lstat() here, not stat(). But on platforms + without symbolic links, lstat() - if it exists - would be equivalent to + stat(), therefore we can use stat(). This saves us a configure check. */ + if (stat (name, &statbuf) >= 0) + errno = EINVAL; + return -1; +} + +#else /* HAVE_READLINK */ + +# undef readlink + +/* readlink() wrapper that uses correct types, for systems like cygwin + 1.5.x where readlink returns int, and which rejects trailing slash, + for Solaris 9. */ + +ssize_t +rpl_readlink (const char *name, char *buf, size_t bufsize) +{ +# if READLINK_TRAILING_SLASH_BUG + size_t len = strlen (name); + if (len && name[len - 1] == '/') + { + /* Even if name without the slash is a symlink to a directory, + both lstat() and stat() must resolve the trailing slash to + the directory rather than the symlink. We can therefore + safely use stat() to distinguish between EINVAL and + ENOTDIR/ENOENT, avoiding extra overhead of rpl_lstat(). */ + struct stat st; + if (stat (name, &st) == 0) + errno = EINVAL; + return -1; + } +# endif /* READLINK_TRAILING_SLASH_BUG */ + return readlink (name, buf, bufsize); +} + +#endif /* HAVE_READLINK */ diff --git a/local/recipes/tools/diffutils/source/lib/ref-add.sin b/local/recipes/tools/diffutils/source/lib/ref-add.sin new file mode 100644 index 0000000000..3913e997bc --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/ref-add.sin @@ -0,0 +1,29 @@ +# Add this package to a list of references stored in a text file. +# +# Copyright (C) 2000, 2009-2017 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, see <http://www.gnu.org/licenses/>. +# +# Written by Bruno Haible <haible@clisp.cons.org>. +# +/^# Packages using this file: / { + s/# Packages using this file:// + ta + :a + s/ @PACKAGE@ / @PACKAGE@ / + tb + s/ $/ @PACKAGE@ / + :b + s/^/# Packages using this file:/ +} diff --git a/local/recipes/tools/diffutils/source/lib/ref-del.sin b/local/recipes/tools/diffutils/source/lib/ref-del.sin new file mode 100644 index 0000000000..eeff94743e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/ref-del.sin @@ -0,0 +1,24 @@ +# Remove this package from a list of references stored in a text file. +# +# Copyright (C) 2000, 2009-2017 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, see <http://www.gnu.org/licenses/>. +# +# Written by Bruno Haible <haible@clisp.cons.org>. +# +/^# Packages using this file: / { + s/# Packages using this file:// + s/ @PACKAGE@ / / + s/^/# Packages using this file:/ +} diff --git a/local/recipes/tools/diffutils/source/lib/regcomp.c b/local/recipes/tools/diffutils/source/lib/regcomp.c new file mode 100644 index 0000000000..6aaa6b12cf --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/regcomp.c @@ -0,0 +1,3937 @@ +/* Extended regular expression matching and search library. + Copyright (C) 2002-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifdef _LIBC +# include <locale/weight.h> +#endif + +static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern, + size_t length, reg_syntax_t syntax); +static void re_compile_fastmap_iter (regex_t *bufp, + const re_dfastate_t *init_state, + char *fastmap); +static reg_errcode_t init_dfa (re_dfa_t *dfa, size_t pat_len); +#ifdef RE_ENABLE_I18N +static void free_charset (re_charset_t *cset); +#endif /* RE_ENABLE_I18N */ +static void free_workarea_compile (regex_t *preg); +static reg_errcode_t create_initial_state (re_dfa_t *dfa); +#ifdef RE_ENABLE_I18N +static void optimize_utf8 (re_dfa_t *dfa); +#endif +static reg_errcode_t analyze (regex_t *preg); +static reg_errcode_t preorder (bin_tree_t *root, + reg_errcode_t (fn (void *, bin_tree_t *)), + void *extra); +static reg_errcode_t postorder (bin_tree_t *root, + reg_errcode_t (fn (void *, bin_tree_t *)), + void *extra); +static reg_errcode_t optimize_subexps (void *extra, bin_tree_t *node); +static reg_errcode_t lower_subexps (void *extra, bin_tree_t *node); +static bin_tree_t *lower_subexp (reg_errcode_t *err, regex_t *preg, + bin_tree_t *node); +static reg_errcode_t calc_first (void *extra, bin_tree_t *node); +static reg_errcode_t calc_next (void *extra, bin_tree_t *node); +static reg_errcode_t link_nfa_nodes (void *extra, bin_tree_t *node); +static Idx duplicate_node (re_dfa_t *dfa, Idx org_idx, unsigned int constraint); +static Idx search_duplicated_node (const re_dfa_t *dfa, Idx org_node, + unsigned int constraint); +static reg_errcode_t calc_eclosure (re_dfa_t *dfa); +static reg_errcode_t calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, + Idx node, bool root); +static reg_errcode_t calc_inveclosure (re_dfa_t *dfa); +static Idx fetch_number (re_string_t *input, re_token_t *token, + reg_syntax_t syntax); +static int peek_token (re_token_t *token, re_string_t *input, + reg_syntax_t syntax) internal_function; +static bin_tree_t *parse (re_string_t *regexp, regex_t *preg, + reg_syntax_t syntax, reg_errcode_t *err); +static bin_tree_t *parse_reg_exp (re_string_t *regexp, regex_t *preg, + re_token_t *token, reg_syntax_t syntax, + Idx nest, reg_errcode_t *err); +static bin_tree_t *parse_branch (re_string_t *regexp, regex_t *preg, + re_token_t *token, reg_syntax_t syntax, + Idx nest, reg_errcode_t *err); +static bin_tree_t *parse_expression (re_string_t *regexp, regex_t *preg, + re_token_t *token, reg_syntax_t syntax, + Idx nest, reg_errcode_t *err); +static bin_tree_t *parse_sub_exp (re_string_t *regexp, regex_t *preg, + re_token_t *token, reg_syntax_t syntax, + Idx nest, reg_errcode_t *err); +static bin_tree_t *parse_dup_op (bin_tree_t *dup_elem, re_string_t *regexp, + re_dfa_t *dfa, re_token_t *token, + reg_syntax_t syntax, reg_errcode_t *err); +static bin_tree_t *parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, + re_token_t *token, reg_syntax_t syntax, + reg_errcode_t *err); +static reg_errcode_t parse_bracket_element (bracket_elem_t *elem, + re_string_t *regexp, + re_token_t *token, int token_len, + re_dfa_t *dfa, + reg_syntax_t syntax, + bool accept_hyphen); +static reg_errcode_t parse_bracket_symbol (bracket_elem_t *elem, + re_string_t *regexp, + re_token_t *token); +#ifdef RE_ENABLE_I18N +static reg_errcode_t build_equiv_class (bitset_t sbcset, + re_charset_t *mbcset, + Idx *equiv_class_alloc, + const unsigned char *name); +static reg_errcode_t build_charclass (RE_TRANSLATE_TYPE trans, + bitset_t sbcset, + re_charset_t *mbcset, + Idx *char_class_alloc, + const char *class_name, + reg_syntax_t syntax); +#else /* not RE_ENABLE_I18N */ +static reg_errcode_t build_equiv_class (bitset_t sbcset, + const unsigned char *name); +static reg_errcode_t build_charclass (RE_TRANSLATE_TYPE trans, + bitset_t sbcset, + const char *class_name, + reg_syntax_t syntax); +#endif /* not RE_ENABLE_I18N */ +static bin_tree_t *build_charclass_op (re_dfa_t *dfa, + RE_TRANSLATE_TYPE trans, + const char *class_name, + const char *extra, + bool non_match, reg_errcode_t *err); +static bin_tree_t *create_tree (re_dfa_t *dfa, + bin_tree_t *left, bin_tree_t *right, + re_token_type_t type); +static bin_tree_t *create_token_tree (re_dfa_t *dfa, + bin_tree_t *left, bin_tree_t *right, + const re_token_t *token); +static bin_tree_t *duplicate_tree (const bin_tree_t *src, re_dfa_t *dfa); +static void free_token (re_token_t *node); +static reg_errcode_t free_tree (void *extra, bin_tree_t *node); +static reg_errcode_t mark_opt_subexp (void *extra, bin_tree_t *node); + +/* This table gives an error message for each of the error codes listed + in regex.h. Obviously the order here has to be same as there. + POSIX doesn't require that we do anything for REG_NOERROR, + but why not be nice? */ + +static const char __re_error_msgid[] = + { +#define REG_NOERROR_IDX 0 + gettext_noop ("Success") /* REG_NOERROR */ + "\0" +#define REG_NOMATCH_IDX (REG_NOERROR_IDX + sizeof "Success") + gettext_noop ("No match") /* REG_NOMATCH */ + "\0" +#define REG_BADPAT_IDX (REG_NOMATCH_IDX + sizeof "No match") + gettext_noop ("Invalid regular expression") /* REG_BADPAT */ + "\0" +#define REG_ECOLLATE_IDX (REG_BADPAT_IDX + sizeof "Invalid regular expression") + gettext_noop ("Invalid collation character") /* REG_ECOLLATE */ + "\0" +#define REG_ECTYPE_IDX (REG_ECOLLATE_IDX + sizeof "Invalid collation character") + gettext_noop ("Invalid character class name") /* REG_ECTYPE */ + "\0" +#define REG_EESCAPE_IDX (REG_ECTYPE_IDX + sizeof "Invalid character class name") + gettext_noop ("Trailing backslash") /* REG_EESCAPE */ + "\0" +#define REG_ESUBREG_IDX (REG_EESCAPE_IDX + sizeof "Trailing backslash") + gettext_noop ("Invalid back reference") /* REG_ESUBREG */ + "\0" +#define REG_EBRACK_IDX (REG_ESUBREG_IDX + sizeof "Invalid back reference") + gettext_noop ("Unmatched [, [^, [:, [., or [=") /* REG_EBRACK */ + "\0" +#define REG_EPAREN_IDX (REG_EBRACK_IDX + sizeof "Unmatched [, [^, [:, [., or [=") + gettext_noop ("Unmatched ( or \\(") /* REG_EPAREN */ + "\0" +#define REG_EBRACE_IDX (REG_EPAREN_IDX + sizeof "Unmatched ( or \\(") + gettext_noop ("Unmatched \\{") /* REG_EBRACE */ + "\0" +#define REG_BADBR_IDX (REG_EBRACE_IDX + sizeof "Unmatched \\{") + gettext_noop ("Invalid content of \\{\\}") /* REG_BADBR */ + "\0" +#define REG_ERANGE_IDX (REG_BADBR_IDX + sizeof "Invalid content of \\{\\}") + gettext_noop ("Invalid range end") /* REG_ERANGE */ + "\0" +#define REG_ESPACE_IDX (REG_ERANGE_IDX + sizeof "Invalid range end") + gettext_noop ("Memory exhausted") /* REG_ESPACE */ + "\0" +#define REG_BADRPT_IDX (REG_ESPACE_IDX + sizeof "Memory exhausted") + gettext_noop ("Invalid preceding regular expression") /* REG_BADRPT */ + "\0" +#define REG_EEND_IDX (REG_BADRPT_IDX + sizeof "Invalid preceding regular expression") + gettext_noop ("Premature end of regular expression") /* REG_EEND */ + "\0" +#define REG_ESIZE_IDX (REG_EEND_IDX + sizeof "Premature end of regular expression") + gettext_noop ("Regular expression too big") /* REG_ESIZE */ + "\0" +#define REG_ERPAREN_IDX (REG_ESIZE_IDX + sizeof "Regular expression too big") + gettext_noop ("Unmatched ) or \\)") /* REG_ERPAREN */ + }; + +static const size_t __re_error_msgid_idx[] = + { + REG_NOERROR_IDX, + REG_NOMATCH_IDX, + REG_BADPAT_IDX, + REG_ECOLLATE_IDX, + REG_ECTYPE_IDX, + REG_EESCAPE_IDX, + REG_ESUBREG_IDX, + REG_EBRACK_IDX, + REG_EPAREN_IDX, + REG_EBRACE_IDX, + REG_BADBR_IDX, + REG_ERANGE_IDX, + REG_ESPACE_IDX, + REG_BADRPT_IDX, + REG_EEND_IDX, + REG_ESIZE_IDX, + REG_ERPAREN_IDX + }; + +/* Entry points for GNU code. */ + +/* re_compile_pattern is the GNU regular expression compiler: it + compiles PATTERN (of length LENGTH) and puts the result in BUFP. + Returns 0 if the pattern was valid, otherwise an error string. + + Assumes the 'allocated' (and perhaps 'buffer') and 'translate' fields + are set in BUFP on entry. */ + +const char * +re_compile_pattern (const char *pattern, size_t length, + struct re_pattern_buffer *bufp) +{ + reg_errcode_t ret; + + /* And GNU code determines whether or not to get register information + by passing null for the REGS argument to re_match, etc., not by + setting no_sub, unless RE_NO_SUB is set. */ + bufp->no_sub = !!(re_syntax_options & RE_NO_SUB); + + /* Match anchors at newline. */ + bufp->newline_anchor = 1; + + ret = re_compile_internal (bufp, pattern, length, re_syntax_options); + + if (!ret) + return NULL; + return gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]); +} +#ifdef _LIBC +weak_alias (__re_compile_pattern, re_compile_pattern) +#endif + +/* Set by 're_set_syntax' to the current regexp syntax to recognize. Can + also be assigned to arbitrarily: each pattern buffer stores its own + syntax, so it can be changed between regex compilations. */ +/* This has no initializer because initialized variables in Emacs + become read-only after dumping. */ +reg_syntax_t re_syntax_options; + + +/* Specify the precise syntax of regexps for compilation. This provides + for compatibility for various utilities which historically have + different, incompatible syntaxes. + + The argument SYNTAX is a bit mask comprised of the various bits + defined in regex.h. We return the old syntax. */ + +reg_syntax_t +re_set_syntax (reg_syntax_t syntax) +{ + reg_syntax_t ret = re_syntax_options; + + re_syntax_options = syntax; + return ret; +} +#ifdef _LIBC +weak_alias (__re_set_syntax, re_set_syntax) +#endif + +int +re_compile_fastmap (struct re_pattern_buffer *bufp) +{ + re_dfa_t *dfa = bufp->buffer; + char *fastmap = bufp->fastmap; + + memset (fastmap, '\0', sizeof (char) * SBC_MAX); + re_compile_fastmap_iter (bufp, dfa->init_state, fastmap); + if (dfa->init_state != dfa->init_state_word) + re_compile_fastmap_iter (bufp, dfa->init_state_word, fastmap); + if (dfa->init_state != dfa->init_state_nl) + re_compile_fastmap_iter (bufp, dfa->init_state_nl, fastmap); + if (dfa->init_state != dfa->init_state_begbuf) + re_compile_fastmap_iter (bufp, dfa->init_state_begbuf, fastmap); + bufp->fastmap_accurate = 1; + return 0; +} +#ifdef _LIBC +weak_alias (__re_compile_fastmap, re_compile_fastmap) +#endif + +static inline void +__attribute__ ((always_inline)) +re_set_fastmap (char *fastmap, bool icase, int ch) +{ + fastmap[ch] = 1; + if (icase) + fastmap[tolower (ch)] = 1; +} + +/* Helper function for re_compile_fastmap. + Compile fastmap for the initial_state INIT_STATE. */ + +static void +re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, + char *fastmap) +{ + re_dfa_t *dfa = bufp->buffer; + Idx node_cnt; + bool icase = (dfa->mb_cur_max == 1 && (bufp->syntax & RE_ICASE)); + for (node_cnt = 0; node_cnt < init_state->nodes.nelem; ++node_cnt) + { + Idx node = init_state->nodes.elems[node_cnt]; + re_token_type_t type = dfa->nodes[node].type; + + if (type == CHARACTER) + { + re_set_fastmap (fastmap, icase, dfa->nodes[node].opr.c); +#ifdef RE_ENABLE_I18N + if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1) + { + unsigned char buf[MB_LEN_MAX]; + unsigned char *p; + wchar_t wc; + mbstate_t state; + + p = buf; + *p++ = dfa->nodes[node].opr.c; + while (++node < dfa->nodes_len + && dfa->nodes[node].type == CHARACTER + && dfa->nodes[node].mb_partial) + *p++ = dfa->nodes[node].opr.c; + memset (&state, '\0', sizeof (state)); + if (__mbrtowc (&wc, (const char *) buf, p - buf, + &state) == p - buf + && (__wcrtomb ((char *) buf, __towlower (wc), &state) + != (size_t) -1)) + re_set_fastmap (fastmap, false, buf[0]); + } +#endif + } + else if (type == SIMPLE_BRACKET) + { + int i, ch; + for (i = 0, ch = 0; i < BITSET_WORDS; ++i) + { + int j; + bitset_word_t w = dfa->nodes[node].opr.sbcset[i]; + for (j = 0; j < BITSET_WORD_BITS; ++j, ++ch) + if (w & ((bitset_word_t) 1 << j)) + re_set_fastmap (fastmap, icase, ch); + } + } +#ifdef RE_ENABLE_I18N + else if (type == COMPLEX_BRACKET) + { + re_charset_t *cset = dfa->nodes[node].opr.mbcset; + Idx i; + +# ifdef _LIBC + /* See if we have to try all bytes which start multiple collation + elements. + e.g. In da_DK, we want to catch 'a' since "aa" is a valid + collation element, and don't catch 'b' since 'b' is + the only collation element which starts from 'b' (and + it is caught by SIMPLE_BRACKET). */ + if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0 + && (cset->ncoll_syms || cset->nranges)) + { + const int32_t *table = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB); + for (i = 0; i < SBC_MAX; ++i) + if (table[i] < 0) + re_set_fastmap (fastmap, icase, i); + } +# endif /* _LIBC */ + + /* See if we have to start the match at all multibyte characters, + i.e. where we would not find an invalid sequence. This only + applies to multibyte character sets; for single byte character + sets, the SIMPLE_BRACKET again suffices. */ + if (dfa->mb_cur_max > 1 + && (cset->nchar_classes || cset->non_match || cset->nranges +# ifdef _LIBC + || cset->nequiv_classes +# endif /* _LIBC */ + )) + { + unsigned char c = 0; + do + { + mbstate_t mbs; + memset (&mbs, 0, sizeof (mbs)); + if (__mbrtowc (NULL, (char *) &c, 1, &mbs) == (size_t) -2) + re_set_fastmap (fastmap, false, (int) c); + } + while (++c != 0); + } + + else + { + /* ... Else catch all bytes which can start the mbchars. */ + for (i = 0; i < cset->nmbchars; ++i) + { + char buf[256]; + mbstate_t state; + memset (&state, '\0', sizeof (state)); + if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1) + re_set_fastmap (fastmap, icase, *(unsigned char *) buf); + if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1) + { + if (__wcrtomb (buf, __towlower (cset->mbchars[i]), &state) + != (size_t) -1) + re_set_fastmap (fastmap, false, *(unsigned char *) buf); + } + } + } + } +#endif /* RE_ENABLE_I18N */ + else if (type == OP_PERIOD +#ifdef RE_ENABLE_I18N + || type == OP_UTF8_PERIOD +#endif /* RE_ENABLE_I18N */ + || type == END_OF_RE) + { + memset (fastmap, '\1', sizeof (char) * SBC_MAX); + if (type == END_OF_RE) + bufp->can_be_null = 1; + return; + } + } +} + +/* Entry point for POSIX code. */ +/* regcomp takes a regular expression as a string and compiles it. + + PREG is a regex_t *. We do not expect any fields to be initialized, + since POSIX says we shouldn't. Thus, we set + + 'buffer' to the compiled pattern; + 'used' to the length of the compiled pattern; + 'syntax' to RE_SYNTAX_POSIX_EXTENDED if the + REG_EXTENDED bit in CFLAGS is set; otherwise, to + RE_SYNTAX_POSIX_BASIC; + 'newline_anchor' to REG_NEWLINE being set in CFLAGS; + 'fastmap' to an allocated space for the fastmap; + 'fastmap_accurate' to zero; + 're_nsub' to the number of subexpressions in PATTERN. + + PATTERN is the address of the pattern string. + + CFLAGS is a series of bits which affect compilation. + + If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we + use POSIX basic syntax. + + If REG_NEWLINE is set, then . and [^...] don't match newline. + Also, regexec will try a match beginning after every newline. + + If REG_ICASE is set, then we considers upper- and lowercase + versions of letters to be equivalent when matching. + + If REG_NOSUB is set, then when PREG is passed to regexec, that + routine will report only success or failure, and nothing about the + registers. + + It returns 0 if it succeeds, nonzero if it doesn't. (See regex.h for + the return codes and their meanings.) */ + +int +regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags) +{ + reg_errcode_t ret; + reg_syntax_t syntax = ((cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTENDED + : RE_SYNTAX_POSIX_BASIC); + + preg->buffer = NULL; + preg->allocated = 0; + preg->used = 0; + + /* Try to allocate space for the fastmap. */ + preg->fastmap = re_malloc (char, SBC_MAX); + if (BE (preg->fastmap == NULL, 0)) + return REG_ESPACE; + + syntax |= (cflags & REG_ICASE) ? RE_ICASE : 0; + + /* If REG_NEWLINE is set, newlines are treated differently. */ + if (cflags & REG_NEWLINE) + { /* REG_NEWLINE implies neither . nor [^...] match newline. */ + syntax &= ~RE_DOT_NEWLINE; + syntax |= RE_HAT_LISTS_NOT_NEWLINE; + /* It also changes the matching behavior. */ + preg->newline_anchor = 1; + } + else + preg->newline_anchor = 0; + preg->no_sub = !!(cflags & REG_NOSUB); + preg->translate = NULL; + + ret = re_compile_internal (preg, pattern, strlen (pattern), syntax); + + /* POSIX doesn't distinguish between an unmatched open-group and an + unmatched close-group: both are REG_EPAREN. */ + if (ret == REG_ERPAREN) + ret = REG_EPAREN; + + /* We have already checked preg->fastmap != NULL. */ + if (BE (ret == REG_NOERROR, 1)) + /* Compute the fastmap now, since regexec cannot modify the pattern + buffer. This function never fails in this implementation. */ + (void) re_compile_fastmap (preg); + else + { + /* Some error occurred while compiling the expression. */ + re_free (preg->fastmap); + preg->fastmap = NULL; + } + + return (int) ret; +} +#ifdef _LIBC +weak_alias (__regcomp, regcomp) +#endif + +/* Returns a message corresponding to an error code, ERRCODE, returned + from either regcomp or regexec. We don't use PREG here. */ + +size_t +regerror (int errcode, const regex_t *_Restrict_ preg, char *_Restrict_ errbuf, + size_t errbuf_size) +{ + const char *msg; + size_t msg_size; + + if (BE (errcode < 0 + || errcode >= (int) (sizeof (__re_error_msgid_idx) + / sizeof (__re_error_msgid_idx[0])), 0)) + /* Only error codes returned by the rest of the code should be passed + to this routine. If we are given anything else, or if other regex + code generates an invalid error code, then the program has a bug. + Dump core so we can fix it. */ + abort (); + + msg = gettext (__re_error_msgid + __re_error_msgid_idx[errcode]); + + msg_size = strlen (msg) + 1; /* Includes the null. */ + + if (BE (errbuf_size != 0, 1)) + { + size_t cpy_size = msg_size; + if (BE (msg_size > errbuf_size, 0)) + { + cpy_size = errbuf_size - 1; + errbuf[cpy_size] = '\0'; + } + memcpy (errbuf, msg, cpy_size); + } + + return msg_size; +} +#ifdef _LIBC +weak_alias (__regerror, regerror) +#endif + + +#ifdef RE_ENABLE_I18N +/* This static array is used for the map to single-byte characters when + UTF-8 is used. Otherwise we would allocate memory just to initialize + it the same all the time. UTF-8 is the preferred encoding so this is + a worthwhile optimization. */ +static const bitset_t utf8_sb_map = +{ + /* Set the first 128 bits. */ +# if defined __GNUC__ && !defined __STRICT_ANSI__ + [0 ... 0x80 / BITSET_WORD_BITS - 1] = BITSET_WORD_MAX +# else +# if 4 * BITSET_WORD_BITS < ASCII_CHARS +# error "bitset_word_t is narrower than 32 bits" +# elif 3 * BITSET_WORD_BITS < ASCII_CHARS + BITSET_WORD_MAX, BITSET_WORD_MAX, BITSET_WORD_MAX, +# elif 2 * BITSET_WORD_BITS < ASCII_CHARS + BITSET_WORD_MAX, BITSET_WORD_MAX, +# elif 1 * BITSET_WORD_BITS < ASCII_CHARS + BITSET_WORD_MAX, +# endif + (BITSET_WORD_MAX + >> (SBC_MAX % BITSET_WORD_BITS == 0 + ? 0 + : BITSET_WORD_BITS - SBC_MAX % BITSET_WORD_BITS)) +# endif +}; +#endif + + +static void +free_dfa_content (re_dfa_t *dfa) +{ + Idx i, j; + + if (dfa->nodes) + for (i = 0; i < dfa->nodes_len; ++i) + free_token (dfa->nodes + i); + re_free (dfa->nexts); + for (i = 0; i < dfa->nodes_len; ++i) + { + if (dfa->eclosures != NULL) + re_node_set_free (dfa->eclosures + i); + if (dfa->inveclosures != NULL) + re_node_set_free (dfa->inveclosures + i); + if (dfa->edests != NULL) + re_node_set_free (dfa->edests + i); + } + re_free (dfa->edests); + re_free (dfa->eclosures); + re_free (dfa->inveclosures); + re_free (dfa->nodes); + + if (dfa->state_table) + for (i = 0; i <= dfa->state_hash_mask; ++i) + { + struct re_state_table_entry *entry = dfa->state_table + i; + for (j = 0; j < entry->num; ++j) + { + re_dfastate_t *state = entry->array[j]; + free_state (state); + } + re_free (entry->array); + } + re_free (dfa->state_table); +#ifdef RE_ENABLE_I18N + if (dfa->sb_char != utf8_sb_map) + re_free (dfa->sb_char); +#endif + re_free (dfa->subexp_map); +#ifdef DEBUG + re_free (dfa->re_str); +#endif + + re_free (dfa); +} + + +/* Free dynamically allocated space used by PREG. */ + +void +regfree (regex_t *preg) +{ + re_dfa_t *dfa = preg->buffer; + if (BE (dfa != NULL, 1)) + { + lock_fini (dfa->lock); + free_dfa_content (dfa); + } + preg->buffer = NULL; + preg->allocated = 0; + + re_free (preg->fastmap); + preg->fastmap = NULL; + + re_free (preg->translate); + preg->translate = NULL; +} +#ifdef _LIBC +weak_alias (__regfree, regfree) +#endif + +/* Entry points compatible with 4.2 BSD regex library. We don't define + them unless specifically requested. */ + +#if defined _REGEX_RE_COMP || defined _LIBC + +/* BSD has one and only one pattern buffer. */ +static struct re_pattern_buffer re_comp_buf; + +char * +# ifdef _LIBC +/* Make these definitions weak in libc, so POSIX programs can redefine + these names if they don't use our functions, and still use + regcomp/regexec above without link errors. */ +weak_function +# endif +re_comp (const char *s) +{ + reg_errcode_t ret; + char *fastmap; + + if (!s) + { + if (!re_comp_buf.buffer) + return gettext ("No previous regular expression"); + return 0; + } + + if (re_comp_buf.buffer) + { + fastmap = re_comp_buf.fastmap; + re_comp_buf.fastmap = NULL; + __regfree (&re_comp_buf); + memset (&re_comp_buf, '\0', sizeof (re_comp_buf)); + re_comp_buf.fastmap = fastmap; + } + + if (re_comp_buf.fastmap == NULL) + { + re_comp_buf.fastmap = (char *) malloc (SBC_MAX); + if (re_comp_buf.fastmap == NULL) + return (char *) gettext (__re_error_msgid + + __re_error_msgid_idx[(int) REG_ESPACE]); + } + + /* Since 're_exec' always passes NULL for the 'regs' argument, we + don't need to initialize the pattern buffer fields which affect it. */ + + /* Match anchors at newlines. */ + re_comp_buf.newline_anchor = 1; + + ret = re_compile_internal (&re_comp_buf, s, strlen (s), re_syntax_options); + + if (!ret) + return NULL; + + /* Yes, we're discarding 'const' here if !HAVE_LIBINTL. */ + return (char *) gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]); +} + +#ifdef _LIBC +libc_freeres_fn (free_mem) +{ + __regfree (&re_comp_buf); +} +#endif + +#endif /* _REGEX_RE_COMP */ + +/* Internal entry point. + Compile the regular expression PATTERN, whose length is LENGTH. + SYNTAX indicate regular expression's syntax. */ + +static reg_errcode_t +re_compile_internal (regex_t *preg, const char * pattern, size_t length, + reg_syntax_t syntax) +{ + reg_errcode_t err = REG_NOERROR; + re_dfa_t *dfa; + re_string_t regexp; + + /* Initialize the pattern buffer. */ + preg->fastmap_accurate = 0; + preg->syntax = syntax; + preg->not_bol = preg->not_eol = 0; + preg->used = 0; + preg->re_nsub = 0; + preg->can_be_null = 0; + preg->regs_allocated = REGS_UNALLOCATED; + + /* Initialize the dfa. */ + dfa = preg->buffer; + if (BE (preg->allocated < sizeof (re_dfa_t), 0)) + { + /* If zero allocated, but buffer is non-null, try to realloc + enough space. This loses if buffer's address is bogus, but + that is the user's responsibility. If ->buffer is NULL this + is a simple allocation. */ + dfa = re_realloc (preg->buffer, re_dfa_t, 1); + if (dfa == NULL) + return REG_ESPACE; + preg->allocated = sizeof (re_dfa_t); + preg->buffer = dfa; + } + preg->used = sizeof (re_dfa_t); + + err = init_dfa (dfa, length); + if (BE (err == REG_NOERROR && lock_init (dfa->lock) != 0, 0)) + err = REG_ESPACE; + if (BE (err != REG_NOERROR, 0)) + { + free_dfa_content (dfa); + preg->buffer = NULL; + preg->allocated = 0; + return err; + } +#ifdef DEBUG + /* Note: length+1 will not overflow since it is checked in init_dfa. */ + dfa->re_str = re_malloc (char, length + 1); + strncpy (dfa->re_str, pattern, length + 1); +#endif + + err = re_string_construct (®exp, pattern, length, preg->translate, + (syntax & RE_ICASE) != 0, dfa); + if (BE (err != REG_NOERROR, 0)) + { + re_compile_internal_free_return: + free_workarea_compile (preg); + re_string_destruct (®exp); + lock_fini (dfa->lock); + free_dfa_content (dfa); + preg->buffer = NULL; + preg->allocated = 0; + return err; + } + + /* Parse the regular expression, and build a structure tree. */ + preg->re_nsub = 0; + dfa->str_tree = parse (®exp, preg, syntax, &err); + if (BE (dfa->str_tree == NULL, 0)) + goto re_compile_internal_free_return; + + /* Analyze the tree and create the nfa. */ + err = analyze (preg); + if (BE (err != REG_NOERROR, 0)) + goto re_compile_internal_free_return; + +#ifdef RE_ENABLE_I18N + /* If possible, do searching in single byte encoding to speed things up. */ + if (dfa->is_utf8 && !(syntax & RE_ICASE) && preg->translate == NULL) + optimize_utf8 (dfa); +#endif + + /* Then create the initial state of the dfa. */ + err = create_initial_state (dfa); + + /* Release work areas. */ + free_workarea_compile (preg); + re_string_destruct (®exp); + + if (BE (err != REG_NOERROR, 0)) + { + lock_fini (dfa->lock); + free_dfa_content (dfa); + preg->buffer = NULL; + preg->allocated = 0; + } + + return err; +} + +/* Initialize DFA. We use the length of the regular expression PAT_LEN + as the initial length of some arrays. */ + +static reg_errcode_t +init_dfa (re_dfa_t *dfa, size_t pat_len) +{ + __re_size_t table_size; +#ifndef _LIBC + const char *codeset_name; +#endif +#ifdef RE_ENABLE_I18N + size_t max_i18n_object_size = MAX (sizeof (wchar_t), sizeof (wctype_t)); +#else + size_t max_i18n_object_size = 0; +#endif + size_t max_object_size = + MAX (sizeof (struct re_state_table_entry), + MAX (sizeof (re_token_t), + MAX (sizeof (re_node_set), + MAX (sizeof (regmatch_t), + max_i18n_object_size)))); + + memset (dfa, '\0', sizeof (re_dfa_t)); + + /* Force allocation of str_tree_storage the first time. */ + dfa->str_tree_storage_idx = BIN_TREE_STORAGE_SIZE; + + /* Avoid overflows. The extra "/ 2" is for the table_size doubling + calculation below, and for similar doubling calculations + elsewhere. And it's <= rather than <, because some of the + doubling calculations add 1 afterwards. */ + if (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) / 2 <= pat_len, 0)) + return REG_ESPACE; + + dfa->nodes_alloc = pat_len + 1; + dfa->nodes = re_malloc (re_token_t, dfa->nodes_alloc); + + /* table_size = 2 ^ ceil(log pat_len) */ + for (table_size = 1; ; table_size <<= 1) + if (table_size > pat_len) + break; + + dfa->state_table = calloc (sizeof (struct re_state_table_entry), table_size); + dfa->state_hash_mask = table_size - 1; + + dfa->mb_cur_max = MB_CUR_MAX; +#ifdef _LIBC + if (dfa->mb_cur_max == 6 + && strcmp (_NL_CURRENT (LC_CTYPE, _NL_CTYPE_CODESET_NAME), "UTF-8") == 0) + dfa->is_utf8 = 1; + dfa->map_notascii = (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MAP_TO_NONASCII) + != 0); +#else + codeset_name = nl_langinfo (CODESET); + if ((codeset_name[0] == 'U' || codeset_name[0] == 'u') + && (codeset_name[1] == 'T' || codeset_name[1] == 't') + && (codeset_name[2] == 'F' || codeset_name[2] == 'f') + && strcmp (codeset_name + 3 + (codeset_name[3] == '-'), "8") == 0) + dfa->is_utf8 = 1; + + /* We check exhaustively in the loop below if this charset is a + superset of ASCII. */ + dfa->map_notascii = 0; +#endif + +#ifdef RE_ENABLE_I18N + if (dfa->mb_cur_max > 1) + { + if (dfa->is_utf8) + dfa->sb_char = (re_bitset_ptr_t) utf8_sb_map; + else + { + int i, j, ch; + + dfa->sb_char = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1); + if (BE (dfa->sb_char == NULL, 0)) + return REG_ESPACE; + + /* Set the bits corresponding to single byte chars. */ + for (i = 0, ch = 0; i < BITSET_WORDS; ++i) + for (j = 0; j < BITSET_WORD_BITS; ++j, ++ch) + { + wint_t wch = __btowc (ch); + if (wch != WEOF) + dfa->sb_char[i] |= (bitset_word_t) 1 << j; +# ifndef _LIBC + if (isascii (ch) && wch != ch) + dfa->map_notascii = 1; +# endif + } + } + } +#endif + + if (BE (dfa->nodes == NULL || dfa->state_table == NULL, 0)) + return REG_ESPACE; + return REG_NOERROR; +} + +/* Initialize WORD_CHAR table, which indicate which character is + "word". In this case "word" means that it is the word construction + character used by some operators like "\<", "\>", etc. */ + +static void +internal_function +init_word_char (re_dfa_t *dfa) +{ + int i = 0; + int j; + int ch = 0; + dfa->word_ops_used = 1; + if (BE (dfa->map_notascii == 0, 1)) + { + bitset_word_t bits0 = 0x00000000; + bitset_word_t bits1 = 0x03ff0000; + bitset_word_t bits2 = 0x87fffffe; + bitset_word_t bits3 = 0x07fffffe; + if (BITSET_WORD_BITS == 64) + { + dfa->word_char[0] = bits1 << 31 << 1 | bits0; + dfa->word_char[1] = bits3 << 31 << 1 | bits2; + i = 2; + } + else if (BITSET_WORD_BITS == 32) + { + dfa->word_char[0] = bits0; + dfa->word_char[1] = bits1; + dfa->word_char[2] = bits2; + dfa->word_char[3] = bits3; + i = 4; + } + else + goto general_case; + ch = 128; + + if (BE (dfa->is_utf8, 1)) + { + memset (&dfa->word_char[i], '\0', (SBC_MAX - ch) / 8); + return; + } + } + + general_case: + for (; i < BITSET_WORDS; ++i) + for (j = 0; j < BITSET_WORD_BITS; ++j, ++ch) + if (isalnum (ch) || ch == '_') + dfa->word_char[i] |= (bitset_word_t) 1 << j; +} + +/* Free the work area which are only used while compiling. */ + +static void +free_workarea_compile (regex_t *preg) +{ + re_dfa_t *dfa = preg->buffer; + bin_tree_storage_t *storage, *next; + for (storage = dfa->str_tree_storage; storage; storage = next) + { + next = storage->next; + re_free (storage); + } + dfa->str_tree_storage = NULL; + dfa->str_tree_storage_idx = BIN_TREE_STORAGE_SIZE; + dfa->str_tree = NULL; + re_free (dfa->org_indices); + dfa->org_indices = NULL; +} + +/* Create initial states for all contexts. */ + +static reg_errcode_t +create_initial_state (re_dfa_t *dfa) +{ + Idx first, i; + reg_errcode_t err; + re_node_set init_nodes; + + /* Initial states have the epsilon closure of the node which is + the first node of the regular expression. */ + first = dfa->str_tree->first->node_idx; + dfa->init_node = first; + err = re_node_set_init_copy (&init_nodes, dfa->eclosures + first); + if (BE (err != REG_NOERROR, 0)) + return err; + + /* The back-references which are in initial states can epsilon transit, + since in this case all of the subexpressions can be null. + Then we add epsilon closures of the nodes which are the next nodes of + the back-references. */ + if (dfa->nbackref > 0) + for (i = 0; i < init_nodes.nelem; ++i) + { + Idx node_idx = init_nodes.elems[i]; + re_token_type_t type = dfa->nodes[node_idx].type; + + Idx clexp_idx; + if (type != OP_BACK_REF) + continue; + for (clexp_idx = 0; clexp_idx < init_nodes.nelem; ++clexp_idx) + { + re_token_t *clexp_node; + clexp_node = dfa->nodes + init_nodes.elems[clexp_idx]; + if (clexp_node->type == OP_CLOSE_SUBEXP + && clexp_node->opr.idx == dfa->nodes[node_idx].opr.idx) + break; + } + if (clexp_idx == init_nodes.nelem) + continue; + + if (type == OP_BACK_REF) + { + Idx dest_idx = dfa->edests[node_idx].elems[0]; + if (!re_node_set_contains (&init_nodes, dest_idx)) + { + reg_errcode_t merge_err + = re_node_set_merge (&init_nodes, dfa->eclosures + dest_idx); + if (merge_err != REG_NOERROR) + return merge_err; + i = 0; + } + } + } + + /* It must be the first time to invoke acquire_state. */ + dfa->init_state = re_acquire_state_context (&err, dfa, &init_nodes, 0); + /* We don't check ERR here, since the initial state must not be NULL. */ + if (BE (dfa->init_state == NULL, 0)) + return err; + if (dfa->init_state->has_constraint) + { + dfa->init_state_word = re_acquire_state_context (&err, dfa, &init_nodes, + CONTEXT_WORD); + dfa->init_state_nl = re_acquire_state_context (&err, dfa, &init_nodes, + CONTEXT_NEWLINE); + dfa->init_state_begbuf = re_acquire_state_context (&err, dfa, + &init_nodes, + CONTEXT_NEWLINE + | CONTEXT_BEGBUF); + if (BE (dfa->init_state_word == NULL || dfa->init_state_nl == NULL + || dfa->init_state_begbuf == NULL, 0)) + return err; + } + else + dfa->init_state_word = dfa->init_state_nl + = dfa->init_state_begbuf = dfa->init_state; + + re_node_set_free (&init_nodes); + return REG_NOERROR; +} + +#ifdef RE_ENABLE_I18N +/* If it is possible to do searching in single byte encoding instead of UTF-8 + to speed things up, set dfa->mb_cur_max to 1, clear is_utf8 and change + DFA nodes where needed. */ + +static void +optimize_utf8 (re_dfa_t *dfa) +{ + Idx node; + int i; + bool mb_chars = false; + bool has_period = false; + + for (node = 0; node < dfa->nodes_len; ++node) + switch (dfa->nodes[node].type) + { + case CHARACTER: + if (dfa->nodes[node].opr.c >= ASCII_CHARS) + mb_chars = true; + break; + case ANCHOR: + switch (dfa->nodes[node].opr.ctx_type) + { + case LINE_FIRST: + case LINE_LAST: + case BUF_FIRST: + case BUF_LAST: + break; + default: + /* Word anchors etc. cannot be handled. It's okay to test + opr.ctx_type since constraints (for all DFA nodes) are + created by ORing one or more opr.ctx_type values. */ + return; + } + break; + case OP_PERIOD: + has_period = true; + break; + case OP_BACK_REF: + case OP_ALT: + case END_OF_RE: + case OP_DUP_ASTERISK: + case OP_OPEN_SUBEXP: + case OP_CLOSE_SUBEXP: + break; + case COMPLEX_BRACKET: + return; + case SIMPLE_BRACKET: + /* Just double check. */ + { + int rshift = (ASCII_CHARS % BITSET_WORD_BITS == 0 + ? 0 + : BITSET_WORD_BITS - ASCII_CHARS % BITSET_WORD_BITS); + for (i = ASCII_CHARS / BITSET_WORD_BITS; i < BITSET_WORDS; ++i) + { + if (dfa->nodes[node].opr.sbcset[i] >> rshift != 0) + return; + rshift = 0; + } + } + break; + default: + abort (); + } + + if (mb_chars || has_period) + for (node = 0; node < dfa->nodes_len; ++node) + { + if (dfa->nodes[node].type == CHARACTER + && dfa->nodes[node].opr.c >= ASCII_CHARS) + dfa->nodes[node].mb_partial = 0; + else if (dfa->nodes[node].type == OP_PERIOD) + dfa->nodes[node].type = OP_UTF8_PERIOD; + } + + /* The search can be in single byte locale. */ + dfa->mb_cur_max = 1; + dfa->is_utf8 = 0; + dfa->has_mb_node = dfa->nbackref > 0 || has_period; +} +#endif + +/* Analyze the structure tree, and calculate "first", "next", "edest", + "eclosure", and "inveclosure". */ + +static reg_errcode_t +analyze (regex_t *preg) +{ + re_dfa_t *dfa = preg->buffer; + reg_errcode_t ret; + + /* Allocate arrays. */ + dfa->nexts = re_malloc (Idx, dfa->nodes_alloc); + dfa->org_indices = re_malloc (Idx, dfa->nodes_alloc); + dfa->edests = re_malloc (re_node_set, dfa->nodes_alloc); + dfa->eclosures = re_malloc (re_node_set, dfa->nodes_alloc); + if (BE (dfa->nexts == NULL || dfa->org_indices == NULL || dfa->edests == NULL + || dfa->eclosures == NULL, 0)) + return REG_ESPACE; + + dfa->subexp_map = re_malloc (Idx, preg->re_nsub); + if (dfa->subexp_map != NULL) + { + Idx i; + for (i = 0; i < preg->re_nsub; i++) + dfa->subexp_map[i] = i; + preorder (dfa->str_tree, optimize_subexps, dfa); + for (i = 0; i < preg->re_nsub; i++) + if (dfa->subexp_map[i] != i) + break; + if (i == preg->re_nsub) + { + free (dfa->subexp_map); + dfa->subexp_map = NULL; + } + } + + ret = postorder (dfa->str_tree, lower_subexps, preg); + if (BE (ret != REG_NOERROR, 0)) + return ret; + ret = postorder (dfa->str_tree, calc_first, dfa); + if (BE (ret != REG_NOERROR, 0)) + return ret; + preorder (dfa->str_tree, calc_next, dfa); + ret = preorder (dfa->str_tree, link_nfa_nodes, dfa); + if (BE (ret != REG_NOERROR, 0)) + return ret; + ret = calc_eclosure (dfa); + if (BE (ret != REG_NOERROR, 0)) + return ret; + + /* We only need this during the prune_impossible_nodes pass in regexec.c; + skip it if p_i_n will not run, as calc_inveclosure can be quadratic. */ + if ((!preg->no_sub && preg->re_nsub > 0 && dfa->has_plural_match) + || dfa->nbackref) + { + dfa->inveclosures = re_malloc (re_node_set, dfa->nodes_len); + if (BE (dfa->inveclosures == NULL, 0)) + return REG_ESPACE; + ret = calc_inveclosure (dfa); + } + + return ret; +} + +/* Our parse trees are very unbalanced, so we cannot use a stack to + implement parse tree visits. Instead, we use parent pointers and + some hairy code in these two functions. */ +static reg_errcode_t +postorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)), + void *extra) +{ + bin_tree_t *node, *prev; + + for (node = root; ; ) + { + /* Descend down the tree, preferably to the left (or to the right + if that's the only child). */ + while (node->left || node->right) + if (node->left) + node = node->left; + else + node = node->right; + + do + { + reg_errcode_t err = fn (extra, node); + if (BE (err != REG_NOERROR, 0)) + return err; + if (node->parent == NULL) + return REG_NOERROR; + prev = node; + node = node->parent; + } + /* Go up while we have a node that is reached from the right. */ + while (node->right == prev || node->right == NULL); + node = node->right; + } +} + +static reg_errcode_t +preorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)), + void *extra) +{ + bin_tree_t *node; + + for (node = root; ; ) + { + reg_errcode_t err = fn (extra, node); + if (BE (err != REG_NOERROR, 0)) + return err; + + /* Go to the left node, or up and to the right. */ + if (node->left) + node = node->left; + else + { + bin_tree_t *prev = NULL; + while (node->right == prev || node->right == NULL) + { + prev = node; + node = node->parent; + if (!node) + return REG_NOERROR; + } + node = node->right; + } + } +} + +/* Optimization pass: if a SUBEXP is entirely contained, strip it and tell + re_search_internal to map the inner one's opr.idx to this one's. Adjust + backreferences as well. Requires a preorder visit. */ +static reg_errcode_t +optimize_subexps (void *extra, bin_tree_t *node) +{ + re_dfa_t *dfa = (re_dfa_t *) extra; + + if (node->token.type == OP_BACK_REF && dfa->subexp_map) + { + int idx = node->token.opr.idx; + node->token.opr.idx = dfa->subexp_map[idx]; + dfa->used_bkref_map |= 1 << node->token.opr.idx; + } + + else if (node->token.type == SUBEXP + && node->left && node->left->token.type == SUBEXP) + { + Idx other_idx = node->left->token.opr.idx; + + node->left = node->left->left; + if (node->left) + node->left->parent = node; + + dfa->subexp_map[other_idx] = dfa->subexp_map[node->token.opr.idx]; + if (other_idx < BITSET_WORD_BITS) + dfa->used_bkref_map &= ~((bitset_word_t) 1 << other_idx); + } + + return REG_NOERROR; +} + +/* Lowering pass: Turn each SUBEXP node into the appropriate concatenation + of OP_OPEN_SUBEXP, the body of the SUBEXP (if any) and OP_CLOSE_SUBEXP. */ +static reg_errcode_t +lower_subexps (void *extra, bin_tree_t *node) +{ + regex_t *preg = (regex_t *) extra; + reg_errcode_t err = REG_NOERROR; + + if (node->left && node->left->token.type == SUBEXP) + { + node->left = lower_subexp (&err, preg, node->left); + if (node->left) + node->left->parent = node; + } + if (node->right && node->right->token.type == SUBEXP) + { + node->right = lower_subexp (&err, preg, node->right); + if (node->right) + node->right->parent = node; + } + + return err; +} + +static bin_tree_t * +lower_subexp (reg_errcode_t *err, regex_t *preg, bin_tree_t *node) +{ + re_dfa_t *dfa = preg->buffer; + bin_tree_t *body = node->left; + bin_tree_t *op, *cls, *tree1, *tree; + + if (preg->no_sub + /* We do not optimize empty subexpressions, because otherwise we may + have bad CONCAT nodes with NULL children. This is obviously not + very common, so we do not lose much. An example that triggers + this case is the sed "script" /\(\)/x. */ + && node->left != NULL + && (node->token.opr.idx >= BITSET_WORD_BITS + || !(dfa->used_bkref_map + & ((bitset_word_t) 1 << node->token.opr.idx)))) + return node->left; + + /* Convert the SUBEXP node to the concatenation of an + OP_OPEN_SUBEXP, the contents, and an OP_CLOSE_SUBEXP. */ + op = create_tree (dfa, NULL, NULL, OP_OPEN_SUBEXP); + cls = create_tree (dfa, NULL, NULL, OP_CLOSE_SUBEXP); + tree1 = body ? create_tree (dfa, body, cls, CONCAT) : cls; + tree = create_tree (dfa, op, tree1, CONCAT); + if (BE (tree == NULL || tree1 == NULL || op == NULL || cls == NULL, 0)) + { + *err = REG_ESPACE; + return NULL; + } + + op->token.opr.idx = cls->token.opr.idx = node->token.opr.idx; + op->token.opt_subexp = cls->token.opt_subexp = node->token.opt_subexp; + return tree; +} + +/* Pass 1 in building the NFA: compute FIRST and create unlinked automaton + nodes. Requires a postorder visit. */ +static reg_errcode_t +calc_first (void *extra, bin_tree_t *node) +{ + re_dfa_t *dfa = (re_dfa_t *) extra; + if (node->token.type == CONCAT) + { + node->first = node->left->first; + node->node_idx = node->left->node_idx; + } + else + { + node->first = node; + node->node_idx = re_dfa_add_node (dfa, node->token); + if (BE (node->node_idx == -1, 0)) + return REG_ESPACE; + if (node->token.type == ANCHOR) + dfa->nodes[node->node_idx].constraint = node->token.opr.ctx_type; + } + return REG_NOERROR; +} + +/* Pass 2: compute NEXT on the tree. Preorder visit. */ +static reg_errcode_t +calc_next (void *extra, bin_tree_t *node) +{ + switch (node->token.type) + { + case OP_DUP_ASTERISK: + node->left->next = node; + break; + case CONCAT: + node->left->next = node->right->first; + node->right->next = node->next; + break; + default: + if (node->left) + node->left->next = node->next; + if (node->right) + node->right->next = node->next; + break; + } + return REG_NOERROR; +} + +/* Pass 3: link all DFA nodes to their NEXT node (any order will do). */ +static reg_errcode_t +link_nfa_nodes (void *extra, bin_tree_t *node) +{ + re_dfa_t *dfa = (re_dfa_t *) extra; + Idx idx = node->node_idx; + reg_errcode_t err = REG_NOERROR; + + switch (node->token.type) + { + case CONCAT: + break; + + case END_OF_RE: + assert (node->next == NULL); + break; + + case OP_DUP_ASTERISK: + case OP_ALT: + { + Idx left, right; + dfa->has_plural_match = 1; + if (node->left != NULL) + left = node->left->first->node_idx; + else + left = node->next->node_idx; + if (node->right != NULL) + right = node->right->first->node_idx; + else + right = node->next->node_idx; + assert (left > -1); + assert (right > -1); + err = re_node_set_init_2 (dfa->edests + idx, left, right); + } + break; + + case ANCHOR: + case OP_OPEN_SUBEXP: + case OP_CLOSE_SUBEXP: + err = re_node_set_init_1 (dfa->edests + idx, node->next->node_idx); + break; + + case OP_BACK_REF: + dfa->nexts[idx] = node->next->node_idx; + if (node->token.type == OP_BACK_REF) + err = re_node_set_init_1 (dfa->edests + idx, dfa->nexts[idx]); + break; + + default: + assert (!IS_EPSILON_NODE (node->token.type)); + dfa->nexts[idx] = node->next->node_idx; + break; + } + + return err; +} + +/* Duplicate the epsilon closure of the node ROOT_NODE. + Note that duplicated nodes have constraint INIT_CONSTRAINT in addition + to their own constraint. */ + +static reg_errcode_t +internal_function +duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node, + Idx root_node, unsigned int init_constraint) +{ + Idx org_node, clone_node; + bool ok; + unsigned int constraint = init_constraint; + for (org_node = top_org_node, clone_node = top_clone_node;;) + { + Idx org_dest, clone_dest; + if (dfa->nodes[org_node].type == OP_BACK_REF) + { + /* If the back reference epsilon-transit, its destination must + also have the constraint. Then duplicate the epsilon closure + of the destination of the back reference, and store it in + edests of the back reference. */ + org_dest = dfa->nexts[org_node]; + re_node_set_empty (dfa->edests + clone_node); + clone_dest = duplicate_node (dfa, org_dest, constraint); + if (BE (clone_dest == -1, 0)) + return REG_ESPACE; + dfa->nexts[clone_node] = dfa->nexts[org_node]; + ok = re_node_set_insert (dfa->edests + clone_node, clone_dest); + if (BE (! ok, 0)) + return REG_ESPACE; + } + else if (dfa->edests[org_node].nelem == 0) + { + /* In case of the node can't epsilon-transit, don't duplicate the + destination and store the original destination as the + destination of the node. */ + dfa->nexts[clone_node] = dfa->nexts[org_node]; + break; + } + else if (dfa->edests[org_node].nelem == 1) + { + /* In case of the node can epsilon-transit, and it has only one + destination. */ + org_dest = dfa->edests[org_node].elems[0]; + re_node_set_empty (dfa->edests + clone_node); + /* If the node is root_node itself, it means the epsilon closure + has a loop. Then tie it to the destination of the root_node. */ + if (org_node == root_node && clone_node != org_node) + { + ok = re_node_set_insert (dfa->edests + clone_node, org_dest); + if (BE (! ok, 0)) + return REG_ESPACE; + break; + } + /* In case the node has another constraint, append it. */ + constraint |= dfa->nodes[org_node].constraint; + clone_dest = duplicate_node (dfa, org_dest, constraint); + if (BE (clone_dest == -1, 0)) + return REG_ESPACE; + ok = re_node_set_insert (dfa->edests + clone_node, clone_dest); + if (BE (! ok, 0)) + return REG_ESPACE; + } + else /* dfa->edests[org_node].nelem == 2 */ + { + /* In case of the node can epsilon-transit, and it has two + destinations. In the bin_tree_t and DFA, that's '|' and '*'. */ + org_dest = dfa->edests[org_node].elems[0]; + re_node_set_empty (dfa->edests + clone_node); + /* Search for a duplicated node which satisfies the constraint. */ + clone_dest = search_duplicated_node (dfa, org_dest, constraint); + if (clone_dest == -1) + { + /* There is no such duplicated node, create a new one. */ + reg_errcode_t err; + clone_dest = duplicate_node (dfa, org_dest, constraint); + if (BE (clone_dest == -1, 0)) + return REG_ESPACE; + ok = re_node_set_insert (dfa->edests + clone_node, clone_dest); + if (BE (! ok, 0)) + return REG_ESPACE; + err = duplicate_node_closure (dfa, org_dest, clone_dest, + root_node, constraint); + if (BE (err != REG_NOERROR, 0)) + return err; + } + else + { + /* There is a duplicated node which satisfies the constraint, + use it to avoid infinite loop. */ + ok = re_node_set_insert (dfa->edests + clone_node, clone_dest); + if (BE (! ok, 0)) + return REG_ESPACE; + } + + org_dest = dfa->edests[org_node].elems[1]; + clone_dest = duplicate_node (dfa, org_dest, constraint); + if (BE (clone_dest == -1, 0)) + return REG_ESPACE; + ok = re_node_set_insert (dfa->edests + clone_node, clone_dest); + if (BE (! ok, 0)) + return REG_ESPACE; + } + org_node = org_dest; + clone_node = clone_dest; + } + return REG_NOERROR; +} + +/* Search for a node which is duplicated from the node ORG_NODE, and + satisfies the constraint CONSTRAINT. */ + +static Idx +search_duplicated_node (const re_dfa_t *dfa, Idx org_node, + unsigned int constraint) +{ + Idx idx; + for (idx = dfa->nodes_len - 1; dfa->nodes[idx].duplicated && idx > 0; --idx) + { + if (org_node == dfa->org_indices[idx] + && constraint == dfa->nodes[idx].constraint) + return idx; /* Found. */ + } + return -1; /* Not found. */ +} + +/* Duplicate the node whose index is ORG_IDX and set the constraint CONSTRAINT. + Return the index of the new node, or -1 if insufficient storage is + available. */ + +static Idx +duplicate_node (re_dfa_t *dfa, Idx org_idx, unsigned int constraint) +{ + Idx dup_idx = re_dfa_add_node (dfa, dfa->nodes[org_idx]); + if (BE (dup_idx != -1, 1)) + { + dfa->nodes[dup_idx].constraint = constraint; + dfa->nodes[dup_idx].constraint |= dfa->nodes[org_idx].constraint; + dfa->nodes[dup_idx].duplicated = 1; + + /* Store the index of the original node. */ + dfa->org_indices[dup_idx] = org_idx; + } + return dup_idx; +} + +static reg_errcode_t +calc_inveclosure (re_dfa_t *dfa) +{ + Idx src, idx; + bool ok; + for (idx = 0; idx < dfa->nodes_len; ++idx) + re_node_set_init_empty (dfa->inveclosures + idx); + + for (src = 0; src < dfa->nodes_len; ++src) + { + Idx *elems = dfa->eclosures[src].elems; + for (idx = 0; idx < dfa->eclosures[src].nelem; ++idx) + { + ok = re_node_set_insert_last (dfa->inveclosures + elems[idx], src); + if (BE (! ok, 0)) + return REG_ESPACE; + } + } + + return REG_NOERROR; +} + +/* Calculate "eclosure" for all the node in DFA. */ + +static reg_errcode_t +calc_eclosure (re_dfa_t *dfa) +{ + Idx node_idx; + bool incomplete; +#ifdef DEBUG + assert (dfa->nodes_len > 0); +#endif + incomplete = false; + /* For each nodes, calculate epsilon closure. */ + for (node_idx = 0; ; ++node_idx) + { + reg_errcode_t err; + re_node_set eclosure_elem; + if (node_idx == dfa->nodes_len) + { + if (!incomplete) + break; + incomplete = false; + node_idx = 0; + } + +#ifdef DEBUG + assert (dfa->eclosures[node_idx].nelem != -1); +#endif + + /* If we have already calculated, skip it. */ + if (dfa->eclosures[node_idx].nelem != 0) + continue; + /* Calculate epsilon closure of 'node_idx'. */ + err = calc_eclosure_iter (&eclosure_elem, dfa, node_idx, true); + if (BE (err != REG_NOERROR, 0)) + return err; + + if (dfa->eclosures[node_idx].nelem == 0) + { + incomplete = true; + re_node_set_free (&eclosure_elem); + } + } + return REG_NOERROR; +} + +/* Calculate epsilon closure of NODE. */ + +static reg_errcode_t +calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root) +{ + reg_errcode_t err; + Idx i; + re_node_set eclosure; + bool ok; + bool incomplete = false; + err = re_node_set_alloc (&eclosure, dfa->edests[node].nelem + 1); + if (BE (err != REG_NOERROR, 0)) + return err; + + /* This indicates that we are calculating this node now. + We reference this value to avoid infinite loop. */ + dfa->eclosures[node].nelem = -1; + + /* If the current node has constraints, duplicate all nodes + since they must inherit the constraints. */ + if (dfa->nodes[node].constraint + && dfa->edests[node].nelem + && !dfa->nodes[dfa->edests[node].elems[0]].duplicated) + { + err = duplicate_node_closure (dfa, node, node, node, + dfa->nodes[node].constraint); + if (BE (err != REG_NOERROR, 0)) + return err; + } + + /* Expand each epsilon destination nodes. */ + if (IS_EPSILON_NODE(dfa->nodes[node].type)) + for (i = 0; i < dfa->edests[node].nelem; ++i) + { + re_node_set eclosure_elem; + Idx edest = dfa->edests[node].elems[i]; + /* If calculating the epsilon closure of 'edest' is in progress, + return intermediate result. */ + if (dfa->eclosures[edest].nelem == -1) + { + incomplete = true; + continue; + } + /* If we haven't calculated the epsilon closure of 'edest' yet, + calculate now. Otherwise use calculated epsilon closure. */ + if (dfa->eclosures[edest].nelem == 0) + { + err = calc_eclosure_iter (&eclosure_elem, dfa, edest, false); + if (BE (err != REG_NOERROR, 0)) + return err; + } + else + eclosure_elem = dfa->eclosures[edest]; + /* Merge the epsilon closure of 'edest'. */ + err = re_node_set_merge (&eclosure, &eclosure_elem); + if (BE (err != REG_NOERROR, 0)) + return err; + /* If the epsilon closure of 'edest' is incomplete, + the epsilon closure of this node is also incomplete. */ + if (dfa->eclosures[edest].nelem == 0) + { + incomplete = true; + re_node_set_free (&eclosure_elem); + } + } + + /* An epsilon closure includes itself. */ + ok = re_node_set_insert (&eclosure, node); + if (BE (! ok, 0)) + return REG_ESPACE; + if (incomplete && !root) + dfa->eclosures[node].nelem = 0; + else + dfa->eclosures[node] = eclosure; + *new_set = eclosure; + return REG_NOERROR; +} + +/* Functions for token which are used in the parser. */ + +/* Fetch a token from INPUT. + We must not use this function inside bracket expressions. */ + +static void +internal_function +fetch_token (re_token_t *result, re_string_t *input, reg_syntax_t syntax) +{ + re_string_skip_bytes (input, peek_token (result, input, syntax)); +} + +/* Peek a token from INPUT, and return the length of the token. + We must not use this function inside bracket expressions. */ + +static int +internal_function +peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax) +{ + unsigned char c; + + if (re_string_eoi (input)) + { + token->type = END_OF_RE; + return 0; + } + + c = re_string_peek_byte (input, 0); + token->opr.c = c; + + token->word_char = 0; +#ifdef RE_ENABLE_I18N + token->mb_partial = 0; + if (input->mb_cur_max > 1 && + !re_string_first_byte (input, re_string_cur_idx (input))) + { + token->type = CHARACTER; + token->mb_partial = 1; + return 1; + } +#endif + if (c == '\\') + { + unsigned char c2; + if (re_string_cur_idx (input) + 1 >= re_string_length (input)) + { + token->type = BACK_SLASH; + return 1; + } + + c2 = re_string_peek_byte_case (input, 1); + token->opr.c = c2; + token->type = CHARACTER; +#ifdef RE_ENABLE_I18N + if (input->mb_cur_max > 1) + { + wint_t wc = re_string_wchar_at (input, + re_string_cur_idx (input) + 1); + token->word_char = IS_WIDE_WORD_CHAR (wc) != 0; + } + else +#endif + token->word_char = IS_WORD_CHAR (c2) != 0; + + switch (c2) + { + case '|': + if (!(syntax & RE_LIMITED_OPS) && !(syntax & RE_NO_BK_VBAR)) + token->type = OP_ALT; + break; + case '1': case '2': case '3': case '4': case '5': + case '6': case '7': case '8': case '9': + if (!(syntax & RE_NO_BK_REFS)) + { + token->type = OP_BACK_REF; + token->opr.idx = c2 - '1'; + } + break; + case '<': + if (!(syntax & RE_NO_GNU_OPS)) + { + token->type = ANCHOR; + token->opr.ctx_type = WORD_FIRST; + } + break; + case '>': + if (!(syntax & RE_NO_GNU_OPS)) + { + token->type = ANCHOR; + token->opr.ctx_type = WORD_LAST; + } + break; + case 'b': + if (!(syntax & RE_NO_GNU_OPS)) + { + token->type = ANCHOR; + token->opr.ctx_type = WORD_DELIM; + } + break; + case 'B': + if (!(syntax & RE_NO_GNU_OPS)) + { + token->type = ANCHOR; + token->opr.ctx_type = NOT_WORD_DELIM; + } + break; + case 'w': + if (!(syntax & RE_NO_GNU_OPS)) + token->type = OP_WORD; + break; + case 'W': + if (!(syntax & RE_NO_GNU_OPS)) + token->type = OP_NOTWORD; + break; + case 's': + if (!(syntax & RE_NO_GNU_OPS)) + token->type = OP_SPACE; + break; + case 'S': + if (!(syntax & RE_NO_GNU_OPS)) + token->type = OP_NOTSPACE; + break; + case '`': + if (!(syntax & RE_NO_GNU_OPS)) + { + token->type = ANCHOR; + token->opr.ctx_type = BUF_FIRST; + } + break; + case '\'': + if (!(syntax & RE_NO_GNU_OPS)) + { + token->type = ANCHOR; + token->opr.ctx_type = BUF_LAST; + } + break; + case '(': + if (!(syntax & RE_NO_BK_PARENS)) + token->type = OP_OPEN_SUBEXP; + break; + case ')': + if (!(syntax & RE_NO_BK_PARENS)) + token->type = OP_CLOSE_SUBEXP; + break; + case '+': + if (!(syntax & RE_LIMITED_OPS) && (syntax & RE_BK_PLUS_QM)) + token->type = OP_DUP_PLUS; + break; + case '?': + if (!(syntax & RE_LIMITED_OPS) && (syntax & RE_BK_PLUS_QM)) + token->type = OP_DUP_QUESTION; + break; + case '{': + if ((syntax & RE_INTERVALS) && (!(syntax & RE_NO_BK_BRACES))) + token->type = OP_OPEN_DUP_NUM; + break; + case '}': + if ((syntax & RE_INTERVALS) && (!(syntax & RE_NO_BK_BRACES))) + token->type = OP_CLOSE_DUP_NUM; + break; + default: + break; + } + return 2; + } + + token->type = CHARACTER; +#ifdef RE_ENABLE_I18N + if (input->mb_cur_max > 1) + { + wint_t wc = re_string_wchar_at (input, re_string_cur_idx (input)); + token->word_char = IS_WIDE_WORD_CHAR (wc) != 0; + } + else +#endif + token->word_char = IS_WORD_CHAR (token->opr.c); + + switch (c) + { + case '\n': + if (syntax & RE_NEWLINE_ALT) + token->type = OP_ALT; + break; + case '|': + if (!(syntax & RE_LIMITED_OPS) && (syntax & RE_NO_BK_VBAR)) + token->type = OP_ALT; + break; + case '*': + token->type = OP_DUP_ASTERISK; + break; + case '+': + if (!(syntax & RE_LIMITED_OPS) && !(syntax & RE_BK_PLUS_QM)) + token->type = OP_DUP_PLUS; + break; + case '?': + if (!(syntax & RE_LIMITED_OPS) && !(syntax & RE_BK_PLUS_QM)) + token->type = OP_DUP_QUESTION; + break; + case '{': + if ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES)) + token->type = OP_OPEN_DUP_NUM; + break; + case '}': + if ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES)) + token->type = OP_CLOSE_DUP_NUM; + break; + case '(': + if (syntax & RE_NO_BK_PARENS) + token->type = OP_OPEN_SUBEXP; + break; + case ')': + if (syntax & RE_NO_BK_PARENS) + token->type = OP_CLOSE_SUBEXP; + break; + case '[': + token->type = OP_OPEN_BRACKET; + break; + case '.': + token->type = OP_PERIOD; + break; + case '^': + if (!(syntax & (RE_CONTEXT_INDEP_ANCHORS | RE_CARET_ANCHORS_HERE)) && + re_string_cur_idx (input) != 0) + { + char prev = re_string_peek_byte (input, -1); + if (!(syntax & RE_NEWLINE_ALT) || prev != '\n') + break; + } + token->type = ANCHOR; + token->opr.ctx_type = LINE_FIRST; + break; + case '$': + if (!(syntax & RE_CONTEXT_INDEP_ANCHORS) && + re_string_cur_idx (input) + 1 != re_string_length (input)) + { + re_token_t next; + re_string_skip_bytes (input, 1); + peek_token (&next, input, syntax); + re_string_skip_bytes (input, -1); + if (next.type != OP_ALT && next.type != OP_CLOSE_SUBEXP) + break; + } + token->type = ANCHOR; + token->opr.ctx_type = LINE_LAST; + break; + default: + break; + } + return 1; +} + +/* Peek a token from INPUT, and return the length of the token. + We must not use this function out of bracket expressions. */ + +static int +internal_function +peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax) +{ + unsigned char c; + if (re_string_eoi (input)) + { + token->type = END_OF_RE; + return 0; + } + c = re_string_peek_byte (input, 0); + token->opr.c = c; + +#ifdef RE_ENABLE_I18N + if (input->mb_cur_max > 1 && + !re_string_first_byte (input, re_string_cur_idx (input))) + { + token->type = CHARACTER; + return 1; + } +#endif /* RE_ENABLE_I18N */ + + if (c == '\\' && (syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) + && re_string_cur_idx (input) + 1 < re_string_length (input)) + { + /* In this case, '\' escape a character. */ + unsigned char c2; + re_string_skip_bytes (input, 1); + c2 = re_string_peek_byte (input, 0); + token->opr.c = c2; + token->type = CHARACTER; + return 1; + } + if (c == '[') /* '[' is a special char in a bracket exps. */ + { + unsigned char c2; + int token_len; + if (re_string_cur_idx (input) + 1 < re_string_length (input)) + c2 = re_string_peek_byte (input, 1); + else + c2 = 0; + token->opr.c = c2; + token_len = 2; + switch (c2) + { + case '.': + token->type = OP_OPEN_COLL_ELEM; + break; + case '=': + token->type = OP_OPEN_EQUIV_CLASS; + break; + case ':': + if (syntax & RE_CHAR_CLASSES) + { + token->type = OP_OPEN_CHAR_CLASS; + break; + } + /* else fall through. */ + default: + token->type = CHARACTER; + token->opr.c = c; + token_len = 1; + break; + } + return token_len; + } + switch (c) + { + case '-': + token->type = OP_CHARSET_RANGE; + break; + case ']': + token->type = OP_CLOSE_BRACKET; + break; + case '^': + token->type = OP_NON_MATCH_LIST; + break; + default: + token->type = CHARACTER; + } + return 1; +} + +/* Functions for parser. */ + +/* Entry point of the parser. + Parse the regular expression REGEXP and return the structure tree. + If an error occurs, ERR is set by error code, and return NULL. + This function build the following tree, from regular expression <reg_exp>: + CAT + / \ + / \ + <reg_exp> EOR + + CAT means concatenation. + EOR means end of regular expression. */ + +static bin_tree_t * +parse (re_string_t *regexp, regex_t *preg, reg_syntax_t syntax, + reg_errcode_t *err) +{ + re_dfa_t *dfa = preg->buffer; + bin_tree_t *tree, *eor, *root; + re_token_t current_token; + dfa->syntax = syntax; + fetch_token (¤t_token, regexp, syntax | RE_CARET_ANCHORS_HERE); + tree = parse_reg_exp (regexp, preg, ¤t_token, syntax, 0, err); + if (BE (*err != REG_NOERROR && tree == NULL, 0)) + return NULL; + eor = create_tree (dfa, NULL, NULL, END_OF_RE); + if (tree != NULL) + root = create_tree (dfa, tree, eor, CONCAT); + else + root = eor; + if (BE (eor == NULL || root == NULL, 0)) + { + *err = REG_ESPACE; + return NULL; + } + return root; +} + +/* This function build the following tree, from regular expression + <branch1>|<branch2>: + ALT + / \ + / \ + <branch1> <branch2> + + ALT means alternative, which represents the operator '|'. */ + +static bin_tree_t * +parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, + reg_syntax_t syntax, Idx nest, reg_errcode_t *err) +{ + re_dfa_t *dfa = preg->buffer; + bin_tree_t *tree, *branch = NULL; + bitset_word_t initial_bkref_map = dfa->completed_bkref_map; + tree = parse_branch (regexp, preg, token, syntax, nest, err); + if (BE (*err != REG_NOERROR && tree == NULL, 0)) + return NULL; + + while (token->type == OP_ALT) + { + fetch_token (token, regexp, syntax | RE_CARET_ANCHORS_HERE); + if (token->type != OP_ALT && token->type != END_OF_RE + && (nest == 0 || token->type != OP_CLOSE_SUBEXP)) + { + bitset_word_t accumulated_bkref_map = dfa->completed_bkref_map; + dfa->completed_bkref_map = initial_bkref_map; + branch = parse_branch (regexp, preg, token, syntax, nest, err); + if (BE (*err != REG_NOERROR && branch == NULL, 0)) + { + if (tree != NULL) + postorder (tree, free_tree, NULL); + return NULL; + } + dfa->completed_bkref_map |= accumulated_bkref_map; + } + else + branch = NULL; + tree = create_tree (dfa, tree, branch, OP_ALT); + if (BE (tree == NULL, 0)) + { + *err = REG_ESPACE; + return NULL; + } + } + return tree; +} + +/* This function build the following tree, from regular expression + <exp1><exp2>: + CAT + / \ + / \ + <exp1> <exp2> + + CAT means concatenation. */ + +static bin_tree_t * +parse_branch (re_string_t *regexp, regex_t *preg, re_token_t *token, + reg_syntax_t syntax, Idx nest, reg_errcode_t *err) +{ + bin_tree_t *tree, *expr; + re_dfa_t *dfa = preg->buffer; + tree = parse_expression (regexp, preg, token, syntax, nest, err); + if (BE (*err != REG_NOERROR && tree == NULL, 0)) + return NULL; + + while (token->type != OP_ALT && token->type != END_OF_RE + && (nest == 0 || token->type != OP_CLOSE_SUBEXP)) + { + expr = parse_expression (regexp, preg, token, syntax, nest, err); + if (BE (*err != REG_NOERROR && expr == NULL, 0)) + { + if (tree != NULL) + postorder (tree, free_tree, NULL); + return NULL; + } + if (tree != NULL && expr != NULL) + { + bin_tree_t *newtree = create_tree (dfa, tree, expr, CONCAT); + if (newtree == NULL) + { + postorder (expr, free_tree, NULL); + postorder (tree, free_tree, NULL); + *err = REG_ESPACE; + return NULL; + } + tree = newtree; + } + else if (tree == NULL) + tree = expr; + /* Otherwise expr == NULL, we don't need to create new tree. */ + } + return tree; +} + +/* This function build the following tree, from regular expression a*: + * + | + a +*/ + +static bin_tree_t * +parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token, + reg_syntax_t syntax, Idx nest, reg_errcode_t *err) +{ + re_dfa_t *dfa = preg->buffer; + bin_tree_t *tree; + switch (token->type) + { + case CHARACTER: + tree = create_token_tree (dfa, NULL, NULL, token); + if (BE (tree == NULL, 0)) + { + *err = REG_ESPACE; + return NULL; + } +#ifdef RE_ENABLE_I18N + if (dfa->mb_cur_max > 1) + { + while (!re_string_eoi (regexp) + && !re_string_first_byte (regexp, re_string_cur_idx (regexp))) + { + bin_tree_t *mbc_remain; + fetch_token (token, regexp, syntax); + mbc_remain = create_token_tree (dfa, NULL, NULL, token); + tree = create_tree (dfa, tree, mbc_remain, CONCAT); + if (BE (mbc_remain == NULL || tree == NULL, 0)) + { + *err = REG_ESPACE; + return NULL; + } + } + } +#endif + break; + case OP_OPEN_SUBEXP: + tree = parse_sub_exp (regexp, preg, token, syntax, nest + 1, err); + if (BE (*err != REG_NOERROR && tree == NULL, 0)) + return NULL; + break; + case OP_OPEN_BRACKET: + tree = parse_bracket_exp (regexp, dfa, token, syntax, err); + if (BE (*err != REG_NOERROR && tree == NULL, 0)) + return NULL; + break; + case OP_BACK_REF: + if (!BE (dfa->completed_bkref_map & (1 << token->opr.idx), 1)) + { + *err = REG_ESUBREG; + return NULL; + } + dfa->used_bkref_map |= 1 << token->opr.idx; + tree = create_token_tree (dfa, NULL, NULL, token); + if (BE (tree == NULL, 0)) + { + *err = REG_ESPACE; + return NULL; + } + ++dfa->nbackref; + dfa->has_mb_node = 1; + break; + case OP_OPEN_DUP_NUM: + if (syntax & RE_CONTEXT_INVALID_DUP) + { + *err = REG_BADRPT; + return NULL; + } + /* FALLTHROUGH */ + case OP_DUP_ASTERISK: + case OP_DUP_PLUS: + case OP_DUP_QUESTION: + if (syntax & RE_CONTEXT_INVALID_OPS) + { + *err = REG_BADRPT; + return NULL; + } + else if (syntax & RE_CONTEXT_INDEP_OPS) + { + fetch_token (token, regexp, syntax); + return parse_expression (regexp, preg, token, syntax, nest, err); + } + /* else fall through */ + case OP_CLOSE_SUBEXP: + if ((token->type == OP_CLOSE_SUBEXP) && + !(syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)) + { + *err = REG_ERPAREN; + return NULL; + } + /* else fall through */ + case OP_CLOSE_DUP_NUM: + /* We treat it as a normal character. */ + + /* Then we can these characters as normal characters. */ + token->type = CHARACTER; + /* mb_partial and word_char bits should be initialized already + by peek_token. */ + tree = create_token_tree (dfa, NULL, NULL, token); + if (BE (tree == NULL, 0)) + { + *err = REG_ESPACE; + return NULL; + } + break; + case ANCHOR: + if ((token->opr.ctx_type + & (WORD_DELIM | NOT_WORD_DELIM | WORD_FIRST | WORD_LAST)) + && dfa->word_ops_used == 0) + init_word_char (dfa); + if (token->opr.ctx_type == WORD_DELIM + || token->opr.ctx_type == NOT_WORD_DELIM) + { + bin_tree_t *tree_first, *tree_last; + if (token->opr.ctx_type == WORD_DELIM) + { + token->opr.ctx_type = WORD_FIRST; + tree_first = create_token_tree (dfa, NULL, NULL, token); + token->opr.ctx_type = WORD_LAST; + } + else + { + token->opr.ctx_type = INSIDE_WORD; + tree_first = create_token_tree (dfa, NULL, NULL, token); + token->opr.ctx_type = INSIDE_NOTWORD; + } + tree_last = create_token_tree (dfa, NULL, NULL, token); + tree = create_tree (dfa, tree_first, tree_last, OP_ALT); + if (BE (tree_first == NULL || tree_last == NULL || tree == NULL, 0)) + { + *err = REG_ESPACE; + return NULL; + } + } + else + { + tree = create_token_tree (dfa, NULL, NULL, token); + if (BE (tree == NULL, 0)) + { + *err = REG_ESPACE; + return NULL; + } + } + /* We must return here, since ANCHORs can't be followed + by repetition operators. + eg. RE"^*" is invalid or "<ANCHOR(^)><CHAR(*)>", + it must not be "<ANCHOR(^)><REPEAT(*)>". */ + fetch_token (token, regexp, syntax); + return tree; + case OP_PERIOD: + tree = create_token_tree (dfa, NULL, NULL, token); + if (BE (tree == NULL, 0)) + { + *err = REG_ESPACE; + return NULL; + } + if (dfa->mb_cur_max > 1) + dfa->has_mb_node = 1; + break; + case OP_WORD: + case OP_NOTWORD: + tree = build_charclass_op (dfa, regexp->trans, + "alnum", + "_", + token->type == OP_NOTWORD, err); + if (BE (*err != REG_NOERROR && tree == NULL, 0)) + return NULL; + break; + case OP_SPACE: + case OP_NOTSPACE: + tree = build_charclass_op (dfa, regexp->trans, + "space", + "", + token->type == OP_NOTSPACE, err); + if (BE (*err != REG_NOERROR && tree == NULL, 0)) + return NULL; + break; + case OP_ALT: + case END_OF_RE: + return NULL; + case BACK_SLASH: + *err = REG_EESCAPE; + return NULL; + default: + /* Must not happen? */ +#ifdef DEBUG + assert (0); +#endif + return NULL; + } + fetch_token (token, regexp, syntax); + + while (token->type == OP_DUP_ASTERISK || token->type == OP_DUP_PLUS + || token->type == OP_DUP_QUESTION || token->type == OP_OPEN_DUP_NUM) + { + bin_tree_t *dup_tree = parse_dup_op (tree, regexp, dfa, token, + syntax, err); + if (BE (*err != REG_NOERROR && dup_tree == NULL, 0)) + { + if (tree != NULL) + postorder (tree, free_tree, NULL); + return NULL; + } + tree = dup_tree; + /* In BRE consecutive duplications are not allowed. */ + if ((syntax & RE_CONTEXT_INVALID_DUP) + && (token->type == OP_DUP_ASTERISK + || token->type == OP_OPEN_DUP_NUM)) + { + if (tree != NULL) + postorder (tree, free_tree, NULL); + *err = REG_BADRPT; + return NULL; + } + } + + return tree; +} + +/* This function build the following tree, from regular expression + (<reg_exp>): + SUBEXP + | + <reg_exp> +*/ + +static bin_tree_t * +parse_sub_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, + reg_syntax_t syntax, Idx nest, reg_errcode_t *err) +{ + re_dfa_t *dfa = preg->buffer; + bin_tree_t *tree; + size_t cur_nsub; + cur_nsub = preg->re_nsub++; + + fetch_token (token, regexp, syntax | RE_CARET_ANCHORS_HERE); + + /* The subexpression may be a null string. */ + if (token->type == OP_CLOSE_SUBEXP) + tree = NULL; + else + { + tree = parse_reg_exp (regexp, preg, token, syntax, nest, err); + if (BE (*err == REG_NOERROR && token->type != OP_CLOSE_SUBEXP, 0)) + { + if (tree != NULL) + postorder (tree, free_tree, NULL); + *err = REG_EPAREN; + } + if (BE (*err != REG_NOERROR, 0)) + return NULL; + } + + if (cur_nsub <= '9' - '1') + dfa->completed_bkref_map |= 1 << cur_nsub; + + tree = create_tree (dfa, tree, NULL, SUBEXP); + if (BE (tree == NULL, 0)) + { + *err = REG_ESPACE; + return NULL; + } + tree->token.opr.idx = cur_nsub; + return tree; +} + +/* This function parse repetition operators like "*", "+", "{1,3}" etc. */ + +static bin_tree_t * +parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa, + re_token_t *token, reg_syntax_t syntax, reg_errcode_t *err) +{ + bin_tree_t *tree = NULL, *old_tree = NULL; + Idx i, start, end, start_idx = re_string_cur_idx (regexp); + re_token_t start_token = *token; + + if (token->type == OP_OPEN_DUP_NUM) + { + end = 0; + start = fetch_number (regexp, token, syntax); + if (start == -1) + { + if (token->type == CHARACTER && token->opr.c == ',') + start = 0; /* We treat "{,m}" as "{0,m}". */ + else + { + *err = REG_BADBR; /* <re>{} is invalid. */ + return NULL; + } + } + if (BE (start != -2, 1)) + { + /* We treat "{n}" as "{n,n}". */ + end = ((token->type == OP_CLOSE_DUP_NUM) ? start + : ((token->type == CHARACTER && token->opr.c == ',') + ? fetch_number (regexp, token, syntax) : -2)); + } + if (BE (start == -2 || end == -2, 0)) + { + /* Invalid sequence. */ + if (BE (!(syntax & RE_INVALID_INTERVAL_ORD), 0)) + { + if (token->type == END_OF_RE) + *err = REG_EBRACE; + else + *err = REG_BADBR; + + return NULL; + } + + /* If the syntax bit is set, rollback. */ + re_string_set_index (regexp, start_idx); + *token = start_token; + token->type = CHARACTER; + /* mb_partial and word_char bits should be already initialized by + peek_token. */ + return elem; + } + + if (BE ((end != -1 && start > end) + || token->type != OP_CLOSE_DUP_NUM, 0)) + { + /* First number greater than second. */ + *err = REG_BADBR; + return NULL; + } + + if (BE (RE_DUP_MAX < (end == -1 ? start : end), 0)) + { + *err = REG_ESIZE; + return NULL; + } + } + else + { + start = (token->type == OP_DUP_PLUS) ? 1 : 0; + end = (token->type == OP_DUP_QUESTION) ? 1 : -1; + } + + fetch_token (token, regexp, syntax); + + if (BE (elem == NULL, 0)) + return NULL; + if (BE (start == 0 && end == 0, 0)) + { + postorder (elem, free_tree, NULL); + return NULL; + } + + /* Extract "<re>{n,m}" to "<re><re>...<re><re>{0,<m-n>}". */ + if (BE (start > 0, 0)) + { + tree = elem; + for (i = 2; i <= start; ++i) + { + elem = duplicate_tree (elem, dfa); + tree = create_tree (dfa, tree, elem, CONCAT); + if (BE (elem == NULL || tree == NULL, 0)) + goto parse_dup_op_espace; + } + + if (start == end) + return tree; + + /* Duplicate ELEM before it is marked optional. */ + elem = duplicate_tree (elem, dfa); + if (BE (elem == NULL, 0)) + goto parse_dup_op_espace; + old_tree = tree; + } + else + old_tree = NULL; + + if (elem->token.type == SUBEXP) + { + uintptr_t subidx = elem->token.opr.idx; + postorder (elem, mark_opt_subexp, (void *) subidx); + } + + tree = create_tree (dfa, elem, NULL, + (end == -1 ? OP_DUP_ASTERISK : OP_ALT)); + if (BE (tree == NULL, 0)) + goto parse_dup_op_espace; + +/* From gnulib's "intprops.h": + True if the arithmetic type T is signed. */ +#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) + + /* This loop is actually executed only when end != -1, + to rewrite <re>{0,n} as (<re>(<re>...<re>?)?)?... We have + already created the start+1-th copy. */ + if (TYPE_SIGNED (Idx) || end != -1) + for (i = start + 2; i <= end; ++i) + { + elem = duplicate_tree (elem, dfa); + tree = create_tree (dfa, tree, elem, CONCAT); + if (BE (elem == NULL || tree == NULL, 0)) + goto parse_dup_op_espace; + + tree = create_tree (dfa, tree, NULL, OP_ALT); + if (BE (tree == NULL, 0)) + goto parse_dup_op_espace; + } + + if (old_tree) + tree = create_tree (dfa, old_tree, tree, CONCAT); + + return tree; + + parse_dup_op_espace: + *err = REG_ESPACE; + return NULL; +} + +/* Size of the names for collating symbol/equivalence_class/character_class. + I'm not sure, but maybe enough. */ +#define BRACKET_NAME_BUF_SIZE 32 + +#ifndef _LIBC + +# ifdef RE_ENABLE_I18N +/* Convert the byte B to the corresponding wide character. In a + unibyte locale, treat B as itself if it is an encoding error. + In a multibyte locale, return WEOF if B is an encoding error. */ +static wint_t +parse_byte (unsigned char b, re_charset_t *mbcset) +{ + wint_t wc = __btowc (b); + return wc == WEOF && !mbcset ? b : wc; +} +#endif + + /* Local function for parse_bracket_exp only used in case of NOT _LIBC. + Build the range expression which starts from START_ELEM, and ends + at END_ELEM. The result are written to MBCSET and SBCSET. + RANGE_ALLOC is the allocated size of mbcset->range_starts, and + mbcset->range_ends, is a pointer argument since we may + update it. */ + +static reg_errcode_t +internal_function +# ifdef RE_ENABLE_I18N +build_range_exp (const reg_syntax_t syntax, + bitset_t sbcset, + re_charset_t *mbcset, + Idx *range_alloc, + const bracket_elem_t *start_elem, + const bracket_elem_t *end_elem) +# else /* not RE_ENABLE_I18N */ +build_range_exp (const reg_syntax_t syntax, + bitset_t sbcset, + const bracket_elem_t *start_elem, + const bracket_elem_t *end_elem) +# endif /* not RE_ENABLE_I18N */ +{ + unsigned int start_ch, end_ch; + /* Equivalence Classes and Character Classes can't be a range start/end. */ + if (BE (start_elem->type == EQUIV_CLASS || start_elem->type == CHAR_CLASS + || end_elem->type == EQUIV_CLASS || end_elem->type == CHAR_CLASS, + 0)) + return REG_ERANGE; + + /* We can handle no multi character collating elements without libc + support. */ + if (BE ((start_elem->type == COLL_SYM + && strlen ((char *) start_elem->opr.name) > 1) + || (end_elem->type == COLL_SYM + && strlen ((char *) end_elem->opr.name) > 1), 0)) + return REG_ECOLLATE; + +# ifdef RE_ENABLE_I18N + { + wchar_t wc; + wint_t start_wc; + wint_t end_wc; + + start_ch = ((start_elem->type == SB_CHAR) ? start_elem->opr.ch + : ((start_elem->type == COLL_SYM) ? start_elem->opr.name[0] + : 0)); + end_ch = ((end_elem->type == SB_CHAR) ? end_elem->opr.ch + : ((end_elem->type == COLL_SYM) ? end_elem->opr.name[0] + : 0)); + start_wc = ((start_elem->type == SB_CHAR || start_elem->type == COLL_SYM) + ? parse_byte (start_ch, mbcset) : start_elem->opr.wch); + end_wc = ((end_elem->type == SB_CHAR || end_elem->type == COLL_SYM) + ? parse_byte (end_ch, mbcset) : end_elem->opr.wch); + if (start_wc == WEOF || end_wc == WEOF) + return REG_ECOLLATE; + else if (BE ((syntax & RE_NO_EMPTY_RANGES) && start_wc > end_wc, 0)) + return REG_ERANGE; + + /* Got valid collation sequence values, add them as a new entry. + However, for !_LIBC we have no collation elements: if the + character set is single byte, the single byte character set + that we build below suffices. parse_bracket_exp passes + no MBCSET if dfa->mb_cur_max == 1. */ + if (mbcset) + { + /* Check the space of the arrays. */ + if (BE (*range_alloc == mbcset->nranges, 0)) + { + /* There is not enough space, need realloc. */ + wchar_t *new_array_start, *new_array_end; + Idx new_nranges; + + /* +1 in case of mbcset->nranges is 0. */ + new_nranges = 2 * mbcset->nranges + 1; + /* Use realloc since mbcset->range_starts and mbcset->range_ends + are NULL if *range_alloc == 0. */ + new_array_start = re_realloc (mbcset->range_starts, wchar_t, + new_nranges); + new_array_end = re_realloc (mbcset->range_ends, wchar_t, + new_nranges); + + if (BE (new_array_start == NULL || new_array_end == NULL, 0)) + { + re_free (new_array_start); + re_free (new_array_end); + return REG_ESPACE; + } + + mbcset->range_starts = new_array_start; + mbcset->range_ends = new_array_end; + *range_alloc = new_nranges; + } + + mbcset->range_starts[mbcset->nranges] = start_wc; + mbcset->range_ends[mbcset->nranges++] = end_wc; + } + + /* Build the table for single byte characters. */ + for (wc = 0; wc < SBC_MAX; ++wc) + { + if (start_wc <= wc && wc <= end_wc) + bitset_set (sbcset, wc); + } + } +# else /* not RE_ENABLE_I18N */ + { + unsigned int ch; + start_ch = ((start_elem->type == SB_CHAR ) ? start_elem->opr.ch + : ((start_elem->type == COLL_SYM) ? start_elem->opr.name[0] + : 0)); + end_ch = ((end_elem->type == SB_CHAR ) ? end_elem->opr.ch + : ((end_elem->type == COLL_SYM) ? end_elem->opr.name[0] + : 0)); + if (start_ch > end_ch) + return REG_ERANGE; + /* Build the table for single byte characters. */ + for (ch = 0; ch < SBC_MAX; ++ch) + if (start_ch <= ch && ch <= end_ch) + bitset_set (sbcset, ch); + } +# endif /* not RE_ENABLE_I18N */ + return REG_NOERROR; +} +#endif /* not _LIBC */ + +#ifndef _LIBC +/* Helper function for parse_bracket_exp only used in case of NOT _LIBC.. + Build the collating element which is represented by NAME. + The result are written to MBCSET and SBCSET. + COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a + pointer argument since we may update it. */ + +static reg_errcode_t +internal_function +# ifdef RE_ENABLE_I18N +build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset, + Idx *coll_sym_alloc, const unsigned char *name) +# else /* not RE_ENABLE_I18N */ +build_collating_symbol (bitset_t sbcset, const unsigned char *name) +# endif /* not RE_ENABLE_I18N */ +{ + size_t name_len = strlen ((const char *) name); + if (BE (name_len != 1, 0)) + return REG_ECOLLATE; + else + { + bitset_set (sbcset, name[0]); + return REG_NOERROR; + } +} +#endif /* not _LIBC */ + +/* This function parse bracket expression like "[abc]", "[a-c]", + "[[.a-a.]]" etc. */ + +static bin_tree_t * +parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, + reg_syntax_t syntax, reg_errcode_t *err) +{ +#ifdef _LIBC + const unsigned char *collseqmb; + const char *collseqwc; + uint32_t nrules; + int32_t table_size; + const int32_t *symb_table; + const unsigned char *extra; + + /* Local function for parse_bracket_exp used in _LIBC environment. + Seek the collating symbol entry corresponding to NAME. + Return the index of the symbol in the SYMB_TABLE, + or -1 if not found. */ + + auto inline int32_t + __attribute__ ((always_inline)) + seek_collating_symbol_entry (const unsigned char *name, size_t name_len) + { + int32_t elem; + + for (elem = 0; elem < table_size; elem++) + if (symb_table[2 * elem] != 0) + { + int32_t idx = symb_table[2 * elem + 1]; + /* Skip the name of collating element name. */ + idx += 1 + extra[idx]; + if (/* Compare the length of the name. */ + name_len == extra[idx] + /* Compare the name. */ + && memcmp (name, &extra[idx + 1], name_len) == 0) + /* Yep, this is the entry. */ + return elem; + } + return -1; + } + + /* Local function for parse_bracket_exp used in _LIBC environment. + Look up the collation sequence value of BR_ELEM. + Return the value if succeeded, UINT_MAX otherwise. */ + + auto inline unsigned int + __attribute__ ((always_inline)) + lookup_collation_sequence_value (bracket_elem_t *br_elem) + { + if (br_elem->type == SB_CHAR) + { + /* + if (MB_CUR_MAX == 1) + */ + if (nrules == 0) + return collseqmb[br_elem->opr.ch]; + else + { + wint_t wc = __btowc (br_elem->opr.ch); + return __collseq_table_lookup (collseqwc, wc); + } + } + else if (br_elem->type == MB_CHAR) + { + if (nrules != 0) + return __collseq_table_lookup (collseqwc, br_elem->opr.wch); + } + else if (br_elem->type == COLL_SYM) + { + size_t sym_name_len = strlen ((char *) br_elem->opr.name); + if (nrules != 0) + { + int32_t elem, idx; + elem = seek_collating_symbol_entry (br_elem->opr.name, + sym_name_len); + if (elem != -1) + { + /* We found the entry. */ + idx = symb_table[2 * elem + 1]; + /* Skip the name of collating element name. */ + idx += 1 + extra[idx]; + /* Skip the byte sequence of the collating element. */ + idx += 1 + extra[idx]; + /* Adjust for the alignment. */ + idx = (idx + 3) & ~3; + /* Skip the multibyte collation sequence value. */ + idx += sizeof (unsigned int); + /* Skip the wide char sequence of the collating element. */ + idx += sizeof (unsigned int) * + (1 + *(unsigned int *) (extra + idx)); + /* Return the collation sequence value. */ + return *(unsigned int *) (extra + idx); + } + else if (sym_name_len == 1) + { + /* No valid character. Match it as a single byte + character. */ + return collseqmb[br_elem->opr.name[0]]; + } + } + else if (sym_name_len == 1) + return collseqmb[br_elem->opr.name[0]]; + } + return UINT_MAX; + } + + /* Local function for parse_bracket_exp used in _LIBC environment. + Build the range expression which starts from START_ELEM, and ends + at END_ELEM. The result are written to MBCSET and SBCSET. + RANGE_ALLOC is the allocated size of mbcset->range_starts, and + mbcset->range_ends, is a pointer argument since we may + update it. */ + + auto inline reg_errcode_t + __attribute__ ((always_inline)) + build_range_exp (bitset_t sbcset, re_charset_t *mbcset, int *range_alloc, + bracket_elem_t *start_elem, bracket_elem_t *end_elem) + { + unsigned int ch; + uint32_t start_collseq; + uint32_t end_collseq; + + /* Equivalence Classes and Character Classes can't be a range + start/end. */ + if (BE (start_elem->type == EQUIV_CLASS || start_elem->type == CHAR_CLASS + || end_elem->type == EQUIV_CLASS || end_elem->type == CHAR_CLASS, + 0)) + return REG_ERANGE; + + /* FIXME: Implement rational ranges here, too. */ + start_collseq = lookup_collation_sequence_value (start_elem); + end_collseq = lookup_collation_sequence_value (end_elem); + /* Check start/end collation sequence values. */ + if (BE (start_collseq == UINT_MAX || end_collseq == UINT_MAX, 0)) + return REG_ECOLLATE; + if (BE ((syntax & RE_NO_EMPTY_RANGES) && start_collseq > end_collseq, 0)) + return REG_ERANGE; + + /* Got valid collation sequence values, add them as a new entry. + However, if we have no collation elements, and the character set + is single byte, the single byte character set that we + build below suffices. */ + if (nrules > 0 || dfa->mb_cur_max > 1) + { + /* Check the space of the arrays. */ + if (BE (*range_alloc == mbcset->nranges, 0)) + { + /* There is not enough space, need realloc. */ + uint32_t *new_array_start; + uint32_t *new_array_end; + Idx new_nranges; + + /* +1 in case of mbcset->nranges is 0. */ + new_nranges = 2 * mbcset->nranges + 1; + new_array_start = re_realloc (mbcset->range_starts, uint32_t, + new_nranges); + new_array_end = re_realloc (mbcset->range_ends, uint32_t, + new_nranges); + + if (BE (new_array_start == NULL || new_array_end == NULL, 0)) + return REG_ESPACE; + + mbcset->range_starts = new_array_start; + mbcset->range_ends = new_array_end; + *range_alloc = new_nranges; + } + + mbcset->range_starts[mbcset->nranges] = start_collseq; + mbcset->range_ends[mbcset->nranges++] = end_collseq; + } + + /* Build the table for single byte characters. */ + for (ch = 0; ch < SBC_MAX; ch++) + { + uint32_t ch_collseq; + /* + if (MB_CUR_MAX == 1) + */ + if (nrules == 0) + ch_collseq = collseqmb[ch]; + else + ch_collseq = __collseq_table_lookup (collseqwc, __btowc (ch)); + if (start_collseq <= ch_collseq && ch_collseq <= end_collseq) + bitset_set (sbcset, ch); + } + return REG_NOERROR; + } + + /* Local function for parse_bracket_exp used in _LIBC environment. + Build the collating element which is represented by NAME. + The result are written to MBCSET and SBCSET. + COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a + pointer argument since we may update it. */ + + auto inline reg_errcode_t + __attribute__ ((always_inline)) + build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset, + Idx *coll_sym_alloc, const unsigned char *name) + { + int32_t elem, idx; + size_t name_len = strlen ((const char *) name); + if (nrules != 0) + { + elem = seek_collating_symbol_entry (name, name_len); + if (elem != -1) + { + /* We found the entry. */ + idx = symb_table[2 * elem + 1]; + /* Skip the name of collating element name. */ + idx += 1 + extra[idx]; + } + else if (name_len == 1) + { + /* No valid character, treat it as a normal + character. */ + bitset_set (sbcset, name[0]); + return REG_NOERROR; + } + else + return REG_ECOLLATE; + + /* Got valid collation sequence, add it as a new entry. */ + /* Check the space of the arrays. */ + if (BE (*coll_sym_alloc == mbcset->ncoll_syms, 0)) + { + /* Not enough, realloc it. */ + /* +1 in case of mbcset->ncoll_syms is 0. */ + Idx new_coll_sym_alloc = 2 * mbcset->ncoll_syms + 1; + /* Use realloc since mbcset->coll_syms is NULL + if *alloc == 0. */ + int32_t *new_coll_syms = re_realloc (mbcset->coll_syms, int32_t, + new_coll_sym_alloc); + if (BE (new_coll_syms == NULL, 0)) + return REG_ESPACE; + mbcset->coll_syms = new_coll_syms; + *coll_sym_alloc = new_coll_sym_alloc; + } + mbcset->coll_syms[mbcset->ncoll_syms++] = idx; + return REG_NOERROR; + } + else + { + if (BE (name_len != 1, 0)) + return REG_ECOLLATE; + else + { + bitset_set (sbcset, name[0]); + return REG_NOERROR; + } + } + } +#endif + + re_token_t br_token; + re_bitset_ptr_t sbcset; +#ifdef RE_ENABLE_I18N + re_charset_t *mbcset; + Idx coll_sym_alloc = 0, range_alloc = 0, mbchar_alloc = 0; + Idx equiv_class_alloc = 0, char_class_alloc = 0; +#endif /* not RE_ENABLE_I18N */ + bool non_match = false; + bin_tree_t *work_tree; + int token_len; + bool first_round = true; +#ifdef _LIBC + collseqmb = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQMB); + nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); + if (nrules) + { + /* + if (MB_CUR_MAX > 1) + */ + collseqwc = _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQWC); + table_size = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_SYMB_HASH_SIZEMB); + symb_table = (const int32_t *) _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_SYMB_TABLEMB); + extra = (const unsigned char *) _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_SYMB_EXTRAMB); + } +#endif + sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1); +#ifdef RE_ENABLE_I18N + mbcset = (re_charset_t *) calloc (sizeof (re_charset_t), 1); +#endif /* RE_ENABLE_I18N */ +#ifdef RE_ENABLE_I18N + if (BE (sbcset == NULL || mbcset == NULL, 0)) +#else + if (BE (sbcset == NULL, 0)) +#endif /* RE_ENABLE_I18N */ + { + re_free (sbcset); +#ifdef RE_ENABLE_I18N + re_free (mbcset); +#endif + *err = REG_ESPACE; + return NULL; + } + + token_len = peek_token_bracket (token, regexp, syntax); + if (BE (token->type == END_OF_RE, 0)) + { + *err = REG_BADPAT; + goto parse_bracket_exp_free_return; + } + if (token->type == OP_NON_MATCH_LIST) + { +#ifdef RE_ENABLE_I18N + mbcset->non_match = 1; +#endif /* not RE_ENABLE_I18N */ + non_match = true; + if (syntax & RE_HAT_LISTS_NOT_NEWLINE) + bitset_set (sbcset, '\n'); + re_string_skip_bytes (regexp, token_len); /* Skip a token. */ + token_len = peek_token_bracket (token, regexp, syntax); + if (BE (token->type == END_OF_RE, 0)) + { + *err = REG_BADPAT; + goto parse_bracket_exp_free_return; + } + } + + /* We treat the first ']' as a normal character. */ + if (token->type == OP_CLOSE_BRACKET) + token->type = CHARACTER; + + while (1) + { + bracket_elem_t start_elem, end_elem; + unsigned char start_name_buf[BRACKET_NAME_BUF_SIZE]; + unsigned char end_name_buf[BRACKET_NAME_BUF_SIZE]; + reg_errcode_t ret; + int token_len2 = 0; + bool is_range_exp = false; + re_token_t token2; + + start_elem.opr.name = start_name_buf; + start_elem.type = COLL_SYM; + ret = parse_bracket_element (&start_elem, regexp, token, token_len, dfa, + syntax, first_round); + if (BE (ret != REG_NOERROR, 0)) + { + *err = ret; + goto parse_bracket_exp_free_return; + } + first_round = false; + + /* Get information about the next token. We need it in any case. */ + token_len = peek_token_bracket (token, regexp, syntax); + + /* Do not check for ranges if we know they are not allowed. */ + if (start_elem.type != CHAR_CLASS && start_elem.type != EQUIV_CLASS) + { + if (BE (token->type == END_OF_RE, 0)) + { + *err = REG_EBRACK; + goto parse_bracket_exp_free_return; + } + if (token->type == OP_CHARSET_RANGE) + { + re_string_skip_bytes (regexp, token_len); /* Skip '-'. */ + token_len2 = peek_token_bracket (&token2, regexp, syntax); + if (BE (token2.type == END_OF_RE, 0)) + { + *err = REG_EBRACK; + goto parse_bracket_exp_free_return; + } + if (token2.type == OP_CLOSE_BRACKET) + { + /* We treat the last '-' as a normal character. */ + re_string_skip_bytes (regexp, -token_len); + token->type = CHARACTER; + } + else + is_range_exp = true; + } + } + + if (is_range_exp == true) + { + end_elem.opr.name = end_name_buf; + end_elem.type = COLL_SYM; + ret = parse_bracket_element (&end_elem, regexp, &token2, token_len2, + dfa, syntax, true); + if (BE (ret != REG_NOERROR, 0)) + { + *err = ret; + goto parse_bracket_exp_free_return; + } + + token_len = peek_token_bracket (token, regexp, syntax); + +#ifdef _LIBC + *err = build_range_exp (sbcset, mbcset, &range_alloc, + &start_elem, &end_elem); +#else +# ifdef RE_ENABLE_I18N + *err = build_range_exp (syntax, sbcset, + dfa->mb_cur_max > 1 ? mbcset : NULL, + &range_alloc, &start_elem, &end_elem); +# else + *err = build_range_exp (syntax, sbcset, &start_elem, &end_elem); +# endif +#endif /* RE_ENABLE_I18N */ + if (BE (*err != REG_NOERROR, 0)) + goto parse_bracket_exp_free_return; + } + else + { + switch (start_elem.type) + { + case SB_CHAR: + bitset_set (sbcset, start_elem.opr.ch); + break; +#ifdef RE_ENABLE_I18N + case MB_CHAR: + /* Check whether the array has enough space. */ + if (BE (mbchar_alloc == mbcset->nmbchars, 0)) + { + wchar_t *new_mbchars; + /* Not enough, realloc it. */ + /* +1 in case of mbcset->nmbchars is 0. */ + mbchar_alloc = 2 * mbcset->nmbchars + 1; + /* Use realloc since array is NULL if *alloc == 0. */ + new_mbchars = re_realloc (mbcset->mbchars, wchar_t, + mbchar_alloc); + if (BE (new_mbchars == NULL, 0)) + goto parse_bracket_exp_espace; + mbcset->mbchars = new_mbchars; + } + mbcset->mbchars[mbcset->nmbchars++] = start_elem.opr.wch; + break; +#endif /* RE_ENABLE_I18N */ + case EQUIV_CLASS: + *err = build_equiv_class (sbcset, +#ifdef RE_ENABLE_I18N + mbcset, &equiv_class_alloc, +#endif /* RE_ENABLE_I18N */ + start_elem.opr.name); + if (BE (*err != REG_NOERROR, 0)) + goto parse_bracket_exp_free_return; + break; + case COLL_SYM: + *err = build_collating_symbol (sbcset, +#ifdef RE_ENABLE_I18N + mbcset, &coll_sym_alloc, +#endif /* RE_ENABLE_I18N */ + start_elem.opr.name); + if (BE (*err != REG_NOERROR, 0)) + goto parse_bracket_exp_free_return; + break; + case CHAR_CLASS: + *err = build_charclass (regexp->trans, sbcset, +#ifdef RE_ENABLE_I18N + mbcset, &char_class_alloc, +#endif /* RE_ENABLE_I18N */ + (const char *) start_elem.opr.name, + syntax); + if (BE (*err != REG_NOERROR, 0)) + goto parse_bracket_exp_free_return; + break; + default: + assert (0); + break; + } + } + if (BE (token->type == END_OF_RE, 0)) + { + *err = REG_EBRACK; + goto parse_bracket_exp_free_return; + } + if (token->type == OP_CLOSE_BRACKET) + break; + } + + re_string_skip_bytes (regexp, token_len); /* Skip a token. */ + + /* If it is non-matching list. */ + if (non_match) + bitset_not (sbcset); + +#ifdef RE_ENABLE_I18N + /* Ensure only single byte characters are set. */ + if (dfa->mb_cur_max > 1) + bitset_mask (sbcset, dfa->sb_char); + + if (mbcset->nmbchars || mbcset->ncoll_syms || mbcset->nequiv_classes + || mbcset->nranges || (dfa->mb_cur_max > 1 && (mbcset->nchar_classes + || mbcset->non_match))) + { + bin_tree_t *mbc_tree; + int sbc_idx; + /* Build a tree for complex bracket. */ + dfa->has_mb_node = 1; + br_token.type = COMPLEX_BRACKET; + br_token.opr.mbcset = mbcset; + mbc_tree = create_token_tree (dfa, NULL, NULL, &br_token); + if (BE (mbc_tree == NULL, 0)) + goto parse_bracket_exp_espace; + for (sbc_idx = 0; sbc_idx < BITSET_WORDS; ++sbc_idx) + if (sbcset[sbc_idx]) + break; + /* If there are no bits set in sbcset, there is no point + of having both SIMPLE_BRACKET and COMPLEX_BRACKET. */ + if (sbc_idx < BITSET_WORDS) + { + /* Build a tree for simple bracket. */ + br_token.type = SIMPLE_BRACKET; + br_token.opr.sbcset = sbcset; + work_tree = create_token_tree (dfa, NULL, NULL, &br_token); + if (BE (work_tree == NULL, 0)) + goto parse_bracket_exp_espace; + + /* Then join them by ALT node. */ + work_tree = create_tree (dfa, work_tree, mbc_tree, OP_ALT); + if (BE (work_tree == NULL, 0)) + goto parse_bracket_exp_espace; + } + else + { + re_free (sbcset); + work_tree = mbc_tree; + } + } + else +#endif /* not RE_ENABLE_I18N */ + { +#ifdef RE_ENABLE_I18N + free_charset (mbcset); +#endif + /* Build a tree for simple bracket. */ + br_token.type = SIMPLE_BRACKET; + br_token.opr.sbcset = sbcset; + work_tree = create_token_tree (dfa, NULL, NULL, &br_token); + if (BE (work_tree == NULL, 0)) + goto parse_bracket_exp_espace; + } + return work_tree; + + parse_bracket_exp_espace: + *err = REG_ESPACE; + parse_bracket_exp_free_return: + re_free (sbcset); +#ifdef RE_ENABLE_I18N + free_charset (mbcset); +#endif /* RE_ENABLE_I18N */ + return NULL; +} + +/* Parse an element in the bracket expression. */ + +static reg_errcode_t +parse_bracket_element (bracket_elem_t *elem, re_string_t *regexp, + re_token_t *token, int token_len, re_dfa_t *dfa, + reg_syntax_t syntax, bool accept_hyphen) +{ +#ifdef RE_ENABLE_I18N + int cur_char_size; + cur_char_size = re_string_char_size_at (regexp, re_string_cur_idx (regexp)); + if (cur_char_size > 1) + { + elem->type = MB_CHAR; + elem->opr.wch = re_string_wchar_at (regexp, re_string_cur_idx (regexp)); + re_string_skip_bytes (regexp, cur_char_size); + return REG_NOERROR; + } +#endif /* RE_ENABLE_I18N */ + re_string_skip_bytes (regexp, token_len); /* Skip a token. */ + if (token->type == OP_OPEN_COLL_ELEM || token->type == OP_OPEN_CHAR_CLASS + || token->type == OP_OPEN_EQUIV_CLASS) + return parse_bracket_symbol (elem, regexp, token); + if (BE (token->type == OP_CHARSET_RANGE, 0) && !accept_hyphen) + { + /* A '-' must only appear as anything but a range indicator before + the closing bracket. Everything else is an error. */ + re_token_t token2; + (void) peek_token_bracket (&token2, regexp, syntax); + if (token2.type != OP_CLOSE_BRACKET) + /* The actual error value is not standardized since this whole + case is undefined. But ERANGE makes good sense. */ + return REG_ERANGE; + } + elem->type = SB_CHAR; + elem->opr.ch = token->opr.c; + return REG_NOERROR; +} + +/* Parse a bracket symbol in the bracket expression. Bracket symbols are + such as [:<character_class>:], [.<collating_element>.], and + [=<equivalent_class>=]. */ + +static reg_errcode_t +parse_bracket_symbol (bracket_elem_t *elem, re_string_t *regexp, + re_token_t *token) +{ + unsigned char ch, delim = token->opr.c; + int i = 0; + if (re_string_eoi(regexp)) + return REG_EBRACK; + for (;; ++i) + { + if (i >= BRACKET_NAME_BUF_SIZE) + return REG_EBRACK; + if (token->type == OP_OPEN_CHAR_CLASS) + ch = re_string_fetch_byte_case (regexp); + else + ch = re_string_fetch_byte (regexp); + if (re_string_eoi(regexp)) + return REG_EBRACK; + if (ch == delim && re_string_peek_byte (regexp, 0) == ']') + break; + elem->opr.name[i] = ch; + } + re_string_skip_bytes (regexp, 1); + elem->opr.name[i] = '\0'; + switch (token->type) + { + case OP_OPEN_COLL_ELEM: + elem->type = COLL_SYM; + break; + case OP_OPEN_EQUIV_CLASS: + elem->type = EQUIV_CLASS; + break; + case OP_OPEN_CHAR_CLASS: + elem->type = CHAR_CLASS; + break; + default: + break; + } + return REG_NOERROR; +} + + /* Helper function for parse_bracket_exp. + Build the equivalence class which is represented by NAME. + The result are written to MBCSET and SBCSET. + EQUIV_CLASS_ALLOC is the allocated size of mbcset->equiv_classes, + is a pointer argument since we may update it. */ + +static reg_errcode_t +#ifdef RE_ENABLE_I18N +build_equiv_class (bitset_t sbcset, re_charset_t *mbcset, + Idx *equiv_class_alloc, const unsigned char *name) +#else /* not RE_ENABLE_I18N */ +build_equiv_class (bitset_t sbcset, const unsigned char *name) +#endif /* not RE_ENABLE_I18N */ +{ +#ifdef _LIBC + uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); + if (nrules != 0) + { + const int32_t *table, *indirect; + const unsigned char *weights, *extra, *cp; + unsigned char char_buf[2]; + int32_t idx1, idx2; + unsigned int ch; + size_t len; + /* Calculate the index for equivalence class. */ + cp = name; + table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB); + weights = (const unsigned char *) _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_WEIGHTMB); + extra = (const unsigned char *) _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_EXTRAMB); + indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_INDIRECTMB); + idx1 = findidx (table, indirect, extra, &cp, -1); + if (BE (idx1 == 0 || *cp != '\0', 0)) + /* This isn't a valid character. */ + return REG_ECOLLATE; + + /* Build single byte matching table for this equivalence class. */ + len = weights[idx1 & 0xffffff]; + for (ch = 0; ch < SBC_MAX; ++ch) + { + char_buf[0] = ch; + cp = char_buf; + idx2 = findidx (table, indirect, extra, &cp, 1); +/* + idx2 = table[ch]; +*/ + if (idx2 == 0) + /* This isn't a valid character. */ + continue; + /* Compare only if the length matches and the collation rule + index is the same. */ + if (len == weights[idx2 & 0xffffff] && (idx1 >> 24) == (idx2 >> 24)) + { + int cnt = 0; + + while (cnt <= len && + weights[(idx1 & 0xffffff) + 1 + cnt] + == weights[(idx2 & 0xffffff) + 1 + cnt]) + ++cnt; + + if (cnt > len) + bitset_set (sbcset, ch); + } + } + /* Check whether the array has enough space. */ + if (BE (*equiv_class_alloc == mbcset->nequiv_classes, 0)) + { + /* Not enough, realloc it. */ + /* +1 in case of mbcset->nequiv_classes is 0. */ + Idx new_equiv_class_alloc = 2 * mbcset->nequiv_classes + 1; + /* Use realloc since the array is NULL if *alloc == 0. */ + int32_t *new_equiv_classes = re_realloc (mbcset->equiv_classes, + int32_t, + new_equiv_class_alloc); + if (BE (new_equiv_classes == NULL, 0)) + return REG_ESPACE; + mbcset->equiv_classes = new_equiv_classes; + *equiv_class_alloc = new_equiv_class_alloc; + } + mbcset->equiv_classes[mbcset->nequiv_classes++] = idx1; + } + else +#endif /* _LIBC */ + { + if (BE (strlen ((const char *) name) != 1, 0)) + return REG_ECOLLATE; + bitset_set (sbcset, *name); + } + return REG_NOERROR; +} + + /* Helper function for parse_bracket_exp. + Build the character class which is represented by NAME. + The result are written to MBCSET and SBCSET. + CHAR_CLASS_ALLOC is the allocated size of mbcset->char_classes, + is a pointer argument since we may update it. */ + +static reg_errcode_t +#ifdef RE_ENABLE_I18N +build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset, + re_charset_t *mbcset, Idx *char_class_alloc, + const char *class_name, reg_syntax_t syntax) +#else /* not RE_ENABLE_I18N */ +build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset, + const char *class_name, reg_syntax_t syntax) +#endif /* not RE_ENABLE_I18N */ +{ + int i; + const char *name = class_name; + + /* In case of REG_ICASE "upper" and "lower" match the both of + upper and lower cases. */ + if ((syntax & RE_ICASE) + && (strcmp (name, "upper") == 0 || strcmp (name, "lower") == 0)) + name = "alpha"; + +#ifdef RE_ENABLE_I18N + /* Check the space of the arrays. */ + if (BE (*char_class_alloc == mbcset->nchar_classes, 0)) + { + /* Not enough, realloc it. */ + /* +1 in case of mbcset->nchar_classes is 0. */ + Idx new_char_class_alloc = 2 * mbcset->nchar_classes + 1; + /* Use realloc since array is NULL if *alloc == 0. */ + wctype_t *new_char_classes = re_realloc (mbcset->char_classes, wctype_t, + new_char_class_alloc); + if (BE (new_char_classes == NULL, 0)) + return REG_ESPACE; + mbcset->char_classes = new_char_classes; + *char_class_alloc = new_char_class_alloc; + } + mbcset->char_classes[mbcset->nchar_classes++] = __wctype (name); +#endif /* RE_ENABLE_I18N */ + +#define BUILD_CHARCLASS_LOOP(ctype_func) \ + do { \ + if (BE (trans != NULL, 0)) \ + { \ + for (i = 0; i < SBC_MAX; ++i) \ + if (ctype_func (i)) \ + bitset_set (sbcset, trans[i]); \ + } \ + else \ + { \ + for (i = 0; i < SBC_MAX; ++i) \ + if (ctype_func (i)) \ + bitset_set (sbcset, i); \ + } \ + } while (0) + + if (strcmp (name, "alnum") == 0) + BUILD_CHARCLASS_LOOP (isalnum); + else if (strcmp (name, "cntrl") == 0) + BUILD_CHARCLASS_LOOP (iscntrl); + else if (strcmp (name, "lower") == 0) + BUILD_CHARCLASS_LOOP (islower); + else if (strcmp (name, "space") == 0) + BUILD_CHARCLASS_LOOP (isspace); + else if (strcmp (name, "alpha") == 0) + BUILD_CHARCLASS_LOOP (isalpha); + else if (strcmp (name, "digit") == 0) + BUILD_CHARCLASS_LOOP (isdigit); + else if (strcmp (name, "print") == 0) + BUILD_CHARCLASS_LOOP (isprint); + else if (strcmp (name, "upper") == 0) + BUILD_CHARCLASS_LOOP (isupper); + else if (strcmp (name, "blank") == 0) + BUILD_CHARCLASS_LOOP (isblank); + else if (strcmp (name, "graph") == 0) + BUILD_CHARCLASS_LOOP (isgraph); + else if (strcmp (name, "punct") == 0) + BUILD_CHARCLASS_LOOP (ispunct); + else if (strcmp (name, "xdigit") == 0) + BUILD_CHARCLASS_LOOP (isxdigit); + else + return REG_ECTYPE; + + return REG_NOERROR; +} + +static bin_tree_t * +build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans, + const char *class_name, + const char *extra, bool non_match, + reg_errcode_t *err) +{ + re_bitset_ptr_t sbcset; +#ifdef RE_ENABLE_I18N + re_charset_t *mbcset; + Idx alloc = 0; +#endif /* not RE_ENABLE_I18N */ + reg_errcode_t ret; + re_token_t br_token; + bin_tree_t *tree; + + sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1); + if (BE (sbcset == NULL, 0)) + { + *err = REG_ESPACE; + return NULL; + } +#ifdef RE_ENABLE_I18N + mbcset = (re_charset_t *) calloc (sizeof (re_charset_t), 1); + if (BE (mbcset == NULL, 0)) + { + re_free (sbcset); + *err = REG_ESPACE; + return NULL; + } + mbcset->non_match = non_match; +#endif /* RE_ENABLE_I18N */ + + /* We don't care the syntax in this case. */ + ret = build_charclass (trans, sbcset, +#ifdef RE_ENABLE_I18N + mbcset, &alloc, +#endif /* RE_ENABLE_I18N */ + class_name, 0); + + if (BE (ret != REG_NOERROR, 0)) + { + re_free (sbcset); +#ifdef RE_ENABLE_I18N + free_charset (mbcset); +#endif /* RE_ENABLE_I18N */ + *err = ret; + return NULL; + } + /* \w match '_' also. */ + for (; *extra; extra++) + bitset_set (sbcset, *extra); + + /* If it is non-matching list. */ + if (non_match) + bitset_not (sbcset); + +#ifdef RE_ENABLE_I18N + /* Ensure only single byte characters are set. */ + if (dfa->mb_cur_max > 1) + bitset_mask (sbcset, dfa->sb_char); +#endif + + /* Build a tree for simple bracket. */ +#if defined GCC_LINT || defined lint + memset (&br_token, 0, sizeof br_token); +#endif + br_token.type = SIMPLE_BRACKET; + br_token.opr.sbcset = sbcset; + tree = create_token_tree (dfa, NULL, NULL, &br_token); + if (BE (tree == NULL, 0)) + goto build_word_op_espace; + +#ifdef RE_ENABLE_I18N + if (dfa->mb_cur_max > 1) + { + bin_tree_t *mbc_tree; + /* Build a tree for complex bracket. */ + br_token.type = COMPLEX_BRACKET; + br_token.opr.mbcset = mbcset; + dfa->has_mb_node = 1; + mbc_tree = create_token_tree (dfa, NULL, NULL, &br_token); + if (BE (mbc_tree == NULL, 0)) + goto build_word_op_espace; + /* Then join them by ALT node. */ + tree = create_tree (dfa, tree, mbc_tree, OP_ALT); + if (BE (mbc_tree != NULL, 1)) + return tree; + } + else + { + free_charset (mbcset); + return tree; + } +#else /* not RE_ENABLE_I18N */ + return tree; +#endif /* not RE_ENABLE_I18N */ + + build_word_op_espace: + re_free (sbcset); +#ifdef RE_ENABLE_I18N + free_charset (mbcset); +#endif /* RE_ENABLE_I18N */ + *err = REG_ESPACE; + return NULL; +} + +/* This is intended for the expressions like "a{1,3}". + Fetch a number from 'input', and return the number. + Return -1 if the number field is empty like "{,1}". + Return RE_DUP_MAX + 1 if the number field is too large. + Return -2 if an error occurred. */ + +static Idx +fetch_number (re_string_t *input, re_token_t *token, reg_syntax_t syntax) +{ + Idx num = -1; + unsigned char c; + while (1) + { + fetch_token (token, input, syntax); + c = token->opr.c; + if (BE (token->type == END_OF_RE, 0)) + return -2; + if (token->type == OP_CLOSE_DUP_NUM || c == ',') + break; + num = ((token->type != CHARACTER || c < '0' || '9' < c || num == -2) + ? -2 + : num == -1 + ? c - '0' + : MIN (RE_DUP_MAX + 1, num * 10 + c - '0')); + } + return num; +} + +#ifdef RE_ENABLE_I18N +static void +free_charset (re_charset_t *cset) +{ + re_free (cset->mbchars); +# ifdef _LIBC + re_free (cset->coll_syms); + re_free (cset->equiv_classes); + re_free (cset->range_starts); + re_free (cset->range_ends); +# endif + re_free (cset->char_classes); + re_free (cset); +} +#endif /* RE_ENABLE_I18N */ + +/* Functions for binary tree operation. */ + +/* Create a tree node. */ + +static bin_tree_t * +create_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right, + re_token_type_t type) +{ + re_token_t t; +#if defined GCC_LINT || defined lint + memset (&t, 0, sizeof t); +#endif + t.type = type; + return create_token_tree (dfa, left, right, &t); +} + +static bin_tree_t * +create_token_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right, + const re_token_t *token) +{ + bin_tree_t *tree; + if (BE (dfa->str_tree_storage_idx == BIN_TREE_STORAGE_SIZE, 0)) + { + bin_tree_storage_t *storage = re_malloc (bin_tree_storage_t, 1); + + if (storage == NULL) + return NULL; + storage->next = dfa->str_tree_storage; + dfa->str_tree_storage = storage; + dfa->str_tree_storage_idx = 0; + } + tree = &dfa->str_tree_storage->data[dfa->str_tree_storage_idx++]; + + tree->parent = NULL; + tree->left = left; + tree->right = right; + tree->token = *token; + tree->token.duplicated = 0; + tree->token.opt_subexp = 0; + tree->first = NULL; + tree->next = NULL; + tree->node_idx = -1; + + if (left != NULL) + left->parent = tree; + if (right != NULL) + right->parent = tree; + return tree; +} + +/* Mark the tree SRC as an optional subexpression. + To be called from preorder or postorder. */ + +static reg_errcode_t +mark_opt_subexp (void *extra, bin_tree_t *node) +{ + Idx idx = (uintptr_t) extra; + if (node->token.type == SUBEXP && node->token.opr.idx == idx) + node->token.opt_subexp = 1; + + return REG_NOERROR; +} + +/* Free the allocated memory inside NODE. */ + +static void +free_token (re_token_t *node) +{ +#ifdef RE_ENABLE_I18N + if (node->type == COMPLEX_BRACKET && node->duplicated == 0) + free_charset (node->opr.mbcset); + else +#endif /* RE_ENABLE_I18N */ + if (node->type == SIMPLE_BRACKET && node->duplicated == 0) + re_free (node->opr.sbcset); +} + +/* Worker function for tree walking. Free the allocated memory inside NODE + and its children. */ + +static reg_errcode_t +free_tree (void *extra, bin_tree_t *node) +{ + free_token (&node->token); + return REG_NOERROR; +} + + +/* Duplicate the node SRC, and return new node. This is a preorder + visit similar to the one implemented by the generic visitor, but + we need more infrastructure to maintain two parallel trees --- so, + it's easier to duplicate. */ + +static bin_tree_t * +duplicate_tree (const bin_tree_t *root, re_dfa_t *dfa) +{ + const bin_tree_t *node; + bin_tree_t *dup_root; + bin_tree_t **p_new = &dup_root, *dup_node = root->parent; + + for (node = root; ; ) + { + /* Create a new tree and link it back to the current parent. */ + *p_new = create_token_tree (dfa, NULL, NULL, &node->token); + if (*p_new == NULL) + return NULL; + (*p_new)->parent = dup_node; + (*p_new)->token.duplicated = 1; + dup_node = *p_new; + + /* Go to the left node, or up and to the right. */ + if (node->left) + { + node = node->left; + p_new = &dup_node->left; + } + else + { + const bin_tree_t *prev = NULL; + while (node->right == prev || node->right == NULL) + { + prev = node; + node = node->parent; + dup_node = dup_node->parent; + if (!node) + return dup_root; + } + node = node->right; + p_new = &dup_node->right; + } + } +} diff --git a/local/recipes/tools/diffutils/source/lib/regex.c b/local/recipes/tools/diffutils/source/lib/regex.c new file mode 100644 index 0000000000..b46308b067 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/regex.c @@ -0,0 +1,81 @@ +/* Extended regular expression matching and search library. + Copyright (C) 2002-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LIBC +# include <config.h> + +# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ +# pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" +# endif +# if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__ +# pragma GCC diagnostic ignored "-Wold-style-definition" +# pragma GCC diagnostic ignored "-Wtype-limits" +# endif +#endif + +/* Make sure no one compiles this code with a C++ compiler. */ +#if defined __cplusplus && defined _LIBC +# error "This is C code, use a C compiler" +#endif + +#ifdef _LIBC +/* We have to keep the namespace clean. */ +# define regfree(preg) __regfree (preg) +# define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef) +# define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags) +# define regerror(errcode, preg, errbuf, errbuf_size) \ + __regerror(errcode, preg, errbuf, errbuf_size) +# define re_set_registers(bu, re, nu, st, en) \ + __re_set_registers (bu, re, nu, st, en) +# define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \ + __re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) +# define re_match(bufp, string, size, pos, regs) \ + __re_match (bufp, string, size, pos, regs) +# define re_search(bufp, string, size, startpos, range, regs) \ + __re_search (bufp, string, size, startpos, range, regs) +# define re_compile_pattern(pattern, length, bufp) \ + __re_compile_pattern (pattern, length, bufp) +# define re_set_syntax(syntax) __re_set_syntax (syntax) +# define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \ + __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop) +# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp) + +# include "../locale/localeinfo.h" +#endif + +/* On some systems, limits.h sets RE_DUP_MAX to a lower value than + GNU regex allows. Include it before <regex.h>, which correctly + #undefs RE_DUP_MAX and sets it to the right value. */ +#include <limits.h> + +#include <regex.h> +#include "regex_internal.h" + +#include "regex_internal.c" +#include "regcomp.c" +#include "regexec.c" + +/* Binary backward compatibility. */ +#if _LIBC +# include <shlib-compat.h> +# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3) +link_warning (re_max_failures, "the 're_max_failures' variable is obsolete and will go away.") +int re_max_failures = 2000; +# endif +#endif diff --git a/local/recipes/tools/diffutils/source/lib/regex.h b/local/recipes/tools/diffutils/source/lib/regex.h new file mode 100644 index 0000000000..18b8cbdc2c --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/regex.h @@ -0,0 +1,659 @@ +/* Definitions for data structures and routines for the regular + expression library. + Copyright (C) 1985, 1989-1993, 1995-1998, 2000-2003, 2005-2017 Free Software + Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _REGEX_H +#define _REGEX_H 1 + +#include <sys/types.h> + +/* Allow the use in C++ code. */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Define __USE_GNU to declare GNU extensions that violate the + POSIX name space rules. */ +#ifdef _GNU_SOURCE +# define __USE_GNU 1 +#endif + +#ifdef _REGEX_LARGE_OFFSETS + +/* Use types and values that are wide enough to represent signed and + unsigned byte offsets in memory. This currently works only when + the regex code is used outside of the GNU C library; it is not yet + supported within glibc itself, and glibc users should not define + _REGEX_LARGE_OFFSETS. */ + +/* The type of object sizes. */ +typedef size_t __re_size_t; + +/* The type of object sizes, in places where the traditional code + uses unsigned long int. */ +typedef size_t __re_long_size_t; + +#else + +/* The traditional GNU regex implementation mishandles strings longer + than INT_MAX. */ +typedef unsigned int __re_size_t; +typedef unsigned long int __re_long_size_t; + +#endif + +/* The following two types have to be signed and unsigned integer type + wide enough to hold a value of a pointer. For most ANSI compilers + ptrdiff_t and size_t should be likely OK. Still size of these two + types is 2 for Microsoft C. Ugh... */ +typedef long int s_reg_t; +typedef unsigned long int active_reg_t; + +/* The following bits are used to determine the regexp syntax we + recognize. The set/not-set meanings are chosen so that Emacs syntax + remains the value 0. The bits are given in alphabetical order, and + the definitions shifted by one from the previous bit; thus, when we + add or remove a bit, only one other definition need change. */ +typedef unsigned long int reg_syntax_t; + +#ifdef __USE_GNU +/* If this bit is not set, then \ inside a bracket expression is literal. + If set, then such a \ quotes the following character. */ +# define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1) + +/* If this bit is not set, then + and ? are operators, and \+ and \? are + literals. + If set, then \+ and \? are operators and + and ? are literals. */ +# define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1) + +/* If this bit is set, then character classes are supported. They are: + [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:], + [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:]. + If not set, then character classes are not supported. */ +# define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1) + +/* If this bit is set, then ^ and $ are always anchors (outside bracket + expressions, of course). + If this bit is not set, then it depends: + ^ is an anchor if it is at the beginning of a regular + expression or after an open-group or an alternation operator; + $ is an anchor if it is at the end of a regular expression, or + before a close-group or an alternation operator. + + This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because + POSIX draft 11.2 says that * etc. in leading positions is undefined. + We already implemented a previous draft which made those constructs + invalid, though, so we haven't changed the code back. */ +# define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1) + +/* If this bit is set, then special characters are always special + regardless of where they are in the pattern. + If this bit is not set, then special characters are special only in + some contexts; otherwise they are ordinary. Specifically, + * + ? and intervals are only special when not after the beginning, + open-group, or alternation operator. */ +# define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1) + +/* If this bit is set, then *, +, ?, and { cannot be first in an re or + immediately after an alternation or begin-group operator. */ +# define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1) + +/* If this bit is set, then . matches newline. + If not set, then it doesn't. */ +# define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1) + +/* If this bit is set, then . doesn't match NUL. + If not set, then it does. */ +# define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1) + +/* If this bit is set, nonmatching lists [^...] do not match newline. + If not set, they do. */ +# define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1) + +/* If this bit is set, either \{...\} or {...} defines an + interval, depending on RE_NO_BK_BRACES. + If not set, \{, \}, {, and } are literals. */ +# define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1) + +/* If this bit is set, +, ? and | aren't recognized as operators. + If not set, they are. */ +# define RE_LIMITED_OPS (RE_INTERVALS << 1) + +/* If this bit is set, newline is an alternation operator. + If not set, newline is literal. */ +# define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1) + +/* If this bit is set, then '{...}' defines an interval, and \{ and \} + are literals. + If not set, then '\{...\}' defines an interval. */ +# define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1) + +/* If this bit is set, (...) defines a group, and \( and \) are literals. + If not set, \(...\) defines a group, and ( and ) are literals. */ +# define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1) + +/* If this bit is set, then \<digit> matches <digit>. + If not set, then \<digit> is a back-reference. */ +# define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1) + +/* If this bit is set, then | is an alternation operator, and \| is literal. + If not set, then \| is an alternation operator, and | is literal. */ +# define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1) + +/* If this bit is set, then an ending range point collating higher + than the starting range point, as in [z-a], is invalid. + If not set, then when ending range point collates higher than the + starting range point, the range is ignored. */ +# define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1) + +/* If this bit is set, then an unmatched ) is ordinary. + If not set, then an unmatched ) is invalid. */ +# define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1) + +/* If this bit is set, succeed as soon as we match the whole pattern, + without further backtracking. */ +# define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1) + +/* If this bit is set, do not process the GNU regex operators. + If not set, then the GNU regex operators are recognized. */ +# define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1) + +/* If this bit is set, turn on internal regex debugging. + If not set, and debugging was on, turn it off. + This only works if regex.c is compiled -DDEBUG. + We define this bit always, so that all that's needed to turn on + debugging is to recompile regex.c; the calling code can always have + this bit set, and it won't affect anything in the normal case. */ +# define RE_DEBUG (RE_NO_GNU_OPS << 1) + +/* If this bit is set, a syntactically invalid interval is treated as + a string of ordinary characters. For example, the ERE 'a{1' is + treated as 'a\{1'. */ +# define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1) + +/* If this bit is set, then ignore case when matching. + If not set, then case is significant. */ +# define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1) + +/* This bit is used internally like RE_CONTEXT_INDEP_ANCHORS but only + for ^, because it is difficult to scan the regex backwards to find + whether ^ should be special. */ +# define RE_CARET_ANCHORS_HERE (RE_ICASE << 1) + +/* If this bit is set, then \{ cannot be first in a regex or + immediately after an alternation, open-group or \} operator. */ +# define RE_CONTEXT_INVALID_DUP (RE_CARET_ANCHORS_HERE << 1) + +/* If this bit is set, then no_sub will be set to 1 during + re_compile_pattern. */ +# define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1) +#endif + +/* This global variable defines the particular regexp syntax to use (for + some interfaces). When a regexp is compiled, the syntax used is + stored in the pattern buffer, so changing this does not affect + already-compiled regexps. */ +extern reg_syntax_t re_syntax_options; + +#ifdef __USE_GNU +/* Define combinations of the above bits for the standard possibilities. + (The [[[ comments delimit what gets put into the Texinfo file, so + don't delete them!) */ +/* [[[begin syntaxes]]] */ +# define RE_SYNTAX_EMACS 0 + +# define RE_SYNTAX_AWK \ + (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \ + | RE_NO_BK_PARENS | RE_NO_BK_REFS \ + | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \ + | RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \ + | RE_CHAR_CLASSES \ + | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS) + +# define RE_SYNTAX_GNU_AWK \ + ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \ + | RE_INVALID_INTERVAL_ORD) \ + & ~(RE_DOT_NOT_NULL | RE_CONTEXT_INDEP_OPS \ + | RE_CONTEXT_INVALID_OPS )) + +# define RE_SYNTAX_POSIX_AWK \ + (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \ + | RE_INTERVALS | RE_NO_GNU_OPS \ + | RE_INVALID_INTERVAL_ORD) + +# define RE_SYNTAX_GREP \ + ((RE_SYNTAX_POSIX_BASIC | RE_NEWLINE_ALT) \ + & ~(RE_CONTEXT_INVALID_DUP | RE_DOT_NOT_NULL)) + +# define RE_SYNTAX_EGREP \ + ((RE_SYNTAX_POSIX_EXTENDED | RE_INVALID_INTERVAL_ORD | RE_NEWLINE_ALT) \ + & ~(RE_CONTEXT_INVALID_OPS | RE_DOT_NOT_NULL)) + +/* POSIX grep -E behavior is no longer incompatible with GNU. */ +# define RE_SYNTAX_POSIX_EGREP \ + RE_SYNTAX_EGREP + +/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */ +# define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC + +# define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC + +/* Syntax bits common to both basic and extended POSIX regex syntax. */ +# define _RE_SYNTAX_POSIX_COMMON \ + (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \ + | RE_INTERVALS | RE_NO_EMPTY_RANGES) + +# define RE_SYNTAX_POSIX_BASIC \ + (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM | RE_CONTEXT_INVALID_DUP) + +/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes + RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this + isn't minimal, since other operators, such as \`, aren't disabled. */ +# define RE_SYNTAX_POSIX_MINIMAL_BASIC \ + (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS) + +# define RE_SYNTAX_POSIX_EXTENDED \ + (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \ + | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \ + | RE_NO_BK_PARENS | RE_NO_BK_VBAR \ + | RE_CONTEXT_INVALID_OPS | RE_UNMATCHED_RIGHT_PAREN_ORD) + +/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INDEP_OPS is + removed and RE_NO_BK_REFS is added. */ +# define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \ + (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \ + | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \ + | RE_NO_BK_PARENS | RE_NO_BK_REFS \ + | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD) +/* [[[end syntaxes]]] */ + +/* Maximum number of duplicates an interval can allow. POSIX-conforming + systems might define this in <limits.h>, but we want our + value, so remove any previous define. */ +# ifdef _REGEX_INCLUDE_LIMITS_H +# include <limits.h> +# endif +# ifdef RE_DUP_MAX +# undef RE_DUP_MAX +# endif + +/* RE_DUP_MAX is 2**15 - 1 because an earlier implementation stored + the counter as a 2-byte signed integer. This is no longer true, so + RE_DUP_MAX could be increased to (INT_MAX / 10 - 1), or to + ((SIZE_MAX - 9) / 10) if _REGEX_LARGE_OFFSETS is defined. + However, there would be a huge performance problem if someone + actually used a pattern like a\{214748363\}, so RE_DUP_MAX retains + its historical value. */ +# define RE_DUP_MAX (0x7fff) +#endif + + +/* POSIX 'cflags' bits (i.e., information for 'regcomp'). */ + +/* If this bit is set, then use extended regular expression syntax. + If not set, then use basic regular expression syntax. */ +#define REG_EXTENDED 1 + +/* If this bit is set, then ignore case when matching. + If not set, then case is significant. */ +#define REG_ICASE (1 << 1) + +/* If this bit is set, then anchors do not match at newline + characters in the string. + If not set, then anchors do match at newlines. */ +#define REG_NEWLINE (1 << 2) + +/* If this bit is set, then report only success or fail in regexec. + If not set, then returns differ between not matching and errors. */ +#define REG_NOSUB (1 << 3) + + +/* POSIX 'eflags' bits (i.e., information for regexec). */ + +/* If this bit is set, then the beginning-of-line operator doesn't match + the beginning of the string (presumably because it's not the + beginning of a line). + If not set, then the beginning-of-line operator does match the + beginning of the string. */ +#define REG_NOTBOL 1 + +/* Like REG_NOTBOL, except for the end-of-line. */ +#define REG_NOTEOL (1 << 1) + +/* Use PMATCH[0] to delimit the start and end of the search in the + buffer. */ +#define REG_STARTEND (1 << 2) + + +/* If any error codes are removed, changed, or added, update the + '__re_error_msgid' table in regcomp.c. */ + +typedef enum +{ + _REG_ENOSYS = -1, /* This will never happen for this implementation. */ + _REG_NOERROR = 0, /* Success. */ + _REG_NOMATCH, /* Didn't find a match (for regexec). */ + + /* POSIX regcomp return error codes. (In the order listed in the + standard.) */ + _REG_BADPAT, /* Invalid pattern. */ + _REG_ECOLLATE, /* Invalid collating element. */ + _REG_ECTYPE, /* Invalid character class name. */ + _REG_EESCAPE, /* Trailing backslash. */ + _REG_ESUBREG, /* Invalid back reference. */ + _REG_EBRACK, /* Unmatched left bracket. */ + _REG_EPAREN, /* Parenthesis imbalance. */ + _REG_EBRACE, /* Unmatched \{. */ + _REG_BADBR, /* Invalid contents of \{\}. */ + _REG_ERANGE, /* Invalid range end. */ + _REG_ESPACE, /* Ran out of memory. */ + _REG_BADRPT, /* No preceding re for repetition op. */ + + /* Error codes we've added. */ + _REG_EEND, /* Premature end. */ + _REG_ESIZE, /* Too large (e.g., repeat count too large). */ + _REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */ +} reg_errcode_t; + +#if defined _XOPEN_SOURCE || defined __USE_XOPEN2K +# define REG_ENOSYS _REG_ENOSYS +#endif +#define REG_NOERROR _REG_NOERROR +#define REG_NOMATCH _REG_NOMATCH +#define REG_BADPAT _REG_BADPAT +#define REG_ECOLLATE _REG_ECOLLATE +#define REG_ECTYPE _REG_ECTYPE +#define REG_EESCAPE _REG_EESCAPE +#define REG_ESUBREG _REG_ESUBREG +#define REG_EBRACK _REG_EBRACK +#define REG_EPAREN _REG_EPAREN +#define REG_EBRACE _REG_EBRACE +#define REG_BADBR _REG_BADBR +#define REG_ERANGE _REG_ERANGE +#define REG_ESPACE _REG_ESPACE +#define REG_BADRPT _REG_BADRPT +#define REG_EEND _REG_EEND +#define REG_ESIZE _REG_ESIZE +#define REG_ERPAREN _REG_ERPAREN + +/* This data structure represents a compiled pattern. Before calling + the pattern compiler, the fields 'buffer', 'allocated', 'fastmap', + and 'translate' can be set. After the pattern has been compiled, + the fields 're_nsub', 'not_bol' and 'not_eol' are available. All + other fields are private to the regex routines. */ + +#ifndef RE_TRANSLATE_TYPE +# define __RE_TRANSLATE_TYPE unsigned char * +# ifdef __USE_GNU +# define RE_TRANSLATE_TYPE __RE_TRANSLATE_TYPE +# endif +#endif + +#ifdef __USE_GNU +# define __REPB_PREFIX(name) name +#else +# define __REPB_PREFIX(name) __##name +#endif + +struct re_pattern_buffer +{ + /* Space that holds the compiled pattern. The type + 'struct re_dfa_t' is private and is not declared here. */ + struct re_dfa_t *__REPB_PREFIX(buffer); + + /* Number of bytes to which 'buffer' points. */ + __re_long_size_t __REPB_PREFIX(allocated); + + /* Number of bytes actually used in 'buffer'. */ + __re_long_size_t __REPB_PREFIX(used); + + /* Syntax setting with which the pattern was compiled. */ + reg_syntax_t __REPB_PREFIX(syntax); + + /* Pointer to a fastmap, if any, otherwise zero. re_search uses the + fastmap, if there is one, to skip over impossible starting points + for matches. */ + char *__REPB_PREFIX(fastmap); + + /* Either a translate table to apply to all characters before + comparing them, or zero for no translation. The translation is + applied to a pattern when it is compiled and to a string when it + is matched. */ + __RE_TRANSLATE_TYPE __REPB_PREFIX(translate); + + /* Number of subexpressions found by the compiler. */ + size_t re_nsub; + + /* Zero if this pattern cannot match the empty string, one else. + Well, in truth it's used only in 're_search_2', to see whether or + not we should use the fastmap, so we don't set this absolutely + perfectly; see 're_compile_fastmap' (the "duplicate" case). */ + unsigned __REPB_PREFIX(can_be_null) : 1; + + /* If REGS_UNALLOCATED, allocate space in the 'regs' structure + for 'max (RE_NREGS, re_nsub + 1)' groups. + If REGS_REALLOCATE, reallocate space if necessary. + If REGS_FIXED, use what's there. */ +#ifdef __USE_GNU +# define REGS_UNALLOCATED 0 +# define REGS_REALLOCATE 1 +# define REGS_FIXED 2 +#endif + unsigned __REPB_PREFIX(regs_allocated) : 2; + + /* Set to zero when 're_compile_pattern' compiles a pattern; set to + one by 're_compile_fastmap' if it updates the fastmap. */ + unsigned __REPB_PREFIX(fastmap_accurate) : 1; + + /* If set, 're_match_2' does not return information about + subexpressions. */ + unsigned __REPB_PREFIX(no_sub) : 1; + + /* If set, a beginning-of-line anchor doesn't match at the beginning + of the string. */ + unsigned __REPB_PREFIX(not_bol) : 1; + + /* Similarly for an end-of-line anchor. */ + unsigned __REPB_PREFIX(not_eol) : 1; + + /* If true, an anchor at a newline matches. */ + unsigned __REPB_PREFIX(newline_anchor) : 1; +}; + +typedef struct re_pattern_buffer regex_t; + +/* Type for byte offsets within the string. POSIX mandates this. */ +#ifdef _REGEX_LARGE_OFFSETS +/* POSIX 1003.1-2008 requires that regoff_t be at least as wide as + ptrdiff_t and ssize_t. We don't know of any hosts where ptrdiff_t + is wider than ssize_t, so ssize_t is safe. ptrdiff_t is not + visible here, so use ssize_t. */ +typedef ssize_t regoff_t; +#else +/* The traditional GNU regex implementation mishandles strings longer + than INT_MAX. */ +typedef int regoff_t; +#endif + + +#ifdef __USE_GNU +/* This is the structure we store register match data in. See + regex.texinfo for a full description of what registers match. */ +struct re_registers +{ + __re_size_t num_regs; + regoff_t *start; + regoff_t *end; +}; + + +/* If 'regs_allocated' is REGS_UNALLOCATED in the pattern buffer, + 're_match_2' returns information about at least this many registers + the first time a 'regs' structure is passed. */ +# ifndef RE_NREGS +# define RE_NREGS 30 +# endif +#endif + + +/* POSIX specification for registers. Aside from the different names than + 're_registers', POSIX uses an array of structures, instead of a + structure of arrays. */ +typedef struct +{ + regoff_t rm_so; /* Byte offset from string's start to substring's start. */ + regoff_t rm_eo; /* Byte offset from string's start to substring's end. */ +} regmatch_t; + +/* Declarations for routines. */ + +#ifdef __USE_GNU +/* Sets the current default syntax to SYNTAX, and return the old syntax. + You can also simply assign to the 're_syntax_options' variable. */ +extern reg_syntax_t re_set_syntax (reg_syntax_t __syntax); + +/* Compile the regular expression PATTERN, with length LENGTH + and syntax given by the global 're_syntax_options', into the buffer + BUFFER. Return NULL if successful, and an error string if not. + + To free the allocated storage, you must call 'regfree' on BUFFER. + Note that the translate table must either have been initialized by + 'regcomp', with a malloc'ed value, or set to NULL before calling + 'regfree'. */ +extern const char *re_compile_pattern (const char *__pattern, size_t __length, + struct re_pattern_buffer *__buffer); + + +/* Compile a fastmap for the compiled pattern in BUFFER; used to + accelerate searches. Return 0 if successful and -2 if was an + internal error. */ +extern int re_compile_fastmap (struct re_pattern_buffer *__buffer); + + +/* Search in the string STRING (with length LENGTH) for the pattern + compiled into BUFFER. Start searching at position START, for RANGE + characters. Return the starting position of the match, -1 for no + match, or -2 for an internal error. Also return register + information in REGS (if REGS and BUFFER->no_sub are nonzero). */ +extern regoff_t re_search (struct re_pattern_buffer *__buffer, + const char *__String, regoff_t __length, + regoff_t __start, regoff_t __range, + struct re_registers *__regs); + + +/* Like 're_search', but search in the concatenation of STRING1 and + STRING2. Also, stop searching at index START + STOP. */ +extern regoff_t re_search_2 (struct re_pattern_buffer *__buffer, + const char *__string1, regoff_t __length1, + const char *__string2, regoff_t __length2, + regoff_t __start, regoff_t __range, + struct re_registers *__regs, + regoff_t __stop); + + +/* Like 're_search', but return how many characters in STRING the regexp + in BUFFER matched, starting at position START. */ +extern regoff_t re_match (struct re_pattern_buffer *__buffer, + const char *__String, regoff_t __length, + regoff_t __start, struct re_registers *__regs); + + +/* Relates to 're_match' as 're_search_2' relates to 're_search'. */ +extern regoff_t re_match_2 (struct re_pattern_buffer *__buffer, + const char *__string1, regoff_t __length1, + const char *__string2, regoff_t __length2, + regoff_t __start, struct re_registers *__regs, + regoff_t __stop); + + +/* Set REGS to hold NUM_REGS registers, storing them in STARTS and + ENDS. Subsequent matches using BUFFER and REGS will use this memory + for recording register information. STARTS and ENDS must be + allocated with malloc, and must each be at least 'NUM_REGS * sizeof + (regoff_t)' bytes long. + + If NUM_REGS == 0, then subsequent matches should allocate their own + register data. + + Unless this function is called, the first search or match using + BUFFER will allocate its own register data, without + freeing the old data. */ +extern void re_set_registers (struct re_pattern_buffer *__buffer, + struct re_registers *__regs, + __re_size_t __num_regs, + regoff_t *__starts, regoff_t *__ends); +#endif /* Use GNU */ + +#if defined _REGEX_RE_COMP || (defined _LIBC && defined __USE_MISC) +# ifndef _CRAY +/* 4.2 bsd compatibility. */ +extern char *re_comp (const char *); +extern int re_exec (const char *); +# endif +#endif + +/* GCC 2.95 and later have "__restrict"; C99 compilers have + "restrict", and "configure" may have defined "restrict". + Other compilers use __restrict, __restrict__, and _Restrict, and + 'configure' might #define 'restrict' to those words, so pick a + different name. */ +#ifndef _Restrict_ +# if 199901L <= __STDC_VERSION__ +# define _Restrict_ restrict +# elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__) +# define _Restrict_ __restrict +# else +# define _Restrict_ +# endif +#endif +/* gcc 3.1 and up support the [restrict] syntax. Don't trust + sys/cdefs.h's definition of __restrict_arr, though, as it + mishandles gcc -ansi -pedantic. */ +#ifndef _Restrict_arr_ +# if ((199901L <= __STDC_VERSION__ \ + || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__)) \ + && !defined __STRICT_ANSI__)) \ + && !defined __GNUG__) +# define _Restrict_arr_ _Restrict_ +# else +# define _Restrict_arr_ +# endif +#endif + +/* POSIX compatibility. */ +extern int regcomp (regex_t *_Restrict_ __preg, + const char *_Restrict_ __pattern, + int __cflags); + +extern int regexec (const regex_t *_Restrict_ __preg, + const char *_Restrict_ __String, size_t __nmatch, + regmatch_t __pmatch[_Restrict_arr_], + int __eflags); + +extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg, + char *_Restrict_ __errbuf, size_t __errbuf_size); + +extern void regfree (regex_t *__preg); + + +#ifdef __cplusplus +} +#endif /* C++ */ + +#endif /* regex.h */ diff --git a/local/recipes/tools/diffutils/source/lib/regex_internal.c b/local/recipes/tools/diffutils/source/lib/regex_internal.c new file mode 100644 index 0000000000..9546b78789 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/regex_internal.c @@ -0,0 +1,1741 @@ +/* Extended regular expression matching and search library. + Copyright (C) 2002-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +static void re_string_construct_common (const char *str, Idx len, + re_string_t *pstr, + RE_TRANSLATE_TYPE trans, bool icase, + const re_dfa_t *dfa) internal_function; +static re_dfastate_t *create_ci_newstate (const re_dfa_t *dfa, + const re_node_set *nodes, + re_hashval_t hash) internal_function; +static re_dfastate_t *create_cd_newstate (const re_dfa_t *dfa, + const re_node_set *nodes, + unsigned int context, + re_hashval_t hash) internal_function; + +/* Functions for string operation. */ + +/* This function allocate the buffers. It is necessary to call + re_string_reconstruct before using the object. */ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +re_string_allocate (re_string_t *pstr, const char *str, Idx len, Idx init_len, + RE_TRANSLATE_TYPE trans, bool icase, const re_dfa_t *dfa) +{ + reg_errcode_t ret; + Idx init_buf_len; + + /* Ensure at least one character fits into the buffers. */ + if (init_len < dfa->mb_cur_max) + init_len = dfa->mb_cur_max; + init_buf_len = (len + 1 < init_len) ? len + 1: init_len; + re_string_construct_common (str, len, pstr, trans, icase, dfa); + + ret = re_string_realloc_buffers (pstr, init_buf_len); + if (BE (ret != REG_NOERROR, 0)) + return ret; + + pstr->word_char = dfa->word_char; + pstr->word_ops_used = dfa->word_ops_used; + pstr->mbs = pstr->mbs_allocated ? pstr->mbs : (unsigned char *) str; + pstr->valid_len = (pstr->mbs_allocated || dfa->mb_cur_max > 1) ? 0 : len; + pstr->valid_raw_len = pstr->valid_len; + return REG_NOERROR; +} + +/* This function allocate the buffers, and initialize them. */ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +re_string_construct (re_string_t *pstr, const char *str, Idx len, + RE_TRANSLATE_TYPE trans, bool icase, const re_dfa_t *dfa) +{ + reg_errcode_t ret; + memset (pstr, '\0', sizeof (re_string_t)); + re_string_construct_common (str, len, pstr, trans, icase, dfa); + + if (len > 0) + { + ret = re_string_realloc_buffers (pstr, len + 1); + if (BE (ret != REG_NOERROR, 0)) + return ret; + } + pstr->mbs = pstr->mbs_allocated ? pstr->mbs : (unsigned char *) str; + + if (icase) + { +#ifdef RE_ENABLE_I18N + if (dfa->mb_cur_max > 1) + { + while (1) + { + ret = build_wcs_upper_buffer (pstr); + if (BE (ret != REG_NOERROR, 0)) + return ret; + if (pstr->valid_raw_len >= len) + break; + if (pstr->bufs_len > pstr->valid_len + dfa->mb_cur_max) + break; + ret = re_string_realloc_buffers (pstr, pstr->bufs_len * 2); + if (BE (ret != REG_NOERROR, 0)) + return ret; + } + } + else +#endif /* RE_ENABLE_I18N */ + build_upper_buffer (pstr); + } + else + { +#ifdef RE_ENABLE_I18N + if (dfa->mb_cur_max > 1) + build_wcs_buffer (pstr); + else +#endif /* RE_ENABLE_I18N */ + { + if (trans != NULL) + re_string_translate_buffer (pstr); + else + { + pstr->valid_len = pstr->bufs_len; + pstr->valid_raw_len = pstr->bufs_len; + } + } + } + + return REG_NOERROR; +} + +/* Helper functions for re_string_allocate, and re_string_construct. */ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +re_string_realloc_buffers (re_string_t *pstr, Idx new_buf_len) +{ +#ifdef RE_ENABLE_I18N + if (pstr->mb_cur_max > 1) + { + wint_t *new_wcs; + + /* Avoid overflow in realloc. */ + const size_t max_object_size = MAX (sizeof (wint_t), sizeof (Idx)); + if (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) < new_buf_len, 0)) + return REG_ESPACE; + + new_wcs = re_realloc (pstr->wcs, wint_t, new_buf_len); + if (BE (new_wcs == NULL, 0)) + return REG_ESPACE; + pstr->wcs = new_wcs; + if (pstr->offsets != NULL) + { + Idx *new_offsets = re_realloc (pstr->offsets, Idx, new_buf_len); + if (BE (new_offsets == NULL, 0)) + return REG_ESPACE; + pstr->offsets = new_offsets; + } + } +#endif /* RE_ENABLE_I18N */ + if (pstr->mbs_allocated) + { + unsigned char *new_mbs = re_realloc (pstr->mbs, unsigned char, + new_buf_len); + if (BE (new_mbs == NULL, 0)) + return REG_ESPACE; + pstr->mbs = new_mbs; + } + pstr->bufs_len = new_buf_len; + return REG_NOERROR; +} + + +static void +internal_function +re_string_construct_common (const char *str, Idx len, re_string_t *pstr, + RE_TRANSLATE_TYPE trans, bool icase, + const re_dfa_t *dfa) +{ + pstr->raw_mbs = (const unsigned char *) str; + pstr->len = len; + pstr->raw_len = len; + pstr->trans = trans; + pstr->icase = icase; + pstr->mbs_allocated = (trans != NULL || icase); + pstr->mb_cur_max = dfa->mb_cur_max; + pstr->is_utf8 = dfa->is_utf8; + pstr->map_notascii = dfa->map_notascii; + pstr->stop = pstr->len; + pstr->raw_stop = pstr->stop; +} + +#ifdef RE_ENABLE_I18N + +/* Build wide character buffer PSTR->WCS. + If the byte sequence of the string are: + <mb1>(0), <mb1>(1), <mb2>(0), <mb2>(1), <sb3> + Then wide character buffer will be: + <wc1> , WEOF , <wc2> , WEOF , <wc3> + We use WEOF for padding, they indicate that the position isn't + a first byte of a multibyte character. + + Note that this function assumes PSTR->VALID_LEN elements are already + built and starts from PSTR->VALID_LEN. */ + +static void +internal_function +build_wcs_buffer (re_string_t *pstr) +{ +#ifdef _LIBC + unsigned char buf[MB_LEN_MAX]; + assert (MB_LEN_MAX >= pstr->mb_cur_max); +#else + unsigned char buf[64]; +#endif + mbstate_t prev_st; + Idx byte_idx, end_idx, remain_len; + size_t mbclen; + + /* Build the buffers from pstr->valid_len to either pstr->len or + pstr->bufs_len. */ + end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len; + for (byte_idx = pstr->valid_len; byte_idx < end_idx;) + { + wchar_t wc; + const char *p; + + remain_len = end_idx - byte_idx; + prev_st = pstr->cur_state; + /* Apply the translation if we need. */ + if (BE (pstr->trans != NULL, 0)) + { + int i, ch; + + for (i = 0; i < pstr->mb_cur_max && i < remain_len; ++i) + { + ch = pstr->raw_mbs [pstr->raw_mbs_idx + byte_idx + i]; + buf[i] = pstr->mbs[byte_idx + i] = pstr->trans[ch]; + } + p = (const char *) buf; + } + else + p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx; + mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state); + if (BE (mbclen == (size_t) -1 || mbclen == 0 + || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len), 0)) + { + /* We treat these cases as a singlebyte character. */ + mbclen = 1; + wc = (wchar_t) pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]; + if (BE (pstr->trans != NULL, 0)) + wc = pstr->trans[wc]; + pstr->cur_state = prev_st; + } + else if (BE (mbclen == (size_t) -2, 0)) + { + /* The buffer doesn't have enough space, finish to build. */ + pstr->cur_state = prev_st; + break; + } + + /* Write wide character and padding. */ + pstr->wcs[byte_idx++] = wc; + /* Write paddings. */ + for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;) + pstr->wcs[byte_idx++] = WEOF; + } + pstr->valid_len = byte_idx; + pstr->valid_raw_len = byte_idx; +} + +/* Build wide character buffer PSTR->WCS like build_wcs_buffer, + but for REG_ICASE. */ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +build_wcs_upper_buffer (re_string_t *pstr) +{ + mbstate_t prev_st; + Idx src_idx, byte_idx, end_idx, remain_len; + size_t mbclen; +#ifdef _LIBC + char buf[MB_LEN_MAX]; + assert (MB_LEN_MAX >= pstr->mb_cur_max); +#else + char buf[64]; +#endif + + byte_idx = pstr->valid_len; + end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len; + + /* The following optimization assumes that ASCII characters can be + mapped to wide characters with a simple cast. */ + if (! pstr->map_notascii && pstr->trans == NULL && !pstr->offsets_needed) + { + while (byte_idx < end_idx) + { + wchar_t wc; + + if (isascii (pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]) + && mbsinit (&pstr->cur_state)) + { + /* In case of a singlebyte character. */ + pstr->mbs[byte_idx] + = toupper (pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]); + /* The next step uses the assumption that wchar_t is encoded + ASCII-safe: all ASCII values can be converted like this. */ + pstr->wcs[byte_idx] = (wchar_t) pstr->mbs[byte_idx]; + ++byte_idx; + continue; + } + + remain_len = end_idx - byte_idx; + prev_st = pstr->cur_state; + mbclen = __mbrtowc (&wc, + ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx + + byte_idx), remain_len, &pstr->cur_state); + if (BE (mbclen < (size_t) -2, 1)) + { + wchar_t wcu = __towupper (wc); + if (wcu != wc) + { + size_t mbcdlen; + + mbcdlen = __wcrtomb (buf, wcu, &prev_st); + if (BE (mbclen == mbcdlen, 1)) + memcpy (pstr->mbs + byte_idx, buf, mbclen); + else + { + src_idx = byte_idx; + goto offsets_needed; + } + } + else + memcpy (pstr->mbs + byte_idx, + pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx, mbclen); + pstr->wcs[byte_idx++] = wcu; + /* Write paddings. */ + for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;) + pstr->wcs[byte_idx++] = WEOF; + } + else if (mbclen == (size_t) -1 || mbclen == 0 + || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len)) + { + /* It is an invalid character, an incomplete character + at the end of the string, or '\0'. Just use the byte. */ + int ch = pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]; + pstr->mbs[byte_idx] = ch; + /* And also cast it to wide char. */ + pstr->wcs[byte_idx++] = (wchar_t) ch; + if (BE (mbclen == (size_t) -1, 0)) + pstr->cur_state = prev_st; + } + else + { + /* The buffer doesn't have enough space, finish to build. */ + pstr->cur_state = prev_st; + break; + } + } + pstr->valid_len = byte_idx; + pstr->valid_raw_len = byte_idx; + return REG_NOERROR; + } + else + for (src_idx = pstr->valid_raw_len; byte_idx < end_idx;) + { + wchar_t wc; + const char *p; + offsets_needed: + remain_len = end_idx - byte_idx; + prev_st = pstr->cur_state; + if (BE (pstr->trans != NULL, 0)) + { + int i, ch; + + for (i = 0; i < pstr->mb_cur_max && i < remain_len; ++i) + { + ch = pstr->raw_mbs [pstr->raw_mbs_idx + src_idx + i]; + buf[i] = pstr->trans[ch]; + } + p = (const char *) buf; + } + else + p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + src_idx; + mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state); + if (BE (mbclen < (size_t) -2, 1)) + { + wchar_t wcu = __towupper (wc); + if (wcu != wc) + { + size_t mbcdlen; + + mbcdlen = wcrtomb ((char *) buf, wcu, &prev_st); + if (BE (mbclen == mbcdlen, 1)) + memcpy (pstr->mbs + byte_idx, buf, mbclen); + else if (mbcdlen != (size_t) -1) + { + size_t i; + + if (byte_idx + mbcdlen > pstr->bufs_len) + { + pstr->cur_state = prev_st; + break; + } + + if (pstr->offsets == NULL) + { + pstr->offsets = re_malloc (Idx, pstr->bufs_len); + + if (pstr->offsets == NULL) + return REG_ESPACE; + } + if (!pstr->offsets_needed) + { + for (i = 0; i < (size_t) byte_idx; ++i) + pstr->offsets[i] = i; + pstr->offsets_needed = 1; + } + + memcpy (pstr->mbs + byte_idx, buf, mbcdlen); + pstr->wcs[byte_idx] = wcu; + pstr->offsets[byte_idx] = src_idx; + for (i = 1; i < mbcdlen; ++i) + { + pstr->offsets[byte_idx + i] + = src_idx + (i < mbclen ? i : mbclen - 1); + pstr->wcs[byte_idx + i] = WEOF; + } + pstr->len += mbcdlen - mbclen; + if (pstr->raw_stop > src_idx) + pstr->stop += mbcdlen - mbclen; + end_idx = (pstr->bufs_len > pstr->len) + ? pstr->len : pstr->bufs_len; + byte_idx += mbcdlen; + src_idx += mbclen; + continue; + } + else + memcpy (pstr->mbs + byte_idx, p, mbclen); + } + else + memcpy (pstr->mbs + byte_idx, p, mbclen); + + if (BE (pstr->offsets_needed != 0, 0)) + { + size_t i; + for (i = 0; i < mbclen; ++i) + pstr->offsets[byte_idx + i] = src_idx + i; + } + src_idx += mbclen; + + pstr->wcs[byte_idx++] = wcu; + /* Write paddings. */ + for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;) + pstr->wcs[byte_idx++] = WEOF; + } + else if (mbclen == (size_t) -1 || mbclen == 0 + || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len)) + { + /* It is an invalid character or '\0'. Just use the byte. */ + int ch = pstr->raw_mbs[pstr->raw_mbs_idx + src_idx]; + + if (BE (pstr->trans != NULL, 0)) + ch = pstr->trans [ch]; + pstr->mbs[byte_idx] = ch; + + if (BE (pstr->offsets_needed != 0, 0)) + pstr->offsets[byte_idx] = src_idx; + ++src_idx; + + /* And also cast it to wide char. */ + pstr->wcs[byte_idx++] = (wchar_t) ch; + if (BE (mbclen == (size_t) -1, 0)) + pstr->cur_state = prev_st; + } + else + { + /* The buffer doesn't have enough space, finish to build. */ + pstr->cur_state = prev_st; + break; + } + } + pstr->valid_len = byte_idx; + pstr->valid_raw_len = src_idx; + return REG_NOERROR; +} + +/* Skip characters until the index becomes greater than NEW_RAW_IDX. + Return the index. */ + +static Idx +internal_function +re_string_skip_chars (re_string_t *pstr, Idx new_raw_idx, wint_t *last_wc) +{ + mbstate_t prev_st; + Idx rawbuf_idx; + size_t mbclen; + wint_t wc = WEOF; + + /* Skip the characters which are not necessary to check. */ + for (rawbuf_idx = pstr->raw_mbs_idx + pstr->valid_raw_len; + rawbuf_idx < new_raw_idx;) + { + wchar_t wc2; + Idx remain_len = pstr->raw_len - rawbuf_idx; + prev_st = pstr->cur_state; + mbclen = __mbrtowc (&wc2, (const char *) pstr->raw_mbs + rawbuf_idx, + remain_len, &pstr->cur_state); + if (BE (mbclen == (size_t) -2 || mbclen == (size_t) -1 || mbclen == 0, 0)) + { + /* We treat these cases as a single byte character. */ + if (mbclen == 0 || remain_len == 0) + wc = L'\0'; + else + wc = *(unsigned char *) (pstr->raw_mbs + rawbuf_idx); + mbclen = 1; + pstr->cur_state = prev_st; + } + else + wc = wc2; + /* Then proceed the next character. */ + rawbuf_idx += mbclen; + } + *last_wc = wc; + return rawbuf_idx; +} +#endif /* RE_ENABLE_I18N */ + +/* Build the buffer PSTR->MBS, and apply the translation if we need. + This function is used in case of REG_ICASE. */ + +static void +internal_function +build_upper_buffer (re_string_t *pstr) +{ + Idx char_idx, end_idx; + end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len; + + for (char_idx = pstr->valid_len; char_idx < end_idx; ++char_idx) + { + int ch = pstr->raw_mbs[pstr->raw_mbs_idx + char_idx]; + if (BE (pstr->trans != NULL, 0)) + ch = pstr->trans[ch]; + pstr->mbs[char_idx] = toupper (ch); + } + pstr->valid_len = char_idx; + pstr->valid_raw_len = char_idx; +} + +/* Apply TRANS to the buffer in PSTR. */ + +static void +internal_function +re_string_translate_buffer (re_string_t *pstr) +{ + Idx buf_idx, end_idx; + end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len; + + for (buf_idx = pstr->valid_len; buf_idx < end_idx; ++buf_idx) + { + int ch = pstr->raw_mbs[pstr->raw_mbs_idx + buf_idx]; + pstr->mbs[buf_idx] = pstr->trans[ch]; + } + + pstr->valid_len = buf_idx; + pstr->valid_raw_len = buf_idx; +} + +/* This function re-construct the buffers. + Concretely, convert to wide character in case of pstr->mb_cur_max > 1, + convert to upper case in case of REG_ICASE, apply translation. */ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) +{ + Idx offset; + + if (BE (pstr->raw_mbs_idx <= idx, 0)) + offset = idx - pstr->raw_mbs_idx; + else + { + /* Reset buffer. */ +#ifdef RE_ENABLE_I18N + if (pstr->mb_cur_max > 1) + memset (&pstr->cur_state, '\0', sizeof (mbstate_t)); +#endif /* RE_ENABLE_I18N */ + pstr->len = pstr->raw_len; + pstr->stop = pstr->raw_stop; + pstr->valid_len = 0; + pstr->raw_mbs_idx = 0; + pstr->valid_raw_len = 0; + pstr->offsets_needed = 0; + pstr->tip_context = ((eflags & REG_NOTBOL) ? CONTEXT_BEGBUF + : CONTEXT_NEWLINE | CONTEXT_BEGBUF); + if (!pstr->mbs_allocated) + pstr->mbs = (unsigned char *) pstr->raw_mbs; + offset = idx; + } + + if (BE (offset != 0, 1)) + { + /* Should the already checked characters be kept? */ + if (BE (offset < pstr->valid_raw_len, 1)) + { + /* Yes, move them to the front of the buffer. */ +#ifdef RE_ENABLE_I18N + if (BE (pstr->offsets_needed, 0)) + { + Idx low = 0, high = pstr->valid_len, mid; + do + { + mid = (high + low) / 2; + if (pstr->offsets[mid] > offset) + high = mid; + else if (pstr->offsets[mid] < offset) + low = mid + 1; + else + break; + } + while (low < high); + if (pstr->offsets[mid] < offset) + ++mid; + pstr->tip_context = re_string_context_at (pstr, mid - 1, + eflags); + /* This can be quite complicated, so handle specially + only the common and easy case where the character with + different length representation of lower and upper + case is present at or after offset. */ + if (pstr->valid_len > offset + && mid == offset && pstr->offsets[mid] == offset) + { + memmove (pstr->wcs, pstr->wcs + offset, + (pstr->valid_len - offset) * sizeof (wint_t)); + memmove (pstr->mbs, pstr->mbs + offset, pstr->valid_len - offset); + pstr->valid_len -= offset; + pstr->valid_raw_len -= offset; + for (low = 0; low < pstr->valid_len; low++) + pstr->offsets[low] = pstr->offsets[low + offset] - offset; + } + else + { + /* Otherwise, just find out how long the partial multibyte + character at offset is and fill it with WEOF/255. */ + pstr->len = pstr->raw_len - idx + offset; + pstr->stop = pstr->raw_stop - idx + offset; + pstr->offsets_needed = 0; + while (mid > 0 && pstr->offsets[mid - 1] == offset) + --mid; + while (mid < pstr->valid_len) + if (pstr->wcs[mid] != WEOF) + break; + else + ++mid; + if (mid == pstr->valid_len) + pstr->valid_len = 0; + else + { + pstr->valid_len = pstr->offsets[mid] - offset; + if (pstr->valid_len) + { + for (low = 0; low < pstr->valid_len; ++low) + pstr->wcs[low] = WEOF; + memset (pstr->mbs, 255, pstr->valid_len); + } + } + pstr->valid_raw_len = pstr->valid_len; + } + } + else +#endif + { + pstr->tip_context = re_string_context_at (pstr, offset - 1, + eflags); +#ifdef RE_ENABLE_I18N + if (pstr->mb_cur_max > 1) + memmove (pstr->wcs, pstr->wcs + offset, + (pstr->valid_len - offset) * sizeof (wint_t)); +#endif /* RE_ENABLE_I18N */ + if (BE (pstr->mbs_allocated, 0)) + memmove (pstr->mbs, pstr->mbs + offset, + pstr->valid_len - offset); + pstr->valid_len -= offset; + pstr->valid_raw_len -= offset; +#if defined DEBUG && DEBUG + assert (pstr->valid_len > 0); +#endif + } + } + else + { +#ifdef RE_ENABLE_I18N + /* No, skip all characters until IDX. */ + Idx prev_valid_len = pstr->valid_len; + + if (BE (pstr->offsets_needed, 0)) + { + pstr->len = pstr->raw_len - idx + offset; + pstr->stop = pstr->raw_stop - idx + offset; + pstr->offsets_needed = 0; + } +#endif + pstr->valid_len = 0; +#ifdef RE_ENABLE_I18N + if (pstr->mb_cur_max > 1) + { + Idx wcs_idx; + wint_t wc = WEOF; + + if (pstr->is_utf8) + { + const unsigned char *raw, *p, *end; + + /* Special case UTF-8. Multi-byte chars start with any + byte other than 0x80 - 0xbf. */ + raw = pstr->raw_mbs + pstr->raw_mbs_idx; + end = raw + (offset - pstr->mb_cur_max); + if (end < pstr->raw_mbs) + end = pstr->raw_mbs; + p = raw + offset - 1; +#ifdef _LIBC + /* We know the wchar_t encoding is UCS4, so for the simple + case, ASCII characters, skip the conversion step. */ + if (isascii (*p) && BE (pstr->trans == NULL, 1)) + { + memset (&pstr->cur_state, '\0', sizeof (mbstate_t)); + /* pstr->valid_len = 0; */ + wc = (wchar_t) *p; + } + else +#endif + for (; p >= end; --p) + if ((*p & 0xc0) != 0x80) + { + mbstate_t cur_state; + wchar_t wc2; + Idx mlen = raw + pstr->len - p; + unsigned char buf[6]; + size_t mbclen; + + const unsigned char *pp = p; + if (BE (pstr->trans != NULL, 0)) + { + int i = mlen < 6 ? mlen : 6; + while (--i >= 0) + buf[i] = pstr->trans[p[i]]; + pp = buf; + } + /* XXX Don't use mbrtowc, we know which conversion + to use (UTF-8 -> UCS4). */ + memset (&cur_state, 0, sizeof (cur_state)); + mbclen = __mbrtowc (&wc2, (const char *) pp, mlen, + &cur_state); + if (raw + offset - p <= mbclen + && mbclen < (size_t) -2) + { + memset (&pstr->cur_state, '\0', + sizeof (mbstate_t)); + pstr->valid_len = mbclen - (raw + offset - p); + wc = wc2; + } + break; + } + } + + if (wc == WEOF) + pstr->valid_len = re_string_skip_chars (pstr, idx, &wc) - idx; + if (wc == WEOF) + pstr->tip_context + = re_string_context_at (pstr, prev_valid_len - 1, eflags); + else + pstr->tip_context = ((BE (pstr->word_ops_used != 0, 0) + && IS_WIDE_WORD_CHAR (wc)) + ? CONTEXT_WORD + : ((IS_WIDE_NEWLINE (wc) + && pstr->newline_anchor) + ? CONTEXT_NEWLINE : 0)); + if (BE (pstr->valid_len, 0)) + { + for (wcs_idx = 0; wcs_idx < pstr->valid_len; ++wcs_idx) + pstr->wcs[wcs_idx] = WEOF; + if (pstr->mbs_allocated) + memset (pstr->mbs, 255, pstr->valid_len); + } + pstr->valid_raw_len = pstr->valid_len; + } + else +#endif /* RE_ENABLE_I18N */ + { + int c = pstr->raw_mbs[pstr->raw_mbs_idx + offset - 1]; + pstr->valid_raw_len = 0; + if (pstr->trans) + c = pstr->trans[c]; + pstr->tip_context = (bitset_contain (pstr->word_char, c) + ? CONTEXT_WORD + : ((IS_NEWLINE (c) && pstr->newline_anchor) + ? CONTEXT_NEWLINE : 0)); + } + } + if (!BE (pstr->mbs_allocated, 0)) + pstr->mbs += offset; + } + pstr->raw_mbs_idx = idx; + pstr->len -= offset; + pstr->stop -= offset; + + /* Then build the buffers. */ +#ifdef RE_ENABLE_I18N + if (pstr->mb_cur_max > 1) + { + if (pstr->icase) + { + reg_errcode_t ret = build_wcs_upper_buffer (pstr); + if (BE (ret != REG_NOERROR, 0)) + return ret; + } + else + build_wcs_buffer (pstr); + } + else +#endif /* RE_ENABLE_I18N */ + if (BE (pstr->mbs_allocated, 0)) + { + if (pstr->icase) + build_upper_buffer (pstr); + else if (pstr->trans != NULL) + re_string_translate_buffer (pstr); + } + else + pstr->valid_len = pstr->len; + + pstr->cur_idx = 0; + return REG_NOERROR; +} + +static unsigned char +internal_function __attribute__ ((pure)) +re_string_peek_byte_case (const re_string_t *pstr, Idx idx) +{ + int ch; + Idx off; + + /* Handle the common (easiest) cases first. */ + if (BE (!pstr->mbs_allocated, 1)) + return re_string_peek_byte (pstr, idx); + +#ifdef RE_ENABLE_I18N + if (pstr->mb_cur_max > 1 + && ! re_string_is_single_byte_char (pstr, pstr->cur_idx + idx)) + return re_string_peek_byte (pstr, idx); +#endif + + off = pstr->cur_idx + idx; +#ifdef RE_ENABLE_I18N + if (pstr->offsets_needed) + off = pstr->offsets[off]; +#endif + + ch = pstr->raw_mbs[pstr->raw_mbs_idx + off]; + +#ifdef RE_ENABLE_I18N + /* Ensure that e.g. for tr_TR.UTF-8 BACKSLASH DOTLESS SMALL LETTER I + this function returns CAPITAL LETTER I instead of first byte of + DOTLESS SMALL LETTER I. The latter would confuse the parser, + since peek_byte_case doesn't advance cur_idx in any way. */ + if (pstr->offsets_needed && !isascii (ch)) + return re_string_peek_byte (pstr, idx); +#endif + + return ch; +} + +static unsigned char +internal_function +re_string_fetch_byte_case (re_string_t *pstr) +{ + if (BE (!pstr->mbs_allocated, 1)) + return re_string_fetch_byte (pstr); + +#ifdef RE_ENABLE_I18N + if (pstr->offsets_needed) + { + Idx off; + int ch; + + /* For tr_TR.UTF-8 [[:islower:]] there is + [[: CAPITAL LETTER I WITH DOT lower:]] in mbs. Skip + in that case the whole multi-byte character and return + the original letter. On the other side, with + [[: DOTLESS SMALL LETTER I return [[:I, as doing + anything else would complicate things too much. */ + + if (!re_string_first_byte (pstr, pstr->cur_idx)) + return re_string_fetch_byte (pstr); + + off = pstr->offsets[pstr->cur_idx]; + ch = pstr->raw_mbs[pstr->raw_mbs_idx + off]; + + if (! isascii (ch)) + return re_string_fetch_byte (pstr); + + re_string_skip_bytes (pstr, + re_string_char_size_at (pstr, pstr->cur_idx)); + return ch; + } +#endif + + return pstr->raw_mbs[pstr->raw_mbs_idx + pstr->cur_idx++]; +} + +static void +internal_function +re_string_destruct (re_string_t *pstr) +{ +#ifdef RE_ENABLE_I18N + re_free (pstr->wcs); + re_free (pstr->offsets); +#endif /* RE_ENABLE_I18N */ + if (pstr->mbs_allocated) + re_free (pstr->mbs); +} + +/* Return the context at IDX in INPUT. */ + +static unsigned int +internal_function +re_string_context_at (const re_string_t *input, Idx idx, int eflags) +{ + int c; + if (BE (idx < 0, 0)) + /* In this case, we use the value stored in input->tip_context, + since we can't know the character in input->mbs[-1] here. */ + return input->tip_context; + if (BE (idx == input->len, 0)) + return ((eflags & REG_NOTEOL) ? CONTEXT_ENDBUF + : CONTEXT_NEWLINE | CONTEXT_ENDBUF); +#ifdef RE_ENABLE_I18N + if (input->mb_cur_max > 1) + { + wint_t wc; + Idx wc_idx = idx; + while(input->wcs[wc_idx] == WEOF) + { +#if defined DEBUG && DEBUG + /* It must not happen. */ + assert (wc_idx >= 0); +#endif + --wc_idx; + if (wc_idx < 0) + return input->tip_context; + } + wc = input->wcs[wc_idx]; + if (BE (input->word_ops_used != 0, 0) && IS_WIDE_WORD_CHAR (wc)) + return CONTEXT_WORD; + return (IS_WIDE_NEWLINE (wc) && input->newline_anchor + ? CONTEXT_NEWLINE : 0); + } + else +#endif + { + c = re_string_byte_at (input, idx); + if (bitset_contain (input->word_char, c)) + return CONTEXT_WORD; + return IS_NEWLINE (c) && input->newline_anchor ? CONTEXT_NEWLINE : 0; + } +} + +/* Functions for set operation. */ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +re_node_set_alloc (re_node_set *set, Idx size) +{ + set->alloc = size; + set->nelem = 0; + set->elems = re_malloc (Idx, size); + if (BE (set->elems == NULL, 0) && (MALLOC_0_IS_NONNULL || size != 0)) + return REG_ESPACE; + return REG_NOERROR; +} + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +re_node_set_init_1 (re_node_set *set, Idx elem) +{ + set->alloc = 1; + set->nelem = 1; + set->elems = re_malloc (Idx, 1); + if (BE (set->elems == NULL, 0)) + { + set->alloc = set->nelem = 0; + return REG_ESPACE; + } + set->elems[0] = elem; + return REG_NOERROR; +} + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +re_node_set_init_2 (re_node_set *set, Idx elem1, Idx elem2) +{ + set->alloc = 2; + set->elems = re_malloc (Idx, 2); + if (BE (set->elems == NULL, 0)) + return REG_ESPACE; + if (elem1 == elem2) + { + set->nelem = 1; + set->elems[0] = elem1; + } + else + { + set->nelem = 2; + if (elem1 < elem2) + { + set->elems[0] = elem1; + set->elems[1] = elem2; + } + else + { + set->elems[0] = elem2; + set->elems[1] = elem1; + } + } + return REG_NOERROR; +} + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +re_node_set_init_copy (re_node_set *dest, const re_node_set *src) +{ + dest->nelem = src->nelem; + if (src->nelem > 0) + { + dest->alloc = dest->nelem; + dest->elems = re_malloc (Idx, dest->alloc); + if (BE (dest->elems == NULL, 0)) + { + dest->alloc = dest->nelem = 0; + return REG_ESPACE; + } + memcpy (dest->elems, src->elems, src->nelem * sizeof (Idx)); + } + else + re_node_set_init_empty (dest); + return REG_NOERROR; +} + +/* Calculate the intersection of the sets SRC1 and SRC2. And merge it to + DEST. Return value indicate the error code or REG_NOERROR if succeeded. + Note: We assume dest->elems is NULL, when dest->alloc is 0. */ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +re_node_set_add_intersect (re_node_set *dest, const re_node_set *src1, + const re_node_set *src2) +{ + Idx i1, i2, is, id, delta, sbase; + if (src1->nelem == 0 || src2->nelem == 0) + return REG_NOERROR; + + /* We need dest->nelem + 2 * elems_in_intersection; this is a + conservative estimate. */ + if (src1->nelem + src2->nelem + dest->nelem > dest->alloc) + { + Idx new_alloc = src1->nelem + src2->nelem + dest->alloc; + Idx *new_elems = re_realloc (dest->elems, Idx, new_alloc); + if (BE (new_elems == NULL, 0)) + return REG_ESPACE; + dest->elems = new_elems; + dest->alloc = new_alloc; + } + + /* Find the items in the intersection of SRC1 and SRC2, and copy + into the top of DEST those that are not already in DEST itself. */ + sbase = dest->nelem + src1->nelem + src2->nelem; + i1 = src1->nelem - 1; + i2 = src2->nelem - 1; + id = dest->nelem - 1; + for (;;) + { + if (src1->elems[i1] == src2->elems[i2]) + { + /* Try to find the item in DEST. Maybe we could binary search? */ + while (id >= 0 && dest->elems[id] > src1->elems[i1]) + --id; + + if (id < 0 || dest->elems[id] != src1->elems[i1]) + dest->elems[--sbase] = src1->elems[i1]; + + if (--i1 < 0 || --i2 < 0) + break; + } + + /* Lower the highest of the two items. */ + else if (src1->elems[i1] < src2->elems[i2]) + { + if (--i2 < 0) + break; + } + else + { + if (--i1 < 0) + break; + } + } + + id = dest->nelem - 1; + is = dest->nelem + src1->nelem + src2->nelem - 1; + delta = is - sbase + 1; + + /* Now copy. When DELTA becomes zero, the remaining + DEST elements are already in place; this is more or + less the same loop that is in re_node_set_merge. */ + dest->nelem += delta; + if (delta > 0 && id >= 0) + for (;;) + { + if (dest->elems[is] > dest->elems[id]) + { + /* Copy from the top. */ + dest->elems[id + delta--] = dest->elems[is--]; + if (delta == 0) + break; + } + else + { + /* Slide from the bottom. */ + dest->elems[id + delta] = dest->elems[id]; + if (--id < 0) + break; + } + } + + /* Copy remaining SRC elements. */ + memcpy (dest->elems, dest->elems + sbase, delta * sizeof (Idx)); + + return REG_NOERROR; +} + +/* Calculate the union set of the sets SRC1 and SRC2. And store it to + DEST. Return value indicate the error code or REG_NOERROR if succeeded. */ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +re_node_set_init_union (re_node_set *dest, const re_node_set *src1, + const re_node_set *src2) +{ + Idx i1, i2, id; + if (src1 != NULL && src1->nelem > 0 && src2 != NULL && src2->nelem > 0) + { + dest->alloc = src1->nelem + src2->nelem; + dest->elems = re_malloc (Idx, dest->alloc); + if (BE (dest->elems == NULL, 0)) + return REG_ESPACE; + } + else + { + if (src1 != NULL && src1->nelem > 0) + return re_node_set_init_copy (dest, src1); + else if (src2 != NULL && src2->nelem > 0) + return re_node_set_init_copy (dest, src2); + else + re_node_set_init_empty (dest); + return REG_NOERROR; + } + for (i1 = i2 = id = 0 ; i1 < src1->nelem && i2 < src2->nelem ;) + { + if (src1->elems[i1] > src2->elems[i2]) + { + dest->elems[id++] = src2->elems[i2++]; + continue; + } + if (src1->elems[i1] == src2->elems[i2]) + ++i2; + dest->elems[id++] = src1->elems[i1++]; + } + if (i1 < src1->nelem) + { + memcpy (dest->elems + id, src1->elems + i1, + (src1->nelem - i1) * sizeof (Idx)); + id += src1->nelem - i1; + } + else if (i2 < src2->nelem) + { + memcpy (dest->elems + id, src2->elems + i2, + (src2->nelem - i2) * sizeof (Idx)); + id += src2->nelem - i2; + } + dest->nelem = id; + return REG_NOERROR; +} + +/* Calculate the union set of the sets DEST and SRC. And store it to + DEST. Return value indicate the error code or REG_NOERROR if succeeded. */ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +re_node_set_merge (re_node_set *dest, const re_node_set *src) +{ + Idx is, id, sbase, delta; + if (src == NULL || src->nelem == 0) + return REG_NOERROR; + if (dest->alloc < 2 * src->nelem + dest->nelem) + { + Idx new_alloc = 2 * (src->nelem + dest->alloc); + Idx *new_buffer = re_realloc (dest->elems, Idx, new_alloc); + if (BE (new_buffer == NULL, 0)) + return REG_ESPACE; + dest->elems = new_buffer; + dest->alloc = new_alloc; + } + + if (BE (dest->nelem == 0, 0)) + { + dest->nelem = src->nelem; + memcpy (dest->elems, src->elems, src->nelem * sizeof (Idx)); + return REG_NOERROR; + } + + /* Copy into the top of DEST the items of SRC that are not + found in DEST. Maybe we could binary search in DEST? */ + for (sbase = dest->nelem + 2 * src->nelem, + is = src->nelem - 1, id = dest->nelem - 1; is >= 0 && id >= 0; ) + { + if (dest->elems[id] == src->elems[is]) + is--, id--; + else if (dest->elems[id] < src->elems[is]) + dest->elems[--sbase] = src->elems[is--]; + else /* if (dest->elems[id] > src->elems[is]) */ + --id; + } + + if (is >= 0) + { + /* If DEST is exhausted, the remaining items of SRC must be unique. */ + sbase -= is + 1; + memcpy (dest->elems + sbase, src->elems, (is + 1) * sizeof (Idx)); + } + + id = dest->nelem - 1; + is = dest->nelem + 2 * src->nelem - 1; + delta = is - sbase + 1; + if (delta == 0) + return REG_NOERROR; + + /* Now copy. When DELTA becomes zero, the remaining + DEST elements are already in place. */ + dest->nelem += delta; + for (;;) + { + if (dest->elems[is] > dest->elems[id]) + { + /* Copy from the top. */ + dest->elems[id + delta--] = dest->elems[is--]; + if (delta == 0) + break; + } + else + { + /* Slide from the bottom. */ + dest->elems[id + delta] = dest->elems[id]; + if (--id < 0) + { + /* Copy remaining SRC elements. */ + memcpy (dest->elems, dest->elems + sbase, + delta * sizeof (Idx)); + break; + } + } + } + + return REG_NOERROR; +} + +/* Insert the new element ELEM to the re_node_set* SET. + SET should not already have ELEM. + Return true if successful. */ + +static bool +internal_function __attribute_warn_unused_result__ +re_node_set_insert (re_node_set *set, Idx elem) +{ + Idx idx; + /* In case the set is empty. */ + if (set->alloc == 0) + return BE (re_node_set_init_1 (set, elem) == REG_NOERROR, 1); + + if (BE (set->nelem, 0) == 0) + { + /* We already guaranteed above that set->alloc != 0. */ + set->elems[0] = elem; + ++set->nelem; + return true; + } + + /* Realloc if we need. */ + if (set->alloc == set->nelem) + { + Idx *new_elems; + set->alloc = set->alloc * 2; + new_elems = re_realloc (set->elems, Idx, set->alloc); + if (BE (new_elems == NULL, 0)) + return false; + set->elems = new_elems; + } + + /* Move the elements which follows the new element. Test the + first element separately to skip a check in the inner loop. */ + if (elem < set->elems[0]) + { + idx = 0; + for (idx = set->nelem; idx > 0; idx--) + set->elems[idx] = set->elems[idx - 1]; + } + else + { + for (idx = set->nelem; set->elems[idx - 1] > elem; idx--) + set->elems[idx] = set->elems[idx - 1]; + } + + /* Insert the new element. */ + set->elems[idx] = elem; + ++set->nelem; + return true; +} + +/* Insert the new element ELEM to the re_node_set* SET. + SET should not already have any element greater than or equal to ELEM. + Return true if successful. */ + +static bool +internal_function __attribute_warn_unused_result__ +re_node_set_insert_last (re_node_set *set, Idx elem) +{ + /* Realloc if we need. */ + if (set->alloc == set->nelem) + { + Idx *new_elems; + set->alloc = (set->alloc + 1) * 2; + new_elems = re_realloc (set->elems, Idx, set->alloc); + if (BE (new_elems == NULL, 0)) + return false; + set->elems = new_elems; + } + + /* Insert the new element. */ + set->elems[set->nelem++] = elem; + return true; +} + +/* Compare two node sets SET1 and SET2. + Return true if SET1 and SET2 are equivalent. */ + +static bool +internal_function __attribute__ ((pure)) +re_node_set_compare (const re_node_set *set1, const re_node_set *set2) +{ + Idx i; + if (set1 == NULL || set2 == NULL || set1->nelem != set2->nelem) + return false; + for (i = set1->nelem ; --i >= 0 ; ) + if (set1->elems[i] != set2->elems[i]) + return false; + return true; +} + +/* Return (idx + 1) if SET contains the element ELEM, return 0 otherwise. */ + +static Idx +internal_function __attribute__ ((pure)) +re_node_set_contains (const re_node_set *set, Idx elem) +{ + __re_size_t idx, right, mid; + if (set->nelem <= 0) + return 0; + + /* Binary search the element. */ + idx = 0; + right = set->nelem - 1; + while (idx < right) + { + mid = (idx + right) / 2; + if (set->elems[mid] < elem) + idx = mid + 1; + else + right = mid; + } + return set->elems[idx] == elem ? idx + 1 : 0; +} + +static void +internal_function +re_node_set_remove_at (re_node_set *set, Idx idx) +{ + if (idx < 0 || idx >= set->nelem) + return; + --set->nelem; + for (; idx < set->nelem; idx++) + set->elems[idx] = set->elems[idx + 1]; +} + + +/* Add the token TOKEN to dfa->nodes, and return the index of the token. + Or return -1 if an error occurred. */ + +static Idx +internal_function +re_dfa_add_node (re_dfa_t *dfa, re_token_t token) +{ + if (BE (dfa->nodes_len >= dfa->nodes_alloc, 0)) + { + size_t new_nodes_alloc = dfa->nodes_alloc * 2; + Idx *new_nexts, *new_indices; + re_node_set *new_edests, *new_eclosures; + re_token_t *new_nodes; + + /* Avoid overflows in realloc. */ + const size_t max_object_size = MAX (sizeof (re_token_t), + MAX (sizeof (re_node_set), + sizeof (Idx))); + if (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) < new_nodes_alloc, 0)) + return -1; + + new_nodes = re_realloc (dfa->nodes, re_token_t, new_nodes_alloc); + if (BE (new_nodes == NULL, 0)) + return -1; + dfa->nodes = new_nodes; + new_nexts = re_realloc (dfa->nexts, Idx, new_nodes_alloc); + new_indices = re_realloc (dfa->org_indices, Idx, new_nodes_alloc); + new_edests = re_realloc (dfa->edests, re_node_set, new_nodes_alloc); + new_eclosures = re_realloc (dfa->eclosures, re_node_set, new_nodes_alloc); + if (BE (new_nexts == NULL || new_indices == NULL + || new_edests == NULL || new_eclosures == NULL, 0)) + { + re_free (new_nexts); + re_free (new_indices); + re_free (new_edests); + re_free (new_eclosures); + return -1; + } + dfa->nexts = new_nexts; + dfa->org_indices = new_indices; + dfa->edests = new_edests; + dfa->eclosures = new_eclosures; + dfa->nodes_alloc = new_nodes_alloc; + } + dfa->nodes[dfa->nodes_len] = token; + dfa->nodes[dfa->nodes_len].constraint = 0; +#ifdef RE_ENABLE_I18N + dfa->nodes[dfa->nodes_len].accept_mb = + ((token.type == OP_PERIOD && dfa->mb_cur_max > 1) + || token.type == COMPLEX_BRACKET); +#endif + dfa->nexts[dfa->nodes_len] = -1; + re_node_set_init_empty (dfa->edests + dfa->nodes_len); + re_node_set_init_empty (dfa->eclosures + dfa->nodes_len); + return dfa->nodes_len++; +} + +static re_hashval_t +internal_function +calc_state_hash (const re_node_set *nodes, unsigned int context) +{ + re_hashval_t hash = nodes->nelem + context; + Idx i; + for (i = 0 ; i < nodes->nelem ; i++) + hash += nodes->elems[i]; + return hash; +} + +/* Search for the state whose node_set is equivalent to NODES. + Return the pointer to the state, if we found it in the DFA. + Otherwise create the new one and return it. In case of an error + return NULL and set the error code in ERR. + Note: - We assume NULL as the invalid state, then it is possible that + return value is NULL and ERR is REG_NOERROR. + - We never return non-NULL value in case of any errors, it is for + optimization. */ + +static re_dfastate_t * +internal_function __attribute_warn_unused_result__ +re_acquire_state (reg_errcode_t *err, const re_dfa_t *dfa, + const re_node_set *nodes) +{ + re_hashval_t hash; + re_dfastate_t *new_state; + struct re_state_table_entry *spot; + Idx i; +#if defined GCC_LINT || defined lint + /* Suppress bogus uninitialized-variable warnings. */ + *err = REG_NOERROR; +#endif + if (BE (nodes->nelem == 0, 0)) + { + *err = REG_NOERROR; + return NULL; + } + hash = calc_state_hash (nodes, 0); + spot = dfa->state_table + (hash & dfa->state_hash_mask); + + for (i = 0 ; i < spot->num ; i++) + { + re_dfastate_t *state = spot->array[i]; + if (hash != state->hash) + continue; + if (re_node_set_compare (&state->nodes, nodes)) + return state; + } + + /* There are no appropriate state in the dfa, create the new one. */ + new_state = create_ci_newstate (dfa, nodes, hash); + if (BE (new_state == NULL, 0)) + *err = REG_ESPACE; + + return new_state; +} + +/* Search for the state whose node_set is equivalent to NODES and + whose context is equivalent to CONTEXT. + Return the pointer to the state, if we found it in the DFA. + Otherwise create the new one and return it. In case of an error + return NULL and set the error code in ERR. + Note: - We assume NULL as the invalid state, then it is possible that + return value is NULL and ERR is REG_NOERROR. + - We never return non-NULL value in case of any errors, it is for + optimization. */ + +static re_dfastate_t * +internal_function __attribute_warn_unused_result__ +re_acquire_state_context (reg_errcode_t *err, const re_dfa_t *dfa, + const re_node_set *nodes, unsigned int context) +{ + re_hashval_t hash; + re_dfastate_t *new_state; + struct re_state_table_entry *spot; + Idx i; +#if defined GCC_LINT || defined lint + /* Suppress bogus uninitialized-variable warnings. */ + *err = REG_NOERROR; +#endif + if (nodes->nelem == 0) + { + *err = REG_NOERROR; + return NULL; + } + hash = calc_state_hash (nodes, context); + spot = dfa->state_table + (hash & dfa->state_hash_mask); + + for (i = 0 ; i < spot->num ; i++) + { + re_dfastate_t *state = spot->array[i]; + if (state->hash == hash + && state->context == context + && re_node_set_compare (state->entrance_nodes, nodes)) + return state; + } + /* There are no appropriate state in 'dfa', create the new one. */ + new_state = create_cd_newstate (dfa, nodes, context, hash); + if (BE (new_state == NULL, 0)) + *err = REG_ESPACE; + + return new_state; +} + +/* Finish initialization of the new state NEWSTATE, and using its hash value + HASH put in the appropriate bucket of DFA's state table. Return value + indicates the error code if failed. */ + +static reg_errcode_t +__attribute_warn_unused_result__ +register_state (const re_dfa_t *dfa, re_dfastate_t *newstate, + re_hashval_t hash) +{ + struct re_state_table_entry *spot; + reg_errcode_t err; + Idx i; + + newstate->hash = hash; + err = re_node_set_alloc (&newstate->non_eps_nodes, newstate->nodes.nelem); + if (BE (err != REG_NOERROR, 0)) + return REG_ESPACE; + for (i = 0; i < newstate->nodes.nelem; i++) + { + Idx elem = newstate->nodes.elems[i]; + if (!IS_EPSILON_NODE (dfa->nodes[elem].type)) + if (! re_node_set_insert_last (&newstate->non_eps_nodes, elem)) + return REG_ESPACE; + } + + spot = dfa->state_table + (hash & dfa->state_hash_mask); + if (BE (spot->alloc <= spot->num, 0)) + { + Idx new_alloc = 2 * spot->num + 2; + re_dfastate_t **new_array = re_realloc (spot->array, re_dfastate_t *, + new_alloc); + if (BE (new_array == NULL, 0)) + return REG_ESPACE; + spot->array = new_array; + spot->alloc = new_alloc; + } + spot->array[spot->num++] = newstate; + return REG_NOERROR; +} + +static void +free_state (re_dfastate_t *state) +{ + re_node_set_free (&state->non_eps_nodes); + re_node_set_free (&state->inveclosure); + if (state->entrance_nodes != &state->nodes) + { + re_node_set_free (state->entrance_nodes); + re_free (state->entrance_nodes); + } + re_node_set_free (&state->nodes); + re_free (state->word_trtable); + re_free (state->trtable); + re_free (state); +} + +/* Create the new state which is independent of contexts. + Return the new state if succeeded, otherwise return NULL. */ + +static re_dfastate_t * +internal_function __attribute_warn_unused_result__ +create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes, + re_hashval_t hash) +{ + Idx i; + reg_errcode_t err; + re_dfastate_t *newstate; + + newstate = (re_dfastate_t *) calloc (sizeof (re_dfastate_t), 1); + if (BE (newstate == NULL, 0)) + return NULL; + err = re_node_set_init_copy (&newstate->nodes, nodes); + if (BE (err != REG_NOERROR, 0)) + { + re_free (newstate); + return NULL; + } + + newstate->entrance_nodes = &newstate->nodes; + for (i = 0 ; i < nodes->nelem ; i++) + { + re_token_t *node = dfa->nodes + nodes->elems[i]; + re_token_type_t type = node->type; + if (type == CHARACTER && !node->constraint) + continue; +#ifdef RE_ENABLE_I18N + newstate->accept_mb |= node->accept_mb; +#endif /* RE_ENABLE_I18N */ + + /* If the state has the halt node, the state is a halt state. */ + if (type == END_OF_RE) + newstate->halt = 1; + else if (type == OP_BACK_REF) + newstate->has_backref = 1; + else if (type == ANCHOR || node->constraint) + newstate->has_constraint = 1; + } + err = register_state (dfa, newstate, hash); + if (BE (err != REG_NOERROR, 0)) + { + free_state (newstate); + newstate = NULL; + } + return newstate; +} + +/* Create the new state which is depend on the context CONTEXT. + Return the new state if succeeded, otherwise return NULL. */ + +static re_dfastate_t * +internal_function __attribute_warn_unused_result__ +create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes, + unsigned int context, re_hashval_t hash) +{ + Idx i, nctx_nodes = 0; + reg_errcode_t err; + re_dfastate_t *newstate; + + newstate = (re_dfastate_t *) calloc (sizeof (re_dfastate_t), 1); + if (BE (newstate == NULL, 0)) + return NULL; + err = re_node_set_init_copy (&newstate->nodes, nodes); + if (BE (err != REG_NOERROR, 0)) + { + re_free (newstate); + return NULL; + } + + newstate->context = context; + newstate->entrance_nodes = &newstate->nodes; + + for (i = 0 ; i < nodes->nelem ; i++) + { + re_token_t *node = dfa->nodes + nodes->elems[i]; + re_token_type_t type = node->type; + unsigned int constraint = node->constraint; + + if (type == CHARACTER && !constraint) + continue; +#ifdef RE_ENABLE_I18N + newstate->accept_mb |= node->accept_mb; +#endif /* RE_ENABLE_I18N */ + + /* If the state has the halt node, the state is a halt state. */ + if (type == END_OF_RE) + newstate->halt = 1; + else if (type == OP_BACK_REF) + newstate->has_backref = 1; + + if (constraint) + { + if (newstate->entrance_nodes == &newstate->nodes) + { + newstate->entrance_nodes = re_malloc (re_node_set, 1); + if (BE (newstate->entrance_nodes == NULL, 0)) + { + free_state (newstate); + return NULL; + } + if (re_node_set_init_copy (newstate->entrance_nodes, nodes) + != REG_NOERROR) + return NULL; + nctx_nodes = 0; + newstate->has_constraint = 1; + } + + if (NOT_SATISFY_PREV_CONSTRAINT (constraint,context)) + { + re_node_set_remove_at (&newstate->nodes, i - nctx_nodes); + ++nctx_nodes; + } + } + } + err = register_state (dfa, newstate, hash); + if (BE (err != REG_NOERROR, 0)) + { + free_state (newstate); + newstate = NULL; + } + return newstate; +} diff --git a/local/recipes/tools/diffutils/source/lib/regex_internal.h b/local/recipes/tools/diffutils/source/lib/regex_internal.h new file mode 100644 index 0000000000..7b1e5516cc --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/regex_internal.h @@ -0,0 +1,902 @@ +/* Extended regular expression matching and search library. + Copyright (C) 2002-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _REGEX_INTERNAL_H +#define _REGEX_INTERNAL_H 1 + +#include <assert.h> +#include <ctype.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include <langinfo.h> +#include <locale.h> +#include <wchar.h> +#include <wctype.h> +#include <stdbool.h> +#include <stdint.h> + +#include "intprops.h" + +#ifdef _LIBC +# include <libc-lock.h> +# define lock_define(name) __libc_lock_define (, name) +# define lock_init(lock) (__libc_lock_init (lock), 0) +# define lock_fini(lock) 0 +# define lock_lock(lock) __libc_lock_lock (lock) +# define lock_unlock(lock) __libc_lock_unlock (lock) +#elif defined GNULIB_LOCK && !defined USE_UNLOCKED_IO +# include "glthread/lock.h" + /* Use gl_lock_define if empty macro arguments are known to work. + Otherwise, fall back on less-portable substitutes. */ +# if ((defined __GNUC__ && !defined __STRICT_ANSI__) \ + || (defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__)) +# define lock_define(name) gl_lock_define (, name) +# elif USE_POSIX_THREADS +# define lock_define(name) pthread_mutex_t name; +# elif USE_PTH_THREADS +# define lock_define(name) pth_mutex_t name; +# elif USE_SOLARIS_THREADS +# define lock_define(name) mutex_t name; +# elif USE_WINDOWS_THREADS +# define lock_define(name) gl_lock_t name; +# else +# define lock_define(name) +# endif +# define lock_init(lock) glthread_lock_init (&(lock)) +# define lock_fini(lock) glthread_lock_destroy (&(lock)) +# define lock_lock(lock) glthread_lock_lock (&(lock)) +# define lock_unlock(lock) glthread_lock_unlock (&(lock)) +#elif defined GNULIB_PTHREAD && !defined USE_UNLOCKED_IO +# include <pthread.h> +# define lock_define(name) pthread_mutex_t name; +# define lock_init(lock) pthread_mutex_init (&(lock), 0) +# define lock_fini(lock) pthread_mutex_destroy (&(lock)) +# define lock_lock(lock) pthread_mutex_lock (&(lock)) +# define lock_unlock(lock) pthread_mutex_unlock (&(lock)) +#else +# define lock_define(name) +# define lock_init(lock) 0 +# define lock_fini(lock) ((void) 0) + /* The 'dfa' avoids an "unused variable 'dfa'" warning from GCC. */ +# define lock_lock(lock) ((void) dfa) +# define lock_unlock(lock) ((void) 0) +#endif + +/* In case that the system doesn't have isblank(). */ +#if !defined _LIBC && ! (defined isblank || (HAVE_ISBLANK && HAVE_DECL_ISBLANK)) +# define isblank(ch) ((ch) == ' ' || (ch) == '\t') +#endif + +#ifdef _LIBC +# ifndef _RE_DEFINE_LOCALE_FUNCTIONS +# define _RE_DEFINE_LOCALE_FUNCTIONS 1 +# include <locale/localeinfo.h> +# include <locale/coll-lookup.h> +# endif +#endif + +/* This is for other GNU distributions with internationalized messages. */ +#if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC +# include <libintl.h> +# ifdef _LIBC +# undef gettext +# define gettext(msgid) \ + __dcgettext (_libc_intl_domainname, msgid, LC_MESSAGES) +# endif +#else +# undef gettext +# define gettext(msgid) (msgid) +#endif + +#ifndef gettext_noop +/* This define is so xgettext can find the internationalizable + strings. */ +# define gettext_noop(String) String +#endif + +#if (defined MB_CUR_MAX && HAVE_WCTYPE_H && HAVE_ISWCTYPE) || _LIBC +# define RE_ENABLE_I18N +#endif + +#define BE(expr, val) __builtin_expect (expr, val) + +/* Number of ASCII characters. */ +#define ASCII_CHARS 0x80 + +/* Number of single byte characters. */ +#define SBC_MAX (UCHAR_MAX + 1) + +#define COLL_ELEM_LEN_MAX 8 + +/* The character which represents newline. */ +#define NEWLINE_CHAR '\n' +#define WIDE_NEWLINE_CHAR L'\n' + +/* Rename to standard API for using out of glibc. */ +#ifndef _LIBC +# undef __wctype +# undef __iswctype +# define __wctype wctype +# define __iswalnum iswalnum +# define __iswctype iswctype +# define __towlower towlower +# define __towupper towupper +# define __btowc btowc +# define __mbrtowc mbrtowc +# define __wcrtomb wcrtomb +# define __regfree regfree +# define attribute_hidden +#endif /* not _LIBC */ + +#if __GNUC__ < 3 + (__GNUC_MINOR__ < 1) +# define __attribute__(arg) +#endif + +#ifndef SSIZE_MAX +# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) +#endif + +/* The type of indexes into strings. This is signed, not size_t, + since the API requires indexes to fit in regoff_t anyway, and using + signed integers makes the code a bit smaller and presumably faster. + The traditional GNU regex implementation uses int for indexes. + The POSIX-compatible implementation uses a possibly-wider type. + The name 'Idx' is three letters to minimize the hassle of + reindenting a lot of regex code that formerly used 'int'. */ +typedef regoff_t Idx; +#ifdef _REGEX_LARGE_OFFSETS +# define IDX_MAX SSIZE_MAX +#else +# define IDX_MAX INT_MAX +#endif + +/* A hash value, suitable for computing hash tables. */ +typedef __re_size_t re_hashval_t; + +/* An integer used to represent a set of bits. It must be unsigned, + and must be at least as wide as unsigned int. */ +typedef unsigned long int bitset_word_t; +/* All bits set in a bitset_word_t. */ +#define BITSET_WORD_MAX ULONG_MAX + +/* Number of bits in a bitset_word_t. For portability to hosts with + padding bits, do not use '(sizeof (bitset_word_t) * CHAR_BIT)'; + instead, deduce it directly from BITSET_WORD_MAX. Avoid + greater-than-32-bit integers and unconditional shifts by more than + 31 bits, as they're not portable. */ +#if BITSET_WORD_MAX == 0xffffffffUL +# define BITSET_WORD_BITS 32 +#elif BITSET_WORD_MAX >> 31 >> 4 == 1 +# define BITSET_WORD_BITS 36 +#elif BITSET_WORD_MAX >> 31 >> 16 == 1 +# define BITSET_WORD_BITS 48 +#elif BITSET_WORD_MAX >> 31 >> 28 == 1 +# define BITSET_WORD_BITS 60 +#elif BITSET_WORD_MAX >> 31 >> 31 >> 1 == 1 +# define BITSET_WORD_BITS 64 +#elif BITSET_WORD_MAX >> 31 >> 31 >> 9 == 1 +# define BITSET_WORD_BITS 72 +#elif BITSET_WORD_MAX >> 31 >> 31 >> 31 >> 31 >> 3 == 1 +# define BITSET_WORD_BITS 128 +#elif BITSET_WORD_MAX >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 7 == 1 +# define BITSET_WORD_BITS 256 +#elif BITSET_WORD_MAX >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 7 > 1 +# define BITSET_WORD_BITS 257 /* any value > SBC_MAX will do here */ +# if BITSET_WORD_BITS <= SBC_MAX +# error "Invalid SBC_MAX" +# endif +#else +# error "Add case for new bitset_word_t size" +#endif + +/* Number of bitset_word_t values in a bitset_t. */ +#define BITSET_WORDS ((SBC_MAX + BITSET_WORD_BITS - 1) / BITSET_WORD_BITS) + +typedef bitset_word_t bitset_t[BITSET_WORDS]; +typedef bitset_word_t *re_bitset_ptr_t; +typedef const bitset_word_t *re_const_bitset_ptr_t; + +#define PREV_WORD_CONSTRAINT 0x0001 +#define PREV_NOTWORD_CONSTRAINT 0x0002 +#define NEXT_WORD_CONSTRAINT 0x0004 +#define NEXT_NOTWORD_CONSTRAINT 0x0008 +#define PREV_NEWLINE_CONSTRAINT 0x0010 +#define NEXT_NEWLINE_CONSTRAINT 0x0020 +#define PREV_BEGBUF_CONSTRAINT 0x0040 +#define NEXT_ENDBUF_CONSTRAINT 0x0080 +#define WORD_DELIM_CONSTRAINT 0x0100 +#define NOT_WORD_DELIM_CONSTRAINT 0x0200 + +typedef enum +{ + INSIDE_WORD = PREV_WORD_CONSTRAINT | NEXT_WORD_CONSTRAINT, + WORD_FIRST = PREV_NOTWORD_CONSTRAINT | NEXT_WORD_CONSTRAINT, + WORD_LAST = PREV_WORD_CONSTRAINT | NEXT_NOTWORD_CONSTRAINT, + INSIDE_NOTWORD = PREV_NOTWORD_CONSTRAINT | NEXT_NOTWORD_CONSTRAINT, + LINE_FIRST = PREV_NEWLINE_CONSTRAINT, + LINE_LAST = NEXT_NEWLINE_CONSTRAINT, + BUF_FIRST = PREV_BEGBUF_CONSTRAINT, + BUF_LAST = NEXT_ENDBUF_CONSTRAINT, + WORD_DELIM = WORD_DELIM_CONSTRAINT, + NOT_WORD_DELIM = NOT_WORD_DELIM_CONSTRAINT +} re_context_type; + +typedef struct +{ + Idx alloc; + Idx nelem; + Idx *elems; +} re_node_set; + +typedef enum +{ + NON_TYPE = 0, + + /* Node type, These are used by token, node, tree. */ + CHARACTER = 1, + END_OF_RE = 2, + SIMPLE_BRACKET = 3, + OP_BACK_REF = 4, + OP_PERIOD = 5, +#ifdef RE_ENABLE_I18N + COMPLEX_BRACKET = 6, + OP_UTF8_PERIOD = 7, +#endif /* RE_ENABLE_I18N */ + + /* We define EPSILON_BIT as a macro so that OP_OPEN_SUBEXP is used + when the debugger shows values of this enum type. */ +#define EPSILON_BIT 8 + OP_OPEN_SUBEXP = EPSILON_BIT | 0, + OP_CLOSE_SUBEXP = EPSILON_BIT | 1, + OP_ALT = EPSILON_BIT | 2, + OP_DUP_ASTERISK = EPSILON_BIT | 3, + ANCHOR = EPSILON_BIT | 4, + + /* Tree type, these are used only by tree. */ + CONCAT = 16, + SUBEXP = 17, + + /* Token type, these are used only by token. */ + OP_DUP_PLUS = 18, + OP_DUP_QUESTION, + OP_OPEN_BRACKET, + OP_CLOSE_BRACKET, + OP_CHARSET_RANGE, + OP_OPEN_DUP_NUM, + OP_CLOSE_DUP_NUM, + OP_NON_MATCH_LIST, + OP_OPEN_COLL_ELEM, + OP_CLOSE_COLL_ELEM, + OP_OPEN_EQUIV_CLASS, + OP_CLOSE_EQUIV_CLASS, + OP_OPEN_CHAR_CLASS, + OP_CLOSE_CHAR_CLASS, + OP_WORD, + OP_NOTWORD, + OP_SPACE, + OP_NOTSPACE, + BACK_SLASH + +} re_token_type_t; + +#ifdef RE_ENABLE_I18N +typedef struct +{ + /* Multibyte characters. */ + wchar_t *mbchars; + + /* Collating symbols. */ +# ifdef _LIBC + int32_t *coll_syms; +# endif + + /* Equivalence classes. */ +# ifdef _LIBC + int32_t *equiv_classes; +# endif + + /* Range expressions. */ +# ifdef _LIBC + uint32_t *range_starts; + uint32_t *range_ends; +# else /* not _LIBC */ + wchar_t *range_starts; + wchar_t *range_ends; +# endif /* not _LIBC */ + + /* Character classes. */ + wctype_t *char_classes; + + /* If this character set is the non-matching list. */ + unsigned int non_match : 1; + + /* # of multibyte characters. */ + Idx nmbchars; + + /* # of collating symbols. */ + Idx ncoll_syms; + + /* # of equivalence classes. */ + Idx nequiv_classes; + + /* # of range expressions. */ + Idx nranges; + + /* # of character classes. */ + Idx nchar_classes; +} re_charset_t; +#endif /* RE_ENABLE_I18N */ + +typedef struct +{ + union + { + unsigned char c; /* for CHARACTER */ + re_bitset_ptr_t sbcset; /* for SIMPLE_BRACKET */ +#ifdef RE_ENABLE_I18N + re_charset_t *mbcset; /* for COMPLEX_BRACKET */ +#endif /* RE_ENABLE_I18N */ + Idx idx; /* for BACK_REF */ + re_context_type ctx_type; /* for ANCHOR */ + } opr; +#if __GNUC__ >= 2 && !defined __STRICT_ANSI__ + re_token_type_t type : 8; +#else + re_token_type_t type; +#endif + unsigned int constraint : 10; /* context constraint */ + unsigned int duplicated : 1; + unsigned int opt_subexp : 1; +#ifdef RE_ENABLE_I18N + unsigned int accept_mb : 1; + /* These 2 bits can be moved into the union if needed (e.g. if running out + of bits; move opr.c to opr.c.c and move the flags to opr.c.flags). */ + unsigned int mb_partial : 1; +#endif + unsigned int word_char : 1; +} re_token_t; + +#define IS_EPSILON_NODE(type) ((type) & EPSILON_BIT) + +struct re_string_t +{ + /* Indicate the raw buffer which is the original string passed as an + argument of regexec(), re_search(), etc.. */ + const unsigned char *raw_mbs; + /* Store the multibyte string. In case of "case insensitive mode" like + REG_ICASE, upper cases of the string are stored, otherwise MBS points + the same address that RAW_MBS points. */ + unsigned char *mbs; +#ifdef RE_ENABLE_I18N + /* Store the wide character string which is corresponding to MBS. */ + wint_t *wcs; + Idx *offsets; + mbstate_t cur_state; +#endif + /* Index in RAW_MBS. Each character mbs[i] corresponds to + raw_mbs[raw_mbs_idx + i]. */ + Idx raw_mbs_idx; + /* The length of the valid characters in the buffers. */ + Idx valid_len; + /* The corresponding number of bytes in raw_mbs array. */ + Idx valid_raw_len; + /* The length of the buffers MBS and WCS. */ + Idx bufs_len; + /* The index in MBS, which is updated by re_string_fetch_byte. */ + Idx cur_idx; + /* length of RAW_MBS array. */ + Idx raw_len; + /* This is RAW_LEN - RAW_MBS_IDX + VALID_LEN - VALID_RAW_LEN. */ + Idx len; + /* End of the buffer may be shorter than its length in the cases such + as re_match_2, re_search_2. Then, we use STOP for end of the buffer + instead of LEN. */ + Idx raw_stop; + /* This is RAW_STOP - RAW_MBS_IDX adjusted through OFFSETS. */ + Idx stop; + + /* The context of mbs[0]. We store the context independently, since + the context of mbs[0] may be different from raw_mbs[0], which is + the beginning of the input string. */ + unsigned int tip_context; + /* The translation passed as a part of an argument of re_compile_pattern. */ + RE_TRANSLATE_TYPE trans; + /* Copy of re_dfa_t's word_char. */ + re_const_bitset_ptr_t word_char; + /* true if REG_ICASE. */ + unsigned char icase; + unsigned char is_utf8; + unsigned char map_notascii; + unsigned char mbs_allocated; + unsigned char offsets_needed; + unsigned char newline_anchor; + unsigned char word_ops_used; + int mb_cur_max; +}; +typedef struct re_string_t re_string_t; + + +struct re_dfa_t; +typedef struct re_dfa_t re_dfa_t; + +#ifndef _LIBC +# define internal_function +# define IS_IN(libc) false +#endif + +static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr, + Idx new_buf_len) + internal_function; +#ifdef RE_ENABLE_I18N +static void build_wcs_buffer (re_string_t *pstr) internal_function; +static reg_errcode_t build_wcs_upper_buffer (re_string_t *pstr) + internal_function; +#endif /* RE_ENABLE_I18N */ +static void build_upper_buffer (re_string_t *pstr) internal_function; +static void re_string_translate_buffer (re_string_t *pstr) internal_function; +static unsigned int re_string_context_at (const re_string_t *input, Idx idx, + int eflags) + internal_function __attribute__ ((pure)); + +#define re_string_peek_byte(pstr, offset) \ + ((pstr)->mbs[(pstr)->cur_idx + offset]) +#define re_string_fetch_byte(pstr) \ + ((pstr)->mbs[(pstr)->cur_idx++]) +#define re_string_first_byte(pstr, idx) \ + ((idx) == (pstr)->valid_len || (pstr)->wcs[idx] != WEOF) +#define re_string_is_single_byte_char(pstr, idx) \ + ((pstr)->wcs[idx] != WEOF && ((pstr)->valid_len == (idx) + 1 \ + || (pstr)->wcs[(idx) + 1] != WEOF)) +#define re_string_eoi(pstr) ((pstr)->stop <= (pstr)->cur_idx) +#define re_string_cur_idx(pstr) ((pstr)->cur_idx) +#define re_string_get_buffer(pstr) ((pstr)->mbs) +#define re_string_length(pstr) ((pstr)->len) +#define re_string_byte_at(pstr,idx) ((pstr)->mbs[idx]) +#define re_string_skip_bytes(pstr,idx) ((pstr)->cur_idx += (idx)) +#define re_string_set_index(pstr,idx) ((pstr)->cur_idx = (idx)) + +#if defined _LIBC || HAVE_ALLOCA +# include <alloca.h> +#endif + +#ifndef _LIBC +# if HAVE_ALLOCA +/* The OS usually guarantees only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + allocate anything larger than 4096 bytes. Also care for the possibility + of a few compiler-allocated temporary stack slots. */ +# define __libc_use_alloca(n) ((n) < 4032) +# else +/* alloca is implemented with malloc, so just use malloc. */ +# define __libc_use_alloca(n) 0 +# undef alloca +# define alloca(n) malloc (n) +# endif +#endif + +#ifdef _LIBC +# define MALLOC_0_IS_NONNULL 1 +#elif !defined MALLOC_0_IS_NONNULL +# define MALLOC_0_IS_NONNULL 0 +#endif + +#ifndef MAX +# define MAX(a,b) ((a) < (b) ? (b) : (a)) +#endif +#ifndef MIN +# define MIN(a,b) ((a) < (b) ? (a) : (b)) +#endif + +#define re_malloc(t,n) ((t *) malloc ((n) * sizeof (t))) +#define re_realloc(p,t,n) ((t *) realloc (p, (n) * sizeof (t))) +#define re_free(p) free (p) + +struct bin_tree_t +{ + struct bin_tree_t *parent; + struct bin_tree_t *left; + struct bin_tree_t *right; + struct bin_tree_t *first; + struct bin_tree_t *next; + + re_token_t token; + + /* 'node_idx' is the index in dfa->nodes, if 'type' == 0. + Otherwise 'type' indicate the type of this node. */ + Idx node_idx; +}; +typedef struct bin_tree_t bin_tree_t; + +#define BIN_TREE_STORAGE_SIZE \ + ((1024 - sizeof (void *)) / sizeof (bin_tree_t)) + +struct bin_tree_storage_t +{ + struct bin_tree_storage_t *next; + bin_tree_t data[BIN_TREE_STORAGE_SIZE]; +}; +typedef struct bin_tree_storage_t bin_tree_storage_t; + +#define CONTEXT_WORD 1 +#define CONTEXT_NEWLINE (CONTEXT_WORD << 1) +#define CONTEXT_BEGBUF (CONTEXT_NEWLINE << 1) +#define CONTEXT_ENDBUF (CONTEXT_BEGBUF << 1) + +#define IS_WORD_CONTEXT(c) ((c) & CONTEXT_WORD) +#define IS_NEWLINE_CONTEXT(c) ((c) & CONTEXT_NEWLINE) +#define IS_BEGBUF_CONTEXT(c) ((c) & CONTEXT_BEGBUF) +#define IS_ENDBUF_CONTEXT(c) ((c) & CONTEXT_ENDBUF) +#define IS_ORDINARY_CONTEXT(c) ((c) == 0) + +#define IS_WORD_CHAR(ch) (isalnum (ch) || (ch) == '_') +#define IS_NEWLINE(ch) ((ch) == NEWLINE_CHAR) +#define IS_WIDE_WORD_CHAR(ch) (__iswalnum (ch) || (ch) == L'_') +#define IS_WIDE_NEWLINE(ch) ((ch) == WIDE_NEWLINE_CHAR) + +#define NOT_SATISFY_PREV_CONSTRAINT(constraint,context) \ + ((((constraint) & PREV_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \ + || ((constraint & PREV_NOTWORD_CONSTRAINT) && IS_WORD_CONTEXT (context)) \ + || ((constraint & PREV_NEWLINE_CONSTRAINT) && !IS_NEWLINE_CONTEXT (context))\ + || ((constraint & PREV_BEGBUF_CONSTRAINT) && !IS_BEGBUF_CONTEXT (context))) + +#define NOT_SATISFY_NEXT_CONSTRAINT(constraint,context) \ + ((((constraint) & NEXT_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \ + || (((constraint) & NEXT_NOTWORD_CONSTRAINT) && IS_WORD_CONTEXT (context)) \ + || (((constraint) & NEXT_NEWLINE_CONSTRAINT) && !IS_NEWLINE_CONTEXT (context)) \ + || (((constraint) & NEXT_ENDBUF_CONSTRAINT) && !IS_ENDBUF_CONTEXT (context))) + +struct re_dfastate_t +{ + re_hashval_t hash; + re_node_set nodes; + re_node_set non_eps_nodes; + re_node_set inveclosure; + re_node_set *entrance_nodes; + struct re_dfastate_t **trtable, **word_trtable; + unsigned int context : 4; + unsigned int halt : 1; + /* If this state can accept "multi byte". + Note that we refer to multibyte characters, and multi character + collating elements as "multi byte". */ + unsigned int accept_mb : 1; + /* If this state has backreference node(s). */ + unsigned int has_backref : 1; + unsigned int has_constraint : 1; +}; +typedef struct re_dfastate_t re_dfastate_t; + +struct re_state_table_entry +{ + Idx num; + Idx alloc; + re_dfastate_t **array; +}; + +/* Array type used in re_sub_match_last_t and re_sub_match_top_t. */ + +typedef struct +{ + Idx next_idx; + Idx alloc; + re_dfastate_t **array; +} state_array_t; + +/* Store information about the node NODE whose type is OP_CLOSE_SUBEXP. */ + +typedef struct +{ + Idx node; + Idx str_idx; /* The position NODE match at. */ + state_array_t path; +} re_sub_match_last_t; + +/* Store information about the node NODE whose type is OP_OPEN_SUBEXP. + And information about the node, whose type is OP_CLOSE_SUBEXP, + corresponding to NODE is stored in LASTS. */ + +typedef struct +{ + Idx str_idx; + Idx node; + state_array_t *path; + Idx alasts; /* Allocation size of LASTS. */ + Idx nlasts; /* The number of LASTS. */ + re_sub_match_last_t **lasts; +} re_sub_match_top_t; + +struct re_backref_cache_entry +{ + Idx node; + Idx str_idx; + Idx subexp_from; + Idx subexp_to; + char more; + char unused; + unsigned short int eps_reachable_subexps_map; +}; + +typedef struct +{ + /* The string object corresponding to the input string. */ + re_string_t input; +#if defined _LIBC || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) + const re_dfa_t *const dfa; +#else + const re_dfa_t *dfa; +#endif + /* EFLAGS of the argument of regexec. */ + int eflags; + /* Where the matching ends. */ + Idx match_last; + Idx last_node; + /* The state log used by the matcher. */ + re_dfastate_t **state_log; + Idx state_log_top; + /* Back reference cache. */ + Idx nbkref_ents; + Idx abkref_ents; + struct re_backref_cache_entry *bkref_ents; + int max_mb_elem_len; + Idx nsub_tops; + Idx asub_tops; + re_sub_match_top_t **sub_tops; +} re_match_context_t; + +typedef struct +{ + re_dfastate_t **sifted_states; + re_dfastate_t **limited_states; + Idx last_node; + Idx last_str_idx; + re_node_set limits; +} re_sift_context_t; + +struct re_fail_stack_ent_t +{ + Idx idx; + Idx node; + regmatch_t *regs; + re_node_set eps_via_nodes; +}; + +struct re_fail_stack_t +{ + Idx num; + Idx alloc; + struct re_fail_stack_ent_t *stack; +}; + +struct re_dfa_t +{ + re_token_t *nodes; + size_t nodes_alloc; + size_t nodes_len; + Idx *nexts; + Idx *org_indices; + re_node_set *edests; + re_node_set *eclosures; + re_node_set *inveclosures; + struct re_state_table_entry *state_table; + re_dfastate_t *init_state; + re_dfastate_t *init_state_word; + re_dfastate_t *init_state_nl; + re_dfastate_t *init_state_begbuf; + bin_tree_t *str_tree; + bin_tree_storage_t *str_tree_storage; + re_bitset_ptr_t sb_char; + int str_tree_storage_idx; + + /* number of subexpressions 're_nsub' is in regex_t. */ + re_hashval_t state_hash_mask; + Idx init_node; + Idx nbackref; /* The number of backreference in this dfa. */ + + /* Bitmap expressing which backreference is used. */ + bitset_word_t used_bkref_map; + bitset_word_t completed_bkref_map; + + unsigned int has_plural_match : 1; + /* If this dfa has "multibyte node", which is a backreference or + a node which can accept multibyte character or multi character + collating element. */ + unsigned int has_mb_node : 1; + unsigned int is_utf8 : 1; + unsigned int map_notascii : 1; + unsigned int word_ops_used : 1; + int mb_cur_max; + bitset_t word_char; + reg_syntax_t syntax; + Idx *subexp_map; +#ifdef DEBUG + char* re_str; +#endif + lock_define (lock) +}; + +#define re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set)) +#define re_node_set_remove(set,id) \ + (re_node_set_remove_at (set, re_node_set_contains (set, id) - 1)) +#define re_node_set_empty(p) ((p)->nelem = 0) +#define re_node_set_free(set) re_free ((set)->elems) + + +typedef enum +{ + SB_CHAR, + MB_CHAR, + EQUIV_CLASS, + COLL_SYM, + CHAR_CLASS +} bracket_elem_type; + +typedef struct +{ + bracket_elem_type type; + union + { + unsigned char ch; + unsigned char *name; + wchar_t wch; + } opr; +} bracket_elem_t; + + +/* Functions for bitset_t operation. */ + +static void +bitset_set (bitset_t set, Idx i) +{ + set[i / BITSET_WORD_BITS] |= (bitset_word_t) 1 << i % BITSET_WORD_BITS; +} + +static void +bitset_clear (bitset_t set, Idx i) +{ + set[i / BITSET_WORD_BITS] &= ~ ((bitset_word_t) 1 << i % BITSET_WORD_BITS); +} + +static bool +bitset_contain (const bitset_t set, Idx i) +{ + return (set[i / BITSET_WORD_BITS] >> i % BITSET_WORD_BITS) & 1; +} + +static void +bitset_empty (bitset_t set) +{ + memset (set, '\0', sizeof (bitset_t)); +} + +static void +bitset_set_all (bitset_t set) +{ + memset (set, -1, sizeof (bitset_word_t) * (SBC_MAX / BITSET_WORD_BITS)); + if (SBC_MAX % BITSET_WORD_BITS != 0) + set[BITSET_WORDS - 1] = + ((bitset_word_t) 1 << SBC_MAX % BITSET_WORD_BITS) - 1; +} + +static void +bitset_copy (bitset_t dest, const bitset_t src) +{ + memcpy (dest, src, sizeof (bitset_t)); +} + +static void __attribute__ ((unused)) +bitset_not (bitset_t set) +{ + int bitset_i; + for (bitset_i = 0; bitset_i < SBC_MAX / BITSET_WORD_BITS; ++bitset_i) + set[bitset_i] = ~set[bitset_i]; + if (SBC_MAX % BITSET_WORD_BITS != 0) + set[BITSET_WORDS - 1] = + ((((bitset_word_t) 1 << SBC_MAX % BITSET_WORD_BITS) - 1) + & ~set[BITSET_WORDS - 1]); +} + +static void __attribute__ ((unused)) +bitset_merge (bitset_t dest, const bitset_t src) +{ + int bitset_i; + for (bitset_i = 0; bitset_i < BITSET_WORDS; ++bitset_i) + dest[bitset_i] |= src[bitset_i]; +} + +static void __attribute__ ((unused)) +bitset_mask (bitset_t dest, const bitset_t src) +{ + int bitset_i; + for (bitset_i = 0; bitset_i < BITSET_WORDS; ++bitset_i) + dest[bitset_i] &= src[bitset_i]; +} + +#ifdef RE_ENABLE_I18N +/* Functions for re_string. */ +static int +internal_function __attribute__ ((pure, unused)) +re_string_char_size_at (const re_string_t *pstr, Idx idx) +{ + int byte_idx; + if (pstr->mb_cur_max == 1) + return 1; + for (byte_idx = 1; idx + byte_idx < pstr->valid_len; ++byte_idx) + if (pstr->wcs[idx + byte_idx] != WEOF) + break; + return byte_idx; +} + +static wint_t +internal_function __attribute__ ((pure, unused)) +re_string_wchar_at (const re_string_t *pstr, Idx idx) +{ + if (pstr->mb_cur_max == 1) + return (wint_t) pstr->mbs[idx]; + return (wint_t) pstr->wcs[idx]; +} + +# ifdef _LIBC +# include <locale/weight.h> +# endif + +static int +internal_function __attribute__ ((pure, unused)) +re_string_elem_size_at (const re_string_t *pstr, Idx idx) +{ +# ifdef _LIBC + const unsigned char *p, *extra; + const int32_t *table, *indirect; + uint_fast32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); + + if (nrules != 0) + { + table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB); + extra = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB); + indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_INDIRECTMB); + p = pstr->mbs + idx; + findidx (table, indirect, extra, &p, pstr->len - idx); + return p - pstr->mbs - idx; + } + else +# endif /* _LIBC */ + return 1; +} +#endif /* RE_ENABLE_I18N */ + +#ifndef __GNUC_PREREQ +# if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +# else +# define __GNUC_PREREQ(maj, min) 0 +# endif +#endif + +#if __GNUC_PREREQ (3,4) +# undef __attribute_warn_unused_result__ +# define __attribute_warn_unused_result__ \ + __attribute__ ((__warn_unused_result__)) +#else +# define __attribute_warn_unused_result__ /* empty */ +#endif + +#endif /* _REGEX_INTERNAL_H */ diff --git a/local/recipes/tools/diffutils/source/lib/regexec.c b/local/recipes/tools/diffutils/source/lib/regexec.c new file mode 100644 index 0000000000..45bc796d4c --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/regexec.c @@ -0,0 +1,4393 @@ +/* Extended regular expression matching and search library. + Copyright (C) 2002-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags, + Idx n) internal_function; +static void match_ctx_clean (re_match_context_t *mctx) internal_function; +static void match_ctx_free (re_match_context_t *cache) internal_function; +static reg_errcode_t match_ctx_add_entry (re_match_context_t *cache, Idx node, + Idx str_idx, Idx from, Idx to) + internal_function; +static Idx search_cur_bkref_entry (const re_match_context_t *mctx, Idx str_idx) + internal_function; +static reg_errcode_t match_ctx_add_subtop (re_match_context_t *mctx, Idx node, + Idx str_idx) internal_function; +static re_sub_match_last_t * match_ctx_add_sublast (re_sub_match_top_t *subtop, + Idx node, Idx str_idx) + internal_function; +static void sift_ctx_init (re_sift_context_t *sctx, re_dfastate_t **sifted_sts, + re_dfastate_t **limited_sts, Idx last_node, + Idx last_str_idx) + internal_function; +static reg_errcode_t re_search_internal (const regex_t *preg, + const char *string, Idx length, + Idx start, Idx last_start, Idx stop, + size_t nmatch, regmatch_t pmatch[], + int eflags) internal_function; +static regoff_t re_search_2_stub (struct re_pattern_buffer *bufp, + const char *string1, Idx length1, + const char *string2, Idx length2, + Idx start, regoff_t range, + struct re_registers *regs, + Idx stop, bool ret_len) internal_function; +static regoff_t re_search_stub (struct re_pattern_buffer *bufp, + const char *string, Idx length, Idx start, + regoff_t range, Idx stop, + struct re_registers *regs, + bool ret_len) internal_function; +static unsigned re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, + Idx nregs, int regs_allocated) internal_function; +static reg_errcode_t prune_impossible_nodes (re_match_context_t *mctx) + internal_function; +static Idx check_matching (re_match_context_t *mctx, bool fl_longest_match, + Idx *p_match_first) internal_function; +static Idx check_halt_state_context (const re_match_context_t *mctx, + const re_dfastate_t *state, Idx idx) + internal_function; +static void update_regs (const re_dfa_t *dfa, regmatch_t *pmatch, + regmatch_t *prev_idx_match, Idx cur_node, + Idx cur_idx, Idx nmatch) internal_function; +static reg_errcode_t push_fail_stack (struct re_fail_stack_t *fs, + Idx str_idx, Idx dest_node, Idx nregs, + regmatch_t *regs, + re_node_set *eps_via_nodes) + internal_function; +static reg_errcode_t set_regs (const regex_t *preg, + const re_match_context_t *mctx, + size_t nmatch, regmatch_t *pmatch, + bool fl_backtrack) internal_function; +static reg_errcode_t free_fail_stack_return (struct re_fail_stack_t *fs) + internal_function; + +#ifdef RE_ENABLE_I18N +static int sift_states_iter_mb (const re_match_context_t *mctx, + re_sift_context_t *sctx, + Idx node_idx, Idx str_idx, Idx max_str_idx) + internal_function; +#endif /* RE_ENABLE_I18N */ +static reg_errcode_t sift_states_backward (const re_match_context_t *mctx, + re_sift_context_t *sctx) + internal_function; +static reg_errcode_t build_sifted_states (const re_match_context_t *mctx, + re_sift_context_t *sctx, Idx str_idx, + re_node_set *cur_dest) + internal_function; +static reg_errcode_t update_cur_sifted_state (const re_match_context_t *mctx, + re_sift_context_t *sctx, + Idx str_idx, + re_node_set *dest_nodes) + internal_function; +static reg_errcode_t add_epsilon_src_nodes (const re_dfa_t *dfa, + re_node_set *dest_nodes, + const re_node_set *candidates) + internal_function; +static bool check_dst_limits (const re_match_context_t *mctx, + const re_node_set *limits, + Idx dst_node, Idx dst_idx, Idx src_node, + Idx src_idx) internal_function; +static int check_dst_limits_calc_pos_1 (const re_match_context_t *mctx, + int boundaries, Idx subexp_idx, + Idx from_node, Idx bkref_idx) + internal_function; +static int check_dst_limits_calc_pos (const re_match_context_t *mctx, + Idx limit, Idx subexp_idx, + Idx node, Idx str_idx, + Idx bkref_idx) internal_function; +static reg_errcode_t check_subexp_limits (const re_dfa_t *dfa, + re_node_set *dest_nodes, + const re_node_set *candidates, + re_node_set *limits, + struct re_backref_cache_entry *bkref_ents, + Idx str_idx) internal_function; +static reg_errcode_t sift_states_bkref (const re_match_context_t *mctx, + re_sift_context_t *sctx, + Idx str_idx, const re_node_set *candidates) + internal_function; +static reg_errcode_t merge_state_array (const re_dfa_t *dfa, + re_dfastate_t **dst, + re_dfastate_t **src, Idx num) + internal_function; +static re_dfastate_t *find_recover_state (reg_errcode_t *err, + re_match_context_t *mctx) internal_function; +static re_dfastate_t *transit_state (reg_errcode_t *err, + re_match_context_t *mctx, + re_dfastate_t *state) internal_function; +static re_dfastate_t *merge_state_with_log (reg_errcode_t *err, + re_match_context_t *mctx, + re_dfastate_t *next_state) + internal_function; +static reg_errcode_t check_subexp_matching_top (re_match_context_t *mctx, + re_node_set *cur_nodes, + Idx str_idx) internal_function; +#if 0 +static re_dfastate_t *transit_state_sb (reg_errcode_t *err, + re_match_context_t *mctx, + re_dfastate_t *pstate) + internal_function; +#endif +#ifdef RE_ENABLE_I18N +static reg_errcode_t transit_state_mb (re_match_context_t *mctx, + re_dfastate_t *pstate) + internal_function; +#endif /* RE_ENABLE_I18N */ +static reg_errcode_t transit_state_bkref (re_match_context_t *mctx, + const re_node_set *nodes) + internal_function; +static reg_errcode_t get_subexp (re_match_context_t *mctx, + Idx bkref_node, Idx bkref_str_idx) + internal_function; +static reg_errcode_t get_subexp_sub (re_match_context_t *mctx, + const re_sub_match_top_t *sub_top, + re_sub_match_last_t *sub_last, + Idx bkref_node, Idx bkref_str) + internal_function; +static Idx find_subexp_node (const re_dfa_t *dfa, const re_node_set *nodes, + Idx subexp_idx, int type) internal_function; +static reg_errcode_t check_arrival (re_match_context_t *mctx, + state_array_t *path, Idx top_node, + Idx top_str, Idx last_node, Idx last_str, + int type) internal_function; +static reg_errcode_t check_arrival_add_next_nodes (re_match_context_t *mctx, + Idx str_idx, + re_node_set *cur_nodes, + re_node_set *next_nodes) + internal_function; +static reg_errcode_t check_arrival_expand_ecl (const re_dfa_t *dfa, + re_node_set *cur_nodes, + Idx ex_subexp, int type) + internal_function; +static reg_errcode_t check_arrival_expand_ecl_sub (const re_dfa_t *dfa, + re_node_set *dst_nodes, + Idx target, Idx ex_subexp, + int type) internal_function; +static reg_errcode_t expand_bkref_cache (re_match_context_t *mctx, + re_node_set *cur_nodes, Idx cur_str, + Idx subexp_num, int type) + internal_function; +static bool build_trtable (const re_dfa_t *dfa, + re_dfastate_t *state) internal_function; +#ifdef RE_ENABLE_I18N +static int check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx, + const re_string_t *input, Idx idx) + internal_function; +# ifdef _LIBC +static unsigned int find_collation_sequence_value (const unsigned char *mbs, + size_t name_len) + internal_function; +# endif /* _LIBC */ +#endif /* RE_ENABLE_I18N */ +static Idx group_nodes_into_DFAstates (const re_dfa_t *dfa, + const re_dfastate_t *state, + re_node_set *states_node, + bitset_t *states_ch) internal_function; +static bool check_node_accept (const re_match_context_t *mctx, + const re_token_t *node, Idx idx) + internal_function; +static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len) + internal_function; + +/* Entry point for POSIX code. */ + +/* regexec searches for a given pattern, specified by PREG, in the + string STRING. + + If NMATCH is zero or REG_NOSUB was set in the cflags argument to + 'regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at + least NMATCH elements, and we set them to the offsets of the + corresponding matched substrings. + + EFLAGS specifies "execution flags" which affect matching: if + REG_NOTBOL is set, then ^ does not match at the beginning of the + string; if REG_NOTEOL is set, then $ does not match at the end. + + We return 0 if we find a match and REG_NOMATCH if not. */ + +int +regexec (const regex_t *_Restrict_ preg, const char *_Restrict_ string, + size_t nmatch, regmatch_t pmatch[], int eflags) +{ + reg_errcode_t err; + Idx start, length; + re_dfa_t *dfa = preg->buffer; + + if (eflags & ~(REG_NOTBOL | REG_NOTEOL | REG_STARTEND)) + return REG_BADPAT; + + if (eflags & REG_STARTEND) + { + start = pmatch[0].rm_so; + length = pmatch[0].rm_eo; + } + else + { + start = 0; + length = strlen (string); + } + + lock_lock (dfa->lock); + if (preg->no_sub) + err = re_search_internal (preg, string, length, start, length, + length, 0, NULL, eflags); + else + err = re_search_internal (preg, string, length, start, length, + length, nmatch, pmatch, eflags); + lock_unlock (dfa->lock); + return err != REG_NOERROR; +} + +#ifdef _LIBC +# include <shlib-compat.h> +versioned_symbol (libc, __regexec, regexec, GLIBC_2_3_4); + +# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) +__typeof__ (__regexec) __compat_regexec; + +int +attribute_compat_text_section +__compat_regexec (const regex_t *_Restrict_ preg, + const char *_Restrict_ string, size_t nmatch, + regmatch_t pmatch[], int eflags) +{ + return regexec (preg, string, nmatch, pmatch, + eflags & (REG_NOTBOL | REG_NOTEOL)); +} +compat_symbol (libc, __compat_regexec, regexec, GLIBC_2_0); +# endif +#endif + +/* Entry points for GNU code. */ + +/* re_match, re_search, re_match_2, re_search_2 + + The former two functions operate on STRING with length LENGTH, + while the later two operate on concatenation of STRING1 and STRING2 + with lengths LENGTH1 and LENGTH2, respectively. + + re_match() matches the compiled pattern in BUFP against the string, + starting at index START. + + re_search() first tries matching at index START, then it tries to match + starting from index START + 1, and so on. The last start position tried + is START + RANGE. (Thus RANGE = 0 forces re_search to operate the same + way as re_match().) + + The parameter STOP of re_{match,search}_2 specifies that no match exceeding + the first STOP characters of the concatenation of the strings should be + concerned. + + If REGS is not NULL, and BUFP->no_sub is not set, the offsets of the match + and all groups is stored in REGS. (For the "_2" variants, the offsets are + computed relative to the concatenation, not relative to the individual + strings.) + + On success, re_match* functions return the length of the match, re_search* + return the position of the start of the match. Return value -1 means no + match was found and -2 indicates an internal error. */ + +regoff_t +re_match (struct re_pattern_buffer *bufp, const char *string, Idx length, + Idx start, struct re_registers *regs) +{ + return re_search_stub (bufp, string, length, start, 0, length, regs, true); +} +#ifdef _LIBC +weak_alias (__re_match, re_match) +#endif + +regoff_t +re_search (struct re_pattern_buffer *bufp, const char *string, Idx length, + Idx start, regoff_t range, struct re_registers *regs) +{ + return re_search_stub (bufp, string, length, start, range, length, regs, + false); +} +#ifdef _LIBC +weak_alias (__re_search, re_search) +#endif + +regoff_t +re_match_2 (struct re_pattern_buffer *bufp, const char *string1, Idx length1, + const char *string2, Idx length2, Idx start, + struct re_registers *regs, Idx stop) +{ + return re_search_2_stub (bufp, string1, length1, string2, length2, + start, 0, regs, stop, true); +} +#ifdef _LIBC +weak_alias (__re_match_2, re_match_2) +#endif + +regoff_t +re_search_2 (struct re_pattern_buffer *bufp, const char *string1, Idx length1, + const char *string2, Idx length2, Idx start, regoff_t range, + struct re_registers *regs, Idx stop) +{ + return re_search_2_stub (bufp, string1, length1, string2, length2, + start, range, regs, stop, false); +} +#ifdef _LIBC +weak_alias (__re_search_2, re_search_2) +#endif + +static regoff_t +internal_function +re_search_2_stub (struct re_pattern_buffer *bufp, const char *string1, + Idx length1, const char *string2, Idx length2, Idx start, + regoff_t range, struct re_registers *regs, + Idx stop, bool ret_len) +{ + const char *str; + regoff_t rval; + Idx len; + char *s = NULL; + + if (BE ((length1 < 0 || length2 < 0 || stop < 0 + || INT_ADD_WRAPV (length1, length2, &len)), + 0)) + return -2; + + /* Concatenate the strings. */ + if (length2 > 0) + if (length1 > 0) + { + s = re_malloc (char, len); + + if (BE (s == NULL, 0)) + return -2; +#ifdef _LIBC + memcpy (__mempcpy (s, string1, length1), string2, length2); +#else + memcpy (s, string1, length1); + memcpy (s + length1, string2, length2); +#endif + str = s; + } + else + str = string2; + else + str = string1; + + rval = re_search_stub (bufp, str, len, start, range, stop, regs, + ret_len); + re_free (s); + return rval; +} + +/* The parameters have the same meaning as those of re_search. + Additional parameters: + If RET_LEN is true the length of the match is returned (re_match style); + otherwise the position of the match is returned. */ + +static regoff_t +internal_function +re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length, + Idx start, regoff_t range, Idx stop, struct re_registers *regs, + bool ret_len) +{ + reg_errcode_t result; + regmatch_t *pmatch; + Idx nregs; + regoff_t rval; + int eflags = 0; + re_dfa_t *dfa = bufp->buffer; + Idx last_start = start + range; + + /* Check for out-of-range. */ + if (BE (start < 0 || start > length, 0)) + return -1; + if (BE (length < last_start || (0 <= range && last_start < start), 0)) + last_start = length; + else if (BE (last_start < 0 || (range < 0 && start <= last_start), 0)) + last_start = 0; + + lock_lock (dfa->lock); + + eflags |= (bufp->not_bol) ? REG_NOTBOL : 0; + eflags |= (bufp->not_eol) ? REG_NOTEOL : 0; + + /* Compile fastmap if we haven't yet. */ + if (start < last_start && bufp->fastmap != NULL && !bufp->fastmap_accurate) + re_compile_fastmap (bufp); + + if (BE (bufp->no_sub, 0)) + regs = NULL; + + /* We need at least 1 register. */ + if (regs == NULL) + nregs = 1; + else if (BE (bufp->regs_allocated == REGS_FIXED + && regs->num_regs <= bufp->re_nsub, 0)) + { + nregs = regs->num_regs; + if (BE (nregs < 1, 0)) + { + /* Nothing can be copied to regs. */ + regs = NULL; + nregs = 1; + } + } + else + nregs = bufp->re_nsub + 1; + pmatch = re_malloc (regmatch_t, nregs); + if (BE (pmatch == NULL, 0)) + { + rval = -2; + goto out; + } + + result = re_search_internal (bufp, string, length, start, last_start, stop, + nregs, pmatch, eflags); + + rval = 0; + + /* I hope we needn't fill their regs with -1's when no match was found. */ + if (result != REG_NOERROR) + rval = result == REG_NOMATCH ? -1 : -2; + else if (regs != NULL) + { + /* If caller wants register contents data back, copy them. */ + bufp->regs_allocated = re_copy_regs (regs, pmatch, nregs, + bufp->regs_allocated); + if (BE (bufp->regs_allocated == REGS_UNALLOCATED, 0)) + rval = -2; + } + + if (BE (rval == 0, 1)) + { + if (ret_len) + { + assert (pmatch[0].rm_so == start); + rval = pmatch[0].rm_eo - start; + } + else + rval = pmatch[0].rm_so; + } + re_free (pmatch); + out: + lock_unlock (dfa->lock); + return rval; +} + +static unsigned +internal_function +re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, Idx nregs, + int regs_allocated) +{ + int rval = REGS_REALLOCATE; + Idx i; + Idx need_regs = nregs + 1; + /* We need one extra element beyond 'num_regs' for the '-1' marker GNU code + uses. */ + + /* Have the register data arrays been allocated? */ + if (regs_allocated == REGS_UNALLOCATED) + { /* No. So allocate them with malloc. */ + regs->start = re_malloc (regoff_t, need_regs); + if (BE (regs->start == NULL, 0)) + return REGS_UNALLOCATED; + regs->end = re_malloc (regoff_t, need_regs); + if (BE (regs->end == NULL, 0)) + { + re_free (regs->start); + return REGS_UNALLOCATED; + } + regs->num_regs = need_regs; + } + else if (regs_allocated == REGS_REALLOCATE) + { /* Yes. If we need more elements than were already + allocated, reallocate them. If we need fewer, just + leave it alone. */ + if (BE (need_regs > regs->num_regs, 0)) + { + regoff_t *new_start = re_realloc (regs->start, regoff_t, need_regs); + regoff_t *new_end; + if (BE (new_start == NULL, 0)) + return REGS_UNALLOCATED; + new_end = re_realloc (regs->end, regoff_t, need_regs); + if (BE (new_end == NULL, 0)) + { + re_free (new_start); + return REGS_UNALLOCATED; + } + regs->start = new_start; + regs->end = new_end; + regs->num_regs = need_regs; + } + } + else + { + assert (regs_allocated == REGS_FIXED); + /* This function may not be called with REGS_FIXED and nregs too big. */ + assert (regs->num_regs >= nregs); + rval = REGS_FIXED; + } + + /* Copy the regs. */ + for (i = 0; i < nregs; ++i) + { + regs->start[i] = pmatch[i].rm_so; + regs->end[i] = pmatch[i].rm_eo; + } + for ( ; i < regs->num_regs; ++i) + regs->start[i] = regs->end[i] = -1; + + return rval; +} + +/* Set REGS to hold NUM_REGS registers, storing them in STARTS and + ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use + this memory for recording register information. STARTS and ENDS + must be allocated using the malloc library routine, and must each + be at least NUM_REGS * sizeof (regoff_t) bytes long. + + If NUM_REGS == 0, then subsequent matches should allocate their own + register data. + + Unless this function is called, the first search or match using + PATTERN_BUFFER will allocate its own register data, without + freeing the old data. */ + +void +re_set_registers (struct re_pattern_buffer *bufp, struct re_registers *regs, + __re_size_t num_regs, regoff_t *starts, regoff_t *ends) +{ + if (num_regs) + { + bufp->regs_allocated = REGS_REALLOCATE; + regs->num_regs = num_regs; + regs->start = starts; + regs->end = ends; + } + else + { + bufp->regs_allocated = REGS_UNALLOCATED; + regs->num_regs = 0; + regs->start = regs->end = NULL; + } +} +#ifdef _LIBC +weak_alias (__re_set_registers, re_set_registers) +#endif + +/* Entry points compatible with 4.2 BSD regex library. We don't define + them unless specifically requested. */ + +#if defined _REGEX_RE_COMP || defined _LIBC +int +# ifdef _LIBC +weak_function +# endif +re_exec (const char *s) +{ + return 0 == regexec (&re_comp_buf, s, 0, NULL, 0); +} +#endif /* _REGEX_RE_COMP */ + +/* Internal entry point. */ + +/* Searches for a compiled pattern PREG in the string STRING, whose + length is LENGTH. NMATCH, PMATCH, and EFLAGS have the same + meaning as with regexec. LAST_START is START + RANGE, where + START and RANGE have the same meaning as with re_search. + Return REG_NOERROR if we find a match, and REG_NOMATCH if not, + otherwise return the error code. + Note: We assume front end functions already check ranges. + (0 <= LAST_START && LAST_START <= LENGTH) */ + +static reg_errcode_t +__attribute_warn_unused_result__ internal_function +re_search_internal (const regex_t *preg, const char *string, Idx length, + Idx start, Idx last_start, Idx stop, size_t nmatch, + regmatch_t pmatch[], int eflags) +{ + reg_errcode_t err; + const re_dfa_t *dfa = preg->buffer; + Idx left_lim, right_lim; + int incr; + bool fl_longest_match; + int match_kind; + Idx match_first; + Idx match_last = -1; + Idx extra_nmatch; + bool sb; + int ch; +#if defined _LIBC || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) + re_match_context_t mctx = { .dfa = dfa }; +#else + re_match_context_t mctx; +#endif + char *fastmap = ((preg->fastmap != NULL && preg->fastmap_accurate + && start != last_start && !preg->can_be_null) + ? preg->fastmap : NULL); + RE_TRANSLATE_TYPE t = preg->translate; + +#if !(defined _LIBC || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) + memset (&mctx, '\0', sizeof (re_match_context_t)); + mctx.dfa = dfa; +#endif + + extra_nmatch = (nmatch > preg->re_nsub) ? nmatch - (preg->re_nsub + 1) : 0; + nmatch -= extra_nmatch; + + /* Check if the DFA haven't been compiled. */ + if (BE (preg->used == 0 || dfa->init_state == NULL + || dfa->init_state_word == NULL || dfa->init_state_nl == NULL + || dfa->init_state_begbuf == NULL, 0)) + return REG_NOMATCH; + +#ifdef DEBUG + /* We assume front-end functions already check them. */ + assert (0 <= last_start && last_start <= length); +#endif + + /* If initial states with non-begbuf contexts have no elements, + the regex must be anchored. If preg->newline_anchor is set, + we'll never use init_state_nl, so do not check it. */ + if (dfa->init_state->nodes.nelem == 0 + && dfa->init_state_word->nodes.nelem == 0 + && (dfa->init_state_nl->nodes.nelem == 0 + || !preg->newline_anchor)) + { + if (start != 0 && last_start != 0) + return REG_NOMATCH; + start = last_start = 0; + } + + /* We must check the longest matching, if nmatch > 0. */ + fl_longest_match = (nmatch != 0 || dfa->nbackref); + + err = re_string_allocate (&mctx.input, string, length, dfa->nodes_len + 1, + preg->translate, (preg->syntax & RE_ICASE) != 0, + dfa); + if (BE (err != REG_NOERROR, 0)) + goto free_return; + mctx.input.stop = stop; + mctx.input.raw_stop = stop; + mctx.input.newline_anchor = preg->newline_anchor; + + err = match_ctx_init (&mctx, eflags, dfa->nbackref * 2); + if (BE (err != REG_NOERROR, 0)) + goto free_return; + + /* We will log all the DFA states through which the dfa pass, + if nmatch > 1, or this dfa has "multibyte node", which is a + back-reference or a node which can accept multibyte character or + multi character collating element. */ + if (nmatch > 1 || dfa->has_mb_node) + { + /* Avoid overflow. */ + if (BE ((MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) + <= mctx.input.bufs_len), 0)) + { + err = REG_ESPACE; + goto free_return; + } + + mctx.state_log = re_malloc (re_dfastate_t *, mctx.input.bufs_len + 1); + if (BE (mctx.state_log == NULL, 0)) + { + err = REG_ESPACE; + goto free_return; + } + } + else + mctx.state_log = NULL; + + match_first = start; + mctx.input.tip_context = (eflags & REG_NOTBOL) ? CONTEXT_BEGBUF + : CONTEXT_NEWLINE | CONTEXT_BEGBUF; + + /* Check incrementally whether the input string matches. */ + incr = (last_start < start) ? -1 : 1; + left_lim = (last_start < start) ? last_start : start; + right_lim = (last_start < start) ? start : last_start; + sb = dfa->mb_cur_max == 1; + match_kind = + (fastmap + ? ((sb || !(preg->syntax & RE_ICASE || t) ? 4 : 0) + | (start <= last_start ? 2 : 0) + | (t != NULL ? 1 : 0)) + : 8); + + for (;; match_first += incr) + { + err = REG_NOMATCH; + if (match_first < left_lim || right_lim < match_first) + goto free_return; + + /* Advance as rapidly as possible through the string, until we + find a plausible place to start matching. This may be done + with varying efficiency, so there are various possibilities: + only the most common of them are specialized, in order to + save on code size. We use a switch statement for speed. */ + switch (match_kind) + { + case 8: + /* No fastmap. */ + break; + + case 7: + /* Fastmap with single-byte translation, match forward. */ + while (BE (match_first < right_lim, 1) + && !fastmap[t[(unsigned char) string[match_first]]]) + ++match_first; + goto forward_match_found_start_or_reached_end; + + case 6: + /* Fastmap without translation, match forward. */ + while (BE (match_first < right_lim, 1) + && !fastmap[(unsigned char) string[match_first]]) + ++match_first; + + forward_match_found_start_or_reached_end: + if (BE (match_first == right_lim, 0)) + { + ch = match_first >= length + ? 0 : (unsigned char) string[match_first]; + if (!fastmap[t ? t[ch] : ch]) + goto free_return; + } + break; + + case 4: + case 5: + /* Fastmap without multi-byte translation, match backwards. */ + while (match_first >= left_lim) + { + ch = match_first >= length + ? 0 : (unsigned char) string[match_first]; + if (fastmap[t ? t[ch] : ch]) + break; + --match_first; + } + if (match_first < left_lim) + goto free_return; + break; + + default: + /* In this case, we can't determine easily the current byte, + since it might be a component byte of a multibyte + character. Then we use the constructed buffer instead. */ + for (;;) + { + /* If MATCH_FIRST is out of the valid range, reconstruct the + buffers. */ + __re_size_t offset = match_first - mctx.input.raw_mbs_idx; + if (BE (offset >= (__re_size_t) mctx.input.valid_raw_len, 0)) + { + err = re_string_reconstruct (&mctx.input, match_first, + eflags); + if (BE (err != REG_NOERROR, 0)) + goto free_return; + + offset = match_first - mctx.input.raw_mbs_idx; + } + /* If MATCH_FIRST is out of the buffer, leave it as '\0'. + Note that MATCH_FIRST must not be smaller than 0. */ + ch = (match_first >= length + ? 0 : re_string_byte_at (&mctx.input, offset)); + if (fastmap[ch]) + break; + match_first += incr; + if (match_first < left_lim || match_first > right_lim) + { + err = REG_NOMATCH; + goto free_return; + } + } + break; + } + + /* Reconstruct the buffers so that the matcher can assume that + the matching starts from the beginning of the buffer. */ + err = re_string_reconstruct (&mctx.input, match_first, eflags); + if (BE (err != REG_NOERROR, 0)) + goto free_return; + +#ifdef RE_ENABLE_I18N + /* Don't consider this char as a possible match start if it part, + yet isn't the head, of a multibyte character. */ + if (!sb && !re_string_first_byte (&mctx.input, 0)) + continue; +#endif + + /* It seems to be appropriate one, then use the matcher. */ + /* We assume that the matching starts from 0. */ + mctx.state_log_top = mctx.nbkref_ents = mctx.max_mb_elem_len = 0; + match_last = check_matching (&mctx, fl_longest_match, + start <= last_start ? &match_first : NULL); + if (match_last != -1) + { + if (BE (match_last == -2, 0)) + { + err = REG_ESPACE; + goto free_return; + } + else + { + mctx.match_last = match_last; + if ((!preg->no_sub && nmatch > 1) || dfa->nbackref) + { + re_dfastate_t *pstate = mctx.state_log[match_last]; + mctx.last_node = check_halt_state_context (&mctx, pstate, + match_last); + } + if ((!preg->no_sub && nmatch > 1 && dfa->has_plural_match) + || dfa->nbackref) + { + err = prune_impossible_nodes (&mctx); + if (err == REG_NOERROR) + break; + if (BE (err != REG_NOMATCH, 0)) + goto free_return; + match_last = -1; + } + else + break; /* We found a match. */ + } + } + + match_ctx_clean (&mctx); + } + +#ifdef DEBUG + assert (match_last != -1); + assert (err == REG_NOERROR); +#endif + + /* Set pmatch[] if we need. */ + if (nmatch > 0) + { + Idx reg_idx; + + /* Initialize registers. */ + for (reg_idx = 1; reg_idx < nmatch; ++reg_idx) + pmatch[reg_idx].rm_so = pmatch[reg_idx].rm_eo = -1; + + /* Set the points where matching start/end. */ + pmatch[0].rm_so = 0; + pmatch[0].rm_eo = mctx.match_last; + /* FIXME: This function should fail if mctx.match_last exceeds + the maximum possible regoff_t value. We need a new error + code REG_OVERFLOW. */ + + if (!preg->no_sub && nmatch > 1) + { + err = set_regs (preg, &mctx, nmatch, pmatch, + dfa->has_plural_match && dfa->nbackref > 0); + if (BE (err != REG_NOERROR, 0)) + goto free_return; + } + + /* At last, add the offset to each register, since we slid + the buffers so that we could assume that the matching starts + from 0. */ + for (reg_idx = 0; reg_idx < nmatch; ++reg_idx) + if (pmatch[reg_idx].rm_so != -1) + { +#ifdef RE_ENABLE_I18N + if (BE (mctx.input.offsets_needed != 0, 0)) + { + pmatch[reg_idx].rm_so = + (pmatch[reg_idx].rm_so == mctx.input.valid_len + ? mctx.input.valid_raw_len + : mctx.input.offsets[pmatch[reg_idx].rm_so]); + pmatch[reg_idx].rm_eo = + (pmatch[reg_idx].rm_eo == mctx.input.valid_len + ? mctx.input.valid_raw_len + : mctx.input.offsets[pmatch[reg_idx].rm_eo]); + } +#else + assert (mctx.input.offsets_needed == 0); +#endif + pmatch[reg_idx].rm_so += match_first; + pmatch[reg_idx].rm_eo += match_first; + } + for (reg_idx = 0; reg_idx < extra_nmatch; ++reg_idx) + { + pmatch[nmatch + reg_idx].rm_so = -1; + pmatch[nmatch + reg_idx].rm_eo = -1; + } + + if (dfa->subexp_map) + for (reg_idx = 0; reg_idx + 1 < nmatch; reg_idx++) + if (dfa->subexp_map[reg_idx] != reg_idx) + { + pmatch[reg_idx + 1].rm_so + = pmatch[dfa->subexp_map[reg_idx] + 1].rm_so; + pmatch[reg_idx + 1].rm_eo + = pmatch[dfa->subexp_map[reg_idx] + 1].rm_eo; + } + } + + free_return: + re_free (mctx.state_log); + if (dfa->nbackref) + match_ctx_free (&mctx); + re_string_destruct (&mctx.input); + return err; +} + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +prune_impossible_nodes (re_match_context_t *mctx) +{ + const re_dfa_t *const dfa = mctx->dfa; + Idx halt_node, match_last; + reg_errcode_t ret; + re_dfastate_t **sifted_states; + re_dfastate_t **lim_states = NULL; + re_sift_context_t sctx; +#ifdef DEBUG + assert (mctx->state_log != NULL); +#endif + match_last = mctx->match_last; + halt_node = mctx->last_node; + + /* Avoid overflow. */ + if (BE (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) <= match_last, 0)) + return REG_ESPACE; + + sifted_states = re_malloc (re_dfastate_t *, match_last + 1); + if (BE (sifted_states == NULL, 0)) + { + ret = REG_ESPACE; + goto free_return; + } + if (dfa->nbackref) + { + lim_states = re_malloc (re_dfastate_t *, match_last + 1); + if (BE (lim_states == NULL, 0)) + { + ret = REG_ESPACE; + goto free_return; + } + while (1) + { + memset (lim_states, '\0', + sizeof (re_dfastate_t *) * (match_last + 1)); + sift_ctx_init (&sctx, sifted_states, lim_states, halt_node, + match_last); + ret = sift_states_backward (mctx, &sctx); + re_node_set_free (&sctx.limits); + if (BE (ret != REG_NOERROR, 0)) + goto free_return; + if (sifted_states[0] != NULL || lim_states[0] != NULL) + break; + do + { + --match_last; + if (match_last < 0) + { + ret = REG_NOMATCH; + goto free_return; + } + } while (mctx->state_log[match_last] == NULL + || !mctx->state_log[match_last]->halt); + halt_node = check_halt_state_context (mctx, + mctx->state_log[match_last], + match_last); + } + ret = merge_state_array (dfa, sifted_states, lim_states, + match_last + 1); + re_free (lim_states); + lim_states = NULL; + if (BE (ret != REG_NOERROR, 0)) + goto free_return; + } + else + { + sift_ctx_init (&sctx, sifted_states, lim_states, halt_node, match_last); + ret = sift_states_backward (mctx, &sctx); + re_node_set_free (&sctx.limits); + if (BE (ret != REG_NOERROR, 0)) + goto free_return; + if (sifted_states[0] == NULL) + { + ret = REG_NOMATCH; + goto free_return; + } + } + re_free (mctx->state_log); + mctx->state_log = sifted_states; + sifted_states = NULL; + mctx->last_node = halt_node; + mctx->match_last = match_last; + ret = REG_NOERROR; + free_return: + re_free (sifted_states); + re_free (lim_states); + return ret; +} + +/* Acquire an initial state and return it. + We must select appropriate initial state depending on the context, + since initial states may have constraints like "\<", "^", etc.. */ + +static inline re_dfastate_t * +__attribute__ ((always_inline)) internal_function +acquire_init_state_context (reg_errcode_t *err, const re_match_context_t *mctx, + Idx idx) +{ + const re_dfa_t *const dfa = mctx->dfa; + if (dfa->init_state->has_constraint) + { + unsigned int context; + context = re_string_context_at (&mctx->input, idx - 1, mctx->eflags); + if (IS_WORD_CONTEXT (context)) + return dfa->init_state_word; + else if (IS_ORDINARY_CONTEXT (context)) + return dfa->init_state; + else if (IS_BEGBUF_CONTEXT (context) && IS_NEWLINE_CONTEXT (context)) + return dfa->init_state_begbuf; + else if (IS_NEWLINE_CONTEXT (context)) + return dfa->init_state_nl; + else if (IS_BEGBUF_CONTEXT (context)) + { + /* It is relatively rare case, then calculate on demand. */ + return re_acquire_state_context (err, dfa, + dfa->init_state->entrance_nodes, + context); + } + else + /* Must not happen? */ + return dfa->init_state; + } + else + return dfa->init_state; +} + +/* Check whether the regular expression match input string INPUT or not, + and return the index where the matching end. Return -1 if + there is no match, and return -2 in case of an error. + FL_LONGEST_MATCH means we want the POSIX longest matching. + If P_MATCH_FIRST is not NULL, and the match fails, it is set to the + next place where we may want to try matching. + Note that the matcher assumes that the matching starts from the current + index of the buffer. */ + +static Idx +internal_function __attribute_warn_unused_result__ +check_matching (re_match_context_t *mctx, bool fl_longest_match, + Idx *p_match_first) +{ + const re_dfa_t *const dfa = mctx->dfa; + reg_errcode_t err; + Idx match = 0; + Idx match_last = -1; + Idx cur_str_idx = re_string_cur_idx (&mctx->input); + re_dfastate_t *cur_state; + bool at_init_state = p_match_first != NULL; + Idx next_start_idx = cur_str_idx; + + err = REG_NOERROR; + cur_state = acquire_init_state_context (&err, mctx, cur_str_idx); + /* An initial state must not be NULL (invalid). */ + if (BE (cur_state == NULL, 0)) + { + assert (err == REG_ESPACE); + return -2; + } + + if (mctx->state_log != NULL) + { + mctx->state_log[cur_str_idx] = cur_state; + + /* Check OP_OPEN_SUBEXP in the initial state in case that we use them + later. E.g. Processing back references. */ + if (BE (dfa->nbackref, 0)) + { + at_init_state = false; + err = check_subexp_matching_top (mctx, &cur_state->nodes, 0); + if (BE (err != REG_NOERROR, 0)) + return err; + + if (cur_state->has_backref) + { + err = transit_state_bkref (mctx, &cur_state->nodes); + if (BE (err != REG_NOERROR, 0)) + return err; + } + } + } + + /* If the RE accepts NULL string. */ + if (BE (cur_state->halt, 0)) + { + if (!cur_state->has_constraint + || check_halt_state_context (mctx, cur_state, cur_str_idx)) + { + if (!fl_longest_match) + return cur_str_idx; + else + { + match_last = cur_str_idx; + match = 1; + } + } + } + + while (!re_string_eoi (&mctx->input)) + { + re_dfastate_t *old_state = cur_state; + Idx next_char_idx = re_string_cur_idx (&mctx->input) + 1; + + if ((BE (next_char_idx >= mctx->input.bufs_len, 0) + && mctx->input.bufs_len < mctx->input.len) + || (BE (next_char_idx >= mctx->input.valid_len, 0) + && mctx->input.valid_len < mctx->input.len)) + { + err = extend_buffers (mctx, next_char_idx + 1); + if (BE (err != REG_NOERROR, 0)) + { + assert (err == REG_ESPACE); + return -2; + } + } + + cur_state = transit_state (&err, mctx, cur_state); + if (mctx->state_log != NULL) + cur_state = merge_state_with_log (&err, mctx, cur_state); + + if (cur_state == NULL) + { + /* Reached the invalid state or an error. Try to recover a valid + state using the state log, if available and if we have not + already found a valid (even if not the longest) match. */ + if (BE (err != REG_NOERROR, 0)) + return -2; + + if (mctx->state_log == NULL + || (match && !fl_longest_match) + || (cur_state = find_recover_state (&err, mctx)) == NULL) + break; + } + + if (BE (at_init_state, 0)) + { + if (old_state == cur_state) + next_start_idx = next_char_idx; + else + at_init_state = false; + } + + if (cur_state->halt) + { + /* Reached a halt state. + Check the halt state can satisfy the current context. */ + if (!cur_state->has_constraint + || check_halt_state_context (mctx, cur_state, + re_string_cur_idx (&mctx->input))) + { + /* We found an appropriate halt state. */ + match_last = re_string_cur_idx (&mctx->input); + match = 1; + + /* We found a match, do not modify match_first below. */ + p_match_first = NULL; + if (!fl_longest_match) + break; + } + } + } + + if (p_match_first) + *p_match_first += next_start_idx; + + return match_last; +} + +/* Check NODE match the current context. */ + +static bool +internal_function +check_halt_node_context (const re_dfa_t *dfa, Idx node, unsigned int context) +{ + re_token_type_t type = dfa->nodes[node].type; + unsigned int constraint = dfa->nodes[node].constraint; + if (type != END_OF_RE) + return false; + if (!constraint) + return true; + if (NOT_SATISFY_NEXT_CONSTRAINT (constraint, context)) + return false; + return true; +} + +/* Check the halt state STATE match the current context. + Return 0 if not match, if the node, STATE has, is a halt node and + match the context, return the node. */ + +static Idx +internal_function +check_halt_state_context (const re_match_context_t *mctx, + const re_dfastate_t *state, Idx idx) +{ + Idx i; + unsigned int context; +#ifdef DEBUG + assert (state->halt); +#endif + context = re_string_context_at (&mctx->input, idx, mctx->eflags); + for (i = 0; i < state->nodes.nelem; ++i) + if (check_halt_node_context (mctx->dfa, state->nodes.elems[i], context)) + return state->nodes.elems[i]; + return 0; +} + +/* Compute the next node to which "NFA" transit from NODE("NFA" is a NFA + corresponding to the DFA). + Return the destination node, and update EPS_VIA_NODES; + return -1 in case of errors. */ + +static Idx +internal_function +proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs, + Idx *pidx, Idx node, re_node_set *eps_via_nodes, + struct re_fail_stack_t *fs) +{ + const re_dfa_t *const dfa = mctx->dfa; + Idx i; + bool ok; + if (IS_EPSILON_NODE (dfa->nodes[node].type)) + { + re_node_set *cur_nodes = &mctx->state_log[*pidx]->nodes; + re_node_set *edests = &dfa->edests[node]; + Idx dest_node; + ok = re_node_set_insert (eps_via_nodes, node); + if (BE (! ok, 0)) + return -2; + /* Pick up a valid destination, or return -1 if none + is found. */ + for (dest_node = -1, i = 0; i < edests->nelem; ++i) + { + Idx candidate = edests->elems[i]; + if (!re_node_set_contains (cur_nodes, candidate)) + continue; + if (dest_node == -1) + dest_node = candidate; + + else + { + /* In order to avoid infinite loop like "(a*)*", return the second + epsilon-transition if the first was already considered. */ + if (re_node_set_contains (eps_via_nodes, dest_node)) + return candidate; + + /* Otherwise, push the second epsilon-transition on the fail stack. */ + else if (fs != NULL + && push_fail_stack (fs, *pidx, candidate, nregs, regs, + eps_via_nodes)) + return -2; + + /* We know we are going to exit. */ + break; + } + } + return dest_node; + } + else + { + Idx naccepted = 0; + re_token_type_t type = dfa->nodes[node].type; + +#ifdef RE_ENABLE_I18N + if (dfa->nodes[node].accept_mb) + naccepted = check_node_accept_bytes (dfa, node, &mctx->input, *pidx); + else +#endif /* RE_ENABLE_I18N */ + if (type == OP_BACK_REF) + { + Idx subexp_idx = dfa->nodes[node].opr.idx + 1; + naccepted = regs[subexp_idx].rm_eo - regs[subexp_idx].rm_so; + if (fs != NULL) + { + if (regs[subexp_idx].rm_so == -1 || regs[subexp_idx].rm_eo == -1) + return -1; + else if (naccepted) + { + char *buf = (char *) re_string_get_buffer (&mctx->input); + if (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx, + naccepted) != 0) + return -1; + } + } + + if (naccepted == 0) + { + Idx dest_node; + ok = re_node_set_insert (eps_via_nodes, node); + if (BE (! ok, 0)) + return -2; + dest_node = dfa->edests[node].elems[0]; + if (re_node_set_contains (&mctx->state_log[*pidx]->nodes, + dest_node)) + return dest_node; + } + } + + if (naccepted != 0 + || check_node_accept (mctx, dfa->nodes + node, *pidx)) + { + Idx dest_node = dfa->nexts[node]; + *pidx = (naccepted == 0) ? *pidx + 1 : *pidx + naccepted; + if (fs && (*pidx > mctx->match_last || mctx->state_log[*pidx] == NULL + || !re_node_set_contains (&mctx->state_log[*pidx]->nodes, + dest_node))) + return -1; + re_node_set_empty (eps_via_nodes); + return dest_node; + } + } + return -1; +} + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +push_fail_stack (struct re_fail_stack_t *fs, Idx str_idx, Idx dest_node, + Idx nregs, regmatch_t *regs, re_node_set *eps_via_nodes) +{ + reg_errcode_t err; + Idx num = fs->num++; + if (fs->num == fs->alloc) + { + struct re_fail_stack_ent_t *new_array; + new_array = realloc (fs->stack, (sizeof (struct re_fail_stack_ent_t) + * fs->alloc * 2)); + if (new_array == NULL) + return REG_ESPACE; + fs->alloc *= 2; + fs->stack = new_array; + } + fs->stack[num].idx = str_idx; + fs->stack[num].node = dest_node; + fs->stack[num].regs = re_malloc (regmatch_t, nregs); + if (fs->stack[num].regs == NULL) + return REG_ESPACE; + memcpy (fs->stack[num].regs, regs, sizeof (regmatch_t) * nregs); + err = re_node_set_init_copy (&fs->stack[num].eps_via_nodes, eps_via_nodes); + return err; +} + +static Idx +internal_function +pop_fail_stack (struct re_fail_stack_t *fs, Idx *pidx, Idx nregs, + regmatch_t *regs, re_node_set *eps_via_nodes) +{ + Idx num = --fs->num; + assert (num >= 0); + *pidx = fs->stack[num].idx; + memcpy (regs, fs->stack[num].regs, sizeof (regmatch_t) * nregs); + re_node_set_free (eps_via_nodes); + re_free (fs->stack[num].regs); + *eps_via_nodes = fs->stack[num].eps_via_nodes; + return fs->stack[num].node; +} + +/* Set the positions where the subexpressions are starts/ends to registers + PMATCH. + Note: We assume that pmatch[0] is already set, and + pmatch[i].rm_so == pmatch[i].rm_eo == -1 for 0 < i < nmatch. */ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch, + regmatch_t *pmatch, bool fl_backtrack) +{ + const re_dfa_t *dfa = preg->buffer; + Idx idx, cur_node; + re_node_set eps_via_nodes; + struct re_fail_stack_t *fs; + struct re_fail_stack_t fs_body = { 0, 2, NULL }; + regmatch_t *prev_idx_match; + bool prev_idx_match_malloced = false; + +#ifdef DEBUG + assert (nmatch > 1); + assert (mctx->state_log != NULL); +#endif + if (fl_backtrack) + { + fs = &fs_body; + fs->stack = re_malloc (struct re_fail_stack_ent_t, fs->alloc); + if (fs->stack == NULL) + return REG_ESPACE; + } + else + fs = NULL; + + cur_node = dfa->init_node; + re_node_set_init_empty (&eps_via_nodes); + + if (__libc_use_alloca (nmatch * sizeof (regmatch_t))) + prev_idx_match = (regmatch_t *) alloca (nmatch * sizeof (regmatch_t)); + else + { + prev_idx_match = re_malloc (regmatch_t, nmatch); + if (prev_idx_match == NULL) + { + free_fail_stack_return (fs); + return REG_ESPACE; + } + prev_idx_match_malloced = true; + } + memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch); + + for (idx = pmatch[0].rm_so; idx <= pmatch[0].rm_eo ;) + { + update_regs (dfa, pmatch, prev_idx_match, cur_node, idx, nmatch); + + if (idx == pmatch[0].rm_eo && cur_node == mctx->last_node) + { + Idx reg_idx; + if (fs) + { + for (reg_idx = 0; reg_idx < nmatch; ++reg_idx) + if (pmatch[reg_idx].rm_so > -1 && pmatch[reg_idx].rm_eo == -1) + break; + if (reg_idx == nmatch) + { + re_node_set_free (&eps_via_nodes); + if (prev_idx_match_malloced) + re_free (prev_idx_match); + return free_fail_stack_return (fs); + } + cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch, + &eps_via_nodes); + } + else + { + re_node_set_free (&eps_via_nodes); + if (prev_idx_match_malloced) + re_free (prev_idx_match); + return REG_NOERROR; + } + } + + /* Proceed to next node. */ + cur_node = proceed_next_node (mctx, nmatch, pmatch, &idx, cur_node, + &eps_via_nodes, fs); + + if (BE (cur_node < 0, 0)) + { + if (BE (cur_node == -2, 0)) + { + re_node_set_free (&eps_via_nodes); + if (prev_idx_match_malloced) + re_free (prev_idx_match); + free_fail_stack_return (fs); + return REG_ESPACE; + } + if (fs) + cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch, + &eps_via_nodes); + else + { + re_node_set_free (&eps_via_nodes); + if (prev_idx_match_malloced) + re_free (prev_idx_match); + return REG_NOMATCH; + } + } + } + re_node_set_free (&eps_via_nodes); + if (prev_idx_match_malloced) + re_free (prev_idx_match); + return free_fail_stack_return (fs); +} + +static reg_errcode_t +internal_function +free_fail_stack_return (struct re_fail_stack_t *fs) +{ + if (fs) + { + Idx fs_idx; + for (fs_idx = 0; fs_idx < fs->num; ++fs_idx) + { + re_node_set_free (&fs->stack[fs_idx].eps_via_nodes); + re_free (fs->stack[fs_idx].regs); + } + re_free (fs->stack); + } + return REG_NOERROR; +} + +static void +internal_function +update_regs (const re_dfa_t *dfa, regmatch_t *pmatch, + regmatch_t *prev_idx_match, Idx cur_node, Idx cur_idx, Idx nmatch) +{ + int type = dfa->nodes[cur_node].type; + if (type == OP_OPEN_SUBEXP) + { + Idx reg_num = dfa->nodes[cur_node].opr.idx + 1; + + /* We are at the first node of this sub expression. */ + if (reg_num < nmatch) + { + pmatch[reg_num].rm_so = cur_idx; + pmatch[reg_num].rm_eo = -1; + } + } + else if (type == OP_CLOSE_SUBEXP) + { + Idx reg_num = dfa->nodes[cur_node].opr.idx + 1; + if (reg_num < nmatch) + { + /* We are at the last node of this sub expression. */ + if (pmatch[reg_num].rm_so < cur_idx) + { + pmatch[reg_num].rm_eo = cur_idx; + /* This is a non-empty match or we are not inside an optional + subexpression. Accept this right away. */ + memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch); + } + else + { + if (dfa->nodes[cur_node].opt_subexp + && prev_idx_match[reg_num].rm_so != -1) + /* We transited through an empty match for an optional + subexpression, like (a?)*, and this is not the subexp's + first match. Copy back the old content of the registers + so that matches of an inner subexpression are undone as + well, like in ((a?))*. */ + memcpy (pmatch, prev_idx_match, sizeof (regmatch_t) * nmatch); + else + /* We completed a subexpression, but it may be part of + an optional one, so do not update PREV_IDX_MATCH. */ + pmatch[reg_num].rm_eo = cur_idx; + } + } + } +} + +/* This function checks the STATE_LOG from the SCTX->last_str_idx to 0 + and sift the nodes in each states according to the following rules. + Updated state_log will be wrote to STATE_LOG. + + Rules: We throw away the Node 'a' in the STATE_LOG[STR_IDX] if... + 1. When STR_IDX == MATCH_LAST(the last index in the state_log): + If 'a' isn't the LAST_NODE and 'a' can't epsilon transit to + the LAST_NODE, we throw away the node 'a'. + 2. When 0 <= STR_IDX < MATCH_LAST and 'a' accepts + string 's' and transit to 'b': + i. If 'b' isn't in the STATE_LOG[STR_IDX+strlen('s')], we throw + away the node 'a'. + ii. If 'b' is in the STATE_LOG[STR_IDX+strlen('s')] but 'b' is + thrown away, we throw away the node 'a'. + 3. When 0 <= STR_IDX < MATCH_LAST and 'a' epsilon transit to 'b': + i. If 'b' isn't in the STATE_LOG[STR_IDX], we throw away the + node 'a'. + ii. If 'b' is in the STATE_LOG[STR_IDX] but 'b' is thrown away, + we throw away the node 'a'. */ + +#define STATE_NODE_CONTAINS(state,node) \ + ((state) != NULL && re_node_set_contains (&(state)->nodes, node)) + +static reg_errcode_t +internal_function +sift_states_backward (const re_match_context_t *mctx, re_sift_context_t *sctx) +{ + reg_errcode_t err; + int null_cnt = 0; + Idx str_idx = sctx->last_str_idx; + re_node_set cur_dest; + +#ifdef DEBUG + assert (mctx->state_log != NULL && mctx->state_log[str_idx] != NULL); +#endif + + /* Build sifted state_log[str_idx]. It has the nodes which can epsilon + transit to the last_node and the last_node itself. */ + err = re_node_set_init_1 (&cur_dest, sctx->last_node); + if (BE (err != REG_NOERROR, 0)) + return err; + err = update_cur_sifted_state (mctx, sctx, str_idx, &cur_dest); + if (BE (err != REG_NOERROR, 0)) + goto free_return; + + /* Then check each states in the state_log. */ + while (str_idx > 0) + { + /* Update counters. */ + null_cnt = (sctx->sifted_states[str_idx] == NULL) ? null_cnt + 1 : 0; + if (null_cnt > mctx->max_mb_elem_len) + { + memset (sctx->sifted_states, '\0', + sizeof (re_dfastate_t *) * str_idx); + re_node_set_free (&cur_dest); + return REG_NOERROR; + } + re_node_set_empty (&cur_dest); + --str_idx; + + if (mctx->state_log[str_idx]) + { + err = build_sifted_states (mctx, sctx, str_idx, &cur_dest); + if (BE (err != REG_NOERROR, 0)) + goto free_return; + } + + /* Add all the nodes which satisfy the following conditions: + - It can epsilon transit to a node in CUR_DEST. + - It is in CUR_SRC. + And update state_log. */ + err = update_cur_sifted_state (mctx, sctx, str_idx, &cur_dest); + if (BE (err != REG_NOERROR, 0)) + goto free_return; + } + err = REG_NOERROR; + free_return: + re_node_set_free (&cur_dest); + return err; +} + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +build_sifted_states (const re_match_context_t *mctx, re_sift_context_t *sctx, + Idx str_idx, re_node_set *cur_dest) +{ + const re_dfa_t *const dfa = mctx->dfa; + const re_node_set *cur_src = &mctx->state_log[str_idx]->non_eps_nodes; + Idx i; + + /* Then build the next sifted state. + We build the next sifted state on 'cur_dest', and update + 'sifted_states[str_idx]' with 'cur_dest'. + Note: + 'cur_dest' is the sifted state from 'state_log[str_idx + 1]'. + 'cur_src' points the node_set of the old 'state_log[str_idx]' + (with the epsilon nodes pre-filtered out). */ + for (i = 0; i < cur_src->nelem; i++) + { + Idx prev_node = cur_src->elems[i]; + int naccepted = 0; + bool ok; + +#ifdef DEBUG + re_token_type_t type = dfa->nodes[prev_node].type; + assert (!IS_EPSILON_NODE (type)); +#endif +#ifdef RE_ENABLE_I18N + /* If the node may accept "multi byte". */ + if (dfa->nodes[prev_node].accept_mb) + naccepted = sift_states_iter_mb (mctx, sctx, prev_node, + str_idx, sctx->last_str_idx); +#endif /* RE_ENABLE_I18N */ + + /* We don't check backreferences here. + See update_cur_sifted_state(). */ + if (!naccepted + && check_node_accept (mctx, dfa->nodes + prev_node, str_idx) + && STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + 1], + dfa->nexts[prev_node])) + naccepted = 1; + + if (naccepted == 0) + continue; + + if (sctx->limits.nelem) + { + Idx to_idx = str_idx + naccepted; + if (check_dst_limits (mctx, &sctx->limits, + dfa->nexts[prev_node], to_idx, + prev_node, str_idx)) + continue; + } + ok = re_node_set_insert (cur_dest, prev_node); + if (BE (! ok, 0)) + return REG_ESPACE; + } + + return REG_NOERROR; +} + +/* Helper functions. */ + +static reg_errcode_t +internal_function +clean_state_log_if_needed (re_match_context_t *mctx, Idx next_state_log_idx) +{ + Idx top = mctx->state_log_top; + + if ((next_state_log_idx >= mctx->input.bufs_len + && mctx->input.bufs_len < mctx->input.len) + || (next_state_log_idx >= mctx->input.valid_len + && mctx->input.valid_len < mctx->input.len)) + { + reg_errcode_t err; + err = extend_buffers (mctx, next_state_log_idx + 1); + if (BE (err != REG_NOERROR, 0)) + return err; + } + + if (top < next_state_log_idx) + { + memset (mctx->state_log + top + 1, '\0', + sizeof (re_dfastate_t *) * (next_state_log_idx - top)); + mctx->state_log_top = next_state_log_idx; + } + return REG_NOERROR; +} + +static reg_errcode_t +internal_function +merge_state_array (const re_dfa_t *dfa, re_dfastate_t **dst, + re_dfastate_t **src, Idx num) +{ + Idx st_idx; + reg_errcode_t err; + for (st_idx = 0; st_idx < num; ++st_idx) + { + if (dst[st_idx] == NULL) + dst[st_idx] = src[st_idx]; + else if (src[st_idx] != NULL) + { + re_node_set merged_set; + err = re_node_set_init_union (&merged_set, &dst[st_idx]->nodes, + &src[st_idx]->nodes); + if (BE (err != REG_NOERROR, 0)) + return err; + dst[st_idx] = re_acquire_state (&err, dfa, &merged_set); + re_node_set_free (&merged_set); + if (BE (err != REG_NOERROR, 0)) + return err; + } + } + return REG_NOERROR; +} + +static reg_errcode_t +internal_function +update_cur_sifted_state (const re_match_context_t *mctx, + re_sift_context_t *sctx, Idx str_idx, + re_node_set *dest_nodes) +{ + const re_dfa_t *const dfa = mctx->dfa; + reg_errcode_t err = REG_NOERROR; + const re_node_set *candidates; + candidates = ((mctx->state_log[str_idx] == NULL) ? NULL + : &mctx->state_log[str_idx]->nodes); + + if (dest_nodes->nelem == 0) + sctx->sifted_states[str_idx] = NULL; + else + { + if (candidates) + { + /* At first, add the nodes which can epsilon transit to a node in + DEST_NODE. */ + err = add_epsilon_src_nodes (dfa, dest_nodes, candidates); + if (BE (err != REG_NOERROR, 0)) + return err; + + /* Then, check the limitations in the current sift_context. */ + if (sctx->limits.nelem) + { + err = check_subexp_limits (dfa, dest_nodes, candidates, &sctx->limits, + mctx->bkref_ents, str_idx); + if (BE (err != REG_NOERROR, 0)) + return err; + } + } + + sctx->sifted_states[str_idx] = re_acquire_state (&err, dfa, dest_nodes); + if (BE (err != REG_NOERROR, 0)) + return err; + } + + if (candidates && mctx->state_log[str_idx]->has_backref) + { + err = sift_states_bkref (mctx, sctx, str_idx, candidates); + if (BE (err != REG_NOERROR, 0)) + return err; + } + return REG_NOERROR; +} + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +add_epsilon_src_nodes (const re_dfa_t *dfa, re_node_set *dest_nodes, + const re_node_set *candidates) +{ + reg_errcode_t err = REG_NOERROR; + Idx i; + + re_dfastate_t *state = re_acquire_state (&err, dfa, dest_nodes); + if (BE (err != REG_NOERROR, 0)) + return err; + + if (!state->inveclosure.alloc) + { + err = re_node_set_alloc (&state->inveclosure, dest_nodes->nelem); + if (BE (err != REG_NOERROR, 0)) + return REG_ESPACE; + for (i = 0; i < dest_nodes->nelem; i++) + { + err = re_node_set_merge (&state->inveclosure, + dfa->inveclosures + dest_nodes->elems[i]); + if (BE (err != REG_NOERROR, 0)) + return REG_ESPACE; + } + } + return re_node_set_add_intersect (dest_nodes, candidates, + &state->inveclosure); +} + +static reg_errcode_t +internal_function +sub_epsilon_src_nodes (const re_dfa_t *dfa, Idx node, re_node_set *dest_nodes, + const re_node_set *candidates) +{ + Idx ecl_idx; + reg_errcode_t err; + re_node_set *inv_eclosure = dfa->inveclosures + node; + re_node_set except_nodes; + re_node_set_init_empty (&except_nodes); + for (ecl_idx = 0; ecl_idx < inv_eclosure->nelem; ++ecl_idx) + { + Idx cur_node = inv_eclosure->elems[ecl_idx]; + if (cur_node == node) + continue; + if (IS_EPSILON_NODE (dfa->nodes[cur_node].type)) + { + Idx edst1 = dfa->edests[cur_node].elems[0]; + Idx edst2 = ((dfa->edests[cur_node].nelem > 1) + ? dfa->edests[cur_node].elems[1] : -1); + if ((!re_node_set_contains (inv_eclosure, edst1) + && re_node_set_contains (dest_nodes, edst1)) + || (edst2 > 0 + && !re_node_set_contains (inv_eclosure, edst2) + && re_node_set_contains (dest_nodes, edst2))) + { + err = re_node_set_add_intersect (&except_nodes, candidates, + dfa->inveclosures + cur_node); + if (BE (err != REG_NOERROR, 0)) + { + re_node_set_free (&except_nodes); + return err; + } + } + } + } + for (ecl_idx = 0; ecl_idx < inv_eclosure->nelem; ++ecl_idx) + { + Idx cur_node = inv_eclosure->elems[ecl_idx]; + if (!re_node_set_contains (&except_nodes, cur_node)) + { + Idx idx = re_node_set_contains (dest_nodes, cur_node) - 1; + re_node_set_remove_at (dest_nodes, idx); + } + } + re_node_set_free (&except_nodes); + return REG_NOERROR; +} + +static bool +internal_function +check_dst_limits (const re_match_context_t *mctx, const re_node_set *limits, + Idx dst_node, Idx dst_idx, Idx src_node, Idx src_idx) +{ + const re_dfa_t *const dfa = mctx->dfa; + Idx lim_idx, src_pos, dst_pos; + + Idx dst_bkref_idx = search_cur_bkref_entry (mctx, dst_idx); + Idx src_bkref_idx = search_cur_bkref_entry (mctx, src_idx); + for (lim_idx = 0; lim_idx < limits->nelem; ++lim_idx) + { + Idx subexp_idx; + struct re_backref_cache_entry *ent; + ent = mctx->bkref_ents + limits->elems[lim_idx]; + subexp_idx = dfa->nodes[ent->node].opr.idx; + + dst_pos = check_dst_limits_calc_pos (mctx, limits->elems[lim_idx], + subexp_idx, dst_node, dst_idx, + dst_bkref_idx); + src_pos = check_dst_limits_calc_pos (mctx, limits->elems[lim_idx], + subexp_idx, src_node, src_idx, + src_bkref_idx); + + /* In case of: + <src> <dst> ( <subexp> ) + ( <subexp> ) <src> <dst> + ( <subexp1> <src> <subexp2> <dst> <subexp3> ) */ + if (src_pos == dst_pos) + continue; /* This is unrelated limitation. */ + else + return true; + } + return false; +} + +static int +internal_function +check_dst_limits_calc_pos_1 (const re_match_context_t *mctx, int boundaries, + Idx subexp_idx, Idx from_node, Idx bkref_idx) +{ + const re_dfa_t *const dfa = mctx->dfa; + const re_node_set *eclosures = dfa->eclosures + from_node; + Idx node_idx; + + /* Else, we are on the boundary: examine the nodes on the epsilon + closure. */ + for (node_idx = 0; node_idx < eclosures->nelem; ++node_idx) + { + Idx node = eclosures->elems[node_idx]; + switch (dfa->nodes[node].type) + { + case OP_BACK_REF: + if (bkref_idx != -1) + { + struct re_backref_cache_entry *ent = mctx->bkref_ents + bkref_idx; + do + { + Idx dst; + int cpos; + + if (ent->node != node) + continue; + + if (subexp_idx < BITSET_WORD_BITS + && !(ent->eps_reachable_subexps_map + & ((bitset_word_t) 1 << subexp_idx))) + continue; + + /* Recurse trying to reach the OP_OPEN_SUBEXP and + OP_CLOSE_SUBEXP cases below. But, if the + destination node is the same node as the source + node, don't recurse because it would cause an + infinite loop: a regex that exhibits this behavior + is ()\1*\1* */ + dst = dfa->edests[node].elems[0]; + if (dst == from_node) + { + if (boundaries & 1) + return -1; + else /* if (boundaries & 2) */ + return 0; + } + + cpos = + check_dst_limits_calc_pos_1 (mctx, boundaries, subexp_idx, + dst, bkref_idx); + if (cpos == -1 /* && (boundaries & 1) */) + return -1; + if (cpos == 0 && (boundaries & 2)) + return 0; + + if (subexp_idx < BITSET_WORD_BITS) + ent->eps_reachable_subexps_map + &= ~((bitset_word_t) 1 << subexp_idx); + } + while (ent++->more); + } + break; + + case OP_OPEN_SUBEXP: + if ((boundaries & 1) && subexp_idx == dfa->nodes[node].opr.idx) + return -1; + break; + + case OP_CLOSE_SUBEXP: + if ((boundaries & 2) && subexp_idx == dfa->nodes[node].opr.idx) + return 0; + break; + + default: + break; + } + } + + return (boundaries & 2) ? 1 : 0; +} + +static int +internal_function +check_dst_limits_calc_pos (const re_match_context_t *mctx, Idx limit, + Idx subexp_idx, Idx from_node, Idx str_idx, + Idx bkref_idx) +{ + struct re_backref_cache_entry *lim = mctx->bkref_ents + limit; + int boundaries; + + /* If we are outside the range of the subexpression, return -1 or 1. */ + if (str_idx < lim->subexp_from) + return -1; + + if (lim->subexp_to < str_idx) + return 1; + + /* If we are within the subexpression, return 0. */ + boundaries = (str_idx == lim->subexp_from); + boundaries |= (str_idx == lim->subexp_to) << 1; + if (boundaries == 0) + return 0; + + /* Else, examine epsilon closure. */ + return check_dst_limits_calc_pos_1 (mctx, boundaries, subexp_idx, + from_node, bkref_idx); +} + +/* Check the limitations of sub expressions LIMITS, and remove the nodes + which are against limitations from DEST_NODES. */ + +static reg_errcode_t +internal_function +check_subexp_limits (const re_dfa_t *dfa, re_node_set *dest_nodes, + const re_node_set *candidates, re_node_set *limits, + struct re_backref_cache_entry *bkref_ents, Idx str_idx) +{ + reg_errcode_t err; + Idx node_idx, lim_idx; + + for (lim_idx = 0; lim_idx < limits->nelem; ++lim_idx) + { + Idx subexp_idx; + struct re_backref_cache_entry *ent; + ent = bkref_ents + limits->elems[lim_idx]; + + if (str_idx <= ent->subexp_from || ent->str_idx < str_idx) + continue; /* This is unrelated limitation. */ + + subexp_idx = dfa->nodes[ent->node].opr.idx; + if (ent->subexp_to == str_idx) + { + Idx ops_node = -1; + Idx cls_node = -1; + for (node_idx = 0; node_idx < dest_nodes->nelem; ++node_idx) + { + Idx node = dest_nodes->elems[node_idx]; + re_token_type_t type = dfa->nodes[node].type; + if (type == OP_OPEN_SUBEXP + && subexp_idx == dfa->nodes[node].opr.idx) + ops_node = node; + else if (type == OP_CLOSE_SUBEXP + && subexp_idx == dfa->nodes[node].opr.idx) + cls_node = node; + } + + /* Check the limitation of the open subexpression. */ + /* Note that (ent->subexp_to = str_idx != ent->subexp_from). */ + if (ops_node >= 0) + { + err = sub_epsilon_src_nodes (dfa, ops_node, dest_nodes, + candidates); + if (BE (err != REG_NOERROR, 0)) + return err; + } + + /* Check the limitation of the close subexpression. */ + if (cls_node >= 0) + for (node_idx = 0; node_idx < dest_nodes->nelem; ++node_idx) + { + Idx node = dest_nodes->elems[node_idx]; + if (!re_node_set_contains (dfa->inveclosures + node, + cls_node) + && !re_node_set_contains (dfa->eclosures + node, + cls_node)) + { + /* It is against this limitation. + Remove it form the current sifted state. */ + err = sub_epsilon_src_nodes (dfa, node, dest_nodes, + candidates); + if (BE (err != REG_NOERROR, 0)) + return err; + --node_idx; + } + } + } + else /* (ent->subexp_to != str_idx) */ + { + for (node_idx = 0; node_idx < dest_nodes->nelem; ++node_idx) + { + Idx node = dest_nodes->elems[node_idx]; + re_token_type_t type = dfa->nodes[node].type; + if (type == OP_CLOSE_SUBEXP || type == OP_OPEN_SUBEXP) + { + if (subexp_idx != dfa->nodes[node].opr.idx) + continue; + /* It is against this limitation. + Remove it form the current sifted state. */ + err = sub_epsilon_src_nodes (dfa, node, dest_nodes, + candidates); + if (BE (err != REG_NOERROR, 0)) + return err; + } + } + } + } + return REG_NOERROR; +} + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +sift_states_bkref (const re_match_context_t *mctx, re_sift_context_t *sctx, + Idx str_idx, const re_node_set *candidates) +{ + const re_dfa_t *const dfa = mctx->dfa; + reg_errcode_t err; + Idx node_idx, node; + re_sift_context_t local_sctx; + Idx first_idx = search_cur_bkref_entry (mctx, str_idx); + + if (first_idx == -1) + return REG_NOERROR; + + local_sctx.sifted_states = NULL; /* Mark that it hasn't been initialized. */ + + for (node_idx = 0; node_idx < candidates->nelem; ++node_idx) + { + Idx enabled_idx; + re_token_type_t type; + struct re_backref_cache_entry *entry; + node = candidates->elems[node_idx]; + type = dfa->nodes[node].type; + /* Avoid infinite loop for the REs like "()\1+". */ + if (node == sctx->last_node && str_idx == sctx->last_str_idx) + continue; + if (type != OP_BACK_REF) + continue; + + entry = mctx->bkref_ents + first_idx; + enabled_idx = first_idx; + do + { + Idx subexp_len; + Idx to_idx; + Idx dst_node; + bool ok; + re_dfastate_t *cur_state; + + if (entry->node != node) + continue; + subexp_len = entry->subexp_to - entry->subexp_from; + to_idx = str_idx + subexp_len; + dst_node = (subexp_len ? dfa->nexts[node] + : dfa->edests[node].elems[0]); + + if (to_idx > sctx->last_str_idx + || sctx->sifted_states[to_idx] == NULL + || !STATE_NODE_CONTAINS (sctx->sifted_states[to_idx], dst_node) + || check_dst_limits (mctx, &sctx->limits, node, + str_idx, dst_node, to_idx)) + continue; + + if (local_sctx.sifted_states == NULL) + { + local_sctx = *sctx; + err = re_node_set_init_copy (&local_sctx.limits, &sctx->limits); + if (BE (err != REG_NOERROR, 0)) + goto free_return; + } + local_sctx.last_node = node; + local_sctx.last_str_idx = str_idx; + ok = re_node_set_insert (&local_sctx.limits, enabled_idx); + if (BE (! ok, 0)) + { + err = REG_ESPACE; + goto free_return; + } + cur_state = local_sctx.sifted_states[str_idx]; + err = sift_states_backward (mctx, &local_sctx); + if (BE (err != REG_NOERROR, 0)) + goto free_return; + if (sctx->limited_states != NULL) + { + err = merge_state_array (dfa, sctx->limited_states, + local_sctx.sifted_states, + str_idx + 1); + if (BE (err != REG_NOERROR, 0)) + goto free_return; + } + local_sctx.sifted_states[str_idx] = cur_state; + re_node_set_remove (&local_sctx.limits, enabled_idx); + + /* mctx->bkref_ents may have changed, reload the pointer. */ + entry = mctx->bkref_ents + enabled_idx; + } + while (enabled_idx++, entry++->more); + } + err = REG_NOERROR; + free_return: + if (local_sctx.sifted_states != NULL) + { + re_node_set_free (&local_sctx.limits); + } + + return err; +} + + +#ifdef RE_ENABLE_I18N +static int +internal_function +sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx, + Idx node_idx, Idx str_idx, Idx max_str_idx) +{ + const re_dfa_t *const dfa = mctx->dfa; + int naccepted; + /* Check the node can accept "multi byte". */ + naccepted = check_node_accept_bytes (dfa, node_idx, &mctx->input, str_idx); + if (naccepted > 0 && str_idx + naccepted <= max_str_idx && + !STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + naccepted], + dfa->nexts[node_idx])) + /* The node can't accept the "multi byte", or the + destination was already thrown away, then the node + could't accept the current input "multi byte". */ + naccepted = 0; + /* Otherwise, it is sure that the node could accept + 'naccepted' bytes input. */ + return naccepted; +} +#endif /* RE_ENABLE_I18N */ + + +/* Functions for state transition. */ + +/* Return the next state to which the current state STATE will transit by + accepting the current input byte, and update STATE_LOG if necessary. + If STATE can accept a multibyte char/collating element/back reference + update the destination of STATE_LOG. */ + +static re_dfastate_t * +internal_function __attribute_warn_unused_result__ +transit_state (reg_errcode_t *err, re_match_context_t *mctx, + re_dfastate_t *state) +{ + re_dfastate_t **trtable; + unsigned char ch; + +#ifdef RE_ENABLE_I18N + /* If the current state can accept multibyte. */ + if (BE (state->accept_mb, 0)) + { + *err = transit_state_mb (mctx, state); + if (BE (*err != REG_NOERROR, 0)) + return NULL; + } +#endif /* RE_ENABLE_I18N */ + + /* Then decide the next state with the single byte. */ +#if 0 + if (0) + /* don't use transition table */ + return transit_state_sb (err, mctx, state); +#endif + + /* Use transition table */ + ch = re_string_fetch_byte (&mctx->input); + for (;;) + { + trtable = state->trtable; + if (BE (trtable != NULL, 1)) + return trtable[ch]; + + trtable = state->word_trtable; + if (BE (trtable != NULL, 1)) + { + unsigned int context; + context + = re_string_context_at (&mctx->input, + re_string_cur_idx (&mctx->input) - 1, + mctx->eflags); + if (IS_WORD_CONTEXT (context)) + return trtable[ch + SBC_MAX]; + else + return trtable[ch]; + } + + if (!build_trtable (mctx->dfa, state)) + { + *err = REG_ESPACE; + return NULL; + } + + /* Retry, we now have a transition table. */ + } +} + +/* Update the state_log if we need */ +static re_dfastate_t * +internal_function +merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx, + re_dfastate_t *next_state) +{ + const re_dfa_t *const dfa = mctx->dfa; + Idx cur_idx = re_string_cur_idx (&mctx->input); + + if (cur_idx > mctx->state_log_top) + { + mctx->state_log[cur_idx] = next_state; + mctx->state_log_top = cur_idx; + } + else if (mctx->state_log[cur_idx] == 0) + { + mctx->state_log[cur_idx] = next_state; + } + else + { + re_dfastate_t *pstate; + unsigned int context; + re_node_set next_nodes, *log_nodes, *table_nodes = NULL; + /* If (state_log[cur_idx] != 0), it implies that cur_idx is + the destination of a multibyte char/collating element/ + back reference. Then the next state is the union set of + these destinations and the results of the transition table. */ + pstate = mctx->state_log[cur_idx]; + log_nodes = pstate->entrance_nodes; + if (next_state != NULL) + { + table_nodes = next_state->entrance_nodes; + *err = re_node_set_init_union (&next_nodes, table_nodes, + log_nodes); + if (BE (*err != REG_NOERROR, 0)) + return NULL; + } + else + next_nodes = *log_nodes; + /* Note: We already add the nodes of the initial state, + then we don't need to add them here. */ + + context = re_string_context_at (&mctx->input, + re_string_cur_idx (&mctx->input) - 1, + mctx->eflags); + next_state = mctx->state_log[cur_idx] + = re_acquire_state_context (err, dfa, &next_nodes, context); + /* We don't need to check errors here, since the return value of + this function is next_state and ERR is already set. */ + + if (table_nodes != NULL) + re_node_set_free (&next_nodes); + } + + if (BE (dfa->nbackref, 0) && next_state != NULL) + { + /* Check OP_OPEN_SUBEXP in the current state in case that we use them + later. We must check them here, since the back references in the + next state might use them. */ + *err = check_subexp_matching_top (mctx, &next_state->nodes, + cur_idx); + if (BE (*err != REG_NOERROR, 0)) + return NULL; + + /* If the next state has back references. */ + if (next_state->has_backref) + { + *err = transit_state_bkref (mctx, &next_state->nodes); + if (BE (*err != REG_NOERROR, 0)) + return NULL; + next_state = mctx->state_log[cur_idx]; + } + } + + return next_state; +} + +/* Skip bytes in the input that correspond to part of a + multi-byte match, then look in the log for a state + from which to restart matching. */ +static re_dfastate_t * +internal_function +find_recover_state (reg_errcode_t *err, re_match_context_t *mctx) +{ + re_dfastate_t *cur_state; + do + { + Idx max = mctx->state_log_top; + Idx cur_str_idx = re_string_cur_idx (&mctx->input); + + do + { + if (++cur_str_idx > max) + return NULL; + re_string_skip_bytes (&mctx->input, 1); + } + while (mctx->state_log[cur_str_idx] == NULL); + + cur_state = merge_state_with_log (err, mctx, NULL); + } + while (*err == REG_NOERROR && cur_state == NULL); + return cur_state; +} + +/* Helper functions for transit_state. */ + +/* From the node set CUR_NODES, pick up the nodes whose types are + OP_OPEN_SUBEXP and which have corresponding back references in the regular + expression. And register them to use them later for evaluating the + corresponding back references. */ + +static reg_errcode_t +internal_function +check_subexp_matching_top (re_match_context_t *mctx, re_node_set *cur_nodes, + Idx str_idx) +{ + const re_dfa_t *const dfa = mctx->dfa; + Idx node_idx; + reg_errcode_t err; + + /* TODO: This isn't efficient. + Because there might be more than one nodes whose types are + OP_OPEN_SUBEXP and whose index is SUBEXP_IDX, we must check all + nodes. + E.g. RE: (a){2} */ + for (node_idx = 0; node_idx < cur_nodes->nelem; ++node_idx) + { + Idx node = cur_nodes->elems[node_idx]; + if (dfa->nodes[node].type == OP_OPEN_SUBEXP + && dfa->nodes[node].opr.idx < BITSET_WORD_BITS + && (dfa->used_bkref_map + & ((bitset_word_t) 1 << dfa->nodes[node].opr.idx))) + { + err = match_ctx_add_subtop (mctx, node, str_idx); + if (BE (err != REG_NOERROR, 0)) + return err; + } + } + return REG_NOERROR; +} + +#if 0 +/* Return the next state to which the current state STATE will transit by + accepting the current input byte. */ + +static re_dfastate_t * +transit_state_sb (reg_errcode_t *err, re_match_context_t *mctx, + re_dfastate_t *state) +{ + const re_dfa_t *const dfa = mctx->dfa; + re_node_set next_nodes; + re_dfastate_t *next_state; + Idx node_cnt, cur_str_idx = re_string_cur_idx (&mctx->input); + unsigned int context; + + *err = re_node_set_alloc (&next_nodes, state->nodes.nelem + 1); + if (BE (*err != REG_NOERROR, 0)) + return NULL; + for (node_cnt = 0; node_cnt < state->nodes.nelem; ++node_cnt) + { + Idx cur_node = state->nodes.elems[node_cnt]; + if (check_node_accept (mctx, dfa->nodes + cur_node, cur_str_idx)) + { + *err = re_node_set_merge (&next_nodes, + dfa->eclosures + dfa->nexts[cur_node]); + if (BE (*err != REG_NOERROR, 0)) + { + re_node_set_free (&next_nodes); + return NULL; + } + } + } + context = re_string_context_at (&mctx->input, cur_str_idx, mctx->eflags); + next_state = re_acquire_state_context (err, dfa, &next_nodes, context); + /* We don't need to check errors here, since the return value of + this function is next_state and ERR is already set. */ + + re_node_set_free (&next_nodes); + re_string_skip_bytes (&mctx->input, 1); + return next_state; +} +#endif + +#ifdef RE_ENABLE_I18N +static reg_errcode_t +internal_function +transit_state_mb (re_match_context_t *mctx, re_dfastate_t *pstate) +{ + const re_dfa_t *const dfa = mctx->dfa; + reg_errcode_t err; + Idx i; + + for (i = 0; i < pstate->nodes.nelem; ++i) + { + re_node_set dest_nodes, *new_nodes; + Idx cur_node_idx = pstate->nodes.elems[i]; + int naccepted; + Idx dest_idx; + unsigned int context; + re_dfastate_t *dest_state; + + if (!dfa->nodes[cur_node_idx].accept_mb) + continue; + + if (dfa->nodes[cur_node_idx].constraint) + { + context = re_string_context_at (&mctx->input, + re_string_cur_idx (&mctx->input), + mctx->eflags); + if (NOT_SATISFY_NEXT_CONSTRAINT (dfa->nodes[cur_node_idx].constraint, + context)) + continue; + } + + /* How many bytes the node can accept? */ + naccepted = check_node_accept_bytes (dfa, cur_node_idx, &mctx->input, + re_string_cur_idx (&mctx->input)); + if (naccepted == 0) + continue; + + /* The node can accepts 'naccepted' bytes. */ + dest_idx = re_string_cur_idx (&mctx->input) + naccepted; + mctx->max_mb_elem_len = ((mctx->max_mb_elem_len < naccepted) ? naccepted + : mctx->max_mb_elem_len); + err = clean_state_log_if_needed (mctx, dest_idx); + if (BE (err != REG_NOERROR, 0)) + return err; +#ifdef DEBUG + assert (dfa->nexts[cur_node_idx] != -1); +#endif + new_nodes = dfa->eclosures + dfa->nexts[cur_node_idx]; + + dest_state = mctx->state_log[dest_idx]; + if (dest_state == NULL) + dest_nodes = *new_nodes; + else + { + err = re_node_set_init_union (&dest_nodes, + dest_state->entrance_nodes, new_nodes); + if (BE (err != REG_NOERROR, 0)) + return err; + } + context = re_string_context_at (&mctx->input, dest_idx - 1, + mctx->eflags); + mctx->state_log[dest_idx] + = re_acquire_state_context (&err, dfa, &dest_nodes, context); + if (dest_state != NULL) + re_node_set_free (&dest_nodes); + if (BE (mctx->state_log[dest_idx] == NULL && err != REG_NOERROR, 0)) + return err; + } + return REG_NOERROR; +} +#endif /* RE_ENABLE_I18N */ + +static reg_errcode_t +internal_function +transit_state_bkref (re_match_context_t *mctx, const re_node_set *nodes) +{ + const re_dfa_t *const dfa = mctx->dfa; + reg_errcode_t err; + Idx i; + Idx cur_str_idx = re_string_cur_idx (&mctx->input); + + for (i = 0; i < nodes->nelem; ++i) + { + Idx dest_str_idx, prev_nelem, bkc_idx; + Idx node_idx = nodes->elems[i]; + unsigned int context; + const re_token_t *node = dfa->nodes + node_idx; + re_node_set *new_dest_nodes; + + /* Check whether 'node' is a backreference or not. */ + if (node->type != OP_BACK_REF) + continue; + + if (node->constraint) + { + context = re_string_context_at (&mctx->input, cur_str_idx, + mctx->eflags); + if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context)) + continue; + } + + /* 'node' is a backreference. + Check the substring which the substring matched. */ + bkc_idx = mctx->nbkref_ents; + err = get_subexp (mctx, node_idx, cur_str_idx); + if (BE (err != REG_NOERROR, 0)) + goto free_return; + + /* And add the epsilon closures (which is 'new_dest_nodes') of + the backreference to appropriate state_log. */ +#ifdef DEBUG + assert (dfa->nexts[node_idx] != -1); +#endif + for (; bkc_idx < mctx->nbkref_ents; ++bkc_idx) + { + Idx subexp_len; + re_dfastate_t *dest_state; + struct re_backref_cache_entry *bkref_ent; + bkref_ent = mctx->bkref_ents + bkc_idx; + if (bkref_ent->node != node_idx || bkref_ent->str_idx != cur_str_idx) + continue; + subexp_len = bkref_ent->subexp_to - bkref_ent->subexp_from; + new_dest_nodes = (subexp_len == 0 + ? dfa->eclosures + dfa->edests[node_idx].elems[0] + : dfa->eclosures + dfa->nexts[node_idx]); + dest_str_idx = (cur_str_idx + bkref_ent->subexp_to + - bkref_ent->subexp_from); + context = re_string_context_at (&mctx->input, dest_str_idx - 1, + mctx->eflags); + dest_state = mctx->state_log[dest_str_idx]; + prev_nelem = ((mctx->state_log[cur_str_idx] == NULL) ? 0 + : mctx->state_log[cur_str_idx]->nodes.nelem); + /* Add 'new_dest_node' to state_log. */ + if (dest_state == NULL) + { + mctx->state_log[dest_str_idx] + = re_acquire_state_context (&err, dfa, new_dest_nodes, + context); + if (BE (mctx->state_log[dest_str_idx] == NULL + && err != REG_NOERROR, 0)) + goto free_return; + } + else + { + re_node_set dest_nodes; + err = re_node_set_init_union (&dest_nodes, + dest_state->entrance_nodes, + new_dest_nodes); + if (BE (err != REG_NOERROR, 0)) + { + re_node_set_free (&dest_nodes); + goto free_return; + } + mctx->state_log[dest_str_idx] + = re_acquire_state_context (&err, dfa, &dest_nodes, context); + re_node_set_free (&dest_nodes); + if (BE (mctx->state_log[dest_str_idx] == NULL + && err != REG_NOERROR, 0)) + goto free_return; + } + /* We need to check recursively if the backreference can epsilon + transit. */ + if (subexp_len == 0 + && mctx->state_log[cur_str_idx]->nodes.nelem > prev_nelem) + { + err = check_subexp_matching_top (mctx, new_dest_nodes, + cur_str_idx); + if (BE (err != REG_NOERROR, 0)) + goto free_return; + err = transit_state_bkref (mctx, new_dest_nodes); + if (BE (err != REG_NOERROR, 0)) + goto free_return; + } + } + } + err = REG_NOERROR; + free_return: + return err; +} + +/* Enumerate all the candidates which the backreference BKREF_NODE can match + at BKREF_STR_IDX, and register them by match_ctx_add_entry(). + Note that we might collect inappropriate candidates here. + However, the cost of checking them strictly here is too high, then we + delay these checking for prune_impossible_nodes(). */ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +get_subexp (re_match_context_t *mctx, Idx bkref_node, Idx bkref_str_idx) +{ + const re_dfa_t *const dfa = mctx->dfa; + Idx subexp_num, sub_top_idx; + const char *buf = (const char *) re_string_get_buffer (&mctx->input); + /* Return if we have already checked BKREF_NODE at BKREF_STR_IDX. */ + Idx cache_idx = search_cur_bkref_entry (mctx, bkref_str_idx); + if (cache_idx != -1) + { + const struct re_backref_cache_entry *entry + = mctx->bkref_ents + cache_idx; + do + if (entry->node == bkref_node) + return REG_NOERROR; /* We already checked it. */ + while (entry++->more); + } + + subexp_num = dfa->nodes[bkref_node].opr.idx; + + /* For each sub expression */ + for (sub_top_idx = 0; sub_top_idx < mctx->nsub_tops; ++sub_top_idx) + { + reg_errcode_t err; + re_sub_match_top_t *sub_top = mctx->sub_tops[sub_top_idx]; + re_sub_match_last_t *sub_last; + Idx sub_last_idx, sl_str, bkref_str_off; + + if (dfa->nodes[sub_top->node].opr.idx != subexp_num) + continue; /* It isn't related. */ + + sl_str = sub_top->str_idx; + bkref_str_off = bkref_str_idx; + /* At first, check the last node of sub expressions we already + evaluated. */ + for (sub_last_idx = 0; sub_last_idx < sub_top->nlasts; ++sub_last_idx) + { + regoff_t sl_str_diff; + sub_last = sub_top->lasts[sub_last_idx]; + sl_str_diff = sub_last->str_idx - sl_str; + /* The matched string by the sub expression match with the substring + at the back reference? */ + if (sl_str_diff > 0) + { + if (BE (bkref_str_off + sl_str_diff > mctx->input.valid_len, 0)) + { + /* Not enough chars for a successful match. */ + if (bkref_str_off + sl_str_diff > mctx->input.len) + break; + + err = clean_state_log_if_needed (mctx, + bkref_str_off + + sl_str_diff); + if (BE (err != REG_NOERROR, 0)) + return err; + buf = (const char *) re_string_get_buffer (&mctx->input); + } + if (memcmp (buf + bkref_str_off, buf + sl_str, sl_str_diff) != 0) + /* We don't need to search this sub expression any more. */ + break; + } + bkref_str_off += sl_str_diff; + sl_str += sl_str_diff; + err = get_subexp_sub (mctx, sub_top, sub_last, bkref_node, + bkref_str_idx); + + /* Reload buf, since the preceding call might have reallocated + the buffer. */ + buf = (const char *) re_string_get_buffer (&mctx->input); + + if (err == REG_NOMATCH) + continue; + if (BE (err != REG_NOERROR, 0)) + return err; + } + + if (sub_last_idx < sub_top->nlasts) + continue; + if (sub_last_idx > 0) + ++sl_str; + /* Then, search for the other last nodes of the sub expression. */ + for (; sl_str <= bkref_str_idx; ++sl_str) + { + Idx cls_node; + regoff_t sl_str_off; + const re_node_set *nodes; + sl_str_off = sl_str - sub_top->str_idx; + /* The matched string by the sub expression match with the substring + at the back reference? */ + if (sl_str_off > 0) + { + if (BE (bkref_str_off >= mctx->input.valid_len, 0)) + { + /* If we are at the end of the input, we cannot match. */ + if (bkref_str_off >= mctx->input.len) + break; + + err = extend_buffers (mctx, bkref_str_off + 1); + if (BE (err != REG_NOERROR, 0)) + return err; + + buf = (const char *) re_string_get_buffer (&mctx->input); + } + if (buf [bkref_str_off++] != buf[sl_str - 1]) + break; /* We don't need to search this sub expression + any more. */ + } + if (mctx->state_log[sl_str] == NULL) + continue; + /* Does this state have a ')' of the sub expression? */ + nodes = &mctx->state_log[sl_str]->nodes; + cls_node = find_subexp_node (dfa, nodes, subexp_num, + OP_CLOSE_SUBEXP); + if (cls_node == -1) + continue; /* No. */ + if (sub_top->path == NULL) + { + sub_top->path = calloc (sizeof (state_array_t), + sl_str - sub_top->str_idx + 1); + if (sub_top->path == NULL) + return REG_ESPACE; + } + /* Can the OP_OPEN_SUBEXP node arrive the OP_CLOSE_SUBEXP node + in the current context? */ + err = check_arrival (mctx, sub_top->path, sub_top->node, + sub_top->str_idx, cls_node, sl_str, + OP_CLOSE_SUBEXP); + if (err == REG_NOMATCH) + continue; + if (BE (err != REG_NOERROR, 0)) + return err; + sub_last = match_ctx_add_sublast (sub_top, cls_node, sl_str); + if (BE (sub_last == NULL, 0)) + return REG_ESPACE; + err = get_subexp_sub (mctx, sub_top, sub_last, bkref_node, + bkref_str_idx); + if (err == REG_NOMATCH) + continue; + } + } + return REG_NOERROR; +} + +/* Helper functions for get_subexp(). */ + +/* Check SUB_LAST can arrive to the back reference BKREF_NODE at BKREF_STR. + If it can arrive, register the sub expression expressed with SUB_TOP + and SUB_LAST. */ + +static reg_errcode_t +internal_function +get_subexp_sub (re_match_context_t *mctx, const re_sub_match_top_t *sub_top, + re_sub_match_last_t *sub_last, Idx bkref_node, Idx bkref_str) +{ + reg_errcode_t err; + Idx to_idx; + /* Can the subexpression arrive the back reference? */ + err = check_arrival (mctx, &sub_last->path, sub_last->node, + sub_last->str_idx, bkref_node, bkref_str, + OP_OPEN_SUBEXP); + if (err != REG_NOERROR) + return err; + err = match_ctx_add_entry (mctx, bkref_node, bkref_str, sub_top->str_idx, + sub_last->str_idx); + if (BE (err != REG_NOERROR, 0)) + return err; + to_idx = bkref_str + sub_last->str_idx - sub_top->str_idx; + return clean_state_log_if_needed (mctx, to_idx); +} + +/* Find the first node which is '(' or ')' and whose index is SUBEXP_IDX. + Search '(' if FL_OPEN, or search ')' otherwise. + TODO: This function isn't efficient... + Because there might be more than one nodes whose types are + OP_OPEN_SUBEXP and whose index is SUBEXP_IDX, we must check all + nodes. + E.g. RE: (a){2} */ + +static Idx +internal_function +find_subexp_node (const re_dfa_t *dfa, const re_node_set *nodes, + Idx subexp_idx, int type) +{ + Idx cls_idx; + for (cls_idx = 0; cls_idx < nodes->nelem; ++cls_idx) + { + Idx cls_node = nodes->elems[cls_idx]; + const re_token_t *node = dfa->nodes + cls_node; + if (node->type == type + && node->opr.idx == subexp_idx) + return cls_node; + } + return -1; +} + +/* Check whether the node TOP_NODE at TOP_STR can arrive to the node + LAST_NODE at LAST_STR. We record the path onto PATH since it will be + heavily reused. + Return REG_NOERROR if it can arrive, or REG_NOMATCH otherwise. */ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node, + Idx top_str, Idx last_node, Idx last_str, int type) +{ + const re_dfa_t *const dfa = mctx->dfa; + reg_errcode_t err = REG_NOERROR; + Idx subexp_num, backup_cur_idx, str_idx, null_cnt; + re_dfastate_t *cur_state = NULL; + re_node_set *cur_nodes, next_nodes; + re_dfastate_t **backup_state_log; + unsigned int context; + + subexp_num = dfa->nodes[top_node].opr.idx; + /* Extend the buffer if we need. */ + if (BE (path->alloc < last_str + mctx->max_mb_elem_len + 1, 0)) + { + re_dfastate_t **new_array; + Idx old_alloc = path->alloc; + Idx incr_alloc = last_str + mctx->max_mb_elem_len + 1; + Idx new_alloc; + if (BE (IDX_MAX - old_alloc < incr_alloc, 0)) + return REG_ESPACE; + new_alloc = old_alloc + incr_alloc; + if (BE (SIZE_MAX / sizeof (re_dfastate_t *) < new_alloc, 0)) + return REG_ESPACE; + new_array = re_realloc (path->array, re_dfastate_t *, new_alloc); + if (BE (new_array == NULL, 0)) + return REG_ESPACE; + path->array = new_array; + path->alloc = new_alloc; + memset (new_array + old_alloc, '\0', + sizeof (re_dfastate_t *) * (path->alloc - old_alloc)); + } + + str_idx = path->next_idx ? path->next_idx : top_str; + + /* Temporary modify MCTX. */ + backup_state_log = mctx->state_log; + backup_cur_idx = mctx->input.cur_idx; + mctx->state_log = path->array; + mctx->input.cur_idx = str_idx; + + /* Setup initial node set. */ + context = re_string_context_at (&mctx->input, str_idx - 1, mctx->eflags); + if (str_idx == top_str) + { + err = re_node_set_init_1 (&next_nodes, top_node); + if (BE (err != REG_NOERROR, 0)) + return err; + err = check_arrival_expand_ecl (dfa, &next_nodes, subexp_num, type); + if (BE (err != REG_NOERROR, 0)) + { + re_node_set_free (&next_nodes); + return err; + } + } + else + { + cur_state = mctx->state_log[str_idx]; + if (cur_state && cur_state->has_backref) + { + err = re_node_set_init_copy (&next_nodes, &cur_state->nodes); + if (BE (err != REG_NOERROR, 0)) + return err; + } + else + re_node_set_init_empty (&next_nodes); + } + if (str_idx == top_str || (cur_state && cur_state->has_backref)) + { + if (next_nodes.nelem) + { + err = expand_bkref_cache (mctx, &next_nodes, str_idx, + subexp_num, type); + if (BE (err != REG_NOERROR, 0)) + { + re_node_set_free (&next_nodes); + return err; + } + } + cur_state = re_acquire_state_context (&err, dfa, &next_nodes, context); + if (BE (cur_state == NULL && err != REG_NOERROR, 0)) + { + re_node_set_free (&next_nodes); + return err; + } + mctx->state_log[str_idx] = cur_state; + } + + for (null_cnt = 0; str_idx < last_str && null_cnt <= mctx->max_mb_elem_len;) + { + re_node_set_empty (&next_nodes); + if (mctx->state_log[str_idx + 1]) + { + err = re_node_set_merge (&next_nodes, + &mctx->state_log[str_idx + 1]->nodes); + if (BE (err != REG_NOERROR, 0)) + { + re_node_set_free (&next_nodes); + return err; + } + } + if (cur_state) + { + err = check_arrival_add_next_nodes (mctx, str_idx, + &cur_state->non_eps_nodes, + &next_nodes); + if (BE (err != REG_NOERROR, 0)) + { + re_node_set_free (&next_nodes); + return err; + } + } + ++str_idx; + if (next_nodes.nelem) + { + err = check_arrival_expand_ecl (dfa, &next_nodes, subexp_num, type); + if (BE (err != REG_NOERROR, 0)) + { + re_node_set_free (&next_nodes); + return err; + } + err = expand_bkref_cache (mctx, &next_nodes, str_idx, + subexp_num, type); + if (BE (err != REG_NOERROR, 0)) + { + re_node_set_free (&next_nodes); + return err; + } + } + context = re_string_context_at (&mctx->input, str_idx - 1, mctx->eflags); + cur_state = re_acquire_state_context (&err, dfa, &next_nodes, context); + if (BE (cur_state == NULL && err != REG_NOERROR, 0)) + { + re_node_set_free (&next_nodes); + return err; + } + mctx->state_log[str_idx] = cur_state; + null_cnt = cur_state == NULL ? null_cnt + 1 : 0; + } + re_node_set_free (&next_nodes); + cur_nodes = (mctx->state_log[last_str] == NULL ? NULL + : &mctx->state_log[last_str]->nodes); + path->next_idx = str_idx; + + /* Fix MCTX. */ + mctx->state_log = backup_state_log; + mctx->input.cur_idx = backup_cur_idx; + + /* Then check the current node set has the node LAST_NODE. */ + if (cur_nodes != NULL && re_node_set_contains (cur_nodes, last_node)) + return REG_NOERROR; + + return REG_NOMATCH; +} + +/* Helper functions for check_arrival. */ + +/* Calculate the destination nodes of CUR_NODES at STR_IDX, and append them + to NEXT_NODES. + TODO: This function is similar to the functions transit_state*(), + however this function has many additional works. + Can't we unify them? */ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +check_arrival_add_next_nodes (re_match_context_t *mctx, Idx str_idx, + re_node_set *cur_nodes, re_node_set *next_nodes) +{ + const re_dfa_t *const dfa = mctx->dfa; + bool ok; + Idx cur_idx; +#ifdef RE_ENABLE_I18N + reg_errcode_t err = REG_NOERROR; +#endif + re_node_set union_set; + re_node_set_init_empty (&union_set); + for (cur_idx = 0; cur_idx < cur_nodes->nelem; ++cur_idx) + { + int naccepted = 0; + Idx cur_node = cur_nodes->elems[cur_idx]; +#ifdef DEBUG + re_token_type_t type = dfa->nodes[cur_node].type; + assert (!IS_EPSILON_NODE (type)); +#endif +#ifdef RE_ENABLE_I18N + /* If the node may accept "multi byte". */ + if (dfa->nodes[cur_node].accept_mb) + { + naccepted = check_node_accept_bytes (dfa, cur_node, &mctx->input, + str_idx); + if (naccepted > 1) + { + re_dfastate_t *dest_state; + Idx next_node = dfa->nexts[cur_node]; + Idx next_idx = str_idx + naccepted; + dest_state = mctx->state_log[next_idx]; + re_node_set_empty (&union_set); + if (dest_state) + { + err = re_node_set_merge (&union_set, &dest_state->nodes); + if (BE (err != REG_NOERROR, 0)) + { + re_node_set_free (&union_set); + return err; + } + } + ok = re_node_set_insert (&union_set, next_node); + if (BE (! ok, 0)) + { + re_node_set_free (&union_set); + return REG_ESPACE; + } + mctx->state_log[next_idx] = re_acquire_state (&err, dfa, + &union_set); + if (BE (mctx->state_log[next_idx] == NULL + && err != REG_NOERROR, 0)) + { + re_node_set_free (&union_set); + return err; + } + } + } +#endif /* RE_ENABLE_I18N */ + if (naccepted + || check_node_accept (mctx, dfa->nodes + cur_node, str_idx)) + { + ok = re_node_set_insert (next_nodes, dfa->nexts[cur_node]); + if (BE (! ok, 0)) + { + re_node_set_free (&union_set); + return REG_ESPACE; + } + } + } + re_node_set_free (&union_set); + return REG_NOERROR; +} + +/* For all the nodes in CUR_NODES, add the epsilon closures of them to + CUR_NODES, however exclude the nodes which are: + - inside the sub expression whose number is EX_SUBEXP, if FL_OPEN. + - out of the sub expression whose number is EX_SUBEXP, if !FL_OPEN. +*/ + +static reg_errcode_t +internal_function +check_arrival_expand_ecl (const re_dfa_t *dfa, re_node_set *cur_nodes, + Idx ex_subexp, int type) +{ + reg_errcode_t err; + Idx idx, outside_node; + re_node_set new_nodes; +#ifdef DEBUG + assert (cur_nodes->nelem); +#endif + err = re_node_set_alloc (&new_nodes, cur_nodes->nelem); + if (BE (err != REG_NOERROR, 0)) + return err; + /* Create a new node set NEW_NODES with the nodes which are epsilon + closures of the node in CUR_NODES. */ + + for (idx = 0; idx < cur_nodes->nelem; ++idx) + { + Idx cur_node = cur_nodes->elems[idx]; + const re_node_set *eclosure = dfa->eclosures + cur_node; + outside_node = find_subexp_node (dfa, eclosure, ex_subexp, type); + if (outside_node == -1) + { + /* There are no problematic nodes, just merge them. */ + err = re_node_set_merge (&new_nodes, eclosure); + if (BE (err != REG_NOERROR, 0)) + { + re_node_set_free (&new_nodes); + return err; + } + } + else + { + /* There are problematic nodes, re-calculate incrementally. */ + err = check_arrival_expand_ecl_sub (dfa, &new_nodes, cur_node, + ex_subexp, type); + if (BE (err != REG_NOERROR, 0)) + { + re_node_set_free (&new_nodes); + return err; + } + } + } + re_node_set_free (cur_nodes); + *cur_nodes = new_nodes; + return REG_NOERROR; +} + +/* Helper function for check_arrival_expand_ecl. + Check incrementally the epsilon closure of TARGET, and if it isn't + problematic append it to DST_NODES. */ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +check_arrival_expand_ecl_sub (const re_dfa_t *dfa, re_node_set *dst_nodes, + Idx target, Idx ex_subexp, int type) +{ + Idx cur_node; + for (cur_node = target; !re_node_set_contains (dst_nodes, cur_node);) + { + bool ok; + + if (dfa->nodes[cur_node].type == type + && dfa->nodes[cur_node].opr.idx == ex_subexp) + { + if (type == OP_CLOSE_SUBEXP) + { + ok = re_node_set_insert (dst_nodes, cur_node); + if (BE (! ok, 0)) + return REG_ESPACE; + } + break; + } + ok = re_node_set_insert (dst_nodes, cur_node); + if (BE (! ok, 0)) + return REG_ESPACE; + if (dfa->edests[cur_node].nelem == 0) + break; + if (dfa->edests[cur_node].nelem == 2) + { + reg_errcode_t err; + err = check_arrival_expand_ecl_sub (dfa, dst_nodes, + dfa->edests[cur_node].elems[1], + ex_subexp, type); + if (BE (err != REG_NOERROR, 0)) + return err; + } + cur_node = dfa->edests[cur_node].elems[0]; + } + return REG_NOERROR; +} + + +/* For all the back references in the current state, calculate the + destination of the back references by the appropriate entry + in MCTX->BKREF_ENTS. */ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +expand_bkref_cache (re_match_context_t *mctx, re_node_set *cur_nodes, + Idx cur_str, Idx subexp_num, int type) +{ + const re_dfa_t *const dfa = mctx->dfa; + reg_errcode_t err; + Idx cache_idx_start = search_cur_bkref_entry (mctx, cur_str); + struct re_backref_cache_entry *ent; + + if (cache_idx_start == -1) + return REG_NOERROR; + + restart: + ent = mctx->bkref_ents + cache_idx_start; + do + { + Idx to_idx, next_node; + + /* Is this entry ENT is appropriate? */ + if (!re_node_set_contains (cur_nodes, ent->node)) + continue; /* No. */ + + to_idx = cur_str + ent->subexp_to - ent->subexp_from; + /* Calculate the destination of the back reference, and append it + to MCTX->STATE_LOG. */ + if (to_idx == cur_str) + { + /* The backreference did epsilon transit, we must re-check all the + node in the current state. */ + re_node_set new_dests; + reg_errcode_t err2, err3; + next_node = dfa->edests[ent->node].elems[0]; + if (re_node_set_contains (cur_nodes, next_node)) + continue; + err = re_node_set_init_1 (&new_dests, next_node); + err2 = check_arrival_expand_ecl (dfa, &new_dests, subexp_num, type); + err3 = re_node_set_merge (cur_nodes, &new_dests); + re_node_set_free (&new_dests); + if (BE (err != REG_NOERROR || err2 != REG_NOERROR + || err3 != REG_NOERROR, 0)) + { + err = (err != REG_NOERROR ? err + : (err2 != REG_NOERROR ? err2 : err3)); + return err; + } + /* TODO: It is still inefficient... */ + goto restart; + } + else + { + re_node_set union_set; + next_node = dfa->nexts[ent->node]; + if (mctx->state_log[to_idx]) + { + bool ok; + if (re_node_set_contains (&mctx->state_log[to_idx]->nodes, + next_node)) + continue; + err = re_node_set_init_copy (&union_set, + &mctx->state_log[to_idx]->nodes); + ok = re_node_set_insert (&union_set, next_node); + if (BE (err != REG_NOERROR || ! ok, 0)) + { + re_node_set_free (&union_set); + err = err != REG_NOERROR ? err : REG_ESPACE; + return err; + } + } + else + { + err = re_node_set_init_1 (&union_set, next_node); + if (BE (err != REG_NOERROR, 0)) + return err; + } + mctx->state_log[to_idx] = re_acquire_state (&err, dfa, &union_set); + re_node_set_free (&union_set); + if (BE (mctx->state_log[to_idx] == NULL + && err != REG_NOERROR, 0)) + return err; + } + } + while (ent++->more); + return REG_NOERROR; +} + +/* Build transition table for the state. + Return true if successful. */ + +static bool +internal_function +build_trtable (const re_dfa_t *dfa, re_dfastate_t *state) +{ + reg_errcode_t err; + Idx i, j; + int ch; + bool need_word_trtable = false; + bitset_word_t elem, mask; + bool dests_node_malloced = false; + bool dest_states_malloced = false; + Idx ndests; /* Number of the destination states from 'state'. */ + re_dfastate_t **trtable; + re_dfastate_t **dest_states = NULL, **dest_states_word, **dest_states_nl; + re_node_set follows, *dests_node; + bitset_t *dests_ch; + bitset_t acceptable; + + struct dests_alloc + { + re_node_set dests_node[SBC_MAX]; + bitset_t dests_ch[SBC_MAX]; + } *dests_alloc; + + /* We build DFA states which corresponds to the destination nodes + from 'state'. 'dests_node[i]' represents the nodes which i-th + destination state contains, and 'dests_ch[i]' represents the + characters which i-th destination state accepts. */ + if (__libc_use_alloca (sizeof (struct dests_alloc))) + dests_alloc = (struct dests_alloc *) alloca (sizeof (struct dests_alloc)); + else + { + dests_alloc = re_malloc (struct dests_alloc, 1); + if (BE (dests_alloc == NULL, 0)) + return false; + dests_node_malloced = true; + } + dests_node = dests_alloc->dests_node; + dests_ch = dests_alloc->dests_ch; + + /* Initialize transition table. */ + state->word_trtable = state->trtable = NULL; + + /* At first, group all nodes belonging to 'state' into several + destinations. */ + ndests = group_nodes_into_DFAstates (dfa, state, dests_node, dests_ch); + if (BE (ndests <= 0, 0)) + { + if (dests_node_malloced) + free (dests_alloc); + /* Return false in case of an error, true otherwise. */ + if (ndests == 0) + { + state->trtable = (re_dfastate_t **) + calloc (sizeof (re_dfastate_t *), SBC_MAX); + if (BE (state->trtable == NULL, 0)) + return false; + return true; + } + return false; + } + + err = re_node_set_alloc (&follows, ndests + 1); + if (BE (err != REG_NOERROR, 0)) + goto out_free; + + /* Avoid arithmetic overflow in size calculation. */ + if (BE ((((SIZE_MAX - (sizeof (re_node_set) + sizeof (bitset_t)) * SBC_MAX) + / (3 * sizeof (re_dfastate_t *))) + < ndests), + 0)) + goto out_free; + + if (__libc_use_alloca ((sizeof (re_node_set) + sizeof (bitset_t)) * SBC_MAX + + ndests * 3 * sizeof (re_dfastate_t *))) + dest_states = (re_dfastate_t **) + alloca (ndests * 3 * sizeof (re_dfastate_t *)); + else + { + dest_states = (re_dfastate_t **) + malloc (ndests * 3 * sizeof (re_dfastate_t *)); + if (BE (dest_states == NULL, 0)) + { +out_free: + if (dest_states_malloced) + free (dest_states); + re_node_set_free (&follows); + for (i = 0; i < ndests; ++i) + re_node_set_free (dests_node + i); + if (dests_node_malloced) + free (dests_alloc); + return false; + } + dest_states_malloced = true; + } + dest_states_word = dest_states + ndests; + dest_states_nl = dest_states_word + ndests; + bitset_empty (acceptable); + + /* Then build the states for all destinations. */ + for (i = 0; i < ndests; ++i) + { + Idx next_node; + re_node_set_empty (&follows); + /* Merge the follows of this destination states. */ + for (j = 0; j < dests_node[i].nelem; ++j) + { + next_node = dfa->nexts[dests_node[i].elems[j]]; + if (next_node != -1) + { + err = re_node_set_merge (&follows, dfa->eclosures + next_node); + if (BE (err != REG_NOERROR, 0)) + goto out_free; + } + } + dest_states[i] = re_acquire_state_context (&err, dfa, &follows, 0); + if (BE (dest_states[i] == NULL && err != REG_NOERROR, 0)) + goto out_free; + /* If the new state has context constraint, + build appropriate states for these contexts. */ + if (dest_states[i]->has_constraint) + { + dest_states_word[i] = re_acquire_state_context (&err, dfa, &follows, + CONTEXT_WORD); + if (BE (dest_states_word[i] == NULL && err != REG_NOERROR, 0)) + goto out_free; + + if (dest_states[i] != dest_states_word[i] && dfa->mb_cur_max > 1) + need_word_trtable = true; + + dest_states_nl[i] = re_acquire_state_context (&err, dfa, &follows, + CONTEXT_NEWLINE); + if (BE (dest_states_nl[i] == NULL && err != REG_NOERROR, 0)) + goto out_free; + } + else + { + dest_states_word[i] = dest_states[i]; + dest_states_nl[i] = dest_states[i]; + } + bitset_merge (acceptable, dests_ch[i]); + } + + if (!BE (need_word_trtable, 0)) + { + /* We don't care about whether the following character is a word + character, or we are in a single-byte character set so we can + discern by looking at the character code: allocate a + 256-entry transition table. */ + trtable = state->trtable = + (re_dfastate_t **) calloc (sizeof (re_dfastate_t *), SBC_MAX); + if (BE (trtable == NULL, 0)) + goto out_free; + + /* For all characters ch...: */ + for (i = 0; i < BITSET_WORDS; ++i) + for (ch = i * BITSET_WORD_BITS, elem = acceptable[i], mask = 1; + elem; + mask <<= 1, elem >>= 1, ++ch) + if (BE (elem & 1, 0)) + { + /* There must be exactly one destination which accepts + character ch. See group_nodes_into_DFAstates. */ + for (j = 0; (dests_ch[j][i] & mask) == 0; ++j) + ; + + /* j-th destination accepts the word character ch. */ + if (dfa->word_char[i] & mask) + trtable[ch] = dest_states_word[j]; + else + trtable[ch] = dest_states[j]; + } + } + else + { + /* We care about whether the following character is a word + character, and we are in a multi-byte character set: discern + by looking at the character code: build two 256-entry + transition tables, one starting at trtable[0] and one + starting at trtable[SBC_MAX]. */ + trtable = state->word_trtable = + (re_dfastate_t **) calloc (sizeof (re_dfastate_t *), 2 * SBC_MAX); + if (BE (trtable == NULL, 0)) + goto out_free; + + /* For all characters ch...: */ + for (i = 0; i < BITSET_WORDS; ++i) + for (ch = i * BITSET_WORD_BITS, elem = acceptable[i], mask = 1; + elem; + mask <<= 1, elem >>= 1, ++ch) + if (BE (elem & 1, 0)) + { + /* There must be exactly one destination which accepts + character ch. See group_nodes_into_DFAstates. */ + for (j = 0; (dests_ch[j][i] & mask) == 0; ++j) + ; + + /* j-th destination accepts the word character ch. */ + trtable[ch] = dest_states[j]; + trtable[ch + SBC_MAX] = dest_states_word[j]; + } + } + + /* new line */ + if (bitset_contain (acceptable, NEWLINE_CHAR)) + { + /* The current state accepts newline character. */ + for (j = 0; j < ndests; ++j) + if (bitset_contain (dests_ch[j], NEWLINE_CHAR)) + { + /* k-th destination accepts newline character. */ + trtable[NEWLINE_CHAR] = dest_states_nl[j]; + if (need_word_trtable) + trtable[NEWLINE_CHAR + SBC_MAX] = dest_states_nl[j]; + /* There must be only one destination which accepts + newline. See group_nodes_into_DFAstates. */ + break; + } + } + + if (dest_states_malloced) + free (dest_states); + + re_node_set_free (&follows); + for (i = 0; i < ndests; ++i) + re_node_set_free (dests_node + i); + + if (dests_node_malloced) + free (dests_alloc); + + return true; +} + +/* Group all nodes belonging to STATE into several destinations. + Then for all destinations, set the nodes belonging to the destination + to DESTS_NODE[i] and set the characters accepted by the destination + to DEST_CH[i]. This function return the number of destinations. */ + +static Idx +internal_function +group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state, + re_node_set *dests_node, bitset_t *dests_ch) +{ + reg_errcode_t err; + bool ok; + Idx i, j, k; + Idx ndests; /* Number of the destinations from 'state'. */ + bitset_t accepts; /* Characters a node can accept. */ + const re_node_set *cur_nodes = &state->nodes; + bitset_empty (accepts); + ndests = 0; + + /* For all the nodes belonging to 'state', */ + for (i = 0; i < cur_nodes->nelem; ++i) + { + re_token_t *node = &dfa->nodes[cur_nodes->elems[i]]; + re_token_type_t type = node->type; + unsigned int constraint = node->constraint; + + /* Enumerate all single byte character this node can accept. */ + if (type == CHARACTER) + bitset_set (accepts, node->opr.c); + else if (type == SIMPLE_BRACKET) + { + bitset_merge (accepts, node->opr.sbcset); + } + else if (type == OP_PERIOD) + { +#ifdef RE_ENABLE_I18N + if (dfa->mb_cur_max > 1) + bitset_merge (accepts, dfa->sb_char); + else +#endif + bitset_set_all (accepts); + if (!(dfa->syntax & RE_DOT_NEWLINE)) + bitset_clear (accepts, '\n'); + if (dfa->syntax & RE_DOT_NOT_NULL) + bitset_clear (accepts, '\0'); + } +#ifdef RE_ENABLE_I18N + else if (type == OP_UTF8_PERIOD) + { + if (ASCII_CHARS % BITSET_WORD_BITS == 0) + memset (accepts, -1, ASCII_CHARS / CHAR_BIT); + else + bitset_merge (accepts, utf8_sb_map); + if (!(dfa->syntax & RE_DOT_NEWLINE)) + bitset_clear (accepts, '\n'); + if (dfa->syntax & RE_DOT_NOT_NULL) + bitset_clear (accepts, '\0'); + } +#endif + else + continue; + + /* Check the 'accepts' and sift the characters which are not + match it the context. */ + if (constraint) + { + if (constraint & NEXT_NEWLINE_CONSTRAINT) + { + bool accepts_newline = bitset_contain (accepts, NEWLINE_CHAR); + bitset_empty (accepts); + if (accepts_newline) + bitset_set (accepts, NEWLINE_CHAR); + else + continue; + } + if (constraint & NEXT_ENDBUF_CONSTRAINT) + { + bitset_empty (accepts); + continue; + } + + if (constraint & NEXT_WORD_CONSTRAINT) + { + bitset_word_t any_set = 0; + if (type == CHARACTER && !node->word_char) + { + bitset_empty (accepts); + continue; + } +#ifdef RE_ENABLE_I18N + if (dfa->mb_cur_max > 1) + for (j = 0; j < BITSET_WORDS; ++j) + any_set |= (accepts[j] &= (dfa->word_char[j] | ~dfa->sb_char[j])); + else +#endif + for (j = 0; j < BITSET_WORDS; ++j) + any_set |= (accepts[j] &= dfa->word_char[j]); + if (!any_set) + continue; + } + if (constraint & NEXT_NOTWORD_CONSTRAINT) + { + bitset_word_t any_set = 0; + if (type == CHARACTER && node->word_char) + { + bitset_empty (accepts); + continue; + } +#ifdef RE_ENABLE_I18N + if (dfa->mb_cur_max > 1) + for (j = 0; j < BITSET_WORDS; ++j) + any_set |= (accepts[j] &= ~(dfa->word_char[j] & dfa->sb_char[j])); + else +#endif + for (j = 0; j < BITSET_WORDS; ++j) + any_set |= (accepts[j] &= ~dfa->word_char[j]); + if (!any_set) + continue; + } + } + + /* Then divide 'accepts' into DFA states, or create a new + state. Above, we make sure that accepts is not empty. */ + for (j = 0; j < ndests; ++j) + { + bitset_t intersec; /* Intersection sets, see below. */ + bitset_t remains; + /* Flags, see below. */ + bitset_word_t has_intersec, not_subset, not_consumed; + + /* Optimization, skip if this state doesn't accept the character. */ + if (type == CHARACTER && !bitset_contain (dests_ch[j], node->opr.c)) + continue; + + /* Enumerate the intersection set of this state and 'accepts'. */ + has_intersec = 0; + for (k = 0; k < BITSET_WORDS; ++k) + has_intersec |= intersec[k] = accepts[k] & dests_ch[j][k]; + /* And skip if the intersection set is empty. */ + if (!has_intersec) + continue; + + /* Then check if this state is a subset of 'accepts'. */ + not_subset = not_consumed = 0; + for (k = 0; k < BITSET_WORDS; ++k) + { + not_subset |= remains[k] = ~accepts[k] & dests_ch[j][k]; + not_consumed |= accepts[k] = accepts[k] & ~dests_ch[j][k]; + } + + /* If this state isn't a subset of 'accepts', create a + new group state, which has the 'remains'. */ + if (not_subset) + { + bitset_copy (dests_ch[ndests], remains); + bitset_copy (dests_ch[j], intersec); + err = re_node_set_init_copy (dests_node + ndests, &dests_node[j]); + if (BE (err != REG_NOERROR, 0)) + goto error_return; + ++ndests; + } + + /* Put the position in the current group. */ + ok = re_node_set_insert (&dests_node[j], cur_nodes->elems[i]); + if (BE (! ok, 0)) + goto error_return; + + /* If all characters are consumed, go to next node. */ + if (!not_consumed) + break; + } + /* Some characters remain, create a new group. */ + if (j == ndests) + { + bitset_copy (dests_ch[ndests], accepts); + err = re_node_set_init_1 (dests_node + ndests, cur_nodes->elems[i]); + if (BE (err != REG_NOERROR, 0)) + goto error_return; + ++ndests; + bitset_empty (accepts); + } + } + return ndests; + error_return: + for (j = 0; j < ndests; ++j) + re_node_set_free (dests_node + j); + return -1; +} + +#ifdef RE_ENABLE_I18N +/* Check how many bytes the node 'dfa->nodes[node_idx]' accepts. + Return the number of the bytes the node accepts. + STR_IDX is the current index of the input string. + + This function handles the nodes which can accept one character, or + one collating element like '.', '[a-z]', opposite to the other nodes + can only accept one byte. */ + +# ifdef _LIBC +# include <locale/weight.h> +# endif + +static int +internal_function +check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx, + const re_string_t *input, Idx str_idx) +{ + const re_token_t *node = dfa->nodes + node_idx; + int char_len, elem_len; + Idx i; + + if (BE (node->type == OP_UTF8_PERIOD, 0)) + { + unsigned char c = re_string_byte_at (input, str_idx), d; + if (BE (c < 0xc2, 1)) + return 0; + + if (str_idx + 2 > input->len) + return 0; + + d = re_string_byte_at (input, str_idx + 1); + if (c < 0xe0) + return (d < 0x80 || d > 0xbf) ? 0 : 2; + else if (c < 0xf0) + { + char_len = 3; + if (c == 0xe0 && d < 0xa0) + return 0; + } + else if (c < 0xf8) + { + char_len = 4; + if (c == 0xf0 && d < 0x90) + return 0; + } + else if (c < 0xfc) + { + char_len = 5; + if (c == 0xf8 && d < 0x88) + return 0; + } + else if (c < 0xfe) + { + char_len = 6; + if (c == 0xfc && d < 0x84) + return 0; + } + else + return 0; + + if (str_idx + char_len > input->len) + return 0; + + for (i = 1; i < char_len; ++i) + { + d = re_string_byte_at (input, str_idx + i); + if (d < 0x80 || d > 0xbf) + return 0; + } + return char_len; + } + + char_len = re_string_char_size_at (input, str_idx); + if (node->type == OP_PERIOD) + { + if (char_len <= 1) + return 0; + /* FIXME: I don't think this if is needed, as both '\n' + and '\0' are char_len == 1. */ + /* '.' accepts any one character except the following two cases. */ + if ((!(dfa->syntax & RE_DOT_NEWLINE) && + re_string_byte_at (input, str_idx) == '\n') || + ((dfa->syntax & RE_DOT_NOT_NULL) && + re_string_byte_at (input, str_idx) == '\0')) + return 0; + return char_len; + } + + elem_len = re_string_elem_size_at (input, str_idx); + if ((elem_len <= 1 && char_len <= 1) || char_len == 0) + return 0; + + if (node->type == COMPLEX_BRACKET) + { + const re_charset_t *cset = node->opr.mbcset; +# ifdef _LIBC + const unsigned char *pin + = ((const unsigned char *) re_string_get_buffer (input) + str_idx); + Idx j; + uint32_t nrules; +# endif /* _LIBC */ + int match_len = 0; + wchar_t wc = ((cset->nranges || cset->nchar_classes || cset->nmbchars) + ? re_string_wchar_at (input, str_idx) : 0); + + /* match with multibyte character? */ + for (i = 0; i < cset->nmbchars; ++i) + if (wc == cset->mbchars[i]) + { + match_len = char_len; + goto check_node_accept_bytes_match; + } + /* match with character_class? */ + for (i = 0; i < cset->nchar_classes; ++i) + { + wctype_t wt = cset->char_classes[i]; + if (__iswctype (wc, wt)) + { + match_len = char_len; + goto check_node_accept_bytes_match; + } + } + +# ifdef _LIBC + nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); + if (nrules != 0) + { + unsigned int in_collseq = 0; + const int32_t *table, *indirect; + const unsigned char *weights, *extra; + const char *collseqwc; + + /* match with collating_symbol? */ + if (cset->ncoll_syms) + extra = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB); + for (i = 0; i < cset->ncoll_syms; ++i) + { + const unsigned char *coll_sym = extra + cset->coll_syms[i]; + /* Compare the length of input collating element and + the length of current collating element. */ + if (*coll_sym != elem_len) + continue; + /* Compare each bytes. */ + for (j = 0; j < *coll_sym; j++) + if (pin[j] != coll_sym[1 + j]) + break; + if (j == *coll_sym) + { + /* Match if every bytes is equal. */ + match_len = j; + goto check_node_accept_bytes_match; + } + } + + if (cset->nranges) + { + if (elem_len <= char_len) + { + collseqwc = _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQWC); + in_collseq = __collseq_table_lookup (collseqwc, wc); + } + else + in_collseq = find_collation_sequence_value (pin, elem_len); + } + /* match with range expression? */ + /* FIXME: Implement rational ranges here, too. */ + for (i = 0; i < cset->nranges; ++i) + if (cset->range_starts[i] <= in_collseq + && in_collseq <= cset->range_ends[i]) + { + match_len = elem_len; + goto check_node_accept_bytes_match; + } + + /* match with equivalence_class? */ + if (cset->nequiv_classes) + { + const unsigned char *cp = pin; + table = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB); + weights = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTMB); + extra = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB); + indirect = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); + int32_t idx = findidx (table, indirect, extra, &cp, elem_len); + if (idx > 0) + for (i = 0; i < cset->nequiv_classes; ++i) + { + int32_t equiv_class_idx = cset->equiv_classes[i]; + size_t weight_len = weights[idx & 0xffffff]; + if (weight_len == weights[equiv_class_idx & 0xffffff] + && (idx >> 24) == (equiv_class_idx >> 24)) + { + Idx cnt = 0; + + idx &= 0xffffff; + equiv_class_idx &= 0xffffff; + + while (cnt <= weight_len + && (weights[equiv_class_idx + 1 + cnt] + == weights[idx + 1 + cnt])) + ++cnt; + if (cnt > weight_len) + { + match_len = elem_len; + goto check_node_accept_bytes_match; + } + } + } + } + } + else +# endif /* _LIBC */ + { + /* match with range expression? */ + for (i = 0; i < cset->nranges; ++i) + { + if (cset->range_starts[i] <= wc && wc <= cset->range_ends[i]) + { + match_len = char_len; + goto check_node_accept_bytes_match; + } + } + } + check_node_accept_bytes_match: + if (!cset->non_match) + return match_len; + else + { + if (match_len > 0) + return 0; + else + return (elem_len > char_len) ? elem_len : char_len; + } + } + return 0; +} + +# ifdef _LIBC +static unsigned int +internal_function +find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len) +{ + uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); + if (nrules == 0) + { + if (mbs_len == 1) + { + /* No valid character. Match it as a single byte character. */ + const unsigned char *collseq = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQMB); + return collseq[mbs[0]]; + } + return UINT_MAX; + } + else + { + int32_t idx; + const unsigned char *extra = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB); + int32_t extrasize = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB + 1) - extra; + + for (idx = 0; idx < extrasize;) + { + int mbs_cnt; + bool found = false; + int32_t elem_mbs_len; + /* Skip the name of collating element name. */ + idx = idx + extra[idx] + 1; + elem_mbs_len = extra[idx++]; + if (mbs_len == elem_mbs_len) + { + for (mbs_cnt = 0; mbs_cnt < elem_mbs_len; ++mbs_cnt) + if (extra[idx + mbs_cnt] != mbs[mbs_cnt]) + break; + if (mbs_cnt == elem_mbs_len) + /* Found the entry. */ + found = true; + } + /* Skip the byte sequence of the collating element. */ + idx += elem_mbs_len; + /* Adjust for the alignment. */ + idx = (idx + 3) & ~3; + /* Skip the collation sequence value. */ + idx += sizeof (uint32_t); + /* Skip the wide char sequence of the collating element. */ + idx = idx + sizeof (uint32_t) * (*(int32_t *) (extra + idx) + 1); + /* If we found the entry, return the sequence value. */ + if (found) + return *(uint32_t *) (extra + idx); + /* Skip the collation sequence value. */ + idx += sizeof (uint32_t); + } + return UINT_MAX; + } +} +# endif /* _LIBC */ +#endif /* RE_ENABLE_I18N */ + +/* Check whether the node accepts the byte which is IDX-th + byte of the INPUT. */ + +static bool +internal_function +check_node_accept (const re_match_context_t *mctx, const re_token_t *node, + Idx idx) +{ + unsigned char ch; + ch = re_string_byte_at (&mctx->input, idx); + switch (node->type) + { + case CHARACTER: + if (node->opr.c != ch) + return false; + break; + + case SIMPLE_BRACKET: + if (!bitset_contain (node->opr.sbcset, ch)) + return false; + break; + +#ifdef RE_ENABLE_I18N + case OP_UTF8_PERIOD: + if (ch >= ASCII_CHARS) + return false; + /* FALLTHROUGH */ +#endif + case OP_PERIOD: + if ((ch == '\n' && !(mctx->dfa->syntax & RE_DOT_NEWLINE)) + || (ch == '\0' && (mctx->dfa->syntax & RE_DOT_NOT_NULL))) + return false; + break; + + default: + return false; + } + + if (node->constraint) + { + /* The node has constraints. Check whether the current context + satisfies the constraints. */ + unsigned int context = re_string_context_at (&mctx->input, idx, + mctx->eflags); + if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context)) + return false; + } + + return true; +} + +/* Extend the buffers, if the buffers have run out. */ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +extend_buffers (re_match_context_t *mctx, int min_len) +{ + reg_errcode_t ret; + re_string_t *pstr = &mctx->input; + + /* Avoid overflow. */ + if (BE (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) / 2 + <= pstr->bufs_len, 0)) + return REG_ESPACE; + + /* Double the lengths of the buffers, but allocate at least MIN_LEN. */ + ret = re_string_realloc_buffers (pstr, + MAX (min_len, + MIN (pstr->len, pstr->bufs_len * 2))); + if (BE (ret != REG_NOERROR, 0)) + return ret; + + if (mctx->state_log != NULL) + { + /* And double the length of state_log. */ + /* XXX We have no indication of the size of this buffer. If this + allocation fail we have no indication that the state_log array + does not have the right size. */ + re_dfastate_t **new_array = re_realloc (mctx->state_log, re_dfastate_t *, + pstr->bufs_len + 1); + if (BE (new_array == NULL, 0)) + return REG_ESPACE; + mctx->state_log = new_array; + } + + /* Then reconstruct the buffers. */ + if (pstr->icase) + { +#ifdef RE_ENABLE_I18N + if (pstr->mb_cur_max > 1) + { + ret = build_wcs_upper_buffer (pstr); + if (BE (ret != REG_NOERROR, 0)) + return ret; + } + else +#endif /* RE_ENABLE_I18N */ + build_upper_buffer (pstr); + } + else + { +#ifdef RE_ENABLE_I18N + if (pstr->mb_cur_max > 1) + build_wcs_buffer (pstr); + else +#endif /* RE_ENABLE_I18N */ + { + if (pstr->trans != NULL) + re_string_translate_buffer (pstr); + } + } + return REG_NOERROR; +} + + +/* Functions for matching context. */ + +/* Initialize MCTX. */ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +match_ctx_init (re_match_context_t *mctx, int eflags, Idx n) +{ + mctx->eflags = eflags; + mctx->match_last = -1; + if (n > 0) + { + /* Avoid overflow. */ + size_t max_object_size = + MAX (sizeof (struct re_backref_cache_entry), + sizeof (re_sub_match_top_t *)); + if (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) < n, 0)) + return REG_ESPACE; + + mctx->bkref_ents = re_malloc (struct re_backref_cache_entry, n); + mctx->sub_tops = re_malloc (re_sub_match_top_t *, n); + if (BE (mctx->bkref_ents == NULL || mctx->sub_tops == NULL, 0)) + return REG_ESPACE; + } + /* Already zero-ed by the caller. + else + mctx->bkref_ents = NULL; + mctx->nbkref_ents = 0; + mctx->nsub_tops = 0; */ + mctx->abkref_ents = n; + mctx->max_mb_elem_len = 1; + mctx->asub_tops = n; + return REG_NOERROR; +} + +/* Clean the entries which depend on the current input in MCTX. + This function must be invoked when the matcher changes the start index + of the input, or changes the input string. */ + +static void +internal_function +match_ctx_clean (re_match_context_t *mctx) +{ + Idx st_idx; + for (st_idx = 0; st_idx < mctx->nsub_tops; ++st_idx) + { + Idx sl_idx; + re_sub_match_top_t *top = mctx->sub_tops[st_idx]; + for (sl_idx = 0; sl_idx < top->nlasts; ++sl_idx) + { + re_sub_match_last_t *last = top->lasts[sl_idx]; + re_free (last->path.array); + re_free (last); + } + re_free (top->lasts); + if (top->path) + { + re_free (top->path->array); + re_free (top->path); + } + free (top); + } + + mctx->nsub_tops = 0; + mctx->nbkref_ents = 0; +} + +/* Free all the memory associated with MCTX. */ + +static void +internal_function +match_ctx_free (re_match_context_t *mctx) +{ + /* First, free all the memory associated with MCTX->SUB_TOPS. */ + match_ctx_clean (mctx); + re_free (mctx->sub_tops); + re_free (mctx->bkref_ents); +} + +/* Add a new backreference entry to MCTX. + Note that we assume that caller never call this function with duplicate + entry, and call with STR_IDX which isn't smaller than any existing entry. +*/ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +match_ctx_add_entry (re_match_context_t *mctx, Idx node, Idx str_idx, Idx from, + Idx to) +{ + if (mctx->nbkref_ents >= mctx->abkref_ents) + { + struct re_backref_cache_entry* new_entry; + new_entry = re_realloc (mctx->bkref_ents, struct re_backref_cache_entry, + mctx->abkref_ents * 2); + if (BE (new_entry == NULL, 0)) + { + re_free (mctx->bkref_ents); + return REG_ESPACE; + } + mctx->bkref_ents = new_entry; + memset (mctx->bkref_ents + mctx->nbkref_ents, '\0', + sizeof (struct re_backref_cache_entry) * mctx->abkref_ents); + mctx->abkref_ents *= 2; + } + if (mctx->nbkref_ents > 0 + && mctx->bkref_ents[mctx->nbkref_ents - 1].str_idx == str_idx) + mctx->bkref_ents[mctx->nbkref_ents - 1].more = 1; + + mctx->bkref_ents[mctx->nbkref_ents].node = node; + mctx->bkref_ents[mctx->nbkref_ents].str_idx = str_idx; + mctx->bkref_ents[mctx->nbkref_ents].subexp_from = from; + mctx->bkref_ents[mctx->nbkref_ents].subexp_to = to; + + /* This is a cache that saves negative results of check_dst_limits_calc_pos. + If bit N is clear, means that this entry won't epsilon-transition to + an OP_OPEN_SUBEXP or OP_CLOSE_SUBEXP for the N+1-th subexpression. If + it is set, check_dst_limits_calc_pos_1 will recurse and try to find one + such node. + + A backreference does not epsilon-transition unless it is empty, so set + to all zeros if FROM != TO. */ + mctx->bkref_ents[mctx->nbkref_ents].eps_reachable_subexps_map + = (from == to ? -1 : 0); + + mctx->bkref_ents[mctx->nbkref_ents++].more = 0; + if (mctx->max_mb_elem_len < to - from) + mctx->max_mb_elem_len = to - from; + return REG_NOERROR; +} + +/* Return the first entry with the same str_idx, or -1 if none is + found. Note that MCTX->BKREF_ENTS is already sorted by MCTX->STR_IDX. */ + +static Idx +internal_function +search_cur_bkref_entry (const re_match_context_t *mctx, Idx str_idx) +{ + Idx left, right, mid, last; + last = right = mctx->nbkref_ents; + for (left = 0; left < right;) + { + mid = (left + right) / 2; + if (mctx->bkref_ents[mid].str_idx < str_idx) + left = mid + 1; + else + right = mid; + } + if (left < last && mctx->bkref_ents[left].str_idx == str_idx) + return left; + else + return -1; +} + +/* Register the node NODE, whose type is OP_OPEN_SUBEXP, and which matches + at STR_IDX. */ + +static reg_errcode_t +internal_function __attribute_warn_unused_result__ +match_ctx_add_subtop (re_match_context_t *mctx, Idx node, Idx str_idx) +{ +#ifdef DEBUG + assert (mctx->sub_tops != NULL); + assert (mctx->asub_tops > 0); +#endif + if (BE (mctx->nsub_tops == mctx->asub_tops, 0)) + { + Idx new_asub_tops = mctx->asub_tops * 2; + re_sub_match_top_t **new_array = re_realloc (mctx->sub_tops, + re_sub_match_top_t *, + new_asub_tops); + if (BE (new_array == NULL, 0)) + return REG_ESPACE; + mctx->sub_tops = new_array; + mctx->asub_tops = new_asub_tops; + } + mctx->sub_tops[mctx->nsub_tops] = calloc (1, sizeof (re_sub_match_top_t)); + if (BE (mctx->sub_tops[mctx->nsub_tops] == NULL, 0)) + return REG_ESPACE; + mctx->sub_tops[mctx->nsub_tops]->node = node; + mctx->sub_tops[mctx->nsub_tops++]->str_idx = str_idx; + return REG_NOERROR; +} + +/* Register the node NODE, whose type is OP_CLOSE_SUBEXP, and which matches + at STR_IDX, whose corresponding OP_OPEN_SUBEXP is SUB_TOP. */ + +static re_sub_match_last_t * +internal_function +match_ctx_add_sublast (re_sub_match_top_t *subtop, Idx node, Idx str_idx) +{ + re_sub_match_last_t *new_entry; + if (BE (subtop->nlasts == subtop->alasts, 0)) + { + Idx new_alasts = 2 * subtop->alasts + 1; + re_sub_match_last_t **new_array = re_realloc (subtop->lasts, + re_sub_match_last_t *, + new_alasts); + if (BE (new_array == NULL, 0)) + return NULL; + subtop->lasts = new_array; + subtop->alasts = new_alasts; + } + new_entry = calloc (1, sizeof (re_sub_match_last_t)); + if (BE (new_entry != NULL, 1)) + { + subtop->lasts[subtop->nlasts] = new_entry; + new_entry->node = node; + new_entry->str_idx = str_idx; + ++subtop->nlasts; + } + return new_entry; +} + +static void +internal_function +sift_ctx_init (re_sift_context_t *sctx, re_dfastate_t **sifted_sts, + re_dfastate_t **limited_sts, Idx last_node, Idx last_str_idx) +{ + sctx->sifted_states = sifted_sts; + sctx->limited_states = limited_sts; + sctx->last_node = last_node; + sctx->last_str_idx = last_str_idx; + re_node_set_init_empty (&sctx->limits); +} diff --git a/local/recipes/tools/diffutils/source/lib/secure_getenv.c b/local/recipes/tools/diffutils/source/lib/secure_getenv.c new file mode 100644 index 0000000000..df53dea0b2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/secure_getenv.c @@ -0,0 +1,54 @@ +/* Look up an environment variable, returning NULL in insecure situations. + + Copyright 2013-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <stdlib.h> + +#if !HAVE___SECURE_GETENV +# if HAVE_ISSETUGID || (HAVE_GETUID && HAVE_GETEUID && HAVE_GETGID && HAVE_GETEGID) +# include <unistd.h> +# endif +#endif + +char * +secure_getenv (char const *name) +{ +#if HAVE___SECURE_GETENV /* glibc */ + return __secure_getenv (name); +#elif HAVE_ISSETUGID /* OS X, FreeBSD, NetBSD, OpenBSD */ + if (issetugid ()) + return NULL; + return getenv (name); +#elif HAVE_GETUID && HAVE_GETEUID && HAVE_GETGID && HAVE_GETEGID /* other Unix */ + if (geteuid () != getuid () || getegid () != getgid ()) + return NULL; + return getenv (name); +#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* native Windows */ + /* On native Windows, there is no such concept as setuid or setgid binaries. + - Programs launched as system services have high privileges, but they don't + inherit environment variables from a user. + - Programs launched by a user with "Run as Administrator" have high + privileges and use the environment variables, but the user has been asked + whether he agrees. + - Programs launched by a user without "Run as Administrator" cannot gain + high privileges, therefore there is no risk. */ + return getenv (name); +#else + return NULL; +#endif +} diff --git a/local/recipes/tools/diffutils/source/lib/setenv.c b/local/recipes/tools/diffutils/source/lib/setenv.c new file mode 100644 index 0000000000..edc6a0a200 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/setenv.c @@ -0,0 +1,390 @@ +/* Copyright (C) 1992, 1995-2003, 2005-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#if !_LIBC +/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc + optimizes away the name == NULL test below. */ +# define _GL_ARG_NONNULL(params) + +# define _GL_USE_STDLIB_ALLOC 1 +# include <config.h> +#endif + +#include <alloca.h> + +/* Specification. */ +#include <stdlib.h> + +#include <errno.h> +#ifndef __set_errno +# define __set_errno(ev) ((errno) = (ev)) +#endif + +#include <string.h> +#if _LIBC || HAVE_UNISTD_H +# include <unistd.h> +#endif + +#if !_LIBC +# include "malloca.h" +#endif + +#if _LIBC || !HAVE_SETENV + +#if !_LIBC +# define __environ environ +#endif + +#if _LIBC +/* This lock protects against simultaneous modifications of 'environ'. */ +# include <bits/libc-lock.h> +__libc_lock_define_initialized (static, envlock) +# define LOCK __libc_lock_lock (envlock) +# define UNLOCK __libc_lock_unlock (envlock) +#else +# define LOCK +# define UNLOCK +#endif + +/* In the GNU C library we must keep the namespace clean. */ +#ifdef _LIBC +# define setenv __setenv +# define clearenv __clearenv +# define tfind __tfind +# define tsearch __tsearch +#endif + +/* In the GNU C library implementation we try to be more clever and + allow arbitrarily many changes of the environment given that the used + values are from a small set. Outside glibc this will eat up all + memory after a while. */ +#if defined _LIBC || (defined HAVE_SEARCH_H && defined HAVE_TSEARCH \ + && defined __GNUC__) +# define USE_TSEARCH 1 +# include <search.h> +typedef int (*compar_fn_t) (const void *, const void *); + +/* This is a pointer to the root of the search tree with the known + values. */ +static void *known_values; + +# define KNOWN_VALUE(Str) \ + ({ \ + void *value = tfind (Str, &known_values, (compar_fn_t) strcmp); \ + value != NULL ? *(char **) value : NULL; \ + }) +# define STORE_VALUE(Str) \ + tsearch (Str, &known_values, (compar_fn_t) strcmp) + +#else +# undef USE_TSEARCH + +# define KNOWN_VALUE(Str) NULL +# define STORE_VALUE(Str) do { } while (0) + +#endif + + +/* If this variable is not a null pointer we allocated the current + environment. */ +static char **last_environ; + + +/* This function is used by 'setenv' and 'putenv'. The difference between + the two functions is that for the former must create a new string which + is then placed in the environment, while the argument of 'putenv' + must be used directly. This is all complicated by the fact that we try + to reuse values once generated for a 'setenv' call since we can never + free the strings. */ +int +__add_to_environ (const char *name, const char *value, const char *combined, + int replace) +{ + char **ep; + size_t size; + const size_t namelen = strlen (name); + const size_t vallen = value != NULL ? strlen (value) + 1 : 0; + + LOCK; + + /* We have to get the pointer now that we have the lock and not earlier + since another thread might have created a new environment. */ + ep = __environ; + + size = 0; + if (ep != NULL) + { + for (; *ep != NULL; ++ep) + if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=') + break; + else + ++size; + } + + if (ep == NULL || *ep == NULL) + { + char **new_environ; +#ifdef USE_TSEARCH + char *new_value; +#endif + + /* We allocated this space; we can extend it. */ + new_environ = + (char **) (last_environ == NULL + ? malloc ((size + 2) * sizeof (char *)) + : realloc (last_environ, (size + 2) * sizeof (char *))); + if (new_environ == NULL) + { + /* It's easier to set errno to ENOMEM than to rely on the + 'malloc-posix' and 'realloc-posix' gnulib modules. */ + __set_errno (ENOMEM); + UNLOCK; + return -1; + } + + /* If the whole entry is given add it. */ + if (combined != NULL) + /* We must not add the string to the search tree since it belongs + to the user. */ + new_environ[size] = (char *) combined; + else + { + /* See whether the value is already known. */ +#ifdef USE_TSEARCH +# ifdef _LIBC + new_value = (char *) alloca (namelen + 1 + vallen); + __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1), + value, vallen); +# else + new_value = (char *) malloca (namelen + 1 + vallen); + if (new_value == NULL) + { + __set_errno (ENOMEM); + UNLOCK; + return -1; + } + memcpy (new_value, name, namelen); + new_value[namelen] = '='; + memcpy (&new_value[namelen + 1], value, vallen); +# endif + + new_environ[size] = KNOWN_VALUE (new_value); + if (new_environ[size] == NULL) +#endif + { + new_environ[size] = (char *) malloc (namelen + 1 + vallen); + if (new_environ[size] == NULL) + { +#if defined USE_TSEARCH && !defined _LIBC + freea (new_value); +#endif + __set_errno (ENOMEM); + UNLOCK; + return -1; + } + +#ifdef USE_TSEARCH + memcpy (new_environ[size], new_value, namelen + 1 + vallen); +#else + memcpy (new_environ[size], name, namelen); + new_environ[size][namelen] = '='; + memcpy (&new_environ[size][namelen + 1], value, vallen); +#endif + /* And save the value now. We cannot do this when we remove + the string since then we cannot decide whether it is a + user string or not. */ + STORE_VALUE (new_environ[size]); + } +#if defined USE_TSEARCH && !defined _LIBC + freea (new_value); +#endif + } + + if (__environ != last_environ) + memcpy ((char *) new_environ, (char *) __environ, + size * sizeof (char *)); + + new_environ[size + 1] = NULL; + + last_environ = __environ = new_environ; + } + else if (replace) + { + char *np; + + /* Use the user string if given. */ + if (combined != NULL) + np = (char *) combined; + else + { +#ifdef USE_TSEARCH + char *new_value; +# ifdef _LIBC + new_value = alloca (namelen + 1 + vallen); + __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1), + value, vallen); +# else + new_value = malloca (namelen + 1 + vallen); + if (new_value == NULL) + { + __set_errno (ENOMEM); + UNLOCK; + return -1; + } + memcpy (new_value, name, namelen); + new_value[namelen] = '='; + memcpy (&new_value[namelen + 1], value, vallen); +# endif + + np = KNOWN_VALUE (new_value); + if (np == NULL) +#endif + { + np = (char *) malloc (namelen + 1 + vallen); + if (np == NULL) + { +#if defined USE_TSEARCH && !defined _LIBC + freea (new_value); +#endif + __set_errno (ENOMEM); + UNLOCK; + return -1; + } + +#ifdef USE_TSEARCH + memcpy (np, new_value, namelen + 1 + vallen); +#else + memcpy (np, name, namelen); + np[namelen] = '='; + memcpy (&np[namelen + 1], value, vallen); +#endif + /* And remember the value. */ + STORE_VALUE (np); + } +#if defined USE_TSEARCH && !defined _LIBC + freea (new_value); +#endif + } + + *ep = np; + } + + UNLOCK; + + return 0; +} + +int +setenv (const char *name, const char *value, int replace) +{ + if (name == NULL || *name == '\0' || strchr (name, '=') != NULL) + { + __set_errno (EINVAL); + return -1; + } + + return __add_to_environ (name, value, NULL, replace); +} + +/* The 'clearenv' was planned to be added to POSIX.1 but probably + never made it. Nevertheless the POSIX.9 standard (POSIX bindings + for Fortran 77) requires this function. */ +int +clearenv (void) +{ + LOCK; + + if (__environ == last_environ && __environ != NULL) + { + /* We allocated this environment so we can free it. */ + free (__environ); + last_environ = NULL; + } + + /* Clear the environment pointer removes the whole environment. */ + __environ = NULL; + + UNLOCK; + + return 0; +} + +#ifdef _LIBC +static void +free_mem (void) +{ + /* Remove all traces. */ + clearenv (); + + /* Now remove the search tree. */ + __tdestroy (known_values, free); + known_values = NULL; +} +text_set_element (__libc_subfreeres, free_mem); + + +# undef setenv +# undef clearenv +weak_alias (__setenv, setenv) +weak_alias (__clearenv, clearenv) +#endif + +#endif /* _LIBC || !HAVE_SETENV */ + +/* The rest of this file is called into use when replacing an existing + but buggy setenv. Known bugs include failure to diagnose invalid + name, and consuming a leading '=' from value. */ +#if HAVE_SETENV + +# undef setenv +# if !HAVE_DECL_SETENV +extern int setenv (const char *, const char *, int); +# endif +# define STREQ(a, b) (strcmp (a, b) == 0) + +int +rpl_setenv (const char *name, const char *value, int replace) +{ + int result; + if (!name || !*name || strchr (name, '=')) + { + errno = EINVAL; + return -1; + } + /* Call the real setenv even if replace is 0, in case implementation + has underlying data to update, such as when environ changes. */ + result = setenv (name, value, replace); + if (result == 0 && replace && *value == '=') + { + char *tmp = getenv (name); + if (!STREQ (tmp, value)) + { + int saved_errno; + size_t len = strlen (value); + tmp = malloca (len + 2); + /* Since leading '=' is eaten, double it up. */ + *tmp = '='; + memcpy (tmp + 1, value, len + 1); + result = setenv (name, tmp, replace); + saved_errno = errno; + freea (tmp); + errno = saved_errno; + } + } + return result; +} + +#endif /* HAVE_SETENV */ diff --git a/local/recipes/tools/diffutils/source/lib/sh-quote.c b/local/recipes/tools/diffutils/source/lib/sh-quote.c new file mode 100644 index 0000000000..fe47ad34af --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/sh-quote.c @@ -0,0 +1,107 @@ +/* Shell quoting. + Copyright (C) 2001-2004, 2006, 2009-2017 Free Software Foundation, Inc. + Written by Bruno Haible <haible@clisp.cons.org>, 2001. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "sh-quote.h" + +#include <string.h> + +#include "quotearg.h" +#include "xalloc.h" + +/* Describes quoting for sh compatible shells. */ +static struct quoting_options *sh_quoting_options; + +/* Initializes the sh_quoting_options variable. */ +static void +init_sh_quoting_options (void) +{ + sh_quoting_options = clone_quoting_options (NULL); + set_quoting_style (sh_quoting_options, shell_quoting_style); +} + +/* Returns the number of bytes needed for the quoted string. */ +size_t +shell_quote_length (const char *string) +{ + if (sh_quoting_options == NULL) + init_sh_quoting_options (); + return quotearg_buffer (NULL, 0, string, strlen (string), + sh_quoting_options); +} + +/* Copies the quoted string to p and returns the incremented p. + There must be room for shell_quote_length (string) + 1 bytes at p. */ +char * +shell_quote_copy (char *p, const char *string) +{ + if (sh_quoting_options == NULL) + init_sh_quoting_options (); + return p + quotearg_buffer (p, (size_t)(-1), string, strlen (string), + sh_quoting_options); +} + +/* Returns the freshly allocated quoted string. */ +char * +shell_quote (const char *string) +{ + if (sh_quoting_options == NULL) + init_sh_quoting_options (); + return quotearg_alloc (string, strlen (string), sh_quoting_options); +} + +/* Returns a freshly allocated string containing all argument strings, quoted, + separated through spaces. */ +char * +shell_quote_argv (char * const *argv) +{ + if (*argv != NULL) + { + char * const *argp; + size_t length; + char *command; + char *p; + + length = 0; + for (argp = argv; ; ) + { + length += shell_quote_length (*argp) + 1; + argp++; + if (*argp == NULL) + break; + } + + command = XNMALLOC (length, char); + + p = command; + for (argp = argv; ; ) + { + p = shell_quote_copy (p, *argp); + argp++; + if (*argp == NULL) + break; + *p++ = ' '; + } + *p = '\0'; + + return command; + } + else + return xstrdup (""); +} diff --git a/local/recipes/tools/diffutils/source/lib/sh-quote.h b/local/recipes/tools/diffutils/source/lib/sh-quote.h new file mode 100644 index 0000000000..b7f646193b --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/sh-quote.h @@ -0,0 +1,49 @@ +/* Shell quoting. + Copyright (C) 2001-2002, 2004, 2009-2017 Free Software Foundation, Inc. + Written by Bruno Haible <haible@clisp.cons.org>, 2001. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _SH_QUOTE_H +#define _SH_QUOTE_H + +/* When passing a command to a shell, we must quote the program name and + arguments, since Unix shells interpret characters like " ", "'", "<", ">", + "$", '*', '?' etc. in a special way. */ + +#include <stddef.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* Returns the number of bytes needed for the quoted string. */ +extern size_t shell_quote_length (const char *string); + +/* Copies the quoted string to p and returns the incremented p. + There must be room for shell_quote_length (string) + 1 bytes at p. */ +extern char * shell_quote_copy (char *p, const char *string); + +/* Returns the freshly allocated quoted string. */ +extern char * shell_quote (const char *string); + +/* Returns a freshly allocated string containing all argument strings, quoted, + separated through spaces. */ +extern char * shell_quote_argv (char * const *argv); + +#ifdef __cplusplus +} +#endif + +#endif /* _SH_QUOTE_H */ diff --git a/local/recipes/tools/diffutils/source/lib/sig-handler.c b/local/recipes/tools/diffutils/source/lib/sig-handler.c new file mode 100644 index 0000000000..52c36217e5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/sig-handler.c @@ -0,0 +1,3 @@ +#include <config.h> +#define SIG_HANDLER_INLINE _GL_EXTERN_INLINE +#include "sig-handler.h" diff --git a/local/recipes/tools/diffutils/source/lib/sig-handler.h b/local/recipes/tools/diffutils/source/lib/sig-handler.h new file mode 100644 index 0000000000..b6fd84119e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/sig-handler.h @@ -0,0 +1,54 @@ +/* Convenience declarations when working with <signal.h>. + + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _GL_SIG_HANDLER_H +#define _GL_SIG_HANDLER_H + +#include <signal.h> + +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef SIG_HANDLER_INLINE +# define SIG_HANDLER_INLINE _GL_INLINE +#endif + +/* Convenience type when working with signal handlers. */ +typedef void (*sa_handler_t) (int); + +/* Return the handler of a signal, as a sa_handler_t value regardless + of its true type. The resulting function can be compared to + special values like SIG_IGN but it is not portable to call it. */ +SIG_HANDLER_INLINE sa_handler_t _GL_ATTRIBUTE_PURE +get_handler (struct sigaction const *a) +{ +#ifdef SA_SIGINFO + /* POSIX says that special values like SIG_IGN can only occur when + action.sa_flags does not contain SA_SIGINFO. But in Linux 2.4, + for example, sa_sigaction and sa_handler are aliases and a signal + is ignored if sa_sigaction (after casting) equals SIG_IGN. So + use (and cast) sa_sigaction in that case. */ + if (a->sa_flags & SA_SIGINFO) + return (sa_handler_t) a->sa_sigaction; +#endif + return a->sa_handler; +} + +_GL_INLINE_HEADER_END + +#endif /* _GL_SIG_HANDLER_H */ diff --git a/local/recipes/tools/diffutils/source/lib/sigaction.c b/local/recipes/tools/diffutils/source/lib/sigaction.c new file mode 100644 index 0000000000..380f9fcb91 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/sigaction.c @@ -0,0 +1,204 @@ +/* POSIX compatible signal blocking. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + Written by Eric Blake <ebb9@byu.net>, 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <signal.h> + +#include <errno.h> +#include <stdint.h> +#include <stdlib.h> + +/* This implementation of sigaction is tailored to native Windows behavior: + signal() has SysV semantics (ie. the handler is uninstalled before + it is invoked). This is an inherent data race if an asynchronous + signal is sent twice in a row before we can reinstall our handler, + but there's nothing we can do about it. Meanwhile, sigprocmask() + is not present, and while we can use the gnulib replacement to + provide critical sections, it too suffers from potential data races + in the face of an ill-timed asynchronous signal. And we compound + the situation by reading static storage in a signal handler, which + POSIX warns is not generically async-signal-safe. Oh well. + + Additionally: + - We don't implement SA_NOCLDSTOP or SA_NOCLDWAIT, because SIGCHLD + is not defined. + - We don't implement SA_ONSTACK, because sigaltstack() is not present. + - We ignore SA_RESTART, because blocking native Windows API calls are + not interrupted anyway when an asynchronous signal occurs, and the + MSVCRT runtime never sets errno to EINTR. + - We don't implement SA_SIGINFO because it is impossible to do so + portably. + + POSIX states that an application should not mix signal() and + sigaction(). We support the use of signal() within the gnulib + sigprocmask() substitute, but all other application code linked + with this module should stick with only sigaction(). */ + +/* Check some of our assumptions. */ +#if defined SIGCHLD || defined HAVE_SIGALTSTACK || defined HAVE_SIGINTERRUPT +# error "Revisit the assumptions made in the sigaction module" +#endif + +/* Out-of-range substitutes make a good fallback for uncatchable + signals. */ +#ifndef SIGKILL +# define SIGKILL (-1) +#endif +#ifndef SIGSTOP +# define SIGSTOP (-1) +#endif + +/* On native Windows, as of 2008, the signal SIGABRT_COMPAT is an alias + for the signal SIGABRT. Only one signal handler is stored for both + SIGABRT and SIGABRT_COMPAT. SIGABRT_COMPAT is not a signal of its own. */ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# undef SIGABRT_COMPAT +# define SIGABRT_COMPAT 6 +#endif + +/* A signal handler. */ +typedef void (*handler_t) (int signal); + +/* Set of current actions. If sa_handler for an entry is NULL, then + that signal is not currently handled by the sigaction handler. */ +static struct sigaction volatile action_array[NSIG] /* = 0 */; + +/* Signal handler that is installed for signals. */ +static void +sigaction_handler (int sig) +{ + handler_t handler; + sigset_t mask; + sigset_t oldmask; + int saved_errno = errno; + if (sig < 0 || NSIG <= sig || !action_array[sig].sa_handler) + { + /* Unexpected situation; be careful to avoid recursive abort. */ + if (sig == SIGABRT) + signal (SIGABRT, SIG_DFL); + abort (); + } + + /* Reinstall the signal handler when required; otherwise update the + bookkeeping so that the user's handler may call sigaction and get + accurate results. We know the signal isn't currently blocked, or + we wouldn't be in its handler, therefore we know that we are not + interrupting a sigaction() call. There is a race where any + asynchronous instance of the same signal occurring before we + reinstall the handler will trigger the default handler; oh + well. */ + handler = action_array[sig].sa_handler; + if ((action_array[sig].sa_flags & SA_RESETHAND) == 0) + signal (sig, sigaction_handler); + else + action_array[sig].sa_handler = NULL; + + /* Block appropriate signals. */ + mask = action_array[sig].sa_mask; + if ((action_array[sig].sa_flags & SA_NODEFER) == 0) + sigaddset (&mask, sig); + sigprocmask (SIG_BLOCK, &mask, &oldmask); + + /* Invoke the user's handler, then restore prior mask. */ + errno = saved_errno; + handler (sig); + saved_errno = errno; + sigprocmask (SIG_SETMASK, &oldmask, NULL); + errno = saved_errno; +} + +/* Change and/or query the action that will be taken on delivery of + signal SIG. If not NULL, ACT describes the new behavior. If not + NULL, OACT is set to the prior behavior. Return 0 on success, or + set errno and return -1 on failure. */ +int +sigaction (int sig, const struct sigaction *restrict act, + struct sigaction *restrict oact) +{ + sigset_t mask; + sigset_t oldmask; + int saved_errno; + + if (sig < 0 || NSIG <= sig || sig == SIGKILL || sig == SIGSTOP + || (act && act->sa_handler == SIG_ERR)) + { + errno = EINVAL; + return -1; + } + +#ifdef SIGABRT_COMPAT + if (sig == SIGABRT_COMPAT) + sig = SIGABRT; +#endif + + /* POSIX requires sigaction() to be async-signal-safe. In other + words, if an asynchronous signal can occur while we are anywhere + inside this function, the user's handler could then call + sigaction() recursively and expect consistent results. We meet + this rule by using sigprocmask to block all signals before + modifying any data structure that could be read from a signal + handler; this works since we know that the gnulib sigprocmask + replacement does not try to use sigaction() from its handler. */ + if (!act && !oact) + return 0; + sigfillset (&mask); + sigprocmask (SIG_BLOCK, &mask, &oldmask); + if (oact) + { + if (action_array[sig].sa_handler) + *oact = action_array[sig]; + else + { + /* Safe to change the handler at will here, since all + signals are currently blocked. */ + oact->sa_handler = signal (sig, SIG_DFL); + if (oact->sa_handler == SIG_ERR) + goto failure; + signal (sig, oact->sa_handler); + oact->sa_flags = SA_RESETHAND | SA_NODEFER; + sigemptyset (&oact->sa_mask); + } + } + + if (act) + { + /* Safe to install the handler before updating action_array, + since all signals are currently blocked. */ + if (act->sa_handler == SIG_DFL || act->sa_handler == SIG_IGN) + { + if (signal (sig, act->sa_handler) == SIG_ERR) + goto failure; + action_array[sig].sa_handler = NULL; + } + else + { + if (signal (sig, sigaction_handler) == SIG_ERR) + goto failure; + action_array[sig] = *act; + } + } + sigprocmask (SIG_SETMASK, &oldmask, NULL); + return 0; + + failure: + saved_errno = errno; + sigprocmask (SIG_SETMASK, &oldmask, NULL); + errno = saved_errno; + return -1; +} diff --git a/local/recipes/tools/diffutils/source/lib/signal.in.h b/local/recipes/tools/diffutils/source/lib/signal.in.h new file mode 100644 index 0000000000..1ffba37e23 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/signal.in.h @@ -0,0 +1,463 @@ +/* A GNU-like <signal.h>. + + Copyright (C) 2006-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#if defined __need_sig_atomic_t || defined __need_sigset_t || defined _GL_ALREADY_INCLUDING_SIGNAL_H || (defined _SIGNAL_H && !defined __SIZEOF_PTHREAD_MUTEX_T) +/* Special invocation convention: + - Inside glibc header files. + - On glibc systems we have a sequence of nested includes + <signal.h> -> <ucontext.h> -> <signal.h>. + In this situation, the functions are not yet declared, therefore we cannot + provide the C++ aliases. + - On glibc systems with GCC 4.3 we have a sequence of nested includes + <csignal> -> </usr/include/signal.h> -> <sys/ucontext.h> -> <signal.h>. + In this situation, some of the functions are not yet declared, therefore + we cannot provide the C++ aliases. */ + +# @INCLUDE_NEXT@ @NEXT_SIGNAL_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_SIGNAL_H + +#define _GL_ALREADY_INCLUDING_SIGNAL_H + +/* Define pid_t, uid_t. + Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. + On Solaris 10, <signal.h> includes <sys/types.h>, which eventually includes + us; so include <sys/types.h> now, before the second inclusion guard. */ +#include <sys/types.h> + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_SIGNAL_H@ + +#undef _GL_ALREADY_INCLUDING_SIGNAL_H + +#ifndef _@GUARD_PREFIX@_SIGNAL_H +#define _@GUARD_PREFIX@_SIGNAL_H + +/* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6, Android + declare pthread_sigmask in <pthread.h>, not in <signal.h>. + But avoid namespace pollution on glibc systems.*/ +#if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \ + && ((defined __APPLE__ && defined __MACH__) \ + || defined __FreeBSD__ || defined __OpenBSD__ || defined __osf__ \ + || defined __sun || defined __ANDROID__) \ + && ! defined __GLIBC__ +# include <pthread.h> +#endif + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +/* On AIX, sig_atomic_t already includes volatile. C99 requires that + 'volatile sig_atomic_t' ignore the extra modifier, but C89 did not. + Hence, redefine this to a non-volatile type as needed. */ +#if ! @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ +# if !GNULIB_defined_sig_atomic_t +typedef int rpl_sig_atomic_t; +# undef sig_atomic_t +# define sig_atomic_t rpl_sig_atomic_t +# define GNULIB_defined_sig_atomic_t 1 +# endif +#endif + +/* A set or mask of signals. */ +#if !@HAVE_SIGSET_T@ +# if !GNULIB_defined_sigset_t +typedef unsigned int sigset_t; +# define GNULIB_defined_sigset_t 1 +# endif +#endif + +/* Define sighandler_t, the type of signal handlers. A GNU extension. */ +#if !@HAVE_SIGHANDLER_T@ +# ifdef __cplusplus +extern "C" { +# endif +# if !GNULIB_defined_sighandler_t +typedef void (*sighandler_t) (int); +# define GNULIB_defined_sighandler_t 1 +# endif +# ifdef __cplusplus +} +# endif +#endif + + +#if @GNULIB_SIGNAL_H_SIGPIPE@ +# ifndef SIGPIPE +/* Define SIGPIPE to a value that does not overlap with other signals. */ +# define SIGPIPE 13 +# define GNULIB_defined_SIGPIPE 1 +/* To actually use SIGPIPE, you also need the gnulib modules 'sigprocmask', + 'write', 'stdio'. */ +# endif +#endif + + +/* Maximum signal number + 1. */ +#ifndef NSIG +# if defined __TANDEM +# define NSIG 32 +# endif +#endif + + +#if @GNULIB_PTHREAD_SIGMASK@ +# if @REPLACE_PTHREAD_SIGMASK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_sigmask +# define pthread_sigmask rpl_pthread_sigmask +# endif +_GL_FUNCDECL_RPL (pthread_sigmask, int, + (int how, const sigset_t *new_mask, sigset_t *old_mask)); +_GL_CXXALIAS_RPL (pthread_sigmask, int, + (int how, const sigset_t *new_mask, sigset_t *old_mask)); +# else +# if !@HAVE_PTHREAD_SIGMASK@ +_GL_FUNCDECL_SYS (pthread_sigmask, int, + (int how, const sigset_t *new_mask, sigset_t *old_mask)); +# endif +_GL_CXXALIAS_SYS (pthread_sigmask, int, + (int how, const sigset_t *new_mask, sigset_t *old_mask)); +# endif +_GL_CXXALIASWARN (pthread_sigmask); +#elif defined GNULIB_POSIXCHECK +# undef pthread_sigmask +# if HAVE_RAW_DECL_PTHREAD_SIGMASK +_GL_WARN_ON_USE (pthread_sigmask, "pthread_sigmask is not portable - " + "use gnulib module pthread_sigmask for portability"); +# endif +#endif + + +#if @GNULIB_RAISE@ +# if @REPLACE_RAISE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef raise +# define raise rpl_raise +# endif +_GL_FUNCDECL_RPL (raise, int, (int sig)); +_GL_CXXALIAS_RPL (raise, int, (int sig)); +# else +# if !@HAVE_RAISE@ +_GL_FUNCDECL_SYS (raise, int, (int sig)); +# endif +_GL_CXXALIAS_SYS (raise, int, (int sig)); +# endif +_GL_CXXALIASWARN (raise); +#elif defined GNULIB_POSIXCHECK +# undef raise +/* Assume raise is always declared. */ +_GL_WARN_ON_USE (raise, "raise can crash on native Windows - " + "use gnulib module raise for portability"); +#endif + + +#if @GNULIB_SIGPROCMASK@ +# if !@HAVE_POSIX_SIGNALBLOCKING@ + +# ifndef GNULIB_defined_signal_blocking +# define GNULIB_defined_signal_blocking 1 +# endif + +/* Maximum signal number + 1. */ +# ifndef NSIG +# define NSIG 32 +# endif + +/* This code supports only 32 signals. */ +# if !GNULIB_defined_verify_NSIG_constraint +typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1]; +# define GNULIB_defined_verify_NSIG_constraint 1 +# endif + +# endif + +/* When also using extern inline, suppress the use of static inline in + standard headers of problematic Apple configurations, as Libc at + least through Libc-825.26 (2013-04-09) mishandles it; see, e.g., + <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>. + Perhaps Apple will fix this some day. */ +#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \ + && (defined __i386__ || defined __x86_64__)) +# undef sigaddset +# undef sigdelset +# undef sigemptyset +# undef sigfillset +# undef sigismember +#endif + +/* Test whether a given signal is contained in a signal set. */ +# if @HAVE_POSIX_SIGNALBLOCKING@ +/* This function is defined as a macro on Mac OS X. */ +# if defined __cplusplus && defined GNULIB_NAMESPACE +# undef sigismember +# endif +# else +_GL_FUNCDECL_SYS (sigismember, int, (const sigset_t *set, int sig) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (sigismember, int, (const sigset_t *set, int sig)); +_GL_CXXALIASWARN (sigismember); + +/* Initialize a signal set to the empty set. */ +# if @HAVE_POSIX_SIGNALBLOCKING@ +/* This function is defined as a macro on Mac OS X. */ +# if defined __cplusplus && defined GNULIB_NAMESPACE +# undef sigemptyset +# endif +# else +_GL_FUNCDECL_SYS (sigemptyset, int, (sigset_t *set) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (sigemptyset, int, (sigset_t *set)); +_GL_CXXALIASWARN (sigemptyset); + +/* Add a signal to a signal set. */ +# if @HAVE_POSIX_SIGNALBLOCKING@ +/* This function is defined as a macro on Mac OS X. */ +# if defined __cplusplus && defined GNULIB_NAMESPACE +# undef sigaddset +# endif +# else +_GL_FUNCDECL_SYS (sigaddset, int, (sigset_t *set, int sig) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (sigaddset, int, (sigset_t *set, int sig)); +_GL_CXXALIASWARN (sigaddset); + +/* Remove a signal from a signal set. */ +# if @HAVE_POSIX_SIGNALBLOCKING@ +/* This function is defined as a macro on Mac OS X. */ +# if defined __cplusplus && defined GNULIB_NAMESPACE +# undef sigdelset +# endif +# else +_GL_FUNCDECL_SYS (sigdelset, int, (sigset_t *set, int sig) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (sigdelset, int, (sigset_t *set, int sig)); +_GL_CXXALIASWARN (sigdelset); + +/* Fill a signal set with all possible signals. */ +# if @HAVE_POSIX_SIGNALBLOCKING@ +/* This function is defined as a macro on Mac OS X. */ +# if defined __cplusplus && defined GNULIB_NAMESPACE +# undef sigfillset +# endif +# else +_GL_FUNCDECL_SYS (sigfillset, int, (sigset_t *set) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (sigfillset, int, (sigset_t *set)); +_GL_CXXALIASWARN (sigfillset); + +/* Return the set of those blocked signals that are pending. */ +# if !@HAVE_POSIX_SIGNALBLOCKING@ +_GL_FUNCDECL_SYS (sigpending, int, (sigset_t *set) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (sigpending, int, (sigset_t *set)); +_GL_CXXALIASWARN (sigpending); + +/* If OLD_SET is not NULL, put the current set of blocked signals in *OLD_SET. + Then, if SET is not NULL, affect the current set of blocked signals by + combining it with *SET as indicated in OPERATION. + In this implementation, you are not allowed to change a signal handler + while the signal is blocked. */ +# if !@HAVE_POSIX_SIGNALBLOCKING@ +# define SIG_BLOCK 0 /* blocked_set = blocked_set | *set; */ +# define SIG_SETMASK 1 /* blocked_set = *set; */ +# define SIG_UNBLOCK 2 /* blocked_set = blocked_set & ~*set; */ +_GL_FUNCDECL_SYS (sigprocmask, int, + (int operation, const sigset_t *set, sigset_t *old_set)); +# endif +_GL_CXXALIAS_SYS (sigprocmask, int, + (int operation, const sigset_t *set, sigset_t *old_set)); +_GL_CXXALIASWARN (sigprocmask); + +/* Install the handler FUNC for signal SIG, and return the previous + handler. */ +# ifdef __cplusplus +extern "C" { +# endif +# if !GNULIB_defined_function_taking_int_returning_void_t +typedef void (*_gl_function_taking_int_returning_void_t) (int); +# define GNULIB_defined_function_taking_int_returning_void_t 1 +# endif +# ifdef __cplusplus +} +# endif +# if !@HAVE_POSIX_SIGNALBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define signal rpl_signal +# endif +_GL_FUNCDECL_RPL (signal, _gl_function_taking_int_returning_void_t, + (int sig, _gl_function_taking_int_returning_void_t func)); +_GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t, + (int sig, _gl_function_taking_int_returning_void_t func)); +# else +_GL_CXXALIAS_SYS (signal, _gl_function_taking_int_returning_void_t, + (int sig, _gl_function_taking_int_returning_void_t func)); +# endif +_GL_CXXALIASWARN (signal); + +# if !@HAVE_POSIX_SIGNALBLOCKING@ && GNULIB_defined_SIGPIPE +/* Raise signal SIGPIPE. */ +_GL_EXTERN_C int _gl_raise_SIGPIPE (void); +# endif + +#elif defined GNULIB_POSIXCHECK +# undef sigaddset +# if HAVE_RAW_DECL_SIGADDSET +_GL_WARN_ON_USE (sigaddset, "sigaddset is unportable - " + "use the gnulib module sigprocmask for portability"); +# endif +# undef sigdelset +# if HAVE_RAW_DECL_SIGDELSET +_GL_WARN_ON_USE (sigdelset, "sigdelset is unportable - " + "use the gnulib module sigprocmask for portability"); +# endif +# undef sigemptyset +# if HAVE_RAW_DECL_SIGEMPTYSET +_GL_WARN_ON_USE (sigemptyset, "sigemptyset is unportable - " + "use the gnulib module sigprocmask for portability"); +# endif +# undef sigfillset +# if HAVE_RAW_DECL_SIGFILLSET +_GL_WARN_ON_USE (sigfillset, "sigfillset is unportable - " + "use the gnulib module sigprocmask for portability"); +# endif +# undef sigismember +# if HAVE_RAW_DECL_SIGISMEMBER +_GL_WARN_ON_USE (sigismember, "sigismember is unportable - " + "use the gnulib module sigprocmask for portability"); +# endif +# undef sigpending +# if HAVE_RAW_DECL_SIGPENDING +_GL_WARN_ON_USE (sigpending, "sigpending is unportable - " + "use the gnulib module sigprocmask for portability"); +# endif +# undef sigprocmask +# if HAVE_RAW_DECL_SIGPROCMASK +_GL_WARN_ON_USE (sigprocmask, "sigprocmask is unportable - " + "use the gnulib module sigprocmask for portability"); +# endif +#endif /* @GNULIB_SIGPROCMASK@ */ + + +#if @GNULIB_SIGACTION@ +# if !@HAVE_SIGACTION@ + +# if !@HAVE_SIGINFO_T@ + +# if !GNULIB_defined_siginfo_types + +/* Present to allow compilation, but unsupported by gnulib. */ +union sigval +{ + int sival_int; + void *sival_ptr; +}; + +/* Present to allow compilation, but unsupported by gnulib. */ +struct siginfo_t +{ + int si_signo; + int si_code; + int si_errno; + pid_t si_pid; + uid_t si_uid; + void *si_addr; + int si_status; + long si_band; + union sigval si_value; +}; +typedef struct siginfo_t siginfo_t; + +# define GNULIB_defined_siginfo_types 1 +# endif + +# endif /* !@HAVE_SIGINFO_T@ */ + +/* We assume that platforms which lack the sigaction() function also lack + the 'struct sigaction' type, and vice versa. */ + +# if !GNULIB_defined_struct_sigaction + +struct sigaction +{ + union + { + void (*_sa_handler) (int); + /* Present to allow compilation, but unsupported by gnulib. POSIX + says that implementations may, but not must, make sa_sigaction + overlap with sa_handler, but we know of no implementation where + they do not overlap. */ + void (*_sa_sigaction) (int, siginfo_t *, void *); + } _sa_func; + sigset_t sa_mask; + /* Not all POSIX flags are supported. */ + int sa_flags; +}; +# define sa_handler _sa_func._sa_handler +# define sa_sigaction _sa_func._sa_sigaction +/* Unsupported flags are not present. */ +# define SA_RESETHAND 1 +# define SA_NODEFER 2 +# define SA_RESTART 4 + +# define GNULIB_defined_struct_sigaction 1 +# endif + +_GL_FUNCDECL_SYS (sigaction, int, (int, const struct sigaction *restrict, + struct sigaction *restrict)); + +# elif !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ + +# define sa_sigaction sa_handler + +# endif /* !@HAVE_SIGACTION@, !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ */ + +_GL_CXXALIAS_SYS (sigaction, int, (int, const struct sigaction *restrict, + struct sigaction *restrict)); +_GL_CXXALIASWARN (sigaction); + +#elif defined GNULIB_POSIXCHECK +# undef sigaction +# if HAVE_RAW_DECL_SIGACTION +_GL_WARN_ON_USE (sigaction, "sigaction is unportable - " + "use the gnulib module sigaction for portability"); +# endif +#endif + +/* Some systems don't have SA_NODEFER. */ +#ifndef SA_NODEFER +# define SA_NODEFER 0 +#endif + + +#endif /* _@GUARD_PREFIX@_SIGNAL_H */ +#endif /* _@GUARD_PREFIX@_SIGNAL_H */ +#endif diff --git a/local/recipes/tools/diffutils/source/lib/sigprocmask.c b/local/recipes/tools/diffutils/source/lib/sigprocmask.c new file mode 100644 index 0000000000..0e31302704 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/sigprocmask.c @@ -0,0 +1,351 @@ +/* POSIX compatible signal blocking. + Copyright (C) 2006-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2006. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <signal.h> + +#include <errno.h> +#include <stdint.h> +#include <stdlib.h> + +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER +# include "msvc-inval.h" +#endif + +/* We assume that a platform without POSIX signal blocking functions + also does not have the POSIX sigaction() function, only the + signal() function. We also assume signal() has SysV semantics, + where any handler is uninstalled prior to being invoked. This is + true for native Windows platforms. */ + +/* We use raw signal(), but also provide a wrapper rpl_signal() so + that applications can query or change a blocked signal. */ +#undef signal + +/* Provide invalid signal numbers as fallbacks if the uncatchable + signals are not defined. */ +#ifndef SIGKILL +# define SIGKILL (-1) +#endif +#ifndef SIGSTOP +# define SIGSTOP (-1) +#endif + +/* On native Windows, as of 2008, the signal SIGABRT_COMPAT is an alias + for the signal SIGABRT. Only one signal handler is stored for both + SIGABRT and SIGABRT_COMPAT. SIGABRT_COMPAT is not a signal of its own. */ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# undef SIGABRT_COMPAT +# define SIGABRT_COMPAT 6 +#endif +#ifdef SIGABRT_COMPAT +# define SIGABRT_COMPAT_MASK (1U << SIGABRT_COMPAT) +#else +# define SIGABRT_COMPAT_MASK 0 +#endif + +typedef void (*handler_t) (int); + +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER +static handler_t +signal_nothrow (int sig, handler_t handler) +{ + handler_t result; + + TRY_MSVC_INVAL + { + result = signal (sig, handler); + } + CATCH_MSVC_INVAL + { + result = SIG_ERR; + errno = EINVAL; + } + DONE_MSVC_INVAL; + + return result; +} +# define signal signal_nothrow +#endif + +/* Handling of gnulib defined signals. */ + +#if GNULIB_defined_SIGPIPE +static handler_t SIGPIPE_handler = SIG_DFL; +#endif + +#if GNULIB_defined_SIGPIPE +static handler_t +ext_signal (int sig, handler_t handler) +{ + switch (sig) + { + case SIGPIPE: + { + handler_t old_handler = SIGPIPE_handler; + SIGPIPE_handler = handler; + return old_handler; + } + default: /* System defined signal */ + return signal (sig, handler); + } +} +# undef signal +# define signal ext_signal +#endif + +int +sigismember (const sigset_t *set, int sig) +{ + if (sig >= 0 && sig < NSIG) + { + #ifdef SIGABRT_COMPAT + if (sig == SIGABRT_COMPAT) + sig = SIGABRT; + #endif + + return (*set >> sig) & 1; + } + else + return 0; +} + +#if !defined(__redox__) +int +sigemptyset (sigset_t *set) +{ + *set = 0; + return 0; +} + +int +sigaddset (sigset_t *set, int sig) +{ + if (sig >= 0 && sig < NSIG) + { + #ifdef SIGABRT_COMPAT + if (sig == SIGABRT_COMPAT) + sig = SIGABRT; + #endif + + *set |= 1U << sig; + return 0; + } + else + { + errno = EINVAL; + return -1; + } +} + +int +sigdelset (sigset_t *set, int sig) +{ + if (sig >= 0 && sig < NSIG) + { + #ifdef SIGABRT_COMPAT + if (sig == SIGABRT_COMPAT) + sig = SIGABRT; + #endif + + *set &= ~(1U << sig); + return 0; + } + else + { + errno = EINVAL; + return -1; + } +} + + +int +sigfillset (sigset_t *set) +{ + *set = ((2U << (NSIG - 1)) - 1) & ~ SIGABRT_COMPAT_MASK; + return 0; +} +#endif + +/* Set of currently blocked signals. */ +static volatile sigset_t blocked_set /* = 0 */; + +/* Set of currently blocked and pending signals. */ +static volatile sig_atomic_t pending_array[NSIG] /* = { 0 } */; + +/* Signal handler that is installed for blocked signals. */ +static void +blocked_handler (int sig) +{ + /* Reinstall the handler, in case the signal occurs multiple times + while blocked. There is an inherent race where an asynchronous + signal in between when the kernel uninstalled the handler and + when we reinstall it will trigger the default handler; oh + well. */ + signal (sig, blocked_handler); + if (sig >= 0 && sig < NSIG) + pending_array[sig] = 1; +} + +int +sigpending (sigset_t *set) +{ + sigset_t pending = 0; + int sig; + + for (sig = 0; sig < NSIG; sig++) + if (pending_array[sig]) + pending |= 1U << sig; + *set = pending; + return 0; +} + +/* The previous signal handlers. + Only the array elements corresponding to blocked signals are relevant. */ +static volatile handler_t old_handlers[NSIG]; + +int +sigprocmask (int operation, const sigset_t *set, sigset_t *old_set) +{ + if (old_set != NULL) + *old_set = blocked_set; + + if (set != NULL) + { + sigset_t new_blocked_set; + sigset_t to_unblock; + sigset_t to_block; + + switch (operation) + { + case SIG_BLOCK: + new_blocked_set = blocked_set | *set; + break; + case SIG_SETMASK: + new_blocked_set = *set; + break; + case SIG_UNBLOCK: + new_blocked_set = blocked_set & ~*set; + break; + default: + errno = EINVAL; + return -1; + } + to_unblock = blocked_set & ~new_blocked_set; + to_block = new_blocked_set & ~blocked_set; + + if (to_block != 0) + { + int sig; + + for (sig = 0; sig < NSIG; sig++) + if ((to_block >> sig) & 1) + { + pending_array[sig] = 0; + if ((old_handlers[sig] = signal (sig, blocked_handler)) != SIG_ERR) + blocked_set |= 1U << sig; + } + } + + if (to_unblock != 0) + { + sig_atomic_t received[NSIG]; + int sig; + + for (sig = 0; sig < NSIG; sig++) + if ((to_unblock >> sig) & 1) + { + if (signal (sig, old_handlers[sig]) != blocked_handler) + /* The application changed a signal handler while the signal + was blocked, bypassing our rpl_signal replacement. + We don't support this. */ + abort (); + received[sig] = pending_array[sig]; + blocked_set &= ~(1U << sig); + pending_array[sig] = 0; + } + else + received[sig] = 0; + + for (sig = 0; sig < NSIG; sig++) + if (received[sig]) + raise (sig); + } + } + return 0; +} + +/* Install the handler FUNC for signal SIG, and return the previous + handler. */ +handler_t +rpl_signal (int sig, handler_t handler) +{ + /* We must provide a wrapper, so that a user can query what handler + they installed even if that signal is currently blocked. */ + if (sig >= 0 && sig < NSIG && sig != SIGKILL && sig != SIGSTOP + && handler != SIG_ERR) + { + #ifdef SIGABRT_COMPAT + if (sig == SIGABRT_COMPAT) + sig = SIGABRT; + #endif + + if (blocked_set & (1U << sig)) + { + /* POSIX states that sigprocmask and signal are both + async-signal-safe. This is not true of our + implementation - there is a slight data race where an + asynchronous interrupt on signal A can occur after we + install blocked_handler but before we have updated + old_handlers for signal B, such that handler A can see + stale information if it calls signal(B). Oh well - + signal handlers really shouldn't try to manipulate the + installed handlers of unrelated signals. */ + handler_t result = old_handlers[sig]; + old_handlers[sig] = handler; + return result; + } + else + return signal (sig, handler); + } + else + { + errno = EINVAL; + return SIG_ERR; + } +} + +#if GNULIB_defined_SIGPIPE +/* Raise the signal SIGPIPE. */ +int +_gl_raise_SIGPIPE (void) +{ + if (blocked_set & (1U << SIGPIPE)) + pending_array[SIGPIPE] = 1; + else + { + handler_t handler = SIGPIPE_handler; + if (handler == SIG_DFL) + exit (128 + SIGPIPE); + else if (handler != SIG_IGN) + (*handler) (SIGPIPE); + } + return 0; +} +#endif diff --git a/local/recipes/tools/diffutils/source/lib/size_max.h b/local/recipes/tools/diffutils/source/lib/size_max.h new file mode 100644 index 0000000000..f0c00b47be --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/size_max.h @@ -0,0 +1,30 @@ +/* size_max.h -- declare SIZE_MAX through system headers + Copyright (C) 2005-2006, 2009-2017 Free Software Foundation, Inc. + Written by Simon Josefsson. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef GNULIB_SIZE_MAX_H +#define GNULIB_SIZE_MAX_H + +/* Get SIZE_MAX declaration on systems like Solaris 7/8/9. */ +# include <limits.h> +/* Get SIZE_MAX declaration on systems like glibc 2. */ +# if HAVE_STDINT_H +# include <stdint.h> +# endif +/* On systems where these include files don't define it, SIZE_MAX is defined + in config.h. */ + +#endif /* GNULIB_SIZE_MAX_H */ diff --git a/local/recipes/tools/diffutils/source/lib/stat-macros.h b/local/recipes/tools/diffutils/source/lib/stat-macros.h new file mode 100644 index 0000000000..690216c74e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/stat-macros.h @@ -0,0 +1,3 @@ +/* All the mode bits that can be affected by chmod. */ +#define CHMOD_MODE_BITS \ + (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO) diff --git a/local/recipes/tools/diffutils/source/lib/stat-time.c b/local/recipes/tools/diffutils/source/lib/stat-time.c new file mode 100644 index 0000000000..81b83ddb4f --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/stat-time.c @@ -0,0 +1,3 @@ +#include <config.h> +#define _GL_STAT_TIME_INLINE _GL_EXTERN_INLINE +#include "stat-time.h" diff --git a/local/recipes/tools/diffutils/source/lib/stat-time.h b/local/recipes/tools/diffutils/source/lib/stat-time.h new file mode 100644 index 0000000000..9e45e85565 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/stat-time.h @@ -0,0 +1,211 @@ +/* stat-related time functions. + + Copyright (C) 2005, 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +#ifndef STAT_TIME_H +#define STAT_TIME_H 1 + +#include <sys/stat.h> +#include <time.h> + +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef _GL_STAT_TIME_INLINE +# define _GL_STAT_TIME_INLINE _GL_INLINE +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type + struct timespec, if available. If not, then STAT_TIMESPEC_NS (ST, + ST_XTIM) is the nanosecond component of the ST_XTIM member for *ST, + if available. ST_XTIM can be st_atim, st_ctim, st_mtim, or st_birthtim + for access, status change, data modification, or birth (creation) + time respectively. + + These macros are private to stat-time.h. */ +#if _GL_WINDOWS_STAT_TIMESPEC || defined HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC +# if _GL_WINDOWS_STAT_TIMESPEC || defined TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC +# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) +# else +# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim.tv_nsec) +# endif +#elif defined HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC +# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim##espec) +#elif defined HAVE_STRUCT_STAT_ST_ATIMENSEC +# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim##ensec) +#elif defined HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC +# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim.st__tim.tv_nsec) +#endif + +/* Return the nanosecond component of *ST's access time. */ +_GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE +get_stat_atime_ns (struct stat const *st) +{ +# if defined STAT_TIMESPEC + return STAT_TIMESPEC (st, st_atim).tv_nsec; +# elif defined STAT_TIMESPEC_NS + return STAT_TIMESPEC_NS (st, st_atim); +# else + return 0; +# endif +} + +/* Return the nanosecond component of *ST's status change time. */ +_GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE +get_stat_ctime_ns (struct stat const *st) +{ +# if defined STAT_TIMESPEC + return STAT_TIMESPEC (st, st_ctim).tv_nsec; +# elif defined STAT_TIMESPEC_NS + return STAT_TIMESPEC_NS (st, st_ctim); +# else + return 0; +# endif +} + +/* Return the nanosecond component of *ST's data modification time. */ +_GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE +get_stat_mtime_ns (struct stat const *st) +{ +# if defined STAT_TIMESPEC + return STAT_TIMESPEC (st, st_mtim).tv_nsec; +# elif defined STAT_TIMESPEC_NS + return STAT_TIMESPEC_NS (st, st_mtim); +# else + return 0; +# endif +} + +/* Return the nanosecond component of *ST's birth time. */ +_GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE +get_stat_birthtime_ns (struct stat const *st) +{ +# if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC + return STAT_TIMESPEC (st, st_birthtim).tv_nsec; +# elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC + return STAT_TIMESPEC_NS (st, st_birthtim); +# else + /* Avoid a "parameter unused" warning. */ + (void) st; + return 0; +# endif +} + +/* Return *ST's access time. */ +_GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE +get_stat_atime (struct stat const *st) +{ +#ifdef STAT_TIMESPEC + return STAT_TIMESPEC (st, st_atim); +#else + struct timespec t; + t.tv_sec = st->st_atime; + t.tv_nsec = get_stat_atime_ns (st); + return t; +#endif +} + +/* Return *ST's status change time. */ +_GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE +get_stat_ctime (struct stat const *st) +{ +#ifdef STAT_TIMESPEC + return STAT_TIMESPEC (st, st_ctim); +#else + struct timespec t; + t.tv_sec = st->st_ctime; + t.tv_nsec = get_stat_ctime_ns (st); + return t; +#endif +} + +/* Return *ST's data modification time. */ +_GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE +get_stat_mtime (struct stat const *st) +{ +#ifdef STAT_TIMESPEC + return STAT_TIMESPEC (st, st_mtim); +#else + struct timespec t; + t.tv_sec = st->st_mtime; + t.tv_nsec = get_stat_mtime_ns (st); + return t; +#endif +} + +/* Return *ST's birth time, if available; otherwise return a value + with tv_sec and tv_nsec both equal to -1. */ +_GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE +get_stat_birthtime (struct stat const *st) +{ + struct timespec t; + +#if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \ + || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC) + t = STAT_TIMESPEC (st, st_birthtim); +#elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC + t.tv_sec = st->st_birthtime; + t.tv_nsec = st->st_birthtimensec; +#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* Native Windows platforms (but not Cygwin) put the "file creation + time" in st_ctime (!). See + <https://msdn.microsoft.com/en-us/library/14h5k7ff(VS.80).aspx>. */ +# if _GL_WINDOWS_STAT_TIMESPEC + t = st->st_ctim; +# else + t.tv_sec = st->st_ctime; + t.tv_nsec = 0; +# endif +#else + /* Birth time is not supported. */ + t.tv_sec = -1; + t.tv_nsec = -1; + /* Avoid a "parameter unused" warning. */ + (void) st; +#endif + +#if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \ + || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC \ + || defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC) + /* FreeBSD and NetBSD sometimes signal the absence of knowledge by + using zero. Attempt to work around this problem. Alas, this can + report failure even for valid timestamps. Also, NetBSD + sometimes returns junk in the birth time fields; work around this + bug if it is detected. */ + if (! (t.tv_sec && 0 <= t.tv_nsec && t.tv_nsec < 1000000000)) + { + t.tv_sec = -1; + t.tv_nsec = -1; + } +#endif + + return t; +} + +#ifdef __cplusplus +} +#endif + +_GL_INLINE_HEADER_END + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/stat-w32.c b/local/recipes/tools/diffutils/source/lib/stat-w32.c new file mode 100644 index 0000000000..b4c762c315 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/stat-w32.c @@ -0,0 +1,415 @@ +/* Core of implementation of fstat and stat for native Windows. + Copyright (C) 2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible. */ + +#include <config.h> + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +/* Ensure that <windows.h> defines FILE_ID_INFO. */ +#undef _WIN32_WINNT +#define _WIN32_WINNT _WIN32_WINNT_WIN8 + +#include <sys/types.h> +#include <sys/stat.h> +#include <errno.h> +#include <limits.h> +#include <string.h> +#include <unistd.h> +#include <windows.h> + +/* Specification. */ +#include "stat-w32.h" + +#include "pathmax.h" +#include "verify.h" + +#if _GL_WINDOWS_STAT_INODES == 2 +/* GetFileInformationByHandleEx was introduced only in Windows Vista. */ +typedef DWORD (WINAPI * GetFileInformationByHandleExFuncType) (HANDLE hFile, + FILE_INFO_BY_HANDLE_CLASS fiClass, + LPVOID lpBuffer, + DWORD dwBufferSize); +static GetFileInformationByHandleExFuncType GetFileInformationByHandleExFunc = NULL; +#endif +/* GetFinalPathNameByHandle was introduced only in Windows Vista. */ +typedef DWORD (WINAPI * GetFinalPathNameByHandleFuncType) (HANDLE hFile, + LPTSTR lpFilePath, + DWORD lenFilePath, + DWORD dwFlags); +static GetFinalPathNameByHandleFuncType GetFinalPathNameByHandleFunc = NULL; +static BOOL initialized = FALSE; + +static void +initialize (void) +{ + HMODULE kernel32 = LoadLibrary ("kernel32.dll"); + if (kernel32 != NULL) + { +#if _GL_WINDOWS_STAT_INODES == 2 + GetFileInformationByHandleExFunc = + (GetFileInformationByHandleExFuncType) GetProcAddress (kernel32, "GetFileInformationByHandleEx"); +#endif + GetFinalPathNameByHandleFunc = + (GetFinalPathNameByHandleFuncType) GetProcAddress (kernel32, "GetFinalPathNameByHandleA"); + } + initialized = TRUE; +} + +/* Converts a FILETIME to GMT time since 1970-01-01 00:00:00. */ +#if _GL_WINDOWS_STAT_TIMESPEC +struct timespec +_gl_convert_FILETIME_to_timespec (const FILETIME *ft) +{ + struct timespec result; + /* FILETIME: <https://msdn.microsoft.com/en-us/library/ms724284.aspx> */ + unsigned long long since_1601 = + ((unsigned long long) ft->dwHighDateTime << 32) + | (unsigned long long) ft->dwLowDateTime; + if (since_1601 == 0) + { + result.tv_sec = 0; + result.tv_nsec = 0; + } + else + { + /* Between 1601-01-01 and 1970-01-01 there were 280 normal years and 89 + leap years, in total 134774 days. */ + unsigned long long since_1970 = + since_1601 - (unsigned long long) 134774 * (unsigned long long) 86400 * (unsigned long long) 10000000; + result.tv_sec = since_1970 / (unsigned long long) 10000000; + result.tv_nsec = (unsigned long) (since_1970 % (unsigned long long) 10000000) * 100; + } + return result; +} +#else +time_t +_gl_convert_FILETIME_to_POSIX (const FILETIME *ft) +{ + /* FILETIME: <https://msdn.microsoft.com/en-us/library/ms724284.aspx> */ + unsigned long long since_1601 = + ((unsigned long long) ft->dwHighDateTime << 32) + | (unsigned long long) ft->dwLowDateTime; + if (since_1601 == 0) + return 0; + else + { + /* Between 1601-01-01 and 1970-01-01 there were 280 normal years and 89 + leap years, in total 134774 days. */ + unsigned long long since_1970 = + since_1601 - (unsigned long long) 134774 * (unsigned long long) 86400 * (unsigned long long) 10000000; + return since_1970 / (unsigned long long) 10000000; + } +} +#endif + +/* Fill *BUF with information about the file designated by H. + PATH is the file name, if known, otherwise NULL. + Return 0 if successful, or -1 with errno set upon failure. */ +int +_gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf) +{ + /* GetFileType + <https://msdn.microsoft.com/en-us/library/aa364960.aspx> */ + DWORD type = GetFileType (h); + if (type == FILE_TYPE_DISK) + { + if (!initialized) + initialize (); + + /* st_mode can be determined through + GetFileAttributesEx + <https://msdn.microsoft.com/en-us/library/aa364946.aspx> + <https://msdn.microsoft.com/en-us/library/aa365739.aspx> + or through + GetFileInformationByHandle + <https://msdn.microsoft.com/en-us/library/aa364952.aspx> + <https://msdn.microsoft.com/en-us/library/aa363788.aspx> + or through + GetFileInformationByHandleEx with argument FileBasicInfo + <https://msdn.microsoft.com/en-us/library/aa364953.aspx> + <https://msdn.microsoft.com/en-us/library/aa364217.aspx> + The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */ + BY_HANDLE_FILE_INFORMATION info; + if (! GetFileInformationByHandle (h, &info)) + goto failed; + + /* Test for error conditions before starting to fill *buf. */ + if (sizeof (buf->st_size) <= 4 && info.nFileSizeHigh > 0) + { + errno = EOVERFLOW; + return -1; + } + +#if _GL_WINDOWS_STAT_INODES + /* st_ino can be determined through + GetFileInformationByHandle + <https://msdn.microsoft.com/en-us/library/aa364952.aspx> + <https://msdn.microsoft.com/en-us/library/aa363788.aspx> + as 64 bits, or through + GetFileInformationByHandleEx with argument FileIdInfo + <https://msdn.microsoft.com/en-us/library/aa364953.aspx> + <https://msdn.microsoft.com/en-us/library/hh802691.aspx> + as 128 bits. + The latter requires -D_WIN32_WINNT=_WIN32_WINNT_WIN8 or higher. */ + /* Experiments show that GetFileInformationByHandleEx does not provide + much more information than GetFileInformationByHandle: + * The dwVolumeSerialNumber from GetFileInformationByHandle is equal + to the low 32 bits of the 64-bit VolumeSerialNumber from + GetFileInformationByHandleEx, and is apparently sufficient for + identifying the device. + * The nFileIndex from GetFileInformationByHandle is equal to the low + 64 bits of the 128-bit FileId from GetFileInformationByHandleEx, + and the high 64 bits of this 128-bit FileId are zero. + * On a FAT file system, GetFileInformationByHandleEx fails with error + ERROR_INVALID_PARAMETER, whereas GetFileInformationByHandle + succeeds. + * On a CIFS/SMB file system, GetFileInformationByHandleEx fails with + error ERROR_INVALID_LEVEL, whereas GetFileInformationByHandle + succeeds. */ +# if _GL_WINDOWS_STAT_INODES == 2 + if (GetFileInformationByHandleExFunc != NULL) + { + FILE_ID_INFO id; + if (GetFileInformationByHandleExFunc (h, FileIdInfo, &id, sizeof (id))) + { + buf->st_dev = id.VolumeSerialNumber; + verify (sizeof (ino_t) == sizeof (id.FileId)); + memcpy (&buf->st_ino, &id.FileId, sizeof (ino_t)); + goto ino_done; + } + else + { + switch (GetLastError ()) + { + case ERROR_INVALID_PARAMETER: /* older Windows version, or FAT */ + case ERROR_INVALID_LEVEL: /* CIFS/SMB file system */ + goto fallback; + default: + goto failed; + } + } + } + fallback: ; + /* Fallback for older Windows versions. */ + buf->st_dev = info.dwVolumeSerialNumber; + buf->st_ino._gl_ino[0] = ((ULONGLONG) info.nFileIndexHigh << 32) | (ULONGLONG) info.nFileIndexLow; + buf->st_ino._gl_ino[1] = 0; + ino_done: ; +# else /* _GL_WINDOWS_STAT_INODES == 1 */ + buf->st_dev = info.dwVolumeSerialNumber; + buf->st_ino = ((ULONGLONG) info.nFileIndexHigh << 32) | (ULONGLONG) info.nFileIndexLow; +# endif +#else + /* st_ino is not wide enough for identifying a file on a device. + Without st_ino, st_dev is pointless. */ + buf->st_dev = 0; + buf->st_ino = 0; +#endif + + /* st_mode. */ + unsigned int mode = + /* XXX How to handle FILE_ATTRIBUTE_REPARSE_POINT ? */ + ((info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? _S_IFDIR | S_IEXEC_UGO : _S_IFREG) + | S_IREAD_UGO + | ((info.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? 0 : S_IWRITE_UGO); + if (!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + { + /* Determine whether the file is executable by looking at the file + name suffix. + If the file name is already known, use it. Otherwise, for + non-empty files, it can be determined through + GetFinalPathNameByHandle + <https://msdn.microsoft.com/en-us/library/aa364962.aspx> + or through + GetFileInformationByHandleEx with argument FileNameInfo + <https://msdn.microsoft.com/en-us/library/aa364953.aspx> + <https://msdn.microsoft.com/en-us/library/aa364388.aspx> + Both require -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */ + if (info.nFileSizeHigh > 0 || info.nFileSizeLow > 0) + { + char fpath[PATH_MAX]; + if (path != NULL + || (GetFinalPathNameByHandleFunc != NULL + && GetFinalPathNameByHandleFunc (h, fpath, sizeof (fpath), VOLUME_NAME_NONE) + < sizeof (fpath) + && (path = fpath, 1))) + { + const char *last_dot = NULL; + const char *p; + for (p = path; *p != '\0'; p++) + if (*p == '.') + last_dot = p; + if (last_dot != NULL) + { + const char *suffix = last_dot + 1; + if (_stricmp (suffix, "exe") == 0 + || _stricmp (suffix, "bat") == 0 + || _stricmp (suffix, "cmd") == 0 + || _stricmp (suffix, "com") == 0) + mode |= S_IEXEC_UGO; + } + } + else + /* Cannot determine file name. Pretend that it is executable. */ + mode |= S_IEXEC_UGO; + } + } + buf->st_mode = mode; + + /* st_nlink can be determined through + GetFileInformationByHandle + <https://msdn.microsoft.com/en-us/library/aa364952.aspx> + <https://msdn.microsoft.com/en-us/library/aa363788.aspx> + or through + GetFileInformationByHandleEx with argument FileStandardInfo + <https://msdn.microsoft.com/en-us/library/aa364953.aspx> + <https://msdn.microsoft.com/en-us/library/aa364401.aspx> + The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */ + buf->st_nlink = (info.nNumberOfLinks > SHRT_MAX ? SHRT_MAX : info.nNumberOfLinks); + + /* There's no easy way to map the Windows SID concept to an integer. */ + buf->st_uid = 0; + buf->st_gid = 0; + + /* st_rdev is irrelevant for normal files and directories. */ + buf->st_rdev = 0; + + /* st_size can be determined through + GetFileSizeEx + <https://msdn.microsoft.com/en-us/library/aa364957.aspx> + or through + GetFileAttributesEx + <https://msdn.microsoft.com/en-us/library/aa364946.aspx> + <https://msdn.microsoft.com/en-us/library/aa365739.aspx> + or through + GetFileInformationByHandle + <https://msdn.microsoft.com/en-us/library/aa364952.aspx> + <https://msdn.microsoft.com/en-us/library/aa363788.aspx> + or through + GetFileInformationByHandleEx with argument FileStandardInfo + <https://msdn.microsoft.com/en-us/library/aa364953.aspx> + <https://msdn.microsoft.com/en-us/library/aa364401.aspx> + The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */ + if (sizeof (buf->st_size) <= 4) + /* Range check already done above. */ + buf->st_size = info.nFileSizeLow; + else + buf->st_size = ((long long) info.nFileSizeHigh << 32) | (long long) info.nFileSizeLow; + + /* st_atime, st_mtime, st_ctime can be determined through + GetFileTime + <https://msdn.microsoft.com/en-us/library/ms724320.aspx> + or through + GetFileAttributesEx + <https://msdn.microsoft.com/en-us/library/aa364946.aspx> + <https://msdn.microsoft.com/en-us/library/aa365739.aspx> + or through + GetFileInformationByHandle + <https://msdn.microsoft.com/en-us/library/aa364952.aspx> + <https://msdn.microsoft.com/en-us/library/aa363788.aspx> + or through + GetFileInformationByHandleEx with argument FileBasicInfo + <https://msdn.microsoft.com/en-us/library/aa364953.aspx> + <https://msdn.microsoft.com/en-us/library/aa364217.aspx> + The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */ +#if _GL_WINDOWS_STAT_TIMESPEC + buf->st_atim = _gl_convert_FILETIME_to_timespec (&info.ftLastAccessTime); + buf->st_mtim = _gl_convert_FILETIME_to_timespec (&info.ftLastWriteTime); + buf->st_ctim = _gl_convert_FILETIME_to_timespec (&info.ftCreationTime); +#else + buf->st_atime = _gl_convert_FILETIME_to_POSIX (&info.ftLastAccessTime); + buf->st_mtime = _gl_convert_FILETIME_to_POSIX (&info.ftLastWriteTime); + buf->st_ctime = _gl_convert_FILETIME_to_POSIX (&info.ftCreationTime); +#endif + + return 0; + } + else if (type == FILE_TYPE_CHAR || type == FILE_TYPE_PIPE) + { + buf->st_dev = 0; +#if _GL_WINDOWS_STAT_INODES == 2 + buf->st_ino._gl_ino[0] = buf->st_ino._gl_ino[1] = 0; +#else + buf->st_ino = 0; +#endif + buf->st_mode = (type == FILE_TYPE_PIPE ? _S_IFIFO : _S_IFCHR); + buf->st_nlink = 1; + buf->st_uid = 0; + buf->st_gid = 0; + buf->st_rdev = 0; + if (type == FILE_TYPE_PIPE) + { + /* PeekNamedPipe + <https://msdn.microsoft.com/en-us/library/aa365779.aspx> */ + DWORD bytes_available; + if (PeekNamedPipe (h, NULL, 0, NULL, &bytes_available, NULL)) + buf->st_size = bytes_available; + else + buf->st_size = 0; + } + else + buf->st_size = 0; +#if _GL_WINDOWS_STAT_TIMESPEC + buf->st_atim.tv_sec = 0; buf->st_atim.tv_nsec = 0; + buf->st_mtim.tv_sec = 0; buf->st_mtim.tv_nsec = 0; + buf->st_ctim.tv_sec = 0; buf->st_ctim.tv_nsec = 0; +#else + buf->st_atime = 0; + buf->st_mtime = 0; + buf->st_ctime = 0; +#endif + return 0; + } + else + { + errno = ENOENT; + return -1; + } + + failed: + { + DWORD error = GetLastError (); + #if 0 + fprintf (stderr, "_gl_fstat_by_handle error 0x%x\n", (unsigned int) error); + #endif + switch (error) + { + case ERROR_ACCESS_DENIED: + case ERROR_SHARING_VIOLATION: + errno = EACCES; + break; + + case ERROR_OUTOFMEMORY: + errno = ENOMEM; + break; + + case ERROR_WRITE_FAULT: + case ERROR_READ_FAULT: + case ERROR_GEN_FAILURE: + errno = EIO; + break; + + default: + errno = EINVAL; + break; + } + return -1; + } +} + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/stat-w32.h b/local/recipes/tools/diffutils/source/lib/stat-w32.h new file mode 100644 index 0000000000..54268432cd --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/stat-w32.h @@ -0,0 +1,37 @@ +/* Core of implementation of fstat and stat for native Windows. + Copyright (C) 2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _STAT_W32_H +#define _STAT_W32_H 1 + +/* Converts a FILETIME to GMT time since 1970-01-01 00:00:00. */ +#if _GL_WINDOWS_STAT_TIMESPEC +extern struct timespec _gl_convert_FILETIME_to_timespec (const FILETIME *ft); +#else +extern time_t _gl_convert_FILETIME_to_POSIX (const FILETIME *ft); +#endif + +/* Fill *BUF with information about the file designated by H. + PATH is the file name, if known, otherwise NULL. + Return 0 if successful, or -1 with errno set upon failure. */ +extern int _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf); + +/* Bitmasks for st_mode. */ +#define S_IREAD_UGO (_S_IREAD | (_S_IREAD >> 3) | (_S_IREAD >> 6)) +#define S_IWRITE_UGO (_S_IWRITE | (_S_IWRITE >> 3) | (_S_IWRITE >> 6)) +#define S_IEXEC_UGO (_S_IEXEC | (_S_IEXEC >> 3) | (_S_IEXEC >> 6)) + +#endif /* _STAT_W32_H */ diff --git a/local/recipes/tools/diffutils/source/lib/stat.c b/local/recipes/tools/diffutils/source/lib/stat.c new file mode 100644 index 0000000000..a73a3445cd --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/stat.c @@ -0,0 +1,423 @@ +/* Work around platform bugs in stat. + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake and Bruno Haible. */ + +/* If the user's config.h happens to include <sys/stat.h>, let it include only + the system's <sys/stat.h> here, so that orig_stat doesn't recurse to + rpl_stat. */ +#define __need_system_sys_stat_h +#include <config.h> + +/* Get the original definition of stat. It might be defined as a macro. */ +#include <sys/types.h> +#include <sys/stat.h> +#undef __need_system_sys_stat_h + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# define WINDOWS_NATIVE +#endif + +#if !defined WINDOWS_NATIVE + +static int +orig_stat (const char *filename, struct stat *buf) +{ + return stat (filename, buf); +} + +#endif + +/* Specification. */ +/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc + eliminates this include because of the preliminary #include <sys/stat.h> + above. */ +#include "sys/stat.h" + +#include <errno.h> +#include <limits.h> +#include <stdbool.h> +#include <string.h> +#include "filename.h" +#include "malloca.h" +#include "verify.h" + +#ifdef WINDOWS_NATIVE +# define WIN32_LEAN_AND_MEAN +# include <windows.h> +# include "stat-w32.h" +#endif + +#ifdef WINDOWS_NATIVE +/* Return TRUE if the given file name denotes an UNC root. */ +static BOOL +is_unc_root (const char *rname) +{ + /* Test whether it has the syntax '\\server\share'. */ + if (ISSLASH (rname[0]) && ISSLASH (rname[1])) + { + /* It starts with two slashes. Find the next slash. */ + const char *p = rname + 2; + const char *q = p; + while (*q != '\0' && !ISSLASH (*q)) + q++; + if (q > p && *q != '\0') + { + /* Found the next slash at q. */ + q++; + const char *r = q; + while (*r != '\0' && !ISSLASH (*r)) + r++; + if (r > q && *r == '\0') + return TRUE; + } + } + return FALSE; +} +#endif + +/* Store information about NAME into ST. Work around bugs with + trailing slashes. Mingw has other bugs (such as st_ino always + being 0 on success) which this wrapper does not work around. But + at least this implementation provides the ability to emulate fchdir + correctly. */ + +int +rpl_stat (char const *name, struct stat *buf) +{ +#ifdef WINDOWS_NATIVE + /* Fill the fields ourselves, because the original stat function returns + values for st_atime, st_mtime, st_ctime that depend on the current time + zone. See + <https://lists.gnu.org/archive/html/bug-gnulib/2017-04/msg00134.html> */ + /* XXX Should we convert to wchar_t* and prepend '\\?\', in order to work + around length limitations + <https://msdn.microsoft.com/en-us/library/aa365247.aspx> ? */ + + /* POSIX <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13> + specifies: "More than two leading <slash> characters shall be treated as + a single <slash> character." */ + if (ISSLASH (name[0]) && ISSLASH (name[1]) && ISSLASH (name[2])) + { + name += 2; + while (ISSLASH (name[1])) + name++; + } + + size_t len = strlen (name); + size_t drive_prefix_len = (HAS_DEVICE (name) ? 2 : 0); + + /* Remove trailing slashes (except the very first one, at position + drive_prefix_len), but remember their presence. */ + size_t rlen; + bool check_dir = false; + + rlen = len; + while (rlen > drive_prefix_len && ISSLASH (name[rlen-1])) + { + check_dir = true; + if (rlen == drive_prefix_len + 1) + break; + rlen--; + } + + /* Handle '' and 'C:'. */ + if (!check_dir && rlen == drive_prefix_len) + { + errno = ENOENT; + return -1; + } + + /* Handle '\\'. */ + if (rlen == 1 && ISSLASH (name[0]) && len >= 2) + { + errno = ENOENT; + return -1; + } + + const char *rname; + char *malloca_rname; + if (rlen == len) + { + rname = name; + malloca_rname = NULL; + } + else + { + malloca_rname = malloca (rlen + 1); + if (malloca_rname == NULL) + { + errno = ENOMEM; + return -1; + } + memcpy (malloca_rname, name, rlen); + malloca_rname[rlen] = '\0'; + rname = malloca_rname; + } + + /* There are two ways to get at the requested information: + - by scanning the parent directory and examining the relevant + directory entry, + - by opening the file directly. + The first approach fails for root directories (e.g. 'C:\') and + UNC root directories (e.g. '\\server\share'). + The second approach fails for some system files (e.g. 'C:\pagefile.sys' + and 'C:\hiberfil.sys'): ERROR_SHARING_VIOLATION. + The second approach gives more information (in particular, correct + st_dev, st_ino, st_nlink fields). + So we use the second approach and, as a fallback except for root and + UNC root directories, also the first approach. */ + { + int ret; + + { + /* Approach based on the file. */ + + /* Open a handle to the file. + CreateFile + <https://msdn.microsoft.com/en-us/library/aa363858.aspx> + <https://msdn.microsoft.com/en-us/library/aa363874.aspx> */ + HANDLE h = + CreateFile (rname, + FILE_READ_ATTRIBUTES, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, + OPEN_EXISTING, + /* FILE_FLAG_POSIX_SEMANTICS (treat file names that differ only + in case as different) makes sense only when applied to *all* + filesystem operations. */ + FILE_FLAG_BACKUP_SEMANTICS /* | FILE_FLAG_POSIX_SEMANTICS */, + NULL); + if (h != INVALID_HANDLE_VALUE) + { + ret = _gl_fstat_by_handle (h, rname, buf); + CloseHandle (h); + goto done; + } + } + + /* Test for root and UNC root directories. */ + if ((rlen == drive_prefix_len + 1 && ISSLASH (rname[drive_prefix_len])) + || is_unc_root (rname)) + goto failed; + + /* Fallback. */ + { + /* Approach based on the directory entry. */ + + if (strchr (rname, '?') != NULL || strchr (rname, '*') != NULL) + { + /* Other Windows API functions would fail with error + ERROR_INVALID_NAME. */ + if (malloca_rname != NULL) + freea (malloca_rname); + errno = ENOENT; + return -1; + } + + /* Get the details about the directory entry. This can be done through + FindFirstFile + <https://msdn.microsoft.com/en-us/library/aa364418.aspx> + <https://msdn.microsoft.com/en-us/library/aa365740.aspx> + or through + FindFirstFileEx with argument FindExInfoBasic + <https://msdn.microsoft.com/en-us/library/aa364419.aspx> + <https://msdn.microsoft.com/en-us/library/aa364415.aspx> + <https://msdn.microsoft.com/en-us/library/aa365740.aspx> */ + WIN32_FIND_DATA info; + HANDLE h = FindFirstFile (rname, &info); + if (h == INVALID_HANDLE_VALUE) + goto failed; + + /* Test for error conditions before starting to fill *buf. */ + if (sizeof (buf->st_size) <= 4 && info.nFileSizeHigh > 0) + { + FindClose (h); + if (malloca_rname != NULL) + freea (malloca_rname); + errno = EOVERFLOW; + return -1; + } + +# if _GL_WINDOWS_STAT_INODES + buf->st_dev = 0; +# if _GL_WINDOWS_STAT_INODES == 2 + buf->st_ino._gl_ino[0] = buf->st_ino._gl_ino[1] = 0; +# else /* _GL_WINDOWS_STAT_INODES == 1 */ + buf->st_ino = 0; +# endif +# else + /* st_ino is not wide enough for identifying a file on a device. + Without st_ino, st_dev is pointless. */ + buf->st_dev = 0; + buf->st_ino = 0; +# endif + + /* st_mode. */ + unsigned int mode = + /* XXX How to handle FILE_ATTRIBUTE_REPARSE_POINT ? */ + ((info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? _S_IFDIR | S_IEXEC_UGO : _S_IFREG) + | S_IREAD_UGO + | ((info.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? 0 : S_IWRITE_UGO); + if (!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + { + /* Determine whether the file is executable by looking at the file + name suffix. */ + if (info.nFileSizeHigh > 0 || info.nFileSizeLow > 0) + { + const char *last_dot = NULL; + const char *p; + for (p = info.cFileName; *p != '\0'; p++) + if (*p == '.') + last_dot = p; + if (last_dot != NULL) + { + const char *suffix = last_dot + 1; + if (_stricmp (suffix, "exe") == 0 + || _stricmp (suffix, "bat") == 0 + || _stricmp (suffix, "cmd") == 0 + || _stricmp (suffix, "com") == 0) + mode |= S_IEXEC_UGO; + } + } + } + buf->st_mode = mode; + + /* st_nlink. Ignore hard links here. */ + buf->st_nlink = 1; + + /* There's no easy way to map the Windows SID concept to an integer. */ + buf->st_uid = 0; + buf->st_gid = 0; + + /* st_rdev is irrelevant for normal files and directories. */ + buf->st_rdev = 0; + + /* st_size. */ + if (sizeof (buf->st_size) <= 4) + /* Range check already done above. */ + buf->st_size = info.nFileSizeLow; + else + buf->st_size = ((long long) info.nFileSizeHigh << 32) | (long long) info.nFileSizeLow; + + /* st_atime, st_mtime, st_ctime. */ +# if _GL_WINDOWS_STAT_TIMESPEC + buf->st_atim = _gl_convert_FILETIME_to_timespec (&info.ftLastAccessTime); + buf->st_mtim = _gl_convert_FILETIME_to_timespec (&info.ftLastWriteTime); + buf->st_ctim = _gl_convert_FILETIME_to_timespec (&info.ftCreationTime); +# else + buf->st_atime = _gl_convert_FILETIME_to_POSIX (&info.ftLastAccessTime); + buf->st_mtime = _gl_convert_FILETIME_to_POSIX (&info.ftLastWriteTime); + buf->st_ctime = _gl_convert_FILETIME_to_POSIX (&info.ftCreationTime); +# endif + + FindClose (h); + + ret = 0; + } + + done: + if (ret >= 0 && check_dir && !S_ISDIR (buf->st_mode)) + { + errno = ENOTDIR; + ret = -1; + } + if (malloca_rname != NULL) + { + int saved_errno = errno; + freea (malloca_rname); + errno = saved_errno; + } + return ret; + } + + failed: + { + DWORD error = GetLastError (); + #if 0 + fprintf (stderr, "rpl_stat error 0x%x\n", (unsigned int) error); + #endif + + if (malloca_rname != NULL) + freea (malloca_rname); + + switch (error) + { + /* Some of these errors probably cannot happen with the specific flags + that we pass to CreateFile. But who knows... */ + case ERROR_FILE_NOT_FOUND: /* The last component of rname does not exist. */ + case ERROR_PATH_NOT_FOUND: /* Some directory component in rname does not exist. */ + case ERROR_BAD_PATHNAME: /* rname is such as '\\server'. */ + case ERROR_BAD_NET_NAME: /* rname is such as '\\server\nonexistentshare'. */ + case ERROR_INVALID_NAME: /* rname contains wildcards, misplaced colon, etc. */ + case ERROR_DIRECTORY: + errno = ENOENT; + break; + + case ERROR_ACCESS_DENIED: /* rname is such as 'C:\System Volume Information\foo'. */ + case ERROR_SHARING_VIOLATION: /* rname is such as 'C:\pagefile.sys' (second approach only). */ + /* XXX map to EACCESS or EPERM? */ + errno = EACCES; + break; + + case ERROR_OUTOFMEMORY: + errno = ENOMEM; + break; + + case ERROR_WRITE_PROTECT: + errno = EROFS; + break; + + case ERROR_WRITE_FAULT: + case ERROR_READ_FAULT: + case ERROR_GEN_FAILURE: + errno = EIO; + break; + + case ERROR_BUFFER_OVERFLOW: + case ERROR_FILENAME_EXCED_RANGE: + errno = ENAMETOOLONG; + break; + + case ERROR_DELETE_PENDING: /* XXX map to EACCESS or EPERM? */ + errno = EPERM; + break; + + default: + errno = EINVAL; + break; + } + + return -1; + } +#else + int result = orig_stat (name, buf); +# if REPLACE_FUNC_STAT_FILE + /* Solaris 9 mistakenly succeeds when given a non-directory with a + trailing slash. */ + if (result == 0 && !S_ISDIR (buf->st_mode)) + { + size_t len = strlen (name); + if (ISSLASH (name[len - 1])) + { + errno = ENOTDIR; + return -1; + } + } +# endif /* REPLACE_FUNC_STAT_FILE */ + return result; +#endif +} diff --git a/local/recipes/tools/diffutils/source/lib/stdarg.in.h b/local/recipes/tools/diffutils/source/lib/stdarg.in.h new file mode 100644 index 0000000000..3785cd1d99 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/stdarg.in.h @@ -0,0 +1,35 @@ +/* Substitute for and wrapper around <stdarg.h>. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _@GUARD_PREFIX@_STDARG_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_STDARG_H@ + +#ifndef _@GUARD_PREFIX@_STDARG_H +#define _@GUARD_PREFIX@_STDARG_H + +#ifndef va_copy +# define va_copy(a,b) ((a) = (b)) +#endif + +#endif /* _@GUARD_PREFIX@_STDARG_H */ +#endif /* _@GUARD_PREFIX@_STDARG_H */ diff --git a/local/recipes/tools/diffutils/source/lib/stdbool.in.h b/local/recipes/tools/diffutils/source/lib/stdbool.in.h new file mode 100644 index 0000000000..1067ed2e4c --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/stdbool.in.h @@ -0,0 +1,132 @@ +/* Copyright (C) 2001-2003, 2006-2017 Free Software Foundation, Inc. + Written by Bruno Haible <haible@clisp.cons.org>, 2001. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _GL_STDBOOL_H +#define _GL_STDBOOL_H + +/* ISO C 99 <stdbool.h> for platforms that lack it. */ + +/* Usage suggestions: + + Programs that use <stdbool.h> should be aware of some limitations + and standards compliance issues. + + Standards compliance: + + - <stdbool.h> must be #included before 'bool', 'false', 'true' + can be used. + + - You cannot assume that sizeof (bool) == 1. + + - Programs should not undefine the macros bool, true, and false, + as C99 lists that as an "obsolescent feature". + + Limitations of this substitute, when used in a C89 environment: + + - <stdbool.h> must be #included before the '_Bool' type can be used. + + - You cannot assume that _Bool is a typedef; it might be a macro. + + - Bit-fields of type 'bool' are not supported. Portable code + should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'. + + - In C99, casts and automatic conversions to '_Bool' or 'bool' are + performed in such a way that every nonzero value gets converted + to 'true', and zero gets converted to 'false'. This doesn't work + with this substitute. With this substitute, only the values 0 and 1 + give the expected result when converted to _Bool' or 'bool'. + + - C99 allows the use of (_Bool)0.0 in constant expressions, but + this substitute cannot always provide this property. + + Also, it is suggested that programs use 'bool' rather than '_Bool'; + this isn't required, but 'bool' is more common. */ + + +/* 7.16. Boolean type and values */ + +/* BeOS <sys/socket.h> already #defines false 0, true 1. We use the same + definitions below, but temporarily we have to #undef them. */ +#if defined __BEOS__ && !defined __HAIKU__ +# include <OS.h> /* defines bool but not _Bool */ +# undef false +# undef true +#endif + +#ifdef __cplusplus +# define _Bool bool +# define bool bool +#else +# if defined __BEOS__ && !defined __HAIKU__ + /* A compiler known to have 'bool'. */ + /* If the compiler already has both 'bool' and '_Bool', we can assume they + are the same types. */ +# if !@HAVE__BOOL@ +typedef bool _Bool; +# endif +# else +# if !defined __GNUC__ + /* If @HAVE__BOOL@: + Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when + the built-in _Bool type is used. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html + Similar bugs are likely with other compilers as well; this file + wouldn't be used if <stdbool.h> was working. + So we override the _Bool type. + If !@HAVE__BOOL@: + Need to define _Bool ourselves. As 'signed char' or as an enum type? + Use of a typedef, with SunPRO C, leads to a stupid + "warning: _Bool is a keyword in ISO C99". + Use of an enum type, with IRIX cc, leads to a stupid + "warning(1185): enumerated type mixed with another type". + Even the existence of an enum type, without a typedef, + "Invalid enumerator. (badenum)" with HP-UX cc on Tru64. + The only benefit of the enum, debuggability, is not important + with these compilers. So use 'signed char' and no enum. */ +# define _Bool signed char +# else + /* With this compiler, trust the _Bool type if the compiler has it. */ +# if !@HAVE__BOOL@ + /* For the sake of symbolic names in gdb, define true and false as + enum constants, not only as macros. + It is tempting to write + typedef enum { false = 0, true = 1 } _Bool; + so that gdb prints values of type 'bool' symbolically. But then + values of type '_Bool' might promote to 'int' or 'unsigned int' + (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int' + (see ISO C 99 6.3.1.1.(2)). So add a negative value to the + enum; this ensures that '_Bool' promotes to 'int'. */ +typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool; +# endif +# endif +# endif +# define bool _Bool +#endif + +/* The other macros must be usable in preprocessor directives. */ +#ifdef __cplusplus +# define false false +# define true true +#else +# define false 0 +# define true 1 +#endif + +#define __bool_true_false_are_defined 1 + +#endif /* _GL_STDBOOL_H */ diff --git a/local/recipes/tools/diffutils/source/lib/stddef.in.h b/local/recipes/tools/diffutils/source/lib/stddef.in.h new file mode 100644 index 0000000000..5b496a6832 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/stddef.in.h @@ -0,0 +1,110 @@ +/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues. + + Copyright (C) 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake. */ + +/* + * POSIX 2008 <stddef.h> for platforms that have issues. + * <http://www.opengroup.org/susv3xbd/stddef.h.html> + */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#if defined __need_wchar_t || defined __need_size_t \ + || defined __need_ptrdiff_t || defined __need_NULL \ + || defined __need_wint_t +/* Special invocation convention inside gcc header files. In + particular, gcc provides a version of <stddef.h> that blindly + redefines NULL even when __need_wint_t was defined, even though + wint_t is not normally provided by <stddef.h>. Hence, we must + remember if special invocation has ever been used to obtain wint_t, + in which case we need to clean up NULL yet again. */ + +# if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _GL_STDDEF_WINT_T) +# ifdef __need_wint_t +# define _GL_STDDEF_WINT_T +# endif +# @INCLUDE_NEXT@ @NEXT_STDDEF_H@ +# endif + +#else +/* Normal invocation convention. */ + +# ifndef _@GUARD_PREFIX@_STDDEF_H + +/* The include_next requires a split double-inclusion guard. */ + +# @INCLUDE_NEXT@ @NEXT_STDDEF_H@ + +/* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */ +# if (@REPLACE_NULL@ \ + && (!defined _@GUARD_PREFIX@_STDDEF_H || defined _GL_STDDEF_WINT_T)) +# undef NULL +# ifdef __cplusplus + /* ISO C++ says that the macro NULL must expand to an integer constant + expression, hence '((void *) 0)' is not allowed in C++. */ +# if __GNUG__ >= 3 + /* GNU C++ has a __null macro that behaves like an integer ('int' or + 'long') but has the same size as a pointer. Use that, to avoid + warnings. */ +# define NULL __null +# else +# define NULL 0L +# endif +# else +# define NULL ((void *) 0) +# endif +# endif + +# ifndef _@GUARD_PREFIX@_STDDEF_H +# define _@GUARD_PREFIX@_STDDEF_H + +/* Some platforms lack wchar_t. */ +#if !@HAVE_WCHAR_T@ +# define wchar_t int +#endif + +/* Some platforms lack max_align_t. The check for _GCC_MAX_ALIGN_T is + a hack in case the configure-time test was done with g++ even though + we are currently compiling with gcc. */ +#if ! (@HAVE_MAX_ALIGN_T@ || defined _GCC_MAX_ALIGN_T) +/* On the x86, the maximum storage alignment of double, long, etc. is 4, + but GCC's C11 ABI for x86 says that max_align_t has an alignment of 8, + and the C11 standard allows this. Work around this problem by + using __alignof__ (which returns 8 for double) rather than _Alignof + (which returns 4), and align each union member accordingly. */ +# ifdef __GNUC__ +# define _GL_STDDEF_ALIGNAS(type) \ + __attribute__ ((__aligned__ (__alignof__ (type)))) +# else +# define _GL_STDDEF_ALIGNAS(type) /* */ +# endif +typedef union +{ + char *__p _GL_STDDEF_ALIGNAS (char *); + double __d _GL_STDDEF_ALIGNAS (double); + long double __ld _GL_STDDEF_ALIGNAS (long double); + long int __i _GL_STDDEF_ALIGNAS (long int); +} max_align_t; +#endif + +# endif /* _@GUARD_PREFIX@_STDDEF_H */ +# endif /* _@GUARD_PREFIX@_STDDEF_H */ +#endif /* __need_XXX */ diff --git a/local/recipes/tools/diffutils/source/lib/stdint.in.h b/local/recipes/tools/diffutils/source/lib/stdint.in.h new file mode 100644 index 0000000000..5fbec34310 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/stdint.in.h @@ -0,0 +1,726 @@ +/* Copyright (C) 2001-2002, 2004-2017 Free Software Foundation, Inc. + Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. + This file is part of gnulib. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* + * ISO C 99 <stdint.h> for platforms that lack it. + * <http://www.opengroup.org/susv3xbd/stdint.h.html> + */ + +#ifndef _@GUARD_PREFIX@_STDINT_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* When including a system file that in turn includes <inttypes.h>, + use the system <inttypes.h>, not our substitute. This avoids + problems with (for example) VMS, whose <sys/bitypes.h> includes + <inttypes.h>. */ +#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H + +/* On Android (Bionic libc), <sys/types.h> includes this file before + having defined 'time_t'. Therefore in this case avoid including + other system header files; just include the system's <stdint.h>. + Ideally we should test __BIONIC__ here, but it is only defined after + <sys/cdefs.h> has been included; hence test __ANDROID__ instead. */ +#if defined __ANDROID__ && defined _GL_INCLUDING_SYS_TYPES_H +# @INCLUDE_NEXT@ @NEXT_STDINT_H@ +#else + +/* Get those types that are already defined in other system include + files, so that we can "#define int8_t signed char" below without + worrying about a later system include file containing a "typedef + signed char int8_t;" that will get messed up by our macro. Our + macros should all be consistent with the system versions, except + for the "fast" types and macros, which we recommend against using + in public interfaces due to compiler differences. */ + +#if @HAVE_STDINT_H@ +# if defined __sgi && ! defined __c99 + /* Bypass IRIX's <stdint.h> if in C89 mode, since it merely annoys users + with "This header file is to be used only for c99 mode compilations" + diagnostics. */ +# define __STDINT_H__ +# endif + + /* Some pre-C++11 <stdint.h> implementations need this. */ +# ifdef __cplusplus +# ifndef __STDC_CONSTANT_MACROS +# define __STDC_CONSTANT_MACROS 1 +# endif +# ifndef __STDC_LIMIT_MACROS +# define __STDC_LIMIT_MACROS 1 +# endif +# endif + + /* Other systems may have an incomplete or buggy <stdint.h>. + Include it before <inttypes.h>, since any "#include <stdint.h>" + in <inttypes.h> would reinclude us, skipping our contents because + _@GUARD_PREFIX@_STDINT_H is defined. + The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_STDINT_H@ +#endif + +#if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H +#define _@GUARD_PREFIX@_STDINT_H + +/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX, + LONG_MIN, LONG_MAX, ULONG_MAX, _GL_INTEGER_WIDTH. */ +#include <limits.h> + +/* Override WINT_MIN and WINT_MAX if gnulib's <wchar.h> or <wctype.h> overrides + wint_t. */ +#if @GNULIB_OVERRIDES_WINT_T@ +# undef WINT_MIN +# undef WINT_MAX +# define WINT_MIN 0x0U +# define WINT_MAX 0xffffffffU +#endif + +#if ! @HAVE_C99_STDINT_H@ + +/* <sys/types.h> defines some of the stdint.h types as well, on glibc, + IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>). + AIX 5.2 <sys/types.h> isn't needed and causes troubles. + Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but + relies on the system <stdint.h> definitions, so include + <sys/types.h> after @NEXT_STDINT_H@. */ +# if @HAVE_SYS_TYPES_H@ && ! defined _AIX +# include <sys/types.h> +# endif + +# if @HAVE_INTTYPES_H@ + /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines + int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. + <inttypes.h> also defines intptr_t and uintptr_t. */ +# include <inttypes.h> +# elif @HAVE_SYS_INTTYPES_H@ + /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and + the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */ +# include <sys/inttypes.h> +# endif + +# if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__ + /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines + int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is + included by <sys/types.h>. */ +# include <sys/bitypes.h> +# endif + +# undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H + +/* Minimum and maximum values for an integer type under the usual assumption. + Return an unspecified value if BITS == 0, adding a check to pacify + picky compilers. */ + +/* These are separate macros, because if you try to merge these macros into + a single one, HP-UX cc rejects the resulting expression in constant + expressions. */ +# define _STDINT_UNSIGNED_MIN(bits, zero) \ + (zero) +# define _STDINT_SIGNED_MIN(bits, zero) \ + (~ _STDINT_MAX (1, bits, zero)) + +# define _STDINT_MAX(signed, bits, zero) \ + (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) + +#if !GNULIB_defined_stdint_types + +/* 7.18.1.1. Exact-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. */ + +# undef int8_t +# undef uint8_t +typedef signed char gl_int8_t; +typedef unsigned char gl_uint8_t; +# define int8_t gl_int8_t +# define uint8_t gl_uint8_t + +# undef int16_t +# undef uint16_t +typedef short int gl_int16_t; +typedef unsigned short int gl_uint16_t; +# define int16_t gl_int16_t +# define uint16_t gl_uint16_t + +# undef int32_t +# undef uint32_t +typedef int gl_int32_t; +typedef unsigned int gl_uint32_t; +# define int32_t gl_int32_t +# define uint32_t gl_uint32_t + +/* If the system defines INT64_MAX, assume int64_t works. That way, + if the underlying platform defines int64_t to be a 64-bit long long + int, the code below won't mistakenly define it to be a 64-bit long + int, which would mess up C++ name mangling. We must use #ifdef + rather than #if, to avoid an error with HP-UX 10.20 cc. */ + +# ifdef INT64_MAX +# define GL_INT64_T +# else +/* Do not undefine int64_t if gnulib is not being used with 64-bit + types, since otherwise it breaks platforms like Tandem/NSK. */ +# if LONG_MAX >> 31 >> 31 == 1 +# undef int64_t +typedef long int gl_int64_t; +# define int64_t gl_int64_t +# define GL_INT64_T +# elif defined _MSC_VER +# undef int64_t +typedef __int64 gl_int64_t; +# define int64_t gl_int64_t +# define GL_INT64_T +# elif @HAVE_LONG_LONG_INT@ +# undef int64_t +typedef long long int gl_int64_t; +# define int64_t gl_int64_t +# define GL_INT64_T +# endif +# endif + +# ifdef UINT64_MAX +# define GL_UINT64_T +# else +# if ULONG_MAX >> 31 >> 31 >> 1 == 1 +# undef uint64_t +typedef unsigned long int gl_uint64_t; +# define uint64_t gl_uint64_t +# define GL_UINT64_T +# elif defined _MSC_VER +# undef uint64_t +typedef unsigned __int64 gl_uint64_t; +# define uint64_t gl_uint64_t +# define GL_UINT64_T +# elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# undef uint64_t +typedef unsigned long long int gl_uint64_t; +# define uint64_t gl_uint64_t +# define GL_UINT64_T +# endif +# endif + +/* Avoid collision with Solaris 2.5.1 <pthread.h> etc. */ +# define _UINT8_T +# define _UINT32_T +# define _UINT64_T + + +/* 7.18.1.2. Minimum-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types + are the same as the corresponding N_t types. */ + +# undef int_least8_t +# undef uint_least8_t +# undef int_least16_t +# undef uint_least16_t +# undef int_least32_t +# undef uint_least32_t +# undef int_least64_t +# undef uint_least64_t +# define int_least8_t int8_t +# define uint_least8_t uint8_t +# define int_least16_t int16_t +# define uint_least16_t uint16_t +# define int_least32_t int32_t +# define uint_least32_t uint32_t +# ifdef GL_INT64_T +# define int_least64_t int64_t +# endif +# ifdef GL_UINT64_T +# define uint_least64_t uint64_t +# endif + +/* 7.18.1.3. Fastest minimum-width integer types */ + +/* Note: Other <stdint.h> substitutes may define these types differently. + It is not recommended to use these types in public header files. */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types + are taken from the same list of types. The following code normally + uses types consistent with glibc, as that lessens the chance of + incompatibility with older GNU hosts. */ + +# undef int_fast8_t +# undef uint_fast8_t +# undef int_fast16_t +# undef uint_fast16_t +# undef int_fast32_t +# undef uint_fast32_t +# undef int_fast64_t +# undef uint_fast64_t +typedef signed char gl_int_fast8_t; +typedef unsigned char gl_uint_fast8_t; + +# ifdef __sun +/* Define types compatible with SunOS 5.10, so that code compiled under + earlier SunOS versions works with code compiled under SunOS 5.10. */ +typedef int gl_int_fast32_t; +typedef unsigned int gl_uint_fast32_t; +# else +typedef long int gl_int_fast32_t; +typedef unsigned long int gl_uint_fast32_t; +# endif +typedef gl_int_fast32_t gl_int_fast16_t; +typedef gl_uint_fast32_t gl_uint_fast16_t; + +# define int_fast8_t gl_int_fast8_t +# define uint_fast8_t gl_uint_fast8_t +# define int_fast16_t gl_int_fast16_t +# define uint_fast16_t gl_uint_fast16_t +# define int_fast32_t gl_int_fast32_t +# define uint_fast32_t gl_uint_fast32_t +# ifdef GL_INT64_T +# define int_fast64_t int64_t +# endif +# ifdef GL_UINT64_T +# define uint_fast64_t uint64_t +# endif + +/* 7.18.1.4. Integer types capable of holding object pointers */ + +/* kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own + definitions of intptr_t and uintptr_t (which use int and unsigned) + to avoid clashes with declarations of system functions like sbrk. */ +# ifndef _INTPTR_T_DECLARED +# undef intptr_t +# undef uintptr_t +typedef long int gl_intptr_t; +typedef unsigned long int gl_uintptr_t; +# define intptr_t gl_intptr_t +# define uintptr_t gl_uintptr_t +# endif + +/* 7.18.1.5. Greatest-width integer types */ + +/* Note: These types are compiler dependent. It may be unwise to use them in + public header files. */ + +/* If the system defines INTMAX_MAX, assume that intmax_t works, and + similarly for UINTMAX_MAX and uintmax_t. This avoids problems with + assuming one type where another is used by the system. */ + +# ifndef INTMAX_MAX +# undef INTMAX_C +# undef intmax_t +# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +typedef long long int gl_intmax_t; +# define intmax_t gl_intmax_t +# elif defined GL_INT64_T +# define intmax_t int64_t +# else +typedef long int gl_intmax_t; +# define intmax_t gl_intmax_t +# endif +# endif + +# ifndef UINTMAX_MAX +# undef UINTMAX_C +# undef uintmax_t +# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +typedef unsigned long long int gl_uintmax_t; +# define uintmax_t gl_uintmax_t +# elif defined GL_UINT64_T +# define uintmax_t uint64_t +# else +typedef unsigned long int gl_uintmax_t; +# define uintmax_t gl_uintmax_t +# endif +# endif + +/* Verify that intmax_t and uintmax_t have the same size. Too much code + breaks if this is not the case. If this check fails, the reason is likely + to be found in the autoconf macros. */ +typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) + ? 1 : -1]; + +# define GNULIB_defined_stdint_types 1 +# endif /* !GNULIB_defined_stdint_types */ + +/* 7.18.2. Limits of specified-width integer types */ + +/* 7.18.2.1. Limits of exact-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. */ + +# undef INT8_MIN +# undef INT8_MAX +# undef UINT8_MAX +# define INT8_MIN (~ INT8_MAX) +# define INT8_MAX 127 +# define UINT8_MAX 255 + +# undef INT16_MIN +# undef INT16_MAX +# undef UINT16_MAX +# define INT16_MIN (~ INT16_MAX) +# define INT16_MAX 32767 +# define UINT16_MAX 65535 + +# undef INT32_MIN +# undef INT32_MAX +# undef UINT32_MAX +# define INT32_MIN (~ INT32_MAX) +# define INT32_MAX 2147483647 +# define UINT32_MAX 4294967295U + +# if defined GL_INT64_T && ! defined INT64_MAX +/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0 + evaluates the latter incorrectly in preprocessor expressions. */ +# define INT64_MIN (- INTMAX_C (1) << 63) +# define INT64_MAX INTMAX_C (9223372036854775807) +# endif + +# if defined GL_UINT64_T && ! defined UINT64_MAX +# define UINT64_MAX UINTMAX_C (18446744073709551615) +# endif + +/* 7.18.2.2. Limits of minimum-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types + are the same as the corresponding N_t types. */ + +# undef INT_LEAST8_MIN +# undef INT_LEAST8_MAX +# undef UINT_LEAST8_MAX +# define INT_LEAST8_MIN INT8_MIN +# define INT_LEAST8_MAX INT8_MAX +# define UINT_LEAST8_MAX UINT8_MAX + +# undef INT_LEAST16_MIN +# undef INT_LEAST16_MAX +# undef UINT_LEAST16_MAX +# define INT_LEAST16_MIN INT16_MIN +# define INT_LEAST16_MAX INT16_MAX +# define UINT_LEAST16_MAX UINT16_MAX + +# undef INT_LEAST32_MIN +# undef INT_LEAST32_MAX +# undef UINT_LEAST32_MAX +# define INT_LEAST32_MIN INT32_MIN +# define INT_LEAST32_MAX INT32_MAX +# define UINT_LEAST32_MAX UINT32_MAX + +# undef INT_LEAST64_MIN +# undef INT_LEAST64_MAX +# ifdef GL_INT64_T +# define INT_LEAST64_MIN INT64_MIN +# define INT_LEAST64_MAX INT64_MAX +# endif + +# undef UINT_LEAST64_MAX +# ifdef GL_UINT64_T +# define UINT_LEAST64_MAX UINT64_MAX +# endif + +/* 7.18.2.3. Limits of fastest minimum-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types + are taken from the same list of types. */ + +# undef INT_FAST8_MIN +# undef INT_FAST8_MAX +# undef UINT_FAST8_MAX +# define INT_FAST8_MIN SCHAR_MIN +# define INT_FAST8_MAX SCHAR_MAX +# define UINT_FAST8_MAX UCHAR_MAX + +# undef INT_FAST16_MIN +# undef INT_FAST16_MAX +# undef UINT_FAST16_MAX +# define INT_FAST16_MIN INT_FAST32_MIN +# define INT_FAST16_MAX INT_FAST32_MAX +# define UINT_FAST16_MAX UINT_FAST32_MAX + +# undef INT_FAST32_MIN +# undef INT_FAST32_MAX +# undef UINT_FAST32_MAX +# ifdef __sun +# define INT_FAST32_MIN INT_MIN +# define INT_FAST32_MAX INT_MAX +# define UINT_FAST32_MAX UINT_MAX +# else +# define INT_FAST32_MIN LONG_MIN +# define INT_FAST32_MAX LONG_MAX +# define UINT_FAST32_MAX ULONG_MAX +# endif + +# undef INT_FAST64_MIN +# undef INT_FAST64_MAX +# ifdef GL_INT64_T +# define INT_FAST64_MIN INT64_MIN +# define INT_FAST64_MAX INT64_MAX +# endif + +# undef UINT_FAST64_MAX +# ifdef GL_UINT64_T +# define UINT_FAST64_MAX UINT64_MAX +# endif + +/* 7.18.2.4. Limits of integer types capable of holding object pointers */ + +# undef INTPTR_MIN +# undef INTPTR_MAX +# undef UINTPTR_MAX +# define INTPTR_MIN LONG_MIN +# define INTPTR_MAX LONG_MAX +# define UINTPTR_MAX ULONG_MAX + +/* 7.18.2.5. Limits of greatest-width integer types */ + +# ifndef INTMAX_MAX +# undef INTMAX_MIN +# ifdef INT64_MAX +# define INTMAX_MIN INT64_MIN +# define INTMAX_MAX INT64_MAX +# else +# define INTMAX_MIN INT32_MIN +# define INTMAX_MAX INT32_MAX +# endif +# endif + +# ifndef UINTMAX_MAX +# ifdef UINT64_MAX +# define UINTMAX_MAX UINT64_MAX +# else +# define UINTMAX_MAX UINT32_MAX +# endif +# endif + +/* 7.18.3. Limits of other integer types */ + +/* ptrdiff_t limits */ +# undef PTRDIFF_MIN +# undef PTRDIFF_MAX +# if @APPLE_UNIVERSAL_BUILD@ +# ifdef _LP64 +# define PTRDIFF_MIN _STDINT_SIGNED_MIN (64, 0l) +# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l) +# else +# define PTRDIFF_MIN _STDINT_SIGNED_MIN (32, 0) +# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0) +# endif +# else +# define PTRDIFF_MIN \ + _STDINT_SIGNED_MIN (@BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) +# define PTRDIFF_MAX \ + _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) +# endif + +/* sig_atomic_t limits */ +# undef SIG_ATOMIC_MIN +# undef SIG_ATOMIC_MAX +# if @HAVE_SIGNED_SIG_ATOMIC_T@ +# define SIG_ATOMIC_MIN \ + _STDINT_SIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, 0@SIG_ATOMIC_T_SUFFIX@) +# else +# define SIG_ATOMIC_MIN \ + _STDINT_UNSIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, 0@SIG_ATOMIC_T_SUFFIX@) +# endif +# define SIG_ATOMIC_MAX \ + _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ + 0@SIG_ATOMIC_T_SUFFIX@) + + +/* size_t limit */ +# undef SIZE_MAX +# if @APPLE_UNIVERSAL_BUILD@ +# ifdef _LP64 +# define SIZE_MAX _STDINT_MAX (0, 64, 0ul) +# else +# define SIZE_MAX _STDINT_MAX (0, 32, 0ul) +# endif +# else +# define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) +# endif + +/* wchar_t limits */ +/* Get WCHAR_MIN, WCHAR_MAX. + This include is not on the top, above, because on OSF/1 4.0 we have a + sequence of nested includes + <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes + <stdint.h> and assumes its types are already defined. */ +# if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX) + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +# include <stddef.h> +# include <stdio.h> +# include <time.h> +# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H +# include <wchar.h> +# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H +# endif +# undef WCHAR_MIN +# undef WCHAR_MAX +# if @HAVE_SIGNED_WCHAR_T@ +# define WCHAR_MIN \ + _STDINT_SIGNED_MIN (@BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) +# else +# define WCHAR_MIN \ + _STDINT_UNSIGNED_MIN (@BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) +# endif +# define WCHAR_MAX \ + _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) + +/* wint_t limits */ +# undef WINT_MIN +# undef WINT_MAX +# if @HAVE_SIGNED_WINT_T@ +# define WINT_MIN \ + _STDINT_SIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) +# else +# define WINT_MIN \ + _STDINT_UNSIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) +# endif +# define WINT_MAX \ + _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) + +/* 7.18.4. Macros for integer constants */ + +/* 7.18.4.1. Macros for minimum-width integer constants */ +/* According to ISO C 99 Technical Corrigendum 1 */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */ + +# undef INT8_C +# undef UINT8_C +# define INT8_C(x) x +# define UINT8_C(x) x + +# undef INT16_C +# undef UINT16_C +# define INT16_C(x) x +# define UINT16_C(x) x + +# undef INT32_C +# undef UINT32_C +# define INT32_C(x) x +# define UINT32_C(x) x ## U + +# undef INT64_C +# undef UINT64_C +# if LONG_MAX >> 31 >> 31 == 1 +# define INT64_C(x) x##L +# elif defined _MSC_VER +# define INT64_C(x) x##i64 +# elif @HAVE_LONG_LONG_INT@ +# define INT64_C(x) x##LL +# endif +# if ULONG_MAX >> 31 >> 31 >> 1 == 1 +# define UINT64_C(x) x##UL +# elif defined _MSC_VER +# define UINT64_C(x) x##ui64 +# elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# define UINT64_C(x) x##ULL +# endif + +/* 7.18.4.2. Macros for greatest-width integer constants */ + +# ifndef INTMAX_C +# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# define INTMAX_C(x) x##LL +# elif defined GL_INT64_T +# define INTMAX_C(x) INT64_C(x) +# else +# define INTMAX_C(x) x##L +# endif +# endif + +# ifndef UINTMAX_C +# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define UINTMAX_C(x) x##ULL +# elif defined GL_UINT64_T +# define UINTMAX_C(x) UINT64_C(x) +# else +# define UINTMAX_C(x) x##UL +# endif +# endif + +#endif /* !@HAVE_C99_STDINT_H@ */ + +/* Macros specified by ISO/IEC TS 18661-1:2014. */ + +#if (!defined UINTMAX_WIDTH \ + && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__)) +# ifdef INT8_MAX +# define INT8_WIDTH _GL_INTEGER_WIDTH (INT8_MIN, INT8_MAX) +# endif +# ifdef UINT8_MAX +# define UINT8_WIDTH _GL_INTEGER_WIDTH (0, UINT8_MAX) +# endif +# ifdef INT16_MAX +# define INT16_WIDTH _GL_INTEGER_WIDTH (INT16_MIN, INT16_MAX) +# endif +# ifdef UINT16_MAX +# define UINT16_WIDTH _GL_INTEGER_WIDTH (0, UINT16_MAX) +# endif +# ifdef INT32_MAX +# define INT32_WIDTH _GL_INTEGER_WIDTH (INT32_MIN, INT32_MAX) +# endif +# ifdef UINT32_MAX +# define UINT32_WIDTH _GL_INTEGER_WIDTH (0, UINT32_MAX) +# endif +# ifdef INT64_MAX +# define INT64_WIDTH _GL_INTEGER_WIDTH (INT64_MIN, INT64_MAX) +# endif +# ifdef UINT64_MAX +# define UINT64_WIDTH _GL_INTEGER_WIDTH (0, UINT64_MAX) +# endif +# define INT_LEAST8_WIDTH _GL_INTEGER_WIDTH (INT_LEAST8_MIN, INT_LEAST8_MAX) +# define UINT_LEAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST8_MAX) +# define INT_LEAST16_WIDTH _GL_INTEGER_WIDTH (INT_LEAST16_MIN, INT_LEAST16_MAX) +# define UINT_LEAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST16_MAX) +# define INT_LEAST32_WIDTH _GL_INTEGER_WIDTH (INT_LEAST32_MIN, INT_LEAST32_MAX) +# define UINT_LEAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST32_MAX) +# define INT_LEAST64_WIDTH _GL_INTEGER_WIDTH (INT_LEAST64_MIN, INT_LEAST64_MAX) +# define UINT_LEAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST64_MAX) +# define INT_FAST8_WIDTH _GL_INTEGER_WIDTH (INT_FAST8_MIN, INT_FAST8_MAX) +# define UINT_FAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST8_MAX) +# define INT_FAST16_WIDTH _GL_INTEGER_WIDTH (INT_FAST16_MIN, INT_FAST16_MAX) +# define UINT_FAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST16_MAX) +# define INT_FAST32_WIDTH _GL_INTEGER_WIDTH (INT_FAST32_MIN, INT_FAST32_MAX) +# define UINT_FAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST32_MAX) +# define INT_FAST64_WIDTH _GL_INTEGER_WIDTH (INT_FAST64_MIN, INT_FAST64_MAX) +# define UINT_FAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST64_MAX) +# define INTPTR_WIDTH _GL_INTEGER_WIDTH (INTPTR_MIN, INTPTR_MAX) +# define UINTPTR_WIDTH _GL_INTEGER_WIDTH (0, UINTPTR_MAX) +# define INTMAX_WIDTH _GL_INTEGER_WIDTH (INTMAX_MIN, INTMAX_MAX) +# define UINTMAX_WIDTH _GL_INTEGER_WIDTH (0, UINTMAX_MAX) +# define PTRDIFF_WIDTH _GL_INTEGER_WIDTH (PTRDIFF_MIN, PTRDIFF_MAX) +# define SIZE_WIDTH _GL_INTEGER_WIDTH (0, SIZE_MAX) +# define WCHAR_WIDTH _GL_INTEGER_WIDTH (WCHAR_MIN, WCHAR_MAX) +# ifdef WINT_MAX +# define WINT_WIDTH _GL_INTEGER_WIDTH (WINT_MIN, WINT_MAX) +# endif +# ifdef SIG_ATOMIC_MAX +# define SIG_ATOMIC_WIDTH _GL_INTEGER_WIDTH (SIG_ATOMIC_MIN, SIG_ATOMIC_MAX) +# endif +#endif /* !WINT_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */ + +#endif /* _@GUARD_PREFIX@_STDINT_H */ +#endif /* !(defined __ANDROID__ && ...) */ +#endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */ diff --git a/local/recipes/tools/diffutils/source/lib/stdio--.h b/local/recipes/tools/diffutils/source/lib/stdio--.h new file mode 100644 index 0000000000..d46d8b018e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/stdio--.h @@ -0,0 +1,41 @@ +/* Like stdio.h, but redefine some names to avoid glitches. + + Copyright (C) 2005-2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +#include <stdio.h> +#include "stdio-safer.h" + +#if GNULIB_FOPEN_SAFER +# undef fopen +# define fopen fopen_safer +#endif + +#if GNULIB_FREOPEN_SAFER +# undef freopen +# define freopen freopen_safer +#endif + +#if GNULIB_TMPFILE_SAFER +# undef tmpfile +# define tmpfile tmpfile_safer +#endif + +#if GNULIB_POPEN_SAFER +# undef popen +# define popen popen_safer +#endif diff --git a/local/recipes/tools/diffutils/source/lib/stdio-safer.h b/local/recipes/tools/diffutils/source/lib/stdio-safer.h new file mode 100644 index 0000000000..cfb5e4d7d4 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/stdio-safer.h @@ -0,0 +1,36 @@ +/* Invoke stdio functions, but avoid some glitches. + + Copyright (C) 2001, 2003, 2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +#include <stdio.h> + +#if GNULIB_FOPEN_SAFER +FILE *fopen_safer (char const *, char const *); +#endif + +#if GNULIB_FREOPEN_SAFER +FILE *freopen_safer (char const *, char const *, FILE *); +#endif + +#if GNULIB_POPEN_SAFER +FILE *popen_safer (char const *, char const *); +#endif + +#if GNULIB_TMPFILE_SAFER +FILE *tmpfile_safer (void); +#endif diff --git a/local/recipes/tools/diffutils/source/lib/stdio.in.h b/local/recipes/tools/diffutils/source/lib/stdio.in.h new file mode 100644 index 0000000000..d706377f98 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/stdio.in.h @@ -0,0 +1,1377 @@ +/* A GNU-like <stdio.h>. + + Copyright (C) 2004, 2007-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H +/* Special invocation convention: + - Inside glibc header files. + - On OSF/1 5.1 we have a sequence of nested includes + <stdio.h> -> <getopt.h> -> <ctype.h> -> <sys/localedef.h> -> + <sys/lc_core.h> -> <nl_types.h> -> <mesg.h> -> <stdio.h>. + In this situation, the functions are not yet declared, therefore we cannot + provide the C++ aliases. */ + +#@INCLUDE_NEXT@ @NEXT_STDIO_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_STDIO_H + +#define _GL_ALREADY_INCLUDING_STDIO_H + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_STDIO_H@ + +#undef _GL_ALREADY_INCLUDING_STDIO_H + +#ifndef _@GUARD_PREFIX@_STDIO_H +#define _@GUARD_PREFIX@_STDIO_H + +/* Get va_list. Needed on many systems, including glibc 2.8. */ +#include <stdarg.h> + +#include <stddef.h> + +/* Get off_t and ssize_t. Needed on many systems, including glibc 2.8 + and eglibc 2.11.2. + May also define off_t to a 64-bit type on native Windows. */ +#include <sys/types.h> + +/* The __attribute__ feature is available in gcc versions 2.5 and later. + The __-protected variants of the attributes 'format' and 'printf' are + accepted by gcc versions 2.6.4 (effectively 2.7) and later. + We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because + gnulib and libintl do '#define printf __printf__' when they override + the 'printf' function. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) +#else +# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ +#endif + +/* _GL_ATTRIBUTE_FORMAT_PRINTF + indicates to GCC that the function takes a format string and arguments, + where the format string directives are the ones standardized by ISO C99 + and POSIX. */ +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) +# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \ + _GL_ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument)) +#else +# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \ + _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument)) +#endif + +/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF, + except that it indicates to GCC that the supported format string directives + are the ones of the system printf(), rather than the ones standardized by + ISO C99 and POSIX. */ +#if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU +# define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \ + _GL_ATTRIBUTE_FORMAT_PRINTF (formatstring_parameter, first_argument) +#else +# define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \ + _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument)) +#endif + +/* _GL_ATTRIBUTE_FORMAT_SCANF + indicates to GCC that the function takes a format string and arguments, + where the format string directives are the ones standardized by ISO C99 + and POSIX. */ +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) +# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \ + _GL_ATTRIBUTE_FORMAT ((__gnu_scanf__, formatstring_parameter, first_argument)) +#else +# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \ + _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument)) +#endif + +/* _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_SCANF, + except that it indicates to GCC that the supported format string directives + are the ones of the system scanf(), rather than the ones standardized by + ISO C99 and POSIX. */ +#define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, first_argument) \ + _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument)) + +/* Solaris 10 declares renameat in <unistd.h>, not in <stdio.h>. */ +/* But in any case avoid namespace pollution on glibc systems. */ +#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __sun \ + && ! defined __GLIBC__ +# include <unistd.h> +#endif + +/* MSVC declares 'perror' in <stdlib.h>, not in <stdio.h>. We must include + it before we #define perror rpl_perror. */ +/* But in any case avoid namespace pollution on glibc systems. */ +#if (@GNULIB_PERROR@ || defined GNULIB_POSIXCHECK) \ + && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \ + && ! defined __GLIBC__ +# include <stdlib.h> +#endif + +/* MSVC declares 'remove' in <io.h>, not in <stdio.h>. We must include + it before we #define remove rpl_remove. */ +/* MSVC declares 'rename' in <io.h>, not in <stdio.h>. We must include + it before we #define rename rpl_rename. */ +/* But in any case avoid namespace pollution on glibc systems. */ +#if (@GNULIB_REMOVE@ || @GNULIB_RENAME@ || defined GNULIB_POSIXCHECK) \ + && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \ + && ! defined __GLIBC__ +# include <io.h> +#endif + + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +/* Macros for stringification. */ +#define _GL_STDIO_STRINGIZE(token) #token +#define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token) + +/* When also using extern inline, suppress the use of static inline in + standard headers of problematic Apple configurations, as Libc at + least through Libc-825.26 (2013-04-09) mishandles it; see, e.g., + <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>. + Perhaps Apple will fix this some day. */ +#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \ + && defined __GNUC__ && defined __STDC__) +# undef putc_unlocked +#endif + +#if @GNULIB_DPRINTF@ +# if @REPLACE_DPRINTF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define dprintf rpl_dprintf +# endif +_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *format, ...) + _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *format, ...)); +# else +# if !@HAVE_DPRINTF@ +_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *format, ...) + _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *format, ...)); +# endif +_GL_CXXALIASWARN (dprintf); +#elif defined GNULIB_POSIXCHECK +# undef dprintf +# if HAVE_RAW_DECL_DPRINTF +_GL_WARN_ON_USE (dprintf, "dprintf is unportable - " + "use gnulib module dprintf for portability"); +# endif +#endif + +#if @GNULIB_FCLOSE@ +/* Close STREAM and its underlying file descriptor. */ +# if @REPLACE_FCLOSE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define fclose rpl_fclose +# endif +_GL_FUNCDECL_RPL (fclose, int, (FILE *stream) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (fclose, int, (FILE *stream)); +# else +_GL_CXXALIAS_SYS (fclose, int, (FILE *stream)); +# endif +_GL_CXXALIASWARN (fclose); +#elif defined GNULIB_POSIXCHECK +# undef fclose +/* Assume fclose is always declared. */ +_GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - " + "use gnulib module fclose for portable POSIX compliance"); +#endif + +#if @GNULIB_FDOPEN@ +# if @REPLACE_FDOPEN@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fdopen +# define fdopen rpl_fdopen +# endif +_GL_FUNCDECL_RPL (fdopen, FILE *, (int fd, const char *mode) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode)); +# else +_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode)); +# endif +_GL_CXXALIASWARN (fdopen); +#elif defined GNULIB_POSIXCHECK +# undef fdopen +/* Assume fdopen is always declared. */ +_GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX compliant - " + "use gnulib module fdopen for portability"); +#endif + +#if @GNULIB_FFLUSH@ +/* Flush all pending data on STREAM according to POSIX rules. Both + output and seekable input streams are supported. + Note! LOSS OF DATA can occur if fflush is applied on an input stream + that is _not_seekable_ or on an update stream that is _not_seekable_ + and in which the most recent operation was input. Seekability can + be tested with lseek(fileno(fp),0,SEEK_CUR). */ +# if @REPLACE_FFLUSH@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define fflush rpl_fflush +# endif +_GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream)); +_GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream)); +# else +_GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream)); +# endif +_GL_CXXALIASWARN (fflush); +#elif defined GNULIB_POSIXCHECK +# undef fflush +/* Assume fflush is always declared. */ +_GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - " + "use gnulib module fflush for portable POSIX compliance"); +#endif + +#if @GNULIB_FGETC@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fgetc +# define fgetc rpl_fgetc +# endif +_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (fgetc, int, (FILE *stream)); +# else +_GL_CXXALIAS_SYS (fgetc, int, (FILE *stream)); +# endif +_GL_CXXALIASWARN (fgetc); +#endif + +#if @GNULIB_FGETS@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fgets +# define fgets rpl_fgets +# endif +_GL_FUNCDECL_RPL (fgets, char *, (char *s, int n, FILE *stream) + _GL_ARG_NONNULL ((1, 3))); +_GL_CXXALIAS_RPL (fgets, char *, (char *s, int n, FILE *stream)); +# else +_GL_CXXALIAS_SYS (fgets, char *, (char *s, int n, FILE *stream)); +# endif +_GL_CXXALIASWARN (fgets); +#endif + +#if @GNULIB_FOPEN@ +# if @REPLACE_FOPEN@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fopen +# define fopen rpl_fopen +# endif +_GL_FUNCDECL_RPL (fopen, FILE *, (const char *filename, const char *mode) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (fopen, FILE *, (const char *filename, const char *mode)); +# else +_GL_CXXALIAS_SYS (fopen, FILE *, (const char *filename, const char *mode)); +# endif +_GL_CXXALIASWARN (fopen); +#elif defined GNULIB_POSIXCHECK +# undef fopen +/* Assume fopen is always declared. */ +_GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX compliant - " + "use gnulib module fopen for portability"); +#endif + +#if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@ +# if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \ + || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)) +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define fprintf rpl_fprintf +# endif +# define GNULIB_overrides_fprintf 1 +# if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@ +_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...) + _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ARG_NONNULL ((1, 2))); +# else +_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...) + _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...)); +# else +_GL_CXXALIAS_SYS (fprintf, int, (FILE *fp, const char *format, ...)); +# endif +_GL_CXXALIASWARN (fprintf); +#endif +#if !@GNULIB_FPRINTF_POSIX@ && defined GNULIB_POSIXCHECK +# if !GNULIB_overrides_fprintf +# undef fprintf +# endif +/* Assume fprintf is always declared. */ +_GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - " + "use gnulib module fprintf-posix for portable " + "POSIX compliance"); +#endif + +#if @GNULIB_FPURGE@ +/* Discard all pending buffered I/O data on STREAM. + STREAM must not be wide-character oriented. + When discarding pending output, the file position is set back to where it + was before the write calls. When discarding pending input, the file + position is advanced to match the end of the previously read input. + Return 0 if successful. Upon error, return -1 and set errno. */ +# if @REPLACE_FPURGE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define fpurge rpl_fpurge +# endif +_GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (fpurge, int, (FILE *gl_stream)); +# else +# if !@HAVE_DECL_FPURGE@ +_GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream)); +# endif +_GL_CXXALIASWARN (fpurge); +#elif defined GNULIB_POSIXCHECK +# undef fpurge +# if HAVE_RAW_DECL_FPURGE +_GL_WARN_ON_USE (fpurge, "fpurge is not always present - " + "use gnulib module fpurge for portability"); +# endif +#endif + +#if @GNULIB_FPUTC@ +# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@) +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fputc +# define fputc rpl_fputc +# endif +_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream)); +# else +_GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream)); +# endif +_GL_CXXALIASWARN (fputc); +#endif + +#if @GNULIB_FPUTS@ +# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@) +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fputs +# define fputs rpl_fputs +# endif +_GL_FUNCDECL_RPL (fputs, int, (const char *string, FILE *stream) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (fputs, int, (const char *string, FILE *stream)); +# else +_GL_CXXALIAS_SYS (fputs, int, (const char *string, FILE *stream)); +# endif +_GL_CXXALIASWARN (fputs); +#endif + +#if @GNULIB_FREAD@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fread +# define fread rpl_fread +# endif +_GL_FUNCDECL_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream) + _GL_ARG_NONNULL ((4))); +_GL_CXXALIAS_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream)); +# else +_GL_CXXALIAS_SYS (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream)); +# endif +_GL_CXXALIASWARN (fread); +#endif + +#if @GNULIB_FREOPEN@ +# if @REPLACE_FREOPEN@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef freopen +# define freopen rpl_freopen +# endif +_GL_FUNCDECL_RPL (freopen, FILE *, + (const char *filename, const char *mode, FILE *stream) + _GL_ARG_NONNULL ((2, 3))); +_GL_CXXALIAS_RPL (freopen, FILE *, + (const char *filename, const char *mode, FILE *stream)); +# else +_GL_CXXALIAS_SYS (freopen, FILE *, + (const char *filename, const char *mode, FILE *stream)); +# endif +_GL_CXXALIASWARN (freopen); +#elif defined GNULIB_POSIXCHECK +# undef freopen +/* Assume freopen is always declared. */ +_GL_WARN_ON_USE (freopen, + "freopen on native Windows platforms is not POSIX compliant - " + "use gnulib module freopen for portability"); +#endif + +#if @GNULIB_FSCANF@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fscanf +# define fscanf rpl_fscanf +# endif +_GL_FUNCDECL_RPL (fscanf, int, (FILE *stream, const char *format, ...) + _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (fscanf, int, (FILE *stream, const char *format, ...)); +# else +_GL_CXXALIAS_SYS (fscanf, int, (FILE *stream, const char *format, ...)); +# endif +_GL_CXXALIASWARN (fscanf); +#endif + + +/* Set up the following warnings, based on which modules are in use. + GNU Coding Standards discourage the use of fseek, since it imposes + an arbitrary limitation on some 32-bit hosts. Remember that the + fseek module depends on the fseeko module, so we only have three + cases to consider: + + 1. The developer is not using either module. Issue a warning under + GNULIB_POSIXCHECK for both functions, to remind them that both + functions have bugs on some systems. _GL_NO_LARGE_FILES has no + impact on this warning. + + 2. The developer is using both modules. They may be unaware of the + arbitrary limitations of fseek, so issue a warning under + GNULIB_POSIXCHECK. On the other hand, they may be using both + modules intentionally, so the developer can define + _GL_NO_LARGE_FILES in the compilation units where the use of fseek + is safe, to silence the warning. + + 3. The developer is using the fseeko module, but not fseek. Gnulib + guarantees that fseek will still work around platform bugs in that + case, but we presume that the developer is aware of the pitfalls of + fseek and was trying to avoid it, so issue a warning even when + GNULIB_POSIXCHECK is undefined. Again, _GL_NO_LARGE_FILES can be + defined to silence the warning in particular compilation units. + In C++ compilations with GNULIB_NAMESPACE, in order to avoid that + fseek gets defined as a macro, it is recommended that the developer + uses the fseek module, even if he is not calling the fseek function. + + Most gnulib clients that perform stream operations should fall into + category 3. */ + +#if @GNULIB_FSEEK@ +# if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES +# define _GL_FSEEK_WARN /* Category 2, above. */ +# undef fseek +# endif +# if @REPLACE_FSEEK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fseek +# define fseek rpl_fseek +# endif +_GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence)); +# else +_GL_CXXALIAS_SYS (fseek, int, (FILE *fp, long offset, int whence)); +# endif +_GL_CXXALIASWARN (fseek); +#endif + +#if @GNULIB_FSEEKO@ +# if !@GNULIB_FSEEK@ && !defined _GL_NO_LARGE_FILES +# define _GL_FSEEK_WARN /* Category 3, above. */ +# undef fseek +# endif +# if @REPLACE_FSEEKO@ +/* Provide an fseeko function that is aware of a preceding fflush(), and which + detects pipes. */ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fseeko +# define fseeko rpl_fseeko +# endif +_GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)); +# else +# if ! @HAVE_DECL_FSEEKO@ +_GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)); +# endif +_GL_CXXALIASWARN (fseeko); +#elif defined GNULIB_POSIXCHECK +# define _GL_FSEEK_WARN /* Category 1, above. */ +# undef fseek +# undef fseeko +# if HAVE_RAW_DECL_FSEEKO +_GL_WARN_ON_USE (fseeko, "fseeko is unportable - " + "use gnulib module fseeko for portability"); +# endif +#endif + +#ifdef _GL_FSEEK_WARN +# undef _GL_FSEEK_WARN +/* Here, either fseek is undefined (but C89 guarantees that it is + declared), or it is defined as rpl_fseek (declared above). */ +_GL_WARN_ON_USE (fseek, "fseek cannot handle files larger than 4 GB " + "on 32-bit platforms - " + "use fseeko function for handling of large files"); +#endif + + +/* ftell, ftello. See the comments on fseek/fseeko. */ + +#if @GNULIB_FTELL@ +# if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES +# define _GL_FTELL_WARN /* Category 2, above. */ +# undef ftell +# endif +# if @REPLACE_FTELL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef ftell +# define ftell rpl_ftell +# endif +_GL_FUNCDECL_RPL (ftell, long, (FILE *fp) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (ftell, long, (FILE *fp)); +# else +_GL_CXXALIAS_SYS (ftell, long, (FILE *fp)); +# endif +_GL_CXXALIASWARN (ftell); +#endif + +#if @GNULIB_FTELLO@ +# if !@GNULIB_FTELL@ && !defined _GL_NO_LARGE_FILES +# define _GL_FTELL_WARN /* Category 3, above. */ +# undef ftell +# endif +# if @REPLACE_FTELLO@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef ftello +# define ftello rpl_ftello +# endif +_GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp)); +# else +# if ! @HAVE_DECL_FTELLO@ +_GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp)); +# endif +_GL_CXXALIASWARN (ftello); +#elif defined GNULIB_POSIXCHECK +# define _GL_FTELL_WARN /* Category 1, above. */ +# undef ftell +# undef ftello +# if HAVE_RAW_DECL_FTELLO +_GL_WARN_ON_USE (ftello, "ftello is unportable - " + "use gnulib module ftello for portability"); +# endif +#endif + +#ifdef _GL_FTELL_WARN +# undef _GL_FTELL_WARN +/* Here, either ftell is undefined (but C89 guarantees that it is + declared), or it is defined as rpl_ftell (declared above). */ +_GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB " + "on 32-bit platforms - " + "use ftello function for handling of large files"); +#endif + + +#if @GNULIB_FWRITE@ +# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@) +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fwrite +# define fwrite rpl_fwrite +# endif +_GL_FUNCDECL_RPL (fwrite, size_t, + (const void *ptr, size_t s, size_t n, FILE *stream) + _GL_ARG_NONNULL ((1, 4))); +_GL_CXXALIAS_RPL (fwrite, size_t, + (const void *ptr, size_t s, size_t n, FILE *stream)); +# else +_GL_CXXALIAS_SYS (fwrite, size_t, + (const void *ptr, size_t s, size_t n, FILE *stream)); + +/* Work around bug 11959 when fortifying glibc 2.4 through 2.15 + <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>, + which sometimes causes an unwanted diagnostic for fwrite calls. + This affects only function declaration attributes under certain + versions of gcc and clang, and is not needed for C++. */ +# if (0 < __USE_FORTIFY_LEVEL \ + && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \ + && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \ + && !defined __cplusplus) +# undef fwrite +# undef fwrite_unlocked +extern size_t __REDIRECT (rpl_fwrite, + (const void *__restrict, size_t, size_t, + FILE *__restrict), + fwrite); +extern size_t __REDIRECT (rpl_fwrite_unlocked, + (const void *__restrict, size_t, size_t, + FILE *__restrict), + fwrite_unlocked); +# define fwrite rpl_fwrite +# define fwrite_unlocked rpl_fwrite_unlocked +# endif +# endif +_GL_CXXALIASWARN (fwrite); +#endif + +#if @GNULIB_GETC@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getc +# define getc rpl_fgetc +# endif +_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream)); +# else +_GL_CXXALIAS_SYS (getc, int, (FILE *stream)); +# endif +_GL_CXXALIASWARN (getc); +#endif + +#if @GNULIB_GETCHAR@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getchar +# define getchar rpl_getchar +# endif +_GL_FUNCDECL_RPL (getchar, int, (void)); +_GL_CXXALIAS_RPL (getchar, int, (void)); +# else +_GL_CXXALIAS_SYS (getchar, int, (void)); +# endif +_GL_CXXALIASWARN (getchar); +#endif + +#if @GNULIB_GETDELIM@ +/* Read input, up to (and including) the next occurrence of DELIMITER, from + STREAM, store it in *LINEPTR (and NUL-terminate it). + *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE + bytes of space. It is realloc'd as necessary. + Return the number of bytes read and stored at *LINEPTR (not including the + NUL terminator), or -1 on error or EOF. */ +# if @REPLACE_GETDELIM@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getdelim +# define getdelim rpl_getdelim +# endif +_GL_FUNCDECL_RPL (getdelim, ssize_t, + (char **lineptr, size_t *linesize, int delimiter, + FILE *stream) + _GL_ARG_NONNULL ((1, 2, 4))); +_GL_CXXALIAS_RPL (getdelim, ssize_t, + (char **lineptr, size_t *linesize, int delimiter, + FILE *stream)); +# else +# if !@HAVE_DECL_GETDELIM@ +_GL_FUNCDECL_SYS (getdelim, ssize_t, + (char **lineptr, size_t *linesize, int delimiter, + FILE *stream) + _GL_ARG_NONNULL ((1, 2, 4))); +# endif +_GL_CXXALIAS_SYS (getdelim, ssize_t, + (char **lineptr, size_t *linesize, int delimiter, + FILE *stream)); +# endif +_GL_CXXALIASWARN (getdelim); +#elif defined GNULIB_POSIXCHECK +# undef getdelim +# if HAVE_RAW_DECL_GETDELIM +_GL_WARN_ON_USE (getdelim, "getdelim is unportable - " + "use gnulib module getdelim for portability"); +# endif +#endif + +#if @GNULIB_GETLINE@ +/* Read a line, up to (and including) the next newline, from STREAM, store it + in *LINEPTR (and NUL-terminate it). + *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE + bytes of space. It is realloc'd as necessary. + Return the number of bytes read and stored at *LINEPTR (not including the + NUL terminator), or -1 on error or EOF. */ +# if @REPLACE_GETLINE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getline +# define getline rpl_getline +# endif +_GL_FUNCDECL_RPL (getline, ssize_t, + (char **lineptr, size_t *linesize, FILE *stream) + _GL_ARG_NONNULL ((1, 2, 3))); +_GL_CXXALIAS_RPL (getline, ssize_t, + (char **lineptr, size_t *linesize, FILE *stream)); +# else +# if !@HAVE_DECL_GETLINE@ +_GL_FUNCDECL_SYS (getline, ssize_t, + (char **lineptr, size_t *linesize, FILE *stream) + _GL_ARG_NONNULL ((1, 2, 3))); +# endif +_GL_CXXALIAS_SYS (getline, ssize_t, + (char **lineptr, size_t *linesize, FILE *stream)); +# endif +# if @HAVE_DECL_GETLINE@ +_GL_CXXALIASWARN (getline); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getline +# if HAVE_RAW_DECL_GETLINE +_GL_WARN_ON_USE (getline, "getline is unportable - " + "use gnulib module getline for portability"); +# endif +#endif + +/* It is very rare that the developer ever has full control of stdin, + so any use of gets warrants an unconditional warning; besides, C11 + removed it. */ +#undef gets +#if HAVE_RAW_DECL_GETS && !defined __cplusplus +_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); +#endif + +#if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@ +struct obstack; +/* Grow an obstack with formatted output. Return the number of + bytes added to OBS. No trailing nul byte is added, and the + object should be closed with obstack_finish before use. Upon + memory allocation error, call obstack_alloc_failed_handler. Upon + other error, return -1. */ +# if @REPLACE_OBSTACK_PRINTF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define obstack_printf rpl_obstack_printf +# endif +_GL_FUNCDECL_RPL (obstack_printf, int, + (struct obstack *obs, const char *format, ...) + _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (obstack_printf, int, + (struct obstack *obs, const char *format, ...)); +# else +# if !@HAVE_DECL_OBSTACK_PRINTF@ +_GL_FUNCDECL_SYS (obstack_printf, int, + (struct obstack *obs, const char *format, ...) + _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (obstack_printf, int, + (struct obstack *obs, const char *format, ...)); +# endif +_GL_CXXALIASWARN (obstack_printf); +# if @REPLACE_OBSTACK_PRINTF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define obstack_vprintf rpl_obstack_vprintf +# endif +_GL_FUNCDECL_RPL (obstack_vprintf, int, + (struct obstack *obs, const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (obstack_vprintf, int, + (struct obstack *obs, const char *format, va_list args)); +# else +# if !@HAVE_DECL_OBSTACK_PRINTF@ +_GL_FUNCDECL_SYS (obstack_vprintf, int, + (struct obstack *obs, const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (obstack_vprintf, int, + (struct obstack *obs, const char *format, va_list args)); +# endif +_GL_CXXALIASWARN (obstack_vprintf); +#endif + +#if @GNULIB_PCLOSE@ +# if !@HAVE_PCLOSE@ +_GL_FUNCDECL_SYS (pclose, int, (FILE *stream) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pclose, int, (FILE *stream)); +_GL_CXXALIASWARN (pclose); +#elif defined GNULIB_POSIXCHECK +# undef pclose +# if HAVE_RAW_DECL_PCLOSE +_GL_WARN_ON_USE (pclose, "pclose is unportable - " + "use gnulib module pclose for more portability"); +# endif +#endif + +#if @GNULIB_PERROR@ +/* Print a message to standard error, describing the value of ERRNO, + (if STRING is not NULL and not empty) prefixed with STRING and ": ", + and terminated with a newline. */ +# if @REPLACE_PERROR@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define perror rpl_perror +# endif +_GL_FUNCDECL_RPL (perror, void, (const char *string)); +_GL_CXXALIAS_RPL (perror, void, (const char *string)); +# else +_GL_CXXALIAS_SYS (perror, void, (const char *string)); +# endif +_GL_CXXALIASWARN (perror); +#elif defined GNULIB_POSIXCHECK +# undef perror +/* Assume perror is always declared. */ +_GL_WARN_ON_USE (perror, "perror is not always POSIX compliant - " + "use gnulib module perror for portability"); +#endif + +#if @GNULIB_POPEN@ +# if @REPLACE_POPEN@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef popen +# define popen rpl_popen +# endif +_GL_FUNCDECL_RPL (popen, FILE *, (const char *cmd, const char *mode) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode)); +# else +# if !@HAVE_POPEN@ +_GL_FUNCDECL_SYS (popen, FILE *, (const char *cmd, const char *mode) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode)); +# endif +_GL_CXXALIASWARN (popen); +#elif defined GNULIB_POSIXCHECK +# undef popen +# if HAVE_RAW_DECL_POPEN +_GL_WARN_ON_USE (popen, "popen is buggy on some platforms - " + "use gnulib module popen or pipe for more portability"); +# endif +#endif + +#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@ +# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \ + || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)) +# if defined __GNUC__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +/* Don't break __attribute__((format(printf,M,N))). */ +# define printf __printf__ +# endif +# if @GNULIB_PRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@ +_GL_FUNCDECL_RPL_1 (__printf__, int, + (const char *format, ...) + __asm__ (@ASM_SYMBOL_PREFIX@ + _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf)) + _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2) + _GL_ARG_NONNULL ((1))); +# else +_GL_FUNCDECL_RPL_1 (__printf__, int, + (const char *format, ...) + __asm__ (@ASM_SYMBOL_PREFIX@ + _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf)) + _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...)); +# else +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define printf rpl_printf +# endif +_GL_FUNCDECL_RPL (printf, int, + (const char *format, ...) + _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (printf, int, (const char *format, ...)); +# endif +# define GNULIB_overrides_printf 1 +# else +_GL_CXXALIAS_SYS (printf, int, (const char *format, ...)); +# endif +_GL_CXXALIASWARN (printf); +#endif +#if !@GNULIB_PRINTF_POSIX@ && defined GNULIB_POSIXCHECK +# if !GNULIB_overrides_printf +# undef printf +# endif +/* Assume printf is always declared. */ +_GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - " + "use gnulib module printf-posix for portable " + "POSIX compliance"); +#endif + +#if @GNULIB_PUTC@ +# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@) +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef putc +# define putc rpl_fputc +# endif +_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream)); +# else +_GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream)); +# endif +_GL_CXXALIASWARN (putc); +#endif + +#if @GNULIB_PUTCHAR@ +# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@) +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef putchar +# define putchar rpl_putchar +# endif +_GL_FUNCDECL_RPL (putchar, int, (int c)); +_GL_CXXALIAS_RPL (putchar, int, (int c)); +# else +_GL_CXXALIAS_SYS (putchar, int, (int c)); +# endif +_GL_CXXALIASWARN (putchar); +#endif + +#if @GNULIB_PUTS@ +# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@) +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef puts +# define puts rpl_puts +# endif +_GL_FUNCDECL_RPL (puts, int, (const char *string) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (puts, int, (const char *string)); +# else +_GL_CXXALIAS_SYS (puts, int, (const char *string)); +# endif +_GL_CXXALIASWARN (puts); +#endif + +#if @GNULIB_REMOVE@ +# if @REPLACE_REMOVE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef remove +# define remove rpl_remove +# endif +_GL_FUNCDECL_RPL (remove, int, (const char *name) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (remove, int, (const char *name)); +# else +_GL_CXXALIAS_SYS (remove, int, (const char *name)); +# endif +_GL_CXXALIASWARN (remove); +#elif defined GNULIB_POSIXCHECK +# undef remove +/* Assume remove is always declared. */ +_GL_WARN_ON_USE (remove, "remove cannot handle directories on some platforms - " + "use gnulib module remove for more portability"); +#endif + +#if @GNULIB_RENAME@ +# if @REPLACE_RENAME@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef rename +# define rename rpl_rename +# endif +_GL_FUNCDECL_RPL (rename, int, + (const char *old_filename, const char *new_filename) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (rename, int, + (const char *old_filename, const char *new_filename)); +# else +_GL_CXXALIAS_SYS (rename, int, + (const char *old_filename, const char *new_filename)); +# endif +_GL_CXXALIASWARN (rename); +#elif defined GNULIB_POSIXCHECK +# undef rename +/* Assume rename is always declared. */ +_GL_WARN_ON_USE (rename, "rename is buggy on some platforms - " + "use gnulib module rename for more portability"); +#endif + +#if @GNULIB_RENAMEAT@ +# if @REPLACE_RENAMEAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef renameat +# define renameat rpl_renameat +# endif +_GL_FUNCDECL_RPL (renameat, int, + (int fd1, char const *file1, int fd2, char const *file2) + _GL_ARG_NONNULL ((2, 4))); +_GL_CXXALIAS_RPL (renameat, int, + (int fd1, char const *file1, int fd2, char const *file2)); +# else +# if !@HAVE_RENAMEAT@ +_GL_FUNCDECL_SYS (renameat, int, + (int fd1, char const *file1, int fd2, char const *file2) + _GL_ARG_NONNULL ((2, 4))); +# endif +_GL_CXXALIAS_SYS (renameat, int, + (int fd1, char const *file1, int fd2, char const *file2)); +# endif +_GL_CXXALIASWARN (renameat); +#elif defined GNULIB_POSIXCHECK +# undef renameat +# if HAVE_RAW_DECL_RENAMEAT +_GL_WARN_ON_USE (renameat, "renameat is not portable - " + "use gnulib module renameat for portability"); +# endif +#endif + +#if @GNULIB_SCANF@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if defined __GNUC__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef scanf +/* Don't break __attribute__((format(scanf,M,N))). */ +# define scanf __scanf__ +# endif +_GL_FUNCDECL_RPL_1 (__scanf__, int, + (const char *format, ...) + __asm__ (@ASM_SYMBOL_PREFIX@ + _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf)) + _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *format, ...)); +# else +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef scanf +# define scanf rpl_scanf +# endif +_GL_FUNCDECL_RPL (scanf, int, (const char *format, ...) + _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (scanf, int, (const char *format, ...)); +# endif +# else +_GL_CXXALIAS_SYS (scanf, int, (const char *format, ...)); +# endif +_GL_CXXALIASWARN (scanf); +#endif + +#if @GNULIB_SNPRINTF@ +# if @REPLACE_SNPRINTF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define snprintf rpl_snprintf +# endif +_GL_FUNCDECL_RPL (snprintf, int, + (char *str, size_t size, const char *format, ...) + _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4) + _GL_ARG_NONNULL ((3))); +_GL_CXXALIAS_RPL (snprintf, int, + (char *str, size_t size, const char *format, ...)); +# else +# if !@HAVE_DECL_SNPRINTF@ +_GL_FUNCDECL_SYS (snprintf, int, + (char *str, size_t size, const char *format, ...) + _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4) + _GL_ARG_NONNULL ((3))); +# endif +_GL_CXXALIAS_SYS (snprintf, int, + (char *str, size_t size, const char *format, ...)); +# endif +_GL_CXXALIASWARN (snprintf); +#elif defined GNULIB_POSIXCHECK +# undef snprintf +# if HAVE_RAW_DECL_SNPRINTF +_GL_WARN_ON_USE (snprintf, "snprintf is unportable - " + "use gnulib module snprintf for portability"); +# endif +#endif + +/* Some people would argue that all sprintf uses should be warned about + (for example, OpenBSD issues a link warning for it), + since it can cause security holes due to buffer overruns. + However, we believe that sprintf can be used safely, and is more + efficient than snprintf in those safe cases; and as proof of our + belief, we use sprintf in several gnulib modules. So this header + intentionally avoids adding a warning to sprintf except when + GNULIB_POSIXCHECK is defined. */ + +#if @GNULIB_SPRINTF_POSIX@ +# if @REPLACE_SPRINTF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define sprintf rpl_sprintf +# endif +_GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...) + _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...)); +# else +_GL_CXXALIAS_SYS (sprintf, int, (char *str, const char *format, ...)); +# endif +_GL_CXXALIASWARN (sprintf); +#elif defined GNULIB_POSIXCHECK +# undef sprintf +/* Assume sprintf is always declared. */ +_GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - " + "use gnulib module sprintf-posix for portable " + "POSIX compliance"); +#endif + +#if @GNULIB_TMPFILE@ +# if @REPLACE_TMPFILE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define tmpfile rpl_tmpfile +# endif +_GL_FUNCDECL_RPL (tmpfile, FILE *, (void)); +_GL_CXXALIAS_RPL (tmpfile, FILE *, (void)); +# else +_GL_CXXALIAS_SYS (tmpfile, FILE *, (void)); +# endif +_GL_CXXALIASWARN (tmpfile); +#elif defined GNULIB_POSIXCHECK +# undef tmpfile +# if HAVE_RAW_DECL_TMPFILE +_GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - " + "use gnulib module tmpfile for portability"); +# endif +#endif + +#if @GNULIB_VASPRINTF@ +/* Write formatted output to a string dynamically allocated with malloc(). + If the memory allocation succeeds, store the address of the string in + *RESULT and return the number of resulting bytes, excluding the trailing + NUL. Upon memory allocation error, or some other error, return -1. */ +# if @REPLACE_VASPRINTF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define asprintf rpl_asprintf +# endif +_GL_FUNCDECL_RPL (asprintf, int, + (char **result, const char *format, ...) + _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (asprintf, int, + (char **result, const char *format, ...)); +# else +# if !@HAVE_VASPRINTF@ +_GL_FUNCDECL_SYS (asprintf, int, + (char **result, const char *format, ...) + _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (asprintf, int, + (char **result, const char *format, ...)); +# endif +_GL_CXXALIASWARN (asprintf); +# if @REPLACE_VASPRINTF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define vasprintf rpl_vasprintf +# endif +_GL_FUNCDECL_RPL (vasprintf, int, + (char **result, const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (vasprintf, int, + (char **result, const char *format, va_list args)); +# else +# if !@HAVE_VASPRINTF@ +_GL_FUNCDECL_SYS (vasprintf, int, + (char **result, const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (vasprintf, int, + (char **result, const char *format, va_list args)); +# endif +_GL_CXXALIASWARN (vasprintf); +#endif + +#if @GNULIB_VDPRINTF@ +# if @REPLACE_VDPRINTF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define vdprintf rpl_vdprintf +# endif +_GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *format, va_list args)); +# else +# if !@HAVE_VDPRINTF@ +_GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ARG_NONNULL ((2))); +# endif +/* Need to cast, because on Solaris, the third parameter will likely be + __va_list args. */ +_GL_CXXALIAS_SYS_CAST (vdprintf, int, + (int fd, const char *format, va_list args)); +# endif +_GL_CXXALIASWARN (vdprintf); +#elif defined GNULIB_POSIXCHECK +# undef vdprintf +# if HAVE_RAW_DECL_VDPRINTF +_GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - " + "use gnulib module vdprintf for portability"); +# endif +#endif + +#if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@ +# if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \ + || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)) +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define vfprintf rpl_vfprintf +# endif +# define GNULIB_overrides_vfprintf 1 +# if @GNULIB_VFPRINTF_POSIX@ +_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ARG_NONNULL ((1, 2))); +# else +_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)); +# else +/* Need to cast, because on Solaris, the third parameter is + __va_list args + and GCC's fixincludes did not change this to __gnuc_va_list. */ +_GL_CXXALIAS_SYS_CAST (vfprintf, int, + (FILE *fp, const char *format, va_list args)); +# endif +_GL_CXXALIASWARN (vfprintf); +#endif +#if !@GNULIB_VFPRINTF_POSIX@ && defined GNULIB_POSIXCHECK +# if !GNULIB_overrides_vfprintf +# undef vfprintf +# endif +/* Assume vfprintf is always declared. */ +_GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - " + "use gnulib module vfprintf-posix for portable " + "POSIX compliance"); +#endif + +#if @GNULIB_VFSCANF@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef vfscanf +# define vfscanf rpl_vfscanf +# endif +_GL_FUNCDECL_RPL (vfscanf, int, + (FILE *stream, const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (vfscanf, int, + (FILE *stream, const char *format, va_list args)); +# else +_GL_CXXALIAS_SYS (vfscanf, int, + (FILE *stream, const char *format, va_list args)); +# endif +_GL_CXXALIASWARN (vfscanf); +#endif + +#if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@ +# if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \ + || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)) +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define vprintf rpl_vprintf +# endif +# define GNULIB_overrides_vprintf 1 +# if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@ +_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0) + _GL_ARG_NONNULL ((1))); +# else +_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args)); +# else +/* Need to cast, because on Solaris, the second parameter is + __va_list args + and GCC's fixincludes did not change this to __gnuc_va_list. */ +_GL_CXXALIAS_SYS_CAST (vprintf, int, (const char *format, va_list args)); +# endif +_GL_CXXALIASWARN (vprintf); +#endif +#if !@GNULIB_VPRINTF_POSIX@ && defined GNULIB_POSIXCHECK +# if !GNULIB_overrides_vprintf +# undef vprintf +# endif +/* Assume vprintf is always declared. */ +_GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - " + "use gnulib module vprintf-posix for portable " + "POSIX compliance"); +#endif + +#if @GNULIB_VSCANF@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef vscanf +# define vscanf rpl_vscanf +# endif +_GL_FUNCDECL_RPL (vscanf, int, (const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (vscanf, int, (const char *format, va_list args)); +# else +_GL_CXXALIAS_SYS (vscanf, int, (const char *format, va_list args)); +# endif +_GL_CXXALIASWARN (vscanf); +#endif + +#if @GNULIB_VSNPRINTF@ +# if @REPLACE_VSNPRINTF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define vsnprintf rpl_vsnprintf +# endif +_GL_FUNCDECL_RPL (vsnprintf, int, + (char *str, size_t size, const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) + _GL_ARG_NONNULL ((3))); +_GL_CXXALIAS_RPL (vsnprintf, int, + (char *str, size_t size, const char *format, va_list args)); +# else +# if !@HAVE_DECL_VSNPRINTF@ +_GL_FUNCDECL_SYS (vsnprintf, int, + (char *str, size_t size, const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) + _GL_ARG_NONNULL ((3))); +# endif +_GL_CXXALIAS_SYS (vsnprintf, int, + (char *str, size_t size, const char *format, va_list args)); +# endif +_GL_CXXALIASWARN (vsnprintf); +#elif defined GNULIB_POSIXCHECK +# undef vsnprintf +# if HAVE_RAW_DECL_VSNPRINTF +_GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - " + "use gnulib module vsnprintf for portability"); +# endif +#endif + +#if @GNULIB_VSPRINTF_POSIX@ +# if @REPLACE_VSPRINTF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define vsprintf rpl_vsprintf +# endif +_GL_FUNCDECL_RPL (vsprintf, int, + (char *str, const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (vsprintf, int, + (char *str, const char *format, va_list args)); +# else +/* Need to cast, because on Solaris, the third parameter is + __va_list args + and GCC's fixincludes did not change this to __gnuc_va_list. */ +_GL_CXXALIAS_SYS_CAST (vsprintf, int, + (char *str, const char *format, va_list args)); +# endif +_GL_CXXALIASWARN (vsprintf); +#elif defined GNULIB_POSIXCHECK +# undef vsprintf +/* Assume vsprintf is always declared. */ +_GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - " + "use gnulib module vsprintf-posix for portable " + "POSIX compliance"); +#endif + +#endif /* _@GUARD_PREFIX@_STDIO_H */ +#endif /* _@GUARD_PREFIX@_STDIO_H */ +#endif diff --git a/local/recipes/tools/diffutils/source/lib/stdlib.in.h b/local/recipes/tools/diffutils/source/lib/stdlib.in.h new file mode 100644 index 0000000000..b5cf9d3695 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/stdlib.in.h @@ -0,0 +1,992 @@ +/* A GNU-like <stdlib.h>. + + Copyright (C) 1995, 2001-2004, 2006-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#if defined __need_system_stdlib_h || defined __need_malloc_and_calloc +/* Special invocation conventions inside some gnulib header files, + and inside some glibc header files, respectively. */ + +#@INCLUDE_NEXT@ @NEXT_STDLIB_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_STDLIB_H + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_STDLIB_H@ + +#ifndef _@GUARD_PREFIX@_STDLIB_H +#define _@GUARD_PREFIX@_STDLIB_H + +/* NetBSD 5.0 mis-defines NULL. */ +#include <stddef.h> + +/* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>. */ +#if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS +# include <sys/wait.h> +#endif + +/* Solaris declares getloadavg() in <sys/loadavg.h>. */ +#if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@ +# include <sys/loadavg.h> +#endif + +/* Native Windows platforms declare mktemp() in <io.h>. */ +#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +# include <io.h> +#endif + +#if @GNULIB_RANDOM_R@ + +/* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included + from <stdlib.h> if _REENTRANT is defined. Include it whenever we need + 'struct random_data'. */ +# if @HAVE_RANDOM_H@ +# include <random.h> +# endif + +# if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@ +# include <stdint.h> +# endif + +# if !@HAVE_STRUCT_RANDOM_DATA@ +/* Define 'struct random_data'. + But allow multiple gnulib generated <stdlib.h> replacements to coexist. */ +# if !GNULIB_defined_struct_random_data +struct random_data +{ + int32_t *fptr; /* Front pointer. */ + int32_t *rptr; /* Rear pointer. */ + int32_t *state; /* Array of state values. */ + int rand_type; /* Type of random number generator. */ + int rand_deg; /* Degree of random number generator. */ + int rand_sep; /* Distance between front and rear. */ + int32_t *end_ptr; /* Pointer behind state table. */ +}; +# define GNULIB_defined_struct_random_data 1 +# endif +# endif +#endif + +#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +/* On Mac OS X 10.3, only <unistd.h> declares mkstemp. */ +/* On Mac OS X 10.5, only <unistd.h> declares mkstemps. */ +/* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */ +/* But avoid namespace pollution on glibc systems and native Windows. */ +# include <unistd.h> +#endif + +/* The __attribute__ feature is available in gcc versions 2.5 and later. + The attribute __pure__ was added in gcc 2.96. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE /* empty */ +#endif + +/* The definition of _Noreturn is copied here. */ + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + + +/* Some systems do not define EXIT_*, despite otherwise supporting C89. */ +#ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +#endif +/* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere + with proper operation of xargs. */ +#ifndef EXIT_FAILURE +# define EXIT_FAILURE 1 +#elif EXIT_FAILURE != 1 +# undef EXIT_FAILURE +# define EXIT_FAILURE 1 +#endif + + +#if @GNULIB__EXIT@ +/* Terminate the current process with the given return code, without running + the 'atexit' handlers. */ +# if !@HAVE__EXIT@ +_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status)); +# endif +_GL_CXXALIAS_SYS (_Exit, void, (int status)); +_GL_CXXALIASWARN (_Exit); +#elif defined GNULIB_POSIXCHECK +# undef _Exit +# if HAVE_RAW_DECL__EXIT +_GL_WARN_ON_USE (_Exit, "_Exit is unportable - " + "use gnulib module _Exit for portability"); +# endif +#endif + + +#if @GNULIB_ATOLL@ +/* Parse a signed decimal integer. + Returns the value of the integer. Errors are not detected. */ +# if !@HAVE_ATOLL@ +_GL_FUNCDECL_SYS (atoll, long long, (const char *string) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (atoll, long long, (const char *string)); +_GL_CXXALIASWARN (atoll); +#elif defined GNULIB_POSIXCHECK +# undef atoll +# if HAVE_RAW_DECL_ATOLL +_GL_WARN_ON_USE (atoll, "atoll is unportable - " + "use gnulib module atoll for portability"); +# endif +#endif + +#if @GNULIB_CALLOC_POSIX@ +# if @REPLACE_CALLOC@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef calloc +# define calloc rpl_calloc +# endif +_GL_FUNCDECL_RPL (calloc, void *, (size_t nmemb, size_t size)); +_GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size)); +# else +_GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size)); +# endif +_GL_CXXALIASWARN (calloc); +#elif defined GNULIB_POSIXCHECK +# undef calloc +/* Assume calloc is always declared. */ +_GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - " + "use gnulib module calloc-posix for portability"); +#endif + +#if @GNULIB_CANONICALIZE_FILE_NAME@ +# if @REPLACE_CANONICALIZE_FILE_NAME@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define canonicalize_file_name rpl_canonicalize_file_name +# endif +_GL_FUNCDECL_RPL (canonicalize_file_name, char *, (const char *name) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name)); +# else +# if !@HAVE_CANONICALIZE_FILE_NAME@ +_GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name)); +# endif +_GL_CXXALIASWARN (canonicalize_file_name); +#elif defined GNULIB_POSIXCHECK +# undef canonicalize_file_name +# if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME +_GL_WARN_ON_USE (canonicalize_file_name, + "canonicalize_file_name is unportable - " + "use gnulib module canonicalize-lgpl for portability"); +# endif +#endif + +#if @GNULIB_GETLOADAVG@ +/* Store max(NELEM,3) load average numbers in LOADAVG[]. + The three numbers are the load average of the last 1 minute, the last 5 + minutes, and the last 15 minutes, respectively. + LOADAVG is an array of NELEM numbers. */ +# if !@HAVE_DECL_GETLOADAVG@ +_GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem)); +_GL_CXXALIASWARN (getloadavg); +#elif defined GNULIB_POSIXCHECK +# undef getloadavg +# if HAVE_RAW_DECL_GETLOADAVG +_GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - " + "use gnulib module getloadavg for portability"); +# endif +#endif + +#if @GNULIB_GETSUBOPT@ +/* Assuming *OPTIONP is a comma separated list of elements of the form + "token" or "token=value", getsubopt parses the first of these elements. + If the first element refers to a "token" that is member of the given + NULL-terminated array of tokens: + - It replaces the comma with a NUL byte, updates *OPTIONP to point past + the first option and the comma, sets *VALUEP to the value of the + element (or NULL if it doesn't contain an "=" sign), + - It returns the index of the "token" in the given array of tokens. + Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined. + For more details see the POSIX:2001 specification. + http://www.opengroup.org/susv3xsh/getsubopt.html */ +# if !@HAVE_GETSUBOPT@ +_GL_FUNCDECL_SYS (getsubopt, int, + (char **optionp, char *const *tokens, char **valuep) + _GL_ARG_NONNULL ((1, 2, 3))); +# endif +_GL_CXXALIAS_SYS (getsubopt, int, + (char **optionp, char *const *tokens, char **valuep)); +_GL_CXXALIASWARN (getsubopt); +#elif defined GNULIB_POSIXCHECK +# undef getsubopt +# if HAVE_RAW_DECL_GETSUBOPT +_GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - " + "use gnulib module getsubopt for portability"); +# endif +#endif + +#if @GNULIB_GRANTPT@ +/* Change the ownership and access permission of the slave side of the + pseudo-terminal whose master side is specified by FD. */ +# if !@HAVE_GRANTPT@ +_GL_FUNCDECL_SYS (grantpt, int, (int fd)); +# endif +_GL_CXXALIAS_SYS (grantpt, int, (int fd)); +_GL_CXXALIASWARN (grantpt); +#elif defined GNULIB_POSIXCHECK +# undef grantpt +# if HAVE_RAW_DECL_GRANTPT +_GL_WARN_ON_USE (grantpt, "grantpt is not portable - " + "use gnulib module grantpt for portability"); +# endif +#endif + +/* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not + rely on GNU or POSIX semantics for malloc and realloc (for example, + by never specifying a zero size), so it does not need malloc or + realloc to be redefined. */ +#if @GNULIB_MALLOC_POSIX@ +# if @REPLACE_MALLOC@ +# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ + || _GL_USE_STDLIB_ALLOC) +# undef malloc +# define malloc rpl_malloc +# endif +_GL_FUNCDECL_RPL (malloc, void *, (size_t size)); +_GL_CXXALIAS_RPL (malloc, void *, (size_t size)); +# else +_GL_CXXALIAS_SYS (malloc, void *, (size_t size)); +# endif +_GL_CXXALIASWARN (malloc); +#elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC +# undef malloc +/* Assume malloc is always declared. */ +_GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - " + "use gnulib module malloc-posix for portability"); +#endif + +/* Convert a multibyte character to a wide character. */ +#if @GNULIB_MBTOWC@ +# if @REPLACE_MBTOWC@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mbtowc +# define mbtowc rpl_mbtowc +# endif +_GL_FUNCDECL_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); +_GL_CXXALIAS_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); +# else +_GL_CXXALIAS_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); +# endif +_GL_CXXALIASWARN (mbtowc); +#endif + +#if @GNULIB_MKDTEMP@ +/* Create a unique temporary directory from TEMPLATE. + The last six characters of TEMPLATE must be "XXXXXX"; + they are replaced with a string that makes the directory name unique. + Returns TEMPLATE, or a null pointer if it cannot get a unique name. + The directory is created mode 700. */ +# if !@HAVE_MKDTEMP@ +_GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/)); +_GL_CXXALIASWARN (mkdtemp); +#elif defined GNULIB_POSIXCHECK +# undef mkdtemp +# if HAVE_RAW_DECL_MKDTEMP +_GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - " + "use gnulib module mkdtemp for portability"); +# endif +#endif + +#if @GNULIB_MKOSTEMP@ +/* Create a unique temporary file from TEMPLATE. + The last six characters of TEMPLATE must be "XXXXXX"; + they are replaced with a string that makes the file name unique. + The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>) + and O_TEXT, O_BINARY (defined in "binary-io.h"). + The file is then created, with the specified flags, ensuring it didn't exist + before. + The file is created read-write (mask at least 0600 & ~umask), but it may be + world-readable and world-writable (mask 0666 & ~umask), depending on the + implementation. + Returns the open file descriptor if successful, otherwise -1 and errno + set. */ +# if !@HAVE_MKOSTEMP@ +_GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)); +_GL_CXXALIASWARN (mkostemp); +#elif defined GNULIB_POSIXCHECK +# undef mkostemp +# if HAVE_RAW_DECL_MKOSTEMP +_GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - " + "use gnulib module mkostemp for portability"); +# endif +#endif + +#if @GNULIB_MKOSTEMPS@ +/* Create a unique temporary file from TEMPLATE. + The last six characters of TEMPLATE before a suffix of length + SUFFIXLEN must be "XXXXXX"; + they are replaced with a string that makes the file name unique. + The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>) + and O_TEXT, O_BINARY (defined in "binary-io.h"). + The file is then created, with the specified flags, ensuring it didn't exist + before. + The file is created read-write (mask at least 0600 & ~umask), but it may be + world-readable and world-writable (mask 0666 & ~umask), depending on the + implementation. + Returns the open file descriptor if successful, otherwise -1 and errno + set. */ +# if !@HAVE_MKOSTEMPS@ +_GL_FUNCDECL_SYS (mkostemps, int, + (char * /*template*/, int /*suffixlen*/, int /*flags*/) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (mkostemps, int, + (char * /*template*/, int /*suffixlen*/, int /*flags*/)); +_GL_CXXALIASWARN (mkostemps); +#elif defined GNULIB_POSIXCHECK +# undef mkostemps +# if HAVE_RAW_DECL_MKOSTEMPS +_GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - " + "use gnulib module mkostemps for portability"); +# endif +#endif + +#if @GNULIB_MKSTEMP@ +/* Create a unique temporary file from TEMPLATE. + The last six characters of TEMPLATE must be "XXXXXX"; + they are replaced with a string that makes the file name unique. + The file is then created, ensuring it didn't exist before. + The file is created read-write (mask at least 0600 & ~umask), but it may be + world-readable and world-writable (mask 0666 & ~umask), depending on the + implementation. + Returns the open file descriptor if successful, otherwise -1 and errno + set. */ +# if @REPLACE_MKSTEMP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define mkstemp rpl_mkstemp +# endif +_GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/)); +# else +# if ! @HAVE_MKSTEMP@ +_GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/)); +# endif +_GL_CXXALIASWARN (mkstemp); +#elif defined GNULIB_POSIXCHECK +# undef mkstemp +# if HAVE_RAW_DECL_MKSTEMP +_GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - " + "use gnulib module mkstemp for portability"); +# endif +#endif + +#if @GNULIB_MKSTEMPS@ +/* Create a unique temporary file from TEMPLATE. + The last six characters of TEMPLATE prior to a suffix of length + SUFFIXLEN must be "XXXXXX"; + they are replaced with a string that makes the file name unique. + The file is then created, ensuring it didn't exist before. + The file is created read-write (mask at least 0600 & ~umask), but it may be + world-readable and world-writable (mask 0666 & ~umask), depending on the + implementation. + Returns the open file descriptor if successful, otherwise -1 and errno + set. */ +# if !@HAVE_MKSTEMPS@ +_GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)); +_GL_CXXALIASWARN (mkstemps); +#elif defined GNULIB_POSIXCHECK +# undef mkstemps +# if HAVE_RAW_DECL_MKSTEMPS +_GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - " + "use gnulib module mkstemps for portability"); +# endif +#endif + +#if @GNULIB_POSIX_OPENPT@ +/* Return an FD open to the master side of a pseudo-terminal. Flags should + include O_RDWR, and may also include O_NOCTTY. */ +# if !@HAVE_POSIX_OPENPT@ +_GL_FUNCDECL_SYS (posix_openpt, int, (int flags)); +# endif +_GL_CXXALIAS_SYS (posix_openpt, int, (int flags)); +_GL_CXXALIASWARN (posix_openpt); +#elif defined GNULIB_POSIXCHECK +# undef posix_openpt +# if HAVE_RAW_DECL_POSIX_OPENPT +_GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - " + "use gnulib module posix_openpt for portability"); +# endif +#endif + +#if @GNULIB_PTSNAME@ +/* Return the pathname of the pseudo-terminal slave associated with + the master FD is open on, or NULL on errors. */ +# if @REPLACE_PTSNAME@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef ptsname +# define ptsname rpl_ptsname +# endif +_GL_FUNCDECL_RPL (ptsname, char *, (int fd)); +_GL_CXXALIAS_RPL (ptsname, char *, (int fd)); +# else +# if !@HAVE_PTSNAME@ +_GL_FUNCDECL_SYS (ptsname, char *, (int fd)); +# endif +_GL_CXXALIAS_SYS (ptsname, char *, (int fd)); +# endif +_GL_CXXALIASWARN (ptsname); +#elif defined GNULIB_POSIXCHECK +# undef ptsname +# if HAVE_RAW_DECL_PTSNAME +_GL_WARN_ON_USE (ptsname, "ptsname is not portable - " + "use gnulib module ptsname for portability"); +# endif +#endif + +#if @GNULIB_PTSNAME_R@ +/* Set the pathname of the pseudo-terminal slave associated with + the master FD is open on and return 0, or set errno and return + non-zero on errors. */ +# if @REPLACE_PTSNAME_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef ptsname_r +# define ptsname_r rpl_ptsname_r +# endif +_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); +_GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); +# else +# if !@HAVE_PTSNAME_R@ +_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); +# endif +_GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); +# endif +_GL_CXXALIASWARN (ptsname_r); +#elif defined GNULIB_POSIXCHECK +# undef ptsname_r +# if HAVE_RAW_DECL_PTSNAME_R +_GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - " + "use gnulib module ptsname_r for portability"); +# endif +#endif + +#if @GNULIB_PUTENV@ +# if @REPLACE_PUTENV@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef putenv +# define putenv rpl_putenv +# endif +_GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (putenv, int, (char *string)); +# else +_GL_CXXALIAS_SYS (putenv, int, (char *string)); +# endif +_GL_CXXALIASWARN (putenv); +#endif + +#if @GNULIB_QSORT_R@ +/* Sort an array of NMEMB elements, starting at address BASE, each element + occupying SIZE bytes, in ascending order according to the comparison + function COMPARE. */ +# if @REPLACE_QSORT_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef qsort_r +# define qsort_r rpl_qsort_r +# endif +_GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, + int (*compare) (void const *, void const *, + void *), + void *arg) _GL_ARG_NONNULL ((1, 4))); +_GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, + int (*compare) (void const *, void const *, + void *), + void *arg)); +# else +# if !@HAVE_QSORT_R@ +_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, + int (*compare) (void const *, void const *, + void *), + void *arg) _GL_ARG_NONNULL ((1, 4))); +# endif +_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, + int (*compare) (void const *, void const *, + void *), + void *arg)); +# endif +_GL_CXXALIASWARN (qsort_r); +#elif defined GNULIB_POSIXCHECK +# undef qsort_r +# if HAVE_RAW_DECL_QSORT_R +_GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - " + "use gnulib module qsort_r for portability"); +# endif +#endif + + +#if @GNULIB_RANDOM_R@ +# if !@HAVE_RANDOM_R@ +# ifndef RAND_MAX +# define RAND_MAX 2147483647 +# endif +# endif +#endif + + +#if @GNULIB_RANDOM@ +# if !@HAVE_RANDOM@ +_GL_FUNCDECL_SYS (random, long, (void)); +# endif +_GL_CXXALIAS_SYS (random, long, (void)); +_GL_CXXALIASWARN (random); +#elif defined GNULIB_POSIXCHECK +# undef random +# if HAVE_RAW_DECL_RANDOM +_GL_WARN_ON_USE (random, "random is unportable - " + "use gnulib module random for portability"); +# endif +#endif + +#if @GNULIB_RANDOM@ +# if !@HAVE_RANDOM@ +_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed)); +# endif +_GL_CXXALIAS_SYS (srandom, void, (unsigned int seed)); +_GL_CXXALIASWARN (srandom); +#elif defined GNULIB_POSIXCHECK +# undef srandom +# if HAVE_RAW_DECL_SRANDOM +_GL_WARN_ON_USE (srandom, "srandom is unportable - " + "use gnulib module random for portability"); +# endif +#endif + +#if @GNULIB_RANDOM@ +# if !@HAVE_RANDOM@ +_GL_FUNCDECL_SYS (initstate, char *, + (unsigned int seed, char *buf, size_t buf_size) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (initstate, char *, + (unsigned int seed, char *buf, size_t buf_size)); +_GL_CXXALIASWARN (initstate); +#elif defined GNULIB_POSIXCHECK +# undef initstate +# if HAVE_RAW_DECL_INITSTATE_R +_GL_WARN_ON_USE (initstate, "initstate is unportable - " + "use gnulib module random for portability"); +# endif +#endif + +#if @GNULIB_RANDOM@ +# if !@HAVE_RANDOM@ +_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (setstate, char *, (char *arg_state)); +_GL_CXXALIASWARN (setstate); +#elif defined GNULIB_POSIXCHECK +# undef setstate +# if HAVE_RAW_DECL_SETSTATE_R +_GL_WARN_ON_USE (setstate, "setstate is unportable - " + "use gnulib module random for portability"); +# endif +#endif + + +#if @GNULIB_RANDOM_R@ +# if @REPLACE_RANDOM_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef random_r +# define random_r rpl_random_r +# endif +_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result)); +# else +# if !@HAVE_RANDOM_R@ +_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result)); +# endif +_GL_CXXALIASWARN (random_r); +#elif defined GNULIB_POSIXCHECK +# undef random_r +# if HAVE_RAW_DECL_RANDOM_R +_GL_WARN_ON_USE (random_r, "random_r is unportable - " + "use gnulib module random_r for portability"); +# endif +#endif + +#if @GNULIB_RANDOM_R@ +# if @REPLACE_RANDOM_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef srandom_r +# define srandom_r rpl_srandom_r +# endif +_GL_FUNCDECL_RPL (srandom_r, int, + (unsigned int seed, struct random_data *rand_state) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (srandom_r, int, + (unsigned int seed, struct random_data *rand_state)); +# else +# if !@HAVE_RANDOM_R@ +_GL_FUNCDECL_SYS (srandom_r, int, + (unsigned int seed, struct random_data *rand_state) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (srandom_r, int, + (unsigned int seed, struct random_data *rand_state)); +# endif +_GL_CXXALIASWARN (srandom_r); +#elif defined GNULIB_POSIXCHECK +# undef srandom_r +# if HAVE_RAW_DECL_SRANDOM_R +_GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - " + "use gnulib module random_r for portability"); +# endif +#endif + +#if @GNULIB_RANDOM_R@ +# if @REPLACE_RANDOM_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef initstate_r +# define initstate_r rpl_initstate_r +# endif +_GL_FUNCDECL_RPL (initstate_r, int, + (unsigned int seed, char *buf, size_t buf_size, + struct random_data *rand_state) + _GL_ARG_NONNULL ((2, 4))); +_GL_CXXALIAS_RPL (initstate_r, int, + (unsigned int seed, char *buf, size_t buf_size, + struct random_data *rand_state)); +# else +# if !@HAVE_RANDOM_R@ +_GL_FUNCDECL_SYS (initstate_r, int, + (unsigned int seed, char *buf, size_t buf_size, + struct random_data *rand_state) + _GL_ARG_NONNULL ((2, 4))); +# endif +_GL_CXXALIAS_SYS (initstate_r, int, + (unsigned int seed, char *buf, size_t buf_size, + struct random_data *rand_state)); +# endif +_GL_CXXALIASWARN (initstate_r); +#elif defined GNULIB_POSIXCHECK +# undef initstate_r +# if HAVE_RAW_DECL_INITSTATE_R +_GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - " + "use gnulib module random_r for portability"); +# endif +#endif + +#if @GNULIB_RANDOM_R@ +# if @REPLACE_RANDOM_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef setstate_r +# define setstate_r rpl_setstate_r +# endif +_GL_FUNCDECL_RPL (setstate_r, int, + (char *arg_state, struct random_data *rand_state) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (setstate_r, int, + (char *arg_state, struct random_data *rand_state)); +# else +# if !@HAVE_RANDOM_R@ +_GL_FUNCDECL_SYS (setstate_r, int, + (char *arg_state, struct random_data *rand_state) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (setstate_r, int, + (char *arg_state, struct random_data *rand_state)); +# endif +_GL_CXXALIASWARN (setstate_r); +#elif defined GNULIB_POSIXCHECK +# undef setstate_r +# if HAVE_RAW_DECL_SETSTATE_R +_GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - " + "use gnulib module random_r for portability"); +# endif +#endif + + +#if @GNULIB_REALLOC_POSIX@ +# if @REPLACE_REALLOC@ +# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ + || _GL_USE_STDLIB_ALLOC) +# undef realloc +# define realloc rpl_realloc +# endif +_GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size)); +_GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size)); +# else +_GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size)); +# endif +_GL_CXXALIASWARN (realloc); +#elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC +# undef realloc +/* Assume realloc is always declared. */ +_GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - " + "use gnulib module realloc-posix for portability"); +#endif + +#if @GNULIB_REALPATH@ +# if @REPLACE_REALPATH@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define realpath rpl_realpath +# endif +_GL_FUNCDECL_RPL (realpath, char *, (const char *name, char *resolved) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (realpath, char *, (const char *name, char *resolved)); +# else +# if !@HAVE_REALPATH@ +_GL_FUNCDECL_SYS (realpath, char *, (const char *name, char *resolved) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (realpath, char *, (const char *name, char *resolved)); +# endif +_GL_CXXALIASWARN (realpath); +#elif defined GNULIB_POSIXCHECK +# undef realpath +# if HAVE_RAW_DECL_REALPATH +_GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module " + "canonicalize or canonicalize-lgpl for portability"); +# endif +#endif + +#if @GNULIB_RPMATCH@ +/* Test a user response to a question. + Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */ +# if !@HAVE_RPMATCH@ +_GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (rpmatch, int, (const char *response)); +_GL_CXXALIASWARN (rpmatch); +#elif defined GNULIB_POSIXCHECK +# undef rpmatch +# if HAVE_RAW_DECL_RPMATCH +_GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - " + "use gnulib module rpmatch for portability"); +# endif +#endif + +#if @GNULIB_SECURE_GETENV@ +/* Look up NAME in the environment, returning 0 in insecure situations. */ +# if !@HAVE_SECURE_GETENV@ +_GL_FUNCDECL_SYS (secure_getenv, char *, + (char const *name) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name)); +_GL_CXXALIASWARN (secure_getenv); +#elif defined GNULIB_POSIXCHECK +# undef secure_getenv +# if HAVE_RAW_DECL_SECURE_GETENV +_GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - " + "use gnulib module secure_getenv for portability"); +# endif +#endif + +#if @GNULIB_SETENV@ +/* Set NAME to VALUE in the environment. + If REPLACE is nonzero, overwrite an existing value. */ +# if @REPLACE_SETENV@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef setenv +# define setenv rpl_setenv +# endif +_GL_FUNCDECL_RPL (setenv, int, + (const char *name, const char *value, int replace) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (setenv, int, + (const char *name, const char *value, int replace)); +# else +# if !@HAVE_DECL_SETENV@ +_GL_FUNCDECL_SYS (setenv, int, + (const char *name, const char *value, int replace) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (setenv, int, + (const char *name, const char *value, int replace)); +# endif +# if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@) +_GL_CXXALIASWARN (setenv); +# endif +#elif defined GNULIB_POSIXCHECK +# undef setenv +# if HAVE_RAW_DECL_SETENV +_GL_WARN_ON_USE (setenv, "setenv is unportable - " + "use gnulib module setenv for portability"); +# endif +#endif + +#if @GNULIB_STRTOD@ + /* Parse a double from STRING, updating ENDP if appropriate. */ +# if @REPLACE_STRTOD@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define strtod rpl_strtod +# endif +_GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp)); +# else +# if !@HAVE_STRTOD@ +_GL_FUNCDECL_SYS (strtod, double, (const char *str, char **endp) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (strtod, double, (const char *str, char **endp)); +# endif +_GL_CXXALIASWARN (strtod); +#elif defined GNULIB_POSIXCHECK +# undef strtod +# if HAVE_RAW_DECL_STRTOD +_GL_WARN_ON_USE (strtod, "strtod is unportable - " + "use gnulib module strtod for portability"); +# endif +#endif + +#if @GNULIB_STRTOLL@ +/* Parse a signed integer whose textual representation starts at STRING. + The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, + it may be decimal or octal (with prefix "0") or hexadecimal (with prefix + "0x"). + If ENDPTR is not NULL, the address of the first byte after the integer is + stored in *ENDPTR. + Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set + to ERANGE. */ +# if !@HAVE_STRTOLL@ +_GL_FUNCDECL_SYS (strtoll, long long, + (const char *string, char **endptr, int base) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (strtoll, long long, + (const char *string, char **endptr, int base)); +_GL_CXXALIASWARN (strtoll); +#elif defined GNULIB_POSIXCHECK +# undef strtoll +# if HAVE_RAW_DECL_STRTOLL +_GL_WARN_ON_USE (strtoll, "strtoll is unportable - " + "use gnulib module strtoll for portability"); +# endif +#endif + +#if @GNULIB_STRTOULL@ +/* Parse an unsigned integer whose textual representation starts at STRING. + The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, + it may be decimal or octal (with prefix "0") or hexadecimal (with prefix + "0x"). + If ENDPTR is not NULL, the address of the first byte after the integer is + stored in *ENDPTR. + Upon overflow, the return value is ULLONG_MAX, and errno is set to + ERANGE. */ +# if !@HAVE_STRTOULL@ +_GL_FUNCDECL_SYS (strtoull, unsigned long long, + (const char *string, char **endptr, int base) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (strtoull, unsigned long long, + (const char *string, char **endptr, int base)); +_GL_CXXALIASWARN (strtoull); +#elif defined GNULIB_POSIXCHECK +# undef strtoull +# if HAVE_RAW_DECL_STRTOULL +_GL_WARN_ON_USE (strtoull, "strtoull is unportable - " + "use gnulib module strtoull for portability"); +# endif +#endif + +#if @GNULIB_UNLOCKPT@ +/* Unlock the slave side of the pseudo-terminal whose master side is specified + by FD, so that it can be opened. */ +# if !@HAVE_UNLOCKPT@ +_GL_FUNCDECL_SYS (unlockpt, int, (int fd)); +# endif +_GL_CXXALIAS_SYS (unlockpt, int, (int fd)); +_GL_CXXALIASWARN (unlockpt); +#elif defined GNULIB_POSIXCHECK +# undef unlockpt +# if HAVE_RAW_DECL_UNLOCKPT +_GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - " + "use gnulib module unlockpt for portability"); +# endif +#endif + +#if @GNULIB_UNSETENV@ +/* Remove the variable NAME from the environment. */ +# if @REPLACE_UNSETENV@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef unsetenv +# define unsetenv rpl_unsetenv +# endif +_GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (unsetenv, int, (const char *name)); +# else +# if !@HAVE_DECL_UNSETENV@ +_GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (unsetenv, int, (const char *name)); +# endif +# if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@) +_GL_CXXALIASWARN (unsetenv); +# endif +#elif defined GNULIB_POSIXCHECK +# undef unsetenv +# if HAVE_RAW_DECL_UNSETENV +_GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - " + "use gnulib module unsetenv for portability"); +# endif +#endif + +/* Convert a wide character to a multibyte character. */ +#if @GNULIB_WCTOMB@ +# if @REPLACE_WCTOMB@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef wctomb +# define wctomb rpl_wctomb +# endif +_GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc)); +_GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc)); +# else +_GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc)); +# endif +_GL_CXXALIASWARN (wctomb); +#endif + + +#endif /* _@GUARD_PREFIX@_STDLIB_H */ +#endif /* _@GUARD_PREFIX@_STDLIB_H */ +#endif diff --git a/local/recipes/tools/diffutils/source/lib/str-kmp.h b/local/recipes/tools/diffutils/source/lib/str-kmp.h new file mode 100644 index 0000000000..f7fc612f54 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/str-kmp.h @@ -0,0 +1,153 @@ +/* Substring search in a NUL terminated string of UNIT elements, + using the Knuth-Morris-Pratt algorithm. + Copyright (C) 2005-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2005. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* Before including this file, you need to define: + UNIT The element type of the needle and haystack. + CANON_ELEMENT(c) A macro that canonicalizes an element right after + it has been fetched from needle or haystack. + The argument is of type UNIT; the result must be + of type UNIT as well. */ + +/* Knuth-Morris-Pratt algorithm. + See http://en.wikipedia.org/wiki/Knuth-Morris-Pratt_algorithm + HAYSTACK is the NUL terminated string in which to search for. + NEEDLE is the string to search for in HAYSTACK, consisting of NEEDLE_LEN + units. + Return a boolean indicating success: + Return true and set *RESULTP if the search was completed. + Return false if it was aborted because not enough memory was available. */ +static bool +knuth_morris_pratt (const UNIT *haystack, + const UNIT *needle, size_t needle_len, + const UNIT **resultp) +{ + size_t m = needle_len; + + /* Allocate the table. */ + size_t *table = (size_t *) nmalloca (m, sizeof (size_t)); + if (table == NULL) + return false; + /* Fill the table. + For 0 < i < m: + 0 < table[i] <= i is defined such that + forall 0 < x < table[i]: needle[x..i-1] != needle[0..i-1-x], + and table[i] is as large as possible with this property. + This implies: + 1) For 0 < i < m: + If table[i] < i, + needle[table[i]..i-1] = needle[0..i-1-table[i]]. + 2) For 0 < i < m: + rhaystack[0..i-1] == needle[0..i-1] + and exists h, i <= h < m: rhaystack[h] != needle[h] + implies + forall 0 <= x < table[i]: rhaystack[x..x+m-1] != needle[0..m-1]. + table[0] remains uninitialized. */ + { + size_t i, j; + + /* i = 1: Nothing to verify for x = 0. */ + table[1] = 1; + j = 0; + + for (i = 2; i < m; i++) + { + /* Here: j = i-1 - table[i-1]. + The inequality needle[x..i-1] != needle[0..i-1-x] is known to hold + for x < table[i-1], by induction. + Furthermore, if j>0: needle[i-1-j..i-2] = needle[0..j-1]. */ + UNIT b = CANON_ELEMENT (needle[i - 1]); + + for (;;) + { + /* Invariants: The inequality needle[x..i-1] != needle[0..i-1-x] + is known to hold for x < i-1-j. + Furthermore, if j>0: needle[i-1-j..i-2] = needle[0..j-1]. */ + if (b == CANON_ELEMENT (needle[j])) + { + /* Set table[i] := i-1-j. */ + table[i] = i - ++j; + break; + } + /* The inequality needle[x..i-1] != needle[0..i-1-x] also holds + for x = i-1-j, because + needle[i-1] != needle[j] = needle[i-1-x]. */ + if (j == 0) + { + /* The inequality holds for all possible x. */ + table[i] = i; + break; + } + /* The inequality needle[x..i-1] != needle[0..i-1-x] also holds + for i-1-j < x < i-1-j+table[j], because for these x: + needle[x..i-2] + = needle[x-(i-1-j)..j-1] + != needle[0..j-1-(x-(i-1-j))] (by definition of table[j]) + = needle[0..i-2-x], + hence needle[x..i-1] != needle[0..i-1-x]. + Furthermore + needle[i-1-j+table[j]..i-2] + = needle[table[j]..j-1] + = needle[0..j-1-table[j]] (by definition of table[j]). */ + j = j - table[j]; + } + /* Here: j = i - table[i]. */ + } + } + + /* Search, using the table to accelerate the processing. */ + { + size_t j; + const UNIT *rhaystack; + const UNIT *phaystack; + + *resultp = NULL; + j = 0; + rhaystack = haystack; + phaystack = haystack; + /* Invariant: phaystack = rhaystack + j. */ + while (*phaystack != 0) + if (CANON_ELEMENT (needle[j]) == CANON_ELEMENT (*phaystack)) + { + j++; + phaystack++; + if (j == m) + { + /* The entire needle has been found. */ + *resultp = rhaystack; + break; + } + } + else if (j > 0) + { + /* Found a match of needle[0..j-1], mismatch at needle[j]. */ + rhaystack += table[j]; + j -= table[j]; + } + else + { + /* Found a mismatch at needle[0] already. */ + rhaystack++; + phaystack++; + } + } + + freea (table); + return true; +} + +#undef CANON_ELEMENT diff --git a/local/recipes/tools/diffutils/source/lib/strcasecmp.c b/local/recipes/tools/diffutils/source/lib/strcasecmp.c new file mode 100644 index 0000000000..8548f4dc53 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/strcasecmp.c @@ -0,0 +1,62 @@ +/* Case-insensitive string comparison function. + Copyright (C) 1998-1999, 2005-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <string.h> + +#include <ctype.h> +#include <limits.h> + +#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) + +/* Compare strings S1 and S2, ignoring case, returning less than, equal to or + greater than zero if S1 is lexicographically less than, equal to or greater + than S2. + Note: This function does not work with multibyte strings! */ + +int +strcasecmp (const char *s1, const char *s2) +{ + const unsigned char *p1 = (const unsigned char *) s1; + const unsigned char *p2 = (const unsigned char *) s2; + unsigned char c1, c2; + + if (p1 == p2) + return 0; + + do + { + c1 = TOLOWER (*p1); + c2 = TOLOWER (*p2); + + if (c1 == '\0') + break; + + ++p1; + ++p2; + } + while (c1 == c2); + + if (UCHAR_MAX <= INT_MAX) + return c1 - c2; + else + /* On machines where 'char' and 'int' are types of the same size, the + difference of two 'unsigned char' values - including the sign bit - + doesn't fit in an 'int'. */ + return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0); +} diff --git a/local/recipes/tools/diffutils/source/lib/streq.h b/local/recipes/tools/diffutils/source/lib/streq.h new file mode 100644 index 0000000000..d40fc48f23 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/streq.h @@ -0,0 +1,176 @@ +/* Optimized string comparison. + Copyright (C) 2001-2002, 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>. */ + +#ifndef _GL_STREQ_H +#define _GL_STREQ_H + +#include <string.h> + +/* STREQ_OPT allows to optimize string comparison with a small literal string. + STREQ_OPT (s, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0) + is semantically equivalent to + strcmp (s, "EUC-KR") == 0 + just faster. */ + +/* Help GCC to generate good code for string comparisons with + immediate strings. */ +#if defined (__GNUC__) && defined (__OPTIMIZE__) + +static inline int +streq9 (const char *s1, const char *s2) +{ + return strcmp (s1 + 9, s2 + 9) == 0; +} + +static inline int +streq8 (const char *s1, const char *s2, char s28) +{ + if (s1[8] == s28) + { + if (s28 == 0) + return 1; + else + return streq9 (s1, s2); + } + else + return 0; +} + +static inline int +streq7 (const char *s1, const char *s2, char s27, char s28) +{ + if (s1[7] == s27) + { + if (s27 == 0) + return 1; + else + return streq8 (s1, s2, s28); + } + else + return 0; +} + +static inline int +streq6 (const char *s1, const char *s2, char s26, char s27, char s28) +{ + if (s1[6] == s26) + { + if (s26 == 0) + return 1; + else + return streq7 (s1, s2, s27, s28); + } + else + return 0; +} + +static inline int +streq5 (const char *s1, const char *s2, char s25, char s26, char s27, char s28) +{ + if (s1[5] == s25) + { + if (s25 == 0) + return 1; + else + return streq6 (s1, s2, s26, s27, s28); + } + else + return 0; +} + +static inline int +streq4 (const char *s1, const char *s2, char s24, char s25, char s26, char s27, char s28) +{ + if (s1[4] == s24) + { + if (s24 == 0) + return 1; + else + return streq5 (s1, s2, s25, s26, s27, s28); + } + else + return 0; +} + +static inline int +streq3 (const char *s1, const char *s2, char s23, char s24, char s25, char s26, char s27, char s28) +{ + if (s1[3] == s23) + { + if (s23 == 0) + return 1; + else + return streq4 (s1, s2, s24, s25, s26, s27, s28); + } + else + return 0; +} + +static inline int +streq2 (const char *s1, const char *s2, char s22, char s23, char s24, char s25, char s26, char s27, char s28) +{ + if (s1[2] == s22) + { + if (s22 == 0) + return 1; + else + return streq3 (s1, s2, s23, s24, s25, s26, s27, s28); + } + else + return 0; +} + +static inline int +streq1 (const char *s1, const char *s2, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28) +{ + if (s1[1] == s21) + { + if (s21 == 0) + return 1; + else + return streq2 (s1, s2, s22, s23, s24, s25, s26, s27, s28); + } + else + return 0; +} + +static inline int +streq0 (const char *s1, const char *s2, char s20, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28) +{ + if (s1[0] == s20) + { + if (s20 == 0) + return 1; + else + return streq1 (s1, s2, s21, s22, s23, s24, s25, s26, s27, s28); + } + else + return 0; +} + +#define STREQ_OPT(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \ + streq0 (s1, s2, s20, s21, s22, s23, s24, s25, s26, s27, s28) + +#else + +#define STREQ_OPT(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \ + (strcmp (s1, s2) == 0) + +#endif + +#endif /* _GL_STREQ_H */ diff --git a/local/recipes/tools/diffutils/source/lib/strerror-override.c b/local/recipes/tools/diffutils/source/lib/strerror-override.c new file mode 100644 index 0000000000..fb2c74f7be --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/strerror-override.c @@ -0,0 +1,302 @@ +/* strerror-override.c --- POSIX compatible system error routine + + Copyright (C) 2010-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2010. */ + +#include <config.h> + +#include "strerror-override.h" + +#include <errno.h> + +#if GNULIB_defined_EWINSOCK /* native Windows platforms */ +# if HAVE_WINSOCK2_H +# include <winsock2.h> +# endif +#endif + +/* If ERRNUM maps to an errno value defined by gnulib, return a string + describing the error. Otherwise return NULL. */ +const char * +strerror_override (int errnum) +{ + /* These error messages are taken from glibc/sysdeps/gnu/errlist.c. */ + switch (errnum) + { +#if REPLACE_STRERROR_0 + case 0: + return "Success"; +#endif + +#if GNULIB_defined_ESOCK /* native Windows platforms with older <errno.h> */ + case EINPROGRESS: + return "Operation now in progress"; + case EALREADY: + return "Operation already in progress"; + case ENOTSOCK: + return "Socket operation on non-socket"; + case EDESTADDRREQ: + return "Destination address required"; + case EMSGSIZE: + return "Message too long"; + case EPROTOTYPE: + return "Protocol wrong type for socket"; + case ENOPROTOOPT: + return "Protocol not available"; + case EPROTONOSUPPORT: + return "Protocol not supported"; + case EOPNOTSUPP: + return "Operation not supported"; + case EAFNOSUPPORT: + return "Address family not supported by protocol"; + case EADDRINUSE: + return "Address already in use"; + case EADDRNOTAVAIL: + return "Cannot assign requested address"; + case ENETDOWN: + return "Network is down"; + case ENETUNREACH: + return "Network is unreachable"; + case ECONNRESET: + return "Connection reset by peer"; + case ENOBUFS: + return "No buffer space available"; + case EISCONN: + return "Transport endpoint is already connected"; + case ENOTCONN: + return "Transport endpoint is not connected"; + case ETIMEDOUT: + return "Connection timed out"; + case ECONNREFUSED: + return "Connection refused"; + case ELOOP: + return "Too many levels of symbolic links"; + case EHOSTUNREACH: + return "No route to host"; + case EWOULDBLOCK: + return "Operation would block"; +#endif +#if GNULIB_defined_ESTREAMS /* native Windows platforms with older <errno.h> */ + case ETXTBSY: + return "Text file busy"; + case ENODATA: + return "No data available"; + case ENOSR: + return "Out of streams resources"; + case ENOSTR: + return "Device not a stream"; + case ETIME: + return "Timer expired"; + case EOTHER: + return "Other error"; +#endif +#if GNULIB_defined_EWINSOCK /* native Windows platforms */ + case ESOCKTNOSUPPORT: + return "Socket type not supported"; + case EPFNOSUPPORT: + return "Protocol family not supported"; + case ESHUTDOWN: + return "Cannot send after transport endpoint shutdown"; + case ETOOMANYREFS: + return "Too many references: cannot splice"; + case EHOSTDOWN: + return "Host is down"; + case EPROCLIM: + return "Too many processes"; + case EUSERS: + return "Too many users"; + case EDQUOT: + return "Disk quota exceeded"; + case ESTALE: + return "Stale NFS file handle"; + case EREMOTE: + return "Object is remote"; +# if HAVE_WINSOCK2_H + /* WSA_INVALID_HANDLE maps to EBADF */ + /* WSA_NOT_ENOUGH_MEMORY maps to ENOMEM */ + /* WSA_INVALID_PARAMETER maps to EINVAL */ + case WSA_OPERATION_ABORTED: + return "Overlapped operation aborted"; + case WSA_IO_INCOMPLETE: + return "Overlapped I/O event object not in signaled state"; + case WSA_IO_PENDING: + return "Overlapped operations will complete later"; + /* WSAEINTR maps to EINTR */ + /* WSAEBADF maps to EBADF */ + /* WSAEACCES maps to EACCES */ + /* WSAEFAULT maps to EFAULT */ + /* WSAEINVAL maps to EINVAL */ + /* WSAEMFILE maps to EMFILE */ + /* WSAEWOULDBLOCK maps to EWOULDBLOCK */ + /* WSAEINPROGRESS maps to EINPROGRESS */ + /* WSAEALREADY maps to EALREADY */ + /* WSAENOTSOCK maps to ENOTSOCK */ + /* WSAEDESTADDRREQ maps to EDESTADDRREQ */ + /* WSAEMSGSIZE maps to EMSGSIZE */ + /* WSAEPROTOTYPE maps to EPROTOTYPE */ + /* WSAENOPROTOOPT maps to ENOPROTOOPT */ + /* WSAEPROTONOSUPPORT maps to EPROTONOSUPPORT */ + /* WSAESOCKTNOSUPPORT is ESOCKTNOSUPPORT */ + /* WSAEOPNOTSUPP maps to EOPNOTSUPP */ + /* WSAEPFNOSUPPORT is EPFNOSUPPORT */ + /* WSAEAFNOSUPPORT maps to EAFNOSUPPORT */ + /* WSAEADDRINUSE maps to EADDRINUSE */ + /* WSAEADDRNOTAVAIL maps to EADDRNOTAVAIL */ + /* WSAENETDOWN maps to ENETDOWN */ + /* WSAENETUNREACH maps to ENETUNREACH */ + /* WSAENETRESET maps to ENETRESET */ + /* WSAECONNABORTED maps to ECONNABORTED */ + /* WSAECONNRESET maps to ECONNRESET */ + /* WSAENOBUFS maps to ENOBUFS */ + /* WSAEISCONN maps to EISCONN */ + /* WSAENOTCONN maps to ENOTCONN */ + /* WSAESHUTDOWN is ESHUTDOWN */ + /* WSAETOOMANYREFS is ETOOMANYREFS */ + /* WSAETIMEDOUT maps to ETIMEDOUT */ + /* WSAECONNREFUSED maps to ECONNREFUSED */ + /* WSAELOOP maps to ELOOP */ + /* WSAENAMETOOLONG maps to ENAMETOOLONG */ + /* WSAEHOSTDOWN is EHOSTDOWN */ + /* WSAEHOSTUNREACH maps to EHOSTUNREACH */ + /* WSAENOTEMPTY maps to ENOTEMPTY */ + /* WSAEPROCLIM is EPROCLIM */ + /* WSAEUSERS is EUSERS */ + /* WSAEDQUOT is EDQUOT */ + /* WSAESTALE is ESTALE */ + /* WSAEREMOTE is EREMOTE */ + case WSASYSNOTREADY: + return "Network subsystem is unavailable"; + case WSAVERNOTSUPPORTED: + return "Winsock.dll version out of range"; + case WSANOTINITIALISED: + return "Successful WSAStartup not yet performed"; + case WSAEDISCON: + return "Graceful shutdown in progress"; + case WSAENOMORE: case WSA_E_NO_MORE: + return "No more results"; + case WSAECANCELLED: case WSA_E_CANCELLED: + return "Call was canceled"; + case WSAEINVALIDPROCTABLE: + return "Procedure call table is invalid"; + case WSAEINVALIDPROVIDER: + return "Service provider is invalid"; + case WSAEPROVIDERFAILEDINIT: + return "Service provider failed to initialize"; + case WSASYSCALLFAILURE: + return "System call failure"; + case WSASERVICE_NOT_FOUND: + return "Service not found"; + case WSATYPE_NOT_FOUND: + return "Class type not found"; + case WSAEREFUSED: + return "Database query was refused"; + case WSAHOST_NOT_FOUND: + return "Host not found"; + case WSATRY_AGAIN: + return "Nonauthoritative host not found"; + case WSANO_RECOVERY: + return "Nonrecoverable error"; + case WSANO_DATA: + return "Valid name, no data record of requested type"; + /* WSA_QOS_* omitted */ +# endif +#endif + +#if GNULIB_defined_ENOMSG + case ENOMSG: + return "No message of desired type"; +#endif + +#if GNULIB_defined_EIDRM + case EIDRM: + return "Identifier removed"; +#endif + +#if GNULIB_defined_ENOLINK + case ENOLINK: + return "Link has been severed"; +#endif + +#if GNULIB_defined_EPROTO + case EPROTO: + return "Protocol error"; +#endif + +#if GNULIB_defined_EMULTIHOP + case EMULTIHOP: + return "Multihop attempted"; +#endif + +#if GNULIB_defined_EBADMSG + case EBADMSG: + return "Bad message"; +#endif + +#if GNULIB_defined_EOVERFLOW + case EOVERFLOW: + return "Value too large for defined data type"; +#endif + +#if GNULIB_defined_ENOTSUP + case ENOTSUP: + return "Not supported"; +#endif + +#if GNULIB_defined_ENETRESET + case ENETRESET: + return "Network dropped connection on reset"; +#endif + +#if GNULIB_defined_ECONNABORTED + case ECONNABORTED: + return "Software caused connection abort"; +#endif + +#if GNULIB_defined_ESTALE + case ESTALE: + return "Stale NFS file handle"; +#endif + +#if GNULIB_defined_EDQUOT + case EDQUOT: + return "Disk quota exceeded"; +#endif + +#if GNULIB_defined_ECANCELED + case ECANCELED: + return "Operation canceled"; +#endif + +#if GNULIB_defined_EOWNERDEAD + case EOWNERDEAD: + return "Owner died"; +#endif + +#if GNULIB_defined_ENOTRECOVERABLE + case ENOTRECOVERABLE: + return "State not recoverable"; +#endif + +#if GNULIB_defined_EILSEQ + case EILSEQ: + return "Invalid or incomplete multibyte or wide character"; +#endif + + default: + return NULL; + } +} diff --git a/local/recipes/tools/diffutils/source/lib/strerror-override.h b/local/recipes/tools/diffutils/source/lib/strerror-override.h new file mode 100644 index 0000000000..c22d303ccb --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/strerror-override.h @@ -0,0 +1,56 @@ +/* strerror-override.h --- POSIX compatible system error routine + + Copyright (C) 2010-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _GL_STRERROR_OVERRIDE_H +# define _GL_STRERROR_OVERRIDE_H + +# include <errno.h> +# include <stddef.h> + +/* Reasonable buffer size that should never trigger ERANGE; if this + proves too small, we intentionally abort(), to remind us to fix + this value. */ +# define STACKBUF_LEN 256 + +/* If ERRNUM maps to an errno value defined by gnulib, return a string + describing the error. Otherwise return NULL. */ +# if REPLACE_STRERROR_0 \ + || GNULIB_defined_ESOCK \ + || GNULIB_defined_ESTREAMS \ + || GNULIB_defined_EWINSOCK \ + || GNULIB_defined_ENOMSG \ + || GNULIB_defined_EIDRM \ + || GNULIB_defined_ENOLINK \ + || GNULIB_defined_EPROTO \ + || GNULIB_defined_EMULTIHOP \ + || GNULIB_defined_EBADMSG \ + || GNULIB_defined_EOVERFLOW \ + || GNULIB_defined_ENOTSUP \ + || GNULIB_defined_ENETRESET \ + || GNULIB_defined_ECONNABORTED \ + || GNULIB_defined_ESTALE \ + || GNULIB_defined_EDQUOT \ + || GNULIB_defined_ECANCELED \ + || GNULIB_defined_EOWNERDEAD \ + || GNULIB_defined_ENOTRECOVERABLE \ + || GNULIB_defined_EILSEQ +extern const char *strerror_override (int errnum) _GL_ATTRIBUTE_CONST; +# else +# define strerror_override(ignored) NULL +# endif + +#endif /* _GL_STRERROR_OVERRIDE_H */ diff --git a/local/recipes/tools/diffutils/source/lib/strerror.c b/local/recipes/tools/diffutils/source/lib/strerror.c new file mode 100644 index 0000000000..afeb9c8c23 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/strerror.c @@ -0,0 +1,71 @@ +/* strerror.c --- POSIX compatible system error routine + + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <string.h> + +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "intprops.h" +#include "strerror-override.h" +#include "verify.h" + +/* Use the system functions, not the gnulib overrides in this file. */ +#undef sprintf + +char * +strerror (int n) +#undef strerror +{ + static char buf[STACKBUF_LEN]; + size_t len; + + /* Cast away const, due to the historical signature of strerror; + callers should not be modifying the string. */ + const char *msg = strerror_override (n); + if (msg) + return (char *) msg; + + msg = strerror (n); + + /* Our strerror_r implementation might use the system's strerror + buffer, so all other clients of strerror have to see the error + copied into a buffer that we manage. This is not thread-safe, + even if the system strerror is, but portable programs shouldn't + be using strerror if they care about thread-safety. */ + if (!msg || !*msg) + { + static char const fmt[] = "Unknown error %d"; + verify (sizeof buf >= sizeof (fmt) + INT_STRLEN_BOUND (n)); + sprintf (buf, fmt, n); + errno = EINVAL; + return buf; + } + + /* Fix STACKBUF_LEN if this ever aborts. */ + len = strlen (msg); + if (sizeof buf <= len) + abort (); + + memcpy (buf, msg, len + 1); + return buf; +} diff --git a/local/recipes/tools/diffutils/source/lib/strftime.c b/local/recipes/tools/diffutils/source/lib/strftime.c new file mode 100644 index 0000000000..99bee4ef97 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/strftime.c @@ -0,0 +1,1506 @@ +/* Copyright (C) 1991-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifdef _LIBC +# define USE_IN_EXTENDED_LOCALE_MODEL 1 +# define HAVE_STRUCT_ERA_ENTRY 1 +# define HAVE_TM_GMTOFF 1 +# define HAVE_TM_ZONE 1 +# define HAVE_TZNAME 1 +# define HAVE_TZSET 1 +# include "../locale/localeinfo.h" +#else +# include <config.h> +# if FPRINTFTIME +# include "fprintftime.h" +# else +# include "strftime.h" +# endif +# include "time-internal.h" +#endif + +#include <ctype.h> +#include <time.h> + +#if HAVE_TZNAME && !HAVE_DECL_TZNAME +extern char *tzname[]; +#endif + +/* Do multibyte processing if multibyte encodings are supported, unless + multibyte sequences are safe in formats. Multibyte sequences are + safe if they cannot contain byte sequences that look like format + conversion specifications. The multibyte encodings used by the + C library on the various platforms (UTF-8, GB2312, GBK, CP936, + GB18030, EUC-TW, BIG5, BIG5-HKSCS, CP950, EUC-JP, EUC-KR, CP949, + SHIFT_JIS, CP932, JOHAB) are safe for formats, because the byte '%' + cannot occur in a multibyte character except in the first byte. + + The DEC-HANYU encoding used on OSF/1 is not safe for formats, but + this encoding has never been seen in real-life use, so we ignore + it. */ +#if !(defined __osf__ && 0) +# define MULTIBYTE_IS_FORMAT_SAFE 1 +#endif +#define DO_MULTIBYTE (! MULTIBYTE_IS_FORMAT_SAFE) + +#if DO_MULTIBYTE +# include <wchar.h> + static const mbstate_t mbstate_zero; +#endif + +#include <limits.h> +#include <stddef.h> +#include <stdlib.h> +#include <string.h> +#include <stdbool.h> + +#ifndef FALLTHROUGH +# if __GNUC__ < 7 +# define FALLTHROUGH ((void) 0) +# else +# define FALLTHROUGH __attribute__ ((__fallthrough__)) +# endif +#endif + +#ifdef COMPILE_WIDE +# include <endian.h> +# define CHAR_T wchar_t +# define UCHAR_T unsigned int +# define L_(Str) L##Str +# define NLW(Sym) _NL_W##Sym + +# define MEMCPY(d, s, n) __wmemcpy (d, s, n) +# define STRLEN(s) __wcslen (s) + +#else +# define CHAR_T char +# define UCHAR_T unsigned char +# define L_(Str) Str +# define NLW(Sym) Sym + +# define MEMCPY(d, s, n) memcpy (d, s, n) +# define STRLEN(s) strlen (s) + +#endif + +/* Shift A right by B bits portably, by dividing A by 2**B and + truncating towards minus infinity. A and B should be free of side + effects, and B should be in the range 0 <= B <= INT_BITS - 2, where + INT_BITS is the number of useful bits in an int. GNU code can + assume that INT_BITS is at least 32. + + ISO C99 says that A >> B is implementation-defined if A < 0. Some + implementations (e.g., UNICOS 9.0 on a Cray Y-MP EL) don't shift + right in the usual way when A < 0, so SHR falls back on division if + ordinary A >> B doesn't seem to be the usual signed shift. */ +#define SHR(a, b) \ + (-1 >> 1 == -1 \ + ? (a) >> (b) \ + : (a) / (1 << (b)) - ((a) % (1 << (b)) < 0)) + +/* Bound on length of the string representing an integer type or expression T. + Subtract 1 for the sign bit if t is signed; log10 (2.0) < 146/485; + add 1 for integer division truncation; add 1 more for a minus sign + if needed. */ +#define INT_STRLEN_BOUND(t) \ + ((sizeof (t) * CHAR_BIT - 1) * 146 / 485 + 2) + +#define TM_YEAR_BASE 1900 + +#ifndef __isleap +/* Nonzero if YEAR is a leap year (every 4 years, + except every 100th isn't, and every 400th is). */ +# define __isleap(year) \ + ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) +#endif + + +#ifdef _LIBC +# define mktime_z(tz, tm) mktime (tm) +# define tzname __tzname +# define tzset __tzset +#endif + +#ifndef FPRINTFTIME +# define FPRINTFTIME 0 +#endif + +#if FPRINTFTIME +# define STREAM_OR_CHAR_T FILE +# define STRFTIME_ARG(x) /* empty */ +#else +# define STREAM_OR_CHAR_T CHAR_T +# define STRFTIME_ARG(x) x, +#endif + +#if FPRINTFTIME +# define memset_byte(P, Len, Byte) \ + do { size_t _i; for (_i = 0; _i < Len; _i++) fputc (Byte, P); } while (0) +# define memset_space(P, Len) memset_byte (P, Len, ' ') +# define memset_zero(P, Len) memset_byte (P, Len, '0') +#elif defined COMPILE_WIDE +# define memset_space(P, Len) (wmemset (P, L' ', Len), (P) += (Len)) +# define memset_zero(P, Len) (wmemset (P, L'0', Len), (P) += (Len)) +#else +# define memset_space(P, Len) (memset (P, ' ', Len), (P) += (Len)) +# define memset_zero(P, Len) (memset (P, '0', Len), (P) += (Len)) +#endif + +#if FPRINTFTIME +# define advance(P, N) +#else +# define advance(P, N) ((P) += (N)) +#endif + +#define add(n, f) \ + do \ + { \ + size_t _n = (n); \ + size_t _w = (width < 0 ? 0 : width); \ + size_t _incr = _n < _w ? _w : _n; \ + if (_incr >= maxsize - i) \ + return 0; \ + if (p) \ + { \ + if (digits == 0 && _n < _w) \ + { \ + size_t _delta = width - _n; \ + if (pad == L_('0')) \ + memset_zero (p, _delta); \ + else \ + memset_space (p, _delta); \ + } \ + f; \ + advance (p, _n); \ + } \ + i += _incr; \ + } while (0) + +#if FPRINTFTIME +# define add1(C) add (1, fputc (C, p)) +#else +# define add1(C) add (1, *p = C) +#endif + +#if FPRINTFTIME +# define cpy(n, s) \ + add ((n), \ + do \ + { \ + if (to_lowcase) \ + fwrite_lowcase (p, (s), _n); \ + else if (to_uppcase) \ + fwrite_uppcase (p, (s), _n); \ + else \ + { \ + /* Ignore the value of fwrite. The caller can determine whether \ + an error occurred by inspecting ferror (P). All known fwrite \ + implementations set the stream's error indicator when they \ + fail due to ENOMEM etc., even though C11 and POSIX.1-2008 do \ + not require this. */ \ + fwrite (s, _n, 1, p); \ + } \ + } \ + while (0) \ + ) +#else +# define cpy(n, s) \ + add ((n), \ + if (to_lowcase) \ + memcpy_lowcase (p, (s), _n LOCALE_ARG); \ + else if (to_uppcase) \ + memcpy_uppcase (p, (s), _n LOCALE_ARG); \ + else \ + MEMCPY ((void *) p, (void const *) (s), _n)) +#endif + +#ifdef COMPILE_WIDE +# ifndef USE_IN_EXTENDED_LOCALE_MODEL +# undef __mbsrtowcs_l +# define __mbsrtowcs_l(d, s, l, st, loc) __mbsrtowcs (d, s, l, st) +# endif +# define widen(os, ws, l) \ + { \ + mbstate_t __st; \ + const char *__s = os; \ + memset (&__st, '\0', sizeof (__st)); \ + l = __mbsrtowcs_l (NULL, &__s, 0, &__st, loc); \ + ws = (wchar_t *) alloca ((l + 1) * sizeof (wchar_t)); \ + (void) __mbsrtowcs_l (ws, &__s, l, &__st, loc); \ + } +#endif + + +#if defined _LIBC && defined USE_IN_EXTENDED_LOCALE_MODEL +/* We use this code also for the extended locale handling where the + function gets as an additional argument the locale which has to be + used. To access the values we have to redefine the _NL_CURRENT + macro. */ +# define strftime __strftime_l +# define wcsftime __wcsftime_l +# undef _NL_CURRENT +# define _NL_CURRENT(category, item) \ + (current->values[_NL_ITEM_INDEX (item)].string) +# define LOCALE_PARAM , __locale_t loc +# define LOCALE_ARG , loc +# define HELPER_LOCALE_ARG , current +#else +# define LOCALE_PARAM +# define LOCALE_ARG +# ifdef _LIBC +# define HELPER_LOCALE_ARG , _NL_CURRENT_DATA (LC_TIME) +# else +# define HELPER_LOCALE_ARG +# endif +#endif + +#ifdef COMPILE_WIDE +# ifdef USE_IN_EXTENDED_LOCALE_MODEL +# define TOUPPER(Ch, L) __towupper_l (Ch, L) +# define TOLOWER(Ch, L) __towlower_l (Ch, L) +# else +# define TOUPPER(Ch, L) towupper (Ch) +# define TOLOWER(Ch, L) towlower (Ch) +# endif +#else +# ifdef USE_IN_EXTENDED_LOCALE_MODEL +# define TOUPPER(Ch, L) __toupper_l (Ch, L) +# define TOLOWER(Ch, L) __tolower_l (Ch, L) +# else +# define TOUPPER(Ch, L) toupper (Ch) +# define TOLOWER(Ch, L) tolower (Ch) +# endif +#endif +/* We don't use 'isdigit' here since the locale dependent + interpretation is not what we want here. We only need to accept + the arabic digits in the ASCII range. One day there is perhaps a + more reliable way to accept other sets of digits. */ +#define ISDIGIT(Ch) ((unsigned int) (Ch) - L_('0') <= 9) + +#if FPRINTFTIME +static void +fwrite_lowcase (FILE *fp, const CHAR_T *src, size_t len) +{ + while (len-- > 0) + { + fputc (TOLOWER ((UCHAR_T) *src, loc), fp); + ++src; + } +} + +static void +fwrite_uppcase (FILE *fp, const CHAR_T *src, size_t len) +{ + while (len-- > 0) + { + fputc (TOUPPER ((UCHAR_T) *src, loc), fp); + ++src; + } +} +#else +static CHAR_T *memcpy_lowcase (CHAR_T *dest, const CHAR_T *src, + size_t len LOCALE_PARAM); + +static CHAR_T * +memcpy_lowcase (CHAR_T *dest, const CHAR_T *src, size_t len LOCALE_PARAM) +{ + while (len-- > 0) + dest[len] = TOLOWER ((UCHAR_T) src[len], loc); + return dest; +} + +static CHAR_T *memcpy_uppcase (CHAR_T *dest, const CHAR_T *src, + size_t len LOCALE_PARAM); + +static CHAR_T * +memcpy_uppcase (CHAR_T *dest, const CHAR_T *src, size_t len LOCALE_PARAM) +{ + while (len-- > 0) + dest[len] = TOUPPER ((UCHAR_T) src[len], loc); + return dest; +} +#endif + + +#if ! HAVE_TM_GMTOFF +/* Yield the difference between *A and *B, + measured in seconds, ignoring leap seconds. */ +# define tm_diff ftime_tm_diff +static int tm_diff (const struct tm *, const struct tm *); +static int +tm_diff (const struct tm *a, const struct tm *b) +{ + /* Compute intervening leap days correctly even if year is negative. + Take care to avoid int overflow in leap day calculations, + but it's OK to assume that A and B are close to each other. */ + int a4 = SHR (a->tm_year, 2) + SHR (TM_YEAR_BASE, 2) - ! (a->tm_year & 3); + int b4 = SHR (b->tm_year, 2) + SHR (TM_YEAR_BASE, 2) - ! (b->tm_year & 3); + int a100 = a4 / 25 - (a4 % 25 < 0); + int b100 = b4 / 25 - (b4 % 25 < 0); + int a400 = SHR (a100, 2); + int b400 = SHR (b100, 2); + int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400); + int years = a->tm_year - b->tm_year; + int days = (365 * years + intervening_leap_days + + (a->tm_yday - b->tm_yday)); + return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour)) + + (a->tm_min - b->tm_min)) + + (a->tm_sec - b->tm_sec)); +} +#endif /* ! HAVE_TM_GMTOFF */ + + + +/* The number of days from the first day of the first ISO week of this + year to the year day YDAY with week day WDAY. ISO weeks start on + Monday; the first ISO week has the year's first Thursday. YDAY may + be as small as YDAY_MINIMUM. */ +#define ISO_WEEK_START_WDAY 1 /* Monday */ +#define ISO_WEEK1_WDAY 4 /* Thursday */ +#define YDAY_MINIMUM (-366) +static int iso_week_days (int, int); +#ifdef __GNUC__ +__inline__ +#endif +static int +iso_week_days (int yday, int wday) +{ + /* Add enough to the first operand of % to make it nonnegative. */ + int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7; + return (yday + - (yday - wday + ISO_WEEK1_WDAY + big_enough_multiple_of_7) % 7 + + ISO_WEEK1_WDAY - ISO_WEEK_START_WDAY); +} + + +/* When compiling this file, GNU applications can #define my_strftime + to a symbol (typically nstrftime) to get an extended strftime with + extra arguments TZ and NS. */ + +#if FPRINTFTIME +# undef my_strftime +# define my_strftime fprintftime +#endif + +#ifdef my_strftime +# undef HAVE_TZSET +# define extra_args , tz, ns +# define extra_args_spec , timezone_t tz, int ns +#else +# if defined COMPILE_WIDE +# define my_strftime wcsftime +# define nl_get_alt_digit _nl_get_walt_digit +# else +# define my_strftime strftime +# define nl_get_alt_digit _nl_get_alt_digit +# endif +# define extra_args +# define extra_args_spec +/* We don't have this information in general. */ +# define tz 1 +# define ns 0 +#endif + +static size_t __strftime_internal (STREAM_OR_CHAR_T *, STRFTIME_ARG (size_t) + const CHAR_T *, const struct tm *, + bool, bool * + extra_args_spec LOCALE_PARAM); + +/* Write information from TP into S according to the format + string FORMAT, writing no more that MAXSIZE characters + (including the terminating '\0') and returning number of + characters written. If S is NULL, nothing will be written + anywhere, so to determine how many characters would be + written, use NULL for S and (size_t) -1 for MAXSIZE. */ +size_t +my_strftime (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) + const CHAR_T *format, + const struct tm *tp extra_args_spec LOCALE_PARAM) +{ + bool tzset_called = false; + return __strftime_internal (s, STRFTIME_ARG (maxsize) format, tp, + false, &tzset_called extra_args LOCALE_ARG); +} +#if defined _LIBC && ! FPRINTFTIME +libc_hidden_def (my_strftime) +#endif + +/* Just like my_strftime, above, but with two more parameters. + UPCASE indicate that the result should be converted to upper case, + and *TZSET_CALLED indicates whether tzset has been called here. */ +static size_t +__strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) + const CHAR_T *format, + const struct tm *tp, bool upcase, bool *tzset_called + extra_args_spec LOCALE_PARAM) +{ +#if defined _LIBC && defined USE_IN_EXTENDED_LOCALE_MODEL + struct __locale_data *const current = loc->__locales[LC_TIME]; +#endif +#if FPRINTFTIME + size_t maxsize = (size_t) -1; +#endif + + int hour12 = tp->tm_hour; +#ifdef _NL_CURRENT + /* We cannot make the following values variables since we must delay + the evaluation of these values until really needed since some + expressions might not be valid in every situation. The 'struct tm' + might be generated by a strptime() call that initialized + only a few elements. Dereference the pointers only if the format + requires this. Then it is ok to fail if the pointers are invalid. */ +# define a_wkday \ + ((const CHAR_T *) (tp->tm_wday < 0 || tp->tm_wday > 6 \ + ? "?" : _NL_CURRENT (LC_TIME, NLW(ABDAY_1) + tp->tm_wday))) +# define f_wkday \ + ((const CHAR_T *) (tp->tm_wday < 0 || tp->tm_wday > 6 \ + ? "?" : _NL_CURRENT (LC_TIME, NLW(DAY_1) + tp->tm_wday))) +# define a_month \ + ((const CHAR_T *) (tp->tm_mon < 0 || tp->tm_mon > 11 \ + ? "?" : _NL_CURRENT (LC_TIME, NLW(ABMON_1) + tp->tm_mon))) +# define f_month \ + ((const CHAR_T *) (tp->tm_mon < 0 || tp->tm_mon > 11 \ + ? "?" : _NL_CURRENT (LC_TIME, NLW(MON_1) + tp->tm_mon))) +# define ampm \ + ((const CHAR_T *) _NL_CURRENT (LC_TIME, tp->tm_hour > 11 \ + ? NLW(PM_STR) : NLW(AM_STR))) + +# define aw_len STRLEN (a_wkday) +# define am_len STRLEN (a_month) +# define ap_len STRLEN (ampm) +#endif +#if HAVE_TZNAME + char **tzname_vec = tzname; +#endif + const char *zone; + size_t i = 0; + STREAM_OR_CHAR_T *p = s; + const CHAR_T *f; +#if DO_MULTIBYTE && !defined COMPILE_WIDE + const char *format_end = NULL; +#endif + +#if ! defined _LIBC && ! HAVE_RUN_TZSET_TEST + /* Solaris 2.5.x and 2.6 tzset sometimes modify the storage returned + by localtime. On such systems, we must either use the tzset and + localtime wrappers to work around the bug (which sets + HAVE_RUN_TZSET_TEST) or make a copy of the structure. */ + struct tm copy = *tp; + tp = © +#endif + + zone = NULL; +#if HAVE_TM_ZONE + /* The POSIX test suite assumes that setting + the environment variable TZ to a new value before calling strftime() + will influence the result (the %Z format) even if the information in + TP is computed with a totally different time zone. + This is bogus: though POSIX allows bad behavior like this, + POSIX does not require it. Do the right thing instead. */ + zone = (const char *) tp->tm_zone; +#endif +#if HAVE_TZNAME + if (!tz) + { + if (! (zone && *zone)) + zone = "GMT"; + } + else + { +# if !HAVE_TM_ZONE + /* Infer the zone name from *TZ instead of from TZNAME. */ + tzname_vec = tz->tzname_copy; +# endif + } + /* The tzset() call might have changed the value. */ + if (!(zone && *zone) && tp->tm_isdst >= 0) + { + /* POSIX.1 requires that local time zone information be used as + though strftime called tzset. */ +# if HAVE_TZSET + if (!*tzset_called) + { + tzset (); + *tzset_called = true; + } +# endif + zone = tzname_vec[tp->tm_isdst != 0]; + } +#endif + if (! zone) + zone = ""; + + if (hour12 > 12) + hour12 -= 12; + else + if (hour12 == 0) + hour12 = 12; + + for (f = format; *f != '\0'; ++f) + { + int pad = 0; /* Padding for number ('-', '_', or 0). */ + int modifier; /* Field modifier ('E', 'O', or 0). */ + int digits = 0; /* Max digits for numeric format. */ + int number_value; /* Numeric value to be printed. */ + unsigned int u_number_value; /* (unsigned int) number_value. */ + bool negative_number; /* The number is negative. */ + bool always_output_a_sign; /* +/- should always be output. */ + int tz_colon_mask; /* Bitmask of where ':' should appear. */ + const CHAR_T *subfmt; + CHAR_T sign_char; + CHAR_T *bufp; + CHAR_T buf[1 + + 2 /* for the two colons in a %::z or %:::z time zone */ + + (sizeof (int) < sizeof (time_t) + ? INT_STRLEN_BOUND (time_t) + : INT_STRLEN_BOUND (int))]; + int width = -1; + bool to_lowcase = false; + bool to_uppcase = upcase; + size_t colons; + bool change_case = false; + int format_char; + +#if DO_MULTIBYTE && !defined COMPILE_WIDE + switch (*f) + { + case L_('%'): + break; + + case L_('\b'): case L_('\t'): case L_('\n'): + case L_('\v'): case L_('\f'): case L_('\r'): + case L_(' '): case L_('!'): case L_('"'): case L_('#'): case L_('&'): + case L_('\''): case L_('('): case L_(')'): case L_('*'): case L_('+'): + case L_(','): case L_('-'): case L_('.'): case L_('/'): case L_('0'): + case L_('1'): case L_('2'): case L_('3'): case L_('4'): case L_('5'): + case L_('6'): case L_('7'): case L_('8'): case L_('9'): case L_(':'): + case L_(';'): case L_('<'): case L_('='): case L_('>'): case L_('?'): + case L_('A'): case L_('B'): case L_('C'): case L_('D'): case L_('E'): + case L_('F'): case L_('G'): case L_('H'): case L_('I'): case L_('J'): + case L_('K'): case L_('L'): case L_('M'): case L_('N'): case L_('O'): + case L_('P'): case L_('Q'): case L_('R'): case L_('S'): case L_('T'): + case L_('U'): case L_('V'): case L_('W'): case L_('X'): case L_('Y'): + case L_('Z'): case L_('['): case L_('\\'): case L_(']'): case L_('^'): + case L_('_'): case L_('a'): case L_('b'): case L_('c'): case L_('d'): + case L_('e'): case L_('f'): case L_('g'): case L_('h'): case L_('i'): + case L_('j'): case L_('k'): case L_('l'): case L_('m'): case L_('n'): + case L_('o'): case L_('p'): case L_('q'): case L_('r'): case L_('s'): + case L_('t'): case L_('u'): case L_('v'): case L_('w'): case L_('x'): + case L_('y'): case L_('z'): case L_('{'): case L_('|'): case L_('}'): + case L_('~'): + /* The C Standard requires these 98 characters (plus '%') to + be in the basic execution character set. None of these + characters can start a multibyte sequence, so they need + not be analyzed further. */ + add1 (*f); + continue; + + default: + /* Copy this multibyte sequence until we reach its end, find + an error, or come back to the initial shift state. */ + { + mbstate_t mbstate = mbstate_zero; + size_t len = 0; + size_t fsize; + + if (! format_end) + format_end = f + strlen (f) + 1; + fsize = format_end - f; + + do + { + size_t bytes = mbrlen (f + len, fsize - len, &mbstate); + + if (bytes == 0) + break; + + if (bytes == (size_t) -2) + { + len += strlen (f + len); + break; + } + + if (bytes == (size_t) -1) + { + len++; + break; + } + + len += bytes; + } + while (! mbsinit (&mbstate)); + + cpy (len, f); + f += len - 1; + continue; + } + } + +#else /* ! DO_MULTIBYTE */ + + /* Either multibyte encodings are not supported, they are + safe for formats, so any non-'%' byte can be copied through, + or this is the wide character version. */ + if (*f != L_('%')) + { + add1 (*f); + continue; + } + +#endif /* ! DO_MULTIBYTE */ + + /* Check for flags that can modify a format. */ + while (1) + { + switch (*++f) + { + /* This influences the number formats. */ + case L_('_'): + case L_('-'): + case L_('0'): + pad = *f; + continue; + + /* This changes textual output. */ + case L_('^'): + to_uppcase = true; + continue; + case L_('#'): + change_case = true; + continue; + + default: + break; + } + break; + } + + /* As a GNU extension we allow the field width to be specified. */ + if (ISDIGIT (*f)) + { + width = 0; + do + { + if (width > INT_MAX / 10 + || (width == INT_MAX / 10 && *f - L_('0') > INT_MAX % 10)) + /* Avoid overflow. */ + width = INT_MAX; + else + { + width *= 10; + width += *f - L_('0'); + } + ++f; + } + while (ISDIGIT (*f)); + } + + /* Check for modifiers. */ + switch (*f) + { + case L_('E'): + case L_('O'): + modifier = *f++; + break; + + default: + modifier = 0; + break; + } + + /* Now do the specified format. */ + format_char = *f; + switch (format_char) + { +#define DO_NUMBER(d, v) \ + do \ + { \ + digits = d; \ + number_value = v; \ + goto do_number; \ + } \ + while (0) +#define DO_SIGNED_NUMBER(d, negative, v) \ + do \ + { \ + digits = d; \ + negative_number = negative; \ + u_number_value = v; \ + goto do_signed_number; \ + } \ + while (0) + + /* The mask is not what you might think. + When the ordinal i'th bit is set, insert a colon + before the i'th digit of the time zone representation. */ +#define DO_TZ_OFFSET(d, mask, v) \ + do \ + { \ + digits = d; \ + tz_colon_mask = mask; \ + u_number_value = v; \ + goto do_tz_offset; \ + } \ + while (0) +#define DO_NUMBER_SPACEPAD(d, v) \ + do \ + { \ + digits = d; \ + number_value = v; \ + goto do_number_spacepad; \ + } \ + while (0) + + case L_('%'): + if (modifier != 0) + goto bad_format; + add1 (*f); + break; + + case L_('a'): + if (modifier != 0) + goto bad_format; + if (change_case) + { + to_uppcase = true; + to_lowcase = false; + } +#ifdef _NL_CURRENT + cpy (aw_len, a_wkday); + break; +#else + goto underlying_strftime; +#endif + + case 'A': + if (modifier != 0) + goto bad_format; + if (change_case) + { + to_uppcase = true; + to_lowcase = false; + } +#ifdef _NL_CURRENT + cpy (STRLEN (f_wkday), f_wkday); + break; +#else + goto underlying_strftime; +#endif + + case L_('b'): + case L_('h'): + if (change_case) + { + to_uppcase = true; + to_lowcase = false; + } + if (modifier != 0) + goto bad_format; +#ifdef _NL_CURRENT + cpy (am_len, a_month); + break; +#else + goto underlying_strftime; +#endif + + case L_('B'): + if (modifier != 0) + goto bad_format; + if (change_case) + { + to_uppcase = true; + to_lowcase = false; + } +#ifdef _NL_CURRENT + cpy (STRLEN (f_month), f_month); + break; +#else + goto underlying_strftime; +#endif + + case L_('c'): + if (modifier == L_('O')) + goto bad_format; +#ifdef _NL_CURRENT + if (! (modifier == 'E' + && (*(subfmt = + (const CHAR_T *) _NL_CURRENT (LC_TIME, + NLW(ERA_D_T_FMT))) + != '\0'))) + subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_T_FMT)); +#else + goto underlying_strftime; +#endif + + subformat: + { + size_t len = __strftime_internal (NULL, STRFTIME_ARG ((size_t) -1) + subfmt, + tp, to_uppcase, tzset_called + extra_args LOCALE_ARG); + add (len, __strftime_internal (p, + STRFTIME_ARG (maxsize - i) + subfmt, + tp, to_uppcase, tzset_called + extra_args LOCALE_ARG)); + } + break; + +#if !(defined _NL_CURRENT && HAVE_STRUCT_ERA_ENTRY) + underlying_strftime: + { + /* The relevant information is available only via the + underlying strftime implementation, so use that. */ + char ufmt[5]; + char *u = ufmt; + char ubuf[1024]; /* enough for any single format in practice */ + size_t len; + /* Make sure we're calling the actual underlying strftime. + In some cases, config.h contains something like + "#define strftime rpl_strftime". */ +# ifdef strftime +# undef strftime + size_t strftime (); +# endif + + /* The space helps distinguish strftime failure from empty + output. */ + *u++ = ' '; + *u++ = '%'; + if (modifier != 0) + *u++ = modifier; + *u++ = format_char; + *u = '\0'; + len = strftime (ubuf, sizeof ubuf, ufmt, tp); + if (len != 0) + cpy (len - 1, ubuf + 1); + } + break; +#endif + + case L_('C'): + if (modifier == L_('E')) + { +#if HAVE_STRUCT_ERA_ENTRY + struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG); + if (era) + { +# ifdef COMPILE_WIDE + size_t len = __wcslen (era->era_wname); + cpy (len, era->era_wname); +# else + size_t len = strlen (era->era_name); + cpy (len, era->era_name); +# endif + break; + } +#else + goto underlying_strftime; +#endif + } + + { + int century = tp->tm_year / 100 + TM_YEAR_BASE / 100; + century -= tp->tm_year % 100 < 0 && 0 < century; + DO_SIGNED_NUMBER (2, tp->tm_year < - TM_YEAR_BASE, century); + } + + case L_('x'): + if (modifier == L_('O')) + goto bad_format; +#ifdef _NL_CURRENT + if (! (modifier == L_('E') + && (*(subfmt = + (const CHAR_T *)_NL_CURRENT (LC_TIME, NLW(ERA_D_FMT))) + != L_('\0')))) + subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_FMT)); + goto subformat; +#else + goto underlying_strftime; +#endif + case L_('D'): + if (modifier != 0) + goto bad_format; + subfmt = L_("%m/%d/%y"); + goto subformat; + + case L_('d'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER (2, tp->tm_mday); + + case L_('e'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER_SPACEPAD (2, tp->tm_mday); + + /* All numeric formats set DIGITS and NUMBER_VALUE (or U_NUMBER_VALUE) + and then jump to one of these labels. */ + + do_tz_offset: + always_output_a_sign = true; + goto do_number_body; + + do_number_spacepad: + /* Force '_' flag unless overridden by '0' or '-' flag. */ + if (pad != L_('0') && pad != L_('-')) + pad = L_('_'); + + do_number: + /* Format NUMBER_VALUE according to the MODIFIER flag. */ + negative_number = number_value < 0; + u_number_value = number_value; + + do_signed_number: + always_output_a_sign = false; + tz_colon_mask = 0; + + do_number_body: + /* Format U_NUMBER_VALUE according to the MODIFIER flag. + NEGATIVE_NUMBER is nonzero if the original number was + negative; in this case it was converted directly to + unsigned int (i.e., modulo (UINT_MAX + 1)) without + negating it. */ + if (modifier == L_('O') && !negative_number) + { +#ifdef _NL_CURRENT + /* Get the locale specific alternate representation of + the number. If none exist NULL is returned. */ + const CHAR_T *cp = nl_get_alt_digit (u_number_value + HELPER_LOCALE_ARG); + + if (cp != NULL) + { + size_t digitlen = STRLEN (cp); + if (digitlen != 0) + { + cpy (digitlen, cp); + break; + } + } +#else + goto underlying_strftime; +#endif + } + + bufp = buf + sizeof (buf) / sizeof (buf[0]); + + if (negative_number) + u_number_value = - u_number_value; + + do + { + if (tz_colon_mask & 1) + *--bufp = ':'; + tz_colon_mask >>= 1; + *--bufp = u_number_value % 10 + L_('0'); + u_number_value /= 10; + } + while (u_number_value != 0 || tz_colon_mask != 0); + + do_number_sign_and_padding: + if (digits < width) + digits = width; + + sign_char = (negative_number ? L_('-') + : always_output_a_sign ? L_('+') + : 0); + + if (pad == L_('-')) + { + if (sign_char) + add1 (sign_char); + } + else + { + int padding = digits - (buf + (sizeof (buf) / sizeof (buf[0])) + - bufp) - !!sign_char; + + if (padding > 0) + { + if (pad == L_('_')) + { + if ((size_t) padding >= maxsize - i) + return 0; + + if (p) + memset_space (p, padding); + i += padding; + width = width > padding ? width - padding : 0; + if (sign_char) + add1 (sign_char); + } + else + { + if ((size_t) digits >= maxsize - i) + return 0; + + if (sign_char) + add1 (sign_char); + + if (p) + memset_zero (p, padding); + i += padding; + width = 0; + } + } + else + { + if (sign_char) + add1 (sign_char); + } + } + + cpy (buf + sizeof (buf) / sizeof (buf[0]) - bufp, bufp); + break; + + case L_('F'): + if (modifier != 0) + goto bad_format; + subfmt = L_("%Y-%m-%d"); + goto subformat; + + case L_('H'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER (2, tp->tm_hour); + + case L_('I'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER (2, hour12); + + case L_('k'): /* GNU extension. */ + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER_SPACEPAD (2, tp->tm_hour); + + case L_('l'): /* GNU extension. */ + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER_SPACEPAD (2, hour12); + + case L_('j'): + if (modifier == L_('E')) + goto bad_format; + + DO_SIGNED_NUMBER (3, tp->tm_yday < -1, tp->tm_yday + 1U); + + case L_('M'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER (2, tp->tm_min); + + case L_('m'): + if (modifier == L_('E')) + goto bad_format; + + DO_SIGNED_NUMBER (2, tp->tm_mon < -1, tp->tm_mon + 1U); + +#ifndef _LIBC + case L_('N'): /* GNU extension. */ + if (modifier == L_('E')) + goto bad_format; + + number_value = ns; + if (width == -1) + width = 9; + else + { + /* Take an explicit width less than 9 as a precision. */ + int j; + for (j = width; j < 9; j++) + number_value /= 10; + } + + DO_NUMBER (width, number_value); +#endif + + case L_('n'): + add1 (L_('\n')); + break; + + case L_('P'): + to_lowcase = true; +#ifndef _NL_CURRENT + format_char = L_('p'); +#endif + FALLTHROUGH; + case L_('p'): + if (change_case) + { + to_uppcase = false; + to_lowcase = true; + } +#ifdef _NL_CURRENT + cpy (ap_len, ampm); + break; +#else + goto underlying_strftime; +#endif + + case L_('q'): /* GNU extension. */ + DO_SIGNED_NUMBER (1, false, ((tp->tm_mon * 11) >> 5) + 1); + break; + + case L_('R'): + subfmt = L_("%H:%M"); + goto subformat; + + case L_('r'): +#ifdef _NL_CURRENT + if (*(subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, + NLW(T_FMT_AMPM))) + == L_('\0')) + subfmt = L_("%I:%M:%S %p"); + goto subformat; +#else + goto underlying_strftime; +#endif + + case L_('S'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER (2, tp->tm_sec); + + case L_('s'): /* GNU extension. */ + { + struct tm ltm; + time_t t; + + ltm = *tp; + t = mktime_z (tz, <m); + + /* Generate string value for T using time_t arithmetic; + this works even if sizeof (long) < sizeof (time_t). */ + + bufp = buf + sizeof (buf) / sizeof (buf[0]); + negative_number = t < 0; + + do + { + int d = t % 10; + t /= 10; + *--bufp = (negative_number ? -d : d) + L_('0'); + } + while (t != 0); + + digits = 1; + always_output_a_sign = false; + goto do_number_sign_and_padding; + } + + case L_('X'): + if (modifier == L_('O')) + goto bad_format; +#ifdef _NL_CURRENT + if (! (modifier == L_('E') + && (*(subfmt = + (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ERA_T_FMT))) + != L_('\0')))) + subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(T_FMT)); + goto subformat; +#else + goto underlying_strftime; +#endif + case L_('T'): + subfmt = L_("%H:%M:%S"); + goto subformat; + + case L_('t'): + add1 (L_('\t')); + break; + + case L_('u'): + DO_NUMBER (1, (tp->tm_wday - 1 + 7) % 7 + 1); + + case L_('U'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER (2, (tp->tm_yday - tp->tm_wday + 7) / 7); + + case L_('V'): + case L_('g'): + case L_('G'): + if (modifier == L_('E')) + goto bad_format; + { + /* YEAR is a leap year if and only if (tp->tm_year + TM_YEAR_BASE) + is a leap year, except that YEAR and YEAR - 1 both work + correctly even when (tp->tm_year + TM_YEAR_BASE) would + overflow. */ + int year = (tp->tm_year + + (tp->tm_year < 0 + ? TM_YEAR_BASE % 400 + : TM_YEAR_BASE % 400 - 400)); + int year_adjust = 0; + int days = iso_week_days (tp->tm_yday, tp->tm_wday); + + if (days < 0) + { + /* This ISO week belongs to the previous year. */ + year_adjust = -1; + days = iso_week_days (tp->tm_yday + (365 + __isleap (year - 1)), + tp->tm_wday); + } + else + { + int d = iso_week_days (tp->tm_yday - (365 + __isleap (year)), + tp->tm_wday); + if (0 <= d) + { + /* This ISO week belongs to the next year. */ + year_adjust = 1; + days = d; + } + } + + switch (*f) + { + case L_('g'): + { + int yy = (tp->tm_year % 100 + year_adjust) % 100; + DO_NUMBER (2, (0 <= yy + ? yy + : tp->tm_year < -TM_YEAR_BASE - year_adjust + ? -yy + : yy + 100)); + } + + case L_('G'): + DO_SIGNED_NUMBER (4, tp->tm_year < -TM_YEAR_BASE - year_adjust, + (tp->tm_year + (unsigned int) TM_YEAR_BASE + + year_adjust)); + + default: + DO_NUMBER (2, days / 7 + 1); + } + } + + case L_('W'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER (2, (tp->tm_yday - (tp->tm_wday - 1 + 7) % 7 + 7) / 7); + + case L_('w'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER (1, tp->tm_wday); + + case L_('Y'): + if (modifier == 'E') + { +#if HAVE_STRUCT_ERA_ENTRY + struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG); + if (era) + { +# ifdef COMPILE_WIDE + subfmt = era->era_wformat; +# else + subfmt = era->era_format; +# endif + goto subformat; + } +#else + goto underlying_strftime; +#endif + } + if (modifier == L_('O')) + goto bad_format; + + DO_SIGNED_NUMBER (4, tp->tm_year < -TM_YEAR_BASE, + tp->tm_year + (unsigned int) TM_YEAR_BASE); + + case L_('y'): + if (modifier == L_('E')) + { +#if HAVE_STRUCT_ERA_ENTRY + struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG); + if (era) + { + int delta = tp->tm_year - era->start_date[0]; + DO_NUMBER (1, (era->offset + + delta * era->absolute_direction)); + } +#else + goto underlying_strftime; +#endif + } + + { + int yy = tp->tm_year % 100; + if (yy < 0) + yy = tp->tm_year < - TM_YEAR_BASE ? -yy : yy + 100; + DO_NUMBER (2, yy); + } + + case L_('Z'): + if (change_case) + { + to_uppcase = false; + to_lowcase = true; + } + +#ifdef COMPILE_WIDE + { + /* The zone string is always given in multibyte form. We have + to transform it first. */ + wchar_t *wczone; + size_t len; + widen (zone, wczone, len); + cpy (len, wczone); + } +#else + cpy (strlen (zone), zone); +#endif + break; + + case L_(':'): + /* :, ::, and ::: are valid only just before 'z'. + :::: etc. are rejected later. */ + for (colons = 1; f[colons] == L_(':'); colons++) + continue; + if (f[colons] != L_('z')) + goto bad_format; + f += colons; + goto do_z_conversion; + + case L_('z'): + colons = 0; + + do_z_conversion: + if (tp->tm_isdst < 0) + break; + + { + int diff; + int hour_diff; + int min_diff; + int sec_diff; +#if HAVE_TM_GMTOFF + diff = tp->tm_gmtoff; +#else + if (!tz) + diff = 0; + else + { + struct tm gtm; + struct tm ltm; + time_t lt; + + /* POSIX.1 requires that local time zone information be used as + though strftime called tzset. */ +# if HAVE_TZSET + if (!*tzset_called) + { + tzset (); + *tzset_called = true; + } +# endif + + ltm = *tp; + lt = mktime_z (tz, <m); + + if (lt == (time_t) -1) + { + /* mktime returns -1 for errors, but -1 is also a + valid time_t value. Check whether an error really + occurred. */ + struct tm tm; + + if (! localtime_rz (tz, <, &tm) + || ((ltm.tm_sec ^ tm.tm_sec) + | (ltm.tm_min ^ tm.tm_min) + | (ltm.tm_hour ^ tm.tm_hour) + | (ltm.tm_mday ^ tm.tm_mday) + | (ltm.tm_mon ^ tm.tm_mon) + | (ltm.tm_year ^ tm.tm_year))) + break; + } + + if (! localtime_rz (0, <, >m)) + break; + + diff = tm_diff (<m, >m); + } +#endif + + negative_number = diff < 0 || (diff == 0 && *zone == '-'); + hour_diff = diff / 60 / 60; + min_diff = diff / 60 % 60; + sec_diff = diff % 60; + + switch (colons) + { + case 0: /* +hhmm */ + DO_TZ_OFFSET (5, 0, hour_diff * 100 + min_diff); + + case 1: tz_hh_mm: /* +hh:mm */ + DO_TZ_OFFSET (6, 04, hour_diff * 100 + min_diff); + + case 2: tz_hh_mm_ss: /* +hh:mm:ss */ + DO_TZ_OFFSET (9, 024, + hour_diff * 10000 + min_diff * 100 + sec_diff); + + case 3: /* +hh if possible, else +hh:mm, else +hh:mm:ss */ + if (sec_diff != 0) + goto tz_hh_mm_ss; + if (min_diff != 0) + goto tz_hh_mm; + DO_TZ_OFFSET (3, 0, hour_diff); + + default: + goto bad_format; + } + } + + case L_('\0'): /* GNU extension: % at end of format. */ + --f; + FALLTHROUGH; + default: + /* Unknown format; output the format, including the '%', + since this is most likely the right thing to do if a + multibyte string has been misparsed. */ + bad_format: + { + int flen; + for (flen = 1; f[1 - flen] != L_('%'); flen++) + continue; + cpy (flen, &f[1 - flen]); + } + break; + } + } + +#if ! FPRINTFTIME + if (p && maxsize != 0) + *p = L_('\0'); +#endif + + return i; +} diff --git a/local/recipes/tools/diffutils/source/lib/strftime.h b/local/recipes/tools/diffutils/source/lib/strftime.h new file mode 100644 index 0000000000..27a8d62412 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/strftime.h @@ -0,0 +1,33 @@ +/* declarations for strftime.c + + Copyright (C) 2002, 2004, 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <time.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* Just like strftime, but with two more arguments: + POSIX requires that strftime use the local timezone information. + Use the timezone __TZ instead. Use __NS as the number of + nanoseconds in the %N directive. */ +size_t nstrftime (char *, size_t, char const *, struct tm const *, + timezone_t __tz, int __ns); + +#ifdef __cplusplus +} +#endif diff --git a/local/recipes/tools/diffutils/source/lib/striconv.c b/local/recipes/tools/diffutils/source/lib/striconv.c new file mode 100644 index 0000000000..d4efad23f3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/striconv.c @@ -0,0 +1,463 @@ +/* Charset conversion. + Copyright (C) 2001-2007, 2010-2017 Free Software Foundation, Inc. + Written by Bruno Haible and Simon Josefsson. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "striconv.h" + +#include <errno.h> +#include <stdlib.h> +#include <string.h> + +#if HAVE_ICONV +# include <iconv.h> +/* Get MB_LEN_MAX, CHAR_BIT. */ +# include <limits.h> +#endif + +#include "c-strcase.h" + +#ifndef SIZE_MAX +# define SIZE_MAX ((size_t) -1) +#endif + + +#if HAVE_ICONV + +int +mem_cd_iconv (const char *src, size_t srclen, iconv_t cd, + char **resultp, size_t *lengthp) +{ +# define tmpbufsize 4096 + size_t length; + char *result; + + /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */ +# if defined _LIBICONV_VERSION \ + || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \ + || defined __sun) + /* Set to the initial state. */ + iconv (cd, NULL, NULL, NULL, NULL); +# endif + + /* Determine the length we need. */ + { + size_t count = 0; + /* The alignment is needed when converting e.g. to glibc's WCHAR_T or + libiconv's UCS-4-INTERNAL encoding. */ + union { unsigned int align; char buf[tmpbufsize]; } tmp; +# define tmpbuf tmp.buf + const char *inptr = src; + size_t insize = srclen; + + while (insize > 0) + { + char *outptr = tmpbuf; + size_t outsize = tmpbufsize; + size_t res = iconv (cd, + (ICONV_CONST char **) &inptr, &insize, + &outptr, &outsize); + + if (res == (size_t)(-1)) + { + if (errno == E2BIG) + ; + else if (errno == EINVAL) + break; + else + return -1; + } +# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__) + /* Irix iconv() inserts a NUL byte if it cannot convert. + NetBSD iconv() inserts a question mark if it cannot convert. + Only GNU libiconv and GNU libc are known to prefer to fail rather + than doing a lossy conversion. */ + else if (res > 0) + { + errno = EILSEQ; + return -1; + } +# endif + count += outptr - tmpbuf; + } + /* Avoid glibc-2.1 bug and Solaris 2.7 bug. */ +# if defined _LIBICONV_VERSION \ + || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \ + || defined __sun) + { + char *outptr = tmpbuf; + size_t outsize = tmpbufsize; + size_t res = iconv (cd, NULL, NULL, &outptr, &outsize); + + if (res == (size_t)(-1)) + return -1; + count += outptr - tmpbuf; + } +# endif + length = count; +# undef tmpbuf + } + + if (length == 0) + { + *lengthp = 0; + return 0; + } + if (*resultp != NULL && *lengthp >= length) + result = *resultp; + else + { + result = (char *) malloc (length); + if (result == NULL) + { + errno = ENOMEM; + return -1; + } + } + + /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */ +# if defined _LIBICONV_VERSION \ + || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \ + || defined __sun) + /* Return to the initial state. */ + iconv (cd, NULL, NULL, NULL, NULL); +# endif + + /* Do the conversion for real. */ + { + const char *inptr = src; + size_t insize = srclen; + char *outptr = result; + size_t outsize = length; + + while (insize > 0) + { + size_t res = iconv (cd, + (ICONV_CONST char **) &inptr, &insize, + &outptr, &outsize); + + if (res == (size_t)(-1)) + { + if (errno == EINVAL) + break; + else + goto fail; + } +# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__) + /* Irix iconv() inserts a NUL byte if it cannot convert. + NetBSD iconv() inserts a question mark if it cannot convert. + Only GNU libiconv and GNU libc are known to prefer to fail rather + than doing a lossy conversion. */ + else if (res > 0) + { + errno = EILSEQ; + goto fail; + } +# endif + } + /* Avoid glibc-2.1 bug and Solaris 2.7 bug. */ +# if defined _LIBICONV_VERSION \ + || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \ + || defined __sun) + { + size_t res = iconv (cd, NULL, NULL, &outptr, &outsize); + + if (res == (size_t)(-1)) + goto fail; + } +# endif + if (outsize != 0) + abort (); + } + + *resultp = result; + *lengthp = length; + + return 0; + + fail: + { + if (result != *resultp) + { + int saved_errno = errno; + free (result); + errno = saved_errno; + } + return -1; + } +# undef tmpbufsize +} + +char * +str_cd_iconv (const char *src, iconv_t cd) +{ + /* For most encodings, a trailing NUL byte in the input will be converted + to a trailing NUL byte in the output. But not for UTF-7. So that this + function is usable for UTF-7, we have to exclude the NUL byte from the + conversion and add it by hand afterwards. */ +# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__) + /* Irix iconv() inserts a NUL byte if it cannot convert. + NetBSD iconv() inserts a question mark if it cannot convert. + Only GNU libiconv and GNU libc are known to prefer to fail rather + than doing a lossy conversion. For other iconv() implementations, + we have to look at the number of irreversible conversions returned; + but this information is lost when iconv() returns for an E2BIG reason. + Therefore we cannot use the second, faster algorithm. */ + + char *result = NULL; + size_t length = 0; + int retval = mem_cd_iconv (src, strlen (src), cd, &result, &length); + char *final_result; + + if (retval < 0) + { + if (result != NULL) + abort (); + return NULL; + } + + /* Add the terminating NUL byte. */ + final_result = + (result != NULL ? realloc (result, length + 1) : malloc (length + 1)); + if (final_result == NULL) + { + free (result); + errno = ENOMEM; + return NULL; + } + final_result[length] = '\0'; + + return final_result; + +# else + /* This algorithm is likely faster than the one above. But it may produce + iconv() returns for an E2BIG reason, when the output size guess is too + small. Therefore it can only be used when we don't need the number of + irreversible conversions performed. */ + char *result; + size_t result_size; + size_t length; + const char *inptr = src; + size_t inbytes_remaining = strlen (src); + + /* Make a guess for the worst-case output size, in order to avoid a + realloc. It's OK if the guess is wrong as long as it is not zero and + doesn't lead to an integer overflow. */ + result_size = inbytes_remaining; + { + size_t approx_sqrt_SIZE_MAX = SIZE_MAX >> (sizeof (size_t) * CHAR_BIT / 2); + if (result_size <= approx_sqrt_SIZE_MAX / MB_LEN_MAX) + result_size *= MB_LEN_MAX; + } + result_size += 1; /* for the terminating NUL */ + + result = (char *) malloc (result_size); + if (result == NULL) + { + errno = ENOMEM; + return NULL; + } + + /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */ +# if defined _LIBICONV_VERSION \ + || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \ + || defined __sun) + /* Set to the initial state. */ + iconv (cd, NULL, NULL, NULL, NULL); +# endif + + /* Do the conversion. */ + { + char *outptr = result; + size_t outbytes_remaining = result_size - 1; + + for (;;) + { + /* Here inptr + inbytes_remaining = src + strlen (src), + outptr + outbytes_remaining = result + result_size - 1. */ + size_t res = iconv (cd, + (ICONV_CONST char **) &inptr, &inbytes_remaining, + &outptr, &outbytes_remaining); + + if (res == (size_t)(-1)) + { + if (errno == EINVAL) + break; + else if (errno == E2BIG) + { + size_t used = outptr - result; + size_t newsize = result_size * 2; + char *newresult; + + if (!(newsize > result_size)) + { + errno = ENOMEM; + goto failed; + } + newresult = (char *) realloc (result, newsize); + if (newresult == NULL) + { + errno = ENOMEM; + goto failed; + } + result = newresult; + result_size = newsize; + outptr = result + used; + outbytes_remaining = result_size - 1 - used; + } + else + goto failed; + } + else + break; + } + /* Avoid glibc-2.1 bug and Solaris 2.7 bug. */ +# if defined _LIBICONV_VERSION \ + || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \ + || defined __sun) + for (;;) + { + /* Here outptr + outbytes_remaining = result + result_size - 1. */ + size_t res = iconv (cd, NULL, NULL, &outptr, &outbytes_remaining); + + if (res == (size_t)(-1)) + { + if (errno == E2BIG) + { + size_t used = outptr - result; + size_t newsize = result_size * 2; + char *newresult; + + if (!(newsize > result_size)) + { + errno = ENOMEM; + goto failed; + } + newresult = (char *) realloc (result, newsize); + if (newresult == NULL) + { + errno = ENOMEM; + goto failed; + } + result = newresult; + result_size = newsize; + outptr = result + used; + outbytes_remaining = result_size - 1 - used; + } + else + goto failed; + } + else + break; + } +# endif + + /* Add the terminating NUL byte. */ + *outptr++ = '\0'; + + length = outptr - result; + } + + /* Give away unused memory. */ + if (length < result_size) + { + char *smaller_result = (char *) realloc (result, length); + + if (smaller_result != NULL) + result = smaller_result; + } + + return result; + + failed: + { + int saved_errno = errno; + free (result); + errno = saved_errno; + return NULL; + } + +# endif +} + +#endif + +char * +str_iconv (const char *src, const char *from_codeset, const char *to_codeset) +{ + if (*src == '\0' || c_strcasecmp (from_codeset, to_codeset) == 0) + { + char *result = strdup (src); + + if (result == NULL) + errno = ENOMEM; + return result; + } + else + { +#if HAVE_ICONV + iconv_t cd; + char *result; + + /* Avoid glibc-2.1 bug with EUC-KR. */ +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \ + && !defined _LIBICONV_VERSION + if (c_strcasecmp (from_codeset, "EUC-KR") == 0 + || c_strcasecmp (to_codeset, "EUC-KR") == 0) + { + errno = EINVAL; + return NULL; + } +# endif + cd = iconv_open (to_codeset, from_codeset); + if (cd == (iconv_t) -1) + return NULL; + + result = str_cd_iconv (src, cd); + + if (result == NULL) + { + /* Close cd, but preserve the errno from str_cd_iconv. */ + int saved_errno = errno; + iconv_close (cd); + errno = saved_errno; + } + else + { + if (iconv_close (cd) < 0) + { + /* Return NULL, but free the allocated memory, and while doing + that, preserve the errno from iconv_close. */ + int saved_errno = errno; + free (result); + errno = saved_errno; + return NULL; + } + } + return result; +#else + /* This is a different error code than if iconv_open existed but didn't + support from_codeset and to_codeset, so that the caller can emit + an error message such as + "iconv() is not supported. Installing GNU libiconv and + then reinstalling this package would fix this." */ + errno = ENOSYS; + return NULL; +#endif + } +} diff --git a/local/recipes/tools/diffutils/source/lib/striconv.h b/local/recipes/tools/diffutils/source/lib/striconv.h new file mode 100644 index 0000000000..fd3854cd8a --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/striconv.h @@ -0,0 +1,75 @@ +/* Charset conversion. + Copyright (C) 2001-2004, 2006-2007, 2009-2017 Free Software Foundation, Inc. + Written by Bruno Haible and Simon Josefsson. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _STRICONV_H +#define _STRICONV_H + +#include <stddef.h> +#if HAVE_ICONV +#include <iconv.h> +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +#if HAVE_ICONV + +/* Convert an entire string from one encoding to another, using iconv. + The original string is at [SRC,...,SRC+SRCLEN-1]. + The conversion descriptor is passed as CD. + *RESULTP and *LENGTH should initially be a scratch buffer and its size, + or *RESULTP can initially be NULL. + May erase the contents of the memory at *RESULTP. + Return value: 0 if successful, otherwise -1 and errno set. + If successful: The resulting string is stored in *RESULTP and its length + in *LENGTHP. *RESULTP is set to a freshly allocated memory block, or is + unchanged if no dynamic memory allocation was necessary. */ +extern int mem_cd_iconv (const char *src, size_t srclen, iconv_t cd, + char **resultp, size_t *lengthp); + +/* Convert an entire string from one encoding to another, using iconv. + The original string is the NUL-terminated string starting at SRC. + The conversion descriptor is passed as CD. Both the "from" and the "to" + encoding must use a single NUL byte at the end of the string (i.e. not + UCS-2, UCS-4, UTF-16, UTF-32). + Allocate a malloced memory block for the result. + Return value: the freshly allocated resulting NUL-terminated string if + successful, otherwise NULL and errno set. */ +extern char * str_cd_iconv (const char *src, iconv_t cd); + +#endif + +/* Convert an entire string from one encoding to another, using iconv. + The original string is the NUL-terminated string starting at SRC. + Both the "from" and the "to" encoding must use a single NUL byte at the + end of the string (i.e. not UCS-2, UCS-4, UTF-16, UTF-32). + Allocate a malloced memory block for the result. + Return value: the freshly allocated resulting NUL-terminated string if + successful, otherwise NULL and errno set. */ +extern char * str_iconv (const char *src, + const char *from_codeset, const char *to_codeset); + + +#ifdef __cplusplus +} +#endif + + +#endif /* _STRICONV_H */ diff --git a/local/recipes/tools/diffutils/source/lib/string.in.h b/local/recipes/tools/diffutils/source/lib/string.in.h new file mode 100644 index 0000000000..9a6b311d00 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/string.in.h @@ -0,0 +1,1046 @@ +/* A GNU-like <string.h>. + + Copyright (C) 1995-1996, 2001-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#if defined _GL_ALREADY_INCLUDING_STRING_H +/* Special invocation convention: + - On OS X/NetBSD we have a sequence of nested includes + <string.h> -> <strings.h> -> "string.h" + In this situation system _chk variants due to -D_FORTIFY_SOURCE + might be used after any replacements defined here. */ + +#@INCLUDE_NEXT@ @NEXT_STRING_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_STRING_H + +#define _GL_ALREADY_INCLUDING_STRING_H + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_STRING_H@ + +#undef _GL_ALREADY_INCLUDING_STRING_H + +#ifndef _@GUARD_PREFIX@_STRING_H +#define _@GUARD_PREFIX@_STRING_H + +/* NetBSD 5.0 mis-defines NULL. */ +#include <stddef.h> + +/* MirBSD defines mbslen as a macro. */ +#if @GNULIB_MBSLEN@ && defined __MirBSD__ +# include <wchar.h> +#endif + +/* The __attribute__ feature is available in gcc versions 2.5 and later. + The attribute __pure__ was added in gcc 2.96. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE /* empty */ +#endif + +/* NetBSD 5.0 declares strsignal in <unistd.h>, not in <string.h>. */ +/* But in any case avoid namespace pollution on glibc systems. */ +#if (@GNULIB_STRSIGNAL@ || defined GNULIB_POSIXCHECK) && defined __NetBSD__ \ + && ! defined __GLIBC__ +# include <unistd.h> +#endif + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + + +/* Find the index of the least-significant set bit. */ +#if @GNULIB_FFSL@ +# if !@HAVE_FFSL@ +_GL_FUNCDECL_SYS (ffsl, int, (long int i)); +# endif +_GL_CXXALIAS_SYS (ffsl, int, (long int i)); +_GL_CXXALIASWARN (ffsl); +#elif defined GNULIB_POSIXCHECK +# undef ffsl +# if HAVE_RAW_DECL_FFSL +_GL_WARN_ON_USE (ffsl, "ffsl is not portable - use the ffsl module"); +# endif +#endif + + +/* Find the index of the least-significant set bit. */ +#if @GNULIB_FFSLL@ +# if !@HAVE_FFSLL@ +_GL_FUNCDECL_SYS (ffsll, int, (long long int i)); +# endif +_GL_CXXALIAS_SYS (ffsll, int, (long long int i)); +_GL_CXXALIASWARN (ffsll); +#elif defined GNULIB_POSIXCHECK +# undef ffsll +# if HAVE_RAW_DECL_FFSLL +_GL_WARN_ON_USE (ffsll, "ffsll is not portable - use the ffsll module"); +# endif +#endif + + +/* Return the first instance of C within N bytes of S, or NULL. */ +#if @GNULIB_MEMCHR@ +# if @REPLACE_MEMCHR@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define memchr rpl_memchr +# endif +_GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n)); +# else +# if ! @HAVE_MEMCHR@ +_GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1))); +# endif + /* On some systems, this function is defined as an overloaded function: + extern "C" { const void * std::memchr (const void *, int, size_t); } + extern "C++" { void * std::memchr (void *, int, size_t); } */ +_GL_CXXALIAS_SYS_CAST2 (memchr, + void *, (void const *__s, int __c, size_t __n), + void const *, (void const *__s, int __c, size_t __n)); +# endif +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) +_GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n)); +_GL_CXXALIASWARN1 (memchr, void const *, + (void const *__s, int __c, size_t __n)); +# else +_GL_CXXALIASWARN (memchr); +# endif +#elif defined GNULIB_POSIXCHECK +# undef memchr +/* Assume memchr is always declared. */ +_GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - " + "use gnulib module memchr for portability" ); +#endif + +/* Return the first occurrence of NEEDLE in HAYSTACK. */ +#if @GNULIB_MEMMEM@ +# if @REPLACE_MEMMEM@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define memmem rpl_memmem +# endif +_GL_FUNCDECL_RPL (memmem, void *, + (void const *__haystack, size_t __haystack_len, + void const *__needle, size_t __needle_len) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1, 3))); +_GL_CXXALIAS_RPL (memmem, void *, + (void const *__haystack, size_t __haystack_len, + void const *__needle, size_t __needle_len)); +# else +# if ! @HAVE_DECL_MEMMEM@ +_GL_FUNCDECL_SYS (memmem, void *, + (void const *__haystack, size_t __haystack_len, + void const *__needle, size_t __needle_len) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1, 3))); +# endif +_GL_CXXALIAS_SYS (memmem, void *, + (void const *__haystack, size_t __haystack_len, + void const *__needle, size_t __needle_len)); +# endif +_GL_CXXALIASWARN (memmem); +#elif defined GNULIB_POSIXCHECK +# undef memmem +# if HAVE_RAW_DECL_MEMMEM +_GL_WARN_ON_USE (memmem, "memmem is unportable and often quadratic - " + "use gnulib module memmem-simple for portability, " + "and module memmem for speed" ); +# endif +#endif + +/* Copy N bytes of SRC to DEST, return pointer to bytes after the + last written byte. */ +#if @GNULIB_MEMPCPY@ +# if ! @HAVE_MEMPCPY@ +_GL_FUNCDECL_SYS (mempcpy, void *, + (void *restrict __dest, void const *restrict __src, + size_t __n) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (mempcpy, void *, + (void *restrict __dest, void const *restrict __src, + size_t __n)); +_GL_CXXALIASWARN (mempcpy); +#elif defined GNULIB_POSIXCHECK +# undef mempcpy +# if HAVE_RAW_DECL_MEMPCPY +_GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - " + "use gnulib module mempcpy for portability"); +# endif +#endif + +/* Search backwards through a block for a byte (specified as an int). */ +#if @GNULIB_MEMRCHR@ +# if ! @HAVE_DECL_MEMRCHR@ +_GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1))); +# endif + /* On some systems, this function is defined as an overloaded function: + extern "C++" { const void * std::memrchr (const void *, int, size_t); } + extern "C++" { void * std::memrchr (void *, int, size_t); } */ +_GL_CXXALIAS_SYS_CAST2 (memrchr, + void *, (void const *, int, size_t), + void const *, (void const *, int, size_t)); +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) +_GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t)); +_GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t)); +# else +_GL_CXXALIASWARN (memrchr); +# endif +#elif defined GNULIB_POSIXCHECK +# undef memrchr +# if HAVE_RAW_DECL_MEMRCHR +_GL_WARN_ON_USE (memrchr, "memrchr is unportable - " + "use gnulib module memrchr for portability"); +# endif +#endif + +/* Find the first occurrence of C in S. More efficient than + memchr(S,C,N), at the expense of undefined behavior if C does not + occur within N bytes. */ +#if @GNULIB_RAWMEMCHR@ +# if ! @HAVE_RAWMEMCHR@ +_GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1))); +# endif + /* On some systems, this function is defined as an overloaded function: + extern "C++" { const void * std::rawmemchr (const void *, int); } + extern "C++" { void * std::rawmemchr (void *, int); } */ +_GL_CXXALIAS_SYS_CAST2 (rawmemchr, + void *, (void const *__s, int __c_in), + void const *, (void const *__s, int __c_in)); +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) +_GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in)); +_GL_CXXALIASWARN1 (rawmemchr, void const *, (void const *__s, int __c_in)); +# else +_GL_CXXALIASWARN (rawmemchr); +# endif +#elif defined GNULIB_POSIXCHECK +# undef rawmemchr +# if HAVE_RAW_DECL_RAWMEMCHR +_GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - " + "use gnulib module rawmemchr for portability"); +# endif +#endif + +/* Copy SRC to DST, returning the address of the terminating '\0' in DST. */ +#if @GNULIB_STPCPY@ +# if ! @HAVE_STPCPY@ +_GL_FUNCDECL_SYS (stpcpy, char *, + (char *restrict __dst, char const *restrict __src) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (stpcpy, char *, + (char *restrict __dst, char const *restrict __src)); +_GL_CXXALIASWARN (stpcpy); +#elif defined GNULIB_POSIXCHECK +# undef stpcpy +# if HAVE_RAW_DECL_STPCPY +_GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - " + "use gnulib module stpcpy for portability"); +# endif +#endif + +/* Copy no more than N bytes of SRC to DST, returning a pointer past the + last non-NUL byte written into DST. */ +#if @GNULIB_STPNCPY@ +# if @REPLACE_STPNCPY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef stpncpy +# define stpncpy rpl_stpncpy +# endif +_GL_FUNCDECL_RPL (stpncpy, char *, + (char *restrict __dst, char const *restrict __src, + size_t __n) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (stpncpy, char *, + (char *restrict __dst, char const *restrict __src, + size_t __n)); +# else +# if ! @HAVE_STPNCPY@ +_GL_FUNCDECL_SYS (stpncpy, char *, + (char *restrict __dst, char const *restrict __src, + size_t __n) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (stpncpy, char *, + (char *restrict __dst, char const *restrict __src, + size_t __n)); +# endif +_GL_CXXALIASWARN (stpncpy); +#elif defined GNULIB_POSIXCHECK +# undef stpncpy +# if HAVE_RAW_DECL_STPNCPY +_GL_WARN_ON_USE (stpncpy, "stpncpy is unportable - " + "use gnulib module stpncpy for portability"); +# endif +#endif + +#if defined GNULIB_POSIXCHECK +/* strchr() does not work with multibyte strings if the locale encoding is + GB18030 and the character to be searched is a digit. */ +# undef strchr +/* Assume strchr is always declared. */ +_GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings " + "in some multibyte locales - " + "use mbschr if you care about internationalization"); +#endif + +/* Find the first occurrence of C in S or the final NUL byte. */ +#if @GNULIB_STRCHRNUL@ +# if @REPLACE_STRCHRNUL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define strchrnul rpl_strchrnul +# endif +_GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (strchrnul, char *, + (const char *str, int ch)); +# else +# if ! @HAVE_STRCHRNUL@ +_GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1))); +# endif + /* On some systems, this function is defined as an overloaded function: + extern "C++" { const char * std::strchrnul (const char *, int); } + extern "C++" { char * std::strchrnul (char *, int); } */ +_GL_CXXALIAS_SYS_CAST2 (strchrnul, + char *, (char const *__s, int __c_in), + char const *, (char const *__s, int __c_in)); +# endif +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) +_GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in)); +_GL_CXXALIASWARN1 (strchrnul, char const *, (char const *__s, int __c_in)); +# else +_GL_CXXALIASWARN (strchrnul); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strchrnul +# if HAVE_RAW_DECL_STRCHRNUL +_GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - " + "use gnulib module strchrnul for portability"); +# endif +#endif + +/* Duplicate S, returning an identical malloc'd string. */ +#if @GNULIB_STRDUP@ +# if @REPLACE_STRDUP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strdup +# define strdup rpl_strdup +# endif +_GL_FUNCDECL_RPL (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (strdup, char *, (char const *__s)); +# else +# if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup + /* strdup exists as a function and as a macro. Get rid of the macro. */ +# undef strdup +# endif +# if !(@HAVE_DECL_STRDUP@ || defined strdup) +_GL_FUNCDECL_SYS (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (strdup, char *, (char const *__s)); +# endif +_GL_CXXALIASWARN (strdup); +#elif defined GNULIB_POSIXCHECK +# undef strdup +# if HAVE_RAW_DECL_STRDUP +_GL_WARN_ON_USE (strdup, "strdup is unportable - " + "use gnulib module strdup for portability"); +# endif +#endif + +/* Append no more than N characters from SRC onto DEST. */ +#if @GNULIB_STRNCAT@ +# if @REPLACE_STRNCAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strncat +# define strncat rpl_strncat +# endif +_GL_FUNCDECL_RPL (strncat, char *, (char *dest, const char *src, size_t n) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (strncat, char *, (char *dest, const char *src, size_t n)); +# else +_GL_CXXALIAS_SYS (strncat, char *, (char *dest, const char *src, size_t n)); +# endif +_GL_CXXALIASWARN (strncat); +#elif defined GNULIB_POSIXCHECK +# undef strncat +# if HAVE_RAW_DECL_STRNCAT +_GL_WARN_ON_USE (strncat, "strncat is unportable - " + "use gnulib module strncat for portability"); +# endif +#endif + +/* Return a newly allocated copy of at most N bytes of STRING. */ +#if @GNULIB_STRNDUP@ +# if @REPLACE_STRNDUP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strndup +# define strndup rpl_strndup +# endif +_GL_FUNCDECL_RPL (strndup, char *, (char const *__s, size_t __n) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n)); +# else +# if ! @HAVE_DECL_STRNDUP@ +_GL_FUNCDECL_SYS (strndup, char *, (char const *__s, size_t __n) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n)); +# endif +_GL_CXXALIASWARN (strndup); +#elif defined GNULIB_POSIXCHECK +# undef strndup +# if HAVE_RAW_DECL_STRNDUP +_GL_WARN_ON_USE (strndup, "strndup is unportable - " + "use gnulib module strndup for portability"); +# endif +#endif + +/* Find the length (number of bytes) of STRING, but scan at most + MAXLEN bytes. If no '\0' terminator is found in that many bytes, + return MAXLEN. */ +#if @GNULIB_STRNLEN@ +# if @REPLACE_STRNLEN@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strnlen +# define strnlen rpl_strnlen +# endif +_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__s, size_t __maxlen) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__s, size_t __maxlen)); +# else +# if ! @HAVE_DECL_STRNLEN@ +_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__s, size_t __maxlen) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (strnlen, size_t, (char const *__s, size_t __maxlen)); +# endif +_GL_CXXALIASWARN (strnlen); +#elif defined GNULIB_POSIXCHECK +# undef strnlen +# if HAVE_RAW_DECL_STRNLEN +_GL_WARN_ON_USE (strnlen, "strnlen is unportable - " + "use gnulib module strnlen for portability"); +# endif +#endif + +#if defined GNULIB_POSIXCHECK +/* strcspn() assumes the second argument is a list of single-byte characters. + Even in this simple case, it does not work with multibyte strings if the + locale encoding is GB18030 and one of the characters to be searched is a + digit. */ +# undef strcspn +/* Assume strcspn is always declared. */ +_GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings " + "in multibyte locales - " + "use mbscspn if you care about internationalization"); +#endif + +/* Find the first occurrence in S of any character in ACCEPT. */ +#if @GNULIB_STRPBRK@ +# if ! @HAVE_STRPBRK@ +_GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1, 2))); +# endif + /* On some systems, this function is defined as an overloaded function: + extern "C" { const char * strpbrk (const char *, const char *); } + extern "C++" { char * strpbrk (char *, const char *); } */ +_GL_CXXALIAS_SYS_CAST2 (strpbrk, + char *, (char const *__s, char const *__accept), + const char *, (char const *__s, char const *__accept)); +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) +_GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept)); +_GL_CXXALIASWARN1 (strpbrk, char const *, + (char const *__s, char const *__accept)); +# else +_GL_CXXALIASWARN (strpbrk); +# endif +# if defined GNULIB_POSIXCHECK +/* strpbrk() assumes the second argument is a list of single-byte characters. + Even in this simple case, it does not work with multibyte strings if the + locale encoding is GB18030 and one of the characters to be searched is a + digit. */ +# undef strpbrk +_GL_WARN_ON_USE (strpbrk, "strpbrk cannot work correctly on character strings " + "in multibyte locales - " + "use mbspbrk if you care about internationalization"); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strpbrk +# if HAVE_RAW_DECL_STRPBRK +_GL_WARN_ON_USE (strpbrk, "strpbrk is unportable - " + "use gnulib module strpbrk for portability"); +# endif +#endif + +#if defined GNULIB_POSIXCHECK +/* strspn() assumes the second argument is a list of single-byte characters. + Even in this simple case, it cannot work with multibyte strings. */ +# undef strspn +/* Assume strspn is always declared. */ +_GL_WARN_ON_USE (strspn, "strspn cannot work correctly on character strings " + "in multibyte locales - " + "use mbsspn if you care about internationalization"); +#endif + +#if defined GNULIB_POSIXCHECK +/* strrchr() does not work with multibyte strings if the locale encoding is + GB18030 and the character to be searched is a digit. */ +# undef strrchr +/* Assume strrchr is always declared. */ +_GL_WARN_ON_USE (strrchr, "strrchr cannot work correctly on character strings " + "in some multibyte locales - " + "use mbsrchr if you care about internationalization"); +#endif + +/* Search the next delimiter (char listed in DELIM) starting at *STRINGP. + If one is found, overwrite it with a NUL, and advance *STRINGP + to point to the next char after it. Otherwise, set *STRINGP to NULL. + If *STRINGP was already NULL, nothing happens. + Return the old value of *STRINGP. + + This is a variant of strtok() that is multithread-safe and supports + empty fields. + + Caveat: It modifies the original string. + Caveat: These functions cannot be used on constant strings. + Caveat: The identity of the delimiting character is lost. + Caveat: It doesn't work with multibyte strings unless all of the delimiter + characters are ASCII characters < 0x30. + + See also strtok_r(). */ +#if @GNULIB_STRSEP@ +# if ! @HAVE_STRSEP@ +_GL_FUNCDECL_SYS (strsep, char *, + (char **restrict __stringp, char const *restrict __delim) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (strsep, char *, + (char **restrict __stringp, char const *restrict __delim)); +_GL_CXXALIASWARN (strsep); +# if defined GNULIB_POSIXCHECK +# undef strsep +_GL_WARN_ON_USE (strsep, "strsep cannot work correctly on character strings " + "in multibyte locales - " + "use mbssep if you care about internationalization"); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strsep +# if HAVE_RAW_DECL_STRSEP +_GL_WARN_ON_USE (strsep, "strsep is unportable - " + "use gnulib module strsep for portability"); +# endif +#endif + +#if @GNULIB_STRSTR@ +# if @REPLACE_STRSTR@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define strstr rpl_strstr +# endif +_GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle)); +# else + /* On some systems, this function is defined as an overloaded function: + extern "C++" { const char * strstr (const char *, const char *); } + extern "C++" { char * strstr (char *, const char *); } */ +_GL_CXXALIAS_SYS_CAST2 (strstr, + char *, (const char *haystack, const char *needle), + const char *, (const char *haystack, const char *needle)); +# endif +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) +_GL_CXXALIASWARN1 (strstr, char *, (char *haystack, const char *needle)); +_GL_CXXALIASWARN1 (strstr, const char *, + (const char *haystack, const char *needle)); +# else +_GL_CXXALIASWARN (strstr); +# endif +#elif defined GNULIB_POSIXCHECK +/* strstr() does not work with multibyte strings if the locale encoding is + different from UTF-8: + POSIX says that it operates on "strings", and "string" in POSIX is defined + as a sequence of bytes, not of characters. */ +# undef strstr +/* Assume strstr is always declared. */ +_GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot " + "work correctly on character strings in most " + "multibyte locales - " + "use mbsstr if you care about internationalization, " + "or use strstr if you care about speed"); +#endif + +/* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive + comparison. */ +#if @GNULIB_STRCASESTR@ +# if @REPLACE_STRCASESTR@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define strcasestr rpl_strcasestr +# endif +_GL_FUNCDECL_RPL (strcasestr, char *, + (const char *haystack, const char *needle) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (strcasestr, char *, + (const char *haystack, const char *needle)); +# else +# if ! @HAVE_STRCASESTR@ +_GL_FUNCDECL_SYS (strcasestr, char *, + (const char *haystack, const char *needle) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1, 2))); +# endif + /* On some systems, this function is defined as an overloaded function: + extern "C++" { const char * strcasestr (const char *, const char *); } + extern "C++" { char * strcasestr (char *, const char *); } */ +_GL_CXXALIAS_SYS_CAST2 (strcasestr, + char *, (const char *haystack, const char *needle), + const char *, (const char *haystack, const char *needle)); +# endif +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) +_GL_CXXALIASWARN1 (strcasestr, char *, (char *haystack, const char *needle)); +_GL_CXXALIASWARN1 (strcasestr, const char *, + (const char *haystack, const char *needle)); +# else +_GL_CXXALIASWARN (strcasestr); +# endif +#elif defined GNULIB_POSIXCHECK +/* strcasestr() does not work with multibyte strings: + It is a glibc extension, and glibc implements it only for unibyte + locales. */ +# undef strcasestr +# if HAVE_RAW_DECL_STRCASESTR +_GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character " + "strings in multibyte locales - " + "use mbscasestr if you care about " + "internationalization, or use c-strcasestr if you want " + "a locale independent function"); +# endif +#endif + +/* Parse S into tokens separated by characters in DELIM. + If S is NULL, the saved pointer in SAVE_PTR is used as + the next starting point. For example: + char s[] = "-abc-=-def"; + char *sp; + x = strtok_r(s, "-", &sp); // x = "abc", sp = "=-def" + x = strtok_r(NULL, "-=", &sp); // x = "def", sp = NULL + x = strtok_r(NULL, "=", &sp); // x = NULL + // s = "abc\0-def\0" + + This is a variant of strtok() that is multithread-safe. + + For the POSIX documentation for this function, see: + http://www.opengroup.org/susv3xsh/strtok.html + + Caveat: It modifies the original string. + Caveat: These functions cannot be used on constant strings. + Caveat: The identity of the delimiting character is lost. + Caveat: It doesn't work with multibyte strings unless all of the delimiter + characters are ASCII characters < 0x30. + + See also strsep(). */ +#if @GNULIB_STRTOK_R@ +# if @REPLACE_STRTOK_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strtok_r +# define strtok_r rpl_strtok_r +# endif +_GL_FUNCDECL_RPL (strtok_r, char *, + (char *restrict s, char const *restrict delim, + char **restrict save_ptr) + _GL_ARG_NONNULL ((2, 3))); +_GL_CXXALIAS_RPL (strtok_r, char *, + (char *restrict s, char const *restrict delim, + char **restrict save_ptr)); +# else +# if @UNDEFINE_STRTOK_R@ || defined GNULIB_POSIXCHECK +# undef strtok_r +# endif +# if ! @HAVE_DECL_STRTOK_R@ +_GL_FUNCDECL_SYS (strtok_r, char *, + (char *restrict s, char const *restrict delim, + char **restrict save_ptr) + _GL_ARG_NONNULL ((2, 3))); +# endif +_GL_CXXALIAS_SYS (strtok_r, char *, + (char *restrict s, char const *restrict delim, + char **restrict save_ptr)); +# endif +_GL_CXXALIASWARN (strtok_r); +# if defined GNULIB_POSIXCHECK +_GL_WARN_ON_USE (strtok_r, "strtok_r cannot work correctly on character " + "strings in multibyte locales - " + "use mbstok_r if you care about internationalization"); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strtok_r +# if HAVE_RAW_DECL_STRTOK_R +_GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - " + "use gnulib module strtok_r for portability"); +# endif +#endif + + +/* The following functions are not specified by POSIX. They are gnulib + extensions. */ + +#if @GNULIB_MBSLEN@ +/* Return the number of multibyte characters in the character string STRING. + This considers multibyte characters, unlike strlen, which counts bytes. */ +# ifdef __MirBSD__ /* MirBSD defines mbslen as a macro. Override it. */ +# undef mbslen +# endif +# if @HAVE_MBSLEN@ /* AIX, OSF/1, MirBSD define mbslen already in libc. */ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define mbslen rpl_mbslen +# endif +_GL_FUNCDECL_RPL (mbslen, size_t, (const char *string) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (mbslen, size_t, (const char *string)); +# else +_GL_FUNCDECL_SYS (mbslen, size_t, (const char *string) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_SYS (mbslen, size_t, (const char *string)); +# endif +_GL_CXXALIASWARN (mbslen); +#endif + +#if @GNULIB_MBSNLEN@ +/* Return the number of multibyte characters in the character string starting + at STRING and ending at STRING + LEN. */ +_GL_EXTERN_C size_t mbsnlen (const char *string, size_t len) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1)); +#endif + +#if @GNULIB_MBSCHR@ +/* Locate the first single-byte character C in the character string STRING, + and return a pointer to it. Return NULL if C is not found in STRING. + Unlike strchr(), this function works correctly in multibyte locales with + encodings such as GB18030. */ +# if defined __hpux +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define mbschr rpl_mbschr /* avoid collision with HP-UX function */ +# endif +_GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c)); +# else +_GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c)); +# endif +_GL_CXXALIASWARN (mbschr); +#endif + +#if @GNULIB_MBSRCHR@ +/* Locate the last single-byte character C in the character string STRING, + and return a pointer to it. Return NULL if C is not found in STRING. + Unlike strrchr(), this function works correctly in multibyte locales with + encodings such as GB18030. */ +# if defined __hpux || defined __INTERIX +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define mbsrchr rpl_mbsrchr /* avoid collision with system function */ +# endif +_GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c)); +# else +_GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c)); +# endif +_GL_CXXALIASWARN (mbsrchr); +#endif + +#if @GNULIB_MBSSTR@ +/* Find the first occurrence of the character string NEEDLE in the character + string HAYSTACK. Return NULL if NEEDLE is not found in HAYSTACK. + Unlike strstr(), this function works correctly in multibyte locales with + encodings different from UTF-8. */ +_GL_EXTERN_C char * mbsstr (const char *haystack, const char *needle) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1, 2)); +#endif + +#if @GNULIB_MBSCASECMP@ +/* Compare the character strings S1 and S2, ignoring case, returning less than, + equal to or greater than zero if S1 is lexicographically less than, equal to + or greater than S2. + Note: This function may, in multibyte locales, return 0 for strings of + different lengths! + Unlike strcasecmp(), this function works correctly in multibyte locales. */ +_GL_EXTERN_C int mbscasecmp (const char *s1, const char *s2) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1, 2)); +#endif + +#if @GNULIB_MBSNCASECMP@ +/* Compare the initial segment of the character string S1 consisting of at most + N characters with the initial segment of the character string S2 consisting + of at most N characters, ignoring case, returning less than, equal to or + greater than zero if the initial segment of S1 is lexicographically less + than, equal to or greater than the initial segment of S2. + Note: This function may, in multibyte locales, return 0 for initial segments + of different lengths! + Unlike strncasecmp(), this function works correctly in multibyte locales. + But beware that N is not a byte count but a character count! */ +_GL_EXTERN_C int mbsncasecmp (const char *s1, const char *s2, size_t n) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1, 2)); +#endif + +#if @GNULIB_MBSPCASECMP@ +/* Compare the initial segment of the character string STRING consisting of + at most mbslen (PREFIX) characters with the character string PREFIX, + ignoring case. If the two match, return a pointer to the first byte + after this prefix in STRING. Otherwise, return NULL. + Note: This function may, in multibyte locales, return non-NULL if STRING + is of smaller length than PREFIX! + Unlike strncasecmp(), this function works correctly in multibyte + locales. */ +_GL_EXTERN_C char * mbspcasecmp (const char *string, const char *prefix) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1, 2)); +#endif + +#if @GNULIB_MBSCASESTR@ +/* Find the first occurrence of the character string NEEDLE in the character + string HAYSTACK, using case-insensitive comparison. + Note: This function may, in multibyte locales, return success even if + strlen (haystack) < strlen (needle) ! + Unlike strcasestr(), this function works correctly in multibyte locales. */ +_GL_EXTERN_C char * mbscasestr (const char *haystack, const char *needle) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1, 2)); +#endif + +#if @GNULIB_MBSCSPN@ +/* Find the first occurrence in the character string STRING of any character + in the character string ACCEPT. Return the number of bytes from the + beginning of the string to this occurrence, or to the end of the string + if none exists. + Unlike strcspn(), this function works correctly in multibyte locales. */ +_GL_EXTERN_C size_t mbscspn (const char *string, const char *accept) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1, 2)); +#endif + +#if @GNULIB_MBSPBRK@ +/* Find the first occurrence in the character string STRING of any character + in the character string ACCEPT. Return the pointer to it, or NULL if none + exists. + Unlike strpbrk(), this function works correctly in multibyte locales. */ +# if defined __hpux +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */ +# endif +_GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept)); +# else +_GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept)); +# endif +_GL_CXXALIASWARN (mbspbrk); +#endif + +#if @GNULIB_MBSSPN@ +/* Find the first occurrence in the character string STRING of any character + not in the character string REJECT. Return the number of bytes from the + beginning of the string to this occurrence, or to the end of the string + if none exists. + Unlike strspn(), this function works correctly in multibyte locales. */ +_GL_EXTERN_C size_t mbsspn (const char *string, const char *reject) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1, 2)); +#endif + +#if @GNULIB_MBSSEP@ +/* Search the next delimiter (multibyte character listed in the character + string DELIM) starting at the character string *STRINGP. + If one is found, overwrite it with a NUL, and advance *STRINGP to point + to the next multibyte character after it. Otherwise, set *STRINGP to NULL. + If *STRINGP was already NULL, nothing happens. + Return the old value of *STRINGP. + + This is a variant of mbstok_r() that supports empty fields. + + Caveat: It modifies the original string. + Caveat: These functions cannot be used on constant strings. + Caveat: The identity of the delimiting character is lost. + + See also mbstok_r(). */ +_GL_EXTERN_C char * mbssep (char **stringp, const char *delim) + _GL_ARG_NONNULL ((1, 2)); +#endif + +#if @GNULIB_MBSTOK_R@ +/* Parse the character string STRING into tokens separated by characters in + the character string DELIM. + If STRING is NULL, the saved pointer in SAVE_PTR is used as + the next starting point. For example: + char s[] = "-abc-=-def"; + char *sp; + x = mbstok_r(s, "-", &sp); // x = "abc", sp = "=-def" + x = mbstok_r(NULL, "-=", &sp); // x = "def", sp = NULL + x = mbstok_r(NULL, "=", &sp); // x = NULL + // s = "abc\0-def\0" + + Caveat: It modifies the original string. + Caveat: These functions cannot be used on constant strings. + Caveat: The identity of the delimiting character is lost. + + See also mbssep(). */ +_GL_EXTERN_C char * mbstok_r (char *string, const char *delim, char **save_ptr) + _GL_ARG_NONNULL ((2, 3)); +#endif + +/* Map any int, typically from errno, into an error message. */ +#if @GNULIB_STRERROR@ +# if @REPLACE_STRERROR@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strerror +# define strerror rpl_strerror +# endif +_GL_FUNCDECL_RPL (strerror, char *, (int)); +_GL_CXXALIAS_RPL (strerror, char *, (int)); +# else +_GL_CXXALIAS_SYS (strerror, char *, (int)); +# endif +_GL_CXXALIASWARN (strerror); +#elif defined GNULIB_POSIXCHECK +# undef strerror +/* Assume strerror is always declared. */ +_GL_WARN_ON_USE (strerror, "strerror is unportable - " + "use gnulib module strerror to guarantee non-NULL result"); +#endif + +/* Map any int, typically from errno, into an error message. Multithread-safe. + Uses the POSIX declaration, not the glibc declaration. */ +#if @GNULIB_STRERROR_R@ +# if @REPLACE_STRERROR_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strerror_r +# define strerror_r rpl_strerror_r +# endif +_GL_FUNCDECL_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen)); +# else +# if !@HAVE_DECL_STRERROR_R@ +_GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen)); +# endif +# if @HAVE_DECL_STRERROR_R@ +_GL_CXXALIASWARN (strerror_r); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strerror_r +# if HAVE_RAW_DECL_STRERROR_R +_GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - " + "use gnulib module strerror_r-posix for portability"); +# endif +#endif + +#if @GNULIB_STRSIGNAL@ +# if @REPLACE_STRSIGNAL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define strsignal rpl_strsignal +# endif +_GL_FUNCDECL_RPL (strsignal, char *, (int __sig)); +_GL_CXXALIAS_RPL (strsignal, char *, (int __sig)); +# else +# if ! @HAVE_DECL_STRSIGNAL@ +_GL_FUNCDECL_SYS (strsignal, char *, (int __sig)); +# endif +/* Need to cast, because on Cygwin 1.5.x systems, the return type is + 'const char *'. */ +_GL_CXXALIAS_SYS_CAST (strsignal, char *, (int __sig)); +# endif +_GL_CXXALIASWARN (strsignal); +#elif defined GNULIB_POSIXCHECK +# undef strsignal +# if HAVE_RAW_DECL_STRSIGNAL +_GL_WARN_ON_USE (strsignal, "strsignal is unportable - " + "use gnulib module strsignal for portability"); +# endif +#endif + +#if @GNULIB_STRVERSCMP@ +# if !@HAVE_STRVERSCMP@ +_GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (strverscmp, int, (const char *, const char *)); +_GL_CXXALIASWARN (strverscmp); +#elif defined GNULIB_POSIXCHECK +# undef strverscmp +# if HAVE_RAW_DECL_STRVERSCMP +_GL_WARN_ON_USE (strverscmp, "strverscmp is unportable - " + "use gnulib module strverscmp for portability"); +# endif +#endif + + +#endif /* _@GUARD_PREFIX@_STRING_H */ +#endif /* _@GUARD_PREFIX@_STRING_H */ +#endif diff --git a/local/recipes/tools/diffutils/source/lib/strings.in.h b/local/recipes/tools/diffutils/source/lib/strings.in.h new file mode 100644 index 0000000000..0374c9474b --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/strings.in.h @@ -0,0 +1,122 @@ +/* A substitute <strings.h>. + + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _@GUARD_PREFIX@_STRINGS_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* Minix 3.1.8 has a bug: <sys/types.h> must be included before <strings.h>. + But avoid namespace pollution on glibc systems. */ +#if defined __minix && !defined __GLIBC__ +# include <sys/types.h> +#endif + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_STRINGS_H@ +# @INCLUDE_NEXT@ @NEXT_STRINGS_H@ +#endif + +#ifndef _@GUARD_PREFIX@_STRINGS_H +#define _@GUARD_PREFIX@_STRINGS_H + +#if ! @HAVE_DECL_STRNCASECMP@ +/* Get size_t. */ +# include <stddef.h> +#endif + + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +#ifdef __cplusplus +extern "C" { +#endif + + + /* Find the index of the least-significant set bit. */ +#if @GNULIB_FFS@ +# if !@HAVE_FFS@ +_GL_FUNCDECL_SYS (ffs, int, (int i)); +# endif +_GL_CXXALIAS_SYS (ffs, int, (int i)); +_GL_CXXALIASWARN (ffs); +#elif defined GNULIB_POSIXCHECK +# undef ffs +# if HAVE_RAW_DECL_FFS +_GL_WARN_ON_USE (ffs, "ffs is not portable - use the ffs module"); +# endif +#endif + +/* Compare strings S1 and S2, ignoring case, returning less than, equal to or + greater than zero if S1 is lexicographically less than, equal to or greater + than S2. + Note: This function does not work in multibyte locales. */ +#if ! @HAVE_STRCASECMP@ +extern int strcasecmp (char const *s1, char const *s2) + _GL_ARG_NONNULL ((1, 2)); +#endif +#if defined GNULIB_POSIXCHECK +/* strcasecmp() does not work with multibyte strings: + POSIX says that it operates on "strings", and "string" in POSIX is defined + as a sequence of bytes, not of characters. */ +# undef strcasecmp +# if HAVE_RAW_DECL_STRCASECMP +_GL_WARN_ON_USE (strcasecmp, "strcasecmp cannot work correctly on character " + "strings in multibyte locales - " + "use mbscasecmp if you care about " + "internationalization, or use c_strcasecmp , " + "gnulib module c-strcase) if you want a locale " + "independent function"); +# endif +#endif + +/* Compare no more than N bytes of strings S1 and S2, ignoring case, + returning less than, equal to or greater than zero if S1 is + lexicographically less than, equal to or greater than S2. + Note: This function cannot work correctly in multibyte locales. */ +#if ! @HAVE_DECL_STRNCASECMP@ +extern int strncasecmp (char const *s1, char const *s2, size_t n) + _GL_ARG_NONNULL ((1, 2)); +#endif +#if defined GNULIB_POSIXCHECK +/* strncasecmp() does not work with multibyte strings: + POSIX says that it operates on "strings", and "string" in POSIX is defined + as a sequence of bytes, not of characters. */ +# undef strncasecmp +# if HAVE_RAW_DECL_STRNCASECMP +_GL_WARN_ON_USE (strncasecmp, "strncasecmp cannot work correctly on character " + "strings in multibyte locales - " + "use mbsncasecmp or mbspcasecmp if you care about " + "internationalization, or use c_strncasecmp , " + "gnulib module c-strcase) if you want a locale " + "independent function"); +# endif +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _@GUARD_PREFIX@_STRING_H */ +#endif /* _@GUARD_PREFIX@_STRING_H */ diff --git a/local/recipes/tools/diffutils/source/lib/stripslash.c b/local/recipes/tools/diffutils/source/lib/stripslash.c new file mode 100644 index 0000000000..2d9d166dc0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/stripslash.c @@ -0,0 +1,45 @@ +/* stripslash.c -- remove redundant trailing slashes from a file name + + Copyright (C) 1990, 2001, 2003-2006, 2009-2017 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "dirname.h" + +/* Remove trailing slashes from FILE. Return true if a trailing slash + was removed. This is useful when using file name completion from a + shell that adds a "/" after directory names (such as tcsh and + bash), because on symlinks to directories, several system calls + have different semantics according to whether a trailing slash is + present. */ + +bool +strip_trailing_slashes (char *file) +{ + char *base = last_component (file); + char *base_lim; + bool had_slash; + + /* last_component returns "" for file system roots, but we need to turn + "///" into "/". */ + if (! *base) + base = file; + base_lim = base + base_len (base); + had_slash = (*base_lim != '\0'); + *base_lim = '\0'; + return had_slash; +} diff --git a/local/recipes/tools/diffutils/source/lib/strncasecmp.c b/local/recipes/tools/diffutils/source/lib/strncasecmp.c new file mode 100644 index 0000000000..2bb02d9a89 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/strncasecmp.c @@ -0,0 +1,62 @@ +/* strncasecmp.c -- case insensitive string comparator + Copyright (C) 1998-1999, 2005-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <string.h> + +#include <ctype.h> +#include <limits.h> + +#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) + +/* Compare no more than N bytes of strings S1 and S2, ignoring case, + returning less than, equal to or greater than zero if S1 is + lexicographically less than, equal to or greater than S2. + Note: This function cannot work correctly in multibyte locales. */ + +int +strncasecmp (const char *s1, const char *s2, size_t n) +{ + register const unsigned char *p1 = (const unsigned char *) s1; + register const unsigned char *p2 = (const unsigned char *) s2; + unsigned char c1, c2; + + if (p1 == p2 || n == 0) + return 0; + + do + { + c1 = TOLOWER (*p1); + c2 = TOLOWER (*p2); + + if (--n == 0 || c1 == '\0') + break; + + ++p1; + ++p2; + } + while (c1 == c2); + + if (UCHAR_MAX <= INT_MAX) + return c1 - c2; + else + /* On machines where 'char' and 'int' are types of the same size, the + difference of two 'unsigned char' values - including the sign bit - + doesn't fit in an 'int'. */ + return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0); +} diff --git a/local/recipes/tools/diffutils/source/lib/strndup.c b/local/recipes/tools/diffutils/source/lib/strndup.c new file mode 100644 index 0000000000..546e58cbe5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/strndup.c @@ -0,0 +1,36 @@ +/* A replacement function, for systems that lack strndup. + + Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2017 Free Software + Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <string.h> + +#include <stdlib.h> + +char * +strndup (char const *s, size_t n) +{ + size_t len = strnlen (s, n); + char *new = malloc (len + 1); + + if (new == NULL) + return NULL; + + new[len] = '\0'; + return memcpy (new, s, len); +} diff --git a/local/recipes/tools/diffutils/source/lib/strnlen.c b/local/recipes/tools/diffutils/source/lib/strnlen.c new file mode 100644 index 0000000000..4cb1ca37e6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/strnlen.c @@ -0,0 +1,30 @@ +/* Find the length of STRING, but scan at most MAXLEN characters. + Copyright (C) 2005-2007, 2009-2017 Free Software Foundation, Inc. + Written by Simon Josefsson. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <string.h> + +/* Find the length of STRING, but scan at most MAXLEN characters. + If no '\0' terminator is found in that many characters, return MAXLEN. */ + +size_t +strnlen (const char *string, size_t maxlen) +{ + const char *end = memchr (string, '\0', maxlen); + return end ? (size_t) (end - string) : maxlen; +} diff --git a/local/recipes/tools/diffutils/source/lib/strnlen1.c b/local/recipes/tools/diffutils/source/lib/strnlen1.c new file mode 100644 index 0000000000..63f78a6a3d --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/strnlen1.c @@ -0,0 +1,35 @@ +/* Find the length of STRING + 1, but scan at most MAXLEN bytes. + Copyright (C) 2005-2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "strnlen1.h" + +#include <string.h> + +/* Find the length of STRING + 1, but scan at most MAXLEN bytes. + If no '\0' terminator is found in that many characters, return MAXLEN. */ +/* This is the same as strnlen (string, maxlen - 1) + 1. */ +size_t +strnlen1 (const char *string, size_t maxlen) +{ + const char *end = (const char *) memchr (string, '\0', maxlen); + if (end != NULL) + return end - string + 1; + else + return maxlen; +} diff --git a/local/recipes/tools/diffutils/source/lib/strnlen1.h b/local/recipes/tools/diffutils/source/lib/strnlen1.h new file mode 100644 index 0000000000..86cb177c09 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/strnlen1.h @@ -0,0 +1,40 @@ +/* Find the length of STRING + 1, but scan at most MAXLEN bytes. + Copyright (C) 2005, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _STRNLEN1_H +#define _STRNLEN1_H + +#include <stddef.h> + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Find the length of STRING + 1, but scan at most MAXLEN bytes. + If no '\0' terminator is found in that many characters, return MAXLEN. */ +/* This is the same as strnlen (string, maxlen - 1) + 1. */ +extern size_t strnlen1 (const char *string, size_t maxlen) + _GL_ATTRIBUTE_PURE; + + +#ifdef __cplusplus +} +#endif + + +#endif /* _STRNLEN1_H */ diff --git a/local/recipes/tools/diffutils/source/lib/strptime.c b/local/recipes/tools/diffutils/source/lib/strptime.c new file mode 100644 index 0000000000..c8e436e9c1 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/strptime.c @@ -0,0 +1,1161 @@ +/* Copyright (C) 2002, 2004-2005, 2007, 2009-2017 Free Software Foundation, + Inc. + This file is part of the GNU C Library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _LIBC +# include <config.h> +#endif + +#include <time.h> + +#include <assert.h> +#include <ctype.h> +#ifdef _LIBC +# include <langinfo.h> +#endif +#include <limits.h> +#include <string.h> +#include <stdbool.h> + +#ifdef _LIBC +# include "../locale/localeinfo.h" +#endif + +#ifndef _LIBC +enum ptime_locale_status { not, loc, raw }; +#endif + + + +#define match_char(ch1, ch2) if (ch1 != ch2) return NULL +#if defined _LIBC && defined __GNUC__ && __GNUC__ >= 2 +# define match_string(cs1, s2) \ + ({ size_t len = strlen (cs1); \ + int result = __strncasecmp_l ((cs1), (s2), len, locale) == 0; \ + if (result) (s2) += len; \ + result; }) +#else +/* Oh come on. Get a reasonable compiler. */ +# define match_string(cs1, s2) \ + (strncasecmp ((cs1), (s2), strlen (cs1)) ? 0 : ((s2) += strlen (cs1), 1)) +#endif +/* We intentionally do not use isdigit() for testing because this will + lead to problems with the wide character version. */ +#define get_number(from, to, n) \ + do { \ + int __n = n; \ + val = 0; \ + while (*rp == ' ') \ + ++rp; \ + if (*rp < '0' || *rp > '9') \ + return NULL; \ + do { \ + val *= 10; \ + val += *rp++ - '0'; \ + } while (--__n > 0 && val * 10 <= to && *rp >= '0' && *rp <= '9'); \ + if (val < from || val > to) \ + return NULL; \ + } while (0) +#ifdef _NL_CURRENT +# define get_alt_number(from, to, n) \ + ({ \ + __label__ do_normal; \ + \ + if (*decided != raw) \ + { \ + val = _nl_parse_alt_digit (&rp HELPER_LOCALE_ARG); \ + if (val == -1 && *decided != loc) \ + { \ + *decided = loc; \ + goto do_normal; \ + } \ + if (val < from || val > to) \ + return NULL; \ + } \ + else \ + { \ + do_normal: \ + get_number (from, to, n); \ + } \ + 0; \ + }) +#else +# define get_alt_number(from, to, n) \ + /* We don't have the alternate representation. */ \ + get_number(from, to, n) +#endif +#define recursive(new_fmt) \ + (*(new_fmt) != '\0' \ + && (rp = __strptime_internal (rp, (new_fmt), tm, \ + decided, era_cnt LOCALE_ARG)) != NULL) + + +#ifdef _LIBC +/* This is defined in locale/C-time.c in the GNU libc. */ +extern const struct locale_data _nl_C_LC_TIME attribute_hidden; + +# define weekday_name (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (DAY_1)].string) +# define ab_weekday_name \ + (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (ABDAY_1)].string) +# define month_name (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (MON_1)].string) +# define ab_month_name (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (ABMON_1)].string) +# define HERE_D_T_FMT (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (D_T_FMT)].string) +# define HERE_D_FMT (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (D_FMT)].string) +# define HERE_AM_STR (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (AM_STR)].string) +# define HERE_PM_STR (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (PM_STR)].string) +# define HERE_T_FMT_AMPM \ + (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (T_FMT_AMPM)].string) +# define HERE_T_FMT (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (T_FMT)].string) + +# define strncasecmp(s1, s2, n) __strncasecmp (s1, s2, n) +#else +static char const weekday_name[][10] = + { + "Sunday", "Monday", "Tuesday", "Wednesday", + "Thursday", "Friday", "Saturday" + }; +static char const ab_weekday_name[][4] = + { + "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" + }; +static char const month_name[][10] = + { + "January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December" + }; +static char const ab_month_name[][4] = + { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" + }; +# define HERE_D_T_FMT "%a %b %e %H:%M:%S %Y" +# define HERE_D_FMT "%m/%d/%y" +# define HERE_AM_STR "AM" +# define HERE_PM_STR "PM" +# define HERE_T_FMT_AMPM "%I:%M:%S %p" +# define HERE_T_FMT "%H:%M:%S" + +static const unsigned short int __mon_yday[2][13] = + { + /* Normal years. */ + { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, + /* Leap years. */ + { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } + }; +#endif + +#if defined _LIBC +/* We use this code also for the extended locale handling where the + function gets as an additional argument the locale which has to be + used. To access the values we have to redefine the _NL_CURRENT + macro. */ +# define strptime __strptime_l +# undef _NL_CURRENT +# define _NL_CURRENT(category, item) \ + (current->values[_NL_ITEM_INDEX (item)].string) +# undef _NL_CURRENT_WORD +# define _NL_CURRENT_WORD(category, item) \ + (current->values[_NL_ITEM_INDEX (item)].word) +# define LOCALE_PARAM , locale +# define LOCALE_ARG , locale +# define LOCALE_PARAM_PROTO , __locale_t locale +# define LOCALE_PARAM_DECL __locale_t locale; +# define HELPER_LOCALE_ARG , current +# define ISSPACE(Ch) __isspace_l (Ch, locale) +#else +# define LOCALE_PARAM +# define LOCALE_ARG +# define LOCALE_PARAM_DECL +# define LOCALE_PARAM_PROTO +# define HELPER_LOCALE_ARG +# define ISSPACE(Ch) isspace (Ch) +#endif + + + + +#ifndef __isleap +/* Nonzero if YEAR is a leap year (every 4 years, + except every 100th isn't, and every 400th is). */ +# define __isleap(year) \ + ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) +#endif + +/* Compute the day of the week. */ +static void +day_of_the_week (struct tm *tm) +{ + /* We know that January 1st 1970 was a Thursday (= 4). Compute the + difference between this data in the one on TM and so determine + the weekday. */ + int corr_year = 1900 + tm->tm_year - (tm->tm_mon < 2); + int wday = (-473 + + (365 * (tm->tm_year - 70)) + + (corr_year / 4) + - ((corr_year / 4) / 25) + ((corr_year / 4) % 25 < 0) + + (((corr_year / 4) / 25) / 4) + + __mon_yday[0][tm->tm_mon] + + tm->tm_mday - 1); + tm->tm_wday = ((wday % 7) + 7) % 7; +} + +/* Compute the day of the year. */ +static void +day_of_the_year (struct tm *tm) +{ + tm->tm_yday = (__mon_yday[__isleap (1900 + tm->tm_year)][tm->tm_mon] + + (tm->tm_mday - 1)); +} + + +#ifdef _LIBC +char * +internal_function +#else +static char * +#endif +__strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM) + const char *rp; + const char *fmt; + struct tm *tm; + enum ptime_locale_status *decided; + int era_cnt; + LOCALE_PARAM_DECL +{ +#ifdef _LIBC + struct locale_data *const current = locale->__locales[LC_TIME]; +#endif + + int cnt; + size_t val; + int have_I, is_pm; + int century, want_century; + int want_era; + int have_wday, want_xday; + int have_yday; + int have_mon, have_mday; + int have_uweek, have_wweek; + int week_no; +#ifdef _NL_CURRENT + size_t num_eras; + struct era_entry *era = NULL; + const char *rp_backup; +#endif + + have_I = is_pm = 0; + century = -1; + want_century = 0; + want_era = 0; + week_no = 0; + + have_wday = want_xday = have_yday = have_mon = have_mday = have_uweek = 0; + have_wweek = 0; + + while (*fmt != '\0') + { + /* A white space in the format string matches 0 more or white + space in the input string. */ + if (ISSPACE (*fmt)) + { + while (ISSPACE (*rp)) + ++rp; + ++fmt; + continue; + } + + /* Any character but '%' must be matched by the same character + in the iput string. */ + if (*fmt != '%') + { + match_char (*fmt++, *rp++); + continue; + } + + ++fmt; +#ifndef _NL_CURRENT + /* We need this for handling the 'E' modifier. */ + start_over: +#else + /* Make back up of current processing pointer. */ + rp_backup = rp; +#endif + + switch (*fmt++) + { + case '%': + /* Match the '%' character itself. */ + match_char ('%', *rp++); + break; + case 'a': + case 'A': + /* Match day of week. */ + for (cnt = 0; cnt < 7; ++cnt) + { +#ifdef _NL_CURRENT + if (*decided !=raw) + { + if (match_string (_NL_CURRENT (LC_TIME, DAY_1 + cnt), rp)) + { + if (*decided == not + && strcmp (_NL_CURRENT (LC_TIME, DAY_1 + cnt), + weekday_name[cnt])) + *decided = loc; + break; + } + if (match_string (_NL_CURRENT (LC_TIME, ABDAY_1 + cnt), rp)) + { + if (*decided == not + && strcmp (_NL_CURRENT (LC_TIME, ABDAY_1 + cnt), + ab_weekday_name[cnt])) + *decided = loc; + break; + } + } +#endif + if (*decided != loc + && (match_string (weekday_name[cnt], rp) + || match_string (ab_weekday_name[cnt], rp))) + { + *decided = raw; + break; + } + } + if (cnt == 7) + /* Does not match a weekday name. */ + return NULL; + tm->tm_wday = cnt; + have_wday = 1; + break; + case 'b': + case 'B': + case 'h': + /* Match month name. */ + for (cnt = 0; cnt < 12; ++cnt) + { +#ifdef _NL_CURRENT + if (*decided !=raw) + { + if (match_string (_NL_CURRENT (LC_TIME, MON_1 + cnt), rp)) + { + if (*decided == not + && strcmp (_NL_CURRENT (LC_TIME, MON_1 + cnt), + month_name[cnt])) + *decided = loc; + break; + } + if (match_string (_NL_CURRENT (LC_TIME, ABMON_1 + cnt), rp)) + { + if (*decided == not + && strcmp (_NL_CURRENT (LC_TIME, ABMON_1 + cnt), + ab_month_name[cnt])) + *decided = loc; + break; + } + } +#endif + if (match_string (month_name[cnt], rp) + || match_string (ab_month_name[cnt], rp)) + { + *decided = raw; + break; + } + } + if (cnt == 12) + /* Does not match a month name. */ + return NULL; + tm->tm_mon = cnt; + want_xday = 1; + break; + case 'c': + /* Match locale's date and time format. */ +#ifdef _NL_CURRENT + if (*decided != raw) + { + if (!recursive (_NL_CURRENT (LC_TIME, D_T_FMT))) + { + if (*decided == loc) + return NULL; + else + rp = rp_backup; + } + else + { + if (*decided == not && + strcmp (_NL_CURRENT (LC_TIME, D_T_FMT), HERE_D_T_FMT)) + *decided = loc; + want_xday = 1; + break; + } + *decided = raw; + } +#endif + if (!recursive (HERE_D_T_FMT)) + return NULL; + want_xday = 1; + break; + case 'C': + /* Match century number. */ +#ifdef _NL_CURRENT + match_century: +#endif + get_number (0, 99, 2); + century = val; + want_xday = 1; + break; + case 'd': + case 'e': + /* Match day of month. */ + get_number (1, 31, 2); + tm->tm_mday = val; + have_mday = 1; + want_xday = 1; + break; + case 'F': + if (!recursive ("%Y-%m-%d")) + return NULL; + want_xday = 1; + break; + case 'x': +#ifdef _NL_CURRENT + if (*decided != raw) + { + if (!recursive (_NL_CURRENT (LC_TIME, D_FMT))) + { + if (*decided == loc) + return NULL; + else + rp = rp_backup; + } + else + { + if (*decided == not + && strcmp (_NL_CURRENT (LC_TIME, D_FMT), HERE_D_FMT)) + *decided = loc; + want_xday = 1; + break; + } + *decided = raw; + } +#endif + /* Fall through. */ + case 'D': + /* Match standard day format. */ + if (!recursive (HERE_D_FMT)) + return NULL; + want_xday = 1; + break; + case 'k': + case 'H': + /* Match hour in 24-hour clock. */ + get_number (0, 23, 2); + tm->tm_hour = val; + have_I = 0; + break; + case 'l': + /* Match hour in 12-hour clock. GNU extension. */ + case 'I': + /* Match hour in 12-hour clock. */ + get_number (1, 12, 2); + tm->tm_hour = val % 12; + have_I = 1; + break; + case 'j': + /* Match day number of year. */ + get_number (1, 366, 3); + tm->tm_yday = val - 1; + have_yday = 1; + break; + case 'm': + /* Match number of month. */ + get_number (1, 12, 2); + tm->tm_mon = val - 1; + have_mon = 1; + want_xday = 1; + break; + case 'M': + /* Match minute. */ + get_number (0, 59, 2); + tm->tm_min = val; + break; + case 'n': + case 't': + /* Match any white space. */ + while (ISSPACE (*rp)) + ++rp; + break; + case 'p': + /* Match locale's equivalent of AM/PM. */ +#ifdef _NL_CURRENT + if (*decided != raw) + { + if (match_string (_NL_CURRENT (LC_TIME, AM_STR), rp)) + { + if (strcmp (_NL_CURRENT (LC_TIME, AM_STR), HERE_AM_STR)) + *decided = loc; + break; + } + if (match_string (_NL_CURRENT (LC_TIME, PM_STR), rp)) + { + if (strcmp (_NL_CURRENT (LC_TIME, PM_STR), HERE_PM_STR)) + *decided = loc; + is_pm = 1; + break; + } + *decided = raw; + } +#endif + if (!match_string (HERE_AM_STR, rp)) + { + if (match_string (HERE_PM_STR, rp)) + is_pm = 1; + else + return NULL; + } + break; + case 'q': + /* Match quarter of year. GNU extension. */ + get_number (1, 4, 1); + tm->tm_mon = (val - 1) * 3; + tm->tm_mday = 1; + have_mon = 1; + have_mday = 1; + want_xday = 1; + break; + case 'r': +#ifdef _NL_CURRENT + if (*decided != raw) + { + if (!recursive (_NL_CURRENT (LC_TIME, T_FMT_AMPM))) + { + if (*decided == loc) + return NULL; + else + rp = rp_backup; + } + else + { + if (*decided == not && + strcmp (_NL_CURRENT (LC_TIME, T_FMT_AMPM), + HERE_T_FMT_AMPM)) + *decided = loc; + break; + } + *decided = raw; + } +#endif + if (!recursive (HERE_T_FMT_AMPM)) + return NULL; + break; + case 'R': + if (!recursive ("%H:%M")) + return NULL; + break; + case 's': + { + /* The number of seconds may be very high so we cannot use + the 'get_number' macro. Instead read the number + character for character and construct the result while + doing this. */ + time_t secs = 0; + if (*rp < '0' || *rp > '9') + /* We need at least one digit. */ + return NULL; + + do + { + secs *= 10; + secs += *rp++ - '0'; + } + while (*rp >= '0' && *rp <= '9'); + + if (localtime_r (&secs, tm) == NULL) + /* Error in function. */ + return NULL; + } + break; + case 'S': + get_number (0, 61, 2); + tm->tm_sec = val; + break; + case 'X': +#ifdef _NL_CURRENT + if (*decided != raw) + { + if (!recursive (_NL_CURRENT (LC_TIME, T_FMT))) + { + if (*decided == loc) + return NULL; + else + rp = rp_backup; + } + else + { + if (strcmp (_NL_CURRENT (LC_TIME, T_FMT), HERE_T_FMT)) + *decided = loc; + break; + } + *decided = raw; + } +#endif + /* Fall through. */ + case 'T': + if (!recursive (HERE_T_FMT)) + return NULL; + break; + case 'u': + get_number (1, 7, 1); + tm->tm_wday = val % 7; + have_wday = 1; + break; + case 'g': + get_number (0, 99, 2); + /* XXX This cannot determine any field in TM. */ + break; + case 'G': + if (*rp < '0' || *rp > '9') + return NULL; + /* XXX Ignore the number since we would need some more + information to compute a real date. */ + do + ++rp; + while (*rp >= '0' && *rp <= '9'); + break; + case 'U': + get_number (0, 53, 2); + week_no = val; + have_uweek = 1; + break; + case 'W': + get_number (0, 53, 2); + week_no = val; + have_wweek = 1; + break; + case 'V': + get_number (0, 53, 2); + /* XXX This cannot determine any field in TM without some + information. */ + break; + case 'w': + /* Match number of weekday. */ + get_number (0, 6, 1); + tm->tm_wday = val; + have_wday = 1; + break; + case 'y': +#ifdef _NL_CURRENT + match_year_in_century: +#endif + /* Match year within century. */ + get_number (0, 99, 2); + /* The "Year 2000: The Millennium Rollover" paper suggests that + values in the range 69-99 refer to the twentieth century. */ + tm->tm_year = val >= 69 ? val : val + 100; + /* Indicate that we want to use the century, if specified. */ + want_century = 1; + want_xday = 1; + break; + case 'Y': + /* Match year including century number. */ + get_number (0, 9999, 4); + tm->tm_year = val - 1900; + want_century = 0; + want_xday = 1; + break; + case 'Z': + /* XXX How to handle this? */ + break; + case 'z': + /* We recognize two formats: if two digits are given, these + specify hours. If fours digits are used, minutes are + also specified. */ + { + bool neg _GL_UNUSED; + int n; + + val = 0; + while (*rp == ' ') + ++rp; + if (*rp != '+' && *rp != '-') + return NULL; + neg = *rp++ == '-'; + n = 0; + while (n < 4 && *rp >= '0' && *rp <= '9') + { + val = val * 10 + *rp++ - '0'; + ++n; + } + if (n == 2) + val *= 100; + else if (n != 4) + /* Only two or four digits recognized. */ + return NULL; + else + { + /* We have to convert the minutes into decimal. */ + if (val % 100 >= 60) + return NULL; + val = (val / 100) * 100 + ((val % 100) * 50) / 30; + } + if (val > 1200) + return NULL; +#if defined _LIBC || HAVE_TM_GMTOFF + tm->tm_gmtoff = (val * 3600) / 100; + if (neg) + tm->tm_gmtoff = -tm->tm_gmtoff; +#endif + } + break; + case 'E': +#ifdef _NL_CURRENT + switch (*fmt++) + { + case 'c': + /* Match locale's alternate date and time format. */ + if (*decided != raw) + { + const char *fmt = _NL_CURRENT (LC_TIME, ERA_D_T_FMT); + + if (*fmt == '\0') + fmt = _NL_CURRENT (LC_TIME, D_T_FMT); + + if (!recursive (fmt)) + { + if (*decided == loc) + return NULL; + else + rp = rp_backup; + } + else + { + if (strcmp (fmt, HERE_D_T_FMT)) + *decided = loc; + want_xday = 1; + break; + } + *decided = raw; + } + /* The C locale has no era information, so use the + normal representation. */ + if (!recursive (HERE_D_T_FMT)) + return NULL; + want_xday = 1; + break; + case 'C': + if (*decided != raw) + { + if (era_cnt >= 0) + { + era = _nl_select_era_entry (era_cnt HELPER_LOCALE_ARG); + if (era != NULL && match_string (era->era_name, rp)) + { + *decided = loc; + break; + } + else + return NULL; + } + + num_eras = _NL_CURRENT_WORD (LC_TIME, + _NL_TIME_ERA_NUM_ENTRIES); + for (era_cnt = 0; era_cnt < (int) num_eras; + ++era_cnt, rp = rp_backup) + { + era = _nl_select_era_entry (era_cnt + HELPER_LOCALE_ARG); + if (era != NULL && match_string (era->era_name, rp)) + { + *decided = loc; + break; + } + } + if (era_cnt != (int) num_eras) + break; + + era_cnt = -1; + if (*decided == loc) + return NULL; + + *decided = raw; + } + /* The C locale has no era information, so use the + normal representation. */ + goto match_century; + case 'y': + if (*decided != raw) + { + get_number(0, 9999, 4); + tm->tm_year = val; + want_era = 1; + want_xday = 1; + want_century = 1; + + if (era_cnt >= 0) + { + assert (*decided == loc); + + era = _nl_select_era_entry (era_cnt HELPER_LOCALE_ARG); + bool match = false; + if (era != NULL) + { + int delta = ((tm->tm_year - era->offset) + * era->absolute_direction); + match = (delta >= 0 + && delta < (((int64_t) era->stop_date[0] + - (int64_t) era->start_date[0]) + * era->absolute_direction)); + } + if (! match) + return NULL; + + break; + } + + num_eras = _NL_CURRENT_WORD (LC_TIME, + _NL_TIME_ERA_NUM_ENTRIES); + for (era_cnt = 0; era_cnt < (int) num_eras; ++era_cnt) + { + era = _nl_select_era_entry (era_cnt + HELPER_LOCALE_ARG); + if (era != NULL) + { + int delta = ((tm->tm_year - era->offset) + * era->absolute_direction); + if (delta >= 0 + && delta < (((int64_t) era->stop_date[0] + - (int64_t) era->start_date[0]) + * era->absolute_direction)) + { + *decided = loc; + break; + } + } + } + if (era_cnt != (int) num_eras) + break; + + era_cnt = -1; + if (*decided == loc) + return NULL; + + *decided = raw; + } + + goto match_year_in_century; + case 'Y': + if (*decided != raw) + { + num_eras = _NL_CURRENT_WORD (LC_TIME, + _NL_TIME_ERA_NUM_ENTRIES); + for (era_cnt = 0; era_cnt < (int) num_eras; + ++era_cnt, rp = rp_backup) + { + era = _nl_select_era_entry (era_cnt HELPER_LOCALE_ARG); + if (era != NULL && recursive (era->era_format)) + break; + } + if (era_cnt == (int) num_eras) + { + era_cnt = -1; + if (*decided == loc) + return NULL; + else + rp = rp_backup; + } + else + { + *decided = loc; + era_cnt = -1; + break; + } + + *decided = raw; + } + get_number (0, 9999, 4); + tm->tm_year = val - 1900; + want_century = 0; + want_xday = 1; + break; + case 'x': + if (*decided != raw) + { + const char *fmt = _NL_CURRENT (LC_TIME, ERA_D_FMT); + + if (*fmt == '\0') + fmt = _NL_CURRENT (LC_TIME, D_FMT); + + if (!recursive (fmt)) + { + if (*decided == loc) + return NULL; + else + rp = rp_backup; + } + else + { + if (strcmp (fmt, HERE_D_FMT)) + *decided = loc; + break; + } + *decided = raw; + } + if (!recursive (HERE_D_FMT)) + return NULL; + break; + case 'X': + if (*decided != raw) + { + const char *fmt = _NL_CURRENT (LC_TIME, ERA_T_FMT); + + if (*fmt == '\0') + fmt = _NL_CURRENT (LC_TIME, T_FMT); + + if (!recursive (fmt)) + { + if (*decided == loc) + return NULL; + else + rp = rp_backup; + } + else + { + if (strcmp (fmt, HERE_T_FMT)) + *decided = loc; + break; + } + *decided = raw; + } + if (!recursive (HERE_T_FMT)) + return NULL; + break; + default: + return NULL; + } + break; +#else + /* We have no information about the era format. Just use + the normal format. */ + if (*fmt != 'c' && *fmt != 'C' && *fmt != 'y' && *fmt != 'Y' + && *fmt != 'x' && *fmt != 'X') + /* This is an illegal format. */ + return NULL; + + goto start_over; +#endif + case 'O': + switch (*fmt++) + { + case 'd': + case 'e': + /* Match day of month using alternate numeric symbols. */ + get_alt_number (1, 31, 2); + tm->tm_mday = val; + have_mday = 1; + want_xday = 1; + break; + case 'H': + /* Match hour in 24-hour clock using alternate numeric + symbols. */ + get_alt_number (0, 23, 2); + tm->tm_hour = val; + have_I = 0; + break; + case 'I': + /* Match hour in 12-hour clock using alternate numeric + symbols. */ + get_alt_number (1, 12, 2); + tm->tm_hour = val % 12; + have_I = 1; + break; + case 'm': + /* Match month using alternate numeric symbols. */ + get_alt_number (1, 12, 2); + tm->tm_mon = val - 1; + have_mon = 1; + want_xday = 1; + break; + case 'M': + /* Match minutes using alternate numeric symbols. */ + get_alt_number (0, 59, 2); + tm->tm_min = val; + break; + case 'q': + /* Match quarter using alternate numeric symbols. */ + get_alt_number (1, 4, 1); + tm->tm_mon = (val - 1) * 3; + tm->tm_mday = 1; + have_mon = 1; + have_mday = 1; + want_xday = 1; + break; + case 'S': + /* Match seconds using alternate numeric symbols. */ + get_alt_number (0, 61, 2); + tm->tm_sec = val; + break; + case 'U': + get_alt_number (0, 53, 2); + week_no = val; + have_uweek = 1; + break; + case 'W': + get_alt_number (0, 53, 2); + week_no = val; + have_wweek = 1; + break; + case 'V': + get_alt_number (0, 53, 2); + /* XXX This cannot determine any field in TM without + further information. */ + break; + case 'w': + /* Match number of weekday using alternate numeric symbols. */ + get_alt_number (0, 6, 1); + tm->tm_wday = val; + have_wday = 1; + break; + case 'y': + /* Match year within century using alternate numeric symbols. */ + get_alt_number (0, 99, 2); + tm->tm_year = val >= 69 ? val : val + 100; + want_xday = 1; + break; + default: + return NULL; + } + break; + default: + return NULL; + } + } + + if (have_I && is_pm) + tm->tm_hour += 12; + + if (century != -1) + { + if (want_century) + tm->tm_year = tm->tm_year % 100 + (century - 19) * 100; + else + /* Only the century, but not the year. Strange, but so be it. */ + tm->tm_year = (century - 19) * 100; + } + + if (era_cnt != -1) + { +#ifdef _NL_CURRENT + era = _nl_select_era_entry (era_cnt HELPER_LOCALE_ARG); + if (era == NULL) + return NULL; + if (want_era) + tm->tm_year = (era->start_date[0] + + ((tm->tm_year - era->offset) + * era->absolute_direction)); + else + /* Era start year assumed. */ + tm->tm_year = era->start_date[0]; +#endif + } + else + if (want_era) + { + /* No era found but we have seen an E modifier. Rectify some + values. */ + if (want_century && century == -1 && tm->tm_year < 69) + tm->tm_year += 100; + } + + if (want_xday && !have_wday) + { + if ( !(have_mon && have_mday) && have_yday) + { + /* We don't have tm_mon and/or tm_mday, compute them. */ + int t_mon = 0; + while (__mon_yday[__isleap(1900 + tm->tm_year)][t_mon] <= tm->tm_yday) + t_mon++; + if (!have_mon) + tm->tm_mon = t_mon - 1; + if (!have_mday) + tm->tm_mday = + (tm->tm_yday + - __mon_yday[__isleap(1900 + tm->tm_year)][t_mon - 1] + 1); + } + day_of_the_week (tm); + } + + if (want_xday && !have_yday) + day_of_the_year (tm); + + if ((have_uweek || have_wweek) && have_wday) + { + int save_wday = tm->tm_wday; + int save_mday = tm->tm_mday; + int save_mon = tm->tm_mon; + int w_offset = have_uweek ? 0 : 1; + + tm->tm_mday = 1; + tm->tm_mon = 0; + day_of_the_week (tm); + if (have_mday) + tm->tm_mday = save_mday; + if (have_mon) + tm->tm_mon = save_mon; + + if (!have_yday) + tm->tm_yday = ((7 - (tm->tm_wday - w_offset)) % 7 + + (week_no - 1) *7 + + save_wday - w_offset); + + if (!have_mday || !have_mon) + { + int t_mon = 0; + while (__mon_yday[__isleap(1900 + tm->tm_year)][t_mon] + <= tm->tm_yday) + t_mon++; + if (!have_mon) + tm->tm_mon = t_mon - 1; + if (!have_mday) + tm->tm_mday = + (tm->tm_yday + - __mon_yday[__isleap(1900 + tm->tm_year)][t_mon - 1] + 1); + } + + tm->tm_wday = save_wday; + } + + return (char *) rp; +} + + +char * +strptime (buf, format, tm LOCALE_PARAM) + const char *restrict buf; + const char *restrict format; + struct tm *restrict tm; + LOCALE_PARAM_DECL +{ + enum ptime_locale_status decided; + +#ifdef _NL_CURRENT + decided = not; +#else + decided = raw; +#endif + return __strptime_internal (buf, format, tm, &decided, -1 LOCALE_ARG); +} + +#ifdef _LIBC +weak_alias (__strptime_l, strptime_l) +#endif diff --git a/local/recipes/tools/diffutils/source/lib/strtoimax.c b/local/recipes/tools/diffutils/source/lib/strtoimax.c new file mode 100644 index 0000000000..3f31fe913a --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/strtoimax.c @@ -0,0 +1,82 @@ +/* Convert string representation of a number into an intmax_t value. + + Copyright (C) 1999, 2001-2004, 2006, 2009-2017 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +#include <config.h> + +/* Verify interface. */ +#include <inttypes.h> + +#include <stdlib.h> + +#include "verify.h" + +#ifdef UNSIGNED +# if HAVE_UNSIGNED_LONG_LONG_INT +# ifndef HAVE_DECL_STRTOULL +"this configure-time declaration test was not run" +# endif +# if !HAVE_DECL_STRTOULL +unsigned long long int strtoull (char const *, char **, int); +# endif +# endif + +#else + +# if HAVE_LONG_LONG_INT +# ifndef HAVE_DECL_STRTOLL +"this configure-time declaration test was not run" +# endif +# if !HAVE_DECL_STRTOLL +long long int strtoll (char const *, char **, int); +# endif +# endif +#endif + +#ifdef UNSIGNED +# define Have_long_long HAVE_UNSIGNED_LONG_LONG_INT +# define Int uintmax_t +# define Strtoimax strtoumax +# define Strtol strtoul +# define Strtoll strtoull +# define Unsigned unsigned +#else +# define Have_long_long HAVE_LONG_LONG_INT +# define Int intmax_t +# define Strtoimax strtoimax +# define Strtol strtol +# define Strtoll strtoll +# define Unsigned +#endif + +Int +Strtoimax (char const *ptr, char **endptr, int base) +{ +#if Have_long_long + verify (sizeof (Int) == sizeof (Unsigned long int) + || sizeof (Int) == sizeof (Unsigned long long int)); + + if (sizeof (Int) != sizeof (Unsigned long int)) + return Strtoll (ptr, endptr, base); +#else + verify (sizeof (Int) == sizeof (Unsigned long int)); +#endif + + return Strtol (ptr, endptr, base); +} diff --git a/local/recipes/tools/diffutils/source/lib/strtol.c b/local/recipes/tools/diffutils/source/lib/strtol.c new file mode 100644 index 0000000000..751d1e0f1e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/strtol.c @@ -0,0 +1,422 @@ +/* Convert string representation of a number into an integer value. + + Copyright (C) 1991-1992, 1994-1999, 2003, 2005-2007, 2009-2017 Free Software + Foundation, Inc. + + NOTE: The canonical source of this file is maintained with the GNU C + Library. Bugs can be reported to bug-glibc@gnu.org. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3 of the License, or any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifdef _LIBC +# define USE_NUMBER_GROUPING +#else +# include <config.h> +#endif + +#include <ctype.h> +#include <errno.h> +#ifndef __set_errno +# define __set_errno(Val) errno = (Val) +#endif + +#include <limits.h> +#include <stddef.h> +#include <stdlib.h> +#include <string.h> + +#ifdef USE_NUMBER_GROUPING +# include "../locale/localeinfo.h" +#endif + +/* Nonzero if we are defining 'strtoul' or 'strtoull', operating on + unsigned integers. */ +#ifndef UNSIGNED +# define UNSIGNED 0 +# define INT LONG int +#else +# define INT unsigned LONG int +#endif + +/* Determine the name. */ +#ifdef USE_IN_EXTENDED_LOCALE_MODEL +# if UNSIGNED +# ifdef USE_WIDE_CHAR +# ifdef QUAD +# define strtol __wcstoull_l +# else +# define strtol __wcstoul_l +# endif +# else +# ifdef QUAD +# define strtol __strtoull_l +# else +# define strtol __strtoul_l +# endif +# endif +# else +# ifdef USE_WIDE_CHAR +# ifdef QUAD +# define strtol __wcstoll_l +# else +# define strtol __wcstol_l +# endif +# else +# ifdef QUAD +# define strtol __strtoll_l +# else +# define strtol __strtol_l +# endif +# endif +# endif +#else +# if UNSIGNED +# ifdef USE_WIDE_CHAR +# ifdef QUAD +# define strtol wcstoull +# else +# define strtol wcstoul +# endif +# else +# ifdef QUAD +# define strtol strtoull +# else +# define strtol strtoul +# endif +# endif +# else +# ifdef USE_WIDE_CHAR +# ifdef QUAD +# define strtol wcstoll +# else +# define strtol wcstol +# endif +# else +# ifdef QUAD +# define strtol strtoll +# endif +# endif +# endif +#endif + +/* If QUAD is defined, we are defining 'strtoll' or 'strtoull', + operating on 'long long int's. */ +#ifdef QUAD +# define LONG long long +# define STRTOL_LONG_MIN LLONG_MIN +# define STRTOL_LONG_MAX LLONG_MAX +# define STRTOL_ULONG_MAX ULLONG_MAX + +/* The extra casts in the following macros work around compiler bugs, + e.g., in Cray C 5.0.3.0. */ + +/* True if the arithmetic type T is signed. */ +# define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) + +/* Minimum and maximum values for integer types. + These macros have undefined behavior for signed types that either + have padding bits or do not use two's complement. If this is a + problem for you, please let us know how to fix it for your host. */ + +/* The maximum and minimum values for the integer type T. */ +# define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t)) +# define TYPE_MAXIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) + +# ifndef ULLONG_MAX +# define ULLONG_MAX TYPE_MAXIMUM (unsigned long long) +# endif +# ifndef LLONG_MAX +# define LLONG_MAX TYPE_MAXIMUM (long long int) +# endif +# ifndef LLONG_MIN +# define LLONG_MIN TYPE_MINIMUM (long long int) +# endif + +# if __GNUC__ == 2 && __GNUC_MINOR__ < 7 + /* Work around gcc bug with using this constant. */ + static const unsigned long long int maxquad = ULLONG_MAX; +# undef STRTOL_ULONG_MAX +# define STRTOL_ULONG_MAX maxquad +# endif +#else +# define LONG long +# define STRTOL_LONG_MIN LONG_MIN +# define STRTOL_LONG_MAX LONG_MAX +# define STRTOL_ULONG_MAX ULONG_MAX +#endif + + +/* We use this code also for the extended locale handling where the + function gets as an additional argument the locale which has to be + used. To access the values we have to redefine the _NL_CURRENT + macro. */ +#ifdef USE_IN_EXTENDED_LOCALE_MODEL +# undef _NL_CURRENT +# define _NL_CURRENT(category, item) \ + (current->values[_NL_ITEM_INDEX (item)].string) +# define LOCALE_PARAM , loc +# define LOCALE_PARAM_PROTO , __locale_t loc +#else +# define LOCALE_PARAM +# define LOCALE_PARAM_PROTO +#endif + +#ifdef USE_WIDE_CHAR +# include <wchar.h> +# include <wctype.h> +# define L_(Ch) L##Ch +# define UCHAR_TYPE wint_t +# define STRING_TYPE wchar_t +# ifdef USE_IN_EXTENDED_LOCALE_MODEL +# define ISSPACE(Ch) __iswspace_l ((Ch), loc) +# define ISALPHA(Ch) __iswalpha_l ((Ch), loc) +# define TOUPPER(Ch) __towupper_l ((Ch), loc) +# else +# define ISSPACE(Ch) iswspace (Ch) +# define ISALPHA(Ch) iswalpha (Ch) +# define TOUPPER(Ch) towupper (Ch) +# endif +#else +# define L_(Ch) Ch +# define UCHAR_TYPE unsigned char +# define STRING_TYPE char +# ifdef USE_IN_EXTENDED_LOCALE_MODEL +# define ISSPACE(Ch) __isspace_l ((Ch), loc) +# define ISALPHA(Ch) __isalpha_l ((Ch), loc) +# define TOUPPER(Ch) __toupper_l ((Ch), loc) +# else +# define ISSPACE(Ch) isspace (Ch) +# define ISALPHA(Ch) isalpha (Ch) +# define TOUPPER(Ch) toupper (Ch) +# endif +#endif + +#define INTERNAL(X) INTERNAL1(X) +#define INTERNAL1(X) __##X##_internal +#define WEAKNAME(X) WEAKNAME1(X) + +#ifdef USE_NUMBER_GROUPING +/* This file defines a function to check for correct grouping. */ +# include "grouping.h" +#endif + + + +/* Convert NPTR to an 'unsigned long int' or 'long int' in base BASE. + If BASE is 0 the base is determined by the presence of a leading + zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal. + If BASE is < 2 or > 36, it is reset to 10. + If ENDPTR is not NULL, a pointer to the character after the last + one converted is stored in *ENDPTR. */ + +INT +INTERNAL (strtol) (const STRING_TYPE *nptr, STRING_TYPE **endptr, + int base, int group LOCALE_PARAM_PROTO) +{ + int negative; + register unsigned LONG int cutoff; + register unsigned int cutlim; + register unsigned LONG int i; + register const STRING_TYPE *s; + register UCHAR_TYPE c; + const STRING_TYPE *save, *end; + int overflow; + +#ifdef USE_NUMBER_GROUPING +# ifdef USE_IN_EXTENDED_LOCALE_MODEL + struct locale_data *current = loc->__locales[LC_NUMERIC]; +# endif + /* The thousands character of the current locale. */ + wchar_t thousands = L'\0'; + /* The numeric grouping specification of the current locale, + in the format described in <locale.h>. */ + const char *grouping; + + if (group) + { + grouping = _NL_CURRENT (LC_NUMERIC, GROUPING); + if (*grouping <= 0 || *grouping == CHAR_MAX) + grouping = NULL; + else + { + /* Figure out the thousands separator character. */ +# if defined _LIBC || defined _HAVE_BTOWC + thousands = __btowc (*_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP)); + if (thousands == WEOF) + thousands = L'\0'; +# endif + if (thousands == L'\0') + grouping = NULL; + } + } + else + grouping = NULL; +#endif + + if (base < 0 || base == 1 || base > 36) + { + __set_errno (EINVAL); + return 0; + } + + save = s = nptr; + + /* Skip white space. */ + while (ISSPACE (*s)) + ++s; + if (*s == L_('\0')) + goto noconv; + + /* Check for a sign. */ + if (*s == L_('-')) + { + negative = 1; + ++s; + } + else if (*s == L_('+')) + { + negative = 0; + ++s; + } + else + negative = 0; + + /* Recognize number prefix and if BASE is zero, figure it out ourselves. */ + if (*s == L_('0')) + { + if ((base == 0 || base == 16) && TOUPPER (s[1]) == L_('X')) + { + s += 2; + base = 16; + } + else if (base == 0) + base = 8; + } + else if (base == 0) + base = 10; + + /* Save the pointer so we can check later if anything happened. */ + save = s; + +#ifdef USE_NUMBER_GROUPING + if (group) + { + /* Find the end of the digit string and check its grouping. */ + end = s; + for (c = *end; c != L_('\0'); c = *++end) + if ((wchar_t) c != thousands + && ((wchar_t) c < L_('0') || (wchar_t) c > L_('9')) + && (!ISALPHA (c) || (int) (TOUPPER (c) - L_('A') + 10) >= base)) + break; + if (*s == thousands) + end = s; + else + end = correctly_grouped_prefix (s, end, thousands, grouping); + } + else +#endif + end = NULL; + + cutoff = STRTOL_ULONG_MAX / (unsigned LONG int) base; + cutlim = STRTOL_ULONG_MAX % (unsigned LONG int) base; + + overflow = 0; + i = 0; + for (c = *s; c != L_('\0'); c = *++s) + { + if (s == end) + break; + if (c >= L_('0') && c <= L_('9')) + c -= L_('0'); + else if (ISALPHA (c)) + c = TOUPPER (c) - L_('A') + 10; + else + break; + if ((int) c >= base) + break; + /* Check for overflow. */ + if (i > cutoff || (i == cutoff && c > cutlim)) + overflow = 1; + else + { + i *= (unsigned LONG int) base; + i += c; + } + } + + /* Check if anything actually happened. */ + if (s == save) + goto noconv; + + /* Store in ENDPTR the address of one character + past the last character we converted. */ + if (endptr != NULL) + *endptr = (STRING_TYPE *) s; + +#if !UNSIGNED + /* Check for a value that is within the range of + 'unsigned LONG int', but outside the range of 'LONG int'. */ + if (overflow == 0 + && i > (negative + ? -((unsigned LONG int) (STRTOL_LONG_MIN + 1)) + 1 + : (unsigned LONG int) STRTOL_LONG_MAX)) + overflow = 1; +#endif + + if (overflow) + { + __set_errno (ERANGE); +#if UNSIGNED + return STRTOL_ULONG_MAX; +#else + return negative ? STRTOL_LONG_MIN : STRTOL_LONG_MAX; +#endif + } + + /* Return the result of the appropriate sign. */ + return negative ? -i : i; + +noconv: + /* We must handle a special case here: the base is 0 or 16 and the + first two characters are '0' and 'x', but the rest are no + hexadecimal digits. This is no error case. We return 0 and + ENDPTR points to the 'x'. */ + if (endptr != NULL) + { + if (save - nptr >= 2 && TOUPPER (save[-1]) == L_('X') + && save[-2] == L_('0')) + *endptr = (STRING_TYPE *) &save[-1]; + else + /* There was no number to convert. */ + *endptr = (STRING_TYPE *) nptr; + } + + return 0L; +} + +/* External user entry point. */ + + +INT +#ifdef weak_function +weak_function +#endif +strtol (const STRING_TYPE *nptr, STRING_TYPE **endptr, + int base LOCALE_PARAM_PROTO) +{ + return INTERNAL (strtol) (nptr, endptr, base, 0 LOCALE_PARAM); +} diff --git a/local/recipes/tools/diffutils/source/lib/strtoul.c b/local/recipes/tools/diffutils/source/lib/strtoul.c new file mode 100644 index 0000000000..c4974e069e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/strtoul.c @@ -0,0 +1,19 @@ +/* Copyright (C) 1991, 1997, 2009-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#define UNSIGNED 1 + +#include "strtol.c" diff --git a/local/recipes/tools/diffutils/source/lib/strtoull.c b/local/recipes/tools/diffutils/source/lib/strtoull.c new file mode 100644 index 0000000000..51ae3acb03 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/strtoull.c @@ -0,0 +1,26 @@ +/* Function to parse an 'unsigned long long int' from text. + Copyright (C) 1995-1997, 1999, 2009-2017 Free Software Foundation, Inc. + NOTE: The canonical source of this file is maintained with the GNU C + Library. Bugs can be reported to bug-glibc@gnu.org. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3 of the License, or any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#define QUAD 1 + +#include "strtoul.c" + +#ifdef _LIBC +strong_alias (__strtoull_internal, __strtouq_internal) +weak_alias (strtoull, strtouq) +#endif diff --git a/local/recipes/tools/diffutils/source/lib/strtoumax.c b/local/recipes/tools/diffutils/source/lib/strtoumax.c new file mode 100644 index 0000000000..dc395d626a --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/strtoumax.c @@ -0,0 +1,2 @@ +#define UNSIGNED 1 +#include "strtoimax.c" diff --git a/local/recipes/tools/diffutils/source/lib/sys_stat.in.h b/local/recipes/tools/diffutils/source/lib/sys_stat.in.h new file mode 100644 index 0000000000..1831740900 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/sys_stat.in.h @@ -0,0 +1,816 @@ +/* Provide a more complete sys/stat.h header file. + Copyright (C) 2005-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake, Paul Eggert, and Jim Meyering. */ + +/* This file is supposed to be used on platforms where <sys/stat.h> is + incomplete. It is intended to provide definitions and prototypes + needed by an application. Start with what the system provides. */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#if defined __need_system_sys_stat_h +/* Special invocation convention. */ + +#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_SYS_STAT_H + +/* Get nlink_t. + May also define off_t to a 64-bit type on native Windows. */ +#include <sys/types.h> + +/* Get struct timespec. */ +#include <time.h> + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ + +#ifndef _@GUARD_PREFIX@_SYS_STAT_H +#define _@GUARD_PREFIX@_SYS_STAT_H + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +/* Before doing "#define mkdir rpl_mkdir" below, we need to include all + headers that may declare mkdir(). Native Windows platforms declare mkdir + in <io.h> and/or <direct.h>, not in <unistd.h>. */ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include <io.h> /* mingw32, mingw64 */ +# include <direct.h> /* mingw64, MSVC 9 */ +#endif + +/* Native Windows platforms declare umask() in <io.h>. */ +#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +# include <io.h> +#endif + +/* Large File Support on native Windows. */ +#if @WINDOWS_64_BIT_ST_SIZE@ +# define stat _stati64 +#endif + +/* Optionally, override 'struct stat' on native Windows. */ +#if @GNULIB_OVERRIDES_STRUCT_STAT@ + +# undef stat +# if @GNULIB_STAT@ +# define stat rpl_stat +# else + /* Provoke a clear link error if stat() is used as a function and + module 'stat' is not in use. */ +# define stat stat_used_without_requesting_gnulib_module_stat +# endif + +# if !GNULIB_defined_struct_stat +struct stat +{ + dev_t st_dev; + ino_t st_ino; + mode_t st_mode; + nlink_t st_nlink; +# if 0 + uid_t st_uid; +# else /* uid_t is not defined by default on native Windows. */ + short st_uid; +# endif +# if 0 + gid_t st_gid; +# else /* gid_t is not defined by default on native Windows. */ + short st_gid; +# endif + dev_t st_rdev; + off_t st_size; +# if 0 + blksize_t st_blksize; + blkcnt_t st_blocks; +# endif + +# if @WINDOWS_STAT_TIMESPEC@ + struct timespec st_atim; + struct timespec st_mtim; + struct timespec st_ctim; +# else + time_t st_atime; + time_t st_mtime; + time_t st_ctime; +# endif +}; +# if @WINDOWS_STAT_TIMESPEC@ +# define st_atime st_atim.tv_sec +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec + /* Indicator, for gnulib internal purposes. */ +# define _GL_WINDOWS_STAT_TIMESPEC 1 +# endif +# define GNULIB_defined_struct_stat 1 +# endif + +/* Other possible values of st_mode. */ +# if 0 +# define _S_IFBLK 0x6000 +# endif +# if 0 +# define _S_IFLNK 0xA000 +# endif +# if 0 +# define _S_IFSOCK 0xC000 +# endif + +#endif + +#ifndef S_IFIFO +# ifdef _S_IFIFO +# define S_IFIFO _S_IFIFO +# endif +#endif + +#ifndef S_IFMT +# define S_IFMT 0170000 +#endif + +#if STAT_MACROS_BROKEN +# undef S_ISBLK +# undef S_ISCHR +# undef S_ISDIR +# undef S_ISFIFO +# undef S_ISLNK +# undef S_ISNAM +# undef S_ISMPB +# undef S_ISMPC +# undef S_ISNWK +# undef S_ISREG +# undef S_ISSOCK +#endif + +#ifndef S_ISBLK +# ifdef S_IFBLK +# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) +# else +# define S_ISBLK(m) 0 +# endif +#endif + +#ifndef S_ISCHR +# ifdef S_IFCHR +# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) +# else +# define S_ISCHR(m) 0 +# endif +#endif + +#ifndef S_ISDIR +# ifdef S_IFDIR +# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +# else +# define S_ISDIR(m) 0 +# endif +#endif + +#ifndef S_ISDOOR /* Solaris 2.5 and up */ +# define S_ISDOOR(m) 0 +#endif + +#ifndef S_ISFIFO +# ifdef S_IFIFO +# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) +# else +# define S_ISFIFO(m) 0 +# endif +#endif + +#ifndef S_ISLNK +# ifdef S_IFLNK +# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +# else +# define S_ISLNK(m) 0 +# endif +#endif + +#ifndef S_ISMPB /* V7 */ +# ifdef S_IFMPB +# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) +# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) +# else +# define S_ISMPB(m) 0 +# define S_ISMPC(m) 0 +# endif +#endif + +#ifndef S_ISMPX /* AIX */ +# define S_ISMPX(m) 0 +#endif + +#ifndef S_ISNAM /* Xenix */ +# ifdef S_IFNAM +# define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM) +# else +# define S_ISNAM(m) 0 +# endif +#endif + +#ifndef S_ISNWK /* HP/UX */ +# ifdef S_IFNWK +# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) +# else +# define S_ISNWK(m) 0 +# endif +#endif + +#ifndef S_ISPORT /* Solaris 10 and up */ +# define S_ISPORT(m) 0 +#endif + +#ifndef S_ISREG +# ifdef S_IFREG +# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +# else +# define S_ISREG(m) 0 +# endif +#endif + +#ifndef S_ISSOCK +# ifdef S_IFSOCK +# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) +# else +# define S_ISSOCK(m) 0 +# endif +#endif + + +#ifndef S_TYPEISMQ +# define S_TYPEISMQ(p) 0 +#endif + +#ifndef S_TYPEISTMO +# define S_TYPEISTMO(p) 0 +#endif + + +#ifndef S_TYPEISSEM +# ifdef S_INSEM +# define S_TYPEISSEM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSEM) +# else +# define S_TYPEISSEM(p) 0 +# endif +#endif + +#ifndef S_TYPEISSHM +# ifdef S_INSHD +# define S_TYPEISSHM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSHD) +# else +# define S_TYPEISSHM(p) 0 +# endif +#endif + +/* high performance ("contiguous data") */ +#ifndef S_ISCTG +# define S_ISCTG(p) 0 +#endif + +/* Cray DMF (data migration facility): off line, with data */ +#ifndef S_ISOFD +# define S_ISOFD(p) 0 +#endif + +/* Cray DMF (data migration facility): off line, with no data */ +#ifndef S_ISOFL +# define S_ISOFL(p) 0 +#endif + +/* 4.4BSD whiteout */ +#ifndef S_ISWHT +# define S_ISWHT(m) 0 +#endif + +/* If any of the following are undefined, + define them to their de facto standard values. */ +#if !S_ISUID +# define S_ISUID 04000 +#endif +#if !S_ISGID +# define S_ISGID 02000 +#endif + +/* S_ISVTX is a common extension to POSIX. */ +#ifndef S_ISVTX +# define S_ISVTX 01000 +#endif + +#if !S_IRUSR && S_IREAD +# define S_IRUSR S_IREAD +#endif +#if !S_IRUSR +# define S_IRUSR 00400 +#endif +#if !S_IRGRP +# define S_IRGRP (S_IRUSR >> 3) +#endif +#if !S_IROTH +# define S_IROTH (S_IRUSR >> 6) +#endif + +#if !S_IWUSR && S_IWRITE +# define S_IWUSR S_IWRITE +#endif +#if !S_IWUSR +# define S_IWUSR 00200 +#endif +#if !S_IWGRP +# define S_IWGRP (S_IWUSR >> 3) +#endif +#if !S_IWOTH +# define S_IWOTH (S_IWUSR >> 6) +#endif + +#if !S_IXUSR && S_IEXEC +# define S_IXUSR S_IEXEC +#endif +#if !S_IXUSR +# define S_IXUSR 00100 +#endif +#if !S_IXGRP +# define S_IXGRP (S_IXUSR >> 3) +#endif +#if !S_IXOTH +# define S_IXOTH (S_IXUSR >> 6) +#endif + +#if !S_IRWXU +# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) +#endif +#if !S_IRWXG +# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) +#endif +#if !S_IRWXO +# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) +#endif + +/* S_IXUGO is a common extension to POSIX. */ +#if !S_IXUGO +# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) +#endif + +#ifndef S_IRWXUGO +# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) +#endif + +/* Macros for futimens and utimensat. */ +#ifndef UTIME_NOW +# define UTIME_NOW (-1) +# define UTIME_OMIT (-2) +#endif + + +#if @GNULIB_FCHMODAT@ +# if !@HAVE_FCHMODAT@ +_GL_FUNCDECL_SYS (fchmodat, int, + (int fd, char const *file, mode_t mode, int flag) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (fchmodat, int, + (int fd, char const *file, mode_t mode, int flag)); +_GL_CXXALIASWARN (fchmodat); +#elif defined GNULIB_POSIXCHECK +# undef fchmodat +# if HAVE_RAW_DECL_FCHMODAT +_GL_WARN_ON_USE (fchmodat, "fchmodat is not portable - " + "use gnulib module openat for portability"); +# endif +#endif + + +#if @GNULIB_FSTAT@ +# if @REPLACE_FSTAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fstat +# define fstat rpl_fstat +# endif +_GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf)); +# else +_GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf)); +# endif +_GL_CXXALIASWARN (fstat); +#elif @GNULIB_OVERRIDES_STRUCT_STAT@ +# undef fstat +# define fstat fstat_used_without_requesting_gnulib_module_fstat +#elif @WINDOWS_64_BIT_ST_SIZE@ +/* Above, we define stat to _stati64. */ +# define fstat _fstati64 +#elif defined GNULIB_POSIXCHECK +# undef fstat +# if HAVE_RAW_DECL_FSTAT +_GL_WARN_ON_USE (fstat, "fstat has portability problems - " + "use gnulib module fstat for portability"); +# endif +#endif + + +#if @GNULIB_FSTATAT@ +# if @REPLACE_FSTATAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fstatat +# define fstatat rpl_fstatat +# endif +_GL_FUNCDECL_RPL (fstatat, int, + (int fd, char const *name, struct stat *st, int flags) + _GL_ARG_NONNULL ((2, 3))); +_GL_CXXALIAS_RPL (fstatat, int, + (int fd, char const *name, struct stat *st, int flags)); +# else +# if !@HAVE_FSTATAT@ +_GL_FUNCDECL_SYS (fstatat, int, + (int fd, char const *name, struct stat *st, int flags) + _GL_ARG_NONNULL ((2, 3))); +# endif +_GL_CXXALIAS_SYS (fstatat, int, + (int fd, char const *name, struct stat *st, int flags)); +# endif +_GL_CXXALIASWARN (fstatat); +#elif @GNULIB_OVERRIDES_STRUCT_STAT@ +# undef fstatat +# define fstatat fstatat_used_without_requesting_gnulib_module_fstatat +#elif defined GNULIB_POSIXCHECK +# undef fstatat +# if HAVE_RAW_DECL_FSTATAT +_GL_WARN_ON_USE (fstatat, "fstatat is not portable - " + "use gnulib module openat for portability"); +# endif +#endif + + +#if @GNULIB_FUTIMENS@ +/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our futimens + implementation relies on futimesat, which on Solaris 10 makes an invocation + to futimens that is meant to invoke the libc's futimens(), not gnulib's + futimens(). */ +# if @REPLACE_FUTIMENS@ || (!@HAVE_FUTIMENS@ && defined __sun) +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef futimens +# define futimens rpl_futimens +# endif +_GL_FUNCDECL_RPL (futimens, int, (int fd, struct timespec const times[2])); +_GL_CXXALIAS_RPL (futimens, int, (int fd, struct timespec const times[2])); +# else +# if !@HAVE_FUTIMENS@ +_GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2])); +# endif +_GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2])); +# endif +# if @HAVE_FUTIMENS@ +_GL_CXXALIASWARN (futimens); +# endif +#elif defined GNULIB_POSIXCHECK +# undef futimens +# if HAVE_RAW_DECL_FUTIMENS +_GL_WARN_ON_USE (futimens, "futimens is not portable - " + "use gnulib module futimens for portability"); +# endif +#endif + + +#if @GNULIB_LCHMOD@ +/* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME + denotes a symbolic link. */ +# if !@HAVE_LCHMOD@ +/* The lchmod replacement follows symbolic links. Callers should take + this into account; lchmod should be applied only to arguments that + are known to not be symbolic links. On hosts that lack lchmod, + this can lead to race conditions between the check and the + invocation of lchmod, but we know of no workarounds that are + reliable in general. You might try requesting support for lchmod + from your operating system supplier. */ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define lchmod chmod +# endif +/* Need to cast, because on mingw, the second parameter of chmod is + int mode. */ +_GL_CXXALIAS_RPL_CAST_1 (lchmod, chmod, int, + (const char *filename, mode_t mode)); +# else +# if 0 /* assume already declared */ +_GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode)); +# endif +# if @HAVE_LCHMOD@ +_GL_CXXALIASWARN (lchmod); +# endif +#elif defined GNULIB_POSIXCHECK +# undef lchmod +# if HAVE_RAW_DECL_LCHMOD +_GL_WARN_ON_USE (lchmod, "lchmod is unportable - " + "use gnulib module lchmod for portability"); +# endif +#endif + + +#if @GNULIB_LSTAT@ +# if ! @HAVE_LSTAT@ +/* mingw does not support symlinks, therefore it does not have lstat. But + without links, stat does just fine. */ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define lstat stat +# endif +_GL_CXXALIAS_RPL_1 (lstat, stat, int, (const char *name, struct stat *buf)); +# elif @REPLACE_LSTAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef lstat +# define lstat rpl_lstat +# endif +_GL_FUNCDECL_RPL (lstat, int, (const char *name, struct stat *buf) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (lstat, int, (const char *name, struct stat *buf)); +# else +_GL_CXXALIAS_SYS (lstat, int, (const char *name, struct stat *buf)); +# endif +# if @HAVE_LSTAT@ +_GL_CXXALIASWARN (lstat); +# endif +#elif @GNULIB_OVERRIDES_STRUCT_STAT@ +# undef lstat +# define lstat lstat_used_without_requesting_gnulib_module_lstat +#elif defined GNULIB_POSIXCHECK +# undef lstat +# if HAVE_RAW_DECL_LSTAT +_GL_WARN_ON_USE (lstat, "lstat is unportable - " + "use gnulib module lstat for portability"); +# endif +#endif + + +#if @REPLACE_MKDIR@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mkdir +# define mkdir rpl_mkdir +# endif +_GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode)); +#else +/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments. + Additionally, it declares _mkdir (and depending on compile flags, an + alias mkdir), only in the nonstandard includes <direct.h> and <io.h>, + which are included above. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +# if !GNULIB_defined_rpl_mkdir +static int +rpl_mkdir (char const *name, mode_t mode) +{ + return _mkdir (name); +} +# define GNULIB_defined_rpl_mkdir 1 +# endif + +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define mkdir rpl_mkdir +# endif +_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode)); +# else +_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode)); +# endif +#endif +_GL_CXXALIASWARN (mkdir); + + +#if @GNULIB_MKDIRAT@ +# if !@HAVE_MKDIRAT@ +_GL_FUNCDECL_SYS (mkdirat, int, (int fd, char const *file, mode_t mode) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (mkdirat, int, (int fd, char const *file, mode_t mode)); +_GL_CXXALIASWARN (mkdirat); +#elif defined GNULIB_POSIXCHECK +# undef mkdirat +# if HAVE_RAW_DECL_MKDIRAT +_GL_WARN_ON_USE (mkdirat, "mkdirat is not portable - " + "use gnulib module openat for portability"); +# endif +#endif + + +#if @GNULIB_MKFIFO@ +# if @REPLACE_MKFIFO@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mkfifo +# define mkfifo rpl_mkfifo +# endif +_GL_FUNCDECL_RPL (mkfifo, int, (char const *file, mode_t mode) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (mkfifo, int, (char const *file, mode_t mode)); +# else +# if !@HAVE_MKFIFO@ +_GL_FUNCDECL_SYS (mkfifo, int, (char const *file, mode_t mode) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (mkfifo, int, (char const *file, mode_t mode)); +# endif +_GL_CXXALIASWARN (mkfifo); +#elif defined GNULIB_POSIXCHECK +# undef mkfifo +# if HAVE_RAW_DECL_MKFIFO +_GL_WARN_ON_USE (mkfifo, "mkfifo is not portable - " + "use gnulib module mkfifo for portability"); +# endif +#endif + + +#if @GNULIB_MKFIFOAT@ +# if !@HAVE_MKFIFOAT@ +_GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)); +_GL_CXXALIASWARN (mkfifoat); +#elif defined GNULIB_POSIXCHECK +# undef mkfifoat +# if HAVE_RAW_DECL_MKFIFOAT +_GL_WARN_ON_USE (mkfifoat, "mkfifoat is not portable - " + "use gnulib module mkfifoat for portability"); +# endif +#endif + + +#if @GNULIB_MKNOD@ +# if @REPLACE_MKNOD@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mknod +# define mknod rpl_mknod +# endif +_GL_FUNCDECL_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev)); +# else +# if !@HAVE_MKNOD@ +_GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev) + _GL_ARG_NONNULL ((1))); +# endif +/* Need to cast, because on OSF/1 5.1, the third parameter is '...'. */ +_GL_CXXALIAS_SYS_CAST (mknod, int, (char const *file, mode_t mode, dev_t dev)); +# endif +_GL_CXXALIASWARN (mknod); +#elif defined GNULIB_POSIXCHECK +# undef mknod +# if HAVE_RAW_DECL_MKNOD +_GL_WARN_ON_USE (mknod, "mknod is not portable - " + "use gnulib module mknod for portability"); +# endif +#endif + + +#if @GNULIB_MKNODAT@ +# if !@HAVE_MKNODAT@ +_GL_FUNCDECL_SYS (mknodat, int, + (int fd, char const *file, mode_t mode, dev_t dev) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (mknodat, int, + (int fd, char const *file, mode_t mode, dev_t dev)); +_GL_CXXALIASWARN (mknodat); +#elif defined GNULIB_POSIXCHECK +# undef mknodat +# if HAVE_RAW_DECL_MKNODAT +_GL_WARN_ON_USE (mknodat, "mknodat is not portable - " + "use gnulib module mkfifoat for portability"); +# endif +#endif + + +#if @GNULIB_STAT@ +# if @REPLACE_STAT@ +# if !@GNULIB_OVERRIDES_STRUCT_STAT@ + /* We can't use the object-like #define stat rpl_stat, because of + struct stat. This means that rpl_stat will not be used if the user + does (stat)(a,b). Oh well. */ +# if defined _AIX && defined stat && defined _LARGE_FILES + /* With _LARGE_FILES defined, AIX (only) defines stat to stat64, + so we have to replace stat64() instead of stat(). */ +# undef stat64 +# define stat64(name, st) rpl_stat (name, st) +# elif @WINDOWS_64_BIT_ST_SIZE@ + /* Above, we define stat to _stati64. */ +# if defined __MINGW32__ && defined _stati64 +# ifndef _USE_32BIT_TIME_T + /* The system headers define _stati64 to _stat64. */ +# undef _stat64 +# define _stat64(name, st) rpl_stat (name, st) +# endif +# elif defined _MSC_VER && defined _stati64 +# ifdef _USE_32BIT_TIME_T + /* The system headers define _stati64 to _stat32i64. */ +# undef _stat32i64 +# define _stat32i64(name, st) rpl_stat (name, st) +# else + /* The system headers define _stati64 to _stat64. */ +# undef _stat64 +# define _stat64(name, st) rpl_stat (name, st) +# endif +# else +# undef _stati64 +# define _stati64(name, st) rpl_stat (name, st) +# endif +# elif defined __MINGW32__ && defined stat +# ifdef _USE_32BIT_TIME_T + /* The system headers define stat to _stat32i64. */ +# undef _stat32i64 +# define _stat32i64(name, st) rpl_stat (name, st) +# else + /* The system headers define stat to _stat64. */ +# undef _stat64 +# define _stat64(name, st) rpl_stat (name, st) +# endif +# elif defined _MSC_VER && defined stat +# ifdef _USE_32BIT_TIME_T + /* The system headers define stat to _stat32. */ +# undef _stat32 +# define _stat32(name, st) rpl_stat (name, st) +# else + /* The system headers define stat to _stat64i32. */ +# undef _stat64i32 +# define _stat64i32(name, st) rpl_stat (name, st) +# endif +# else /* !(_AIX || __MINGW32__ || _MSC_VER) */ +# undef stat +# define stat(name, st) rpl_stat (name, st) +# endif /* !_LARGE_FILES */ +# endif /* !@GNULIB_OVERRIDES_STRUCT_STAT@ */ +_GL_EXTERN_C int stat (const char *name, struct stat *buf) + _GL_ARG_NONNULL ((1, 2)); +# endif +#elif @GNULIB_OVERRIDES_STRUCT_STAT@ +/* see above: + #define stat stat_used_without_requesting_gnulib_module_stat + */ +#elif defined GNULIB_POSIXCHECK +# undef stat +# if HAVE_RAW_DECL_STAT +_GL_WARN_ON_USE (stat, "stat is unportable - " + "use gnulib module stat for portability"); +# endif +#endif + + +#if @GNULIB_UTIMENSAT@ +/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our utimensat + implementation relies on futimesat, which on Solaris 10 makes an invocation + to utimensat that is meant to invoke the libc's utimensat(), not gnulib's + utimensat(). */ +# if @REPLACE_UTIMENSAT@ || (!@HAVE_UTIMENSAT@ && defined __sun) +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef utimensat +# define utimensat rpl_utimensat +# endif +_GL_FUNCDECL_RPL (utimensat, int, (int fd, char const *name, + struct timespec const times[2], int flag) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (utimensat, int, (int fd, char const *name, + struct timespec const times[2], int flag)); +# else +# if !@HAVE_UTIMENSAT@ +_GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name, + struct timespec const times[2], int flag) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name, + struct timespec const times[2], int flag)); +# endif +# if @HAVE_UTIMENSAT@ +_GL_CXXALIASWARN (utimensat); +# endif +#elif defined GNULIB_POSIXCHECK +# undef utimensat +# if HAVE_RAW_DECL_UTIMENSAT +_GL_WARN_ON_USE (utimensat, "utimensat is not portable - " + "use gnulib module utimensat for portability"); +# endif +#endif + + +#endif /* _@GUARD_PREFIX@_SYS_STAT_H */ +#endif /* _@GUARD_PREFIX@_SYS_STAT_H */ +#endif diff --git a/local/recipes/tools/diffutils/source/lib/sys_time.in.h b/local/recipes/tools/diffutils/source/lib/sys_time.in.h new file mode 100644 index 0000000000..57739bc4c5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/sys_time.in.h @@ -0,0 +1,220 @@ +/* Provide a more complete sys/time.h. + + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +#ifndef _@GUARD_PREFIX@_SYS_TIME_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* On Cygwin and on many BSDish systems, <sys/time.h> includes itself + recursively via <sys/select.h>. + Simply delegate to the system's header in this case; it is a no-op. + Without this extra ifdef, the C++ gettimeofday declaration below + would be a forward declaration in gnulib's nested <sys/time.h>. */ +#if defined _CYGWIN_SYS_TIME_H || defined _SYS_TIME_H || defined _SYS_TIME_H_ +# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@ +#else + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_SYS_TIME_H@ +# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@ +#endif + +#ifndef _@GUARD_PREFIX@_SYS_TIME_H +#define _@GUARD_PREFIX@_SYS_TIME_H + +#if ! @HAVE_SYS_TIME_H@ +# include <time.h> +#endif + +/* On native Windows with MSVC, get the 'struct timeval' type. + Also, on native Windows with a 64-bit time_t, where we are overriding the + 'struct timeval' type, get all declarations of system functions whose + signature contains 'struct timeval'. */ +#if (defined _MSC_VER || @REPLACE_STRUCT_TIMEVAL@) && @HAVE_WINSOCK2_H@ && !defined _GL_INCLUDING_WINSOCK2_H +# define _GL_INCLUDING_WINSOCK2_H +# include <winsock2.h> +# undef _GL_INCLUDING_WINSOCK2_H +#endif + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +#ifdef __cplusplus +extern "C" { +#endif + +#if !@HAVE_STRUCT_TIMEVAL@ || @REPLACE_STRUCT_TIMEVAL@ + +# if @REPLACE_STRUCT_TIMEVAL@ +# define timeval rpl_timeval +# endif + +# if !GNULIB_defined_struct_timeval +struct timeval +{ + time_t tv_sec; + long int tv_usec; +}; +# define GNULIB_defined_struct_timeval 1 +# endif + +#endif + +#ifdef __cplusplus +} +#endif + +#if @GNULIB_GETTIMEOFDAY@ +# if @REPLACE_GETTIMEOFDAY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef gettimeofday +# define gettimeofday rpl_gettimeofday +# endif +_GL_FUNCDECL_RPL (gettimeofday, int, + (struct timeval *restrict, void *restrict) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (gettimeofday, int, + (struct timeval *restrict, void *restrict)); +# else +# if !@HAVE_GETTIMEOFDAY@ +_GL_FUNCDECL_SYS (gettimeofday, int, + (struct timeval *restrict, void *restrict) + _GL_ARG_NONNULL ((1))); +# endif +/* Need to cast, because on glibc systems, by default, the second argument is + struct timezone *. */ +_GL_CXXALIAS_SYS_CAST (gettimeofday, int, + (struct timeval *restrict, void *restrict)); +# endif +_GL_CXXALIASWARN (gettimeofday); +# if defined __cplusplus && defined GNULIB_NAMESPACE +namespace GNULIB_NAMESPACE { + typedef ::timeval +#undef timeval + timeval; +} +# endif +#elif defined GNULIB_POSIXCHECK +# undef gettimeofday +# if HAVE_RAW_DECL_GETTIMEOFDAY +_GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - " + "use gnulib module gettimeofday for portability"); +# endif +#endif + +/* Hide some function declarations from <winsock2.h>. */ + +#if defined _MSC_VER && @HAVE_WINSOCK2_H@ +# if !defined _@GUARD_PREFIX@_UNISTD_H +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef close +# define close close_used_without_including_unistd_h +# else + _GL_WARN_ON_USE (close, + "close() used without including <unistd.h>"); +# endif +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef gethostname +# define gethostname gethostname_used_without_including_unistd_h +# else + _GL_WARN_ON_USE (gethostname, + "gethostname() used without including <unistd.h>"); +# endif +# endif +# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef socket +# define socket socket_used_without_including_sys_socket_h +# undef connect +# define connect connect_used_without_including_sys_socket_h +# undef accept +# define accept accept_used_without_including_sys_socket_h +# undef bind +# define bind bind_used_without_including_sys_socket_h +# undef getpeername +# define getpeername getpeername_used_without_including_sys_socket_h +# undef getsockname +# define getsockname getsockname_used_without_including_sys_socket_h +# undef getsockopt +# define getsockopt getsockopt_used_without_including_sys_socket_h +# undef listen +# define listen listen_used_without_including_sys_socket_h +# undef recv +# define recv recv_used_without_including_sys_socket_h +# undef send +# define send send_used_without_including_sys_socket_h +# undef recvfrom +# define recvfrom recvfrom_used_without_including_sys_socket_h +# undef sendto +# define sendto sendto_used_without_including_sys_socket_h +# undef setsockopt +# define setsockopt setsockopt_used_without_including_sys_socket_h +# undef shutdown +# define shutdown shutdown_used_without_including_sys_socket_h +# else + _GL_WARN_ON_USE (socket, + "socket() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (connect, + "connect() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (accept, + "accept() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (bind, + "bind() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (getpeername, + "getpeername() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (getsockname, + "getsockname() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (getsockopt, + "getsockopt() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (listen, + "listen() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (recv, + "recv() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (send, + "send() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (recvfrom, + "recvfrom() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (sendto, + "sendto() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (setsockopt, + "setsockopt() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (shutdown, + "shutdown() used without including <sys/socket.h>"); +# endif +# endif +# if !defined _@GUARD_PREFIX@_SYS_SELECT_H +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef select +# define select select_used_without_including_sys_select_h +# else + _GL_WARN_ON_USE (select, + "select() used without including <sys/select.h>"); +# endif +# endif +#endif + +#endif /* _@GUARD_PREFIX@_SYS_TIME_H */ +#endif /* _CYGWIN_SYS_TIME_H */ +#endif /* _@GUARD_PREFIX@_SYS_TIME_H */ diff --git a/local/recipes/tools/diffutils/source/lib/sys_types.in.h b/local/recipes/tools/diffutils/source/lib/sys_types.in.h new file mode 100644 index 0000000000..3cea44884e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/sys_types.in.h @@ -0,0 +1,95 @@ +/* Provide a more complete sys/types.h. + + Copyright (C) 2011-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#ifndef _@GUARD_PREFIX@_SYS_TYPES_H + +/* The include_next requires a split double-inclusion guard. */ +# define _GL_INCLUDING_SYS_TYPES_H +#@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@ +# undef _GL_INCLUDING_SYS_TYPES_H + +#ifndef _@GUARD_PREFIX@_SYS_TYPES_H +#define _@GUARD_PREFIX@_SYS_TYPES_H + +/* Override off_t if Large File Support is requested on native Windows. */ +#if @WINDOWS_64_BIT_OFF_T@ +/* Same as int64_t in <stdint.h>. */ +# if defined _MSC_VER +# define off_t __int64 +# else +# define off_t long long int +# endif +/* Indicator, for gnulib internal purposes. */ +# define _GL_WINDOWS_64_BIT_OFF_T 1 +#endif + +/* Override dev_t and ino_t if distinguishable inodes support is requested + on native Windows. */ +#if @WINDOWS_STAT_INODES@ + +# if @WINDOWS_STAT_INODES@ == 2 +/* Experimental, not useful in Windows 10. */ + +/* Define dev_t to a 64-bit type. */ +# if !defined GNULIB_defined_dev_t +typedef unsigned long long int rpl_dev_t; +# undef dev_t +# define dev_t rpl_dev_t +# define GNULIB_defined_dev_t 1 +# endif + +/* Define ino_t to a 128-bit type. */ +# if !defined GNULIB_defined_ino_t +/* MSVC does not have a 128-bit integer type. + GCC has a 128-bit integer type __int128, but only on 64-bit targets. */ +typedef struct { unsigned long long int _gl_ino[2]; } rpl_ino_t; +# undef ino_t +# define ino_t rpl_ino_t +# define GNULIB_defined_ino_t 1 +# endif + +# else /* @WINDOWS_STAT_INODES@ == 1 */ + +/* Define ino_t to a 64-bit type. */ +# if !defined GNULIB_defined_ino_t +typedef unsigned long long int rpl_ino_t; +# undef ino_t +# define ino_t rpl_ino_t +# define GNULIB_defined_ino_t 1 +# endif + +# endif + +/* Indicator, for gnulib internal purposes. */ +# define _GL_WINDOWS_STAT_INODES @WINDOWS_STAT_INODES@ + +#endif + +/* MSVC 9 defines size_t in <stddef.h>, not in <sys/types.h>. */ +/* But avoid namespace pollution on glibc systems. */ +#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \ + && ! defined __GLIBC__ +# include <stddef.h> +#endif + +#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */ +#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */ diff --git a/local/recipes/tools/diffutils/source/lib/sys_wait.in.h b/local/recipes/tools/diffutils/source/lib/sys_wait.in.h new file mode 100644 index 0000000000..1458d26b29 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/sys_wait.in.h @@ -0,0 +1,129 @@ +/* A POSIX-like <sys/wait.h>. + Copyright (C) 2001-2003, 2005-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + + +#ifndef _@GUARD_PREFIX@_SYS_WAIT_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* The include_next requires a split double-inclusion guard. */ +#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +# @INCLUDE_NEXT@ @NEXT_SYS_WAIT_H@ +#endif + +#ifndef _@GUARD_PREFIX@_SYS_WAIT_H +#define _@GUARD_PREFIX@_SYS_WAIT_H + +/* Get pid_t. */ +#include <sys/types.h> + + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + + +#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +/* Unix API. */ + +/* The following macros apply to an argument x, that is a status of a process, + as returned by waitpid(). + On nearly all systems, including Linux/x86, WEXITSTATUS are bits 15..8 and + WTERMSIG are bits 7..0, while BeOS uses the opposite. Therefore programs + have to use the abstract macros. */ + +/* For valid x, exactly one of WIFSIGNALED(x), WIFEXITED(x), WIFSTOPPED(x) + is true. */ +# ifndef WIFSIGNALED +# define WIFSIGNALED(x) (WTERMSIG (x) != 0 && WTERMSIG(x) != 0x7f) +# endif +# ifndef WIFEXITED +# define WIFEXITED(x) (WTERMSIG (x) == 0) +# endif +# ifndef WIFSTOPPED +# define WIFSTOPPED(x) (WTERMSIG (x) == 0x7f) +# endif + +/* The termination signal. Only to be accessed if WIFSIGNALED(x) is true. */ +# ifndef WTERMSIG +# define WTERMSIG(x) ((x) & 0x7f) +# endif + +/* The exit status. Only to be accessed if WIFEXITED(x) is true. */ +# ifndef WEXITSTATUS +# define WEXITSTATUS(x) (((x) >> 8) & 0xff) +# endif + +/* The stopping signal. Only to be accessed if WIFSTOPPED(x) is true. */ +# ifndef WSTOPSIG +# define WSTOPSIG(x) (((x) >> 8) & 0x7f) +# endif + +/* True if the process dumped core. Not standardized by POSIX. */ +# ifndef WCOREDUMP +# define WCOREDUMP(x) ((x) & 0x80) +# endif + +#else +/* Native Windows API. */ + +# include <signal.h> /* for SIGTERM */ + +/* The following macros apply to an argument x, that is a status of a process, + as returned by waitpid() or, equivalently, _cwait() or GetExitCodeProcess(). + This value is simply an 'int', not composed of bit fields. */ + +/* When an unhandled fatal signal terminates a process, the exit code is 3. */ +# define WIFSIGNALED(x) ((x) == 3) +# define WIFEXITED(x) ((x) != 3) +# define WIFSTOPPED(x) 0 + +/* The signal that terminated a process is not known posthum. */ +# define WTERMSIG(x) SIGTERM + +# define WEXITSTATUS(x) (x) + +/* There are no stopping signals. */ +# define WSTOPSIG(x) 0 + +/* There are no core dumps. */ +# define WCOREDUMP(x) 0 + +#endif + + +/* Declarations of functions. */ + +#if @GNULIB_WAITPID@ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +_GL_FUNCDECL_SYS (waitpid, pid_t, (pid_t pid, int *statusp, int options)); +# endif +_GL_CXXALIAS_SYS (waitpid, pid_t, (pid_t pid, int *statusp, int options)); +_GL_CXXALIASWARN (waitpid); +#elif defined GNULIB_POSIXCHECK +# undef waitpid +# if HAVE_RAW_DECL_WAITPID +_GL_WARN_ON_USE (waitpid, "waitpid is unportable - " + "use gnulib module sys_wait for portability"); +# endif +#endif + + +#endif /* _@GUARD_PREFIX@_SYS_WAIT_H */ +#endif /* _@GUARD_PREFIX@_SYS_WAIT_H */ diff --git a/local/recipes/tools/diffutils/source/lib/system-quote.c b/local/recipes/tools/diffutils/source/lib/system-quote.c new file mode 100644 index 0000000000..c114f7fbf2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/system-quote.c @@ -0,0 +1,311 @@ +/* Quoting for a system command. + Copyright (C) 2012-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2012. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "system-quote.h" + +#include <stdbool.h> +#include <stdlib.h> +#include <string.h> + +#include "sh-quote.h" +#include "xalloc.h" + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +/* The native Windows CreateProcess() function interprets characters like + ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + - '*', '?' characters may get expanded through wildcard expansion in the + callee: By default, in the callee, the initialization code before main() + takes the result of GetCommandLine(), wildcard-expands it, and passes it + to main(). The exceptions to this rule are: + - programs that inspect GetCommandLine() and ignore argv, + - mingw programs that have a global variable 'int _CRT_glob = 0;', + - Cygwin programs, when invoked from a Cygwin program. + */ +# define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037*?" +# define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" + +/* Copies the quoted string to p and returns the number of bytes needed. + If p is non-NULL, there must be room for system_quote_length (string) + bytes at p. */ +static size_t +windows_createprocess_quote (char *p, const char *string) +{ + size_t len = strlen (string); + bool quote_around = + (len == 0 || strpbrk (string, SHELL_SPECIAL_CHARS) != NULL); + size_t backslashes = 0; + size_t i = 0; +# define STORE(c) \ + do \ + { \ + if (p != NULL) \ + p[i] = (c); \ + i++; \ + } \ + while (0) + + if (quote_around) + STORE ('"'); + for (; len > 0; string++, len--) + { + char c = *string; + + if (c == '"') + { + size_t j; + + for (j = backslashes + 1; j > 0; j--) + STORE ('\\'); + } + STORE (c); + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + size_t j; + + for (j = backslashes; j > 0; j--) + STORE ('\\'); + STORE ('"'); + } +# undef STORE + return i; +} + +/* The native Windows cmd.exe command interpreter also interprets: + - '\n', '\r' as a command terminator - no way to escape it, + - '<', '>' as redirections, + - '|' as pipe operator, + - '%var%' as a reference to the environment variable VAR (uppercase), + even inside quoted strings, + - '&' '[' ']' '{' '}' '^' '=' ';' '!' '\'' '+' ',' '`' '~' for other + purposes, according to + <http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx?mfr=true> + We quote a string like '%var%' by putting the '%' characters outside of + double-quotes and the rest of the string inside double-quotes: %"var"%. + This is guaranteed to not be a reference to an environment variable. + */ +# define CMD_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037!%&'*+,;<=>?[]^`{|}~" +# define CMD_FORBIDDEN_CHARS "\n\r" + +/* Copies the quoted string to p and returns the number of bytes needed. + If p is non-NULL, there must be room for system_quote_length (string) + bytes at p. */ +static size_t +windows_cmd_quote (char *p, const char *string) +{ + size_t len = strlen (string); + bool quote_around = + (len == 0 || strpbrk (string, CMD_SPECIAL_CHARS) != NULL); + size_t backslashes = 0; + size_t i = 0; +# define STORE(c) \ + do \ + { \ + if (p != NULL) \ + p[i] = (c); \ + i++; \ + } \ + while (0) + + if (quote_around) + STORE ('"'); + for (; len > 0; string++, len--) + { + char c = *string; + + if (c == '"') + { + size_t j; + + for (j = backslashes + 1; j > 0; j--) + STORE ('\\'); + } + if (c == '%') + { + size_t j; + + for (j = backslashes; j > 0; j--) + STORE ('\\'); + STORE ('"'); + } + STORE (c); + if (c == '%') + STORE ('"'); + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + size_t j; + + for (j = backslashes; j > 0; j--) + STORE ('\\'); + STORE ('"'); + } + return i; +} + +#endif + +size_t +system_quote_length (enum system_command_interpreter interpreter, + const char *string) +{ + switch (interpreter) + { +#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) + case SCI_SYSTEM: +#endif + case SCI_POSIX_SH: + return shell_quote_length (string); + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + case SCI_WINDOWS_CREATEPROCESS: + return windows_createprocess_quote (NULL, string); + + case SCI_SYSTEM: + case SCI_WINDOWS_CMD: + return windows_cmd_quote (NULL, string); +#endif + + default: + /* Invalid interpreter. */ + abort (); + } +} + +char * +system_quote_copy (char *p, + enum system_command_interpreter interpreter, + const char *string) +{ + switch (interpreter) + { +#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) + case SCI_SYSTEM: +#endif + case SCI_POSIX_SH: + return shell_quote_copy (p, string); + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + case SCI_WINDOWS_CREATEPROCESS: + p += windows_createprocess_quote (p, string); + *p = '\0'; + return p; + + case SCI_SYSTEM: + case SCI_WINDOWS_CMD: + p += windows_cmd_quote (p, string); + *p = '\0'; + return p; +#endif + + default: + /* Invalid interpreter. */ + abort (); + } +} + +char * +system_quote (enum system_command_interpreter interpreter, + const char *string) +{ + switch (interpreter) + { +#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) + case SCI_SYSTEM: +#endif + case SCI_POSIX_SH: + return shell_quote (string); + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + case SCI_WINDOWS_CREATEPROCESS: + case SCI_SYSTEM: + case SCI_WINDOWS_CMD: + { + size_t length = system_quote_length (interpreter, string); + char *quoted = XNMALLOC (length, char); + system_quote_copy (quoted, interpreter, string); + return quoted; + } +#endif + + default: + /* Invalid interpreter. */ + abort (); + } +} + +char * +system_quote_argv (enum system_command_interpreter interpreter, + char * const *argv) +{ + if (*argv != NULL) + { + char * const *argp; + size_t length; + char *command; + char *p; + + length = 0; + for (argp = argv; ; ) + { + length += system_quote_length (interpreter, *argp) + 1; + argp++; + if (*argp == NULL) + break; + } + + command = XNMALLOC (length, char); + + p = command; + for (argp = argv; ; ) + { + p = system_quote_copy (p, interpreter, *argp); + argp++; + if (*argp == NULL) + break; + *p++ = ' '; + } + *p = '\0'; + + return command; + } + else + return xstrdup (""); +} diff --git a/local/recipes/tools/diffutils/source/lib/system-quote.h b/local/recipes/tools/diffutils/source/lib/system-quote.h new file mode 100644 index 0000000000..f45292f422 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/system-quote.h @@ -0,0 +1,99 @@ +/* Quoting for a system command. + Copyright (C) 2001-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2012. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _SYSTEM_QUOTE_H +#define _SYSTEM_QUOTE_H + +/* When passing a command the system's command interpreter, we must quote the + program name and arguments, since + - Unix shells interpret characters like " ", "'", "<", ">", "$", '*', '?' + etc. in a special way, + - Windows CreateProcess() interprets characters like ' ', '\t', '\\', '"' + etc. (but not '<' and '>') in a special way, + - Windows cmd.exe also interprets characters like '<', '>', '&', '%', etc. + in a special way. Note that it is impossible to pass arguments that + contain newlines or carriage return characters to programs through + cmd.exe. + - Windows programs usually perform wildcard expansion when they receive + arguments that contain unquoted '*', '?' characters. + + With this module, you can build a command that will invoke a program with + specific strings as arguments. + + Note: If you want wildcard expansion to happen, you have to first do wildcard + expansion through the 'glob' module, then quote the resulting strings through + this module, and then invoke the system's command interpreter. + + Limitations: + - When invoking native Windows programs on Windows Vista or newer, + wildcard expansion will occur in the invoked program nevertheless. + - On native Windows, for SCI_SYSTEM and SCI_WINDOWS_CMD, newlines and + carriage return characters are not supported. Their undesired effect + is to truncate the entire command line. + */ + +#include <stddef.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* Identifier for the kind of interpreter of the command. */ +enum system_command_interpreter +{ + /* The interpreter used by the system() and popen() functions. + This is equivalent to SCI_POSIX_SH on Unix platforms and + SCI_WINDOWS_CMD on native Windows platforms. */ + SCI_SYSTEM = 0 + /* The POSIX /bin/sh. */ + , SCI_POSIX_SH = 1 +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* The native Windows CreateProcess() function. */ + , SCI_WINDOWS_CREATEPROCESS = 2 + /* The native Windows cmd.exe interpreter. */ + , SCI_WINDOWS_CMD = 3 +#endif +}; + +/* Returns the number of bytes needed for the quoted string. */ +extern size_t + system_quote_length (enum system_command_interpreter interpreter, + const char *string); + +/* Copies the quoted string to p and returns the incremented p. + There must be room for system_quote_length (string) + 1 bytes at p. */ +extern char * + system_quote_copy (char *p, + enum system_command_interpreter interpreter, + const char *string); + +/* Returns the freshly allocated quoted string. */ +extern char * + system_quote (enum system_command_interpreter interpreter, + const char *string); + +/* Returns a freshly allocated string containing all argument strings, quoted, + separated through spaces. */ +extern char * + system_quote_argv (enum system_command_interpreter interpreter, + char * const *argv); + +#ifdef __cplusplus +} +#endif + +#endif /* _SYSTEM_QUOTE_H */ diff --git a/local/recipes/tools/diffutils/source/lib/tempname.c b/local/recipes/tools/diffutils/source/lib/tempname.c new file mode 100644 index 0000000000..2cd90328bd --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/tempname.c @@ -0,0 +1,324 @@ +/* tempname.c - generate the name of a temporary file. + + Copyright (C) 1991-2003, 2005-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Extracted from glibc sysdeps/posix/tempname.c. See also tmpdir.c. */ + +#if !_LIBC +# include <config.h> +# include "tempname.h" +#endif + +#include <sys/types.h> +#include <assert.h> + +#include <errno.h> +#ifndef __set_errno +# define __set_errno(Val) errno = (Val) +#endif + +#include <stdio.h> +#ifndef P_tmpdir +# define P_tmpdir "/tmp" +#endif +#ifndef TMP_MAX +# define TMP_MAX 238328 +#endif +#ifndef __GT_FILE +# define __GT_FILE 0 +# define __GT_DIR 1 +# define __GT_NOCREATE 2 +#endif +#if !_LIBC && (GT_FILE != __GT_FILE || GT_DIR != __GT_DIR \ + || GT_NOCREATE != __GT_NOCREATE) +# error report this to bug-gnulib@gnu.org +#endif + +#include <stddef.h> +#include <stdlib.h> +#include <string.h> + +#include <fcntl.h> +#include <sys/time.h> +#include <stdint.h> +#include <unistd.h> + +#include <sys/stat.h> + +#if _LIBC +# define struct_stat64 struct stat64 +#else +# define struct_stat64 struct stat +# define __try_tempname try_tempname +# define __gen_tempname gen_tempname +# define __getpid getpid +# define __gettimeofday gettimeofday +# define __mkdir mkdir +# define __open open +# define __lxstat64(version, file, buf) lstat (file, buf) +# define __secure_getenv secure_getenv +#endif + +#ifdef _LIBC +# include <hp-timing.h> +# if HP_TIMING_AVAIL +# define RANDOM_BITS(Var) \ + if (__builtin_expect (value == UINT64_C (0), 0)) \ + { \ + /* If this is the first time this function is used initialize \ + the variable we accumulate the value in to some somewhat \ + random value. If we'd not do this programs at startup time \ + might have a reduced set of possible names, at least on slow \ + machines. */ \ + struct timeval tv; \ + __gettimeofday (&tv, NULL); \ + value = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec; \ + } \ + HP_TIMING_NOW (Var) +# endif +#endif + +/* Use the widest available unsigned type if uint64_t is not + available. The algorithm below extracts a number less than 62**6 + (approximately 2**35.725) from uint64_t, so ancient hosts where + uintmax_t is only 32 bits lose about 3.725 bits of randomness, + which is better than not having mkstemp at all. */ +#if !defined UINT64_MAX && !defined uint64_t +# define uint64_t uintmax_t +#endif + +#if _LIBC +/* Return nonzero if DIR is an existent directory. */ +static int +direxists (const char *dir) +{ + struct_stat64 buf; + return __xstat64 (_STAT_VER, dir, &buf) == 0 && S_ISDIR (buf.st_mode); +} + +/* Path search algorithm, for tmpnam, tmpfile, etc. If DIR is + non-null and exists, uses it; otherwise uses the first of $TMPDIR, + P_tmpdir, /tmp that exists. Copies into TMPL a template suitable + for use with mk[s]temp. Will fail (-1) if DIR is non-null and + doesn't exist, none of the searched dirs exists, or there's not + enough space in TMPL. */ +int +__path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx, + int try_tmpdir) +{ + const char *d; + size_t dlen, plen; + + if (!pfx || !pfx[0]) + { + pfx = "file"; + plen = 4; + } + else + { + plen = strlen (pfx); + if (plen > 5) + plen = 5; + } + + if (try_tmpdir) + { + d = __secure_getenv ("TMPDIR"); + if (d != NULL && direxists (d)) + dir = d; + else if (dir != NULL && direxists (dir)) + /* nothing */ ; + else + dir = NULL; + } + if (dir == NULL) + { + if (direxists (P_tmpdir)) + dir = P_tmpdir; + else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp")) + dir = "/tmp"; + else + { + __set_errno (ENOENT); + return -1; + } + } + + dlen = strlen (dir); + while (dlen > 1 && dir[dlen - 1] == '/') + dlen--; /* remove trailing slashes */ + + /* check we have room for "${dir}/${pfx}XXXXXX\0" */ + if (tmpl_len < dlen + 1 + plen + 6 + 1) + { + __set_errno (EINVAL); + return -1; + } + + sprintf (tmpl, "%.*s/%.*sXXXXXX", (int) dlen, dir, (int) plen, pfx); + return 0; +} +#endif /* _LIBC */ + +/* These are the characters used in temporary file names. */ +static const char letters[] = +"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + +int +__try_tempname (char *tmpl, int suffixlen, void *args, + int (*tryfunc) (char *, void *)) +{ + int len; + char *XXXXXX; + static uint64_t value; + uint64_t random_time_bits; + unsigned int count; + int fd = -1; + int save_errno = errno; + + /* A lower bound on the number of temporary files to attempt to + generate. The maximum total number of temporary file names that + can exist for a given template is 62**6. It should never be + necessary to try all of these combinations. Instead if a reasonable + number of names is tried (we define reasonable as 62**3) fail to + give the system administrator the chance to remove the problems. */ +#define ATTEMPTS_MIN (62 * 62 * 62) + + /* The number of times to attempt to generate a temporary file. To + conform to POSIX, this must be no smaller than TMP_MAX. */ +#if ATTEMPTS_MIN < TMP_MAX + unsigned int attempts = TMP_MAX; +#else + unsigned int attempts = ATTEMPTS_MIN; +#endif + + len = strlen (tmpl); + if (len < 6 + suffixlen || memcmp (&tmpl[len - 6 - suffixlen], "XXXXXX", 6)) + { + __set_errno (EINVAL); + return -1; + } + + /* This is where the Xs start. */ + XXXXXX = &tmpl[len - 6 - suffixlen]; + + /* Get some more or less random data. */ +#ifdef RANDOM_BITS + RANDOM_BITS (random_time_bits); +#else + { + struct timeval tv; + __gettimeofday (&tv, NULL); + random_time_bits = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec; + } +#endif + value += random_time_bits ^ __getpid (); + + for (count = 0; count < attempts; value += 7777, ++count) + { + uint64_t v = value; + + /* Fill in the random bits. */ + XXXXXX[0] = letters[v % 62]; + v /= 62; + XXXXXX[1] = letters[v % 62]; + v /= 62; + XXXXXX[2] = letters[v % 62]; + v /= 62; + XXXXXX[3] = letters[v % 62]; + v /= 62; + XXXXXX[4] = letters[v % 62]; + v /= 62; + XXXXXX[5] = letters[v % 62]; + + fd = tryfunc (tmpl, args); + if (fd >= 0) + { + __set_errno (save_errno); + return fd; + } + else if (errno != EEXIST) + return -1; + } + + /* We got out of the loop because we ran out of combinations to try. */ + __set_errno (EEXIST); + return -1; +} + +static int +try_file (char *tmpl, void *flags) +{ + int *openflags = flags; + return __open (tmpl, + (*openflags & ~O_ACCMODE) + | O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); +} + +static int +try_dir (char *tmpl, void *flags _GL_UNUSED) +{ + return __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR); +} + +static int +try_nocreate (char *tmpl, void *flags _GL_UNUSED) +{ + struct_stat64 st; + + if (__lxstat64 (_STAT_VER, tmpl, &st) == 0) + __set_errno (EEXIST); + return errno == ENOENT ? 0 : -1; +} + +/* Generate a temporary file name based on TMPL. TMPL must match the + rules for mk[s]temp (i.e. end in "XXXXXX", possibly with a suffix). + The name constructed does not exist at the time of the call to + __gen_tempname. TMPL is overwritten with the result. + + KIND may be one of: + __GT_NOCREATE: simply verify that the name does not exist + at the time of the call. + __GT_FILE: create the file using open(O_CREAT|O_EXCL) + and return a read-write fd. The file is mode 0600. + __GT_DIR: create a directory, which will be mode 0700. + + We use a clever algorithm to get hard-to-predict names. */ +int +__gen_tempname (char *tmpl, int suffixlen, int flags, int kind) +{ + int (*tryfunc) (char *, void *); + + switch (kind) + { + case __GT_FILE: + tryfunc = try_file; + break; + + case __GT_DIR: + tryfunc = try_dir; + break; + + case __GT_NOCREATE: + tryfunc = try_nocreate; + break; + + default: + assert (! "invalid KIND in __gen_tempname"); + abort (); + } + return __try_tempname (tmpl, suffixlen, &flags, tryfunc); +} diff --git a/local/recipes/tools/diffutils/source/lib/tempname.h b/local/recipes/tools/diffutils/source/lib/tempname.h new file mode 100644 index 0000000000..1ca97484fb --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/tempname.h @@ -0,0 +1,65 @@ +/* Create a temporary file or directory. + + Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* header written by Eric Blake */ + +#ifndef GL_TEMPNAME_H +# define GL_TEMPNAME_H + +# include <stdio.h> + +# ifdef __GT_FILE +# define GT_FILE __GT_FILE +# define GT_DIR __GT_DIR +# define GT_NOCREATE __GT_NOCREATE +# else +# define GT_FILE 0 +# define GT_DIR 1 +# define GT_NOCREATE 2 +# endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Generate a temporary file name based on TMPL. TMPL must match the + rules for mk[s]temp (i.e. end in "XXXXXX", possibly with a suffix). + The name constructed does not exist at the time of the call to + gen_tempname. TMPL is overwritten with the result. + + KIND may be one of: + GT_NOCREATE: simply verify that the name does not exist + at the time of the call. + GT_FILE: create a large file using open(O_CREAT|O_EXCL) + and return a read-write fd. The file is mode 0600. + GT_DIR: create a directory, which will be mode 0700. + + We use a clever algorithm to get hard-to-predict names. */ +extern int gen_tempname (char *tmpl, int suffixlen, int flags, int kind); + +/* Similar to gen_tempname, but TRYFUNC is called for each temporary + name to try. If TRYFUNC returns a non-negative number, TRY_GEN_TEMPNAME + returns with this value. Otherwise, if errno is set to EEXIST, another + name is tried, or else TRY_GEN_TEMPNAME returns -1. */ +extern int try_tempname (char *tmpl, int suffixlen, void *args, + int (*tryfunc) (char *, void *)); + +#ifdef __cplusplus +} +#endif + +#endif /* GL_TEMPNAME_H */ diff --git a/local/recipes/tools/diffutils/source/lib/time-internal.h b/local/recipes/tools/diffutils/source/lib/time-internal.h new file mode 100644 index 0000000000..bf22834b2e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/time-internal.h @@ -0,0 +1,49 @@ +/* Time internal interface + + Copyright 2015-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +/* A time zone rule. */ +struct tm_zone +{ + /* More abbreviations, should they be needed. Their TZ_IS_SET + members are zero. */ + struct tm_zone *next; + +#if HAVE_TZNAME && !HAVE_TM_ZONE + /* Copies of recent strings taken from tzname[0] and tzname[1]. + The copies are in ABBRS, so that they survive tzset. Null if unknown. */ + char *tzname_copy[2]; +#endif + + /* If nonzero, the rule represents the TZ environment variable set + to the first "abbreviation" (this may be the empty string). + Otherwise, it represents an unset TZ. */ + char tz_is_set; + + /* A sequence of null-terminated strings packed next to each other. + The strings are followed by an extra null byte. If TZ_IS_SET, + there must be at least one string and the first string (which is + actually a TZ environment value) may be empty. Otherwise all + strings must be nonempty. + + Abbreviations are stored here because otherwise the values of + tm_zone and/or tzname would be dead after changing TZ and calling + tzset. Abbreviations never move once allocated, and are live + until tzfree is called. */ + char abbrs[FLEXIBLE_ARRAY_MEMBER]; +}; diff --git a/local/recipes/tools/diffutils/source/lib/time.in.h b/local/recipes/tools/diffutils/source/lib/time.in.h new file mode 100644 index 0000000000..f0c7ef8666 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/time.in.h @@ -0,0 +1,350 @@ +/* A more-standard <time.h>. + + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* Don't get in the way of glibc when it includes time.h merely to + declare a few standard symbols, rather than to declare all the + symbols. (However, skip this for MinGW as it treats __need_time_t + incompatibly.) Also, Solaris 8 <time.h> eventually includes itself + recursively; if that is happening, just include the system <time.h> + without adding our own declarations. */ +#if (((defined __need_time_t || defined __need_clock_t \ + || defined __need_timespec) \ + && !defined __MINGW32__) \ + || defined _@GUARD_PREFIX@_TIME_H) + +# @INCLUDE_NEXT@ @NEXT_TIME_H@ + +#else + +# define _@GUARD_PREFIX@_TIME_H + +# @INCLUDE_NEXT@ @NEXT_TIME_H@ + +/* NetBSD 5.0 mis-defines NULL. */ +# include <stddef.h> + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +/* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3). + Or they define it with the wrong member names or define it in <sys/time.h> + (e.g., FreeBSD circa 1997). Stock Mingw prior to 3.0 does not define it, + but the pthreads-win32 library defines it in <pthread.h>. */ +# if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@ +# if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +# include <sys/time.h> +# elif @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ +# include <pthread.h> +# elif @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ +# include <unistd.h> +# else + +# ifdef __cplusplus +extern "C" { +# endif + +# if !GNULIB_defined_struct_timespec +# undef timespec +# define timespec rpl_timespec +struct timespec +{ + time_t tv_sec; + long int tv_nsec; +}; +# define GNULIB_defined_struct_timespec 1 +# endif + +# ifdef __cplusplus +} +# endif + +# endif +# endif + +# if !GNULIB_defined_struct_time_t_must_be_integral +/* Per http://austingroupbugs.net/view.php?id=327, POSIX requires + time_t to be an integer type, even though C99 permits floating + point. We don't know of any implementation that uses floating + point, and it is much easier to write code that doesn't have to + worry about that corner case, so we force the issue. */ +struct __time_t_must_be_integral { + unsigned int __floating_time_t_unsupported : (time_t) 1; +}; +# define GNULIB_defined_struct_time_t_must_be_integral 1 +# endif + +/* Sleep for at least RQTP seconds unless interrupted, If interrupted, + return -1 and store the remaining time into RMTP. See + <http://www.opengroup.org/susv3xsh/nanosleep.html>. */ +# if @GNULIB_NANOSLEEP@ +# if @REPLACE_NANOSLEEP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define nanosleep rpl_nanosleep +# endif +_GL_FUNCDECL_RPL (nanosleep, int, + (struct timespec const *__rqtp, struct timespec *__rmtp) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (nanosleep, int, + (struct timespec const *__rqtp, struct timespec *__rmtp)); +# else +# if ! @HAVE_NANOSLEEP@ +_GL_FUNCDECL_SYS (nanosleep, int, + (struct timespec const *__rqtp, struct timespec *__rmtp) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (nanosleep, int, + (struct timespec const *__rqtp, struct timespec *__rmtp)); +# endif +_GL_CXXALIASWARN (nanosleep); +# endif + +/* Initialize time conversion information. */ +# if @GNULIB_TZSET@ +# if @REPLACE_TZSET@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef tzset +# define tzset rpl_tzset +# endif +_GL_FUNCDECL_RPL (tzset, void, (void)); +_GL_CXXALIAS_RPL (tzset, void, (void)); +# else +# if ! @HAVE_TZSET@ +_GL_FUNCDECL_SYS (tzset, void, (void)); +# endif +_GL_CXXALIAS_SYS (tzset, void, (void)); +# endif +_GL_CXXALIASWARN (tzset); +# endif + +/* Return the 'time_t' representation of TP and normalize TP. */ +# if @GNULIB_MKTIME@ +# if @REPLACE_MKTIME@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define mktime rpl_mktime +# endif +_GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp)); +# else +_GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp)); +# endif +_GL_CXXALIASWARN (mktime); +# endif + +/* Convert TIMER to RESULT, assuming local time and UTC respectively. See + <http://www.opengroup.org/susv3xsh/localtime_r.html> and + <http://www.opengroup.org/susv3xsh/gmtime_r.html>. */ +# if @GNULIB_TIME_R@ +# if @REPLACE_LOCALTIME_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef localtime_r +# define localtime_r rpl_localtime_r +# endif +_GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, + struct tm *restrict __result) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, + struct tm *restrict __result)); +# else +# if ! @HAVE_DECL_LOCALTIME_R@ +_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, + struct tm *restrict __result) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, + struct tm *restrict __result)); +# endif +# if @HAVE_DECL_LOCALTIME_R@ +_GL_CXXALIASWARN (localtime_r); +# endif +# if @REPLACE_LOCALTIME_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef gmtime_r +# define gmtime_r rpl_gmtime_r +# endif +_GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, + struct tm *restrict __result) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, + struct tm *restrict __result)); +# else +# if ! @HAVE_DECL_LOCALTIME_R@ +_GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, + struct tm *restrict __result) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, + struct tm *restrict __result)); +# endif +# if @HAVE_DECL_LOCALTIME_R@ +_GL_CXXALIASWARN (gmtime_r); +# endif +# endif + +/* Convert TIMER to RESULT, assuming local time and UTC respectively. See + <http://www.opengroup.org/susv3xsh/localtime.html> and + <http://www.opengroup.org/susv3xsh/gmtime.html>. */ +# if @GNULIB_LOCALTIME@ || @REPLACE_LOCALTIME@ +# if @REPLACE_LOCALTIME@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef localtime +# define localtime rpl_localtime +# endif +_GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer)); +# else +_GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer)); +# endif +_GL_CXXALIASWARN (localtime); +# endif + +# if 0 || @REPLACE_GMTIME@ +# if @REPLACE_GMTIME@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef gmtime +# define gmtime rpl_gmtime +# endif +_GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer)); +# else +_GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer)); +# endif +_GL_CXXALIASWARN (gmtime); +# endif + +/* Parse BUF as a timestamp, assuming FORMAT specifies its layout, and store + the resulting broken-down time into TM. See + <http://www.opengroup.org/susv3xsh/strptime.html>. */ +# if @GNULIB_STRPTIME@ +# if ! @HAVE_STRPTIME@ +_GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf, + char const *restrict __format, + struct tm *restrict __tm) + _GL_ARG_NONNULL ((1, 2, 3))); +# endif +_GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf, + char const *restrict __format, + struct tm *restrict __tm)); +_GL_CXXALIASWARN (strptime); +# endif + +/* Convert *TP to a date and time string. See + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/ctime.html>. */ +# if @GNULIB_CTIME@ +# if @REPLACE_CTIME@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define ctime rpl_ctime +# endif +_GL_FUNCDECL_RPL (ctime, char *, (time_t const *__tp) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (ctime, char *, (time_t const *__tp)); +# else +_GL_CXXALIAS_SYS (ctime, char *, (time_t const *__tp)); +# endif +_GL_CXXALIASWARN (ctime); +# endif + +/* Convert *TP to a date and time string. See + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html>. */ +# if @GNULIB_STRFTIME@ +# if @REPLACE_STRFTIME@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define strftime rpl_strftime +# endif +_GL_FUNCDECL_RPL (strftime, size_t, (char *__buf, size_t __bufsize, + const char *__fmt, const struct tm *__tp) + _GL_ARG_NONNULL ((1, 3, 4))); +_GL_CXXALIAS_RPL (strftime, size_t, (char *__buf, size_t __bufsize, + const char *__fmt, const struct tm *__tp)); +# else +_GL_CXXALIAS_SYS (strftime, size_t, (char *__buf, size_t __bufsize, + const char *__fmt, const struct tm *__tp)); +# endif +_GL_CXXALIASWARN (strftime); +# endif + +# if defined _GNU_SOURCE && @GNULIB_TIME_RZ@ && ! @HAVE_TIMEZONE_T@ +typedef struct tm_zone *timezone_t; +_GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name)); +_GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name)); +_GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz)); +_GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz)); +_GL_FUNCDECL_SYS (localtime_rz, struct tm *, + (timezone_t __tz, time_t const *restrict __timer, + struct tm *restrict __result) _GL_ARG_NONNULL ((2, 3))); +_GL_CXXALIAS_SYS (localtime_rz, struct tm *, + (timezone_t __tz, time_t const *restrict __timer, + struct tm *restrict __result)); +_GL_FUNCDECL_SYS (mktime_z, time_t, + (timezone_t __tz, struct tm *restrict __result) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_SYS (mktime_z, time_t, + (timezone_t __tz, struct tm *restrict __result)); +# endif + +/* Convert TM to a time_t value, assuming UTC. */ +# if @GNULIB_TIMEGM@ +# if @REPLACE_TIMEGM@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef timegm +# define timegm rpl_timegm +# endif +_GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm)); +# else +# if ! @HAVE_TIMEGM@ +_GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm)); +# endif +_GL_CXXALIASWARN (timegm); +# endif + +/* Encourage applications to avoid unsafe functions that can overrun + buffers when given outlandish struct tm values. Portable + applications should use strftime (or even sprintf) instead. */ +# if defined GNULIB_POSIXCHECK +# undef asctime +_GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - " + "better use strftime (or even sprintf) instead"); +# endif +# if defined GNULIB_POSIXCHECK +# undef asctime_r +_GL_WARN_ON_USE (asctime, "asctime_r can overrun buffers in some cases - " + "better use strftime (or even sprintf) instead"); +# endif +# if defined GNULIB_POSIXCHECK +# undef ctime +_GL_WARN_ON_USE (asctime, "ctime can overrun buffers in some cases - " + "better use strftime (or even sprintf) instead"); +# endif +# if defined GNULIB_POSIXCHECK +# undef ctime_r +_GL_WARN_ON_USE (asctime, "ctime_r can overrun buffers in some cases - " + "better use strftime (or even sprintf) instead"); +# endif + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/time_r.c b/local/recipes/tools/diffutils/source/lib/time_r.c new file mode 100644 index 0000000000..708a98b324 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/time_r.c @@ -0,0 +1,44 @@ +/* Reentrant time functions like localtime_r. + + Copyright (C) 2003, 2006-2007, 2010-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +#include <config.h> + +#include <time.h> + +static struct tm * +copy_tm_result (struct tm *dest, struct tm const *src) +{ + if (! src) + return 0; + *dest = *src; + return dest; +} + + +struct tm * +gmtime_r (time_t const * restrict t, struct tm * restrict tp) +{ + return copy_tm_result (tp, gmtime (t)); +} + +struct tm * +localtime_r (time_t const * restrict t, struct tm * restrict tp) +{ + return copy_tm_result (tp, localtime (t)); +} diff --git a/local/recipes/tools/diffutils/source/lib/time_rz.c b/local/recipes/tools/diffutils/source/lib/time_rz.c new file mode 100644 index 0000000000..17bc11c20e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/time_rz.c @@ -0,0 +1,329 @@ +/* Time zone functions such as tzalloc and localtime_rz + + Copyright 2015-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +/* Although this module is not thread-safe, any races should be fairly + rare and reasonably benign. For complete thread-safety, use a C + library with a working timezone_t type, so that this module is not + needed. */ + +#include <config.h> + +#include <time.h> + +#include <errno.h> +#include <limits.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdlib.h> +#include <string.h> + +#include "flexmember.h" +#include "time-internal.h" + +#ifndef SIZE_MAX +# define SIZE_MAX ((size_t) -1) +#endif + +/* The approximate size to use for small allocation requests. This is + the largest "small" request for the GNU C library malloc. */ +enum { DEFAULT_MXFAST = 64 * sizeof (size_t) / 4 }; + +/* Minimum size of the ABBRS member of struct tm_zone. ABBRS is larger + only in the unlikely case where an abbreviation longer than this is + used. */ +enum { ABBR_SIZE_MIN = DEFAULT_MXFAST - offsetof (struct tm_zone, abbrs) }; + +/* Magic cookie timezone_t value, for local time. It differs from + NULL and from all other timezone_t values. Only the address + matters; the pointer is never dereferenced. */ +static timezone_t const local_tz = (timezone_t) 1; + +#if HAVE_TM_ZONE || HAVE_TZNAME + +/* Return true if the values A and B differ according to the rules for + tm_isdst: A and B differ if one is zero and the other positive. */ +static bool +isdst_differ (int a, int b) +{ + return !a != !b && 0 <= a && 0 <= b; +} + +/* Return true if A and B are equal. */ +static int +equal_tm (const struct tm *a, const struct tm *b) +{ + return ! ((a->tm_sec ^ b->tm_sec) + | (a->tm_min ^ b->tm_min) + | (a->tm_hour ^ b->tm_hour) + | (a->tm_mday ^ b->tm_mday) + | (a->tm_mon ^ b->tm_mon) + | (a->tm_year ^ b->tm_year) + | isdst_differ (a->tm_isdst, b->tm_isdst)); +} + +#endif + +/* Copy to ABBRS the abbreviation at ABBR with size ABBR_SIZE (this + includes its trailing null byte). Append an extra null byte to + mark the end of ABBRS. */ +static void +extend_abbrs (char *abbrs, char const *abbr, size_t abbr_size) +{ + memcpy (abbrs, abbr, abbr_size); + abbrs[abbr_size] = '\0'; +} + +/* Return a newly allocated time zone for NAME, or NULL on failure. + A null NAME stands for wall clock time (which is like unset TZ). */ +timezone_t +tzalloc (char const *name) +{ + size_t name_size = name ? strlen (name) + 1 : 0; + size_t abbr_size = name_size < ABBR_SIZE_MIN ? ABBR_SIZE_MIN : name_size + 1; + timezone_t tz = malloc (FLEXSIZEOF (struct tm_zone, abbrs, abbr_size)); + if (tz) + { + tz->next = NULL; +#if HAVE_TZNAME && !HAVE_TM_ZONE + tz->tzname_copy[0] = tz->tzname_copy[1] = NULL; +#endif + tz->tz_is_set = !!name; + tz->abbrs[0] = '\0'; + if (name) + extend_abbrs (tz->abbrs, name, name_size); + } + return tz; +} + +/* Save into TZ any nontrivial time zone abbreviation used by TM, and + update *TM (if HAVE_TM_ZONE) or *TZ (if !HAVE_TM_ZONE && + HAVE_TZNAME) if they use the abbreviation. Return true if + successful, false (setting errno) otherwise. */ +static bool +save_abbr (timezone_t tz, struct tm *tm) +{ +#if HAVE_TM_ZONE || HAVE_TZNAME + char const *zone = NULL; + char *zone_copy = (char *) ""; + +# if HAVE_TZNAME + int tzname_index = -1; +# endif + +# if HAVE_TM_ZONE + zone = tm->tm_zone; +# endif + +# if HAVE_TZNAME + if (! (zone && *zone) && 0 <= tm->tm_isdst) + { + tzname_index = tm->tm_isdst != 0; + zone = tzname[tzname_index]; + } +# endif + + /* No need to replace null zones, or zones within the struct tm. */ + if (!zone || ((char *) tm <= zone && zone < (char *) (tm + 1))) + return true; + + if (*zone) + { + zone_copy = tz->abbrs; + + while (strcmp (zone_copy, zone) != 0) + { + if (! (*zone_copy || (zone_copy == tz->abbrs && tz->tz_is_set))) + { + size_t zone_size = strlen (zone) + 1; + size_t zone_used = zone_copy - tz->abbrs; + if (SIZE_MAX - zone_used < zone_size) + { + errno = ENOMEM; + return false; + } + if (zone_used + zone_size < ABBR_SIZE_MIN) + extend_abbrs (zone_copy, zone, zone_size); + else + { + tz = tz->next = tzalloc (zone); + if (!tz) + return false; + tz->tz_is_set = 0; + zone_copy = tz->abbrs; + } + break; + } + + zone_copy += strlen (zone_copy) + 1; + if (!*zone_copy && tz->next) + { + tz = tz->next; + zone_copy = tz->abbrs; + } + } + } + + /* Replace the zone name so that its lifetime matches that of TZ. */ +# if HAVE_TM_ZONE + tm->tm_zone = zone_copy; +# else + if (0 <= tzname_index) + tz->tzname_copy[tzname_index] = zone_copy; +# endif +#endif + + return true; +} + +/* Free a time zone. */ +void +tzfree (timezone_t tz) +{ + if (tz != local_tz) + while (tz) + { + timezone_t next = tz->next; + free (tz); + tz = next; + } +} + +/* Get and set the TZ environment variable. These functions can be + overridden by programs like Emacs that manage their own environment. */ + +#ifndef getenv_TZ +static char * +getenv_TZ (void) +{ + return getenv ("TZ"); +} +#endif + +#ifndef setenv_TZ +static int +setenv_TZ (char const *tz) +{ + return tz ? setenv ("TZ", tz, 1) : unsetenv ("TZ"); +} +#endif + +/* Change the environment to match the specified timezone_t value. + Return true if successful, false (setting errno) otherwise. */ +static bool +change_env (timezone_t tz) +{ + if (setenv_TZ (tz->tz_is_set ? tz->abbrs : NULL) != 0) + return false; + tzset (); + return true; +} + +/* Temporarily set the time zone to TZ, which must not be null. + Return LOCAL_TZ if the time zone setting is already correct. + Otherwise return a newly allocated time zone representing the old + setting, or NULL (setting errno) on failure. */ +static timezone_t +set_tz (timezone_t tz) +{ + char *env_tz = getenv_TZ (); + if (env_tz + ? tz->tz_is_set && strcmp (tz->abbrs, env_tz) == 0 + : !tz->tz_is_set) + return local_tz; + else + { + timezone_t old_tz = tzalloc (env_tz); + if (!old_tz) + return old_tz; + if (! change_env (tz)) + { + int saved_errno = errno; + tzfree (old_tz); + errno = saved_errno; + return NULL; + } + return old_tz; + } +} + +/* Restore an old setting returned by set_tz. It must not be null. + Return true (preserving errno) if successful, false (setting errno) + otherwise. */ +static bool +revert_tz (timezone_t tz) +{ + if (tz == local_tz) + return true; + else + { + int saved_errno = errno; + bool ok = change_env (tz); + if (!ok) + saved_errno = errno; + tzfree (tz); + errno = saved_errno; + return ok; + } +} + +/* Use time zone TZ to compute localtime_r (T, TM). */ +struct tm * +localtime_rz (timezone_t tz, time_t const *t, struct tm *tm) +{ + if (!tz) + return gmtime_r (t, tm); + else + { + timezone_t old_tz = set_tz (tz); + if (old_tz) + { + bool abbr_saved = localtime_r (t, tm) && save_abbr (tz, tm); + if (revert_tz (old_tz) && abbr_saved) + return tm; + } + return NULL; + } +} + +/* Use time zone TZ to compute mktime (TM). */ +time_t +mktime_z (timezone_t tz, struct tm *tm) +{ + if (!tz) + return timegm (tm); + else + { + timezone_t old_tz = set_tz (tz); + if (old_tz) + { + time_t t = mktime (tm); +#if HAVE_TM_ZONE || HAVE_TZNAME + time_t badtime = -1; + struct tm tm_1; + if ((t != badtime + || (localtime_r (&t, &tm_1) && equal_tm (tm, &tm_1))) + && !save_abbr (tz, tm)) + t = badtime; +#endif + if (revert_tz (old_tz)) + return t; + } + return -1; + } +} diff --git a/local/recipes/tools/diffutils/source/lib/timegm.c b/local/recipes/tools/diffutils/source/lib/timegm.c new file mode 100644 index 0000000000..957a3b830c --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/timegm.c @@ -0,0 +1,40 @@ +/* Convert UTC calendar time to simple time. Like mktime but assumes UTC. + + Copyright (C) 1994, 1997, 2003-2004, 2006-2007, 2009-2017 Free Software + Foundation, Inc. This file is part of the GNU C Library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _LIBC +# include <config.h> +#endif + +#include <time.h> + +#ifdef _LIBC +typedef time_t mktime_offset_t; +#else +# undef __gmtime_r +# define __gmtime_r gmtime_r +# define __mktime_internal mktime_internal +# include "mktime-internal.h" +#endif + +time_t +timegm (struct tm *tmp) +{ + static mktime_offset_t gmtime_offset; + tmp->tm_isdst = 0; + return __mktime_internal (tmp, __gmtime_r, &gmtime_offset); +} diff --git a/local/recipes/tools/diffutils/source/lib/timespec.c b/local/recipes/tools/diffutils/source/lib/timespec.c new file mode 100644 index 0000000000..2b6098ed7b --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/timespec.c @@ -0,0 +1,3 @@ +#include <config.h> +#define _GL_TIMESPEC_INLINE _GL_EXTERN_INLINE +#include "timespec.h" diff --git a/local/recipes/tools/diffutils/source/lib/timespec.h b/local/recipes/tools/diffutils/source/lib/timespec.h new file mode 100644 index 0000000000..f5d823aefe --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/timespec.h @@ -0,0 +1,120 @@ +/* timespec -- System time interface + + Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2017 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#if ! defined TIMESPEC_H +# define TIMESPEC_H + +# include <time.h> + +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef _GL_TIMESPEC_INLINE +# define _GL_TIMESPEC_INLINE _GL_INLINE +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Resolution of timespec timestamps (in units per second), and log + base 10 of the resolution. */ + +enum { TIMESPEC_RESOLUTION = 1000000000 }; +enum { LOG10_TIMESPEC_RESOLUTION = 9 }; + +/* Return a timespec with seconds S and nanoseconds NS. */ + +_GL_TIMESPEC_INLINE struct timespec +make_timespec (time_t s, long int ns) +{ + struct timespec r; + r.tv_sec = s; + r.tv_nsec = ns; + return r; +} + +/* Return negative, zero, positive if A < B, A == B, A > B, respectively. + + For each timestamp T, this code assumes that either: + + * T.tv_nsec is in the range 0..999999999; or + * T.tv_sec corresponds to a valid leap second on a host that supports + leap seconds, and T.tv_nsec is in the range 1000000000..1999999999; or + * T.tv_sec is the minimum time_t value and T.tv_nsec is -1; or + T.tv_sec is the maximum time_t value and T.tv_nsec is 2000000000. + This allows for special struct timespec values that are less or + greater than all possible valid timestamps. + + In all these cases, it is safe to subtract two tv_nsec values and + convert the result to integer without worrying about overflow on + any platform of interest to the GNU project, since all such + platforms have 32-bit int or wider. + + Replacing "(int) (a.tv_nsec - b.tv_nsec)" with something like + "a.tv_nsec < b.tv_nsec ? -1 : a.tv_nsec > b.tv_nsec" would cause + this function to work in some cases where the above assumption is + violated, but not in all cases (e.g., a.tv_sec==1, a.tv_nsec==-2, + b.tv_sec==0, b.tv_nsec==999999999) and is arguably not worth the + extra instructions. Using a subtraction has the advantage of + detecting some invalid cases on platforms that detect integer + overflow. + + The (int) cast avoids a gcc -Wconversion warning. */ + +_GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE +timespec_cmp (struct timespec a, struct timespec b) +{ + return (a.tv_sec < b.tv_sec ? -1 + : a.tv_sec > b.tv_sec ? 1 + : (int) (a.tv_nsec - b.tv_nsec)); +} + +/* Return -1, 0, 1, depending on the sign of A. A.tv_nsec must be + nonnegative. */ +_GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE +timespec_sign (struct timespec a) +{ + return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec; +} + +struct timespec timespec_add (struct timespec, struct timespec) + _GL_ATTRIBUTE_CONST; +struct timespec timespec_sub (struct timespec, struct timespec) + _GL_ATTRIBUTE_CONST; +struct timespec dtotimespec (double) + _GL_ATTRIBUTE_CONST; + +/* Return an approximation to A, of type 'double'. */ +_GL_TIMESPEC_INLINE double +timespectod (struct timespec a) +{ + return a.tv_sec + a.tv_nsec / 1e9; +} + +void gettime (struct timespec *); +int settime (struct timespec const *); + +#ifdef __cplusplus +} +#endif + +_GL_INLINE_HEADER_END + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/trim.c b/local/recipes/tools/diffutils/source/lib/trim.c new file mode 100644 index 0000000000..a4dca9fd2d --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/trim.c @@ -0,0 +1,129 @@ +/* Removes leading and/or trailing whitespaces + Copyright (C) 2006-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Davide Angelocola <davide.angelocola@gmail.com> */ + +#include <config.h> + +/* Specification. */ +#include "trim.h" + +#include <ctype.h> +#include <string.h> +#include <stddef.h> +#include <stdlib.h> + +#include "mbchar.h" +#include "mbiter.h" +#include "xalloc.h" + +/* Use this to suppress gcc's "...may be used before initialized" warnings. */ +#if defined GCC_LINT || defined lint +# define IF_LINT(Code) Code +#else +# define IF_LINT(Code) /* empty */ +#endif + +char * +trim2 (const char *s, int how) +{ + char *d; + + d = strdup (s); + + if (!d) + xalloc_die (); + + if (MB_CUR_MAX > 1) + { + mbi_iterator_t i; + + /* Trim leading whitespaces. */ + if (how != TRIM_TRAILING) + { + mbi_init (i, d, strlen (d)); + + for (; mbi_avail (i) && mb_isspace (mbi_cur (i)); mbi_advance (i)) + ; + + memmove (d, mbi_cur_ptr (i), strlen (mbi_cur_ptr (i)) + 1); + } + + /* Trim trailing whitespaces. */ + if (how != TRIM_LEADING) + { + unsigned int state = 0; + char *r IF_LINT (= NULL); /* used only while state = 2 */ + + mbi_init (i, d, strlen (d)); + + for (; mbi_avail (i); mbi_advance (i)) + { + if (state == 0 && mb_isspace (mbi_cur (i))) + continue; + + if (state == 0 && !mb_isspace (mbi_cur (i))) + { + state = 1; + continue; + } + + if (state == 1 && !mb_isspace (mbi_cur (i))) + continue; + + if (state == 1 && mb_isspace (mbi_cur (i))) + { + state = 2; + r = (char *) mbi_cur_ptr (i); + } + else if (state == 2 && mb_isspace (mbi_cur (i))) + { + /* empty */ + } + else + { + state = 1; + } + } + + if (state == 2) + *r = '\0'; + } + } + else + { + char *p; + + /* Trim leading whitespaces. */ + if (how != TRIM_TRAILING) + { + for (p = d; *p && isspace ((unsigned char) *p); p++) + ; + + memmove (d, p, strlen (p) + 1); + } + + /* Trim trailing whitespaces. */ + if (how != TRIM_LEADING) + { + for (p = d + strlen (d) - 1; + p >= d && isspace ((unsigned char) *p); p--) + *p = '\0'; + } + } + + return d; +} diff --git a/local/recipes/tools/diffutils/source/lib/trim.h b/local/recipes/tools/diffutils/source/lib/trim.h new file mode 100644 index 0000000000..ca081a8fca --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/trim.h @@ -0,0 +1,33 @@ +/* Removes leading and/or trailing whitespaces + Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Davide Angelocola <davide.angelocola@gmail.com> */ + +/* Trim mode. */ +#define TRIM_TRAILING 0 +#define TRIM_LEADING 1 +#define TRIM_BOTH 2 + +/* Removes trailing and leading whitespaces. */ +#define trim(s) trim2(s, TRIM_BOTH) + +/* Removes trailing whitespaces. */ +#define trim_trailing(s) trim2(s, TRIM_TRAILING) + +/* Removes leading whitespaces. */ +#define trim_leading(s) trim2(s, TRIM_LEADING) + +char *trim2 (const char *, int); diff --git a/local/recipes/tools/diffutils/source/lib/tzset.c b/local/recipes/tools/diffutils/source/lib/tzset.c new file mode 100644 index 0000000000..038a515555 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/tzset.c @@ -0,0 +1,83 @@ +/* Provide tzset for systems that don't have it or for which it's broken. + + Copyright (C) 2001-2003, 2005-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* written by Jim Meyering */ + +#include <config.h> + +/* Specification. */ +#include <time.h> + +#include "localtime-buffer.h" + +/* This is a wrapper for tzset, for systems on which tzset may clobber + the static buffer used for localtime's result. + Work around the bug in some systems whereby tzset clobbers the + static buffer that localtime uses for its return value. The + tzset function from Solaris 2.5, 2.5.1, and 2.6 has this problem. */ + +void +tzset (void) +#undef tzset +{ +#if TZSET_CLOBBERS_LOCALTIME + /* Save and restore the contents of the buffer used for localtime's + result around the call to tzset. */ + struct tm save = *localtime_buffer_addr; +#endif + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* Rectify the value of the environment variable TZ. + There are four possible kinds of such values: + - Traditional US time zone names, e.g. "PST8PDT". Syntax: see + <https://msdn.microsoft.com/en-us/library/90s5c885.aspx> + - Time zone names based on geography, that contain one or more + slashes, e.g. "Europe/Moscow". + - Time zone names based on geography, without slashes, e.g. + "Singapore". + - Time zone names that contain explicit DST rules. Syntax: see + <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03> + The Microsoft CRT understands only the first kind. It produces incorrect + results if the value of TZ is of the other kinds. + But in a Cygwin environment, /etc/profile.d/tzset.sh sets TZ to a value + of the second kind for most geographies, or of the first kind in a few + other geographies. If it is of the second kind, neutralize it. For the + Microsoft CRT, an absent or empty TZ means the time zone that the user + has set in the Windows Control Panel. + If the value of TZ is of the third or fourth kind -- Cygwin programs + understand these syntaxes as well --, it does not matter whether we + neutralize it or not, since these values occur only when a Cygwin user + has set TZ explicitly; this case is 1. rare and 2. under the user's + responsibility. */ + const char *tz = getenv ("TZ"); + if (tz != NULL && strchr (tz, '/') != NULL) + _putenv ("TZ="); + + /* On native Windows, tzset() is deprecated. Use _tzset() instead. See + https://msdn.microsoft.com/en-us/library/ms235451.aspx + https://msdn.microsoft.com/en-us/library/90s5c885.aspx */ + _tzset (); +#elif HAVE_TZSET + tzset (); +#else + /* Do nothing. Avoid infinite recursion. */ +#endif + +#if TZSET_CLOBBERS_LOCALTIME + *localtime_buffer_addr = save; +#endif +} diff --git a/local/recipes/tools/diffutils/source/lib/uinttostr.c b/local/recipes/tools/diffutils/source/lib/uinttostr.c new file mode 100644 index 0000000000..48fd98f21c --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/uinttostr.c @@ -0,0 +1,3 @@ +#define anytostr uinttostr +#define inttype unsigned int +#include "anytostr.c" diff --git a/local/recipes/tools/diffutils/source/lib/umaxtostr.c b/local/recipes/tools/diffutils/source/lib/umaxtostr.c new file mode 100644 index 0000000000..f95bfc3ee0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/umaxtostr.c @@ -0,0 +1,3 @@ +#define anytostr umaxtostr +#define inttype uintmax_t +#include "anytostr.c" diff --git a/local/recipes/tools/diffutils/source/lib/unistd.c b/local/recipes/tools/diffutils/source/lib/unistd.c new file mode 100644 index 0000000000..72bad1c052 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/unistd.c @@ -0,0 +1,4 @@ +#include <config.h> +#define _GL_UNISTD_INLINE _GL_EXTERN_INLINE +#include "unistd.h" +typedef int dummy; diff --git a/local/recipes/tools/diffutils/source/lib/unistd.in.h b/local/recipes/tools/diffutils/source/lib/unistd.in.h new file mode 100644 index 0000000000..f366caffa5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/unistd.in.h @@ -0,0 +1,1620 @@ +/* Substitute for and wrapper around <unistd.h>. + Copyright (C) 2003-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _@GUARD_PREFIX@_UNISTD_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#ifdef _GL_INCLUDING_UNISTD_H +/* Special invocation convention: + - On Mac OS X 10.3.9 we have a sequence of nested includes + <unistd.h> -> <signal.h> -> <pthread.h> -> <unistd.h> + In this situation, the functions are not yet declared, therefore we cannot + provide the C++ aliases. */ + +#@INCLUDE_NEXT@ @NEXT_UNISTD_H@ + +#else +/* Normal invocation convention. */ + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_UNISTD_H@ +# define _GL_INCLUDING_UNISTD_H +# @INCLUDE_NEXT@ @NEXT_UNISTD_H@ +# undef _GL_INCLUDING_UNISTD_H +#endif + +/* Get all possible declarations of gethostname(). */ +#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \ + && !defined _GL_INCLUDING_WINSOCK2_H +# define _GL_INCLUDING_WINSOCK2_H +# include <winsock2.h> +# undef _GL_INCLUDING_WINSOCK2_H +#endif + +#if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H +#define _@GUARD_PREFIX@_UNISTD_H + +/* NetBSD 5.0 mis-defines NULL. Also get size_t. */ +#include <stddef.h> + +/* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */ +/* MSVC declares 'unlink' in <stdio.h>, not in <unistd.h>. We must include + it before we #define unlink rpl_unlink. */ +/* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>. */ +/* But avoid namespace pollution on glibc systems. */ +#if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \ + || ((@GNULIB_UNLINK@ || defined GNULIB_POSIXCHECK) \ + && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) \ + || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \ + && defined __CYGWIN__)) \ + && ! defined __GLIBC__ +# include <stdio.h> +#endif + +/* Cygwin 1.7.1 declares unlinkat in <fcntl.h>, not in <unistd.h>. */ +/* But avoid namespace pollution on glibc systems. */ +#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && defined __CYGWIN__ \ + && ! defined __GLIBC__ +# include <fcntl.h> +#endif + +/* mingw fails to declare _exit in <unistd.h>. */ +/* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in + <unistd.h>. */ +/* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>. */ +/* OSF Tru64 Unix cannot see gnulib rpl_strtod when system <stdlib.h> is + included here. */ +/* But avoid namespace pollution on glibc systems. */ +#if !defined __GLIBC__ && !defined __osf__ +# define __need_system_stdlib_h +# include <stdlib.h> +# undef __need_system_stdlib_h +#endif + +/* Native Windows platforms declare chdir, getcwd, rmdir in + <io.h> and/or <direct.h>, not in <unistd.h>. + They also declare access(), chmod(), close(), dup(), dup2(), isatty(), + lseek(), read(), unlink(), write() in <io.h>. */ +#if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \ + || defined GNULIB_POSIXCHECK) \ + && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) +# include <io.h> /* mingw32, mingw64 */ +# include <direct.h> /* mingw64, MSVC 9 */ +#elif (@GNULIB_CLOSE@ || @GNULIB_DUP@ || @GNULIB_DUP2@ || @GNULIB_ISATTY@ \ + || @GNULIB_LSEEK@ || @GNULIB_READ@ || @GNULIB_UNLINK@ || @GNULIB_WRITE@ \ + || defined GNULIB_POSIXCHECK) \ + && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +# include <io.h> +#endif + +/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>. + NonStop Kernel declares gethostname in <netdb.h>, not in <unistd.h>. */ +/* But avoid namespace pollution on glibc systems. */ +#if ((@GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__)) \ + || (@GNULIB_GETHOSTNAME@ && defined __TANDEM)) \ + && !defined __GLIBC__ +# include <netdb.h> +#endif + +/* MSVC defines off_t in <sys/types.h>. + May also define off_t to a 64-bit type on native Windows. */ +#if !@HAVE_UNISTD_H@ || @WINDOWS_64_BIT_OFF_T@ +/* Get off_t. */ +# include <sys/types.h> +#endif + +#if (@GNULIB_READ@ || @GNULIB_WRITE@ \ + || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \ + || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK) +/* Get ssize_t. */ +# include <sys/types.h> +#endif + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + + +/* Get getopt(), optarg, optind, opterr, optopt. + But avoid namespace pollution on glibc systems. */ +#if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT +# include <getopt-cdefs.h> +# include <getopt-pfx-core.h> +#endif + +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef _GL_UNISTD_INLINE +# define _GL_UNISTD_INLINE _GL_INLINE +#endif + +/* Hide some function declarations from <winsock2.h>. */ + +#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ +# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef socket +# define socket socket_used_without_including_sys_socket_h +# undef connect +# define connect connect_used_without_including_sys_socket_h +# undef accept +# define accept accept_used_without_including_sys_socket_h +# undef bind +# define bind bind_used_without_including_sys_socket_h +# undef getpeername +# define getpeername getpeername_used_without_including_sys_socket_h +# undef getsockname +# define getsockname getsockname_used_without_including_sys_socket_h +# undef getsockopt +# define getsockopt getsockopt_used_without_including_sys_socket_h +# undef listen +# define listen listen_used_without_including_sys_socket_h +# undef recv +# define recv recv_used_without_including_sys_socket_h +# undef send +# define send send_used_without_including_sys_socket_h +# undef recvfrom +# define recvfrom recvfrom_used_without_including_sys_socket_h +# undef sendto +# define sendto sendto_used_without_including_sys_socket_h +# undef setsockopt +# define setsockopt setsockopt_used_without_including_sys_socket_h +# undef shutdown +# define shutdown shutdown_used_without_including_sys_socket_h +# else + _GL_WARN_ON_USE (socket, + "socket() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (connect, + "connect() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (accept, + "accept() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (bind, + "bind() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (getpeername, + "getpeername() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (getsockname, + "getsockname() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (getsockopt, + "getsockopt() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (listen, + "listen() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (recv, + "recv() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (send, + "send() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (recvfrom, + "recvfrom() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (sendto, + "sendto() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (setsockopt, + "setsockopt() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (shutdown, + "shutdown() used without including <sys/socket.h>"); +# endif +# endif +# if !defined _@GUARD_PREFIX@_SYS_SELECT_H +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef select +# define select select_used_without_including_sys_select_h +# else + _GL_WARN_ON_USE (select, + "select() used without including <sys/select.h>"); +# endif +# endif +#endif + + +/* OS/2 EMX lacks these macros. */ +#ifndef STDIN_FILENO +# define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +# define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +# define STDERR_FILENO 2 +#endif + +/* Ensure *_OK macros exist. */ +#ifndef F_OK +# define F_OK 0 +# define X_OK 1 +# define W_OK 2 +# define R_OK 4 +#endif + + +/* Declare overridden functions. */ + + +#if defined GNULIB_POSIXCHECK +/* The access() function is a security risk. */ +_GL_WARN_ON_USE (access, "the access function is a security risk - " + "use the gnulib module faccessat instead"); +#endif + + +#if @GNULIB_CHDIR@ +_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1))); +_GL_CXXALIASWARN (chdir); +#elif defined GNULIB_POSIXCHECK +# undef chdir +# if HAVE_RAW_DECL_CHDIR +_GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - " + "use gnulib module chdir for portability"); +# endif +#endif + + +#if @GNULIB_CHOWN@ +/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE + to GID (if GID is not -1). Follow symbolic links. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2008 specification + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html. */ +# if @REPLACE_CHOWN@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef chown +# define chown rpl_chown +# endif +_GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)); +# else +# if !@HAVE_CHOWN@ +_GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)); +# endif +_GL_CXXALIASWARN (chown); +#elif defined GNULIB_POSIXCHECK +# undef chown +# if HAVE_RAW_DECL_CHOWN +_GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and " + "doesn't treat a uid or gid of -1 on some systems - " + "use gnulib module chown for portability"); +# endif +#endif + + +#if @GNULIB_CLOSE@ +# if @REPLACE_CLOSE@ +/* Automatically included by modules that need a replacement for close. */ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef close +# define close rpl_close +# endif +_GL_FUNCDECL_RPL (close, int, (int fd)); +_GL_CXXALIAS_RPL (close, int, (int fd)); +# else +_GL_CXXALIAS_SYS (close, int, (int fd)); +# endif +_GL_CXXALIASWARN (close); +#elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +# undef close +# define close close_used_without_requesting_gnulib_module_close +#elif defined GNULIB_POSIXCHECK +# undef close +/* Assume close is always declared. */ +_GL_WARN_ON_USE (close, "close does not portably work on sockets - " + "use gnulib module close for portability"); +#endif + + +#if @GNULIB_DUP@ +# if @REPLACE_DUP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define dup rpl_dup +# endif +_GL_FUNCDECL_RPL (dup, int, (int oldfd)); +_GL_CXXALIAS_RPL (dup, int, (int oldfd)); +# else +_GL_CXXALIAS_SYS (dup, int, (int oldfd)); +# endif +_GL_CXXALIASWARN (dup); +#elif defined GNULIB_POSIXCHECK +# undef dup +# if HAVE_RAW_DECL_DUP +_GL_WARN_ON_USE (dup, "dup is unportable - " + "use gnulib module dup for portability"); +# endif +#endif + + +#if @GNULIB_DUP2@ +/* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if + NEWFD = OLDFD, otherwise close NEWFD first if it is open. + Return newfd if successful, otherwise -1 and errno set. + See the POSIX:2008 specification + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>. */ +# if @REPLACE_DUP2@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define dup2 rpl_dup2 +# endif +_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd)); +_GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd)); +# else +# if !@HAVE_DUP2@ +_GL_FUNCDECL_SYS (dup2, int, (int oldfd, int newfd)); +# endif +_GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd)); +# endif +_GL_CXXALIASWARN (dup2); +#elif defined GNULIB_POSIXCHECK +# undef dup2 +# if HAVE_RAW_DECL_DUP2 +_GL_WARN_ON_USE (dup2, "dup2 is unportable - " + "use gnulib module dup2 for portability"); +# endif +#endif + + +#if @GNULIB_DUP3@ +/* Copy the file descriptor OLDFD into file descriptor NEWFD, with the + specified flags. + The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>) + and O_TEXT, O_BINARY (defined in "binary-io.h"). + Close NEWFD first if it is open. + Return newfd if successful, otherwise -1 and errno set. + See the Linux man page at + <http://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */ +# if @HAVE_DUP3@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define dup3 rpl_dup3 +# endif +_GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags)); +_GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags)); +# else +_GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags)); +_GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags)); +# endif +_GL_CXXALIASWARN (dup3); +#elif defined GNULIB_POSIXCHECK +# undef dup3 +# if HAVE_RAW_DECL_DUP3 +_GL_WARN_ON_USE (dup3, "dup3 is unportable - " + "use gnulib module dup3 for portability"); +# endif +#endif + + +#if @GNULIB_ENVIRON@ +# if !@HAVE_DECL_ENVIRON@ +/* Set of environment variables and values. An array of strings of the form + "VARIABLE=VALUE", terminated with a NULL. */ +# if defined __APPLE__ && defined __MACH__ +# include <TargetConditionals.h> +# if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR +# define _GL_USE_CRT_EXTERNS +# endif +# endif +# ifdef _GL_USE_CRT_EXTERNS +# include <crt_externs.h> +# define environ (*_NSGetEnviron ()) +# else +# ifdef __cplusplus +extern "C" { +# endif +extern char **environ; +# ifdef __cplusplus +} +# endif +# endif +# endif +#elif defined GNULIB_POSIXCHECK +# if HAVE_RAW_DECL_ENVIRON +_GL_UNISTD_INLINE char *** +rpl_environ (void) +{ + return &environ; +} +_GL_WARN_ON_USE (rpl_environ, "environ is unportable - " + "use gnulib module environ for portability"); +# undef environ +# define environ (*rpl_environ ()) +# endif +#endif + + +#if @GNULIB_EUIDACCESS@ +/* Like access(), except that it uses the effective user id and group id of + the current process. */ +# if !@HAVE_EUIDACCESS@ +_GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode)); +_GL_CXXALIASWARN (euidaccess); +# if defined GNULIB_POSIXCHECK +/* Like access(), this function is a security risk. */ +_GL_WARN_ON_USE (euidaccess, "the euidaccess function is a security risk - " + "use the gnulib module faccessat instead"); +# endif +#elif defined GNULIB_POSIXCHECK +# undef euidaccess +# if HAVE_RAW_DECL_EUIDACCESS +_GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - " + "use gnulib module euidaccess for portability"); +# endif +#endif + + +#if @GNULIB_FACCESSAT@ +# if !@HAVE_FACCESSAT@ +_GL_FUNCDECL_SYS (faccessat, int, + (int fd, char const *file, int mode, int flag) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (faccessat, int, + (int fd, char const *file, int mode, int flag)); +_GL_CXXALIASWARN (faccessat); +#elif defined GNULIB_POSIXCHECK +# undef faccessat +# if HAVE_RAW_DECL_FACCESSAT +_GL_WARN_ON_USE (faccessat, "faccessat is not portable - " + "use gnulib module faccessat for portability"); +# endif +#endif + + +#if @GNULIB_FCHDIR@ +/* Change the process' current working directory to the directory on which + the given file descriptor is open. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2008 specification + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>. */ +# if ! @HAVE_FCHDIR@ +_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/)); + +/* Gnulib internal hooks needed to maintain the fchdir metadata. */ +_GL_EXTERN_C int _gl_register_fd (int fd, const char *filename) + _GL_ARG_NONNULL ((2)); +_GL_EXTERN_C void _gl_unregister_fd (int fd); +_GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd); +_GL_EXTERN_C const char *_gl_directory_name (int fd); + +# else +# if !@HAVE_DECL_FCHDIR@ +_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/)); +# endif +# endif +_GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/)); +_GL_CXXALIASWARN (fchdir); +#elif defined GNULIB_POSIXCHECK +# undef fchdir +# if HAVE_RAW_DECL_FCHDIR +_GL_WARN_ON_USE (fchdir, "fchdir is unportable - " + "use gnulib module fchdir for portability"); +# endif +#endif + + +#if @GNULIB_FCHOWNAT@ +# if @REPLACE_FCHOWNAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fchownat +# define fchownat rpl_fchownat +# endif +_GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file, + uid_t owner, gid_t group, int flag) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file, + uid_t owner, gid_t group, int flag)); +# else +# if !@HAVE_FCHOWNAT@ +_GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file, + uid_t owner, gid_t group, int flag) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file, + uid_t owner, gid_t group, int flag)); +# endif +_GL_CXXALIASWARN (fchownat); +#elif defined GNULIB_POSIXCHECK +# undef fchownat +# if HAVE_RAW_DECL_FCHOWNAT +_GL_WARN_ON_USE (fchownat, "fchownat is not portable - " + "use gnulib module openat for portability"); +# endif +#endif + + +#if @GNULIB_FDATASYNC@ +/* Synchronize changes to a file. + Return 0 if successful, otherwise -1 and errno set. + See POSIX:2008 specification + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>. */ +# if !@HAVE_FDATASYNC@ || !@HAVE_DECL_FDATASYNC@ +_GL_FUNCDECL_SYS (fdatasync, int, (int fd)); +# endif +_GL_CXXALIAS_SYS (fdatasync, int, (int fd)); +_GL_CXXALIASWARN (fdatasync); +#elif defined GNULIB_POSIXCHECK +# undef fdatasync +# if HAVE_RAW_DECL_FDATASYNC +_GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - " + "use gnulib module fdatasync for portability"); +# endif +#endif + + +#if @GNULIB_FSYNC@ +/* Synchronize changes, including metadata, to a file. + Return 0 if successful, otherwise -1 and errno set. + See POSIX:2008 specification + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>. */ +# if !@HAVE_FSYNC@ +_GL_FUNCDECL_SYS (fsync, int, (int fd)); +# endif +_GL_CXXALIAS_SYS (fsync, int, (int fd)); +_GL_CXXALIASWARN (fsync); +#elif defined GNULIB_POSIXCHECK +# undef fsync +# if HAVE_RAW_DECL_FSYNC +_GL_WARN_ON_USE (fsync, "fsync is unportable - " + "use gnulib module fsync for portability"); +# endif +#endif + + +#if @GNULIB_FTRUNCATE@ +/* Change the size of the file to which FD is opened to become equal to LENGTH. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2008 specification + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>. */ +# if @REPLACE_FTRUNCATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef ftruncate +# define ftruncate rpl_ftruncate +# endif +_GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length)); +_GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length)); +# else +# if !@HAVE_FTRUNCATE@ +_GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length)); +# endif +_GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length)); +# endif +_GL_CXXALIASWARN (ftruncate); +#elif defined GNULIB_POSIXCHECK +# undef ftruncate +# if HAVE_RAW_DECL_FTRUNCATE +_GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - " + "use gnulib module ftruncate for portability"); +# endif +#endif + + +#if @GNULIB_GETCWD@ +/* Get the name of the current working directory, and put it in SIZE bytes + of BUF. + Return BUF if successful, or NULL if the directory couldn't be determined + or SIZE was too small. + See the POSIX:2008 specification + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>. + Additionally, the gnulib module 'getcwd' guarantees the following GNU + extension: If BUF is NULL, an array is allocated with 'malloc'; the array + is SIZE bytes long, unless SIZE == 0, in which case it is as big as + necessary. */ +# if @REPLACE_GETCWD@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define getcwd rpl_getcwd +# endif +_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size)); +_GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size)); +# else +/* Need to cast, because on mingw, the second parameter is + int size. */ +_GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size)); +# endif +_GL_CXXALIASWARN (getcwd); +#elif defined GNULIB_POSIXCHECK +# undef getcwd +# if HAVE_RAW_DECL_GETCWD +_GL_WARN_ON_USE (getcwd, "getcwd is unportable - " + "use gnulib module getcwd for portability"); +# endif +#endif + + +#if @GNULIB_GETDOMAINNAME@ +/* Return the NIS domain name of the machine. + WARNING! The NIS domain name is unrelated to the fully qualified host name + of the machine. It is also unrelated to email addresses. + WARNING! The NIS domain name is usually the empty string or "(none)" when + not using NIS. + + Put up to LEN bytes of the NIS domain name into NAME. + Null terminate it if the name is shorter than LEN. + If the NIS domain name is longer than LEN, set errno = EINVAL and return -1. + Return 0 if successful, otherwise set errno and return -1. */ +# if @REPLACE_GETDOMAINNAME@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getdomainname +# define getdomainname rpl_getdomainname +# endif +_GL_FUNCDECL_RPL (getdomainname, int, (char *name, size_t len) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (getdomainname, int, (char *name, size_t len)); +# else +# if !@HAVE_DECL_GETDOMAINNAME@ +_GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len)); +# endif +_GL_CXXALIASWARN (getdomainname); +#elif defined GNULIB_POSIXCHECK +# undef getdomainname +# if HAVE_RAW_DECL_GETDOMAINNAME +_GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - " + "use gnulib module getdomainname for portability"); +# endif +#endif + + +#if @GNULIB_GETDTABLESIZE@ +/* Return the maximum number of file descriptors in the current process. + In POSIX, this is same as sysconf (_SC_OPEN_MAX). */ +# if @REPLACE_GETDTABLESIZE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getdtablesize +# define getdtablesize rpl_getdtablesize +# endif +_GL_FUNCDECL_RPL (getdtablesize, int, (void)); +_GL_CXXALIAS_RPL (getdtablesize, int, (void)); +# else +# if !@HAVE_GETDTABLESIZE@ +_GL_FUNCDECL_SYS (getdtablesize, int, (void)); +# endif +_GL_CXXALIAS_SYS (getdtablesize, int, (void)); +# endif +_GL_CXXALIASWARN (getdtablesize); +#elif defined GNULIB_POSIXCHECK +# undef getdtablesize +# if HAVE_RAW_DECL_GETDTABLESIZE +_GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - " + "use gnulib module getdtablesize for portability"); +# endif +#endif + + +#if @GNULIB_GETGROUPS@ +/* Return the supplemental groups that the current process belongs to. + It is unspecified whether the effective group id is in the list. + If N is 0, return the group count; otherwise, N describes how many + entries are available in GROUPS. Return -1 and set errno if N is + not 0 and not large enough. Fails with ENOSYS on some systems. */ +# if @REPLACE_GETGROUPS@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getgroups +# define getgroups rpl_getgroups +# endif +_GL_FUNCDECL_RPL (getgroups, int, (int n, gid_t *groups)); +_GL_CXXALIAS_RPL (getgroups, int, (int n, gid_t *groups)); +# else +# if !@HAVE_GETGROUPS@ +_GL_FUNCDECL_SYS (getgroups, int, (int n, gid_t *groups)); +# endif +_GL_CXXALIAS_SYS (getgroups, int, (int n, gid_t *groups)); +# endif +_GL_CXXALIASWARN (getgroups); +#elif defined GNULIB_POSIXCHECK +# undef getgroups +# if HAVE_RAW_DECL_GETGROUPS +_GL_WARN_ON_USE (getgroups, "getgroups is unportable - " + "use gnulib module getgroups for portability"); +# endif +#endif + + +#if @GNULIB_GETHOSTNAME@ +/* Return the standard host name of the machine. + WARNING! The host name may or may not be fully qualified. + + Put up to LEN bytes of the host name into NAME. + Null terminate it if the name is shorter than LEN. + If the host name is longer than LEN, set errno = EINVAL and return -1. + Return 0 if successful, otherwise set errno and return -1. */ +# if @UNISTD_H_HAVE_WINSOCK2_H@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef gethostname +# define gethostname rpl_gethostname +# endif +_GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len)); +# else +# if !@HAVE_GETHOSTNAME@ +_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len) + _GL_ARG_NONNULL ((1))); +# endif +/* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second + parameter is + int len. */ +_GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len)); +# endif +_GL_CXXALIASWARN (gethostname); +#elif @UNISTD_H_HAVE_WINSOCK2_H@ +# undef gethostname +# define gethostname gethostname_used_without_requesting_gnulib_module_gethostname +#elif defined GNULIB_POSIXCHECK +# undef gethostname +# if HAVE_RAW_DECL_GETHOSTNAME +_GL_WARN_ON_USE (gethostname, "gethostname is unportable - " + "use gnulib module gethostname for portability"); +# endif +#endif + + +#if @GNULIB_GETLOGIN@ +/* Returns the user's login name, or NULL if it cannot be found. Upon error, + returns NULL with errno set. + + See <http://www.opengroup.org/susv3xsh/getlogin.html>. + + Most programs don't need to use this function, because the information is + available through environment variables: + ${LOGNAME-$USER} on Unix platforms, + $USERNAME on native Windows platforms. + */ +# if !@HAVE_DECL_GETLOGIN@ +_GL_FUNCDECL_SYS (getlogin, char *, (void)); +# endif +_GL_CXXALIAS_SYS (getlogin, char *, (void)); +_GL_CXXALIASWARN (getlogin); +#elif defined GNULIB_POSIXCHECK +# undef getlogin +# if HAVE_RAW_DECL_GETLOGIN +_GL_WARN_ON_USE (getlogin, "getlogin is unportable - " + "use gnulib module getlogin for portability"); +# endif +#endif + + +#if @GNULIB_GETLOGIN_R@ +/* Copies the user's login name to NAME. + The array pointed to by NAME has room for SIZE bytes. + + Returns 0 if successful. Upon error, an error number is returned, or -1 in + the case that the login name cannot be found but no specific error is + provided (this case is hopefully rare but is left open by the POSIX spec). + + See <http://www.opengroup.org/susv3xsh/getlogin.html>. + + Most programs don't need to use this function, because the information is + available through environment variables: + ${LOGNAME-$USER} on Unix platforms, + $USERNAME on native Windows platforms. + */ +# if @REPLACE_GETLOGIN_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define getlogin_r rpl_getlogin_r +# endif +_GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size)); +# else +# if !@HAVE_DECL_GETLOGIN_R@ +_GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size) + _GL_ARG_NONNULL ((1))); +# endif +/* Need to cast, because on Solaris 10 systems, the second argument is + int size. */ +_GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size)); +# endif +_GL_CXXALIASWARN (getlogin_r); +#elif defined GNULIB_POSIXCHECK +# undef getlogin_r +# if HAVE_RAW_DECL_GETLOGIN_R +_GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - " + "use gnulib module getlogin_r for portability"); +# endif +#endif + + +#if @GNULIB_GETPAGESIZE@ +# if @REPLACE_GETPAGESIZE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define getpagesize rpl_getpagesize +# endif +_GL_FUNCDECL_RPL (getpagesize, int, (void)); +_GL_CXXALIAS_RPL (getpagesize, int, (void)); +# else +# if !@HAVE_GETPAGESIZE@ +# if !defined getpagesize +/* This is for POSIX systems. */ +# if !defined _gl_getpagesize && defined _SC_PAGESIZE +# if ! (defined __VMS && __VMS_VER < 70000000) +# define _gl_getpagesize() sysconf (_SC_PAGESIZE) +# endif +# endif +/* This is for older VMS. */ +# if !defined _gl_getpagesize && defined __VMS +# ifdef __ALPHA +# define _gl_getpagesize() 8192 +# else +# define _gl_getpagesize() 512 +# endif +# endif +/* This is for BeOS. */ +# if !defined _gl_getpagesize && @HAVE_OS_H@ +# include <OS.h> +# if defined B_PAGE_SIZE +# define _gl_getpagesize() B_PAGE_SIZE +# endif +# endif +/* This is for AmigaOS4.0. */ +# if !defined _gl_getpagesize && defined __amigaos4__ +# define _gl_getpagesize() 2048 +# endif +/* This is for older Unix systems. */ +# if !defined _gl_getpagesize && @HAVE_SYS_PARAM_H@ +# include <sys/param.h> +# ifdef EXEC_PAGESIZE +# define _gl_getpagesize() EXEC_PAGESIZE +# else +# ifdef NBPG +# ifndef CLSIZE +# define CLSIZE 1 +# endif +# define _gl_getpagesize() (NBPG * CLSIZE) +# else +# ifdef NBPC +# define _gl_getpagesize() NBPC +# endif +# endif +# endif +# endif +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define getpagesize() _gl_getpagesize () +# else +# if !GNULIB_defined_getpagesize_function +_GL_UNISTD_INLINE int +getpagesize () +{ + return _gl_getpagesize (); +} +# define GNULIB_defined_getpagesize_function 1 +# endif +# endif +# endif +# endif +/* Need to cast, because on Cygwin 1.5.x systems, the return type is size_t. */ +_GL_CXXALIAS_SYS_CAST (getpagesize, int, (void)); +# endif +# if @HAVE_DECL_GETPAGESIZE@ +_GL_CXXALIASWARN (getpagesize); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getpagesize +# if HAVE_RAW_DECL_GETPAGESIZE +_GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - " + "use gnulib module getpagesize for portability"); +# endif +#endif + + +#if @GNULIB_GETUSERSHELL@ +/* Return the next valid login shell on the system, or NULL when the end of + the list has been reached. */ +# if !@HAVE_DECL_GETUSERSHELL@ +_GL_FUNCDECL_SYS (getusershell, char *, (void)); +# endif +_GL_CXXALIAS_SYS (getusershell, char *, (void)); +_GL_CXXALIASWARN (getusershell); +#elif defined GNULIB_POSIXCHECK +# undef getusershell +# if HAVE_RAW_DECL_GETUSERSHELL +_GL_WARN_ON_USE (getusershell, "getusershell is unportable - " + "use gnulib module getusershell for portability"); +# endif +#endif + +#if @GNULIB_GETUSERSHELL@ +/* Rewind to pointer that is advanced at each getusershell() call. */ +# if !@HAVE_DECL_GETUSERSHELL@ +_GL_FUNCDECL_SYS (setusershell, void, (void)); +# endif +_GL_CXXALIAS_SYS (setusershell, void, (void)); +_GL_CXXALIASWARN (setusershell); +#elif defined GNULIB_POSIXCHECK +# undef setusershell +# if HAVE_RAW_DECL_SETUSERSHELL +_GL_WARN_ON_USE (setusershell, "setusershell is unportable - " + "use gnulib module getusershell for portability"); +# endif +#endif + +#if @GNULIB_GETUSERSHELL@ +/* Free the pointer that is advanced at each getusershell() call and + associated resources. */ +# if !@HAVE_DECL_GETUSERSHELL@ +_GL_FUNCDECL_SYS (endusershell, void, (void)); +# endif +_GL_CXXALIAS_SYS (endusershell, void, (void)); +_GL_CXXALIASWARN (endusershell); +#elif defined GNULIB_POSIXCHECK +# undef endusershell +# if HAVE_RAW_DECL_ENDUSERSHELL +_GL_WARN_ON_USE (endusershell, "endusershell is unportable - " + "use gnulib module getusershell for portability"); +# endif +#endif + + +#if @GNULIB_GROUP_MEMBER@ +/* Determine whether group id is in calling user's group list. */ +# if !@HAVE_GROUP_MEMBER@ +_GL_FUNCDECL_SYS (group_member, int, (gid_t gid)); +# endif +_GL_CXXALIAS_SYS (group_member, int, (gid_t gid)); +_GL_CXXALIASWARN (group_member); +#elif defined GNULIB_POSIXCHECK +# undef group_member +# if HAVE_RAW_DECL_GROUP_MEMBER +_GL_WARN_ON_USE (group_member, "group_member is unportable - " + "use gnulib module group-member for portability"); +# endif +#endif + + +#if @GNULIB_ISATTY@ +# if @REPLACE_ISATTY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef isatty +# define isatty rpl_isatty +# endif +_GL_FUNCDECL_RPL (isatty, int, (int fd)); +_GL_CXXALIAS_RPL (isatty, int, (int fd)); +# else +_GL_CXXALIAS_SYS (isatty, int, (int fd)); +# endif +_GL_CXXALIASWARN (isatty); +#elif defined GNULIB_POSIXCHECK +# undef isatty +# if HAVE_RAW_DECL_ISATTY +_GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - " + "use gnulib module isatty for portability"); +# endif +#endif + + +#if @GNULIB_LCHOWN@ +/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE + to GID (if GID is not -1). Do not follow symbolic links. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2008 specification + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html>. */ +# if @REPLACE_LCHOWN@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef lchown +# define lchown rpl_lchown +# endif +_GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group)); +# else +# if !@HAVE_LCHOWN@ +_GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)); +# endif +_GL_CXXALIASWARN (lchown); +#elif defined GNULIB_POSIXCHECK +# undef lchown +# if HAVE_RAW_DECL_LCHOWN +_GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - " + "use gnulib module lchown for portability"); +# endif +#endif + + +#if @GNULIB_LINK@ +/* Create a new hard link for an existing file. + Return 0 if successful, otherwise -1 and errno set. + See POSIX:2008 specification + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html>. */ +# if @REPLACE_LINK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define link rpl_link +# endif +_GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2)); +# else +# if !@HAVE_LINK@ +_GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2)); +# endif +_GL_CXXALIASWARN (link); +#elif defined GNULIB_POSIXCHECK +# undef link +# if HAVE_RAW_DECL_LINK +_GL_WARN_ON_USE (link, "link is unportable - " + "use gnulib module link for portability"); +# endif +#endif + + +#if @GNULIB_LINKAT@ +/* Create a new hard link for an existing file, relative to two + directories. FLAG controls whether symlinks are followed. + Return 0 if successful, otherwise -1 and errno set. */ +# if @REPLACE_LINKAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef linkat +# define linkat rpl_linkat +# endif +_GL_FUNCDECL_RPL (linkat, int, + (int fd1, const char *path1, int fd2, const char *path2, + int flag) + _GL_ARG_NONNULL ((2, 4))); +_GL_CXXALIAS_RPL (linkat, int, + (int fd1, const char *path1, int fd2, const char *path2, + int flag)); +# else +# if !@HAVE_LINKAT@ +_GL_FUNCDECL_SYS (linkat, int, + (int fd1, const char *path1, int fd2, const char *path2, + int flag) + _GL_ARG_NONNULL ((2, 4))); +# endif +_GL_CXXALIAS_SYS (linkat, int, + (int fd1, const char *path1, int fd2, const char *path2, + int flag)); +# endif +_GL_CXXALIASWARN (linkat); +#elif defined GNULIB_POSIXCHECK +# undef linkat +# if HAVE_RAW_DECL_LINKAT +_GL_WARN_ON_USE (linkat, "linkat is unportable - " + "use gnulib module linkat for portability"); +# endif +#endif + + +#if @GNULIB_LSEEK@ +/* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END. + Return the new offset if successful, otherwise -1 and errno set. + See the POSIX:2008 specification + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>. */ +# if @REPLACE_LSEEK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define lseek rpl_lseek +# endif +_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence)); +_GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence)); +# else +_GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence)); +# endif +_GL_CXXALIASWARN (lseek); +#elif defined GNULIB_POSIXCHECK +# undef lseek +# if HAVE_RAW_DECL_LSEEK +_GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some " + "systems - use gnulib module lseek for portability"); +# endif +#endif + + +#if @GNULIB_PIPE@ +/* Create a pipe, defaulting to O_BINARY mode. + Store the read-end as fd[0] and the write-end as fd[1]. + Return 0 upon success, or -1 with errno set upon failure. */ +# if !@HAVE_PIPE@ +_GL_FUNCDECL_SYS (pipe, int, (int fd[2]) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pipe, int, (int fd[2])); +_GL_CXXALIASWARN (pipe); +#elif defined GNULIB_POSIXCHECK +# undef pipe +# if HAVE_RAW_DECL_PIPE +_GL_WARN_ON_USE (pipe, "pipe is unportable - " + "use gnulib module pipe-posix for portability"); +# endif +#endif + + +#if @GNULIB_PIPE2@ +/* Create a pipe, applying the given flags when opening the read-end of the + pipe and the write-end of the pipe. + The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>) + and O_TEXT, O_BINARY (defined in "binary-io.h"). + Store the read-end as fd[0] and the write-end as fd[1]. + Return 0 upon success, or -1 with errno set upon failure. + See also the Linux man page at + <http://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */ +# if @HAVE_PIPE2@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define pipe2 rpl_pipe2 +# endif +_GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags)); +# else +_GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags)); +# endif +_GL_CXXALIASWARN (pipe2); +#elif defined GNULIB_POSIXCHECK +# undef pipe2 +# if HAVE_RAW_DECL_PIPE2 +_GL_WARN_ON_USE (pipe2, "pipe2 is unportable - " + "use gnulib module pipe2 for portability"); +# endif +#endif + + +#if @GNULIB_PREAD@ +/* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET. + Return the number of bytes placed into BUF if successful, otherwise + set errno and return -1. 0 indicates EOF. + See the POSIX:2008 specification + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html>. */ +# if @REPLACE_PREAD@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pread +# define pread rpl_pread +# endif +_GL_FUNCDECL_RPL (pread, ssize_t, + (int fd, void *buf, size_t bufsize, off_t offset) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (pread, ssize_t, + (int fd, void *buf, size_t bufsize, off_t offset)); +# else +# if !@HAVE_PREAD@ +_GL_FUNCDECL_SYS (pread, ssize_t, + (int fd, void *buf, size_t bufsize, off_t offset) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (pread, ssize_t, + (int fd, void *buf, size_t bufsize, off_t offset)); +# endif +_GL_CXXALIASWARN (pread); +#elif defined GNULIB_POSIXCHECK +# undef pread +# if HAVE_RAW_DECL_PREAD +_GL_WARN_ON_USE (pread, "pread is unportable - " + "use gnulib module pread for portability"); +# endif +#endif + + +#if @GNULIB_PWRITE@ +/* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET. + Return the number of bytes written if successful, otherwise + set errno and return -1. 0 indicates nothing written. See the + POSIX:2008 specification + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html>. */ +# if @REPLACE_PWRITE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pwrite +# define pwrite rpl_pwrite +# endif +_GL_FUNCDECL_RPL (pwrite, ssize_t, + (int fd, const void *buf, size_t bufsize, off_t offset) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (pwrite, ssize_t, + (int fd, const void *buf, size_t bufsize, off_t offset)); +# else +# if !@HAVE_PWRITE@ +_GL_FUNCDECL_SYS (pwrite, ssize_t, + (int fd, const void *buf, size_t bufsize, off_t offset) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (pwrite, ssize_t, + (int fd, const void *buf, size_t bufsize, off_t offset)); +# endif +_GL_CXXALIASWARN (pwrite); +#elif defined GNULIB_POSIXCHECK +# undef pwrite +# if HAVE_RAW_DECL_PWRITE +_GL_WARN_ON_USE (pwrite, "pwrite is unportable - " + "use gnulib module pwrite for portability"); +# endif +#endif + + +#if @GNULIB_READ@ +/* Read up to COUNT bytes from file descriptor FD into the buffer starting + at BUF. See the POSIX:2008 specification + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html>. */ +# if @REPLACE_READ@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef read +# define read rpl_read +# endif +_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count)); +# else +/* Need to cast, because on mingw, the third parameter is + unsigned int count + and the return type is 'int'. */ +_GL_CXXALIAS_SYS_CAST (read, ssize_t, (int fd, void *buf, size_t count)); +# endif +_GL_CXXALIASWARN (read); +#endif + + +#if @GNULIB_READLINK@ +/* Read the contents of the symbolic link FILE and place the first BUFSIZE + bytes of it into BUF. Return the number of bytes placed into BUF if + successful, otherwise -1 and errno set. + See the POSIX:2008 specification + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>. */ +# if @REPLACE_READLINK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define readlink rpl_readlink +# endif +_GL_FUNCDECL_RPL (readlink, ssize_t, + (const char *file, char *buf, size_t bufsize) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (readlink, ssize_t, + (const char *file, char *buf, size_t bufsize)); +# else +# if !@HAVE_READLINK@ +_GL_FUNCDECL_SYS (readlink, ssize_t, + (const char *file, char *buf, size_t bufsize) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (readlink, ssize_t, + (const char *file, char *buf, size_t bufsize)); +# endif +_GL_CXXALIASWARN (readlink); +#elif defined GNULIB_POSIXCHECK +# undef readlink +# if HAVE_RAW_DECL_READLINK +_GL_WARN_ON_USE (readlink, "readlink is unportable - " + "use gnulib module readlink for portability"); +# endif +#endif + + +#if @GNULIB_READLINKAT@ +# if @REPLACE_READLINKAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define readlinkat rpl_readlinkat +# endif +_GL_FUNCDECL_RPL (readlinkat, ssize_t, + (int fd, char const *file, char *buf, size_t len) + _GL_ARG_NONNULL ((2, 3))); +_GL_CXXALIAS_RPL (readlinkat, ssize_t, + (int fd, char const *file, char *buf, size_t len)); +# else +# if !@HAVE_READLINKAT@ +_GL_FUNCDECL_SYS (readlinkat, ssize_t, + (int fd, char const *file, char *buf, size_t len) + _GL_ARG_NONNULL ((2, 3))); +# endif +_GL_CXXALIAS_SYS (readlinkat, ssize_t, + (int fd, char const *file, char *buf, size_t len)); +# endif +_GL_CXXALIASWARN (readlinkat); +#elif defined GNULIB_POSIXCHECK +# undef readlinkat +# if HAVE_RAW_DECL_READLINKAT +_GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - " + "use gnulib module readlinkat for portability"); +# endif +#endif + + +#if @GNULIB_RMDIR@ +/* Remove the directory DIR. */ +# if @REPLACE_RMDIR@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define rmdir rpl_rmdir +# endif +_GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (rmdir, int, (char const *name)); +# else +_GL_CXXALIAS_SYS (rmdir, int, (char const *name)); +# endif +_GL_CXXALIASWARN (rmdir); +#elif defined GNULIB_POSIXCHECK +# undef rmdir +# if HAVE_RAW_DECL_RMDIR +_GL_WARN_ON_USE (rmdir, "rmdir is unportable - " + "use gnulib module rmdir for portability"); +# endif +#endif + + +#if @GNULIB_SETHOSTNAME@ +/* Set the host name of the machine. + The host name may or may not be fully qualified. + + Put LEN bytes of NAME into the host name. + Return 0 if successful, otherwise, set errno and return -1. + + Platforms with no ability to set the hostname return -1 and set + errno = ENOSYS. */ +# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@ +_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len) + _GL_ARG_NONNULL ((1))); +# endif +/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5 + and FreeBSD 6.4 the second parameter is int. On Solaris 11 + 2011-10, the first parameter is not const. */ +_GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len)); +_GL_CXXALIASWARN (sethostname); +#elif defined GNULIB_POSIXCHECK +# undef sethostname +# if HAVE_RAW_DECL_SETHOSTNAME +_GL_WARN_ON_USE (sethostname, "sethostname is unportable - " + "use gnulib module sethostname for portability"); +# endif +#endif + + +#if @GNULIB_SLEEP@ +/* Pause the execution of the current thread for N seconds. + Returns the number of seconds left to sleep. + See the POSIX:2008 specification + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html>. */ +# if @REPLACE_SLEEP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef sleep +# define sleep rpl_sleep +# endif +_GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n)); +_GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n)); +# else +# if !@HAVE_SLEEP@ +_GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n)); +# endif +_GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n)); +# endif +_GL_CXXALIASWARN (sleep); +#elif defined GNULIB_POSIXCHECK +# undef sleep +# if HAVE_RAW_DECL_SLEEP +_GL_WARN_ON_USE (sleep, "sleep is unportable - " + "use gnulib module sleep for portability"); +# endif +#endif + + +#if @GNULIB_SYMLINK@ +# if @REPLACE_SYMLINK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef symlink +# define symlink rpl_symlink +# endif +_GL_FUNCDECL_RPL (symlink, int, (char const *contents, char const *file) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (symlink, int, (char const *contents, char const *file)); +# else +# if !@HAVE_SYMLINK@ +_GL_FUNCDECL_SYS (symlink, int, (char const *contents, char const *file) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (symlink, int, (char const *contents, char const *file)); +# endif +_GL_CXXALIASWARN (symlink); +#elif defined GNULIB_POSIXCHECK +# undef symlink +# if HAVE_RAW_DECL_SYMLINK +_GL_WARN_ON_USE (symlink, "symlink is not portable - " + "use gnulib module symlink for portability"); +# endif +#endif + + +#if @GNULIB_SYMLINKAT@ +# if @REPLACE_SYMLINKAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef symlinkat +# define symlinkat rpl_symlinkat +# endif +_GL_FUNCDECL_RPL (symlinkat, int, + (char const *contents, int fd, char const *file) + _GL_ARG_NONNULL ((1, 3))); +_GL_CXXALIAS_RPL (symlinkat, int, + (char const *contents, int fd, char const *file)); +# else +# if !@HAVE_SYMLINKAT@ +_GL_FUNCDECL_SYS (symlinkat, int, + (char const *contents, int fd, char const *file) + _GL_ARG_NONNULL ((1, 3))); +# endif +_GL_CXXALIAS_SYS (symlinkat, int, + (char const *contents, int fd, char const *file)); +# endif +_GL_CXXALIASWARN (symlinkat); +#elif defined GNULIB_POSIXCHECK +# undef symlinkat +# if HAVE_RAW_DECL_SYMLINKAT +_GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - " + "use gnulib module symlinkat for portability"); +# endif +#endif + + +#if @GNULIB_TRUNCATE@ +/* Change the size of the file designated by FILENAME to become equal to LENGTH. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2008 specification + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html>. */ +# if @REPLACE_TRUNCATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef truncate +# define truncate rpl_truncate +# endif +_GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length)); +# else +# if !@HAVE_TRUNCATE@ +_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length)); +# endif +_GL_CXXALIASWARN (truncate); +#elif defined GNULIB_POSIXCHECK +# undef truncate +# if HAVE_RAW_DECL_TRUNCATE +_GL_WARN_ON_USE (truncate, "truncate is unportable - " + "use gnulib module truncate for portability"); +# endif +#endif + + +#if @GNULIB_TTYNAME_R@ +/* Store at most BUFLEN characters of the pathname of the terminal FD is + open on in BUF. Return 0 on success, otherwise an error number. */ +# if @REPLACE_TTYNAME_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef ttyname_r +# define ttyname_r rpl_ttyname_r +# endif +_GL_FUNCDECL_RPL (ttyname_r, int, + (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (ttyname_r, int, + (int fd, char *buf, size_t buflen)); +# else +# if !@HAVE_DECL_TTYNAME_R@ +_GL_FUNCDECL_SYS (ttyname_r, int, + (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (ttyname_r, int, + (int fd, char *buf, size_t buflen)); +# endif +_GL_CXXALIASWARN (ttyname_r); +#elif defined GNULIB_POSIXCHECK +# undef ttyname_r +# if HAVE_RAW_DECL_TTYNAME_R +_GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - " + "use gnulib module ttyname_r for portability"); +# endif +#endif + + +#if @GNULIB_UNLINK@ +# if @REPLACE_UNLINK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef unlink +# define unlink rpl_unlink +# endif +_GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (unlink, int, (char const *file)); +# else +_GL_CXXALIAS_SYS (unlink, int, (char const *file)); +# endif +_GL_CXXALIASWARN (unlink); +#elif defined GNULIB_POSIXCHECK +# undef unlink +# if HAVE_RAW_DECL_UNLINK +_GL_WARN_ON_USE (unlink, "unlink is not portable - " + "use gnulib module unlink for portability"); +# endif +#endif + + +#if @GNULIB_UNLINKAT@ +# if @REPLACE_UNLINKAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef unlinkat +# define unlinkat rpl_unlinkat +# endif +_GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag)); +# else +# if !@HAVE_UNLINKAT@ +_GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag)); +# endif +_GL_CXXALIASWARN (unlinkat); +#elif defined GNULIB_POSIXCHECK +# undef unlinkat +# if HAVE_RAW_DECL_UNLINKAT +_GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - " + "use gnulib module openat for portability"); +# endif +#endif + + +#if @GNULIB_USLEEP@ +/* Pause the execution of the current thread for N microseconds. + Returns 0 on completion, or -1 on range error. + See the POSIX:2001 specification + <http://www.opengroup.org/susv3xsh/usleep.html>. */ +# if @REPLACE_USLEEP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef usleep +# define usleep rpl_usleep +# endif +_GL_FUNCDECL_RPL (usleep, int, (useconds_t n)); +_GL_CXXALIAS_RPL (usleep, int, (useconds_t n)); +# else +# if !@HAVE_USLEEP@ +_GL_FUNCDECL_SYS (usleep, int, (useconds_t n)); +# endif +_GL_CXXALIAS_SYS (usleep, int, (useconds_t n)); +# endif +_GL_CXXALIASWARN (usleep); +#elif defined GNULIB_POSIXCHECK +# undef usleep +# if HAVE_RAW_DECL_USLEEP +_GL_WARN_ON_USE (usleep, "usleep is unportable - " + "use gnulib module usleep for portability"); +# endif +#endif + + +#if @GNULIB_WRITE@ +/* Write up to COUNT bytes starting at BUF to file descriptor FD. + See the POSIX:2008 specification + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>. */ +# if @REPLACE_WRITE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef write +# define write rpl_write +# endif +_GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count)); +# else +/* Need to cast, because on mingw, the third parameter is + unsigned int count + and the return type is 'int'. */ +_GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t count)); +# endif +_GL_CXXALIASWARN (write); +#endif + +_GL_INLINE_HEADER_END + +#endif /* _@GUARD_PREFIX@_UNISTD_H */ +#endif /* _GL_INCLUDING_UNISTD_H */ +#endif /* _@GUARD_PREFIX@_UNISTD_H */ diff --git a/local/recipes/tools/diffutils/source/lib/unistr.in.h b/local/recipes/tools/diffutils/source/lib/unistr.in.h new file mode 100644 index 0000000000..0f330af3f0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/unistr.in.h @@ -0,0 +1,746 @@ +/* Elementary Unicode string functions. + Copyright (C) 2001-2002, 2005-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _UNISTR_H +#define _UNISTR_H + +#include "unitypes.h" + +/* Get common macros for C. */ +#include "unused-parameter.h" + +/* Get bool. */ +#include <stdbool.h> + +/* Get size_t. */ +#include <stddef.h> + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Conventions: + + All functions prefixed with u8_ operate on UTF-8 encoded strings. + Their unit is an uint8_t (1 byte). + + All functions prefixed with u16_ operate on UTF-16 encoded strings. + Their unit is an uint16_t (a 2-byte word). + + All functions prefixed with u32_ operate on UCS-4 encoded strings. + Their unit is an uint32_t (a 4-byte word). + + All argument pairs (s, n) denote a Unicode string s[0..n-1] with exactly + n units. + + All arguments starting with "str" and the arguments of functions starting + with u8_str/u16_str/u32_str denote a NUL terminated string, i.e. a string + which terminates at the first NUL unit. This termination unit is + considered part of the string for all memory allocation purposes, but + is not considered part of the string for all other logical purposes. + + Functions returning a string result take a (resultbuf, lengthp) argument + pair. If resultbuf is not NULL and the result fits into *lengthp units, + it is put in resultbuf, and resultbuf is returned. Otherwise, a freshly + allocated string is returned. In both cases, *lengthp is set to the + length (number of units) of the returned string. In case of error, + NULL is returned and errno is set. */ + + +/* Elementary string checks. */ + +/* Check whether an UTF-8 string is well-formed. + Return NULL if valid, or a pointer to the first invalid unit otherwise. */ +extern const uint8_t * + u8_check (const uint8_t *s, size_t n) + _UC_ATTRIBUTE_PURE; + +/* Check whether an UTF-16 string is well-formed. + Return NULL if valid, or a pointer to the first invalid unit otherwise. */ +extern const uint16_t * + u16_check (const uint16_t *s, size_t n) + _UC_ATTRIBUTE_PURE; + +/* Check whether an UCS-4 string is well-formed. + Return NULL if valid, or a pointer to the first invalid unit otherwise. */ +extern const uint32_t * + u32_check (const uint32_t *s, size_t n) + _UC_ATTRIBUTE_PURE; + + +/* Elementary string conversions. */ + +/* Convert an UTF-8 string to an UTF-16 string. */ +extern uint16_t * + u8_to_u16 (const uint8_t *s, size_t n, uint16_t *resultbuf, + size_t *lengthp); + +/* Convert an UTF-8 string to an UCS-4 string. */ +extern uint32_t * + u8_to_u32 (const uint8_t *s, size_t n, uint32_t *resultbuf, + size_t *lengthp); + +/* Convert an UTF-16 string to an UTF-8 string. */ +extern uint8_t * + u16_to_u8 (const uint16_t *s, size_t n, uint8_t *resultbuf, + size_t *lengthp); + +/* Convert an UTF-16 string to an UCS-4 string. */ +extern uint32_t * + u16_to_u32 (const uint16_t *s, size_t n, uint32_t *resultbuf, + size_t *lengthp); + +/* Convert an UCS-4 string to an UTF-8 string. */ +extern uint8_t * + u32_to_u8 (const uint32_t *s, size_t n, uint8_t *resultbuf, + size_t *lengthp); + +/* Convert an UCS-4 string to an UTF-16 string. */ +extern uint16_t * + u32_to_u16 (const uint32_t *s, size_t n, uint16_t *resultbuf, + size_t *lengthp); + + +/* Elementary string functions. */ + +/* Return the length (number of units) of the first character in S, which is + no longer than N. Return 0 if it is the NUL character. Return -1 upon + failure. */ +/* Similar to mblen(), except that s must not be NULL. */ +extern int + u8_mblen (const uint8_t *s, size_t n) + _UC_ATTRIBUTE_PURE; +extern int + u16_mblen (const uint16_t *s, size_t n) + _UC_ATTRIBUTE_PURE; +extern int + u32_mblen (const uint32_t *s, size_t n) + _UC_ATTRIBUTE_PURE; + +/* Return the length (number of units) of the first character in S, putting + its 'ucs4_t' representation in *PUC. Upon failure, *PUC is set to 0xfffd, + and an appropriate number of units is returned. + The number of available units, N, must be > 0. */ +/* Similar to mbtowc(), except that puc and s must not be NULL, n must be > 0, + and the NUL character is not treated specially. */ +/* The variants with _safe suffix are safe, even if the library is compiled + without --enable-safety. */ + +#if GNULIB_UNISTR_U8_MBTOUC_UNSAFE || HAVE_LIBUNISTRING +# if !HAVE_INLINE +extern int + u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n); +# else +extern int + u8_mbtouc_unsafe_aux (ucs4_t *puc, const uint8_t *s, size_t n); +static inline int +u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n) +{ + uint8_t c = *s; + + if (c < 0x80) + { + *puc = c; + return 1; + } + else + return u8_mbtouc_unsafe_aux (puc, s, n); +} +# endif +#endif + +#if GNULIB_UNISTR_U16_MBTOUC_UNSAFE || HAVE_LIBUNISTRING +# if !HAVE_INLINE +extern int + u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n); +# else +extern int + u16_mbtouc_unsafe_aux (ucs4_t *puc, const uint16_t *s, size_t n); +static inline int +u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n) +{ + uint16_t c = *s; + + if (c < 0xd800 || c >= 0xe000) + { + *puc = c; + return 1; + } + else + return u16_mbtouc_unsafe_aux (puc, s, n); +} +# endif +#endif + +#if GNULIB_UNISTR_U32_MBTOUC_UNSAFE || HAVE_LIBUNISTRING +# if !HAVE_INLINE +extern int + u32_mbtouc_unsafe (ucs4_t *puc, const uint32_t *s, size_t n); +# else +static inline int +u32_mbtouc_unsafe (ucs4_t *puc, + const uint32_t *s, size_t n _GL_UNUSED_PARAMETER) +{ + uint32_t c = *s; + + if (c < 0xd800 || (c >= 0xe000 && c < 0x110000)) + *puc = c; + else + /* invalid multibyte character */ + *puc = 0xfffd; + return 1; +} +# endif +#endif + +#if GNULIB_UNISTR_U8_MBTOUC || HAVE_LIBUNISTRING +# if !HAVE_INLINE +extern int + u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n); +# else +extern int + u8_mbtouc_aux (ucs4_t *puc, const uint8_t *s, size_t n); +static inline int +u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n) +{ + uint8_t c = *s; + + if (c < 0x80) + { + *puc = c; + return 1; + } + else + return u8_mbtouc_aux (puc, s, n); +} +# endif +#endif + +#if GNULIB_UNISTR_U16_MBTOUC || HAVE_LIBUNISTRING +# if !HAVE_INLINE +extern int + u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n); +# else +extern int + u16_mbtouc_aux (ucs4_t *puc, const uint16_t *s, size_t n); +static inline int +u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n) +{ + uint16_t c = *s; + + if (c < 0xd800 || c >= 0xe000) + { + *puc = c; + return 1; + } + else + return u16_mbtouc_aux (puc, s, n); +} +# endif +#endif + +#if GNULIB_UNISTR_U32_MBTOUC || HAVE_LIBUNISTRING +# if !HAVE_INLINE +extern int + u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n); +# else +static inline int +u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n _GL_UNUSED_PARAMETER) +{ + uint32_t c = *s; + + if (c < 0xd800 || (c >= 0xe000 && c < 0x110000)) + *puc = c; + else + /* invalid multibyte character */ + *puc = 0xfffd; + return 1; +} +# endif +#endif + +/* Return the length (number of units) of the first character in S, putting + its 'ucs4_t' representation in *PUC. Upon failure, *PUC is set to 0xfffd, + and -1 is returned for an invalid sequence of units, -2 is returned for an + incomplete sequence of units. + The number of available units, N, must be > 0. */ +/* Similar to u*_mbtouc(), except that the return value gives more details + about the failure, similar to mbrtowc(). */ + +#if GNULIB_UNISTR_U8_MBTOUCR || HAVE_LIBUNISTRING +extern int + u8_mbtoucr (ucs4_t *puc, const uint8_t *s, size_t n); +#endif + +#if GNULIB_UNISTR_U16_MBTOUCR || HAVE_LIBUNISTRING +extern int + u16_mbtoucr (ucs4_t *puc, const uint16_t *s, size_t n); +#endif + +#if GNULIB_UNISTR_U32_MBTOUCR || HAVE_LIBUNISTRING +extern int + u32_mbtoucr (ucs4_t *puc, const uint32_t *s, size_t n); +#endif + +/* Put the multibyte character represented by UC in S, returning its + length. Return -1 upon failure, -2 if the number of available units, N, + is too small. The latter case cannot occur if N >= 6/2/1, respectively. */ +/* Similar to wctomb(), except that s must not be NULL, and the argument n + must be specified. */ + +#if GNULIB_UNISTR_U8_UCTOMB || HAVE_LIBUNISTRING +/* Auxiliary function, also used by u8_chr, u8_strchr, u8_strrchr. */ +extern int + u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n); +# if !HAVE_INLINE +extern int + u8_uctomb (uint8_t *s, ucs4_t uc, int n); +# else +static inline int +u8_uctomb (uint8_t *s, ucs4_t uc, int n) +{ + if (uc < 0x80 && n > 0) + { + s[0] = uc; + return 1; + } + else + return u8_uctomb_aux (s, uc, n); +} +# endif +#endif + +#if GNULIB_UNISTR_U16_UCTOMB || HAVE_LIBUNISTRING +/* Auxiliary function, also used by u16_chr, u16_strchr, u16_strrchr. */ +extern int + u16_uctomb_aux (uint16_t *s, ucs4_t uc, int n); +# if !HAVE_INLINE +extern int + u16_uctomb (uint16_t *s, ucs4_t uc, int n); +# else +static inline int +u16_uctomb (uint16_t *s, ucs4_t uc, int n) +{ + if (uc < 0xd800 && n > 0) + { + s[0] = uc; + return 1; + } + else + return u16_uctomb_aux (s, uc, n); +} +# endif +#endif + +#if GNULIB_UNISTR_U32_UCTOMB || HAVE_LIBUNISTRING +# if !HAVE_INLINE +extern int + u32_uctomb (uint32_t *s, ucs4_t uc, int n); +# else +static inline int +u32_uctomb (uint32_t *s, ucs4_t uc, int n) +{ + if (uc < 0xd800 || (uc >= 0xe000 && uc < 0x110000)) + { + if (n > 0) + { + *s = uc; + return 1; + } + else + return -2; + } + else + return -1; +} +# endif +#endif + +/* Copy N units from SRC to DEST. */ +/* Similar to memcpy(). */ +extern uint8_t * + u8_cpy (uint8_t *dest, const uint8_t *src, size_t n); +extern uint16_t * + u16_cpy (uint16_t *dest, const uint16_t *src, size_t n); +extern uint32_t * + u32_cpy (uint32_t *dest, const uint32_t *src, size_t n); + +/* Copy N units from SRC to DEST, guaranteeing correct behavior for + overlapping memory areas. */ +/* Similar to memmove(). */ +extern uint8_t * + u8_move (uint8_t *dest, const uint8_t *src, size_t n); +extern uint16_t * + u16_move (uint16_t *dest, const uint16_t *src, size_t n); +extern uint32_t * + u32_move (uint32_t *dest, const uint32_t *src, size_t n); + +/* Set the first N characters of S to UC. UC should be a character that + occupies only 1 unit. */ +/* Similar to memset(). */ +extern uint8_t * + u8_set (uint8_t *s, ucs4_t uc, size_t n); +extern uint16_t * + u16_set (uint16_t *s, ucs4_t uc, size_t n); +extern uint32_t * + u32_set (uint32_t *s, ucs4_t uc, size_t n); + +/* Compare S1 and S2, each of length N. */ +/* Similar to memcmp(). */ +extern int + u8_cmp (const uint8_t *s1, const uint8_t *s2, size_t n) + _UC_ATTRIBUTE_PURE; +extern int + u16_cmp (const uint16_t *s1, const uint16_t *s2, size_t n) + _UC_ATTRIBUTE_PURE; +extern int + u32_cmp (const uint32_t *s1, const uint32_t *s2, size_t n) + _UC_ATTRIBUTE_PURE; + +/* Compare S1 and S2. */ +/* Similar to the gnulib function memcmp2(). */ +extern int + u8_cmp2 (const uint8_t *s1, size_t n1, const uint8_t *s2, size_t n2) + _UC_ATTRIBUTE_PURE; +extern int + u16_cmp2 (const uint16_t *s1, size_t n1, const uint16_t *s2, size_t n2) + _UC_ATTRIBUTE_PURE; +extern int + u32_cmp2 (const uint32_t *s1, size_t n1, const uint32_t *s2, size_t n2) + _UC_ATTRIBUTE_PURE; + +/* Search the string at S for UC. */ +/* Similar to memchr(). */ +extern uint8_t * + u8_chr (const uint8_t *s, size_t n, ucs4_t uc) + _UC_ATTRIBUTE_PURE; +extern uint16_t * + u16_chr (const uint16_t *s, size_t n, ucs4_t uc) + _UC_ATTRIBUTE_PURE; +extern uint32_t * + u32_chr (const uint32_t *s, size_t n, ucs4_t uc) + _UC_ATTRIBUTE_PURE; + +/* Count the number of Unicode characters in the N units from S. */ +/* Similar to mbsnlen(). */ +extern size_t + u8_mbsnlen (const uint8_t *s, size_t n) + _UC_ATTRIBUTE_PURE; +extern size_t + u16_mbsnlen (const uint16_t *s, size_t n) + _UC_ATTRIBUTE_PURE; +extern size_t + u32_mbsnlen (const uint32_t *s, size_t n) + _UC_ATTRIBUTE_PURE; + +/* Elementary string functions with memory allocation. */ + +/* Make a freshly allocated copy of S, of length N. */ +extern uint8_t * + u8_cpy_alloc (const uint8_t *s, size_t n); +extern uint16_t * + u16_cpy_alloc (const uint16_t *s, size_t n); +extern uint32_t * + u32_cpy_alloc (const uint32_t *s, size_t n); + +/* Elementary string functions on NUL terminated strings. */ + +/* Return the length (number of units) of the first character in S. + Return 0 if it is the NUL character. Return -1 upon failure. */ +extern int + u8_strmblen (const uint8_t *s) + _UC_ATTRIBUTE_PURE; +extern int + u16_strmblen (const uint16_t *s) + _UC_ATTRIBUTE_PURE; +extern int + u32_strmblen (const uint32_t *s) + _UC_ATTRIBUTE_PURE; + +/* Return the length (number of units) of the first character in S, putting + its 'ucs4_t' representation in *PUC. Return 0 if it is the NUL + character. Return -1 upon failure. */ +extern int + u8_strmbtouc (ucs4_t *puc, const uint8_t *s); +extern int + u16_strmbtouc (ucs4_t *puc, const uint16_t *s); +extern int + u32_strmbtouc (ucs4_t *puc, const uint32_t *s); + +/* Forward iteration step. Advances the pointer past the next character, + or returns NULL if the end of the string has been reached. Puts the + character's 'ucs4_t' representation in *PUC. */ +extern const uint8_t * + u8_next (ucs4_t *puc, const uint8_t *s); +extern const uint16_t * + u16_next (ucs4_t *puc, const uint16_t *s); +extern const uint32_t * + u32_next (ucs4_t *puc, const uint32_t *s); + +/* Backward iteration step. Advances the pointer to point to the previous + character, or returns NULL if the beginning of the string had been reached. + Puts the character's 'ucs4_t' representation in *PUC. */ +extern const uint8_t * + u8_prev (ucs4_t *puc, const uint8_t *s, const uint8_t *start); +extern const uint16_t * + u16_prev (ucs4_t *puc, const uint16_t *s, const uint16_t *start); +extern const uint32_t * + u32_prev (ucs4_t *puc, const uint32_t *s, const uint32_t *start); + +/* Return the number of units in S. */ +/* Similar to strlen(), wcslen(). */ +extern size_t + u8_strlen (const uint8_t *s) + _UC_ATTRIBUTE_PURE; +extern size_t + u16_strlen (const uint16_t *s) + _UC_ATTRIBUTE_PURE; +extern size_t + u32_strlen (const uint32_t *s) + _UC_ATTRIBUTE_PURE; + +/* Return the number of units in S, but at most MAXLEN. */ +/* Similar to strnlen(), wcsnlen(). */ +extern size_t + u8_strnlen (const uint8_t *s, size_t maxlen) + _UC_ATTRIBUTE_PURE; +extern size_t + u16_strnlen (const uint16_t *s, size_t maxlen) + _UC_ATTRIBUTE_PURE; +extern size_t + u32_strnlen (const uint32_t *s, size_t maxlen) + _UC_ATTRIBUTE_PURE; + +/* Copy SRC to DEST. */ +/* Similar to strcpy(), wcscpy(). */ +extern uint8_t * + u8_strcpy (uint8_t *dest, const uint8_t *src); +extern uint16_t * + u16_strcpy (uint16_t *dest, const uint16_t *src); +extern uint32_t * + u32_strcpy (uint32_t *dest, const uint32_t *src); + +/* Copy SRC to DEST, returning the address of the terminating NUL in DEST. */ +/* Similar to stpcpy(). */ +extern uint8_t * + u8_stpcpy (uint8_t *dest, const uint8_t *src); +extern uint16_t * + u16_stpcpy (uint16_t *dest, const uint16_t *src); +extern uint32_t * + u32_stpcpy (uint32_t *dest, const uint32_t *src); + +/* Copy no more than N units of SRC to DEST. */ +/* Similar to strncpy(), wcsncpy(). */ +extern uint8_t * + u8_strncpy (uint8_t *dest, const uint8_t *src, size_t n); +extern uint16_t * + u16_strncpy (uint16_t *dest, const uint16_t *src, size_t n); +extern uint32_t * + u32_strncpy (uint32_t *dest, const uint32_t *src, size_t n); + +/* Copy no more than N units of SRC to DEST. Return a pointer past the last + non-NUL unit written into DEST. */ +/* Similar to stpncpy(). */ +extern uint8_t * + u8_stpncpy (uint8_t *dest, const uint8_t *src, size_t n); +extern uint16_t * + u16_stpncpy (uint16_t *dest, const uint16_t *src, size_t n); +extern uint32_t * + u32_stpncpy (uint32_t *dest, const uint32_t *src, size_t n); + +/* Append SRC onto DEST. */ +/* Similar to strcat(), wcscat(). */ +extern uint8_t * + u8_strcat (uint8_t *dest, const uint8_t *src); +extern uint16_t * + u16_strcat (uint16_t *dest, const uint16_t *src); +extern uint32_t * + u32_strcat (uint32_t *dest, const uint32_t *src); + +/* Append no more than N units of SRC onto DEST. */ +/* Similar to strncat(), wcsncat(). */ +extern uint8_t * + u8_strncat (uint8_t *dest, const uint8_t *src, size_t n); +extern uint16_t * + u16_strncat (uint16_t *dest, const uint16_t *src, size_t n); +extern uint32_t * + u32_strncat (uint32_t *dest, const uint32_t *src, size_t n); + +/* Compare S1 and S2. */ +/* Similar to strcmp(), wcscmp(). */ +#ifdef __sun +/* Avoid a collision with the u8_strcmp() function in Solaris 11 libc. */ +extern int + u8_strcmp_gnu (const uint8_t *s1, const uint8_t *s2) + _UC_ATTRIBUTE_PURE; +# define u8_strcmp u8_strcmp_gnu +#else +extern int + u8_strcmp (const uint8_t *s1, const uint8_t *s2) + _UC_ATTRIBUTE_PURE; +#endif +extern int + u16_strcmp (const uint16_t *s1, const uint16_t *s2) + _UC_ATTRIBUTE_PURE; +extern int + u32_strcmp (const uint32_t *s1, const uint32_t *s2) + _UC_ATTRIBUTE_PURE; + +/* Compare S1 and S2 using the collation rules of the current locale. + Return -1 if S1 < S2, 0 if S1 = S2, 1 if S1 > S2. + Upon failure, set errno and return any value. */ +/* Similar to strcoll(), wcscoll(). */ +extern int + u8_strcoll (const uint8_t *s1, const uint8_t *s2); +extern int + u16_strcoll (const uint16_t *s1, const uint16_t *s2); +extern int + u32_strcoll (const uint32_t *s1, const uint32_t *s2); + +/* Compare no more than N units of S1 and S2. */ +/* Similar to strncmp(), wcsncmp(). */ +extern int + u8_strncmp (const uint8_t *s1, const uint8_t *s2, size_t n) + _UC_ATTRIBUTE_PURE; +extern int + u16_strncmp (const uint16_t *s1, const uint16_t *s2, size_t n) + _UC_ATTRIBUTE_PURE; +extern int + u32_strncmp (const uint32_t *s1, const uint32_t *s2, size_t n) + _UC_ATTRIBUTE_PURE; + +/* Duplicate S, returning an identical malloc'd string. */ +/* Similar to strdup(), wcsdup(). */ +extern uint8_t * + u8_strdup (const uint8_t *s); +extern uint16_t * + u16_strdup (const uint16_t *s); +extern uint32_t * + u32_strdup (const uint32_t *s); + +/* Find the first occurrence of UC in STR. */ +/* Similar to strchr(), wcschr(). */ +extern uint8_t * + u8_strchr (const uint8_t *str, ucs4_t uc) + _UC_ATTRIBUTE_PURE; +extern uint16_t * + u16_strchr (const uint16_t *str, ucs4_t uc) + _UC_ATTRIBUTE_PURE; +extern uint32_t * + u32_strchr (const uint32_t *str, ucs4_t uc) + _UC_ATTRIBUTE_PURE; + +/* Find the last occurrence of UC in STR. */ +/* Similar to strrchr(), wcsrchr(). */ +extern uint8_t * + u8_strrchr (const uint8_t *str, ucs4_t uc) + _UC_ATTRIBUTE_PURE; +extern uint16_t * + u16_strrchr (const uint16_t *str, ucs4_t uc) + _UC_ATTRIBUTE_PURE; +extern uint32_t * + u32_strrchr (const uint32_t *str, ucs4_t uc) + _UC_ATTRIBUTE_PURE; + +/* Return the length of the initial segment of STR which consists entirely + of Unicode characters not in REJECT. */ +/* Similar to strcspn(), wcscspn(). */ +extern size_t + u8_strcspn (const uint8_t *str, const uint8_t *reject) + _UC_ATTRIBUTE_PURE; +extern size_t + u16_strcspn (const uint16_t *str, const uint16_t *reject) + _UC_ATTRIBUTE_PURE; +extern size_t + u32_strcspn (const uint32_t *str, const uint32_t *reject) + _UC_ATTRIBUTE_PURE; + +/* Return the length of the initial segment of STR which consists entirely + of Unicode characters in ACCEPT. */ +/* Similar to strspn(), wcsspn(). */ +extern size_t + u8_strspn (const uint8_t *str, const uint8_t *accept) + _UC_ATTRIBUTE_PURE; +extern size_t + u16_strspn (const uint16_t *str, const uint16_t *accept) + _UC_ATTRIBUTE_PURE; +extern size_t + u32_strspn (const uint32_t *str, const uint32_t *accept) + _UC_ATTRIBUTE_PURE; + +/* Find the first occurrence in STR of any character in ACCEPT. */ +/* Similar to strpbrk(), wcspbrk(). */ +extern uint8_t * + u8_strpbrk (const uint8_t *str, const uint8_t *accept) + _UC_ATTRIBUTE_PURE; +extern uint16_t * + u16_strpbrk (const uint16_t *str, const uint16_t *accept) + _UC_ATTRIBUTE_PURE; +extern uint32_t * + u32_strpbrk (const uint32_t *str, const uint32_t *accept) + _UC_ATTRIBUTE_PURE; + +/* Find the first occurrence of NEEDLE in HAYSTACK. */ +/* Similar to strstr(), wcsstr(). */ +extern uint8_t * + u8_strstr (const uint8_t *haystack, const uint8_t *needle) + _UC_ATTRIBUTE_PURE; +extern uint16_t * + u16_strstr (const uint16_t *haystack, const uint16_t *needle) + _UC_ATTRIBUTE_PURE; +extern uint32_t * + u32_strstr (const uint32_t *haystack, const uint32_t *needle) + _UC_ATTRIBUTE_PURE; + +/* Test whether STR starts with PREFIX. */ +extern bool + u8_startswith (const uint8_t *str, const uint8_t *prefix) + _UC_ATTRIBUTE_PURE; +extern bool + u16_startswith (const uint16_t *str, const uint16_t *prefix) + _UC_ATTRIBUTE_PURE; +extern bool + u32_startswith (const uint32_t *str, const uint32_t *prefix) + _UC_ATTRIBUTE_PURE; + +/* Test whether STR ends with SUFFIX. */ +extern bool + u8_endswith (const uint8_t *str, const uint8_t *suffix) + _UC_ATTRIBUTE_PURE; +extern bool + u16_endswith (const uint16_t *str, const uint16_t *suffix) + _UC_ATTRIBUTE_PURE; +extern bool + u32_endswith (const uint32_t *str, const uint32_t *suffix) + _UC_ATTRIBUTE_PURE; + +/* Divide STR into tokens separated by characters in DELIM. + This interface is actually more similar to wcstok than to strtok. */ +/* Similar to strtok_r(), wcstok(). */ +extern uint8_t * + u8_strtok (uint8_t *str, const uint8_t *delim, uint8_t **ptr); +extern uint16_t * + u16_strtok (uint16_t *str, const uint16_t *delim, uint16_t **ptr); +extern uint32_t * + u32_strtok (uint32_t *str, const uint32_t *delim, uint32_t **ptr); + + +#ifdef __cplusplus +} +#endif + +#endif /* _UNISTR_H */ diff --git a/local/recipes/tools/diffutils/source/lib/unistr/u8-mbtoucr.c b/local/recipes/tools/diffutils/source/lib/unistr/u8-mbtoucr.c new file mode 100644 index 0000000000..3f2f38659f --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/unistr/u8-mbtoucr.c @@ -0,0 +1,142 @@ +/* Look at first character in UTF-8 string, returning an error code. + Copyright (C) 1999-2002, 2006-2007, 2009-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2001. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "unistr.h" + +int +u8_mbtoucr (ucs4_t *puc, const uint8_t *s, size_t n) +{ + uint8_t c = *s; + + if (c < 0x80) + { + *puc = c; + return 1; + } + else if (c >= 0xc2) + { + if (c < 0xe0) + { + if (n >= 2) + { + if ((s[1] ^ 0x80) < 0x40) + { + *puc = ((unsigned int) (c & 0x1f) << 6) + | (unsigned int) (s[1] ^ 0x80); + return 2; + } + /* invalid multibyte character */ + } + else + { + /* incomplete multibyte character */ + *puc = 0xfffd; + return -2; + } + } + else if (c < 0xf0) + { + if (n >= 2) + { + if ((s[1] ^ 0x80) < 0x40 + && (c >= 0xe1 || s[1] >= 0xa0) + && (c != 0xed || s[1] < 0xa0)) + { + if (n >= 3) + { + if ((s[2] ^ 0x80) < 0x40) + { + *puc = ((unsigned int) (c & 0x0f) << 12) + | ((unsigned int) (s[1] ^ 0x80) << 6) + | (unsigned int) (s[2] ^ 0x80); + return 3; + } + /* invalid multibyte character */ + } + else + { + /* incomplete multibyte character */ + *puc = 0xfffd; + return -2; + } + } + /* invalid multibyte character */ + } + else + { + /* incomplete multibyte character */ + *puc = 0xfffd; + return -2; + } + } + else if (c < 0xf8) + { + if (n >= 2) + { + if ((s[1] ^ 0x80) < 0x40 + && (c >= 0xf1 || s[1] >= 0x90) + && (c < 0xf4 || (c == 0xf4 && s[1] < 0x90))) + { + if (n >= 3) + { + if ((s[2] ^ 0x80) < 0x40) + { + if (n >= 4) + { + if ((s[3] ^ 0x80) < 0x40) + { + *puc = ((unsigned int) (c & 0x07) << 18) + | ((unsigned int) (s[1] ^ 0x80) << 12) + | ((unsigned int) (s[2] ^ 0x80) << 6) + | (unsigned int) (s[3] ^ 0x80); + return 4; + } + /* invalid multibyte character */ + } + else + { + /* incomplete multibyte character */ + *puc = 0xfffd; + return -2; + } + } + /* invalid multibyte character */ + } + else + { + /* incomplete multibyte character */ + *puc = 0xfffd; + return -2; + } + } + /* invalid multibyte character */ + } + else + { + /* incomplete multibyte character */ + *puc = 0xfffd; + return -2; + } + } + } + /* invalid multibyte character */ + *puc = 0xfffd; + return -1; +} diff --git a/local/recipes/tools/diffutils/source/lib/unistr/u8-uctomb-aux.c b/local/recipes/tools/diffutils/source/lib/unistr/u8-uctomb-aux.c new file mode 100644 index 0000000000..ba358ed4ea --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/unistr/u8-uctomb-aux.c @@ -0,0 +1,66 @@ +/* Conversion UCS-4 to UTF-8. + Copyright (C) 2002, 2006-2007, 2009-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2002. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "unistr.h" + +#ifndef FALLTHROUGH +# if __GNUC__ < 7 +# define FALLTHROUGH ((void) 0) +# else +# define FALLTHROUGH __attribute__ ((__fallthrough__)) +# endif +#endif + +int +u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n) +{ + int count; + + if (uc < 0x80) + /* The case n >= 1 is already handled by the caller. */ + return -2; + else if (uc < 0x800) + count = 2; + else if (uc < 0x10000) + { + if (uc < 0xd800 || uc >= 0xe000) + count = 3; + else + return -1; + } + else if (uc < 0x110000) + count = 4; + else + return -1; + + if (n < count) + return -2; + + switch (count) /* note: code falls through cases! */ + { + case 4: s[3] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x10000; + FALLTHROUGH; + case 3: s[2] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x800; + FALLTHROUGH; + case 2: s[1] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0xc0; + /*case 1:*/ s[0] = uc; + } + return count; +} diff --git a/local/recipes/tools/diffutils/source/lib/unistr/u8-uctomb.c b/local/recipes/tools/diffutils/source/lib/unistr/u8-uctomb.c new file mode 100644 index 0000000000..685b6f1eec --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/unistr/u8-uctomb.c @@ -0,0 +1,75 @@ +/* Store a character in UTF-8 string. + Copyright (C) 2002, 2005-2006, 2009-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2002. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#if defined IN_LIBUNISTRING +/* Tell unistr.h to declare u8_uctomb as 'extern', not 'static inline'. */ +# include "unistring-notinline.h" +#endif + +/* Specification. */ +#include "unistr.h" + +#if !HAVE_INLINE + +int +u8_uctomb (uint8_t *s, ucs4_t uc, int n) +{ + if (uc < 0x80) + { + if (n > 0) + { + s[0] = uc; + return 1; + } + /* else return -2, below. */ + } + else + { + int count; + + if (uc < 0x800) + count = 2; + else if (uc < 0x10000) + { + if (uc < 0xd800 || uc >= 0xe000) + count = 3; + else + return -1; + } + else if (uc < 0x110000) + count = 4; + else + return -1; + + if (n >= count) + { + switch (count) /* note: code falls through cases! */ + { + case 4: s[3] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x10000; + case 3: s[2] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x800; + case 2: s[1] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0xc0; + /*case 1:*/ s[0] = uc; + } + return count; + } + } + return -2; +} + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/unitypes.in.h b/local/recipes/tools/diffutils/source/lib/unitypes.in.h new file mode 100644 index 0000000000..8733079aeb --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/unitypes.in.h @@ -0,0 +1,46 @@ +/* Elementary types and macros for the GNU UniString library. + Copyright (C) 2002, 2005-2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _UNITYPES_H +#define _UNITYPES_H + +/* Get uint8_t, uint16_t, uint32_t. */ +#include <stdint.h> + +/* Type representing a Unicode character. */ +typedef uint32_t ucs4_t; + +/* Attribute of a function whose result depends only on the arguments + (not pointers!) and which has no side effects. */ +#ifndef _UC_ATTRIBUTE_CONST +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +# define _UC_ATTRIBUTE_CONST __attribute__ ((__const__)) +# else +# define _UC_ATTRIBUTE_CONST +# endif +#endif + +/* Attribute of a function whose result depends only on the arguments + (possibly pointers) and global memory, and which has no side effects. */ +#ifndef _UC_ATTRIBUTE_PURE +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _UC_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define _UC_ATTRIBUTE_PURE +# endif +#endif + +#endif /* _UNITYPES_H */ diff --git a/local/recipes/tools/diffutils/source/lib/uniwidth.in.h b/local/recipes/tools/diffutils/source/lib/uniwidth.in.h new file mode 100644 index 0000000000..fc85e9665d --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/uniwidth.in.h @@ -0,0 +1,72 @@ +/* Display width functions. + Copyright (C) 2001-2002, 2005, 2007, 2009-2017 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _UNIWIDTH_H +#define _UNIWIDTH_H + +#include "unitypes.h" + +/* Get size_t. */ +#include <stddef.h> + +/* Get locale_charset() declaration. */ +#include "localcharset.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Display width. */ + +/* These functions are locale dependent. The encoding argument identifies + the encoding (e.g. "ISO-8859-2" for Polish). */ + +/* Determine number of column positions required for UC. */ +extern int + uc_width (ucs4_t uc, const char *encoding) + _UC_ATTRIBUTE_PURE; + +/* Determine number of column positions required for first N units + (or fewer if S ends before this) in S. */ +extern int + u8_width (const uint8_t *s, size_t n, const char *encoding) + _UC_ATTRIBUTE_PURE; +extern int + u16_width (const uint16_t *s, size_t n, const char *encoding) + _UC_ATTRIBUTE_PURE; +extern int + u32_width (const uint32_t *s, size_t n, const char *encoding) + _UC_ATTRIBUTE_PURE; + +/* Determine number of column positions required for S. */ +extern int + u8_strwidth (const uint8_t *s, const char *encoding) + _UC_ATTRIBUTE_PURE; +extern int + u16_strwidth (const uint16_t *s, const char *encoding) + _UC_ATTRIBUTE_PURE; +extern int + u32_strwidth (const uint32_t *s, const char *encoding) + _UC_ATTRIBUTE_PURE; + + +#ifdef __cplusplus +} +#endif + +#endif /* _UNIWIDTH_H */ diff --git a/local/recipes/tools/diffutils/source/lib/uniwidth/cjk.h b/local/recipes/tools/diffutils/source/lib/uniwidth/cjk.h new file mode 100644 index 0000000000..c354608abb --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/uniwidth/cjk.h @@ -0,0 +1,37 @@ +/* Test for CJK encoding. + Copyright (C) 2001-2002, 2005-2007, 2009-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2002. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include "streq.h" + +static int +is_cjk_encoding (const char *encoding) +{ + if (0 + /* Legacy Japanese encodings */ + || STREQ_OPT (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0) + /* Legacy Chinese encodings */ + || STREQ_OPT (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0) + || STREQ_OPT (encoding, "GBK", 'G', 'B', 'K', 0, 0, 0, 0, 0, 0) + || STREQ_OPT (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0) + || STREQ_OPT (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0) + /* Legacy Korean encodings */ + || STREQ_OPT (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0) + || STREQ_OPT (encoding, "CP949", 'C', 'P', '9', '4', '9', 0, 0, 0, 0) + || STREQ_OPT (encoding, "JOHAB", 'J', 'O', 'H', 'A', 'B', 0, 0, 0, 0)) + return 1; + return 0; +} diff --git a/local/recipes/tools/diffutils/source/lib/uniwidth/width.c b/local/recipes/tools/diffutils/source/lib/uniwidth/width.c new file mode 100644 index 0000000000..0817d39c2a --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/uniwidth/width.c @@ -0,0 +1,450 @@ +/* Determine display width of Unicode character. + Copyright (C) 2001-2002, 2006-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2002. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "uniwidth.h" + +#include "cjk.h" + +/* + * Non-spacing attribute table. + * Consists of: + * - Non-spacing characters; generated from PropList.txt or + * "grep '^[^;]*;[^;]*;[^;]*;[^;]*;NSM;' UnicodeData.txt" + * - Format control characters; generated from + * "grep '^[^;]*;[^;]*;Cf;' UnicodeData.txt" + * - Zero width characters; generated from + * "grep '^[^;]*;ZERO WIDTH ' UnicodeData.txt" + */ +static const unsigned char nonspacing_table_data[36*64] = { + /* 0x0000-0x01ff */ + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, /* 0x0000-0x003f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0x0040-0x007f */ + 0xff, 0xff, 0xff, 0xff, 0x00, 0x20, 0x00, 0x00, /* 0x0080-0x00bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00c0-0x00ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0100-0x013f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0140-0x017f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0180-0x01bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x01c0-0x01ff */ + /* 0x0200-0x03ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0200-0x023f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0240-0x027f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0280-0x02bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x02c0-0x02ff */ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x0300-0x033f */ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, /* 0x0340-0x037f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0380-0x03bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x03c0-0x03ff */ + /* 0x0400-0x05ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0400-0x043f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0440-0x047f */ + 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0480-0x04bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x04c0-0x04ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0500-0x053f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0540-0x057f */ + 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xbf, /* 0x0580-0x05bf */ + 0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x05c0-0x05ff */ + /* 0x0600-0x07ff */ + 0x3f, 0x00, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, /* 0x0600-0x063f */ + 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x01, 0x00, /* 0x0640-0x067f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0680-0x06bf */ + 0x00, 0x00, 0xc0, 0xbf, 0x9f, 0x3d, 0x00, 0x00, /* 0x06c0-0x06ff */ + 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, /* 0x0700-0x073f */ + 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0740-0x077f */ + 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x01, 0x00, /* 0x0780-0x07bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, /* 0x07c0-0x07ff */ + /* 0x0800-0x09ff */ + 0x00, 0x00, 0xc0, 0xfb, 0xef, 0x3e, 0x00, 0x00, /* 0x0800-0x083f */ + 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, /* 0x0840-0x087f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0880-0x08bf */ + 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, /* 0x08c0-0x08ff */ + 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, /* 0x0900-0x093f */ + 0xfe, 0x21, 0xfe, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0940-0x097f */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0980-0x09bf */ + 0x1e, 0x20, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x09c0-0x09ff */ + /* 0x0a00-0x0bff */ + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0a00-0x0a3f */ + 0x86, 0x39, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, /* 0x0a40-0x0a7f */ + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0a80-0x0abf */ + 0xbe, 0x21, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0ac0-0x0aff */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, /* 0x0b00-0x0b3f */ + 0x1e, 0x20, 0x40, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0b40-0x0b7f */ + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0b80-0x0bbf */ + 0x01, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0bc0-0x0bff */ + /* 0x0c00-0x0dff */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, /* 0x0c00-0x0c3f */ + 0xc1, 0x3d, 0x60, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0c40-0x0c7f */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0c80-0x0cbf */ + 0x00, 0x30, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0cc0-0x0cff */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0d00-0x0d3f */ + 0x1e, 0x20, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0d40-0x0d7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0d80-0x0dbf */ + 0x00, 0x04, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0dc0-0x0dff */ + /* 0x0e00-0x0fff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf2, 0x07, /* 0x0e00-0x0e3f */ + 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0e40-0x0e7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf2, 0x1b, /* 0x0e80-0x0ebf */ + 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0ec0-0x0eff */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0xa0, 0x02, /* 0x0f00-0x0f3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, /* 0x0f40-0x0f7f */ + 0xdf, 0xe0, 0xff, 0xfe, 0xff, 0xff, 0xff, 0x1f, /* 0x0f80-0x0fbf */ + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0fc0-0x0fff */ + /* 0x1000-0x11ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xfd, 0x66, /* 0x1000-0x103f */ + 0x00, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x1e, 0x00, /* 0x1040-0x107f */ + 0x64, 0x20, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, /* 0x1080-0x10bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10c0-0x10ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1100-0x113f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1140-0x117f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1180-0x11bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11c0-0x11ff */ + /* 0x1200-0x13ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1200-0x123f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1240-0x127f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1280-0x12bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x12c0-0x12ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1300-0x133f */ + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, /* 0x1340-0x137f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1380-0x13bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x13c0-0x13ff */ + /* 0x1600-0x17ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1600-0x163f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1640-0x167f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1680-0x16bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16c0-0x16ff */ + 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, /* 0x1700-0x173f */ + 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, /* 0x1740-0x177f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x3f, /* 0x1780-0x17bf */ + 0x40, 0xfe, 0x0f, 0x20, 0x00, 0x00, 0x00, 0x00, /* 0x17c0-0x17ff */ + /* 0x1800-0x19ff */ + 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1800-0x183f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1840-0x187f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, /* 0x1880-0x18bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18c0-0x18ff */ + 0x00, 0x00, 0x00, 0x00, 0x87, 0x01, 0x04, 0x0e, /* 0x1900-0x193f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1940-0x197f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1980-0x19bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x19c0-0x19ff */ + /* 0x1a00-0x1bff */ + 0x00, 0x00, 0x80, 0x09, 0x00, 0x00, 0x00, 0x00, /* 0x1a00-0x1a3f */ + 0x00, 0x00, 0x40, 0x7f, 0xe5, 0x1f, 0xf8, 0x9f, /* 0x1a40-0x1a7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, /* 0x1a80-0x1abf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1ac0-0x1aff */ + 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x17, /* 0x1b00-0x1b3f */ + 0x04, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, /* 0x1b40-0x1b7f */ + 0x03, 0x00, 0x00, 0x00, 0x3c, 0x3b, 0x00, 0x00, /* 0x1b80-0x1bbf */ + 0x00, 0x00, 0x00, 0x00, 0x40, 0xa3, 0x03, 0x00, /* 0x1bc0-0x1bff */ + /* 0x1c00-0x1dff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xcf, 0x00, /* 0x1c00-0x1c3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1c40-0x1c7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1c80-0x1cbf */ + 0x00, 0x00, 0xf7, 0xff, 0xfd, 0x21, 0x10, 0x03, /* 0x1cc0-0x1cff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d00-0x1d3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d40-0x1d7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d80-0x1dbf */ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xf0, /* 0x1dc0-0x1dff */ + /* 0x2000-0x21ff */ + 0x00, 0xf8, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, /* 0x2000-0x203f */ + 0x00, 0x00, 0x00, 0x00, 0xdf, 0xff, 0x00, 0x00, /* 0x2040-0x207f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2080-0x20bf */ + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, /* 0x20c0-0x20ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2100-0x213f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2140-0x217f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2180-0x21bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x21c0-0x21ff */ + /* 0x2c00-0x2dff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2c00-0x2c3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2c40-0x2c7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2c80-0x2cbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, /* 0x2cc0-0x2cff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2d00-0x2d3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0x2d40-0x2d7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2d80-0x2dbf */ + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, /* 0x2dc0-0x2dff */ + /* 0x3000-0x31ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* 0x3000-0x303f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3040-0x307f */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, /* 0x3080-0x30bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30c0-0x30ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3100-0x313f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3140-0x317f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3180-0x31bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x31c0-0x31ff */ + /* 0xa600-0xa7ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa600-0xa63f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf7, 0x3f, /* 0xa640-0xa67f */ + 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, /* 0xa680-0xa6bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, /* 0xa6c0-0xa6ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa700-0xa73f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa740-0xa77f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa780-0xa7bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa7c0-0xa7ff */ + /* 0xa800-0xa9ff */ + 0x44, 0x08, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, /* 0xa800-0xa83f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa840-0xa87f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa880-0xa8bf */ + 0x10, 0x00, 0x00, 0x00, 0xff, 0xff, 0x03, 0x00, /* 0xa8c0-0xa8ff */ + 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, /* 0xa900-0xa93f */ + 0x80, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa940-0xa97f */ + 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x13, /* 0xa980-0xa9bf */ + 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, /* 0xa9c0-0xa9ff */ + /* 0xaa00-0xabff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x66, 0x00, /* 0xaa00-0xaa3f */ + 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0xaa40-0xaa7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0xc1, /* 0xaa80-0xaabf */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x30, 0x40, 0x00, /* 0xaac0-0xaaff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xab00-0xab3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xab40-0xab7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xab80-0xabbf */ + 0x00, 0x00, 0x00, 0x00, 0x20, 0x21, 0x00, 0x00, /* 0xabc0-0xabff */ + /* 0xfa00-0xfbff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfa00-0xfa3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfa40-0xfa7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfa80-0xfabf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfac0-0xfaff */ + 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, /* 0xfb00-0xfb3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfb40-0xfb7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfb80-0xfbbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfbc0-0xfbff */ + /* 0xfe00-0xffff */ + 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, /* 0xfe00-0xfe3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfe40-0xfe7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfe80-0xfebf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0xfec0-0xfeff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xff00-0xff3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xff40-0xff7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xff80-0xffbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, /* 0xffc0-0xffff */ + /* 0x10000-0x101ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10000-0x1003f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10040-0x1007f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10080-0x100bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x100c0-0x100ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10100-0x1013f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10140-0x1017f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10180-0x101bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, /* 0x101c0-0x101ff */ + /* 0x10200-0x103ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10200-0x1023f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10240-0x1027f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10280-0x102bf */ + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* 0x102c0-0x102ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10300-0x1033f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, /* 0x10340-0x1037f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10380-0x103bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x103c0-0x103ff */ + /* 0x10a00-0x10bff */ + 0x6e, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, /* 0x10a00-0x10a3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10a40-0x10a7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10a80-0x10abf */ + 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, /* 0x10ac0-0x10aff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10b00-0x10b3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10b40-0x10b7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10b80-0x10bbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10bc0-0x10bff */ + /* 0x11000-0x111ff */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0x11000-0x1103f */ + 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0x11040-0x1107f */ + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x26, /* 0x11080-0x110bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x110c0-0x110ff */ + 0x07, 0x00, 0x00, 0x00, 0x80, 0xef, 0x1f, 0x00, /* 0x11100-0x1113f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, /* 0x11140-0x1117f */ + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, /* 0x11180-0x111bf */ + 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x111c0-0x111ff */ + /* 0x11200-0x113ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xd3, 0x00, /* 0x11200-0x1123f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11240-0x1127f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11280-0x112bf */ + 0x00, 0x00, 0x00, 0x80, 0xf8, 0x07, 0x00, 0x00, /* 0x112c0-0x112ff */ + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x11300-0x1133f */ + 0x01, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x1f, 0x00, /* 0x11340-0x1137f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11380-0x113bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x113c0-0x113ff */ + /* 0x11400-0x115ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11400-0x1143f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11440-0x1147f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x85, /* 0x11480-0x114bf */ + 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x114c0-0x114ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11500-0x1153f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11540-0x1157f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0xb0, /* 0x11580-0x115bf */ + 0x01, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, /* 0x115c0-0x115ff */ + /* 0x11600-0x117ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xa7, /* 0x11600-0x1163f */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11640-0x1167f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0xbf, 0x00, /* 0x11680-0x116bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x116c0-0x116ff */ + 0x00, 0x00, 0x00, 0xe0, 0xbc, 0x0f, 0x00, 0x00, /* 0x11700-0x1173f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11740-0x1177f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11780-0x117bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x117c0-0x117ff */ + /* 0x16a00-0x16bff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16a00-0x16a3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16a40-0x16a7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16a80-0x16abf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, /* 0x16ac0-0x16aff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, /* 0x16b00-0x16b3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16b40-0x16b7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16b80-0x16bbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16bc0-0x16bff */ + /* 0x16e00-0x16fff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16e00-0x16e3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16e40-0x16e7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16e80-0x16ebf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16ec0-0x16eff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16f00-0x16f3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16f40-0x16f7f */ + 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16f80-0x16fbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16fc0-0x16fff */ + /* 0x1bc00-0x1bdff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bc00-0x1bc3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bc40-0x1bc7f */ + 0x00, 0x00, 0x00, 0x60, 0x0f, 0x00, 0x00, 0x00, /* 0x1bc80-0x1bcbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bcc0-0x1bcff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bd00-0x1bd3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bd40-0x1bd7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bd80-0x1bdbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bdc0-0x1bdff */ + /* 0x1d000-0x1d1ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d000-0x1d03f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d040-0x1d07f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d080-0x1d0bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d0c0-0x1d0ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d100-0x1d13f */ + 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0xf8, 0xff, /* 0x1d140-0x1d17f */ + 0xe7, 0x0f, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* 0x1d180-0x1d1bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d1c0-0x1d1ff */ + /* 0x1d200-0x1d3ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d200-0x1d23f */ + 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d240-0x1d27f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d280-0x1d2bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d2c0-0x1d2ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d300-0x1d33f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d340-0x1d37f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d380-0x1d3bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d3c0-0x1d3ff */ + /* 0x1da00-0x1dbff */ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xf8, /* 0x1da00-0x1da3f */ + 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x20, 0x00, /* 0x1da40-0x1da7f */ + 0x10, 0x00, 0x00, 0xf8, 0xfe, 0xff, 0x00, 0x00, /* 0x1da80-0x1dabf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1dac0-0x1daff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1db00-0x1db3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1db40-0x1db7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1db80-0x1dbbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1dbc0-0x1dbff */ + /* 0x1e800-0x1e9ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e800-0x1e83f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e840-0x1e87f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e880-0x1e8bf */ + 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e8c0-0x1e8ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e900-0x1e93f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e940-0x1e97f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e980-0x1e9bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* 0x1e9c0-0x1e9ff */ +}; +static const signed char nonspacing_table_ind[248] = { + 0, 1, 2, 3, 4, 5, 6, 7, /* 0x0000-0x0fff */ + 8, 9, -1, 10, 11, 12, 13, -1, /* 0x1000-0x1fff */ + 14, -1, -1, -1, -1, -1, 15, -1, /* 0x2000-0x2fff */ + 16, -1, -1, -1, -1, -1, -1, -1, /* 0x3000-0x3fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x4000-0x4fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x5000-0x5fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x6000-0x6fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x7000-0x7fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x8000-0x8fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x9000-0x9fff */ + -1, -1, -1, 17, 18, 19, -1, -1, /* 0xa000-0xafff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0xb000-0xbfff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0xc000-0xcfff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0xd000-0xdfff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0xe000-0xefff */ + -1, -1, -1, -1, -1, 20, -1, 21, /* 0xf000-0xffff */ + 22, 23, -1, -1, -1, 24, -1, -1, /* 0x10000-0x10fff */ + 25, 26, 27, 28, -1, -1, -1, -1, /* 0x11000-0x11fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x12000-0x12fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x13000-0x13fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x14000-0x14fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x15000-0x15fff */ + -1, -1, -1, -1, -1, 29, -1, 30, /* 0x16000-0x16fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x17000-0x17fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x18000-0x18fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x19000-0x19fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x1a000-0x1afff */ + -1, -1, -1, -1, -1, -1, 31, -1, /* 0x1b000-0x1bfff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x1c000-0x1cfff */ + 32, 33, -1, -1, -1, 34, -1, -1, /* 0x1d000-0x1dfff */ + -1, -1, -1, -1, 35, -1, -1, -1 /* 0x1e000-0x1efff */ +}; + +/* Determine number of column positions required for UC. */ +int +uc_width (ucs4_t uc, const char *encoding) +{ + /* Test for non-spacing or control character. */ + if ((uc >> 9) < 248) + { + int ind = nonspacing_table_ind[uc >> 9]; + if (ind >= 0) + if ((nonspacing_table_data[64*ind + ((uc >> 3) & 63)] >> (uc & 7)) & 1) + { + if (uc > 0 && uc < 0xa0) + return -1; + else + return 0; + } + } + else if ((uc >> 9) == (0xe0000 >> 9)) + { + if (uc >= 0xe0100) + { + if (uc <= 0xe01ef) + return 0; + } + else + { + if (uc >= 0xe0020 ? uc <= 0xe007f : uc == 0xe0001) + return 0; + } + } + /* Test for double-width character. + * Generated from "grep '^[^;]\{4,5\};[WF]' EastAsianWidth.txt" + * and "grep '^[^;]\{4,5\};[^WF]' EastAsianWidth.txt" + */ + if (uc >= 0x1100 + && ((uc < 0x1160) /* Hangul Jamo */ + || (uc >= 0x2329 && uc < 0x232b) /* Angle Brackets */ + || (uc >= 0x2e80 && uc < 0xa4d0 /* CJK ... Yi */ + && !(uc == 0x303f) && !(uc >= 0x4dc0 && uc < 0x4e00)) + || (uc >= 0xac00 && uc < 0xd7a4) /* Hangul Syllables */ + || (uc >= 0xf900 && uc < 0xfb00) /* CJK Compatibility Ideographs */ + || (uc >= 0xfe10 && uc < 0xfe20) /* Presentation Forms for Vertical */ + || (uc >= 0xfe30 && uc < 0xfe70) /* CJK Compatibility Forms */ + || (uc >= 0xff00 && uc < 0xff61) /* Fullwidth Forms */ + || (uc >= 0xffe0 && uc < 0xffe7) /* Fullwidth Signs */ + || (uc >= 0x20000 && uc <= 0x2ffff) /* Supplementary Ideographic Plane */ + || (uc >= 0x30000 && uc <= 0x3ffff) /* Tertiary Ideographic Plane */ + ) ) + return 2; + /* In ancient CJK encodings, Cyrillic and most other characters are + double-width as well. */ + if (uc >= 0x00A1 && uc < 0xFF61 && uc != 0x20A9 + && is_cjk_encoding (encoding)) + return 2; + return 1; +} diff --git a/local/recipes/tools/diffutils/source/lib/unlocked-io.h b/local/recipes/tools/diffutils/source/lib/unlocked-io.h new file mode 100644 index 0000000000..aaf60a0fb4 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/unlocked-io.h @@ -0,0 +1,136 @@ +/* Prefer faster, non-thread-safe stdio functions if available. + + Copyright (C) 2001-2004, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Jim Meyering. */ + +#ifndef UNLOCKED_IO_H +# define UNLOCKED_IO_H 1 + +/* These are wrappers for functions/macros from the GNU C library, and + from other C libraries supporting POSIX's optional thread-safe functions. + + The standard I/O functions are thread-safe. These *_unlocked ones are + more efficient but not thread-safe. That they're not thread-safe is + fine since all of the applications in this package are single threaded. + + Also, some code that is shared with the GNU C library may invoke + the *_unlocked functions directly. On hosts that lack those + functions, invoke the non-thread-safe versions instead. */ + +# include <stdio.h> + +# if HAVE_DECL_CLEARERR_UNLOCKED +# undef clearerr +# define clearerr(x) clearerr_unlocked (x) +# else +# define clearerr_unlocked(x) clearerr (x) +# endif + +# if HAVE_DECL_FEOF_UNLOCKED +# undef feof +# define feof(x) feof_unlocked (x) +# else +# define feof_unlocked(x) feof (x) +# endif + +# if HAVE_DECL_FERROR_UNLOCKED +# undef ferror +# define ferror(x) ferror_unlocked (x) +# else +# define ferror_unlocked(x) ferror (x) +# endif + +# if HAVE_DECL_FFLUSH_UNLOCKED +# undef fflush +# define fflush(x) fflush_unlocked (x) +# else +# define fflush_unlocked(x) fflush (x) +# endif + +# if HAVE_DECL_FGETS_UNLOCKED +# undef fgets +# define fgets(x,y,z) fgets_unlocked (x,y,z) +# else +# define fgets_unlocked(x,y,z) fgets (x,y,z) +# endif + +# if HAVE_DECL_FPUTC_UNLOCKED +# undef fputc +# define fputc(x,y) fputc_unlocked (x,y) +# else +# define fputc_unlocked(x,y) fputc (x,y) +# endif + +# if HAVE_DECL_FPUTS_UNLOCKED +# undef fputs +# define fputs(x,y) fputs_unlocked (x,y) +# else +# define fputs_unlocked(x,y) fputs (x,y) +# endif + +# if HAVE_DECL_FREAD_UNLOCKED +# undef fread +# define fread(w,x,y,z) fread_unlocked (w,x,y,z) +# else +# define fread_unlocked(w,x,y,z) fread (w,x,y,z) +# endif + +# if HAVE_DECL_FWRITE_UNLOCKED +# undef fwrite +# define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z) +# else +# define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z) +# endif + +# if HAVE_DECL_GETC_UNLOCKED +# undef getc +# define getc(x) getc_unlocked (x) +# else +# define getc_unlocked(x) getc (x) +# endif + +# if HAVE_DECL_GETCHAR_UNLOCKED +# undef getchar +# define getchar() getchar_unlocked () +# else +# define getchar_unlocked() getchar () +# endif + +# if HAVE_DECL_PUTC_UNLOCKED +# undef putc +# define putc(x,y) putc_unlocked (x,y) +# else +# define putc_unlocked(x,y) putc (x,y) +# endif + +# if HAVE_DECL_PUTCHAR_UNLOCKED +# undef putchar +# define putchar(x) putchar_unlocked (x) +# else +# define putchar_unlocked(x) putchar (x) +# endif + +# undef flockfile +# define flockfile(x) ((void) 0) + +# undef ftrylockfile +# define ftrylockfile(x) 0 + +# undef funlockfile +# define funlockfile(x) ((void) 0) + +#endif /* UNLOCKED_IO_H */ diff --git a/local/recipes/tools/diffutils/source/lib/unsetenv.c b/local/recipes/tools/diffutils/source/lib/unsetenv.c new file mode 100644 index 0000000000..e8f9a80b5f --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/unsetenv.c @@ -0,0 +1,127 @@ +/* Copyright (C) 1992, 1995-2002, 2005-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc + optimizes away the name == NULL test below. */ +#define _GL_ARG_NONNULL(params) + +#include <config.h> + +/* Specification. */ +#include <stdlib.h> + +#include <errno.h> +#if !_LIBC +# define __set_errno(ev) ((errno) = (ev)) +#endif + +#include <string.h> +#include <unistd.h> + +#if !_LIBC +# define __environ environ +#endif + +#if _LIBC +/* This lock protects against simultaneous modifications of 'environ'. */ +# include <bits/libc-lock.h> +__libc_lock_define_initialized (static, envlock) +# define LOCK __libc_lock_lock (envlock) +# define UNLOCK __libc_lock_unlock (envlock) +#else +# define LOCK +# define UNLOCK +#endif + +/* In the GNU C library we must keep the namespace clean. */ +#ifdef _LIBC +# define unsetenv __unsetenv +#endif + +#if _LIBC || !HAVE_UNSETENV + +int +unsetenv (const char *name) +{ + size_t len; + char **ep; + + if (name == NULL || *name == '\0' || strchr (name, '=') != NULL) + { + __set_errno (EINVAL); + return -1; + } + + len = strlen (name); + + LOCK; + + ep = __environ; + while (*ep != NULL) + if (!strncmp (*ep, name, len) && (*ep)[len] == '=') + { + /* Found it. Remove this pointer by moving later ones back. */ + char **dp = ep; + + do + dp[0] = dp[1]; + while (*dp++); + /* Continue the loop in case NAME appears again. */ + } + else + ++ep; + + UNLOCK; + + return 0; +} + +#ifdef _LIBC +# undef unsetenv +weak_alias (__unsetenv, unsetenv) +#endif + +#else /* HAVE_UNSETENV */ + +# undef unsetenv +# if !HAVE_DECL_UNSETENV +# if VOID_UNSETENV +extern void unsetenv (const char *); +# else +extern int unsetenv (const char *); +# endif +# endif + +/* Call the underlying unsetenv, in case there is hidden bookkeeping + that needs updating beyond just modifying environ. */ +int +rpl_unsetenv (const char *name) +{ + int result = 0; + if (!name || !*name || strchr (name, '=')) + { + errno = EINVAL; + return -1; + } + while (getenv (name)) +# if !VOID_UNSETENV + result = +# endif + unsetenv (name); + return result; +} + +#endif /* HAVE_UNSETENV */ diff --git a/local/recipes/tools/diffutils/source/lib/unused-parameter.h b/local/recipes/tools/diffutils/source/lib/unused-parameter.h new file mode 100644 index 0000000000..b300055a1d --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/unused-parameter.h @@ -0,0 +1,36 @@ +/* A C macro for declaring that specific function parameters are not used. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* _GL_UNUSED_PARAMETER is a marker that can be appended to function parameter + declarations for parameters that are not used. This helps to reduce + warnings, such as from GCC -Wunused-parameter. The syntax is as follows: + type param _GL_UNUSED_PARAMETER + or more generally + param_decl _GL_UNUSED_PARAMETER + For example: + int param _GL_UNUSED_PARAMETER + int *(*param)(void) _GL_UNUSED_PARAMETER + Other possible, but obscure and discouraged syntaxes: + int _GL_UNUSED_PARAMETER *(*param)(void) + _GL_UNUSED_PARAMETER int *(*param)(void) + */ +#ifndef _GL_UNUSED_PARAMETER +# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _GL_UNUSED_PARAMETER __attribute__ ((__unused__)) +# else +# define _GL_UNUSED_PARAMETER +# endif +#endif diff --git a/local/recipes/tools/diffutils/source/lib/vasnprintf.c b/local/recipes/tools/diffutils/source/lib/vasnprintf.c new file mode 100644 index 0000000000..2d02414d5a --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/vasnprintf.c @@ -0,0 +1,5609 @@ +/* vsprintf with automatic memory allocation. + Copyright (C) 1999, 2002-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* This file can be parametrized with the following macros: + VASNPRINTF The name of the function being defined. + FCHAR_T The element type of the format string. + DCHAR_T The element type of the destination (result) string. + FCHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters + in the format string are ASCII. MUST be set if + FCHAR_T and DCHAR_T are not the same type. + DIRECTIVE Structure denoting a format directive. + Depends on FCHAR_T. + DIRECTIVES Structure denoting the set of format directives of a + format string. Depends on FCHAR_T. + PRINTF_PARSE Function that parses a format string. + Depends on FCHAR_T. + DCHAR_CPY memcpy like function for DCHAR_T[] arrays. + DCHAR_SET memset like function for DCHAR_T[] arrays. + DCHAR_MBSNLEN mbsnlen like function for DCHAR_T[] arrays. + SNPRINTF The system's snprintf (or similar) function. + This may be either snprintf or swprintf. + TCHAR_T The element type of the argument and result string + of the said SNPRINTF function. This may be either + char or wchar_t. The code exploits that + sizeof (TCHAR_T) | sizeof (DCHAR_T) and + alignof (TCHAR_T) <= alignof (DCHAR_T). + DCHAR_IS_TCHAR Set to 1 if DCHAR_T and TCHAR_T are the same type. + DCHAR_CONV_FROM_ENCODING A function to convert from char[] to DCHAR[]. + DCHAR_IS_UINT8_T Set to 1 if DCHAR_T is uint8_t. + DCHAR_IS_UINT16_T Set to 1 if DCHAR_T is uint16_t. + DCHAR_IS_UINT32_T Set to 1 if DCHAR_T is uint32_t. */ + +/* Tell glibc's <stdio.h> to provide a prototype for snprintf(). + This must come before <config.h> because <config.h> may include + <features.h>, and once <features.h> has been included, it's too late. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifndef VASNPRINTF +# include <config.h> +#endif +#ifndef IN_LIBINTL +# include <alloca.h> +#endif + +/* Specification. */ +#ifndef VASNPRINTF +# if WIDE_CHAR_VERSION +# include "vasnwprintf.h" +# else +# include "vasnprintf.h" +# endif +#endif + +#include <locale.h> /* localeconv() */ +#include <stdio.h> /* snprintf(), sprintf() */ +#include <stdlib.h> /* abort(), malloc(), realloc(), free() */ +#include <string.h> /* memcpy(), strlen() */ +#include <errno.h> /* errno */ +#include <limits.h> /* CHAR_BIT */ +#include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP */ +#if HAVE_NL_LANGINFO +# include <langinfo.h> +#endif +#ifndef VASNPRINTF +# if WIDE_CHAR_VERSION +# include "wprintf-parse.h" +# else +# include "printf-parse.h" +# endif +#endif + +/* Checked size_t computations. */ +#include "xsize.h" + +#include "verify.h" + +#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL +# include <math.h> +# include "float+.h" +#endif + +#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL +# include <math.h> +# include "isnand-nolibm.h" +#endif + +#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) && !defined IN_LIBINTL +# include <math.h> +# include "isnanl-nolibm.h" +# include "fpucw.h" +#endif + +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL +# include <math.h> +# include "isnand-nolibm.h" +# include "printf-frexp.h" +#endif + +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL +# include <math.h> +# include "isnanl-nolibm.h" +# include "printf-frexpl.h" +# include "fpucw.h" +#endif + +#ifndef FALLTHROUGH +# if __GNUC__ < 7 +# define FALLTHROUGH ((void) 0) +# else +# define FALLTHROUGH __attribute__ ((__fallthrough__)) +# endif +#endif + +/* Default parameters. */ +#ifndef VASNPRINTF +# if WIDE_CHAR_VERSION +# define VASNPRINTF vasnwprintf +# define FCHAR_T wchar_t +# define DCHAR_T wchar_t +# define TCHAR_T wchar_t +# define DCHAR_IS_TCHAR 1 +# define DIRECTIVE wchar_t_directive +# define DIRECTIVES wchar_t_directives +# define PRINTF_PARSE wprintf_parse +# define DCHAR_CPY wmemcpy +# define DCHAR_SET wmemset +# else +# define VASNPRINTF vasnprintf +# define FCHAR_T char +# define DCHAR_T char +# define TCHAR_T char +# define DCHAR_IS_TCHAR 1 +# define DIRECTIVE char_directive +# define DIRECTIVES char_directives +# define PRINTF_PARSE printf_parse +# define DCHAR_CPY memcpy +# define DCHAR_SET memset +# endif +#endif +#if WIDE_CHAR_VERSION + /* TCHAR_T is wchar_t. */ +# define USE_SNPRINTF 1 +# if HAVE_DECL__SNWPRINTF + /* On Windows, the function swprintf() has a different signature than + on Unix; we use the function _snwprintf() or - on mingw - snwprintf() + instead. The mingw function snwprintf() has fewer bugs than the + MSVCRT function _snwprintf(), so prefer that. */ +# if defined __MINGW32__ +# define SNPRINTF snwprintf +# else +# define SNPRINTF _snwprintf +# define USE_MSVC__SNPRINTF 1 +# endif +# else + /* Unix. */ +# define SNPRINTF swprintf +# endif +#else + /* TCHAR_T is char. */ + /* Use snprintf if it exists under the name 'snprintf' or '_snprintf'. + But don't use it on BeOS, since BeOS snprintf produces no output if the + size argument is >= 0x3000000. + Also don't use it on Linux libc5, since there snprintf with size = 1 + writes any output without bounds, like sprintf. */ +# if (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) && !defined __BEOS__ && !(__GNU_LIBRARY__ == 1) +# define USE_SNPRINTF 1 +# else +# define USE_SNPRINTF 0 +# endif +# if HAVE_DECL__SNPRINTF + /* Windows. The mingw function snprintf() has fewer bugs than the MSVCRT + function _snprintf(), so prefer that. */ +# if defined __MINGW32__ +# define SNPRINTF snprintf + /* Here we need to call the native snprintf, not rpl_snprintf. */ +# undef snprintf +# else + /* MSVC versions < 14 did not have snprintf, only _snprintf. */ +# define SNPRINTF _snprintf +# define USE_MSVC__SNPRINTF 1 +# endif +# else + /* Unix. */ +# define SNPRINTF snprintf + /* Here we need to call the native snprintf, not rpl_snprintf. */ +# undef snprintf +# endif +#endif +/* Here we need to call the native sprintf, not rpl_sprintf. */ +#undef sprintf + +/* GCC >= 4.0 with -Wall emits unjustified "... may be used uninitialized" + warnings in this file. Use -Dlint to suppress them. */ +#if defined GCC_LINT || defined lint +# define IF_LINT(Code) Code +#else +# define IF_LINT(Code) /* empty */ +#endif + +/* Avoid some warnings from "gcc -Wshadow". + This file doesn't use the exp() and remainder() functions. */ +#undef exp +#define exp expo +#undef remainder +#define remainder rem + +#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && !WIDE_CHAR_VERSION +# if (HAVE_STRNLEN && !defined _AIX) +# define local_strnlen strnlen +# else +# ifndef local_strnlen_defined +# define local_strnlen_defined 1 +static size_t +local_strnlen (const char *string, size_t maxlen) +{ + const char *end = memchr (string, '\0', maxlen); + return end ? (size_t) (end - string) : maxlen; +} +# endif +# endif +#endif + +#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T +# if HAVE_WCSLEN +# define local_wcslen wcslen +# else + /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid + a dependency towards this library, here is a local substitute. + Define this substitute only once, even if this file is included + twice in the same compilation unit. */ +# ifndef local_wcslen_defined +# define local_wcslen_defined 1 +static size_t +local_wcslen (const wchar_t *s) +{ + const wchar_t *ptr; + + for (ptr = s; *ptr != (wchar_t) 0; ptr++) + ; + return ptr - s; +} +# endif +# endif +#endif + +#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && HAVE_WCHAR_T && WIDE_CHAR_VERSION +# if HAVE_WCSNLEN +# define local_wcsnlen wcsnlen +# else +# ifndef local_wcsnlen_defined +# define local_wcsnlen_defined 1 +static size_t +local_wcsnlen (const wchar_t *s, size_t maxlen) +{ + const wchar_t *ptr; + + for (ptr = s; maxlen > 0 && *ptr != (wchar_t) 0; ptr++, maxlen--) + ; + return ptr - s; +} +# endif +# endif +#endif + +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL +/* Determine the decimal-point character according to the current locale. */ +# ifndef decimal_point_char_defined +# define decimal_point_char_defined 1 +static char +decimal_point_char (void) +{ + const char *point; + /* Determine it in a multithread-safe way. We know nl_langinfo is + multithread-safe on glibc systems and Mac OS X systems, but is not required + to be multithread-safe by POSIX. sprintf(), however, is multithread-safe. + localeconv() is rarely multithread-safe. */ +# if HAVE_NL_LANGINFO && (__GLIBC__ || defined __UCLIBC__ || (defined __APPLE__ && defined __MACH__)) + point = nl_langinfo (RADIXCHAR); +# elif 1 + char pointbuf[5]; + sprintf (pointbuf, "%#.0f", 1.0); + point = &pointbuf[1]; +# else + point = localeconv () -> decimal_point; +# endif + /* The decimal point is always a single byte: either '.' or ','. */ + return (point[0] != '\0' ? point[0] : '.'); +} +# endif +#endif + +#if NEED_PRINTF_INFINITE_DOUBLE && !NEED_PRINTF_DOUBLE && !defined IN_LIBINTL + +/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */ +static int +is_infinite_or_zero (double x) +{ + return isnand (x) || x + x == x; +} + +#endif + +#if NEED_PRINTF_INFINITE_LONG_DOUBLE && !NEED_PRINTF_LONG_DOUBLE && !defined IN_LIBINTL + +/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */ +static int +is_infinite_or_zerol (long double x) +{ + return isnanl (x) || x + x == x; +} + +#endif + +#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL + +/* Converting 'long double' to decimal without rare rounding bugs requires + real bignums. We use the naming conventions of GNU gmp, but vastly simpler + (and slower) algorithms. */ + +typedef unsigned int mp_limb_t; +# define GMP_LIMB_BITS 32 +verify (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS); + +typedef unsigned long long mp_twolimb_t; +# define GMP_TWOLIMB_BITS 64 +verify (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS); + +/* Representation of a bignum >= 0. */ +typedef struct +{ + size_t nlimbs; + mp_limb_t *limbs; /* Bits in little-endian order, allocated with malloc(). */ +} mpn_t; + +/* Compute the product of two bignums >= 0. + Return the allocated memory in case of success, NULL in case of memory + allocation failure. */ +static void * +multiply (mpn_t src1, mpn_t src2, mpn_t *dest) +{ + const mp_limb_t *p1; + const mp_limb_t *p2; + size_t len1; + size_t len2; + + if (src1.nlimbs <= src2.nlimbs) + { + len1 = src1.nlimbs; + p1 = src1.limbs; + len2 = src2.nlimbs; + p2 = src2.limbs; + } + else + { + len1 = src2.nlimbs; + p1 = src2.limbs; + len2 = src1.nlimbs; + p2 = src1.limbs; + } + /* Now 0 <= len1 <= len2. */ + if (len1 == 0) + { + /* src1 or src2 is zero. */ + dest->nlimbs = 0; + dest->limbs = (mp_limb_t *) malloc (1); + } + else + { + /* Here 1 <= len1 <= len2. */ + size_t dlen; + mp_limb_t *dp; + size_t k, i, j; + + dlen = len1 + len2; + dp = (mp_limb_t *) malloc (dlen * sizeof (mp_limb_t)); + if (dp == NULL) + return NULL; + for (k = len2; k > 0; ) + dp[--k] = 0; + for (i = 0; i < len1; i++) + { + mp_limb_t digit1 = p1[i]; + mp_twolimb_t carry = 0; + for (j = 0; j < len2; j++) + { + mp_limb_t digit2 = p2[j]; + carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2; + carry += dp[i + j]; + dp[i + j] = (mp_limb_t) carry; + carry = carry >> GMP_LIMB_BITS; + } + dp[i + len2] = (mp_limb_t) carry; + } + /* Normalise. */ + while (dlen > 0 && dp[dlen - 1] == 0) + dlen--; + dest->nlimbs = dlen; + dest->limbs = dp; + } + return dest->limbs; +} + +/* Compute the quotient of a bignum a >= 0 and a bignum b > 0. + a is written as a = q * b + r with 0 <= r < b. q is the quotient, r + the remainder. + Finally, round-to-even is performed: If r > b/2 or if r = b/2 and q is odd, + q is incremented. + Return the allocated memory in case of success, NULL in case of memory + allocation failure. */ +static void * +divide (mpn_t a, mpn_t b, mpn_t *q) +{ + /* Algorithm: + First normalise a and b: a=[a[m-1],...,a[0]], b=[b[n-1],...,b[0]] + with m>=0 and n>0 (in base beta = 2^GMP_LIMB_BITS). + If m<n, then q:=0 and r:=a. + If m>=n=1, perform a single-precision division: + r:=0, j:=m, + while j>0 do + {Here (q[m-1]*beta^(m-1)+...+q[j]*beta^j) * b[0] + r*beta^j = + = a[m-1]*beta^(m-1)+...+a[j]*beta^j und 0<=r<b[0]<beta} + j:=j-1, r:=r*beta+a[j], q[j]:=floor(r/b[0]), r:=r-b[0]*q[j]. + Normalise [q[m-1],...,q[0]], yields q. + If m>=n>1, perform a multiple-precision division: + We have a/b < beta^(m-n+1). + s:=intDsize-1-(highest bit in b[n-1]), 0<=s<intDsize. + Shift a and b left by s bits, copying them. r:=a. + r=[r[m],...,r[0]], b=[b[n-1],...,b[0]] with b[n-1]>=beta/2. + For j=m-n,...,0: {Here 0 <= r < b*beta^(j+1).} + Compute q* : + q* := floor((r[j+n]*beta+r[j+n-1])/b[n-1]). + In case of overflow (q* >= beta) set q* := beta-1. + Compute c2 := ((r[j+n]*beta+r[j+n-1]) - q* * b[n-1])*beta + r[j+n-2] + and c3 := b[n-2] * q*. + {We have 0 <= c2 < 2*beta^2, even 0 <= c2 < beta^2 if no overflow + occurred. Furthermore 0 <= c3 < beta^2. + If there was overflow and + r[j+n]*beta+r[j+n-1] - q* * b[n-1] >= beta, i.e. c2 >= beta^2, + the next test can be skipped.} + While c3 > c2, {Here 0 <= c2 < c3 < beta^2} + Put q* := q* - 1, c2 := c2 + b[n-1]*beta, c3 := c3 - b[n-2]. + If q* > 0: + Put r := r - b * q* * beta^j. In detail: + [r[n+j],...,r[j]] := [r[n+j],...,r[j]] - q* * [b[n-1],...,b[0]]. + hence: u:=0, for i:=0 to n-1 do + u := u + q* * b[i], + r[j+i]:=r[j+i]-(u mod beta) (+ beta, if carry), + u:=u div beta (+ 1, if carry in subtraction) + r[n+j]:=r[n+j]-u. + {Since always u = (q* * [b[i-1],...,b[0]] div beta^i) + 1 + < q* + 1 <= beta, + the carry u does not overflow.} + If a negative carry occurs, put q* := q* - 1 + and [r[n+j],...,r[j]] := [r[n+j],...,r[j]] + [0,b[n-1],...,b[0]]. + Set q[j] := q*. + Normalise [q[m-n],..,q[0]]; this yields the quotient q. + Shift [r[n-1],...,r[0]] right by s bits and normalise; this yields the + rest r. + The room for q[j] can be allocated at the memory location of r[n+j]. + Finally, round-to-even: + Shift r left by 1 bit. + If r > b or if r = b and q[0] is odd, q := q+1. + */ + const mp_limb_t *a_ptr = a.limbs; + size_t a_len = a.nlimbs; + const mp_limb_t *b_ptr = b.limbs; + size_t b_len = b.nlimbs; + mp_limb_t *roomptr; + mp_limb_t *tmp_roomptr = NULL; + mp_limb_t *q_ptr; + size_t q_len; + mp_limb_t *r_ptr; + size_t r_len; + + /* Allocate room for a_len+2 digits. + (Need a_len+1 digits for the real division and 1 more digit for the + final rounding of q.) */ + roomptr = (mp_limb_t *) malloc ((a_len + 2) * sizeof (mp_limb_t)); + if (roomptr == NULL) + return NULL; + + /* Normalise a. */ + while (a_len > 0 && a_ptr[a_len - 1] == 0) + a_len--; + + /* Normalise b. */ + for (;;) + { + if (b_len == 0) + /* Division by zero. */ + abort (); + if (b_ptr[b_len - 1] == 0) + b_len--; + else + break; + } + + /* Here m = a_len >= 0 and n = b_len > 0. */ + + if (a_len < b_len) + { + /* m<n: trivial case. q=0, r := copy of a. */ + r_ptr = roomptr; + r_len = a_len; + memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t)); + q_ptr = roomptr + a_len; + q_len = 0; + } + else if (b_len == 1) + { + /* n=1: single precision division. + beta^(m-1) <= a < beta^m ==> beta^(m-2) <= a/b < beta^m */ + r_ptr = roomptr; + q_ptr = roomptr + 1; + { + mp_limb_t den = b_ptr[0]; + mp_limb_t remainder = 0; + const mp_limb_t *sourceptr = a_ptr + a_len; + mp_limb_t *destptr = q_ptr + a_len; + size_t count; + for (count = a_len; count > 0; count--) + { + mp_twolimb_t num = + ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--sourceptr; + *--destptr = num / den; + remainder = num % den; + } + /* Normalise and store r. */ + if (remainder > 0) + { + r_ptr[0] = remainder; + r_len = 1; + } + else + r_len = 0; + /* Normalise q. */ + q_len = a_len; + if (q_ptr[q_len - 1] == 0) + q_len--; + } + } + else + { + /* n>1: multiple precision division. + beta^(m-1) <= a < beta^m, beta^(n-1) <= b < beta^n ==> + beta^(m-n-1) <= a/b < beta^(m-n+1). */ + /* Determine s. */ + size_t s; + { + mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */ + /* Determine s = GMP_LIMB_BITS - integer_length (msd). + Code copied from gnulib's integer_length.c. */ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) + s = __builtin_clz (msd); +# else +# if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT + if (GMP_LIMB_BITS <= DBL_MANT_BIT) + { + /* Use 'double' operations. + Assumes an IEEE 754 'double' implementation. */ +# define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7) +# define DBL_EXP_BIAS (DBL_EXP_MASK / 2 - 1) +# define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) + union { double value; unsigned int word[NWORDS]; } m; + + /* Use a single integer to floating-point conversion. */ + m.value = msd; + + s = GMP_LIMB_BITS + - (((m.word[DBL_EXPBIT0_WORD] >> DBL_EXPBIT0_BIT) & DBL_EXP_MASK) + - DBL_EXP_BIAS); + } + else +# undef NWORDS +# endif + { + s = 31; + if (msd >= 0x10000) + { + msd = msd >> 16; + s -= 16; + } + if (msd >= 0x100) + { + msd = msd >> 8; + s -= 8; + } + if (msd >= 0x10) + { + msd = msd >> 4; + s -= 4; + } + if (msd >= 0x4) + { + msd = msd >> 2; + s -= 2; + } + if (msd >= 0x2) + { + msd = msd >> 1; + s -= 1; + } + } +# endif + } + /* 0 <= s < GMP_LIMB_BITS. + Copy b, shifting it left by s bits. */ + if (s > 0) + { + tmp_roomptr = (mp_limb_t *) malloc (b_len * sizeof (mp_limb_t)); + if (tmp_roomptr == NULL) + { + free (roomptr); + return NULL; + } + { + const mp_limb_t *sourceptr = b_ptr; + mp_limb_t *destptr = tmp_roomptr; + mp_twolimb_t accu = 0; + size_t count; + for (count = b_len; count > 0; count--) + { + accu += (mp_twolimb_t) *sourceptr++ << s; + *destptr++ = (mp_limb_t) accu; + accu = accu >> GMP_LIMB_BITS; + } + /* accu must be zero, since that was how s was determined. */ + if (accu != 0) + abort (); + } + b_ptr = tmp_roomptr; + } + /* Copy a, shifting it left by s bits, yields r. + Memory layout: + At the beginning: r = roomptr[0..a_len], + at the end: r = roomptr[0..b_len-1], q = roomptr[b_len..a_len] */ + r_ptr = roomptr; + if (s == 0) + { + memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t)); + r_ptr[a_len] = 0; + } + else + { + const mp_limb_t *sourceptr = a_ptr; + mp_limb_t *destptr = r_ptr; + mp_twolimb_t accu = 0; + size_t count; + for (count = a_len; count > 0; count--) + { + accu += (mp_twolimb_t) *sourceptr++ << s; + *destptr++ = (mp_limb_t) accu; + accu = accu >> GMP_LIMB_BITS; + } + *destptr++ = (mp_limb_t) accu; + } + q_ptr = roomptr + b_len; + q_len = a_len - b_len + 1; /* q will have m-n+1 limbs */ + { + size_t j = a_len - b_len; /* m-n */ + mp_limb_t b_msd = b_ptr[b_len - 1]; /* b[n-1] */ + mp_limb_t b_2msd = b_ptr[b_len - 2]; /* b[n-2] */ + mp_twolimb_t b_msdd = /* b[n-1]*beta+b[n-2] */ + ((mp_twolimb_t) b_msd << GMP_LIMB_BITS) | b_2msd; + /* Division loop, traversed m-n+1 times. + j counts down, b is unchanged, beta/2 <= b[n-1] < beta. */ + for (;;) + { + mp_limb_t q_star; + mp_limb_t c1; + if (r_ptr[j + b_len] < b_msd) /* r[j+n] < b[n-1] ? */ + { + /* Divide r[j+n]*beta+r[j+n-1] by b[n-1], no overflow. */ + mp_twolimb_t num = + ((mp_twolimb_t) r_ptr[j + b_len] << GMP_LIMB_BITS) + | r_ptr[j + b_len - 1]; + q_star = num / b_msd; + c1 = num % b_msd; + } + else + { + /* Overflow, hence r[j+n]*beta+r[j+n-1] >= beta*b[n-1]. */ + q_star = (mp_limb_t)~(mp_limb_t)0; /* q* = beta-1 */ + /* Test whether r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] >= beta + <==> r[j+n]*beta+r[j+n-1] + b[n-1] >= beta*b[n-1]+beta + <==> b[n-1] < floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta) + {<= beta !}. + If yes, jump directly to the subtraction loop. + (Otherwise, r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] < beta + <==> floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta) = b[n-1] ) */ + if (r_ptr[j + b_len] > b_msd + || (c1 = r_ptr[j + b_len - 1] + b_msd) < b_msd) + /* r[j+n] >= b[n-1]+1 or + r[j+n] = b[n-1] and the addition r[j+n-1]+b[n-1] gives a + carry. */ + goto subtract; + } + /* q_star = q*, + c1 = (r[j+n]*beta+r[j+n-1]) - q* * b[n-1] (>=0, <beta). */ + { + mp_twolimb_t c2 = /* c1*beta+r[j+n-2] */ + ((mp_twolimb_t) c1 << GMP_LIMB_BITS) | r_ptr[j + b_len - 2]; + mp_twolimb_t c3 = /* b[n-2] * q* */ + (mp_twolimb_t) b_2msd * (mp_twolimb_t) q_star; + /* While c2 < c3, increase c2 and decrease c3. + Consider c3-c2. While it is > 0, decrease it by + b[n-1]*beta+b[n-2]. Because of b[n-1]*beta+b[n-2] >= beta^2/2 + this can happen only twice. */ + if (c3 > c2) + { + q_star = q_star - 1; /* q* := q* - 1 */ + if (c3 - c2 > b_msdd) + q_star = q_star - 1; /* q* := q* - 1 */ + } + } + if (q_star > 0) + subtract: + { + /* Subtract r := r - b * q* * beta^j. */ + mp_limb_t cr; + { + const mp_limb_t *sourceptr = b_ptr; + mp_limb_t *destptr = r_ptr + j; + mp_twolimb_t carry = 0; + size_t count; + for (count = b_len; count > 0; count--) + { + /* Here 0 <= carry <= q*. */ + carry = + carry + + (mp_twolimb_t) q_star * (mp_twolimb_t) *sourceptr++ + + (mp_limb_t) ~(*destptr); + /* Here 0 <= carry <= beta*q* + beta-1. */ + *destptr++ = ~(mp_limb_t) carry; + carry = carry >> GMP_LIMB_BITS; /* <= q* */ + } + cr = (mp_limb_t) carry; + } + /* Subtract cr from r_ptr[j + b_len], then forget about + r_ptr[j + b_len]. */ + if (cr > r_ptr[j + b_len]) + { + /* Subtraction gave a carry. */ + q_star = q_star - 1; /* q* := q* - 1 */ + /* Add b back. */ + { + const mp_limb_t *sourceptr = b_ptr; + mp_limb_t *destptr = r_ptr + j; + mp_limb_t carry = 0; + size_t count; + for (count = b_len; count > 0; count--) + { + mp_limb_t source1 = *sourceptr++; + mp_limb_t source2 = *destptr; + *destptr++ = source1 + source2 + carry; + carry = + (carry + ? source1 >= (mp_limb_t) ~source2 + : source1 > (mp_limb_t) ~source2); + } + } + /* Forget about the carry and about r[j+n]. */ + } + } + /* q* is determined. Store it as q[j]. */ + q_ptr[j] = q_star; + if (j == 0) + break; + j--; + } + } + r_len = b_len; + /* Normalise q. */ + if (q_ptr[q_len - 1] == 0) + q_len--; +# if 0 /* Not needed here, since we need r only to compare it with b/2, and + b is shifted left by s bits. */ + /* Shift r right by s bits. */ + if (s > 0) + { + mp_limb_t ptr = r_ptr + r_len; + mp_twolimb_t accu = 0; + size_t count; + for (count = r_len; count > 0; count--) + { + accu = (mp_twolimb_t) (mp_limb_t) accu << GMP_LIMB_BITS; + accu += (mp_twolimb_t) *--ptr << (GMP_LIMB_BITS - s); + *ptr = (mp_limb_t) (accu >> GMP_LIMB_BITS); + } + } +# endif + /* Normalise r. */ + while (r_len > 0 && r_ptr[r_len - 1] == 0) + r_len--; + } + /* Compare r << 1 with b. */ + if (r_len > b_len) + goto increment_q; + { + size_t i; + for (i = b_len;;) + { + mp_limb_t r_i = + (i <= r_len && i > 0 ? r_ptr[i - 1] >> (GMP_LIMB_BITS - 1) : 0) + | (i < r_len ? r_ptr[i] << 1 : 0); + mp_limb_t b_i = (i < b_len ? b_ptr[i] : 0); + if (r_i > b_i) + goto increment_q; + if (r_i < b_i) + goto keep_q; + if (i == 0) + break; + i--; + } + } + if (q_len > 0 && ((q_ptr[0] & 1) != 0)) + /* q is odd. */ + increment_q: + { + size_t i; + for (i = 0; i < q_len; i++) + if (++(q_ptr[i]) != 0) + goto keep_q; + q_ptr[q_len++] = 1; + } + keep_q: + if (tmp_roomptr != NULL) + free (tmp_roomptr); + q->limbs = q_ptr; + q->nlimbs = q_len; + return roomptr; +} + +/* Convert a bignum a >= 0, multiplied with 10^extra_zeroes, to decimal + representation. + Destroys the contents of a. + Return the allocated memory - containing the decimal digits in low-to-high + order, terminated with a NUL character - in case of success, NULL in case + of memory allocation failure. */ +static char * +convert_to_decimal (mpn_t a, size_t extra_zeroes) +{ + mp_limb_t *a_ptr = a.limbs; + size_t a_len = a.nlimbs; + /* 0.03345 is slightly larger than log(2)/(9*log(10)). */ + size_t c_len = 9 * ((size_t)(a_len * (GMP_LIMB_BITS * 0.03345f)) + 1); + char *c_ptr = (char *) malloc (xsum (c_len, extra_zeroes)); + if (c_ptr != NULL) + { + char *d_ptr = c_ptr; + for (; extra_zeroes > 0; extra_zeroes--) + *d_ptr++ = '0'; + while (a_len > 0) + { + /* Divide a by 10^9, in-place. */ + mp_limb_t remainder = 0; + mp_limb_t *ptr = a_ptr + a_len; + size_t count; + for (count = a_len; count > 0; count--) + { + mp_twolimb_t num = + ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--ptr; + *ptr = num / 1000000000; + remainder = num % 1000000000; + } + /* Store the remainder as 9 decimal digits. */ + for (count = 9; count > 0; count--) + { + *d_ptr++ = '0' + (remainder % 10); + remainder = remainder / 10; + } + /* Normalize a. */ + if (a_ptr[a_len - 1] == 0) + a_len--; + } + /* Remove leading zeroes. */ + while (d_ptr > c_ptr && d_ptr[-1] == '0') + d_ptr--; + /* But keep at least one zero. */ + if (d_ptr == c_ptr) + *d_ptr++ = '0'; + /* Terminate the string. */ + *d_ptr = '\0'; + } + return c_ptr; +} + +# if NEED_PRINTF_LONG_DOUBLE + +/* Assuming x is finite and >= 0: + write x as x = 2^e * m, where m is a bignum. + Return the allocated memory in case of success, NULL in case of memory + allocation failure. */ +static void * +decode_long_double (long double x, int *ep, mpn_t *mp) +{ + mpn_t m; + int exp; + long double y; + size_t i; + + /* Allocate memory for result. */ + m.nlimbs = (LDBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS; + m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t)); + if (m.limbs == NULL) + return NULL; + /* Split into exponential part and mantissa. */ + y = frexpl (x, &exp); + if (!(y >= 0.0L && y < 1.0L)) + abort (); + /* x = 2^exp * y = 2^(exp - LDBL_MANT_BIT) * (y * 2^LDBL_MANT_BIT), and the + latter is an integer. */ + /* Convert the mantissa (y * 2^LDBL_MANT_BIT) to a sequence of limbs. + I'm not sure whether it's safe to cast a 'long double' value between + 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only + 'long double' values between 0 and 2^16 (to 'unsigned int' or 'int', + doesn't matter). */ +# if (LDBL_MANT_BIT % GMP_LIMB_BITS) != 0 +# if (LDBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2 + { + mp_limb_t hi, lo; + y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % (GMP_LIMB_BITS / 2)); + hi = (int) y; + y -= hi; + if (!(y >= 0.0L && y < 1.0L)) + abort (); + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + lo = (int) y; + y -= lo; + if (!(y >= 0.0L && y < 1.0L)) + abort (); + m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo; + } +# else + { + mp_limb_t d; + y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % GMP_LIMB_BITS); + d = (int) y; + y -= d; + if (!(y >= 0.0L && y < 1.0L)) + abort (); + m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = d; + } +# endif +# endif + for (i = LDBL_MANT_BIT / GMP_LIMB_BITS; i > 0; ) + { + mp_limb_t hi, lo; + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + hi = (int) y; + y -= hi; + if (!(y >= 0.0L && y < 1.0L)) + abort (); + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + lo = (int) y; + y -= lo; + if (!(y >= 0.0L && y < 1.0L)) + abort (); + m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo; + } +# if 0 /* On FreeBSD 6.1/x86, 'long double' numbers sometimes have excess + precision. */ + if (!(y == 0.0L)) + abort (); +# endif + /* Normalise. */ + while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0) + m.nlimbs--; + *mp = m; + *ep = exp - LDBL_MANT_BIT; + return m.limbs; +} + +# endif + +# if NEED_PRINTF_DOUBLE + +/* Assuming x is finite and >= 0: + write x as x = 2^e * m, where m is a bignum. + Return the allocated memory in case of success, NULL in case of memory + allocation failure. */ +static void * +decode_double (double x, int *ep, mpn_t *mp) +{ + mpn_t m; + int exp; + double y; + size_t i; + + /* Allocate memory for result. */ + m.nlimbs = (DBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS; + m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t)); + if (m.limbs == NULL) + return NULL; + /* Split into exponential part and mantissa. */ + y = frexp (x, &exp); + if (!(y >= 0.0 && y < 1.0)) + abort (); + /* x = 2^exp * y = 2^(exp - DBL_MANT_BIT) * (y * 2^DBL_MANT_BIT), and the + latter is an integer. */ + /* Convert the mantissa (y * 2^DBL_MANT_BIT) to a sequence of limbs. + I'm not sure whether it's safe to cast a 'double' value between + 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only + 'double' values between 0 and 2^16 (to 'unsigned int' or 'int', + doesn't matter). */ +# if (DBL_MANT_BIT % GMP_LIMB_BITS) != 0 +# if (DBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2 + { + mp_limb_t hi, lo; + y *= (mp_limb_t) 1 << (DBL_MANT_BIT % (GMP_LIMB_BITS / 2)); + hi = (int) y; + y -= hi; + if (!(y >= 0.0 && y < 1.0)) + abort (); + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + lo = (int) y; + y -= lo; + if (!(y >= 0.0 && y < 1.0)) + abort (); + m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo; + } +# else + { + mp_limb_t d; + y *= (mp_limb_t) 1 << (DBL_MANT_BIT % GMP_LIMB_BITS); + d = (int) y; + y -= d; + if (!(y >= 0.0 && y < 1.0)) + abort (); + m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = d; + } +# endif +# endif + for (i = DBL_MANT_BIT / GMP_LIMB_BITS; i > 0; ) + { + mp_limb_t hi, lo; + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + hi = (int) y; + y -= hi; + if (!(y >= 0.0 && y < 1.0)) + abort (); + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + lo = (int) y; + y -= lo; + if (!(y >= 0.0 && y < 1.0)) + abort (); + m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo; + } + if (!(y == 0.0)) + abort (); + /* Normalise. */ + while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0) + m.nlimbs--; + *mp = m; + *ep = exp - DBL_MANT_BIT; + return m.limbs; +} + +# endif + +/* Assuming x = 2^e * m is finite and >= 0, and n is an integer: + Returns the decimal representation of round (x * 10^n). + Return the allocated memory - containing the decimal digits in low-to-high + order, terminated with a NUL character - in case of success, NULL in case + of memory allocation failure. */ +static char * +scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n) +{ + int s; + size_t extra_zeroes; + unsigned int abs_n; + unsigned int abs_s; + mp_limb_t *pow5_ptr; + size_t pow5_len; + unsigned int s_limbs; + unsigned int s_bits; + mpn_t pow5; + mpn_t z; + void *z_memory; + char *digits; + + if (memory == NULL) + return NULL; + /* x = 2^e * m, hence + y = round (2^e * 10^n * m) = round (2^(e+n) * 5^n * m) + = round (2^s * 5^n * m). */ + s = e + n; + extra_zeroes = 0; + /* Factor out a common power of 10 if possible. */ + if (s > 0 && n > 0) + { + extra_zeroes = (s < n ? s : n); + s -= extra_zeroes; + n -= extra_zeroes; + } + /* Here y = round (2^s * 5^n * m) * 10^extra_zeroes. + Before converting to decimal, we need to compute + z = round (2^s * 5^n * m). */ + /* Compute 5^|n|, possibly shifted by |s| bits if n and s have the same + sign. 2.322 is slightly larger than log(5)/log(2). */ + abs_n = (n >= 0 ? n : -n); + abs_s = (s >= 0 ? s : -s); + pow5_ptr = (mp_limb_t *) malloc (((int)(abs_n * (2.322f / GMP_LIMB_BITS)) + 1 + + abs_s / GMP_LIMB_BITS + 1) + * sizeof (mp_limb_t)); + if (pow5_ptr == NULL) + { + free (memory); + return NULL; + } + /* Initialize with 1. */ + pow5_ptr[0] = 1; + pow5_len = 1; + /* Multiply with 5^|n|. */ + if (abs_n > 0) + { + static mp_limb_t const small_pow5[13 + 1] = + { + 1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625, + 48828125, 244140625, 1220703125 + }; + unsigned int n13; + for (n13 = 0; n13 <= abs_n; n13 += 13) + { + mp_limb_t digit1 = small_pow5[n13 + 13 <= abs_n ? 13 : abs_n - n13]; + size_t j; + mp_twolimb_t carry = 0; + for (j = 0; j < pow5_len; j++) + { + mp_limb_t digit2 = pow5_ptr[j]; + carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2; + pow5_ptr[j] = (mp_limb_t) carry; + carry = carry >> GMP_LIMB_BITS; + } + if (carry > 0) + pow5_ptr[pow5_len++] = (mp_limb_t) carry; + } + } + s_limbs = abs_s / GMP_LIMB_BITS; + s_bits = abs_s % GMP_LIMB_BITS; + if (n >= 0 ? s >= 0 : s <= 0) + { + /* Multiply with 2^|s|. */ + if (s_bits > 0) + { + mp_limb_t *ptr = pow5_ptr; + mp_twolimb_t accu = 0; + size_t count; + for (count = pow5_len; count > 0; count--) + { + accu += (mp_twolimb_t) *ptr << s_bits; + *ptr++ = (mp_limb_t) accu; + accu = accu >> GMP_LIMB_BITS; + } + if (accu > 0) + { + *ptr = (mp_limb_t) accu; + pow5_len++; + } + } + if (s_limbs > 0) + { + size_t count; + for (count = pow5_len; count > 0;) + { + count--; + pow5_ptr[s_limbs + count] = pow5_ptr[count]; + } + for (count = s_limbs; count > 0;) + { + count--; + pow5_ptr[count] = 0; + } + pow5_len += s_limbs; + } + pow5.limbs = pow5_ptr; + pow5.nlimbs = pow5_len; + if (n >= 0) + { + /* Multiply m with pow5. No division needed. */ + z_memory = multiply (m, pow5, &z); + } + else + { + /* Divide m by pow5 and round. */ + z_memory = divide (m, pow5, &z); + } + } + else + { + pow5.limbs = pow5_ptr; + pow5.nlimbs = pow5_len; + if (n >= 0) + { + /* n >= 0, s < 0. + Multiply m with pow5, then divide by 2^|s|. */ + mpn_t numerator; + mpn_t denominator; + void *tmp_memory; + tmp_memory = multiply (m, pow5, &numerator); + if (tmp_memory == NULL) + { + free (pow5_ptr); + free (memory); + return NULL; + } + /* Construct 2^|s|. */ + { + mp_limb_t *ptr = pow5_ptr + pow5_len; + size_t i; + for (i = 0; i < s_limbs; i++) + ptr[i] = 0; + ptr[s_limbs] = (mp_limb_t) 1 << s_bits; + denominator.limbs = ptr; + denominator.nlimbs = s_limbs + 1; + } + z_memory = divide (numerator, denominator, &z); + free (tmp_memory); + } + else + { + /* n < 0, s > 0. + Multiply m with 2^s, then divide by pow5. */ + mpn_t numerator; + mp_limb_t *num_ptr; + num_ptr = (mp_limb_t *) malloc ((m.nlimbs + s_limbs + 1) + * sizeof (mp_limb_t)); + if (num_ptr == NULL) + { + free (pow5_ptr); + free (memory); + return NULL; + } + { + mp_limb_t *destptr = num_ptr; + { + size_t i; + for (i = 0; i < s_limbs; i++) + *destptr++ = 0; + } + if (s_bits > 0) + { + const mp_limb_t *sourceptr = m.limbs; + mp_twolimb_t accu = 0; + size_t count; + for (count = m.nlimbs; count > 0; count--) + { + accu += (mp_twolimb_t) *sourceptr++ << s_bits; + *destptr++ = (mp_limb_t) accu; + accu = accu >> GMP_LIMB_BITS; + } + if (accu > 0) + *destptr++ = (mp_limb_t) accu; + } + else + { + const mp_limb_t *sourceptr = m.limbs; + size_t count; + for (count = m.nlimbs; count > 0; count--) + *destptr++ = *sourceptr++; + } + numerator.limbs = num_ptr; + numerator.nlimbs = destptr - num_ptr; + } + z_memory = divide (numerator, pow5, &z); + free (num_ptr); + } + } + free (pow5_ptr); + free (memory); + + /* Here y = round (x * 10^n) = z * 10^extra_zeroes. */ + + if (z_memory == NULL) + return NULL; + digits = convert_to_decimal (z, extra_zeroes); + free (z_memory); + return digits; +} + +# if NEED_PRINTF_LONG_DOUBLE + +/* Assuming x is finite and >= 0, and n is an integer: + Returns the decimal representation of round (x * 10^n). + Return the allocated memory - containing the decimal digits in low-to-high + order, terminated with a NUL character - in case of success, NULL in case + of memory allocation failure. */ +static char * +scale10_round_decimal_long_double (long double x, int n) +{ + int e IF_LINT(= 0); + mpn_t m; + void *memory = decode_long_double (x, &e, &m); + return scale10_round_decimal_decoded (e, m, memory, n); +} + +# endif + +# if NEED_PRINTF_DOUBLE + +/* Assuming x is finite and >= 0, and n is an integer: + Returns the decimal representation of round (x * 10^n). + Return the allocated memory - containing the decimal digits in low-to-high + order, terminated with a NUL character - in case of success, NULL in case + of memory allocation failure. */ +static char * +scale10_round_decimal_double (double x, int n) +{ + int e IF_LINT(= 0); + mpn_t m; + void *memory = decode_double (x, &e, &m); + return scale10_round_decimal_decoded (e, m, memory, n); +} + +# endif + +# if NEED_PRINTF_LONG_DOUBLE + +/* Assuming x is finite and > 0: + Return an approximation for n with 10^n <= x < 10^(n+1). + The approximation is usually the right n, but may be off by 1 sometimes. */ +static int +floorlog10l (long double x) +{ + int exp; + long double y; + double z; + double l; + + /* Split into exponential part and mantissa. */ + y = frexpl (x, &exp); + if (!(y >= 0.0L && y < 1.0L)) + abort (); + if (y == 0.0L) + return INT_MIN; + if (y < 0.5L) + { + while (y < (1.0L / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2)))) + { + y *= 1.0L * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2)); + exp -= GMP_LIMB_BITS; + } + if (y < (1.0L / (1 << 16))) + { + y *= 1.0L * (1 << 16); + exp -= 16; + } + if (y < (1.0L / (1 << 8))) + { + y *= 1.0L * (1 << 8); + exp -= 8; + } + if (y < (1.0L / (1 << 4))) + { + y *= 1.0L * (1 << 4); + exp -= 4; + } + if (y < (1.0L / (1 << 2))) + { + y *= 1.0L * (1 << 2); + exp -= 2; + } + if (y < (1.0L / (1 << 1))) + { + y *= 1.0L * (1 << 1); + exp -= 1; + } + } + if (!(y >= 0.5L && y < 1.0L)) + abort (); + /* Compute an approximation for l = log2(x) = exp + log2(y). */ + l = exp; + z = y; + if (z < 0.70710678118654752444) + { + z *= 1.4142135623730950488; + l -= 0.5; + } + if (z < 0.8408964152537145431) + { + z *= 1.1892071150027210667; + l -= 0.25; + } + if (z < 0.91700404320467123175) + { + z *= 1.0905077326652576592; + l -= 0.125; + } + if (z < 0.9576032806985736469) + { + z *= 1.0442737824274138403; + l -= 0.0625; + } + /* Now 0.95 <= z <= 1.01. */ + z = 1 - z; + /* log2(1-z) = 1/log(2) * (- z - z^2/2 - z^3/3 - z^4/4 - ...) + Four terms are enough to get an approximation with error < 10^-7. */ + l -= 1.4426950408889634074 * z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25))); + /* Finally multiply with log(2)/log(10), yields an approximation for + log10(x). */ + l *= 0.30102999566398119523; + /* Round down to the next integer. */ + return (int) l + (l < 0 ? -1 : 0); +} + +# endif + +# if NEED_PRINTF_DOUBLE + +/* Assuming x is finite and > 0: + Return an approximation for n with 10^n <= x < 10^(n+1). + The approximation is usually the right n, but may be off by 1 sometimes. */ +static int +floorlog10 (double x) +{ + int exp; + double y; + double z; + double l; + + /* Split into exponential part and mantissa. */ + y = frexp (x, &exp); + if (!(y >= 0.0 && y < 1.0)) + abort (); + if (y == 0.0) + return INT_MIN; + if (y < 0.5) + { + while (y < (1.0 / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2)))) + { + y *= 1.0 * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2)); + exp -= GMP_LIMB_BITS; + } + if (y < (1.0 / (1 << 16))) + { + y *= 1.0 * (1 << 16); + exp -= 16; + } + if (y < (1.0 / (1 << 8))) + { + y *= 1.0 * (1 << 8); + exp -= 8; + } + if (y < (1.0 / (1 << 4))) + { + y *= 1.0 * (1 << 4); + exp -= 4; + } + if (y < (1.0 / (1 << 2))) + { + y *= 1.0 * (1 << 2); + exp -= 2; + } + if (y < (1.0 / (1 << 1))) + { + y *= 1.0 * (1 << 1); + exp -= 1; + } + } + if (!(y >= 0.5 && y < 1.0)) + abort (); + /* Compute an approximation for l = log2(x) = exp + log2(y). */ + l = exp; + z = y; + if (z < 0.70710678118654752444) + { + z *= 1.4142135623730950488; + l -= 0.5; + } + if (z < 0.8408964152537145431) + { + z *= 1.1892071150027210667; + l -= 0.25; + } + if (z < 0.91700404320467123175) + { + z *= 1.0905077326652576592; + l -= 0.125; + } + if (z < 0.9576032806985736469) + { + z *= 1.0442737824274138403; + l -= 0.0625; + } + /* Now 0.95 <= z <= 1.01. */ + z = 1 - z; + /* log2(1-z) = 1/log(2) * (- z - z^2/2 - z^3/3 - z^4/4 - ...) + Four terms are enough to get an approximation with error < 10^-7. */ + l -= 1.4426950408889634074 * z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25))); + /* Finally multiply with log(2)/log(10), yields an approximation for + log10(x). */ + l *= 0.30102999566398119523; + /* Round down to the next integer. */ + return (int) l + (l < 0 ? -1 : 0); +} + +# endif + +/* Tests whether a string of digits consists of exactly PRECISION zeroes and + a single '1' digit. */ +static int +is_borderline (const char *digits, size_t precision) +{ + for (; precision > 0; precision--, digits++) + if (*digits != '0') + return 0; + if (*digits != '1') + return 0; + digits++; + return *digits == '\0'; +} + +#endif + +#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF + +/* Use a different function name, to make it possible that the 'wchar_t' + parametrization and the 'char' parametrization get compiled in the same + translation unit. */ +# if WIDE_CHAR_VERSION +# define MAX_ROOM_NEEDED wmax_room_needed +# else +# define MAX_ROOM_NEEDED max_room_needed +# endif + +/* Returns the number of TCHAR_T units needed as temporary space for the result + of sprintf or SNPRINTF of a single conversion directive. */ +static size_t +MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion, + arg_type type, int flags, size_t width, int has_precision, + size_t precision, int pad_ourselves) +{ + size_t tmp_length; + + switch (conversion) + { + case 'd': case 'i': case 'u': +# if HAVE_LONG_LONG_INT + if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long long) * CHAR_BIT + * 0.30103 /* binary -> decimal */ + ) + + 1; /* turn floor into ceil */ + else +# endif + if (type == TYPE_LONGINT || type == TYPE_ULONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long) * CHAR_BIT + * 0.30103 /* binary -> decimal */ + ) + + 1; /* turn floor into ceil */ + else + tmp_length = + (unsigned int) (sizeof (unsigned int) * CHAR_BIT + * 0.30103 /* binary -> decimal */ + ) + + 1; /* turn floor into ceil */ + if (tmp_length < precision) + tmp_length = precision; + /* Multiply by 2, as an estimate for FLAG_GROUP. */ + tmp_length = xsum (tmp_length, tmp_length); + /* Add 1, to account for a leading sign. */ + tmp_length = xsum (tmp_length, 1); + break; + + case 'o': +# if HAVE_LONG_LONG_INT + if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long long) * CHAR_BIT + * 0.333334 /* binary -> octal */ + ) + + 1; /* turn floor into ceil */ + else +# endif + if (type == TYPE_LONGINT || type == TYPE_ULONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long) * CHAR_BIT + * 0.333334 /* binary -> octal */ + ) + + 1; /* turn floor into ceil */ + else + tmp_length = + (unsigned int) (sizeof (unsigned int) * CHAR_BIT + * 0.333334 /* binary -> octal */ + ) + + 1; /* turn floor into ceil */ + if (tmp_length < precision) + tmp_length = precision; + /* Add 1, to account for a leading sign. */ + tmp_length = xsum (tmp_length, 1); + break; + + case 'x': case 'X': +# if HAVE_LONG_LONG_INT + if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long long) * CHAR_BIT + * 0.25 /* binary -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + else +# endif + if (type == TYPE_LONGINT || type == TYPE_ULONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long) * CHAR_BIT + * 0.25 /* binary -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + else + tmp_length = + (unsigned int) (sizeof (unsigned int) * CHAR_BIT + * 0.25 /* binary -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + if (tmp_length < precision) + tmp_length = precision; + /* Add 2, to account for a leading sign or alternate form. */ + tmp_length = xsum (tmp_length, 2); + break; + + case 'f': case 'F': + if (type == TYPE_LONGDOUBLE) + tmp_length = + (unsigned int) (LDBL_MAX_EXP + * 0.30103 /* binary -> decimal */ + * 2 /* estimate for FLAG_GROUP */ + ) + + 1 /* turn floor into ceil */ + + 10; /* sign, decimal point etc. */ + else + tmp_length = + (unsigned int) (DBL_MAX_EXP + * 0.30103 /* binary -> decimal */ + * 2 /* estimate for FLAG_GROUP */ + ) + + 1 /* turn floor into ceil */ + + 10; /* sign, decimal point etc. */ + tmp_length = xsum (tmp_length, precision); + break; + + case 'e': case 'E': case 'g': case 'G': + tmp_length = + 12; /* sign, decimal point, exponent etc. */ + tmp_length = xsum (tmp_length, precision); + break; + + case 'a': case 'A': + if (type == TYPE_LONGDOUBLE) + tmp_length = + (unsigned int) (LDBL_DIG + * 0.831 /* decimal -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + else + tmp_length = + (unsigned int) (DBL_DIG + * 0.831 /* decimal -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + if (tmp_length < precision) + tmp_length = precision; + /* Account for sign, decimal point etc. */ + tmp_length = xsum (tmp_length, 12); + break; + + case 'c': +# if HAVE_WINT_T && !WIDE_CHAR_VERSION + if (type == TYPE_WIDE_CHAR) + tmp_length = MB_CUR_MAX; + else +# endif + tmp_length = 1; + break; + + case 's': +# if HAVE_WCHAR_T + if (type == TYPE_WIDE_STRING) + { +# if WIDE_CHAR_VERSION + /* ISO C says about %ls in fwprintf: + "If the precision is not specified or is greater than the size + of the array, the array shall contain a null wide character." + So if there is a precision, we must not use wcslen. */ + const wchar_t *arg = ap->arg[arg_index].a.a_wide_string; + + if (has_precision) + tmp_length = local_wcsnlen (arg, precision); + else + tmp_length = local_wcslen (arg); +# else + /* ISO C says about %ls in fprintf: + "If a precision is specified, no more than that many bytes are + written (including shift sequences, if any), and the array + shall contain a null wide character if, to equal the multibyte + character sequence length given by the precision, the function + would need to access a wide character one past the end of the + array." + So if there is a precision, we must not use wcslen. */ + /* This case has already been handled separately in VASNPRINTF. */ + abort (); +# endif + } + else +# endif + { +# if WIDE_CHAR_VERSION + /* ISO C says about %s in fwprintf: + "If the precision is not specified or is greater than the size + of the converted array, the converted array shall contain a + null wide character." + So if there is a precision, we must not use strlen. */ + /* This case has already been handled separately in VASNPRINTF. */ + abort (); +# else + /* ISO C says about %s in fprintf: + "If the precision is not specified or greater than the size of + the array, the array shall contain a null character." + So if there is a precision, we must not use strlen. */ + const char *arg = ap->arg[arg_index].a.a_string; + + if (has_precision) + tmp_length = local_strnlen (arg, precision); + else + tmp_length = strlen (arg); +# endif + } + break; + + case 'p': + tmp_length = + (unsigned int) (sizeof (void *) * CHAR_BIT + * 0.25 /* binary -> hexadecimal */ + ) + + 1 /* turn floor into ceil */ + + 2; /* account for leading 0x */ + break; + + default: + abort (); + } + + if (!pad_ourselves) + { +# if ENABLE_UNISTDIO + /* Padding considers the number of characters, therefore the number of + elements after padding may be + > max (tmp_length, width) + but is certainly + <= tmp_length + width. */ + tmp_length = xsum (tmp_length, width); +# else + /* Padding considers the number of elements, says POSIX. */ + if (tmp_length < width) + tmp_length = width; +# endif + } + + tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ + + return tmp_length; +} + +#endif + +DCHAR_T * +VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + const FCHAR_T *format, va_list args) +{ + DIRECTIVES d; + arguments a; + + if (PRINTF_PARSE (format, &d, &a) < 0) + /* errno is already set. */ + return NULL; + +#define CLEANUP() \ + if (d.dir != d.direct_alloc_dir) \ + free (d.dir); \ + if (a.arg != a.direct_alloc_arg) \ + free (a.arg); + + if (PRINTF_FETCHARGS (args, &a) < 0) + { + CLEANUP (); + errno = EINVAL; + return NULL; + } + + { + size_t buf_neededlength; + TCHAR_T *buf; + TCHAR_T *buf_malloced; + const FCHAR_T *cp; + size_t i; + DIRECTIVE *dp; + /* Output string accumulator. */ + DCHAR_T *result; + size_t allocated; + size_t length; + + /* Allocate a small buffer that will hold a directive passed to + sprintf or snprintf. */ + buf_neededlength = + xsum4 (7, d.max_width_length, d.max_precision_length, 6); +#if HAVE_ALLOCA + if (buf_neededlength < 4000 / sizeof (TCHAR_T)) + { + buf = (TCHAR_T *) alloca (buf_neededlength * sizeof (TCHAR_T)); + buf_malloced = NULL; + } + else +#endif + { + size_t buf_memsize = xtimes (buf_neededlength, sizeof (TCHAR_T)); + if (size_overflow_p (buf_memsize)) + goto out_of_memory_1; + buf = (TCHAR_T *) malloc (buf_memsize); + if (buf == NULL) + goto out_of_memory_1; + buf_malloced = buf; + } + + if (resultbuf != NULL) + { + result = resultbuf; + allocated = *lengthp; + } + else + { + result = NULL; + allocated = 0; + } + length = 0; + /* Invariants: + result is either == resultbuf or == NULL or malloc-allocated. + If length > 0, then result != NULL. */ + + /* Ensures that allocated >= needed. Aborts through a jump to + out_of_memory if needed is SIZE_MAX or otherwise too big. */ +#define ENSURE_ALLOCATION(needed) \ + if ((needed) > allocated) \ + { \ + size_t memory_size; \ + DCHAR_T *memory; \ + \ + allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \ + if ((needed) > allocated) \ + allocated = (needed); \ + memory_size = xtimes (allocated, sizeof (DCHAR_T)); \ + if (size_overflow_p (memory_size)) \ + goto out_of_memory; \ + if (result == resultbuf || result == NULL) \ + memory = (DCHAR_T *) malloc (memory_size); \ + else \ + memory = (DCHAR_T *) realloc (result, memory_size); \ + if (memory == NULL) \ + goto out_of_memory; \ + if (result == resultbuf && length > 0) \ + DCHAR_CPY (memory, result, length); \ + result = memory; \ + } + + for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++) + { + if (cp != dp->dir_start) + { + size_t n = dp->dir_start - cp; + size_t augmented_length = xsum (length, n); + + ENSURE_ALLOCATION (augmented_length); + /* This copies a piece of FCHAR_T[] into a DCHAR_T[]. Here we + need that the format string contains only ASCII characters + if FCHAR_T and DCHAR_T are not the same type. */ + if (sizeof (FCHAR_T) == sizeof (DCHAR_T)) + { + DCHAR_CPY (result + length, (const DCHAR_T *) cp, n); + length = augmented_length; + } + else + { + do + result[length++] = *cp++; + while (--n > 0); + } + } + if (i == d.count) + break; + + /* Execute a single directive. */ + if (dp->conversion == '%') + { + size_t augmented_length; + + if (!(dp->arg_index == ARG_NONE)) + abort (); + augmented_length = xsum (length, 1); + ENSURE_ALLOCATION (augmented_length); + result[length] = '%'; + length = augmented_length; + } + else + { + if (!(dp->arg_index != ARG_NONE)) + abort (); + + if (dp->conversion == 'n') + { + switch (a.arg[dp->arg_index].type) + { + case TYPE_COUNT_SCHAR_POINTER: + *a.arg[dp->arg_index].a.a_count_schar_pointer = length; + break; + case TYPE_COUNT_SHORT_POINTER: + *a.arg[dp->arg_index].a.a_count_short_pointer = length; + break; + case TYPE_COUNT_INT_POINTER: + *a.arg[dp->arg_index].a.a_count_int_pointer = length; + break; + case TYPE_COUNT_LONGINT_POINTER: + *a.arg[dp->arg_index].a.a_count_longint_pointer = length; + break; +#if HAVE_LONG_LONG_INT + case TYPE_COUNT_LONGLONGINT_POINTER: + *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length; + break; +#endif + default: + abort (); + } + } +#if ENABLE_UNISTDIO + /* The unistdio extensions. */ + else if (dp->conversion == 'U') + { + arg_type type = a.arg[dp->arg_index].type; + int flags = dp->flags; + int has_width; + size_t width; + int has_precision; + size_t precision; + + has_width = 0; + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + width = arg; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = -width; + } + } + else + { + const FCHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } + has_width = 1; + } + + has_precision = 0; + precision = 0; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + /* "A negative precision is taken as if the precision + were omitted." */ + if (arg >= 0) + { + precision = arg; + has_precision = 1; + } + } + else + { + const FCHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + while (digitp != dp->precision_end) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + has_precision = 1; + } + } + + switch (type) + { + case TYPE_U8_STRING: + { + const uint8_t *arg = a.arg[dp->arg_index].a.a_u8_string; + const uint8_t *arg_end; + size_t characters; + + if (has_precision) + { + /* Use only PRECISION characters, from the left. */ + arg_end = arg; + characters = 0; + for (; precision > 0; precision--) + { + int count = u8_strmblen (arg_end); + if (count == 0) + break; + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else if (has_width) + { + /* Use the entire string, and count the number of + characters. */ + arg_end = arg; + characters = 0; + for (;;) + { + int count = u8_strmblen (arg_end); + if (count == 0) + break; + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else + { + /* Use the entire string. */ + arg_end = arg + u8_strlen (arg); + /* The number of characters doesn't matter. */ + characters = 0; + } + + if (characters < width && !(dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + +# if DCHAR_IS_UINT8_T + { + size_t n = arg_end - arg; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_CPY (result + length, arg, n); + length += n; + } +# else + { /* Convert. */ + DCHAR_T *converted = result + length; + size_t converted_len = allocated - length; +# if DCHAR_IS_TCHAR + /* Convert from UTF-8 to locale encoding. */ + converted = + u8_conv_to_encoding (locale_charset (), + iconveh_question_mark, + arg, arg_end - arg, NULL, + converted, &converted_len); +# else + /* Convert from UTF-8 to UTF-16/UTF-32. */ + converted = + U8_TO_DCHAR (arg, arg_end - arg, + converted, &converted_len); +# endif + if (converted == NULL) + { + int saved_errno = errno; + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = saved_errno; + return NULL; + } + if (converted != result + length) + { + ENSURE_ALLOCATION (xsum (length, converted_len)); + DCHAR_CPY (result + length, converted, converted_len); + free (converted); + } + length += converted_len; + } +# endif + + if (characters < width && (dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } + break; + + case TYPE_U16_STRING: + { + const uint16_t *arg = a.arg[dp->arg_index].a.a_u16_string; + const uint16_t *arg_end; + size_t characters; + + if (has_precision) + { + /* Use only PRECISION characters, from the left. */ + arg_end = arg; + characters = 0; + for (; precision > 0; precision--) + { + int count = u16_strmblen (arg_end); + if (count == 0) + break; + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else if (has_width) + { + /* Use the entire string, and count the number of + characters. */ + arg_end = arg; + characters = 0; + for (;;) + { + int count = u16_strmblen (arg_end); + if (count == 0) + break; + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else + { + /* Use the entire string. */ + arg_end = arg + u16_strlen (arg); + /* The number of characters doesn't matter. */ + characters = 0; + } + + if (characters < width && !(dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + +# if DCHAR_IS_UINT16_T + { + size_t n = arg_end - arg; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_CPY (result + length, arg, n); + length += n; + } +# else + { /* Convert. */ + DCHAR_T *converted = result + length; + size_t converted_len = allocated - length; +# if DCHAR_IS_TCHAR + /* Convert from UTF-16 to locale encoding. */ + converted = + u16_conv_to_encoding (locale_charset (), + iconveh_question_mark, + arg, arg_end - arg, NULL, + converted, &converted_len); +# else + /* Convert from UTF-16 to UTF-8/UTF-32. */ + converted = + U16_TO_DCHAR (arg, arg_end - arg, + converted, &converted_len); +# endif + if (converted == NULL) + { + int saved_errno = errno; + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = saved_errno; + return NULL; + } + if (converted != result + length) + { + ENSURE_ALLOCATION (xsum (length, converted_len)); + DCHAR_CPY (result + length, converted, converted_len); + free (converted); + } + length += converted_len; + } +# endif + + if (characters < width && (dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } + break; + + case TYPE_U32_STRING: + { + const uint32_t *arg = a.arg[dp->arg_index].a.a_u32_string; + const uint32_t *arg_end; + size_t characters; + + if (has_precision) + { + /* Use only PRECISION characters, from the left. */ + arg_end = arg; + characters = 0; + for (; precision > 0; precision--) + { + int count = u32_strmblen (arg_end); + if (count == 0) + break; + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else if (has_width) + { + /* Use the entire string, and count the number of + characters. */ + arg_end = arg; + characters = 0; + for (;;) + { + int count = u32_strmblen (arg_end); + if (count == 0) + break; + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else + { + /* Use the entire string. */ + arg_end = arg + u32_strlen (arg); + /* The number of characters doesn't matter. */ + characters = 0; + } + + if (characters < width && !(dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + +# if DCHAR_IS_UINT32_T + { + size_t n = arg_end - arg; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_CPY (result + length, arg, n); + length += n; + } +# else + { /* Convert. */ + DCHAR_T *converted = result + length; + size_t converted_len = allocated - length; +# if DCHAR_IS_TCHAR + /* Convert from UTF-32 to locale encoding. */ + converted = + u32_conv_to_encoding (locale_charset (), + iconveh_question_mark, + arg, arg_end - arg, NULL, + converted, &converted_len); +# else + /* Convert from UTF-32 to UTF-8/UTF-16. */ + converted = + U32_TO_DCHAR (arg, arg_end - arg, + converted, &converted_len); +# endif + if (converted == NULL) + { + int saved_errno = errno; + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = saved_errno; + return NULL; + } + if (converted != result + length) + { + ENSURE_ALLOCATION (xsum (length, converted_len)); + DCHAR_CPY (result + length, converted, converted_len); + free (converted); + } + length += converted_len; + } +# endif + + if (characters < width && (dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } + break; + + default: + abort (); + } + } +#endif +#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T + else if (dp->conversion == 's' +# if WIDE_CHAR_VERSION + && a.arg[dp->arg_index].type != TYPE_WIDE_STRING +# else + && a.arg[dp->arg_index].type == TYPE_WIDE_STRING +# endif + ) + { + /* The normal handling of the 's' directive below requires + allocating a temporary buffer. The determination of its + length (tmp_length), in the case when a precision is + specified, below requires a conversion between a char[] + string and a wchar_t[] wide string. It could be done, but + we have no guarantee that the implementation of sprintf will + use the exactly same algorithm. Without this guarantee, it + is possible to have buffer overrun bugs. In order to avoid + such bugs, we implement the entire processing of the 's' + directive ourselves. */ + int flags = dp->flags; + int has_width; + size_t width; + int has_precision; + size_t precision; + + has_width = 0; + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + width = arg; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = -width; + } + } + else + { + const FCHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } + has_width = 1; + } + + has_precision = 0; + precision = 6; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + /* "A negative precision is taken as if the precision + were omitted." */ + if (arg >= 0) + { + precision = arg; + has_precision = 1; + } + } + else + { + const FCHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + while (digitp != dp->precision_end) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + has_precision = 1; + } + } + +# if WIDE_CHAR_VERSION + /* %s in vasnwprintf. See the specification of fwprintf. */ + { + const char *arg = a.arg[dp->arg_index].a.a_string; + const char *arg_end; + size_t characters; + + if (has_precision) + { + /* Use only as many bytes as needed to produce PRECISION + wide characters, from the left. */ +# if HAVE_MBRTOWC + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + arg_end = arg; + characters = 0; + for (; precision > 0; precision--) + { + int count; +# if HAVE_MBRTOWC + count = mbrlen (arg_end, MB_CUR_MAX, &state); +# else + count = mblen (arg_end, MB_CUR_MAX); +# endif + if (count == 0) + /* Found the terminating NUL. */ + break; + if (count < 0) + { + /* Invalid or incomplete multibyte character. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else if (has_width) + { + /* Use the entire string, and count the number of wide + characters. */ +# if HAVE_MBRTOWC + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + arg_end = arg; + characters = 0; + for (;;) + { + int count; +# if HAVE_MBRTOWC + count = mbrlen (arg_end, MB_CUR_MAX, &state); +# else + count = mblen (arg_end, MB_CUR_MAX); +# endif + if (count == 0) + /* Found the terminating NUL. */ + break; + if (count < 0) + { + /* Invalid or incomplete multibyte character. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else + { + /* Use the entire string. */ + arg_end = arg + strlen (arg); + /* The number of characters doesn't matter. */ + characters = 0; + } + + if (characters < width && !(dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + + if (has_precision || has_width) + { + /* We know the number of wide characters in advance. */ + size_t remaining; +# if HAVE_MBRTOWC + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + ENSURE_ALLOCATION (xsum (length, characters)); + for (remaining = characters; remaining > 0; remaining--) + { + wchar_t wc; + int count; +# if HAVE_MBRTOWC + count = mbrtowc (&wc, arg, arg_end - arg, &state); +# else + count = mbtowc (&wc, arg, arg_end - arg); +# endif + if (count <= 0) + /* mbrtowc not consistent with mbrlen, or mbtowc + not consistent with mblen. */ + abort (); + result[length++] = wc; + arg += count; + } + if (!(arg == arg_end)) + abort (); + } + else + { +# if HAVE_MBRTOWC + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + while (arg < arg_end) + { + wchar_t wc; + int count; +# if HAVE_MBRTOWC + count = mbrtowc (&wc, arg, arg_end - arg, &state); +# else + count = mbtowc (&wc, arg, arg_end - arg); +# endif + if (count <= 0) + /* mbrtowc not consistent with mbrlen, or mbtowc + not consistent with mblen. */ + abort (); + ENSURE_ALLOCATION (xsum (length, 1)); + result[length++] = wc; + arg += count; + } + } + + if (characters < width && (dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } +# else + /* %ls in vasnprintf. See the specification of fprintf. */ + { + const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string; + const wchar_t *arg_end; + size_t characters; +# if !DCHAR_IS_TCHAR + /* This code assumes that TCHAR_T is 'char'. */ + verify (sizeof (TCHAR_T) == 1); + TCHAR_T *tmpsrc; + DCHAR_T *tmpdst; + size_t tmpdst_len; +# endif + size_t w; + + if (has_precision) + { + /* Use only as many wide characters as needed to produce + at most PRECISION bytes, from the left. */ +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + arg_end = arg; + characters = 0; + while (precision > 0) + { + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg_end == 0) + /* Found the terminating null wide character. */ + break; +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + count = wcrtomb (cbuf, *arg_end, &state); +# else + count = wctomb (cbuf, *arg_end); +# endif + if (count < 0) + { + /* Cannot convert. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + if (precision < count) + break; + arg_end++; + characters += count; + precision -= count; + } + } +# if DCHAR_IS_TCHAR + else if (has_width) +# else + else +# endif + { + /* Use the entire string, and count the number of + bytes. */ +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + arg_end = arg; + characters = 0; + for (;;) + { + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg_end == 0) + /* Found the terminating null wide character. */ + break; +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + count = wcrtomb (cbuf, *arg_end, &state); +# else + count = wctomb (cbuf, *arg_end); +# endif + if (count < 0) + { + /* Cannot convert. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end++; + characters += count; + } + } +# if DCHAR_IS_TCHAR + else + { + /* Use the entire string. */ + arg_end = arg + local_wcslen (arg); + /* The number of bytes doesn't matter. */ + characters = 0; + } +# endif + +# if !DCHAR_IS_TCHAR + /* Convert the string into a piece of temporary memory. */ + tmpsrc = (TCHAR_T *) malloc (characters * sizeof (TCHAR_T)); + if (tmpsrc == NULL) + goto out_of_memory; + { + TCHAR_T *tmpptr = tmpsrc; + size_t remaining; +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + for (remaining = characters; remaining > 0; ) + { + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg == 0) + abort (); +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + count = wcrtomb (cbuf, *arg, &state); +# else + count = wctomb (cbuf, *arg); +# endif + if (count <= 0) + /* Inconsistency. */ + abort (); + memcpy (tmpptr, cbuf, count); + tmpptr += count; + arg++; + remaining -= count; + } + if (!(arg == arg_end)) + abort (); + } + + /* Convert from TCHAR_T[] to DCHAR_T[]. */ + tmpdst = + DCHAR_CONV_FROM_ENCODING (locale_charset (), + iconveh_question_mark, + tmpsrc, characters, + NULL, + NULL, &tmpdst_len); + if (tmpdst == NULL) + { + int saved_errno = errno; + free (tmpsrc); + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = saved_errno; + return NULL; + } + free (tmpsrc); +# endif + + if (has_width) + { +# if ENABLE_UNISTDIO + /* Outside POSIX, it's preferable to compare the width + against the number of _characters_ of the converted + value. */ + w = DCHAR_MBSNLEN (result + length, characters); +# else + /* The width is compared against the number of _bytes_ + of the converted value, says POSIX. */ + w = characters; +# endif + } + else + /* w doesn't matter. */ + w = 0; + + if (w < width && !(dp->flags & FLAG_LEFT)) + { + size_t n = width - w; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + +# if DCHAR_IS_TCHAR + if (has_precision || has_width) + { + /* We know the number of bytes in advance. */ + size_t remaining; +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + ENSURE_ALLOCATION (xsum (length, characters)); + for (remaining = characters; remaining > 0; ) + { + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg == 0) + abort (); +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + count = wcrtomb (cbuf, *arg, &state); +# else + count = wctomb (cbuf, *arg); +# endif + if (count <= 0) + /* Inconsistency. */ + abort (); + memcpy (result + length, cbuf, count); + length += count; + arg++; + remaining -= count; + } + if (!(arg == arg_end)) + abort (); + } + else + { +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + while (arg < arg_end) + { + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg == 0) + abort (); +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + count = wcrtomb (cbuf, *arg, &state); +# else + count = wctomb (cbuf, *arg); +# endif + if (count <= 0) + { + /* Cannot convert. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + ENSURE_ALLOCATION (xsum (length, count)); + memcpy (result + length, cbuf, count); + length += count; + arg++; + } + } +# else + ENSURE_ALLOCATION (xsum (length, tmpdst_len)); + DCHAR_CPY (result + length, tmpdst, tmpdst_len); + free (tmpdst); + length += tmpdst_len; +# endif + + if (w < width && (dp->flags & FLAG_LEFT)) + { + size_t n = width - w; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } +# endif + } +#endif +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL + else if ((dp->conversion == 'a' || dp->conversion == 'A') +# if !(NEED_PRINTF_DIRECTIVE_A || (NEED_PRINTF_LONG_DOUBLE && NEED_PRINTF_DOUBLE)) + && (0 +# if NEED_PRINTF_DOUBLE + || a.arg[dp->arg_index].type == TYPE_DOUBLE +# endif +# if NEED_PRINTF_LONG_DOUBLE + || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE +# endif + ) +# endif + ) + { + arg_type type = a.arg[dp->arg_index].type; + int flags = dp->flags; + size_t width; + int has_precision; + size_t precision; + size_t tmp_length; + size_t count; + DCHAR_T tmpbuf[700]; + DCHAR_T *tmp; + DCHAR_T *pad_ptr; + DCHAR_T *p; + + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + width = arg; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = -width; + } + } + else + { + const FCHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } + } + + has_precision = 0; + precision = 0; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + /* "A negative precision is taken as if the precision + were omitted." */ + if (arg >= 0) + { + precision = arg; + has_precision = 1; + } + } + else + { + const FCHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + while (digitp != dp->precision_end) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + has_precision = 1; + } + } + + /* Allocate a temporary buffer of sufficient size. */ + if (type == TYPE_LONGDOUBLE) + tmp_length = + (unsigned int) ((LDBL_DIG + 1) + * 0.831 /* decimal -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + else + tmp_length = + (unsigned int) ((DBL_DIG + 1) + * 0.831 /* decimal -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + if (tmp_length < precision) + tmp_length = precision; + /* Account for sign, decimal point etc. */ + tmp_length = xsum (tmp_length, 12); + + if (tmp_length < width) + tmp_length = width; + + tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ + + if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T)) + tmp = tmpbuf; + else + { + size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T)); + + if (size_overflow_p (tmp_memsize)) + /* Overflow, would lead to out of memory. */ + goto out_of_memory; + tmp = (DCHAR_T *) malloc (tmp_memsize); + if (tmp == NULL) + /* Out of memory. */ + goto out_of_memory; + } + + pad_ptr = NULL; + p = tmp; + if (type == TYPE_LONGDOUBLE) + { +# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE + long double arg = a.arg[dp->arg_index].a.a_longdouble; + + if (isnanl (arg)) + { + if (dp->conversion == 'A') + { + *p++ = 'N'; *p++ = 'A'; *p++ = 'N'; + } + else + { + *p++ = 'n'; *p++ = 'a'; *p++ = 'n'; + } + } + else + { + int sign = 0; + DECL_LONG_DOUBLE_ROUNDING + + BEGIN_LONG_DOUBLE_ROUNDING (); + + if (signbit (arg)) /* arg < 0.0L or negative zero */ + { + sign = -1; + arg = -arg; + } + + if (sign < 0) + *p++ = '-'; + else if (flags & FLAG_SHOWSIGN) + *p++ = '+'; + else if (flags & FLAG_SPACE) + *p++ = ' '; + + if (arg > 0.0L && arg + arg == arg) + { + if (dp->conversion == 'A') + { + *p++ = 'I'; *p++ = 'N'; *p++ = 'F'; + } + else + { + *p++ = 'i'; *p++ = 'n'; *p++ = 'f'; + } + } + else + { + int exponent; + long double mantissa; + + if (arg > 0.0L) + mantissa = printf_frexpl (arg, &exponent); + else + { + exponent = 0; + mantissa = 0.0L; + } + + if (has_precision + && precision < (unsigned int) ((LDBL_DIG + 1) * 0.831) + 1) + { + /* Round the mantissa. */ + long double tail = mantissa; + size_t q; + + for (q = precision; ; q--) + { + int digit = (int) tail; + tail -= digit; + if (q == 0) + { + if (digit & 1 ? tail >= 0.5L : tail > 0.5L) + tail = 1 - tail; + else + tail = - tail; + break; + } + tail *= 16.0L; + } + if (tail != 0.0L) + for (q = precision; q > 0; q--) + tail *= 0.0625L; + mantissa += tail; + } + + *p++ = '0'; + *p++ = dp->conversion - 'A' + 'X'; + pad_ptr = p; + { + int digit; + + digit = (int) mantissa; + mantissa -= digit; + *p++ = '0' + digit; + if ((flags & FLAG_ALT) + || mantissa > 0.0L || precision > 0) + { + *p++ = decimal_point_char (); + /* This loop terminates because we assume + that FLT_RADIX is a power of 2. */ + while (mantissa > 0.0L) + { + mantissa *= 16.0L; + digit = (int) mantissa; + mantissa -= digit; + *p++ = digit + + (digit < 10 + ? '0' + : dp->conversion - 10); + if (precision > 0) + precision--; + } + while (precision > 0) + { + *p++ = '0'; + precision--; + } + } + } + *p++ = dp->conversion - 'A' + 'P'; +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + { '%', '+', 'd', '\0' }; + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, "%+d", exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, "%+d", exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } +# endif + } + + END_LONG_DOUBLE_ROUNDING (); + } +# else + abort (); +# endif + } + else + { +# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE + double arg = a.arg[dp->arg_index].a.a_double; + + if (isnand (arg)) + { + if (dp->conversion == 'A') + { + *p++ = 'N'; *p++ = 'A'; *p++ = 'N'; + } + else + { + *p++ = 'n'; *p++ = 'a'; *p++ = 'n'; + } + } + else + { + int sign = 0; + + if (signbit (arg)) /* arg < 0.0 or negative zero */ + { + sign = -1; + arg = -arg; + } + + if (sign < 0) + *p++ = '-'; + else if (flags & FLAG_SHOWSIGN) + *p++ = '+'; + else if (flags & FLAG_SPACE) + *p++ = ' '; + + if (arg > 0.0 && arg + arg == arg) + { + if (dp->conversion == 'A') + { + *p++ = 'I'; *p++ = 'N'; *p++ = 'F'; + } + else + { + *p++ = 'i'; *p++ = 'n'; *p++ = 'f'; + } + } + else + { + int exponent; + double mantissa; + + if (arg > 0.0) + mantissa = printf_frexp (arg, &exponent); + else + { + exponent = 0; + mantissa = 0.0; + } + + if (has_precision + && precision < (unsigned int) ((DBL_DIG + 1) * 0.831) + 1) + { + /* Round the mantissa. */ + double tail = mantissa; + size_t q; + + for (q = precision; ; q--) + { + int digit = (int) tail; + tail -= digit; + if (q == 0) + { + if (digit & 1 ? tail >= 0.5 : tail > 0.5) + tail = 1 - tail; + else + tail = - tail; + break; + } + tail *= 16.0; + } + if (tail != 0.0) + for (q = precision; q > 0; q--) + tail *= 0.0625; + mantissa += tail; + } + + *p++ = '0'; + *p++ = dp->conversion - 'A' + 'X'; + pad_ptr = p; + { + int digit; + + digit = (int) mantissa; + mantissa -= digit; + *p++ = '0' + digit; + if ((flags & FLAG_ALT) + || mantissa > 0.0 || precision > 0) + { + *p++ = decimal_point_char (); + /* This loop terminates because we assume + that FLT_RADIX is a power of 2. */ + while (mantissa > 0.0) + { + mantissa *= 16.0; + digit = (int) mantissa; + mantissa -= digit; + *p++ = digit + + (digit < 10 + ? '0' + : dp->conversion - 10); + if (precision > 0) + precision--; + } + while (precision > 0) + { + *p++ = '0'; + precision--; + } + } + } + *p++ = dp->conversion - 'A' + 'P'; +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + { '%', '+', 'd', '\0' }; + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, "%+d", exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, "%+d", exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } +# endif + } + } +# else + abort (); +# endif + } + + /* The generated string now extends from tmp to p, with the + zero padding insertion point being at pad_ptr. */ + count = p - tmp; + + if (count < width) + { + size_t pad = width - count; + DCHAR_T *end = p + pad; + + if (flags & FLAG_LEFT) + { + /* Pad with spaces on the right. */ + for (; pad > 0; pad--) + *p++ = ' '; + } + else if ((flags & FLAG_ZERO) && pad_ptr != NULL) + { + /* Pad with zeroes. */ + DCHAR_T *q = end; + + while (p > pad_ptr) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = '0'; + } + else + { + /* Pad with spaces on the left. */ + DCHAR_T *q = end; + + while (p > tmp) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = ' '; + } + + p = end; + } + + count = p - tmp; + + if (count >= tmp_length) + /* tmp_length was incorrectly calculated - fix the + code above! */ + abort (); + + /* Make room for the result. */ + if (count >= allocated - length) + { + size_t n = xsum (length, count); + + ENSURE_ALLOCATION (n); + } + + /* Append the result. */ + memcpy (result + length, tmp, count * sizeof (DCHAR_T)); + if (tmp != tmpbuf) + free (tmp); + length += count; + } +#endif +#if (NEED_PRINTF_INFINITE_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL + else if ((dp->conversion == 'f' || dp->conversion == 'F' + || dp->conversion == 'e' || dp->conversion == 'E' + || dp->conversion == 'g' || dp->conversion == 'G' + || dp->conversion == 'a' || dp->conversion == 'A') + && (0 +# if NEED_PRINTF_DOUBLE + || a.arg[dp->arg_index].type == TYPE_DOUBLE +# elif NEED_PRINTF_INFINITE_DOUBLE + || (a.arg[dp->arg_index].type == TYPE_DOUBLE + /* The systems (mingw) which produce wrong output + for Inf, -Inf, and NaN also do so for -0.0. + Therefore we treat this case here as well. */ + && is_infinite_or_zero (a.arg[dp->arg_index].a.a_double)) +# endif +# if NEED_PRINTF_LONG_DOUBLE + || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE +# elif NEED_PRINTF_INFINITE_LONG_DOUBLE + || (a.arg[dp->arg_index].type == TYPE_LONGDOUBLE + /* Some systems produce wrong output for Inf, + -Inf, and NaN. Some systems in this category + (IRIX 5.3) also do so for -0.0. Therefore we + treat this case here as well. */ + && is_infinite_or_zerol (a.arg[dp->arg_index].a.a_longdouble)) +# endif + )) + { +# if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) + arg_type type = a.arg[dp->arg_index].type; +# endif + int flags = dp->flags; + size_t width; + size_t count; + int has_precision; + size_t precision; + size_t tmp_length; + DCHAR_T tmpbuf[700]; + DCHAR_T *tmp; + DCHAR_T *pad_ptr; + DCHAR_T *p; + + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + width = arg; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = -width; + } + } + else + { + const FCHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } + } + + has_precision = 0; + precision = 0; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + /* "A negative precision is taken as if the precision + were omitted." */ + if (arg >= 0) + { + precision = arg; + has_precision = 1; + } + } + else + { + const FCHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + while (digitp != dp->precision_end) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + has_precision = 1; + } + } + + /* POSIX specifies the default precision to be 6 for %f, %F, + %e, %E, but not for %g, %G. Implementations appear to use + the same default precision also for %g, %G. But for %a, %A, + the default precision is 0. */ + if (!has_precision) + if (!(dp->conversion == 'a' || dp->conversion == 'A')) + precision = 6; + + /* Allocate a temporary buffer of sufficient size. */ +# if NEED_PRINTF_DOUBLE && NEED_PRINTF_LONG_DOUBLE + tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : DBL_DIG + 1); +# elif NEED_PRINTF_INFINITE_DOUBLE && NEED_PRINTF_LONG_DOUBLE + tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : 0); +# elif NEED_PRINTF_LONG_DOUBLE + tmp_length = LDBL_DIG + 1; +# elif NEED_PRINTF_DOUBLE + tmp_length = DBL_DIG + 1; +# else + tmp_length = 0; +# endif + if (tmp_length < precision) + tmp_length = precision; +# if NEED_PRINTF_LONG_DOUBLE +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE + if (type == TYPE_LONGDOUBLE) +# endif + if (dp->conversion == 'f' || dp->conversion == 'F') + { + long double arg = a.arg[dp->arg_index].a.a_longdouble; + if (!(isnanl (arg) || arg + arg == arg)) + { + /* arg is finite and nonzero. */ + int exponent = floorlog10l (arg < 0 ? -arg : arg); + if (exponent >= 0 && tmp_length < exponent + precision) + tmp_length = exponent + precision; + } + } +# endif +# if NEED_PRINTF_DOUBLE +# if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE + if (type == TYPE_DOUBLE) +# endif + if (dp->conversion == 'f' || dp->conversion == 'F') + { + double arg = a.arg[dp->arg_index].a.a_double; + if (!(isnand (arg) || arg + arg == arg)) + { + /* arg is finite and nonzero. */ + int exponent = floorlog10 (arg < 0 ? -arg : arg); + if (exponent >= 0 && tmp_length < exponent + precision) + tmp_length = exponent + precision; + } + } +# endif + /* Account for sign, decimal point etc. */ + tmp_length = xsum (tmp_length, 12); + + if (tmp_length < width) + tmp_length = width; + + tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ + + if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T)) + tmp = tmpbuf; + else + { + size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T)); + + if (size_overflow_p (tmp_memsize)) + /* Overflow, would lead to out of memory. */ + goto out_of_memory; + tmp = (DCHAR_T *) malloc (tmp_memsize); + if (tmp == NULL) + /* Out of memory. */ + goto out_of_memory; + } + + pad_ptr = NULL; + p = tmp; + +# if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE + if (type == TYPE_LONGDOUBLE) +# endif + { + long double arg = a.arg[dp->arg_index].a.a_longdouble; + + if (isnanl (arg)) + { + if (dp->conversion >= 'A' && dp->conversion <= 'Z') + { + *p++ = 'N'; *p++ = 'A'; *p++ = 'N'; + } + else + { + *p++ = 'n'; *p++ = 'a'; *p++ = 'n'; + } + } + else + { + int sign = 0; + DECL_LONG_DOUBLE_ROUNDING + + BEGIN_LONG_DOUBLE_ROUNDING (); + + if (signbit (arg)) /* arg < 0.0L or negative zero */ + { + sign = -1; + arg = -arg; + } + + if (sign < 0) + *p++ = '-'; + else if (flags & FLAG_SHOWSIGN) + *p++ = '+'; + else if (flags & FLAG_SPACE) + *p++ = ' '; + + if (arg > 0.0L && arg + arg == arg) + { + if (dp->conversion >= 'A' && dp->conversion <= 'Z') + { + *p++ = 'I'; *p++ = 'N'; *p++ = 'F'; + } + else + { + *p++ = 'i'; *p++ = 'n'; *p++ = 'f'; + } + } + else + { +# if NEED_PRINTF_LONG_DOUBLE + pad_ptr = p; + + if (dp->conversion == 'f' || dp->conversion == 'F') + { + char *digits; + size_t ndigits; + + digits = + scale10_round_decimal_long_double (arg, precision); + if (digits == NULL) + { + END_LONG_DOUBLE_ROUNDING (); + goto out_of_memory; + } + ndigits = strlen (digits); + + if (ndigits > precision) + do + { + --ndigits; + *p++ = digits[ndigits]; + } + while (ndigits > precision); + else + *p++ = '0'; + /* Here ndigits <= precision. */ + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > ndigits; precision--) + *p++ = '0'; + while (ndigits > 0) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + + free (digits); + } + else if (dp->conversion == 'e' || dp->conversion == 'E') + { + int exponent; + + if (arg == 0.0L) + { + exponent = 0; + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + } + else + { + /* arg > 0.0L. */ + int adjusted; + char *digits; + size_t ndigits; + + exponent = floorlog10l (arg); + adjusted = 0; + for (;;) + { + digits = + scale10_round_decimal_long_double (arg, + (int)precision - exponent); + if (digits == NULL) + { + END_LONG_DOUBLE_ROUNDING (); + goto out_of_memory; + } + ndigits = strlen (digits); + + if (ndigits == precision + 1) + break; + if (ndigits < precision + || ndigits > precision + 2) + /* The exponent was not guessed + precisely enough. */ + abort (); + if (adjusted) + /* None of two values of exponent is + the right one. Prevent an endless + loop. */ + abort (); + free (digits); + if (ndigits == precision) + exponent -= 1; + else + exponent += 1; + adjusted = 1; + } + /* Here ndigits = precision+1. */ + if (is_borderline (digits, precision)) + { + /* Maybe the exponent guess was too high + and a smaller exponent can be reached + by turning a 10...0 into 9...9x. */ + char *digits2 = + scale10_round_decimal_long_double (arg, + (int)precision - exponent + 1); + if (digits2 == NULL) + { + free (digits); + END_LONG_DOUBLE_ROUNDING (); + goto out_of_memory; + } + if (strlen (digits2) == precision + 1) + { + free (digits); + digits = digits2; + exponent -= 1; + } + else + free (digits2); + } + /* Here ndigits = precision+1. */ + + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + while (ndigits > 0) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + + free (digits); + } + + *p++ = dp->conversion; /* 'e' or 'E' */ +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + { '%', '+', '.', '2', 'd', '\0' }; + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, "%+.2d", exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, "%+.2d", exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } +# endif + } + else if (dp->conversion == 'g' || dp->conversion == 'G') + { + if (precision == 0) + precision = 1; + /* precision >= 1. */ + + if (arg == 0.0L) + /* The exponent is 0, >= -4, < precision. + Use fixed-point notation. */ + { + size_t ndigits = precision; + /* Number of trailing zeroes that have to be + dropped. */ + size_t nzeroes = + (flags & FLAG_ALT ? 0 : precision - 1); + + --ndigits; + *p++ = '0'; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = '0'; + } + } + } + else + { + /* arg > 0.0L. */ + int exponent; + int adjusted; + char *digits; + size_t ndigits; + size_t nzeroes; + + exponent = floorlog10l (arg); + adjusted = 0; + for (;;) + { + digits = + scale10_round_decimal_long_double (arg, + (int)(precision - 1) - exponent); + if (digits == NULL) + { + END_LONG_DOUBLE_ROUNDING (); + goto out_of_memory; + } + ndigits = strlen (digits); + + if (ndigits == precision) + break; + if (ndigits < precision - 1 + || ndigits > precision + 1) + /* The exponent was not guessed + precisely enough. */ + abort (); + if (adjusted) + /* None of two values of exponent is + the right one. Prevent an endless + loop. */ + abort (); + free (digits); + if (ndigits < precision) + exponent -= 1; + else + exponent += 1; + adjusted = 1; + } + /* Here ndigits = precision. */ + if (is_borderline (digits, precision - 1)) + { + /* Maybe the exponent guess was too high + and a smaller exponent can be reached + by turning a 10...0 into 9...9x. */ + char *digits2 = + scale10_round_decimal_long_double (arg, + (int)(precision - 1) - exponent + 1); + if (digits2 == NULL) + { + free (digits); + END_LONG_DOUBLE_ROUNDING (); + goto out_of_memory; + } + if (strlen (digits2) == precision) + { + free (digits); + digits = digits2; + exponent -= 1; + } + else + free (digits2); + } + /* Here ndigits = precision. */ + + /* Determine the number of trailing zeroes + that have to be dropped. */ + nzeroes = 0; + if ((flags & FLAG_ALT) == 0) + while (nzeroes < ndigits + && digits[nzeroes] == '0') + nzeroes++; + + /* The exponent is now determined. */ + if (exponent >= -4 + && exponent < (long)precision) + { + /* Fixed-point notation: + max(exponent,0)+1 digits, then the + decimal point, then the remaining + digits without trailing zeroes. */ + if (exponent >= 0) + { + size_t ecount = exponent + 1; + /* Note: count <= precision = ndigits. */ + for (; ecount > 0; ecount--) + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + } + else + { + size_t ecount = -exponent - 1; + *p++ = '0'; + *p++ = decimal_point_char (); + for (; ecount > 0; ecount--) + *p++ = '0'; + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + } + else + { + /* Exponential notation. */ + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */ +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + { '%', '+', '.', '2', 'd', '\0' }; + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, "%+.2d", exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, "%+.2d", exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } +# endif + } + + free (digits); + } + } + else + abort (); +# else + /* arg is finite. */ + if (!(arg == 0.0L)) + abort (); + + pad_ptr = p; + + if (dp->conversion == 'f' || dp->conversion == 'F') + { + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + } + else if (dp->conversion == 'e' || dp->conversion == 'E') + { + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + *p++ = dp->conversion; /* 'e' or 'E' */ + *p++ = '+'; + *p++ = '0'; + *p++ = '0'; + } + else if (dp->conversion == 'g' || dp->conversion == 'G') + { + *p++ = '0'; + if (flags & FLAG_ALT) + { + size_t ndigits = + (precision > 0 ? precision - 1 : 0); + *p++ = decimal_point_char (); + for (; ndigits > 0; --ndigits) + *p++ = '0'; + } + } + else if (dp->conversion == 'a' || dp->conversion == 'A') + { + *p++ = '0'; + *p++ = dp->conversion - 'A' + 'X'; + pad_ptr = p; + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + *p++ = dp->conversion - 'A' + 'P'; + *p++ = '+'; + *p++ = '0'; + } + else + abort (); +# endif + } + + END_LONG_DOUBLE_ROUNDING (); + } + } +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE + else +# endif +# endif +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE + { + double arg = a.arg[dp->arg_index].a.a_double; + + if (isnand (arg)) + { + if (dp->conversion >= 'A' && dp->conversion <= 'Z') + { + *p++ = 'N'; *p++ = 'A'; *p++ = 'N'; + } + else + { + *p++ = 'n'; *p++ = 'a'; *p++ = 'n'; + } + } + else + { + int sign = 0; + + if (signbit (arg)) /* arg < 0.0 or negative zero */ + { + sign = -1; + arg = -arg; + } + + if (sign < 0) + *p++ = '-'; + else if (flags & FLAG_SHOWSIGN) + *p++ = '+'; + else if (flags & FLAG_SPACE) + *p++ = ' '; + + if (arg > 0.0 && arg + arg == arg) + { + if (dp->conversion >= 'A' && dp->conversion <= 'Z') + { + *p++ = 'I'; *p++ = 'N'; *p++ = 'F'; + } + else + { + *p++ = 'i'; *p++ = 'n'; *p++ = 'f'; + } + } + else + { +# if NEED_PRINTF_DOUBLE + pad_ptr = p; + + if (dp->conversion == 'f' || dp->conversion == 'F') + { + char *digits; + size_t ndigits; + + digits = + scale10_round_decimal_double (arg, precision); + if (digits == NULL) + goto out_of_memory; + ndigits = strlen (digits); + + if (ndigits > precision) + do + { + --ndigits; + *p++ = digits[ndigits]; + } + while (ndigits > precision); + else + *p++ = '0'; + /* Here ndigits <= precision. */ + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > ndigits; precision--) + *p++ = '0'; + while (ndigits > 0) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + + free (digits); + } + else if (dp->conversion == 'e' || dp->conversion == 'E') + { + int exponent; + + if (arg == 0.0) + { + exponent = 0; + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + } + else + { + /* arg > 0.0. */ + int adjusted; + char *digits; + size_t ndigits; + + exponent = floorlog10 (arg); + adjusted = 0; + for (;;) + { + digits = + scale10_round_decimal_double (arg, + (int)precision - exponent); + if (digits == NULL) + goto out_of_memory; + ndigits = strlen (digits); + + if (ndigits == precision + 1) + break; + if (ndigits < precision + || ndigits > precision + 2) + /* The exponent was not guessed + precisely enough. */ + abort (); + if (adjusted) + /* None of two values of exponent is + the right one. Prevent an endless + loop. */ + abort (); + free (digits); + if (ndigits == precision) + exponent -= 1; + else + exponent += 1; + adjusted = 1; + } + /* Here ndigits = precision+1. */ + if (is_borderline (digits, precision)) + { + /* Maybe the exponent guess was too high + and a smaller exponent can be reached + by turning a 10...0 into 9...9x. */ + char *digits2 = + scale10_round_decimal_double (arg, + (int)precision - exponent + 1); + if (digits2 == NULL) + { + free (digits); + goto out_of_memory; + } + if (strlen (digits2) == precision + 1) + { + free (digits); + digits = digits2; + exponent -= 1; + } + else + free (digits2); + } + /* Here ndigits = precision+1. */ + + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + while (ndigits > 0) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + + free (digits); + } + + *p++ = dp->conversion; /* 'e' or 'E' */ +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + /* Produce the same number of exponent digits + as the native printf implementation. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + { '%', '+', '.', '3', 'd', '\0' }; +# else + { '%', '+', '.', '2', 'd', '\0' }; +# endif + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + { + static const char decimal_format[] = + /* Produce the same number of exponent digits + as the native printf implementation. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + "%+.3d"; +# else + "%+.2d"; +# endif + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, decimal_format, exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, decimal_format, exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } + } +# endif + } + else if (dp->conversion == 'g' || dp->conversion == 'G') + { + if (precision == 0) + precision = 1; + /* precision >= 1. */ + + if (arg == 0.0) + /* The exponent is 0, >= -4, < precision. + Use fixed-point notation. */ + { + size_t ndigits = precision; + /* Number of trailing zeroes that have to be + dropped. */ + size_t nzeroes = + (flags & FLAG_ALT ? 0 : precision - 1); + + --ndigits; + *p++ = '0'; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = '0'; + } + } + } + else + { + /* arg > 0.0. */ + int exponent; + int adjusted; + char *digits; + size_t ndigits; + size_t nzeroes; + + exponent = floorlog10 (arg); + adjusted = 0; + for (;;) + { + digits = + scale10_round_decimal_double (arg, + (int)(precision - 1) - exponent); + if (digits == NULL) + goto out_of_memory; + ndigits = strlen (digits); + + if (ndigits == precision) + break; + if (ndigits < precision - 1 + || ndigits > precision + 1) + /* The exponent was not guessed + precisely enough. */ + abort (); + if (adjusted) + /* None of two values of exponent is + the right one. Prevent an endless + loop. */ + abort (); + free (digits); + if (ndigits < precision) + exponent -= 1; + else + exponent += 1; + adjusted = 1; + } + /* Here ndigits = precision. */ + if (is_borderline (digits, precision - 1)) + { + /* Maybe the exponent guess was too high + and a smaller exponent can be reached + by turning a 10...0 into 9...9x. */ + char *digits2 = + scale10_round_decimal_double (arg, + (int)(precision - 1) - exponent + 1); + if (digits2 == NULL) + { + free (digits); + goto out_of_memory; + } + if (strlen (digits2) == precision) + { + free (digits); + digits = digits2; + exponent -= 1; + } + else + free (digits2); + } + /* Here ndigits = precision. */ + + /* Determine the number of trailing zeroes + that have to be dropped. */ + nzeroes = 0; + if ((flags & FLAG_ALT) == 0) + while (nzeroes < ndigits + && digits[nzeroes] == '0') + nzeroes++; + + /* The exponent is now determined. */ + if (exponent >= -4 + && exponent < (long)precision) + { + /* Fixed-point notation: + max(exponent,0)+1 digits, then the + decimal point, then the remaining + digits without trailing zeroes. */ + if (exponent >= 0) + { + size_t ecount = exponent + 1; + /* Note: ecount <= precision = ndigits. */ + for (; ecount > 0; ecount--) + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + } + else + { + size_t ecount = -exponent - 1; + *p++ = '0'; + *p++ = decimal_point_char (); + for (; ecount > 0; ecount--) + *p++ = '0'; + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + } + else + { + /* Exponential notation. */ + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */ +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + /* Produce the same number of exponent digits + as the native printf implementation. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + { '%', '+', '.', '3', 'd', '\0' }; +# else + { '%', '+', '.', '2', 'd', '\0' }; +# endif + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + { + static const char decimal_format[] = + /* Produce the same number of exponent digits + as the native printf implementation. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + "%+.3d"; +# else + "%+.2d"; +# endif + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, decimal_format, exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, decimal_format, exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } + } +# endif + } + + free (digits); + } + } + else + abort (); +# else + /* arg is finite. */ + if (!(arg == 0.0)) + abort (); + + pad_ptr = p; + + if (dp->conversion == 'f' || dp->conversion == 'F') + { + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + } + else if (dp->conversion == 'e' || dp->conversion == 'E') + { + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + *p++ = dp->conversion; /* 'e' or 'E' */ + *p++ = '+'; + /* Produce the same number of exponent digits as + the native printf implementation. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + *p++ = '0'; +# endif + *p++ = '0'; + *p++ = '0'; + } + else if (dp->conversion == 'g' || dp->conversion == 'G') + { + *p++ = '0'; + if (flags & FLAG_ALT) + { + size_t ndigits = + (precision > 0 ? precision - 1 : 0); + *p++ = decimal_point_char (); + for (; ndigits > 0; --ndigits) + *p++ = '0'; + } + } + else + abort (); +# endif + } + } + } +# endif + + /* The generated string now extends from tmp to p, with the + zero padding insertion point being at pad_ptr. */ + count = p - tmp; + + if (count < width) + { + size_t pad = width - count; + DCHAR_T *end = p + pad; + + if (flags & FLAG_LEFT) + { + /* Pad with spaces on the right. */ + for (; pad > 0; pad--) + *p++ = ' '; + } + else if ((flags & FLAG_ZERO) && pad_ptr != NULL) + { + /* Pad with zeroes. */ + DCHAR_T *q = end; + + while (p > pad_ptr) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = '0'; + } + else + { + /* Pad with spaces on the left. */ + DCHAR_T *q = end; + + while (p > tmp) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = ' '; + } + + p = end; + } + + count = p - tmp; + + if (count >= tmp_length) + /* tmp_length was incorrectly calculated - fix the + code above! */ + abort (); + + /* Make room for the result. */ + if (count >= allocated - length) + { + size_t n = xsum (length, count); + + ENSURE_ALLOCATION (n); + } + + /* Append the result. */ + memcpy (result + length, tmp, count * sizeof (DCHAR_T)); + if (tmp != tmpbuf) + free (tmp); + length += count; + } +#endif + else + { + arg_type type = a.arg[dp->arg_index].type; + int flags = dp->flags; +#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + int has_width; +#endif +#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + size_t width; +#endif +#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION + int has_precision; + size_t precision; +#endif +#if NEED_PRINTF_UNBOUNDED_PRECISION + int prec_ourselves; +#else +# define prec_ourselves 0 +#endif +#if NEED_PRINTF_FLAG_LEFTADJUST +# define pad_ourselves 1 +#elif !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + int pad_ourselves; +#else +# define pad_ourselves 0 +#endif + TCHAR_T *fbp; + unsigned int prefix_count; + int prefixes[2] IF_LINT (= { 0 }); + int orig_errno; +#if !USE_SNPRINTF + size_t tmp_length; + TCHAR_T tmpbuf[700]; + TCHAR_T *tmp; +#endif + +#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + has_width = 0; +#endif +#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + width = arg; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = -width; + } + } + else + { + const FCHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } +#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + has_width = 1; +#endif + } +#endif + +#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION + has_precision = 0; + precision = 6; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + /* "A negative precision is taken as if the precision + were omitted." */ + if (arg >= 0) + { + precision = arg; + has_precision = 1; + } + } + else + { + const FCHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + while (digitp != dp->precision_end) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + has_precision = 1; + } + } +#endif + + /* Decide whether to handle the precision ourselves. */ +#if NEED_PRINTF_UNBOUNDED_PRECISION + switch (dp->conversion) + { + case 'd': case 'i': case 'u': + case 'o': + case 'x': case 'X': case 'p': + prec_ourselves = has_precision && (precision > 0); + break; + default: + prec_ourselves = 0; + break; + } +#endif + + /* Decide whether to perform the padding ourselves. */ +#if !NEED_PRINTF_FLAG_LEFTADJUST && (!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION) + switch (dp->conversion) + { +# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO + /* If we need conversion from TCHAR_T[] to DCHAR_T[], we need + to perform the padding after this conversion. Functions + with unistdio extensions perform the padding based on + character count rather than element count. */ + case 'c': case 's': +# endif +# if NEED_PRINTF_FLAG_ZERO + case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': + case 'a': case 'A': +# endif + pad_ourselves = 1; + break; + default: + pad_ourselves = prec_ourselves; + break; + } +#endif + +#if !USE_SNPRINTF + /* Allocate a temporary buffer of sufficient size for calling + sprintf. */ + tmp_length = + MAX_ROOM_NEEDED (&a, dp->arg_index, dp->conversion, type, + flags, width, has_precision, precision, + pad_ourselves); + + if (tmp_length <= sizeof (tmpbuf) / sizeof (TCHAR_T)) + tmp = tmpbuf; + else + { + size_t tmp_memsize = xtimes (tmp_length, sizeof (TCHAR_T)); + + if (size_overflow_p (tmp_memsize)) + /* Overflow, would lead to out of memory. */ + goto out_of_memory; + tmp = (TCHAR_T *) malloc (tmp_memsize); + if (tmp == NULL) + /* Out of memory. */ + goto out_of_memory; + } +#endif + + /* Construct the format string for calling snprintf or + sprintf. */ + fbp = buf; + *fbp++ = '%'; +#if NEED_PRINTF_FLAG_GROUPING + /* The underlying implementation doesn't support the ' flag. + Produce no grouping characters in this case; this is + acceptable because the grouping is locale dependent. */ +#else + if (flags & FLAG_GROUP) + *fbp++ = '\''; +#endif + if (flags & FLAG_LEFT) + *fbp++ = '-'; + if (flags & FLAG_SHOWSIGN) + *fbp++ = '+'; + if (flags & FLAG_SPACE) + *fbp++ = ' '; + if (flags & FLAG_ALT) + *fbp++ = '#'; +#if __GLIBC__ >= 2 && !defined __UCLIBC__ + if (flags & FLAG_LOCALIZED) + *fbp++ = 'I'; +#endif + if (!pad_ourselves) + { + if (flags & FLAG_ZERO) + *fbp++ = '0'; + if (dp->width_start != dp->width_end) + { + size_t n = dp->width_end - dp->width_start; + /* The width specification is known to consist only + of standard ASCII characters. */ + if (sizeof (FCHAR_T) == sizeof (TCHAR_T)) + { + memcpy (fbp, dp->width_start, n * sizeof (TCHAR_T)); + fbp += n; + } + else + { + const FCHAR_T *mp = dp->width_start; + do + *fbp++ = *mp++; + while (--n > 0); + } + } + } + if (!prec_ourselves) + { + if (dp->precision_start != dp->precision_end) + { + size_t n = dp->precision_end - dp->precision_start; + /* The precision specification is known to consist only + of standard ASCII characters. */ + if (sizeof (FCHAR_T) == sizeof (TCHAR_T)) + { + memcpy (fbp, dp->precision_start, n * sizeof (TCHAR_T)); + fbp += n; + } + else + { + const FCHAR_T *mp = dp->precision_start; + do + *fbp++ = *mp++; + while (--n > 0); + } + } + } + + switch (type) + { +#if HAVE_LONG_LONG_INT + case TYPE_LONGLONGINT: + case TYPE_ULONGLONGINT: +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + *fbp++ = 'I'; + *fbp++ = '6'; + *fbp++ = '4'; + break; +# else + *fbp++ = 'l'; +# endif +#endif + FALLTHROUGH; + case TYPE_LONGINT: + case TYPE_ULONGINT: +#if HAVE_WINT_T + case TYPE_WIDE_CHAR: +#endif +#if HAVE_WCHAR_T + case TYPE_WIDE_STRING: +#endif + *fbp++ = 'l'; + break; + case TYPE_LONGDOUBLE: + *fbp++ = 'L'; + break; + default: + break; + } +#if NEED_PRINTF_DIRECTIVE_F + if (dp->conversion == 'F') + *fbp = 'f'; + else +#endif + *fbp = dp->conversion; +#if USE_SNPRINTF +# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) + fbp[1] = '%'; + fbp[2] = 'n'; + fbp[3] = '\0'; +# else + /* On glibc2 systems from glibc >= 2.3 - probably also older + ones - we know that snprintf's return value conforms to + ISO C 99: the tests gl_SNPRINTF_RETVAL_C99 and + gl_SNPRINTF_TRUNCATION_C99 pass. + Therefore we can avoid using %n in this situation. + On glibc2 systems from 2004-10-18 or newer, the use of %n + in format strings in writable memory may crash the program + (if compiled with _FORTIFY_SOURCE=2), so we should avoid it + in this situation. */ + /* On native Windows systems (such as mingw), we can avoid using + %n because: + - Although the gl_SNPRINTF_TRUNCATION_C99 test fails, + snprintf does not write more than the specified number + of bytes. (snprintf (buf, 3, "%d %d", 4567, 89) writes + '4', '5', '6' into buf, not '4', '5', '\0'.) + - Although the gl_SNPRINTF_RETVAL_C99 test fails, snprintf + allows us to recognize the case of an insufficient + buffer size: it returns -1 in this case. + On native Windows systems (such as mingw) where the OS is + Windows Vista, the use of %n in format strings by default + crashes the program. See + <http://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and + <http://msdn2.microsoft.com/en-us/library/ms175782(VS.80).aspx> + So we should avoid %n in this situation. */ + fbp[1] = '\0'; +# endif +#else + fbp[1] = '\0'; +#endif + + /* Construct the arguments for calling snprintf or sprintf. */ + prefix_count = 0; + if (!pad_ourselves && dp->width_arg_index != ARG_NONE) + { + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int; + } + if (!prec_ourselves && dp->precision_arg_index != ARG_NONE) + { + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int; + } + +#if USE_SNPRINTF + /* The SNPRINTF result is appended after result[0..length]. + The latter is an array of DCHAR_T; SNPRINTF appends an + array of TCHAR_T to it. This is possible because + sizeof (TCHAR_T) divides sizeof (DCHAR_T) and + alignof (TCHAR_T) <= alignof (DCHAR_T). */ +# define TCHARS_PER_DCHAR (sizeof (DCHAR_T) / sizeof (TCHAR_T)) + /* Ensure that maxlen below will be >= 2. Needed on BeOS, + where an snprintf() with maxlen==1 acts like sprintf(). */ + ENSURE_ALLOCATION (xsum (length, + (2 + TCHARS_PER_DCHAR - 1) + / TCHARS_PER_DCHAR)); + /* Prepare checking whether snprintf returns the count + via %n. */ + *(TCHAR_T *) (result + length) = '\0'; +#endif + + orig_errno = errno; + + for (;;) + { + int count = -1; + +#if USE_SNPRINTF + int retcount = 0; + size_t maxlen = allocated - length; + /* SNPRINTF can fail if its second argument is + > INT_MAX. */ + if (maxlen > INT_MAX / TCHARS_PER_DCHAR) + maxlen = INT_MAX / TCHARS_PER_DCHAR; + maxlen = maxlen * TCHARS_PER_DCHAR; +# define SNPRINTF_BUF(arg) \ + switch (prefix_count) \ + { \ + case 0: \ + retcount = SNPRINTF ((TCHAR_T *) (result + length), \ + maxlen, buf, \ + arg, &count); \ + break; \ + case 1: \ + retcount = SNPRINTF ((TCHAR_T *) (result + length), \ + maxlen, buf, \ + prefixes[0], arg, &count); \ + break; \ + case 2: \ + retcount = SNPRINTF ((TCHAR_T *) (result + length), \ + maxlen, buf, \ + prefixes[0], prefixes[1], arg, \ + &count); \ + break; \ + default: \ + abort (); \ + } +#else +# define SNPRINTF_BUF(arg) \ + switch (prefix_count) \ + { \ + case 0: \ + count = sprintf (tmp, buf, arg); \ + break; \ + case 1: \ + count = sprintf (tmp, buf, prefixes[0], arg); \ + break; \ + case 2: \ + count = sprintf (tmp, buf, prefixes[0], prefixes[1],\ + arg); \ + break; \ + default: \ + abort (); \ + } +#endif + + errno = 0; + switch (type) + { + case TYPE_SCHAR: + { + int arg = a.arg[dp->arg_index].a.a_schar; + SNPRINTF_BUF (arg); + } + break; + case TYPE_UCHAR: + { + unsigned int arg = a.arg[dp->arg_index].a.a_uchar; + SNPRINTF_BUF (arg); + } + break; + case TYPE_SHORT: + { + int arg = a.arg[dp->arg_index].a.a_short; + SNPRINTF_BUF (arg); + } + break; + case TYPE_USHORT: + { + unsigned int arg = a.arg[dp->arg_index].a.a_ushort; + SNPRINTF_BUF (arg); + } + break; + case TYPE_INT: + { + int arg = a.arg[dp->arg_index].a.a_int; + SNPRINTF_BUF (arg); + } + break; + case TYPE_UINT: + { + unsigned int arg = a.arg[dp->arg_index].a.a_uint; + SNPRINTF_BUF (arg); + } + break; + case TYPE_LONGINT: + { + long int arg = a.arg[dp->arg_index].a.a_longint; + SNPRINTF_BUF (arg); + } + break; + case TYPE_ULONGINT: + { + unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint; + SNPRINTF_BUF (arg); + } + break; +#if HAVE_LONG_LONG_INT + case TYPE_LONGLONGINT: + { + long long int arg = a.arg[dp->arg_index].a.a_longlongint; + SNPRINTF_BUF (arg); + } + break; + case TYPE_ULONGLONGINT: + { + unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint; + SNPRINTF_BUF (arg); + } + break; +#endif + case TYPE_DOUBLE: + { + double arg = a.arg[dp->arg_index].a.a_double; + SNPRINTF_BUF (arg); + } + break; + case TYPE_LONGDOUBLE: + { + long double arg = a.arg[dp->arg_index].a.a_longdouble; + SNPRINTF_BUF (arg); + } + break; + case TYPE_CHAR: + { + int arg = a.arg[dp->arg_index].a.a_char; + SNPRINTF_BUF (arg); + } + break; +#if HAVE_WINT_T + case TYPE_WIDE_CHAR: + { + wint_t arg = a.arg[dp->arg_index].a.a_wide_char; + SNPRINTF_BUF (arg); + } + break; +#endif + case TYPE_STRING: + { + const char *arg = a.arg[dp->arg_index].a.a_string; + SNPRINTF_BUF (arg); + } + break; +#if HAVE_WCHAR_T + case TYPE_WIDE_STRING: + { + const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string; + SNPRINTF_BUF (arg); + } + break; +#endif + case TYPE_POINTER: + { + void *arg = a.arg[dp->arg_index].a.a_pointer; + SNPRINTF_BUF (arg); + } + break; + default: + abort (); + } + +#if USE_SNPRINTF + /* Portability: Not all implementations of snprintf() + are ISO C 99 compliant. Determine the number of + bytes that snprintf() has produced or would have + produced. */ + if (count >= 0) + { + /* Verify that snprintf() has NUL-terminated its + result. */ + if (count < maxlen + && ((TCHAR_T *) (result + length)) [count] != '\0') + abort (); + /* Portability hack. */ + if (retcount > count) + count = retcount; + } + else + { + /* snprintf() doesn't understand the '%n' + directive. */ + if (fbp[1] != '\0') + { + /* Don't use the '%n' directive; instead, look + at the snprintf() return value. */ + fbp[1] = '\0'; + continue; + } + else + { + /* Look at the snprintf() return value. */ + if (retcount < 0) + { +# if !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF + /* HP-UX 10.20 snprintf() is doubly deficient: + It doesn't understand the '%n' directive, + *and* it returns -1 (rather than the length + that would have been required) when the + buffer is too small. + But a failure at this point can also come + from other reasons than a too small buffer, + such as an invalid wide string argument to + the %ls directive, or possibly an invalid + floating-point argument. */ + size_t tmp_length = + MAX_ROOM_NEEDED (&a, dp->arg_index, + dp->conversion, type, flags, + width, + has_precision, + precision, pad_ourselves); + + if (maxlen < tmp_length) + { + /* Make more room. But try to do through + this reallocation only once. */ + size_t bigger_need = + xsum (length, + xsum (tmp_length, + TCHARS_PER_DCHAR - 1) + / TCHARS_PER_DCHAR); + /* And always grow proportionally. + (There may be several arguments, each + needing a little more room than the + previous one.) */ + size_t bigger_need2 = + xsum (xtimes (allocated, 2), 12); + if (bigger_need < bigger_need2) + bigger_need = bigger_need2; + ENSURE_ALLOCATION (bigger_need); + continue; + } +# endif + } + else + count = retcount; + } + } +#endif + + /* Attempt to handle failure. */ + if (count < 0) + { + /* SNPRINTF or sprintf failed. Save and use the errno + that it has set, if any. */ + int saved_errno = errno; + if (saved_errno == 0) + { + if (dp->conversion == 'c' || dp->conversion == 's') + saved_errno = EILSEQ; + else + saved_errno = EINVAL; + } + + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + + errno = saved_errno; + return NULL; + } + +#if USE_SNPRINTF + /* Handle overflow of the allocated buffer. + If such an overflow occurs, a C99 compliant snprintf() + returns a count >= maxlen. However, a non-compliant + snprintf() function returns only count = maxlen - 1. To + cover both cases, test whether count >= maxlen - 1. */ + if ((unsigned int) count + 1 >= maxlen) + { + /* If maxlen already has attained its allowed maximum, + allocating more memory will not increase maxlen. + Instead of looping, bail out. */ + if (maxlen == INT_MAX / TCHARS_PER_DCHAR) + goto overflow; + else + { + /* Need at least (count + 1) * sizeof (TCHAR_T) + bytes. (The +1 is for the trailing NUL.) + But ask for (count + 2) * sizeof (TCHAR_T) + bytes, so that in the next round, we likely get + maxlen > (unsigned int) count + 1 + and so we don't get here again. + And allocate proportionally, to avoid looping + eternally if snprintf() reports a too small + count. */ + size_t n = + xmax (xsum (length, + ((unsigned int) count + 2 + + TCHARS_PER_DCHAR - 1) + / TCHARS_PER_DCHAR), + xtimes (allocated, 2)); + + ENSURE_ALLOCATION (n); + continue; + } + } +#endif + +#if NEED_PRINTF_UNBOUNDED_PRECISION + if (prec_ourselves) + { + /* Handle the precision. */ + TCHAR_T *prec_ptr = +# if USE_SNPRINTF + (TCHAR_T *) (result + length); +# else + tmp; +# endif + size_t prefix_count; + size_t move; + + prefix_count = 0; + /* Put the additional zeroes after the sign. */ + if (count >= 1 + && (*prec_ptr == '-' || *prec_ptr == '+' + || *prec_ptr == ' ')) + prefix_count = 1; + /* Put the additional zeroes after the 0x prefix if + (flags & FLAG_ALT) || (dp->conversion == 'p'). */ + else if (count >= 2 + && prec_ptr[0] == '0' + && (prec_ptr[1] == 'x' || prec_ptr[1] == 'X')) + prefix_count = 2; + + move = count - prefix_count; + if (precision > move) + { + /* Insert zeroes. */ + size_t insert = precision - move; + TCHAR_T *prec_end; + +# if USE_SNPRINTF + size_t n = + xsum (length, + (count + insert + TCHARS_PER_DCHAR - 1) + / TCHARS_PER_DCHAR); + length += (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR; + ENSURE_ALLOCATION (n); + length -= (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR; + prec_ptr = (TCHAR_T *) (result + length); +# endif + + prec_end = prec_ptr + count; + prec_ptr += prefix_count; + + while (prec_end > prec_ptr) + { + prec_end--; + prec_end[insert] = prec_end[0]; + } + + prec_end += insert; + do + *--prec_end = '0'; + while (prec_end > prec_ptr); + + count += insert; + } + } +#endif + +#if !USE_SNPRINTF + if (count >= tmp_length) + /* tmp_length was incorrectly calculated - fix the + code above! */ + abort (); +#endif + +#if !DCHAR_IS_TCHAR + /* Convert from TCHAR_T[] to DCHAR_T[]. */ + if (dp->conversion == 'c' || dp->conversion == 's') + { + /* type = TYPE_CHAR or TYPE_WIDE_CHAR or TYPE_STRING + TYPE_WIDE_STRING. + The result string is not certainly ASCII. */ + const TCHAR_T *tmpsrc; + DCHAR_T *tmpdst; + size_t tmpdst_len; + /* This code assumes that TCHAR_T is 'char'. */ + verify (sizeof (TCHAR_T) == 1); +# if USE_SNPRINTF + tmpsrc = (TCHAR_T *) (result + length); +# else + tmpsrc = tmp; +# endif + tmpdst = + DCHAR_CONV_FROM_ENCODING (locale_charset (), + iconveh_question_mark, + tmpsrc, count, + NULL, + NULL, &tmpdst_len); + if (tmpdst == NULL) + { + int saved_errno = errno; + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = saved_errno; + return NULL; + } + ENSURE_ALLOCATION (xsum (length, tmpdst_len)); + DCHAR_CPY (result + length, tmpdst, tmpdst_len); + free (tmpdst); + count = tmpdst_len; + } + else + { + /* The result string is ASCII. + Simple 1:1 conversion. */ +# if USE_SNPRINTF + /* If sizeof (DCHAR_T) == sizeof (TCHAR_T), it's a + no-op conversion, in-place on the array starting + at (result + length). */ + if (sizeof (DCHAR_T) != sizeof (TCHAR_T)) +# endif + { + const TCHAR_T *tmpsrc; + DCHAR_T *tmpdst; + size_t n; + +# if USE_SNPRINTF + if (result == resultbuf) + { + tmpsrc = (TCHAR_T *) (result + length); + /* ENSURE_ALLOCATION will not move tmpsrc + (because it's part of resultbuf). */ + ENSURE_ALLOCATION (xsum (length, count)); + } + else + { + /* ENSURE_ALLOCATION will move the array + (because it uses realloc(). */ + ENSURE_ALLOCATION (xsum (length, count)); + tmpsrc = (TCHAR_T *) (result + length); + } +# else + tmpsrc = tmp; + ENSURE_ALLOCATION (xsum (length, count)); +# endif + tmpdst = result + length; + /* Copy backwards, because of overlapping. */ + tmpsrc += count; + tmpdst += count; + for (n = count; n > 0; n--) + *--tmpdst = *--tmpsrc; + } + } +#endif + +#if DCHAR_IS_TCHAR && !USE_SNPRINTF + /* Make room for the result. */ + if (count > allocated - length) + { + /* Need at least count elements. But allocate + proportionally. */ + size_t n = + xmax (xsum (length, count), xtimes (allocated, 2)); + + ENSURE_ALLOCATION (n); + } +#endif + + /* Here count <= allocated - length. */ + + /* Perform padding. */ +#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + if (pad_ourselves && has_width) + { + size_t w; +# if ENABLE_UNISTDIO + /* Outside POSIX, it's preferable to compare the width + against the number of _characters_ of the converted + value. */ + w = DCHAR_MBSNLEN (result + length, count); +# else + /* The width is compared against the number of _bytes_ + of the converted value, says POSIX. */ + w = count; +# endif + if (w < width) + { + size_t pad = width - w; + + /* Make room for the result. */ + if (xsum (count, pad) > allocated - length) + { + /* Need at least count + pad elements. But + allocate proportionally. */ + size_t n = + xmax (xsum3 (length, count, pad), + xtimes (allocated, 2)); + +# if USE_SNPRINTF + length += count; + ENSURE_ALLOCATION (n); + length -= count; +# else + ENSURE_ALLOCATION (n); +# endif + } + /* Here count + pad <= allocated - length. */ + + { +# if !DCHAR_IS_TCHAR || USE_SNPRINTF + DCHAR_T * const rp = result + length; +# else + DCHAR_T * const rp = tmp; +# endif + DCHAR_T *p = rp + count; + DCHAR_T *end = p + pad; + DCHAR_T *pad_ptr; +# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO + if (dp->conversion == 'c' + || dp->conversion == 's') + /* No zero-padding for string directives. */ + pad_ptr = NULL; + else +# endif + { + pad_ptr = (*rp == '-' ? rp + 1 : rp); + /* No zero-padding of "inf" and "nan". */ + if ((*pad_ptr >= 'A' && *pad_ptr <= 'Z') + || (*pad_ptr >= 'a' && *pad_ptr <= 'z')) + pad_ptr = NULL; + } + /* The generated string now extends from rp to p, + with the zero padding insertion point being at + pad_ptr. */ + + count = count + pad; /* = end - rp */ + + if (flags & FLAG_LEFT) + { + /* Pad with spaces on the right. */ + for (; pad > 0; pad--) + *p++ = ' '; + } + else if ((flags & FLAG_ZERO) && pad_ptr != NULL) + { + /* Pad with zeroes. */ + DCHAR_T *q = end; + + while (p > pad_ptr) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = '0'; + } + else + { + /* Pad with spaces on the left. */ + DCHAR_T *q = end; + + while (p > rp) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = ' '; + } + } + } + } +#endif + + /* Here still count <= allocated - length. */ + +#if !DCHAR_IS_TCHAR || USE_SNPRINTF + /* The snprintf() result did fit. */ +#else + /* Append the sprintf() result. */ + memcpy (result + length, tmp, count * sizeof (DCHAR_T)); +#endif +#if !USE_SNPRINTF + if (tmp != tmpbuf) + free (tmp); +#endif + +#if NEED_PRINTF_DIRECTIVE_F + if (dp->conversion == 'F') + { + /* Convert the %f result to upper case for %F. */ + DCHAR_T *rp = result + length; + size_t rc; + for (rc = count; rc > 0; rc--, rp++) + if (*rp >= 'a' && *rp <= 'z') + *rp = *rp - 'a' + 'A'; + } +#endif + + length += count; + break; + } + errno = orig_errno; +#undef pad_ourselves +#undef prec_ourselves + } + } + } + + /* Add the final NUL. */ + ENSURE_ALLOCATION (xsum (length, 1)); + result[length] = '\0'; + + if (result != resultbuf && length + 1 < allocated) + { + /* Shrink the allocated memory if possible. */ + DCHAR_T *memory; + + memory = (DCHAR_T *) realloc (result, (length + 1) * sizeof (DCHAR_T)); + if (memory != NULL) + result = memory; + } + + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + *lengthp = length; + /* Note that we can produce a big string of a length > INT_MAX. POSIX + says that snprintf() fails with errno = EOVERFLOW in this case, but + that's only because snprintf() returns an 'int'. This function does + not have this limitation. */ + return result; + +#if USE_SNPRINTF + overflow: + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EOVERFLOW; + return NULL; +#endif + + out_of_memory: + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + out_of_memory_1: + CLEANUP (); + errno = ENOMEM; + return NULL; + } +} + +#undef MAX_ROOM_NEEDED +#undef TCHARS_PER_DCHAR +#undef SNPRINTF +#undef USE_SNPRINTF +#undef DCHAR_SET +#undef DCHAR_CPY +#undef PRINTF_PARSE +#undef DIRECTIVES +#undef DIRECTIVE +#undef DCHAR_IS_TCHAR +#undef TCHAR_T +#undef DCHAR_T +#undef FCHAR_T +#undef VASNPRINTF diff --git a/local/recipes/tools/diffutils/source/lib/vasnprintf.h b/local/recipes/tools/diffutils/source/lib/vasnprintf.h new file mode 100644 index 0000000000..c22782571d --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/vasnprintf.h @@ -0,0 +1,79 @@ +/* vsprintf with automatic memory allocation. + Copyright (C) 2002-2004, 2007-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _VASNPRINTF_H +#define _VASNPRINTF_H + +/* Get va_list. */ +#include <stdarg.h> + +/* Get size_t. */ +#include <stddef.h> + +/* The __attribute__ feature is available in gcc versions 2.5 and later. + The __-protected variants of the attributes 'format' and 'printf' are + accepted by gcc versions 2.6.4 (effectively 2.7) and later. + We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because + gnulib and libintl do '#define printf __printf__' when they override + the 'printf' function. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) +#else +# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Write formatted output to a string dynamically allocated with malloc(). + You can pass a preallocated buffer for the result in RESULTBUF and its + size in *LENGTHP; otherwise you pass RESULTBUF = NULL. + If successful, return the address of the string (this may be = RESULTBUF + if no dynamic memory allocation was necessary) and set *LENGTHP to the + number of resulting bytes, excluding the trailing NUL. Upon error, set + errno and return NULL. + + When dynamic memory allocation occurs, the preallocated buffer is left + alone (with possibly modified contents). This makes it possible to use + a statically allocated or stack-allocated buffer, like this: + + char buf[100]; + size_t len = sizeof (buf); + char *output = vasnprintf (buf, &len, format, args); + if (output == NULL) + ... error handling ...; + else + { + ... use the output string ...; + if (output != buf) + free (output); + } + */ +#if REPLACE_VASNPRINTF +# define asnprintf rpl_asnprintf +# define vasnprintf rpl_vasnprintf +#endif +extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) + _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4)); +extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 0)); + +#ifdef __cplusplus +} +#endif + +#endif /* _VASNPRINTF_H */ diff --git a/local/recipes/tools/diffutils/source/lib/vasprintf.c b/local/recipes/tools/diffutils/source/lib/vasprintf.c new file mode 100644 index 0000000000..2dd6e3fffb --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/vasprintf.c @@ -0,0 +1,50 @@ +/* Formatted output to strings. + Copyright (C) 1999, 2002, 2006-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#ifdef IN_LIBASPRINTF +# include "vasprintf.h" +#else +# include <stdio.h> +#endif + +#include <errno.h> +#include <limits.h> +#include <stdlib.h> + +#include "vasnprintf.h" + +int +vasprintf (char **resultp, const char *format, va_list args) +{ + size_t length; + char *result = vasnprintf (NULL, &length, format, args); + if (result == NULL) + return -1; + + if (length > INT_MAX) + { + free (result); + errno = EOVERFLOW; + return -1; + } + + *resultp = result; + /* Return the number of resulting bytes, excluding the trailing NUL. */ + return length; +} diff --git a/local/recipes/tools/diffutils/source/lib/verify.h b/local/recipes/tools/diffutils/source/lib/verify.h new file mode 100644 index 0000000000..dcba9c8cb0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/verify.h @@ -0,0 +1,284 @@ +/* Compile-time assert-like macros. + + Copyright (C) 2005-2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */ + +#ifndef _GL_VERIFY_H +#define _GL_VERIFY_H + + +/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert works as per C11. + This is supported by GCC 4.6.0 and later, in C mode, and its use + here generates easier-to-read diagnostics when verify (R) fails. + + Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per C++11. + This will likely be supported by future GCC versions, in C++ mode. + + Use this only with GCC. If we were willing to slow 'configure' + down we could also use it with other compilers, but since this + affects only the quality of diagnostics, why bother? */ +#if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \ + && (201112L <= __STDC_VERSION__ || !defined __STRICT_ANSI__) \ + && !defined __cplusplus) +# define _GL_HAVE__STATIC_ASSERT 1 +#endif +/* The condition (99 < __GNUC__) is temporary, until we know about the + first G++ release that supports static_assert. */ +#if (99 < __GNUC__) && defined __cplusplus +# define _GL_HAVE_STATIC_ASSERT 1 +#endif + +/* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other + system headers, defines a conflicting _Static_assert that is no + better than ours; override it. */ +#ifndef _GL_HAVE_STATIC_ASSERT +# include <stddef.h> +# undef _Static_assert +#endif + +/* Each of these macros verifies that its argument R is nonzero. To + be portable, R should be an integer constant expression. Unlike + assert (R), there is no run-time overhead. + + If _Static_assert works, verify (R) uses it directly. Similarly, + _GL_VERIFY_TRUE works by packaging a _Static_assert inside a struct + that is an operand of sizeof. + + The code below uses several ideas for C++ compilers, and for C + compilers that do not support _Static_assert: + + * The first step is ((R) ? 1 : -1). Given an expression R, of + integral or boolean or floating-point type, this yields an + expression of integral type, whose value is later verified to be + constant and nonnegative. + + * Next this expression W is wrapped in a type + struct _gl_verify_type { + unsigned int _gl_verify_error_if_negative: W; + }. + If W is negative, this yields a compile-time error. No compiler can + deal with a bit-field of negative size. + + One might think that an array size check would have the same + effect, that is, that the type struct { unsigned int dummy[W]; } + would work as well. However, inside a function, some compilers + (such as C++ compilers and GNU C) allow local parameters and + variables inside array size expressions. With these compilers, + an array size check would not properly diagnose this misuse of + the verify macro: + + void function (int n) { verify (n < 0); } + + * For the verify macro, the struct _gl_verify_type will need to + somehow be embedded into a declaration. To be portable, this + declaration must declare an object, a constant, a function, or a + typedef name. If the declared entity uses the type directly, + such as in + + struct dummy {...}; + typedef struct {...} dummy; + extern struct {...} *dummy; + extern void dummy (struct {...} *); + extern struct {...} *dummy (void); + + two uses of the verify macro would yield colliding declarations + if the entity names are not disambiguated. A workaround is to + attach the current line number to the entity name: + + #define _GL_CONCAT0(x, y) x##y + #define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y) + extern struct {...} * _GL_CONCAT (dummy, __LINE__); + + But this has the problem that two invocations of verify from + within the same macro would collide, since the __LINE__ value + would be the same for both invocations. (The GCC __COUNTER__ + macro solves this problem, but is not portable.) + + A solution is to use the sizeof operator. It yields a number, + getting rid of the identity of the type. Declarations like + + extern int dummy [sizeof (struct {...})]; + extern void dummy (int [sizeof (struct {...})]); + extern int (*dummy (void)) [sizeof (struct {...})]; + + can be repeated. + + * Should the implementation use a named struct or an unnamed struct? + Which of the following alternatives can be used? + + extern int dummy [sizeof (struct {...})]; + extern int dummy [sizeof (struct _gl_verify_type {...})]; + extern void dummy (int [sizeof (struct {...})]); + extern void dummy (int [sizeof (struct _gl_verify_type {...})]); + extern int (*dummy (void)) [sizeof (struct {...})]; + extern int (*dummy (void)) [sizeof (struct _gl_verify_type {...})]; + + In the second and sixth case, the struct type is exported to the + outer scope; two such declarations therefore collide. GCC warns + about the first, third, and fourth cases. So the only remaining + possibility is the fifth case: + + extern int (*dummy (void)) [sizeof (struct {...})]; + + * GCC warns about duplicate declarations of the dummy function if + -Wredundant-decls is used. GCC 4.3 and later have a builtin + __COUNTER__ macro that can let us generate unique identifiers for + each dummy function, to suppress this warning. + + * This implementation exploits the fact that older versions of GCC, + which do not support _Static_assert, also do not warn about the + last declaration mentioned above. + + * GCC warns if -Wnested-externs is enabled and verify() is used + within a function body; but inside a function, you can always + arrange to use verify_expr() instead. + + * In C++, any struct definition inside sizeof is invalid. + Use a template type to work around the problem. */ + +/* Concatenate two preprocessor tokens. */ +#define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y) +#define _GL_CONCAT0(x, y) x##y + +/* _GL_COUNTER is an integer, preferably one that changes each time we + use it. Use __COUNTER__ if it works, falling back on __LINE__ + otherwise. __LINE__ isn't perfect, but it's better than a + constant. */ +#if defined __COUNTER__ && __COUNTER__ != __COUNTER__ +# define _GL_COUNTER __COUNTER__ +#else +# define _GL_COUNTER __LINE__ +#endif + +/* Generate a symbol with the given prefix, making it unique if + possible. */ +#define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER) + +/* Verify requirement R at compile-time, as an integer constant expression + that returns 1. If R is false, fail at compile-time, preferably + with a diagnostic that includes the string-literal DIAGNOSTIC. */ + +#define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \ + (!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC))) + +#ifdef __cplusplus +# if !GNULIB_defined_struct__gl_verify_type +template <int w> + struct _gl_verify_type { + unsigned int _gl_verify_error_if_negative: w; + }; +# define GNULIB_defined_struct__gl_verify_type 1 +# endif +# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \ + _gl_verify_type<(R) ? 1 : -1> +#elif defined _GL_HAVE__STATIC_ASSERT +# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \ + struct { \ + _Static_assert (R, DIAGNOSTIC); \ + int _gl_dummy; \ + } +#else +# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \ + struct { unsigned int _gl_verify_error_if_negative: (R) ? 1 : -1; } +#endif + +/* Verify requirement R at compile-time, as a declaration without a + trailing ';'. If R is false, fail at compile-time, preferably + with a diagnostic that includes the string-literal DIAGNOSTIC. + + Unfortunately, unlike C11, this implementation must appear as an + ordinary declaration, and cannot appear inside struct { ... }. */ + +#ifdef _GL_HAVE__STATIC_ASSERT +# define _GL_VERIFY _Static_assert +#else +# define _GL_VERIFY(R, DIAGNOSTIC) \ + extern int (*_GL_GENSYM (_gl_verify_function) (void)) \ + [_GL_VERIFY_TRUE (R, DIAGNOSTIC)] +#endif + +/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */ +#ifdef _GL_STATIC_ASSERT_H +# if !defined _GL_HAVE__STATIC_ASSERT && !defined _Static_assert +# define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC) +# endif +# if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert +# define static_assert _Static_assert /* C11 requires this #define. */ +# endif +#endif + +/* @assert.h omit start@ */ + +/* Each of these macros verifies that its argument R is nonzero. To + be portable, R should be an integer constant expression. Unlike + assert (R), there is no run-time overhead. + + There are two macros, since no single macro can be used in all + contexts in C. verify_true (R) is for scalar contexts, including + integer constant expression contexts. verify (R) is for declaration + contexts, e.g., the top level. */ + +/* Verify requirement R at compile-time, as an integer constant expression. + Return 1. This is equivalent to verify_expr (R, 1). + + verify_true is obsolescent; please use verify_expr instead. */ + +#define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")") + +/* Verify requirement R at compile-time. Return the value of the + expression E. */ + +#define verify_expr(R, E) \ + (_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E)) + +/* Verify requirement R at compile-time, as a declaration without a + trailing ';'. */ + +#ifdef __GNUC__ +# define verify(R) _GL_VERIFY (R, "verify (" #R ")") +#else +/* PGI barfs if R is long. Play it safe. */ +# define verify(R) _GL_VERIFY (R, "verify (...)") +#endif + +#ifndef __has_builtin +# define __has_builtin(x) 0 +#endif + +/* Assume that R always holds. This lets the compiler optimize + accordingly. R should not have side-effects; it may or may not be + evaluated. Behavior is undefined if R is false. */ + +#if (__has_builtin (__builtin_unreachable) \ + || 4 < __GNUC__ + (5 <= __GNUC_MINOR__)) +# define assume(R) ((R) ? (void) 0 : __builtin_unreachable ()) +#elif 1200 <= _MSC_VER +# define assume(R) __assume (R) +#elif ((defined GCC_LINT || defined lint) \ + && (__has_builtin (__builtin_trap) \ + || 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__)))) + /* Doing it this way helps various packages when configured with + --enable-gcc-warnings, which compiles with -Dlint. It's nicer + when 'assume' silences warnings even with older GCCs. */ +# define assume(R) ((R) ? (void) 0 : __builtin_trap ()) +#else +# define assume(R) ((void) (0 && (R))) +#endif + +/* @assert.h omit end@ */ + +#endif diff --git a/local/recipes/tools/diffutils/source/lib/version-etc-fsf.c b/local/recipes/tools/diffutils/source/lib/version-etc-fsf.c new file mode 100644 index 0000000000..6b6f582d45 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/version-etc-fsf.c @@ -0,0 +1,30 @@ +/* Variable with FSF copyright information, for version-etc. + Copyright (C) 1999-2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Jim Meyering. */ + +#include <config.h> + +/* Specification. */ +#include "version-etc.h" + +/* Default copyright goes to the FSF. */ + +const char version_etc_copyright[] = + /* Do *not* mark this string for translation. %s is a copyright + symbol suitable for this locale, and %d is the copyright + year. */ + "Copyright %s %d Free Software Foundation, Inc."; diff --git a/local/recipes/tools/diffutils/source/lib/version-etc.c b/local/recipes/tools/diffutils/source/lib/version-etc.c new file mode 100644 index 0000000000..ce84af3992 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/version-etc.c @@ -0,0 +1,258 @@ +/* Print --version and bug-reporting information in a consistent format. + Copyright (C) 1999-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Jim Meyering. */ + +#include <config.h> + +/* Specification. */ +#include "version-etc.h" + +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> + +#if USE_UNLOCKED_IO +# include "unlocked-io.h" +#endif + +#include "gettext.h" +#define _(msgid) gettext (msgid) + +/* If you use AM_INIT_AUTOMAKE's no-define option, + PACKAGE is not defined. Use PACKAGE_TARNAME instead. */ +#if ! defined PACKAGE && defined PACKAGE_TARNAME +# define PACKAGE PACKAGE_TARNAME +#endif + +enum { COPYRIGHT_YEAR = 2017 }; + +/* The three functions below display the --version information the + standard way. + + If COMMAND_NAME is NULL, the PACKAGE is assumed to be the name of + the program. The formats are therefore: + + PACKAGE VERSION + + or + + COMMAND_NAME (PACKAGE) VERSION. + + The functions differ in the way they are passed author names. */ + +/* Display the --version information the standard way. + + Author names are given in the array AUTHORS. N_AUTHORS is the + number of elements in the array. */ +void +version_etc_arn (FILE *stream, + const char *command_name, const char *package, + const char *version, + const char * const * authors, size_t n_authors) +{ + if (command_name) + fprintf (stream, "%s (%s) %s\n", command_name, package, version); + else + fprintf (stream, "%s %s\n", package, version); + +#ifdef PACKAGE_PACKAGER +# ifdef PACKAGE_PACKAGER_VERSION + fprintf (stream, _("Packaged by %s (%s)\n"), PACKAGE_PACKAGER, + PACKAGE_PACKAGER_VERSION); +# else + fprintf (stream, _("Packaged by %s\n"), PACKAGE_PACKAGER); +# endif +#endif + + /* TRANSLATORS: Translate "(C)" to the copyright symbol + (C-in-a-circle), if this symbol is available in the user's + locale. Otherwise, do not translate "(C)"; leave it as-is. */ + fprintf (stream, version_etc_copyright, _("(C)"), COPYRIGHT_YEAR); + + fputs (_("\ +\n\ +License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\n\ +This is free software: you are free to change and redistribute it.\n\ +There is NO WARRANTY, to the extent permitted by law.\n\ +\n\ +"), + stream); + + switch (n_authors) + { + case 0: + /* The caller must provide at least one author name. */ + abort (); + case 1: + /* TRANSLATORS: %s denotes an author name. */ + fprintf (stream, _("Written by %s.\n"), authors[0]); + break; + case 2: + /* TRANSLATORS: Each %s denotes an author name. */ + fprintf (stream, _("Written by %s and %s.\n"), authors[0], authors[1]); + break; + case 3: + /* TRANSLATORS: Each %s denotes an author name. */ + fprintf (stream, _("Written by %s, %s, and %s.\n"), + authors[0], authors[1], authors[2]); + break; + case 4: + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + fprintf (stream, _("Written by %s, %s, %s,\nand %s.\n"), + authors[0], authors[1], authors[2], authors[3]); + break; + case 5: + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + fprintf (stream, _("Written by %s, %s, %s,\n%s, and %s.\n"), + authors[0], authors[1], authors[2], authors[3], authors[4]); + break; + case 6: + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + fprintf (stream, _("Written by %s, %s, %s,\n%s, %s, and %s.\n"), + authors[0], authors[1], authors[2], authors[3], authors[4], + authors[5]); + break; + case 7: + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + fprintf (stream, _("Written by %s, %s, %s,\n%s, %s, %s, and %s.\n"), + authors[0], authors[1], authors[2], authors[3], authors[4], + authors[5], authors[6]); + break; + case 8: + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + fprintf (stream, _("\ +Written by %s, %s, %s,\n%s, %s, %s, %s,\nand %s.\n"), + authors[0], authors[1], authors[2], authors[3], authors[4], + authors[5], authors[6], authors[7]); + break; + case 9: + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + fprintf (stream, _("\ +Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, and %s.\n"), + authors[0], authors[1], authors[2], authors[3], authors[4], + authors[5], authors[6], authors[7], authors[8]); + break; + default: + /* 10 or more authors. Use an abbreviation, since the human reader + will probably not want to read the entire list anyway. */ + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + fprintf (stream, _("\ +Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, %s, and others.\n"), + authors[0], authors[1], authors[2], authors[3], authors[4], + authors[5], authors[6], authors[7], authors[8]); + break; + } +} + +/* Display the --version information the standard way. See the initial + comment to this module, for more information. + + Author names are given in the NULL-terminated array AUTHORS. */ +void +version_etc_ar (FILE *stream, + const char *command_name, const char *package, + const char *version, const char * const * authors) +{ + size_t n_authors; + + for (n_authors = 0; authors[n_authors]; n_authors++) + ; + version_etc_arn (stream, command_name, package, version, authors, n_authors); +} + +/* Display the --version information the standard way. See the initial + comment to this module, for more information. + + Author names are given in the NULL-terminated va_list AUTHORS. */ +void +version_etc_va (FILE *stream, + const char *command_name, const char *package, + const char *version, va_list authors) +{ + size_t n_authors; + const char *authtab[10]; + + for (n_authors = 0; + n_authors < 10 + && (authtab[n_authors] = va_arg (authors, const char *)) != NULL; + n_authors++) + ; + version_etc_arn (stream, command_name, package, version, + authtab, n_authors); +} + + +/* Display the --version information the standard way. + + If COMMAND_NAME is NULL, the PACKAGE is assumed to be the name of + the program. The formats are therefore: + + PACKAGE VERSION + + or + + COMMAND_NAME (PACKAGE) VERSION. + + The authors names are passed as separate arguments, with an additional + NULL argument at the end. */ +void +version_etc (FILE *stream, + const char *command_name, const char *package, + const char *version, /* const char *author1, ...*/ ...) +{ + va_list authors; + + va_start (authors, version); + version_etc_va (stream, command_name, package, version, authors); + va_end (authors); +} + +void +emit_bug_reporting_address (void) +{ + /* TRANSLATORS: The placeholder indicates the bug-reporting address + for this package. Please add _another line_ saying + "Report translation bugs to <...>\n" with the address for translation + bugs (typically your translation team's web or email address). */ + printf (_("\nReport bugs to: %s\n"), PACKAGE_BUGREPORT); +#ifdef PACKAGE_PACKAGER_BUG_REPORTS + printf (_("Report %s bugs to: %s\n"), PACKAGE_PACKAGER, + PACKAGE_PACKAGER_BUG_REPORTS); +#endif +#ifdef PACKAGE_URL + printf (_("%s home page: <%s>\n"), PACKAGE_NAME, PACKAGE_URL); +#else + printf (_("%s home page: <http://www.gnu.org/software/%s/>\n"), + PACKAGE_NAME, PACKAGE); +#endif + fputs (_("General help using GNU software: <http://www.gnu.org/gethelp/>\n"), + stdout); +} diff --git a/local/recipes/tools/diffutils/source/lib/version-etc.h b/local/recipes/tools/diffutils/source/lib/version-etc.h new file mode 100644 index 0000000000..b931de888c --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/version-etc.h @@ -0,0 +1,78 @@ +/* Print --version and bug-reporting information in a consistent format. + Copyright (C) 1999, 2003, 2005, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Jim Meyering. */ + +#ifndef VERSION_ETC_H +# define VERSION_ETC_H 1 + +# include <stdarg.h> +# include <stdio.h> + +/* The 'sentinel' attribute was added in gcc 4.0. */ +#ifndef _GL_ATTRIBUTE_SENTINEL +# if 4 <= __GNUC__ +# define _GL_ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__)) +# else +# define _GL_ATTRIBUTE_SENTINEL /* empty */ +# endif +#endif + +extern const char version_etc_copyright[]; + +/* The three functions below display the --version information in the + standard way: command and package names, package version, followed + by a short GPLv3+ notice and a list of up to 10 author names. + + If COMMAND_NAME is NULL, the PACKAGE is assumed to be the name of + the program. The formats are therefore: + + PACKAGE VERSION + + or + + COMMAND_NAME (PACKAGE) VERSION. + + The functions differ in the way they are passed author names: */ + +/* N_AUTHORS names are supplied in array AUTHORS. */ +extern void version_etc_arn (FILE *stream, + const char *command_name, const char *package, + const char *version, + const char * const * authors, size_t n_authors); + +/* Names are passed in the NULL-terminated array AUTHORS. */ +extern void version_etc_ar (FILE *stream, + const char *command_name, const char *package, + const char *version, const char * const * authors); + +/* Names are passed in the NULL-terminated va_list. */ +extern void version_etc_va (FILE *stream, + const char *command_name, const char *package, + const char *version, va_list authors); + +/* Names are passed as separate arguments, with an additional + NULL argument at the end. */ +extern void version_etc (FILE *stream, + const char *command_name, const char *package, + const char *version, + /* const char *author1, ..., NULL */ ...) + _GL_ATTRIBUTE_SENTINEL; + +/* Display the usual "Report bugs to" stanza. */ +extern void emit_bug_reporting_address (void); + +#endif /* VERSION_ETC_H */ diff --git a/local/recipes/tools/diffutils/source/lib/warn-on-use.h b/local/recipes/tools/diffutils/source/lib/warn-on-use.h new file mode 100644 index 0000000000..3c0eb579fa --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/warn-on-use.h @@ -0,0 +1,109 @@ +/* A C macro for emitting warnings if a function is used. + Copyright (C) 2010-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* _GL_WARN_ON_USE (function, "literal string") issues a declaration + for FUNCTION which will then trigger a compiler warning containing + the text of "literal string" anywhere that function is called, if + supported by the compiler. If the compiler does not support this + feature, the macro expands to an unused extern declaration. + + This macro is useful for marking a function as a potential + portability trap, with the intent that "literal string" include + instructions on the replacement function that should be used + instead. However, one of the reasons that a function is a + portability trap is if it has the wrong signature. Declaring + FUNCTION with a different signature in C is a compilation error, so + this macro must use the same type as any existing declaration so + that programs that avoid the problematic FUNCTION do not fail to + compile merely because they included a header that poisoned the + function. But this implies that _GL_WARN_ON_USE is only safe to + use if FUNCTION is known to already have a declaration. Use of + this macro implies that there must not be any other macro hiding + the declaration of FUNCTION; but undefining FUNCTION first is part + of the poisoning process anyway (although for symbols that are + provided only via a macro, the result is a compilation error rather + than a warning containing "literal string"). Also note that in + C++, it is only safe to use if FUNCTION has no overloads. + + For an example, it is possible to poison 'getline' by: + - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]], + [getline]) in configure.ac, which potentially defines + HAVE_RAW_DECL_GETLINE + - adding this code to a header that wraps the system <stdio.h>: + #undef getline + #if HAVE_RAW_DECL_GETLINE + _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but" + "not universally present; use the gnulib module getline"); + #endif + + It is not possible to directly poison global variables. But it is + possible to write a wrapper accessor function, and poison that + (less common usage, like &environ, will cause a compilation error + rather than issue the nice warning, but the end result of informing + the developer about their portability problem is still achieved): + #if HAVE_RAW_DECL_ENVIRON + static char ***rpl_environ (void) { return &environ; } + _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared"); + # undef environ + # define environ (*rpl_environ ()) + #endif + */ +#ifndef _GL_WARN_ON_USE + +# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) +/* A compiler attribute is available in gcc versions 4.3.0 and later. */ +# define _GL_WARN_ON_USE(function, message) \ +extern __typeof__ (function) function __attribute__ ((__warning__ (message))) +# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING +/* Verify the existence of the function. */ +# define _GL_WARN_ON_USE(function, message) \ +extern __typeof__ (function) function +# else /* Unsupported. */ +# define _GL_WARN_ON_USE(function, message) \ +_GL_WARN_EXTERN_C int _gl_warn_on_use +# endif +#endif + +/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string") + is like _GL_WARN_ON_USE (function, "string"), except that the function is + declared with the given prototype, consisting of return type, parameters, + and attributes. + This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does + not work in this case. */ +#ifndef _GL_WARN_ON_USE_CXX +# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) +# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ +extern rettype function parameters_and_attributes \ + __attribute__ ((__warning__ (msg))) +# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING +/* Verify the existence of the function. */ +# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ +extern rettype function parameters_and_attributes +# else /* Unsupported. */ +# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ +_GL_WARN_EXTERN_C int _gl_warn_on_use +# endif +#endif + +/* _GL_WARN_EXTERN_C declaration; + performs the declaration with C linkage. */ +#ifndef _GL_WARN_EXTERN_C +# if defined __cplusplus +# define _GL_WARN_EXTERN_C extern "C" +# else +# define _GL_WARN_EXTERN_C extern +# endif +#endif diff --git a/local/recipes/tools/diffutils/source/lib/wchar.in.h b/local/recipes/tools/diffutils/source/lib/wchar.in.h new file mode 100644 index 0000000000..56eba3c42f --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/wchar.in.h @@ -0,0 +1,1077 @@ +/* A substitute for ISO C99 <wchar.h>, for platforms that have issues. + + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake. */ + +/* + * ISO C 99 <wchar.h> for platforms that have issues. + * <http://www.opengroup.org/susv3xbd/wchar.h.html> + * + * For now, this just ensures proper prerequisite inclusion order and + * the declaration of wcwidth(). + */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#if (((defined __need_mbstate_t || defined __need_wint_t) \ + && !defined __MINGW32__ && !defined __KLIBC__) \ + || (defined __hpux \ + && ((defined _INTTYPES_INCLUDED && !defined strtoimax) \ + || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) \ + || (defined __MINGW32__ && defined __STRING_H_SOURCED__) \ + || defined _GL_ALREADY_INCLUDING_WCHAR_H) +/* Special invocation convention: + - Inside glibc and uClibc header files, but not MinGW. + - On HP-UX 11.00 we have a sequence of nested includes + <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>, + once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h> + and once directly. In both situations 'wint_t' is not yet defined, + therefore we cannot provide the function overrides; instead include only + the system's <wchar.h>. + - With MinGW 3.22, when <string.h> includes <wchar.h>, only some part of + <wchar.h> is actually processed, and that doesn't include 'mbstate_t'. + - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and + the latter includes <wchar.h>. But here, we have no way to detect whether + <wctype.h> is completely included or is still being included. */ + +#@INCLUDE_NEXT@ @NEXT_WCHAR_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_WCHAR_H + +#define _GL_ALREADY_INCLUDING_WCHAR_H + +#if @HAVE_FEATURES_H@ +# include <features.h> /* for __GLIBC__ */ +#endif + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. + In some builds of uClibc, <wchar.h> is nonexistent and wchar_t is defined + by <stddef.h>. + But avoid namespace pollution on glibc systems. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <stddef.h> +#endif +#ifndef __GLIBC__ +# include <stdio.h> +# include <time.h> +#endif + +/* Include the original <wchar.h> if it exists. + Some builds of uClibc lack it. */ +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_WCHAR_H@ +# @INCLUDE_NEXT@ @NEXT_WCHAR_H@ +#endif + +#undef _GL_ALREADY_INCLUDING_WCHAR_H + +#ifndef _@GUARD_PREFIX@_WCHAR_H +#define _@GUARD_PREFIX@_WCHAR_H + +/* The __attribute__ feature is available in gcc versions 2.5 and later. + The attribute __pure__ was added in gcc 2.96. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE /* empty */ +#endif + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + + +/* Define wint_t and WEOF. (Also done in wctype.in.h.) */ +#if !@HAVE_WINT_T@ && !defined wint_t +# define wint_t int +# ifndef WEOF +# define WEOF -1 +# endif +#else +/* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or + <stddef.h>. This is too small: ISO C 99 section 7.24.1.(2) says that + wint_t must be "unchanged by default argument promotions". Override it. */ +# if @GNULIB_OVERRIDES_WINT_T@ +# if !GNULIB_defined_wint_t +# if @HAVE_CRTDEFS_H@ +# include <crtdefs.h> +# else +# include <stddef.h> +# endif +typedef unsigned int rpl_wint_t; +# undef wint_t +# define wint_t rpl_wint_t +# define GNULIB_defined_wint_t 1 +# endif +# endif +# ifndef WEOF +# define WEOF ((wint_t) -1) +# endif +#endif + + +/* Override mbstate_t if it is too small. + On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for + implementing mbrtowc for encodings like UTF-8. */ +#if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@ +# if !GNULIB_defined_mbstate_t +typedef int rpl_mbstate_t; +# undef mbstate_t +# define mbstate_t rpl_mbstate_t +# define GNULIB_defined_mbstate_t 1 +# endif +#endif + + +/* Convert a single-byte character to a wide character. */ +#if @GNULIB_BTOWC@ +# if @REPLACE_BTOWC@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef btowc +# define btowc rpl_btowc +# endif +_GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE); +_GL_CXXALIAS_RPL (btowc, wint_t, (int c)); +# else +# if !@HAVE_BTOWC@ +_GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (btowc, wint_t, (int c)); +# endif +_GL_CXXALIASWARN (btowc); +#elif defined GNULIB_POSIXCHECK +# undef btowc +# if HAVE_RAW_DECL_BTOWC +_GL_WARN_ON_USE (btowc, "btowc is unportable - " + "use gnulib module btowc for portability"); +# endif +#endif + + +/* Convert a wide character to a single-byte character. */ +#if @GNULIB_WCTOB@ +# if @REPLACE_WCTOB@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef wctob +# define wctob rpl_wctob +# endif +_GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE); +_GL_CXXALIAS_RPL (wctob, int, (wint_t wc)); +# else +# if !defined wctob && !@HAVE_DECL_WCTOB@ +/* wctob is provided by gnulib, or wctob exists but is not declared. */ +_GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wctob, int, (wint_t wc)); +# endif +_GL_CXXALIASWARN (wctob); +#elif defined GNULIB_POSIXCHECK +# undef wctob +# if HAVE_RAW_DECL_WCTOB +_GL_WARN_ON_USE (wctob, "wctob is unportable - " + "use gnulib module wctob for portability"); +# endif +#endif + + +/* Test whether *PS is in the initial state. */ +#if @GNULIB_MBSINIT@ +# if @REPLACE_MBSINIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mbsinit +# define mbsinit rpl_mbsinit +# endif +_GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps)); +_GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps)); +# else +# if !@HAVE_MBSINIT@ +_GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps)); +# endif +_GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps)); +# endif +_GL_CXXALIASWARN (mbsinit); +#elif defined GNULIB_POSIXCHECK +# undef mbsinit +# if HAVE_RAW_DECL_MBSINIT +_GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - " + "use gnulib module mbsinit for portability"); +# endif +#endif + + +/* Convert a multibyte character to a wide character. */ +#if @GNULIB_MBRTOWC@ +# if @REPLACE_MBRTOWC@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mbrtowc +# define mbrtowc rpl_mbrtowc +# endif +_GL_FUNCDECL_RPL (mbrtowc, size_t, + (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)); +_GL_CXXALIAS_RPL (mbrtowc, size_t, + (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)); +# else +# if !@HAVE_MBRTOWC@ +_GL_FUNCDECL_SYS (mbrtowc, size_t, + (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)); +# endif +_GL_CXXALIAS_SYS (mbrtowc, size_t, + (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)); +# endif +_GL_CXXALIASWARN (mbrtowc); +#elif defined GNULIB_POSIXCHECK +# undef mbrtowc +# if HAVE_RAW_DECL_MBRTOWC +_GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - " + "use gnulib module mbrtowc for portability"); +# endif +#endif + + +/* Recognize a multibyte character. */ +#if @GNULIB_MBRLEN@ +# if @REPLACE_MBRLEN@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mbrlen +# define mbrlen rpl_mbrlen +# endif +_GL_FUNCDECL_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps)); +_GL_CXXALIAS_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps)); +# else +# if !@HAVE_MBRLEN@ +_GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps)); +# endif +_GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps)); +# endif +_GL_CXXALIASWARN (mbrlen); +#elif defined GNULIB_POSIXCHECK +# undef mbrlen +# if HAVE_RAW_DECL_MBRLEN +_GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - " + "use gnulib module mbrlen for portability"); +# endif +#endif + + +/* Convert a string to a wide string. */ +#if @GNULIB_MBSRTOWCS@ +# if @REPLACE_MBSRTOWCS@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mbsrtowcs +# define mbsrtowcs rpl_mbsrtowcs +# endif +_GL_FUNCDECL_RPL (mbsrtowcs, size_t, + (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (mbsrtowcs, size_t, + (wchar_t *dest, const char **srcp, size_t len, + mbstate_t *ps)); +# else +# if !@HAVE_MBSRTOWCS@ +_GL_FUNCDECL_SYS (mbsrtowcs, size_t, + (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (mbsrtowcs, size_t, + (wchar_t *dest, const char **srcp, size_t len, + mbstate_t *ps)); +# endif +_GL_CXXALIASWARN (mbsrtowcs); +#elif defined GNULIB_POSIXCHECK +# undef mbsrtowcs +# if HAVE_RAW_DECL_MBSRTOWCS +_GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - " + "use gnulib module mbsrtowcs for portability"); +# endif +#endif + + +/* Convert a string to a wide string. */ +#if @GNULIB_MBSNRTOWCS@ +# if @REPLACE_MBSNRTOWCS@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mbsnrtowcs +# define mbsnrtowcs rpl_mbsnrtowcs +# endif +_GL_FUNCDECL_RPL (mbsnrtowcs, size_t, + (wchar_t *dest, const char **srcp, size_t srclen, size_t len, + mbstate_t *ps) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (mbsnrtowcs, size_t, + (wchar_t *dest, const char **srcp, size_t srclen, size_t len, + mbstate_t *ps)); +# else +# if !@HAVE_MBSNRTOWCS@ +_GL_FUNCDECL_SYS (mbsnrtowcs, size_t, + (wchar_t *dest, const char **srcp, size_t srclen, size_t len, + mbstate_t *ps) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (mbsnrtowcs, size_t, + (wchar_t *dest, const char **srcp, size_t srclen, size_t len, + mbstate_t *ps)); +# endif +_GL_CXXALIASWARN (mbsnrtowcs); +#elif defined GNULIB_POSIXCHECK +# undef mbsnrtowcs +# if HAVE_RAW_DECL_MBSNRTOWCS +_GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - " + "use gnulib module mbsnrtowcs for portability"); +# endif +#endif + + +/* Convert a wide character to a multibyte character. */ +#if @GNULIB_WCRTOMB@ +# if @REPLACE_WCRTOMB@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef wcrtomb +# define wcrtomb rpl_wcrtomb +# endif +_GL_FUNCDECL_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps)); +_GL_CXXALIAS_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps)); +# else +# if !@HAVE_WCRTOMB@ +_GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps)); +# endif +_GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps)); +# endif +_GL_CXXALIASWARN (wcrtomb); +#elif defined GNULIB_POSIXCHECK +# undef wcrtomb +# if HAVE_RAW_DECL_WCRTOMB +_GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - " + "use gnulib module wcrtomb for portability"); +# endif +#endif + + +/* Convert a wide string to a string. */ +#if @GNULIB_WCSRTOMBS@ +# if @REPLACE_WCSRTOMBS@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef wcsrtombs +# define wcsrtombs rpl_wcsrtombs +# endif +_GL_FUNCDECL_RPL (wcsrtombs, size_t, + (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (wcsrtombs, size_t, + (char *dest, const wchar_t **srcp, size_t len, + mbstate_t *ps)); +# else +# if !@HAVE_WCSRTOMBS@ +_GL_FUNCDECL_SYS (wcsrtombs, size_t, + (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (wcsrtombs, size_t, + (char *dest, const wchar_t **srcp, size_t len, + mbstate_t *ps)); +# endif +_GL_CXXALIASWARN (wcsrtombs); +#elif defined GNULIB_POSIXCHECK +# undef wcsrtombs +# if HAVE_RAW_DECL_WCSRTOMBS +_GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - " + "use gnulib module wcsrtombs for portability"); +# endif +#endif + + +/* Convert a wide string to a string. */ +#if @GNULIB_WCSNRTOMBS@ +# if @REPLACE_WCSNRTOMBS@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef wcsnrtombs +# define wcsnrtombs rpl_wcsnrtombs +# endif +_GL_FUNCDECL_RPL (wcsnrtombs, size_t, + (char *dest, const wchar_t **srcp, size_t srclen, size_t len, + mbstate_t *ps) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (wcsnrtombs, size_t, + (char *dest, const wchar_t **srcp, size_t srclen, size_t len, + mbstate_t *ps)); +# else +# if !@HAVE_WCSNRTOMBS@ +_GL_FUNCDECL_SYS (wcsnrtombs, size_t, + (char *dest, const wchar_t **srcp, size_t srclen, size_t len, + mbstate_t *ps) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (wcsnrtombs, size_t, + (char *dest, const wchar_t **srcp, size_t srclen, size_t len, + mbstate_t *ps)); +# endif +_GL_CXXALIASWARN (wcsnrtombs); +#elif defined GNULIB_POSIXCHECK +# undef wcsnrtombs +# if HAVE_RAW_DECL_WCSNRTOMBS +_GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - " + "use gnulib module wcsnrtombs for portability"); +# endif +#endif + + +/* Return the number of screen columns needed for WC. */ +#if @GNULIB_WCWIDTH@ +# if @REPLACE_WCWIDTH@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef wcwidth +# define wcwidth rpl_wcwidth +# endif +_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE); +_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t)); +# else +# if !@HAVE_DECL_WCWIDTH@ +/* wcwidth exists but is not declared. */ +_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE); +# elif defined __KLIBC__ +/* On OS/2 kLIBC, wcwidth is a macro that expands to the name of a + static inline function. The implementation of wcwidth in wcwidth.c + causes a "conflicting types" error. */ +# undef wcwidth +# endif +_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t)); +# endif +_GL_CXXALIASWARN (wcwidth); +#elif defined GNULIB_POSIXCHECK +# undef wcwidth +# if HAVE_RAW_DECL_WCWIDTH +_GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - " + "use gnulib module wcwidth for portability"); +# endif +#endif + + +/* Search N wide characters of S for C. */ +#if @GNULIB_WMEMCHR@ +# if !@HAVE_WMEMCHR@ +_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n) + _GL_ATTRIBUTE_PURE); +# endif + /* On some systems, this function is defined as an overloaded function: + extern "C++" { + const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t); + wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t); + } */ +_GL_CXXALIAS_SYS_CAST2 (wmemchr, + wchar_t *, (const wchar_t *, wchar_t, size_t), + const wchar_t *, (const wchar_t *, wchar_t, size_t)); +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) +_GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n)); +_GL_CXXALIASWARN1 (wmemchr, const wchar_t *, + (const wchar_t *s, wchar_t c, size_t n)); +# else +_GL_CXXALIASWARN (wmemchr); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wmemchr +# if HAVE_RAW_DECL_WMEMCHR +_GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - " + "use gnulib module wmemchr for portability"); +# endif +#endif + + +/* Compare N wide characters of S1 and S2. */ +#if @GNULIB_WMEMCMP@ +# if !@HAVE_WMEMCMP@ +_GL_FUNCDECL_SYS (wmemcmp, int, + (const wchar_t *s1, const wchar_t *s2, size_t n) + _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wmemcmp, int, + (const wchar_t *s1, const wchar_t *s2, size_t n)); +_GL_CXXALIASWARN (wmemcmp); +#elif defined GNULIB_POSIXCHECK +# undef wmemcmp +# if HAVE_RAW_DECL_WMEMCMP +_GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - " + "use gnulib module wmemcmp for portability"); +# endif +#endif + + +/* Copy N wide characters of SRC to DEST. */ +#if @GNULIB_WMEMCPY@ +# if !@HAVE_WMEMCPY@ +_GL_FUNCDECL_SYS (wmemcpy, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +# endif +_GL_CXXALIAS_SYS (wmemcpy, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +_GL_CXXALIASWARN (wmemcpy); +#elif defined GNULIB_POSIXCHECK +# undef wmemcpy +# if HAVE_RAW_DECL_WMEMCPY +_GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - " + "use gnulib module wmemcpy for portability"); +# endif +#endif + + +/* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for + overlapping memory areas. */ +#if @GNULIB_WMEMMOVE@ +# if !@HAVE_WMEMMOVE@ +_GL_FUNCDECL_SYS (wmemmove, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +# endif +_GL_CXXALIAS_SYS (wmemmove, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +_GL_CXXALIASWARN (wmemmove); +#elif defined GNULIB_POSIXCHECK +# undef wmemmove +# if HAVE_RAW_DECL_WMEMMOVE +_GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - " + "use gnulib module wmemmove for portability"); +# endif +#endif + + +/* Set N wide characters of S to C. */ +#if @GNULIB_WMEMSET@ +# if !@HAVE_WMEMSET@ +_GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n)); +# endif +_GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n)); +_GL_CXXALIASWARN (wmemset); +#elif defined GNULIB_POSIXCHECK +# undef wmemset +# if HAVE_RAW_DECL_WMEMSET +_GL_WARN_ON_USE (wmemset, "wmemset is unportable - " + "use gnulib module wmemset for portability"); +# endif +#endif + + +/* Return the number of wide characters in S. */ +#if @GNULIB_WCSLEN@ +# if !@HAVE_WCSLEN@ +_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s)); +_GL_CXXALIASWARN (wcslen); +#elif defined GNULIB_POSIXCHECK +# undef wcslen +# if HAVE_RAW_DECL_WCSLEN +_GL_WARN_ON_USE (wcslen, "wcslen is unportable - " + "use gnulib module wcslen for portability"); +# endif +#endif + + +/* Return the number of wide characters in S, but at most MAXLEN. */ +#if @GNULIB_WCSNLEN@ +# if !@HAVE_WCSNLEN@ +_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen) + _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)); +_GL_CXXALIASWARN (wcsnlen); +#elif defined GNULIB_POSIXCHECK +# undef wcsnlen +# if HAVE_RAW_DECL_WCSNLEN +_GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - " + "use gnulib module wcsnlen for portability"); +# endif +#endif + + +/* Copy SRC to DEST. */ +#if @GNULIB_WCSCPY@ +# if !@HAVE_WCSCPY@ +_GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src)); +# endif +_GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src)); +_GL_CXXALIASWARN (wcscpy); +#elif defined GNULIB_POSIXCHECK +# undef wcscpy +# if HAVE_RAW_DECL_WCSCPY +_GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - " + "use gnulib module wcscpy for portability"); +# endif +#endif + + +/* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */ +#if @GNULIB_WCPCPY@ +# if !@HAVE_WCPCPY@ +_GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src)); +# endif +_GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src)); +_GL_CXXALIASWARN (wcpcpy); +#elif defined GNULIB_POSIXCHECK +# undef wcpcpy +# if HAVE_RAW_DECL_WCPCPY +_GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - " + "use gnulib module wcpcpy for portability"); +# endif +#endif + + +/* Copy no more than N wide characters of SRC to DEST. */ +#if @GNULIB_WCSNCPY@ +# if !@HAVE_WCSNCPY@ +_GL_FUNCDECL_SYS (wcsncpy, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +# endif +_GL_CXXALIAS_SYS (wcsncpy, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +_GL_CXXALIASWARN (wcsncpy); +#elif defined GNULIB_POSIXCHECK +# undef wcsncpy +# if HAVE_RAW_DECL_WCSNCPY +_GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - " + "use gnulib module wcsncpy for portability"); +# endif +#endif + + +/* Copy no more than N characters of SRC to DEST, returning the address of + the last character written into DEST. */ +#if @GNULIB_WCPNCPY@ +# if !@HAVE_WCPNCPY@ +_GL_FUNCDECL_SYS (wcpncpy, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +# endif +_GL_CXXALIAS_SYS (wcpncpy, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +_GL_CXXALIASWARN (wcpncpy); +#elif defined GNULIB_POSIXCHECK +# undef wcpncpy +# if HAVE_RAW_DECL_WCPNCPY +_GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - " + "use gnulib module wcpncpy for portability"); +# endif +#endif + + +/* Append SRC onto DEST. */ +#if @GNULIB_WCSCAT@ +# if !@HAVE_WCSCAT@ +_GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src)); +# endif +_GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src)); +_GL_CXXALIASWARN (wcscat); +#elif defined GNULIB_POSIXCHECK +# undef wcscat +# if HAVE_RAW_DECL_WCSCAT +_GL_WARN_ON_USE (wcscat, "wcscat is unportable - " + "use gnulib module wcscat for portability"); +# endif +#endif + + +/* Append no more than N wide characters of SRC onto DEST. */ +#if @GNULIB_WCSNCAT@ +# if !@HAVE_WCSNCAT@ +_GL_FUNCDECL_SYS (wcsncat, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +# endif +_GL_CXXALIAS_SYS (wcsncat, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +_GL_CXXALIASWARN (wcsncat); +#elif defined GNULIB_POSIXCHECK +# undef wcsncat +# if HAVE_RAW_DECL_WCSNCAT +_GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - " + "use gnulib module wcsncat for portability"); +# endif +#endif + + +/* Compare S1 and S2. */ +#if @GNULIB_WCSCMP@ +# if !@HAVE_WCSCMP@ +_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2) + _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)); +_GL_CXXALIASWARN (wcscmp); +#elif defined GNULIB_POSIXCHECK +# undef wcscmp +# if HAVE_RAW_DECL_WCSCMP +_GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - " + "use gnulib module wcscmp for portability"); +# endif +#endif + + +/* Compare no more than N wide characters of S1 and S2. */ +#if @GNULIB_WCSNCMP@ +# if !@HAVE_WCSNCMP@ +_GL_FUNCDECL_SYS (wcsncmp, int, + (const wchar_t *s1, const wchar_t *s2, size_t n) + _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wcsncmp, int, + (const wchar_t *s1, const wchar_t *s2, size_t n)); +_GL_CXXALIASWARN (wcsncmp); +#elif defined GNULIB_POSIXCHECK +# undef wcsncmp +# if HAVE_RAW_DECL_WCSNCMP +_GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - " + "use gnulib module wcsncmp for portability"); +# endif +#endif + + +/* Compare S1 and S2, ignoring case. */ +#if @GNULIB_WCSCASECMP@ +# if !@HAVE_WCSCASECMP@ +_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2) + _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)); +_GL_CXXALIASWARN (wcscasecmp); +#elif defined GNULIB_POSIXCHECK +# undef wcscasecmp +# if HAVE_RAW_DECL_WCSCASECMP +_GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - " + "use gnulib module wcscasecmp for portability"); +# endif +#endif + + +/* Compare no more than N chars of S1 and S2, ignoring case. */ +#if @GNULIB_WCSNCASECMP@ +# if !@HAVE_WCSNCASECMP@ +_GL_FUNCDECL_SYS (wcsncasecmp, int, + (const wchar_t *s1, const wchar_t *s2, size_t n) + _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wcsncasecmp, int, + (const wchar_t *s1, const wchar_t *s2, size_t n)); +_GL_CXXALIASWARN (wcsncasecmp); +#elif defined GNULIB_POSIXCHECK +# undef wcsncasecmp +# if HAVE_RAW_DECL_WCSNCASECMP +_GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - " + "use gnulib module wcsncasecmp for portability"); +# endif +#endif + + +/* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE + category of the current locale. */ +#if @GNULIB_WCSCOLL@ +# if !@HAVE_WCSCOLL@ +_GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2)); +# endif +_GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2)); +_GL_CXXALIASWARN (wcscoll); +#elif defined GNULIB_POSIXCHECK +# undef wcscoll +# if HAVE_RAW_DECL_WCSCOLL +_GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - " + "use gnulib module wcscoll for portability"); +# endif +#endif + + +/* Transform S2 into array pointed to by S1 such that if wcscmp is applied + to two transformed strings the result is the as applying 'wcscoll' to the + original strings. */ +#if @GNULIB_WCSXFRM@ +# if !@HAVE_WCSXFRM@ +_GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n)); +# endif +_GL_CXXALIAS_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n)); +_GL_CXXALIASWARN (wcsxfrm); +#elif defined GNULIB_POSIXCHECK +# undef wcsxfrm +# if HAVE_RAW_DECL_WCSXFRM +_GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - " + "use gnulib module wcsxfrm for portability"); +# endif +#endif + + +/* Duplicate S, returning an identical malloc'd string. */ +#if @GNULIB_WCSDUP@ +# if !@HAVE_WCSDUP@ +_GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s)); +# endif +_GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s)); +_GL_CXXALIASWARN (wcsdup); +#elif defined GNULIB_POSIXCHECK +# undef wcsdup +# if HAVE_RAW_DECL_WCSDUP +_GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - " + "use gnulib module wcsdup for portability"); +# endif +#endif + + +/* Find the first occurrence of WC in WCS. */ +#if @GNULIB_WCSCHR@ +# if !@HAVE_WCSCHR@ +_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc) + _GL_ATTRIBUTE_PURE); +# endif + /* On some systems, this function is defined as an overloaded function: + extern "C++" { + const wchar_t * std::wcschr (const wchar_t *, wchar_t); + wchar_t * std::wcschr (wchar_t *, wchar_t); + } */ +_GL_CXXALIAS_SYS_CAST2 (wcschr, + wchar_t *, (const wchar_t *, wchar_t), + const wchar_t *, (const wchar_t *, wchar_t)); +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) +_GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc)); +_GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc)); +# else +_GL_CXXALIASWARN (wcschr); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcschr +# if HAVE_RAW_DECL_WCSCHR +_GL_WARN_ON_USE (wcschr, "wcschr is unportable - " + "use gnulib module wcschr for portability"); +# endif +#endif + + +/* Find the last occurrence of WC in WCS. */ +#if @GNULIB_WCSRCHR@ +# if !@HAVE_WCSRCHR@ +_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc) + _GL_ATTRIBUTE_PURE); +# endif + /* On some systems, this function is defined as an overloaded function: + extern "C++" { + const wchar_t * std::wcsrchr (const wchar_t *, wchar_t); + wchar_t * std::wcsrchr (wchar_t *, wchar_t); + } */ +_GL_CXXALIAS_SYS_CAST2 (wcsrchr, + wchar_t *, (const wchar_t *, wchar_t), + const wchar_t *, (const wchar_t *, wchar_t)); +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) +_GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc)); +_GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc)); +# else +_GL_CXXALIASWARN (wcsrchr); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcsrchr +# if HAVE_RAW_DECL_WCSRCHR +_GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - " + "use gnulib module wcsrchr for portability"); +# endif +#endif + + +/* Return the length of the initial segmet of WCS which consists entirely + of wide characters not in REJECT. */ +#if @GNULIB_WCSCSPN@ +# if !@HAVE_WCSCSPN@ +_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject) + _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)); +_GL_CXXALIASWARN (wcscspn); +#elif defined GNULIB_POSIXCHECK +# undef wcscspn +# if HAVE_RAW_DECL_WCSCSPN +_GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - " + "use gnulib module wcscspn for portability"); +# endif +#endif + + +/* Return the length of the initial segmet of WCS which consists entirely + of wide characters in ACCEPT. */ +#if @GNULIB_WCSSPN@ +# if !@HAVE_WCSSPN@ +_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept) + _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)); +_GL_CXXALIASWARN (wcsspn); +#elif defined GNULIB_POSIXCHECK +# undef wcsspn +# if HAVE_RAW_DECL_WCSSPN +_GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - " + "use gnulib module wcsspn for portability"); +# endif +#endif + + +/* Find the first occurrence in WCS of any character in ACCEPT. */ +#if @GNULIB_WCSPBRK@ +# if !@HAVE_WCSPBRK@ +_GL_FUNCDECL_SYS (wcspbrk, wchar_t *, + (const wchar_t *wcs, const wchar_t *accept) + _GL_ATTRIBUTE_PURE); +# endif + /* On some systems, this function is defined as an overloaded function: + extern "C++" { + const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *); + wchar_t * std::wcspbrk (wchar_t *, const wchar_t *); + } */ +_GL_CXXALIAS_SYS_CAST2 (wcspbrk, + wchar_t *, (const wchar_t *, const wchar_t *), + const wchar_t *, (const wchar_t *, const wchar_t *)); +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) +_GL_CXXALIASWARN1 (wcspbrk, wchar_t *, + (wchar_t *wcs, const wchar_t *accept)); +_GL_CXXALIASWARN1 (wcspbrk, const wchar_t *, + (const wchar_t *wcs, const wchar_t *accept)); +# else +_GL_CXXALIASWARN (wcspbrk); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcspbrk +# if HAVE_RAW_DECL_WCSPBRK +_GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - " + "use gnulib module wcspbrk for portability"); +# endif +#endif + + +/* Find the first occurrence of NEEDLE in HAYSTACK. */ +#if @GNULIB_WCSSTR@ +# if !@HAVE_WCSSTR@ +_GL_FUNCDECL_SYS (wcsstr, wchar_t *, + (const wchar_t *haystack, const wchar_t *needle) + _GL_ATTRIBUTE_PURE); +# endif + /* On some systems, this function is defined as an overloaded function: + extern "C++" { + const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *); + wchar_t * std::wcsstr (wchar_t *, const wchar_t *); + } */ +_GL_CXXALIAS_SYS_CAST2 (wcsstr, + wchar_t *, (const wchar_t *, const wchar_t *), + const wchar_t *, (const wchar_t *, const wchar_t *)); +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) +_GL_CXXALIASWARN1 (wcsstr, wchar_t *, + (wchar_t *haystack, const wchar_t *needle)); +_GL_CXXALIASWARN1 (wcsstr, const wchar_t *, + (const wchar_t *haystack, const wchar_t *needle)); +# else +_GL_CXXALIASWARN (wcsstr); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcsstr +# if HAVE_RAW_DECL_WCSSTR +_GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - " + "use gnulib module wcsstr for portability"); +# endif +#endif + + +/* Divide WCS into tokens separated by characters in DELIM. */ +#if @GNULIB_WCSTOK@ +# if !@HAVE_WCSTOK@ +_GL_FUNCDECL_SYS (wcstok, wchar_t *, + (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr)); +# endif +_GL_CXXALIAS_SYS (wcstok, wchar_t *, + (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr)); +_GL_CXXALIASWARN (wcstok); +#elif defined GNULIB_POSIXCHECK +# undef wcstok +# if HAVE_RAW_DECL_WCSTOK +_GL_WARN_ON_USE (wcstok, "wcstok is unportable - " + "use gnulib module wcstok for portability"); +# endif +#endif + + +/* Determine number of column positions required for first N wide + characters (or fewer if S ends before this) in S. */ +#if @GNULIB_WCSWIDTH@ +# if @REPLACE_WCSWIDTH@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef wcswidth +# define wcswidth rpl_wcswidth +# endif +_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n) + _GL_ATTRIBUTE_PURE); +_GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n)); +# else +# if !@HAVE_WCSWIDTH@ +_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n) + _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n)); +# endif +_GL_CXXALIASWARN (wcswidth); +#elif defined GNULIB_POSIXCHECK +# undef wcswidth +# if HAVE_RAW_DECL_WCSWIDTH +_GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - " + "use gnulib module wcswidth for portability"); +# endif +#endif + + +/* Convert *TP to a date and time wide string. See + <http://pubs.opengroup.org/onlinepubs/9699919799/functions/wcsftime.html>. */ +#if @GNULIB_WCSFTIME@ +# if @REPLACE_WCSFTIME@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef wcsftime +# define wcsftime rpl_wcsftime +# endif +_GL_FUNCDECL_RPL (wcsftime, size_t, (wchar_t *__buf, size_t __bufsize, + const wchar_t *__fmt, const struct tm *__tp) + _GL_ARG_NONNULL ((1, 3, 4))); +_GL_CXXALIAS_RPL (wcsftime, size_t, (wchar_t *__buf, size_t __bufsize, + const wchar_t *__fmt, const struct tm *__tp)); +# else +# if !@HAVE_WCSFTIME@ +_GL_FUNCDECL_SYS (wcsftime, size_t, (wchar_t *__buf, size_t __bufsize, + const wchar_t *__fmt, const struct tm *__tp) + _GL_ARG_NONNULL ((1, 3, 4))); +# endif +_GL_CXXALIAS_SYS (wcsftime, size_t, (wchar_t *__buf, size_t __bufsize, + const wchar_t *__fmt, const struct tm *__tp)); +# endif +_GL_CXXALIASWARN (wcsftime); +#elif defined GNULIB_POSIXCHECK +# undef wcsftime +# if HAVE_RAW_DECL_WCSFTIME +_GL_WARN_ON_USE (wcsftime, "wcsftime is unportable - " + "use gnulib module wcsftime for portability"); +# endif +#endif + + +#endif /* _@GUARD_PREFIX@_WCHAR_H */ +#endif /* _@GUARD_PREFIX@_WCHAR_H */ +#endif diff --git a/local/recipes/tools/diffutils/source/lib/wcrtomb.c b/local/recipes/tools/diffutils/source/lib/wcrtomb.c new file mode 100644 index 0000000000..f956ecf1a9 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/wcrtomb.c @@ -0,0 +1,53 @@ +/* Convert wide character to multibyte character. + Copyright (C) 2008-2017 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <wchar.h> + +#include <errno.h> +#include <stdlib.h> + + +size_t +wcrtomb (char *s, wchar_t wc, mbstate_t *ps) +{ + /* This implementation of wcrtomb on top of wctomb() supports only + stateless encodings. ps must be in the initial state. */ + if (ps != NULL && !mbsinit (ps)) + { + errno = EINVAL; + return (size_t)(-1); + } + + if (s == NULL) + /* We know the NUL wide character corresponds to the NUL character. */ + return 1; + else + { + int ret = wctomb (s, wc); + + if (ret >= 0) + return ret; + else + { + errno = EILSEQ; + return (size_t)(-1); + } + } +} diff --git a/local/recipes/tools/diffutils/source/lib/wctype-h.c b/local/recipes/tools/diffutils/source/lib/wctype-h.c new file mode 100644 index 0000000000..bb5f847e33 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/wctype-h.c @@ -0,0 +1,4 @@ +/* Normally this would be wctype.c, but that name's already taken. */ +#include <config.h> +#define _GL_WCTYPE_INLINE _GL_EXTERN_INLINE +#include "wctype.h" diff --git a/local/recipes/tools/diffutils/source/lib/wctype.in.h b/local/recipes/tools/diffutils/source/lib/wctype.in.h new file mode 100644 index 0000000000..3a9e26c8ec --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/wctype.in.h @@ -0,0 +1,533 @@ +/* A substitute for ISO C99 <wctype.h>, for platforms that lack it. + + Copyright (C) 2006-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible and Paul Eggert. */ + +/* + * ISO C 99 <wctype.h> for platforms that lack it. + * <http://www.opengroup.org/susv3xbd/wctype.h.html> + * + * iswctype, towctrans, towlower, towupper, wctrans, wctype, + * wctrans_t, and wctype_t are not yet implemented. + */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#if (defined __MINGW32__ && defined __CTYPE_H_SOURCED__) + +/* Special invocation convention: + - With MinGW 3.22, when <ctype.h> includes <wctype.h>, only some part of + <wctype.h> is being processed, which doesn't include the idempotency + guard. */ + +#@INCLUDE_NEXT@ @NEXT_WCTYPE_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_WCTYPE_H + +#if @HAVE_WINT_T@ +/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. + Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +# include <stddef.h> +# include <stdio.h> +# include <time.h> +# include <wchar.h> +#endif + +/* Native Windows (mingw, MSVC) have declarations of towupper, towlower, and + isw* functions in <ctype.h>, <wchar.h> as well as in <wctype.h>. Include + <ctype.h>, <wchar.h> in advance to avoid rpl_ prefix being added to the + declarations. */ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include <ctype.h> +# include <wchar.h> +#endif + +/* Include the original <wctype.h> if it exists. + BeOS 5 has the functions but no <wctype.h>. */ +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_WCTYPE_H@ +# @INCLUDE_NEXT@ @NEXT_WCTYPE_H@ +#endif + +#ifndef _@GUARD_PREFIX@_WCTYPE_H +#define _@GUARD_PREFIX@_WCTYPE_H + +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef _GL_WCTYPE_INLINE +# define _GL_WCTYPE_INLINE _GL_INLINE +#endif + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +/* Solaris 2.6 <wctype.h> includes <widec.h> which includes <euc.h> which + #defines a number of identifiers in the application namespace. Revert + these #defines. */ +#ifdef __sun +# undef multibyte +# undef eucw1 +# undef eucw2 +# undef eucw3 +# undef scrw1 +# undef scrw2 +# undef scrw3 +#endif + +/* Define wint_t and WEOF. (Also done in wchar.in.h.) */ +#if !@HAVE_WINT_T@ && !defined wint_t +# define wint_t int +# ifndef WEOF +# define WEOF -1 +# endif +#else +/* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or + <stddef.h>. This is too small: ISO C 99 section 7.24.1.(2) says that + wint_t must be "unchanged by default argument promotions". Override it. */ +# if @GNULIB_OVERRIDES_WINT_T@ +# if !GNULIB_defined_wint_t +# if @HAVE_CRTDEFS_H@ +# include <crtdefs.h> +# else +# include <stddef.h> +# endif +typedef unsigned int rpl_wint_t; +# undef wint_t +# define wint_t rpl_wint_t +# define GNULIB_defined_wint_t 1 +# endif +# endif +# ifndef WEOF +# define WEOF ((wint_t) -1) +# endif +#endif + + +#if !GNULIB_defined_wctype_functions + +/* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions. + Linux libc5 has <wctype.h> and the functions but they are broken. + Assume all 11 functions (all isw* except iswblank) are implemented the + same way, or not at all. */ +# if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@ + +/* IRIX 5.3 has macros but no functions, its isw* macros refer to an + undefined variable _ctmp_ and to <ctype.h> macros like _P, and they + refer to system functions like _iswctype that are not in the + standard C library. Rather than try to get ancient buggy + implementations like this to work, just disable them. */ +# undef iswalnum +# undef iswalpha +# undef iswblank +# undef iswcntrl +# undef iswdigit +# undef iswgraph +# undef iswlower +# undef iswprint +# undef iswpunct +# undef iswspace +# undef iswupper +# undef iswxdigit +# undef towlower +# undef towupper + +/* Linux libc5 has <wctype.h> and the functions but they are broken. */ +# if @REPLACE_ISWCNTRL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define iswalnum rpl_iswalnum +# define iswalpha rpl_iswalpha +# define iswblank rpl_iswblank +# define iswcntrl rpl_iswcntrl +# define iswdigit rpl_iswdigit +# define iswgraph rpl_iswgraph +# define iswlower rpl_iswlower +# define iswprint rpl_iswprint +# define iswpunct rpl_iswpunct +# define iswspace rpl_iswspace +# define iswupper rpl_iswupper +# define iswxdigit rpl_iswxdigit +# endif +# endif +# if @REPLACE_TOWLOWER@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define towlower rpl_towlower +# define towupper rpl_towupper +# endif +# endif + +_GL_WCTYPE_INLINE int +# if @REPLACE_ISWCNTRL@ +rpl_iswalnum +# else +iswalnum +# endif + (wint_t wc) +{ + return ((wc >= '0' && wc <= '9') + || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')); +} + +_GL_WCTYPE_INLINE int +# if @REPLACE_ISWCNTRL@ +rpl_iswalpha +# else +iswalpha +# endif + (wint_t wc) +{ + return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'; +} + +_GL_WCTYPE_INLINE int +# if @REPLACE_ISWCNTRL@ +rpl_iswblank +# else +iswblank +# endif + (wint_t wc) +{ + return wc == ' ' || wc == '\t'; +} + +_GL_WCTYPE_INLINE int +# if @REPLACE_ISWCNTRL@ +rpl_iswcntrl +# else +iswcntrl +# endif + (wint_t wc) +{ + return (wc & ~0x1f) == 0 || wc == 0x7f; +} + +_GL_WCTYPE_INLINE int +# if @REPLACE_ISWCNTRL@ +rpl_iswdigit +# else +iswdigit +# endif + (wint_t wc) +{ + return wc >= '0' && wc <= '9'; +} + +_GL_WCTYPE_INLINE int +# if @REPLACE_ISWCNTRL@ +rpl_iswgraph +# else +iswgraph +# endif + (wint_t wc) +{ + return wc >= '!' && wc <= '~'; +} + +_GL_WCTYPE_INLINE int +# if @REPLACE_ISWCNTRL@ +rpl_iswlower +# else +iswlower +# endif + (wint_t wc) +{ + return wc >= 'a' && wc <= 'z'; +} + +_GL_WCTYPE_INLINE int +# if @REPLACE_ISWCNTRL@ +rpl_iswprint +# else +iswprint +# endif + (wint_t wc) +{ + return wc >= ' ' && wc <= '~'; +} + +_GL_WCTYPE_INLINE int +# if @REPLACE_ISWCNTRL@ +rpl_iswpunct +# else +iswpunct +# endif + (wint_t wc) +{ + return (wc >= '!' && wc <= '~' + && !((wc >= '0' && wc <= '9') + || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'))); +} + +_GL_WCTYPE_INLINE int +# if @REPLACE_ISWCNTRL@ +rpl_iswspace +# else +iswspace +# endif + (wint_t wc) +{ + return (wc == ' ' || wc == '\t' + || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r'); +} + +_GL_WCTYPE_INLINE int +# if @REPLACE_ISWCNTRL@ +rpl_iswupper +# else +iswupper +# endif + (wint_t wc) +{ + return wc >= 'A' && wc <= 'Z'; +} + +_GL_WCTYPE_INLINE int +# if @REPLACE_ISWCNTRL@ +rpl_iswxdigit +# else +iswxdigit +# endif + (wint_t wc) +{ + return ((wc >= '0' && wc <= '9') + || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F')); +} + +_GL_WCTYPE_INLINE wint_t +# if @REPLACE_TOWLOWER@ +rpl_towlower +# else +towlower +# endif + (wint_t wc) +{ + return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc); +} + +_GL_WCTYPE_INLINE wint_t +# if @REPLACE_TOWLOWER@ +rpl_towupper +# else +towupper +# endif + (wint_t wc) +{ + return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc); +} + +# elif @GNULIB_ISWBLANK@ && (! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@) +/* Only the iswblank function is missing. */ + +# if @REPLACE_ISWBLANK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define iswblank rpl_iswblank +# endif +_GL_FUNCDECL_RPL (iswblank, int, (wint_t wc)); +# else +_GL_FUNCDECL_SYS (iswblank, int, (wint_t wc)); +# endif + +# endif + +# if defined __MINGW32__ + +/* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t. + The functions towlower and towupper are implemented in the MSVCRT library + to take a wchar_t argument and return a wchar_t result. mingw declares + these functions to take a wint_t argument and return a wint_t result. + This means that: + 1. When the user passes an argument outside the range 0x0000..0xFFFF, the + function will look only at the lower 16 bits. This is allowed according + to POSIX. + 2. The return value is returned in the lower 16 bits of the result register. + The upper 16 bits are random: whatever happened to be in that part of the + result register. We need to fix this by adding a zero-extend from + wchar_t to wint_t after the call. */ + +_GL_WCTYPE_INLINE wint_t +rpl_towlower (wint_t wc) +{ + return (wint_t) (wchar_t) towlower (wc); +} +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define towlower rpl_towlower +# endif + +_GL_WCTYPE_INLINE wint_t +rpl_towupper (wint_t wc) +{ + return (wint_t) (wchar_t) towupper (wc); +} +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define towupper rpl_towupper +# endif + +# endif /* __MINGW32__ */ + +# define GNULIB_defined_wctype_functions 1 +#endif + +#if @REPLACE_ISWCNTRL@ +_GL_CXXALIAS_RPL (iswalnum, int, (wint_t wc)); +_GL_CXXALIAS_RPL (iswalpha, int, (wint_t wc)); +_GL_CXXALIAS_RPL (iswcntrl, int, (wint_t wc)); +_GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc)); +_GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc)); +_GL_CXXALIAS_RPL (iswlower, int, (wint_t wc)); +_GL_CXXALIAS_RPL (iswprint, int, (wint_t wc)); +_GL_CXXALIAS_RPL (iswpunct, int, (wint_t wc)); +_GL_CXXALIAS_RPL (iswspace, int, (wint_t wc)); +_GL_CXXALIAS_RPL (iswupper, int, (wint_t wc)); +_GL_CXXALIAS_RPL (iswxdigit, int, (wint_t wc)); +#else +_GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc)); +_GL_CXXALIAS_SYS (iswalpha, int, (wint_t wc)); +_GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc)); +_GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc)); +_GL_CXXALIAS_SYS (iswgraph, int, (wint_t wc)); +_GL_CXXALIAS_SYS (iswlower, int, (wint_t wc)); +_GL_CXXALIAS_SYS (iswprint, int, (wint_t wc)); +_GL_CXXALIAS_SYS (iswpunct, int, (wint_t wc)); +_GL_CXXALIAS_SYS (iswspace, int, (wint_t wc)); +_GL_CXXALIAS_SYS (iswupper, int, (wint_t wc)); +_GL_CXXALIAS_SYS (iswxdigit, int, (wint_t wc)); +#endif +_GL_CXXALIASWARN (iswalnum); +_GL_CXXALIASWARN (iswalpha); +_GL_CXXALIASWARN (iswcntrl); +_GL_CXXALIASWARN (iswdigit); +_GL_CXXALIASWARN (iswgraph); +_GL_CXXALIASWARN (iswlower); +_GL_CXXALIASWARN (iswprint); +_GL_CXXALIASWARN (iswpunct); +_GL_CXXALIASWARN (iswspace); +_GL_CXXALIASWARN (iswupper); +_GL_CXXALIASWARN (iswxdigit); + +#if @GNULIB_ISWBLANK@ +# if @REPLACE_ISWCNTRL@ || @REPLACE_ISWBLANK@ +_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc)); +# else +_GL_CXXALIAS_SYS (iswblank, int, (wint_t wc)); +# endif +_GL_CXXALIASWARN (iswblank); +#endif + +#if !@HAVE_WCTYPE_T@ +# if !GNULIB_defined_wctype_t +typedef void * wctype_t; +# define GNULIB_defined_wctype_t 1 +# endif +#endif + +/* Get a descriptor for a wide character property. */ +#if @GNULIB_WCTYPE@ +# if !@HAVE_WCTYPE_T@ +_GL_FUNCDECL_SYS (wctype, wctype_t, (const char *name)); +# endif +_GL_CXXALIAS_SYS (wctype, wctype_t, (const char *name)); +_GL_CXXALIASWARN (wctype); +#elif defined GNULIB_POSIXCHECK +# undef wctype +# if HAVE_RAW_DECL_WCTYPE +_GL_WARN_ON_USE (wctype, "wctype is unportable - " + "use gnulib module wctype for portability"); +# endif +#endif + +/* Test whether a wide character has a given property. + The argument WC must be either a wchar_t value or WEOF. + The argument DESC must have been returned by the wctype() function. */ +#if @GNULIB_ISWCTYPE@ +# if !@HAVE_WCTYPE_T@ +_GL_FUNCDECL_SYS (iswctype, int, (wint_t wc, wctype_t desc)); +# endif +_GL_CXXALIAS_SYS (iswctype, int, (wint_t wc, wctype_t desc)); +_GL_CXXALIASWARN (iswctype); +#elif defined GNULIB_POSIXCHECK +# undef iswctype +# if HAVE_RAW_DECL_ISWCTYPE +_GL_WARN_ON_USE (iswctype, "iswctype is unportable - " + "use gnulib module iswctype for portability"); +# endif +#endif + +#if @REPLACE_TOWLOWER@ || defined __MINGW32__ +_GL_CXXALIAS_RPL (towlower, wint_t, (wint_t wc)); +_GL_CXXALIAS_RPL (towupper, wint_t, (wint_t wc)); +#else +_GL_CXXALIAS_SYS (towlower, wint_t, (wint_t wc)); +_GL_CXXALIAS_SYS (towupper, wint_t, (wint_t wc)); +#endif +_GL_CXXALIASWARN (towlower); +_GL_CXXALIASWARN (towupper); + +#if !@HAVE_WCTRANS_T@ +# if !GNULIB_defined_wctrans_t +typedef void * wctrans_t; +# define GNULIB_defined_wctrans_t 1 +# endif +#endif + +/* Get a descriptor for a wide character case conversion. */ +#if @GNULIB_WCTRANS@ +# if !@HAVE_WCTRANS_T@ +_GL_FUNCDECL_SYS (wctrans, wctrans_t, (const char *name)); +# endif +_GL_CXXALIAS_SYS (wctrans, wctrans_t, (const char *name)); +_GL_CXXALIASWARN (wctrans); +#elif defined GNULIB_POSIXCHECK +# undef wctrans +# if HAVE_RAW_DECL_WCTRANS +_GL_WARN_ON_USE (wctrans, "wctrans is unportable - " + "use gnulib module wctrans for portability"); +# endif +#endif + +/* Perform a given case conversion on a wide character. + The argument WC must be either a wchar_t value or WEOF. + The argument DESC must have been returned by the wctrans() function. */ +#if @GNULIB_TOWCTRANS@ +# if !@HAVE_WCTRANS_T@ +_GL_FUNCDECL_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc)); +# endif +_GL_CXXALIAS_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc)); +_GL_CXXALIASWARN (towctrans); +#elif defined GNULIB_POSIXCHECK +# undef towctrans +# if HAVE_RAW_DECL_TOWCTRANS +_GL_WARN_ON_USE (towctrans, "towctrans is unportable - " + "use gnulib module towctrans for portability"); +# endif +#endif + +_GL_INLINE_HEADER_END + +#endif /* _@GUARD_PREFIX@_WCTYPE_H */ +#endif /* _@GUARD_PREFIX@_WCTYPE_H */ +#endif diff --git a/local/recipes/tools/diffutils/source/lib/wcwidth.c b/local/recipes/tools/diffutils/source/lib/wcwidth.c new file mode 100644 index 0000000000..038e86575c --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/wcwidth.c @@ -0,0 +1,50 @@ +/* Determine the number of screen columns needed for a character. + Copyright (C) 2006-2007, 2010-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <wchar.h> + +/* Get iswprint. */ +#include <wctype.h> + +#include "localcharset.h" +#include "streq.h" +#include "uniwidth.h" + +int +wcwidth (wchar_t wc) +#undef wcwidth +{ + /* In UTF-8 locales, use a Unicode aware width function. */ + const char *encoding = locale_charset (); + if (STREQ_OPT (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0 ,0)) + { + /* We assume that in a UTF-8 locale, a wide character is the same as a + Unicode character. */ + return uc_width (wc, encoding); + } + else + { + /* Otherwise, fall back to the system's wcwidth function. */ +#if HAVE_WCWIDTH + return wcwidth (wc); +#else + return wc == 0 ? 0 : iswprint (wc) ? 1 : -1; +#endif + } +} diff --git a/local/recipes/tools/diffutils/source/lib/xalloc-die.c b/local/recipes/tools/diffutils/source/lib/xalloc-die.c new file mode 100644 index 0000000000..3a64aa5cb3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xalloc-die.c @@ -0,0 +1,41 @@ +/* Report a memory allocation failure and exit. + + Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2017 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "xalloc.h" + +#include <stdlib.h> + +#include "error.h" +#include "exitfail.h" + +#include "gettext.h" +#define _(msgid) gettext (msgid) + +void +xalloc_die (void) +{ + error (exit_failure, 0, "%s", _("memory exhausted")); + + /* _Noreturn cannot be given to error, since it may return if + its first argument is 0. To help compilers understand the + xalloc_die does not return, call abort. Also, the abort is a + safety feature if exit_failure is 0 (which shouldn't happen). */ + abort (); +} diff --git a/local/recipes/tools/diffutils/source/lib/xalloc-oversized.h b/local/recipes/tools/diffutils/source/lib/xalloc-oversized.h new file mode 100644 index 0000000000..ff0efc6ba4 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xalloc-oversized.h @@ -0,0 +1,60 @@ +/* xalloc-oversized.h -- memory allocation size checking + + Copyright (C) 1990-2000, 2003-2004, 2006-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef XALLOC_OVERSIZED_H_ +#define XALLOC_OVERSIZED_H_ + +#include <stddef.h> +#include <stdint.h> + +/* True if N * S would overflow in a size_t calculation, + or would generate a value larger than PTRDIFF_MAX. + This expands to a constant expression if N and S are both constants. + By gnulib convention, SIZE_MAX represents overflow in size + calculations, so the conservative size_t-based dividend to use here + is SIZE_MAX - 1. */ +#define __xalloc_oversized(n, s) \ + ((size_t) (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX - 1) / (s) < (n)) + +#if PTRDIFF_MAX < SIZE_MAX +typedef ptrdiff_t __xalloc_count_type; +#else +typedef size_t __xalloc_count_type; +#endif + +/* Return 1 if an array of N objects, each of size S, cannot exist + reliably due to size or ptrdiff_t arithmetic overflow. S must be + positive and N must be nonnegative. This is a macro, not a + function, so that it works correctly even when SIZE_MAX < N. */ + +#if 7 <= __GNUC__ +# define xalloc_oversized(n, s) \ + __builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1) +#elif 5 <= __GNUC__ && !__STRICT_ANSI__ +# define xalloc_oversized(n, s) \ + (__builtin_constant_p (n) && __builtin_constant_p (s) \ + ? __xalloc_oversized (n, s) \ + : ({ __xalloc_count_type __xalloc_count; \ + __builtin_mul_overflow (n, s, &__xalloc_count); })) + +/* Other compilers use integer division; this may be slower but is + more portable. */ +#else +# define xalloc_oversized(n, s) __xalloc_oversized (n, s) +#endif + +#endif /* !XALLOC_OVERSIZED_H_ */ diff --git a/local/recipes/tools/diffutils/source/lib/xalloc.h b/local/recipes/tools/diffutils/source/lib/xalloc.h new file mode 100644 index 0000000000..5cf804b44d --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xalloc.h @@ -0,0 +1,268 @@ +/* xalloc.h -- malloc with out-of-memory checking + + Copyright (C) 1990-2000, 2003-2004, 2006-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef XALLOC_H_ +#define XALLOC_H_ + +#include <stddef.h> +#include <stdint.h> + +#include "xalloc-oversized.h" + +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef XALLOC_INLINE +# define XALLOC_INLINE _GL_INLINE +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +#if __GNUC__ >= 3 +# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) +#else +# define _GL_ATTRIBUTE_MALLOC +#endif + +#if ! defined __clang__ && \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) +# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args)) +#else +# define _GL_ATTRIBUTE_ALLOC_SIZE(args) +#endif + +/* This function is always triggered when memory is exhausted. + It must be defined by the application, either explicitly + or by using gnulib's xalloc-die module. This is the + function to call when one wants the program to die because of a + memory allocation failure. */ +extern _Noreturn void xalloc_die (void); + +void *xmalloc (size_t s) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1)); +void *xzalloc (size_t s) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1)); +void *xcalloc (size_t n, size_t s) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1, 2)); +void *xrealloc (void *p, size_t s) + _GL_ATTRIBUTE_ALLOC_SIZE ((2)); +void *x2realloc (void *p, size_t *pn); +void *xmemdup (void const *p, size_t s) + _GL_ATTRIBUTE_ALLOC_SIZE ((2)); +char *xstrdup (char const *str) + _GL_ATTRIBUTE_MALLOC; + +/* In the following macros, T must be an elementary or structure/union or + typedef'ed type, or a pointer to such a type. To apply one of the + following macros to a function pointer or array type, you need to typedef + it first and use the typedef name. */ + +/* Allocate an object of type T dynamically, with error checking. */ +/* extern t *XMALLOC (typename t); */ +#define XMALLOC(t) ((t *) xmalloc (sizeof (t))) + +/* Allocate memory for N elements of type T, with error checking. */ +/* extern t *XNMALLOC (size_t n, typename t); */ +#define XNMALLOC(n, t) \ + ((t *) (sizeof (t) == 1 ? xmalloc (n) : xnmalloc (n, sizeof (t)))) + +/* Allocate an object of type T dynamically, with error checking, + and zero it. */ +/* extern t *XZALLOC (typename t); */ +#define XZALLOC(t) ((t *) xzalloc (sizeof (t))) + +/* Allocate memory for N elements of type T, with error checking, + and zero it. */ +/* extern t *XCALLOC (size_t n, typename t); */ +#define XCALLOC(n, t) \ + ((t *) (sizeof (t) == 1 ? xzalloc (n) : xcalloc (n, sizeof (t)))) + + +/* Allocate an array of N objects, each with S bytes of memory, + dynamically, with error checking. S must be nonzero. */ + +XALLOC_INLINE void *xnmalloc (size_t n, size_t s) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1, 2)); +XALLOC_INLINE void * +xnmalloc (size_t n, size_t s) +{ + if (xalloc_oversized (n, s)) + xalloc_die (); + return xmalloc (n * s); +} + +/* Change the size of an allocated block of memory P to an array of N + objects each of S bytes, with error checking. S must be nonzero. */ + +XALLOC_INLINE void *xnrealloc (void *p, size_t n, size_t s) + _GL_ATTRIBUTE_ALLOC_SIZE ((2, 3)); +XALLOC_INLINE void * +xnrealloc (void *p, size_t n, size_t s) +{ + if (xalloc_oversized (n, s)) + xalloc_die (); + return xrealloc (p, n * s); +} + +/* If P is null, allocate a block of at least *PN such objects; + otherwise, reallocate P so that it contains more than *PN objects + each of S bytes. S must be nonzero. Set *PN to the new number of + objects, and return the pointer to the new block. *PN is never set + to zero, and the returned pointer is never null. + + Repeated reallocations are guaranteed to make progress, either by + allocating an initial block with a nonzero size, or by allocating a + larger block. + + In the following implementation, nonzero sizes are increased by a + factor of approximately 1.5 so that repeated reallocations have + O(N) overall cost rather than O(N**2) cost, but the + specification for this function does not guarantee that rate. + + Here is an example of use: + + int *p = NULL; + size_t used = 0; + size_t allocated = 0; + + void + append_int (int value) + { + if (used == allocated) + p = x2nrealloc (p, &allocated, sizeof *p); + p[used++] = value; + } + + This causes x2nrealloc to allocate a block of some nonzero size the + first time it is called. + + To have finer-grained control over the initial size, set *PN to a + nonzero value before calling this function with P == NULL. For + example: + + int *p = NULL; + size_t used = 0; + size_t allocated = 0; + size_t allocated1 = 1000; + + void + append_int (int value) + { + if (used == allocated) + { + p = x2nrealloc (p, &allocated1, sizeof *p); + allocated = allocated1; + } + p[used++] = value; + } + + */ + +XALLOC_INLINE void * +x2nrealloc (void *p, size_t *pn, size_t s) +{ + size_t n = *pn; + + if (! p) + { + if (! n) + { + /* The approximate size to use for initial small allocation + requests, when the invoking code specifies an old size of + zero. This is the largest "small" request for the GNU C + library malloc. */ + enum { DEFAULT_MXFAST = 64 * sizeof (size_t) / 4 }; + + n = DEFAULT_MXFAST / s; + n += !n; + } + if (xalloc_oversized (n, s)) + xalloc_die (); + } + else + { + /* Set N = floor (1.5 * N) + 1 so that progress is made even if N == 0. + Check for overflow, so that N * S stays in both ptrdiff_t and + size_t range. The check may be slightly conservative, but an + exact check isn't worth the trouble. */ + if ((PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX) / 3 * 2 / s + <= n) + xalloc_die (); + n += n / 2 + 1; + } + + *pn = n; + return xrealloc (p, n * s); +} + +/* Return a pointer to a new buffer of N bytes. This is like xmalloc, + except it returns char *. */ + +XALLOC_INLINE char *xcharalloc (size_t n) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1)); +XALLOC_INLINE char * +xcharalloc (size_t n) +{ + return XNMALLOC (n, char); +} + +#ifdef __cplusplus +} + +/* C++ does not allow conversions from void * to other pointer types + without a cast. Use templates to work around the problem when + possible. */ + +template <typename T> inline T * +xrealloc (T *p, size_t s) +{ + return (T *) xrealloc ((void *) p, s); +} + +template <typename T> inline T * +xnrealloc (T *p, size_t n, size_t s) +{ + return (T *) xnrealloc ((void *) p, n, s); +} + +template <typename T> inline T * +x2realloc (T *p, size_t *pn) +{ + return (T *) x2realloc ((void *) p, pn); +} + +template <typename T> inline T * +x2nrealloc (T *p, size_t *pn, size_t s) +{ + return (T *) x2nrealloc ((void *) p, pn, s); +} + +template <typename T> inline T * +xmemdup (T const *p, size_t s) +{ + return (T *) xmemdup ((void const *) p, s); +} + +#endif + +_GL_INLINE_HEADER_END + +#endif /* !XALLOC_H_ */ diff --git a/local/recipes/tools/diffutils/source/lib/xasprintf.c b/local/recipes/tools/diffutils/source/lib/xasprintf.c new file mode 100644 index 0000000000..b4c2a0035a --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xasprintf.c @@ -0,0 +1,34 @@ +/* vasprintf and asprintf with out-of-memory checking. + Copyright (C) 1999, 2002-2004, 2006, 2009-2017 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "xvasprintf.h" + +char * +xasprintf (const char *format, ...) +{ + va_list args; + char *result; + + va_start (args, format); + result = xvasprintf (format, args); + va_end (args); + + return result; +} diff --git a/local/recipes/tools/diffutils/source/lib/xfreopen.c b/local/recipes/tools/diffutils/source/lib/xfreopen.c new file mode 100644 index 0000000000..5e7163ace6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xfreopen.c @@ -0,0 +1,42 @@ +/* a wrapper for freopen + Copyright (C) 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> +#include "xfreopen.h" + +#include <errno.h> +#include "error.h" +#include "exitfail.h" +#include "quote.h" +#include "stdio--.h" + +#include "gettext.h" +#define _(msgid) gettext (msgid) + +void +xfreopen (char const *filename, char const *mode, FILE *fp) +{ + if (!freopen (filename, mode, fp)) + { + char const *f = (filename ? filename + : (fp == stdin ? _("stdin") + : (fp == stdout ? _("stdout") + : (fp == stderr ? _("stderr") + : _("unknown stream"))))); + error (exit_failure, errno, _("failed to reopen %s with mode %s"), + quote_n (0, f), quote_n (1, mode)); + } +} diff --git a/local/recipes/tools/diffutils/source/lib/xfreopen.h b/local/recipes/tools/diffutils/source/lib/xfreopen.h new file mode 100644 index 0000000000..2ce49b5a4a --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xfreopen.h @@ -0,0 +1,2 @@ +#include <stdio.h> +void xfreopen (char const *filename, char const *mode, FILE *fp); diff --git a/local/recipes/tools/diffutils/source/lib/xmalloc.c b/local/recipes/tools/diffutils/source/lib/xmalloc.c new file mode 100644 index 0000000000..a4d308d24e --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xmalloc.c @@ -0,0 +1,122 @@ +/* xmalloc.c -- malloc with out of memory checking + + Copyright (C) 1990-2000, 2002-2006, 2008-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#define XALLOC_INLINE _GL_EXTERN_INLINE + +#include "xalloc.h" + +#include <stdlib.h> +#include <string.h> + +/* 1 if calloc is known to be compatible with GNU calloc. This + matters if we are not also using the calloc module, which defines + HAVE_CALLOC_GNU and supports the GNU API even on non-GNU platforms. */ +#if defined HAVE_CALLOC_GNU || (defined __GLIBC__ && !defined __UCLIBC__) +enum { HAVE_GNU_CALLOC = 1 }; +#else +enum { HAVE_GNU_CALLOC = 0 }; +#endif + +/* Allocate N bytes of memory dynamically, with error checking. */ + +void * +xmalloc (size_t n) +{ + void *p = malloc (n); + if (!p && n != 0) + xalloc_die (); + return p; +} + +/* Change the size of an allocated block of memory P to N bytes, + with error checking. */ + +void * +xrealloc (void *p, size_t n) +{ + if (!n && p) + { + /* The GNU and C99 realloc behaviors disagree here. Act like + GNU, even if the underlying realloc is C99. */ + free (p); + return NULL; + } + + p = realloc (p, n); + if (!p && n) + xalloc_die (); + return p; +} + +/* If P is null, allocate a block of at least *PN bytes; otherwise, + reallocate P so that it contains more than *PN bytes. *PN must be + nonzero unless P is null. Set *PN to the new block's size, and + return the pointer to the new block. *PN is never set to zero, and + the returned pointer is never null. */ + +void * +x2realloc (void *p, size_t *pn) +{ + return x2nrealloc (p, pn, 1); +} + +/* Allocate S bytes of zeroed memory dynamically, with error checking. + There's no need for xnzalloc (N, S), since it would be equivalent + to xcalloc (N, S). */ + +void * +xzalloc (size_t s) +{ + return memset (xmalloc (s), 0, s); +} + +/* Allocate zeroed memory for N elements of S bytes, with error + checking. S must be nonzero. */ + +void * +xcalloc (size_t n, size_t s) +{ + void *p; + /* Test for overflow, since objects with size greater than + PTRDIFF_MAX cause pointer subtraction to go awry. Omit size-zero + tests if HAVE_GNU_CALLOC, since GNU calloc never returns NULL if + successful. */ + if (xalloc_oversized (n, s) + || (! (p = calloc (n, s)) && (HAVE_GNU_CALLOC || n != 0))) + xalloc_die (); + return p; +} + +/* Clone an object P of size S, with error checking. There's no need + for xnmemdup (P, N, S), since xmemdup (P, N * S) works without any + need for an arithmetic overflow check. */ + +void * +xmemdup (void const *p, size_t s) +{ + return memcpy (xmalloc (s), p, s); +} + +/* Clone STRING. */ + +char * +xstrdup (char const *string) +{ + return xmemdup (string, strlen (string) + 1); +} diff --git a/local/recipes/tools/diffutils/source/lib/xreadlink.c b/local/recipes/tools/diffutils/source/lib/xreadlink.c new file mode 100644 index 0000000000..b7257e8949 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xreadlink.c @@ -0,0 +1,44 @@ +/* xreadlink.c -- readlink wrapper to return the link name in malloc'd storage + + Copyright (C) 2001, 2003-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Jim Meyering <jim@meyering.net> + and Bruno Haible <bruno@clisp.org>. */ + +#include <config.h> + +/* Specification. */ +#include "xreadlink.h" + +#include <errno.h> + +#include "areadlink.h" +#include "xalloc.h" + +/* Call readlink to get the symbolic link value of FILENAME. + Return a pointer to that NUL-terminated string in malloc'd storage. + If readlink fails, return NULL and set errno. + If realloc fails, or if the link value is longer than SIZE_MAX :-), + give a diagnostic and exit. */ + +char * +xreadlink (char const *filename) +{ + char *result = areadlink (filename); + if (result == NULL && errno == ENOMEM) + xalloc_die (); + return result; +} diff --git a/local/recipes/tools/diffutils/source/lib/xreadlink.h b/local/recipes/tools/diffutils/source/lib/xreadlink.h new file mode 100644 index 0000000000..e5eed6e7cd --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xreadlink.h @@ -0,0 +1,25 @@ +/* Reading symbolic links without size limitation. + + Copyright (C) 2001, 2003-2004, 2007, 2009-2017 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Jim Meyering <jim@meyering.net> */ + +extern char *xreadlink (char const *filename); + +#if GNULIB_XREADLINKAT +extern char *xreadlinkat (int fd, char const *filename); +#endif diff --git a/local/recipes/tools/diffutils/source/lib/xsize.c b/local/recipes/tools/diffutils/source/lib/xsize.c new file mode 100644 index 0000000000..4b4914c2ca --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xsize.c @@ -0,0 +1,3 @@ +#include <config.h> +#define XSIZE_INLINE _GL_EXTERN_INLINE +#include "xsize.h" diff --git a/local/recipes/tools/diffutils/source/lib/xsize.h b/local/recipes/tools/diffutils/source/lib/xsize.h new file mode 100644 index 0000000000..daf78d601d --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xsize.h @@ -0,0 +1,117 @@ +/* xsize.h -- Checked size_t computations. + + Copyright (C) 2003, 2008-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _XSIZE_H +#define _XSIZE_H + +/* Get size_t. */ +#include <stddef.h> + +/* Get SIZE_MAX. */ +#include <limits.h> +#if HAVE_STDINT_H +# include <stdint.h> +#endif + +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef XSIZE_INLINE +# define XSIZE_INLINE _GL_INLINE +#endif + +/* The size of memory objects is often computed through expressions of + type size_t. Example: + void* p = malloc (header_size + n * element_size). + These computations can lead to overflow. When this happens, malloc() + returns a piece of memory that is way too small, and the program then + crashes while attempting to fill the memory. + To avoid this, the functions and macros in this file check for overflow. + The convention is that SIZE_MAX represents overflow. + malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc + implementation that uses mmap --, it's recommended to use size_overflow_p() + or size_in_bounds_p() before invoking malloc(). + The example thus becomes: + size_t size = xsum (header_size, xtimes (n, element_size)); + void *p = (size_in_bounds_p (size) ? malloc (size) : NULL); +*/ + +/* Convert an arbitrary value >= 0 to type size_t. */ +#define xcast_size_t(N) \ + ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX) + +/* Sum of two sizes, with overflow check. */ +XSIZE_INLINE size_t +#if __GNUC__ >= 3 +__attribute__ ((__pure__)) +#endif +xsum (size_t size1, size_t size2) +{ + size_t sum = size1 + size2; + return (sum >= size1 ? sum : SIZE_MAX); +} + +/* Sum of three sizes, with overflow check. */ +XSIZE_INLINE size_t +#if __GNUC__ >= 3 +__attribute__ ((__pure__)) +#endif +xsum3 (size_t size1, size_t size2, size_t size3) +{ + return xsum (xsum (size1, size2), size3); +} + +/* Sum of four sizes, with overflow check. */ +XSIZE_INLINE size_t +#if __GNUC__ >= 3 +__attribute__ ((__pure__)) +#endif +xsum4 (size_t size1, size_t size2, size_t size3, size_t size4) +{ + return xsum (xsum (xsum (size1, size2), size3), size4); +} + +/* Maximum of two sizes, with overflow check. */ +XSIZE_INLINE size_t +#if __GNUC__ >= 3 +__attribute__ ((__pure__)) +#endif +xmax (size_t size1, size_t size2) +{ + /* No explicit check is needed here, because for any n: + max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */ + return (size1 >= size2 ? size1 : size2); +} + +/* Multiplication of a count with an element size, with overflow check. + The count must be >= 0 and the element size must be > 0. + This is a macro, not a function, so that it works correctly even + when N is of a wider type and N > SIZE_MAX. */ +#define xtimes(N, ELSIZE) \ + ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX) + +/* Check for overflow. */ +#define size_overflow_p(SIZE) \ + ((SIZE) == SIZE_MAX) +/* Check against overflow. */ +#define size_in_bounds_p(SIZE) \ + ((SIZE) != SIZE_MAX) + +_GL_INLINE_HEADER_END + +#endif /* _XSIZE_H */ diff --git a/local/recipes/tools/diffutils/source/lib/xstriconv.c b/local/recipes/tools/diffutils/source/lib/xstriconv.c new file mode 100644 index 0000000000..21546b6a4f --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xstriconv.c @@ -0,0 +1,62 @@ +/* Charset conversion with out-of-memory checking. + Copyright (C) 2001-2004, 2006, 2009-2017 Free Software Foundation, Inc. + Written by Bruno Haible. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "xstriconv.h" + +#include <errno.h> + +#include "striconv.h" +#include "xalloc.h" + + +#if HAVE_ICONV + +int +xmem_cd_iconv (const char *src, size_t srclen, iconv_t cd, + char **resultp, size_t *lengthp) +{ + int retval = mem_cd_iconv (src, srclen, cd, resultp, lengthp); + + if (retval < 0 && errno == ENOMEM) + xalloc_die (); + return retval; +} + +char * +xstr_cd_iconv (const char *src, iconv_t cd) +{ + char *result = str_cd_iconv (src, cd); + + if (result == NULL && errno == ENOMEM) + xalloc_die (); + return result; +} + +#endif + +char * +xstr_iconv (const char *src, const char *from_codeset, const char *to_codeset) +{ + char *result = str_iconv (src, from_codeset, to_codeset); + + if (result == NULL && errno == ENOMEM) + xalloc_die (); + return result; +} diff --git a/local/recipes/tools/diffutils/source/lib/xstriconv.h b/local/recipes/tools/diffutils/source/lib/xstriconv.h new file mode 100644 index 0000000000..d93c268e6b --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xstriconv.h @@ -0,0 +1,78 @@ +/* Charset conversion with out-of-memory checking. + Copyright (C) 2001-2004, 2006-2007, 2009-2017 Free Software Foundation, Inc. + Written by Bruno Haible and Simon Josefsson. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _XSTRICONV_H +#define _XSTRICONV_H + +#include <stddef.h> +#if HAVE_ICONV +#include <iconv.h> +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +#if HAVE_ICONV + +/* Convert an entire string from one encoding to another, using iconv. + The original string is at [SRC,...,SRC+SRCLEN-1]. + The conversion descriptor is passed as CD. + *RESULTP and *LENGTH should initially be a scratch buffer and its size, + or *RESULTP can initially be NULL. + May erase the contents of the memory at *RESULTP. + Upon memory allocation failure, report the error and exit. + Return value: 0 if successful, otherwise -1 and errno set. + If successful: The resulting string is stored in *RESULTP and its length + in *LENGTHP. *RESULTP is set to a freshly allocated memory block, or is + unchanged if no dynamic memory allocation was necessary. */ +extern int xmem_cd_iconv (const char *src, size_t srclen, iconv_t cd, + char **resultp, size_t *lengthp); + +/* Convert an entire string from one encoding to another, using iconv. + The original string is the NUL-terminated string starting at SRC. + The conversion descriptor is passed as CD. Both the "from" and the "to" + encoding must use a single NUL byte at the end of the string (i.e. not + UCS-2, UCS-4, UTF-16, UTF-32). + Allocate a malloced memory block for the result. + Upon memory allocation failure, report the error and exit. + Return value: the freshly allocated resulting NUL-terminated string if + successful, otherwise NULL and errno set. */ +extern char * xstr_cd_iconv (const char *src, iconv_t cd); + +#endif + +/* Convert an entire string from one encoding to another, using iconv. + The original string is the NUL-terminated string starting at SRC. + Both the "from" and the "to" encoding must use a single NUL byte at the + end of the string (i.e. not UCS-2, UCS-4, UTF-16, UTF-32). + Allocate a malloced memory block for the result. + Upon memory allocation failure, report the error and exit. + Return value: the freshly allocated resulting NUL-terminated string if + successful, otherwise NULL and errno set. */ +extern char * xstr_iconv (const char *src, + const char *from_codeset, const char *to_codeset); + + +#ifdef __cplusplus +} +#endif + + +#endif /* _XSTRICONV_H */ diff --git a/local/recipes/tools/diffutils/source/lib/xstrndup.c b/local/recipes/tools/diffutils/source/lib/xstrndup.c new file mode 100644 index 0000000000..8fbef7f073 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xstrndup.c @@ -0,0 +1,36 @@ +/* Duplicate a bounded initial segment of a string, with out-of-memory + checking. + Copyright (C) 2003, 2006-2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "xstrndup.h" + +#include <string.h> +#include "xalloc.h" + +/* Return a newly allocated copy of at most N bytes of STRING. + In other words, return a copy of the initial segment of length N of + STRING. */ +char * +xstrndup (const char *string, size_t n) +{ + char *s = strndup (string, n); + if (! s) + xalloc_die (); + return s; +} diff --git a/local/recipes/tools/diffutils/source/lib/xstrndup.h b/local/recipes/tools/diffutils/source/lib/xstrndup.h new file mode 100644 index 0000000000..d901c2c303 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xstrndup.h @@ -0,0 +1,23 @@ +/* Duplicate a bounded initial segment of a string, with out-of-memory + checking. + Copyright (C) 2003, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <stddef.h> + +/* Return a newly allocated copy of at most N bytes of STRING. + In other words, return a copy of the initial segment of length N of + STRING. */ +extern char *xstrndup (const char *string, size_t n); diff --git a/local/recipes/tools/diffutils/source/lib/xstrtol-error.c b/local/recipes/tools/diffutils/source/lib/xstrtol-error.c new file mode 100644 index 0000000000..18bf5afff0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xstrtol-error.c @@ -0,0 +1,98 @@ +/* A more useful interface to strtol. + + Copyright (C) 1995-1996, 1998-1999, 2001-2004, 2006-2017 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> +#include "xstrtol.h" + +#include <stdlib.h> + +#include "error.h" +#include "exitfail.h" +#include "gettext.h" + +#define N_(msgid) msgid + +/* Report an error for an invalid integer in an option argument. + + ERR is the error code returned by one of the xstrto* functions. + + Use OPT_IDX to decide whether to print the short option string "C" + or "-C" or a long option string derived from LONG_OPTION. OPT_IDX + is -2 if the short option "C" was used, without any leading "-"; it + is -1 if the short option "-C" was used; otherwise it is an index + into LONG_OPTIONS, which should have a name preceded by two '-' + characters. + + ARG is the option-argument containing the integer. + + After reporting an error, exit with status EXIT_STATUS if it is + nonzero. */ + +static void +xstrtol_error (enum strtol_error err, + int opt_idx, char c, struct option const *long_options, + char const *arg, + int exit_status) +{ + char const *hyphens = "--"; + char const *msgid; + char const *option; + char option_buffer[2]; + + switch (err) + { + default: + abort (); + + case LONGINT_INVALID: + msgid = N_("invalid %s%s argument '%s'"); + break; + + case LONGINT_INVALID_SUFFIX_CHAR: + case LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW: + msgid = N_("invalid suffix in %s%s argument '%s'"); + break; + + case LONGINT_OVERFLOW: + msgid = N_("%s%s argument '%s' too large"); + break; + } + + if (opt_idx < 0) + { + hyphens -= opt_idx; + option_buffer[0] = c; + option_buffer[1] = '\0'; + option = option_buffer; + } + else + option = long_options[opt_idx].name; + + error (exit_status, 0, gettext (msgid), hyphens, option, arg); +} + +/* Like xstrtol_error, except exit with a failure status. */ + +void +xstrtol_fatal (enum strtol_error err, + int opt_idx, char c, struct option const *long_options, + char const *arg) +{ + xstrtol_error (err, opt_idx, c, long_options, arg, exit_failure); + abort (); +} diff --git a/local/recipes/tools/diffutils/source/lib/xstrtol.c b/local/recipes/tools/diffutils/source/lib/xstrtol.c new file mode 100644 index 0000000000..2ec26f0fe8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xstrtol.c @@ -0,0 +1,249 @@ +/* A more useful interface to strtol. + + Copyright (C) 1995-1996, 1998-2001, 2003-2007, 2009-2017 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Jim Meyering. */ + +#ifndef __strtol +# define __strtol strtol +# define __strtol_t long int +# define __xstrtol xstrtol +# define STRTOL_T_MINIMUM LONG_MIN +# define STRTOL_T_MAXIMUM LONG_MAX +#endif + +#include <config.h> + +#include "xstrtol.h" + +/* Some pre-ANSI implementations (e.g. SunOS 4) + need stderr defined if assertion checking is enabled. */ +#include <stdio.h> + +#include <ctype.h> +#include <errno.h> +#include <limits.h> +#include <stdlib.h> +#include <string.h> + +#include "assure.h" +#include "intprops.h" + +/* xstrtoll.c and xstrtoull.c, which include this file, require that + ULLONG_MAX, LLONG_MAX, LLONG_MIN are defined, but <limits.h> does not + define them on all platforms. */ +#ifndef ULLONG_MAX +# define ULLONG_MAX TYPE_MAXIMUM (unsigned long long) +#endif +#ifndef LLONG_MAX +# define LLONG_MAX TYPE_MAXIMUM (long long int) +#endif +#ifndef LLONG_MIN +# define LLONG_MIN TYPE_MINIMUM (long long int) +#endif + +static strtol_error +bkm_scale (__strtol_t *x, int scale_factor) +{ + if (TYPE_SIGNED (__strtol_t) && *x < STRTOL_T_MINIMUM / scale_factor) + { + *x = STRTOL_T_MINIMUM; + return LONGINT_OVERFLOW; + } + if (STRTOL_T_MAXIMUM / scale_factor < *x) + { + *x = STRTOL_T_MAXIMUM; + return LONGINT_OVERFLOW; + } + *x *= scale_factor; + return LONGINT_OK; +} + +static strtol_error +bkm_scale_by_power (__strtol_t *x, int base, int power) +{ + strtol_error err = LONGINT_OK; + while (power--) + err |= bkm_scale (x, base); + return err; +} + +/* FIXME: comment. */ + +strtol_error +__xstrtol (const char *s, char **ptr, int strtol_base, + __strtol_t *val, const char *valid_suffixes) +{ + char *t_ptr; + char **p; + __strtol_t tmp; + strtol_error err = LONGINT_OK; + + assure (0 <= strtol_base && strtol_base <= 36); + + p = (ptr ? ptr : &t_ptr); + + errno = 0; + + if (! TYPE_SIGNED (__strtol_t)) + { + const char *q = s; + unsigned char ch = *q; + while (isspace (ch)) + ch = *++q; + if (ch == '-') + return LONGINT_INVALID; + } + + tmp = __strtol (s, p, strtol_base); + + if (*p == s) + { + /* If there is no number but there is a valid suffix, assume the + number is 1. The string is invalid otherwise. */ + if (valid_suffixes && **p && strchr (valid_suffixes, **p)) + tmp = 1; + else + return LONGINT_INVALID; + } + else if (errno != 0) + { + if (errno != ERANGE) + return LONGINT_INVALID; + err = LONGINT_OVERFLOW; + } + + /* Let valid_suffixes == NULL mean "allow any suffix". */ + /* FIXME: update all callers except the ones that allow suffixes + after the number, changing last parameter NULL to "". */ + if (!valid_suffixes) + { + *val = tmp; + return err; + } + + if (**p != '\0') + { + int base = 1024; + int suffixes = 1; + strtol_error overflow; + + if (!strchr (valid_suffixes, **p)) + { + *val = tmp; + return err | LONGINT_INVALID_SUFFIX_CHAR; + } + + switch (**p) + { + case 'E': case 'G': case 'g': case 'k': case 'K': case 'M': case 'm': + case 'P': case 'T': case 't': case 'Y': case 'Z': + + /* The "valid suffix" '0' is a special flag meaning that + an optional second suffix is allowed, which can change + the base. A suffix "B" (e.g. "100MB") stands for a power + of 1000, whereas a suffix "iB" (e.g. "100MiB") stands for + a power of 1024. If no suffix (e.g. "100M"), assume + power-of-1024. */ + + if (strchr (valid_suffixes, '0')) + switch (p[0][1]) + { + case 'i': + if (p[0][2] == 'B') + suffixes += 2; + break; + + case 'B': + case 'D': /* 'D' is obsolescent */ + base = 1000; + suffixes++; + break; + } + } + + switch (**p) + { + case 'b': + overflow = bkm_scale (&tmp, 512); + break; + + case 'B': + /* This obsolescent first suffix is distinct from the 'B' + second suffix above. E.g., 'tar -L 1000B' means change + the tape after writing 1000 KiB of data. */ + overflow = bkm_scale (&tmp, 1024); + break; + + case 'c': + overflow = LONGINT_OK; + break; + + case 'E': /* exa or exbi */ + overflow = bkm_scale_by_power (&tmp, base, 6); + break; + + case 'G': /* giga or gibi */ + case 'g': /* 'g' is undocumented; for compatibility only */ + overflow = bkm_scale_by_power (&tmp, base, 3); + break; + + case 'k': /* kilo */ + case 'K': /* kibi */ + overflow = bkm_scale_by_power (&tmp, base, 1); + break; + + case 'M': /* mega or mebi */ + case 'm': /* 'm' is undocumented; for compatibility only */ + overflow = bkm_scale_by_power (&tmp, base, 2); + break; + + case 'P': /* peta or pebi */ + overflow = bkm_scale_by_power (&tmp, base, 5); + break; + + case 'T': /* tera or tebi */ + case 't': /* 't' is undocumented; for compatibility only */ + overflow = bkm_scale_by_power (&tmp, base, 4); + break; + + case 'w': + overflow = bkm_scale (&tmp, 2); + break; + + case 'Y': /* yotta or 2**80 */ + overflow = bkm_scale_by_power (&tmp, base, 8); + break; + + case 'Z': /* zetta or 2**70 */ + overflow = bkm_scale_by_power (&tmp, base, 7); + break; + + default: + *val = tmp; + return err | LONGINT_INVALID_SUFFIX_CHAR; + } + + err |= overflow; + *p += suffixes; + if (**p) + err |= LONGINT_INVALID_SUFFIX_CHAR; + } + + *val = tmp; + return err; +} diff --git a/local/recipes/tools/diffutils/source/lib/xstrtol.h b/local/recipes/tools/diffutils/source/lib/xstrtol.h new file mode 100644 index 0000000000..7d2e8cf04c --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xstrtol.h @@ -0,0 +1,73 @@ +/* A more useful interface to strtol. + + Copyright (C) 1995-1996, 1998-1999, 2001-2004, 2006-2017 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef XSTRTOL_H_ +# define XSTRTOL_H_ 1 + +# include <getopt.h> +# include <inttypes.h> + +# ifndef _STRTOL_ERROR +enum strtol_error + { + LONGINT_OK = 0, + + /* These two values can be ORed together, to indicate that both + errors occurred. */ + LONGINT_OVERFLOW = 1, + LONGINT_INVALID_SUFFIX_CHAR = 2, + + LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW = (LONGINT_INVALID_SUFFIX_CHAR + | LONGINT_OVERFLOW), + LONGINT_INVALID = 4 + }; +typedef enum strtol_error strtol_error; +# endif + +# define _DECLARE_XSTRTOL(name, type) \ + strtol_error name (const char *, char **, int, type *, const char *); +_DECLARE_XSTRTOL (xstrtol, long int) +_DECLARE_XSTRTOL (xstrtoul, unsigned long int) +_DECLARE_XSTRTOL (xstrtoimax, intmax_t) +_DECLARE_XSTRTOL (xstrtoumax, uintmax_t) + +#if HAVE_LONG_LONG_INT +_DECLARE_XSTRTOL (xstrtoll, long long int) +_DECLARE_XSTRTOL (xstrtoull, unsigned long long int) +#endif + +/* Report an error for an invalid integer in an option argument. + + ERR is the error code returned by one of the xstrto* functions. + + Use OPT_IDX to decide whether to print the short option string "C" + or "-C" or a long option string derived from LONG_OPTION. OPT_IDX + is -2 if the short option "C" was used, without any leading "-"; it + is -1 if the short option "-C" was used; otherwise it is an index + into LONG_OPTIONS, which should have a name preceded by two '-' + characters. + + ARG is the option-argument containing the integer. + + After reporting an error, exit with a failure status. */ + +_Noreturn void xstrtol_fatal (enum strtol_error, + int, char, struct option const *, + char const *); + +#endif /* not XSTRTOL_H_ */ diff --git a/local/recipes/tools/diffutils/source/lib/xstrtoul.c b/local/recipes/tools/diffutils/source/lib/xstrtoul.c new file mode 100644 index 0000000000..285f7b96f8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xstrtoul.c @@ -0,0 +1,6 @@ +#define __strtol strtoul +#define __strtol_t unsigned long int +#define __xstrtol xstrtoul +#define STRTOL_T_MINIMUM 0 +#define STRTOL_T_MAXIMUM ULONG_MAX +#include "xstrtol.c" diff --git a/local/recipes/tools/diffutils/source/lib/xstrtoumax.c b/local/recipes/tools/diffutils/source/lib/xstrtoumax.c new file mode 100644 index 0000000000..9a2349f00d --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xstrtoumax.c @@ -0,0 +1,6 @@ +#define __strtol strtoumax +#define __strtol_t uintmax_t +#define __xstrtol xstrtoumax +#define STRTOL_T_MINIMUM 0 +#define STRTOL_T_MAXIMUM UINTMAX_MAX +#include "xstrtol.c" diff --git a/local/recipes/tools/diffutils/source/lib/xvasprintf.c b/local/recipes/tools/diffutils/source/lib/xvasprintf.c new file mode 100644 index 0000000000..c04cfd6985 --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xvasprintf.c @@ -0,0 +1,110 @@ +/* vasprintf and asprintf with out-of-memory checking. + Copyright (C) 1999, 2002-2004, 2006-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "xvasprintf.h" + +#include <errno.h> +#include <limits.h> +#include <string.h> +#include <stdio.h> + +#include "xalloc.h" + +/* Checked size_t computations. */ +#include "xsize.h" + +static char * +xstrcat (size_t argcount, va_list args) +{ + char *result; + va_list ap; + size_t totalsize; + size_t i; + char *p; + + /* Determine the total size. */ + totalsize = 0; + va_copy (ap, args); + for (i = argcount; i > 0; i--) + { + const char *next = va_arg (ap, const char *); + totalsize = xsum (totalsize, strlen (next)); + } + va_end (ap); + + /* Test for overflow in the summing pass above or in (totalsize + 1) below. + Also, don't return a string longer than INT_MAX, for consistency with + vasprintf(). */ + if (totalsize == SIZE_MAX || totalsize > INT_MAX) + { + errno = EOVERFLOW; + return NULL; + } + + /* Allocate and fill the result string. */ + result = XNMALLOC (totalsize + 1, char); + p = result; + for (i = argcount; i > 0; i--) + { + const char *next = va_arg (args, const char *); + size_t len = strlen (next); + memcpy (p, next, len); + p += len; + } + *p = '\0'; + + return result; +} + +char * +xvasprintf (const char *format, va_list args) +{ + char *result; + + /* Recognize the special case format = "%s...%s". It is a frequently used + idiom for string concatenation and needs to be fast. We don't want to + have a separate function xstrcat() for this purpose. */ + { + size_t argcount = 0; + const char *f; + + for (f = format;;) + { + if (*f == '\0') + /* Recognized the special case of string concatenation. */ + return xstrcat (argcount, args); + if (*f != '%') + break; + f++; + if (*f != 's') + break; + f++; + argcount++; + } + } + + if (vasprintf (&result, format, args) < 0) + { + if (errno == ENOMEM) + xalloc_die (); + return NULL; + } + + return result; +} diff --git a/local/recipes/tools/diffutils/source/lib/xvasprintf.h b/local/recipes/tools/diffutils/source/lib/xvasprintf.h new file mode 100644 index 0000000000..9481574e6c --- /dev/null +++ b/local/recipes/tools/diffutils/source/lib/xvasprintf.h @@ -0,0 +1,55 @@ +/* vasprintf and asprintf with out-of-memory checking. + Copyright (C) 2002-2004, 2006-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _XVASPRINTF_H +#define _XVASPRINTF_H + +/* Get va_list. */ +#include <stdarg.h> + +/* The __attribute__ feature is available in gcc versions 2.5 and later. + The __-protected variants of the attributes 'format' and 'printf' are + accepted by gcc versions 2.6.4 (effectively 2.7) and later. + We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because + gnulib and libintl do '#define printf __printf__' when they override + the 'printf' function. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) +#else +# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Write formatted output to a string dynamically allocated with malloc(), + and return it. Upon [ENOMEM] memory allocation error, call xalloc_die. + On some other error + - [EOVERFLOW] resulting string length is > INT_MAX, + - [EINVAL] invalid format string, + - [EILSEQ] error during conversion between wide and multibyte characters, + return NULL. */ +extern char *xasprintf (const char *format, ...) + _GL_ATTRIBUTE_FORMAT ((__printf__, 1, 2)); +extern char *xvasprintf (const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT ((__printf__, 1, 0)); + +#ifdef __cplusplus +} +#endif + +#endif /* _XVASPRINTF_H */ diff --git a/local/recipes/tools/diffutils/source/m4/00gnulib.m4 b/local/recipes/tools/diffutils/source/m4/00gnulib.m4 new file mode 100644 index 0000000000..bb3512fd52 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/00gnulib.m4 @@ -0,0 +1,46 @@ +# 00gnulib.m4 serial 3 +dnl Copyright (C) 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This file must be named something that sorts before all other +dnl gnulib-provided .m4 files. It is needed until such time as we can +dnl assume Autoconf 2.64, with its improved AC_DEFUN_ONCE and +dnl m4_divert semantics. + +# Until autoconf 2.63, handling of the diversion stack required m4_init +# to be called first; but this does not happen with aclocal. Wrapping +# the entire execution in another layer of the diversion stack fixes this. +# Worse, prior to autoconf 2.62, m4_wrap depended on the underlying m4 +# for whether it was FIFO or LIFO; in order to properly balance with +# m4_init, we need to undo our push just before anything wrapped within +# the m4_init body. The way to ensure this is to wrap both sides of +# m4_init with a one-shot macro that does the pop at the right time. +m4_ifndef([_m4_divert_diversion], +[m4_divert_push([KILL]) +m4_define([gl_divert_fixup], [m4_divert_pop()m4_define([$0])]) +m4_define([m4_init], + [gl_divert_fixup()]m4_defn([m4_init])[gl_divert_fixup()])]) + + +# AC_DEFUN_ONCE([NAME], VALUE) +# ---------------------------- +# Define NAME to expand to VALUE on the first use (whether by direct +# expansion, or by AC_REQUIRE), and to nothing on all subsequent uses. +# Avoid bugs in AC_REQUIRE in Autoconf 2.63 and earlier. This +# definition is slower than the version in Autoconf 2.64, because it +# can only use interfaces that existed since 2.59; but it achieves the +# same effect. Quoting is necessary to avoid confusing Automake. +m4_version_prereq([2.63.263], [], +[m4_define([AC][_DEFUN_ONCE], + [AC][_DEFUN([$1], + [AC_REQUIRE([_gl_DEFUN_ONCE([$1])], + [m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl +[AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])]) + +# gl_00GNULIB +# ----------- +# Witness macro that this file has been included. Needed to force +# Automake to include this file prior to all other gnulib .m4 files. +AC_DEFUN([gl_00GNULIB]) diff --git a/local/recipes/tools/diffutils/source/m4/absolute-header.m4 b/local/recipes/tools/diffutils/source/m4/absolute-header.m4 new file mode 100644 index 0000000000..c73adc82d2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/absolute-header.m4 @@ -0,0 +1,102 @@ +# absolute-header.m4 serial 16 +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Derek Price. + +# gl_ABSOLUTE_HEADER(HEADER1 HEADER2 ...) +# --------------------------------------- +# Find the absolute name of a header file, testing first if the header exists. +# If the header were sys/inttypes.h, this macro would define +# ABSOLUTE_SYS_INTTYPES_H to the '""' quoted absolute name of sys/inttypes.h +# in config.h +# (e.g. '#define ABSOLUTE_SYS_INTTYPES_H "///usr/include/sys/inttypes.h"'). +# The three "///" are to pacify Sun C 5.8, which otherwise would say +# "warning: #include of /usr/include/... may be non-portable". +# Use '""', not '<>', so that the /// cannot be confused with a C99 comment. +# Note: This macro assumes that the header file is not empty after +# preprocessing, i.e. it does not only define preprocessor macros but also +# provides some type/enum definitions or function/variable declarations. +AC_DEFUN([gl_ABSOLUTE_HEADER], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_PREPROC_REQUIRE()dnl +dnl FIXME: gl_absolute_header and ac_header_exists must be used unquoted +dnl until we can assume autoconf 2.64 or newer. +m4_foreach_w([gl_HEADER_NAME], [$1], + [AS_VAR_PUSHDEF([gl_absolute_header], + [gl_cv_absolute_]m4_defn([gl_HEADER_NAME]))dnl + AC_CACHE_CHECK([absolute name of <]m4_defn([gl_HEADER_NAME])[>], + m4_defn([gl_absolute_header]), + [AS_VAR_PUSHDEF([ac_header_exists], + [ac_cv_header_]m4_defn([gl_HEADER_NAME]))dnl + AC_CHECK_HEADERS_ONCE(m4_defn([gl_HEADER_NAME]))dnl + if test AS_VAR_GET(ac_header_exists) = yes; then + gl_ABSOLUTE_HEADER_ONE(m4_defn([gl_HEADER_NAME])) + fi + AS_VAR_POPDEF([ac_header_exists])dnl + ])dnl + AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_defn([gl_HEADER_NAME])), + ["AS_VAR_GET(gl_absolute_header)"], + [Define this to an absolute name of <]m4_defn([gl_HEADER_NAME])[>.]) + AS_VAR_POPDEF([gl_absolute_header])dnl +])dnl +])# gl_ABSOLUTE_HEADER + +# gl_ABSOLUTE_HEADER_ONE(HEADER) +# ------------------------------ +# Like gl_ABSOLUTE_HEADER, except that: +# - it assumes that the header exists, +# - it uses the current CPPFLAGS, +# - it does not cache the result, +# - it is silent. +AC_DEFUN([gl_ABSOLUTE_HEADER_ONE], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote([$1])[[>]])]) + dnl AIX "xlc -E" and "cc -E" omit #line directives for header files + dnl that contain only a #include of other header files and no + dnl non-comment tokens of their own. This leads to a failure to + dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h> + dnl and others. The workaround is to force preservation of comments + dnl through option -C. This ensures all necessary #line directives + dnl are present. GCC supports option -C as well. + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac +changequote(,) + case "$host_os" in + mingw*) + dnl For the sake of native Windows compilers (excluding gcc), + dnl treat backslash as a directory separator, like /. + dnl Actually, these compilers use a double-backslash as + dnl directory separator, inside the + dnl # line "filename" + dnl directives. + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + dnl A sed expression that turns a string into a basic regular + dnl expression, for use within "/.../". + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo '$1' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' +changequote([,]) + dnl eval is necessary to expand gl_absname_cpp. + dnl Ultrix and Pyramid sh refuse to redirect output of eval, + dnl so use subshell. + AS_VAR_SET([gl_cv_absolute_]AS_TR_SH([[$1]]), +[`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | + sed -n "$gl_absolute_header_sed"`]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/alloca.m4 b/local/recipes/tools/diffutils/source/m4/alloca.m4 new file mode 100644 index 0000000000..7f0604cbda --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/alloca.m4 @@ -0,0 +1,121 @@ +# alloca.m4 serial 14 +dnl Copyright (C) 2002-2004, 2006-2007, 2009-2017 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_ALLOCA], +[ + AC_REQUIRE([AC_FUNC_ALLOCA]) + if test $ac_cv_func_alloca_works = no; then + gl_PREREQ_ALLOCA + fi + + # Define an additional variable used in the Makefile substitution. + if test $ac_cv_working_alloca_h = yes; then + AC_CACHE_CHECK([for alloca as a compiler built-in], [gl_cv_rpl_alloca], [ + AC_EGREP_CPP([Need own alloca], [ +#if defined __GNUC__ || defined _AIX || defined _MSC_VER + Need own alloca +#endif + ], [gl_cv_rpl_alloca=yes], [gl_cv_rpl_alloca=no]) + ]) + if test $gl_cv_rpl_alloca = yes; then + dnl OK, alloca can be implemented through a compiler built-in. + AC_DEFINE([HAVE_ALLOCA], [1], + [Define to 1 if you have 'alloca' after including <alloca.h>, + a header that may be supplied by this distribution.]) + ALLOCA_H=alloca.h + else + dnl alloca exists as a library function, i.e. it is slow and probably + dnl a memory leak. Don't define HAVE_ALLOCA in this case. + ALLOCA_H= + fi + else + ALLOCA_H=alloca.h + fi + AC_SUBST([ALLOCA_H]) + AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"]) +]) + +# Prerequisites of lib/alloca.c. +# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA. +AC_DEFUN([gl_PREREQ_ALLOCA], [:]) + +# This works around a bug in autoconf <= 2.68. +# See <http://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00277.html>. + +m4_version_prereq([2.69], [] ,[ + +# This is taken from the following Autoconf patch: +# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497 + +# _AC_LIBOBJ_ALLOCA +# ----------------- +# Set up the LIBOBJ replacement of 'alloca'. Well, not exactly +# AC_LIBOBJ since we actually set the output variable 'ALLOCA'. +# Nevertheless, for Automake, AC_LIBSOURCES it. +m4_define([_AC_LIBOBJ_ALLOCA], +[# The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. +AC_LIBSOURCES(alloca.c) +AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl +AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.]) + +AC_CACHE_CHECK(whether 'alloca.c' needs Cray hooks, ac_cv_os_cray, +[AC_EGREP_CPP(webecray, +[#if defined CRAY && ! defined CRAY2 +webecray +#else +wenotbecray +#endif +], ac_cv_os_cray=yes, ac_cv_os_cray=no)]) +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + AC_CHECK_FUNC($ac_func, + [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func, + [Define to one of '_getb67', 'GETB67', + 'getb67' for Cray-2 and Cray-YMP + systems. This function is required for + 'alloca.c' support on those systems.]) + break]) + done +fi + +AC_CACHE_CHECK([stack direction for C alloca], + [ac_cv_c_stack_direction], +[AC_RUN_IFELSE([AC_LANG_SOURCE( +[AC_INCLUDES_DEFAULT +int +find_stack_direction (int *addr, int depth) +{ + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; +} + +int +main (int argc, char **argv) +{ + return find_stack_direction (0, argc + !argv + 20) < 0; +}])], + [ac_cv_c_stack_direction=1], + [ac_cv_c_stack_direction=-1], + [ac_cv_c_stack_direction=0])]) +AH_VERBATIM([STACK_DIRECTION], +[/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +@%:@undef STACK_DIRECTION])dnl +AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) +])# _AC_LIBOBJ_ALLOCA +]) diff --git a/local/recipes/tools/diffutils/source/m4/arpa_inet_h.m4 b/local/recipes/tools/diffutils/source/m4/arpa_inet_h.m4 new file mode 100644 index 0000000000..d6554554fb --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/arpa_inet_h.m4 @@ -0,0 +1,57 @@ +# arpa_inet_h.m4 serial 13 +dnl Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Simon Josefsson and Bruno Haible + +AC_DEFUN([gl_HEADER_ARPA_INET], +[ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) + + AC_CHECK_HEADERS_ONCE([arpa/inet.h]) + if test $ac_cv_header_arpa_inet_h = yes; then + HAVE_ARPA_INET_H=1 + else + HAVE_ARPA_INET_H=0 + fi + AC_SUBST([HAVE_ARPA_INET_H]) + dnl <arpa/inet.h> is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([arpa/inet.h]) + + AC_REQUIRE([gl_FEATURES_H]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ +/* On some systems, this header is not self-consistent. */ +#if !(defined __GLIBC__ || defined __UCLIBC__) +# include <sys/socket.h> +#endif +#ifdef __TANDEM +# include <netdb.h> +#endif +#include <arpa/inet.h> + ]], [inet_ntop inet_pton]) +]) + +AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) +]) + +AC_DEFUN([gl_ARPA_INET_H_DEFAULTS], +[ + GNULIB_INET_NTOP=0; AC_SUBST([GNULIB_INET_NTOP]) + GNULIB_INET_PTON=0; AC_SUBST([GNULIB_INET_PTON]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DECL_INET_NTOP=1; AC_SUBST([HAVE_DECL_INET_NTOP]) + HAVE_DECL_INET_PTON=1; AC_SUBST([HAVE_DECL_INET_PTON]) + REPLACE_INET_NTOP=0; AC_SUBST([REPLACE_INET_NTOP]) + REPLACE_INET_PTON=0; AC_SUBST([REPLACE_INET_PTON]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/btowc.m4 b/local/recipes/tools/diffutils/source/m4/btowc.m4 new file mode 100644 index 0000000000..102180938a --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/btowc.m4 @@ -0,0 +1,116 @@ +# btowc.m4 serial 10 +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_BTOWC], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + dnl Check whether <wchar.h> is usable at all, first. Otherwise the test + dnl program below may lead to an endless loop. See + dnl <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. + AC_REQUIRE([gl_WCHAR_H_INLINE_OK]) + + AC_CHECK_FUNCS_ONCE([btowc]) + if test $ac_cv_func_btowc = no; then + HAVE_BTOWC=0 + else + + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + dnl Cygwin 1.7.2 btowc('\0') is WEOF, not 0. + AC_CACHE_CHECK([whether btowc(0) is correct], + [gl_cv_func_btowc_nul], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (btowc ('\0') != 0) + return 1; + return 0; +}]])], + [gl_cv_func_btowc_nul=yes], + [gl_cv_func_btowc_nul=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess no on Cygwin. + cygwin*) gl_cv_func_btowc_nul="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_nul="guessing yes" ;; + esac +changequote([,])dnl + ]) + ]) + + dnl IRIX 6.5 btowc(EOF) is 0xFF, not WEOF. + AC_CACHE_CHECK([whether btowc(EOF) is correct], + [gl_cv_func_btowc_eof], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on IRIX. + irix*) gl_cv_func_btowc_eof="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_eof="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (btowc (EOF) != WEOF) + return 1; + } + return 0; +}]])], + [gl_cv_func_btowc_eof=yes], + [gl_cv_func_btowc_eof=no], + [:]) + fi + ]) + + case "$gl_cv_func_btowc_nul" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + case "$gl_cv_func_btowc_eof" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + fi +]) + +# Prerequisites of lib/btowc.c. +AC_DEFUN([gl_PREREQ_BTOWC], [ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/builtin-expect.m4 b/local/recipes/tools/diffutils/source/m4/builtin-expect.m4 new file mode 100644 index 0000000000..aa3364bffd --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/builtin-expect.m4 @@ -0,0 +1,49 @@ +dnl Check for __builtin_expect. + +dnl Copyright 2016-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Paul Eggert. + +AC_DEFUN([gl___BUILTIN_EXPECT], +[ + AC_CACHE_CHECK([for __builtin_expect], + [gl_cv___builtin_expect], + [AC_LINK_IFELSE( + [AC_LANG_SOURCE([[ + int + main (int argc, char **argv) + { + argc = __builtin_expect (argc, 100); + return argv[argc != 100][0]; + }]])], + [gl_cv___builtin_expect=yes], + [AC_LINK_IFELSE( + [AC_LANG_SOURCE([[ + #include <builtins.h> + int + main (int argc, char **argv) + { + argc = __builtin_expect (argc, 100); + return argv[argc != 100][0]; + }]])], + [gl_cv___builtin_expect="in <builtins.h>"], + [gl_cv___builtin_expect=no])])]) + if test "$gl_cv___builtin_expect" = yes; then + AC_DEFINE([HAVE___BUILTIN_EXPECT], [1]) + elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then + AC_DEFINE([HAVE___BUILTIN_EXPECT], [2]) + fi + AH_VERBATIM([HAVE___BUILTIN_EXPECT], + [/* Define to 1 if the compiler supports __builtin_expect, + and to 2 if <builtins.h> does. */ +#undef HAVE___BUILTIN_EXPECT +#ifndef HAVE___BUILTIN_EXPECT +# define __builtin_expect(e, c) (e) +#elif HAVE___BUILTIN_EXPECT == 2 +# include <builtins.h> +#endif + ]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/c-stack.m4 b/local/recipes/tools/diffutils/source/m4/c-stack.m4 new file mode 100644 index 0000000000..3a85ee9309 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/c-stack.m4 @@ -0,0 +1,359 @@ +# Check prerequisites for compiling lib/c-stack.c. + +# Copyright (C) 2002-2004, 2008-2017 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Written by Paul Eggert. + +# serial 15 + +AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC], + [ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_FUNCS_ONCE([setrlimit]) + AC_CHECK_HEADERS_ONCE([ucontext.h]) + + dnl List of signals that are sent when an invalid virtual memory address + dnl is accessed, or when the stack overflows. + dnl Either { SIGSEGV } or { SIGSEGV, SIGBUS }. + case "$host_os" in + sunos4* | freebsd* | dragonfly* | openbsd* | mirbsd* | netbsd* | kfreebsd* | knetbsd*) # BSD systems + FAULT_YIELDS_SIGBUS=1 ;; + hpux*) # HP-UX + FAULT_YIELDS_SIGBUS=1 ;; + macos* | darwin*) # Mac OS X + FAULT_YIELDS_SIGBUS=1 ;; + gnu*) # Hurd + FAULT_YIELDS_SIGBUS=1 ;; + *) + FAULT_YIELDS_SIGBUS=0 ;; + esac + AC_DEFINE_UNQUOTED([FAULT_YIELDS_SIGBUS], [$FAULT_YIELDS_SIGBUS], + [Define to 1 if an invalid memory address access may yield a SIGBUS.]) + + AC_CACHE_CHECK([for working C stack overflow detection], + [ac_cv_sys_stack_overflow_works], + [AC_RUN_IFELSE([AC_LANG_SOURCE( + [[ + #include <unistd.h> + #include <signal.h> + #if HAVE_SETRLIMIT + # include <sys/types.h> + # include <sys/time.h> + # include <sys/resource.h> + #endif + #ifndef SIGSTKSZ + # define SIGSTKSZ 16384 + #endif + + static union + { + char buffer[2 * SIGSTKSZ]; + long double ld; + long u; + void *p; + } alternate_signal_stack; + + static void + segv_handler (int signo) + { + _exit (0); + } + + static int + c_stack_action () + { + stack_t st; + struct sigaction act; + int r; + + st.ss_flags = 0; + /* Use the midpoint to avoid Irix sigaltstack bug. */ + st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; + st.ss_size = SIGSTKSZ; + r = sigaltstack (&st, 0); + if (r != 0) + return 1; + + sigemptyset (&act.sa_mask); + act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND; + act.sa_handler = segv_handler; + #if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, 0) < 0) + return 2; + #endif + if (sigaction (SIGSEGV, &act, 0) < 0) + return 3; + return 0; + } + static volatile int * + recurse_1 (volatile int n, volatile int *p) + { + if (n >= 0) + *recurse_1 (n + 1, p) += n; + return p; + } + static int + recurse (volatile int n) + { + int sum = 0; + return *recurse_1 (n, &sum); + } + int + main () + { + int result; + #if HAVE_SETRLIMIT && defined RLIMIT_STACK + /* Before starting the endless recursion, try to be friendly + to the user's machine. On some Linux 2.2.x systems, there + is no stack limit for user processes at all. We don't want + to kill such systems. */ + struct rlimit rl; + rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */ + setrlimit (RLIMIT_STACK, &rl); + #endif + + result = c_stack_action (); + if (result != 0) + return result; + return recurse (0); + } + ]])], + [ac_cv_sys_stack_overflow_works=yes], + [ac_cv_sys_stack_overflow_works=no], + [ac_cv_sys_stack_overflow_works=cross-compiling])]) + + if test $ac_cv_sys_stack_overflow_works = yes; then + AC_DEFINE([HAVE_STACK_OVERFLOW_HANDLING], [1], + [Define to 1 if extending the stack slightly past the limit causes + a SIGSEGV which can be handled on an alternate stack established + with sigaltstack.]) + + dnl The ss_sp field of a stack_t is, according to POSIX, the lowest address + dnl of the memory block designated as an alternate stack. But IRIX 5.3 + dnl interprets it as the highest address! + AC_CACHE_CHECK([for correct stack_t interpretation], + [gl_cv_sigaltstack_low_base], [ + AC_RUN_IFELSE([ + AC_LANG_SOURCE([[ +#include <stdlib.h> +#include <signal.h> +#if HAVE_SYS_SIGNAL_H +# include <sys/signal.h> +#endif +#ifndef SIGSTKSZ +# define SIGSTKSZ 16384 +#endif +volatile char *stack_lower_bound; +volatile char *stack_upper_bound; +static void check_stack_location (volatile char *addr) +{ + if (addr >= stack_lower_bound && addr <= stack_upper_bound) + exit (0); + else + exit (1); +} +static void stackoverflow_handler (int sig) +{ + char dummy; + check_stack_location (&dummy); +} +int main () +{ + char mystack[2 * SIGSTKSZ]; + stack_t altstack; + struct sigaction action; + /* Install the alternate stack. */ + altstack.ss_sp = mystack + SIGSTKSZ; + altstack.ss_size = SIGSTKSZ; + stack_lower_bound = (char *) altstack.ss_sp; + stack_upper_bound = (char *) altstack.ss_sp + altstack.ss_size - 1; + altstack.ss_flags = 0; /* no SS_DISABLE */ + if (sigaltstack (&altstack, NULL) < 0) + exit (2); + /* Install the SIGSEGV handler. */ + sigemptyset (&action.sa_mask); + action.sa_handler = &stackoverflow_handler; + action.sa_flags = SA_ONSTACK; + if (sigaction (SIGSEGV, &action, (struct sigaction *) NULL) < 0) + exit(3); + /* Provoke a SIGSEGV. */ + raise (SIGSEGV); + exit (4); +}]])], + [gl_cv_sigaltstack_low_base=yes], + [gl_cv_sigaltstack_low_base=no], + [gl_cv_sigaltstack_low_base=cross-compiling])]) + if test "$gl_cv_sigaltstack_low_base" = no; then + AC_DEFINE([SIGALTSTACK_SS_REVERSED], [1], + [Define if sigaltstack() interprets the stack_t.ss_sp field + incorrectly, as the highest address of the alternate stack range + rather than as the lowest address.]) + fi + + AC_CACHE_CHECK([for precise C stack overflow detection], + ac_cv_sys_xsi_stack_overflow_heuristic, + [AC_RUN_IFELSE([AC_LANG_SOURCE( + [[ + #include <unistd.h> + #include <signal.h> + #if HAVE_UCONTEXT_H + # include <ucontext.h> + #endif + #if HAVE_SETRLIMIT + # include <sys/types.h> + # include <sys/time.h> + # include <sys/resource.h> + #endif + #ifndef SIGSTKSZ + # define SIGSTKSZ 16384 + #endif + + static union + { + char buffer[2 * SIGSTKSZ]; + long double ld; + long u; + void *p; + } alternate_signal_stack; + + #if STACK_DIRECTION + # define find_stack_direction(ptr) STACK_DIRECTION + #else + static int + find_stack_direction (char const *addr) + { + char dummy; + return (! addr ? find_stack_direction (&dummy) + : addr < &dummy ? 1 : -1); + } + #endif + + static void + segv_handler (int signo, siginfo_t *info, void *context) + { + if (0 < info->si_code) + { + /* For XSI heuristics to work, we need uc_stack to describe + the interrupted stack (as on Solaris), and not the + currently executing stack (as on Linux). */ + ucontext_t const *user_context = context; + char const *stack_min = user_context->uc_stack.ss_sp; + size_t stack_size = user_context->uc_stack.ss_size; + char const *faulting_address = info->si_addr; + size_t s = faulting_address - stack_min; + size_t page_size = sysconf (_SC_PAGESIZE); + if (find_stack_direction (0) < 0) + s += page_size; + if (s < stack_size + page_size) + _exit (0); + _exit (4); + } + _exit (5); + } + + static int + c_stack_action () + { + stack_t st; + struct sigaction act; + int r; + + st.ss_flags = 0; + /* Use the midpoint to avoid Irix sigaltstack bug. */ + st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; + st.ss_size = SIGSTKSZ; + r = sigaltstack (&st, 0); + if (r != 0) + return 1; + + sigemptyset (&act.sa_mask); + act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO; + act.sa_sigaction = segv_handler; + #if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, 0) < 0) + return 2; + #endif + if (sigaction (SIGSEGV, &act, 0) < 0) + return 3; + return 0; + } + static volatile int * + recurse_1 (volatile int n, volatile int *p) + { + if (n >= 0) + *recurse_1 (n + 1, p) += n; + return p; + } + static int + recurse (volatile int n) + { + int sum = 0; + return *recurse_1 (n, &sum); + } + int + main () + { + int result; + #if HAVE_SETRLIMIT && defined RLIMIT_STACK + /* Before starting the endless recursion, try to be friendly + to the user's machine. On some Linux 2.2.x systems, there + is no stack limit for user processes at all. We don't want + to kill such systems. */ + struct rlimit rl; + rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */ + setrlimit (RLIMIT_STACK, &rl); + #endif + + result = c_stack_action (); + if (result != 0) + return result; + return recurse (0); + } + ]])], + [ac_cv_sys_xsi_stack_overflow_heuristic=yes], + [ac_cv_sys_xsi_stack_overflow_heuristic=no], + [ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling])]) + + if test $ac_cv_sys_xsi_stack_overflow_heuristic = yes; then + AC_DEFINE([HAVE_XSI_STACK_OVERFLOW_HEURISTIC], [1], + [Define to 1 if extending the stack slightly past the limit causes + a SIGSEGV, and an alternate stack can be established with sigaltstack, + and the signal handler is passed a context that specifies the + run time stack. This behavior is defined by POSIX 1003.1-2001 + with the X/Open System Interface (XSI) option + and is a standardized way to implement a SEGV-based stack + overflow detection heuristic.]) + fi + fi]) + + +AC_DEFUN([gl_PREREQ_C_STACK], + [AC_REQUIRE([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC]) + AC_REQUIRE([gl_LIBSIGSEGV]) + + # for STACK_DIRECTION + AC_REQUIRE([AC_FUNC_ALLOCA]) + + AC_CHECK_FUNCS_ONCE([sigaltstack]) + AC_CHECK_DECLS([sigaltstack], , , [[#include <signal.h>]]) + + AC_CHECK_HEADERS_ONCE([unistd.h ucontext.h]) + + AC_CHECK_TYPES([stack_t], , , [#include <signal.h>]) + + dnl c-stack does not need -lsigsegv if the system has XSI heuristics. + if test "$gl_cv_lib_sigsegv" = yes \ + && test $"ac_cv_sys_xsi_stack_overflow_heuristic" != yes ; then + AC_SUBST([LIBCSTACK], [$LIBSIGSEGV]) + AC_SUBST([LTLIBCSTACK], [$LTLIBSIGSEGV]) + fi +]) + +AC_DEFUN([gl_C_STACK], +[ + dnl Prerequisites of lib/c-stack.c. + gl_PREREQ_C_STACK +]) diff --git a/local/recipes/tools/diffutils/source/m4/clock_time.m4 b/local/recipes/tools/diffutils/source/m4/clock_time.m4 new file mode 100644 index 0000000000..21b6f25676 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/clock_time.m4 @@ -0,0 +1,31 @@ +# clock_time.m4 serial 10 +dnl Copyright (C) 2002-2006, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Check for clock_gettime and clock_settime, and set LIB_CLOCK_GETTIME. +# For a program named, say foo, you should add a line like the following +# in the corresponding Makefile.am file: +# foo_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) + +AC_DEFUN([gl_CLOCK_TIME], +[ + dnl Persuade glibc and Solaris <time.h> to declare these functions. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. + # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. + + # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* + # programs in the package would end up linked with that potentially-shared + # library, inducing unnecessary run-time overhead. + LIB_CLOCK_GETTIME= + AC_SUBST([LIB_CLOCK_GETTIME]) + gl_saved_libs=$LIBS + AC_SEARCH_LIBS([clock_gettime], [rt posix4], + [test "$ac_cv_search_clock_gettime" = "none required" || + LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime]) + AC_CHECK_FUNCS([clock_gettime clock_settime]) + LIBS=$gl_saved_libs +]) diff --git a/local/recipes/tools/diffutils/source/m4/close.m4 b/local/recipes/tools/diffutils/source/m4/close.m4 new file mode 100644 index 0000000000..ed357ab924 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/close.m4 @@ -0,0 +1,35 @@ +# close.m4 serial 9 +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_CLOSE], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + m4_ifdef([gl_MSVC_INVAL], [ + AC_REQUIRE([gl_MSVC_INVAL]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_CLOSE=1 + fi + ]) + m4_ifdef([gl_PREREQ_SYS_H_WINSOCK2], [ + gl_PREREQ_SYS_H_WINSOCK2 + if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then + dnl Even if the 'socket' module is not used here, another part of the + dnl application may use it and pass file descriptors that refer to + dnl sockets to the close() function. So enable the support for sockets. + REPLACE_CLOSE=1 + fi + ]) + dnl Replace close() for supporting the gnulib-defined fchdir() function, + dnl to keep fchdir's bookkeeping up-to-date. + m4_ifdef([gl_FUNC_FCHDIR], [ + if test $REPLACE_CLOSE = 0; then + gl_TEST_FCHDIR + if test $HAVE_FCHDIR = 0; then + REPLACE_CLOSE=1 + fi + fi + ]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/codeset.m4 b/local/recipes/tools/diffutils/source/m4/codeset.m4 new file mode 100644 index 0000000000..bc98201e39 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/codeset.m4 @@ -0,0 +1,24 @@ +# codeset.m4 serial 5 (gettext-0.18.2) +dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +AC_DEFUN([AM_LANGINFO_CODESET], +[ + AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <langinfo.h>]], + [[char* cs = nl_langinfo(CODESET); return !cs;]])], + [am_cv_langinfo_codeset=yes], + [am_cv_langinfo_codeset=no]) + ]) + if test $am_cv_langinfo_codeset = yes; then + AC_DEFINE([HAVE_LANGINFO_CODESET], [1], + [Define if you have <langinfo.h> and nl_langinfo(CODESET).]) + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/config-h.m4 b/local/recipes/tools/diffutils/source/m4/config-h.m4 new file mode 100644 index 0000000000..6e6e661f7c --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/config-h.m4 @@ -0,0 +1,13 @@ +# Say that -DHAVE_CONFIG_H is not needed. + +dnl Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Paul Eggert. + +# This package's source files all include config.h unconditionally, +# so there's no need to pass -DHAVE_CONFIG_H to the compiler. +AC_DEFUN([gl_CONFIG_H], + [AC_CONFIG_COMMANDS_PRE([test "X$DEFS" = X-DHAVE_CONFIG_H && DEFS=])]) diff --git a/local/recipes/tools/diffutils/source/m4/configmake.m4 b/local/recipes/tools/diffutils/source/m4/configmake.m4 new file mode 100644 index 0000000000..b783296b62 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/configmake.m4 @@ -0,0 +1,55 @@ +# configmake.m4 serial 2 +dnl Copyright (C) 2010-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# gl_CONFIGMAKE_PREP +# ------------------ +# Guarantee all of the standard directory variables, even when used with +# autoconf 2.59 (datarootdir wasn't supported until 2.59c, and runstatedir +# in 2.70) or automake 1.9.6 (pkglibexecdir wasn't supported until 1.10b, +# and runstatedir in 1.14.1). +AC_DEFUN([gl_CONFIGMAKE_PREP], +[ + dnl Technically, datadir should default to datarootdir. But if + dnl autoconf is too old to provide datarootdir, then reversing the + dnl definition is a reasonable compromise. Only AC_SUBST a variable + dnl if it was not already defined earlier by autoconf. + if test "x$datarootdir" = x; then + AC_SUBST([datarootdir], ['${datadir}']) + fi + dnl Copy the approach used in autoconf 2.60. + if test "x$docdir" = x; then + AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], + ['${datarootdir}/doc/${PACKAGE_TARNAME}'], + ['${datarootdir}/doc/${PACKAGE}'])]) + fi + dnl The remaining variables missing from autoconf 2.59 are easier. + if test "x$htmldir" = x; then + AC_SUBST([htmldir], ['${docdir}']) + fi + if test "x$dvidir" = x; then + AC_SUBST([dvidir], ['${docdir}']) + fi + if test "x$pdfdir" = x; then + AC_SUBST([pdfdir], ['${docdir}']) + fi + if test "x$psdir" = x; then + AC_SUBST([psdir], ['${docdir}']) + fi + if test "x$lispdir" = x; then + AC_SUBST([lispdir], ['${datarootdir}/emacs/site-lisp']) + fi + if test "x$localedir" = x; then + AC_SUBST([localedir], ['${datarootdir}/locale']) + fi + dnl Added in autoconf 2.70 + if test "x$runstatedir" = x; then + AC_SUBST([runstatedir], ['${localstatedir}/run']) + fi + + dnl Automake 1.9.6 only lacks pkglibexecdir; and since 1.11 merely + dnl provides it without AC_SUBST, this blind use of AC_SUBST is safe. + AC_SUBST([pkglibexecdir], ['${libexecdir}/${PACKAGE}']) +]) diff --git a/local/recipes/tools/diffutils/source/m4/ctype.m4 b/local/recipes/tools/diffutils/source/m4/ctype.m4 new file mode 100644 index 0000000000..3791f463e5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/ctype.m4 @@ -0,0 +1,32 @@ +# ctype_h.m4 serial 6 +dnl Copyright (C) 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_CTYPE_H], +[ + AC_REQUIRE([gl_CTYPE_H_DEFAULTS]) + + dnl <ctype.h> is always overridden, because of GNULIB_POSIXCHECK. + gl_NEXT_HEADERS([ctype.h]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include <ctype.h> + ]], [isblank]) +]) + +AC_DEFUN([gl_CTYPE_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_CTYPE_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) +]) + +AC_DEFUN([gl_CTYPE_H_DEFAULTS], +[ + GNULIB_ISBLANK=0; AC_SUBST([GNULIB_ISBLANK]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_ISBLANK=1; AC_SUBST([HAVE_ISBLANK]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/dirname.m4 b/local/recipes/tools/diffutils/source/m4/dirname.m4 new file mode 100644 index 0000000000..46f5394c7c --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/dirname.m4 @@ -0,0 +1,19 @@ +#serial 10 -*- autoconf -*- +dnl Copyright (C) 2002-2006, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_DIRNAME], +[ + AC_REQUIRE([gl_DIRNAME_LGPL]) +]) + +AC_DEFUN([gl_DIRNAME_LGPL], +[ + dnl Prerequisites of lib/dirname.h. + AC_REQUIRE([gl_DOUBLE_SLASH_ROOT]) + + dnl No prerequisites of lib/basename-lgpl.c, lib/dirname-lgpl.c, + dnl lib/stripslash.c. +]) diff --git a/local/recipes/tools/diffutils/source/m4/double-slash-root.m4 b/local/recipes/tools/diffutils/source/m4/double-slash-root.m4 new file mode 100644 index 0000000000..c80f9eada2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/double-slash-root.m4 @@ -0,0 +1,38 @@ +# double-slash-root.m4 serial 4 -*- Autoconf -*- +dnl Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_DOUBLE_SLASH_ROOT], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CACHE_CHECK([whether // is distinct from /], [gl_cv_double_slash_root], + [ if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # <bug-gnulib@gnu.org>. + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + gl_cv_double_slash_root='unknown, assuming no' ;; + esac + else + set x `ls -di / // 2>/dev/null` + if test "$[2]" = "$[4]" && wc //dev/null >/dev/null 2>&1; then + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi]) + if test "$gl_cv_double_slash_root" = yes; then + AC_DEFINE([DOUBLE_SLASH_IS_DISTINCT_ROOT], [1], + [Define to 1 if // is a file system root distinct from /.]) + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/dup2.m4 b/local/recipes/tools/diffutils/source/m4/dup2.m4 new file mode 100644 index 0000000000..bdb9ae2501 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/dup2.m4 @@ -0,0 +1,117 @@ +#serial 25 +dnl Copyright (C) 2002, 2005, 2007, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_DUP2], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + m4_ifdef([gl_FUNC_DUP2_OBSOLETE], [ + AC_CHECK_FUNCS_ONCE([dup2]) + if test $ac_cv_func_dup2 = no; then + HAVE_DUP2=0 + fi + ], [ + AC_DEFINE([HAVE_DUP2], [1], [Define to 1 if you have the 'dup2' function.]) + ]) + if test $HAVE_DUP2 = 1; then + AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works], + [AC_RUN_IFELSE([ + AC_LANG_PROGRAM( + [[#include <errno.h> + #include <fcntl.h> + #include <limits.h> + #include <sys/resource.h> + #include <unistd.h> + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + ]], + [[int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + #ifdef FD_CLOEXEC + if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) + result |= 1; + #endif + if (dup2 (1, 1) != 1) + result |= 2; + #ifdef FD_CLOEXEC + if (fcntl (1, F_GETFD) != FD_CLOEXEC) + result |= 4; + #endif + close (0); + if (dup2 (0, 0) != -1) + result |= 8; + /* Many gnulib modules require POSIX conformance of EBADF. */ + if (dup2 (2, bad_fd) == -1 && errno != EBADF) + result |= 16; + /* Flush out some cygwin core dumps. */ + if (dup2 (2, -1) != -1 || errno != EBADF) + result |= 32; + dup2 (2, 255); + dup2 (2, 256); + /* On OS/2 kLIBC, dup2() does not work on a directory fd. */ + { + int fd = open (".", O_RDONLY); + if (fd == -1) + result |= 64; + else if (dup2 (fd, fd + 1) == -1) + result |= 128; + + close (fd); + } + return result;]]) + ], + [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no], + [case "$host_os" in + mingw*) # on this platform, dup2 always returns 0 for success + gl_cv_func_dup2_works="guessing no" ;; + cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 + gl_cv_func_dup2_works="guessing no" ;; + aix* | freebsd*) + # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE, + # not EBADF. + gl_cv_func_dup2_works="guessing no" ;; + haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. + gl_cv_func_dup2_works="guessing no" ;; + *-android*) # implemented using dup3(), which fails if oldfd == newfd + gl_cv_func_dup2_works="guessing no" ;; + os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd. + gl_cv_func_dup2_works="guessing no" ;; + *) gl_cv_func_dup2_works="guessing yes" ;; + esac]) + ]) + case "$gl_cv_func_dup2_works" in + *yes) ;; + *) + REPLACE_DUP2=1 + AC_CHECK_FUNCS([setdtablesize]) + ;; + esac + fi + dnl Replace dup2() for supporting the gnulib-defined fchdir() function, + dnl to keep fchdir's bookkeeping up-to-date. + m4_ifdef([gl_FUNC_FCHDIR], [ + gl_TEST_FCHDIR + if test $HAVE_FCHDIR = 0; then + if test $HAVE_DUP2 = 1; then + REPLACE_DUP2=1 + fi + fi + ]) +]) + +# Prerequisites of lib/dup2.c. +AC_DEFUN([gl_PREREQ_DUP2], []) diff --git a/local/recipes/tools/diffutils/source/m4/eealloc.m4 b/local/recipes/tools/diffutils/source/m4/eealloc.m4 new file mode 100644 index 0000000000..96b9bca5ae --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/eealloc.m4 @@ -0,0 +1,31 @@ +# eealloc.m4 serial 3 +dnl Copyright (C) 2003, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_EEALLOC], +[ + AC_REQUIRE([gl_EEMALLOC]) + AC_REQUIRE([gl_EEREALLOC]) +]) + +AC_DEFUN([gl_EEMALLOC], +[ + _AC_FUNC_MALLOC_IF( + [gl_cv_func_malloc_0_nonnull=1], + [gl_cv_func_malloc_0_nonnull=0]) + AC_DEFINE_UNQUOTED([MALLOC_0_IS_NONNULL], [$gl_cv_func_malloc_0_nonnull], + [If malloc(0) is != NULL, define this to 1. Otherwise define this + to 0.]) +]) + +AC_DEFUN([gl_EEREALLOC], +[ + _AC_FUNC_REALLOC_IF( + [gl_cv_func_realloc_0_nonnull=1], + [gl_cv_func_realloc_0_nonnull=0]) + AC_DEFINE_UNQUOTED([REALLOC_0_IS_NONNULL], [$gl_cv_func_realloc_0_nonnull], + [If realloc(NULL,0) is != NULL, define this to 1. Otherwise define this + to 0.]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/environ.m4 b/local/recipes/tools/diffutils/source/m4/environ.m4 new file mode 100644 index 0000000000..3b9fa5f58b --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/environ.m4 @@ -0,0 +1,47 @@ +# environ.m4 serial 6 +dnl Copyright (C) 2001-2004, 2006-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN_ONCE([gl_ENVIRON], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + dnl Persuade glibc <unistd.h> to declare environ. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_CHECK_HEADERS_ONCE([unistd.h]) + gt_CHECK_VAR_DECL( + [#if HAVE_UNISTD_H + #include <unistd.h> + #endif + /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */ + #include <stdlib.h> + ], + [environ]) + if test $gt_cv_var_environ_declaration != yes; then + HAVE_DECL_ENVIRON=0 + fi +]) + +# Check if a variable is properly declared. +# gt_CHECK_VAR_DECL(includes,variable) +AC_DEFUN([gt_CHECK_VAR_DECL], +[ + define([gt_cv_var], [gt_cv_var_]$2[_declaration]) + AC_MSG_CHECKING([if $2 is properly declared]) + AC_CACHE_VAL([gt_cv_var], [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[$1 + extern struct { int foo; } $2;]], + [[$2.foo = 1;]])], + [gt_cv_var=no], + [gt_cv_var=yes])]) + AC_MSG_RESULT([$gt_cv_var]) + if test $gt_cv_var = yes; then + AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1, + [Define if you have the declaration of $2.]) + fi + undefine([gt_cv_var]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/errno_h.m4 b/local/recipes/tools/diffutils/source/m4/errno_h.m4 new file mode 100644 index 0000000000..9f0f2f2fb3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/errno_h.m4 @@ -0,0 +1,137 @@ +# errno_h.m4 serial 12 +dnl Copyright (C) 2004, 2006, 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN_ONCE([gl_HEADER_ERRNO_H], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [ + AC_EGREP_CPP([booboo],[ +#include <errno.h> +#if !defined ETXTBSY +booboo +#endif +#if !defined ENOMSG +booboo +#endif +#if !defined EIDRM +booboo +#endif +#if !defined ENOLINK +booboo +#endif +#if !defined EPROTO +booboo +#endif +#if !defined EMULTIHOP +booboo +#endif +#if !defined EBADMSG +booboo +#endif +#if !defined EOVERFLOW +booboo +#endif +#if !defined ENOTSUP +booboo +#endif +#if !defined ENETRESET +booboo +#endif +#if !defined ECONNABORTED +booboo +#endif +#if !defined ESTALE +booboo +#endif +#if !defined EDQUOT +booboo +#endif +#if !defined ECANCELED +booboo +#endif +#if !defined EOWNERDEAD +booboo +#endif +#if !defined ENOTRECOVERABLE +booboo +#endif +#if !defined EILSEQ +booboo +#endif + ], + [gl_cv_header_errno_h_complete=no], + [gl_cv_header_errno_h_complete=yes]) + ]) + if test $gl_cv_header_errno_h_complete = yes; then + ERRNO_H='' + else + gl_NEXT_HEADERS([errno.h]) + ERRNO_H='errno.h' + fi + AC_SUBST([ERRNO_H]) + AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"]) + gl_REPLACE_ERRNO_VALUE([EMULTIHOP]) + gl_REPLACE_ERRNO_VALUE([ENOLINK]) + gl_REPLACE_ERRNO_VALUE([EOVERFLOW]) +]) + +# Assuming $1 = EOVERFLOW. +# The EOVERFLOW errno value ought to be defined in <errno.h>, according to +# POSIX. But some systems (like OpenBSD 4.0 or AIX 3) don't define it, and +# some systems (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined. +# Check for the value of EOVERFLOW. +# Set the variables EOVERFLOW_HIDDEN and EOVERFLOW_VALUE. +AC_DEFUN([gl_REPLACE_ERRNO_VALUE], +[ + if test -n "$ERRNO_H"; then + AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [ + AC_EGREP_CPP([yes],[ +#include <errno.h> +#ifdef ]$1[ +yes +#endif + ], + [gl_cv_header_errno_h_]$1[=yes], + [gl_cv_header_errno_h_]$1[=no]) + if test $gl_cv_header_errno_h_]$1[ = no; then + AC_EGREP_CPP([yes],[ +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +#ifdef ]$1[ +yes +#endif + ], [gl_cv_header_errno_h_]$1[=hidden]) + if test $gl_cv_header_errno_h_]$1[ = hidden; then + dnl The macro exists but is hidden. + dnl Define it to the same value. + AC_COMPUTE_INT([gl_cv_header_errno_h_]$1, $1, [ +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include <stdio.h> +#include <stdlib.h> +]) + fi + fi + ]) + case $gl_cv_header_errno_h_]$1[ in + yes | no) + ]$1[_HIDDEN=0; ]$1[_VALUE= + ;; + *) + ]$1[_HIDDEN=1; ]$1[_VALUE="$gl_cv_header_errno_h_]$1[" + ;; + esac + AC_SUBST($1[_HIDDEN]) + AC_SUBST($1[_VALUE]) + fi +]) + +dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. +dnl Remove this when we can assume autoconf >= 2.61. +m4_ifdef([AC_COMPUTE_INT], [], [ + AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/error.m4 b/local/recipes/tools/diffutils/source/m4/error.m4 new file mode 100644 index 0000000000..57c6f125c5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/error.m4 @@ -0,0 +1,27 @@ +#serial 14 + +# Copyright (C) 1996-1998, 2001-2004, 2009-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_ERROR], +[ + dnl We don't use AC_FUNC_ERROR_AT_LINE any more, because it is no longer + dnl maintained in Autoconf and because it invokes AC_LIBOBJ. + AC_CACHE_CHECK([for error_at_line], [ac_cv_lib_error_at_line], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <error.h>]], + [[error_at_line (0, 0, "", 0, "an error occurred");]])], + [ac_cv_lib_error_at_line=yes], + [ac_cv_lib_error_at_line=no])]) +]) + +# Prerequisites of lib/error.c. +AC_DEFUN([gl_PREREQ_ERROR], +[ + AC_REQUIRE([AC_FUNC_STRERROR_R]) + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/exponentd.m4 b/local/recipes/tools/diffutils/source/m4/exponentd.m4 new file mode 100644 index 0000000000..cd64b92d0f --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/exponentd.m4 @@ -0,0 +1,116 @@ +# exponentd.m4 serial 3 +dnl Copyright (C) 2007-2008, 2010-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +AC_DEFUN([gl_DOUBLE_EXPONENT_LOCATION], +[ + AC_CACHE_CHECK([where to find the exponent in a 'double'], + [gl_cv_cc_double_expbit0], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <float.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { double value; unsigned int word[NWORDS]; } memory_double; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (double x) +{ + memory_double m; + size_t i; + /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ + memset (&m, 0, sizeof (memory_double)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25); + add_to_ored_words (0.5); + add_to_ored_words (1.0); + add_to_ored_words (2.0); + add_to_ored_words (4.0); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + ]])], + [gl_cv_cc_double_expbit0=`cat conftest.out`], + [gl_cv_cc_double_expbit0="unknown"], + [ + dnl On ARM, there are two 'double' floating-point formats, used by + dnl different sets of instructions: The older FPA instructions assume + dnl that they are stored in big-endian word order, while the words + dnl (like integer types) are stored in little-endian byte order. + dnl The newer VFP instructions assume little-endian order + dnl consistently. + AC_EGREP_CPP([mixed_endianness], [ +#if defined arm || defined __arm || defined __arm__ + mixed_endianness +#endif + ], + [gl_cv_cc_double_expbit0="unknown"], + [ + pushdef([AC_MSG_CHECKING],[:])dnl + pushdef([AC_MSG_RESULT],[:])dnl + pushdef([AC_MSG_RESULT_UNQUOTED],[:])dnl + AC_C_BIGENDIAN( + [gl_cv_cc_double_expbit0="word 0 bit 20"], + [gl_cv_cc_double_expbit0="word 1 bit 20"], + [gl_cv_cc_double_expbit0="unknown"]) + popdef([AC_MSG_RESULT_UNQUOTED])dnl + popdef([AC_MSG_RESULT])dnl + popdef([AC_MSG_CHECKING])dnl + ]) + ]) + rm -f conftest.out + ]) + case "$gl_cv_cc_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` + AC_DEFINE_UNQUOTED([DBL_EXPBIT0_WORD], [$word], + [Define as the word index where to find the exponent of 'double'.]) + AC_DEFINE_UNQUOTED([DBL_EXPBIT0_BIT], [$bit], + [Define as the bit index in the word where to find bit 0 of the exponent of 'double'.]) + ;; + esac +]) diff --git a/local/recipes/tools/diffutils/source/m4/extensions.m4 b/local/recipes/tools/diffutils/source/m4/extensions.m4 new file mode 100644 index 0000000000..c60f537db1 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/extensions.m4 @@ -0,0 +1,173 @@ +# serial 15 -*- Autoconf -*- +# Enable extensions on systems that normally disable them. + +# Copyright (C) 2003, 2006-2017 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git +# Autoconf. Perhaps we can remove this once we can assume Autoconf +# 2.70 or later everywhere, but since Autoconf mutates rapidly +# enough in this area it's likely we'll need to redefine +# AC_USE_SYSTEM_EXTENSIONS for quite some time. + +# If autoconf reports a warning +# warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS +# or warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS +# the fix is +# 1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked +# but always AC_REQUIREd, +# 2) to ensure that for each occurrence of +# AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) +# or +# AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) +# the corresponding gnulib module description has 'extensions' among +# its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS +# invocation occurs in gl_EARLY, not in gl_INIT. + +# AC_USE_SYSTEM_EXTENSIONS +# ------------------------ +# Enable extensions on systems that normally disable them, +# typically due to standards-conformance issues. +# +# Remember that #undef in AH_VERBATIM gets replaced with #define by +# AC_DEFINE. The goal here is to define all known feature-enabling +# macros, then, if reports of conflicts are made, disable macros that +# cause problems on some platforms (such as __EXTENSIONS__). +AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS], +[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl +AC_BEFORE([$0], [AC_RUN_IFELSE])dnl + + AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=]) + if test "$MINIX" = yes; then + AC_DEFINE([_POSIX_SOURCE], [1], + [Define to 1 if you need to in order for 'stat' and other + things to work.]) + AC_DEFINE([_POSIX_1_SOURCE], [2], + [Define to 2 if the system does not provide POSIX.1 features + except with this defined.]) + AC_DEFINE([_MINIX], [1], + [Define to 1 if on MINIX.]) + AC_DEFINE([_NETBSD_SOURCE], [1], + [Define to 1 to make NetBSD features available. MINIX 3 needs this.]) + fi + +dnl Use a different key than __EXTENSIONS__, as that name broke existing +dnl configure.ac when using autoheader 2.62. + AH_VERBATIM([USE_SYSTEM_EXTENSIONS], +[/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable general extensions on macOS. */ +#ifndef _DARWIN_C_SOURCE +# undef _DARWIN_C_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# undef __STDC_WANT_IEC_60559_BFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# undef __STDC_WANT_IEC_60559_DFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# undef __STDC_WANT_IEC_60559_TYPES_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# undef __STDC_WANT_LIB_EXT2__ +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# undef __STDC_WANT_MATH_SPEC_FUNCS__ +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable X/Open extensions if necessary. HP-UX 11.11 defines + mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of + whether compiling with -Ae or -D_HPUX_SOURCE=1. */ +#ifndef _XOPEN_SOURCE +# undef _XOPEN_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif +]) + AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], + [ac_cv_safe_to_define___extensions__], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ +# define __EXTENSIONS__ 1 + ]AC_INCLUDES_DEFAULT])], + [ac_cv_safe_to_define___extensions__=yes], + [ac_cv_safe_to_define___extensions__=no])]) + test $ac_cv_safe_to_define___extensions__ = yes && + AC_DEFINE([__EXTENSIONS__]) + AC_DEFINE([_ALL_SOURCE]) + AC_DEFINE([_DARWIN_C_SOURCE]) + AC_DEFINE([_GNU_SOURCE]) + AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) + AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_DFP_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_FUNCS_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_TYPES_EXT__]) + AC_DEFINE([__STDC_WANT_LIB_EXT2__]) + AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__]) + AC_DEFINE([_TANDEM_SOURCE]) + AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined], + [ac_cv_should_define__xopen_source], + [ac_cv_should_define__xopen_source=no + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #include <wchar.h> + mbstate_t x;]])], + [], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #define _XOPEN_SOURCE 500 + #include <wchar.h> + mbstate_t x;]])], + [ac_cv_should_define__xopen_source=yes])])]) + test $ac_cv_should_define__xopen_source = yes && + AC_DEFINE([_XOPEN_SOURCE], [500]) +])# AC_USE_SYSTEM_EXTENSIONS + +# gl_USE_SYSTEM_EXTENSIONS +# ------------------------ +# Enable extensions on systems that normally disable them, +# typically due to standards-conformance issues. +AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS], +[ + dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS. + dnl gnulib does not need it. But if it gets required by third-party macros + dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a + dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS". + dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE, + dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck. + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/extern-inline.m4 b/local/recipes/tools/diffutils/source/m4/extern-inline.m4 new file mode 100644 index 0000000000..00f960968b --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/extern-inline.m4 @@ -0,0 +1,102 @@ +dnl 'extern inline' a la ISO C99. + +dnl Copyright 2012-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_EXTERN_INLINE], +[ + AH_VERBATIM([extern_inline], +[/* Please see the Gnulib manual for how to use these macros. + + Suppress extern inline with HP-UX cc, as it appears to be broken; see + <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>. + + Suppress extern inline with Sun C in standards-conformance mode, as it + mishandles inline functions that call each other. E.g., for 'inline void f + (void) { } inline void g (void) { f (); }', c99 incorrectly complains + 'reference to static identifier "f" in extern inline function'. + This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. + + Suppress extern inline (with or without __attribute__ ((__gnu_inline__))) + on configurations that mistakenly use 'static inline' to implement + functions or macros in standard C headers like <ctype.h>. For example, + if isdigit is mistakenly implemented via a static inline function, + a program containing an extern inline function that calls isdigit + may not work since the C standard prohibits extern inline functions + from calling static functions. This bug is known to occur on: + + OS X 10.8 and earlier; see: + http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html + + DragonFly; see + http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log + + FreeBSD; see: + http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html + + OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and + for clang but remains for g++; see <http://trac.macports.org/ticket/41033>. + Assume DragonFly and FreeBSD will be similar. */ +#if (((defined __APPLE__ && defined __MACH__) \ + || defined __DragonFly__ || defined __FreeBSD__) \ + && (defined __header_inline \ + ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \ + && ! defined __clang__) \ + : ((! defined _DONT_USE_CTYPE_INLINE_ \ + && (defined __GNUC__ || defined __cplusplus)) \ + || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \ + && defined __GNUC__ && ! defined __cplusplus)))) +# define _GL_EXTERN_INLINE_STDHEADER_BUG +#endif +#if ((__GNUC__ \ + ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ + : (199901L <= __STDC_VERSION__ \ + && !defined __HP_cc \ + && !defined __PGI \ + && !(defined __SUNPRO_C && __STDC__))) \ + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) +# define _GL_INLINE inline +# define _GL_EXTERN_INLINE extern inline +# define _GL_EXTERN_INLINE_IN_USE +#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \ + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) +# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__ + /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ +# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) +# else +# define _GL_INLINE extern inline +# endif +# define _GL_EXTERN_INLINE extern +# define _GL_EXTERN_INLINE_IN_USE +#else +# define _GL_INLINE static _GL_UNUSED +# define _GL_EXTERN_INLINE static _GL_UNUSED +#endif + +/* In GCC 4.6 (inclusive) to 5.1 (exclusive), + suppress bogus "no previous prototype for 'FOO'" + and "no previous declaration for 'FOO'" diagnostics, + when FOO is an inline function in the header; see + <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and + <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>. */ +#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__ +# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ +# define _GL_INLINE_HEADER_CONST_PRAGMA +# else +# define _GL_INLINE_HEADER_CONST_PRAGMA \ + _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") +# endif +# define _GL_INLINE_HEADER_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \ + _GL_INLINE_HEADER_CONST_PRAGMA +# define _GL_INLINE_HEADER_END \ + _Pragma ("GCC diagnostic pop") +#else +# define _GL_INLINE_HEADER_BEGIN +# define _GL_INLINE_HEADER_END +#endif]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/fcntl-o.m4 b/local/recipes/tools/diffutils/source/m4/fcntl-o.m4 new file mode 100644 index 0000000000..3c3b63c525 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/fcntl-o.m4 @@ -0,0 +1,134 @@ +# fcntl-o.m4 serial 4 +dnl Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Paul Eggert. + +# Test whether the flags O_NOATIME and O_NOFOLLOW actually work. +# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise. +# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise. +AC_DEFUN([gl_FCNTL_O_FLAGS], +[ + dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW. + dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes + dnl AC_GNU_SOURCE. + m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], + [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])], + [AC_REQUIRE([AC_GNU_SOURCE])]) + + AC_CHECK_HEADERS_ONCE([unistd.h]) + AC_CHECK_FUNCS_ONCE([symlink]) + AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <sys/types.h> + #include <sys/stat.h> + #if HAVE_UNISTD_H + # include <unistd.h> + #else /* on Windows with MSVC */ + # include <io.h> + # include <stdlib.h> + # defined sleep(n) _sleep ((n) * 1000) + #endif + #include <fcntl.h> + #ifndef O_NOATIME + #define O_NOATIME 0 + #endif + #ifndef O_NOFOLLOW + #define O_NOFOLLOW 0 + #endif + static int const constants[] = + { + O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, + O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY + }; + ]], + [[ + int result = !constants; + #if HAVE_SYMLINK + { + static char const sym[] = "conftest.sym"; + if (symlink ("/dev/null", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + if (unlink (sym) != 0 || symlink (".", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_RDONLY | O_NOFOLLOW); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + unlink (sym); + } + #endif + { + static char const file[] = "confdefs.h"; + int fd = open (file, O_RDONLY | O_NOATIME); + if (fd < 0) + result |= 8; + else + { + struct stat st0; + if (fstat (fd, &st0) != 0) + result |= 16; + else + { + char c; + sleep (1); + if (read (fd, &c, 1) != 1) + result |= 24; + else + { + if (close (fd) != 0) + result |= 32; + else + { + struct stat st1; + if (stat (file, &st1) != 0) + result |= 40; + else + if (st0.st_atime != st1.st_atime) + result |= 64; + } + } + } + } + } + return result;]])], + [gl_cv_header_working_fcntl_h=yes], + [case $? in #( + 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( + 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( + 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( + *) gl_cv_header_working_fcntl_h='no';; + esac], + [gl_cv_header_working_fcntl_h=cross-compiling])]) + + case $gl_cv_header_working_fcntl_h in #( + *O_NOATIME* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val], + [Define to 1 if O_NOATIME works.]) + + case $gl_cv_header_working_fcntl_h in #( + *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val], + [Define to 1 if O_NOFOLLOW works.]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/fcntl.m4 b/local/recipes/tools/diffutils/source/m4/fcntl.m4 new file mode 100644 index 0000000000..dda3b5f2c7 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/fcntl.m4 @@ -0,0 +1,126 @@ +# fcntl.m4 serial 9 +dnl Copyright (C) 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# For now, this module ensures that fcntl() +# - supports F_DUPFD correctly +# - supports or emulates F_DUPFD_CLOEXEC +# - supports F_GETFD +# Still to be ported to mingw: +# - F_SETFD +# - F_GETFL, F_SETFL +# - F_GETOWN, F_SETOWN +# - F_GETLK, F_SETLK, F_SETLKW +AC_DEFUN([gl_FUNC_FCNTL], +[ + dnl Persuade glibc to expose F_DUPFD_CLOEXEC. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_FUNCS_ONCE([fcntl]) + if test $ac_cv_func_fcntl = no; then + gl_REPLACE_FCNTL + else + dnl cygwin 1.5.x F_DUPFD has wrong errno, and allows negative target + dnl haiku alpha 2 F_DUPFD has wrong errno + AC_CACHE_CHECK([whether fcntl handles F_DUPFD correctly], + [gl_cv_func_fcntl_f_dupfd_works], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <errno.h> + #include <fcntl.h> + #include <limits.h> + #include <sys/resource.h> + #include <unistd.h> + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + ]], + [[int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + if (fcntl (0, F_DUPFD, -1) != -1) result |= 1; + if (errno != EINVAL) result |= 2; + if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4; + if (errno != EINVAL) result |= 8; + /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */ + { + int fd; + fd = open (".", O_RDONLY); + if (fd == -1) + result |= 16; + else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1) + result |= 32; + + close (fd); + } + return result;]])], + [gl_cv_func_fcntl_f_dupfd_works=yes], + [gl_cv_func_fcntl_f_dupfd_works=no], + [case $host_os in + aix* | cygwin* | haiku*) + gl_cv_func_fcntl_f_dupfd_works="guessing no" ;; + *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;; + esac])]) + case $gl_cv_func_fcntl_f_dupfd_works in + *yes) ;; + *) gl_REPLACE_FCNTL + AC_DEFINE([FCNTL_DUPFD_BUGGY], [1], [Define this to 1 if F_DUPFD + behavior does not match POSIX]) ;; + esac + + dnl Many systems lack F_DUPFD_CLOEXEC + AC_CACHE_CHECK([whether fcntl understands F_DUPFD_CLOEXEC], + [gl_cv_func_fcntl_f_dupfd_cloexec], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include <fcntl.h> +#ifndef F_DUPFD_CLOEXEC +choke me +#endif + ]])], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#ifdef __linux__ +/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace + it to support the semantics on older kernels that failed with EINVAL. */ +choke me +#endif + ]])], + [gl_cv_func_fcntl_f_dupfd_cloexec=yes], + [gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"])], + [gl_cv_func_fcntl_f_dupfd_cloexec=no])]) + if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then + gl_REPLACE_FCNTL + dnl No witness macro needed for this bug. + fi + fi + dnl Replace fcntl() for supporting the gnulib-defined fchdir() function, + dnl to keep fchdir's bookkeeping up-to-date. + m4_ifdef([gl_FUNC_FCHDIR], [ + gl_TEST_FCHDIR + if test $HAVE_FCHDIR = 0; then + gl_REPLACE_FCNTL + fi + ]) +]) + +AC_DEFUN([gl_REPLACE_FCNTL], +[ + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([fcntl]) + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/fcntl_h.m4 b/local/recipes/tools/diffutils/source/m4/fcntl_h.m4 new file mode 100644 index 0000000000..09c21eff91 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/fcntl_h.m4 @@ -0,0 +1,50 @@ +# serial 15 +# Configure fcntl.h. +dnl Copyright (C) 2006-2007, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Paul Eggert. + +AC_DEFUN([gl_FCNTL_H], +[ + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + AC_REQUIRE([gl_FCNTL_O_FLAGS]) + gl_NEXT_HEADERS([fcntl.h]) + + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) + + dnl Ensure the type mode_t gets defined. + AC_REQUIRE([AC_TYPE_MODE_T]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use, if it is not common + dnl enough to be declared everywhere. + gl_WARN_ON_USE_PREPARE([[#include <fcntl.h> + ]], [fcntl openat]) +]) + +AC_DEFUN([gl_FCNTL_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_FCNTL_H_DEFAULTS], +[ + GNULIB_FCNTL=0; AC_SUBST([GNULIB_FCNTL]) + GNULIB_NONBLOCKING=0; AC_SUBST([GNULIB_NONBLOCKING]) + GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN]) + GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL]) + HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT]) + REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL]) + REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN]) + REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/fdopen.m4 b/local/recipes/tools/diffutils/source/m4/fdopen.m4 new file mode 100644 index 0000000000..42f928efd0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/fdopen.m4 @@ -0,0 +1,50 @@ +# fdopen.m4 serial 4 +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_FDOPEN], +[ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + m4_ifdef([gl_MSVC_INVAL], [ + AC_REQUIRE([gl_MSVC_INVAL]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_FDOPEN=1 + fi + ]) + if test $REPLACE_FDOPEN = 0; then + dnl Test whether fdopen() sets errno when it fails due to a bad fd argument. + AC_CACHE_CHECK([whether fdopen sets errno], [gl_cv_func_fdopen_works], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#include <errno.h> +int +main (void) +{ + FILE *fp; + errno = 0; + fp = fdopen (-1, "r"); + if (fp == NULL && errno == 0) + return 1; + return 0; +}]])], + [gl_cv_func_fdopen_works=yes], + [gl_cv_func_fdopen_works=no], + [case "$host_os" in + mingw*) gl_cv_func_fdopen_works="guessing no" ;; + *) gl_cv_func_fdopen_works="guessing yes" ;; + esac + ]) + ]) + case "$gl_cv_func_fdopen_works" in + *no) REPLACE_FDOPEN=1 ;; + esac + fi +]) + +dnl Prerequisites of lib/fdopen.c. +AC_DEFUN([gl_PREREQ_FDOPEN], []) diff --git a/local/recipes/tools/diffutils/source/m4/filenamecat.m4 b/local/recipes/tools/diffutils/source/m4/filenamecat.m4 new file mode 100644 index 0000000000..ce60cb4718 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/filenamecat.m4 @@ -0,0 +1,16 @@ +# filenamecat.m4 serial 11 +dnl Copyright (C) 2002-2006, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FILE_NAME_CONCAT], +[ + AC_REQUIRE([gl_FILE_NAME_CONCAT_LGPL]) +]) + +AC_DEFUN([gl_FILE_NAME_CONCAT_LGPL], +[ + dnl Prerequisites of lib/filenamecat-lgpl.c. + AC_CHECK_FUNCS_ONCE([mempcpy]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/flexmember.m4 b/local/recipes/tools/diffutils/source/m4/flexmember.m4 new file mode 100644 index 0000000000..9d3b50d157 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/flexmember.m4 @@ -0,0 +1,46 @@ +# serial 5 +# Check for flexible array member support. + +# Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Written by Paul Eggert. + +AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER], +[ + AC_CACHE_CHECK([for flexible array member], + ac_cv_c_flexmember, + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <stdlib.h> + #include <stdio.h> + #include <stddef.h> + struct m { struct m *next, **list; char name[]; }; + struct s { struct s *p; struct m *m; int n; double d[]; };]], + [[int m = getchar (); + size_t nbytes = offsetof (struct s, d) + m * sizeof (double); + nbytes += sizeof (struct s) - 1; + nbytes -= nbytes % sizeof (struct s); + struct s *p = malloc (nbytes); + p->p = p; + p->m = NULL; + p->d[0] = 0.0; + return p->d != (double *) NULL;]])], + [ac_cv_c_flexmember=yes], + [ac_cv_c_flexmember=no])]) + if test $ac_cv_c_flexmember = yes; then + AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [], + [Define to nothing if C supports flexible array members, and to + 1 if it does not. That way, with a declaration like 'struct s + { int n; double d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };', the struct hack + can be used with pre-C99 compilers. + When computing the size of such an object, don't use 'sizeof (struct s)' + as it overestimates the size. Use 'offsetof (struct s, d)' instead. + Don't use 'offsetof (struct s, d@<:@0@:>@)', as this doesn't work with + MSVC and with C++ compilers.]) + else + AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [1]) + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/float_h.m4 b/local/recipes/tools/diffutils/source/m4/float_h.m4 new file mode 100644 index 0000000000..e8522ab118 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/float_h.m4 @@ -0,0 +1,98 @@ +# float_h.m4 serial 9 +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FLOAT_H], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + FLOAT_H= + REPLACE_FLOAT_LDBL=0 + case "$host_os" in + aix* | beos* | openbsd* | mirbsd* | irix*) + FLOAT_H=float.h + ;; + freebsd*) + case "$host_cpu" in +changequote(,)dnl + i[34567]86 ) +changequote([,])dnl + FLOAT_H=float.h + ;; + x86_64 ) + # On x86_64 systems, the C compiler may still be generating + # 32-bit code. + AC_EGREP_CPP([yes], + [#if defined __LP64__ || defined __x86_64__ || defined __amd64__ + yes + #endif], + [], + [FLOAT_H=float.h]) + ;; + esac + ;; + linux*) + case "$host_cpu" in + powerpc*) + FLOAT_H=float.h + ;; + esac + ;; + esac + case "$host_os" in + aix* | freebsd* | linux*) + if test -n "$FLOAT_H"; then + REPLACE_FLOAT_LDBL=1 + fi + ;; + esac + + dnl Test against glibc-2.7 Linux/SPARC64 bug. + REPLACE_ITOLD=0 + AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works], + [gl_cv_func_itold_works], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +int i = -1; +volatile long double ld; +int main () +{ + ld += i * 1.0L; + if (ld > 0) + return 1; + return 0; +}]])], + [gl_cv_func_itold_works=yes], + [gl_cv_func_itold_works=no], + [case "$host" in + sparc*-*-linux*) + AC_EGREP_CPP([yes], + [#if defined __LP64__ || defined __arch64__ + yes + #endif], + [gl_cv_func_itold_works="guessing no"], + [gl_cv_func_itold_works="guessing yes"]) + ;; + *) gl_cv_func_itold_works="guessing yes" ;; + esac + ]) + ]) + case "$gl_cv_func_itold_works" in + *no) + REPLACE_ITOLD=1 + dnl We add the workaround to <float.h> but also to <math.h>, + dnl to increase the chances that the fix function gets pulled in. + FLOAT_H=float.h + ;; + esac + + if test -n "$FLOAT_H"; then + gl_NEXT_HEADERS([float.h]) + fi + AC_SUBST([FLOAT_H]) + AM_CONDITIONAL([GL_GENERATE_FLOAT_H], [test -n "$FLOAT_H"]) + AC_SUBST([REPLACE_ITOLD]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/fnmatch.m4 b/local/recipes/tools/diffutils/source/m4/fnmatch.m4 new file mode 100644 index 0000000000..7292c1aab1 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/fnmatch.m4 @@ -0,0 +1,156 @@ +# Check for fnmatch - serial 9. -*- coding: utf-8 -*- + +# Copyright (C) 2000-2007, 2009-2017 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Autoconf defines AC_FUNC_FNMATCH, but that is obsolescent. +# New applications should use the macros below instead. + +# Request a POSIX compliant fnmatch function. +AC_DEFUN([gl_FUNC_FNMATCH_POSIX], +[ + m4_divert_text([DEFAULTS], [gl_fnmatch_required=POSIX]) + + dnl Persuade glibc <fnmatch.h> to declare FNM_CASEFOLD etc. + dnl This is only needed if gl_fnmatch_required = GNU. It would be possible + dnl to avoid this dependency for gl_FUNC_FNMATCH_POSIX by putting + dnl gl_FUNC_FNMATCH_GNU into a separate .m4 file. + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + FNMATCH_H= + gl_fnmatch_required_lowercase=` + echo $gl_fnmatch_required | LC_ALL=C tr '[[A-Z]]' '[[a-z]]' + ` + gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" + AC_CACHE_CHECK([for working $gl_fnmatch_required fnmatch], + [$gl_fnmatch_cache_var], + [dnl Some versions of Solaris, SCO, and the GNU C Library + dnl have a broken or incompatible fnmatch. + dnl So we run a test program. If we are cross-compiling, take no chance. + dnl Thanks to John Oleynick, François Pinard, and Paul Eggert for this + dnl test. + if test $gl_fnmatch_required = GNU; then + gl_fnmatch_gnu_start= + gl_fnmatch_gnu_end= + else + gl_fnmatch_gnu_start='#if 0' + gl_fnmatch_gnu_end='#endif' + fi + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <fnmatch.h> + static int + y (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == 0; + } + static int + n (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == FNM_NOMATCH; + } + ]], + [[char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]"; + char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]"; + static char const A_1[] = { 'A' - 1, 0 }; + static char const A01[] = { 'A' + 1, 0 }; + static char const a_1[] = { 'a' - 1, 0 }; + static char const a01[] = { 'a' + 1, 0 }; + static char const bs_1[] = { '\\\\' - 1, 0 }; + static char const bs01[] = { '\\\\' + 1, 0 }; + int result = 0; + if (!n ("a*", "", 0)) + return 1; + if (!y ("a*", "abc", 0)) + return 1; + if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */ + return 1; + if (!n ("d*/*1", "d/s/1", FNM_PATHNAME)) + return 2; + if (!y ("a\\\\bc", "abc", 0)) + return 3; + if (!n ("a\\\\bc", "abc", FNM_NOESCAPE)) + return 3; + if (!y ("*x", ".x", 0)) + return 4; + if (!n ("*x", ".x", FNM_PERIOD)) + return 4; + if (!y (Apat, "\\\\", 0)) + return 5; + if (!y (Apat, "A", 0)) + return 5; + if (!y (apat, "\\\\", 0)) + return 5; + if (!y (apat, "a", 0)) + return 5; + if (!(n (Apat, A_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, a_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, A01, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, a01, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, bs_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, bs_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(n (Apat, bs01, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, bs01, 0) == ('a' < '\\\\'))) + return 5; + $gl_fnmatch_gnu_start + if (!y ("xxXX", "xXxX", FNM_CASEFOLD)) + result |= 8; + if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)) + result |= 16; + if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME)) + result |= 32; + if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + $gl_fnmatch_gnu_end + return result; + ]])], + [eval "$gl_fnmatch_cache_var=yes"], + [eval "$gl_fnmatch_cache_var=no"], + [eval "$gl_fnmatch_cache_var=\"guessing no\""]) + ]) + eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\"" + if test "$gl_fnmatch_result" = yes; then + dnl Not strictly necessary. Only to avoid spurious leftover files if people + dnl don't do "make distclean". + rm -f "$gl_source_base/fnmatch.h" + else + FNMATCH_H=fnmatch.h + fi + AC_SUBST([FNMATCH_H]) + AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_H"]) +]) + +# Request a POSIX compliant fnmatch function with GNU extensions. +AC_DEFUN([gl_FUNC_FNMATCH_GNU], +[ + m4_divert_text([INIT_PREPARE], [gl_fnmatch_required=GNU]) + + AC_REQUIRE([gl_FUNC_FNMATCH_POSIX]) +]) + +AC_DEFUN([gl_PREREQ_FNMATCH], +[ + dnl We must choose a different name for our function, since on ELF systems + dnl a broken fnmatch() in libc.so would override our fnmatch() if it is + dnl compiled into a shared library. + AC_DEFINE_UNQUOTED([fnmatch], [${gl_fnmatch_required_lowercase}_fnmatch], + [Define to a replacement function name for fnmatch().]) + dnl Prerequisites of lib/fnmatch.c. + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]]) + AC_CHECK_FUNCS_ONCE([btowc isblank iswctype mbsrtowcs mempcpy wmemchr wmemcpy wmempcpy]) + AC_CHECK_HEADERS_ONCE([wctype.h]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/fpieee.m4 b/local/recipes/tools/diffutils/source/m4/fpieee.m4 new file mode 100644 index 0000000000..69579d82a7 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/fpieee.m4 @@ -0,0 +1,54 @@ +# fpieee.m4 serial 2 -*- coding: utf-8 -*- +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl IEEE 754 standardized three items: +dnl - The formats of single-float and double-float - nowadays commonly +dnl available as 'float' and 'double' in C and C++. +dnl No autoconf test needed. +dnl - The overflow and division by zero behaviour: The result are values +dnl '±Inf' and 'NaN', rather than exceptions as it was before. +dnl This file provides an autoconf macro for ensuring this behaviour of +dnl floating-point operations. +dnl - A set of conditions (overflow, underflow, inexact, etc.) which can +dnl be configured to trigger an exception. +dnl This cannot be done in a portable way: it depends on the compiler, +dnl libc, kernel, and CPU. No autoconf macro is provided for this. + +dnl Ensure non-trapping behaviour of floating-point overflow and +dnl floating-point division by zero. +dnl (For integer overflow, see gcc's -ftrapv option; for integer division by +dnl zero, see the autoconf macro in intdiv0.m4.) + +AC_DEFUN([gl_FP_IEEE], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + # IEEE behaviour is the default on all CPUs except Alpha and SH + # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 + # and the GCC 4.1.2 manual). + case "$host_cpu" in + alpha*) + # On Alpha systems, a compiler option provides the behaviour. + # See the ieee(3) manual page, also available at + # <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/0600____.HTM> + if test -n "$GCC"; then + # GCC has the option -mieee. + # For full IEEE compliance (rarely needed), use option -mieee-with-inexact. + CPPFLAGS="$CPPFLAGS -mieee" + else + # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact. + # For full IEEE compliance (rarely needed), use option -ieee_with_inexact. + CPPFLAGS="$CPPFLAGS -ieee" + fi + ;; + sh*) + if test -n "$GCC"; then + # GCC has the option -mieee. + CPPFLAGS="$CPPFLAGS -mieee" + fi + ;; + esac +]) diff --git a/local/recipes/tools/diffutils/source/m4/freopen.m4 b/local/recipes/tools/diffutils/source/m4/freopen.m4 new file mode 100644 index 0000000000..e772377ac5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/freopen.m4 @@ -0,0 +1,40 @@ +# freopen.m4 serial 6 +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_FREOPEN], +[ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw* | pw* | os2*) + REPLACE_FREOPEN=1 + ;; + *) + AC_CACHE_CHECK([whether freopen works on closed fds], + [gl_cv_func_freopen_works_on_closed], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <stdio.h> + #include <unistd.h> + ]], + [[close (0); + return !(freopen ("/dev/null", "r", stdin) + && getchar () == EOF + && !ferror (stdin) && feof (stdin));]])], + [gl_cv_func_freopen_works_on_closed=yes], + [gl_cv_func_freopen_works_on_closed=no], + [case $host_os in + *gnu*) gl_cv_func_freopen_works_on_closed="guessing no" ;; + *) gl_cv_func_freopen_works_on_closed="guessing yes";; + esac])]) + case $gl_cv_func_freopen_works_on_closed in + *no) REPLACE_FREOPEN=1;; + esac + esac +]) + +# Prerequisites of lib/freopen.c. +AC_DEFUN([gl_PREREQ_FREOPEN], [:]) diff --git a/local/recipes/tools/diffutils/source/m4/fstat.m4 b/local/recipes/tools/diffutils/source/m4/fstat.m4 new file mode 100644 index 0000000000..e70e533e7a --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/fstat.m4 @@ -0,0 +1,38 @@ +# fstat.m4 serial 5 +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_FSTAT], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + + case "$host_os" in + mingw*) + dnl On this platform, the original stat() returns st_atime, st_mtime, + dnl st_ctime values that are affected by the time zone. + REPLACE_FSTAT=1 + ;; + esac + + dnl Replace fstat() for supporting the gnulib-defined open() on directories. + m4_ifdef([gl_FUNC_FCHDIR], [ + gl_TEST_FCHDIR + if test $HAVE_FCHDIR = 0; then + case "$gl_cv_func_open_directory_works" in + *yes) ;; + *) + REPLACE_FSTAT=1 + ;; + esac + fi + ]) +]) + +# Prerequisites of lib/fstat.c and lib/stat-w32.c. +AC_DEFUN([gl_PREREQ_FSTAT], [ + AC_REQUIRE([gl_HEADER_SYS_STAT_H]) + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/ftruncate.m4 b/local/recipes/tools/diffutils/source/m4/ftruncate.m4 new file mode 100644 index 0000000000..40700161cb --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/ftruncate.m4 @@ -0,0 +1,40 @@ +# serial 20 + +# See if we need to emulate a missing ftruncate function using chsize. + +# Copyright (C) 2000-2001, 2003-2007, 2009-2017 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_FTRUNCATE], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([ftruncate]) + if test $ac_cv_func_ftruncate = yes; then + m4_ifdef([gl_LARGEFILE], [ + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw*) + dnl Native Windows, and Large File Support is requested. + dnl The MSVCRT _chsize() function only accepts a 32-bit file size, + dnl and the mingw64 ftruncate64() function is unreliable (it may + dnl delete the file, see + dnl <http://mingw-w64.sourcearchive.com/documentation/2.0-1/ftruncate64_8c_source.html>). + dnl Use gnulib's ftruncate() implementation instead. + REPLACE_FTRUNCATE=1 + ;; + esac + ], [ + : + ]) + else + HAVE_FTRUNCATE=0 + fi +]) + +# Prerequisites of lib/ftruncate.c. +AC_DEFUN([gl_PREREQ_FTRUNCATE], +[ + AC_CHECK_FUNCS([chsize]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/getcwd.m4 b/local/recipes/tools/diffutils/source/m4/getcwd.m4 new file mode 100644 index 0000000000..ec6b637c50 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/getcwd.m4 @@ -0,0 +1,162 @@ +# getcwd.m4 - check for working getcwd that is compatible with glibc + +# Copyright (C) 2001, 2003-2007, 2009-2017 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Written by Paul Eggert. +# serial 13 + +AC_DEFUN([gl_FUNC_GETCWD_NULL], + [ + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CHECK_HEADERS_ONCE([unistd.h]) + AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result], + [gl_cv_func_getcwd_null], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +# include <stdlib.h> +# if HAVE_UNISTD_H +# include <unistd.h> +# else /* on Windows with MSVC */ +# include <direct.h> +# endif +# ifndef getcwd + char *getcwd (); +# endif +]], [[ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* mingw cwd does not start with '/', but getcwd does allocate. + However, mingw fails to honor non-zero size. */ +#else + if (chdir ("/") != 0) + return 1; + else + { + char *f = getcwd (NULL, 0); + if (! f) + return 2; + if (f[0] != '/') + return 3; + if (f[1] != '\0') + return 4; + free (f); + return 0; + } +#endif + ]])], + [gl_cv_func_getcwd_null=yes], + [gl_cv_func_getcwd_null=no], + [[case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_getcwd_null="guessing yes";; + # Guess yes on Cygwin. + cygwin*) gl_cv_func_getcwd_null="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_getcwd_null="guessing no";; + esac + ]])]) +]) + +AC_DEFUN([gl_FUNC_GETCWD_SIGNATURE], +[ + AC_CACHE_CHECK([for getcwd with POSIX signature], + [gl_cv_func_getcwd_posix_signature], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <unistd.h>]], + [[extern + #ifdef __cplusplus + "C" + #endif + char *getcwd (char *, size_t); + ]]) + ], + [gl_cv_func_getcwd_posix_signature=yes], + [gl_cv_func_getcwd_posix_signature=no]) + ]) +]) + +dnl Guarantee that getcwd will malloc with a NULL first argument. Assumes +dnl that either the system getcwd is robust, or that calling code is okay +dnl with spurious failures when run from a directory with an absolute name +dnl larger than 4k bytes. +dnl +dnl Assumes that getcwd exists; if you are worried about obsolete +dnl platforms that lacked getcwd(), then you need to use the GPL module. +AC_DEFUN([gl_FUNC_GETCWD_LGPL], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([gl_FUNC_GETCWD_NULL]) + AC_REQUIRE([gl_FUNC_GETCWD_SIGNATURE]) + + case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in + *yes,yes) ;; + *) + dnl Minimal replacement lib/getcwd-lgpl.c. + REPLACE_GETCWD=1 + ;; + esac +]) + +dnl Check for all known getcwd bugs; useful for a program likely to be +dnl executed from an arbitrary location. +AC_DEFUN([gl_FUNC_GETCWD], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([gl_FUNC_GETCWD_NULL]) + AC_REQUIRE([gl_FUNC_GETCWD_SIGNATURE]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + gl_abort_bug=no + case "$host_os" in + mingw*) + gl_cv_func_getcwd_path_max=yes + ;; + *) + gl_FUNC_GETCWD_PATH_MAX + case "$gl_cv_func_getcwd_null" in + *yes) + gl_FUNC_GETCWD_ABORT_BUG([gl_abort_bug=yes]) + ;; + esac + ;; + esac + dnl Define HAVE_MINIMALLY_WORKING_GETCWD and HAVE_PARTLY_WORKING_GETCWD + dnl if appropriate. + case "$gl_cv_func_getcwd_path_max" in + "no"|"no, it has the AIX bug") ;; + *) + AC_DEFINE([HAVE_MINIMALLY_WORKING_GETCWD], [1], + [Define to 1 if getcwd minimally works, that is, its result can be + trusted when it succeeds.]) + ;; + esac + case "$gl_cv_func_getcwd_path_max" in + "no, but it is partly working") + AC_DEFINE([HAVE_PARTLY_WORKING_GETCWD], [1], + [Define to 1 if getcwd works, except it sometimes fails when it + shouldn't, setting errno to ERANGE, ENAMETOOLONG, or ENOENT.]) + ;; + "yes, but with shorter paths") + AC_DEFINE([HAVE_GETCWD_SHORTER], [1], + [Define to 1 if getcwd works, but with shorter paths + than is generally tested with the replacement.]) + ;; + esac + + if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \ + || test $gl_cv_func_getcwd_posix_signature != yes \ + || { case "$gl_cv_func_getcwd_path_max" in *yes*) false;; *) true;; esac; } \ + || test $gl_abort_bug = yes; then + REPLACE_GETCWD=1 + fi +]) + +# Prerequisites of lib/getcwd.c, when full replacement is in effect. +AC_DEFUN([gl_PREREQ_GETCWD], +[ + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO]) + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/getdtablesize.m4 b/local/recipes/tools/diffutils/source/m4/getdtablesize.m4 new file mode 100644 index 0000000000..1af2a2478f --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/getdtablesize.m4 @@ -0,0 +1,46 @@ +# getdtablesize.m4 serial 6 +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_GETDTABLESIZE], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_FUNCS_ONCE([getdtablesize]) + AC_CHECK_DECLS_ONCE([getdtablesize]) + if test $ac_cv_func_getdtablesize = yes && + test $ac_cv_have_decl_getdtablesize = yes; then + # Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft limit + # up to an unchangeable hard limit; all other platforms correctly + # require setrlimit before getdtablesize() can report a larger value. + AC_CACHE_CHECK([whether getdtablesize works], + [gl_cv_func_getdtablesize_works], + [AC_RUN_IFELSE([ + AC_LANG_PROGRAM([[#include <unistd.h>]], + [int size = getdtablesize(); + if (dup2 (0, getdtablesize()) != -1) + return 1; + if (size != getdtablesize()) + return 2; + ])], + [gl_cv_func_getdtablesize_works=yes], + [gl_cv_func_getdtablesize_works=no], + [case "$host_os" in + cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows + gl_cv_func_getdtablesize_works="guessing no" ;; + *) gl_cv_func_getdtablesize_works="guessing yes" ;; + esac]) + ]) + case "$gl_cv_func_getdtablesize_works" in + *yes) ;; + *) REPLACE_GETDTABLESIZE=1 ;; + esac + else + HAVE_GETDTABLESIZE=0 + fi +]) + +# Prerequisites of lib/getdtablesize.c. +AC_DEFUN([gl_PREREQ_GETDTABLESIZE], [:]) diff --git a/local/recipes/tools/diffutils/source/m4/getopt.m4 b/local/recipes/tools/diffutils/source/m4/getopt.m4 new file mode 100644 index 0000000000..3ebc7b7edf --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/getopt.m4 @@ -0,0 +1,379 @@ +# getopt.m4 serial 46 +dnl Copyright (C) 2002-2006, 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Request a POSIX compliant getopt function. +AC_DEFUN([gl_FUNC_GETOPT_POSIX], +[ + m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX]) + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([gl_GETOPT_CHECK_HEADERS]) + dnl Other modules can request the gnulib implementation of the getopt + dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS. + dnl argp.m4 does this. + m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [ + REPLACE_GETOPT=1 + ], [ + REPLACE_GETOPT=0 + if test -n "$gl_replace_getopt"; then + REPLACE_GETOPT=1 + fi + ]) + if test $REPLACE_GETOPT = 1; then + dnl Arrange for getopt.h to be created. + gl_GETOPT_SUBSTITUTE_HEADER + fi +]) + +# Request a POSIX compliant getopt function with GNU extensions (such as +# options with optional arguments) and the functions getopt_long, +# getopt_long_only. +AC_DEFUN([gl_FUNC_GETOPT_GNU], +[ + dnl Set the variable gl_getopt_required, so that all invocations of + dnl gl_GETOPT_CHECK_HEADERS in the scope of the current configure file + dnl will check for getopt with GNU extensions. + dnl This means that if one gnulib-tool invocation requests getopt-posix + dnl and another gnulib-tool invocation requests getopt-gnu, it is as if + dnl both had requested getopt-gnu. + m4_divert_text([INIT_PREPARE], [gl_getopt_required=GNU]) + + dnl No need to invoke gl_FUNC_GETOPT_POSIX here; this is automatically + dnl done through the module dependency getopt-gnu -> getopt-posix. +]) + +# Determine whether to replace the entire getopt facility. +AC_DEFUN([gl_GETOPT_CHECK_HEADERS], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([AC_PROG_AWK]) dnl for awk that supports ENVIRON + + dnl Persuade Solaris <unistd.h> to declare optarg, optind, opterr, optopt. + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + gl_CHECK_NEXT_HEADERS([getopt.h]) + if test $ac_cv_header_getopt_h = yes; then + HAVE_GETOPT_H=1 + else + HAVE_GETOPT_H=0 + fi + AC_SUBST([HAVE_GETOPT_H]) + + gl_replace_getopt= + + dnl Test whether <getopt.h> is available. + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + AC_CHECK_HEADERS([getopt.h], [], [gl_replace_getopt=yes]) + fi + + dnl Test whether the function getopt_long is available. + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes]) + fi + + dnl POSIX 2008 does not specify leading '+' behavior, but see + dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on + dnl the next version of POSIX. For now, we only guarantee leading '+' + dnl behavior with getopt-gnu. + if test -z "$gl_replace_getopt"; then + AC_CACHE_CHECK([whether getopt is POSIX compatible], + [gl_cv_func_getopt_posix], + [ + dnl Merging these three different test programs into a single one + dnl would require a reset mechanism. On BSD systems, it can be done + dnl through 'optreset'; on some others (glibc), it can be done by + dnl setting 'optind' to 0; on others again (HP-UX, IRIX, OSF/1, + dnl Solaris 9, musl libc), there is no such mechanism. + if test $cross_compiling = no; then + dnl Sanity check. Succeeds everywhere (except on MSVC, + dnl which lacks <unistd.h> and getopt() entirely). + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <unistd.h> +#include <stdlib.h> +#include <string.h> + +int +main () +{ + static char program[] = "program"; + static char a[] = "-a"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, a, foo, bar, NULL }; + int c; + + c = getopt (4, argv, "ab"); + if (!(c == 'a')) + return 1; + c = getopt (4, argv, "ab"); + if (!(c == -1)) + return 2; + if (!(optind == 2)) + return 3; + return 0; +} +]])], + [gl_cv_func_getopt_posix=maybe], + [gl_cv_func_getopt_posix=no]) + if test $gl_cv_func_getopt_posix = maybe; then + dnl Sanity check with '+'. Succeeds everywhere (except on MSVC, + dnl which lacks <unistd.h> and getopt() entirely). + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <unistd.h> +#include <stdlib.h> +#include <string.h> + +int +main () +{ + static char program[] = "program"; + static char donald[] = "donald"; + static char p[] = "-p"; + static char billy[] = "billy"; + static char duck[] = "duck"; + static char a[] = "-a"; + static char bar[] = "bar"; + char *argv[] = { program, donald, p, billy, duck, a, bar, NULL }; + int c; + + c = getopt (7, argv, "+abp:q:"); + if (!(c == -1)) + return 4; + if (!(strcmp (argv[0], "program") == 0)) + return 5; + if (!(strcmp (argv[1], "donald") == 0)) + return 6; + if (!(strcmp (argv[2], "-p") == 0)) + return 7; + if (!(strcmp (argv[3], "billy") == 0)) + return 8; + if (!(strcmp (argv[4], "duck") == 0)) + return 9; + if (!(strcmp (argv[5], "-a") == 0)) + return 10; + if (!(strcmp (argv[6], "bar") == 0)) + return 11; + if (!(optind == 1)) + return 12; + return 0; +} +]])], + [gl_cv_func_getopt_posix=maybe], + [gl_cv_func_getopt_posix=no]) + fi + if test $gl_cv_func_getopt_posix = maybe; then + dnl Detect Mac OS X 10.5, AIX 7.1, mingw bug. + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <unistd.h> +#include <stdlib.h> +#include <string.h> + +int +main () +{ + static char program[] = "program"; + static char ab[] = "-ab"; + char *argv[3] = { program, ab, NULL }; + if (getopt (2, argv, "ab:") != 'a') + return 13; + if (getopt (2, argv, "ab:") != '?') + return 14; + if (optopt != 'b') + return 15; + if (optind != 2) + return 16; + return 0; +} +]])], + [gl_cv_func_getopt_posix=yes], + [gl_cv_func_getopt_posix=no]) + fi + else + case "$host_os" in + darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";; + *) gl_cv_func_getopt_posix="guessing yes";; + esac + fi + ]) + case "$gl_cv_func_getopt_posix" in + *no) gl_replace_getopt=yes ;; + esac + fi + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_getopt_gnu], + [# Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the + # optstring is necessary for programs like m4 that have POSIX-mandated + # semantics for supporting options interspersed with files. + # Also, since getopt_long is a GNU extension, we require optind=0. + # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT; + # so take care to revert to the correct (non-)export state. +dnl GNU Coding Standards currently allow awk but not env; besides, env +dnl is ambiguous with environment values that contain newlines. + gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }' + case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in + xx) gl_had_POSIXLY_CORRECT=exported ;; + x) gl_had_POSIXLY_CORRECT=yes ;; + *) gl_had_POSIXLY_CORRECT= ;; + esac + POSIXLY_CORRECT=1 + export POSIXLY_CORRECT + AC_RUN_IFELSE( + [AC_LANG_PROGRAM([[#include <getopt.h> + #include <stddef.h> + #include <string.h> + ]GL_NOCRASH[ + ]], [[ + int result = 0; + + nocrash_init(); + + /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw, + and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5, + OSF/1 5.1, Solaris 10. */ + { + static char conftest[] = "conftest"; + static char plus[] = "-+"; + char *argv[3] = { conftest, plus, NULL }; + opterr = 0; + if (getopt (2, argv, "+a") != '?') + result |= 1; + } + /* This code succeeds on glibc 2.8, mingw, + and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11, + IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */ + { + static char program[] = "program"; + static char p[] = "-p"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, p, foo, bar, NULL }; + + optind = 1; + if (getopt (4, argv, "p::") != 'p') + result |= 2; + else if (optarg != NULL) + result |= 4; + else if (getopt (4, argv, "p::") != -1) + result |= 6; + else if (optind != 2) + result |= 8; + } + /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */ + { + static char program[] = "program"; + static char foo[] = "foo"; + static char p[] = "-p"; + char *argv[] = { program, foo, p, NULL }; + optind = 0; + if (getopt (3, argv, "-p") != 1) + result |= 16; + else if (getopt (3, argv, "-p") != 'p') + result |= 16; + } + /* This code fails on glibc 2.11. */ + { + static char program[] = "program"; + static char b[] = "-b"; + static char a[] = "-a"; + char *argv[] = { program, b, a, NULL }; + optind = opterr = 0; + if (getopt (3, argv, "+:a:b") != 'b') + result |= 32; + else if (getopt (3, argv, "+:a:b") != ':') + result |= 32; + } + /* This code dumps core on glibc 2.14. */ + { + static char program[] = "program"; + static char w[] = "-W"; + static char dummy[] = "dummy"; + char *argv[] = { program, w, dummy, NULL }; + optind = opterr = 1; + if (getopt (3, argv, "W;") != 'W') + result |= 64; + } + return result; + ]])], + [gl_cv_func_getopt_gnu=yes], + [gl_cv_func_getopt_gnu=no], + [dnl Cross compiling. Assume the worst, even on glibc platforms. + gl_cv_func_getopt_gnu="guessing no" + ]) + case $gl_had_POSIXLY_CORRECT in + exported) ;; + yes) AS_UNSET([POSIXLY_CORRECT]); POSIXLY_CORRECT=1 ;; + *) AS_UNSET([POSIXLY_CORRECT]) ;; + esac + ]) + if test "$gl_cv_func_getopt_gnu" != yes; then + gl_replace_getopt=yes + else + AC_CACHE_CHECK([for working GNU getopt_long function], + [gl_cv_func_getopt_long_gnu], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <getopt.h> + #include <stddef.h> + #include <string.h> + ]], + [[static const struct option long_options[] = + { + { "xtremely-",no_argument, NULL, 1003 }, + { "xtra", no_argument, NULL, 1001 }, + { "xtreme", no_argument, NULL, 1002 }, + { "xtremely", no_argument, NULL, 1003 }, + { NULL, 0, NULL, 0 } + }; + /* This code fails on OpenBSD 5.0. */ + { + static char program[] = "program"; + static char xtremel[] = "--xtremel"; + char *argv[] = { program, xtremel, NULL }; + int option_index; + optind = 1; opterr = 0; + if (getopt_long (2, argv, "", long_options, &option_index) != 1003) + return 1; + } + return 0; + ]])], + [gl_cv_func_getopt_long_gnu=yes], + [gl_cv_func_getopt_long_gnu=no], + [dnl Cross compiling. Guess no on OpenBSD, yes otherwise. + case "$host_os" in + openbsd*) gl_cv_func_getopt_long_gnu="guessing no";; + *) gl_cv_func_getopt_long_gnu="guessing yes";; + esac + ]) + ]) + case "$gl_cv_func_getopt_long_gnu" in + *yes) ;; + *) gl_replace_getopt=yes ;; + esac + fi + fi +]) + +AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER], +[ + AC_CHECK_HEADERS_ONCE([sys/cdefs.h]) + if test $ac_cv_header_sys_cdefs_h = yes; then + HAVE_SYS_CDEFS_H=1 + else + HAVE_SYS_CDEFS_H=0 + fi + AC_SUBST([HAVE_SYS_CDEFS_H]) + + AC_DEFINE([__GETOPT_PREFIX], [[rpl_]], + [Define to rpl_ if the getopt replacement functions and variables + should be used.]) + GETOPT_H=getopt.h + GETOPT_CDEFS_H=getopt-cdefs.h + AC_SUBST([GETOPT_H]) + AC_SUBST([GETOPT_CDEFS_H]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/getpagesize.m4 b/local/recipes/tools/diffutils/source/m4/getpagesize.m4 new file mode 100644 index 0000000000..f891200f14 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/getpagesize.m4 @@ -0,0 +1,32 @@ +# getpagesize.m4 serial 9 +dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2017 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_GETPAGESIZE], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_FUNCS([getpagesize]) + if test $ac_cv_func_getpagesize = no; then + HAVE_GETPAGESIZE=0 + AC_CHECK_HEADERS([OS.h]) + if test $ac_cv_header_OS_h = yes; then + HAVE_OS_H=1 + fi + AC_CHECK_HEADERS([sys/param.h]) + if test $ac_cv_header_sys_param_h = yes; then + HAVE_SYS_PARAM_H=1 + fi + fi + case "$host_os" in + mingw*) + REPLACE_GETPAGESIZE=1 + ;; + esac + dnl Also check whether it's declared. + dnl mingw has getpagesize() in libgcc.a but doesn't declare it. + AC_CHECK_DECL([getpagesize], , [HAVE_DECL_GETPAGESIZE=0]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/getprogname.m4 b/local/recipes/tools/diffutils/source/m4/getprogname.m4 new file mode 100644 index 0000000000..efc06e78e5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/getprogname.m4 @@ -0,0 +1,43 @@ +# getprogname.m4 - check for getprogname or replacements for it + +# Copyright (C) 2016-2017 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +AC_DEFUN([gl_FUNC_GETPROGNAME], +[ + AC_CHECK_FUNCS_ONCE([getprogname getexecname]) + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + ac_found=0 + AC_CHECK_DECLS([program_invocation_name], [ac_found=1], [], + [#include <errno.h>]) + AC_CHECK_DECLS([program_invocation_short_name], [ac_found=1], [], + [#include <errno.h>]) + AC_CHECK_DECLS([__argv], [ac_found=1], [], [#include <stdlib.h>]) + + # Incur the cost of this test only if none of the above worked. + if test $ac_found = 0; then + # On OpenBSD 5.1, using the global __progname variable appears to be + # the only way to implement getprogname. + AC_CACHE_CHECK([whether __progname is defined in default libraries], + [gl_cv_var___progname], + [ + gl_cv_var___progname= + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[extern char *__progname;]], + [[return *__progname;]] + )], + [gl_cv_var___progname=yes] + ) + ] + ) + if test "$gl_cv_var___progname" = yes; then + AC_DEFINE([HAVE_VAR___PROGNAME], 1, + [Define if you have a global __progname variable]) + fi + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/gettext.m4 b/local/recipes/tools/diffutils/source/m4/gettext.m4 new file mode 100644 index 0000000000..be247bf7b8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/gettext.m4 @@ -0,0 +1,401 @@ +# gettext.m4 serial 66 (gettext-0.18.2) +dnl Copyright (C) 1995-2014 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. +dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010. + +dnl Macro to add for using GNU gettext. + +dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). +dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The +dnl default (if it is not specified or empty) is 'no-libtool'. +dnl INTLSYMBOL should be 'external' for packages with no intl directory, +dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. +dnl If INTLSYMBOL is 'use-libtool', then a libtool library +dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, +dnl depending on --{enable,disable}-{shared,static} and on the presence of +dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library +dnl $(top_builddir)/intl/libintl.a will be created. +dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext +dnl implementations (in libc or libintl) without the ngettext() function +dnl will be ignored. If NEEDSYMBOL is specified and is +dnl 'need-formatstring-macros', then GNU gettext implementations that don't +dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored. +dnl INTLDIR is used to find the intl libraries. If empty, +dnl the value '$(top_builddir)/intl/' is used. +dnl +dnl The result of the configuration is one of three cases: +dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled +dnl and used. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 2) GNU gettext has been found in the system's C library. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 3) No internationalization, always use English msgid. +dnl Catalog format: none +dnl Catalog extension: none +dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. +dnl The use of .gmo is historical (it was needed to avoid overwriting the +dnl GNU format catalogs when building on a platform with an X/Open gettext), +dnl but we keep it in order not to force irrelevant filename changes on the +dnl maintainers. +dnl +AC_DEFUN([AM_GNU_GETTEXT], +[ + dnl Argument checking. + ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , + [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT +])])])])]) + ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], + [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])]) + ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , + [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT +])])])]) + define([gt_included_intl], + ifelse([$1], [external], + ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), + [yes])) + define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) + gt_NEEDS_INIT + AM_GNU_GETTEXT_NEED([$2]) + + AC_REQUIRE([AM_PO_SUBDIRS])dnl + ifelse(gt_included_intl, yes, [ + AC_REQUIRE([AM_INTL_SUBDIR])dnl + ]) + + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Sometimes libintl requires libiconv, so first search for libiconv. + dnl Ideally we would do this search only after the + dnl if test "$USE_NLS" = "yes"; then + dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT + dnl the configure script would need to contain the same shell code + dnl again, outside any 'if'. There are two solutions: + dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. + dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. + dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not + dnl documented, we avoid it. + ifelse(gt_included_intl, yes, , [ + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + ]) + + dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation. + gt_INTL_MACOSX + + dnl Set USE_NLS. + AC_REQUIRE([AM_NLS]) + + ifelse(gt_included_intl, yes, [ + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + ]) + LIBINTL= + LTLIBINTL= + POSUB= + + dnl Add a version number to the cache macros. + case " $gt_needs " in + *" need-formatstring-macros "*) gt_api_version=3 ;; + *" need-ngettext "*) gt_api_version=2 ;; + *) gt_api_version=1 ;; + esac + gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" + gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + + dnl If we use NLS figure out what method + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + ifelse(gt_included_intl, yes, [ + AC_MSG_CHECKING([whether included gettext is requested]) + AC_ARG_WITH([included-gettext], + [ --with-included-gettext use the GNU gettext library included here], + nls_cv_force_use_gnu_gettext=$withval, + nls_cv_force_use_gnu_gettext=no) + AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext]) + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + ]) + dnl User does not insist on using GNU NLS library. Figure out what + dnl to use. If GNU gettext is available we use this. Else we have + dnl to fall back to GNU NLS library. + + if test $gt_api_version -ge 3; then + gt_revision_test_code=' +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +changequote(,)dnl +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +changequote([,])dnl +' + else + gt_revision_test_code= + fi + if test $gt_api_version -ge 2; then + gt_expression_test_code=' + * ngettext ("", "", 0)' + else + gt_expression_test_code= + fi + + AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <libintl.h> +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings + ]])], + [eval "$gt_func_gnugettext_libc=yes"], + [eval "$gt_func_gnugettext_libc=no"])]) + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + dnl Sometimes libintl requires libiconv, so first search for libiconv. + ifelse(gt_included_intl, yes, , [ + AM_ICONV_LINK + ]) + dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL + dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) + dnl because that would add "-liconv" to LIBINTL and LTLIBINTL + dnl even if libiconv doesn't exist. + AC_LIB_LINKFLAGS_BODY([intl]) + AC_CACHE_CHECK([for GNU gettext in libintl], + [$gt_func_gnugettext_libintl], + [gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + dnl Now see whether libintl exists and does not depend on libiconv. + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <libintl.h> +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ]])], + [eval "$gt_func_gnugettext_libintl=yes"], + [eval "$gt_func_gnugettext_libintl=no"]) + dnl Now see whether libintl exists and depends on libiconv. + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <libintl.h> +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ]])], + [LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" + ]) + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS"]) + fi + + dnl If an already present or preinstalled GNU gettext() is found, + dnl use it. But if this macro is used in GNU gettext, and GNU + dnl gettext is already preinstalled in libintl, we update this + dnl libintl. (Cf. the install rule in intl/Makefile.in.) + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ + || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + dnl Reset the values set by searching for libintl. + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + ifelse(gt_included_intl, yes, [ + if test "$gt_use_preinstalled_gnugettext" != "yes"; then + dnl GNU gettext is not found in the C library. + dnl Fall back on included GNU gettext library. + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions used to generate GNU NLS library. + BUILD_INCLUDED_LIBINTL=yes + USE_INCLUDED_LIBINTL=yes + LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" + LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + fi + + CATOBJEXT= + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions to use GNU gettext tools. + CATOBJEXT=.gmo + fi + ]) + + if test -n "$INTL_MACOSX_LIBS"; then + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Some extra flags are needed during linking. + LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" + LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" + fi + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + AC_DEFINE([ENABLE_NLS], [1], + [Define to 1 if translation of program messages to the user's native language + is requested.]) + else + USE_NLS=no + fi + fi + + AC_MSG_CHECKING([whether to use NLS]) + AC_MSG_RESULT([$USE_NLS]) + if test "$USE_NLS" = "yes"; then + AC_MSG_CHECKING([where the gettext function comes from]) + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + AC_MSG_RESULT([$gt_source]) + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + AC_MSG_CHECKING([how to link with libintl]) + AC_MSG_RESULT([$LIBINTL]) + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) + fi + + dnl For backward compatibility. Some packages may be using this. + AC_DEFINE([HAVE_GETTEXT], [1], + [Define if the GNU gettext() function is already present or preinstalled.]) + AC_DEFINE([HAVE_DCGETTEXT], [1], + [Define if the GNU dcgettext() function is already present or preinstalled.]) + fi + + dnl We need to process the po/ directory. + POSUB=po + fi + + ifelse(gt_included_intl, yes, [ + dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL + dnl to 'yes' because some of the testsuite requires it. + if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then + BUILD_INCLUDED_LIBINTL=yes + fi + + dnl Make all variables we use known to autoconf. + AC_SUBST([BUILD_INCLUDED_LIBINTL]) + AC_SUBST([USE_INCLUDED_LIBINTL]) + AC_SUBST([CATOBJEXT]) + + dnl For backward compatibility. Some configure.ins may be using this. + nls_cv_header_intl= + nls_cv_header_libgt= + + dnl For backward compatibility. Some Makefiles may be using this. + DATADIRNAME=share + AC_SUBST([DATADIRNAME]) + + dnl For backward compatibility. Some Makefiles may be using this. + INSTOBJEXT=.mo + AC_SUBST([INSTOBJEXT]) + + dnl For backward compatibility. Some Makefiles may be using this. + GENCAT=gencat + AC_SUBST([GENCAT]) + + dnl For backward compatibility. Some Makefiles may be using this. + INTLOBJS= + if test "$USE_INCLUDED_LIBINTL" = yes; then + INTLOBJS="\$(GETTOBJS)" + fi + AC_SUBST([INTLOBJS]) + + dnl Enable libtool support if the surrounding package wishes it. + INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix + AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX]) + ]) + + dnl For backward compatibility. Some Makefiles may be using this. + INTLLIBS="$LIBINTL" + AC_SUBST([INTLLIBS]) + + dnl Make all documented variables known to autoconf. + AC_SUBST([LIBINTL]) + AC_SUBST([LTLIBINTL]) + AC_SUBST([POSUB]) +]) + + +dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. +m4_define([gt_NEEDS_INIT], +[ + m4_divert_text([DEFAULTS], [gt_needs=]) + m4_define([gt_NEEDS_INIT], []) +]) + + +dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) +AC_DEFUN([AM_GNU_GETTEXT_NEED], +[ + m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) +]) + + +dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) +AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) diff --git a/local/recipes/tools/diffutils/source/m4/gettime.m4 b/local/recipes/tools/diffutils/source/m4/gettime.m4 new file mode 100644 index 0000000000..1cdab2780d --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/gettime.m4 @@ -0,0 +1,13 @@ +# gettime.m4 serial 8 +dnl Copyright (C) 2002, 2004-2006, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_GETTIME], +[ + dnl Prerequisites of lib/gettime.c. + AC_REQUIRE([gl_CLOCK_TIME]) + AC_REQUIRE([gl_TIMESPEC]) + AC_CHECK_FUNCS_ONCE([gettimeofday nanotime]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/gettimeofday.m4 b/local/recipes/tools/diffutils/source/m4/gettimeofday.m4 new file mode 100644 index 0000000000..8ee206eea2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/gettimeofday.m4 @@ -0,0 +1,124 @@ +# serial 23 + +# Copyright (C) 2001-2003, 2005, 2007, 2009-2017 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +dnl From Jim Meyering. + +AC_DEFUN([gl_FUNC_GETTIMEOFDAY], +[ + AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_HEADER_SYS_TIME_H]) + AC_CHECK_FUNCS_ONCE([gettimeofday]) + + gl_gettimeofday_timezone=void + if test $ac_cv_func_gettimeofday != yes; then + HAVE_GETTIMEOFDAY=0 + else + gl_FUNC_GETTIMEOFDAY_CLOBBER + AC_CACHE_CHECK([for gettimeofday with POSIX signature], + [gl_cv_func_gettimeofday_posix_signature], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <sys/time.h> + struct timeval c; + int gettimeofday (struct timeval *restrict, void *restrict); + ]], + [[/* glibc uses struct timezone * rather than the POSIX void * + if _GNU_SOURCE is defined. However, since the only portable + use of gettimeofday uses NULL as the second parameter, and + since the glibc definition is actually more typesafe, it is + not worth wrapping this to get a compliant signature. */ + int (*f) (struct timeval *restrict, void *restrict) + = gettimeofday; + int x = f (&c, 0); + return !(x | c.tv_sec | c.tv_usec); + ]])], + [gl_cv_func_gettimeofday_posix_signature=yes], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <sys/time.h> +int gettimeofday (struct timeval *restrict, struct timezone *restrict); + ]])], + [gl_cv_func_gettimeofday_posix_signature=almost], + [gl_cv_func_gettimeofday_posix_signature=no])])]) + if test $gl_cv_func_gettimeofday_posix_signature = almost; then + gl_gettimeofday_timezone='struct timezone' + elif test $gl_cv_func_gettimeofday_posix_signature != yes; then + REPLACE_GETTIMEOFDAY=1 + fi + dnl If we override 'struct timeval', we also have to override gettimeofday. + if test $REPLACE_STRUCT_TIMEVAL = 1; then + REPLACE_GETTIMEOFDAY=1 + fi + dnl On mingw, the original gettimeofday has only a precision of 15.6 + dnl milliseconds. So override it. + case "$host_os" in + mingw*) REPLACE_GETTIMEOFDAY=1 ;; + esac + fi + AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone], + [Define this to 'void' or 'struct timezone' to match the system's + declaration of the second argument to gettimeofday.]) +]) + + +dnl See if gettimeofday clobbers the static buffer that localtime uses +dnl for its return value. The gettimeofday function from Mac OS X 10.0.4 +dnl (i.e., Darwin 1.3.7) has this problem. +dnl +dnl If it does, then arrange to use gettimeofday and localtime only via +dnl the wrapper functions that work around the problem. + +AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], +[ + AC_REQUIRE([gl_HEADER_SYS_TIME_H]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) + + AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer], + [gl_cv_func_gettimeofday_clobber], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <string.h> + #include <sys/time.h> + #include <time.h> + #include <stdlib.h> + ]], + [[ + time_t t = 0; + struct tm *lt; + struct tm saved_lt; + struct timeval tv; + lt = localtime (&t); + saved_lt = *lt; + gettimeofday (&tv, NULL); + return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0; + ]])], + [gl_cv_func_gettimeofday_clobber=no], + [gl_cv_func_gettimeofday_clobber=yes], + [# When cross-compiling: + case "$host_os" in + # Guess all is fine on glibc systems. + *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_gettimeofday_clobber="guessing yes" ;; + esac + ])]) + + case "$gl_cv_func_gettimeofday_clobber" in + *yes) + REPLACE_GETTIMEOFDAY=1 + AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1], + [Define if gettimeofday clobbers the localtime buffer.]) + gl_LOCALTIME_BUFFER_NEEDED + ;; + esac +]) + +# Prerequisites of lib/gettimeofday.c. +AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [:]) diff --git a/local/recipes/tools/diffutils/source/m4/glibc21.m4 b/local/recipes/tools/diffutils/source/m4/glibc21.m4 new file mode 100644 index 0000000000..2e30ed6884 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/glibc21.m4 @@ -0,0 +1,34 @@ +# glibc21.m4 serial 5 +dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2017 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Test for the GNU C Library, version 2.1 or newer, or uClibc. +# From Bruno Haible. + +AC_DEFUN([gl_GLIBC21], + [ + AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc], + [ac_cv_gnu_library_2_1], + [AC_EGREP_CPP([Lucky], + [ +#include <features.h> +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif +#ifdef __UCLIBC__ + Lucky user +#endif + ], + [ac_cv_gnu_library_2_1=yes], + [ac_cv_gnu_library_2_1=no]) + ] + ) + AC_SUBST([GLIBC21]) + GLIBC21="$ac_cv_gnu_library_2_1" + ] +) diff --git a/local/recipes/tools/diffutils/source/m4/gnu-make.m4 b/local/recipes/tools/diffutils/source/m4/gnu-make.m4 new file mode 100644 index 0000000000..55dbfd4d86 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/gnu-make.m4 @@ -0,0 +1,19 @@ +# Determine whether recent-enough GNU Make is being used. + +# Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Written by Paul Eggert. + +# Set GNU_MAKE if we are using a recent-enough version of GNU make. + +# Use --version AND trailing junk, because SGI Make doesn't fail on --version. + +AC_DEFUN([gl_GNU_MAKE], +[ + AM_CONDITIONAL([GNU_MAKE], + [${MAKE-make} --version /cannot/make/this >/dev/null 2>&1]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/gnulib-common.m4 b/local/recipes/tools/diffutils/source/m4/gnulib-common.m4 new file mode 100644 index 0000000000..36f2acc553 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/gnulib-common.m4 @@ -0,0 +1,467 @@ +# gnulib-common.m4 serial 38 +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# gl_COMMON +# is expanded unconditionally through gnulib-tool magic. +AC_DEFUN([gl_COMMON], [ + dnl Use AC_REQUIRE here, so that the code is expanded once only. + AC_REQUIRE([gl_00GNULIB]) + AC_REQUIRE([gl_COMMON_BODY]) +]) +AC_DEFUN([gl_COMMON_BODY], [ + AH_VERBATIM([_Noreturn], +[/* The _Noreturn keyword of C11. */ +#if ! (defined _Noreturn \ + || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) +# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ + || 0x5110 <= __SUNPRO_C) +# define _Noreturn __attribute__ ((__noreturn__)) +# elif defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn +# endif +#endif +]) + AH_VERBATIM([isoc99_inline], +[/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports + the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of + earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. + __APPLE__ && __MACH__ test for Mac OS X. + __APPLE_CC__ tests for the Apple compiler and its version. + __STDC_VERSION__ tests for the C99 mode. */ +#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ +# define __GNUC_STDC_INLINE__ 1 +#endif]) + AH_VERBATIM([unused_parameter], +[/* Define as a marker that can be attached to declarations that might not + be used. This helps to reduce warnings, such as from + GCC -Wunused-parameter. */ +#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _GL_UNUSED __attribute__ ((__unused__)) +#else +# define _GL_UNUSED +#endif +/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name + is a misnomer outside of parameter lists. */ +#define _UNUSED_PARAMETER_ _GL_UNUSED + +/* gcc supports the "unused" attribute on possibly unused labels, and + g++ has since version 4.5. Note to support C++ as well as C, + _GL_UNUSED_LABEL should be used with a trailing ; */ +#if !defined __cplusplus || __GNUC__ > 4 \ + || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# define _GL_UNUSED_LABEL _GL_UNUSED +#else +# define _GL_UNUSED_LABEL +#endif + +/* The __pure__ attribute was added in gcc 2.96. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE /* empty */ +#endif + +/* The __const__ attribute was added in gcc 2.95. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) +#else +# define _GL_ATTRIBUTE_CONST /* empty */ +#endif +]) + dnl Preparation for running test programs: + dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not + dnl to /dev/tty, so they can be redirected to log files. Such diagnostics + dnl arise e.g., in the macros gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N. + LIBC_FATAL_STDERR_=1 + export LIBC_FATAL_STDERR_ +]) + +# gl_MODULE_INDICATOR_CONDITION +# expands to a C preprocessor expression that evaluates to 1 or 0, depending +# whether a gnulib module that has been requested shall be considered present +# or not. +m4_define([gl_MODULE_INDICATOR_CONDITION], [1]) + +# gl_MODULE_INDICATOR_SET_VARIABLE([modulename]) +# sets the shell variable that indicates the presence of the given module to +# a C preprocessor expression that will evaluate to 1. +AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE], +[ + gl_MODULE_INDICATOR_SET_VARIABLE_AUX( + [GNULIB_[]m4_translit([[$1]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], + [gl_MODULE_INDICATOR_CONDITION]) +]) + +# gl_MODULE_INDICATOR_SET_VARIABLE_AUX([variable]) +# modifies the shell variable to include the gl_MODULE_INDICATOR_CONDITION. +# The shell variable's value is a C preprocessor expression that evaluates +# to 0 or 1. +AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX], +[ + m4_if(m4_defn([gl_MODULE_INDICATOR_CONDITION]), [1], + [ + dnl Simplify the expression VALUE || 1 to 1. + $1=1 + ], + [gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([$1], + [gl_MODULE_INDICATOR_CONDITION])]) +]) + +# gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([variable], [condition]) +# modifies the shell variable to include the given condition. The shell +# variable's value is a C preprocessor expression that evaluates to 0 or 1. +AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR], +[ + dnl Simplify the expression 1 || CONDITION to 1. + if test "$[]$1" != 1; then + dnl Simplify the expression 0 || CONDITION to CONDITION. + if test "$[]$1" = 0; then + $1=$2 + else + $1="($[]$1 || $2)" + fi + fi +]) + +# gl_MODULE_INDICATOR([modulename]) +# defines a C macro indicating the presence of the given module +# in a location where it can be used. +# | Value | Value | +# | in lib/ | in tests/ | +# --------------------------------------------+---------+-----------+ +# Module present among main modules: | 1 | 1 | +# --------------------------------------------+---------+-----------+ +# Module present among tests-related modules: | 0 | 1 | +# --------------------------------------------+---------+-----------+ +# Module not present at all: | 0 | 0 | +# --------------------------------------------+---------+-----------+ +AC_DEFUN([gl_MODULE_INDICATOR], +[ + AC_DEFINE_UNQUOTED([GNULIB_]m4_translit([[$1]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), + [gl_MODULE_INDICATOR_CONDITION], + [Define to a C preprocessor expression that evaluates to 1 or 0, + depending whether the gnulib module $1 shall be considered present.]) +]) + +# gl_MODULE_INDICATOR_FOR_TESTS([modulename]) +# defines a C macro indicating the presence of the given module +# in lib or tests. This is useful to determine whether the module +# should be tested. +# | Value | Value | +# | in lib/ | in tests/ | +# --------------------------------------------+---------+-----------+ +# Module present among main modules: | 1 | 1 | +# --------------------------------------------+---------+-----------+ +# Module present among tests-related modules: | 1 | 1 | +# --------------------------------------------+---------+-----------+ +# Module not present at all: | 0 | 0 | +# --------------------------------------------+---------+-----------+ +AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], +[ + AC_DEFINE([GNULIB_TEST_]m4_translit([[$1]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1], + [Define to 1 when the gnulib module $1 should be tested.]) +]) + +# gl_ASSERT_NO_GNULIB_POSIXCHECK +# asserts that there will never be a need to #define GNULIB_POSIXCHECK. +# and thereby enables an optimization of configure and config.h. +# Used by Emacs. +AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK], +[ + dnl Override gl_WARN_ON_USE_PREPARE. + dnl But hide this definition from 'aclocal'. + AC_DEFUN([gl_W][ARN_ON_USE_PREPARE], []) +]) + +# gl_ASSERT_NO_GNULIB_TESTS +# asserts that there will be no gnulib tests in the scope of the configure.ac +# and thereby enables an optimization of config.h. +# Used by Emacs. +AC_DEFUN([gl_ASSERT_NO_GNULIB_TESTS], +[ + dnl Override gl_MODULE_INDICATOR_FOR_TESTS. + AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], []) +]) + +# Test whether <features.h> exists. +# Set HAVE_FEATURES_H. +AC_DEFUN([gl_FEATURES_H], +[ + AC_CHECK_HEADERS_ONCE([features.h]) + if test $ac_cv_header_features_h = yes; then + HAVE_FEATURES_H=1 + else + HAVE_FEATURES_H=0 + fi + AC_SUBST([HAVE_FEATURES_H]) +]) + +# m4_foreach_w +# is a backport of autoconf-2.59c's m4_foreach_w. +# Remove this macro when we can assume autoconf >= 2.60. +m4_ifndef([m4_foreach_w], + [m4_define([m4_foreach_w], + [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])]) + +# AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH]) +# ---------------------------------------------------- +# Backport of autoconf-2.63b's macro. +# Remove this macro when we can assume autoconf >= 2.64. +m4_ifndef([AS_VAR_IF], +[m4_define([AS_VAR_IF], +[AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])]) + +# gl_PROG_CC_C99 +# Modifies the value of the shell variable CC in an attempt to make $CC +# understand ISO C99 source code. +# This is like AC_PROG_CC_C99, except that +# - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60, +# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC +# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00367.html>, +# but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99 +# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00441.html>. +# Remaining problems: +# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options +# to CC twice +# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00431.html>. +# - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard. +AC_DEFUN([gl_PROG_CC_C99], +[ + dnl Change that version number to the minimum Autoconf version that supports + dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls. + m4_version_prereq([9.0], + [AC_REQUIRE([AC_PROG_CC_C99])], + [AC_REQUIRE([AC_PROG_CC_STDC])]) +]) + +# gl_PROG_AR_RANLIB +# Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler. +# The user can set the variables AR, ARFLAGS, RANLIB if he wants to override +# the values. +AC_DEFUN([gl_PROG_AR_RANLIB], +[ + dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler + dnl as "cc", and GCC as "gcc". They have different object file formats and + dnl library formats. In particular, the GNU binutils programs ar and ranlib + dnl produce libraries that work only with gcc, not with cc. + AC_REQUIRE([AC_PROG_CC]) + dnl The '][' hides this use from 'aclocal'. + AC_BEFORE([$0], [A][M_PROG_AR]) + AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler], + [ + AC_EGREP_CPP([Amsterdam], + [ +#ifdef __ACK__ +Amsterdam +#endif + ], + [gl_cv_c_amsterdam_compiler=yes], + [gl_cv_c_amsterdam_compiler=no]) + ]) + + dnl Don't compete with AM_PROG_AR's decision about AR/ARFLAGS if we are not + dnl building with __ACK__. + if test $gl_cv_c_amsterdam_compiler = yes; then + if test -z "$AR"; then + AR='cc -c.a' + fi + if test -z "$ARFLAGS"; then + ARFLAGS='-o' + fi + else + dnl AM_PROG_AR was added in automake v1.11.2. AM_PROG_AR does not AC_SUBST + dnl ARFLAGS variable (it is filed into Makefile.in directly by automake + dnl script on-demand, if not specified by ./configure of course). + dnl Don't AC_REQUIRE the AM_PROG_AR otherwise the code for __ACK__ above + dnl will be ignored. Also, pay attention to call AM_PROG_AR in else block + dnl because AM_PROG_AR is written so it could re-set AR variable even for + dnl __ACK__. It may seem like its easier to avoid calling the macro here, + dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some good + dnl default value and automake should usually know them). + dnl + dnl The '][' hides this use from 'aclocal'. + m4_ifdef([A][M_PROG_AR], [A][M_PROG_AR], [:]) + fi + + dnl In case the code above has not helped with setting AR/ARFLAGS, use + dnl Automake-documented default values for AR and ARFLAGS, but prefer + dnl ${host}-ar over ar (useful for cross-compiling). + AC_CHECK_TOOL([AR], [ar], [ar]) + if test -z "$ARFLAGS"; then + ARFLAGS='cr' + fi + + AC_SUBST([AR]) + AC_SUBST([ARFLAGS]) + if test -z "$RANLIB"; then + if test $gl_cv_c_amsterdam_compiler = yes; then + RANLIB=':' + else + dnl Use the ranlib program if it is available. + AC_PROG_RANLIB + fi + fi + AC_SUBST([RANLIB]) +]) + +# AC_PROG_MKDIR_P +# is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix +# for interoperability with automake-1.9.6 from autoconf-2.62. +# Remove this macro when we can assume autoconf >= 2.62 or +# autoconf >= 2.60 && automake >= 1.10. +# AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness. +m4_ifndef([AC_AUTOCONF_VERSION],[ +m4_ifdef([AC_PROG_MKDIR_P], [ + dnl For automake-1.9.6 && autoconf < 2.62: Ensure MKDIR_P is AC_SUBSTed. + m4_define([AC_PROG_MKDIR_P], + m4_defn([AC_PROG_MKDIR_P])[ + AC_SUBST([MKDIR_P])])], [ + dnl For autoconf < 2.60: Backport of AC_PROG_MKDIR_P. + AC_DEFUN_ONCE([AC_PROG_MKDIR_P], + [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake + MKDIR_P='$(mkdir_p)' + AC_SUBST([MKDIR_P])])]) +]) + +# AC_C_RESTRICT +# This definition is copied from post-2.69 Autoconf and overrides the +# AC_C_RESTRICT macro from autoconf 2.60..2.69. It can be removed +# once autoconf >= 2.70 can be assumed. It's painful to check version +# numbers, and in practice this macro is more up-to-date than Autoconf +# is, so override Autoconf unconditionally. +AC_DEFUN([AC_C_RESTRICT], +[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict], + [ac_cv_c_restrict=no + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[typedef int *int_ptr; + int foo (int_ptr $ac_kw ip) { return ip[0]; } + int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ + int bar (int ip[$ac_kw]) { return ip[0]; } + ]], + [[int s[1]; + int *$ac_kw t = s; + t[0] = 0; + return foo (t) + bar (t); + ]])], + [ac_cv_c_restrict=$ac_kw]) + test "$ac_cv_c_restrict" != no && break + done + ]) + AH_VERBATIM([restrict], +[/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#undef restrict +/* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the + previous line. Perhaps some future version of Sun C++ will work with + restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +# define _Restrict +# define __restrict__ +#endif]) + case $ac_cv_c_restrict in + restrict) ;; + no) AC_DEFINE([restrict], []) ;; + *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;; + esac +])# AC_C_RESTRICT + +# gl_BIGENDIAN +# is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd. +# Note that AC_REQUIRE([AC_C_BIGENDIAN]) does not work reliably because some +# macros invoke AC_C_BIGENDIAN with arguments. +AC_DEFUN([gl_BIGENDIAN], +[ + AC_C_BIGENDIAN +]) + +# gl_CACHE_VAL_SILENT(cache-id, command-to-set-it) +# is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not +# output a spurious "(cached)" mark in the midst of other configure output. +# This macro should be used instead of AC_CACHE_VAL when it is not surrounded +# by an AC_MSG_CHECKING/AC_MSG_RESULT pair. +AC_DEFUN([gl_CACHE_VAL_SILENT], +[ + saved_as_echo_n="$as_echo_n" + as_echo_n=':' + AC_CACHE_VAL([$1], [$2]) + as_echo_n="$saved_as_echo_n" +]) + +# AS_VAR_COPY was added in autoconf 2.63b +m4_define_default([AS_VAR_COPY], +[AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])]) + +# AC_PROG_SED was added in autoconf 2.59b +m4_ifndef([AC_PROG_SED], +[AC_DEFUN([AC_PROG_SED], +[AC_CACHE_CHECK([for a sed that does not truncate output], ac_cv_path_SED, + [dnl ac_script should not contain more than 99 commands (for HP-UX sed), + dnl but more than about 7000 bytes, to catch a limit in Solaris 8 /usr/ucb/sed. + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + AS_UNSET([ac_script]) + if test -z "$SED"; then + ac_path_SED_found=false + _AS_PATH_WALK([], [ + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + AS_EXECUTABLE_P(["$ac_path_SED"]) || continue + case `"$ac_path_SED" --version 2>&1` in + *GNU*) ac_cv_path_SED=$ac_path_SED ac_path_SED_found=:;; + *) + ac_count=0 + _AS_ECHO_N([0123456789]) >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >> conftest.nl + "$ac_path_SED" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best so far, but keep looking for better + ac_cv_path_SED=$ac_path_SED + ac_path_SED_max=$ac_count + fi + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; + esac + $ac_path_SED_found && break 3 + done + done]) + if test -z "$ac_cv_path_SED"; then + AC_ERROR([no acceptable sed could be found in \$PATH]) + fi + else + ac_cv_path_SED=$SED + fi + ]) + SED="$ac_cv_path_SED" + AC_SUBST([SED])dnl + rm -f conftest.sed +]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/gnulib-comp.m4 b/local/recipes/tools/diffutils/source/m4/gnulib-comp.m4 new file mode 100644 index 0000000000..77adaf84fd --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/gnulib-comp.m4 @@ -0,0 +1,2034 @@ +# DO NOT EDIT! GENERATED AUTOMATICALLY! +# Copyright (C) 2002-2017 Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this file. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception to the GNU General Public License, +# this file may be distributed as part of a program that +# contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# Generated by gnulib-tool. +# +# This file represents the compiled summary of the specification in +# gnulib-cache.m4. It lists the computed macro invocations that need +# to be invoked from configure.ac. +# In projects that use version control, this file can be treated like +# other built files. + + +# This macro should be invoked from ./configure.ac, in the section +# "Checks for programs", right after AC_PROG_CC, and certainly before +# any checks for libraries, header files, types and library functions. +AC_DEFUN([gl_EARLY], +[ + m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace + m4_pattern_allow([^gl_ES$])dnl a valid locale name + m4_pattern_allow([^gl_LIBOBJS$])dnl a variable + m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable + + # Pre-early section. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([gl_PROG_AR_RANLIB]) + + AC_REQUIRE([AM_PROG_CC_C_O]) + # Code from module absolute-header: + # Code from module accept: + # Code from module accept-tests: + # Code from module alloca: + # Code from module alloca-opt: + # Code from module alloca-opt-tests: + # Code from module allocator: + # Code from module announce-gen: + # Code from module areadlink: + # Code from module areadlink-tests: + # Code from module argmatch: + # Code from module argmatch-tests: + # Code from module arpa_inet: + # Code from module arpa_inet-tests: + # Code from module assure: + # Code from module binary-io: + # Code from module binary-io-tests: + # Code from module bind: + # Code from module bind-tests: + # Code from module bitrotate: + # Code from module bitrotate-tests: + # Code from module btowc: + # Code from module btowc-tests: + # Code from module builtin-expect: + # Code from module c-ctype: + # Code from module c-ctype-tests: + # Code from module c-stack: + # Code from module c-stack-tests: + # Code from module c-strcase: + # Code from module c-strcase-tests: + # Code from module c-strcaseeq: + # Code from module careadlinkat: + # Code from module clock-time: + # Code from module close: + # Code from module close-tests: + # Code from module config-h: + # Code from module configmake: + # Code from module connect: + # Code from module connect-tests: + # Code from module ctype: + # Code from module ctype-tests: + # Code from module diffseq: + # Code from module dirname: + # Code from module dirname-lgpl: + # Code from module dirname-tests: + # Code from module do-release-commit-and-tag: + # Code from module dosname: + # Code from module double-slash-root: + # Code from module dtotimespec: + # Code from module dup2: + # Code from module dup2-tests: + # Code from module environ: + # Code from module environ-tests: + # Code from module errno: + # Code from module errno-tests: + # Code from module error: + # Code from module exclude: + # Code from module exclude-tests: + # Code from module exitfail: + # Code from module extensions: + # Code from module extern-inline: + # Code from module fcntl: + # Code from module fcntl-h: + # Code from module fcntl-h-tests: + # Code from module fcntl-tests: + # Code from module fd-hook: + # Code from module fdl: + # Code from module fdopen: + # Code from module fdopen-tests: + # Code from module fgetc-tests: + # Code from module file-type: + # Code from module filename: + # Code from module filenamecat: + # Code from module filenamecat-lgpl: + # Code from module filenamecat-tests: + # Code from module flexmember: + # Code from module float: + # Code from module float-tests: + # Code from module fnmatch: + # Code from module fnmatch-gnu: + # Code from module fnmatch-tests: + # Code from module fpieee: + AC_REQUIRE([gl_FP_IEEE]) + # Code from module fpucw: + # Code from module fputc-tests: + # Code from module fread-tests: + # Code from module freopen: + # Code from module freopen-safer: + # Code from module freopen-safer-tests: + # Code from module freopen-tests: + # Code from module fstat: + # Code from module fstat-tests: + # Code from module ftruncate: + # Code from module ftruncate-tests: + # Code from module fwrite-tests: + # Code from module gendocs: + # Code from module getcwd-lgpl: + # Code from module getcwd-lgpl-tests: + # Code from module getdtablesize: + # Code from module getdtablesize-tests: + # Code from module getopt: + # Code from module getopt-gnu: + # Code from module getopt-gnu-tests: + # Code from module getopt-posix: + # Code from module getopt-posix-tests: + # Code from module getpagesize: + # Code from module getprogname: + # Code from module getprogname-tests: + # Code from module gettext-h: + # Code from module gettime: + # Code from module gettimeofday: + # Code from module gettimeofday-tests: + # Code from module git-version-gen: + # Code from module gitlog-to-changelog: + # Code from module gnu-make: + # Code from module gnu-web-doc-update: + # Code from module gnumakefile: + # Code from module gnupload: + # Code from module gperf: + # Code from module hard-locale: + # Code from module hash: + # Code from module hash-pjw: + # Code from module hash-tests: + # Code from module havelib: + # Code from module iconv: + # Code from module iconv-h: + # Code from module iconv-h-tests: + # Code from module iconv-tests: + # Code from module iconv_open: + # Code from module ignore-value: + # Code from module ignore-value-tests: + # Code from module include_next: + # Code from module inet_pton: + # Code from module inet_pton-tests: + # Code from module inline: + # Code from module intprops: + # Code from module intprops-tests: + # Code from module inttostr: + # Code from module inttostr-tests: + # Code from module inttypes: + # Code from module inttypes-incomplete: + # Code from module inttypes-tests: + # Code from module ioctl: + # Code from module ioctl-tests: + # Code from module isblank: + # Code from module isblank-tests: + # Code from module iswblank: + # Code from module iswblank-tests: + # Code from module langinfo: + # Code from module langinfo-tests: + # Code from module largefile: + AC_REQUIRE([AC_SYS_LARGEFILE]) + # Code from module libsigsegv: + # Code from module limits-h: + # Code from module limits-h-tests: + # Code from module listen: + # Code from module listen-tests: + # Code from module localcharset: + # Code from module locale: + # Code from module locale-tests: + # Code from module localeconv: + # Code from module localeconv-tests: + # Code from module localtime-buffer: + # Code from module lstat: + # Code from module lstat-tests: + # Code from module maintainer-makefile: + # Code from module malloc-posix: + # Code from module malloca: + # Code from module malloca-tests: + # Code from module manywarnings: + # Code from module mbchar: + # Code from module mbiter: + # Code from module mbrtowc: + # Code from module mbrtowc-tests: + # Code from module mbscasecmp: + # Code from module mbscasecmp-tests: + # Code from module mbsinit: + # Code from module mbsinit-tests: + # Code from module mbslen: + # Code from module mbsrtowcs: + # Code from module mbsrtowcs-tests: + # Code from module mbsstr: + # Code from module mbsstr-tests: + # Code from module mbtowc: + # Code from module mbuiter: + # Code from module memchr: + # Code from module memchr-tests: + # Code from module minmax: + # Code from module mkstemp: + # Code from module mktime: + # Code from module mktime-internal: + # Code from module msvc-inval: + # Code from module msvc-nothrow: + # Code from module multiarch: + # Code from module nanosleep: + # Code from module nanosleep-tests: + # Code from module netinet_in: + # Code from module netinet_in-tests: + # Code from module nl_langinfo: + # Code from module nl_langinfo-tests: + # Code from module nocrash: + # Code from module open: + # Code from module open-tests: + # Code from module pathmax: + # Code from module pathmax-tests: + # Code from module perror: + # Code from module perror-tests: + # Code from module pipe-posix: + # Code from module pipe-posix-tests: + # Code from module progname: + # Code from module propername: + # Code from module putenv: + # Code from module quote: + # Code from module quotearg: + # Code from module quotearg-simple: + # Code from module quotearg-simple-tests: + # Code from module raise: + # Code from module raise-tests: + # Code from module rawmemchr: + # Code from module rawmemchr-tests: + # Code from module readlink: + # Code from module readlink-tests: + # Code from module readme-release: + # Code from module regex: + # Code from module regex-tests: + # Code from module same-inode: + # Code from module secure_getenv: + # Code from module select: + # Code from module select-tests: + # Code from module setenv: + # Code from module setenv-tests: + # Code from module setlocale: + # Code from module setlocale-tests: + # Code from module setsockopt: + # Code from module setsockopt-tests: + # Code from module sh-quote: + # Code from module sh-quote-tests: + # Code from module sigaction: + # Code from module sigaction-tests: + # Code from module signal: + # Code from module signal-h: + # Code from module signal-h-tests: + # Code from module sigprocmask: + # Code from module sigprocmask-tests: + # Code from module size_max: + # Code from module sleep: + # Code from module sleep-tests: + # Code from module snippet/_Noreturn: + # Code from module snippet/arg-nonnull: + # Code from module snippet/c++defs: + # Code from module snippet/unused-parameter: + # Code from module snippet/warn-on-use: + # Code from module snprintf: + # Code from module snprintf-tests: + # Code from module socket: + # Code from module socketlib: + # Code from module sockets: + # Code from module sockets-tests: + # Code from module socklen: + # Code from module ssize_t: + # Code from module stat: + # Code from module stat-macros: + # Code from module stat-tests: + # Code from module stat-time: + # Code from module stat-time-tests: + # Code from module stdalign: + # Code from module stdalign-tests: + # Code from module stdarg: + dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode + dnl for the builtin va_copy to work. With Autoconf 2.60 or later, + dnl gl_PROG_CC_C99 arranges for this. With older Autoconf gl_PROG_CC_C99 + dnl shouldn't hurt, though installers are on their own to set c99 mode. + gl_PROG_CC_C99 + # Code from module stdbool: + # Code from module stdbool-tests: + # Code from module stddef: + # Code from module stddef-tests: + # Code from module stdint: + # Code from module stdint-tests: + # Code from module stdio: + # Code from module stdio-tests: + # Code from module stdlib: + # Code from module stdlib-tests: + # Code from module strcase: + # Code from module streq: + # Code from module strerror: + # Code from module strerror-override: + # Code from module strerror-tests: + # Code from module strerror_r-posix: + # Code from module strerror_r-posix-tests: + # Code from module strftime: + # Code from module strftime-tests: + # Code from module striconv: + # Code from module striconv-tests: + # Code from module string: + # Code from module string-tests: + # Code from module strings: + # Code from module strings-tests: + # Code from module strndup: + # Code from module strnlen: + # Code from module strnlen-tests: + # Code from module strnlen1: + # Code from module strptime: + # Code from module strtoull: + # Code from module strtoull-tests: + # Code from module strtoumax: + # Code from module strtoumax-tests: + # Code from module symlink: + # Code from module symlink-tests: + # Code from module sys_ioctl: + # Code from module sys_ioctl-tests: + # Code from module sys_select: + # Code from module sys_select-tests: + # Code from module sys_socket: + # Code from module sys_socket-tests: + # Code from module sys_stat: + # Code from module sys_stat-tests: + # Code from module sys_time: + # Code from module sys_time-tests: + # Code from module sys_types: + # Code from module sys_types-tests: + # Code from module sys_uio: + # Code from module sys_uio-tests: + # Code from module sys_wait: + # Code from module sys_wait-tests: + # Code from module system-quote: + # Code from module tempname: + # Code from module test-framework-sh: + # Code from module test-framework-sh-tests: + # Code from module time: + # Code from module time-tests: + # Code from module time_r: + # Code from module time_rz: + # Code from module timegm: + # Code from module timespec: + # Code from module timespec-add: + # Code from module timespec-sub: + # Code from module timespec-tests: + # Code from module trim: + # Code from module tzset: + # Code from module unistd: + # Code from module unistd-tests: + # Code from module unistr/base: + # Code from module unistr/u8-mbtoucr: + # Code from module unistr/u8-mbtoucr-tests: + # Code from module unistr/u8-uctomb: + # Code from module unistr/u8-uctomb-tests: + # Code from module unitypes: + # Code from module uniwidth/base: + # Code from module uniwidth/width: + # Code from module uniwidth/width-tests: + # Code from module unlocked-io: + # Code from module unsetenv: + # Code from module unsetenv-tests: + # Code from module update-copyright: + # Code from module update-copyright-tests: + # Code from module useless-if-before-free: + # Code from module vararrays: + # Code from module vasnprintf: + # Code from module vasnprintf-tests: + # Code from module vasprintf: + # Code from module vasprintf-tests: + # Code from module vc-list-files: + # Code from module vc-list-files-tests: + # Code from module verify: + # Code from module verify-tests: + # Code from module version-etc: + # Code from module version-etc-fsf: + # Code from module version-etc-tests: + # Code from module warnings: + # Code from module wchar: + # Code from module wchar-tests: + # Code from module wcrtomb: + # Code from module wcrtomb-tests: + # Code from module wctob: + # Code from module wctomb: + # Code from module wctype-h: + # Code from module wctype-h-tests: + # Code from module wcwidth: + # Code from module wcwidth-tests: + # Code from module xalloc: + # Code from module xalloc-die: + # Code from module xalloc-die-tests: + # Code from module xalloc-oversized: + # Code from module xfreopen: + # Code from module xreadlink: + # Code from module xsize: + # Code from module xstriconv: + # Code from module xstrndup: + # Code from module xstrtol: + # Code from module xstrtol-tests: + # Code from module xstrtoumax: + # Code from module xstrtoumax-tests: + # Code from module xvasprintf: + # Code from module xvasprintf-tests: +]) + +# This macro should be invoked from ./configure.ac, in the section +# "Check for header files, types and library functions". +AC_DEFUN([gl_INIT], +[ + AM_CONDITIONAL([GL_COND_LIBTOOL], [false]) + gl_cond_libtool=false + gl_libdeps= + gl_ltlibdeps= + gl_m4_base='m4' + m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ])) + m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS])) + m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES])) + m4_pushdef([gl_LIBSOURCES_LIST], []) + m4_pushdef([gl_LIBSOURCES_DIR], []) + gl_COMMON + gl_source_base='lib' + gl_FUNC_ALLOCA + gl_FUNC_BTOWC + if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then + AC_LIBOBJ([btowc]) + gl_PREREQ_BTOWC + fi + gl_WCHAR_MODULE_INDICATOR([btowc]) + gl___BUILTIN_EXPECT + gl_C_STACK + AC_CHECK_FUNCS_ONCE([readlinkat]) + gl_CLOCK_TIME + gl_FUNC_CLOSE + if test $REPLACE_CLOSE = 1; then + AC_LIBOBJ([close]) + fi + gl_UNISTD_MODULE_INDICATOR([close]) + gl_CONFIG_H + gl_CONFIGMAKE_PREP + gl_CTYPE_H + gl_DIRNAME + gl_MODULE_INDICATOR([dirname]) + gl_DIRNAME_LGPL + gl_DOUBLE_SLASH_ROOT + gl_FUNC_DUP2 + if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then + AC_LIBOBJ([dup2]) + gl_PREREQ_DUP2 + fi + gl_UNISTD_MODULE_INDICATOR([dup2]) + gl_ENVIRON + gl_UNISTD_MODULE_INDICATOR([environ]) + gl_HEADER_ERRNO_H + gl_ERROR + if test $ac_cv_lib_error_at_line = no; then + AC_LIBOBJ([error]) + gl_PREREQ_ERROR + fi + m4_ifdef([AM_XGETTEXT_OPTION], + [AM_][XGETTEXT_OPTION([--flag=error:3:c-format]) + AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])]) + AC_REQUIRE([gl_EXTERN_INLINE]) + gl_FUNC_FCNTL + if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then + AC_LIBOBJ([fcntl]) + fi + gl_FCNTL_MODULE_INDICATOR([fcntl]) + gl_FCNTL_H + gl_FILE_NAME_CONCAT + gl_MODULE_INDICATOR([filenamecat]) + gl_FILE_NAME_CONCAT_LGPL + AC_C_FLEXIBLE_ARRAY_MEMBER + gl_FLOAT_H + if test $REPLACE_FLOAT_LDBL = 1; then + AC_LIBOBJ([float]) + fi + if test $REPLACE_ITOLD = 1; then + AC_LIBOBJ([itold]) + fi + gl_FUNC_FNMATCH_POSIX + if test -n "$FNMATCH_H"; then + AC_LIBOBJ([fnmatch]) + gl_PREREQ_FNMATCH + fi + gl_FUNC_FNMATCH_GNU + if test -n "$FNMATCH_H"; then + AC_LIBOBJ([fnmatch]) + gl_PREREQ_FNMATCH + fi + gl_FUNC_FREOPEN + if test $REPLACE_FREOPEN = 1; then + AC_LIBOBJ([freopen]) + gl_PREREQ_FREOPEN + fi + gl_STDIO_MODULE_INDICATOR([freopen]) + gl_MODULE_INDICATOR([freopen-safer]) + gl_FUNC_FSTAT + if test $REPLACE_FSTAT = 1; then + AC_LIBOBJ([fstat]) + AC_LIBOBJ([stat-w32]) + gl_PREREQ_FSTAT + fi + gl_SYS_STAT_MODULE_INDICATOR([fstat]) + gl_FUNC_GETDTABLESIZE + if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then + AC_LIBOBJ([getdtablesize]) + gl_PREREQ_GETDTABLESIZE + fi + gl_UNISTD_MODULE_INDICATOR([getdtablesize]) + gl_FUNC_GETOPT_GNU + dnl Because of the way gl_FUNC_GETOPT_GNU is implemented (the gl_getopt_required + dnl mechanism), there is no need to do any AC_LIBOBJ or AC_SUBST here; they are + dnl done in the getopt-posix module. + gl_FUNC_GETOPT_POSIX + if test $REPLACE_GETOPT = 1; then + AC_LIBOBJ([getopt]) + AC_LIBOBJ([getopt1]) + dnl Arrange for unistd.h to include getopt.h. + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) + gl_FUNC_GETPROGNAME + AC_SUBST([LIBINTL]) + AC_SUBST([LTLIBINTL]) + gl_GETTIME + gl_FUNC_GETTIMEOFDAY + if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then + AC_LIBOBJ([gettimeofday]) + gl_PREREQ_GETTIMEOFDAY + fi + gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) + gl_GNU_MAKE + # Autoconf 2.61a.99 and earlier don't support linking a file only + # in VPATH builds. But since GNUmakefile is for maintainer use + # only, it does not matter if we skip the link with older autoconf. + # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH + # builds, so use a shell variable to bypass this. + GNUmakefile=GNUmakefile + m4_if(m4_version_compare([2.61a.100], + m4_defn([m4_PACKAGE_VERSION])), [1], [], + [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], + [GNUmakefile=$GNUmakefile])]) + gl_HARD_LOCALE + AM_ICONV + m4_ifdef([gl_ICONV_MODULE_INDICATOR], + [gl_ICONV_MODULE_INDICATOR([iconv])]) + gl_ICONV_H + gl_FUNC_ICONV_OPEN + if test $REPLACE_ICONV_OPEN = 1; then + AC_LIBOBJ([iconv_open]) + fi + if test $REPLACE_ICONV = 1; then + AC_LIBOBJ([iconv]) + AC_LIBOBJ([iconv_close]) + fi + gl_INLINE + gl_INTTOSTR + gl_INTTYPES_H + gl_INTTYPES_INCOMPLETE + gl_FUNC_ISBLANK + if test $HAVE_ISBLANK = 0; then + AC_LIBOBJ([isblank]) + fi + gl_CTYPE_MODULE_INDICATOR([isblank]) + gl_FUNC_ISWBLANK + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + AC_LIBOBJ([iswblank]) + fi + fi + gl_WCTYPE_MODULE_INDICATOR([iswblank]) + gl_LANGINFO_H + AC_REQUIRE([gl_LARGEFILE]) + gl_LIBSIGSEGV + gl_LIMITS_H + gl_LOCALCHARSET + LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" + AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT]) + gl_LOCALE_H + gl_FUNC_LOCALECONV + if test $REPLACE_LOCALECONV = 1; then + AC_LIBOBJ([localeconv]) + gl_PREREQ_LOCALECONV + fi + gl_LOCALE_MODULE_INDICATOR([localeconv]) + AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) + AC_LIBOBJ([localtime-buffer]) + gl_FUNC_LSTAT + if test $REPLACE_LSTAT = 1; then + AC_LIBOBJ([lstat]) + gl_PREREQ_LSTAT + fi + gl_SYS_STAT_MODULE_INDICATOR([lstat]) + AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER], + [AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])]) + AC_REQUIRE([AC_PROG_SED]) + gl_FUNC_MALLOC_POSIX + if test $REPLACE_MALLOC = 1; then + AC_LIBOBJ([malloc]) + fi + gl_STDLIB_MODULE_INDICATOR([malloc-posix]) + gl_MALLOCA + gl_MBCHAR + gl_MBITER + gl_FUNC_MBRTOWC + if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then + AC_LIBOBJ([mbrtowc]) + gl_PREREQ_MBRTOWC + fi + gl_WCHAR_MODULE_INDICATOR([mbrtowc]) + gl_STRING_MODULE_INDICATOR([mbscasecmp]) + gl_FUNC_MBSINIT + if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then + AC_LIBOBJ([mbsinit]) + gl_PREREQ_MBSINIT + fi + gl_WCHAR_MODULE_INDICATOR([mbsinit]) + gl_FUNC_MBSLEN + gl_STRING_MODULE_INDICATOR([mbslen]) + gl_FUNC_MBSRTOWCS + if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then + AC_LIBOBJ([mbsrtowcs]) + AC_LIBOBJ([mbsrtowcs-state]) + gl_PREREQ_MBSRTOWCS + fi + gl_WCHAR_MODULE_INDICATOR([mbsrtowcs]) + gl_STRING_MODULE_INDICATOR([mbsstr]) + gl_FUNC_MBTOWC + if test $REPLACE_MBTOWC = 1; then + AC_LIBOBJ([mbtowc]) + gl_PREREQ_MBTOWC + fi + gl_STDLIB_MODULE_INDICATOR([mbtowc]) + gl_MBITER + gl_FUNC_MEMCHR + if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + AC_LIBOBJ([memchr]) + gl_PREREQ_MEMCHR + fi + gl_STRING_MODULE_INDICATOR([memchr]) + gl_MINMAX + gl_FUNC_MKSTEMP + if test $HAVE_MKSTEMP = 0 || test $REPLACE_MKSTEMP = 1; then + AC_LIBOBJ([mkstemp]) + gl_PREREQ_MKSTEMP + fi + gl_STDLIB_MODULE_INDICATOR([mkstemp]) + gl_FUNC_MKTIME + if test $REPLACE_MKTIME = 1; then + AC_LIBOBJ([mktime]) + gl_PREREQ_MKTIME + fi + gl_TIME_MODULE_INDICATOR([mktime]) + gl_FUNC_MKTIME_INTERNAL + if test $WANT_MKTIME_INTERNAL = 1; then + AC_LIBOBJ([mktime]) + gl_PREREQ_MKTIME + fi + AC_REQUIRE([gl_MSVC_INVAL]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + AC_LIBOBJ([msvc-inval]) + fi + AC_REQUIRE([gl_MSVC_NOTHROW]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + AC_LIBOBJ([msvc-nothrow]) + fi + gl_MODULE_INDICATOR([msvc-nothrow]) + gl_MULTIARCH + gl_FUNC_NL_LANGINFO + if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then + AC_LIBOBJ([nl_langinfo]) + fi + gl_LANGINFO_MODULE_INDICATOR([nl_langinfo]) + gl_FUNC_OPEN + if test $REPLACE_OPEN = 1; then + AC_LIBOBJ([open]) + gl_PREREQ_OPEN + fi + gl_FCNTL_MODULE_INDICATOR([open]) + gl_PATHMAX + AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>]) + AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>]) + m4_ifdef([AM_XGETTEXT_OPTION], + [AM_][XGETTEXT_OPTION([--keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"']) + AM_][XGETTEXT_OPTION([--keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"'])]) + gl_QUOTE + gl_QUOTEARG + gl_FUNC_RAISE + if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then + AC_LIBOBJ([raise]) + gl_PREREQ_RAISE + fi + gl_SIGNAL_MODULE_INDICATOR([raise]) + gl_FUNC_RAWMEMCHR + if test $HAVE_RAWMEMCHR = 0; then + AC_LIBOBJ([rawmemchr]) + gl_PREREQ_RAWMEMCHR + fi + gl_STRING_MODULE_INDICATOR([rawmemchr]) + gl_FUNC_READLINK + if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then + AC_LIBOBJ([readlink]) + gl_PREREQ_READLINK + fi + gl_UNISTD_MODULE_INDICATOR([readlink]) + gl_REGEX + if test $ac_use_included_regex = yes; then + AC_LIBOBJ([regex]) + gl_PREREQ_REGEX + fi + gl_FUNC_SECURE_GETENV + if test $HAVE_SECURE_GETENV = 0; then + AC_LIBOBJ([secure_getenv]) + gl_PREREQ_SECURE_GETENV + fi + gl_STDLIB_MODULE_INDICATOR([secure_getenv]) + gl_FUNC_SETENV + if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then + AC_LIBOBJ([setenv]) + fi + gl_STDLIB_MODULE_INDICATOR([setenv]) + gl_SIGACTION + if test $HAVE_SIGACTION = 0; then + AC_LIBOBJ([sigaction]) + gl_PREREQ_SIGACTION + fi + gl_SIGNAL_MODULE_INDICATOR([sigaction]) + gl_SIGNAL_H + gl_SIGNALBLOCKING + if test $HAVE_POSIX_SIGNALBLOCKING = 0; then + AC_LIBOBJ([sigprocmask]) + gl_PREREQ_SIGPROCMASK + fi + gl_SIGNAL_MODULE_INDICATOR([sigprocmask]) + gl_SIZE_MAX + gt_TYPE_SSIZE_T + gl_FUNC_STAT + if test $REPLACE_STAT = 1; then + AC_LIBOBJ([stat]) + AC_LIBOBJ([stat-w32]) + gl_PREREQ_STAT + fi + gl_SYS_STAT_MODULE_INDICATOR([stat]) + gl_STAT_TIME + gl_STAT_BIRTHTIME + gl_STDARG_H + AM_STDBOOL_H + gl_STDDEF_H + gl_STDINT_H + gl_STDIO_H + gl_STDLIB_H + gl_STRCASE + if test $HAVE_STRCASECMP = 0; then + AC_LIBOBJ([strcasecmp]) + gl_PREREQ_STRCASECMP + fi + if test $HAVE_STRNCASECMP = 0; then + AC_LIBOBJ([strncasecmp]) + gl_PREREQ_STRNCASECMP + fi + gl_FUNC_STRERROR + if test $REPLACE_STRERROR = 1; then + AC_LIBOBJ([strerror]) + fi + gl_MODULE_INDICATOR([strerror]) + gl_STRING_MODULE_INDICATOR([strerror]) + AC_REQUIRE([gl_HEADER_ERRNO_H]) + AC_REQUIRE([gl_FUNC_STRERROR_0]) + if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then + AC_LIBOBJ([strerror-override]) + gl_PREREQ_SYS_H_WINSOCK2 + fi + gl_FUNC_GNU_STRFTIME + if test $gl_cond_libtool = false; then + gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV" + gl_libdeps="$gl_libdeps $LIBICONV" + fi + gl_HEADER_STRING_H + gl_HEADER_STRINGS_H + gl_FUNC_STRNDUP + if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then + AC_LIBOBJ([strndup]) + fi + gl_STRING_MODULE_INDICATOR([strndup]) + gl_FUNC_STRNLEN + if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then + AC_LIBOBJ([strnlen]) + gl_PREREQ_STRNLEN + fi + gl_STRING_MODULE_INDICATOR([strnlen]) + gl_FUNC_STRPTIME + if test $HAVE_STRPTIME = 0; then + AC_LIBOBJ([strptime]) + gl_PREREQ_STRPTIME + fi + gl_TIME_MODULE_INDICATOR([strptime]) + gl_FUNC_STRTOULL + if test $HAVE_STRTOULL = 0; then + AC_LIBOBJ([strtoull]) + gl_PREREQ_STRTOULL + fi + gl_STDLIB_MODULE_INDICATOR([strtoull]) + gl_FUNC_STRTOUMAX + if test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; then + AC_LIBOBJ([strtoumax]) + gl_PREREQ_STRTOUMAX + fi + gl_INTTYPES_MODULE_INDICATOR([strtoumax]) + gl_HEADER_SYS_STAT_H + AC_PROG_MKDIR_P + gl_HEADER_SYS_TIME_H + AC_PROG_MKDIR_P + gl_SYS_TYPES_H + AC_PROG_MKDIR_P + gl_SYS_WAIT_H + AC_PROG_MKDIR_P + gl_FUNC_GEN_TEMPNAME + gl_HEADER_TIME_H + gl_TIME_R + if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then + AC_LIBOBJ([time_r]) + gl_PREREQ_TIME_R + fi + gl_TIME_MODULE_INDICATOR([time_r]) + gl_TIME_RZ + if test $HAVE_TIMEZONE_T = 0; then + AC_LIBOBJ([time_rz]) + fi + gl_TIME_MODULE_INDICATOR([time_rz]) + gl_FUNC_TIMEGM + if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then + AC_LIBOBJ([timegm]) + gl_PREREQ_TIMEGM + fi + gl_TIME_MODULE_INDICATOR([timegm]) + gl_TIMESPEC + gl_FUNC_TZSET + if test $HAVE_TZSET = 0 || test $REPLACE_TZSET = 1; then + AC_LIBOBJ([tzset]) + fi + gl_TIME_MODULE_INDICATOR([tzset]) + gl_UNISTD_H + gl_LIBUNISTRING_LIBHEADER([0.9.4], [unistr.h]) + gl_MODULE_INDICATOR([unistr/u8-mbtoucr]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-mbtoucr]) + gl_MODULE_INDICATOR([unistr/u8-uctomb]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-uctomb]) + gl_LIBUNISTRING_LIBHEADER([0.9.4], [unitypes.h]) + gl_LIBUNISTRING_LIBHEADER([0.9.4], [uniwidth.h]) + gl_LIBUNISTRING_MODULE([0.9.6], [uniwidth/width]) + gl_FUNC_GLIBC_UNLOCKED_IO + gl_FUNC_UNSETENV + if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then + AC_LIBOBJ([unsetenv]) + gl_PREREQ_UNSETENV + fi + gl_STDLIB_MODULE_INDICATOR([unsetenv]) + AC_C_VARARRAYS + gl_FUNC_VASNPRINTF + gl_FUNC_VASPRINTF + gl_STDIO_MODULE_INDICATOR([vasprintf]) + m4_ifdef([AM_XGETTEXT_OPTION], + [AM_][XGETTEXT_OPTION([--flag=asprintf:2:c-format]) + AM_][XGETTEXT_OPTION([--flag=vasprintf:2:c-format])]) + gl_VERSION_ETC + gl_WCHAR_H + gl_FUNC_WCRTOMB + if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then + AC_LIBOBJ([wcrtomb]) + gl_PREREQ_WCRTOMB + fi + gl_WCHAR_MODULE_INDICATOR([wcrtomb]) + gl_WCTYPE_H + gl_FUNC_WCWIDTH + if test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1; then + AC_LIBOBJ([wcwidth]) + fi + gl_WCHAR_MODULE_INDICATOR([wcwidth]) + gl_XALLOC + gl_XSIZE + gl_XSTRNDUP + gl_XSTRTOL + gl_XVASPRINTF + m4_ifdef([AM_XGETTEXT_OPTION], + [AM_][XGETTEXT_OPTION([--flag=xasprintf:1:c-format])]) + # End of code from modules + m4_ifval(gl_LIBSOURCES_LIST, [ + m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ || + for gl_file in ]gl_LIBSOURCES_LIST[ ; do + if test ! -r ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file ; then + echo "missing file ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file" >&2 + exit 1 + fi + done])dnl + m4_if(m4_sysval, [0], [], + [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])]) + ]) + m4_popdef([gl_LIBSOURCES_DIR]) + m4_popdef([gl_LIBSOURCES_LIST]) + m4_popdef([AC_LIBSOURCES]) + m4_popdef([AC_REPLACE_FUNCS]) + m4_popdef([AC_LIBOBJ]) + AC_CONFIG_COMMANDS_PRE([ + gl_libobjs= + gl_ltlibobjs= + if test -n "$gl_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do + gl_libobjs="$gl_libobjs $i.$ac_objext" + gl_ltlibobjs="$gl_ltlibobjs $i.lo" + done + fi + AC_SUBST([gl_LIBOBJS], [$gl_libobjs]) + AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs]) + ]) + gltests_libdeps= + gltests_ltlibdeps= + m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ])) + m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS])) + m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES])) + m4_pushdef([gltests_LIBSOURCES_LIST], []) + m4_pushdef([gltests_LIBSOURCES_DIR], []) + gl_COMMON + gl_source_base='gnulib-tests' +changequote(,)dnl + gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS +changequote([, ])dnl + AC_SUBST([gltests_WITNESS]) + gl_module_indicator_condition=$gltests_WITNESS + m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([accept]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([accept]) + gl_HEADER_ARPA_INET + AC_PROG_MKDIR_P + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([bind]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([bind]) + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 + gt_LOCALE_FR + gt_LOCALE_TR_UTF8 + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([connect]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([connect]) + gl_FUNC_FDOPEN + if test $REPLACE_FDOPEN = 1; then + AC_LIBOBJ([fdopen]) + gl_PREREQ_FDOPEN + fi + gl_STDIO_MODULE_INDICATOR([fdopen]) + gl_FUNC_FTRUNCATE + if test $HAVE_FTRUNCATE = 0 || test $REPLACE_FTRUNCATE = 1; then + AC_LIBOBJ([ftruncate]) + gl_PREREQ_FTRUNCATE + fi + gl_UNISTD_MODULE_INDICATOR([ftruncate]) + gl_FUNC_GETCWD_LGPL + if test $REPLACE_GETCWD = 1; then + AC_LIBOBJ([getcwd-lgpl]) + fi + gl_UNISTD_MODULE_INDICATOR([getcwd]) + gl_FUNC_GETPAGESIZE + if test $REPLACE_GETPAGESIZE = 1; then + AC_LIBOBJ([getpagesize]) + fi + gl_UNISTD_MODULE_INDICATOR([getpagesize]) + gl_FUNC_INET_PTON + if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then + AC_LIBOBJ([inet_pton]) + gl_PREREQ_INET_PTON + fi + gl_ARPA_INET_MODULE_INDICATOR([inet_pton]) + AC_C_BIGENDIAN + gl_FUNC_IOCTL + if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then + AC_LIBOBJ([ioctl]) + fi + gl_SYS_IOCTL_MODULE_INDICATOR([ioctl]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([listen]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([listen]) + AC_CHECK_FUNCS_ONCE([newlocale]) + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 + gt_LOCALE_JA + gt_LOCALE_ZH_CN + gt_LOCALE_TR_UTF8 + gt_LOCALE_FR_UTF8 + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 + gt_LOCALE_JA + gt_LOCALE_ZH_CN + gt_LOCALE_FR_UTF8 + gt_LOCALE_ZH_CN + dnl Check for prerequisites for memory fence checks. + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + gl_FUNC_NANOSLEEP + if test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1; then + AC_LIBOBJ([nanosleep]) + gl_PREREQ_NANOSLEEP + fi + gl_TIME_MODULE_INDICATOR([nanosleep]) + AC_CHECK_DECLS_ONCE([alarm]) + gl_HEADER_NETINET_IN + AC_PROG_MKDIR_P + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 + gl_FUNC_PERROR + if test $REPLACE_PERROR = 1; then + AC_LIBOBJ([perror]) + fi + gl_STRING_MODULE_INDICATOR([perror]) + gl_FUNC_PIPE + if test $HAVE_PIPE = 0; then + AC_LIBOBJ([pipe]) + fi + gl_UNISTD_MODULE_INDICATOR([pipe]) + gl_FUNC_PUTENV + if test $REPLACE_PUTENV = 1; then + AC_LIBOBJ([putenv]) + gl_PREREQ_PUTENV + fi + gl_STDLIB_MODULE_INDICATOR([putenv]) + dnl Check for prerequisites for memory fence checks. + dnl FIXME: zerosize-ptr.h requires these: make a module for it + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + dnl Check for prerequisites for memory fence checks. + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + gl_FUNC_SELECT + if test $REPLACE_SELECT = 1; then + AC_LIBOBJ([select]) + fi + gl_SYS_SELECT_MODULE_INDICATOR([select]) + AC_CHECK_HEADERS_ONCE([sys/wait.h]) + gl_FUNC_SETLOCALE + if test $REPLACE_SETLOCALE = 1; then + AC_LIBOBJ([setlocale]) + gl_PREREQ_SETLOCALE + fi + gl_LOCALE_MODULE_INDICATOR([setlocale]) + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 + gt_LOCALE_JA + gt_LOCALE_ZH_CN + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([setsockopt]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([setsockopt]) + gl_FUNC_SLEEP + if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then + AC_LIBOBJ([sleep]) + fi + gl_UNISTD_MODULE_INDICATOR([sleep]) + AC_CHECK_DECLS_ONCE([alarm]) + gl_FUNC_SNPRINTF + gl_STDIO_MODULE_INDICATOR([snprintf]) + gl_MODULE_INDICATOR([snprintf]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([socket]) + fi + # When this module is used, sockets may actually occur as file descriptors, + # hence it is worth warning if the modules 'close' and 'ioctl' are not used. + m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])]) + m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])]) + AC_REQUIRE([gl_PREREQ_SYS_H_WINSOCK2]) + if test "$ac_cv_header_winsock2_h" = yes; then + UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 + fi + gl_SYS_SOCKET_MODULE_INDICATOR([socket]) + AC_REQUIRE([gl_SOCKETLIB]) + AC_REQUIRE([gl_SOCKETS]) + gl_TYPE_SOCKLEN_T + gl_STDALIGN_H + AC_REQUIRE([gt_TYPE_WCHAR_T]) + AC_REQUIRE([gt_TYPE_WINT_T]) + gl_FUNC_STRERROR_R + if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then + AC_LIBOBJ([strerror_r]) + gl_PREREQ_STRERROR_R + fi + gl_STRING_MODULE_INDICATOR([strerror_r]) + dnl For the modules argp, error. + gl_MODULE_INDICATOR([strerror_r-posix]) + dnl Check for prerequisites for memory fence checks. + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + gl_FUNC_SYMLINK + if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then + AC_LIBOBJ([symlink]) + fi + gl_UNISTD_MODULE_INDICATOR([symlink]) + gl_SYS_IOCTL_H + AC_PROG_MKDIR_P + AC_REQUIRE([gl_HEADER_SYS_SELECT]) + AC_PROG_MKDIR_P + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + AC_PROG_MKDIR_P + AC_CHECK_FUNCS_ONCE([shutdown]) + gl_HEADER_SYS_UIO + AC_PROG_MKDIR_P + abs_aux_dir=`cd "$ac_aux_dir"; pwd` + AC_SUBST([abs_aux_dir]) + abs_aux_dir=`cd "$ac_aux_dir"; pwd` + AC_SUBST([abs_aux_dir]) + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 + gt_LOCALE_JA + gt_LOCALE_ZH_CN + gl_FUNC_WCTOB + if test $HAVE_WCTOB = 0 || test $REPLACE_WCTOB = 1; then + AC_LIBOBJ([wctob]) + gl_PREREQ_WCTOB + fi + gl_WCHAR_MODULE_INDICATOR([wctob]) + gl_FUNC_WCTOMB + if test $REPLACE_WCTOMB = 1; then + AC_LIBOBJ([wctomb]) + gl_PREREQ_WCTOMB + fi + gl_STDLIB_MODULE_INDICATOR([wctomb]) + m4_popdef([gl_MODULE_INDICATOR_CONDITION]) + m4_ifval(gltests_LIBSOURCES_LIST, [ + m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ || + for gl_file in ]gltests_LIBSOURCES_LIST[ ; do + if test ! -r ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file ; then + echo "missing file ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file" >&2 + exit 1 + fi + done])dnl + m4_if(m4_sysval, [0], [], + [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])]) + ]) + m4_popdef([gltests_LIBSOURCES_DIR]) + m4_popdef([gltests_LIBSOURCES_LIST]) + m4_popdef([AC_LIBSOURCES]) + m4_popdef([AC_REPLACE_FUNCS]) + m4_popdef([AC_LIBOBJ]) + AC_CONFIG_COMMANDS_PRE([ + gltests_libobjs= + gltests_ltlibobjs= + if test -n "$gltests_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do + gltests_libobjs="$gltests_libobjs $i.$ac_objext" + gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" + done + fi + AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs]) + AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs]) + ]) + LIBDIFFUTILS_LIBDEPS="$gl_libdeps" + AC_SUBST([LIBDIFFUTILS_LIBDEPS]) + LIBDIFFUTILS_LTLIBDEPS="$gl_ltlibdeps" + AC_SUBST([LIBDIFFUTILS_LTLIBDEPS]) + LIBTESTS_LIBDEPS="$gltests_libdeps" + AC_SUBST([LIBTESTS_LIBDEPS]) +]) + +# Like AC_LIBOBJ, except that the module name goes +# into gl_LIBOBJS instead of into LIBOBJS. +AC_DEFUN([gl_LIBOBJ], [ + AS_LITERAL_IF([$1], [gl_LIBSOURCES([$1.c])])dnl + gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext" +]) + +# Like AC_REPLACE_FUNCS, except that the module name goes +# into gl_LIBOBJS instead of into LIBOBJS. +AC_DEFUN([gl_REPLACE_FUNCS], [ + m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl + AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)]) +]) + +# Like AC_LIBSOURCES, except the directory where the source file is +# expected is derived from the gnulib-tool parameterization, +# and alloca is special cased (for the alloca-opt module). +# We could also entirely rely on EXTRA_lib..._SOURCES. +AC_DEFUN([gl_LIBSOURCES], [ + m4_foreach([_gl_NAME], [$1], [ + m4_if(_gl_NAME, [alloca.c], [], [ + m4_define([gl_LIBSOURCES_DIR], [lib]) + m4_append([gl_LIBSOURCES_LIST], _gl_NAME, [ ]) + ]) + ]) +]) + +# Like AC_LIBOBJ, except that the module name goes +# into gltests_LIBOBJS instead of into LIBOBJS. +AC_DEFUN([gltests_LIBOBJ], [ + AS_LITERAL_IF([$1], [gltests_LIBSOURCES([$1.c])])dnl + gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext" +]) + +# Like AC_REPLACE_FUNCS, except that the module name goes +# into gltests_LIBOBJS instead of into LIBOBJS. +AC_DEFUN([gltests_REPLACE_FUNCS], [ + m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl + AC_CHECK_FUNCS([$1], , [gltests_LIBOBJ($ac_func)]) +]) + +# Like AC_LIBSOURCES, except the directory where the source file is +# expected is derived from the gnulib-tool parameterization, +# and alloca is special cased (for the alloca-opt module). +# We could also entirely rely on EXTRA_lib..._SOURCES. +AC_DEFUN([gltests_LIBSOURCES], [ + m4_foreach([_gl_NAME], [$1], [ + m4_if(_gl_NAME, [alloca.c], [], [ + m4_define([gltests_LIBSOURCES_DIR], [gnulib-tests]) + m4_append([gltests_LIBSOURCES_LIST], _gl_NAME, [ ]) + ]) + ]) +]) + +# This macro records the list of files which have been installed by +# gnulib-tool and may be removed by future gnulib-tool invocations. +AC_DEFUN([gl_FILE_LIST], [ + build-aux/announce-gen + build-aux/config.rpath + build-aux/do-release-commit-and-tag + build-aux/gendocs.sh + build-aux/git-version-gen + build-aux/gitlog-to-changelog + build-aux/gnu-web-doc-update + build-aux/gnupload + build-aux/update-copyright + build-aux/useless-if-before-free + build-aux/vc-list-files + doc/fdl.texi + doc/gendocs_template + doc/gendocs_template_min + lib/_Noreturn.h + lib/alloca.c + lib/alloca.in.h + lib/allocator.c + lib/allocator.h + lib/anytostr.c + lib/areadlink.c + lib/areadlink.h + lib/arg-nonnull.h + lib/argmatch.c + lib/argmatch.h + lib/asnprintf.c + lib/asprintf.c + lib/assure.h + lib/basename-lgpl.c + lib/basename.c + lib/binary-io.c + lib/binary-io.h + lib/bitrotate.c + lib/bitrotate.h + lib/btowc.c + lib/c++defs.h + lib/c-ctype.c + lib/c-ctype.h + lib/c-stack.c + lib/c-stack.h + lib/c-strcase.h + lib/c-strcasecmp.c + lib/c-strcaseeq.h + lib/c-strncasecmp.c + lib/careadlinkat.c + lib/careadlinkat.h + lib/close.c + lib/config.charset + lib/ctype.in.h + lib/diffseq.h + lib/dirname-lgpl.c + lib/dirname.c + lib/dirname.h + lib/dosname.h + lib/dup2.c + lib/errno.in.h + lib/error.c + lib/error.h + lib/exclude.c + lib/exclude.h + lib/exitfail.c + lib/exitfail.h + lib/fcntl.c + lib/fcntl.in.h + lib/fd-hook.c + lib/fd-hook.h + lib/file-type.c + lib/file-type.h + lib/filename.h + lib/filenamecat-lgpl.c + lib/filenamecat.c + lib/filenamecat.h + lib/flexmember.h + lib/float+.h + lib/float.c + lib/float.in.h + lib/fnmatch.c + lib/fnmatch.in.h + lib/fnmatch_loop.c + lib/freopen-safer.c + lib/freopen.c + lib/fstat.c + lib/getdtablesize.c + lib/getopt-cdefs.in.h + lib/getopt-core.h + lib/getopt-ext.h + lib/getopt-pfx-core.h + lib/getopt-pfx-ext.h + lib/getopt.c + lib/getopt.in.h + lib/getopt1.c + lib/getopt_int.h + lib/getprogname.c + lib/getprogname.h + lib/gettext.h + lib/gettime.c + lib/gettimeofday.c + lib/hard-locale.c + lib/hard-locale.h + lib/hash.c + lib/hash.h + lib/iconv.c + lib/iconv.in.h + lib/iconv_close.c + lib/iconv_open-aix.gperf + lib/iconv_open-hpux.gperf + lib/iconv_open-irix.gperf + lib/iconv_open-osf.gperf + lib/iconv_open-solaris.gperf + lib/iconv_open.c + lib/ignore-value.h + lib/imaxtostr.c + lib/intprops.h + lib/inttostr.c + lib/inttostr.h + lib/inttypes.in.h + lib/isblank.c + lib/iswblank.c + lib/itold.c + lib/langinfo.in.h + lib/limits.in.h + lib/localcharset.c + lib/localcharset.h + lib/locale.in.h + lib/localeconv.c + lib/localtime-buffer.c + lib/localtime-buffer.h + lib/lstat.c + lib/malloc.c + lib/malloca.c + lib/malloca.h + lib/malloca.valgrind + lib/mbchar.c + lib/mbchar.h + lib/mbiter.c + lib/mbiter.h + lib/mbrtowc.c + lib/mbscasecmp.c + lib/mbsinit.c + lib/mbslen.c + lib/mbsrtowcs-impl.h + lib/mbsrtowcs-state.c + lib/mbsrtowcs.c + lib/mbsstr.c + lib/mbtowc-impl.h + lib/mbtowc.c + lib/mbuiter.c + lib/mbuiter.h + lib/memchr.c + lib/memchr.valgrind + lib/minmax.h + lib/mkstemp.c + lib/mktime-internal.h + lib/mktime.c + lib/msvc-inval.c + lib/msvc-inval.h + lib/msvc-nothrow.c + lib/msvc-nothrow.h + lib/nl_langinfo.c + lib/offtostr.c + lib/open.c + lib/pathmax.h + lib/printf-args.c + lib/printf-args.h + lib/printf-parse.c + lib/printf-parse.h + lib/progname.c + lib/progname.h + lib/propername.c + lib/propername.h + lib/quote.h + lib/quotearg.c + lib/quotearg.h + lib/raise.c + lib/rawmemchr.c + lib/rawmemchr.valgrind + lib/readlink.c + lib/ref-add.sin + lib/ref-del.sin + lib/regcomp.c + lib/regex.c + lib/regex.h + lib/regex_internal.c + lib/regex_internal.h + lib/regexec.c + lib/secure_getenv.c + lib/setenv.c + lib/sh-quote.c + lib/sh-quote.h + lib/sig-handler.c + lib/sig-handler.h + lib/sigaction.c + lib/signal.in.h + lib/sigprocmask.c + lib/size_max.h + lib/stat-macros.h + lib/stat-time.c + lib/stat-time.h + lib/stat-w32.c + lib/stat-w32.h + lib/stat.c + lib/stdarg.in.h + lib/stdbool.in.h + lib/stddef.in.h + lib/stdint.in.h + lib/stdio--.h + lib/stdio-safer.h + lib/stdio.in.h + lib/stdlib.in.h + lib/str-kmp.h + lib/strcasecmp.c + lib/streq.h + lib/strerror-override.c + lib/strerror-override.h + lib/strerror.c + lib/strftime.c + lib/strftime.h + lib/striconv.c + lib/striconv.h + lib/string.in.h + lib/strings.in.h + lib/stripslash.c + lib/strncasecmp.c + lib/strndup.c + lib/strnlen.c + lib/strnlen1.c + lib/strnlen1.h + lib/strptime.c + lib/strtoimax.c + lib/strtol.c + lib/strtoul.c + lib/strtoull.c + lib/strtoumax.c + lib/sys_stat.in.h + lib/sys_time.in.h + lib/sys_types.in.h + lib/sys_wait.in.h + lib/system-quote.c + lib/system-quote.h + lib/tempname.c + lib/tempname.h + lib/time-internal.h + lib/time.in.h + lib/time_r.c + lib/time_rz.c + lib/timegm.c + lib/timespec.c + lib/timespec.h + lib/trim.c + lib/trim.h + lib/tzset.c + lib/uinttostr.c + lib/umaxtostr.c + lib/unistd.c + lib/unistd.in.h + lib/unistr.in.h + lib/unistr/u8-mbtoucr.c + lib/unistr/u8-uctomb-aux.c + lib/unistr/u8-uctomb.c + lib/unitypes.in.h + lib/uniwidth.in.h + lib/uniwidth/cjk.h + lib/uniwidth/width.c + lib/unlocked-io.h + lib/unsetenv.c + lib/unused-parameter.h + lib/vasnprintf.c + lib/vasnprintf.h + lib/vasprintf.c + lib/verify.h + lib/version-etc-fsf.c + lib/version-etc.c + lib/version-etc.h + lib/warn-on-use.h + lib/wchar.in.h + lib/wcrtomb.c + lib/wctype-h.c + lib/wctype.in.h + lib/wcwidth.c + lib/xalloc-die.c + lib/xalloc-oversized.h + lib/xalloc.h + lib/xasprintf.c + lib/xfreopen.c + lib/xfreopen.h + lib/xmalloc.c + lib/xreadlink.c + lib/xreadlink.h + lib/xsize.c + lib/xsize.h + lib/xstriconv.c + lib/xstriconv.h + lib/xstrndup.c + lib/xstrndup.h + lib/xstrtol-error.c + lib/xstrtol.c + lib/xstrtol.h + lib/xstrtoul.c + lib/xstrtoumax.c + lib/xvasprintf.c + lib/xvasprintf.h + m4/00gnulib.m4 + m4/absolute-header.m4 + m4/alloca.m4 + m4/arpa_inet_h.m4 + m4/btowc.m4 + m4/builtin-expect.m4 + m4/c-stack.m4 + m4/clock_time.m4 + m4/close.m4 + m4/codeset.m4 + m4/config-h.m4 + m4/configmake.m4 + m4/ctype.m4 + m4/dirname.m4 + m4/double-slash-root.m4 + m4/dup2.m4 + m4/eealloc.m4 + m4/environ.m4 + m4/errno_h.m4 + m4/error.m4 + m4/exponentd.m4 + m4/extensions.m4 + m4/extern-inline.m4 + m4/fcntl-o.m4 + m4/fcntl.m4 + m4/fcntl_h.m4 + m4/fdopen.m4 + m4/filenamecat.m4 + m4/flexmember.m4 + m4/float_h.m4 + m4/fnmatch.m4 + m4/fpieee.m4 + m4/freopen.m4 + m4/fstat.m4 + m4/ftruncate.m4 + m4/getcwd.m4 + m4/getdtablesize.m4 + m4/getopt.m4 + m4/getpagesize.m4 + m4/getprogname.m4 + m4/gettime.m4 + m4/gettimeofday.m4 + m4/glibc21.m4 + m4/gnu-make.m4 + m4/gnulib-common.m4 + m4/hard-locale.m4 + m4/iconv.m4 + m4/iconv_h.m4 + m4/iconv_open.m4 + m4/include_next.m4 + m4/inet_pton.m4 + m4/inline.m4 + m4/intmax_t.m4 + m4/inttostr.m4 + m4/inttypes-pri.m4 + m4/inttypes.m4 + m4/inttypes_h.m4 + m4/ioctl.m4 + m4/isblank.m4 + m4/iswblank.m4 + m4/langinfo_h.m4 + m4/largefile.m4 + m4/lib-ld.m4 + m4/lib-link.m4 + m4/lib-prefix.m4 + m4/libsigsegv.m4 + m4/libunistring-base.m4 + m4/limits-h.m4 + m4/localcharset.m4 + m4/locale-fr.m4 + m4/locale-ja.m4 + m4/locale-tr.m4 + m4/locale-zh.m4 + m4/locale_h.m4 + m4/localeconv.m4 + m4/localtime-buffer.m4 + m4/longlong.m4 + m4/lstat.m4 + m4/malloc.m4 + m4/malloca.m4 + m4/manywarnings.m4 + m4/math_h.m4 + m4/mbchar.m4 + m4/mbiter.m4 + m4/mbrtowc.m4 + m4/mbsinit.m4 + m4/mbslen.m4 + m4/mbsrtowcs.m4 + m4/mbstate_t.m4 + m4/mbtowc.m4 + m4/memchr.m4 + m4/minmax.m4 + m4/mkstemp.m4 + m4/mktime.m4 + m4/mmap-anon.m4 + m4/mode_t.m4 + m4/msvc-inval.m4 + m4/msvc-nothrow.m4 + m4/multiarch.m4 + m4/nanosleep.m4 + m4/netinet_in_h.m4 + m4/nl_langinfo.m4 + m4/nocrash.m4 + m4/off_t.m4 + m4/open.m4 + m4/pathmax.m4 + m4/perror.m4 + m4/pipe.m4 + m4/printf.m4 + m4/putenv.m4 + m4/quote.m4 + m4/quotearg.m4 + m4/raise.m4 + m4/rawmemchr.m4 + m4/readlink.m4 + m4/regex.m4 + m4/secure_getenv.m4 + m4/select.m4 + m4/setenv.m4 + m4/setlocale.m4 + m4/sigaction.m4 + m4/signal_h.m4 + m4/signalblocking.m4 + m4/size_max.m4 + m4/sleep.m4 + m4/snprintf.m4 + m4/socketlib.m4 + m4/sockets.m4 + m4/socklen.m4 + m4/sockpfaf.m4 + m4/ssize_t.m4 + m4/stat-time.m4 + m4/stat.m4 + m4/stdalign.m4 + m4/stdarg.m4 + m4/stdbool.m4 + m4/stddef_h.m4 + m4/stdint.m4 + m4/stdint_h.m4 + m4/stdio_h.m4 + m4/stdlib_h.m4 + m4/strcase.m4 + m4/strerror.m4 + m4/strerror_r.m4 + m4/strftime.m4 + m4/string_h.m4 + m4/strings_h.m4 + m4/strndup.m4 + m4/strnlen.m4 + m4/strptime.m4 + m4/strtoull.m4 + m4/strtoumax.m4 + m4/symlink.m4 + m4/sys_ioctl_h.m4 + m4/sys_select_h.m4 + m4/sys_socket_h.m4 + m4/sys_stat_h.m4 + m4/sys_time_h.m4 + m4/sys_types_h.m4 + m4/sys_uio_h.m4 + m4/sys_wait_h.m4 + m4/tempname.m4 + m4/time_h.m4 + m4/time_r.m4 + m4/time_rz.m4 + m4/timegm.m4 + m4/timespec.m4 + m4/tm_gmtoff.m4 + m4/tzset.m4 + m4/unistd_h.m4 + m4/unlocked-io.m4 + m4/vararrays.m4 + m4/vasnprintf.m4 + m4/vasprintf.m4 + m4/version-etc.m4 + m4/warn-on-use.m4 + m4/warnings.m4 + m4/wchar_h.m4 + m4/wchar_t.m4 + m4/wcrtomb.m4 + m4/wctob.m4 + m4/wctomb.m4 + m4/wctype_h.m4 + m4/wcwidth.m4 + m4/wint_t.m4 + m4/xalloc.m4 + m4/xsize.m4 + m4/xstrndup.m4 + m4/xstrtol.m4 + m4/xvasprintf.m4 + tests/init.sh + tests/macros.h + tests/nap.h + tests/signature.h + tests/test-accept.c + tests/test-alloca-opt.c + tests/test-areadlink.c + tests/test-areadlink.h + tests/test-argmatch.c + tests/test-arpa_inet.c + tests/test-binary-io.c + tests/test-binary-io.sh + tests/test-bind.c + tests/test-bitrotate.c + tests/test-btowc.c + tests/test-btowc1.sh + tests/test-btowc2.sh + tests/test-c-ctype.c + tests/test-c-stack.c + tests/test-c-stack.sh + tests/test-c-stack2.sh + tests/test-c-strcase.sh + tests/test-c-strcasecmp.c + tests/test-c-strncasecmp.c + tests/test-close.c + tests/test-connect.c + tests/test-ctype.c + tests/test-dirname.c + tests/test-dup2.c + tests/test-environ.c + tests/test-errno.c + tests/test-exclude.c + tests/test-exclude1.sh + tests/test-exclude2.sh + tests/test-exclude3.sh + tests/test-exclude4.sh + tests/test-exclude5.sh + tests/test-exclude6.sh + tests/test-exclude7.sh + tests/test-exclude8.sh + tests/test-fcntl-h.c + tests/test-fcntl.c + tests/test-fdopen.c + tests/test-fgetc.c + tests/test-filenamecat.c + tests/test-float.c + tests/test-fnmatch.c + tests/test-fputc.c + tests/test-fread.c + tests/test-freopen-safer.c + tests/test-freopen.c + tests/test-fstat.c + tests/test-ftruncate.c + tests/test-ftruncate.sh + tests/test-fwrite.c + tests/test-getcwd-lgpl.c + tests/test-getdtablesize.c + tests/test-getopt-gnu.c + tests/test-getopt-main.h + tests/test-getopt-posix.c + tests/test-getopt.h + tests/test-getopt_long.h + tests/test-getprogname.c + tests/test-gettimeofday.c + tests/test-hash.c + tests/test-iconv-h.c + tests/test-iconv.c + tests/test-ignore-value.c + tests/test-inet_pton.c + tests/test-init.sh + tests/test-intprops.c + tests/test-inttostr.c + tests/test-inttypes.c + tests/test-ioctl.c + tests/test-isblank.c + tests/test-iswblank.c + tests/test-langinfo.c + tests/test-limits-h.c + tests/test-listen.c + tests/test-locale.c + tests/test-localeconv.c + tests/test-lstat.c + tests/test-lstat.h + tests/test-malloca.c + tests/test-mbrtowc-w32-1.sh + tests/test-mbrtowc-w32-2.sh + tests/test-mbrtowc-w32-3.sh + tests/test-mbrtowc-w32-4.sh + tests/test-mbrtowc-w32-5.sh + tests/test-mbrtowc-w32.c + tests/test-mbrtowc.c + tests/test-mbrtowc1.sh + tests/test-mbrtowc2.sh + tests/test-mbrtowc3.sh + tests/test-mbrtowc4.sh + tests/test-mbrtowc5.sh + tests/test-mbscasecmp.c + tests/test-mbscasecmp.sh + tests/test-mbsinit.c + tests/test-mbsinit.sh + tests/test-mbsrtowcs.c + tests/test-mbsrtowcs1.sh + tests/test-mbsrtowcs2.sh + tests/test-mbsrtowcs3.sh + tests/test-mbsrtowcs4.sh + tests/test-mbsstr1.c + tests/test-mbsstr2.c + tests/test-mbsstr2.sh + tests/test-mbsstr3.c + tests/test-mbsstr3.sh + tests/test-memchr.c + tests/test-nanosleep.c + tests/test-netinet_in.c + tests/test-nl_langinfo.c + tests/test-nl_langinfo.sh + tests/test-open.c + tests/test-open.h + tests/test-pathmax.c + tests/test-perror.c + tests/test-perror.sh + tests/test-perror2.c + tests/test-pipe.c + tests/test-quotearg-simple.c + tests/test-quotearg.h + tests/test-raise.c + tests/test-rawmemchr.c + tests/test-readlink.c + tests/test-readlink.h + tests/test-regex.c + tests/test-select-fd.c + tests/test-select-in.sh + tests/test-select-out.sh + tests/test-select-stdin.c + tests/test-select.c + tests/test-select.h + tests/test-setenv.c + tests/test-setlocale1.c + tests/test-setlocale1.sh + tests/test-setlocale2.c + tests/test-setlocale2.sh + tests/test-setsockopt.c + tests/test-sh-quote.c + tests/test-sigaction.c + tests/test-signal-h.c + tests/test-sigprocmask.c + tests/test-sleep.c + tests/test-snprintf.c + tests/test-sockets.c + tests/test-stat-time.c + tests/test-stat.c + tests/test-stat.h + tests/test-stdalign.c + tests/test-stdbool.c + tests/test-stddef.c + tests/test-stdint.c + tests/test-stdio.c + tests/test-stdlib.c + tests/test-strerror.c + tests/test-strerror_r.c + tests/test-strftime.c + tests/test-striconv.c + tests/test-string.c + tests/test-strings.c + tests/test-strnlen.c + tests/test-strtoull.c + tests/test-strtoumax.c + tests/test-symlink.c + tests/test-symlink.h + tests/test-sys_ioctl.c + tests/test-sys_select.c + tests/test-sys_socket.c + tests/test-sys_stat.c + tests/test-sys_time.c + tests/test-sys_types.c + tests/test-sys_uio.c + tests/test-sys_wait.c + tests/test-sys_wait.h + tests/test-time.c + tests/test-timespec.c + tests/test-unistd.c + tests/test-unsetenv.c + tests/test-update-copyright.sh + tests/test-vasnprintf.c + tests/test-vasprintf.c + tests/test-vc-list-files-cvs.sh + tests/test-vc-list-files-git.sh + tests/test-verify-try.c + tests/test-verify.c + tests/test-verify.sh + tests/test-version-etc.c + tests/test-version-etc.sh + tests/test-wchar.c + tests/test-wcrtomb-w32-1.sh + tests/test-wcrtomb-w32-2.sh + tests/test-wcrtomb-w32-3.sh + tests/test-wcrtomb-w32-4.sh + tests/test-wcrtomb-w32-5.sh + tests/test-wcrtomb-w32.c + tests/test-wcrtomb.c + tests/test-wcrtomb.sh + tests/test-wctype-h.c + tests/test-wcwidth.c + tests/test-xalloc-die.c + tests/test-xalloc-die.sh + tests/test-xstrtol.c + tests/test-xstrtol.sh + tests/test-xstrtoul.c + tests/test-xstrtoumax.c + tests/test-xstrtoumax.sh + tests/test-xvasprintf.c + tests/unistr/test-u8-mbtoucr.c + tests/unistr/test-u8-uctomb.c + tests/uniwidth/test-uc_width.c + tests/uniwidth/test-uc_width2.c + tests/uniwidth/test-uc_width2.sh + tests/zerosize-ptr.h + tests=lib/_Noreturn.h + tests=lib/accept.c + tests=lib/arg-nonnull.h + tests=lib/arpa_inet.in.h + tests=lib/bind.c + tests=lib/c++defs.h + tests=lib/connect.c + tests=lib/dtotimespec.c + tests=lib/fdopen.c + tests=lib/fpucw.h + tests=lib/ftruncate.c + tests=lib/getcwd-lgpl.c + tests=lib/getpagesize.c + tests=lib/hash-pjw.c + tests=lib/hash-pjw.h + tests=lib/inet_pton.c + tests=lib/ioctl.c + tests=lib/listen.c + tests=lib/nanosleep.c + tests=lib/netinet_in.in.h + tests=lib/perror.c + tests=lib/pipe.c + tests=lib/putenv.c + tests=lib/same-inode.h + tests=lib/select.c + tests=lib/setlocale.c + tests=lib/setsockopt.c + tests=lib/sleep.c + tests=lib/snprintf.c + tests=lib/socket.c + tests=lib/sockets.c + tests=lib/sockets.h + tests=lib/stdalign.in.h + tests=lib/strerror_r.c + tests=lib/symlink.c + tests=lib/sys_ioctl.in.h + tests=lib/sys_select.in.h + tests=lib/sys_socket.c + tests=lib/sys_socket.in.h + tests=lib/sys_uio.in.h + tests=lib/timespec-add.c + tests=lib/timespec-sub.c + tests=lib/unused-parameter.h + tests=lib/w32sock.h + tests=lib/warn-on-use.h + tests=lib/wctob.c + tests=lib/wctomb-impl.h + tests=lib/wctomb.c + top/GNUmakefile + top/README-release + top/maint.mk +]) diff --git a/local/recipes/tools/diffutils/source/m4/hard-locale.m4 b/local/recipes/tools/diffutils/source/m4/hard-locale.m4 new file mode 100644 index 0000000000..d79acd6581 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/hard-locale.m4 @@ -0,0 +1,11 @@ +# hard-locale.m4 serial 8 +dnl Copyright (C) 2002-2006, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl No prerequisites of lib/hard-locale.c. +AC_DEFUN([gl_HARD_LOCALE], +[ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/iconv.m4 b/local/recipes/tools/diffutils/source/m4/iconv.m4 new file mode 100644 index 0000000000..bdafc54e30 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/iconv.m4 @@ -0,0 +1,275 @@ +# iconv.m4 serial 20 +dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], +[ + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([iconv]) +]) + +AC_DEFUN([AM_ICONV_LINK], +[ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable GNU libiconv installed). + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + + dnl Add $INCICONV to CPPFLAGS before performing the following checks, + dnl because if the user has installed libiconv and not disabled its use + dnl via --without-libiconv-prefix, he wants to use it. The first + dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. + am_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) + + AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <stdlib.h> +#include <iconv.h> + ]], + [[iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);]])], + [am_cv_func_iconv=yes]) + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <stdlib.h> +#include <iconv.h> + ]], + [[iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);]])], + [am_cv_lib_iconv=yes] + [am_cv_func_iconv=yes]) + LIBS="$am_save_LIBS" + fi + ]) + if test "$am_cv_func_iconv" = yes; then + AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ + dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, + dnl Solaris 10. + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <iconv.h> +#include <string.h> + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + ]], + [[int result = 0; + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\263"; + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + result |= 8; + iconv_close (cd_88591_to_utf8); + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + result |= 16; + return result; +]])], + [am_cv_func_iconv_works=yes], , + [case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac]) + test "$am_cv_func_iconv_works" = no || break + done + LIBS="$am_save_LIBS" + ]) + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + AC_DEFINE([HAVE_ICONV], [1], + [Define if you have the iconv() function and it works.]) + fi + if test "$am_cv_lib_iconv" = yes; then + AC_MSG_CHECKING([how to link with libiconv]) + AC_MSG_RESULT([$LIBICONV]) + else + dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV + dnl either. + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + AC_SUBST([LIBICONV]) + AC_SUBST([LTLIBICONV]) +]) + +dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to +dnl avoid warnings like +dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". +dnl This is tricky because of the way 'aclocal' is implemented: +dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. +dnl Otherwise aclocal's initial scan pass would miss the macro definition. +dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. +dnl Otherwise aclocal would emit many "Use of uninitialized value $1" +dnl warnings. +m4_define([gl_iconv_AC_DEFUN], + m4_version_prereq([2.64], + [[AC_DEFUN_ONCE( + [$1], [$2])]], + [m4_ifdef([gl_00GNULIB], + [[AC_DEFUN_ONCE( + [$1], [$2])]], + [[AC_DEFUN( + [$1], [$2])]])])) +gl_iconv_AC_DEFUN([AM_ICONV], +[ + AM_ICONV_LINK + if test "$am_cv_func_iconv" = yes; then + AC_MSG_CHECKING([for iconv declaration]) + AC_CACHE_VAL([am_cv_proto_iconv], [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <stdlib.h> +#include <iconv.h> +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif + ]], + [[]])], + [am_cv_proto_iconv_arg1=""], + [am_cv_proto_iconv_arg1="const"]) + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) + am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + AC_MSG_RESULT([ + $am_cv_proto_iconv]) + else + dnl When compiling GNU libiconv on a system that does not have iconv yet, + dnl pick the POSIX compliant declaration without 'const'. + am_cv_proto_iconv_arg1="" + fi + AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], + [Define as const if the declaration of iconv() needs const.]) + dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>. + m4_ifdef([gl_ICONV_H_DEFAULTS], + [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) + if test -n "$am_cv_proto_iconv_arg1"; then + ICONV_CONST="const" + fi + ]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/iconv_h.m4 b/local/recipes/tools/diffutils/source/m4/iconv_h.m4 new file mode 100644 index 0000000000..d4ac24357a --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/iconv_h.m4 @@ -0,0 +1,41 @@ +# iconv_h.m4 serial 8 +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_ICONV_H], +[ + AC_REQUIRE([gl_ICONV_H_DEFAULTS]) + + dnl Execute this unconditionally, because ICONV_H may be set by other + dnl modules, after this code is executed. + gl_CHECK_NEXT_HEADERS([iconv.h]) +]) + +dnl Unconditionally enables the replacement of <iconv.h>. +AC_DEFUN([gl_REPLACE_ICONV_H], +[ + AC_REQUIRE([gl_ICONV_H_DEFAULTS]) + ICONV_H='iconv.h' + AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"]) +]) + +AC_DEFUN([gl_ICONV_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_ICONV_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) +]) + +AC_DEFUN([gl_ICONV_H_DEFAULTS], +[ + GNULIB_ICONV=0; AC_SUBST([GNULIB_ICONV]) + dnl Assume proper GNU behavior unless another module says otherwise. + ICONV_CONST=; AC_SUBST([ICONV_CONST]) + REPLACE_ICONV=0; AC_SUBST([REPLACE_ICONV]) + REPLACE_ICONV_OPEN=0; AC_SUBST([REPLACE_ICONV_OPEN]) + REPLACE_ICONV_UTF=0; AC_SUBST([REPLACE_ICONV_UTF]) + ICONV_H=''; AC_SUBST([ICONV_H]) + AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/iconv_open.m4 b/local/recipes/tools/diffutils/source/m4/iconv_open.m4 new file mode 100644 index 0000000000..2517a5bba4 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/iconv_open.m4 @@ -0,0 +1,56 @@ +# iconv_open.m4 serial 14 +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_ICONV_OPEN], +[ + AC_REQUIRE([AM_ICONV]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_ICONV_H_DEFAULTS]) + if test "$am_cv_func_iconv" = yes; then + dnl Provide the <iconv.h> override, for the sake of the C++ aliases. + gl_REPLACE_ICONV_H + dnl Test whether iconv_open accepts standardized encoding names. + dnl We know that GNU libiconv and GNU libc do. + AC_EGREP_CPP([gnu_iconv], [ + #include <iconv.h> + #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__) + gnu_iconv + #endif + ], [gl_func_iconv_gnu=yes], [gl_func_iconv_gnu=no]) + if test $gl_func_iconv_gnu = no; then + iconv_flavor= + case "$host_os" in + aix*) iconv_flavor=ICONV_FLAVOR_AIX ;; + irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;; + hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;; + osf*) iconv_flavor=ICONV_FLAVOR_OSF ;; + solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;; + esac + if test -n "$iconv_flavor"; then + AC_DEFINE_UNQUOTED([ICONV_FLAVOR], [$iconv_flavor], + [Define to a symbolic name denoting the flavor of iconv_open() + implementation.]) + gl_REPLACE_ICONV_OPEN + fi + fi + m4_ifdef([gl_FUNC_ICONV_OPEN_UTF_SUPPORT], [ + gl_FUNC_ICONV_OPEN_UTF_SUPPORT + if test $gl_cv_func_iconv_supports_utf = no; then + REPLACE_ICONV_UTF=1 + AC_DEFINE([REPLACE_ICONV_UTF], [1], + [Define if the iconv() functions are enhanced to handle the UTF-{16,32}{BE,LE} encodings.]) + REPLACE_ICONV=1 + gl_REPLACE_ICONV_OPEN + fi + ]) + fi +]) + +AC_DEFUN([gl_REPLACE_ICONV_OPEN], +[ + gl_REPLACE_ICONV_H + REPLACE_ICONV_OPEN=1 +]) diff --git a/local/recipes/tools/diffutils/source/m4/include_next.m4 b/local/recipes/tools/diffutils/source/m4/include_next.m4 new file mode 100644 index 0000000000..068f6f60a4 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/include_next.m4 @@ -0,0 +1,224 @@ +# include_next.m4 serial 24 +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert and Derek Price. + +dnl Sets INCLUDE_NEXT, INCLUDE_NEXT_AS_FIRST_DIRECTIVE, PRAGMA_SYSTEM_HEADER, +dnl and PRAGMA_COLUMNS. +dnl +dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to +dnl 'include' otherwise. +dnl +dnl INCLUDE_NEXT_AS_FIRST_DIRECTIVE expands to 'include_next' if the compiler +dnl supports it in the special case that it is the first include directive in +dnl the given file, or to 'include' otherwise. +dnl +dnl PRAGMA_SYSTEM_HEADER can be used in files that contain #include_next, +dnl so as to avoid GCC warnings when the gcc option -pedantic is used. +dnl '#pragma GCC system_header' has the same effect as if the file was found +dnl through the include search path specified with '-isystem' options (as +dnl opposed to the search path specified with '-I' options). Namely, gcc +dnl does not warn about some things, and on some systems (Solaris and Interix) +dnl __STDC__ evaluates to 0 instead of to 1. The latter is an undesired side +dnl effect; we are therefore careful to use 'defined __STDC__' or '1' instead +dnl of plain '__STDC__'. +dnl +dnl PRAGMA_COLUMNS can be used in files that override system header files, so +dnl as to avoid compilation errors on HP NonStop systems when the gnulib file +dnl is included by a system header file that does a "#pragma COLUMNS 80" (which +dnl has the effect of truncating the lines of that file and all files that it +dnl includes to 80 columns) and the gnulib file has lines longer than 80 +dnl columns. + +AC_DEFUN([gl_INCLUDE_NEXT], +[ + AC_LANG_PREPROC_REQUIRE() + AC_CACHE_CHECK([whether the preprocessor supports include_next], + [gl_cv_have_include_next], + [rm -rf conftestd1a conftestd1b conftestd2 + mkdir conftestd1a conftestd1b conftestd2 + dnl IBM C 9.0, 10.1 (original versions, prior to the 2009-01 updates) on + dnl AIX 6.1 support include_next when used as first preprocessor directive + dnl in a file, but not when preceded by another include directive. Check + dnl for this bug by including <stdio.h>. + dnl Additionally, with this same compiler, include_next is a no-op when + dnl used in a header file that was included by specifying its absolute + dnl file name. Despite these two bugs, include_next is used in the + dnl compiler's <math.h>. By virtue of the second bug, we need to use + dnl include_next as well in this case. + cat <<EOF > conftestd1a/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include_next <conftest.h> +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat <<EOF > conftestd1b/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include <stdio.h> +#include_next <conftest.h> +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat <<EOF > conftestd2/conftest.h +#ifndef DEFINED_IN_CONFTESTD1 +#error "include_next test doesn't work" +#endif +#define DEFINED_IN_CONFTESTD2 +EOF + gl_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" +dnl We intentionally avoid using AC_LANG_SOURCE here. + AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]], + [gl_cv_have_include_next=yes], + [CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" + AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]], + [gl_cv_have_include_next=buggy], + [gl_cv_have_include_next=no]) + ]) + CPPFLAGS="$gl_save_CPPFLAGS" + rm -rf conftestd1a conftestd1b conftestd2 + ]) + PRAGMA_SYSTEM_HEADER= + if test $gl_cv_have_include_next = yes; then + INCLUDE_NEXT=include_next + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + if test -n "$GCC"; then + PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' + fi + else + if test $gl_cv_have_include_next = buggy; then + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + else + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include + fi + fi + AC_SUBST([INCLUDE_NEXT]) + AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE]) + AC_SUBST([PRAGMA_SYSTEM_HEADER]) + AC_CACHE_CHECK([whether system header files limit the line length], + [gl_cv_pragma_columns], + [dnl HP NonStop systems, which define __TANDEM, have this misfeature. + AC_EGREP_CPP([choke me], + [ +#ifdef __TANDEM +choke me +#endif + ], + [gl_cv_pragma_columns=yes], + [gl_cv_pragma_columns=no]) + ]) + if test $gl_cv_pragma_columns = yes; then + PRAGMA_COLUMNS="#pragma COLUMNS 10000" + else + PRAGMA_COLUMNS= + fi + AC_SUBST([PRAGMA_COLUMNS]) +]) + +# gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...) +# ------------------------------------------ +# For each arg foo.h, if #include_next works, define NEXT_FOO_H to be +# '<foo.h>'; otherwise define it to be +# '"///usr/include/foo.h"', or whatever other absolute file name is suitable. +# Also, if #include_next works as first preprocessing directive in a file, +# define NEXT_AS_FIRST_DIRECTIVE_FOO_H to be '<foo.h>'; otherwise define it to +# be +# '"///usr/include/foo.h"', or whatever other absolute file name is suitable. +# That way, a header file with the following line: +# #@INCLUDE_NEXT@ @NEXT_FOO_H@ +# or +# #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_FOO_H@ +# behaves (after sed substitution) as if it contained +# #include_next <foo.h> +# even if the compiler does not support include_next. +# The three "///" are to pacify Sun C 5.8, which otherwise would say +# "warning: #include of /usr/include/... may be non-portable". +# Use '""', not '<>', so that the /// cannot be confused with a C99 comment. +# Note: This macro assumes that the header file is not empty after +# preprocessing, i.e. it does not only define preprocessor macros but also +# provides some type/enum definitions or function/variable declarations. +# +# This macro also checks whether each header exists, by invoking +# AC_CHECK_HEADERS_ONCE or AC_CHECK_HEADERS on each argument. +AC_DEFUN([gl_CHECK_NEXT_HEADERS], +[ + gl_NEXT_HEADERS_INTERNAL([$1], [check]) +]) + +# gl_NEXT_HEADERS(HEADER1 HEADER2 ...) +# ------------------------------------ +# Like gl_CHECK_NEXT_HEADERS, except do not check whether the headers exist. +# This is suitable for headers like <stddef.h> that are standardized by C89 +# and therefore can be assumed to exist. +AC_DEFUN([gl_NEXT_HEADERS], +[ + gl_NEXT_HEADERS_INTERNAL([$1], [assume]) +]) + +# The guts of gl_CHECK_NEXT_HEADERS and gl_NEXT_HEADERS. +AC_DEFUN([gl_NEXT_HEADERS_INTERNAL], +[ + AC_REQUIRE([gl_INCLUDE_NEXT]) + AC_REQUIRE([AC_CANONICAL_HOST]) + + m4_if([$2], [check], + [AC_CHECK_HEADERS_ONCE([$1]) + ]) + +dnl FIXME: gl_next_header and gl_header_exists must be used unquoted +dnl until we can assume autoconf 2.64 or newer. + m4_foreach_w([gl_HEADER_NAME], [$1], + [AS_VAR_PUSHDEF([gl_next_header], + [gl_cv_next_]m4_defn([gl_HEADER_NAME])) + if test $gl_cv_have_include_next = yes; then + AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>']) + else + AC_CACHE_CHECK( + [absolute name of <]m4_defn([gl_HEADER_NAME])[>], + m4_defn([gl_next_header]), + [m4_if([$2], [check], + [AS_VAR_PUSHDEF([gl_header_exists], + [ac_cv_header_]m4_defn([gl_HEADER_NAME])) + if test AS_VAR_GET(gl_header_exists) = yes; then + AS_VAR_POPDEF([gl_header_exists]) + ]) + gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME) + AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME)) + AS_VAR_SET(gl_next_header, ['"'$gl_header'"']) + m4_if([$2], [check], + [else + AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>']) + fi + ]) + ]) + fi + AC_SUBST( + AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])), + [AS_VAR_GET(gl_next_header)]) + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'gl_HEADER_NAME'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=AS_VAR_GET(gl_next_header) + fi + AC_SUBST( + AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])), + [$gl_next_as_first_directive]) + AS_VAR_POPDEF([gl_next_header])]) +]) + +# Autoconf 2.68 added warnings for our use of AC_COMPILE_IFELSE; +# this fallback is safe for all earlier autoconf versions. +m4_define_default([AC_LANG_DEFINES_PROVIDED]) diff --git a/local/recipes/tools/diffutils/source/m4/inet_pton.m4 b/local/recipes/tools/diffutils/source/m4/inet_pton.m4 new file mode 100644 index 0000000000..407c29c2c4 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/inet_pton.m4 @@ -0,0 +1,68 @@ +# inet_pton.m4 serial 17 +dnl Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_INET_PTON], +[ + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) + + dnl Persuade Solaris <arpa/inet.h> to declare inet_pton. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([AC_C_RESTRICT]) + + dnl Most platforms that provide inet_pton define it in libc. + dnl Solaris 8..10 provide inet_pton in libnsl instead. + dnl Solaris 2.6..7 provide inet_pton in libresolv instead. + dnl Native Windows provides it in -lws2_32 instead, with a declaration in + dnl <ws2tcpip.h>, and it uses stdcall calling convention, not cdecl + dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it). + HAVE_INET_PTON=1 + INET_PTON_LIB= + gl_PREREQ_SYS_H_WINSOCK2 + if test $HAVE_WINSOCK2_H = 1; then + AC_CHECK_DECLS([inet_pton],,, [[#include <ws2tcpip.h>]]) + if test $ac_cv_have_decl_inet_pton = yes; then + dnl It needs to be overridden, because the stdcall calling convention + dnl is not compliant with POSIX. + REPLACE_INET_PTON=1 + INET_PTON_LIB="-lws2_32" + else + HAVE_DECL_INET_PTON=0 + HAVE_INET_PTON=0 + fi + else + gl_save_LIBS=$LIBS + AC_SEARCH_LIBS([inet_pton], [nsl resolv], [], + [AC_CHECK_FUNCS([inet_pton]) + if test $ac_cv_func_inet_pton = no; then + HAVE_INET_PTON=0 + fi + ]) + LIBS=$gl_save_LIBS + + if test "$ac_cv_search_inet_pton" != "no" \ + && test "$ac_cv_search_inet_pton" != "none required"; then + INET_PTON_LIB="$ac_cv_search_inet_pton" + fi + + AC_CHECK_HEADERS_ONCE([netdb.h]) + AC_CHECK_DECLS([inet_pton],,, + [[#include <arpa/inet.h> + #if HAVE_NETDB_H + # include <netdb.h> + #endif + ]]) + if test $ac_cv_have_decl_inet_pton = no; then + HAVE_DECL_INET_PTON=0 + fi + fi + AC_SUBST([INET_PTON_LIB]) +]) + +# Prerequisites of lib/inet_pton.c. +AC_DEFUN([gl_PREREQ_INET_PTON], [ + AC_REQUIRE([gl_SOCKET_FAMILIES]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/inline.m4 b/local/recipes/tools/diffutils/source/m4/inline.m4 new file mode 100644 index 0000000000..f00572e0ce --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/inline.m4 @@ -0,0 +1,40 @@ +# inline.m4 serial 4 +dnl Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Test for the 'inline' keyword or equivalent. +dnl Define 'inline' to a supported equivalent, or to nothing if not supported, +dnl like AC_C_INLINE does. Also, define HAVE_INLINE if 'inline' or an +dnl equivalent is effectively supported, i.e. if the compiler is likely to +dnl drop unused 'static inline' functions. +AC_DEFUN([gl_INLINE], +[ + AC_REQUIRE([AC_C_INLINE]) + AC_CACHE_CHECK([whether the compiler generally respects inline], + [gl_cv_c_inline_effective], + [if test $ac_cv_c_inline = no; then + gl_cv_c_inline_effective=no + else + dnl GCC defines __NO_INLINE__ if not optimizing or if -fno-inline is + dnl specified. + dnl Use AC_COMPILE_IFELSE here, not AC_EGREP_CPP, because the result + dnl depends on optimization flags, which can be in CFLAGS. + dnl (AC_EGREP_CPP looks only at the CPPFLAGS.) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], + [[#ifdef __NO_INLINE__ + #error "inline is not effective" + #endif]])], + [gl_cv_c_inline_effective=yes], + [gl_cv_c_inline_effective=no]) + fi + ]) + if test $gl_cv_c_inline_effective = yes; then + AC_DEFINE([HAVE_INLINE], [1], + [Define to 1 if the compiler supports one of the keywords + 'inline', '__inline__', '__inline' and effectively inlines + functions marked as such.]) + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/intlmacosx.m4 b/local/recipes/tools/diffutils/source/m4/intlmacosx.m4 new file mode 100644 index 0000000000..8a045f6a29 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/intlmacosx.m4 @@ -0,0 +1,56 @@ +# intlmacosx.m4 serial 5 (gettext-0.18.2) +dnl Copyright (C) 2004-2014 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Checks for special options needed on Mac OS X. +dnl Defines INTL_MACOSX_LIBS. +AC_DEFUN([gt_INTL_MACOSX], +[ + dnl Check for API introduced in Mac OS X 10.2. + AC_CACHE_CHECK([for CFPreferencesCopyAppValue], + [gt_cv_func_CFPreferencesCopyAppValue], + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <CoreFoundation/CFPreferences.h>]], + [[CFPreferencesCopyAppValue(NULL, NULL)]])], + [gt_cv_func_CFPreferencesCopyAppValue=yes], + [gt_cv_func_CFPreferencesCopyAppValue=no]) + LIBS="$gt_save_LIBS"]) + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], + [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) + fi + dnl Check for API introduced in Mac OS X 10.3. + AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <CoreFoundation/CFLocale.h>]], + [[CFLocaleCopyCurrent();]])], + [gt_cv_func_CFLocaleCopyCurrent=yes], + [gt_cv_func_CFLocaleCopyCurrent=no]) + LIBS="$gt_save_LIBS"]) + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], + [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + fi + AC_SUBST([INTL_MACOSX_LIBS]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/intmax_t.m4 b/local/recipes/tools/diffutils/source/m4/intmax_t.m4 new file mode 100644 index 0000000000..ff143e9d89 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/intmax_t.m4 @@ -0,0 +1,67 @@ +# intmax_t.m4 serial 8 +dnl Copyright (C) 1997-2004, 2006-2007, 2009-2017 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +AC_PREREQ([2.53]) + +# Define intmax_t to 'long' or 'long long' +# if it is not already defined in <stdint.h> or <inttypes.h>. + +AC_DEFUN([gl_AC_TYPE_INTMAX_T], +[ + dnl For simplicity, we assume that a header file defines 'intmax_t' if and + dnl only if it defines 'uintmax_t'. + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([gl_AC_HEADER_STDINT_H]) + if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + test $ac_cv_type_long_long_int = yes \ + && ac_type='long long' \ + || ac_type='long' + AC_DEFINE_UNQUOTED([intmax_t], [$ac_type], + [Define to long or long long if <inttypes.h> and <stdint.h> don't define.]) + else + AC_DEFINE([HAVE_INTMAX_T], [1], + [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) + fi +]) + +dnl An alternative would be to explicitly test for 'intmax_t'. + +AC_DEFUN([gt_AC_TYPE_INTMAX_T], +[ + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([gl_AC_HEADER_STDINT_H]) + AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <stddef.h> +#include <stdlib.h> +#if HAVE_STDINT_H_WITH_UINTMAX +#include <stdint.h> +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include <inttypes.h> +#endif + ]], + [[intmax_t x = -1; return !x;]])], + [gt_cv_c_intmax_t=yes], + [gt_cv_c_intmax_t=no])]) + if test $gt_cv_c_intmax_t = yes; then + AC_DEFINE([HAVE_INTMAX_T], [1], + [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) + else + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + test $ac_cv_type_long_long_int = yes \ + && ac_type='long long' \ + || ac_type='long' + AC_DEFINE_UNQUOTED([intmax_t], [$ac_type], + [Define to long or long long if <stdint.h> and <inttypes.h> don't define.]) + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/inttostr.m4 b/local/recipes/tools/diffutils/source/m4/inttostr.m4 new file mode 100644 index 0000000000..3120f959e5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/inttostr.m4 @@ -0,0 +1,32 @@ +#serial 8 +dnl Copyright (C) 2004-2006, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_INTTOSTR], +[ + gl_PREREQ_INTTOSTR + gl_PREREQ_IMAXTOSTR + gl_PREREQ_OFFTOSTR + gl_PREREQ_UMAXTOSTR + gl_PREREQ_UINTTOSTR +]) + +# Prerequisites of lib/inttostr.h. +AC_DEFUN([gl_PREREQ_INTTOSTR], [ + AC_REQUIRE([AC_TYPE_OFF_T]) + : +]) + +# Prerequisites of lib/imaxtostr.c. +AC_DEFUN([gl_PREREQ_IMAXTOSTR], [:]) + +# Prerequisites of lib/offtostr.c. +AC_DEFUN([gl_PREREQ_OFFTOSTR], [:]) + +# Prerequisites of lib/umaxtostr.c. +AC_DEFUN([gl_PREREQ_UMAXTOSTR], [:]) + +# Prerequisites of lib/uinttostr.c. +AC_DEFUN([gl_PREREQ_UINTTOSTR], [:]) diff --git a/local/recipes/tools/diffutils/source/m4/inttypes-pri.m4 b/local/recipes/tools/diffutils/source/m4/inttypes-pri.m4 new file mode 100644 index 0000000000..205578782f --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/inttypes-pri.m4 @@ -0,0 +1,42 @@ +# inttypes-pri.m4 serial 7 (gettext-0.18.2) +dnl Copyright (C) 1997-2002, 2006, 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +AC_PREREQ([2.53]) + +# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI* +# macros to non-string values. This is the case on AIX 4.3.3. + +AC_DEFUN([gt_INTTYPES_PRI], +[ + AC_CHECK_HEADERS([inttypes.h]) + if test $ac_cv_header_inttypes_h = yes; then + AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], + [gt_cv_inttypes_pri_broken], + [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <inttypes.h> +#ifdef PRId32 +char *p = PRId32; +#endif + ]], + [[]])], + [gt_cv_inttypes_pri_broken=no], + [gt_cv_inttypes_pri_broken=yes]) + ]) + fi + if test "$gt_cv_inttypes_pri_broken" = yes; then + AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1], + [Define if <inttypes.h> exists and defines unusable PRI* macros.]) + PRI_MACROS_BROKEN=1 + else + PRI_MACROS_BROKEN=0 + fi + AC_SUBST([PRI_MACROS_BROKEN]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/inttypes.m4 b/local/recipes/tools/diffutils/source/m4/inttypes.m4 new file mode 100644 index 0000000000..434a7ee2bc --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/inttypes.m4 @@ -0,0 +1,158 @@ +# inttypes.m4 serial 26 +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Derek Price, Bruno Haible. +dnl Test whether <inttypes.h> is supported or must be substituted. + +AC_DEFUN([gl_INTTYPES_H], +[ + AC_REQUIRE([gl_INTTYPES_INCOMPLETE]) + gl_INTTYPES_PRI_SCN +]) + +AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE], +[ + AC_REQUIRE([gl_STDINT_H]) + AC_CHECK_HEADERS_ONCE([inttypes.h]) + + dnl Override <inttypes.h> always, so that the portability warnings work. + AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) + gl_CHECK_NEXT_HEADERS([inttypes.h]) + + AC_REQUIRE([gl_MULTIARCH]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include <inttypes.h> + ]], [imaxabs imaxdiv strtoimax strtoumax]) +]) + +# Ensure that the PRI* and SCN* macros are defined appropriately. +AC_DEFUN([gl_INTTYPES_PRI_SCN], +[ + AC_REQUIRE([gt_INTTYPES_PRI]) + + PRIPTR_PREFIX= + if test -n "$STDINT_H"; then + dnl Using the gnulib <stdint.h>. It always defines intptr_t to 'long'. + PRIPTR_PREFIX='"l"' + else + dnl Using the system's <stdint.h>. + for glpfx in '' l ll I64; do + case $glpfx in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + I64) gltype1='__int64';; + esac + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include <stdint.h> + extern intptr_t foo; + extern $gltype1 foo;]])], + [PRIPTR_PREFIX='"'$glpfx'"']) + test -n "$PRIPTR_PREFIX" && break + done + fi + AC_SUBST([PRIPTR_PREFIX]) + + gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( + [INT32_MAX_LT_INTMAX_MAX], + [defined INT32_MAX && defined INTMAX_MAX], + [INT32_MAX < INTMAX_MAX], + [sizeof (int) < sizeof (long long int)]) + if test $APPLE_UNIVERSAL_BUILD = 0; then + gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( + [INT64_MAX_EQ_LONG_MAX], + [defined INT64_MAX], + [INT64_MAX == LONG_MAX], + [sizeof (long long int) == sizeof (long int)]) + else + INT64_MAX_EQ_LONG_MAX=-1 + fi + gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( + [UINT32_MAX_LT_UINTMAX_MAX], + [defined UINT32_MAX && defined UINTMAX_MAX], + [UINT32_MAX < UINTMAX_MAX], + [sizeof (unsigned int) < sizeof (unsigned long long int)]) + if test $APPLE_UNIVERSAL_BUILD = 0; then + gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( + [UINT64_MAX_EQ_ULONG_MAX], + [defined UINT64_MAX], + [UINT64_MAX == ULONG_MAX], + [sizeof (unsigned long long int) == sizeof (unsigned long int)]) + else + UINT64_MAX_EQ_ULONG_MAX=-1 + fi +]) + +# Define the symbol $1 to be 1 if the condition is true, 0 otherwise. +# If $2 is true, the condition is $3; otherwise if long long int is supported +# approximate the condition with $4; otherwise, assume the condition is false. +# The condition should work on all C99 platforms; the approximations should be +# good enough to work on all practical pre-C99 platforms. +# $2 is evaluated by the C preprocessor, $3 and $4 as compile-time constants. +AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION], +[ + AC_CACHE_CHECK([whether $3], + [gl_cv_test_$1], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include <limits.h> + #if HAVE_STDINT_H + #include <stdint.h> + #endif + + #if $2 + #define CONDITION ($3) + #elif HAVE_LONG_LONG_INT + #define CONDITION ($4) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1];]])], + [gl_cv_test_$1=yes], + [gl_cv_test_$1=no])]) + if test $gl_cv_test_$1 = yes; then + $1=1; + else + $1=0; + fi + AC_SUBST([$1]) +]) + +AC_DEFUN([gl_INTTYPES_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) +]) + +AC_DEFUN([gl_INTTYPES_H_DEFAULTS], +[ + GNULIB_IMAXABS=0; AC_SUBST([GNULIB_IMAXABS]) + GNULIB_IMAXDIV=0; AC_SUBST([GNULIB_IMAXDIV]) + GNULIB_STRTOIMAX=0; AC_SUBST([GNULIB_STRTOIMAX]) + GNULIB_STRTOUMAX=0; AC_SUBST([GNULIB_STRTOUMAX]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DECL_IMAXABS=1; AC_SUBST([HAVE_DECL_IMAXABS]) + HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV]) + HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX]) + HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX]) + REPLACE_STRTOIMAX=0; AC_SUBST([REPLACE_STRTOIMAX]) + REPLACE_STRTOUMAX=0; AC_SUBST([REPLACE_STRTOUMAX]) + INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX]) + INT64_MAX_EQ_LONG_MAX='defined _LP64'; AC_SUBST([INT64_MAX_EQ_LONG_MAX]) + PRI_MACROS_BROKEN=0; AC_SUBST([PRI_MACROS_BROKEN]) + PRIPTR_PREFIX=__PRIPTR_PREFIX; AC_SUBST([PRIPTR_PREFIX]) + UINT32_MAX_LT_UINTMAX_MAX=1; AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX]) + UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; AC_SUBST([UINT64_MAX_EQ_ULONG_MAX]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/inttypes_h.m4 b/local/recipes/tools/diffutils/source/m4/inttypes_h.m4 new file mode 100644 index 0000000000..9240305057 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/inttypes_h.m4 @@ -0,0 +1,29 @@ +# inttypes_h.m4 serial 10 +dnl Copyright (C) 1997-2004, 2006, 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists, +# doesn't clash with <sys/types.h>, and declares uintmax_t. + +AC_DEFUN([gl_AC_HEADER_INTTYPES_H], +[ + AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <sys/types.h> +#include <inttypes.h> + ]], + [[uintmax_t i = (uintmax_t) -1; return !i;]])], + [gl_cv_header_inttypes_h=yes], + [gl_cv_header_inttypes_h=no])]) + if test $gl_cv_header_inttypes_h = yes; then + AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1], + [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, + and declares uintmax_t. ]) + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/ioctl.m4 b/local/recipes/tools/diffutils/source/m4/ioctl.m4 new file mode 100644 index 0000000000..30209dd646 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/ioctl.m4 @@ -0,0 +1,41 @@ +# ioctl.m4 serial 4 +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_IOCTL], +[ + AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + HAVE_IOCTL=1 + if test "$ac_cv_header_winsock2_h" = yes; then + dnl Even if the 'socket' module is not used here, another part of the + dnl application may use it and pass file descriptors that refer to + dnl sockets to the ioctl() function. So enable the support for sockets. + HAVE_IOCTL=0 + else + AC_CHECK_FUNCS([ioctl]) + dnl On glibc systems, the second parameter is 'unsigned long int request', + dnl not 'int request'. We cannot simply cast the function pointer, but + dnl instead need a wrapper. + AC_CACHE_CHECK([for ioctl with POSIX signature], + [gl_cv_func_ioctl_posix_signature], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <sys/ioctl.h>]], + [[extern + #ifdef __cplusplus + "C" + #endif + int ioctl (int, int, ...); + ]]) + ], + [gl_cv_func_ioctl_posix_signature=yes], + [gl_cv_func_ioctl_posix_signature=no]) + ]) + if test $gl_cv_func_ioctl_posix_signature != yes; then + REPLACE_IOCTL=1 + fi + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/isblank.m4 b/local/recipes/tools/diffutils/source/m4/isblank.m4 new file mode 100644 index 0000000000..abbc338b26 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/isblank.m4 @@ -0,0 +1,17 @@ +# isblank.m4 serial 3 +dnl Copyright (C) 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_ISBLANK], +[ + dnl Persuade glibc <ctype.h> to declare isblank(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([gl_CTYPE_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([isblank]) + if test $ac_cv_func_isblank = no; then + HAVE_ISBLANK=0 + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/iswblank.m4 b/local/recipes/tools/diffutils/source/m4/iswblank.m4 new file mode 100644 index 0000000000..e9d6975e8d --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/iswblank.m4 @@ -0,0 +1,41 @@ +# iswblank.m4 serial 4 +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_ISWBLANK], +[ + AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) + AC_REQUIRE([gl_WCTYPE_H]) + dnl Persuade glibc <wctype.h> to declare iswblank(). + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_FUNCS_ONCE([iswblank]) + AC_CHECK_DECLS([iswblank], , , [[ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +#include <wctype.h> +]]) + if test $ac_cv_func_iswblank = no; then + HAVE_ISWBLANK=0 + if test $ac_cv_have_decl_iswblank = yes; then + REPLACE_ISWBLANK=1 + fi + fi + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + dnl Redefine all of iswcntrl, ..., towupper in <wctype.h>. + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + dnl Redefine only iswblank. + : + fi + fi + +]) diff --git a/local/recipes/tools/diffutils/source/m4/langinfo_h.m4 b/local/recipes/tools/diffutils/source/m4/langinfo_h.m4 new file mode 100644 index 0000000000..ea94b4ed2b --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/langinfo_h.m4 @@ -0,0 +1,105 @@ +# langinfo_h.m4 serial 7 +dnl Copyright (C) 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_LANGINFO_H], +[ + AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) + + dnl Persuade glibc-2.0.6 <langinfo.h> to define CODESET. + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + dnl <langinfo.h> is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([langinfo.h]) + + dnl Determine whether <langinfo.h> exists. It is missing on mingw and BeOS. + HAVE_LANGINFO_CODESET=0 + HAVE_LANGINFO_T_FMT_AMPM=0 + HAVE_LANGINFO_ERA=0 + HAVE_LANGINFO_YESEXPR=0 + AC_CHECK_HEADERS_ONCE([langinfo.h]) + if test $ac_cv_header_langinfo_h = yes; then + HAVE_LANGINFO_H=1 + dnl Determine what <langinfo.h> defines. CODESET and ERA etc. are missing + dnl on OpenBSD 3.8. T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3. + AC_CACHE_CHECK([whether langinfo.h defines CODESET], + [gl_cv_header_langinfo_codeset], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include <langinfo.h> +int a = CODESET; +]])], + [gl_cv_header_langinfo_codeset=yes], + [gl_cv_header_langinfo_codeset=no]) + ]) + if test $gl_cv_header_langinfo_codeset = yes; then + HAVE_LANGINFO_CODESET=1 + fi + AC_CACHE_CHECK([whether langinfo.h defines T_FMT_AMPM], + [gl_cv_header_langinfo_t_fmt_ampm], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include <langinfo.h> +int a = T_FMT_AMPM; +]])], + [gl_cv_header_langinfo_t_fmt_ampm=yes], + [gl_cv_header_langinfo_t_fmt_ampm=no]) + ]) + if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then + HAVE_LANGINFO_T_FMT_AMPM=1 + fi + AC_CACHE_CHECK([whether langinfo.h defines ERA], + [gl_cv_header_langinfo_era], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include <langinfo.h> +int a = ERA; +]])], + [gl_cv_header_langinfo_era=yes], + [gl_cv_header_langinfo_era=no]) + ]) + if test $gl_cv_header_langinfo_era = yes; then + HAVE_LANGINFO_ERA=1 + fi + AC_CACHE_CHECK([whether langinfo.h defines YESEXPR], + [gl_cv_header_langinfo_yesexpr], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include <langinfo.h> +int a = YESEXPR; +]])], + [gl_cv_header_langinfo_yesexpr=yes], + [gl_cv_header_langinfo_yesexpr=no]) + ]) + if test $gl_cv_header_langinfo_yesexpr = yes; then + HAVE_LANGINFO_YESEXPR=1 + fi + else + HAVE_LANGINFO_H=0 + fi + AC_SUBST([HAVE_LANGINFO_H]) + AC_SUBST([HAVE_LANGINFO_CODESET]) + AC_SUBST([HAVE_LANGINFO_T_FMT_AMPM]) + AC_SUBST([HAVE_LANGINFO_ERA]) + AC_SUBST([HAVE_LANGINFO_YESEXPR]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include <langinfo.h> + ]], [nl_langinfo]) +]) + +AC_DEFUN([gl_LANGINFO_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_LANGINFO_H_DEFAULTS], +[ + GNULIB_NL_LANGINFO=0; AC_SUBST([GNULIB_NL_LANGINFO]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_NL_LANGINFO=1; AC_SUBST([HAVE_NL_LANGINFO]) + REPLACE_NL_LANGINFO=0; AC_SUBST([REPLACE_NL_LANGINFO]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/largefile.m4 b/local/recipes/tools/diffutils/source/m4/largefile.m4 new file mode 100644 index 0000000000..edc1a9b41b --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/largefile.m4 @@ -0,0 +1,161 @@ +# Enable large files on systems where this is not the default. + +# Copyright 1992-1996, 1998-2017 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# The following implementation works around a problem in autoconf <= 2.69; +# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5, +# or configures them incorrectly in some cases. +m4_version_prereq([2.70], [] ,[ + +# _AC_SYS_LARGEFILE_TEST_INCLUDES +# ------------------------------- +m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES], +[@%:@include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]];[]dnl +]) + + +# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, +# CACHE-VAR, +# DESCRIPTION, +# PROLOGUE, [FUNCTION-BODY]) +# -------------------------------------------------------- +m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE], +[AC_CACHE_CHECK([for $1 value needed for large files], [$3], +[while :; do + m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])( + [AC_LANG_PROGRAM([$5], [$6])], + [$3=no; break]) + m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])( + [AC_LANG_PROGRAM([@%:@define $1 $2 +$5], [$6])], + [$3=$2; break]) + $3=unknown + break +done]) +case $$3 in #( + no | unknown) ;; + *) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]);; +esac +rm -rf conftest*[]dnl +])# _AC_SYS_LARGEFILE_MACRO_VALUE + + +# AC_SYS_LARGEFILE +# ---------------- +# By default, many hosts won't let programs access large files; +# one must use special compiler options to get large-file access to work. +# For more details about this brain damage please see: +# http://www.unix-systems.org/version2/whatsnew/lfs20mar.html +AC_DEFUN([AC_SYS_LARGEFILE], +[AC_ARG_ENABLE(largefile, + [ --disable-largefile omit support for large files]) +if test "$enable_largefile" != no; then + + AC_CACHE_CHECK([for special C compiler options needed for large files], + ac_cv_sys_largefile_CC, + [ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])]) + AC_COMPILE_IFELSE([], [break]) + CC="$CC -n32" + AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break]) + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi]) + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + _AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, + ac_cv_sys_file_offset_bits, + [Number of bits in a file offset, on hosts where this is settable.], + [_AC_SYS_LARGEFILE_TEST_INCLUDES]) + if test $ac_cv_sys_file_offset_bits = unknown; then + _AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, + ac_cv_sys_large_files, + [Define for large files, on AIX-style hosts.], + [_AC_SYS_LARGEFILE_TEST_INCLUDES]) + fi + + AC_DEFINE([_DARWIN_USE_64_BIT_INODE], [1], + [Enable large inode numbers on Mac OS X 10.5.]) +fi +])# AC_SYS_LARGEFILE +])# m4_version_prereq 2.70 + +# Enable large files on systems where this is implemented by Gnulib, not by the +# system headers. +# Set the variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE if Gnulib +# overrides ensure that off_t or 'struct size.st_size' are 64-bit, respectively. +AC_DEFUN([gl_LARGEFILE], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw*) + dnl Native Windows. + dnl mingw64 defines off_t to a 64-bit type already, if + dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE. + AC_CACHE_CHECK([for 64-bit off_t], [gl_cv_type_off_t_64], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <sys/types.h> + int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1]; + ]], + [[]])], + [gl_cv_type_off_t_64=yes], [gl_cv_type_off_t_64=no]) + ]) + if test $gl_cv_type_off_t_64 = no; then + WINDOWS_64_BIT_OFF_T=1 + else + WINDOWS_64_BIT_OFF_T=0 + fi + dnl Some mingw versions define, if _FILE_OFFSET_BITS=64, 'struct stat' + dnl to 'struct _stat32i64' or 'struct _stat64' (depending on + dnl _USE_32BIT_TIME_T), which has a 32-bit st_size member. + AC_CACHE_CHECK([for 64-bit st_size], [gl_cv_member_st_size_64], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <sys/types.h> + struct stat buf; + int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1]; + ]], + [[]])], + [gl_cv_member_st_size_64=yes], [gl_cv_member_st_size_64=no]) + ]) + if test $gl_cv_member_st_size_64 = no; then + WINDOWS_64_BIT_ST_SIZE=1 + else + WINDOWS_64_BIT_ST_SIZE=0 + fi + ;; + *) + dnl Nothing to do on gnulib's side. + dnl A 64-bit off_t is + dnl - already the default on Mac OS X, FreeBSD, NetBSD, OpenBSD, IRIX, + dnl OSF/1, Cygwin, + dnl - enabled by _FILE_OFFSET_BITS=64 (ensured by AC_SYS_LARGEFILE) on + dnl glibc, HP-UX, Solaris, + dnl - enabled by _LARGE_FILES=1 (ensured by AC_SYS_LARGEFILE) on AIX, + dnl - impossible to achieve on Minix 3.1.8. + WINDOWS_64_BIT_OFF_T=0 + WINDOWS_64_BIT_ST_SIZE=0 + ;; + esac +]) diff --git a/local/recipes/tools/diffutils/source/m4/lib-ld.m4 b/local/recipes/tools/diffutils/source/m4/lib-ld.m4 new file mode 100644 index 0000000000..8b8a26e8d5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/lib-ld.m4 @@ -0,0 +1,147 @@ +# lib-ld.m4 serial 7 +dnl Copyright (C) 1996-2003, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Subroutines of libtool.m4, +dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid +dnl collision with libtool.m4. + +dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. +AC_DEFUN([AC_LIB_PROG_LD_GNU], +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], +[# I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + acl_cv_prog_gnu_ld=yes + ;; +*) + acl_cv_prog_gnu_ld=no + ;; +esac]) +with_gnu_ld=$acl_cv_prog_gnu_ld +]) + +dnl From libtool-2.4. Sets the variable LD. +AC_DEFUN([AC_LIB_PROG_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld [default=no]])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +if test -n "$LD"; then + AC_MSG_CHECKING([for ld]) +elif test "$GCC" = yes; then + AC_MSG_CHECKING([for ld used by $CC]) +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +if test -n "$LD"; then + # Let the user override the test with a path. + : +else + AC_CACHE_VAL([acl_cv_path_LD], + [ + acl_cv_path_LD= # Final result of this test + ac_prog=ld # Program to search in $PATH + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + acl_output=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $acl_output in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` + while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do + acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` + done + # Got the pathname. No search in PATH is needed. + acl_cv_path_LD="$acl_output" + ac_prog= + ;; + "") + # If it fails, then pretend we aren't using GCC. + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac + fi + if test -n "$ac_prog"; then + # Search for $ac_prog in $PATH. + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$acl_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break + ;; + *) + test "$with_gnu_ld" != yes && break + ;; + esac + fi + done + IFS="$acl_save_ifs" + fi + case $host in + *-*-aix*) + AC_EGREP_CPP([yes], + [#if defined __powerpc64__ || defined _ARCH_PPC64 + yes + #endif + ], + [# The compiler produces 64-bit code. Add option '-b64' so that the + # linker groks 64-bit object files. + case "$acl_cv_path_LD " in + *" -b64 "*) ;; + *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;; + esac + ], []) + ;; + esac + ]) + LD="$acl_cv_path_LD" +fi +if test -n "$LD"; then + AC_MSG_RESULT([$LD]) +else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([no acceptable ld found in \$PATH]) +fi +AC_LIB_PROG_LD_GNU +]) diff --git a/local/recipes/tools/diffutils/source/m4/lib-link.m4 b/local/recipes/tools/diffutils/source/m4/lib-link.m4 new file mode 100644 index 0000000000..1ce9a5ab36 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/lib-link.m4 @@ -0,0 +1,777 @@ +# lib-link.m4 serial 26 (gettext-0.18.2) +dnl Copyright (C) 2001-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +AC_PREREQ([2.54]) + +dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and +dnl augments the CPPFLAGS variable. +dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname +dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. +AC_DEFUN([AC_LIB_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + pushdef([Name],[m4_translit([$1],[./+-], [____])]) + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + ac_cv_lib[]Name[]_libs="$LIB[]NAME" + ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" + ac_cv_lib[]Name[]_cppflags="$INC[]NAME" + ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" + ]) + LIB[]NAME="$ac_cv_lib[]Name[]_libs" + LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" + INC[]NAME="$ac_cv_lib[]Name[]_cppflags" + LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + AC_SUBST([LIB]NAME[_PREFIX]) + dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the + dnl results of this search when this library appears as a dependency. + HAVE_LIB[]NAME=yes + popdef([NAME]) + popdef([Name]) +]) + +dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message]) +dnl searches for libname and the libraries corresponding to explicit and +dnl implicit dependencies, together with the specified include files and +dnl the ability to compile and link the specified testcode. The missing-message +dnl defaults to 'no' and may contain additional hints for the user. +dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} +dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and +dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs +dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. +dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname +dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. +AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + pushdef([Name],[m4_translit([$1],[./+-], [____])]) + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + + dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + + dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, + dnl because if the user has installed lib[]Name and not disabled its use + dnl via --without-lib[]Name-prefix, he wants to use it. + ac_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + + AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ + ac_save_LIBS="$LIBS" + dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS, + dnl because these -l options might require -L options that are present in + dnl LIBS. -l options benefit only from the -L options listed before it. + dnl Otherwise, add it to the front of LIBS, because it may be a static + dnl library that depends on another static library that is present in LIBS. + dnl Static libraries benefit only from the static libraries listed after + dnl it. + case " $LIB[]NAME" in + *" -l"*) LIBS="$LIBS $LIB[]NAME" ;; + *) LIBS="$LIB[]NAME $LIBS" ;; + esac + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[$3]], [[$4]])], + [ac_cv_lib[]Name=yes], + [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) + LIBS="$ac_save_LIBS" + ]) + if test "$ac_cv_lib[]Name" = yes; then + HAVE_LIB[]NAME=yes + AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.]) + AC_MSG_CHECKING([how to link with lib[]$1]) + AC_MSG_RESULT([$LIB[]NAME]) + else + HAVE_LIB[]NAME=no + dnl If $LIB[]NAME didn't lead to a usable library, we don't need + dnl $INC[]NAME either. + CPPFLAGS="$ac_save_CPPFLAGS" + LIB[]NAME= + LTLIB[]NAME= + LIB[]NAME[]_PREFIX= + fi + AC_SUBST([HAVE_LIB]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + AC_SUBST([LIB]NAME[_PREFIX]) + popdef([NAME]) + popdef([Name]) +]) + +dnl Determine the platform dependent parameters needed to use rpath: +dnl acl_libext, +dnl acl_shlibext, +dnl acl_libname_spec, +dnl acl_library_names_spec, +dnl acl_hardcode_libdir_flag_spec, +dnl acl_hardcode_libdir_separator, +dnl acl_hardcode_direct, +dnl acl_hardcode_minus_L. +AC_DEFUN([AC_LIB_RPATH], +[ + dnl Tell automake >= 1.10 to complain if config.rpath is missing. + m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) + AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS + AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld + AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host + AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir + AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ]) + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + dnl Determine whether the user wants rpath handling at all. + AC_ARG_ENABLE([rpath], + [ --disable-rpath do not hardcode runtime library paths], + :, enable_rpath=yes) +]) + +dnl AC_LIB_FROMPACKAGE(name, package) +dnl declares that libname comes from the given package. The configure file +dnl will then not have a --with-libname-prefix option but a +dnl --with-package-prefix option. Several libraries can come from the same +dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar +dnl macro call that searches for libname. +AC_DEFUN([AC_LIB_FROMPACKAGE], +[ + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + define([acl_frompackage_]NAME, [$2]) + popdef([NAME]) + pushdef([PACK],[$2]) + pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + define([acl_libsinpackage_]PACKUP, + m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) + popdef([PACKUP]) + popdef([PACK]) +]) + +dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. +dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found +dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. +AC_DEFUN([AC_LIB_LINKFLAGS_BODY], +[ + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) + pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) + dnl Autoconf >= 2.61 supports dots in --with options. + pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_ARG_WITH(P_A_C_K[-prefix], +[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib + --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi +]) + dnl Search the library and its dependencies in $additional_libdir and + dnl $LDFLAGS. Using breadth-first-seach. + LIB[]NAME= + LTLIB[]NAME= + INC[]NAME= + LIB[]NAME[]_PREFIX= + dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been + dnl computed. So it has to be reset here. + HAVE_LIB[]NAME= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='$1 $2' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + dnl See if it was already located by an earlier AC_LIB_LINKFLAGS + dnl or AC_LIB_HAVE_LINKFLAGS call. + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" + else + dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined + dnl that this library doesn't exist. So just drop it. + : + fi + else + dnl Search the library lib$name in $additional_libdir and $LDFLAGS + dnl and the already constructed $LIBNAME/$LTLIBNAME. + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + dnl The same code as in the loop below: + dnl First look for a shared library. + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + dnl Then look for a static library. + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + dnl First look for a shared library. + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + dnl Then look for a static library. + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + dnl Found the library. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + dnl Linking with a shared library. We attempt to hardcode its + dnl directory into the executable's runpath, unless it's the + dnl standard /usr/lib. + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + dnl No hardcoding is needed. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + dnl The hardcoding into $LIBNAME is system dependent. + if test "$acl_hardcode_direct" = yes; then + dnl Using DIR/libNAME.so during linking hardcodes DIR into the + dnl resulting binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + dnl Rely on "-L$found_dir". + dnl But don't add it if it's already contained in the LDFLAGS + dnl or the already constructed $LIBNAME + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH + dnl here, because this doesn't fit in flags passed to the + dnl compiler. So give up. No hardcoding. This affects only + dnl very old systems. + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + dnl Linking with a static library. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" + else + dnl We shouldn't come here, but anyway it's good to have a + dnl fallback. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" + fi + fi + dnl Assume the include files are nearby. + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = '$1'; then + LIB[]NAME[]_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = '$1'; then + LIB[]NAME[]_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + dnl Potentially add $additional_includedir to $INCNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's /usr/local/include and we are using GCC on Linux, + dnl 3. if it's already present in $CPPFLAGS or the already + dnl constructed $INCNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INC[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $INCNAME. + INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + dnl Look for dependencies. + if test -n "$found_la"; then + dnl Read the .la file. It defines the variables + dnl dlname, library_names, old_library, dependency_libs, current, + dnl age, revision, installed, dlopen, dlpreopen, libdir. + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + dnl We use only dependency_libs. + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's /usr/local/lib and we are using GCC on Linux, + dnl 3. if it's already present in $LDFLAGS or the already + dnl constructed $LIBNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LIBNAME. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LTLIBNAME. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + dnl Handle this in the next round. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + dnl Handle this in the next round. Throw away the .la's + dnl directory; it is already contained in a preceding -L + dnl option. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + dnl Most likely an immediate library name. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" + ;; + esac + done + fi + else + dnl Didn't find the library; assume it is in the system directories + dnl known to the linker and runtime loader. (All the system + dnl directories known to the linker should also be known to the + dnl runtime loader, otherwise the system is severely misconfigured.) + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user must + dnl pass all path elements in one option. We can arrange that for a + dnl single library, but not when more than one $LIBNAMEs are used. + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + else + dnl The -rpath options are cumulative. + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + dnl When using libtool, the option that works for both libraries and + dnl executables is -R. The -R options are cumulative. + for found_dir in $ltrpathdirs; do + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" + done + fi + popdef([P_A_C_K]) + popdef([PACKLIBS]) + popdef([PACKUP]) + popdef([PACK]) + popdef([NAME]) +]) + +dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, +dnl unless already present in VAR. +dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes +dnl contains two or three consecutive elements that belong together. +AC_DEFUN([AC_LIB_APPENDTOVAR], +[ + for element in [$2]; do + haveit= + for x in $[$1]; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + [$1]="${[$1]}${[$1]:+ }$element" + fi + done +]) + +dnl For those cases where a variable contains several -L and -l options +dnl referring to unknown libraries and directories, this macro determines the +dnl necessary additional linker options for the runtime path. +dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) +dnl sets LDADDVAR to linker options needed together with LIBSVALUE. +dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, +dnl otherwise linking without libtool is assumed. +AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], +[ + AC_REQUIRE([AC_LIB_RPATH]) + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + $1= + if test "$enable_rpath" != no; then + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode directories into the resulting + dnl binary. + rpathdirs= + next= + for opt in $2; do + if test -n "$next"; then + dir="$next" + dnl No need to hardcode the standard /usr/lib. + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2"; then + rpathdirs="$rpathdirs $dir" + fi + next= + else + case $opt in + -L) next=yes ;; + -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` + dnl No need to hardcode the standard /usr/lib. + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2"; then + rpathdirs="$rpathdirs $dir" + fi + next= ;; + *) next= ;; + esac + fi + done + if test "X$rpathdirs" != "X"; then + if test -n ""$3""; then + dnl libtool is used for linking. Use -R options. + for dir in $rpathdirs; do + $1="${$1}${$1:+ }-R$dir" + done + else + dnl The linker is used for linking directly. + if test -n "$acl_hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user + dnl must pass all path elements in one option. + alldirs= + for dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + $1="$flag" + else + dnl The -rpath options are cumulative. + for dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + $1="${$1}${$1:+ }$flag" + done + fi + fi + fi + fi + fi + AC_SUBST([$1]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/lib-prefix.m4 b/local/recipes/tools/diffutils/source/m4/lib-prefix.m4 new file mode 100644 index 0000000000..a5d56c8d78 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/lib-prefix.m4 @@ -0,0 +1,241 @@ +# lib-prefix.m4 serial 8 +dnl Copyright (C) 2001-2005, 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and +dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't +dnl require excessive bracketing. +ifdef([AC_HELP_STRING], +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], +[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) + +dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed +dnl to access previously installed libraries. The basic assumption is that +dnl a user will want packages to use other packages he previously installed +dnl with the same --prefix option. +dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate +dnl libraries, but is otherwise very convenient. +AC_DEFUN([AC_LIB_PREFIX], +[ + AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib-prefix], +[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib + --without-lib-prefix don't search for libraries in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi +]) + if test $use_additional = yes; then + dnl Potentially add $additional_includedir to $CPPFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's already present in $CPPFLAGS, + dnl 3. if it's /usr/local/include and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + for x in $CPPFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $CPPFLAGS. + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" + fi + fi + fi + fi + dnl Potentially add $additional_libdir to $LDFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's already present in $LDFLAGS, + dnl 3. if it's /usr/local/lib and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + for x in $LDFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LDFLAGS. + LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" + fi + fi + fi + fi + fi +]) + +dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, +dnl acl_final_exec_prefix, containing the values to which $prefix and +dnl $exec_prefix will expand at the end of the configure script. +AC_DEFUN([AC_LIB_PREPARE_PREFIX], +[ + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" +]) + +dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the +dnl variables prefix and exec_prefix bound to the values they will have +dnl at the end of the configure script. +AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], +[ + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + $1 + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" +]) + +dnl AC_LIB_PREPARE_MULTILIB creates +dnl - a variable acl_libdirstem, containing the basename of the libdir, either +dnl "lib" or "lib64" or "lib/64", +dnl - a variable acl_libdirstem2, as a secondary possible value for +dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or +dnl "lib/amd64". +AC_DEFUN([AC_LIB_PREPARE_MULTILIB], +[ + dnl There is no formal standard regarding lib and lib64. + dnl On glibc systems, the current practice is that on a system supporting + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under + dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine + dnl the compiler's default mode by looking at the compiler's library search + dnl path. If at least one of its elements ends in /lib64 or points to a + dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. + dnl Otherwise we use the default, namely "lib". + dnl On Solaris systems, the current practice is that on a system supporting + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under + dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or + dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. + AC_REQUIRE([AC_CANONICAL_HOST]) + dnl Allow the user to override the result by setting acl_cv_libdirstems. + AC_CACHE_CHECK([for the common suffixes of directories in the library search path], + [acl_cv_libdirstems], + [acl_libdirstem=lib + acl_libdirstem2= + case "$host_os" in + solaris*) + dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment + dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>. + dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." + dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the + dnl symlink is missing, so we set acl_libdirstem2 too. + AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], + [AC_EGREP_CPP([sixtyfour bits], [ +#ifdef _LP64 +sixtyfour bits +#endif + ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) + ]) + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; + esac + fi + ;; + *) + dnl The result is a property of the system. However, non-system + dnl compilers sometimes have odd library search paths. Therefore + dnl prefer asking /usr/bin/gcc, if available, rather than $CC. + searchpath=`(if test -f /usr/bin/gcc \ + && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \ + LC_ALL=C /usr/bin/gcc -print-search-dirs; \ + else \ + LC_ALL=C $CC -print-search-dirs; \ + fi) 2>/dev/null \ + | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2" + ]) + # Decompose acl_cv_libdirstems into acl_libdirstem and acl_libdirstem2. + acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` + acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e '/,/s/.*,//'` +]) diff --git a/local/recipes/tools/diffutils/source/m4/libsigsegv.m4 b/local/recipes/tools/diffutils/source/m4/libsigsegv.m4 new file mode 100644 index 0000000000..cb9d4d5888 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/libsigsegv.m4 @@ -0,0 +1,16 @@ +# libsigsegv.m4 serial 4 +dnl Copyright (C) 2002-2003, 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible, Sam Steingold. + +AC_DEFUN([gl_LIBSIGSEGV], +[ + AC_LIB_HAVE_LINKFLAGS([sigsegv], [], + [#include <sigsegv.h>], [sigsegv_deinstall_handler();], + [no, consider installing GNU libsigsegv]) + dnl Some other autoconf macros and clisp's configure use this variable. + gl_cv_lib_sigsegv="$ac_cv_libsigsegv" +]) diff --git a/local/recipes/tools/diffutils/source/m4/libunistring-base.m4 b/local/recipes/tools/diffutils/source/m4/libunistring-base.m4 new file mode 100644 index 0000000000..ee648f272a --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/libunistring-base.m4 @@ -0,0 +1,141 @@ +# libunistring-base.m4 serial 5 +dnl Copyright (C) 2010-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paolo Bonzini and Bruno Haible. + +dnl gl_LIBUNISTRING_MODULE([VERSION], [Module]) +dnl Declares that the source files of Module should be compiled, unless we +dnl are linking with libunistring and its version is >= the given VERSION. +dnl Defines an automake conditional LIBUNISTRING_COMPILE_$MODULE that is +dnl true if the source files of Module should be compiled. +dnl This macro is to be used for public libunistring API, not for +dnl undocumented API. +dnl +dnl You have to bump the VERSION argument to the next projected version +dnl number each time you make a change that affects the behaviour of the +dnl functions defined in Module (even if the sources of Module itself do not +dnl change). + +AC_DEFUN([gl_LIBUNISTRING_MODULE], +[ + AC_REQUIRE([gl_LIBUNISTRING_LIB_PREPARE]) + dnl Use the variables HAVE_LIBUNISTRING, LIBUNISTRING_VERSION from + dnl gl_LIBUNISTRING_CORE if that macro has been run. + AM_CONDITIONAL(AS_TR_CPP([LIBUNISTRING_COMPILE_$2]), + [gl_LIBUNISTRING_VERSION_CMP([$1])]) +]) + +dnl gl_LIBUNISTRING_LIBHEADER([VERSION], [HeaderFile]) +dnl Declares that HeaderFile should be created, unless we are linking +dnl with libunistring and its version is >= the given VERSION. +dnl HeaderFile should be relative to the lib directory and end in '.h'. +dnl Prepares for substituting LIBUNISTRING_HEADERFILE (to HeaderFile or empty). +dnl +dnl When we are linking with the already installed libunistring and its version +dnl is < VERSION, we create HeaderFile here, because we may compile functions +dnl (via gl_LIBUNISTRING_MODULE above) that are not contained in the installed +dnl version. +dnl When we are linking with the already installed libunistring and its version +dnl is > VERSION, we don't create HeaderFile here: it could cause compilation +dnl errors in other libunistring header files if some types are missing. +dnl +dnl You have to bump the VERSION argument to the next projected version +dnl number each time you make a non-comment change to the HeaderFile. + +AC_DEFUN([gl_LIBUNISTRING_LIBHEADER], +[ + AC_REQUIRE([gl_LIBUNISTRING_LIB_PREPARE]) + dnl Use the variables HAVE_LIBUNISTRING, LIBUNISTRING_VERSION from + dnl gl_LIBUNISTRING_CORE if that macro has been run. + if gl_LIBUNISTRING_VERSION_CMP([$1]); then + LIBUNISTRING_[]AS_TR_CPP([$2])='$2' + else + LIBUNISTRING_[]AS_TR_CPP([$2])= + fi + AC_SUBST([LIBUNISTRING_]AS_TR_CPP([$2])) +]) + +dnl Miscellaneous preparations/initializations. + +AC_DEFUN([gl_LIBUNISTRING_LIB_PREPARE], +[ + dnl Ensure that HAVE_LIBUNISTRING is fully determined at this point. + m4_ifdef([gl_LIBUNISTRING], [AC_REQUIRE([gl_LIBUNISTRING])]) + + AC_REQUIRE([AC_PROG_AWK]) + +dnl Sed expressions to extract the parts of a version number. +changequote(,) +gl_libunistring_sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +changequote([,]) + + if test "$HAVE_LIBUNISTRING" = yes; then + LIBUNISTRING_VERSION_MAJOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_major"` + LIBUNISTRING_VERSION_MINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_minor"` + LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_subminor"` + fi +]) + +dnl gl_LIBUNISTRING_VERSION_CMP([VERSION]) +dnl Expands to a shell statement that evaluates to true if LIBUNISTRING_VERSION +dnl is less than the VERSION argument. +AC_DEFUN([gl_LIBUNISTRING_VERSION_CMP], +[ { test "$HAVE_LIBUNISTRING" != yes \ + || { + dnl AS_LITERAL_IF exists and works fine since autoconf-2.59 at least. + AS_LITERAL_IF([$1], + [dnl This is the optimized variant, that assumes the argument is a literal: + m4_pushdef([requested_version_major], + [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^\([0-9]*\).*], [\1]), [])]) + m4_pushdef([requested_version_minor], + [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^[0-9]*[.]\([0-9]*\).*], [\1]), [$1])]) + m4_pushdef([requested_version_subminor], + [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^[0-9]*[.][0-9]*[.]\([0-9]*\).*], [\1]), [$1])]) + test $LIBUNISTRING_VERSION_MAJOR -lt requested_version_major \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq requested_version_major \ + && { test $LIBUNISTRING_VERSION_MINOR -lt requested_version_minor \ + || { test $LIBUNISTRING_VERSION_MINOR -eq requested_version_minor \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt requested_version_subminor + } + } + } + m4_popdef([requested_version_subminor]) + m4_popdef([requested_version_minor]) + m4_popdef([requested_version_major]) + ], + [dnl This is the unoptimized variant: + requested_version_major=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_major"` + requested_version_minor=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_minor"` + requested_version_subminor=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_subminor"` + test $LIBUNISTRING_VERSION_MAJOR -lt $requested_version_major \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq $requested_version_major \ + && { test $LIBUNISTRING_VERSION_MINOR -lt $requested_version_minor \ + || { test $LIBUNISTRING_VERSION_MINOR -eq $requested_version_minor \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt $requested_version_subminor + } + } + } + ]) + } + }]) + +dnl gl_LIBUNISTRING_ARG_OR_ZERO([ARG], [ORIG]) expands to ARG if it is not the +dnl same as ORIG, otherwise to 0. +m4_define([gl_LIBUNISTRING_ARG_OR_ZERO], [m4_if([$1], [$2], [0], [$1])]) diff --git a/local/recipes/tools/diffutils/source/m4/limits-h.m4 b/local/recipes/tools/diffutils/source/m4/limits-h.m4 new file mode 100644 index 0000000000..443f91b4dc --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/limits-h.m4 @@ -0,0 +1,31 @@ +dnl Check whether limits.h has needed features. + +dnl Copyright 2016-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +AC_DEFUN_ONCE([gl_LIMITS_H], +[ + gl_CHECK_NEXT_HEADERS([limits.h]) + + AC_CACHE_CHECK([whether limits.h has ULLONG_WIDTH etc.], + [gl_cv_header_limits_width], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include <limits.h> + int ullw = ULLONG_WIDTH;]])], + [gl_cv_header_limits_width=yes], + [gl_cv_header_limits_width=no])]) + if test "$gl_cv_header_limits_width" = yes; then + LIMITS_H= + else + LIMITS_H=limits.h + fi + AC_SUBST([LIMITS_H]) + AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/localcharset.m4 b/local/recipes/tools/diffutils/source/m4/localcharset.m4 new file mode 100644 index 0000000000..0c1ff38688 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/localcharset.m4 @@ -0,0 +1,17 @@ +# localcharset.m4 serial 7 +dnl Copyright (C) 2002, 2004, 2006, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_LOCALCHARSET], +[ + dnl Prerequisites of lib/localcharset.c. + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_REQUIRE([gl_FCNTL_O_FLAGS]) + AC_CHECK_DECLS_ONCE([getc_unlocked]) + + dnl Prerequisites of the lib/Makefile.am snippet. + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_GLIBC21]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/locale-fr.m4 b/local/recipes/tools/diffutils/source/m4/locale-fr.m4 new file mode 100644 index 0000000000..93d3da7d72 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/locale-fr.m4 @@ -0,0 +1,250 @@ +# locale-fr.m4 serial 17 +dnl Copyright (C) 2003, 2005-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +dnl Determine the name of a french locale with traditional encoding. +AC_DEFUN([gt_LOCALE_FR], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [ + AC_LANG_CONFTEST([AC_LANG_SOURCE([ +changequote(,)dnl +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ]) + LOCALE_FR=$gt_cv_locale_fr + AC_SUBST([LOCALE_FR]) +]) + +dnl Determine the name of a french locale with UTF-8 encoding. +AC_DEFUN([gt_LOCALE_FR_UTF8], +[ + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [ + AC_LANG_CONFTEST([AC_LANG_SOURCE([ +changequote(,)dnl +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ]) + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + AC_SUBST([LOCALE_FR_UTF8]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/locale-ja.m4 b/local/recipes/tools/diffutils/source/m4/locale-ja.m4 new file mode 100644 index 0000000000..c1d1154b9c --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/locale-ja.m4 @@ -0,0 +1,136 @@ +# locale-ja.m4 serial 12 +dnl Copyright (C) 2003, 2005-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +dnl Determine the name of a japanese locale with EUC-JP encoding. +AC_DEFUN([gt_LOCALE_JA], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_CACHE_CHECK([for a traditional japanese locale], [gt_cv_locale_ja], [ + AC_LANG_CONFTEST([AC_LANG_SOURCE([ +changequote(,)dnl +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ]) + LOCALE_JA=$gt_cv_locale_ja + AC_SUBST([LOCALE_JA]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/locale-tr.m4 b/local/recipes/tools/diffutils/source/m4/locale-tr.m4 new file mode 100644 index 0000000000..06e2f6ec3e --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/locale-tr.m4 @@ -0,0 +1,127 @@ +# locale-tr.m4 serial 10 +dnl Copyright (C) 2003, 2005-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +dnl Determine the name of a turkish locale with UTF-8 encoding. +AC_DEFUN([gt_LOCALE_TR_UTF8], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_CACHE_CHECK([for a turkish Unicode locale], [gt_cv_locale_tr_utf8], [ + AC_LANG_CONFTEST([AC_LANG_SOURCE([ +changequote(,)dnl +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. But BeOS does not + implement the Turkish upper-/lowercase mappings. Therefore, let this + program return 1 on BeOS. */ + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the eighth month, the second + character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f) + return 1; + /* Check whether the upper-/lowercase mappings are as expected for + Turkish. */ + if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i' + || towupper(0x0131) != 'I' || towlower ('I') != 0x0131) + return 1; + return 0; +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=Turkish_Turkey.65001 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr.UTF-8 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + fi + fi + ;; + esac + else + gt_cv_locale_tr_utf8=none + fi + rm -fr conftest* + ]) + LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8 + AC_SUBST([LOCALE_TR_UTF8]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/locale-zh.m4 b/local/recipes/tools/diffutils/source/m4/locale-zh.m4 new file mode 100644 index 0000000000..14594182c7 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/locale-zh.m4 @@ -0,0 +1,130 @@ +# locale-zh.m4 serial 12 +dnl Copyright (C) 2003, 2005-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +dnl Determine the name of a chinese locale with GB18030 encoding. +AC_DEFUN([gt_LOCALE_ZH_CN], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_CACHE_CHECK([for a transitional chinese locale], [gt_cv_locale_zh_CN], [ + AC_LANG_CONFTEST([AC_LANG_SOURCE([ +changequote(,)dnl +#include <locale.h> +#include <stdlib.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ]) + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + AC_SUBST([LOCALE_ZH_CN]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/locale_h.m4 b/local/recipes/tools/diffutils/source/m4/locale_h.m4 new file mode 100644 index 0000000000..7426a6528b --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/locale_h.m4 @@ -0,0 +1,122 @@ +# locale_h.m4 serial 19 +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_LOCALE_H], +[ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) + + dnl Persuade glibc <locale.h> to define locale_t and the int_p_*, int_n_* + dnl members of 'struct lconv'. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + dnl If <stddef.h> is replaced, then <locale.h> must also be replaced. + AC_REQUIRE([gl_STDDEF_H]) + + dnl Solaris 11 2011-11 defines the int_p_*, int_n_* members of 'struct lconv' + dnl only if _LCONV_C99 is defined. + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + solaris*) + AC_DEFINE([_LCONV_C99], [1], [Define to 1 on Solaris.]) + ;; + esac + + AC_CACHE_CHECK([whether locale.h conforms to POSIX:2001], + [gl_cv_header_locale_h_posix2001], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <locale.h> + int x = LC_MESSAGES; + int y = sizeof (((struct lconv *) 0)->decimal_point);]], + [[]])], + [gl_cv_header_locale_h_posix2001=yes], + [gl_cv_header_locale_h_posix2001=no])]) + + dnl Check for <xlocale.h>. + AC_CHECK_HEADERS_ONCE([xlocale.h]) + if test $ac_cv_header_xlocale_h = yes; then + HAVE_XLOCALE_H=1 + dnl Check whether use of locale_t requires inclusion of <xlocale.h>, + dnl e.g. on Mac OS X 10.5. If <locale.h> does not define locale_t by + dnl itself, we assume that <xlocale.h> will do so. + AC_CACHE_CHECK([whether locale.h defines locale_t], + [gl_cv_header_locale_has_locale_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <locale.h> + locale_t x;]], + [[]])], + [gl_cv_header_locale_has_locale_t=yes], + [gl_cv_header_locale_has_locale_t=no]) + ]) + if test $gl_cv_header_locale_has_locale_t = yes; then + gl_cv_header_locale_h_needs_xlocale_h=no + else + gl_cv_header_locale_h_needs_xlocale_h=yes + fi + else + HAVE_XLOCALE_H=0 + gl_cv_header_locale_h_needs_xlocale_h=no + fi + AC_SUBST([HAVE_XLOCALE_H]) + + dnl Check whether 'struct lconv' is complete. + dnl Bionic libc's 'struct lconv' is just a dummy. + dnl On OpenBSD 4.9, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin 1.5.x, + dnl mingw, MSVC 9, it lacks the int_p_* and int_n_* members. + AC_CACHE_CHECK([whether struct lconv is properly defined], + [gl_cv_sys_struct_lconv_ok], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <locale.h> + struct lconv l; + int x = sizeof (l.decimal_point); + int y = sizeof (l.int_p_cs_precedes);]], + [[]])], + [gl_cv_sys_struct_lconv_ok=yes], + [gl_cv_sys_struct_lconv_ok=no]) + ]) + if test $gl_cv_sys_struct_lconv_ok = no; then + REPLACE_STRUCT_LCONV=1 + fi + + dnl <locale.h> is always overridden, because of GNULIB_POSIXCHECK. + gl_NEXT_HEADERS([locale.h]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include <locale.h> +/* Some systems provide declarations in a non-standard header. */ +#if HAVE_XLOCALE_H +# include <xlocale.h> +#endif + ]], + [setlocale duplocale]) +]) + +AC_DEFUN([gl_LOCALE_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_LOCALE_H_DEFAULTS], +[ + GNULIB_LOCALECONV=0; AC_SUBST([GNULIB_LOCALECONV]) + GNULIB_SETLOCALE=0; AC_SUBST([GNULIB_SETLOCALE]) + GNULIB_DUPLOCALE=0; AC_SUBST([GNULIB_DUPLOCALE]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE]) + REPLACE_LOCALECONV=0; AC_SUBST([REPLACE_LOCALECONV]) + REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE]) + REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE]) + REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/localeconv.m4 b/local/recipes/tools/diffutils/source/m4/localeconv.m4 new file mode 100644 index 0000000000..c287aa526e --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/localeconv.m4 @@ -0,0 +1,22 @@ +# localeconv.m4 serial 1 +dnl Copyright (C) 2012-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_LOCALECONV], +[ + AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) + AC_REQUIRE([gl_LOCALE_H]) + + if test $REPLACE_STRUCT_LCONV = 1; then + REPLACE_LOCALECONV=1 + fi +]) + +# Prerequisites of lib/localeconv.c. +AC_DEFUN([gl_PREREQ_LOCALECONV], +[ + AC_CHECK_MEMBERS([struct lconv.decimal_point], [], [], + [[#include <locale.h>]]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/localtime-buffer.m4 b/local/recipes/tools/diffutils/source/m4/localtime-buffer.m4 new file mode 100644 index 0000000000..3965b5d9f2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/localtime-buffer.m4 @@ -0,0 +1,21 @@ +# localtime-buffer.m4 serial 1 +dnl Copyright (C) 2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_LOCALTIME_BUFFER_DEFAULTS], +[ + NEED_LOCALTIME_BUFFER=0 +]) + +dnl Macro invoked from other modules, to signal that the compilation of +dnl module 'localtime-buffer' is needed. +AC_DEFUN([gl_LOCALTIME_BUFFER_NEEDED], +[ + AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + NEED_LOCALTIME_BUFFER=1 + REPLACE_GMTIME=1 + REPLACE_LOCALTIME=1 +]) diff --git a/local/recipes/tools/diffutils/source/m4/longlong.m4 b/local/recipes/tools/diffutils/source/m4/longlong.m4 new file mode 100644 index 0000000000..9a3294bc2c --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/longlong.m4 @@ -0,0 +1,113 @@ +# longlong.m4 serial 17 +dnl Copyright (C) 1999-2007, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +# Define HAVE_LONG_LONG_INT if 'long long int' works. +# This fixes a bug in Autoconf 2.61, and can be faster +# than what's in Autoconf 2.62 through 2.68. + +# Note: If the type 'long long int' exists but is only 32 bits large +# (as on some very old compilers), HAVE_LONG_LONG_INT will not be +# defined. In this case you can treat 'long long int' like 'long int'. + +AC_DEFUN([AC_TYPE_LONG_LONG_INT], +[ + AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) + AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], + [ac_cv_type_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_long_long_int = yes; then + dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. + dnl If cross compiling, assume the bug is not important, since + dnl nobody cross compiles for this platform as far as we know. + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[@%:@include <limits.h> + @%:@ifndef LLONG_MAX + @%:@ define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + @%:@ define LLONG_MAX (HALF - 1 + HALF) + @%:@endif]], + [[long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0;]])], + [], + [ac_cv_type_long_long_int=no], + [:]) + fi + fi]) + if test $ac_cv_type_long_long_int = yes; then + AC_DEFINE([HAVE_LONG_LONG_INT], [1], + [Define to 1 if the system has the type 'long long int'.]) + fi +]) + +# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. +# This fixes a bug in Autoconf 2.61, and can be faster +# than what's in Autoconf 2.62 through 2.68. + +# Note: If the type 'unsigned long long int' exists but is only 32 bits +# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT +# will not be defined. In this case you can treat 'unsigned long long int' +# like 'unsigned long int'. + +AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], +[ + AC_CACHE_CHECK([for unsigned long long int], + [ac_cv_type_unsigned_long_long_int], + [ac_cv_type_unsigned_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + AC_LINK_IFELSE( + [_AC_TYPE_LONG_LONG_SNIPPET], + [], + [ac_cv_type_unsigned_long_long_int=no]) + fi]) + if test $ac_cv_type_unsigned_long_long_int = yes; then + AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], + [Define to 1 if the system has the type 'unsigned long long int'.]) + fi +]) + +# Expands to a C program that can be used to test for simultaneous support +# of 'long long' and 'unsigned long long'. We don't want to say that +# 'long long' is available if 'unsigned long long' is not, or vice versa, +# because too many programs rely on the symmetry between signed and unsigned +# integer types (excluding 'bool'). +AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET], +[ + AC_LANG_PROGRAM( + [[/* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63;]], + [[/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull));]]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/lstat.m4 b/local/recipes/tools/diffutils/source/m4/lstat.m4 new file mode 100644 index 0000000000..953c117d80 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/lstat.m4 @@ -0,0 +1,71 @@ +# serial 27 + +# Copyright (C) 1997-2001, 2003-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +dnl From Jim Meyering. + +AC_DEFUN([gl_FUNC_LSTAT], +[ + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + dnl If lstat does not exist, the replacement <sys/stat.h> does + dnl "#define lstat stat", and lstat.c is a no-op. + AC_CHECK_FUNCS_ONCE([lstat]) + if test $ac_cv_func_lstat = yes; then + AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *no) + REPLACE_LSTAT=1 + ;; + esac + else + HAVE_LSTAT=0 + fi +]) + +# Prerequisites of lib/lstat.c. +AC_DEFUN([gl_PREREQ_LSTAT], [:]) + +AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK], +[ + dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it + dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ. + AC_CACHE_CHECK([whether lstat correctly handles trailing slash], + [gl_cv_func_lstat_dereferences_slashed_symlink], + [rm -f conftest.sym conftest.file + echo >conftest.file + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [AC_INCLUDES_DEFAULT], + [[struct stat sbuf; + if (symlink ("conftest.file", "conftest.sym") != 0) + return 1; + /* Linux will dereference the symlink and fail, as required by + POSIX. That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + ]])], + [gl_cv_func_lstat_dereferences_slashed_symlink=yes], + [gl_cv_func_lstat_dereferences_slashed_symlink=no], + [case "$host_os" in + *-gnu*) + # Guess yes on glibc systems. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; + *) + # If we don't know, assume the worst. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; + esac + ]) + rm -f conftest.sym conftest.file + ]) + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *yes) + AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1], + [Define to 1 if 'lstat' dereferences a symlink specified + with a trailing slash.]) + ;; + esac +]) diff --git a/local/recipes/tools/diffutils/source/m4/malloc.m4 b/local/recipes/tools/diffutils/source/m4/malloc.m4 new file mode 100644 index 0000000000..e1d2ec687f --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/malloc.m4 @@ -0,0 +1,101 @@ +# malloc.m4 serial 15 +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +m4_version_prereq([2.70], [] ,[ + +# This is adapted with modifications from upstream Autoconf here: +# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c +AC_DEFUN([_AC_FUNC_MALLOC_IF], +[ + AC_REQUIRE([AC_HEADER_STDC])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles + AC_CHECK_HEADERS([stdlib.h]) + AC_CACHE_CHECK([for GNU libc compatible malloc], + [ac_cv_func_malloc_0_nonnull], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#if defined STDC_HEADERS || defined HAVE_STDLIB_H + # include <stdlib.h> + #else + char *malloc (); + #endif + ]], + [[char *p = malloc (0); + int result = !p; + free (p); + return result;]]) + ], + [ac_cv_func_malloc_0_nonnull=yes], + [ac_cv_func_malloc_0_nonnull=no], + [case "$host_os" in + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* \ + | hpux* | solaris* | cygwin* | mingw*) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; + esac + ]) + ]) + AS_IF([test $ac_cv_func_malloc_0_nonnull = yes], [$1], [$2]) +])# _AC_FUNC_MALLOC_IF + +]) + +# gl_FUNC_MALLOC_GNU +# ------------------ +# Test whether 'malloc (0)' is handled like in GNU libc, and replace malloc if +# it is not. +AC_DEFUN([gl_FUNC_MALLOC_GNU], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + dnl _AC_FUNC_MALLOC_IF is defined in Autoconf. + _AC_FUNC_MALLOC_IF( + [AC_DEFINE([HAVE_MALLOC_GNU], [1], + [Define to 1 if your system has a GNU libc compatible 'malloc' + function, and to 0 otherwise.])], + [AC_DEFINE([HAVE_MALLOC_GNU], [0]) + REPLACE_MALLOC=1 + ]) +]) + +# gl_FUNC_MALLOC_POSIX +# -------------------- +# Test whether 'malloc' is POSIX compliant (sets errno to ENOMEM when it +# fails), and replace malloc if it is not. +AC_DEFUN([gl_FUNC_MALLOC_POSIX], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) + if test $gl_cv_func_malloc_posix = yes; then + AC_DEFINE([HAVE_MALLOC_POSIX], [1], + [Define if the 'malloc' function is POSIX compliant.]) + else + REPLACE_MALLOC=1 + fi +]) + +# Test whether malloc, realloc, calloc are POSIX compliant, +# Set gl_cv_func_malloc_posix to yes or no accordingly. +AC_DEFUN([gl_CHECK_MALLOC_POSIX], +[ + AC_CACHE_CHECK([whether malloc, realloc, calloc are POSIX compliant], + [gl_cv_func_malloc_posix], + [ + dnl It is too dangerous to try to allocate a large amount of memory: + dnl some systems go to their knees when you do that. So assume that + dnl all Unix implementations of the function are POSIX compliant. + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[]], + [[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + choke me + #endif + ]])], + [gl_cv_func_malloc_posix=yes], + [gl_cv_func_malloc_posix=no]) + ]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/malloca.m4 b/local/recipes/tools/diffutils/source/m4/malloca.m4 new file mode 100644 index 0000000000..6956baf209 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/malloca.m4 @@ -0,0 +1,15 @@ +# malloca.m4 serial 1 +dnl Copyright (C) 2003-2004, 2006-2007, 2009-2017 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_MALLOCA], +[ + dnl Use the autoconf tests for alloca(), but not the AC_SUBSTed variables + dnl @ALLOCA@ and @LTALLOCA@. + dnl gl_FUNC_ALLOCA dnl Already brought in by the module dependencies. + AC_REQUIRE([gl_EEMALLOC]) + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/manywarnings.m4 b/local/recipes/tools/diffutils/source/m4/manywarnings.m4 new file mode 100644 index 0000000000..2d35eff6a2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/manywarnings.m4 @@ -0,0 +1,295 @@ +# manywarnings.m4 serial 8 +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Simon Josefsson + +# gl_MANYWARN_COMPLEMENT(OUTVAR, LISTVAR, REMOVEVAR) +# -------------------------------------------------- +# Copy LISTVAR to OUTVAR except for the entries in REMOVEVAR. +# Elements separated by whitespace. In set logic terms, the function +# does OUTVAR = LISTVAR \ REMOVEVAR. +AC_DEFUN([gl_MANYWARN_COMPLEMENT], +[ + gl_warn_set= + set x $2; shift + for gl_warn_item + do + case " $3 " in + *" $gl_warn_item "*) + ;; + *) + gl_warn_set="$gl_warn_set $gl_warn_item" + ;; + esac + done + $1=$gl_warn_set +]) + +# gl_MANYWARN_ALL_GCC(VARIABLE) +# ----------------------------- +# Add all documented GCC warning parameters to variable VARIABLE. +# Note that you need to test them using gl_WARN_ADD if you want to +# make sure your gcc understands it. +AC_DEFUN([gl_MANYWARN_ALL_GCC], +[ + dnl First, check for some issues that only occur when combining multiple + dnl gcc warning categories. + AC_REQUIRE([AC_PROG_CC]) + if test -n "$GCC"; then + + dnl Check if -W -Werror -Wno-missing-field-initializers is supported + dnl with the current $CC $CFLAGS $CPPFLAGS. + AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported]) + AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [ + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], [[]])], + [gl_cv_cc_nomfi_supported=yes], + [gl_cv_cc_nomfi_supported=no]) + CFLAGS="$gl_save_CFLAGS"]) + AC_MSG_RESULT([$gl_cv_cc_nomfi_supported]) + + if test "$gl_cv_cc_nomfi_supported" = yes; then + dnl Now check whether -Wno-missing-field-initializers is needed + dnl for the { 0, } construct. + AC_MSG_CHECKING([whether -Wno-missing-field-initializers is needed]) + AC_CACHE_VAL([gl_cv_cc_nomfi_needed], [ + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[int f (void) + { + typedef struct { int a; int b; } s_t; + s_t s1 = { 0, }; + return s1.b; + } + ]], + [[]])], + [gl_cv_cc_nomfi_needed=no], + [gl_cv_cc_nomfi_needed=yes]) + CFLAGS="$gl_save_CFLAGS" + ]) + AC_MSG_RESULT([$gl_cv_cc_nomfi_needed]) + fi + + dnl Next, check if -Werror -Wuninitialized is useful with the + dnl user's choice of $CFLAGS; some versions of gcc warn that it + dnl has no effect if -O is not also used + AC_MSG_CHECKING([whether -Wuninitialized is supported]) + AC_CACHE_VAL([gl_cv_cc_uninitialized_supported], [ + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wuninitialized" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], [[]])], + [gl_cv_cc_uninitialized_supported=yes], + [gl_cv_cc_uninitialized_supported=no]) + CFLAGS="$gl_save_CFLAGS"]) + AC_MSG_RESULT([$gl_cv_cc_uninitialized_supported]) + + fi + + # List all gcc warning categories. + # To compare this list to your installed GCC's, run this Bash command: + # + # comm -3 \ + # <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \ + # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort | + # grep -v -x -F -f <( + # awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec)) + + gl_manywarn_set= + for gl_manywarn_item in -fno-common \ + -W \ + -Wabi \ + -Waddress \ + -Waggressive-loop-optimizations \ + -Wall \ + -Wattributes \ + -Wbad-function-cast \ + -Wbool-compare \ + -Wbool-operation \ + -Wbuiltin-declaration-mismatch \ + -Wbuiltin-macro-redefined \ + -Wcast-align \ + -Wchar-subscripts \ + -Wchkp \ + -Wclobbered \ + -Wcomment \ + -Wcomments \ + -Wcoverage-mismatch \ + -Wcpp \ + -Wdangling-else \ + -Wdate-time \ + -Wdeprecated \ + -Wdeprecated-declarations \ + -Wdesignated-init \ + -Wdisabled-optimization \ + -Wdiscarded-array-qualifiers \ + -Wdiscarded-qualifiers \ + -Wdiv-by-zero \ + -Wdouble-promotion \ + -Wduplicated-branches \ + -Wduplicated-cond \ + -Wduplicate-decl-specifier \ + -Wempty-body \ + -Wendif-labels \ + -Wenum-compare \ + -Wexpansion-to-defined \ + -Wextra \ + -Wformat-contains-nul \ + -Wformat-extra-args \ + -Wformat-nonliteral \ + -Wformat-security \ + -Wformat-signedness \ + -Wformat-y2k \ + -Wformat-zero-length \ + -Wframe-address \ + -Wfree-nonheap-object \ + -Whsa \ + -Wignored-attributes \ + -Wignored-qualifiers \ + -Wimplicit \ + -Wimplicit-function-declaration \ + -Wimplicit-int \ + -Wincompatible-pointer-types \ + -Winit-self \ + -Winline \ + -Wint-conversion \ + -Wint-in-bool-context \ + -Wint-to-pointer-cast \ + -Winvalid-memory-model \ + -Winvalid-pch \ + -Wjump-misses-init \ + -Wlogical-not-parentheses \ + -Wlogical-op \ + -Wmain \ + -Wmaybe-uninitialized \ + -Wmemset-elt-size \ + -Wmemset-transposed-args \ + -Wmisleading-indentation \ + -Wmissing-braces \ + -Wmissing-declarations \ + -Wmissing-field-initializers \ + -Wmissing-include-dirs \ + -Wmissing-parameter-type \ + -Wmissing-prototypes \ + -Wmultichar \ + -Wnarrowing \ + -Wnested-externs \ + -Wnonnull \ + -Wnonnull-compare \ + -Wnull-dereference \ + -Wodr \ + -Wold-style-declaration \ + -Wold-style-definition \ + -Wopenmp-simd \ + -Woverflow \ + -Woverlength-strings \ + -Woverride-init \ + -Wpacked \ + -Wpacked-bitfield-compat \ + -Wparentheses \ + -Wpointer-arith \ + -Wpointer-compare \ + -Wpointer-sign \ + -Wpointer-to-int-cast \ + -Wpragmas \ + -Wpsabi \ + -Wrestrict \ + -Wreturn-local-addr \ + -Wreturn-type \ + -Wscalar-storage-order \ + -Wsequence-point \ + -Wshadow \ + -Wshift-count-negative \ + -Wshift-count-overflow \ + -Wshift-negative-value \ + -Wsizeof-array-argument \ + -Wsizeof-pointer-memaccess \ + -Wstack-protector \ + -Wstrict-aliasing \ + -Wstrict-overflow \ + -Wstrict-prototypes \ + -Wsuggest-attribute=const \ + -Wsuggest-attribute=format \ + -Wsuggest-attribute=noreturn \ + -Wsuggest-attribute=pure \ + -Wsuggest-final-methods \ + -Wsuggest-final-types \ + -Wswitch \ + -Wswitch-bool \ + -Wswitch-default \ + -Wswitch-unreachable \ + -Wsync-nand \ + -Wsystem-headers \ + -Wtautological-compare \ + -Wtrampolines \ + -Wtrigraphs \ + -Wtype-limits \ + -Wuninitialized \ + -Wunknown-pragmas \ + -Wunsafe-loop-optimizations \ + -Wunused \ + -Wunused-but-set-parameter \ + -Wunused-but-set-variable \ + -Wunused-function \ + -Wunused-label \ + -Wunused-local-typedefs \ + -Wunused-macros \ + -Wunused-parameter \ + -Wunused-result \ + -Wunused-value \ + -Wunused-variable \ + -Wvarargs \ + -Wvariadic-macros \ + -Wvector-operation-performance \ + -Wvla \ + -Wvolatile-register-var \ + -Wwrite-strings \ + \ + ; do + gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" + done + + # gcc --help=warnings outputs an unusual form for these options; list + # them here so that the above 'comm' command doesn't report a false match. + # Would prefer "min (PTRDIFF_MAX, SIZE_MAX)", but it must be a literal: + ptrdiff_max_max=9223372036854775807 + gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$ptrdiff_max_max" + gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2" + gl_manywarn_set="$gl_manywarn_set -Wformat-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wformat-truncation=2" + gl_manywarn_set="$gl_manywarn_set -Wimplicit-fallthrough=5" + gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc" + gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wstringop-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2" + gl_manywarn_set="$gl_manywarn_set -Wvla-larger-than=4031" + + # These are needed for older GCC versions. + if test -n "$GCC"; then + case `($CC --version) 2>/dev/null` in + 'gcc (GCC) '[[0-3]].* | \ + 'gcc (GCC) '4.[[0-7]].*) + gl_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option" + gl_manywarn_set="$gl_manywarn_set -funit-at-a-time" + ;; + esac + fi + + # Disable specific options as needed. + if test "$gl_cv_cc_nomfi_needed" = yes; then + gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers" + fi + + if test "$gl_cv_cc_uninitialized_supported" = no; then + gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized" + fi + + $1=$gl_manywarn_set +]) diff --git a/local/recipes/tools/diffutils/source/m4/mbchar.m4 b/local/recipes/tools/diffutils/source/m4/mbchar.m4 new file mode 100644 index 0000000000..60ea12444a --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/mbchar.m4 @@ -0,0 +1,13 @@ +# mbchar.m4 serial 9 +dnl Copyright (C) 2005-2007, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl autoconf tests required for use of mbchar.m4 +dnl From Bruno Haible. + +AC_DEFUN([gl_MBCHAR], +[ + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/mbiter.m4 b/local/recipes/tools/diffutils/source/m4/mbiter.m4 new file mode 100644 index 0000000000..add4034426 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/mbiter.m4 @@ -0,0 +1,14 @@ +# mbiter.m4 serial 7 +dnl Copyright (C) 2005, 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl autoconf tests required for use of mbiter.h +dnl From Bruno Haible. + +AC_DEFUN([gl_MBITER], +[ + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/mbrtowc.m4 b/local/recipes/tools/diffutils/source/m4/mbrtowc.m4 new file mode 100644 index 0000000000..536183f4f8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/mbrtowc.m4 @@ -0,0 +1,664 @@ +# mbrtowc.m4 serial 27 -*- coding: utf-8 -*- +dnl Copyright (C) 2001-2002, 2004-2005, 2008-2017 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_MBRTOWC], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + gl_MBSTATE_T_BROKEN + + AC_CHECK_FUNCS_ONCE([mbrtowc]) + if test $ac_cv_func_mbrtowc = no; then + HAVE_MBRTOWC=0 + AC_CHECK_DECLS([mbrtowc],,, [[ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +]]) + if test $ac_cv_have_decl_mbrtowc = yes; then + dnl On Minix 3.1.8, the system's <wchar.h> declares mbrtowc() although + dnl it does not have the function. Avoid a collision with gnulib's + dnl replacement. + REPLACE_MBRTOWC=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBRTOWC=1 + else + gl_MBRTOWC_NULL_ARG1 + gl_MBRTOWC_NULL_ARG2 + gl_MBRTOWC_RETVAL + gl_MBRTOWC_NUL_RETVAL + gl_MBRTOWC_EMPTY_INPUT + gl_MBRTOWC_C_LOCALE + case "$gl_cv_func_mbrtowc_null_arg1" in + *yes) ;; + *) AC_DEFINE([MBRTOWC_NULL_ARG1_BUG], [1], + [Define if the mbrtowc function has the NULL pwc argument bug.]) + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_null_arg2" in + *yes) ;; + *) AC_DEFINE([MBRTOWC_NULL_ARG2_BUG], [1], + [Define if the mbrtowc function has the NULL string argument bug.]) + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_retval" in + *yes) ;; + *) AC_DEFINE([MBRTOWC_RETVAL_BUG], [1], + [Define if the mbrtowc function returns a wrong return value.]) + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_nul_retval" in + *yes) ;; + *) AC_DEFINE([MBRTOWC_NUL_RETVAL_BUG], [1], + [Define if the mbrtowc function does not return 0 for a NUL character.]) + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_empty_input" in + *yes) ;; + *) AC_DEFINE([MBRTOWC_EMPTY_INPUT_BUG], [1], + [Define if the mbrtowc function does not return (size_t) -2 + for empty input.]) + REPLACE_MBRTOWC=1 + ;; + esac + case $gl_cv_C_locale_sans_EILSEQ in + *yes) ;; + *) AC_DEFINE([C_LOCALE_MAYBE_EILSEQ], [1], + [Define to 1 if the C locale may have encoding errors.]) + REPLACE_MBRTOWC=1 + ;; + esac + fi + fi +]) + +dnl Test whether mbsinit() and mbrtowc() need to be overridden in a way that +dnl redefines the semantics of the given mbstate_t type. +dnl Result is REPLACE_MBSTATE_T. +dnl When this is set to 1, we replace both mbsinit() and mbrtowc(), in order to +dnl avoid inconsistencies. + +AC_DEFUN([gl_MBSTATE_T_BROKEN], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + AC_CHECK_FUNCS_ONCE([mbsinit]) + AC_CHECK_FUNCS_ONCE([mbrtowc]) + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + gl_MBRTOWC_INCOMPLETE_STATE + gl_MBRTOWC_SANITYCHECK + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi +]) + +dnl Test whether mbrtowc puts the state into non-initial state when parsing an +dnl incomplete multibyte character. +dnl Result is gl_cv_func_mbrtowc_incomplete_state. + +AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_JA]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc handles incomplete characters], + [gl_cv_func_mbrtowc_incomplete_state], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_JA != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 2; + } + return 0; +}]])], + [gl_cv_func_mbrtowc_incomplete_state=yes], + [gl_cv_func_mbrtowc_incomplete_state=no], + [:]) + fi + ]) +]) + +dnl Test whether mbrtowc works not worse than mbtowc. +dnl Result is gl_cv_func_mbrtowc_sanitycheck. + +AC_DEFUN([gl_MBRTOWC_SANITYCHECK], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_ZH_CN]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc works as well as mbtowc], + [gl_cv_func_mbrtowc_sanitycheck], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_ZH_CN != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <locale.h> +#include <stdlib.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 2; + } + return 0; +}]])], + [gl_cv_func_mbrtowc_sanitycheck=yes], + [gl_cv_func_mbrtowc_sanitycheck=no], + [:]) + fi + ]) +]) + +dnl Test whether mbrtowc supports a NULL pwc argument correctly. +dnl Result is gl_cv_func_mbrtowc_null_arg1. + +AC_DEFUN([gl_MBRTOWC_NULL_ARG1], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR_UTF8]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc handles a NULL pwc argument], + [gl_cv_func_mbrtowc_null_arg1], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on Solaris. + solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR_UTF8 != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <locale.h> +#include <stdlib.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + int result = 0; + + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "\303\237er"; + mbstate_t state; + wchar_t wc; + size_t ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 5, &state); + if (ret != 2) + result |= 1; + if (!mbsinit (&state)) + result |= 2; + + memset (&state, '\0', sizeof (mbstate_t)); + ret = mbrtowc (NULL, input, 5, &state); + if (ret != 2) /* Solaris 7 fails here: ret is -1. */ + result |= 4; + if (!mbsinit (&state)) + result |= 8; + } + return result; +}]])], + [gl_cv_func_mbrtowc_null_arg1=yes], + [gl_cv_func_mbrtowc_null_arg1=no], + [:]) + fi + ]) +]) + +dnl Test whether mbrtowc supports a NULL string argument correctly. +dnl Result is gl_cv_func_mbrtowc_null_arg2. + +AC_DEFUN([gl_MBRTOWC_NULL_ARG2], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR_UTF8]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc handles a NULL string argument], + [gl_cv_func_mbrtowc_null_arg2], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on OSF/1. + osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR_UTF8 != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + mbstate_t state; + wchar_t wc; + int ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + mbrtowc (&wc, NULL, 5, &state); + /* Check that wc was not modified. */ + if (wc != (wchar_t) 0xBADFACE) + return 2; + } + return 0; +}]])], + [gl_cv_func_mbrtowc_null_arg2=yes], + [gl_cv_func_mbrtowc_null_arg2=no], + [:]) + fi + ]) +]) + +dnl Test whether mbrtowc, when parsing the end of a multibyte character, +dnl correctly returns the number of bytes that were needed to complete the +dnl character (not the total number of bytes of the multibyte character). +dnl Result is gl_cv_func_mbrtowc_retval. + +AC_DEFUN([gl_MBRTOWC_RETVAL], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR_UTF8]) + AC_REQUIRE([gt_LOCALE_JA]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CACHE_CHECK([whether mbrtowc has a correct return value], + [gl_cv_func_mbrtowc_retval], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on HP-UX, Solaris, native Windows. + hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_retval="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \ + || { case "$host_os" in mingw*) true;; *) false;; esac; }; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + int result = 0; + int found_some_locale = 0; + /* This fails on Solaris. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "B\303\274\303\237er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 1) + result |= 1; + } + found_some_locale = 1; + } + /* This fails on HP-UX 11.11. */ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 2) + result |= 2; + } + found_some_locale = 1; + } + /* This fails on native Windows. */ + if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) + { + char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 4; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) + { + char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 8; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_China.936") != NULL) + { + char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 16; + } + found_some_locale = 1; + } + return (found_some_locale ? result : 77); +}]])], + [gl_cv_func_mbrtowc_retval=yes], + [if test $? != 77; then + gl_cv_func_mbrtowc_retval=no + fi + ], + [:]) + fi + ]) +]) + +dnl Test whether mbrtowc, when parsing a NUL character, correctly returns 0. +dnl Result is gl_cv_func_mbrtowc_nul_retval. + +AC_DEFUN([gl_MBRTOWC_NUL_RETVAL], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_ZH_CN]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc returns 0 when parsing a NUL character], + [gl_cv_func_mbrtowc_nul_retval], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on Solaris 8 and 9. + solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_ZH_CN != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris 8 and 9. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, "", 1, &state) != 0) + return 2; + } + return 0; +}]])], + [gl_cv_func_mbrtowc_nul_retval=yes], + [gl_cv_func_mbrtowc_nul_retval=no], + [:]) + fi + ]) +]) + +dnl Test whether mbrtowc returns the correct value on empty input. + +AC_DEFUN([gl_MBRTOWC_EMPTY_INPUT], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc works on empty input], + [gl_cv_func_mbrtowc_empty_input], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on AIX and glibc systems. + aix* | *-gnu*) + gl_cv_func_mbrtowc_empty_input="guessing no" ;; + *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; + esac +changequote([,])dnl + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ + #include <wchar.h> + static wchar_t wc; + static mbstate_t mbs; + int + main (void) + { + return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2; + }]])], + [gl_cv_func_mbrtowc_empty_input=yes], + [gl_cv_func_mbrtowc_empty_input=no], + [:]) + ]) +]) + +dnl Test whether mbrtowc reports encoding errors in the C locale. +dnl Although POSIX was never intended to allow this, the GNU C Library +dnl and other implementations do it. See: +dnl https://sourceware.org/bugzilla/show_bug.cgi?id=19932 + +AC_DEFUN([gl_MBRTOWC_C_LOCALE], +[ + AC_CACHE_CHECK([whether the C locale is free of encoding errors], + [gl_cv_C_locale_sans_EILSEQ], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. + gl_cv_C_locale_sans_EILSEQ="guessing no" + + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <limits.h> + #include <locale.h> + #include <wchar.h> + ]], [[ + int i; + char *locale = setlocale (LC_ALL, "C"); + if (! locale) + return 2; + for (i = CHAR_MIN; i <= CHAR_MAX; i++) + { + char c = i; + wchar_t wc; + mbstate_t mbs = { 0, }; + size_t ss = mbrtowc (&wc, &c, 1, &mbs); + if (1 < ss) + return 3; + } + return 0; + ]])], + [gl_cv_C_locale_sans_EILSEQ=yes], + [gl_cv_C_locale_sans_EILSEQ=no], + [:])]) +]) + +# Prerequisites of lib/mbrtowc.c. +AC_DEFUN([gl_PREREQ_MBRTOWC], [ + : +]) + + +dnl From Paul Eggert + +dnl This is an override of an autoconf macro. + +AC_DEFUN([AC_FUNC_MBRTOWC], +[ + dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60. + AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared], + gl_cv_func_mbrtowc, + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h>]], + [[wchar_t wc; + char const s[] = ""; + size_t n = 1; + mbstate_t state; + return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])], + gl_cv_func_mbrtowc=yes, + gl_cv_func_mbrtowc=no)]) + if test $gl_cv_func_mbrtowc = yes; then + AC_DEFINE([HAVE_MBRTOWC], [1], + [Define to 1 if mbrtowc and mbstate_t are properly declared.]) + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/mbsinit.m4 b/local/recipes/tools/diffutils/source/m4/mbsinit.m4 new file mode 100644 index 0000000000..5904a5107b --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/mbsinit.m4 @@ -0,0 +1,51 @@ +# mbsinit.m4 serial 8 +dnl Copyright (C) 2008, 2010-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_MBSINIT], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + gl_MBSTATE_T_BROKEN + + AC_CHECK_FUNCS_ONCE([mbsinit]) + if test $ac_cv_func_mbsinit = no; then + HAVE_MBSINIT=0 + AC_CHECK_DECLS([mbsinit],,, [[ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +]]) + if test $ac_cv_have_decl_mbsinit = yes; then + dnl On Minix 3.1.8, the system's <wchar.h> declares mbsinit() although + dnl it does not have the function. Avoid a collision with gnulib's + dnl replacement. + REPLACE_MBSINIT=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSINIT=1 + else + dnl On mingw, mbsinit() always returns 1, which is inappropriate for + dnl states produced by mbrtowc() for an incomplete multibyte character + dnl in multibyte locales. + case "$host_os" in + mingw*) REPLACE_MBSINIT=1 ;; + esac + fi + fi +]) + +# Prerequisites of lib/mbsinit.c. +AC_DEFUN([gl_PREREQ_MBSINIT], [ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/mbslen.m4 b/local/recipes/tools/diffutils/source/m4/mbslen.m4 new file mode 100644 index 0000000000..b9193ad548 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/mbslen.m4 @@ -0,0 +1,16 @@ +# mbslen.m4 serial 2 +dnl Copyright (C) 2010-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_MBSLEN], +[ + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([mbslen]) + if test $ac_cv_func_mbslen = yes; then + HAVE_MBSLEN=1 + else + HAVE_MBSLEN=0 + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/mbsrtowcs.m4 b/local/recipes/tools/diffutils/source/m4/mbsrtowcs.m4 new file mode 100644 index 0000000000..79b8d767b6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/mbsrtowcs.m4 @@ -0,0 +1,155 @@ +# mbsrtowcs.m4 serial 13 +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_MBSRTOWCS], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + gl_MBSTATE_T_BROKEN + + AC_CHECK_FUNCS_ONCE([mbsrtowcs]) + if test $ac_cv_func_mbsrtowcs = no; then + HAVE_MBSRTOWCS=0 + AC_CHECK_DECLS([mbsrtowcs],,, [[ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +]]) + if test $ac_cv_have_decl_mbsrtowcs = yes; then + dnl On Minix 3.1.8, the system's <wchar.h> declares mbsrtowcs() although + dnl it does not have the function. Avoid a collision with gnulib's + dnl replacement. + REPLACE_MBSRTOWCS=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSRTOWCS=1 + else + gl_MBSRTOWCS_WORKS + case "$gl_cv_func_mbsrtowcs_works" in + *yes) ;; + *) REPLACE_MBSRTOWCS=1 ;; + esac + fi + fi +]) + +dnl Test whether mbsrtowcs works. +dnl Result is gl_cv_func_mbsrtowcs_works. + +AC_DEFUN([gl_MBSRTOWCS_WORKS], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR]) + AC_REQUIRE([gt_LOCALE_FR_UTF8]) + AC_REQUIRE([gt_LOCALE_JA]) + AC_REQUIRE([gt_LOCALE_ZH_CN]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbsrtowcs works], + [gl_cv_func_mbsrtowcs_works], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on HP-UX, Solaris, mingw. + hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbsrtowcs_works="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + int result = 0; + /* Test whether the function supports a NULL destination argument. + This fails on native Windows. */ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + const char input[] = "\337er"; + const char *src = input; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbsrtowcs (NULL, &src, 1, &state) != 3 + || src != input) + result |= 1; + } + /* Test whether the function works when started with a conversion state + in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + const char input[] = "B\303\274\303\237er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + result |= 2; + } + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "<\306\374\313\334\270\354>"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 4; + if (mbsrtowcs (NULL, &src, 10, &state) != 3) + result |= 4; + } + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + const char input[] = "B\250\271\201\060\211\070er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + result |= 8; + } + } + return result; +}]])], + [gl_cv_func_mbsrtowcs_works=yes], + [gl_cv_func_mbsrtowcs_works=no], + [:]) + fi + ]) +]) + +# Prerequisites of lib/mbsrtowcs.c. +AC_DEFUN([gl_PREREQ_MBSRTOWCS], [ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/mbstate_t.m4 b/local/recipes/tools/diffutils/source/m4/mbstate_t.m4 new file mode 100644 index 0000000000..6325cf3a49 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/mbstate_t.m4 @@ -0,0 +1,41 @@ +# mbstate_t.m4 serial 13 +dnl Copyright (C) 2000-2002, 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# From Paul Eggert. + +# BeOS 5 has <wchar.h> but does not define mbstate_t, +# so you can't declare an object of that type. +# Check for this incompatibility with Standard C. + +# AC_TYPE_MBSTATE_T +# ----------------- +AC_DEFUN([AC_TYPE_MBSTATE_T], +[ + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) dnl for HP-UX 11.11 + + AC_CACHE_CHECK([for mbstate_t], [ac_cv_type_mbstate_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [AC_INCLUDES_DEFAULT[ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h>]], + [[mbstate_t x; return sizeof x;]])], + [ac_cv_type_mbstate_t=yes], + [ac_cv_type_mbstate_t=no])]) + if test $ac_cv_type_mbstate_t = yes; then + AC_DEFINE([HAVE_MBSTATE_T], [1], + [Define to 1 if <wchar.h> declares mbstate_t.]) + else + AC_DEFINE([mbstate_t], [int], + [Define to a type if <wchar.h> does not define.]) + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/mbtowc.m4 b/local/recipes/tools/diffutils/source/m4/mbtowc.m4 new file mode 100644 index 0000000000..378a4e258a --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/mbtowc.m4 @@ -0,0 +1,19 @@ +# mbtowc.m4 serial 2 +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_MBTOWC], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + + if false; then + REPLACE_MBTOWC=1 + fi +]) + +# Prerequisites of lib/mbtowc.c. +AC_DEFUN([gl_PREREQ_MBTOWC], [ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/memchr.m4 b/local/recipes/tools/diffutils/source/m4/memchr.m4 new file mode 100644 index 0000000000..b6ec81401b --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/memchr.m4 @@ -0,0 +1,88 @@ +# memchr.m4 serial 12 +dnl Copyright (C) 2002-2004, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN_ONCE([gl_FUNC_MEMCHR], +[ + dnl Check for prerequisites for memory fence checks. + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + m4_ifdef([gl_FUNC_MEMCHR_OBSOLETE], [ + dnl These days, we assume memchr is present. But if support for old + dnl platforms is desired: + AC_CHECK_FUNCS_ONCE([memchr]) + if test $ac_cv_func_memchr = no; then + HAVE_MEMCHR=0 + fi + ]) + if test $HAVE_MEMCHR = 1; then + # Detect platform-specific bugs in some versions of glibc: + # memchr should not dereference anything with length 0 + # http://bugzilla.redhat.com/499689 + # memchr should not dereference overestimated length after a match + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 + # http://sourceware.org/bugzilla/show_bug.cgi?id=10162 + # Assume that memchr works on platforms that lack mprotect. + AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include <string.h> +#if HAVE_SYS_MMAN_H +# include <fcntl.h> +# include <unistd.h> +# include <sys/types.h> +# include <sys/mman.h> +# ifndef MAP_FILE +# define MAP_FILE 0 +# endif +#endif +]], [[ + int result = 0; + char *fence = NULL; +#if HAVE_SYS_MMAN_H && HAVE_MPROTECT +# if HAVE_MAP_ANONYMOUS + const int flags = MAP_ANONYMOUS | MAP_PRIVATE; + const int fd = -1; +# else /* !HAVE_MAP_ANONYMOUS */ + const int flags = MAP_FILE | MAP_PRIVATE; + int fd = open ("/dev/zero", O_RDONLY, 0666); + if (fd >= 0) +# endif + { + int pagesize = getpagesize (); + char *two_pages = + (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, + flags, fd, 0); + if (two_pages != (char *)(-1) + && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) + fence = two_pages + pagesize; + } +#endif + if (fence) + { + if (memchr (fence, 0, 0)) + result |= 1; + strcpy (fence - 9, "12345678"); + if (memchr (fence - 9, 0, 79) != fence - 1) + result |= 2; + if (memchr (fence - 1, 0, 3) != fence - 1) + result |= 4; + } + return result; +]])], [gl_cv_func_memchr_works=yes], [gl_cv_func_memchr_works=no], + [dnl Be pessimistic for now. + gl_cv_func_memchr_works="guessing no"])]) + if test "$gl_cv_func_memchr_works" != yes; then + REPLACE_MEMCHR=1 + fi + fi +]) + +# Prerequisites of lib/memchr.c. +AC_DEFUN([gl_PREREQ_MEMCHR], [ + AC_CHECK_HEADERS([bp-sym.h]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/minmax.m4 b/local/recipes/tools/diffutils/source/m4/minmax.m4 new file mode 100644 index 0000000000..6845fce89c --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/minmax.m4 @@ -0,0 +1,44 @@ +# minmax.m4 serial 4 +dnl Copyright (C) 2005, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_PREREQ([2.53]) + +AC_DEFUN([gl_MINMAX], +[ + AC_REQUIRE([gl_PREREQ_MINMAX]) +]) + +# Prerequisites of lib/minmax.h. +AC_DEFUN([gl_PREREQ_MINMAX], +[ + gl_MINMAX_IN_HEADER([limits.h]) + gl_MINMAX_IN_HEADER([sys/param.h]) +]) + +dnl gl_MINMAX_IN_HEADER(HEADER) +dnl The parameter has to be a literal header name; it cannot be macro, +dnl nor a shell variable. (Because autoheader collects only AC_DEFINE +dnl invocations with a literal macro name.) +AC_DEFUN([gl_MINMAX_IN_HEADER], +[ + m4_pushdef([header], AS_TR_SH([$1])) + m4_pushdef([HEADER], AS_TR_CPP([$1])) + AC_CACHE_CHECK([whether <$1> defines MIN and MAX], + [gl_cv_minmax_in_]header, + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <$1> + int x = MIN (42, 17);]], + [[]])], + [gl_cv_minmax_in_]header[=yes], + [gl_cv_minmax_in_]header[=no])]) + if test $gl_cv_minmax_in_[]header = yes; then + AC_DEFINE([HAVE_MINMAX_IN_]HEADER, 1, + [Define to 1 if <$1> defines the MIN and MAX macros.]) + fi + m4_popdef([HEADER]) + m4_popdef([header]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/mkstemp.m4 b/local/recipes/tools/diffutils/source/m4/mkstemp.m4 new file mode 100644 index 0000000000..31b9b8bb67 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/mkstemp.m4 @@ -0,0 +1,82 @@ +#serial 23 + +# Copyright (C) 2001, 2003-2007, 2009-2017 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# On some hosts (e.g., HP-UX 10.20, SunOS 4.1.4, Solaris 2.5.1), mkstemp has a +# silly limit that it can create no more than 26 files from a given template. +# Other systems lack mkstemp altogether. +# On OSF1/Tru64 V4.0F, the system-provided mkstemp function can create +# only 32 files per process. +# On some hosts, mkstemp creates files with mode 0666, which is a security +# problem and a violation of POSIX 2008. +# On systems like the above, arrange to use the replacement function. +AC_DEFUN([gl_FUNC_MKSTEMP], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + AC_CHECK_FUNCS_ONCE([mkstemp]) + if test $ac_cv_func_mkstemp = yes; then + AC_CACHE_CHECK([for working mkstemp], + [gl_cv_func_working_mkstemp], + [ + mkdir conftest.mkstemp + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [AC_INCLUDES_DEFAULT], + [[int result = 0; + int i; + off_t large = (off_t) 4294967295u; + if (large < 0) + large = 2147483647; + umask (0); + for (i = 0; i < 70; i++) + { + char templ[] = "conftest.mkstemp/coXXXXXX"; + int (*mkstemp_function) (char *) = mkstemp; + int fd = mkstemp_function (templ); + if (fd < 0) + result |= 1; + else + { + struct stat st; + if (lseek (fd, large, SEEK_SET) != large) + result |= 2; + if (fstat (fd, &st) < 0) + result |= 4; + else if (st.st_mode & 0077) + result |= 8; + if (close (fd)) + result |= 16; + } + } + return result;]])], + [gl_cv_func_working_mkstemp=yes], + [gl_cv_func_working_mkstemp=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_working_mkstemp="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_mkstemp="guessing no" ;; + esac + ]) + rm -rf conftest.mkstemp + ]) + case "$gl_cv_func_working_mkstemp" in + *yes) ;; + *) + REPLACE_MKSTEMP=1 + ;; + esac + else + HAVE_MKSTEMP=0 + fi +]) + +# Prerequisites of lib/mkstemp.c. +AC_DEFUN([gl_PREREQ_MKSTEMP], +[ +]) diff --git a/local/recipes/tools/diffutils/source/m4/mktime.m4 b/local/recipes/tools/diffutils/source/m4/mktime.m4 new file mode 100644 index 0000000000..31da65e8b2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/mktime.m4 @@ -0,0 +1,289 @@ +# serial 28 +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2017 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Jim Meyering. + +AC_DEFUN([gl_TIME_T_IS_SIGNED], +[ + AC_CACHE_CHECK([whether time_t is signed], + [gl_cv_time_t_is_signed], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include <time.h> + char time_t_signed[(time_t) -1 < 0 ? 1 : -1];]])], + [gl_cv_time_t_is_signed=yes], + [gl_cv_time_t_is_signed=no])]) + if test $gl_cv_time_t_is_signed = yes; then + AC_DEFINE([TIME_T_IS_SIGNED], [1], [Define to 1 if time_t is signed.]) + fi +]) + +dnl Test whether mktime works. Set gl_cv_func_working_mktime. +AC_DEFUN([gl_FUNC_MKTIME_WORKS], +[ + AC_REQUIRE([gl_TIME_T_IS_SIGNED]) + + dnl We don't use AC_FUNC_MKTIME any more, because it is no longer maintained + dnl in Autoconf and because it invokes AC_LIBOBJ. + AC_CHECK_HEADERS_ONCE([unistd.h]) + AC_CHECK_DECLS_ONCE([alarm]) + AC_CHECK_FUNCS_ONCE([tzset]) + AC_REQUIRE([gl_MULTIARCH]) + if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple Mac OS X platforms. + # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode. + # But we need a configuration result that is valid in both modes. + gl_cv_func_working_mktime=no + fi + AC_CACHE_CHECK([for working mktime], [gl_cv_func_working_mktime], + [AC_RUN_IFELSE( + [AC_LANG_SOURCE( +[[/* Test program from Paul Eggert and Tony Leneis. */ +#include <limits.h> +#include <stdlib.h> +#include <time.h> + +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif + +#if HAVE_DECL_ALARM +# include <signal.h> +#endif + +/* Work around redefinition to rpl_putenv by other config tests. */ +#undef putenv + +static time_t time_t_max; +static time_t time_t_min; + +/* Values we'll use to set the TZ environment variable. */ +static char *tz_strings[] = { + (char *) 0, "TZ=GMT0", "TZ=JST-9", + "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" +}; +#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) + +/* Return 0 if mktime fails to convert a date in the spring-forward gap. + Based on a problem report from Andreas Jaeger. */ +static int +spring_forward_gap () +{ + /* glibc (up to about 1998-10-07) failed this test. */ + struct tm tm; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + tm.tm_year = 98; + tm.tm_mon = 3; + tm.tm_mday = 5; + tm.tm_hour = 2; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + return mktime (&tm) != (time_t) -1; +} + +static int +mktime_test1 (time_t now) +{ + struct tm *lt; + return ! (lt = localtime (&now)) || mktime (lt) == now; +} + +static int +mktime_test (time_t now) +{ + return (mktime_test1 (now) + && mktime_test1 ((time_t) (time_t_max - now)) + && mktime_test1 ((time_t) (time_t_min + now))); +} + +static int +irix_6_4_bug () +{ + /* Based on code from Ariel Faigon. */ + struct tm tm; + tm.tm_year = 96; + tm.tm_mon = 3; + tm.tm_mday = 0; + tm.tm_hour = 0; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + mktime (&tm); + return tm.tm_mon == 2 && tm.tm_mday == 31; +} + +static int +bigtime_test (int j) +{ + struct tm tm; + time_t now; + tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; + now = mktime (&tm); + if (now != (time_t) -1) + { + struct tm *lt = localtime (&now); + if (! (lt + && lt->tm_year == tm.tm_year + && lt->tm_mon == tm.tm_mon + && lt->tm_mday == tm.tm_mday + && lt->tm_hour == tm.tm_hour + && lt->tm_min == tm.tm_min + && lt->tm_sec == tm.tm_sec + && lt->tm_yday == tm.tm_yday + && lt->tm_wday == tm.tm_wday + && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) + == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) + return 0; + } + return 1; +} + +static int +year_2050_test () +{ + /* The correct answer for 2050-02-01 00:00:00 in Pacific time, + ignoring leap seconds. */ + unsigned long int answer = 2527315200UL; + + struct tm tm; + time_t t; + tm.tm_year = 2050 - 1900; + tm.tm_mon = 2 - 1; + tm.tm_mday = 1; + tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + tm.tm_isdst = -1; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + t = mktime (&tm); + + /* Check that the result is either a failure, or close enough + to the correct answer that we can assume the discrepancy is + due to leap seconds. */ + return (t == (time_t) -1 + || (0 < t && answer - 120 <= t && t <= answer + 120)); +} + +int +main () +{ + int result = 0; + time_t t, delta; + int i, j; + int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1; + +#if HAVE_DECL_ALARM + /* This test makes some buggy mktime implementations loop. + Give up after 60 seconds; a mktime slower than that + isn't worth using anyway. */ + signal (SIGALRM, SIG_DFL); + alarm (60); +#endif + + time_t_max = (! TIME_T_IS_SIGNED + ? (time_t) -1 + : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1) + * 2 + 1)); + time_t_min = (! TIME_T_IS_SIGNED + ? (time_t) 0 + : time_t_signed_magnitude + ? ~ (time_t) 0 + : ~ time_t_max); + + delta = time_t_max / 997; /* a suitable prime number */ + for (i = 0; i < N_STRINGS; i++) + { + if (tz_strings[i]) + putenv (tz_strings[i]); + + for (t = 0; t <= time_t_max - delta && (result & 1) == 0; t += delta) + if (! mktime_test (t)) + result |= 1; + if ((result & 2) == 0 + && ! (mktime_test ((time_t) 1) + && mktime_test ((time_t) (60 * 60)) + && mktime_test ((time_t) (60 * 60 * 24)))) + result |= 2; + + for (j = 1; (result & 4) == 0; j <<= 1) + { + if (! bigtime_test (j)) + result |= 4; + if (INT_MAX / 2 < j) + break; + } + if ((result & 8) == 0 && ! bigtime_test (INT_MAX)) + result |= 8; + } + if (! irix_6_4_bug ()) + result |= 16; + if (! spring_forward_gap ()) + result |= 32; + if (! year_2050_test ()) + result |= 64; + return result; +}]])], + [gl_cv_func_working_mktime=yes], + [gl_cv_func_working_mktime=no], + [gl_cv_func_working_mktime="guessing no"]) + ]) +]) + +dnl Main macro of module 'mktime'. +AC_DEFUN([gl_FUNC_MKTIME], +[ + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_FUNC_MKTIME_WORKS]) + + REPLACE_MKTIME=0 + if test "$gl_cv_func_working_mktime" != yes; then + REPLACE_MKTIME=1 + AC_DEFINE([NEED_MKTIME_WORKING], [1], + [Define if the compilation of mktime.c should define 'mktime' + with the algorithmic workarounds.]) + fi + case "$host_os" in + mingw*) + REPLACE_MKTIME=1 + AC_DEFINE([NEED_MKTIME_WINDOWS], [1], + [Define if the compilation of mktime.c should define 'mktime' + with the native Windows TZ workaround.]) + ;; + esac +]) + +dnl Main macro of module 'mktime-internal'. +AC_DEFUN([gl_FUNC_MKTIME_INTERNAL], [ + AC_REQUIRE([gl_FUNC_MKTIME_WORKS]) + + WANT_MKTIME_INTERNAL=0 + dnl BeOS has __mktime_internal in libc, but other platforms don't. + AC_CHECK_FUNC([__mktime_internal], + [AC_DEFINE([mktime_internal], [__mktime_internal], + [Define to the real name of the mktime_internal function.]) + ], + [dnl mktime works but it doesn't export __mktime_internal, + dnl so we need to substitute our own mktime implementation. + WANT_MKTIME_INTERNAL=1 + AC_DEFINE([NEED_MKTIME_INTERNAL], [1], + [Define if the compilation of mktime.c should define 'mktime_internal'.]) + ]) +]) + +# Prerequisites of lib/mktime.c. +AC_DEFUN([gl_PREREQ_MKTIME], [:]) diff --git a/local/recipes/tools/diffutils/source/m4/mmap-anon.m4 b/local/recipes/tools/diffutils/source/m4/mmap-anon.m4 new file mode 100644 index 0000000000..263687d1ad --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/mmap-anon.m4 @@ -0,0 +1,55 @@ +# mmap-anon.m4 serial 10 +dnl Copyright (C) 2005, 2007, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Detect how mmap can be used to create anonymous (not file-backed) memory +# mappings. +# - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS +# and MAP_ANON exist and have the same value. +# - On HP-UX, only MAP_ANONYMOUS exists. +# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists. +# - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be +# used. + +AC_DEFUN([gl_FUNC_MMAP_ANON], +[ + dnl Persuade glibc <sys/mman.h> to define MAP_ANONYMOUS. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + AC_CHECK_FUNC([mmap], [gl_have_mmap=yes], [gl_have_mmap=no]) + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + AC_MSG_CHECKING([for MAP_ANONYMOUS]) + AC_EGREP_CPP([I cannot identify this map], [ +#include <sys/mman.h> +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif +], + [gl_have_mmap_anonymous=yes]) + if test $gl_have_mmap_anonymous != yes; then + AC_EGREP_CPP([I cannot identify this map], [ +#include <sys/mman.h> +#ifdef MAP_ANON + I cannot identify this map +#endif +], + [AC_DEFINE([MAP_ANONYMOUS], [MAP_ANON], + [Define to a substitute value for mmap()'s MAP_ANONYMOUS flag.]) + gl_have_mmap_anonymous=yes]) + fi + AC_MSG_RESULT([$gl_have_mmap_anonymous]) + if test $gl_have_mmap_anonymous = yes; then + AC_DEFINE([HAVE_MAP_ANONYMOUS], [1], + [Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including + config.h and <sys/mman.h>.]) + fi + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/mode_t.m4 b/local/recipes/tools/diffutils/source/m4/mode_t.m4 new file mode 100644 index 0000000000..75d372a4a8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/mode_t.m4 @@ -0,0 +1,26 @@ +# mode_t.m4 serial 2 +dnl Copyright (C) 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# For using mode_t, it's sufficient to use AC_TYPE_MODE_T and +# include <sys/types.h>. + +# Define PROMOTED_MODE_T to the type that is the result of "default argument +# promotion" (ISO C 6.5.2.2.(6)) of the type mode_t. +AC_DEFUN([gl_PROMOTED_TYPE_MODE_T], +[ + AC_REQUIRE([AC_TYPE_MODE_T]) + AC_CACHE_CHECK([for promoted mode_t type], [gl_cv_promoted_mode_t], [ + dnl Assume mode_t promotes to 'int' if and only if it is smaller than 'int', + dnl and to itself otherwise. This assumption is not guaranteed by the ISO C + dnl standard, but we don't know of any real-world counterexamples. + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]], + [[typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];]])], + [gl_cv_promoted_mode_t='int'], + [gl_cv_promoted_mode_t='mode_t']) + ]) + AC_DEFINE_UNQUOTED([PROMOTED_MODE_T], [$gl_cv_promoted_mode_t], + [Define to the type that is the result of default argument promotions of type mode_t.]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/msvc-inval.m4 b/local/recipes/tools/diffutils/source/m4/msvc-inval.m4 new file mode 100644 index 0000000000..3324375118 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/msvc-inval.m4 @@ -0,0 +1,19 @@ +# msvc-inval.m4 serial 1 +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_MSVC_INVAL], +[ + AC_CHECK_FUNCS_ONCE([_set_invalid_parameter_handler]) + if test $ac_cv_func__set_invalid_parameter_handler = yes; then + HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 + AC_DEFINE([HAVE_MSVC_INVALID_PARAMETER_HANDLER], [1], + [Define to 1 on MSVC platforms that have the "invalid parameter handler" + concept.]) + else + HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 + fi + AC_SUBST([HAVE_MSVC_INVALID_PARAMETER_HANDLER]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/msvc-nothrow.m4 b/local/recipes/tools/diffutils/source/m4/msvc-nothrow.m4 new file mode 100644 index 0000000000..3014661f06 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/msvc-nothrow.m4 @@ -0,0 +1,10 @@ +# msvc-nothrow.m4 serial 1 +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_MSVC_NOTHROW], +[ + AC_REQUIRE([gl_MSVC_INVAL]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/multiarch.m4 b/local/recipes/tools/diffutils/source/m4/multiarch.m4 new file mode 100644 index 0000000000..30006cb337 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/multiarch.m4 @@ -0,0 +1,62 @@ +# multiarch.m4 serial 7 +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Determine whether the compiler is or may be producing universal binaries. +# +# On Mac OS X 10.5 and later systems, the user can create libraries and +# executables that work on multiple system types--known as "fat" or +# "universal" binaries--by specifying multiple '-arch' options to the +# compiler but only a single '-arch' option to the preprocessor. Like +# this: +# +# ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ +# CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ +# CPP="gcc -E" CXXCPP="g++ -E" +# +# Detect this situation and set APPLE_UNIVERSAL_BUILD accordingly. + +AC_DEFUN_ONCE([gl_MULTIARCH], +[ + dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN. + gl_cv_c_multiarch=no + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + ]])], + [ + dnl Check for potential -arch flags. It is not universal unless + dnl there are at least two -arch flags with different values. + arch= + prev= + for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do + if test -n "$prev"; then + case $word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$arch" || test "$arch" = "$word"; then + arch="$word" + else + gl_cv_c_multiarch=yes + fi + ;; + esac + prev= + else + if test "x$word" = "x-arch"; then + prev=arch + fi + fi + done + ]) + if test $gl_cv_c_multiarch = yes; then + APPLE_UNIVERSAL_BUILD=1 + else + APPLE_UNIVERSAL_BUILD=0 + fi + AC_SUBST([APPLE_UNIVERSAL_BUILD]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/nanosleep.m4 b/local/recipes/tools/diffutils/source/m4/nanosleep.m4 new file mode 100644 index 0000000000..5590696b4f --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/nanosleep.m4 @@ -0,0 +1,148 @@ +# serial 36 + +dnl From Jim Meyering. +dnl Check for the nanosleep function. +dnl If not found, use the supplied replacement. +dnl + +# Copyright (C) 1999-2001, 2003-2017 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_NANOSLEEP], +[ + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + dnl Persuade glibc and Solaris <time.h> to declare nanosleep. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_CHECK_HEADERS_ONCE([sys/time.h]) + AC_REQUIRE([gl_FUNC_SELECT]) + + nanosleep_save_libs=$LIBS + + # Solaris 2.5.1 needs -lposix4 to get the nanosleep function. + # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. + LIB_NANOSLEEP= + AC_SUBST([LIB_NANOSLEEP]) + AC_SEARCH_LIBS([nanosleep], [rt posix4], + [test "$ac_cv_search_nanosleep" = "none required" || + LIB_NANOSLEEP=$ac_cv_search_nanosleep]) + if test "x$ac_cv_search_nanosleep" != xno; then + dnl The system has a nanosleep function. + + AC_REQUIRE([gl_MULTIARCH]) + if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple Mac OS X platforms. + # The test result would be 'no (mishandles large arguments)' in 64-bit + # mode but 'yes' in 32-bit mode. But we need a configuration result that + # is valid in both modes. + gl_cv_func_nanosleep='no (mishandles large arguments)' + fi + + AC_CACHE_CHECK([for working nanosleep], + [gl_cv_func_nanosleep], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ + #include <errno.h> + #include <limits.h> + #include <signal.h> + #if HAVE_SYS_TIME_H + #include <sys/time.h> + #endif + #include <time.h> + #include <unistd.h> + #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) + #define TYPE_MAXIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) + + static void + check_for_SIGALRM (int sig) + { + if (sig != SIGALRM) + _exit (1); + } + + int + main () + { + static struct timespec ts_sleep; + static struct timespec ts_remaining; + static struct sigaction act; + /* Test for major problems first. */ + if (! nanosleep) + return 2; + act.sa_handler = check_for_SIGALRM; + sigemptyset (&act.sa_mask); + sigaction (SIGALRM, &act, NULL); + ts_sleep.tv_sec = 0; + ts_sleep.tv_nsec = 1; + alarm (1); + if (nanosleep (&ts_sleep, NULL) != 0) + return 3; + /* Test for a minor problem: the handling of large arguments. */ + ts_sleep.tv_sec = TYPE_MAXIMUM (time_t); + ts_sleep.tv_nsec = 999999999; + alarm (1); + if (nanosleep (&ts_sleep, &ts_remaining) != -1) + return 4; + if (errno != EINTR) + return 5; + if (ts_remaining.tv_sec <= TYPE_MAXIMUM (time_t) - 10) + return 6; + return 0; + }]])], + [gl_cv_func_nanosleep=yes], + [case $? in dnl ( + 4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)';; dnl ( + *) gl_cv_func_nanosleep=no;; + esac], + [case "$host_os" in dnl (( + linux*) # Guess it halfway works when the kernel is Linux. + gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;; + *) # If we don't know, assume the worst. + gl_cv_func_nanosleep='guessing no' ;; + esac + ]) + ]) + case "$gl_cv_func_nanosleep" in + *yes) + REPLACE_NANOSLEEP=0 + ;; + *) + REPLACE_NANOSLEEP=1 + case "$gl_cv_func_nanosleep" in + *"mishandles large arguments"*) + AC_DEFINE([HAVE_BUG_BIG_NANOSLEEP], [1], + [Define to 1 if nanosleep mishandles large arguments.]) + ;; + *) + # The replacement uses select(). Add $LIBSOCKET to $LIB_NANOSLEEP. + for ac_lib in $LIBSOCKET; do + case " $LIB_NANOSLEEP " in + *" $ac_lib "*) ;; + *) LIB_NANOSLEEP="$LIB_NANOSLEEP $ac_lib";; + esac + done + ;; + esac + ;; + esac + else + HAVE_NANOSLEEP=0 + fi + LIBS=$nanosleep_save_libs +]) + +# Prerequisites of lib/nanosleep.c. +AC_DEFUN([gl_PREREQ_NANOSLEEP], +[ + AC_CHECK_HEADERS_ONCE([sys/select.h]) + gl_PREREQ_SIG_HANDLER_H +]) diff --git a/local/recipes/tools/diffutils/source/m4/netinet_in_h.m4 b/local/recipes/tools/diffutils/source/m4/netinet_in_h.m4 new file mode 100644 index 0000000000..f936657027 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/netinet_in_h.m4 @@ -0,0 +1,31 @@ +# netinet_in_h.m4 serial 5 +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_HEADER_NETINET_IN], +[ + AC_CACHE_CHECK([whether <netinet/in.h> is self-contained], + [gl_cv_header_netinet_in_h_selfcontained], + [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[]])], + [gl_cv_header_netinet_in_h_selfcontained=yes], + [gl_cv_header_netinet_in_h_selfcontained=no]) + ]) + if test $gl_cv_header_netinet_in_h_selfcontained = yes; then + NETINET_IN_H='' + else + NETINET_IN_H='netinet/in.h' + AC_CHECK_HEADERS([netinet/in.h]) + gl_CHECK_NEXT_HEADERS([netinet/in.h]) + if test $ac_cv_header_netinet_in_h = yes; then + HAVE_NETINET_IN_H=1 + else + HAVE_NETINET_IN_H=0 + fi + AC_SUBST([HAVE_NETINET_IN_H]) + fi + AC_SUBST([NETINET_IN_H]) + AM_CONDITIONAL([GL_GENERATE_NETINET_IN_H], [test -n "$NETINET_IN_H"]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/nl_langinfo.m4 b/local/recipes/tools/diffutils/source/m4/nl_langinfo.m4 new file mode 100644 index 0000000000..16de8de302 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/nl_langinfo.m4 @@ -0,0 +1,50 @@ +# nl_langinfo.m4 serial 5 +dnl Copyright (C) 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_NL_LANGINFO], +[ + AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) + AC_REQUIRE([gl_LANGINFO_H]) + AC_CHECK_FUNCS_ONCE([nl_langinfo]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + if test $ac_cv_func_nl_langinfo = yes; then + # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken. + AC_CACHE_CHECK([whether YESEXPR works], + [gl_cv_func_nl_langinfo_yesexpr_works], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM([[#include <langinfo.h> +]], [[return !*nl_langinfo(YESEXPR); +]])], + [gl_cv_func_nl_langinfo_yesexpr_works=yes], + [gl_cv_func_nl_langinfo_yesexpr_works=no], + [ + case "$host_os" in + # Guess no on irix systems. + irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";; + # Guess yes elsewhere. + *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";; + esac + ]) + ]) + case $gl_cv_func_nl_langinfo_yesexpr_works in + *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;; + *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;; + esac + AC_DEFINE_UNQUOTED([FUNC_NL_LANGINFO_YESEXPR_WORKS], + [$FUNC_NL_LANGINFO_YESEXPR_WORKS], + [Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string.]) + if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \ + && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then + : + else + REPLACE_NL_LANGINFO=1 + AC_DEFINE([REPLACE_NL_LANGINFO], [1], + [Define if nl_langinfo exists but is overridden by gnulib.]) + fi + else + HAVE_NL_LANGINFO=0 + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/nls.m4 b/local/recipes/tools/diffutils/source/m4/nls.m4 new file mode 100644 index 0000000000..53cdc8be8b --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/nls.m4 @@ -0,0 +1,32 @@ +# nls.m4 serial 5 (gettext-0.18) +dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. +dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. + +AC_PREREQ([2.50]) + +AC_DEFUN([AM_NLS], +[ + AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE([nls], + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT([$USE_NLS]) + AC_SUBST([USE_NLS]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/nocrash.m4 b/local/recipes/tools/diffutils/source/m4/nocrash.m4 new file mode 100644 index 0000000000..2c2c5fb457 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/nocrash.m4 @@ -0,0 +1,131 @@ +# nocrash.m4 serial 4 +dnl Copyright (C) 2005, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Based on libsigsegv, from Bruno Haible and Paolo Bonzini. + +AC_PREREQ([2.13]) + +dnl Expands to some code for use in .c programs that will cause the configure +dnl test to exit instead of crashing. This is useful to avoid triggering +dnl action from a background debugger and to avoid core dumps. +dnl Usage: ... +dnl ]GL_NOCRASH[ +dnl ... +dnl int main() { nocrash_init(); ... } +AC_DEFUN([GL_NOCRASH],[[ +#include <stdlib.h> +#if defined __MACH__ && defined __APPLE__ +/* Avoid a crash on Mac OS X. */ +#include <mach/mach.h> +#include <mach/mach_error.h> +#include <mach/thread_status.h> +#include <mach/exception.h> +#include <mach/task.h> +#include <pthread.h> +/* The exception port on which our thread listens. */ +static mach_port_t our_exception_port; +/* The main function of the thread listening for exceptions of type + EXC_BAD_ACCESS. */ +static void * +mach_exception_thread (void *arg) +{ + /* Buffer for a message to be received. */ + struct { + mach_msg_header_t head; + mach_msg_body_t msgh_body; + char data[1024]; + } msg; + mach_msg_return_t retval; + /* Wait for a message on the exception port. */ + retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), + our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + if (retval != MACH_MSG_SUCCESS) + abort (); + exit (1); +} +static void +nocrash_init (void) +{ + mach_port_t self = mach_task_self (); + /* Allocate a port on which the thread shall listen for exceptions. */ + if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) + == KERN_SUCCESS) { + /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ + if (mach_port_insert_right (self, our_exception_port, our_exception_port, + MACH_MSG_TYPE_MAKE_SEND) + == KERN_SUCCESS) { + /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting + for us. */ + exception_mask_t mask = EXC_MASK_BAD_ACCESS; + /* Create the thread listening on the exception port. */ + pthread_attr_t attr; + pthread_t thread; + if (pthread_attr_init (&attr) == 0 + && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 + && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { + pthread_attr_destroy (&attr); + /* Replace the exception port info for these exceptions with our own. + Note that we replace the exception port for the entire task, not only + for a particular thread. This has the effect that when our exception + port gets the message, the thread specific exception port has already + been asked, and we don't need to bother about it. + See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ + task_set_exception_ports (self, mask, our_exception_port, + EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); + } + } + } +} +#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Avoid a crash on native Windows. */ +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <winerror.h> +static LONG WINAPI +exception_filter (EXCEPTION_POINTERS *ExceptionInfo) +{ + switch (ExceptionInfo->ExceptionRecord->ExceptionCode) + { + case EXCEPTION_ACCESS_VIOLATION: + case EXCEPTION_IN_PAGE_ERROR: + case EXCEPTION_STACK_OVERFLOW: + case EXCEPTION_GUARD_PAGE: + case EXCEPTION_PRIV_INSTRUCTION: + case EXCEPTION_ILLEGAL_INSTRUCTION: + case EXCEPTION_DATATYPE_MISALIGNMENT: + case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: + case EXCEPTION_NONCONTINUABLE_EXCEPTION: + exit (1); + } + return EXCEPTION_CONTINUE_SEARCH; +} +static void +nocrash_init (void) +{ + SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter); +} +#else +/* Avoid a crash on POSIX systems. */ +#include <signal.h> +#include <unistd.h> +/* A POSIX signal handler. */ +static void +exception_handler (int sig) +{ + _exit (1); +} +static void +nocrash_init (void) +{ +#ifdef SIGSEGV + signal (SIGSEGV, exception_handler); +#endif +#ifdef SIGBUS + signal (SIGBUS, exception_handler); +#endif +} +#endif +]]) diff --git a/local/recipes/tools/diffutils/source/m4/off_t.m4 b/local/recipes/tools/diffutils/source/m4/off_t.m4 new file mode 100644 index 0000000000..92c45ef785 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/off_t.m4 @@ -0,0 +1,18 @@ +# off_t.m4 serial 1 +dnl Copyright (C) 2012-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Check whether to override the 'off_t' type. +dnl Set WINDOWS_64_BIT_OFF_T. + +AC_DEFUN([gl_TYPE_OFF_T], +[ + m4_ifdef([gl_LARGEFILE], [ + AC_REQUIRE([gl_LARGEFILE]) + ], [ + WINDOWS_64_BIT_OFF_T=0 + ]) + AC_SUBST([WINDOWS_64_BIT_OFF_T]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/open.m4 b/local/recipes/tools/diffutils/source/m4/open.m4 new file mode 100644 index 0000000000..2a869dc6b7 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/open.m4 @@ -0,0 +1,91 @@ +# open.m4 serial 14 +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_OPEN], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw* | pw*) + REPLACE_OPEN=1 + ;; + *) + dnl open("foo/") should not create a file when the file name has a + dnl trailing slash. FreeBSD only has the problem on symlinks. + AC_CHECK_FUNCS_ONCE([lstat]) + AC_CACHE_CHECK([whether open recognizes a trailing slash], + [gl_cv_func_open_slash], + [# Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + touch conftest.tmp + ln -s conftest.tmp conftest.lnk + fi + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <fcntl.h> +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +int main () +{ + int result = 0; +#if HAVE_LSTAT + if (open ("conftest.lnk/", O_RDONLY) != -1) + result |= 1; +#endif + if (open ("conftest.sl/", O_CREAT, 0600) >= 0) + result |= 2; + return result; +}]])], + [gl_cv_func_open_slash=yes], + [gl_cv_func_open_slash=no], + [ +changequote(,)dnl + case "$host_os" in + freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*) + gl_cv_func_open_slash="guessing no" ;; + *) + gl_cv_func_open_slash="guessing yes" ;; + esac +changequote([,])dnl + ]) + rm -f conftest.sl conftest.tmp conftest.lnk + ]) + case "$gl_cv_func_open_slash" in + *no) + AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1], + [Define to 1 if open() fails to recognize a trailing slash.]) + REPLACE_OPEN=1 + ;; + esac + ;; + esac + dnl Replace open() for supporting the gnulib-defined fchdir() function, + dnl to keep fchdir's bookkeeping up-to-date. + m4_ifdef([gl_FUNC_FCHDIR], [ + if test $REPLACE_OPEN = 0; then + gl_TEST_FCHDIR + if test $HAVE_FCHDIR = 0; then + REPLACE_OPEN=1 + fi + fi + ]) + dnl Replace open() for supporting the gnulib-defined O_NONBLOCK flag. + m4_ifdef([gl_NONBLOCKING_IO], [ + if test $REPLACE_OPEN = 0; then + gl_NONBLOCKING_IO + if test $gl_cv_have_open_O_NONBLOCK != yes; then + REPLACE_OPEN=1 + fi + fi + ]) +]) + +# Prerequisites of lib/open.c. +AC_DEFUN([gl_PREREQ_OPEN], +[ + AC_REQUIRE([gl_PROMOTED_TYPE_MODE_T]) + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/pathmax.m4 b/local/recipes/tools/diffutils/source/m4/pathmax.m4 new file mode 100644 index 0000000000..c6c9f24d06 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/pathmax.m4 @@ -0,0 +1,42 @@ +# pathmax.m4 serial 10 +dnl Copyright (C) 2002-2003, 2005-2006, 2009-2017 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_PATHMAX], +[ + dnl Prerequisites of lib/pathmax.h. + AC_CHECK_HEADERS_ONCE([sys/param.h]) +]) + +# Expands to a piece of C program that defines PATH_MAX in the same way as +# "pathmax.h" will do. +AC_DEFUN([gl_PATHMAX_SNIPPET], [[ +/* Arrange to define PATH_MAX, like "pathmax.h" does. */ +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +#include <limits.h> +#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN +# include <sys/param.h> +#endif +#if !defined PATH_MAX && defined MAXPATHLEN +# define PATH_MAX MAXPATHLEN +#endif +#ifdef __hpux +# undef PATH_MAX +# define PATH_MAX 1024 +#endif +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# undef PATH_MAX +# define PATH_MAX 260 +#endif +]]) + +# Prerequisites of gl_PATHMAX_SNIPPET. +AC_DEFUN([gl_PATHMAX_SNIPPET_PREREQ], +[ + AC_CHECK_HEADERS_ONCE([unistd.h sys/param.h]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/perror.m4 b/local/recipes/tools/diffutils/source/m4/perror.m4 new file mode 100644 index 0000000000..752cb44be1 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/perror.m4 @@ -0,0 +1,63 @@ +# perror.m4 serial 6 +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_PERROR], +[ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_REQUIRE([gl_HEADER_ERRNO_H]) + AC_REQUIRE([gl_FUNC_STRERROR_R]) + AC_REQUIRE([gl_FUNC_STRERROR_0]) + dnl We intentionally do not check for the broader REPLACE_STRERROR_R, + dnl since on glibc systems, strerror_r is replaced only for signature + dnl issues, and perror is just fine. Rather, we only want to + dnl replace perror if strerror_r was replaced for a content fix. + if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then + dnl The system's perror() cannot know about the new errno values we add + dnl to <errno.h>, or any fix for strerror(0). Replace it. + REPLACE_PERROR=1 + fi + case ${gl_cv_func_strerror_r_works-unset} in + unset|*yes) + AC_CACHE_CHECK([whether perror matches strerror], + [gl_cv_func_perror_works], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <errno.h> + #include <stdio.h> + #include <stdlib.h> + #include <string.h> + ]], + [[char *str = strerror (-1); + if (!getenv("CONFTEST_OUTPUT")) return 0; + if (!str) str = ""; + puts (str); + errno = -1; + perror (""); + return 0; + ]])], + [if CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2 \ + && cmp conftest.txt1 conftest.txt2 >/dev/null; then + gl_cv_func_perror_works=yes + else + gl_cv_func_perror_works=no + fi + rm -rf conftest.txt1 conftest.txt2], + [gl_cv_func_perror_works=no], + [dnl Guess no when cross-compiling. + gl_cv_func_perror_works="guessing no" + ]) + ]) + if test "$gl_cv_func_perror_works" != yes; then + REPLACE_PERROR=1 + fi + ;; + *) + dnl The system's perror() probably inherits the bugs in the + dnl system's strerror_r(). Replace it. + REPLACE_PERROR=1 + ;; + esac +]) diff --git a/local/recipes/tools/diffutils/source/m4/pipe.m4 b/local/recipes/tools/diffutils/source/m4/pipe.m4 new file mode 100644 index 0000000000..c35b32c50e --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/pipe.m4 @@ -0,0 +1,15 @@ +# pipe.m4 serial 2 +dnl Copyright (C) 2010-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_PIPE], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + + AC_CHECK_FUNCS_ONCE([pipe]) + if test $ac_cv_func_pipe != yes; then + HAVE_PIPE=0 + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/po.m4 b/local/recipes/tools/diffutils/source/m4/po.m4 new file mode 100644 index 0000000000..84659ea531 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/po.m4 @@ -0,0 +1,453 @@ +# po.m4 serial 22 (gettext-0.19) +dnl Copyright (C) 1995-2014 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. +dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. + +AC_PREREQ([2.60]) + +dnl Checks for all prerequisites of the po subdirectory. +AC_DEFUN([AM_PO_SUBDIRS], +[ + AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl + AC_REQUIRE([AC_PROG_MKDIR_P])dnl + AC_REQUIRE([AC_PROG_SED])dnl + AC_REQUIRE([AM_NLS])dnl + + dnl Release version of the gettext macros. This is used to ensure that + dnl the gettext macros and po/Makefile.in.in are in sync. + AC_SUBST([GETTEXT_MACRO_VERSION], [0.19]) + + dnl Perform the following tests also if --disable-nls has been given, + dnl because they are needed for "make dist" to work. + + dnl Search for GNU msgfmt in the PATH. + dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. + dnl The second test excludes FreeBSD msgfmt. + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) + + dnl Test whether it is GNU msgfmt >= 0.15. +changequote(,)dnl + case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; + *) MSGFMT_015=$MSGFMT ;; + esac +changequote([,])dnl + AC_SUBST([MSGFMT_015]) +changequote(,)dnl + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac +changequote([,])dnl + AC_SUBST([GMSGFMT_015]) + + dnl Search for GNU xgettext 0.12 or newer in the PATH. + dnl The first test excludes Solaris xgettext and early GNU xgettext versions. + dnl The second test excludes FreeBSD xgettext. + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + dnl Remove leftover from FreeBSD xgettext call. + rm -f messages.po + + dnl Test whether it is GNU xgettext >= 0.15. +changequote(,)dnl + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac +changequote([,])dnl + AC_SUBST([XGETTEXT_015]) + + dnl Search for GNU msgmerge 0.11 or newer in the PATH. + AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, + [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) + + dnl Installation directories. + dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we + dnl have to define it here, so that it can be used in po/Makefile. + test -n "$localedir" || localedir='${datadir}/locale' + AC_SUBST([localedir]) + + dnl Support for AM_XGETTEXT_OPTION. + test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) + + AC_CONFIG_COMMANDS([po-directories], [[ + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + # Treat a directory as a PO directory if and only if it has a + # POTFILES.in file. This allows packages to have multiple PO + # directories under different names or in different locations. + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done]], + [# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it + # from automake < 1.5. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + ]) +]) + +dnl Postprocesses a Makefile in a directory containing PO files. +AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], +[ + # When this code is run, in config.status, two variables have already been + # set: + # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, + # - LINGUAS is the value of the environment variable LINGUAS at configure + # time. + +changequote(,)dnl + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + # Find a way to echo strings without interpreting backslash. + if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then + gt_echo='echo' + else + if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then + gt_echo='printf %s\n' + else + echo_func () { + cat <<EOT +$* +EOT + } + gt_echo='echo_func' + fi + fi + + # A sed script that extracts the value of VARIABLE from a Makefile. + tab=`printf '\t'` + sed_x_variable=' +# Test if the hold space is empty. +x +s/P/P/ +x +ta +# Yes it was empty. Look if we have the expected variable definition. +/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{ + # Seen the first line of the variable definition. + s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=// + ba +} +bd +:a +# Here we are processing a line from the variable definition. +# Remove comment, more precisely replace it with a space. +s/#.*$/ / +# See if the line ends in a backslash. +tb +:b +s/\\$// +# Print the line, without the trailing backslash. +p +tc +# There was no trailing backslash. The end of the variable definition is +# reached. Clear the hold space. +s/^.*$// +x +bd +:c +# A trailing backslash means that the variable definition continues in the +# next line. Put a nonempty string into the hold space to indicate this. +s/^.*$/P/ +x +:d +' +changequote([,])dnl + + # Set POTFILES to the value of the Makefile variable POTFILES. + sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'` + POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"` + # Compute POTFILES_DEPS as + # $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) + POTFILES_DEPS= + for file in $POTFILES; do + POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file" + done + POMAKEFILEDEPS="" + + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS. + sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'` + ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"` + fi + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + # Compute PROPERTIESFILES + # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties) + # Compute CLASSFILES + # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class) + # Compute QMFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm) + # Compute MSGFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg) + # Compute RESOURCESDLLFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + PROPERTIESFILES= + CLASSFILES= + QMFILES= + MSGFILES= + RESOURCESDLLFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties" + CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class" + QMFILES="$QMFILES $srcdirpre$lang.qm" + frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` + MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg" + frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` + RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + JAVACATALOGS= + QTCATALOGS= + TCLCATALOGS= + CSHARPCATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties" + QTCATALOGS="$QTCATALOGS $lang.qm" + frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` + TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg" + frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` + CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll" + done + fi + + sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp" + tab=`printf '\t'` + if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then + # Add dependencies that cannot be formulated as a simple suffix rule. + for lang in $ALL_LINGUAS; do + frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` + cat >> "$ac_file.tmp" <<EOF +$frobbedlang.msg: $lang.po +${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \ +${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; } +EOF + done + fi + if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then + # Add dependencies that cannot be formulated as a simple suffix rule. + for lang in $ALL_LINGUAS; do + frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` + cat >> "$ac_file.tmp" <<EOF +$frobbedlang/\$(DOMAIN).resources.dll: $lang.po +${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \ +${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; } +EOF + done + fi + if test -n "$POMAKEFILEDEPS"; then + cat >> "$ac_file.tmp" <<EOF +Makefile: $POMAKEFILEDEPS +EOF + fi + mv "$ac_file.tmp" "$ac_file" +]) + +dnl Initializes the accumulator used by AM_XGETTEXT_OPTION. +AC_DEFUN([AM_XGETTEXT_OPTION_INIT], +[ + XGETTEXT_EXTRA_OPTIONS= +]) + +dnl Registers an option to be passed to xgettext in the po subdirectory. +AC_DEFUN([AM_XGETTEXT_OPTION], +[ + AC_REQUIRE([AM_XGETTEXT_OPTION_INIT]) + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1" +]) diff --git a/local/recipes/tools/diffutils/source/m4/printf.m4 b/local/recipes/tools/diffutils/source/m4/printf.m4 new file mode 100644 index 0000000000..113cc2e606 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/printf.m4 @@ -0,0 +1,1564 @@ +# printf.m4 serial 53 +dnl Copyright (C) 2003, 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Test whether the *printf family of functions supports the 'j', 'z', 't', +dnl 'L' size specifiers. (ISO C99, POSIX:2001) +dnl Result is gl_cv_func_printf_sizes_c99. + +AC_DEFUN([gl_PRINTF_SIZES_C99], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gl_AC_HEADER_STDINT_H]) + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports size specifiers as in C99], + [gl_cv_func_printf_sizes_c99], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#include <sys/types.h> +#if HAVE_STDINT_H_WITH_UINTMAX +# include <stdint.h> +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +# include <inttypes.h> +#endif +static char buf[100]; +int main () +{ + int result = 0; +#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX + buf[0] = '\0'; + if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0 + || strcmp (buf, "12345671 33") != 0) + result |= 1; +#else + result |= 1; +#endif + buf[0] = '\0'; + if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0 + || strcmp (buf, "12345672 33") != 0) + result |= 2; + buf[0] = '\0'; + if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0 + || strcmp (buf, "12345673 33") != 0) + result |= 4; + buf[0] = '\0'; + if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0 + || strcmp (buf, "1.5 33") != 0) + result |= 8; + return result; +}]])], + [gl_cv_func_printf_sizes_c99=yes], + [gl_cv_func_printf_sizes_c99=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_printf_sizes_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";; + darwin*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_printf_sizes_c99="guessing no";; + openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_sizes_c99="guessing no";; + netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_sizes_c99="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports 'long double' +dnl arguments together with the 'L' size specifier. (ISO C99, POSIX:2001) +dnl Result is gl_cv_func_printf_long_double. + +AC_DEFUN([gl_PRINTF_LONG_DOUBLE], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports 'long double' arguments], + [gl_cv_func_printf_long_double], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#include <string.h> +static char buf[10000]; +int main () +{ + int result = 0; + buf[0] = '\0'; + if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.750000 33") != 0) + result |= 1; + buf[0] = '\0'; + if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.750000e+00 33") != 0) + result |= 2; + buf[0] = '\0'; + if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.75 33") != 0) + result |= 4; + return result; +}]])], + [gl_cv_func_printf_long_double=yes], + [gl_cv_func_printf_long_double=no], + [ +changequote(,)dnl + case "$host_os" in + beos*) gl_cv_func_printf_long_double="guessing no";; + mingw* | pw*) gl_cv_func_printf_long_double="guessing no";; + *) gl_cv_func_printf_long_double="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports infinite and NaN +dnl 'double' arguments and negative zero arguments in the %f, %e, %g +dnl directives. (ISO C99, POSIX:2001) +dnl Result is gl_cv_func_printf_infinite. + +AC_DEFUN([gl_PRINTF_INFINITE], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports infinite 'double' arguments], + [gl_cv_func_printf_infinite], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#include <string.h> +static int +strisnan (const char *string, size_t start_index, size_t end_index) +{ + if (start_index < end_index) + { + if (string[start_index] == '-') + start_index++; + if (start_index + 3 <= end_index + && memcmp (string + start_index, "nan", 3) == 0) + { + start_index += 3; + if (start_index == end_index + || (string[start_index] == '(' && string[end_index - 1] == ')')) + return 1; + } + } + return 0; +} +static int +have_minus_zero () +{ + static double plus_zero = 0.0; + double minus_zero = - plus_zero; + return memcmp (&plus_zero, &minus_zero, sizeof (double)) != 0; +} +static char buf[10000]; +static double zero = 0.0; +int main () +{ + int result = 0; + if (sprintf (buf, "%f", 1.0 / zero) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 1; + if (sprintf (buf, "%f", -1.0 / zero) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 1; + if (sprintf (buf, "%f", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%e", 1.0 / zero) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 4; + if (sprintf (buf, "%e", -1.0 / zero) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 4; + if (sprintf (buf, "%e", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 8; + if (sprintf (buf, "%g", 1.0 / zero) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 16; + if (sprintf (buf, "%g", -1.0 / zero) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 16; + if (sprintf (buf, "%g", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 32; + /* This test fails on HP-UX 10.20. */ + if (have_minus_zero ()) + if (sprintf (buf, "%g", - zero) < 0 + || strcmp (buf, "-0") != 0) + result |= 64; + return result; +}]])], + [gl_cv_func_printf_infinite=yes], + [gl_cv_func_printf_infinite=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5].*) gl_cv_func_printf_infinite="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";; + darwin*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";; + hpux*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_infinite="guessing no";; + netbsd*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_infinite="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_infinite="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports infinite and NaN +dnl 'long double' arguments in the %f, %e, %g directives. (ISO C99, POSIX:2001) +dnl Result is gl_cv_func_printf_infinite_long_double. + +AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE], +[ + AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gl_BIGENDIAN]) + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + dnl The user can set or unset the variable gl_printf_safe to indicate + dnl that he wishes a safe handling of non-IEEE-754 'long double' values. + if test -n "$gl_printf_safe"; then + AC_DEFINE([CHECK_PRINTF_SAFE], [1], + [Define if you wish *printf() functions that have a safe handling of + non-IEEE-754 'long double' values.]) + fi + case "$gl_cv_func_printf_long_double" in + *yes) + AC_CACHE_CHECK([whether printf supports infinite 'long double' arguments], + [gl_cv_func_printf_infinite_long_double], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +]GL_NOCRASH[ +#include <float.h> +#include <stdio.h> +#include <string.h> +static int +strisnan (const char *string, size_t start_index, size_t end_index) +{ + if (start_index < end_index) + { + if (string[start_index] == '-') + start_index++; + if (start_index + 3 <= end_index + && memcmp (string + start_index, "nan", 3) == 0) + { + start_index += 3; + if (start_index == end_index + || (string[start_index] == '(' && string[end_index - 1] == ')')) + return 1; + } + } + return 0; +} +static char buf[10000]; +static long double zeroL = 0.0L; +int main () +{ + int result = 0; + nocrash_init(); + if (sprintf (buf, "%Lf", 1.0L / zeroL) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Lf", -1.0L / zeroL) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Lf", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 1; + if (sprintf (buf, "%Le", 1.0L / zeroL) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Le", -1.0L / zeroL) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Le", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 1; + if (sprintf (buf, "%Lg", 1.0L / zeroL) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Lg", -1.0L / zeroL) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Lg", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 1; +#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE +/* Representation of an 80-bit 'long double' as an initializer for a sequence + of 'unsigned int' words. */ +# ifdef WORDS_BIGENDIAN +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ + (unsigned int) (mantlo) << 16 \ + } +# else +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { mantlo, manthi, exponent } +# endif + { /* Quiet NaN. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + } + { + /* Signalling NaN. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + } + { /* Pseudo-NaN. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 4; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 4; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 4; + } + { /* Pseudo-Infinity. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 8; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 8; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 8; + } + { /* Pseudo-Zero. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 16; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 16; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 16; + } + { /* Unnormalized number. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 32; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 32; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 32; + } + { /* Pseudo-Denormal. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 64; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 64; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 64; + } +#endif + return result; +}]])], + [gl_cv_func_printf_infinite_long_double=yes], + [gl_cv_func_printf_infinite_long_double=no], + [ +changequote(,)dnl + case "$host_cpu" in + # Guess no on ia64, x86_64, i386. + ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";; + *) + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";; + hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_infinite_long_double="guessing no";; + esac + ;; + esac +changequote([,])dnl + ]) + ]) + ;; + *) + gl_cv_func_printf_infinite_long_double="irrelevant" + ;; + esac +]) + +dnl Test whether the *printf family of functions supports the 'a' and 'A' +dnl conversion specifier for hexadecimal output of floating-point numbers. +dnl (ISO C99, POSIX:2001) +dnl Result is gl_cv_func_printf_directive_a. + +AC_DEFUN([gl_PRINTF_DIRECTIVE_A], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives], + [gl_cv_func_printf_directive_a], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#include <string.h> +static char buf[100]; +static double zero = 0.0; +int main () +{ + int result = 0; + if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0 + || (strcmp (buf, "0x1.922p+1 33") != 0 + && strcmp (buf, "0x3.244p+0 33") != 0 + && strcmp (buf, "0x6.488p-1 33") != 0 + && strcmp (buf, "0xc.91p-2 33") != 0)) + result |= 1; + if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0 + || (strcmp (buf, "-0X1.922P+1 33") != 0 + && strcmp (buf, "-0X3.244P+0 33") != 0 + && strcmp (buf, "-0X6.488P-1 33") != 0 + && strcmp (buf, "-0XC.91P-2 33") != 0)) + result |= 2; + /* This catches a FreeBSD 6.1 bug: it doesn't round. */ + if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0 + || (strcmp (buf, "0x1.83p+0 33") != 0 + && strcmp (buf, "0x3.05p-1 33") != 0 + && strcmp (buf, "0x6.0ap-2 33") != 0 + && strcmp (buf, "0xc.14p-3 33") != 0)) + result |= 4; + /* This catches a Mac OS X 10.12.4 (Darwin 16.5) bug: it doesn't round. */ + if (sprintf (buf, "%.0a %d", 1.51, 33, 44, 55) < 0 + || (strcmp (buf, "0x2p+0 33") != 0 + && strcmp (buf, "0x3p-1 33") != 0 + && strcmp (buf, "0x6p-2 33") != 0 + && strcmp (buf, "0xcp-3 33") != 0)) + result |= 4; + /* This catches a FreeBSD 6.1 bug. See + <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */ + if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0 + || buf[0] == '0') + result |= 8; + /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug. */ + if (sprintf (buf, "%.1a", 1.999) < 0 + || (strcmp (buf, "0x1.0p+1") != 0 + && strcmp (buf, "0x2.0p+0") != 0 + && strcmp (buf, "0x4.0p-1") != 0 + && strcmp (buf, "0x8.0p-2") != 0)) + result |= 16; + /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a + glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */ + if (sprintf (buf, "%.1La", 1.999L) < 0 + || (strcmp (buf, "0x1.0p+1") != 0 + && strcmp (buf, "0x2.0p+0") != 0 + && strcmp (buf, "0x4.0p-1") != 0 + && strcmp (buf, "0x8.0p-2") != 0)) + result |= 32; + return result; +}]])], + [gl_cv_func_printf_directive_a=yes], + [gl_cv_func_printf_directive_a=no], + [ + case "$host_os" in + # Guess yes on glibc >= 2.5 systems. + *-gnu*) + AC_EGREP_CPP([BZ2908], [ + #include <features.h> + #ifdef __GNU_LIBRARY__ + #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)) && !defined __UCLIBC__ + BZ2908 + #endif + #endif + ], + [gl_cv_func_printf_directive_a="guessing yes"], + [gl_cv_func_printf_directive_a="guessing no"]) + ;; + # If we don't know, assume the worst. + *) gl_cv_func_printf_directive_a="guessing no";; + esac + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports the %F format +dnl directive. (ISO C99, POSIX:2001) +dnl Result is gl_cv_func_printf_directive_f. + +AC_DEFUN([gl_PRINTF_DIRECTIVE_F], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the 'F' directive], + [gl_cv_func_printf_directive_f], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#include <string.h> +static char buf[100]; +static double zero = 0.0; +int main () +{ + int result = 0; + if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0 + || strcmp (buf, "1234567.000000 33") != 0) + result |= 1; + if (sprintf (buf, "%F", 1.0 / zero) < 0 + || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0)) + result |= 2; + /* This catches a Cygwin 1.5.x bug. */ + if (sprintf (buf, "%.F", 1234.0) < 0 + || strcmp (buf, "1234") != 0) + result |= 4; + return result; +}]])], + [gl_cv_func_printf_directive_f=yes], + [gl_cv_func_printf_directive_f=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";; + darwin*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_directive_f="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports the %n format +dnl directive. (ISO C99, POSIX:2001) +dnl Result is gl_cv_func_printf_directive_n. + +AC_DEFUN([gl_PRINTF_DIRECTIVE_N], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the 'n' directive], + [gl_cv_func_printf_directive_n], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#ifdef _MSC_VER +/* See page about "Parameter Validation" on msdn.microsoft.com. */ +static void cdecl +invalid_parameter_handler (const wchar_t *expression, + const wchar_t *function, + const wchar_t *file, unsigned int line, + uintptr_t dummy) +{ + exit (1); +} +#endif +static char fmtstring[10]; +static char buf[100]; +int main () +{ + int count = -1; +#ifdef _MSC_VER + _set_invalid_parameter_handler (invalid_parameter_handler); +#endif + /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) + support %n in format strings in read-only memory but not in writable + memory. */ + strcpy (fmtstring, "%d %n"); + if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0 + || strcmp (buf, "123 ") != 0 + || count != 4) + return 1; + return 0; +}]])], + [gl_cv_func_printf_directive_n=yes], + [gl_cv_func_printf_directive_n=no], + [ +changequote(,)dnl + case "$host_os" in + mingw*) gl_cv_func_printf_directive_n="guessing no";; + *) gl_cv_func_printf_directive_n="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports the %ls format +dnl directive and in particular, when a precision is specified, whether +dnl the functions stop converting the wide string argument when the number +dnl of bytes that have been produced by this conversion equals or exceeds +dnl the precision. +dnl Result is gl_cv_func_printf_directive_ls. + +AC_DEFUN([gl_PRINTF_DIRECTIVE_LS], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the 'ls' directive], + [gl_cv_func_printf_directive_ls], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +#include <string.h> +int main () +{ + int result = 0; + char buf[100]; + /* Test whether %ls works at all. + This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on + Cygwin 1.5. */ + { + static const wchar_t wstring[] = { 'a', 'b', 'c', 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%ls", wstring) < 0 + || strcmp (buf, "abc") != 0) + result |= 1; + } + /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an + assertion failure inside libc), but not on OpenBSD 4.0. */ + { + static const wchar_t wstring[] = { 'a', 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%ls", wstring) < 0 + || strcmp (buf, "a") != 0) + result |= 2; + } + /* Test whether precisions in %ls are supported as specified in ISO C 99 + section 7.19.6.1: + "If a precision is specified, no more than that many bytes are written + (including shift sequences, if any), and the array shall contain a + null wide character if, to equal the multibyte character sequence + length given by the precision, the function would need to access a + wide character one past the end of the array." + This test fails on Solaris 10. */ + { + static const wchar_t wstring[] = { 'a', 'b', (wchar_t) 0xfdfdfdfd, 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%.2ls", wstring) < 0 + || strcmp (buf, "ab") != 0) + result |= 8; + } + return result; +}]])], + [gl_cv_func_printf_directive_ls=yes], + [gl_cv_func_printf_directive_ls=no], + [ +changequote(,)dnl + case "$host_os" in + openbsd*) gl_cv_func_printf_directive_ls="guessing no";; + irix*) gl_cv_func_printf_directive_ls="guessing no";; + solaris*) gl_cv_func_printf_directive_ls="guessing no";; + cygwin*) gl_cv_func_printf_directive_ls="guessing no";; + beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; + *) gl_cv_func_printf_directive_ls="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports POSIX/XSI format +dnl strings with positions. (POSIX:2001) +dnl Result is gl_cv_func_printf_positions. + +AC_DEFUN([gl_PRINTF_POSITIONS], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with positions], + [gl_cv_func_printf_positions], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#include <string.h> +/* The string "%2$d %1$d", with dollar characters protected from the shell's + dollar expansion (possibly an autoconf bug). */ +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; +static char buf[100]; +int main () +{ + sprintf (buf, format, 33, 55); + return (strcmp (buf, "55 33") != 0); +}]])], + [gl_cv_func_printf_positions=yes], + [gl_cv_func_printf_positions=no], + [ +changequote(,)dnl + case "$host_os" in + netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) + gl_cv_func_printf_positions="guessing no";; + beos*) gl_cv_func_printf_positions="guessing no";; + mingw* | pw*) gl_cv_func_printf_positions="guessing no";; + *) gl_cv_func_printf_positions="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports POSIX/XSI format +dnl strings with the ' flag for grouping of decimal digits. (POSIX:2001) +dnl Result is gl_cv_func_printf_flag_grouping. + +AC_DEFUN([gl_PRINTF_FLAG_GROUPING], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the grouping flag], + [gl_cv_func_printf_flag_grouping], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#include <string.h> +static char buf[100]; +int main () +{ + if (sprintf (buf, "%'d %d", 1234567, 99) < 0 + || buf[strlen (buf) - 1] != '9') + return 1; + return 0; +}]])], + [gl_cv_func_printf_flag_grouping=yes], + [gl_cv_func_printf_flag_grouping=no], + [ +changequote(,)dnl + case "$host_os" in + cygwin*) gl_cv_func_printf_flag_grouping="guessing no";; + netbsd*) gl_cv_func_printf_flag_grouping="guessing no";; + mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";; + *) gl_cv_func_printf_flag_grouping="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports the - flag correctly. +dnl (ISO C99.) See +dnl <http://lists.gnu.org/archive/html/bug-coreutils/2008-02/msg00035.html> +dnl Result is gl_cv_func_printf_flag_leftadjust. + +AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the left-adjust flag correctly], + [gl_cv_func_printf_flag_leftadjust], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#include <string.h> +static char buf[100]; +int main () +{ + /* Check that a '-' flag is not annihilated by a negative width. */ + if (sprintf (buf, "a%-*sc", -3, "b") < 0 + || strcmp (buf, "ab c") != 0) + return 1; + return 0; +}]])], + [gl_cv_func_printf_flag_leftadjust=yes], + [gl_cv_func_printf_flag_leftadjust=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on HP-UX 11. + hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";; + # Guess no on HP-UX 10 and older. + hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_printf_flag_leftadjust="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports padding of non-finite +dnl values with the 0 flag correctly. (ISO C99 + TC1 + TC2.) See +dnl <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> +dnl Result is gl_cv_func_printf_flag_zero. + +AC_DEFUN([gl_PRINTF_FLAG_ZERO], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the zero flag correctly], + [gl_cv_func_printf_flag_zero], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#include <string.h> +static char buf[100]; +static double zero = 0.0; +int main () +{ + if (sprintf (buf, "%010f", 1.0 / zero, 33, 44, 55) < 0 + || (strcmp (buf, " inf") != 0 + && strcmp (buf, " infinity") != 0)) + return 1; + return 0; +}]])], + [gl_cv_func_printf_flag_zero=yes], + [gl_cv_func_printf_flag_zero=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_flag_zero="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_flag_zero="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports large precisions. +dnl On mingw, precisions larger than 512 are treated like 512, in integer, +dnl floating-point or pointer output. On Solaris 10/x86, precisions larger +dnl than 510 in floating-point output crash the program. On Solaris 10/SPARC, +dnl precisions larger than 510 in floating-point output yield wrong results. +dnl On AIX 7.1, precisions larger than 998 in floating-point output yield +dnl wrong results. On BeOS, precisions larger than 1044 crash the program. +dnl Result is gl_cv_func_printf_precision. + +AC_DEFUN([gl_PRINTF_PRECISION], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports large precisions], + [gl_cv_func_printf_precision], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#include <string.h> +static char buf[5000]; +int main () +{ + int result = 0; +#ifdef __BEOS__ + /* On BeOS, this would crash and show a dialog box. Avoid the crash. */ + return 1; +#endif + if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3) + result |= 1; + if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5) + result |= 2; + if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5 + || buf[0] != '1') + result |= 4; + if (sprintf (buf, "%.999f %d", 1.0, 33, 44) < 999 + 5 + || buf[0] != '1') + result |= 4; + return result; +}]])], + [gl_cv_func_printf_precision=yes], + [gl_cv_func_printf_precision=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess no only on Solaris, native Windows, and BeOS systems. + solaris*) gl_cv_func_printf_precision="guessing no" ;; + mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;; + beos*) gl_cv_func_printf_precision="guessing no" ;; + *) gl_cv_func_printf_precision="guessing yes" ;; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the *printf family of functions recovers gracefully in case +dnl of an out-of-memory condition, or whether it crashes the entire program. +dnl Result is gl_cv_func_printf_enomem. + +AC_DEFUN([gl_PRINTF_ENOMEM], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gl_MULTIARCH]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf survives out-of-memory conditions], + [gl_cv_func_printf_enomem], + [ + gl_cv_func_printf_enomem="guessing no" + if test "$cross_compiling" = no; then + if test $APPLE_UNIVERSAL_BUILD = 0; then + AC_LANG_CONFTEST([AC_LANG_SOURCE([ +]GL_NOCRASH[ +changequote(,)dnl +#include <stdio.h> +#include <sys/types.h> +#include <sys/time.h> +#include <sys/resource.h> +#include <errno.h> +int main() +{ + struct rlimit limit; + int ret; + nocrash_init (); + /* Some printf implementations allocate temporary space with malloc. */ + /* On BSD systems, malloc() is limited by RLIMIT_DATA. */ +#ifdef RLIMIT_DATA + if (getrlimit (RLIMIT_DATA, &limit) < 0) + return 77; + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) + limit.rlim_max = 5000000; + limit.rlim_cur = limit.rlim_max; + if (setrlimit (RLIMIT_DATA, &limit) < 0) + return 77; +#endif + /* On Linux systems, malloc() is limited by RLIMIT_AS. */ +#ifdef RLIMIT_AS + if (getrlimit (RLIMIT_AS, &limit) < 0) + return 77; + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) + limit.rlim_max = 5000000; + limit.rlim_cur = limit.rlim_max; + if (setrlimit (RLIMIT_AS, &limit) < 0) + return 77; +#endif + /* Some printf implementations allocate temporary space on the stack. */ +#ifdef RLIMIT_STACK + if (getrlimit (RLIMIT_STACK, &limit) < 0) + return 77; + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) + limit.rlim_max = 5000000; + limit.rlim_cur = limit.rlim_max; + if (setrlimit (RLIMIT_STACK, &limit) < 0) + return 77; +#endif + ret = printf ("%.5000000f", 1.0); + return !(ret == 5000002 || (ret < 0 && errno == ENOMEM)); +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + (./conftest 2>&AS_MESSAGE_LOG_FD + result=$? + _AS_ECHO_LOG([\$? = $result]) + if test $result != 0 && test $result != 77; then result=1; fi + exit $result + ) >/dev/null 2>/dev/null + case $? in + 0) gl_cv_func_printf_enomem="yes" ;; + 77) gl_cv_func_printf_enomem="guessing no" ;; + *) gl_cv_func_printf_enomem="no" ;; + esac + else + gl_cv_func_printf_enomem="guessing no" + fi + rm -fr conftest* + else + dnl A universal build on Apple Mac OS X platforms. + dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode. + dnl But we need a configuration result that is valid in both modes. + gl_cv_func_printf_enomem="guessing no" + fi + fi + if test "$gl_cv_func_printf_enomem" = "guessing no"; then +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on Solaris. + solaris*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on AIX. + aix*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on HP-UX/hppa. + hpux*) case "$host_cpu" in + hppa*) gl_cv_func_printf_enomem="guessing yes";; + *) gl_cv_func_printf_enomem="guessing no";; + esac + ;; + # Guess yes on IRIX. + irix*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on OSF/1. + osf*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on Haiku. + haiku*) gl_cv_func_printf_enomem="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_enomem="guessing no";; + esac +changequote([,])dnl + fi + ]) +]) + +dnl Test whether the snprintf function exists. (ISO C99, POSIX:2001) +dnl Result is ac_cv_func_snprintf. + +AC_DEFUN([gl_SNPRINTF_PRESENCE], +[ + AC_CHECK_FUNCS_ONCE([snprintf]) +]) + +dnl Test whether the string produced by the snprintf function is always NUL +dnl terminated. (ISO C99, POSIX:2001) +dnl Result is gl_cv_func_snprintf_truncation_c99. + +AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_SNPRINTF_PRESENCE]) + AC_CACHE_CHECK([whether snprintf truncates the result as in C99], + [gl_cv_func_snprintf_truncation_c99], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#include <string.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char buf[100]; +int main () +{ + strcpy (buf, "ABCDEF"); + my_snprintf (buf, 3, "%d %d", 4567, 89); + if (memcmp (buf, "45\0DEF", 6) != 0) + return 1; + return 0; +}]])], + [gl_cv_func_snprintf_truncation_c99=yes], + [gl_cv_func_snprintf_truncation_c99=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";; + darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";; + hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on OSF/1 >= 5. + osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_truncation_c99="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the return value of the snprintf function is the number +dnl of bytes (excluding the terminating NUL) that would have been produced +dnl if the buffer had been large enough. (ISO C99, POSIX:2001) +dnl For example, this test program fails on IRIX 6.5: +dnl --------------------------------------------------------------------- +dnl #include <stdio.h> +dnl int main() +dnl { +dnl static char buf[8]; +dnl int retval = snprintf (buf, 3, "%d", 12345); +dnl return retval >= 0 && retval < 3; +dnl } +dnl --------------------------------------------------------------------- +dnl Result is gl_cv_func_snprintf_retval_c99. + +AC_DEFUN_ONCE([gl_SNPRINTF_RETVAL_C99], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_SNPRINTF_PRESENCE]) + AC_CACHE_CHECK([whether snprintf returns a byte count as in C99], + [gl_cv_func_snprintf_retval_c99], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#include <string.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char buf[100]; +int main () +{ + strcpy (buf, "ABCDEF"); + if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7) + return 1; + if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7) + return 2; + if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7) + return 3; + return 0; +}]])], + [gl_cv_func_snprintf_retval_c99=yes], + [gl_cv_func_snprintf_retval_c99=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";; + darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_retval_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";; + aix*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_retval_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_retval_c99="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the snprintf function supports the %n format directive +dnl also in truncated portions of the format string. (ISO C99, POSIX:2001) +dnl Result is gl_cv_func_snprintf_directive_n. + +AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_SNPRINTF_PRESENCE]) + AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive], + [gl_cv_func_snprintf_directive_n], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#include <string.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char fmtstring[10]; +static char buf[100]; +int main () +{ + int count = -1; + /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) + support %n in format strings in read-only memory but not in writable + memory. */ + strcpy (fmtstring, "%d %n"); + my_snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55); + if (count != 6) + return 1; + return 0; +}]])], + [gl_cv_func_snprintf_directive_n=yes], + [gl_cv_func_snprintf_directive_n=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_directive_n="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";; + darwin*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_snprintf_directive_n="guessing no";; + solaris*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";; + aix*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on OSF/1 >= 5. + osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";; + osf*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_directive_n="guessing no";; + netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_directive_n="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_directive_n="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the snprintf function, when passed a size = 1, writes any +dnl output without bounds in this case, behaving like sprintf. This is the +dnl case on Linux libc5. +dnl Result is gl_cv_func_snprintf_size1. + +AC_DEFUN([gl_SNPRINTF_SIZE1], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gl_SNPRINTF_PRESENCE]) + AC_CACHE_CHECK([whether snprintf respects a size of 1], + [gl_cv_func_snprintf_size1], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + my_snprintf (buf, 1, "%d", 12345); + return buf[1] != 'E'; +}]])], + [gl_cv_func_snprintf_size1=yes], + [gl_cv_func_snprintf_size1=no], + [gl_cv_func_snprintf_size1="guessing yes"]) + ]) +]) + +dnl Test whether the vsnprintf function, when passed a zero size, produces no +dnl output. (ISO C99, POSIX:2001) +dnl For example, snprintf nevertheless writes a NUL byte in this case +dnl on OSF/1 5.1: +dnl --------------------------------------------------------------------- +dnl #include <stdio.h> +dnl int main() +dnl { +dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; +dnl snprintf (buf, 0, "%d", 12345); +dnl return buf[0] != 'D'; +dnl } +dnl --------------------------------------------------------------------- +dnl And vsnprintf writes any output without bounds in this case, behaving like +dnl vsprintf, on HP-UX 11 and OSF/1 5.1: +dnl --------------------------------------------------------------------- +dnl #include <stdarg.h> +dnl #include <stdio.h> +dnl static int my_snprintf (char *buf, int size, const char *format, ...) +dnl { +dnl va_list args; +dnl int ret; +dnl va_start (args, format); +dnl ret = vsnprintf (buf, size, format, args); +dnl va_end (args); +dnl return ret; +dnl } +dnl int main() +dnl { +dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; +dnl my_snprintf (buf, 0, "%d", 12345); +dnl return buf[0] != 'D'; +dnl } +dnl --------------------------------------------------------------------- +dnl Result is gl_cv_func_vsnprintf_zerosize_c99. + +AC_DEFUN([gl_VSNPRINTF_ZEROSIZE_C99], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether vsnprintf respects a zero size as in C99], + [gl_cv_func_vsnprintf_zerosize_c99], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdarg.h> +#include <stdio.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + my_snprintf (buf, 0, "%d", 12345); + return buf[0] != 'D'; +}]])], + [gl_cv_func_vsnprintf_zerosize_c99=yes], + [gl_cv_func_vsnprintf_zerosize_c99=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Cygwin. + cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on mingw. + mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl The results of these tests on various platforms are: +dnl +dnl 1 = gl_PRINTF_SIZES_C99 +dnl 2 = gl_PRINTF_LONG_DOUBLE +dnl 3 = gl_PRINTF_INFINITE +dnl 4 = gl_PRINTF_INFINITE_LONG_DOUBLE +dnl 5 = gl_PRINTF_DIRECTIVE_A +dnl 6 = gl_PRINTF_DIRECTIVE_F +dnl 7 = gl_PRINTF_DIRECTIVE_N +dnl 8 = gl_PRINTF_DIRECTIVE_LS +dnl 9 = gl_PRINTF_POSITIONS +dnl 10 = gl_PRINTF_FLAG_GROUPING +dnl 11 = gl_PRINTF_FLAG_LEFTADJUST +dnl 12 = gl_PRINTF_FLAG_ZERO +dnl 13 = gl_PRINTF_PRECISION +dnl 14 = gl_PRINTF_ENOMEM +dnl 15 = gl_SNPRINTF_PRESENCE +dnl 16 = gl_SNPRINTF_TRUNCATION_C99 +dnl 17 = gl_SNPRINTF_RETVAL_C99 +dnl 18 = gl_SNPRINTF_DIRECTIVE_N +dnl 19 = gl_SNPRINTF_SIZE1 +dnl 20 = gl_VSNPRINTF_ZEROSIZE_C99 +dnl +dnl 1 = checking whether printf supports size specifiers as in C99... +dnl 2 = checking whether printf supports 'long double' arguments... +dnl 3 = checking whether printf supports infinite 'double' arguments... +dnl 4 = checking whether printf supports infinite 'long double' arguments... +dnl 5 = checking whether printf supports the 'a' and 'A' directives... +dnl 6 = checking whether printf supports the 'F' directive... +dnl 7 = checking whether printf supports the 'n' directive... +dnl 8 = checking whether printf supports the 'ls' directive... +dnl 9 = checking whether printf supports POSIX/XSI format strings with positions... +dnl 10 = checking whether printf supports the grouping flag... +dnl 11 = checking whether printf supports the left-adjust flag correctly... +dnl 12 = checking whether printf supports the zero flag correctly... +dnl 13 = checking whether printf supports large precisions... +dnl 14 = checking whether printf survives out-of-memory conditions... +dnl 15 = checking for snprintf... +dnl 16 = checking whether snprintf truncates the result as in C99... +dnl 17 = checking whether snprintf returns a byte count as in C99... +dnl 18 = checking whether snprintf fully supports the 'n' directive... +dnl 19 = checking whether snprintf respects a size of 1... +dnl 20 = checking whether vsnprintf respects a zero size as in C99... +dnl +dnl . = yes, # = no. +dnl +dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +dnl glibc 2.5 . . . . . . . . . . . . . . . . . . . . +dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . . . +dnl FreeBSD 5.4, 6.1 . . . . # . . . . . . # . # . . . . . . +dnl Mac OS X 10.5.8 . . . # # . . . . . . # . . . . . . . . +dnl Mac OS X 10.3.9 . . . . # . . . . . . # . # . . . . . . +dnl OpenBSD 3.9, 4.0 . . # # # # . # . # . # . # . . . . . . +dnl Cygwin 1.7.0 (2009) . . . # . . . ? . . . . . ? . . . . . . +dnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # . . . . . . +dnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # . . . . . . +dnl Solaris 11 2011-11 . . # # # . . # . . . # . . . . . . . . +dnl Solaris 10 . . # # # . . # . . . # # . . . . . . . +dnl Solaris 2.6 ... 9 # . # # # # . # . . . # # . . . # . . . +dnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # # +dnl AIX 7.1 . . # # # . . . . . . # # . . . . . . . +dnl AIX 5.2 . . # # # . . . . . . # . . . . . . . . +dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . # . . . +dnl HP-UX 11.31 . . . . # . . . . . . # . . . . # # . . +dnl HP-UX 11.{00,11,23} # . . . # # . . . . . # . . . . # # . # +dnl HP-UX 10.20 # . # . # # . ? . . # # . . . . # # ? # +dnl IRIX 6.5 # . # # # # . # . . . # . . . . # . . . +dnl OSF/1 5.1 # . # # # # . . . . . # . . . . # . . # +dnl OSF/1 4.0d # . # # # # . . . . . # . . # # # # # # +dnl NetBSD 5.0 . . . # # . . . . . . # . # . . . . . . +dnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ? +dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . . +dnl Haiku . . . # # # . # . . . . . ? . . ? . . . +dnl BeOS # # . # # # . ? # . ? . # ? . . ? . . . +dnl old mingw / msvcrt # # # # # # . . # # . # # ? . # # # . . +dnl MSVC 9 # # # # # # # . # # . # # ? # # # # . . +dnl mingw 2009-2011 . # . # . . . . # # . . . ? . . . . . . +dnl mingw-w64 2011 # # # # # # . . # # . # # ? . # # # . . diff --git a/local/recipes/tools/diffutils/source/m4/progtest.m4 b/local/recipes/tools/diffutils/source/m4/progtest.m4 new file mode 100644 index 0000000000..b499f79cf3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/progtest.m4 @@ -0,0 +1,91 @@ +# progtest.m4 serial 7 (gettext-0.18.2) +dnl Copyright (C) 1996-2003, 2005, 2008-2014 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper <drepper@cygnus.com>, 1996. + +AC_PREREQ([2.50]) + +# Search path for a program which passes the given test. + +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN([AM_PATH_PROG_WITH_TEST], +[ +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL([ac_cv_path_$1], +[case "[$]$1" in + [[\\/]]* | ?:[[\\/]]*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in ifelse([$5], , $PATH, [$5]); do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then + AC_MSG_RESULT([$][$1]) +else + AC_MSG_RESULT([no]) +fi +AC_SUBST([$1])dnl +]) diff --git a/local/recipes/tools/diffutils/source/m4/putenv.m4 b/local/recipes/tools/diffutils/source/m4/putenv.m4 new file mode 100644 index 0000000000..a8e3ab33dc --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/putenv.m4 @@ -0,0 +1,56 @@ +# putenv.m4 serial 20 +dnl Copyright (C) 2002-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Jim Meyering. +dnl +dnl Check whether putenv ("FOO") removes FOO from the environment. +dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that. + +AC_DEFUN([gl_FUNC_PUTENV], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([for putenv compatible with GNU and SVID], + [gl_cv_func_svid_putenv], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[ + /* Put it in env. */ + if (putenv ("CONFTEST_putenv=val")) + return 1; + + /* Try to remove it. */ + if (putenv ("CONFTEST_putenv")) + return 2; + + /* Make sure it was deleted. */ + if (getenv ("CONFTEST_putenv") != 0) + return 3; + + return 0; + ]])], + gl_cv_func_svid_putenv=yes, + gl_cv_func_svid_putenv=no, + dnl When crosscompiling, assume putenv is broken. + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_svid_putenv="guessing no" ;; + esac + ]) + ]) + case "$gl_cv_func_svid_putenv" in + *yes) ;; + *) + REPLACE_PUTENV=1 + ;; + esac +]) + +# Prerequisites of lib/putenv.c. +AC_DEFUN([gl_PREREQ_PUTENV], +[ + AC_CHECK_DECLS([_putenv]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/quote.m4 b/local/recipes/tools/diffutils/source/m4/quote.m4 new file mode 100644 index 0000000000..92be1e7287 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/quote.m4 @@ -0,0 +1,13 @@ +# quote.m4 serial 6 +dnl Copyright (C) 2002-2003, 2005-2006, 2009-2017 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_QUOTE], +[ + dnl Prerequisites of lib/quote.c. + dnl (none) + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/quotearg.m4 b/local/recipes/tools/diffutils/source/m4/quotearg.m4 new file mode 100644 index 0000000000..5fae4f3e16 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/quotearg.m4 @@ -0,0 +1,10 @@ +# quotearg.m4 serial 9 +dnl Copyright (C) 2002, 2004-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_QUOTEARG], +[ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/raise.m4 b/local/recipes/tools/diffutils/source/m4/raise.m4 new file mode 100644 index 0000000000..fe6e06858e --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/raise.m4 @@ -0,0 +1,36 @@ +# raise.m4 serial 4 +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_RAISE], +[ + AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_FUNCS([raise]) + if test $ac_cv_func_raise = no; then + HAVE_RAISE=0 + else + m4_ifdef([gl_MSVC_INVAL], [ + AC_REQUIRE([gl_MSVC_INVAL]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_RAISE=1 + fi + ]) + m4_ifdef([gl_SIGNALBLOCKING], [ + gl_SIGNALBLOCKING + if test $HAVE_POSIX_SIGNALBLOCKING = 0; then + m4_ifdef([gl_SIGNAL_SIGPIPE], [ + gl_SIGNAL_SIGPIPE + if test $gl_cv_header_signal_h_SIGPIPE != yes; then + REPLACE_RAISE=1 + fi + ], [:]) + fi + ]) + fi +]) + +# Prerequisites of lib/raise.c. +AC_DEFUN([gl_PREREQ_RAISE], [:]) diff --git a/local/recipes/tools/diffutils/source/m4/rawmemchr.m4 b/local/recipes/tools/diffutils/source/m4/rawmemchr.m4 new file mode 100644 index 0000000000..f800ed4d59 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/rawmemchr.m4 @@ -0,0 +1,20 @@ +# rawmemchr.m4 serial 2 +dnl Copyright (C) 2003, 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_RAWMEMCHR], +[ + dnl Persuade glibc <string.h> to declare rawmemchr(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_CHECK_FUNCS([rawmemchr]) + if test $ac_cv_func_rawmemchr = no; then + HAVE_RAWMEMCHR=0 + fi +]) + +# Prerequisites of lib/strchrnul.c. +AC_DEFUN([gl_PREREQ_RAWMEMCHR], [:]) diff --git a/local/recipes/tools/diffutils/source/m4/readlink.m4 b/local/recipes/tools/diffutils/source/m4/readlink.m4 new file mode 100644 index 0000000000..d3ba0ad421 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/readlink.m4 @@ -0,0 +1,71 @@ +# readlink.m4 serial 12 +dnl Copyright (C) 2003, 2007, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_READLINK], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CHECK_FUNCS_ONCE([readlink]) + if test $ac_cv_func_readlink = no; then + HAVE_READLINK=0 + else + AC_CACHE_CHECK([whether readlink signature is correct], + [gl_cv_decl_readlink_works], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <unistd.h> + /* Cause compilation failure if original declaration has wrong type. */ + ssize_t readlink (const char *, char *, size_t);]])], + [gl_cv_decl_readlink_works=yes], [gl_cv_decl_readlink_works=no])]) + dnl Solaris 9 ignores trailing slash. + dnl FreeBSD 7.2 dereferences only one level of links with trailing slash. + AC_CACHE_CHECK([whether readlink handles trailing slash correctly], + [gl_cv_func_readlink_works], + [# We have readlink, so assume ln -s works. + ln -s conftest.no-such conftest.link + ln -s conftest.link conftest.lnk2 + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <unistd.h> +]], [[char buf[20]; + return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;]])], + [gl_cv_func_readlink_works=yes], [gl_cv_func_readlink_works=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_readlink_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_readlink_works="guessing no" ;; + esac + ]) + rm -f conftest.link conftest.lnk2]) + case "$gl_cv_func_readlink_works" in + *yes) + if test "$gl_cv_decl_readlink_works" != yes; then + REPLACE_READLINK=1 + fi + ;; + *) + AC_DEFINE([READLINK_TRAILING_SLASH_BUG], [1], [Define to 1 if readlink + fails to recognize a trailing slash.]) + REPLACE_READLINK=1 + ;; + esac + fi +]) + +# Like gl_FUNC_READLINK, except prepare for separate compilation +# (no REPLACE_READLINK, no AC_LIBOBJ). +AC_DEFUN([gl_FUNC_READLINK_SEPARATE], +[ + AC_CHECK_FUNCS_ONCE([readlink]) + gl_PREREQ_READLINK +]) + +# Prerequisites of lib/readlink.c. +AC_DEFUN([gl_PREREQ_READLINK], +[ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/regex.m4 b/local/recipes/tools/diffutils/source/m4/regex.m4 new file mode 100644 index 0000000000..61ff09872b --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/regex.m4 @@ -0,0 +1,293 @@ +# serial 66 + +# Copyright (C) 1996-2001, 2003-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +dnl Initially derived from code in GNU grep. +dnl Mostly written by Jim Meyering. + +AC_PREREQ([2.50]) + +AC_DEFUN([gl_REGEX], +[ + AC_ARG_WITH([included-regex], + [AS_HELP_STRING([--without-included-regex], + [don't compile regex; this is the default on systems + with recent-enough versions of the GNU C Library + (use with caution on other systems).])]) + + case $with_included_regex in #( + yes|no) ac_use_included_regex=$with_included_regex + ;; + '') + # If the system regex support is good enough that it passes the + # following run test, then default to *not* using the included regex.c. + # If cross compiling, assume the test would fail and use the included + # regex.c. + AC_CHECK_DECLS_ONCE([alarm]) + AC_CHECK_HEADERS_ONCE([malloc.h]) + AC_CACHE_CHECK([for working re_compile_pattern], + [gl_cv_func_re_compile_pattern_working], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <regex.h> + + #include <locale.h> + #include <limits.h> + #include <string.h> + + #if defined M_CHECK_ACTION || HAVE_DECL_ALARM + # include <signal.h> + # include <unistd.h> + #endif + + #if HAVE_MALLOC_H + # include <malloc.h> + #endif + + #ifdef M_CHECK_ACTION + /* Exit with distinguishable exit code. */ + static void sigabrt_no_core (int sig) { raise (SIGTERM); } + #endif + ]], + [[int result = 0; + static struct re_pattern_buffer regex; + unsigned char folded_chars[UCHAR_MAX + 1]; + int i; + const char *s; + struct re_registers regs; + + /* Some builds of glibc go into an infinite loop on this + test. Use alarm to force death, and mallopt to avoid + malloc recursion in diagnosing the corrupted heap. */ +#if HAVE_DECL_ALARM + signal (SIGALRM, SIG_DFL); + alarm (2); +#endif +#ifdef M_CHECK_ACTION + signal (SIGABRT, sigabrt_no_core); + mallopt (M_CHECK_ACTION, 2); +#endif + + if (setlocale (LC_ALL, "en_US.UTF-8")) + { + { + /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html + This test needs valgrind to catch the bug on Debian + GNU/Linux 3.1 x86, but it might catch the bug better + on other platforms and it shouldn't hurt to try the + test here. */ + static char const pat[] = "insert into"; + static char const data[] = + "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK"; + re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE + | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else if (re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, ®s) + != -1) + result |= 1; + regfree (®ex); + } + + { + /* This test is from glibc bug 15078. + The test case is from Andreas Schwab in + <http://www.sourceware.org/ml/libc-alpha/2013-01/msg00967.html>. + */ + static char const pat[] = "[^x]x"; + static char const data[] = + /* <U1000><U103B><U103D><U1014><U103A><U102F><U1015><U103A> */ + "\xe1\x80\x80" + "\xe1\x80\xbb" + "\xe1\x80\xbd" + "\xe1\x80\x94" + "\xe1\x80\xba" + "\xe1\x80\xaf" + "\xe1\x80\x95" + "\xe1\x80\xba" + "x"; + re_set_syntax (0); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else + { + i = re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, 0); + if (i != 0 && i != 21) + result |= 1; + } + regfree (®ex); + } + + if (! setlocale (LC_ALL, "C")) + return 1; + } + + /* This test is from glibc bug 3957, reported by Andrew Mackey. */ + re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[^x]b", 6, ®ex); + if (s) + result |= 2; + /* This should fail, but succeeds for glibc-2.5. */ + else if (re_search (®ex, "a\nb", 3, 0, 3, ®s) != -1) + result |= 2; + + /* This regular expression is from Spencer ere test number 75 + in grep-2.3. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP); + memset (®ex, 0, sizeof regex); + for (i = 0; i <= UCHAR_MAX; i++) + folded_chars[i] = i; + regex.translate = folded_chars; + s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, ®ex); + /* This should fail with _Invalid character class name_ error. */ + if (!s) + result |= 4; + + /* Ensure that [b-a] is diagnosed as invalid, when + using RE_NO_EMPTY_RANGES. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[b-a]", 6, ®ex); + if (s == 0) + result |= 8; + + /* This should succeed, but does not for glibc-2.1.3. */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("{1", 2, ®ex); + if (s) + result |= 8; + + /* The following example is derived from a problem report + against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[an\371]*n", 7, ®ex); + if (s) + result |= 8; + /* This should match, but does not for glibc-2.2.1. */ + else if (re_match (®ex, "an", 2, 0, ®s) != 2) + result |= 8; + + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 8; + /* glibc-2.2.93 does not work with a negative RANGE argument. */ + else if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1) + result |= 8; + + /* The version of regex.c in older versions of gnulib + ignored RE_ICASE. Detect that problem too. */ + re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 16; + else if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0) + result |= 16; + + /* Catch a bug reported by Vin Shelton in + http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html + */ + re_set_syntax (RE_SYNTAX_POSIX_BASIC + & ~RE_CONTEXT_INVALID_DUP + & ~RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, ®ex); + if (s) + result |= 32; + + /* REG_STARTEND was added to glibc on 2004-01-15. + Reject older versions. */ + if (! REG_STARTEND) + result |= 64; + +#if 0 + /* It would be nice to reject hosts whose regoff_t values are too + narrow (including glibc on hosts with 64-bit ptrdiff_t and + 32-bit int), but we should wait until glibc implements this + feature. Otherwise, support for equivalence classes and + multibyte collation symbols would always be broken except + when compiling --without-included-regex. */ + if (sizeof (regoff_t) < sizeof (ptrdiff_t) + || sizeof (regoff_t) < sizeof (ssize_t)) + result |= 64; +#endif + + return result; + ]])], + [gl_cv_func_re_compile_pattern_working=yes], + [gl_cv_func_re_compile_pattern_working=no], + dnl When crosscompiling, assume it is not working. + [gl_cv_func_re_compile_pattern_working=no])]) + case $gl_cv_func_re_compile_pattern_working in #( + yes) ac_use_included_regex=no;; #( + no) ac_use_included_regex=yes;; + esac + ;; + *) AC_MSG_ERROR([Invalid value for --with-included-regex: $with_included_regex]) + ;; + esac + + if test $ac_use_included_regex = yes; then + AC_DEFINE([_REGEX_INCLUDE_LIMITS_H], [1], + [Define if you want <regex.h> to include <limits.h>, so that it + consistently overrides <limits.h>'s RE_DUP_MAX.]) + AC_DEFINE([_REGEX_LARGE_OFFSETS], [1], + [Define if you want regoff_t to be at least as wide POSIX requires.]) + AC_DEFINE([re_syntax_options], [rpl_re_syntax_options], + [Define to rpl_re_syntax_options if the replacement should be used.]) + AC_DEFINE([re_set_syntax], [rpl_re_set_syntax], + [Define to rpl_re_set_syntax if the replacement should be used.]) + AC_DEFINE([re_compile_pattern], [rpl_re_compile_pattern], + [Define to rpl_re_compile_pattern if the replacement should be used.]) + AC_DEFINE([re_compile_fastmap], [rpl_re_compile_fastmap], + [Define to rpl_re_compile_fastmap if the replacement should be used.]) + AC_DEFINE([re_search], [rpl_re_search], + [Define to rpl_re_search if the replacement should be used.]) + AC_DEFINE([re_search_2], [rpl_re_search_2], + [Define to rpl_re_search_2 if the replacement should be used.]) + AC_DEFINE([re_match], [rpl_re_match], + [Define to rpl_re_match if the replacement should be used.]) + AC_DEFINE([re_match_2], [rpl_re_match_2], + [Define to rpl_re_match_2 if the replacement should be used.]) + AC_DEFINE([re_set_registers], [rpl_re_set_registers], + [Define to rpl_re_set_registers if the replacement should be used.]) + AC_DEFINE([re_comp], [rpl_re_comp], + [Define to rpl_re_comp if the replacement should be used.]) + AC_DEFINE([re_exec], [rpl_re_exec], + [Define to rpl_re_exec if the replacement should be used.]) + AC_DEFINE([regcomp], [rpl_regcomp], + [Define to rpl_regcomp if the replacement should be used.]) + AC_DEFINE([regexec], [rpl_regexec], + [Define to rpl_regexec if the replacement should be used.]) + AC_DEFINE([regerror], [rpl_regerror], + [Define to rpl_regerror if the replacement should be used.]) + AC_DEFINE([regfree], [rpl_regfree], + [Define to rpl_regfree if the replacement should be used.]) + fi +]) + +# Prerequisites of lib/regex.c and lib/regex_internal.c. +AC_DEFUN([gl_PREREQ_REGEX], +[ + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([AC_C_INLINE]) + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + AC_REQUIRE([gl_EEMALLOC]) + AC_REQUIRE([gl_GLIBC21]) + AC_CHECK_HEADERS([libintl.h]) + AC_CHECK_FUNCS_ONCE([isblank iswctype]) + AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/secure_getenv.m4 b/local/recipes/tools/diffutils/source/m4/secure_getenv.m4 new file mode 100644 index 0000000000..6bd4afd9c1 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/secure_getenv.m4 @@ -0,0 +1,26 @@ +# Look up an environment variable more securely. +dnl Copyright 2013-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_SECURE_GETENV], +[ + dnl Persuade glibc <stdlib.h> to declare secure_getenv(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([secure_getenv]) + if test $ac_cv_func_secure_getenv = no; then + HAVE_SECURE_GETENV=0 + fi +]) + +# Prerequisites of lib/secure_getenv.c. +AC_DEFUN([gl_PREREQ_SECURE_GETENV], [ + AC_CHECK_FUNCS([__secure_getenv]) + if test $ac_cv_func___secure_getenv = no; then + AC_CHECK_FUNCS([issetugid]) + fi + AC_CHECK_FUNCS_ONCE([getuid geteuid getgid getegid]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/select.m4 b/local/recipes/tools/diffutils/source/m4/select.m4 new file mode 100644 index 0000000000..c7844bc8ea --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/select.m4 @@ -0,0 +1,114 @@ +# select.m4 serial 8 +dnl Copyright (C) 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_SELECT], +[ + AC_REQUIRE([gl_HEADER_SYS_SELECT]) + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_SOCKETS]) + if test "$ac_cv_header_winsock2_h" = yes; then + REPLACE_SELECT=1 + else + dnl On Interix 3.5, select(0, NULL, NULL, NULL, timeout) fails with error + dnl EFAULT. + AC_CHECK_HEADERS_ONCE([sys/select.h]) + AC_CACHE_CHECK([whether select supports a 0 argument], + [gl_cv_func_select_supports0], + [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include <sys/types.h> +#include <sys/time.h> +#if HAVE_SYS_SELECT_H +#include <sys/select.h> +#endif +int main () +{ + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0; +}]])], [gl_cv_func_select_supports0=yes], [gl_cv_func_select_supports0=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess no on Interix. + interix*) gl_cv_func_select_supports0="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_select_supports0="guessing yes";; + esac +changequote([,])dnl + ]) + ]) + case "$gl_cv_func_select_supports0" in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + + dnl On FreeBSD 8.2, select() doesn't always reject bad fds. + AC_CACHE_CHECK([whether select detects invalid fds], + [gl_cv_func_select_detects_ebadf], + [ + AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include <sys/types.h> +#include <sys/time.h> +#if HAVE_SYS_SELECT_H +# include <sys/select.h> +#endif +#include <unistd.h> +#include <errno.h> +]],[[ + fd_set set; + dup2(0, 16); + FD_ZERO(&set); + FD_SET(16, &set); + close(16); + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF; +]])], [gl_cv_func_select_detects_ebadf=yes], + [gl_cv_func_select_detects_ebadf=no], + [ + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_select_detects_ebadf="guessing no" ;; + esac + ]) + ]) + case $gl_cv_func_select_detects_ebadf in + *yes) ;; + *) REPLACE_SELECT=1 ;; + esac + fi + + dnl Determine the needed libraries. + LIB_SELECT="$LIBSOCKET" + if test $REPLACE_SELECT = 1; then + case "$host_os" in + mingw*) + dnl On the MSVC platform, the function MsgWaitForMultipleObjects + dnl (used in lib/select.c) requires linking with -luser32. On mingw, + dnl it is implicit. + AC_LINK_IFELSE( + [AC_LANG_SOURCE([[ +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +int +main () +{ + MsgWaitForMultipleObjects (0, NULL, 0, 0, 0); + return 0; +}]])], + [], + [LIB_SELECT="$LIB_SELECT -luser32"]) + ;; + esac + fi + AC_SUBST([LIB_SELECT]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/setenv.m4 b/local/recipes/tools/diffutils/source/m4/setenv.m4 new file mode 100644 index 0000000000..005aa8cfed --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/setenv.m4 @@ -0,0 +1,160 @@ +# setenv.m4 serial 26 +dnl Copyright (C) 2001-2004, 2006-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_SETENV], +[ + AC_REQUIRE([gl_FUNC_SETENV_SEPARATE]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + if test $ac_cv_func_setenv = no; then + HAVE_SETENV=0 + else + AC_CACHE_CHECK([whether setenv validates arguments], + [gl_cv_func_setenv_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ + #include <stdlib.h> + #include <errno.h> + #include <string.h> + ]], [[ + int result = 0; + { + if (setenv ("", "", 0) != -1) + result |= 1; + else if (errno != EINVAL) + result |= 2; + } + { + if (setenv ("a", "=", 1) != 0) + result |= 4; + else if (strcmp (getenv ("a"), "=") != 0) + result |= 8; + } + return result; + ]])], + [gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_setenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_setenv_works="guessing no" ;; + esac + ])]) + case "$gl_cv_func_setenv_works" in + *yes) ;; + *) + REPLACE_SETENV=1 + ;; + esac + fi +]) + +# Like gl_FUNC_SETENV, except prepare for separate compilation +# (no REPLACE_SETENV, no AC_LIBOBJ). +AC_DEFUN([gl_FUNC_SETENV_SEPARATE], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_CHECK_DECLS_ONCE([setenv]) + if test $ac_cv_have_decl_setenv = no; then + HAVE_DECL_SETENV=0 + fi + AC_CHECK_FUNCS_ONCE([setenv]) + gl_PREREQ_SETENV +]) + +AC_DEFUN([gl_FUNC_UNSETENV], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CHECK_DECLS_ONCE([unsetenv]) + if test $ac_cv_have_decl_unsetenv = no; then + HAVE_DECL_UNSETENV=0 + fi + AC_CHECK_FUNCS([unsetenv]) + if test $ac_cv_func_unsetenv = no; then + HAVE_UNSETENV=0 + else + HAVE_UNSETENV=1 + dnl Some BSDs return void, failing to do error checking. + AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#undef _BSD +#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */ +#include <stdlib.h> +extern +#ifdef __cplusplus +"C" +#endif +int unsetenv (const char *name); + ]], + [[]])], + [gt_cv_func_unsetenv_ret='int'], + [gt_cv_func_unsetenv_ret='void'])]) + if test $gt_cv_func_unsetenv_ret = 'void'; then + AC_DEFINE([VOID_UNSETENV], [1], [Define to 1 if unsetenv returns void + instead of int.]) + REPLACE_UNSETENV=1 + fi + + dnl Solaris 10 unsetenv does not remove all copies of a name. + dnl Haiku alpha 2 unsetenv gets confused by assignment to environ. + dnl OpenBSD 4.7 unsetenv("") does not fail. + AC_CACHE_CHECK([whether unsetenv obeys POSIX], + [gl_cv_func_unsetenv_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ + #include <stdlib.h> + #include <errno.h> + extern char **environ; + ]], [[ + char entry1[] = "a=1"; + char entry2[] = "b=2"; + char *env[] = { entry1, entry2, NULL }; + if (putenv ((char *) "a=1")) return 1; + if (putenv (entry2)) return 2; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 3; + if (!unsetenv ("") || errno != EINVAL) return 4; + entry2[0] = 'b'; + environ = env; + if (!getenv ("a")) return 5; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 6; + ]])], + [gl_cv_func_unsetenv_works=yes], [gl_cv_func_unsetenv_works=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_unsetenv_works="guessing no" ;; + esac + ])]) + case "$gl_cv_func_unsetenv_works" in + *yes) ;; + *) + REPLACE_UNSETENV=1 + ;; + esac + fi +]) + +# Prerequisites of lib/setenv.c. +AC_DEFUN([gl_PREREQ_SETENV], +[ + AC_REQUIRE([AC_FUNC_ALLOCA]) + AC_REQUIRE([gl_ENVIRON]) + AC_CHECK_HEADERS_ONCE([unistd.h]) + AC_CHECK_HEADERS([search.h]) + AC_CHECK_FUNCS([tsearch]) +]) + +# Prerequisites of lib/unsetenv.c. +AC_DEFUN([gl_PREREQ_UNSETENV], +[ + AC_REQUIRE([gl_ENVIRON]) + AC_CHECK_HEADERS_ONCE([unistd.h]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/setlocale.m4 b/local/recipes/tools/diffutils/source/m4/setlocale.m4 new file mode 100644 index 0000000000..879317de2b --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/setlocale.m4 @@ -0,0 +1,29 @@ +# setlocale.m4 serial 4 +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_SETLOCALE], +[ + AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + dnl On native Windows systems, setlocale(category,NULL) does not look at + dnl the environment variables LC_ALL, category, and LANG. + mingw*) REPLACE_SETLOCALE=1 ;; + dnl On Cygwin 1.5.x, setlocale always succeeds but setlocale(LC_CTYPE,NULL) + dnl is then still "C". + cygwin*) + case `uname -r` in + 1.5.*) REPLACE_SETLOCALE=1 ;; + esac + ;; + esac +]) + +# Prerequisites of lib/setlocale.c. +AC_DEFUN([gl_PREREQ_SETLOCALE], +[ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/sigaction.m4 b/local/recipes/tools/diffutils/source/m4/sigaction.m4 new file mode 100644 index 0000000000..1042f3a308 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/sigaction.m4 @@ -0,0 +1,40 @@ +# sigaction.m4 serial 7 +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Determine if sigaction interface is present. +AC_DEFUN([gl_SIGACTION], +[ + AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([sigaction]) + if test $ac_cv_func_sigaction = yes; then + AC_CHECK_MEMBERS([struct sigaction.sa_sigaction], , , + [[#include <signal.h>]]) + if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then + HAVE_STRUCT_SIGACTION_SA_SIGACTION=0 + fi + else + HAVE_SIGACTION=0 + fi +]) + +# Prerequisites of the part of lib/signal.in.h and of lib/sigaction.c. +AC_DEFUN([gl_PREREQ_SIGACTION], +[ + AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([AC_TYPE_UID_T]) + AC_REQUIRE([gl_PREREQ_SIG_HANDLER_H]) + AC_CHECK_FUNCS_ONCE([sigaltstack siginterrupt]) + AC_CHECK_TYPES([siginfo_t], [], [], [[ +#include <signal.h> + ]]) + if test $ac_cv_type_siginfo_t = no; then + HAVE_SIGINFO_T=0 + fi +]) + +# Prerequisites of lib/sig-handler.h. +AC_DEFUN([gl_PREREQ_SIG_HANDLER_H], [:]) diff --git a/local/recipes/tools/diffutils/source/m4/signal_h.m4 b/local/recipes/tools/diffutils/source/m4/signal_h.m4 new file mode 100644 index 0000000000..eaf5ce98e4 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/signal_h.m4 @@ -0,0 +1,83 @@ +# signal_h.m4 serial 18 +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_SIGNAL_H], +[ + AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) + AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T]) + gl_NEXT_HEADERS([signal.h]) + +# AIX declares sig_atomic_t to already include volatile, and C89 compilers +# then choke on 'volatile sig_atomic_t'. C99 requires that it compile. + AC_CHECK_TYPE([volatile sig_atomic_t], [], + [HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0], [[ +#include <signal.h> + ]]) + + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) + + AC_REQUIRE([AC_TYPE_UID_T]) + + dnl Persuade glibc <signal.h> to define sighandler_t. + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_TYPE([sighandler_t], [], [HAVE_SIGHANDLER_T=0], [[ +#include <signal.h> + ]]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include <signal.h> + ]], [pthread_sigmask sigaction + sigaddset sigdelset sigemptyset sigfillset sigismember + sigpending sigprocmask]) +]) + +AC_DEFUN([gl_CHECK_TYPE_SIGSET_T], +[ + AC_CHECK_TYPES([sigset_t], + [gl_cv_type_sigset_t=yes], [gl_cv_type_sigset_t=no], + [[ + #include <signal.h> + /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */ + #include <sys/types.h> + ]]) + if test $gl_cv_type_sigset_t != yes; then + HAVE_SIGSET_T=0 + fi +]) + +AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_SIGNAL_H_DEFAULTS], +[ + GNULIB_PTHREAD_SIGMASK=0; AC_SUBST([GNULIB_PTHREAD_SIGMASK]) + GNULIB_RAISE=0; AC_SUBST([GNULIB_RAISE]) + GNULIB_SIGNAL_H_SIGPIPE=0; AC_SUBST([GNULIB_SIGNAL_H_SIGPIPE]) + GNULIB_SIGPROCMASK=0; AC_SUBST([GNULIB_SIGPROCMASK]) + GNULIB_SIGACTION=0; AC_SUBST([GNULIB_SIGACTION]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_POSIX_SIGNALBLOCKING=1; AC_SUBST([HAVE_POSIX_SIGNALBLOCKING]) + HAVE_PTHREAD_SIGMASK=1; AC_SUBST([HAVE_PTHREAD_SIGMASK]) + HAVE_RAISE=1; AC_SUBST([HAVE_RAISE]) + HAVE_SIGSET_T=1; AC_SUBST([HAVE_SIGSET_T]) + HAVE_SIGINFO_T=1; AC_SUBST([HAVE_SIGINFO_T]) + HAVE_SIGACTION=1; AC_SUBST([HAVE_SIGACTION]) + HAVE_STRUCT_SIGACTION_SA_SIGACTION=1; + AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION]) + HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1; + AC_SUBST([HAVE_TYPE_VOLATILE_SIG_ATOMIC_T]) + HAVE_SIGHANDLER_T=1; AC_SUBST([HAVE_SIGHANDLER_T]) + REPLACE_PTHREAD_SIGMASK=0; AC_SUBST([REPLACE_PTHREAD_SIGMASK]) + REPLACE_RAISE=0; AC_SUBST([REPLACE_RAISE]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/signalblocking.m4 b/local/recipes/tools/diffutils/source/m4/signalblocking.m4 new file mode 100644 index 0000000000..26041b11b8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/signalblocking.m4 @@ -0,0 +1,25 @@ +# signalblocking.m4 serial 14 +dnl Copyright (C) 2001-2002, 2006-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Determine available signal blocking primitives. Three different APIs exist: +# 1) POSIX: sigemptyset, sigaddset, sigprocmask +# 2) SYSV: sighold, sigrelse +# 3) BSD: sigblock, sigsetmask +# For simplicity, here we check only for the POSIX signal blocking. +AC_DEFUN([gl_SIGNALBLOCKING], +[ + AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) + AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T]) + if test $gl_cv_type_sigset_t = yes; then + AC_CHECK_FUNC([sigprocmask], [gl_cv_func_sigprocmask=1]) + fi + if test -z "$gl_cv_func_sigprocmask"; then + HAVE_POSIX_SIGNALBLOCKING=0 + fi +]) + +# Prerequisites of lib/sigprocmask.c. +AC_DEFUN([gl_PREREQ_SIGPROCMASK], [:]) diff --git a/local/recipes/tools/diffutils/source/m4/size_max.m4 b/local/recipes/tools/diffutils/source/m4/size_max.m4 new file mode 100644 index 0000000000..05ad1b602a --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/size_max.m4 @@ -0,0 +1,79 @@ +# size_max.m4 serial 10 +dnl Copyright (C) 2003, 2005-2006, 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +AC_DEFUN([gl_SIZE_MAX], +[ + AC_CHECK_HEADERS([stdint.h]) + dnl First test whether the system already has SIZE_MAX. + AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [ + gl_cv_size_max= + AC_EGREP_CPP([Found it], [ +#include <limits.h> +#if HAVE_STDINT_H +#include <stdint.h> +#endif +#ifdef SIZE_MAX +Found it +#endif +], [gl_cv_size_max=yes]) + if test -z "$gl_cv_size_max"; then + dnl Define it ourselves. Here we assume that the type 'size_t' is not wider + dnl than the type 'unsigned long'. Try hard to find a definition that can + dnl be used in a preprocessor #if, i.e. doesn't contain a cast. + AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1], + [#include <stddef.h> +#include <limits.h>], [size_t_bits_minus_1=]) + AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)], + [#include <stddef.h>], [fits_in_uint=]) + if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then + if test $fits_in_uint = 1; then + dnl Even though SIZE_MAX fits in an unsigned int, it must be of type + dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <stddef.h> + extern size_t foo; + extern unsigned long foo; + ]], + [[]])], + [fits_in_uint=0]) + fi + dnl We cannot use 'expr' to simplify this expression, because 'expr' + dnl works only with 'long' integers in the host environment, while we + dnl might be cross-compiling from a 32-bit platform to a 64-bit platform. + if test $fits_in_uint = 1; then + gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" + else + gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" + fi + else + dnl Shouldn't happen, but who knows... + gl_cv_size_max='((size_t)~(size_t)0)' + fi + fi + ]) + if test "$gl_cv_size_max" != yes; then + AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max], + [Define as the maximum value of type 'size_t', if the system doesn't define it.]) + fi + dnl Don't redefine SIZE_MAX in config.h if config.h is re-included after + dnl <stdint.h>. Remember that the #undef in AH_VERBATIM gets replaced with + dnl #define by AC_DEFINE_UNQUOTED. + AH_VERBATIM([SIZE_MAX], +[/* Define as the maximum value of type 'size_t', if the system doesn't define + it. */ +#ifndef SIZE_MAX +# undef SIZE_MAX +#endif]) +]) + +dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. +dnl Remove this when we can assume autoconf >= 2.61. +m4_ifdef([AC_COMPUTE_INT], [], [ + AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/sleep.m4 b/local/recipes/tools/diffutils/source/m4/sleep.m4 new file mode 100644 index 0000000000..2d92ea8e2d --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/sleep.m4 @@ -0,0 +1,62 @@ +# sleep.m4 serial 7 +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_SLEEP], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + dnl We expect to see the declaration of sleep() in a header file. + dnl Older versions of mingw have a sleep() function that is an alias to + dnl _sleep() in MSVCRT. It has a different signature than POSIX sleep(): + dnl it takes the number of milliseconds as argument and returns void. + dnl mingw does not declare this function. + AC_CHECK_DECLS([sleep], , , [[#include <unistd.h>]]) + AC_CHECK_FUNCS_ONCE([sleep]) + if test $ac_cv_have_decl_sleep != yes; then + HAVE_SLEEP=0 + else + dnl Cygwin 1.5.x has a bug where sleep can't exceed 49.7 days. + AC_CACHE_CHECK([for working sleep], [gl_cv_func_sleep_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include <errno.h> +#include <unistd.h> +#include <signal.h> +static void +handle_alarm (int sig) +{ + if (sig != SIGALRM) + _exit (2); +} +]], [[ + /* Failure to compile this test due to missing alarm is okay, + since all such platforms (mingw) also lack sleep. */ + unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days. */ + unsigned int remaining; + signal (SIGALRM, handle_alarm); + alarm (1); + remaining = sleep (pentecost); + if (remaining > pentecost) + return 3; + if (remaining <= pentecost - 10) + return 4; + return 0; + ]])], + [gl_cv_func_sleep_works=yes], [gl_cv_func_sleep_works=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_sleep_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_sleep_works="guessing no" ;; + esac + ])]) + case "$gl_cv_func_sleep_works" in + *yes) ;; + *) + REPLACE_SLEEP=1 + ;; + esac + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/snprintf.m4 b/local/recipes/tools/diffutils/source/m4/snprintf.m4 new file mode 100644 index 0000000000..e5155f7987 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/snprintf.m4 @@ -0,0 +1,62 @@ +# snprintf.m4 serial 7 +dnl Copyright (C) 2002-2004, 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Libintl 0.17 will replace snprintf only if it does not support %1$s, +dnl but defers to any gnulib snprintf replacements. Therefore, gnulib +dnl must guarantee that the decision for replacing snprintf is a superset +dnl of the reasons checked by libintl. +AC_DEFUN([gl_FUNC_SNPRINTF], +[ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + gl_cv_func_snprintf_usable=no + AC_CHECK_FUNCS([snprintf]) + if test $ac_cv_func_snprintf = yes; then + gl_SNPRINTF_SIZE1 + case "$gl_cv_func_snprintf_size1" in + *yes) + gl_SNPRINTF_RETVAL_C99 + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + gl_PRINTF_POSITIONS + case "$gl_cv_func_printf_positions" in + *yes) + gl_cv_func_snprintf_usable=yes + ;; + esac + ;; + esac + ;; + esac + fi + if test $gl_cv_func_snprintf_usable = no; then + gl_REPLACE_SNPRINTF + fi + AC_CHECK_DECLS_ONCE([snprintf]) + if test $ac_cv_have_decl_snprintf = no; then + HAVE_DECL_SNPRINTF=0 + fi +]) + +AC_DEFUN([gl_REPLACE_SNPRINTF], +[ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_LIBOBJ([snprintf]) + if test $ac_cv_func_snprintf = yes; then + REPLACE_SNPRINTF=1 + else + AC_CHECK_DECLS_ONCE([snprintf]) + if test $ac_cv_have_decl_snprintf = yes; then + dnl If the function is declared but does not appear to exist, it may be + dnl defined as an inline function. In order to avoid a conflict, we have + dnl to define rpl_snprintf, not snprintf. + REPLACE_SNPRINTF=1 + fi + fi + gl_PREREQ_SNPRINTF +]) + +# Prerequisites of lib/snprintf.c. +AC_DEFUN([gl_PREREQ_SNPRINTF], [:]) diff --git a/local/recipes/tools/diffutils/source/m4/socketlib.m4 b/local/recipes/tools/diffutils/source/m4/socketlib.m4 new file mode 100644 index 0000000000..c708fd2608 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/socketlib.m4 @@ -0,0 +1,86 @@ +# socketlib.m4 serial 1 +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl gl_SOCKETLIB +dnl Determines the library to use for socket functions. +dnl Sets and AC_SUBSTs LIBSOCKET. + +AC_DEFUN([gl_SOCKETLIB], +[ + gl_PREREQ_SYS_H_WINSOCK2 dnl for HAVE_WINSOCK2_H + LIBSOCKET= + if test $HAVE_WINSOCK2_H = 1; then + dnl Native Windows API (not Cygwin). + AC_CACHE_CHECK([if we need to call WSAStartup in winsock2.h and -lws2_32], + [gl_cv_func_wsastartup], [ + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#ifdef HAVE_WINSOCK2_H +# include <winsock2.h> +#endif]], [[ + WORD wVersionRequested = MAKEWORD(1, 1); + WSADATA wsaData; + int err = WSAStartup(wVersionRequested, &wsaData); + WSACleanup ();]])], + gl_cv_func_wsastartup=yes, gl_cv_func_wsastartup=no) + LIBS="$gl_save_LIBS" + ]) + if test "$gl_cv_func_wsastartup" = "yes"; then + AC_DEFINE([WINDOWS_SOCKETS], [1], [Define if WSAStartup is needed.]) + LIBSOCKET='-lws2_32' + fi + else + dnl Unix API. + dnl Solaris has most socket functions in libsocket. + dnl Haiku has most socket functions in libnetwork. + dnl BeOS has most socket functions in libnet. + AC_CACHE_CHECK([for library containing setsockopt], [gl_cv_lib_socket], [ + gl_cv_lib_socket= + AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern +#ifdef __cplusplus +"C" +#endif +char setsockopt();]], [[setsockopt();]])], + [], + [gl_save_LIBS="$LIBS" + LIBS="$gl_save_LIBS -lsocket" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern +#ifdef __cplusplus +"C" +#endif +char setsockopt();]], [[setsockopt();]])], + [gl_cv_lib_socket="-lsocket"]) + if test -z "$gl_cv_lib_socket"; then + LIBS="$gl_save_LIBS -lnetwork" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern +#ifdef __cplusplus +"C" +#endif +char setsockopt();]], [[setsockopt();]])], + [gl_cv_lib_socket="-lnetwork"]) + if test -z "$gl_cv_lib_socket"; then + LIBS="$gl_save_LIBS -lnet" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern +#ifdef __cplusplus +"C" +#endif +char setsockopt();]], [[setsockopt();]])], + [gl_cv_lib_socket="-lnet"]) + fi + fi + LIBS="$gl_save_LIBS" + ]) + if test -z "$gl_cv_lib_socket"; then + gl_cv_lib_socket="none needed" + fi + ]) + if test "$gl_cv_lib_socket" != "none needed"; then + LIBSOCKET="$gl_cv_lib_socket" + fi + fi + AC_SUBST([LIBSOCKET]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/sockets.m4 b/local/recipes/tools/diffutils/source/m4/sockets.m4 new file mode 100644 index 0000000000..0ef23bc324 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/sockets.m4 @@ -0,0 +1,17 @@ +# sockets.m4 serial 7 +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_SOCKETS], +[ + AC_REQUIRE([AC_C_INLINE]) + AC_REQUIRE([gl_SOCKETLIB]) + gl_PREREQ_SOCKETS +]) + +# Prerequisites of lib/sockets.c. +AC_DEFUN([gl_PREREQ_SOCKETS], [ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/socklen.m4 b/local/recipes/tools/diffutils/source/m4/socklen.m4 new file mode 100644 index 0000000000..0a62f49d68 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/socklen.m4 @@ -0,0 +1,77 @@ +# socklen.m4 serial 10 +dnl Copyright (C) 2005-2007, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Albert Chin, Windows fixes from Simon Josefsson. + +dnl Check for socklen_t: historically on BSD it is an int, and in +dnl POSIX 1g it is a type of its own, but some platforms use different +dnl types for the argument to getsockopt, getpeername, etc.: +dnl HP-UX 10.20, IRIX 6.5, OSF/1 4.0, Interix 3.5, BeOS. +dnl So we have to test to find something that will work. + +AC_DEFUN([gl_TYPE_SOCKLEN_T], + [AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])dnl + AC_CHECK_TYPE([socklen_t], , + [AC_MSG_CHECKING([for socklen_t equivalent]) + AC_CACHE_VAL([gl_cv_socklen_t_equiv], + [# Systems have either "struct sockaddr *" or + # "void *" as the second argument to getpeername + gl_cv_socklen_t_equiv= + for arg2 in "struct sockaddr" void; do + for t in int size_t "unsigned int" "long int" "unsigned long int"; do + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[#include <sys/types.h> + #include <sys/socket.h> + + int getpeername (int, $arg2 *, $t *);]], + [[$t len; + getpeername (0, 0, &len);]])], + [gl_cv_socklen_t_equiv="$t"]) + test "$gl_cv_socklen_t_equiv" != "" && break + done + test "$gl_cv_socklen_t_equiv" != "" && break + done + ]) + if test "$gl_cv_socklen_t_equiv" = ""; then + AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) + fi + AC_MSG_RESULT([$gl_cv_socklen_t_equiv]) + AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv], + [type to use in place of socklen_t if not defined])], + [gl_SOCKET_HEADERS])]) + +dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find +dnl it there too. But on Cygwin, wc2tcpip.h must not be included. Users +dnl of this module should use the same include pattern as gl_SOCKET_HEADERS. +dnl When you change this macro, keep also in sync: +dnl - gl_CHECK_SOCKET_HEADERS, +dnl - the Include section of modules/socklen. +AC_DEFUN([gl_SOCKET_HEADERS], +[ +/* <sys/types.h> is not needed according to POSIX, but the + <sys/socket.h> in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include <sys/types.h> +#if HAVE_SYS_SOCKET_H +# include <sys/socket.h> +#elif HAVE_WS2TCPIP_H +# include <ws2tcpip.h> +#endif +]) + +dnl Tests for the existence of the header for socket facilities. +dnl Defines the C macros HAVE_SYS_SOCKET_H, HAVE_WS2TCPIP_H. +dnl This macro must match gl_SOCKET_HEADERS. +AC_DEFUN([gl_CHECK_SOCKET_HEADERS], + [AC_CHECK_HEADERS_ONCE([sys/socket.h]) + if test $ac_cv_header_sys_socket_h = no; then + dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make + dnl the check for those headers unconditional; yet cygwin reports + dnl that the headers are present but cannot be compiled (since on + dnl cygwin, all socket information should come from sys/socket.h). + AC_CHECK_HEADERS([ws2tcpip.h]) + fi + ]) diff --git a/local/recipes/tools/diffutils/source/m4/sockpfaf.m4 b/local/recipes/tools/diffutils/source/m4/sockpfaf.m4 new file mode 100644 index 0000000000..c2e258215f --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/sockpfaf.m4 @@ -0,0 +1,87 @@ +# sockpfaf.m4 serial 8 +dnl Copyright (C) 2004, 2006, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Test for some common socket protocol families (PF_INET, PF_INET6, ...) +dnl and some common address families (AF_INET, AF_INET6, ...). +dnl This test assumes that a system supports an address family if and only if +dnl it supports the corresponding protocol family. + +dnl From Bruno Haible. + +AC_DEFUN([gl_SOCKET_FAMILIES], +[ + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + AC_CHECK_HEADERS_ONCE([netinet/in.h]) + + AC_MSG_CHECKING([for IPv4 sockets]) + AC_CACHE_VAL([gl_cv_socket_ipv4], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_WINSOCK2_H +#include <winsock2.h> +#endif]], +[[int x = AF_INET; struct in_addr y; struct sockaddr_in z; + if (&x && &y && &z) return 0;]])], + gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)]) + AC_MSG_RESULT([$gl_cv_socket_ipv4]) + if test $gl_cv_socket_ipv4 = yes; then + AC_DEFINE([HAVE_IPV4], [1], [Define to 1 if <sys/socket.h> defines AF_INET.]) + fi + + AC_MSG_CHECKING([for IPv6 sockets]) + AC_CACHE_VAL([gl_cv_socket_ipv6], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_WINSOCK2_H +#include <winsock2.h> +#endif +#ifdef HAVE_WS2TCPIP_H +#include <ws2tcpip.h> +#endif]], +[[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; + if (&x && &y && &z) return 0;]])], + gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)]) + AC_MSG_RESULT([$gl_cv_socket_ipv6]) + if test $gl_cv_socket_ipv6 = yes; then + AC_DEFINE([HAVE_IPV6], [1], [Define to 1 if <sys/socket.h> defines AF_INET6.]) + fi +]) + +AC_DEFUN([gl_SOCKET_FAMILY_UNIX], +[ + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + AC_CHECK_HEADERS_ONCE([sys/un.h]) + + AC_MSG_CHECKING([for UNIX domain sockets]) + AC_CACHE_VAL([gl_cv_socket_unix], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_SYS_UN_H +#include <sys/un.h> +#endif +#ifdef HAVE_WINSOCK2_H +#include <winsock2.h> +#endif]], +[[int x = AF_UNIX; struct sockaddr_un y; + if (&x && &y) return 0;]])], + gl_cv_socket_unix=yes, gl_cv_socket_unix=no)]) + AC_MSG_RESULT([$gl_cv_socket_unix]) + if test $gl_cv_socket_unix = yes; then + AC_DEFINE([HAVE_UNIXSOCKET], [1], [Define to 1 if <sys/socket.h> defines AF_UNIX.]) + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/ssize_t.m4 b/local/recipes/tools/diffutils/source/m4/ssize_t.m4 new file mode 100644 index 0000000000..66ba9d4ea2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/ssize_t.m4 @@ -0,0 +1,23 @@ +# ssize_t.m4 serial 5 (gettext-0.18.2) +dnl Copyright (C) 2001-2003, 2006, 2010-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. +dnl Test whether ssize_t is defined. + +AC_DEFUN([gt_TYPE_SSIZE_T], +[ + AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <sys/types.h>]], + [[int x = sizeof (ssize_t *) + sizeof (ssize_t); + return !x;]])], + [gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])]) + if test $gt_cv_ssize_t = no; then + AC_DEFINE([ssize_t], [int], + [Define as a signed type of the same size as size_t.]) + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/stat-time.m4 b/local/recipes/tools/diffutils/source/m4/stat-time.m4 new file mode 100644 index 0000000000..4017fc9d7f --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/stat-time.m4 @@ -0,0 +1,83 @@ +# Checks for stat-related time functions. + +# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2017 Free Software +# Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +# st_atim.tv_nsec - Linux, Solaris, Cygwin +# st_atimespec.tv_nsec - FreeBSD, NetBSD, if ! defined _POSIX_SOURCE +# st_atimensec - FreeBSD, NetBSD, if defined _POSIX_SOURCE +# st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1) + +# st_birthtimespec - FreeBSD, NetBSD (hidden on OpenBSD 3.9, anyway) +# st_birthtim - Cygwin 1.7.0+ + +AC_DEFUN([gl_STAT_TIME], +[ + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_HEADERS_ONCE([sys/time.h]) + + AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec], + [AC_CACHE_CHECK([whether struct stat.st_atim is of type struct timespec], + [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[ + #include <sys/types.h> + #include <sys/stat.h> + #if HAVE_SYS_TIME_H + # include <sys/time.h> + #endif + #include <time.h> + struct timespec ts; + struct stat st; + ]], + [[ + st.st_atim = ts; + ]])], + [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes], + [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no])]) + if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then + AC_DEFINE([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], [1], + [Define to 1 if the type of the st_atim member of a struct stat is + struct timespec.]) + fi], + [AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec], [], + [AC_CHECK_MEMBERS([struct stat.st_atimensec], [], + [AC_CHECK_MEMBERS([struct stat.st_atim.st__tim.tv_nsec], [], [], + [#include <sys/types.h> + #include <sys/stat.h>])], + [#include <sys/types.h> + #include <sys/stat.h>])], + [#include <sys/types.h> + #include <sys/stat.h>])], + [#include <sys/types.h> + #include <sys/stat.h>]) +]) + +# Check for st_birthtime, a feature from UFS2 (FreeBSD, NetBSD, OpenBSD, etc.) +# and NTFS (Cygwin). +# There was a time when this field was named st_createtime (21 June +# 2002 to 16 July 2002) But that window is very small and applied only +# to development code, so systems still using that configuration are +# not supported. See revisions 1.10 and 1.11 of FreeBSD's +# src/sys/ufs/ufs/dinode.h. +# +AC_DEFUN([gl_STAT_BIRTHTIME], +[ + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_HEADERS_ONCE([sys/time.h]) + AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec], [], + [AC_CHECK_MEMBERS([struct stat.st_birthtimensec], [], + [AC_CHECK_MEMBERS([struct stat.st_birthtim.tv_nsec], [], [], + [#include <sys/types.h> + #include <sys/stat.h>])], + [#include <sys/types.h> + #include <sys/stat.h>])], + [#include <sys/types.h> + #include <sys/stat.h>]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/stat.m4 b/local/recipes/tools/diffutils/source/m4/stat.m4 new file mode 100644 index 0000000000..286fcba845 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/stat.m4 @@ -0,0 +1,67 @@ +# serial 12 + +# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STAT], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([lstat]) + case "$host_os" in + mingw*) + dnl On this platform, the original stat() returns st_atime, st_mtime, + dnl st_ctime values that are affected by the time zone. + REPLACE_STAT=1 + ;; + *) + dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/"). + dnl (For mingw, this is due to a broken stat() override in libmingwex.a.) + dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/"). + AC_CACHE_CHECK([whether stat handles trailing slashes on files], + [gl_cv_func_stat_file_slash], + [touch conftest.tmp + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + ln -s conftest.tmp conftest.lnk + fi + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <sys/stat.h> +]], [[int result = 0; + struct stat st; + if (!stat ("conftest.tmp/", &st)) + result |= 1; +#if HAVE_LSTAT + if (!stat ("conftest.lnk/", &st)) + result |= 2; +#endif + return result; + ]])], + [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_stat_file_slash="guessing no" ;; + esac + ]) + rm -f conftest.tmp conftest.lnk]) + case $gl_cv_func_stat_file_slash in + *no) + REPLACE_STAT=1 + AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs + help when passed a file name with a trailing slash]);; + esac + ;; + esac +]) + +# Prerequisites of lib/stat.c and lib/stat-w32.c. +AC_DEFUN([gl_PREREQ_STAT], [ + AC_REQUIRE([gl_HEADER_SYS_STAT_H]) + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/stdalign.m4 b/local/recipes/tools/diffutils/source/m4/stdalign.m4 new file mode 100644 index 0000000000..0652a1e4af --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/stdalign.m4 @@ -0,0 +1,57 @@ +# Check for stdalign.h that conforms to C11. + +dnl Copyright 2011-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Prepare for substituting <stdalign.h> if it is not supported. + +AC_DEFUN([gl_STDALIGN_H], +[ + AC_CACHE_CHECK([for working stdalign.h], + [gl_cv_header_working_stdalign_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <stdalign.h> + #include <stddef.h> + + /* Test that alignof yields a result consistent with offsetof. + This catches GCC bug 52023 + <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */ + #ifdef __cplusplus + template <class t> struct alignof_helper { char a; t b; }; + # define ao(type) offsetof (alignof_helper<type>, b) + #else + # define ao(type) offsetof (struct { char a; type b; }, b) + #endif + char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1]; + char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1]; + char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1]; + + /* Test _Alignas only on platforms where gnulib can help. */ + #if \ + ((defined __cplusplus && 201103 <= __cplusplus) \ + || (defined __APPLE__ && defined __MACH__ \ + ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ + : __GNUC__) \ + || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ + || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \ + || 1300 <= _MSC_VER) + struct alignas_test { char c; char alignas (8) alignas_8; }; + char test_alignas[offsetof (struct alignas_test, alignas_8) == 8 + ? 1 : -1]; + #endif + ]])], + [gl_cv_header_working_stdalign_h=yes], + [gl_cv_header_working_stdalign_h=no])]) + + if test $gl_cv_header_working_stdalign_h = yes; then + STDALIGN_H='' + else + STDALIGN_H='stdalign.h' + fi + + AC_SUBST([STDALIGN_H]) + AM_CONDITIONAL([GL_GENERATE_STDALIGN_H], [test -n "$STDALIGN_H"]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/stdarg.m4 b/local/recipes/tools/diffutils/source/m4/stdarg.m4 new file mode 100644 index 0000000000..40db5e43f3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/stdarg.m4 @@ -0,0 +1,78 @@ +# stdarg.m4 serial 6 +dnl Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. +dnl Provide a working va_copy in combination with <stdarg.h>. + +AC_DEFUN([gl_STDARG_H], +[ + STDARG_H='' + NEXT_STDARG_H='<stdarg.h>' + AC_MSG_CHECKING([for va_copy]) + AC_CACHE_VAL([gl_cv_func_va_copy], [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <stdarg.h>]], + [[ +#ifndef va_copy +void (*func) (va_list, va_list) = va_copy; +#endif + ]])], + [gl_cv_func_va_copy=yes], + [gl_cv_func_va_copy=no])]) + AC_MSG_RESULT([$gl_cv_func_va_copy]) + if test $gl_cv_func_va_copy = no; then + dnl Provide a substitute. + dnl Usually a simple definition in <config.h> is enough. Not so on AIX 5 + dnl with some versions of the /usr/vac/bin/cc compiler. It has an <stdarg.h> + dnl which does '#undef va_copy', leading to a missing va_copy symbol. For + dnl this platform, we use an <stdarg.h> substitute. But we cannot use this + dnl approach on other platforms, because <stdarg.h> often defines only + dnl preprocessor macros and gl_ABSOLUTE_HEADER, gl_CHECK_NEXT_HEADERS do + dnl not work in this situation. + AC_EGREP_CPP([vaccine], + [#if defined _AIX && !defined __GNUC__ + AIX vaccine + #endif + ], [gl_aixcc=yes], [gl_aixcc=no]) + if test $gl_aixcc = yes; then + dnl Provide a substitute <stdarg.h> file. + STDARG_H=stdarg.h + gl_NEXT_HEADERS([stdarg.h]) + dnl Fallback for the case when <stdarg.h> contains only macro definitions. + if test "$gl_cv_next_stdarg_h" = '""'; then + gl_cv_next_stdarg_h='"///usr/include/stdarg.h"' + NEXT_STDARG_H="$gl_cv_next_stdarg_h" + fi + else + dnl Provide a substitute in <config.h>, either __va_copy or as a simple + dnl assignment. + gl_CACHE_VAL_SILENT([gl_cv_func___va_copy], [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <stdarg.h>]], + [[ +#ifndef __va_copy +error, bail out +#endif + ]])], + [gl_cv_func___va_copy=yes], + [gl_cv_func___va_copy=no])]) + if test $gl_cv_func___va_copy = yes; then + AC_DEFINE([va_copy], [__va_copy], + [Define as a macro for copying va_list variables.]) + else + AH_VERBATIM([gl_VA_COPY], [/* A replacement for va_copy, if needed. */ +#define gl_va_copy(a,b) ((a) = (b))]) + AC_DEFINE([va_copy], [gl_va_copy], + [Define as a macro for copying va_list variables.]) + fi + fi + fi + AC_SUBST([STDARG_H]) + AM_CONDITIONAL([GL_GENERATE_STDARG_H], [test -n "$STDARG_H"]) + AC_SUBST([NEXT_STDARG_H]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/stdbool.m4 b/local/recipes/tools/diffutils/source/m4/stdbool.m4 new file mode 100644 index 0000000000..d368123360 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/stdbool.m4 @@ -0,0 +1,108 @@ +# Check for stdbool.h that conforms to C99. + +dnl Copyright (C) 2002-2006, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +#serial 7 + +# Prepare for substituting <stdbool.h> if it is not supported. + +AC_DEFUN([AM_STDBOOL_H], +[ + AC_REQUIRE([AC_CHECK_HEADER_STDBOOL]) + + # Define two additional variables used in the Makefile substitution. + + if test "$ac_cv_header_stdbool_h" = yes; then + STDBOOL_H='' + else + STDBOOL_H='stdbool.h' + fi + AC_SUBST([STDBOOL_H]) + AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"]) + + if test "$ac_cv_type__Bool" = yes; then + HAVE__BOOL=1 + else + HAVE__BOOL=0 + fi + AC_SUBST([HAVE__BOOL]) +]) + +# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future. +AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H]) + +# This version of the macro is needed in autoconf <= 2.68. + +AC_DEFUN([AC_CHECK_HEADER_STDBOOL], + [AC_CACHE_CHECK([for stdbool.h that conforms to C99], + [ac_cv_header_stdbool_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include <stdbool.h> + + #ifdef __cplusplus + typedef bool Bool; + #else + typedef _Bool Bool; + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #endif + + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + Bool q = true; + Bool *pq = &q; + bool *qq = &q; + ]], + [[ + bool e = &s; + *pq |= q; *pq |= ! q; + *qq |= q; *qq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq + !qq); + ]])], + [ac_cv_header_stdbool_h=yes], + [ac_cv_header_stdbool_h=no])]) + AC_CHECK_TYPES([_Bool]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/stddef_h.m4 b/local/recipes/tools/diffutils/source/m4/stddef_h.m4 new file mode 100644 index 0000000000..f45def1013 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/stddef_h.m4 @@ -0,0 +1,51 @@ +dnl A placeholder for <stddef.h>, for platforms that have issues. +# stddef_h.m4 serial 5 +dnl Copyright (C) 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_STDDEF_H], +[ + AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) + AC_REQUIRE([gt_TYPE_WCHAR_T]) + STDDEF_H= + AC_CHECK_TYPE([max_align_t], [], [HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h], + [[#include <stddef.h> + ]]) + if test $gt_cv_c_wchar_t = no; then + HAVE_WCHAR_T=0 + STDDEF_H=stddef.h + fi + AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions], + [gl_cv_decl_null_works], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h> + int test[2 * (sizeof NULL == sizeof (void *)) -1]; +]])], + [gl_cv_decl_null_works=yes], + [gl_cv_decl_null_works=no])]) + if test $gl_cv_decl_null_works = no; then + REPLACE_NULL=1 + STDDEF_H=stddef.h + fi + AC_SUBST([STDDEF_H]) + AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"]) + if test -n "$STDDEF_H"; then + gl_NEXT_HEADERS([stddef.h]) + fi +]) + +AC_DEFUN([gl_STDDEF_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) +]) + +AC_DEFUN([gl_STDDEF_H_DEFAULTS], +[ + dnl Assume proper GNU behavior unless another module says otherwise. + REPLACE_NULL=0; AC_SUBST([REPLACE_NULL]) + HAVE_MAX_ALIGN_T=1; AC_SUBST([HAVE_MAX_ALIGN_T]) + HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/stdint.m4 b/local/recipes/tools/diffutils/source/m4/stdint.m4 new file mode 100644 index 0000000000..4ac854d519 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/stdint.m4 @@ -0,0 +1,541 @@ +# stdint.m4 serial 50 +dnl Copyright (C) 2001-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert and Bruno Haible. +dnl Test whether <stdint.h> is supported or must be substituted. + +AC_DEFUN_ONCE([gl_STDINT_H], +[ + AC_PREREQ([2.59])dnl + + AC_REQUIRE([gl_LIMITS_H]) + AC_REQUIRE([gt_TYPE_WINT_T]) + + dnl Check for long long int and unsigned long long int. + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + if test $ac_cv_type_long_long_int = yes; then + HAVE_LONG_LONG_INT=1 + else + HAVE_LONG_LONG_INT=0 + fi + AC_SUBST([HAVE_LONG_LONG_INT]) + AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) + if test $ac_cv_type_unsigned_long_long_int = yes; then + HAVE_UNSIGNED_LONG_LONG_INT=1 + else + HAVE_UNSIGNED_LONG_LONG_INT=0 + fi + AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT]) + + dnl Check for <wchar.h>, in the same way as gl_WCHAR_H does. + AC_CHECK_HEADERS_ONCE([wchar.h]) + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + AC_SUBST([HAVE_WCHAR_H]) + + dnl Check for <inttypes.h>. + dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h. + if test $ac_cv_header_inttypes_h = yes; then + HAVE_INTTYPES_H=1 + else + HAVE_INTTYPES_H=0 + fi + AC_SUBST([HAVE_INTTYPES_H]) + + dnl Check for <sys/types.h>. + dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_sys_types_h. + if test $ac_cv_header_sys_types_h = yes; then + HAVE_SYS_TYPES_H=1 + else + HAVE_SYS_TYPES_H=0 + fi + AC_SUBST([HAVE_SYS_TYPES_H]) + + gl_CHECK_NEXT_HEADERS([stdint.h]) + if test $ac_cv_header_stdint_h = yes; then + HAVE_STDINT_H=1 + else + HAVE_STDINT_H=0 + fi + AC_SUBST([HAVE_STDINT_H]) + + dnl Now see whether we need a substitute <stdint.h>. + if test $ac_cv_header_stdint_h = yes; then + AC_CACHE_CHECK([whether stdint.h conforms to C99], + [gl_cv_header_working_stdint_h], + [gl_cv_header_working_stdint_h=no + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 +#include <stdint.h> +/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */ +#if !(defined WCHAR_MIN && defined WCHAR_MAX) +#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>" +#endif +] +gl_STDINT_INCLUDES +[ +#ifdef INT8_MAX +int8_t a1 = INT8_MAX; +int8_t a1min = INT8_MIN; +#endif +#ifdef INT16_MAX +int16_t a2 = INT16_MAX; +int16_t a2min = INT16_MIN; +#endif +#ifdef INT32_MAX +int32_t a3 = INT32_MAX; +int32_t a3min = INT32_MIN; +#endif +#ifdef INT64_MAX +int64_t a4 = INT64_MAX; +int64_t a4min = INT64_MIN; +#endif +#ifdef UINT8_MAX +uint8_t b1 = UINT8_MAX; +#else +typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; +#endif +#ifdef UINT16_MAX +uint16_t b2 = UINT16_MAX; +#endif +#ifdef UINT32_MAX +uint32_t b3 = UINT32_MAX; +#endif +#ifdef UINT64_MAX +uint64_t b4 = UINT64_MAX; +#endif +int_least8_t c1 = INT8_C (0x7f); +int_least8_t c1max = INT_LEAST8_MAX; +int_least8_t c1min = INT_LEAST8_MIN; +int_least16_t c2 = INT16_C (0x7fff); +int_least16_t c2max = INT_LEAST16_MAX; +int_least16_t c2min = INT_LEAST16_MIN; +int_least32_t c3 = INT32_C (0x7fffffff); +int_least32_t c3max = INT_LEAST32_MAX; +int_least32_t c3min = INT_LEAST32_MIN; +int_least64_t c4 = INT64_C (0x7fffffffffffffff); +int_least64_t c4max = INT_LEAST64_MAX; +int_least64_t c4min = INT_LEAST64_MIN; +uint_least8_t d1 = UINT8_C (0xff); +uint_least8_t d1max = UINT_LEAST8_MAX; +uint_least16_t d2 = UINT16_C (0xffff); +uint_least16_t d2max = UINT_LEAST16_MAX; +uint_least32_t d3 = UINT32_C (0xffffffff); +uint_least32_t d3max = UINT_LEAST32_MAX; +uint_least64_t d4 = UINT64_C (0xffffffffffffffff); +uint_least64_t d4max = UINT_LEAST64_MAX; +int_fast8_t e1 = INT_FAST8_MAX; +int_fast8_t e1min = INT_FAST8_MIN; +int_fast16_t e2 = INT_FAST16_MAX; +int_fast16_t e2min = INT_FAST16_MIN; +int_fast32_t e3 = INT_FAST32_MAX; +int_fast32_t e3min = INT_FAST32_MIN; +int_fast64_t e4 = INT_FAST64_MAX; +int_fast64_t e4min = INT_FAST64_MIN; +uint_fast8_t f1 = UINT_FAST8_MAX; +uint_fast16_t f2 = UINT_FAST16_MAX; +uint_fast32_t f3 = UINT_FAST32_MAX; +uint_fast64_t f4 = UINT_FAST64_MAX; +#ifdef INTPTR_MAX +intptr_t g = INTPTR_MAX; +intptr_t gmin = INTPTR_MIN; +#endif +#ifdef UINTPTR_MAX +uintptr_t h = UINTPTR_MAX; +#endif +intmax_t i = INTMAX_MAX; +uintmax_t j = UINTMAX_MAX; + +/* Check that SIZE_MAX has the correct type, if possible. */ +#if 201112 <= __STDC_VERSION__ +int k = _Generic (SIZE_MAX, size_t: 0); +#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) +extern size_t k; +extern __typeof__ (SIZE_MAX) k; +#endif + +#include <limits.h> /* for CHAR_BIT */ +#define TYPE_MINIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) +#define TYPE_MAXIMUM(t) \ + ((t) ((t) 0 < (t) -1 \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) +struct s { + int check_PTRDIFF: + PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) + && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) + ? 1 : -1; + /* Detect bug in FreeBSD 6.0 / ia64. */ + int check_SIG_ATOMIC: + SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) + && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) + ? 1 : -1; + int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; + int check_WCHAR: + WCHAR_MIN == TYPE_MINIMUM (wchar_t) + && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) + ? 1 : -1; + /* Detect bug in mingw. */ + int check_WINT: + WINT_MIN == TYPE_MINIMUM (wint_t) + && WINT_MAX == TYPE_MAXIMUM (wint_t) + ? 1 : -1; + + /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ + int check_UINT8_C: + (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; + int check_UINT16_C: + (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; + + /* Detect bugs in OpenBSD 3.9 stdint.h. */ +#ifdef UINT8_MAX + int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; +#endif +#ifdef UINT16_MAX + int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; +#endif +#ifdef UINT32_MAX + int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; +#endif +#ifdef UINT64_MAX + int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; +#endif + int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; + int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; + int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; + int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; + int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; + int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; + int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; + int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; + int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; + int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; + int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; +}; + ]])], + [dnl Determine whether the various *_MIN, *_MAX macros are usable + dnl in preprocessor expression. We could do it by compiling a test + dnl program for each of these macros. It is faster to run a program + dnl that inspects the macro expansion. + dnl This detects a bug on HP-UX 11.23/ia64. + AC_RUN_IFELSE([ + AC_LANG_PROGRAM([[ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 +#include <stdint.h> +] +gl_STDINT_INCLUDES +[ +#include <stdio.h> +#include <string.h> +#define MVAL(macro) MVAL1(macro) +#define MVAL1(expression) #expression +static const char *macro_values[] = + { +#ifdef INT8_MAX + MVAL (INT8_MAX), +#endif +#ifdef INT16_MAX + MVAL (INT16_MAX), +#endif +#ifdef INT32_MAX + MVAL (INT32_MAX), +#endif +#ifdef INT64_MAX + MVAL (INT64_MAX), +#endif +#ifdef UINT8_MAX + MVAL (UINT8_MAX), +#endif +#ifdef UINT16_MAX + MVAL (UINT16_MAX), +#endif +#ifdef UINT32_MAX + MVAL (UINT32_MAX), +#endif +#ifdef UINT64_MAX + MVAL (UINT64_MAX), +#endif + NULL + }; +]], [[ + const char **mv; + for (mv = macro_values; *mv != NULL; mv++) + { + const char *value = *mv; + /* Test whether it looks like a cast expression. */ + if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 + || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 + || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 + || strncmp (value, "((int)"/*)*/, 6) == 0 + || strncmp (value, "((signed short)"/*)*/, 15) == 0 + || strncmp (value, "((signed char)"/*)*/, 14) == 0) + return mv - macro_values + 1; + } + return 0; +]])], + [gl_cv_header_working_stdint_h=yes], + [], + [dnl When cross-compiling, assume it works. + gl_cv_header_working_stdint_h=yes + ]) + ]) + ]) + fi + + HAVE_C99_STDINT_H=0 + HAVE_SYS_BITYPES_H=0 + HAVE_SYS_INTTYPES_H=0 + STDINT_H=stdint.h + if test "$gl_cv_header_working_stdint_h" = yes; then + HAVE_C99_STDINT_H=1 + dnl Now see whether the system <stdint.h> works without + dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined. + AC_CACHE_CHECK([whether stdint.h predates C++11], + [gl_cv_header_stdint_predates_cxx11_h], + [gl_cv_header_stdint_predates_cxx11_h=yes + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include <stdint.h> +] +gl_STDINT_INCLUDES +[ +intmax_t im = INTMAX_MAX; +int32_t i32 = INT32_C (0x7fffffff); + ]])], + [gl_cv_header_stdint_predates_cxx11_h=no])]) + + if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + AC_DEFINE([__STDC_CONSTANT_MACROS], [1], + [Define to 1 if the system <stdint.h> predates C++11.]) + AC_DEFINE([__STDC_LIMIT_MACROS], [1], + [Define to 1 if the system <stdint.h> predates C++11.]) + fi + AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.], + [gl_cv_header_stdint_width], + [gl_cv_header_stdint_width=no + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 + #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include <stdint.h> + ]gl_STDINT_INCLUDES[ + int iw = UINTMAX_WIDTH; + ]])], + [gl_cv_header_stdint_width=yes])]) + if test "$gl_cv_header_stdint_width" = yes; then + STDINT_H= + fi + else + dnl Check for <sys/inttypes.h>, and for + dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5). + AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h]) + if test $ac_cv_header_sys_inttypes_h = yes; then + HAVE_SYS_INTTYPES_H=1 + fi + if test $ac_cv_header_sys_bitypes_h = yes; then + HAVE_SYS_BITYPES_H=1 + fi + gl_STDINT_TYPE_PROPERTIES + fi + + dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH. + LIMITS_H=limits.h + AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) + + AC_SUBST([HAVE_C99_STDINT_H]) + AC_SUBST([HAVE_SYS_BITYPES_H]) + AC_SUBST([HAVE_SYS_INTTYPES_H]) + AC_SUBST([STDINT_H]) + AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"]) +]) + +dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) +dnl Determine the size of each of the given types in bits. +AC_DEFUN([gl_STDINT_BITSIZEOF], +[ + dnl Use a shell loop, to avoid bloating configure, and + dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into + dnl config.h.in, + dnl - extra AC_SUBST calls, so that the right substitutions are made. + m4_foreach_w([gltype], [$1], + [AH_TEMPLATE([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), + [Define to the number of bits in type ']gltype['.])]) + for gltype in $1 ; do + AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}], + [AC_COMPUTE_INT([result], [sizeof ($gltype) * CHAR_BIT], + [$2 +#include <limits.h>], [result=unknown]) + eval gl_cv_bitsizeof_${gltype}=\$result + ]) + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + dnl Use a nonempty default, because some compilers, such as IRIX 5 cc, + dnl do a syntax check even on unused #if conditions and give an error + dnl on valid C code like this: + dnl #if 0 + dnl # if > 32 + dnl # endif + dnl #endif + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result]) + eval BITSIZEOF_${GLTYPE}=\$result + done + m4_foreach_w([gltype], [$1], + [AC_SUBST([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) +]) + +dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES) +dnl Determine the signedness of each of the given types. +dnl Define HAVE_SIGNED_TYPE if type is signed. +AC_DEFUN([gl_CHECK_TYPES_SIGNED], +[ + dnl Use a shell loop, to avoid bloating configure, and + dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into + dnl config.h.in, + dnl - extra AC_SUBST calls, so that the right substitutions are made. + m4_foreach_w([gltype], [$1], + [AH_TEMPLATE([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), + [Define to 1 if ']gltype[' is a signed integer type.])]) + for gltype in $1 ; do + AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([$2[ + int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];]])], + result=yes, result=no) + eval gl_cv_type_${gltype}_signed=\$result + ]) + eval result=\$gl_cv_type_${gltype}_signed + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + if test "$result" = yes; then + AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], [1]) + eval HAVE_SIGNED_${GLTYPE}=1 + else + eval HAVE_SIGNED_${GLTYPE}=0 + fi + done + m4_foreach_w([gltype], [$1], + [AC_SUBST([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) +]) + +dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES) +dnl Determine the suffix to use for integer constants of the given types. +dnl Define t_SUFFIX for each such type. +AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], +[ + dnl Use a shell loop, to avoid bloating configure, and + dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into + dnl config.h.in, + dnl - extra AC_SUBST calls, so that the right substitutions are made. + m4_foreach_w([gltype], [$1], + [AH_TEMPLATE(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX], + [Define to l, ll, u, ul, ull, etc., as suitable for + constants of type ']gltype['.])]) + for gltype in $1 ; do + AC_CACHE_CHECK([for $gltype integer literal suffix], + [gl_cv_type_${gltype}_suffix], + [eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([$2[ + extern $gltype foo; + extern $gltype1 foo;]])], + [eval gl_cv_type_${gltype}_suffix=\$glsuf]) + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done]) + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result]) + done + m4_foreach_w([gltype], [$1], + [AC_SUBST(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])]) +]) + +dnl gl_STDINT_INCLUDES +AC_DEFUN([gl_STDINT_INCLUDES], +[[ + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif +]]) + +dnl gl_STDINT_TYPE_PROPERTIES +dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t +dnl of interest to stdint.in.h. +AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], +[ + AC_REQUIRE([gl_MULTIARCH]) + if test $APPLE_UNIVERSAL_BUILD = 0; then + gl_STDINT_BITSIZEOF([ptrdiff_t size_t], + [gl_STDINT_INCLUDES]) + fi + gl_STDINT_BITSIZEOF([sig_atomic_t wchar_t wint_t], + [gl_STDINT_INCLUDES]) + gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t], + [gl_STDINT_INCLUDES]) + gl_cv_type_ptrdiff_t_signed=yes + gl_cv_type_size_t_signed=no + if test $APPLE_UNIVERSAL_BUILD = 0; then + gl_INTEGER_TYPE_SUFFIX([ptrdiff_t size_t], + [gl_STDINT_INCLUDES]) + fi + gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t], + [gl_STDINT_INCLUDES]) + + dnl If wint_t is smaller than 'int', it cannot satisfy the ISO C 99 + dnl requirement that wint_t is "unchanged by default argument promotions". + dnl In this case gnulib's <wchar.h> and <wctype.h> override wint_t. + dnl Set the variable BITSIZEOF_WINT_T accordingly. + if test $GNULIB_OVERRIDES_WINT_T = 1; then + BITSIZEOF_WINT_T=32 + fi +]) + +dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. +dnl Remove this when we can assume autoconf >= 2.61. +m4_ifdef([AC_COMPUTE_INT], [], [ + AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/stdint_h.m4 b/local/recipes/tools/diffutils/source/m4/stdint_h.m4 new file mode 100644 index 0000000000..786eaa3c95 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/stdint_h.m4 @@ -0,0 +1,27 @@ +# stdint_h.m4 serial 9 +dnl Copyright (C) 1997-2004, 2006, 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists, +# doesn't clash with <sys/types.h>, and declares uintmax_t. + +AC_DEFUN([gl_AC_HEADER_STDINT_H], +[ + AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <sys/types.h> + #include <stdint.h>]], + [[uintmax_t i = (uintmax_t) -1; return !i;]])], + [gl_cv_header_stdint_h=yes], + [gl_cv_header_stdint_h=no])]) + if test $gl_cv_header_stdint_h = yes; then + AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1], + [Define if <stdint.h> exists, doesn't clash with <sys/types.h>, + and declares uintmax_t. ]) + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/stdio_h.m4 b/local/recipes/tools/diffutils/source/m4/stdio_h.m4 new file mode 100644 index 0000000000..9ffbb852ea --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/stdio_h.m4 @@ -0,0 +1,225 @@ +# stdio_h.m4 serial 48 +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_STDIO_H], +[ + AH_VERBATIM([MINGW_ANSI_STDIO], +[/* Use GNU style printf and scanf. */ +#ifndef __USE_MINGW_ANSI_STDIO +# undef __USE_MINGW_ANSI_STDIO +#endif +]) + AC_DEFINE([__USE_MINGW_ANSI_STDIO]) + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + gl_NEXT_HEADERS([stdio.h]) + + dnl Determine whether __USE_MINGW_ANSI_STDIO makes printf and + dnl inttypes.h behave like gnu instead of system; we must give our + dnl printf wrapper the right attribute to match. + AC_CACHE_CHECK([which flavor of printf attribute matches inttypes macros], + [gl_cv_func_printf_attribute_flavor], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #define __STDC_FORMAT_MACROS 1 + #include <stdio.h> + #include <inttypes.h> + /* For non-mingw systems, compilation will trivially succeed. + For mingw, compilation will succeed for older mingw (system + printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */ + #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; + #endif + ]])], [gl_cv_func_printf_attribute_flavor=system], + [gl_cv_func_printf_attribute_flavor=gnu])]) + if test "$gl_cv_func_printf_attribute_flavor" = gnu; then + AC_DEFINE([GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU], [1], + [Define to 1 if printf and friends should be labeled with + attribute "__gnu_printf__" instead of "__printf__"]) + fi + + dnl No need to create extra modules for these functions. Everyone who uses + dnl <stdio.h> likely needs them. + GNULIB_FSCANF=1 + gl_MODULE_INDICATOR([fscanf]) + GNULIB_SCANF=1 + gl_MODULE_INDICATOR([scanf]) + GNULIB_FGETC=1 + GNULIB_GETC=1 + GNULIB_GETCHAR=1 + GNULIB_FGETS=1 + GNULIB_FREAD=1 + dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c" + dnl "expected source file, required through AC_LIBSOURCES, not found". It is + dnl also an optimization, to avoid performing a configure check whose result + dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING + dnl or GNULIB_NONBLOCKING redundant. + m4_ifdef([gl_NONBLOCKING_IO], [ + gl_NONBLOCKING_IO + if test $gl_cv_have_nonblocking != yes; then + REPLACE_STDIO_READ_FUNCS=1 + AC_LIBOBJ([stdio-read]) + fi + ]) + + dnl No need to create extra modules for these functions. Everyone who uses + dnl <stdio.h> likely needs them. + GNULIB_FPRINTF=1 + GNULIB_PRINTF=1 + GNULIB_VFPRINTF=1 + GNULIB_VPRINTF=1 + GNULIB_FPUTC=1 + GNULIB_PUTC=1 + GNULIB_PUTCHAR=1 + GNULIB_FPUTS=1 + GNULIB_PUTS=1 + GNULIB_FWRITE=1 + dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c" + dnl "expected source file, required through AC_LIBSOURCES, not found". It is + dnl also an optimization, to avoid performing a configure check whose result + dnl is not used. But it does not make the test of GNULIB_STDIO_H_SIGPIPE or + dnl GNULIB_SIGPIPE redundant. + m4_ifdef([gl_SIGNAL_SIGPIPE], [ + gl_SIGNAL_SIGPIPE + if test $gl_cv_header_signal_h_SIGPIPE != yes; then + REPLACE_STDIO_WRITE_FUNCS=1 + AC_LIBOBJ([stdio-write]) + fi + ]) + dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c" + dnl "expected source file, required through AC_LIBSOURCES, not found". It is + dnl also an optimization, to avoid performing a configure check whose result + dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING + dnl or GNULIB_NONBLOCKING redundant. + m4_ifdef([gl_NONBLOCKING_IO], [ + gl_NONBLOCKING_IO + if test $gl_cv_have_nonblocking != yes; then + REPLACE_STDIO_WRITE_FUNCS=1 + AC_LIBOBJ([stdio-write]) + fi + ]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use, and which is not + dnl guaranteed by both C89 and C11. + gl_WARN_ON_USE_PREPARE([[#include <stdio.h> + ]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen + renameat snprintf tmpfile vdprintf vsnprintf]) +]) + +AC_DEFUN([gl_STDIO_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_STDIO_H_DEFAULTS], +[ + GNULIB_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF]) + GNULIB_FCLOSE=0; AC_SUBST([GNULIB_FCLOSE]) + GNULIB_FDOPEN=0; AC_SUBST([GNULIB_FDOPEN]) + GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH]) + GNULIB_FGETC=0; AC_SUBST([GNULIB_FGETC]) + GNULIB_FGETS=0; AC_SUBST([GNULIB_FGETS]) + GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN]) + GNULIB_FPRINTF=0; AC_SUBST([GNULIB_FPRINTF]) + GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX]) + GNULIB_FPURGE=0; AC_SUBST([GNULIB_FPURGE]) + GNULIB_FPUTC=0; AC_SUBST([GNULIB_FPUTC]) + GNULIB_FPUTS=0; AC_SUBST([GNULIB_FPUTS]) + GNULIB_FREAD=0; AC_SUBST([GNULIB_FREAD]) + GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN]) + GNULIB_FSCANF=0; AC_SUBST([GNULIB_FSCANF]) + GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK]) + GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO]) + GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL]) + GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO]) + GNULIB_FWRITE=0; AC_SUBST([GNULIB_FWRITE]) + GNULIB_GETC=0; AC_SUBST([GNULIB_GETC]) + GNULIB_GETCHAR=0; AC_SUBST([GNULIB_GETCHAR]) + GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM]) + GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE]) + GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF]) + GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX]) + GNULIB_PCLOSE=0; AC_SUBST([GNULIB_PCLOSE]) + GNULIB_PERROR=0; AC_SUBST([GNULIB_PERROR]) + GNULIB_POPEN=0; AC_SUBST([GNULIB_POPEN]) + GNULIB_PRINTF=0; AC_SUBST([GNULIB_PRINTF]) + GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX]) + GNULIB_PUTC=0; AC_SUBST([GNULIB_PUTC]) + GNULIB_PUTCHAR=0; AC_SUBST([GNULIB_PUTCHAR]) + GNULIB_PUTS=0; AC_SUBST([GNULIB_PUTS]) + GNULIB_REMOVE=0; AC_SUBST([GNULIB_REMOVE]) + GNULIB_RENAME=0; AC_SUBST([GNULIB_RENAME]) + GNULIB_RENAMEAT=0; AC_SUBST([GNULIB_RENAMEAT]) + GNULIB_SCANF=0; AC_SUBST([GNULIB_SCANF]) + GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF]) + GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX]) + GNULIB_STDIO_H_NONBLOCKING=0; AC_SUBST([GNULIB_STDIO_H_NONBLOCKING]) + GNULIB_STDIO_H_SIGPIPE=0; AC_SUBST([GNULIB_STDIO_H_SIGPIPE]) + GNULIB_TMPFILE=0; AC_SUBST([GNULIB_TMPFILE]) + GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF]) + GNULIB_VFSCANF=0; AC_SUBST([GNULIB_VFSCANF]) + GNULIB_VSCANF=0; AC_SUBST([GNULIB_VSCANF]) + GNULIB_VDPRINTF=0; AC_SUBST([GNULIB_VDPRINTF]) + GNULIB_VFPRINTF=0; AC_SUBST([GNULIB_VFPRINTF]) + GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX]) + GNULIB_VPRINTF=0; AC_SUBST([GNULIB_VPRINTF]) + GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX]) + GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF]) + GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DECL_FPURGE=1; AC_SUBST([HAVE_DECL_FPURGE]) + HAVE_DECL_FSEEKO=1; AC_SUBST([HAVE_DECL_FSEEKO]) + HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO]) + HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM]) + HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE]) + HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF]) + HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF]) + HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF]) + HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF]) + HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO]) + HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO]) + HAVE_PCLOSE=1; AC_SUBST([HAVE_PCLOSE]) + HAVE_POPEN=1; AC_SUBST([HAVE_POPEN]) + HAVE_RENAMEAT=1; AC_SUBST([HAVE_RENAMEAT]) + HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF]) + HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF]) + REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF]) + REPLACE_FCLOSE=0; AC_SUBST([REPLACE_FCLOSE]) + REPLACE_FDOPEN=0; AC_SUBST([REPLACE_FDOPEN]) + REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH]) + REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN]) + REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF]) + REPLACE_FPURGE=0; AC_SUBST([REPLACE_FPURGE]) + REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN]) + REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK]) + REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO]) + REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL]) + REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO]) + REPLACE_GETDELIM=0; AC_SUBST([REPLACE_GETDELIM]) + REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE]) + REPLACE_OBSTACK_PRINTF=0; AC_SUBST([REPLACE_OBSTACK_PRINTF]) + REPLACE_PERROR=0; AC_SUBST([REPLACE_PERROR]) + REPLACE_POPEN=0; AC_SUBST([REPLACE_POPEN]) + REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF]) + REPLACE_REMOVE=0; AC_SUBST([REPLACE_REMOVE]) + REPLACE_RENAME=0; AC_SUBST([REPLACE_RENAME]) + REPLACE_RENAMEAT=0; AC_SUBST([REPLACE_RENAMEAT]) + REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF]) + REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF]) + REPLACE_STDIO_READ_FUNCS=0; AC_SUBST([REPLACE_STDIO_READ_FUNCS]) + REPLACE_STDIO_WRITE_FUNCS=0; AC_SUBST([REPLACE_STDIO_WRITE_FUNCS]) + REPLACE_TMPFILE=0; AC_SUBST([REPLACE_TMPFILE]) + REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF]) + REPLACE_VDPRINTF=0; AC_SUBST([REPLACE_VDPRINTF]) + REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF]) + REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF]) + REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF]) + REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/stdlib_h.m4 b/local/recipes/tools/diffutils/source/m4/stdlib_h.m4 new file mode 100644 index 0000000000..110fe2d1a9 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/stdlib_h.m4 @@ -0,0 +1,120 @@ +# stdlib_h.m4 serial 43 +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_STDLIB_H], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + gl_NEXT_HEADERS([stdlib.h]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use, and which is not + dnl guaranteed by C89. + gl_WARN_ON_USE_PREPARE([[#include <stdlib.h> +#if HAVE_SYS_LOADAVG_H +# include <sys/loadavg.h> +#endif +#if HAVE_RANDOM_H +# include <random.h> +#endif + ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt + initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps + posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch + secure_getenv setenv setstate setstate_r srandom srandom_r + strtod strtoll strtoull unlockpt unsetenv]) +]) + +AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_STDLIB_H_DEFAULTS], +[ + GNULIB__EXIT=0; AC_SUBST([GNULIB__EXIT]) + GNULIB_ATOLL=0; AC_SUBST([GNULIB_ATOLL]) + GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX]) + GNULIB_CANONICALIZE_FILE_NAME=0; AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME]) + GNULIB_GETLOADAVG=0; AC_SUBST([GNULIB_GETLOADAVG]) + GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) + GNULIB_GRANTPT=0; AC_SUBST([GNULIB_GRANTPT]) + GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX]) + GNULIB_MBTOWC=0; AC_SUBST([GNULIB_MBTOWC]) + GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP]) + GNULIB_MKOSTEMP=0; AC_SUBST([GNULIB_MKOSTEMP]) + GNULIB_MKOSTEMPS=0; AC_SUBST([GNULIB_MKOSTEMPS]) + GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP]) + GNULIB_MKSTEMPS=0; AC_SUBST([GNULIB_MKSTEMPS]) + GNULIB_POSIX_OPENPT=0; AC_SUBST([GNULIB_POSIX_OPENPT]) + GNULIB_PTSNAME=0; AC_SUBST([GNULIB_PTSNAME]) + GNULIB_PTSNAME_R=0; AC_SUBST([GNULIB_PTSNAME_R]) + GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV]) + GNULIB_QSORT_R=0; AC_SUBST([GNULIB_QSORT_R]) + GNULIB_RANDOM=0; AC_SUBST([GNULIB_RANDOM]) + GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R]) + GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX]) + GNULIB_REALPATH=0; AC_SUBST([GNULIB_REALPATH]) + GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH]) + GNULIB_SECURE_GETENV=0; AC_SUBST([GNULIB_SECURE_GETENV]) + GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV]) + GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD]) + GNULIB_STRTOLL=0; AC_SUBST([GNULIB_STRTOLL]) + GNULIB_STRTOULL=0; AC_SUBST([GNULIB_STRTOULL]) + GNULIB_SYSTEM_POSIX=0; AC_SUBST([GNULIB_SYSTEM_POSIX]) + GNULIB_UNLOCKPT=0; AC_SUBST([GNULIB_UNLOCKPT]) + GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV]) + GNULIB_WCTOMB=0; AC_SUBST([GNULIB_WCTOMB]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE__EXIT=1; AC_SUBST([HAVE__EXIT]) + HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL]) + HAVE_CANONICALIZE_FILE_NAME=1; AC_SUBST([HAVE_CANONICALIZE_FILE_NAME]) + HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG]) + HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) + HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT]) + HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP]) + HAVE_MKOSTEMP=1; AC_SUBST([HAVE_MKOSTEMP]) + HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS]) + HAVE_MKSTEMP=1; AC_SUBST([HAVE_MKSTEMP]) + HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS]) + HAVE_POSIX_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT]) + HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME]) + HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R]) + HAVE_QSORT_R=1; AC_SUBST([HAVE_QSORT_R]) + HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM]) + HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H]) + HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R]) + HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH]) + HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH]) + HAVE_SECURE_GETENV=1; AC_SUBST([HAVE_SECURE_GETENV]) + HAVE_SETENV=1; AC_SUBST([HAVE_SETENV]) + HAVE_DECL_SETENV=1; AC_SUBST([HAVE_DECL_SETENV]) + HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD]) + HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL]) + HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL]) + HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA]) + HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H]) + HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT]) + HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV]) + REPLACE_CALLOC=0; AC_SUBST([REPLACE_CALLOC]) + REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME]) + REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC]) + REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC]) + REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) + REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME]) + REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R]) + REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) + REPLACE_QSORT_R=0; AC_SUBST([REPLACE_QSORT_R]) + REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R]) + REPLACE_REALLOC=0; AC_SUBST([REPLACE_REALLOC]) + REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH]) + REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV]) + REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD]) + REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV]) + REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/strcase.m4 b/local/recipes/tools/diffutils/source/m4/strcase.m4 new file mode 100644 index 0000000000..de20eb6118 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/strcase.m4 @@ -0,0 +1,45 @@ +# strcase.m4 serial 11 +dnl Copyright (C) 2002, 2005-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_STRCASE], +[ + gl_FUNC_STRCASECMP + gl_FUNC_STRNCASECMP +]) + +AC_DEFUN([gl_FUNC_STRCASECMP], +[ + AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + AC_CHECK_FUNCS([strcasecmp]) + if test $ac_cv_func_strcasecmp = no; then + HAVE_STRCASECMP=0 + fi +]) + +AC_DEFUN([gl_FUNC_STRNCASECMP], +[ + AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + AC_CHECK_FUNCS([strncasecmp]) + if test $ac_cv_func_strncasecmp = yes; then + HAVE_STRNCASECMP=1 + else + HAVE_STRNCASECMP=0 + fi + AC_CHECK_DECLS([strncasecmp]) + if test $ac_cv_have_decl_strncasecmp = no; then + HAVE_DECL_STRNCASECMP=0 + fi +]) + +# Prerequisites of lib/strcasecmp.c. +AC_DEFUN([gl_PREREQ_STRCASECMP], [ + : +]) + +# Prerequisites of lib/strncasecmp.c. +AC_DEFUN([gl_PREREQ_STRNCASECMP], [ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/strerror.m4 b/local/recipes/tools/diffutils/source/m4/strerror.m4 new file mode 100644 index 0000000000..460ddc9571 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/strerror.m4 @@ -0,0 +1,96 @@ +# strerror.m4 serial 17 +dnl Copyright (C) 2002, 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STRERROR], +[ + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_HEADER_ERRNO_H]) + AC_REQUIRE([gl_FUNC_STRERROR_0]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [ + AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS]) + ]) + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + AC_CACHE_CHECK([for working strerror function], + [gl_cv_func_working_strerror], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <string.h> + ]], + [[if (!*strerror (-2)) return 1;]])], + [gl_cv_func_working_strerror=yes], + [gl_cv_func_working_strerror=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_working_strerror="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_strerror="guessing no" ;; + esac + ]) + ]) + case "$gl_cv_func_working_strerror" in + *yes) ;; + *) + dnl The system's strerror() fails to return a string for out-of-range + dnl integers. Replace it. + REPLACE_STRERROR=1 + ;; + esac + m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [ + dnl If the system's strerror_r or __xpg_strerror_r clobbers strerror's + dnl buffer, we must replace strerror. + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR=1 ;; + esac + ]) + else + dnl The system's strerror() cannot know about the new errno values we add + dnl to <errno.h>, or any fix for strerror(0). Replace it. + REPLACE_STRERROR=1 + fi +]) + +dnl Detect if strerror(0) passes (that is, does not set errno, and does not +dnl return a string that matches strerror(-1)). +AC_DEFUN([gl_FUNC_STRERROR_0], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + REPLACE_STRERROR_0=0 + AC_CACHE_CHECK([whether strerror(0) succeeds], + [gl_cv_func_strerror_0_works], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <string.h> + #include <errno.h> + ]], + [[int result = 0; + char *str; + errno = 0; + str = strerror (0); + if (!*str) result |= 1; + if (errno) result |= 2; + if (strstr (str, "nknown") || strstr (str, "ndefined")) + result |= 4; + return result;]])], + [gl_cv_func_strerror_0_works=yes], + [gl_cv_func_strerror_0_works=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_strerror_0_works="guessing no" ;; + esac + ]) + ]) + case "$gl_cv_func_strerror_0_works" in + *yes) ;; + *) + REPLACE_STRERROR_0=1 + AC_DEFINE([REPLACE_STRERROR_0], [1], [Define to 1 if strerror(0) + does not return a message implying success.]) + ;; + esac +]) diff --git a/local/recipes/tools/diffutils/source/m4/strerror_r.m4 b/local/recipes/tools/diffutils/source/m4/strerror_r.m4 new file mode 100644 index 0000000000..28cd0d42d4 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/strerror_r.m4 @@ -0,0 +1,173 @@ +# strerror_r.m4 serial 19 +dnl Copyright (C) 2002, 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STRERROR_R], +[ + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS]) + + dnl Persuade Solaris <string.h> to declare strerror_r(). + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + dnl Some systems don't declare strerror_r() if _THREAD_SAFE and _REENTRANT + dnl are not defined. + AC_CHECK_DECLS_ONCE([strerror_r]) + if test $ac_cv_have_decl_strerror_r = no; then + HAVE_DECL_STRERROR_R=0 + fi + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + if test $gl_cv_func_strerror_r_posix_signature = yes; then + case "$gl_cv_func_strerror_r_works" in + dnl The system's strerror_r has bugs. Replace it. + *no) REPLACE_STRERROR_R=1 ;; + esac + else + dnl The system's strerror_r() has a wrong signature. Replace it. + REPLACE_STRERROR_R=1 + fi + else + dnl The system's strerror_r() cannot know about the new errno values we + dnl add to <errno.h>, or any fix for strerror(0). Replace it. + REPLACE_STRERROR_R=1 + fi + fi +]) + +# Prerequisites of lib/strerror_r.c. +AC_DEFUN([gl_PREREQ_STRERROR_R], [ + dnl glibc >= 2.3.4 and cygwin 1.7.9 have a function __xpg_strerror_r. + AC_CHECK_FUNCS_ONCE([__xpg_strerror_r]) + AC_CHECK_FUNCS_ONCE([catgets]) + AC_CHECK_FUNCS_ONCE([snprintf]) +]) + +# Detect if strerror_r works, but without affecting whether a replacement +# strerror_r will be used. +AC_DEFUN([gl_FUNC_STRERROR_R_WORKS], +[ + AC_REQUIRE([gl_HEADER_ERRNO_H]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_FUNC_STRERROR_0]) + + AC_CHECK_FUNCS_ONCE([strerror_r]) + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + dnl The POSIX prototype is: int strerror_r (int, char *, size_t); + dnl glibc, Cygwin: char *strerror_r (int, char *, size_t); + dnl AIX 5.1, OSF/1 5.1: int strerror_r (int, char *, int); + AC_CACHE_CHECK([for strerror_r with POSIX signature], + [gl_cv_func_strerror_r_posix_signature], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <string.h> + int strerror_r (int, char *, size_t); + ]], + [])], + [gl_cv_func_strerror_r_posix_signature=yes], + [gl_cv_func_strerror_r_posix_signature=no]) + ]) + if test $gl_cv_func_strerror_r_posix_signature = yes; then + dnl AIX 6.1 strerror_r fails by returning -1, not an error number. + dnl HP-UX 11.31 strerror_r always fails when the buffer length argument + dnl is less than 80. + dnl FreeBSD 8.s strerror_r claims failure on 0 + dnl Mac OS X 10.5 strerror_r treats 0 like -1 + dnl Solaris 10 strerror_r corrupts errno on failure + AC_CACHE_CHECK([whether strerror_r works], + [gl_cv_func_strerror_r_works], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <errno.h> + #include <string.h> + ]], + [[int result = 0; + char buf[79]; + if (strerror_r (EACCES, buf, 0) < 0) + result |= 1; + errno = 0; + if (strerror_r (EACCES, buf, sizeof buf) != 0) + result |= 2; + strcpy (buf, "Unknown"); + if (strerror_r (0, buf, sizeof buf) != 0) + result |= 4; + if (errno) + result |= 8; + if (strstr (buf, "nknown") || strstr (buf, "ndefined")) + result |= 0x10; + errno = 0; + *buf = 0; + if (strerror_r (-3, buf, sizeof buf) < 0) + result |= 0x20; + if (errno) + result |= 0x40; + if (!*buf) + result |= 0x80; + return result; + ]])], + [gl_cv_func_strerror_r_works=yes], + [gl_cv_func_strerror_r_works=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess no on AIX. + aix*) gl_cv_func_strerror_r_works="guessing no";; + # Guess no on HP-UX. + hpux*) gl_cv_func_strerror_r_works="guessing no";; + # Guess no on BSD variants. + *bsd*) gl_cv_func_strerror_r_works="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_strerror_r_works="guessing yes";; + esac +changequote([,])dnl + ]) + ]) + else + dnl The system's strerror() has a wrong signature. + dnl glibc >= 2.3.4 and cygwin 1.7.9 have a function __xpg_strerror_r. + AC_CHECK_FUNCS_ONCE([__xpg_strerror_r]) + dnl In glibc < 2.14, __xpg_strerror_r does not populate buf on failure. + dnl In cygwin < 1.7.10, __xpg_strerror_r clobbers strerror's buffer. + if test $ac_cv_func___xpg_strerror_r = yes; then + AC_CACHE_CHECK([whether __xpg_strerror_r works], + [gl_cv_func_strerror_r_works], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <errno.h> + #include <string.h> + extern + #ifdef __cplusplus + "C" + #endif + int __xpg_strerror_r(int, char *, size_t); + ]], + [[int result = 0; + char buf[256] = "^"; + char copy[256]; + char *str = strerror (-1); + strcpy (copy, str); + if (__xpg_strerror_r (-2, buf, 1) == 0) + result |= 1; + if (*buf) + result |= 2; + __xpg_strerror_r (-2, buf, 256); + if (strcmp (str, copy)) + result |= 4; + return result; + ]])], + [gl_cv_func_strerror_r_works=yes], + [gl_cv_func_strerror_r_works=no], + [dnl Guess no on all platforms that have __xpg_strerror_r, + dnl at least until fixed glibc and cygwin are more common. + gl_cv_func_strerror_r_works="guessing no" + ]) + ]) + fi + fi + fi + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/strftime.m4 b/local/recipes/tools/diffutils/source/m4/strftime.m4 new file mode 100644 index 0000000000..d2dac9e232 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/strftime.m4 @@ -0,0 +1,22 @@ +# serial 34 + +# Copyright (C) 1996-1997, 1999-2007, 2009-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Written by Jim Meyering and Paul Eggert. + +AC_DEFUN([gl_FUNC_GNU_STRFTIME], +[ + # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE. + AC_REQUIRE([AC_STRUCT_TIMEZONE]) + + AC_REQUIRE([gl_TM_GMTOFF]) + + AC_CHECK_FUNCS_ONCE([tzset]) + + AC_DEFINE([my_strftime], [nstrftime], + [Define to the name of the strftime replacement function.]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/string_h.m4 b/local/recipes/tools/diffutils/source/m4/string_h.m4 new file mode 100644 index 0000000000..3d2ad2219a --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/string_h.m4 @@ -0,0 +1,120 @@ +# Configure a GNU-like replacement for <string.h>. + +# Copyright (C) 2007-2017 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 21 + +# Written by Paul Eggert. + +AC_DEFUN([gl_HEADER_STRING_H], +[ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_HEADER_STRING_H_BODY]) +]) + +AC_DEFUN([gl_HEADER_STRING_H_BODY], +[ + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + gl_NEXT_HEADERS([string.h]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use, and which is not + dnl guaranteed by C89. + gl_WARN_ON_USE_PREPARE([[#include <string.h> + ]], + [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul + strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r + strerror_r strsignal strverscmp]) +]) + +AC_DEFUN([gl_STRING_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], +[ + GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL]) + GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL]) + GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR]) + GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) + GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) + GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR]) + GNULIB_RAWMEMCHR=0; AC_SUBST([GNULIB_RAWMEMCHR]) + GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY]) + GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY]) + GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL]) + GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP]) + GNULIB_STRNCAT=0; AC_SUBST([GNULIB_STRNCAT]) + GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP]) + GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN]) + GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK]) + GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP]) + GNULIB_STRSTR=0; AC_SUBST([GNULIB_STRSTR]) + GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR]) + GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R]) + GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN]) + GNULIB_MBSNLEN=0; AC_SUBST([GNULIB_MBSNLEN]) + GNULIB_MBSCHR=0; AC_SUBST([GNULIB_MBSCHR]) + GNULIB_MBSRCHR=0; AC_SUBST([GNULIB_MBSRCHR]) + GNULIB_MBSSTR=0; AC_SUBST([GNULIB_MBSSTR]) + GNULIB_MBSCASECMP=0; AC_SUBST([GNULIB_MBSCASECMP]) + GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP]) + GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP]) + GNULIB_MBSCASESTR=0; AC_SUBST([GNULIB_MBSCASESTR]) + GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN]) + GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK]) + GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN]) + GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP]) + GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) + GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR]) + GNULIB_STRERROR_R=0; AC_SUBST([GNULIB_STRERROR_R]) + GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL]) + GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP]) + HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_FFSL=1; AC_SUBST([HAVE_FFSL]) + HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL]) + HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR]) + HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM]) + HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY]) + HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR]) + HAVE_RAWMEMCHR=1; AC_SUBST([HAVE_RAWMEMCHR]) + HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY]) + HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY]) + HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL]) + HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP]) + HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP]) + HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN]) + HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK]) + HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP]) + HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR]) + HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R]) + HAVE_DECL_STRERROR_R=1; AC_SUBST([HAVE_DECL_STRERROR_R]) + HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL]) + HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP]) + REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR]) + REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM]) + REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY]) + REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP]) + REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR]) + REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR]) + REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL]) + REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR]) + REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R]) + REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT]) + REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP]) + REPLACE_STRNLEN=0; AC_SUBST([REPLACE_STRNLEN]) + REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL]) + REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R]) + UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/strings_h.m4 b/local/recipes/tools/diffutils/source/m4/strings_h.m4 new file mode 100644 index 0000000000..1163a6328f --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/strings_h.m4 @@ -0,0 +1,52 @@ +# Configure a replacement for <strings.h>. +# serial 6 + +# Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_HEADER_STRINGS_H], +[ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_HEADER_STRINGS_H_BODY]) +]) + +AC_DEFUN([gl_HEADER_STRINGS_H_BODY], +[ + AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + + gl_CHECK_NEXT_HEADERS([strings.h]) + if test $ac_cv_header_strings_h = yes; then + HAVE_STRINGS_H=1 + else + HAVE_STRINGS_H=0 + fi + AC_SUBST([HAVE_STRINGS_H]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ + /* Minix 3.1.8 has a bug: <sys/types.h> must be included before + <strings.h>. */ + #include <sys/types.h> + #include <strings.h> + ]], [ffs strcasecmp strncasecmp]) +]) + +AC_DEFUN([gl_STRINGS_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) +]) + +AC_DEFUN([gl_HEADER_STRINGS_H_DEFAULTS], +[ + GNULIB_FFS=0; AC_SUBST([GNULIB_FFS]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_FFS=1; AC_SUBST([HAVE_FFS]) + HAVE_STRCASECMP=1; AC_SUBST([HAVE_STRCASECMP]) + HAVE_DECL_STRNCASECMP=1; AC_SUBST([HAVE_DECL_STRNCASECMP]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/strndup.m4 b/local/recipes/tools/diffutils/source/m4/strndup.m4 new file mode 100644 index 0000000000..7a28f21c2f --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/strndup.m4 @@ -0,0 +1,58 @@ +# strndup.m4 serial 22 +dnl Copyright (C) 2002-2003, 2005-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STRNDUP], +[ + dnl Persuade glibc <string.h> to declare strndup(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_CHECK_DECLS_ONCE([strndup]) + AC_CHECK_FUNCS_ONCE([strndup]) + if test $ac_cv_have_decl_strndup = no; then + HAVE_DECL_STRNDUP=0 + fi + + if test $ac_cv_func_strndup = yes; then + HAVE_STRNDUP=1 + # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. + AC_CACHE_CHECK([for working strndup], [gl_cv_func_strndup_works], + [AC_RUN_IFELSE([ + AC_LANG_PROGRAM([[#include <string.h> + #include <stdlib.h>]], [[ +#if !HAVE_DECL_STRNDUP + extern + #ifdef __cplusplus + "C" + #endif + char *strndup (const char *, size_t); +#endif + int result; + char *s; + s = strndup ("some longer string", 15); + free (s); + s = strndup ("shorter string", 13); + result = s[13] != '\0'; + free (s); + return result;]])], + [gl_cv_func_strndup_works=yes], + [gl_cv_func_strndup_works=no], + [ +changequote(,)dnl + case $host_os in + aix | aix[3-6]*) gl_cv_func_strndup_works="guessing no";; + *) gl_cv_func_strndup_works="guessing yes";; + esac +changequote([,])dnl + ])]) + case $gl_cv_func_strndup_works in + *no) REPLACE_STRNDUP=1 ;; + esac + else + HAVE_STRNDUP=0 + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/strnlen.m4 b/local/recipes/tools/diffutils/source/m4/strnlen.m4 new file mode 100644 index 0000000000..bf05027167 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/strnlen.m4 @@ -0,0 +1,30 @@ +# strnlen.m4 serial 13 +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2017 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STRNLEN], +[ + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + + dnl Persuade glibc <string.h> to declare strnlen(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + AC_CHECK_DECLS_ONCE([strnlen]) + if test $ac_cv_have_decl_strnlen = no; then + HAVE_DECL_STRNLEN=0 + else + m4_pushdef([AC_LIBOBJ], [:]) + dnl Note: AC_FUNC_STRNLEN does AC_LIBOBJ([strnlen]). + AC_FUNC_STRNLEN + m4_popdef([AC_LIBOBJ]) + if test $ac_cv_func_strnlen_working = no; then + REPLACE_STRNLEN=1 + fi + fi +]) + +# Prerequisites of lib/strnlen.c. +AC_DEFUN([gl_PREREQ_STRNLEN], [:]) diff --git a/local/recipes/tools/diffutils/source/m4/strptime.m4 b/local/recipes/tools/diffutils/source/m4/strptime.m4 new file mode 100644 index 0000000000..91ce49849f --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/strptime.m4 @@ -0,0 +1,22 @@ +# strptime.m4 serial 7 +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STRPTIME], +[ + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([AC_C_RESTRICT]) + AC_CHECK_FUNCS_ONCE([strptime]) + if test $ac_cv_func_strptime != yes; then + HAVE_STRPTIME=0 + fi +]) + +# Prerequisites of lib/strptime.c. +AC_DEFUN([gl_PREREQ_STRPTIME], +[ + AC_REQUIRE([gl_TM_GMTOFF]) + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/strtoull.m4 b/local/recipes/tools/diffutils/source/m4/strtoull.m4 new file mode 100644 index 0000000000..c6b215072b --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/strtoull.m4 @@ -0,0 +1,24 @@ +# strtoull.m4 serial 7 +dnl Copyright (C) 2002, 2004, 2006, 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STRTOULL], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + dnl We don't need (and can't compile) the replacement strtoull + dnl unless the type 'unsigned long long int' exists. + AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) + if test "$ac_cv_type_unsigned_long_long_int" = yes; then + AC_CHECK_FUNCS([strtoull]) + if test $ac_cv_func_strtoull = no; then + HAVE_STRTOULL=0 + fi + fi +]) + +# Prerequisites of lib/strtoull.c. +AC_DEFUN([gl_PREREQ_STRTOULL], [ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/strtoumax.m4 b/local/recipes/tools/diffutils/source/m4/strtoumax.m4 new file mode 100644 index 0000000000..43ef5b5abb --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/strtoumax.m4 @@ -0,0 +1,28 @@ +# strtoumax.m4 serial 12 +dnl Copyright (C) 2002-2004, 2006, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STRTOUMAX], +[ + AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) + + dnl On OSF/1 5.1 with cc, this function is declared but not defined. + AC_CHECK_FUNCS_ONCE([strtoumax]) + AC_CHECK_DECLS_ONCE([strtoumax]) + if test "$ac_cv_have_decl_strtoumax" = yes; then + if test "$ac_cv_func_strtoumax" != yes; then + # HP-UX 11.11 has "#define strtoimax(...) ..." but no function. + REPLACE_STRTOUMAX=1 + fi + else + HAVE_DECL_STRTOUMAX=0 + fi +]) + +# Prerequisites of lib/strtoumax.c. +AC_DEFUN([gl_PREREQ_STRTOUMAX], [ + AC_CHECK_DECLS([strtoull]) + AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/symlink.m4 b/local/recipes/tools/diffutils/source/m4/symlink.m4 new file mode 100644 index 0000000000..220ea1922e --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/symlink.m4 @@ -0,0 +1,53 @@ +# serial 6 +# See if we need to provide symlink replacement. + +dnl Copyright (C) 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Written by Eric Blake. + +AC_DEFUN([gl_FUNC_SYMLINK], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CHECK_FUNCS_ONCE([symlink]) + dnl The best we can do on mingw is provide a dummy that always fails, so + dnl that compilation can proceed with fewer ifdefs. On FreeBSD 7.2, AIX 7.1, + dnl and Solaris 9, we want to fix a bug with trailing slash handling. + if test $ac_cv_func_symlink = no; then + HAVE_SYMLINK=0 + else + AC_CACHE_CHECK([whether symlink handles trailing slash correctly], + [gl_cv_func_symlink_works], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <unistd.h> + ]], + [[int result = 0; + if (!symlink ("a", "conftest.link/")) + result |= 1; + if (symlink ("conftest.f", "conftest.lnk2")) + result |= 2; + else if (!symlink ("a", "conftest.lnk2/")) + result |= 4; + return result; + ]])], + [gl_cv_func_symlink_works=yes], [gl_cv_func_symlink_works=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_symlink_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_symlink_works="guessing no" ;; + esac + ]) + rm -f conftest.f conftest.link conftest.lnk2]) + case "$gl_cv_func_symlink_works" in + *yes) ;; + *) + REPLACE_SYMLINK=1 + ;; + esac + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/sys_ioctl_h.m4 b/local/recipes/tools/diffutils/source/m4/sys_ioctl_h.m4 new file mode 100644 index 0000000000..e68f9cd7a9 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/sys_ioctl_h.m4 @@ -0,0 +1,64 @@ +# sys_ioctl_h.m4 serial 10 +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Bruno Haible. + +AC_DEFUN([gl_SYS_IOCTL_H], +[ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS]) + + AC_CHECK_HEADERS_ONCE([sys/ioctl.h]) + if test $ac_cv_header_sys_ioctl_h = yes; then + HAVE_SYS_IOCTL_H=1 + dnl Test whether <sys/ioctl.h> declares ioctl(), or whether some other + dnl header file, such as <unistd.h> or <stropts.h>, is needed for that. + AC_CACHE_CHECK([whether <sys/ioctl.h> declares ioctl], + [gl_cv_decl_ioctl_in_sys_ioctl_h], + [dnl We cannot use AC_CHECK_DECL because it produces its own messages. + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [AC_INCLUDES_DEFAULT([#include <sys/ioctl.h>])], + [(void) ioctl;])], + [gl_cv_decl_ioctl_in_sys_ioctl_h=yes], + [gl_cv_decl_ioctl_in_sys_ioctl_h=no]) + ]) + else + HAVE_SYS_IOCTL_H=0 + fi + AC_SUBST([HAVE_SYS_IOCTL_H]) + dnl <sys/ioctl.h> is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([sys/ioctl.h]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include <sys/ioctl.h> +/* Some platforms declare ioctl in the wrong header. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <unistd.h> +#endif + ]], [ioctl]) +]) + +AC_DEFUN([gl_SYS_IOCTL_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_SYS_IOCTL_H_DEFAULTS], +[ + GNULIB_IOCTL=0; AC_SUBST([GNULIB_IOCTL]) + dnl Assume proper GNU behavior unless another module says otherwise. + SYS_IOCTL_H_HAVE_WINSOCK2_H=0; AC_SUBST([SYS_IOCTL_H_HAVE_WINSOCK2_H]) + SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; + AC_SUBST([SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS]) + REPLACE_IOCTL=0; AC_SUBST([REPLACE_IOCTL]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/sys_select_h.m4 b/local/recipes/tools/diffutils/source/m4/sys_select_h.m4 new file mode 100644 index 0000000000..4ec28009da --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/sys_select_h.m4 @@ -0,0 +1,95 @@ +# sys_select_h.m4 serial 20 +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_HEADER_SYS_SELECT], +[ + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([gl_SYS_SELECT_H_DEFAULTS]) + AC_CACHE_CHECK([whether <sys/select.h> is self-contained], + [gl_cv_header_sys_select_h_selfcontained], + [ + dnl Test against two bugs: + dnl 1. On many platforms, <sys/select.h> assumes prior inclusion of + dnl <sys/types.h>. + dnl 2. On OSF/1 4.0, <sys/select.h> provides only a forward declaration + dnl of 'struct timeval', and no definition of this type. + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/select.h>]], + [[struct timeval b;]])], + [gl_cv_header_sys_select_h_selfcontained=yes], + [gl_cv_header_sys_select_h_selfcontained=no]) + dnl Test against another bug: + dnl 3. On Solaris 10, <sys/select.h> provides an FD_ZERO implementation + dnl that relies on memset(), but without including <string.h>. + if test $gl_cv_header_sys_select_h_selfcontained = yes; then + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include <sys/select.h>]], + [[int memset; int bzero;]]) + ], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include <sys/select.h>]], [[ + #undef memset + #define memset nonexistent_memset + extern + #ifdef __cplusplus + "C" + #endif + void *memset (void *, int, unsigned long); + #undef bzero + #define bzero nonexistent_bzero + extern + #ifdef __cplusplus + "C" + #endif + void bzero (void *, unsigned long); + fd_set fds; + FD_ZERO (&fds); + ]]) + ], + [], + [gl_cv_header_sys_select_h_selfcontained=no]) + ]) + fi + ]) + dnl <sys/select.h> is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([sys/select.h]) + if test $ac_cv_header_sys_select_h = yes; then + HAVE_SYS_SELECT_H=1 + else + HAVE_SYS_SELECT_H=0 + fi + AC_SUBST([HAVE_SYS_SELECT_H]) + gl_PREREQ_SYS_H_WINSOCK2 + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ +/* Some systems require prerequisite headers. */ +#include <sys/types.h> +#if !(defined __GLIBC__ && !defined __UCLIBC__) && HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +#include <sys/select.h> + ]], [pselect select]) +]) + +AC_DEFUN([gl_SYS_SELECT_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_SELECT_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_SYS_SELECT_H_DEFAULTS], +[ + GNULIB_PSELECT=0; AC_SUBST([GNULIB_PSELECT]) + GNULIB_SELECT=0; AC_SUBST([GNULIB_SELECT]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_PSELECT=1; AC_SUBST([HAVE_PSELECT]) + REPLACE_PSELECT=0; AC_SUBST([REPLACE_PSELECT]) + REPLACE_SELECT=0; AC_SUBST([REPLACE_SELECT]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/sys_socket_h.m4 b/local/recipes/tools/diffutils/source/m4/sys_socket_h.m4 new file mode 100644 index 0000000000..3ecbe7c021 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/sys_socket_h.m4 @@ -0,0 +1,176 @@ +# sys_socket_h.m4 serial 23 +dnl Copyright (C) 2005-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Simon Josefsson. + +AC_DEFUN([gl_HEADER_SYS_SOCKET], +[ + AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + + dnl On OSF/1, the functions recv(), send(), recvfrom(), sendto() have + dnl old-style declarations (with return type 'int' instead of 'ssize_t') + dnl unless _POSIX_PII_SOCKET is defined. + case "$host_os" in + osf*) + AC_DEFINE([_POSIX_PII_SOCKET], [1], + [Define to 1 in order to get the POSIX compatible declarations + of socket functions.]) + ;; + esac + + AC_CACHE_CHECK([whether <sys/socket.h> is self-contained], + [gl_cv_header_sys_socket_h_selfcontained], + [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[]])], + [gl_cv_header_sys_socket_h_selfcontained=yes], + [gl_cv_header_sys_socket_h_selfcontained=no]) + ]) + if test $gl_cv_header_sys_socket_h_selfcontained = yes; then + dnl If the shutdown function exists, <sys/socket.h> should define + dnl SHUT_RD, SHUT_WR, SHUT_RDWR. + AC_CHECK_FUNCS([shutdown]) + if test $ac_cv_func_shutdown = yes; then + AC_CACHE_CHECK([whether <sys/socket.h> defines the SHUT_* macros], + [gl_cv_header_sys_socket_h_shut], + [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include <sys/socket.h>]], + [[int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };]])], + [gl_cv_header_sys_socket_h_shut=yes], + [gl_cv_header_sys_socket_h_shut=no]) + ]) + if test $gl_cv_header_sys_socket_h_shut = no; then + SYS_SOCKET_H='sys/socket.h' + fi + fi + fi + # We need to check for ws2tcpip.h now. + gl_PREREQ_SYS_H_SOCKET + AC_CHECK_TYPES([struct sockaddr_storage, sa_family_t],,,[ + /* sys/types.h is not needed according to POSIX, but the + sys/socket.h in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_WS2TCPIP_H +#include <ws2tcpip.h> +#endif +]) + if test $ac_cv_type_struct_sockaddr_storage = no; then + HAVE_STRUCT_SOCKADDR_STORAGE=0 + fi + if test $ac_cv_type_sa_family_t = no; then + HAVE_SA_FAMILY_T=0 + fi + if test $ac_cv_type_struct_sockaddr_storage != no; then + AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], + [], + [HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0], + [#include <sys/types.h> + #ifdef HAVE_SYS_SOCKET_H + #include <sys/socket.h> + #endif + #ifdef HAVE_WS2TCPIP_H + #include <ws2tcpip.h> + #endif + ]) + fi + if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \ + || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then + SYS_SOCKET_H='sys/socket.h' + fi + gl_PREREQ_SYS_H_WINSOCK2 + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ +/* Some systems require prerequisite headers. */ +#include <sys/types.h> +#include <sys/socket.h> + ]], [socket connect accept bind getpeername getsockname getsockopt + listen recv send recvfrom sendto setsockopt shutdown accept4]) +]) + +AC_DEFUN([gl_PREREQ_SYS_H_SOCKET], +[ + dnl Check prerequisites of the <sys/socket.h> replacement. + AC_REQUIRE([gl_CHECK_SOCKET_HEADERS]) + gl_CHECK_NEXT_HEADERS([sys/socket.h]) + if test $ac_cv_header_sys_socket_h = yes; then + HAVE_SYS_SOCKET_H=1 + HAVE_WS2TCPIP_H=0 + else + HAVE_SYS_SOCKET_H=0 + if test $ac_cv_header_ws2tcpip_h = yes; then + HAVE_WS2TCPIP_H=1 + else + HAVE_WS2TCPIP_H=0 + fi + fi + AC_SUBST([HAVE_SYS_SOCKET_H]) + AC_SUBST([HAVE_WS2TCPIP_H]) +]) + +# Common prerequisites of the <sys/socket.h> replacement and of the +# <sys/select.h> replacement. +# Sets and substitutes HAVE_WINSOCK2_H. +AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2], +[ + m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])]) + m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])]) + AC_CHECK_HEADERS_ONCE([sys/socket.h]) + if test $ac_cv_header_sys_socket_h != yes; then + dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make + dnl the check for those headers unconditional; yet cygwin reports + dnl that the headers are present but cannot be compiled (since on + dnl cygwin, all socket information should come from sys/socket.h). + AC_CHECK_HEADERS([winsock2.h]) + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + AC_SUBST([HAVE_WINSOCK2_H]) +]) + +AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS], +[ + GNULIB_SOCKET=0; AC_SUBST([GNULIB_SOCKET]) + GNULIB_CONNECT=0; AC_SUBST([GNULIB_CONNECT]) + GNULIB_ACCEPT=0; AC_SUBST([GNULIB_ACCEPT]) + GNULIB_BIND=0; AC_SUBST([GNULIB_BIND]) + GNULIB_GETPEERNAME=0; AC_SUBST([GNULIB_GETPEERNAME]) + GNULIB_GETSOCKNAME=0; AC_SUBST([GNULIB_GETSOCKNAME]) + GNULIB_GETSOCKOPT=0; AC_SUBST([GNULIB_GETSOCKOPT]) + GNULIB_LISTEN=0; AC_SUBST([GNULIB_LISTEN]) + GNULIB_RECV=0; AC_SUBST([GNULIB_RECV]) + GNULIB_SEND=0; AC_SUBST([GNULIB_SEND]) + GNULIB_RECVFROM=0; AC_SUBST([GNULIB_RECVFROM]) + GNULIB_SENDTO=0; AC_SUBST([GNULIB_SENDTO]) + GNULIB_SETSOCKOPT=0; AC_SUBST([GNULIB_SETSOCKOPT]) + GNULIB_SHUTDOWN=0; AC_SUBST([GNULIB_SHUTDOWN]) + GNULIB_ACCEPT4=0; AC_SUBST([GNULIB_ACCEPT4]) + HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE]) + HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1; + AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY]) + HAVE_SA_FAMILY_T=1; AC_SUBST([HAVE_SA_FAMILY_T]) + HAVE_ACCEPT4=1; AC_SUBST([HAVE_ACCEPT4]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/sys_stat_h.m4 b/local/recipes/tools/diffutils/source/m4/sys_stat_h.m4 new file mode 100644 index 0000000000..8934278982 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/sys_stat_h.m4 @@ -0,0 +1,100 @@ +# sys_stat_h.m4 serial 31 -*- Autoconf -*- +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Eric Blake. +dnl Provide a GNU-like <sys/stat.h>. + +AC_DEFUN([gl_HEADER_SYS_STAT_H], +[ + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + + dnl Check for broken stat macros. + AC_REQUIRE([AC_HEADER_STAT]) + + gl_CHECK_NEXT_HEADERS([sys/stat.h]) + + dnl Ensure the type mode_t gets defined. + AC_REQUIRE([AC_TYPE_MODE_T]) + + dnl Whether to enable precise timestamps in 'struct stat'. + m4_ifdef([gl_WINDOWS_STAT_TIMESPEC], [ + AC_REQUIRE([gl_WINDOWS_STAT_TIMESPEC]) + ], [ + WINDOWS_STAT_TIMESPEC=0 + ]) + AC_SUBST([WINDOWS_STAT_TIMESPEC]) + + dnl Whether to ensure that struct stat.st_size is 64-bit wide. + m4_ifdef([gl_LARGEFILE], [ + AC_REQUIRE([gl_LARGEFILE]) + ], [ + WINDOWS_64_BIT_ST_SIZE=0 + ]) + AC_SUBST([WINDOWS_64_BIT_ST_SIZE]) + + dnl Define types that are supposed to be defined in <sys/types.h> or + dnl <sys/stat.h>. + AC_CHECK_TYPE([nlink_t], [], + [AC_DEFINE([nlink_t], [int], + [Define to the type of st_nlink in struct stat, or a supertype.])], + [#include <sys/types.h> + #include <sys/stat.h>]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include <sys/stat.h> + ]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat + mknod mknodat stat utimensat]) +]) # gl_HEADER_SYS_STAT_H + +AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_SYS_STAT_H_DEFAULTS], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR + GNULIB_FCHMODAT=0; AC_SUBST([GNULIB_FCHMODAT]) + GNULIB_FSTAT=0; AC_SUBST([GNULIB_FSTAT]) + GNULIB_FSTATAT=0; AC_SUBST([GNULIB_FSTATAT]) + GNULIB_FUTIMENS=0; AC_SUBST([GNULIB_FUTIMENS]) + GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD]) + GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT]) + GNULIB_MKDIRAT=0; AC_SUBST([GNULIB_MKDIRAT]) + GNULIB_MKFIFO=0; AC_SUBST([GNULIB_MKFIFO]) + GNULIB_MKFIFOAT=0; AC_SUBST([GNULIB_MKFIFOAT]) + GNULIB_MKNOD=0; AC_SUBST([GNULIB_MKNOD]) + GNULIB_MKNODAT=0; AC_SUBST([GNULIB_MKNODAT]) + GNULIB_STAT=0; AC_SUBST([GNULIB_STAT]) + GNULIB_UTIMENSAT=0; AC_SUBST([GNULIB_UTIMENSAT]) + GNULIB_OVERRIDES_STRUCT_STAT=0; AC_SUBST([GNULIB_OVERRIDES_STRUCT_STAT]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT]) + HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT]) + HAVE_FUTIMENS=1; AC_SUBST([HAVE_FUTIMENS]) + HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD]) + HAVE_LSTAT=1; AC_SUBST([HAVE_LSTAT]) + HAVE_MKDIRAT=1; AC_SUBST([HAVE_MKDIRAT]) + HAVE_MKFIFO=1; AC_SUBST([HAVE_MKFIFO]) + HAVE_MKFIFOAT=1; AC_SUBST([HAVE_MKFIFOAT]) + HAVE_MKNOD=1; AC_SUBST([HAVE_MKNOD]) + HAVE_MKNODAT=1; AC_SUBST([HAVE_MKNODAT]) + HAVE_UTIMENSAT=1; AC_SUBST([HAVE_UTIMENSAT]) + REPLACE_FSTAT=0; AC_SUBST([REPLACE_FSTAT]) + REPLACE_FSTATAT=0; AC_SUBST([REPLACE_FSTATAT]) + REPLACE_FUTIMENS=0; AC_SUBST([REPLACE_FUTIMENS]) + REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT]) + REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR]) + REPLACE_MKFIFO=0; AC_SUBST([REPLACE_MKFIFO]) + REPLACE_MKNOD=0; AC_SUBST([REPLACE_MKNOD]) + REPLACE_STAT=0; AC_SUBST([REPLACE_STAT]) + REPLACE_UTIMENSAT=0; AC_SUBST([REPLACE_UTIMENSAT]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/sys_time_h.m4 b/local/recipes/tools/diffutils/source/m4/sys_time_h.m4 new file mode 100644 index 0000000000..1c8c3cfcc3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/sys_time_h.m4 @@ -0,0 +1,110 @@ +# Configure a replacement for <sys/time.h>. +# serial 9 + +# Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Written by Paul Eggert and Martin Lambers. + +AC_DEFUN([gl_HEADER_SYS_TIME_H], +[ + dnl Use AC_REQUIRE here, so that the REPLACE_GETTIMEOFDAY=0 statement + dnl below is expanded once only, before all REPLACE_GETTIMEOFDAY=1 + dnl statements that occur in other macros. + AC_REQUIRE([gl_HEADER_SYS_TIME_H_BODY]) +]) + +AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY], +[ + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) + AC_CHECK_HEADERS_ONCE([sys/time.h]) + gl_CHECK_NEXT_HEADERS([sys/time.h]) + + if test $ac_cv_header_sys_time_h != yes; then + HAVE_SYS_TIME_H=0 + fi + + dnl On native Windows with MSVC, 'struct timeval' is defined in <winsock2.h> + dnl only. So include that header in the list. + gl_PREREQ_SYS_H_WINSOCK2 + AC_CACHE_CHECK([for struct timeval], [gl_cv_sys_struct_timeval], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#if HAVE_SYS_TIME_H + #include <sys/time.h> + #endif + #include <time.h> + #if HAVE_WINSOCK2_H + # include <winsock2.h> + #endif + ]], + [[static struct timeval x; x.tv_sec = x.tv_usec;]])], + [gl_cv_sys_struct_timeval=yes], + [gl_cv_sys_struct_timeval=no]) + ]) + if test $gl_cv_sys_struct_timeval != yes; then + HAVE_STRUCT_TIMEVAL=0 + else + dnl On native Windows with a 64-bit 'time_t', 'struct timeval' is defined + dnl (in <sys/time.h> and <winsock2.h> for mingw64, in <winsock2.h> only + dnl for MSVC) with a tv_sec field of type 'long' (32-bit!), which is + dnl smaller than the 'time_t' type mandated by POSIX. + dnl On OpenBSD 5.1 amd64, tv_sec is 64 bits and time_t 32 bits, but + dnl that is good enough. + AC_CACHE_CHECK([for wide-enough struct timeval.tv_sec member], + [gl_cv_sys_struct_timeval_tv_sec], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#if HAVE_SYS_TIME_H + #include <sys/time.h> + #endif + #include <time.h> + #if HAVE_WINSOCK2_H + # include <winsock2.h> + #endif + ]], + [[static struct timeval x; + typedef int verify_tv_sec_type[ + sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1 + ]; + ]])], + [gl_cv_sys_struct_timeval_tv_sec=yes], + [gl_cv_sys_struct_timeval_tv_sec=no]) + ]) + if test $gl_cv_sys_struct_timeval_tv_sec != yes; then + REPLACE_STRUCT_TIMEVAL=1 + fi + fi + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ +#if HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +#include <time.h> + ]], [gettimeofday]) +]) + +AC_DEFUN([gl_SYS_TIME_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS], +[ + GNULIB_GETTIMEOFDAY=0; AC_SUBST([GNULIB_GETTIMEOFDAY]) + dnl Assume POSIX behavior unless another module says otherwise. + HAVE_GETTIMEOFDAY=1; AC_SUBST([HAVE_GETTIMEOFDAY]) + HAVE_STRUCT_TIMEVAL=1; AC_SUBST([HAVE_STRUCT_TIMEVAL]) + HAVE_SYS_TIME_H=1; AC_SUBST([HAVE_SYS_TIME_H]) + REPLACE_GETTIMEOFDAY=0; AC_SUBST([REPLACE_GETTIMEOFDAY]) + REPLACE_STRUCT_TIMEVAL=0; AC_SUBST([REPLACE_STRUCT_TIMEVAL]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/sys_types_h.m4 b/local/recipes/tools/diffutils/source/m4/sys_types_h.m4 new file mode 100644 index 0000000000..e5906709f6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/sys_types_h.m4 @@ -0,0 +1,57 @@ +# sys_types_h.m4 serial 7 +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN_ONCE([gl_SYS_TYPES_H], +[ + AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS]) + gl_NEXT_HEADERS([sys/types.h]) + + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) + + dnl Ensure the type mode_t gets defined. + AC_REQUIRE([AC_TYPE_MODE_T]) + + dnl Whether to override the 'off_t' type. + AC_REQUIRE([gl_TYPE_OFF_T]) + + dnl Whether to override the 'dev_t' and 'ino_t' types. + m4_ifdef([gl_WINDOWS_STAT_INODES], [ + AC_REQUIRE([gl_WINDOWS_STAT_INODES]) + ], [ + WINDOWS_STAT_INODES=0 + ]) + AC_SUBST([WINDOWS_STAT_INODES]) +]) + +AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS], +[ +]) + +# This works around a buggy version in autoconf <= 2.69. +# See <https://lists.gnu.org/archive/html/autoconf/2016-08/msg00014.html> + +m4_version_prereq([2.70], [], [ + +# This is taken from the following Autoconf patch: +# http://git.sv.gnu.org/cgit/autoconf.git/commit/?id=e17a30e98 + +m4_undefine([AC_HEADER_MAJOR]) +AC_DEFUN([AC_HEADER_MAJOR], +[AC_CHECK_HEADERS_ONCE([sys/types.h]) +AC_CHECK_HEADER([sys/mkdev.h], + [AC_DEFINE([MAJOR_IN_MKDEV], [1], + [Define to 1 if `major', `minor', and `makedev' are declared in + <mkdev.h>.])]) +if test $ac_cv_header_sys_mkdev_h = no; then + AC_CHECK_HEADER([sys/sysmacros.h], + [AC_DEFINE([MAJOR_IN_SYSMACROS], [1], + [Define to 1 if `major', `minor', and `makedev' are declared in + <sysmacros.h>.])]) +fi +]) + +]) diff --git a/local/recipes/tools/diffutils/source/m4/sys_uio_h.m4 b/local/recipes/tools/diffutils/source/m4/sys_uio_h.m4 new file mode 100644 index 0000000000..68ef088483 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/sys_uio_h.m4 @@ -0,0 +1,31 @@ +# sys_uio_h.m4 serial 1 +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_HEADER_SYS_UIO], +[ + AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS]) + dnl <sys/uio.h> is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([sys/uio.h]) + if test $ac_cv_header_sys_uio_h = yes; then + HAVE_SYS_UIO_H=1 + else + HAVE_SYS_UIO_H=0 + fi + AC_SUBST([HAVE_SYS_UIO_H]) +]) + +AC_DEFUN([gl_SYS_UIO_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_SYS_UIO_H_DEFAULTS], +[ +]) diff --git a/local/recipes/tools/diffutils/source/m4/sys_wait_h.m4 b/local/recipes/tools/diffutils/source/m4/sys_wait_h.m4 new file mode 100644 index 0000000000..ed0fe7f1a6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/sys_wait_h.m4 @@ -0,0 +1,36 @@ +# sys_wait_h.m4 serial 6 +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_SYS_WAIT_H], +[ + AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS]) + + dnl <sys/wait.h> is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([sys/wait.h]) + + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include <sys/wait.h>]], + [waitpid]) +]) + +AC_DEFUN([gl_SYS_WAIT_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_SYS_WAIT_H_DEFAULTS], +[ + GNULIB_WAITPID=0; AC_SUBST([GNULIB_WAITPID]) + dnl Assume proper GNU behavior unless another module says otherwise. +]) diff --git a/local/recipes/tools/diffutils/source/m4/tempname.m4 b/local/recipes/tools/diffutils/source/m4/tempname.m4 new file mode 100644 index 0000000000..a59f4c0868 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/tempname.m4 @@ -0,0 +1,19 @@ +#serial 5 + +# Copyright (C) 2006-2007, 2009-2017 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# glibc provides __gen_tempname as a wrapper for mk[ds]temp. Expose +# it as a public API, and provide it on systems that are lacking. +AC_DEFUN([gl_FUNC_GEN_TEMPNAME], +[ + gl_PREREQ_TEMPNAME +]) + +# Prerequisites of lib/tempname.c. +AC_DEFUN([gl_PREREQ_TEMPNAME], +[ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/time_h.m4 b/local/recipes/tools/diffutils/source/m4/time_h.m4 new file mode 100644 index 0000000000..28e22092e1 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/time_h.m4 @@ -0,0 +1,144 @@ +# Configure a more-standard replacement for <time.h>. + +# Copyright (C) 2000-2001, 2003-2007, 2009-2017 Free Software Foundation, Inc. + +# serial 11 + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Written by Paul Eggert and Jim Meyering. + +AC_DEFUN([gl_HEADER_TIME_H], +[ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_HEADER_TIME_H_BODY]) +]) + +AC_DEFUN([gl_HEADER_TIME_H_BODY], +[ + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + gl_NEXT_HEADERS([time.h]) + AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC]) +]) + +dnl Check whether 'struct timespec' is declared +dnl in time.h, sys/time.h, pthread.h, or unistd.h. + +AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC], +[ + AC_CHECK_HEADERS_ONCE([sys/time.h]) + AC_CACHE_CHECK([for struct timespec in <time.h>], + [gl_cv_sys_struct_timespec_in_time_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <time.h> + ]], + [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], + [gl_cv_sys_struct_timespec_in_time_h=yes], + [gl_cv_sys_struct_timespec_in_time_h=no])]) + + TIME_H_DEFINES_STRUCT_TIMESPEC=0 + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 + UNISTD_H_DEFINES_STRUCT_TIMESPEC=0 + if test $gl_cv_sys_struct_timespec_in_time_h = yes; then + TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + AC_CACHE_CHECK([for struct timespec in <sys/time.h>], + [gl_cv_sys_struct_timespec_in_sys_time_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <sys/time.h> + ]], + [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], + [gl_cv_sys_struct_timespec_in_sys_time_h=yes], + [gl_cv_sys_struct_timespec_in_sys_time_h=no])]) + if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + AC_CACHE_CHECK([for struct timespec in <pthread.h>], + [gl_cv_sys_struct_timespec_in_pthread_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <pthread.h> + ]], + [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], + [gl_cv_sys_struct_timespec_in_pthread_h=yes], + [gl_cv_sys_struct_timespec_in_pthread_h=no])]) + if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 + else + AC_CACHE_CHECK([for struct timespec in <unistd.h>], + [gl_cv_sys_struct_timespec_in_unistd_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <unistd.h> + ]], + [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], + [gl_cv_sys_struct_timespec_in_unistd_h=yes], + [gl_cv_sys_struct_timespec_in_unistd_h=no])]) + if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then + UNISTD_H_DEFINES_STRUCT_TIMESPEC=1 + fi + fi + fi + fi + AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC]) + AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC]) + AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC]) + AC_SUBST([UNISTD_H_DEFINES_STRUCT_TIMESPEC]) +]) + +AC_DEFUN([gl_TIME_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], +[ + GNULIB_CTIME=0; AC_SUBST([GNULIB_CTIME]) + GNULIB_MKTIME=0; AC_SUBST([GNULIB_MKTIME]) + GNULIB_LOCALTIME=0; AC_SUBST([GNULIB_LOCALTIME]) + GNULIB_NANOSLEEP=0; AC_SUBST([GNULIB_NANOSLEEP]) + GNULIB_STRFTIME=0; AC_SUBST([GNULIB_STRFTIME]) + GNULIB_STRPTIME=0; AC_SUBST([GNULIB_STRPTIME]) + GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM]) + GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R]) + GNULIB_TIME_RZ=0; AC_SUBST([GNULIB_TIME_RZ]) + GNULIB_TZSET=0; AC_SUBST([GNULIB_TZSET]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R]) + HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP]) + HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME]) + HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM]) + HAVE_TZSET=1; AC_SUBST([HAVE_TZSET]) + dnl Even GNU libc does not have timezone_t yet. + HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T]) + dnl If another module says to replace or to not replace, do that. + dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK; + dnl this lets maintainers check for portability. + REPLACE_CTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_CTIME]) + REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R]) + REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME]) + REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP]) + REPLACE_STRFTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRFTIME]) + REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM]) + REPLACE_TZSET=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TZSET]) + + dnl Hack so that the time module doesn't depend on the sys_time module. + dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent. + : ${GNULIB_GETTIMEOFDAY=0}; AC_SUBST([GNULIB_GETTIMEOFDAY]) + dnl Second, it's OK to not use GNULIB_PORTCHECK for REPLACE_GMTIME + dnl and REPLACE_LOCALTIME, as portability to Solaris 2.6 and earlier + dnl is no longer a big deal. + REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME]) + REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/time_r.m4 b/local/recipes/tools/diffutils/source/m4/time_r.m4 new file mode 100644 index 0000000000..3e24ccb2e0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/time_r.m4 @@ -0,0 +1,58 @@ +dnl Reentrant time functions: localtime_r, gmtime_r. + +dnl Copyright (C) 2003, 2006-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Paul Eggert. + +AC_DEFUN([gl_TIME_R], +[ + dnl Persuade glibc and Solaris <time.h> to declare localtime_r. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([AC_C_RESTRICT]) + + dnl Some systems don't declare localtime_r() and gmtime_r() if _REENTRANT is + dnl not defined. + AC_CHECK_DECLS([localtime_r], [], [], [[#include <time.h>]]) + if test $ac_cv_have_decl_localtime_r = no; then + HAVE_DECL_LOCALTIME_R=0 + fi + + AC_CHECK_FUNCS_ONCE([localtime_r]) + if test $ac_cv_func_localtime_r = yes; then + HAVE_LOCALTIME_R=1 + AC_CACHE_CHECK([whether localtime_r is compatible with its POSIX signature], + [gl_cv_time_r_posix], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <time.h>]], + [[/* We don't need to append 'restrict's to the argument types, + even though the POSIX signature has the 'restrict's, + since C99 says they can't affect type compatibility. */ + struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r; + if (ptr) return 0; + /* Check the return type is a pointer. + On HP-UX 10 it is 'int'. */ + *localtime_r (0, 0);]]) + ], + [gl_cv_time_r_posix=yes], + [gl_cv_time_r_posix=no]) + ]) + if test $gl_cv_time_r_posix = yes; then + REPLACE_LOCALTIME_R=0 + else + REPLACE_LOCALTIME_R=1 + fi + else + HAVE_LOCALTIME_R=0 + fi +]) + +# Prerequisites of lib/time_r.c. +AC_DEFUN([gl_PREREQ_TIME_R], [ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/time_rz.m4 b/local/recipes/tools/diffutils/source/m4/time_rz.m4 new file mode 100644 index 0000000000..3991118b61 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/time_rz.m4 @@ -0,0 +1,20 @@ +dnl Time zone functions: tzalloc, localtime_rz, etc. + +dnl Copyright (C) 2015-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Paul Eggert. + +AC_DEFUN([gl_TIME_RZ], +[ + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([AC_STRUCT_TIMEZONE]) + + AC_CHECK_TYPES([timezone_t], [], [], [[#include <time.h>]]) + if test "$ac_cv_type_timezone_t" = yes; then + HAVE_TIMEZONE_T=1 + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/timegm.m4 b/local/recipes/tools/diffutils/source/m4/timegm.m4 new file mode 100644 index 0000000000..1f18552e9f --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/timegm.m4 @@ -0,0 +1,26 @@ +# timegm.m4 serial 12 +dnl Copyright (C) 2003, 2007, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_TIMEGM], +[ + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([gl_FUNC_MKTIME_WORKS]) + REPLACE_TIMEGM=0 + AC_CHECK_FUNCS_ONCE([timegm]) + if test $ac_cv_func_timegm = yes; then + if test "$gl_cv_func_working_mktime" != yes; then + # Assume that timegm is buggy if mktime is. + REPLACE_TIMEGM=1 + fi + else + HAVE_TIMEGM=0 + fi +]) + +# Prerequisites of lib/timegm.c. +AC_DEFUN([gl_PREREQ_TIMEGM], [ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/timespec.m4 b/local/recipes/tools/diffutils/source/m4/timespec.m4 new file mode 100644 index 0000000000..c901468ed8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/timespec.m4 @@ -0,0 +1,11 @@ +#serial 15 + +# Copyright (C) 2000-2001, 2003-2007, 2009-2017 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +dnl From Jim Meyering + +AC_DEFUN([gl_TIMESPEC], [:]) diff --git a/local/recipes/tools/diffutils/source/m4/tm_gmtoff.m4 b/local/recipes/tools/diffutils/source/m4/tm_gmtoff.m4 new file mode 100644 index 0000000000..32db008d94 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/tm_gmtoff.m4 @@ -0,0 +1,14 @@ +# tm_gmtoff.m4 serial 3 +dnl Copyright (C) 2002, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_TM_GMTOFF], +[ + AC_CHECK_MEMBER([struct tm.tm_gmtoff], + [AC_DEFINE([HAVE_TM_GMTOFF], [1], + [Define if struct tm has the tm_gmtoff member.])], + , + [#include <time.h>]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/tzset.m4 b/local/recipes/tools/diffutils/source/m4/tzset.m4 new file mode 100644 index 0000000000..08362fea73 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/tzset.m4 @@ -0,0 +1,81 @@ +# serial 8 + +# Copyright (C) 2003, 2007, 2009-2017 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# See if we have a working tzset function. +# If so, arrange to compile the wrapper function. +# For at least Solaris 2.5.1 and 2.6, this is necessary +# because tzset can clobber the contents of the buffer +# used by localtime. + +# Written by Paul Eggert and Jim Meyering. + +AC_DEFUN([gl_FUNC_TZSET], +[ + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_FUNCS_ONCE([tzset]) + if test $ac_cv_func_tzset = no; then + HAVE_TZSET=0 + fi + gl_FUNC_TZSET_CLOBBER + REPLACE_TZSET=0 + case "$gl_cv_func_tzset_clobber" in + *yes) + REPLACE_TZSET=1 + AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1], + [Define if tzset clobbers localtime's static buffer.]) + gl_LOCALTIME_BUFFER_NEEDED + ;; + esac + case "$host_os" in + mingw*) REPLACE_TZSET=1 ;; + esac +]) + +# Set gl_cv_func_tzset_clobber. +AC_DEFUN([gl_FUNC_TZSET_CLOBBER], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether tzset clobbers localtime buffer], + gl_cv_func_tzset_clobber, + [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include <time.h> +#include <stdlib.h> + +int +main () +{ + time_t t1 = 853958121; + struct tm *p, s; + putenv ("TZ=GMT0"); + p = localtime (&t1); + s = *p; + putenv ("TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"); + tzset (); + return (p->tm_year != s.tm_year + || p->tm_mon != s.tm_mon + || p->tm_mday != s.tm_mday + || p->tm_hour != s.tm_hour + || p->tm_min != s.tm_min + || p->tm_sec != s.tm_sec); +} + ]])], + [gl_cv_func_tzset_clobber=no], + [gl_cv_func_tzset_clobber=yes], + [case "$host_os" in + # Guess all is fine on glibc systems. + *-gnu*) gl_cv_func_tzset_clobber="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_tzset_clobber="guessing yes" ;; + esac + ])]) + + AC_DEFINE([HAVE_RUN_TZSET_TEST], [1], + [Define to 1 if you have run the test for working tzset.]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/unistd_h.m4 b/local/recipes/tools/diffutils/source/m4/unistd_h.m4 new file mode 100644 index 0000000000..cc44677d9e --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/unistd_h.m4 @@ -0,0 +1,193 @@ +# unistd_h.m4 serial 70 +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Simon Josefsson, Bruno Haible. + +AC_DEFUN([gl_UNISTD_H], +[ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + + gl_CHECK_NEXT_HEADERS([unistd.h]) + if test $ac_cv_header_unistd_h = yes; then + HAVE_UNISTD_H=1 + else + HAVE_UNISTD_H=0 + fi + AC_SUBST([HAVE_UNISTD_H]) + + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) + + dnl Determine WINDOWS_64_BIT_OFF_T. + AC_REQUIRE([gl_TYPE_OFF_T]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +/* Some systems declare various items in the wrong headers. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <fcntl.h> +# include <stdio.h> +# include <stdlib.h> +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include <io.h> +# endif +#endif + ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat + fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups + gethostname getlogin getlogin_r getpagesize + getusershell setusershell endusershell + group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite + readlink readlinkat rmdir sethostname sleep symlink symlinkat + truncate ttyname_r unlink unlinkat usleep]) +]) + +AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_UNISTD_H_DEFAULTS], +[ + GNULIB_CHDIR=0; AC_SUBST([GNULIB_CHDIR]) + GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) + GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) + GNULIB_DUP=0; AC_SUBST([GNULIB_DUP]) + GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) + GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3]) + GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) + GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) + GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT]) + GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) + GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT]) + GNULIB_FDATASYNC=0; AC_SUBST([GNULIB_FDATASYNC]) + GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) + GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) + GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) + GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME]) + GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE]) + GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS]) + GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME]) + GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN]) + GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) + GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) + GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) + GNULIB_GROUP_MEMBER=0; AC_SUBST([GNULIB_GROUP_MEMBER]) + GNULIB_ISATTY=0; AC_SUBST([GNULIB_ISATTY]) + GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) + GNULIB_LINK=0; AC_SUBST([GNULIB_LINK]) + GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT]) + GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) + GNULIB_PIPE=0; AC_SUBST([GNULIB_PIPE]) + GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2]) + GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD]) + GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE]) + GNULIB_READ=0; AC_SUBST([GNULIB_READ]) + GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) + GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT]) + GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR]) + GNULIB_SETHOSTNAME=0; AC_SUBST([GNULIB_SETHOSTNAME]) + GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) + GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK]) + GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT]) + GNULIB_TRUNCATE=0; AC_SUBST([GNULIB_TRUNCATE]) + GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R]) + GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING]) + GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) + GNULIB_UNLINK=0; AC_SUBST([GNULIB_UNLINK]) + GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT]) + GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP]) + GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN]) + HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) + HAVE_DUP3=1; AC_SUBST([HAVE_DUP3]) + HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS]) + HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT]) + HAVE_FCHDIR=1; AC_SUBST([HAVE_FCHDIR]) + HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT]) + HAVE_FDATASYNC=1; AC_SUBST([HAVE_FDATASYNC]) + HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) + HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) + HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE]) + HAVE_GETGROUPS=1; AC_SUBST([HAVE_GETGROUPS]) + HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) + HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN]) + HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) + HAVE_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER]) + HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN]) + HAVE_LINK=1; AC_SUBST([HAVE_LINK]) + HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT]) + HAVE_PIPE=1; AC_SUBST([HAVE_PIPE]) + HAVE_PIPE2=1; AC_SUBST([HAVE_PIPE2]) + HAVE_PREAD=1; AC_SUBST([HAVE_PREAD]) + HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE]) + HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) + HAVE_READLINKAT=1; AC_SUBST([HAVE_READLINKAT]) + HAVE_SETHOSTNAME=1; AC_SUBST([HAVE_SETHOSTNAME]) + HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) + HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK]) + HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT]) + HAVE_TRUNCATE=1; AC_SUBST([HAVE_TRUNCATE]) + HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT]) + HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP]) + HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) + HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR]) + HAVE_DECL_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC]) + HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME]) + HAVE_DECL_GETLOGIN=1; AC_SUBST([HAVE_DECL_GETLOGIN]) + HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) + HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE]) + HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL]) + HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME]) + HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R]) + HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) + HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) + REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) + REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE]) + REPLACE_DUP=0; AC_SUBST([REPLACE_DUP]) + REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2]) + REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT]) + REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE]) + REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) + REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME]) + REPLACE_GETDTABLESIZE=0; AC_SUBST([REPLACE_GETDTABLESIZE]) + REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R]) + REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS]) + REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE]) + REPLACE_ISATTY=0; AC_SUBST([REPLACE_ISATTY]) + REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN]) + REPLACE_LINK=0; AC_SUBST([REPLACE_LINK]) + REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT]) + REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) + REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD]) + REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE]) + REPLACE_READ=0; AC_SUBST([REPLACE_READ]) + REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK]) + REPLACE_READLINKAT=0; AC_SUBST([REPLACE_READLINKAT]) + REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR]) + REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP]) + REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK]) + REPLACE_SYMLINKAT=0; AC_SUBST([REPLACE_SYMLINKAT]) + REPLACE_TRUNCATE=0; AC_SUBST([REPLACE_TRUNCATE]) + REPLACE_TTYNAME_R=0; AC_SUBST([REPLACE_TTYNAME_R]) + REPLACE_UNLINK=0; AC_SUBST([REPLACE_UNLINK]) + REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT]) + REPLACE_USLEEP=0; AC_SUBST([REPLACE_USLEEP]) + REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE]) + UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H]) + UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; + AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/unlocked-io.m4 b/local/recipes/tools/diffutils/source/m4/unlocked-io.m4 new file mode 100644 index 0000000000..448ccac2f0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/unlocked-io.m4 @@ -0,0 +1,41 @@ +# unlocked-io.m4 serial 15 + +# Copyright (C) 1998-2006, 2009-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +dnl From Jim Meyering. +dnl +dnl See if the glibc *_unlocked I/O macros or functions are available. +dnl Use only those *_unlocked macros or functions that are declared +dnl (because some of them were declared in Solaris 2.5.1 but were removed +dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run +dnl on Solaris 2.6). + +AC_DEFUN([gl_FUNC_GLIBC_UNLOCKED_IO], +[ + AC_DEFINE([USE_UNLOCKED_IO], [1], + [Define to 1 if you want getc etc. to use unlocked I/O if available. + Unlocked I/O can improve performance in unithreaded apps, + but it is not safe for multithreaded apps.]) + + dnl Persuade glibc and Solaris <stdio.h> to declare + dnl fgets_unlocked(), fputs_unlocked() etc. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_CHECK_DECLS_ONCE([clearerr_unlocked]) + AC_CHECK_DECLS_ONCE([feof_unlocked]) + AC_CHECK_DECLS_ONCE([ferror_unlocked]) + AC_CHECK_DECLS_ONCE([fflush_unlocked]) + AC_CHECK_DECLS_ONCE([fgets_unlocked]) + AC_CHECK_DECLS_ONCE([fputc_unlocked]) + AC_CHECK_DECLS_ONCE([fputs_unlocked]) + AC_CHECK_DECLS_ONCE([fread_unlocked]) + AC_CHECK_DECLS_ONCE([fwrite_unlocked]) + AC_CHECK_DECLS_ONCE([getc_unlocked]) + AC_CHECK_DECLS_ONCE([getchar_unlocked]) + AC_CHECK_DECLS_ONCE([putc_unlocked]) + AC_CHECK_DECLS_ONCE([putchar_unlocked]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/vararrays.m4 b/local/recipes/tools/diffutils/source/m4/vararrays.m4 new file mode 100644 index 0000000000..8391121ad3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/vararrays.m4 @@ -0,0 +1,68 @@ +# Check for variable-length arrays. + +# serial 5 + +# From Paul Eggert + +# Copyright (C) 2001, 2009-2017 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This is a copy of AC_C_VARARRAYS from a recent development version +# of Autoconf. It replaces Autoconf's version, or for pre-2.61 autoconf +# it defines the macro that Autoconf lacks. +AC_DEFUN([AC_C_VARARRAYS], +[ + AC_CACHE_CHECK([for variable-length arrays], + ac_cv_c_vararrays, + [AC_EGREP_CPP([defined], + [#ifdef __STDC_NO_VLA__ + defined + #endif + ], + [ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined'], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[/* Test for VLA support. This test is partly inspired + from examples in the C standard. Use at least two VLA + functions to detect the GCC 3.4.3 bug described in: + http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html + */ + #ifdef __STDC_NO_VLA__ + syntax error; + #else + extern int n; + int B[100]; + int fvla (int m, int C[m][m]); + + int + simple (int count, int all[static count]) + { + return all[count - 1]; + } + + int + fvla (int m, int C[m][m]) + { + typedef int VLA[m][m]; + VLA x; + int D[m]; + static int (*q)[m] = &B; + int (*s)[n] = q; + return C && &x[0][0] == &D[0] && &D[0] == s[0]; + } + #endif + ]])], + [ac_cv_c_vararrays=yes], + [ac_cv_c_vararrays=no])])]) + if test "$ac_cv_c_vararrays" = yes; then + dnl This is for compatibility with Autoconf 2.61-2.69. + AC_DEFINE([HAVE_C_VARARRAYS], 1, + [Define to 1 if C supports variable-length arrays.]) + elif test "$ac_cv_c_vararrays" = no; then + AC_DEFINE([__STDC_NO_VLA__], 1, + [Define to 1 if C does not support variable-length arrays, and + if the compiler does not already define this.]) + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/vasnprintf.m4 b/local/recipes/tools/diffutils/source/m4/vasnprintf.m4 new file mode 100644 index 0000000000..47c5951cb5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/vasnprintf.m4 @@ -0,0 +1,291 @@ +# vasnprintf.m4 serial 36 +dnl Copyright (C) 2002-2004, 2006-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_VASNPRINTF], +[ + AC_CHECK_FUNCS_ONCE([vasnprintf]) + if test $ac_cv_func_vasnprintf = no; then + gl_REPLACE_VASNPRINTF + fi +]) + +AC_DEFUN([gl_REPLACE_VASNPRINTF], +[ + AC_CHECK_FUNCS_ONCE([vasnprintf]) + AC_LIBOBJ([vasnprintf]) + AC_LIBOBJ([printf-args]) + AC_LIBOBJ([printf-parse]) + AC_LIBOBJ([asnprintf]) + if test $ac_cv_func_vasnprintf = yes; then + AC_DEFINE([REPLACE_VASNPRINTF], [1], + [Define if vasnprintf exists but is overridden by gnulib.]) + fi + gl_PREREQ_PRINTF_ARGS + gl_PREREQ_PRINTF_PARSE + gl_PREREQ_VASNPRINTF + gl_PREREQ_ASNPRINTF +]) + +# Prerequisites of lib/printf-args.h, lib/printf-args.c. +AC_DEFUN([gl_PREREQ_PRINTF_ARGS], +[ + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + AC_REQUIRE([gt_TYPE_WCHAR_T]) + AC_REQUIRE([gt_TYPE_WINT_T]) +]) + +# Prerequisites of lib/printf-parse.h, lib/printf-parse.c. +AC_DEFUN([gl_PREREQ_PRINTF_PARSE], +[ + AC_REQUIRE([gl_FEATURES_H]) + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + AC_REQUIRE([gt_TYPE_WCHAR_T]) + AC_REQUIRE([gt_TYPE_WINT_T]) + AC_REQUIRE([AC_TYPE_SIZE_T]) + AC_CHECK_TYPE([ptrdiff_t], , + [AC_DEFINE([ptrdiff_t], [long], + [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) + ]) + AC_REQUIRE([gt_AC_TYPE_INTMAX_T]) +]) + +# Prerequisites of lib/vasnprintf.c. +AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF], +[ + AC_REQUIRE([AC_FUNC_ALLOCA]) + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + AC_REQUIRE([gt_TYPE_WCHAR_T]) + AC_REQUIRE([gt_TYPE_WINT_T]) + AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb]) + dnl Use the _snprintf function only if it is declared (because on NetBSD it + dnl is defined as a weak alias of snprintf; we prefer to use the latter). + AC_CHECK_DECLS([_snprintf], , , [[#include <stdio.h>]]) + dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization + dnl in the code for NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE. + AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION]) + dnl We can avoid a lot of code by assuming that snprintf's return value + dnl conforms to ISO C99. So check that. + AC_REQUIRE([gl_SNPRINTF_RETVAL_C99]) + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + AC_DEFINE([HAVE_SNPRINTF_RETVAL_C99], [1], + [Define if the return value of the snprintf function is the number of + of bytes (excluding the terminating NUL) that would have been produced + if the buffer had been large enough.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting 'long double' +# arguments. +AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE], +[ + AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) + case "$gl_cv_func_printf_long_double" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + 'long double' arguments.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'double' +# arguments. +AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE], +[ + AC_REQUIRE([gl_PRINTF_INFINITE]) + case "$gl_cv_func_printf_infinite" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + infinite 'double' arguments.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'long double' +# arguments. +AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE], +[ + AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE]) + dnl There is no need to set NEED_PRINTF_INFINITE_LONG_DOUBLE if + dnl NEED_PRINTF_LONG_DOUBLE is already set. + AC_REQUIRE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE]) + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + infinite 'long double' arguments.]) + ;; + esac + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting the 'a' directive. +AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A], +[ + AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) + case "$gl_cv_func_printf_directive_a" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], [1], + [Define if the vasnprintf implementation needs special code for + the 'a' and 'A' directives.]) + AC_CHECK_FUNCS([nl_langinfo]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting the 'F' directive. +AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F], +[ + AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) + case "$gl_cv_func_printf_directive_f" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], [1], + [Define if the vasnprintf implementation needs special code for + the 'F' directive.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting the 'ls' directive. +AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_LS], +[ + AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) + case "$gl_cv_func_printf_directive_ls" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_DIRECTIVE_LS], [1], + [Define if the vasnprintf implementation needs special code for + the 'ls' directive.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting the ' flag. +AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING], +[ + AC_REQUIRE([gl_PRINTF_FLAG_GROUPING]) + case "$gl_cv_func_printf_flag_grouping" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], [1], + [Define if the vasnprintf implementation needs special code for the + ' flag.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting the '-' flag. +AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST], +[ + AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST]) + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], [1], + [Define if the vasnprintf implementation needs special code for the + '-' flag.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting the 0 flag. +AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO], +[ + AC_REQUIRE([gl_PRINTF_FLAG_ZERO]) + case "$gl_cv_func_printf_flag_zero" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_FLAG_ZERO], [1], + [Define if the vasnprintf implementation needs special code for the + 0 flag.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting large precisions. +AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION], +[ + AC_REQUIRE([gl_PRINTF_PRECISION]) + case "$gl_cv_func_printf_precision" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], [1], + [Define if the vasnprintf implementation needs special code for + supporting large precisions without arbitrary bounds.]) + AC_DEFINE([NEED_PRINTF_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + 'double' arguments.]) + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + 'long double' arguments.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for surviving out-of-memory +# conditions. +AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM], +[ + AC_REQUIRE([gl_PRINTF_ENOMEM]) + case "$gl_cv_func_printf_enomem" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_ENOMEM], [1], + [Define if the vasnprintf implementation needs special code for + surviving out-of-memory conditions.]) + AC_DEFINE([NEED_PRINTF_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + 'double' arguments.]) + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + 'long double' arguments.]) + ;; + esac +]) + +# Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance. +AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS], +[ + AC_REQUIRE([gl_PREREQ_VASNPRINTF]) + gl_PREREQ_VASNPRINTF_LONG_DOUBLE + gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE + gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE + gl_PREREQ_VASNPRINTF_DIRECTIVE_A + gl_PREREQ_VASNPRINTF_DIRECTIVE_F + gl_PREREQ_VASNPRINTF_DIRECTIVE_LS + gl_PREREQ_VASNPRINTF_FLAG_GROUPING + gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST + gl_PREREQ_VASNPRINTF_FLAG_ZERO + gl_PREREQ_VASNPRINTF_PRECISION + gl_PREREQ_VASNPRINTF_ENOMEM +]) + +# Prerequisites of lib/asnprintf.c. +AC_DEFUN([gl_PREREQ_ASNPRINTF], +[ +]) diff --git a/local/recipes/tools/diffutils/source/m4/vasprintf.m4 b/local/recipes/tools/diffutils/source/m4/vasprintf.m4 new file mode 100644 index 0000000000..a75c6f1804 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/vasprintf.m4 @@ -0,0 +1,46 @@ +# vasprintf.m4 serial 6 +dnl Copyright (C) 2002-2003, 2006-2007, 2009-2017 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_VASPRINTF], +[ + AC_CHECK_FUNCS([vasprintf]) + if test $ac_cv_func_vasprintf = no; then + gl_REPLACE_VASPRINTF + fi +]) + +AC_DEFUN([gl_REPLACE_VASPRINTF], +[ + AC_LIBOBJ([vasprintf]) + AC_LIBOBJ([asprintf]) + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + if test $ac_cv_func_vasprintf = yes; then + REPLACE_VASPRINTF=1 + else + HAVE_VASPRINTF=0 + fi + gl_PREREQ_VASPRINTF_H + gl_PREREQ_VASPRINTF + gl_PREREQ_ASPRINTF +]) + +# Prerequisites of the vasprintf portion of lib/stdio.h. +AC_DEFUN([gl_PREREQ_VASPRINTF_H], +[ + dnl Persuade glibc <stdio.h> to declare asprintf() and vasprintf(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) +]) + +# Prerequisites of lib/vasprintf.c. +AC_DEFUN([gl_PREREQ_VASPRINTF], +[ +]) + +# Prerequisites of lib/asprintf.c. +AC_DEFUN([gl_PREREQ_ASPRINTF], +[ +]) diff --git a/local/recipes/tools/diffutils/source/m4/version-etc.m4 b/local/recipes/tools/diffutils/source/m4/version-etc.m4 new file mode 100644 index 0000000000..c099101fcd --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/version-etc.m4 @@ -0,0 +1,33 @@ +# version-etc.m4 serial 1 +# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +dnl $1 - configure flag and define name +dnl $2 - human readable description +m4_define([gl_VERSION_ETC_FLAG], +[dnl + AC_ARG_WITH([$1], [AS_HELP_STRING([--with-$1], [$2])], + [dnl + case $withval in + yes|no) ;; + *) AC_DEFINE_UNQUOTED(AS_TR_CPP([PACKAGE_$1]), ["$withval"], [$2]) ;; + esac + ]) +]) + +AC_DEFUN([gl_VERSION_ETC], +[dnl + gl_VERSION_ETC_FLAG([packager], + [String identifying the packager of this software]) + gl_VERSION_ETC_FLAG([packager-version], + [Packager-specific version information]) + gl_VERSION_ETC_FLAG([packager-bug-reports], + [Packager info for bug reports (URL/e-mail/...)]) + if test "X$with_packager" = "X" && \ + test "X$with_packager_version$with_packager_bug_reports" != "X" + then + AC_MSG_ERROR([The --with-packager-{bug-reports,version} options require --with-packager]) + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/warn-on-use.m4 b/local/recipes/tools/diffutils/source/m4/warn-on-use.m4 new file mode 100644 index 0000000000..25ce737898 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/warn-on-use.m4 @@ -0,0 +1,47 @@ +# warn-on-use.m4 serial 5 +dnl Copyright (C) 2010-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# gl_WARN_ON_USE_PREPARE(INCLUDES, NAMES) +# --------------------------------------- +# For each whitespace-separated element in the list of NAMES, define +# HAVE_RAW_DECL_name if the function has a declaration among INCLUDES +# even after being undefined as a macro. +# +# See warn-on-use.h for some hints on how to poison function names, as +# well as ideas on poisoning global variables and macros. NAMES may +# include global variables, but remember that only functions work with +# _GL_WARN_ON_USE. Typically, INCLUDES only needs to list a single +# header, but if the replacement header pulls in other headers because +# some systems declare functions in the wrong header, then INCLUDES +# should do likewise. +# +# It is generally safe to assume declarations for functions declared +# in the intersection of C89 and C11 (such as printf) without +# needing gl_WARN_ON_USE_PREPARE. +AC_DEFUN([gl_WARN_ON_USE_PREPARE], +[ + m4_foreach_w([gl_decl], [$2], + [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])), + [Define to 1 if ]m4_defn([gl_decl])[ is declared even after + undefining macros.])])dnl +dnl FIXME: gl_Symbol must be used unquoted until we can assume +dnl autoconf 2.64 or newer. + for gl_func in m4_flatten([$2]); do + AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl + AC_CACHE_CHECK([whether $gl_func is declared without a macro], + gl_Symbol, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1], +[@%:@undef $gl_func + (void) $gl_func;])], + [AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])]) + AS_VAR_IF(gl_Symbol, [yes], + [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1]) + dnl shortcut - if the raw declaration exists, then set a cache + dnl variable to allow skipping any later AC_CHECK_DECL efforts + eval ac_cv_have_decl_$gl_func=yes]) + AS_VAR_POPDEF([gl_Symbol])dnl + done +]) diff --git a/local/recipes/tools/diffutils/source/m4/warnings.m4 b/local/recipes/tools/diffutils/source/m4/warnings.m4 new file mode 100644 index 0000000000..e697174edd --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/warnings.m4 @@ -0,0 +1,79 @@ +# warnings.m4 serial 11 +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Simon Josefsson + +# gl_AS_VAR_APPEND(VAR, VALUE) +# ---------------------------- +# Provide the functionality of AS_VAR_APPEND if Autoconf does not have it. +m4_ifdef([AS_VAR_APPEND], +[m4_copy([AS_VAR_APPEND], [gl_AS_VAR_APPEND])], +[m4_define([gl_AS_VAR_APPEND], +[AS_VAR_SET([$1], [AS_VAR_GET([$1])$2])])]) + + +# gl_COMPILER_OPTION_IF(OPTION, [IF-SUPPORTED], [IF-NOT-SUPPORTED], +# [PROGRAM = AC_LANG_PROGRAM()]) +# ----------------------------------------------------------------- +# Check if the compiler supports OPTION when compiling PROGRAM. +# +# FIXME: gl_Warn must be used unquoted until we can assume Autoconf +# 2.64 or newer. +AC_DEFUN([gl_COMPILER_OPTION_IF], +[AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl +AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl +AS_LITERAL_IF([$1], + [m4_pushdef([gl_Positive], m4_bpatsubst([$1], [^-Wno-], [-W]))], + [gl_positive="$1" +case $gl_positive in + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; +esac +m4_pushdef([gl_Positive], [$gl_positive])])dnl +AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [ + gl_save_compiler_FLAGS="$gl_Flags" + gl_AS_VAR_APPEND(m4_defn([gl_Flags]), + [" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["]) + AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])], + [AS_VAR_SET(gl_Warn, [yes])], + [AS_VAR_SET(gl_Warn, [no])]) + gl_Flags="$gl_save_compiler_FLAGS" +]) +AS_VAR_IF(gl_Warn, [yes], [$2], [$3]) +m4_popdef([gl_Positive])dnl +AS_VAR_POPDEF([gl_Flags])dnl +AS_VAR_POPDEF([gl_Warn])dnl +]) + +# gl_UNKNOWN_WARNINGS_ARE_ERRORS +# ------------------------------ +# Clang doesn't complain about unknown warning options unless one also +# specifies -Wunknown-warning-option -Werror. Detect this. +AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS], +[gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option], + [gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'], + [gl_unknown_warnings_are_errors=])]) + +# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS], +# [PROGRAM = AC_LANG_PROGRAM()]) +# --------------------------------------------- +# Adds parameter to WARN_CFLAGS if the compiler supports it when +# compiling PROGRAM. For example, gl_WARN_ADD([-Wparentheses]). +# +# If VARIABLE is a variable name, AC_SUBST it. +AC_DEFUN([gl_WARN_ADD], +[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS]) +gl_COMPILER_OPTION_IF([$1], + [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])], + [], + [$3]) +m4_ifval([$2], + [AS_LITERAL_IF([$2], [AC_SUBST([$2])])], + [AC_SUBST([WARN_CFLAGS])])dnl +]) + +# Local Variables: +# mode: autoconf +# End: diff --git a/local/recipes/tools/diffutils/source/m4/wchar_h.m4 b/local/recipes/tools/diffutils/source/m4/wchar_h.m4 new file mode 100644 index 0000000000..1a2734cfed --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/wchar_h.m4 @@ -0,0 +1,238 @@ +dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues. + +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Eric Blake. + +# wchar_h.m4 serial 42 + +AC_DEFUN([gl_WCHAR_H], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + AC_REQUIRE([gl_WCHAR_H_INLINE_OK]) + dnl Prepare for creating substitute <wchar.h>. + dnl Check for <wchar.h> (missing in Linux uClibc when built without wide + dnl character support). + dnl <wchar.h> is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([wchar.h]) + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + AC_SUBST([HAVE_WCHAR_H]) + + AC_REQUIRE([gl_FEATURES_H]) + + AC_REQUIRE([gt_TYPE_WINT_T]) + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + AC_SUBST([HAVE_WINT_T]) + + AC_REQUIRE([gl_TYPE_WINT_T_PREREQ]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <stddef.h> +# include <stdio.h> +# include <time.h> +#endif +#include <wchar.h> + ]], + [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb + wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset + wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp + wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr + wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime + ]) +]) + +dnl Check whether <wchar.h> is usable at all. +AC_DEFUN([gl_WCHAR_H_INLINE_OK], +[ + dnl Test whether <wchar.h> suffers due to the transition from '__inline' to + dnl 'gnu_inline'. See <http://sourceware.org/bugzilla/show_bug.cgi?id=4022> + dnl and <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary, + dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and + dnl the option -std=c99 or -std=gnu99, leads to a broken <wchar.h>. + AC_CACHE_CHECK([whether <wchar.h> uses 'inline' correctly], + [gl_cv_header_wchar_h_correct_inline], + [gl_cv_header_wchar_h_correct_inline=yes + AC_LANG_CONFTEST([ + AC_LANG_SOURCE([[#define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +extern int zero (void); +int main () { return zero(); } +]])]) + dnl Do not rename the object file from conftest.$ac_objext to + dnl conftest1.$ac_objext, as this will cause the link to fail on + dnl z/OS when using the XPLINK object format (due to duplicate + dnl CSECT names). Instead, temporarily redefine $ac_compile so + dnl that the object file has the latter name from the start. + save_ac_compile="$ac_compile" + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` + if AC_TRY_EVAL([ac_compile]); then + AC_LANG_CONFTEST([ + AC_LANG_SOURCE([[#define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int zero (void) { return 0; } +]])]) + dnl See note above about renaming object files. + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` + if AC_TRY_EVAL([ac_compile]); then + if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then + : + else + gl_cv_header_wchar_h_correct_inline=no + fi + fi + fi + ac_compile="$save_ac_compile" + rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext + ]) + if test $gl_cv_header_wchar_h_correct_inline = no; then + AC_MSG_ERROR([<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). +This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in +C99 mode. You have four options: + - Add the flag -fgnu89-inline to CC and reconfigure, or + - Fix your include files, using parts of + <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or + - Use a gcc version older than 4.3, or + - Don't use the flags -std=c99 or -std=gnu99. +Configuration aborted.]) + fi +]) + +AC_DEFUN([gl_WCHAR_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_WCHAR_H_DEFAULTS], +[ + GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC]) + GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB]) + GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT]) + GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC]) + GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN]) + GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS]) + GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS]) + GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB]) + GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS]) + GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS]) + GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH]) + GNULIB_WMEMCHR=0; AC_SUBST([GNULIB_WMEMCHR]) + GNULIB_WMEMCMP=0; AC_SUBST([GNULIB_WMEMCMP]) + GNULIB_WMEMCPY=0; AC_SUBST([GNULIB_WMEMCPY]) + GNULIB_WMEMMOVE=0; AC_SUBST([GNULIB_WMEMMOVE]) + GNULIB_WMEMSET=0; AC_SUBST([GNULIB_WMEMSET]) + GNULIB_WCSLEN=0; AC_SUBST([GNULIB_WCSLEN]) + GNULIB_WCSNLEN=0; AC_SUBST([GNULIB_WCSNLEN]) + GNULIB_WCSCPY=0; AC_SUBST([GNULIB_WCSCPY]) + GNULIB_WCPCPY=0; AC_SUBST([GNULIB_WCPCPY]) + GNULIB_WCSNCPY=0; AC_SUBST([GNULIB_WCSNCPY]) + GNULIB_WCPNCPY=0; AC_SUBST([GNULIB_WCPNCPY]) + GNULIB_WCSCAT=0; AC_SUBST([GNULIB_WCSCAT]) + GNULIB_WCSNCAT=0; AC_SUBST([GNULIB_WCSNCAT]) + GNULIB_WCSCMP=0; AC_SUBST([GNULIB_WCSCMP]) + GNULIB_WCSNCMP=0; AC_SUBST([GNULIB_WCSNCMP]) + GNULIB_WCSCASECMP=0; AC_SUBST([GNULIB_WCSCASECMP]) + GNULIB_WCSNCASECMP=0; AC_SUBST([GNULIB_WCSNCASECMP]) + GNULIB_WCSCOLL=0; AC_SUBST([GNULIB_WCSCOLL]) + GNULIB_WCSXFRM=0; AC_SUBST([GNULIB_WCSXFRM]) + GNULIB_WCSDUP=0; AC_SUBST([GNULIB_WCSDUP]) + GNULIB_WCSCHR=0; AC_SUBST([GNULIB_WCSCHR]) + GNULIB_WCSRCHR=0; AC_SUBST([GNULIB_WCSRCHR]) + GNULIB_WCSCSPN=0; AC_SUBST([GNULIB_WCSCSPN]) + GNULIB_WCSSPN=0; AC_SUBST([GNULIB_WCSSPN]) + GNULIB_WCSPBRK=0; AC_SUBST([GNULIB_WCSPBRK]) + GNULIB_WCSSTR=0; AC_SUBST([GNULIB_WCSSTR]) + GNULIB_WCSTOK=0; AC_SUBST([GNULIB_WCSTOK]) + GNULIB_WCSWIDTH=0; AC_SUBST([GNULIB_WCSWIDTH]) + GNULIB_WCSFTIME=0; AC_SUBST([GNULIB_WCSFTIME]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC]) + HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT]) + HAVE_MBRTOWC=1; AC_SUBST([HAVE_MBRTOWC]) + HAVE_MBRLEN=1; AC_SUBST([HAVE_MBRLEN]) + HAVE_MBSRTOWCS=1; AC_SUBST([HAVE_MBSRTOWCS]) + HAVE_MBSNRTOWCS=1; AC_SUBST([HAVE_MBSNRTOWCS]) + HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB]) + HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS]) + HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS]) + HAVE_WMEMCHR=1; AC_SUBST([HAVE_WMEMCHR]) + HAVE_WMEMCMP=1; AC_SUBST([HAVE_WMEMCMP]) + HAVE_WMEMCPY=1; AC_SUBST([HAVE_WMEMCPY]) + HAVE_WMEMMOVE=1; AC_SUBST([HAVE_WMEMMOVE]) + HAVE_WMEMSET=1; AC_SUBST([HAVE_WMEMSET]) + HAVE_WCSLEN=1; AC_SUBST([HAVE_WCSLEN]) + HAVE_WCSNLEN=1; AC_SUBST([HAVE_WCSNLEN]) + HAVE_WCSCPY=1; AC_SUBST([HAVE_WCSCPY]) + HAVE_WCPCPY=1; AC_SUBST([HAVE_WCPCPY]) + HAVE_WCSNCPY=1; AC_SUBST([HAVE_WCSNCPY]) + HAVE_WCPNCPY=1; AC_SUBST([HAVE_WCPNCPY]) + HAVE_WCSCAT=1; AC_SUBST([HAVE_WCSCAT]) + HAVE_WCSNCAT=1; AC_SUBST([HAVE_WCSNCAT]) + HAVE_WCSCMP=1; AC_SUBST([HAVE_WCSCMP]) + HAVE_WCSNCMP=1; AC_SUBST([HAVE_WCSNCMP]) + HAVE_WCSCASECMP=1; AC_SUBST([HAVE_WCSCASECMP]) + HAVE_WCSNCASECMP=1; AC_SUBST([HAVE_WCSNCASECMP]) + HAVE_WCSCOLL=1; AC_SUBST([HAVE_WCSCOLL]) + HAVE_WCSXFRM=1; AC_SUBST([HAVE_WCSXFRM]) + HAVE_WCSDUP=1; AC_SUBST([HAVE_WCSDUP]) + HAVE_WCSCHR=1; AC_SUBST([HAVE_WCSCHR]) + HAVE_WCSRCHR=1; AC_SUBST([HAVE_WCSRCHR]) + HAVE_WCSCSPN=1; AC_SUBST([HAVE_WCSCSPN]) + HAVE_WCSSPN=1; AC_SUBST([HAVE_WCSSPN]) + HAVE_WCSPBRK=1; AC_SUBST([HAVE_WCSPBRK]) + HAVE_WCSSTR=1; AC_SUBST([HAVE_WCSSTR]) + HAVE_WCSTOK=1; AC_SUBST([HAVE_WCSTOK]) + HAVE_WCSWIDTH=1; AC_SUBST([HAVE_WCSWIDTH]) + HAVE_WCSFTIME=1; AC_SUBST([HAVE_WCSFTIME]) + HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB]) + HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH]) + REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T]) + REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC]) + REPLACE_WCTOB=0; AC_SUBST([REPLACE_WCTOB]) + REPLACE_MBSINIT=0; AC_SUBST([REPLACE_MBSINIT]) + REPLACE_MBRTOWC=0; AC_SUBST([REPLACE_MBRTOWC]) + REPLACE_MBRLEN=0; AC_SUBST([REPLACE_MBRLEN]) + REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS]) + REPLACE_MBSNRTOWCS=0; AC_SUBST([REPLACE_MBSNRTOWCS]) + REPLACE_WCRTOMB=0; AC_SUBST([REPLACE_WCRTOMB]) + REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS]) + REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS]) + REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH]) + REPLACE_WCSWIDTH=0; AC_SUBST([REPLACE_WCSWIDTH]) + REPLACE_WCSFTIME=0; AC_SUBST([REPLACE_WCSFTIME]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/wchar_t.m4 b/local/recipes/tools/diffutils/source/m4/wchar_t.m4 new file mode 100644 index 0000000000..11783d299a --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/wchar_t.m4 @@ -0,0 +1,24 @@ +# wchar_t.m4 serial 4 (gettext-0.18.2) +dnl Copyright (C) 2002-2003, 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. +dnl Test whether <stddef.h> has the 'wchar_t' type. +dnl Prerequisite: AC_PROG_CC + +AC_DEFUN([gt_TYPE_WCHAR_T], +[ + AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <stddef.h> + wchar_t foo = (wchar_t)'\0';]], + [[]])], + [gt_cv_c_wchar_t=yes], + [gt_cv_c_wchar_t=no])]) + if test $gt_cv_c_wchar_t = yes; then + AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.]) + fi +]) diff --git a/local/recipes/tools/diffutils/source/m4/wcrtomb.m4 b/local/recipes/tools/diffutils/source/m4/wcrtomb.m4 new file mode 100644 index 0000000000..0aa040df3d --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/wcrtomb.m4 @@ -0,0 +1,112 @@ +# wcrtomb.m4 serial 11 +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_WCRTOMB], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + gl_MBSTATE_T_BROKEN + + AC_CHECK_FUNCS_ONCE([wcrtomb]) + if test $ac_cv_func_wcrtomb = no; then + HAVE_WCRTOMB=0 + AC_CHECK_DECLS([wcrtomb],,, [[ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +]]) + if test $ac_cv_have_decl_wcrtomb = yes; then + dnl On Minix 3.1.8, the system's <wchar.h> declares wcrtomb() although + dnl it does not have the function. Avoid a collision with gnulib's + dnl replacement. + REPLACE_WCRTOMB=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_WCRTOMB=1 + else + dnl On AIX 4.3, OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes + dnl returns 0 instead of 1. + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR]) + AC_REQUIRE([gt_LOCALE_FR_UTF8]) + AC_REQUIRE([gt_LOCALE_JA]) + AC_REQUIRE([gt_LOCALE_ZH_CN]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether wcrtomb return value is correct], + [gl_cv_func_wcrtomb_retval], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on AIX 4, OSF/1 and Solaris. + aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wcrtomb_retval="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + int result = 0; + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 1; + } + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 2; + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 4; + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 8; + } + return result; +}]])], + [gl_cv_func_wcrtomb_retval=yes], + [gl_cv_func_wcrtomb_retval=no], + [:]) + fi + ]) + case "$gl_cv_func_wcrtomb_retval" in + *yes) ;; + *) REPLACE_WCRTOMB=1 ;; + esac + fi + fi +]) + +# Prerequisites of lib/wcrtomb.c. +AC_DEFUN([gl_PREREQ_WCRTOMB], [ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/wctob.m4 b/local/recipes/tools/diffutils/source/m4/wctob.m4 new file mode 100644 index 0000000000..492f4c8d71 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/wctob.m4 @@ -0,0 +1,127 @@ +# wctob.m4 serial 10 +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_WCTOB], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_CHECK_FUNCS_ONCE([wctob]) + if test $ac_cv_func_wctob = no; then + HAVE_WCTOB=0 + HAVE_DECL_WCTOB=0 + else + HAVE_WCTOB=1 + + dnl Solaris 9 has the wctob() function but it does not work. + dnl Cygwin 1.7.2 has the wctob() function but it clobbers caller-owned + dnl registers, see <http://cygwin.com/ml/cygwin/2010-05/msg00015.html>. + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether wctob works], + [gl_cv_func_wctob_works], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on Solaris <= 9 and Cygwin. + solaris2.[1-9] | solaris2.[1-9].* | cygwin*) + gl_cv_func_wctob_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wctob_works="guessing yes" ;; + esac +changequote([,])dnl + case "$host_os" in + cygwin*) + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <locale.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +register long global __asm__ ("%ebx"); + +int main () +{ + setlocale (LC_ALL, "en_US.UTF-8"); + + global = 0x12345678; + if (wctob (0x00FC) != -1) + return 1; + if (global != 0x12345678) + return 2; + return 0; +}]])], + [:], + [gl_cv_func_wctob_works=no], + [:]) + ;; + esac + if test "$gl_cv_func_wctob_works" != no && test $LOCALE_FR != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + wchar_t wc; + + if (mbtowc (&wc, "\374", 1) == 1) + if (wctob (wc) != (unsigned char) '\374') + return 1; + } + return 0; +}]])], + [gl_cv_func_wctob_works=yes], + [gl_cv_func_wctob_works=no], + [:]) + fi + ]) + case "$gl_cv_func_wctob_works" in + *yes) ;; + *) REPLACE_WCTOB=1 ;; + esac + if test $REPLACE_WCTOB = 0; then + + dnl IRIX 6.5 has the wctob() function but does not declare it. + AC_CHECK_DECLS([wctob], [], [], [[ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +]]) + if test $ac_cv_have_decl_wctob != yes; then + HAVE_DECL_WCTOB=0 + fi + fi + fi +]) + +# Prerequisites of lib/wctob.c. +AC_DEFUN([gl_PREREQ_WCTOB], [ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/wctomb.m4 b/local/recipes/tools/diffutils/source/m4/wctomb.m4 new file mode 100644 index 0000000000..dc1860f2dd --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/wctomb.m4 @@ -0,0 +1,19 @@ +# wctomb.m4 serial 2 +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_WCTOMB], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + + if false; then + REPLACE_WCTOMB=1 + fi +]) + +# Prerequisites of lib/wctomb.c. +AC_DEFUN([gl_PREREQ_WCTOMB], [ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/wctype_h.m4 b/local/recipes/tools/diffutils/source/m4/wctype_h.m4 new file mode 100644 index 0000000000..0c8c3053c2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/wctype_h.m4 @@ -0,0 +1,211 @@ +# wctype_h.m4 serial 20 + +dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it. + +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Paul Eggert. + +AC_DEFUN([gl_WCTYPE_H], +[ + AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_FUNCS_ONCE([iswcntrl]) + if test $ac_cv_func_iswcntrl = yes; then + HAVE_ISWCNTRL=1 + else + HAVE_ISWCNTRL=0 + fi + AC_SUBST([HAVE_ISWCNTRL]) + + AC_REQUIRE([gt_TYPE_WINT_T]) + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + AC_SUBST([HAVE_WINT_T]) + + AC_REQUIRE([gl_TYPE_WINT_T_PREREQ]) + + gl_CHECK_NEXT_HEADERS([wctype.h]) + if test $ac_cv_header_wctype_h = yes; then + if test $ac_cv_func_iswcntrl = yes; then + dnl Linux libc5 has an iswprint function that returns 0 for all arguments. + dnl The other functions are likely broken in the same way. + AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ + /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #include <wctype.h> + int main () { return iswprint ('x') == 0; } + ]])], + [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h> + #if __GNU_LIBRARY__ == 1 + Linux libc5 i18n is broken. + #endif]], [])], + [gl_cv_func_iswcntrl_works="guessing yes"], + [gl_cv_func_iswcntrl_works="guessing no"]) + ]) + ]) + fi + HAVE_WCTYPE_H=1 + else + HAVE_WCTYPE_H=0 + fi + AC_SUBST([HAVE_WCTYPE_H]) + + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac + AC_SUBST([REPLACE_ISWCNTRL]) + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + dnl Redefine all of iswcntrl, ..., iswxdigit in <wctype.h>. + : + fi + + if test $REPLACE_ISWCNTRL = 1; then + REPLACE_TOWLOWER=1 + else + AC_CHECK_FUNCS([towlower]) + if test $ac_cv_func_towlower = yes; then + REPLACE_TOWLOWER=0 + else + AC_CHECK_DECLS([towlower],,, + [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #if HAVE_WCTYPE_H + # include <wctype.h> + #endif + ]]) + if test $ac_cv_have_decl_towlower = yes; then + dnl On Minix 3.1.8, the system's <wctype.h> declares towlower() and + dnl towupper() although it does not have the functions. Avoid a + dnl collision with gnulib's replacement. + REPLACE_TOWLOWER=1 + else + REPLACE_TOWLOWER=0 + fi + fi + fi + AC_SUBST([REPLACE_TOWLOWER]) + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then + dnl Redefine towlower, towupper in <wctype.h>. + : + fi + + dnl We assume that the wctype() and iswctype() functions exist if and only + dnl if the type wctype_t is defined in <wchar.h> or in <wctype.h> if that + dnl exists. + dnl HP-UX 11.00 declares all these in <wchar.h> and lacks <wctype.h>. + AC_CACHE_CHECK([for wctype_t], [gl_cv_type_wctype_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #if HAVE_WCTYPE_H + # include <wctype.h> + #endif + wctype_t a; + ]], + [[]])], + [gl_cv_type_wctype_t=yes], + [gl_cv_type_wctype_t=no]) + ]) + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi + + dnl We assume that the wctrans() and towctrans() functions exist if and only + dnl if the type wctrans_t is defined in <wctype.h>. + AC_CACHE_CHECK([for wctrans_t], [gl_cv_type_wctrans_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #include <wctype.h> + wctrans_t a; + ]], + [[]])], + [gl_cv_type_wctrans_t=yes], + [gl_cv_type_wctrans_t=no]) + ]) + if test $gl_cv_type_wctrans_t = no; then + HAVE_WCTRANS_T=0 + fi + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <stddef.h> +# include <stdio.h> +# include <time.h> +# include <wchar.h> +#endif +#include <wctype.h> + ]], + [wctype iswctype wctrans towctrans + ]) +]) + +AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_WCTYPE_H_DEFAULTS], +[ + GNULIB_ISWBLANK=0; AC_SUBST([GNULIB_ISWBLANK]) + GNULIB_WCTYPE=0; AC_SUBST([GNULIB_WCTYPE]) + GNULIB_ISWCTYPE=0; AC_SUBST([GNULIB_ISWCTYPE]) + GNULIB_WCTRANS=0; AC_SUBST([GNULIB_WCTRANS]) + GNULIB_TOWCTRANS=0; AC_SUBST([GNULIB_TOWCTRANS]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_ISWBLANK=1; AC_SUBST([HAVE_ISWBLANK]) + HAVE_WCTYPE_T=1; AC_SUBST([HAVE_WCTYPE_T]) + HAVE_WCTRANS_T=1; AC_SUBST([HAVE_WCTRANS_T]) + REPLACE_ISWBLANK=0; AC_SUBST([REPLACE_ISWBLANK]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/wcwidth.m4 b/local/recipes/tools/diffutils/source/m4/wcwidth.m4 new file mode 100644 index 0000000000..58716416cf --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/wcwidth.m4 @@ -0,0 +1,104 @@ +# wcwidth.m4 serial 23 +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_WCWIDTH], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + dnl Persuade glibc <wchar.h> to declare wcwidth(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([gt_TYPE_WCHAR_T]) + AC_REQUIRE([gt_TYPE_WINT_T]) + + AC_CHECK_HEADERS_ONCE([wchar.h]) + AC_CHECK_FUNCS_ONCE([wcwidth]) + + AC_CHECK_DECLS([wcwidth], [], [], [[ +/* AIX 3.2.5 declares wcwidth in <string.h>. */ +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +]]) + if test $ac_cv_have_decl_wcwidth != yes; then + HAVE_DECL_WCWIDTH=0 + fi + + if test $ac_cv_func_wcwidth = yes; then + HAVE_WCWIDTH=1 + dnl On Mac OS X 10.3, wcwidth(0x0301) (COMBINING ACUTE ACCENT) returns 1. + dnl On OpenBSD 5.0, wcwidth(0x05B0) (HEBREW POINT SHEVA) returns 1. + dnl On OSF/1 5.1, wcwidth(0x200B) (ZERO WIDTH SPACE) returns 1. + dnl On OpenBSD 5.8, wcwidth(0xFF1A) (FULLWIDTH COLON) returns 0. + dnl This leads to bugs in 'ls' (coreutils). + AC_CACHE_CHECK([whether wcwidth works reasonably in UTF-8 locales], + [gl_cv_func_wcwidth_works], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <locale.h> +/* AIX 3.2.5 declares wcwidth in <string.h>. */ +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +#if !HAVE_DECL_WCWIDTH +extern +# ifdef __cplusplus +"C" +# endif +int wcwidth (int); +#endif +int main () +{ + int result = 0; + if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL) + { + if (wcwidth (0x0301) > 0) + result |= 1; + if (wcwidth (0x05B0) > 0) + result |= 2; + if (wcwidth (0x200B) > 0) + result |= 4; + if (wcwidth (0xFF1A) == 0) + result |= 8; + } + return result; +}]])], + [gl_cv_func_wcwidth_works=yes], + [gl_cv_func_wcwidth_works=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc and AIX 7 systems. + *-gnu* | aix[7-9]*) gl_cv_func_wcwidth_works="guessing yes";; + *) gl_cv_func_wcwidth_works="guessing no";; + esac +changequote([,])dnl + ]) + ]) + case "$gl_cv_func_wcwidth_works" in + *yes) ;; + *no) REPLACE_WCWIDTH=1 ;; + esac + else + HAVE_WCWIDTH=0 + fi + dnl We don't substitute HAVE_WCWIDTH. We assume that if the system does not + dnl have the wcwidth function, then it does not declare it. +]) diff --git a/local/recipes/tools/diffutils/source/m4/wint_t.m4 b/local/recipes/tools/diffutils/source/m4/wint_t.m4 new file mode 100644 index 0000000000..d30b8bcf83 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/wint_t.m4 @@ -0,0 +1,74 @@ +# wint_t.m4 serial 7 +dnl Copyright (C) 2003, 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. +dnl Test whether <wchar.h> has the 'wint_t' type and whether gnulib's +dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'. +dnl Prerequisite: AC_PROG_CC + +AC_DEFUN([gt_TYPE_WINT_T], +[ + AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + wint_t foo = (wchar_t)'\0';]], + [[]])], + [gt_cv_c_wint_t=yes], + [gt_cv_c_wint_t=no])]) + if test $gt_cv_c_wint_t = yes; then + AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.]) + + dnl Determine whether gnulib's <wchar.h> or <wctype.h> would, if present, + dnl override 'wint_t'. + AC_CACHE_CHECK([whether wint_t is too small], + [gl_cv_type_wint_t_too_small], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <stddef.h> +# include <stdio.h> +# include <time.h> +#endif +#include <wchar.h> + int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; + ]])], + [gl_cv_type_wint_t_too_small=no], + [gl_cv_type_wint_t_too_small=yes])]) + if test $gl_cv_type_wint_t_too_small = yes; then + GNULIB_OVERRIDES_WINT_T=1 + else + GNULIB_OVERRIDES_WINT_T=0 + fi + else + GNULIB_OVERRIDES_WINT_T=0 + fi + AC_SUBST([GNULIB_OVERRIDES_WINT_T]) +]) + +dnl Prerequisites of the 'wint_t' override. +AC_DEFUN([gl_TYPE_WINT_T_PREREQ], +[ + AC_CHECK_HEADERS_ONCE([crtdefs.h]) + if test $ac_cv_header_crtdefs_h = yes; then + HAVE_CRTDEFS_H=1 + else + HAVE_CRTDEFS_H=0 + fi + AC_SUBST([HAVE_CRTDEFS_H]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/xalloc.m4 b/local/recipes/tools/diffutils/source/m4/xalloc.m4 new file mode 100644 index 0000000000..53aba149ac --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/xalloc.m4 @@ -0,0 +1,7 @@ +# xalloc.m4 serial 18 +dnl Copyright (C) 2002-2006, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_XALLOC], [:]) diff --git a/local/recipes/tools/diffutils/source/m4/xsize.m4 b/local/recipes/tools/diffutils/source/m4/xsize.m4 new file mode 100644 index 0000000000..5f8505770c --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/xsize.m4 @@ -0,0 +1,12 @@ +# xsize.m4 serial 5 +dnl Copyright (C) 2003-2004, 2008-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_XSIZE], +[ + dnl Prerequisites of lib/xsize.h. + AC_REQUIRE([gl_SIZE_MAX]) + AC_CHECK_HEADERS([stdint.h]) +]) diff --git a/local/recipes/tools/diffutils/source/m4/xstrndup.m4 b/local/recipes/tools/diffutils/source/m4/xstrndup.m4 new file mode 100644 index 0000000000..efb94a1af5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/xstrndup.m4 @@ -0,0 +1,15 @@ +# xstrndup.m4 serial 2 +dnl Copyright (C) 2003, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_XSTRNDUP], +[ + gl_PREREQ_XSTRNDUP +]) + +# Prerequisites of lib/xstrndup.c. +AC_DEFUN([gl_PREREQ_XSTRNDUP], [ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/xstrtol.m4 b/local/recipes/tools/diffutils/source/m4/xstrtol.m4 new file mode 100644 index 0000000000..035588ea9e --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/xstrtol.m4 @@ -0,0 +1,10 @@ +#serial 11 +dnl Copyright (C) 2002-2007, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_XSTRTOL], +[ + : +]) diff --git a/local/recipes/tools/diffutils/source/m4/xvasprintf.m4 b/local/recipes/tools/diffutils/source/m4/xvasprintf.m4 new file mode 100644 index 0000000000..b7ce7b5238 --- /dev/null +++ b/local/recipes/tools/diffutils/source/m4/xvasprintf.m4 @@ -0,0 +1,8 @@ +# xvasprintf.m4 serial 2 +dnl Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Prerequisites of lib/xvasprintf.c. +AC_DEFUN([gl_XVASPRINTF], [:]) diff --git a/local/recipes/tools/diffutils/source/maint.mk b/local/recipes/tools/diffutils/source/maint.mk new file mode 100644 index 0000000000..09a98bce80 --- /dev/null +++ b/local/recipes/tools/diffutils/source/maint.mk @@ -0,0 +1,1674 @@ +# -*-Makefile-*- +# This Makefile fragment tries to be general-purpose enough to be +# used by many projects via the gnulib maintainer-makefile module. + +## Copyright (C) 2001-2017 Free Software Foundation, Inc. +## +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see <http://www.gnu.org/licenses/>. + +# This is reported not to work with make-3.79.1 +# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +ME := maint.mk + +# Helper variables. +_empty = +_sp = $(_empty) $(_empty) + +# _equal,S1,S2 +# ------------ +# If S1 == S2, return S1, otherwise the empty string. +_equal = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1))) + +# member-check,VARIABLE,VALID-VALUES +# ---------------------------------- +# Check that $(VARIABLE) is in the space-separated list of VALID-VALUES, and +# return it. Die otherwise. +member-check = \ + $(strip \ + $(if $($(1)), \ + $(if $(findstring $(_sp),$($(1))), \ + $(error invalid $(1): '$($(1))', expected $(2)), \ + $(or $(findstring $(_sp)$($(1))$(_sp),$(_sp)$(2)$(_sp)), \ + $(error invalid $(1): '$($(1))', expected $(2)))), \ + $(error $(1) undefined))) + +# Do not save the original name or timestamp in the .tar.gz file. +# Use --rsyncable if available. +gzip_rsyncable := \ + $(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null \ + && printf %s --rsyncable) +GZIP_ENV = '--no-name --best $(gzip_rsyncable)' + +GIT = git +VC = $(GIT) + +VC_LIST = $(srcdir)/$(_build-aux)/vc-list-files -C $(srcdir) + +# You can override this variable in cfg.mk if your gnulib submodule lives +# in a different location. +gnulib_dir ?= $(srcdir)/gnulib + +# You can override this variable in cfg.mk to set your own regexp +# matching files to ignore. +VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$ + +# This is to preprocess robustly the output of $(VC_LIST), so that even +# when $(srcdir) is a pathological name like "....", the leading sed command +# removes only the intended prefix. +_dot_escaped_srcdir = $(subst .,\.,$(srcdir)) + +# Post-process $(VC_LIST) output, prepending $(srcdir)/, but only +# when $(srcdir) is not ".". +ifeq ($(srcdir),.) + _prepend_srcdir_prefix = +else + _prepend_srcdir_prefix = | $(SED) 's|^|$(srcdir)/|' +endif + +# In order to be able to consistently filter "."-relative names, +# (i.e., with no $(srcdir) prefix), this definition is careful to +# remove any $(srcdir) prefix, and to restore what it removes. +_sc_excl = \ + $(or $(exclude_file_name_regexp--$@),^$$) +VC_LIST_EXCEPT = \ + $(VC_LIST) | $(SED) 's|^$(_dot_escaped_srcdir)/||' \ + | if test -f $(srcdir)/.x-$@; then grep -vEf $(srcdir)/.x-$@; \ + else grep -Ev -e "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi \ + | grep -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \ + $(_prepend_srcdir_prefix) + +ifeq ($(origin prev_version_file), undefined) + prev_version_file = $(srcdir)/.prev-version +endif + +PREV_VERSION := $(shell cat $(prev_version_file) 2>/dev/null) +VERSION_REGEXP = $(subst .,\.,$(VERSION)) +PREV_VERSION_REGEXP = $(subst .,\.,$(PREV_VERSION)) + +ifeq ($(VC),$(GIT)) + this-vc-tag = v$(VERSION) + this-vc-tag-regexp = v$(VERSION_REGEXP) +else + tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]') + tag-this-version = $(subst .,_,$(VERSION)) + this-vc-tag = $(tag-package)-$(tag-this-version) + this-vc-tag-regexp = $(this-vc-tag) +endif +my_distdir = $(PACKAGE)-$(VERSION) + +# Old releases are stored here. +release_archive_dir ?= ../release + +# If RELEASE_TYPE is undefined, but RELEASE is, use its second word. +# But overwrite VERSION. +ifdef RELEASE + VERSION := $(word 1, $(RELEASE)) + RELEASE_TYPE ?= $(word 2, $(RELEASE)) +endif + +# Validate and return $(RELEASE_TYPE), or die. +RELEASE_TYPES = alpha beta stable +release-type = $(call member-check,RELEASE_TYPE,$(RELEASE_TYPES)) + +# Override gnu_rel_host and url_dir_list in cfg.mk if these are not right. +# Use alpha.gnu.org for alpha and beta releases. +# Use ftp.gnu.org for stable releases. +gnu_ftp_host-alpha = alpha.gnu.org +gnu_ftp_host-beta = alpha.gnu.org +gnu_ftp_host-stable = ftp.gnu.org +gnu_rel_host ?= $(gnu_ftp_host-$(release-type)) + +url_dir_list ?= $(if $(call _equal,$(gnu_rel_host),ftp.gnu.org), \ + http://ftpmirror.gnu.org/$(PACKAGE), \ + ftp://$(gnu_rel_host)/gnu/$(PACKAGE)) + +# Override this in cfg.mk if you are using a different format in your +# NEWS file. +today = $(shell date +%Y-%m-%d) + +# Select which lines of NEWS are searched for $(news-check-regexp). +# This is a sed line number spec. The default says that we search +# lines 1..10 of NEWS for $(news-check-regexp). +# If you want to search only line 3 or only lines 20-22, use "3" or "20,22". +news-check-lines-spec ?= 1,10 +news-check-regexp ?= '^\*.* $(VERSION_REGEXP) \($(today)\)' + +# Prevent programs like 'sort' from considering distinct strings to be equal. +# Doing it here saves us from having to set LC_ALL elsewhere in this file. +export LC_ALL = C + +## --------------- ## +## Sanity checks. ## +## --------------- ## + +ifneq ($(_gl-Makefile),) +_cfg_mk := $(wildcard $(srcdir)/cfg.mk) + +# Collect the names of rules starting with 'sc_'. +syntax-check-rules := $(sort $(shell $(SED) -n \ + 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' $(srcdir)/$(ME) $(_cfg_mk))) +.PHONY: $(syntax-check-rules) + +ifeq ($(shell $(VC_LIST) >/dev/null 2>&1; echo $$?),0) + local-checks-available += $(syntax-check-rules) +else + local-checks-available += no-vc-detected +no-vc-detected: + @echo "No version control files detected; skipping syntax check" +endif +.PHONY: $(local-checks-available) + +# Arrange to print the name of each syntax-checking rule just before running it. +$(syntax-check-rules): %: %.m +sc_m_rules_ = $(patsubst %, %.m, $(syntax-check-rules)) +.PHONY: $(sc_m_rules_) +$(sc_m_rules_): + @echo $(patsubst sc_%.m, %, $@) + @date +%s.%N > .sc-start-$(basename $@) + +# Compute and print the elapsed time for each syntax-check rule. +sc_z_rules_ = $(patsubst %, %.z, $(syntax-check-rules)) +.PHONY: $(sc_z_rules_) +$(sc_z_rules_): %.z: % + @end=$$(date +%s.%N); \ + start=$$(cat .sc-start-$*); \ + rm -f .sc-start-$*; \ + awk -v s=$$start -v e=$$end \ + 'END {printf "%.2f $(patsubst sc_%,%,$*)\n", e - s}' < /dev/null + +# The patsubst here is to replace each sc_% rule with its sc_%.z wrapper +# that computes and prints elapsed time. +local-check := \ + $(patsubst sc_%, sc_%.z, \ + $(filter-out $(local-checks-to-skip), $(local-checks-available))) + +syntax-check: $(local-check) +endif + +# _sc_search_regexp +# +# This macro searches for a given construct in the selected files and +# then takes some action. +# +# Parameters (shell variables): +# +# prohibit | require +# +# Regular expression (ERE) denoting either a forbidden construct +# or a required construct. Those arguments are exclusive. +# +# exclude +# +# Regular expression (ERE) denoting lines to ignore that matched +# a prohibit construct. For example, this can be used to exclude +# comments that mention why the nearby code uses an alternative +# construct instead of the simpler prohibited construct. +# +# in_vc_files | in_files +# +# grep-E-style regexp selecting the files to check. For in_vc_files, +# the regexp is used to select matching files from the list of all +# version-controlled files; for in_files, it's from the names printed +# by "find $(srcdir)". When neither is specified, use all files that +# are under version control. +# +# containing | non_containing +# +# Select the files (non) containing strings matching this regexp. +# If both arguments are specified then CONTAINING takes +# precedence. +# +# with_grep_options +# +# Extra options for grep. +# +# ignore_case +# +# Ignore case. +# +# halt +# +# Message to display before to halting execution. +# +# Finally, you may exempt files based on an ERE matching file names. +# For example, to exempt from the sc_space_tab check all files with the +# .diff suffix, set this Make variable: +# +# exclude_file_name_regexp--sc_space_tab = \.diff$ +# +# Note that while this functionality is mostly inherited via VC_LIST_EXCEPT, +# when filtering by name via in_files, we explicitly filter out matching +# names here as well. + +# Initialize each, so that envvar settings cannot interfere. +export require = +export prohibit = +export exclude = +export in_vc_files = +export in_files = +export containing = +export non_containing = +export halt = +export with_grep_options = + +# By default, _sc_search_regexp does not ignore case. +export ignore_case = +_ignore_case = $$(test -n "$$ignore_case" && printf %s -i || :) + +define _sc_say_and_exit + dummy=; : so we do not need a semicolon before each use; \ + { printf '%s\n' "$(ME): $$msg" 1>&2; exit 1; }; +endef + +define _sc_search_regexp + dummy=; : so we do not need a semicolon before each use; \ + \ + : Check arguments; \ + test -n "$$prohibit" && test -n "$$require" \ + && { msg='Cannot specify both prohibit and require' \ + $(_sc_say_and_exit) } || :; \ + test -z "$$prohibit" && test -z "$$require" \ + && { msg='Should specify either prohibit or require' \ + $(_sc_say_and_exit) } || :; \ + test -z "$$prohibit" && test -n "$$exclude" \ + && { msg='Use of exclude requires a prohibit pattern' \ + $(_sc_say_and_exit) } || :; \ + test -n "$$in_vc_files" && test -n "$$in_files" \ + && { msg='Cannot specify both in_vc_files and in_files' \ + $(_sc_say_and_exit) } || :; \ + test "x$$halt" != x \ + || { msg='halt not defined' $(_sc_say_and_exit) }; \ + \ + : Filter by file name; \ + if test -n "$$in_files"; then \ + files=$$(find $(srcdir) | grep -E "$$in_files" \ + | grep -Ev '$(_sc_excl)'); \ + else \ + files=$$($(VC_LIST_EXCEPT)); \ + if test -n "$$in_vc_files"; then \ + files=$$(echo "$$files" | grep -E "$$in_vc_files"); \ + fi; \ + fi; \ + \ + : Filter by content; \ + test -n "$$files" && test -n "$$containing" \ + && { files=$$(grep -l "$$containing" $$files); } || :; \ + test -n "$$files" && test -n "$$non_containing" \ + && { files=$$(grep -vl "$$non_containing" $$files); } || :; \ + \ + : Check for the construct; \ + if test -n "$$files"; then \ + if test -n "$$prohibit"; then \ + grep $$with_grep_options $(_ignore_case) -nE "$$prohibit" $$files \ + | grep -vE "$${exclude:-^$$}" \ + && { msg="$$halt" $(_sc_say_and_exit) } || :; \ + else \ + grep $$with_grep_options $(_ignore_case) -LE "$$require" $$files \ + | grep . \ + && { msg="$$halt" $(_sc_say_and_exit) } || :; \ + fi \ + else :; \ + fi || :; +endef + +sc_avoid_if_before_free: + @$(srcdir)/$(_build-aux)/useless-if-before-free \ + $(useless_free_options) \ + $$($(VC_LIST_EXCEPT) | grep -v useless-if-before-free) && \ + { echo '$(ME): found useless "if" before "free" above' 1>&2; \ + exit 1; } || : + +sc_cast_of_argument_to_free: + @prohibit='\<free *\( *\(' halt="don't cast free argument" \ + $(_sc_search_regexp) + +sc_cast_of_x_alloc_return_value: + @prohibit='\*\) *x(m|c|re)alloc\>' \ + halt="don't cast x*alloc return value" \ + $(_sc_search_regexp) + +sc_cast_of_alloca_return_value: + @prohibit='\*\) *alloca\>' \ + halt="don't cast alloca return value" \ + $(_sc_search_regexp) + +sc_space_tab: + @prohibit='[ ] ' \ + halt='found SPACE-TAB sequence; remove the SPACE' \ + $(_sc_search_regexp) + +# Don't use *scanf or the old ato* functions in "real" code. +# They provide no error checking mechanism. +# Instead, use strto* functions. +sc_prohibit_atoi_atof: + @prohibit='\<([fs]?scanf|ato([filq]|ll)) *\(' \ + halt='do not use *scan''f, ato''f, ato''i, ato''l, ato''ll or ato''q' \ + $(_sc_search_regexp) + +# Use STREQ rather than comparing strcmp == 0, or != 0. +sp_ = strcmp *\(.+\) +sc_prohibit_strcmp: + @prohibit='! *strcmp *\(|\<$(sp_) *[!=]=|[!=]= *$(sp_)' \ + exclude='# *define STRN?EQ\(' \ + halt='replace strcmp calls above with STREQ/STRNEQ' \ + $(_sc_search_regexp) + +# Really. You don't want to use this function. +# It may fail to NUL-terminate the destination, +# and always NUL-pads out to the specified length. +sc_prohibit_strncpy: + @prohibit='\<strncpy *\(' \ + halt='do not use strncpy, period' \ + $(_sc_search_regexp) + +# Pass EXIT_*, not number, to usage, exit, and error (when exiting) +# Convert all uses automatically, via these two commands: +# git grep -l '\<exit *(1)' \ +# | grep -vEf .x-sc_prohibit_magic_number_exit \ +# | xargs --no-run-if-empty \ +# perl -pi -e 's/(^|[^.])\b(exit ?)\(1\)/$1$2(EXIT_FAILURE)/' +# git grep -l '\<exit *(0)' \ +# | grep -vEf .x-sc_prohibit_magic_number_exit \ +# | xargs --no-run-if-empty \ +# perl -pi -e 's/(^|[^.])\b(exit ?)\(0\)/$1$2(EXIT_SUCCESS)/' +sc_prohibit_magic_number_exit: + @prohibit='(^|[^.])\<(usage|exit|error) ?\(-?[0-9]+[,)]' \ + exclude='exit \(77\)|error ?\(((0|77),|[^,]*)' \ + halt='use EXIT_* values rather than magic number' \ + $(_sc_search_regexp) + +# Using EXIT_SUCCESS as the first argument to error is misleading, +# since when that parameter is 0, error does not exit. Use '0' instead. +sc_error_exit_success: + @prohibit='error *\(EXIT_SUCCESS,' \ + in_vc_files='\.[chly]$$' \ + halt='found error (EXIT_SUCCESS' \ + $(_sc_search_regexp) + +# "FATAL:" should be fully upper-cased in error messages +# "WARNING:" should be fully upper-cased, or fully lower-cased +sc_error_message_warn_fatal: + @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \ + | grep -E '"Warning|"Fatal|"fatal' && \ + { echo '$(ME): use FATAL, WARNING or warning' 1>&2; \ + exit 1; } || : + +# Error messages should not start with a capital letter +sc_error_message_uppercase: + @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \ + | grep -E '"[A-Z]' \ + | grep -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX' && \ + { echo '$(ME): found capitalized error message' 1>&2; \ + exit 1; } || : + +# Error messages should not end with a period +sc_error_message_period: + @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \ + | grep -E '[^."]\."' && \ + { echo '$(ME): found error message ending in period' 1>&2; \ + exit 1; } || : + +sc_file_system: + @prohibit=file''system \ + ignore_case=1 \ + halt='found use of "file''system"; spell it "file system"' \ + $(_sc_search_regexp) + +# Don't use cpp tests of this symbol. All code assumes config.h is included. +sc_prohibit_have_config_h: + @prohibit='^# *if.*HAVE''_CONFIG_H' \ + halt='found use of HAVE''_CONFIG_H; remove' \ + $(_sc_search_regexp) + +# Nearly all .c files must include <config.h>. However, we also permit this +# via inclusion of a package-specific header, if cfg.mk specified one. +# config_h_header must be suitable for grep -E. +config_h_header ?= <config\.h> +sc_require_config_h: + @require='^# *include $(config_h_header)' \ + in_vc_files='\.c$$' \ + halt='the above files do not include <config.h>' \ + $(_sc_search_regexp) + +# Print each file name for which the first #include does not match +# $(config_h_header). Like grep -m 1, this only looks at the first match. +perl_config_h_first_ = \ + -e 'BEGIN {$$ret = 0}' \ + -e 'if (/^\# *include\b/) {' \ + -e ' if (not m{^\# *include $(config_h_header)}) {' \ + -e ' print "$$ARGV\n";' \ + -e ' $$ret = 1;' \ + -e ' }' \ + -e ' \# Move on to next file after first include' \ + -e ' close ARGV;' \ + -e '}' \ + -e 'END {exit $$ret}' + +# You must include <config.h> before including any other header file. +# This can possibly be via a package-specific header, if given by cfg.mk. +sc_require_config_h_first: + @if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \ + files=$$($(VC_LIST_EXCEPT) | grep '\.c$$') && \ + perl -n $(perl_config_h_first_) $$files || \ + { echo '$(ME): the above files include some other header' \ + 'before <config.h>' 1>&2; exit 1; } || :; \ + else :; \ + fi + +sc_prohibit_HAVE_MBRTOWC: + @prohibit='\bHAVE_MBRTOWC\b' \ + halt="do not use $$prohibit; it is always defined" \ + $(_sc_search_regexp) + +# To use this "command" macro, you must first define two shell variables: +# h: the header name, with no enclosing <> or "" +# re: a regular expression that matches IFF something provided by $h is used. +define _sc_header_without_use + dummy=; : so we do not need a semicolon before each use; \ + h_esc=`echo '[<"]'"$$h"'[">]'|$(SED) 's/\./\\\\./g'`; \ + if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \ + files=$$(grep -l '^# *include '"$$h_esc" \ + $$($(VC_LIST_EXCEPT) | grep '\.c$$')) && \ + grep -LE "$$re" $$files | grep . && \ + { echo "$(ME): the above files include $$h but don't use it" \ + 1>&2; exit 1; } || :; \ + else :; \ + fi +endef + +# Prohibit the inclusion of assert.h without an actual use of assert. +sc_prohibit_assert_without_use: + @h='assert.h' re='\<assert *\(' $(_sc_header_without_use) + +# Prohibit the inclusion of close-stream.h without an actual use. +sc_prohibit_close_stream_without_use: + @h='close-stream.h' re='\<close_stream *\(' $(_sc_header_without_use) + +# Prohibit the inclusion of getopt.h without an actual use. +sc_prohibit_getopt_without_use: + @h='getopt.h' re='\<getopt(_long)? *\(' $(_sc_header_without_use) + +# Don't include quotearg.h unless you use one of its functions. +sc_prohibit_quotearg_without_use: + @h='quotearg.h' re='\<quotearg(_[^ ]+)? *\(' $(_sc_header_without_use) + +# Don't include quote.h unless you use one of its functions. +sc_prohibit_quote_without_use: + @h='quote.h' re='\<quote((_n)? *\(|_quoting_options\>)' \ + $(_sc_header_without_use) + +# Don't include this header unless you use one of its functions. +sc_prohibit_long_options_without_use: + @h='long-options.h' re='\<parse_long_options *\(' \ + $(_sc_header_without_use) + +# Don't include this header unless you use one of its functions. +sc_prohibit_inttostr_without_use: + @h='inttostr.h' re='\<(off|[iu]max|uint)tostr *\(' \ + $(_sc_header_without_use) + +# Don't include this header unless you use one of its functions. +sc_prohibit_ignore_value_without_use: + @h='ignore-value.h' re='\<ignore_(value|ptr) *\(' \ + $(_sc_header_without_use) + +# Don't include this header unless you use one of its functions. +sc_prohibit_error_without_use: + @h='error.h' \ + re='\<error(_at_line|_print_progname|_one_per_line|_message_count)? *\('\ + $(_sc_header_without_use) + +# Don't include xalloc.h unless you use one of its functions. +# Consider these symbols: +# perl -lne '/^# *define (\w+)\(/ and print $1' lib/xalloc.h|grep -v '^__'; +# perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) *\(/ and print $1' lib/xalloc.h +# Divide into two sets on case, and filter each through this: +# | sort | perl -MRegexp::Assemble -le \ +# 'print Regexp::Assemble->new(file => "/dev/stdin")->as_string'|sed 's/\?://g' +# Note this was produced by the above: +# _xa1 = \ +#x(((2n?)?re|c(har)?|n(re|m)|z)alloc|alloc_(oversized|die)|m(alloc|emdup)|strdup) +# But we can do better, in at least two ways: +# 1) take advantage of two "dup"-suffixed strings: +# x(((2n?)?re|c(har)?|n(re|m)|[mz])alloc|alloc_(oversized|die)|(mem|str)dup) +# 2) notice that "c(har)?|[mz]" is equivalent to the shorter and more readable +# "char|[cmz]" +# x(((2n?)?re|char|n(re|m)|[cmz])alloc|alloc_(oversized|die)|(mem|str)dup) +_xa1 = x(((2n?)?re|char|n(re|m)|[cmz])alloc|alloc_(oversized|die)|(mem|str)dup) +_xa2 = X([CZ]|N?M)ALLOC +sc_prohibit_xalloc_without_use: + @h='xalloc.h' \ + re='\<($(_xa1)|$(_xa2)) *\('\ + $(_sc_header_without_use) + +# Extract function names: +# perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) *\(/ and print $1' lib/hash.h +_hash_re = \ +clear|delete|free|get_(first|next)|insert|lookup|print_statistics|reset_tuning +_hash_fn = \<($(_hash_re)) *\( +_hash_struct = (struct )?\<[Hh]ash_(table|tuning)\> +sc_prohibit_hash_without_use: + @h='hash.h' \ + re='$(_hash_fn)|$(_hash_struct)'\ + $(_sc_header_without_use) + +sc_prohibit_cloexec_without_use: + @h='cloexec.h' re='\<(set_cloexec_flag|dup_cloexec) *\(' \ + $(_sc_header_without_use) + +sc_prohibit_posixver_without_use: + @h='posixver.h' re='\<posix2_version *\(' $(_sc_header_without_use) + +sc_prohibit_same_without_use: + @h='same.h' re='\<same_name *\(' $(_sc_header_without_use) + +sc_prohibit_hash_pjw_without_use: + @h='hash-pjw.h' \ + re='\<hash_pjw\>' \ + $(_sc_header_without_use) + +sc_prohibit_safe_read_without_use: + @h='safe-read.h' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \ + $(_sc_header_without_use) + +sc_prohibit_argmatch_without_use: + @h='argmatch.h' \ + re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<(invalid_arg|argmatch(_exit_fn|_(in)?valid)?) *\()' \ + $(_sc_header_without_use) + +sc_prohibit_canonicalize_without_use: + @h='canonicalize.h' \ + re='CAN_(EXISTING|ALL_BUT_LAST|MISSING)|canonicalize_(mode_t|filename_mode|file_name)' \ + $(_sc_header_without_use) + +sc_prohibit_root_dev_ino_without_use: + @h='root-dev-ino.h' \ + re='(\<ROOT_DEV_INO_(CHECK|WARN)\>|\<get_root_dev_ino *\()' \ + $(_sc_header_without_use) + +sc_prohibit_openat_without_use: + @h='openat.h' \ + re='\<(openat_(permissive|needs_fchdir|(save|restore)_fail)|l?(stat|ch(own|mod))at|(euid)?accessat|(FCHMOD|FCHOWN|STAT)AT_INLINE)\>' \ + $(_sc_header_without_use) + +# Prohibit the inclusion of c-ctype.h without an actual use. +ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\ +|isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper +sc_prohibit_c_ctype_without_use: + @h='c-ctype.h' re='\<c_($(ctype_re)) *\(' \ + $(_sc_header_without_use) + +# The following list was generated by running: +# man signal.h|col -b|perl -ne '/bsd_signal.*;/.../sigwaitinfo.*;/ and print' \ +# | perl -lne '/^\s+(?:int|void).*?(\w+).*/ and print $1' | fmt +_sig_functions = \ + bsd_signal kill killpg pthread_kill pthread_sigmask raise sigaction \ + sigaddset sigaltstack sigdelset sigemptyset sigfillset sighold sigignore \ + siginterrupt sigismember signal sigpause sigpending sigprocmask sigqueue \ + sigrelse sigset sigsuspend sigtimedwait sigwait sigwaitinfo +_sig_function_re = $(subst $(_sp),|,$(strip $(_sig_functions))) +# The following were extracted from "man signal.h" manually. +_sig_types_and_consts = \ + MINSIGSTKSZ SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK \ + SA_RESETHAND SA_RESTART SA_SIGINFO SIGEV_NONE SIGEV_SIGNAL \ + SIGEV_THREAD SIGSTKSZ SIG_BLOCK SIG_SETMASK SIG_UNBLOCK SS_DISABLE \ + SS_ONSTACK mcontext_t pid_t sig_atomic_t sigevent siginfo_t sigset_t \ + sigstack sigval stack_t ucontext_t +# generated via this: +# perl -lne '/^#ifdef (SIG\w+)/ and print $1' lib/sig2str.c|sort -u|fmt -70 +_sig_names = \ + SIGABRT SIGALRM SIGALRM1 SIGBUS SIGCANCEL SIGCHLD SIGCLD SIGCONT \ + SIGDANGER SIGDIL SIGEMT SIGFPE SIGFREEZE SIGGRANT SIGHUP SIGILL \ + SIGINFO SIGINT SIGIO SIGIOT SIGKAP SIGKILL SIGKILLTHR SIGLOST SIGLWP \ + SIGMIGRATE SIGMSG SIGPHONE SIGPIPE SIGPOLL SIGPRE SIGPROF SIGPWR \ + SIGQUIT SIGRETRACT SIGSAK SIGSEGV SIGSOUND SIGSTKFLT SIGSTOP SIGSYS \ + SIGTERM SIGTHAW SIGTRAP SIGTSTP SIGTTIN SIGTTOU SIGURG SIGUSR1 \ + SIGUSR2 SIGVIRT SIGVTALRM SIGWAITING SIGWINCH SIGWIND SIGWINDOW \ + SIGXCPU SIGXFSZ +_sig_syms_re = $(subst $(_sp),|,$(strip $(_sig_names) $(_sig_types_and_consts))) + +# Prohibit the inclusion of signal.h without an actual use. +sc_prohibit_signal_without_use: + @h='signal.h' \ + re='\<($(_sig_function_re)) *\(|\<($(_sig_syms_re))\>' \ + $(_sc_header_without_use) + +# Don't include stdio--.h unless you use one of its functions. +sc_prohibit_stdio--_without_use: + @h='stdio--.h' re='\<((f(re)?|p)open|tmpfile) *\(' \ + $(_sc_header_without_use) + +# Don't include stdio-safer.h unless you use one of its functions. +sc_prohibit_stdio-safer_without_use: + @h='stdio-safer.h' re='\<((f(re)?|p)open|tmpfile)_safer *\(' \ + $(_sc_header_without_use) + +# Prohibit the inclusion of strings.h without a sensible use. +# Using the likes of bcmp, bcopy, bzero, index or rindex is not sensible. +sc_prohibit_strings_without_use: + @h='strings.h' \ + re='\<(strn?casecmp|ffs(ll)?)\>' \ + $(_sc_header_without_use) + +# Extract the raw list of symbol names with this: +gl_extract_define_simple = \ + /^\# *define ([A-Z]\w+)\(/ and print $$1 +# Filter out duplicates and convert to a space-separated list: +_intprops_names = \ + $(shell f=$(gnulib_dir)/lib/intprops.h; \ + perl -lne '$(gl_extract_define_simple)' $$f | sort -u | tr '\n' ' ') +# Remove trailing space and convert to a regular expression: +_intprops_syms_re = $(subst $(_sp),|,$(strip $(_intprops_names))) +# Prohibit the inclusion of intprops.h without an actual use. +sc_prohibit_intprops_without_use: + @h='intprops.h' \ + re='\<($(_intprops_syms_re)) *\(' \ + $(_sc_header_without_use) + +_stddef_syms_re = NULL|offsetof|ptrdiff_t|size_t|wchar_t +# Prohibit the inclusion of stddef.h without an actual use. +sc_prohibit_stddef_without_use: + @h='stddef.h' \ + re='\<($(_stddef_syms_re))\>' \ + $(_sc_header_without_use) + +_de1 = dirfd|(close|(fd)?open|read|rewind|seek|tell)dir(64)?(_r)? +_de2 = (versionsort|struct dirent|getdirentries|alphasort|scandir(at)?)(64)? +_de3 = MAXNAMLEN|DIR|ino_t|d_ino|d_fileno|d_namlen +_dirent_syms_re = $(_de1)|$(_de2)|$(_de3) +# Prohibit the inclusion of dirent.h without an actual use. +sc_prohibit_dirent_without_use: + @h='dirent.h' \ + re='\<($(_dirent_syms_re))\>' \ + $(_sc_header_without_use) + +# Prohibit the inclusion of verify.h without an actual use. +sc_prohibit_verify_without_use: + @h='verify.h' \ + re='\<(verify(true|expr)?|assume|static_assert) *\(' \ + $(_sc_header_without_use) + +# Don't include xfreopen.h unless you use one of its functions. +sc_prohibit_xfreopen_without_use: + @h='xfreopen.h' re='\<xfreopen *\(' $(_sc_header_without_use) + +sc_obsolete_symbols: + @prohibit='\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \ + halt='do not use HAVE''_FCNTL_H or O'_NDELAY \ + $(_sc_search_regexp) + +# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ + +# Each nonempty ChangeLog line must start with a year number, or a TAB. +sc_changelog: + @prohibit='^[^12 ]' \ + in_vc_files='^ChangeLog$$' \ + halt='found unexpected prefix in a ChangeLog' \ + $(_sc_search_regexp) + +# Ensure that each .c file containing a "main" function also +# calls bindtextdomain. +sc_bindtextdomain: + @require='bindtextdomain *\(' \ + in_vc_files='\.c$$' \ + containing='\<main *(' \ + halt='the above files do not call bindtextdomain' \ + $(_sc_search_regexp) + +# Require that the final line of each test-lib.sh-using test be this one: +# Exit $fail +# Note: this test requires GNU grep's --label= option. +Exit_witness_file ?= tests/test-lib.sh +Exit_base := $(notdir $(Exit_witness_file)) +sc_require_test_exit_idiom: + @if test -f $(srcdir)/$(Exit_witness_file); then \ + die=0; \ + for i in $$(grep -l -F 'srcdir/$(Exit_base)' \ + $$($(VC_LIST) tests)); do \ + tail -n1 $$i | grep '^Exit .' > /dev/null \ + && : || { die=1; echo $$i; } \ + done; \ + test $$die = 1 && \ + { echo 1>&2 '$(ME): the final line in each of the above is not:'; \ + echo 1>&2 'Exit something'; \ + exit 1; } || :; \ + fi + +sc_trailing_blank: + @prohibit='[ ]$$' \ + halt='found trailing blank(s)' \ + exclude='^Binary file .* matches$$' \ + $(_sc_search_regexp) + +# Match lines like the following, but where there is only one space +# between the options and the description: +# -D, --all-repeated[=delimit-method] print all duplicate lines\n +longopt_re = --[a-z][0-9A-Za-z-]*(\[?=[0-9A-Za-z-]*\]?)? +sc_two_space_separator_in_usage: + @prohibit='^ *(-[A-Za-z],)? $(longopt_re) [^ ].*\\$$' \ + halt='help2man requires at least two spaces between an option and its description'\ + $(_sc_search_regexp) + +# A regexp matching function names like "error" that may be used +# to emit translatable messages. +_gl_translatable_diag_func_re ?= error + +# Look for diagnostics that aren't marked for translation. +# This won't find any for which error's format string is on a separate line. +sc_unmarked_diagnostics: + @prohibit='\<$(_gl_translatable_diag_func_re) *\([^"]*"[^"]*[a-z]{3}' \ + exclude='(_|ngettext ?)\(' \ + halt='found unmarked diagnostic(s)' \ + $(_sc_search_regexp) + +# Avoid useless parentheses like those in this example: +# #if defined (SYMBOL) || defined (SYM2) +sc_useless_cpp_parens: + @prohibit='^# *if .*defined *\(' \ + halt='found useless parentheses in cpp directive' \ + $(_sc_search_regexp) + +# List headers for which HAVE_HEADER_H is always true, assuming you are +# using the appropriate gnulib module. CAUTION: for each "unnecessary" +# #if HAVE_HEADER_H that you remove, be sure that your project explicitly +# requires the gnulib module that guarantees the usability of that header. +gl_assured_headers_ = \ + cd $(gnulib_dir)/lib && echo *.in.h|$(SED) 's/\.in\.h//g' + +# Convert the list of names to upper case, and replace each space with "|". +az_ = abcdefghijklmnopqrstuvwxyz +AZ_ = ABCDEFGHIJKLMNOPQRSTUVWXYZ +gl_header_upper_case_or_ = \ + $$($(gl_assured_headers_) \ + | tr $(az_)/.- $(AZ_)___ \ + | tr -s ' ' '|' \ + ) +sc_prohibit_always_true_header_tests: + @or=$(gl_header_upper_case_or_); \ + re="HAVE_($$or)_H"; \ + prohibit='\<'"$$re"'\>' \ + halt=$$(printf '%s\n' \ + 'do not test the above HAVE_<header>_H symbol(s);' \ + ' with the corresponding gnulib module, they are always true') \ + $(_sc_search_regexp) + +sc_prohibit_defined_have_decl_tests: + @prohibit='(#[ ]*ifn?def|\<defined)\>[ (]+HAVE_DECL_' \ + halt='HAVE_DECL macros are always defined' \ + $(_sc_search_regexp) + +# ================================================================== +gl_other_headers_ ?= \ + intprops.h \ + openat.h \ + stat-macros.h + +# Perl -lne code to extract "significant" cpp-defined symbols from a +# gnulib header file, eliminating a few common false-positives. +# The exempted names below are defined only conditionally in gnulib, +# and hence sometimes must/may be defined in application code. +gl_extract_significant_defines_ = \ + /^\# *define ([^_ (][^ (]*)(\s*\(|\s+\w+)/\ + && $$2 !~ /(?:rpl_|_used_without_)/\ + && $$1 !~ /^(?:NSIG|ENODATA)$$/\ + && $$1 !~ /^(?:SA_RESETHAND|SA_RESTART)$$/\ + and print $$1 + +# Create a list of regular expressions matching the names +# of macros that are guaranteed to be defined by parts of gnulib. +define def_sym_regex + gen_h=$(gl_generated_headers_); \ + (cd $(gnulib_dir)/lib; \ + for f in *.in.h $(gl_other_headers_); do \ + test -f $$f \ + && perl -lne '$(gl_extract_significant_defines_)' $$f; \ + done; \ + ) | sort -u \ + | $(SED) 's/^/^ *# *(define|undef) */;s/$$/\\>/' +endef + +# Don't define macros that we already get from gnulib header files. +sc_prohibit_always-defined_macros: + @if test -d $(gnulib_dir); then \ + case $$(echo all: | grep -l -f - Makefile) in Makefile);; *) \ + echo '$(ME): skipping $@: you lack GNU grep' 1>&2; exit 0;; \ + esac; \ + $(def_sym_regex) | grep -E -f - $$($(VC_LIST_EXCEPT)) \ + && { echo '$(ME): define the above via some gnulib .h file' \ + 1>&2; exit 1; } || :; \ + fi +# ================================================================== + +# Prohibit checked in backup files. +sc_prohibit_backup_files: + @$(VC_LIST) | grep '~$$' && \ + { echo '$(ME): found version controlled backup file' 1>&2; \ + exit 1; } || : + +# Require the latest GPL. +sc_GPL_version: + @prohibit='either ''version [^3]' \ + halt='GPL vN, N!=3' \ + $(_sc_search_regexp) + +# Require the latest GFDL. Two regexp, since some .texi files end up +# line wrapping between 'Free Documentation License,' and 'Version'. +_GFDL_regexp = (Free ''Documentation.*Version 1\.[^3]|Version 1\.[^3] or any) +sc_GFDL_version: + @prohibit='$(_GFDL_regexp)' \ + halt='GFDL vN, N!=3' \ + $(_sc_search_regexp) + +# Don't use Texinfo's @acronym{}. +# http://lists.gnu.org/archive/html/bug-gnulib/2010-03/msg00321.html +texinfo_suffix_re_ ?= \.(txi|texi(nfo)?)$$ +sc_texinfo_acronym: + @prohibit='@acronym\{' \ + in_vc_files='$(texinfo_suffix_re_)' \ + halt='found use of Texinfo @acronym{}' \ + $(_sc_search_regexp) + +cvs_keywords = \ + Author|Date|Header|Id|Name|Locker|Log|RCSfile|Revision|Source|State + +sc_prohibit_cvs_keyword: + @prohibit='\$$($(cvs_keywords))\$$' \ + halt='do not use CVS keyword expansion' \ + $(_sc_search_regexp) + +# This Perl code is slightly obfuscated. Not only is each "$" doubled +# because it's in a Makefile, but the $$c's are comments; we cannot +# use "#" due to the way the script ends up concatenated onto one line. +# It would be much more concise, and would produce better output (including +# counts) if written as: +# perl -ln -0777 -e '/\n(\n+)$/ and print "$ARGV: ".length $1' ... +# but that would be far less efficient, reading the entire contents +# of each file, rather than just the last two bytes of each. +# In addition, while the code below detects both blank lines and a missing +# newline at EOF, the above detects only the former. +# +# This is a perl script that is expected to be the single-quoted argument +# to a command-line "-le". The remaining arguments are file names. +# Print the name of each file that does not end in exactly one newline byte. +# I.e., warn if there are blank lines (2 or more newlines), or if the +# last byte is not a newline. However, currently we don't complain +# about any file that contains exactly one byte. +# Exit nonzero if at least one such file is found, otherwise, exit 0. +# Warn about, but otherwise ignore open failure. Ignore seek/read failure. +# +# Use this if you want to remove trailing empty lines from selected files: +# perl -pi -0777 -e 's/\n\n+$/\n/' files... +# +require_exactly_one_NL_at_EOF_ = \ + foreach my $$f (@ARGV) \ + { \ + open F, "<", $$f or (warn "failed to open $$f: $$!\n"), next; \ + my $$p = sysseek (F, -2, 2); \ + my $$c = "seek failure probably means file has < 2 bytes; ignore"; \ + my $$last_two_bytes; \ + defined $$p and $$p = sysread F, $$last_two_bytes, 2; \ + close F; \ + $$c = "ignore read failure"; \ + $$p && ($$last_two_bytes eq "\n\n" \ + || substr ($$last_two_bytes,1) ne "\n") \ + and (print $$f), $$fail=1; \ + } \ + END { exit defined $$fail } +sc_prohibit_empty_lines_at_EOF: + @perl -le '$(require_exactly_one_NL_at_EOF_)' $$($(VC_LIST_EXCEPT)) \ + || { echo '$(ME): empty line(s) or no newline at EOF' \ + 1>&2; exit 1; } || : + +# Make sure we don't use st_blocks. Use ST_NBLOCKS instead. +# This is a bit of a kludge, since it prevents use of the string +# even in comments, but for now it does the job with no false positives. +sc_prohibit_stat_st_blocks: + @prohibit='[.>]st_blocks' \ + halt='do not use st_blocks; use ST_NBLOCKS' \ + $(_sc_search_regexp) + +# Make sure we don't define any S_IS* macros in src/*.c files. +# They're already defined via gnulib's sys/stat.h replacement. +sc_prohibit_S_IS_definition: + @prohibit='^ *# *define *S_IS' \ + halt='do not define S_IS* macros; include <sys/stat.h>' \ + $(_sc_search_regexp) + +# Perl block to convert a match to FILE_NAME:LINENO:TEST, +# that is shared by two definitions below. +perl_filename_lineno_text_ = \ + -e ' {' \ + -e ' $$n = ($$` =~ tr/\n/\n/ + 1);' \ + -e ' ($$v = $$&) =~ s/\n/\\n/g;' \ + -e ' print "$$ARGV:$$n:$$v\n";' \ + -e ' }' + +prohibit_doubled_words_ = \ + the then in an on if is it but for or at and do to +# expand the regex before running the check to avoid using expensive captures +prohibit_doubled_word_expanded_ = \ + $(join $(prohibit_doubled_words_),$(addprefix \s+,$(prohibit_doubled_words_))) +prohibit_doubled_word_RE_ ?= \ + /\b(?:$(subst $(_sp),|,$(prohibit_doubled_word_expanded_)))\b/gims +prohibit_doubled_word_ = \ + -e 'while ($(prohibit_doubled_word_RE_))' \ + $(perl_filename_lineno_text_) + +# Define this to a regular expression that matches +# any filename:dd:match lines you want to ignore. +# The default is to ignore no matches. +ignore_doubled_word_match_RE_ ?= ^$$ + +sc_prohibit_doubled_word: + @perl -n -0777 $(prohibit_doubled_word_) $$($(VC_LIST_EXCEPT)) \ + | grep -vE '$(ignore_doubled_word_match_RE_)' \ + | grep . && { echo '$(ME): doubled words' 1>&2; exit 1; } || : + +# A regular expression matching undesirable combinations of words like +# "can not"; this matches them even when the two words appear on different +# lines, but not when there is an intervening delimiter like "#" or "*". +# Similarly undesirable, "See @xref{...}", since an @xref should start +# a sentence. Explicitly prohibit any prefix of "see" or "also". +# Also prohibit a prefix matching "\w+ +". +# @pxref gets the same see/also treatment and should be parenthesized; +# presume it must *not* start a sentence. +# POSIX spells it "timestamp" rather than "time\s+stamp", so we do, too. +bad_xref_re_ ?= (?:[\w,:;] +|(?:see|also)\s+)\@xref\{ +bad_pxref_re_ ?= (?:[.!?]|(?:see|also))\s+\@pxref\{ +prohibit_undesirable_word_seq_RE_ ?= \ + /(?:\bcan\s+not\b|\btime\s+stamps?\b|$(bad_xref_re_)|$(bad_pxref_re_))/gims +prohibit_undesirable_word_seq_ = \ + -e 'while ($(prohibit_undesirable_word_seq_RE_))' \ + $(perl_filename_lineno_text_) +# Define this to a regular expression that matches +# any filename:dd:match lines you want to ignore. +# The default is to ignore no matches. +ignore_undesirable_word_sequence_RE_ ?= ^$$ + +sc_prohibit_undesirable_word_seq: + @perl -n -0777 $(prohibit_undesirable_word_seq_) \ + $$($(VC_LIST_EXCEPT)) \ + | grep -vE '$(ignore_undesirable_word_sequence_RE_)' | grep . \ + && { echo '$(ME): undesirable word sequence' >&2; exit 1; } || : + +# Except for shell files and for loops, double semicolon is probably a mistake +sc_prohibit_double_semicolon: + @prohibit='; *;[ {} \]*(/[/*]|$$)' \ + in_vc_files='\.[chly]$$' \ + exclude='\bfor *\(.*\)' \ + halt="Double semicolon detected" \ + $(_sc_search_regexp) + +_ptm1 = use "test C1 && test C2", not "test C1 -''a C2" +_ptm2 = use "test C1 || test C2", not "test C1 -''o C2" +# Using test's -a and -o operators is not portable. +# We prefer test over [, since the latter is spelled [[ in configure.ac. +sc_prohibit_test_minus_ao: + @prohibit='(\<test| \[+) .+ -[ao] ' \ + halt='$(_ptm1); $(_ptm2)' \ + $(_sc_search_regexp) + +# Avoid a test bashism. +sc_prohibit_test_double_equal: + @prohibit='(\<test| \[+) .+ == ' \ + containing='#! */bin/[a-z]*sh' \ + halt='use "test x = x", not "test x =''= x"' \ + $(_sc_search_regexp) + +# Each program that uses proper_name_utf8 must link with one of the +# ICONV libraries. Otherwise, some ICONV library must appear in LDADD. +# The perl -0777 invocation below extracts the possibly-multi-line +# definition of LDADD from the appropriate Makefile.am and exits 0 +# when it contains "ICONV". +sc_proper_name_utf8_requires_ICONV: + @progs=$$(grep -l 'proper_name_utf8 ''("' $$($(VC_LIST_EXCEPT)));\ + if test "x$$progs" != x; then \ + fail=0; \ + for p in $$progs; do \ + dir=$$(dirname "$$p"); \ + perl -0777 \ + -ne 'exit !(/^LDADD =(.+?[^\\]\n)/ms && $$1 =~ /ICONV/)' \ + $$dir/Makefile.am && continue; \ + base=$$(basename "$$p" .c); \ + grep "$${base}_LDADD.*ICONV)" $$dir/Makefile.am > /dev/null \ + || { fail=1; echo 1>&2 "$(ME): $$p uses proper_name_utf8"; }; \ + done; \ + test $$fail = 1 && \ + { echo 1>&2 '$(ME): the above do not link with any ICONV library'; \ + exit 1; } || :; \ + fi + +# Warn about "c0nst struct Foo const foo[]", +# but not about "char const *const foo" or "#define const const". +sc_redundant_const: + @prohibit='\bconst\b[[:space:][:alnum:]]{2,}\bconst\b' \ + halt='redundant "const" in declarations' \ + $(_sc_search_regexp) + +sc_const_long_option: + @prohibit='^ *static.*struct option ' \ + exclude='const struct option|struct option const' \ + halt='add "const" to the above declarations' \ + $(_sc_search_regexp) + +NEWS_hash = \ + $$($(SED) -n '/^\*.* $(PREV_VERSION_REGEXP) ([0-9-]*)/,$$p' \ + $(srcdir)/NEWS \ + | perl -0777 -pe \ + 's/^Copyright.+?Free\sSoftware\sFoundation,\sInc\.\n//ms' \ + | md5sum - \ + | $(SED) 's/ .*//') + +# Ensure that we don't accidentally insert an entry into an old NEWS block. +sc_immutable_NEWS: + @if test -f $(srcdir)/NEWS; then \ + test "$(NEWS_hash)" = '$(old_NEWS_hash)' && : || \ + { echo '$(ME): you have modified old NEWS' 1>&2; exit 1; }; \ + fi + +# Update the hash stored above. Do this after each release and +# for any corrections to old entries. +update-NEWS-hash: NEWS + perl -pi -e 's/^(old_NEWS_hash[ \t]+:?=[ \t]+).*/$${1}'"$(NEWS_hash)/" \ + $(srcdir)/cfg.mk + +# Ensure that we use only the standard $(VAR) notation, +# not @...@ in Makefile.am, now that we can rely on automake +# to emit a definition for each substituted variable. +# However, there is still one case in which @VAR@ use is not just +# legitimate, but actually required: when augmenting an automake-defined +# variable with a prefix. For example, gettext uses this: +# MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@ +# otherwise, makeinfo would put German or French (current locale) +# navigation hints in the otherwise-English documentation. +# +# Allow the package to add exceptions via a hook in cfg.mk; +# for example, @PRAGMA_SYSTEM_HEADER@ can be permitted by +# setting this to ' && !/PRAGMA_SYSTEM_HEADER/'. +_makefile_at_at_check_exceptions ?= +sc_makefile_at_at_check: + @perl -ne '/\@\w+\@/' \ + -e ' && !/(\w+)\s+=.*\@\1\@$$/' \ + -e ''$(_makefile_at_at_check_exceptions) \ + -e 'and (print "$$ARGV:$$.: $$_"), $$m=1; END {exit !$$m}' \ + $$($(VC_LIST_EXCEPT) | grep -E '(^|/)(Makefile\.am|[^/]+\.mk)$$') \ + && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || : + +news-check: NEWS + $(AM_V_GEN)if $(SED) -n $(news-check-lines-spec)p $< \ + | grep -E $(news-check-regexp) >/dev/null; then \ + :; \ + else \ + echo 'NEWS: $$(news-check-regexp) failed to match' 1>&2; \ + exit 1; \ + fi + +sc_makefile_TAB_only_indentation: + @prohibit='^ [ ]{8}' \ + in_vc_files='akefile|\.mk$$' \ + halt='found TAB-8-space indentation' \ + $(_sc_search_regexp) + +sc_m4_quote_check: + @prohibit='(AC_DEFINE(_UNQUOTED)?|AC_DEFUN)\([^[]' \ + in_vc_files='(^configure\.ac|\.m4)$$' \ + halt='quote the first arg to AC_DEF*' \ + $(_sc_search_regexp) + +fix_po_file_diag = \ +'you have changed the set of files with translatable diagnostics;\n\ +apply the above patch\n' + +# Generate a list of files in which to search for translatable strings. +perl_translatable_files_list_ = \ + -e 'foreach $$file (@ARGV) {' \ + -e ' \# Consider only file extensions with one or two letters' \ + -e ' $$file =~ /\...?$$/ or next;' \ + -e ' \# Ignore m4 and mk files' \ + -e ' $$file =~ /\.m[4k]$$/ and next;' \ + -e ' \# Ignore a .c or .h file with a corresponding .l or .y file' \ + -e ' $$file =~ /(.+)\.[ch]$$/ && (-e "$${1}.l" || -e "$${1}.y")' \ + -e ' and next;' \ + -e ' \# Skip unreadable files' \ + -e ' -r $$file or next;' \ + -e ' print "$$file ";' \ + -e '}' + +# Verify that all source files using _() (more specifically, files that +# match $(_gl_translatable_string_re)) are listed in po/POTFILES.in. +po_file ?= $(srcdir)/po/POTFILES.in +generated_files ?= $(srcdir)/lib/*.[ch] +_gl_translatable_string_re ?= \b(N?_|gettext *)\([^)"]*("|$$) +sc_po_check: + @if test -f $(po_file); then \ + grep -E -v '^(#|$$)' $(po_file) \ + | grep -v '^src/false\.c$$' | sort > $@-1; \ + files=$$(perl $(perl_translatable_files_list_) \ + $$($(VC_LIST_EXCEPT)) $(generated_files)); \ + grep -E -l '$(_gl_translatable_string_re)' $$files \ + | $(SED) 's|^$(_dot_escaped_srcdir)/||' | sort -u > $@-2; \ + diff -u -L $(po_file) -L $(po_file) $@-1 $@-2 \ + || { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; }; \ + rm -f $@-1 $@-2; \ + fi + +# Sometimes it is useful to change the PATH environment variable +# in Makefiles. When doing so, it's better not to use the Unix-centric +# path separator of ':', but rather the automake-provided '$(PATH_SEPARATOR)'. +msg = 'Do not use ":" above; use $$(PATH_SEPARATOR) instead' +sc_makefile_path_separator_check: + @prohibit='PATH[=].*:' \ + in_vc_files='akefile|\.mk$$' \ + halt=$(msg) \ + $(_sc_search_regexp) + +# Check that 'make alpha' will not fail at the end of the process, +# i.e., when pkg-M.N.tar.xz already exists (either in "." or in ../release) +# and is read-only. +writable-files: + $(AM_V_GEN)if test -d $(release_archive_dir); then \ + for file in $(DIST_ARCHIVES); do \ + for p in ./ $(release_archive_dir)/; do \ + test -e $$p$$file || continue; \ + test -w $$p$$file \ + || { echo ERROR: $$p$$file is not writable; fail=1; }; \ + done; \ + done; \ + test "$$fail" && exit 1 || : ; \ + else :; \ + fi + +v_etc_file = $(gnulib_dir)/lib/version-etc.c +sample-test = tests/sample-test +texi = doc/$(PACKAGE).texi +# Make sure that the copyright date in $(v_etc_file) is up to date. +# Do the same for the $(sample-test) and the main doc/.texi file. +sc_copyright_check: + @require='enum { COPYRIGHT_YEAR = '$$(date +%Y)' };' \ + in_files=$(v_etc_file) \ + halt='out of date copyright in $(v_etc_file); update it' \ + $(_sc_search_regexp) + @require='# Copyright \(C\) '$$(date +%Y)' Free' \ + in_vc_files=$(sample-test) \ + halt='out of date copyright in $(sample-test); update it' \ + $(_sc_search_regexp) + @require='Copyright @copyright\{\} .*'$$(date +%Y) \ + in_vc_files=$(texi) \ + halt='out of date copyright in $(texi); update it' \ + $(_sc_search_regexp) + +# If tests/help-version exists and seems to be new enough, assume that its +# use of init.sh and path_prepend_ is correct, and ensure that every other +# use of init.sh is identical. +# This is useful because help-version cross-checks prog --version +# with $(VERSION), which verifies that its path_prepend_ invocation +# sets PATH correctly. This is an inexpensive way to ensure that +# the other init.sh-using tests also get it right. +_hv_file ?= $(srcdir)/tests/help-version +_hv_regex_weak ?= ^ *\. .*/init\.sh" +# Fix syntax-highlighters " +_hv_regex_strong ?= ^ *\. "\$${srcdir=\.}/init\.sh" +sc_cross_check_PATH_usage_in_tests: + @if test -f $(_hv_file); then \ + grep -l 'VERSION mismatch' $(_hv_file) >/dev/null \ + || { echo "$@: skipped: no such file: $(_hv_file)" 1>&2; \ + exit 0; }; \ + grep -lE '$(_hv_regex_strong)' $(_hv_file) >/dev/null \ + || { echo "$@: $(_hv_file) lacks conforming use of init.sh" 1>&2; \ + exit 1; }; \ + good=$$(grep -E '$(_hv_regex_strong)' $(_hv_file)); \ + grep -LFx "$$good" \ + $$(grep -lE '$(_hv_regex_weak)' $$($(VC_LIST_EXCEPT))) \ + | grep . && \ + { echo "$(ME): the above files use path_prepend_ inconsistently" \ + 1>&2; exit 1; } || :; \ + fi + +# BRE regex of file contents to identify a test script. +_test_script_regex ?= \<init\.sh\> + +# In tests, use "compare expected actual", not the reverse. +sc_prohibit_reversed_compare_failure: + @prohibit='\<compare [^ ]+ ([^ ]*exp|/dev/null)' \ + containing='$(_test_script_regex)' \ + halt='reversed compare arguments' \ + $(_sc_search_regexp) + +# #if HAVE_... will evaluate to false for any non numeric string. +# That would be flagged by using -Wundef, however gnulib currently +# tests many undefined macros, and so we can't enable that option. +# So at least preclude common boolean strings as macro values. +sc_Wundef_boolean: + @prohibit='^#define.*(yes|no|true|false)$$' \ + in_files='$(CONFIG_INCLUDE)' \ + halt='Use 0 or 1 for macro values' \ + $(_sc_search_regexp) + +# Even if you use pathmax.h to guarantee that PATH_MAX is defined, it might +# not be constant, or might overflow a stack. In general, use PATH_MAX as +# a limit, not an array or alloca size. +sc_prohibit_path_max_allocation: + @prohibit='(\balloca *\([^)]*|\[[^]]*)\bPATH_MAX' \ + halt='Avoid stack allocations of size PATH_MAX' \ + $(_sc_search_regexp) + +sc_vulnerable_makefile_CVE-2009-4029: + @prohibit='perm -777 -exec chmod a\+rwx|chmod 777 \$$\(distdir\)' \ + in_files='(^|/)Makefile\.in$$' \ + halt=$$(printf '%s\n' \ + 'the above files are vulnerable; beware of running' \ + ' "make dist*" rules, and upgrade to fixed automake' \ + ' see http://bugzilla.redhat.com/542609 for details') \ + $(_sc_search_regexp) + +sc_vulnerable_makefile_CVE-2012-3386: + @prohibit='chmod a\+w \$$\(distdir\)' \ + in_files='(^|/)Makefile\.in$$' \ + halt=$$(printf '%s\n' \ + 'the above files are vulnerable; beware of running' \ + ' "make distcheck", and upgrade to fixed automake' \ + ' see http://bugzilla.redhat.com/CVE-2012-3386 for details') \ + $(_sc_search_regexp) + +vc-diff-check: + $(AM_V_GEN)(unset CDPATH; cd $(srcdir) && $(VC) diff) > vc-diffs || : + $(AM_V_at)if test -s vc-diffs; then \ + cat vc-diffs; \ + echo "Some files are locally modified:" 1>&2; \ + exit 1; \ + else \ + rm vc-diffs; \ + fi + +rel-files = $(DIST_ARCHIVES) + +gnulib-version = $$(cd $(gnulib_dir) \ + && { git describe || git rev-parse --short=10 HEAD; } ) +bootstrap-tools ?= autoconf,automake,gnulib + +gpgv = $$(gpgv2 --version >/dev/null && echo gpgv2 || echo gpgv) +# If it's not already specified, derive the GPG key ID from +# the signed tag we've just applied to mark this release. +gpg_key_ID ?= \ + $$(cd $(srcdir) \ + && git cat-file tag v$(VERSION) \ + | $(gpgv) --status-fd 1 --keyring /dev/null - - 2>/dev/null \ + | awk '/^\[GNUPG:\] ERRSIG / {print $$3; exit}') + +translation_project_ ?= coordinator@translationproject.org + +# Make info-gnu the default only for a stable release. +announcement_Cc_stable = $(translation_project_), $(PACKAGE_BUGREPORT) +announcement_mail_headers_stable = \ + To: info-gnu@gnu.org \ + Cc: $(announcement_Cc_) \ + Mail-Followup-To: $(PACKAGE_BUGREPORT) + +announcement_Cc_alpha = $(translation_project_) +announcement_mail_headers_alpha = \ + To: $(PACKAGE_BUGREPORT) \ + Cc: $(announcement_Cc_) + +announcement_mail_Cc_beta = $(announcement_mail_Cc_alpha) +announcement_mail_headers_beta = $(announcement_mail_headers_alpha) + +announcement_mail_Cc_ ?= $(announcement_mail_Cc_$(release-type)) +announcement_mail_headers_ ?= $(announcement_mail_headers_$(release-type)) +announcement: NEWS ChangeLog $(rel-files) +# Not $(AM_V_GEN) since the output of this command serves as +# announcement message: it would start with " GEN announcement". + $(AM_V_at)$(srcdir)/$(_build-aux)/announce-gen \ + --mail-headers='$(announcement_mail_headers_)' \ + --release-type=$(release-type) \ + --package=$(PACKAGE) \ + --prev=$(PREV_VERSION) \ + --curr=$(VERSION) \ + --gpg-key-id=$(gpg_key_ID) \ + --srcdir=$(srcdir) \ + --news=$(srcdir)/NEWS \ + --bootstrap-tools=$(bootstrap-tools) \ + $$(case ,$(bootstrap-tools), in (*,gnulib,*) \ + echo --gnulib-version=$(gnulib-version);; esac) \ + --no-print-checksums \ + $(addprefix --url-dir=, $(url_dir_list)) + +.PHONY: release-commit +release-commit: + $(AM_V_GEN)cd $(srcdir) \ + && $(_build-aux)/do-release-commit-and-tag \ + -C $(abs_builddir) $(RELEASE) + +## ---------------- ## +## Updating files. ## +## ---------------- ## + +ftp-gnu = ftp://ftp.gnu.org/gnu +www-gnu = http://www.gnu.org + +upload_dest_dir_ ?= $(PACKAGE) +upload_command = \ + $(srcdir)/$(_build-aux)/gnupload $(GNUPLOADFLAGS) \ + --to $(gnu_rel_host):$(upload_dest_dir_) \ + $(rel-files) +emit_upload_commands: + @echo ===================================== + @echo ===================================== + @echo '$(upload_command)' + @echo '# send the ~/announce-$(my_distdir) e-mail' + @echo ===================================== + @echo ===================================== + +.PHONY: upload +upload: + $(AM_V_GEN)$(upload_command) + +define emit-commit-log + printf '%s\n' 'maint: post-release administrivia' '' \ + '* NEWS: Add header line for next release.' \ + '* .prev-version: Record previous version.' \ + '* cfg.mk (old_NEWS_hash): Auto-update.' +endef + +.PHONY: no-submodule-changes +no-submodule-changes: + $(AM_V_GEN)if test -d $(srcdir)/.git \ + && git --version >/dev/null 2>&1; then \ + diff=$$(cd $(srcdir) && git submodule -q foreach \ + git diff-index --name-only HEAD) \ + || exit 1; \ + case $$diff in '') ;; \ + *) echo '$(ME): submodule files are locally modified:'; \ + echo "$$diff"; exit 1;; esac; \ + else \ + : ; \ + fi + +submodule-checks ?= no-submodule-changes public-submodule-commit + +# Ensure that each sub-module commit we're using is public. +# Without this, it is too easy to tag and release code that +# cannot be built from a fresh clone. +.PHONY: public-submodule-commit +public-submodule-commit: + $(AM_V_GEN)if test -d $(srcdir)/.git \ + && git --version >/dev/null 2>&1; then \ + cd $(srcdir) && \ + git submodule --quiet foreach \ + 'test "$$(git rev-parse "$$sha1")" \ + = "$$(git merge-base origin "$$sha1")"' \ + || { echo '$(ME): found non-public submodule commit' >&2; \ + exit 1; }; \ + else \ + : ; \ + fi +# This rule has a high enough utility/cost ratio that it should be a +# dependent of "check" by default. However, some of us do occasionally +# commit a temporary change that deliberately points to a non-public +# submodule commit, and want to be able to use rules like "make check". +# In that case, run e.g., "make check gl_public_submodule_commit=" +# to disable this test. +gl_public_submodule_commit ?= public-submodule-commit +check: $(gl_public_submodule_commit) + +.PHONY: alpha beta stable release +ALL_RECURSIVE_TARGETS += alpha beta stable +alpha beta stable: $(local-check) writable-files $(submodule-checks) + $(AM_V_GEN)test $@ = stable \ + && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \ + || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\ + || : + $(AM_V_at)$(MAKE) vc-diff-check + $(AM_V_at)$(MAKE) news-check + $(AM_V_at)$(MAKE) distcheck + $(AM_V_at)$(MAKE) dist + $(AM_V_at)$(MAKE) $(release-prep-hook) RELEASE_TYPE=$@ + $(AM_V_at)$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@ + +release: + $(AM_V_GEN)$(MAKE) _version + $(AM_V_GEN)$(MAKE) $(release-type) + +# Override this in cfg.mk if you follow different procedures. +release-prep-hook ?= release-prep + +gl_noteworthy_news_ = * Noteworthy changes in release ?.? (????-??-??) [?] +.PHONY: release-prep +release-prep: + $(AM_V_GEN)$(MAKE) --no-print-directory -s announcement \ + > ~/announce-$(my_distdir) + $(AM_V_at)if test -d $(release_archive_dir); then \ + ln $(rel-files) $(release_archive_dir); \ + chmod a-w $(rel-files); \ + fi + $(AM_V_at)echo $(VERSION) > $(prev_version_file) + $(AM_V_at)$(MAKE) update-NEWS-hash + $(AM_V_at)perl -pi \ + -e '$$. == 3 and print "$(gl_noteworthy_news_)\n\n\n"' \ + $(srcdir)/NEWS + $(AM_V_at)msg=$$($(emit-commit-log)) || exit 1; \ + cd $(srcdir) && $(VC) commit -m "$$msg" -a + +# Override this with e.g., -s $(srcdir)/some_other_name.texi +# if the default $(PACKAGE)-derived name doesn't apply. +gendocs_options_ ?= + +.PHONY: web-manual +web-manual: + $(AM_V_GEN)test -z "$(manual_title)" \ + && { echo define manual_title in cfg.mk 1>&2; exit 1; } || : + $(AM_V_at)cd '$(srcdir)/doc'; \ + $(SHELL) ../$(_build-aux)/gendocs.sh $(gendocs_options_) \ + -o '$(abs_builddir)/doc/manual' \ + --email $(PACKAGE_BUGREPORT) $(PACKAGE) \ + "$(PACKAGE_NAME) - $(manual_title)" + $(AM_V_at)echo " *** Upload the doc/manual directory to web-cvs." + +.PHONY: web-manual-update +web-manual-update: + $(AM_V_GEN)cd $(srcdir) \ + && $(_build-aux)/gnu-web-doc-update -C $(abs_builddir) + + +# Code Coverage + +init-coverage: + $(MAKE) $(AM_MAKEFLAGS) clean + lcov --directory . --zerocounters + +COVERAGE_CCOPTS ?= "-g --coverage" +COVERAGE_OUT ?= doc/coverage + +build-coverage: + $(MAKE) $(AM_MAKEFLAGS) CFLAGS=$(COVERAGE_CCOPTS) CXXFLAGS=$(COVERAGE_CCOPTS) + $(MAKE) $(AM_MAKEFLAGS) CFLAGS=$(COVERAGE_CCOPTS) CXXFLAGS=$(COVERAGE_CCOPTS) check + mkdir -p $(COVERAGE_OUT) + lcov --directory . --output-file $(COVERAGE_OUT)/$(PACKAGE).info \ + --capture + +gen-coverage: + genhtml --output-directory $(COVERAGE_OUT) \ + $(COVERAGE_OUT)/$(PACKAGE).info \ + --highlight --frames --legend \ + --title "$(PACKAGE_NAME)" + +coverage: + $(MAKE) init-coverage + $(MAKE) build-coverage + $(MAKE) gen-coverage + +# Some projects carry local adjustments for gnulib modules via patches in +# a gnulib patch directory whose default name is gl/ (defined in bootstrap +# via local_gl_dir=gl). Those patches become stale as the originals evolve +# in gnulib. Use this rule to refresh any stale patches. It applies each +# patch to the original in $(gnulib_dir) and uses the temporary result to +# generate a fuzz-free .diff file. If you customize the name of your local +# gnulib patch directory via bootstrap.conf, this rule detects that name. +# Run this from a non-VPATH (i.e., srcdir) build directory. +.PHONY: refresh-gnulib-patches +refresh-gnulib-patches: + gl=gl; \ + if test -f bootstrap.conf; then \ + t=$$(perl -lne '/^\s*local_gl_dir=(\S+)/ and $$d=$$1;' \ + -e 'END{defined $$d and print $$d}' bootstrap.conf); \ + test -n "$$t" && gl=$$t; \ + fi; \ + for diff in $$(cd $$gl; git ls-files | grep '\.diff$$'); do \ + b=$$(printf %s "$$diff"|$(SED) 's/\.diff$$//'); \ + VERSION_CONTROL=none \ + patch "$(gnulib_dir)/$$b" "$$gl/$$diff" || exit 1; \ + ( cd $(gnulib_dir) || exit 1; \ + git diff "$$b" > "../$$gl/$$diff"; \ + git checkout $$b ) || exit 1; \ + done + +# Update gettext files. +PACKAGE ?= $(shell basename $(PWD)) +PO_DOMAIN ?= $(PACKAGE) +POURL = http://translationproject.org/latest/$(PO_DOMAIN)/ +PODIR ?= po +refresh-po: + rm -f $(PODIR)/*.po && \ + echo "$(ME): getting translations into po (please ignore the robots.txt ERROR 404)..." && \ + wget --no-verbose --directory-prefix $(PODIR) --no-directories --recursive --level 1 --accept .po --accept .po.1 $(POURL) && \ + echo 'en@boldquot' > $(PODIR)/LINGUAS && \ + echo 'en@quot' >> $(PODIR)/LINGUAS && \ + ls $(PODIR)/*.po | $(SED) 's/\.po//;s,$(PODIR)/,,' | \ + sort >> $(PODIR)/LINGUAS + + # Running indent once is not idempotent, but running it twice is. +INDENT_SOURCES ?= $(C_SOURCES) +.PHONY: indent +indent: + indent $(INDENT_SOURCES) + indent $(INDENT_SOURCES) + +# If you want to set UPDATE_COPYRIGHT_* environment variables, +# put the assignments in this variable. +update-copyright-env ?= + +# Run this rule once per year (usually early in January) +# to update all FSF copyright year lists in your project. +# If you have an additional project-specific rule, +# add it in cfg.mk along with a line 'update-copyright: prereq'. +# By default, exclude all variants of COPYING; you can also +# add exemptions (such as ChangeLog..* for rotated change logs) +# in the file .x-update-copyright. +.PHONY: update-copyright +update-copyright: + $(AM_V_GEN)grep -l -w Copyright \ + $$(export VC_LIST_EXCEPT_DEFAULT=COPYING && $(VC_LIST_EXCEPT)) \ + | $(update-copyright-env) xargs $(srcdir)/$(_build-aux)/$@ + +# This tight_scope test is skipped with a warning if $(_gl_TS_headers) is not +# overridden and $(_gl_TS_dir)/Makefile.am does not mention noinst_HEADERS. + +# NOTE: to override any _gl_TS_* default value, you must +# define the variable(s) using "export" in cfg.mk. +_gl_TS_dir ?= src + +ALL_RECURSIVE_TARGETS += sc_tight_scope +sc_tight_scope: tight-scope.mk + @fail=0; \ + if ! grep '^ *export _gl_TS_headers *=' $(srcdir)/cfg.mk \ + > /dev/null \ + && ! grep -w noinst_HEADERS $(srcdir)/$(_gl_TS_dir)/Makefile.am \ + > /dev/null 2>&1; then \ + echo '$(ME): skipping $@'; \ + else \ + $(MAKE) -s -C $(_gl_TS_dir) \ + -f Makefile \ + -f $(abs_top_srcdir)/cfg.mk \ + -f $(abs_top_builddir)/$< \ + _gl_tight_scope \ + || fail=1; \ + fi; \ + rm -f $<; \ + exit $$fail + +tight-scope.mk: $(ME) + @rm -f $@ $@-t + @perl -ne '/^# TS-start/.../^# TS-end/ and print' $(srcdir)/$(ME) > $@-t + @chmod a=r $@-t && mv $@-t $@ + +ifeq (a,b) +# TS-start + +# Most functions should have static scope. +# Any that don't must be marked with 'extern', but 'main' +# and 'usage' are exceptions: they're always extern, but +# do not need to be marked. Symbols matching '__.*' are +# reserved by the compiler, so are automatically excluded below. +_gl_TS_unmarked_extern_functions ?= main usage +_gl_TS_function_match ?= /^(?:$(_gl_TS_extern)) +.*?(\w+) *\(/ + +# If your project uses a macro like "XTERN", then put +# the following in cfg.mk to override this default: +# export _gl_TS_extern = extern|XTERN +_gl_TS_extern ?= extern + +# The second nm|grep checks for file-scope variables with 'extern' scope. +# Without gnulib's progname module, you might put program_name here. +# Symbols matching '__.*' are reserved by the compiler, +# so are automatically excluded below. +_gl_TS_unmarked_extern_vars ?= + +# NOTE: the _match variables are perl expressions -- not mere regular +# expressions -- so that you can extend them to match other patterns +# and easily extract matched variable names. +# For example, if your project declares some global variables via +# a macro like this: GLOBAL(type, var_name, initializer), then you +# can override this definition to automatically extract those names: +# export _gl_TS_var_match = \ +# /^(?:$(_gl_TS_extern)) .*?\**(\w+)(\[.*?\])?;/ || /\bGLOBAL\(.*?,\s*(.*?),/ +_gl_TS_var_match ?= /^(?:$(_gl_TS_extern)) .*?(\w+)(\[.*?\])?;/ + +# The names of object files in (or relative to) $(_gl_TS_dir). +_gl_TS_obj_files ?= *.$(OBJEXT) + +# Files in which to search for the one-line style extern declarations. +# $(_gl_TS_dir)-relative. +_gl_TS_headers ?= $(noinst_HEADERS) +_gl_TS_other_headers ?= *.h + +.PHONY: _gl_tight_scope +_gl_tight_scope: $(bin_PROGRAMS) + sed_wrap='s/^/^_?/;s/$$/$$/'; \ + t=exceptions-$$$$; \ + trap 's=$$?; rm -f $$t; exit $$s' 0; \ + for sig in 1 2 3 13 15; do \ + eval "trap 'v=`expr $$sig + 128`; (exit $$v); exit $$v' $$sig"; \ + done; \ + src=`for f in $(SOURCES); do \ + test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \ + hdr=`for f in $(_gl_TS_headers); do \ + test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \ + ( printf '%s\n' '__.*' $(_gl_TS_unmarked_extern_functions); \ + grep -h -A1 '^extern .*[^;]$$' $$src \ + | grep -vE '^(extern |--|#)' | $(SED) 's/ .*//; /^$$/d'; \ + perl -lne \ + '$(_gl_TS_function_match) and print $$1' $$hdr; \ + ) | sort -u | $(SED) "$$sed_wrap" > $$t; \ + nm -g $(_gl_TS_obj_files)|$(SED) -n 's/.* T //p'|grep -Ev -f $$t \ + && { echo the above functions should have static scope >&2; \ + exit 1; } || : ; \ + ( printf '%s\n' '__.*' main $(_gl_TS_unmarked_extern_vars); \ + perl -lne '$(_gl_TS_var_match) and print $$1' \ + $$hdr $(_gl_TS_other_headers) \ + ) | sort -u | $(SED) "$$sed_wrap" > $$t; \ + nm -g $(_gl_TS_obj_files) | $(SED) -n 's/.* [BCDGRS] //p' \ + | sort -u | grep -Ev -f $$t \ + && { echo the above variables should have static scope >&2; \ + exit 1; } || : +# TS-end +endif diff --git a/local/recipes/tools/diffutils/source/man/Makefile.am b/local/recipes/tools/diffutils/source/man/Makefile.am new file mode 100644 index 0000000000..98bfb4bd31 --- /dev/null +++ b/local/recipes/tools/diffutils/source/man/Makefile.am @@ -0,0 +1,39 @@ +# Automakefile for GNU diffutils man pages + +# Copyright (C) 2002, 2009-2013, 2015-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +dist_man1_MANS = cmp.1 diff.1 diff3.1 sdiff.1 +EXTRA_DIST = $(dist_man1_MANS:%.1=%.x) help2man +MAINTAINERCLEANFILES = $(dist_man1_MANS) + +S = $(top_srcdir)/src +cmp.1: $S/cmp.c cmp.x +diff.1: $S/diff.c diff.x +diff3.1: $S/diff3.c diff3.x +sdiff.1: $S/sdiff.c sdiff.x + +# Directory in which just-built programs reside. It is used +# to ensure help2man invokes them via the use of PATH below. +bin_dir = ../src + +# Depend on the former to get version number changes. +$(dist_man1_MANS): $(SRC_VERSION_C) help2man + $(AM_V_GEN)base=`expr $@ : '\(.*\).1'` \ + && test -x $(bin_dir)/$$base \ + && (echo '[NAME]' && sed 's@/\* *@@; s/-/\\-/; q' $S/$$base.c) \ + | PATH="$(bin_dir)$(PATH_SEPARATOR)$$PATH" \ + $(srcdir)/help2man -i - -i $(srcdir)/$$base.x \ + -S '$(PACKAGE) $(VERSION)' $$base > $@-t && mv $@-t $@ diff --git a/local/recipes/tools/diffutils/source/man/Makefile.in b/local/recipes/tools/diffutils/source/man/Makefile.in new file mode 100644 index 0000000000..41be650988 --- /dev/null +++ b/local/recipes/tools/diffutils/source/man/Makefile.in @@ -0,0 +1,1497 @@ +# Makefile.in generated by automake 1.18.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2025 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Automakefile for GNU diffutils man pages + +# Copyright (C) 2002, 2009-2013, 2015-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +am__rm_f = rm -f $(am__rm_f_notfound) +am__rm_rf = rm -rf $(am__rm_f_notfound) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = man +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ + $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \ + $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/btowc.m4 \ + $(top_srcdir)/m4/builtin-expect.m4 $(top_srcdir)/m4/c-stack.m4 \ + $(top_srcdir)/m4/clock_time.m4 $(top_srcdir)/m4/close.m4 \ + $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \ + $(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/ctype.m4 \ + $(top_srcdir)/m4/dirname.m4 \ + $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/extensions.m4 \ + $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fcntl-o.m4 \ + $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/filenamecat.m4 \ + $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \ + $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpieee.m4 \ + $(top_srcdir)/m4/freopen.m4 $(top_srcdir)/m4/fstat.m4 \ + $(top_srcdir)/m4/ftruncate.m4 $(top_srcdir)/m4/getcwd.m4 \ + $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/getpagesize.m4 \ + $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnu-make.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 \ + $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \ + $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \ + $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttostr.m4 \ + $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \ + $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \ + $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/iswblank.m4 \ + $(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ + $(top_srcdir)/m4/libunistring-base.m4 \ + $(top_srcdir)/m4/limits-h.m4 $(top_srcdir)/m4/localcharset.m4 \ + $(top_srcdir)/m4/locale-fr.m4 $(top_srcdir)/m4/locale-ja.m4 \ + $(top_srcdir)/m4/locale-tr.m4 $(top_srcdir)/m4/locale-zh.m4 \ + $(top_srcdir)/m4/locale_h.m4 $(top_srcdir)/m4/localeconv.m4 \ + $(top_srcdir)/m4/localtime-buffer.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ + $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/mbchar.m4 \ + $(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbslen.m4 \ + $(top_srcdir)/m4/mbsrtowcs.m4 $(top_srcdir)/m4/mbstate_t.m4 \ + $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \ + $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mkstemp.m4 \ + $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/mmap-anon.m4 \ + $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \ + $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \ + $(top_srcdir)/m4/nanosleep.m4 $(top_srcdir)/m4/netinet_in_h.m4 \ + $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \ + $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ + $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \ + $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/regex.m4 \ + $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/setlocale.m4 \ + $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/signalblocking.m4 \ + $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/socketlib.m4 \ + $(top_srcdir)/m4/sockets.m4 $(top_srcdir)/m4/socklen.m4 \ + $(top_srcdir)/m4/sockpfaf.m4 $(top_srcdir)/m4/ssize_t.m4 \ + $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \ + $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \ + $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/strcase.m4 $(top_srcdir)/m4/strerror.m4 \ + $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/strftime.m4 \ + $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strings_h.m4 \ + $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ + $(top_srcdir)/m4/strptime.m4 $(top_srcdir)/m4/strtoull.m4 \ + $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/symlink.m4 \ + $(top_srcdir)/m4/sys_ioctl_h.m4 \ + $(top_srcdir)/m4/sys_select_h.m4 \ + $(top_srcdir)/m4/sys_socket_h.m4 \ + $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ + $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \ + $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \ + $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \ + $(top_srcdir)/m4/time_rz.m4 $(top_srcdir)/m4/timegm.m4 \ + $(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \ + $(top_srcdir)/m4/tzset.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vararrays.m4 \ + $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vasprintf.m4 \ + $(top_srcdir)/m4/version-etc.m4 \ + $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \ + $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ + $(top_srcdir)/m4/wctomb.m4 $(top_srcdir)/m4/wctype_h.m4 \ + $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \ + $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xstrtol.m4 \ + $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/lib/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ + } +man1dir = $(mandir)/man1 +am__installdirs = "$(DESTDIR)$(man1dir)" +NROFF = nroff +MANS = $(dist_man1_MANS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(dist_man1_MANS) $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkglibexecdir = @pkglibexecdir@ +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_INCLUDE = @CONFIG_INCLUDE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ +EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ +ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ +ENOLINK_VALUE = @ENOLINK_VALUE@ +EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ +EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ +ERRNO_H = @ERRNO_H@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FLOAT_H = @FLOAT_H@ +FNMATCH_H = @FNMATCH_H@ +GETOPT_CDEFS_H = @GETOPT_CDEFS_H@ +GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIBC21 = @GLIBC21@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ +GNULIB_CHDIR = @GNULIB_CHDIR@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_CTIME = @GNULIB_CTIME@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ +GNULIB_DUP = @GNULIB_DUP@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_DUP3 = @GNULIB_DUP3@ +GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ +GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ +GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ +GNULIB_FCNTL = @GNULIB_FCNTL@ +GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ +GNULIB_FDOPEN = @GNULIB_FDOPEN@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FFS = @GNULIB_FFS@ +GNULIB_FFSL = @GNULIB_FFSL@ +GNULIB_FFSLL = @GNULIB_FFSLL@ +GNULIB_FGETC = @GNULIB_FGETC@ +GNULIB_FGETS = @GNULIB_FGETS@ +GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPURGE = @GNULIB_FPURGE@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ +GNULIB_FREAD = @GNULIB_FREAD@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ +GNULIB_FSCANF = @GNULIB_FSCANF@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSTAT = @GNULIB_FSTAT@ +GNULIB_FSTATAT = @GNULIB_FSTATAT@ +GNULIB_FSYNC = @GNULIB_FSYNC@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETC = @GNULIB_GETC@ +GNULIB_GETCHAR = @GNULIB_GETCHAR@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ +GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ +GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ +GNULIB_GRANTPT = @GNULIB_GRANTPT@ +GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ +GNULIB_ICONV = @GNULIB_ICONV@ +GNULIB_IMAXABS = @GNULIB_IMAXABS@ +GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ +GNULIB_IOCTL = @GNULIB_IOCTL@ +GNULIB_ISATTY = @GNULIB_ISATTY@ +GNULIB_ISBLANK = @GNULIB_ISBLANK@ +GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ +GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LINKAT = @GNULIB_LINKAT@ +GNULIB_LISTEN = @GNULIB_LISTEN@ +GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ +GNULIB_LOCALTIME = @GNULIB_LOCALTIME@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MBTOWC = @GNULIB_MBTOWC@ +GNULIB_MEMCHR = @GNULIB_MEMCHR@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKFIFO = @GNULIB_MKFIFO@ +GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ +GNULIB_MKNOD = @GNULIB_MKNOD@ +GNULIB_MKNODAT = @GNULIB_MKNODAT@ +GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ +GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ +GNULIB_MKTIME = @GNULIB_MKTIME@ +GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ +GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ +GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_OPENAT = @GNULIB_OPENAT@ +GNULIB_OVERRIDES_STRUCT_STAT = @GNULIB_OVERRIDES_STRUCT_STAT@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ +GNULIB_PCLOSE = @GNULIB_PCLOSE@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PIPE = @GNULIB_PIPE@ +GNULIB_PIPE2 = @GNULIB_PIPE2@ +GNULIB_POPEN = @GNULIB_POPEN@ +GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ +GNULIB_PREAD = @GNULIB_PREAD@ +GNULIB_PRINTF = @GNULIB_PRINTF@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PSELECT = @GNULIB_PSELECT@ +GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ +GNULIB_PTSNAME = @GNULIB_PTSNAME@ +GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ +GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ +GNULIB_RAISE = @GNULIB_RAISE@ +GNULIB_RANDOM = @GNULIB_RANDOM@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ +GNULIB_READ = @GNULIB_READ@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_READLINKAT = @GNULIB_READLINKAT@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_REALPATH = @GNULIB_REALPATH@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ +GNULIB_REMOVE = @GNULIB_REMOVE@ +GNULIB_RENAME = @GNULIB_RENAME@ +GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ +GNULIB_RMDIR = @GNULIB_RMDIR@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SCANF = @GNULIB_SCANF@ +GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ +GNULIB_SELECT = @GNULIB_SELECT@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ +GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ +GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ +GNULIB_SIGACTION = @GNULIB_SIGACTION@ +GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ +GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STAT = @GNULIB_STAT@ +GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ +GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ +GNULIB_STRFTIME = @GNULIB_STRFTIME@ +GNULIB_STRNCAT = @GNULIB_STRNCAT@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRPTIME = @GNULIB_STRPTIME@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ +GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ +GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ +GNULIB_SYMLINK = @GNULIB_SYMLINK@ +GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ +GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ +GNULIB_TIMEGM = @GNULIB_TIMEGM@ +GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ +GNULIB_TMPFILE = @GNULIB_TMPFILE@ +GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ +GNULIB_TRUNCATE = @GNULIB_TRUNCATE@ +GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ +GNULIB_TZSET = @GNULIB_TZSET@ +GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ +GNULIB_UNLINK = @GNULIB_UNLINK@ +GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ +GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ +GNULIB_USLEEP = @GNULIB_USLEEP@ +GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VFSCANF = @GNULIB_VFSCANF@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSCANF = @GNULIB_VSCANF@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WAITPID = @GNULIB_WAITPID@ +GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@ +GNULIB_WCPCPY = @GNULIB_WCPCPY@ +GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ +GNULIB_WCSCAT = @GNULIB_WCSCAT@ +GNULIB_WCSCHR = @GNULIB_WCSCHR@ +GNULIB_WCSCMP = @GNULIB_WCSCMP@ +GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ +GNULIB_WCSCPY = @GNULIB_WCSCPY@ +GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ +GNULIB_WCSDUP = @GNULIB_WCSDUP@ +GNULIB_WCSFTIME = @GNULIB_WCSFTIME@ +GNULIB_WCSLEN = @GNULIB_WCSLEN@ +GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ +GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ +GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ +GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ +GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ +GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCSSPN = @GNULIB_WCSSPN@ +GNULIB_WCSSTR = @GNULIB_WCSSTR@ +GNULIB_WCSTOK = @GNULIB_WCSTOK@ +GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ +GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ +GNULIB_WCTOB = @GNULIB_WCTOB@ +GNULIB_WCTOMB = @GNULIB_WCTOMB@ +GNULIB_WCTRANS = @GNULIB_WCTRANS@ +GNULIB_WCTYPE = @GNULIB_WCTYPE@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ +GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ +GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ +GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ +GNULIB_WMEMSET = @GNULIB_WMEMSET@ +GNULIB_WRITE = @GNULIB_WRITE@ +GNULIB__EXIT = @GNULIB__EXIT@ +HAVE_ACCEPT4 = @HAVE_ACCEPT4@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ +HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ +HAVE_CHOWN = @HAVE_CHOWN@ +HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ +HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ +HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ +HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ +HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ +HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ +HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ +HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_DUP3 = @HAVE_DUP3@ +HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_FACCESSAT = @HAVE_FACCESSAT@ +HAVE_FCHDIR = @HAVE_FCHDIR@ +HAVE_FCHMODAT = @HAVE_FCHMODAT@ +HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FCNTL = @HAVE_FCNTL@ +HAVE_FDATASYNC = @HAVE_FDATASYNC@ +HAVE_FEATURES_H = @HAVE_FEATURES_H@ +HAVE_FFS = @HAVE_FFS@ +HAVE_FFSL = @HAVE_FFSL@ +HAVE_FFSLL = @HAVE_FFSLL@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSTATAT = @HAVE_FSTATAT@ +HAVE_FSYNC = @HAVE_FSYNC@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_FUTIMENS = @HAVE_FUTIMENS@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETGROUPS = @HAVE_GETGROUPS@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ +HAVE_GETLOGIN = @HAVE_GETLOGIN@ +HAVE_GETOPT_H = @HAVE_GETOPT_H@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ +HAVE_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISBLANK = @HAVE_ISBLANK@ +HAVE_ISWBLANK = @HAVE_ISWBLANK@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ +HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ +HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ +HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ +HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LCHOWN = @HAVE_LCHOWN@ +HAVE_LIBSIGSEGV = @HAVE_LIBSIGSEGV@ +HAVE_LINK = @HAVE_LINK@ +HAVE_LINKAT = @HAVE_LINKAT@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSLEN = @HAVE_MBSLEN@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ +HAVE_MEMCHR = @HAVE_MEMCHR@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDIRAT = @HAVE_MKDIRAT@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_MKFIFO = @HAVE_MKFIFO@ +HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ +HAVE_MKNOD = @HAVE_MKNOD@ +HAVE_MKNODAT = @HAVE_MKNODAT@ +HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ +HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ +HAVE_MKSTEMP = @HAVE_MKSTEMP@ +HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ +HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ +HAVE_OPENAT = @HAVE_OPENAT@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_PCLOSE = @HAVE_PCLOSE@ +HAVE_PIPE = @HAVE_PIPE@ +HAVE_PIPE2 = @HAVE_PIPE2@ +HAVE_POPEN = @HAVE_POPEN@ +HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ +HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_PREAD = @HAVE_PREAD@ +HAVE_PSELECT = @HAVE_PSELECT@ +HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ +HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ +HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ +HAVE_RAISE = @HAVE_RAISE@ +HAVE_RANDOM = @HAVE_RANDOM@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_READLINKAT = @HAVE_READLINKAT@ +HAVE_REALPATH = @HAVE_REALPATH@ +HAVE_RENAMEAT = @HAVE_RENAMEAT@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ +HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SIGACTION = @HAVE_SIGACTION@ +HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ +HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ +HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ +HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ +HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_SIGSET_T = @HAVE_SIGSET_T@ +HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STPCPY = @HAVE_STPCPY@ +HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ +HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRINGS_H = @HAVE_STRINGS_H@ +HAVE_STRPBRK = @HAVE_STRPBRK@ +HAVE_STRPTIME = @HAVE_STRPTIME@ +HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ +HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ +HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ +HAVE_SYMLINK = @HAVE_SYMLINK@ +HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@ +HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ +HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ +HAVE_TRUNCATE = @HAVE_TRUNCATE@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ +HAVE_TZSET = @HAVE_TZSET@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNLINKAT = @HAVE_UNLINKAT@ +HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_USLEEP = @HAVE_USLEEP@ +HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCHAR_T = @HAVE_WCHAR_T@ +HAVE_WCPCPY = @HAVE_WCPCPY@ +HAVE_WCPNCPY = @HAVE_WCPNCPY@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ +HAVE_WCSCAT = @HAVE_WCSCAT@ +HAVE_WCSCHR = @HAVE_WCSCHR@ +HAVE_WCSCMP = @HAVE_WCSCMP@ +HAVE_WCSCOLL = @HAVE_WCSCOLL@ +HAVE_WCSCPY = @HAVE_WCSCPY@ +HAVE_WCSCSPN = @HAVE_WCSCSPN@ +HAVE_WCSDUP = @HAVE_WCSDUP@ +HAVE_WCSFTIME = @HAVE_WCSFTIME@ +HAVE_WCSLEN = @HAVE_WCSLEN@ +HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ +HAVE_WCSNCAT = @HAVE_WCSNCAT@ +HAVE_WCSNCMP = @HAVE_WCSNCMP@ +HAVE_WCSNCPY = @HAVE_WCSNCPY@ +HAVE_WCSNLEN = @HAVE_WCSNLEN@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSPBRK = @HAVE_WCSPBRK@ +HAVE_WCSRCHR = @HAVE_WCSRCHR@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ +HAVE_WCSSPN = @HAVE_WCSSPN@ +HAVE_WCSSTR = @HAVE_WCSSTR@ +HAVE_WCSTOK = @HAVE_WCSTOK@ +HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ +HAVE_WCSXFRM = @HAVE_WCSXFRM@ +HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE_WMEMCHR = @HAVE_WMEMCHR@ +HAVE_WMEMCMP = @HAVE_WMEMCMP@ +HAVE_WMEMCPY = @HAVE_WMEMCPY@ +HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ +HAVE_WMEMSET = @HAVE_WMEMSET@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ +HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ +HAVE__BOOL = @HAVE__BOOL@ +HAVE__EXIT = @HAVE__EXIT@ +HELP2MAN = @HELP2MAN@ +ICONV_CONST = @ICONV_CONST@ +ICONV_H = @ICONV_H@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ +INET_PTON_LIB = @INET_PTON_LIB@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ +INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBCSTACK = @LIBCSTACK@ +LIBDIFFUTILS_LIBDEPS = @LIBDIFFUTILS_LIBDEPS@ +LIBDIFFUTILS_LTLIBDEPS = @LIBDIFFUTILS_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSIGSEGV = @LIBSIGSEGV@ +LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@ +LIBSOCKET = @LIBSOCKET@ +LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ +LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@ +LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@ +LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIB_NANOSLEEP = @LIB_NANOSLEEP@ +LIB_SELECT = @LIB_SELECT@ +LIMITS_H = @LIMITS_H@ +LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ +LTLIBCSTACK = @LTLIBCSTACK@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBSIGSEGV = @LTLIBSIGSEGV@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ +NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@ +NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ +NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ +NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@ +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ +NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ +NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ +NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ +NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ +NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ +NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ +NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@ +NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@ +NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ +NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ +NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ +NEXT_CTYPE_H = @NEXT_CTYPE_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_ICONV_H = @NEXT_ICONV_H@ +NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ +NEXT_LOCALE_H = @NEXT_LOCALE_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ +NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_STDARG_H = @NEXT_STDARG_H@ +NEXT_STDDEF_H = @NEXT_STDDEF_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ +NEXT_STDIO_H = @NEXT_STDIO_H@ +NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRINGS_H = @NEXT_STRINGS_H@ +NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@ +NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@ +NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ +NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ +NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ +NEXT_TIME_H = @NEXT_TIME_H@ +NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ +NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSUB = @POSUB@ +PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ +PR_PROGRAM = @PR_PROGRAM@ +PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ +REPLACE_CALLOC = @REPLACE_CALLOC@ +REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_CTIME = @REPLACE_CTIME@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ +REPLACE_DUP = @REPLACE_DUP@ +REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ +REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FCNTL = @REPLACE_FCNTL@ +REPLACE_FDOPEN = @REPLACE_FDOPEN@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FSTAT = @REPLACE_FSTAT@ +REPLACE_FSTATAT = @REPLACE_FSTATAT@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ +REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETDELIM = @REPLACE_GETDELIM@ +REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ +REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@ +REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_GMTIME = @REPLACE_GMTIME@ +REPLACE_ICONV = @REPLACE_ICONV@ +REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@ +REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@ +REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ +REPLACE_INET_PTON = @REPLACE_INET_PTON@ +REPLACE_IOCTL = @REPLACE_IOCTL@ +REPLACE_ISATTY = @REPLACE_ISATTY@ +REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ +REPLACE_ITOLD = @REPLACE_ITOLD@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LINK = @REPLACE_LINK@ +REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ +REPLACE_LOCALTIME = @REPLACE_LOCALTIME@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MALLOC = @REPLACE_MALLOC@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MBTOWC = @REPLACE_MBTOWC@ +REPLACE_MEMCHR = @REPLACE_MEMCHR@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKDIR = @REPLACE_MKDIR@ +REPLACE_MKFIFO = @REPLACE_MKFIFO@ +REPLACE_MKNOD = @REPLACE_MKNOD@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_MKTIME = @REPLACE_MKTIME@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ +REPLACE_NULL = @REPLACE_NULL@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ +REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POPEN = @REPLACE_POPEN@ +REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PSELECT = @REPLACE_PSELECT@ +REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ +REPLACE_PTSNAME = @REPLACE_PTSNAME@ +REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ +REPLACE_RAISE = @REPLACE_RAISE@ +REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ +REPLACE_READ = @REPLACE_READ@ +REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ +REPLACE_REALLOC = @REPLACE_REALLOC@ +REPLACE_REALPATH = @REPLACE_REALPATH@ +REPLACE_REMOVE = @REPLACE_REMOVE@ +REPLACE_RENAME = @REPLACE_RENAME@ +REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ +REPLACE_RMDIR = @REPLACE_RMDIR@ +REPLACE_SELECT = @REPLACE_SELECT@ +REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ +REPLACE_SLEEP = @REPLACE_SLEEP@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STAT = @REPLACE_STAT@ +REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ +REPLACE_STPNCPY = @REPLACE_STPNCPY@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ +REPLACE_STRDUP = @REPLACE_STRDUP@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ +REPLACE_STRFTIME = @REPLACE_STRFTIME@ +REPLACE_STRNCAT = @REPLACE_STRNCAT@ +REPLACE_STRNDUP = @REPLACE_STRNDUP@ +REPLACE_STRNLEN = @REPLACE_STRNLEN@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ +REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ +REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ +REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ +REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ +REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TMPFILE = @REPLACE_TMPFILE@ +REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ +REPLACE_TRUNCATE = @REPLACE_TRUNCATE@ +REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ +REPLACE_TZSET = @REPLACE_TZSET@ +REPLACE_UNLINK = @REPLACE_UNLINK@ +REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ +REPLACE_UNSETENV = @REPLACE_UNSETENV@ +REPLACE_USLEEP = @REPLACE_USLEEP@ +REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSFTIME = @REPLACE_WCSFTIME@ +REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ +REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCTOMB = @REPLACE_WCTOMB@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SRC_VERSION_C = @SRC_VERSION_C@ +STDALIGN_H = @STDALIGN_H@ +STDARG_H = @STDARG_H@ +STDBOOL_H = @STDBOOL_H@ +STDDEF_H = @STDDEF_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@ +SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ +UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ +UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WERROR_CFLAGS = @WERROR_CFLAGS@ +WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ +WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@ +WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_aux_dir = @abs_aux_dir@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__rm_f_notfound = @am__rm_f_notfound@ +am__tar = @am__tar@ +am__untar = @am__untar@ +am__xargs_n = @am__xargs_n@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ +gltests_WITNESS = @gltests_WITNESS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +lispdir = @lispdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +dist_man1_MANS = cmp.1 diff.1 diff3.1 sdiff.1 +EXTRA_DIST = $(dist_man1_MANS:%.1=%.x) help2man +MAINTAINERCLEANFILES = $(dist_man1_MANS) +S = $(top_srcdir)/src + +# Directory in which just-built programs reside. It is used +# to ensure help2man invokes them via the use of PATH below. +bin_dir = ../src +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu man/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-man1: $(dist_man1_MANS) + @$(NORMAL_INSTALL) + @list1='$(dist_man1_MANS)'; \ + list2=''; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(MANS) +installdirs: + for dir in "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -$(am__rm_f) $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -$(am__rm_f) $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-man + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man1 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-man + +uninstall-man: uninstall-man1 + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic cscopelist-am \ + ctags-am distclean distclean-generic distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-man1 install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am uninstall-man \ + uninstall-man1 + +.PRECIOUS: Makefile + +cmp.1: $S/cmp.c cmp.x +diff.1: $S/diff.c diff.x +diff3.1: $S/diff3.c diff3.x +sdiff.1: $S/sdiff.c sdiff.x + +# Depend on the former to get version number changes. +$(dist_man1_MANS): $(SRC_VERSION_C) help2man + $(AM_V_GEN)base=`expr $@ : '\(.*\).1'` \ + && test -x $(bin_dir)/$$base \ + && (echo '[NAME]' && sed 's@/\* *@@; s/-/\\-/; q' $S/$$base.c) \ + | PATH="$(bin_dir)$(PATH_SEPARATOR)$$PATH" \ + $(srcdir)/help2man -i - -i $(srcdir)/$$base.x \ + -S '$(PACKAGE) $(VERSION)' $$base > $@-t && mv $@-t $@ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: + +# Tell GNU make to disable its built-in pattern rules. +%:: %,v +%:: RCS/%,v +%:: RCS/% +%:: s.% +%:: SCCS/s.% diff --git a/local/recipes/tools/diffutils/source/man/cmp.1 b/local/recipes/tools/diffutils/source/man/cmp.1 new file mode 100644 index 0000000000..23e17d9f38 --- /dev/null +++ b/local/recipes/tools/diffutils/source/man/cmp.1 @@ -0,0 +1,74 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4. +.TH CMP "1" "May 2017" "diffutils 3.6" "User Commands" +.SH NAME +cmp \- compare two files byte by byte +.SH SYNOPSIS +.B cmp +[\fIOPTION\fR]... \fIFILE1 \fR[\fIFILE2 \fR[\fISKIP1 \fR[\fISKIP2\fR]]] +.SH DESCRIPTION +Compare two files byte by byte. +.PP +The optional SKIP1 and SKIP2 specify the number of bytes to skip +at the beginning of each file (zero by default). +.PP +Mandatory arguments to long options are mandatory for short options too. +.TP +\fB\-b\fR, \fB\-\-print\-bytes\fR +print differing bytes +.TP +\fB\-i\fR, \fB\-\-ignore\-initial\fR=\fISKIP\fR +skip first SKIP bytes of both inputs +.TP +\fB\-i\fR, \fB\-\-ignore\-initial\fR=\fISKIP1\fR:SKIP2 +skip first SKIP1 bytes of FILE1 and +first SKIP2 bytes of FILE2 +.TP +\fB\-l\fR, \fB\-\-verbose\fR +output byte numbers and differing byte values +.TP +\fB\-n\fR, \fB\-\-bytes\fR=\fILIMIT\fR +compare at most LIMIT bytes +.TP +\fB\-s\fR, \fB\-\-quiet\fR, \fB\-\-silent\fR +suppress all normal output +.TP +\fB\-\-help\fR +display this help and exit +.TP +\fB\-v\fR, \fB\-\-version\fR +output version information and exit +.PP +SKIP values may be followed by the following multiplicative suffixes: +kB 1000, K 1024, MB 1,000,000, M 1,048,576, +GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y. +.PP +If a FILE is '\-' or missing, read standard input. +Exit status is 0 if inputs are the same, 1 if different, 2 if trouble. +.SH AUTHOR +Written by Torbjorn Granlund and David MacKenzie. +.SH "REPORTING BUGS" +Report bugs to: bug\-diffutils@gnu.org +.br +GNU diffutils home page: <http://www.gnu.org/software/diffutils/> +.br +General help using GNU software: <http://www.gnu.org/gethelp/> +.SH COPYRIGHT +Copyright \(co 2017 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. +.br +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +.SH "SEE ALSO" +diff(1), diff3(1), sdiff(1) +.PP +The full documentation for +.B cmp +is maintained as a Texinfo manual. If the +.B info +and +.B cmp +programs are properly installed at your site, the command +.IP +.B info cmp +.PP +should give you access to the complete manual. diff --git a/local/recipes/tools/diffutils/source/man/cmp.x b/local/recipes/tools/diffutils/source/man/cmp.x new file mode 100644 index 0000000000..5c9ef82beb --- /dev/null +++ b/local/recipes/tools/diffutils/source/man/cmp.x @@ -0,0 +1,2 @@ +[SEE ALSO] +diff(1), diff3(1), sdiff(1) diff --git a/local/recipes/tools/diffutils/source/man/diff.1 b/local/recipes/tools/diffutils/source/man/diff.1 new file mode 100644 index 0000000000..69ec420718 --- /dev/null +++ b/local/recipes/tools/diffutils/source/man/diff.1 @@ -0,0 +1,266 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4. +.TH DIFF "1" "May 2017" "diffutils 3.6" "User Commands" +.SH NAME +diff \- compare files line by line +.SH SYNOPSIS +.B diff +[\fIOPTION\fR]... \fIFILES\fR +.SH DESCRIPTION +Compare FILES line by line. +.PP +Mandatory arguments to long options are mandatory for short options too. +.TP +\fB\-\-normal\fR +output a normal diff (the default) +.TP +\fB\-q\fR, \fB\-\-brief\fR +report only when files differ +.TP +\fB\-s\fR, \fB\-\-report\-identical\-files\fR +report when two files are the same +.TP +\fB\-c\fR, \fB\-C\fR NUM, \fB\-\-context\fR[=\fINUM\fR] +output NUM (default 3) lines of copied context +.TP +\fB\-u\fR, \fB\-U\fR NUM, \fB\-\-unified\fR[=\fINUM\fR] +output NUM (default 3) lines of unified context +.TP +\fB\-e\fR, \fB\-\-ed\fR +output an ed script +.TP +\fB\-n\fR, \fB\-\-rcs\fR +output an RCS format diff +.TP +\fB\-y\fR, \fB\-\-side\-by\-side\fR +output in two columns +.TP +\fB\-W\fR, \fB\-\-width\fR=\fINUM\fR +output at most NUM (default 130) print columns +.TP +\fB\-\-left\-column\fR +output only the left column of common lines +.TP +\fB\-\-suppress\-common\-lines\fR +do not output common lines +.TP +\fB\-p\fR, \fB\-\-show\-c\-function\fR +show which C function each change is in +.TP +\fB\-F\fR, \fB\-\-show\-function\-line\fR=\fIRE\fR +show the most recent line matching RE +.TP +\fB\-\-label\fR LABEL +use LABEL instead of file name and timestamp +(can be repeated) +.TP +\fB\-t\fR, \fB\-\-expand\-tabs\fR +expand tabs to spaces in output +.TP +\fB\-T\fR, \fB\-\-initial\-tab\fR +make tabs line up by prepending a tab +.TP +\fB\-\-tabsize\fR=\fINUM\fR +tab stops every NUM (default 8) print columns +.TP +\fB\-\-suppress\-blank\-empty\fR +suppress space or tab before empty output lines +.TP +\fB\-l\fR, \fB\-\-paginate\fR +pass output through 'pr' to paginate it +.TP +\fB\-r\fR, \fB\-\-recursive\fR +recursively compare any subdirectories found +.TP +\fB\-\-no\-dereference\fR +don't follow symbolic links +.TP +\fB\-N\fR, \fB\-\-new\-file\fR +treat absent files as empty +.TP +\fB\-\-unidirectional\-new\-file\fR +treat absent first files as empty +.TP +\fB\-\-ignore\-file\-name\-case\fR +ignore case when comparing file names +.TP +\fB\-\-no\-ignore\-file\-name\-case\fR +consider case when comparing file names +.TP +\fB\-x\fR, \fB\-\-exclude\fR=\fIPAT\fR +exclude files that match PAT +.TP +\fB\-X\fR, \fB\-\-exclude\-from\fR=\fIFILE\fR +exclude files that match any pattern in FILE +.TP +\fB\-S\fR, \fB\-\-starting\-file\fR=\fIFILE\fR +start with FILE when comparing directories +.TP +\fB\-\-from\-file\fR=\fIFILE1\fR +compare FILE1 to all operands; +FILE1 can be a directory +.TP +\fB\-\-to\-file\fR=\fIFILE2\fR +compare all operands to FILE2; +FILE2 can be a directory +.TP +\fB\-i\fR, \fB\-\-ignore\-case\fR +ignore case differences in file contents +.TP +\fB\-E\fR, \fB\-\-ignore\-tab\-expansion\fR +ignore changes due to tab expansion +.TP +\fB\-Z\fR, \fB\-\-ignore\-trailing\-space\fR +ignore white space at line end +.TP +\fB\-b\fR, \fB\-\-ignore\-space\-change\fR +ignore changes in the amount of white space +.TP +\fB\-w\fR, \fB\-\-ignore\-all\-space\fR +ignore all white space +.TP +\fB\-B\fR, \fB\-\-ignore\-blank\-lines\fR +ignore changes where lines are all blank +.TP +\fB\-I\fR, \fB\-\-ignore\-matching\-lines\fR=\fIRE\fR +ignore changes where all lines match RE +.TP +\fB\-a\fR, \fB\-\-text\fR +treat all files as text +.TP +\fB\-\-strip\-trailing\-cr\fR +strip trailing carriage return on input +.TP +\fB\-D\fR, \fB\-\-ifdef\fR=\fINAME\fR +output merged file with '#ifdef NAME' diffs +.TP +\fB\-\-GTYPE\-group\-format\fR=\fIGFMT\fR +format GTYPE input groups with GFMT +.TP +\fB\-\-line\-format\fR=\fILFMT\fR +format all input lines with LFMT +.TP +\fB\-\-LTYPE\-line\-format\fR=\fILFMT\fR +format LTYPE input lines with LFMT +.IP +These format options provide fine\-grained control over the output +.IP +of diff, generalizing \fB\-D\fR/\-\-ifdef. +.TP +LTYPE is 'old', 'new', or 'unchanged'. +GTYPE is LTYPE or 'changed'. +.IP +GFMT (only) may contain: +.TP +%< +lines from FILE1 +.TP +%> +lines from FILE2 +.TP +%= +lines common to FILE1 and FILE2 +.TP +%[\-][WIDTH][.[PREC]]{doxX}LETTER +printf\-style spec for LETTER +.IP +LETTERs are as follows for new group, lower case for old group: +.TP +F +first line number +.TP +L +last line number +.TP +N +number of lines = L\-F+1 +.TP +E +F\-1 +.TP +M +L+1 +.TP +%(A=B?T:E) +if A equals B then T else E +.IP +LFMT (only) may contain: +.TP +%L +contents of line +.TP +%l +contents of line, excluding any trailing newline +.TP +%[\-][WIDTH][.[PREC]]{doxX}n +printf\-style spec for input line number +.IP +Both GFMT and LFMT may contain: +.TP +%% +% +.TP +%c'C' +the single character C +.TP +%c'\eOOO' +the character with octal code OOO +.TP +C +the character C (other characters represent themselves) +.TP +\fB\-d\fR, \fB\-\-minimal\fR +try hard to find a smaller set of changes +.TP +\fB\-\-horizon\-lines\fR=\fINUM\fR +keep NUM lines of the common prefix and suffix +.TP +\fB\-\-speed\-large\-files\fR +assume large files and many scattered small changes +.TP +\fB\-\-color\fR[=\fIWHEN\fR] +colorize the output; WHEN can be 'never', 'always', +or 'auto' (the default) +.TP +\fB\-\-palette\fR=\fIPALETTE\fR +the colors to use when \fB\-\-color\fR is active; PALETTE is +a colon\-separated list of terminfo capabilities +.TP +\fB\-\-help\fR +display this help and exit +.TP +\fB\-v\fR, \fB\-\-version\fR +output version information and exit +.PP +FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'. +If \fB\-\-from\-file\fR or \fB\-\-to\-file\fR is given, there are no restrictions on FILE(s). +If a FILE is '\-', read standard input. +Exit status is 0 if inputs are the same, 1 if different, 2 if trouble. +.SH AUTHOR +Written by Paul Eggert, Mike Haertel, David Hayes, +Richard Stallman, and Len Tower. +.SH "REPORTING BUGS" +Report bugs to: bug\-diffutils@gnu.org +.br +GNU diffutils home page: <http://www.gnu.org/software/diffutils/> +.br +General help using GNU software: <http://www.gnu.org/gethelp/> +.SH COPYRIGHT +Copyright \(co 2017 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. +.br +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +.SH "SEE ALSO" +wdiff(1), cmp(1), diff3(1), sdiff(1), patch(1) +.PP +The full documentation for +.B diff +is maintained as a Texinfo manual. If the +.B info +and +.B diff +programs are properly installed at your site, the command +.IP +.B info diff +.PP +should give you access to the complete manual. diff --git a/local/recipes/tools/diffutils/source/man/diff.x b/local/recipes/tools/diffutils/source/man/diff.x new file mode 100644 index 0000000000..fdb69d27ce --- /dev/null +++ b/local/recipes/tools/diffutils/source/man/diff.x @@ -0,0 +1,2 @@ +[SEE ALSO] +wdiff(1), cmp(1), diff3(1), sdiff(1), patch(1) diff --git a/local/recipes/tools/diffutils/source/man/diff3.1 b/local/recipes/tools/diffutils/source/man/diff3.1 new file mode 100644 index 0000000000..d0b51f9e0c --- /dev/null +++ b/local/recipes/tools/diffutils/source/man/diff3.1 @@ -0,0 +1,100 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4. +.TH DIFF3 "1" "May 2017" "diffutils 3.6" "User Commands" +.SH NAME +diff3 \- compare three files line by line +.SH SYNOPSIS +.B diff3 +[\fIOPTION\fR]... \fIMYFILE OLDFILE YOURFILE\fR +.SH DESCRIPTION +Compare three files line by line. +.PP +Mandatory arguments to long options are mandatory for short options too. +.TP +\fB\-A\fR, \fB\-\-show\-all\fR +output all changes, bracketing conflicts +.TP +\fB\-e\fR, \fB\-\-ed\fR +output ed script incorporating changes +from OLDFILE to YOURFILE into MYFILE +.TP +\fB\-E\fR, \fB\-\-show\-overlap\fR +like \fB\-e\fR, but bracket conflicts +.TP +\fB\-3\fR, \fB\-\-easy\-only\fR +like \fB\-e\fR, but incorporate only nonoverlapping changes +.TP +\fB\-x\fR, \fB\-\-overlap\-only\fR +like \fB\-e\fR, but incorporate only overlapping changes +.TP +\fB\-X\fR +like \fB\-x\fR, but bracket conflicts +.TP +\fB\-i\fR +append 'w' and 'q' commands to ed scripts +.TP +\fB\-m\fR, \fB\-\-merge\fR +output actual merged file, according to +\fB\-A\fR if no other options are given +.TP +\fB\-a\fR, \fB\-\-text\fR +treat all files as text +.TP +\fB\-\-strip\-trailing\-cr\fR +strip trailing carriage return on input +.TP +\fB\-T\fR, \fB\-\-initial\-tab\fR +make tabs line up by prepending a tab +.TP +\fB\-\-diff\-program\fR=\fIPROGRAM\fR +use PROGRAM to compare files +.TP +\fB\-L\fR, \fB\-\-label\fR=\fILABEL\fR +use LABEL instead of file name +(can be repeated up to three times) +.TP +\fB\-\-help\fR +display this help and exit +.TP +\fB\-v\fR, \fB\-\-version\fR +output version information and exit +.PP +The default output format is a somewhat human\-readable representation of +the changes. +.PP +The \fB\-e\fR, \fB\-E\fR, \fB\-x\fR, \fB\-X\fR (and corresponding long) options cause an ed script +to be output instead of the default. +.PP +Finally, the \fB\-m\fR (\fB\-\-merge\fR) option causes diff3 to do the merge internally +and output the actual merged file. For unusual input, this is more +robust than using ed. +.PP +If a FILE is '\-', read standard input. +Exit status is 0 if successful, 1 if conflicts, 2 if trouble. +.SH AUTHOR +Written by Randy Smith. +.SH "REPORTING BUGS" +Report bugs to: bug\-diffutils@gnu.org +.br +GNU diffutils home page: <http://www.gnu.org/software/diffutils/> +.br +General help using GNU software: <http://www.gnu.org/gethelp/> +.SH COPYRIGHT +Copyright \(co 2017 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. +.br +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +.SH "SEE ALSO" +cmp(1), diff(1), sdiff(1) +.PP +The full documentation for +.B diff3 +is maintained as a Texinfo manual. If the +.B info +and +.B diff3 +programs are properly installed at your site, the command +.IP +.B info diff3 +.PP +should give you access to the complete manual. diff --git a/local/recipes/tools/diffutils/source/man/diff3.x b/local/recipes/tools/diffutils/source/man/diff3.x new file mode 100644 index 0000000000..0751208aff --- /dev/null +++ b/local/recipes/tools/diffutils/source/man/diff3.x @@ -0,0 +1,2 @@ +[SEE ALSO] +cmp(1), diff(1), sdiff(1) diff --git a/local/recipes/tools/diffutils/source/man/help2man b/local/recipes/tools/diffutils/source/man/help2man new file mode 100755 index 0000000000..54e5a3182d --- /dev/null +++ b/local/recipes/tools/diffutils/source/man/help2man @@ -0,0 +1,671 @@ +#!/usr/bin/perl -w + +# Generate a short man page from --help and --version output. +# Copyright (C) 1997-2005, 2009-2011, 2013, 2015-2017 Free Software Foundation, +# Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Written by Brendan O'Dea <bod@debian.org> +# Available from ftp://ftp.gnu.org/gnu/help2man/ + +use 5.008; +use strict; +use Getopt::Long; +use Text::Tabs qw(expand); +use POSIX qw(strftime setlocale LC_ALL); + +my $this_program = 'help2man'; +my $this_version = '1.40.4'; + +sub _ { $_[0] } +sub configure_locale +{ + my $locale = shift; + die "$this_program: no locale support (Locale::gettext required)\n" + unless $locale eq 'C'; +} + +sub dec { $_[0] } +sub enc { $_[0] } +sub enc_user { $_[0] } +sub kark { die +(sprintf shift, @_), "\n" } +sub N_ { $_[0] } + +my $version_info = enc_user sprintf _(<<'EOT'), $this_program, $this_version; +GNU %s %s + +Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2009, 2010, +2011 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +Written by Brendan O'Dea <bod@debian.org> +EOT + +my $help_info = enc_user sprintf _(<<'EOT'), $this_program, $this_program; +'%s' generates a man page out of '--help' and '--version' output. + +Usage: %s [OPTION]... EXECUTABLE + + -n, --name=STRING description for the NAME paragraph + -s, --section=SECTION section number for manual page (1, 6, 8) + -m, --manual=TEXT name of manual (User Commands, ...) + -S, --source=TEXT source of program (FSF, Debian, ...) + -L, --locale=STRING select locale (default "C") + -i, --include=FILE include material from 'FILE' + -I, --opt-include=FILE include material from 'FILE' if it exists + -o, --output=FILE send output to 'FILE' + -p, --info-page=TEXT name of Texinfo manual + -N, --no-info suppress pointer to Texinfo manual + -l, --libtool exclude the 'lt-' from the program name + --help print this help, then exit + --version print version number, then exit + +EXECUTABLE should accept '--help' and '--version' options and produce output on +stdout although alternatives may be specified using: + + -h, --help-option=STRING help option string + -v, --version-option=STRING version option string + --version-string=STRING version string + --no-discard-stderr include stderr when parsing option output + +Report bugs to <bug-help2man@gnu.org>. +EOT + +my $section = 1; +my $manual = ''; +my $source = ''; +my $help_option = '--help'; +my $version_option = '--version'; +my $discard_stderr = 1; +my ($opt_name, @opt_include, $opt_output, $opt_info, $opt_no_info, $opt_libtool, + $version_text); + +my %opt_def = ( + 'n|name=s' => \$opt_name, + 's|section=s' => \$section, + 'm|manual=s' => \$manual, + 'S|source=s' => \$source, + 'L|locale=s' => sub { configure_locale pop }, + 'i|include=s' => sub { push @opt_include, [ pop, 1 ] }, + 'I|opt-include=s' => sub { push @opt_include, [ pop, 0 ] }, + 'o|output=s' => \$opt_output, + 'p|info-page=s' => \$opt_info, + 'N|no-info' => \$opt_no_info, + 'l|libtool' => \$opt_libtool, + 'help' => sub { print $help_info; exit }, + 'version' => sub { print $version_info; exit }, + 'h|help-option=s' => \$help_option, + 'v|version-option=s' => \$version_option, + 'version-string=s' => \$version_text, + 'discard-stderr!' => \$discard_stderr, +); + +# Parse options. +Getopt::Long::config('bundling'); +die $help_info unless GetOptions %opt_def and @ARGV == 1; + +my %include = (); +my %append = (); +my @include = (); # retain order given in include file + +# Process include file (if given). Format is: +# +# [section name] +# verbatim text +# +# or +# +# /pattern/ +# verbatim text +# + +while (@opt_include) +{ + my ($inc, $required) = @{shift @opt_include}; + + next unless -f $inc or $required; + kark N_("%s: can't open '%s' (%s)"), $this_program, $inc, $! + unless open INC, $inc; + + my $key; + my $hash = \%include; + + while (<INC>) + { + # Convert input to internal Perl format, so that multibyte + # sequences are treated as single characters. + $_ = dec $_; + + # [section] + if (/^\[([^]]+)\]\s*$/) + { + $key = uc $1; + $key =~ s/^\s+//; + $key =~ s/\s+$//; + $hash = \%include; + push @include, $key unless $include{$key}; + next; + } + + # /pattern/ + if (m!^/(.*)/([ims]*)\s*$!) + { + my $pat = $2 ? "(?$2)$1" : $1; + + # Check pattern. + eval { $key = qr($pat) }; + if ($@) + { + $@ =~ s/ at .*? line \d.*//; + die "$inc:$.:$@"; + } + + $hash = \%append; + next; + } + + # Check for options before the first section--anything else is + # silently ignored, allowing the first for comments and + # revision info. + unless ($key) + { + # handle options + if (/^-/) + { + local @ARGV = split; + GetOptions %opt_def; + } + + next; + } + + $hash->{$key} ||= ''; + $hash->{$key} .= $_; + } + + close INC; + + kark N_("%s: no valid information found in '%s'"), $this_program, $inc + unless $key; +} + +# Compress trailing blank lines. +for my $hash (\(%include, %append)) +{ + for (keys %$hash) { $hash->{$_} =~ s/\n+$/\n/ } +} + +sub get_option_value; + +# Grab help and version info from executable. +my $help_text = get_option_value $ARGV[0], $help_option; +$version_text ||= get_option_value $ARGV[0], $version_option; + +# Translators: the following message is a strftime(3) format string, which in +# the English version expands to the month as a word and the full year. It +# is used on the footer of the generated manual pages. If in doubt, you may +# just use %x as the value (which should be the full locale-specific date). +my $date = enc strftime _("%B %Y"), localtime; +(my $program = $ARGV[0]) =~ s!.*/!!; +my $package = $program; +my $version; + +if ($opt_output) +{ + unlink $opt_output or kark N_("%s: can't unlink %s (%s)"), + $this_program, $opt_output, $! if -e $opt_output; + + open STDOUT, ">$opt_output" + or kark N_("%s: can't create %s (%s)"), $this_program, $opt_output, $!; +} + +# The first line of the --version information is assumed to be in one +# of the following formats: +# +# <version> +# <program> <version> +# {GNU,Free} <program> <version> +# <program> ({GNU,Free} <package>) <version> +# <program> - {GNU,Free} <package> <version> +# +# and separated from any copyright/author details by a blank line. + +($_, $version_text) = ((split /\n+/, $version_text, 2), ''); + +if (/^(\S+) +\(((?:GNU|Free) +[^)]+)\) +(.*)/ or + /^(\S+) +- *((?:GNU|Free) +\S+) +(.*)/) +{ + $program = $1; + $package = $2; + $version = $3; +} +elsif (/^((?:GNU|Free) +)?(\S+) +(.*)/) +{ + $program = $2; + $package = $1 ? "$1$2" : $2; + $version = $3; +} +else +{ + $version = $_; +} + +$program =~ s!.*/!!; + +# No info for 'info' itself. +$opt_no_info = 1 if $program eq 'info'; + +# Translators: "NAME", "SYNOPSIS" and other one or two word strings in all +# upper case are manual page section headings. The man(1) manual page in your +# language, if available should provide the conventional translations. +for ($include{_('NAME')}) +{ + if ($opt_name) # --name overrides --include contents. + { + $_ = "$program \\- $opt_name\n"; + } + elsif ($_) # Use first name given as $program + { + $program = $1 if /^([^\s,]+)(?:,?\s*[^\s,\\-]+)*\s+\\?-/; + } + else # Set a default (useless) NAME paragraph. + { + $_ = sprintf _("%s \\- manual page for %s %s") . "\n", $program, + $program, $version; + } +} + +# Man pages traditionally have the page title in caps. +my $PROGRAM = uc $program; + +# Set default page head/footers +$source ||= "$program $version"; +unless ($manual) +{ + for ($section) + { + if (/^(1[Mm]|8)/) { $manual = enc _('System Administration Utilities') } + elsif (/^6/) { $manual = enc _('Games') } + else { $manual = enc _('User Commands') } + } +} + +# Extract usage clause(s) [if any] for SYNOPSIS. +# Translators: "Usage" and "or" here are patterns (regular expressions) which +# are used to match the usage synopsis in program output. An example from cp +# (GNU coreutils) which contains both strings: +# Usage: cp [OPTION]... [-T] SOURCE DEST +# or: cp [OPTION]... SOURCE... DIRECTORY +# or: cp [OPTION]... -t DIRECTORY SOURCE... +my $PAT_USAGE = _('Usage'); +my $PAT_USAGE_CONT = _('or'); +if ($help_text =~ s/^($PAT_USAGE):( +(\S+))(.*)((?:\n(?: {6}\1| *($PAT_USAGE_CONT): +\S).*)*)//om) +{ + my @syn = $3 . $4; + + if ($_ = $5) + { + s/^\n//; + for (split /\n/) { s/^ *(($PAT_USAGE_CONT): +)?//o; push @syn, $_ } + } + + my $synopsis = ''; + for (@syn) + { + $synopsis .= ".br\n" if $synopsis; + s!^\S*/!!; + s/^lt-// if $opt_libtool; + s/^(\S+) *//; + $synopsis .= ".B $1\n"; + s/\s+$//; + s/(([][]|\.\.+)+)/\\fR$1\\fI/g; + s/^/\\fI/ unless s/^\\fR//; + $_ .= '\fR'; + s/(\\fI)( *)/$2$1/g; + s/\\fI\\fR//g; + s/^\\fR//; + s/\\fI$//; + s/^\./\\&./; + + $synopsis .= "$_\n"; + } + + $include{_('SYNOPSIS')} ||= $synopsis; +} + +# Process text, initial section is DESCRIPTION. +my $sect = _('DESCRIPTION'); +$_ = "$help_text\n\n$version_text"; + +# Normalise paragraph breaks. +s/^\n+//; +s/\n*$/\n/; +s/\n\n+/\n\n/g; + +# Join hyphenated lines. +s/([A-Za-z])-\n *([A-Za-z])/$1$2/g; + +# Temporarily exchange leading dots, apostrophes and backslashes for +# tokens. +s/^\./\x80/mg; +s/^'/\x81/mg; +s/\\/\x82/g; + +# Translators: patterns are used to match common program output. In the source +# these strings are all of the form of "my $PAT_something = _('...');" and are +# regular expressions. If there is more than one commonly used string, you +# may separate alternatives with "|". Spaces in these expressions are written +# as " +" to indicate that more than one space may be matched. The string +# "(?:[\\w-]+ +)?" in the bug reporting pattern is used to indicate an +# optional word, so that either "Report bugs" or "Report _program_ bugs" will +# be matched. +my $PAT_BUGS = _('Report +(?:[\w-]+ +)?bugs|Email +bug +reports +to'); +my $PAT_AUTHOR = _('Written +by'); +my $PAT_OPTIONS = _('Options'); +my $PAT_ENVIRONMENT = _('Environment'); +my $PAT_FILES = _('Files'); +my $PAT_EXAMPLES = _('Examples'); +my $PAT_FREE_SOFTWARE = _('This +is +free +software'); + +# Start a new paragraph (if required) for these. +s/([^\n])\n($PAT_BUGS|$PAT_AUTHOR) /$1\n\n$2 /og; + +# Convert iso-8859-1 copyright symbol or (c) to nroff +# character. +s/^Copyright +(?:\xa9|\([Cc]\))/Copyright \\(co/mg; + +sub convert_option; + +while (length) +{ + # Convert some standard paragraph names. + if (s/^($PAT_OPTIONS): *\n//o) + { + $sect = _('OPTIONS'); + next; + } + if (s/^($PAT_ENVIRONMENT): *\n//o) + { + $sect = _('ENVIRONMENT'); + next; + } + if (s/^($PAT_FILES): *\n//o) + { + $sect = _('FILES'); + next; + } + elsif (s/^($PAT_EXAMPLES): *\n//o) + { + $sect = _('EXAMPLES'); + next; + } + + # Copyright section + if (/^Copyright /) + { + $sect = _('COPYRIGHT'); + } + + # Bug reporting section. + elsif (/^($PAT_BUGS) /o) + { + $sect = _('REPORTING BUGS'); + } + + # Author section. + elsif (/^($PAT_AUTHOR)/o) + { + $sect = _('AUTHOR'); + } + + # Examples, indicated by an indented leading $, % or > are + # rendered in a constant width font. + if (/^( +)([\$\%>] )\S/) + { + my $indent = $1; + my $prefix = $2; + my $break = '.IP'; + $include{$sect} ||= ''; + while (s/^$indent\Q$prefix\E(\S.*)\n*//) + { + $include{$sect} .= "$break\n\\f(CW$prefix$1\\fR\n"; + $break = '.br'; + } + + next; + } + + my $matched = ''; + $include{$sect} ||= ''; + + # Sub-sections have a trailing colon and the second line indented. + if (s/^(\S.*:) *\n / /) + { + $matched .= $& if %append; + $include{$sect} .= qq(.SS "$1"\n); + } + + my $indent = 0; + my $content = ''; + + # Option with description. + if (s/^( {1,10}([+-]\S.*?))(?:( +(?!-))|\n( {20,}))(\S.*)\n//) + { + $matched .= $& if %append; + $indent = length ($4 || "$1$3"); + $content = ".TP\n\x84$2\n\x84$5\n"; + unless ($4) + { + # Indent may be different on second line. + $indent = length $& if /^ {20,}/; + } + } + + # Option without description. + elsif (s/^ {1,10}([+-]\S.*)\n//) + { + $matched .= $& if %append; + $content = ".HP\n\x84$1\n"; + $indent = 80; # not continued + } + + # Indented paragraph with tag. + elsif (s/^( +(\S.*?) +)(\S.*)\n//) + { + $matched .= $& if %append; + $indent = length $1; + $content = ".TP\n\x84$2\n\x84$3\n"; + } + + # Indented paragraph. + elsif (s/^( +)(\S.*)\n//) + { + $matched .= $& if %append; + $indent = length $1; + $content = ".IP\n\x84$2\n"; + } + + # Left justified paragraph. + else + { + s/(.*)\n//; + $matched .= $& if %append; + $content = ".PP\n" if $include{$sect}; + $content .= "$1\n"; + } + + # Append continuations. + while ($indent ? s/^ {$indent}(\S.*)\n// : s/^(\S.*)\n//) + { + $matched .= $& if %append; + $content .= "\x84$1\n"; + } + + # Move to next paragraph. + s/^\n+//; + + for ($content) + { + # Leading dot and apostrophe protection. + s/\x84\./\x80/g; + s/\x84'/\x81/g; + s/\x84//g; + + # Convert options. + s/(^| |\()(-[][\w=-]+)/$1 . convert_option $2/mge; + + # Escape remaining hyphens + s/-/\x83/g; + + if ($sect eq 'COPYRIGHT') + { + # Insert line breaks before additional copyright messages + # and the disclaimer. + s/\n(Copyright |$PAT_FREE_SOFTWARE)/\n.br\n$1/og; + } + elsif ($sect eq 'REPORTING BUGS') + { + # Handle multi-line bug reporting sections of the form: + # + # Report <program> bugs to <addr> + # GNU <package> home page: <url> + # ... + s/\n([[:upper:]])/\n.br\n$1/g; + } + } + + # Check if matched paragraph contains /pat/. + if (%append) + { + for my $pat (keys %append) + { + if ($matched =~ $pat) + { + $content .= ".PP\n" unless $append{$pat} =~ /^\./; + $content .= $append{$pat}; + } + } + } + + $include{$sect} .= $content; +} + +# Refer to the real documentation. +unless ($opt_no_info) +{ + my $info_page = $opt_info || $program; + + $sect = _('SEE ALSO'); + $include{$sect} ||= ''; + $include{$sect} .= ".PP\n" if $include{$sect}; + $include{$sect} .= sprintf _(<<'EOT'), $program, $program, $info_page; +The full documentation for +.B %s +is maintained as a Texinfo manual. If the +.B info +and +.B %s +programs are properly installed at your site, the command +.IP +.B info %s +.PP +should give you access to the complete manual. +EOT +} + +# Output header. +print <<EOT; +.\\" DO NOT MODIFY THIS FILE! It was generated by $this_program $this_version. +.TH $PROGRAM "$section" "$date" "$source" "$manual" +EOT + +# Section ordering. +my @pre = (_('NAME'), _('SYNOPSIS'), _('DESCRIPTION'), _('OPTIONS'), + _('ENVIRONMENT'), _('FILES'), _('EXAMPLES')); + +my @post = (_('AUTHOR'), _('REPORTING BUGS'), _('COPYRIGHT'), _('SEE ALSO')); +my $filter = join '|', @pre, @post; + +# Output content. +for my $sect (@pre, (grep ! /^($filter)$/o, @include), @post) +{ + if ($include{$sect}) + { + my $quote = $sect =~ /\W/ ? '"' : ''; + print enc ".SH $quote$sect$quote\n"; + + for ($include{$sect}) + { + # Replace leading dot, apostrophe, backslash and hyphen + # tokens. + s/\x80/\\&./g; + s/\x81/\\&'/g; + s/\x82/\\e/g; + s/\x83/\\-/g; + + # Convert some latin1 chars to troff equivalents + s/\xa0/\\ /g; # non-breaking space + + print enc $_; + } + } +} + +close STDOUT or kark N_("%s: error writing to %s (%s)"), $this_program, + $opt_output || 'stdout', $!; + +exit; + +# Call program with given option and return results. +sub get_option_value +{ + my ($prog, $opt) = @_; + my $stderr = $discard_stderr ? '/dev/null' : '&1'; + my $value = join '', + map { s/ +$//; expand $_ } + map { dec $_ } + `$prog $opt 2>$stderr`; + + unless ($value) + { + my $err = N_("%s: can't get '%s' info from %s%s"); + my $extra = $discard_stderr + ? "\n" . N_("Try '--no-discard-stderr' if option outputs to stderr") + : ''; + + kark $err, $this_program, $opt, $prog, $extra; + } + + return $value; +} + +# Convert option dashes to \- to stop nroff from hyphenating 'em, and +# embolden. Option arguments get italicised. +sub convert_option +{ + local $_ = '\fB' . shift; + + s/-/\x83/g; + unless (s/\[=(.*)\]$/\\fR[=\\fI$1\\fR]/) + { + s/=(.)/\\fR=\\fI$1/; + s/ (.)/ \\fI$1/; + $_ .= '\fR'; + } + + $_; +} diff --git a/local/recipes/tools/diffutils/source/man/sdiff.1 b/local/recipes/tools/diffutils/source/man/sdiff.1 new file mode 100644 index 0000000000..e7ca72d51d --- /dev/null +++ b/local/recipes/tools/diffutils/source/man/sdiff.1 @@ -0,0 +1,102 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4. +.TH SDIFF "1" "May 2017" "diffutils 3.6" "User Commands" +.SH NAME +sdiff \- side-by-side merge of file differences +.SH SYNOPSIS +.B sdiff +[\fIOPTION\fR]... \fIFILE1 FILE2\fR +.SH DESCRIPTION +Side\-by\-side merge of differences between FILE1 and FILE2. +.PP +Mandatory arguments to long options are mandatory for short options too. +.TP +\fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR +operate interactively, sending output to FILE +.TP +\fB\-i\fR, \fB\-\-ignore\-case\fR +consider upper\- and lower\-case to be the same +.TP +\fB\-E\fR, \fB\-\-ignore\-tab\-expansion\fR +ignore changes due to tab expansion +.TP +\fB\-Z\fR, \fB\-\-ignore\-trailing\-space\fR +ignore white space at line end +.TP +\fB\-b\fR, \fB\-\-ignore\-space\-change\fR +ignore changes in the amount of white space +.TP +\fB\-W\fR, \fB\-\-ignore\-all\-space\fR +ignore all white space +.TP +\fB\-B\fR, \fB\-\-ignore\-blank\-lines\fR +ignore changes whose lines are all blank +.TP +\fB\-I\fR, \fB\-\-ignore\-matching\-lines\fR=\fIRE\fR +ignore changes all whose lines match RE +.TP +\fB\-\-strip\-trailing\-cr\fR +strip trailing carriage return on input +.TP +\fB\-a\fR, \fB\-\-text\fR +treat all files as text +.TP +\fB\-w\fR, \fB\-\-width\fR=\fINUM\fR +output at most NUM (default 130) print columns +.TP +\fB\-l\fR, \fB\-\-left\-column\fR +output only the left column of common lines +.TP +\fB\-s\fR, \fB\-\-suppress\-common\-lines\fR +do not output common lines +.TP +\fB\-t\fR, \fB\-\-expand\-tabs\fR +expand tabs to spaces in output +.TP +\fB\-\-tabsize\fR=\fINUM\fR +tab stops at every NUM (default 8) print columns +.TP +\fB\-d\fR, \fB\-\-minimal\fR +try hard to find a smaller set of changes +.TP +\fB\-H\fR, \fB\-\-speed\-large\-files\fR +assume large files, many scattered small changes +.TP +\fB\-\-diff\-program\fR=\fIPROGRAM\fR +use PROGRAM to compare files +.TP +\fB\-\-help\fR +display this help and exit +.TP +\fB\-v\fR, \fB\-\-version\fR +output version information and exit +.PP +If a FILE is '\-', read standard input. +Exit status is 0 if inputs are the same, 1 if different, 2 if trouble. +.SH AUTHOR +Written by Thomas Lord. +.SH "REPORTING BUGS" +Report bugs to: bug\-diffutils@gnu.org +.br +GNU diffutils home page: <http://www.gnu.org/software/diffutils/> +.br +General help using GNU software: <http://www.gnu.org/gethelp/> +.SH COPYRIGHT +Copyright \(co 2017 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. +.br +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +.SH "SEE ALSO" +cmp(1), diff(1), diff3(1) +.PP +The full documentation for +.B sdiff +is maintained as a Texinfo manual. If the +.B info +and +.B sdiff +programs are properly installed at your site, the command +.IP +.B info sdiff +.PP +should give you access to the complete manual. diff --git a/local/recipes/tools/diffutils/source/man/sdiff.x b/local/recipes/tools/diffutils/source/man/sdiff.x new file mode 100644 index 0000000000..fdc9c3eb14 --- /dev/null +++ b/local/recipes/tools/diffutils/source/man/sdiff.x @@ -0,0 +1,2 @@ +[SEE ALSO] +cmp(1), diff(1), diff3(1) diff --git a/local/recipes/tools/diffutils/source/po/LINGUAS b/local/recipes/tools/diffutils/source/po/LINGUAS new file mode 100644 index 0000000000..cf85d7b823 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/LINGUAS @@ -0,0 +1,32 @@ +ca +cs +da +de +el +eo +es +fi +fr +ga +gl +he +hr +hu +id +it +ja +lv +ms +nb +nl +pl +pt_BR +ro +ru +sr +sv +tr +uk +vi +zh_CN +zh_TW diff --git a/local/recipes/tools/diffutils/source/po/Makefile.in.in b/local/recipes/tools/diffutils/source/po/Makefile.in.in new file mode 100644 index 0000000000..65184f65c7 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/Makefile.in.in @@ -0,0 +1,475 @@ +# Makefile for PO directory in any package using GNU gettext. +# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <drepper@gnu.ai.mit.edu> +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU General Public +# License but which still want to provide support for the GNU gettext +# functionality. +# Please note that the actual code of GNU gettext is covered by the GNU +# General Public License and is *not* in the public domain. +# +# Origin: gettext-0.19 +GETTEXT_MACRO_VERSION = 0.19 + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ + +SED = @SED@ +SHELL = /bin/sh +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datarootdir = @datarootdir@ +datadir = @datadir@ +localedir = @localedir@ +gettextsrcdir = $(datadir)/gettext/po + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +# We use $(mkdir_p). +# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as +# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, +# @install_sh@ does not start with $(SHELL), so we add it. +# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined +# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake +# versions, $(mkinstalldirs) and $(install_sh) are unused. +mkinstalldirs = $(SHELL) @install_sh@ -d +install_sh = $(SHELL) @install_sh@ +MKDIR_P = @MKDIR_P@ +mkdir_p = @mkdir_p@ + +GMSGFMT_ = @GMSGFMT@ +GMSGFMT_no = @GMSGFMT@ +GMSGFMT_yes = @GMSGFMT_015@ +GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) +MSGFMT_ = @MSGFMT@ +MSGFMT_no = @MSGFMT@ +MSGFMT_yes = @MSGFMT_015@ +MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) +XGETTEXT_ = @XGETTEXT@ +XGETTEXT_no = @XGETTEXT@ +XGETTEXT_yes = @XGETTEXT_015@ +XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +POFILES = @POFILES@ +GMOFILES = @GMOFILES@ +UPDATEPOFILES = @UPDATEPOFILES@ +DUMMYPOFILES = @DUMMYPOFILES@ +DISTFILES.common = Makefile.in.in remove-potcdate.sin \ +$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) +DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ +$(POFILES) $(GMOFILES) \ +$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) + +POTFILES = \ + +CATALOGS = @CATALOGS@ + +POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot +POFILESDEPS_yes = $(POFILESDEPS_) +POFILESDEPS_no = +POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT)) + +DISTFILESDEPS_ = update-po +DISTFILESDEPS_yes = $(DISTFILESDEPS_) +DISTFILESDEPS_no = +DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO)) + +# Makevars gets inserted here. (Don't remove this line!) + +.SUFFIXES: +.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update + +.po.mo: + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ + +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all: all-@USE_NLS@ + +all-yes: stamp-po +all-no: + +# Ensure that the gettext macros and this Makefile.in.in are in sync. +CHECK_MACRO_VERSION = \ + test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ + || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ + exit 1; \ + } + +# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no +# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because +# we don't want to bother translators with empty POT files). We assume that +# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. +# In this case, stamp-po is a nop (i.e. a phony target). + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + @$(CHECK_MACRO_VERSION) + test ! -f $(srcdir)/$(DOMAIN).pot || \ + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @test ! -f $(srcdir)/$(DOMAIN).pot || { \ + echo "touch stamp-po" && \ + echo timestamp > stamp-poT && \ + mv stamp-poT stamp-po; \ + } + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +# The determination of whether the package xyz is a GNU one is based on the +# heuristic whether some file in the top level directory mentions "GNU xyz". +# If GNU 'find' is available, we avoid grepping through monster files. +$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed + package_gnu="$(PACKAGE_GNU)"; \ + test -n "$$package_gnu" || { \ + if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ + LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f \ + -size -10000000c -exec grep 'GNU @PACKAGE@' \ + /dev/null '{}' ';' 2>/dev/null; \ + else \ + LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ + fi; \ + } | grep -v 'libtool:' >/dev/null; then \ + package_gnu=yes; \ + else \ + package_gnu=no; \ + fi; \ + }; \ + if test "$$package_gnu" = "yes"; then \ + package_prefix='GNU '; \ + else \ + package_prefix=''; \ + fi; \ + if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ + msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ + else \ + msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ + fi; \ + case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + ;; \ + *) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --package-name="$${package_prefix}@PACKAGE@" \ + --package-version='@VERSION@' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + ;; \ + esac + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(POFILESDEPS) + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + if test -f "$(srcdir)/$${lang}.po"; then \ + test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) \ + && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ + $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ + esac; \ + }; \ + else \ + $(MAKE) $${lang}.po-create; \ + fi + + +install: install-exec install-data +install-exec: +install-data: install-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ + for file in $(DISTFILES.common) Makevars.template; do \ + $(INSTALL_DATA) $(srcdir)/$$file \ + $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + for file in Makevars; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi +install-data-no: all +install-data-yes: all + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkdir_p) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +install-strip: install + +installdirs: installdirs-exec installdirs-data +installdirs-exec: +installdirs-data: installdirs-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ + else \ + : ; \ + fi +installdirs-data-no: +installdirs-data-yes: + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkdir_p) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +# Define this as empty until I found a useful application. +installcheck: + +uninstall: uninstall-exec uninstall-data +uninstall-exec: +uninstall-data: uninstall-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + for file in $(DISTFILES.common) Makevars.template; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi +uninstall-data-no: +uninstall-data-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +check: all + +info dvi ps pdf html tags TAGS ctags CTAGS ID: + +mostlyclean: + rm -f remove-potcdate.sed + rm -f stamp-poT + rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po + rm -fr *.o + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES *.mo + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f stamp-po $(GMOFILES) + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: + test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS) + @$(MAKE) dist2 +# This is a separate target because 'update-po' must be executed before. +dist2: stamp-po $(DISTFILES) + dists="$(DISTFILES)"; \ + if test "$(PACKAGE)" = "gettext-tools"; then \ + dists="$$dists Makevars.template"; \ + fi; \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + dists="$$dists $(DOMAIN).pot stamp-po"; \ + fi; \ + if test -f $(srcdir)/ChangeLog; then \ + dists="$$dists ChangeLog"; \ + fi; \ + for i in 0 1 2 3 4 5 6 7 8 9; do \ + if test -f $(srcdir)/ChangeLog.$$i; then \ + dists="$$dists ChangeLog.$$i"; \ + fi; \ + done; \ + if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ + for file in $$dists; do \ + if test -f $$file; then \ + cp -p $$file $(distdir) || exit 1; \ + else \ + cp -p $(srcdir)/$$file $(distdir) || exit 1; \ + fi; \ + done + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for creating PO files. + +.nop.po-create: + @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ + echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ + exit 1 + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ + $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + esac; \ + }; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: + +# Recreate Makefile by invoking config.status. Explicitly invoke the shell, +# because execution permission bits may not work on the current file system. +# Use @SHELL@, which is the shell determined by autoconf for the use by its +# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. +Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ + cd $(top_builddir) \ + && @SHELL@ ./config.status $(subdir)/$@.in po-directories + +force: + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/local/recipes/tools/diffutils/source/po/Makevars b/local/recipes/tools/diffutils/source/po/Makevars new file mode 100644 index 0000000000..8a3afda761 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/Makevars @@ -0,0 +1,83 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ \ + \ + --flag=_:1:pass-c-format\ + --flag=N_:1:pass-c-format\ + --flag=error:3:c-format --flag=error_at_line:5:c-format\ +\ + --from-code=UTF-8\ + --flag=asprintf:2:c-format --flag=vasprintf:2:c-format\ + --flag=asnprintf:3:c-format --flag=vasnprintf:3:c-format\ + --flag=message:1:c-format --flag=message5:1:c-format\ + --flag=try_help:1:c-format\ + $${end_of_xgettext_options+} + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Free Software Foundation, Inc. + +# This tells whether or not to prepend "GNU " prefix to the package +# name that gets inserted into the header of the $(DOMAIN).pot file. +# Possible values are "yes", "no", or empty. If it is empty, try to +# detect it automatically by scanning the files in $(top_srcdir) for +# "GNU packagename" string. +PACKAGE_GNU = + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-diffutils@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' +# context. Possible values are "yes" and "no". Set this to yes if the +# package uses functions taking also a message context, like pgettext(), or +# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. +USE_MSGCTXT = no + +# These options get passed to msgmerge. +# Useful options are in particular: +# --previous to keep previous msgids of translated messages, +# --quiet to reduce the verbosity. +MSGMERGE_OPTIONS = + +# This tells whether or not to regenerate a PO file when $(DOMAIN).pot +# has changed. Possible values are "yes" and "no". Set this to no if +# the POT file is checked in the repository and the version control +# program ignores timestamps. +PO_DEPENDS_ON_POT = yes + +# This tells whether or not to forcibly update $(DOMAIN).pot and +# regenerate PO files on "make dist". Possible values are "yes" and +# "no". Set this to no if the POT file and PO files are maintained +# externally. +DIST_DEPENDS_ON_UPDATE_PO = yes diff --git a/local/recipes/tools/diffutils/source/po/POTFILES.in b/local/recipes/tools/diffutils/source/po/POTFILES.in new file mode 100644 index 0000000000..08690f8f02 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/POTFILES.in @@ -0,0 +1,36 @@ +# List of files that contain translatable strings. + +# Copyright (C) 2001-2002, 2009-2013, 2015-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +lib/argmatch.c +lib/c-stack.c +lib/error.c +lib/file-type.c +lib/getopt.c +lib/quotearg.c +lib/regcomp.c +lib/xalloc-die.c +lib/xfreopen.c +lib/xstrtol-error.c +lib/version-etc.c + +src/analyze.c +src/cmp.c +src/diff.c +src/diff3.c +src/dir.c +src/sdiff.c +src/util.c diff --git a/local/recipes/tools/diffutils/source/po/Rules-quot b/local/recipes/tools/diffutils/source/po/Rules-quot new file mode 100644 index 0000000000..7b92c7e456 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/Rules-quot @@ -0,0 +1,58 @@ +# This file, Rules-quot, can be copied and used freely without restrictions. +# Special Makefile rules for English message catalogs with quotation marks. + +DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot + +.SUFFIXES: .insert-header .po-update-en + +en@quot.po-create: + $(MAKE) en@quot.po-update +en@boldquot.po-create: + $(MAKE) en@boldquot.po-update + +en@quot.po-update: en@quot.po-update-en +en@boldquot.po-update: en@boldquot.po-update-en + +.insert-header.po-update-en: + @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ + if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + ll=`echo $$lang | sed -e 's/@.*//'`; \ + LC_ALL=C; export LC_ALL; \ + cd $(srcdir); \ + if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \ + | $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \ + { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \ + $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \ + ;; \ + *) \ + $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \ + ;; \ + esac } 2>/dev/null > $$tmpdir/$$lang.new.po \ + ; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "creation of $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +en@quot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header + +en@boldquot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header + +mostlyclean: mostlyclean-quot +mostlyclean-quot: + rm -f *.insert-header diff --git a/local/recipes/tools/diffutils/source/po/boldquot.sed b/local/recipes/tools/diffutils/source/po/boldquot.sed new file mode 100644 index 0000000000..4b937aa517 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/boldquot.sed @@ -0,0 +1,10 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g +s/“/“/g +s/”/”/g +s/‘/‘/g +s/’/’/g diff --git a/local/recipes/tools/diffutils/source/po/ca.gmo b/local/recipes/tools/diffutils/source/po/ca.gmo new file mode 100644 index 0000000000..ede1743f2d Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/ca.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/ca.po b/local/recipes/tools/diffutils/source/po/ca.po new file mode 100644 index 0000000000..8e5168a7e6 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/ca.po @@ -0,0 +1,1668 @@ +# Catalan messages for diffutils. +# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Ernest Adrogu Calveras <eadrogue@gmx.net>, 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: diffutils 2.8.7\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2004-04-21 13:33+0200\n" +"Last-Translator: Ernest Adrogu Calveras <eadrogue@gmx.net>\n" +"Language-Team: Catalan <ca@dodds.net>\n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "error del programa" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "desbordament de pila" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Error no identificat del sistema" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "fitxer ordinari buit" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "fitxer ordinari" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "directori" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "enlla simblic" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "cua de missatges" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "semfor" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "objecte de memria compartida" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "objecte de memria tipificada" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "fitxer especial de blocs" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "fitxer especial de carcters" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "cua FIFO" + +#: lib/file-type.c:78 +msgid "door" +msgstr "" + +#: lib/file-type.c:81 +#, fuzzy +msgid "multiplexed block special file" +msgstr "fitxer especial de blocs" + +#: lib/file-type.c:84 +#, fuzzy +msgid "multiplexed character special file" +msgstr "fitxer especial de carcters" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "" + +#: lib/file-type.c:90 +#, fuzzy +msgid "named file" +msgstr "fitxer estrambtic" + +#: lib/file-type.c:93 +#, fuzzy +msgid "network special file" +msgstr "fitxer especial de blocs" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "" + +#: lib/file-type.c:102 +msgid "port" +msgstr "" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "connector" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "fitxer estrambtic" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: l'opci %s s ambigua\n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: l'opci %s s ambigua\n" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: opci no reconeguda %c%s\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: l'opci %c%s no admet arguments\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: l'opci %s requereix arguments\n" + +#: lib/getopt.c:621 +#, fuzzy, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: opci no vlida -- %c\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, fuzzy, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: l'opci requereix arguments -- %c\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Succs" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Cap resultat" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "L'expressi regular no s vlida" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "El carcter de collaci no s vlid" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "El nom de la classe de carcter no s vlid" + +# al final o al principi? eac +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Hi ha una barra invertida al final" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Hi ha una referncia cap enrera no vlida" + +#: lib/regcomp.c:156 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Hi ha un signe [ o ^[ desaparellat" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Hi ha un signe ( o \\( desaparellat" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Hi ha un signe \\{ desaparellat" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "El contingut de \\{\\} no s vlid" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "El lmit superior de l'interval no vlid" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Memria exhaurida" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "L'expressi regular precedent no s vlida" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Final prematur de l'expressi regular" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "L'expressi regular s massa gran" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Hi ha un signe ) o \\) desaparellat" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "No hi ha cap expressi regular prvia" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "memria exhaurida" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "" + +#: lib/xfreopen.c:38 +#, fuzzy +msgid "unknown stream" +msgstr "Error no identificat del sistema" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "" + +#: lib/xstrtol-error.c:63 +#, fuzzy, c-format +msgid "invalid %s%s argument '%s'" +msgstr "el valor %s per l'opci --bytes no s vlid" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Escrit per %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Escrit per %s i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Escrit per %s, %s i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Escrit per %s, %s, %s,\n" +"i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Escrit per %s, %s, %s,\n" +"%s, i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Escrit per %s, %s, %s,\n" +"%s, %s, i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Escrit per %s, %s, %s,\n" +"%s, %s, %s, i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Escrit per %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Escrit per %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Excrit per %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, i altres.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Els fitxers %s i %s difereixen\n" + +#: src/analyze.c:455 +#, fuzzy, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Els fitxers %s i %s difereixen\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "No hi ha cap carcter de salt de lnia al final del fitxer" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, fuzzy, c-format +msgid "Try '%s --help' for more information." +msgstr "Proveu %s --help per obtenir ms informaci." + +#: src/cmp.c:137 +#, fuzzy, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "el valor %s per l'opci --ignore-initial no s vlid" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "les opcions -l i -s sn incompatibles" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "error d'escriptura" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "sortida estndard" + +#: src/cmp.c:161 +#, fuzzy +msgid "-b, --print-bytes print differing bytes" +msgstr "-b --print-bytes Mostra els octets que difereixen." + +#: src/cmp.c:162 +#, fuzzy +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "-i SALT --ignore-initial=SALT Ignora els primers SALT octets." + +#: src/cmp.c:163 +#, fuzzy +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +" Ignora els primers SALT1 octets de FITXER1 i els primers SALT2 de FITXER2." + +#: src/cmp.c:165 +#, fuzzy +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "-l --verbose Mostra la posici i valor dels octets que difereixen." + +#: src/cmp.c:166 +#, fuzzy +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n LMIT --bytes=LMIT Compara com a mxim LMIT octets." + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr "" + +#: src/cmp.c:169 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "-v --version Mostra la versi del programa." + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Mode d's: %s [OPCI]... FITXER1 [FITXER2 [SALT1 [SALT2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Compara dos fitxers octet a octet." + +#: src/cmp.c:182 +#, fuzzy +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"SALT1 i SALT2 sn el nombre d'octets que es passen per alt de cada fitxer." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"Els valors de SALT poden tenir els segents sufixs multiplicadors:\n" +"kB per 1000, K per 1024, MB per 1.000.000, M per 1.048.576, GB per\n" +"1.000.000.000, G per 1.073.741.824, i aix amb T, P, E, Z i Y." + +#: src/cmp.c:194 +#, fuzzy +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Si un FITXER s - o falta, llegeix l'entrada estndard." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"L'estat de sortida s 0 si les entrades sn iguals, 1 si sn diferents\n" +"i 2 en cas d'error." + +#: src/cmp.c:240 +#, fuzzy, c-format +msgid "invalid --bytes value '%s'" +msgstr "el valor %s per l'opci --bytes no s vlid" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, fuzzy, c-format +msgid "missing operand after '%s'" +msgstr "falta un operand desprs de %s" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, fuzzy, c-format +msgid "extra operand '%s'" +msgstr "sobra l'operand %s" + +# mirar el comentari del codi font +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s i %s difereixen: octet %s, lnia %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s i %s difereixen: l'octet %s, lnia %s, s %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: final de fitxer a %s\n" + +# mirar el comentari del codi font +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s i %s difereixen: octet %s, lnia %s\n" + +# mirar el comentari del codi font +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s i %s difereixen: octet %s, lnia %s\n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: final de fitxer a %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "" + +#: src/diff.c:353 +#, fuzzy, c-format +msgid "invalid context length '%s'" +msgstr "el nombre de lnies de context %s no s vlid" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "aquest sistema no suporta paginaci" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "massa opcions d'etiqueta de fitxer" + +#: src/diff.c:528 +#, fuzzy, c-format +msgid "invalid width '%s'" +msgstr "l'amplada %s no s vlida" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "opcions d'amplada incompatibles" + +#: src/diff.c:557 +#, fuzzy, c-format +msgid "invalid horizon length '%s'" +msgstr "el nombre de lnies d'horitz %s no s vlid" + +#: src/diff.c:613 +#, fuzzy, c-format +msgid "invalid tabsize '%s'" +msgstr "la distncia de tabulaci %s no s vlida" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "opcions de distncia de tabulaci incompatibles" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "heu especificat les opcions --from-file i --to-file al mateix temps" + +#: src/diff.c:891 +#, fuzzy +msgid " --normal output a normal diff (the default)" +msgstr "--normal Genera un diff normal." + +#: src/diff.c:892 +#, fuzzy +msgid "-q, --brief report only when files differ" +msgstr "-q --brief Indica noms si els fitxers difereixen o no." + +#: src/diff.c:893 +#, fuzzy +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s --report-identical-files Avisa quan dos fitxers sn idntics." + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" + +#: src/diff.c:895 +#, fuzzy +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-w NM --width=NM No ms de NM (130 per omissi) carcters per lnia." + +#: src/diff.c:896 +#, fuzzy +msgid "-e, --ed output an ed script" +msgstr "-e --ed Genera un script ed." + +#: src/diff.c:897 +#, fuzzy +msgid "-n, --rcs output an RCS format diff" +msgstr "-n --rcs Genera un diff en format RCS." + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "" + +#: src/diff.c:899 +#, fuzzy +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w NM --width=NM No ms de NM (130 per omissi) carcters per lnia." + +#: src/diff.c:900 +#, fuzzy +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +"-l --left-column Noms escriu les lnies en com a la columna esquerra." + +#: src/diff.c:901 +#, fuzzy +msgid " --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines No mostra les lnies en com." + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" + +#: src/diff.c:908 +#, fuzzy +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t --expand-tabs Expandeix les tabulacions de la sortida a espais." + +#: src/diff.c:909 +#, fuzzy +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T --initial-tab Alinea el text de cada lnia amb un carcter de tabulaci." + +#: src/diff.c:910 +#, fuzzy +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +"--tabsize=NM Estableix la distncia de tabulaci en NM (8 per omissi)\n" +" carcters." + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" + +#: src/diff.c:912 +#, fuzzy +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "-l --paginate Pagina la sortida amb el programa pr." + +#: src/diff.c:914 +#, fuzzy +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r --recursive Compara recursivament qualsevol subdirectori existent." + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr "" + +#: src/diff.c:916 +#, fuzzy +msgid "-N, --new-file treat absent files as empty" +msgstr "-N --new-file Considera els fitxers inexistents com si fssin buits." + +#: src/diff.c:917 +#, fuzzy +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +"--unidirectional-new-file Tracta els fitxers primers inexistents com si\n" +" fssin buits." + +#: src/diff.c:918 +#, fuzzy +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +"--ignore-file-name-case Ignora diferncies entre majscules i minscules " +"en\n" +" els noms dels fitxers." + +#: src/diff.c:919 +#, fuzzy +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +"--no-ignore-file-name-case T en compte diferncies entre majscules i\n" +" minscules en comparar noms de fitxers." + +#: src/diff.c:920 +#, fuzzy +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "-x PAT --exclude=PAT Exclou fitxers que coincideixen amb PAT." + +#: src/diff.c:921 +#, fuzzy +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X FITXER --exclude-from=FITXER Exclou fitxers que coincideixen amb\n" +" qualsevol patr de FITXER." + +#: src/diff.c:922 +#, fuzzy +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S FITXER --starting-file=FITXER Comena per FITXER quan es comparen\n" +" directoris." + +#: src/diff.c:923 +#, fuzzy +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +"--from-file=FITXER1 Compara FITXER1 amb tots els operands. FITXER1 pot ser\n" +" un directori." + +#: src/diff.c:925 +#, fuzzy +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +"--to-file=FITXER1 Compara tots els operands amb FITXER2. FITXER2 pot ser\n" +" un directori." + +#: src/diff.c:928 +#, fuzzy +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "-i --ignore-case Ignora diferncies entre majscules i minscules." + +#: src/diff.c:929 +#, fuzzy +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E --ignore-tab-expansion Ignora canvis provocats per la distncia de\n" +" tabulaci." + +#: src/diff.c:930 +#, fuzzy +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-w --ignore-all-space Ignora tot l'espai en blanc." + +#: src/diff.c:931 +#, fuzzy +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b --ignore-space-change Ignora canvis en la quantitat d'espai en blanc." + +#: src/diff.c:932 +#, fuzzy +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w --ignore-all-space Ignora tot l'espai en blanc." + +#: src/diff.c:933 +#, fuzzy +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "-B --ignore-blank-lines Ignora canvis en lnies que estan en blanc." + +#: src/diff.c:934 +#, fuzzy +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I ER --ignore-matching-lines=ER Ignora canvis en lnies que continguin ER." + +#: src/diff.c:936 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr "-a --text Tracta tots els fitxers com a text." + +#: src/diff.c:937 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +"--strip-trailing-cr Treu els carcters finals de retorn de carro de " +"l'entrada." + +#: src/diff.c:939 +#, fuzzy +msgid " --binary read and write data in binary mode" +msgstr "--binary Escriu i llegeix dades en mode binari." + +#: src/diff.c:942 +#, fuzzy +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D NOM --ifdef=NOM Genera un fitxer combinat amb diferncies expressades\n" +" amb directives `#ifdef NOM'." + +# `grups' o `grups de lnies' (no queda prou clar) +#: src/diff.c:943 +#, fuzzy +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +"--TIPUSG-group-format=FMTG Similar, per formata els grups TIPUSG amb FMTG." + +#: src/diff.c:944 +#, fuzzy +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "--line-format=FMTL Similar, per formata totes les lnies amb FMTL." + +#: src/diff.c:945 +#, fuzzy +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +"--TIPUSL-line-format=FMTL Similar, per formata les lnies TIPUSL amb FMTL." + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" + +#: src/diff.c:948 +#, fuzzy +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" TIPUSL pot ser old (velles), new (noves), o " +"unchanged (inalterades).\n" +" TIPUSG pot ser qualsevol TIPUSL o b changed (alterades)." + +#: src/diff.c:949 +#, fuzzy +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" FMTG pot contenir:\n" +" %< lnies de FITXER1\n" +" %> lnies de FITXER2\n" +" %= lnies comunes de FITXER1 i FITXER2\n" +" %[-][AMPLADA][.[PRECISI]]{doxX}LLETRA espec. estil printf per a " +"LLETRA\n" +" LLETRA s una de les segents pels grups nous (en minscules pels " +"vells):\n" +" F nombre de la primera lnia\n" +" L nombre de l'ltima lnia\n" +" N nombre de lnies del grup = L-F+1\n" +" E F-1\n" +" M L+1" + +#: src/diff.c:961 +#, fuzzy +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" FMTL pot contenir:\n" +" %L contingut de la lnia\n" +" %l contingut de la lnia sense el salt de lnia final\n" +" %[-][AMPLADA][.[PRECISI]]{doxX}n espec. estil printf pel nombre de " +"lnia" + +#: src/diff.c:965 +#, fuzzy +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" Tant FMTG com FMTL poden contenir:\n" +" %% %\n" +" %c'C' el carcter C\n" +" %c'\\OOO' el carcter de codi octal OOO" + +#: src/diff.c:971 +#, fuzzy +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d --minimal Intenta trobar canvis mnims." + +#: src/diff.c:972 +#, fuzzy +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "--horizon-lines=NM No descarta NM lnies amb prefix i sufix com." + +#: src/diff.c:973 +#, fuzzy +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +"-H --speed-large-files Assumeix fitxers grans i molts canvis petits " +"dispersos." + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr "" + +#: src/diff.c:980 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "-v --version Mostra la versi del programa." + +#: src/diff.c:982 +#, fuzzy +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"FITXERS s FITXER1 FITXER2 o DIR1 DIR2 o DIR FITXER... o FITXER... " +"DIR." + +#: src/diff.c:983 +#, fuzzy +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Amb les opcions --from-file o --to-file no hi ha restriccions de FITXERS." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +#, fuzzy +msgid "If a FILE is '-', read standard input." +msgstr "Si FITXER s -, llegeix l'entrada estndard." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Mode d's: %s [OPCI]... FITXERS\n" + +#: src/diff.c:995 +#, fuzzy +msgid "Compare FILES line by line." +msgstr "Compara fitxers lnia per lnia." + +#: src/diff.c:1029 +#, fuzzy, c-format +msgid "conflicting %s option value '%s'" +msgstr "el valor %s per l'opci %s s conflictiu" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "opcions d'estil de sortida conflictives" + +#: src/diff.c:1058 +#, fuzzy, c-format +msgid "invalid color '%s'" +msgstr "el nombre de lnies de context %s no s vlid" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Noms a %s: %s\n" + +#: src/diff.c:1248 +#, fuzzy +msgid "cannot compare '-' to a directory" +msgstr "no es pot comparar - amb un directori" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "l'opci -D no funciona amb directoris" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Subdirectoris comuns: %s i %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "El fitxer %s s un %s mentre que el fitxer %s s un %s\n" + +#: src/diff.c:1370 +#, fuzzy, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Els fitxers %s i %s difereixen\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Els fitxers %s i %s sn idntics\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "opcions incompatibles" + +#: src/diff3.c:391 +#, fuzzy +msgid "'-' specified for more than one input file" +msgstr "heu especificat - per ms d'un fitxer d'entrada" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "lectura fallida" + +#: src/diff3.c:475 +#, fuzzy +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A --show-all Mostra tots els canvis, senyalant els conflictes amb " +"separadors." + +#: src/diff3.c:477 +#, fuzzy +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e --ed Mostra els canvis no comuns de FITXER-VELL a FITXER2 en FITXER1." + +#: src/diff3.c:479 +#, fuzzy +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +"-E --show-overlap Mostra els canvis no comuns, senyalant els conflictes " +"amb\n" +" separadors." + +#: src/diff3.c:480 +#, fuzzy +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "-3 --easy-only Mostra els canvis no comuns i no solapats." + +#: src/diff3.c:481 +#, fuzzy +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "-x --overlap-only Mostra els canvis solapats." + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" + +#: src/diff3.c:483 +#, fuzzy +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "-i Afegeix les instruccions w i q a l'script ed." + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" + +#: src/diff3.c:488 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr "-a --text Tracta tots els fitxers com a text." + +#: src/diff3.c:489 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +"--strip-trailing-cr Treu els carcters finals de retorn de carro de " +"l'entrada." + +#: src/diff3.c:490 +#, fuzzy +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T --initial-tab Alinea el text de cada lnia amb un carcter de tabulaci." + +#: src/diff3.c:491 +#, fuzzy +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "--diff-program=PROGRAMA Usa PROGRAMA per comparar fitxers." + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr "" + +#: src/diff3.c:496 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "-v --version Mostra la versi del programa." + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Mode d's: %s [OPCI]... FITXER1 FITXER-VELL FITXER2\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Compara tres fitxers lnia per lnia." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"L'estat de sortida s 0 si s'acaba amb xit, 1 si hi ha conflictes\n" +"i 2 en cas d'error." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "error intern: format dels blocs diff desmanegat" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff ha fallat: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "error intern: tipus de diff invlid en process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "el format diff no s vlid: el separador de canvis no s vlid" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "el format diff no s vlid: l'ltima lnia est incompleta" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, fuzzy, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "no s'ha pogut invocar el programa subsidiari %s" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "el format diff no s vlid: carcters invlids al principi de lnia" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "error intern: tipus de diff no vlid passat a la sortida" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "el fitxer d'entrada s'ha encongit" + +#: src/dir.c:156 +#, fuzzy, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "no es poden comparar els noms de fitxer %s i %s" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "" + +#: src/sdiff.c:173 +#, fuzzy +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o FITXER --output=FITXER Opera interactivament, i envia la sortida a " +"FITXER." + +#: src/sdiff.c:175 +#, fuzzy +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i --ignore-case No distingeix entre majscules i minscules." + +#: src/sdiff.c:176 +#, fuzzy +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E --ignore-tab-expansion Ignora canvis provocats per la distncia de\n" +" tabulaci." + +#: src/sdiff.c:177 +#, fuzzy +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-w --ignore-all-space Ignora tot l'espai en blanc." + +#: src/sdiff.c:178 +#, fuzzy +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b --ignore-space-change Ignora canvis en la quantitat d'espai en blanc." + +#: src/sdiff.c:179 +#, fuzzy +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W --ignore-all-space Ignora tot l'espai en blanc." + +#: src/sdiff.c:180 +#, fuzzy +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "-B --ignore-blank-lines Ignora canvis en lnies que estan en blanc." + +#: src/sdiff.c:181 +#, fuzzy +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I ER --ignore-matching-lines=ER Ignora canvis en lnies que continguin ER." + +#: src/sdiff.c:182 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +"--strip-trailing-cr Treu els carcters finals de retorn de carro de " +"l'entrada." + +#: src/sdiff.c:183 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr "-a --text Tracta tots els fitxers com a text." + +#: src/sdiff.c:185 +#, fuzzy +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w NM --width=NM No ms de NM (130 per omissi) carcters per lnia." + +#: src/sdiff.c:186 +#, fuzzy +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" +"-l --left-column Noms escriu les lnies en com a la columna esquerra." + +#: src/sdiff.c:187 +#, fuzzy +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines No mostra les lnies en com." + +#: src/sdiff.c:189 +#, fuzzy +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t --expand-tabs Expandeix les tabulacions de la sortida a espais." + +#: src/sdiff.c:190 +#, fuzzy +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +"--tabsize=NM Estableix la distncia de tabulaci en NM (8 per omissi)\n" +" carcters." + +#: src/sdiff.c:192 +#, fuzzy +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d --minimal Intenta trobar canvis mnims." + +#: src/sdiff.c:193 +#, fuzzy +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H --speed-large-files Assumeix fitxers grans i molts canvis petits " +"dispersos." + +#: src/sdiff.c:194 +#, fuzzy +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "--diff-program=PROGRAMA Usa PROGRAMA per comparar fitxers." + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr "" + +#: src/sdiff.c:197 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "-v --version Mostra la versi del programa." + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Mode d's: %s [OPCI]... FITXER1 FITXER2\n" + +#: src/sdiff.c:208 +#, fuzzy +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Combina diferncies entre fitxers en dues columnes" + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "no es pot combinar interactivament l'entrada estndard" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "ambds fitxers sn directoris" + +#: src/sdiff.c:818 +#, fuzzy +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tEdita i usa les dues versions, amb un encapalament afegit.\n" +"eb:\tEdita i usa les dues versions.\n" +"el:\tEdita i usa la versi de l'esquerra.\n" +"er:\tEdita i usa la versi de la dreta.\n" +"e:\tEdita una nova versi.\n" +"l:\tUsa la versi de l'esquerra.\n" +"r:\tUsa la versi de la dreta.\n" +"s:\tInclou les lnies comunes silenciosament\n" +"v:\tInclou les lnies comunes i informa amb loquacitat\n" +"q:\tSurt.\n" + +#: src/util.c:662 +#, fuzzy, c-format +msgid "unrecognized prefix: %s" +msgstr "%s: opci no reconeguda --%s\n" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "" + +#, fuzzy +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: l'opci --%s no admet arguments\n" + +#, fuzzy +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: opci no reconeguda --%s\n" + +#, fuzzy +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: l'opci -W %s s ambigua\n" + +#, fuzzy +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: l'opci -W %s no admet arguments\n" + +#, fuzzy +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: l'opci %s requereix arguments\n" + +#~ msgid "%s: illegal option -- %c\n" +#~ msgstr "%s: opci illegal -- %c\n" + +#~ msgid "" +#~ "This is free software; see the source for copying conditions. There is " +#~ "NO\n" +#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR " +#~ "PURPOSE.\n" +#~ msgstr "" +#~ "Aix s programari lliure; vegeu el codi font per les condicions de " +#~ "cpia. No\n" +#~ "hi ha CAP garantia, ni tan sols de COMERCIABILITAT o ADEQUACI A UN " +#~ "PROPSIT.\n" + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i SALT1:SALT2 --ignore-initial=SALT1:SALT2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "" +#~ "-s --quiet --silent No mostra res; torna l'estat de sortida i prou." + +#~ msgid "--help Output this help." +#~ msgstr "--help Mostra aquesta ajuda." + +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>." +#~ msgstr "Comuniqueu errors a <bug-gnu-utils@gnu.org>." + +#~ msgid "`-%ld' option is obsolete; use `-%c %ld'" +#~ msgstr "l'opci -%ld s obsoleta; useu -%c %ld" + +#~ msgid "`-%ld' option is obsolete; omit it" +#~ msgstr "l'opci -%ld s obsoleta; eviteu-la" + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ "-c -C NM --context[=NM] Escriu NM (3 per omissi) lnies de " +#~ "context.\n" +#~ "-u -U NM --unified[=NM] Escriu NM (3 per omissi) lnies de " +#~ "context\n" +#~ " unificat.\n" +#~ " --label ETIQUETA Usa ETIQUETA en lloc del nom del fitxer.\n" +#~ " -p --show-c-function Mostra en quina funci C es troba cada canvi.\n" +#~ " -F ER --show-function-line=ER Mostra la lnia ms recent que " +#~ "contingui ER." + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ "-y --side-by-side Disposa el resultat en dues columnes.\n" +#~ " -W NM --width=NM No ms de NM (130 per omissi) carcters per " +#~ "lnia.\n" +#~ " --left-column Noms mostra les lnies en com a la columna esquerra.\n" +#~ " --suppress-common-lines No mostra les lnies en com." + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "" +#~ "--speed-large-files Assumeix fitxers grans i molts canvis petits " +#~ "dispersos." + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "-X Mostra els canvis solapats, amb separadors." + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "" +#~ "-m --merge Produeix un fitxer de canvis combinat en lloc d'un script " +#~ "ed\n" +#~ " (usant l'opci -A per omissi)." + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "" +#~ "-L ETIQUETA --label=ETIQUETA Usa ETIQUETA en lloc del nom del fitxer." + +#~ msgid "subsidiary program `%s' not found" +#~ msgstr "no s'ha trobat el programa subsidiari %s" + +#~ msgid "subsidiary program `%s' failed" +#~ msgstr "el programa subsidiari %s ha fallat" + +#~ msgid "subsidiary program `%s' failed (exit status %d)" +#~ msgstr "el programa subsidiari %s Ha fallat (estat de sortida %d)" diff --git a/local/recipes/tools/diffutils/source/po/cs.gmo b/local/recipes/tools/diffutils/source/po/cs.gmo new file mode 100644 index 0000000000..c9c01a4de1 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/cs.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/cs.po b/local/recipes/tools/diffutils/source/po/cs.po new file mode 100644 index 0000000000..9457e4682f --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/cs.po @@ -0,0 +1,1584 @@ +# Czech translations for the GNU diffutils messages. +# Copyright (C) 1998, 2002, 2004, 2010 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Petr Kočvara <petr.kocvara@nemfm.cz>, 1998, 2002, 2004, 2010 +# Petr Pisar <petr.pisar@atlas.cz, 2014, 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: diffutils 3.5.14\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2017-02-03 13:03+01:00\n" +"Last-Translator: Petr Pisar <petr.pisar@atlas.cz>\n" +"Language-Team: Czech <translation-team-cs@lists.sourceforge.net>\n" +"Language: cs\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "neplatný argument „%s“ pro %s" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "nejednoznačný argument %s pro %s" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "Platné argumenty jsou:" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "chyba programu" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "přetečení zásobníku" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Neznámá chyba systému" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "obyčejný prázdný soubor" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "obyčejný soubor" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "adresář" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "symbolický odkaz" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "fronta zpráv" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "semafor" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "objekt sdílené paměti" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "objekt typové paměti" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "blokový speciální soubor" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "znakový speciální soubor" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "souvislá data" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "roura" + +#: lib/file-type.c:78 +msgid "door" +msgstr "dveře" + +#: lib/file-type.c:81 +msgid "multiplexed block special file" +msgstr "sdružený blokový speciální soubor" + +#: lib/file-type.c:84 +msgid "multiplexed character special file" +msgstr "sdružený znakový speciální soubor" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "sdružený soubor" + +#: lib/file-type.c:90 +msgid "named file" +msgstr "pojmenovaný soubor" + +#: lib/file-type.c:93 +msgid "network special file" +msgstr "síťový speciální soubor" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "zmigrovaný soubor s daty" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "zmigrovaný soubor bez dat" + +#: lib/file-type.c:102 +msgid "port" +msgstr "port" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "soket" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "zabělení" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "soubor neznámého typu" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: přepínač „%s“ není jednoznačný\n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: přepínač „%s“ není jednoznačný; možnosti:" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: neznámý přepínač „%c%s“\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: přepínač „%c%s“ musí být zadán bez argumentu\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: přepínač „--%s“ vyžaduje argument\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: neznámý přepínač – „%c“\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: přepínač vyžaduje argument – „%c“\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "„" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "“" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Hotovo" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Žádná shoda" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Neplatný regulární výraz" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Neplatný znak porovnání" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Neplatné jméno třídy znaků" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Koncové zpětné lomítko" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Neplatný zpětný odkaz" + +#: lib/regcomp.c:156 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Nepárová [, [^, [:, [. nebo [=" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Nepárová ( nebo \\(" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Nepárová \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Neplatný obsah \\{\\}" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Neplatný konec rozsahu" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Paměť vyčerpána" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Neplatný předchozí regulární výraz" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Předčasný konec regulárního výrazu" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Regulární výraz je příliš dlouhý" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Nepárová ) nebo \\)" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Předchozí regulární výraz neexistuje" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "paměť vyčerpána" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "stdin" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "stdout" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "stderr" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "neznámý proud" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "nelze znovuotevřít %s v módu %s" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "neplatný argument „%3$s“ přepínače %1$s%2$s" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "neplatná přípona argumentu „%3$s“ přepínače %2$s%1$s" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "argument „%3$s“ přepínače %1$s%2$s je příliš velký" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Balíček připravil %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Balíček připravil %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Licence GPLv3+: GNU GPL verze 3 nebo novější <http://gnu.org/licenses/gpl." +"html>.\n" +"Toto je svobodné programové vybavení: máte právo měnit jej a dále šířit.\n" +"Není poskytována ŽÁDNÁ ZÁRUKA, jak jen zákon dovoluje.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Autor: %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Autoři: %s a %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Autoři: %s, %s a %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Autoři: %s, %s, %s\n" +"a %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Autoři: %s, %s, %s,\n" +"%s a %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Autoři: %s, %s, %s,\n" +"%s, %s a %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Autoři: %s, %s, %s,\n" +"%s, %s, %s a %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Autoři: %s, %s, %s,\n" +"%s, %s, %s, %s\n" +"a %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Autoři: %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s a %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Autoři: %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s a další.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Chyby v programu oznamujte na adrese %s (anglicky),\n" +"připomínky k překladu na adrese <translation-team-cs@lists.sourceforge.net>\n" +"(česky).\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "" +"Chyby v programu %s oznamujte (anglicky) na: %s\n" +"Připomínky k překladu (česky) na: <translation-team-cs@lists.sourceforge." +"net>\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Domovská stránka %s: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "Domovská stránka programu %s: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"Obecná pomoc při používání softwaru GNU:: <http://www.gnu.org/gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Soubory %s a %s jsou různé\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Binární soubory %s a %s jsou rozdílné\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Chybí znak konce řádku na konci souboru" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Více informací získáte příkazem „%s --help“." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "neplatná hodnota --ignore-inital „%s“" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "přepínače -l a -s nejsou kompatibilní" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "zápis selhal" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "standardní výstup" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b --print-bytes vypíše rozdílné bajty" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "-i, --ignore-initial=N přeskočí prvních N bajtů obou vstupů" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=N1:N2 přeskočí prvních N1 bajtů SOUBORU1 a\n" +" prvních N2 bajtů SOUBORU2" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "-l --verbose vypíše pozice a hodnoty rozdílných bajtů" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=LIMIT porovná nejvýše LIMIT bajtů" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent potlačí veškerý běžný výstup" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help zobrazí tuto nápovědu a skončí" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v --version vypíše údaje o verzi a skončí" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Použití: %s [PŘEPÍNAČ]… SOUBOR1 [SOUBOR2 [N1 [N2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Porovnává dva soubory bajt po bajtu." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"Volitelné argumenty N1 a N2 udávají počet bajtů, které budou přeskočeny\n" +"na začátku každého souboru (výchozí je nula)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Povinné argumenty dlouhých přepínačů jsou též povinné u krátkých forem.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"Hodnoty N1 a N2 mohou být doplněny následujícími násobnými příponami:\n" +"kB 1000, K 1024, MB 1 000 000, M 1 048 576,\n" +"GB 1 000 000 000, G 1 073 741 824 a stejně tak i pro T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Pokud SOUBOR je „-“ nebo nebo chybí, bude čten standardní vstup." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"Návratový kód je roven 0 pokud jsou vstupy shodné, 1 pokud se liší a 2 při " +"chybě." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "neplatná hodnota přepínače --bytes „%s“" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "po „%s“ chybí operand" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "operand „%s“ je nadbytečný" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s se liší: bajt %s, řádek %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s se liší: bajt %s, řádek %s je %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: konec souboru v %s\n" + +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s %s se liší: bajt %s, řádek %s\n" + +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s %s se liší: bajt %s, řádek %s\n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: konec souboru v %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "neplatná délka kontextu „%s“" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "přestránkování není na tomto počítači podporováno" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "příliš mnoho přepínačů popisu souboru" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "nesprávná délka „%s“" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "konfliktní volby šířky výstupu" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "neplatná výška obzoru „%s“" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "nesprávná hodnota --tabsize „%s“" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "konfliktní přepínače tabsize" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "parametry --from-file i to-file použity najednou" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr " --normal normálním formát výstupu diff (výchozí)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "-q --brief výstup pouze při rozdílných souborech" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s --report-identical-files hlásí shodné soubory" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C POČET, --context[=POČET]\n" +" vypíše POČET (výchozí je 3) řádků\n" +" kopírovaného kontextu" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U POČET, --unified[=POČET]\n" +" vypíše POČET (výchozí je 3) řádků\n" +" unifikovaného kontextu" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e --ed vypíše skript pro ed" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n --rcs vypíše rozdíl ve formátu RCS" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side vypíše ve dvou sloupcích" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=POČET vypíše nejvýše POČET (výchozí je 130)\n" +" tiskových sloupců" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +" --left-column vypíše pouze levý sloupec společných řádků" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines nevypisuje shodné řádky" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" +"-p, --show-c-function ukáže, ve které funkci C se změna nachází" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "-F, --show-function-line=RV ukáže poslední řádek odpovídající RV" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label NÁZEV použije NÁZEV místo názvu souboru a časového " +"údaje\n" +" (lze opakovat)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs ve výstupu převede tabulátory na mezery" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T, --initial-tab na začátek řádků se vloží tabulátor" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=POČET tabulátor zastavuje každých POČET\n" +" (výchozí je 8) tiskových sloupců" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty potlačí mezeru nebo tabulátor před prázdnými\n" +"   řádky výstupu" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" +"-l, --paginate výstup projde přes „pr“ pro přestránkování" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r --recursive rekurzivně porovná všechny nalezené " +"podadresáře" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference nenásleduje symbolické odkazy" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "" +"-N, --new-file neexistující soubory považuje za prázdné" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +" --unidirectional-new-file neexistující soubory z prvního adresáře\n" +" považuje za prázdné" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case ignoruje velikost písmen v názvech souborů" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case bere v potaz velikost písmen v názvech " +"souborů" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "-x, --exclude=VZOR vynechá soubory odpovídající VZORU" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=SOUBOR vynechá soubory, které odpovídají\n" +" libovolnému vzoru ze SOUBORU" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=SOUBOR při porovnávání adresářů začne SOUBOREM" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=SOUBOR1 porovná SOUBOR1 se všemi operandy,\n" +" SOUBOR1 může být adresář" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=SOUBOR2 porovná všechny operandy se SOUBOREM2,\n" +" SOUBOR2 může být adresář" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i, --ignore-case ignoruje velikost písmen v obsahu souborů" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "-E, --ignore-tab-expansion ignoruje změny v odsazení tabulátorem" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space ignoruje bílá místa na konci řádku" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change ignoruje změny v počtu bílých míst" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space ignoruje všechna bílá místa" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B, --ignore-blank-lines ignoruje změny v případě prázdných řádků" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RV ignoruje změny na všech řádcích\n" +" odpovídajících RV" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text pokládá všechny soubory za text" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr odstraní ukončovací znak CR na vstupu" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr "" +" --binary data čte a zapisuje data v binárním režimu" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=NÁZEV vypíše sloučený soubor s rozdíly „#ifdef " +"NÁZEV“" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +" --GTYPE-group-format=GFMT formátuje vstupní skupiny GTYPE podle FMTS" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "" +" --line-format=LFMT formátuje všechny vstupní řádky podle LFMT" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +" --LTYPE-line-format=LFMT formátuje vstupní řádky LTYPE podle LFMT" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" Tyto formátovací přepínače poskytují jemnou kontrolu nad výstupem diffu\n" +" a zobecňují -D/--ifdef." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE je „old“ (starý), „new“ (nový) nebo „unchanged“ (nezměněn). GTYPE\n" +" je LTYPE nebo „changed“ (změněn)." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT může obsahovat:\n" +" %< řádky ze SOUBORU1\n" +" %> řádky ze SOUBORU2\n" +" %= řádky společné pro SOUBOR1 i SOUBOR2\n" +" %[-][DÉLKA][.[PŘESNOST]]{doxX}ZNAK formát stylu printf pro ZNAK\n" +" ZNAKy dále jsou pro novou skupinu, malými písmeny pro starou skupinu:\n" +" F číslo prvního řádku\n" +" L číslo posledního řádku\n" +" N počet řádků = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) pokud A se rovná B, tak T, jinak E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT (pouze) smí obsahovat:\n" +" %L obsah řádku\n" +" %l obsah řádku, bez znaku konce řádku\n" +" %[-][ŠÍŘKA][.[PŘESNOST]]{doxX}n formát stylu printf pro číslo " +"vstupního\n" +" řádku" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" Jak GFMT, tak i LFMT smí obsahovat:\n" +" %% %\n" +" %c'C' jeden znak C\n" +" %c'\\000' znak s osmičkovým kódem 000\n" +" C znak C (ostatní znaky zastupují samy sebe)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal pokusí se nalézt nejmenší sadu změn" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +" --horizon-lines=POČET\n" +" ponechá POČET shodných řádků předpony a přípony" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files předpokládá velké soubory a mnoho rozptýlených\n" +" drobných změn" + +#: src/diff.c:974 +#, fuzzy +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" +" --color[=KDY] obarví výstup, KDY smí být „never“ (nikdy),\n" +" „always“ (vždy)," + +#: src/diff.c:976 +#, fuzzy +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" +" PALETA je dvojtečkou oddělený seznam schopností\n" +" terminfa" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help zobrazí tuto nápovědu a skončí" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version vypíše údaje o verzi a skončí" + +#: src/diff.c:982 +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"SOUBORY jsou „SOUBOR1 SOUBOR2“ nebo „ADRESÁŘ1 ADRESÁŘ2' nebo\n" +"„ADRESÁŘ SOUBOR“ nebo „SOUBOR ADRESÁŘ“." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Pokud je uveden --from-file nebo --to-file, pak nejsou u SOUBORŮ žádná " +"omezení." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Pokud SOUBOR bude „-“, bude čten standardní vstup." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Použití: %s [PŘEPÍNAČ]… SOUBORY\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Porovnává SOUBORY řádek po řádku." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "konfliktní hodnota „%2$s“ přepínače „%1$s“" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "konfliktní přepínače pro styl výstupu" + +#: src/diff.c:1058 +#, c-format +msgid "invalid color '%s'" +msgstr "neplatná barva „%s“" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Pouze v %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "„-“ s adresářem nelze porovnat" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "-D přepínač nepodporuje práci s adresáři" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Společné podadresáře: %s a %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Soubor %s je %s zatímco soubor %s je %s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Symbolické odkazy %s a %s se liší\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Soubory %s a %s jsou identické\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "nekompatibilní přepínače" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "„-“ zadáno pro více než jeden vstupní soubor" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "čtení selhalo" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A, --show-all vypíše všechny rozdíly, konflikty v závorkách" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed vypíše ed skript zahrnující změny mezi\n" +" STARÝM_SOUBOREM a VAŠÍM_SOUBOREM do MÉHO_SOUBORU" + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "-E, --show-overlap jako -e, ale konflikty umístí do závorek" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3, --easy-only jako -e, ale zahrne jen nepřekrývající se změny" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +"-x, --overlap-only jako -e, ale zahrne jen překrývající se změny" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "-X jako -x, ale konflikty umístí do závorek" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "-i přidá příkazy „w“ a „q“ do skriptů pro ed" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge vypíše vlastní spojený soubor podle -A, nebyly-" +"li\n" +" uvedeny další přepínače" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text pokládá všechny soubory za text" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr odstraní ukončovací znak CR na vstupu" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T, --initial-tab na začátek řádků se vloží tabulátor" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=PROGRAM použije PROGRAM k porovnání souborů" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=NÁZEV použije NÁZEV namísto názvu souboru\n" +" (lze opakovat až třikrát)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help zobrazí tuto nápovědu a skončí" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version vypíše údaje o verzi a skončí" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Použití: %s [PŘEPÍNAČ]… MŮJ_SOUBOR STARÝ_SOUBOR VÁŠ_SOUBOR\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Porovnání tří souborů řádek po řádku." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"Výchozí výstupní formát je více méně člověkem čitelná reprezentace změn.\n" +"\n" +"Přepínače -e, -E, -x, -X (a odpovídající dlouhé přepínače) způsobí vypsání\n" +"skriptu pro program ed namísto výchozího formátu.\n" +"\n" +"Nakonec přepínač -m (--merge) způsobí, že diff3 provede spojení sám a " +"vypíše\n" +"vlastní spojený soubor. V případě neobvyklého vstupu, je toto spolehlivější\n" +"způsob než použití programu ed.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "Návratová hodnota je 0 při úspěchu, 1 při konfliktu a 2 při chybě." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "vnitřní chyba: chyba ve formátu diff bloků" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff selhal: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "vnitřní chyba: nesprávný typ diffu v process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "neplatný formát diff souboru; neplatný oddělovač změny" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "neplatný formát diff souboru; nekompletní poslední řádek" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "pomocný program „%s“ nebylo možné zavolat" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "neplatný formát diff souboru; nesprávné úvodní znaky na řádku" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "vnitřní chyba: nesprávný typ diffu pro výstup" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "vstupní soubor se zmenšil" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "nelze porovnat názvy souborů „%s“ a „%s“" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: smyčka v rekurzi adresářů" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o, --output=SOUBOR interaktivní režim, výstup půjde do SOUBORU" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i, --ignore-case nerozlišuje velká a malá písmena" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "-E, --ignore-tab-expansion ignoruje změny v odsazení tabulátorem" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" +"-Z, --ignore-trailing-space ignoruje všechny bílé znaky na konci řádku" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change ignoruje změny v počtu bílých znaků" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space ignoruje všechny bílé znaky" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "-B, --ignore-blank-lines ignoruje změny v případě prázdných řádků" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RV ignoruje změny na všech řádcích\n" +" odpovídajících RV" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr odstraní ukončovací znak CR na vstupu" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a, --text pokládá všechny soubory za text" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=POČET vypíše nejvýše POČET (výchozí je 130) " +"tiskových\n" +" sloupců" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" +"-l, --left-column vypíše pouze levý sloupec společných řádků" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines nevypisuje společné řádky" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs ve výstupu převede tabulátory na mezery" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +" --tabsize=POČET tabulátor zastavuje každých POČET (výchozí je " +"8)\n" +" tiskových sloupců" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal pokusí se nalézt nejmenší sadu změn" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files předpokládá velké soubory a mnoho rozptýlených\n" +" drobných změn" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=PROGRAM použije PROGRAM k porovnání souborů" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help zobrazí tuto nápovědu a skončí" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v, --version vypíše údaje o verzi a skončí" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Použití: %s [PŘEPÍNAČ]… SOUBOR1 SOUBOR2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Spojí změny mezi SOUBOREM1 a SOUBOREM2 v režimu „vedle sebe“." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "interaktivně nelze standardní vstup sloučit" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "oba soubory k porovnání jsou adresáři" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tEditace - použije obě verze, každou obdaří hlavičkou.\n" +"eb:\tEditace - použije obě verze.\n" +"el nebo e1:\tEditace - použije levou verzi.\n" +"er nebo e2:\tEditace - použije pravou verzi.\n" +"e:\tZahození obou verzí a editace nové verze.\n" +"l nebo 1:\tPoužije levou verzi.\n" +"r nebo 2:\tPoužije pravou verzi.\n" +"s:\tV tichosti vloží společné řádky.\n" +"v:\tUpozorní na vložení společných řádků.\n" +"q:\tUkončení.\n" + +#: src/util.c:662 +#, c-format +msgid "unrecognized prefix: %s" +msgstr "nerozpoznaná předpona: %s" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "nerozebratelná hodnota pro přepínač --pellete" + +#~ msgid " or 'auto' (the default)" +#~ msgstr " nebo „auto“ (výchozí)" + +#~ msgid "" +#~ " --palette=PALETTE specify the colors to use when --color is active" +#~ msgstr "" +#~ " --pellete=PALETA určuje barvy, které se použijí se zapnutým --" +#~ "color" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: přepínač „--%s“ musí být zadán bez argumentu\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: neznámý přepínač „--%s“\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: přepínač „-W %s“ není jednoznačný\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: přepínač „-W %s“ musí být zadán bez argumentu\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: přepínač „-W %s“ vyžaduje argument\n" + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i N1:N2 --ignore-initial=N1:N2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "-s --quiet --silent Žádný výstup; vrátí pouze status." + +#~ msgid "--help Output this help." +#~ msgstr "--help Vypíše tuto nápovědu." + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ "-c -C POČ --context[=POČ] Vypíše POČ (implicitně 3) řádky " +#~ "kopírovaného\n" +#~ " kontextu.\n" +#~ "-u -U POČ --unified[=POČ] Vypíše POČ (implicitně 3) řádky " +#~ "sjednoceného\n" +#~ " kontextu.\n" +#~ " -L POPIS --label POPIS Použije POPIS místo jména souboru.\n" +#~ " -p --show-c-function U každé změny vypíše jméno C funkce, ve které " +#~ "se\n" +#~ " tato změna nachází.\n" +#~ " -F RV --show-function-line=RV Vypíše nejnovější řádky odpovídající RV." + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ "-y --side-by-side Výstup ve dvou sloupcích.\n" +#~ " -W POČ --width=POČ Vypíše maximálně POČ (implicitně 130) znaků na " +#~ "řádek.\n" +#~ " --left-column Vypíše pouze levý sloupec společných řádků.\n" +#~ " --suppress-common-lines Nevypíše společné řádky." + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "" +#~ "--speed-large-files Předpokládá velké soubory a mnoho rozptýlených\n" +#~ " drobných změn." + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "-X Vypíše překrývající se změny, uzavřené v závorkách." + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "" +#~ "-m --merge Vypíše spojený soubor místo ed skriptu (implicitně -A)." + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "-L POPIS --label=POPIS Použije POPIS místo jména souboru." diff --git a/local/recipes/tools/diffutils/source/po/da.gmo b/local/recipes/tools/diffutils/source/po/da.gmo new file mode 100644 index 0000000000..ccc9625e11 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/da.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/da.po b/local/recipes/tools/diffutils/source/po/da.po new file mode 100644 index 0000000000..4170192ddd --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/da.po @@ -0,0 +1,1599 @@ +# Danish diffutils translation po-file +# Copyright (C) 2000, 2012, 2017 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# +# Claus Hindsgaul <claus_h@image.dk>, 2000-2002. +# Ask Hjorth Larsen <asklarsen@gmail.com>, 2010-2012, 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: diffutils-3.5.14\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2017-02-06 19:52+0100\n" +"Last-Translator: Ask Hjorth Larsen <asklarsen@gmail.com>\n" +"Language-Team: Danish <dansk@dansk-gruppen.dk>\n" +"Language: da\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: KBabel 0.9.5\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "ugyldigt argument %s til %s" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "flertydigt argument %s til %s" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "Gyldige argumenter er:" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "programfejl" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "stakoverløb" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Ukendt systemfejl" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "almindelig tom fil" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "almindelig fil" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "katalog" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "symbolsk lænke" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "meddelelseskø" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "signal" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "delt hukommelses-objekt" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "typeangivet hukommelses-objekt" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "blok-specialfil" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "tegn-specialfil" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "Sammenhængende data" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "dør" + +#: lib/file-type.c:81 +msgid "multiplexed block special file" +msgstr "multiplekset blokspecialfil" + +#: lib/file-type.c:84 +msgid "multiplexed character special file" +msgstr "multiplekset tegnspecialfil" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "multiplekset fil" + +#: lib/file-type.c:90 +msgid "named file" +msgstr "navngivet fil" + +#: lib/file-type.c:93 +msgid "network special file" +msgstr "netværksspecialfil" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "migreret fil med data" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "migreret fil uden data" + +#: lib/file-type.c:102 +msgid "port" +msgstr "port" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "stik" + +# ?? +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "whiteout" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "mystisk fil" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: tilvalget \"%s\" er flertydigt\n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: tilvalget \"%s\" er flertydigt; muligheder:" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: ukendt tilvalg \"%c%s\"\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: tilvalget \"%c%s\" tillader ikke et argument\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: tilvalget \"--%s\" kræver et argument\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: ugyldigt tilvalg -- \"%c\"\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: tilvalg kræver et argument -- \"%c\"\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "\"" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "\"" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Succes" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Ingen match" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Ugyldigt regulært udtryk" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Ugyldig sammenlignings-tegn" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Ugyldigt navn på tegn-klasse" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Efterstillet backslash" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Ugyldig bagud-reference" + +#: lib/regcomp.c:156 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Uparret [, [^, [:, [. eller [=" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Uparret ( eller \\(" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Uparret \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Ugyldigt indhold af \\{\\}" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Ugyldig område-afslutning" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Hukommelse opbrugt" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Ugyldigt foranstillet regulært udtryk" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "For tidlig afslutning på regulært udtryk" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "For stort regulært udtryk" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Uparret ) eller \\)" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Intet foranstillet regulært udtryk" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "hukommelse opbrugt" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "stdin" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "stdout" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "stderr" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "ukendt strøm" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "kunne ikke genåbne %s i tilstand %s" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "ugyldigt %s%s-argument \"%s\"" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "ugyldig endelse i %s%s-argument \"%s\"" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "%s%s-argumentet \"%s\" er for stort" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Pakket af %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Pakket af %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +# første linje passer netop ind i 80 linjer (hvilket ikke ville være tilfældet med 'version' frem for 'udgave' +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Licens GPLv3+: GNU GPL udgave 3 eller nyere <http://gnu.org/licenses/gpl." +"html>.\n" +"Dette er fri software: Du kan frit ændre og videredistribuere det.\n" +"Der gives INGEN GARANTI, i den grad som dette er tilladt af loven.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Skrevet af %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Skrevet af %s og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Skrevet af %s, %s og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Skrevet af %s, %s, %s\n" +"og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Skrevet af %s, %s, %s,\n" +"%s og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Skrevet af %s, %s, %s,\n" +"%s, %s og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Skrevet af %s, %s, %s,\n" +"%s, %s, %s og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Skrevet af %s, %s, %s,\n" +"%s, %s, %s, %s\n" +"og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Skrevet af %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Skrevet af %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s og andre.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Rapportér fejl til: %s\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Rapportér fejl i %s til: %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Hjemmeside for %s: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "Hjemmeside for %s: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "Generel hjælp til GNU-programmer: <http://www.gnu.org/gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Filerne %s og %s er forskellige\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Binære filer %s og %s er forskellige\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Intet linjeskift ved filafslutning" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjörn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Prøv \"%s --help\" for mere information." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "ugyldig værdi \"%s\" for --ignore-initial" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "tilvalgene -l og -s er inkompatible" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "skrivning mislykkedes" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "standard-ud" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b, --print-bytes vis afvigende byte" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i, --ignore-initial=SPRING spring de første SPRING byte over i begge\n" +" input" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=SPRING1:SPRING2 spring de første SPRING1 byte af FIL1 " +"og\n" +" SPRING2 byte af FIL2 over" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l, --verbose vis numre og værdier for de byte, der er " +"forskellige" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=GRÆNSE sammenlign højst GRÆNSE byte" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent undertryk al normal udskrift" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help vis denne hjælpetekst og afslut" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v, --version vis versionsoplysninger og afslut" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Brug: %s [TILVALG]... FIL1 [FIL2 [SPRING1 [SPRING2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Sammenlign to filer byte for byte." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"De valgfri SPRING1 og SPRING2 angiver antallet af byte, der skal springes\n" +"over ved begyndelsen af hver fil (normalt 0)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Obligatoriske argumenter til lange tilvalg er også obligatoriske til de " +"korte.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"SPRING-værdier kan efterfølges af følgende enheder:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, og så videre for T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Såfremt en FIL er \"-\" eller mangler, læses fra standard-ind." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"Slutstatus er 0 hvis inddata er ens, 1 hvis ikke, og 2 hvis der er problemer." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "ugyldig værdi \"%s\" for --bytes" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "manglende operand efter \"%s\"" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "ekstra operand \"%s\"" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s afviger: byte %s, linje %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s afviger: tegn %s, linje %s er %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: filafslutning på %s\n" + +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s %s afviger: byte %s, linje %s\n" + +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s %s afviger: byte %s, linje %s\n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: filafslutning på %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "ugyldig kontekstlængde \"%s\"" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "paginering understøttes ikke af denne vært" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "for mange fil-mærke tilvalg" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "ugyldig bredde \"%s\"" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "modstridende breddeangivelser" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "ugyldig horisontlængde \"%s\"" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "ugyldig tabulatorbredde \"%s\"" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "modstridende angivelser af tabulatorbredde" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "både --from-file og --to-file er angivet" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr " --normal udskriv en almindelig diff (forvalg)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "-q, --brief angiv kun når filerne er forskellige" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s, --report-identical-files rapportér hvis to filer er ens" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C ANTAL, --context[=ANTAL] udskriv ANTAL (normalt 3) linjer med " +"kopieret\n" +" kontekst" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U ANTAL, --unified[=ANTAL] Udskriv højst ANTAL (normalt 3) linjer\n" +" forenet kontekst" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed udskriv et ed-script" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n, --rcs udskriv en diff i RCS-format" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side udskriv i to kolonner" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=ANTAL udskriv højst ANTAL (normalt 130) kolonner" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +" --left-column udskriv kun venstre kolonne i fælles linjer" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines udskriv ikke fælles linjer" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "-p, --show-c-function vis hvilken C-funktion hver ændring er i" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "-F, --show-function-line=RE vis den seneste linje der matcher RE" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label MÆRKAT brug MÆRKAT frem for filnavn og tidsstempel\n" +" (kan gentages)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs lav tabulatorer om til mellemrum i udskrift" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab få tabulatorer på linje ved at forudstille en\n" +" tabulator" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=ANTAL tabulatorstop for hver ANTAL (normalt 8) " +"kolonner" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty intet mellemrum eller tabulator før tomme\n" +" ud-linjer" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" +"-l, --paginate led uddata gennem \"pr\" for at sideinddele det" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r, --recursive sammenlign alle fundne underkataloger " +"rekursivt" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference følg ikke symbolske lænker" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "" +"-N, --new-file behandl manglende filer som var de tomme" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +" --unidirectional-new-file behandl manglende førstefiler som var de " +"tomme" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case ingen forskel på store og små bogstaver ved\n" +" sammenligning af filnavne" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case skeln mellem store og små bogstaver ved\n" +" sammenligning af filnavne" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "-x, --exclude=MØNSTER udelad filer, det matcher MØNSTER" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=FIL udelad filer, der matcher ethvert mønster i " +"FIL" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=FIL start med FIL, når der sammenlignes kataloger" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=FIL1 sammenlign FIL1 med alle operander; FIL1 må\n" +" godt være et katalog" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=FIL1 sammenlign alle operander med FIL2. FIL2 " +"må\n" +" godt være et katalog" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "-i, --ignore-case ignorér versalforskelle i filindhold" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion ignorér ændringer der skyldes\n" +" tabulatoromsætning" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" +"-Z, --ignore-trailing-space ignorér blanke tegn ved linjens afslutning" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change ignorér ændringer i mængden af blanke tegn" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space ignorér alle blanke tegn" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "-B, --ignore-blank-lines ignorér ændringer med kun tomme linjer" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=MØNSTER ignorér ændringer, hvis linjer alle\n" +" matcher MØNSTER" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text behandl alle filer som tekst" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr fjern afsluttende vognretur i inddata" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr " --binary læs og skriv data binært" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=NAVN udskriv flettet fil med \"#ifdef NAVN\"-" +"differ" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr " --GTYPE-group-format=GFMT formatér GTYPE-inputgrupper med GFMT" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr " --line-format=LFMT formatér alle inputlinjer med LFMT" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr " --LTYPE-line-format=LFMT formatér LTYPE-inputlinjer med LFMT" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" Disse formattilvalg giver finkontrol over udskriften af diff, og\n" +" generaliserer -D/--ifdef." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE er \"old\" (gammel), \"new\" (ny) eller \"unchanged\" (uændret).\n" +" GTYPE er LTYPE eller \"changed\" (ændret)." + +# hvad er PREC? Det står ingen steder i filen. PRÆC blev brugt i tidligere +# oversættelse, så beholder. -Ask +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT (kun) må indeholde:\n" +" %< linjer fra FIL\n" +" %> linjer fra FIL2\n" +" %= linjer både i FIL1 og FIL2\n" +" %[-][BREDDE][.[PRÆC]]{doxX}BOGSTAV printf-angivelse for BOGSTAV\n" +" BOGSTAVer er som følger for ny gruppe, eller som små bogstaver for " +"gammel\n" +" gruppe:\n" +" F første linjenummer\n" +" L sidste linjenummer\n" +" N antal linjer = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) hvis A lig med B så T, ellers E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT (kun) må indeholde:\n" +" %L indhold af linje\n" +" %l indhold af linje, undtagen eventuelt følgende linjeskift\n" +" %[-][BREDDE][.[PRÆC]]{doxX}n printf-angivelse for inputlinjenummer" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" GFMT og LFMT kan begge indeholde:\n" +" %% %\n" +" %c'C' tegnet C\n" +" %c'\\OOO' tegnet med oktalkode OOO\n" +" C tegnet C (andre tegn repræsenterer sig selv)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d, --minimal grundigt forsøg på at finde et mindre antal " +"ændringer" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +" --horizon-lines=ANTAL behold ANTAL linjer af fælles præfiks og suffiks" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files antag store filer og mange spredte, små ændringer" + +#: src/diff.c:974 +#, fuzzy +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" +" --color[=HVORNÅR] farv udskriften; HVORNÅR kan være \"never\", " +"\"always\"" + +# ikke direkte oversat men det må være ok +#: src/diff.c:976 +#, fuzzy +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" +" PALET er en kolon-adskilt liste af terminfo-" +"egenskaber" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help vis denne hjælpetekst og afslut" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version vis versionsoplysninger og afslut" + +#: src/diff.c:982 +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"FILER er \"FIL1 FIL2\" eller \"KATALOG1 KATALOG2\" eller \"KATALOG FIL\" " +"eller \"FIL KATALOG\"." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Hvis --from-file eller --to-file er givet, er der ingen restriktioner på " +"FILer." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Såfremt en FIL er \"-\", læses fra standard-ind." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Brug: %s [TILVALG]... FILER\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Sammenlign filer linjevis." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "modstridende værdi for %s-tilvalget: \"%s\"" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "modstridende valg af uddata-stil" + +#: src/diff.c:1058 +#, c-format +msgid "invalid color '%s'" +msgstr "ugyldig farve \"%s\"" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Kun i %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "kan ikke sammenligne \"-\" med et katalog" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "-D tilvalg understøttes ikke for kataloger" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Identiske underkataloger: %s og %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Filen %s er en %s mens filen %s er en %s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "De symbolske lænker %s og %s er forskellige\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Filerne %s og %s er identiske\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "inkompatible tilvalg" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "\"-\" angivet for mere end én ind-fil" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "læsning mislykkedes" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A, --show-all udskriv alle ændringer, med konflikter i " +"parenteser" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed udskriv et ed-script som udfører ændringerne\n" +" fra GAMMELFIL til DINFIL ind i MINFIL" + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "-E, --show-overlap som -e, men sæt konflikter i parentes" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3, --easy-only som -e, men inkludér kun ikke-overlappende " +"ændringer" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +"-x, --overlap-only som -e, men inkludér kun overlappende ændringer" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "-X som -x, men sæt konflikter i parenteser" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "" +"-i tilføj \"w\" og \"q\"-kommandoer til ed-script" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge udskriv faktisk flettet fil ifølge -A\n" +" hvis ingen andre tilvalg er givet" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text behandl alle filer som tekst" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr fjern afsluttende vognretur i inddata" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab få tabulatorer på linje ved at forudstille\n" +" en tabulator" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=PROGRAM brug PROGRAM til at sammenligne filerne" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=MÆRKAT brug MÆRKAT frem for filnavn\n" +" (kan gentages op til tre gange)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help vis denne hjælpetekst og afslut" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version vis versionsoplysninger og afslut" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Brug: %s [TILVALG]... MINFIL GAMMELFIL DINFIL\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Sammenlign tre filer linje for linje." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"Som standard bruges et rimelig læsevenligt udskriftsformat til " +"repræsentation\n" +"af ændringerne.\n" +"\n" +"Tilvalgene -e, -E, -x, -X (og de tilsvarende lange) får et ed-script til at\n" +"blive udskrevet frem for standardopførslen.\n" +"\n" +"Endelig får tilvalget -m (--merge) diff3 til at flette internt, og udskrive\n" +"den faktiske flettede fil. Til usædvanlige inddata er dette mere robust " +"end\n" +"med ed.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"Slutstatus er 0 hvis succes, 1 hvis der er konflikter, 2 hvis der er " +"problemer." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "intern fejl: rod i formatet på diff blokke" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff fejlede: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "intern fejl: ugyldig diff type i process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "ugyldigt diff format; ugyldig ændrings-separator" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "ugyldigt diff format; uafsluttet sidste linje" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "hjælpeprogrammet \"%s\" kunne ikke køres" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "ugyldigt diff format; forkerte linje-begyndelses-tegn" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "intern fejl: ugyldig diff type sendt til uddata" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "ind-fil formindskedes" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "kan ikke sammenligne filnavnene \"%s\" og \"%s\"" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: rekursiv katalogløkke" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o, --output=FIL arbejd interaktivt, og send uddata til FIL" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "" +"-i, --ignore-case anse store og små bogstaver for at være ens" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion ignorér ændringer, der skyldes " +"tabulatoromsætning" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" +"-Z, --ignore-trailing-space ignorér blanke tegn ved linjens afslutning" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change ignorér ændringer i mængden af blanke tegn" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space ignorér alle blanke tegn" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" +"-B, --ignore-blank-lines ignorér ændringer med udelukkende blanke linjer" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=MØNSTER ignorér ændringer, hvis linjer alle\n" +" matcher MØNSTER" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr fjern afsluttende vognretur i inddata" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a, --text behandl alle filer som tekst" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "-w, --width=ANTAL udskriv højst ANTAL (normalt 130) søjler" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "-l, --left-column vis kun venstre kolonne af fælles linjer" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines vis ingen fælles linjer" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs lav tabulatorer om til mellemrum i output" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +" --tabsize=ANTAL tabulatorstop for hver ANTAL (normalt 8) " +"kolonner" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d, --minimal forsøg ihærdigt at finde et mindre antal " +"ændringer" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files antag store filer og mange spredte, små " +"ændringer" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=PROGRAM brug PROGRAM til at sammenligne filerne" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help vis denne hjælpetekst og afslut" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v, --version vis versionsoplysninger og afslut" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Brug: %s [TILVALG]... FIL1 FIL2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Side om side-fletning af forskelle mellem FIL1 og FIL2." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "kan ikke indflette standard input interaktivt" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "begge filer der sammenlignes er kataloger" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tRedigér og brug så begge udgaver, hver udstyret med et hoved.\n" +"eb:\tRedigér og brug så begge udgaver.\n" +"el eller e1:\tRedigér og brug så venstre udgave.\n" +"er eller e2:\tRedigér og brug så højre udgave.\n" +"e:\tForkast begge udgaver og redigér så en ny.\n" +"l eller 1:\tBrug venstre udgave.\n" +"r eller 2:\tBrug højre udgave.\n" +"s:\tMedtag fælles linjer uden at skrive meddelelser.\n" +"v:\tMedtag og vis fælles linjer.\n" +"q:\tAfslut.\n" + +#: src/util.c:662 +#, c-format +msgid "unrecognized prefix: %s" +msgstr "ukendt præfiks: %s" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "værdi for --palette kan ikke fortolkes" + +#~ msgid " or 'auto' (the default)" +#~ msgstr " eller \"auto\" (standard)" + +#~ msgid "" +#~ " --palette=PALETTE specify the colors to use when --color is active" +#~ msgstr "" +#~ " --palette=PALET angiv farverne, der skal bruges givet --color" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: tilvalget \"--%s\" tillader ikke et argument\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: ukendt tilvalg \"--%s\"\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: tilvalget \"-W %s\" er flertydigt\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: tilvalget \"-W %s\" tillader ikke et argument\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: tilvalget \"-W %s\" tillader ikke et argument\n" + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i SPRING1:SPRING2 --ignore-initial=SPRING1:SPRING2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "" +#~ "-s --quiet --silent Ingen udskrift; sæt kun en afslutnings-slut-kode." + +#~ msgid "--help Output this help." +#~ msgstr "--help Vis denne hjælpetekst." + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ "-c -C ANTAL --context[=ANTAL] Udskriv ANTAL (normalt 3) linjer af " +#~ "kopieret kontekst.\n" +#~ "-u -U ANTAL --unified[=ANTAL] Udskriv ANTAL (normalt 3) linjer af " +#~ "forenet kontekst.\n" +#~ " -L MÆRKE --label MÆRKE Brug MÆRKE i stedet for filnavn.\n" +#~ " -p --show-c-function Vis hvilken C funktion hver ændring er i.\n" +#~ " -F MØNSTER --show-function-line=MØNSTER Vis den sidste foregående " +#~ "linje, der matcher MØNSTER." + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "-L MÆRKE --label=MÆRKE Brug MÆRKE i stedet for filnavn." + +#~ msgid "" +#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n" +#~ "You may redistribute copies of this program\n" +#~ "under the terms of the GNU General Public License.\n" +#~ "For more information about these matters, see the file named COPYING." +#~ msgstr "" +#~ "Dette program kommer HELT UDEN GARANTI i den udstrækning, loven tillader " +#~ "det.\n" +#~ "Du må videredistribuere kopier af dette program\n" +#~ "under betingelserne i GNU General Public License (GPL).\n" +#~ "Se filen COPYING for flere oplysninger om dette." + +#~ msgid "%s: illegal option -- %c\n" +#~ msgstr "%s: ugyldigt tilvalg -- %c\n" + +#~ msgid "Written by Torbjorn Granlund and David MacKenzie." +#~ msgstr "Skrevet af Torbjorn Granlund og David MacKenzie." + +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>." +#~ msgstr "Raportér programfejl på engelsk til <bug-gnu-utils@gnu.org>." + +#~ msgid "" +#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman, and Len Tower." +#~ msgstr "" +#~ "Skrevet af Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman og Len Tower." diff --git a/local/recipes/tools/diffutils/source/po/de.gmo b/local/recipes/tools/diffutils/source/po/de.gmo new file mode 100644 index 0000000000..951a2b3270 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/de.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/de.po b/local/recipes/tools/diffutils/source/po/de.po new file mode 100644 index 0000000000..fa10df3db1 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/de.po @@ -0,0 +1,1681 @@ +# German messages for GNU diffutils. +# This file is distributed under the same license as the diffutils package. +# Copyright (C) 1996, 2001, 2002, 2012, 2013 Free Software Foundation, Inc. +# Karl Eichwalder <keichwa@gmx.net>, 1996 +# Martin von Löwis <martin@v.loewis.de>, 1997, 2001, 2002 +# Jakob Kramer <jakob.kramer@gmx.de>, 2012, 2013. +# Benno Schulenberg <bensberg@justemail.net>, 2013. +# Mario Blättermann <mario.blaettermann@gmail.com>, 2014, 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU diffutils 3.5.25\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2017-05-11 10:57+0200\n" +"Last-Translator: Mario Blättermann <mario.blaettermann@gmail.com>\n" +"Language-Team: German <translation-team-de@lists.sourceforge.net>\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 1.8.12\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "ungültiges Argument %s für %s" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "Argument %s für %s ist mehrdeutig" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "Gültige Argumente sind:" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "Programmfehler" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "Stacküberlauf" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Unbekannter Systemfehler" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "normale leere Datei" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "normale Datei" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "Verzeichnis" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "symbolische Verknüpfung" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "Nachrichten-Warteschlange" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "Semaphor" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "gemeinsames Speicherobjekt" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "typisiertes Speicherobjekt" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "blockorientiertes Gerät" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "zeichenorientiertes Gerät" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "zusammenhängende Daten" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "FIFO" + +#: lib/file-type.c:78 +msgid "door" +msgstr "Door" + +#: lib/file-type.c:81 +msgid "multiplexed block special file" +msgstr "blockorientierte Multiplex-Spezialdatei" + +#: lib/file-type.c:84 +msgid "multiplexed character special file" +msgstr "zeichenorientierte Multiplex-Spezialdatei" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "Multiplex-Datei" + +#: lib/file-type.c:90 +msgid "named file" +msgstr "benannte Datei" + +#: lib/file-type.c:93 +msgid "network special file" +msgstr "Netzwerk-Spezialdatei" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "migrierte Datei mit Daten" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "migrierte Datei ohne Daten" + +#: lib/file-type.c:102 +msgid "port" +msgstr "Port" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "Socket" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "Whiteout" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "seltsame Datei" + +#: lib/getopt.c:278 +#, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: Option »%s%s« ist mehrdeutig\n" + +#: lib/getopt.c:284 +#, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: Option »%s%s« ist mehrdeutig, Möglichkeiten:" + +#: lib/getopt.c:319 +#, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: Unbekannte Option »%s%s«.\n" + +#: lib/getopt.c:345 +#, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: Option »%s%s« erlaubt kein Argument.\n" + +#: lib/getopt.c:360 +#, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: Option »%s%s« verlangt ein Argument.\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: ungültige Option -- »%c«\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: Option verlangt ein Argument -- »%c«\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "»" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "«" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Erfolg." + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Keine Übereinstimmung." + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Ungültiger regulärer Ausdruck." + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Ungültiges Sortierzeichen." + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Ungültiger Name für Zeichenklasse." + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Extra Backslash am Ende." + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Ungültige Rückreferenz." + +#: lib/regcomp.c:156 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Öffnende [, [^, [:, [. oder [= ohne schließende." + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Öffnende ( oder \\( ohne schließende." + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Öffnende \\{ ohne schließende." + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Ungültiger Inhalt von \\{\\}." + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Ungültiges Bereichsende." + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Speicher verbraucht." + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Ungültiger vorhergehender regulärer Ausdruck." + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Vorzeitiges Ende des regulären Ausdrucks." + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Regulärer Ausdruck ist zu groß." + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Schließende ) oder \\) ohne öffnende." + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Kein vorhergehender regulärer Ausdruck." + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "Speicher verbraucht." + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "Standardeingabe" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "Standardausgabe" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "Standardfehlerausgabe" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "unbekannter Datenstrom" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "%s konnte mit Modus %s nicht wieder geöffnet werden" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "ungültiges %s%s-Argument »%s«" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "ungültiges Suffix in %s%s Argument »%s«" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "%s%s-Argument »%s« ist zu groß" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Paket erstellt von %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Paket erstellt von %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Lizenz GPLv3+: GNU GPL Version 3 oder später <http://www.gnu.org/licenses/" +"gpl.html>.\n" +"Dies ist freie Software: Sie dürfen sie verändern und verbreiten.\n" +"Es gibt KEINE GARANTIE, soweit diese nicht durch das Gesetz vorgeschrieben\n" +"wird.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Geschrieben von %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Geschrieben von %s und %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Geschrieben von %s, %s und %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Geschrieben von %s, %s, %s\n" +"und %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Geschrieben von %s, %s, %s,\n" +"%s und %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Geschrieben von %s, %s, %s,\n" +"%s, %s und %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Geschrieben von %s, %s, %s,\n" +"%s, %s, %s und %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Geschrieben von %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"und %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Geschrieben von %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s und %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Geschrieben von %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s und weiteren.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Fehlerberichte an %s.\n" +"Übersetzungsfehler an <http://translationproject.org/team/de.html>.\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Berichten Sie Fehler in %s an %s.\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Homepage von %s: <%s>.\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "Homepage von %s: <http://www.gnu.org/software/%s/>.\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"Allgemeine Hilfe zur Benutzung von GNU-Software: <http://www.gnu.org/gethelp/" +">\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Dateien %s und %s sind verschieden.\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Binärdateien %s und %s sind verschieden.\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Kein Zeilenumbruch am Dateiende." + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjörn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "»%s --help« gibt Ihnen mehr Informationen." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "ungültiger --ignore-initial-Wert »%s«." + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "Die Optionen -l und -s sind inkompatibel." + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "Schreibfehler." + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "Standardausgabe" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b, --print-bytes Unterschiedliche Bytes ausgeben." + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i, --ignore-initial=SKIP\n" +" Die ersten SKIP Bytes der Eingabe überspringen." + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=SKIP1:SKIP2\n" +" Die ersten SKIP1 Bytes von DATEI1 und die\n" +" ersten SKIP2 Bytes von DATEI2 überspringen." + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l, --verbose Bytenummern und Werte aller unterschiedlichen\n" +" Bytes ausgeben." + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=LIMIT Höchstens LIMIT Bytes vergleichen." + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent Alle normalen Ausgaben unterdrücken." + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help Diese Hilfe anzeigen und beenden." + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v, -version Versionsinformation ausgeben und beenden." + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Aufruf: %s [OPTION]... DATEI1 [DATEI2 [SKIP1 [SKIP2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Zwei Dateien Byte für Byte vergleichen." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"Die optionalen Argumente SKIP1 und SKIP2 geben die Zahl der Bytes an,\n" +"die in jeder Datei übersprungen werden (standardmäßig null)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Nötige Argumente für lange Optionen sind auch für kurze Optionen nötig.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"SKIP-Werte dürfen die folgenden multiplikativen Anhänge haben:\n" +"kB 1000, K 1024, MB 1.000.000, M 1.048.576,\n" +"GB 1.000.000.000, G 1.073.741.824, und so weiter für T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Wenn DATEI »-« ist oder fehlt, wird von der Standardeingabe gelesen." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"Der Rückgabewert des Programms ist 0, falls die Eingaben identisch\n" +"sind, 1 falls sie verschieden sind und 2, falls es Probleme gab." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "ungültiger --bytes-Wert »%s«" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "fehlender Operand nach »%s«" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "extra Operand »%s«." + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s sind verschieden: Byte %s, Zeile %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s sind verschieden: Zeichen %s, Zeile %s ist %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: Dateiende in %s, welche leer ist.\n" + +#: src/cmp.c:585 +#, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "cmp: Dateiende in %s nach Byte %s, Zeile %s\n" + +#: src/cmp.c:586 +#, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "cmp: Dateiende in %s nach Byte %s, Zeile %s\n" + +#: src/cmp.c:592 +#, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: Dateiende in %s nach Byte %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "ungültige Kontextlänge »%s«." + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "Seitenumbruch wird auf diesem System nicht unterstützt." + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "Zu viele Datei-Label-Optionen wurden angegeben." + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "ungültige Breite »%s«." + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "widersprüchliche Breitenoptionen" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "ungültige Horizontlänge »%s«." + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "ungültige Tabulatorbreite »%s«." + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "widersprüchliche Tabulatorbreitenoptionen." + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "--from-file und --to-file sind beide angegeben." + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr " --normal Ein normales Diff ausgeben (Vorgabe)." + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "" +"-q, --brief Nur ausgeben, ob die Dateien verschieden " +"sind." + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "" +"-s, --report-identical-files Zurückgeben, ob zwei Dateien gleich sind." + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C ZAHL, --context[=ZAHL] ZAHL Zeilen des kopierten Kontexts ausgeben\n" +" (Vorgabe: 3)." + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U ZAHL, --unified[=ZAHL] ZAHL Zeilen des Unified-Kontexts ausgeben\n" +" (Vorgabe: 3)." + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed Ein ed-Skript ausgeben." + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n, --rcs Im RCS-Format ausgeben." + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side In zwei Spalten ausgeben." + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=ZAHL Maximal ZAHL Druckspalten pro Zeile " +"ausgeben\n" +" (Vorgabe: 130)." + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +" --left-column Nur linke Spalte der gemeinsamen Zeilen\n" +" ausgeben." + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines Keine gemeinsamen Zeilen ausgeben." + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" +"-p, --show-c-function Für jede Änderung zeigen, in welcher\n" +" C-Funktion sie ist." + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" +"-F, --show-function-line=RE Die vorangehende Zeile zeigen, die dem " +"Muster\n" +" RE entspricht." + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label LABEL LABEL statt des Dateinamens und " +"Zeitstempels\n" +" benutzen (kann wiederholt werden)." + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, -expand-tabs Tabulatoren in der Ausgabe zu Leerzeichen\n" +" ausdehnen." + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab Einrückungen durch vorangestellte " +"Tabulatoren\n" +" erzeugen." + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=ZAHL Tabulatorstopps sind alle ZAHL Spalten\n" +" (Vorgabe: 8)." + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty Leerzeichen oder Tabulator vor leeren\n" +" Ausgabezeilen verhindern." + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" +"-l, --paginate Ausgabe an »pr« zum Seitenumbruch übergeben." + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r, --recursive Rekursiv alle Unterverzeichnisse vergleichen." + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr "" +" --no-dereference Symbolischen Verknüpfungen nicht folgen." + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "-N, --new-file Fehlende Dateien als leer betrachten." + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +" --unidirectional-new-file Fehlende erste Dateien als leer betrachten." + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case Unterschiede der Groß-/Kleinschreibung von\n" +" Dateinamen ignorieren." + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case Unterschiede der Groß-/Kleinschreibung von\n" +" Dateinamen beachten." + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "" +"-x, --exclude=MUSTER Dateien ausschließen, die auf MUSTER passen." + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=DATEI Dateien ausschließen, die auf eines der\n" +" Muster in DATEI passen." + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=DATEI Beim Verzeichnisvergleich mit DATEI beginnen." + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=DATEI1 DATEI1 mit allen Operanden vergleichen.\n" +" DATEI1 kann ein Verzeichnis sein." + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=DATEI2 Alle Operanden mit DATEI2 vergleichen.\n" +" DATEI2 kann ein Verzeichnis sein." + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i, --ignore-case Unterschiede der Groß-/Kleinschreibung\n" +" im Dateiinhalt ignorieren." + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion Änderungen aufgrund von Tabausdehnungen\n" +" ignorieren." + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space Leerraum am Zeilenende ignorieren." + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change Änderungen im Leerraum ignorieren." + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space Leerraum ignorieren." + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B, --ignore-blank-lines Änderungen ignorieren, bei denen alle " +"Zeilen\n" +" leer sind." + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE Änderungen ignorieren, bei denen alle " +"Zeilen\n" +" auf das Muster RE passen." + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text Alle Dateien als Text behandeln." + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr Wagenrücklauf (CR) am Zeilenende beim\n" +" Einlesen entfernen." + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr "" +" --binary Daten im Binärmodus lesen und schreiben." + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=NAME Zusammengefügte Datei mit »#ifdef NAME« in\n" +" die Ausgabe mischen." + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr " --GTYPE-group-format=GFMT GTYPE-Eingabe mit GFMT formatieren." + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "" +" --line-format=LFMT Alle Eingabe-Zeilen mit LFMT formatieren." + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr " --LTYPE-line-format=LFMT LTYPE-Eingabe mit LFMT formatieren." + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" Diese Formatoptionen stellen haargenaue Kontrolle über die Eingabe\n" +" von diff bereit, indem -D/--ifdef verallgemeinert wird." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE kann »old«, »new« oder »unchanged« sein.\n" +" GTYPE ist LTYPE oder »changed«." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT kann (nur) enthalten:\n" +" %< Zeilen von DATEI1.\n" +" %> Zeilen von DATEI2.\n" +" %= Zeilen, die sowohl zu DATEI1 als auch zu DATEI2 gehören.\n" +" %[-][BREITE][.[PRÄZ]]{doxX}BUCHST Ausgabe nach printf-Regeln für " +"BUCHST.\n" +" Die folgenden BUCHSTaben gelten für neue Gruppen,\n" +" die entsprechenden Kleinbuchstaben für alte:\n" +" F Erste Zeilennummer.\n" +" L Letzte Zeilennummer.\n" +" N Zahl der Zeilen = L-F+1.\n" +" E F-1.\n" +" M L+1.\n" +" %(A=B?T:E) Falls A gleich B, dann T, sonst E." + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT kann (nur) enthalten:\n" +" %L Inhalt der Zeile.\n" +" %l Inhalt der Zeile, ohne Zeilenumbruch am Ende.\n" +" %[-][BREITE][.[PRÄZ]]{doxX}n Zeilennummer im printf-Stil." + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" GFMT und LFMT können enthalten:\n" +" %% %\n" +" %c'C' das einzelne Zeichen C\n" +" %c'\\OOO' das Zeichen mit dem Oktalcode OOO\n" +" C Das Zeichen C (andere Zeichen stellen sich selbst dar)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d, --minimal Intensiv nach einer kleineren Menge von " +"Änderungen\n" +" suchen." + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +" --horizon-lines=ZAHL ZAHL Zeilen mit gemeinsamem Präfix und Suffix\n" +" behalten." + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files Es werden große Dateien mit vielen verstreuten,\n" +" kleinen Änderungen vermutet." + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" +" --color[=WANN] Die Ausgabe einfärben; WANN kann »never«, " +"»always«,\n" +" oder »auto« sein (Voreinstellung)" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" +" --palette=PALETTE Die zu verwendenden Farben, wenn --color aktiv " +"ist;\n" +" PALETTE ist eine durch Doppelpunkte getrennte\n" +" Liste aus terminfo-Capabilities." + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help Diese Hilfe anzeigen und beenden." + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, -version Versionsinformation ausgeben und beenden." + +#: src/diff.c:982 +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"DATEIEN sind »DATEI1 DATEI2« oder »VERZ1 VERZ2« oder »VERZ DATEI«\n" +" oder »DATEI VERZ«." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Wenn --from-file oder --to-file angegeben werden, gibt es keine\n" +" Einschränkungen für DATEI(EN)." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Wenn DATEI »-« ist, von der Standardeingabe lesen." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Aufruf: %s [OPTION]... DATEIEN\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "DATEIEN Zeile für Zeile vergleichen." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "Widersprüchlicher %s-Optionswert »%s«." + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "Widersprüchliche Optionen für den Ausgabestil." + +#: src/diff.c:1058 +#, c-format +msgid "invalid color '%s'" +msgstr "Ungültige Farbe »%s«." + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Nur in %s: %s.\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "»-« kann nicht mit Verzeichnis verglichen werden." + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "Option -D nicht unterstützt bei Verzeichnissen" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Gemeinsame Unterverzeichnisse: %s und %s.\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Datei %s ist ein %s, während Datei %s ein %s ist.\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Symbolische Verknüpfungen %s und %s sind verschieden.\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Dateien %s und %s sind identisch.\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "Inkompatible Optionen." + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "»-« für mehr als eine Eingabedatei angegeben." + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "Lesefehler." + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A, --show-all Alle Änderungen ausgeben, Konflikte in Klammern." + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed ed-Script ausgeben, das die Änderungen\n" +" von ALTEDATEI hin zu DEINEDATEI in\n" +" MEINEDATEI integriert." + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "-E --show-overlap Wie -e, aber Konflikte in Klammern." + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3, --easy-only Wie -e, aber nur nichtüberlappende Änderungen\n" +" integrieren." + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +"-x, --overlap-only Wie -e, aber nur überlappende Änderungen\n" +" integrieren." + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "-X Wie -x, aber Konflikte in Klammern." + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "" +"-i An ed-Skripte »w«- und »q«-Befehle anhängen." + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge Zusammengefügte Datei ausgeben, wie -A,\n" +" falls keine anderen Optionen übergeben " +"wurden." + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text Alle Dateien als Text behandeln." + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr Wagenrücklauf (CR) am Zeilenende beim Einlesen\n" +" entfernen." + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab Einrückungen durch vorangestellte Tabulatoren\n" +" erzeugen." + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=PROGRAMM PROGRAMM zum Vergleichen von Dateien verwenden." + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=LABEL LABEL statt des Dateinamens benutzen\n" +" (kann bis zu dreimal wiederholt werden)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help Diese Hilfe anzeigen und beenden." + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version Versionsinformation ausgeben und beenden." + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Aufruf: %s [OPTION]... MEINEDATEI ALTEDATEI DEINEDATEI\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Drei Dateien Zeile für Zeile vergleichen." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"Das Standardausgabeformat ist eine einigermaßen menschenlesbare\n" +"Darstellung der Änderungen.\n" +"\n" +"Die Optionen -e, -E, -x und -X (und deren entsprechende lange Versionen)\n" +"erzeugen ein ed-Skript als Ausgabe statt des Standards.\n" +"\n" +"Abschließend versucht die Option -m (--merge), dass diff3 die Änderungen\n" +"intern zusammenführt und die eigentliche, zusammengeführte Datei ausgegeben\n" +"wird. Für ungewöhnliche Eingaben ist dies robuster, als ed zu benutzen.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"Der Rückgabewert des Programms ist 0, falls es erfolgreich ist, 1 falls\n" +"es Konflikte gibt und 2 falls Probleme auftreten." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "Interner Fehler: Format für diff-Blöcke ist durcheinander." + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: »diff« ist gescheitert: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "Interner Fehler: Ungültiger diff-Typ in process_diff." + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "Ungültiges Diff-Format; ungültiger Änderungstrenner." + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "Ungültiges Diff-Format; unvollständige letzte Zeile." + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "Unterprogramm »%s« konnte nicht aufgerufen werden." + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "Ungültiges Diff-Format; inkorrektes führendes Zeichen in Zeile." + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "Interner Fehler: Ungültiger diff-Typ an Ausgabe übergeben." + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "Eingabedatei ist überraschend geschrumpft." + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "Die Dateinamen »%s« und »%s« können nicht verglichen werden." + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: Rekursive Verzeichnisschleife" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o, --output=DATEI Interaktiv arbeiten, Ausgabe in DATEI speichern." + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "" +"-i, --ignore-case Nicht zwischen Groß- und Kleinschreibung " +"unterscheiden." + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion Änderungen aufgrund von Tabausdehnungen " +"ignorieren." + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space Leerraum am Zeilenende ignorieren." + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change Änderungen an der Größe des Leerraums " +"ignorieren." + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space Leerraum ignorieren." + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" +"-B, --ignore-blank-lines Änderungen ignorieren, bei denen alle Zeilen " +"leer sind." + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE Änderungen ignorieren, bei denen alle " +"Zeilen\n" +" auf das Muster RE passen." + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr Wagenrücklauf (CR) am Zeilenende beim Einlesen " +"entfernen." + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a, --text Alle Dateien als Text betrachten." + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=ZAHL Maximale ZAHL Druckspalten pro Zeile (Vorgabe: " +"130)." + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" +"-l, --left-column Nur linke Spalte der gemeinsamen Zeilen " +"ausgeben." + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines Keine gemeinsamen Zeilen ausgeben." + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs Tabulatoren in der Ausgabe zu Leerzeichen " +"ausdehnen." + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +" --tabsize=ZAHL Tabulatorstopps sind alle ZAHL Spalten " +"(Vorgabe: 8)." + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d, --minimal Intensiv nach einer kleineren Menge von " +"Änderungen suchen." + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files Es werden große Dateien mit vielen " +"verstreuten,\n" +" kleinen Änderungen vermutet." + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=PROGRAMM PROGRAMM zum Vergleichen von Dateien verwenden." + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help Diese Hilfe anzeigen und beenden." + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v, -version Versionsinformation ausgeben und beenden." + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Aufruf: %s [OPTION]... DATEI1 DATEI2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "" +"Nebeneinanderstehendes Zusammenbringen der Unterschiede zwischen\n" +"DATEI1 und DATEI2." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "Die Standardeingabe kann nicht interaktiv zusammengebracht werden." + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "Beide zu vergleichende Dateien sind Verzeichnisse." + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tEditieren, dann beide Versionen benutzen, jede mit einem Kopf " +"dekoriert.\n" +"eb:\tEditieren, dann beide Versionen benutzen.\n" +"el oder e1:\tEditieren, dann linke Version benutzen.\n" +"er oder e2:\tEditieren, dann rechte Version benutzen.\n" +"e:\tBeide Versionen verwerfen und dann eine neue Version editieren.\n" +"l:\tLinke Version benutzen.\n" +"r:\tRechte Version benutzen.\n" +"s:\tStillschweigend gemeinsame Zeilen übernehmen.\n" +"v:\tAusführlich gemeinsame Zeilen übernehmen.\n" +"q:\tBeenden.\n" + +#: src/util.c:662 +#, c-format +msgid "unrecognized prefix: %s" +msgstr "Unbekanntes Präfix: %s" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "Wert für --palette ist nicht auswertbar" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: Option »--%s« erlaubt kein Argument.\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: Unbekannte Option »--%s«.\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: Option »-W %s« ist mehrdeutig\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: Option »-W %s« erlaubt kein Argument.\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: Option »-W %s« verlangt ein Argument.\n" + +#~ msgid " or 'auto' (the default)" +#~ msgstr " oder »auto« sein (Voreinstellung)" + +#~ msgid "" +#~ " --palette=PALETTE specify the colors to use when --color is active" +#~ msgstr " --palette=PALETTE Farben angeben, wenn --color aktiv ist." + +#~ msgid "" +#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n" +#~ "You may redistribute copies of this program\n" +#~ "under the terms of the GNU General Public License.\n" +#~ "For more information about these matters, see the file named COPYING." +#~ msgstr "" +#~ "Dieses Programm wird ohne Gewährleistung geliefert, soweit dies\n" +#~ "gesetzlich zulässig ist. Sie können es unter den Bedingungen der GNU\n" +#~ "General Public License weitergeben. \n" +#~ "Details dazu enthält die Datei COPYING." + +#~ msgid "%s: illegal option -- %c\n" +#~ msgstr "%s: ungültige Option -- %c.\n" + +#~ msgid "Written by Torbjorn Granlund and David MacKenzie." +#~ msgstr "Geschrieben von Torbjorn Granlund und David MacKenzie." + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "-s -quiet --silent Keine Ausgabe; nur den Exit-Status setzen." + +#~ msgid "--help Output this help." +#~ msgstr "--help Nur diese Hilfe zeigen." + +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>." +#~ msgstr "Fehlerberichte bitte an <bug-gnu-utils@gnu.org>." + +#~ msgid "" +#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman, and Len Tower." +#~ msgstr "" +#~ "Geschrieben von Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman und Len Tower." + +#~ msgid "`-%ld' option is obsolete; use `-%c %ld'" +#~ msgstr "Die Option »-%ld« ist veraltet; verwenden Sie »-%c %ld«." + +#~ msgid "`-%ld' option is obsolete; omit it" +#~ msgstr "Die Option »-%ld« ist veraltet; lassen Sie sie weg." + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ " -c, -C ZAHL, --context[=ZAHL] ZAHL Zeilen des kopierten Kontextes " +#~ "ausgeben\n" +#~ " (Vorgabe: 3).\n" +#~ " -u, -U ZAHL, --unified[=ZAHL] ZAHL Zeilen des \"unifizierten\" " +#~ "Kontextes ausgeben\n" +#~ " (Vorgabe: 3).\n" +#~ " --label LABEL LABEL statt Dateiname verwenden.\n" +#~ " -p, --show-c-function Anzeigen, in welcher C-Funktion die " +#~ "Veränderung\n" +#~ " vorkommt.\n" +#~ " -F RE, --show-function-line=RE Die nächste Zeile anzeigen, auf die RE " +#~ "zutrifft." + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ "-y -side-by-side In zwei Spalten ausgeben.\n" +#~ " -W ZAHL --width=ZAHL Maximal ZAHL Zeichen pro Zeile ausgeben(Vorgabe: " +#~ "130).\n" +#~ " --left-column Nur linke Spalte gemeinsamer Zeilen ausgeben.\n" +#~ " ---suppress-common-lines Keine gemeinsamen Zeilen ausgeben." + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "" +#~ "--speed-large-files Es werden große Dateien und viele Änderungen " +#~ "vermutet." + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "-X Überlappende Änderungen geklammert ausgeben." + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "" +#~ "-m --merge Zusammengeführte Datei anstelle von ed-Skript ausgeben " +#~ "(Vorgabe -A)." + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "-L LABEL --label=LABEL LABEL anstelle des Dateinamens verwenden." + +#~ msgid "subsidiary program `%s' failed" +#~ msgstr "Unterprogramm »%s« schlug fehl." + +#~ msgid "subsidiary program `%s' not executable" +#~ msgstr "Unterprogramm »%s« ist nicht ausführbar." diff --git a/local/recipes/tools/diffutils/source/po/diffutils.pot b/local/recipes/tools/diffutils/source/po/diffutils.pot new file mode 100644 index 0000000000..be203e2715 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/diffutils.pot @@ -0,0 +1,1333 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the GNU diffutils package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: GNU diffutils 3.6\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "" + +#: lib/file-type.c:78 +msgid "door" +msgstr "" + +#: lib/file-type.c:81 +msgid "multiplexed block special file" +msgstr "" + +#: lib/file-type.c:84 +msgid "multiplexed character special file" +msgstr "" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "" + +#: lib/file-type.c:90 +msgid "named file" +msgstr "" + +#: lib/file-type.c:93 +msgid "network special file" +msgstr "" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "" + +#: lib/file-type.c:102 +msgid "port" +msgstr "" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "" + +#: lib/getopt.c:278 +#, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "" + +#: lib/getopt.c:284 +#, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "" + +#: lib/getopt.c:319 +#, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "" + +#: lib/getopt.c:345 +#, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "" + +#: lib/getopt.c:360 +#, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "" + +#: lib/regcomp.c:156 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "" + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr "" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "" + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "" + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "" + +#: src/cmp.c:571 +#, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "" + +#: src/cmp.c:585 +#, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "" + +#: src/cmp.c:586 +#, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "" + +#: src/cmp.c:592 +#, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr "" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr "" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr "" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr "" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr "" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "" + +#: src/diff.c:982 +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "" + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "" + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "" + +#: src/diff.c:1058 +#, c-format +msgid "invalid color '%s'" +msgstr "" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr "" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "" + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "" + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr "" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "" + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" + +#: src/util.c:662 +#, c-format +msgid "unrecognized prefix: %s" +msgstr "" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "" diff --git a/local/recipes/tools/diffutils/source/po/el.gmo b/local/recipes/tools/diffutils/source/po/el.gmo new file mode 100644 index 0000000000..bcbd21bb52 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/el.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/el.po b/local/recipes/tools/diffutils/source/po/el.po new file mode 100644 index 0000000000..cb876e92f3 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/el.po @@ -0,0 +1,1505 @@ +# translation of diffutils to Greek +# Copyright (C) 2004 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Lefteris Dimitroulakis <edimitro@tee.gr>, 2004. +# Lefteris Dimitroulakis <ledimitro@gmail.com>, 2013, 2014, 2017. +msgid "" +msgstr "" +"Project-Id-Version: diffutils-3.5.25\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2017-05-13 01:10+0300\n" +"Last-Translator: Lefteris Dimitroulakis <ledimitro@gmail.com>\n" +"Language-Team: Greek <team@lists.gnome.gr>\n" +"Language: el\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Lokalize 1.5\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "μη έγκυρο όρισμα %s για %s" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "ασαφές όρισμα %s για %s" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "Έγκυρο ορίσματα είναι:" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "σφάλμα προγράμματος" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "υπερχείλιση στοίβας" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Άγνωστο σφάλμα συστήματος" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "τυπικό κενό αρχείο" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "τυπικό αρχείο" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "κατάλογος" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "συμβολικός σύνδεσμος" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "ουρά μηνύματος" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "σηματοφορέας" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "αντικείμενο κοινόχρηστης μνήμης" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "typed memory object" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "ειδικό αρχείο μπλοκ" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "ειδικό αρχείο χαρακτήρων" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "συνεχόμενα δεδομένα" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "door" + +#: lib/file-type.c:81 +msgid "multiplexed block special file" +msgstr "ειδικό αρχείο μπλοκ" + +#: lib/file-type.c:84 +msgid "multiplexed character special file" +msgstr "ειδικό αρχείο χαρακτήρων" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "multiplexed file" + +#: lib/file-type.c:90 +msgid "named file" +msgstr "named file" + +#: lib/file-type.c:93 +msgid "network special file" +msgstr "ειδικό αρχείο δικτύου" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "migrated file with data" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "migrated file without data" + +#: lib/file-type.c:102 +msgid "port" +msgstr "θύρα" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "socket" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "whiteout" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "αλλόκοτο αρχείο" + +#: lib/getopt.c:278 +#, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: η επιλογή «%s%s» είναι ασαφής\n" + +#: lib/getopt.c:284 +#, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: η επιλογή «%s%s» είναι ασαφής· επιλογές: " + +#: lib/getopt.c:319 +#, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: η επιλογή «%s%s» δεν αναγνωρίζεται\n" + +#: lib/getopt.c:345 +#, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: η επιλογή «%s%s» δεν επιτρέπει όρισμα\n" + +#: lib/getopt.c:360 +#, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: η επιλογή «%s%s» απαιτεί όρισμα\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: η επιλογή -- «%c» δεν είναι έγκυρη\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: η επιλογή απαιτεί όρισμα -- «%c»\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "«" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "»" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Επιτυχία" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Δεν υπάρχει ταίριασμα" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Μη έγκυρη κανονική έκφραση" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Μη έγκυρος χαρακτήρας διαταξινόμησης" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Μη έγκυρο όνομα κλάσεως χαρακτήρων" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Αντιπλαγία στο τέλος" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Άκυρη πίσω παραπομπή" + +#: lib/regcomp.c:156 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Δεν βρέθηκε [, [^, [:, [., or [=" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Δε βρέθηκε ( ή \\(" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Δε βρέθηκε \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Το περιεχόμενο του \\{\\} είναι μη έγκυρο" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Μη έγκυρο πέρας διαστήματος" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Η μνήμη εξαντλήθηκε" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Η προηγούμενη κανονική έκφραση είναι άκυρη" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Πρόωρο τέλος κανονικής έκφρασης" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Πολύ μεγάλη κανονική έκφραση" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Δε βρέθηκε ) ή \\)" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Δεν προηγήθηκε κανονική έκφραση" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "η μνήμη εξαντλήθηκε" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "stdin" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "stdout" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "stderr" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "άγνωστο ρεύμα" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "αποτυχία ξανανοίγματος %s σε κατάσταση %s" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "μη έγκυρο %s%s όρισμα «%s»" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "μη έγκυρη κατάληξη «%s» στο όρισμα %s%s" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "%s%s όρισμα «%s» πολύ μεγάλο" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Packaged by %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Packaged by %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "(C)" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Άδεια GPLv3+: GNU GPL έκδοση 3 ή νεότερη <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Γράφτηκε από %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Γράφτηκε από %s και %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Γράφτηκε από %s, %s,και %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Γράφτηκε από τους %s, %s, %s,\n" +"και %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Γράφτηκε από τους %s, %s, %s,\n" +"%s, και %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Γράφτηκε από τους %s, %s, %s,\n" +"%s, %s, και %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Γράφτηκε από τους %s, %s, %s,\n" +"%s, %s, %s, και %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Γράφτηκε από τους %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"και %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Γράφτηκε από τους %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, και %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Γράφτηκε από τους %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, και άλλους.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Report bugs to: %s\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Report %s bugs to: %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s home page: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "%s home page: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"Γενική βοήθεια στη χρήση λογισμικού GNU: <http://www.gnu.org/gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Τα αρχεία %s και %s διαφέρουν\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Τα δυαδικά αρχεία %s και %s διαφέρουν\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Δεν υπάρχει χαρακτήρας νέας γραμμής στο τέλος του αρχείου" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Δοκιμάστε «%s --help» για περισσότερες πληροφορίες." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "άκυρη τιμή --ignore-initial «%s»" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "οι επιλογές -l και -s είναι ασύμβατες" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "η εγγραφή απέτυχε" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "κανονική έξοδος" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b, --print-bytes Εμφανίζει bytes που διαφέρουν." + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i, --ignore-initial=SKIP Παράβλεψη των πρώτων SKIP bytes και των δύο " +"εισόδων" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=SKIP1:SKIP2 παράβλεψη των πρώτων SKIP1 bytes του " +"αρχείου FILE1 και\n" +" των πρώτων SKIP2 bytes του αρχείου FILE2" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "-l --verbose Έξοδος αριθμού και τιμής όλων των bytes που διαφέρουν." + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=ΟΡΙΟ Σύγκριση το πολύ ΟΡΙΟ bytes." + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent απάλειψη κανονικής εξόδου" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help εμφάνιση αυτής εδώ της βοήθειας κι έξοδος" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v, --version εμφάνιση πληροφοριών έκδοσης κι έξοδος" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Χρήση: %s [ΕΠΙΛΟΓΗ]... ΑΡΧΕΙΟ1 [ΑΡΧΕΙΟ2 [SKIP1 [SKIP2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Σύγκριση δύο αρχείων byte προς byte." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"Οι προαιρετικές παράμετροι SKIP1 και SKIP2 καθορίζουν τον αριθμό των bytes " +"προς παράβλεψη\n" +"στην αρχή κάθε αρχείου (η προεπιλογή είναι μηδέν). " + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Υποχρεωτικά ορίσματα στις μακρές επιλογές είναι υποχρεωτικά και στις κοντές " +"επιλογές επίσης.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"Οι τιμές SKIP μπορούν ν' ακολουθούνται\n" +"από τα παρακάτω πολαπλασιαστικά επιθέματα :\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, κτλ γιά T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Αν ένα ΑΡΧΕΙΟ είναι «-» ή απών, τότε ανάγνωση από την κανονική είσοδο." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"Η έξοδος είναι 0 αν τα δεδομένα αρχεία είναι ίδια, 1 αν είναι διαφορετικά,\n" +"2 αν υπάρχει πρόβλημα." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "άκυρη τιμή «%s» για την επιλογή --bytes " + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "απών τελεστέος μετά από «%s»" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "συμπληρωματικός τελεστέος «%s»" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s διαφέρουν: byte %s, γραμμή %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s διαφέρουν: byte %s, γραμμή %s είναι %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: EOF στο %s που είναι κενό\n" + +#: src/cmp.c:585 +#, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "cmp: EOF στο %s μετά το byte %s, γραμμή %s\n" + +#: src/cmp.c:586 +#, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "cmp: EOF στο %s μετά το byte %s, στη γραμμή %s\n" + +#: src/cmp.c:592 +#, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: EOF στο %s μετά το byte %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "μη έγκυρο μήκος συμφραζομένων «%s»" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "Η αρίθμιση σελίδων δεν υποστηρίζεται σ' αυτόν τον υπολογιστή" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "πάρα πολλές επιλογές ετικέττας αρχείου" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "μη έγκυρο πλάτος «%s»" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "αντικρουόμενες επιλογές πλάτους" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "μη έγκυρο μήκος ορίζοντα «%s»" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "μη έγκυρο μήκος στηλοθέτησης `%s'" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "αντικρουόμενες επιλογές μήκους στηλοθέτησης" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "--from-file και --to-file έχουν οριστεί αμφότερα" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr " --normal Δημιουργία ενός κανονικού `diff' (προεπιλογή)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "-q --brief αποτέλεσμα στην έξοδο μόνο αν τ' αρχεία διαφέρουν" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s, --report-identical-files Ειδοποιεί όταν δύο αρχεία είναι ίδια" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C NUM, --context[=NUM] έξοδος NUM (προεπιλογή 3) γραμμές of copied " +"context" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed εμφανίζει ένα ed script" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n --rcs Δημιουργία αρχείου «diff» σε μορφή RCS." + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side έξοδος σε δυο στήλες" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=NUM output at most NUM (default 130) print columns" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +"--left-column Εμφάνιση μόνο της αριστερής στήλης των ταυτόσημων γραμμών." + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines Οι ταυτόσημες γραμμές δεν εμφανίζονται." + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" +"-p, --show-c-function εμφάνιση σε ποιά συνάρτηση C βρίσκεται κάθε αλλαγή" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" +"-F, --show-function-line=RE εμφάνιση του πιο πρόσφατου ταιριάσματος " +"γραμμής RE" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +"-L, --label=LABEL χρήση LABEL αντί ονόματος αρχείου και timestamp\n" +" (μπορεί να επαναληφθεί)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs Μετατροπή στηλοθετών σε διαστήματα στην έξοδο." + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab Στοίχιση των στηλοθετών με την επιπρόσθεση ενός στην " +"αρχή." + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=ΑΡ Ο αριθμός διαστημάτων του στηλοθέτη είναι ΑΡ (προεπιλογή 8)" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty απάλειψη διαστήματος ή στ/θέτη πριν από κενές " +"γραμμές στην έξοδο" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" +" -l, --paginate Έξοδος δια μέσου του «pr» ώστε να αριθμιθούν οι σελίδες" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "-r, --recursive Αναδρομική σύγκριση όσων υποκαταλόγων βρεθούν" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference μην ακολουθείς συμβολικούς συνδέσμους" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "-N, --new-file Θεωρεί τα απόντα αρχεία ως κενά" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "--unidirectional-new-file Θεωρεί τα απόντα πρώτα αρχεία ως κενά." + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +"--ignore-file-name-case Αγνοεί τις διαφορές λόγω πεζών-κεφαλαίων\n" +" κατά τη σύγκριση ονομάτων αρχείων." + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +"--no-ignore-file-name-case Λαμβάνει υπ' όψιν τις διαφορές λόγω\n" +" πεζών-κεφαλαίων κατά τη σύγκριση ονομάτων αρχείων." + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "-x, --exclude=PAT Εξαίρεση αρχείων με όνομα που ταιριάζει με PAT." + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=ΑΡΧΕΙΟ Εξαίρεση αρχείων με όνομα που ταιράζει\n" +" με τα ονόματα που βρίσκονται στο ΑΡΧΕΙΟ" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=ΑΡΧΕΙΟ Εκκίνηση σύγκρισης καταλόγων από το ΑΡΧΕΙΟ" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +"--from-file=ΑΡΧΕΙΟ1 Σύγκριση ΑΡΧΕΙΟ1 με όλους τους τελεστέους·\n" +" ΑΡΧΕΙΟ1 μπορεί να είναι κατάλογος" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +"--to-file=ΑΡΧΕΙΟ2 Σύγκριση όλων των τελεστέων στο ΑΡΧΕΙΟ2·\n" +" ΑΡΧΕΙΟ2 μπορεί να είναι κατάλογος" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i, --ignore-case Αγνοεί τις διαφορές λόγω πεζών-κεφαλαίων στα περιεχόμενα " +"των αρχείων" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion Αγνοεί αλλαγές οφειλόμενες στη στηλοθέτηση" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" +"-Z, --ignore-trailing-space αγνοεί λευκά διαστήματα στο τέλος γραμμής" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change Αγνοεί αλλαγές οφειλόμενες στον αριθμό λευκών " +"διαστημάτων." + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space Αγνοεί όλα τα λευκά διαστήματα." + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B, --ignore-blank-lines Αγνοεί αλλαγές οφειλόμενες στις λευκές γραμμές" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE Αγνοεί αλλαγές που οι γραμμές τους " +"ταιριάζουν με RE." + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text Θεωρεί όλα τα αρχεία ως κείμενο." + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "--strip-trailing-cr Απαλειφή του χαρακτήρα επιστροφής στην είσοδο." + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr "--binary Ανάγνωση και εγγραφή πληροφορίας σε δυαδική μορφή." + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=ΟΝΟΜΑ Έξοδος συγχωνευμένου αρχείου με τις διαφορές «#ifdef " +"NAME»." + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "--GTYPE-group-format=GFMT μορφοποίηση ομάδων εισόδου GTYPE με GFMT." + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "" +"--line-format=LFMT μορφοποίηση όλων των γραμμών εισόδου με LFMT" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "--LTYPE-line-format=LFMT μορφοποίηση γραμμών εισόδου LTYPE με LFMT." + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +"Αυτές οι επιλογές μορφής παρέχουν λεπτομερή έλεγχο πάνω στην έξοδο\n" +" του diff, γενικεύοντας -D/--ifdef." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE είναι «old», «new», ή «unchanged». GTYPE είναι LTYPE ή «changed»." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +"GFMT μπορεί να περιέχει:\n" +" %< για να δηλώνει γραμμές από το ΑΡΧΕΙΟ1\n" +" %> για να δηλώνει γραμμές από το ΑΡΧΕΙΟ2\n" +" %= για να δηλώνει ταυτόσημες γραμμές μεταξύ των ΑΡΧΕΙΟ1 και ΑΡΧΕΙΟ2\n" +" %[-][ΠΛΑΤΟΣ][.[PREC]]{doxX}ΓΡΑΜΜΑ, προδιαγραφές του ΓΡΑΜΜΑτος\n" +" στο στύλ της printf(), ως ακολούθως γιά τη νέα ομάδα\n" +" ενώ με πεζά για τη παλαιά ομάδα:\n" +" F αριθμός πρώτης γραμμής\n" +" L αριθμός τελευταίας γραμμής\n" +" N αριθμός γραμμών = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) αν A ίσον B τότε T αλλιώς E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT μπορεί να περιέχει:\n" +" %L για το περιεχόμενο της γραμμής\n" +" %l για το περιεχόμενο της γραμμής χωρίς το τέλος γραμμής\n" +" %[-][ΠΛΑΤΟΣ][.[PREC]]{doxX}n την προδιαγραφή του αριθμού γραμμής\n" +" εισόδου κατά τη μορφή της printf()" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" GFMT και LFMT μπορεί να περιέχουν:\n" +" %% %\n" +" %c'C' το μοναδικό χαρακτήρα C\n" +" %c'\\OOO' το χαρακτήρα με οκταδικό κωδικό OOO\n" +" C το χαρακτήρα C (οι άλλοι χαρακτήρες αναπαριστούν τον εαυτόν τους)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d --minimal προσπάθεια εύρεσης μικρότερου συνόλου διαφορών." + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +"--horizon-lines=ΑΡ Διατηρεί ΑΡ γραμμές με ταυτόσημα προθέματα κι επιθέματα." + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +"--speed-large-files Υποθέτει μεγάλα αρχεία με πολλές σκόρπιες μικροαλλαγές." + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" +" --color[=WHEN] χρωματίζει την έξοδο, WHEN μπορεί να είναι «ποτέ», " +"«πάντα»,\n" +" ή «αυτόματο» (προεπιλογή)" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" +" --palette=PALETTE τα προς χρήση χρώματα όταν η επιλογή --color έχει " +"ενεργοποιηθεί, PALETTE είναι\n" +" μια λίστα ικανοτήτων terminfo που χωρίζονται από " +"δίστιγμα. capabilities" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help εμφάνιση αυτής εδώ της βοήθειας κι έξοδος" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v --version Εμφάνιση πληροφοριών έκδοσης κι έξοδος" + +#: src/diff.c:982 +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"ΑΡΧΕΙΑ είναι «ΑΡΧΕΙΟ1 ΑΡΧΕΙΟ2» ή «ΚΑΤ1 ΚΑΤ2» ή «ΚΑΤ ΑΡΧΕΙΟ...» ή «ΑΡΧΕΙΟ..." +"ΚΑΤ»." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Αν δίδεται το --from-file ή το --to-file, τότε δεν υπάρχει περιορισμός στα " +"ΑΡΧΕΙΑ. " + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Αν ένα ΑΡΧΕΙΟ είναι «-», τότε ανάγνωση από την τυπική είσοδο. " + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Χρήση: %s [ΕΠΙΛΟΓΗ]... ΑΡΧΕΙΑ\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Σύγκριση αρχείων γραμμή προς γραμμή." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "η επιλογή %s είναι αντικρουόμενη με την τιμή «%s»" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "αντικρουόμενες επιλογές για τη μορφή εξόδου" + +#: src/diff.c:1058 +#, c-format +msgid "invalid color '%s'" +msgstr "μη έγκυρο χρώμα «%s»" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Μόνο στο %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "Αδύνατη η σύγκριση του «-» με ένα κατάλογο" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "Η επιλογή -D δεν υποστηρίζεται για καταλόγους" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Οι υποκατάλογοι %s και %s είναι ταυτόσημοι\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Το αρχείο %s είναι %s ενώ το αρχείο %s είναι %s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Οι συμβολικοί σύνδεσμοι %s και %s διαφέρουν\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Τα αρχεία %s καί %s είναι πανομοιότυπα\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "ασύμβατες επιλογές" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "«-» ορίστηκε για περισσότερα από ένα αρχεία εισόδου" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "αποτυχία ανάγνωσης" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "-A --show-all Έξοδος όλων των διαφορών σε αγκύλες." + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed έξοδος ενός ed script που περιλαμβάνει τις αλλαγές\n" +"από OLDFILE σε YOURFILE στο MYFILE " + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "-E, --show-overlap όπως -e, αλλά οι διαφορές σε αγκύλες" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3, --easy-only όπως -e, αλλά περιλαμβάνει μόνο τις μη " +"αλληλοεπικαλυπτόμενες αλλαγές" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +"-x, --overlap-only όπως -e, αλλά περιλαμβάνει μόνο τις αλληλοκαλυπτόμενες " +"αλλαγές" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "-X like -x, but bracket conflicts" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "-i προσάρτηση των εντολών «w» και «q» στα σενάρια του «ed»" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge έξοδος του συγχωνευμένου αρχείου σύμφωνα με την\n" +" -A αν δεν δίνεται άλλη επιλογή" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text Θεωρεί όλα τα αρχεία ως κείμενο." + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "--strip-trailing-cr Απαλειφή του χαρακτήρα επιστροφής στην είσοδο." + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab στοίχιση των στηλοθετών με την επιπρόσθεση ενός στην " +"αρχή." + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "--diff-program=ΠΡΟΓΡ Χρήση του ΠΡΟΓΡάμματος στη σύγκριση αρχείων." + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=LABEL χρήση LABEL αντί ονόματος αρχείου\n" +" (μπορεί να επαναληφθεί μέχρι τρεις φορές) " + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help εμφάνιση αυτής εδώ της βοήθειας κι έξοδος " + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version εμφάνιση πληροφοριών έκδοσης κι έξοδος" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Χρήση: %s [ΕΠΙΛΟΓΗ]... MYFILE OLDFILE YOURFILE\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Σύγκριση τριών αρχείων γραμμή προς γραμμή." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"Η προεπιλεγμένη μορφή εξόδου είναι η λίγο πολύ αναγνώσιμη αναπαράσταση των " +"αλλαγών.\n" +"\n" +"Οι -e, -E, -x, -X (και οι αντίστοιχες μακρές) επιλογές δημιουργούν ένα ed " +"script\n" +"στην έξοδο αντί της προεπιλογής.\n" +"\n" +"Τελικά, η επιλογή -m (--merge) υποχρεώνει το diff3 να κάνει τη συγχώνευση " +"εσωτερικά\n" +"και να εμφανίσει στην έξοδο το συγχωνευμένο αρχείο. Για μη συνηθισμένη " +"είσοδο, αυτό είναι\n" +"σταθερότερο απο την χρήση του ed.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "Σε επιτυχία η έξοδος είναι 0, σε σύγκρουση 1 και σε πρόβλημα 2." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "εσωτερικό σφάλμα: μπέρδεμα στις μορφές των μπλοκ diff" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: αποτυχία του diff: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "εσωτερικό σφάλμα: μη έγκυρος τύπος diff στο process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "άκυρη μορφή diff· μη έγκυρος οριοθέτης αλλαγής" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "άκυρη μορφή diff· ασυμπλήρωτη τελευταία γραμμή" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "το υποπρόγραμμα «%s» δεν ήταν δυνατόν να κληθεί" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "άκυρη μορφή diff· λάθος χαρακτήρες στη γραμμή αποτελεσμάτων" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "εσωτερικό σφάλμα: μη έγκυρος τύπος diff πέρασε στην έξοδο" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "Το αρχείο εισόδου συρρικνώθηκε" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "αδύνατη η σύγκριση των ονομάτων αρχείων «%s» και «%s»" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: αναδρομικός βρόχος στον κατάλογο" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o, --output=ΑΡΧΕΙΟ Αλληλεπιδραστική λειτουργία με αποστολή εξόδου στο " +"ΑΡΧΕΙΟ." + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i, --ignore-case Θεωρεί πεζά-κεφαλαία ίδια" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion Αγνοεί αλλαγές οφειλόμενες στη στηλοθέτηση" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" +"-Z, --ignore-trailing-space αγνοεί το λευκό διάστημα στο τέλος γραμμής" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b --ignore-space-change αγνοεί αλλαγές οφειλόμενες στον αριθμό λευκών " +"διαστημάτων" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space Αγνοεί όλα τα λευκά διαστήματα." + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" +"-B, --ignore-blank-lines Αγνοεί αλλαγές οφειλόμενες στις λευκές γραμμές" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE αγνοεί αλλαγές που οι γραμμές τους " +"ταιριάζουν με RE" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "--strip-trailing-cr Απαλειφή του χαρακτήρα επιστροφής στην είσοδο" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a --text Θεωρεί όλα τα αρχεία ως κείμενο" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=ΑΡ Έξοδος με το πολύ ΑΡ στήλες εκτύπωσης (προεπιλογή 130)." + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "-l, --left-column Εμφάνιση στην αριστερή στήλη των κοινών γραμμών" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines Οι ταυτόσημες γραμμές δεν εμφανίζονται" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs Μετατροπή στηλοθετών σε διαστήματα στην έξοδο" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +" --tabsize=ΑΡ Ο αριθμός διαστημάτων του στηλοθέτη είναι ΑΡ (προεπιλογή 8) " +"στήλες" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal προσπάθεια εύρεσης μικρότερου συνόλου αλλαγών" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files Υποθέτει μεγάλα αρχεία με πολλές σκόρπιες " +"μικροδιαφορές" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "--diff-program=ΠΡΟΓΡ Χρήση του ΠΡΟΓΡάμματος στη σύγκριση αρχείων" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help εμφάνιση αυτής εδώ της βοήθειας κι έξοδος " + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v --version ονόμα, έκδοση κι έξοδος" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Χρήση: %s [ΕΠΙΛΟΓΗ]... ΑΡΧΕΙΟ1 ΑΡΧΕΙΟ2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Συγχώνευση δίπλα-δίπλα των διαφορών των ΑΡΧΕΙΟ1 και ΑΡΧΕΙΟ2." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "αδυνατώ να συγχωνεύσω αλληλεπιδραστικά την πρότυπη είσοδο." + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "και τα δύο προς σύγκριση αρχεία είναι κατάλογοι" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tΔιόρθωση και μετά χρήση και των δύο παραλλαγών,\n" +"εκάστη διακοσμημένη με επικεφαλίδα.\n" +"eb:\tΔιόρθωση και μετά χρήση και των δύο παραλλαγών.\n" +"el:\tΔιόρθωση και μετά χρήση της αριστερής παραλλαγής.\n" +"er:\tΔιόρθωση και μετά χρήση της δεξιάς παραλλαγής.\n" +"e:\tΔιόρθωση νέας παραλλαγής.\n" +"l:\tΧρήση αριστερής παραλλαγής.\n" +"r:\tΧρήση δεξιάς παραλλαγής.\n" +"s:\tΣυμπεριλαμβάνει τις ταυτόσημες γραμμές σιωπηρά.\n" +"v:\tΣυμπεριλαμβάνει τις ταυτόσημες γραμμές και το επισημαίνει.\n" +"q:\tΈξοδος.\n" + +#: src/util.c:662 +#, c-format +msgid "unrecognized prefix: %s" +msgstr "άγνωστο πρόθεμα: %s" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "unparsable τιμή για --palette " diff --git a/local/recipes/tools/diffutils/source/po/en@boldquot.header b/local/recipes/tools/diffutils/source/po/en@boldquot.header new file mode 100644 index 0000000000..fedb6a06d1 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/en@boldquot.header @@ -0,0 +1,25 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# +# This catalog furthermore displays the text between the quotation marks in +# bold face, assuming the VT100/XTerm escape sequences. +# diff --git a/local/recipes/tools/diffutils/source/po/en@quot.header b/local/recipes/tools/diffutils/source/po/en@quot.header new file mode 100644 index 0000000000..a9647fc35c --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/en@quot.header @@ -0,0 +1,22 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# diff --git a/local/recipes/tools/diffutils/source/po/eo.gmo b/local/recipes/tools/diffutils/source/po/eo.gmo new file mode 100644 index 0000000000..1d3f0aa375 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/eo.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/eo.po b/local/recipes/tools/diffutils/source/po/eo.po new file mode 100644 index 0000000000..0d652ec091 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/eo.po @@ -0,0 +1,1526 @@ +# Esperantaj mesaĝoj por GNU diffutils. +# Copyright (C) 1996, 2001, 2002, 2004, 2013 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Edmund GRIMLEY EVANS <edmundo@rano.org>, 2001, 2002, 2003, 2004. +# Felipe Castro <fefcas@gmail.com>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU diffutils 3.3-pre1\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2013-10-31 13:16-0300\n" +"Last-Translator: Felipe Castro <fefcas@gmail.com>\n" +"Language-Team: Esperanto <translation-team-eo@lists.sourceforge.net>\n" +"Language: eo\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 1.5.4\n" + +#: lib/argmatch.c:134 +#, fuzzy, c-format +msgid "invalid argument %s for %s" +msgstr "malvalida %s%s-argumento '%s'" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "" + +#: lib/argmatch.c:154 +#, fuzzy +msgid "Valid arguments are:" +msgstr "malvalida %s%s-argumento '%s'" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "program-eraro" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "stako tro granda" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Nekonata sistemeraro" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "normala malplena dosiero" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "normala dosiero" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "dosierujo" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "simbola ligo" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "mesaĝovico" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "semaforo" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "komuna memoro" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "tipita memora objekto" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "blok-aparatdosiero" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "sign-aparatdosiero" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "" + +#: lib/file-type.c:81 +#, fuzzy +msgid "multiplexed block special file" +msgstr "blok-aparatdosiero" + +#: lib/file-type.c:84 +#, fuzzy +msgid "multiplexed character special file" +msgstr "sign-aparatdosiero" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "" + +#: lib/file-type.c:90 +#, fuzzy +msgid "named file" +msgstr "stranga dosiero" + +#: lib/file-type.c:93 +#, fuzzy +msgid "network special file" +msgstr "blok-aparatdosiero" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "" + +#: lib/file-type.c:102 +msgid "port" +msgstr "" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "konektilo" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "stranga dosiero" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: la modifilo '-W %s' estas plursenca\n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: la modifilo '%s' estas plursenca; ebloj:" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: nerekonata modifilo '%c%s'\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: la modifilo '%c%s' ne permesas argumenton\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: la modifilo '--%s' postulas argumenton\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: malvalida modifilo -- '%c'\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: la modifilo postulas argumenton -- '%c'\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "‘" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "’" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Sukceso" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Nenia trafo" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Malvalida regulesprimo" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Malvalida ordiga signo" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Malvalida nomo de signoklaso" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Vosta retroklino" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Malvalida retroreferenco" + +#: lib/regcomp.c:156 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Neparigita [ aŭ [^" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Neparigita ( aŭ \\(" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Neparigita \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Malvalida kunteksto de \\{\\}" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Malvalida intervalo-fino" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Memoro estas elĉerpita" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Malvalida antaŭa regulesprimo" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Neatendita fino de regulesprimo" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Regula esprimo tro grandas" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Neparigita ) aŭ \\)" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Mankas antaŭa regulesprimo" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "memoro elĉerpiĝis" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "ĉefenigujo" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "ĉefeligujo" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "ĉeferar-eligujo" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "nekonata fluo" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "malsukcesis remalfermi %s per reĝimo %s" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "malvalida %s%s-argumento '%s'" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "malvalida sufikso en %s%s-argumento '%s'" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "%s%s-argumento '%s' tro larĝas" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Pakigita de %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Pakigita de %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Permeso GPLv3+: GNU GPL versio 3 aŭ posta <http://gnu.org/licenses/gpl." +"html>.\n" +"Tio ĉi estas libera programaro: vi estas libera por ŝanĝi kaj redisdoni " +"ĝin.\n" +"Ekzistas NENIU GARANTIO, laŭ plej amplekse permesate de la leĝoj.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Verkita de %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Verkita de %s kaj %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Verkita de %s, %s, kaj %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Verkita de %s, %s, %s,\n" +"kaj %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Verkita de %s, %s, %s,\n" +"%s, kaj %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Verkita de %s, %s, %s,\n" +"%s, %s, kaj %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Verkita de %s, %s, %s,\n" +"%s, %s, %s, kaj %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Verkita de %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"kaj %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Verkita de %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, kaj %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Verkita de %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, kaj aliaj.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Raportu program-misojn al: %s\n" +"\n" +"Raportu tradukajn misojn al: <translation-team-eo@lists.sourceforge.net>\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Raportu %s misojn al: %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s hejm-paĝo: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "%s hejm-paĝo: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"Ĝenerala helpo por uzi programaron GNU: <http://www.gnu.org/gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Dosieroj %s kaj %s estas malsamaj\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Ciferecaj dosieroj %s kaj %s estas malsamaj\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Mankas linifino ĉe fino de dosiero" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn GRANLUND" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MACKENZIE" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Provu '%s --help' por pli da informoj." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "malvalida valoro '%s' de --ignore-initial" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "modifiloj -l kaj -s malakordas" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "skriberaro" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "normala eligo" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b, --print-bytes eligi malsamajn bajtojn" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i N --ignore-initial=SALTO preterpasi la unuajn SALTO bajtojn de ambaŭ " +"enigoj" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=SALT1:SALT2 pretersalti la unuajn SALT1 bajtojn de\n" +" DOSIERO1 kaj la unuajn SALT2 bajtojn\n" +" de DOSIERO2" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l, --verbose montri numerojn kaj valorojn de ĉiuj malsamaj " +"bajtoj" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=LIMO kompari maksimume LIMO bajtojn" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent forkaŝi ĉiun normalan eligon" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help montri ĉi tiun helpon kaj eliri" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr " -v, --version eligi informon pri versio kaj eliri" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Uzmaniero: %s [MODIFILO]... DOSIERO1 [DOSIERO2 [SALT1 [SALT2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Kompari du dosierojn bajton post bajto." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"La nedevigaj SALT1 kaj SALT2 indikas la nombron da bajtoj por salti\n" +"en la komenco de ĉiu dosiero (aprioras nulo)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Nepraj argumentoj por longaj modifiloj ankaŭ nepras por la mallongaj.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"Valoroj de SALTO povas esti sekvataj de la sekvaj multobligaj sufiksoj:\n" +"kB 1000, K 1024, MB 1 000 000, M 1 048 576,\n" +"GB 1 000 000 000, G 1 073 741 824, kaj tiel plu por T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Se DOSIERO estas '-' aŭ mankas, legi la normalan enigon." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"Elig-valoro estas 0 se enigoj estas samaj, 1 se malsamaj, 2 se problemaj." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "malvalida valoro '%s' de --bytes" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "mankas argumento post '%s'" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "superflua argumento '%s'" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s malsamas: bajto %s, linio %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s malsamas: bajto %s, linio %s estas %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: EOF ĉe %s\n" + +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s %s malsamas: bajto %s, linio %s\n" + +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s %s malsamas: bajto %s, linio %s\n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: EOF ĉe %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul EGGERT" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike HAERTEL" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David HAYES" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard STALLMANN" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len TOWER" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "malvalida longo '%s' de kunteksto" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "dispaĝigo ne eblas kun ĉi tiu sistemo" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "tro multe da dosier-etikedaj modifiloj" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "malvalida larĝo '%s'" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "malakordaj modifiloj pri larĝo" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "malvalida horizonta longo '%s'" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "malvalida TAB-larĝo '%s'" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "malkongruaj modifiloj pri TAB-larĝo" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "--from-file kaj --to-file ambaŭ specifitaj" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr " --normal montri normalan malsamon (aprioras)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "-q, --brief montri nur kiam la dosieroj malsamas" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s, --report-identical-files montri kiam du dosieroj samas" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C NUM, --context[=NUM] montri NUM (aprioras 3) liniojn da kopiita " +"kunteksto" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U NUM, --unified[=NUM] montri NUM (aprioras 3) liniojn da unuigita " +"kunteksto" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed montri ed-skripton" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n, --rcs montri malsamon laŭ RCS-formo" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side montri en du kolumnoj" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=NUM montri maksimume NUM (aprioras 130) kolumnojn" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +" --left-column montri nur la maldekstran kolumnon de komunaj " +"linioj" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines ne montri komunajn liniojn" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "-p, --show-c-function montri en kiu C-funkcio ĉiu ŝanĝo estas" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" +"-F, --show-function-line=RE montri la plej freŝa linio kongruanta al RE" + +#: src/diff.c:905 +#, fuzzy +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label ETIKEDO uzi ETIKEDOn anstataŭ dosiernomo\n" +" (povas esti ripetata)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs etendigi tabojn al spacoj en la eligo" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T, --initial-tab ĝustigi tabojn per antaŭmeto de tabo" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=NUM tab-lokoj estas post ĉiuj NUM (aprioras 8) " +"kolumnoj" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty forkaŝi spacon aŭ tabon antaŭ malplenaj " +"eligitaj linioj" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" +"-l, --paginate pasigi la eligon tra 'pr' por enpaĝigi ĝin" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r, --recursive rikure kompari trovitajn subdosierujojn" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference ne sekvi simbolajn ligojn" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "" +"-N, --new-file trakti mankantajn dosierojn kiel malplenajn" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +" --unidirectional-new-file trakti mankantajn unuajn dosierojn kiel " +"malplenajn" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case preteratenti usklecon dum komparo de " +"dosiernomoj" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case konsideri usklecon dum komparo de dosiernomoj" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "" +"-x, --exclude=ŜABLONO forigi dosierojn, kiuj kongruas kun ŜABLONO" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=DOSIERO forigi dosierojn, kiuj kongruas kun iu " +"ŝablono en DOSIERO" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=DOSIERO komenci per DOSIERO, komparante dosierujojn" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=DOSIERO1 kompari DOSIERO1 kun ĉiuj argumentoj;\n" +" DOSIERO1 povas esti dosierujo" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=DOSIERO2 kompari ĉiujn argumentojn kun DOSIERO2;\n" +" DOSIERO2 povas esti dosierujo" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i, --ignore-case preteratenti malsamojn en uskleco en " +"dosierenhavo" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion preteratenti ŝanĝojn kaŭzatajn de tab-" +"etendigo" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space preteratenti blank-spacon ĉe linifino" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change preteratenti ŝanĝojn en kvanto da blank-spaco" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space preteratenti ĉiun blankan spacon" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B, --ignore-blank-lines preteratenti ŝanĝojn, kie linioj estas ĉiuj " +"malplenaj" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE preteratenti ŝanĝojn, kie ĉiuj linioj " +"kongruas al RE" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text trakti ĉiujn dosierojn kiel tekstajn" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr forigi linifinan CR ĉe enigo" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr " --binary legi kaj skribi datumaron ciferece" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=NOMO montri kunfanditan dosieron kun malsamoj " +"'#ifdef NOMO'" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr " --GTYPE-group-format=GFMT enformigi enig-grupojn GTYPE per GFMT" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr " --line-format=LFMT enformigi ĉiujn enigliniojn per LFMT" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr " --LTYPE-line-format=LFMT enformigi enig-grupojn LTYPE per LFMT" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" Tiuj enformigaj modifiloj provizas rafinitan regadon pri la eligo\n" +" de diff, ĝeneraliganta -D/--ifdef." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE estas 'old', 'new' aŭ 'unchanged'. GTYPE estas LTYPE aŭ 'changed'." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT (nur) povas enhavi:\n" +" %< linioj el DOSIERO1\n" +" %> linioj el DOSIERO2\n" +" %= linioj komunaj al DOSIERO1 kaj DOSIERO2\n" +" %[-][LARĜO][.[PREC]]{doxX}LITERO printf-stila indiko por LITERO\n" +" LITEROJ estas jenaj por nova grupo, minuskle por malnova grupo:\n" +" F unua lininumero\n" +" L lasta lininumero\n" +" N nombro de linioj = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) se A egalas al B, do T, male E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT (nur) povas enhavi:\n" +" %L enhavo de linio\n" +" %l enhavo linio, sen eventuala linifino\n" +" %[-][LARĜO][.[PREC]]{doxX}n printf-stila indiko de lininumero" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" Kaj GFMT kaj LFMT povas enhavi:\n" +" %% %\n" +" %c'C' la unuopa signo C\n" +" %c'\\000' la signo kun okuma kodo OOO\n" +" C la signo C (aliaj signoj reprezentas ili mem)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal strebe serĉi pli etan aron da ŝanĝoj" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +" --horizon-lines=NUM teni NUM liniojn de la komuna prefikso kaj sufikso" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files atendi grandajn dosierojn kaj multajn disajn " +"ŝanĝetojn" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help montri ĉi tiun helpon kaj eliri" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version montri informon pri versio kaj eliri" + +#: src/diff.c:982 +#, fuzzy +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"DOSIEROJ estas 'DOSIERO1 DOSIERO2' aŭ 'UJO1 UJO2' aŭ 'UJO DOSIERO...' aŭ " +"'DOSIERO... UJO'." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Se --from-file aŭ --to-file estas donita, ne estas limigoj por DOSIERO(j)." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Se DOSIERO estas '-', legi la ĉefenigujon." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Uzmaniero: %s [MODIFILO]... DOSIEROJ\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Kompari DOSIEROJn linion post linio." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "malakorda valoro de opcio %s: '%s'" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "malakordaj modifiloj pri elig-stilo" + +#: src/diff.c:1058 +#, fuzzy, c-format +msgid "invalid color '%s'" +msgstr "malvalida larĝo '%s'" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Nur en %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "ne eblas kompari '-' al dosierujo" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "modifilo -D ne estas subtenata kun dosierujoj" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Komunaj subdosierujoj: %s kaj %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Dosiero %s estas %s, dum dosiero %s estas %s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Simbolaj ligoj %s kaj %s malsamas\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Dosieroj %s kaj %s samas\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy SMITH" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "malkongruaj modifiloj" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "'-' indikita por pli ol unu enigdosiero" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "lego fiaskis" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A, --show-all montri ĉiujn ŝanĝojn, kun konfliktoj inter " +"krampoj" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed montri ed-skripton enkorpigantan ŝanĝojn\n" +" de PRADOSIERO al VIADOSIERO en MIADOSIEROn" + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "-E, --show-overlap kiel -e, sed kun konfliktoj inter krampoj" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3, --easy-only kiel -e, sed enkorpigi nur ne-interkovriĝantajn " +"ŝanĝojn" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +"-x, --overlap-only kiel -e, sed enkorpigi nur interkovriĝantajn " +"ŝanĝojn" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "-X kiel -x, sed kun konfliktoj inter krampoj" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "" +"-i aldoni la komandojn 'w' kaj 'q' al ed-skriptoj" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge montri veran kunfanditan dosieron, akorde al\n" +" -A se neniu alia modifilo ĉeestas" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text trakti ĉiujn dosierojn kiel tekstajn" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr forigi linifinan CR ĉe enigo" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T, --initial-tab ĝustigi tabojn per antaŭmeto de tabo" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=PROGRAMO uzi PROGRAMOn por kompari dosierojn" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=ETIKEDO uzi ETIKEDOn anstataŭ dosiernomo\n" +" (povas esti ripetata ĝis 3 fojoj)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help montri ĉi tiun helpon kaj eliri" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version eligi informon pri versio kaj eliri" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Uzmaniero: %s [MODIFILO]... MIADOSIERO PRADOSIERO VIADOSIERO\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Kompari tri dosierojn linion post linio." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"La apriora elig-formo estas iom hom-legebla reprezento de la ŝanĝoj.\n" +"\n" +"La modifiloj -e, -E, -x, -X (kaj korespondaj long-formoj) eligas ed-" +"skripton\n" +"anstataŭ la aprioron.\n" +"\n" +"Fine, la modifilo -m (--merge) igas ke diff3 kunfandu interne kaj\n" +"eligu la veran kunfanditan dosieron. Por ne-ordinara enigo, tio ĉi estas\n" +"pli fortika ol la uzo de ed.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "Elig-valoro estas 0 por sukceso, 1 por konfliktoj, 2 por problemo." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "interna eraro: fuŝo en formato de diff-blokoj" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff malsukcesis: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "interna eraro: malvalida diff-speco en process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "malvalida diff-formato; malvalida ŝanĝ-apartigilo" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "malvalida diff-formato; malkompleta lasta linio" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "ne eblis alvoki la subprogramon '%s'" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "malvalida diff-formato; malĝusta signo en antaŭa linio" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "interna eraro: malvalida diff-speco donita al eligo" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "enigdosiero ŝrumpis" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "ne eblas kompari dosiernomojn '%s' kaj '%s'" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: rikura dosieruja ciklo" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas LORD" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o, --output=DOSIERO funkcii interage, sendante eligon al DOSIERO" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "" +"-i, --ignore-case konsideri majusklojn kaj minusklojn kiel samajn" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion preteratenti ŝanĝojn kaŭzatajn de tab-etendigo" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" +"-Z, --ignore-trailing-space preteratenti ĉiun blank-spacon ĉe linifino" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change preteratenti ŝanĝojn en la kvanto da blank-" +"spaco" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space preteratenti ĉiun blank-spacon" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" +"-B, --ignore-blank-lines preteratenti ŝanĝojn, kie linioj estas ĉiuj " +"malplenaj" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE preteratenti ŝanĝojn, kie ĉiuj linioj " +"kongruas al RE" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr forigi linifinan CR ĉe enigo" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a, --text trakti ĉiujn dosierojn kiel tekstajn" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=NUM montri maksimume NUM (aprioras 130) kolumnojn" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" +"-l, --left-column montri nur la maldekstran kolumnon de komunaj " +"linioj" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines ne eligi komunajn liniojn" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs etendigi tabojn al spacoj en la eligo" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +" --tabsize=NUM tab-lokoj estas post ĉiu NUM (aprioras 8) " +"kolumnoj" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal strebe serĉi pli etan aron da ŝanĝoj" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files atendi grandajn dosierojn kaj multajn disajn " +"ŝanĝetojn" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=PROGRAMO uzi PROGRAMOn por kompari dosierojn" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help montri ĉi tiun helpon kaj eliri" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v, --version montri informon pri versio kaj eliri" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Uzmaniero: %s [MODIFILO]... DOSIERO1 DOSIERO2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Apuda kunfando de malsamoj inter DOSIERO1 kaj DOSIERO2." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "ne eblas interage kunfandi la ĉefenigujon" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "ambaŭ komparendaj dosieroj estas dosierujoj" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tredakti kaj uzi ambaŭ versiojn, ĉiu kun kaplinioj.\n" +"eb:\tredakti kaj uzi ambaŭ versiojn.\n" +"el aŭ e1:\tredakti kaj uzi maldekstran version.\n" +"er aŭ e2:\tredakti kaj uzi dekstran version.\n" +"e:\tredakti novan version.\n" +"l aŭ 1:\tuzi maldekstran version.\n" +"r aŭ 2:\tuzi dekstran version.\n" +"s:\tsilente transpreni komunajn liniojn.\n" +"v:\tlaŭte transpreni komunajn liniojn.\n" +"q:\tĉesi.\n" + +#: src/util.c:662 +#, fuzzy, c-format +msgid "unrecognized prefix: %s" +msgstr "%s: nerekonata modifilo '--%s'\n" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "" + +#, fuzzy +#~ msgid " or 'auto' (the default)" +#~ msgstr " --normal montri normalan malsamon (aprioras)" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: la modifilo '--%s' ne permesas argumenton\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: nerekonata modifilo '--%s'\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: la modifilo '-W %s' estas plursenca\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: la modifilo '-W %s' ne permesas argumenton\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: la modifilo '-W %s' postulas argumenton\n" diff --git a/local/recipes/tools/diffutils/source/po/es.gmo b/local/recipes/tools/diffutils/source/po/es.gmo new file mode 100644 index 0000000000..86aa691637 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/es.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/es.po b/local/recipes/tools/diffutils/source/po/es.po new file mode 100644 index 0000000000..9a444e7b42 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/es.po @@ -0,0 +1,1906 @@ +# Mensajes en español para GNU diffutils. +# Copyright (C) 1996, 2001, 2002, 2004, 2009, 2010, 2011, 2013 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Iñaky Pérez González <inaky@peloncho.fis.ucm.es>, 1996. +# Santiago Vila Doncel <sanvila@unex.es>, 2001, 2002, 2004, 2009, 2010, 2011, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU diffutils 3.3-pre1\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2013-02-19 00:30+0100\n" +"Last-Translator: Santiago Vila Doncel <sanvila@unex.es>\n" +"Language-Team: Spanish <es@li.org>\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: lib/argmatch.c:134 +#, fuzzy, c-format +msgid "invalid argument %s for %s" +msgstr "argumento de %s%s inválido '%s'" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "" + +#: lib/argmatch.c:154 +#, fuzzy +msgid "Valid arguments are:" +msgstr "argumento de %s%s inválido '%s'" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "error del programa" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "desbordamiento de pila" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Error del sistema desconocido" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "fichero regular vacío" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "fichero regular" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "directorio" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "enlace simbólico" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "cola de mensajes" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "semáforo" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "objeto de memoria compartido" + +# ¿Alguien sabe lo que es esto? +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "objeto de memoria `typed'" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "fichero especial de bloques" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "fichero especial de caracteres" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "`fifo'" + +#: lib/file-type.c:78 +msgid "door" +msgstr "" + +#: lib/file-type.c:81 +#, fuzzy +msgid "multiplexed block special file" +msgstr "fichero especial de bloques" + +#: lib/file-type.c:84 +#, fuzzy +msgid "multiplexed character special file" +msgstr "fichero especial de caracteres" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "" + +# FIXME +# se podría decir algo más decente para "weird" ... pero ¿qué? +# ¿ no habitual ? em +# ¡Nchts! Prefiero extraño ... no habitual me suena muy difuso +# siempre podemos poner escachifollado ;) ipg +#: lib/file-type.c:90 +#, fuzzy +msgid "named file" +msgstr "fichero extraño" + +#: lib/file-type.c:93 +#, fuzzy +msgid "network special file" +msgstr "fichero especial de bloques" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "" + +#: lib/file-type.c:102 +msgid "port" +msgstr "" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "`socket'" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "" + +# FIXME +# se podría decir algo más decente para "weird" ... pero ¿qué? +# ¿ no habitual ? em +# ¡Nchts! Prefiero extraño ... no habitual me suena muy difuso +# siempre podemos poner escachifollado ;) ipg +#: lib/file-type.c:110 +msgid "weird file" +msgstr "fichero extraño" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: la opción '-W %s' es ambigua\n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: la opción '%s' es ambigua; posibilidades:" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: opción no reconocida '%c%s'\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: la opción '%c%s' no admite ningún argumento\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: la opción '--%s' requiere un argumento\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: opción inválida -- '%c'\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: la opción requiere un argumento -- '%c'\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "«" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "»" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Conseguido" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "No hay ninguna coincidencia" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Expresión regular inválida" + +# Se refiere probablemente a cosas tales como que la c con la h es "ch", +# aunque este ejemplo ya no es válido, pues la Real Academia dice +# que para propósitos de ordenación son letras independientes. +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Carácter de unión inválido" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Carácter de clase inválido" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Barra invertida al final" + +# FIXME +# Retro-referencia es lo mejor que se me ocurre ... claro, que acepto +# sugerencias ;) +# ¿Referencia hacia atrás? sv +# Me suena a cangrejo ;) ... no se ... a ver que opinan Enrique y el resto de +# la gente ... La verdad es que prefiero Retro-referencia a referencia hacia +# atrás (más que nada es por que es la traducción que se hace, como por +# ejemplo en backfeed -- retroalimentación) IPG +# En glibc.1.10.1 : +# # posix/regex.c:946 +# msgid "Invalid back reference" +# msgstr "Referencia hacia atrás no válida" em +# Si no fuese porque has traducido tu la glibc, te preguntaría quien ha sido +# el asesino que ha puesto eso :) Momento que voy a mirar la enciclopedia +# esa que tenemos decorando la estantería ;) ... ¡¡Ja jaaaa!! :) ¡Palidecerás +# ante esta cita! "Diccionario Enciclopédico Espasa-Calpe". Edición de Dios +# sabe cuando (la décima, creo), volumen 15, página 8846, tercera columna, +# tal que a la mitad: +# +# retrocontrol. (De retro- y control.) m. Biol. Fenómeno de autocontrol por +# el cual la excesiva acumulación de una hormona en la sangre actúa sobre +# la glándula corespondiente e inhibe automáticamente su producción. Se +# utiliza mucho internacionalmente la voz inglesa --feed-back-- para expre- +# sar esta idea. +# +# Y mejor ... para rematar :). Misma página, primera columna, cuarta entrada: +# +# retro-. (del lat. retro, --hacia atrás--) pref. que lleva a lugar o tiempo +# anterior a la significación de las voces simples a que se halla unida: +# retro-traer, retro-vender ... +# +# ¡¡Quiyos!! Hay dos páginas de retro-"algo" ... :) ¡no me digáis después +# de esto que preferís "hacia atrás"! y máxime cuando está aceptado preponer +# retro- para ello :) Si no os importa, y a no ser que venga alguno de la +# RALE y me castre por ello, dejaré retro-referencia. +# ipg +# Un comentario: No serán los de la RALE los que hagan eso, sino los +# que no lo entiendan. Aún después de ver tus acertadas referencias, pienso +# que referencia hacia atrás se puede entender mejor, pero por supuesto, +# no estoy dispuesto a matar por ello... sv +# :) Gracias, pero por ahora dejaré retro-referencia, me parece más clara +# en cuanto al significado preciso de la frase. ipg +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Retro-referencia inválida" + +#: lib/regcomp.c:156 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "[ ó [^ desemparejados" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "( ó \\( desemparejado" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "\\{ desemparejado" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "El contenido de \\{\\} no es válido" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Final de rango inválido" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Memoria agotada" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Expresión regular precedente inválida" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Final prematuro de la expresión regular" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "La expresión regular es demasiado grande" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr ") ó \\) desemparejado" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "No hay ninguna expresión regular previa" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "memoria agotada" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "entrada estándar" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "salida estándar" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "salida de error estándar" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "flujo desconocido" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "fallo al reabrir %s con modo %s" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "argumento de %s%s inválido '%s'" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "sufijo inválido en el argumento de %s%s '%s'" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "%s%s argumento '%s' demasiado grande" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Empaquetado por %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Empaquetado por %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Licencia GPLv3+: GPL de GNU versión 3 o posterior <http://gnu.org/licenses/" +"gpl.html>.\n" +"Esto es software libre, usted es libre de cambiarlo y redistribuirlo.\n" +"No hay NINGUNA GARANTÍA, hasta donde permite la ley.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Escrito por %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Escrito por %s y %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Escrito por %s, %s, y %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Escrito por %s, %s, %s,\n" +"y %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Escrito por %s, %s, %s,\n" +"%s, y %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Escrito por %s, %s, %s,\n" +"%s, %s, y %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Escrito por %s, %s, %s,\n" +"%s, %s, %s, y %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Escrito por %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"y %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Escrito por %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, y %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Escrito por %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, y otros.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Comunicar errores en el programa a: %s\n" +"Comunicar errores de traducción a es@li.org y al último traductor.\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Comunicar errores de %s a: %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s página inicial: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "%s página inicial: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"Ayuda general sobre el uso de software de GNU: <http://www.gnu.org/gethelp/" +">\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Los ficheros %s y %s son distintos\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Los ficheros binarios %s y %s son distintos\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "No hay ningún carácter de nueva línea al final del fichero" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjörn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Pruebe '%s --help' para más información." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "valor --ignore-initial inválido '%s'" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "las opciones -l y -s son incompatibles" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "la escritura falló" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "salida estándar" + +# Muestra como caracteres los bytes que difieran +# queda más claro, creo yo em +# Yo no le veo diferencia (¿será por qué lo parí yo? ;) ipg +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b --print-bytes muestra los bytes que son distintos" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i, --ignore-initial=SALTO salta los primeros SALTO bytes de\n" +" las dos entradas" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=SALTO1:SALTO2 salta los primeros SALTO1 bytes de " +"FICHERO1\n" +" y los primeros SALTO2 bytes de FICHERO2" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l, --verbose muestra los números de byte y valores de todos los bytes " +"que\n" +" difieran" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=LÍMITE compara como máximo LÍMITE bytes" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent suprime toda la salida normal" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help muestra esta ayuda y finaliza" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v, --version informa de la versión y finaliza" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Modo de empleo: %s [OPCIÓN]... FICHERO1 [FICHERO2 [SALTO1 [SALTO2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Compara dos ficheros byte por byte." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"Los parámetros opcionales SALTO1 y SALTO2 especifican el número de\n" +"bytes que se saltan en cada fichero (cero por omisión)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Los argumentos obligatorios para las opciones largas son también " +"obligatorios\n" +"para las opciones cortas.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"Los valores SALTO pueden estar seguidos por los siguientes sufijos\n" +"multiplicadores:\n" +"kB 1.000, K 1.024, MB 1.000.000, M 1.048.576,\n" +"GB 1.000.000.000, G 1.073.741.824, y así en adelante para T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Si un FICHERO es '-' o no se especifica, lee la entrada estándar." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"El estado de salida es 0 si las entradas son iguales, 1 si son diferentes,\n" +"2 en caso de problema." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "valor --bytes inválido '%s'" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "falta un operando después de '%s'" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "operando extra '%s'" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s son distintos: byte %s, línea %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s son distintos: el byte %s, en la línea %s es %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: fin de fichero encontrado en %s\n" + +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s %s son distintos: byte %s, línea %s\n" + +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s %s son distintos: byte %s, línea %s\n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: fin de fichero encontrado en %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "longitud de contexto inválida '%s'" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "este sistema no admite paginación" + +# FIXME +# me sace a mi que esto no se parece ni un ápice a lo que +# se quiere decir en realidad. He mirado los docs y no consigo +# encontrarle un buen significado, así que pido ayuda ;) +# Ni p... idea em +# La opción -L LABEL puedes usarla, una o dos veces, pero no más. A eso +# se refiere. la opción de etiqueta de fichero se ha especificado demasiadas +# veces. O más cortito, dejarlo como está :) em+ +# Me parece que así está bien ... +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "demasiadas opciones de etiqueta de fichero" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "ancho inválido '%s'" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "opciones de ancho conflictivas" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "longitud del horizonte inválida '%s'" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "tamaño de tab inválido '%s'" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "opciones de tamaño de tab conflictivas" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "se ha especificado tanto --from-file como --to-file" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr " --normal produce un diff normal (predeterminado)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "" +"-q --brief indica sólo si los ficheros son diferentes o no" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "" +"-s --report-identical-files notifica cuándo dos ficheros son idénticos" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C NÚM, --context[=NÚM] muestra NÚM (por omisión 3) líneas de contexto" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U NÚM, --unified[=NÚM] muestra NÚM (por omisión 3) línea de contexto\n" +" unificado" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e --ed produce un script ed" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n --rcs produce un diff en formato RCS" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side muestra en dos columnas" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=NÚM muestra como mucho NÚM columnas de " +"impresión\n" +" (por omisión 130)" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +" --left-column muestra sólo en la columna izquierda las líneas " +"comunes" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines no muestra las líneas comunes" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" +"-p, --show-c-function muestra en qué función C está cada cambio" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" +"-F, --show-function-line=ER muestra la línea más reciente que encaje con ER" + +#: src/diff.c:905 +#, fuzzy +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label ETIQUETA utiliza ETIQUETA en lugar del nombre del " +"fichero\n" +" (se puede repetir)" + +# Aquí a lo mejor también: la salida -> el resultado. sv +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t --expand-tabs expande los tabuladores a espacios en la salida" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab hace que los tabuladores se alineen\n" +" anteponiendo uno" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=NÚM los topes de tabulación están separados por NÚM " +"columnas\n" +" de impresión (por omisión, 8)" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty suprime espacios o tabs antes de una línea " +"vacía" + +# Sugerencia: la salida -> el resultado. +# (y paginarla -> paginarlo, en su caso). sv +# Yo personalmente prefiero `la salida'; si traducimos literalmente el +# inglés es eso, no cabe duda, pero poner `el resultado' no me cuadra. +# Lo digo porque tenemos una entrada y una salida (por un lado entran +# los cerdos a la máquina de hacer chorizos, y por otro salen). Creo +# que con esto me guiaré por lo que haya hecho el resto de la gente. +# Si sabes qué han hecho ... :). ipg +# Te mandaré el gettext, para que veas lo que vale un peine... sv +# X'D ... no soy tan malo ... ipg +# Medita de nuevo si no usas resultado em +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" +"-l, --paginate pasa la salida a través de 'pr' para paginarla" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r, --recursive compara recursivamente todos los " +"subdirectorios" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference no sigue los enlaces simbólicos" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "" +"-N, --new-file trata los ficheros que no existan como vacíos" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +" --unidirectional-new-file trata los ficheros originales que no " +"existan\n" +" como vacíos" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case descarta las diferencias entre mayúsculas y\n" +" minúsculas al comparar los nombres de los " +"ficheros" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +"--no-ignore-file-name-case considera distintas mayúsculas y minúsculas\n" +" cuando compara los nombres de los ficheros" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "" +"-x, --exclude=PAT excluye los ficheros que coincidan con PAT" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=FICHERO excluye los ficheros que coincidan con " +"alguna\n" +" expresión regular de FICHERO" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=FICHERO comienza por FICHERO cuando se comparan\n" +" directorios" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=FICHERO1 compara FICHERO1 con todos los operandos;\n" +" FICHERO1 puede ser un directorio" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=FICHERO2 compara todos los operandos con FICHERO2\n" +" FICHERO2 puede ser un directorio" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i, --ignore-case descarta las diferencias entre mayúsculas y " +"minúsculas\n" +" en el contenido de los ficheros" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion descarta cambios debidos a expansiones de " +"tabs" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" +"-Z, --ignore-trailing-space descarta espacio en blanco al final de línea" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change descarta las diferencias en la cantidad de\n" +" espacio en blanco" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space descarta los espacios en blanco" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B, --ignore-blank-lines descarta los cambios en líneas completamente " +"vacías" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=EXPR-REG descarta las líneas que coincidan con " +"EXPR-REG" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "" +"-a, --text trata todos los ficheros como de tipo texto" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr elimina los retornos de carro finales en la " +"entrada" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr "" +" --binary lee y escribe los datos en modo binario" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=NOMBRE genera un fichero combinado que muestra las\n" +" diferencias con '#ifdef NOMBRE'" + +# Propongo similar -> parecida. Ver gettext. sv +# Hmmm ... prefiero similar. Antes estaba puesto `parecida' y la verdad, +# no quedaba tan bien. ipg +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +" --GTYPE-group-format=GFMT formatea los grupos de entrada GTYPE con GFMT" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "" +" --line-format=LFMT formatea todas las líneas de entrada con LFMT" + +# ídem. sv +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +" --LTYPE-line-format=LFMT formatea las líneas de entrada LTYPE con LFMT" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" Estas opciones de formato proporcionan un control preciso sobre el " +"resultado\n" +" de diff, generalizando -D/--ifdef." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE es 'old' (antiguo), 'new' (nuevo) o 'unchanged' (sin cambios).\n" +" GTYPE es como LTYPE o 'changed' (cambiado)." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT (solamente) puede contener:\n" +" %< líneas del FICHERO1\n" +" %> líneas del FICHERO2\n" +" %= líneas comunes a FICHERO1 y FICHERO2\n" +" %[-][ANCHO][.[PRECISIÓN]]{doxX}LETRA especificación printf para LETRA\n" +" Las LETRAs pueden ser como siguen para grupos nuevos (en minúsculas\n" +" para grupos antiguos):\n" +" F número de la primera línea\n" +" L número de la última línea\n" +" N número de líneas = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) si A es igual a B entonces T en caso contrario E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT (solamente) puede contener:\n" +" %L contenido de la línea\n" +" %l contenido de la línea, excluyendo caracteres de nueva línea finales\n" +" %[-][ANCHO][.[PRECISIÓN]]{doxX}n especificación en estilo printf para " +"el\n" +" número de línea de entrada" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" Tanto GFMT como LFMT pueden contener:\n" +" %% %\n" +" %c'C' el carácter C\n" +" %c'\\OOO' el carácter con código octal OOO\n" +" C el carácter C (los otros caracteres se representan a sí mismos)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d, --minimal se esfuerza en encontrar un grupo de cambios menor" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +" --horizon-lines=NÚM mantiene NÚM líneas de prefijos y sufijos comunes" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files supone que los ficheros son grandes y los cambios " +"son\n" +" numerosos, pequeños y dispersos" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help muestra esta ayuda y finaliza" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version informa de la versión y finaliza" + +#: src/diff.c:982 +#, fuzzy +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"FICHEROS puede ser 'FICHERO1 FICHERO2' o 'DIRECTORIO1 DIRECTORIO2'\n" +" o 'DIRECTORIO FICHERO...' o 'FICHERO... DIRECTORIO'." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "Si se da --from-file o --to-file, no hay restricciones en FICHERO(s)." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Si un FICHERO es '-', lee la entrada estándar." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Modo de empleo: %s [OPCIÓN]... FICHEROS\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Compara FICHEROS línea por línea." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "la opción %s tiene el valor conflictivo '%s'" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "las especificaciones del estilo de salida son conflictivas" + +#: src/diff.c:1058 +#, fuzzy, c-format +msgid "invalid color '%s'" +msgstr "ancho inválido '%s'" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Sólo en %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "no se puede comparar '-' con un directorio" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "la opción -D no se puede usar con directorios" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Subdirectorios comunes: %s y %s\n" + +# Nota: El segundo y el cuarto `%s' son tipos de fichero. +# Por ejemplo, "texto C", "texto FORTRAN", etc. +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "El fichero %s es un %s mientras que el %s es un %s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Los enlaces simbólicos %s y %s son distintos\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Los ficheros %s y %s son idénticos\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "opciones incompatibles" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "se ha especificado '-' para más de un fichero de entrada" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "la lectura falló" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A, --show-all muestra todos los cambios, encerrando los " +"conflictos\n" +" entre corchetes" + +# Sería ideal traducir OLDFILE y YOURFILE. sv +# Sí, eso pensé yo, pero no sé como ponerlo para que quede bien ... +# Esto no hay quien lo entienda, piénsalo 3 minutos más si te apetece :) em+ +# +# OLDFILE FICHERO-ANTIGUO +# YOURFILE TU-FICHERO +# MYFILE MI-FICHERO +# +# Pongo eso por ahora, pero espero una sugerencia mejor ;) +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed muestra un `script' ed incorporando los cambios entre\n" +" FICHERO-ANTIGUO y TU-FICHERO a MI-FICHERO" + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +"-E, --show-overlap como -e, pero encerrando los conflictos\n" +" entre corchetes" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3, --easy-only como -e, pero solamente incorpora los cambios " +"que\n" +" no se superponen" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +"-x, --overlap-only como -e, pero solamente muestra los cambios que " +"se\n" +" solapan" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" +"-X como -x, pero encierra conflictos entre corchetes" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "" +"-i añade las órdenes 'w' y 'q' a los scripts ed" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge muestra el fichero combinado, de acuerdo con -A " +"si\n" +" no se especifica ninguna otra opción" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "" +"-a, --text trata todos los ficheros como de tipo texto" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr elimina los retornos de carro finales en la " +"entrada" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab hace que los tabuladores se alineen anteponiendo " +"uno" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=PROGRAMA utiliza PROGRAMA para comparar los ficheros" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=ETIQUETA utiliza ETIQUETA en lugar del nombre del " +"fichero\n" +" (se puede reperir hasta tres veces)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help muestra esta ayuda y finaliza" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v --version informa de la versión y finaliza" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Modo de empleo: %s [OPCIÓN]... MI-FICHERO FICHERO-ANTIGUO TU-FICHERO\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Compara tres ficheros línea por línea." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"El formato de salida predeterminado es una representación más o menos " +"legible\n" +"de los cambios.\n" +"\n" +"Las opciones -e, -E, -x, -X (y sus correspondientes versiones largas) " +"generan\n" +"un `script' ed en lugar del resultado predeterminado.\n" +"\n" +"Finalmente, la opción -m (--merge) hace que diff3 realice la combinación\n" +"internamente y muestra el fichero combinado. Para ciertas entradas, esto " +"es\n" +"más robusto que usar ed.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"El estado de salida es 0 en caso de éxito, 1 si hay conflictos, 2 en caso " +"de\n" +"problema." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "error interno: fallo en el formato de los bloques diff" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff falló: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "error interno: tipo de diff inválido en process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "formato de diff inválido; separador de cambio inválido" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "formato de diff inválido; línea final incompleta" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "no se ha podido invocar al programa subsidiario '%s'" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "" +"formato de diff inválido; caracteres incorrectos al comienzo de la línea" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "error interno: tipo de diff inválido pasado a la salida" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "el fichero de entrada ha menguado" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "no se pueden comparar los nombres de fichero '%s' y '%s'" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: bucle de directorio recursivo" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o, --output=FICHERO opera interactivamente, enviando el " +"resultado\n" +" al fichero FICHERO" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i, --ignore-case considera iguales mayúsculas y minúsculas" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion descarta cambios debidos a expansiones de tabs" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" +"-Z, --ignore-trailing-space descarta espacio en blanco al final de línea" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change descarta las diferencias en la cantidad " +"espacio\n" +" en blanco" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space descarta todo el espacio en blanco" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" +"-B, --ignore-blank-lines descarta los cambios cuyas líneas son todas " +"vacías" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=EXPR-REG descarta las líneas que coincidan con " +"EXPR-REG" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr elimina los retornos de carro finales en la " +"entrada" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "" +"-a, --text trata todos los ficheros como de tipo texto" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=NÚM muestra como mucho NÚM columnas de impresión\n" +" (por omisión 130)" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" +"-l, --left-column muestra sólo la columna izquierda de líneas " +"comunes" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines no muestra las líneas comunes" + +# Aquí a lo mejor también: la salida -> el resultado. sv +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs expande los tabuladores a espacios en la salida" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +" --tabsize=NÚM los topes de tabulación están separados por " +"NÚM\n" +" columnas de impresión (por omisión, 8)" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d, --minimal se esfuerza en encontrar un grupo de cambios " +"menor" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files supone que los ficheros son grandes y los " +"cambios\n" +" son numerosos, pequeños y dispersos" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=PROGRAMA utiliza PROGRAMA para comparar los ficheros" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help muestra esta ayuda y finaliza" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v, --version informa de la versión y finaliza" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Modo de empleo: %s [OPCIÓN]... FICHERO1 FICHERO2\n" + +# Se admiten sugerencias. +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "" +"Combinación a dos columnas de las diferencias entre FICHERO1 y FICHERO2." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "no se puede mezclar interactivamente con la entrada estándar" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "los dos ficheros que hay que comparar son directorios" + +# FIXME +# ¿sugerencias para traducir mejor "verbosely"? +# ¿ Con verborrea ?, ;) +# era una broma, ¿ qué tal prolijamente ? em +# Huy ... mi famosa enciclopedia no dice en prolijo nada que se +# parezca a dar mucho la lata ... casi que lo dejamos, ¿no? ipg +# Sugerencia -> `verbosamente' -> con detalle. sv +# Hfff ... es que `con detalle' suena más a dar detalles de lo +# que es cada cosa, que no a que se está haciendo ipg +# Federico ha usado "prolijamente" en tar. Algo habrá que hacer, porque +# verbosamente no me suena a español. ¿Existe eso? sv +# A mi tampoco ... voy a ver si conecto con el diccionario de Anaya +# y lo miro ... a veeeeerrr ... ya ta: +# prolijo, -a: Del lat. prolixus = fluyente. +# 1. (adjetivo, -a). Largo, muy extenso. +# 2. (adjetivo, -a). Cuidadoso o esmerado con exceso. +# 3. (adjetivo, -a). Cargante, molesto. +# FAM: Prolijamente, prolijidad. +# SIN. 1. Amplio. 3. Impertinente, pesado. +# ANT. 1. Lacónico, conciso. 2. Descuidado. 3. Ameno. +# (Referencia: http://www.anaya.es/dict/Buscar) +# +# Pues está claro que es castellano (o español), pero yo no lo había +# oído hasta ahora, y me imagino que mucha gente estará igual. Yo +# voto por buscar algo más común (y creo que verbosamente vale, +# momento que lo bujco). ipg +# +# ¿ Lo encontraste ? , yo no lo he oído en mi vida, y me suena a verborrea, que +# es más bien despectivo. ¿ qué tal `con detalle' ? em+ +# Dejo verbosamente, que al menos el alma precavida lo asociará con que hay +# mucho verbo :) ipg +# +# Pero vamos a ver, ¿la palabra "verbosamente" existe? +# A mí me parece completamente un "palabro". sv +# ## ¿Por qué no la buscas en algún diccionario? sv +# ## Momeneto ... en la Espasa Calpe viene: +# ## verbosamente: adverbio, con verbosidad. +# ## En Anaya (http://www.anaya.es/dict): +# ## verbosidad +# ## I. De verbo. +# ## 1. (sustantivo femenino). Verborrea. +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed: Edita y usa ambas versiones, cada una decorada con una cabecera.\n" +"eb: Edita y usa ambas versiones.\n" +"el ó e1: Edita y usa la versión izquierda.\n" +"er ó e2: Edita y usa la versión derecha.\n" +"e: Edita una nueva versión.\n" +"l ó 1: Usa la versión izquierda.\n" +"r ó 2: Usa la versión derecha.\n" +"s: Incluye líneas comunes silenciosamente.\n" +"v: Incluye líneas comunes verbosamente.\n" +"q: Salir.\n" + +#: src/util.c:662 +#, fuzzy, c-format +msgid "unrecognized prefix: %s" +msgstr "%s: opción no reconocida '--%s'\n" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "" + +#, fuzzy +#~ msgid " or 'auto' (the default)" +#~ msgstr "" +#~ " --normal produce un diff normal (predeterminado)" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: la opción '--%s' no admite ningún argumento\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: opción no reconocida '--%s'\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: la opción '-W %s' es ambigua\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: la opción '-W %s' no admite ningún argumento\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: la opción '-W %s' requiere un argumento\n" + +#~ msgid "" +#~ "-b --ignore-space-change ignore changes in the amount of white " +#~ "space" +#~ msgstr "" +#~ "-b, --ignore-space-change descarta las diferencias en la cantidad " +#~ "de\n" +#~ " espacio en blanco" + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i SALTO1:SALTO2 --ignore-initial=SALTO1:SALTO2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "" +#~ "-s --quiet --silent No muestra nada, sólo da un código de salida." + +#~ msgid "--help Output this help." +#~ msgstr "--help Muestra esta ayuda y finaliza." + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ "-c -C NÚM --context[=NÚM] Muestra NÚM (3 por omisión) líneas de " +#~ "contexto\n" +#~ "-u -U NÚM --unified[=NÚM] Muestra NÚM (3 por omisión) líneas de " +#~ "contexto\n" +#~ " unificado.\n" +#~ " --label NOMBRE Usa NOMBRE en lugar del nombre de fichero.\n" +#~ " -p --show-c-function Muestra en qué función C se encuentra cada " +#~ "cambio.\n" +#~ " -F EXPR-REG --show-function-line=EXPR-REG Muestra la línea más " +#~ "reciente\n" +#~ " que coincida con EXPR-REG." + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ "-y --side-by-side Genera salida en dos columnas.\n" +#~ " -W NÚM --width=NÚM Genera como máximo NÚM (130 por omisión) " +#~ "caracteres\n" +#~ " por línea.\n" +#~ " --left-column Muestra sólo la columna izquierda en las líneas " +#~ "comunes.\n" +#~ " --suppress-common-lines No muestra las líneas comunes." + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "" +#~ "--speed-large-files Supone que los ficheros son grandes y los cambios " +#~ "son\n" +#~ " numerosos, pequeños y dispersos." + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "-X Muestra los cambios superpuestos (entre corchetes)." + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "" +#~ "-m --merge Produce un fichero mezclado en lugar de un\n" +#~ " script ed (por omisión -A)." + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "" +#~ "-L NOMBRE --label=NOMBRE Usa NOMBRE en lugar del nombre de fichero." + +#~ msgid "%s: illegal option -- %c\n" +#~ msgstr "%s: opción ilegal -- %c\n" + +#~ msgid "" +#~ "This is free software; see the source for copying conditions. There is " +#~ "NO\n" +#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR " +#~ "PURPOSE.\n" +#~ msgstr "" +#~ "Esto es software libre; vea el código fuente para las condiciones de " +#~ "copia.\n" +#~ "No hay NINGUNA garantía; ni siquiera de COMERCIABILIDAD o ADECUACIÓN " +#~ "PARA\n" +#~ "UN PROPÓSITO EN PARTICULAR.\n" + +# Véase "A bug's life". +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>." +#~ msgstr "Comunicar bichos a <bug-gnu-utils@gnu.org>." + +#~ msgid "`-%ld' option is obsolete; use `-%c %ld'" +#~ msgstr "la opción `-%ld' está obsoleta; utilice `-%c %ld'" + +#~ msgid "`-%ld' option is obsolete; omit it" +#~ msgstr "la opción `-%ld' está obsoleta; omítala" + +#~ msgid "subsidiary program `%s' not found" +#~ msgstr "no se encontró el programa subsidiario `%s'" + +#~ msgid "subsidiary program `%s' failed" +#~ msgstr "el programa subsidiario `%s' falló" + +#~ msgid "subsidiary program `%s' failed (exit status %d)" +#~ msgstr "el programa subsidiario `%s' falló (estado de salida %d)" + +#~ msgid "" +#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n" +#~ "You may redistribute copies of this program\n" +#~ "under the terms of the GNU General Public License.\n" +#~ "For more information about these matters, see the files named COPYING." +#~ msgstr "" +#~ "Este programa viene sin NINGUNA GARANTÍA, hasta donde permite la ley.\n" +#~ "Se pueden redistribuir copias de este programa bajo los términos de la\n" +#~ "Licencia Pública General de GNU.\n" +#~ "Para más información sobre esto, vea los ficheros llamados COPYING." + +#~ msgid "Written by Torbjorn Granlund and David MacKenzie." +#~ msgstr "Escrito por Torbjörn Granlund y David MacKenzie." + +#~ msgid "" +#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman, and Len Tower." +#~ msgstr "" +#~ "Escrito por Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman, y Len Tower." + +#~ msgid "subsidiary program `%s' not executable" +#~ msgstr "el programa subsidiario `%s' no es ejecutable" + +# Creo que es suficientemente decente, pero se admiten sugerencias. +#~ msgid "--inhibit-hunk-merge Do not merge hunks." +#~ msgstr "--inhibit-hunk-merge No junta los trozos." + +#~ msgid "context length specified twice" +#~ msgstr "la longitud del contexto se ha especificado dos veces" + +#~ msgid "multiple `--from-file' options" +#~ msgstr "se han dado varias opciones `--from-file'" + +#~ msgid "multiple `--to-file' options" +#~ msgstr "se han dado varias opciones `--to-file'" + +#~ msgid "regular empty executable file" +#~ msgstr "fichero regular ejecutable vacío" + +#~ msgid "regular executable file" +#~ msgstr "fichero regular vacío" + +#~ msgid ": not found\n" +#~ msgstr ": no encontrado\n" + +#~ msgid "-D%s: conflicting #ifdef format" +#~ msgstr "-D%s: formato #ifdef conflictivo" + +#~ msgid "%s: conflicting line format" +#~ msgstr "%s: formato de línea conflictivo" + +#~ msgid "conflicting group format" +#~ msgstr "formato de grupo conflictivo" + +#~ msgid "--ignore-initial value must be a nonnegative integer" +#~ msgstr "el valor de --ignore-initial debe ser un entero no negativo" + +#~ msgid "column width must be a positive integer" +#~ msgstr "el ancho de la columna debe ser un entero positivo" + +#~ msgid "context length must be a nonnegative integer" +#~ msgstr "la longitud del contexto ha de ser un entero no negativo" + +#~ msgid "horizon must be a nonnegative integer" +#~ msgstr "el horizonte (horizon) ha de ser un entero no negativo" diff --git a/local/recipes/tools/diffutils/source/po/fi.gmo b/local/recipes/tools/diffutils/source/po/fi.gmo new file mode 100644 index 0000000000..087c3666e1 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/fi.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/fi.po b/local/recipes/tools/diffutils/source/po/fi.po new file mode 100644 index 0000000000..484469d97e --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/fi.po @@ -0,0 +1,1669 @@ +# Finnish translation of GNU diffutils. +# This file is distributed under the same license as the diffutils package. +# Copyright © 2016 Free Software Foundation, Inc. +# Lauri Nurmi <lanurmi@iki.fi>, 2002-2004,2015-2016. +# +msgid "" +msgstr "" +"Project-Id-Version: diffutils 3.3-pre1\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2016-05-26 21:28+0300\n" +"Last-Translator: Lauri Nurmi <lanurmi@iki.fi>\n" +"Language-Team: Finnish <translation-team-fi@lists.sourceforge.net>\n" +"Language: fi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 1.8.7\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: lib/argmatch.c:134 +#, fuzzy, c-format +msgid "invalid argument %s for %s" +msgstr "argumentti %s on virheellinen %s:lle" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "" + +#: lib/argmatch.c:154 +#, fuzzy +msgid "Valid arguments are:" +msgstr "argumentti %s on virheellinen %s:lle" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "ohjelmavirhe" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "pinon ylivuoto" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Tuntematon järjestelmävirhe" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "tavallinen tyhjä tiedosto" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "tavallinen tiedosto" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "hakemisto" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "symbolinen linkki" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "viestijono" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "semafori" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "jaettu muistiobjekti" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "tyypitetty muistiobjekti" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "lohkolaite-erikoistiedosto" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "merkkilaite-erikoistiedosto" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "" + +#: lib/file-type.c:81 +#, fuzzy +msgid "multiplexed block special file" +msgstr "lohkolaite-erikoistiedosto" + +#: lib/file-type.c:84 +#, fuzzy +msgid "multiplexed character special file" +msgstr "merkkilaite-erikoistiedosto" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "" + +#: lib/file-type.c:90 +#, fuzzy +msgid "named file" +msgstr "outo tiedosto" + +#: lib/file-type.c:93 +#, fuzzy +msgid "network special file" +msgstr "lohkolaite-erikoistiedosto" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "" + +#: lib/file-type.c:102 +msgid "port" +msgstr "" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "pistoke" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "outo tiedosto" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: valitsin ”-W %s” on moniselitteinen\n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: valitsin ”%s” on moniselitteinen; vaihtoehdot:" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: tunnistamaton valitsin ”%c%s”\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: valitsin ”%c%s” ei salli argumenttia\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: valitsin ”--%s” vaatii argumentin\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: virheellinen valitsin -- ”%c”\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: valitsin vaatii argumentin -- ”%c”\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "”" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "”" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Onnistui" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Ei vastaavuutta" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Virheellinen säännöllinen lauseke" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Virheellinen vertailumerkki" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Virheellinen merkkiluokan nimi" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Kenoviiva lopussa" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Virheellinen takaisinviittaus" + +#: lib/regcomp.c:156 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Pariton [ tai [^" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Pariton ( tai \\(" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Pariton \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Virheellinen \"\\{\\}\":n sisältö" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Virheellinen välin loppu" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Muisti lopussa" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Virheellinen edeltävä säännöllinen lauseke" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Ennenaikainen säännöllisen lausekkeen loppu" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Liian suuri säännöllinen lauseke" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Pariton ) tai \\)" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Ei edellistä säännöllistä lauseketta" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "muisti lopussa" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "vakiosyöte" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "vakiotuloste" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "vakiovirhetuloste" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "tuntematon virta" + +#: lib/xfreopen.c:39 +#, fuzzy, c-format +msgid "failed to reopen %s with mode %s" +msgstr "%s: Oikeuksien muuttaminen tilaan %s ei onnistu" + +#: lib/xstrtol-error.c:63 +#, fuzzy, c-format +msgid "invalid %s%s argument '%s'" +msgstr "argumentti %s on virheellinen %s:lle" + +#: lib/xstrtol-error.c:68 +#, fuzzy, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "virheellinen loppuliite ”%.*s” liukulukuvakiolla" + +#: lib/xstrtol-error.c:72 +#, fuzzy, c-format +msgid "%s%s argument '%s' too large" +msgstr "lukumäärä %s on liian suuri" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Paketoinut %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Paketoinut %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Lisenssi GPLv3+: GNU GPL versio 3 tai myöhempi <http://gnu.org/licenses/gpl." +"html>.\n" +"Tämä on vapaa ohjelmisto; sitä saa vapaasti muuttaa ja levittää edelleen.\n" +"Siinä määrin kuin laki sallii, TAKUUTA EI OLE.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Kirjoittanut %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Kirjoittaneet %s ja %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Kirjoittaneet %s, %s ja %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Kirjoittaneet %s, %s,\n" +"%s ja %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Kirjoittaneet %s, %s,\n" +"%s, %s ja %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Kirjoittaneet %s, %s,\n" +"%s, %s, %s ja %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Kirjoittaneet %s, %s,\n" +"%s, %s, %s,\n" +"%s ja %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Kirjoittaneet %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s ja %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Kirjoittaneet %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s ja %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Kirjoittaneet %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, %s ja muut.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Ilmoita ohjelmistovioista (englanniksi) osoitteeseen: %s\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Ilmoita %s-vioista (englanniksi) osoitteeseen %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s-kotisivu: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "%s-kotisivu: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"Yleisohjeita GNU-ohjelmistojen käyttöön: <http://www.gnu.org/gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Tiedostot %s ja %s eroavat\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Binääritiedostot %s ja %s eroavat\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Ei rivinvaihtoa tiedoston lopussa" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjörn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Komento ”%s --help” antaa lisää tietoa." + +#: src/cmp.c:137 +#, fuzzy, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "virheellinen alkuarvo jäsenelle %qE" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "valitsimet -l ja -s eivät ole yhteensopivia" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "kirjoitus epäonnistui" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "vakiotuloste" + +#: src/cmp.c:161 +#, fuzzy +msgid "-b, --print-bytes print differing bytes" +msgstr "-b --print-bytes Tulostaa eroavat tavut." + +#: src/cmp.c:162 +#, fuzzy +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i OHITA --ignore-initial=OHITA Ohittaa syötteen ensimmäiset OHITA tavua." + +#: src/cmp.c:163 +#, fuzzy +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +" Ohittaa TIEDOSTO1:n ensimmäiset OHITA1 tavua, ja TIEDOSTO2:n ensimmäiset " +"OHITA2 tavua." + +#: src/cmp.c:165 +#, fuzzy +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "-I --verbose Näytä kaikkien eroavien tavujen sijainnit ja arvot" + +#: src/cmp.c:166 +#, fuzzy +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n RAJA --bytes=RAJA Vertaa korkeintaan RAJAn verran tavuja." + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent vaienna kaikki tavanomainen tuloste" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help näytä tämä ohje ja poistu" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v, --version näytä versiotiedot ja poistu" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Käyttö: %s [VALITSIN]... TIEDOSTO1 [TIEDOSTO2 [OHITA1 [OHITA2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Vertaa kahta tiedostoa tavu tavulta." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"OHITA1 ja OHITA2 ovat jokaisen tiedostn alusta ohitettavien tavujen\n" +"määrä (oletusarvo on nolla)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Pitkien valitsinten pakolliset argumentit ovat pakollisia myös lyhyille.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"OHITA-arvoihin voidaan liittää perään seuraavat kertoimet:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, sekä T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Jos TIEDOSTOa ei ole annettu, tai se on ”-”, luetaan vakiosyötettä." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"Paluuarvo on 0, jos syötteet ovat samoja, 1 jos erilaisia, " +"ongelmatilanteissa 2." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "virheellinen arvo ”%s” valitsimelle --bytes" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "puuttuva operandi argumentin ”%s” jälkeen" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "ylimääräinen operandi ”%s”" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s eroavat: tavu %s, rivi %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s eroavat: tavu %s, rivi %s on %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: Tiedoston %s loppu\n" + +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s %s eroavat: tavu %s, rivi %s\n" + +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s %s eroavat: tavu %s, rivi %s\n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: Tiedoston %s loppu\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "virheellinen kontekstin pituus ”%s”" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "tämä isäntä ei tue sivunumerointia" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "liian monta tiedostonimivalitsinta" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "virheellinen leveys \"%s\"" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "ristiriitaiset leveysvalinnat" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "virheellinen horisontin pituus \"%s\"" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "virheellinen sarkaimen koko \"%s\"" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "ristiriitaiset sarkaimen kokovalinnat" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "sekä valitsin --from-file että --to-file on määritetty" + +#: src/diff.c:891 +#, fuzzy +msgid " --normal output a normal diff (the default)" +msgstr "--normal Tulosta normaali diff." + +#: src/diff.c:892 +#, fuzzy +msgid "-q, --brief report only when files differ" +msgstr "-q --brief Kertoo vain, eroavatko tiedostot." + +#: src/diff.c:893 +#, fuzzy +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s --report-identical-files Ilmoita, jos kaksi tiedostoa ovat samat." + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" + +#: src/diff.c:895 +#, fuzzy +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-w MÄÄRÄ --width=MÄÄRÄ Tulosta enintään MÄÄRÄ (oletus 130) merkkiä riville." + +#: src/diff.c:896 +#, fuzzy +msgid "-e, --ed output an ed script" +msgstr "-e --ed Tulosta ed-skripti." + +#: src/diff.c:897 +#, fuzzy +msgid "-n, --rcs output an RCS format diff" +msgstr "-n --rcs Tulosta RCS-muotoinen diff." + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "" + +#: src/diff.c:899 +#, fuzzy +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w MÄÄRÄ --width=MÄÄRÄ Tulosta enintään MÄÄRÄ (oletus 130) merkkiä riville." + +#: src/diff.c:900 +#, fuzzy +msgid "" +" --left-column output only the left column of common lines" +msgstr "-l --left-column Tulosta vain yhteisten rivien vasen palsta" + +#: src/diff.c:901 +#, fuzzy +msgid " --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines Älä tulosta yhteisiä rivejä." + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" + +#: src/diff.c:905 +#, fuzzy +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +"--from-file=TIEDOSTO1 Vertaa TIEDOSTO1:ä kaikkiin operandeihin. TIEDOSTO1 " +"voi olla hakemisto." + +#: src/diff.c:908 +#, fuzzy +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t --expand-tabs Laajentaa sarkaimet välilyönneiksi tulosteessa." + +#: src/diff.c:909 +#, fuzzy +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T --initial-tab Lisää sarkain rivien alkuun." + +#: src/diff.c:910 +#, fuzzy +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "--tabsize=KOKO Sarkaimen koko on KOKO (oletus 8) merkkiä." + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" +"-l --paginate Ohjaa tuloste ohjelman \"pr\" läpi sivunumerointia varten." + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r, --recursive vertaa löytyneitä alihakemistoja " +"rekursiivisesti" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr "" + +#: src/diff.c:916 +#, fuzzy +msgid "-N, --new-file treat absent files as empty" +msgstr "-N --new-file Käsittele puuttuvia tiedostoja tyhjinä." + +#: src/diff.c:917 +#, fuzzy +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "--unidirectional-new-file Käsittele puuttuvia tiedostoja tyhjinä." + +#: src/diff.c:918 +#, fuzzy +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +"--ignore-file-name-case Älä huomioi kirjainkokoa tiedostojen nimiä " +"verrattaessa." + +#: src/diff.c:919 +#, fuzzy +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +"--no-ignore-file-name-case Kirjainkoko huomioidaan tiedostonimiä " +"verrattaessa." + +#: src/diff.c:920 +#, fuzzy +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "" +"-x HAHMO --exclude=HAHMO Jätä pois tiedostot, jotka vastaavat HAHMOa." + +#: src/diff.c:921 +#, fuzzy +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X TIEDOSTO --exclude-from=TIEDOSTO Jätä pois TIEDOSTOssa listatut " +"tiedostot." + +#: src/diff.c:922 +#, fuzzy +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S TIEDOSTO --starting-file=TIEDOSTO Aloita TIEDOSTOlla verrattaessa " +"hakemistoja." + +#: src/diff.c:923 +#, fuzzy +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +"--from-file=TIEDOSTO1 Vertaa TIEDOSTO1:ä kaikkiin operandeihin. TIEDOSTO1 " +"voi olla hakemisto." + +#: src/diff.c:925 +#, fuzzy +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +"--to-file=TIEDOSTO2 Vertaa kaikkia operandeja TIEDOSTO2:een. TIEDOSTO2 voi " +"olla hakemisto." + +#: src/diff.c:928 +#, fuzzy +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i --ignore-case Älä huomioi kirjainkokoa tiedostojen sisältöä " +"verrattaessa." + +#: src/diff.c:929 +#, fuzzy +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E --ignore-tab-expansion Älä huomioi sarkainten laajennuksesta johtuvia " +"eroja." + +#: src/diff.c:930 +#, fuzzy +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-w --ignore-all-white-space Älä huomioi tyhjiä merkkejä." + +#: src/diff.c:931 +#, fuzzy +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b --ignore-space-change Älä huomioi tyhjistä merkeistä johtuvia eroja." + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w --ignore-all-white-space älä huomioi tyhjiä merkkejä" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "-B --ignore-blank-lines älä huomioi tyhjistä riveistä johtuvia eroja" + +#: src/diff.c:934 +#, fuzzy +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I SI --ignore-matching-lines=SI Älä huomioi eroavia rivejä, jotka " +"vastaavat säännöllistä lauseketta." + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a --text käsittelee kaikki tiedostot tekstinä" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "--strip-trailing-cr poista vaununpalautus syötteen lopusta" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr " --binary lue ja kirjoita dataa binääritilassa" + +#: src/diff.c:942 +#, fuzzy +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D NIMI --ifdef=NIMI Tulosta yhdistetty tiedosto näyttämään \"#ifdef NIMI" +"\"-erot." + +#: src/diff.c:943 +#, fuzzy +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +"--GTYYPPI-group-format=GMUOTO Sama, muotoile GTYYPPIset syöteryhmät " +"GMUOTOon." + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr " --line-format=LMUOTO muotoile kaikki syöterivit LMUOTOon" + +#: src/diff.c:945 +#, fuzzy +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr " --line-format=LMUOTO muotoile kaikki syöterivit LMUOTOon" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYYPPI on \"old\", \"new\" tai \"unchanged\". GTYYPPI on LTYYPPI tai " +"\"changed\"." + +#: src/diff.c:949 +#, fuzzy +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GMUOTO voi sisältää:\n" +" %< rivejä TIEDOSTO1:stä\n" +" %> rivejä TIEDOSTO2:sta\n" +" %= TIEDOSTO1:n ja TIEDOSTO2:n yhteiset rivit\n" +" %[-][LEVEYS][.[TARKK]]{doxX}KIRJAIN printf-tyylimääritys KIRJAIMELLE\n" +" KIRJAIMET ovat seuraavat uudelle ryhmälle; pienet kirjaimet vanhalle " +"ryhmälle:\n" +" F ensimmäinen rivinumero\n" +" L viimeinen rivinumero\n" +" N rivien määrä = L-F+1\n" +" E F-1\n" +" M L+1" + +#: src/diff.c:961 +#, fuzzy +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LMUOTO voi sisältää:\n" +" %L rivin sisältö\n" +" %l rivin sisältö, mahdollinen edeltävä rivinvaihto poislukien\n" +" %[-][LEVEYS][.[TARKK]]{doxX}n syöterivin numero printf-tyylillä" + +#: src/diff.c:965 +#, fuzzy +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" Sekä GMUOTO että LMUOTO voivat sisältää:\n" +" %% %\n" +" %c'C' yksittäinen merkki C\n" +" %c'\\OOO' yksittäinen merkki oktaalikoodilla OOO" + +#: src/diff.c:971 +#, fuzzy +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d --minimal Yrittää löytää pienemmän määrän muutoksia." + +#: src/diff.c:972 +#, fuzzy +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +"--horizon-lines=MÄÄRÄ Säilytä MÄÄRÄ riviä yhteisestä etu- ja " +"jälkiliitteestä." + +#: src/diff.c:973 +#, fuzzy +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +"-H --speed-large-files Oleta suuret tiedostot, joissa pieniä muutoksia " +"ympäri tiedoston." + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" + +#: src/diff.c:979 +#, fuzzy +msgid " --help display this help and exit" +msgstr " --help näytä tämä ohje ja poistu" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version näytä versiotiedot ja poistu" + +#: src/diff.c:982 +#, fuzzy +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"TIEDOSTOT ovat \"TIEDOSTO1 TIEDOSTO2\" tai \"HAK1 HAK2\" tai \"HAK " +"TIEDOSTO...\" tai \"TIEDOSTO... HAK\"." + +#: src/diff.c:983 +#, fuzzy +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "Tiedoston lisääminen hakemiston %s ulkopuolelta epäonnistui" + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +#, fuzzy +msgid "If a FILE is '-', read standard input." +msgstr "" +"\n" +"Jos TIEDOSTOa ei ole annettu, tai se on ”-”, luetaan vakiosyötettä.\n" + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Käyttö: %s [VALITSIN]... TIEDOSTOT\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Vertaa TIEDOSTOja rivi riviltä." + +#: src/diff.c:1029 +#, fuzzy, c-format +msgid "conflicting %s option value '%s'" +msgstr "ristiriitaiset tyypit kohteelle %<%c%s%>:lle" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "ristiriitaiset tulostustyylin valinnat" + +#: src/diff.c:1058 +#, fuzzy, c-format +msgid "invalid color '%s'" +msgstr "virheellinen leveys \"%s\"" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Vain hakemistossa %s: %s\n" + +#: src/diff.c:1248 +#, fuzzy +msgid "cannot compare '-' to a directory" +msgstr "hakemiston %s luominen ei onnistu" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "valitsin -D ei toimi hakemistojen kanssa" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Yhteiset alihakemistot: %s ja %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Tiedosto %s on %s, kun taas tiedosto %s on %s\n" + +#: src/diff.c:1370 +#, fuzzy, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Tiedostot %s ja %s eroavat\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Tiedostot %s ja %s ovat identtiset\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "yhteensopimattomat valitsimet" + +#: src/diff3.c:391 +#, fuzzy +msgid "'-' specified for more than one input file" +msgstr "Voidaan antaa vain yksi syötetiedosto!\n" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "lukeminen epäonnistui" + +#: src/diff3.c:475 +#, fuzzy +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "-A --show-all Tulosta kaikki muutokset, ristiriidat merkiten." + +#: src/diff3.c:477 +#, fuzzy +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e --ed Tulosta VANHANTIEDOSTON yhdistämättömät muutokset TIEDOSTOOSI " +"verrattuna TIEDOSTOONI." + +#: src/diff3.c:479 +#, fuzzy +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +"-E --show-overlap Tulosta yhdistämättömät muutokset, ristiriidat merkiten." + +#: src/diff3.c:480 +#, fuzzy +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "-3 --easy-only Tulosta yhdistämättömät ei-päällekkäiset muutokset." + +#: src/diff3.c:481 +#, fuzzy +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "-x --overlap-only Tulosta päällekkäiset muutokset." + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" + +#: src/diff3.c:483 +#, fuzzy +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "-i Lisää komennot \"w\" ja \"q\" ed-skripteihin." + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text käsittele kaikki tiedostot tekstinä" + +#: src/diff3.c:489 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "--strip-trailing-cr poista vaununpalautus syötteen lopusta" + +#: src/diff3.c:490 +#, fuzzy +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T --initial-tab Lisää sarkain rivien alkuun." + +#: src/diff3.c:491 +#, fuzzy +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "--diff-program=OHJELMA Käytä OHJELMAa tiedostojen vertaamiseen." + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help näytä tämä ohje ja poistu" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version näytä versiotiedot ja poistu" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Käyttö: %s [VALITSIN]... TIEDOSTONI VANHATIEDOSTO TIEDOSTOSI\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Vertaa kolmea tiedostoa rivi riviltä." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"Paluuarvo on onnistuessa 0, ristiriitatilanteissa 1, ja ongelmatilanteissa 2." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "sisäinen virhe: virhe diff-lohkojen muodossa" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff epäonnistui: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "sisäinen virhe: virheellinen diff-tyyppi funktiossa process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "virheellinen diff-muoto; virheellinen muutoserotin" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "virheellinen diff-muoto; viimeinen rivi vajaa" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, fuzzy, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "apuohjelmaa \"%s\" ei voitu käynnistää" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "virheellinen diff-muoto; väärät rivin alkumerkit" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "sisäinen virhe: virheellinen diff-muoto välitetty tulosteeseen" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "syötetiedosto kutistui" + +#: src/dir.c:156 +#, fuzzy, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "tiedostonimiä %s ja %s ei voi vertailla" + +#: src/dir.c:225 +#, fuzzy, c-format +msgid "%s: recursive directory loop" +msgstr "%s: syöte sisältää silmukan:" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +#, fuzzy +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o TIEDOSTO --output=TIEDOSTO Vuorovaikutteinen toiminta, tuloste " +"TIEDOSTOon." + +#: src/sdiff.c:175 +#, fuzzy +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i --ignore-case Käsittele isot ja pienet kirjaimet samoina." + +#: src/sdiff.c:176 +#, fuzzy +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E --ignore-tab-expansion Älä huomioi sarkainten laajennuksesta johtuvia " +"eroja." + +#: src/sdiff.c:177 +#, fuzzy +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-w --ignore-all-white-space Älä huomioi tyhjiä merkkejä." + +#: src/sdiff.c:178 +#, fuzzy +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b --ignore-space-change Älä huomioi tyhjistä merkeistä johtuvia eroja." + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space älä huomioi tyhjiä merkkejä" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" +"-B, --ignore-blank-lines älä huomioi tyhjistä riveistä johtuvia eroja" + +#: src/sdiff.c:181 +#, fuzzy +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I SI --ignore-matching-lines=SI Älä huomioi eroavia rivejä, jotka " +"vastaavat säännöllistä lauseketta." + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr poista vaununpalautus syötteen lopusta" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a --text käsittele kaikki tiedostot tekstinä" + +#: src/sdiff.c:185 +#, fuzzy +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w MÄÄRÄ --width=MÄÄRÄ Tulosta enintään MÄÄRÄ (oletus 130) merkkiä riville." + +#: src/sdiff.c:186 +#, fuzzy +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "-l --left-column Tulosta vain yhteisten rivien vasen palsta" + +#: src/sdiff.c:187 +#, fuzzy +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines Älä tulosta yhteisiä rivejä." + +#: src/sdiff.c:189 +#, fuzzy +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t --expand-tabs Laajentaa sarkaimet välilyönneiksi tulosteessa." + +#: src/sdiff.c:190 +#, fuzzy +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "--tabsize=KOKO Sarkaimen koko on KOKO (oletus 8) merkkiä." + +#: src/sdiff.c:192 +#, fuzzy +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d --minimal Yrittää löytää pienemmän määrän muutoksia." + +#: src/sdiff.c:193 +#, fuzzy +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H --speed-large-files Oleta suuret tiedostot, joissa pieniä muutoksia " +"ympäri tiedoston." + +#: src/sdiff.c:194 +#, fuzzy +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "--diff-program=OHJELMA Käytä OHJELMAa tiedostojen vertaamiseen." + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help näytä tämä ohje ja poistu" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v --version näytä versiotiedot ja poistu" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Käyttö: %s [VALITSIN]...TIEDOSTO1 TIEDOSTO2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "" +"Tiedostojen TIED1 ja TIED2 erojen yhdistäminen vierekkäisillä palstoilla." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "vakiosyötettä ei voi yhdistää vuorovaikutteisesti" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "molemmat vertailtavat tiedostot ovat hakemistoja" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tMuokkaa ja käytä molempia versioita, kumpaankin otsake.\n" +"eb:\tMuokkaa ja käytä molempia versioita.\n" +"el tai e1:\tMuokkaa ja käytä vasenta versiota.\n" +"er tai e2:\tMuokkaa ja käytä oikeata versiota.\n" +"e:\tHylkää molemmat versiot ja muokkaa uusi.\n" +"l tai 1:\tKäytä vasenta versiota.\n" +"r tai 2:\tKäytä oikeata versiota.\n" +"s:\tSisällytä yhteiset rivit automaattisesti, ilmoittamatta.\n" +"v:\tSisällytä yhteiset rivit automaattisesti, ilmoittaen.\n" +"q:\tLopeta.\n" + +#: src/util.c:662 +#, fuzzy, c-format +msgid "unrecognized prefix: %s" +msgstr "%s: tunnistamaton valitsin ”--%s”\n" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "" + +#, fuzzy +#~ msgid " or 'auto' (the default)" +#~ msgstr "--normal Tulosta normaali diff." + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: valitsin ”--%s” ei salli argumenttia\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: tunnistamaton valitsin ”--%s”\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: valitsin ”-W %s” on moniselitteinen\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: valitsin ”-W %s” ei salli argumenttia\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: valitsin ”%s” vaatii argumentin\n" + +#~ msgid "%s: illegal option -- %c\n" +#~ msgstr "%s: virheellinen valitsin -- %c\n" + +#~ msgid "" +#~ "This is free software; see the source for copying conditions. There is " +#~ "NO\n" +#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR " +#~ "PURPOSE.\n" +#~ msgstr "" +#~ "Tämä on vapaa ohjelmisto; katsokaa kopiointiehdot lähdekoodista. Takuuta " +#~ "EI\n" +#~ "OLE; ei edes KAUPALLISESTI HYVÄKSYTTÄVÄSTÄ LAADUSTA tai SOPIVUUDESTA " +#~ "TIETTYYN\n" +#~ "TARKOITUKSEEN.\n" + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i OHITA1:OHITA2 --ignore-initial=OHITA1:OHITA2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "-s --quiet --silent Ei tulostusta; vain paluuarvo." + +#~ msgid "--help Output this help." +#~ msgstr "--help Näyttää tämän ohjeen." + +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>." +#~ msgstr "" +#~ "Ilmoita ohjelmistovioista (englanniksi) osoitteeseen <bug-gnu-utils@gnu." +#~ "org>." + +#~ msgid "`-%ld' option is obsolete; use `-%c %ld'" +#~ msgstr "valitsin \"-%ld\" on vanhentunut, käytä \"-%c %ld\"" + +#~ msgid "`-%ld' option is obsolete; omit it" +#~ msgstr "valitsin \"-%ld\" on vanhentunut; jätä se pois" + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ "-c -C MÄÄRÄ --context[=MÄÄRÄ] Tulosta MÄÄRÄ (oletus 3) riviä kopioitua " +#~ "kontekstia.\n" +#~ "-u -U MÄÄRÄ --unified[=MÄÄRÄ] Tulosta MÄÄRÄ (oletus 3) riviä " +#~ "yhdistettyä kontekstia.\n" +#~ " --label NIMIÖ Käytä NIMIÖtä tiedostonimen sijaan.\n" +#~ " -p --show-c-function Näytä, minkä C-funktion sisällä kukin muutos " +#~ "on.\n" +#~ " -F SI --show-function-line=SI Näytä viimeisin säännöllistä lauseketta " +#~ "vastaava rivi." + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ "-y --side-by-side Tulosta kahdelle palstalle.\n" +#~ " -W MÄÄRÄ --width=MÄÄRÄ Tulosta korkeintaan MÄÄRÄ (oletus 130) merkkiä " +#~ "riville.\n" +#~ " --left-column Tulosta vain yhteisten rivien vasen palsta.\n" +#~ " --suppress-common-lines Älä tulosta yhteisiä rivejä." + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "" +#~ "--speed-large-files Olettaa tiedostojen olevan suuria ja muutosten " +#~ "pieniä sekä hajanaisia." + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "-X Tulosta päällekkäiset muutokset sulkeiden sisään." + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "" +#~ "-m --merge Tulosta yhdistetty tiedosto ed-skriptin sijaan (oletus -A)." + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "-L NIMIÖ --label=NIMIÖ Käytä NIMIÖtä tiedostonimen sijaan." + +#~ msgid "subsidiary program `%s' not found" +#~ msgstr "apuohjelmaa \"%s\" ei löytynyt" + +#~ msgid "subsidiary program `%s' failed" +#~ msgstr "apuohjelman \"%s\" suoritus epäonnistui" + +#~ msgid "subsidiary program `%s' failed (exit status %d)" +#~ msgstr "apuohjelman \"%s\" suoritus epäonnistui (paluuarvo %d)" + +#~ msgid "" +#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n" +#~ "You may redistribute copies of this program\n" +#~ "under the terms of the GNU General Public License.\n" +#~ "For more information about these matters, see the files named COPYING." +#~ msgstr "" +#~ "Tällä ohjelmalla EI - lain sallimissa rajoissa - OLE TAKUUTA.\n" +#~ "Tämän ohjelman kopioita saa levittää GNU:n General Public Licensen \n" +#~ "mukaisesti. Lisää tietoa näistä asioista on tiedostossa COPYING." + +#~ msgid "Written by Torbjorn Granlund and David MacKenzie." +#~ msgstr "Kirjoittaneet Torbjörn Granlund ja David MacKenzie." + +#~ msgid "" +#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman, and Len Tower." +#~ msgstr "" +#~ "Kirjoittaneet Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman ja Len Tower." + +#~ msgid "subsidiary program `%s' not executable" +#~ msgstr "apuohjelma \"%s\" ei ole käynnistettävä" diff --git a/local/recipes/tools/diffutils/source/po/fr.gmo b/local/recipes/tools/diffutils/source/po/fr.gmo new file mode 100644 index 0000000000..07f264b840 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/fr.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/fr.po b/local/recipes/tools/diffutils/source/po/fr.po new file mode 100644 index 0000000000..a9b31928f2 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/fr.po @@ -0,0 +1,1783 @@ +# Messages français pour GNU concernant diffutils. +# Copyright (C) 2017 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# +# Michel Robitaille <robitail@IRO.UMontreal.CA>, 1996. +# Frédéric Marchal <fmarchal@perso.be>, 2017. +msgid "" +msgstr "" +"Project-Id-Version: GNU diffutils 3.5.25\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2017-05-11 17:26+0200\n" +"Last-Translator: Frédéric Marchal <fmarchal@perso.be>\n" +"Language-Team: French <traduc@traduc.org>\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "argument %s pas valable pour %s" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "argument %s ambigu pour %s" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "Les arguments valables sont:" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "erreur du programme" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "débordement de pile" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Erreur système inconnue" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "fichier régulier vide" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "fichier régulier" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "répertoire" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "lien symbolique" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "queue de messages" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "sémaphore" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "objet en mémoire partagée" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "objet mémoire typé" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "fichier spécial-blocs" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "fichier spécial-caractères" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "données contigües" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "« fifo »" + +#: lib/file-type.c:78 +msgid "door" +msgstr "porte" + +#: lib/file-type.c:81 +msgid "multiplexed block special file" +msgstr "fichier spécial avec des blocs multiplexés" + +#: lib/file-type.c:84 +msgid "multiplexed character special file" +msgstr "fichier spécial avec des caractères multiplexés" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "fichier multiplexé" + +#: lib/file-type.c:90 +msgid "named file" +msgstr "fichier nommé" + +#: lib/file-type.c:93 +msgid "network special file" +msgstr "fichier spécial réseau" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "fichier migré avec les données" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "fichier migré sans les données" + +#: lib/file-type.c:102 +msgid "port" +msgstr "port" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "« socket »" + +# fichier sur un système de fichier en lecture seule qui est voilé pour faire croire qu'il a été effacé +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "voilé (whiteout)" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "fichier bizarre" + +#: lib/getopt.c:278 +#, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: l'option « %s%s » est ambiguë\n" + +#: lib/getopt.c:284 +#, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: l'option « %s%s » est ambiguë ; les possibilités sont :" + +#: lib/getopt.c:319 +#, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: l'option « %s%s » n'est pas reconnue\n" + +#: lib/getopt.c:345 +#, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: l'option « %s%s » n'accepte aucun argument\n" + +#: lib/getopt.c:360 +#, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: l'option « %s%s » requiert un argument\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: l'option -- « %c » est invalide\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: l'option -- « %c » requiert un argument\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "« " + +#: lib/quotearg.c:363 +msgid "'" +msgstr " »" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Succès" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Pas de concordance" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "L'expression régulière est invalide" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Le caractère de regroupement est invalide" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Le nom d'un ensemble de caractères est invalide" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Barre oblique inverse à la fin" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "La référence arrière est invalide" + +#: lib/regcomp.c:156 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "[, [^, [:, [. ou [= sans vis-à-vis" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr " ( ou \\( sans vis-à-vis" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "\\{ sans vis-à-vis" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Le contenu de \\{\\} est invalide" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "La fin d'intervalle est invalide" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Mémoire épuisée" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "L'expression régulière précédente est invalide" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Fin prématurée de l'expression régulière" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Expression régulière trop grande" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr ") or \\) sans vis-à-vis" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "N'est pas précédé d'une expression régulière" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "mémoire épuisée" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "stdin" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "stdout" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "stderr" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "flux inconnu" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "impossible de ré-ouvrir %s avec le mode %s" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "argument pour %s%s pas valable: « %s »" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "suffixe par valable dans l'argument de %s%s: « %s »" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "%s%s: argument « %s » trop grand" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Empaqueté par %s(%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Empaqueté par %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "(C)" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Licence GPLv3+: GNU GPL version 3 ou ultérieure <http://gnu.org/licenses/gpl." +"html>.\n" +"Ceci est un logiciel libre: vous êtes libre de le changer et de le " +"redistribuer.\n" +"Il n'y a PAS de GARANTIE, dans les limites permises par la loi.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Écrit par %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Écrit par %s et %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Écrit par %s, %s et %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Écrit par %s, %s, %s\n" +"et %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Écrit par %s, %s, %s\n" +"%s et %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Écrit par %s, %s, %s\n" +"%s, %s et %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Écrit par %s, %s, %s\n" +"%s, %s, %s et %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Écrit par %s, %s, %s\n" +"%s, %s, %s, %s\n" +"et %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Écrit par %s, %s, %s\n" +"%s, %s, %s, %s\n" +"%s et %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Écrit par %s, %s, %s\n" +"%s, %s, %s, %s\n" +"%s, %s et autres.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Signalez les bogues à: %s\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "" +"Signalez les bogues de %s à: %s\n" +"Signalez les bogues de traduction à traduc@traduc.org\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "site internet de %s: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "site internet de %s: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"Aide générale sur l'utilisation des logiciels GNU: <http://www.gnu.org/" +"gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Les fichiers %s et %s sont différents\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Les fichiers binaires %s et %s sont différents\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Pas de fin de ligne à la fin du fichier" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Utilisez « %s --help » pour en savoir d'avantage." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "valeur invalide pour --ignore-initial: « %s »" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "options -l et -s sont incompatibles" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "échec d'écriture" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "sortie standard" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b, --print-bytes Afficher les octets qui diffèrent" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i, --ignore-initial=N Escamoter les N premiers octets des entrées" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=N1:N2 Escamoter les N1 premiers octets de FICHIER1 et " +"les N2 premiers octets de FICHIER2." + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l, --verbose Afficher les numéros d'octets et les valeurs de " +"tous les octets qui diffèrent." + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=LIMITE Comparer au plus LIMITE octets" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent Supprimer la sortie normale" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help Afficher cette aide et terminer" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "" +"-v, --version Afficher le nom et la version du logiciel puis " +"terminer" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Usage: %s [OPTION]... FICHIER1 [FICHIER2 [SAUT1 [SAUT2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Comparer deux fichiers octet par octet." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"Les paramètres optionnels SAUT1 et SAUT2 indiquent le nombre d'octets à " +"escamoter\n" +"au début de chaque fichier (zéro par défaut)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Les paramètres requis pour les options longues sont également requis pour " +"les options courtes.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"valeurs de SAUT peuvent être suivies par un des suffixes multiplicateurs " +"suivants:\n" +"kB 1000, K 1024, MB 1.000.000, M 1.048.576,\n" +"GB 1.000.000.000, G 1.073.741.824, et ainsi de suite pour T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Si un FICHIER est « - » ou manquant, lire sur l'entrée standard." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"Le statut de fin d'exécution est 0 si les entrées sont les mêmes, 1 si " +"différentes et 2 si problématiques." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "valeur invalide pour --bytes: « %s »" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "opérande manquante après « %s »" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "opérande supplémentaire « %s »" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s sont différents: octet %s, ligne %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s diffèrent: octet %s, ligne %s est %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: Fin-de-fichier (EOF) sur %s qui est vide\n" + +#: src/cmp.c:585 +#, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "cmp: Fin-de-fichier (EOF) sur %s après l'octet %s, ligne %s\n" + +#: src/cmp.c:586 +#, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "cmp: Fin-de-fichier (EOF) sur %s après l'octet %s, ligne %s\n" + +#: src/cmp.c:592 +#, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: Fin-de-fichier (EOF) sur %s après l'octet %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "longueur du contexte invalide « %s »" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "La pagination n'est pas supporté sur cette machine" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "Trop de noms de fichiers dans les options" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "largeur invalide « %s »" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "options de largeur conflictuelles" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "longueur d'horizon invalide « %s »" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "taille de tabulation invalide « %s »" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "options conflictuelles de taille de tabulation" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "--from-file et --to-file ont été spécifiés ensemble" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr "" +" --normal Produire un « diff » en format normal (par " +"défaut)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "" +"-q, --brief Indiquer seulement si les fichiers diffèrent" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "" +"-s, --report-identical-files Indiquer si les deux fichiers sont identiques" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C N, --context[=N] Afficher N (3 par défaut) lignes du " +"contexte copié" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U N, --unified[=N] Afficher N (3 par défaut) lignes dans " +"le context unifié" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed Générer un script pour « ed »" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "" +"-n, --rcs Générer un fichier « diff » au format RCS" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side Affichage sur deux colonnes" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=N Limiter la sortie à au plus N colonnes " +"imprimées (130 par défaut)" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +" --left-column Afficher les lignes identiques uniquement dans " +"la colonne de gauche" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines Ne pas afficher les lignes identiques" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" +"-p, --show-c-function Afficher dans quelle fonction C le changement " +"se trouve" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" +"-F, --show-function-line=RE Montrer la ligne la plus récente correspondant " +"à RE" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label ÉTIQUETTE utiliser ÉTIQUETTE au lieu du nom de fichier " +"et de l'horodatage\n" +" (peut être répété)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs Étaler les tabulateurs en espaces dans la " +"sortie" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab Aligner les tabulateurs en préfixant un " +"tabulateur" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=N Les balises de tabulation sont à chaque N (8 " +"par défaut) colonnes" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty Supprimer les espaces et les tabulations avant " +"les lignes vides" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" +"-l, --paginate Relayer la sortie à « pr » afin de la paginer" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r, --recursive Comparer récursivement les sous-répertoires " +"trouvés" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference Ne pas suivre les liens symboliques" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "" +"-N, --new-file Traiter les fichiers absents comme des " +"fichiers vides" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +" --unidirectional-new-file Traiter les premiers fichiers absents comme " +"vides" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case Ignorer la casse lors de la comparaison des " +"noms de fichiers" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case Tenir compte de la casse lors de la " +"comparaison des noms de fichiers" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "" +"-x, --exclude=PAT Exclure les fichiers dont les noms concordent " +"avec le PATron" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=FICHIER Exclure les fichiers dont les noms\n" +" concordent avec ceux contenus dans le FICHIER" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=FICHIER Débuter la comparaison des répertoires par le " +"FICHIER" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=FICHIER1 Comparer le FICHIER1 à toutes les opérandes.\n" +" FICHIER1 peut être un répertoire" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=FICHIER2 Comparer toutes les opérandes à FICHIER2.\n" +" FICHIER2 peut être un répertoire" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i, --ignore-case Ignorer les différences de casses dans le " +"contenu des fichiers" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion Ignorer les changements liés à l'expansion des " +"tabulations" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" +"-Z, --ignore-trailing-space Ignorer les blancs d'espacement à la fin " +"de la ligne" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change Ignorer les changements dans le nombre " +"d'espaces" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space Ignorer tout blanc d'espacement" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B, --ignore-blank-lines Ignorer les changements dont toutes les lignes " +"sont blanches" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE Ignorer les différences dont toutes les\n" +" lignes concordent avec l'expression régulière RE" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "" +"-a, --text Traiter tous les fichiers comme des textes" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr Éliminer les retours de chariot de l'entrée" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr " --binary Lire et écrire les données en binaire" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=NOM Afficher les fichiers fusionnés en marquant les " +"différences par des « #ifdef NOM »" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +" --GTYPE-group-format=GFMT Formater les groupes d'entrée GTYPE avec GFMT" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "" +" --line-format=LFMT Formater toutes les lignes d'entrée avec LFMT" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +" --LTYPE-line-format=LFMT Formater les lignes d'entrée LTYPE avec LFMT" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" Ces options de formatage fournissent un contrôle fin sur la sortie\n" +" de diff et généralise -D/--ifdef." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE peut être soit « old », « new », ou « unchanged ». GTYPE prend une " +"des valeurs de LTYPE ou « changed »." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT (uniquement) peut contenir :\n" +" %< pour marquer les lignes du FICHIER1\n" +" %> pour marquer les lignes du FICHIER2\n" +" %= pour marquer les lignes identiques entre FICHIER1 et FICHIER2\n" +" %[-][LARGEUR][.[PREC]]{doxX}LETTRE la spécification de LETTRE\n" +" est identique à la notation de printf()\n" +" dont les codes possibles de LETTRE sont\n" +" en majuscule pour le nouveau groupe, \n" +" en minuscules pour l'ancien groupe:\n" +" F numéro de la première ligne\n" +" L numéro de la dernière ligne\n" +" N nombre de lignes = L-F+1\n" +" E F-1\n" +" M L+1 %(A=B?T:E) si A égal B alors T sinon E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT (uniquement) peut contenir :\n" +" %L pour le contenu de la ligne\n" +" %l pour le contenu de la ligne sans fin de ligne\n" +" %[-][LARGEUR][.[PREC]]{doxX}n la spécification du numéro de ligne\n" +" d'entrée selon le format de printf" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" GFMT et LFMT peuvent contenir :\n" +" %% %\n" +" %c«C» le caractère «C» lui-même\n" +" %c'\\OOO» le caractère dont le code octal est OOO C le " +"caractère C (les autres caractères se représentent eux-mêmes)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d, --minimal rechercher assidûment le plus petit ensemble de " +"différences" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +" --horizon-lines=N retenir N lignes ayant des préfixes et suffixes " +"identiques" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files suppose de grands fichiers et de nombreux petits " +"changements éparpillés" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" +" --color[=QUAND] coloriser la sortie; QUAND peut être " +"« never » (jamais),\n" +" « always » (toujours) ou « auto » (par défaut)" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" +" --palette=PALETTE les couleurs à utiliser quand --color est actif; " +"PALETTE\n" +" est une liste de capacités terminfo séparées par " +"des virgules" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help afficher cette aide et terminer" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "" +"-v, --version afficher le nom et la version du logiciel et " +"terminer" + +#: src/diff.c:982 +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"FICHIERS sont « FICHIER1 FICHIER2 » ou « RÉP1 RÉP2 » ou « RÉP FICHIER » ou " +"« FICHIER RÉP »." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Si --from-file ou --to-file sont fournis, il n'y a pas de restriction sur " +"les FICHIERS." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Si un FICHIER est « - » alors lire depuis l'entrée standard." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Usage: %s [OPTION]... FICHIERS\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Comparer les fichiers ligne par ligne." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "valeur conflictuelle de l'option %s: « %s »" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "options de style de sortie conflictuelles" + +#: src/diff.c:1058 +#, c-format +msgid "invalid color '%s'" +msgstr "couleur « %s » invalide" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Seulement dans %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "ne peut comparer « - » avec un répertoire" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "L'option -D ne traite pas les répertoires" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Les sous-répertoires %s et %s sont identiques\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Le fichier %s est un %s alors que le fichier %s est un %s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Les liens symboliques %s et %s sont différents\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Les fichiers %s et %s sont identiques\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "options incompatibles" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "« - » fourni pour plus d'un fichier d'entrée" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "lecture non-réussie" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A, --show-all Afficher toutes les différences avec les " +"conflits entre crochets" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed Écrire un script ed incorporant les " +"changements\n" +" du fichier ORIGINAL vers le fichier MODIFIÉ\n" +" vers le fichier de SORTIE" + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +"-E, --show-overlap Comme -e mais les conflits sont entre crochets" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3, --easy-only Comme -e mais n'inclut que les changements qui " +"ne se recoupent pas" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +"-x, --overlap-only Comme -e mais inclut les changements qui se recoupent" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" +"-X Comme -x mais le conflits sont entre crochets" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "" +"-i Ajouter les commandes « w » et « q » au script " +"« ed »" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge Écrire le fichier fusionné selon -A si aucune " +"autre\n" +" option n'est spécifiée" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "" +"-a, --text Traiter tous les fichiers comme des textes" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr Éliminer les retours de chariot de l'entrée" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab Aligner les tabulateurs en préfixant un " +"tabulateur" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=PROG Utiliser le PROGramme pour comparer les " +"fichiers" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=ÉTIQUETTE Utiliser l'ÉTIQUETTE au lieu du nom de " +"fichier\n" +" (peut être répété jusqu'à trois fois)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help Afficher cette aide et terminer" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "" +"-v, --version Afficher le nom et la version du logiciel et " +"terminer" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Comparer trois fichiers ligne par ligne." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"Le format de sortie par défaut est une représentation plus ou moins lisible\n" +"par un humain des changements.\n" +"\n" +"Les options -e, -E, -x, -X (et les options longues correspondantes) " +"provoquent\n" +"l'écriture d'un script ed au lieu de la sortie par défaut.\n" +"\n" +"Finalement, l'option -m (--merge) demande à diff3 de fusionner en interne\n" +"et de sortir le fichier fusionné. Pour des entrées inhabituelles, c'est " +"plus\n" +"robuste que d'utiliser ed.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"Le statut de fin d'exécution est 0 si réussite, 1 si en conflit et 2 si " +"problématique." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "erreur interne: mélange dans le format des blocs « diff »" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: échec de « diff » : " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "erreur interne: type de « diff » invalide dans process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "format de « diff » invalide ; séparateur de changement invalide" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "format de « diff » invalide ; dernière ligne incomplète" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "programme subsidiaire « %s » n'a pu être invoqué" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "" +"format de « diff » invalide ; caractères incorrects au début de la ligne" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "erreur interne : type de « diff » invalide fourni en sortie" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "le fichier d'entrée a rétréci" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "ne peut comparer les noms de fichier « %s » et « %s »" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: boucle récursive dans le répertoire" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o, --output=FICHIER Agir interactivement, avec sortie sur FICHIER" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i, --ignore-case Banaliser majuscules et minuscules" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion Ignorer les changements liés à l'expansion des " +"tabulations" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" +"-Z, --ignore-trailing-space Ignorer les blancs d'espacement à la fin " +"de la ligne" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change Ignorer les changements dans l'espacement" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space Ignorer tout blanc d'espacement" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" +"-B, --ignore-blank-lines Ignorer les changements dont toutes les lignes " +"sont blanches" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE Ignorer les différences dont toutes les\n" +" lignes concordent avec l'expression régulière RE" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr Éliminer les retours de chariot de l'entrée" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "" +"-a, --text Traiter tous les fichiers comme des textes" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=N Limiter la sortie à au plus N colonnes " +"imprimées (130 par défaut)" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" +"-l, --left-column Afficher uniquement la colonne de gauche des " +"lignes identiques" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines Ne pas afficher les lignes identiques" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs Étaler les tabulateurs en espaces dans la sortie" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +" --tabsize=N Les balises de tabulation sont à chaque N (8 " +"par défaut) colonnes" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d, --minimal Rechercher assidûment le plus petit ensemble de " +"différences" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files Suppose de grands fichiers et de nombreux " +"petits changements éparpillés" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=PROG Utiliser le PROGramme pour comparer les fichiers" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help Afficher cette aide et terminer" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "" +"-v, --version Afficher le nom et la version du logiciel et " +"terminer" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Usage: %s [OPTION]... FICHIER1 FICHIER2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Fusion côte à côte des différences des fichiers." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "ne peut fusionner l'entrée standard interactivement" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "les deux fichiers à comparer sont des répertoires" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tÉditer puis utiliser les deux versions, chacune chapeautée d'une en-" +"tête.\n" +"eb:\tÉditer puis utiliser les deux versions.\n" +"el ou e1:\tÉditer puis utiliser la version de gauche.\n" +"er ou e2:\tÉditer puis utiliser la version de droite.\n" +"e:\tAbandonne les deux version puis éditer une nouvelle version.\n" +"l ou 1:\tUtiliser la version de gauche.\n" +"r ou 2:\tUtiliser la version de droite.\n" +"s:\tInclure les lignes identiques silencieusement.\n" +"v:\tInclure les lignes identiques et le signaler.\n" +"q:\tQuitter.\n" + +#: src/util.c:662 +#, c-format +msgid "unrecognized prefix: %s" +msgstr "préfixe non reconnu: %s" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "valeur impossible à analyser pour --palette" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: l'option « --%s » n'accepte aucun argument\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: l'option « --%s » n'est pas reconnue\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: l'option « -W %s » est ambiguë\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: l'option « -W %s » n'accepte aucun argument.\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: l'option « -W %s » requiert un argument\n" + +#~ msgid " or 'auto' (the default)" +#~ msgstr " ou « auto » (par défaut)" + +#~ msgid "" +#~ " --palette=PALETTE specify the colors to use when --color is active" +#~ msgstr "" +#~ " --palette=PALETTE spécifier les couleurs à utiliser quand --color " +#~ "est actif" + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i SAUT1:SAUT2 --ignore-initial=SAUT1:SAUT2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "" +#~ "-s --quiet --silent Ne rien afficher, produire seulement un constat de " +#~ "fin d'exécution" + +#~ msgid "--help Output this help." +#~ msgstr "--help Afficher l'aide-mémoire." + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ "-c -C N --context[=N] Afficher N lignes de contexte (3 par " +#~ "défaut)\n" +#~ "-u -U N --unified[=N] Afficher N lignes du contexte unifié (3 par " +#~ "défaut)\n" +#~ " --label ÉTIQ Utiliser l'ÉTIQuette comme nom de fichier.\n" +#~ " -p --show-c-function Identifier la fonction C contenant chaque " +#~ "différence.\n" +#~ " -F EXPREG\n" +#~ " --show-function-line=EXPREG\n" +#~ " Afficher la ligne la plus récente qui " +#~ "concorde\n" +#~ " avec l'EXPression RÉGulière." + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ "-y --side-by-side Afficher la sortie sur deux colonnes.\n" +#~ " -w N --width=N Limiter la sortie à N caractères par ligne " +#~ "(130 par défaut).\n" +#~ " --left-column Afficher seulement la colonne de gauche pour " +#~ "les lignes identiques.\n" +#~ " --suppress-common-lines Ne pas afficher les lignes identiques." + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "" +#~ "--speed-large-files Suppose de grands fichiers et de nombreux petits " +#~ "changements dispersés." + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "-X Afficher les différences qui se recoupent entre crochets." + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "" +#~ "-m --merge Afficher le fichier fusionné plutôt qu'un script " +#~ "«ed» (implique -A)." + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "" +#~ "-L ÉTIQ --label=ÉTIQ Utiliser l'ÉTIQuette plutôt que le nom du fichier." + +#~ msgid "%s: illegal option -- %c\n" +#~ msgstr "%s: l'option -- %c est illégale.\n" + +#~ msgid "" +#~ "This is free software; see the source for copying conditions. There is " +#~ "NO\n" +#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR " +#~ "PURPOSE.\n" +#~ msgstr "" +#~ "Ce logiciel est libre; vous pouvez le redistribuer selon les termes de " +#~ "la\n" +#~ "licence GNU General Public License. AUCUNE garantie n'est donnée.\n" + +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>." +#~ msgstr "Rapporter toutes anomalies à <bug-gnu-utils@gnu.org>" + +#~ msgid "`-%ld' option is obsolete; use `-%c %ld'" +#~ msgstr "l'option « -%ld » est obsolète; utilise « -%c %ld »" + +#~ msgid "`-%ld' option is obsolete; omit it" +#~ msgstr "l'option « -%ld » est obsolète; l'omettre" + +#~ msgid "subsidiary program `%s' not found" +#~ msgstr "programme de service « %s » non repéré" + +#~ msgid "subsidiary program `%s' failed" +#~ msgstr "échec du programme de service « %s »" + +#~ msgid "subsidiary program `%s' failed (exit status %d)" +#~ msgstr "échec du programme subsidiaire « %s » (statut d'exécution %d)" + +#~ msgid "" +#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n" +#~ "You may redistribute copies of this program\n" +#~ "under the terms of the GNU General Public License.\n" +#~ "For more information about these matters, see the files named COPYING." +#~ msgstr "" +#~ "Ce programme est fourni sans AUCUNE GARANTIE, tel que permis par la loi.\n" +#~ "Vous pouvez le redistribuer selon les termes de « GNU General Public " +#~ "License »,\n" +#~ "lire le texte du fichier COPYING pour plus de détails.\n" +#~ "Pour plus d'informations, voir le fichier portant le nom COPYING." + +#~ msgid "Written by Torbjorn Granlund and David MacKenzie." +#~ msgstr "Écrit par Torbjorn Granlund et David MacKenzie." + +#~ msgid "" +#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman, and Len Tower." +#~ msgstr "" +#~ "Écrit par Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman et Len Tower." + +#~ msgid "subsidiary program `%s' not executable" +#~ msgstr "programme de service « %s » n'est pas exécutable" + +# src/diff.c:882 MRO +#~ msgid "--inhibit-hunk-merge Do not merge hunks." +#~ msgstr "--inhibit-hunk-merge ne pas faire la fusion des hunks" + +#~ msgid "context length specified twice" +#~ msgstr "La longueur du contexte a été spécifié deux fois." + +#~ msgid "multiple `--from-file' options" +#~ msgstr "options multiples de `--from-file'" + +#~ msgid "multiple `--to-file' options" +#~ msgstr "options multiples de `--to-file'" + +#~ msgid "regular empty executable file" +#~ msgstr "fichier régulier exécutable vide" + +#~ msgid "regular executable file" +#~ msgstr "fichier régulier exécutable" + +#~ msgid "" +#~ "SKIP values may be followed by the following multiplicative suffixes:\n" +#~ msgstr "" +#~ "Les valeurs de SAUT peuvent être suivies par un des facteurs " +#~ "multiplicatifs suivants:\n" + +#~ msgid "kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +#~ msgstr "kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" + +#~ msgid "GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y.\n" +#~ msgstr "" +#~ "GB 1,000,000,000, G 1,073,741,824, et ainsi de suite pour T, P, E, Z, Y.\n" + +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>.\n" +#~ msgstr "Rapporter toutes anomalies à <bug-gnu-utils@gnu.org>\n" + +#~ msgid "If a FILE is `-', read standard input.\n" +#~ msgstr "Si FICHIER spécifié est `-', alors lire de l'entrée standard.\n" + +#~ msgid ": not found\n" +#~ msgstr ": introuvable\n" + +#~ msgid "-D%s: conflicting #ifdef format" +#~ msgstr "-D%s: format #ifdef conflictuels" + +#~ msgid "%s: conflicting line format" +#~ msgstr "%s: format de ligne conflictuel" + +#~ msgid "conflicting group format" +#~ msgstr "formats de groupes conflictuels" + +#~ msgid "--ignore-initial value must be a nonnegative integer" +#~ msgstr "La valeur de --ignore-initial doit être un entier non-négatif" + +#~ msgid "column width must be a positive integer" +#~ msgstr "Le nombre de colonnes doit être un entier positif." + +#~ msgid "context length must be a nonnegative integer" +#~ msgstr "La longueur du contexte doit être un entier non négatif." + +#~ msgid "horizon must be a nonnegative integer" +#~ msgstr "L'horizon doit être un entier non négatif." diff --git a/local/recipes/tools/diffutils/source/po/ga.gmo b/local/recipes/tools/diffutils/source/po/ga.gmo new file mode 100644 index 0000000000..21dfcb8ab4 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/ga.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/ga.po b/local/recipes/tools/diffutils/source/po/ga.po new file mode 100644 index 0000000000..f69ed62316 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/ga.po @@ -0,0 +1,1645 @@ +# Irish translations for diffutils. +# Copyright (C) 2004 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Kevin Patrick Scannell <scannell@SLU.EDU>, 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: diffutils 2.8.7\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2004-12-03 13:47-0500\n" +"Last-Translator: Kevin Patrick Scannell <scannell@SLU.EDU>\n" +"Language-Team: Irish <ga@li.org>\n" +"Language: ga\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "earrid chlir" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "cruach thar maoil" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Earrid chrais anaithnid" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "gnthchomhad folamh" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "gnthchomhad" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "comhadlann" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "nasc siombalach" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "ci teachtaireachta" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "samafr" + +# FARF --KPS +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "comhad comhchuimhne" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "comhad cuimhne le cinel" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "comhad speisialta den chinel `bloc'" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "comhad speisialta den chinel `carachtar'" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "" + +# `TITA' ?! -KPS +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "" + +#: lib/file-type.c:81 +#, fuzzy +msgid "multiplexed block special file" +msgstr "comhad speisialta den chinel `bloc'" + +#: lib/file-type.c:84 +#, fuzzy +msgid "multiplexed character special file" +msgstr "comhad speisialta den chinel `carachtar'" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "" + +#: lib/file-type.c:90 +#, fuzzy +msgid "named file" +msgstr "comhad aisteach" + +#: lib/file-type.c:93 +#, fuzzy +msgid "network special file" +msgstr "comhad speisialta den chinel `bloc'" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "" + +#: lib/file-type.c:102 +msgid "port" +msgstr "" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "soicad" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "comhad aisteach" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: T an rogha `%s' dbhroch\n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: T an rogha `%s' dbhroch\n" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: rogha anaithnid `%c%s'\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: n cheadatear argint i ndiaidh na rogha `%c%s'\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: n folir argint don rogha `%s'\n" + +#: lib/getopt.c:621 +#, fuzzy, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: rogha neamhbhail -- %c\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, fuzzy, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: n folir argint don rogha -- %c\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Bua!" + +# #-#-#-#-# findutils-4.2.6.ga.po (findutils 4.2.6) #-#-#-#-# +# ugh. Not clear what kind of things we're matching -- KPS +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Nl a leithid ann" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Slonn ionadaochta neamhbhail" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Carachtar cimheasa neamhbhail" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Aicme charachtair neamhbhail" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Clslais ag deireadh" + +# #-#-#-#-# sed-4.1.1.ga.po (sed 4.1.1) #-#-#-#-# +# coinage - KPS +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Cltagairt neamhbhail" + +#: lib/regcomp.c:156 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "[ n [^ corr" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "( n \\( corr" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "\\{ corr" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "bhar neamhbhail idir \\{\\}" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Deireadh raoin neamhbhail" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Cuimhne dithe" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Is neamhbhail an slonn ionadaochta roimhe seo" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Deireadh le slonn ionadaochta gan choinne" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Slonn ionadaochta rmhr" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr ") n \\) corr" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Nl aon slonn ionadaochta roimhe seo" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "cuimhne dithe" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "" + +#: lib/xfreopen.c:38 +#, fuzzy +msgid "unknown stream" +msgstr "Earrid chrais anaithnid" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "" + +#: lib/xstrtol-error.c:63 +#, fuzzy, c-format +msgid "invalid %s%s argument '%s'" +msgstr "luach neamhbhail --bytes `%s'" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Le %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Le %s agus %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Le %s, %s, agus %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Le %s, %s, %s,\n" +"agus %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Le %s, %s, %s,\n" +"%s, agus %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Le %s, %s, %s,\n" +"%s, %s, agus %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Le %s, %s, %s,\n" +"%s, %s, %s, agus %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Le %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"agus %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Le %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, agus %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Le %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, agus daoine eile nach iad.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "T difrocht idir na comhaid %s agus %s\n" + +#: src/analyze.c:455 +#, fuzzy, c-format +msgid "Binary files %s and %s differ\n" +msgstr "T difrocht idir na comhaid %s agus %s\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Gan lne nua ag an chomhadchroch" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, fuzzy, c-format +msgid "Try '%s --help' for more information." +msgstr "Bain triail as `%s --help' chun tuilleadh eolais a fhil." + +#: src/cmp.c:137 +#, fuzzy, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "luach neamhbhail --ignore-initial `%s'" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "Nl na roghanna -l agus -s comhoirinach" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "teipeadh ag scrobh" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "aschur caighdenach" + +#: src/cmp.c:161 +#, fuzzy +msgid "-b, --print-bytes print differing bytes" +msgstr "-b --print-bytes Taispein na bearta at difrila." + +#: src/cmp.c:162 +#, fuzzy +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i UIMHIR --ignore-initial=UIMHIR Gabh thar an chad UIMHIR beart " +"ionchurtha." + +#: src/cmp.c:163 +#, fuzzy +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr " Gabh thar an chad SCIP1 beart as COMHAD1 agus SCIP2 as COMHAD2." + +#: src/cmp.c:165 +#, fuzzy +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l --verbose Taispein uimhreacha agus luachanna do bhearta uile difrila." + +#: src/cmp.c:166 +#, fuzzy +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n TEOR --bytes=TEOR Cuir TEOR beart i gcomparid, ar a mhad." + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr "" + +#: src/cmp.c:169 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "-v --version Taispein eolas faoin leagan." + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "sid: %s [ROGHA]... COMHAD1 [COMHAD2 [SCIPEIL1 [SCIPEIL2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Cuir dh chomhad i gcomparid, beart le beart." + +#: src/cmp.c:182 +#, fuzzy +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"Is ard at i SCIP1 agus SCIP2 n lonta na mbeart a scipeil i ngach comhad." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"Is fidir na hiarmhreanna a leanas a chur i ndiaidh SCIP:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, srl. do T, P, E, Z, Y." + +#: src/cmp.c:194 +#, fuzzy +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Mura bhfuil COMHAD ann, n ms `-' , ligh n ionchur caighdenach." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "Stdas scortha: 0 ms ionann iad, 1 ms difriil, 2 m t fadhb ann." + +#: src/cmp.c:240 +#, fuzzy, c-format +msgid "invalid --bytes value '%s'" +msgstr "luach neamhbhail --bytes `%s'" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, fuzzy, c-format +msgid "missing operand after '%s'" +msgstr "n folir argint i ndiaidh `%s'" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, fuzzy, c-format +msgid "extra operand '%s'" +msgstr "oibreann breise `%s'" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s difriil: beart %s, lne %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s difriil: beart %s, lne %s = %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: EOF ar %s\n" + +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s %s difriil: beart %s, lne %s\n" + +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s %s difriil: beart %s, lne %s\n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: EOF ar %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "" + +#: src/diff.c:353 +#, fuzzy, c-format +msgid "invalid context length '%s'" +msgstr "Fad neamhbhail comhthacs `%s'" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "N thacatear leis an uimhri leathanach ar an stromhaire seo" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "an iomarca argint do lipid chomhaid" + +#: src/diff.c:528 +#, fuzzy, c-format +msgid "invalid width '%s'" +msgstr "leithead neamhbhail `%s'" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "roghanna leithid contrrtha" + +#: src/diff.c:557 +#, fuzzy, c-format +msgid "invalid horizon length '%s'" +msgstr "fad laslne neamhbhail `%s'" + +#: src/diff.c:613 +#, fuzzy, c-format +msgid "invalid tabsize '%s'" +msgstr "t an mhid thib `%s' neamhbhail" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "Roghanna tbmhid contrrtha" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "tugadh --from-file agus --to-file lena chile" + +#: src/diff.c:891 +#, fuzzy +msgid " --normal output a normal diff (the default)" +msgstr "--normal Aschuir diff coitianta." + +#: src/diff.c:892 +#, fuzzy +msgid "-q, --brief report only when files differ" +msgstr "-q --brief N taispein ach difriil n nach ea." + +#: src/diff.c:893 +#, fuzzy +msgid "-s, --report-identical-files report when two files are the same" +msgstr "" +"-s --report-identical-files Tuairiscigh nuair at dh chomhad comhionanna." + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" + +#: src/diff.c:895 +#, fuzzy +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-w UIMH --width=UIMH UIMH coln priontla ar a mhad (ramhshocr=130)." + +#: src/diff.c:896 +#, fuzzy +msgid "-e, --ed output an ed script" +msgstr "-e --ed Aschuir script `ed'." + +#: src/diff.c:897 +#, fuzzy +msgid "-n, --rcs output an RCS format diff" +msgstr "-n --rcs Aschuir diff i gcruth RCS." + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "" + +#: src/diff.c:899 +#, fuzzy +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w UIMH --width=UIMH UIMH coln priontla ar a mhad (ramhshocr=130)." + +#: src/diff.c:900 +#, fuzzy +msgid "" +" --left-column output only the left column of common lines" +msgstr "-l --left-column N taispein an coln ar dheis ms ionann iad." + +#: src/diff.c:901 +#, fuzzy +msgid " --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines N taispein lnte at i bpirt acu." + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" + +#: src/diff.c:908 +#, fuzzy +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t --expand-tabs leathnaigh tib go spsanna san aschur." + +#: src/diff.c:909 +#, fuzzy +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T --initial-tab Ailnigh tib tr thb a chur in ionad sps tosaigh." + +#: src/diff.c:910 +#, fuzzy +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "--tabsize=UIMH Tbstop gach UIMH coln (ramhshocr=8)." + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" + +#: src/diff.c:912 +#, fuzzy +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "-l --paginate uimhrigh leathanaigh le `pr'." + +#: src/diff.c:914 +#, fuzzy +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "-r --recursive Cuir fochomhadlanna i gcomparid go hathchrsach." + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr "" + +#: src/diff.c:916 +#, fuzzy +msgid "-N, --new-file treat absent files as empty" +msgstr "-N --new-file Caith le comhad ar iarraidh mar chomhad folamh." + +#: src/diff.c:917 +#, fuzzy +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +"--unidirectional-new-file Ms ar iarraidh, caith leis an chad chomhad\n" +" mar chomhad folamh." + +#: src/diff.c:918 +#, fuzzy +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "--ignore-file-name-case N b csogair le hainmneacha comhaid." + +#: src/diff.c:919 +#, fuzzy +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +"--no-ignore-file-name-case B csogair maidir le hainmneacha comhaid." + +#: src/diff.c:920 +#, fuzzy +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "" +"-X SLONN --exclude=SLONN Fg comhaid as m t siad comhoirinacha le SLONN." + +#: src/diff.c:921 +#, fuzzy +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X COMHAD --exclude-from=COMHAD Fg comhaid as m t siad comhoirinacha le " +"haon\n" +" slonn ionadaochta as an CHOMHAD." + +#: src/diff.c:922 +#, fuzzy +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S COMHAD --starting-file=COMHAD Tosaigh le COMHAD agus comhadlanna " +"gcimheas." + +#: src/diff.c:923 +#, fuzzy +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +"--from-file=COMHAD Cuir COMHAD (n comhadlann) i gcomparid le gach oibreann." + +#: src/diff.c:925 +#, fuzzy +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +"--to-file=COMHAD Cuir gach oibreann i gcomparid le COMHAD (n comhadlann)." + +#: src/diff.c:928 +#, fuzzy +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "-i --ignore-case N b csogair le hinneachar na gcomhad." + +#: src/diff.c:929 +#, fuzzy +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E --ignore-tab-expansion Dan neamhshuim ar athruithe leathn na dtib." + +#: src/diff.c:930 +#, fuzzy +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-w --ignore-all-space Dan neamhshuim ar sps bn go hiomln." + +#: src/diff.c:931 +#, fuzzy +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b --ignore-space-change Dan neamhshuim ar mhid an spis bn." + +#: src/diff.c:932 +#, fuzzy +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w --ignore-all-space Dan neamhshuim ar sps bn go hiomln." + +#: src/diff.c:933 +#, fuzzy +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "-B --ignore-blank-lines Dan neamhshuim ar lnte folmha." + +#: src/diff.c:934 +#, fuzzy +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I SI --ignore-matching-lines=RE Dan neamhshuim ar lnte at " +"comhoirinach\n" +" leis an slonn SI." + +#: src/diff.c:936 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr "-a --text Caith le gach comhad mar thacschomhad." + +#: src/diff.c:937 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +"--strip-trailing-cr Dealaigh aisfhilleadh carriste gach lne ionchurtha." + +#: src/diff.c:939 +#, fuzzy +msgid " --binary read and write data in binary mode" +msgstr "--binary Ligh agus scrobh sonra sa mhd dnrtha." + +#: src/diff.c:942 +#, fuzzy +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D AINM --ifdef=AINM Taispein comhad cumaiscthe chun na diff-a\n" +" `#ifdef AINM' a liri" + +#: src/diff.c:943 +#, fuzzy +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +"--GCINL-group-format=GFMD Taispein grpa GCINL ionchuir de rir GFMD." + +#: src/diff.c:944 +#, fuzzy +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "--line-format=LFMD Taispein gach lne ionchuir de rir LFMD." + +#: src/diff.c:945 +#, fuzzy +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +"--LCINL-line-format=LFMD Taispein lnte LCINL ionchuir de rir LFMD." + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" + +#: src/diff.c:948 +#, fuzzy +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr " LCINL = `old', `new', n `unchanged'. GCINL = LCINL n `changed'." + +#: src/diff.c:949 +#, fuzzy +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" Is ard at i GFMT n:\n" +" %< lnte as COMHAD1\n" +" %> lnte as COMHAD2\n" +" %= lnte at i gCOMHAD1 agus COMHAD2 araon\n" +" %[-][LEITHEAD][.[SONR]]{doxX}LITIR sonr do litir mar C `printf'\n" +" Is LITIR mar a leanas (agus litreacha beaga don ghrpa `old'):\n" +" F an chad lne-uimhir\n" +" L an lne-uimhir dheiridh\n" +" N lon na lnte = L-F+1\n" +" E F-1\n" +" M L+1" + +#: src/diff.c:961 +#, fuzzy +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" Is ard at i LFMT n::\n" +" %L bhar na lne\n" +" %l bhar na lne, gan aon lne nua\n" +" %[-][LEITHEAD][.[SONR]]{doxX}n sonr do lne-uimhir mar C `printf'" + +#: src/diff.c:965 +#, fuzzy +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" Is fidir na teaghrin a leanas a bheith i GLA n LLA:\n" +" %% %\n" +" %c'C' an carachtar litriil C\n" +" %c'\\OOO' an carachtar le cd ochtnrtha OOO" + +#: src/diff.c:971 +#, fuzzy +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d --minimal Obair go crua le haghaidh nos l athruithe." + +#: src/diff.c:972 +#, fuzzy +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "--horizon-lines=UIMH Coinnigh UIMH lne den rimr/iarmhr choiteann." + +#: src/diff.c:973 +#, fuzzy +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +"-H --speed-large-files Comhaid mra agus go leor mionathruithe forleata." + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr "" + +#: src/diff.c:980 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "-v --version Taispein eolas faoin leagan." + +#: src/diff.c:982 +#, fuzzy +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"COMHAID = `COMHAD1 COMHAD2' n `COMHADLANN1 COMHADLANN2' n `COMHADLANN " +"COMHAD...' n `COMHAD... COMHADLANN'." + +#: src/diff.c:983 +#, fuzzy +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"M t --from-file n --to-file tugtha, nl a leithid de shrian ar COMHAID." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +#, fuzzy +msgid "If a FILE is '-', read standard input." +msgstr "Ms '-' an COMHAD, ligh n ionchur caighdenach." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "sid: %s [ROGHA]... COMHAID\n" + +#: src/diff.c:995 +#, fuzzy +msgid "Compare FILES line by line." +msgstr "Dan comparid idir na comhaid, lne ar lne." + +#: src/diff.c:1029 +#, fuzzy, c-format +msgid "conflicting %s option value '%s'" +msgstr "luach contrrtha don rogha %s: `%s'" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "roghanna contrrtha le haghaidh na stle aschuir" + +#: src/diff.c:1058 +#, fuzzy, c-format +msgid "invalid color '%s'" +msgstr "Fad neamhbhail comhthacs `%s'" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "I %s amhin: %s\n" + +#: src/diff.c:1248 +#, fuzzy +msgid "cannot compare '-' to a directory" +msgstr "n fidir `-' a chur i gcomparid le comhadlann" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "Nl an rogha -D ar fil do chomhadlanna" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Fochomhadlanna i gcoitianta: %s agus %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "T comhad %s ina %s ach t comhad %s ina %s\n" + +#: src/diff.c:1370 +#, fuzzy, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "T difrocht idir na comhaid %s agus %s\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Is comhionann iad na comhaid %s agus %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "roghanna neamh-chomhoirinacha" + +#: src/diff3.c:391 +#, fuzzy +msgid "'-' specified for more than one input file" +msgstr "bh `-' tugtha le haghaidh nos m n inchomhad amhin" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "theip ar lamh" + +#: src/diff3.c:475 +#, fuzzy +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A --show-all Taispein gach athr agus cuir coinbhleachta idir libn." + +#: src/diff3.c:477 +#, fuzzy +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e --ed Scrobh i MOCHOMHAD na hathruithe neamhchumaiscthe SEANCHOMHAD " +"go DOCHOMHAD." + +#: src/diff3.c:479 +#, fuzzy +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +"-E --show-overlap Taispein na hathruithe neamhchumaiscthe agus cuir " +"coinbhleachta idir libn." + +#: src/diff3.c:480 +#, fuzzy +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "-3 --easy-only Taispein athruithe neamhchumaiscthe forluiteacha." + +#: src/diff3.c:481 +#, fuzzy +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "-x --overlap-only Taispein na hathruithe forluiteacha." + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" + +#: src/diff3.c:483 +#, fuzzy +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "-i Cuir na horduithe `w' agus `q' le scripteanna `ed'." + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" + +#: src/diff3.c:488 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr "-a --text Caith le gach comhad mar thacschomhad." + +#: src/diff3.c:489 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +"--strip-trailing-cr Dealaigh aisfhilleadh carriste gach lne ionchurtha." + +#: src/diff3.c:490 +#, fuzzy +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T --initial-tab Ailnigh tib tr thb a chur in ionad sps tosaigh." + +#: src/diff3.c:491 +#, fuzzy +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +"--diff-program=CLR Bain sid as an CLR chun comhaid a chur i " +"gcomparid." + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr "" + +#: src/diff3.c:496 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "-v --version Taispein eolas faoin leagan." + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "sid: %s [ROGHA]... MOCHOMHAD SEANCHOMHAD DOCHOMHAD\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Cuir tr chomhad i gcomparid, lne ar lne." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "Stdas scortha = 0 (rathil), 1 (coinbhleachta), 2 (trioblid)." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "earrid inmhenach: formid de na bloic diff trna chile" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: theip ar diff: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "earrid inmhenach: cinel neamhbhail diff san fheidhm process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "formid diff neamhbhail; teorantir neamhbhail idir athruithe" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "formid neamhbhail diff; lne deiridh neamhiomln" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, fuzzy, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "norbh fhidir an fochlr `%s' a rith" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "formid neamhbhail diff; carachtair mhchearta ag tosach na lne" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "" +"earrid inmhenach: seachadadh cinel neamhbhail diff go dt an aschur" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "crapadh an t-inchomhad" + +#: src/dir.c:156 +#, fuzzy, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "" +"n fidir na hainmneacha comhaid `%s' agus `%s' a chur i gcomparid le chile" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "" + +#: src/sdiff.c:173 +#, fuzzy +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o COMHAD --output=COMHAD Md idirghnomhach, ag scrobh an aschuir i " +"gCOMHAD." + +#: src/sdiff.c:175 +#, fuzzy +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i --ignore-case N b csogair." + +#: src/sdiff.c:176 +#, fuzzy +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E --ignore-tab-expansion Dan neamhshuim ar athruithe leathn na dtib." + +#: src/sdiff.c:177 +#, fuzzy +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-w --ignore-all-space Dan neamhshuim ar sps bn go hiomln." + +#: src/sdiff.c:178 +#, fuzzy +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b --ignore-space-change Dan neamhshuim ar mhid an spis bn." + +#: src/sdiff.c:179 +#, fuzzy +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W --ignore-all-space Dan neamhshuim ar spsanna bn go hiomln." + +#: src/sdiff.c:180 +#, fuzzy +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "-B --ignore-blank-lines Dan neamhshuim ar lnte folmha." + +#: src/sdiff.c:181 +#, fuzzy +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I SI --ignore-matching-lines=RE Dan neamhshuim ar lnte at " +"comhoirinach\n" +" leis an slonn SI." + +#: src/sdiff.c:182 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +"--strip-trailing-cr Dealaigh aisfhilleadh carriste gach lne ionchurtha." + +#: src/sdiff.c:183 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr "-a --text Caith le gach comhad mar thacschomhad." + +#: src/sdiff.c:185 +#, fuzzy +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w UIMH --width=UIMH UIMH coln priontla ar a mhad (ramhshocr=130)." + +#: src/sdiff.c:186 +#, fuzzy +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "-l --left-column N taispein an coln ar dheis ms ionann iad." + +#: src/sdiff.c:187 +#, fuzzy +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines N taispein lnte at i bpirt acu." + +#: src/sdiff.c:189 +#, fuzzy +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t --expand-tabs leathnaigh tib go spsanna san aschur." + +#: src/sdiff.c:190 +#, fuzzy +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "--tabsize=UIMH Tbstop gach UIMH coln (ramhshocr=8)." + +#: src/sdiff.c:192 +#, fuzzy +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d --minimal Obair go crua le haghaidh nos l athruithe." + +#: src/sdiff.c:193 +#, fuzzy +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H --speed-large-files Comhaid mra agus go leor mionathruithe forleata." + +#: src/sdiff.c:194 +#, fuzzy +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +"--diff-program=CLR Bain sid as an CLR chun comhaid a chur i " +"gcomparid." + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr "" + +#: src/sdiff.c:197 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "-v --version Taispein eolas faoin leagan." + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "sid: %s [ROGHA]... COMHAD1 COMHAD2\n" + +#: src/sdiff.c:208 +#, fuzzy +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Cumaisc difrochta idir na comhaid, taobh le taobh." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "n fidir an t-ionchur caighdenach a chumasc go hidirghnomhach" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "is comhadlanna iad na comhaid le cur i gcomparid" + +#: src/sdiff.c:818 +#, fuzzy +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tCuir na leaganacha araon in eagar, agus ceanntsc le gach.\n" +"eb:\tCuir na leaganacha araon in eagar, agus ansin bain sid astu.\n" +"el:\tCuir an leagan ar cl in eagar, agus ansin bain sid as.\n" +"er:\tCuir an leagan ar dheis in eagar, agus ansin bain sid as.\n" +"e:\tCuir leagan nua in eagar.\n" +"l:\tBain sid as an leagan ar cl.\n" +"r:\tBain sid as an leagan ar dheis.\n" +"s:\tCuir comhlnte san ireamh go balbh.\n" +"v:\tCuir comhlnte san ireamh go foclach.\n" +"q:\tScoir.\n" + +#: src/util.c:662 +#, fuzzy, c-format +msgid "unrecognized prefix: %s" +msgstr "%s: rogha anaithnid `--%s'\n" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "" + +#, fuzzy +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: n cheadatear argint i ndiaidh na rogha `--%s'\n" + +#, fuzzy +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: rogha anaithnid `--%s'\n" + +#, fuzzy +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: T an rogha `-W %s' dbhroch\n" + +#, fuzzy +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: n cheadatear argint i ndiaidh na rogha `-W %s'\n" + +#, fuzzy +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: n folir argint don rogha `%s'\n" + +#~ msgid "%s: illegal option -- %c\n" +#~ msgstr "%s: rogha neamhcheadaithe -- %c\n" + +#~ msgid "" +#~ "This is free software; see the source for copying conditions. There is " +#~ "NO\n" +#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR " +#~ "PURPOSE.\n" +#~ msgstr "" +#~ "Is saorbhogearra an romhchlr seo; fach ar an bhunchd le haghaidh\n" +#~ "coinnollacha cipela. Nl barnta ar bith ann; go fi nl barnta ann\n" +#~ "d'INDOLTACHT n FEILINACHT DO FHEIDHM AR LEITH.\n" + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i SCIP1:SCIP2 --ignore-initial=SCIP1:SCIP2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "-s --quiet --silent N haschuir rud ar bith; gin stdas scortha." + +#~ msgid "--help Output this help." +#~ msgstr "--help Taispein an chabhair seo.." + +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>." +#~ msgstr "Seol tuairisc fabhtanna chuig <bug-gnu-utils@gnu.org>." + +#~ msgid "`-%ld' option is obsolete; use `-%c %ld'" +#~ msgstr "t an rogha `-%ld' as feidhm; bain sid as `-%c %ld'" + +#~ msgid "`-%ld' option is obsolete; omit it" +#~ msgstr "t an rogha `-%ld' as feidhm; fg ar lr" + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ "-c -C UIMHIR --context[=UIMHIR] Taispein UIMHIR lne de chomhthacs\n" +#~ " cipeilte (ramhshocr = 3).\n" +#~ "-u -U UIMHIR --unified[=UIMHIR] Taispein UIMHIR lne de chomhthacs\n" +#~ " aontaithe (ramhshocr = 3).\n" +#~ " --label LIPAD Bain sid as LIPAD in ionad ainm comhaid.\n" +#~ " -p --show-c-function Taispein an fheidhm C do gach difrocht.\n" +#~ " -F SI --show-function-line=SI Taispein an lne is dana at\n" +#~ " comhoirinach leis an slonn SI." + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ "-y --side-by-side Taispein le dh choln.\n" +#~ " -W UIMH --width=UIMH Taispein UIMH carachtar sa lne ar a mhad,\n" +#~ " (ramhshocr=130).\n" +#~ " --left-column N taispein ach an coln ar cl do lnte canna\n" +#~ " --suppress-common-lines N taispein lnte canna." + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "" +#~ "--speed-large-files Comhaid mra agus go leor mionathruithe forleata." + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "-X Taispein na hathruithe forluiteacha, idir libn." + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "" +#~ "-m --merge Taispein comhad cumaiscthe in ionad script ed (ramhshocr -" +#~ "A)." + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "-L LIPAD --label=LIPAD sid LIPAD in ionad ainm comhaid." + +#~ msgid "subsidiary program `%s' not found" +#~ msgstr "fochlr `%s' gan aimsi" + +#~ msgid "subsidiary program `%s' failed" +#~ msgstr "theip ar an fhochlr `%s'" + +#~ msgid "subsidiary program `%s' failed (exit status %d)" +#~ msgstr "theip ar an fhochlr `%s' (stdas scortha %d)" diff --git a/local/recipes/tools/diffutils/source/po/gl.gmo b/local/recipes/tools/diffutils/source/po/gl.gmo new file mode 100644 index 0000000000..dc924a39c9 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/gl.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/gl.po b/local/recipes/tools/diffutils/source/po/gl.po new file mode 100644 index 0000000000..1dd51d8015 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/gl.po @@ -0,0 +1,1708 @@ +# Galician translation of GNU diffutils +# Copyright © 2000, 2001, 2002 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Jacobo Tarrío Barreiro <jtarrio@trasno.net>, 2000, 2001, 2002. +# Miguel Anxo Bouzada <mbouzada@gmail.com>, 2011. +# Leandro Regueiro <leandro.regueiro@gmail.com>, 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU diffutils 3.2\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2011-10-17 12:43+0100\n" +"Last-Translator: Leandro Regueiro <leandro.regueiro@gmail.com>\n" +"Language-Team: Galician <proxecto@trasno.net>\n" +"Language: gl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: lib/argmatch.c:134 +#, fuzzy, c-format +msgid "invalid argument %s for %s" +msgstr "o argumento «%s» de %s%s é incorrecto" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "" + +#: lib/argmatch.c:154 +#, fuzzy +msgid "Valid arguments are:" +msgstr "o argumento «%s» de %s%s é incorrecto" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "erro do programa" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "desbordamento da pila" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Produciuse un erro descoñecido do sistema" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "ficheiro regular baleiro" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "ficheiro regular" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "directorio" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "ligazón simbólica" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "cola de mensaxes" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "semáforo" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "obxecto de memoria compartida" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "obxecto de memoria con tipo" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "ficheiro especial de bloques" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "ficheiro especial de caracteres" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "" + +#: lib/file-type.c:81 +#, fuzzy +msgid "multiplexed block special file" +msgstr "ficheiro especial de bloques" + +#: lib/file-type.c:84 +#, fuzzy +msgid "multiplexed character special file" +msgstr "ficheiro especial de caracteres" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "" + +#: lib/file-type.c:90 +#, fuzzy +msgid "named file" +msgstr "ficheiro estraño" + +#: lib/file-type.c:93 +#, fuzzy +msgid "network special file" +msgstr "ficheiro especial de bloques" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "" + +#: lib/file-type.c:102 +msgid "port" +msgstr "" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "socket" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "ficheiro estraño" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: a opción «-W %s» é ambigua\n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "'%s' está danado. A liña %d na sección Opción é incorrecta" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: non se recoñece a opción «%c%s»\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: a opción «%c%s» non permite un argumento\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: a opción «--%s» require un argumento\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: opción incorrecta -- «%c»\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: a opción require un argumento -- «%c»\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "«" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "»" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Correcto" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Non hai coincidencias" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Expresión regular incorrecta" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Carácter de ordenamento incorrecto" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Nome da clase de caracteres incorrecto" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Barra invertida ao final" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Referencia cara a atrás incorrecta" + +#: lib/regcomp.c:156 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "[ ou [^ non emparellado" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "( ou \\( non emparellado" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "\\{ non emparellado" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "O contido entre \\{\\} non é correcto" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Final do rango incorrecto" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Memoria esgotada" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Expresión regular precedente incorrecta" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Final prematura da expresión regular" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Expresión regular demasiado grande" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr ") ou \\) non emparellado" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Non hai unha expresión regular anterior" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "esgotouse a memoria" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "entrada estándar" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "saída estándar" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "saída estándar de erro" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "fluxo descoñecido" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "produciuse un erro ao volver abrir %s en modo %s" + +#: lib/xstrtol-error.c:63 +#, fuzzy, c-format +msgid "invalid %s%s argument '%s'" +msgstr "o argumento «%s» de %s%s é incorrecto" + +#: lib/xstrtol-error.c:68 +#, fuzzy, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "sufixo incorrecto %s%s no argumento «%s»" + +#: lib/xstrtol-error.c:72 +#, fuzzy, c-format +msgid "%s%s argument '%s' too large" +msgstr "%s%s argumento «%s» demasiado longo" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Empaquetado por %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Empaquetado por %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Licenza GPLv3+: GNU GPL versión 3 ou posterior <http://gnu.org/licenses/gpl." +"html>.\n" +"Isto é software libre: vostede é libre para modificalo e redistribuílo.\n" +"NON HAI GARANTÍA, ata o punto permitido pola lei.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Escrito por %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Escrito por %s e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Escrito por %s, %s e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Escrito por %s, %s, %s\n" +"e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Escrito por %s, %s, %s\n" +"%s e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Escrito por %s, %s, %s\n" +"%s, %s e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Escrito por %s, %s, %s\n" +"%s, %s, %s, e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Escrito por %s, %s, %s\n" +"%s, %s, %s, %s,\n" +"e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Escrito por %s, %s, %s\n" +"%s, %s, %s, %s,\n" +"%s e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Escrito por %s, %s, %s\n" +"%s, %s, %s, %s,\n" +"%s, %s e outros.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Envíe os informes de erros a: %s\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Envíe %s informes de erros a: %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s páxina web: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "%s páxina web: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "Axuda xeral ao usar software GNU: <http://www.gnu.org/gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Os ficheiros %s e %s son diferentes\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Os ficheiros binarios %s e %s son diferentes\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Non hai un salto de liña na fin da liña" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, fuzzy, c-format +msgid "Try '%s --help' for more information." +msgstr "Probe «%s --help» para obter máis información." + +#: src/cmp.c:137 +#, fuzzy, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "valor de --ignore-initial «%s» non válido" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "as opcións -l e -s son incompatíbeis" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "fallou a escritura" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "saída estándar" + +#: src/cmp.c:161 +#, fuzzy +msgid "-b, --print-bytes print differing bytes" +msgstr "Axustar a resolución de impresión" + +#: src/cmp.c:162 +#, fuzzy +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i N --ignore-initial=N Omitir os primeiros N bytes de entrada." + +#: src/cmp.c:163 +#, fuzzy +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +" Omitir os primeiros N1 bytes de FICH1 e os primeiros N2 bytes de FICH2." + +#: src/cmp.c:165 +#, fuzzy +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "-l --verbose Amosar os números e valores dos bytes que difiran." + +#: src/cmp.c:166 +#, fuzzy +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n LÍMITE --bytes=LÍMITE Comparar como moito LÍMITE bytes." + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr "" + +#: src/cmp.c:169 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "Mostrar información da versión e saír" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Uso: %s [OPCIÓN]... FICH1 [FICH2 [N1 [N2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Comparar dous ficheiros byte a byte." + +#: src/cmp.c:182 +#, fuzzy +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "N1 e N2 son o número de bytes a omitir en cada ficheiro." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"Os valores N poden estar seguidos polos seguintes sufixos multiplicativos:\n" +"kB 1000, K 1024, MB 1.000.000, M 1.048.576,\n" +"GB 1.000.000.000, G 1.073.741.824, e así para T, P, E, Z e Y." + +#: src/cmp.c:194 +#, fuzzy +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Se un FICHEIRO é «-» ou non se indica, lese da entrada estándar." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"O estado de saída é 0 se as entradas son iguais, 1 se son diferentes, 2 en " +"caso de problema." + +#: src/cmp.c:240 +#, fuzzy, c-format +msgid "invalid --bytes value '%s'" +msgstr "valor de --bytes «%s» non válido" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, fuzzy, c-format +msgid "missing operand after '%s'" +msgstr "falta un operando despois de «%s»" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, fuzzy, c-format +msgid "extra operand '%s'" +msgstr "operando «%s» sobrante" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s son diferentes: byte %s, liña %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s son diferentes: byte %s, liña %s é %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: Fin de ficheiro en %s\n" + +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s %s son diferentes: byte %s, liña %s\n" + +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s %s son diferentes: byte %s, liña %s\n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: Fin de ficheiro en %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, fuzzy, c-format +msgid "invalid context length '%s'" +msgstr "lonxitude do contexto «%s» non válida" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "a paxinación non está admitida nesta máquina" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "demasiadas opcións de etiquetas de ficheiro" + +#: src/diff.c:528 +#, fuzzy, c-format +msgid "invalid width '%s'" +msgstr "largo «%s» non válido" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "opcións de largura conflitivas" + +#: src/diff.c:557 +#, fuzzy, c-format +msgid "invalid horizon length '%s'" +msgstr "lonxitude do horizonte «%s» non válida" + +#: src/diff.c:613 +#, fuzzy, c-format +msgid "invalid tabsize '%s'" +msgstr "tamaño de tabulación «%s» non válido" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "opcións de tamaño de tabulación conflitivas" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "Especificáronse --from-file e --to-file ao mesmo tempo" + +#: src/diff.c:891 +#, fuzzy +msgid " --normal output a normal diff (the default)" +msgstr "Aparencia predefinida no modo normal" + +#: src/diff.c:892 +#, fuzzy +msgid "-q, --brief report only when files differ" +msgstr "-q --brief Producir unha saída só se os ficheiros teñen diferencias." + +#: src/diff.c:893 +#, fuzzy +msgid "-s, --report-identical-files report when two files are the same" +msgstr "" +"-s --report-identical-files Informar cando dous ficheiros son o mesmo." + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" + +#: src/diff.c:895 +#, fuzzy +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "-w NÚM --width=NÚM Amosar como moito NÚM columnas (130 por omisión)." + +#: src/diff.c:896 +#, fuzzy +msgid "-e, --ed output an ed script" +msgstr "Gardar a saída da consola de Script-Fu" + +#: src/diff.c:897 +#, fuzzy +msgid "-n, --rcs output an RCS format diff" +msgstr "-n --rcs Producir un diff en formato RCS." + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "" + +#: src/diff.c:899 +#, fuzzy +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "-w NÚM --width=NÚM Amosar como moito NÚM columnas (130 por omisión)." + +#: src/diff.c:900 +#, fuzzy +msgid "" +" --left-column output only the left column of common lines" +msgstr "-l --left-column Amosar só a columna da esquerda nas liñas comúns." + +#: src/diff.c:901 +#, fuzzy +msgid " --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines Non amosar as liñas comúns." + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" + +#: src/diff.c:905 +#, fuzzy +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +"--from-file=FICH1 Comparar FICH1 con todos os operandos. Pode ser " +"directorio." + +#: src/diff.c:908 +#, fuzzy +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t --expand-tabs Expandir as tabulacións a espazos na saída." + +#: src/diff.c:909 +#, fuzzy +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T --initial-tab Facer que as tabulacións queden aliñadas poñendo outra\n" +" tabulación ao principio da liña." + +#: src/diff.c:910 +#, fuzzy +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "--tabsize=NÚM Tabulacións de NÚM columnas (8 por omisión)." + +#: src/diff.c:911 +#, fuzzy +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +"--suppress-blank-empty Suprime espazos ou tabuladores antes dunha liña " +"baleira." + +#: src/diff.c:912 +#, fuzzy +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "-l --paginate Pasar a saída por «pr» para paxinala." + +#: src/diff.c:914 +#, fuzzy +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r --recursive Comparar recursivamente os subdirectorios que se atopen." + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr "" + +#: src/diff.c:916 +#, fuzzy +msgid "-N, --new-file treat absent files as empty" +msgstr "-N --new-file Tratar os ficheiros ausentes como baleiros." + +#: src/diff.c:917 +#, fuzzy +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +"--unidirectional-new-file Tratar os ficheiros antigos ausentes como\r\n" +"a baleiros." + +#: src/diff.c:918 +#, fuzzy +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +"--ignore-file-name-case Ignorar maiúsculas/minúsculas no nome do ficheiro." + +#: src/diff.c:919 +#, fuzzy +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +"--no-ignore-file-name-case Ter en conta as maiúsculas/minúsculas\r\n" +" ao comparar os nomes dos ficheiros." + +#: src/diff.c:920 +#, fuzzy +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "-x MOD --exclude=MOD Excluír os ficheiros que coinciden co MODelo." + +#: src/diff.c:921 +#, fuzzy +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X FICH --exclude-from=FICH Excluír ficheiros que coinciden con algún\r\n" +" modelo do FICHeiro." + +#: src/diff.c:922 +#, fuzzy +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S FICH --starting-file=FICH Comezar no FICHeiro ao comparar directorios." + +#: src/diff.c:923 +#, fuzzy +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +"--from-file=FICH1 Comparar FICH1 con todos os operandos. Pode ser " +"directorio." + +#: src/diff.c:925 +#, fuzzy +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +"--to-file=FICH2 Comparar todos os operandos con FICH2. Pode ser un " +"directorio." + +#: src/diff.c:928 +#, fuzzy +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i --ignore-case Ignorar maiúsculas/minúsculas no contido do ficheiro." + +#: src/diff.c:929 +#, fuzzy +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E --ignore-tab-expansion Ignorar os cambios pola expansión de tabulacións." + +#: src/diff.c:930 +#, fuzzy +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-w --ignore-all-space Ignorar todos os espazos en branco." + +#: src/diff.c:931 +#, fuzzy +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b --ignore-space-change Ignorar os cambios na cantidade de espazos." + +#: src/diff.c:932 +#, fuzzy +msgid "-w, --ignore-all-space ignore all white space" +msgstr "Todo visíbel (ignorar patrón)" + +#: src/diff.c:933 +#, fuzzy +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B --ignore-blank-lines Ignorar os cambios que teñan todas as liñas en " +"branco" + +#: src/diff.c:934 +#, fuzzy +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I EXPR-REG --ignore-matching-lines=EXPR-REG Ignorar os cambios nos que " +"todas as liñas\r\n" +" conteñan EXPR-REG." + +#: src/diff.c:936 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr "-a --text Tratar todos os ficheiros como texto" + +#: src/diff.c:937 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +"--strip-trailing-cr Eliminar os retornos de carro á fin das liñas de " +"entrada." + +#: src/diff.c:939 +#, fuzzy +msgid " --binary read and write data in binary mode" +msgstr "--binary Ler e escribir datos en modo binario." + +#: src/diff.c:942 +#, fuzzy +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D NOME -ifdef=NOME Amosar o ficheiro mesturado con diffs «#ifdef NOME»." + +#: src/diff.c:943 +#, fuzzy +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +"--GTYPE-group-format=GFMT Similar, mais formatar os grupos de entrada GTYPE" +"\r\n" +" con GFMT." + +#: src/diff.c:944 +#, fuzzy +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "" +"--line-format=LFMT Similar, mais formatar todas as liñas de entrada con " +"LFMT." + +#: src/diff.c:945 +#, fuzzy +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +"--LTYPE-line-format=LFMT Similar, mais formatar as liñas de entrada LTYPE" +"\r\n" +" con LFMT." + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" + +#: src/diff.c:948 +#, fuzzy +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE é «old» (antigo), «new» (novo) ou «unchanged» (sen cambios).\r\n" +" GTYPE é LTYPE ou «changed» (con cambios)." + +#: src/diff.c:949 +#, fuzzy +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT pode conter:\n" +" %< liñas do FICH1\n" +" %> liñas do FICH2\n" +" %= liñas comúns a FICH1 e FICH2\n" +" %[-][ANCHO][.[PREC]]{doxX}LETRA especificación estilo printf para a " +"LETRA\n" +" As LETRAs son como segue para o novo grupo, en minúsculas para o " +"antigo:\n" +" F número da primeira liña\n" +" L número da última liña\n" +" N número de liñas = L-F+1\n" +" E F-1\n" +" M L+1" + +#: src/diff.c:961 +#, fuzzy +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT pode conter:\n" +" %L contido da liña\n" +" %l contido da liña, excluíndo os saltos de liña finais\n" +" %[-][ANCHO][.[PREC]]{doxX}n especif. estilo printf do número da liña" + +#: src/diff.c:965 +#, fuzzy +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" GFMT e LFMT poden conter:\n" +" %% %\n" +" %c«C» o carácter C\n" +" %c«\\OOO» o carácter de código octal OOO" + +#: src/diff.c:971 +#, fuzzy +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d --minimal Procurar atopar o conxunto de cambios máis pequeno." + +#: src/diff.c:972 +#, fuzzy +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "--horizon-lines=NUM Manter NUM liñas do prefixo e sufixo comúns." + +#: src/diff.c:973 +#, fuzzy +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +"-H --speed-large-files Asumir ficheiros longos e pequenos cambios " +"dispersos." + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr "" + +#: src/diff.c:980 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "Mostrar información da versión e saír" + +#: src/diff.c:982 +#, fuzzy +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"Os FICHEIROS son «FICH1 FICH2», «DIR1 DIR2», «DIR FICH...» ou «FICH... DIR»." + +#: src/diff.c:983 +#, fuzzy +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Se se indica --from-file ou --to-file, non hai restricións nos FICHEIROS." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +#, fuzzy +msgid "If a FILE is '-', read standard input." +msgstr "Se un FICHEIRO é «-», lese da entrada estándar." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Uso: %s [OPCIÓN]... FICHEIROS\n" + +#: src/diff.c:995 +#, fuzzy +msgid "Compare FILES line by line." +msgstr "Comparar os ficheiros liña a liña." + +#: src/diff.c:1029 +#, fuzzy, c-format +msgid "conflicting %s option value '%s'" +msgstr "valor «%1$s» da opción %2$s conflitivo" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "opcións de estilo da saída conflitivas" + +#: src/diff.c:1058 +#, fuzzy, c-format +msgid "invalid color '%s'" +msgstr "lonxitude do contexto «%s» non válida" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Só en %s: %s\n" + +#: src/diff.c:1248 +#, fuzzy +msgid "cannot compare '-' to a directory" +msgstr "non se pode comparar «-» cun directorio" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "A opción -D non está admitida con directorios" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Subdirectorios comúns: %s e %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "O ficheiro %s é un %s mentres que o ficheiro %s é un %s\n" + +#: src/diff.c:1370 +#, fuzzy, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Os ficheiros %s e %s son diferentes\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Os ficheiros %s e %s son idénticos\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "opcións incompatíbeis" + +#: src/diff3.c:391 +#, fuzzy +msgid "'-' specified for more than one input file" +msgstr "Especificouse «-» para máis dun ficheiro de entrada" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "fallou a lectura" + +#: src/diff3.c:475 +#, fuzzy +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-a --show-all Amosar todos os cambios, cos conflitos entre parénteses." + +#: src/diff3.c:477 +#, fuzzy +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e --ed Produce cambios sen mesturar de FICH-ANTIGO a TEU-FICH en MEU-FICH." + +#: src/diff3.c:479 +#, fuzzy +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +"-E --show-overlap Amosar cambios sen mesturar cos conflitos entre " +"parénteses." + +#: src/diff3.c:480 +#, fuzzy +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "-3 --easy-only Amosar cambios non sobrepostos e non mesturados." + +#: src/diff3.c:481 +#, fuzzy +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "-x --overlap-only Amosar los cambios que se superpoñen." + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" + +#: src/diff3.c:483 +#, fuzzy +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "-i Engadir as ordes «w» e «q» aos scripts en ed." + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" + +#: src/diff3.c:488 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr "-a --text Tratar todos os ficheiros como texto" + +#: src/diff3.c:489 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +"--strip-trailing-cr Eliminar os retornos de carro á fin das liñas de " +"entrada." + +#: src/diff3.c:490 +#, fuzzy +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T --initial-tab Facer que as tabulacións queden aliñadas poñendo outra\n" +" tabulación ao principio da liña." + +#: src/diff3.c:491 +#, fuzzy +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +"--diff-program=PROGRAMA Empregar o PROGRAMA para comparar os ficheiros." + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr "" + +#: src/diff3.c:496 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "Mostrar información da versión e saír" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Uso: %s [OPCIÓN]... MEU-FICH ANTIGO-FICH TEU-FICH\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Comparar tres ficheiros liña a liña." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"O estado de saída é 0 se é correcto, 1 se hai conflitos, 2 en caso de " +"problema." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "erro interno: fallo no formato dos bloques diff" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff fallou: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "erro interno: tipo de diff non válido en process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "formato de diff non válido; separador de cambios non válido" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "formato de diff non válido: última liña incompleta" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, fuzzy, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "non foi posíbel invocar o programa subsidiario «%s»" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "formato de diff non válido: caracteres a principio de liña incorrectos" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "erro interno_ tipo de diff non válido pasado á saída" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "o ficheiro de entrada minguou" + +#: src/dir.c:156 +#, fuzzy, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "non se poden comparar os ficheiros «%s» e «%s»" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: bucle de directorio recursivo" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +#, fuzzy +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o FICH --output=FICH Operar interactivamente, enviando a saída ao " +"FICHeiro." + +#: src/sdiff.c:175 +#, fuzzy +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "" +"-i --ignore-case Ignorar as diferencias entre maiúsculas e minúsculas." + +#: src/sdiff.c:176 +#, fuzzy +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E --ignore-tab-expansion Ignorar os cambios pola expansión de tabulacións." + +#: src/sdiff.c:177 +#, fuzzy +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-w --ignore-all-space Ignorar todos os espazos en branco." + +#: src/sdiff.c:178 +#, fuzzy +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b --ignore-space-change Ignorar os cambios na cantidade de espazos." + +#: src/sdiff.c:179 +#, fuzzy +msgid "-W, --ignore-all-space ignore all white space" +msgstr "Todo visíbel (ignorar patrón)" + +#: src/sdiff.c:180 +#, fuzzy +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" +"-B --ignore-blank-lines Ignorar os cambios que teñan todas as liñas en " +"branco" + +#: src/sdiff.c:181 +#, fuzzy +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I EXPR-REG --ignore-matching-lines=EXPR-REG Ignorar os cambios nos que " +"todas as liñas\r\n" +" conteñan EXPR-REG." + +#: src/sdiff.c:182 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +"--strip-trailing-cr Eliminar os retornos de carro á fin das liñas de " +"entrada." + +#: src/sdiff.c:183 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr "-a --text Tratar todos os ficheiros como texto" + +#: src/sdiff.c:185 +#, fuzzy +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "-w NÚM --width=NÚM Amosar como moito NÚM columnas (130 por omisión)." + +#: src/sdiff.c:186 +#, fuzzy +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "-l --left-column Amosar só a columna da esquerda nas liñas comúns." + +#: src/sdiff.c:187 +#, fuzzy +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines Non amosar as liñas comúns." + +#: src/sdiff.c:189 +#, fuzzy +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t --expand-tabs Expandir as tabulacións a espazos na saída." + +#: src/sdiff.c:190 +#, fuzzy +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "--tabsize=NÚM Tabulacións de NÚM columnas (8 por omisión)." + +#: src/sdiff.c:192 +#, fuzzy +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d --minimal Procurar atopar o conxunto de cambios máis pequeno." + +#: src/sdiff.c:193 +#, fuzzy +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H --speed-large-files Asumir ficheiros longos e pequenos cambios " +"dispersos." + +#: src/sdiff.c:194 +#, fuzzy +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +"--diff-program=PROGRAMA Empregar o PROGRAMA para comparar os ficheiros." + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr "" + +#: src/sdiff.c:197 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "Mostrar información da versión e saír" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Uso: %s [OPCIÓN]... FICH1 FICH2\n" + +#: src/sdiff.c:208 +#, fuzzy +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Mestura en dúas columnas das diferencias entre os ficheiros." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "non se pode mesturar a entrada estándar interactivamente" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "ámbolos dous ficheiros a ser comparados son directorios" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tEdita e usa ambas versións, cada unha decorada cunha cabeceira.\n" +"eb:\tEdita e usa ambas versións.\n" +"el ou e1:\tEdita e usa a versión esquerda.\n" +"er ou e2:\tEdita e usa a versión dereita.\n" +"e:\tEdita unha nova versión.\n" +"l ou 1:\tUsa a versión esquerda.\n" +"r ou 2:\tUsa a versión dereita.\n" +"s: Inclúe liñas comúns silenciosamente.\n" +"v: Inclúe liñas comúns de xeito detallado.\n" +"q: Saír.\n" + +#: src/util.c:662 +#, fuzzy, c-format +msgid "unrecognized prefix: %s" +msgstr "%s: non se recoñece a opción «--%s»\n" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "" + +#, fuzzy +#~ msgid " or 'auto' (the default)" +#~ msgstr "Aparencia predefinida no modo normal" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: a opción «--%s» non permite un argumento\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: non se recoñece a opción «--%s»\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: a opción «-W %s» é ambigua\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: a opción «-W %s» non permite un argumento\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: a opción «-W %s» require un argumento\n" + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i N1:N2 --ignore-initial=N1:N2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "-s --quiet --silent Non producir nada; só dar o estado de saída." + +#~ msgid "--help Output this help." +#~ msgstr "--help Amosar esta axuda." + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ "-c -C NÚM --context[=NÚM] Amosar NÚM (3 por omisión) liñas de contexto " +#~ "copiado.\n" +#~ "-u -U NÚM --unified[=NÚM] Amosar NÚM (3 por omisión) liñas de contexto " +#~ "unificado.\n" +#~ " --label ETIQUETA Usar a ETIQUETA no canto do nome do ficheiro.\n" +#~ " -p --show-c-function Amosar en que función C está cada cambio.\n" +#~ " -F EXPR-REG --show-function-line=EXPR-REG Amosar a liña máis recente " +#~ "que coincide\n" +#~ " con EXPR-REG." + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ "-y --side-by-side Producir a saída en dúas columnas.\n" +#~ " -w NÚM --width=NÚM Amosar como moito NÚM (130 por omisión) columnas " +#~ "de impresión.\n" +#~ " --left-column Amosar só a columna da esquerda nas liñas comúns.\n" +#~ " --suppress-common-lines Non amosar as liñas comúns." + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "" +#~ "--speed-large-files Asumir ficheiros longos e pequenos cambios dispersos." + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "" +#~ "-X Amosar os cambios que se sobrepoñan, poñéndoos entre parénteses." + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "" +#~ "-m --merge Amosar o ficheiro mesturado no canto dun script en ed [-A]." + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "" +#~ "-L ETIQ --label=ETIQ Usar a ETIQueta no canto do nome do ficheiro." + +#~ msgid "%s: illegal option -- %c\n" +#~ msgstr "ón non permitida -- %c\n" + +#~ msgid "" +#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n" +#~ "You may redistribute copies of this program\n" +#~ "under the terms of the GNU General Public License.\n" +#~ "For more information about these matters, see the files named COPYING." +#~ msgstr "" +#~ "én SEN GARANTÍA, ata o permitido pola lei.\n" +#~ "ír copias deste programa baixo os termos\n" +#~ "ública Xeral de GNU.\n" +#~ "áis información sobre estas materias, vexa o ficheiro chamado COPYING." + +#~ msgid "Written by Torbjorn Granlund and David MacKenzie." +#~ msgstr "örn Granlund e David MacKenzie." + +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>." +#~ msgstr "" +#~ "\n" +#~ "ón a <proxecto@trasno.net>." + +#~ msgid "" +#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman, and Len Tower." +#~ msgstr "\n" + +#~ msgid "`-%ld' option is obsolete; use `-%c %ld'" +#~ msgstr "ón `-%ld' é obsoleta; empregue `-%c %ld'" + +#~ msgid "`-%ld' option is obsolete; omit it" +#~ msgstr "ón `-%ld' é obsoleta; omítaa" + +#~ msgid "subsidiary program `%s' not executable" +#~ msgstr "é executable" + +#~ msgid "" +#~ "SKIP values may be followed by the following multiplicative suffixes:\n" +#~ msgstr "\n" + +#~ msgid "kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +#~ msgstr "\n" + +#~ msgid "GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y.\n" +#~ msgstr "í para T, P, E, Z e Y.\n" + +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>.\n" +#~ msgstr "\n" + +#~ msgid "context length specified twice" +#~ msgstr "úas veces" + +#~ msgid "multiple `--from-file' options" +#~ msgstr "óns `--from-file' múltiples" + +#~ msgid "multiple `--to-file' options" +#~ msgstr "óns `--to-file' múltiples" + +#~ msgid "If a FILE is `-', read standard input.\n" +#~ msgstr "é `-', lese da entrada estándar.\n" + +#~ msgid ": not found\n" +#~ msgstr "\n" + +#~ msgid "conflicting line format" +#~ msgstr "ña con conflictos" diff --git a/local/recipes/tools/diffutils/source/po/he.gmo b/local/recipes/tools/diffutils/source/po/he.gmo new file mode 100644 index 0000000000..8c11a2fd83 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/he.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/he.po b/local/recipes/tools/diffutils/source/po/he.po new file mode 100644 index 0000000000..3df1419412 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/he.po @@ -0,0 +1,1600 @@ +# Hebrew messages for GNU Diffutils -*- coding: hebrew-iso-8bit -*- +# Copyright (C) 2001, 2002 Free Software Foundation, Inc. +# Eli Zaretskii <eliz@is.elta.co.il>, 2001, 2002. +# +msgid "" +msgstr "" +"Project-Id-Version: diffutils 2.8.3\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2002-06-17 13:03+0300\n" +"Last-Translator: Eli Zaretskii <eliz@gnu.org>\n" +"Language-Team: Hebrew <eliz@gnu.org>\n" +"Language: he\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr " " + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr " " + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "- " + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr " " + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr " " + +#: lib/file-type.c:52 +msgid "message queue" +msgstr " " + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr " " + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr " " + +#: lib/file-type.c:66 +msgid "block special file" +msgstr " " + +#: lib/file-type.c:69 +msgid "character special file" +msgstr " " + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo " + +#: lib/file-type.c:78 +msgid "door" +msgstr "" + +#: lib/file-type.c:81 +#, fuzzy +msgid "multiplexed block special file" +msgstr " " + +#: lib/file-type.c:84 +#, fuzzy +msgid "multiplexed character special file" +msgstr " " + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "" + +#: lib/file-type.c:90 +#, fuzzy +msgid "named file" +msgstr " " + +#: lib/file-type.c:93 +#, fuzzy +msgid "network special file" +msgstr " " + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "" + +#: lib/file-type.c:102 +msgid "port" +msgstr "" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr " " + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s - `%s' \n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s - `%s' \n" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s `%c%s' - \n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s `%c%s' \n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s `%s' \n" + +#: lib/getopt.c:621 +#, fuzzy, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s -- %c\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, fuzzy, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: -- %c\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr " " + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr " " + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "- " + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr " - " + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "`\\' " + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr " - " + +#: lib/regcomp.c:156 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "- [^ [" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "- \\( (" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "- \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "\\{\\} " + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr " " + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr " " + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr " " + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr " " + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr " " + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "- \\) )" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr " " + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr " " + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "" + +#: lib/xfreopen.c:38 +#, fuzzy +msgid "unknown stream" +msgstr "- " + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "" + +#: lib/xstrtol-error.c:63 +#, fuzzy, c-format +msgid "invalid %s%s argument '%s'" +msgstr "--bytes `%s' " + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, fuzzy, c-format +msgid "Written by %s.\n" +msgstr ".Thomas Lord \" " + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, fuzzy, c-format +msgid "Written by %s and %s.\n" +msgstr ".Randy Smith \" " + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, fuzzy, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr ".Randy Smith \" " + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr " `%s'- `%s' \n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr " `%s'- `%s' \n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr " - " + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, fuzzy, c-format +msgid "Try '%s --help' for more information." +msgstr ". `%s --help' " + +#: src/cmp.c:137 +#, fuzzy, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "--ignore-initial `%s' " + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr " -s- -l " + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr " " + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr " " + +#: src/cmp.c:161 +#, fuzzy +msgid "-b, --print-bytes print differing bytes" +msgstr " . -b --print-bytes" + +#: src/cmp.c:162 +#, fuzzy +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr " . N -i N --ignore-initial=N" + +#: src/cmp.c:163 +#, fuzzy +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr ". N2 N1 " + +#: src/cmp.c:165 +#, fuzzy +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr ". ' -l --verbose" + +#: src/cmp.c:166 +#, fuzzy +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr " . N -n N --bytes=N" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr "" + +#: src/cmp.c:169 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr " . -v --version" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr " %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]] : \n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr ". " + +#: src/cmp.c:182 +#, fuzzy +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr " . SKIP2- SKIP1" + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +" : SKIP \n" +" ,M 1,048,576, MB 1,000,000 ,K 1024 ,kB 1000,\n" +" .T, P, E, Z, Y ,G 1,073,741,824 ,GB 1,000,000,000" + +#: src/cmp.c:194 +#, fuzzy +msgid "If a FILE is '-' or missing, read standard input." +msgstr " . , `-' FILE " + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" + +#: src/cmp.c:240 +#, fuzzy, c-format +msgid "invalid --bytes value '%s'" +msgstr "--bytes `%s' " + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, fuzzy, c-format +msgid "missing operand after '%s'" +msgstr "`%s' " + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, fuzzy, c-format +msgid "extra operand '%s'" +msgstr "`%s' " + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s- %s %s ,%s \n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s- %s %s ,%s %3o %s %3o %s \n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: %s \n" + +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s- %s %s ,%s \n" + +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s- %s %s ,%s \n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: %s \n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "" + +#: src/diff.c:353 +#, fuzzy, c-format +msgid "invalid context length '%s'" +msgstr "`%s' " + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr " " + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr " -L " + +#: src/diff.c:528 +#, fuzzy, c-format +msgid "invalid width '%s'" +msgstr "`%s' " + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr " " + +#: src/diff.c:557 +#, fuzzy, c-format +msgid "invalid horizon length '%s'" +msgstr "--horizon-lines `%s' " + +#: src/diff.c:613 +#, fuzzy, c-format +msgid "invalid tabsize '%s'" +msgstr "`%s' Tab " + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr " Tab " + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "--to-file --from-file " + +#: src/diff.c:891 +#, fuzzy +msgid " --normal output a normal diff (the default)" +msgstr " . --normal" + +#: src/diff.c:892 +#, fuzzy +msgid "-q, --brief report only when files differ" +msgstr " . -q --brief" + +#: src/diff.c:893 +#, fuzzy +msgid "-s, --report-identical-files report when two files are the same" +msgstr "" +" . -s --report-identical-files" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" + +#: src/diff.c:895 +#, fuzzy +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr ". (130 \") NUM -w NUM --width=NUM" + +#: src/diff.c:896 +#, fuzzy +msgid "-e, --ed output an ed script" +msgstr " .ed -e --ed" + +#: src/diff.c:897 +#, fuzzy +msgid "-n, --rcs output an RCS format diff" +msgstr " .RCS -n --rcs" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "" + +#: src/diff.c:899 +#, fuzzy +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr ". (130 \") NUM -w NUM --width=NUM" + +#: src/diff.c:900 +#, fuzzy +msgid "" +" --left-column output only the left column of common lines" +msgstr " . , -l --left-column" + +#: src/diff.c:901 +#, fuzzy +msgid " --suppress-common-lines do not output common lines" +msgstr "" +" . -s --suppress-common-lines" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" + +#: src/diff.c:908 +#, fuzzy +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr " . TAB -t --expand-tabs" + +#: src/diff.c:909 +#, fuzzy +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr " . TAB \" -TAB -T --initial-tab" + +#: src/diff.c:910 +#, fuzzy +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr " .(8 \") NUM Tab --tabsize=NUM" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" + +#: src/diff.c:912 +#, fuzzy +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr " . `pr' -l --paginate" + +#: src/diff.c:914 +#, fuzzy +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr " . - -r --recursive" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr "" + +#: src/diff.c:916 +#, fuzzy +msgid "-N, --new-file treat absent files as empty" +msgstr " . -N --new-file" + +#: src/diff.c:917 +#, fuzzy +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +" . --unidirectional-new-file" + +#: src/diff.c:918 +#, fuzzy +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr ". --ignore-file-name-case" + +#: src/diff.c:919 +#, fuzzy +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" . --no-ignore-file-name-case" + +#: src/diff.c:920 +#, fuzzy +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr " .PAT -x PAT --exclude=PAT" + +#: src/diff.c:921 +#, fuzzy +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"FILE- -X FILE --exclude-from=FILE" + +#: src/diff.c:922 +#, fuzzy +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +" .FILE -S FILE --starting-file=FILE" + +#: src/diff.c:923 +#, fuzzy +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +". FILE1 . FILE1 --from-file=FILE1" + +#: src/diff.c:925 +#, fuzzy +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" . FILE2 .FILE2- --to-file=FILE2" + +#: src/diff.c:928 +#, fuzzy +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr ". -i --ignore-case" + +#: src/diff.c:929 +#, fuzzy +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +" . TAB -E --ignore-tab-expansion" + +#: src/diff.c:930 +#, fuzzy +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr " . -w --ignore-all-space" + +#: src/diff.c:931 +#, fuzzy +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr " . -b --ignore-space-change" + +#: src/diff.c:932 +#, fuzzy +msgid "-w, --ignore-all-space ignore all white space" +msgstr " . -w --ignore-all-space" + +#: src/diff.c:933 +#, fuzzy +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr " . -B --ignore-blank-lines" + +#: src/diff.c:934 +#, fuzzy +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +".RE -I RE --ignore-matching-lines=RE" + +#: src/diff.c:936 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr " . -a --text" + +#: src/diff.c:937 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " . CR --strip-trailing-cr" + +#: src/diff.c:939 +#, fuzzy +msgid " --binary read and write data in binary mode" +msgstr " . --binary" + +#: src/diff.c:942 +#, fuzzy +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "`#ifdef NAME'- , -D NAME --ifdef=NAME" + +#: src/diff.c:943 +#, fuzzy +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +"GFMT GTYPE ,\" --GTYPE-group-format=GFMT" + +#: src/diff.c:944 +#, fuzzy +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr " .LFMT ,\" --line-format=LFMT" + +#: src/diff.c:945 +#, fuzzy +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +".LFMT LTYPE ,\" --LTYPE-group-format=LFMT" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" + +#: src/diff.c:948 +#, fuzzy +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr " .`changed' LTYPE GTYPE .`unchanged' `new' ,`old' LTYPE" + +#: src/diff.c:949 +#, fuzzy +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" : GFMT\n" +" FILE1- %<\n" +" FILE2- %>\n" +" FILE2- FILE1- %=\n" +" LETTER printf %[-][WIDTH][.[PREC]]{doxX}LETTER\n" +" :( ) LETTER\n" +" F\n" +" L\n" +" L-F+1 = N\n" +" F-1 E\n" +" M+1 M" + +#: src/diff.c:961 +#, fuzzy +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" : LFMT\n" +" %L\n" +" %l\n" +" printf %[-][WIDTH][.[PREC]]{doxX}n" + +#: src/diff.c:965 +#, fuzzy +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" : LFMT GFMT\n" +" %% %\n" +" C %c'C'\n" +" OOO %c'\\OOO'" + +#: src/diff.c:971 +#, fuzzy +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr " . -d --minimal" + +#: src/diff.c:972 +#, fuzzy +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +". NUM --horizon-lines=NUM" + +#: src/diff.c:973 +#, fuzzy +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr " . -H --speed-large-files" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr "" + +#: src/diff.c:980 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr " . -v --version" + +#: src/diff.c:982 +#, fuzzy +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +".`FILE... DIR' `DIR FILE...' `DIR1 DIR2' `FILE1 FILE2' FILES" + +#: src/diff.c:983 +#, fuzzy +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +" .FILES ,--to-file --from-file " + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +#, fuzzy +msgid "If a FILE is '-', read standard input." +msgstr "" +" . ,`-' FILE " + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "%s [OPTION]... FILES : \n" + +#: src/diff.c:995 +#, fuzzy +msgid "Compare FILES line by line." +msgstr ". " + +#: src/diff.c:1029 +#, fuzzy, c-format +msgid "conflicting %s option value '%s'" +msgstr "%s `%s' " + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr " " + +#: src/diff.c:1058 +#, fuzzy, c-format +msgid "invalid color '%s'" +msgstr "`%s' " + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "%s- %s\n" + +#: src/diff.c:1248 +#, fuzzy +msgid "cannot compare '-' to a directory" +msgstr " `-' " + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr " -D " + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "%s- %s : -\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "%s %s- %s %s \n" + +#: src/diff.c:1370 +#, fuzzy, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr " `%s'- `%s' \n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr " %s- %s \n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +#, fuzzy +msgid "Randy Smith" +msgstr ".Randy Smith \" " + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr " " + +#: src/diff3.c:391 +#, fuzzy +msgid "'-' specified for more than one input file" +msgstr " `-' " + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr " " + +#: src/diff3.c:475 +#, fuzzy +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr " . , -A --show-all" + +#: src/diff3.c:477 +#, fuzzy +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "MYFILE YOURFILE- OLDFILE- -e --ed" + +#: src/diff3.c:479 +#, fuzzy +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +" . , -E --show-overlap" + +#: src/diff3.c:480 +#, fuzzy +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr " . -3 --easy-only" + +#: src/diff3.c:481 +#, fuzzy +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +" . -x --overlap-only" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" + +#: src/diff3.c:483 +#, fuzzy +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr " .ed `q'- `w' -i" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" + +#: src/diff3.c:488 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr " . -a --text" + +#: src/diff3.c:489 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " . CR --strip-trailing-cr" + +#: src/diff3.c:490 +#, fuzzy +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr " . TAB \" -TAB -T --initial-tab" + +#: src/diff3.c:491 +#, fuzzy +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" . PROGRAM --diff-program=PROGRAM" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr "" + +#: src/diff3.c:496 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr " . -v --version" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "%s [OPTION]... MYFILE OLDFILE YOURFILE : \n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr ". " + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "diff : " + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s \" diff :" + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "process_diff : " + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr " : " + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr " : " + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, fuzzy, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr " `%s' -" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr " : " + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr " : " + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr " " + +#: src/dir.c:156 +#, fuzzy, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "`%s'- `%s' " + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +#, fuzzy +msgid "Thomas Lord" +msgstr ".Thomas Lord \" " + +#: src/sdiff.c:173 +#, fuzzy +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr " .FILE- , -o FILE --output=FILE" + +#: src/sdiff.c:175 +#, fuzzy +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr " . -i --ignore-case" + +#: src/sdiff.c:176 +#, fuzzy +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +" . TAB -E --ignore-tab-expansion" + +#: src/sdiff.c:177 +#, fuzzy +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr " . -w --ignore-all-space" + +#: src/sdiff.c:178 +#, fuzzy +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr " . -b --ignore-space-change" + +#: src/sdiff.c:179 +#, fuzzy +msgid "-W, --ignore-all-space ignore all white space" +msgstr " . -W --ignore-all-space" + +#: src/sdiff.c:180 +#, fuzzy +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr " . -B --ignore-blank-lines" + +#: src/sdiff.c:181 +#, fuzzy +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +".RE -I RE --ignore-matching-lines=RE" + +#: src/sdiff.c:182 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " . CR --strip-trailing-cr" + +#: src/sdiff.c:183 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr " . -a --text" + +#: src/sdiff.c:185 +#, fuzzy +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr ". (130 \") NUM -w NUM --width=NUM" + +#: src/sdiff.c:186 +#, fuzzy +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr " . , -l --left-column" + +#: src/sdiff.c:187 +#, fuzzy +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "" +" . -s --suppress-common-lines" + +#: src/sdiff.c:189 +#, fuzzy +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr " . TAB -t --expand-tabs" + +#: src/sdiff.c:190 +#, fuzzy +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr " .(8 \") NUM Tab --tabsize=NUM" + +#: src/sdiff.c:192 +#, fuzzy +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr " . -d --minimal" + +#: src/sdiff.c:193 +#, fuzzy +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr " . -H --speed-large-files" + +#: src/sdiff.c:194 +#, fuzzy +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" . PROGRAM --diff-program=PROGRAM" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr "" + +#: src/sdiff.c:197 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr " . -v --version" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "%s [OPTION]... FILE1 FILE2 : \n" + +#: src/sdiff.c:208 +#, fuzzy +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr ". " + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr " " + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr " " + +#: src/sdiff.c:818 +#, fuzzy +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed -- , ,\n" +"eb -- ,\n" +"el -- ,\n" +"er -- ,\n" +"e -- \n" +"l -- \n" +"r -- \n" +"s -- \n" +"v -- \n" +"q -- \n" + +#: src/util.c:662 +#, fuzzy, c-format +msgid "unrecognized prefix: %s" +msgstr "%s `--%s' - \n" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "" + +#, fuzzy +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s `--%s' \n" + +#, fuzzy +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s `--%s' - \n" + +#, fuzzy +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s - `-W %s' \n" + +#, fuzzy +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s `-W %s' \n" + +#, fuzzy +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s `%s' \n" + +#~ msgid "%s: illegal option -- %c\n" +#~ msgstr "%s: - -- %c\n" + +#~ msgid "" +#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n" +#~ "You may redistribute copies of this program\n" +#~ "under the terms of the GNU General Public License.\n" +#~ "For more information about these matters, see the files named COPYING." +#~ msgstr "" +#~ " . , \n" +#~ ".GNU General Public License \n" +#~ " .COPYING , " + +#~ msgid "Written by Torbjorn Granlund and David MacKenzie." +#~ msgstr ".David MacKenzie- Torbjorn Granlund \" " + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "" +#~ " -i N1:N2\n" +#~ " --ignore-initial=N1:N2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr " . ; -s --quiet --silent" + +#~ msgid "--help Output this help." +#~ msgstr " . --help" + +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>." +#~ msgstr ".<bug-gnu-utils@gnu.org> " + +#~ msgid "" +#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman, and Len Tower." +#~ msgstr "" +#~ " ,David Hayes ,Mike Haertel ,Paul Eggert \" " +#~ "\n" +#~ " .Len Tower- ,Richard " +#~ "Stallman" + +#~ msgid "`-%ld' option is obsolete; use `-%c %ld'" +#~ msgstr " `-%ld' `-%c %ld'- " + +#~ msgid "`-%ld' option is obsolete; omit it" +#~ msgstr " `-%ld'- " + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ " . (3 :\") NUM -c -C NUM --context[=NUM]\n" +#~ " . (3 :\") NUM -u -U NUM --unified[=NUM]\n" +#~ " . LABEL- --label LABEL\n" +#~ " . C -p --show-c-function\n" +#~ " .RE -F RE --show-function-" +#~ "line=RE" + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ " . -y --side-by-side\n" +#~ " . (130 :\") NUM- -W NUM --width=NUM\n" +#~ " . , --left-column\n" +#~ " . --suppress-common-lines" + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "" +#~ " . --speed-large-files" + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr " . -X" + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr " .(-A \") ed -m --merge" + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "" +#~ " . LABEL- -L LABEL --" +#~ "label=LABEL" + +#~ msgid "subsidiary program `%s' failed" +#~ msgstr "`%s' - " + +#~ msgid "subsidiary program `%s' not executable" +#~ msgstr " `%s' -" diff --git a/local/recipes/tools/diffutils/source/po/hr.gmo b/local/recipes/tools/diffutils/source/po/hr.gmo new file mode 100644 index 0000000000..4af7364c14 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/hr.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/hr.po b/local/recipes/tools/diffutils/source/po/hr.po new file mode 100644 index 0000000000..711ca26ac0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/hr.po @@ -0,0 +1,1413 @@ +# Translation of diffutils to Croatian. +# Copyright © 2012 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Tomislav Krznar <tomislav.krznar@gmail.com>, 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU diffutils 3.3-pre1\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2012-12-21 00:37+0100\n" +"Last-Translator: Tomislav Krznar <tomislav.krznar@gmail.com>\n" +"Language-Team: Croatian <lokalizacija@linux.hr>\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Gtranslator 2.91.5\n" + +#: lib/argmatch.c:134 +#, fuzzy, c-format +msgid "invalid argument %s for %s" +msgstr "neispravan %s%s argument „%s”" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "" + +#: lib/argmatch.c:154 +#, fuzzy +msgid "Valid arguments are:" +msgstr "neispravan %s%s argument „%s”" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "programska greška" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "preljev stoga" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Nepoznata greška sustava" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "obična prazna datoteka" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "obična datoteka" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "direktorij" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "simbolička veza" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "red poruka" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "semafor" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "dijeljeni memorijski objekt" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "tipizirani memorijski objekt" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "posebna blokovska datoteka" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "posebna znakovna datoteka" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "" + +#: lib/file-type.c:81 +#, fuzzy +msgid "multiplexed block special file" +msgstr "posebna blokovska datoteka" + +#: lib/file-type.c:84 +#, fuzzy +msgid "multiplexed character special file" +msgstr "posebna znakovna datoteka" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "" + +#: lib/file-type.c:90 +#, fuzzy +msgid "named file" +msgstr "čudna datoteka" + +#: lib/file-type.c:93 +#, fuzzy +msgid "network special file" +msgstr "posebna blokovska datoteka" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "" + +#: lib/file-type.c:102 +msgid "port" +msgstr "" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "utičnica" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "čudna datoteka" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: opcija „-W %s” je višeznačna\n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: opcija „%s” je višeznačna, mogućnosti:" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: neprepoznata opcija „%c%s”\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: opcija „%c%s” ne dozvoljava argument\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: opcija „--%s” zahtijeva argument\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: neispravna opcija -- „%c”\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: opcija zahtijeva argument -- „%c”\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "„" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "”" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Uspjeh" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Nema poklapanja" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Neispravan regularni izraz" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Neispravan znak razvrstavanja" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Neispravno ime razreda znakova" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Obrnuta kosa crta na kraju" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Neispravna povratna referenca" + +#: lib/regcomp.c:156 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Neuparena [ ili [^" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Neuparena ( ili \\(" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Neuparena \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Neispravan sadržaj \\{\\}" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Neispravan kraj raspona" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Memorija iscrpljena" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Neispravan prethodni regularni izraz" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Preuranjen kraj regularnog izraza" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Regularni izraz je prevelik" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Neuparena ) ili \\)" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Nedostaje prethodni regularni izraz" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "memorija iscrpljena" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "standardni ulaz" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "standardni izlaz" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "standardni izlaz za greške" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "nepoznat tok podataka" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "nisam uspio ponovo otvoriti %s s modom %s" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "neispravan %s%s argument „%s”" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "neispravan sufiks u %s%s argumentu „%s”" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "%s%s argument „%s” je prevelik" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Pakirao %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Pakirao %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Licenca GPLv3+: GNU GPL inačica 3 ili novija <http://gnu.org/licenses/gpl." +"html>.\n" +"Ovo je slobodan softver: slobodno ga smijete mijenjati i dijeliti.\n" +"NEMA JAMSTAVA, do krajnje mjere dozvoljene zakonom.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Napisao %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Napisali %s i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Napisali %s, %s i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Napisali %s, %s, %s\n" +"i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Napisali %s, %s, %s,\n" +"%s i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Napisali %s, %s, %s,\n" +"%s, %s i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Napisali %s, %s, %s,\n" +"%s, %s, %s i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Napisali %s, %s, %s,\n" +"%s, %s, %s, %s\n" +"i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Napisali %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Napisali %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s i ostali.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Prijavite greške na %s.\n" +"Prijavite greške prijevoda na <lokalizacija@linux.hr>.\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Prijavite %s greške na %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s početna stranica: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "%s početna stranica: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"Općenita pomoć za korištenje GNU softvera: <http://www.gnu.org/gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Datoteke %s i %s se razlikuju\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Binarne datoteke %s i %s se razlikuju\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Nema novog retka na kraju datoteke" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Pokušajte „%s --help” za više informacija." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "neispravna --ignore-initial vrijednost „%s”" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "opcije -l i -s nisu kompatibilne" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "pisanje nije uspjelo" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "standardni izlaz" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b, --print-bytes ispiši bajtove koji se razlikuju" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i, --ignore-initial=BROJ preskoči prvih BROJ bajtova oba ulaza" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=BROJ1:BROJ2 preskoči prvih BROJ1 bajtova DATOTEKE1\n" +" i prvih BROJ2 bajtova DATOTEKE2" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l, --verbose ispiši brojeve i vrijednosti bajtova koji se " +"razlikuju" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=BROJ usporedi najviše BROJ bajtova" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent izostavi sav normalan izlaz" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help prikaži ovu pomoć i izađi" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v, --version ispiši informacije o inačici i izađi" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Uporaba: %s [OPCIJA]... DATOTEKA1 [DATOTEKA2 [BROJ1 [BROJ2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Usporedi dvije datoteke bajt po bajt." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Obavezni argumenti dugačkih opcija također su obavezni i za kratke opcije.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Ako DATOTEKA nije navedena ili je „-”, čitaj standardni ulaz." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"Izlazno stanje je 0 ako su ulazi jednaki, 1 ako se razlikuju, 2 u slučaju " +"greške." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "neispravna --bytes vrijednost „%s”" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "nedostaje operand nakon „%s”" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "operand viška „%s”" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "" + +#: src/cmp.c:571 +#, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "" + +#: src/cmp.c:585 +#, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "" + +#: src/cmp.c:586 +#, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "" + +#: src/cmp.c:592 +#, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "neispravna duljina sadržaja „%s”" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "straničenje nije podržano na ovom računalu" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "previše opcija oznaka datoteka" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "neispravna širina „%s”" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "konfliktne opcije širine" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "neispravna duljina sadržaja „%s”" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "neispravna širina „%s”" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "konfliktne opcije širine" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr " --normal ispiši normalnu razliku (zadano)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "-q, --brief izvještaj samo kad se datoteke razlikuju" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s, --report-identical-files izvještaj samo kad su datoteke jednake" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed ispiši ed skriptu" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n, --rcs ispiši razliku u RCS obliku" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side ispiši u dva stupca" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr "" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs pretvori tabulatore u praznine u izlazu" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference ne slijedi simboličke veze" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "" +"-N, --new-file postupaj s odsutnim datotekama kao s praznim" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case zanemari veličinu slova pri uspoređivanju " +"imena datoteka" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case ne zanemaruj veličinu slova pri " +"uspoređivanju imena datoteka" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "" +"-a, --text postupaj sa svim datotekama kao s tekstualnim" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr " --binary čitaj i piši podatke u binarnom načinu" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help prikaži ovu pomoć i izađi" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version ispiši informacije o inačici i izađi" + +#: src/diff.c:982 +#, fuzzy +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"DATOTEKE su „DATOTEKA1 DATOTEKA2”, „DIR1 DIR2”, „DIR DATOTEKA...” ili " +"„DATOTEKA... DIR”." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Ako je DATOTEKA „-”, čitaj standardni ulaz." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Uporaba: %s [OPCIJA]... DATOTEKE\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Usporedi DATOTEKE redak po redak." + +# Ovdje trebam zamijeniti poredak... Pogledati kako se to radi. +#: src/diff.c:1029 +#, fuzzy, c-format +msgid "conflicting %s option value '%s'" +msgstr "konfliktna vrijednost „%s” opcije „%s”" + +# Notes: +# Add Note +# +# Format: +# C +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "konfliktne opcije izlaznog stila" + +#: src/diff.c:1058 +#, fuzzy, c-format +msgid "invalid color '%s'" +msgstr "neispravna širina „%s”" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Samo u %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "ne mogu usporediti „-” s direktorijem" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "opcija -D nije podržana s direktorijima" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Uobičajeni poddirektoriji: %s i %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Datoteka %s je %s, a datoteka %s je %s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Simboličke veze %s i %s se razlikuju\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Datoteke %s i %s su identične\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "nekompatibilne opcije" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "„-” je navedeno za više od jedne ulazne datoteke" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "čitanje nije uspjelo" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "" +"-a, --text postupaj sa svim datotekama kao s tekstualnim" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help prikaži ovu pomoć i izađi" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version ispiši informacije o inačici i izađi" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Usporedi tri datoteke redak po redak." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "Izlazno stanje je 0 za uspjeh, 1 za neuspjeh, 2 u slučaju greške." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff nije uspio: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "interna greška: neispravna diff vrsta u process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "neispravan diff oblik, nepotpun posljednji redak" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "podređeni program „%s” se ne može pozvati" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "ulazna datoteka se smanjila" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "ne mogu usporediti imena datoteka „%s” i „%s”" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: rekurzivna petlja direktorija" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "" +"-a, --text postupaj sa svim datotekama kao s tekstualnim" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs pretvori tabulatore u praznine u izlazu" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help prikaži ovu pomoć i izađi" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v, --version ispiši informacije o inačici i izađi" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Uporaba: %s [OPCIJA]... DATOTEKA1 DATOTEKA2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "" + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "ne mogu interaktivno spojiti standardni ulaz" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "obje datoteke za usporedbu su direktoriji" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" + +#: src/util.c:662 +#, fuzzy, c-format +msgid "unrecognized prefix: %s" +msgstr "%s: neprepoznata opcija „--%s”\n" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "" + +#, fuzzy +#~ msgid " or 'auto' (the default)" +#~ msgstr " --normal ispiši normalnu razliku (zadano)" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: opcija „--%s” ne dozvoljava argument\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: neprepoznata opcija „--%s”\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: opcija „-W %s” je višeznačna\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: opcija „-W %s” ne dozvoljava argument\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: opcija „-W %s” zahtijeva argument\n" diff --git a/local/recipes/tools/diffutils/source/po/hu.gmo b/local/recipes/tools/diffutils/source/po/hu.gmo new file mode 100644 index 0000000000..2877153323 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/hu.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/hu.po b/local/recipes/tools/diffutils/source/po/hu.po new file mode 100644 index 0000000000..dfa19295b1 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/hu.po @@ -0,0 +1,1554 @@ +# Hungarian traslation for diffutils. +# Copyright (C) 2002, 2014 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# +# +# Gábor István <stive@mezobereny.hu>, 2002. +# Andras Timar <timar@fsf.hu>, 2004. +# Balázs Úr <urbalazs@gmail.com>, 2014. +msgid "" +msgstr "" +"Project-Id-Version: diffutils 3.3-pre1\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2014-07-13 22:01+0200\n" +"Last-Translator: Balázs Úr <urbalazs@gmail.com>\n" +"Language-Team: Hungarian <translation-team-hu@lists.sourceforge.net>\n" +"Language: hu\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Lokalize 1.5\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: lib/argmatch.c:134 +#, fuzzy, c-format +msgid "invalid argument %s for %s" +msgstr "érvénytelen %s%s argumentum: „%s”" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "" + +#: lib/argmatch.c:154 +#, fuzzy +msgid "Valid arguments are:" +msgstr "érvénytelen %s%s argumentum: „%s”" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "programhiba" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "veremtúlcsordulás" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Ismeretlen rendszerhiba" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "szabályos üres fájl" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "szabályos fájl" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "könyvtár" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "szimbolikus link" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "üzenetsor" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "szemafor" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "osztott memóriaobjektum" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "típusos memóriaobjektum" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "speciális blokkfájl" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "speciális karakterfájl" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "" + +#: lib/file-type.c:81 +#, fuzzy +msgid "multiplexed block special file" +msgstr "speciális blokkfájl" + +#: lib/file-type.c:84 +#, fuzzy +msgid "multiplexed character special file" +msgstr "speciális karakterfájl" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "" + +#: lib/file-type.c:90 +#, fuzzy +msgid "named file" +msgstr "szokatlan fájl" + +#: lib/file-type.c:93 +#, fuzzy +msgid "network special file" +msgstr "speciális blokkfájl" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "" + +#: lib/file-type.c:102 +msgid "port" +msgstr "" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "foglalat" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "szokatlan fájl" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: a „-W %s” kapcsoló nem egyértelmű\n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: a(z) „%s” kapcsoló nem egyértelmű; lehetőségek:" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: ismeretlen „%c%s” kapcsoló\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: a(z) „%c%s” kapcsoló nem enged meg argumentumot\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: a(z) „--%s” kapcsolóhoz egy argumentum szükséges\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: érvénytelen kapcsoló -- „%c”\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: a kapcsoló egy argumentumot igényel -- „%c”\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "„" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "”" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Sikerült" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Nincs találat" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Érvénytelen reguláris kifejezés" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Érvénytelen egyeztető karakter" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Érvénytelen karakterosztálynév" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Záró visszaper" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Érvénytelen visszahivatkozás" + +#: lib/regcomp.c:156 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Pár nélküli [ vagy [^" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Pár nélküli ( vagy \\(" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Pár nélküli \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "A \\{\\} tartalma érvénytelen" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Érvénytelen tartományvég" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Elfogyott a memória" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Érvénytelen megelőző reguláris kifejezés" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "A reguláris kifejezés túl korán véget ért" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "A reguláris kifejezés túl nagy" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Pár nélküli ) vagy \\)" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Nincs megelőző reguláris kifejezés" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "elfogyott a memória" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "szabványos bemenet" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "szabványos kimenet" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "szabványos hibakimenet" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "ismeretlen adatfolyam" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "%s újranyitása %s móddal meghiúsult" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "érvénytelen %s%s argumentum: „%s”" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "érvénytelen utótag a(z) %s%s argumentumban: „%s”" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "%s%s: a(z) „%s” argumentum túl nagy" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Csomagolta: %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Csomagolta: %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"A licenc GPLv3+: a GNU GPL 3. vagy újabb változata <http://gnu.org/licenses/" +"gpl.html>\n" +"Ez egy szabad szoftver, terjesztheti és/vagy módosíthatja.\n" +"NINCS GARANCIA, a törvény által engedélyezett mértékig.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Írta: %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Írta: %s és %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Írta: %s, %s és %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Írta: %s, %s, %s\n" +"és %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Írta: %s, %s, %s,\n" +"%s és %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Írta: %s, %s, %s,\n" +"%s, %s és %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Írta: %s, %s, %s,\n" +"%s, %s, %s és %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Írta: %s, %s, %s,\n" +"%s, %s, %s, %s\n" +"és %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Írta: %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s és %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Írta: %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s és mások.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"A hibák a(z) %s címen jelenthetők.\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "A(z) %s hibái a(z) %s címen jelenthetők.\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "A(z) %s honlapja: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "A(z) %s honlapja: <http://www.gnu.org/software/%s/>.\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"Általános segítség a GNU szoftverek használatához: <http://www.gnu.org/" +"gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "A(z) %s és a(z) %s fájlok különböznek\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "A(z) %s és a(z) %s bináris fájlok különböznek\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Nincs új sor a fájl végén" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "További információkért próbálja a(z) „%s --help” parancsot." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "érvénytelen --ignore-initial érték: „%s”" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "a -l és a -s kapcsolók összeférhetetlenek" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "az írás sikertelen" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "szabványos kimenet" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b, --print-bytes eltérő bájtok kiírása" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i, --ignore-initial=UGRÁS az első UGRÁS bájt kihagyása mindkét " +"bemeneten" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=UGRÁS1:UGRÁS2 a FÁJL1 első UGRÁS1 bájtjának és a " +"FÁJL2\n" +" első UGRÁS2 bájtjának kihagyása" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l, --verbose a bájt számok és az eltérő bájt értékek kiírása" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=KORLÁT legfeljebb KORLÁT bájt összehasonlítása" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent minden normál kimenet elfojtása" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help ezen súgó megjelenítése és kilépés" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v, --version verzióinformációk kiírása és kilépés" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Használat: %s [KAPCSOLÓ]… FÁJL1 [FÁJL2 [UGRÁS1 [UGRÁS2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Két fájl összehasonlítása bájtról bájtra." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"Az opcionális UGRÁS1 és UGRÁS2 megadja a minden egyes fájl elejéről " +"kihagyandó bájtok számát (alapértelmezetten nulla)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"A hosszú kapcsolók kötelező argumentumai a rövid kapcsolókhoz is " +"kötelezőek.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"Az UGRÁS értékek után a következő szorzóutótagokat lehet írni:\n" +"kB 1000, K 1024, MB 1.000.000, M 1.048.576,\n" +"GB 1.000.000.000, G 1.073.741.824 és így tovább: T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Ha a FÁJL a „-” vagy hiányzik, akkor a szabványos bemenetről olvas." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"A kilépési állapotkód 0, ha a bemenetek azonosak; 1, ha különbözők; 2, ha\n" +"hiba történt." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "érvénytelen --bytes érték: „%s”" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "hiányzó operandus a(z) „%s” után" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "extra operandus: „%s”" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s eltér: byte: %s, sor: %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s eltér: byte %s, sor %s %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: EOF ennél: %s\n" + +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s %s eltér: byte: %s, sor: %s\n" + +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s %s eltér: byte: %s, sor: %s\n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: EOF ennél: %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "érvénytelen környezethossz: „%s”" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "a tördelés nem támogatott ezen a gépen" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "túl sok fájlcímke-beállítás" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "érvénytelen szélesség: „%s”" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "ütköző szélességbeállítások" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "érvénytelen munkaszinthossz: „%s”" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "érvénytelen tabulátorméret: „%s”" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "ütköző tabulátorméret beállítások" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "a --from-file és a --to-file is meg van adva" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr "" +" --normal egy normál diff kimenet (az alapértelmezett)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "-q, --brief csak akkor jelent, ha a fájlok eltérnek" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s, --report-identical-files jelentés, ha a két fájl ugyanaz" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C SZÁM, --context[=SZÁM] a másolt környezet SZÁM (alapértelmezetten " +"3)\n" +" sorának kiírása" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U SZÁM, --unified[=SZÁM] a egységesített környezet SZÁM\n" +" (alapértelmezetten 3) sorának kiírása" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed egy ed parancsfájl kiírása" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n, --rcs egy RCS formátumú diff kiírása" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side kimenet két oszlopban" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=SZÁM legfeljebb SZÁM (alapértelmezetten 130)\n" +" nyomtatási oszlop kiírása" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +" --left-column a közös soroknak csak a bal oszlopának kiírása" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines ne írja ki a közös sorokat" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" +"-p, --show-c-function jelenítse meg, mely C függvényben van változás" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" +"-F, --show-function-line=RK a legutóbbi RK-ra illeszkedő sor megjelenítése" + +#: src/diff.c:905 +#, fuzzy +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label CÍMKE CÍMKE használata fájlnév helyett (ismételhető)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs tabulátorok bővítése szóközökké a kimeneten" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab beigazítja a tabulátorokat egy tabulátor\n" +" hozzáfűzésével" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=SZÁM a tabulátor megáll minden SZÁMADIK\n" +" (alapértelmezetten 8) nyomtatási oszlopnál" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty szóköz vagy tabulátor elnyomása az üres " +"kimeneti\n" +" sorok előtt" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" +"-l, --paginate kimenet átadása a „pr” parancsnak " +"lapszámozáshoz" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r, --recursive a talált alkönyvtár rekurzív összehasonlítása" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference ne kövesse a szimbolikus linkeket" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "-N, --new-file a hiányzó fájlokat üresként kezelje" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +" --unidirectional-new-file a hiányzó első fájlokat üresként kezelje" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case kis- és nagybetűk figyelmen kívül hagyása\n" +" fájlnevek összehasonlításakor" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case kis- és nagybetűk figyelembe vétele\n" +" fájlnevek összehasonlításakor" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "-x, --exclude=MINTA a MINTÁRA illeszkedő fájlok kizárása" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=FÁJL a FÁJLBAN lévő bármely mintára illeszkedő\n" +" fájlok kizárása" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=FÁJL a FÁJLLAL kezdjen könyvtárak " +"összehasonlítását" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=FÁJL1 FÁJL1 összehasonlítása minden operandussal;\n" +" FÁJL1 lehet könyvtár is" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=FÁJL2 minden operandus összehasonlítása FÁJL2-" +"vel;\n" +" FÁJL2 lehet könyvtár is" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i, --ignore-case kis- és nagybetű eltérések figyelmen kívül\n" +" hagyása a fájlok tartalmában" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion a tabulátorbővítés miatti változások " +"mellőzése" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space a sorvégi üres helyek mellőzése" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change üres helyek számában lévő változások " +"mellőzése" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space minden üres hely mellőzése" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B, --ignore-blank-lines változások mellőzése, ahol a sorok üresek" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RK változások mellőzése, ahol minden sor\n" +" illeszkedik az RK-ra" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text az összes fájl szövegként kezelése" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr a záró kocsi vissza levágása a bemenetről" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr " --binary adatok olvasása és írása bináris módon" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=NÉV egyesített fájlkiírás a „#ifdef NÉV” diffs\n" +" használatával" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +" --GTYPE-group-format=GFMT a GTYPE bemeneti csoportok formázása GFMT-vel" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr " --line-format=LFMT minden bemeneti sor formázása LFMT-vel" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +" --LTYPE-line-format=LFMT az LTYPE bemeneti sorok formázása LFMT-vel" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" Ezek a formázási lehetőségek részletes vezérlést biztosítanak a diff\n" +" kimenetén, általánosítva: -D/--ifdef." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" Az LTYPE „old”, „new” vagy „unchanged”. A GTYPE értéke LTYPE vagy " +"„changed”." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" A GFMT (csak) a következőket tartalmazhatja:\n" +" %< FÁJL1 sorai\n" +" %> FÁJL2 sorai\n" +" %= FÁJL1 és FÁJL2 közös sorai\n" +" %[-][SZÉLESSÉG][.[PONTOSSÁG]]{doxX}BETŰ a BETŰ printf-stílusú megadása\n" +" a BETŰK a következők lehetnek az új csoporthoz, kisbetűsek a régi\n" +" csoporthoz:\n" +" F első sor száma\n" +" L utolsó sor száma\n" +" N sorok száma = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) ha A egyenlő B, akkor T, egyébként E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" Az LFMT (csak) a következőket tartalmazhatja:\n" +" %L a sor tartalma\n" +" %l a sor tartalma, kivéve bármilyen záró üres karaktert\n" +" %[-][SZÉLESSÉG][.[PONTOSSÁG]]{doxX}n printf-stílusú megadás a bemeneti\n" +" sor számához" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" A GFMT és az LFMT is tartalmazhatja:\n" +" %% %\n" +" %c'C' az önálló C karakter\n" +" %c'\\OOO' a OOO oktális kódú karakter\n" +" C a C karakter (más karakterek saját magukat ábrázolják)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d, --minimal igyekszik egy kisebb változási halmazt megtalálni" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +" --horizon-lines=SZÁM a közös előtag és utótag SZÁM sorának megtartása" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files nagy fájlokat és sok apró kis változást tételez fel" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help ezen súgó megjelenítése és kilépés" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version verzióinformációk kiírása és kilépés" + +#: src/diff.c:982 +#, fuzzy +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"A FÁJLOK az alábbiak lehetnek „FÁJL1 FÁJL2” vagy „KÖNYVTÁR1 KÖNYVTÁR2” vagy\n" +"„KÖNYVTÁR FÁJL…” vagy „FÁJL… KÖNYVTÁR”." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Ha a --from-file vagy a --to-file meg van adva, akkor nincsenek " +"megszorítások\n" +"a FÁJLOKRA." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Ha a FÁJL a „-”, akkor a szabványos bemenetről olvas." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Használat: %s [KAPCSOLÓ]… FÁJLOK\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "FÁJLOK összehasonlítása sorról sorra." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "ütköző %s kapcsoló érték: „%s”" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "ütköző kimeneti stílus kapcsolók" + +#: src/diff.c:1058 +#, fuzzy, c-format +msgid "invalid color '%s'" +msgstr "érvénytelen szélesség: „%s”" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Csak ebben: %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "a „-” nem hasonlítható össze egy könyvtárral" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "A -D kapcsoló könyvtáraknál nem támogatott" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Közös alkönyvtárak: %s és %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "A(z) %s fájl egy %s, viszont a(z) %s fájl egy %s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "A(z) %s és a(z) %s szimbolikus linkek különböznek\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "A(z) %s és a(z) %s fájlok azonosak\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "összeférhetetlen kapcsolók" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "a „-” több mint egy bemeneti fájlhoz lett megadva" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "olvasás sikertelen" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A, --show-all minden változás kiírása, zárójelbe téve az\n" +" ütközéseket" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed egy ed parancsfájlt ír ki, amely a SAJÁTFÁJLBAN\n" +" tartalmazza a RÉGIFÁJL és ÖNFÁJLJA " +"változásait" + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +"-E, --show-overlap mint a -e, de zárójelbe teszi az ütközéseket" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3, --easy-only mint a -e, de csak a nem átfedő változásokat\n" +" tartalmazza" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +"-x, --overlap-only mint a -e, de csak az átfedő változásokat\n" +" tartalmazza" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" +"-X mint a -x, de zárójelbe teszi az ütközéseket" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "" +"-i „w” és „q” parancsok hozzáfűzése az ed\n" +" parancsfájlokhoz" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge az aktuális egyesített fájl kiírása a -A " +"szerint,\n" +" ha más kapcsoló nincs megadva" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text az összes fájl szövegként kezelése" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr a záró kocsi vissza levágása a bemenetről" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab beigazítja a tabulátorokat egy tabulátor\n" +" hozzáfűzésével" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=PROGRAM a PROGRAM használata fájlok összehasonlításához" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=CÍMKE CÍMKE használata fájlnév helyett\n" +" (legfeljebb háromszor ismételhető)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help ezen súgó megjelenítése és kilépés" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version verzióinformációk kiírása és kilépés" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Használat: %s [KAPCSOLÓ]… SAJÁTFÁJL RÉGIFÁJL ÖNFÁJLJA\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Három fájl összehasonlítása sorról sorra." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"Az alapértelmezett kimeneti formátum a változásoknak az ember által kevésbé\n" +"olvasható ábrázolása.\n" +"\n" +"A -e, -E, -x, -X (és a megfelelő hosszú) kapcsolók egy ed parancsfájlt " +"idéznek\n" +"elő az alapértelmezett kimenet helyett.\n" +"\n" +"Végül a -m (--merge) kapcsoló diff3 formátumot hoz létre az egyesítés\n" +"belsőleg történő elvégzéséhez, és az aktuális egyesített fájlt írja ki.\n" +"Szokatlan bemenethez ez sokkal erőteljesebb az ed használatánál.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"A kilépési állapotkód 0, ha sikeres; 1, ha ütközés van; 2, ha hiba történt." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "belső hiba: zűrzavar az összehasonlítási blokkok formátumában" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: összehasonlítás sikertelen: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "" +"belső hiba: érvénytelen összehasonlítási típus a process_diff függvényben" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "érvénytelen összehasonlítási formátum; érvénytelen változáselválasztó" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "érvénytelen összehasonlítási formátum; befejezetlen utolsó sor" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "a(z) „%s” kisegítő programot nem sikerült meghívni" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "érvénytelen összehasonlítási formátum; helytelen sor eleji karakterek" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "belső hiba: érvénytelen összehasonlítási típus lett átadva kimenetnek" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "a bementi fájl összement" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "nem sikerült a(z) „%s” és a(z) „%s” fájlneveket összehasonlítani" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: rekurzív könyvtárhurok" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o, --output=FÁJL interaktív működés, kimenet küldése FÁJLBA" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i, --ignore-case a kis- és nagybetűket azonosnak tekinti" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion a tabulátorbővítés miatti változások mellőzése" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space a sorvégi üres helyek mellőzése" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change üres helyek számában lévő változások mellőzése" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space minden üres hely mellőzése" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "-B, --ignore-blank-lines változások mellőzése, ahol a sorok üresek" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RK változások mellőzése, ahol minden sor\n" +" illeszkedik az RK-ra" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr a záró kocsi vissza levágása a bemenetről" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a, --text az összes fájl szövegként kezelése" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=SZÁM legfeljebb SZÁM (alapértelmezetten 130)\n" +" nyomtatási oszlop kiírása" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" +"-l, --left-column a közös soroknak csak a bal oszlopának kiírása" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines ne írja ki a közös sorokat" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs tabulátorok bővítése szóközökké a kimeneten" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +" --tabsize=SZÁM a tabulátor megáll minden SZÁMADIK\n" +" (alapértelmezetten 8) nyomtatási oszlopnál" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d, --minimal igyekszik egy kisebb változási halmazt " +"megtalálni" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files nagy fájlokat, sok apró kis változást tételez " +"fel" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=PROGRAM a PROGRAM használata fájlok összehasonlításához" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help ezen súgó megjelenítése és kilépés" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v, --version verzióinformációk kiírása és kilépés" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Használat: %s [KAPCSOLÓ]… FÁJL1 FÁJL2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "A FÁJL1 és FÁJL2 közötti különbségek egymás melletti egyesítése." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "nem sikerült interaktívan egyesíteni a szabványos bemenetet" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "mindkét összehasonlítandó fájl könyvtár" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tSzerkesztés, majd mindkét változat használata fejlécekkel díszítve.\n" +"eb:\tSzerkesztés, majd mindkét változat használata.\n" +"el vagy e1:\tSzerkesztés, majd a bal oldali változat használata.\n" +"er vagy e2:\tSzerkesztés, majd a jobb oldali változat használata.\n" +"e:\tMindkét változat eldobása, majd az új szerkesztése.\n" +"l vagy 1:\tA bal oldali változat használata.\n" +"r vagy 2:\tA jobb oldali változat használata.\n" +"s:\tA közös sorok felvétele csendben.\n" +"v:\tA közös sorok felvétele bőbeszédűen.\n" +"q:\tKilépés.\n" + +#: src/util.c:662 +#, fuzzy, c-format +msgid "unrecognized prefix: %s" +msgstr "%s: ismeretlen „--%s” kapcsoló\n" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "" + +#, fuzzy +#~ msgid " or 'auto' (the default)" +#~ msgstr "" +#~ " --normal egy normál diff kimenet (az alapértelmezett)" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: a(z) „--%s” kapcsoló nem enged meg argumentumot\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: ismeretlen „--%s” kapcsoló\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: a „-W %s” kapcsoló nem egyértelmű\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: a „-W %s” kapcsoló nem enged meg argumentumot\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: a „-W %s” kapcsolóhoz egy argumentum szükséges\n" diff --git a/local/recipes/tools/diffutils/source/po/id.gmo b/local/recipes/tools/diffutils/source/po/id.gmo new file mode 100644 index 0000000000..2b0ce32c00 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/id.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/id.po b/local/recipes/tools/diffutils/source/po/id.po new file mode 100644 index 0000000000..bc4fa12939 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/id.po @@ -0,0 +1,1588 @@ +# Pesan bahasa indonesia untuk diffutils +# Copyright (C) 2002 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Tedi Heriyanto <tedi_h@gmx.net>, 2002. +# Arif E. Nugroho <arif_endro@yahoo.com>, 2008, 2009, 2010, 2011, 2012, 2013, 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: diffutils 3.3-pre1\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2014-08-03 08:00+0700\n" +"Last-Translator: Arif E. Nugroho <arif_endro@yahoo.com>\n" +"Language-Team: Indonesian <translation-team-id@lists.sourceforge.net>\n" +"Language: id\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: lib/argmatch.c:134 +#, fuzzy, c-format +msgid "invalid argument %s for %s" +msgstr "argumen %s%s tidak valid '%s'" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "" + +#: lib/argmatch.c:154 +#, fuzzy +msgid "Valid arguments are:" +msgstr "argumen %s%s tidak valid '%s'" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "kesalahan program" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "overflow stack" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Kesalahan sistem tidak dikenal" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "berkas reguler kosong" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "berkas reguler" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "direktori" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "link simbolik" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "antrian pesan" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "semaphore" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "objek memori bersama" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "tipe objek memori" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "berkas blok spesial" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "berkas karakter spesial" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "" + +#: lib/file-type.c:81 +#, fuzzy +msgid "multiplexed block special file" +msgstr "berkas blok spesial" + +#: lib/file-type.c:84 +#, fuzzy +msgid "multiplexed character special file" +msgstr "berkas karakter spesial" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "" + +#: lib/file-type.c:90 +#, fuzzy +msgid "named file" +msgstr "berkas aneh" + +#: lib/file-type.c:93 +#, fuzzy +msgid "network special file" +msgstr "berkas blok spesial" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "" + +#: lib/file-type.c:102 +msgid "port" +msgstr "" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "soket" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "berkas aneh" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: pilihan '-W %s' ambigu\n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: pilihan '%s' ambigu" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: pilihan '%c%s' tidak dikenal\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: pilihan '%c%s' tidak mengijinkan sebuah argumen\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: pilihan '--%s' membutuhkan sebuah argumen\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: pilihan -- '%c' tidak valid\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: pilihan -- '%c' membutuhkan sebuah argumen\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "`" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "'" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Sukses" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Tidak cocok" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Ekspresi reguler tidak valid" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Karakter kolasi tidak valid" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Nama kelas karakter tidak valid" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Akhiran backslash" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Referensi balik tidak valid" + +#: lib/regcomp.c:156 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Tidak cocok [ atau [^" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Tidak cocok ( atau \\(" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Tidak cocok \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Isi dari \\{\\} tidak valid" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Batas akhir tidak valid" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Kehabisan memori" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Ekspresi reguler yang mengawali tidak valid" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Ekspresi reguler berakhir dengan prematur" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Ekspresi reguler terlalu besar" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Tidak cocok ) atau \\)" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Tidak ada ekspresi reguler sebelumnya" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "kehabisan memori" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "stdin" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "stdout" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "stderr" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "aliran tidak dikenal" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "gagal untuk membuka kembali %s dengan mode %s" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "argumen %s%s tidak valid '%s'" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "akhiran dalam argumen %s%s tidak valid '%s'" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "%s%s argumen '%s' terlalu besar" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Dibungkus oleh %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Dibungkus oleh %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "(C)" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Lisensi GPLv3+: GNU GPL versi 3 atau selanjutnya <http://gnu.org/licenses/" +"gpl.html>.\n" +"Ini adalah perangkat lunak bebas: anda bebas untuk mengubah dan " +"mendistribusikannya.\n" +"Tidak ada JAMINAN APAPUN, sepanjang masih diijinkan oleh hukum yang " +"berlaku.\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Ditulis oleh %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Ditulis oleh %s dan %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Ditulis oleh %s, %s, dan %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Ditulias oleh %s, %s, %s,\n" +"dan %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Ditulis oleh %s, %s, %s,\n" +"%s, dan %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Ditulis oleh %s, %s, %s,\n" +"%s, %s, dan %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Ditulis oleh %s, %s, %s,\n" +"%s, %s, %s, dan %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Ditulis oleh %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"dan %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Ditulis oleh %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, dan %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Ditulis oleh %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, dan yang lainnya.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Laporkan bugs ke: %s\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Laporkan %s bugs ke: %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s halaman rumah: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "%s halaman rumah: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"Bantuan umum menggunakan perangkat lunak GNU: <http://www.gnu.org/gethelp>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Berkas %s dan %s berbeda\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "File biner %s dan %s berbeda\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Tidak ada baris-baru di akhir dari berkas" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Coba '%s --help' untuk informasi lebih lanjut." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "tidak valid --ignore-initial nilai '%s'" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "pilihan -l dan -s tidak kompatibel" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "gagal menulis" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "standar keluaran" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b, --print-bytes Tampilkan byte yang berbeda." + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "-i, --ignore-initial=SKIP Lewati SKIP byte pertama dari masukan." + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=SKIP1:SKIP2 Lewati SKIP1 byte pertama FILE1 dan SKIP2 " +"byte pertama FILE2.\n" +" first SKIP2 bytes of FILE2" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l, --verbose Keluarkan jumlah byte dan nilai semua byte yang berbeda." + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=LIMIT Bandingkan paling banyak LIMIT byte." + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent suppress all normal output" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help display this help and exit" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v, --version Tampilkan informasi versi." + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Penggunaan: %s [PILIHAN]... BERKAS1 [BERKAS2 [SKIP1 [SKIP2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Bandingkan dua file byte per byte" + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"SKIP1 dan SKIP2 adalah jumlah byte yang harus dilewati di tiap file.\n" +"at the beginning of each file (zero by default)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Mandatory arguments to long options are mandatory for short options too.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"Nilai SKIP dapat diikuti oleh suffiks perkalian berikut:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, dan seterusnya untuk T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Jika sebuah FILE adalah '-' atau tidak ada, baca input standar" + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"Status keluar adalah 0 jika masukan sama, 1 jika berbeda, 2 jika bermasalah." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "nilai --byte tidak valid '%s'" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "tidak ada operand setelah '%s'" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "operand ekstra '%s'" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s berbeda: byte %s, baris %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s berbeda: byte %s, baris %s adalah %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: EOF pada %s\n" + +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s %s berbeda: byte %s, baris %s\n" + +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s %s berbeda: byte %s, baris %s\n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: EOF pada %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "panjang context tidak valid '%s'" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "paginasi tidak didukung pada host ini" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "terlalu banyak option label file" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "lebar tidak valid '%s'" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "option lebar konflik" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "panjang horizon tidak valid '%s'" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "tabsize tidak valid '%s'" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "option tabsize konflik" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "--from-file dan --to-file keduanya disebutkan" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr "--normal Output normal diff." + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "-q, --brief Tampilkan hanya apakah file berbeda." + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s, --report-identical-files Laporkan ketika dua file sama." + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-w, NUM --width=NUM Output paling banyak NUM (baku 130) kolom cetakan." + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed Output adalah script ed." + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n, --rcs Output dalam format RCS diff." + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side output in two columns" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "-W, --width=NUM Output paling banyak NUM (baku 130) kolom cetakan." + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr " --left-column Hanya tampilkan kolom kiri baris yang sama." + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines Jangan tampilkan baris yang sama." + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "-p, --show-c-function show which C function each change is in" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "-F, --show-function-line=RE show the most recent line matching RE" + +#: src/diff.c:905 +#, fuzzy +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label LABEL use LABEL instead of file name\n" +" (can be repeated)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs Ekspansi tab ke spasi dalam output." + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T, --initial-tab Buat tab beraturan dg menambahkan sebuah tab." + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "--tabsize=NUM Tab stop adalah setiap NUM (default 8) kolom cetakan." + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +"--suppress-blank-empty Tekan spasi atau tab sebelum mengeluarkan baris " +"kosong." + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "-l, --paginate Berikan output ke `pr' untuk di-paginate." + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "-r, --recursive Membandingkan subdirektori secara rekursif." + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference don't follow symbolic links" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "-N, --new-file Perlakukan tiada file sebagai kosong." + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +"--unidirectional-new-file Anggap file tidak ada pertama sebagai kosong." + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "--ignore-file-name-case Abaikan case saat membandingkan nama file." + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +"--no-ignore-file-name-case Pertimbangkan case saat membandingkan nama file." + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "-x, --exclude=PAT Tanpa file yang cocok dengan PAT." + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=FILE Abaikan file yang cocok dengan pola dalam FILE" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=FILE Mulai dengan FILE ketika membandingkan direktori." + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +"--from-file=FILE1 Bandingkan FILE1 ke semua operand. FILE1 dapat berupa " +"direktori.\n" +" FILE1 can be a directory" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +"--to-file=FILE2 Bandingkan semua operand dengan FILE2. FILE2 dapat berupa " +"direktori.\n" +" FILE2 can be a directory" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "-i, --ignore-case Abaikan beda case dalam isi file." + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "-E, --ignore-tab-expansion Abaikan perubahan akibat ekspansi tab." + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-all-space Abaikan seluruh white space." + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change Abaikan perubahan sejumlah white space." + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space Abaikan seluruh white space." + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "-B, --ignore-blank-lines Abaikan perubahan baris kosong." + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE Abaikan perubahan baris yang cocok dg RE." + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text Perlakukan seluruh file sebagai teks." + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "--strip-trailing-cr Hapus trailing carriage return pada input." + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr "--binary Baca dan tulis data dalam mode biner." + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=NAME Output file merge untuk tampilkan `#ifdef NAME' diffs." + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +"--GTYPE-group-format=GFMT Serupa, tapi format input kelompok GTYPE dg GFMT. " + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "--line-format=LFMT Serupa, tapi format seluruh baris input dg LFMT." + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +"--LTYPE-line-format=LFMT Serupa, tapi format baris input LTYPE dg LFMT." + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE adalah 'old', 'new', atau 'unchanged'. GTYPE adalah LTYPE atau " +"'changed'." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT dapat berisi:\n" +" %< baris dari FILE1\n" +" %> baris dari FILE2\n" +" %= baris bersama FILE1 dan FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec untuk LETTER\n" +" LETTERs adalah sebagai berikut untuk grup baru, huruf kecil untuk grup " +"tua:\n" +" F nomor baris pertama\n" +" L nomor baris terakhir\n" +" N jumlah baris = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT dapat berisi:\n" +" %L isi baris\n" +" %l isi baris, tanpa baris baru\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec untuk nomor baris input" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" GFMT atau LFMT dapat berisikan:\n" +" %% %\n" +" %c'C' karakter tunggal C\n" +" %c'\\OOO' karakter dengan kode oktal OOO" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal Usahakan mencari perubahan terkecil." + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "--horizon-lines=NUM Pertahankan NUM baris prefiks dan suffiks umum." + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files Asumsikan file besar dan banyak sebaran perubahan " +"kecil." + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help display this help and exit" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version Tampilkan informasi versi." + +#: src/diff.c:982 +#, fuzzy +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"FILES adalah 'FILE1 FILE2' atau 'DIR1 DIR2' atau 'DIR FILE...' atau 'FILE... " +"DIR'." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Bila --from-file atau --to-file diberikan, tidak ada batasan untuk FILES." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Jika sebuah file FILE adalah '-', baca standard input." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Penggunaan: %s [OPTION]... FILES\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Bandingkan file baris per baris" + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "Nilai option %s konflik dengan '%s'" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "option gaya output konflik" + +#: src/diff.c:1058 +#, fuzzy, c-format +msgid "invalid color '%s'" +msgstr "lebar tidak valid '%s'" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Hanya dalam %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "tidak dapat membandingkan '-' dg direktori" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "-D option tidak didukung dg direktori" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Subdirektori sama: %s dan %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "File %s adalah %s sementara file %s adalah %s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Berkas %s dan %s berbeda\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "File %s dan %s identik\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "option tidak kompatibel" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "'-' dispesifikasikan lebih dari satu file input" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "gagal membaca" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "-A, --show-all Output seluruh perubahan, konflik dalam tanda kurung." + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e --ed Output perubahan tanpa dimerge dari OLDFILE ke YOURFILE ke dl " +"MYFILE." + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +"-E, --show-overlap Output perubahan unmerge, konflik dl tanda kurung." + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "-3, --easy-only Output unmerged perubahan nonoverlap." + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "-x, --overlap-only Tampilkan perubahan yang overlap." + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "-X like -x, but bracket conflicts" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "-i Tambah perintah 'w' dan 'q' ke script ed." + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text Perlakukan seluruh file sebagai teks." + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "--strip-trailing-cr Hapus trailing carriage return pada input." + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T, --initial-tab Buat tab beraturan dg menambahkan sebuah tab." + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "--diff-program=PROGRAM Gunakan PROGRAM untuk membandingkan file." + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help display this help and exit" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version Tampilkan informasi versi." + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Pemakaian: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Bandingkan tiga file baris per baris." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"Status keluaran adalah 0 jika sukses, 1 jika konflik, 2 jika bermasalah." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "kesalahan internal: kacau dalam format blok diff" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff gagal: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "kesalahan internal: tipe diff tidak valid dalam process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "format diff tidak valid; separator perubahan tidak valid" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "format diff tidak valid; baris akhir tidak lengkap" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "program subsider '%s' tidak dipanggil" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "format diff tidak valid; karakter leading line tidak tepat" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "kesalahan internal: tipe diff tidak valid dimasukkan ke output" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "file input mengecil" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "tidak dapat membandingkan nama file '%s' dan '%s'" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: rekursif loop direktori" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "-o, --output=FILE Operasi secara interaktif, kirim output ke FILE." + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i, --ignore-case Abaikan huruf kapital dan huruf kecil." + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "-E, --ignore-tab-expansion Abaikan perubahan akibat ekspansi tab." + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailling-space Abaikan seluruh white space." + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change Abaikan perubahan sejumlah white space." + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W --ignore-all-space Abaikan seluruh white space." + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "-B, --ignore-blank-lines Abaikan perubahan baris kosong." + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE Abaikan perubahan baris yang cocok dg RE." + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "--strip-trailing-cr Hapus trailing carriage return pada input." + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a, --text Perlakukan seluruh file sebagai teks." + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "-w, --width=NUM Output paling banyak NUM (baku 130) kolom cetakan." + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "-l, --left-column Hanya tampilkan kolom kiri baris yang sama." + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines Jangan tampilkan baris yang sama." + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs Ekspansi tab ke spasi dalam output." + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "--tabsize=NUM Tab stop adalah setiap NUM (default 8) kolom cetakan." + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal Usahakan mencari perubahan terkecil." + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files Asumsikan file besar dan banyak sebaran perubahan " +"kecil." + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "--diff-program=PROGRAM Gunakan PROGRAM untuk membandingkan file." + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help display this help and exit" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v, --version Tampilkan informasi versi." + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Pemakaian: %s [OPTION]... FILE1 FILE2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Merge side-by-side beda file." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "tidak dapat menggabung input standar secara interaktif" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "kedua file yang dibandingkan adalah direktori" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tUbah lalu gunakan kedua versi, dekorasikan dengan header.\n" +"eb:\tUbah lalu gunakan kedua versi.\n" +"el atau e1:\tEdit lalu gunakan versi kiri.\n" +"er atau e2:\tEdit lalu gunakan versi kanan.\n" +"e:\tEdit versi baru.\n" +"l atau e1:\tGunakan versi kiri.\n" +"r atau e2:\tGunakan versi kanan.\n" +"s:\tSertakan baris bersama secara diam-diam.\n" +"v:\tSertakan baris bersama secara verbose.\n" +"q:\tKeluar.\n" + +#: src/util.c:662 +#, fuzzy, c-format +msgid "unrecognized prefix: %s" +msgstr "%s: pilihan '--%s' tidak dikenal\n" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "" + +#, fuzzy +#~ msgid " or 'auto' (the default)" +#~ msgstr "--normal Output normal diff." + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: pilihan '--%s' tidak mengijinkan sebuah argumen\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: pilihan '--%s' tidak dikenal\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: pilihan '-W %s' ambigu\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: pilihan '-W %s' tidak mengijinkan sebuah argumen\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: pilihan '-W %s' membutuhkan sebuah argumen\n" + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "" +#~ "-s --quiet --silent Tidak mengeluarkan apapun; hanya memberikan status " +#~ "keluar saja." + +#~ msgid "--help Output this help." +#~ msgstr "--help Tampilkan bantuan ini." + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ "-c -C NUM --context[=NUM] Output NUM (baku 3) baris isi yang disalin.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (baku 3) baris unified context.\n" +#~ " --label LABEL Gunakan LABEL alih-alih nama file.\n" +#~ " -p --show-c-function Tampilkan setiap fungsi C yang berubah.\n" +#~ " -F RE --show-function-line=RE Tampilkan baris paling akhir yang cocok " +#~ "dengan RE." + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ "-y --side-by-side Output dalam dua kolom.\n" +#~ " -W NUM --width=NUM Output paling banyak NUM (baku 130) kolom.\n" +#~ " --left-column Output hanya kolom kiri baris bersama.\n" +#~ " --suppress-common-lines Jangan hasilkan baris bersama." + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "" +#~ "--speed-large-files Asumsikan file besar dan banyak perubahan kecil." + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "-X Output perubahan overlap, beri tanda kurung." + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "-m --merge Tampilkan file yang dimerge bukan script ed (baku -A)." + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "-L LABEL --label=LABEL Gunakan LABEL bukan nama file." + +#~ msgid "%s: illegal option -- %c\n" +#~ msgstr "%s: pilihan -- %c tidak legal\n" + +#~ msgid "" +#~ "This is free software; see the source for copying conditions. There is " +#~ "NO\n" +#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR " +#~ "PURPOSE.\n" +#~ msgstr "" +#~ "Ini adalah aplikasi bebas; lihat kode program untuk persayaraan " +#~ "penyalinan;\n" +#~ "TIDAK ADA GARANSI; bahkan untuk DIPERDAGANGKAN atau KECOCOKAN UNTUK " +#~ "TUJUAN TERTENTU.\n" + +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>." +#~ msgstr "Laporkan bug ke <bug-gnu-utils@gnu.org>" + +#~ msgid "`-%ld' option is obsolete; use `-%c %ld'" +#~ msgstr "`-%ld' option kuno; gunakan `-%c %ld'" + +#~ msgid "`-%ld' option is obsolete; omit it" +#~ msgstr "`-%ld' option kuno, hilangkan saja" + +#~ msgid "subsidiary program `%s' not found" +#~ msgstr "program subsider `%s' tidak ditemukan" + +#~ msgid "subsidiary program `%s' failed" +#~ msgstr "program subsider `%s' gagal" + +#~ msgid "subsidiary program `%s' failed (exit status %d)" +#~ msgstr "program subsider `%s' gagal (status keluar %d)" + +#~ msgid "" +#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n" +#~ "You may redistribute copies of this program\n" +#~ "under the terms of the GNU General Public License.\n" +#~ "For more information about these matters, see the files named COPYING." +#~ msgstr "" +#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n" +#~ "You may redistribute copies of this program\n" +#~ "under the terms of the GNU General Public License.\n" +#~ "For more information about these matters, see the file named COPYING." + +#~ msgid "Written by Torbjorn Granlund and David MacKenzie." +#~ msgstr "Ditulis oleh Torbjorn Granlund dan David MacKenzie." + +#~ msgid "" +#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman, and Len Tower." +#~ msgstr "" +#~ "Ditulis oleh Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman, dan Len Tower." + +#~ msgid "subsidiary program `%s' not executable" +#~ msgstr "program subsider `%s' tidak dapat dieksekusi" diff --git a/local/recipes/tools/diffutils/source/po/insert-header.sin b/local/recipes/tools/diffutils/source/po/insert-header.sin new file mode 100644 index 0000000000..b26de01f6c --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/insert-header.sin @@ -0,0 +1,23 @@ +# Sed script that inserts the file called HEADER before the header entry. +# +# At each occurrence of a line starting with "msgid ", we execute the following +# commands. At the first occurrence, insert the file. At the following +# occurrences, do nothing. The distinction between the first and the following +# occurrences is achieved by looking at the hold space. +/^msgid /{ +x +# Test if the hold space is empty. +s/m/m/ +ta +# Yes it was empty. First occurrence. Read the file. +r HEADER +# Output the file's contents by reading the next line. But don't lose the +# current line while doing this. +g +N +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} diff --git a/local/recipes/tools/diffutils/source/po/it.gmo b/local/recipes/tools/diffutils/source/po/it.gmo new file mode 100644 index 0000000000..e6af69830d Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/it.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/it.po b/local/recipes/tools/diffutils/source/po/it.po new file mode 100644 index 0000000000..00e74cbdc8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/it.po @@ -0,0 +1,1629 @@ +# Italian messages for diffutils. +# Copyright (C) 2004, 2005, 2010 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Marco Colombo <m.colombo@ed.ac.uk>, 2004, 2005, 2010, 2011, 2015, 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: diffutils 3.5.14\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2017-02-28 09:33+0000\n" +"Last-Translator: Marco Colombo <m.colombo@ed.ac.uk>\n" +"Language-Team: Italian <tp@lists.linux.it>\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "argomento \"%s\" di %s non valido" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "argomento \"%s\" di %s ambiguo" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "Argomenti validi sono:" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "errore del programma" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "overflow dello stack" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Errore di sistema sconosciuto" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "file normale vuoto" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "file normale" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "directory" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "link simbolico" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "coda di messaggi" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "semaforo" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "oggetto di memoria condivisa" + +# La memoria è tipizzata, non l'oggetto. +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "oggetto di memoria tipizzata" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "file speciale a blocchi" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "file speciale a caratteri" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "dati contigui" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "porta" + +#: lib/file-type.c:81 +msgid "multiplexed block special file" +msgstr "" + +#: lib/file-type.c:84 +msgid "multiplexed character special file" +msgstr "" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "" + +#: lib/file-type.c:90 +msgid "named file" +msgstr "" + +#: lib/file-type.c:93 +msgid "network special file" +msgstr "file speciale di rete" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "file migrato con dati" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "file migrato senza dati" + +#: lib/file-type.c:102 +msgid "port" +msgstr "porta" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "socket" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "file strano" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: l'opzione \"%s\" è ambigua\n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: l'opzione \"%s\" è ambigua; alternative:" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: opzione \"%c%s\" non riconosciuta\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: l'opzione \"%c%s\" non accetta argomenti\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: l'opzione \"%s\" richiede un argomento\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: opzione non valida -- \"%c\"\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: l'opzione richiede un argomento -- \"%c\"\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "\"" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "\"" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Successo" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Nessuna corrispondenza" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Espressione regolare non valida" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Carattere di collazione non valido" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Nome della classe di caratteri non valido" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Backslash finale" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Riferimento all'indietro non valido" + +#: lib/regcomp.c:156 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "[, [^, [:, [. o [= senza corrispondenza" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "( o \\( senza corrispondenza" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "\\{ senza corrispondenza" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Contenuto di \\{\\} non valido" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Fine dell'intervallo non valida" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Memoria esaurita" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "L'espressione regolare precedente non è valida" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Fine prematura dell'espressione regolare" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "L'espressione regolare è troppo grande" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr ") o \\) non accoppiata" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Non c'è una espressione regolare precedente" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "memoria esaurita" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "stdin" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "stdout" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "stderr" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "stream sconosciuto" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "riapertura di %s in modalità %s non riuscita" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "argomento \"%3$s\" di %1$s%2$s non valido" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "suffisso \"%3$s\" non valido nell'argomento di %1$s%2$s" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "argomento \"%3$s\" di %1$s%2$s troppo grande" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Impacchettato da %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Impacchettato da %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "(C)" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Licenza GPLv3+: GNU GPL versione 3 o successiva <http://gnu.org/licenses/gpl." +"html>.\n" +"Questo è software libero: siete liberi di cambiaro e redistribuirlo.\n" +"Non c'è ALCUNA GARANZIA, nei limiti previsti dalla legge.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Scritto da %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Scritto da %s e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Scritto da %s, %s, e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Scritto da %s, %s, %s,\n" +"e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Scritto da %s, %s, %s,\n" +"%s, e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Scritto da %s, %s, %s,\n" +"%s, %s, e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Scritto da %s, %s, %s,\n" +"%s, %s, %s, e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Scritto da %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Scritto da %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Scritto da %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, e altri.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Segnalare i bug a: %s\n" +"Segnalare gli errori di traduzione a: <tp@lists.linux.it>\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Segnalare i bug di %s a: %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s home page: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "%s home page: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "Aiuto sull'uso di software GNU: <http://www.gnu.org/gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "I file %s e %s sono diversi\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "I file binari %s e %s sono diversi\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Manca newline alla fine del file" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Usare \"%s --help\" per maggiori informazioni." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "Valore \"%s\" non valido per --ignore-initial" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "le opzioni -l e -s sono incompatibili" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "scrittura non riuscita" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "standard output" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b, --print-bytes Stampa i byte differenti" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i, --ignore-initial=SKIP Salta i primi SKIP byte di entrambi gli input" + +# Lo strano allineamento è corretto +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=SKIP1:SKIP2 Salta i primi SKIP1 byte di FILE1 e i " +"primi\n" +" SKIP2 byte di FILE2" + +# Lo strano allineamento della seconda riga è corretto. +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l, --verbose Mostra i numeri e i valori di tutti i byte\n" +" differenti" + +# Solitamente viene usato NUM quando si vuole specificare un numero. +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=NUM Confronta al massimo NUM byte" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent Sopprime tutto l'output normale" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help Mostra questo aiuto ed esce" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "" +"-v, --version Stampa le informazioni sulla versione ed esce" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Uso: %s [OPZIONE]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Confronta due file byte per byte." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"I valori opzionali SKIP1 e SKIP2 indicano il numero di byte da saltare\n" +"all'inizio di ogni file (zero se non indicato)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Gli argomenti obbligatori per le opzioni lunghe lo sono anche per quelle " +"corte.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"I valori di SKIP possono essere seguiti dai seguenti suffissi " +"moltiplicativi:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, e così via per T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Se un FILE è \"-\" o è mancante, legge lo standard input." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"Il codice d'uscita è 0 se gli input sono identici, 1 se sono differenti, 2 " +"quando si riscontrano dei problemi." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "valore \"%s\" non valido per --bytes" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "operando mancante dopo \"%s\"" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "extra operando \"%s\"" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s differenza: byte %s, riga %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s differenza: byte %s, riga %s è %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: EOF in %s\n" + +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s %s differenza: byte %s, riga %s\n" + +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s %s differenza: byte %s, riga %s\n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: EOF in %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "lunghezza di contesto \"%s\" non valida" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "paginazione non supportata su questo host" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "troppe opzioni di etichetta" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "larghezza \"%s\" non valida" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "opzioni di larghezza in conflitto" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "lunghezza di orizzonte \"%s\" non valida" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "lunghezza di tabulazione \"%s\" non valida" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "opzioni di lunghezza di tabulazione in conflitto" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "--from-file e --to-file specificati entrambi" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr " --normal Mostra una diff normale (predefinito)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "-q, --brief Segnala solo se i file sono diversi" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s, --report-identical-files Segnala quando due file sono identici" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C NUM, --context[=NUM] Mostra NUM righe di contesto copiato\n" +" (predefinito 3)" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U NUM, --unified[=NUM] Mostra NUM righe di contesto unificato\n" +" (predefinito 3)" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed Mostra uno script per ed" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n, --rcs Mostra una diff in formato RCS" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side Output in due colonne" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=NUM Mostra al massimo NUM colonne (predefinito 130)" + +# Lo strano allineamento della seconda riga è corretto. +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +" --left-column Mostra solo la colonna di sinistra per le " +"righe\n" +" in comune" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines Non mostra le righe in comune" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" +"-p, --show-c-function Mostra in quale funzione C si trova ogni\n" +" differenza" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" +"-F, --show-function-line=ER Mostra la riga più recente che corrisponde\n" +" all'espressione regolare ER" + +# FIXME +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label ETICHETTA Usa ETICHETTA invece del nome e timestamp del " +"file\n" +" (può essere ripetuta)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs Espande le tabulazioni in spazi nell'output" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab Allinea le tabulazioni usando una tabulazione" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=NUM Stop di tabulazione ogni NUM colonne\n" +" (predefinito 8)" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty Rimuove spazi e tabulazioni prima di righe\n" +" di output vuote" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" +"-l, --paginate Passa l'output attraverso \"pr\" per " +"impaginarlo" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r, --recursive Confronta ricorsivamente ogni sottodirectory\n" +" incontrata" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference Non segue i collegamenti simbolici" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "-N, --new-file Considera i file mancanti come vuoti" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +" --unidirectional-new-file Considera i file mancanti in prima posizione\n" +" come vuoti" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case Ignora differenze in maiuscole e minuscole\n" +" confrontando nomi di file" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case Considera differenze in maiuscole e " +"minuscole\n" +" confrontando nomi di file" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "" +"-x, --exclude=MODELLO Esclude i file che corrispondono al MODELLO" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=FILE Esclude i file che corrispondono a qualsiasi\n" +" modello in FILE" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=FILE Comincia da FILE quando si confrontano " +"directory" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=FILE1 Confronta FILE1 con tutti gli operandi;\n" +" FILE1 può essere una directory" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=FILE2 Confronta tutti gli operandi con FILE2;\n" +" FILE2 può essere una directory" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i, --ignore-case Ignora differenze in maiuscole e minuscole " +"nel\n" +" contenuto del file" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion Ignora differenze causate dall'espansione\n" +" delle tabulazioni" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space Ignora gli spazi a fine riga" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change Ignora differenze nel numero di spazi" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space Ignora tutti gli spazi" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "-B, --ignore-blank-lines Ignora differenze in righe vuote" + +# Lo strano allineamento della seconda riga è corretto +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=ER Ignora differenze che corrispondono\n" +" all'espressione regolare ER" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text Considera tutti i file come testo" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr Elimina i ritorni a capo a fine riga in input" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr " --binary Legge e scrive in modalità binaria" + +# Con questa opzione, i due file originali sono uniti in un unico file che +# viene stampato sullo standard output. Le differenze sono mostrate così: +# +# Testo comune. +# #ifndef NOME +# Questo è il file 1. +# #else /* NOME */ +# Questo è il file 2. +# #endif /* NOME */ +# Testo comune. +# +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=NOME Mostra le differenze in un unico file usando\n" +" \"#ifdef NOME\"" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +" --GTYPE-group-format=GFMT Simile, ma formatta i gruppi di input GTYPE\n" +" con GFMT" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "" +" --line-format=LFMT Formatta tutte le righe di input con LFMT" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +" --LTYPE-line-format=LFMT Formatta le righe di input LTYPE con LFMT" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" Queste opzioni di formato forniscono un controllo preciso dell'output di\n" +" diff, generalizzando -D/--ifdef." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE è \"old\", \"new\", o \"unchanged\". GTYPE è LTYPE o \"changed\"." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT può (solo) contenere:\n" +" %< righe dal FILE1\n" +" %> righe dal FILE2\n" +" %= righe comuni a FILE1 e FILE2\n" +" %[-][LARGHEZZA][.[PREC]]{doxX}LETTERA formato in stile printf per " +"LETTERA\n" +" LETTERA può contenere (in maiuscolo per nuovi gruppi o in minuscolo\n" +" per vecchi):\n" +" F numero della prima riga\n" +" L numero dell'ultima riga\n" +" N numero di righe = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) se A è uguale a B allora T, altrimenti E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT può contenere:\n" +" %L contenuto della riga\n" +" %l contenuto della riga, ad esclusione di ogni andata a capo finale\n" +" %[-][LARGHEZZA][.[PREC]]{doxX}n formato in stile printf del numero\n" +" di riga di input" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" GFMT e LFMT possono contenere:\n" +" %% %\n" +" %c'C' il singolo carattere C\n" +" %c'\\OOO' il carattere con codice ottale OOO\n" +" C il carattere C (altri caratteri rappresentano se stessi)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal Minimizza il numero di differenze" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +" --horizon-lines=NUM Mantiene NUM righe di prefisso e suffisso comune" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files Assume file grandi e tante piccole differenze" + +#: src/diff.c:974 +#, fuzzy +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" +" --color[=QUANDO] Colora l'output; QUANDO può essere \"never\", " +"\"always\"" + +#: src/diff.c:976 +#, fuzzy +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" +" PALETTA è una lista di terminfo " +"capabilities\n" +" separati da \":\"" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help Mostra questo aiuto ed esce" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "" +"-v, --version Stampa le informazioni sulla versione ed esce" + +#: src/diff.c:982 +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"FILES sono \"FILE1 FILE2\" o \"DIR1 DIR2\" o \"DIR FILE\" o \"FILE DIR\"." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Se --from-file o --to-file sono usati, non ci sono restrizioni per FILES." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Se un FILE è \"-\", legge lo standard input." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Uso: %s [OPZIONE]... FILES\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Confronta i file riga per riga." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "conflitto nell'opzione %s: valore \"%s\"" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "opzioni di stile di output in conflitto" + +#: src/diff.c:1058 +#, c-format +msgid "invalid color '%s'" +msgstr "colore \"%s\" non valido" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Solo in %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "impossibile confrontare \"-\" con una directory" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "opzione -D non supportata con directory" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Sottodirectory in comune: %s e %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "File %s è un %s mentre file %s è un %s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "I collegamenti simbolici %s e %s sono diversi\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "I file %s e %s sono identici\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "opzioni incompatibili" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "\"-\" specificato per più di un file di input" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "lettura fallita" + +# Questa opzione produce: +# +# diff3 -A file1 file2 file3 +# 2a +# ||||||| file2 +# Questo è il file 2. +# ======= +# Questo è il file 3. +# >>>>>>> file3 +# . +# 1a +# <<<<<<< file1 +# . +# +# Lo strano allineamento della seconda riga è corretto. +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A, --show-all Mostra tutte le differenze, tenendo separati\n" +" i conflitti" + +# Per mostrare i diversi output generati con le varie opzioni di diff3, +# ho usato i seguenti file: +# +# file1: Testo comune. +# Questo è il file 1. +# Altro testo comune. +# file2: Testo comune. +# Questo è il file 2. +# Altro testo comune. +# file3: Testo comune. +# Questo è il file 3. +# Altro testo comune. +# +# In questo caso mi sembra più corretto usare 'cambiamenti' invece che +# 'differenze'. +# +# Lo strano allineamento della seconda riga è corretto. +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed Mostra uno script ed con i cambiamenti\n" +" da VECCHIOFILE a TUOFILE in MIOFILE" + +# Questa opzione produce: +# +# diff3 -E file1 file2 file3 +# 2a +# ======= +# Questo è il file 3. +# >>>>>>> file3 +# . +# 1a +# <<<<<<< file1 +# . +# +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "-E, --show-overlap Come -e, tenendo separati i conflitti" + +# Questa opzione, per i 3 file considerati, non produce niente. +# +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3 --easy-only Come -e, ma mostra solo i cambiamenti che non\n" +" si sovrappongono" + +# Questa opzione produce: +# +# diff3 -x file1 file2 file3 +# 2c +# Questo è il file 3. +# . +# +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +"-x, --overlap-only Come -e, ma mostra solo i cambiamenti che si\n" +" sovrappongono" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "-X Come -x, ma tiene separati i conflitti" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "" +"-i Aggiunge i comandi \"w\" e \"q\" agli script per " +"ed" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge Mostra il file combinato risultante, secondo -A\n" +" se non è indicata nessun'altra opzione" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text Considera tutti i file come testo" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr Elimina i ritorni a capo a fine riga in input" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab Allinea le tabulazioni usando una tabulazione" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=PROGRAMMA Usa PROGRAMMA per confrontare i file" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=ETICHETTA Usa ETICHETTA invece del nome del file\n" +" (può essere repetuta fino a tre volte)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help Mostra questo aiuto ed esce" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "" +"-v, --version Stampa le informazioni sulla versione ed esce" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Uso: %s [OPZIONE]... MIOFILE VECCHIOFILE TUOFILE\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Confronta tre file riga per riga." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"Il formato predefinito di output è una rappresentazione più o meno " +"leggibile\n" +"dei cambiamenti.\n" +"\n" +"Le opzioni -e, -E, -x, -X (e le opzioni lunghe corrispondenti) producono " +"uno\n" +"script per ed invece dell'output predefinito.\n" +"\n" +"Infine, l'opzione -m (--merge) indica a diff3 di combinare internamente i " +"file\n" +"e mostrare il file combinato. Per input non convenzionali, ciò è più " +"robusto\n" +"di ed.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"Il codice d'uscita è 0 in caso di successo, 1 in caso di conflitto, 2 se " +"sono\n" +"stati riscontrati dei problemi." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "errore interno: problema nel formato dei blocchi di diff" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff fallita: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "errore interno: tipo di diff non valido in process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "formato di diff non valido; separatore di modifica non valido" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "formato di diff non valido; ultima riga incompleta" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "programma accessorio \"%s\" non può essere chiamato" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "formato di diff non valido; caratteri incorretti a inizio riga" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "errore interno: il tipo di diff passato all'output non è valido" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "il file di input è rimpicciolito" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "impossibile confrontare i nomi dei file \"%s\" e \"%s\"" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: ciclo ricorsivo tra le directory" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +# Lo strano allineamento della seconda riga è corretto. +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o, --output=FILE Procede in modo interattivo, scrivendo l'output\n" +" in FILE" + +# Questa traduzione corrisponde a quella usata sopra per diff. +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i, --ignore-case Ignora differenze in maiuscole e minuscole" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion Ignora differenze causate dall'espansione\n" +" delle tabulazioni" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space Ignora gli spazi a fine riga" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change Ignora differenze nel numero di spazi" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space Ignora tutti gli spazi" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "-B, --ignore-blank-lines Ignora differenze in righe vuote" + +# Lo strano allineamento della seconda riga è corretto +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=ER Ignora differenze che corrispondono\n" +" all'espressione regolare ER" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr Elimina i ritorni a capo a fine riga in input" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a, --text Considera tutti i file come testo" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=NUM Mostra al massimo NUM colonne (predefinito 130)" + +# Lo strano allineamento della seconda riga è corretto. +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" +"-l, --left-column Mostra solo la colonna di sinistra per le righe\n" +" in comune" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines Non mostra le righe in comune" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs Espande le tabulazioni in spazi nell'output" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +"--tabsize=NUM Stop di tabulazione ogni NUM colonne\n" +" (predefinito 8)" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal Minimizza il numero di differenze" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files Assume file grandi e tante piccole differenze" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "--diff-program=PROGRAMMA Usa PROGRAMMA per confrontare i file" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help Mostra questo aiuto ed esce" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "" +"-v, --version Stampa le informazioni sulla versione ed esce" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Uso: %s [OPZIONE]... FILE1 FILE2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Mostra le differenze tra FILE1 e FILE2 fianco a fianco." + +# Tobia Conforto: impossibile combinare in modo interattivo da standard input +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "impossibile combinare in modo interattivo con lo standard input" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "entrambi i file da confrontare sono directory" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tModifica e poi usa entrambe le versioni, ognuna con un'intestazione.\n" +"eb:\tModifica e poi usa entrambe le versioni.\n" +"el, e1:\tModifica e poi usa la versione di sinistra.\n" +"er, e2:\tModifica e poi usa la versione di destra.\n" +"e:\tScarta entrambe le versioni e modifica una nuova versione.\n" +"l, 1:\tUsa la versione di sinistra.\n" +"r, 2:\tUsa la versione di destra.\n" +"s:\tInclude silenziosamente le righe in comune.\n" +"v:\tInclude prolissamente le righe in comune.\n" +"q:\tEsce.\n" + +#: src/util.c:662 +#, c-format +msgid "unrecognized prefix: %s" +msgstr "prefisso non riconosciuto: %s" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "valore di --palette non comprensibile" + +#~ msgid " or 'auto' (the default)" +#~ msgstr " oppure \"auto\" (predefinito)" + +#~ msgid "" +#~ " --palette=PALETTE specify the colors to use when --color is active" +#~ msgstr "" +#~ " --palette=PALETTA Indica i colori da usare quando --color è " +#~ "attivo" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: l'opzione \"--%s\" non accetta argomenti\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: opzione \"--%s\" non riconosciuta\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: l'opzione \"-W %s\" è ambigua\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: l'opzione \"-W %s\" non accetta argomenti\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: l'opzione \"-W %s\" richiede un argomento\n" diff --git a/local/recipes/tools/diffutils/source/po/ja.gmo b/local/recipes/tools/diffutils/source/po/ja.gmo new file mode 100644 index 0000000000..6ff91cc616 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/ja.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/ja.po b/local/recipes/tools/diffutils/source/po/ja.po new file mode 100644 index 0000000000..960e973135 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/ja.po @@ -0,0 +1,1566 @@ +# Japanese GNU diffutils messages +# Copyright (C) 2000, 2011 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# IIDA Yosiaki <iida@gnu.org>, 2002. +# Masahito Yamaga <yamaga@ipc.chiba-u.ac.jp>, 2002. +# GOTO Masanori <gotom@debian.or.jp>, 2006. +# derived from the version by Yasuyuki Furukawa <yasu@on.cs.keio.ac.jp> 1998. +# Jun Nishii <jun@flatout.org> 1999. +# Daisuke Yamashita <yamad@mb.infoweb.ne.jp> 1999. +# Yasuaki Taniguchi <yasuakit@gmail.com>, 2010, 2011. +msgid "" +msgstr "" +"Project-Id-Version: GNU diffutils 3.2\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2011-09-08 14:13+0900\n" +"Last-Translator: Yasuaki Taniguchi <yasuakit@gmail.com>\n" +"Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: lib/argmatch.c:134 +#, fuzzy, c-format +msgid "invalid argument %s for %s" +msgstr "引数 `%3$s' に対して %1$s%2$s が無効です" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "" + +#: lib/argmatch.c:154 +#, fuzzy +msgid "Valid arguments are:" +msgstr "引数 `%3$s' に対して %1$s%2$s が無効です" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "プログラムエラー" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "スタックオーバーフロー" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "不明なシステムエラー" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "通常の空ファイル" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "通常ファイル" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "ディレクトリー" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "シンボリックリンク" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "メッセージキュー" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "セマフォ" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "共有メモリオブジェクト" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "型付メモリオブジェクト" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "ブロックスペシャルファイル" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "キャラクタスペシャルファイル" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "" + +#: lib/file-type.c:81 +#, fuzzy +msgid "multiplexed block special file" +msgstr "ブロックスペシャルファイル" + +#: lib/file-type.c:84 +#, fuzzy +msgid "multiplexed character special file" +msgstr "キャラクタスペシャルファイル" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "" + +#: lib/file-type.c:90 +#, fuzzy +msgid "named file" +msgstr "不明なファイル" + +#: lib/file-type.c:93 +#, fuzzy +msgid "network special file" +msgstr "ブロックスペシャルファイル" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "" + +#: lib/file-type.c:102 +msgid "port" +msgstr "" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "ソケット" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "不明なファイル" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: オプション '-W %s' は曖昧です\n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: オプション '%s' は曖昧です。次のものが可能です:" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: オプション '%c%s' を認識できません\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: オプション '%c%s' は引数を取ることができません\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: オプション '--%s' は引数が必要です\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: 無効なオプション -- '%c'\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: オプションには引数が必要です -- '%c'\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "`" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "'" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "成功です" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "一致しません" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "無効な正規表現です" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "無効な照合文字です" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "無効な文字クラス名です" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "終端のバックスラッシュ" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "無効な前方参照です" + +#: lib/regcomp.c:156 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "[ または [^ が不一致です" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "( または \\( が不一致です" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "\\{ が不一致です" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "\\{\\} の中身が無効です" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "無効な範囲終了です" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "メモリを使い果たしました" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "無効な前方正規表現です" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "正規表現が途中で終了しました" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "正規表現が大きすぎます" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr ") または \\) が不一致です" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "以前に正規表現がありません" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "メモリを使い果たしました" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "標準入力" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "標準出力" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "標準エラー出力" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "不明なストリーム" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "%s をモード %s で再度開くことに失敗しました" + +#: lib/xstrtol-error.c:63 +#, fuzzy, c-format +msgid "invalid %s%s argument '%s'" +msgstr "引数 `%3$s' に対して %1$s%2$s が無効です" + +#: lib/xstrtol-error.c:68 +#, fuzzy, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "引数 `%3$s' に対して無効な接尾辞 %1$s%2$s です" + +#: lib/xstrtol-error.c:72 +#, fuzzy, c-format +msgid "%s%s argument '%s' too large" +msgstr "引数 `%3$s' に対する %1$s%2$s が大きすぎます" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "パッケージ作成者: %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "パッケージ作成者: %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "(C)" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"ライセンス GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "作者 %s。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "作者 %s および %s。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "作者 %s、 %s、および %s。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"作者 %s、 %s、 %s、\n" +"および %s。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"作者 %s、 %s、 %s、\n" +"%s、および %s。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"作者 %s、 %s、 %s、\n" +"%s、 %s、および %s。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"作者 %s、 %s、 %s、\n" +"%s、 %s、 %s、および %s。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"作者 %s、 %s、 %s、\n" +"%s、 %s、 %s、 %s、\n" +"および %s。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"作者 %s、 %s、 %s、\n" +"%s、 %s、 %s、 %s、\n" +"%s、および %s。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"作者 %s、 %s、 %s、\n" +"%s、 %s、 %s、 %s、\n" +"%s、 %s、 および他の方々。\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"バグを発見したら <%s> に報告して下さい。\n" +"翻訳に関するバグは<translation-team-ja@lists.sourceforge.net>に報告してくださ" +"い。\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "%s のバグは <%s> に報告してください。\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s のホームページ: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "%s のホームページ: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"GNU ソフトウェアを使用する際の一般的なヘルプ: <http://www.gnu.org/gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "ファイル %s と %s は異なります\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "バイナリーファイル %s と%s は異なります\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "ファイル末尾に改行がありません" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, fuzzy, c-format +msgid "Try '%s --help' for more information." +msgstr "詳しくは`%s --help'を実行してください。" + +#: src/cmp.c:137 +#, fuzzy, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "無効な --ignore-initial の値 `%s' です" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "オプション -l と -s は同時に指定できません" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "書き込みに失敗しました" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "標準出力" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b, --print-bytes 異なるバイトを表示する" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i, --ignore-initial=SKIP 両方の入力の先頭 SKIP バイトをスキップする" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=SKIP1:SKIP2 FILE1 の先頭 SKIP1 バイトと FILE2 の先頭\n" +" SKIP2 バイトをスキップする" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "-l, --verbose バイト数および異なるバイトの値を出力する" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=LIMIT 最大 LIMIT バイトを比較する" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent 通常の表示をすべて抑止する" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help このメッセージを表示して終了する" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v, --version バージョン情報を表示して終了する" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "使用法: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "2つのファイルをバイトごとに比較します。" + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"オプションの SKIP1 と SKIP2 はそれぞれのファイルの先頭からスキップする\n" +"バイト数を指定します(デフォルトは 0)。" + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"長い形式のオプションで必須の引数は、それに対応する短い形式のオプションでも同" +"様に必須です。\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"SKIP の値には次の倍数を表す接尾辞を付けることも出来ます:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824。また、 T, P, E, Z, Y も同様です。" + +#: src/cmp.c:194 +#, fuzzy +msgid "If a FILE is '-' or missing, read standard input." +msgstr "FILE が `-' または指定しない場合、標準入力から読み込みます。" + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"終了コードは、入力ファイルが同じ場合は 0、入力ファイルが異なる場合は 1、\n" +"問題が発生したときは 2 になります。" + +#: src/cmp.c:240 +#, fuzzy, c-format +msgid "invalid --bytes value '%s'" +msgstr "無効な --bytes の値 `%s' です。" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, fuzzy, c-format +msgid "missing operand after '%s'" +msgstr "`%s' の後に被演算子がありません" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, fuzzy, c-format +msgid "extra operand '%s'" +msgstr "余分な被演算子 `%s' です。" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s 異なります: バイト %s、行 %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s 異なります: バイト %s、行 %s %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: %s でファイル終端 (EOF) に達しました\n" + +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s %s 異なります: バイト %s、行 %s\n" + +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s %s 異なります: バイト %s、行 %s\n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: %s でファイル終端 (EOF) に達しました\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, fuzzy, c-format +msgid "invalid context length '%s'" +msgstr "無効な前後の行数 `%s' です" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "このホストではページ割付けをサポートしません" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "ファイル・ラベル・オプションが多すぎます" + +#: src/diff.c:528 +#, fuzzy, c-format +msgid "invalid width '%s'" +msgstr "無効な幅 `%s' です" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "幅のオプションが競合しています" + +#: src/diff.c:557 +#, fuzzy, c-format +msgid "invalid horizon length '%s'" +msgstr "無効な横幅 `%s' です" + +#: src/diff.c:613 +#, fuzzy, c-format +msgid "invalid tabsize '%s'" +msgstr "無効なタブ幅 `%s' です" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "タブ幅のオプションが競合しています" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "--from-file および --to-file の両方が指定されています" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr " --normal 通常の diff を出力する (デフォルト)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "-q, --brief ファイルが異なるかどうかのみ表示する" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "" +"-s, --report-identical-files 両方のファイルが同一であるかどうかのみ表示する" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C NUM, --context[=NUM] コンテキスト diff 形式で前後 NUM (デフォルト: " +"3) 行を表示する" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U NUM, --unified[=NUM] ユニファイド diff 形式で前後 NUM (デフォルト: " +"3) 行を表示する" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed ed スクリプトを出力する" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n, --rcs RCS 形式の diff を出力する" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side 出力を2列にする" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=NUM 表示する列を最大 NUM (デフォルト: 130) 列にする" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr " --left-column 共通行は左側の列のみ表示する" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines 共通行の出力を抑止する" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "-p, --show-c-function 変更がある C 関数を表示する" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "-F, --show-function-line=RE RE に一致する最も近い行を表示する" + +#: src/diff.c:905 +#, fuzzy +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label LABEL ファイル名の代わりに LABEL を使用する\n" +" (繰り返し指定できます)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs 出力時にタブをスペースに展開する" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab タブで始まる行は、前にタブを置いてそろえる" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=NUM タブ幅を NUM (デフォルト: 8) 列に設定する" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty 空の出力行の前後ではスペースまたはタブを抑止す" +"る" + +#: src/diff.c:912 +#, fuzzy +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" +"-l, --paginate ページ割り付けを行うために `pr' を通して出力す" +"る" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "-r, --recursive サブディレクトリーを再帰的に比較する" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr "" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "" +"-N, --new-file 存在しないファイルを空ファイルとして扱う" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +" --unidirectional-new-file 存在しない最初のファイルを空ファイルとして扱" +"う" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr " --ignore-file-name-case ファイル名の大文字と小文字を区別しない" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr " --no-ignore-file-name-case ファイル名の大文字と小文字を区別する" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "-x, --exclude=PAT PAT に一致するファイルを除外する" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=FILE FILE 内のパターンに一致するファイルを除外する" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=FILE ディレクトリーを比較する時に FILE から始める" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=FILE1 すべての被演算子と FILE1 を比較する\n" +" FILE1 はディレクトリーでもよい" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=FILE2 すべての被演算子を FILE2 を比較する\n" +" FILE2 はディレクトリーでもよい" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i, --ignore-case ファイル内容の比較時に大文字と小文字を区別し" +"ない" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "-E, --ignore-tab-expansion タブ展開によって発生する違いを無視する" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space 行末にあるスペースを無視する" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change スペース数により生じる違いを無視する" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space すべてのスペースを無視する" + +#: src/diff.c:933 +#, fuzzy +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B, --ignore-blank-lines 空白類文字だけの行により生じる違いを無視する" + +#: src/diff.c:934 +#, fuzzy +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE RE と一致するすべての行の違いを無視する" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text すべてのファイルをテキストとして扱う" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr 入力から CR (キャリッジリターン) を除去する" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr " --binary バイナリーモードでデータを読み書きする" + +#: src/diff.c:942 +#, fuzzy +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=NAME パッチ適用時に `#ifdef NAME' で併合されるよう" +"に差分を出力する" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr " --GTYPE-group-format=GFMT GTYPE の入力グループを GFMT で整形する" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr " --line-format=LFMT すべての入力行を LFMT で整形する" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr " --LTYPE-line-format=LFMT LTYPE 入力行を LFMT で整形する" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" これらの書式整形オプションは -D/--ifdef に適用される diff の出力をきれい" +"に\n" +" 見えるように制御するために提供されます。" + +#: src/diff.c:948 +#, fuzzy +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE は `old'、`new'、または`unchanged'です。GTYPE は LTYPE または " +"`changed' です。" + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT でのみ指定できる書式:\n" +" %< FILE1 からの行\n" +" %> FILE2 からの行\n" +" %= FILE1 と FILE2 で共通の行\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf 書式の LETTER\n" +" LETTER は次の通りです。ただし古いグループでは小文字です:\n" +" F 最初の行番号\n" +" L 最後の行番号\n" +" N 行数 = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) A と B が等しい場合は T、等しくない場合は E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT でのみ指定できる書式:\n" +" %L 行の内容\n" +" %l 行末にあるすべての種類の改行文字を除いた行の内容\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf 書式の入力行" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" GFMT と LFMT の両方で指摘できる書式:\n" +" %% %\n" +" %c'C' 単一文字 C\n" +" %c'\\OOO' 八進数コード OOO\n" +" C 文字 C (他の文字も同様に表す)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal 差分の大きさが最小となるように違いを検出する" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr " --horizon-lines=NUM 差分の前後にある共通部分を NUM 行保持する" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files 巨大なファイルに小さな差分が分散していると仮定する" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help このヘルプを表示して終了する" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version バージョン情報を表示して終了する" + +#: src/diff.c:982 +#, fuzzy +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"FILES は `FILE1 FILE2'、`DIR1 DIR2' 、`DIR FILE...'、または `FILE... DIR' で" +"す。" + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"--from-file または --to-file が与えられた場合、FILE に制限はありません。" + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +#, fuzzy +msgid "If a FILE is '-', read standard input." +msgstr "FILE が `-' の場合、標準入力から読み込みます。" + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "使用法: %s [OPTION]... FILES\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "FILES を行ごとに比較します。" + +#: src/diff.c:1029 +#, fuzzy, c-format +msgid "conflicting %s option value '%s'" +msgstr "%s オプションの値 `%s' が競合しています" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "出力形式オプションが競合しています" + +#: src/diff.c:1058 +#, fuzzy, c-format +msgid "invalid color '%s'" +msgstr "無効な前後の行数 `%s' です" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "%s のみに存在: %s\n" + +#: src/diff.c:1248 +#, fuzzy +msgid "cannot compare '-' to a directory" +msgstr "`-' とディレクトリーは比較できません" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "-D オプションはディレクトリーにはサポートされません" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "共通のサブディレクトリー: %s と %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "ファイル %s は %s です。一方、ファイル %s は %s です\n" + +#: src/diff.c:1370 +#, fuzzy, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "ファイル %s と %s は異なります\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "ファイル %s と %s は同一です\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "同時に指定できないオプションです" + +#: src/diff3.c:391 +#, fuzzy +msgid "'-' specified for more than one input file" +msgstr "入力ファイルとして `-' が複数回指定されています" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "読み込みに失敗しました" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A, --show-all 競合をすべて括弧でくくり、変更をすべて出力する" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed OLDFILE、YOURFILE、MYFILE の間の違いを ed\n" +" スクリプトとして出力する\n" +" " + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "-E, --show-overlap -e と同様だが、競合を括弧でくくる" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3, --easy-only -e と同様だが、3ファイル競合で無い部分のみ出力す" +"る" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +"-x, --overlap-only -e と同様だが、3ファイル競合の部分のみ出力する" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "-X -x と同様だが、競合を括弧でくくる" + +#: src/diff3.c:483 +#, fuzzy +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "" +"-i ed スクリプトの後に `w' と `q' コマンドを追加する" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge 他のオプションを指定していない場合、-A 従って\n" +" 実際に併合されたファイルを出力する" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text すべてのファイルをテキストとして扱う" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr 入力から末尾のキャリッジリターンを除去する" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T, --initial-tab タブで始まる行は、前にタブを置いてそろえる" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=PROGRAM ファイル比較に PROGRAM を使用する" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=LABEL ファイル名の代わりに LABEL を使用する\n" +" (3回まで繰り返し指定できる)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help このヘルプを表示して終了する" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version バージョン情報を表示して終了する" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "3つのファイルを行ごとに比較します。" + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"デフォルトでは違いが人間にとって読みやすい出力形式です。\n" +"\n" +"-e、-E、-x、-X (およびその長い形式) オプションを指定した場合はデフォルト\n" +"の代わりに ed スクリプトを出力します。\n" +"\n" +"最後に、-m (--merge) オプションにより diff3 は内部で併合を行い、実際に\n" +"併合されたファイルを出力します。通常の入力としては、これは ed を使用す\n" +"るより強固です。\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"終了コードは、成功した場合は 0、競合がある場合は 1、\n" +"問題が発生したときは 2 になります。" + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "内部エラー: 差分ブロックの形式をうまく処理できませんでした" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff に失敗しました: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "内部エラー: process_diff 内に無効な差分型があります" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "無効な差分形式です。無効な変更区切りです" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "無効な差分形式です。最後の行が不完全です" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, fuzzy, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "下位プログラム `%s' が起動できません" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "無効な差分形式です。行の先頭文字が誤っています" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "内部エラー: 無効な差分型が出力に渡されました" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "入力ファイルが小さくなりました" + +#: src/dir.c:156 +#, fuzzy, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "ファイル `%s' と `%s' を比較できません" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: ディレクトリーが再帰的にループしています" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "-o, --output=FILE 対話的に操作し、出力を FILE に送る" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i, --ignore-case 大文字と小文字を区別しない" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "-E, --ignore-tab-expansion タブ展開によって発生する違いを無視する" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space 行末にあるスペースを無視する" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change スペース数により生じる違いを無視する" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space すべてのスペースを無視する" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" +"-B, --ignore-blank-lines 空白類文字だけの行により生じる違いを無視する" + +#: src/sdiff.c:181 +#, fuzzy +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE RE と一致するすべての行の違いを無視する" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr 入力から末尾のキャリッジリターンを除去する" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a, --text すべてのファイルをテキストとして扱う" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=NUM 表示する列を最大 NUM (デフォルト: 130) 列にする" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "-l, --left-column 共通行は左側の列のみ表示する" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines 共通行の出力を抑止する" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs 出力時にタブをスペースに展開する" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr " --tabsize=NUM タブ幅を NUM (デフォルト: 8) 列に設定する" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d, --minimal 差分の大きさが最小となるように違いを検出する" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files 巨大なファイルに小さな差分が分散していると仮定す" +"る" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=PROGRAM ファイル比較に PROGRAM を使用する" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help このヘルプを表示して終了する" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v, --version バージョン情報を表示して終了する" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "使用法: %s [OPTION]... FILE1 FILE2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "FILE1 と FILE2 の差分を2段組で比較しながら併合します。" + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "標準出力は対話的に併合できません" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "比較対象は両方ともディレクトリーです" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed: 両方にヘッダーを付加し、両方の版を編集して使用する。\n" +"eb: 両方の版を編集して使用する。\n" +"el または e1: 左側の版を編集して使用する。\n" +"er または e2: 右側の版を編集して使用する。\n" +"e: 両方の版を破棄し、新規行を編集する。\n" +"l または 1: 左側の版を使用する。\n" +"r または 2: 右側の版を使用する。\n" +"s: 共通行を暗黙的に含める。\n" +"v: 共通行を明示して含める。\n" +"q: 終了する。\n" + +#: src/util.c:662 +#, fuzzy, c-format +msgid "unrecognized prefix: %s" +msgstr "%s: オプション '--%s' を認識できません\n" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "" + +#, fuzzy +#~ msgid " or 'auto' (the default)" +#~ msgstr " --normal 通常の diff を出力する (デフォルト)" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: オプション '--%s' は引数を取ることができません\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: オプション '--%s' を認識できません\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: オプション '-W %s' は曖昧です\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: オプション '-W %s' は引数を取ることができません\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: オプション '-W %s' は引数が必要です\n" + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "-s --quiet --silent 出力なし。終了ステータスのみ。" + +#~ msgid "--help Output this help." +#~ msgstr "--help この説明を出力。" + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ "-c -C NUM --context[=NUM] コピーした前後NUM行 (既定は3) を出力。\n" +#~ "-u -U NUM --unified[=NUM] 統合した前後NUM行 (既定は3) を出力。\n" +#~ " --label LABEL ファイル名の代わりにLABELを使用。\n" +#~ " -p --show-c-function 各変更を含むCの関数名を表示。\n" +#~ " -F RE --show-function-line=RE REと一致する直近の行を表示。" + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ "-y --side-by-side 縦列出力。\n" +#~ " -W NUM --width=NUM 高々NUM (既定は130) 印字桁で出力。\n" +#~ " --left-column 共通行は左列だけ出力。\n" +#~ " --suppress-common-lines 共通行の出力を抑止。" + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "--speed-large-files 巨大なファイルに分散した変更があると仮定。" + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "-X 衝突をくくりながら、変更を出力。" + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "" +#~ "-m --merge edスクリプトの代わりに、併合したファイルを出力 (既定は-A)。" + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "-L LABEL --label=LABEL ファイル名の代わりにLABELを使用。" diff --git a/local/recipes/tools/diffutils/source/po/lv.gmo b/local/recipes/tools/diffutils/source/po/lv.gmo new file mode 100644 index 0000000000..60de0b340f Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/lv.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/lv.po b/local/recipes/tools/diffutils/source/po/lv.po new file mode 100644 index 0000000000..d2aa10a860 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/lv.po @@ -0,0 +1,1604 @@ +# Latvian translation of diffutils. +# Copyright (C) 2009 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# +# Rihards Priedītis <rprieditis@gmail.com>, 2009, 2010. +# Rūdolfs Mazurs <rudolfs.mazurs@gmail.com>, 2014. +msgid "" +msgstr "" +"Project-Id-Version: diffutils-3.3-pre1\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2014-04-20 15:28+0300\n" +"Last-Translator: Rihards Prieditis <rprieditis@gmail.com>\n" +"Language-Team: Latvian <translation-team-lv@lists.sourceforge.net>\n" +"Language: lv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : " +"2);\n" +"X-Generator: Lokalize 1.5\n" + +#: lib/argmatch.c:134 +#, fuzzy, c-format +msgid "invalid argument %s for %s" +msgstr "nederīgs %s%s arguments “%s”" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "" + +#: lib/argmatch.c:154 +#, fuzzy +msgid "Valid arguments are:" +msgstr "nederīgs %s%s arguments “%s”" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "programmas kļūda" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "steka pārplūšana" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Nezināma sistēmas kļūda" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "parasta tukša datne" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "parasta datne" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "direktorija" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "simboliskā saite" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "ziņojumu rinda" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "semafors" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "koplietots atmiņas objekts" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "tipa atmiņas objekts" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "īpaša bloka datne" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "īpaša rakstzīmes datne" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "" + +#: lib/file-type.c:81 +#, fuzzy +msgid "multiplexed block special file" +msgstr "īpaša bloka datne" + +#: lib/file-type.c:84 +#, fuzzy +msgid "multiplexed character special file" +msgstr "īpaša rakstzīmes datne" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "" + +#: lib/file-type.c:90 +#, fuzzy +msgid "named file" +msgstr "dīvaina datne" + +#: lib/file-type.c:93 +#, fuzzy +msgid "network special file" +msgstr "īpaša bloka datne" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "" + +#: lib/file-type.c:102 +msgid "port" +msgstr "" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "sokets" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "dīvaina datne" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: opcija “-W %s” ir divdomīga\n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: opcija “%s” nav viennozīmīga, iespējas:" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: neatpazīta opcija “%c%s”\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: opcija “%c%s” neatļauj argumentu\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: opcijai “--%s” nepieciešams arguments\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: nederīga opcija -- “%c”\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: opcijai nepieciešams arguments -- “%c”\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "“" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "”" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Veiksmīgi" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Nav atbilstību" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Nederīga regulārā izteiksme" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Nederīga salīdzināmā rakstzīme" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Nederīgs rakstzīmju klases nosaukums" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Sekojošās otrādās slīpsvītras" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Nederīga atpakaļ norāde" + +#: lib/regcomp.c:156 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Nesakrītošs [ vai [^" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Nesakrītošs ( vai \\(" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Nesakrītošs \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Nederīgs \\{\\} saturs" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Nederīgas apgabala beigas" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Atmiņa izsmelta" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Nederīga iepriekšējā regulārā izteiksme" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Priekšlaicīgas beigas regulārai izteiksmei" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Pārāk liela regulārā izteiksme" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Nav atbilstoša ) vai \\)" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Nav iepriekšējas regulārās izteiksmes" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "atmiņa izsmelta" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "stdin" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "stdout" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "stderr" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "nezināma straume" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "neizdevās atkārtoti atvērt %s režīmā %s" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "nederīgs %s%s arguments “%s”" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "nederīgs piedēklis %s%s argumentā “%s”" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "%s%s arguments “%s” ir pārāk liels" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Pakoja %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Pakoja %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "(C)" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Licence GPLv3+: GNU GPL versija 3 vai vēlāka <http://gnu.org/licenses/gpl." +"html>.\n" +"Šī ir brīva programmatūra: jums ir brīvība to mainīt un izplatīt.\n" +"Tai NAV GARANTIJAS, cik to pieļauj likums.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Sarakstīja %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Sarakstīja %s un %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Sarakstīja %s, %s un %s\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Sarakstīja %s, %s, %s\n" +"un %s\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Sarakstīja %s, %s, %s,\n" +"%s un %s\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Sarakstīja %s, %s, %s,\n" +"%s, %s un %s\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Sarakstīja %s, %s, %s,\n" +"%s, %s, %s un %s\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Sarakstīja %s, %s, %s,\n" +"%s,%s, %s, %s,\n" +"un %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Sarakstīja %s, %s, %s,\n" +"%s,%s, %s, %s,\n" +"%s un %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Sarakstīja %s, %s, %s,\n" +"%s,%s, %s, %s,\n" +"%s, %s un citi.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Ziņojiet par kļūdām uz: %s\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Ziņojiet %s kļūdas uz: %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s mājas lapa: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "%s mājas lapa: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"Vispārēja palīdzība, izmantojot GNU programmatūru: <http://www.gnu.org/" +"gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Datnes %s un %s atšķiras\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Binārās datnes %s un %s atšķiras\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Nav jaunu rindu datnes beigās" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Lietojiet “%s --help”, lai uzzinātu vairāk." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "nederīga --ignore-initial vērtība “%s”" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "opcijas -l un -s nav savstarpēji saderīgas" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "rakstīšana neizdevās" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "standarta izvade" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b, --print-bytes drukāt atšķirīgos baitus" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i, --ignore-initial=IZLAIST izlaists pirmos IZLAIŽAMOS baitus ievadē" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=IZLAIST1:IZLAIST2 izlaist pirmos IZLAIST1 DATNE1 " +"baitus\n" +" un pirmos IZLAIST2 DATNE2 baitus" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l, --verbose izvadīt baitu numurus un atšķirīgo baitu vērtības" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=ROBEŽA salīdzināt līdz ROBEŽAs baitiem" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent nomākt visu parasto izvadi" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help parādīt šo palīdzību un iziet" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v, --version izvada informāciju par versiju un iziet" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Izmantošana: %s [OPCIJAS]... DATNE1 [DATNE2 [IZLAIST1 [IZLAIST2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Salīdzināt divas datnes baitu pa baitam." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"Neobligātie IZLAIST1 un IZLAIST2 norāda, cik baitus izlaist\n" +"katras datnes sākumā (pēc noklusējuma nulle)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Parametri, kas ir obligāti garajām opcijām, ir obligāti arī īsajām opcijām.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"IZLAIST vērtības var sekot vairāki piedēkļi:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, un tā tālāk T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Ja DATNEI ir “-” vai tā nav, tad lasīt standarta ievadi." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"Izejas status ir 0, ja ievads ir tāds pats, 1, ja tas ir atšķirīgs, 2, ja ir " +"nepatikšanas." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "nederīga --bytes vērtība “%s”" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "trūkst operands pēc “%s”" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "papildu operands “%s”" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s atšķiras: baits %s, rinda %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s atšķiras: baits %s, rinda %s ir %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: EOF uz %s\n" + +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s %s atšķiras: baits %s, rinda %s\n" + +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s %s atšķiras: baits %s, rinda %s\n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: EOF uz %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "nederīgs konteksta garums “%s”" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "lapošana netiek atbalstīta uz šī resursdatora" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "pārāk daudz datnes etiķešu opciju" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "nederīgs platums “%s”" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "konfliktējošas platuma opcijas" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "nederīgs horizontālais garums “%s”" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "nederīgs tabulācijas izmērs “%s”" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "konfliktējošas tabulācijas izmēru opcijas" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "--from-file un --to-file abi norādīti" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr " --normal izvada parastu diff (noklusējuma)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "-q, --brief ziņot tikai, ja datnes atšķiras" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s, --report-identical-files ziņot, ja divas datnes ir vienādas" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C NUM, --context[=NUM] izvadīt NUM (noklus. 3) kopētā konteksta rindas" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U NUM, --unified[=NUM] izvadīt NUM (noklus. 3) vienotā konteksta " +"rindas" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed izvada ed skriptu" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n, --rcs izvada RCS formāta diff" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side izvade divās kolonnās" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=NUM izvada līdz NUM (noklusējuma 130) drukas " +"kolonas" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +" --left-column izvadīt tikai kreiso kolonu no kopējām rindām" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines neizvadīt kopējās rindas" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "-p, --show-c-function rādīt, kurās C funkcijās ir izmaiņas" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "-F, --show-function-line=RE rādīt visnesenāko rindu, kas atbilst RE" + +#: src/diff.c:905 +#, fuzzy +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label ETIĶETE izmantot ETIĶETI nevis datnes nosaukumu\n" +" (var atkārtot)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs pārveidot tabulācijas par atstarpēm izvadē" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab pacelt tabulācijas rindu pirms tabulācijas" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=NUM tabulāciju pietura ik NUM drukas " +"kolonas (noklusējuma ir 8)" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty apspiest atstarpes vai tabulācijas pirms " +"tukšām\n" +" izvades rindām." + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "-l, --paginate izlaist izvadi caur “pr”, lai to lapotu" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r, --recursive rekursīvi salīdzina atrastās " +"apakšdirektorijas" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference nerādīt simboliskās saites" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "-N, --new-file trūkstošas datnes uzskatīt par tukšām" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +" --unidirectional-new-file trūkstošas pirmās datnes uzskatīt par tukšām" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case ignorēt reģistru, salīdzinot datņu nosaukumus" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case neignorēt reģistru, salīdzinot datņu " +"nosaukumus" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "-x, --exclude=ŠABLONS izslēgt datnes, kuras atbilst ŠABLONAM" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=DATNE izslēgt datnes, kuras atbilst jebkuram\n" +" šablonam DATNĒ" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=DATNE sākt ar DATNI, kad salīdzina direktorijas" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=DATNE1 salīdzina DANTE1 ar visiem operandiem;\n" +" DATNE1 var būt direktorija" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=FILE2 salīdzina visus operandus ar DANTE2;\n" +" DATNE2 var būt direktorija" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i, --ignore-case ignorē reģistra atšķirības datnes saturā" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion ignorēt izmaiņas dēļ tabulācijas izplešanās" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space ignorēt visas atstarpes rindu beigās" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change ignorēt izmaiņas dēļ atstarpēm" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space ignorēt visas atstarpes" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "-B, --ignore-blank-lines ignorēt izmaiņas tukšajās rindās" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE ignorēt izmaiņas rindās, kuras sakrīt ar RE" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text uztvert visas datnes kā teksta datnes" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr noņemt atkārtojošos rakstatgriezi ievadē" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr " --binary lasīt un rakstīt datus binārajā režīmā" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=NOSAUKUMS izvadīt sapludināto datni ar\n" +" “#ifdef NOSAUKUMS” diff" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr " --GTYPE-group-format=GFMT formatēt GTYPE ievades grupas ar GFMT" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr " --line-format=LFMT formatēt visas ievades rindas ar LFMT" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr " --LTYPE-line-format=LFMT formatēt LTYPE ievades rindām ar LFMT" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" Šīs formāta opcijas sniedz detalizētu kontroli pār diff izvadi,\n" +" vispārinot -D/--ifdef." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE ir “old”, “new” vai “unchanged”. GTYPE ir LTYPE vai “changed”." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT (tikai) var saturēt:\n" +" %< rindas no DATNE1\n" +" %> rindas no DATNE2\n" +" %= rindas kopīgas DATNE1 un DATNE2\n" +" %[-][PLATUMS][.[PREC]]{doxX}BURTS printf-style specifikācija BURTAM\n" +" BURTS ir šāds jaunai grupai, mazais reģistrs vecais grupai:\n" +" F pirmās rindas numurs\n" +" L pēdējās rindas numurs\n" +" N rindu skaits = L-F+1\n" +" E F-1\n" +" M L+1 %(A=B?T:E) ja A vienāds ar B tad T citādi E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT (tikai) var saturēt:\n" +" %L rindas saturs\n" +" %l rindas saturs, izņemot sekojošās jaunās rindas rakstzīmes\n" +" %[-][PLATUMS][.[PREC]]{doxX}n printf-style specifikācija ievades rindu\n" +" numuriem" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" Gan GFMT, gan LFMT var saturēt:\n" +" %% %\n" +" %c'C' vienu rakstzīmi C\n" +" %c'\\OOO' rakstzīmi ar oktālo kodu OOO\n" +" C rakstzīme C (vai citas rakstzīmes, kas attēlo pašas sevi)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal ļoti censties atrast mazāku izmaiņu kopu" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +" --horizon-lines=NUM uzturēt NUM rindas kopējiem prefiksiem un sufiksiem" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files pieņemt, ka datnes ir lielas ar daudz mazām izmaiņām" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help parādīt šo palīdzību un iziet" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version izvada informāciju par versiju un iziet" + +#: src/diff.c:982 +#, fuzzy +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"DATNES ir “DATNE1 DATNE2” vai “DIREKTORIJA1 DIREKTORIJA2” vai\n" +"“DIREKTORIJA DATNE...” vai “DATNE... DIREKTORIJA”" + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Ja ir doti --from-file vai --to-file, nav nekādu ierobežojumu uz DATNĒM." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Ja DATNE ir “-”, lasīt standarta ievadi." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Lietošana: %s [OPCIJAS]... DATNES\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Salīdzina DATNES rindu pa rindai." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "konfliktējoša %s opcijas vērtība “%s”" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "konfliktējoša izvades stila opcijas" + +#: src/diff.c:1058 +#, fuzzy, c-format +msgid "invalid color '%s'" +msgstr "nederīgs platums “%s”" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Tikai iekš %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "nevar salīdzināt “-” ar direktoriju" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "-D opcija nav atbalstīta ar direktorijām" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Kopējās apakšdirektorijas: %s un %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Datne %s ir %s kamēr datne %s ir %s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Simboliskās saites %s un %s atšķiras\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Datnes %s un %s ir identiskas\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "savstarpēji nesaderīgas opcijas" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "“-” norādīts vairāk par vienu ievades datni" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "lasīšana neizdevās" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A, --show-all izvada visas izmaņas, ieliekot iekavās konfliktus" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed izvada ed skirpta iekļautās izmaiņas\n" +" no VECĀSDATNES uz JŪSUDATNI iekš MANUDATNI." + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +"-E, --show-overlap tāpat kā -e, bet ieliekot iekavās konfliktus" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3, --easy-only līdzīgs -e, bet iekļauj tikai nepārklājošās " +"izmaiņas" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +"-x, --overlap-only līdzīgs -e, bet iekļauj tikai pārklājošās " +"izmaiņas" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" +"-X līdzīgs -x, bet ieliekot iekavās konfliktus" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "-i pievieno “w” un “q” komandas ed skriptā" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge izvada pašu sapludināto datni, vadoties pēc -A,\n" +" ja nav dotu citu opciju" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text uztvert visas datnes kā teksta datnes" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr noņemt atkārtojošos rakstatgriezi ievadē" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T, --initial-tab pacelt tabulācijas rindu pirms tabulācijas" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=PROGRAMMA izmantot PROGRAMMU, lai salīdzinātu divas datnes" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=ETIĶETE izmantot ETIĶETI nevis datnes nosaukumu\n" +" (var atkārtot)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help parādīt šo palīdzību un iziet" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version izvada informāciju par versiju un iziet" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Izmantošana: %s [OPCIJAS]... MANADATNE VECĀDATNE JŪSUDATNE\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Salīdzināt trīs datnes rindiņu pa rindiņai." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"Noklusējuma izvades formāts ir daudz maz cilvēkam lasāma izmaiņu " +"attēlojums.\n" +"\n" +"Opcijas -e, -E, -x, -X (un to garie varianti) liek izvadīt ed skriptu, " +"nevis\n" +"noklusējuma.\n" +"\n" +"Visbeidzot, -m (--merge) opcija liek iekšēji sapludināt diff3 un izvadīt " +"pašu\n" +"sapludināto datni. Netipiskām ievadēm, šis ir vēl spēcīgāks paņēmiens, nekā\n" +"ed izmantošana.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"Izejas statuss ir 0, ja tas ir veiksmīgs, 1, ja ir konflikts, 2, ja ir " +"nepatikšanas." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "iekšējā kļūda: sagāja grīstē diff bloku formāts" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff neizdevās:" + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "iekšējā kļūda: nederīgs diff veids iekš process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "nederīgs diff formāts; nederīgs izmaiņu atdalītājs" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "nederīgs diff formāts; nepilnīga pēdējā rinda" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "nevarēja izsaukt palīgprogrammu “%s”" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "nederīgs diff formāts; nederīgas rindas ievades rakstzīmes" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "iekšējā kļūda: nederīgs uz izvadi padotais diff veids" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "ievades datne saruka" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "nevar salīdzināt datņu nosaukumus “%s” un “%s”" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: rekursīvs direktorijas cikls" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o, --output=DATNE darboties interaktīvi, izvadot izvadu uz DATNI" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "" +"-i, --ignore-case uzskatīt ka augšējais un apakšējais reģistrs " +"ir\n" +" viens un tas pats" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion ignorēt izmaiņas dēļ tabulācijas izplešanās" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space ignorēt visas atstarpes rindu beigās" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change ignorēt izmaiņas dēļ atstarpēm" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space ignorēt visas atstarpes" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "-B, --ignore-blank-lines ignorēt izmaiņas tukšajās rindās" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE ignorēt izmaiņas rindās, kuras sakrīt ar RE" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr noņemt atkārtojošos rakstatgriezi ievadē" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a, --text uztvert visas datnes kā teksta datnes" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=NUM izvada līdz NUM (noklusējuma 130) drukas kolonas" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" +"-l, --left-column izvadīt tikai kreiso kolonu no kopējām rindām" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines neizvadīt kopējās rindas" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs pārveidot tabulācijas par atstarpēm izvadē" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +" --tabsize=NUM tabulāciju pietura ik NUM drukas " +"kolonas (noklusējuma ir 8)" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal ļoti censties atrast mazāku izmaiņu kopu" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files pieņemt, ka datnes ir lielas, daudz mazu izmaiņu" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=PROGRAMMA izmantot PROGRAMMU, lai salīdzinātu divas datnes" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help parādīt šo palīdzību un iziet" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v, --version izvada informāciju par versiju un iziet" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Lietošana: %s [OPCIJAS]... DATNE1 DATNE1\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Sānu-pie-sāna datņu DATNE1 un DATNE2 atšķirību sapludināšana." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "nevar interaktīvi sapludināt standarta ievadi" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "abas salīdzināmās datnes ir direktorijas" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tRediģēt tad izmantot abas versijas, katra izrotāta ar virsrakstu.\n" +"eb:\tRediģēt un tad izmantot abas versijas.\n" +"el vai e1:\tRediģēt un tad izmantot kreiso versiju.\n" +"er vai e2:\tRediģēt un tad izmantot labo versiju.\n" +"e:\tIgnorēt abas versijas, tad rediģēt jauno.\n" +"l vai 1:\tIzmantot kreiso versiju.\n" +"r vai 2:\tIzmantot labo versiju.\n" +"s:\tKlusi iekļaut kopējās rindas.\n" +"v:\tDetalizēti iekļaut kopējās rindas.\n" +"q:\tIziet.\n" + +#: src/util.c:662 +#, fuzzy, c-format +msgid "unrecognized prefix: %s" +msgstr "%s: neatpazīta opcija “--%s”\n" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "" + +#, fuzzy +#~ msgid " or 'auto' (the default)" +#~ msgstr " --normal izvada parastu diff (noklusējuma)" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: opcija “--%s” neatļauj argumentu\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: neatpazīta opcija “--%s”\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: opcija “-W %s” ir divdomīga\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: opcija “-W %s” neatļauj argumentu\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: opcijai “-W %s” nepieciešams arguments\n" + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i IZLAIST1:IZLAIST2 --ignore-initial=IZLAIST1:IZLAIST2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "-s --quiet --silent Izvada neko, izdod tikai izejas stāvokli." + +#~ msgid "--help Output this help." +#~ msgstr "--help Izvada šo palīdzību." + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ "-c -C NUM --context[=NUM] Izvada NUM (noklusētais 3) rinfas no kopētā " +#~ "konteksta.\n" +#~ "-u -U NUM --unified[=NUM] Izvada NUM (noklusētais 3) rinfas no " +#~ "unificēta konteksta.\n" +#~ " --label ETIĶETE Izmanto ETIĶETES faila nosaukumos.\n" +#~ " -p --show-c-function Rāda C funkcijas, kurās ir izmaiņas.\n" +#~ " -F RE --show-function-line=RE Rāda nesenāko skarītošo RE rindu." + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ "-y --side-by-side Izvada divas kolonas.\n" +#~ " -W NUM --width=NUM Izvada līdz NUM (noklusētais 130) drukas kolonas.\n" +#~ " --left-column Izvada tikai kreisās kolonas no kopējām rindām.\n" +#~ " --suppress-common-lines Neizvada kopējās rindas." + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "" +#~ "--speed-large-files Pieņemt, ka faili ir lieli un satur daudzas mazas " +#~ "izmaiņas." + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "-X Izvada pārklājušas izmaiņas, ieliekot iekavās tās." + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "" +#~ "-m --merge Izvada sapludinātu failu nevis ed skriptu (noklusētais ir -" +#~ "A)." + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "" +#~ "-L ETIĶETE --label=ETIĶETE Izmantot ETIĶETI nevis faila nosaukumu." + +#~ msgid "%s: illegal option -- %c\n" +#~ msgstr "%s: neatļauta opcija -- %c\n" + +#~ msgid "" +#~ "This is free software; see the source for copying conditions. There is " +#~ "NO\n" +#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR " +#~ "PURPOSE.\n" +#~ msgstr "" +#~ "Šī ir brīva programmatūra; apskaties izejas kodu autortiesību " +#~ "nosacījumiem.\n" +#~ "NAV nekāda garantijas; pat TIRGOŠANAS vai DERĪBA KONKRĒTAM MĒRĶIM.\n" + +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>." +#~ msgstr "Ziņot par kļūdam uz <bug-gnu-utils@gnu.org>." + +#~ msgid "`-%ld' option is obsolete; use `-%c %ld'" +#~ msgstr "`-%ld' opcija ir novecojusi; izmantojiet `-%c %ld'" + +#~ msgid "`-%ld' option is obsolete; omit it" +#~ msgstr "`-%ld' opcija ir novecojusi; nelietojiet to" + +#~ msgid "subsidiary program `%s' not found" +#~ msgstr "netika atrasta palīgprogramma \"%s\"" + +#~ msgid "subsidiary program `%s' failed" +#~ msgstr "neizdevās izpildīt palīgprogrammu \"%s\"" + +#~ msgid "subsidiary program `%s' failed (exit status %d)" +#~ msgstr "neizdevās izpildīt palīgprogrammu \"%s\" (izejas stauss %d)" diff --git a/local/recipes/tools/diffutils/source/po/ms.gmo b/local/recipes/tools/diffutils/source/po/ms.gmo new file mode 100644 index 0000000000..9b15af14e4 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/ms.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/ms.po b/local/recipes/tools/diffutils/source/po/ms.po new file mode 100644 index 0000000000..3d30a330fd --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/ms.po @@ -0,0 +1,1604 @@ +# diffutils Bahasa Melayu (Malay) (ms). +# Copyright (C) 2003, 2015 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Sharuzzaman Ahmat Raslan <sharuzzaman@gmail.com>, 2003, 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: diffutils 3.3-pre1\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2015-09-24 17:50+0800\n" +"Last-Translator: Sharuzzaman Ahmat Raslan <sharuzzaman@gmail.com>\n" +"Language-Team: Malay <translation-team-ms@lists.sourceforge.net>\n" +"Language: ms\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 1.8.5\n" + +#: lib/argmatch.c:134 +#, fuzzy, c-format +msgid "invalid argument %s for %s" +msgstr "hujah tidak sah %s untuk %s" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "" + +#: lib/argmatch.c:154 +#, fuzzy +msgid "Valid arguments are:" +msgstr "hujah tidak sah %s untuk %s" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "ralat program" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "stack melimpah" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Ralat sistem tidak diketahui" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "fail kosong biasa" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "fail biasa" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "direktori" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "pautan simbolik" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "barisan mesej" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "semaphore" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "objek ingatan dikongsi" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "objek memori berjenis" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "fail khas blok" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "fail khas aksara" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "" + +#: lib/file-type.c:81 +#, fuzzy +msgid "multiplexed block special file" +msgstr "fail khas blok" + +#: lib/file-type.c:84 +#, fuzzy +msgid "multiplexed character special file" +msgstr "fail khas aksara" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "" + +#: lib/file-type.c:90 +#, fuzzy +msgid "named file" +msgstr "fail pelik" + +#: lib/file-type.c:93 +#, fuzzy +msgid "network special file" +msgstr "fail khas blok" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "" + +#: lib/file-type.c:102 +msgid "port" +msgstr "" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "soket" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "fail pelik" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: pilihan '%s' adalah kabur; kemungkinan:" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: pilihan '%s' adalah kabur; kemungkinan:" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: -c tidak disokong pada rekabentuk %s\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: pilihan `-W %s' tidak mengizinkan hujah\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "Pilihan \"%s\" memerlukan hujah" + +#: lib/getopt.c:621 +#, fuzzy, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "Tetapan pilihan lekapan tidak sah: %s\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, fuzzy, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "Pilihan \"%s\" memerlukan hujah" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "`" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "'" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Berjaya" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Tiada padanan" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Regular expression tidak sah" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Aksara pengumpulsemakan tidak sah" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Nama kelas aksara tidak sah" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Slash dibelakang" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Rujukan belakang tidak sah" + +#: lib/regcomp.c:156 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "[ atau [^ tidak sepadan" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "( atau \\( tidak sepadan" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "\\{ tidak sepadan" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Kandungan \\{\\} tidak sah" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Julat akhir tidak sah" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Kehabisan memori" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Regular expression awalan tidak sah" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Regular expression tamat tiba-tiba" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Regular expression terlalu besar" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr ") atau \\) tidak sepadan" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Tiada regular expression terdahulu" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "kehabisan memori" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "stdin" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "stdout" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "stderr" + +#: lib/xfreopen.c:38 +#, fuzzy +msgid "unknown stream" +msgstr "Tidak dapat mencipta soket aliran." + +#: lib/xfreopen.c:39 +#, fuzzy, c-format +msgid "failed to reopen %s with mode %s" +msgstr "regcomp() gagal pada %s: %s." + +#: lib/xstrtol-error.c:63 +#, fuzzy, c-format +msgid "invalid %s%s argument '%s'" +msgstr "hujah tidak sah %s untuk %s" + +#: lib/xstrtol-error.c:68 +#, fuzzy, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "hujah tidak sah %s untuk %s" + +#: lib/xstrtol-error.c:72 +#, fuzzy, c-format +msgid "%s%s argument '%s' too large" +msgstr "hujah kabur %s untuk %s" + +#: lib/version-etc.c:74 +#, fuzzy, c-format +msgid "Packaged by %s (%s)\n" +msgstr "" +"Ditulis oleh by %s, %s, %s,\n" +"and %s.\n" + +#: lib/version-etc.c:77 +#, fuzzy, c-format +msgid "Packaged by %s\n" +msgstr "Ditulis oleh %s, %s, and %s.\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "(C)" + +#: lib/version-etc.c:86 +#, fuzzy +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"Lesen GPLv3+: GNU GPL vesri 3 atau selepasnya <http://gnu.org/licenses/gpl." +"html>\n" +"Ini adalah perisan bebas: anda bebas untuk mengubah dan mengulangedarnya.\n" +"TIADA JAMINAN diberikan, sehingga had yang dibenarkan oleh undang-undang.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Ditulis oleh %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Ditulis oleh %s and %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Ditulis oleh %s, %s, and %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Ditulis oleh by %s, %s, %s,\n" +"and %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Ditulis oleh %s, %s, %s,\n" +"%s, and %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Ditulis oleh %s, %s, %s,\n" +"%s, %s, and %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Ditulis oleh %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Ditulis oleh %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Ditulis oleh %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Ditulis oleh %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, fuzzy, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "Lapor pepijat ke %s.\n" + +#: lib/version-etc.c:247 +#, fuzzy, c-format +msgid "Report %s bugs to: %s\n" +msgstr "" +"\n" +"Lapor pepijat ke <%s>.\n" + +#: lib/version-etc.c:251 +#, fuzzy, c-format +msgid "%s home page: <%s>\n" +msgstr "" +"// Dijana oleh %s.\n" +"// Lapor pepijat ke <%s>.\n" +"// Laman utama: <%s>.\n" +"\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "Laman web %s: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +#, fuzzy +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"Bantuan umum menggunakan perisian GNU: <http://www.gnu.org/gethelp/>.\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Fail %s dan %s berbeza\n" + +#: src/analyze.c:455 +#, fuzzy, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Fail %s dan %s berbeza\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Tiada baris baru pada penghujung fail" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, fuzzy, c-format +msgid "Try '%s --help' for more information." +msgstr "Cuba `%s --help' untuk maklumat lanjut." + +#: src/cmp.c:137 +#, fuzzy, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "nilai `%s' --ignore-initial tidak sah" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "pilihan -l dan -s tidak sepadan" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "gagal menulis" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "keluaran piawai" + +#: src/cmp.c:161 +#, fuzzy +msgid "-b, --print-bytes print differing bytes" +msgstr "-b --print-bytes Cetak byte berbeza." + +#: src/cmp.c:162 +#, fuzzy +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i LANGKAU --ignore-initial=LANGKAU Langkau LANGKAU byte pertama masukan." + +#: src/cmp.c:163 +#, fuzzy +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +" Langkau LANGKAU1 byte pertama untuk FAIL1 dan LANGKAU2 byte pertama untuk " +"FAIL2." + +#: src/cmp.c:165 +#, fuzzy +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "-l --verbose Keluarkan nombor byte dan nilai semua byte berbeza." + +#: src/cmp.c:166 +#, fuzzy +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n HAD --bytes=HAD Banding paling banyak HAD byte." + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent sekat semua keluaran normal" + +#: src/cmp.c:168 +#, fuzzy +msgid " --help display this help and exit" +msgstr "Papar teks bantuan ini" + +#: src/cmp.c:169 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "Papar maklumat versi dan keluar" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Penggunaan: %s [PILIHAN]... FAIL1 [FAIL2 [LANGKAU1 [LANGKAU2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Banding dua fail setiap byte." + +#: src/cmp.c:182 +#, fuzzy +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"LANGKAU1 dan LANGKAU2 adalah jumlah byte untuk dilangkau dalam setiap fail." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +#, fuzzy +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Hujah wajib kepada pilihan panjang adalah wajib untuk pilihan pendek juga.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"Nilai LANGKAU boleh diikuti dengan akhiran pekali berikut:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, dan seterusnya untuk T, P, E, Z, Y." + +#: src/cmp.c:194 +#, fuzzy +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Jika FAIL adalah `-' atau tiada, baca masukan piawai." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"Status keluar adalah 0 jika masukan adalah sama, 1 jika berbeza, 2 jika " +"bermasalah." + +#: src/cmp.c:240 +#, fuzzy, c-format +msgid "invalid --bytes value '%s'" +msgstr "nilai --bytes `%s' tidak sah" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, fuzzy, c-format +msgid "missing operand after '%s'" +msgstr "operan hilang selepas `%s'" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, fuzzy, c-format +msgid "extra operand '%s'" +msgstr "operan tambahan `%s'" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s berbeza: byte %s, baris %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s berbeza: byte %s, baris %s adalah %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: EOF pada %s\n" + +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s %s berbeza: byte %s, baris %s\n" + +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s %s berbeza: byte %s, baris %s\n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: EOF pada %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, fuzzy, c-format +msgid "invalid context length '%s'" +msgstr "panjang konteks `%s' tidak sah" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "pagination tidak disokong pada hos ini" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "terlalu banyak pilihan label fail" + +#: src/diff.c:528 +#, fuzzy, c-format +msgid "invalid width '%s'" +msgstr "lebar `%s' tidak sah" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "pilihan lebar berkonflik" + +#: src/diff.c:557 +#, fuzzy, c-format +msgid "invalid horizon length '%s'" +msgstr "panjang horizon `%s' tidak sah" + +#: src/diff.c:613 +#, fuzzy, c-format +msgid "invalid tabsize '%s'" +msgstr "saiz tab `%s' tidak sah" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "pilihan saiz tab berkonflik" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "--from-file dan --to-file kedua-duanya dinyatakan" + +#: src/diff.c:891 +#, fuzzy +msgid " --normal output a normal diff (the default)" +msgstr "--normal Keluarkan diff normal." + +#: src/diff.c:892 +#, fuzzy +msgid "-q, --brief report only when files differ" +msgstr "-q --brief Keluaran hanya jika fail berbeza." + +#: src/diff.c:893 +#, fuzzy +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s --report-identical-files Lapor apabila dua fail adalah sama." + +#: src/diff.c:894 +#, fuzzy +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c -C NOM --context[=NOM] Keluarkan NOM (default 3) baris konteks yang " +"disalin.\n" +"-u -U NOM --unified[=NOM] Keluarkan NOM (default 3) baris konteks " +"tergabung.\n" +" --label LABEL Guna LABEL selain daripada nama fail.\n" +" -p --show-c-function Papar fungsi C yang mana dalam setiap perubahan.\n" +" -F RE --show-function-line=RE Papar baris terbaru sepadan RE." + +#: src/diff.c:895 +#, fuzzy +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-c -C NOM --context[=NOM] Keluarkan NOM (default 3) baris konteks yang " +"disalin.\n" +"-u -U NOM --unified[=NOM] Keluarkan NOM (default 3) baris konteks " +"tergabung.\n" +" --label LABEL Guna LABEL selain daripada nama fail.\n" +" -p --show-c-function Papar fungsi C yang mana dalam setiap perubahan.\n" +" -F RE --show-function-line=RE Papar baris terbaru sepadan RE." + +#: src/diff.c:896 +#, fuzzy +msgid "-e, --ed output an ed script" +msgstr "-e --ed Keluarkan skrip ed." + +#: src/diff.c:897 +#, fuzzy +msgid "-n, --rcs output an RCS format diff" +msgstr "-n --rcs Keluarkan diff format RCS." + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side keluaran dalam dua lajur" + +#: src/diff.c:899 +#, fuzzy +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w NOM --width=NOM Keluarkan paling banyak NOM (default 130) lajur cetakan." + +#: src/diff.c:900 +#, fuzzy +msgid "" +" --left-column output only the left column of common lines" +msgstr "-l --left-column Keluarkan hanya lajur kiri baris yang sama." + +#: src/diff.c:901 +#, fuzzy +msgid " --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines Jangan keluarkan baris sama." + +#: src/diff.c:903 +#, fuzzy +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" +"-c -C NOM --context[=NOM] Keluarkan NOM (default 3) baris konteks yang " +"disalin.\n" +"-u -U NOM --unified[=NOM] Keluarkan NOM (default 3) baris konteks " +"tergabung.\n" +" --label LABEL Guna LABEL selain daripada nama fail.\n" +" -p --show-c-function Papar fungsi C yang mana dalam setiap perubahan.\n" +" -F RE --show-function-line=RE Papar baris terbaru sepadan RE." + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "-F, --show-function-line=RE papar baris paling terkini sepadan RE" + +#: src/diff.c:905 +#, fuzzy +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "-L LABEL --label=LABEL Guna LABEL selain daripada nama fail." + +#: src/diff.c:908 +#, fuzzy +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t --expand-tabs Kembang tab kepada ruang dalam keluaran." + +#: src/diff.c:909 +#, fuzzy +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T --initial-tab Jadikan tab sebaris dengan menambah awalan tab." + +#: src/diff.c:910 +#, fuzzy +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "--tabsize=NOM Hentian tab setial NOM (default 8) lajur cetakan." + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty sekat ruang atau tab sebelum baris keluaran " +"kosong" + +#: src/diff.c:912 +#, fuzzy +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "-l --paginate Salur keluaran menerusi `pr' untuk paginate." + +#: src/diff.c:914 +#, fuzzy +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r --recursive Banding berulang-ulang sebarang subdirektori yang dijumpai." + +#: src/diff.c:915 +#, fuzzy +msgid " --no-dereference don't follow symbolic links" +msgstr "Jangan ikut pautan simbolik, tulisemula" + +#: src/diff.c:916 +#, fuzzy +msgid "-N, --new-file treat absent files as empty" +msgstr "-N --new-file Anggap fail tidak wujud sebagai kosong." + +#: src/diff.c:917 +#, fuzzy +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "--unidirectional-new-file Anggap fail tidak wujud sebagai kosong." + +#: src/diff.c:918 +#, fuzzy +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "--ignore-file-name-case Abai case apabila membanding nama fail." + +#: src/diff.c:919 +#, fuzzy +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +"--no-ignore-file-name-case Ambil kira case ketika membanding nama fail." + +#: src/diff.c:920 +#, fuzzy +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "-x PAT --exclude=PAT Asing fail yang sepadan PAT." + +#: src/diff.c:921 +#, fuzzy +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X FAIL --exclude-from=FAIL Asing fail yang sepadan sebarang corak dalam " +"FAIL." + +#: src/diff.c:922 +#, fuzzy +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S FAIL --starting-file=FAIL Mula dengan FAIL apabila membanding direktori." + +#: src/diff.c:923 +#, fuzzy +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +"--from-file=FAIL1 Banding FAIL1 kepada semua operan. FAIL1 boleh jadi " +"direktori." + +#: src/diff.c:925 +#, fuzzy +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +"--to-file=FAIL2 Banding semua operan kepada FAIL2. FAIL2 boleh jadi " +"direktori." + +#: src/diff.c:928 +#, fuzzy +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "-i --ignore-case Abai perbezaan case dalam kandungan fail." + +#: src/diff.c:929 +#, fuzzy +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E --ignore-tab-expansion Abai perubahan diakibatkan oleh pengembangan tab." + +#: src/diff.c:930 +#, fuzzy +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-w --ignore-all-space Abai semua ruang putih." + +#: src/diff.c:931 +#, fuzzy +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b --ignore-space-change Abai perubahan dalam jumlah ruang putih." + +#: src/diff.c:932 +#, fuzzy +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w --ignore-all-space Abai semua ruang putih." + +#: src/diff.c:933 +#, fuzzy +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B --ignore-blank-lines Abai perubahan dimana baris adalah kesemuanya " +"kosong." + +#: src/diff.c:934 +#, fuzzy +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I RE --ignore-matching-lines=RE Abai perubahan dimana baris semua sepadan " +"RE." + +#: src/diff.c:936 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr "-a --text Layan semua fail sebagai teks." + +#: src/diff.c:937 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "--strip-trailing-cr Buang enter penghujung pada masukan." + +#: src/diff.c:939 +#, fuzzy +msgid " --binary read and write data in binary mode" +msgstr "--binary Baca dan tulis data dalam mod binari." + +#: src/diff.c:942 +#, fuzzy +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D NAMA --ifdef=NAMA Keluarkan fail tergabung untuk menunjukkan perbezaa " +"`#ifdef NAMA'." + +#: src/diff.c:943 +#, fuzzy +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +"--GTYPE-group-format=GFMT Hampir sama, tetapi format masukan GTYPE " +"dikumpulkan dengan GFMT." + +#: src/diff.c:944 +#, fuzzy +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "" +"--line-format=LFMT Hampir sama, tetapi format semua baris masukan dengan " +"LFMT." + +#: src/diff.c:945 +#, fuzzy +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +"--LTYPE-line-format=LFMT Hampir sama, tetapi format baris masukan LTYPE " +"dengan LFMT." + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" + +#: src/diff.c:948 +#, fuzzy +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE adalah `old', `new', atau `unchanged'. GTYPE adalah LTYPE atau " +"`changed'." + +#: src/diff.c:949 +#, fuzzy +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT boleh mengandungi:\n" +" %< baris dari FAIL1\n" +" %> baris dari FAIL2\n" +" %= baris yang sama pada FAIL1 dan FAIL2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER spec gaya-printf untuk LETTER\n" +" LETTER adalah seperti berikut untuk kumpulan baru, huruf kecil untuk " +"kumpulan lama:\n" +" F nombor baris pertama\n" +" L nombor baris terakhir\n" +" N jumlah baris = L-F+1\n" +" E F-1\n" +" M L+1" + +#: src/diff.c:961 +#, fuzzy +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT boleh mengandungi:\n" +" %L kandungan baris\n" +" %l kandungan baris, tidak termasuk baris baru dipenghujung\n" +" %[-][WIDTH][.[PREC]]{doxX}n spec gaya-printf untuk nombor baris masukan" + +#: src/diff.c:965 +#, fuzzy +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" Sama ada GFMT atau LFMT boleh mengandungi:\n" +" %% %\n" +" %c'C' satu aksara C\n" +" %c'\\OOO' aksara dengan kod oktal OOO" + +#: src/diff.c:971 +#, fuzzy +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d --minimal Cuba cari dengan tekun set perbezaan yang kecil." + +#: src/diff.c:972 +#, fuzzy +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "--horizon-lines=NOM Pastikan NOM baris prefix dan suffix sama." + +#: src/diff.c:973 +#, fuzzy +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +"--speed-large-files Anggap fail besar dan banyak perubahan kecil tersebar." + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" + +#: src/diff.c:979 +#, fuzzy +msgid " --help display this help and exit" +msgstr "Papar teks bantuan ini" + +#: src/diff.c:980 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "Papar maklumat versi dan keluar" + +#: src/diff.c:982 +#, fuzzy +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"FAIL-FAIL adalah `FAIL1 FAIL2' atau `DIR1 DIR2' atau `DIR FAIL...' atau " +"`FAIL... DIR'." + +#: src/diff.c:983 +#, fuzzy +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "Jika --from-file atau --to-file diberi, tiada sekatan pada FAIL." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +#, fuzzy +msgid "If a FILE is '-', read standard input." +msgstr "Jika FAIL adalah `-', baca masukan piawai." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Penggunaan: %s [PILIHAN]... FAIL\n" + +#: src/diff.c:995 +#, fuzzy +msgid "Compare FILES line by line." +msgstr "Banding fail setiap baris." + +#: src/diff.c:1029 +#, fuzzy, c-format +msgid "conflicting %s option value '%s'" +msgstr "nilai pilihan %s berkonflik `%s'" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "pilihan gaya keluaran berkonflik" + +#: src/diff.c:1058 +#, fuzzy, c-format +msgid "invalid color '%s'" +msgstr "lebar `%s' tidak sah" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Hanya dalam %s: %s\n" + +#: src/diff.c:1248 +#, fuzzy +msgid "cannot compare '-' to a directory" +msgstr "tidak dapat membandingkan `-' kepada direktori" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "pilihan -D tidak disokong dengan direktori" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Subdirektori umum: %s dan %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Fail %s adalah %s manakala fail %s adalah %s\n" + +#: src/diff.c:1370 +#, fuzzy, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "%s bukan fail biasa atau pautan simbolik." + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Fail %s dan %s adalah serupa\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "pilihan tidak sepadan" + +#: src/diff3.c:391 +#, fuzzy +msgid "'-' specified for more than one input file" +msgstr "`-' dinyatakan untuk lebih daripada satu fail masukan" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "gagal membaca" + +#: src/diff3.c:475 +#, fuzzy +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "-A --show-all Keluarkan semua perubahan, kurungkan konflik." + +#: src/diff3.c:477 +#, fuzzy +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e --ed Keluarkan perubahan tidak digabung daripada OLDFILE ke YOURFILE " +"kedalam MYFILE." + +#: src/diff3.c:479 +#, fuzzy +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +"-E --show-overlap Keluarkan perubahan tidak digabung, kurungkan konflik." + +#: src/diff3.c:480 +#, fuzzy +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3 --easy-only Keluarkan perubahan tidak digabung dan tidak bertindih." + +#: src/diff3.c:481 +#, fuzzy +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "-x --overlap-only Keluarkan perubahan bertindih." + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" + +#: src/diff3.c:483 +#, fuzzy +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "-i Tambah arahan `w' dan `q' kepada skrip ed." + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" + +#: src/diff3.c:488 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr "-a --text Layan semua fail sebagai teks." + +#: src/diff3.c:489 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "--strip-trailing-cr Buang enter penghujung pada masukan." + +#: src/diff3.c:490 +#, fuzzy +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T --initial-tab Jadikan tab sebaris dengan menambah awalan tab." + +#: src/diff3.c:491 +#, fuzzy +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "--diff-program=PROGRAM Guna PROGRAM untuk membanding fail." + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" + +#: src/diff3.c:495 +#, fuzzy +msgid " --help display this help and exit" +msgstr "Papar teks bantuan ini" + +#: src/diff3.c:496 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "Papar maklumat versi dan keluar" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Penggunaan: %s [PILIHAN]... MYFILE OLDFILE YOURFILE\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Banding tiga fail tiap-tiap baris." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"Status keluar adalah 0 jika berjaya, 1 jika konflik, 2 jika bermasalah." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "ralat dalaman: kerosakan dalam format blok diff" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff gagal: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "ralat dalaman: jenis diff tidak sah dalam process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "format diff tidak sah; pengasing perbezaan tidak sah" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "format diff tidak sah; baris akhir tidak lengkap" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, fuzzy, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "program subsidiari `%s' tidak dapat dilaksanakan" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "format diff tidak sah; aksara awal baris tidak betul" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "ralat dalaman: jenis diff tidak sah diberikan kepada keluaran" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "fail masukan mengecil" + +#: src/dir.c:156 +#, fuzzy, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "tidak dapat membandingkan fail bernama `%s' dan `%s'" + +#: src/dir.c:225 +#, fuzzy, c-format +msgid "%s: recursive directory loop" +msgstr "\"%s\" adalah sebuah direktori" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +#, fuzzy +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o FAIL --output=FAIL Operasi secara interaktif, hantar keluaran ke FAIL." + +#: src/sdiff.c:175 +#, fuzzy +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i --ignore-case Anggap huruf besar dan kecil sebagai sama." + +#: src/sdiff.c:176 +#, fuzzy +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E --ignore-tab-expansion Abai perubahan diakibatkan oleh pengembangan tab." + +#: src/sdiff.c:177 +#, fuzzy +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-w --ignore-all-space Abai semua ruang putih." + +#: src/sdiff.c:178 +#, fuzzy +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b --ignore-space-change Abai perubahan dalam jumlah ruang putih." + +#: src/sdiff.c:179 +#, fuzzy +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-w --ignore-all-space Abai semua ruang putih." + +#: src/sdiff.c:180 +#, fuzzy +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" +"-B --ignore-blank-lines Abai perubahan dimana baris adalah kesemuanya " +"kosong." + +#: src/sdiff.c:181 +#, fuzzy +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I RE --ignore-matching-lines=RE Abai perubahan dimana baris semua sepadan " +"RE." + +#: src/sdiff.c:182 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "--strip-trailing-cr Buang enter penghujung pada masukan." + +#: src/sdiff.c:183 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr "-a --text Layan semua fail sebagai teks." + +#: src/sdiff.c:185 +#, fuzzy +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w NOM --width=NOM Keluarkan paling banyak NOM (default 130) lajur cetakan." + +#: src/sdiff.c:186 +#, fuzzy +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "-l --left-column Keluarkan hanya lajur kiri baris yang sama." + +#: src/sdiff.c:187 +#, fuzzy +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines Jangan keluarkan baris sama." + +#: src/sdiff.c:189 +#, fuzzy +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t --expand-tabs Kembang tab kepada ruang dalam keluaran." + +#: src/sdiff.c:190 +#, fuzzy +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "--tabsize=NOM Hentian tab setial NOM (default 8) lajur cetakan." + +#: src/sdiff.c:192 +#, fuzzy +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d --minimal Cuba cari dengan tekun set perbezaan yang kecil." + +#: src/sdiff.c:193 +#, fuzzy +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H --speed-large-files Anggap fail besar dan banyak perubahan kecil " +"tersebar." + +#: src/sdiff.c:194 +#, fuzzy +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "--diff-program=PROGRAM Guna PROGRAM untuk membanding fail." + +#: src/sdiff.c:196 +#, fuzzy +msgid " --help display this help and exit" +msgstr "Papar teks bantuan ini" + +#: src/sdiff.c:197 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "Papar maklumat versi dan keluar" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Penggunaan: %s [PILIHAN]... FAIL1 FAIL2\n" + +#: src/sdiff.c:208 +#, fuzzy +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Gabung bersebelahan perbezaaan fail." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "tidak dapat menggabung masukan piawai secara interaktif" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "kedua-dua fail yang akan dibanding adalah direktori" + +#: src/sdiff.c:818 +#, fuzzy +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tSunting kemudian guna kedua-dua versi, setiap satu ditambah dengan " +"header.\n" +"eb:\tSunting kemudian guna kedua-dua versi.\n" +"el:\tSunting kemudian guna versi kiri.\n" +"er:\tSunting kemudian guna versi kanan.\n" +"e:\tSunting versi baru.\n" +"l:\tGuna versi kiri.\n" +"r:\tGuna versi kanan.\n" +"s:\tSertakan baris sama dengan senyap.\n" +"v:\tSertakan baris sama dengan berjela.\n" +"q:\tKeluar.\n" + +#: src/util.c:662 +#, fuzzy, c-format +msgid "unrecognized prefix: %s" +msgstr "%s: pilihan '%s' adalah kabur; kemungkinan:" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "" + +#, fuzzy +#~ msgid " or 'auto' (the default)" +#~ msgstr "--normal Keluarkan diff normal." + +#, fuzzy +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: pilihan `-W %s' tidak mengizinkan hujah\n" + +#, fuzzy +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: pilihan '%s' adalah kabur; kemungkinan:" + +#, fuzzy +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: pilihan '%s' adalah kabur; kemungkinan:" + +#, fuzzy +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: pilihan `-W %s' tidak mengizinkan hujah\n" + +#, fuzzy +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "Pilihan \"%s\" memerlukan hujah" diff --git a/local/recipes/tools/diffutils/source/po/nb.gmo b/local/recipes/tools/diffutils/source/po/nb.gmo new file mode 100644 index 0000000000..8dcc4a44b6 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/nb.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/nb.po b/local/recipes/tools/diffutils/source/po/nb.po new file mode 100644 index 0000000000..18752884aa --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/nb.po @@ -0,0 +1,1533 @@ +# Norwegian bokmål translation of GNU diffutils +# Copyright (C) 2016 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Åka Sikrom <a4@hush.com>, 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: diffutils-3.5.25\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2017-05-21 15:11+0200\n" +"Last-Translator: Åka Sikrom <a4@hush.com>\n" +"Language-Team: Norwegian Bokmaal <i18n-nb@lister.ping.uio.no>\n" +"Language: nb\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 1.8.7.1\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "argumentet %s er ugyldig for %s" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "argumentet %s er flertydig for %s" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "Følgende argumenter kan brukes:" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "programfeil" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "stabel er full" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Ukjent systemfeil" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "vanlig tom fil" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "vanlig fil" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "mappe" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "symbolsk lenke" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "meldingskø" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "semafor" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "delt minneobjekt" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "typebestemt minneobjekt" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "blokk-spesialfil" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "tegn-spesialfil" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "tilstøtende data" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "dør" + +#: lib/file-type.c:81 +msgid "multiplexed block special file" +msgstr "oppstykket blokk-spesialfil" + +#: lib/file-type.c:84 +msgid "multiplexed character special file" +msgstr "oppstykket tegn-spesialfil" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "oppstykket fil" + +#: lib/file-type.c:90 +msgid "named file" +msgstr "navngitt fil" + +#: lib/file-type.c:93 +msgid "network special file" +msgstr "nettverk-spesialfil" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "flyttet fil med innhold" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "flyttet fil uten innhold" + +#: lib/file-type.c:102 +msgid "port" +msgstr "port" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "sokkel" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "whiteout" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "rar fil" + +#: lib/getopt.c:278 +#, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: valget «%s%s» er flertydig\n" + +#: lib/getopt.c:284 +#, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: valget «%s%s» er flertydig, og kan bety følgende:" + +#: lib/getopt.c:319 +#, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: «%s%s» er et ukjent valg\n" + +#: lib/getopt.c:345 +#, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: valget «%s%s» tillater ikke argumenter\n" + +#: lib/getopt.c:360 +#, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: valget «%s%s» krever et argument\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: «%c» er et ugyldig valg\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: valget -- «%c» krever et argument\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "«" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "»" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Fullført" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Ingen treff" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Ugyldig regulært uttrykk" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Ugyldig sorteringstegn" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Ugyldig tegnklassenavn" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Etterfølgende omvendt skråstrek" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Ugyldig tilbakereferanse" + +#: lib/regcomp.c:156 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Ingen treff på «[», «[^», «[:», «[.» eller «[=»" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Ingen treff på «(» eller «\\(»" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Ingen treff på «\\{{»" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Ugyldig innhold i «\\{\\}»" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Ugyldig slutt på rekkevidde" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Minnet er fullt" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Ugyldig foregående regulært uttrykk" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "For tidlig slutt på regulært uttrykk" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Regulært uttrykk er for stort" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Ingen treff på «)» eller «\\)»" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Intet tidligere regulært uttrykk" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "minnet er fullt" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "std.innkanal" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "std.utkanal" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "std.feilkanal" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "ukjent strøm" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "klarte ikke å åpne %s på nytt med modus %s" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "%s%s-argumentet «%s» er ugyldig" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "ugyldig suffiks i %s%s-argument «%s»" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "%s%s-argumentet «%s» er for stort" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Pakket av %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Pakket av %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Lisens GPLv3+: GNU GPL versjon 3 eller senere <http://gnu.org/licenses/gpl." +"html>.\n" +"Dette er fri programvare. Du kan endre den og dele den videre.\n" +"Det stilles INGEN GARANTI, i den grad dette tillates av gjeldende lovverk.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Skrevet av %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Skrevet av %s og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Skrevet av %s, %s og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Skrevet av %s, %s, %s\n" +"og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Skrevet av %s, %s, %s,\n" +"%s og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Skrevet av %s, %s, %s,\n" +"%s, %s og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Skrevet av %s, %s, %s,\n" +"%s, %s, %s og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Skrevet av %s, %s, %s,\n" +"%s, %s, %s, %s\n" +"og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Skrevet av %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Skrevet av %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s og andre.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Rapporter programfeil til: %s\n" +"Rapporter oversettelsesfeil til: <i18n-no@lister.ping.uio.no>\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Rapporter programfeil i %s til: %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Nettside for %s: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "Nettside for %s: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"Generell hjelp til å bruke GNU-programmer: <http://www.gnu.org/gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Filene %s og %s er ulike\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Binærfilene %s og %s er ulike\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Intet linjeskift i slutten av fila" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjörn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Prøv «%s --help» for ytterligere informasjon." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "«%s» er en ugyldig verdi for «--ignore-initial»" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "valgene «-l» og «-s» kan ikke brukes samtidig" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "skriving mislyktes" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "standardutdata" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b, --print-bytes skriv ut byte som er ulike" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i, --ignore-initial=ANT hopp over første valgt ANTall byte begge " +"FILer" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=ANT1:ANT2 hopp over første valgt ANT1 byte i FIL1 og\n" +" ANT2 byte i FIL2" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l, --verbose skriv ut byte-nummer og avvikende byte-verdier" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=ANT ikke sammenlikn flere enn valgt ANTall byte" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent ikke skriv ut vanlig utdata" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help vis denne hjelpeteksten og avslutt" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v, --version skriv ut versjonsinformasjon og avslutt" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Bruk: %s [VALG] … FIL1 [FIL2 [ANT1 [ANT2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Sammenlikn to filer byte for byte." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"Du kan hoppe over valgfritt ANT1 og ANT2 byte i begynnelsen\n" +"av henholdsvis første og andre fil (standard er null)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Argumenter som er obligatoriske for lange valg, er også obligatoriske for " +"korte valg.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"ANT-verdier kan etterfølges av følgende multipliseringsuttrykk:\n" +"kB (1000), K (1024), MB (1 000 000), M (1 048 576),\n" +"GB (1 000 000 000), G (1 073 741 824), og så videre (T, P, E, Z, Y)." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Hvis FIL er tom eller «-», leser programmet standard inndata." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"Avsluttende status er 0 hvis inndata er like, 1 hvis ulike og 2 hvis det " +"oppstår problemer." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "«%s» er en ugyldig verdi for «--bytes»" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "operand mangler etter «%s»" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "ekstra operand «%s»" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s er ulike: byte %s, linje %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s er ulike: byte %s, linje %s er %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: EOF på %s, som er tom\n" + +#: src/cmp.c:585 +#, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "cmp: EOF på %s etter byte %s, linje %s\n" + +#: src/cmp.c:586 +#, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "cmp: EOF på %s etter byte %s, på linje %s\n" + +#: src/cmp.c:592 +#, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: EOF på %s etter byte %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "«%s» er en ugyldig kontekstlengde" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "sidedeling støttes ikke på denne verten" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "for mange filetikett-valg" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "«%s» er en ugyldig bredde" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "breddevalg i konflikt" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "«%s» er en ugyldig horisontlengde" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "«%s» er en ugyldig tabulatorstørrelse" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "tabulatorvalg i konflikt" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "du har valgt både «--from-file» og «--to-file»" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr "" +" --normal skriv ut en normal diff (dette er standard)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "-q, --brief bare rapporter når filer er ulike" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s, --report-identical-files rapporter når to filer er like" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C ANT, --context[=ANT] skriv ut valgt ANTall linjer med kopiert " +"kontekst (standard: 3)" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U ANT, --unified[=ANT] skriv ut valgt ANTall linjer med sammenslått " +"kontekst (standard: 3)" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed skriv ut et ed-skript" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n, --rcs skriv ut diff i RCS-format" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side skriv ut i to kolonner" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=ANT skriv ut maks valgt ANTall kolonner (standard: " +"130)" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +" --left-column bare skriv ut venstre kolonne med felles linjer" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines ikke skriv ut felles linjer" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" +"-p, --show-c-function vis hvilken C-funksjon hver endring ligger i" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "-F, --show-function-line=RE vis nyeste linje som samsvarer med RE" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label ETIK bruk valgt ETIKett i stedet for filnavn og " +"tidsstempel\n" +" (dette kan gjentas)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs utvid tabulatorer til mellomrom på utskrift" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab still opp tabulatorer ved å legge til en " +"tabulator først" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=NUM tabulatorer stopper for hvert valgte " +"utskriftskolonne-NUMmer (standard: 8)" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty ikke skriv ut mellomrom eller tabulator før " +"tomme linjer" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "-l, --paginate del utdata i sider via «pr»" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "-r, --recursive sammenlikn evt. undermapper rekursivt" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference ikke følg symbolske lenker" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "-N, --new-file behandle fraværende filer som tomme" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr " --unidirectional-new-file behandle fraværende førstefil som tom" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case skill mellom store og små bokstaver ved " +"sammenlikning av filnavn" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case skill mellom store og små bokstaver ved " +"sammenlikning av filnavn" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "" +"-x, --exclude=MØN utelat filer som samsvarer med valgt MØNster" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=FIL utelat filer som samsvarer med mønster(e) i " +"valgt FIL" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=FIL begynn med valgt FIL ved sammenlikning av " +"mapper" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=FIL1 sammenlikn FIL1 med alle operand-er\n" +" (FIL1 kan være en mappe)" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=FIL2 sammenlikn alle operand-er med FIL2\n" +" (FIL2 kan være en mappe)" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i, --ignore-case ikke skill mellom små og store bokstaver i " +"fil-innhold" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion ignorer endringer som skyldes tabulator-" +"utvidelse" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space ignorer blanktegn i slutten av linjer" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change ignorer endringer i antall blanktegn" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space ignorer alle blanktegn" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B, --ignore-blank-lines ignorer endringer når alle linjer er tomme" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE ignorer endringer når alle linjer samsvarer " +"med RE" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text behandle filer som tekst" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr fjern etterfølgende linjeskift-tegn fra " +"inndata" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr " --binary les og skriv data i binærmodus" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=NAVN skriv ut sammenslått fil med ulikheter i " +"«#ifdef NAVN»" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr " --GTYPE-group-format=GFMT formater GTYPE-inndatagrupper med GFMT" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr " --line-format=LFMT formater inndatalinjer med LFMT" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr " --LTYPE-line-format=LFMT formater LTYPE-inndatalinjer med LFMT" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" Disse formatvalgene gjør det mulig å detaljstyre utdata\n" +" fra diff, og generaliserer -D/--ifdef." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE er enten «old», «new» eller «unchanged». GTYPE er enten LTYPE eller " +"«changed»." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT (alene) kan inneholde følgende:\n" +" %< linjer fra FIL1\n" +" %> linjer fra FIL2\n" +" %= linjer som finnes i både FIL1 og FIL2\n" +" %[-][BREDDE][.[PREC]]{doxX}BOKST spesifikasjon av BOKSTav i printf-" +"stil.\n" +" BOKSTaver kan være som følger for ny gruppe (bruk små bokstaver for " +"gammel gruppe):\n" +" F første linjenummer\n" +" L siste linjenummer\n" +" N antall linjer = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) hvis A er lik B, så T eller E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT (alene) kan inneholde følgende:\n" +" %L linjeinnhold\n" +" %l linjeinnhold, unntatt evt. etterfølgende linjeskift\n" +" %[-][BREDDE][.[PREC]]{doxX}n spesifikasjon av inndata-linjenummer i " +"printf-stil" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" Både GFMT og LFMT kan inneholde følgende:\n" +" %% %\n" +" %c'C' enkelttegnet C\n" +" %c'\\OOO' tegnet med oktalkode OOO\n" +" C tegnet C (andre tegn representerer seg selv)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal prøv hardt å finne en mindre rekke endringer" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +" --horizon-lines=ANT behold valgt ANTall linjer av felles pre- og suffiks" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr " --speed-large-files forvent store filer og små, spredte endringer" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" +" --color[=NÅR] fargelegg utdata. NÅR kan være «never» (aldri),\n" +" «always» eller «auto» (standard)" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" +" --palette=PALETT farger som skal brukes når «--color» er valgt.\n" +" PALETT er en kolon-delt liste over terminfo-" +"muligheter" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help vis denne hjelpeteksten og avslutt" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version vis versjonsinformasjon og avslutt" + +#: src/diff.c:982 +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "FILER er «FIL1 FIL2», «MAPPE1 MAPPE2», «MAPPE FIL» eller «FIL MAPPE»." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Programmet bruker ingen restriksjoner på FIL(er) hvis «--from-file» eller «--" +"to-file» er valgt." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Programmet leser fra standard inndata hvis FIL er «-»." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Bruk: %s [VALG] … FILER\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Sammenlikn FILER linje for linje." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "valget %s er i konflikt med verdien «%s»" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "utdata-stilvalg er i konflikt med hverandre" + +#: src/diff.c:1058 +#, c-format +msgid "invalid color '%s'" +msgstr "«%s» er en ugyldig farge" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Bare i %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "du kan ikke sammenlikne «-» med en mappe" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "valget «-D» støttes ikke for mapper" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Felles undermapper: %s og %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Fila %s er en %s, og fila %s er en %s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "De symbolske lenkene %s og %s er ulike\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Filene %s og %s er identiske\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "gjeldende valg kan ikke brukes samtidig" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "«-» er valgt for flere enn én inndatafil" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "lesing mislyktes" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A, --show-all skriv ut alle endringer, med konflikter i " +"parentes" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed skriv ut ed-skript med endringer\n" +" mellom GAMMELFIL og NYFIL til FIL" + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +"-E, --show-overlap likner «-e», men viser konflikter i parentes" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3, --easy-only likner «-e», men tar ikke med endringer som " +"overlapper hverandre" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +"-x, --overlap-only likner «-e», men tar bare med endringer som " +"overlapper hverandre" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" +"-X likner «-x», men viser også konflikter i parentes" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "" +"-i legg til kommandoene «w» og «q» i ed-skript" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge skriv ut sammenslått fil ihht. «-A»,\n" +" med mindre noe annet er valgt" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text behandle filer som tekst" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr fjern etterfølgende linjeskift-tegn fra inndata" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab still opp tabulatorer på rekke ved å legge til " +"en ekstra tab foran" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=PROGRAM bruk valgt PROGRAM til å sammenlikne filer" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=ETIKETT bruk valgt ETIKETT i stedet for filnavn\n" +" (dette kan gjentas opptil tre ganger)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help vis denne hjelpeteksten og avslutt" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version vis versjonsinformasjon og avslutt" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Usage: %s [VALG] … FIL GAMMELFIL NYFIL\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Sammenlikn tre filer, linje for linje." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"Standard utskriftsformat er en nogen lunde menneskevennlig visning\n" +"av endringene.\n" +"\n" +"Valgene «-e», «-E», «-x» og «-X» (samt tilsv. lange valgnavn) fører til\n" +"utskrift av ed-skript i stedet for standardformatet.\n" +"\n" +"Valget «-m» («--merge») lar diff3 utføre sammenslåing internt\n" +"og skrive ut sammenslått fil. Dette er sikrere for behandling av\n" +"uvanlig inndata enn å bruke ed.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"Avsluttende status er 0 hvis alt er i orden, 1 ved konflikter og 2 ved " +"problemer." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "intern feil: rot i diff-blokkformat" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff mislyktes: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "intern feil: ugyldig diff-type i process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "ugyldig diff-format. Ugyldig endringsskilletegn" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "ugyldig diff-format. Siste linje er ufullstendig" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "klarte ikke å starte hjelpeprogrammet «%s»" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "ugyldig diff-format. Feil ledende linjetegn" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "intern feil: ugyldig diff-type sendt til utdata" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "inndata-fila er krympet" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "klarte ikke å sammenlikne filnavn «%s» med «%s»" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: rekursiv mappesløyfe" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "-o, --output=FIL jobb interaktivt, og send utdata til FIL" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i, --ignore-case ikke skill mellom store og små bokstaver" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion ikke regn tabulator-forskjeller som endringer" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space ignorer blanktegn i slutten av linjer" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change ikke regn ulikt antall blanktegn som endringer" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space ignorer alle blanktegn" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" +"-B, --ignore-blank-lines ignorer endringer hvis linjer er fullstendig " +"tomme" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE ignorer endringer hvis linjer samsvarer med " +"RE" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr fjern etterfølgende linjeskift-tegn fra inndata" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a, --text behandle filer som tekst" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=ANT ikke skriv ut flere enn valgt ANTall kolonner " +"(standard: 130)" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" +"-l, --left-column bare skriv ut venstre kolonne med felles linjer" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines ikke skriv ut felles linjer" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs utvid tabulatorer til mellomrom i utdata" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +" --tabsize=NUM tabulatorer slutter ved hvert valgte " +"kolonneNUMmer (standard: 8)" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal prøv hardt å finne små endringer" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files forvent store filer med små, spredte endringer" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=PROGRAM bruk valgt PROGRAM til å sammenlikne filer" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help vis denne hjelpeteksten og avslutt" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v, --version vis versjonsinformasjon og avslutt" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Bruk: %s [VALG] … FIL1 FIL2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Sammenslåing av forskjeller mellom FIL1 og FIL2, side ved side." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "du kan ikke slå sammen standard inndata interaktivt" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "begge filer som skal sammenliknes er mapper" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tRediger og bruk begge versjoner, og dekorer begge med overskrift.\n" +"eb:\tRediger og bruk deretter begge versjoner.\n" +"el or e1:\tRediger og bruk deretter venstre versjon.\n" +"er or e2:\tRediger og bruk deretter høyre versjon.\n" +"e:\tForkast begge versjoner, og rediger ny versjon.\n" +"l or 1:\tBruk venstre versjon.\n" +"r or 2:\tBruk høyre versjon.\n" +"s:\tTa med felles linjer uten å gi beskjed.\n" +"v:\tTa med felles linjer og gi beskjed.\n" +"q:\tAvslutt.\n" + +#: src/util.c:662 +#, c-format +msgid "unrecognized prefix: %s" +msgstr "ukjent prefiks: %s" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "«--palette» har uforståelig verdi" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: valget «--%s» tillater ikke argumenter\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: «--%s» er et ukjent valg\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: valget «-W %s» er flertydig\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: valget «-W %s» tillater ikke argumenter\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: valget «-W %s» krever et argument\n" + +#~ msgid " or 'auto' (the default)" +#~ msgstr " eller «auto» (standard)" + +#~ msgid "" +#~ " --palette=PALETTE specify the colors to use when --color is active" +#~ msgstr "" +#~ " --palette=PALETT velg farger som skal brukes når «--color» er " +#~ "valgt" diff --git a/local/recipes/tools/diffutils/source/po/nl.gmo b/local/recipes/tools/diffutils/source/po/nl.gmo new file mode 100644 index 0000000000..afca336cef Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/nl.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/nl.po b/local/recipes/tools/diffutils/source/po/nl.po new file mode 100644 index 0000000000..a24d4c2867 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/nl.po @@ -0,0 +1,1633 @@ +# Dutch translations for GNU diffutils. +# Copyright (C) 2017 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# +# «We know things, but when they bother us we suddenly forget we knew them.» +# +# Benno Schulenberg <benno@vertaalt.nl>, 2007, 2008, 2010, 2011, 2012, 2017. +# Elros Cyriatan <cyriatan@fastmail.fm>, 2004. +msgid "" +msgstr "" +"Project-Id-Version: diffutils-3.5.25\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2017-05-09 19:36+0200\n" +"Last-Translator: Benno Schulenberg <benno@vertaalt.nl>\n" +"Language-Team: Dutch <vertaling@vrijschrift.org>\n" +"Language: nl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Lokalize 1.0\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "ongeldig argument %s van %s" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "argument %s van %s is niet eenduidig" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "Geldige argumenten zijn:" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "programmafout" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "stack-overloop" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Onbekende systeemfout" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "leeg normaal bestand" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "normaal bestand" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "map" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "symbolische koppeling" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "berichtenwachtrij" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "semafoor" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "gedeeld geheugenobject" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "zelfstandig geheugenobject" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "blok-apparaat" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "byte-apparaat" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "aaneengesloten gegevens" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "door" + +#: lib/file-type.c:81 +msgid "multiplexed block special file" +msgstr "gemultiplexed blok-apparaat" + +#: lib/file-type.c:84 +msgid "multiplexed character special file" +msgstr "gemultiplexed byte-apparaat" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "gemultiplexed bestand" + +#: lib/file-type.c:90 +msgid "named file" +msgstr "benoemd bestand" + +#: lib/file-type.c:93 +msgid "network special file" +msgstr "netwerkapparaat" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "gemigreerd bestand met gegevens" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "gemigreerd bestand zonder gegevens" + +#: lib/file-type.c:102 +msgid "port" +msgstr "poort" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "socket" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "whiteout" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "merkwaardig bestand" + +#: lib/getopt.c:278 +#, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: optie '%s%s' is niet eenduidig\n" + +#: lib/getopt.c:284 +#, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: optie '%s%s' is niet eenduidig; mogelijkheden zijn:" + +#: lib/getopt.c:319 +#, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: onbekende optie '%s%s'\n" + +#: lib/getopt.c:345 +#, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: optie '%s%s' staat geen argument toe\n" + +#: lib/getopt.c:360 +#, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: optie '%s%s' vereist een argument\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: ongeldige optie -- '%c'\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: optie vereist een argument -- '%c'\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "‘" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "’" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Gelukt" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Geen overeenkomsten" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Ongeldige reguliere expressie" + +# Zie http://mailman.vrijschrift.org/pipermail/vertaling/2005-August/004670.html +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Ongeldig samengesteld teken" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Ongeldige tekenklassenaam" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Backslash aan het eind" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Ongeldige terugverwijzing" + +#: lib/regcomp.c:156 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Ongepaarde [, [^, [:, [., of [=" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Ongepaarde ( of \\(" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Ongepaarde \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Ongeldige inhoud van \\{\\}" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Ongeldig bereikeinde" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Onvoldoende geheugen beschikbaar" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Ongeldige voorafgaande reguliere expressie" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Voortijdig einde van reguliere expressie" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Reguliere expressie is te groot" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Ongepaarde ) of \\)" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Geen eerdere reguliere expressie" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "onvoldoende geheugen beschikbaar" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "standaardinvoer" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "standaarduitvoer" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "standaardfoutuitvoer" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "onbekende gegevensstroom" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "opnieuw openen van '%s' met modus %s is mislukt" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "ongeldig argument '%3$s' van %1$s%2$s" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "ongeldig achtervoegsel in argument '%3$s' van %1$s%2$s" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "argument '%3$s' van %1$s%2$s is te groot" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "In pakketvorm gebracht door %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "In pakketvorm gebracht door %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Dit is vrije software: u mag het vrijelijk wijzigen en verder verspreiden.\n" +"De precieze licentie is GPL-3+: GNU General Public License versie 3 of " +"later.\n" +"Zie http://gnu.org/licenses/gpl.html voor de volledige (Engelse) tekst.\n" +"Deze software kent GEEN GARANTIE, voor zover de wet dit toestaat.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Geschreven door %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Geschreven door %s en %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Geschreven door %s, %s en %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Geschreven door %s, %s, %s\n" +"en %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Geschreven door %s, %s, %s,\n" +"%s en %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Geschreven door %s, %s, %s,\n" +"%s, %s en %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Geschreven door %s, %s, %s,\n" +"%s, %s, %s en %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Geschreven door %s, %s, %s,\n" +"%s, %s, %s, %s\n" +"en %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Geschreven door %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s en %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Geschreven door %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s en anderen.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Rapporteer gebreken in het programma aan <%s>;\n" +"meld fouten in de vertaling aan <vertaling@vrijschrift.org>.\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "" +"Rapporteer gebreken in het programma '%s' aan <%s>;\n" +"meld fouten in de vertaling aan <vertaling@vrijschrift.org>.\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Webpagina van %s: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "Webpagina van %s: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"Algemene hulp bij gebruik van GNU-software: <http://www.gnu.org/gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Bestanden %s en %s zijn verschillend\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Binaire bestanden %s en %s zijn verschillend\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Geen regeleindeteken (LF) aan einde van bestand" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjörn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Typ '%s --help' voor meer informatie." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "ongeldige waarde '%s' voor '--ignore-initial'" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "opties '-l' en '-s' gaan niet samen" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "schrijven is mislukt" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "standaarduitvoer" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b, --print-bytes de bytes tonen die verschillen" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i, --ignore-initial=OVERSLAAN de eerste OVERSLAAN bytes van\n" +" beide invoeren overslaan" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=OVS1:OVS2 de eerste OVS1 bytes van BESTAND1 en de\n" +" eerste OVS2 bytes van BESTAND2 overslaan" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l, --verbose bytenummers en -waarden tonen van bytes die " +"verschillen" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=AANTAL maximaal dit AANTAL bytes vergelijken" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent alle gewone uitvoer onderdrukken" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help deze hulptekst tonen en stoppen" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v, --version programmaversie tonen en stoppen" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "" +"Gebruik: %s [OPTIE...] BESTAND1 [BESTAND2 [OVERSLAAN1 [OVERSLAAN2]]]\n" +"\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Twee bestanden byte-voor-byte vergelijken." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"De optionele waarden OVERSLAAN1 en OVERSLAAN2 geven het aantal bytes aan " +"dat\n" +"aan het begin van elk bestand moet worden overgeslagen (standaard nul)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"(Een verplicht argument bij een lange optie geldt ook voor de korte vorm.)\n" +"\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"De waarden voor OVERSLAAN mogen worden gevolgd door de volgende\n" +"vermenigvuldigende achtervoegsels:\n" +" kB 1000, K 1024, MB 1.000.000, M 1.048.576,\n" +" GB 1.000.000.000, G 1.073.741.824, enzovoort voor T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "" +"Als een BESTAND ontbreekt of '-' is, wordt er van standaardinvoer gelezen." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"De afsluitwaarde is 0 als de invoeren gelijk zijn, 1 als ze verschillen,\n" +"en 2 bij problemen." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "ongeldige waarde '%s' voor '--bytes'" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "ontbrekend argument na '%s'" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "overtollig argument '%s'" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s verschillen: byte %s, regel %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s verschillen: byte %s, regel %s, is %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: einde-van-bestand in %s dat leeg is\n" + +#: src/cmp.c:585 +#, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "cmp: einde-van-bestand in %s na byte %s, regel %s\n" + +#: src/cmp.c:586 +#, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "cmp: einde-van-bestand in %s na byte %s, in regel %s\n" + +#: src/cmp.c:592 +#, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: einde-van-bestand in %s na byte %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "ongeldige contextlengte '%s'" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "het in pagina's indelen is op deze computer niet mogelijk" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "te veel bestandslabel-opties" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "ongeldige breedte '%s'" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "conflicterende breedte-opties" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "ongeldige horizonlengte '%s'" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "ongeldige tabgrootte '%s'" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "conflicterende tabgrootte-opties" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "zowel '--from-file' als '--to-file' zijn opgegeven" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr " --normal een gewone diff produceren (standaard)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "-q, --brief alleen aangeven of bestanden verschillen" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "" +"-s, --report-identical-files vermelden of twee bestanden hetzelfde zijn" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C AANTAL, --context[=AANTAL] dit AANTAL regels (standaard 3) van\n" +" gekopieerde context tonen" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U AANTAL, --unified[=AANTAL] dit AANTAL regels (standaard 3) van\n" +" geünificeerde context tonen" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed een ed-script produceren" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n, --rcs een diff in RCS-opmaak produceren" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side het resultaat weergeven in twee kolommen" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=AANTAL maximaal dit AANTAL kolommen tonen (standaard 130)" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +" --left-column bij gelijke regels alleen de linkerkolom tonen" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines de gelijke regels onderdrukken" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" +"-p, --show-c-function vermelden in welke C-functie elke wijziging is" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" +"-F, --show-function-line=RE recentste regel overeenkomend met RE tonen" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label LABEL dit LABEL gebruiken in plaats van bestandsnaam " +"plus\n" +" tijdsstempel (mag herhaald worden)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs tabs uitschrijven naar spaties in uitvoer" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab tabs uitlijnen door invoegen van tab aan het begin" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=AANTAL tab-stops op elke AANTAL posities (standaard 8)" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty spatie of tab onderdrukken voor lege uitregels" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" +"-l, --paginate de uitvoer door 'pr' halen om deze in pagina's\n" +" in te delen" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "-r, --recursive recursief elke gevonden submap vergelijken" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference symbolische koppelingen niet volgen" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "-N, --new-file afwezige bestanden als leeg behandelen" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +" --unidirectional-new-file alleen bestanden die afwezig zijn in de\n" +" eerste map als leeg behandelen" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case verschil tussen hoofd- en kleine letters " +"negeren\n" +" bij vergelijken van bestandsnamen" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case onderscheid maken tussen hoofd- en kleine\n" +" letters bij vergelijken van bestandsnamen" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "" +"-x, --exclude=PATROON bestanden uitsluiten als ze overeenkomen met " +"PATROON" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=BESTAND bestanden uitsluiten die overeenkomen met\n" +" een patroon in BESTAND" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=BESTAND beginnen met BESTAND bij vergelijken van " +"mappen" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=BESTAND1 BESTAND1 met alle argumenten vergelijken;\n" +" BESTAND1 mag een map zijn" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=BESTAND2 alle argumenten met BESTAND2 vergelijken;\n" +" BESTAND2 mag een map zijn" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i, --ignore-case verschil tussen hoofd- en kleine letters\n" +" negeren in bestandsinhoud" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "-E, --ignore-tab-expansion omzettingen van tabs in spaties negeren" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space witruimte aan einde van regel negeren" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change wijzigingen in hoeveelheid witruimte negeren" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space alle witruimte negeren" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B, --ignore-blank-lines wijzigingen waarvan alle regels leeg zijn " +"negeren" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE wijzigingen waarvan alle regels " +"overeenkomen\n" +" met reguliere expressie RE negeren" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text alle bestanden als tekst behandelen" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr Enter-tekens (CR's) aan einde van regels weglaten" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr "" +" --binary gegevens in binaire modus lezen en schrijven" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=NAAM samengevoegd bestand tonen om verschillen in\n" +" '#ifdef NAAM' te laten zien" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +" --GSOORT-group-format=GOPMAAK iets dergelijks, maar dan invoergroepen " +"van\n" +" soort GSOORT opmaken met GOPMAAK" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "" +" --line-format=LOPMAAK iets dergelijks, maar dan alle invoerregels " +"opmaken\n" +" met LOPMAAK" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +" --LSOORT-line-format=LOPMAAK iets dergelijks, maar dan invoerregels " +"van\n" +" soort LSOORT opmaken met LOPMAAK" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" Deze opmaakopties bieden een fijnafregeling van de uitvoer aan,\n" +" een generalisatie van de optie '-d/--ifdef'." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LSOORT is 'old' (oud), 'new' (nieuw), of 'unchanged' (ongewijzigd);\n" +" GSOORT is LSOORT of 'changed' (gewijzigd)." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GOPMAAK mag bevatten:\n" +" %< regels van BESTAND1\n" +" %> regels van BESTAND2\n" +" %= regels overeenkomend in BESTAND1 en BESTAND2\n" +" %[-][BREEDTE][.[PREC]]{doxX}LETTER printf-stijl specificatie voor " +"LETTER\n" +" LETTERs zijn als volgt voor nieuwe groep, kleine letter voor oude " +"groep:\n" +" F eerste regelnummer\n" +" L laatste regelnummer\n" +" N het aantal regels (L-F+1)\n" +" E F-1\n" +" M L+1\n" +" %(A=B?Z:V) als A gelijk is aan B, dan Z anders V" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LOPMAAK mag bevatten:\n" +" %L inhoud van regel\n" +" %l inhoud van regel, behalve eventuele witregel aan einde\n" +" %[-][BREEDTE][.[PREC]]{doxX}n specificatie in printf-stijl voor\n" +" invoerregelnummer" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" GOPMAAK en LOPMAAK mogen bevatten:\n" +" %% een %-teken\n" +" %c'C' het enkele teken C\n" +" %c'\\OOO' het teken met octaalcode OOO\n" +" C het teken C (andere tekens representeren zichzelf)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d, --minimal moeite doen om een kleinere verzameling " +"wijzigingen\n" +" te vinden" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +" --horizon-lines=AANTAL dit AANTAL regels met identieke kop en staart\n" +" bij vergelijkingsproces meenemen" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files aannemen dat bestanden groot zijn met veel " +"verspreide\n" +" kleine wijzigingen" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" +" --color[=WANNEER] de uitvoer kleuren; WANNEER is " +"'always' (altijd),\n" +" 'never' (nooit), of 'auto' (standaard)" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" +" --palette=PALET te gebruiken kleuren bij '--color'; PALET is een\n" +" lijst van terminfo-capabilities gescheiden " +"door\n" +" dubbelepunten" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help deze hulptekst tonen en stoppen" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version programmaversie tonen en stoppen" + +#: src/diff.c:982 +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"BESTANDEN is 'BESTAND1 BESTAND2' of 'MAP1 MAP2' of\n" +" 'MAP BESTAND...' of 'BESTAND... MAP'." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Als '--from-file' of '--to-file' gegeven is, mag BESTANDEN van alles zijn." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Als een BESTAND '-' is, wordt er van standaardinvoer gelezen." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "" +"Gebruik: %s [OPTIE...] BESTANDEN\n" +"\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Bestanden regel-voor-regel vergelijken." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "conflicterende waarde '%2$s' van optie %1$s" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "conflicterende uitvoerstijl-opties" + +#: src/diff.c:1058 +#, c-format +msgid "invalid color '%s'" +msgstr "ongeldige kleur '%s'" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Alleen in %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "kan '-' niet met een map vergelijken" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "optie '-D' is niet mogelijk bij mappen" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Gemeenschappelijke submappen: %s en %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Bestand %s is een %s terwijl bestand %s een %s is\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Symbolische koppelingen %s en %s zijn verschillend\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Bestanden %s en %s zijn identiek\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "niet-samengaande opties" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "'-' opgegeven voor meer dan één invoerbestand" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "lezen is mislukt" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A, --show-all alle wijzigingen tonen, met rechte haken om de " +"conflicten" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed een ed-script produceren die de wijzigingen van\n" +" OUDBESTAND naar UWBESTAND in MIJNBESTAND maakt" + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +"-E, --show-overlap als '-e' maar met rechte haken om de conflicten" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3, --easy-only als '-e' maar alleen met niet-overlappende " +"wijzigingen" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +"-x, --overlap-only als '-e' maar met alleen de overlappende " +"wijzigingen" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" +"-X als '-x' maar met rechte haken om de conflicten" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "" +"-i opdrachten 'w' en 'q' toevoegen aan einde van ed-" +"scripts" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge het feitelijk samengevoegde bestand tonen\n" +" volgens '-A' zonder andere opties" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text alle bestanden als tekst behandelen" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr Enter-tekens (CR's) aan einde van regels weglaten" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab tabs uitlijnen door invoegen van tab aan het begin" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=PROG dit programma gebruiken om bestanden te " +"vergelijken" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=LABEL dit LABEL gebruiken in plaats van bestandsnaam\n" +" (mag maximaal driemaal herhaald worden)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help deze hulptekst tonen en stoppen" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version programmaversie tonen en stoppen" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "" +"Gebruik: %s [OPTIE]... MIJNBESTAND OUDBESTAND UWBESTAND\n" +"\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Drie bestanden regel-voor-regel vergelijken." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"De standaard uitvoeropmaak is een enigszins leesbare representatie van\n" +"de wijzigingen.\n" +"\n" +"De opties '-e', '-E', '-x', en '-X' (en hun equivalente lange versies)\n" +"produceren een ed-script in plaats van de standaard uitvoer.\n" +"\n" +"De optie '-m' ('--merge') maakt dat 'diff3' de samenvoeging intern " +"produceert\n" +"en het samengevoegde bestand uitvoert. Voor ongewone invoer is dit " +"robuuster\n" +"dan het gebruik van 'ed'.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"De afsluitwaarde is 0 bij succes, 1 bij conflicten, en 2 bij problemen." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "*interne programmafout*: opmaak van diff-blokken is verhaspeld" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff is mislukt: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "*interne programmmafout*: ongeldig soort diff in process_diff()" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "ongeldige diff-opmaak: ongeldig scheidingsteken voor veranderingen" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "ongeldige diff-opmaak: incomplete laatste regel" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "hulpprogramma '%s' kan niet worden aangeroepen" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "ongeldige diff-opmaak: onjuiste tekens aan begin van regel" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "*interne programmafout*: ongeldig soort diff naar uitvoer gestuurd" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "invoerbestand is gekrompen" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "kan bestandsnamen '%s' en '%s' niet vergelijken" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: oneindige lus in de mappen" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o, --output=BESTAND interactief werken; het resultaat opslaan in " +"BESTAND" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "" +"-i, --ignore-case hoofd- en kleine letters als hetzelfde zien" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "-E, --ignore-tab-expansion omzettingen van tabs in spaties negeren" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space witruimte aan einde van regel negeren" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change wijzigingen in hoeveelheid witruimte negeren" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space alle witruimte negeren" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" +"-B, --ignore-blank-lines wijzigingen waarvan alle regels leeg zijn " +"negeren" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE wijzigingen waarvan alle regels " +"overeenkomen\n" +" met reguliere expressie RE negeren" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr Enter-tekens (CR's) aan einde van regels weglaten" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a, --text alle bestanden als tekst behandelen" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=AANTAL maximaal dit AANTAL kolommen tonen (standaard 130)" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" +"-l, --left-column bij gelijke regels alleen de linkerkolom tonen" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines de gelijke regels onderdrukken" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs tabs uitschrijven naar spaties in uitvoer" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +" --tabsize=AANTAL tab-stops op elke AANTAL posities (standaard 8)" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d, --minimal moeite doen om een kleinere verzameling " +"wijzigingen\n" +" te vinden" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files aannemen dat bestanden groot zijn met veel " +"verspreide\n" +" kleine wijzigingen" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=PRGRM dit programma gebruiken om bestanden te " +"vergelijken" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help deze hulptekst tonen en stoppen" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v, --version programmaversie tonen en stoppen" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "" +"Gebruik: %s [OPTIE...] BESTAND1 BESTAND2\n" +"\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Twee bestanden en hun verschillen naast elkaar weergeven." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "kan standaardinvoer niet interactief samenvoegen" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "de te vergelijken bestanden zijn allebei mappen" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed: Bewerken en daarna beide versies gebruiken, beide met een kop.\n" +"eb: Bewerken en daarna beide versies gebruiken.\n" +"el / e1: Bewerken en daarna de linker versie gebruiken.\n" +"er / e2: Bewerken en daarna de rechter versie gebruiken.\n" +"e: Een nieuwe versie bewerken.\n" +"l / 1: De linker versie gebruiken.\n" +"r / 2: De rechter versie gebruiken.\n" +"s: Overeenkomende regels stilzwijgend invoegen.\n" +"v: Overeenkomende regels invoegen en tonen.\n" +"q: Afsluiten.\n" + +#: src/util.c:662 +#, c-format +msgid "unrecognized prefix: %s" +msgstr "niet-herkend voorvoegsel: %s" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "onbegrepen waarde bij '--palette'" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: optie '--%s' staat geen argument toe\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: onbekende optie '--%s'\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: optie '-W %s' is niet eenduidig\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: optie '-W %s' staat geen argument toe\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: optie '-W %s' vereist een argument\n" + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i OVERSLAAN1:OVERSLAAN2 --ignore-initial=OVERSLAAN1:OVERSLAAN2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "" +#~ "-s --quiet --silent Niets tonen; alleen een afsluitwaarde leveren." + +#~ msgid "--help Output this help." +#~ msgstr "--help Deze hulptekst tonen." + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ "-c -C AANTAL --context[=AANTAL] AANTAL (standaard 3) regels van\n" +#~ " gekopieerde context tonen.\n" +#~ "-u -U AANTAL --unified[=AANTAL] AANTAL (standaard 3) regels van\n" +#~ " geünificeerde context tonen.\n" +#~ "--label LABEL Dit LABEL gebruiken in plaats van bestandsnaam.\n" +#~ "-p --show-c-function Vermelden in welke C-functie elke wijziging is.\n" +#~ "-F RE --show-function-line=RE Recentste regel overeenkomend met RE " +#~ "tonen." + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ "-y --side-by-side Resultaat weergeven in twee kolommen.\n" +#~ "-W AANTAL --width=AANTAL Maximaal AANTAL (standaard 130) kolommen " +#~ "tonen.\n" +#~ "--left-column Van overeenkomende regels alleen de linker kolom tonen.\n" +#~ "--suppress-common-lines Overeenkomende regels niet tonen." + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "" +#~ "--speed-large-files Aannemen dat bestanden groot zijn en veel kleine,\n" +#~ " verspreide wijzigingen hebben." + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "-X Overlappende wijzigingen tonen, tussen rechte haken." + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "" +#~ "-m --merge Samengevoegd bestand tonen (standaard met -A) i.p.v. ed-" +#~ "script." + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "" +#~ "-L LABEL --label=LABEL Dit LABEL gebruiken in plaats van bestandsnaam." diff --git a/local/recipes/tools/diffutils/source/po/pl.gmo b/local/recipes/tools/diffutils/source/po/pl.gmo new file mode 100644 index 0000000000..f8eb2b8193 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/pl.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/pl.po b/local/recipes/tools/diffutils/source/po/pl.po new file mode 100644 index 0000000000..2c6fe40468 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/pl.po @@ -0,0 +1,1505 @@ +# Polish translations for the GNU diffutils messages +# Copyright (C) 1996, 2002, 2004, 2009, 2010, 2011, 2012, 2017 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Rafał Maszkowski <rzm@icm.edu.pl> 1996, 2002, 2004, 2009-2012, 2017 +# Contributions: +# Paweł Krawczyk <kravietz@pipeta.chemia.pk.edu.pl>, 1996. +# 23 corrections - Jakub Bogusz <qboosh@pld-linux.org>, 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU diffutils 3.5.25\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2017-05-09 14:30+0200\n" +"Last-Translator: Rafał Maszkowski <rzm@icm.edu.pl>\n" +"Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n" +"Language: pl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "argument %s błędny w kontekście %s" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "argument %s błędny w kontekście %s" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "Prawidłowe argumenty to:" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "błąd programu" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "przepełnienie stosu" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Nieznany błąd systemu" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "zwykły pusty plik" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "plik zwykły" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "katalog" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "dowiązanie symboliczne" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "kolejka komunikatów" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "semafor" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "obiekt w pamięci dzielonej" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "obiekt w pamięci z określeniem typu" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "blokowy plik specjalny" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "znakowy plik specjalny" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "dane ciągłe" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "drzwi" + +#: lib/file-type.c:81 +msgid "multiplexed block special file" +msgstr "blokowy zwielokrotniony plik specjalny" + +#: lib/file-type.c:84 +msgid "multiplexed character special file" +msgstr "znakowy zwielokrotniony plik specjalny" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "plik zwielokrotniony" + +#: lib/file-type.c:90 +msgid "named file" +msgstr "nazwany plik specjalny" + +#: lib/file-type.c:93 +msgid "network special file" +msgstr "sieciowy plik specjalny" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "przemigrowany plik z danymi" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "przemigrowany plik bez danych" + +#: lib/file-type.c:102 +msgid "port" +msgstr "port" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "gniazdo" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "plik zaślepka" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "plik dziwny" + +#: lib/getopt.c:278 +#, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: opcja „%s%s” jest niejednoznaczna\n" + +#: lib/getopt.c:284 +#, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: opcja „%s%s” jest niejednoznaczna; możliwości:" + +#: lib/getopt.c:319 +#, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: nierozpoznana opcja „%s%s”\n" + +#: lib/getopt.c:345 +#, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: opcja „%s%s” nie może mieć argumentu\n" + +#: lib/getopt.c:360 +#, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: opcja „%s%s” wymaga argumentu\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: błędna opcja -- „%c'\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: opcja wymaga argumentu -- „%c”\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "„" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "”" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Powodzenie" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Nie pasuje" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Błędne wyrażenie regularne" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Znak błędny dla bieżącego uporządkowania" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Błędne nazwa klasy znaków" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Końcowy ukośnik odwrotny" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Błędny odnośnik wstecz" + +#: lib/regcomp.c:156 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Nie sparowany [, [^, [:, [., albo [=" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Nie sparowany ( albo \\(" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Nie sparowany \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Błędna zawartość \\{\\}" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Błędny koniec zakresu" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Brak pamięci" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Błędne poprzedzające wyrażenie regularne" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Przedwczesny koniec wyrażenia regularnego" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Wyrażenia regularne jest za duże" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Nie sparowany ) lub \\)" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Brak poprzedniego wyrażenia regularnego" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "brak pamięci" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "standardowe wejście" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "standardowe wyjście" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "standardowe wyjście błędu" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "nieznany strumień" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "nie udało się ponownie otworzyć %s z uprawnieniami %s" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "błędny argument %s%s: „%s”" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "błędny przyrostek argumentu %s%s: „%s”" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "argument %s%s „%s” jest za duży" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Pakowane przez %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Pakowane przez %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Licencja GPLv3+: GNU GPL wersja 3 albo późniejsza http://gnu.org/licenses/" +"gpl.html\n" +"To jest wolne oprogramowanie: masz prawo je zmieniać i rozpowszechniać.\n" +"Autorzy nie dają ŻADNYCH GWARANCJI w granicach dozwolonych prawem.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Autor: %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Autorzy: %s i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Autorzy: %s, %s i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Autorzy: %s, %s, %s\n" +"i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Autorzy: %s, %s, %s,\n" +"%s i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Autorzy: %s, %s, %s,\n" +"%s, %s i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Autorzy: %s, %s, %s,\n" +"%s, %s, %s i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Autorzy: %s, %s, %s,\n" +"%s, %s, %s, %s\n" +"i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Autorzy: %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s i %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Autorzy: %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s i inni.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"O błędach programu poinformuj %s\n" +"O błędach tłumaczenia poinformuj translation-team-pl@lists.sourceforge.net\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Raporty o błędach %s wysyłaj do %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "strona domowa %s: %s\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "strona domowa %s: http://www.gnu.org/software/%s/\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "Pomoc w używaniu oprogramowania GNU: http://www.gnu.org/gethelp/\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Pliki %s i %s różnią się\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Binarne pliki %s i %s różnią się\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Brak znaku nowej linii na końcu pliku" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjörn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Napisz „%s --help” żeby dowiedzieć się więcej." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "błędna wartość --ignore-initial „%s”" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "sprzeczne opcje -l i -s" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "zapis nieudany" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "standardowe wyjście" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b --print-bytes wypisanie różniących się bajtów" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "-i, --ignore-initial=OMIŃ przeskoczenie pierwszych OMIŃ bajtów" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"--ignore-initial=OMIŃ1:OMIŃ2 przeskoczenie pierwszych OMIŃ1 bajtów\n" +" PLIKU1 i OMIŃ2 bajtów PLIKU2" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-I --verbose wypisanie położeń i kodów wszystkich różniących " +"się bajtów" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n , --bytes=LIMIT porównanie najwyżej LIMIT bajtów" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent wyłączenie wszystkich zwykłych komunikatów" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help wypisanie tej pomocy i zakończenie" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v --version wypisanie informacji o wersji i zakończenie" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Składnia: %s [OPCJA]... PLIK1 [PLIK2 [OMIŃ1 [OMIŃ2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Porównanie plików bajt po bajcie." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"Opcjonalne argumenty OMIŃ1 i OMIŃ2 to liczby bajtów do pominięcia na\n" +"początku każdego z plików (domyślnie zero)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "Obowiązkowe argumenty długich opcji są obowiązkowe też dla krótkich.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"Po wartości do OMINIĘCIA mogą być dodane następujące przyrostki:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, i tak dalej dla T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Jeżeli PLIK to „-” lub go brak, czytane jest standardowe wejście." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"Status wyjściowy ma wartość 0 gdy pliki wejściowe są takie same, 1 - jeżeli\n" +"różne, 2 - jeżeli są problemy." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "błędna wartość --bytes „%s”" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "brakujący argument po „%s”" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "nadmiarowy argument „%s”" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s różnią się: bajt %s, linia %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s różnią się: bajt %s, linia %s zawiera %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: EOF w %s, który jest pusty\n" + +#: src/cmp.c:585 +#, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "cmp: EOF w %s, po bajcie %s, linii %s\n" + +#: src/cmp.c:586 +#, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "cmp: EOF w %s, po bajcie %s, w linii %s\n" + +#: src/cmp.c:592 +#, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: EOF w %s, po bajcie %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "błędna długość kontekstu „%s”" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "stronicowanie nie jest możliwe na tej maszynie" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "za dużo opcji etykietowania plików" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "błędna szerokość „%s”" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "sprzeczne opcje szerokości" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "błędna długość horyzontu „%s”" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "błędny rozmiar tabulacji „%s”" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "sprzeczne opcje rozmiarów TAB-a" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "równocześnie podane --from-file i --to-file" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr "" +"--normal wynik w postaci zwykłego diff-a (domyślnie)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "" +"-q --brief wypisanie wyniku tylko gdy pliki się różnią" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s --report-identical-files informowanie gdy dwa pliki są takie same" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C NUM, --context[=ILE] wypisanie ILU (domyślnie 3) linii kontekstu" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"--u, -U ILE, --unified=ILE wypisanie najwyżej ILE (domyślnie 3)\n" +" linii kontekstu w trybie unified" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e --ed wynik w postaci poleceń ed-a" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n --rcs wynik w postaci diff-a z RCS" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side wyniki w dwóch kolumnach" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=ILE wypisanie najwyżej ILE (domyślnie 130) kolumn" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +" --left-column wypisanie tylko lewej kolumny dla wspólnych " +"linii" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines bez wypisania wspólnych linii" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "-p, --show-c-function podanie w jakiej funkcji C są zmiany" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" +"-F, --show-function-line=WYRREG wypisanie ostatniej linii pasującej do " +"WYRREG" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label ETYKIETA użycie ETYKIETY zamiast nazwy pliku i " +"znacznika\n" +" czasu (może być powtarzane)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t --expand-tabs rozwinięcie TAB-ów w spacje w wyniku" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T --initial-tab wyrównanie linii przez użycie TAB-ów" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr " --tabsize=ILE TAB-y co ILE (domyślnie 8) kolumn" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty bez wypisywania spacji i znaków TAB przed\n" +" pustymi liniami" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" +"-I --paginate przepuszczenie wyniku przez „pr” żeby go " +"stronnicować" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "-r --recursive porównanie podkatalogów rekurencyjnie" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr "" +" --no-dereference bez podążania za dowiązaniami symbolicznymi" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "" +"-N --new-file traktowanie brakujących plików jak pustych" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +" --unidirectional-new-file traktowanie brakujących pierwszych plików\n" +" w pierwszym zestawie jako pustych" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-space-change zignorowanie wielkości liter przy\n" +" porównywaniu nazw plików" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case uwzględnianie wielkości liter przy\n" +" porównywaniu nazw plików" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "-x, --exclude=WZÓR wykluczenie plików pasujących do WZORU" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=PLIK pominięcie plików pasujących do wzorców w " +"PLIKU" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=PLIK zacznij od PLIKU przy porównywaniu katalogów" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=PLIK1 porównanie PLIKU1 z wszystkimi\n" +" argumentami; PLIK1 może być katalogiem" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=PLIK2 porównanie wszystkich argumentów\n" +" z PLIKIEM2; PLIK2 może być katalogiem" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i --ignore-case ignorowanie różnic między wielkimi i małymi " +"literami" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E --ignore-tab-expansion zignorowanie zmian spowodowanych\n" +" rozwinięciem TAB-ów" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" +"-Z --ignore-trailing-space ignorowanie znaków odstępu na końcu linii" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b --ignore-space-change Zignorowanie zmian ilości znaków odstępu" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w --ignore-all-space zignorowanie znaków odstępu" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B --ignore-blank-lines zignorowanie zmian liczby pustych linii" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE zignorowanie zmian w liniach pasujących\n" +" do RE" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a --text traktowanie plików jako tekstowych" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +"--strip-trailing-cr pominięcie znaków nowej linii na wejściu" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr "--binary czytanie i zapisywanie danych binarnie" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=NAZWA wypisanie połączonego pliku dla pokazania\n" +" różnic w „#ifdef NAZWA”" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +" --GTYPE-group-format=FMTG użyciem FMTF do sformatowania grup\n" +" wejściowych typu GTYPE" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "" +" --line-format=LFMT podobnie, ale z użyciem LFMT do\n" +" sformatowania linii wejściowych" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +" --LTYPE-line-format=FMTL użycie FMTL do sformatowania linii\n" +" wejściowych typu LTYPE" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" Te opcje formatowania dają dokładną kontrolę nad wynikami diff-a,\n" +" są uogólnieniem -D/--ifdef." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +"TYPL to „old” (stary), „new” (nowy) albo „unchanged” (nie zmieniony).\n" +"TYPG to TYPL albo „changed” (zmieniony)." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" (Tylko) FMTG może zawierać:\n" +" %< linie z PLIKU1\n" +" %> linie z PLIKU2\n" +" %= linie wspólne dla PLIKU1 i PLIKU2\n" +" %[-][SZER][.[DOKŁ]]{doxX}LITERA specyfikacja w stylu printf dla " +"LITERY\n" +" LITERY są następujące dla nowej grupy (małe dla starej grupy):\n" +" F numer pierwszej linii\n" +" L numer ostatniej linii\n" +" N ilość linii = L-F+1\n" +" E F-1\n" +" M L+1 %(A=B?T:E) jeżeli A równa się B, to T, jeżeli nie, to E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" (Tylko) LFMT może zawierać:\n" +" %L zawartość linii\n" +" %l zawartość linii z wyłączeniem znaku nowej linii\n" +" %[-][SZER][.[DOKŁ]]{doxX}n specyfikację numeru linii w stylu printf" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" Zarówno FMTG jak FMTL mogą zawierać:\n" +" %% %\n" +" %c'Z' pojedynczy znak Z\n" +" %c'\\OOO' znak o kodzie ósemkowym OOO\n" +" Z znak Z (inne znaki reprezentują same siebie)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d --minimal usiłowanie znalezienia mniejszego zbioru zmian" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +" --horizon-lines=ILE zostawienie ILE linii wspólnego przedrostka i " +"przyrostka" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files założenie: duże pliki i rozrzucone małe zmiany" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" +" --color[=KIEDY] kolorowe wyniki; KIEDY to „never” (nigdy), " +"„always”\n" +" (zawsze) albo „auto” (wartość domyślna)" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" +" --palette=PALETA kolory do użycia przy włączonym --color;\n" +" PALETA jest listą oddzielonych dwukropkami\n" +" właściwości terminfo" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help wypisanie tej pomocy i zakończenie" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v --version wypisanie informacji o wersji i zakończenie" + +#: src/diff.c:982 +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"PLIKI to „PLIK1 PLIK2” albo „KATALOG1 KATALOG2” albo „KATALOG PLIK” albo\n" +"„PLIK KATALOG”." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Jeżeli użyta jest opcja --from-file albo --to-file, nie ma ograniczeń co do\n" +"PLIKU/ÓW." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Jeżeli PLIK to „-”, czytane jest standardowe wejście." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Składnia: %s [OPCJA]... PLIKI\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Porównanie PLIKÓW kolejnymi liniami." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "sprzeczna wartość opcji %s: „%s”" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "sprzeczne opcje stylu wyniku" + +#: src/diff.c:1058 +#, c-format +msgid "invalid color '%s'" +msgstr "błędny kolor „%s”" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Tylko w %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "nie można porównać „-” z katalogiem" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "opcja -D nie działa dla katalogów" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Wspólne podkatalogi: %s i %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Plik %s jest %s, podczas gdy plik %s jest %s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Dowiązania symboliczne %s i %s różnią się\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Pliki %s i %s są identyczne\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "niezgodne opcje" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "„-” podany dla więcej niż jednego pliku wejściowego" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "nieudany odczyt" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A --show-all wypisanie wszystkich zmian, konflikty w nawiasach" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e --ed wypisanie niezłączonych zmian między\n" +" STARY_PLIK a NOWY_PLIK do MÓJ_PLIK" + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "-E --show-overlap jak -e, ale z konfliktami w nawiasach" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3 --easy-only jak -e, ale z tylko z nienachodzącymi zmianami" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "-x --overlap-only jak -e, ale tylko z nachodzącymi zmianami" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "-X jak -x, ale z konfliktami w nawiasach" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "-i dodanie poleceń „w” i „q” do skryptu ed-a" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge wypisanie połączonego pliku zgodnie z -A,\n" +" jeżeli nie było innych opcji" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a --text traktowanie plików jako tekstowych" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "--strip-trailing-cr pominięcie znaków nowej linii na wejściu" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T --initial-tab wyrównanie linii przez użycie TAB-ów" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "--diff-program=PROGRAM użycie PROGRAMU do porównania plików" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=ETYKIETA użycie ETYKIETY zamiast nazwy pliku\n" +" (może być powtarzane do trzech razy)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help wypisanie tej pomocy i zakończenie" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "" +"-v --version wypisanie informacji o wersji i zakończenie" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Składnia: %s [OPCJA]... MÓJ_PLIK STARY_PLIK TWÓJ_PLIK\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Porównanie trzech plików linia po linii." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"Domyśly format wyjściowy jest stosunkowo czytelną dla człowieka\n" +"reprezentacją zmian.\n" +"\n" +"Opcje -e, -E, -x, -X (i odpowiednie długie) powodują, że na wyjściu\n" +"pojawia się skrypt ed-a zamiast formatu domyślnego.\n" +"\n" +"Wreszcie opcja -m (--merge) powoduje, że diff3 wewnętrznie łączy\n" +"różnice i wypisuje połączony plik. Przy nietypowych danych wejściowych\n" +"jest to bardziej elastyczne niż użycie ed-a.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"Status wyjściowy ma wartość 0 gdy polecenie wykonało się z prawidłowym\n" +"wynikiem, 1 - jeżeli są konflikty, 2 - jeżeli są problemy." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "bład wewnętrzny: spieprzony format bloków diff" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff nie zadziałał: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "błąd wewnętrzny: błędny typ diff w process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "błędny format diff; błędny separator zmian" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "błędny format diff; niekompletna ostatnia linia" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "nie mógł być wywołany program pomocniczy „%s”" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "błędny format diff; nieprawidłowe znaki na początku linii" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "błąd wenwętrzny: błędny typ diff-a przekazany na wyjście" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "plik wejściowy się zmniejszył" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "nie można porównać nazw plików „%s” i „%s”" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: rekurencyjne zapętlenie katalogów" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o, --output=PLIK tryb interakcyjny, wyniki wysyłane do PLIKU" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "" +"-i --ignore-case traktowanie małych i wielkich liter tak samo" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E --ignore-tab-expansion zignorowanie zmian spowodowanych rozwinięciem\n" +" TAB-ów" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z --ignore-trailing-space ignorowanie znaków odstępu na końcu linii" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b --ignore-space-change zignorowanie zmian ilości znaków odstępu" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W --ignore-all-space ignorowanie wszystkich znaków odstępu" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "-B --ignore-blank-lines zignorowanie zmian liczby pustych linii" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE zignorowanie zmian w liniach pasujących\n" +" do RE" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "--strip-trailing-cr pominięcie znaków nowej linii na wejściu" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a --text traktowanie plików jako tekstowych" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w ILE --width=ILE wypisanie najwyżej ILE (domyślnie 130) kolumn" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" +"-I --left-column wypisanie tylko lewej kolumny dla wspólnych " +"linii" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines bez wypisania wspólnych linii" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t --expand-tabs rozwinięcie TAB-ów w spacje w wyniku" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr " --tabsize=ILE TAB-y co ILE (domyślnie 8) kolumn" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d --minimal usiłowanie znalezienia mniejszego zbioru zmian" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H --speed-large-files założenie: duże pliki i rozrzucone małe zmiany" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=PROGRAM użycie PROGRAMU do porównania plików" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help wypisanie tej pomocy i zakończenie" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "" +"-v --version wypisanie informacji o wersji i zakończenie" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Składnia: %s [OPCJA]... PLIK1 PLIK2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Interaktywne łączenie różnic między PLIKIEM1 a PLIKIEM2." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "nie mogę interakcyjnie łączyć standardowego wejścia" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "oba mające być porównane pliki to katalogi" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tEdycja i użycie obu wersji, każdej z nagłówkiem.\n" +"eb:\tEdycja i użycie obu wersji.\n" +"el albo e1:\tiUżycie wersji po lewej.\n" +"er albo e2:\tEdycja i użycie wersji po prawej.\n" +"e:\tUsunięcie obu wersji i edycja nowej.\n" +"l albo 1:\tUżycie wersji po lewej.\n" +"r albo 2:\tUżycie wersji po prawej.\n" +"s:\tDołączenie wspólnych linii bez informowania o tym.\n" +"v:\tDołączenie wspólnych linii z podaniem informacji.\n" +"q:\tZakończenie.\n" + +#: src/util.c:662 +#, c-format +msgid "unrecognized prefix: %s" +msgstr "nierozpoznany prefiks: %s" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "wartość --palette niemożliwa do rozbioru" diff --git a/local/recipes/tools/diffutils/source/po/pt_BR.gmo b/local/recipes/tools/diffutils/source/po/pt_BR.gmo new file mode 100644 index 0000000000..3d5b75acad Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/pt_BR.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/pt_BR.po b/local/recipes/tools/diffutils/source/po/pt_BR.po new file mode 100644 index 0000000000..58c15056c1 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/pt_BR.po @@ -0,0 +1,1681 @@ +# Brazilian Portuguese translations for diffutis package +# Traduções em português brasileiro para o pacote diffutils +# Copyright (C) 2017 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Halley Pacheco de Oliveira <halleypo@ig.com.br>, 2002. +# Rafael Fontenelle <rffontenelle@gmail.com>, 2016, 2017. +msgid "" +msgstr "" +"Project-Id-Version: diffutils 3.5.25\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2017-05-07 15:53-0200\n" +"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>\n" +"Language-Team: Brazilian Portuguese <ldpbr-translation@lists.sourceforge." +"net>\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Virtaal 1.0.0-beta1\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "argumento inválido para %s: %s" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "argumento ambíguo %s para %s" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "Argumentos válidos são:" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "erro do programa" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "estouro de pilha" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Erro desconhecido de sistema" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "arquivo comum vazio" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "arquivo comum" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "diretório" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "link simbólico" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "fila de mensagem" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "semáforo" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "objeto em memória compartilhada" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "objeto de memória tipificada" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "arquivo especial de bloco" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "arquivo especial de caractere" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "dados contíguos" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "porta" + +#: lib/file-type.c:81 +msgid "multiplexed block special file" +msgstr "arquivo multiplexado especial de bloco" + +#: lib/file-type.c:84 +msgid "multiplexed character special file" +msgstr "arquivo multiplexado especial de caractere" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "arquivo multiplexado" + +#: lib/file-type.c:90 +msgid "named file" +msgstr "arquivo nomeado" + +#: lib/file-type.c:93 +msgid "network special file" +msgstr "arquivo especial de rede" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "arquivo migrado com dados" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "arquivo migrado sem dados" + +#: lib/file-type.c:102 +msgid "port" +msgstr "porta" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "soquete" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "whiteout" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "arquivo estranho" + +#: lib/getopt.c:278 +#, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: a opção \"%s%s\" é ambígua\n" + +#: lib/getopt.c:284 +#, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: a opção \"%s%s\" é ambígua; possibilidades:" + +#: lib/getopt.c:319 +#, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: opção desconhecida \"%s%s\"\n" + +#: lib/getopt.c:345 +#, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: a opção \"%s%s\" não permite argumento\n" + +#: lib/getopt.c:360 +#, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: a opção \"%s%s\" exige um argumento\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: opção inválida -- \"%c\"\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: a opção exige um argumento -- \"%c\"\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "“" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "”" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Sucesso" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Nenhuma ocorrência do padrão" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Expressão regular inválida" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "caractere de combinação inválido" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Nome inválido da classe de caracteres" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Barra invertida no final" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Retrorreferência inválida" + +#: lib/regcomp.c:156 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "[, [^, [:, [. ou [= sem correspondente" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "( ou \\( sem correspondente" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "\\{ sem correspondente" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Conteúdo inválido de \\{\\}" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Fim do intervalo inválido" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Memória esgotada" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "A expressão regular precedente é inválida" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Fim prematuro da expressão regular" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Expressão regular grande demais" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr ") ou \\) sem correspondente" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Nenhuma expressão regular anterior" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "memória esgotada" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "entrada padrão (stdin)" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "saída padrão (stdout)" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "erro padrão (stderr)" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "fluxo desconhecido" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "falha ao reabrir %s com modo %s" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "argumento inválido para %s%s: \"%s\"" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "sufixo inválido no argumento para %s%s: \"%s\"" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "argumento grande demais para %s%s: \"%s\"" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Empacotado por %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Empacotado por %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "(C)" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Licença GPLv3+: GNU GPL versão 3 ou posterior <http://gnu.org/licenses/gpl." +"html>\n" +"Este é um software livre: você é livre para alterá-lo e redistribuí-lo.\n" +"NÃO HÁ QUALQUER GARANTIA, na máxima extensão permitida em lei.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Escrito por %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Escrito por %s e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Escrito por %s, %s e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Escrito por %s, %s, %s\n" +"e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Escrito por %s, %s, %s\n" +"%s e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Escrito por %s, %s, %s\n" +"%s, %s e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Escrito por %s, %s, %s\n" +"%s, %s, %s e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Escrito por %s, %s, %s\n" +"%s, %s, %s, %s\n" +"e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Escrito por %s, %s, %s\n" +"%s, %s, %s, %s\n" +"%s e %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Escrito por %s, %s, %s\n" +"%s, %s, %s, %s,\n" +"%s, %s e outros.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Relate erros para: %s\n" +"Relate erros de tradução para <http://ldpbr-translation@lists.sourceforge." +"net>\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Relate os erros do %s para: %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Página do %s: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "Página do %s: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "Ajuda geral no uso de software GNU: <http://www.gnu.org/gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Os arquivos %s e %s são diferentes\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Os arquivos binários %s e %s são diferentes\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Nenhum caractere de nova linha no final do arquivo" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Tente \"%s --help\" para mais informações." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "valor inválido --ignore-initial \"%s\"" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "as opções -l e -s são incompatíveis" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "erro de escrita" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "saída padrão" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b, --print-bytes imprime os bytes diferentes" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i, --ignore-initial=SALTO ignora os primeiros SALTO bytes da entrada" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=SALTO1:SALTO2\n" +" ignora os primeiros SALTO1 bytes do " +"ARQUIVO1\n" +" e os primeiros SALTO2 bytes do ARQUIVO2" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l, --verbose emite os números de bytes e os valores de\n" +" todos os bytes diferentes" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=LIMITE compara no máximo LIMITE bytes" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent suprime todas saídas normais" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help mostra esta ajuda e sai" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v, --version mostra informação sobre a versão e sai" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Uso: %s [OPÇÃO]... ARQUIVO1 [ARQUIVO2 [SALTO1 [SALTO2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Compara dois arquivos byte por byte." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"Os argumentos opcionais SALTO1 e SALTO2 especificam o número de\n" +"bytes para ignorar no começo de cada arquivo (zero por padrão)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Argumentos obrigatórios para opções longas também o são para opções curtas.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"Os valores do SALTO podem ser seguidos por sufixos multiplicativos a " +"seguir:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824,\n" +"e assim por diante para T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Se ARQUIVO for igual a \"-\" ou for omitido, ler da entrada padrão." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"Status de saída é 0 se as entradas forem iguais, 1 se diferente e 2 se " +"problema." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "valor inválido --bytes \"%s\"" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "faltando operando após \"%s\"" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "operando extra \"%s\"" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s e %s são diferentes: byte %s, linha %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s e %s são diferentes: byte %s, linha %s é %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: Fim de arquivo (EOF) em %s que está vazio\n" + +#: src/cmp.c:585 +#, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "cmp: Fim de arquivo (EOF) em %s após byte %s, linha %s\n" + +#: src/cmp.c:586 +#, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "cmp: Fim de arquivo (EOF) em %s após byte %s, na linha %s\n" + +#: src/cmp.c:592 +#, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: Fim de arquivo (EOF) em %s após byte %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "o comprimento do contexto não é válido \"%s\"" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "sem suporte a paginação neste computador" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "número excessivo de opções de rótulo de arquivo" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "largura inválida \"%s\"" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "opções de largura conflitantes" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "comprimento do horizonte inválido \"%s\"" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "tamanho de tabulação inválido \"%s\"" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "opções de tamanho de tabulação conflitantes" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "ambos --from-file e --to-file especificados" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr " --normal cria um diff no formato normal (padrão)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "" +"-q, --brief indica apenas se os arquivos forem diferentes" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "" +"-s, --report-identical-files indica quando dois arquivos forem o idênticos" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C NÚM, --context[=NÚM] cria em NÚM linhas (padrão 3) de contexto " +"copiado" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U NÚM, --unified[=NÚM] cria em NÚM linhas (padrão 3) de contexto " +"unificado" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed cria um script para o editor ed" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n, --rcs cria um diff no formato RCS" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side cria em duas colunas" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=NÚM limita a saída a NÚM colunas por linha (padrão " +"130)" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +" --left-column emite apenas a coluna da esquerda das linhas\n" +" idênticas" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines não exibe as linhas idênticas" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" +"-p, --show-c-function mostra em qual função C está cada alteração" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" +"-F, --show-function-line=ER mostra a linha mais recente correspondendo à ER" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label RÓTULO usa RÓTULO ao invés do nome do arquivo e\n" +" carimbo de tempo (pode ser repetido)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs expande as tabulações para espaços na saída" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab alinha tabulações introduzindo uma\n" +" tabulação no início" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=NÚM paradas de tabulação a cada NÚM colunas\n" +" (padrão=8)" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty suprime espaço ou tabulação antes de linhas\n" +" vazias na saída" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" +"-l, --paginate passa a saída por meio de \"pr\" para paginá-la" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r, --recursive compara recursivamente os subdiretórios\n" +" encontrados" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference não interpreta links simbólicos" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "" +"-N, --new-file considera os arquivos ausentes como vazios" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +" --unidirectional-new-file considera os primeiros arquivos ausentes\n" +" como vazios" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case não faz distinção entre letras maiúsculas e\n" +" minúsculas nos nomes dos arquivos" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case faz distinção entre letras maiúsculas e\n" +" minúsculas nos nomes dos arquivos" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "" +"-x, --exclude=PADRÃO exclui arquivos correspondendo a PADRÃO" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=ARQUIVO exclui arquivos com correspondam a qualquer\n" +" padrão contido em ARQUIVO" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=ARQUIVO inicia por ARQUIVO ao comparar diretórios" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=ARQUIVO1 compara ARQUIVO1 com todos os operandos;\n" +" ARQUIVO1 pode ser um diretório" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=ARQUIVO2 compara todos os operandos com ARQUIVO2;\n" +" ARQUIVO2 pode ser um diretório" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i, --ignore-case não faz distinção entre letras maiúsculas e\n" +" minúsculas no conteúdo do arquivo" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion ignora as diferenças causadas pela expansão\n" +" da tabulação" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" +"-Z, --ignore-trailing-space ignora espaços em branco no fim das linhas" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change ignora as diferenças na quantidade de " +"espaços\n" +" em branco" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space ignora todos os espaços em branco" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B, --ignore-blank-lines ignora diferenças onde as linhas estão vazias" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=ER ignora as diferenças nas linhas que " +"correspondem\n" +" à Expressão Regular" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text trata todos os arquivos como texto" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr remove o caractere de retorno de carro\n" +" (CR) ao final da linha na entrada" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr " --binary lê e escreve os dados em modo binário" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=NOME exibe o arquivo mesclado incluindo\n" +" \"#ifndef NOME\" nas diferenças" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +" --GTYPE-group-format=GFMT formata grupos de entrada GTYPE com GFMT" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "" +" --line-format=LFMT formata todas as linhas de entrada com LFMT" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +" --LTYPE-line-format=LFMT formata todas as linhas de entrada LTYPE com " +"LFMT" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" Essa opções de formatação fornece um controle refinado sobre a saída\n" +" das diferenças, generalizando -D/--ifdef." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE pode ser \"old\", \"new\" ou \"unchanged\". GTYPE é LTYPE ou " +"\"changed\"." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT pode conter (apenas):\n" +" %< linhas do ARQUIVO1\n" +" %> linhas do ARQUIVO2\n" +" %= linhas idênticas em ARQUIVO1 e ARQUIVO2\n" +" %[-][LARGURA][.[PREC]]{doxX}LETRA especificação para LETRA\n" +" utilizando a mesma notação do comando printf(). \n" +" Os códigos permitidos para LETRA são,\n" +" em maiúsculas para grupos novos,\n" +" em minúsculas para grupos antigos:\n" +" F número da primeira linha\n" +" L número da última linha\n" +" N número de linhas = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) se A igual B, então T; senão E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT pode conter (apenas):\n" +" %L conteúdo da linha\n" +" %l conteúdo da linha, excluindo o caractere final de nova linha\n" +" %[-][LARGURA][.[PREC]]{doxX}n especificação estilo printf() do número\n" +" da linha da utilizando" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" GFMT ou LFMT pode conter:\n" +" %% %\n" +" %c'C' o caractere C\n" +" %c'\\OOO' o caractere com código octal OOO\n" +" C o caractere C (outros caracteres representam a si próprios)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d, --minimal se esforça para localizar o menor conjunto\n" +" de diferenças" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +" --horizon-lines=NÚM mantém NÚM linhas de prefixo e sufixo idênticos" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files assume arquivos grandes e muitas alterações\n" +" pequenas espalhadas" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" +" --color[=QUANDO] colore a saída; QUANDO pode ser \"never\", \"always" +"\",\n" +" ou \"auto\" (o padrão)" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" +" --palette=PALETA as cores para usar quando --color está ativa;\n" +" PALETA é uma lista de capacidades de terminfo\n" +" separadas por caractere de dois pontos" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help mostra esta ajuda e sai" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version mostra as informações da versão e sai" + +#: src/diff.c:982 +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"ARQUIVOS são \"ARQUIVO1 ARQUIVO2\", \"DIR1 DIR2\", \"DIR ARQUIVO\" ou " +"\"ARQUIVO DIR\"." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Se --from-file ou --to-file for especificado, não há restrição em ARQUIVO(s)." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Se um ARQUIVO for igual a \"-\", lê da entrada padrão." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Uso: %s [OPÇÃO]... ARQUIVOS\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Compara ARQUIVOS linha por linha." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "opção %s com valor conflitante \"%s\"" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "opções conflitantes de estilo de saída" + +#: src/diff.c:1058 +#, c-format +msgid "invalid color '%s'" +msgstr "cor inválida \"%s\"" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Somente em %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "não é possível comparar \"-\" com um diretório" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "Sem suporte à opção -D com diretórios" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Subdiretórios idênticos: %s e %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "O arquivo %s é %s, enquanto o arquivo %s é %s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Os links simbólicos %s e %s são diferentes\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Os aquivos %s e %s são idênticos\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "opções incompatíveis" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "\"-\" especificado para mais de um arquivo de entrada" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "falha de leitura" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A, --show-all exibe todas as diferenças, com os conflitos\n" +" entre parênteses" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed cria um script de ed para incorporar as\n" +" diferenças entre ARQUIVO1 e ARQUIVO2\n" +" em ARQUIVO3" + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +"-E, --show-overlap similar a -e, mas exibe conflitos entre " +"parênteses" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3, --easy-only similar a -e, mas incorpora apenas as " +"alterações\n" +" que não se sobreponham" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +"-x, --overlap-only similar a -e, mas incorpora apenas as " +"alterações\n" +" que se sobrepõem" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" +"-X similar a -x, mas exibe conflitos entre parentes" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "" +"-i anexa os comandos \"w\" e \"q\" aos scripts de ed" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge emite arquivo mesclado atual, conforme\n" +" -A se nenhuma outra opções for fornecida" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text trata todos os arquivos como texto" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr remove o caractere de retorno de carro\n" +" (CR) ao final da linha na entrada" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab alinha tabulações introduzindo uma\n" +" tabulação no início." + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=PROGRAMA usa o PROGRAMA para comparar os arquivos" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label RÓTULO usa RÓTULO ao invés do nome do arquivo\n" +" (pode ser repetido até três vezes)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help mostra esta ajuda e sai" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version mostra informação da versão e sai" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Uso: %s [OPÇÃO]... ARQUIVO1 ARQUIVO2 ARQUIVO3\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Compara três arquivos linha por linha." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"O formato padrão de saída é uma forma legível por humanos de representação\n" +"das alterações.\n" +"\n" +"As opções -e, -E, -x, -X (e opções extensas correspondentes) fazem com que\n" +"um script de ed seja criado, ao invés do padrão.\n" +"\n" +"Finalmente, a opção -m (--merge) faz com que diff3 faça a mesclagem\n" +"internalmente e emite o arquivo mesclado atual. Para entradas incomuns,\n" +"isto é mais robusto do que usar o ed.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "Status de saída é 0 se houver sucesso, 1 se conflitos e 2 se problema." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "erro interno: confusão no formato dos blocos diff" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff falhou: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "erro interno: tipo de diff inválido em process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "formato de diff inválido; separador de diferença inválido" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "formato de diff inválido; última linha incompleta" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "o programa subsidiário \"%s\" não pôde ser invocado" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "formato de diff inválido; caracteres incorretos na linha de início" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "erro interno: tipo de diff inválido passado para a saída" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "o arquivo de entrada diminuiu" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "não foi possível comparar os nomes dos arquivos \"%s\" e \"%s\"" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: loop de diretório recursivo" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o, --output=ARQUIVO age interativamente, enviando a saída para " +"ARQUIVO" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "" +"-i, --ignore-case não faz distinção entre letras maiúsculas\n" +" e minúsculas" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion ignorar as diferenças causadas pela expansão\n" +" da tabulação" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" +"-Z, --ignore-trailing-space ignora espaços em branco no fim das linhas" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change ignora as diferenças na quantidade de espaços\n" +" em branco" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space ignora todos os espaços em branco" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" +"-B, --ignore-blank-lines ignora diferenças onde as linhas estão vazias" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=ER ignora as diferenças em linhas que " +"correspondem\n" +" à Expressão Regular" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr remove o caractere de retorno de carro\n" +" (CR) ao final da linha na entrada" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a, --text trata todos os arquivos como texto" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=NÚM limita a saída a NÚM colunas por linha (padrão " +"130)" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" +"-l, --left-column emite apenas a coluna da esquerda das linhas\n" +" idênticas" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines não emite as linhas idênticas" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs expande as tabulações para espaços na saída" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +" --tabsize=NÚM paradas de tabulação a cada NÚM colunas\n" +" (padrão=8)" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d, --minimal se esforça para localizar o menor conjunto\n" +" de diferenças" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files assume arquivos grandes e muitas alterações\n" +" pequenas espalhadas" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=PROGRAMA usa o PROGRAMA para comparar os arquivos" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help mostra esta ajuda e sai" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v, --version mostra informação da versão e sai" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Uso: %s [OPÇÃO]... ARQUIVO1 ARQUIVO2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Mesclagem lado a lado das diferenças entre ARQUIVO1 e ARQUIVO2." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "não foi possível mesclar interativamente a entrada padrão" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "os dois arquivos a serem comparados são diretórios" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tEdita e, então, usa ambas as versões, cada uma com seu cabeçalho.\n" +"eb:\tEdita e, então, usa ambas as versões.\n" +"el ou e1:\tEdita e, então, usa a versão da esquerda.\n" +"er ou e2:\tEdita e, então, usa a versão da direita.\n" +"e:\tEdita uma nova versão.\n" +"l ou 1:\tUsa a versão da esquerda.\n" +"r ou 2:\tUsa a versão da direita.\n" +"s:\tInclui silenciosamente as linhas idênticas.\n" +"v:\tInclui verbosamente as linhas idênticas.\n" +"q:\tSai.\n" + +#: src/util.c:662 +#, c-format +msgid "unrecognized prefix: %s" +msgstr "prefixo desconhecido: %s" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "valor não analisável para --palette" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: a opção \"--%s\" não permite um argumento\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: opção desconhecida \"--%s\"\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: a opção \"-W %s\" é ambígua\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: a opção \"-W %s\" não permite um argumento\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: a opção \"-W %s\" exige um argumento\n" + +#~ msgid " or 'auto' (the default)" +#~ msgstr " ou \"auto\" (o padrão)" + +#~ msgid "" +#~ " --palette=PALETTE specify the colors to use when --color is active" +#~ msgstr "" +#~ " --palette=PALETA especifica as cores para usar com --color ativada" + +#~ msgid "%s: illegal option -- %c\n" +#~ msgstr "%s: a opção -- %c é ilegal\n" + +#~ msgid "" +#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n" +#~ "You may redistribute copies of this program\n" +#~ "under the terms of the GNU General Public License.\n" +#~ "For more information about these matters, see the files named COPYING." +#~ msgstr "" +#~ "Este programa não tem nenhum tipo de garantia, o tanto quanto\n" +#~ "é permitido por lei. Você pode redistribuir cópias deste\n" +#~ "programa sob os termos da Licença Pública Geral GNU. Para\n" +#~ "mais informações a este respeito, leia o arquivo COPYING." + +#~ msgid "Written by Torbjorn Granlund and David MacKenzie." +#~ msgstr "Escrito por Torbjörn Granlund e David MacKenzie." + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i SALTO1:SALTO2 --ignore-initial=SALTO1:SALTO2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "" +#~ "-s --quiet --silent Não exibir nada; retornar apenas o status de " +#~ "fim." + +#~ msgid "--help Output this help." +#~ msgstr "--help Exibir esta ajuda." + +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>." +#~ msgstr "Relatar os problemas para <bug-gnu-utils@gnu.org>." + +#~ msgid "" +#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman, and Len Tower." +#~ msgstr "" +#~ "Escrito por Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman, e Len Tower." + +#~ msgid "`-%ld' option is obsolete; use `-%c %ld'" +#~ msgstr "a opção `-%ld' está obsoleta; usar `-%c %ld'" + +#~ msgid "`-%ld' option is obsolete; omit it" +#~ msgstr "a opção `-%ld' está obsoleta; omita-a" + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ "-c -C N --context[=N] Exibir o contexto regular das diferenças\n" +#~ " usando N linhas de contexto (N=3 por " +#~ "padrão).\n" +#~ "-u -U N --unified[=N] Exibir o contexto unificado das diferenças\n" +#~ " usando N linhas de contexto (N=3 por " +#~ "padrão).\n" +#~ " --label RÓTULO Usar RÓTULO em vez do nome do arquivo.\n" +#~ " -p --show-c-function Mostrar em qual função C (ed) está cada " +#~ "diferença.\n" +#~ " -F EXPREG --show-function-line=EXPREG\n" +#~ " Exibir a linha mais recente que corresponde\n" +#~ " à EXPressão REGular." + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ "-y --side-by-side Exibir em duas colunas.\n" +#~ " -W N --width=N Exibir no máximo N colunas. (N=130 por " +#~ "padrão)\n" +#~ " --left-column Exibir apenas a coluna da esquerda nas " +#~ "linhas\n" +#~ " idênticas.\n" +#~ " --suppress-common-lines Não exibir as linhas idênticas." + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "" +#~ "--speed-large-files Assumir arquivos grandes e muitas alterações\n" +#~ " pequenas espalhadas." + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "" +#~ "-X Exibir as diferenças que se sobrepõem,\n" +#~ " entre parênteses." + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "" +#~ "-m --merge Exibir o arquivo mesclado em vez do script do " +#~ "ed\n" +#~ " (implica -A)." + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "-L RÓTULO --label=RÓTULO Usar RÓTULO em vez do nome do arquivo." + +#~ msgid "subsidiary program `%s' failed" +#~ msgstr "o programa auxiliar `%s' falhou" + +#~ msgid "subsidiary program `%s' not executable" +#~ msgstr "o programa auxiliar `%s' não é executável" diff --git a/local/recipes/tools/diffutils/source/po/quot.sed b/local/recipes/tools/diffutils/source/po/quot.sed new file mode 100644 index 0000000000..0122c46318 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/quot.sed @@ -0,0 +1,6 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g diff --git a/local/recipes/tools/diffutils/source/po/remove-potcdate.sin b/local/recipes/tools/diffutils/source/po/remove-potcdate.sin new file mode 100644 index 0000000000..2436c49e78 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/remove-potcdate.sin @@ -0,0 +1,19 @@ +# Sed script that remove the POT-Creation-Date line in the header entry +# from a POT file. +# +# The distinction between the first and the following occurrences of the +# pattern is achieved by looking at the hold space. +/^"POT-Creation-Date: .*"$/{ +x +# Test if the hold space is empty. +s/P/P/ +ta +# Yes it was empty. First occurrence. Remove the line. +g +d +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} diff --git a/local/recipes/tools/diffutils/source/po/ro.gmo b/local/recipes/tools/diffutils/source/po/ro.gmo new file mode 100644 index 0000000000..17ad5c2fce Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/ro.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/ro.po b/local/recipes/tools/diffutils/source/po/ro.po new file mode 100644 index 0000000000..a949bda37e --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/ro.po @@ -0,0 +1,1660 @@ +# Mesajele n limba romn pentru diffutils-2.8.3 +# Copyright (C) 2003 Free Software Foundation, Inc. +# Acest fi?ier este distribuit sub aceea?i licen?? ca ?i pachetul diffutils +# Eugen Hoanca <eugenh@urban-grafx.ro>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: diffutils 2.8.3\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2003-08-22 08:43+0300\n" +"Last-Translator: Eugen Hoanca <eugenh@urban-grafx.ro>\n" +"Language-Team: Romanian <translation-team-ro@lists.sourceforge.net>\n" +"Language: ro\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "eroare de program" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "stiv plin(overflow)" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Eroare de sistem necunoscut" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "fiier obinuit(regular) vid" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "fiier obinuit" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "director" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "legtur simbolic" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "coad(queue) de mesaje" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "semafor" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "obiect memorie global(shared memory)" + +#: lib/file-type.c:61 +#, fuzzy +msgid "typed memory object" +msgstr "obiect memorie global(shared memory)" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "fiier bloc special" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "fiier caracter special" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "" + +#: lib/file-type.c:81 +#, fuzzy +msgid "multiplexed block special file" +msgstr "fiier bloc special" + +#: lib/file-type.c:84 +#, fuzzy +msgid "multiplexed character special file" +msgstr "fiier caracter special" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "" + +#: lib/file-type.c:90 +#, fuzzy +msgid "named file" +msgstr "fiier ciudat" + +#: lib/file-type.c:93 +#, fuzzy +msgid "network special file" +msgstr "fiier bloc special" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "" + +#: lib/file-type.c:102 +msgid "port" +msgstr "" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "socket" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "fiier ciudat" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: opiunea `%s' este ambigu\n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: opiunea `%s' este ambigu\n" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: opiune necunoscut `%c%s'\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: opiunea `%c%s' nu permite parametri\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: opiunea `%s' necesit un parametru\n" + +#: lib/getopt.c:621 +#, fuzzy, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: opiune invalid -- %c\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, fuzzy, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: opiunea necesit un parametru -- %c\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Succes" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Nici o potrivire" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Expresie normal(regular) invalid" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Caracter de comparare invalid" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Nume clas caracter invalid" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Backslash de sfrit de linie(trailing)" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Referin precedent invalid" + +#: lib/regcomp.c:156 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "[ sau [^ nenchise" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "( or \\( nenchise" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "\\{ nenchis" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Coninut invalid al \\{\\}" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Sfrit de domeniu invalid" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Memorie plin" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Expresie normal de preceden invalid" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Sfrit prematur de expresie normal" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Expresie normal prea mare" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr ") or \\) nedeschise" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Nu a existat nici o expresie normal antecedent" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "memorie plin" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "" + +#: lib/xfreopen.c:38 +#, fuzzy +msgid "unknown stream" +msgstr "Eroare de sistem necunoscut" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "" + +#: lib/xstrtol-error.c:63 +#, fuzzy, c-format +msgid "invalid %s%s argument '%s'" +msgstr "valoare --bytes invalid `%s'" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "(C)" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, fuzzy, c-format +msgid "Written by %s.\n" +msgstr "Scris de Thomas Lord." + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, fuzzy, c-format +msgid "Written by %s and %s.\n" +msgstr "Scris de Randy Smith." + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, fuzzy, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Scris de Randy Smith." + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Fiierele %s i %s difer\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Fiierele binare %s i %s difer\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Nici un element de linie nou la sfritul fiierului" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, fuzzy, c-format +msgid "Try '%s --help' for more information." +msgstr "ncercai `%s --help' pentru mai multe informaii." + +#: src/cmp.c:137 +#, fuzzy, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "invalid --se ignor valoarea iniial `%s'" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "opiunile -l i -s sunt incompatibile" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "scriere euat" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "ieire(output) standard" + +#: src/cmp.c:161 +#, fuzzy +msgid "-b, --print-bytes print differing bytes" +msgstr "-b --print-bytes Tiprete octeii diferii." + +#: src/cmp.c:162 +#, fuzzy +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i OMIS --ignore-initial=OMIS Omite primii octei OMISi din intrare(input)." + +#: src/cmp.c:163 +#, fuzzy +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +" Omite primii OMIS1 octei din FIIER1 i primii OMIS2 octei din FIIER2" + +#: src/cmp.c:165 +#, fuzzy +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l --verbose Tiprete numerele octeilor i valorile octeilor diferii." + +#: src/cmp.c:166 +#, fuzzy +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n LIMIT --bytes=LIMIT Compar cel mult LIMIT octei." + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr "" + +#: src/cmp.c:169 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "-v --version Tiprete informaii despre versiune." + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Folosire: %s [OPIUNE]... FIIER1 [FIIER2 [OMIS1 [OMIS2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Compar dou fiiere octet cu octet." + +#: src/cmp.c:182 +#, fuzzy +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"OMIS1 i OMIS2 sunt numerele de octei care s fie omii din fiecare fiier." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"Valorile OMIS pot fi urmate de urmtoarele sufixe multiplicative:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, i aa mai departe pentru T, P, E, Z, Y." + +#: src/cmp.c:194 +#, fuzzy +msgid "If a FILE is '-' or missing, read standard input." +msgstr "" +"Dac un FIIER este `-' sau lipsete, se citete intrarea(input) standard." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" + +#: src/cmp.c:240 +#, fuzzy, c-format +msgid "invalid --bytes value '%s'" +msgstr "valoare --bytes invalid `%s'" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, fuzzy, c-format +msgid "missing operand after '%s'" +msgstr "lipsete operandul dup `%s'" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, fuzzy, c-format +msgid "extra operand '%s'" +msgstr "operand n plus(extra) `%s'" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s difer: octetul %s, linia %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s difer: octetul %s, linia %s este %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: EOF n %s\n" + +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s %s difer: octetul %s, linia %s\n" + +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s %s difer: octetul %s, linia %s\n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: EOF n %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "" + +#: src/diff.c:353 +#, fuzzy, c-format +msgid "invalid context length '%s'" +msgstr "lungime invalid de context `%s'" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "paginaie nesuportat de acest host" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "prea multe opiuni de etichete fiier" + +#: src/diff.c:528 +#, fuzzy, c-format +msgid "invalid width '%s'" +msgstr "lungime invalid `%s'" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "opiuni de lungime n conflict" + +#: src/diff.c:557 +#, fuzzy, c-format +msgid "invalid horizon length '%s'" +msgstr "lungime de orizont invalid `%s'" + +#: src/diff.c:613 +#, fuzzy, c-format +msgid "invalid tabsize '%s'" +msgstr "mrime tab invalid `%s'" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "opiuni mrime tab n conflict" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr " --from-file i --to-file sunt specificate mpreun" + +#: src/diff.c:891 +#, fuzzy +msgid " --normal output a normal diff (the default)" +msgstr "--normal Afieaz un diff normal." + +#: src/diff.c:892 +#, fuzzy +msgid "-q, --brief report only when files differ" +msgstr "-q --brief Afieaz doar dac fiierele difer." + +#: src/diff.c:893 +#, fuzzy +msgid "-s, --report-identical-files report when two files are the same" +msgstr "" +"-s --report-identical-files Raporteaz cnd dou fiiere sunt asemntoare." + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" + +#: src/diff.c:895 +#, fuzzy +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-w NUM --width=NUM Afieaz cel mult NUM (implicit 130) coloane tiprite." + +#: src/diff.c:896 +#, fuzzy +msgid "-e, --ed output an ed script" +msgstr "-e --ed Afieaz un script ed." + +#: src/diff.c:897 +#, fuzzy +msgid "-n, --rcs output an RCS format diff" +msgstr "-n --rcs Afieaz un diff n format RCS." + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "" + +#: src/diff.c:899 +#, fuzzy +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w NUM --width=NUM Afieaz cel mult NUM (implicit 130) coloane tiprite." + +#: src/diff.c:900 +#, fuzzy +msgid "" +" --left-column output only the left column of common lines" +msgstr "-l --left-column Afieaz doar coloana din stnga a liniilor comune." + +#: src/diff.c:901 +#, fuzzy +msgid " --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines Nu afia liniile comune." + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" + +#: src/diff.c:908 +#, fuzzy +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t --expand-tabs Schimb tab-urile n spaii la ieire(output)." + +#: src/diff.c:909 +#, fuzzy +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T --initial-tab Aliniaz tab-urile adugnd n fa un tab." + +#: src/diff.c:910 +#, fuzzy +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +"--tabsize=NUM Opririle tab-ului vor fi la fiecare NUM (implicit 8) coloane " +"tiprite." + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" + +#: src/diff.c:912 +#, fuzzy +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" +"-l --paginate Trimite ieirea(output) prin `pr' pentru a fi paginat." + +#: src/diff.c:914 +#, fuzzy +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "-r --recursive Compar recursiv orice subdirector ntlnit." + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr "" + +#: src/diff.c:916 +#, fuzzy +msgid "-N, --new-file treat absent files as empty" +msgstr "-N --new-file Trateaz fiierele lips ca vide." + +#: src/diff.c:917 +#, fuzzy +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "--unidirectional-new-file Trateaz primele fiiere lips ca vide." + +#: src/diff.c:918 +#, fuzzy +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +"--ignore-file-name-case Ignor cazul cnd se compar numele de fiiere." + +#: src/diff.c:919 +#, fuzzy +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +"--no-ignore-file-name-case Ia n calcul cazul atunci cnd se compar numele " +"de fiiere." + +#: src/diff.c:920 +#, fuzzy +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "-x TIP --exclude=TIP Exclude fiierele care se potrivesc TIParului." + +#: src/diff.c:921 +#, fuzzy +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X FIIER --exclude-from=FIIER Exclude fiierele care se potrivesc " +"oricrui tipar din FIIER." + +#: src/diff.c:922 +#, fuzzy +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S FIIER --starting-file=FIIER ncepe cu FIIER n compararea " +"directoarelor." + +#: src/diff.c:923 +#, fuzzy +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +"--from-file=FIIER1 Compar FIIER1 cu toi operanzii. FIIER1 poate fi " +"director." + +#: src/diff.c:925 +#, fuzzy +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +"--to-file=FIIER2 Compar toi operanzii cu FIIER2. FIIER2 poate fi " +"director." + +#: src/diff.c:928 +#, fuzzy +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i --ignore-case Ignor diferenele de caz din coninutul fiierului." + +#: src/diff.c:929 +#, fuzzy +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E --ignore-tab-expansion Ignor schimbrile produse de modificarea tab-" +"ului." + +#: src/diff.c:930 +#, fuzzy +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-w --ignore-all-space Ignor tot spaiul vid." + +#: src/diff.c:931 +#, fuzzy +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b --ignore-space-change Ignor schimbrile din spaiul vid." + +#: src/diff.c:932 +#, fuzzy +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w --ignore-all-space Ignor tot spaiul vid." + +#: src/diff.c:933 +#, fuzzy +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B --ignore-blank-lines Ignor schimbrile unde toate liniile sunt " +"goale(blank)." + +#: src/diff.c:934 +#, fuzzy +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I RE --ignore-matching-lines=RE Ignor schimbrile la toate liniile care " +"se potrivesc RE-ului." + +#: src/diff.c:936 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr "-a --text Trateaz toate fiierele ca text." + +#: src/diff.c:937 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +"--strip-trailing-cr Elimin returul de car(carriage return) final la " +"intrare(input)." + +#: src/diff.c:939 +#, fuzzy +msgid " --binary read and write data in binary mode" +msgstr "--binary Citete i scrie date n mod binar." + +#: src/diff.c:942 +#, fuzzy +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D NUME --ifdef=NUME Afieaz fiierul rezultat(merged) pentru a arta " +"diff-urile`#ifdef NAME'." + +#: src/diff.c:943 +#, fuzzy +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +"--GTYPE-group-format=GFMT Similar, dar formatul de intrare GTYPE se " +"grupeaz cu GFMT." + +#: src/diff.c:944 +#, fuzzy +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "--line-format=LFMT Similar, dar formateaz toate liniile cu LFMT." + +#: src/diff.c:945 +#, fuzzy +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +"--LTYPE-line-format=LFMT Similar, dar formateaz liniile de intrare LTYPE " +"cu LFMT." + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" + +#: src/diff.c:948 +#, fuzzy +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE este `old', `new', sau `unchanged'. GTYPE este LTYPE sau `changed'." + +#: src/diff.c:949 +#, fuzzy +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT poate conine:\n" +" %< linii din FIIER1\n" +" %> linii din FIIER2\n" +" %= linii comune lui FIIER1 si FIIER2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER specificaii stil printf pentru " +"LETTER\n" +" LETTERs sunt dup cum urmeaz pentru grup nou, liter mic pentru grup " +"vechi:\n" +" F primul numr de linie\n" +" L ultimul numr de linie\n" +" N numere de linii = L-F+1\n" +" E F-1\n" +" M L+1" + +#: src/diff.c:961 +#, fuzzy +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT poate conine:\n" +" %L coninut de linie\n" +" %l coninut de linie, excluznd orice caracter de linie nou final\n" +" %[-][WIDTH][.[PREC]]{doxX}n specificaii stil printf-pentru " +"introducerea numrului de linie" + +#: src/diff.c:965 +#, fuzzy +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" Una din GFMT sau LFMT poate conine:\n" +" %% %\n" +" %c'C' caracterul singular C\n" +" %c'\\OOO' caracterul cu codul octal OOO" + +#: src/diff.c:971 +#, fuzzy +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d --minimal ncearc din greu s gseti un set mai mic de schimbri" + +#: src/diff.c:972 +#, fuzzy +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "--horizon-lines=NUM Reine NUM linii de prefix i sufix comun." + +#: src/diff.c:973 +#, fuzzy +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +"-H --speed-large-files Presupune fiiere mari i multe modificri mici " +"mprtiate." + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr "" + +#: src/diff.c:980 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "-v --version Tiprete informaii despre versiune." + +#: src/diff.c:982 +#, fuzzy +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"FIIEREle sunt `FIIER1 FIIER2' sau `DIR1 DIR2' sau `DIR FIIER...' or " +"`FIIER... DIR'." + +#: src/diff.c:983 +#, fuzzy +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Dac --from-file sau --to-file sunt precizate, nu exist restricii pe " +"FIIERE." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +#, fuzzy +msgid "If a FILE is '-', read standard input." +msgstr "Dac FIIER este `-', se citete intrarea(input) standard." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Folosire: %s [OPIUNE]... FIIERE\n" + +#: src/diff.c:995 +#, fuzzy +msgid "Compare FILES line by line." +msgstr "Compar fiierele linie cu linie." + +#: src/diff.c:1029 +#, fuzzy, c-format +msgid "conflicting %s option value '%s'" +msgstr "Exist un conflict cu %s n valoarea opiunii `%s'" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "Conflict n opiunile stilului de afiare(output)" + +#: src/diff.c:1058 +#, fuzzy, c-format +msgid "invalid color '%s'" +msgstr "lungime invalid de context `%s'" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Doar n %s: %s\n" + +#: src/diff.c:1248 +#, fuzzy +msgid "cannot compare '-' to a directory" +msgstr "nu se poate compara `-' cu un director" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "opiunea -D nu este compatibil cu directoarele" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Subdirectoare comune: %s i %s.\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Fiierul %s este un %s pe cnd fiierul %s este un %s.\n" + +#: src/diff.c:1370 +#, fuzzy, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Fiierele %s i %s difer\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Fiierele %s i %s sunt identice\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +#, fuzzy +msgid "Randy Smith" +msgstr "Scris de Randy Smith." + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "opiuni incompatibile" + +#: src/diff3.c:391 +#, fuzzy +msgid "'-' specified for more than one input file" +msgstr "`-' specificat pentru mai mult de un fiier de intrare(input)" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "citire euat" + +#: src/diff3.c:475 +#, fuzzy +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "-A --show-all Afieaz toate modificrile, conflictele de paranteze." + +#: src/diff3.c:477 +#, fuzzy +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e --ed Trimite(output) modificrile nerezultate(unmerged) de la " +"FIIER_VECHI la FIIERUL_VOSTRU n FIIERUL_MEU.." + +#: src/diff3.c:479 +#, fuzzy +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +"-E --show-overlap Afieaz modificrile nerezultate(unmerged), conflictele " +"de paranteze." + +#: src/diff3.c:480 +#, fuzzy +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3 --easy-only Afieaz schimbrile nesuprapuse(nonoverlapping) i " +"nerezultate(unmerged)." + +#: src/diff3.c:481 +#, fuzzy +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "-x --overlap-only Afieaz toate schimbrile de suprapunere." + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" + +#: src/diff3.c:483 +#, fuzzy +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "-i Adaug comenzile `w' i `q' la scripturile ed." + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" + +#: src/diff3.c:488 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr "-a --text Trateaz toate fiierele ca text." + +#: src/diff3.c:489 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +"--strip-trailing-cr Elimin returul de car(carriage return) final la " +"intrare(input)." + +#: src/diff3.c:490 +#, fuzzy +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T --initial-tab Aliniaz tab-urile adugnd n fa un tab." + +#: src/diff3.c:491 +#, fuzzy +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "--diff-program=PROGRAM Folosete PROGRAM pentru a compara fiierele." + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr "" + +#: src/diff3.c:496 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "-v --version Tiprete informaii despre versiune." + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Folosire: %s [OPIUNE]... FIIERUL_MEU FIIER_VECHI FIIERUL_TU\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Compar trei fiiere linie cu linie" + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "eroare intern: zpceal n formatul blocurilor diff" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff euat: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "eroare intern: tip diff invalid n process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "format diff invalid; separator de modificare invalid" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "format diff invalid; ultim-linie incomplet" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, fuzzy, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "programul subsidiar `%s' nu a fost gsit" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "format diff invalid; caractere precedente liniei incorecte" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "eroare intern: tip invalid de diff trimis spre ieire(output)" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "fiier de intrare(input) micorat" + +#: src/dir.c:156 +#, fuzzy, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "nu se pot compara numele de fiiere `%s' i `%s'" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +#, fuzzy +msgid "Thomas Lord" +msgstr "Scris de Thomas Lord." + +#: src/sdiff.c:173 +#, fuzzy +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o FIIER --output=FIIER Opereaz interactiv, trimind outputul spre " +"FIIER." + +#: src/sdiff.c:175 +#, fuzzy +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "" +"-i --ignore-case Consider majusculele i minusculele ca fiind aceleai." + +#: src/sdiff.c:176 +#, fuzzy +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E --ignore-tab-expansion Ignor schimbrile produse de modificarea tab-" +"ului." + +#: src/sdiff.c:177 +#, fuzzy +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-w --ignore-all-space Ignor tot spaiul vid." + +#: src/sdiff.c:178 +#, fuzzy +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b --ignore-space-change Ignor schimbrile din spaiul vid." + +#: src/sdiff.c:179 +#, fuzzy +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W --ignore-all-space Ignor tot spaiul gol." + +#: src/sdiff.c:180 +#, fuzzy +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" +"-B --ignore-blank-lines Ignor schimbrile unde toate liniile sunt " +"goale(blank)." + +#: src/sdiff.c:181 +#, fuzzy +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I RE --ignore-matching-lines=RE Ignor schimbrile la toate liniile care " +"se potrivesc RE-ului." + +#: src/sdiff.c:182 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +"--strip-trailing-cr Elimin returul de car(carriage return) final la " +"intrare(input)." + +#: src/sdiff.c:183 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr "-a --text Trateaz toate fiierele ca text." + +#: src/sdiff.c:185 +#, fuzzy +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w NUM --width=NUM Afieaz cel mult NUM (implicit 130) coloane tiprite." + +#: src/sdiff.c:186 +#, fuzzy +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "-l --left-column Afieaz doar coloana din stnga a liniilor comune." + +#: src/sdiff.c:187 +#, fuzzy +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines Nu afia liniile comune." + +#: src/sdiff.c:189 +#, fuzzy +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t --expand-tabs Schimb tab-urile n spaii la ieire(output)." + +#: src/sdiff.c:190 +#, fuzzy +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +"--tabsize=NUM Opririle tab-ului vor fi la fiecare NUM (implicit 8) coloane " +"tiprite." + +#: src/sdiff.c:192 +#, fuzzy +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d --minimal ncearc din greu s gseti un set mai mic de schimbri" + +#: src/sdiff.c:193 +#, fuzzy +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H --speed-large-files Presupune fiiere mari i multe modificri mici " +"mprtiate." + +#: src/sdiff.c:194 +#, fuzzy +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "--diff-program=PROGRAM Folosete PROGRAM pentru a compara fiierele." + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr "" + +#: src/sdiff.c:197 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "-v --version Tiprete informaii despre versiune." + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Folosire: %s [OPIUNE]... FIIER1 FIIER2\n" + +#: src/sdiff.c:208 +#, fuzzy +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Analiz pas cu pas a diferenelor de fiiere." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "nu poate rezulta(merge) interactiv intrarea(input) standard" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "ambele fiiere de comparat sunt directoare" + +#: src/sdiff.c:818 +#, fuzzy +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tEditeaz apoi folosete ambele versiuni, fiecare decorat cu un cap de " +"tabel.\n" +"eb:\tEditeaz apoi folosete ambele versiuni.\n" +"el:\tEditeaz apoi folosete versiunea din stnga.\n" +"er:\tEditeaz apoi folosete versiunea din dreapta.\n" +"e:\tEditeaz o versiune nou.\n" +"l:\tFolosete versiunea din stnga.\n" +"r:\tFolosete versiunea din dreapta.\n" +"s:\tInclude silenios liniile comune.\n" +"v:\tInclude detaliat liniile comune.\n" +"q:\tIeire.\n" + +#: src/util.c:662 +#, fuzzy, c-format +msgid "unrecognized prefix: %s" +msgstr "%s: opiune necunoscut `--%s'\n" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "" + +#, fuzzy +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: opiunea `--%s' nu permite parametri\n" + +#, fuzzy +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: opiune necunoscut `--%s'\n" + +#, fuzzy +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: opiunea `-W %s' este ambigu\n" + +#, fuzzy +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: opiunea `-W %s' nu permite parametri\n" + +#, fuzzy +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: opiunea `%s' necesit un parametru\n" + +#~ msgid "%s: illegal option -- %c\n" +#~ msgstr "%s: opiune ilegal -- %c\n" + +#~ msgid "" +#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n" +#~ "You may redistribute copies of this program\n" +#~ "under the terms of the GNU General Public License.\n" +#~ "For more information about these matters, see the files named COPYING." +#~ msgstr "" +#~ "Acest program NU vine cu NICI O GARANIE, n msura permis de lege.\n" +#~ "Putei redistribui copii ale acestui program\n" +#~ "sub termenii Licenei Publice Generale GNU.\n" +#~ "Pentru mai multe informaii despre aceste chestiuni, citii fiierul " +#~ "numit COPYING." + +#~ msgid "Written by Torbjorn Granlund and David MacKenzie." +#~ msgstr "Scris de Torbjorn Granlund i David MacKenzie." + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i OMIS1:OMIS2 --ignore-initial=OMIS1:OMIS2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "" +#~ "-s --quiet --silent Nu tiprete nimic; anun(yield) doar starea de " +#~ "ieire." + +#~ msgid "--help Output this help." +#~ msgstr "--help Tiprete acest ajutor." + +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>." +#~ msgstr "Raportai erorile(bugs)la <bug-gnu-utils@gnu.org>." + +#~ msgid "" +#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman, and Len Tower." +#~ msgstr "" +#~ "Scris de Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman, i Len Tower." + +#~ msgid "`-%ld' option is obsolete; use `-%c %ld'" +#~ msgstr "`-%ld' opiunea este nvechit; folosii `-%c %ld'" + +#~ msgid "`-%ld' option is obsolete; omit it" +#~ msgstr "`-%ld' opiunea este nvechit; omitei-o" + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ "-c -C NUM --context[=NUM] Tiprete NUM (implicit 3) linii de " +#~ "contextcopiat.\n" +#~ "-u -U NUM --unified[=NUM] Tiprete NUM (implicit 3) linii de " +#~ "contextunificat.\n" +#~ " --label ETICHET Folosete ETICHET n loc de nume fiier.\n" +#~ " -p --show-c-function Afieaz fiecare schimbare din fiecare funcie " +#~ "C.\n" +#~ " -F RE --show-function-line=RE Afieaz cele mai recente linii care se " +#~ "potrivesc RE." + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ "-y --side-by-side Afieaz pe dou coloane.\n" +#~ " -W NUM --width=NUM Afieaz cel mult NUM (implicit 130) coloane " +#~ "tiprite.\n" +#~ " --left-column Afieaz doar coloana din stnga a liniilor comune.\n" +#~ " --suppress-common-lines Nu afia liniile comune." + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "" +#~ "--speed-large-files Presupune fiiere mari i multe modificri mici " +#~ "mprtiate." + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "-X Afieaz schimbrile de suprapunere, punndu-le n paranteze." + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "" +#~ "-m --merge Afieaz fiierul rezultat(merged) n loc de scriputl ed " +#~ "(implicit -A)." + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "" +#~ "-L ETICHET --label=ETICHET Folosete ETICHET n loc de numele " +#~ "fiierului." + +#~ msgid "subsidiary program `%s' failed" +#~ msgstr "programul subsidiar `%s' euat" + +#~ msgid "subsidiary program `%s' not executable" +#~ msgstr "programul subsidiar `%s' nu este executabil" diff --git a/local/recipes/tools/diffutils/source/po/ru.gmo b/local/recipes/tools/diffutils/source/po/ru.gmo new file mode 100644 index 0000000000..95e6c9fed1 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/ru.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/ru.po b/local/recipes/tools/diffutils/source/po/ru.po new file mode 100644 index 0000000000..35d1ebabf0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/ru.po @@ -0,0 +1,1635 @@ +# Перевод сообщений diffutils +# Copyright (C) 1998 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# +# Oleg S. Tihonov <ost@tatnipi.ru>, 1998, 2001, 2002, 2005, 2007. +# Yuri Kozlov <yuray@komyakino.ru>, 2017. +msgid "" +msgstr "" +"Project-Id-Version: diffutils 3.5.25\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2017-05-08 11:12+0300\n" +"Last-Translator: Yuri Kozlov <yuray@komyakino.ru>\n" +"Language-Team: Russian <gnu@d07.ru>\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Lokalize 2.0\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "неверный аргумент %s для %s" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "двусмысленный аргумент %s для %s" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "Допустимые аргументы:" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "ошибка программы" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "переполнение стека" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Неизвестная системная ошибка" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "обычный пустой файл" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "обычный файл" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "каталог" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "символьная ссылка" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "очередь сообщений" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "семафор" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "разделяемый объект" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "объект типизированной памяти" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "специальный файл с поблочным доступом" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "специальный файл с посимвольным доступом" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "непрерывные данные" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "очередь" + +#: lib/file-type.c:78 +msgid "door" +msgstr "дверь" + +#: lib/file-type.c:81 +msgid "multiplexed block special file" +msgstr "мультиплексный блочный специальный файл" + +#: lib/file-type.c:84 +msgid "multiplexed character special file" +msgstr "мультиплексный символьный специальный файл" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "мультиплексный файл" + +#: lib/file-type.c:90 +msgid "named file" +msgstr "именованный файл" + +#: lib/file-type.c:93 +msgid "network special file" +msgstr "сетевой специальный файл" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "переносной файл с данными" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "переносной файл без данных" + +#: lib/file-type.c:102 +msgid "port" +msgstr "порт" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "сокет" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "замазка" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "странный файл" + +#: lib/getopt.c:278 +#, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: двусмысленный параметр «%s%s»\n" + +#: lib/getopt.c:284 +#, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: двусмысленный параметр «%s%s»; возможные варианты:" + +#: lib/getopt.c:319 +#, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: нераспознанный параметр «%s%s»\n" + +#: lib/getopt.c:345 +#, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: для параметра «%s%s» нельзя использовать аргумент\n" + +#: lib/getopt.c:360 +#, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: для параметра «%s%s» требуется аргумент\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: недопустимый параметр — «%c»\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: для параметра требуется аргумент — «%c»\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "?" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "?" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Выполнено успешно" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Совпадений нет" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Неверное регулярное выражение" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Недопустимый для сортировки символ" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Неверное имя класса символа" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Обратная косая черта стоит последней" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Неверная ссылка" + +#: lib/regcomp.c:156 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Непарная [, [^, [:, [. или [=" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Непарная ( или \\(" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Непарная \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Неверное содержимое \\{\\}" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Неверный нижний предел" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Оперативная память исчерпана" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Неверное предшествующее регулярное выражение" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Преждевременный конец регулярного выражения" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Регулярное выражение слишком велико" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Непарная ) или \\)" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Регулярное выражение не было задано раньше" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "память исчерпана" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "стандартный ввод" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "стандартный вывод" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "стандартный поток ошибок" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "неизвестный поток" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "не удалось повторно открыть %s в режиме %s" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "неверный аргумент %s%s в ?%s?" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "неверный суффикс в %s%s аргументе ?%s?" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "аргумент %s%s слишком велик для ?%s?" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Упакован %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Упакован %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Лицензия GPLv3+: GNU GPL версии 3 или новее <http://gnu.org/licenses/gpl." +"html>\n" +"Это свободное ПО: вы можете продавать и распространять его.\n" +"Нет НИКАКИХ ГАРАНТИЙ до степени, разрешённой законом.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Автор программы ? %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Авторы программы ? %s и %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Авторы программы ? %s, %s и %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Авторы программы ? %s, %s, %s\n" +"и %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Авторы программы ? %s, %s, %s,\n" +"%s и %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Авторы программы ? %s, %s, %s,\n" +"%s, %s и %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Авторы программы ? %s, %s, %s,\n" +"%s, %s, %s и %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Авторы программы ? %s, %s, %s,\n" +"%s, %s, %s, %s\n" +"и %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Авторы программы ? %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s и %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Авторы программы ? %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s и другие.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Об ошибках сообщайте по адресу <%s>\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Об ошибках в %s сообщайте по адресу %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Домашняя страница %s: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "Домашняя страница %s: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "Справка по работе с программами GNU: <http://www.gnu.org/gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Файлы %s и %s различаются\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Двоичные файлы %s и %s различаются\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "В конце файла нет новой строки" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Торбьёрн Гронлунд (Torbjorn Granlund)" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "Дэвид Маккензи (David MacKenzie)" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "По команде ?%s --help? можно получить дополнительную информацию." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "недопустимое для --ignore-initial значение ?%s?" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "ключи -l и -s несовместимы" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "ошибка при записи" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "стандартный вывод" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b, --print-bytes выводить различающиеся байты" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "-i, --ignore-initial=Н пропустить первые Н байт ввода" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=Н1:Н2\n" +" пропустить первые Н1 байт файла ФАЙЛ1\n" +" и первые Н2 байт файла ФАЙЛ2" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l, --verbose выводить номера и значения всех различающихся байт" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=Н сравнивать не более Н байт" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent не показывать обычные сообщения" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help показать эту справку и выйти" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v, --version показать информацию о версии и выйти" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Использование: %s [КЛЮЧ]? ФАЙЛ1 [ФАЙЛ2 [Н1 [Н2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Побайтово сравнивает два файла." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"Необязательные Н1 и Н2 ? это число байт, которые следует пропустить\n" +"в каждом файле (по умолчанию 0)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Аргументы, обязательные для длинных параметров, обязательны и для коротких.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"К значениям Н можно приписывать один из следующих множительных суффиксов:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, и так далее для T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Если ФАЙЛ не задан или задан как ?-?, то читается стандартный ввод." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"Выходной статус равен 0, если входные файлы идентичны, 1 ? если\n" +"различаются, и 2 в случае неполадок." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "недопустимое значение --bytes ?%s?" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "пропущен операнд после ?%s?" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "лишний операнд ?%s?" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s различаются: байт %s, строка %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s различаются: байт %s, строка %s равен %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: EOF в %s, который пуст\n" + +#: src/cmp.c:585 +#, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "cmp: EOF в %s после байта %s, строка %s\n" + +#: src/cmp.c:586 +#, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "cmp: EOF в %s после байта %s в строке %s\n" + +#: src/cmp.c:592 +#, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: EOF в %s после байта %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Поль Эггерт (Paul Eggert)" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Майк Гертель (Mike Haertel)" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "Дэвид Хейз (David Hayes)" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Ричард Столлман (Richard Stallman)" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Лен Тауэр (Len Tower)" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "недопустимая длина контекста ?%s?" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "разбиение на страницы не поддерживается на данной машине" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "слишком много ключей задающих метки файлов" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "недопустимая ширина ?%s?" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "противоречивые ключи задания ширины" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "недопустимая длина горизонта ?%s?" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "недопустимая ширина табуляции ?%s?" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "противоречивые ключи задания ширины табуляции" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "необходимо задать как --from-file, так и --to-file" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr " --normal выводить в обычном формате diff (по умолчанию)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "-q, --brief напечатать только различаются ли файлы" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "" +"-s, --report-identical-files\n" +" сообщать об одинаковых файлах" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C Н, --context[=Н] выводить по Н (по умолчанию 3) строк\n" +" копируемого контекста" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U Н, --unified[=Н] выводить по Н (по умолчанию 3) строк\n" +" объединенного контекста" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed выводить как сценарий ed" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n, --rcs выводить в формате RCS diff" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side выводить в две колонки" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=Н выводить не более Н знаков в строке\n" +" (по умолчанию 130)" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr " --left-column выводить только левую колонку общих строк" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr "" +" --suppress-common-lines\n" +" не выводить общие строки" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" +"-p, --show-c-function отображать в какой функции Си находится\n" +" каждое изменение" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" +"-F, --show-function-line=RE\n" +" отображать последнюю совпавшую с RE строку" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label МЕТКА использовать МЕТКУ вместо имени файла и времени\n" +" (может повторяться)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs раскрывать при выводе символы табуляции в пробелы" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab выравнивать строки, добавляя в начало символ " +"табуляции" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=Н табуляция через каждые Н знаков (по умолчанию 8)" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty\n" +" не вставлять пробел или табуляцию перед\n" +" выводом пустых строк" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "-l, --paginate направить вывод в pr для разбиения на страницы" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "-r, --recursive рекурсивно сравнивать подкаталоги" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference не переходить по символьным ссылкам" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "-N, --new-file воспринимать несуществующие файлы как пустые" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +" --unidirectional-new-file\n" +" воспринимать несуществующие первые файлы как пустые" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case\n" +" игнорировать регистр в именах файлов" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case\n" +" учитывать регистр в именах файлов" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "" +"-x, --exclude=ОБРАЗЕЦ исключить файлы, чьи имена совпадают с ОБРАЗЦОМ" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=ФАЙЛ исключить файлы с именами, совпадающими\n" +" с любым образцом из ФАЙЛА" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=ФАЙЛ\n" +" при сравнении каталогов начать с ФАЙЛА" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=ФАЙЛ1 сравнить ФАЙЛ1 со всеми операндами;\n" +" ФАЙЛ1 может быть каталогом" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=ФАЙЛ2 сравнить все операнды с ФАЙЛОМ2;\n" +" ФАЙЛ2 может быть каталогом" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "-i, --ignore-case игнорировать регистр в содержимом файла" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion\n" +" игнорировать изменения, вызванные раскрытием " +"табуляции" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" +"-Z, --ignore-trailing-space\n" +" игнорировать пробельные символы в конце строки" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change\n" +" игнорировать изменения количества пробельных символов" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space игнорировать все пробельные символы" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B, --ignore-blank-lines\n" +" игнорировать изменения количества пустых строк" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE\n" +" игнорировать изменения строк, совпадающих с RE" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text считать все файлы текстовыми" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr удалять из ввода завершающий возврат каретки" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr " --binary читать и записывать файлы в двоичном режиме" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=ИМЯ выводить заплаты, использующие конструкцию ?#ifdef " +"ИМЯ?" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +" --GTYPE-group-format=GFMT\n" +" форматировать входные группы типа GTYPE\n" +" в соответствии GFMT" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "" +" --line-format=LFMT форматировать все входные строки в соответствии с " +"LFMT" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +" --LTYPE-line-format=LFMT\n" +" форматировать входные строки типа LTYPE\n" +" в соответствии LFMT" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +"Параметры форматирования предоставляют точный контроль над конечным diff\n" +"обобщающими -D/--ifdef." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE может быть ?old?, ?new? или ?unchanged?.\n" +" Значение GTYPE те же или ?changed?." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT может содержать (только):\n" +" %< строки из ФАЙЛА1\n" +" %> строки из ФАЙЛА2\n" +" %= строки, общие для ФАЙЛА1 и ФАЙЛА2\n" +" %[-][ШИРИНА][.[ТОЧН]]{doxX}БУКВА формат для БУКВЫ в стиле printf\n" +" БУКВА принимает следующие значения для новых групп, для старых " +"строчные:\n" +" F номер первой строки\n" +" L номер последней строки\n" +" N число строк = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) если A равно B, то T, иначе E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT может содержать (только):\n" +" %L содержимое строки\n" +" %l содержимое строки, исключая все конечные символы новой строки\n" +" %[-][ШИРИНА][.[ТОЧН]]{doxX}n формат номера входной строки в стиле printf" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" GFMT и LFMT могут содержать:\n" +" %% %\n" +" %c'С' один символ С\n" +" %c'\\OOO' символ в восьмеричным коде OOO\n" +" C символ C (символы, представляющие сами себя)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal пытаться найти наименьший набор изменений" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +" --horizon-lines=Н оставлять Н общих строк до и после различающихся" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files предполагать, что файлы большие и есть много\n" +" разбросанных мелких изменений" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" +" --color[=КОГДА] вывод в цвете; КОГДА может быть «never», «always»\n" +" или «auto» (по умолчанию)" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" +" --palette=ПАЛИТРА набор цветов при активном --color; ПАЛИТРА это\n" +" список свойств terminfo через двоеточие" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help показать эту справку и выйти" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version показать информацию о версии и выйти" + +#: src/diff.c:982 +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"ФАЙЛЫ это ?ФАЙЛ1 ФАЙЛ2?, ?КАТАЛОГ1 КАТАЛОГ2?, ?КАТАЛОГ ФАЙЛ??\n" +"или ?ФАЙЛ? КАТАЛОГ?." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "Если задан --from-file или --to-file, то на ФАЙЛЫ нет ограничений." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Если ФАЙЛ задан как ?-?, читает стандартный ввод." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Использование: %s [КЛЮЧ]? ФАЙЛЫ\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Построчно сравнивает ФАЙЛЫ." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "противоречивое значение %s для ключа ?%s?" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "противоречивые ключи задания стиля вывода" + +#: src/diff.c:1058 +#, c-format +msgid "invalid color '%s'" +msgstr "неправильное указание цвета ?%s?" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Только в %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "невозможно сравнить ?-? с каталогом" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "ключ -D не поддерживается для каталогов" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Общие подкаталоги: %s и %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Файл %s это %s, тогда как файл %s ? %s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Символические ссылки %s и %s различаются\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Файлы %s и %s идентичны\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Рэнди Смит (Randy Smith)" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "несовместимые ключи" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "?-? задан для более одного входного файла" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "ошибка чтения" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A, --show-all выводить все изменения, заключая конфликтные\n" +" места в скобки" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed вывести сценарий ed, изменяющий\n" +" СТАРЫЙ_ФАЙЛ из ВАШ_ФАЙЛ, в МОЙ_ФАЙЛ" + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "-E, --show-overlap как -e плюс конфликты в скобках" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "-3, --easy-only как -e, но только непересекающиеся изменения" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "-x, --overlap-only как -e, но только перекрывающиеся изменения" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "-X как -x плюс конфликты в скобках" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "-i добавить команды ?w? и ?q? в сценарий ed" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge выводить объединенный файл согласно\n" +" -A, если не указаны другие параметры" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text считать все файлы текстовыми" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr удалять из ввода завершающий возврат каретки" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab выравнивать строки, добавляя в начало символ " +"табуляции" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=ПРОГРАММА\n" +" для сравнения файлов использовать ПРОГРАММУ" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=МЕТКА использовать МЕТКУ вместо имени файла\n" +" (может повторяться до трёх раз)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help показать эту справку и выйти" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version показать информацию о версии и выйти" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Использование: %s [КЛЮЧ]? МОЙ_ФАЙЛ СТАРЫЙ_ФАЙЛ ВАШ_ФАЙЛ\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Построчно сравнивает три файла." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"По умолчанию формат вывода представляет изменения для чтения человеком.\n" +"\n" +"Параметры -e, -E, -x, -X (и их длинные аналоги) включают\n" +"вывод в виде сценария ed вместо формата по умолчанию.\n" +"\n" +"Параметр -m (--merge) заставляет diff3 выполнять внутреннее слияние\n" +"и выводить уже объединённый файл. Для необычного ввода это более\n" +"разумно, чем использование ed.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"Выходной статус равен 0 в случае успеха, 1 в случае конфликтов и 2 в\n" +"случае неполадок." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "внутренняя ошибка: поврежденный формат блоков заплаты" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: ошибка при поиске различий: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "внутренняя ошибка: неверный тип заплаты в функции process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "неверный формат заплаты; неверный разделитель изменения" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "неверный формат заплаты; неполная последняя строка" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "не удалось запустить вспомогательную программу ?%s?" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "неверный формат заплаты; неправильные первые символы строки" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "внутренняя ошибка: на выход передан неверный тип заплаты" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "входной файл уменьшился" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "невозможно сравнить имена файлов ?%s? и ?%s?" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: каталоги зациклены" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Томас Лорд (Thomas Lord)" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "-o, --output=ФАЙЛ работать интерактивно, записывая вывод в ФАЙЛ" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i, --ignore-case игнорировать регистр символов" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion\n" +" игнорировать изменения, вызванные раскрытием " +"табуляции" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" +"-Z, --ignore-trailing-space\n" +" игнорировать пробельные символы в конце строки" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change\n" +" игнорировать изменения количества пробельных символов" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space игнорировать все пробельные символы" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" +"-B, --ignore-blank-lines\n" +" игнорировать изменения количества пустых строк" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE\n" +" игнорировать изменения строк, совпадающих с RE" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr удалять из ввода завершающий возврат каретки" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a, --text считать все файлы текстовыми" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=Н выводить не более Н знаков в строке\n" +" (по умолчанию 130)" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "--left-column выводить только левую колонку общих строк" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "" +"--suppress-common-lines\n" +" не выводить общие строки" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs раскрывать при выводе символы табуляции в пробелы" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +" --tabsize=Н табуляция через каждые Н знаков (по умолчанию 8)" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal пытаться найти наименьший набор изменений" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files предполагать, что файлы большие и есть много\n" +" разбросанных мелких изменений" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=ПРОГРАММА\n" +" для сравнения файлов использовать ПРОГРАММУ" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help показать эту справку и выйти" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v, --version показать информацию о версии и выйти" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Использование: %s [КЛЮЧ]? ФАЙЛ1 ФАЙЛ2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Интерактивно объединяет различия между ФАЙЛОМ1 и ФАЙЛОМ2." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "невозможно интерактивно объединить стандартный ввод" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "оба сравниваемых файла ? каталоги" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tРедактировать и использовать обе версии, включив в каждую заголовок.\n" +"eb:\tРедактировать и использовать обе версии.\n" +"el или e1:\tРедактировать и использовать левую версию.\n" +"er или e2:\tРедактировать и использовать правую версию.\n" +"e:\tОтбросить обе и редактировать новую версию.\n" +"l или 1:\tИспользовать левую версию.\n" +"r или 2:\tИспользовать правую версию.\n" +"s:\tВключать общие строки, не выдавая сообщения.\n" +"v:\tВключать общие строки, выдавая сообщение.\n" +"q:\tВыйти.\n" + +#: src/util.c:662 +#, c-format +msgid "unrecognized prefix: %s" +msgstr "неизвестный префикс: %s" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "невозможно разобрать значение --palette" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: у параметра ?--%s? не может быть аргумента\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: нераспознанный параметр ?--%s?\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: двусмысленный параметр ?-W %s?\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: у параметра ?-W %s? не может быть аргумента\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: для параметра ?-W %s? требуется аргумент\n" + +#~ msgid " or 'auto' (the default)" +#~ msgstr " или ?auto? (по умолчанию)" + +#~ msgid "" +#~ " --palette=PALETTE specify the colors to use when --color is active" +#~ msgstr " --palette=ПАЛИТРА задать набор цветов при активном --color" + +#~ msgid "%s: illegal option -- %c\n" +#~ msgstr "%s: недопустимый ключ -- %c\n" + +#~ msgid "" +#~ "This is free software; see the source for copying conditions. There is " +#~ "NO\n" +#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR " +#~ "PURPOSE.\n" +#~ msgstr "" +#~ "Это свободная программа; подробности об условиях распространения\n" +#~ "смотрите в исходном тексте. Мы НЕ предоставляем гарантий; даже гарантий\n" +#~ "КОММЕРЧЕСКОЙ ПРИГОДНОСТИ или ПРИГОДНОСТИ ДЛЯ КАКОЙ-ЛИБО ЦЕЛИ.\n" + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i Н1:Н2 --ignore-initial=Н1:Н2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "" +#~ "-s --quiet --silent Не выводить, только сообщить возвращаемое значение." + +#~ msgid "--help Output this help." +#~ msgstr "--help Показать эту справку и выйти." + +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>." +#~ msgstr "Об ошибках сообщайте <bug-gnu-utils@gnu.org>." + +#~ msgid "`-%ld' option is obsolete; use `-%c %ld'" +#~ msgstr "ключ `-%ld' устарел; используйте `-%c %ld'" + +#~ msgid "`-%ld' option is obsolete; omit it" +#~ msgstr "ключ `-%ld' устарел; опускайте его" + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ "-c -C ЧИСЛО --context[=ЧИСЛО] Копировать ЧИСЛО (по умолчанию 3) строк " +#~ "контекста.\n" +#~ "-u -U ЧИСЛО --unified[=ЧИСЛО] Выводить ЧИСЛО (по умолчанию 3) строк\n" +#~ " объединенного контекста.\n" +#~ " -L МЕТКА --label МЕТКА Использовать МЕТКУ вместо имени файла.\n" +#~ " -p --show-c-function Показывать C-функцию, содержащую изменение.\n" +#~ " -F РВ --show-function-line=РВ Показывать предшествующую строку, " +#~ "совпадающую\n" +#~ " с заданным регулярным выражением." + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ "-y --side-by-side Выводить в две колонки.\n" +#~ " -W ЧИСЛО --width=ЧИСЛО Выводить максимум заданное ЧИСЛО знаков в " +#~ "строке.\n" +#~ " (по умолчанию 130)\n" +#~ " --left-column Выводить только левую колонку общих строк.\n" +#~ " --suppress-common-lines Не выводить общие строки." + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "" +#~ "--speed-large-files Предполагать, что файлы большие со многими\n" +#~ " разбросанными мелкими изменениями." + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "-X Выводить пересекающиеся изменения, заключая их в скобки." + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "" +#~ "-m --merge Выводить объединенный файл вместо сценария ed (по умолчанию -" +#~ "A)." + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "-L МЕТКА --label=МЕТКА Использовать МЕТКУ вместо имени файла." + +#~ msgid "subsidiary program `%s' not found" +#~ msgstr "не найдена вспомогательная программа `%s'" + +#~ msgid "subsidiary program `%s' failed" +#~ msgstr "дочерняя программа `%s' завершилась ошибкой" + +#~ msgid "subsidiary program `%s' failed (exit status %d)" +#~ msgstr "" +#~ "вспомогательная программа `%s' завершилась неуспешно (выходной статус %d) " diff --git a/local/recipes/tools/diffutils/source/po/sr.gmo b/local/recipes/tools/diffutils/source/po/sr.gmo new file mode 100644 index 0000000000..2a52548684 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/sr.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/sr.po b/local/recipes/tools/diffutils/source/po/sr.po new file mode 100644 index 0000000000..025915db26 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/sr.po @@ -0,0 +1,1506 @@ +# Serbian translation of `diffutils'. +# Copyright © 2004 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Aleksandar Jelenak <jelenak@netlinkplus.net>, 2004. +# Мирослав Николић <miroslavnikolic@rocketmail.com>, 2013—2017. +msgid "" +msgstr "" +"Project-Id-Version: diffutils 3.5.14\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2017-02-05 14:48+0200\n" +"Last-Translator: Мирослав Николић <miroslavnikolic@rocketmail.com>\n" +"Language-Team: Serbian <(nothing)>\n" +"Language: sr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "неисправан аргумент „%s“ за „%s“" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "нејасан аргумент „%s“ за „%s“" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "Исправни аргументи су:" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "грешка програма" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "стек препуњен" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Непозната системска грешка" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "обична празна датотека" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "обична датотека" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "директоријум" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "симболичка веза" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "ред порука" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "семафор" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "заједнички меморијски објекат" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "типски меморијски објекат" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "датотека блоковског уређаја" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "датотека знаковног уређаја" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "непрекидни подаци" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "пупи" + +#: lib/file-type.c:78 +msgid "door" +msgstr "врата" + +#: lib/file-type.c:81 +msgid "multiplexed block special file" +msgstr "мултиплексирана датотека блоковског уређаја" + +#: lib/file-type.c:84 +msgid "multiplexed character special file" +msgstr "мултиплексирана датотека знаковног уређаја" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "мултиплексирана датотека" + +#: lib/file-type.c:90 +msgid "named file" +msgstr "именована датотека" + +#: lib/file-type.c:93 +msgid "network special file" +msgstr "датотека мрежног уређаја" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "пресељена датотека са подацима" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "пресељена датотека без података" + +#: lib/file-type.c:102 +msgid "port" +msgstr "прикључник" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "прикључница" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "празност" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "чудна датотека" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: опција „%s“ је нејасна\n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: опција „%s“ је нејасна; могућности:" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: непозната опција „%c%s“\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: опција „%c%s“ не дозвољава аргумент\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: опција „%s“ захтева аргумент\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: неисправна опција -- „%c“\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: опција захтева аргумент -- „%c“\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "„" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "“" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Успешно" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Нема поклапања" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Неисправан регуларни израз" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Неисправан знак слагања" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Неправилан назив разреда знака" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Пратећа обрнута коса црта" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Неисправна повратна упута" + +#: lib/regcomp.c:156 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Неупарено [, [^, [:, [., или [=" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Неупарено ( или \\(" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Неупарено \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Неисправан садржај у \\{\\}" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Неисправан крај опсега" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Меморија је исцрпљена" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Неисправан претходећи регуларни израз" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Преран завршетак регуларног израза" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Регуларан израз је исувише велики" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Неупарено ) или \\)" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Нема претходног регуларног израза" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "меморија је исцрпљена" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "стдулаз" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "стдизлаз" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "стдгрешка" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "непознат ток" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "нисам успео да поново отворим „%s“ са режимом %s" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "неисправан %s%s аргумент „%s“" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "неисправан суфикс у %s%s аргументу „%s“" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "%s%s аргумент „%s“ је превелик" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Запаковао је %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Запаковао је %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Дозвола ОЈЛв3+: Гнуова ОЈЛ издање 3 или касније <http://gnu.org/licenses/gpl." +"html>.\n" +"Ово је слободан софтвер: слободни сте да га мењате и расподељујете.\n" +"Нема НИКАКВЕ ГАРАНЦИЈЕ, у обиму допуштеном законом.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Написао: %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Написали: %s и %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Написали: %s, %s и %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Написали: %s, %s, %s,\n" +"и %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Написали: %s, %s, %s,\n" +"%s, и %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Написали: %s, %s, %s,\n" +"%s, %s, и %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Написали: %s, %s, %s,\n" +"%s, %s, %s, и %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Написали: %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"и %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Написали: %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, и %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Написали: %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, и други.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Грешке пријавите на: %s\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Грешке програма „%s“ пријавите на: %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s матична страница: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "%s матична страница: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "Општа помоћ користећи ГНУ софтвер: <http://www.gnu.org/gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Датотеке „%s“ и „%s“ су различите\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Бинарне датотеке %s и %s различите\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Без новог реда на крају датотеке" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Торбјорн Гранлунд" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "Дејвид Мек Кензи" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Покушајте „%s --help“ за више информација." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "неисправна „--ignore-initial“ вредност „%s“" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "опције -l и -s не иду заједно" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "записивање није успело" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "стандардни излаз" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "" +"-b --print-bytes исписује бајтове који се разликују." + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i БРОЈ --ignore-initial=БРОЈ изоставља првих БРОЈ бајтова улаза." + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +" изоставља првих БРОЈ1 бајтова ДАТОТЕКЕ1 и првих БРОЈ2 бајтова ДАТОТЕКЕ2." + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l --verbose исписује редни број и вредност бајтова " +"који се разликују." + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "" +"-n ОГРАНИЧЕЊЕ --bytes=ОГРАНИЧЕЊЕ пореди до највише ОГРАНИЧЕЊЕ бајтова." + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent потискује све обичне излазе" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help приказује ову помоћ и излази" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v --version исписује податке о издању." + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Употреба: %s [ОПЦИЈА]... ДАТОТЕКА1 [ДАТОТЕКА2 [БРОЈ1 [БРОЈ2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Поредите две датотеке бајт по бајт." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"Изборни БРОЈ1 и БРОЈ2 су бројеви бајтова за изостављање на почетку\n" +"сваке датотеке (подразумева се нула)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Обавезни аргументи за дуге опције су обавезни и за кратке опције такође.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"Уз БРОЈ могу ићи и следећи умножавајући суфикси:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576, GB 1,000,000,000, G " +"1,073,741,824,\n" +"итд. за T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Чита стандардни улаз ако ДАТОТЕКА недостаје или је „-“." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "Излазно стање је 0 ако су улази исти, 1 за различите, 2 за грешку." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "неисправна --bytes вредност „%s“" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "недостаје оператор после „%s“" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "вишак оператор „%s“" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s се разликују: бајт %s, ред %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s се разликују: бајт %s, ред %s је %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: крај датотеке на %s\n" + +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s %s се разликују: бајт %s, ред %s\n" + +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s %s се разликују: бајт %s, ред %s\n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: крај датотеке на %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Пол Егерт" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Мајк Хартел" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "Дејвид Хејес" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Ричард Столман" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Лен Тауер" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "неисправна дужина склопа „%s“" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "прелом страна није подржан на овом рачунару" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "исувише опција за ознаку датотеке" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "неисправна дужина „%s“" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "сукобљене опције ширине" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "неисправна дужина видокруга „%s“" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "неисправна величина табулатора „%s“" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "сукобљене опције величине табулатора" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "„--from-file“ и „--to-file“ су наведени оба" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr " --normal исписује обичне разлике (основно)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "-q --brief исписује само када се датотеке разликују" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s --report-identical-files извештава када су две датотеке исте" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C БРОЈ, --context[=БРОЈ] исписује БРОЈ (почетно 3) редова умноженог " +"склопа" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-w БРОЈ --width=БРОЈ исписује БРОЈ (почетно 3) редова обједињеног " +"склопа" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e --ed исписује ед спис" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n --rcs исписује РЦС запис разлика" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side исписује у две колоне" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w БРЈ --width=БРЈ исписује на највише БРЈ (почетно 130) колона" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +"-l --left-column исписује само леву колону заједничких редова" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines не приказује заједничке редове" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" +"-p, --show-c-function приказује у којој Ц функцији је свака промена" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" +"-F, --show-function-line=РИ приказује најскорији ред који одговара РИ" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label ОЗНАКА користи ОЗНАКУ уместо назива датотеке и " +"временске ознаке\n" +" (може да се понавља)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t --expand-tabs развија табулаторе у размаке за излаз" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T --initial-tab поравнава табулаторе додајући један табулатор." + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +"--tabsize=БРЈ величина табулатора је БРЈ (почетно 8) колона" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +"--suppress-blank-empty потискује размак или табулатор пре празних " +"редова излаза" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "-l --paginate пропушта излаз кроз „pr“ за прелом" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r --recursive дубински упоређује све пронађене " +"поддиректоријуме" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference не прати симболичке везе" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "-N --new-file сматра празним недостајуће датотеке" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +" --unidirectional-new-file сматра празним прве недостајуће датотеке" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case занемарује словну величину поређујући назива " +"датотека" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case урачунава словну величину поређујући називе " +"датотека" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "-x, --exclude=ОБР искључује датотеке које поклапају ОБР" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=ТЕКА искључује датотеке које поклапа било који " +"образац у ТЕКА" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=ТЕКА почиње од ТЕКА при поређењу директоријума" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=ТЕКА1 упоређује ТЕКУ1 са свим оперантима. ТЕКА1 " +"може бити директоријум" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=ТЕКА2 упоређује све операнте са ТЕКОМ2. ТЕКА2 може " +"бити директоријум" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i --ignore-case занемарује словну величину у склопу датотека" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E --ignore-tab-expansion занемарује промене услед развијања табулатора" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space занемарује размак на крају реда" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b --ignore-space-change занемарује промене због количине празног " +"простора" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w --ignore-all-space занемарује све празне просторе" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B --ignore-blank-lines занемарује промене услед празних редова" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=РИ занемарује промене чији редови поклапају РИ" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a --text сматра све датотеке као текст" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr огољава пратеће <CR> на улазу" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr " --binary чита и пише податке у бинарном режиму" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=НАЗИВ исписује стопљену датотеку да прикаже " +"„#ifdef НАЗИВ“ разлике" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr " --GTYPE-group-format=ГОБЛ обликује GTYPE улазне групе са ГОБЛ" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr " --line-format=РОБЛ обликује све улазне редове са РОБЛ" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr " --LTYPE-line-format=РОБЛ обликује LTYPE улазне редове са РОБЛ" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" Ове опције записа обезбеђује фино подешено управљање преко излаза\n" +" различника, генерализујући -D/--ifdef." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE је „old“, „new“, или „unchanged“. GTYPE је LTYPE или „changed“." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" ГОБЛ (само) може садржати:\n" +" %< редове из ДАТОТЕКЕ1\n" +" %> редове из ДАТОТЕКЕ2\n" +" %= редове заједничке у ДАТОТЕЦИ1 и ДАТОТЕЦИ2\n" +" %[-][ШИРН][.[ТАЧН]]{doxX}СЛОВО printf-стил за СЛОВО\n" +" СЛОВО за нову групу, мала слова за стару групу:\n" +" F број првог реда\n" +" L број последњег реда\n" +" N број редова = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) ако је А исто као Б онда Т супротно Е" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" РОБЛ (само) може садржати:\n" +" %L садржај реда\n" +" %l садржај реда, изузев пратећих знакова за нови ред\n" +" %[-][ШИРН][.[ТАЧН]]{doxX}n printf-стил за улазни број реда" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" Било ГОБЛ или РОБЛ могу садржати:\n" +" %% %\n" +" %c'З' само један знак „З“\n" +" %c'\\OOO' знак са окталним кодом OOO\n" +" З знак З (други знаци представљају сами себе)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d --minimal труди се да нађе мањи скуп промена" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +" --horizon-lines=БРЈ чува БРЈ редова заједничког префикса и суфикса" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files за велике датотеке са много раштрканих малих измена" + +#: src/diff.c:974 +#, fuzzy +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" +" --color[=КАДА] обојава излаз; КАДА може бити „never“ (никада), " +"„always“ (увек)," + +#: src/diff.c:976 +#, fuzzy +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" +" ПАЛЕТА је списак могућности података термина " +"раздвојен двотачком" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help приказује ову помоћ и излази" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v --version исписује податке о издању" + +#: src/diff.c:982 +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"ДАТОТЕКЕ су „ТЕКА1 ТЕКА2“ или „ДИР1 ДИР2“ или „ДИР ТЕКА“ или „ТЕКА ДИР“." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Нема ограничења за ДАТОТЕКЕ ако је задато „--from-file“ или „--to-file“." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Ако је ДАТОТЕКА „-“, чита стандардни улаз." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Употреба: %s [ОПЦИЈА]... ДАТОТЕКЕ\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Поредите ДАТОТЕКЕ ред по ред." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "сукоб вредности „%s“ опције „%s“" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "сукобљене опције излазног стила" + +#: src/diff.c:1058 +#, c-format +msgid "invalid color '%s'" +msgstr "неисправна боја „%s“" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Само у %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "не могу поредити „-“ са директоријумом" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "опција „-D“ није подржана за директоријуме" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Заједнички поддиректоријуми: %s и %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Датотека „%s“ је „%s“ док је датотека „%s“ „%s“\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Симболичке везе „%s“ и „%s“ су различите\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Датотеке „%s“ и „%s“ се истоветне\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Ренди Смит" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "несагласне опције" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "„-“ је наведено за више од једне улазне датотеке" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "читање није успело" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A --show-all исписује све промене, означавајући сукобе " +"заградама" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e --ed исписује неспојене промене између СТАРАТЕКА и " +"ТВОЈАТЕКА у МОЈАТЕКА" + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "-E --show-overlap као -e, означавајући сукобе заградама" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3 --easy-only као -e, али обједињује непреклопљене промене" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "-x, --overlap-only као -e, али обједињује преклопљене промене" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "-X као -x, означавајући сукобе заградама" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "-i придодаје „w“ и „q“ наредбе ед списима" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge исписује тренутну стопљену датотеку, у складу\n" +" са -A ако нису дате друге опције" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a --text сматра све датотеке као текст" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr огољава пратеће <CR> на улазу" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T --initial-tab поравнава табулаторе додајући један табулатор" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=ПРОГРАМ користи ПРОГРАМ за поређење датотека" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=ОЗНАКА користи ОЗНАКУ уместо назива датотеке\n" +" (може да се понови до три пута)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help приказује ову помоћ и излази" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version исписује податке о издању и излази" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Употреба: %s [ОПЦИЈА]... МОЈАТЕКА СТАРАТЕКА ТВОЈАТЕКА\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Поредите три датотеке ред по ред." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"Основни запис излаза је некако људима разумљиво представљање промена.\n" +"\n" +"Опције „-e, -E, -x, -X“ (и одговарајуће дуге) доводе до тога да ед спис\n" +"буде излаз уместо подразумеваног.\n" +"\n" +"На крају, опција „-m“ (--merge) доводи до тога да „diff3“ изнутра стопи\n" +"и да испише тренутно стопљену датотеку. За необичан улаз, ово је много\n" +"рогпадније него употреба еда.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "Излазно стање је 0 за успех, 1 за сукобе, 2 за грешку." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "унутрашња грешка: зез у запису блокова разлика" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: разлике нису успеле: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "унутрашња грешка: неисправна врста разлика у „process_diff“" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "неисправан запис разлика; неисправан раздвојник измена" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "неисправан облик разлика; непотпун задњи ред" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "помоћни програм „%s“ не може бити покренут" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "неисправан запис разлика; нетачни водећи знакови реда" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "унутрашња грешка: неисправна врста разлика прослеђена излазу" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "улазна датотека се скупила" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "не могу поредити називе датотека „%s“ и „%s“" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: дубинска петља кроз директоријуме" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Томас Лорд" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "-o, --output=ТЕКА ради међудејствено, шаљући излаз у ТЕКА" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i --ignore-case сматра истим велика и мала слова" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E --ignore-tab-expansion занемарује промене услед развијања табулатора" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space занемарује размак на крају реда" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b --ignore-space-change занемарује промене због количине празног " +"простора" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W --ignore-all-space занемарује све размаке" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "-B --ignore-blank-lines занемарује промене услед празних редова" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=РИ занемарује промене чији редови поклапају РИ" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr огољава пратеће <CR> на улазу" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a --text сматра све датотеке као текст" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=БРОЈ исписује на највише БРОЈ (почетно 130) колона" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" +"-l --left-column исписује само леву колону заједничких редова" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines не приказује заједничке редове" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t --expand-tabs развија табулаторе у размаке за излаз" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +" --tabsize=БРОЈ величина табулатора је БРОЈ (почетно 8) колона" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d --minimal труди се да нађе мањи скуп промена" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H --speed-large-files за велике датотеке са много раштрканих малих " +"измена" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=ПРОГРАМ користи ПРОГРАМ за поређење датотека" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help приказује ову помоћ и излази" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v --version исписује податке о издању" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Употреба: %s [ОПЦИЈА]... ДАТОТЕКА1 ДАТОТЕКА2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Упоредно стапање разлика између ДАТОТЕКЕ1 и ДАТОТЕКЕ2." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "не могу интерактивно уклопити стандардни улаз" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "обе датотеке за поређење су директоријуми" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed: Уређује па користи оба издања, свако украшено заглављем.\n" +"eb:\t Уређије па користи оба издања.\n" +"el или e1: Уређује па користи издање лево.\n" +"er или e2: Уређује па користи издање десно.\n" +"e: Уређује ново издање.\n" +"l: Користи издање лево.\n" +"r: Користи издање десно.\n" +"s: Умеће заједничке редове тихо.\n" +"v: Умеће заједничке редове бучно.\n" +"q: Завршава.\n" + +#: src/util.c:662 +#, c-format +msgid "unrecognized prefix: %s" +msgstr "непознат префикс: %s" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "необрадива вредност за „--palette“" + +#~ msgid " or 'auto' (the default)" +#~ msgstr " или „auto“ (подразумевано)" + +#~ msgid "" +#~ " --palette=PALETTE specify the colors to use when --color is active" +#~ msgstr "" +#~ " --palette=ПАЛЕТА наводи боје за коришћење када је активно „--" +#~ "color“" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: опција „--%s“ не дозвољава аргумент\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: непозната опција „--%s“\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: опција „-W %s“ је нејасна\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: опција „-W %s“ не дозвољава аргумент\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: опција „-W %s“ захтева аргумент\n" diff --git a/local/recipes/tools/diffutils/source/po/stamp-po b/local/recipes/tools/diffutils/source/po/stamp-po new file mode 100644 index 0000000000..9788f70238 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/stamp-po @@ -0,0 +1 @@ +timestamp diff --git a/local/recipes/tools/diffutils/source/po/sv.gmo b/local/recipes/tools/diffutils/source/po/sv.gmo new file mode 100644 index 0000000000..91f744cb94 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/sv.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/sv.po b/local/recipes/tools/diffutils/source/po/sv.po new file mode 100644 index 0000000000..079d82655f --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/sv.po @@ -0,0 +1,1495 @@ +# Swedish messages for diffutils. +# Copyright © 1996, 2001, 2002, 2004, 2006, 2010, 2011, 2012, 2017 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Göran Uddeborg <goeran@uddeborg.se>, 1996, 2001, 2002, 2004, 2006, 2010, 2011, 2012, 2017. +# +# $Revision: 1.48 $ +# +msgid "" +msgstr "" +"Project-Id-Version: diffutils 3.5.25\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2017-05-13 18:08+0200\n" +"Last-Translator: Göran Uddeborg <goeran@uddeborg.se>\n" +"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n" +"Language: sv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "ogiltigt argument %s till %s" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "tvetydigt argument %s till %s" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "Giltiga argument är:" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "programfel" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "stackspill" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Okänt systemfel" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "en tom normal fil" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "en normal fil" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "en katalog" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "en symbolisk länk" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "en meddelandekö" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "en semafor" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "ett objekt av delat minne" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "ett objekt av typat minne" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "en blockspecialfil" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "en teckenspecialfil" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "sammanhängande data" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "en fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "en dörr" + +#: lib/file-type.c:81 +msgid "multiplexed block special file" +msgstr "en multiplexad blockspecialfil" + +#: lib/file-type.c:84 +msgid "multiplexed character special file" +msgstr "en multiplexad teckenspecialfil" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "en multiplexad fil" + +#: lib/file-type.c:90 +msgid "named file" +msgstr "en namngiven fil" + +#: lib/file-type.c:93 +msgid "network special file" +msgstr "en nätverksspecialfil" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "en migrerad fil med data" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "en migrerad fil utan data" + +#: lib/file-type.c:102 +msgid "port" +msgstr "en port" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "ett uttag (socket)" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "en övertäckningsfil" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "en konstig fil" + +#: lib/getopt.c:278 +#, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: flaggan ”%s%s” är tvetydig\n" + +#: lib/getopt.c:284 +#, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: flaggan ”%s%s” är tvetydig; möjligheter:" + +#: lib/getopt.c:319 +#, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: okänd flagga ”%s%s”\n" + +#: lib/getopt.c:345 +#, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: flaggan ”%s%s” tar inget argument\n" + +#: lib/getopt.c:360 +#, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: flaggan ”%s%s” behöver ett argument\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: ogiltig flagga – ”%c”\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: flaggan behöver ett argument – ”%c”\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "”" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "”" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Lyckades" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Ingen träff" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Ogiltigt reguljäruttryck" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Ogiltigt sorteringstecken" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Ogiltigt namn på teckenklass" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Avslutande omvänt snedstreck" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Ogiltig bakåtreferens" + +#: lib/regcomp.c:156 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Oparad [, [^, [:, [. eller [=" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Oparad ( eller \\(" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Oparad \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Ogiltigt innehåll i \\{\\}" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Ogiltigt intervallslut" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Minnet slut" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Föregående reguljäruttryck ogiltigt" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Förtida slut på reguljäruttryck" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "För stort reguljäruttryck" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Oparad ) eller \\)" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Inget föregående reguljäruttryck" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "minnet slut" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "standard in" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "standard ut" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "standard fel" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "okänd ström" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "kunde inte öppna om %s i läge %s" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "ogiltigt argument till %s%s ”%s”" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "ogiltigt suffix i argument till %s%s ”%s”" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "argument till %s%s ”%s” är för stort" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Paketerat av %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Paketerat av %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Licens GPLv3+: GNU GPL version 3 eller senare <http://gnu.org/licenses/gpl." +"html>.\n" +"Detta är fri programvara: du får fritt ändra och vidaredistribuera den.\n" +"Det finns INGEN GARANTI, så långt lagen tillåter.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Skrivet av %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Skrivet av %s och %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Skrivet av %s, %s och %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Skrivet av %s, %s, %s\n" +"och %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Skrivet av %s, %s, %s,\n" +"%s och %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Skrivet av %s, %s, %s,\n" +"%s, %s och %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Skrivet av %s, %s, %s,\n" +"%s, %s, %s och %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Skrivet av %s, %s, %s,\n" +"%s, %s, %s, %s\n" +"och %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Skrivet av %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s och %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Skrivet av %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s med flera.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Rapportera fel till %s\n" +"Rapportera synpunkter på översättningen till <tp-sv@listor.tp-sv.se>.\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Rapportera %s-fel till: %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s hemsida: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "%s hemsida: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"Allmän hjälp med att använda GNU-program: <http://www.gnu.org/gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Filerna %s och %s skiljer\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "De binära filerna %s och %s skiljer\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Ingen nyrad vid filslut" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjörn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Försök med ”%s --help” för mer information." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "ogiltigt --ignore-initial-värde ”%s”" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "flaggorna -l och -s är motstridiga" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "skrivning misslyckades" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "standard ut" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b --print-bytes skriv ut byte som skiljer" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i, --ignore-initial=HOPP hoppa över de första HOPP byte indata" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=HOPP1:HOPP2 hoppa över de HOPP1 första byten i FIL1 " +"och\n" +" de HOPP2 första byten i FIL2" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l, --verbose skriv ut bytenummer och värde för alla skiljande " +"byte" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=GRÄNS jämför högst GRÄNS byte" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent undertryck all normal utskrift" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help visa denna hjälp och avsluta" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v --version visa versionsinformation och avsluta" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Användning: %s [FLAGGA]... FIL1 [FIL2 [HOPP1 [HOPP2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Jämför två filer byte för byte." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"De valfria HOPP1 och HOPP2 anger antalet byte att hoppa över\n" +"i början varje fil (noll som standard)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Obligatoriska argument till långa flaggor är obligatoriska även för de " +"korta.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"HOPP-värden kan följas av följande multiplikativa suffix:\n" +"kB 1000, K 1024, MB 1 000 000, M 1 048 576\n" +"GB 1 000 000 000, G 1 073 741 824, och så vidare för T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Om FIL är ”-” eller utelämnats, läs standard in." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "Slutsstatus är 0 om indata är lika, 1 om olika, 2 vid problem." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "ogiltigt --bytes-värde ”%s”" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "saknad operand efter ”%s”" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "extra operand ”%s”" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s skiljer: byte %s, rad %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s skiljer: byte %s, rad %s är %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: EOF i %s som är tom\n" + +#: src/cmp.c:585 +#, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "cmp: EOF i %s efter byte %s, rad %s\n" + +#: src/cmp.c:586 +#, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "cmp: EOF i %s efter byte %s, på rad %s\n" + +#: src/cmp.c:592 +#, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: EOF i %s efter byte %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "ogiltig omgivningslängd ”%s”" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "sidvisning stödjs ej på denna värd" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "för många etikettflaggor" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "ogiltig bredd ”%s”" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "konflikt mellan breddflaggor" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "ogiltig horisontlängd ”%s”" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "ogiltigt tabulatorsteg ”%s”" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "konflikt mellan tabulatorflaggor" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "både --from-file och --to-file angavs" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr " --normal skriv ut en normal diff (standard)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "-q, --brief rapportera endast när filer skiljer sig" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s --report-identical-files rapportera om två filer är lika" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C ANT, --context[=ANT] skriv ANT (3 som standard) rader kopia av " +"sammanhang" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U ANT, --unified[=ANT] skriv ut ANT (3 som standard) rader med\n" +" sammanslagen omgivning" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed skriv ut ett ed-skript" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n, --rcs skriv ut skillnader i RCS-format" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side skriv ut i två kolumner" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=ANT skriv ut högst ANT (130 som standard) kolumner" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +" --left-column skriv ut endast vänstra kolumnen av gemensamma " +"rader" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines skriv inte ut gemensamma rader" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "-p, --show-c-function visa vilken C-funktion varje rad finns i" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "-F, --show-function-line=RU visa den senaste raden som matchar RU" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label ETIKETT använd ETIKETT istället för filnamn och\n" +" tidsstämpel (kan upprepas)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs expandera tabulatorer till blanksteg i utdata" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab justera tabulatorer genom att skjuta in en" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=N tabulatorstopp var N:e (8 som standard) kolumn" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty undertryck blanka eller tabulatorer före " +"tomma\n" +" utrader" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "-l, --paginate skicka utdata till ”pr” för paginering" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r, --recursive jämför underkataloger som hittas rekursivt" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference följ inte symboliska länkar" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "-N, --new-file behandla saknade filer som tomma" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr " --unidirectional-new-file behandla saknade förstafiler som tomma" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case bortse från skiftläge när filnamn jämförs" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case ta hänsyn till skiftläge när filnamn jämförs" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "-x, --exclude=MNS ta inte med filer som matchar MNS" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=FIL uteslut filer som matchar något mönster i FIL" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "-S, --starting-file=FIL börja med FIL när kataloger jämförs" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=FIL1 jämför FIL1 med alla operander;\n" +" FIL1 kan vara en katalog" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=FIL2 jämför alla operander med FIL2;\n" +" FIL2 kan vara en katalog" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i, --ignore-case bortse från skillnader i skiftläge i " +"filinnehåll" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion bortse från ändringar på grund av tab-" +"expansion" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" +"-Z, --ignore-trailing-space ignorera alla blanktecken i slutet av raden" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change bortse från ändringar i antalet blanka" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space bortse från alla blanktecken" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B, --ignore-blank-lines bortse från ändringar där raderna är helt " +"blanka" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RU bortse från ändringar där alla rader matchar " +"RU" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text behandla alla filer som text" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr tag bort avslutande vagnreturer i indata" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr " --binary läs och skriv data binärt" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=NAMN skriv sammanslagen fil med skillnader inom\n" +" ”#ifdef NAMN”" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr " --GTYP-group-format=GFMT formatera GTYP-ingrupper med GFMT" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr " --line-format=RFMT formatera alla inrader med RFMT" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr " --RTYP-line-format=RFMT formatera RTYP-inrader med RFMT" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" Dessa formatflaggor gör det möjligt att finjustera utskriften från\n" +" diff, generaliserande -D/--ifdef." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" RTYP är ”old”, ”new” eller ”unchanged”. GTYP är RTYP eller ”changed”." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT (endast) kan innehålla:\n" +" %< rader från FIL1\n" +" %> rader från FIL2\n" +" %= gemensamma rader i FIL1 och FIL2\n" +" %[-][BREDD][.[PREC]]{doxX}BOKSTAV printf-lik spec. för BOKSTAV\n" +" BOKSTÄVER är enligt följande för ny grupp, gemen för gammal grupp:\n" +" F första radnumret\n" +" L sista radnumret\n" +" N antal rader = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) om A är lika med B då T annars E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" RFMT (endast) kan innehålla:\n" +" %L radinnehåll\n" +" %l radinnehåll exklusive avslutande nyrad\n" +" %[-][BREDD][.[PREC]]{doxX}n printf-stil spec. för inradnummer" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" Både GFMT och RFMT kan innehålla:\n" +" %% %\n" +" %c'T' det ensamma tecknet T\n" +" %c'\\OOO' tecknet med oktalkod OOO\n" +" T tecknet T (övriga tecken representerar sig själva)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d, --minimal arbeta hårt för att hitta en mindre mängd av " +"ändringar" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +" --horizon-lines=ANT spara ANT rader av gemensamt prefix och suffix" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr " --speed-large-files antag stora filer och små spridda ändringar" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" +" --color[=NÄR] färglägg utdata; NÄR kan vara ”never”, ”always”,\n" +" eller ”auto” (standard)" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" +" --palette=PALETT färgerna att använda när --color är aktivt; PALETT " +"är\n" +" en kolonseparerad lista av terminfoförmågor" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help visa denna hjälp och avsluta" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version visa versionsinformation och avsluta" + +#: src/diff.c:982 +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"FILER är ”FIL1 FIL2” eller ”KAT1 KAT2” eller ”KAT FIL” eller ”FIL KAT”." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Om --from-file eller --to-file är angivet finns det inga begränsningar\n" +"på FILER." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Om en FIL är ”-”, läs standard in." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Användning: %s [FLAGGA]... FILER\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Jämför FILER rad för rad." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "motstridigt %s-flaggsvärde ”%s”" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "motstridig utmatningsstilsflagga" + +#: src/diff.c:1058 +#, c-format +msgid "invalid color '%s'" +msgstr "ogiltig färg ”%s”" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Endast i %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "kan inte jämföra ”-” med en katalog" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "flaggan -D stödjs ej för kataloger" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Lika underkataloger: %s och %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Filen %s är %s medan filen %s är %s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "De symboliska länkarna %s och %s skiljer\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Filerna %s och %s är lika\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "oförenliga flaggor" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "”-” angivet för mer än en infil" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "läsning misslyckades" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A, --show-all skriv alla ändringar med markering runt " +"konflikter" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed skriv ut ett ed-skript som innehåller ändringar\n" +" från GAMMALFIL till DINFIL i MINFIL" + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +"-E, --show-overlap som -e, men med markeringar runt konflikter" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3, --easy-only som -e, men tag endast med ej överlappande " +"ändringar" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +"-x, --overlap-only som -e, men tag endast med överlappande ändringar" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "-X som -x, men skriv klamrar om konflikter" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "" +"-i lägg till ”w”- och ”q”-kommandon till ed-skript" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge skriv ut en faktiskt sammanslagen fil, enligt\n" +" -A om inga andra flaggor ges" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text betrakta alla filer som text" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr tag bort avslutande vagnreturer i indata" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab justera tabulatorer genom att skjuta in en " +"tabulator" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=PROGRAM använd PROGRAM för att jämföra filer" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=ETIKETT använd ETIKETT istället för filnamn\n" +" (kan upprepas upp till tre gånger)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help visa denna hjälp och avsluta" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version visa versionsinformation och avsluta" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Användning: %s [FLAGGA]... MINFIL GAMMALFIL DINFIL\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Jämför tre filer rad för rad." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"Standardformatet för utskrift är en något så när mänskligt läsbar " +"representation\n" +"av ändringarna.\n" +"\n" +"Flaggorna -e, -E, -x, -X (och motsvarande långa) gör att ett ed-skript " +"skrivs\n" +"ut istället för standardtext.\n" +"\n" +"Slutligen får flaggan -m (--merge) diff3 att göra sammanslagningen internt\n" +"och skriva ut den faktiskt sammanslagna filen. För ovanlig indata är detta\n" +"mer robust än att använda ed.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "Slutstatus är 0 om allt bra, 1 vid konflikt, 2 vid problem." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "internt fel: trasigt format i diff-block" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff misslyckades: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "internt fel: ogiltig diff-typ i process_diff" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "ogiltigt diff-format; ogiltig ändringsseparator" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "ogiltigt diff-format; ofullständig sista rad" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "underprogram ”%s” kunde inte startas" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "ogiltigt diff-format; felaktiga starttecken på rad" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "internt fel: ogiltig diff-typ utskickad" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "infilen krympte" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "kan inte jämföra filnamnen ”%s” och ”%s”" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: rekursiv katalogslinga" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "-o, --output=FIL kör interaktivt, med utdata till FIL" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i, --ignore-case betrakta versaler och gemena som lika" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion ignorera ändringar på grund av " +"tabulatorexpansion" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "" +"-Z, --ignore-trailing-space ignorera alla blanktecken i slutet av raden" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change ignorera ändringar i antalet blanka" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space ignorera alla blanktecken" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" +"-B, --ignore-blank-lines ignorera ändringar i form av enbart blanka rader" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RU bortse från ändringar vars alla rader " +"matchar RU" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr tag bort avslutande vagnreturer i indata" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a, --text behandla alla filer som text" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=ANT skriv ut högst ANT (130 som standard) kolumner" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" +"-l, --left-column skriv endast ut gemensamma raders vänstra kolumn" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines skriv inte ut gemensamma rader" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs expandera tabulatorer till blanksteg i utdata" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +" --tabsize=N tabulatorstopp var N:e (8 som standard) kolumn" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "" +"-d, --minimal arbeta hårt för att hitta en mindre mängd " +"ändringar" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files antag stora filer och små spridda ändringar" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=PROGRAM använd PROGRAM för att jämföra filer" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help visa denna hjälp och avsluta" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v, --version visa versionsinformation och avsluta" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Användning: %s [FLAGGA]... FIL1 FIL2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Sammanslagning sida-vid-sida av skillnader mellan FIL1 och FIL2." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "kan inte slå samman standard in interaktivt" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "båda filerna som skall jämföras är kataloger" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tRedigera och använd sedan båda versioner, dekorerade med huvuden.\n" +"eb:\tRedigera och använd sedan båda versioner.\n" +"el eller e1:\tRedigera och använd sedan vänstra versionen.\n" +"er eller e2:\tRedigera och använd sedan högra versionen.\n" +"e:\tKasta båda versionerna, och redigera sedan en ny.\n" +"l eller 1:\tAnvänd vänstra versionen.\n" +"r eller 2:\tAnvänd högra versionen.\n" +"s:\tInkludera tyst gemensamma rader.\n" +"v:\tInkludera och tillkännage gemensamma rader.\n" +"q:\tAvsluta.\n" + +#: src/util.c:662 +#, c-format +msgid "unrecognized prefix: %s" +msgstr "okänt prefix: %s" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "otolkbart värde för --palette" diff --git a/local/recipes/tools/diffutils/source/po/tr.gmo b/local/recipes/tools/diffutils/source/po/tr.gmo new file mode 100644 index 0000000000..6dad1218f5 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/tr.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/tr.po b/local/recipes/tools/diffutils/source/po/tr.po new file mode 100644 index 0000000000..6c180387ff --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/tr.po @@ -0,0 +1,1653 @@ +# translation of diffutils-3.5.25.tr.po to Turkish +# Diffutils Turkish translation +# Copyright (C) 2001, 2005 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Deniz Akkus Kanca <deniz@arayan.com>, 2001. +# Volkan Gezer <vlkngzr@gmail.com>, 2013. +# Mehmet Kececi <mkececi@mehmetkececi.com>, 2017. +msgid "" +msgstr "" +"Project-Id-Version: diffutils 3.5.25\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2017-05-08 11:19+0300\n" +"Last-Translator: Mehmet Kececi <mkececi@mehmetkececi.com>\n" +"Language-Team: Turkish <gnu-tr-u12a@lists.sourceforge.net>\n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Virtaal 0.7.1\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "%s için geçersiz bağımsız değişken %s" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "%s için belirsiz bağımsız değişkeni %s" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "Geçerli argümanlar şunlardır:" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "yazılım hatası" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "yığıt taşması" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Bilinmeyen sistem hatası" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "normal boş dosya" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "normal dosya" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "dizin" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "sembolik bağ" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "ileti kuyruğu" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "semafor" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "ortak bellek nesnesi" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "türlenmiş bellek nesnesi" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "blok özel dosyası" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "karakter özel dosyası" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "bitişik veri" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "kapı" + +#: lib/file-type.c:81 +msgid "multiplexed block special file" +msgstr "çoklu blok özel dosyası" + +#: lib/file-type.c:84 +msgid "multiplexed character special file" +msgstr "çoklu karakter özel dosyası" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "çoklu dosya" + +#: lib/file-type.c:90 +msgid "named file" +msgstr "adlandırılmış dosya" + +#: lib/file-type.c:93 +msgid "network special file" +msgstr "ağ özel dosyası" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "veri ile geçirilen dosya" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "veriler olmadan geçirilen dosya" + +#: lib/file-type.c:102 +msgid "port" +msgstr "bağlantı noktası" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "soket" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "sıfır görüş" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "dosya garip" + +#: lib/getopt.c:278 +#, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: '%s%s' seçeneği belirsiz\n" + +#: lib/getopt.c:284 +#, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: '%s%s' seçeneği belirsiz; kullanılabilecekler:" + +#: lib/getopt.c:319 +#, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: `%s%s' seçeneği bilinmiyor\n" + +#: lib/getopt.c:345 +#, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: seçenek '%s%s' argümansız kullanılır\n" + +#: lib/getopt.c:360 +#, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: '%s%s' seçeneği bir argümanla kullanılır\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: geçersiz seçenek -- %c\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: seçenek bir argümanla kullanılır -- %c\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "`" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "'" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Başarılı" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Eşleme yok" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Düzenli ifade geçersiz" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Harmanlama karakteri geçersiz" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Karakter sınıf ismi geçersiz" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "İzleyen ters kesme" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Geriye başvuru geçersiz" + +#: lib/regcomp.c:156 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "[, [^, [:, [., veya [= eşleşmiyor" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "( ya da \\( eşleşmiyor" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "\\{ eşleşmiyor" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "\\{\\} içeriği geçersiz" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Kapsam sonu geçersiz" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Bellek tükendi" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Önceki düzenli ifade geçersiz" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Düzenli ifadenin sonu eksik kalmış" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Düzenli ifade çok büyük" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr ") ya da \\) eşleşmiyor" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Daha önce düzenli ifade yok" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "bellek tükendi" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "stdin" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "stdout" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "stderr" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "bilinmeyen akış" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "%s, %s kipinde yeniden açılamadı" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "Geçersiz %s%s argümanı '%s'" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "%s%s içinde '%s' argümanı için geçersiz son ek" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "%s%s argümanı '%s' çok uzun" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "%s (%s) tarafından paketlenmiş\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "%s tarafından paketlenmiş\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "(C)" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Lisans GPLv3+: GNU GPL sürüm 3 veya sonrası <http://gnu.org/licenses/gpl." +"html>.\n" +"Bu ücretsiz bir yazılımdır: değiştirmekte ve tekrar dağıtmakta özgürsünüz.\n" +"İzin verilen yasalar kapsamında hiçbir GARANTİSİ BULUNMAMAKTADIR.\n" +"\n" + +# TRANSLATORS: %s denotes an author name. +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "%s tarafından yazılmıştır.\n" + +# TRANSLATORS: Each %s denotes an author name. +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "%s ve %s tarafından yazılmıştır.\n" + +# TRANSLATORS: Each %s denotes an author name. +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "%s, %s ve %s tarafından yazılmıştır.\n" + +# TRANSLATORS: Each %s denotes an author name. +# You can use line breaks, estimating that each author name occupies +# ca. 16 screen columns and that a screen line has ca. 80 columns. +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"%s, %s, %s, ve\n" +"%s tarafından yazılmıştır.\n" + +# TRANSLATORS: Each %s denotes an author name. +# You can use line breaks, estimating that each author name occupies +# ca. 16 screen columns and that a screen line has ca. 80 columns. +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"%s, %s, %s,\n" +"%s ve %s tarafından yazılmıştır.\n" + +# TRANSLATORS: Each %s denotes an author name. +# You can use line breaks, estimating that each author name occupies +# ca. 16 screen columns and that a screen line has ca. 80 columns. +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"%s, %s, %s,\n" +"%s, %s ve %s\n" +"tarafından yazılmıştır.\n" + +# TRANSLATORS: Each %s denotes an author name. +# You can use line breaks, estimating that each author name occupies +# ca. 16 screen columns and that a screen line has ca. 80 columns. +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"%s, %s, %s, \n" +"%s, %s, %s ve\n" +"%s tarafından yazılmıştır.\n" + +# TRANSLATORS: Each %s denotes an author name. +# You can use line breaks, estimating that each author name occupies +# ca. 16 screen columns and that a screen line has ca. 80 columns. +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"%s, %s, %s,\n" +"%s, %s, %s,\n" +"%s ve %s tarafından yazılmıştır.\n" + +# TRANSLATORS: Each %s denotes an author name. +# You can use line breaks, estimating that each author name occupies +# ca. 16 screen columns and that a screen line has ca. 80 columns. +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"%s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s ve %s tarafından yazılmıştır.\n" + +# TRANSLATORS: Each %s denotes an author name. +# You can use line breaks, estimating that each author name occupies +# ca. 16 screen columns and that a screen line has ca. 80 columns. +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"%s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s ve başkaları\n" +"tarafından yazılmıştır.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Hataları şuraya bildirin: %s\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "%s hatalarını şuraya bildirin: %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s ana sayfası: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "%s ana sayfası: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"GNU yazılımı kullanımı hakkında genel yardım: <http://www.gnu.org/gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "%s ve %s dosyaları birbirinden farklı\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "İkili %s ve %s birbirinden farklı\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Dosya sonunda yenisatır yok." + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Daha fazla bilgi için `%s --help' komutunu deneyin." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "geçersiz --ignore-initial değeri '%s'" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "-l ve -s seçenekleri beraber kullanılamaz" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "yazma başarısız oldu" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "standart çıktı" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b, --print-bytes bayt farklarını çıktılar" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i, --ignore-initial=ATLA İki girdinin de ilk ATLA baytını atlar." + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=ATLA1:ATLA2 DOSYA1'in ilk ATLA1 baytını ve\n" +" DOSYA2'nin ilk ATLA2 baytını atlar" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l, --verbose bütün farklı baytların numaralarını ve " +"değerlerini göster" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=LİMİT en fazla LİMİT baytı karşılaştırır" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent tüm normal çıktıları gizle" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help bu yardım metnini göster ve çık" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v, --version sürüm bilgisini gösterir" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Kullanım: %s [SEÇENEK]... DOSYA1 [DOSYA2 [ATLA1 [ATLA2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "İki dosyayı bayt bayt karşılaştırır." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"İsteğe bağlı ATLA1 ve ATLA2, her dosyanın başından atlanacak\n" +"(öntanımlı olarak sıfır) bayt sayısını belirtir." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Uzun seçenekler için zorunlu olan argümanlar, kısa seçenekler için de " +"zorunludur.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"ATLA değerleri aşağıdaki çarpanlarla sonlanabilir:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, ve T, P, E, Z, Y için devam eder." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Eğer DOSYA `-' ise veya yoksa, standart girdi okunur." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "Girdiler aynı ise çıkış durumu 0, farklı ise 1, sorun var ise 2 olur." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "geçersiz --bytes değeri `%s'" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "`%s'den sonra işlenen eksik" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "fazla işlenen `%s'" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s farklı: bayt %s, satır %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s farklı: bayt %s, satır %s: %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: %s'da EOF (dosya sonu) boş\n" + +#: src/cmp.c:585 +#, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "cmp: EOF üzerinde %s sonrası byte %s, satır %s\n" + +#: src/cmp.c:586 +#, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "cmp: EOF üzerinde %s sonrası byte %s, satır %s\n" + +#: src/cmp.c:592 +#, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: EOF üzerinde %s sonrası byte %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "`%s' bağlam uzunluğu geçersiz" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "sayfalama bu makina üzerinde desteklenmiyor" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "çok fazla dosya etiket seçeneği" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "geçersiz genişlik `%s'" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "çelişkili genişlik seçenekleri" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "geçersiz ufuk uzunluğu `%s'" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "geçersiz sekme genişliği `%s'" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "çelişkili genişlik seçenekleri" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "hem --from-file hem de --to-file belirtilmiş" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr " --normal normal bir diff çıktılar (öntanımlı)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "-q, --brief yalnızca dosyalar farklı ise göster" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "" +"-s, --report-identical-files iki dosyanın birbirinin aynısı ise göster" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C SAYI, --context[=SAYI] kopyalanan bağlamı SAYI satırınca (öntanımlı " +"3) bastırır" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U SAYI, --unified[=SAYI] birleşik bağlamın SAYI (öntanımlı 3) " +"satırınca çıktı gösterir" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed bir ed betiği çıktılar" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n, --rcs RCS biçeminde diff çıktılar" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side iki sütunda çıktı göster" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=SAYI satır başına en fazla SAYI kadar karakter " +"çıktılar (öntanımlı 130)" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +" --left-column ortak satırları yalnızca sol sütunda çıktılar" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines ortak satırlayı gösterme" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "-p, --show-c-function içinde değişen her C işlevini göster" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" +"-F, --show-function-line=DÜZİF DÜZİF ile eşleşen en yakın satırı göster" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label ETİKET dosya adı yerine ETİKET kullan\n" +" (tekrarlanabilir)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs çıktıda sekmeleri boşluk haline getir" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab başlarına bir sekme ilave ederek sekmelerin " +"hizalanmasını sağla" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=SAYI sekmeler SAYI sütun genişliğine (öntanımlı 8) " +"ayarlanır." + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty boş çıktı satırlarından önce boşluk veya " +"sekmeyi gözardı et" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" +"-l, --paginate çıktıyı 'pr' komutundan geçirerek sayfala" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r, --recursive çevrimli olarak bulunan bütün alt dizinleri " +"karşılaştır" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference sembolik bağlantıları takip etme" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "-N, --new-file var olmayan dosyaları boş varsay" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr " --unidirectional-new-file var olmayan birinci dosyayı boş varsay" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case dosya isimlerinde büyük/küçük harf " +"farklarını yoksay" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case dosya isimlerinde büyük/küçük harf farkını " +"göz önüne al" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "" +"-x, --exclude=KALIP KALIP'a uyan dosyaları işleme dahil etme" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=DOSYA DOSYA'da bulunan kalıplara uyan dosyaları " +"işlem dışı tut" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=DOSYA dizinleri karşılaştırırken DOSYA'dan başla" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=DOSYA1 DOSYA1'i bütün işlenenlerle karşılaştır;\n" +" DOSYA1 bir dizin olabilir" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=DOSYA2 DOSYA2'yi bütün işlenenlerle karşılaştır;\n" +" DOSYA2 bir dizin olabilir" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i, --ignore-case dosya içeriğinde büyük/küçük harf farklarını " +"yoksay" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion sekmelerin açılmasından doğan farkları yoksay" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space bütün satır sonu boşluklarını yoksay" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change boşluk miktarındaki değişiklikleri yoksay" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space bütün boşlukları yoksay" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B, --ignore-blank-lines satırları boş olan değişiklikleri dikkate " +"alma" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=DÜZİF satırları DÜZİF kalıbına uyan farkları " +"yok say" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text bütün dosyaları metin olarak işle" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr girdiden en sonda sarkan satır başını soy" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr " --binary veriyi ikilik kipte yaz ve oku" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=İSİM '#ifdef İSİM' farklarını gösteren " +"harmanlanmış dosya çıktıla." + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +" --GTYPE-group-format=GFMT GTYPE girdi gruplarını GFMT ile biçimlendir" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "" +" --line-format=LFMT tüm girdi satırlarını LFMT ile biçimlendir" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +" --LTYPE-line-format=LFMT tüm LTYPE girdi satırlarını LFMT ile " +"biçimlendir" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" Bu biçimlendirme seçenekleri çıktı veya fark üzerinde iyileştirilmiş fine-" +"grained control over the output\n" +" tanecik denetimi sağlar. -D/--ifdef genelleştirmesi yapar." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE 'old', 'new' veya 'unchanged' olabilir. GTYPE, LTYPE veya " +"'changed'dir." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT (sadece) aşağıdakileri içerebilir:\n" +" %< DOSYA1'den satırlar\n" +" %> DOSYA2'den satırlar\n" +" %= DOSYA1 ve DOSYA2'de ortak olan satırlar\n" +" %[-][GENİŞLİK][.[KESİNLİK]]{doxX}HARF HARF için printf tarzı biçem\n" +" HARF'ler yeni grup için aşağıdaki gibi, eski grup için ise\n" +" küçük harf olurlar:\n" +" F ilk satır numarası\n" +" L son satır numarası\n" +" N satır sayısı = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) eğer A eşittir B ise T değilse E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT (sadece) aşağıdakileri içerebilir:\n" +" %L satırın içeriği\n" +" %l sonlayan yenisatır karakteri hariç, satırın içeriği\n" +" %[-][GENİŞLİK][.[KESİNLİK]]{doxX}n girdi satır sayısı için printf tarzı " +"biçem" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" GFMT ve LFMT aşağıdakileri içerebilir:\n" +" %% %\n" +" %c'C' tekli karakter C\n" +" %c'\\OOO' Sekizlik kodu OOO olan karakter\n" +" C C karakteri (diğer karakterler kendilerini temsil eder)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal daha küçük bir fark kümesi bulmaya çalış" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr " --horizon-lines=SAYI ortak ön ek ve son eklerin SAYI satırını tut" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files büyük dosyalar ve çok sayıda dağınık küçük farklar " +"olduğunu varsay" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" +"--color[=WHEN] renklendirme çıktısı; WHEN (Ne zaman) olabilir 'asla', " +"'devmalı',\n" +" veya 'oto' (varsayılan)" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" +"--palette=PALETTE renkler kullanıldığında --color aktiftir; PALET\n" +" bir virgülle ayrılmış terminfo yetenekleri " +"listelenmiştir" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help bu yardım metnini göster ve çık" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version sürüm bilgisini göster ve çık" + +#: src/diff.c:982 +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"`DOSYA1 DOSYA2' veya `DİZİN1 DİZİN2' veya `DİZİN DOSYA' veya `DOSYA DİZİN' " +"DOSYAlARdır." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Eğer --from-file veya --to-file kullanılmışsa, DOSYAlar üzerinde kısıtlama " +"yoktur." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Eğer bir DOSYA `-' ise, standart girdi okunur." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Kullanım: %s [SEÇENEK]... DOSYAlar\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "DOSYAları satır satır karşılaştırır." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "çelişkili %s seçeneği değeri: '%s'" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "çelişkili çıktı tarz seçenekleri" + +#: src/diff.c:1058 +#, c-format +msgid "invalid color '%s'" +msgstr "geçersiz renk '%s'" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Yalnızca %s'da: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "'-', bir dizinle karşılaştırılamaz" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "-D seçenek dizinler için kullanılamaz." + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Ortak alt dizinler: %s ve %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "%s dosyası, bir %s, halbuki %s dosyası bir %s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "%s ve %s sembolik bağlantıları birbirinden farklı\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "%s ve %s dosyaları birbirinin aynı\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "uyumsuz seçenekler" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "'-' birden fazla girdi dosyası için belirtilmiş" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "okuma başarısız oldu" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A, --show-all bütün değişiklikleri çıktıla, çakışmaları köşeli " +"parantez içine al" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed ESKİDOSYA ile SİZİNDOSYA arasındaki " +"harmanlanmamış\n" +" ed betiklerini BENİMDOSYA'ya çıktıla" + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +"-E, --show-overlap -e'ye benzer, fakat çakışmaları parantez içine " +"alır" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3, --easy-only -e gibi, fakat sadece örtüşmeyen değişiklikleri " +"birleştir" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +"-x, --overlap-only -e gibi, fakat sadece örtüşen değişiklikleri " +"birleştir" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" +"-X -x gibi ancak çakışmaları parantez içine alır" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "" +"-i ed betiklerinin sonuna `w' ve `q' komutlarını " +"ekle" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge asıl birleştirilmiş dosyayı, başka bir seçenek\n" +" verilmediyse -A ya göre gösterir" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text bütün dosyaları metin olarak işle" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr girdiden en sonda sarkan satır başını soy" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab başlarına bir sekme ilave ederek sekmelerin " +"hizalanmasını sağla" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=YAZILIM dosyaları karşılaştırmak için YAZILIM'ı kullan" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=ETİKET dosya adı yerine ETİKET kullan\n" +" (üç defaya kadar tekrarlanabilir)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help bu yardım metnini göster ve çık" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version sürüm bilgisini göster ve çık" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Kullanım: %s [SEÇENEK]... BENİMDOSYA ESKİDOSYA SİZİNDOSYA\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Üç dosyayı satır satır karşılaştırır." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"Öntanımlı çıktı biçimi, değişikliklerin kişi-okunabilir gösterimidir.\n" +"\n" +"-e, -E, -x, -X (ve ilgili uzun) seçenekler, öntanımlı yerine bir ed betiği\n" +"çıktı vermesine sebep olurlar.\n" +"\n" +"Son olarak, -m (--merge) seçeneği, diff3'ün dahili olarak birleştirme\n" +"yapmasına neden olur ve asıl birleştirilen dosya çıkarılır. Alışılmadık\n" +"girdiler için, bu ed kullanımından daha dayanıklıdır.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"Eğer işleme başarılı ise çıkış durumu 0, çelişkiler var ise 1,\n" +"sorun var ise 2 olur." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "iç hata: diff blokları biçemlemesinde hata oluştu" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff başarısız oldu: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "iç hata: process_diff işlevi içinde geçersiz diff türü" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "geçersiz diff biçemi; geçersiz fark ayracı" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "geçersiz diff biçemi; tamamlanmamış son satır" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "alt yazılım '%s' çalıştırılamadı" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "geçersiz diff biçemi; geçersiz satır başı karakterleri" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "iç hata: çıktıya geçersiz diff türü geçirildi" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "girdi dosyası küçüldü" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "dosya isimleri '%s' ve '%s' karşılaştırılamıyor" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: iç dizin döngüsü" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o, --output=DOSYA etkileşimli olarak çalış, çıktıyı DOSYA'ya " +"yönlendir" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i, --ignore-case büyük harf/küçük harf farkı gözetme" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E, --ignore-tab-expansion sekmelerin açılmasından doğan farkları yoksay" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space bütün satır sonu boşluklarını yoksay" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change boşluk miktarındaki değişiklikleri yoksay" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space bütün boşlukları yoksay" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" +"-B, --ignore-blank-lines satırları boş olan değişiklikleri dikkate alma" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=DÜZİF satırları DÜZİF kalıbına uyan farkları " +"yoksay" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr girdiden en sonda sarkan satır başını soy" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a, --text bütün dosyaları metin olarak işle" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=SAYI satır başına en fazla SAYI kadar karakter " +"çıktılar (öntanımlı 130)" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" +"-W, --width=SAYI satır başına en fazla SAYI kadar karakter " +"çıktılar (öntanımlı 130)" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines ortak satırlayı gösterme" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs çıktıda sekmeleri boşluk haline getir" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +" --tabsize=SAYI sekmeleri SAYI sütun genişliğine (öntanımlı 8) " +"ayarla" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal daha küçük bir fark kümesi bulmaya çalış" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files büyük dosyalar ve çok sayıda dağınık küçük " +"farklar olduğunu varsay" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=YAZILIM dosyaları karşılaştırmak için YAZILIM'ı kullan" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help bu yardım metnini göster ve çık" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v, --version sürüm bilgisini göster ve çık" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Kullanım: %s [SEÇENEK]... DOSYA1 DOSYA2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "DOSYA1 vey DOSYA2 arasındaki farkları yan yana birleştir." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "interaktif olarak standart girdi harmanlanamaz" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "karşılaştırılacak her iki dosya da dizin" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tDüzenler, sonra iki tarafı da kullanır, bir başlıkla süsler.\n" +"eb:\tDüzenler, sonra iki tarafı da kullanır.\n" +"el:\tDüzenler, sonra sol tarafı kullanır.\n" +"er:\tDüzenler, sonra sağ tarafı kullanır.\n" +"e:\tYeni bir sürüm düzenler, iki sürümü de ihmal eder.\n" +"l veya 1:\tSol tarafı kullanır.\n" +"r veya 2:\tSağ tarafı kullanır.\n" +"s:\tOrtak satırları sessizce dahil eder.\n" +"v:\tOrtak satırları bilgi vererek dahil eder.\n" +"q:\tÇıkar.\n" + +#: src/util.c:662 +#, c-format +msgid "unrecognized prefix: %s" +msgstr "tanınmamış önek: %s" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "--palette için ayrıştırılamayan değer" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: `--%s' seçeneği argümansız kullanılır\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: `-W %s' seçeneği argümansız kullanılır\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: `%s' seçeneği bir argümanla kullanılır\n" + +#~ msgid "%s: illegal option -- %c\n" +#~ msgstr "%s: kuraldışı seçenek -- %c\n" + +#~ msgid "" +#~ "This is free software; see the source for copying conditions. There is " +#~ "NO\n" +#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR " +#~ "PURPOSE.\n" +#~ msgstr "" +#~ "Bu, özgür yazılımdır; kaynak koduna bakarak kopyalama şartlarını\n" +#~ "görebilirsiniz. SATILABİLİRLİĞİ veya HERHANGİ BİR AMACA UYGUNLUĞU için " +#~ "dahi\n" +#~ "GARANTİ YOKTUR.\n" + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i ATLA1:ATLA2 --ignore-initial=ATLA1:ATLA2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "" +#~ "-s --quiet --silent Hiç bir şey çıktılamaz, yalnızca çıkış durumunu " +#~ "bildirir." + +#~ msgid "--help Output this help." +#~ msgstr "--help Bu yardımı gösterir." + +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>." +#~ msgstr "" +#~ "Yazılım hatalarını <bug-gnu-utils@gnu.org> adresine, \n" +#~ "çeviri hatalarını <gnu-tr@belgeler.org> adresine bildirin." + +#~ msgid "`-%ld' option is obsolete; use `-%c %ld'" +#~ msgstr "`-%ld' seçeneği kullanımdan kalktı; `-%c %ld' kullanın" + +#~ msgid "`-%ld' option is obsolete; omit it" +#~ msgstr "`-%ld' seçeneği kullanımdan kalktı; kullanmayın" + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ "-c -C SAYI --context[=SAYI] SAYI kadar bağlam satırı kopyalar " +#~ "(öntanımlı 3)\n" +#~ "-u -U SAYI --unified[=SAYI] SAYI kadar birleşmiş bağlam satırı " +#~ "kopyalar\n" +#~ " (öntanımlı 3)\n" +#~ " --label ETİKET Dosya adı yerine ETİKET'i kullanır.\n" +#~ " -p --show-c-function Her farkın hangi C işlevi içinde olduğunu " +#~ "gösterir.\n" +#~ " -F DÜZİF --show-function-line=DÜZİF DÜZİF düzenli ifade kalıbına " +#~ "uygun olan\n" +#~ " en son satırı gösterir." + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ "-y --side-by-side İki sütun halinde çıktı verir.\n" +#~ " -w SAYI --width=SAYI Satır başına en fazla SAYI kadar karakter " +#~ "çıktılar\n" +#~ " (öntanımlı 130).\n" +#~ " --left-column Ortak satırlarda yalnız sol sütunu gösterir.\n" +#~ " --suppress-common-lines Ortak satırları göstermez." + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "" +#~ "--speed-large-files Büyük dosyalar ve çok sayıda dağınık küçük \n" +#~ " farklar olduğunu farzeder." + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "" +#~ "-X Birbiriyle örtüşen farkları köşeli parantez içinde göstererek " +#~ "çıktılar." + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "" +#~ "-m --merge Ed betiği yerine harmanlanmış dosya çıktılar. (öntanımlı -A)" + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "-L ETİKET --label=ETİKET Dosya adı yerine ETİKET'i kullanır." + +#~ msgid "subsidiary program `%s' not found" +#~ msgstr "alt yazılım `%s' bulunamadı" + +#~ msgid "subsidiary program `%s' failed" +#~ msgstr "alt yazılım `%s' başarısız oldu" + +#~ msgid "subsidiary program `%s' failed (exit status %d)" +#~ msgstr "alt yazılım `%s' başarısız oldu (çıkış durumu %d)" diff --git a/local/recipes/tools/diffutils/source/po/uk.gmo b/local/recipes/tools/diffutils/source/po/uk.gmo new file mode 100644 index 0000000000..190629c2cf Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/uk.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/uk.po b/local/recipes/tools/diffutils/source/po/uk.po new file mode 100644 index 0000000000..8b4f732cbf --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/uk.po @@ -0,0 +1,1576 @@ +# Ukrainian translation to diffutils. +# Copyright (C) 2006 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# +# Maxim V. Dziumanenko <dziumanenko@gmail.com>, 2006. +# Yuri Chornoivan <yurchor@ukr.net>, 2011, 2012, 2017. +msgid "" +msgstr "" +"Project-Id-Version: diffutils 3.5.25\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2017-05-07 22:08+0300\n" +"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n" +"Language-Team: Ukrainian <translation-team-uk@lists.sourceforge.net>\n" +"Language: uk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Lokalize 1.5\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "некоректний аргумент %s до %s" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "неоднозначний аргумент %s до %s" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "Список коректних аргументів:" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "помилка програми" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "переповнення стеку" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Невідома системна помилка" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "звичайний порожній файл" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "звичайний файл" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "каталог" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "символьне посилання" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "черга повідомлень" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "семафор" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "об’єкт у спільній пам'яті" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "об’єкт пам'яті з типами" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "спеціальний файл з блоковим доступом" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "спеціальний файл з символьним доступом" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "неперервні дані" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "черга" + +#: lib/file-type.c:78 +msgid "door" +msgstr "двері" + +#: lib/file-type.c:81 +msgid "multiplexed block special file" +msgstr "спеціальний файл ущільненого блокового пристрою" + +#: lib/file-type.c:84 +msgid "multiplexed character special file" +msgstr "спеціальний файл ущільненого символьного пристрою" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "ущільнений файл" + +#: lib/file-type.c:90 +msgid "named file" +msgstr "іменований файл" + +#: lib/file-type.c:93 +msgid "network special file" +msgstr "спеціальний файл мережі" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "перенесений файл з даними" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "перенесений файл без даних" + +#: lib/file-type.c:102 +msgid "port" +msgstr "порт" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "сокет" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "забілювання" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "дивний файл" + +#: lib/getopt.c:278 +#, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: параметр «%s%s» не є однозначним\n" + +#: lib/getopt.c:284 +#, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: неоднозначний параметр «%s%s»; можливі варіанти:" + +#: lib/getopt.c:319 +#, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: невідомий параметр «%s%s»\n" + +#: lib/getopt.c:345 +#, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: додавання аргументів до параметра «%s%s» не передбачено\n" + +#: lib/getopt.c:360 +#, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: до параметра «%s%s» слід додати аргумент\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: некоректний параметр — «%c»\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: до параметра слід додати аргумент — «%c»\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "`" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "'" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Успішно" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Немає відповідностей" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Неправильний регулярний вираз" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Некоректний символ для сортування" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Неправильна назва класу символу" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Зворотна коса риска стоїть останньою" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Неправильне посилання" + +#: lib/regcomp.c:156 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Непарна [, [^, [:, [. або [=" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Непарна ( чи \\(" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Непарна \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Неправильний вміст \\{\\}" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Неправильна нижня межа" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Оперативну пам'ять вичерпано" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Неправильний попередній регулярний вираз" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Передчасний кінець регулярного виразу" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Регулярний вираз надто великий" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Непарна ) чи \\)" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Регулярний вираз не було вказано раніше" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "пам’ять вичерпано" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "stdin" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "stdout" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "stderr" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "невідомий потік даних" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "не вдалося повторно відкрити %s у режимі %s" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "некоректний аргумент %s%s — «%s»" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "некоректний суфікс у аргументі %s%s «%s»" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "%s%s, аргумент «%s» є занадто об'ємним" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Пакування виконано %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Пакування виконано %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Умови ліцензування викладено у GPLv3+: GNU GPL версії 3 або новішій, <http://" +"gnu.org/licenses/gpl.html>\n" +"Це вільне програмне забезпечення: ви можете вільно змінювати і поширювати " +"його.\n" +"Вам не надається ЖОДНИХ ГАРАНТІЙ, окрім гарантій передбачених " +"законодавством.\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Автор програми -- %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Автори програми -- %s та %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Автори програми -- %s, %s та %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Автори програми -- %s, %s, %s\n" +"та %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Автори програми -- %s, %s, %s,\n" +"%s та %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Автори програми -- %s, %s, %s,\n" +"%s, %s та %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Автори програми -- %s, %s, %s,\n" +"%s, %s, %s та %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Автори програми -- %s, %s, %s,\n" +"%s, %s, %s, %s\n" +"та %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Автори програми -- %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s та %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Автори програми -- %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s та інші.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Про вади повідомляйте за такою адресою: %s\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Про вади у %s повідомляйте за такою адресою: %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Домашня сторінка %s: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "Домашня сторінка %s: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"Загальна довідка з програмного забезпечення GNU: <http://www.gnu.org/gethelp/" +">\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Файли %s та %s відрізняються\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Двійкові файли %s та %s відрізняються\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Наприкінці файла немає нового рядка" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Спробуйте «%s --help» для отримання докладнішого опису." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "неприпустиме значення --ignore-initial «%s»" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "параметри -l та -s несумісні" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "запис невдалий" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "стандартний вивід" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b --print-bytes вивести байти, що відрізняються." + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i, --ignore-initial=Н пропустити перші Н байтів у обох потоках " +"вхідних даних" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=Н1:Н2 пропустити перші Н1 байтів у ФАЙЛ1 і\n" +" перші Н2 байтів у ФАЙЛ2" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l --verbose вивести номери та значення усіх різних байтів" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "" +"-n, --bytes=МЕЖА порівнювати не більше вказаної кількості байтів." + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent не показувати всі звичайні повідомлення" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr "" +" --help показати це довідкове повідомлення і завершити " +"роботу" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "" +"-v, --version показати дані щодо версії і завершити роботу" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Використання: %s [ПАРАМЕТР]... ФАЙЛ1 [ФАЙЛ2 [Н1 [Н2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "Порівнює два файли по байтах." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"Додаткові аргументи Н1 та Н2 визначають кількість байтів, які слід\n" +"пропустити на початку кожного файла (типово байти не пропускаються)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Обов’язкові аргументи для довгих форм запису параметрів є обов’язковими і " +"для скорочених форм.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"До значень Н можна приписувати один з наступних суфіксів множення:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, і так далі для T, P, E, Z, Y." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "" +"Якщо ФАЙЛ не вказано або вказано як «-», дані буде прочитано зі стандартного " +"потоку введення." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"Код завершення дорівнює 0, якщо вхідні файли ідентичні, 1 -- якщо\n" +"відрізняються, та 2 при виникненні помилок." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "некоректне значення --bytes «%s»" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "пропущено операнд після «%s»" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "зайвий операнд «%s»" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s відрізняються: байт %s, рядок %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s відрізняються: байт %s, рядок %s дорівнює %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: кінець файла у %s, який є порожнім\n" + +#: src/cmp.c:585 +#, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "cmp: кінець файла у %s після байта %s, рядок %s\n" + +#: src/cmp.c:586 +#, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "cmp: кінець файла у %s після байта %s, у рядку %s\n" + +#: src/cmp.c:592 +#, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: кінець файла у %s після байта %s\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "некоректна довжина контексту «%s»" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "розбиття на сторінки не підтримується на цій машині" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "надто багато параметрів, що вказують позначки файлів" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "некоректна ширина «%s»" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "суперечливі параметри визначення ширини" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "некоректна довжина горизонту «%s»" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "неприпустима ширина табуляції «%s»" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "суперечливі параметри визначення ширини табуляції" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "необхідно вказати як --from-file, так і --to-file" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr "" +" --normal вивести дані у форматі звичайного diff (типово)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "-q, --brief сповіщати лише про різні файли" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s --report-identical-files сповіщати про однакові файли" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C КТЬ, --context[=КТЬ] вивести КТЬ (типово 3) рядки скопійованого " +"контексту" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U ЧИСЛО, --unified[=ЧИСЛО] вивести ЧИСЛО (типово 3) рядків спільного " +"контексту" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed вивести дані у форматі запису ed" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "" +"-n, --rcs виводити у форматі diff систем керування " +"версіями" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side вивести дані у два стовпчики" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=ЧИСЛО виводити текст не більше ніж у ЧИСЛО (типово " +"130) позицій у рядок" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +" --left-column виводити спільні рядки лише у ліву колонку" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines не виводити однакові рядки" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" +"-p, --show-c-function показати дані щодо функцій C у яких виявлено " +"кожну зі змін" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" +"-F, --show-function-line=RE показати останній рядок, що відповідає " +"формальному виразу RE" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label МІТКА використати МІТКУ замість назви файла і " +"часової позначки\n" +" (можна використовувати декілька разів)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t --expand-tabs замінювати символи табуляції пробілами у виводі" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T --initial-tab вирівнювати табуляцію символами табуляції" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=ЧИСЛО табуляція кожні ЧИСЛО позицій виведення " +"(типово 8)" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty не показувати пробіли або табуляції перед " +"порожніми рядками" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" +"-l --paginate спрямувати дані до «pr» для розбиття на " +"сторінки." + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r, --recursive рекурсивно порівняти всі знайдені підкаталоги" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr "" +" --no-dereference не переходити за символічними посиланнями" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "-N, --new-file вважати незнайдені файли порожніми" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "" +" --unidirectional-new-file вважати незнайдені у першому джерелі файли " +"порожніми" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case ігнорувати регістр назв файлів під час " +"порівняння" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case враховувати регістр символів назв файлів" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "" +"-x --exclude=ЗРАЗОК виключити файли, назви яких відповідають " +"ЗРАЗКУ" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=ФАЙЛ виключити файли, назви яких відповідають " +"зразкам\n" +" з файла." + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=ФАЙЛ починати порівняння каталогів на файлі ФАЙЛ" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=ФАЙЛ1 порівняти ФАЙЛ1 з усіма операндами;\n" +" ФАЙЛ1 може бути каталогом" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=ФАЙЛ2 порівняти всі операнди з ФАЙЛОМ " +"2; ФАЙЛ2 може бути каталогом." + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i --ignore-case ігнорувати регістр літер у вмісті файлів" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E --ignore-tab-expansion ігнорувати зміни, викликані заміною " +"табуляції пробілами" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space ігнорувати пробіли наприкінці рядка" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b --ignore-space-change ігнорувати зміни у кількості пробілів" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w --ignore-all-space ігнорувати усі пробіли" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "" +"-B --ignore-blank-lines ігнорувати зміни кількості порожніх рядків" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE ігнорувати зміни, які відповідають " +"формальному виразу RE" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text вважати всі файли текстовими" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr вилучити з виведених даних всі завершальні " +"символи нового рядка" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr "" +" --binary читати та записувати файли у двійковій формі" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=НАЗВА виводити diff-блоки, що використовують " +"конструкцію «#ifdef НАЗВА»." + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +" --ГТИП-group-format=ГФМТ форматувати вхідні групи типу ГТИП\n" +" у відповідності до формату ГФМТ." + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "" +" --line-format=СФМТ форматувати всі вхідні рядки за допомогою " +"СФМТ." + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +" --CТИП-group-format=СФМТ форматувати вхідні рядки типу СТИП\n" +" у відповідності до формату СФМТ" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" За допомогою цих параметрів форматування можна точно налаштувати\n" +" вивід diff, з узагальненням -D/--ifdef." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" СТИП може бути «old», «new» чи «unchanged», ГТИП — те саме або «changed»." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" ГФМТ може містити:\n" +" %< рядки з ФАЙЛА1\n" +" %> рядки з ФАЙЛА2\n" +" %= рядки, спільні для ФАЙЛА1 та ФАЙЛА2\n" +" %[-][ШИРИНА][.[ТОЧН]]{doxX}ЛІТЕРА формат для ЛІТЕРА у стилі printf\n" +" ЛІТЕРА має наступні значення для нових груп, маленькі для старих:\n" +" F номер першого рядка\n" +" L номер останнього рядка\n" +" N кількість рядків = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) якщо A дорівнює B, T, інакше E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" СФМТ може містити:\n" +" %L вміст рядка\n" +" %l вміст рядка без символу нового рядка наприкінці\n" +" %[-][ШИРИНА][.[ТОЧН]]{doxX}n формат номеру вхідного рядка у стилі printf" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" Обидва ГФМТ та СФМТ можуть містити:\n" +" %% %\n" +" %c'С' один символ С\n" +" %c'\\OOO' один символ з вісімковим кодом OOO\n" +" C символ C (інші символи не оброблятимуться)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d --minimal намагатись знайти найменший набір змін" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "" +" --horizon-lines=ЧИСЛО зберегти ЧИСЛО спільних рядків, до та після різних" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files вважати файли великими з багатьма розкиданими\n" +" дрібними змінами." + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" +" --color[=КОЛИ] розфарбовувати виведення; значенням КОЛИ може бути " +"«never», «always»,\n" +" або «auto» (типовий варіант)" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" +" --palette=ПАЛІТРА кольори, які слід використовувати, якщо додано --" +"color;\n" +" ПАЛІТРА — відокремлений двокрапками список " +"можливостей terminfo" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr "" +" --help показати це довідкове повідомлення і завершити " +"роботу" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version показати дані щодо версії і завершити роботу" + +#: src/diff.c:982 +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"ФАЙЛИ — це «ФАЙЛ1 ФАЙЛ2», чи «КАТАЛОГ1 КАТАЛОГ2», чи «КАТАЛОГ ФАЙЛ»,\n" +"чи «ФАЙЛ КАТАЛОГ»." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "Якщо вказано --from-file чи --to-file, на ФАЙЛИ обмежень немає." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "" +"Якщо ФАЙЛ вказано як «-», дані буде прочитано зі стандартного потоку " +"введення." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Використання: %s [КЛЮЧ]... ФАЙЛИ\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "Порівнює два файли за рядками." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "суперечливі значення %s для ключа «%s»" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "суперечливі ключі визначення стилю виводу" + +#: src/diff.c:1058 +#, c-format +msgid "invalid color '%s'" +msgstr "некоректний колір «%s»" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Лише у %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "не можна порівнювати «-» з каталогом" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "-D параметр не підтримується для каталогів" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Спільні підкаталоги: %s та %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Файл %s це %s, тоді як файл %s -- %s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Символічні посилання %s і %s є різними\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Файли %s та %s ідентичні\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "несумісні ключі" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "«-» вказано для більш ніж одного вхідного файла" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "помилка читання" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A --show-all вивести всі зміни, беручи конфліктні місця у " +"дужки." + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e --ed вивести необ'єднані зміни у СТАРОМУ-ФАЙЛІ\n" +" порівняно з ВАШИМ-ФАЙЛОМ до МОГО-ФАЙЛА." + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +"-E --show-overlap подібно до -e, але з взяттям конфліктних місць у " +"дужки" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3, --easy-only подібно до -e, але включити лише зміни без " +"перекриття" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +"-x, --overlap-only подібно до -e, але включати лише зміни з " +"перекриттям" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" +"-X подібно до -x, але з взяттям розбіжностей у дужки" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "" +"-i дописувати команди «w» і «q» в кінець сценарію " +"ed." + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge вивести дані до об'єднаного файла, відповідно " +"до\n" +" -A, якщо не вказано інших параметрів" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text вважати всі файли текстовими" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr вилучити з виведених даних всі завершальні " +"символи нового рядка" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T --initial-tab вирівнювати табуляцію додаючи на початок символ " +"табуляції" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=ПРОГРАМА використовувати для порівняння вказану ПРОГРАМУ" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=МІТКА використовувати МІТКУ замість назви файла\n" +" (можна використовувати не більше трьох разів)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr "" +" --help показати це довідкове повідомлення і завершити " +"роботу" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "" +"-v, --version показати дані щодо версії і завершити роботу" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Використання: %s [КЛЮЧ]... МІЙ-ФАЙЛ СТАРИЙ-ФАЙЛ ВАШ-ФАЙЛ\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "Порівняння трьох файлів рядками." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"Типовим форматом виведених даних є щось подібне до зручного для читання\n" +"представлення змін.\n" +"\n" +"Параметри -e, -E, -x, -X (та відповідні розширені версії) призводять до\n" +"виведення даних у форматі запису ed замість типового.\n" +"\n" +"Нарешті, параметр -m (--merge) призводить до об’єднання даних за допомогою\n" +"diff3 з виводом їх до об’єднаного файла. Для нетипових вхідних даних\n" +"такий варіант працює краще за варіант з використанням ed.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"Код завершення дорівнює 0 при нормальному завершенні, 1 при конфліктах\n" +" та 2 при несправностях." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "внутрішня помилка: пошкоджений формат diff-блоків" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: помилка при пошуку відмінностей: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "" +"внутрішня помилка: неправильний тип diff-блоку у функції `process_diff'" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "неправильний формат diff-файла; неправильний розділювач змін" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "неправильний формат diff-файла; неповний останній рядок" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "не вдається запустити допоміжну програму «%s»" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "неправильний diff-формат; неправильні перші символи рядка" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "внутрішня помилка: на вхід подано неправильний тип diff-файла" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "вхідний файл зменшився" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "неможливо порівняти назви файлів «%s» та «%s»" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: зациклення рекурсивного проходу каталогів" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o, --output=ФАЙЛ інтерактивний режим із записом виводу до ФАЙЛА" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i --ignore-case ігнорувати регістр літер" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "" +"-E --ignore-tab-expansion ігнорувати зміни, викликані заміною табуляції " +"пробілами" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space ігнорувати пробіли наприкінці рядка" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b --ignore-space-change ігнорувати зміни у кількості пробілів" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W --ignore-all-space ігнорувати усі пробіли" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "" +"-B --ignore-blank-lines ігнорувати зміни кількості порожніх рядків" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE ігнорувати зміни, які відповідають " +"формальному виразу RE" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr вилучити з виведених даних всі завершальні " +"символи нового рядка" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a, --text вважати всі файли текстовими" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=ЧИСЛО виводити текст не більше ніж у ЧИСЛО (типово " +"130) позицій у рядок" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" +"-l, -left-column виводити спільні рядки лише у ліву колонку" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines не виводити спільні рядки" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t --expand-tabs замінювати символи табуляції пробілами у виводі" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +" --tabsize=ЧИСЛО табуляція кожні ЧИСЛО позицій виведення (типово " +"8)" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d --minimal намагатись знайти найменший набір змін" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, -speed-large-files вважати файли великими з багатьма розкиданими\n" +" дрібними змінами." + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=ПРОГРАМА використовувати для порівняння вказану ПРОГРАМУ" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr "" +" --help показати це довідкове повідомлення і завершити " +"роботу" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "" +"-v, --version показати дані щодо версії і завершити роботу" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Використання: %s [КЛЮЧ]... ФАЙЛ1 ФАЙЛ2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Паралельне об’єднання файлів ФАЙЛ1 і ФАЙЛ2." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "не можна інтерактивно об'єднувати стандартний потік вводу" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "обидва файли, що порівнюються є каталогами" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tРедагувати та використовувати обидві версії, кожну із заголовком.\n" +"eb:\tРедагувати та використовувати обидві версії.\n" +"el або e1:\tРедагувати та використовувати ліву версію.\n" +"er або e2:\tРедагувати та використовувати праву версію.\n" +"e:\tВикористовувати нову версію.\n" +"l або 1:\tВикористовувати ліву версію.\n" +"r або 2:\tВикористовувати праву версію.\n" +"s:\tВключати спільні рядки, без виводу повідомлень.\n" +"v:\tВключати спільні рядки, виводячи повідомлення.\n" +"q:\tВийти.\n" + +#: src/util.c:662 +#, c-format +msgid "unrecognized prefix: %s" +msgstr "невідомий префікс: %s" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "непридатне до обробки значення для --palette" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: додавання аргументів до параметра «--%s» не передбачено\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: невідомий параметр «--%s»\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: параметр «-W %s» не є однозначним\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: додавання аргументів до параметра «-W %s» не передбачено\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: до параметра «-W %s» слід додати аргумент\n" + +#~ msgid " or 'auto' (the default)" +#~ msgstr " або «auto» (типове значення)" + +#~ msgid "" +#~ " --palette=PALETTE specify the colors to use when --color is active" +#~ msgstr "" +#~ " --palette=ПАЛІТРА вказати кольори, які слід використовувати, якщо " +#~ "додано --color" diff --git a/local/recipes/tools/diffutils/source/po/vi.gmo b/local/recipes/tools/diffutils/source/po/vi.gmo new file mode 100644 index 0000000000..f43cb48139 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/vi.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/vi.po b/local/recipes/tools/diffutils/source/po/vi.po new file mode 100644 index 0000000000..75e7f657b8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/vi.po @@ -0,0 +1,1615 @@ +# Vietnamese translation for Diff Utils. +# Copyright © 2013 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Clytie Siddall <clytie@riverland.net.au>, 2005-2010. +# Trần Ngọc Quân <vnwildman@gmail.com>, 2013, 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: diffutils 3.5.25\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2017-05-08 07:10+0700\n" +"Last-Translator: Trần Ngọc Quân <vnwildman@gmail.com>\n" +"Language-Team: Vietnamese <translation-team-vi@lists.sourceforge.net>\n" +"Language: vi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Team-Website: <http://translationproject.org/team/vi.html>\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Gtranslator 2.91.7\n" +"X-Poedit-SourceCharset: UTF-8\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "tham số %s cho %s không hợp lệ" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "tham số %s không rõ ràng với %s" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "Các tham số hợp lệ là:" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "lỗi chương trình" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "stack bị tràn" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "Không biết lỗi hệ thống" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "tập tin trống thông thường" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "tập tin thường" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "thư mục" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "liên kết mềm" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "hàng đợi thông điệp" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "cờ hiệu" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "đối tượng bộ nhớ dùng chung" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "đối tượng bộ nhớ đánh loại" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "tập tin đặc biệt khối" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "tập tin đặc biệt ký tự" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "dữ liệu liên tiếp" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo (vào trước, ra trước)" + +#: lib/file-type.c:78 +msgid "door" +msgstr "cửa" + +#: lib/file-type.c:81 +msgid "multiplexed block special file" +msgstr "tập tin đặc biệt khối đa phức hợp" + +#: lib/file-type.c:84 +msgid "multiplexed character special file" +msgstr "tập tin đặc biệt ký tự đa phức hợp" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "tập tin đa phức hợp" + +#: lib/file-type.c:90 +msgid "named file" +msgstr "tập tin tên" + +#: lib/file-type.c:93 +msgid "network special file" +msgstr "tập tin đặc biệt mạng" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "chuyển đổi tập tin với dữ liệu" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "chuyển đổi tập tin không cùng dữ liệu" + +#: lib/file-type.c:102 +msgid "port" +msgstr "cổng" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "socket" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "bỏ trắng" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "tập tin lạ" + +#: lib/getopt.c:278 +#, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s: tùy chọn “%s%s” chưa rõ ràng\n" + +#: lib/getopt.c:284 +#, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s: tùy chọn “%s%s” chưa rõ ràng; khả năng là:" + +#: lib/getopt.c:319 +#, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s: không nhận ra tùy chọn “%s%s”\n" + +#: lib/getopt.c:345 +#, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s: tùy chọn “%s%s” không không cho phép một đối số\n" + +#: lib/getopt.c:360 +#, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s: tùy chọn “%s%s” cần một đối số\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: tùy chọn không hợp lệ -- “%c”\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: tùy chọn yêu cầu một đối số -- “%c”\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "“" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "”" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "Thành công" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "Không có gì khớp" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "Biểu thức chính quy không hợp lệ" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "Ký tự đối chiếu không hợp lệ" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "Tên lớp ký tự không hợp lệ" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "Có gạch ngược theo sau" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "Tham chiếu ngược trở lại không hợp lệ" + +#: lib/regcomp.c:156 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Chưa khớp cặp ký tự [, [^, [:, [., hay [=" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "Chưa khớp ( hay \\(" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "Chưa khớp \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "Nội dung của \\{\\} không hợp lệ" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "Kết thúc vùng không hợp lệ" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "Hết bộ nhớ" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "Biểu thức chính quy đi trước không hợp lệ" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "Kết thức quá sớm của biểu thức chính quy" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "Biểu thức chính quy quá lớn" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "Chưa khớp ) hay \\)" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "Không có biểu thức chính quy đi trước" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "hết bộ nhớ rồi" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "đầu vào tiêu chuẩn" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "đầu ra tiêu chuẩn" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "đầu lỗi tiêu chuẩn" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "không nhận ra luồng" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "lỗi mở lại %s với chế độ %s" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "đối số %s%s không hợp lệ “%s”" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "gặp hậu tố không hợp lệ trong %s%s đối số “%s”" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "%s%s nhận đối số “%s” là quá lớn" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Gói đóng bởi %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Gói đóng bởi %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Giấy phép GPL pb3+: Giấy phép Công cộng GNU phiên bản 3 hay sau\n" +"<http://gnu.org/licenses/gpl.html>\n" +"Đây là phần mềm tự do: bạn có quyền sửa đổi và phát hành lại nó.\n" +"KHÔNG CÓ BẢO HÀNH GÌ CẢ, với điều kiện được pháp luật cho phép.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Tác giả: %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Tác giả: %s và %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Tác giả: %s, %s, và %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Tác giả: %s, %s, %s,\n" +"và %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Tác giả: %s, %s, %s,\n" +"%s, và %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Tác giả: %s, %s, %s,\n" +"%s, %s, và %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Tác giả: %s, %s, %s,\n" +"%s, %s, %s, và %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Tác giả: %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"và %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Tác giả: %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, và %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Tác giả: %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, và người khác.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Thông báo lỗi nào cho: %s\n" +"Thông báo lỗi dịch nào cho: <http://translationproject.org/team/vi.html>\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Thông báo lỗi %s nào cho: %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Trang chủ %s: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "Trang chủ %s: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" +"Trợ giúp chung về cách sử dụng phần mềm GNU: <http://www.gnu.org/gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "Hai tập tin %s và %s là khác nhau.\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "Hai tập tin nhị phân %s và %s khác nhau\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "Không có ký tự dòng mới tại kêt thức tập tin." + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn Granlund" + +# Tên họ +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "David MacKenzie" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "Hãy chạy lệnh “%s --help” để xem thông tin thêm." + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "" +"giá trị của tùy chọn --ignore-initial (bỏ qua giá trị đầu) “%s” không hợp lệ" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "hai tùy chọn -l và -s không tương thích với nhau" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "không ghi được" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "thiết bị xuất chuẩn" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b, --print-bytes in ra những byte khác nhau." + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "" +"-i, --ignore-initial=SỐ bỏ qua SỐ byte khởi đầu của dữ liệu nhập" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=SỐ1:SỐ2 bỏ qua SỐ1 byte đầu của TẬP-TIN1 và\n" +" SỐ2 byte đầu của TẬP-TIN2." + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "" +"-l, --verbose xuất số byte và giá trị của tất cả byte khác nhau" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=SỐ so sánh tối đa SỐ byte" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "-s, --quiet, --silent loại bỏ tất cả các kết xuất thông thường" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help hiển thị trợ giúp này rồi thoát" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v, --version đưa ra thông tin phiên bản rồi thoát" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "Cách dùng: %s [TÙY_CHỌN]… TẬP_TIN1 [TẬP_TIN2 [SKIP1 [SKIP2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "So sánh mỗi byte trong hai tập tin." + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "" +"Tùy chọn SKIP1 và SKIP2 chỉ định số byte sẽ được bỏ qua\n" +"tại vị trí bắt đầu của mỗi tập tin (số không là mặc định)." + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "Tùy chọn dài yêu cầu đối số thì tùy chọn ngắn cũng vậy.\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"SKIP có thể sử dụng một của những chữ theo đây để làm hệ số nhân:\n" +"kB x 1000\t\tK x 1024\n" +"MB x 1,000,000\t\tM x 1,048,576\n" +"GB x 1,000,000,000\tG x 1,073,741,824\n" +"tương tự với T, P, E, Z, Y v.v." + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "Nếu TẬP-TIN là “-”, hay bỏ trống, thì đọc từ đầu vào tiêu chuẩn." + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "" +"Trạng thái thoát là số 0 nếu hai đầu vào bằng nhau, số 1 nếu là khác nhau và " +"số 2 nếu gặp lỗi." + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "giá trị cho tùy chọn --bytes “%s” không hợp lệ" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "thiếu toán hạng sau “%s”" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "toán hạng bổ xung “%s”" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s có khác nhau: byte %s, dòng %s\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s có khác nhau: byte %s, dòng %s là %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp: gặp kết thức tập tin trên %s cái mà trống rỗng\n" + +#: src/cmp.c:585 +#, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "cmp: gặp kết thức tập tin trên %s sau byte %s, dòng %s\n" + +#: src/cmp.c:586 +#, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "cmp: gặp kết thức tập tin trên %s sau byte %s, ở dòng %s\n" + +#: src/cmp.c:592 +#, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp: gặp kết thức tập tin trên %s sau byte %s\n" + +# Tên họ +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "Paul Eggert" + +# Tên họ +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "Mike Haertel" + +# Tên họ +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "David Hayes" + +# Tên họ +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "Richard Stallman" + +# Tên họ +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "Len Tower" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "độ dài ngữ cảnh không hợp lệ “%s”" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "máy chủ này không hỗ trợ dàn trang" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "quá nhiều tùy chọn nhãn tập tin" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "độ rộng không hợp lệ “%s”" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "nhiều tùy chọn độ rộng xung đột với nhau" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "độ dài chiều đứng không hợp lệ “%s”" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "cỡ ký tự tab không hợp lệ “%s”" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "nhiều tùy chọn cỡ ký tự tab xung đột với nhau" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "" +"ghi rõ cả hai tùy chọn --from-file (từ tập tin) và --to-file (vào tập tin) " +"đều" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr "" +" --normal xuất ra định dạng diff thông thường (mặc định)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "" +"-q, --brief chỉ báo cáo nếu những tập tin khác với nhau" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s, --report-identical-files báo cáo khi có hai tập tin bằng nhau" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" +"-c, -C SỐ, --context[=SỐ] xuất ra SỐ (mặc định là 3) dòng của ngữ cảnh" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "" +"-u, -U SỐ, --unified[=SỐ] xuất ra SỐ (mặc định là 3) dòng của ngữ cảnh\n" +" hợp nhất" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed xuất tập lệnh loại ed" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "" +"-n, --rcs xuất dữ liệu khác biệt sử dụng định dạng RCS" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "-y, --side-by-side xuất ra theo định dạng hai cột" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-W, --width=SỐ xuất tối đa SỐ cột đã in ra (mặc định là 130)" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr "" +" --left-column kết xuất chỉ cột bên trái của các dòng chung" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines không kết xuất các dòng chung nhau" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" +"-p, --show-c-function hiển thị cái mà từng hàm C thay đổi ở trong đó" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "-F, --show-function-line=RE hiển thị những dòng gần nhất khớp với RE" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --label NHÃN sử dụng NHÃN thay vì tên tập tin và dấu thời " +"gian\n" +" (có thể được lặp lại)" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs mở rộng ký tự tab ra ký tự khoảng cách khi " +"kết\n" +" xuất" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab sắp xếp tất cả ký tự tab bằng cách thêm\n" +" một tab vào trước" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "" +" --tabsize=SỐ định khoảng cách tab sau mỗi SỐ cột đã in ra\n" +" (mặc định là 8)" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" +" --suppress-blank-empty thu hồi khoảng cách hay tab đằng trước dòng " +"kết\n" +" xuất trống" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "" +"-l, --paginate chuyển dữ liệu kết xuất qua “pr” để dàn trang " +"nó" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "" +"-r, --recursive so sánh đệ qui mọi thư mục con đã tìm thấy" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr " --no-dereference không theo liên kết mềm" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "-N --new-file coi tập tin vắng mặt là trống" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr " --unidirectional-new-file coi tập tin đầu mà vắng mặt là trống" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "" +" --ignore-file-name-case bỏ qua chữ HOA/thường khi so sánh\n" +" các tên tập tin" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "" +" --no-ignore-file-name-case phân biệt HOA/thường khi so sánh tên tập tin" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "-x, --exclude=MẪU loại trừ các tập tin khớp với MẪU ấy" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "" +"-X, --exclude-from=TẬP_TIN loại trừ mọi tập tin khớp với bất cứ mẫu nào " +"trong TẬP TIN ấy" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "" +"-S, --starting-file=TẬP_TIN bắt đầu với TẬP TIN khi so sánh nhiều thư mục" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=TẬP_TIN1 so TẬP TIN 1 với tất cả toán hạng;\n" +" TẬP TIN 1 có thể là thư mục" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=TẬP_TIN2 So tất cả toán hạng với TẬP TIN 2;\n" +" TẬP TIN 2 có thể là thư mục" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "" +"-i, --ignore-case không phân biệt chữ HOA/thường trong nội\n" +" dung tập tin" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "-E, --ignore-tab-expansion bỏ qua mọi thay đổi do mở rộng tab" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space bỏ qua tất cả dấu cách ở cuối dòng" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "" +"-b, --ignore-space-change bỏ qua thay đổi gây ra bởi nhóm dấu cách" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space bỏ qua tất cả dấu cách" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "-B, --ignore-blank-lines bỏ qua thay đổi do dòng trống" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE bỏ qua thay đổi do mà mọi dòng khớp với RE" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text xử lý mọi tập tin là văn bản thường" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr cắt bỏ ký tự về đầu dòng (cr) theo sau khi gõ" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr "" +" --binary đọc và ghi dữ liệu trong chế độ nhị phân" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=TÊN kết xuất tập tin đã trộn với khác biệt " +"“#ifdef TÊN”" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr " --GTYPE-group-format=GFMT định dạng nhập GTYPE với GFMT " + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "" +" --line-format=LFMT định dạng tất cảc các dòng vào với LFMT" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr " --LTYPE-line-format=LFMT định dạng nhập LTYPE với LFMT" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" +" Nhưng tùy chọn đó điểu khiển kết xuất ra định dạng diff\n" +" đẹp hơn, khái quát hóa -D/--ifdef." + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE là “cũ”, “mới”, hoặc “chưa thay đổi”. GTYPE là LTYPE hoặc “thay đổi " +"rồi”." + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT chỉ có thể chứa:\n" +" %< dòng từ TẬP_TIN1\n" +" %> dòng từ TẬP_TIN2\n" +" %= dòng chung của TẬP_TIN1 và TẬP_TIN2\n" +" %[-][ĐỘ_RỘNG][.[PREC]]{doxX}CHỮ dạng printf cho CHỮ ấy\n" +" CHỮ HOA cho nhóm mới, chữ thường cho nhóm cũ:\n" +" F số dòng đầu\n" +" L số dòng cuối cùng\n" +" N tổng số dòng = L-F+1\n" +" E F-1\n" +" M L+1 %(A=B?T:E) nếu A bằng B thì T nếu không thì E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT chỉ có thể chứa:\n" +" %L nội dung của dòng\n" +" %l nội dung của dòng, loại trừ ký tự dòng mới nào đi theo\n" +" %[-][Đ_RỘNG][.[PREC]]{doxX}n đặc tả dạng printf cho số dòng đầu vào" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" Cả GFMT và LFMT có thể chứa:\n" +" %% %\n" +" %c'C' ký tự riêng lẻ C\n" +" %c'\\OOO' ký tự có mã bát phân OOO\n" +" C ký tự C (các ký tự khác đại diện cho chính chúng)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal cố tìm một thay đổi nhỏ" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr " --horizon-lines=SỐ giữ SỐ dòng của tiền tố và hậu tố chung" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "" +" --speed-large-files giả định tập tin lớn và nhiều thay đổi nhỏ rải rác" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" +" --color[=WHEN] tô màu kết xuất; WHEN có thể là 'never', 'always',\n" +" hay 'auto' (mặc định)" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" +" --palette=PALETTE các màu được dùng khi --color kích hoạt; PALETTE là " +"một\n" +" danh sách terminfo capabilities ngăn cách bằng " +"dấu phẩy" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help hiển thị trợ giúp này rồi thoát" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version đưa ra thông tin phiên bản rồi thoát" + +#: src/diff.c:982 +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"CÁC TẬP TIN là “TẬP_TIN1 TẬP_TIN2” hoặc “THƯ_MỤC1 THƯ_MỤC2” hoặc “THƯ_MỤC " +"TẬP_TIN” hay “TẬP_TIN THƯ_MỤC”." + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "" +"Nếu đưa ra tùy chọn --from-file (từ tập tin) hay --to-file (vào tập tin) thì " +"không có giới hạn TẬP TIN." + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "Nếu TẬP-TIN là “-”, thì đọc từ đầu vào tiêu chuẩn." + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "Cách dùng: %s [TÙY_CHỌN]… CÁC_TẬP_TIN\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "So sánh các TẬP-TIN theo từng dòng." + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "tùy chọn %s xung đột, giá trị “%s”" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "nhiều tùy chọn điều khiển định dạng xuất xung đột với nhau" + +#: src/diff.c:1058 +#, c-format +msgid "invalid color '%s'" +msgstr "màu không hợp lệ “%s”" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "Chỉ trong %s: %s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "không thể so sánh “-” với một thư mục" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "không hỗ trợ tùy chọn -D với thư mục" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "Thư mục con chung: %s và %s\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "Tập tin %s là một %s trong khi tập tin %s là một %s.\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "Hai liên kết mềm %s và %s là khác nhau\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "Cả %s và %s là cùng một tập tin\n" + +# Tên họ +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "Randy Smith" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "nhiều tùy chọn không tương thích với nhau" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "đã chỉ ra “-” cho nhiều hơn một tập tin đầu vào" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "đọc gặp lỗi" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "" +"-A, --show-all kết xuất tất cả thay đổi, đặt mọi xung đột trong " +"ngoặc đơn" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed kết xuất script ed những thay đổi hợp nhất\n" +" từ TẬP_TIN_CŨ thành TẬP_TIN_CỦA_BẠN vào " +"TẬP_TIN_TÔI." + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "" +"-E, --show-overlap giống -e, nhưng đặt xung đột trong ngoặc đơn" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3, --easy-only giống -e, nhưng chỉ sát nhập những thay đổi " +"không chồng lấp" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "" +"-x, --overlap-only giống -e, nhưng chỉ sát nhập những thay đổi bị " +"chồng lấp" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" +"-X giống -x, nhưng đặt xung đột trong ngoặc đơn" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "" +"-i nối thêm hai lệnh “w” và “q” vào văn lệnh ed" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" +"-m, --merge kết xuất tập tin đã thực tế được hòa trộn, tuân " +"theo\n" +" tùy chọn -A nếu như không có tùy chọn khác " +"được chỉ ra" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a, --text coi mọi tập tin là văn bản thường" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr cắt bỏ ký tự về đầu dòng (cr) theo sau khi nhập" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "" +"-T, --initial-tab tạo khoảng tab cho dòng bằng cách thêm một tab " +"vào trước" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=CHƯƠNG_TRÌNH dùng CHƯƠNG_TRÌNH để so sánh các tập tin" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" +"-L, --label=NHÃN sử dụng NHÃN thay vì tên tập tin\n" +" (có thể lặp lại đến ba lần)" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help hiển thị trợ giúp này rồi thoát" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version đưa ra thông tin phiên bản rồi thoát" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "Cách dùng: %s [TÙY_CHỌN]… TẬP_TIN_TÔI TẬP_TIN_CŨ TẬP_TIN_BẠN\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "So sánh ba tập tin từng dòng một." + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" +"\n" +"Định dạng kết xuất mặc định là hơi khó để con người có thể đọc được\n" +"các thay đổi là gì.\n" +"\n" +"Tùy chọn -e, -E, -x, -X (tương ứng với dạng dài) là căn nguyên kết xuất " +"dạng\n" +"bó lệnh ed thay vì kiểu mặc định.\n" +"\n" +"Cuối cùng, tùy chọn -m (--merge) là căn nguyên diff3 thực hiện việc trộn từ " +"nội tại\n" +"và kết xuất là tập tin đã được trộn. Với kiểu đầu vào ít dùng, đây là cách\n" +"hợp lý hơn sử dụng ed.\n" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "" +"Trạng thái thoát là số 0 nếu thành công, số 1 nếu có xung đột nào và số 2 " +"nếu gặp lỗi." + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "gặp lỗi nội bộ: không định dạng khối khác biệt được." + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s: diff gặp lỗi: " + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "" +"gặp lỗi nội bộ: loại khác biệt không hợp lệ trong process_diff (xử lý khác " +"biệt)" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "khuôn dạng diff không hợp lệ; ký tự ngăn cách thay đổi không hợp lê" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "khuôn dạng diff không hợp lệ; chưa xong dòng cuối cùng" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "không gọi được chương trình phụ trợ “%s”" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "khuôn dạng khác biệt không hợp lệ; ký tự đi trước dòng là không đúng" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "gặp lỗi nội bộ: kiểu diff không hợp lệ được chuyển qua cho kết xuất" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "tập tin đầu vào co lại" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "không so sánh được hai tập tin “%s” và “%s”" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s: vòng lặp thư mục đệ quy" + +# Tên họ +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "Thomas Lord" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "" +"-o, --output=TẬP_TIN Thực hiện một cách tương tác, gửi kết xuất ra " +"TẬP-TIN" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i, --ignore-case coi chữ HOA và thường là như nhau" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "-E, --ignore-tab-expansion bỏ qua mọi thay đổi do mở rộng tab" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space bỏ qua tất cả dấu cách ở cuối dòng" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change bỏ qua thay đổi gây ra bởi nhóm dấu cách" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space bỏ qua tất cả dấu cách" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "-B, --ignore-blank-lines bỏ qua thay đổi do đó là dòng trống" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=RE bỏ qua thay đổi do mà mọi dòng khớp với RE" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "" +" --strip-trailing-cr cắt bỏ ký tự về đầu dòng (cr) theo sau khi gõ" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a, --text coi mọi tập tin là văn bản thường" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "" +"-w, --width=SỐ kết xuất nhiểu nhất là SỐ cột (mặc định là 130)" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "" +"-l, --left-column kết xuất chỉ cột bên trái của các dòng chung " +"nhau" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines không kết xuất các dòng chung nhau" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "" +"-t, --expand-tabs khai triển ký tự tab thành các khoảng trắng\n" +" khi kết xuất" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "" +" --tabsize=SỐ điểm đừng tab sau mỗi SỐ cột đã in ra (mặc định " +"là 8)" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal cố tìm một thay đổi nhỏ" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files giả sử tập tin lớn, nhiều thay đổi nhỏ rải rác" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "" +" --diff-program=CHƯƠNG_TRÌNH sử dụng CHƯƠNG_TRÌNH ấy để so sánh các tập " +"tin" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help hiển thị trợ giúp này rồi thoát" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v, --version đưa ra thông tin phiên bản rồi thoát" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "Cách dùng: %s [TÙY_CHỌN]… TẬP_TIN1 TẬP_TIN2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "Hòa trộn những khác biệt TẬP_TIN1 VÀ TẬP_TIN2 cạnh nhau." + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "không hợp nhất được dữ liệu gõ chuẩn một cách tương tác" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "cả hai tập tin dùng để so sánh đều là thư mục" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\tSửa rồi sử dụng cả hai phiên bản; mỗi cái gắn thêm phần đầu.\n" +"eb:\tSửa rồi sử dụng cả hai phiên bản.\n" +"el hay e1:\tSửa rồi sử dụng phiên bản bên trái.\n" +"er hay e2:\tSửa rồi sử dụng phiên bản bên phải.\n" +"e:\tHủy cả hai phiên bản rồi sửa một phiên bản mới.\n" +"l hay 1:\tSử dụng phiên bản bên trái.\n" +"r hay 2:\tSử dụng phiên bản bên phải.\n" +"s:\tBao gồm dòng chung nhưng không xuất chi tiết.\n" +"v:\tBao gồm dòng chung xuất một cách chi tiết.\n" +"q:\tThoát.\n" + +#: src/util.c:662 +#, c-format +msgid "unrecognized prefix: %s" +msgstr "không hiểu tiền tố: %s" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "không thể phân tích giá trị cho --palette" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s: tùy chọn “--%s” không cho phép đối số\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s: không nhận ra tùy chọn “--%s”\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s: tùy chọn “-W %s” chưa rõ ràng\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s: tùy chọn “-W %s” không cho phép đối số\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s: tùy chọn “-W %s” yêu cầu một đối số\n" + +#~ msgid " or 'auto' (the default)" +#~ msgstr " hay 'auto' (mặc định)" + +#~ msgid "" +#~ " --palette=PALETTE specify the colors to use when --color is active" +#~ msgstr "" +#~ " --palette=PALETTE chỉ định các màu sẽ dùng khi --color được kích " +#~ "hoạt" + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i SỐ1:SỐ2 --ignore-initial=SỐ1:SỐ2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "" +#~ "-s --quiet --silent Không xuất gì; chỉ hiển thị tính trạng thoát thôi " +#~ "(_im_)." + +#~ msgid "--help Output this help." +#~ msgstr "--help Xuất _trợ giúp_ này." + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ " -c -C SỐ \t--context[=SỐ] \tXuất SỐ dòng của _ngữ cảnh_ đã sao " +#~ "chép.\n" +#~ " -u -U SỐ \t--unified[=SỐ] \tXuất SỐ dòng của ngữ cảnh _đã thống " +#~ "nhất_.\n" +#~ " \t\t\t--label NHÃN \tSử dụng NHÃN thay thế tên tập tin.\n" +#~ " -p \t\t--show-c-function \t_Hiển thị chức năng C_ của mỗi thay đổi.\n" +#~ " -F RE --show-function-line=RE \n" +#~ "\t\t\t_Hiển thị dòng_ gần đây nhất mà khớp với RE (_chức năng_)." + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ " -y \t--side-by-side \tXuất hai cột (_cạnh nhau_).\n" +#~ " -W SỐ \t--width=SỐ \t\tXuất tối đa SỐ cột dữ liệu đã in ra (mặc định " +#~ "là 130)\n" +#~ "\t\t\t\t\t\t\t\t(_độ rộng_).\n" +#~ " \t\t--left-column \tXuất chỉ _cột bên trái_ của dòng chung.\n" +#~ " \t\t--suppress-common-lines \tKhông xuất dòng chung." + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "" +#~ "--speed-large-files Giả định _tập tin lớn_ và nhiều thay đổi nhỏ rải rác " +#~ "(_tốc độ_)." + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "" +#~ "-X Xuất những thay đổi chồng lấp, cũng đặt mọi điều xung đột trong ngoặc " +#~ "đơn." + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "" +#~ "-m --merge Xuất tập tin đã _hợp nhất_ thay thế tập lệnh loại ed (mặc " +#~ "định là -A)." + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "-L NHÃN --label=NHÃN Sử dụng NHÃN thay thế tên tập tin." diff --git a/local/recipes/tools/diffutils/source/po/zh_CN.gmo b/local/recipes/tools/diffutils/source/po/zh_CN.gmo new file mode 100644 index 0000000000..f0f643e626 Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/zh_CN.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/zh_CN.po b/local/recipes/tools/diffutils/source/po/zh_CN.po new file mode 100644 index 0000000000..55d35a9171 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/zh_CN.po @@ -0,0 +1,1529 @@ +# Chinese (simplified) translation for diffutils +# Copyright (C) 2004, 2013 Free Software Foundation, Inc. +# This file is distributed under the same license as the diffutils package. +# Yingxin Zhou <eerd003@dlut.edu.cn>, 2004. +# Anthony Fok <foka@debian.org>, 2013. +# Mingye Wang (Arthur2e5) <arthur200126@gmail.com>, 2016. +# +msgid "" +msgstr "" +"Project-Id-Version: diffutils 3.3-pre1\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2016-02-17 19:23+0100\n" +"Last-Translator: Mingye Wang (Arthur2e5) <arthur200126@gmail.com>\n" +"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 1.8.7\n" + +#: lib/argmatch.c:134 +#, fuzzy, c-format +msgid "invalid argument %s for %s" +msgstr "无效的 %s%s 参数 “%s”" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "" + +#: lib/argmatch.c:154 +#, fuzzy +msgid "Valid arguments are:" +msgstr "无效的 %s%s 参数 “%s”" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "程序错误" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "栈溢出" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "未知的系统错误" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "常规空文件" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "常规文件" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "目录" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "符号链接" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "消息队列" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "信号量" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "共享内存目标" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "分类内存目标" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "特殊块文件" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "特殊字符文件" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "有名管道" + +#: lib/file-type.c:78 +msgid "door" +msgstr "" + +#: lib/file-type.c:81 +#, fuzzy +msgid "multiplexed block special file" +msgstr "特殊块文件" + +#: lib/file-type.c:84 +#, fuzzy +msgid "multiplexed character special file" +msgstr "特殊字符文件" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "" + +#: lib/file-type.c:90 +#, fuzzy +msgid "named file" +msgstr "奇怪的文件" + +#: lib/file-type.c:93 +#, fuzzy +msgid "network special file" +msgstr "特殊块文件" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "" + +#: lib/file-type.c:102 +msgid "port" +msgstr "" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "套接字" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "奇怪的文件" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s:选项 “-W %s” 意义不明确\n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s:选项 “%s” 意义不明确;可能性如下:" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s:选项 “%c%s” 无法识别\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s:选项 “%c%s” 不接受参数\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s:选项 “%s” 需要一个参数\n" + +#: lib/getopt.c:621 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s:无效选项 -- “%c”\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s:选项需要一个参数 -- “%c”\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "“" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "”" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "成功" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "没有匹配" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "无效的正则表达式" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "无效的对照字符" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "无效的字符种类名称" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "末端有多余的反斜号" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "无效的向后引用" + +#: lib/regcomp.c:156 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "没有匹配的 [ 或 [^" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "没有匹配的 ( 或 \\(" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "没有匹配的 \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "\\{\\} 中的内容无效" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "范围末端字符无效" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "内存耗尽" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "无效的前导正则表达式" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "正则表达式过旱结束" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "正则表达式过大" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "没有匹配的 ) 或 \\)" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "之前没有任何正则表达式" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "内存耗尽" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "标准输入" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "标准输出" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "标准错误" + +#: lib/xfreopen.c:38 +msgid "unknown stream" +msgstr "未知流" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "未能以模式 %2$s 重打开 %1$s" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "无效的 %s%s 参数 “%s”" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "在 %s%s 的参数 “%s” 中有无效的后缀" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "%s %s 参数 “%s” 太大" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "由 %s 打包 (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "由 %s 打包\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"许可证:GPLv3+:GNU 通用公共许可证第 3 版或更新版本<http://gnu.org/licenses/" +"gpl.html>。\n" +"本软件是自由软件:您可以自由修改和重新发布它。\n" +"在法律允许的范围内没有其他保证。\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "作者:%s。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "作者:%s 和 %s。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "作者:%s、%s 和 %s。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"作者:%s、%s、%s\n" +"   和 %s。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"作者:%s、%s、%s、\n" +"   %s 和 %s。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"作者:%s、%s、%s、\n" +"   %s、%s 和 %s。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"作者:%s、%s、%s、\n" +"   %s、%s、%s 和 %s。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"作者:%s、%s、%s、\n" +"   %s、%s、%s、%s\n" +"   和 %s。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"作者:%s、%s、%s、\n" +"   %s、%s、%s、%s、\n" +"   %s 和 %s。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"作者:%s、%s、%s、\n" +"   %s、%s、%s、%s、\n" +"   %s、%s 和其他人。\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"报告程序错误到: %s\n" +"报告翻译错误到: https://translationproject.org/teams/zh_CN.html\n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "" +"报告 %1$s 程序错误到: %2$s\n" +"报告 %1$s 翻译错误到: https://translationproject.org/teams/zh_CN.html\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s 主页: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "%s 主页: <http://www.gnu.org/software/%s/>\n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "使用 GNU 软件的通用帮助:<http://www.gnu.org/gethelp/>\n" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "文件 %s 和 %s 不同\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "二进制文件 %s 和 %s 不同\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "文件尾没有换行符" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, c-format +msgid "Try '%s --help' for more information." +msgstr "请尝试 “%s --help”,以获得更多信息。" + +#: src/cmp.c:137 +#, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "无效的 --ignore-initial 值 “%s”" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "选项 -l 和 -s 不兼容" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "写入失败" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "标准输出" + +#: src/cmp.c:161 +msgid "-b, --print-bytes print differing bytes" +msgstr "-b --print-bytes 打印出内容相异的字节" + +#: src/cmp.c:162 +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "-i, --ignore-initial=SKIP 两个输入内容都略过前 SKIP 字节" + +#: src/cmp.c:163 +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr "" +"-i, --ignore-initial=跳1:跳2 略过 <文件1> 的前 <跳1> 个字节和文件 <文件" +"2>\n" +" 的前 <跳2> 个字节。" + +#: src/cmp.c:165 +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "-l, --verbose 输出所有相异字节的字节数和内容" + +#: src/cmp.c:166 +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n, --bytes=限制 最多比较 <限制> 个字节" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr " --help 显示此帮助信息并退出" + +#: src/cmp.c:169 +msgid "-v, --version output version information and exit" +msgstr "-v, --version 输出版本信息并退出" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "用法: %s [选项]... 文件1 [文件2 [跳1 [跳2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "逐字节比较两个文件。" + +#: src/cmp.c:182 +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "<跳1> 和 <跳2> 分别是每个文件要略过的字节数。" + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "长选项的必需参数也是相应短选项的必需参数。\n" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"<跳> 值可以加上以下的单位:\n" +"kB=1,000、K=1,024、MB=1,000,000、M=1,048,576、GB=1,000,000,000、" +"G=107,374,182,\n" +"还有 T、P、E、Z、Y,如此类推。" + +#: src/cmp.c:194 +msgid "If a FILE is '-' or missing, read standard input." +msgstr "如果文件是 “-” 或没给出,则从标准输入读入内容。" + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "如果输入相同,则退出状态为 0;1 表示输入不同;2 表示有错误产生。" + +#: src/cmp.c:240 +#, c-format +msgid "invalid --bytes value '%s'" +msgstr "无效的 --bytes 值 `%s'" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, c-format +msgid "missing operand after '%s'" +msgstr "操作数 “%s” 后缺少参数" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, c-format +msgid "extra operand '%s'" +msgstr "多余的操作数 “%s”" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s 不同:第 %s 字节,第 %s 行\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%1$s %2$s 不同:第 %4$s 行,第 %3$s 字节为 %5$3o %6$s %7$3o %8$s\n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp:%s 已结束\n" + +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s %s 不同:第 %s 字节,第 %s 行\n" + +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s %s 不同:第 %s 字节,第 %s 行\n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp:%s 已结束\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "理查德·斯托曼" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "" + +#: src/diff.c:353 +#, c-format +msgid "invalid context length '%s'" +msgstr "无效的上下文行数 “%s”" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "此系统不支持分页" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "过多的文件标号选项" + +#: src/diff.c:528 +#, c-format +msgid "invalid width '%s'" +msgstr "无效的宽度 “%s”" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "宽度选项冲突" + +#: src/diff.c:557 +#, c-format +msgid "invalid horizon length '%s'" +msgstr "无效的水平长度 “%s”" + +#: src/diff.c:613 +#, c-format +msgid "invalid tabsize '%s'" +msgstr "无效的制表符宽度 “%s”" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "的制表符选项冲突" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "同时指定了选项 --from-file 和 --to-file" + +#: src/diff.c:891 +msgid " --normal output a normal diff (the default)" +msgstr " --normal 以正常的 diff 方式输出 (默认)" + +#: src/diff.c:892 +msgid "-q, --brief report only when files differ" +msgstr "-q, --brief 只有在文件不同时报告" + +#: src/diff.c:893 +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s, --report-identical-files 当两个一样时仍然显示结果" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" + +#: src/diff.c:895 +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "-u, -U 数量, --unified[=数量] 输出 <数量>(默认为 3)行一致化上下文" + +#: src/diff.c:896 +msgid "-e, --ed output an ed script" +msgstr "-e, --ed 以 ed script 方式输出" + +#: src/diff.c:897 +msgid "-n, --rcs output an RCS format diff" +msgstr "-n, --rcs 以 RCS diff 格式输出" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "" + +#: src/diff.c:899 +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "-W, --width=数量 每行显示最多 <数量>(默认 130)个字符" + +#: src/diff.c:900 +msgid "" +" --left-column output only the left column of common lines" +msgstr " --left-column 当有两行相同时只显示左边栏的一行" + +#: src/diff.c:901 +msgid " --suppress-common-lines do not output common lines" +msgstr " --suppress-common-lines 当有两行相同时不显示" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" + +#: src/diff.c:905 +#, fuzzy +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" +" --from-file=文件1 将<文件1>和操作数中的所有文件/目录作比较;\n" +" <文件1>可以是目录" + +#: src/diff.c:908 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs 将输出中的 tab 转换成空格" + +#: src/diff.c:909 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T, --initial-tab 每行先加上 tab 字符,使 tab 字符可以对齐" + +#: src/diff.c:910 +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr " --tabsize=数字 TAB 格的宽度,默认为 8 个打印列宽" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" + +#: src/diff.c:912 +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "-l, --paginate 将输出送至 “pr” 指令来分页" + +#: src/diff.c:914 +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "-r, --recursive 连同所有子目录一起比较" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr "" + +#: src/diff.c:916 +msgid "-N, --new-file treat absent files as empty" +msgstr "-N, --new-file 不存在的文件以空文件方式处理" + +#: src/diff.c:917 +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr " --unidirectional-new-file 若第一文件不存在,以空文件处理" + +#: src/diff.c:918 +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr " --ignore-file-name-case 忽略文件名大小写的区别" + +#: src/diff.c:919 +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr " --no-ignore-file-name-case 不忽略文件名大小写的区别" + +#: src/diff.c:920 +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "-x, --exclude=模式 排除匹配 <模式> 的文件" + +#: src/diff.c:921 +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "-X, --exclude-from=文件 排除所有匹配在<文件>中列出的模式的文件" + +#: src/diff.c:922 +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "-S, --starting-file=文件 当比较目录時,由<文件>开始比较" + +#: src/diff.c:923 +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +" --from-file=文件1 将<文件1>和操作数中的所有文件/目录作比较;\n" +" <文件1>可以是目录" + +#: src/diff.c:925 +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +" --to-file=文件2 将操作数中的所有文件/目录和<文件2>作比较;\n" +" <文件2>可以是目录" + +#: src/diff.c:928 +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "-i, --ignore-case 忽略文件内容大小写的区别" + +#: src/diff.c:929 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "-E, --ignore-tab-expansion 忽略由制表符宽度造成的差异" + +#: src/diff.c:930 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space 忽略每行末端的空格" + +#: src/diff.c:931 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change 忽略由空格数不同造成的差异" + +#: src/diff.c:932 +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w, --ignore-all-space 忽略所有空格" + +#: src/diff.c:933 +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "-B, --ignore-blank-lines 忽略任何因空行而造成的差异" + +#: src/diff.c:934 +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I, --ignore-matching-lines=正则 若某行完全匹配 <正则>,则忽略由该行造成的差" +"异" + +#: src/diff.c:936 +msgid "-a, --text treat all files as text" +msgstr "-a, --text 所有文件都以文本方式处理" + +#: src/diff.c:937 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr 去除输入内容每行末端的回车(CR)字符" + +#: src/diff.c:939 +msgid " --binary read and write data in binary mode" +msgstr " --binary 以二进制方式读写数据" + +#: src/diff.c:942 +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "" +"-D, --ifdef=名称 输出的内容以 ‘#ifdef <名称>’ 方式标明差异" + +#: src/diff.c:943 +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr " --GTYPE-group-format=GFMT 以 GFMT 格式处理 GTYPE 输入行组" + +#: src/diff.c:944 +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr " --line-format=LFMT 以 LFMT 格式处理每一行资料" + +#: src/diff.c:945 +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr " --LTYPE-line-format=LFMT 以 LFMT 格式处理 LTYPE 输入的行" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" + +#: src/diff.c:948 +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE 可以是 “old”、“new” 或 “unchanged”。GTYPE 可以是 LTYPE 的选择\n" +" 或是 “changed”。" + +#: src/diff.c:949 +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +"(仅)GFMT 可包括:\n" +" %< 该组中每行属于<文件1>的差异\n" +" %> 该组中每行属于<文件2>的差异\n" +" %= 该组中同时在<文件1>和<文件2>出现的每一行\n" +" %[-][宽度][.[精确度]]{doxX}字符 以 printf 格式表示该<字符>代表的内容\n" +" 大写<字符>表示属于新的文件,小写表示属于旧的文件。<字符>的意义如下:\n" +" F 行组中第一行的行号\n" +" L 行组中最后一行的行号\n" +" N 行数 ( =L-F+1 )\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) 如果 A 等于 B 那么 T 否则 E" + +#: src/diff.c:961 +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +"(仅)LFMT 可包括:\n" +" %L 该行的内容\n" +" %l 该行的内容,但不包括结束的换行符\n" +" %[-][宽度][.[精确度]]{doxX}n 以 printf 格式表示的输入行号" + +#: src/diff.c:965 +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" GFMT 或 LFMT 都可包括:\n" +" %% %\n" +" %c'C' 单个字符 C\n" +" %c'\\OOO' 八进制码 OOO 所代表的字符\n" +" C 字符 C(处上述转义外的其他字符代表它们自身)" + +#: src/diff.c:971 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal 尽可能找出最小的差异。" + +#: src/diff.c:972 +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr " --horizon-lines=数量 保持<数量>行的一致前后缀" + +#: src/diff.c:973 +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr " --speed-large-files 假设文件十分大而且文件中含有许多微小的差异" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr " --help 显示此帮助信息并退出" + +#: src/diff.c:980 +msgid "-v, --version output version information and exit" +msgstr "-v, --version 输出版本信息并退出" + +#: src/diff.c:982 +#, fuzzy +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"<文件们> 的格式可以是‘文件1 文件2’、‘目录1 目录2’、‘目录 文件...’或\n" +" ‘文件... 目录’。" + +#: src/diff.c:983 +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "如果使用 --from-file 或 --to-file 选项,<文件名> 的格式则不受限制。" + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +msgid "If a FILE is '-', read standard input." +msgstr "如果 FILE 是 “-”,则由标准输入读取内容。" + +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "用法:%s [选项]... 文件们\n" + +#: src/diff.c:995 +msgid "Compare FILES line by line." +msgstr "逐行比较<文件们>。" + +#: src/diff.c:1029 +#, c-format +msgid "conflicting %s option value '%s'" +msgstr "互相冲突的 %s 选项,参数值为 “%s”" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "互相冲突的输出风格选项。" + +#: src/diff.c:1058 +#, fuzzy, c-format +msgid "invalid color '%s'" +msgstr "无效的宽度 “%s”" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "只在 %s 存在:%s\n" + +#: src/diff.c:1248 +msgid "cannot compare '-' to a directory" +msgstr "“-” 无法与目录作比较" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "-D 选项不支持目录使用" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "%s 和 %s 有共同的子目录\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "文件 %s 是%s而文件 %s 是%s\n" + +#: src/diff.c:1370 +#, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "软链接 %s 和 %s 不同\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "檔案 %s 和 %s 相同\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "不兼容的选项" + +#: src/diff3.c:391 +msgid "'-' specified for more than one input file" +msgstr "“-”作输入文件不可多于一处" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "读取时失败" + +#: src/diff3.c:475 +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "-A, --show-all 输出所有要更改的部份,并括上互相冲突的地方" + +#: src/diff3.c:477 +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e, --ed 取出由 <旧文件> 至 <你的文件> 的更改部份,并输出" +"可将此\n" +" 改变应用至 <我的文件> 的 ed 脚本" + +#: src/diff3.c:479 +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "-E, --show-overlap 类似 -e,但括上互相冲突的地方" + +#: src/diff3.c:480 +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "" +"-3, --easy-only 类似 -e,但只输出未合并而且不重叠的更改部份" + +#: src/diff3.c:481 +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "-x, --overlap-only 类似 -e,但只输出重叠的更改部份" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "-X 类似 -x,但括上互相冲突的地方" + +#: src/diff3.c:483 +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "-i 在 ed script 中附加‘w’和‘q’命令" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" + +#: src/diff3.c:488 +msgid "-a, --text treat all files as text" +msgstr "-a --text 所有文件都以文本方式处理" + +#: src/diff3.c:489 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr 去除输入内容每行末端的回车(CR)字符" + +#: src/diff3.c:490 +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T --initial-tab 每行先加上 tab 字符,使 tab 字符可以对齐" + +#: src/diff3.c:491 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=程序 用<程序>来比较文件" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr " --help 显示此帮助信息并退出" + +#: src/diff3.c:496 +msgid "-v, --version output version information and exit" +msgstr "-v, --version 输出版本信息并退出" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "用法:%s [选项]... 我的文件 旧文件 你的文件\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "逐行比较三个文件。" + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "退出状态为 0 表示成功,1 表示冲突,2 表示有错误发生。" + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "内部错误:diff 区段的格式出错" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s:diff 失败:" + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "内部错误:process_diff 中的 diff 类型无效" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "无效的 diff 格式;表示内容改变的分隔字符串无效" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "无效的 diff 格式;最后一行不完整" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "无法调用辅助程序 “%s”" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "无效的 diff 格式;错误的行前导字符" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "内部错误:传递给输出的 diff 类型无效" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "输入文件缩小" + +#: src/dir.c:156 +#, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "无法比较文件名 “%s” 和 “%s”" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "%s:递归目录循环" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "" + +#: src/sdiff.c:173 +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "-o, --output=文件 交互式操作,并将结果写入至<文件>" + +#: src/sdiff.c:175 +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i, --ignore-case 忽略大小写的区别。" + +#: src/sdiff.c:176 +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "-E, --ignore-tab-expansion 忽略由制表符宽度造成的差异" + +#: src/sdiff.c:177 +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-Z, --ignore-trailing-space 忽略行末的空格字符" + +#: src/sdiff.c:178 +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b, --ignore-space-change 忽略由空格数不同造成的差异" + +#: src/sdiff.c:179 +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W, --ignore-all-space 忽略所有空白字符" + +#: src/sdiff.c:180 +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "-B, --ignore-blank-lines 忽略任何因空行而造成的差异" + +#: src/sdiff.c:181 +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I, --ignore-matching-lines=正则 若某行完全匹配 <正则>,则忽略由该行造成的差" +"异" + +#: src/sdiff.c:182 +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr " --strip-trailing-cr 去除输入内容每行末端的回车(CR)字符" + +#: src/sdiff.c:183 +msgid "-a, --text treat all files as text" +msgstr "-a --text 所有文件都以文本方式处理" + +#: src/sdiff.c:185 +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "-W, --width=数量 每行显示最多 <数量>(默认 130)个字符" + +#: src/sdiff.c:186 +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "-l, --left-column 当有两行相同时只显示左栏的一行" + +#: src/sdiff.c:187 +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s, --suppress-common-lines 当有两行相同时不显示" + +#: src/sdiff.c:189 +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t, --expand-tabs 将输出中的 tab 转换成空格" + +#: src/sdiff.c:190 +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr " --tabsize=数字 TAB 格的宽度,默认为 8 个打印列宽" + +#: src/sdiff.c:192 +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d, --minimal 尽可能找出最小的差异集" + +#: src/sdiff.c:193 +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "" +"-H, --speed-large-files 假设文件十分大而且文件中含有许多微小的差异" + +#: src/sdiff.c:194 +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr " --diff-program=程序 用<程序>来比较文件" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr " --help 显示此帮助信息并退出" + +#: src/sdiff.c:197 +msgid "-v, --version output version information and exit" +msgstr "-v, --version 输出版本信息并退出" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "用法:%s [选项]... 文件1 文件2\n" + +#: src/sdiff.c:208 +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "以并排方式合并文件之间的差异。" + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "不允许以交互方式合并标准输入的内容" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "两个要被比较的文件都是目录" + +#: src/sdiff.c:818 +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:编辑然后同时使用两边的版本,各版本分别加上标头以识别。\n" +"eb:编辑然后同时使用两边的版本。\n" +"el 或 e1:编辑然后使用左边的版本。\n" +"er 或 e2:编辑然后使用右边的版本。\n" +"e :丢弃两者然后编辑新的版本。\n" +"l 或 1:使用左边的版本。\n" +"r 或 2:使用右边的版本。\n" +"s :加上两边一样的行时不在输出上显示。\n" +"v :加上两边一样的行时会在输出上显示。\n" +"q :退出。\n" + +#: src/util.c:662 +#, fuzzy, c-format +msgid "unrecognized prefix: %s" +msgstr "%s:选项 “--%s” 无法识别\n" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "" + +#, fuzzy +#~ msgid " or 'auto' (the default)" +#~ msgstr " --normal 以正常的 diff 方式输出 (默认)" + +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s:选项 “--%s” 不接受参数\n" + +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s:选项 “--%s” 无法识别\n" + +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s:选项 “-W %s” 意义不明确\n" + +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s:选项 “-W %s” 不接受参数\n" + +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s:选项 “%s” 需要一个参数\n" + +#~ msgid "%s: illegal option -- %c\n" +#~ msgstr "%s:非法选项 -- %c\n" + +#~ msgid "" +#~ "This is free software; see the source for copying conditions. There is " +#~ "NO\n" +#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR " +#~ "PURPOSE.\n" +#~ msgstr "" +#~ "本程序是自由软件;请参看源代码的版权声明。本软件不提供任何保证;\n" +#~ "即使是商业的或为某一专用目的适用性保证也没有。\n" + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "-s --quiet --silent 无任何输出;只产生退出状态。" + +#~ msgid "--help Output this help." +#~ msgstr "--help 输入本帮助。" + +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>." +#~ msgstr "请向 <bug-gnu-utils@gnu.org> 报告错误。" + +#~ msgid "`-%ld' option is obsolete; use `-%c %ld'" +#~ msgstr "“-%ld” 选项已过时;请使用 “-%c %ld”" + +#~ msgid "`-%ld' option is obsolete; omit it" +#~ msgstr "“-%ld” 选项已过时;忽略之" + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ "-c -C 行数 --context[=行数] 显示指定<行数>(默认 3 行)copied 格式的上下" +#~ "文\n" +#~ "-u -U 行数 --unified[=行数] 显示指定<行数>(默认 3 行)unified 格式的上下" +#~ "文\n" +#~ " --label 标识 使用<标识>代替文件名称。\n" +#~ " -p --show-c-function 显示和每个差异有关的 C 函数名称。\n" +#~ " -F RE --show-function-line=RE 显示最接近而符合<正则表示式>的一行。" + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ "-y --side-by-side 以两列并排的方式显示。\n" +#~ " -W NUM --width=NUM 每行显示最多 NUM (默认 130) 个字符。\n" +#~ " --left-column 当有两行相同时只显示左边的一行。\n" +#~ " --suppress-common-lines 当有两行相同时不会显示。" + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "--speed-large-files 假设文件十分大而且其中含有许多微小的差异。" + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "-X 输出重叠的更改部份,并加上括号。" + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "-m --merge 显示合并后的文件而不是 ed script (默认加上 -A)。" + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "-L 标识 --label=标识 以<标识>代替文件名称。" + +#~ msgid "subsidiary program `%s' not found" +#~ msgstr "找不到辅助程序 “%s”" + +#~ msgid "subsidiary program `%s' failed" +#~ msgstr "辅助程序 “%s” 调用失败" + +#~ msgid "subsidiary program `%s' failed (exit status %d)" +#~ msgstr "辅助程序 “%s” 调用失败(退出状态:%d)" diff --git a/local/recipes/tools/diffutils/source/po/zh_TW.gmo b/local/recipes/tools/diffutils/source/po/zh_TW.gmo new file mode 100644 index 0000000000..0a2ace880b Binary files /dev/null and b/local/recipes/tools/diffutils/source/po/zh_TW.gmo differ diff --git a/local/recipes/tools/diffutils/source/po/zh_TW.po b/local/recipes/tools/diffutils/source/po/zh_TW.po new file mode 100644 index 0000000000..f8649bb507 --- /dev/null +++ b/local/recipes/tools/diffutils/source/po/zh_TW.po @@ -0,0 +1,1640 @@ +# traditional Chinese translation of diffutils. +# Copyright (C) 2002, 2005 Free Software Foundation, Inc. +# Abel Cheung <maddog@linux.org.hk>, 2002, 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: diffutils 2.8.7\n" +"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n" +"POT-Creation-Date: 2017-05-21 13:26-0700\n" +"PO-Revision-Date: 2005-04-01 14:31+0800\n" +"Last-Translator: Abel Cheung <maddog@linux.org.hk>\n" +"Language-Team: Chinese (traditional) <zh-l10n@linux.org.tw>\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: lib/argmatch.c:134 +#, c-format +msgid "invalid argument %s for %s" +msgstr "" + +#: lib/argmatch.c:135 +#, c-format +msgid "ambiguous argument %s for %s" +msgstr "" + +#: lib/argmatch.c:154 +msgid "Valid arguments are:" +msgstr "" + +#: lib/c-stack.c:203 lib/c-stack.c:296 +msgid "program error" +msgstr "程式錯誤" + +#: lib/c-stack.c:204 lib/c-stack.c:297 +msgid "stack overflow" +msgstr "堆疊溢位" + +#: lib/error.c:195 +msgid "Unknown system error" +msgstr "不明的系統錯誤" + +#: lib/file-type.c:40 +msgid "regular empty file" +msgstr "普通空白檔案" + +#: lib/file-type.c:40 +msgid "regular file" +msgstr "普通檔案" + +#: lib/file-type.c:43 +msgid "directory" +msgstr "目錄" + +#: lib/file-type.c:46 +msgid "symbolic link" +msgstr "符號連結" + +#: lib/file-type.c:52 +msgid "message queue" +msgstr "訊息佇列" + +#: lib/file-type.c:55 +msgid "semaphore" +msgstr "semaphore" + +#: lib/file-type.c:58 +msgid "shared memory object" +msgstr "分享記憶物件" + +#: lib/file-type.c:61 +msgid "typed memory object" +msgstr "分類記憶物件" + +#: lib/file-type.c:66 +msgid "block special file" +msgstr "區塊特殊檔案" + +#: lib/file-type.c:69 +msgid "character special file" +msgstr "字元特殊檔案" + +#: lib/file-type.c:72 +msgid "contiguous data" +msgstr "" + +#: lib/file-type.c:75 +msgid "fifo" +msgstr "fifo" + +#: lib/file-type.c:78 +msgid "door" +msgstr "" + +#: lib/file-type.c:81 +#, fuzzy +msgid "multiplexed block special file" +msgstr "區塊特殊檔案" + +#: lib/file-type.c:84 +#, fuzzy +msgid "multiplexed character special file" +msgstr "字元特殊檔案" + +#: lib/file-type.c:87 +msgid "multiplexed file" +msgstr "" + +#: lib/file-type.c:90 +#, fuzzy +msgid "named file" +msgstr "不尋常的檔案" + +#: lib/file-type.c:93 +#, fuzzy +msgid "network special file" +msgstr "區塊特殊檔案" + +#: lib/file-type.c:96 +msgid "migrated file with data" +msgstr "" + +#: lib/file-type.c:99 +msgid "migrated file without data" +msgstr "" + +#: lib/file-type.c:102 +msgid "port" +msgstr "" + +#: lib/file-type.c:105 +msgid "socket" +msgstr "socket" + +#: lib/file-type.c:108 +msgid "whiteout" +msgstr "" + +#: lib/file-type.c:110 +msgid "weird file" +msgstr "不尋常的檔案" + +#: lib/getopt.c:278 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous\n" +msgstr "%s:選項‘%s’是不明確的\n" + +#: lib/getopt.c:284 +#, fuzzy, c-format +msgid "%s: option '%s%s' is ambiguous; possibilities:" +msgstr "%s:選項‘%s’是不明確的\n" + +#: lib/getopt.c:319 +#, fuzzy, c-format +msgid "%s: unrecognized option '%s%s'\n" +msgstr "%s:無法識別的選項‘%c%s’\n" + +#: lib/getopt.c:345 +#, fuzzy, c-format +msgid "%s: option '%s%s' doesn't allow an argument\n" +msgstr "%s:選項‘%c%s’不可配合參數使用\n" + +#: lib/getopt.c:360 +#, fuzzy, c-format +msgid "%s: option '%s%s' requires an argument\n" +msgstr "%s:選項‘%s’需要參數\n" + +#: lib/getopt.c:621 +#, fuzzy, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s:無效的選項 ─ %c\n" + +#: lib/getopt.c:636 lib/getopt.c:682 +#, fuzzy, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s:選項需要參數 ─ %c\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages> +#. and use glyphs suitable for your language. +#: lib/quotearg.c:362 +msgid "`" +msgstr "" + +#: lib/quotearg.c:363 +msgid "'" +msgstr "" + +#: lib/regcomp.c:135 +msgid "Success" +msgstr "成功" + +#: lib/regcomp.c:138 +msgid "No match" +msgstr "沒有符合的字串" + +#: lib/regcomp.c:141 +msgid "Invalid regular expression" +msgstr "不正確的正規表示式" + +#: lib/regcomp.c:144 +msgid "Invalid collation character" +msgstr "無效的 collation 字元" + +#: lib/regcomp.c:147 +msgid "Invalid character class name" +msgstr "無效的字元種類名稱" + +#: lib/regcomp.c:150 +msgid "Trailing backslash" +msgstr "末端有多餘的反斜號" + +#: lib/regcomp.c:153 +msgid "Invalid back reference" +msgstr "無效的 back reference" + +#: lib/regcomp.c:156 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "沒有對應的 [ 或 [^" + +#: lib/regcomp.c:159 +msgid "Unmatched ( or \\(" +msgstr "沒有對應的 ( 或 \\(" + +#: lib/regcomp.c:162 +msgid "Unmatched \\{" +msgstr "沒有對應的 \\{" + +#: lib/regcomp.c:165 +msgid "Invalid content of \\{\\}" +msgstr "\\{\\} 中的內容無效" + +#: lib/regcomp.c:168 +msgid "Invalid range end" +msgstr "範圍末端字元無效" + +#: lib/regcomp.c:171 +msgid "Memory exhausted" +msgstr "記憶體耗盡" + +#: lib/regcomp.c:174 +msgid "Invalid preceding regular expression" +msgstr "之前的正規表示式無效" + +#: lib/regcomp.c:177 +msgid "Premature end of regular expression" +msgstr "正規表示式過早結束" + +#: lib/regcomp.c:180 +msgid "Regular expression too big" +msgstr "正規表示式過長" + +#: lib/regcomp.c:183 +msgid "Unmatched ) or \\)" +msgstr "沒有對應的 ) 或 \\)" + +#: lib/regcomp.c:687 +msgid "No previous regular expression" +msgstr "之前沒有任何正規表示式" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "記憶體耗盡" + +#: lib/xfreopen.c:35 +msgid "stdin" +msgstr "" + +#: lib/xfreopen.c:36 +msgid "stdout" +msgstr "" + +#: lib/xfreopen.c:37 +msgid "stderr" +msgstr "" + +#: lib/xfreopen.c:38 +#, fuzzy +msgid "unknown stream" +msgstr "不明的系統錯誤" + +#: lib/xfreopen.c:39 +#, c-format +msgid "failed to reopen %s with mode %s" +msgstr "" + +#: lib/xstrtol-error.c:63 +#, fuzzy, c-format +msgid "invalid %s%s argument '%s'" +msgstr "無效的 --bytes 值 ‘%s’" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl." +"html>.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "由 %s 編寫。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "由 %s 和 %s 編寫。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "由 %s, %s 和 %s 編寫。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"由 %s, %s, %s\n" +"和 %s 編寫。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"由 %s, %s, %s,\n" +"%s 和 %s 編寫。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"由 %s, %s, %s,\n" +"%s, %s 和 %s 編寫。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"由 %s, %s, %s,\n" +"%s, %s, %s 和 %s 編寫。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"由 %s, %s, %s,\n" +"%s, %s, %s, %s\n" +"和 %s 編寫。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"由 %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s 和 %s 編寫。\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"由 %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s 和 %s 等等編寫。\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: <http://www.gnu.org/software/%s/>\n" +msgstr "" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n" +msgstr "" + +#: src/analyze.c:454 src/diff.c:1401 +#, c-format +msgid "Files %s and %s differ\n" +msgstr "檔案 %s 與 %s 不同\n" + +#: src/analyze.c:455 +#, c-format +msgid "Binary files %s and %s differ\n" +msgstr "二元碼檔 %s 與 %s 不同\n" + +#: src/analyze.c:706 src/diff3.c:1465 src/util.c:1254 +msgid "No newline at end of file" +msgstr "檔案末沒有 newline 字元" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:44 +msgid "Torbjorn Granlund" +msgstr "Torbjorn Granlund" + +#. This is a proper name. See the gettext manual, section Names. +#: src/cmp.c:45 +msgid "David MacKenzie" +msgstr "" + +#: src/cmp.c:119 src/diff.c:877 src/diff3.c:462 src/sdiff.c:159 +#, fuzzy, c-format +msgid "Try '%s --help' for more information." +msgstr "請嘗試‘%s --help’來獲取更多資訊。" + +#: src/cmp.c:137 +#, fuzzy, c-format +msgid "invalid --ignore-initial value '%s'" +msgstr "無效的 --ignore-initial 值 ‘%s’" + +#: src/cmp.c:147 +#, c-format +msgid "options -l and -s are incompatible" +msgstr "-l 和 -s 選項不兼容" + +#: src/cmp.c:155 src/diff.c:885 src/diff3.c:469 src/sdiff.c:167 src/sdiff.c:315 +#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:852 src/util.c:952 src/util.c:959 +msgid "write failed" +msgstr "寫入失敗" + +#: src/cmp.c:157 src/diff.c:887 src/diff.c:1466 src/diff3.c:471 src/sdiff.c:169 +msgid "standard output" +msgstr "標準輸出" + +#: src/cmp.c:161 +#, fuzzy +msgid "-b, --print-bytes print differing bytes" +msgstr "-b --print-bytes 印出相異位置的位元組。" + +#: src/cmp.c:162 +#, fuzzy +msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs" +msgstr "-i SKIP --ignore-initial=SKIP 略過輸入資料的最初 SKIP 個位元組。" + +#: src/cmp.c:163 +#, fuzzy +msgid "" +"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" +" first SKIP2 bytes of FILE2" +msgstr " 略過 FILE1 的最初 SKIP1 個位元組和 FILE2 的最初 SKIP2 個位元組。" + +#: src/cmp.c:165 +#, fuzzy +msgid "" +"-l, --verbose output byte numbers and differing byte values" +msgstr "-l --verbose 顯示兩者所有相異的位置和它們的位元組數值。" + +#: src/cmp.c:166 +#, fuzzy +msgid "-n, --bytes=LIMIT compare at most LIMIT bytes" +msgstr "-n LIMIT --bytes=LIMIT 最多比較 LIMIT 個位元組。" + +#: src/cmp.c:167 +msgid "-s, --quiet, --silent suppress all normal output" +msgstr "" + +#: src/cmp.c:168 +msgid " --help display this help and exit" +msgstr "" + +#: src/cmp.c:169 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "-v --version 顯示版本資訊。" + +#: src/cmp.c:178 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n" +msgstr "用法:%s [選項]... 檔案1 [檔案2 [SKIP1 [SKIP2]]]\n" + +#: src/cmp.c:180 +msgid "Compare two files byte by byte." +msgstr "比較兩個檔案的每一個位元組。" + +#: src/cmp.c:182 +#, fuzzy +msgid "" +"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" +"at the beginning of each file (zero by default)." +msgstr "SKIP1 和 SKIP2 是每個檔案會略過的位元組數目。" + +#: src/cmp.c:185 src/diff.c:997 src/diff3.c:509 src/sdiff.c:210 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" + +#: src/cmp.c:191 +msgid "" +"SKIP values may be followed by the following multiplicative suffixes:\n" +"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y." +msgstr "" +"SKIP 值可以加上以下的單位:\n" +"kB=1000、K=1024、MB=1000000、M=1048576、GB=1000000000、G=1073741824,\n" +"還有 T、P、E、Z、Y 如此類推。" + +#: src/cmp.c:194 +#, fuzzy +msgid "If a FILE is '-' or missing, read standard input." +msgstr "如果檔案是‘-’或沒有指定,則由標準輸入讀入資料。" + +#: src/cmp.c:195 src/diff.c:985 src/sdiff.c:220 +msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble." +msgstr "如果兩邊內容一樣,回傳值是 0;1 代表兩邊內容不相同,2 代表有錯誤。" + +#: src/cmp.c:240 +#, fuzzy, c-format +msgid "invalid --bytes value '%s'" +msgstr "無效的 --bytes 值 ‘%s’" + +#: src/cmp.c:266 src/diff.c:795 src/diff3.c:356 src/sdiff.c:565 +#, fuzzy, c-format +msgid "missing operand after '%s'" +msgstr "‘%s’後缺少了參數" + +#: src/cmp.c:278 src/diff.c:797 src/diff3.c:358 src/sdiff.c:567 +#, fuzzy, c-format +msgid "extra operand '%s'" +msgstr "多餘的參數‘%s’" + +#: src/cmp.c:498 +#, c-format +msgid "%s %s differ: byte %s, line %s\n" +msgstr "%s %s 不同:第 %s 位元組,第 %s 行\n" + +#: src/cmp.c:514 +#, c-format +msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n" +msgstr "%s %s 不同:第 %s 行,第 %s 位元組為 %3o %s %3o %s\n" + +#: src/cmp.c:571 +#, fuzzy, c-format +msgid "cmp: EOF on %s which is empty\n" +msgstr "cmp:%s 已結束\n" + +#: src/cmp.c:585 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, line %s\n" +msgstr "%s %s 不同:第 %s 位元組,第 %s 行\n" + +#: src/cmp.c:586 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s, in line %s\n" +msgstr "%s %s 不同:第 %s 位元組,第 %s 行\n" + +#: src/cmp.c:592 +#, fuzzy, c-format +msgid "cmp: EOF on %s after byte %s\n" +msgstr "cmp:%s 已結束\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:50 +msgid "Paul Eggert" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:51 +msgid "Mike Haertel" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:52 +msgid "David Hayes" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:53 +msgid "Richard Stallman" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff.c:54 +msgid "Len Tower" +msgstr "" + +#: src/diff.c:353 +#, fuzzy, c-format +msgid "invalid context length '%s'" +msgstr "無效的上下文行數‘%s’" + +#: src/diff.c:436 +#, c-format +msgid "pagination not supported on this host" +msgstr "此系統不支援分頁" + +#: src/diff.c:451 src/diff3.c:336 +#, c-format +msgid "too many file label options" +msgstr "太多有關檔案標籤的選項" + +#: src/diff.c:528 +#, fuzzy, c-format +msgid "invalid width '%s'" +msgstr "無效的寬度‘%s’" + +#: src/diff.c:532 +msgid "conflicting width options" +msgstr "出現互相抵觸的寬度選項" + +#: src/diff.c:557 +#, fuzzy, c-format +msgid "invalid horizon length '%s'" +msgstr "無效的水平長度 ‘%s’" + +#: src/diff.c:613 +#, fuzzy, c-format +msgid "invalid tabsize '%s'" +msgstr "無效的定位字元寬度 ‘%s’" + +#: src/diff.c:617 +msgid "conflicting tabsize options" +msgstr "出現互相抵觸的定位字元寬度選項" + +#: src/diff.c:772 +msgid "--from-file and --to-file both specified" +msgstr "同時指定了 --from-file 及 --to-file 選項" + +#: src/diff.c:891 +#, fuzzy +msgid " --normal output a normal diff (the default)" +msgstr "--normal 以正常的 diff 方式輸出。" + +#: src/diff.c:892 +#, fuzzy +msgid "-q, --brief report only when files differ" +msgstr "-q --brief 只顯示檔案是否不同。" + +#: src/diff.c:893 +#, fuzzy +msgid "-s, --report-identical-files report when two files are the same" +msgstr "-s --report-identical-files 當兩個檔案一樣時仍然顯示結果。" + +#: src/diff.c:894 +msgid "" +"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context" +msgstr "" + +#: src/diff.c:895 +#, fuzzy +msgid "" +"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context" +msgstr "-w NUM --width=NUM 每行顯示最多 NUM(預設 130)個字元。" + +#: src/diff.c:896 +#, fuzzy +msgid "-e, --ed output an ed script" +msgstr "-e --ed 以 ed script 方式輸出。" + +#: src/diff.c:897 +#, fuzzy +msgid "-n, --rcs output an RCS format diff" +msgstr "-n --rcs 以 RCS diff 格式輸出。" + +#: src/diff.c:898 +msgid "-y, --side-by-side output in two columns" +msgstr "" + +#: src/diff.c:899 +#, fuzzy +msgid "" +"-W, --width=NUM output at most NUM (default 130) print columns" +msgstr "-w NUM --width=NUM 每行顯示最多 NUM(預設 130)個字元。" + +#: src/diff.c:900 +#, fuzzy +msgid "" +" --left-column output only the left column of common lines" +msgstr "-l --left-column 當有兩行相同時只顯示左邊的一行。" + +#: src/diff.c:901 +#, fuzzy +msgid " --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines 當有兩行相同時不會顯示。" + +#: src/diff.c:903 +msgid "-p, --show-c-function show which C function each change is in" +msgstr "" + +#: src/diff.c:904 +msgid "-F, --show-function-line=RE show the most recent line matching RE" +msgstr "" + +#: src/diff.c:905 +msgid "" +" --label LABEL use LABEL instead of file name and timestamp\n" +" (can be repeated)" +msgstr "" + +#: src/diff.c:908 +#, fuzzy +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t --expand-tabs 將輸出中的 tab 換成空格。" + +#: src/diff.c:909 +#, fuzzy +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T --initial-tab 每行先加上 tab 字元,使 tab 字元可以對齊。" + +#: src/diff.c:910 +#, fuzzy +msgid "" +" --tabsize=NUM tab stops every NUM (default 8) print columns" +msgstr "--tabsize=NUM 定位字元 (tab) 的寬度,預設為 8 個空格。" + +#: src/diff.c:911 +msgid "" +" --suppress-blank-empty suppress space or tab before empty output lines" +msgstr "" + +#: src/diff.c:912 +#, fuzzy +msgid "-l, --paginate pass output through 'pr' to paginate it" +msgstr "-l --paginate 將輸出送至‘pr’指令來分頁。" + +#: src/diff.c:914 +#, fuzzy +msgid "" +"-r, --recursive recursively compare any subdirectories found" +msgstr "-r --recursive 連同所有副目錄一起比較。" + +#: src/diff.c:915 +msgid " --no-dereference don't follow symbolic links" +msgstr "" + +#: src/diff.c:916 +#, fuzzy +msgid "-N, --new-file treat absent files as empty" +msgstr "-N --new-file 不存在的檔案以空白檔案方式處理。" + +#: src/diff.c:917 +#, fuzzy +msgid " --unidirectional-new-file treat absent first files as empty" +msgstr "--unidirectional-new-file 若第一個檔案不存在,以空白檔案處理。" + +#: src/diff.c:918 +#, fuzzy +msgid " --ignore-file-name-case ignore case when comparing file names" +msgstr "--ignore-file-name-case 當比較檔案名稱時不分辨大小寫。" + +#: src/diff.c:919 +#, fuzzy +msgid " --no-ignore-file-name-case consider case when comparing file names" +msgstr "--no-ignore-file-name-case 當比較檔案名稱時會分辨大小寫。" + +#: src/diff.c:920 +#, fuzzy +msgid "-x, --exclude=PAT exclude files that match PAT" +msgstr "-x PAT --exclude=PAT 排除樣式為 PAT 的檔案。" + +#: src/diff.c:921 +#, fuzzy +msgid "" +"-X, --exclude-from=FILE exclude files that match any pattern in FILE" +msgstr "-X FILE --exclude-from=FILE 排除所有在 FILE 中列出的樣式的檔案。" + +#: src/diff.c:922 +#, fuzzy +msgid "" +"-S, --starting-file=FILE start with FILE when comparing directories" +msgstr "-S FILE --starting-file=FILE 當比較目錄時,由 FILE 開始比較。" + +#: src/diff.c:923 +#, fuzzy +msgid "" +" --from-file=FILE1 compare FILE1 to all operands;\n" +" FILE1 can be a directory" +msgstr "" +"--from-file=FILE1 將 FILE1 和參數中的所有檔案/目錄作比較。FILE1 可以是目錄。" + +#: src/diff.c:925 +#, fuzzy +msgid "" +" --to-file=FILE2 compare all operands to FILE2;\n" +" FILE2 can be a directory" +msgstr "" +"--to-file=FILE2 將參數中的所有檔案/目錄和 FILE2 作比較。FILE2 可以是目錄。" + +#: src/diff.c:928 +#, fuzzy +msgid "" +"-i, --ignore-case ignore case differences in file contents" +msgstr "-i --ignore-case 不分辨檔案內容中的大小寫。" + +#: src/diff.c:929 +#, fuzzy +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "-E --ignore-tab-expansion 忽略因將 tab 轉換為空格而造成的差異。" + +#: src/diff.c:930 +#, fuzzy +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-w --ignore-all-space 忽略所有空白字元。" + +#: src/diff.c:931 +#, fuzzy +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b --ignore-space-change 忽略因空白字元數目不同而造成的差異。" + +#: src/diff.c:932 +#, fuzzy +msgid "-w, --ignore-all-space ignore all white space" +msgstr "-w --ignore-all-space 忽略所有空白字元。" + +#: src/diff.c:933 +#, fuzzy +msgid "" +"-B, --ignore-blank-lines ignore changes where lines are all blank" +msgstr "-B --ignore-blank-lines 忽略任何因空行而造成的差異。" + +#: src/diff.c:934 +#, fuzzy +msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE" +msgstr "" +"-I RE --ignore-matching-lines=RE 忽略任何符合指定的<正規表示式>的地方。" + +#: src/diff.c:936 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr "-a --text 所有檔案都以文字檔方式處理。" + +#: src/diff.c:937 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "--strip-trailing-cr 去除輸入資料每行末端的 carriage return 字元。" + +#: src/diff.c:939 +#, fuzzy +msgid " --binary read and write data in binary mode" +msgstr "--binary 以二元碼檔模式讀寫資料。" + +#: src/diff.c:942 +#, fuzzy +msgid "" +"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs" +msgstr "-D NAME --ifdef=NAME 輸出的資料以‘#ifdef NAME’方式標明差異。" + +#: src/diff.c:943 +#, fuzzy +msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT" +msgstr "" +"--GTYPE-group-format=GFMT 效果類似,但會以 GFMT 格式處理 GTYPE 輸入行組。" + +#: src/diff.c:944 +#, fuzzy +msgid " --line-format=LFMT format all input lines with LFMT" +msgstr "--line-format=LFMT 效果類似,但會以 LFMT 格式處理每一行資料。" + +#: src/diff.c:945 +#, fuzzy +msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT" +msgstr "" +"--LTYPE-line-format=LFMT 效果類似,但會以 LFMT 格式處理 LTYPE 輸入行組。" + +#: src/diff.c:946 +msgid "" +" These format options provide fine-grained control over the output\n" +" of diff, generalizing -D/--ifdef." +msgstr "" + +#: src/diff.c:948 +#, fuzzy +msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'." +msgstr "" +" LTYPE 可以是‘old’、‘new’或‘unchanged’。GTYPE 可以是 LTYPE 的選擇\n" +" 或是‘changed’。" + +#: src/diff.c:949 +#, fuzzy +msgid "" +" GFMT (only) may contain:\n" +" %< lines from FILE1\n" +" %> lines from FILE2\n" +" %= lines common to FILE1 and FILE2\n" +" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n" +" LETTERs are as follows for new group, lower case for old group:\n" +" F first line number\n" +" L last line number\n" +" N number of lines = L-F+1\n" +" E F-1\n" +" M L+1\n" +" %(A=B?T:E) if A equals B then T else E" +msgstr "" +" GFMT 可包括:\n" +" %< 該組中每行屬於 FILE1 的差異\n" +" %> 該組中每行屬於 FILE2 的差異\n" +" %= 該組中同時在 FILE1 和 FILE2 出現的每一行\n" +" %[-][寬度][.[精確度]]{doxX}字元 以 printf 格式表示該<字元>代表的資料\n" +" 大寫<字元>表示屬於新的檔案,小寫表示屬於舊的檔案。<字元>的意義如下:\n" +" F 行組中第一行的行號\n" +" L 行組中最後一行的行號\n" +" N 行數 ( =L-F+1 )\n" +" E F-1\n" +" M L+1" + +#: src/diff.c:961 +#, fuzzy +msgid "" +" LFMT (only) may contain:\n" +" %L contents of line\n" +" %l contents of line, excluding any trailing newline\n" +" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number" +msgstr "" +" LFMT 可包括:\n" +" %L 該行的內容\n" +" %l 該行的內容,但不包括結束的 newline 字元\n" +" %[-][寬度][.[精確度]]{doxX}n 以 printf 格式表示的輸入資料行號" + +#: src/diff.c:965 +#, fuzzy +msgid "" +" Both GFMT and LFMT may contain:\n" +" %% %\n" +" %c'C' the single character C\n" +" %c'\\OOO' the character with octal code OOO\n" +" C the character C (other characters represent themselves)" +msgstr "" +" GFMT 或 LFMT 可包括:\n" +" %% %\n" +" %c'C' 字元 C\n" +" %c'\\OOO' 八進位數字 OOO 所代表的字元" + +#: src/diff.c:971 +#, fuzzy +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d --minimal 盡可能找出最小的差異。" + +#: src/diff.c:972 +#, fuzzy +msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix" +msgstr "--horizon-lines=NUM (此選項不作處理)" + +#: src/diff.c:973 +#, fuzzy +msgid "" +" --speed-large-files assume large files and many scattered small changes" +msgstr "-H --speed-large-files 假設檔案十分大而且當中含有許多些微的差異。" + +#: src/diff.c:974 +msgid "" +" --color[=WHEN] colorize the output; WHEN can be 'never', " +"'always',\n" +" or 'auto' (the default)" +msgstr "" + +#: src/diff.c:976 +msgid "" +" --palette=PALETTE the colors to use when --color is active; PALETTE " +"is\n" +" a colon-separated list of terminfo capabilities" +msgstr "" + +#: src/diff.c:979 +msgid " --help display this help and exit" +msgstr "" + +#: src/diff.c:980 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "-v --version 顯示版本資訊。" + +#: src/diff.c:982 +#, fuzzy +msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'." +msgstr "" +"FILES 的格式可以是‘FILE1 FILE2’、‘DIR1 DIR2’、‘DIR FILE...’或\n" +" ‘FILE... DIR’。" + +#: src/diff.c:983 +#, fuzzy +msgid "" +"If --from-file or --to-file is given, there are no restrictions on FILE(s)." +msgstr "如果使用 --from-file 或 --to-file 選項,FILES 的格式則不受限制。" + +#: src/diff.c:984 src/diff3.c:528 src/sdiff.c:219 +#, fuzzy +msgid "If a FILE is '-', read standard input." +msgstr "如果 FILE 是‘-’,則由標準輸入讀取資料。" + +# It is intentional *not* to translate FILES -- maddog +#: src/diff.c:994 +#, c-format +msgid "Usage: %s [OPTION]... FILES\n" +msgstr "用法:%s [選項]... FILES\n" + +#: src/diff.c:995 +#, fuzzy +msgid "Compare FILES line by line." +msgstr "比較兩個檔案的每一行。" + +#: src/diff.c:1029 +#, fuzzy, c-format +msgid "conflicting %s option value '%s'" +msgstr "互相矛盾的 %s 選項,參數值為‘%s’" + +#: src/diff.c:1042 +#, c-format +msgid "conflicting output style options" +msgstr "互相矛盾的輸出模式選項" + +#: src/diff.c:1058 +#, fuzzy, c-format +msgid "invalid color '%s'" +msgstr "無效的上下文行數‘%s’" + +#: src/diff.c:1114 src/diff.c:1324 +#, c-format +msgid "Only in %s: %s\n" +msgstr "只在 %s 存在:%s\n" + +#: src/diff.c:1248 +#, fuzzy +msgid "cannot compare '-' to a directory" +msgstr "‘-’無法與目錄作比較" + +#: src/diff.c:1283 +msgid "-D option not supported with directories" +msgstr "-D 選項不可配合目錄使用" + +#: src/diff.c:1292 +#, c-format +msgid "Common subdirectories: %s and %s\n" +msgstr "%s 和 %s 有共同的副目錄\n" + +#: src/diff.c:1334 src/diff.c:1384 +#, c-format +msgid "File %s is a %s while file %s is a %s\n" +msgstr "檔案 %s 是%s而檔案 %s 是%s\n" + +#: src/diff.c:1370 +#, fuzzy, c-format +msgid "Symbolic links %s and %s differ\n" +msgstr "檔案 %s 與 %s 不同\n" + +#: src/diff.c:1457 +#, c-format +msgid "Files %s and %s are identical\n" +msgstr "檔案 %s 和 %s 相同\n" + +#. This is a proper name. See the gettext manual, section Names. +#: src/diff3.c:42 +msgid "Randy Smith" +msgstr "" + +#: src/diff3.c:351 +#, c-format +msgid "incompatible options" +msgstr "不兼容的選項" + +#: src/diff3.c:391 +#, fuzzy +msgid "'-' specified for more than one input file" +msgstr "輸入檔‘-’不可多於一個" + +#: src/diff3.c:442 src/diff3.c:1290 src/diff3.c:1693 src/diff3.c:1748 +#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855 +msgid "read failed" +msgstr "讀取資料失敗" + +#: src/diff3.c:475 +#, fuzzy +msgid "-A, --show-all output all changes, bracketing conflicts" +msgstr "-A --show-all 顯示所有要更改的部份,並括上互相抵觸的地方。" + +#: src/diff3.c:477 +#, fuzzy +msgid "" +"-e, --ed output ed script incorporating changes\n" +" from OLDFILE to YOURFILE into MYFILE" +msgstr "" +"-e --ed 取出由 OLDFILE 至 YOURFILE 的更改部份,並顯示可將此\n" +" 部份套用至 MYFILE 的 ed script。" + +#: src/diff3.c:479 +#, fuzzy +msgid "-E, --show-overlap like -e, but bracket conflicts" +msgstr "-E --show-overlap 顯示未合併的更改部份,並括上互相抵觸的地方。" + +#: src/diff3.c:480 +#, fuzzy +msgid "" +"-3, --easy-only like -e, but incorporate only nonoverlapping " +"changes" +msgstr "-3 --easy-only 顯示未合併而且不重疊的更改部份。" + +#: src/diff3.c:481 +#, fuzzy +msgid "" +"-x, --overlap-only like -e, but incorporate only overlapping changes" +msgstr "-x --overlap-only 只顯示重疊的更改部份。" + +#: src/diff3.c:482 +msgid "-X like -x, but bracket conflicts" +msgstr "" + +#: src/diff3.c:483 +#, fuzzy +msgid "-i append 'w' and 'q' commands to ed scripts" +msgstr "-i 在 ed script 中附加‘w’和‘q’指令。" + +#: src/diff3.c:485 +msgid "" +"-m, --merge output actual merged file, according to\n" +" -A if no other options are given" +msgstr "" + +#: src/diff3.c:488 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr "-a --text 所有檔案都以文字檔方式處理。" + +#: src/diff3.c:489 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "--strip-trailing-cr 去除輸入資料每行末端的 carriage return 字元。" + +#: src/diff3.c:490 +#, fuzzy +msgid "-T, --initial-tab make tabs line up by prepending a tab" +msgstr "-T --initial-tab 每行先加上 tab 字元,使 tab 字元可以對齊。" + +#: src/diff3.c:491 +#, fuzzy +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "--diff-program=程式 使用<程式>來比較檔案。" + +#: src/diff3.c:492 +msgid "" +"-L, --label=LABEL use LABEL instead of file name\n" +" (can be repeated up to three times)" +msgstr "" + +#: src/diff3.c:495 +msgid " --help display this help and exit" +msgstr "" + +#: src/diff3.c:496 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "-v --version 顯示版本資訊。" + +#: src/diff3.c:505 +#, c-format +msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n" +msgstr "用法:%s [選項]... MYFILE OLDFILE YOURFILE\n" + +#: src/diff3.c:507 +msgid "Compare three files line by line." +msgstr "比較三個檔案的每一行。" + +#: src/diff3.c:517 +msgid "" +"\n" +"The default output format is a somewhat human-readable representation of\n" +"the changes.\n" +"\n" +"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" +"to be output instead of the default.\n" +"\n" +"Finally, the -m (--merge) option causes diff3 to do the merge internally\n" +"and output the actual merged file. For unusual input, this is more\n" +"robust than using ed.\n" +msgstr "" + +#: src/diff3.c:529 +msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble." +msgstr "回傳值是 0 的話代表指令成功執行,1 代表內容有衝突,2 代表有錯誤。" + +#: src/diff3.c:722 +msgid "internal error: screwup in format of diff blocks" +msgstr "內部錯誤:diff 區段的格式出錯" + +#: src/diff3.c:1017 +#, c-format +msgid "%s: diff failed: " +msgstr "%s:diff 失敗:" + +#: src/diff3.c:1039 +msgid "internal error: invalid diff type in process_diff" +msgstr "內部錯誤:process_diff 中的 diff 類型無效" + +#: src/diff3.c:1064 +msgid "invalid diff format; invalid change separator" +msgstr "無效的 diff 格式;表示資料變更的分隔字串無效" + +#: src/diff3.c:1300 +msgid "invalid diff format; incomplete last line" +msgstr "無效的 diff 格式;最後一行不完整" + +#: src/diff3.c:1324 src/sdiff.c:275 src/util.c:969 +#, fuzzy, c-format +msgid "subsidiary program '%s' could not be invoked" +msgstr "子程式 ‘%s’ 無法執行" + +#: src/diff3.c:1349 +msgid "invalid diff format; incorrect leading line chars" +msgstr "diff 格式無效;某行的第一個字元不正確" + +#: src/diff3.c:1422 +msgid "internal error: invalid diff type passed to output" +msgstr "內部錯誤:準備輸出的 diff 資料類型無效" + +#: src/diff3.c:1695 src/diff3.c:1752 +msgid "input file shrank" +msgstr "輸入檔縮小" + +#: src/dir.c:156 +#, fuzzy, c-format +msgid "cannot compare file names '%s' and '%s'" +msgstr "無法比較檔案 ‘%s’ 和 ‘%s’" + +#: src/dir.c:225 +#, c-format +msgid "%s: recursive directory loop" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/sdiff.c:43 +msgid "Thomas Lord" +msgstr "" + +#: src/sdiff.c:173 +#, fuzzy +msgid "" +"-o, --output=FILE operate interactively, sending output to FILE" +msgstr "-o 檔案 --output=檔案 互動式操作,並將結果寫入至<檔案>。" + +#: src/sdiff.c:175 +#, fuzzy +msgid "" +"-i, --ignore-case consider upper- and lower-case to be the same" +msgstr "-i --ignore-case 不分辨檔案內容中的大小寫。" + +#: src/sdiff.c:176 +#, fuzzy +msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion" +msgstr "-E --ignore-tab-expansion 忽略因將 tab 轉換為空格而造成的差異。" + +#: src/sdiff.c:177 +#, fuzzy +msgid "-Z, --ignore-trailing-space ignore white space at line end" +msgstr "-w --ignore-all-space 忽略所有空白字元。" + +#: src/sdiff.c:178 +#, fuzzy +msgid "" +"-b, --ignore-space-change ignore changes in the amount of white space" +msgstr "-b --ignore-space-change 忽略因空白字元數目不同而造成的差異。" + +#: src/sdiff.c:179 +#, fuzzy +msgid "-W, --ignore-all-space ignore all white space" +msgstr "-W --ignore-all-space 忽略所有空白字元。" + +#: src/sdiff.c:180 +#, fuzzy +msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank" +msgstr "-B --ignore-blank-lines 忽略任何因空行而造成的差異。" + +#: src/sdiff.c:181 +#, fuzzy +msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE" +msgstr "" +"-I RE --ignore-matching-lines=RE 忽略任何符合指定的<正規表示式>的地方。" + +#: src/sdiff.c:182 +#, fuzzy +msgid " --strip-trailing-cr strip trailing carriage return on input" +msgstr "--strip-trailing-cr 去除輸入資料每行末端的 carriage return 字元。" + +#: src/sdiff.c:183 +#, fuzzy +msgid "-a, --text treat all files as text" +msgstr "-a --text 所有檔案都以文字檔方式處理。" + +#: src/sdiff.c:185 +#, fuzzy +msgid "" +"-w, --width=NUM output at most NUM (default 130) print columns" +msgstr "-w NUM --width=NUM 每行顯示最多 NUM(預設 130)個字元。" + +#: src/sdiff.c:186 +#, fuzzy +msgid "" +"-l, --left-column output only the left column of common lines" +msgstr "-l --left-column 當有兩行相同時只顯示左邊的一行。" + +#: src/sdiff.c:187 +#, fuzzy +msgid "-s, --suppress-common-lines do not output common lines" +msgstr "-s --suppress-common-lines 當有兩行相同時不會顯示。" + +#: src/sdiff.c:189 +#, fuzzy +msgid "-t, --expand-tabs expand tabs to spaces in output" +msgstr "-t --expand-tabs 將輸出中的 tab 換成空格。" + +#: src/sdiff.c:190 +#, fuzzy +msgid "" +" --tabsize=NUM tab stops at every NUM (default 8) print columns" +msgstr "--tabsize=NUM 定位字元 (tab) 的寬度,預設為 8 個空格。" + +#: src/sdiff.c:192 +#, fuzzy +msgid "-d, --minimal try hard to find a smaller set of changes" +msgstr "-d --minimal 盡可能找出最小的差異。" + +#: src/sdiff.c:193 +#, fuzzy +msgid "" +"-H, --speed-large-files assume large files, many scattered small changes" +msgstr "-H --speed-large-files 假設檔案十分大而且當中含有許多些微的差異。" + +#: src/sdiff.c:194 +#, fuzzy +msgid " --diff-program=PROGRAM use PROGRAM to compare files" +msgstr "--diff-program=程式 使用<程式>來比較檔案。" + +#: src/sdiff.c:196 +msgid " --help display this help and exit" +msgstr "" + +#: src/sdiff.c:197 +#, fuzzy +msgid "-v, --version output version information and exit" +msgstr "-v --version 顯示版本資訊。" + +#: src/sdiff.c:206 +#, c-format +msgid "Usage: %s [OPTION]... FILE1 FILE2\n" +msgstr "用法:%s [選項]... 檔案1 檔案2\n" + +#: src/sdiff.c:208 +#, fuzzy +msgid "Side-by-side merge of differences between FILE1 and FILE2." +msgstr "以並排方式合併檔案之間的差異。" + +#: src/sdiff.c:329 +msgid "cannot interactively merge standard input" +msgstr "不允許以互動方式合併標準輸入的資料" + +#: src/sdiff.c:595 +msgid "both files to be compared are directories" +msgstr "兩個要比較的都是目錄" + +#: src/sdiff.c:818 +#, fuzzy +msgid "" +"ed:\tEdit then use both versions, each decorated with a header.\n" +"eb:\tEdit then use both versions.\n" +"el or e1:\tEdit then use the left version.\n" +"er or e2:\tEdit then use the right version.\n" +"e:\tDiscard both versions then edit a new one.\n" +"l or 1:\tUse the left version.\n" +"r or 2:\tUse the right version.\n" +"s:\tSilently include common lines.\n" +"v:\tVerbosely include common lines.\n" +"q:\tQuit.\n" +msgstr "" +"ed:\t編輯兩邊的版本合併後的資料,各版本分別加上標頭以資識別。\n" +"eb:\t編輯兩邊的版本合併後的資料。\n" +"el:\t使用左邊的版本來進行編輯。\n" +"er:\t使用右邊的版本來進行編輯。\n" +"e :\t編輯新的版本。\n" +"l :\t使用左邊的版本。\n" +"r :\t使用右邊的版本。\n" +"s :\t加上兩邊一樣的行組時不在畫面顯示。\n" +"v :\t加上兩邊一樣的行組時會在畫面顯示。\n" +"q :\t離開。\n" + +#: src/util.c:662 +#, fuzzy, c-format +msgid "unrecognized prefix: %s" +msgstr "%s:無法識別的選項‘--%s’\n" + +#: src/util.c:692 +#, c-format +msgid "unparsable value for --palette" +msgstr "" + +#, fuzzy +#~ msgid "%s: option '--%s' doesn't allow an argument\n" +#~ msgstr "%s:選項‘--%s’不可配合參數使用\n" + +#, fuzzy +#~ msgid "%s: unrecognized option '--%s'\n" +#~ msgstr "%s:無法識別的選項‘--%s’\n" + +#, fuzzy +#~ msgid "%s: option '-W %s' is ambiguous\n" +#~ msgstr "%s:選項‘-W %s’是不明確的\n" + +#, fuzzy +#~ msgid "%s: option '-W %s' doesn't allow an argument\n" +#~ msgstr "%s:選項‘-W %s’不可配合參數使用\n" + +#, fuzzy +#~ msgid "%s: option '-W %s' requires an argument\n" +#~ msgstr "%s:選項‘%s’需要參數\n" + +#~ msgid "%s: illegal option -- %c\n" +#~ msgstr "%s:不合法的選項 ─ %c\n" + +#~ msgid "" +#~ "This is free software; see the source for copying conditions. There is " +#~ "NO\n" +#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR " +#~ "PURPOSE.\n" +#~ msgstr "" +#~ "本程式是自由軟體;請參考源代碼中的版權聲明。本軟體不提供任何保證,甚至不" +#~ "會\n" +#~ "包括可售性或適用於任何特定目的的保證。\n" + +#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" +#~ msgstr "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2" + +#~ msgid "-s --quiet --silent Output nothing; yield exit status only." +#~ msgstr "-s --quiet --silent 不輸出任何資訊;只產生回傳值。" + +#~ msgid "--help Output this help." +#~ msgstr "--help 顯示此求助說明。" + +#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>." +#~ msgstr "請向 <bug-gnu-utils@gnu.org> 回報錯誤。" + +#~ msgid "`-%ld' option is obsolete; use `-%c %ld'" +#~ msgstr "‘-%ld’ 選項已過時;請使用 ‘-%c %ld’" + +#~ msgid "`-%ld' option is obsolete; omit it" +#~ msgstr "‘-%ld’ 選項已過時;會忽略此選項" + +#~ msgid "" +#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied " +#~ "context.\n" +#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified " +#~ "context.\n" +#~ " --label LABEL Use LABEL instead of file name.\n" +#~ " -p --show-c-function Show which C function each change is in.\n" +#~ " -F RE --show-function-line=RE Show the most recent line matching RE." +#~ msgstr "" +#~ "-c -C 行數 --context[=行數] 顯示指定<行數>(預設 3 行)copied 格式的上下" +#~ "文\n" +#~ "-u -U 行數 --unified[=行數] 顯示指定<行數>(預設 3 行)unified 格式的上下" +#~ "文\n" +#~ " --label 標籤 使用<標籤>代替檔案名稱。\n" +#~ " -p --show-c-function 顯示和每個差異有關的 C 函式名稱。\n" +#~ " -F RE --show-function-line=RE 顯示最接近而符合<正規表示式>的一行。" + +#~ msgid "" +#~ "-y --side-by-side Output in two columns.\n" +#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n" +#~ " --left-column Output only the left column of common lines.\n" +#~ " --suppress-common-lines Do not output common lines." +#~ msgstr "" +#~ "-y --side-by-side 以兩列並排的方式顯示。\n" +#~ " -W NUM --width=NUM 每行顯示最多 NUM (預設 130) 個字元。\n" +#~ " --left-column 當有兩行相同時只顯示左邊的一行。\n" +#~ " --suppress-common-lines 當有兩行相同時不會顯示。" + +#~ msgid "" +#~ "--speed-large-files Assume large files and many scattered small changes." +#~ msgstr "--speed-large-files 假設檔案十分大而且當中含有許多些微的差異。" + +#~ msgid "-X Output overlapping changes, bracketing them." +#~ msgstr "-X 顯示重疊的更改部份,並括上記號。" + +#~ msgid "-m --merge Output merged file instead of ed script (default -A)." +#~ msgstr "" +#~ "-m --merge 顯示合併後的檔案而不是 ed script (預設加上 -A)。" + +#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name." +#~ msgstr "-L 標籤 --label=標籤 以<標籤>代替檔案名稱。" + +#~ msgid "subsidiary program `%s' not found" +#~ msgstr "找不到子程式 ‘%s’" + +#~ msgid "subsidiary program `%s' failed" +#~ msgstr "程式 ‘%s’ 回傳錯誤" + +#~ msgid "subsidiary program `%s' failed (exit status %d)" +#~ msgstr "子程式 ‘%s’ 發生錯誤 (回傳值為 %d)" + +#~ msgid "" +#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n" +#~ "You may redistribute copies of this program\n" +#~ "under the terms of the GNU General Public License.\n" +#~ "For more information about these matters, see the files named COPYING." +#~ msgstr "" +#~ "此軟體在法律允許的限度之下不附帶任何保證。你可以根據 GNU General Public\n" +#~ "License 中的條款重新散佈此軟體。詳情請參考檔案 COPYING。" + +#~ msgid "Written by Torbjorn Granlund and David MacKenzie." +#~ msgstr "由 Torbjorn Granlund 及 David MacKenzie 編寫。" + +#~ msgid "" +#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n" +#~ "Richard Stallman, and Len Tower." +#~ msgstr "" +#~ "由 Paul Eggert、Mike Haertel、David Hayes、\n" +#~ "Richard Stallman 和 Len Tower 編寫。" + +#~ msgid "subsidiary program `%s' not executable" +#~ msgstr "所需的程式‘%s’無法執行" + +#~ msgid "--inhibit-hunk-merge Do not merge hunks." +#~ msgstr "--inhibit-hunk-merge (此選項不作處理)" + +#~ msgid "" +#~ "SKIP values may be followed by the following multiplicative suffixes:\n" +#~ msgstr "SKIP 值可以加上以下的單位:\n" + +#~ msgid "kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n" +#~ msgstr "kB 1000、K 1024、MB 1,000,000、M 1,048,576、\n" + +#~ msgid "GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y.\n" +#~ msgstr "GB 1,000,000,000、G 1,073,741,824、還有 T、P、E、Z、Y 如此類推。\n" + +#~ msgid "multiple `--from-file' options" +#~ msgstr "‘--from-file’選項不可使用多於一次" + +#~ msgid "multiple `--to-file' options" +#~ msgstr "‘--to-file’選項不可使用多於一次" + +#~ msgid "regular executable file" +#~ msgstr "正常可執行檔" + +#~ msgid "If a FILE is `-', read standard input.\n" +#~ msgstr "如果檔案是‘-’,則由標準輸入讀入資料。\n" diff --git a/local/recipes/tools/diffutils/source/src/Makefile.am b/local/recipes/tools/diffutils/source/src/Makefile.am new file mode 100644 index 0000000000..50acad9e59 --- /dev/null +++ b/local/recipes/tools/diffutils/source/src/Makefile.am @@ -0,0 +1,80 @@ +# Automakefile for GNU diffutils programs. + +# Copyright (C) 2001-2002, 2006, 2009-2013, 2015-2017 Free Software Foundation, +# Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +bin_PROGRAMS = cmp diff diff3 sdiff + +localedir = $(datadir)/locale + +AM_CPPFLAGS = -I../lib -I$(top_srcdir)/lib +AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) + +LDADD = \ + libver.a \ + ../lib/libdiffutils.a \ + $(LIBCSTACK) \ + $(LIBINTL) \ + $(LIBICONV) \ + $(LIBSIGSEGV) \ + $(LIB_CLOCK_GETTIME) + +diff_LDADD = $(LDADD) +cmp_LDADD = $(LDADD) +sdiff_LDADD = $(LDADD) +diff3_LDADD = $(LDADD) + +cmp_SOURCES = cmp.c +diff3_SOURCES = diff3.c +sdiff_SOURCES = sdiff.c +diff_SOURCES = \ + analyze.c context.c diff.c dir.c ed.c ifdef.c io.c \ + normal.c side.c util.c +noinst_HEADERS = \ + die.h \ + diff.h \ + system.h + +MOSTLYCLEANFILES = paths.h paths.ht + +cmp.$(OBJEXT) diff3.$(OBJEXT) diff.$(OBJEXT) sdiff.$(OBJEXT): paths.h + +gdiff = `echo diff|sed '$(transform)'` +BUILT_SOURCES = paths.h +paths.h: Makefile.am + $(AM_V_GEN)(echo '#define DEFAULT_DIFF_PROGRAM "'$(gdiff)'"' && \ + echo '#define LOCALEDIR "$(localedir)"') >$@t && mv $@t $@ + +noinst_LIBRARIES = libver.a +nodist_libver_a_SOURCES = version.c version.h + +BUILT_SOURCES += version.c +version.c: Makefile + $(AM_V_GEN)rm -f $@ + $(AM_V_at)printf '#include <config.h>\n' > $@t + $(AM_V_at)printf 'char const *Version = "$(PACKAGE_VERSION)";\n' >> $@t + $(AM_V_at)chmod a-w $@t + $(AM_V_at)mv $@t $@ + +BUILT_SOURCES += version.h +version.h: Makefile + $(AM_V_GEN)rm -f $@ + $(AM_V_at)printf 'extern char const *Version;\n' > $@t + $(AM_V_at)chmod a-w $@t + $(AM_V_at)mv $@t $@ + +DISTCLEANFILES = version.c version.h +MAINTAINERCLEANFILES = $(BUILT_SOURCES) diff --git a/local/recipes/tools/diffutils/source/src/Makefile.in b/local/recipes/tools/diffutils/source/src/Makefile.in new file mode 100644 index 0000000000..43053b51b9 --- /dev/null +++ b/local/recipes/tools/diffutils/source/src/Makefile.in @@ -0,0 +1,1728 @@ +# Makefile.in generated by automake 1.18.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2025 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Automakefile for GNU diffutils programs. + +# Copyright (C) 2001-2002, 2006, 2009-2013, 2015-2017 Free Software Foundation, +# Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +am__rm_f = rm -f $(am__rm_f_notfound) +am__rm_rf = rm -rf $(am__rm_f_notfound) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = cmp$(EXEEXT) diff$(EXEEXT) diff3$(EXEEXT) \ + sdiff$(EXEEXT) +subdir = src +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ + $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \ + $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/btowc.m4 \ + $(top_srcdir)/m4/builtin-expect.m4 $(top_srcdir)/m4/c-stack.m4 \ + $(top_srcdir)/m4/clock_time.m4 $(top_srcdir)/m4/close.m4 \ + $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \ + $(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/ctype.m4 \ + $(top_srcdir)/m4/dirname.m4 \ + $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/extensions.m4 \ + $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fcntl-o.m4 \ + $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/filenamecat.m4 \ + $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \ + $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpieee.m4 \ + $(top_srcdir)/m4/freopen.m4 $(top_srcdir)/m4/fstat.m4 \ + $(top_srcdir)/m4/ftruncate.m4 $(top_srcdir)/m4/getcwd.m4 \ + $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/getpagesize.m4 \ + $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnu-make.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 \ + $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \ + $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \ + $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttostr.m4 \ + $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \ + $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \ + $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/iswblank.m4 \ + $(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ + $(top_srcdir)/m4/libunistring-base.m4 \ + $(top_srcdir)/m4/limits-h.m4 $(top_srcdir)/m4/localcharset.m4 \ + $(top_srcdir)/m4/locale-fr.m4 $(top_srcdir)/m4/locale-ja.m4 \ + $(top_srcdir)/m4/locale-tr.m4 $(top_srcdir)/m4/locale-zh.m4 \ + $(top_srcdir)/m4/locale_h.m4 $(top_srcdir)/m4/localeconv.m4 \ + $(top_srcdir)/m4/localtime-buffer.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ + $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/mbchar.m4 \ + $(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbslen.m4 \ + $(top_srcdir)/m4/mbsrtowcs.m4 $(top_srcdir)/m4/mbstate_t.m4 \ + $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \ + $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mkstemp.m4 \ + $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/mmap-anon.m4 \ + $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \ + $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \ + $(top_srcdir)/m4/nanosleep.m4 $(top_srcdir)/m4/netinet_in_h.m4 \ + $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \ + $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ + $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \ + $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/regex.m4 \ + $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/setlocale.m4 \ + $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/signalblocking.m4 \ + $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/socketlib.m4 \ + $(top_srcdir)/m4/sockets.m4 $(top_srcdir)/m4/socklen.m4 \ + $(top_srcdir)/m4/sockpfaf.m4 $(top_srcdir)/m4/ssize_t.m4 \ + $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \ + $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \ + $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/strcase.m4 $(top_srcdir)/m4/strerror.m4 \ + $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/strftime.m4 \ + $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strings_h.m4 \ + $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ + $(top_srcdir)/m4/strptime.m4 $(top_srcdir)/m4/strtoull.m4 \ + $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/symlink.m4 \ + $(top_srcdir)/m4/sys_ioctl_h.m4 \ + $(top_srcdir)/m4/sys_select_h.m4 \ + $(top_srcdir)/m4/sys_socket_h.m4 \ + $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ + $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \ + $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \ + $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \ + $(top_srcdir)/m4/time_rz.m4 $(top_srcdir)/m4/timegm.m4 \ + $(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \ + $(top_srcdir)/m4/tzset.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vararrays.m4 \ + $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vasprintf.m4 \ + $(top_srcdir)/m4/version-etc.m4 \ + $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \ + $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ + $(top_srcdir)/m4/wctomb.m4 $(top_srcdir)/m4/wctype_h.m4 \ + $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \ + $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xstrtol.m4 \ + $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ + $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/lib/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +LIBRARIES = $(noinst_LIBRARIES) +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +libver_a_AR = $(AR) $(ARFLAGS) +libver_a_RANLIB = $(RANLIB) +libver_a_LIBADD = +nodist_libver_a_OBJECTS = version.$(OBJEXT) +libver_a_OBJECTS = $(nodist_libver_a_OBJECTS) +am_cmp_OBJECTS = cmp.$(OBJEXT) +cmp_OBJECTS = $(am_cmp_OBJECTS) +am__DEPENDENCIES_1 = +am__DEPENDENCIES_2 = libver.a ../lib/libdiffutils.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +cmp_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_diff_OBJECTS = analyze.$(OBJEXT) context.$(OBJEXT) diff.$(OBJEXT) \ + dir.$(OBJEXT) ed.$(OBJEXT) ifdef.$(OBJEXT) io.$(OBJEXT) \ + normal.$(OBJEXT) side.$(OBJEXT) util.$(OBJEXT) +diff_OBJECTS = $(am_diff_OBJECTS) +diff_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_diff3_OBJECTS = diff3.$(OBJEXT) +diff3_OBJECTS = $(am_diff3_OBJECTS) +diff3_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_sdiff_OBJECTS = sdiff.$(OBJEXT) +sdiff_OBJECTS = $(am_sdiff_OBJECTS) +sdiff_DEPENDENCIES = $(am__DEPENDENCIES_2) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/lib +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/analyze.Po ./$(DEPDIR)/cmp.Po \ + ./$(DEPDIR)/context.Po ./$(DEPDIR)/diff.Po \ + ./$(DEPDIR)/diff3.Po ./$(DEPDIR)/dir.Po ./$(DEPDIR)/ed.Po \ + ./$(DEPDIR)/ifdef.Po ./$(DEPDIR)/io.Po ./$(DEPDIR)/normal.Po \ + ./$(DEPDIR)/sdiff.Po ./$(DEPDIR)/side.Po ./$(DEPDIR)/util.Po \ + ./$(DEPDIR)/version.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(nodist_libver_a_SOURCES) $(cmp_SOURCES) $(diff_SOURCES) \ + $(diff3_SOURCES) $(sdiff_SOURCES) +DIST_SOURCES = $(cmp_SOURCES) $(diff_SOURCES) $(diff3_SOURCES) \ + $(sdiff_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/build-aux/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkglibexecdir = @pkglibexecdir@ +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_INCLUDE = @CONFIG_INCLUDE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ +EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ +ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ +ENOLINK_VALUE = @ENOLINK_VALUE@ +EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ +EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ +ERRNO_H = @ERRNO_H@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FLOAT_H = @FLOAT_H@ +FNMATCH_H = @FNMATCH_H@ +GETOPT_CDEFS_H = @GETOPT_CDEFS_H@ +GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIBC21 = @GLIBC21@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ +GNULIB_CHDIR = @GNULIB_CHDIR@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_CTIME = @GNULIB_CTIME@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ +GNULIB_DUP = @GNULIB_DUP@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_DUP3 = @GNULIB_DUP3@ +GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ +GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ +GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ +GNULIB_FCNTL = @GNULIB_FCNTL@ +GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ +GNULIB_FDOPEN = @GNULIB_FDOPEN@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FFS = @GNULIB_FFS@ +GNULIB_FFSL = @GNULIB_FFSL@ +GNULIB_FFSLL = @GNULIB_FFSLL@ +GNULIB_FGETC = @GNULIB_FGETC@ +GNULIB_FGETS = @GNULIB_FGETS@ +GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPURGE = @GNULIB_FPURGE@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ +GNULIB_FREAD = @GNULIB_FREAD@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ +GNULIB_FSCANF = @GNULIB_FSCANF@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSTAT = @GNULIB_FSTAT@ +GNULIB_FSTATAT = @GNULIB_FSTATAT@ +GNULIB_FSYNC = @GNULIB_FSYNC@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETC = @GNULIB_GETC@ +GNULIB_GETCHAR = @GNULIB_GETCHAR@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ +GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ +GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ +GNULIB_GRANTPT = @GNULIB_GRANTPT@ +GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ +GNULIB_ICONV = @GNULIB_ICONV@ +GNULIB_IMAXABS = @GNULIB_IMAXABS@ +GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ +GNULIB_IOCTL = @GNULIB_IOCTL@ +GNULIB_ISATTY = @GNULIB_ISATTY@ +GNULIB_ISBLANK = @GNULIB_ISBLANK@ +GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ +GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LINKAT = @GNULIB_LINKAT@ +GNULIB_LISTEN = @GNULIB_LISTEN@ +GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ +GNULIB_LOCALTIME = @GNULIB_LOCALTIME@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MBTOWC = @GNULIB_MBTOWC@ +GNULIB_MEMCHR = @GNULIB_MEMCHR@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKFIFO = @GNULIB_MKFIFO@ +GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ +GNULIB_MKNOD = @GNULIB_MKNOD@ +GNULIB_MKNODAT = @GNULIB_MKNODAT@ +GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ +GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ +GNULIB_MKTIME = @GNULIB_MKTIME@ +GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ +GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ +GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_OPENAT = @GNULIB_OPENAT@ +GNULIB_OVERRIDES_STRUCT_STAT = @GNULIB_OVERRIDES_STRUCT_STAT@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ +GNULIB_PCLOSE = @GNULIB_PCLOSE@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PIPE = @GNULIB_PIPE@ +GNULIB_PIPE2 = @GNULIB_PIPE2@ +GNULIB_POPEN = @GNULIB_POPEN@ +GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ +GNULIB_PREAD = @GNULIB_PREAD@ +GNULIB_PRINTF = @GNULIB_PRINTF@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PSELECT = @GNULIB_PSELECT@ +GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ +GNULIB_PTSNAME = @GNULIB_PTSNAME@ +GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ +GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ +GNULIB_RAISE = @GNULIB_RAISE@ +GNULIB_RANDOM = @GNULIB_RANDOM@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ +GNULIB_READ = @GNULIB_READ@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_READLINKAT = @GNULIB_READLINKAT@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_REALPATH = @GNULIB_REALPATH@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ +GNULIB_REMOVE = @GNULIB_REMOVE@ +GNULIB_RENAME = @GNULIB_RENAME@ +GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ +GNULIB_RMDIR = @GNULIB_RMDIR@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SCANF = @GNULIB_SCANF@ +GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ +GNULIB_SELECT = @GNULIB_SELECT@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ +GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ +GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ +GNULIB_SIGACTION = @GNULIB_SIGACTION@ +GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ +GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STAT = @GNULIB_STAT@ +GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ +GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ +GNULIB_STRFTIME = @GNULIB_STRFTIME@ +GNULIB_STRNCAT = @GNULIB_STRNCAT@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRPTIME = @GNULIB_STRPTIME@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ +GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ +GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ +GNULIB_SYMLINK = @GNULIB_SYMLINK@ +GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ +GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ +GNULIB_TIMEGM = @GNULIB_TIMEGM@ +GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ +GNULIB_TMPFILE = @GNULIB_TMPFILE@ +GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ +GNULIB_TRUNCATE = @GNULIB_TRUNCATE@ +GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ +GNULIB_TZSET = @GNULIB_TZSET@ +GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ +GNULIB_UNLINK = @GNULIB_UNLINK@ +GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ +GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ +GNULIB_USLEEP = @GNULIB_USLEEP@ +GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VFSCANF = @GNULIB_VFSCANF@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSCANF = @GNULIB_VSCANF@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WAITPID = @GNULIB_WAITPID@ +GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@ +GNULIB_WCPCPY = @GNULIB_WCPCPY@ +GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ +GNULIB_WCSCAT = @GNULIB_WCSCAT@ +GNULIB_WCSCHR = @GNULIB_WCSCHR@ +GNULIB_WCSCMP = @GNULIB_WCSCMP@ +GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ +GNULIB_WCSCPY = @GNULIB_WCSCPY@ +GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ +GNULIB_WCSDUP = @GNULIB_WCSDUP@ +GNULIB_WCSFTIME = @GNULIB_WCSFTIME@ +GNULIB_WCSLEN = @GNULIB_WCSLEN@ +GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ +GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ +GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ +GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ +GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ +GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCSSPN = @GNULIB_WCSSPN@ +GNULIB_WCSSTR = @GNULIB_WCSSTR@ +GNULIB_WCSTOK = @GNULIB_WCSTOK@ +GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ +GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ +GNULIB_WCTOB = @GNULIB_WCTOB@ +GNULIB_WCTOMB = @GNULIB_WCTOMB@ +GNULIB_WCTRANS = @GNULIB_WCTRANS@ +GNULIB_WCTYPE = @GNULIB_WCTYPE@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ +GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ +GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ +GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ +GNULIB_WMEMSET = @GNULIB_WMEMSET@ +GNULIB_WRITE = @GNULIB_WRITE@ +GNULIB__EXIT = @GNULIB__EXIT@ +HAVE_ACCEPT4 = @HAVE_ACCEPT4@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ +HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ +HAVE_CHOWN = @HAVE_CHOWN@ +HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ +HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ +HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ +HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ +HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ +HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ +HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ +HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_DUP3 = @HAVE_DUP3@ +HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_FACCESSAT = @HAVE_FACCESSAT@ +HAVE_FCHDIR = @HAVE_FCHDIR@ +HAVE_FCHMODAT = @HAVE_FCHMODAT@ +HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FCNTL = @HAVE_FCNTL@ +HAVE_FDATASYNC = @HAVE_FDATASYNC@ +HAVE_FEATURES_H = @HAVE_FEATURES_H@ +HAVE_FFS = @HAVE_FFS@ +HAVE_FFSL = @HAVE_FFSL@ +HAVE_FFSLL = @HAVE_FFSLL@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSTATAT = @HAVE_FSTATAT@ +HAVE_FSYNC = @HAVE_FSYNC@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_FUTIMENS = @HAVE_FUTIMENS@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETGROUPS = @HAVE_GETGROUPS@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ +HAVE_GETLOGIN = @HAVE_GETLOGIN@ +HAVE_GETOPT_H = @HAVE_GETOPT_H@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ +HAVE_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISBLANK = @HAVE_ISBLANK@ +HAVE_ISWBLANK = @HAVE_ISWBLANK@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ +HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ +HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ +HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ +HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LCHOWN = @HAVE_LCHOWN@ +HAVE_LIBSIGSEGV = @HAVE_LIBSIGSEGV@ +HAVE_LINK = @HAVE_LINK@ +HAVE_LINKAT = @HAVE_LINKAT@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSLEN = @HAVE_MBSLEN@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ +HAVE_MEMCHR = @HAVE_MEMCHR@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDIRAT = @HAVE_MKDIRAT@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_MKFIFO = @HAVE_MKFIFO@ +HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ +HAVE_MKNOD = @HAVE_MKNOD@ +HAVE_MKNODAT = @HAVE_MKNODAT@ +HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ +HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ +HAVE_MKSTEMP = @HAVE_MKSTEMP@ +HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ +HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ +HAVE_OPENAT = @HAVE_OPENAT@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_PCLOSE = @HAVE_PCLOSE@ +HAVE_PIPE = @HAVE_PIPE@ +HAVE_PIPE2 = @HAVE_PIPE2@ +HAVE_POPEN = @HAVE_POPEN@ +HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ +HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_PREAD = @HAVE_PREAD@ +HAVE_PSELECT = @HAVE_PSELECT@ +HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ +HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ +HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ +HAVE_RAISE = @HAVE_RAISE@ +HAVE_RANDOM = @HAVE_RANDOM@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_READLINKAT = @HAVE_READLINKAT@ +HAVE_REALPATH = @HAVE_REALPATH@ +HAVE_RENAMEAT = @HAVE_RENAMEAT@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ +HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SIGACTION = @HAVE_SIGACTION@ +HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ +HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ +HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ +HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ +HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_SIGSET_T = @HAVE_SIGSET_T@ +HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STPCPY = @HAVE_STPCPY@ +HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ +HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRINGS_H = @HAVE_STRINGS_H@ +HAVE_STRPBRK = @HAVE_STRPBRK@ +HAVE_STRPTIME = @HAVE_STRPTIME@ +HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ +HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ +HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ +HAVE_SYMLINK = @HAVE_SYMLINK@ +HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@ +HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ +HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ +HAVE_TRUNCATE = @HAVE_TRUNCATE@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ +HAVE_TZSET = @HAVE_TZSET@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNLINKAT = @HAVE_UNLINKAT@ +HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_USLEEP = @HAVE_USLEEP@ +HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCHAR_T = @HAVE_WCHAR_T@ +HAVE_WCPCPY = @HAVE_WCPCPY@ +HAVE_WCPNCPY = @HAVE_WCPNCPY@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ +HAVE_WCSCAT = @HAVE_WCSCAT@ +HAVE_WCSCHR = @HAVE_WCSCHR@ +HAVE_WCSCMP = @HAVE_WCSCMP@ +HAVE_WCSCOLL = @HAVE_WCSCOLL@ +HAVE_WCSCPY = @HAVE_WCSCPY@ +HAVE_WCSCSPN = @HAVE_WCSCSPN@ +HAVE_WCSDUP = @HAVE_WCSDUP@ +HAVE_WCSFTIME = @HAVE_WCSFTIME@ +HAVE_WCSLEN = @HAVE_WCSLEN@ +HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ +HAVE_WCSNCAT = @HAVE_WCSNCAT@ +HAVE_WCSNCMP = @HAVE_WCSNCMP@ +HAVE_WCSNCPY = @HAVE_WCSNCPY@ +HAVE_WCSNLEN = @HAVE_WCSNLEN@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSPBRK = @HAVE_WCSPBRK@ +HAVE_WCSRCHR = @HAVE_WCSRCHR@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ +HAVE_WCSSPN = @HAVE_WCSSPN@ +HAVE_WCSSTR = @HAVE_WCSSTR@ +HAVE_WCSTOK = @HAVE_WCSTOK@ +HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ +HAVE_WCSXFRM = @HAVE_WCSXFRM@ +HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE_WMEMCHR = @HAVE_WMEMCHR@ +HAVE_WMEMCMP = @HAVE_WMEMCMP@ +HAVE_WMEMCPY = @HAVE_WMEMCPY@ +HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ +HAVE_WMEMSET = @HAVE_WMEMSET@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ +HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ +HAVE__BOOL = @HAVE__BOOL@ +HAVE__EXIT = @HAVE__EXIT@ +HELP2MAN = @HELP2MAN@ +ICONV_CONST = @ICONV_CONST@ +ICONV_H = @ICONV_H@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ +INET_PTON_LIB = @INET_PTON_LIB@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ +INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBCSTACK = @LIBCSTACK@ +LIBDIFFUTILS_LIBDEPS = @LIBDIFFUTILS_LIBDEPS@ +LIBDIFFUTILS_LTLIBDEPS = @LIBDIFFUTILS_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSIGSEGV = @LIBSIGSEGV@ +LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@ +LIBSOCKET = @LIBSOCKET@ +LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ +LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@ +LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@ +LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIB_NANOSLEEP = @LIB_NANOSLEEP@ +LIB_SELECT = @LIB_SELECT@ +LIMITS_H = @LIMITS_H@ +LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ +LTLIBCSTACK = @LTLIBCSTACK@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBSIGSEGV = @LTLIBSIGSEGV@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ +NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@ +NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ +NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ +NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@ +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ +NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ +NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ +NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ +NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ +NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ +NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ +NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@ +NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@ +NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ +NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ +NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ +NEXT_CTYPE_H = @NEXT_CTYPE_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_ICONV_H = @NEXT_ICONV_H@ +NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ +NEXT_LOCALE_H = @NEXT_LOCALE_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ +NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_STDARG_H = @NEXT_STDARG_H@ +NEXT_STDDEF_H = @NEXT_STDDEF_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ +NEXT_STDIO_H = @NEXT_STDIO_H@ +NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRINGS_H = @NEXT_STRINGS_H@ +NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@ +NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@ +NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ +NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ +NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ +NEXT_TIME_H = @NEXT_TIME_H@ +NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ +NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSUB = @POSUB@ +PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ +PR_PROGRAM = @PR_PROGRAM@ +PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ +REPLACE_CALLOC = @REPLACE_CALLOC@ +REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_CTIME = @REPLACE_CTIME@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ +REPLACE_DUP = @REPLACE_DUP@ +REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ +REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FCNTL = @REPLACE_FCNTL@ +REPLACE_FDOPEN = @REPLACE_FDOPEN@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FSTAT = @REPLACE_FSTAT@ +REPLACE_FSTATAT = @REPLACE_FSTATAT@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ +REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETDELIM = @REPLACE_GETDELIM@ +REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ +REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@ +REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_GMTIME = @REPLACE_GMTIME@ +REPLACE_ICONV = @REPLACE_ICONV@ +REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@ +REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@ +REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ +REPLACE_INET_PTON = @REPLACE_INET_PTON@ +REPLACE_IOCTL = @REPLACE_IOCTL@ +REPLACE_ISATTY = @REPLACE_ISATTY@ +REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ +REPLACE_ITOLD = @REPLACE_ITOLD@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LINK = @REPLACE_LINK@ +REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ +REPLACE_LOCALTIME = @REPLACE_LOCALTIME@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MALLOC = @REPLACE_MALLOC@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MBTOWC = @REPLACE_MBTOWC@ +REPLACE_MEMCHR = @REPLACE_MEMCHR@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKDIR = @REPLACE_MKDIR@ +REPLACE_MKFIFO = @REPLACE_MKFIFO@ +REPLACE_MKNOD = @REPLACE_MKNOD@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_MKTIME = @REPLACE_MKTIME@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ +REPLACE_NULL = @REPLACE_NULL@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ +REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POPEN = @REPLACE_POPEN@ +REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PSELECT = @REPLACE_PSELECT@ +REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ +REPLACE_PTSNAME = @REPLACE_PTSNAME@ +REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ +REPLACE_RAISE = @REPLACE_RAISE@ +REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ +REPLACE_READ = @REPLACE_READ@ +REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ +REPLACE_REALLOC = @REPLACE_REALLOC@ +REPLACE_REALPATH = @REPLACE_REALPATH@ +REPLACE_REMOVE = @REPLACE_REMOVE@ +REPLACE_RENAME = @REPLACE_RENAME@ +REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ +REPLACE_RMDIR = @REPLACE_RMDIR@ +REPLACE_SELECT = @REPLACE_SELECT@ +REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ +REPLACE_SLEEP = @REPLACE_SLEEP@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STAT = @REPLACE_STAT@ +REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ +REPLACE_STPNCPY = @REPLACE_STPNCPY@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ +REPLACE_STRDUP = @REPLACE_STRDUP@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ +REPLACE_STRFTIME = @REPLACE_STRFTIME@ +REPLACE_STRNCAT = @REPLACE_STRNCAT@ +REPLACE_STRNDUP = @REPLACE_STRNDUP@ +REPLACE_STRNLEN = @REPLACE_STRNLEN@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ +REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ +REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ +REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ +REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ +REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TMPFILE = @REPLACE_TMPFILE@ +REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ +REPLACE_TRUNCATE = @REPLACE_TRUNCATE@ +REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ +REPLACE_TZSET = @REPLACE_TZSET@ +REPLACE_UNLINK = @REPLACE_UNLINK@ +REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ +REPLACE_UNSETENV = @REPLACE_UNSETENV@ +REPLACE_USLEEP = @REPLACE_USLEEP@ +REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSFTIME = @REPLACE_WCSFTIME@ +REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ +REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCTOMB = @REPLACE_WCTOMB@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SRC_VERSION_C = @SRC_VERSION_C@ +STDALIGN_H = @STDALIGN_H@ +STDARG_H = @STDARG_H@ +STDBOOL_H = @STDBOOL_H@ +STDDEF_H = @STDDEF_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@ +SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ +UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ +UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WERROR_CFLAGS = @WERROR_CFLAGS@ +WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ +WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@ +WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_aux_dir = @abs_aux_dir@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__rm_f_notfound = @am__rm_f_notfound@ +am__tar = @am__tar@ +am__untar = @am__untar@ +am__xargs_n = @am__xargs_n@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ +gltests_WITNESS = @gltests_WITNESS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +lispdir = @lispdir@ +localedir = $(datadir)/locale +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = -I../lib -I$(top_srcdir)/lib +AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) +LDADD = \ + libver.a \ + ../lib/libdiffutils.a \ + $(LIBCSTACK) \ + $(LIBINTL) \ + $(LIBICONV) \ + $(LIBSIGSEGV) \ + $(LIB_CLOCK_GETTIME) + +diff_LDADD = $(LDADD) +cmp_LDADD = $(LDADD) +sdiff_LDADD = $(LDADD) +diff3_LDADD = $(LDADD) +cmp_SOURCES = cmp.c +diff3_SOURCES = diff3.c +sdiff_SOURCES = sdiff.c +diff_SOURCES = \ + analyze.c context.c diff.c dir.c ed.c ifdef.c io.c \ + normal.c side.c util.c + +noinst_HEADERS = \ + die.h \ + diff.h \ + system.h + +MOSTLYCLEANFILES = paths.h paths.ht +gdiff = `echo diff|sed '$(transform)'` +BUILT_SOURCES = paths.h version.c version.h +noinst_LIBRARIES = libver.a +nodist_libver_a_SOURCES = version.c version.h +DISTCLEANFILES = version.c version.h +MAINTAINERCLEANFILES = $(BUILT_SOURCES) +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && $(am__rm_f) $$files + +clean-binPROGRAMS: + -$(am__rm_f) $(bin_PROGRAMS) + +clean-noinstLIBRARIES: + -$(am__rm_f) $(noinst_LIBRARIES) + +libver.a: $(libver_a_OBJECTS) $(libver_a_DEPENDENCIES) $(EXTRA_libver_a_DEPENDENCIES) + $(AM_V_at)-rm -f libver.a + $(AM_V_AR)$(libver_a_AR) libver.a $(libver_a_OBJECTS) $(libver_a_LIBADD) + $(AM_V_at)$(libver_a_RANLIB) libver.a + +cmp$(EXEEXT): $(cmp_OBJECTS) $(cmp_DEPENDENCIES) $(EXTRA_cmp_DEPENDENCIES) + @rm -f cmp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(cmp_OBJECTS) $(cmp_LDADD) $(LIBS) + +diff$(EXEEXT): $(diff_OBJECTS) $(diff_DEPENDENCIES) $(EXTRA_diff_DEPENDENCIES) + @rm -f diff$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(diff_OBJECTS) $(diff_LDADD) $(LIBS) + +diff3$(EXEEXT): $(diff3_OBJECTS) $(diff3_DEPENDENCIES) $(EXTRA_diff3_DEPENDENCIES) + @rm -f diff3$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(diff3_OBJECTS) $(diff3_LDADD) $(LIBS) + +sdiff$(EXEEXT): $(sdiff_OBJECTS) $(sdiff_DEPENDENCIES) $(EXTRA_sdiff_DEPENDENCIES) + @rm -f sdiff$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sdiff_OBJECTS) $(sdiff_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/analyze.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/context.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diff.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diff3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ed.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ifdef.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/normal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdiff.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/side.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @: >>$@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(PROGRAMS) $(LIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -$(am__rm_f) $(MOSTLYCLEANFILES) + +clean-generic: + +distclean-generic: + -$(am__rm_f) $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) + -$(am__rm_f) $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -$(am__rm_f) $(BUILT_SOURCES) + -$(am__rm_f) $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/analyze.Po + -rm -f ./$(DEPDIR)/cmp.Po + -rm -f ./$(DEPDIR)/context.Po + -rm -f ./$(DEPDIR)/diff.Po + -rm -f ./$(DEPDIR)/diff3.Po + -rm -f ./$(DEPDIR)/dir.Po + -rm -f ./$(DEPDIR)/ed.Po + -rm -f ./$(DEPDIR)/ifdef.Po + -rm -f ./$(DEPDIR)/io.Po + -rm -f ./$(DEPDIR)/normal.Po + -rm -f ./$(DEPDIR)/sdiff.Po + -rm -f ./$(DEPDIR)/side.Po + -rm -f ./$(DEPDIR)/util.Po + -rm -f ./$(DEPDIR)/version.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/analyze.Po + -rm -f ./$(DEPDIR)/cmp.Po + -rm -f ./$(DEPDIR)/context.Po + -rm -f ./$(DEPDIR)/diff.Po + -rm -f ./$(DEPDIR)/diff3.Po + -rm -f ./$(DEPDIR)/dir.Po + -rm -f ./$(DEPDIR)/ed.Po + -rm -f ./$(DEPDIR)/ifdef.Po + -rm -f ./$(DEPDIR)/io.Po + -rm -f ./$(DEPDIR)/normal.Po + -rm -f ./$(DEPDIR)/sdiff.Po + -rm -f ./$(DEPDIR)/side.Po + -rm -f ./$(DEPDIR)/util.Po + -rm -f ./$(DEPDIR)/version.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: all check install install-am install-exec install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-binPROGRAMS + +.PRECIOUS: Makefile + + +cmp.$(OBJEXT) diff3.$(OBJEXT) diff.$(OBJEXT) sdiff.$(OBJEXT): paths.h +paths.h: Makefile.am + $(AM_V_GEN)(echo '#define DEFAULT_DIFF_PROGRAM "'$(gdiff)'"' && \ + echo '#define LOCALEDIR "$(localedir)"') >$@t && mv $@t $@ +version.c: Makefile + $(AM_V_GEN)rm -f $@ + $(AM_V_at)printf '#include <config.h>\n' > $@t + $(AM_V_at)printf 'char const *Version = "$(PACKAGE_VERSION)";\n' >> $@t + $(AM_V_at)chmod a-w $@t + $(AM_V_at)mv $@t $@ +version.h: Makefile + $(AM_V_GEN)rm -f $@ + $(AM_V_at)printf 'extern char const *Version;\n' > $@t + $(AM_V_at)chmod a-w $@t + $(AM_V_at)mv $@t $@ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: + +# Tell GNU make to disable its built-in pattern rules. +%:: %,v +%:: RCS/%,v +%:: RCS/% +%:: s.% +%:: SCCS/s.% diff --git a/local/recipes/tools/diffutils/source/src/analyze.c b/local/recipes/tools/diffutils/source/src/analyze.c new file mode 100644 index 0000000000..403ae73b25 --- /dev/null +++ b/local/recipes/tools/diffutils/source/src/analyze.c @@ -0,0 +1,716 @@ +/* Analyze file differences for GNU DIFF. + + Copyright (C) 1988-1989, 1992-1995, 1998, 2001-2002, 2004, 2006-2007, + 2009-2013, 2015-2017 Free Software Foundation, Inc. + + This file is part of GNU DIFF. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include "diff.h" +#include <cmpbuf.h> +#include <error.h> +#include <file-type.h> +#include <xalloc.h> + +/* The core of the Diff algorithm. */ +#define ELEMENT lin +#define EQUAL(x,y) ((x) == (y)) +#define OFFSET lin +#define EXTRA_CONTEXT_FIELDS /* none */ +#define NOTE_DELETE(c, xoff) (files[0].changed[files[0].realindexes[xoff]] = 1) +#define NOTE_INSERT(c, yoff) (files[1].changed[files[1].realindexes[yoff]] = 1) +#define USE_HEURISTIC 1 +#include <diffseq.h> + +/* Discard lines from one file that have no matches in the other file. + + A line which is discarded will not be considered by the actual + comparison algorithm; it will be as if that line were not in the file. + The file's 'realindexes' table maps virtual line numbers + (which don't count the discarded lines) into real line numbers; + this is how the actual comparison algorithm produces results + that are comprehensible when the discarded lines are counted. + + When we discard a line, we also mark it as a deletion or insertion + so that it will be printed in the output. */ + +static void +discard_confusing_lines (struct file_data filevec[]) +{ + int f; + lin i; + char *discarded[2]; + lin *equiv_count[2]; + lin *p; + + /* Allocate our results. */ + p = xmalloc ((filevec[0].buffered_lines + filevec[1].buffered_lines) + * (2 * sizeof *p)); + for (f = 0; f < 2; f++) + { + filevec[f].undiscarded = p; p += filevec[f].buffered_lines; + filevec[f].realindexes = p; p += filevec[f].buffered_lines; + } + + /* Set up equiv_count[F][I] as the number of lines in file F + that fall in equivalence class I. */ + + p = zalloc (filevec[0].equiv_max * (2 * sizeof *p)); + equiv_count[0] = p; + equiv_count[1] = p + filevec[0].equiv_max; + + for (i = 0; i < filevec[0].buffered_lines; ++i) + ++equiv_count[0][filevec[0].equivs[i]]; + for (i = 0; i < filevec[1].buffered_lines; ++i) + ++equiv_count[1][filevec[1].equivs[i]]; + + /* Set up tables of which lines are going to be discarded. */ + + discarded[0] = zalloc (filevec[0].buffered_lines + + filevec[1].buffered_lines); + discarded[1] = discarded[0] + filevec[0].buffered_lines; + + /* Mark to be discarded each line that matches no line of the other file. + If a line matches many lines, mark it as provisionally discardable. */ + + for (f = 0; f < 2; f++) + { + size_t end = filevec[f].buffered_lines; + char *discards = discarded[f]; + lin *counts = equiv_count[1 - f]; + lin *equivs = filevec[f].equivs; + size_t many = 5; + size_t tem = end / 64; + + /* Multiply MANY by approximate square root of number of lines. + That is the threshold for provisionally discardable lines. */ + while ((tem = tem >> 2) > 0) + many *= 2; + + for (i = 0; i < end; i++) + { + lin nmatch; + if (equivs[i] == 0) + continue; + nmatch = counts[equivs[i]]; + if (nmatch == 0) + discards[i] = 1; + else if (nmatch > many) + discards[i] = 2; + } + } + + /* Don't really discard the provisional lines except when they occur + in a run of discardables, with nonprovisionals at the beginning + and end. */ + + for (f = 0; f < 2; f++) + { + lin end = filevec[f].buffered_lines; + register char *discards = discarded[f]; + + for (i = 0; i < end; i++) + { + /* Cancel provisional discards not in middle of run of discards. */ + if (discards[i] == 2) + discards[i] = 0; + else if (discards[i] != 0) + { + /* We have found a nonprovisional discard. */ + register lin j; + lin length; + lin provisional = 0; + + /* Find end of this run of discardable lines. + Count how many are provisionally discardable. */ + for (j = i; j < end; j++) + { + if (discards[j] == 0) + break; + if (discards[j] == 2) + ++provisional; + } + + /* Cancel provisional discards at end, and shrink the run. */ + while (j > i && discards[j - 1] == 2) + discards[--j] = 0, --provisional; + + /* Now we have the length of a run of discardable lines + whose first and last are not provisional. */ + length = j - i; + + /* If 1/4 of the lines in the run are provisional, + cancel discarding of all provisional lines in the run. */ + if (provisional * 4 > length) + { + while (j > i) + if (discards[--j] == 2) + discards[j] = 0; + } + else + { + register lin consec; + lin minimum = 1; + lin tem = length >> 2; + + /* MINIMUM is approximate square root of LENGTH/4. + A subrun of two or more provisionals can stand + when LENGTH is at least 16. + A subrun of 4 or more can stand when LENGTH >= 64. */ + while (0 < (tem >>= 2)) + minimum <<= 1; + minimum++; + + /* Cancel any subrun of MINIMUM or more provisionals + within the larger run. */ + for (j = 0, consec = 0; j < length; j++) + if (discards[i + j] != 2) + consec = 0; + else if (minimum == ++consec) + /* Back up to start of subrun, to cancel it all. */ + j -= consec; + else if (minimum < consec) + discards[i + j] = 0; + + /* Scan from beginning of run + until we find 3 or more nonprovisionals in a row + or until the first nonprovisional at least 8 lines in. + Until that point, cancel any provisionals. */ + for (j = 0, consec = 0; j < length; j++) + { + if (j >= 8 && discards[i + j] == 1) + break; + if (discards[i + j] == 2) + consec = 0, discards[i + j] = 0; + else if (discards[i + j] == 0) + consec = 0; + else + consec++; + if (consec == 3) + break; + } + + /* I advances to the last line of the run. */ + i += length - 1; + + /* Same thing, from end. */ + for (j = 0, consec = 0; j < length; j++) + { + if (j >= 8 && discards[i - j] == 1) + break; + if (discards[i - j] == 2) + consec = 0, discards[i - j] = 0; + else if (discards[i - j] == 0) + consec = 0; + else + consec++; + if (consec == 3) + break; + } + } + } + } + } + + /* Actually discard the lines. */ + for (f = 0; f < 2; f++) + { + char *discards = discarded[f]; + lin end = filevec[f].buffered_lines; + lin j = 0; + for (i = 0; i < end; ++i) + if (minimal || discards[i] == 0) + { + filevec[f].undiscarded[j] = filevec[f].equivs[i]; + filevec[f].realindexes[j++] = i; + } + else + filevec[f].changed[i] = 1; + filevec[f].nondiscarded_lines = j; + } + + free (discarded[0]); + free (equiv_count[0]); +} + +/* Adjust inserts/deletes of identical lines to join changes + as much as possible. + + We do something when a run of changed lines include a + line at one end and have an excluded, identical line at the other. + We are free to choose which identical line is included. + 'compareseq' usually chooses the one at the beginning, + but usually it is cleaner to consider the following identical line + to be the "change". */ + +static void +shift_boundaries (struct file_data filevec[]) +{ + int f; + + for (f = 0; f < 2; f++) + { + char *changed = filevec[f].changed; + char *other_changed = filevec[1 - f].changed; + lin const *equivs = filevec[f].equivs; + lin i = 0; + lin j = 0; + lin i_end = filevec[f].buffered_lines; + + while (1) + { + lin runlength, start, corresponding; + + /* Scan forwards to find beginning of another run of changes. + Also keep track of the corresponding point in the other file. */ + + while (i < i_end && !changed[i]) + { + while (other_changed[j++]) + continue; + i++; + } + + if (i == i_end) + break; + + start = i; + + /* Find the end of this run of changes. */ + + while (changed[++i]) + continue; + while (other_changed[j]) + j++; + + do + { + /* Record the length of this run of changes, so that + we can later determine whether the run has grown. */ + runlength = i - start; + + /* Move the changed region back, so long as the + previous unchanged line matches the last changed one. + This merges with previous changed regions. */ + + while (start && equivs[start - 1] == equivs[i - 1]) + { + changed[--start] = 1; + changed[--i] = 0; + while (changed[start - 1]) + start--; + while (other_changed[--j]) + continue; + } + + /* Set CORRESPONDING to the end of the changed run, at the last + point where it corresponds to a changed run in the other file. + CORRESPONDING == I_END means no such point has been found. */ + corresponding = other_changed[j - 1] ? i : i_end; + + /* Move the changed region forward, so long as the + first changed line matches the following unchanged one. + This merges with following changed regions. + Do this second, so that if there are no merges, + the changed region is moved forward as far as possible. */ + + while (i != i_end && equivs[start] == equivs[i]) + { + changed[start++] = 0; + changed[i++] = 1; + while (changed[i]) + i++; + while (other_changed[++j]) + corresponding = i; + } + } + while (runlength != i - start); + + /* If possible, move the fully-merged run of changes + back to a corresponding run in the other file. */ + + while (corresponding < i) + { + changed[--start] = 1; + changed[--i] = 0; + while (other_changed[--j]) + continue; + } + } + } +} + +/* Cons an additional entry onto the front of an edit script OLD. + LINE0 and LINE1 are the first affected lines in the two files (origin 0). + DELETED is the number of lines deleted here from file 0. + INSERTED is the number of lines inserted here in file 1. + + If DELETED is 0 then LINE0 is the number of the line before + which the insertion was done; vice versa for INSERTED and LINE1. */ + +static struct change * +add_change (lin line0, lin line1, lin deleted, lin inserted, + struct change *old) +{ + struct change *new = xmalloc (sizeof *new); + + new->line0 = line0; + new->line1 = line1; + new->inserted = inserted; + new->deleted = deleted; + new->link = old; + return new; +} + +/* Scan the tables of which lines are inserted and deleted, + producing an edit script in reverse order. */ + +static struct change * +build_reverse_script (struct file_data const filevec[]) +{ + struct change *script = 0; + char *changed0 = filevec[0].changed; + char *changed1 = filevec[1].changed; + lin len0 = filevec[0].buffered_lines; + lin len1 = filevec[1].buffered_lines; + + /* Note that changedN[lenN] does exist, and is 0. */ + + lin i0 = 0, i1 = 0; + + while (i0 < len0 || i1 < len1) + { + if (changed0[i0] | changed1[i1]) + { + lin line0 = i0, line1 = i1; + + /* Find # lines changed here in each file. */ + while (changed0[i0]) ++i0; + while (changed1[i1]) ++i1; + + /* Record this change. */ + script = add_change (line0, line1, i0 - line0, i1 - line1, script); + } + + /* We have reached lines in the two files that match each other. */ + i0++, i1++; + } + + return script; +} + +/* Scan the tables of which lines are inserted and deleted, + producing an edit script in forward order. */ + +static struct change * +build_script (struct file_data const filevec[]) +{ + struct change *script = 0; + char *changed0 = filevec[0].changed; + char *changed1 = filevec[1].changed; + lin i0 = filevec[0].buffered_lines, i1 = filevec[1].buffered_lines; + + /* Note that changedN[-1] does exist, and is 0. */ + + while (i0 >= 0 || i1 >= 0) + { + if (changed0[i0 - 1] | changed1[i1 - 1]) + { + lin line0 = i0, line1 = i1; + + /* Find # lines changed here in each file. */ + while (changed0[i0 - 1]) --i0; + while (changed1[i1 - 1]) --i1; + + /* Record this change. */ + script = add_change (i0, i1, line0 - i0, line1 - i1, script); + } + + /* We have reached lines in the two files that match each other. */ + i0--, i1--; + } + + return script; +} + +/* If CHANGES, briefly report that two files differed. */ +static void +briefly_report (int changes, struct file_data const filevec[]) +{ + if (changes) + message ((brief + ? _("Files %s and %s differ\n") + : _("Binary files %s and %s differ\n")), + file_label[0] ? file_label[0] : filevec[0].name, + file_label[1] ? file_label[1] : filevec[1].name); +} + +/* Report the differences of two files. */ +int +diff_2_files (struct comparison *cmp) +{ + int f; + struct change *e, *p; + struct change *script; + int changes; + + + /* If we have detected that either file is binary, + compare the two files as binary. This can happen + only when the first chunk is read. + Also, --brief without any --ignore-* options means + we can speed things up by treating the files as binary. */ + + if (read_files (cmp->file, files_can_be_treated_as_binary)) + { + /* Files with different lengths must be different. */ + if (cmp->file[0].stat.st_size != cmp->file[1].stat.st_size + && 0 < cmp->file[0].stat.st_size + && 0 < cmp->file[1].stat.st_size + && (cmp->file[0].desc < 0 || S_ISREG (cmp->file[0].stat.st_mode)) + && (cmp->file[1].desc < 0 || S_ISREG (cmp->file[1].stat.st_mode))) + changes = 1; + + /* Standard input equals itself. */ + else if (cmp->file[0].desc == cmp->file[1].desc) + changes = 0; + + else + /* Scan both files, a buffer at a time, looking for a difference. */ + { + /* Allocate same-sized buffers for both files. */ + size_t lcm_max = PTRDIFF_MAX - 1; + size_t buffer_size = + buffer_lcm (sizeof (word), + buffer_lcm (STAT_BLOCKSIZE (cmp->file[0].stat), + STAT_BLOCKSIZE (cmp->file[1].stat), + lcm_max), + lcm_max); + for (f = 0; f < 2; f++) + cmp->file[f].buffer = xrealloc (cmp->file[f].buffer, buffer_size); + + for (;; cmp->file[0].buffered = cmp->file[1].buffered = 0) + { + /* Read a buffer's worth from both files. */ + for (f = 0; f < 2; f++) + if (0 <= cmp->file[f].desc) + file_block_read (&cmp->file[f], + buffer_size - cmp->file[f].buffered); + + /* If the buffers differ, the files differ. */ + if (cmp->file[0].buffered != cmp->file[1].buffered + || memcmp (cmp->file[0].buffer, + cmp->file[1].buffer, + cmp->file[0].buffered)) + { + changes = 1; + break; + } + + /* If we reach end of file, the files are the same. */ + if (cmp->file[0].buffered != buffer_size) + { + changes = 0; + break; + } + } + } + + briefly_report (changes, cmp->file); + } + else + { + struct context ctxt; + lin diags; + lin too_expensive; + + /* Allocate vectors for the results of comparison: + a flag for each line of each file, saying whether that line + is an insertion or deletion. + Allocate an extra element, always 0, at each end of each vector. */ + + size_t s = cmp->file[0].buffered_lines + cmp->file[1].buffered_lines + 4; + char *flag_space = zalloc (s); + cmp->file[0].changed = flag_space + 1; + cmp->file[1].changed = flag_space + cmp->file[0].buffered_lines + 3; + + /* Some lines are obviously insertions or deletions + because they don't match anything. Detect them now, and + avoid even thinking about them in the main comparison algorithm. */ + + discard_confusing_lines (cmp->file); + + /* Now do the main comparison algorithm, considering just the + undiscarded lines. */ + + ctxt.xvec = cmp->file[0].undiscarded; + ctxt.yvec = cmp->file[1].undiscarded; + diags = (cmp->file[0].nondiscarded_lines + + cmp->file[1].nondiscarded_lines + 3); + ctxt.fdiag = xmalloc (diags * (2 * sizeof *ctxt.fdiag)); + ctxt.bdiag = ctxt.fdiag + diags; + ctxt.fdiag += cmp->file[1].nondiscarded_lines + 1; + ctxt.bdiag += cmp->file[1].nondiscarded_lines + 1; + + ctxt.heuristic = speed_large_files; + + /* Set TOO_EXPENSIVE to be the approximate square root of the + input size, bounded below by 4096. 4096 seems to be good for + circa-2016 CPUs; see Bug#16848 and Bug#24715. */ + too_expensive = 1; + for (; diags != 0; diags >>= 2) + too_expensive <<= 1; + ctxt.too_expensive = MAX (4096, too_expensive); + + files[0] = cmp->file[0]; + files[1] = cmp->file[1]; + + compareseq (0, cmp->file[0].nondiscarded_lines, + 0, cmp->file[1].nondiscarded_lines, minimal, &ctxt); + + free (ctxt.fdiag - (cmp->file[1].nondiscarded_lines + 1)); + + /* Modify the results slightly to make them prettier + in cases where that can validly be done. */ + + shift_boundaries (cmp->file); + + /* Get the results of comparison in the form of a chain + of 'struct change's -- an edit script. */ + + if (output_style == OUTPUT_ED) + script = build_reverse_script (cmp->file); + else + script = build_script (cmp->file); + + /* Set CHANGES if we had any diffs. + If some changes are ignored, we must scan the script to decide. */ + if (ignore_blank_lines || ignore_regexp.fastmap) + { + struct change *next = script; + changes = 0; + + while (next && changes == 0) + { + struct change *this, *end; + lin first0, last0, first1, last1; + + /* Find a set of changes that belong together. */ + this = next; + end = find_change (next); + + /* Disconnect them from the rest of the changes, making them + a hunk, and remember the rest for next iteration. */ + next = end->link; + end->link = 0; + + /* Determine whether this hunk is really a difference. */ + if (analyze_hunk (this, &first0, &last0, &first1, &last1)) + changes = 1; + + /* Reconnect the script so it will all be freed properly. */ + end->link = next; + } + } + else + changes = (script != 0); + + if (brief) + briefly_report (changes, cmp->file); + else + { + if (changes || !no_diff_means_no_output) + { + /* Record info for starting up output, + to be used if and when we have some output to print. */ + setup_output (file_label[0] ? file_label[0] : cmp->file[0].name, + file_label[1] ? file_label[1] : cmp->file[1].name, + cmp->parent != 0); + + switch (output_style) + { + case OUTPUT_CONTEXT: + print_context_script (script, false); + break; + + case OUTPUT_UNIFIED: + print_context_script (script, true); + break; + + case OUTPUT_ED: + print_ed_script (script); + break; + + case OUTPUT_FORWARD_ED: + pr_forward_ed_script (script); + break; + + case OUTPUT_RCS: + print_rcs_script (script); + break; + + case OUTPUT_NORMAL: + print_normal_script (script); + break; + + case OUTPUT_IFDEF: + print_ifdef_script (script); + break; + + case OUTPUT_SDIFF: + print_sdiff_script (script); + break; + + default: + abort (); + } + + finish_output (); + } + } + + free (cmp->file[0].undiscarded); + + free (flag_space); + + for (f = 0; f < 2; f++) + { + free (cmp->file[f].equivs); + free (cmp->file[f].linbuf + cmp->file[f].linbuf_base); + } + + for (e = script; e; e = p) + { + p = e->link; + free (e); + } + + if (! ROBUST_OUTPUT_STYLE (output_style)) + for (f = 0; f < 2; ++f) + if (cmp->file[f].missing_newline) + { + error (0, 0, "%s: %s\n", + file_label[f] ? file_label[f] : cmp->file[f].name, + _("No newline at end of file")); + changes = 2; + } + } + + if (cmp->file[0].buffer != cmp->file[1].buffer) + free (cmp->file[0].buffer); + free (cmp->file[1].buffer); + + return changes; +} diff --git a/local/recipes/tools/diffutils/source/src/cmp.c b/local/recipes/tools/diffutils/source/src/cmp.c new file mode 100644 index 0000000000..bc39153634 --- /dev/null +++ b/local/recipes/tools/diffutils/source/src/cmp.c @@ -0,0 +1,693 @@ +/* cmp - compare two files byte by byte + + Copyright (C) 1990-1996, 1998, 2001-2002, 2004, 2006-2007, 2009-2013, + 2015-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include "system.h" +#include "paths.h" + +#include <stdio.h> + +#include <c-stack.h> +#include <cmpbuf.h> +#include "die.h" +#include <error.h> +#include <exitfail.h> +#include <file-type.h> +#include <getopt.h> +#include <hard-locale.h> +#include <inttostr.h> +#include <progname.h> +#include <unlocked-io.h> +#include <version-etc.h> +#include <xalloc.h> +#include <binary-io.h> +#include <xstrtol.h> + +/* The official name of this program (e.g., no 'g' prefix). */ +#define PROGRAM_NAME "cmp" + +#define AUTHORS \ + proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \ + proper_name ("David MacKenzie") + +#if defined LC_MESSAGES && ENABLE_NLS +# define hard_locale_LC_MESSAGES hard_locale (LC_MESSAGES) +#else +# define hard_locale_LC_MESSAGES 0 +#endif + +static int cmp (void); +static off_t file_position (int); +static size_t block_compare (word const *, word const *) _GL_ATTRIBUTE_PURE; +static size_t count_newlines (char *, size_t); +static void sprintc (char *, unsigned char); + +/* Filenames of the compared files. */ +static char const *file[2]; + +/* File descriptors of the files. */ +static int file_desc[2]; + +/* Status of the files. */ +static struct stat stat_buf[2]; + +/* Read buffers for the files. */ +static word *buffer[2]; + +/* Optimal block size for the files. */ +static size_t buf_size; + +/* Initial prefix to ignore for each file. */ +static off_t ignore_initial[2]; + +/* Number of bytes to compare. */ +static uintmax_t bytes = UINTMAX_MAX; + +/* Output format. */ +static enum comparison_type + { + type_first_diff, /* Print the first difference. */ + type_all_diffs, /* Print all differences. */ + type_no_stdout, /* Do not output to stdout; only stderr. */ + type_status /* Exit status only. */ + } comparison_type; + +/* If nonzero, print values of bytes quoted like cat -t does. */ +static bool opt_print_bytes; + +/* Values for long options that do not have single-letter equivalents. */ +enum +{ + HELP_OPTION = CHAR_MAX + 1 +}; + +static struct option const long_options[] = +{ + {"print-bytes", 0, 0, 'b'}, + {"print-chars", 0, 0, 'c'}, /* obsolescent as of diffutils 2.7.3 */ + {"ignore-initial", 1, 0, 'i'}, + {"verbose", 0, 0, 'l'}, + {"bytes", 1, 0, 'n'}, + {"silent", 0, 0, 's'}, + {"quiet", 0, 0, 's'}, + {"version", 0, 0, 'v'}, + {"help", 0, 0, HELP_OPTION}, + {0, 0, 0, 0} +}; + +static void try_help (char const *, char const *) __attribute__((noreturn)); +static void +try_help (char const *reason_msgid, char const *operand) +{ + if (reason_msgid) + error (0, 0, _(reason_msgid), operand); + die (EXIT_TROUBLE, 0, + _("Try '%s --help' for more information."), program_name); +} + +static char const valid_suffixes[] = "kKMGTPEZY0"; + +/* Update ignore_initial[F] according to the result of parsing an + *operand ARGPTR of --ignore-initial, updating *ARGPTR to point + *after the operand. If DELIMITER is nonzero, the operand may be + *followed by DELIMITER; otherwise it must be null-terminated. */ +static void +specify_ignore_initial (int f, char **argptr, char delimiter) +{ + uintmax_t val; + char const *arg = *argptr; + strtol_error e = xstrtoumax (arg, argptr, 0, &val, valid_suffixes); + if (! (e == LONGINT_OK + || (e == LONGINT_INVALID_SUFFIX_CHAR && **argptr == delimiter)) + || TYPE_MAXIMUM (off_t) < val) + try_help ("invalid --ignore-initial value '%s'", arg); + if (ignore_initial[f] < val) + ignore_initial[f] = val; +} + +/* Specify the output format. */ +static void +specify_comparison_type (enum comparison_type t) +{ + if (comparison_type && comparison_type != t) + try_help ("options -l and -s are incompatible", 0); + comparison_type = t; +} + +static void +check_stdout (void) +{ + if (ferror (stdout)) + die (EXIT_TROUBLE, 0, "%s", _("write failed")); + else if (fclose (stdout) != 0) + die (EXIT_TROUBLE, errno, "%s", _("standard output")); +} + +static char const * const option_help_msgid[] = { + N_("-b, --print-bytes print differing bytes"), + N_("-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"), + N_("-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n" + " first SKIP2 bytes of FILE2"), + N_("-l, --verbose output byte numbers and differing byte values"), + N_("-n, --bytes=LIMIT compare at most LIMIT bytes"), + N_("-s, --quiet, --silent suppress all normal output"), + N_(" --help display this help and exit"), + N_("-v, --version output version information and exit"), + 0 +}; + +static void +usage (void) +{ + char const * const *p; + + printf (_("Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"), + program_name); + printf ("%s\n", _("Compare two files byte by byte.")); + printf ("\n%s\n\n", +_("The optional SKIP1 and SKIP2 specify the number of bytes to skip\n" + "at the beginning of each file (zero by default).")); + + fputs (_("\ +Mandatory arguments to long options are mandatory for short options too.\n\ +"), stdout); + for (p = option_help_msgid; *p; p++) + printf (" %s\n", _(*p)); + printf ("\n%s\n\n%s\n%s\n", + _("SKIP values may be followed by the following multiplicative suffixes:\n\ +kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n\ +GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."), + _("If a FILE is '-' or missing, read standard input."), + _("Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.")); + emit_bug_reporting_address (); +} + +int +main (int argc, char **argv) +{ + int c, f, exit_status; + size_t words_per_buffer; + + exit_failure = EXIT_TROUBLE; + initialize_main (&argc, &argv); + set_program_name (argv[0]); + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + c_stack_action (0); + + /* Parse command line options. */ + + while ((c = getopt_long (argc, argv, "bci:ln:sv", long_options, 0)) + != -1) + switch (c) + { + case 'b': + case 'c': /* 'c' is obsolescent as of diffutils 2.7.3 */ + opt_print_bytes = true; + break; + + case 'i': + specify_ignore_initial (0, &optarg, ':'); + if (*optarg++ == ':') + specify_ignore_initial (1, &optarg, 0); + else if (ignore_initial[1] < ignore_initial[0]) + ignore_initial[1] = ignore_initial[0]; + break; + + case 'l': + specify_comparison_type (type_all_diffs); + break; + + case 'n': + { + uintmax_t n; + if (xstrtoumax (optarg, 0, 0, &n, valid_suffixes) != LONGINT_OK) + try_help ("invalid --bytes value '%s'", optarg); + if (n < bytes) + bytes = n; + } + break; + + case 's': + specify_comparison_type (type_status); + break; + + case 'v': + version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version, + AUTHORS, (char *) NULL); + check_stdout (); + return EXIT_SUCCESS; + + case HELP_OPTION: + usage (); + check_stdout (); + return EXIT_SUCCESS; + + default: + try_help (0, 0); + } + + if (optind == argc) + try_help ("missing operand after '%s'", argv[argc - 1]); + + file[0] = argv[optind++]; + file[1] = optind < argc ? argv[optind++] : "-"; + + for (f = 0; f < 2 && optind < argc; f++) + { + char *arg = argv[optind++]; + specify_ignore_initial (f, &arg, 0); + } + + if (optind < argc) + try_help ("extra operand '%s'", argv[optind]); + + for (f = 0; f < 2; f++) + { + /* If file[1] is "-", treat it first; this avoids a misdiagnostic if + stdin is closed and opening file[0] yields file descriptor 0. */ + int f1 = f ^ (STREQ (file[1], "-")); + + /* Two files with the same name and offset are identical. + But wait until we open the file once, for proper diagnostics. */ + if (f && ignore_initial[0] == ignore_initial[1] + && file_name_cmp (file[0], file[1]) == 0) + return EXIT_SUCCESS; + + if (STREQ (file[f1], "-")) + { + file_desc[f1] = STDIN_FILENO; + if (O_BINARY && ! isatty (STDIN_FILENO)) + set_binary_mode (STDIN_FILENO, O_BINARY); + } + else + file_desc[f1] = open (file[f1], O_RDONLY | O_BINARY, 0); + + if (file_desc[f1] < 0 || fstat (file_desc[f1], stat_buf + f1) != 0) + { + if (file_desc[f1] < 0 && comparison_type == type_status) + exit (EXIT_TROUBLE); + else + die (EXIT_TROUBLE, errno, "%s", file[f1]); + } + } + + /* If the files are links to the same inode and have the same file position, + they are identical. */ + + if (0 < same_file (&stat_buf[0], &stat_buf[1]) + && same_file_attributes (&stat_buf[0], &stat_buf[1]) + && file_position (0) == file_position (1)) + return EXIT_SUCCESS; + + /* If output is redirected to the null device, we can avoid some of + the work. */ + + if (comparison_type != type_status) + { + struct stat outstat, nullstat; + + if (fstat (STDOUT_FILENO, &outstat) == 0 + && stat (NULL_DEVICE, &nullstat) == 0 + && 0 < same_file (&outstat, &nullstat)) + comparison_type = type_no_stdout; + } + + /* If only a return code is needed, + and if both input descriptors are associated with plain files, + conclude that the files differ if they have different sizes + and if more bytes will be compared than are in the smaller file. */ + + if (comparison_type == type_status + && S_ISREG (stat_buf[0].st_mode) + && S_ISREG (stat_buf[1].st_mode)) + { + off_t s0 = stat_buf[0].st_size - file_position (0); + off_t s1 = stat_buf[1].st_size - file_position (1); + if (s0 < 0) + s0 = 0; + if (s1 < 0) + s1 = 0; + if (s0 != s1 && MIN (s0, s1) < bytes) + exit (EXIT_FAILURE); + } + + /* Get the optimal block size of the files. */ + + buf_size = buffer_lcm (STAT_BLOCKSIZE (stat_buf[0]), + STAT_BLOCKSIZE (stat_buf[1]), + PTRDIFF_MAX - sizeof (word)); + + /* Allocate word-aligned buffers, with space for sentinels at the end. */ + + words_per_buffer = (buf_size + 2 * sizeof (word) - 1) / sizeof (word); + buffer[0] = xmalloc (2 * sizeof (word) * words_per_buffer); + buffer[1] = buffer[0] + words_per_buffer; + + exit_status = cmp (); + + for (f = 0; f < 2; f++) + if (close (file_desc[f]) != 0) + die (EXIT_TROUBLE, errno, "%s", file[f]); + if (exit_status != EXIT_SUCCESS && comparison_type < type_no_stdout) + check_stdout (); + exit (exit_status); + return exit_status; +} + +/* Compare the two files already open on 'file_desc[0]' and 'file_desc[1]', + using 'buffer[0]' and 'buffer[1]'. + Return EXIT_SUCCESS if identical, EXIT_FAILURE if different, + >1 if error. */ + +static int +cmp (void) +{ + bool at_line_start = true; + off_t line_number = 1; /* Line number (1...) of difference. */ + off_t byte_number = 1; /* Byte number (1...) of difference. */ + uintmax_t remaining = bytes; /* Remaining number of bytes to compare. */ + size_t read0, read1; /* Number of bytes read from each file. */ + size_t first_diff; /* Offset (0...) in buffers of 1st diff. */ + size_t smaller; /* The lesser of 'read0' and 'read1'. */ + word *buffer0 = buffer[0]; + word *buffer1 = buffer[1]; + char *buf0 = (char *) buffer0; + char *buf1 = (char *) buffer1; + int differing = 0; + int f; + int offset_width IF_LINT (= 0); + + if (comparison_type == type_all_diffs) + { + off_t byte_number_max = MIN (bytes, TYPE_MAXIMUM (off_t)); + + for (f = 0; f < 2; f++) + if (S_ISREG (stat_buf[f].st_mode)) + { + off_t file_bytes = stat_buf[f].st_size - file_position (f); + if (file_bytes < byte_number_max) + byte_number_max = file_bytes; + } + + for (offset_width = 1; (byte_number_max /= 10) != 0; offset_width++) + continue; + } + + for (f = 0; f < 2; f++) + { + off_t ig = ignore_initial[f]; + if (ig && file_position (f) == -1) + { + /* lseek failed; read and discard the ignored initial prefix. */ + do + { + size_t bytes_to_read = MIN (ig, buf_size); + size_t r = block_read (file_desc[f], buf0, bytes_to_read); + if (r != bytes_to_read) + { + if (r == SIZE_MAX) + die (EXIT_TROUBLE, errno, "%s", file[f]); + break; + } + ig -= r; + } + while (ig); + } + } + + do + { + size_t bytes_to_read = buf_size; + + if (remaining != UINTMAX_MAX) + { + if (remaining < bytes_to_read) + bytes_to_read = remaining; + remaining -= bytes_to_read; + } + + read0 = block_read (file_desc[0], buf0, bytes_to_read); + if (read0 == SIZE_MAX) + die (EXIT_TROUBLE, errno, "%s", file[0]); + read1 = block_read (file_desc[1], buf1, bytes_to_read); + if (read1 == SIZE_MAX) + die (EXIT_TROUBLE, errno, "%s", file[1]); + + smaller = MIN (read0, read1); + + /* Optimize the common case where the buffers are the same. */ + if (memcmp (buf0, buf1, smaller) == 0) + first_diff = smaller; + else + { + /* Insert sentinels for the block compare. */ + buf0[read0] = ~buf1[read0]; + buf1[read1] = ~buf0[read1]; + + first_diff = block_compare (buffer0, buffer1); + } + + byte_number += first_diff; + if (comparison_type == type_first_diff && first_diff != 0) + { + line_number += count_newlines (buf0, first_diff); + at_line_start = buf0[first_diff - 1] == '\n'; + } + + if (first_diff < smaller) + { + switch (comparison_type) + { + case type_first_diff: + { + char byte_buf[INT_BUFSIZE_BOUND (off_t)]; + char line_buf[INT_BUFSIZE_BOUND (off_t)]; + char const *byte_num = offtostr (byte_number, byte_buf); + char const *line_num = offtostr (line_number, line_buf); + if (!opt_print_bytes) + { + /* See POSIX for this format. This message is + used only in the POSIX locale, so it need not + be translated. */ + static char const char_message[] = + "%s %s differ: char %s, line %s\n"; + + /* The POSIX rationale recommends using the word + "byte" outside the POSIX locale. Some gettext + implementations translate even in the POSIX + locale if certain other environment variables + are set, so use "byte" if a translation is + available, or if outside the POSIX locale. */ + static char const byte_msgid[] = + N_("%s %s differ: byte %s, line %s\n"); + char const *byte_message = _(byte_msgid); + bool use_byte_message = (byte_message != byte_msgid + || hard_locale_LC_MESSAGES); + + printf (use_byte_message ? byte_message : char_message, + file[0], file[1], byte_num, line_num); + } + else + { + unsigned char c0 = buf0[first_diff]; + unsigned char c1 = buf1[first_diff]; + char s0[5]; + char s1[5]; + sprintc (s0, c0); + sprintc (s1, c1); + printf (_("%s %s differ: byte %s, line %s is %3o %s %3o %s\n"), + file[0], file[1], byte_num, line_num, + c0, s0, c1, s1); + } + } + FALLTHROUGH; + case type_status: + return EXIT_FAILURE; + + case type_all_diffs: + do + { + unsigned char c0 = buf0[first_diff]; + unsigned char c1 = buf1[first_diff]; + if (c0 != c1) + { + char byte_buf[INT_BUFSIZE_BOUND (off_t)]; + char const *byte_num = offtostr (byte_number, byte_buf); + if (!opt_print_bytes) + { + /* See POSIX for this format. */ + printf ("%*s %3o %3o\n", + offset_width, byte_num, c0, c1); + } + else + { + char s0[5]; + char s1[5]; + sprintc (s0, c0); + sprintc (s1, c1); + printf ("%*s %3o %-4s %3o %s\n", + offset_width, byte_num, c0, s0, c1, s1); + } + } + byte_number++; + first_diff++; + } + while (first_diff < smaller); + differing = -1; + break; + + case type_no_stdout: + differing = 1; + break; + } + } + + if (read0 != read1) + { + if (differing <= 0 && comparison_type != type_status) + { + char const *shorter_file = file[read1 < read0]; + + /* POSIX says that each of these format strings must be + "cmp: EOF on %s", optionally followed by a blank and + extra text sans newline, then terminated by "\n". */ + if (byte_number == 1) + fprintf (stderr, _("cmp: EOF on %s which is empty\n"), + shorter_file); + else + { + char byte_buf[INT_BUFSIZE_BOUND (off_t)]; + char const *byte_num = offtostr (byte_number - 1, byte_buf); + + if (comparison_type == type_first_diff) + { + char line_buf[INT_BUFSIZE_BOUND (off_t)]; + char const *line_num + = offtostr (line_number - at_line_start, line_buf); + fprintf (stderr, + (at_line_start + ? _("cmp: EOF on %s after byte %s, line %s\n") + : _("cmp: EOF on %s after byte %s," + " in line %s\n")), + shorter_file, byte_num, line_num); + } + else + fprintf (stderr, + _("cmp: EOF on %s after byte %s\n"), + shorter_file, byte_num); + } + } + + return EXIT_FAILURE; + } + } + while (differing <= 0 && read0 == buf_size); + + return differing == 0 ? EXIT_SUCCESS : EXIT_FAILURE; +} + +/* Compare two blocks of memory P0 and P1 until they differ. + If the blocks are not guaranteed to be different, put sentinels at the ends + of the blocks before calling this function. + + Return the offset of the first byte that differs. */ + +static size_t +block_compare (word const *p0, word const *p1) +{ + word const *l0, *l1; + char const *c0, *c1; + + /* Find the rough position of the first difference by reading words, + not bytes. */ + + for (l0 = p0, l1 = p1; *l0 == *l1; l0++, l1++) + continue; + + /* Find the exact differing position (endianness independent). */ + + for (c0 = (char const *) l0, c1 = (char const *) l1; + *c0 == *c1; + c0++, c1++) + continue; + + return c0 - (char const *) p0; +} + +/* Return the number of newlines in BUF, of size BUFSIZE, + where BUF[NBYTES] is available for use as a sentinel. */ + +static size_t +count_newlines (char *buf, size_t bufsize) +{ + size_t count = 0; + char *p; + char *lim = buf + bufsize; + *lim = '\n'; + for (p = buf; (p = rawmemchr (p, '\n')) != lim; p++) + count++; + return count; +} + +/* Put into BUF the unsigned char C, making unprintable bytes + visible by quoting like cat -t does. */ + +static void +sprintc (char *buf, unsigned char c) +{ + if (! isprint (c)) + { + if (c >= 128) + { + *buf++ = 'M'; + *buf++ = '-'; + c -= 128; + } + if (c < 32) + { + *buf++ = '^'; + c += 64; + } + else if (c == 127) + { + *buf++ = '^'; + c = '?'; + } + } + + *buf++ = c; + *buf = 0; +} + +/* Position file F to ignore_initial[F] bytes from its initial position, + and yield its new position. Don't try more than once. */ + +static off_t +file_position (int f) +{ + static bool positioned[2]; + static off_t position[2]; + + if (! positioned[f]) + { + positioned[f] = true; + position[f] = lseek (file_desc[f], ignore_initial[f], SEEK_CUR); + } + return position[f]; +} diff --git a/local/recipes/tools/diffutils/source/src/context.c b/local/recipes/tools/diffutils/source/src/context.c new file mode 100644 index 0000000000..e96007db8e --- /dev/null +++ b/local/recipes/tools/diffutils/source/src/context.c @@ -0,0 +1,537 @@ +/* Context-format output routines for GNU DIFF. + + Copyright (C) 1988-1989, 1991-1995, 1998, 2001-2002, 2004, 2006, 2009-2013, + 2015-2017 Free Software Foundation, Inc. + + This file is part of GNU DIFF. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include "diff.h" +#include "c-ctype.h" +#include <stat-time.h> +#include <strftime.h> + +static char const *find_function (char const * const *, lin); +static struct change *find_hunk (struct change *); +static void mark_ignorable (struct change *); +static void pr_context_hunk (struct change *); +static void pr_unidiff_hunk (struct change *); + +/* Last place find_function started searching from. */ +static lin find_function_last_search; + +/* The value find_function returned when it started searching there. */ +static lin find_function_last_match; + +/* Print a label for a context diff, with a file name and date or a label. */ + +static void +print_context_label (char const *mark, + struct file_data *inf, + char const *name, + char const *label) +{ + if (label) + fprintf (outfile, "%s %s\n", mark, label); + else + { + char buf[MAX (INT_STRLEN_BOUND (int) + 32, + INT_STRLEN_BOUND (time_t) + 11)]; + struct tm const *tm = localtime (&inf->stat.st_mtime); + int nsec = get_stat_mtime_ns (&inf->stat); + if (! (tm && nstrftime (buf, sizeof buf, time_format, tm, 0, nsec))) + { + verify (TYPE_IS_INTEGER (time_t)); + if (LONG_MIN <= TYPE_MINIMUM (time_t) + && TYPE_MAXIMUM (time_t) <= LONG_MAX) + { + long int sec = inf->stat.st_mtime; + sprintf (buf, "%ld.%.9d", sec, nsec); + } + else if (TYPE_MAXIMUM (time_t) <= INTMAX_MAX) + { + intmax_t sec = inf->stat.st_mtime; + sprintf (buf, "%"PRIdMAX".%.9d", sec, nsec); + } + else + { + uintmax_t sec = inf->stat.st_mtime; + sprintf (buf, "%"PRIuMAX".%.9d", sec, nsec); + } + } + fprintf (outfile, "%s %s\t%s\n", mark, name, buf); + } +} + +/* Print a header for a context diff, with the file names and dates. */ + +void +print_context_header (struct file_data inf[], char const *const *names, bool unidiff) +{ + set_color_context (HEADER_CONTEXT); + if (unidiff) + { + print_context_label ("---", &inf[0], names[0], file_label[0]); + print_context_label ("+++", &inf[1], names[1], file_label[1]); + } + else + { + print_context_label ("***", &inf[0], names[0], file_label[0]); + print_context_label ("---", &inf[1], names[1], file_label[1]); + } + set_color_context (RESET_CONTEXT); +} + +/* Print an edit script in context format. */ + +void +print_context_script (struct change *script, bool unidiff) +{ + if (ignore_blank_lines || ignore_regexp.fastmap) + mark_ignorable (script); + else + { + struct change *e; + for (e = script; e; e = e->link) + e->ignore = false; + } + + find_function_last_search = - files[0].prefix_lines; + find_function_last_match = LIN_MAX; + + if (unidiff) + print_script (script, find_hunk, pr_unidiff_hunk); + else + print_script (script, find_hunk, pr_context_hunk); +} + +/* Print a pair of line numbers with a comma, translated for file FILE. + If the second number is not greater, use the first in place of it. + + Args A and B are internal line numbers. + We print the translated (real) line numbers. */ + +static void +print_context_number_range (struct file_data const *file, lin a, lin b) +{ + printint trans_a, trans_b; + translate_range (file, a, b, &trans_a, &trans_b); + + /* We can have B <= A in the case of a range of no lines. + In this case, we should print the line number before the range, + which is B. + + POSIX 1003.1-2001 requires two line numbers separated by a comma + even if the line numbers are the same. However, this does not + match existing practice and is surely an error in the + specification. */ + + if (trans_b <= trans_a) + fprintf (outfile, "%"pI"d", trans_b); + else + fprintf (outfile, "%"pI"d,%"pI"d", trans_a, trans_b); +} + +/* Print FUNCTION in a context header. */ +static void +print_context_function (FILE *out, char const *function) +{ + int i, j; + putc (' ', out); + for (i = 0; c_isspace ((unsigned char) function[i]) && function[i] != '\n'; i++) + continue; + for (j = i; j < i + 40 && function[j] != '\n'; j++) + continue; + while (i < j && c_isspace ((unsigned char) function[j - 1])) + j--; + fwrite (function + i, sizeof (char), j - i, out); +} + +/* Print a portion of an edit script in context format. + HUNK is the beginning of the portion to be printed. + The end is marked by a 'link' that has been nulled out. + + Prints out lines from both files, and precedes each + line with the appropriate flag-character. */ + +static void +pr_context_hunk (struct change *hunk) +{ + lin first0, last0, first1, last1, i; + char const *prefix; + char const *function; + FILE *out; + + /* Determine range of line numbers involved in each file. */ + + enum changes changes = analyze_hunk (hunk, &first0, &last0, &first1, &last1); + if (! changes) + return; + + /* Include a context's width before and after. */ + + i = - files[0].prefix_lines; + first0 = MAX (first0 - context, i); + first1 = MAX (first1 - context, i); + if (last0 < files[0].valid_lines - context) + last0 += context; + else + last0 = files[0].valid_lines - 1; + if (last1 < files[1].valid_lines - context) + last1 += context; + else + last1 = files[1].valid_lines - 1; + + /* If desired, find the preceding function definition line in file 0. */ + function = NULL; + if (function_regexp.fastmap) + function = find_function (files[0].linbuf, first0); + + begin_output (); + out = outfile; + + fputs ("***************", out); + + if (function) + print_context_function (out, function); + + putc ('\n', out); + set_color_context (LINE_NUMBER_CONTEXT); + fputs ("*** ", out); + print_context_number_range (&files[0], first0, last0); + fputs (" ****", out); + set_color_context (RESET_CONTEXT); + putc ('\n', out); + + if (changes & OLD) + { + struct change *next = hunk; + + if (first0 <= last0) + set_color_context (DELETE_CONTEXT); + + for (i = first0; i <= last0; i++) + { + /* Skip past changes that apply (in file 0) + only to lines before line I. */ + + while (next && next->line0 + next->deleted <= i) + next = next->link; + + /* Compute the marking for line I. */ + + prefix = " "; + if (next && next->line0 <= i) + { + /* The change NEXT covers this line. + If lines were inserted here in file 1, this is "changed". + Otherwise it is "deleted". */ + prefix = (next->inserted > 0 ? "!" : "-"); + } + print_1_line_nl (prefix, &files[0].linbuf[i], true); + if (i == last0) + set_color_context (RESET_CONTEXT); + if (files[0].linbuf[i + 1][-1] == '\n') + putc ('\n', out); + } + } + + set_color_context (LINE_NUMBER_CONTEXT); + fputs ("--- ", out); + print_context_number_range (&files[1], first1, last1); + fputs (" ----", out); + set_color_context (RESET_CONTEXT); + putc ('\n', out); + + if (changes & NEW) + { + struct change *next = hunk; + + if (first1 <= last1) + set_color_context (ADD_CONTEXT); + + for (i = first1; i <= last1; i++) + { + /* Skip past changes that apply (in file 1) + only to lines before line I. */ + + while (next && next->line1 + next->inserted <= i) + next = next->link; + + /* Compute the marking for line I. */ + + prefix = " "; + if (next && next->line1 <= i) + { + /* The change NEXT covers this line. + If lines were deleted here in file 0, this is "changed". + Otherwise it is "inserted". */ + prefix = (next->deleted > 0 ? "!" : "+"); + } + print_1_line_nl (prefix, &files[1].linbuf[i], true); + if (i == last1) + set_color_context (RESET_CONTEXT); + if (files[1].linbuf[i + 1][-1] == '\n') + putc ('\n', out); + } + } +} + +/* Print a pair of line numbers with a comma, translated for file FILE. + If the second number is smaller, use the first in place of it. + If the numbers are equal, print just one number. + + Args A and B are internal line numbers. + We print the translated (real) line numbers. */ + +static void +print_unidiff_number_range (struct file_data const *file, lin a, lin b) +{ + printint trans_a, trans_b; + translate_range (file, a, b, &trans_a, &trans_b); + + /* We can have B < A in the case of a range of no lines. + In this case, we print the line number before the range, + which is B. It would be more logical to print A, but + 'patch' expects B in order to detect diffs against empty files. */ + if (trans_b <= trans_a) + fprintf (outfile, trans_b < trans_a ? "%"pI"d,0" : "%"pI"d", trans_b); + else + fprintf (outfile, "%"pI"d,%"pI"d", trans_a, trans_b - trans_a + 1); +} + +/* Print a portion of an edit script in unidiff format. + HUNK is the beginning of the portion to be printed. + The end is marked by a 'link' that has been nulled out. + + Prints out lines from both files, and precedes each + line with the appropriate flag-character. */ + +static void +pr_unidiff_hunk (struct change *hunk) +{ + lin first0, last0, first1, last1; + lin i, j, k; + struct change *next; + char const *function; + FILE *out; + + /* Determine range of line numbers involved in each file. */ + + if (! analyze_hunk (hunk, &first0, &last0, &first1, &last1)) + return; + + /* Include a context's width before and after. */ + + i = - files[0].prefix_lines; + first0 = MAX (first0 - context, i); + first1 = MAX (first1 - context, i); + if (last0 < files[0].valid_lines - context) + last0 += context; + else + last0 = files[0].valid_lines - 1; + if (last1 < files[1].valid_lines - context) + last1 += context; + else + last1 = files[1].valid_lines - 1; + + /* If desired, find the preceding function definition line in file 0. */ + function = NULL; + if (function_regexp.fastmap) + function = find_function (files[0].linbuf, first0); + + begin_output (); + out = outfile; + + set_color_context (LINE_NUMBER_CONTEXT); + fputs ("@@ -", out); + print_unidiff_number_range (&files[0], first0, last0); + fputs (" +", out); + print_unidiff_number_range (&files[1], first1, last1); + fputs (" @@", out); + set_color_context (RESET_CONTEXT); + + if (function) + print_context_function (out, function); + + putc ('\n', out); + + next = hunk; + i = first0; + j = first1; + + while (i <= last0 || j <= last1) + { + + /* If the line isn't a difference, output the context from file 0. */ + + if (!next || i < next->line0) + { + char const *const *line = &files[0].linbuf[i++]; + if (! (suppress_blank_empty && **line == '\n')) + putc (initial_tab ? '\t' : ' ', out); + print_1_line (NULL, line); + j++; + } + else + { + /* For each difference, first output the deleted part. */ + + k = next->deleted; + if (k) + set_color_context (DELETE_CONTEXT); + + while (k--) + { + char const * const *line = &files[0].linbuf[i++]; + putc ('-', out); + if (initial_tab && ! (suppress_blank_empty && **line == '\n')) + putc ('\t', out); + print_1_line_nl (NULL, line, true); + + if (!k) + set_color_context (RESET_CONTEXT); + + if (line[1][-1] == '\n') + putc ('\n', out); + } + + /* Then output the inserted part. */ + + k = next->inserted; + if (k) + set_color_context (ADD_CONTEXT); + + while (k--) + { + char const * const *line = &files[1].linbuf[j++]; + putc ('+', out); + if (initial_tab && ! (suppress_blank_empty && **line == '\n')) + putc ('\t', out); + print_1_line_nl (NULL, line, true); + + if (!k) + set_color_context (RESET_CONTEXT); + + if (line[1][-1] == '\n') + putc ('\n', out); + } + + /* We're done with this hunk, so on to the next! */ + + next = next->link; + } + } +} + +/* Scan a (forward-ordered) edit script for the first place that more than + 2*CONTEXT unchanged lines appear, and return a pointer + to the 'struct change' for the last change before those lines. */ + +static struct change * _GL_ATTRIBUTE_PURE +find_hunk (struct change *start) +{ + struct change *prev; + lin top0, top1; + lin thresh; + + /* Threshold distance is CONTEXT if the second change is ignorable, + 2 * CONTEXT + 1 otherwise. Integer overflow can't happen, due + to CONTEXT_LIM. */ + lin ignorable_threshold = context; + lin non_ignorable_threshold = 2 * context + 1; + + do + { + /* Compute number of first line in each file beyond this changed. */ + top0 = start->line0 + start->deleted; + top1 = start->line1 + start->inserted; + prev = start; + start = start->link; + thresh = (start && start->ignore + ? ignorable_threshold + : non_ignorable_threshold); + /* It is not supposed to matter which file we check in the end-test. + If it would matter, crash. */ + if (start && start->line0 - top0 != start->line1 - top1) + abort (); + } while (start + /* Keep going if less than THRESH lines + elapse before the affected line. */ + && start->line0 - top0 < thresh); + + return prev; +} + +/* Set the 'ignore' flag properly in each change in SCRIPT. + It should be 1 if all the lines inserted or deleted in that change + are ignorable lines. */ + +static void +mark_ignorable (struct change *script) +{ + while (script) + { + struct change *next = script->link; + lin first0, last0, first1, last1; + + /* Turn this change into a hunk: detach it from the others. */ + script->link = NULL; + + /* Determine whether this change is ignorable. */ + script->ignore = ! analyze_hunk (script, + &first0, &last0, &first1, &last1); + + /* Reconnect the chain as before. */ + script->link = next; + + /* Advance to the following change. */ + script = next; + } +} + +/* Find the last function-header line in LINBUF prior to line number LINENUM. + This is a line containing a match for the regexp in 'function_regexp'. + Return the address of the text, or NULL if no function-header is found. */ + +static char const * +find_function (char const * const *linbuf, lin linenum) +{ + lin i = linenum; + lin last = find_function_last_search; + find_function_last_search = i; + + while (last <= --i) + { + /* See if this line is what we want. */ + char const *line = linbuf[i]; + size_t linelen = linbuf[i + 1] - line - 1; + + /* FIXME: re_search's size args should be size_t, not int. */ + int len = MIN (linelen, INT_MAX); + + if (0 <= re_search (&function_regexp, line, len, 0, len, NULL)) + { + find_function_last_match = i; + return line; + } + } + /* If we search back to where we started searching the previous time, + find the line we found last time. */ + if (find_function_last_match != LIN_MAX) + return linbuf[find_function_last_match]; + + return NULL; +} diff --git a/local/recipes/tools/diffutils/source/src/die.h b/local/recipes/tools/diffutils/source/src/die.h new file mode 100644 index 0000000000..8835d80ffd --- /dev/null +++ b/local/recipes/tools/diffutils/source/src/die.h @@ -0,0 +1,31 @@ +/* Report an error and exit. + Copyright 2016-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ + +#ifndef DIE_H +# define DIE_H + +# include <error.h> +# include <stdbool.h> +# include <verify.h> + +/* Like 'error (STATUS, ...)', except STATUS must be a nonzero constant. + This may pacify the compiler or help it generate better code. */ +# define die(status, ...) \ + verify_expr (status, (error (status, __VA_ARGS__), assume (false))) + +#endif /* DIE_H */ diff --git a/local/recipes/tools/diffutils/source/src/diff.c b/local/recipes/tools/diffutils/source/src/diff.c new file mode 100644 index 0000000000..df3338cf3a --- /dev/null +++ b/local/recipes/tools/diffutils/source/src/diff.c @@ -0,0 +1,1473 @@ +/* diff - compare files line by line + + Copyright (C) 1988-1989, 1992-1994, 1996, 1998, 2001-2002, 2004, 2006-2007, + 2009-2013, 2015-2017 Free Software Foundation, Inc. + + This file is part of GNU DIFF. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#define GDIFF_MAIN +#include "diff.h" +#include "die.h" +#include <assert.h> +#include "paths.h" +#include <c-stack.h> +#include <dirname.h> +#include <error.h> +#include <exclude.h> +#include <exitfail.h> +#include <filenamecat.h> +#include <file-type.h> +#include <fnmatch.h> +#include <getopt.h> +#include <hard-locale.h> +#include <prepargs.h> +#include <progname.h> +#include <sh-quote.h> +#include <stat-time.h> +#include <timespec.h> +#include <version-etc.h> +#include <xalloc.h> +#include <xreadlink.h> +#include <binary-io.h> + +/* The official name of this program (e.g., no 'g' prefix). */ +#define PROGRAM_NAME "diff" + +#define AUTHORS \ + proper_name ("Paul Eggert"), \ + proper_name ("Mike Haertel"), \ + proper_name ("David Hayes"), \ + proper_name ("Richard Stallman"), \ + proper_name ("Len Tower") + +#ifndef GUTTER_WIDTH_MINIMUM +# define GUTTER_WIDTH_MINIMUM 3 +#endif + +struct regexp_list +{ + char *regexps; /* chars representing disjunction of the regexps */ + size_t len; /* chars used in 'regexps' */ + size_t size; /* size malloc'ed for 'regexps'; 0 if not malloc'ed */ + bool multiple_regexps;/* Does 'regexps' represent a disjunction? */ + struct re_pattern_buffer *buf; +}; + +static int compare_files (struct comparison const *, char const *, char const *); +static void add_regexp (struct regexp_list *, char const *); +static void summarize_regexp_list (struct regexp_list *); +static void specify_style (enum output_style); +static void specify_value (char const **, char const *, char const *); +static void specify_colors_style (char const *); +static void try_help (char const *, char const *) __attribute__((noreturn)); +static void check_stdout (void); +static void usage (void); + +/* If comparing directories, compare their common subdirectories + recursively. */ +static bool recursive; + +/* In context diffs, show previous lines that match these regexps. */ +static struct regexp_list function_regexp_list; + +/* Ignore changes affecting only lines that match these regexps. */ +static struct regexp_list ignore_regexp_list; + +#if O_BINARY +/* Use binary I/O when reading and writing data (--binary). + On POSIX hosts, this has no effect. */ +static bool binary; +#else +enum { binary = true }; +#endif + +/* If one file is missing, treat it as present but empty (-N). */ +static bool new_file; + +/* If the first file is missing, treat it as present but empty + (--unidirectional-new-file). */ +static bool unidirectional_new_file; + +/* Report files compared that are the same (-s). + Normally nothing is output when that happens. */ +static bool report_identical_files; + +static char const shortopts[] = +"0123456789abBcC:dD:eEfF:hHiI:lL:nNpPqrsS:tTuU:vwW:x:X:yZ"; + +/* Values for long options that do not have single-letter equivalents. */ +enum +{ + BINARY_OPTION = CHAR_MAX + 1, + FROM_FILE_OPTION, + HELP_OPTION, + HORIZON_LINES_OPTION, + IGNORE_FILE_NAME_CASE_OPTION, + INHIBIT_HUNK_MERGE_OPTION, + LEFT_COLUMN_OPTION, + LINE_FORMAT_OPTION, + NO_DEREFERENCE_OPTION, + NO_IGNORE_FILE_NAME_CASE_OPTION, + NORMAL_OPTION, + SDIFF_MERGE_ASSIST_OPTION, + STRIP_TRAILING_CR_OPTION, + SUPPRESS_BLANK_EMPTY_OPTION, + SUPPRESS_COMMON_LINES_OPTION, + TABSIZE_OPTION, + TO_FILE_OPTION, + + /* These options must be in sequence. */ + UNCHANGED_LINE_FORMAT_OPTION, + OLD_LINE_FORMAT_OPTION, + NEW_LINE_FORMAT_OPTION, + + /* These options must be in sequence. */ + UNCHANGED_GROUP_FORMAT_OPTION, + OLD_GROUP_FORMAT_OPTION, + NEW_GROUP_FORMAT_OPTION, + CHANGED_GROUP_FORMAT_OPTION, + + COLOR_OPTION, + COLOR_PALETTE_OPTION, + + PRESUME_OUTPUT_TTY_OPTION, +}; + +static char const group_format_option[][sizeof "--unchanged-group-format"] = + { + "--unchanged-group-format", + "--old-group-format", + "--new-group-format", + "--changed-group-format" + }; + +static char const line_format_option[][sizeof "--unchanged-line-format"] = + { + "--unchanged-line-format", + "--old-line-format", + "--new-line-format" + }; + +static struct option const longopts[] = +{ + {"binary", 0, 0, BINARY_OPTION}, + {"brief", 0, 0, 'q'}, + {"changed-group-format", 1, 0, CHANGED_GROUP_FORMAT_OPTION}, + {"color", 2, 0, COLOR_OPTION}, + {"context", 2, 0, 'C'}, + {"ed", 0, 0, 'e'}, + {"exclude", 1, 0, 'x'}, + {"exclude-from", 1, 0, 'X'}, + {"expand-tabs", 0, 0, 't'}, + {"forward-ed", 0, 0, 'f'}, + {"from-file", 1, 0, FROM_FILE_OPTION}, + {"help", 0, 0, HELP_OPTION}, + {"horizon-lines", 1, 0, HORIZON_LINES_OPTION}, + {"ifdef", 1, 0, 'D'}, + {"ignore-all-space", 0, 0, 'w'}, + {"ignore-blank-lines", 0, 0, 'B'}, + {"ignore-case", 0, 0, 'i'}, + {"ignore-file-name-case", 0, 0, IGNORE_FILE_NAME_CASE_OPTION}, + {"ignore-matching-lines", 1, 0, 'I'}, + {"ignore-space-change", 0, 0, 'b'}, + {"ignore-tab-expansion", 0, 0, 'E'}, + {"ignore-trailing-space", 0, 0, 'Z'}, + {"inhibit-hunk-merge", 0, 0, INHIBIT_HUNK_MERGE_OPTION}, + {"initial-tab", 0, 0, 'T'}, + {"label", 1, 0, 'L'}, + {"left-column", 0, 0, LEFT_COLUMN_OPTION}, + {"line-format", 1, 0, LINE_FORMAT_OPTION}, + {"minimal", 0, 0, 'd'}, + {"new-file", 0, 0, 'N'}, + {"new-group-format", 1, 0, NEW_GROUP_FORMAT_OPTION}, + {"new-line-format", 1, 0, NEW_LINE_FORMAT_OPTION}, + {"no-dereference", 0, 0, NO_DEREFERENCE_OPTION}, + {"no-ignore-file-name-case", 0, 0, NO_IGNORE_FILE_NAME_CASE_OPTION}, + {"normal", 0, 0, NORMAL_OPTION}, + {"old-group-format", 1, 0, OLD_GROUP_FORMAT_OPTION}, + {"old-line-format", 1, 0, OLD_LINE_FORMAT_OPTION}, + {"paginate", 0, 0, 'l'}, + {"palette", 1, 0, COLOR_PALETTE_OPTION}, + {"rcs", 0, 0, 'n'}, + {"recursive", 0, 0, 'r'}, + {"report-identical-files", 0, 0, 's'}, + {"sdiff-merge-assist", 0, 0, SDIFF_MERGE_ASSIST_OPTION}, + {"show-c-function", 0, 0, 'p'}, + {"show-function-line", 1, 0, 'F'}, + {"side-by-side", 0, 0, 'y'}, + {"speed-large-files", 0, 0, 'H'}, + {"starting-file", 1, 0, 'S'}, + {"strip-trailing-cr", 0, 0, STRIP_TRAILING_CR_OPTION}, + {"suppress-blank-empty", 0, 0, SUPPRESS_BLANK_EMPTY_OPTION}, + {"suppress-common-lines", 0, 0, SUPPRESS_COMMON_LINES_OPTION}, + {"tabsize", 1, 0, TABSIZE_OPTION}, + {"text", 0, 0, 'a'}, + {"to-file", 1, 0, TO_FILE_OPTION}, + {"unchanged-group-format", 1, 0, UNCHANGED_GROUP_FORMAT_OPTION}, + {"unchanged-line-format", 1, 0, UNCHANGED_LINE_FORMAT_OPTION}, + {"unidirectional-new-file", 0, 0, 'P'}, + {"unified", 2, 0, 'U'}, + {"version", 0, 0, 'v'}, + {"width", 1, 0, 'W'}, + + /* This is solely for testing. Do not document. */ + {"-presume-output-tty", no_argument, NULL, PRESUME_OUTPUT_TTY_OPTION}, + {0, 0, 0, 0} +}; + +/* Return a string containing the command options with which diff was invoked. + Spaces appear between what were separate ARGV-elements. + There is a space at the beginning but none at the end. + If there were no options, the result is an empty string. + + Arguments: OPTIONVEC, a vector containing separate ARGV-elements, and COUNT, + the length of that vector. */ + +static char * +option_list (char **optionvec, int count) +{ + int i; + size_t size = 1; + char *result; + char *p; + + for (i = 0; i < count; i++) + size += 1 + shell_quote_length (optionvec[i]); + + p = result = xmalloc (size); + + for (i = 0; i < count; i++) + { + *p++ = ' '; + p = shell_quote_copy (p, optionvec[i]); + } + + *p = '\0'; + return result; +} + + +/* Return an option value suitable for add_exclude. */ + +static int +exclude_options (void) +{ + return EXCLUDE_WILDCARDS | (ignore_file_name_case ? FNM_CASEFOLD : 0); +} + +int +main (int argc, char **argv) +{ + int exit_status = EXIT_SUCCESS; + int c; + int i; + int prev = -1; + lin ocontext = -1; + bool explicit_context = false; + size_t width = 0; + bool show_c_function = false; + char const *from_file = NULL; + char const *to_file = NULL; + uintmax_t numval; + char *numend; + + /* Do our initializations. */ + exit_failure = EXIT_TROUBLE; + initialize_main (&argc, &argv); + set_program_name (argv[0]); + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + c_stack_action (0); + function_regexp_list.buf = &function_regexp; + ignore_regexp_list.buf = &ignore_regexp; + re_set_syntax (RE_SYNTAX_GREP | RE_NO_POSIX_BACKTRACKING); + excluded = new_exclude (); + presume_output_tty = false; + + /* Decode the options. */ + + while ((c = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1) + { + switch (c) + { + case 0: + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + ocontext = (! ISDIGIT (prev) + ? c - '0' + : (ocontext - (c - '0' <= CONTEXT_MAX % 10) + < CONTEXT_MAX / 10) + ? 10 * ocontext + (c - '0') + : CONTEXT_MAX); + break; + + case 'a': + text = true; + break; + + case 'b': + if (ignore_white_space < IGNORE_SPACE_CHANGE) + ignore_white_space = IGNORE_SPACE_CHANGE; + break; + + case 'Z': + if (ignore_white_space < IGNORE_SPACE_CHANGE) + ignore_white_space |= IGNORE_TRAILING_SPACE; + break; + + case 'B': + ignore_blank_lines = true; + break; + + case 'C': + case 'U': + { + if (optarg) + { + numval = strtoumax (optarg, &numend, 10); + if (*numend) + try_help ("invalid context length '%s'", optarg); + if (CONTEXT_MAX < numval) + numval = CONTEXT_MAX; + } + else + numval = 3; + + specify_style (c == 'U' ? OUTPUT_UNIFIED : OUTPUT_CONTEXT); + if (context < numval) + context = numval; + explicit_context = true; + } + break; + + case 'c': + specify_style (OUTPUT_CONTEXT); + if (context < 3) + context = 3; + break; + + case 'd': + minimal = true; + break; + + case 'D': + specify_style (OUTPUT_IFDEF); + { + static char const C_ifdef_group_formats[] = + "%%=%c#ifndef %s\n%%<#endif /* ! %s */\n%c#ifdef %s\n%%>#endif /* %s */\n%c#ifndef %s\n%%<#else /* %s */\n%%>#endif /* %s */\n"; + char *b = xmalloc (sizeof C_ifdef_group_formats + + 7 * strlen (optarg) - 14 /* 7*"%s" */ + - 8 /* 5*"%%" + 3*"%c" */); + sprintf (b, C_ifdef_group_formats, + 0, + optarg, optarg, 0, + optarg, optarg, 0, + optarg, optarg, optarg); + for (i = 0; i < sizeof group_format / sizeof group_format[0]; i++) + { + specify_value (&group_format[i], b, "-D"); + b += strlen (b) + 1; + } + } + break; + + case 'e': + specify_style (OUTPUT_ED); + break; + + case 'E': + if (ignore_white_space < IGNORE_SPACE_CHANGE) + ignore_white_space |= IGNORE_TAB_EXPANSION; + break; + + case 'f': + specify_style (OUTPUT_FORWARD_ED); + break; + + case 'F': + add_regexp (&function_regexp_list, optarg); + break; + + case 'h': + /* Split the files into chunks for faster processing. + Usually does not change the result. + + This currently has no effect. */ + break; + + case 'H': + speed_large_files = true; + break; + + case 'i': + ignore_case = true; + break; + + case 'I': + add_regexp (&ignore_regexp_list, optarg); + break; + + case 'l': + if (!pr_program[0]) + try_help ("pagination not supported on this host", NULL); + paginate = true; +#ifdef SIGCHLD + /* Pagination requires forking and waiting, and + System V fork+wait does not work if SIGCHLD is ignored. */ + signal (SIGCHLD, SIG_DFL); +#endif + break; + + case 'L': + if (!file_label[0]) + file_label[0] = optarg; + else if (!file_label[1]) + file_label[1] = optarg; + else + fatal ("too many file label options"); + break; + + case 'n': + specify_style (OUTPUT_RCS); + break; + + case 'N': + new_file = true; + break; + + case 'p': + show_c_function = true; + add_regexp (&function_regexp_list, "^[[:alpha:]$_]"); + break; + + case 'P': + unidirectional_new_file = true; + break; + + case 'q': + brief = true; + break; + + case 'r': + recursive = true; + break; + + case 's': + report_identical_files = true; + break; + + case 'S': + specify_value (&starting_file, optarg, "-S"); + break; + + case 't': + expand_tabs = true; + break; + + case 'T': + initial_tab = true; + break; + + case 'u': + specify_style (OUTPUT_UNIFIED); + if (context < 3) + context = 3; + break; + + case 'v': + version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version, + AUTHORS, (char *) NULL); + check_stdout (); + return EXIT_SUCCESS; + + case 'w': + ignore_white_space = IGNORE_ALL_SPACE; + break; + + case 'x': + add_exclude (excluded, optarg, exclude_options ()); + break; + + case 'X': + if (add_exclude_file (add_exclude, excluded, optarg, + exclude_options (), '\n')) + pfatal_with_name (optarg); + break; + + case 'y': + specify_style (OUTPUT_SDIFF); + break; + + case 'W': + numval = strtoumax (optarg, &numend, 10); + if (! (0 < numval && numval <= SIZE_MAX) || *numend) + try_help ("invalid width '%s'", optarg); + if (width != numval) + { + if (width) + fatal ("conflicting width options"); + width = numval; + } + break; + + case BINARY_OPTION: +#if O_BINARY + binary = true; + if (! isatty (STDOUT_FILENO)) + set_binary_mode (STDOUT_FILENO, O_BINARY); +#endif + break; + + case FROM_FILE_OPTION: + specify_value (&from_file, optarg, "--from-file"); + break; + + case HELP_OPTION: + usage (); + check_stdout (); + return EXIT_SUCCESS; + + case HORIZON_LINES_OPTION: + numval = strtoumax (optarg, &numend, 10); + if (*numend) + try_help ("invalid horizon length '%s'", optarg); + horizon_lines = MAX (horizon_lines, MIN (numval, LIN_MAX)); + break; + + case IGNORE_FILE_NAME_CASE_OPTION: + ignore_file_name_case = true; + break; + + case INHIBIT_HUNK_MERGE_OPTION: + /* This option is obsolete, but accept it for backward + compatibility. */ + break; + + case LEFT_COLUMN_OPTION: + left_column = true; + break; + + case LINE_FORMAT_OPTION: + specify_style (OUTPUT_IFDEF); + for (i = 0; i < sizeof line_format / sizeof line_format[0]; i++) + specify_value (&line_format[i], optarg, "--line-format"); + break; + + case NO_DEREFERENCE_OPTION: + no_dereference_symlinks = true; + break; + + case NO_IGNORE_FILE_NAME_CASE_OPTION: + ignore_file_name_case = false; + break; + + case NORMAL_OPTION: + specify_style (OUTPUT_NORMAL); + break; + + case SDIFF_MERGE_ASSIST_OPTION: + specify_style (OUTPUT_SDIFF); + sdiff_merge_assist = true; + break; + + case STRIP_TRAILING_CR_OPTION: + strip_trailing_cr = true; + break; + + case SUPPRESS_BLANK_EMPTY_OPTION: + suppress_blank_empty = true; + break; + + case SUPPRESS_COMMON_LINES_OPTION: + suppress_common_lines = true; + break; + + case TABSIZE_OPTION: + numval = strtoumax (optarg, &numend, 10); + if (! (0 < numval && numval <= SIZE_MAX - GUTTER_WIDTH_MINIMUM) + || *numend) + try_help ("invalid tabsize '%s'", optarg); + if (tabsize != numval) + { + if (tabsize) + fatal ("conflicting tabsize options"); + tabsize = numval; + } + break; + + case TO_FILE_OPTION: + specify_value (&to_file, optarg, "--to-file"); + break; + + case UNCHANGED_LINE_FORMAT_OPTION: + case OLD_LINE_FORMAT_OPTION: + case NEW_LINE_FORMAT_OPTION: + specify_style (OUTPUT_IFDEF); + c -= UNCHANGED_LINE_FORMAT_OPTION; + specify_value (&line_format[c], optarg, line_format_option[c]); + break; + + case UNCHANGED_GROUP_FORMAT_OPTION: + case OLD_GROUP_FORMAT_OPTION: + case NEW_GROUP_FORMAT_OPTION: + case CHANGED_GROUP_FORMAT_OPTION: + specify_style (OUTPUT_IFDEF); + c -= UNCHANGED_GROUP_FORMAT_OPTION; + specify_value (&group_format[c], optarg, group_format_option[c]); + break; + + case COLOR_OPTION: + specify_colors_style (optarg); + break; + + case COLOR_PALETTE_OPTION: + set_color_palette (optarg); + break; + + case PRESUME_OUTPUT_TTY_OPTION: + presume_output_tty = true; + break; + + default: + try_help (NULL, NULL); + } + prev = c; + } + + if (colors_style == AUTO) + { + char const *t = getenv ("TERM"); + if (t && STREQ (t, "dumb")) + colors_style = NEVER; + } + + if (output_style == OUTPUT_UNSPECIFIED) + { + if (show_c_function) + { + specify_style (OUTPUT_CONTEXT); + if (ocontext < 0) + context = 3; + } + else + specify_style (OUTPUT_NORMAL); + } + + if (output_style != OUTPUT_CONTEXT || hard_locale (LC_TIME)) + { +#if (defined STAT_TIMESPEC || defined STAT_TIMESPEC_NS \ + || defined HAVE_STRUCT_STAT_ST_SPARE1) + time_format = "%Y-%m-%d %H:%M:%S.%N %z"; +#else + time_format = "%Y-%m-%d %H:%M:%S %z"; +#endif + } + else + { + /* See POSIX 1003.1-2001 for this format. */ + time_format = "%a %b %e %T %Y"; + } + + if (0 <= ocontext + && (output_style == OUTPUT_CONTEXT + || output_style == OUTPUT_UNIFIED) + && (context < ocontext + || (ocontext < context && ! explicit_context))) + context = ocontext; + + if (! tabsize) + tabsize = 8; + if (! width) + width = 130; + + { + /* Maximize first the half line width, and then the gutter width, + according to the following constraints: + + 1. Two half lines plus a gutter must fit in a line. + 2. If the half line width is nonzero: + a. The gutter width is at least GUTTER_WIDTH_MINIMUM. + b. If tabs are not expanded to spaces, + a half line plus a gutter is an integral number of tabs, + so that tabs in the right column line up. */ + + size_t t = expand_tabs ? 1 : tabsize; + size_t w = width; + size_t t_plus_g = t + GUTTER_WIDTH_MINIMUM; + size_t unaligned_off = (w >> 1) + (t_plus_g >> 1) + (w & t_plus_g & 1); + size_t off = unaligned_off - unaligned_off % t; + sdiff_half_width = (off <= GUTTER_WIDTH_MINIMUM || w <= off + ? 0 + : MIN (off - GUTTER_WIDTH_MINIMUM, w - off)); + sdiff_column2_offset = sdiff_half_width ? off : w; + } + + /* Make the horizon at least as large as the context, so that + shift_boundaries has more freedom to shift the first and last hunks. */ + if (horizon_lines < context) + horizon_lines = context; + + summarize_regexp_list (&function_regexp_list); + summarize_regexp_list (&ignore_regexp_list); + + if (output_style == OUTPUT_IFDEF) + { + for (i = 0; i < sizeof line_format / sizeof line_format[0]; i++) + if (!line_format[i]) + line_format[i] = "%l\n"; + if (!group_format[OLD]) + group_format[OLD] + = group_format[CHANGED] ? group_format[CHANGED] : "%<"; + if (!group_format[NEW]) + group_format[NEW] + = group_format[CHANGED] ? group_format[CHANGED] : "%>"; + if (!group_format[UNCHANGED]) + group_format[UNCHANGED] = "%="; + if (!group_format[CHANGED]) + group_format[CHANGED] = concat (group_format[OLD], + group_format[NEW], ""); + } + + no_diff_means_no_output = + (output_style == OUTPUT_IFDEF ? + (!*group_format[UNCHANGED] + || (STREQ (group_format[UNCHANGED], "%=") + && !*line_format[UNCHANGED])) + : (output_style != OUTPUT_SDIFF) | suppress_common_lines); + + files_can_be_treated_as_binary = + (brief & binary + & ~ (ignore_blank_lines | ignore_case | strip_trailing_cr + | (ignore_regexp_list.regexps || ignore_white_space))); + + switch_string = option_list (argv + 1, optind - 1); + + if (from_file) + { + if (to_file) + fatal ("--from-file and --to-file both specified"); + else + for (; optind < argc; optind++) + { + int status = compare_files (NULL, from_file, argv[optind]); + if (exit_status < status) + exit_status = status; + } + } + else + { + if (to_file) + for (; optind < argc; optind++) + { + int status = compare_files (NULL, argv[optind], to_file); + if (exit_status < status) + exit_status = status; + } + else + { + if (argc - optind != 2) + { + if (argc - optind < 2) + try_help ("missing operand after '%s'", argv[argc - 1]); + else + try_help ("extra operand '%s'", argv[optind + 2]); + } + + exit_status = compare_files (NULL, argv[optind], argv[optind + 1]); + } + } + + /* Print any messages that were saved up for last. */ + print_message_queue (); + + check_stdout (); + exit (exit_status); + return exit_status; +} + +/* Append to REGLIST the regexp PATTERN. */ + +static void +add_regexp (struct regexp_list *reglist, char const *pattern) +{ + size_t patlen = strlen (pattern); + char const *m = re_compile_pattern (pattern, patlen, reglist->buf); + + if (m != 0) + error (EXIT_TROUBLE, 0, "%s: %s", pattern, m); + else + { + char *regexps = reglist->regexps; + size_t len = reglist->len; + bool multiple_regexps = reglist->multiple_regexps = regexps != 0; + size_t newlen = reglist->len = len + 2 * multiple_regexps + patlen; + size_t size = reglist->size; + + if (size <= newlen) + { + if (!size) + size = 1; + + do size *= 2; + while (size <= newlen); + + reglist->size = size; + reglist->regexps = regexps = xrealloc (regexps, size); + } + if (multiple_regexps) + { + regexps[len++] = '\\'; + regexps[len++] = '|'; + } + memcpy (regexps + len, pattern, patlen + 1); + } +} + +/* Ensure that REGLIST represents the disjunction of its regexps. + This is done here, rather than earlier, to avoid O(N^2) behavior. */ + +static void +summarize_regexp_list (struct regexp_list *reglist) +{ + if (reglist->regexps) + { + /* At least one regexp was specified. Allocate a fastmap for it. */ + reglist->buf->fastmap = xmalloc (1 << CHAR_BIT); + if (reglist->multiple_regexps) + { + /* Compile the disjunction of the regexps. + (If just one regexp was specified, it is already compiled.) */ + char const *m = re_compile_pattern (reglist->regexps, reglist->len, + reglist->buf); + if (m) + die (EXIT_TROUBLE, 0, "%s: %s", reglist->regexps, m); + } + } +} + +static void +try_help (char const *reason_msgid, char const *operand) +{ + if (reason_msgid) + error (0, 0, _(reason_msgid), operand); + die (EXIT_TROUBLE, 0, _("Try '%s --help' for more information."), + program_name); +} + +static void +check_stdout (void) +{ + if (ferror (stdout)) + fatal ("write failed"); + else if (fclose (stdout) != 0) + pfatal_with_name (_("standard output")); +} + +static char const * const option_help_msgid[] = { + N_(" --normal output a normal diff (the default)"), + N_("-q, --brief report only when files differ"), + N_("-s, --report-identical-files report when two files are the same"), + N_("-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"), + N_("-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"), + N_("-e, --ed output an ed script"), + N_("-n, --rcs output an RCS format diff"), + N_("-y, --side-by-side output in two columns"), + N_("-W, --width=NUM output at most NUM (default 130) print columns"), + N_(" --left-column output only the left column of common lines"), + N_(" --suppress-common-lines do not output common lines"), + "", + N_("-p, --show-c-function show which C function each change is in"), + N_("-F, --show-function-line=RE show the most recent line matching RE"), + N_(" --label LABEL use LABEL instead of file name and timestamp\n" + " (can be repeated)"), + "", + N_("-t, --expand-tabs expand tabs to spaces in output"), + N_("-T, --initial-tab make tabs line up by prepending a tab"), + N_(" --tabsize=NUM tab stops every NUM (default 8) print columns"), + N_(" --suppress-blank-empty suppress space or tab before empty output lines"), + N_("-l, --paginate pass output through 'pr' to paginate it"), + "", + N_("-r, --recursive recursively compare any subdirectories found"), + N_(" --no-dereference don't follow symbolic links"), + N_("-N, --new-file treat absent files as empty"), + N_(" --unidirectional-new-file treat absent first files as empty"), + N_(" --ignore-file-name-case ignore case when comparing file names"), + N_(" --no-ignore-file-name-case consider case when comparing file names"), + N_("-x, --exclude=PAT exclude files that match PAT"), + N_("-X, --exclude-from=FILE exclude files that match any pattern in FILE"), + N_("-S, --starting-file=FILE start with FILE when comparing directories"), + N_(" --from-file=FILE1 compare FILE1 to all operands;\n" + " FILE1 can be a directory"), + N_(" --to-file=FILE2 compare all operands to FILE2;\n" + " FILE2 can be a directory"), + "", + N_("-i, --ignore-case ignore case differences in file contents"), + N_("-E, --ignore-tab-expansion ignore changes due to tab expansion"), + N_("-Z, --ignore-trailing-space ignore white space at line end"), + N_("-b, --ignore-space-change ignore changes in the amount of white space"), + N_("-w, --ignore-all-space ignore all white space"), + N_("-B, --ignore-blank-lines ignore changes where lines are all blank"), + N_("-I, --ignore-matching-lines=RE ignore changes where all lines match RE"), + "", + N_("-a, --text treat all files as text"), + N_(" --strip-trailing-cr strip trailing carriage return on input"), +#if O_BINARY + N_(" --binary read and write data in binary mode"), +#endif + "", + N_("-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"), + N_(" --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"), + N_(" --line-format=LFMT format all input lines with LFMT"), + N_(" --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"), + N_(" These format options provide fine-grained control over the output\n" + " of diff, generalizing -D/--ifdef."), + N_(" LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."), + N_(" GFMT (only) may contain:\n\ + %< lines from FILE1\n\ + %> lines from FILE2\n\ + %= lines common to FILE1 and FILE2\n\ + %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n\ + LETTERs are as follows for new group, lower case for old group:\n\ + F first line number\n\ + L last line number\n\ + N number of lines = L-F+1\n\ + E F-1\n\ + M L+1\n\ + %(A=B?T:E) if A equals B then T else E"), + N_(" LFMT (only) may contain:\n\ + %L contents of line\n\ + %l contents of line, excluding any trailing newline\n\ + %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"), + N_(" Both GFMT and LFMT may contain:\n\ + %% %\n\ + %c'C' the single character C\n\ + %c'\\OOO' the character with octal code OOO\n\ + C the character C (other characters represent themselves)"), + "", + N_("-d, --minimal try hard to find a smaller set of changes"), + N_(" --horizon-lines=NUM keep NUM lines of the common prefix and suffix"), + N_(" --speed-large-files assume large files and many scattered small changes"), + N_(" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',\n" + " or 'auto' (the default)"), + N_(" --palette=PALETTE the colors to use when --color is active; PALETTE is\n" + " a colon-separated list of terminfo capabilities"), + "", + N_(" --help display this help and exit"), + N_("-v, --version output version information and exit"), + "", + N_("FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."), + N_("If --from-file or --to-file is given, there are no restrictions on FILE(s)."), + N_("If a FILE is '-', read standard input."), + N_("Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."), + 0 +}; + +static void +usage (void) +{ + char const * const *p; + + printf (_("Usage: %s [OPTION]... FILES\n"), program_name); + printf ("%s\n\n", _("Compare FILES line by line.")); + + fputs (_("\ +Mandatory arguments to long options are mandatory for short options too.\n\ +"), stdout); + + for (p = option_help_msgid; *p; p++) + { + if (!**p) + putchar ('\n'); + else + { + char const *msg = _(*p); + char const *nl; + while ((nl = strchr (msg, '\n'))) + { + int msglen = nl + 1 - msg; + printf (" %.*s", msglen, msg); + msg = nl + 1; + } + + printf (" %s\n" + 2 * (*msg != ' ' && *msg != '-'), msg); + } + } + emit_bug_reporting_address (); +} + +/* Set VAR to VALUE, reporting an OPTION error if this is a + conflict. */ +static void +specify_value (char const **var, char const *value, char const *option) +{ + if (*var && ! STREQ (*var, value)) + { + error (0, 0, _("conflicting %s option value '%s'"), option, value); + try_help (NULL, NULL); + } + *var = value; +} + +/* Set the output style to STYLE, diagnosing conflicts. */ +static void +specify_style (enum output_style style) +{ + if (output_style != style) + { + if (output_style != OUTPUT_UNSPECIFIED) + try_help ("conflicting output style options", NULL); + output_style = style; + } +} + +/* Set the color mode. */ +static void +specify_colors_style (char const *value) +{ + if (value == NULL || STREQ (value, "auto")) + colors_style = AUTO; + else if (STREQ (value, "always")) + colors_style = ALWAYS; + else if (STREQ (value, "never")) + colors_style = NEVER; + else + try_help ("invalid color '%s'", value); +} + + +/* Set the last-modified time of *ST to be the current time. */ + +static void +set_mtime_to_now (struct stat *st) +{ +#ifdef STAT_TIMESPEC + gettime (&STAT_TIMESPEC (st, st_mtim)); +#else + struct timespec t; + gettime (&t); + st->st_mtime = t.tv_sec; +# if defined STAT_TIMESPEC_NS + STAT_TIMESPEC_NS (st, st_mtim) = t.tv_nsec; +# elif defined HAVE_STRUCT_STAT_ST_SPARE1 + st->st_spare1 = t.tv_nsec / 1000; +# endif +#endif +} + +/* Compare two files (or dirs) with parent comparison PARENT + and names NAME0 and NAME1. + (If PARENT is null, then the first name is just NAME0, etc.) + This is self-contained; it opens the files and closes them. + + Value is EXIT_SUCCESS if files are the same, EXIT_FAILURE if + different, EXIT_TROUBLE if there is a problem opening them. */ + +static int +compare_files (struct comparison const *parent, + char const *name0, + char const *name1) +{ + struct comparison cmp; +#define DIR_P(f) (S_ISDIR (cmp.file[f].stat.st_mode) != 0) + register int f; + int status = EXIT_SUCCESS; + bool same_files; + char *free0; + char *free1; + + /* If this is directory comparison, perhaps we have a file + that exists only in one of the directories. + If so, just print a message to that effect. */ + + if (! ((name0 && name1) + || (unidirectional_new_file && name1) + || new_file)) + { + char const *name = name0 ? name0 : name1; + char const *dir = parent->file[!name0].name; + + /* See POSIX 1003.1-2001 for this format. */ + message ("Only in %s: %s\n", dir, name); + + /* Return EXIT_FAILURE so that diff_dirs will return + EXIT_FAILURE ("some files differ"). */ + return EXIT_FAILURE; + } + + memset (cmp.file, 0, sizeof cmp.file); + cmp.parent = parent; + + /* cmp.file[f].desc markers */ +#define NONEXISTENT (-1) /* nonexistent file */ +#define UNOPENED (-2) /* unopened file (e.g. directory) */ +#define ERRNO_ENCODE(errno) (-3 - (errno)) /* encoded errno value */ + +#define ERRNO_DECODE(desc) (-3 - (desc)) /* inverse of ERRNO_ENCODE */ + + cmp.file[0].desc = name0 ? UNOPENED : NONEXISTENT; + cmp.file[1].desc = name1 ? UNOPENED : NONEXISTENT; + + /* Now record the full name of each file, including nonexistent ones. */ + + if (!name0) + name0 = name1; + if (!name1) + name1 = name0; + + if (!parent) + { + free0 = NULL; + free1 = NULL; + cmp.file[0].name = name0; + cmp.file[1].name = name1; + } + else + { + cmp.file[0].name = free0 + = file_name_concat (parent->file[0].name, name0, NULL); + cmp.file[1].name = free1 + = file_name_concat (parent->file[1].name, name1, NULL); + } + + /* Stat the files. */ + + for (f = 0; f < 2; f++) + { + if (cmp.file[f].desc != NONEXISTENT) + { + if (f && file_name_cmp (cmp.file[f].name, cmp.file[0].name) == 0) + { + cmp.file[f].desc = cmp.file[0].desc; + cmp.file[f].stat = cmp.file[0].stat; + } + else if (STREQ (cmp.file[f].name, "-")) + { + cmp.file[f].desc = STDIN_FILENO; + if (binary && ! isatty (STDIN_FILENO)) + set_binary_mode (STDIN_FILENO, O_BINARY); + if (fstat (STDIN_FILENO, &cmp.file[f].stat) != 0) + cmp.file[f].desc = ERRNO_ENCODE (errno); + else + { + if (S_ISREG (cmp.file[f].stat.st_mode)) + { + off_t pos = lseek (STDIN_FILENO, 0, SEEK_CUR); + if (pos < 0) + cmp.file[f].desc = ERRNO_ENCODE (errno); + else + cmp.file[f].stat.st_size = + MAX (0, cmp.file[f].stat.st_size - pos); + } + + /* POSIX 1003.1-2001 requires current time for + stdin. */ + set_mtime_to_now (&cmp.file[f].stat); + } + } + else if ((no_dereference_symlinks + ? lstat (cmp.file[f].name, &cmp.file[f].stat) + : stat (cmp.file[f].name, &cmp.file[f].stat)) + != 0) + cmp.file[f].desc = ERRNO_ENCODE (errno); + } + } + + /* Mark files as nonexistent as needed for -N and -P, if they are + inaccessible empty regular files (the kind of files that 'patch' + creates to indicate nonexistent backups), or if they are + top-level files that do not exist but their counterparts do + exist. */ + for (f = 0; f < 2; f++) + if ((new_file || (f == 0 && unidirectional_new_file)) + && (cmp.file[f].desc == UNOPENED + ? (S_ISREG (cmp.file[f].stat.st_mode) + && ! (cmp.file[f].stat.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) + && cmp.file[f].stat.st_size == 0) + : ((cmp.file[f].desc == ERRNO_ENCODE (ENOENT) + || cmp.file[f].desc == ERRNO_ENCODE (EBADF)) + && ! parent + && (cmp.file[1 - f].desc == UNOPENED + || cmp.file[1 - f].desc == STDIN_FILENO)))) + cmp.file[f].desc = NONEXISTENT; + + for (f = 0; f < 2; f++) + if (cmp.file[f].desc == NONEXISTENT) + { + memset (&cmp.file[f].stat, 0, sizeof cmp.file[f].stat); + cmp.file[f].stat.st_mode = cmp.file[1 - f].stat.st_mode; + } + + for (f = 0; f < 2; f++) + { + int e = ERRNO_DECODE (cmp.file[f].desc); + if (0 <= e) + { + errno = e; + perror_with_name (cmp.file[f].name); + status = EXIT_TROUBLE; + } + } + + if (status == EXIT_SUCCESS && ! parent && DIR_P (0) != DIR_P (1)) + { + /* If one is a directory, and it was specified in the command line, + use the file in that dir with the other file's basename. */ + + int fnm_arg = DIR_P (0); + int dir_arg = 1 - fnm_arg; + char const *fnm = cmp.file[fnm_arg].name; + char const *dir = cmp.file[dir_arg].name; + char const *filename = cmp.file[dir_arg].name = free0 + = find_dir_file_pathname (dir, last_component (fnm)); + + if (STREQ (fnm, "-")) + fatal ("cannot compare '-' to a directory"); + + if ((no_dereference_symlinks + ? lstat (filename, &cmp.file[dir_arg].stat) + : stat (filename, &cmp.file[dir_arg].stat)) + != 0) + { + perror_with_name (filename); + status = EXIT_TROUBLE; + } + } + + if (status != EXIT_SUCCESS) + { + /* One of the files should exist but does not. */ + } + else if (cmp.file[0].desc == NONEXISTENT + && cmp.file[1].desc == NONEXISTENT) + { + /* Neither file "exists", so there's nothing to compare. */ + } + else if ((same_files + = (cmp.file[0].desc != NONEXISTENT + && cmp.file[1].desc != NONEXISTENT + && 0 < same_file (&cmp.file[0].stat, &cmp.file[1].stat) + && same_file_attributes (&cmp.file[0].stat, + &cmp.file[1].stat))) + && no_diff_means_no_output) + { + /* The two named files are actually the same physical file. + We know they are identical without actually reading them. */ + } + else if (DIR_P (0) & DIR_P (1)) + { + if (output_style == OUTPUT_IFDEF) + fatal ("-D option not supported with directories"); + + /* If both are directories, compare the files in them. */ + + if (parent && !recursive) + { + /* But don't compare dir contents one level down + unless -r was specified. + See POSIX 1003.1-2001 for this format. */ + message ("Common subdirectories: %s and %s\n", + cmp.file[0].name, cmp.file[1].name); + } + else + status = diff_dirs (&cmp, compare_files); + } + else if ((DIR_P (0) | DIR_P (1)) + || (parent + && !((S_ISREG (cmp.file[0].stat.st_mode) + || S_ISLNK (cmp.file[0].stat.st_mode)) + && (S_ISREG (cmp.file[1].stat.st_mode) + || S_ISLNK (cmp.file[1].stat.st_mode))))) + { + if (cmp.file[0].desc == NONEXISTENT || cmp.file[1].desc == NONEXISTENT) + { + /* We have a subdirectory that exists only in one directory. */ + + if ((DIR_P (0) | DIR_P (1)) + && recursive + && (new_file + || (unidirectional_new_file + && cmp.file[0].desc == NONEXISTENT))) + status = diff_dirs (&cmp, compare_files); + else + { + char const *dir; + + /* PARENT must be non-NULL here. */ + assert (parent); + dir = parent->file[cmp.file[0].desc == NONEXISTENT].name; + + /* See POSIX 1003.1-2001 for this format. */ + message ("Only in %s: %s\n", dir, name0); + + status = EXIT_FAILURE; + } + } + else + { + /* We have two files that are not to be compared. */ + + /* See POSIX 1003.1-2001 for this format. */ + message5 ("File %s is a %s while file %s is a %s\n", + file_label[0] ? file_label[0] : cmp.file[0].name, + file_type (&cmp.file[0].stat), + file_label[1] ? file_label[1] : cmp.file[1].name, + file_type (&cmp.file[1].stat)); + + /* This is a difference. */ + status = EXIT_FAILURE; + } + } + else if (S_ISLNK (cmp.file[0].stat.st_mode) + || S_ISLNK (cmp.file[1].stat.st_mode)) + { + /* We get here only if we use lstat(), not stat(). */ + assert (no_dereference_symlinks); + + if (S_ISLNK (cmp.file[0].stat.st_mode) + && S_ISLNK (cmp.file[1].stat.st_mode)) + { + /* Compare the values of the symbolic links. */ + char *link_value[2] = { NULL, NULL }; + + for (f = 0; f < 2; f++) + { + link_value[f] = xreadlink (cmp.file[f].name); + if (link_value[f] == NULL) + { + perror_with_name (cmp.file[f].name); + status = EXIT_TROUBLE; + break; + } + } + if (status == EXIT_SUCCESS) + { + if ( ! STREQ (link_value[0], link_value[1])) + { + message ("Symbolic links %s and %s differ\n", + cmp.file[0].name, cmp.file[1].name); + /* This is a difference. */ + status = EXIT_FAILURE; + } + } + for (f = 0; f < 2; f++) + free (link_value[f]); + } + else + { + /* We have two files that are not to be compared, because + one of them is a symbolic link and the other one is not. */ + + message5 ("File %s is a %s while file %s is a %s\n", + file_label[0] ? file_label[0] : cmp.file[0].name, + file_type (&cmp.file[0].stat), + file_label[1] ? file_label[1] : cmp.file[1].name, + file_type (&cmp.file[1].stat)); + + /* This is a difference. */ + status = EXIT_FAILURE; + } + } + else if (files_can_be_treated_as_binary + && S_ISREG (cmp.file[0].stat.st_mode) + && S_ISREG (cmp.file[1].stat.st_mode) + && cmp.file[0].stat.st_size != cmp.file[1].stat.st_size + && 0 < cmp.file[0].stat.st_size + && 0 < cmp.file[1].stat.st_size) + { + message ("Files %s and %s differ\n", + file_label[0] ? file_label[0] : cmp.file[0].name, + file_label[1] ? file_label[1] : cmp.file[1].name); + status = EXIT_FAILURE; + } + else + { + /* Both exist and neither is a directory. */ + + /* Open the files and record their descriptors. */ + + int oflags = O_RDONLY | (binary ? O_BINARY : 0); + + if (cmp.file[0].desc == UNOPENED) + if ((cmp.file[0].desc = open (cmp.file[0].name, oflags, 0)) < 0) + { + perror_with_name (cmp.file[0].name); + status = EXIT_TROUBLE; + } + if (cmp.file[1].desc == UNOPENED) + { + if (same_files) + cmp.file[1].desc = cmp.file[0].desc; + else if ((cmp.file[1].desc = open (cmp.file[1].name, oflags, 0)) < 0) + { + perror_with_name (cmp.file[1].name); + status = EXIT_TROUBLE; + } + } + + /* Compare the files, if no error was found. */ + + if (status == EXIT_SUCCESS) + status = diff_2_files (&cmp); + + /* Close the file descriptors. */ + + if (0 <= cmp.file[0].desc && close (cmp.file[0].desc) != 0) + { + perror_with_name (cmp.file[0].name); + status = EXIT_TROUBLE; + } + if (0 <= cmp.file[1].desc && cmp.file[0].desc != cmp.file[1].desc + && close (cmp.file[1].desc) != 0) + { + perror_with_name (cmp.file[1].name); + status = EXIT_TROUBLE; + } + } + + /* Now the comparison has been done, if no error prevented it, + and STATUS is the value this function will return. */ + + if (status == EXIT_SUCCESS) + { + if (report_identical_files && !DIR_P (0)) + message ("Files %s and %s are identical\n", + file_label[0] ? file_label[0] : cmp.file[0].name, + file_label[1] ? file_label[1] : cmp.file[1].name); + } + else + { + /* Flush stdout so that the user sees differences immediately. + This can hurt performance, unfortunately. */ + if (fflush (stdout) != 0) + pfatal_with_name (_("standard output")); + } + + free (free0); + free (free1); + + return status; +} diff --git a/local/recipes/tools/diffutils/source/src/diff.h b/local/recipes/tools/diffutils/source/src/diff.h new file mode 100644 index 0000000000..c8cf436723 --- /dev/null +++ b/local/recipes/tools/diffutils/source/src/diff.h @@ -0,0 +1,423 @@ +/* Shared definitions for GNU DIFF + + Copyright (C) 1988-1989, 1991-1995, 1998, 2001-2002, 2004, 2009-2013, + 2015-2017 Free Software Foundation, Inc. + + This file is part of GNU DIFF. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include "system.h" +#include <regex.h> +#include <stdio.h> +#include <unlocked-io.h> + +/* What kind of changes a hunk contains. */ +enum changes +{ + /* No changes: lines common to both files. */ + UNCHANGED, + + /* Deletes only: lines taken from just the first file. */ + OLD, + + /* Inserts only: lines taken from just the second file. */ + NEW, + + /* Both deletes and inserts: a hunk containing both old and new lines. */ + CHANGED +}; + +/* When colors should be used in the output. */ +enum colors_style +{ + /* Never output colors. */ + NEVER, + + /* Output colors if the output is a terminal. */ + AUTO, + + /* Always output colors. */ + ALWAYS, +}; + +/* Variables for command line options */ + +#ifndef GDIFF_MAIN +# define XTERN extern +#else +# define XTERN +#endif + +enum output_style +{ + /* No output style specified. */ + OUTPUT_UNSPECIFIED, + + /* Default output style. */ + OUTPUT_NORMAL, + + /* Output the differences with lines of context before and after (-c). */ + OUTPUT_CONTEXT, + + /* Output the differences in a unified context diff format (-u). */ + OUTPUT_UNIFIED, + + /* Output the differences as commands suitable for 'ed' (-e). */ + OUTPUT_ED, + + /* Output the diff as a forward ed script (-f). */ + OUTPUT_FORWARD_ED, + + /* Like -f, but output a count of changed lines in each "command" (-n). */ + OUTPUT_RCS, + + /* Output merged #ifdef'd file (-D). */ + OUTPUT_IFDEF, + + /* Output sdiff style (-y). */ + OUTPUT_SDIFF +}; + +/* True for output styles that are robust, + i.e. can handle a file that ends in a non-newline. */ +#define ROBUST_OUTPUT_STYLE(S) ((S) != OUTPUT_ED && (S) != OUTPUT_FORWARD_ED) + +XTERN enum output_style output_style; + +/* Define the current color context used to print a line. */ +XTERN enum colors_style colors_style; + +/* Nonzero if output cannot be generated for identical files. */ +XTERN bool no_diff_means_no_output; + +/* Number of lines of context to show in each set of diffs. + This is zero when context is not to be shown. */ +XTERN lin context; + +/* Consider all files as text files (-a). + Don't interpret codes over 0177 as implying a "binary file". */ +XTERN bool text; + +/* Number of lines to keep in identical prefix and suffix. */ +XTERN lin horizon_lines; + +/* The significance of white space during comparisons. */ +enum DIFF_white_space +{ + /* All white space is significant (the default). */ + IGNORE_NO_WHITE_SPACE, + + /* Ignore changes due to tab expansion (-E). */ + IGNORE_TAB_EXPANSION, + + /* Ignore changes in trailing horizontal white space (-Z). */ + IGNORE_TRAILING_SPACE, + + /* IGNORE_TAB_EXPANSION and IGNORE_TRAILING_SPACE are a special case + because they are independent and can be ORed together, yielding + IGNORE_TAB_EXPANSION_AND_TRAILING_SPACE. */ + IGNORE_TAB_EXPANSION_AND_TRAILING_SPACE, + + /* Ignore changes in horizontal white space (-b). */ + IGNORE_SPACE_CHANGE, + + /* Ignore all horizontal white space (-w). */ + IGNORE_ALL_SPACE +}; +XTERN enum DIFF_white_space ignore_white_space; + +/* Ignore changes that affect only blank lines (-B). */ +XTERN bool ignore_blank_lines; + +/* Files can be compared byte-by-byte, as if they were binary. + This depends on various options. */ +XTERN bool files_can_be_treated_as_binary; + +/* Ignore differences in case of letters (-i). */ +XTERN bool ignore_case; + +/* Ignore differences in case of letters in file names. */ +XTERN bool ignore_file_name_case; + +/* Act on symbolic links themselves rather than on their target + (--no-dereference). */ +XTERN bool no_dereference_symlinks; + +/* File labels for '-c' output headers (--label). */ +XTERN char *file_label[2]; + +/* Regexp to identify function-header lines (-F). */ +XTERN struct re_pattern_buffer function_regexp; + +/* Ignore changes that affect only lines matching this regexp (-I). */ +XTERN struct re_pattern_buffer ignore_regexp; + +/* Say only whether files differ, not how (-q). */ +XTERN bool brief; + +/* Expand tabs in the output so the text lines up properly + despite the characters added to the front of each line (-t). */ +XTERN bool expand_tabs; + +/* Number of columns between tab stops. */ +XTERN size_t tabsize; + +/* Use a tab in the output, rather than a space, before the text of an + input line, so as to keep the proper alignment in the input line + without changing the characters in it (-T). */ +XTERN bool initial_tab; + +/* Do not output an initial space or tab before the text of an empty line. */ +XTERN bool suppress_blank_empty; + +/* Remove trailing carriage returns from input. */ +XTERN bool strip_trailing_cr; + +/* In directory comparison, specify file to start with (-S). + This is used for resuming an aborted comparison. + All file names less than this name are ignored. */ +XTERN char const *starting_file; + +/* Pipe each file's output through pr (-l). */ +XTERN bool paginate; + +/* Line group formats for unchanged, old, new, and changed groups. */ +XTERN char const *group_format[CHANGED + 1]; + +/* Line formats for unchanged, old, and new lines. */ +XTERN char const *line_format[NEW + 1]; + +/* If using OUTPUT_SDIFF print extra information to help the sdiff filter. */ +XTERN bool sdiff_merge_assist; + +/* Tell OUTPUT_SDIFF to show only the left version of common lines. */ +XTERN bool left_column; + +/* Tell OUTPUT_SDIFF to not show common lines. */ +XTERN bool suppress_common_lines; + +/* The half line width and column 2 offset for OUTPUT_SDIFF. */ +XTERN size_t sdiff_half_width; +XTERN size_t sdiff_column2_offset; + +/* String containing all the command options diff received, + with spaces between and at the beginning but none at the end. + If there were no options given, this string is empty. */ +XTERN char *switch_string; + +/* Use heuristics for better speed with large files with a small + density of changes. */ +XTERN bool speed_large_files; + +/* Patterns that match file names to be excluded. */ +XTERN struct exclude *excluded; + +/* Don't discard lines. This makes things slower (sometimes much + slower) but will find a guaranteed minimal set of changes. */ +XTERN bool minimal; + +/* The strftime format to use for time strings. */ +XTERN char const *time_format; + +/* The result of comparison is an "edit script": a chain of 'struct change'. + Each 'struct change' represents one place where some lines are deleted + and some are inserted. + + LINE0 and LINE1 are the first affected lines in the two files (origin 0). + DELETED is the number of lines deleted here from file 0. + INSERTED is the number of lines inserted here in file 1. + + If DELETED is 0 then LINE0 is the number of the line before + which the insertion was done; vice versa for INSERTED and LINE1. */ + +struct change +{ + struct change *link; /* Previous or next edit command */ + lin inserted; /* # lines of file 1 changed here. */ + lin deleted; /* # lines of file 0 changed here. */ + lin line0; /* Line number of 1st deleted line. */ + lin line1; /* Line number of 1st inserted line. */ + bool ignore; /* Flag used in context.c. */ +}; + +/* Structures that describe the input files. */ + +/* Data on one input file being compared. */ + +struct file_data { + int desc; /* File descriptor */ + char const *name; /* File name */ + struct stat stat; /* File status */ + + /* Buffer in which text of file is read. */ + word *buffer; + + /* Allocated size of buffer, in bytes. Always a multiple of + sizeof *buffer. */ + size_t bufsize; + + /* Number of valid bytes now in the buffer. */ + size_t buffered; + + /* Array of pointers to lines in the file. */ + char const **linbuf; + + /* linbuf_base <= buffered_lines <= valid_lines <= alloc_lines. + linebuf[linbuf_base ... buffered_lines - 1] are possibly differing. + linebuf[linbuf_base ... valid_lines - 1] contain valid data. + linebuf[linbuf_base ... alloc_lines - 1] are allocated. */ + lin linbuf_base, buffered_lines, valid_lines, alloc_lines; + + /* Pointer to end of prefix of this file to ignore when hashing. */ + char const *prefix_end; + + /* Count of lines in the prefix. + There are this many lines in the file before linbuf[0]. */ + lin prefix_lines; + + /* Pointer to start of suffix of this file to ignore when hashing. */ + char const *suffix_begin; + + /* Vector, indexed by line number, containing an equivalence code for + each line. It is this vector that is actually compared with that + of another file to generate differences. */ + lin *equivs; + + /* Vector, like the previous one except that + the elements for discarded lines have been squeezed out. */ + lin *undiscarded; + + /* Vector mapping virtual line numbers (not counting discarded lines) + to real ones (counting those lines). Both are origin-0. */ + lin *realindexes; + + /* Total number of nondiscarded lines. */ + lin nondiscarded_lines; + + /* Vector, indexed by real origin-0 line number, + containing 1 for a line that is an insertion or a deletion. + The results of comparison are stored here. */ + char *changed; + + /* 1 if file ends in a line with no final newline. */ + bool missing_newline; + + /* 1 if at end of file. */ + bool eof; + + /* 1 more than the maximum equivalence value used for this or its + sibling file. */ + lin equiv_max; +}; + +/* The file buffer, considered as an array of bytes rather than + as an array of words. */ +#define FILE_BUFFER(f) ((char *) (f)->buffer) + +/* Data on two input files being compared. */ + +struct comparison + { + struct file_data file[2]; + struct comparison const *parent; /* parent, if a recursive comparison */ + }; + +/* Describe the two files currently being compared. */ + +XTERN struct file_data files[2]; + +/* Stdio stream to output diffs to. */ + +XTERN FILE *outfile; + +/* Declare various functions. */ + +/* analyze.c */ +extern int diff_2_files (struct comparison *); + +/* context.c */ +extern void print_context_header (struct file_data[], char const * const *, bool); +extern void print_context_script (struct change *, bool); + +/* dir.c */ +extern int diff_dirs (struct comparison const *, + int (*) (struct comparison const *, + char const *, char const *)); +extern char *find_dir_file_pathname (char const *, char const *); + +/* ed.c */ +extern void print_ed_script (struct change *); +extern void pr_forward_ed_script (struct change *); + +/* ifdef.c */ +extern void print_ifdef_script (struct change *); + +/* io.c */ +extern void file_block_read (struct file_data *, size_t); +extern bool read_files (struct file_data[], bool); + +/* normal.c */ +extern void print_normal_script (struct change *); + +/* rcs.c */ +extern void print_rcs_script (struct change *); + +/* side.c */ +extern void print_sdiff_script (struct change *); + +/* util.c */ +extern char const change_letter[4]; +extern char const pr_program[]; +extern char *concat (char const *, char const *, char const *); +extern bool lines_differ (char const *, char const *) _GL_ATTRIBUTE_PURE; +extern lin translate_line_number (struct file_data const *, lin); +extern struct change *find_change (struct change *); +extern struct change *find_reverse_change (struct change *); +extern void *zalloc (size_t); +extern enum changes analyze_hunk (struct change *, lin *, lin *, lin *, lin *); +extern void begin_output (void); +extern void debug_script (struct change *); +extern void fatal (char const *) __attribute__((noreturn)); +extern void finish_output (void); +extern void message (char const *, char const *, char const *); +extern void message5 (char const *, char const *, char const *, + char const *, char const *); +extern void output_1_line (char const *, char const *, char const *, + char const *); +extern void perror_with_name (char const *); +extern void pfatal_with_name (char const *) __attribute__((noreturn)); +extern void print_1_line (char const *, char const * const *); +extern void print_1_line_nl (char const *, char const * const *, bool); +extern void print_message_queue (void); +extern void print_number_range (char, struct file_data *, lin, lin); +extern void print_script (struct change *, struct change * (*) (struct change *), + void (*) (struct change *)); +extern void setup_output (char const *, char const *, bool); +extern void translate_range (struct file_data const *, lin, lin, + printint *, printint *); + +enum color_context +{ + HEADER_CONTEXT, + ADD_CONTEXT, + DELETE_CONTEXT, + RESET_CONTEXT, + LINE_NUMBER_CONTEXT, +}; + +XTERN bool presume_output_tty; + +extern void set_color_context (enum color_context color_context); +extern void set_color_palette (char const *palette); diff --git a/local/recipes/tools/diffutils/source/src/diff3.c b/local/recipes/tools/diffutils/source/src/diff3.c new file mode 100644 index 0000000000..5f3c7cba75 --- /dev/null +++ b/local/recipes/tools/diffutils/source/src/diff3.c @@ -0,0 +1,1790 @@ +/* diff3 - compare three files line by line + + Copyright (C) 1988-1989, 1992-1996, 1998, 2001-2002, 2004, 2006, 2009-2013, + 2015-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include "system.h" +#include "paths.h" + +#include <stdio.h> +#include <unlocked-io.h> + +#include <c-stack.h> +#include <cmpbuf.h> +#include "die.h" +#include <error.h> +#include <exitfail.h> +#include <file-type.h> +#include <getopt.h> +#include <progname.h> +#include <system-quote.h> +#include <version-etc.h> +#include <xalloc.h> +#include <xfreopen.h> + +/* The official name of this program (e.g., no 'g' prefix). */ +#define PROGRAM_NAME "diff3" + +#define AUTHORS \ + proper_name ("Randy Smith") + +/* Internal data structures and macros for the diff3 program; includes + data structures for both diff3 diffs and normal diffs. */ + +/* Different files within a three way diff. */ +#define FILE0 0 +#define FILE1 1 +#define FILE2 2 + +/* A three way diff is built from two two-way diffs; the file which + the two two-way diffs share is: */ +#define FILEC FILE2 + +/* Different files within a two way diff. + FC is the common file, FO the other file. */ +#define FO 0 +#define FC 1 + +/* The ranges are indexed by */ +#define RANGE_START 0 +#define RANGE_END 1 + +enum diff_type { + ERROR, /* Should not be used */ + ADD, /* Two way diff add */ + CHANGE, /* Two way diff change */ + DELETE, /* Two way diff delete */ + DIFF_ALL, /* All three are different */ + DIFF_1ST, /* Only the first is different */ + DIFF_2ND, /* Only the second */ + DIFF_3RD /* Only the third */ +}; + +/* Two way diff */ +struct diff_block { + lin ranges[2][2]; /* Ranges are inclusive */ + char **lines[2]; /* The actual lines (may contain nulls) */ + size_t *lengths[2]; /* Line lengths (including newlines, if any) */ + struct diff_block *next; +#ifdef lint + struct diff_block *n2; /* Used only when freeing. */ +#endif +}; + +/* Three way diff */ + +struct diff3_block { + enum diff_type correspond; /* Type of diff */ + lin ranges[3][2]; /* Ranges are inclusive */ + char **lines[3]; /* The actual lines (may contain nulls) */ + size_t *lengths[3]; /* Line lengths (including newlines, if any) */ + struct diff3_block *next; +}; + +/* Access the ranges on a diff block. */ +#define D_LOWLINE(diff, filenum) \ + ((diff)->ranges[filenum][RANGE_START]) +#define D_HIGHLINE(diff, filenum) \ + ((diff)->ranges[filenum][RANGE_END]) +#define D_NUMLINES(diff, filenum) \ + (D_HIGHLINE (diff, filenum) - D_LOWLINE (diff, filenum) + 1) + +/* Access the line numbers in a file in a diff by relative line + numbers (i.e. line number within the diff itself). Note that these + are lvalues and can be used for assignment. */ +#define D_RELNUM(diff, filenum, linenum) \ + ((diff)->lines[filenum][linenum]) +#define D_RELLEN(diff, filenum, linenum) \ + ((diff)->lengths[filenum][linenum]) + +/* And get at them directly, when that should be necessary. */ +#define D_LINEARRAY(diff, filenum) \ + ((diff)->lines[filenum]) +#define D_LENARRAY(diff, filenum) \ + ((diff)->lengths[filenum]) + +/* Next block. */ +#define D_NEXT(diff) ((diff)->next) + +/* Access the type of a diff3 block. */ +#define D3_TYPE(diff) ((diff)->correspond) + +/* Line mappings based on diffs. The first maps off the top of the + diff, the second off of the bottom. */ +#define D_HIGH_MAPLINE(diff, fromfile, tofile, linenum) \ + ((linenum) \ + - D_HIGHLINE ((diff), (fromfile)) \ + + D_HIGHLINE ((diff), (tofile))) + +#define D_LOW_MAPLINE(diff, fromfile, tofile, linenum) \ + ((linenum) \ + - D_LOWLINE ((diff), (fromfile)) \ + + D_LOWLINE ((diff), (tofile))) + +/* Options variables for flags set on command line. */ + +/* If nonzero, treat all files as text files, never as binary. */ +static bool text; + +/* Remove trailing carriage returns from input. */ +static bool strip_trailing_cr; + +/* If nonzero, write out an ed script instead of the standard diff3 format. */ +static bool edscript; + +/* If nonzero, in the case of overlapping diffs (type DIFF_ALL), + preserve the lines which would normally be deleted from + file 1 with a special flagging mechanism. */ +static bool flagging; + +/* Use a tab to align output lines (-T). */ +static bool initial_tab; + +/* If nonzero, do not output information for overlapping diffs. */ +static bool simple_only; + +/* If nonzero, do not output information for non-overlapping diffs. */ +static bool overlap_only; + +/* If nonzero, show information for DIFF_2ND diffs. */ +static bool show_2nd; + +/* If nonzero, include ':wq' at the end of the script + to write out the file being edited. */ +static bool finalwrite; + +/* If nonzero, output a merged file. */ +static bool merge; + +static char *read_diff (char const *, char const *, char **); +static char *scan_diff_line (char *, char **, size_t *, char *, char); +static enum diff_type process_diff_control (char **, struct diff_block *); +static bool compare_line_list (char * const[], size_t const[], char * const[], size_t const[], lin); +static bool copy_stringlist (char * const[], size_t const[], char *[], size_t[], lin); +static bool output_diff3_edscript (FILE *, struct diff3_block *, int const[3], int const[3], char const *, char const *, char const *); +static bool output_diff3_merge (FILE *, FILE *, struct diff3_block *, int const[3], int const[3], char const *, char const *, char const *); +static struct diff3_block *create_diff3_block (lin, lin, lin, lin, lin, lin); +static struct diff3_block *make_3way_diff (struct diff_block *, struct diff_block *); +static struct diff3_block *reverse_diff3_blocklist (struct diff3_block *); +static struct diff3_block *using_to_diff3_block (struct diff_block *[2], struct diff_block *[2], int, int, struct diff3_block const *); +static struct diff_block *process_diff (char const *, char const *, struct diff_block **, char **); +static void check_stdout (void); +static void fatal (char const *) __attribute__((noreturn)); +static void output_diff3 (FILE *, struct diff3_block *, int const[3], int const[3]); +static void perror_with_exit (char const *) __attribute__((noreturn)); +static void try_help (char const *, char const *) __attribute__((noreturn)); +static void usage (void); + +static char const *diff_program = DEFAULT_DIFF_PROGRAM; + +/* Values for long options that do not have single-letter equivalents. */ +enum +{ + DIFF_PROGRAM_OPTION = CHAR_MAX + 1, + HELP_OPTION, + STRIP_TRAILING_CR_OPTION +}; + +static struct option const longopts[] = +{ + {"diff-program", 1, 0, DIFF_PROGRAM_OPTION}, + {"easy-only", 0, 0, '3'}, + {"ed", 0, 0, 'e'}, + {"help", 0, 0, HELP_OPTION}, + {"initial-tab", 0, 0, 'T'}, + {"label", 1, 0, 'L'}, + {"merge", 0, 0, 'm'}, + {"overlap-only", 0, 0, 'x'}, + {"show-all", 0, 0, 'A'}, + {"show-overlap", 0, 0, 'E'}, + {"strip-trailing-cr", 0, 0, STRIP_TRAILING_CR_OPTION}, + {"text", 0, 0, 'a'}, + {"version", 0, 0, 'v'}, + {0, 0, 0, 0} +}; + +static void +free_diff_block (struct diff_block *p) +{ +#ifndef lint + (void)p; +#else + while (p) + { + free (p->lines[0]); + free (p->lines[1]); + free (p->lengths[0]); + free (p->lengths[1]); + struct diff_block *next = p->n2; + free (p); + p = next; + } +#endif +} + +/* Copy each next pointer to n2, since make_3way_diff would clobber the former, + yet we will still need something to free these buffers. */ +static void +next_to_n2 (struct diff_block *p) +{ +#ifndef lint + (void)p; +#else + while (p) + p = p->n2 = p->next; +#endif +} + +int +main (int argc, char **argv) +{ + int c, i; + int common; + int mapping[3]; + int rev_mapping[3]; + int incompat = 0; + bool conflicts_found; + struct diff_block *thread0, *thread1, *last_block; + struct diff3_block *diff3; + int tag_count = 0; + char *tag_strings[3]; + char *commonname; + char **file; + struct stat statb; + + exit_failure = EXIT_TROUBLE; + initialize_main (&argc, &argv); + set_program_name (argv[0]); + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + c_stack_action (0); + + while ((c = getopt_long (argc, argv, "aeimvx3AEL:TX", longopts, 0)) != -1) + { + switch (c) + { + case 'a': + text = true; + break; + case 'A': + show_2nd = true; + flagging = true; + incompat++; + break; + case 'x': + overlap_only = true; + incompat++; + break; + case '3': + simple_only = true; + incompat++; + break; + case 'i': + finalwrite = true; + break; + case 'm': + merge = true; + break; + case 'X': + overlap_only = true; + FALLTHROUGH; + case 'E': + flagging = true; + FALLTHROUGH; + case 'e': + incompat++; + break; + case 'T': + initial_tab = true; + break; + case STRIP_TRAILING_CR_OPTION: + strip_trailing_cr = true; + break; + case 'v': + version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version, + AUTHORS, (char *) NULL); + check_stdout (); + return EXIT_SUCCESS; + case DIFF_PROGRAM_OPTION: + diff_program = optarg; + break; + case HELP_OPTION: + usage (); + check_stdout (); + return EXIT_SUCCESS; + case 'L': + /* Handle up to three -L options. */ + if (tag_count < 3) + { + tag_strings[tag_count++] = optarg; + break; + } + try_help ("too many file label options", 0); + default: + try_help (0, 0); + } + } + + /* -AeExX3 without -m implies ed script. */ + edscript = incompat & ~(int) merge; + + show_2nd |= ~incompat & merge; /* -m without -AeExX3 implies -A. */ + flagging |= ~incompat & merge; + + if (incompat > 1 /* Ensure at most one of -AeExX3. */ + || finalwrite & merge /* -i -m would rewrite input file. */ + || (tag_count && ! flagging)) /* -L requires one of -AEX. */ + try_help ("incompatible options", 0); + + if (argc - optind != 3) + { + if (argc - optind < 3) + try_help ("missing operand after '%s'", argv[argc - 1]); + else + try_help ("extra operand '%s'", argv[optind + 3]); + } + + file = &argv[optind]; + + for (i = tag_count; i < 3; i++) + tag_strings[i] = file[i]; + + /* Always compare file1 to file2, even if file2 is "-". + This is needed for -mAeExX3. Using the file0 as + the common file would produce wrong results, because if the + file0-file1 diffs didn't line up with the file0-file2 diffs + (which is entirely possible since we don't use diff's -n option), + diff3 might report phantom changes from file1 to file2. + + Also, try to compare file0 to file1, because this is where + changes are expected to come from. Diffing between these pairs + of files is more likely to avoid phantom changes from file0 to file1. + + Historically, the default common file was file2, so some older + applications (e.g. Emacs ediff) used file2 as the ancestor. So, + for compatibility, if this is a 3-way diff (not a merge or + edscript), prefer file2 as the common file. */ + + common = 2 - (edscript | merge); + + if (STREQ (file[common], "-")) + { + /* Sigh. We've got standard input as the common file. We can't + call diff twice on stdin. Use the other arg as the common + file instead. */ + common = 3 - common; + if (STREQ (file[0], "-") || STREQ (file[common], "-")) + fatal ("'-' specified for more than one input file"); + } + + mapping[0] = 0; + mapping[1] = 3 - common; + mapping[2] = common; + + for (i = 0; i < 3; i++) + rev_mapping[mapping[i]] = i; + + for (i = 0; i < 3; i++) + if (! STREQ (file[i], "-")) + { + if (stat (file[i], &statb) < 0) + perror_with_exit (file[i]); + else if (S_ISDIR (statb.st_mode)) + die (EXIT_TROUBLE, EISDIR, "%s", file[i]); + } + +#ifdef SIGCHLD + /* System V fork+wait does not work if SIGCHLD is ignored. */ + signal (SIGCHLD, SIG_DFL); +#endif + + /* Invoke diff twice on two pairs of input files, combine the two + diffs, and output them. */ + + char *b0, *b1; + commonname = file[rev_mapping[FILEC]]; + thread1 = process_diff (file[rev_mapping[FILE1]], commonname, &last_block, &b1); + thread0 = process_diff (file[rev_mapping[FILE0]], commonname, &last_block, &b0); + + next_to_n2 (thread0); + next_to_n2 (thread1); + + diff3 = make_3way_diff (thread0, thread1); + + free_diff_block (thread0); + free_diff_block (thread1); + + if (edscript) + conflicts_found + = output_diff3_edscript (stdout, diff3, mapping, rev_mapping, + tag_strings[0], tag_strings[1], tag_strings[2]); + else if (merge) + { + xfreopen (file[rev_mapping[FILE0]], "r", stdin); + conflicts_found + = output_diff3_merge (stdin, stdout, diff3, mapping, rev_mapping, + tag_strings[0], tag_strings[1], tag_strings[2]); + if (ferror (stdin)) + fatal ("read failed"); + } + else + { + output_diff3 (stdout, diff3, mapping, rev_mapping); + conflicts_found = false; + } + + free (b0); + free (b1); + check_stdout (); + exit (conflicts_found); +} + +static void +try_help (char const *reason_msgid, char const *operand) +{ + if (reason_msgid) + error (0, 0, _(reason_msgid), operand); + die (EXIT_TROUBLE, 0, + _("Try '%s --help' for more information."), program_name); +} + +static void +check_stdout (void) +{ + if (ferror (stdout)) + fatal ("write failed"); + else if (fclose (stdout) != 0) + perror_with_exit (_("standard output")); +} + +static char const * const option_help_msgid[] = { + N_("-A, --show-all output all changes, bracketing conflicts"), + "", + N_("-e, --ed output ed script incorporating changes\n" + " from OLDFILE to YOURFILE into MYFILE"), + N_("-E, --show-overlap like -e, but bracket conflicts"), + N_("-3, --easy-only like -e, but incorporate only nonoverlapping changes"), + N_("-x, --overlap-only like -e, but incorporate only overlapping changes"), + N_("-X like -x, but bracket conflicts"), + N_("-i append 'w' and 'q' commands to ed scripts"), + "", + N_("-m, --merge output actual merged file, according to\n" + " -A if no other options are given"), + "", + N_("-a, --text treat all files as text"), + N_(" --strip-trailing-cr strip trailing carriage return on input"), + N_("-T, --initial-tab make tabs line up by prepending a tab"), + N_(" --diff-program=PROGRAM use PROGRAM to compare files"), + N_("-L, --label=LABEL use LABEL instead of file name\n" + " (can be repeated up to three times)"), + "", + N_(" --help display this help and exit"), + N_("-v, --version output version information and exit"), + 0 +}; + +static void +usage (void) +{ + char const * const *p; + + printf (_("Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"), + program_name); + printf ("%s\n\n", _("Compare three files line by line.")); + + fputs (_("\ +Mandatory arguments to long options are mandatory for short options too.\n\ +"), stdout); + for (p = option_help_msgid; *p; p++) + if (**p) + printf (" %s\n", _(*p)); + else + putchar ('\n'); + fputs (_("\n\ +The default output format is a somewhat human-readable representation of\n\ +the changes.\n\ +\n\ +The -e, -E, -x, -X (and corresponding long) options cause an ed script\n\ +to be output instead of the default.\n\ +\n\ +Finally, the -m (--merge) option causes diff3 to do the merge internally\n\ +and output the actual merged file. For unusual input, this is more\n\ +robust than using ed.\n"), stdout); + printf ("\n%s\n%s\n", + _("If a FILE is '-', read standard input."), + _("Exit status is 0 if successful, 1 if conflicts, 2 if trouble.")); + emit_bug_reporting_address (); +} + +/* Combine the two diffs together into one. + Here is the algorithm: + + File2 is shared in common between the two diffs. + Diff02 is the diff between 0 and 2. + Diff12 is the diff between 1 and 2. + + 1) Find the range for the first block in File2. + a) Take the lowest of the two ranges (in File2) in the two + current blocks (one from each diff) as being the low + water mark. Assign the upper end of this block as + being the high water mark and move the current block up + one. Mark the block just moved over as to be used. + b) Check the next block in the diff that the high water + mark is *not* from. + + *If* the high water mark is above + the low end of the range in that block, + + mark that block as to be used and move the current + block up. Set the high water mark to the max of + the high end of this block and the current. Repeat b. + + 2) Find the corresponding ranges in File0 (from the blocks + in diff02; line per line outside of diffs) and in File1. + Create a diff3_block, reserving space as indicated by the ranges. + + 3) Copy all of the pointers for file2 in. At least for now, + do memcmp's between corresponding strings in the two diffs. + + 4) Copy all of the pointers for file0 and 1 in. Get what is + needed from file2 (when there isn't a diff block, it's + identical to file2 within the range between diff blocks). + + 5) If the diff blocks used came from only one of the two + strings of diffs, then that file (i.e. the one other than + the common file in that diff) is the odd person out. If + diff blocks are used from both sets, check to see if files + 0 and 1 match: + + Same number of lines? If so, do a set of memcmp's (if + a memcmp matches; copy the pointer over; it'll be easier + later during comparisons). If they match, 0 & 1 are the + same. If not, all three different. + + Then do it again, until the blocks are exhausted. */ + + +/* Make a three way diff (chain of diff3_block's) from two two way + diffs (chains of diff_block's). Assume that each of the two diffs + passed are onto the same file (i.e. that each of the diffs were + made "to" the same file). Return a three way diff pointer with + numbering FILE0 = the other file in diff02, FILE1 = the other file + in diff12, and FILEC = the common file. */ + +static struct diff3_block * +make_3way_diff (struct diff_block *thread0, struct diff_block *thread1) +{ + /* Work on the two diffs passed to it as threads. Thread number 0 + is diff02, thread number 1 is diff12. USING is the base of the + list of blocks to be used to construct each block of the three + way diff; if no blocks from a particular thread are to be used, + that element of USING is 0. LAST_USING contains the last + elements on each of the using lists. + + HIGH_WATER_MARK is the highest line number in the common file + described in any of the diffs in either of the USING lists. + HIGH_WATER_THREAD names the thread. Similarly BASE_WATER_MARK + and BASE_WATER_THREAD describe the lowest line number in the + common file described in any of the diffs in either of the USING + lists. HIGH_WATER_DIFF is the diff from which the + HIGH_WATER_MARK was taken. + + HIGH_WATER_DIFF should always be equal to + LAST_USING[HIGH_WATER_THREAD]. OTHER_DIFF is the next diff to + check for higher water, and should always be equal to + CURRENT[HIGH_WATER_THREAD ^ 1]. OTHER_THREAD is the thread in + which the OTHER_DIFF is, and hence should always be equal to + HIGH_WATER_THREAD ^ 1. + + LAST_DIFF is the last diff block produced by this routine, for + line correspondence purposes between that diff and the one + currently being worked on. It is ZERO_DIFF before any blocks + have been created. */ + + struct diff_block *using[2]; + struct diff_block *last_using[2]; + struct diff_block *current[2]; + + lin high_water_mark; + + int high_water_thread; + int base_water_thread; + int other_thread; + + struct diff_block *high_water_diff; + struct diff_block *other_diff; + + struct diff3_block *result; + struct diff3_block *tmpblock; + struct diff3_block **result_end; + + struct diff3_block const *last_diff3; + + static struct diff3_block const zero_diff3; + + /* Initialization */ + result = 0; + result_end = &result; + current[0] = thread0; current[1] = thread1; + last_diff3 = &zero_diff3; + + /* Sniff up the threads until we reach the end */ + + while (current[0] || current[1]) + { + using[0] = using[1] = last_using[0] = last_using[1] = 0; + + /* Setup low and high water threads, diffs, and marks. */ + if (!current[0]) + base_water_thread = 1; + else if (!current[1]) + base_water_thread = 0; + else + base_water_thread = + (D_LOWLINE (current[0], FC) > D_LOWLINE (current[1], FC)); + + high_water_thread = base_water_thread; + + high_water_diff = current[high_water_thread]; + + high_water_mark = D_HIGHLINE (high_water_diff, FC); + + /* Make the diff you just got info from into the using class */ + using[high_water_thread] + = last_using[high_water_thread] + = high_water_diff; + current[high_water_thread] = high_water_diff->next; + last_using[high_water_thread]->next = 0; + + /* And mark the other diff */ + other_thread = high_water_thread ^ 0x1; + other_diff = current[other_thread]; + + /* Shuffle up the ladder, checking the other diff to see if it + needs to be incorporated. */ + while (other_diff + && D_LOWLINE (other_diff, FC) <= high_water_mark + 1) + { + + /* Incorporate this diff into the using list. Note that + this doesn't take it off the current list */ + if (using[other_thread]) + last_using[other_thread]->next = other_diff; + else + using[other_thread] = other_diff; + last_using[other_thread] = other_diff; + + /* Take it off the current list. Note that this following + code assumes that other_diff enters it equal to + current[high_water_thread ^ 0x1] */ + current[other_thread] = current[other_thread]->next; + other_diff->next = 0; + + /* Set the high_water stuff + If this comparison is equal, then this is the last pass + through this loop; since diff blocks within a given + thread cannot overlap, the high_water_mark will be + *below* the range_start of either of the next diffs. */ + + if (high_water_mark < D_HIGHLINE (other_diff, FC)) + { + high_water_thread ^= 1; + high_water_mark = D_HIGHLINE (other_diff, FC); + } + + /* Set the other diff */ + other_thread = high_water_thread ^ 0x1; + other_diff = current[other_thread]; + } + + /* The using lists contain a list of all of the blocks to be + included in this diff3_block. Create it. */ + + tmpblock = using_to_diff3_block (using, last_using, + base_water_thread, high_water_thread, + last_diff3); + + if (!tmpblock) + fatal ("internal error: screwup in format of diff blocks"); + + /* Put it on the list. */ + *result_end = tmpblock; + result_end = &tmpblock->next; + + /* Set up corresponding lines correctly. */ + last_diff3 = tmpblock; + } + return result; +} + +/* Take two lists of blocks (from two separate diff threads) and put + them together into one diff3 block. Return a pointer to this diff3 + block or 0 for failure. + + All arguments besides using are for the convenience of the routine; + they could be derived from the using array. LAST_USING is a pair + of pointers to the last blocks in the using structure. LOW_THREAD + and HIGH_THREAD tell which threads contain the lowest and highest + line numbers for File0. LAST_DIFF3 contains the last diff produced + in the calling routine. This is used for lines mappings that + would still be identical to the state that diff ended in. + + A distinction should be made in this routine between the two diffs + that are part of a normal two diff block, and the three diffs that + are part of a diff3_block. */ + +static struct diff3_block * +using_to_diff3_block (struct diff_block *using[2], + struct diff_block *last_using[2], + int low_thread, int high_thread, + struct diff3_block const *last_diff3) +{ + lin low[2], high[2]; + struct diff3_block *result; + struct diff_block *ptr; + int d; + lin i; + + /* Find the range in the common file. */ + lin lowc = D_LOWLINE (using[low_thread], FC); + lin highc = D_HIGHLINE (last_using[high_thread], FC); + + /* Find the ranges in the other files. + If using[d] is null, that means that the file to which that diff + refers is equivalent to the common file over this range. */ + + for (d = 0; d < 2; d++) + if (using[d]) + { + low[d] = D_LOW_MAPLINE (using[d], FC, FO, lowc); + high[d] = D_HIGH_MAPLINE (last_using[d], FC, FO, highc); + } + else + { + low[d] = D_HIGH_MAPLINE (last_diff3, FILEC, FILE0 + d, lowc); + high[d] = D_HIGH_MAPLINE (last_diff3, FILEC, FILE0 + d, highc); + } + + /* Create a block with the appropriate sizes */ + result = create_diff3_block (low[0], high[0], low[1], high[1], lowc, highc); + + /* Copy information for the common file. + Return with a zero if any of the compares failed. */ + + for (d = 0; d < 2; d++) + for (ptr = using[d]; ptr; ptr = D_NEXT (ptr)) + { + lin result_offset = D_LOWLINE (ptr, FC) - lowc; + + if (!copy_stringlist (D_LINEARRAY (ptr, FC), + D_LENARRAY (ptr, FC), + D_LINEARRAY (result, FILEC) + result_offset, + D_LENARRAY (result, FILEC) + result_offset, + D_NUMLINES (ptr, FC))) + return 0; + } + + /* Copy information for file d. First deal with anything that might be + before the first diff. */ + + for (d = 0; d < 2; d++) + { + struct diff_block *u = using[d]; + lin lo = low[d], hi = high[d]; + + for (i = 0; + i + lo < (u ? D_LOWLINE (u, FO) : hi + 1); + i++) + { + D_RELNUM (result, FILE0 + d, i) = D_RELNUM (result, FILEC, i); + D_RELLEN (result, FILE0 + d, i) = D_RELLEN (result, FILEC, i); + } + + for (ptr = u; ptr; ptr = D_NEXT (ptr)) + { + lin result_offset = D_LOWLINE (ptr, FO) - lo; + lin linec; + + if (!copy_stringlist (D_LINEARRAY (ptr, FO), + D_LENARRAY (ptr, FO), + D_LINEARRAY (result, FILE0 + d) + result_offset, + D_LENARRAY (result, FILE0 + d) + result_offset, + D_NUMLINES (ptr, FO))) + return 0; + + /* Catch the lines between here and the next diff */ + linec = D_HIGHLINE (ptr, FC) + 1 - lowc; + for (i = D_HIGHLINE (ptr, FO) + 1 - lo; + i < (D_NEXT (ptr) ? D_LOWLINE (D_NEXT (ptr), FO) : hi + 1) - lo; + i++) + { + D_RELNUM (result, FILE0 + d, i) = D_RELNUM (result, FILEC, linec); + D_RELLEN (result, FILE0 + d, i) = D_RELLEN (result, FILEC, linec); + linec++; + } + } + } + + /* Set correspond */ + if (!using[0]) + D3_TYPE (result) = DIFF_2ND; + else if (!using[1]) + D3_TYPE (result) = DIFF_1ST; + else + { + lin nl0 = D_NUMLINES (result, FILE0); + lin nl1 = D_NUMLINES (result, FILE1); + + if (nl0 != nl1 + || !compare_line_list (D_LINEARRAY (result, FILE0), + D_LENARRAY (result, FILE0), + D_LINEARRAY (result, FILE1), + D_LENARRAY (result, FILE1), + nl0)) + D3_TYPE (result) = DIFF_ALL; + else + D3_TYPE (result) = DIFF_3RD; + } + + return result; +} + +/* Copy pointers from a list of strings to a different list of + strings. If a spot in the second list is already filled, make sure + that it is filled with the same string; if not, return false, the copy + incomplete. Upon successful completion of the copy, return true. */ + +static bool +copy_stringlist (char * const fromptrs[], size_t const fromlengths[], + char *toptrs[], size_t tolengths[], + lin copynum) +{ + register char * const *f = fromptrs; + register char **t = toptrs; + register size_t const *fl = fromlengths; + register size_t *tl = tolengths; + + while (copynum--) + { + if (*t) + { + if (*fl != *tl || memcmp (*f, *t, *fl) != 0) + return false; + } + else + { + *t = *f; + *tl = *fl; + } + + t++; f++; tl++; fl++; + } + + return true; +} + +/* Create a diff3_block, with ranges as specified in the arguments. + Allocate the arrays for the various pointers (and zero them) based + on the arguments passed. Return the block as a result. */ + +static struct diff3_block * +create_diff3_block (lin low0, lin high0, + lin low1, lin high1, + lin low2, lin high2) +{ + struct diff3_block *result = xmalloc (sizeof *result); + lin numlines; + + D3_TYPE (result) = ERROR; + D_NEXT (result) = 0; + + /* Assign ranges */ + D_LOWLINE (result, FILE0) = low0; + D_HIGHLINE (result, FILE0) = high0; + D_LOWLINE (result, FILE1) = low1; + D_HIGHLINE (result, FILE1) = high1; + D_LOWLINE (result, FILE2) = low2; + D_HIGHLINE (result, FILE2) = high2; + + /* Allocate and zero space */ + numlines = D_NUMLINES (result, FILE0); + if (numlines) + { + D_LINEARRAY (result, FILE0) = xcalloc (numlines, sizeof (char *)); + D_LENARRAY (result, FILE0) = xcalloc (numlines, sizeof (size_t)); + } + else + { + D_LINEARRAY (result, FILE0) = 0; + D_LENARRAY (result, FILE0) = 0; + } + + numlines = D_NUMLINES (result, FILE1); + if (numlines) + { + D_LINEARRAY (result, FILE1) = xcalloc (numlines, sizeof (char *)); + D_LENARRAY (result, FILE1) = xcalloc (numlines, sizeof (size_t)); + } + else + { + D_LINEARRAY (result, FILE1) = 0; + D_LENARRAY (result, FILE1) = 0; + } + + numlines = D_NUMLINES (result, FILE2); + if (numlines) + { + D_LINEARRAY (result, FILE2) = xcalloc (numlines, sizeof (char *)); + D_LENARRAY (result, FILE2) = xcalloc (numlines, sizeof (size_t)); + } + else + { + D_LINEARRAY (result, FILE2) = 0; + D_LENARRAY (result, FILE2) = 0; + } + + /* Return */ + return result; +} + +/* Compare two lists of lines of text. + Return 1 if they are equivalent, 0 if not. */ + +static bool +compare_line_list (char * const list1[], size_t const lengths1[], + char * const list2[], size_t const lengths2[], + lin nl) +{ + char * const *l1 = list1; + char * const *l2 = list2; + size_t const *lgths1 = lengths1; + size_t const *lgths2 = lengths2; + + while (nl--) + if (!*l1 || !*l2 || *lgths1 != *lgths2++ + || memcmp (*l1++, *l2++, *lgths1++) != 0) + return false; + return true; +} + +/* Input and parse two way diffs. */ + +static struct diff_block * +process_diff (char const *filea, + char const *fileb, + struct diff_block **last_block, + char **buf_to_free) +{ + char *diff_contents; + char *diff_limit; + char *scan_diff; + enum diff_type dt; + lin i; + struct diff_block *block_list; + struct diff_block **block_list_end = &block_list; + struct diff_block *bptr IF_LINT (= NULL); + size_t too_many_lines = (PTRDIFF_MAX + / MIN (sizeof *bptr->lines[1], + sizeof *bptr->lengths[1])); + + diff_limit = read_diff (filea, fileb, &diff_contents); + *buf_to_free = diff_contents; + scan_diff = diff_contents; + + while (scan_diff < diff_limit) + { + bptr = xmalloc (sizeof *bptr); + bptr->lines[0] = bptr->lines[1] = 0; + bptr->lengths[0] = bptr->lengths[1] = 0; + + dt = process_diff_control (&scan_diff, bptr); + if (dt == ERROR || *scan_diff != '\n') + { + fprintf (stderr, _("%s: diff failed: "), program_name); + do + { + putc (*scan_diff, stderr); + } + while (*scan_diff++ != '\n'); + exit (EXIT_TROUBLE); + } + scan_diff++; + + /* Force appropriate ranges to be null, if necessary */ + switch (dt) + { + case ADD: + bptr->ranges[0][0]++; + break; + case DELETE: + bptr->ranges[1][0]++; + break; + case CHANGE: + break; + default: + fatal ("internal error: invalid diff type in process_diff"); + break; + } + + /* Allocate space for the pointers for the lines from filea, and + parcel them out among these pointers */ + if (dt != ADD) + { + lin numlines = D_NUMLINES (bptr, 0); + if (too_many_lines <= numlines) + xalloc_die (); + bptr->lines[0] = xmalloc (numlines * sizeof *bptr->lines[0]); + bptr->lengths[0] = xmalloc (numlines * sizeof *bptr->lengths[0]); + for (i = 0; i < numlines; i++) + scan_diff = scan_diff_line (scan_diff, + &(bptr->lines[0][i]), + &(bptr->lengths[0][i]), + diff_limit, + '<'); + } + + /* Get past the separator for changes */ + if (dt == CHANGE) + { + if (strncmp (scan_diff, "---\n", 4)) + fatal ("invalid diff format; invalid change separator"); + scan_diff += 4; + } + + /* Allocate space for the pointers for the lines from fileb, and + parcel them out among these pointers */ + if (dt != DELETE) + { + lin numlines = D_NUMLINES (bptr, 1); + if (too_many_lines <= numlines) + xalloc_die (); + bptr->lines[1] = xmalloc (numlines * sizeof *bptr->lines[1]); + bptr->lengths[1] = xmalloc (numlines * sizeof *bptr->lengths[1]); + for (i = 0; i < numlines; i++) + scan_diff = scan_diff_line (scan_diff, + &(bptr->lines[1][i]), + &(bptr->lengths[1][i]), + diff_limit, + '>'); + } + + /* Place this block on the blocklist. */ + *block_list_end = bptr; + block_list_end = &bptr->next; + } + + *block_list_end = NULL; + *last_block = bptr; + return block_list; +} + +/* Skip tabs and spaces, and return the first character after them. */ + +static char * _GL_ATTRIBUTE_PURE +skipwhite (char *s) +{ + while (*s == ' ' || *s == '\t') + s++; + return s; +} + +/* Read a nonnegative line number from S, returning the address of the + first character after the line number, and storing the number into + *PNUM. Return 0 if S does not point to a valid line number. */ + +static char * +readnum (char *s, lin *pnum) +{ + unsigned char c = *s; + lin num = 0; + + if (! ISDIGIT (c)) + return 0; + + do + { + num = c - '0' + num * 10; + c = *++s; + } + while (ISDIGIT (c)); + + *pnum = num; + return s; +} + +/* Parse a normal format diff control string. Return the type of the + diff (ERROR if the format is bad). All of the other important + information is filled into to the structure pointed to by db, and + the string pointer (whose location is passed to this routine) is + updated to point beyond the end of the string parsed. Note that + only the ranges in the diff_block will be set by this routine. + + If some specific pair of numbers has been reduced to a single + number, then both corresponding numbers in the diff block are set + to that number. In general these numbers are interpreted as ranges + inclusive, unless being used by the ADD or DELETE commands. It is + assumed that these will be special cased in a superior routine. */ + +static enum diff_type +process_diff_control (char **string, struct diff_block *db) +{ + char *s = *string; + enum diff_type type; + + /* Read first set of digits */ + s = readnum (skipwhite (s), &db->ranges[0][RANGE_START]); + if (! s) + return ERROR; + + /* Was that the only digit? */ + s = skipwhite (s); + if (*s == ',') + { + s = readnum (s + 1, &db->ranges[0][RANGE_END]); + if (! s) + return ERROR; + } + else + db->ranges[0][RANGE_END] = db->ranges[0][RANGE_START]; + + /* Get the letter */ + s = skipwhite (s); + switch (*s) + { + case 'a': + type = ADD; + break; + case 'c': + type = CHANGE; + break; + case 'd': + type = DELETE; + break; + default: + return ERROR; /* Bad format */ + } + s++; /* Past letter */ + + /* Read second set of digits */ + s = readnum (skipwhite (s), &db->ranges[1][RANGE_START]); + if (! s) + return ERROR; + + /* Was that the only digit? */ + s = skipwhite (s); + if (*s == ',') + { + s = readnum (s + 1, &db->ranges[1][RANGE_END]); + if (! s) + return ERROR; + s = skipwhite (s); /* To move to end */ + } + else + db->ranges[1][RANGE_END] = db->ranges[1][RANGE_START]; + + *string = s; + return type; +} + +static char * +read_diff (char const *filea, + char const *fileb, + char **output_placement) +{ + char *diff_result; + size_t current_chunk_size, total; + int fd, wstatus, status; + int werrno = 0; + struct stat pipestat; + char const *argv[9]; + char const **ap; +#if HAVE_WORKING_FORK + int fds[2]; + pid_t pid; +#else + FILE *fpipe; + char *command; +#endif + + ap = argv; + *ap++ = diff_program; + if (text) + *ap++ = "-a"; + if (strip_trailing_cr) + *ap++ = "--strip-trailing-cr"; + *ap++ = "--horizon-lines=100"; + *ap++ = "--"; + *ap++ = filea; + *ap++ = fileb; + *ap = 0; + +#if HAVE_WORKING_FORK + + if (pipe (fds) != 0) + perror_with_exit ("pipe"); + + pid = fork (); + if (pid == 0) + { + /* Child */ + close (fds[0]); + if (fds[1] != STDOUT_FILENO) + { + dup2 (fds[1], STDOUT_FILENO); + close (fds[1]); + } + + /* The cast to (char **) is needed for portability to older + hosts with a nonstandard prototype for execvp. */ + execvp (diff_program, (char **) argv); + + _exit (errno == ENOENT ? 127 : 126); + } + + if (pid == -1) + perror_with_exit ("fork"); + + close (fds[1]); /* Prevent erroneous lack of EOF */ + fd = fds[0]; + +#else + + command = system_quote_argv (SCI_SYSTEM, (char **) argv); + errno = 0; + fpipe = popen (command, "r"); + if (!fpipe) + perror_with_exit (command); + free (command); + fd = fileno (fpipe); + +#endif + + if (fstat (fd, &pipestat) != 0) + perror_with_exit ("fstat"); + current_chunk_size = MAX (1, STAT_BLOCKSIZE (pipestat)); + diff_result = xmalloc (current_chunk_size); + total = 0; + + for (;;) + { + size_t bytes_to_read = current_chunk_size - total; + size_t bytes = block_read (fd, diff_result + total, bytes_to_read); + total += bytes; + if (bytes != bytes_to_read) + { + if (bytes == SIZE_MAX) + perror_with_exit (_("read failed")); + break; + } + if (PTRDIFF_MAX / 2 <= current_chunk_size) + xalloc_die (); + current_chunk_size *= 2; + diff_result = xrealloc (diff_result, current_chunk_size); + } + + if (total != 0 && diff_result[total-1] != '\n') + fatal ("invalid diff format; incomplete last line"); + + *output_placement = diff_result; + +#if ! HAVE_WORKING_FORK + + wstatus = pclose (fpipe); + if (wstatus == -1) + werrno = errno; + +#else + + if (close (fd) != 0) + perror_with_exit ("close"); + if (waitpid (pid, &wstatus, 0) < 0) + perror_with_exit ("waitpid"); + +#endif + + status = ! werrno && WIFEXITED (wstatus) ? WEXITSTATUS (wstatus) : INT_MAX; + + if (EXIT_TROUBLE <= status) + die (EXIT_TROUBLE, werrno, + _(status == 126 + ? "subsidiary program '%s' could not be invoked" + : status == 127 + ? "subsidiary program '%s' not found" + : status == INT_MAX + ? "subsidiary program '%s' failed" + : "subsidiary program '%s' failed (exit status %d)"), + diff_program, status); + + return diff_result + total; +} + + +/* Scan a regular diff line (consisting of > or <, followed by a + space, followed by text (including nulls) up to a newline. + + This next routine began life as a macro and many parameters in it + are used as call-by-reference values. */ +static char * +scan_diff_line (char *scan_ptr, char **set_start, size_t *set_length, + char *limit, char leadingchar) +{ + char *line_ptr; + + if (!(scan_ptr[0] == leadingchar + && scan_ptr[1] == ' ')) + fatal ("invalid diff format; incorrect leading line chars"); + + *set_start = line_ptr = scan_ptr + 2; + while (*line_ptr++ != '\n') + continue; + + /* Include newline if the original line ended in a newline, + or if an edit script is being generated. + Copy any missing newline message to stderr if an edit script is being + generated, because edit scripts cannot handle missing newlines. + Return the beginning of the next line. */ + *set_length = line_ptr - *set_start; + if (line_ptr < limit && *line_ptr == '\\') + { + if (edscript) + fprintf (stderr, "%s:", program_name); + else + --*set_length; + line_ptr++; + do + { + if (edscript) + putc (*line_ptr, stderr); + } + while (*line_ptr++ != '\n'); + } + + return line_ptr; +} + +/* Output a three way diff passed as a list of diff3_block's. The + argument MAPPING is indexed by external file number (in the + argument list) and contains the internal file number (from the diff + passed). This is important because the user expects outputs in + terms of the argument list number, and the diff passed may have + been done slightly differently (if the last argument was "-", for + example). REV_MAPPING is the inverse of MAPPING. */ + +static void +output_diff3 (FILE *outputfile, struct diff3_block *diff, + int const mapping[3], int const rev_mapping[3]) +{ + int i; + int oddoneout; + char *cp; + struct diff3_block *ptr; + lin line; + size_t length; + int dontprint; + static int skew_increment[3] = { 2, 3, 1 }; /* 0==>2==>1==>3 */ + char const *line_prefix = initial_tab ? "\t" : " "; + + for (ptr = diff; ptr; ptr = D_NEXT (ptr)) + { + char x[2]; + + switch (ptr->correspond) + { + case DIFF_ALL: + x[0] = 0; + dontprint = 3; /* Print them all */ + oddoneout = 3; /* Nobody's odder than anyone else */ + break; + case DIFF_1ST: + case DIFF_2ND: + case DIFF_3RD: + oddoneout = rev_mapping[ptr->correspond - DIFF_1ST]; + + x[0] = oddoneout + '1'; + x[1] = 0; + dontprint = oddoneout == 0; + break; + default: + fatal ("internal error: invalid diff type passed to output"); + } + fprintf (outputfile, "====%s\n", x); + + /* Go 0, 2, 1 if the first and third outputs are equivalent. */ + for (i = 0; i < 3; + i = (oddoneout == 1 ? skew_increment[i] : i + 1)) + { + int realfile = mapping[i]; + lin lowt = D_LOWLINE (ptr, realfile); + lin hight = D_HIGHLINE (ptr, realfile); + printint llowt = lowt; + printint lhight = hight; + + fprintf (outputfile, "%d:", i + 1); + switch (lowt - hight) + { + case 1: + fprintf (outputfile, "%"pI"da\n", llowt - 1); + break; + case 0: + fprintf (outputfile, "%"pI"dc\n", llowt); + break; + default: + fprintf (outputfile, "%"pI"d,%"pI"dc\n", llowt, lhight); + break; + } + + if (i == dontprint) continue; + + if (lowt <= hight) + { + line = 0; + do + { + fputs (line_prefix, outputfile); + cp = D_RELNUM (ptr, realfile, line); + length = D_RELLEN (ptr, realfile, line); + fwrite (cp, sizeof (char), length, outputfile); + } + while (++line < hight - lowt + 1); + if (cp[length - 1] != '\n') + fprintf (outputfile, "\n\\ %s\n", + _("No newline at end of file")); + } + } + } +} + + +/* Output to OUTPUTFILE the lines of B taken from FILENUM. Double any + initial '.'s; yield nonzero if any initial '.'s were doubled. */ + +static bool +dotlines (FILE *outputfile, struct diff3_block *b, int filenum) +{ + lin i; + bool leading_dot = false; + + for (i = 0; + i < D_NUMLINES (b, filenum); + i++) + { + char *line = D_RELNUM (b, filenum, i); + if (line[0] == '.') + { + leading_dot = true; + fputc ('.', outputfile); + } + fwrite (line, sizeof (char), + D_RELLEN (b, filenum, i), outputfile); + } + + return leading_dot; +} + +/* Output to OUTPUTFILE a '.' line. If LEADING_DOT is true, also + output a command that removes initial '.'s starting with line START + and continuing for NUM lines. */ + +static void +undotlines (FILE *outputfile, bool leading_dot, printint start, printint num) +{ + fputs (".\n", outputfile); + if (leading_dot) + { + if (num == 1) + fprintf (outputfile, "%"pI"ds/^\\.//\n", start); + else + fprintf (outputfile, "%"pI"d,%"pI"ds/^\\.//\n", start, start + num - 1); + } +} + +/* Output a diff3 set of blocks as an ed script. This script applies + the changes between file's 2 & 3 to file 1. Take the precise + format of the ed script to be output from global variables set + during options processing. Reverse the order of + the set of diff3 blocks in DIFF; this gets + around the problems involved with changing line numbers in an ed + script. + + As in 'output_diff3', the variable MAPPING maps from file number + according to the argument list to file number according to the diff + passed. All files listed below are in terms of the argument list. + REV_MAPPING is the inverse of MAPPING. + + FILE0, FILE1 and FILE2 are the strings to print as the names of the + three files. These may be the actual names, or may be the + arguments specified with -L. + + Return 1 if conflicts were found. */ + +static bool +output_diff3_edscript (FILE *outputfile, struct diff3_block *diff, + int const mapping[3], int const rev_mapping[3], + char const *file0, char const *file1, char const *file2) +{ + bool leading_dot; + bool conflicts_found = false; + bool conflict; + struct diff3_block *b; + + for (b = reverse_diff3_blocklist (diff); b; b = b->next) + { + /* Must do mapping correctly. */ + enum diff_type type + = (b->correspond == DIFF_ALL + ? DIFF_ALL + : DIFF_1ST + rev_mapping[b->correspond - DIFF_1ST]); + + printint low0, high0; + + /* If we aren't supposed to do this output block, skip it. */ + switch (type) + { + default: continue; + case DIFF_2ND: if (!show_2nd) continue; conflict = true; break; + case DIFF_3RD: if (overlap_only) continue; conflict = false; break; + case DIFF_ALL: if (simple_only) continue; conflict = flagging; break; + } + + low0 = D_LOWLINE (b, mapping[FILE0]); + high0 = D_HIGHLINE (b, mapping[FILE0]); + + if (conflict) + { + conflicts_found = true; + + + /* Mark end of conflict. */ + + fprintf (outputfile, "%"pI"da\n", high0); + leading_dot = false; + if (type == DIFF_ALL) + { + if (show_2nd) + { + /* Append lines from FILE1. */ + fprintf (outputfile, "||||||| %s\n", file1); + leading_dot = dotlines (outputfile, b, mapping[FILE1]); + } + /* Append lines from FILE2. */ + fputs ("=======\n", outputfile); + leading_dot |= dotlines (outputfile, b, mapping[FILE2]); + } + fprintf (outputfile, ">>>>>>> %s\n", file2); + undotlines (outputfile, leading_dot, high0 + 2, + (D_NUMLINES (b, mapping[FILE1]) + + D_NUMLINES (b, mapping[FILE2]) + 1)); + + + /* Mark start of conflict. */ + + fprintf (outputfile, "%"pI"da\n<<<<<<< %s\n", low0 - 1, + type == DIFF_ALL ? file0 : file1); + leading_dot = false; + if (type == DIFF_2ND) + { + /* Prepend lines from FILE1. */ + leading_dot = dotlines (outputfile, b, mapping[FILE1]); + fputs ("=======\n", outputfile); + } + undotlines (outputfile, leading_dot, low0 + 1, + D_NUMLINES (b, mapping[FILE1])); + } + else if (D_NUMLINES (b, mapping[FILE2]) == 0) + /* Write out a delete */ + { + if (low0 == high0) + fprintf (outputfile, "%"pI"dd\n", low0); + else + fprintf (outputfile, "%"pI"d,%"pI"dd\n", low0, high0); + } + else + /* Write out an add or change */ + { + switch (high0 - low0) + { + case -1: + fprintf (outputfile, "%"pI"da\n", high0); + break; + case 0: + fprintf (outputfile, "%"pI"dc\n", high0); + break; + default: + fprintf (outputfile, "%"pI"d,%"pI"dc\n", low0, high0); + break; + } + + undotlines (outputfile, dotlines (outputfile, b, mapping[FILE2]), + low0, D_NUMLINES (b, mapping[FILE2])); + } + } + if (finalwrite) + fputs ("w\nq\n", outputfile); + return conflicts_found; +} + +/* Read from INFILE and output to OUTPUTFILE a set of diff3_blocks + DIFF as a merged file. This acts like 'ed file0 + <[output_diff3_edscript]', except that it works even for binary + data or incomplete lines. + + As before, MAPPING maps from arg list file number to diff file + number, REV_MAPPING is its inverse, and FILE0, FILE1, and FILE2 are + the names of the files. + + Return 1 if conflicts were found. */ + +static bool +output_diff3_merge (FILE *infile, FILE *outputfile, struct diff3_block *diff, + int const mapping[3], int const rev_mapping[3], + char const *file0, char const *file1, char const *file2) +{ + int c; + lin i; + bool conflicts_found = false; + bool conflict; + struct diff3_block *b; + lin linesread = 0; + + for (b = diff; b; b = b->next) + { + /* Must do mapping correctly. */ + enum diff_type type + = ((b->correspond == DIFF_ALL) + ? DIFF_ALL + : DIFF_1ST + rev_mapping[b->correspond - DIFF_1ST]); + char const *format_2nd = "<<<<<<< %s\n"; + + /* If we aren't supposed to do this output block, skip it. */ + switch (type) + { + default: continue; + case DIFF_2ND: if (!show_2nd) continue; conflict = true; break; + case DIFF_3RD: if (overlap_only) continue; conflict = false; break; + case DIFF_ALL: if (simple_only) continue; conflict = flagging; + format_2nd = "||||||| %s\n"; + break; + } + + /* Copy I lines from file 0. */ + i = D_LOWLINE (b, FILE0) - linesread - 1; + linesread += i; + while (0 <= --i) + do + { + c = getc (infile); + if (c == EOF) + { + if (ferror (infile)) + perror_with_exit (_("read failed")); + else if (feof (infile)) + fatal ("input file shrank"); + } + putc (c, outputfile); + } + while (c != '\n'); + + if (conflict) + { + conflicts_found = true; + + if (type == DIFF_ALL) + { + /* Put in lines from FILE0 with bracket. */ + fprintf (outputfile, "<<<<<<< %s\n", file0); + for (i = 0; + i < D_NUMLINES (b, mapping[FILE0]); + i++) + fwrite (D_RELNUM (b, mapping[FILE0], i), sizeof (char), + D_RELLEN (b, mapping[FILE0], i), outputfile); + } + + if (show_2nd) + { + /* Put in lines from FILE1 with bracket. */ + fprintf (outputfile, format_2nd, file1); + for (i = 0; + i < D_NUMLINES (b, mapping[FILE1]); + i++) + fwrite (D_RELNUM (b, mapping[FILE1], i), sizeof (char), + D_RELLEN (b, mapping[FILE1], i), outputfile); + } + + fputs ("=======\n", outputfile); + } + + /* Put in lines from FILE2. */ + for (i = 0; + i < D_NUMLINES (b, mapping[FILE2]); + i++) + fwrite (D_RELNUM (b, mapping[FILE2], i), sizeof (char), + D_RELLEN (b, mapping[FILE2], i), outputfile); + + if (conflict) + fprintf (outputfile, ">>>>>>> %s\n", file2); + + /* Skip I lines in file 0. */ + i = D_NUMLINES (b, FILE0); + linesread += i; + while (0 <= --i) + while ((c = getc (infile)) != '\n') + if (c == EOF) + { + if (ferror (infile)) + perror_with_exit (_("read failed")); + else if (feof (infile)) + { + if (i || b->next) + fatal ("input file shrank"); + return conflicts_found; + } + } + } + /* Copy rest of common file. */ + while ((c = getc (infile)) != EOF || !(ferror (infile) | feof (infile))) + putc (c, outputfile); + return conflicts_found; +} + +/* Reverse the order of the list of diff3 blocks. */ + +static struct diff3_block * +reverse_diff3_blocklist (struct diff3_block *diff) +{ + register struct diff3_block *tmp, *next, *prev; + + for (tmp = diff, prev = 0; tmp; tmp = next) + { + next = tmp->next; + tmp->next = prev; + prev = tmp; + } + + return prev; +} + +static void +fatal (char const *msgid) +{ + die (EXIT_TROUBLE, 0, "%s", _(msgid)); +} + +static void +perror_with_exit (char const *string) +{ + die (EXIT_TROUBLE, errno, "%s", string); +} diff --git a/local/recipes/tools/diffutils/source/src/dir.c b/local/recipes/tools/diffutils/source/src/dir.c new file mode 100644 index 0000000000..52c320aa89 --- /dev/null +++ b/local/recipes/tools/diffutils/source/src/dir.c @@ -0,0 +1,385 @@ +/* Read, sort and compare two directories. Used for GNU DIFF. + + Copyright (C) 1988-1989, 1992-1995, 1998, 2001-2002, 2004, 2006-2007, + 2009-2013, 2015-2017 Free Software Foundation, Inc. + + This file is part of GNU DIFF. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include "diff.h" +#include <error.h> +#include <exclude.h> +#include <filenamecat.h> +#include <setjmp.h> +#include <xalloc.h> + +/* Read the directory named by DIR and store into DIRDATA a sorted vector + of filenames for its contents. DIR->desc == -1 means this directory is + known to be nonexistent, so set DIRDATA to an empty vector. + Return -1 (setting errno) if error, 0 otherwise. */ + +struct dirdata +{ + size_t nnames; /* Number of names. */ + char const **names; /* Sorted names of files in dir, followed by 0. */ + char *data; /* Allocated storage for file names. */ +}; + +/* Whether file names in directories should be compared with + locale-specific sorting. */ +static bool locale_specific_sorting; + +/* Where to go if locale-specific sorting fails. */ +static jmp_buf failed_locale_specific_sorting; + +static bool dir_loop (struct comparison const *, int); + + +/* Read a directory and get its vector of names. */ + +static bool +dir_read (struct file_data const *dir, struct dirdata *dirdata) +{ + register struct dirent *next; + register size_t i; + + /* Address of block containing the files that are described. */ + char const **names; + + /* Number of files in directory. */ + size_t nnames; + + /* Allocated and used storage for file name data. */ + char *data; + size_t data_alloc, data_used; + + dirdata->names = 0; + dirdata->data = 0; + nnames = 0; + data = 0; + + if (dir->desc != -1) + { + /* Open the directory and check for errors. */ + register DIR *reading = opendir (dir->name); + if (!reading) + return false; + + /* Initialize the table of filenames. */ + + data_alloc = 512; + data_used = 0; + dirdata->data = data = xmalloc (data_alloc); + + /* Read the directory entries, and insert the subfiles + into the 'data' table. */ + + while ((errno = 0, (next = readdir (reading)) != 0)) + { + char *d_name = next->d_name; + size_t d_size = _D_EXACT_NAMLEN (next) + 1; + + /* Ignore "." and "..". */ + if (d_name[0] == '.' + && (d_name[1] == 0 || (d_name[1] == '.' && d_name[2] == 0))) + continue; + + if (excluded_file_name (excluded, d_name)) + continue; + + while (data_alloc < data_used + d_size) + { + if (PTRDIFF_MAX / 2 <= data_alloc) + xalloc_die (); + dirdata->data = data = xrealloc (data, data_alloc *= 2); + } + + memcpy (data + data_used, d_name, d_size); + data_used += d_size; + nnames++; + } + if (errno) + { + int e = errno; + closedir (reading); + errno = e; + return false; + } +#if CLOSEDIR_VOID + closedir (reading); +#else + if (closedir (reading) != 0) + return false; +#endif + } + + /* Create the 'names' table from the 'data' table. */ + if (PTRDIFF_MAX / sizeof *names - 1 <= nnames) + xalloc_die (); + dirdata->names = names = xmalloc ((nnames + 1) * sizeof *names); + dirdata->nnames = nnames; + for (i = 0; i < nnames; i++) + { + names[i] = data; + data += strlen (data) + 1; + } + names[nnames] = 0; + return true; +} + +/* Compare strings in a locale-specific way, returning a value + compatible with strcmp. */ + +static int +compare_collated (char const *name1, char const *name2) +{ + int r; + errno = 0; + if (ignore_file_name_case) + r = strcasecoll (name1, name2); + else + r = strcoll (name1, name2); + if (errno) + { + error (0, errno, _("cannot compare file names '%s' and '%s'"), + name1, name2); + longjmp (failed_locale_specific_sorting, 1); + } + return r; +} + +/* Compare file names, returning a value compatible with strcmp. */ + +static int +compare_names (char const *name1, char const *name2) +{ + if (locale_specific_sorting) + { + int diff = compare_collated (name1, name2); + if (diff || ignore_file_name_case) + return diff; + } + return file_name_cmp (name1, name2); +} + +/* Compare names FILE1 and FILE2 when sorting a directory. + Prefer filtered comparison, breaking ties with file_name_cmp. */ + +static int +compare_names_for_qsort (void const *file1, void const *file2) +{ + char const *const *f1 = file1; + char const *const *f2 = file2; + char const *name1 = *f1; + char const *name2 = *f2; + if (locale_specific_sorting) + { + int diff = compare_collated (name1, name2); + if (diff) + return diff; + } + return file_name_cmp (name1, name2); +} + +/* Compare the contents of two directories named in CMP. + This is a top-level routine; it does everything necessary for diff + on two directories. + + CMP->file[0].desc == -1 says directory CMP->file[0] doesn't exist, + but pretend it is empty. Likewise for CMP->file[1]. + + HANDLE_FILE is a caller-provided subroutine called to handle each file. + It gets three operands: CMP, name of file in dir 0, name of file in dir 1. + These names are relative to the original working directory. + + For a file that appears in only one of the dirs, one of the name-args + to HANDLE_FILE is zero. + + Returns the maximum of all the values returned by HANDLE_FILE, + or EXIT_TROUBLE if trouble is encountered in opening files. */ + +int +diff_dirs (struct comparison const *cmp, + int (*handle_file) (struct comparison const *, + char const *, char const *)) +{ + struct dirdata dirdata[2]; + int volatile val = EXIT_SUCCESS; + int i; + + if ((cmp->file[0].desc == -1 || dir_loop (cmp, 0)) + && (cmp->file[1].desc == -1 || dir_loop (cmp, 1))) + { + error (0, 0, _("%s: recursive directory loop"), + cmp->file[cmp->file[0].desc == -1].name); + return EXIT_TROUBLE; + } + + /* Get contents of both dirs. */ + for (i = 0; i < 2; i++) + if (! dir_read (&cmp->file[i], &dirdata[i])) + { + perror_with_name (cmp->file[i].name); + val = EXIT_TROUBLE; + } + + if (val == EXIT_SUCCESS) + { + char const **volatile names[2]; + names[0] = dirdata[0].names; + names[1] = dirdata[1].names; + + /* Use locale-specific sorting if possible, else native byte order. */ + locale_specific_sorting = true; + if (setjmp (failed_locale_specific_sorting)) + locale_specific_sorting = false; + + /* Sort the directories. */ + for (i = 0; i < 2; i++) + qsort (names[i], dirdata[i].nnames, sizeof *dirdata[i].names, + compare_names_for_qsort); + + /* If '-S name' was given, and this is the topmost level of comparison, + ignore all file names less than the specified starting name. */ + + if (starting_file && ! cmp->parent) + { + while (*names[0] && compare_names (*names[0], starting_file) < 0) + names[0]++; + while (*names[1] && compare_names (*names[1], starting_file) < 0) + names[1]++; + } + + /* Loop while files remain in one or both dirs. */ + while (*names[0] || *names[1]) + { + /* Compare next name in dir 0 with next name in dir 1. + At the end of a dir, + pretend the "next name" in that dir is very large. */ + int nameorder = (!*names[0] ? 1 : !*names[1] ? -1 + : compare_names (*names[0], *names[1])); + + /* Prefer a file_name_cmp match if available. This algorithm is + O(N**2), where N is the number of names in a directory + that compare_names says are all equal, but in practice N + is so small it's not worth tuning. */ + if (nameorder == 0 && ignore_file_name_case) + { + int raw_order = file_name_cmp (*names[0], *names[1]); + if (raw_order != 0) + { + int greater_side = raw_order < 0; + int lesser_side = 1 - greater_side; + char const **lesser = names[lesser_side]; + char const *greater_name = *names[greater_side]; + char const **p; + + for (p = lesser + 1; + *p && compare_names (*p, greater_name) == 0; + p++) + { + int c = file_name_cmp (*p, greater_name); + if (0 <= c) + { + if (c == 0) + { + memmove (lesser + 1, lesser, + (char *) p - (char *) lesser); + *lesser = greater_name; + } + break; + } + } + } + } + + int v1 = (*handle_file) (cmp, + 0 < nameorder ? 0 : *names[0]++, + nameorder < 0 ? 0 : *names[1]++); + if (val < v1) + val = v1; + } + } + + for (i = 0; i < 2; i++) + { + free (dirdata[i].names); + free (dirdata[i].data); + } + + return val; +} + +/* Return nonzero if CMP is looping recursively in argument I. */ + +static bool _GL_ATTRIBUTE_PURE +dir_loop (struct comparison const *cmp, int i) +{ + struct comparison const *p = cmp; + while ((p = p->parent)) + if (0 < same_file (&p->file[i].stat, &cmp->file[i].stat)) + return true; + return false; +} + +/* Find a matching filename in a directory. */ + +char * +find_dir_file_pathname (char const *dir, char const *file) +{ + /* The 'IF_LINT (volatile)' works around what appears to be a bug in + gcc 4.8.0 20120825; see + <http://lists.gnu.org/archive/html/bug-diffutils/2012-08/msg00007.html>. + */ + char const * IF_LINT (volatile) match = file; + + char *val; + struct dirdata dirdata; + dirdata.names = NULL; + dirdata.data = NULL; + + if (ignore_file_name_case) + { + struct file_data filedata; + filedata.name = dir; + filedata.desc = 0; + + if (dir_read (&filedata, &dirdata)) + { + locale_specific_sorting = true; + if (setjmp (failed_locale_specific_sorting)) + match = file; /* longjmp may mess up MATCH. */ + else + { + for (char const **p = dirdata.names; *p; p++) + if (compare_names (*p, file) == 0) + { + if (file_name_cmp (*p, file) == 0) + { + match = *p; + break; + } + if (match == file) + match = *p; + } + } + } + } + + val = file_name_concat (dir, match, NULL); + free (dirdata.names); + free (dirdata.data); + return val; +} diff --git a/local/recipes/tools/diffutils/source/src/ed.c b/local/recipes/tools/diffutils/source/src/ed.c new file mode 100644 index 0000000000..68789a4755 --- /dev/null +++ b/local/recipes/tools/diffutils/source/src/ed.c @@ -0,0 +1,177 @@ +/* Output routines for ed-script format. + + Copyright (C) 1988-1989, 1991-1993, 1995, 1998, 2001, 2004, 2006, 2009-2013, + 2015-2017 Free Software Foundation, Inc. + + This file is part of GNU DIFF. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include "diff.h" + +static void print_ed_hunk (struct change *); +static void print_rcs_hunk (struct change *); +static void pr_forward_ed_hunk (struct change *); + +/* Print our script as ed commands. */ + +void +print_ed_script (struct change *script) +{ + print_script (script, find_reverse_change, print_ed_hunk); +} + +/* Print a hunk of an ed diff */ + +static void +print_ed_hunk (struct change *hunk) +{ + lin f0, l0, f1, l1; + enum changes changes; + +#ifdef DEBUG + debug_script (hunk); +#endif + + /* Determine range of line numbers involved in each file. */ + changes = analyze_hunk (hunk, &f0, &l0, &f1, &l1); + if (!changes) + return; + + begin_output (); + + /* Print out the line number header for this hunk */ + print_number_range (',', &files[0], f0, l0); + fputc (change_letter[changes], outfile); + fputc ('\n', outfile); + + /* Print new/changed lines from second file, if needed */ + if (changes != OLD) + { + lin i; + bool insert_mode = true; + + for (i = f1; i <= l1; i++) + { + if (!insert_mode) + { + fputs ("a\n", outfile); + insert_mode = true; + } + if (files[1].linbuf[i][0] == '.' && files[1].linbuf[i][1] == '\n') + { + /* The file's line is just a dot, and it would exit + insert mode. Precede the dot with another dot, exit + insert mode and remove the extra dot. */ + fputs ("..\n.\ns/.//\n", outfile); + insert_mode = false; + } + else + print_1_line ("", &files[1].linbuf[i]); + } + + if (insert_mode) + fputs (".\n", outfile); + } +} + +/* Print change script in the style of ed commands, + but print the changes in the order they appear in the input files, + which means that the commands are not truly useful with ed. + Because of the issue with lines containing just a dot, the output + is not even parseable. */ + +void +pr_forward_ed_script (struct change *script) +{ + print_script (script, find_change, pr_forward_ed_hunk); +} + +static void +pr_forward_ed_hunk (struct change *hunk) +{ + lin i, f0, l0, f1, l1; + + /* Determine range of line numbers involved in each file. */ + enum changes changes = analyze_hunk (hunk, &f0, &l0, &f1, &l1); + if (!changes) + return; + + begin_output (); + + fputc (change_letter[changes], outfile); + print_number_range (' ', files, f0, l0); + fputc ('\n', outfile); + + /* If deletion only, print just the number range. */ + + if (changes == OLD) + return; + + /* For insertion (with or without deletion), print the number range + and the lines from file 2. */ + + for (i = f1; i <= l1; i++) + print_1_line ("", &files[1].linbuf[i]); + + fputs (".\n", outfile); +} + +/* Print in a format somewhat like ed commands + except that each insert command states the number of lines it inserts. + This format is used for RCS. */ + +void +print_rcs_script (struct change *script) +{ + print_script (script, find_change, print_rcs_hunk); +} + +/* Print a hunk of an RCS diff */ + +static void +print_rcs_hunk (struct change *hunk) +{ + lin i, f0, l0, f1, l1; + printint tf0, tl0, tf1, tl1; + + /* Determine range of line numbers involved in each file. */ + enum changes changes = analyze_hunk (hunk, &f0, &l0, &f1, &l1); + if (!changes) + return; + + begin_output (); + + translate_range (&files[0], f0, l0, &tf0, &tl0); + + if (changes & OLD) + { + /* For deletion, print just the starting line number from file 0 + and the number of lines deleted. */ + fprintf (outfile, "d%"pI"d %"pI"d\n", tf0, + tf0 <= tl0 ? tl0 - tf0 + 1 : 1); + } + + if (changes & NEW) + { + /* Take last-line-number from file 0 and # lines from file 1. */ + translate_range (&files[1], f1, l1, &tf1, &tl1); + fprintf (outfile, "a%"pI"d %"pI"d\n", tl0, + tf1 <= tl1 ? tl1 - tf1 + 1 : 1); + + /* Print the inserted lines. */ + for (i = f1; i <= l1; i++) + print_1_line ("", &files[1].linbuf[i]); + } +} diff --git a/local/recipes/tools/diffutils/source/src/ifdef.c b/local/recipes/tools/diffutils/source/src/ifdef.c new file mode 100644 index 0000000000..c7dae8d111 --- /dev/null +++ b/local/recipes/tools/diffutils/source/src/ifdef.c @@ -0,0 +1,431 @@ +/* #ifdef-format output routines for GNU DIFF. + + Copyright (C) 1989, 1991-1994, 2001-2002, 2004, 2006, 2009-2013, 2015-2017 + Free Software Foundation, Inc. + + This file is part of GNU DIFF. + + GNU DIFF is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. No author or distributor + accepts responsibility to anyone for the consequences of using it + or for whether it serves any particular purpose or works at all, + unless he says so in writing. Refer to the GNU General Public + License for full details. + + Everyone is granted permission to copy, modify and redistribute + GNU DIFF, but only under the conditions described in the + GNU General Public License. A copy of this license is + supposed to have been given to you along with GNU DIFF so you + can know your rights and responsibilities. It should be in a + file named COPYING. Among other things, the copyright notice + and this notice must be preserved on all copies. */ + +#include "diff.h" + +#include <xalloc.h> + +struct group +{ + struct file_data const *file; + lin from, upto; /* start and limit lines for this group of lines */ +}; + +static char const *format_group (FILE *, char const *, char, + struct group const *); +static char const *do_printf_spec (FILE *, char const *, + struct file_data const *, lin, + struct group const *); +static char const *scan_char_literal (char const *, char *); +static lin groups_letter_value (struct group const *, char); +static void format_ifdef (char const *, lin, lin, lin, lin); +static void print_ifdef_hunk (struct change *); +static void print_ifdef_lines (FILE *, char const *, struct group const *); + +static lin next_line0; +static lin next_line1; + +/* Print the edit-script SCRIPT as a merged #ifdef file. */ + +void +print_ifdef_script (struct change *script) +{ + next_line0 = next_line1 = - files[0].prefix_lines; + print_script (script, find_change, print_ifdef_hunk); + if (next_line0 < files[0].valid_lines + || next_line1 < files[1].valid_lines) + { + begin_output (); + format_ifdef (group_format[UNCHANGED], + next_line0, files[0].valid_lines, + next_line1, files[1].valid_lines); + } +} + +/* Print a hunk of an ifdef diff. + This is a contiguous portion of a complete edit script, + describing changes in consecutive lines. */ + +static void +print_ifdef_hunk (struct change *hunk) +{ + lin first0, last0, first1, last1; + + /* Determine range of line numbers involved in each file. */ + enum changes changes = analyze_hunk (hunk, &first0, &last0, &first1, &last1); + if (!changes) + return; + + begin_output (); + + /* Print lines up to this change. */ + if (next_line0 < first0 || next_line1 < first1) + format_ifdef (group_format[UNCHANGED], + next_line0, first0, + next_line1, first1); + + /* Print this change. */ + next_line0 = last0 + 1; + next_line1 = last1 + 1; + format_ifdef (group_format[changes], + first0, next_line0, + first1, next_line1); +} + +/* Print a set of lines according to FORMAT. + Lines BEG0 up to END0 are from the first file; + lines BEG1 up to END1 are from the second file. */ + +static void +format_ifdef (char const *format, lin beg0, lin end0, lin beg1, lin end1) +{ + struct group groups[2]; + + groups[0].file = &files[0]; + groups[0].from = beg0; + groups[0].upto = end0; + groups[1].file = &files[1]; + groups[1].from = beg1; + groups[1].upto = end1; + format_group (outfile, format, 0, groups); +} + +/* Print to file OUT a set of lines according to FORMAT. + The format ends at the first free instance of ENDCHAR. + Yield the address of the terminating character. + GROUPS specifies which lines to print. + If OUT is zero, do not actually print anything; just scan the format. */ + +static char const * +format_group (register FILE *out, char const *format, char endchar, + struct group const *groups) +{ + register char c; + register char const *f = format; + + while ((c = *f) != endchar && c != 0) + { + char const *f1 = ++f; + if (c == '%') + switch ((c = *f++)) + { + case '%': + break; + + case '(': + /* Print if-then-else format e.g. '%(n=1?thenpart:elsepart)'. */ + { + int i; + uintmax_t value[2]; + FILE *thenout, *elseout; + + for (i = 0; i < 2; i++) + { + if (ISDIGIT (*f)) + { + char *fend; + errno = 0; + value[i] = strtoumax (f, &fend, 10); + if (errno) + goto bad_format; + f = fend; + } + else + { + value[i] = groups_letter_value (groups, *f); + if (value[i] == -1) + goto bad_format; + f++; + } + if (*f++ != "=?"[i]) + goto bad_format; + } + if (value[0] == value[1]) + thenout = out, elseout = 0; + else + thenout = 0, elseout = out; + f = format_group (thenout, f, ':', groups); + if (*f) + { + f = format_group (elseout, f + 1, ')', groups); + if (*f) + f++; + } + } + continue; + + case '<': + /* Print lines deleted from first file. */ + print_ifdef_lines (out, line_format[OLD], &groups[0]); + continue; + + case '=': + /* Print common lines. */ + print_ifdef_lines (out, line_format[UNCHANGED], &groups[0]); + continue; + + case '>': + /* Print lines inserted from second file. */ + print_ifdef_lines (out, line_format[NEW], &groups[1]); + continue; + + default: + f = do_printf_spec (out, f - 2, 0, 0, groups); + if (f) + continue; + /* Fall through. */ + bad_format: + c = '%'; + f = f1; + break; + } + + if (out) + putc (c, out); + } + + return f; +} + +/* For the line group pair G, return the number corresponding to LETTER. + Return -1 if LETTER is not a group format letter. */ +static lin +groups_letter_value (struct group const *g, char letter) +{ + switch (letter) + { + case 'E': letter = 'e'; g++; break; + case 'F': letter = 'f'; g++; break; + case 'L': letter = 'l'; g++; break; + case 'M': letter = 'm'; g++; break; + case 'N': letter = 'n'; g++; break; + } + + switch (letter) + { + case 'e': return translate_line_number (g->file, g->from) - 1; + case 'f': return translate_line_number (g->file, g->from); + case 'l': return translate_line_number (g->file, g->upto) - 1; + case 'm': return translate_line_number (g->file, g->upto); + case 'n': return g->upto - g->from; + default: return -1; + } +} + +/* Print to file OUT, using FORMAT to print the line group GROUP. + But do nothing if OUT is zero. */ +static void +print_ifdef_lines (register FILE *out, char const *format, + struct group const *group) +{ + struct file_data const *file = group->file; + char const * const *linbuf = file->linbuf; + lin from = group->from, upto = group->upto; + + if (!out) + return; + + /* If possible, use a single fwrite; it's faster. */ + if (!expand_tabs && format[0] == '%') + { + if (format[1] == 'l' && format[2] == '\n' && !format[3] && from < upto) + { + fwrite (linbuf[from], sizeof (char), + linbuf[upto] + (linbuf[upto][-1] != '\n') - linbuf[from], + out); + return; + } + if (format[1] == 'L' && !format[2]) + { + fwrite (linbuf[from], sizeof (char), + linbuf[upto] - linbuf[from], out); + return; + } + } + + for (; from < upto; from++) + { + register char c; + register char const *f = format; + + while ((c = *f++) != 0) + { + char const *f1 = f; + if (c == '%') + switch ((c = *f++)) + { + case '%': + break; + + case 'l': + output_1_line (linbuf[from], + (linbuf[from + 1] + - (linbuf[from + 1][-1] == '\n')), + 0, 0); + continue; + + case 'L': + output_1_line (linbuf[from], linbuf[from + 1], 0, 0); + continue; + + default: + f = do_printf_spec (out, f - 2, file, from, 0); + if (f) + continue; + c = '%'; + f = f1; + break; + } + + putc (c, out); + } + } +} + +static char const * +do_printf_spec (FILE *out, char const *spec, + struct file_data const *file, lin n, + struct group const *groups) +{ + char const *f = spec; + char c; + char c1; + + /* Scan printf-style SPEC of the form %[-'0]*[0-9]*(.[0-9]*)?[cdoxX]. */ + /* assert (*f == '%'); */ + f++; + while ((c = *f++) == '-' || c == '\'' || c == '0') + continue; + while (ISDIGIT (c)) + c = *f++; + if (c == '.') + while (ISDIGIT (c = *f++)) + continue; + c1 = *f++; + + switch (c) + { + case 'c': + if (c1 != '\'') + return 0; + else + { + char value IF_LINT (= 0); + f = scan_char_literal (f, &value); + if (!f) + return 0; + if (out) + putc (value, out); + } + break; + + case 'd': case 'o': case 'x': case 'X': + { + lin value; + + if (file) + { + if (c1 != 'n') + return 0; + value = translate_line_number (file, n); + } + else + { + value = groups_letter_value (groups, c1); + if (value < 0) + return 0; + } + + if (out) + { + /* For example, if the spec is "%3xn" and pI is "l", use the printf + format spec "%3lx". Here the spec prefix is "%3". */ + printint print_value = value; + size_t spec_prefix_len = f - spec - 2; + size_t pI_len = sizeof pI - 1; +#if 0 + char format[spec_prefix_len + pI_len + 2]; +#else + char *format = xmalloc (spec_prefix_len + pI_len + 2); +#endif + char *p = format + spec_prefix_len + pI_len; + memcpy (format, spec, spec_prefix_len); + memcpy (format + spec_prefix_len, pI, pI_len); + *p++ = c; + *p = '\0'; + fprintf (out, format, print_value); +#if ! HAVE_C_VARARRAYS + free (format); +#endif + } + } + break; + + default: + return 0; + } + + return f; +} + +/* Scan the character literal represented in the string LIT; LIT points just + after the initial apostrophe. Put the literal's value into *VALPTR. + Yield the address of the first character after the closing apostrophe, + or a null pointer if the literal is ill-formed. */ +static char const * +scan_char_literal (char const *lit, char *valptr) +{ + register char const *p = lit; + char value; + ptrdiff_t digits; + char c = *p++; + + switch (c) + { + case 0: + case '\'': + return NULL; + + case '\\': + value = 0; + while ((c = *p++) != '\'') + { + unsigned int digit = c - '0'; + if (8 <= digit) + return NULL; + value = 8 * value + digit; + } + digits = p - lit - 2; + if (! (1 <= digits && digits <= 3)) + return NULL; + break; + + default: + value = c; + if (*p++ != '\'') + return NULL; + break; + } + + *valptr = value; + return p; +} diff --git a/local/recipes/tools/diffutils/source/src/io.c b/local/recipes/tools/diffutils/source/src/io.c new file mode 100644 index 0000000000..b4ef5dcf5f --- /dev/null +++ b/local/recipes/tools/diffutils/source/src/io.c @@ -0,0 +1,830 @@ +/* File I/O for GNU DIFF. + + Copyright (C) 1988-1989, 1992-1995, 1998, 2001-2002, 2004, 2006, 2009-2013, + 2015-2017 Free Software Foundation, Inc. + + This file is part of GNU DIFF. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include "diff.h" +#include <binary-io.h> +#include <cmpbuf.h> +#include <file-type.h> +#include <xalloc.h> + +/* Rotate an unsigned value to the left. */ +#define ROL(v, n) ((v) << (n) | (v) >> (sizeof (v) * CHAR_BIT - (n))) + +/* Given a hash value and a new character, return a new hash value. */ +#define HASH(h, c) ((c) + ROL (h, 7)) + +/* The type of a hash value. */ +typedef size_t hash_value; +verify (! TYPE_SIGNED (hash_value)); + +/* Lines are put into equivalence classes of lines that match in lines_differ. + Each equivalence class is represented by one of these structures, + but only while the classes are being computed. + Afterward, each class is represented by a number. */ +struct equivclass +{ + lin next; /* Next item in this bucket. */ + hash_value hash; /* Hash of lines in this class. */ + char const *line; /* A line that fits this class. */ + size_t length; /* That line's length, not counting its newline. */ +}; + +/* Hash-table: array of buckets, each being a chain of equivalence classes. + buckets[-1] is reserved for incomplete lines. */ +static lin *buckets; + +/* Number of buckets in the hash table array, not counting buckets[-1]. */ +static size_t nbuckets; + +/* Array in which the equivalence classes are allocated. + The bucket-chains go through the elements in this array. + The number of an equivalence class is its index in this array. */ +static struct equivclass *equivs; + +/* Index of first free element in the array 'equivs'. */ +static lin equivs_index; + +/* Number of elements allocated in the array 'equivs'. */ +static lin equivs_alloc; + +/* Read a block of data into a file buffer, checking for EOF and error. */ + +void +file_block_read (struct file_data *current, size_t size) +{ + if (size && ! current->eof) + { + size_t s = block_read (current->desc, + FILE_BUFFER (current) + current->buffered, size); + if (s == SIZE_MAX) + pfatal_with_name (current->name); + current->buffered += s; + current->eof = s < size; + } +} + +/* Check for binary files and compare them for exact identity. */ + +/* Return 1 if BUF contains a non text character. + SIZE is the number of characters in BUF. */ + +#define binary_file_p(buf, size) (memchr (buf, 0, size) != 0) + +/* Get ready to read the current file. + Return nonzero if SKIP_TEST is zero, + and if it appears to be a binary file. */ + +static bool +sip (struct file_data *current, bool skip_test) +{ + /* If we have a nonexistent file at this stage, treat it as empty. */ + if (current->desc < 0) + { + /* Leave room for a sentinel. */ + current->bufsize = sizeof (word); + current->buffer = xmalloc (current->bufsize); + } + else + { + current->bufsize = buffer_lcm (sizeof (word), + STAT_BLOCKSIZE (current->stat), + PTRDIFF_MAX - 2 * sizeof (word)); + current->buffer = xmalloc (current->bufsize); + +#ifdef __KLIBC__ + /* Skip test if seek is not possible */ + skip_test = skip_test + || (lseek (current->desc, 0, SEEK_CUR) < 0 + && errno == ESPIPE); +#endif + + if (! skip_test) + { + /* Check first part of file to see if it's a binary file. */ + + int prev_mode = set_binary_mode (current->desc, O_BINARY); + off_t buffered; + file_block_read (current, current->bufsize); + buffered = current->buffered; + + if (prev_mode != O_BINARY) + { + /* Revert to text mode and seek back to the start to reread + the file. Use relative seek, since file descriptors + like stdin might not start at offset zero. */ + if (lseek (current->desc, - buffered, SEEK_CUR) < 0) + pfatal_with_name (current->name); + set_binary_mode (current->desc, prev_mode); + current->buffered = 0; + current->eof = false; + } + + return binary_file_p (current->buffer, buffered); + } + } + + current->buffered = 0; + current->eof = false; + return false; +} + +/* Slurp the rest of the current file completely into memory. */ + +static void +slurp (struct file_data *current) +{ + size_t cc; + + if (current->desc < 0) + { + /* The file is nonexistent. */ + return; + } + + if (S_ISREG (current->stat.st_mode)) + { + /* It's a regular file; slurp in the rest all at once. */ + + /* Get the size out of the stat block. + Allocate just enough room for appended newline plus word sentinel, + plus word-alignment since we want the buffer word-aligned. */ + size_t file_size = current->stat.st_size; + cc = file_size + 2 * sizeof (word) - file_size % sizeof (word); + if (file_size != current->stat.st_size || cc < file_size + || PTRDIFF_MAX <= cc) + xalloc_die (); + + if (current->bufsize < cc) + { + current->bufsize = cc; + current->buffer = xrealloc (current->buffer, cc); + } + + /* Try to read at least 1 more byte than the size indicates, to + detect whether the file is growing. This is a nicety for + users who run 'diff' on files while they are changing. */ + + if (current->buffered <= file_size) + { + file_block_read (current, file_size + 1 - current->buffered); + if (current->buffered <= file_size) + return; + } + } + + /* It's not a regular file, or it's a growing regular file; read it, + growing the buffer as needed. */ + + file_block_read (current, current->bufsize - current->buffered); + + if (current->buffered) + { + while (current->buffered == current->bufsize) + { + if (PTRDIFF_MAX / 2 - sizeof (word) < current->bufsize) + xalloc_die (); + current->bufsize *= 2; + current->buffer = xrealloc (current->buffer, current->bufsize); + file_block_read (current, current->bufsize - current->buffered); + } + + /* Allocate just enough room for appended newline plus word + sentinel, plus word-alignment. */ + cc = current->buffered + 2 * sizeof (word); + current->bufsize = cc - cc % sizeof (word); + current->buffer = xrealloc (current->buffer, current->bufsize); + } +} + +/* Split the file into lines, simultaneously computing the equivalence + class for each line. */ + +static void +find_and_hash_each_line (struct file_data *current) +{ + char const *p = current->prefix_end; + lin i, *bucket; + size_t length; + + /* Cache often-used quantities in local variables to help the compiler. */ + char const **linbuf = current->linbuf; + lin alloc_lines = current->alloc_lines; + lin line = 0; + lin linbuf_base = current->linbuf_base; + lin *cureqs = xmalloc (alloc_lines * sizeof *cureqs); + struct equivclass *eqs = equivs; + lin eqs_index = equivs_index; + lin eqs_alloc = equivs_alloc; + char const *suffix_begin = current->suffix_begin; + char const *bufend = FILE_BUFFER (current) + current->buffered; + bool ig_case = ignore_case; + enum DIFF_white_space ig_white_space = ignore_white_space; + bool diff_length_compare_anyway = + ig_white_space != IGNORE_NO_WHITE_SPACE; + bool same_length_diff_contents_compare_anyway = + diff_length_compare_anyway | ig_case; + + while (p < suffix_begin) + { + char const *ip = p; + hash_value h = 0; + unsigned char c; + + /* Hash this line until we find a newline. */ + switch (ig_white_space) + { + case IGNORE_ALL_SPACE: + while ((c = *p++) != '\n') + if (! isspace (c)) + h = HASH (h, ig_case ? tolower (c) : c); + break; + + case IGNORE_SPACE_CHANGE: + while ((c = *p++) != '\n') + { + if (isspace (c)) + { + do + if ((c = *p++) == '\n') + goto hashing_done; + while (isspace (c)); + + h = HASH (h, ' '); + } + + /* C is now the first non-space. */ + h = HASH (h, ig_case ? tolower (c) : c); + } + break; + + case IGNORE_TAB_EXPANSION: + case IGNORE_TAB_EXPANSION_AND_TRAILING_SPACE: + case IGNORE_TRAILING_SPACE: + { + size_t column = 0; + while ((c = *p++) != '\n') + { + if (ig_white_space & IGNORE_TRAILING_SPACE + && isspace (c)) + { + char const *p1 = p; + unsigned char c1; + do + if ((c1 = *p1++) == '\n') + { + p = p1; + goto hashing_done; + } + while (isspace (c1)); + } + + size_t repetitions = 1; + + if (ig_white_space & IGNORE_TAB_EXPANSION) + switch (c) + { + case '\b': + column -= 0 < column; + break; + + case '\t': + c = ' '; + repetitions = tabsize - column % tabsize; + column = (column + repetitions < column + ? 0 + : column + repetitions); + break; + + case '\r': + column = 0; + break; + + default: + column++; + break; + } + + if (ig_case) + c = tolower (c); + + do + h = HASH (h, c); + while (--repetitions != 0); + } + } + break; + + default: + if (ig_case) + while ((c = *p++) != '\n') + h = HASH (h, tolower (c)); + else + while ((c = *p++) != '\n') + h = HASH (h, c); + break; + } + + hashing_done:; + + bucket = &buckets[h % nbuckets]; + length = p - ip - 1; + + if (p == bufend + && current->missing_newline + && ROBUST_OUTPUT_STYLE (output_style)) + { + /* The last line is incomplete and we do not silently + complete lines. If the line cannot compare equal to any + complete line, put it into buckets[-1] so that it can + compare equal only to the other file's incomplete line + (if one exists). */ + if (ig_white_space < IGNORE_TRAILING_SPACE) + bucket = &buckets[-1]; + } + + for (i = *bucket; ; i = eqs[i].next) + if (!i) + { + /* Create a new equivalence class in this bucket. */ + i = eqs_index++; + if (i == eqs_alloc) + { + if (PTRDIFF_MAX / (2 * sizeof *eqs) <= eqs_alloc) + xalloc_die (); + eqs_alloc *= 2; + eqs = xrealloc (eqs, eqs_alloc * sizeof *eqs); + } + eqs[i].next = *bucket; + eqs[i].hash = h; + eqs[i].line = ip; + eqs[i].length = length; + *bucket = i; + break; + } + else if (eqs[i].hash == h) + { + char const *eqline = eqs[i].line; + + /* Reuse existing class if lines_differ reports the lines + equal. */ + if (eqs[i].length == length) + { + /* Reuse existing equivalence class if the lines are identical. + This detects the common case of exact identity + faster than lines_differ would. */ + if (memcmp (eqline, ip, length) == 0) + break; + if (!same_length_diff_contents_compare_anyway) + continue; + } + else if (!diff_length_compare_anyway) + continue; + + if (! lines_differ (eqline, ip)) + break; + } + + /* Maybe increase the size of the line table. */ + if (line == alloc_lines) + { + /* Double (alloc_lines - linbuf_base) by adding to alloc_lines. */ + if (PTRDIFF_MAX / 3 <= alloc_lines + || PTRDIFF_MAX / sizeof *cureqs <= 2 * alloc_lines - linbuf_base + || PTRDIFF_MAX / sizeof *linbuf <= alloc_lines - linbuf_base) + xalloc_die (); + alloc_lines = 2 * alloc_lines - linbuf_base; + cureqs = xrealloc (cureqs, alloc_lines * sizeof *cureqs); + linbuf += linbuf_base; + linbuf = xrealloc (linbuf, + (alloc_lines - linbuf_base) * sizeof *linbuf); + linbuf -= linbuf_base; + } + linbuf[line] = ip; + cureqs[line] = i; + ++line; + } + + current->buffered_lines = line; + + for (i = 0; ; i++) + { + /* Record the line start for lines in the suffix that we care about. + Record one more line start than lines, + so that we can compute the length of any buffered line. */ + if (line == alloc_lines) + { + /* Double (alloc_lines - linbuf_base) by adding to alloc_lines. */ + if (PTRDIFF_MAX / 3 <= alloc_lines + || PTRDIFF_MAX / sizeof *cureqs <= 2 * alloc_lines - linbuf_base + || PTRDIFF_MAX / sizeof *linbuf <= alloc_lines - linbuf_base) + xalloc_die (); + alloc_lines = 2 * alloc_lines - linbuf_base; + linbuf += linbuf_base; + linbuf = xrealloc (linbuf, + (alloc_lines - linbuf_base) * sizeof *linbuf); + linbuf -= linbuf_base; + } + linbuf[line] = p; + + if (p == bufend) + { + /* If the last line is incomplete and we do not silently + complete lines, don't count its appended newline. */ + if (current->missing_newline && ROBUST_OUTPUT_STYLE (output_style)) + linbuf[line]--; + break; + } + + if (context <= i && no_diff_means_no_output) + break; + + line++; + + while (*p++ != '\n') + continue; + } + + /* Done with cache in local variables. */ + current->linbuf = linbuf; + current->valid_lines = line; + current->alloc_lines = alloc_lines; + current->equivs = cureqs; + equivs = eqs; + equivs_alloc = eqs_alloc; + equivs_index = eqs_index; +} + +/* Prepare the text. Make sure the text end is initialized. + Make sure text ends in a newline, + but remember that we had to add one. + Strip trailing CRs, if that was requested. */ + +static void +prepare_text (struct file_data *current) +{ + size_t buffered = current->buffered; + char *p = FILE_BUFFER (current); + + if (buffered == 0 || p[buffered - 1] == '\n') + current->missing_newline = false; + else + { + p[buffered++] = '\n'; + current->missing_newline = true; + } + + if (!p) + return; + + /* Don't use uninitialized storage when planting or using sentinels. */ + memset (p + buffered, 0, sizeof (word)); + + if (strip_trailing_cr) + { + char *dst; + char *srclim = p + buffered; + *srclim = '\r'; + dst = rawmemchr (p, '\r'); + + if (dst != srclim) + { + char const *src = dst; + do + { + *dst = *src++; + dst += ! (*dst == '\r' && *src == '\n'); + } + while (src < srclim); + + buffered -= src - dst; + } + } + + current->buffered = buffered; +} + +/* We have found N lines in a buffer of size S; guess the + proportionate number of lines that will be found in a buffer of + size T. However, do not guess a number of lines so large that the + resulting line table might cause overflow in size calculations. */ +static lin +guess_lines (lin n, size_t s, size_t t) +{ + size_t guessed_bytes_per_line = n < 10 ? 32 : s / (n - 1); + lin guessed_lines = MAX (1, t / guessed_bytes_per_line); + return MIN (guessed_lines, PTRDIFF_MAX / (2 * sizeof (char *) + 1) - 5) + 5; +} + +/* Given a vector of two file_data objects, find the identical + prefixes and suffixes of each object. */ + +static void +find_identical_ends (struct file_data filevec[]) +{ + word *w0, *w1; + char *p0, *p1, *buffer0, *buffer1; + char const *end0, *beg0; + char const **linbuf0, **linbuf1; + lin i, lines; + size_t n0, n1; + lin alloc_lines0, alloc_lines1; + bool prefix_needed; + lin buffered_prefix, prefix_count, prefix_mask; + lin middle_guess, suffix_guess; + + slurp (&filevec[0]); + prepare_text (&filevec[0]); + if (filevec[0].desc != filevec[1].desc) + { + slurp (&filevec[1]); + prepare_text (&filevec[1]); + } + else + { + filevec[1].buffer = filevec[0].buffer; + filevec[1].bufsize = filevec[0].bufsize; + filevec[1].buffered = filevec[0].buffered; + filevec[1].missing_newline = filevec[0].missing_newline; + } + + /* Find identical prefix. */ + + w0 = filevec[0].buffer; + w1 = filevec[1].buffer; + p0 = buffer0 = (char *) w0; + p1 = buffer1 = (char *) w1; + n0 = filevec[0].buffered; + n1 = filevec[1].buffered; + + if (p0 == p1) + /* The buffers are the same; sentinels won't work. */ + p0 = p1 += n1; + else + { + /* Insert end sentinels, in this case characters that are guaranteed + to make the equality test false, and thus terminate the loop. */ + + if (n0 < n1) + p0[n0] = ~p1[n0]; + else + p1[n1] = ~p0[n1]; + + /* Loop until first mismatch, or to the sentinel characters. */ + + /* Compare a word at a time for speed. */ + while (*w0 == *w1) + w0++, w1++; + + /* Do the last few bytes of comparison a byte at a time. */ + p0 = (char *) w0; + p1 = (char *) w1; + while (*p0 == *p1) + p0++, p1++; + + /* Don't mistakenly count missing newline as part of prefix. */ + if (ROBUST_OUTPUT_STYLE (output_style) + && ((buffer0 + n0 - filevec[0].missing_newline < p0) + != + (buffer1 + n1 - filevec[1].missing_newline < p1))) + p0--, p1--; + } + + /* Now P0 and P1 point at the first nonmatching characters. */ + + /* Skip back to last line-beginning in the prefix, + and then discard up to HORIZON_LINES lines from the prefix. */ + i = horizon_lines; + while (p0 != buffer0 && (p0[-1] != '\n' || i--)) + p0--, p1--; + + /* Record the prefix. */ + filevec[0].prefix_end = p0; + filevec[1].prefix_end = p1; + + /* Find identical suffix. */ + + /* P0 and P1 point beyond the last chars not yet compared. */ + p0 = buffer0 + n0; + p1 = buffer1 + n1; + + if (! ROBUST_OUTPUT_STYLE (output_style) + || filevec[0].missing_newline == filevec[1].missing_newline) + { + end0 = p0; /* Addr of last char in file 0. */ + + /* Get value of P0 at which we should stop scanning backward: + this is when either P0 or P1 points just past the last char + of the identical prefix. */ + beg0 = filevec[0].prefix_end + (n0 < n1 ? 0 : n0 - n1); + + /* Scan back until chars don't match or we reach that point. */ + while (p0 != beg0) + if (*--p0 != *--p1) + { + /* Point at the first char of the matching suffix. */ + ++p0, ++p1; + beg0 = p0; + break; + } + + /* Are we at a line-beginning in both files? If not, add the rest of + this line to the main body. Discard up to HORIZON_LINES lines from + the identical suffix. Also, discard one extra line, + because shift_boundaries may need it. */ + i = horizon_lines + !((buffer0 == p0 || p0[-1] == '\n') + && + (buffer1 == p1 || p1[-1] == '\n')); + while (i-- && p0 != end0) + while (*p0++ != '\n') + continue; + + p1 += p0 - beg0; + } + + /* Record the suffix. */ + filevec[0].suffix_begin = p0; + filevec[1].suffix_begin = p1; + + /* Calculate number of lines of prefix to save. + + prefix_count == 0 means save the whole prefix; + we need this for options like -D that output the whole file, + or for enormous contexts (to avoid worrying about arithmetic overflow). + We also need it for options like -F that output some preceding line; + at least we will need to find the last few lines, + but since we don't know how many, it's easiest to find them all. + + Otherwise, prefix_count != 0. Save just prefix_count lines at start + of the line buffer; they'll be moved to the proper location later. + Handle 1 more line than the context says (because we count 1 too many), + rounded up to the next power of 2 to speed index computation. */ + + if (no_diff_means_no_output && ! function_regexp.fastmap + && context < LIN_MAX / 4 && context < n0) + { + middle_guess = guess_lines (0, 0, p0 - filevec[0].prefix_end); + suffix_guess = guess_lines (0, 0, buffer0 + n0 - p0); + for (prefix_count = 1; prefix_count <= context; prefix_count *= 2) + continue; + alloc_lines0 = (prefix_count + middle_guess + + MIN (context, suffix_guess)); + } + else + { + prefix_count = 0; + alloc_lines0 = guess_lines (0, 0, n0); + } + + prefix_mask = prefix_count - 1; + lines = 0; + linbuf0 = xmalloc (alloc_lines0 * sizeof *linbuf0); + prefix_needed = ! (no_diff_means_no_output + && filevec[0].prefix_end == p0 + && filevec[1].prefix_end == p1); + p0 = buffer0; + + /* If the prefix is needed, find the prefix lines. */ + if (prefix_needed) + { + end0 = filevec[0].prefix_end; + while (p0 != end0) + { + lin l = lines++ & prefix_mask; + if (l == alloc_lines0) + { + if (PTRDIFF_MAX / (2 * sizeof *linbuf0) <= alloc_lines0) + xalloc_die (); + alloc_lines0 *= 2; + linbuf0 = xrealloc (linbuf0, alloc_lines0 * sizeof *linbuf0); + } + linbuf0[l] = p0; + while (*p0++ != '\n') + continue; + } + } + buffered_prefix = prefix_count && context < lines ? context : lines; + + /* Allocate line buffer 1. */ + + middle_guess = guess_lines (lines, p0 - buffer0, p1 - filevec[1].prefix_end); + suffix_guess = guess_lines (lines, p0 - buffer0, buffer1 + n1 - p1); + alloc_lines1 = buffered_prefix + middle_guess + MIN (context, suffix_guess); + if (alloc_lines1 < buffered_prefix + || PTRDIFF_MAX / sizeof *linbuf1 <= alloc_lines1) + xalloc_die (); + linbuf1 = xmalloc (alloc_lines1 * sizeof *linbuf1); + + if (buffered_prefix != lines) + { + /* Rotate prefix lines to proper location. */ + for (i = 0; i < buffered_prefix; i++) + linbuf1[i] = linbuf0[(lines - context + i) & prefix_mask]; + for (i = 0; i < buffered_prefix; i++) + linbuf0[i] = linbuf1[i]; + } + + /* Initialize line buffer 1 from line buffer 0. */ + for (i = 0; i < buffered_prefix; i++) + linbuf1[i] = linbuf0[i] - buffer0 + buffer1; + + /* Record the line buffer, adjusted so that + linbuf[0] points at the first differing line. */ + filevec[0].linbuf = linbuf0 + buffered_prefix; + filevec[1].linbuf = linbuf1 + buffered_prefix; + filevec[0].linbuf_base = filevec[1].linbuf_base = - buffered_prefix; + filevec[0].alloc_lines = alloc_lines0 - buffered_prefix; + filevec[1].alloc_lines = alloc_lines1 - buffered_prefix; + filevec[0].prefix_lines = filevec[1].prefix_lines = lines; +} + +/* If 1 < k, then (2**k - prime_offset[k]) is the largest prime less + than 2**k. This table is derived from Chris K. Caldwell's list + <http://www.utm.edu/research/primes/lists/2small/>. */ + +static unsigned char const prime_offset[] = +{ + 0, 0, 1, 1, 3, 1, 3, 1, 5, 3, 3, 9, 3, 1, 3, 19, 15, 1, 5, 1, 3, 9, 3, + 15, 3, 39, 5, 39, 57, 3, 35, 1, 5, 9, 41, 31, 5, 25, 45, 7, 87, 21, + 11, 57, 17, 55, 21, 115, 59, 81, 27, 129, 47, 111, 33, 55, 5, 13, 27, + 55, 93, 1, 57, 25 +}; + +/* Verify that this host's size_t is not too wide for the above table. */ + +verify (sizeof (size_t) * CHAR_BIT <= sizeof prime_offset); + +/* Given a vector of two file_data objects, read the file associated + with each one, and build the table of equivalence classes. + Return nonzero if either file appears to be a binary file. + If PRETEND_BINARY is nonzero, pretend they are binary regardless. */ + +bool +read_files (struct file_data filevec[], bool pretend_binary) +{ + int i; + bool skip_test = text | pretend_binary; + bool appears_binary = pretend_binary | sip (&filevec[0], skip_test); + + if (filevec[0].desc != filevec[1].desc) + appears_binary |= sip (&filevec[1], skip_test | appears_binary); + else + { + filevec[1].buffer = filevec[0].buffer; + filevec[1].bufsize = filevec[0].bufsize; + filevec[1].buffered = filevec[0].buffered; + } + if (appears_binary) + { + set_binary_mode (filevec[0].desc, O_BINARY); + set_binary_mode (filevec[1].desc, O_BINARY); + return true; + } + + find_identical_ends (filevec); + + equivs_alloc = filevec[0].alloc_lines + filevec[1].alloc_lines + 1; + if (PTRDIFF_MAX / sizeof *equivs <= equivs_alloc) + xalloc_die (); + equivs = xmalloc (equivs_alloc * sizeof *equivs); + /* Equivalence class 0 is permanently safe for lines that were not + hashed. Real equivalence classes start at 1. */ + equivs_index = 1; + + /* Allocate (one plus) a prime number of hash buckets. Use a prime + number between 1/3 and 2/3 of the value of equiv_allocs, + approximately. */ + for (i = 9; (size_t) 1 << i < equivs_alloc / 3; i++) + continue; + nbuckets = ((size_t) 1 << i) - prime_offset[i]; + if (PTRDIFF_MAX / sizeof *buckets <= nbuckets) + xalloc_die (); + buckets = zalloc ((nbuckets + 1) * sizeof *buckets); + buckets++; + + for (i = 0; i < 2; i++) + find_and_hash_each_line (&filevec[i]); + + filevec[0].equiv_max = filevec[1].equiv_max = equivs_index; + + free (equivs); + free (buckets - 1); + + return false; +} diff --git a/local/recipes/tools/diffutils/source/src/normal.c b/local/recipes/tools/diffutils/source/src/normal.c new file mode 100644 index 0000000000..0f809daf6d --- /dev/null +++ b/local/recipes/tools/diffutils/source/src/normal.c @@ -0,0 +1,91 @@ +/* Normal-format output routines for GNU DIFF. + + Copyright (C) 1988-1989, 1993, 1995, 1998, 2001, 2006, 2009-2013, 2015-2017 + Free Software Foundation, Inc. + + This file is part of GNU DIFF. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include "diff.h" + +static void print_normal_hunk (struct change *); + +/* Print the edit-script SCRIPT as a normal diff. + INF points to an array of descriptions of the two files. */ + +void +print_normal_script (struct change *script) +{ + print_script (script, find_change, print_normal_hunk); +} + +/* Print a hunk of a normal diff. + This is a contiguous portion of a complete edit script, + describing changes in consecutive lines. */ + +static void +print_normal_hunk (struct change *hunk) +{ + lin first0, last0, first1, last1; + register lin i; + + /* Determine range of line numbers involved in each file. */ + enum changes changes = analyze_hunk (hunk, &first0, &last0, &first1, &last1); + if (!changes) + return; + + begin_output (); + + /* Print out the line number header for this hunk */ + set_color_context (LINE_NUMBER_CONTEXT); + print_number_range (',', &files[0], first0, last0); + fputc (change_letter[changes], outfile); + print_number_range (',', &files[1], first1, last1); + set_color_context (RESET_CONTEXT); + fputc ('\n', outfile); + + /* Print the lines that the first file has. */ + if (changes & OLD) + { + if (first0 <= last0) + set_color_context (DELETE_CONTEXT); + for (i = first0; i <= last0; i++) + { + print_1_line_nl ("<", &files[0].linbuf[i], true); + if (i == last0) + set_color_context (RESET_CONTEXT); + if (files[0].linbuf[i + 1][-1] == '\n') + putc ('\n', outfile); + } + } + + if (changes == CHANGED) + fputs ("---\n", outfile); + + /* Print the lines that the second file has. */ + if (changes & NEW) + { + if (first1 <= last1) + set_color_context (ADD_CONTEXT); + for (i = first1; i <= last1; i++) + { + print_1_line_nl (">", &files[1].linbuf[i], true); + if (i == last1) + set_color_context (RESET_CONTEXT); + if (files[1].linbuf[i + 1][-1] == '\n') + putc ('\n', outfile); + } + } +} diff --git a/local/recipes/tools/diffutils/source/src/sdiff.c b/local/recipes/tools/diffutils/source/src/sdiff.c new file mode 100644 index 0000000000..1ae3dcb1b5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/src/sdiff.c @@ -0,0 +1,1173 @@ +/* sdiff - side-by-side merge of file differences + + Copyright (C) 1992-1996, 1998, 2001-2002, 2004, 2006-2007, 2009-2013, + 2015-2017 Free Software Foundation, Inc. + + This file is part of GNU DIFF. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include "system.h" +#include "paths.h" + +#include <stdio.h> +#include <unlocked-io.h> + +#include <c-stack.h> +#include <dirname.h> +#include "die.h" +#include <error.h> +#include <exitfail.h> +#include <file-type.h> +#include <getopt.h> +#include <progname.h> +#include <system-quote.h> +#include <version-etc.h> +#include <xalloc.h> + +/* The official name of this program (e.g., no 'g' prefix). */ +#define PROGRAM_NAME "sdiff" + +#define AUTHORS \ + proper_name ("Thomas Lord") + +/* Size of chunks read from files which must be parsed into lines. */ +#define SDIFF_BUFSIZE ((size_t) 65536) + +static char const *editor_program = DEFAULT_EDITOR_PROGRAM; +static char const **diffargv; + +static char * volatile tmpname; +static FILE *tmp; + +#if HAVE_WORKING_FORK +static pid_t volatile diffpid; +#endif + +struct line_filter; + +static void catchsig (int); +static bool edit (struct line_filter *, char const *, lin, lin, struct line_filter *, char const *, lin, lin, FILE *); +static bool interact (struct line_filter *, struct line_filter *, char const *, struct line_filter *, char const *, FILE *); +static void checksigs (void); +static void diffarg (char const *); +static void fatal (char const *) __attribute__((noreturn)); +static void perror_fatal (char const *) __attribute__((noreturn)); +static void trapsigs (void); +static void untrapsig (int); + +static int const sigs[] = { +#ifdef SIGHUP + SIGHUP, +#endif +#ifdef SIGQUIT + SIGQUIT, +#endif +#ifdef SIGTERM + SIGTERM, +#endif +#ifdef SIGXCPU + SIGXCPU, +#endif +#ifdef SIGXFSZ + SIGXFSZ, +#endif +#ifdef SIGPIPE + SIGPIPE, +#endif + SIGINT +}; +enum + { + NUM_SIGS = sizeof sigs / sizeof *sigs, + handler_index_of_SIGINT = NUM_SIGS - 1 + }; + +#if HAVE_SIGACTION + /* Prefer 'sigaction' if available, since 'signal' can lose signals. */ + static struct sigaction initial_action[NUM_SIGS]; +# define initial_handler(i) (initial_action[i].sa_handler) + static void signal_handler (int, void (*) (int)); +#else + static void (*initial_action[NUM_SIGS]) (); +# define initial_handler(i) (initial_action[i]) +# define signal_handler(sig, handler) signal (sig, handler) +#endif + +static bool diraccess (char const *); +static int temporary_file (void); + +/* Options: */ + +/* Name of output file if -o specified. */ +static char const *output; + +/* Do not print common lines. */ +static bool suppress_common_lines; + +/* Value for the long option that does not have single-letter equivalents. */ +enum +{ + DIFF_PROGRAM_OPTION = CHAR_MAX + 1, + HELP_OPTION, + STRIP_TRAILING_CR_OPTION, + TABSIZE_OPTION +}; + +static struct option const longopts[] = +{ + {"diff-program", 1, 0, DIFF_PROGRAM_OPTION}, + {"expand-tabs", 0, 0, 't'}, + {"help", 0, 0, HELP_OPTION}, + {"ignore-all-space", 0, 0, 'W'}, /* swap W and w for historical reasons */ + {"ignore-blank-lines", 0, 0, 'B'}, + {"ignore-case", 0, 0, 'i'}, + {"ignore-matching-lines", 1, 0, 'I'}, + {"ignore-space-change", 0, 0, 'b'}, + {"ignore-tab-expansion", 0, 0, 'E'}, + {"ignore-trailing-space", 0, 0, 'Z'}, + {"left-column", 0, 0, 'l'}, + {"minimal", 0, 0, 'd'}, + {"output", 1, 0, 'o'}, + {"speed-large-files", 0, 0, 'H'}, + {"strip-trailing-cr", 0, 0, STRIP_TRAILING_CR_OPTION}, + {"suppress-common-lines", 0, 0, 's'}, + {"tabsize", 1, 0, TABSIZE_OPTION}, + {"text", 0, 0, 'a'}, + {"version", 0, 0, 'v'}, + {"width", 1, 0, 'w'}, + {0, 0, 0, 0} +}; + +static void try_help (char const *, char const *) __attribute__((noreturn)); +static void +try_help (char const *reason_msgid, char const *operand) +{ + if (reason_msgid) + error (0, 0, _(reason_msgid), operand); + die (EXIT_TROUBLE, 0, _("Try '%s --help' for more information."), + program_name); +} + +static void +check_stdout (void) +{ + if (ferror (stdout)) + fatal ("write failed"); + else if (fclose (stdout) != 0) + perror_fatal (_("standard output")); +} + +static char const * const option_help_msgid[] = { + N_("-o, --output=FILE operate interactively, sending output to FILE"), + "", + N_("-i, --ignore-case consider upper- and lower-case to be the same"), + N_("-E, --ignore-tab-expansion ignore changes due to tab expansion"), + N_("-Z, --ignore-trailing-space ignore white space at line end"), + N_("-b, --ignore-space-change ignore changes in the amount of white space"), + N_("-W, --ignore-all-space ignore all white space"), + N_("-B, --ignore-blank-lines ignore changes whose lines are all blank"), + N_("-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"), + N_(" --strip-trailing-cr strip trailing carriage return on input"), + N_("-a, --text treat all files as text"), + "", + N_("-w, --width=NUM output at most NUM (default 130) print columns"), + N_("-l, --left-column output only the left column of common lines"), + N_("-s, --suppress-common-lines do not output common lines"), + "", + N_("-t, --expand-tabs expand tabs to spaces in output"), + N_(" --tabsize=NUM tab stops at every NUM (default 8) print columns"), + "", + N_("-d, --minimal try hard to find a smaller set of changes"), + N_("-H, --speed-large-files assume large files, many scattered small changes"), + N_(" --diff-program=PROGRAM use PROGRAM to compare files"), + "", + N_(" --help display this help and exit"), + N_("-v, --version output version information and exit"), + 0 +}; + +static void +usage (void) +{ + char const * const *p; + + printf (_("Usage: %s [OPTION]... FILE1 FILE2\n"), program_name); + printf ("%s\n\n", + _("Side-by-side merge of differences between FILE1 and FILE2.")); + + fputs (_("\ +Mandatory arguments to long options are mandatory for short options too.\n\ +"), stdout); + for (p = option_help_msgid; *p; p++) + if (**p) + printf (" %s\n", _(*p)); + else + putchar ('\n'); + printf ("\n%s\n%s\n", + _("If a FILE is '-', read standard input."), + _("Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.")); + emit_bug_reporting_address (); +} + +/* Clean up after a signal or other failure. This function is + async-signal-safe. */ +static void +cleanup (int signo __attribute__((unused))) +{ +#if HAVE_WORKING_FORK + if (0 < diffpid) + kill (diffpid, SIGPIPE); +#endif + if (tmpname) + unlink (tmpname); +} + +static void exiterr (void) __attribute__((noreturn)); +static void +exiterr (void) +{ + cleanup (0); + untrapsig (0); + checksigs (); + exit (EXIT_TROUBLE); +} + +static void +fatal (char const *msgid) +{ + error (0, 0, "%s", _(msgid)); + exiterr (); +} + +static void +perror_fatal (char const *msg) +{ + int e = errno; + checksigs (); + error (0, e, "%s", msg); + exiterr (); +} + +static void +check_child_status (int werrno, int wstatus, int max_ok_status, + char const *subsidiary_program) +{ + int status = (! werrno && WIFEXITED (wstatus) + ? WEXITSTATUS (wstatus) + : INT_MAX); + + if (max_ok_status < status) + { + error (0, werrno, + _(status == 126 + ? "subsidiary program '%s' could not be invoked" + : status == 127 + ? "subsidiary program '%s' not found" + : status == INT_MAX + ? "subsidiary program '%s' failed" + : "subsidiary program '%s' failed (exit status %d)"), + subsidiary_program, status); + exiterr (); + } +} + +static FILE * +ck_fopen (char const *fname, char const *type) +{ + FILE *r = fopen (fname, type); + if (! r) + perror_fatal (fname); + return r; +} + +static void +ck_fclose (FILE *f) +{ + if (fclose (f)) + perror_fatal ("fclose"); +} + +static size_t +ck_fread (char *buf, size_t size, FILE *f) +{ + size_t r = fread (buf, sizeof (char), size, f); + if (r == 0 && ferror (f)) + perror_fatal (_("read failed")); + return r; +} + +static void +ck_fwrite (char const *buf, size_t size, FILE *f) +{ + if (fwrite (buf, sizeof (char), size, f) != size) + perror_fatal (_("write failed")); +} + +static void +ck_fflush (FILE *f) +{ + if (fflush (f) != 0) + perror_fatal (_("write failed")); +} + +static char const * +expand_name (char *name, bool is_dir, char const *other_name) +{ + if (STREQ (name, "-")) + fatal ("cannot interactively merge standard input"); + if (! is_dir) + return name; + else + { + /* Yield NAME/BASE, where BASE is OTHER_NAME's basename. */ + char const *base = last_component (other_name); + size_t namelen = strlen (name), baselen = base_len (base); + bool insert_slash = *last_component (name) && name[namelen - 1] != '/'; + char *r = xmalloc (namelen + insert_slash + baselen + 1); + memcpy (r, name, namelen); + r[namelen] = '/'; + memcpy (r + namelen + insert_slash, base, baselen); + r[namelen + insert_slash + baselen] = '\0'; + return r; + } +} + +struct line_filter { + FILE *infile; + char *bufpos; + char *buffer; + char *buflim; +}; + +static void +lf_init (struct line_filter *lf, FILE *infile) +{ + lf->infile = infile; + lf->bufpos = lf->buffer = lf->buflim = xmalloc (SDIFF_BUFSIZE + 1); + lf->buflim[0] = '\n'; +} + +/* Fill an exhausted line_filter buffer from its INFILE */ +static size_t +lf_refill (struct line_filter *lf) +{ + size_t s = ck_fread (lf->buffer, SDIFF_BUFSIZE, lf->infile); + lf->bufpos = lf->buffer; + lf->buflim = lf->buffer + s; + lf->buflim[0] = '\n'; + checksigs (); + return s; +} + +/* Advance LINES on LF's infile, copying lines to OUTFILE */ +static void +lf_copy (struct line_filter *lf, lin lines, FILE *outfile) +{ + char *start = lf->bufpos; + + while (lines) + { + lf->bufpos = rawmemchr (lf->bufpos, '\n'); + if (lf->bufpos == lf->buflim) + { + ck_fwrite (start, lf->buflim - start, outfile); + if (! lf_refill (lf)) + return; + start = lf->bufpos; + } + else + { + --lines; + ++lf->bufpos; + } + } + + ck_fwrite (start, lf->bufpos - start, outfile); +} + +/* Advance LINES on LF's infile without doing output */ +static void +lf_skip (struct line_filter *lf, lin lines) +{ + while (lines) + { + lf->bufpos = rawmemchr (lf->bufpos, '\n'); + if (lf->bufpos == lf->buflim) + { + if (! lf_refill (lf)) + break; + } + else + { + --lines; + ++lf->bufpos; + } + } +} + +/* Snarf a line into a buffer. Return EOF if EOF, 0 if error, 1 if OK. */ +static int +lf_snarf (struct line_filter *lf, char *buffer, size_t bufsize) +{ + for (;;) + { + char *start = lf->bufpos; + char *next = rawmemchr (start, '\n'); + size_t s = next - start; + if (bufsize <= s) + return 0; + memcpy (buffer, start, s); + if (next < lf->buflim) + { + buffer[s] = 0; + lf->bufpos = next + 1; + return 1; + } + if (! lf_refill (lf)) + return s ? 0 : EOF; + buffer += s; + bufsize -= s; + } +} + +int +main (int argc, char *argv[]) +{ + int opt; + char const *prog; + + exit_failure = EXIT_TROUBLE; + initialize_main (&argc, &argv); + set_program_name (argv[0]); + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + c_stack_action (cleanup); + + prog = getenv ("EDITOR"); + if (prog) + editor_program = prog; + + diffarg (DEFAULT_DIFF_PROGRAM); + + /* parse command line args */ + while ((opt = getopt_long (argc, argv, "abBdEHiI:lo:stvw:WZ", longopts, 0)) + != -1) + { + switch (opt) + { + case 'a': + diffarg ("-a"); + break; + + case 'b': + diffarg ("-b"); + break; + + case 'B': + diffarg ("-B"); + break; + + case 'd': + diffarg ("-d"); + break; + + case 'E': + diffarg ("-E"); + break; + + case 'H': + diffarg ("-H"); + break; + + case 'i': + diffarg ("-i"); + break; + + case 'I': + diffarg ("-I"); + diffarg (optarg); + break; + + case 'l': + diffarg ("--left-column"); + break; + + case 'o': + output = optarg; + break; + + case 's': + suppress_common_lines = true; + break; + + case 't': + diffarg ("-t"); + break; + + case 'v': + version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version, + AUTHORS, (char *) NULL); + check_stdout (); + return EXIT_SUCCESS; + + case 'w': + diffarg ("-W"); + diffarg (optarg); + break; + + case 'W': + diffarg ("-w"); + break; + + case 'Z': + diffarg ("-Z"); + break; + + case DIFF_PROGRAM_OPTION: + diffargv[0] = optarg; + break; + + case HELP_OPTION: + usage (); + check_stdout (); + return EXIT_SUCCESS; + + case STRIP_TRAILING_CR_OPTION: + diffarg ("--strip-trailing-cr"); + break; + + case TABSIZE_OPTION: + diffarg ("--tabsize"); + diffarg (optarg); + break; + + default: + try_help (0, 0); + } + } + + if (argc - optind != 2) + { + if (argc - optind < 2) + try_help ("missing operand after '%s'", argv[argc - 1]); + else + try_help ("extra operand '%s'", argv[optind + 2]); + } + + if (! output) + { + /* easy case: diff does everything for us */ + if (suppress_common_lines) + diffarg ("--suppress-common-lines"); + diffarg ("-y"); + diffarg ("--"); + diffarg (argv[optind]); + diffarg (argv[optind + 1]); + diffarg (0); + execvp (diffargv[0], (char **) diffargv); + perror_fatal (diffargv[0]); + } + else + { + char const *lname, *rname; + FILE *left, *right, *out, *diffout; + bool interact_ok; + struct line_filter lfilt; + struct line_filter rfilt; + struct line_filter diff_filt; + bool leftdir = diraccess (argv[optind]); + bool rightdir = diraccess (argv[optind + 1]); + + if (leftdir & rightdir) + fatal ("both files to be compared are directories"); + + lname = expand_name (argv[optind], leftdir, argv[optind + 1]); + left = ck_fopen (lname, "r"); + rname = expand_name (argv[optind + 1], rightdir, argv[optind]); + right = ck_fopen (rname, "r"); + out = ck_fopen (output, "w"); + + diffarg ("--sdiff-merge-assist"); + diffarg ("--"); + diffarg (argv[optind]); + diffarg (argv[optind + 1]); + diffarg (0); + + trapsigs (); + +#if ! HAVE_WORKING_FORK + { + char *command = system_quote_argv (SCI_SYSTEM, (char **) diffargv); + errno = 0; + diffout = popen (command, "r"); + if (! diffout) + perror_fatal (command); + free (command); + } +#else + { + int diff_fds[2]; + + if (pipe (diff_fds) != 0) + perror_fatal ("pipe"); + + diffpid = fork (); + if (diffpid < 0) + perror_fatal ("fork"); + if (! diffpid) + { + /* Alter the child's SIGINT and SIGPIPE handlers; + this may munge the parent. + The child ignores SIGINT in case the user interrupts the editor. + The child does not ignore SIGPIPE, even if the parent does. */ + if (initial_handler (handler_index_of_SIGINT) != SIG_IGN) + signal_handler (SIGINT, SIG_IGN); + signal_handler (SIGPIPE, SIG_DFL); + close (diff_fds[0]); + if (diff_fds[1] != STDOUT_FILENO) + { + dup2 (diff_fds[1], STDOUT_FILENO); + close (diff_fds[1]); + } + + execvp (diffargv[0], (char **) diffargv); + _exit (errno == ENOENT ? 127 : 126); + } + + close (diff_fds[1]); + diffout = fdopen (diff_fds[0], "r"); + if (! diffout) + perror_fatal ("fdopen"); + } +#endif + + lf_init (&diff_filt, diffout); + lf_init (&lfilt, left); + lf_init (&rfilt, right); + + interact_ok = interact (&diff_filt, &lfilt, lname, &rfilt, rname, out); + + ck_fclose (left); + ck_fclose (right); + ck_fclose (out); + + { + int wstatus; + int werrno = 0; + +#if ! HAVE_WORKING_FORK + wstatus = pclose (diffout); + if (wstatus == -1) + werrno = errno; +#else + ck_fclose (diffout); + while (waitpid (diffpid, &wstatus, 0) < 0) + if (errno == EINTR) + checksigs (); + else + perror_fatal ("waitpid"); + diffpid = 0; +#endif + + if (tmpname) + { + unlink (tmpname); + tmpname = 0; + } + + if (! interact_ok) + exiterr (); + + check_child_status (werrno, wstatus, EXIT_FAILURE, diffargv[0]); + untrapsig (0); + checksigs (); + exit (WEXITSTATUS (wstatus)); + } + } + return EXIT_SUCCESS; /* Fool '-Wall'. */ +} + +static void +diffarg (char const *a) +{ + static size_t diffargs, diffarglim; + + if (diffargs == diffarglim) + { + if (! diffarglim) + diffarglim = 16; + else if (PTRDIFF_MAX / (2 * sizeof *diffargv) <= diffarglim) + xalloc_die (); + else + diffarglim *= 2; + diffargv = xrealloc (diffargv, diffarglim * sizeof *diffargv); + } + diffargv[diffargs++] = a; +} + +/* Signal handling */ + +static bool volatile ignore_SIGINT; +static int volatile signal_received; +static bool sigs_trapped; + +static void +catchsig (int s) +{ +#if ! HAVE_SIGACTION + signal (s, SIG_IGN); +#endif + if (! (s == SIGINT && ignore_SIGINT)) + signal_received = s; +} + +#if HAVE_SIGACTION +static struct sigaction catchaction; + +static void +signal_handler (int sig, void (*handler) (int)) +{ + catchaction.sa_handler = handler; + sigaction (sig, &catchaction, 0); +} +#endif + +static void +trapsigs (void) +{ + int i; + +#if HAVE_SIGACTION + catchaction.sa_flags = SA_RESTART; + sigemptyset (&catchaction.sa_mask); + for (i = 0; i < NUM_SIGS; i++) + sigaddset (&catchaction.sa_mask, sigs[i]); +#endif + + for (i = 0; i < NUM_SIGS; i++) + { +#if HAVE_SIGACTION + sigaction (sigs[i], 0, &initial_action[i]); +#else + initial_action[i] = signal (sigs[i], SIG_IGN); +#endif + if (initial_handler (i) != SIG_IGN) + signal_handler (sigs[i], catchsig); + } + +#ifdef SIGCHLD + /* System V fork+wait does not work if SIGCHLD is ignored. */ + signal (SIGCHLD, SIG_DFL); +#endif + + sigs_trapped = true; +} + +/* Untrap signal S, or all trapped signals if S is zero. */ +static void +untrapsig (int s) +{ + int i; + + if (sigs_trapped) + for (i = 0; i < NUM_SIGS; i++) + if ((! s || sigs[i] == s) && initial_handler (i) != SIG_IGN) + { +#if HAVE_SIGACTION + sigaction (sigs[i], &initial_action[i], 0); +#else + signal (sigs[i], initial_action[i]); +#endif + } +} + +/* Exit if a signal has been received. */ +static void +checksigs (void) +{ + int s = signal_received; + if (s) + { + cleanup (0); + + /* Yield an exit status indicating that a signal was received. */ + untrapsig (s); + kill (getpid (), s); + + /* That didn't work, so exit with error status. */ + exit (EXIT_TROUBLE); + } +} + +static void +give_help (void) +{ + fprintf (stderr, "%s", _("\ +ed:\tEdit then use both versions, each decorated with a header.\n\ +eb:\tEdit then use both versions.\n\ +el or e1:\tEdit then use the left version.\n\ +er or e2:\tEdit then use the right version.\n\ +e:\tDiscard both versions then edit a new one.\n\ +l or 1:\tUse the left version.\n\ +r or 2:\tUse the right version.\n\ +s:\tSilently include common lines.\n\ +v:\tVerbosely include common lines.\n\ +q:\tQuit.\n\ +")); +} + +static int +skip_white (void) +{ + int c; + for (;;) + { + c = getchar (); + if (! isspace (c) || c == '\n') + break; + checksigs (); + } + if (ferror (stdin)) + perror_fatal (_("read failed")); + return c; +} + +static void +flush_line (void) +{ + int c; + while ((c = getchar ()) != '\n' && c != EOF) + continue; + if (ferror (stdin)) + perror_fatal (_("read failed")); +} + + +/* interpret an edit command */ +static bool +edit (struct line_filter *left, char const *lname, lin lline, lin llen, + struct line_filter *right, char const *rname, lin rline, lin rlen, + FILE *outfile) +{ + for (;;) + { + int cmd0 IF_LINT (= 0); + int cmd1 IF_LINT (= 0); + bool gotcmd = false; + + while (! gotcmd) + { + if (putchar ('%') != '%') + perror_fatal (_("write failed")); + ck_fflush (stdout); + + cmd0 = skip_white (); + switch (cmd0) + { + case '1': case '2': case 'l': case 'r': + case 's': case 'v': case 'q': + if (skip_white () != '\n') + { + give_help (); + flush_line (); + continue; + } + gotcmd = true; + break; + + case 'e': + cmd1 = skip_white (); + switch (cmd1) + { + case '1': case '2': case 'b': case 'd': case 'l': case 'r': + if (skip_white () != '\n') + { + give_help (); + flush_line (); + continue; + } + gotcmd = true; + break; + case '\n': + gotcmd = true; + break; + default: + give_help (); + flush_line (); + continue; + } + break; + + case EOF: + if (feof (stdin)) + { + gotcmd = true; + cmd0 = 'q'; + break; + } + FALLTHROUGH; + default: + flush_line (); + FALLTHROUGH; + case '\n': + give_help (); + continue; + } + } + + switch (cmd0) + { + case '1': case 'l': + lf_copy (left, llen, outfile); + lf_skip (right, rlen); + return true; + case '2': case 'r': + lf_copy (right, rlen, outfile); + lf_skip (left, llen); + return true; + case 's': + suppress_common_lines = true; + break; + case 'v': + suppress_common_lines = false; + break; + case 'q': + return false; + case 'e': + { + int fd; + + if (tmpname) + tmp = fopen (tmpname, "w"); + else + { + if ((fd = temporary_file ()) < 0) + perror_fatal ("mkstemp"); + tmp = fdopen (fd, "w"); + } + + if (! tmp) + perror_fatal (tmpname); + + switch (cmd1) + { + case 'd': + if (llen) + { + printint l1 = lline; + printint l2 = lline + llen - 1; + if (llen == 1) + fprintf (tmp, "--- %s %"pI"d\n", lname, l1); + else + fprintf (tmp, "--- %s %"pI"d,%"pI"d\n", lname, l1, l2); + } + FALLTHROUGH; + case '1': case 'b': case 'l': + lf_copy (left, llen, tmp); + break; + + default: + lf_skip (left, llen); + break; + } + + switch (cmd1) + { + case 'd': + if (rlen) + { + printint l1 = rline; + printint l2 = rline + rlen - 1; + if (rlen == 1) + fprintf (tmp, "+++ %s %"pI"d\n", rname, l1); + else + fprintf (tmp, "+++ %s %"pI"d,%"pI"d\n", rname, l1, l2); + } + FALLTHROUGH; + case '2': case 'b': case 'r': + lf_copy (right, rlen, tmp); + break; + + default: + lf_skip (right, rlen); + break; + } + + ck_fclose (tmp); + + { + int wstatus; + int werrno = 0; + char const *argv[3]; + + ignore_SIGINT = true; + checksigs (); + argv[0] = editor_program; + argv[1] = tmpname; + argv[2] = 0; + + { +#if ! HAVE_WORKING_FORK + char *command = system_quote_argv (SCI_SYSTEM, (char **) argv); + wstatus = system (command); + if (wstatus == -1) + werrno = errno; + free (command); +#else + pid_t pid; + + pid = fork (); + if (pid == 0) + { + execvp (editor_program, (char **) argv); + _exit (errno == ENOENT ? 127 : 126); + } + + if (pid < 0) + perror_fatal ("fork"); + + while (waitpid (pid, &wstatus, 0) < 0) + if (errno == EINTR) + checksigs (); + else + perror_fatal ("waitpid"); +#endif + } + + ignore_SIGINT = false; + check_child_status (werrno, wstatus, EXIT_SUCCESS, + editor_program); + } + + { + char buf[SDIFF_BUFSIZE]; + size_t size; + tmp = ck_fopen (tmpname, "r"); + while ((size = ck_fread (buf, SDIFF_BUFSIZE, tmp)) != 0) + { + checksigs (); + ck_fwrite (buf, size, outfile); + } + ck_fclose (tmp); + } + return true; + } + default: + give_help (); + break; + } + } +} + +/* Alternately reveal bursts of diff output and handle user commands. */ +static bool +interact (struct line_filter *diff, + struct line_filter *left, char const *lname, + struct line_filter *right, char const *rname, + FILE *outfile) +{ + lin lline = 1, rline = 1; + + for (;;) + { + char diff_help[256]; + int snarfed = lf_snarf (diff, diff_help, sizeof diff_help); + + if (snarfed <= 0) + return snarfed != 0; + + checksigs (); + + if (diff_help[0] == ' ') + puts (diff_help + 1); + else + { + char *numend; + uintmax_t val; + lin llen, rlen, lenmax; + errno = 0; + val = strtoumax (diff_help + 1, &numend, 10); + if (LIN_MAX < val || errno || *numend != ',') + fatal (diff_help); + llen = val; + val = strtoumax (numend + 1, &numend, 10); + if (LIN_MAX < val || errno || *numend) + fatal (diff_help); + rlen = val; + + lenmax = MAX (llen, rlen); + + switch (diff_help[0]) + { + case 'i': + if (suppress_common_lines) + lf_skip (diff, lenmax); + else + lf_copy (diff, lenmax, stdout); + + lf_copy (left, llen, outfile); + lf_skip (right, rlen); + break; + + case 'c': + lf_copy (diff, lenmax, stdout); + if (! edit (left, lname, lline, llen, + right, rname, rline, rlen, + outfile)) + return false; + break; + + default: + fatal (diff_help); + } + + lline += llen; + rline += rlen; + } + } +} + +/* Return true if DIR is an existing directory. */ +static bool +diraccess (char const *dir) +{ + struct stat buf; + return stat (dir, &buf) == 0 && S_ISDIR (buf.st_mode); +} + +#ifndef P_tmpdir +# define P_tmpdir "/tmp" +#endif +#ifndef TMPDIR_ENV +# define TMPDIR_ENV "TMPDIR" +#endif + +/* Open a temporary file and return its file descriptor. Put into + tmpname the address of a newly allocated buffer that holds the + file's name. Use the prefix "sdiff". */ +static int +temporary_file (void) +{ + char const *tmpdir = getenv (TMPDIR_ENV); + char const *dir = tmpdir ? tmpdir : P_tmpdir; + char *buf = xmalloc (strlen (dir) + 1 + 5 + 6 + 1); + int fd; + sprintf (buf, "%s/sdiffXXXXXX", dir); + fd = mkstemp (buf); + if (0 <= fd) + tmpname = buf; + return fd; +} diff --git a/local/recipes/tools/diffutils/source/src/side.c b/local/recipes/tools/diffutils/source/src/side.c new file mode 100644 index 0000000000..7f902da352 --- /dev/null +++ b/local/recipes/tools/diffutils/source/src/side.c @@ -0,0 +1,335 @@ +/* sdiff-format output routines for GNU DIFF. + + Copyright (C) 1991-1993, 1998, 2001-2002, 2004, 2009-2013, 2015-2017 Free + Software Foundation, Inc. + + This file is part of GNU DIFF. + + GNU DIFF is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. No author or distributor + accepts responsibility to anyone for the consequences of using it + or for whether it serves any particular purpose or works at all, + unless he says so in writing. Refer to the GNU General Public + License for full details. + + Everyone is granted permission to copy, modify and redistribute + GNU DIFF, but only under the conditions described in the + GNU General Public License. A copy of this license is + supposed to have been given to you along with GNU DIFF so you + can know your rights and responsibilities. It should be in a + file named COPYING. Among other things, the copyright notice + and this notice must be preserved on all copies. */ + +#include "diff.h" + +#include <wchar.h> + +static void print_sdiff_common_lines (lin, lin); +static void print_sdiff_hunk (struct change *); + +/* Next line number to be printed in the two input files. */ +static lin next0, next1; + +/* Print the edit-script SCRIPT as a sdiff style output. */ + +void +print_sdiff_script (struct change *script) +{ + begin_output (); + + next0 = next1 = - files[0].prefix_lines; + print_script (script, find_change, print_sdiff_hunk); + + print_sdiff_common_lines (files[0].valid_lines, files[1].valid_lines); +} + +/* Tab from column FROM to column TO, where FROM <= TO. Yield TO. */ + +static size_t +tab_from_to (size_t from, size_t to) +{ + FILE *out = outfile; + size_t tab; + size_t tab_size = tabsize; + + if (!expand_tabs) + for (tab = from + tab_size - from % tab_size; tab <= to; tab += tab_size) + { + putc ('\t', out); + from = tab; + } + while (from++ < to) + putc (' ', out); + return to; +} + +/* Print the text for half an sdiff line. This means truncate to + width observing tabs, and trim a trailing newline. Return the + last column written (not the number of chars). */ + +static size_t +print_half_line (char const *const *line, size_t indent, size_t out_bound) +{ + FILE *out = outfile; + register size_t in_position = 0; + register size_t out_position = 0; + register char const *text_pointer = line[0]; + register char const *text_limit = line[1]; + mbstate_t mbstate = { 0 }; + + while (text_pointer < text_limit) + { + char const *tp0 = text_pointer; + register char c = *text_pointer++; + + switch (c) + { + case '\t': + { + size_t spaces = tabsize - in_position % tabsize; + if (in_position == out_position) + { + size_t tabstop = out_position + spaces; + if (expand_tabs) + { + if (out_bound < tabstop) + tabstop = out_bound; + for (; out_position < tabstop; out_position++) + putc (' ', out); + } + else + if (tabstop < out_bound) + { + out_position = tabstop; + putc (c, out); + } + } + in_position += spaces; + } + break; + + case '\r': + { + putc (c, out); + tab_from_to (0, indent); + in_position = out_position = 0; + } + break; + + case '\b': + if (in_position != 0 && --in_position < out_bound) + { + if (out_position <= in_position) + /* Add spaces to make up for suppressed tab past out_bound. */ + for (; out_position < in_position; out_position++) + putc (' ', out); + else + { + out_position = in_position; + putc (c, out); + } + } + break; + + default: + { + wchar_t wc; + size_t bytes = mbrtowc (&wc, tp0, text_limit - tp0, &mbstate); + + if (0 < bytes && bytes < (size_t) -2) + { + int width = wcwidth (wc); + if (0 < width) + in_position += width; + if (in_position <= out_bound) + { + out_position = in_position; + fwrite (tp0, 1, bytes, stdout); + } + text_pointer = tp0 + bytes; + break; + } + } + FALLTHROUGH; + case '\f': + case '\v': + if (in_position < out_bound) + putc (c, out); + break; + + case ' ': case '!': case '"': case '#': case '%': + case '&': case '\'': case '(': case ')': case '*': + case '+': case ',': case '-': case '.': case '/': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + case ':': case ';': case '<': case '=': case '>': + case '?': + case 'A': case 'B': case 'C': case 'D': case 'E': + case 'F': case 'G': case 'H': case 'I': case 'J': + case 'K': case 'L': case 'M': case 'N': case 'O': + case 'P': case 'Q': case 'R': case 'S': case 'T': + case 'U': case 'V': case 'W': case 'X': case 'Y': + case 'Z': + case '[': case '\\': case ']': case '^': case '_': + case 'a': case 'b': case 'c': case 'd': case 'e': + case 'f': case 'g': case 'h': case 'i': case 'j': + case 'k': case 'l': case 'm': case 'n': case 'o': + case 'p': case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'y': + case 'z': case '{': case '|': case '}': case '~': + /* These characters are printable ASCII characters. */ + if (in_position++ < out_bound) + { + out_position = in_position; + putc (c, out); + } + break; + + case '\n': + return out_position; + } + } + + return out_position; +} + +/* Print side by side lines with a separator in the middle. + 0 parameters are taken to indicate white space text. + Blank lines that can easily be caught are reduced to a single newline. */ + +static void +print_1sdiff_line (char const *const *left, char sep, + char const *const *right) +{ + FILE *out = outfile; + size_t hw = sdiff_half_width; + size_t c2o = sdiff_column2_offset; + size_t col = 0; + bool put_newline = false; + bool color_to_reset = false; + + if (sep == '<') + { + set_color_context (DELETE_CONTEXT); + color_to_reset = true; + } + else if (sep == '>') + { + set_color_context (ADD_CONTEXT); + color_to_reset = true; + } + + if (left) + { + put_newline |= left[1][-1] == '\n'; + col = print_half_line (left, 0, hw); + } + + if (sep != ' ') + { + col = tab_from_to (col, (hw + c2o - 1) / 2) + 1; + if (sep == '|' && put_newline != (right[1][-1] == '\n')) + sep = put_newline ? '/' : '\\'; + putc (sep, out); + } + + if (right) + { + put_newline |= right[1][-1] == '\n'; + if (**right != '\n') + { + col = tab_from_to (col, c2o); + print_half_line (right, col, hw); + } + } + + if (put_newline) + putc ('\n', out); + + if (color_to_reset) + set_color_context (RESET_CONTEXT); +} + +/* Print lines common to both files in side-by-side format. */ +static void +print_sdiff_common_lines (lin limit0, lin limit1) +{ + lin i0 = next0, i1 = next1; + + if (!suppress_common_lines && (i0 != limit0 || i1 != limit1)) + { + if (sdiff_merge_assist) + { + printint len0 = limit0 - i0; + printint len1 = limit1 - i1; + fprintf (outfile, "i%"pI"d,%"pI"d\n", len0, len1); + } + + if (!left_column) + { + while (i0 != limit0 && i1 != limit1) + print_1sdiff_line (&files[0].linbuf[i0++], ' ', + &files[1].linbuf[i1++]); + while (i1 != limit1) + print_1sdiff_line (0, ')', &files[1].linbuf[i1++]); + } + while (i0 != limit0) + print_1sdiff_line (&files[0].linbuf[i0++], '(', 0); + } + + next0 = limit0; + next1 = limit1; +} + +/* Print a hunk of an sdiff diff. + This is a contiguous portion of a complete edit script, + describing changes in consecutive lines. */ + +static void +print_sdiff_hunk (struct change *hunk) +{ + lin first0, last0, first1, last1; + register lin i, j; + + /* Determine range of line numbers involved in each file. */ + enum changes changes = + analyze_hunk (hunk, &first0, &last0, &first1, &last1); + if (!changes) + return; + + /* Print out lines up to this change. */ + print_sdiff_common_lines (first0, first1); + + if (sdiff_merge_assist) + { + printint len0 = last0 - first0 + 1; + printint len1 = last1 - first1 + 1; + fprintf (outfile, "c%"pI"d,%"pI"d\n", len0, len1); + } + + /* Print "xxx | xxx " lines. */ + if (changes == CHANGED) + { + for (i = first0, j = first1; i <= last0 && j <= last1; i++, j++) + print_1sdiff_line (&files[0].linbuf[i], '|', &files[1].linbuf[j]); + changes = (i <= last0 ? OLD : 0) + (j <= last1 ? NEW : 0); + next0 = first0 = i; + next1 = first1 = j; + } + + /* Print " > xxx " lines. */ + if (changes & NEW) + { + for (j = first1; j <= last1; ++j) + print_1sdiff_line (0, '>', &files[1].linbuf[j]); + next1 = j; + } + + /* Print "xxx < " lines. */ + if (changes & OLD) + { + for (i = first0; i <= last0; ++i) + print_1sdiff_line (&files[0].linbuf[i], '<', 0); + next0 = i; + } +} diff --git a/local/recipes/tools/diffutils/source/src/system.h b/local/recipes/tools/diffutils/source/src/system.h new file mode 100644 index 0000000000..a8936ba7de --- /dev/null +++ b/local/recipes/tools/diffutils/source/src/system.h @@ -0,0 +1,240 @@ +/* System dependent declarations. + + Copyright (C) 1988-1989, 1992-1995, 1998, 2001-2002, 2004, 2006, 2009-2013, + 2015-2017 Free Software Foundation, Inc. + + This file is part of GNU DIFF. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Use this to suppress gcc's "...may be used before initialized" warnings. */ +#ifdef lint +# define IF_LINT(Code) Code +#else +# define IF_LINT(Code) /* empty */ +#endif + +/* Define '__attribute__' and 'volatile' first + so that they're used consistently in all system includes. */ +#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6) || __STRICT_ANSI__ +# define __attribute__(x) +#endif + +#include <verify.h> + +#include <sys/types.h> + +#include <sys/stat.h> +#include "stat-macros.h" + +#ifndef STAT_BLOCKSIZE +# if HAVE_STRUCT_STAT_ST_BLKSIZE +# define STAT_BLOCKSIZE(s) ((s).st_blksize) +# else +# define STAT_BLOCKSIZE(s) (8 * 1024) +# endif +#endif + +#include <unistd.h> + +#include <fcntl.h> +#include <time.h> + +#include <sys/wait.h> + +#include <dirent.h> +#ifndef _D_EXACT_NAMLEN +# define _D_EXACT_NAMLEN(dp) strlen ((dp)->d_name) +#endif + +#include <stdlib.h> +#define EXIT_TROUBLE 2 + +#include <limits.h> +#include <locale.h> +#include <stddef.h> +#include <inttypes.h> + +#include <string.h> +#if ! HAVE_STRCASECOLL +# if HAVE_STRICOLL || defined stricoll +# define strcasecoll(a, b) stricoll (a, b) +# else +# define strcasecoll(a, b) strcasecmp (a, b) /* best we can do */ +# endif +#endif +#if ! (HAVE_STRCASECMP || defined strcasecmp) +int strcasecmp (char const *, char const *); +#endif + +#include <gettext.h> +#if ! ENABLE_NLS +# undef textdomain +# define textdomain(Domainname) /* empty */ +# undef bindtextdomain +# define bindtextdomain(Domainname, Dirname) /* empty */ +#endif + +#define _(msgid) gettext (msgid) +#define N_(msgid) msgid + +#include <ctype.h> + +/* ISDIGIT differs from isdigit, as follows: + - Its arg may be any int or unsigned int; it need not be an unsigned char. + - It's guaranteed to evaluate its argument exactly once. + - It's typically faster. + POSIX 1003.1-2001 says that only '0' through '9' are digits. + Prefer ISDIGIT to isdigit unless it's important to use the locale's + definition of 'digit' even when the host does not conform to POSIX. */ +#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9) + +#include <errno.h> + +#include <signal.h> +#if !defined SIGCHLD && defined SIGCLD +# define SIGCHLD SIGCLD +#endif + +#undef MIN +#undef MAX +#define MIN(a, b) ((a) <= (b) ? (a) : (b)) +#define MAX(a, b) ((a) >= (b) ? (a) : (b)) + +#include <stdbool.h> +#include <intprops.h> +#include "propername.h" +#include "version.h" + +/* Type used for fast comparison of several bytes at a time. + This used to be uintmax_t, but changing it to size_t + made plain 'cmp' 90% faster (GCC 4.8.1, x86). */ + +#ifndef word +# define word size_t +#endif + +/* The signed integer type of a line number. Since files are read + into main memory, ptrdiff_t should be wide enough. */ + +typedef ptrdiff_t lin; +#define LIN_MAX PTRDIFF_MAX + +/* The signed integer type for printing line numbers, and its printf + length modifier. This is not simply ptrdiff_t, to cater to older + and/or nonstandard C libraries where "l" works but "ll" and "t" do + not, or where 'long' is too narrow and "ll" works but "t" does not. */ + +#if LIN_MAX <= LONG_MAX +typedef long int printint; +# define pI "l" +#elif LIN_MAX <= LLONG_MAX +typedef long long int printint; +# define pI "ll" +#else +typedef ptrdiff_t printint; +# define pI "t" +#endif + +verify (TYPE_SIGNED (lin)); +verify (TYPE_SIGNED (printint)); +verify (LIN_MAX == TYPE_MAXIMUM (lin)); +verify (LIN_MAX <= TYPE_MAXIMUM (printint)); + +/* Limit so that 2 * CONTEXT + 1 does not overflow. */ + +#define CONTEXT_MAX ((LIN_MAX - 1) / 2) + + +/* This section contains POSIX-compliant defaults for macros + that are meant to be overridden by hand in config.h as needed. */ + +#ifndef file_name_cmp +# define file_name_cmp strcmp +#endif + +#ifndef initialize_main +# define initialize_main(argcp, argvp) +#endif + +#ifndef NULL_DEVICE +# define NULL_DEVICE "/dev/null" +#endif + +/* Do struct stat *S, *T describe the same special file? */ +#ifndef same_special_file +# if HAVE_STRUCT_STAT_ST_RDEV && defined S_ISBLK && defined S_ISCHR +# define same_special_file(s, t) \ + (((S_ISBLK ((s)->st_mode) && S_ISBLK ((t)->st_mode)) \ + || (S_ISCHR ((s)->st_mode) && S_ISCHR ((t)->st_mode))) \ + && (s)->st_rdev == (t)->st_rdev) +# else +# define same_special_file(s, t) 0 +# endif +#endif + +/* Do struct stat *S, *T describe the same file? Answer -1 if unknown. */ +#ifndef same_file +# define same_file(s, t) \ + ((((s)->st_ino == (t)->st_ino) && ((s)->st_dev == (t)->st_dev)) \ + || same_special_file (s, t)) +#endif + +/* Do struct stat *S, *T have the same file attributes? + + POSIX says that two files are identical if st_ino and st_dev are + the same, but many file systems incorrectly assign the same (device, + inode) pair to two distinct files, including: + + - GNU/Linux NFS servers that export all local file systems as a + single NFS file system, if a local device number (st_dev) exceeds + 255, or if a local inode number (st_ino) exceeds 16777215. + + - Network Appliance NFS servers in snapshot directories; see + Network Appliance bug #195. + + - ClearCase MVFS; see bug id ATRia04618. + + Check whether two files that purport to be the same have the same + attributes, to work around instances of this common bug. Do not + inspect all attributes, only attributes useful in checking for this + bug. + + It's possible for two distinct files on a buggy file system to have + the same attributes, but it's not worth slowing down all + implementations (or complicating the configuration) to cater to + these rare cases in buggy implementations. */ + +#ifndef same_file_attributes +# define same_file_attributes(s, t) \ + ((s)->st_mode == (t)->st_mode \ + && (s)->st_nlink == (t)->st_nlink \ + && (s)->st_uid == (t)->st_uid \ + && (s)->st_gid == (t)->st_gid \ + && (s)->st_size == (t)->st_size \ + && (s)->st_mtime == (t)->st_mtime \ + && (s)->st_ctime == (t)->st_ctime) +#endif + +#define STREQ(a, b) (strcmp (a, b) == 0) + +#ifndef FALLTHROUGH +# if __GNUC__ < 7 +# define FALLTHROUGH ((void) 0) +# else +# define FALLTHROUGH __attribute__ ((__fallthrough__)) +# endif +#endif diff --git a/local/recipes/tools/diffutils/source/src/util.c b/local/recipes/tools/diffutils/source/src/util.c new file mode 100644 index 0000000000..88955da99c --- /dev/null +++ b/local/recipes/tools/diffutils/source/src/util.c @@ -0,0 +1,1576 @@ +/* Support routines for GNU DIFF. + + Copyright (C) 1988-1989, 1992-1995, 1998, 2001-2002, 2004, 2006, 2009-2013, + 2015-2017 Free Software Foundation, Inc. + + This file is part of GNU DIFF. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include "diff.h" +#include "argmatch.h" +#include "die.h" +#include <dirname.h> +#include <error.h> +#include <system-quote.h> +#include <xalloc.h> +#include "xvasprintf.h" +#include <signal.h> + +/* Use SA_NOCLDSTOP as a proxy for whether the sigaction machinery is + present. */ +#ifndef SA_NOCLDSTOP +# define SA_NOCLDSTOP 0 +# define sigprocmask(How, Set, Oset) /* empty */ +# define sigset_t int +# if ! HAVE_SIGINTERRUPT +# define siginterrupt(sig, flag) /* empty */ +# endif +#endif + +#ifndef SA_RESTART +# define SA_RESTART 0 +#endif + +char const pr_program[] = PR_PROGRAM; + +/* Queue up one-line messages to be printed at the end, + when -l is specified. Each message is recorded with a 'struct msg'. */ + +struct msg +{ + struct msg *next; + char args[1]; /* Format + 4 args, each '\0' terminated, concatenated. */ +}; + +/* Head of the chain of queues messages. */ + +static struct msg *msg_chain; + +/* Tail of the chain of queues messages. */ + +static struct msg **msg_chain_end = &msg_chain; + +/* Use when a system call returns non-zero status. + NAME should normally be the file name. */ + +void +perror_with_name (char const *name) +{ + error (0, errno, "%s", name); +} + +/* Use when a system call returns non-zero status and that is fatal. */ + +void +pfatal_with_name (char const *name) +{ + int e = errno; + print_message_queue (); + die (EXIT_TROUBLE, e, "%s", name); +} + +/* Print an error message containing MSGID, then exit. */ + +void +fatal (char const *msgid) +{ + print_message_queue (); + die (EXIT_TROUBLE, 0, "%s", _(msgid)); +} + +/* Like printf, except if -l in effect then save the message and print later. + This is used for things like "Only in ...". */ + +void +message (char const *format_msgid, char const *arg1, char const *arg2) +{ + message5 (format_msgid, arg1, arg2, 0, 0); +} + +void +message5 (char const *format_msgid, char const *arg1, char const *arg2, + char const *arg3, char const *arg4) +{ + if (paginate) + { + char *p; + char const *arg[5]; + int i; + size_t size[5]; + size_t total_size = offsetof (struct msg, args); + struct msg *new; + + arg[0] = format_msgid; + arg[1] = arg1; + arg[2] = arg2; + arg[3] = arg3 ? arg3 : ""; + arg[4] = arg4 ? arg4 : ""; + + for (i = 0; i < 5; i++) + total_size += size[i] = strlen (arg[i]) + 1; + + new = xmalloc (total_size); + + for (i = 0, p = new->args; i < 5; p += size[i++]) + memcpy (p, arg[i], size[i]); + + *msg_chain_end = new; + new->next = 0; + msg_chain_end = &new->next; + } + else + { + if (sdiff_merge_assist) + putchar (' '); + printf (_(format_msgid), arg1, arg2, arg3, arg4); + } +} + +/* Output all the messages that were saved up by calls to 'message'. */ + +void +print_message_queue (void) +{ + char const *arg[5]; + int i; + struct msg *m = msg_chain; + + while (m) + { + struct msg *next = m->next; + arg[0] = m->args; + for (i = 0; i < 4; i++) + arg[i + 1] = arg[i] + strlen (arg[i]) + 1; + printf (_(arg[0]), arg[1], arg[2], arg[3], arg[4]); + free (m); + m = next; + } +} + +/* The set of signals that are caught. */ + +static sigset_t caught_signals; + +/* If nonzero, the value of the pending fatal signal. */ + +static sig_atomic_t volatile interrupt_signal; + +/* A count of the number of pending stop signals that have been received. */ + +static sig_atomic_t volatile stop_signal_count; + +/* An ordinary signal was received; arrange for the program to exit. */ + +static void +sighandler (int sig) +{ + if (! SA_NOCLDSTOP) + signal (sig, SIG_IGN); + if (! interrupt_signal) + interrupt_signal = sig; +} + +/* A SIGTSTP was received; arrange for the program to suspend itself. */ + +static void +stophandler (int sig) +{ + if (! SA_NOCLDSTOP) + signal (sig, stophandler); + if (! interrupt_signal) + stop_signal_count++; +} +/* Process any pending signals. If signals are caught, this function + should be called periodically. Ideally there should never be an + unbounded amount of time when signals are not being processed. + Signal handling can restore the default colors, so callers must + immediately change colors after invoking this function. */ + +static void +process_signals (void) +{ + while (interrupt_signal || stop_signal_count) + { + int sig; + int stops; + sigset_t oldset; + + set_color_context (RESET_CONTEXT); + fflush (stdout); + + sigprocmask (SIG_BLOCK, &caught_signals, &oldset); + + /* Reload interrupt_signal and stop_signal_count, in case a new + signal was handled before sigprocmask took effect. */ + sig = interrupt_signal; + stops = stop_signal_count; + + /* SIGTSTP is special, since the application can receive that signal + more than once. In this case, don't set the signal handler to the + default. Instead, just raise the uncatchable SIGSTOP. */ + if (stops) + { + stop_signal_count = stops - 1; + sig = SIGSTOP; + } + else + signal (sig, SIG_DFL); + + /* Exit or suspend the program. */ + raise (sig); + sigprocmask (SIG_SETMASK, &oldset, NULL); + + /* If execution reaches here, then the program has been + continued (after being suspended). */ + } +} + +static void +install_signal_handlers (void) +{ + /* The signals that are trapped, and the number of such signals. */ + static int const sig[] = + { + /* This one is handled specially. */ + SIGTSTP, + + /* The usual suspects. */ + SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, +#ifdef SIGPOLL + SIGPOLL, +#endif +#ifdef SIGPROF + SIGPROF, +#endif +#ifdef SIGVTALRM + SIGVTALRM, +#endif +#ifdef SIGXCPU + SIGXCPU, +#endif +#ifdef SIGXFSZ + SIGXFSZ, +#endif + }; + enum { nsigs = sizeof (sig) / sizeof *(sig) }; + +#if ! SA_NOCLDSTOP + bool caught_sig[nsigs]; +#endif + { + int j; +#if SA_NOCLDSTOP + struct sigaction act; + + sigemptyset (&caught_signals); + for (j = 0; j < nsigs; j++) + { + sigaction (sig[j], NULL, &act); + if (act.sa_handler != SIG_IGN) + sigaddset (&caught_signals, sig[j]); + } + + act.sa_mask = caught_signals; + act.sa_flags = SA_RESTART; + + for (j = 0; j < nsigs; j++) + if (sigismember (&caught_signals, sig[j])) + { + act.sa_handler = sig[j] == SIGTSTP ? stophandler : sighandler; + sigaction (sig[j], &act, NULL); + } +#else + for (j = 0; j < nsigs; j++) + { + caught_sig[j] = (signal (sig[j], SIG_IGN) != SIG_IGN); + if (caught_sig[j]) + { + signal (sig[j], sig[j] == SIGTSTP ? stophandler : sighandler); + siginterrupt (sig[j], 0); + } + } +#endif + } +} + +static char const *current_name0; +static char const *current_name1; +static bool currently_recursive; +static bool colors_enabled; + +static struct color_ext_type *color_ext_list = NULL; + +struct bin_str + { + size_t len; /* Number of bytes */ + const char *string; /* Pointer to the same */ + }; + +struct color_ext_type + { + struct bin_str ext; /* The extension we're looking for */ + struct bin_str seq; /* The sequence to output when we do */ + struct color_ext_type *next; /* Next in list */ + }; + +/* Parse a string as part of the --palette argument; this may involve + decoding all kinds of escape characters. If equals_end is set an + unescaped equal sign ends the string, otherwise only a : or \0 + does. Set *OUTPUT_COUNT to the number of bytes output. Return + true if successful. + + The resulting string is *not* null-terminated, but may contain + embedded nulls. + + Note that both dest and src are char **; on return they point to + the first free byte after the array and the character that ended + the input string, respectively. */ + +static bool +get_funky_string (char **dest, const char **src, bool equals_end, + size_t *output_count) +{ + char num; /* For numerical codes */ + size_t count; /* Something to count with */ + enum { + ST_GND, ST_BACKSLASH, ST_OCTAL, ST_HEX, ST_CARET, ST_END, ST_ERROR + } state; + const char *p; + char *q; + + p = *src; /* We don't want to double-indirect */ + q = *dest; /* the whole darn time. */ + + count = 0; /* No characters counted in yet. */ + num = 0; + + state = ST_GND; /* Start in ground state. */ + while (state < ST_END) + { + switch (state) + { + case ST_GND: /* Ground state (no escapes) */ + switch (*p) + { + case ':': + case '\0': + state = ST_END; /* End of string */ + break; + case '\\': + state = ST_BACKSLASH; /* Backslash scape sequence */ + ++p; + break; + case '^': + state = ST_CARET; /* Caret escape */ + ++p; + break; + case '=': + if (equals_end) + { + state = ST_END; /* End */ + break; + } + FALLTHROUGH; + default: + *(q++) = *(p++); + ++count; + break; + } + break; + + case ST_BACKSLASH: /* Backslash escaped character */ + switch (*p) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + state = ST_OCTAL; /* Octal sequence */ + num = *p - '0'; + break; + case 'x': + case 'X': + state = ST_HEX; /* Hex sequence */ + num = 0; + break; + case 'a': /* Bell */ + num = '\a'; + break; + case 'b': /* Backspace */ + num = '\b'; + break; + case 'e': /* Escape */ + num = 27; + break; + case 'f': /* Form feed */ + num = '\f'; + break; + case 'n': /* Newline */ + num = '\n'; + break; + case 'r': /* Carriage return */ + num = '\r'; + break; + case 't': /* Tab */ + num = '\t'; + break; + case 'v': /* Vtab */ + num = '\v'; + break; + case '?': /* Delete */ + num = 127; + break; + case '_': /* Space */ + num = ' '; + break; + case '\0': /* End of string */ + state = ST_ERROR; /* Error! */ + break; + default: /* Escaped character like \ ^ : = */ + num = *p; + break; + } + if (state == ST_BACKSLASH) + { + *(q++) = num; + ++count; + state = ST_GND; + } + ++p; + break; + + case ST_OCTAL: /* Octal sequence */ + if (*p < '0' || *p > '7') + { + *(q++) = num; + ++count; + state = ST_GND; + } + else + num = (num << 3) + (*(p++) - '0'); + break; + + case ST_HEX: /* Hex sequence */ + switch (*p) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + num = (num << 4) + (*(p++) - '0'); + break; + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + num = (num << 4) + (*(p++) - 'a') + 10; + break; + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + num = (num << 4) + (*(p++) - 'A') + 10; + break; + default: + *(q++) = num; + ++count; + state = ST_GND; + break; + } + break; + + case ST_CARET: /* Caret escape */ + state = ST_GND; /* Should be the next state... */ + if (*p >= '@' && *p <= '~') + { + *(q++) = *(p++) & 037; + ++count; + } + else if (*p == '?') + { + *(q++) = 127; + ++count; + } + else + state = ST_ERROR; + break; + + default: + abort (); + } + } + + *dest = q; + *src = p; + *output_count = count; + + return state != ST_ERROR; +} + +enum parse_state + { + PS_START = 1, + PS_2, + PS_3, + PS_4, + PS_DONE, + PS_FAIL + }; + +#define LEN_STR_PAIR(s) sizeof (s) - 1, s + +static struct bin_str color_indicator[] = + { + { LEN_STR_PAIR ("\033[") }, /* lc: Left of color sequence */ + { LEN_STR_PAIR ("m") }, /* rc: Right of color sequence */ + { 0, NULL }, /* ec: End color (replaces lc+rs+rc) */ + { LEN_STR_PAIR ("0") }, /* rs: Reset to ordinary colors */ + { LEN_STR_PAIR ("1") }, /* hd: Header */ + { LEN_STR_PAIR ("32") }, /* ad: Add line */ + { LEN_STR_PAIR ("31") }, /* de: Delete line */ + { LEN_STR_PAIR ("36") }, /* ln: Line number */ + }; + +static const char *const indicator_name[] = + { + "lc", "rc", "ec", "rs", "hd", "ad", "de", "ln", NULL + }; +ARGMATCH_VERIFY (indicator_name, color_indicator); + +static char const *color_palette; + +void +set_color_palette (char const *palette) +{ + color_palette = palette; +} + +static void +parse_diff_color (void) +{ + char *color_buf; + const char *p; /* Pointer to character being parsed */ + char *buf; /* color_buf buffer pointer */ + int ind_no; /* Indicator number */ + char label[3]; /* Indicator label */ + struct color_ext_type *ext; /* Extension we are working on */ + + if ((p = color_palette) == NULL || *p == '\0') + return; + + ext = NULL; + strcpy (label, "??"); + + /* This is an overly conservative estimate, but any possible + --palette string will *not* generate a color_buf longer than + itself, so it is a safe way of allocating a buffer in + advance. */ + buf = color_buf = xstrdup (p); + + enum parse_state state = PS_START; + while (true) + { + switch (state) + { + case PS_START: /* First label character */ + switch (*p) + { + case ':': + ++p; + break; + + case '*': + /* Allocate new extension block and add to head of + linked list (this way a later definition will + override an earlier one, which can be useful for + having terminal-specific defs override global). */ + + ext = xmalloc (sizeof *ext); + ext->next = color_ext_list; + color_ext_list = ext; + + ++p; + ext->ext.string = buf; + + state = (get_funky_string (&buf, &p, true, &ext->ext.len) + ? PS_4 : PS_FAIL); + break; + + case '\0': + state = PS_DONE; /* Done! */ + goto done; + + default: /* Assume it is file type label */ + label[0] = *(p++); + state = PS_2; + break; + } + break; + + case PS_2: /* Second label character */ + if (*p) + { + label[1] = *(p++); + state = PS_3; + } + else + state = PS_FAIL; /* Error */ + break; + + case PS_3: /* Equal sign after indicator label */ + state = PS_FAIL; /* Assume failure... */ + if (*(p++) == '=')/* It *should* be... */ + { + for (ind_no = 0; indicator_name[ind_no] != NULL; ++ind_no) + { + if (STREQ (label, indicator_name[ind_no])) + { + color_indicator[ind_no].string = buf; + state = (get_funky_string (&buf, &p, false, + &color_indicator[ind_no].len) + ? PS_START : PS_FAIL); + break; + } + } + if (state == PS_FAIL) + error (0, 0, _("unrecognized prefix: %s"), label); + } + break; + + case PS_4: /* Equal sign after *.ext */ + if (*(p++) == '=') + { + ext->seq.string = buf; + state = (get_funky_string (&buf, &p, false, &ext->seq.len) + ? PS_START : PS_FAIL); + } + else + state = PS_FAIL; + break; + + case PS_FAIL: + goto done; + + default: + abort (); + } + } + done: + + if (state == PS_FAIL) + { + struct color_ext_type *e; + struct color_ext_type *e2; + + error (0, 0, + _("unparsable value for --palette")); + free (color_buf); + for (e = color_ext_list; e != NULL; /* empty */) + { + e2 = e; + e = e->next; + free (e2); + } + colors_enabled = false; + } +} + +static void +check_color_output (bool is_pipe) +{ + bool output_is_tty; + + if (! outfile || colors_style == NEVER) + return; + + output_is_tty = presume_output_tty || (!is_pipe && isatty (fileno (outfile))); + + colors_enabled = (colors_style == ALWAYS + || (colors_style == AUTO && output_is_tty)); + + if (colors_enabled) + parse_diff_color (); + + if (output_is_tty) + install_signal_handlers (); +} + +/* Call before outputting the results of comparing files NAME0 and NAME1 + to set up OUTFILE, the stdio stream for the output to go to. + + Usually, OUTFILE is just stdout. But when -l was specified + we fork off a 'pr' and make OUTFILE a pipe to it. + 'pr' then outputs to our stdout. */ + +void +setup_output (char const *name0, char const *name1, bool recursive) +{ + current_name0 = name0; + current_name1 = name1; + currently_recursive = recursive; + outfile = 0; +} + +#if HAVE_WORKING_FORK +static pid_t pr_pid; +#endif + +static char c_escape_char (char c) +{ + switch (c) { + case '\a': return 'a'; + case '\b': return 'b'; + case '\t': return 't'; + case '\n': return 'n'; + case '\v': return 'v'; + case '\f': return 'f'; + case '\r': return 'r'; + case '"': return '"'; + case '\\': return '\\'; + default: + return c < 32; + } +} + +static char * +c_escape (char const *str) +{ + char const *s; + size_t plus = 0; + bool must_quote = false; + + for (s = str; *s; s++) + { + char c = *s; + + if (c == ' ') + { + must_quote = true; + continue; + } + switch (c_escape_char (*s)) + { + case 1: + plus += 3; + /* fall through */ + case 0: + break; + default: + plus++; + break; + } + } + + if (must_quote || plus) + { + size_t s_len = s - str; + char *buffer = xmalloc (s_len + plus + 3); + char *b = buffer; + + *b++ = '"'; + for (s = str; *s; s++) + { + char c = *s; + char escape = c_escape_char (c); + + switch (escape) + { + case 0: + *b++ = c; + break; + case 1: + *b++ = '\\'; + *b++ = ((c >> 6) & 03) + '0'; + *b++ = ((c >> 3) & 07) + '0'; + *b++ = ((c >> 0) & 07) + '0'; + break; + default: + *b++ = '\\'; + *b++ = escape; + break; + } + } + *b++ = '"'; + *b = 0; + return buffer; + } + + return (char *) str; +} + +void +begin_output (void) +{ + char *names[2]; + char *name; + + if (outfile != 0) + return; + + names[0] = c_escape (current_name0); + names[1] = c_escape (current_name1); + + /* Construct the header of this piece of diff. */ + /* POSIX 1003.1-2001 specifies this format. But there are some bugs in + the standard: it says that we must print only the last component + of the pathnames, and it requires two spaces after "diff" if + there are no options. These requirements are silly and do not + match historical practice. */ + name = xasprintf ("diff%s %s %s", switch_string, names[0], names[1]); + + if (paginate) + { + char const *argv[4]; + + if (fflush (stdout) != 0) + pfatal_with_name (_("write failed")); + + argv[0] = pr_program; + argv[1] = "-h"; + argv[2] = name; + argv[3] = 0; + + /* Make OUTFILE a pipe to a subsidiary 'pr'. */ + { +#if HAVE_WORKING_FORK + int pipes[2]; + + if (pipe (pipes) != 0) + pfatal_with_name ("pipe"); + + pr_pid = fork (); + if (pr_pid < 0) + pfatal_with_name ("fork"); + + if (pr_pid == 0) + { + close (pipes[1]); + if (pipes[0] != STDIN_FILENO) + { + if (dup2 (pipes[0], STDIN_FILENO) < 0) + pfatal_with_name ("dup2"); + close (pipes[0]); + } + + execv (pr_program, (char **) argv); + _exit (errno == ENOENT ? 127 : 126); + } + else + { + close (pipes[0]); + outfile = fdopen (pipes[1], "w"); + if (!outfile) + pfatal_with_name ("fdopen"); + check_color_output (true); + } +#else + char *command = system_quote_argv (SCI_SYSTEM, (char **) argv); + errno = 0; + outfile = popen (command, "w"); + if (!outfile) + pfatal_with_name (command); + check_color_output (true); + free (command); +#endif + } + } + else + { + + /* If -l was not specified, output the diff straight to 'stdout'. */ + + outfile = stdout; + check_color_output (false); + + /* If handling multiple files (because scanning a directory), + print which files the following output is about. */ + if (currently_recursive) + printf ("%s\n", name); + } + + free (name); + + /* A special header is needed at the beginning of context output. */ + switch (output_style) + { + case OUTPUT_CONTEXT: + print_context_header (files, (char const *const *)names, false); + break; + + case OUTPUT_UNIFIED: + print_context_header (files, (char const *const *)names, true); + break; + + default: + break; + } + + if (names[0] != current_name0) + free (names[0]); + if (names[1] != current_name1) + free (names[1]); +} + +/* Call after the end of output of diffs for one file. + Close OUTFILE and get rid of the 'pr' subfork. */ + +void +finish_output (void) +{ + if (outfile != 0 && outfile != stdout) + { + int status; + int wstatus; + int werrno = 0; + if (ferror (outfile)) + fatal ("write failed"); +#if ! HAVE_WORKING_FORK + wstatus = pclose (outfile); + if (wstatus == -1) + werrno = errno; +#else + if (fclose (outfile) != 0) + pfatal_with_name (_("write failed")); + if (waitpid (pr_pid, &wstatus, 0) < 0) + pfatal_with_name ("waitpid"); +#endif + status = (! werrno && WIFEXITED (wstatus) + ? WEXITSTATUS (wstatus) + : INT_MAX); + if (status) + die (EXIT_TROUBLE, werrno, + _(status == 126 + ? "subsidiary program '%s' could not be invoked" + : status == 127 + ? "subsidiary program '%s' not found" + : status == INT_MAX + ? "subsidiary program '%s' failed" + : "subsidiary program '%s' failed (exit status %d)"), + pr_program, status); + } + + outfile = 0; +} + +/* Compare two lines (typically one from each input file) + according to the command line options. + For efficiency, this is invoked only when the lines do not match exactly + but an option like -i might cause us to ignore the difference. + Return nonzero if the lines differ. */ + +bool +lines_differ (char const *s1, char const *s2) +{ + register char const *t1 = s1; + register char const *t2 = s2; + size_t column = 0; + + while (1) + { + register unsigned char c1 = *t1++; + register unsigned char c2 = *t2++; + + /* Test for exact char equality first, since it's a common case. */ + if (c1 != c2) + { + switch (ignore_white_space) + { + case IGNORE_ALL_SPACE: + /* For -w, just skip past any white space. */ + while (isspace (c1) && c1 != '\n') c1 = *t1++; + while (isspace (c2) && c2 != '\n') c2 = *t2++; + break; + + case IGNORE_SPACE_CHANGE: + /* For -b, advance past any sequence of white space in + line 1 and consider it just one space, or nothing at + all if it is at the end of the line. */ + if (isspace (c1)) + { + while (c1 != '\n') + { + c1 = *t1++; + if (! isspace (c1)) + { + --t1; + c1 = ' '; + break; + } + } + } + + /* Likewise for line 2. */ + if (isspace (c2)) + { + while (c2 != '\n') + { + c2 = *t2++; + if (! isspace (c2)) + { + --t2; + c2 = ' '; + break; + } + } + } + + if (c1 != c2) + { + /* If we went too far when doing the simple test + for equality, go back to the first non-white-space + character in both sides and try again. */ + if (c2 == ' ' && c1 != '\n' + && s1 + 1 < t1 + && isspace ((unsigned char) t1[-2])) + { + --t1; + continue; + } + if (c1 == ' ' && c2 != '\n' + && s2 + 1 < t2 + && isspace ((unsigned char) t2[-2])) + { + --t2; + continue; + } + } + + break; + + case IGNORE_TRAILING_SPACE: + case IGNORE_TAB_EXPANSION_AND_TRAILING_SPACE: + if (isspace (c1) && isspace (c2)) + { + unsigned char c; + if (c1 != '\n') + { + char const *p = t1; + while ((c = *p) != '\n' && isspace (c)) + ++p; + if (c != '\n') + break; + } + if (c2 != '\n') + { + char const *p = t2; + while ((c = *p) != '\n' && isspace (c)) + ++p; + if (c != '\n') + break; + } + /* Both lines have nothing but whitespace left. */ + return false; + } + if (ignore_white_space == IGNORE_TRAILING_SPACE) + break; + FALLTHROUGH; + case IGNORE_TAB_EXPANSION: + if ((c1 == ' ' && c2 == '\t') + || (c1 == '\t' && c2 == ' ')) + { + size_t column2 = column; + for (;; c1 = *t1++) + { + if (c1 == ' ') + column++; + else if (c1 == '\t') + column += tabsize - column % tabsize; + else + break; + } + for (;; c2 = *t2++) + { + if (c2 == ' ') + column2++; + else if (c2 == '\t') + column2 += tabsize - column2 % tabsize; + else + break; + } + if (column != column2) + return true; + } + break; + + case IGNORE_NO_WHITE_SPACE: + break; + } + + /* Lowercase all letters if -i is specified. */ + + if (ignore_case) + { + c1 = tolower (c1); + c2 = tolower (c2); + } + + if (c1 != c2) + break; + } + if (c1 == '\n') + return false; + + column += c1 == '\t' ? tabsize - column % tabsize : 1; + } + + return true; +} + +/* Find the consecutive changes at the start of the script START. + Return the last link before the first gap. */ + +struct change * _GL_ATTRIBUTE_CONST +find_change (struct change *start) +{ + return start; +} + +struct change * _GL_ATTRIBUTE_CONST +find_reverse_change (struct change *start) +{ + return start; +} + +/* Divide SCRIPT into pieces by calling HUNKFUN and + print each piece with PRINTFUN. + Both functions take one arg, an edit script. + + HUNKFUN is called with the tail of the script + and returns the last link that belongs together with the start + of the tail. + + PRINTFUN takes a subscript which belongs together (with a null + link at the end) and prints it. */ + +void +print_script (struct change *script, + struct change * (*hunkfun) (struct change *), + void (*printfun) (struct change *)) +{ + struct change *next = script; + + while (next) + { + struct change *this, *end; + + /* Find a set of changes that belong together. */ + this = next; + end = (*hunkfun) (next); + + /* Disconnect them from the rest of the changes, + making them a hunk, and remember the rest for next iteration. */ + next = end->link; + end->link = 0; +#ifdef DEBUG + debug_script (this); +#endif + + /* Print this hunk. */ + (*printfun) (this); + + /* Reconnect the script so it will all be freed properly. */ + end->link = next; + } +} + +/* Print the text of a single line LINE, + flagging it with the characters in LINE_FLAG (which say whether + the line is inserted, deleted, changed, etc.). LINE_FLAG must not + end in a blank, unless it is a single blank. */ + +void +print_1_line (char const *line_flag, char const *const *line) +{ + print_1_line_nl (line_flag, line, false); +} + +/* Print the text of a single line LINE, + flagging it with the characters in LINE_FLAG (which say whether + the line is inserted, deleted, changed, etc.). LINE_FLAG must not + end in a blank, unless it is a single blank. If SKIP_NL is set, then + the final '\n' is not printed. */ + +void +print_1_line_nl (char const *line_flag, char const *const *line, bool skip_nl) +{ + char const *base = line[0], *limit = line[1]; /* Help the compiler. */ + FILE *out = outfile; /* Help the compiler some more. */ + char const *flag_format = 0; + + /* If -T was specified, use a Tab between the line-flag and the text. + Otherwise use a Space (as Unix diff does). + Print neither space nor tab if line-flags are empty. + But omit trailing blanks if requested. */ + + if (line_flag && *line_flag) + { + char const *flag_format_1 = flag_format = initial_tab ? "%s\t" : "%s "; + char const *line_flag_1 = line_flag; + + if (suppress_blank_empty && **line == '\n') + { + flag_format_1 = "%s"; + + /* This hack to omit trailing blanks takes advantage of the + fact that the only way that LINE_FLAG can end in a blank + is when LINE_FLAG consists of a single blank. */ + line_flag_1 += *line_flag_1 == ' '; + } + + fprintf (out, flag_format_1, line_flag_1); + } + + output_1_line (base, limit - (skip_nl && limit[-1] == '\n'), flag_format, line_flag); + + if ((!line_flag || line_flag[0]) && limit[-1] != '\n') + { + set_color_context (RESET_CONTEXT); + fprintf (out, "\n\\ %s\n", _("No newline at end of file")); + } +} + +/* Output a line from BASE up to LIMIT. + With -t, expand white space characters to spaces, and if FLAG_FORMAT + is nonzero, output it with argument LINE_FLAG after every + internal carriage return, so that tab stops continue to line up. */ + +void +output_1_line (char const *base, char const *limit, char const *flag_format, + char const *line_flag) +{ + const size_t MAX_CHUNK = 1024; + if (!expand_tabs) + { + size_t left = limit - base; + while (left) + { + size_t to_write = MIN (left, MAX_CHUNK); + size_t written = fwrite (base, sizeof (char), to_write, outfile); + if (written < to_write) + return; + base += written; + left -= written; + process_signals (); + } + } + else + { + register FILE *out = outfile; + register unsigned char c; + register char const *t = base; + register size_t column = 0; + size_t tab_size = tabsize; + size_t counter_proc_signals = 0; + + while (t < limit) + { + counter_proc_signals++; + if (counter_proc_signals == MAX_CHUNK) + { + process_signals (); + counter_proc_signals = 0; + } + + switch ((c = *t++)) + { + case '\t': + { + size_t spaces = tab_size - column % tab_size; + column += spaces; + do + putc (' ', out); + while (--spaces); + } + break; + + case '\r': + putc (c, out); + if (flag_format && t < limit && *t != '\n') + fprintf (out, flag_format, line_flag); + column = 0; + break; + + case '\b': + if (column == 0) + continue; + column--; + putc (c, out); + break; + + default: + column += isprint (c) != 0; + putc (c, out); + break; + } + } + } +} + +enum indicator_no + { + C_LEFT, C_RIGHT, C_END, C_RESET, C_HEADER, C_ADD, C_DELETE, C_LINE + }; + +static void +put_indicator (const struct bin_str *ind) +{ + fwrite (ind->string, ind->len, 1, outfile); +} + +static enum color_context last_context = RESET_CONTEXT; + +void +set_color_context (enum color_context color_context) +{ + if (color_context != RESET_CONTEXT) + process_signals (); + if (colors_enabled && last_context != color_context) + { + put_indicator (&color_indicator[C_LEFT]); + switch (color_context) + { + case HEADER_CONTEXT: + put_indicator (&color_indicator[C_HEADER]); + break; + + case LINE_NUMBER_CONTEXT: + put_indicator (&color_indicator[C_LINE]); + break; + + case ADD_CONTEXT: + put_indicator (&color_indicator[C_ADD]); + break; + + case DELETE_CONTEXT: + put_indicator (&color_indicator[C_DELETE]); + break; + + case RESET_CONTEXT: + put_indicator (&color_indicator[C_RESET]); + break; + + default: + abort (); + } + put_indicator (&color_indicator[C_RIGHT]); + last_context = color_context; + } +} + + +char const change_letter[] = { 0, 'd', 'a', 'c' }; + +/* Translate an internal line number (an index into diff's table of lines) + into an actual line number in the input file. + The internal line number is I. FILE points to the data on the file. + + Internal line numbers count from 0 starting after the prefix. + Actual line numbers count from 1 within the entire file. */ + +lin _GL_ATTRIBUTE_PURE +translate_line_number (struct file_data const *file, lin i) +{ + return i + file->prefix_lines + 1; +} + +/* Translate a line number range. This is always done for printing, + so for convenience translate to printint rather than lin, so that the + caller can use printf with "%"pI"d" without casting. */ + +void +translate_range (struct file_data const *file, + lin a, lin b, + printint *aptr, printint *bptr) +{ + *aptr = translate_line_number (file, a - 1) + 1; + *bptr = translate_line_number (file, b + 1) - 1; +} + +/* Print a pair of line numbers with SEPCHAR, translated for file FILE. + If the two numbers are identical, print just one number. + + Args A and B are internal line numbers. + We print the translated (real) line numbers. */ + +void +print_number_range (char sepchar, struct file_data *file, lin a, lin b) +{ + printint trans_a, trans_b; + translate_range (file, a, b, &trans_a, &trans_b); + + /* Note: we can have B < A in the case of a range of no lines. + In this case, we should print the line number before the range, + which is B. */ + if (trans_b > trans_a) + fprintf (outfile, "%"pI"d%c%"pI"d", trans_a, sepchar, trans_b); + else + fprintf (outfile, "%"pI"d", trans_b); +} + +/* Look at a hunk of edit script and report the range of lines in each file + that it applies to. HUNK is the start of the hunk, which is a chain + of 'struct change'. The first and last line numbers of file 0 are stored in + *FIRST0 and *LAST0, and likewise for file 1 in *FIRST1 and *LAST1. + Note that these are internal line numbers that count from 0. + + If no lines from file 0 are deleted, then FIRST0 is LAST0+1. + + Return UNCHANGED if only ignorable lines are inserted or deleted, + OLD if lines of file 0 are deleted, + NEW if lines of file 1 are inserted, + and CHANGED if both kinds of changes are found. */ + +enum changes +analyze_hunk (struct change *hunk, + lin *first0, lin *last0, + lin *first1, lin *last1) +{ + struct change *next; + lin l0, l1; + lin show_from, show_to; + lin i; + bool trivial = ignore_blank_lines || ignore_regexp.fastmap; + size_t trivial_length = ignore_blank_lines - 1; + /* If 0, ignore zero-length lines; + if SIZE_MAX, do not ignore lines just because of their length. */ + + bool skip_white_space = + ignore_blank_lines && IGNORE_TRAILING_SPACE <= ignore_white_space; + bool skip_leading_white_space = + skip_white_space && IGNORE_SPACE_CHANGE <= ignore_white_space; + + char const * const *linbuf0 = files[0].linbuf; /* Help the compiler. */ + char const * const *linbuf1 = files[1].linbuf; + + show_from = show_to = 0; + + *first0 = hunk->line0; + *first1 = hunk->line1; + + next = hunk; + do + { + l0 = next->line0 + next->deleted - 1; + l1 = next->line1 + next->inserted - 1; + show_from += next->deleted; + show_to += next->inserted; + + for (i = next->line0; i <= l0 && trivial; i++) + { + char const *line = linbuf0[i]; + char const *lastbyte = linbuf0[i + 1] - 1; + char const *newline = lastbyte + (*lastbyte != '\n'); + size_t len = newline - line; + char const *p = line; + if (skip_white_space) + for (; *p != '\n'; p++) + if (! isspace ((unsigned char) *p)) + { + if (! skip_leading_white_space) + p = line; + break; + } + if (newline - p != trivial_length + && (! ignore_regexp.fastmap + || re_search (&ignore_regexp, line, len, 0, len, 0) < 0)) + trivial = 0; + } + + for (i = next->line1; i <= l1 && trivial; i++) + { + char const *line = linbuf1[i]; + char const *lastbyte = linbuf1[i + 1] - 1; + char const *newline = lastbyte + (*lastbyte != '\n'); + size_t len = newline - line; + char const *p = line; + if (skip_white_space) + for (; *p != '\n'; p++) + if (! isspace ((unsigned char) *p)) + { + if (! skip_leading_white_space) + p = line; + break; + } + if (newline - p != trivial_length + && (! ignore_regexp.fastmap + || re_search (&ignore_regexp, line, len, 0, len, 0) < 0)) + trivial = 0; + } + } + while ((next = next->link) != 0); + + *last0 = l0; + *last1 = l1; + + /* If all inserted or deleted lines are ignorable, + tell the caller to ignore this hunk. */ + + if (trivial) + return UNCHANGED; + + return (show_from ? OLD : UNCHANGED) | (show_to ? NEW : UNCHANGED); +} + +/* Concatenate three strings, returning a newly malloc'd string. */ + +char * +concat (char const *s1, char const *s2, char const *s3) +{ + char *new = xmalloc (strlen (s1) + strlen (s2) + strlen (s3) + 1); + sprintf (new, "%s%s%s", s1, s2, s3); + return new; +} + +/* Yield a new block of SIZE bytes, initialized to zero. */ + +void * +zalloc (size_t size) +{ + void *p = xmalloc (size); + memset (p, 0, size); + return p; +} + +void +debug_script (struct change *sp) +{ + fflush (stdout); + + for (; sp; sp = sp->link) + { + printint line0 = sp->line0; + printint line1 = sp->line1; + printint deleted = sp->deleted; + printint inserted = sp->inserted; + fprintf (stderr, "%3"pI"d %3"pI"d delete %"pI"d insert %"pI"d\n", + line0, line1, deleted, inserted); + } + + fflush (stderr); +} diff --git a/local/recipes/tools/diffutils/source/tests/Makefile.am b/local/recipes/tools/diffutils/source/tests/Makefile.am new file mode 100644 index 0000000000..6668863148 --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/Makefile.am @@ -0,0 +1,92 @@ +# tests for GNU diff + +TESTS = \ + basic \ + bignum \ + binary \ + brief-vs-stat-zero-kernel-lies \ + cmp \ + colliding-file-names \ + diff3 \ + excess-slash \ + help-version \ + invalid-re \ + function-line-vs-leading-space \ + ignore-matching-lines \ + label-vs-func \ + new-file \ + no-dereference \ + no-newline-at-eof \ + stdin \ + strcoll-0-names \ + filename-quoting \ + colors + +EXTRA_DIST = \ + $(TESTS) init.sh t-local.sh envvar-check + +# Note that the first lines are statements. They ensure that environment +# variables that can perturb tests are unset or set to expected values. +# The rest are envvar settings that propagate build-related Makefile +# variables to test scripts. +TESTS_ENVIRONMENT = \ + tmp__=$${TMPDIR-/tmp}; \ + test -d "$$tmp__" && test -w "$$tmp__" || tmp__=.; \ + . $(srcdir)/envvar-check; \ + TMPDIR=$$tmp__; export TMPDIR; \ + \ + if test -n "$$BASH_VERSION" || (eval "export v=x") 2>/dev/null; then \ + export_with_values () { export "$$@"; }; \ + else \ + export_with_values () \ + { \ + sed_extract_var='s/=.*//'; \ + sed_quote_value="s/'/'\\\\''/g;s/=\\(.*\\)/='\\1'/";\ + for arg in "$$@"; do \ + var=`echo "$$arg" | sed "$$sed_extract_var"`; \ + arg=`echo "$$arg" | sed "$$sed_quote_value"`; \ + eval "$$arg"; \ + export "$$var"; \ + done; \ + }; \ + fi; \ + \ + export_with_values \ + VERSION='$(VERSION)' \ + LOCALE_FR='$(LOCALE_FR)' \ + LOCALE_FR_UTF8='$(LOCALE_FR_UTF8)' \ + AWK=$(AWK) \ + GREP_OPTIONS='' \ + LC_ALL=C \ + abs_top_builddir='$(abs_top_builddir)' \ + abs_top_srcdir='$(abs_top_srcdir)' \ + abs_srcdir='$(abs_srcdir)' \ + built_programs="`$(built_programs)`" \ + srcdir='$(srcdir)' \ + top_srcdir='$(top_srcdir)' \ + CC='$(CC)' \ + DIFFUTILS_TEST_NAME=`echo $$tst|sed 's,^\./,,;s,/,-,g'` \ + MAKE=$(MAKE) \ + MALLOC_PERTURB_=$(MALLOC_PERTURB_) \ + PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)' \ + PACKAGE_VERSION=$(PACKAGE_VERSION) \ + PERL='$(PERL)' \ + SHELL='$(SHELL)' \ + PREFERABLY_POSIX_SHELL='$(PREFERABLY_POSIX_SHELL)' \ + REPLACE_GETCWD=$(REPLACE_GETCWD) \ + PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH" \ + stderr_fileno_=9 \ + ; 9>&2 + +LOG_COMPILER= $(SHELL) + +built_programs = \ + echo 'spy:;@echo $$(PROGRAMS)' \ + | { (cd ../src && MAKEFLAGS= $(MAKE) -s -f Makefile -f - spy) \ + | tr ' ' '\n' \ + | sed '/^$$/d; s,$(EXEEXT)$$,,' \ + | sort -u \ + | tr '\n' ' '; echo; } \ + | sed 's/ $$//' + +VERBOSE = yes diff --git a/local/recipes/tools/diffutils/source/tests/Makefile.in b/local/recipes/tools/diffutils/source/tests/Makefile.in new file mode 100644 index 0000000000..2d11bc0470 --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/Makefile.in @@ -0,0 +1,2010 @@ +# Makefile.in generated by automake 1.18.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2025 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# tests for GNU diff +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +am__rm_f = rm -f $(am__rm_f_notfound) +am__rm_rf = rm -rf $(am__rm_f_notfound) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = tests +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ + $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \ + $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/btowc.m4 \ + $(top_srcdir)/m4/builtin-expect.m4 $(top_srcdir)/m4/c-stack.m4 \ + $(top_srcdir)/m4/clock_time.m4 $(top_srcdir)/m4/close.m4 \ + $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \ + $(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/ctype.m4 \ + $(top_srcdir)/m4/dirname.m4 \ + $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/extensions.m4 \ + $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fcntl-o.m4 \ + $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/filenamecat.m4 \ + $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \ + $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpieee.m4 \ + $(top_srcdir)/m4/freopen.m4 $(top_srcdir)/m4/fstat.m4 \ + $(top_srcdir)/m4/ftruncate.m4 $(top_srcdir)/m4/getcwd.m4 \ + $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/getpagesize.m4 \ + $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnu-make.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 \ + $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \ + $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \ + $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttostr.m4 \ + $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \ + $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \ + $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/iswblank.m4 \ + $(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ + $(top_srcdir)/m4/libunistring-base.m4 \ + $(top_srcdir)/m4/limits-h.m4 $(top_srcdir)/m4/localcharset.m4 \ + $(top_srcdir)/m4/locale-fr.m4 $(top_srcdir)/m4/locale-ja.m4 \ + $(top_srcdir)/m4/locale-tr.m4 $(top_srcdir)/m4/locale-zh.m4 \ + $(top_srcdir)/m4/locale_h.m4 $(top_srcdir)/m4/localeconv.m4 \ + $(top_srcdir)/m4/localtime-buffer.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ + $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/mbchar.m4 \ + $(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbslen.m4 \ + $(top_srcdir)/m4/mbsrtowcs.m4 $(top_srcdir)/m4/mbstate_t.m4 \ + $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \ + $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mkstemp.m4 \ + $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/mmap-anon.m4 \ + $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \ + $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \ + $(top_srcdir)/m4/nanosleep.m4 $(top_srcdir)/m4/netinet_in_h.m4 \ + $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \ + $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ + $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \ + $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/regex.m4 \ + $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/setlocale.m4 \ + $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/signalblocking.m4 \ + $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/socketlib.m4 \ + $(top_srcdir)/m4/sockets.m4 $(top_srcdir)/m4/socklen.m4 \ + $(top_srcdir)/m4/sockpfaf.m4 $(top_srcdir)/m4/ssize_t.m4 \ + $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \ + $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \ + $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/strcase.m4 $(top_srcdir)/m4/strerror.m4 \ + $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/strftime.m4 \ + $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strings_h.m4 \ + $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ + $(top_srcdir)/m4/strptime.m4 $(top_srcdir)/m4/strtoull.m4 \ + $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/symlink.m4 \ + $(top_srcdir)/m4/sys_ioctl_h.m4 \ + $(top_srcdir)/m4/sys_select_h.m4 \ + $(top_srcdir)/m4/sys_socket_h.m4 \ + $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ + $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \ + $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \ + $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \ + $(top_srcdir)/m4/time_rz.m4 $(top_srcdir)/m4/timegm.m4 \ + $(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \ + $(top_srcdir)/m4/tzset.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vararrays.m4 \ + $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vasprintf.m4 \ + $(top_srcdir)/m4/version-etc.m4 \ + $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \ + $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ + $(top_srcdir)/m4/wctomb.m4 $(top_srcdir)/m4/wctype_h.m4 \ + $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \ + $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xstrtol.m4 \ + $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/lib/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + $$am__collect_skipped_logs \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer-defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(IGNORE_SKIPPED_LOGS)'; then \ + am__collect_skipped_logs='--collect-skipped-logs no'; \ +else \ + am__collect_skipped_logs=''; \ +fi; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/build-aux/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkglibexecdir = @pkglibexecdir@ +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_INCLUDE = @CONFIG_INCLUDE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ +EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ +ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ +ENOLINK_VALUE = @ENOLINK_VALUE@ +EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ +EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ +ERRNO_H = @ERRNO_H@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FLOAT_H = @FLOAT_H@ +FNMATCH_H = @FNMATCH_H@ +GETOPT_CDEFS_H = @GETOPT_CDEFS_H@ +GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIBC21 = @GLIBC21@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ +GNULIB_CHDIR = @GNULIB_CHDIR@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_CTIME = @GNULIB_CTIME@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ +GNULIB_DUP = @GNULIB_DUP@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_DUP3 = @GNULIB_DUP3@ +GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ +GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ +GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ +GNULIB_FCNTL = @GNULIB_FCNTL@ +GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ +GNULIB_FDOPEN = @GNULIB_FDOPEN@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FFS = @GNULIB_FFS@ +GNULIB_FFSL = @GNULIB_FFSL@ +GNULIB_FFSLL = @GNULIB_FFSLL@ +GNULIB_FGETC = @GNULIB_FGETC@ +GNULIB_FGETS = @GNULIB_FGETS@ +GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPURGE = @GNULIB_FPURGE@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ +GNULIB_FREAD = @GNULIB_FREAD@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ +GNULIB_FSCANF = @GNULIB_FSCANF@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSTAT = @GNULIB_FSTAT@ +GNULIB_FSTATAT = @GNULIB_FSTATAT@ +GNULIB_FSYNC = @GNULIB_FSYNC@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETC = @GNULIB_GETC@ +GNULIB_GETCHAR = @GNULIB_GETCHAR@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ +GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ +GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ +GNULIB_GRANTPT = @GNULIB_GRANTPT@ +GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ +GNULIB_ICONV = @GNULIB_ICONV@ +GNULIB_IMAXABS = @GNULIB_IMAXABS@ +GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ +GNULIB_IOCTL = @GNULIB_IOCTL@ +GNULIB_ISATTY = @GNULIB_ISATTY@ +GNULIB_ISBLANK = @GNULIB_ISBLANK@ +GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ +GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LINKAT = @GNULIB_LINKAT@ +GNULIB_LISTEN = @GNULIB_LISTEN@ +GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ +GNULIB_LOCALTIME = @GNULIB_LOCALTIME@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MBTOWC = @GNULIB_MBTOWC@ +GNULIB_MEMCHR = @GNULIB_MEMCHR@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKFIFO = @GNULIB_MKFIFO@ +GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ +GNULIB_MKNOD = @GNULIB_MKNOD@ +GNULIB_MKNODAT = @GNULIB_MKNODAT@ +GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ +GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ +GNULIB_MKTIME = @GNULIB_MKTIME@ +GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ +GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ +GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_OPENAT = @GNULIB_OPENAT@ +GNULIB_OVERRIDES_STRUCT_STAT = @GNULIB_OVERRIDES_STRUCT_STAT@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ +GNULIB_PCLOSE = @GNULIB_PCLOSE@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PIPE = @GNULIB_PIPE@ +GNULIB_PIPE2 = @GNULIB_PIPE2@ +GNULIB_POPEN = @GNULIB_POPEN@ +GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ +GNULIB_PREAD = @GNULIB_PREAD@ +GNULIB_PRINTF = @GNULIB_PRINTF@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PSELECT = @GNULIB_PSELECT@ +GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ +GNULIB_PTSNAME = @GNULIB_PTSNAME@ +GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ +GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ +GNULIB_RAISE = @GNULIB_RAISE@ +GNULIB_RANDOM = @GNULIB_RANDOM@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ +GNULIB_READ = @GNULIB_READ@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_READLINKAT = @GNULIB_READLINKAT@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_REALPATH = @GNULIB_REALPATH@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ +GNULIB_REMOVE = @GNULIB_REMOVE@ +GNULIB_RENAME = @GNULIB_RENAME@ +GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ +GNULIB_RMDIR = @GNULIB_RMDIR@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SCANF = @GNULIB_SCANF@ +GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ +GNULIB_SELECT = @GNULIB_SELECT@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ +GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ +GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ +GNULIB_SIGACTION = @GNULIB_SIGACTION@ +GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ +GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STAT = @GNULIB_STAT@ +GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ +GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ +GNULIB_STRFTIME = @GNULIB_STRFTIME@ +GNULIB_STRNCAT = @GNULIB_STRNCAT@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRPTIME = @GNULIB_STRPTIME@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ +GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ +GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ +GNULIB_SYMLINK = @GNULIB_SYMLINK@ +GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ +GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ +GNULIB_TIMEGM = @GNULIB_TIMEGM@ +GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ +GNULIB_TMPFILE = @GNULIB_TMPFILE@ +GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ +GNULIB_TRUNCATE = @GNULIB_TRUNCATE@ +GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ +GNULIB_TZSET = @GNULIB_TZSET@ +GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ +GNULIB_UNLINK = @GNULIB_UNLINK@ +GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ +GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ +GNULIB_USLEEP = @GNULIB_USLEEP@ +GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VFSCANF = @GNULIB_VFSCANF@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSCANF = @GNULIB_VSCANF@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WAITPID = @GNULIB_WAITPID@ +GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@ +GNULIB_WCPCPY = @GNULIB_WCPCPY@ +GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ +GNULIB_WCSCAT = @GNULIB_WCSCAT@ +GNULIB_WCSCHR = @GNULIB_WCSCHR@ +GNULIB_WCSCMP = @GNULIB_WCSCMP@ +GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ +GNULIB_WCSCPY = @GNULIB_WCSCPY@ +GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ +GNULIB_WCSDUP = @GNULIB_WCSDUP@ +GNULIB_WCSFTIME = @GNULIB_WCSFTIME@ +GNULIB_WCSLEN = @GNULIB_WCSLEN@ +GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ +GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ +GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ +GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ +GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ +GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCSSPN = @GNULIB_WCSSPN@ +GNULIB_WCSSTR = @GNULIB_WCSSTR@ +GNULIB_WCSTOK = @GNULIB_WCSTOK@ +GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ +GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ +GNULIB_WCTOB = @GNULIB_WCTOB@ +GNULIB_WCTOMB = @GNULIB_WCTOMB@ +GNULIB_WCTRANS = @GNULIB_WCTRANS@ +GNULIB_WCTYPE = @GNULIB_WCTYPE@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ +GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ +GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ +GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ +GNULIB_WMEMSET = @GNULIB_WMEMSET@ +GNULIB_WRITE = @GNULIB_WRITE@ +GNULIB__EXIT = @GNULIB__EXIT@ +HAVE_ACCEPT4 = @HAVE_ACCEPT4@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ +HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ +HAVE_CHOWN = @HAVE_CHOWN@ +HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ +HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ +HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ +HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ +HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ +HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ +HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ +HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_DUP3 = @HAVE_DUP3@ +HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_FACCESSAT = @HAVE_FACCESSAT@ +HAVE_FCHDIR = @HAVE_FCHDIR@ +HAVE_FCHMODAT = @HAVE_FCHMODAT@ +HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FCNTL = @HAVE_FCNTL@ +HAVE_FDATASYNC = @HAVE_FDATASYNC@ +HAVE_FEATURES_H = @HAVE_FEATURES_H@ +HAVE_FFS = @HAVE_FFS@ +HAVE_FFSL = @HAVE_FFSL@ +HAVE_FFSLL = @HAVE_FFSLL@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSTATAT = @HAVE_FSTATAT@ +HAVE_FSYNC = @HAVE_FSYNC@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_FUTIMENS = @HAVE_FUTIMENS@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETGROUPS = @HAVE_GETGROUPS@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ +HAVE_GETLOGIN = @HAVE_GETLOGIN@ +HAVE_GETOPT_H = @HAVE_GETOPT_H@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ +HAVE_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISBLANK = @HAVE_ISBLANK@ +HAVE_ISWBLANK = @HAVE_ISWBLANK@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ +HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ +HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ +HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ +HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LCHOWN = @HAVE_LCHOWN@ +HAVE_LIBSIGSEGV = @HAVE_LIBSIGSEGV@ +HAVE_LINK = @HAVE_LINK@ +HAVE_LINKAT = @HAVE_LINKAT@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSLEN = @HAVE_MBSLEN@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ +HAVE_MEMCHR = @HAVE_MEMCHR@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDIRAT = @HAVE_MKDIRAT@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_MKFIFO = @HAVE_MKFIFO@ +HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ +HAVE_MKNOD = @HAVE_MKNOD@ +HAVE_MKNODAT = @HAVE_MKNODAT@ +HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ +HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ +HAVE_MKSTEMP = @HAVE_MKSTEMP@ +HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ +HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ +HAVE_OPENAT = @HAVE_OPENAT@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_PCLOSE = @HAVE_PCLOSE@ +HAVE_PIPE = @HAVE_PIPE@ +HAVE_PIPE2 = @HAVE_PIPE2@ +HAVE_POPEN = @HAVE_POPEN@ +HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ +HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_PREAD = @HAVE_PREAD@ +HAVE_PSELECT = @HAVE_PSELECT@ +HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ +HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ +HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ +HAVE_RAISE = @HAVE_RAISE@ +HAVE_RANDOM = @HAVE_RANDOM@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_READLINKAT = @HAVE_READLINKAT@ +HAVE_REALPATH = @HAVE_REALPATH@ +HAVE_RENAMEAT = @HAVE_RENAMEAT@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ +HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SIGACTION = @HAVE_SIGACTION@ +HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ +HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ +HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ +HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ +HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_SIGSET_T = @HAVE_SIGSET_T@ +HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STPCPY = @HAVE_STPCPY@ +HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ +HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRINGS_H = @HAVE_STRINGS_H@ +HAVE_STRPBRK = @HAVE_STRPBRK@ +HAVE_STRPTIME = @HAVE_STRPTIME@ +HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ +HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ +HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ +HAVE_SYMLINK = @HAVE_SYMLINK@ +HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@ +HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ +HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ +HAVE_TRUNCATE = @HAVE_TRUNCATE@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ +HAVE_TZSET = @HAVE_TZSET@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNLINKAT = @HAVE_UNLINKAT@ +HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_USLEEP = @HAVE_USLEEP@ +HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCHAR_T = @HAVE_WCHAR_T@ +HAVE_WCPCPY = @HAVE_WCPCPY@ +HAVE_WCPNCPY = @HAVE_WCPNCPY@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ +HAVE_WCSCAT = @HAVE_WCSCAT@ +HAVE_WCSCHR = @HAVE_WCSCHR@ +HAVE_WCSCMP = @HAVE_WCSCMP@ +HAVE_WCSCOLL = @HAVE_WCSCOLL@ +HAVE_WCSCPY = @HAVE_WCSCPY@ +HAVE_WCSCSPN = @HAVE_WCSCSPN@ +HAVE_WCSDUP = @HAVE_WCSDUP@ +HAVE_WCSFTIME = @HAVE_WCSFTIME@ +HAVE_WCSLEN = @HAVE_WCSLEN@ +HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ +HAVE_WCSNCAT = @HAVE_WCSNCAT@ +HAVE_WCSNCMP = @HAVE_WCSNCMP@ +HAVE_WCSNCPY = @HAVE_WCSNCPY@ +HAVE_WCSNLEN = @HAVE_WCSNLEN@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSPBRK = @HAVE_WCSPBRK@ +HAVE_WCSRCHR = @HAVE_WCSRCHR@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ +HAVE_WCSSPN = @HAVE_WCSSPN@ +HAVE_WCSSTR = @HAVE_WCSSTR@ +HAVE_WCSTOK = @HAVE_WCSTOK@ +HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ +HAVE_WCSXFRM = @HAVE_WCSXFRM@ +HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE_WMEMCHR = @HAVE_WMEMCHR@ +HAVE_WMEMCMP = @HAVE_WMEMCMP@ +HAVE_WMEMCPY = @HAVE_WMEMCPY@ +HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ +HAVE_WMEMSET = @HAVE_WMEMSET@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ +HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ +HAVE__BOOL = @HAVE__BOOL@ +HAVE__EXIT = @HAVE__EXIT@ +HELP2MAN = @HELP2MAN@ +ICONV_CONST = @ICONV_CONST@ +ICONV_H = @ICONV_H@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ +INET_PTON_LIB = @INET_PTON_LIB@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ +INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBCSTACK = @LIBCSTACK@ +LIBDIFFUTILS_LIBDEPS = @LIBDIFFUTILS_LIBDEPS@ +LIBDIFFUTILS_LTLIBDEPS = @LIBDIFFUTILS_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSIGSEGV = @LIBSIGSEGV@ +LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@ +LIBSOCKET = @LIBSOCKET@ +LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ +LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@ +LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@ +LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIB_NANOSLEEP = @LIB_NANOSLEEP@ +LIB_SELECT = @LIB_SELECT@ +LIMITS_H = @LIMITS_H@ +LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ +LTLIBCSTACK = @LTLIBCSTACK@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBSIGSEGV = @LTLIBSIGSEGV@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ +NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@ +NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ +NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ +NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@ +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ +NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ +NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ +NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ +NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ +NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ +NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ +NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@ +NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@ +NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ +NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ +NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ +NEXT_CTYPE_H = @NEXT_CTYPE_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_ICONV_H = @NEXT_ICONV_H@ +NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ +NEXT_LOCALE_H = @NEXT_LOCALE_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ +NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_STDARG_H = @NEXT_STDARG_H@ +NEXT_STDDEF_H = @NEXT_STDDEF_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ +NEXT_STDIO_H = @NEXT_STDIO_H@ +NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRINGS_H = @NEXT_STRINGS_H@ +NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@ +NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@ +NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ +NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ +NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ +NEXT_TIME_H = @NEXT_TIME_H@ +NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ +NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSUB = @POSUB@ +PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ +PR_PROGRAM = @PR_PROGRAM@ +PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ +REPLACE_CALLOC = @REPLACE_CALLOC@ +REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_CTIME = @REPLACE_CTIME@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ +REPLACE_DUP = @REPLACE_DUP@ +REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ +REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FCNTL = @REPLACE_FCNTL@ +REPLACE_FDOPEN = @REPLACE_FDOPEN@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FSTAT = @REPLACE_FSTAT@ +REPLACE_FSTATAT = @REPLACE_FSTATAT@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ +REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETDELIM = @REPLACE_GETDELIM@ +REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ +REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@ +REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_GMTIME = @REPLACE_GMTIME@ +REPLACE_ICONV = @REPLACE_ICONV@ +REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@ +REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@ +REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ +REPLACE_INET_PTON = @REPLACE_INET_PTON@ +REPLACE_IOCTL = @REPLACE_IOCTL@ +REPLACE_ISATTY = @REPLACE_ISATTY@ +REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ +REPLACE_ITOLD = @REPLACE_ITOLD@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LINK = @REPLACE_LINK@ +REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ +REPLACE_LOCALTIME = @REPLACE_LOCALTIME@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MALLOC = @REPLACE_MALLOC@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MBTOWC = @REPLACE_MBTOWC@ +REPLACE_MEMCHR = @REPLACE_MEMCHR@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKDIR = @REPLACE_MKDIR@ +REPLACE_MKFIFO = @REPLACE_MKFIFO@ +REPLACE_MKNOD = @REPLACE_MKNOD@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_MKTIME = @REPLACE_MKTIME@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ +REPLACE_NULL = @REPLACE_NULL@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ +REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POPEN = @REPLACE_POPEN@ +REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PSELECT = @REPLACE_PSELECT@ +REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ +REPLACE_PTSNAME = @REPLACE_PTSNAME@ +REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ +REPLACE_RAISE = @REPLACE_RAISE@ +REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ +REPLACE_READ = @REPLACE_READ@ +REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ +REPLACE_REALLOC = @REPLACE_REALLOC@ +REPLACE_REALPATH = @REPLACE_REALPATH@ +REPLACE_REMOVE = @REPLACE_REMOVE@ +REPLACE_RENAME = @REPLACE_RENAME@ +REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ +REPLACE_RMDIR = @REPLACE_RMDIR@ +REPLACE_SELECT = @REPLACE_SELECT@ +REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ +REPLACE_SLEEP = @REPLACE_SLEEP@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STAT = @REPLACE_STAT@ +REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ +REPLACE_STPNCPY = @REPLACE_STPNCPY@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ +REPLACE_STRDUP = @REPLACE_STRDUP@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ +REPLACE_STRFTIME = @REPLACE_STRFTIME@ +REPLACE_STRNCAT = @REPLACE_STRNCAT@ +REPLACE_STRNDUP = @REPLACE_STRNDUP@ +REPLACE_STRNLEN = @REPLACE_STRNLEN@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ +REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ +REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ +REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ +REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ +REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TMPFILE = @REPLACE_TMPFILE@ +REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ +REPLACE_TRUNCATE = @REPLACE_TRUNCATE@ +REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ +REPLACE_TZSET = @REPLACE_TZSET@ +REPLACE_UNLINK = @REPLACE_UNLINK@ +REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ +REPLACE_UNSETENV = @REPLACE_UNSETENV@ +REPLACE_USLEEP = @REPLACE_USLEEP@ +REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSFTIME = @REPLACE_WCSFTIME@ +REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ +REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCTOMB = @REPLACE_WCTOMB@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SRC_VERSION_C = @SRC_VERSION_C@ +STDALIGN_H = @STDALIGN_H@ +STDARG_H = @STDARG_H@ +STDBOOL_H = @STDBOOL_H@ +STDDEF_H = @STDDEF_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@ +SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ +UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ +UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WERROR_CFLAGS = @WERROR_CFLAGS@ +WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ +WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@ +WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_aux_dir = @abs_aux_dir@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__rm_f_notfound = @am__rm_f_notfound@ +am__tar = @am__tar@ +am__untar = @am__untar@ +am__xargs_n = @am__xargs_n@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ +gltests_WITNESS = @gltests_WITNESS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +lispdir = @lispdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +TESTS = \ + basic \ + bignum \ + binary \ + brief-vs-stat-zero-kernel-lies \ + cmp \ + colliding-file-names \ + diff3 \ + excess-slash \ + help-version \ + invalid-re \ + function-line-vs-leading-space \ + ignore-matching-lines \ + label-vs-func \ + new-file \ + no-dereference \ + no-newline-at-eof \ + stdin \ + strcoll-0-names \ + filename-quoting \ + colors + +EXTRA_DIST = \ + $(TESTS) init.sh t-local.sh envvar-check + + +# Note that the first lines are statements. They ensure that environment +# variables that can perturb tests are unset or set to expected values. +# The rest are envvar settings that propagate build-related Makefile +# variables to test scripts. +TESTS_ENVIRONMENT = \ + tmp__=$${TMPDIR-/tmp}; \ + test -d "$$tmp__" && test -w "$$tmp__" || tmp__=.; \ + . $(srcdir)/envvar-check; \ + TMPDIR=$$tmp__; export TMPDIR; \ + \ + if test -n "$$BASH_VERSION" || (eval "export v=x") 2>/dev/null; then \ + export_with_values () { export "$$@"; }; \ + else \ + export_with_values () \ + { \ + sed_extract_var='s/=.*//'; \ + sed_quote_value="s/'/'\\\\''/g;s/=\\(.*\\)/='\\1'/";\ + for arg in "$$@"; do \ + var=`echo "$$arg" | sed "$$sed_extract_var"`; \ + arg=`echo "$$arg" | sed "$$sed_quote_value"`; \ + eval "$$arg"; \ + export "$$var"; \ + done; \ + }; \ + fi; \ + \ + export_with_values \ + VERSION='$(VERSION)' \ + LOCALE_FR='$(LOCALE_FR)' \ + LOCALE_FR_UTF8='$(LOCALE_FR_UTF8)' \ + AWK=$(AWK) \ + GREP_OPTIONS='' \ + LC_ALL=C \ + abs_top_builddir='$(abs_top_builddir)' \ + abs_top_srcdir='$(abs_top_srcdir)' \ + abs_srcdir='$(abs_srcdir)' \ + built_programs="`$(built_programs)`" \ + srcdir='$(srcdir)' \ + top_srcdir='$(top_srcdir)' \ + CC='$(CC)' \ + DIFFUTILS_TEST_NAME=`echo $$tst|sed 's,^\./,,;s,/,-,g'` \ + MAKE=$(MAKE) \ + MALLOC_PERTURB_=$(MALLOC_PERTURB_) \ + PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)' \ + PACKAGE_VERSION=$(PACKAGE_VERSION) \ + PERL='$(PERL)' \ + SHELL='$(SHELL)' \ + PREFERABLY_POSIX_SHELL='$(PREFERABLY_POSIX_SHELL)' \ + REPLACE_GETCWD=$(REPLACE_GETCWD) \ + PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH" \ + stderr_fileno_=9 \ + ; 9>&2 + +LOG_COMPILER = $(SHELL) +built_programs = \ + echo 'spy:;@echo $$(PROGRAMS)' \ + | { (cd ../src && MAKEFLAGS= $(MAKE) -s -f Makefile -f - spy) \ + | tr ' ' '\n' \ + | sed '/^$$/d; s,$(EXEEXT)$$,,' \ + | sort -u \ + | tr '\n' ' '; echo; } \ + | sed 's/ $$//' + +VERBOSE = yes +all: all-am + +.SUFFIXES: +.SUFFIXES: .log .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + output_system_information () \ + { \ + echo; \ + { uname -a | $(AWK) '{ \ + printf "System information (uname -a):"; \ + for (i = 1; i < NF; ++i) \ + { \ + if (i != 2) \ + printf " %s", $$i; \ + } \ + printf "\n"; \ +}'; } 2>&1; \ + if test -r /etc/os-release; then \ + echo "Distribution information (/etc/os-release):"; \ + sed 8q /etc/os-release; \ + elif test -r /etc/issue; then \ + echo "Distribution information (/etc/issue):"; \ + cat /etc/issue; \ + fi; \ + }; \ + please_report () \ + { \ +echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \ +echo "together with the test-suite.log file (gzipped) and your system"; \ +echo "information. Thanks."; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + output_system_information; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @$(am__rm_f) $(RECHECK_LOGS) + @$(am__rm_f) $(RECHECK_LOGS:.log=.trs) + @$(am__rm_f) $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all + @$(am__rm_f) $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +basic.log: basic + @p='basic'; \ + b='basic'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +bignum.log: bignum + @p='bignum'; \ + b='bignum'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +binary.log: binary + @p='binary'; \ + b='binary'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +brief-vs-stat-zero-kernel-lies.log: brief-vs-stat-zero-kernel-lies + @p='brief-vs-stat-zero-kernel-lies'; \ + b='brief-vs-stat-zero-kernel-lies'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +cmp.log: cmp + @p='cmp'; \ + b='cmp'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +colliding-file-names.log: colliding-file-names + @p='colliding-file-names'; \ + b='colliding-file-names'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +diff3.log: diff3 + @p='diff3'; \ + b='diff3'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +excess-slash.log: excess-slash + @p='excess-slash'; \ + b='excess-slash'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +help-version.log: help-version + @p='help-version'; \ + b='help-version'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +invalid-re.log: invalid-re + @p='invalid-re'; \ + b='invalid-re'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +function-line-vs-leading-space.log: function-line-vs-leading-space + @p='function-line-vs-leading-space'; \ + b='function-line-vs-leading-space'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +ignore-matching-lines.log: ignore-matching-lines + @p='ignore-matching-lines'; \ + b='ignore-matching-lines'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +label-vs-func.log: label-vs-func + @p='label-vs-func'; \ + b='label-vs-func'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +new-file.log: new-file + @p='new-file'; \ + b='new-file'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +no-dereference.log: no-dereference + @p='no-dereference'; \ + b='no-dereference'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +no-newline-at-eof.log: no-newline-at-eof + @p='no-newline-at-eof'; \ + b='no-newline-at-eof'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +stdin.log: stdin + @p='stdin'; \ + b='stdin'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +strcoll-0-names.log: strcoll-0-names + @p='strcoll-0-names'; \ + b='strcoll-0-names'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +filename-quoting.log: filename-quoting + @p='filename-quoting'; \ + b='filename-quoting'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +colors.log: colors + @p='colors'; \ + b='colors'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -$(am__rm_f) $(TEST_LOGS) + -$(am__rm_f) $(TEST_LOGS:.log=.trs) + -$(am__rm_f) $(TEST_SUITE_LOG) + +clean-generic: + +distclean-generic: + -$(am__rm_f) $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-TESTS check-am clean clean-generic \ + cscopelist-am ctags-am distclean distclean-generic distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am recheck tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: + +# Tell GNU make to disable its built-in pattern rules. +%:: %,v +%:: RCS/%,v +%:: RCS/% +%:: s.% +%:: SCCS/s.% diff --git a/local/recipes/tools/diffutils/source/tests/basic b/local/recipes/tools/diffutils/source/tests/basic new file mode 100755 index 0000000000..161262d6b5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/basic @@ -0,0 +1,42 @@ +#!/bin/sh +# small examples + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +fail=0 + +cat <<EOF > exp- || fail=1 +1c1 +< a +--- +> b +EOF + +cat <<EOF > exp--u || fail=1 +--- a ++++ b +@@ -1 +1 @@ +-a ++b +EOF + +cat <<EOF > exp--c || fail=1 +*** a +--- b +*************** +*** 1 **** +! a +--- 1 ---- +! b +EOF + +echo a > a +echo b > b +for opt in '' -u -c; do + returns_ 1 diff $opt a b > out 2> err || fail=1 + # Remove date and time. + sed -e 's/^\([-+*][-+*][-+*] [^ ]*\) .*/\1/' out > k; mv k out + compare exp-$(echo $opt|tr ' ' _) out || fail=1 +done + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/bignum b/local/recipes/tools/diffutils/source/tests/bignum new file mode 100755 index 0000000000..a0c95f61ae --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/bignum @@ -0,0 +1,14 @@ +#!/bin/sh +# big numbers + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +fail=0 + +for tabsize in 2147483648 9223372036854775808; do + diff --tabsize=$tabsize /dev/null /dev/null + status=$? + test $status -eq 0 || test $status -eq 2 || fail=1 +done + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/binary b/local/recipes/tools/diffutils/source/tests/binary new file mode 100755 index 0000000000..36fbe2d8d9 --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/binary @@ -0,0 +1,15 @@ +#!/bin/sh +# small examples + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +printf 'Binary files - and /dev/null differ\n' > out-exp || fail_ setup + +fail=0 + +# diff must exit with status 1, stdout as above, and no stderr. +printf '\0'| returns_ 1 diff - /dev/null > out 2> err || fail=1 +compare out-exp out || fail=1 +compare /dev/null err || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/brief-vs-stat-zero-kernel-lies b/local/recipes/tools/diffutils/source/tests/brief-vs-stat-zero-kernel-lies new file mode 100755 index 0000000000..82b33e68fb --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/brief-vs-stat-zero-kernel-lies @@ -0,0 +1,38 @@ +#!/bin/sh +# Before diff-3.4, diff --brief could mistakenly declare a difference. +# For example, when comparing a file like /proc/cmdline (for which the linux +# kernel reports a st_size of 0 even though it is not an empty file) to a +# copy of that file's contents residing on a "normal" file system. + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +fail=0 + +# Skip the test unless we have an appropriate file. +boot=/proc/cmdline +test -r $boot || skip_ no $boot file +sz=$(stat --format %s $boot) || skip_ stat --format %s does not work +test $sz = 0 || skip_ $boot has nonzero size + +# /proc/self is not useful on the Hurd, where it always points to "1", +# so skip this test when /proc/self does not point to a file whose name is +# the current process ID. +readlink /proc/self > pid & pid=$! +wait $pid +echo $pid > exp +compare exp pid || skip_ /proc/self is not useful on this system + +# There are two code paths to test: one for non-binary and one for binary files. +# $boot is non-binary. +cat $boot > ref || framework_failure_ +diff --brief $boot ref > out 2>&1 || fail=1 +compare /dev/null out || fail=1 + +# /proc/self/cmdline is a NUL-terminated list of argv values, +# so construct the expected output here: +printf 'diff\0--brief\0/proc/self/cmdline\0bin\0' > bin || framework_failure_ +# And run the command that is embedded in that output: +diff --brief /proc/self/cmdline bin > out 2>&1 || fail=1 +compare /dev/null out || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/cmp b/local/recipes/tools/diffutils/source/tests/cmp new file mode 100755 index 0000000000..082a931db9 --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/cmp @@ -0,0 +1,211 @@ +#!/bin/sh +# Test 'cmp'. + +# Copyright 2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +fail=0 + +cat <<'EOF' > exp || fail=1 +cmp a a +0 +cmp a b +a b differ: char 1, line 1 +1 +cmp a c +cmp: EOF on c which is empty +1 +cmp a d +cmp: d: No such file or directory +2 +cmp b a +b a differ: char 1, line 1 +1 +cmp b b +0 +cmp b c +cmp: EOF on c which is empty +1 +cmp b d +cmp: d: No such file or directory +2 +cmp c a +cmp: EOF on c which is empty +1 +cmp c b +cmp: EOF on c which is empty +1 +cmp c c +0 +cmp c d +cmp: d: No such file or directory +2 +cmp d a +cmp: d: No such file or directory +2 +cmp d b +cmp: d: No such file or directory +2 +cmp d c +cmp: d: No such file or directory +2 +cmp d d +cmp: d: No such file or directory +2 +cmp -l a a +0 +cmp -l a b +1 141 142 +1 +cmp -l a c +cmp: EOF on c which is empty +1 +cmp -l a d +cmp: d: No such file or directory +2 +cmp -l b a +1 142 141 +1 +cmp -l b b +0 +cmp -l b c +cmp: EOF on c which is empty +1 +cmp -l b d +cmp: d: No such file or directory +2 +cmp -l c a +cmp: EOF on c which is empty +1 +cmp -l c b +cmp: EOF on c which is empty +1 +cmp -l c c +0 +cmp -l c d +cmp: d: No such file or directory +2 +cmp -l d a +cmp: d: No such file or directory +2 +cmp -l d b +cmp: d: No such file or directory +2 +cmp -l d c +cmp: d: No such file or directory +2 +cmp -l d d +cmp: d: No such file or directory +2 +cmp -s a a +0 +cmp -s a b +1 +cmp -s a c +1 +cmp -s a d +2 +cmp -s b a +1 +cmp -s b b +0 +cmp -s b c +1 +cmp -s b d +2 +cmp -s c a +1 +cmp -s c b +1 +cmp -s c c +0 +cmp -s c d +2 +cmp -s d a +2 +cmp -s d b +2 +cmp -s d c +2 +cmp -s d d +2 +EOF + +echo a >a +echo b >b +: >c +rm -f d + +for option in '' -l -s; do + for i in a b c d; do + for j in a b c d; do + echo cmp $option $i $j + cmp $option $i $j >stdout 2>stderr + status=$? + cat stderr stdout + echo $status + done + done +done >out + +compare exp out || fail=1 + +cat <<'EOF' > exp1 || fail=1 +cmp a0 a1 +cmp: EOF on a0 which is empty +1 +cmp a1 a2 +cmp: EOF on a1 after byte 2, line 1 +1 +cmp a2 a3 +cmp: EOF on a2 after byte 5, in line 2 +1 +cmp -l a0 a1 +cmp: EOF on a0 which is empty +1 +cmp -l a1 a2 +cmp: EOF on a1 after byte 2 +1 +cmp -l a2 a3 +cmp: EOF on a2 after byte 5 +1 +cmp -s a0 a1 +1 +cmp -s a1 a2 +1 +cmp -s a2 a3 +1 +EOF + +printf '' >a0 +printf '1\n' >a1 +printf '1\nfoo' >a2 +printf '1\nfoolery\n' >a3 + +for option in '' -l -s; do + for files in 'a0 a1' 'a1 a2' 'a2 a3'; do + echo cmp $option $files + cmp $option $files >stdout 2>stderr + status=$? + cat stderr stdout + echo $status + done +done >out1 + +compare exp1 out1 || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/colliding-file-names b/local/recipes/tools/diffutils/source/tests/colliding-file-names new file mode 100755 index 0000000000..964d026f07 --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/colliding-file-names @@ -0,0 +1,19 @@ +#!/bin/sh +# Check that diff responds well if a directory has multiple file names +# that compare equal. + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +mkdir d1 d2 || fail=1 + +for i in abc abC aBc aBC; do + echo xyz >d1/$i || fail=1 +done + +for i in ABC ABc AbC Abc; do + echo xyz >d2/$i || fail=1 +done + +diff -r --ignore-file-name-case d1 d2 || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/colors b/local/recipes/tools/diffutils/source/tests/colors new file mode 100755 index 0000000000..9c7021cc81 --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/colors @@ -0,0 +1,128 @@ +#!/bin/sh + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +TZ=UTC0 +export TZ + +fail=0 + +echo a > a +echo b > b + +epoch='1970-01-01 00:00:00' +touch -t 197001010000.00 a b + +e=$(printf '\033') +tab=$(printf '\t') + +gen_exp_u() +{ + local epoch_plus="$epoch.000000000 +0000" + local rs=$(printf "$e[${rs}m") + local hd=$(printf "$e[${hd}m") + local ad=$(printf "$e[${ad}m") + local de=$(printf "$e[${de}m") + local ln=$(printf "$e[${ln}m") + printf '%s' \ +"$hd--- a$tab$epoch_plus ++++ b$tab$epoch_plus +$rs${ln}@@ -1 +1 @@$rs +$de-a$rs +$ad+b$rs +" +} + +gen_exp_c() +{ + local epoch_posix_1003_1_2001="Thu Jan 1 00:00:00 1970" + local rs=$(printf "$e[${rs}m") + local hd=$(printf "$e[${hd}m") + local ad=$(printf "$e[${ad}m") + local de=$(printf "$e[${de}m") + local ln=$(printf "$e[${ln}m") + printf '%s' \ +"$hd*** a$tab$epoch_posix_1003_1_2001 +--- b$tab$epoch_posix_1003_1_2001 +$rs*************** +$ln*** 1 ****$rs +$de! a$rs +$ln--- 1 ----$rs +$ad! b$rs +" +} + +gen_exp_default() +{ + printf '%s' \ +"1c1 +< a +--- +> b +" +} + +gen_exp_default_colors() +{ + local rs=$(printf "$e[${rs}m") + local hd=$(printf "$e[${hd}m") + local ad=$(printf "$e[${ad}m") + local de=$(printf "$e[${de}m") + local ln=$(printf "$e[${ln}m") + printf '%s' \ +"${ln}1c1$rs +$de< a$rs +--- +$ad> b$rs +" +} + +# Compare with some known outputs + +rs=0 hd=1 ad=32 de=31 ln=36 + +returns_ 1 diff --color=auto a b > out || fail=1 +gen_exp_default > exp || framework_failure_ +compare exp out || fail=1 + +returns_ 1 env TERM=dumb diff ---presume-output-tty --color=auto a b > out \ + || fail=1 +gen_exp_default > exp || framework_failure_ +compare exp out || fail=1 + +returns_ 1 diff --color=never a b > out || fail=1 +gen_exp_default > exp || framework_failure_ +compare exp out || fail=1 + +returns_ 1 diff a b > out || fail=1 +gen_exp_default > exp || framework_failure_ +compare exp out || fail=1 + +returns_ 1 diff --color=always a b > out || fail=1 +gen_exp_default_colors > exp || framework_failure_ +compare exp out || fail=1 + +returns_ 1 diff -u --color=always a b > out || fail=1 +gen_exp_u > exp || framework_failure_ +compare exp out || fail=1 + +returns_ 1 diff -c --color=always a b > out || fail=1 +gen_exp_c > exp || framework_failure_ +compare exp out || fail=1 + +rs=0 hd=33 ad=34 de=35 ln=36 +returns_ 1 diff -u --color=always \ + --palette="rs=0:hd=33:ad=34:de=35:ln=36" a b > out || fail=1 +gen_exp_u > exp || framework_failure_ +compare exp out || fail=1 + +# Before the fix in http://debbugs.gnu.org/22067, +# this test would trigger an infinite loop bug. +mkfifo fifo +printf '%*s-a' 1000000 > a +printf '%*s-b' 1000000 > b +head -c 10 < fifo > /dev/null & +diff --color=always ---presume-output-tty a b > fifo +test $? = 141 || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/diff3 b/local/recipes/tools/diffutils/source/tests/diff3 new file mode 100644 index 0000000000..b591751fa5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/diff3 @@ -0,0 +1,108 @@ +#!/bin/sh +# This would malfunction in diff-3.4 + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +# Some systems lack seq. +# A limited replacement for seq: handle 1 or 2 args; increment must be 1 +seq() +{ + case $# in + 1) start=1 final=$1;; + 2) start=$1 final=$2;; + *) echo you lose 1>&2; exit 1;; + esac + awk 'BEGIN{for(i='$start';i<='$final';i++) print i}' < /dev/null +} + +echo a > a || framework_failure_ +echo b > b || framework_failure_ +echo c > c || framework_failure_ +cat <<'EOF' > exp || framework_failure_ +==== +1:1c + a +2:1c + b +3:1c + c +EOF + +fail=0 + +diff3 a b c > out 2> err || fail=1 +compare exp out || fail=1 +compare /dev/null err || fail=1 + +# Repeat, but with all three files the same: +diff3 a a a > out 2> err || fail=1 +compare /dev/null out || fail=1 +compare /dev/null err || fail=1 + +# This would have provoked a nontrivial leak prior to diffutils-3.5, +# due to the nontrivial list of diff_block structs. +seq 10 40|sed 's/1$/x/' > d || framework_failure_ +seq 10 40|sed 's/5$/y/' > e || framework_failure_ +seq 10 40|sed 's/8$/z/' > f || framework_failure_ +cat <<'EOF' > exp40 || framework_failure_ +====1 +1:2c + 1x +2:2c +3:2c + 11 +====2 +1:6c +3:6c + 15 +2:6c + 1y +====3 +1:9c +2:9c + 18 +3:9c + 1z +====1 +1:12c + 2x +2:12c +3:12c + 21 +====2 +1:16c +3:16c + 25 +2:16c + 2y +====3 +1:19c +2:19c + 28 +3:19c + 2z +====1 +1:22c + 3x +2:22c +3:22c + 31 +====2 +1:26c +3:26c + 35 +2:26c + 3y +====3 +1:29c +2:29c + 38 +3:29c + 3z +EOF + +diff3 d e f > out 2> err +compare exp40 out || fail=1 +compare /dev/null err || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/envvar-check b/local/recipes/tools/diffutils/source/tests/envvar-check new file mode 100644 index 0000000000..e602485504 --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/envvar-check @@ -0,0 +1,65 @@ +# -*- sh -*- +# Check environment variables for sane values while testing. + +# Copyright (C) 2000-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +envvar_check_fail=0 +vars=' + _POSIX2_VERSION + _STDBUF_E + _STDBUF_I + _STDBUF_O + BASH_ENV + BLOCKSIZE + BLOCK_SIZE + CDPATH + COLUMNS + DF_BLOCK_SIZE + DU_BLOCK_SIZE + EDITOR + ENV + GREP_OPTIONS + LANGUAGE + LS_BLOCK_SIZE + LS_COLORS + OMP_NUM_THREADS + POSIXLY_CORRECT + QUOTING_STYLE + SIMPLE_BACKUP_SUFFIX + TABSIZE + TERM + COLORTERM + TIME_STYLE + TMPDIR + VERSION_CONTROL +' +for var in $vars +do + $as_unset $var + if eval test \"\${$var+set}\" = set; then + echo "$0: the $var environment variable is set --" \ + ' unset it and rerun this test' >&2 + envvar_check_fail=1 + fi +done + +test "$envvar_check_fail" = 1 && exit 1 diff --git a/local/recipes/tools/diffutils/source/tests/excess-slash b/local/recipes/tools/diffutils/source/tests/excess-slash new file mode 100755 index 0000000000..22c2060e6d --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/excess-slash @@ -0,0 +1,18 @@ +#!/bin/sh +# Ensure that no excess slash appears in diff -r output. + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +mkdir -p a/f b/f/g || framework_failure_ +echo Only in b/f: g > expected-out || framework_failure_ + +fail=0 + +diff -r a b/ > out 2> err && fail=1 + +# expect no stderr +compare /dev/null err || fail=1 + +compare expected-out out || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/filename-quoting b/local/recipes/tools/diffutils/source/tests/filename-quoting new file mode 100755 index 0000000000..2e75a0370e --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/filename-quoting @@ -0,0 +1,61 @@ +#!/bin/sh +# filename quoting + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +fail=0 + +cat <<EOF > exp- || fail=1 +diff -N -r "a/ " "b/ " +0a1 +> space +EOF + +cat <<EOF > exp--u || fail=1 +diff -N -r -u "a/ " "b/ " +--- "a/ " ++++ "b/ " +@@ -0,0 +1 @@ ++space +EOF + +cat <<EOF > exp--c || fail=1 +diff -N -r -c "a/ " "b/ " +*** "a/ " +--- "b/ " +*************** +*** 0 **** +--- 1 ---- ++ space +EOF + +mkdir a b +echo space > "b/ " || fail=1 +for opt in '' -u -c; do + returns_ 1 diff -N -r $opt a b > out 2> err || fail=1 + # Remove date and time. + sed -e 's/^\([-+*][-+*][-+*] [^ ]*\) .*/\1/' out > k; mv k out + compare exp-$(echo $opt|tr ' ' _) out || fail=1 +done + +rm -f "b/ " + +cat <<EOF > exp || fail=1 +--- "a/\t" ++++ "b/\001" +@@ -1 +1 @@ +-tab ++one +EOF + +tab=$(printf '\t') +x01=$(printf '\001') + +echo tab > "a/$tab" || fail=1 +echo one > "b/$x01" || fail=1 +returns_ 1 diff -u "a/$tab" "b/$x01" > out 2> err || fail=1 +# Remove date and time. +sed -e 's/^\([-+*][-+*][-+*] [^ ]*\) .*/\1/' out > k; mv k out +compare exp out || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/function-line-vs-leading-space b/local/recipes/tools/diffutils/source/tests/function-line-vs-leading-space new file mode 100755 index 0000000000..d67eaf4396 --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/function-line-vs-leading-space @@ -0,0 +1,65 @@ +#!/bin/sh +# Demonstrate how -F RE behavior changed after diff-2.9. + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +cat <<EOF > in || fail_ "failed to create temporary file" +procedure AdaCode is + procedure Local_Level_1 is + procedure Local_Level_2 is + procedure Local_Level_3 is + procedure Local_Level_4 is + procedure Local_Level_5 is + begin + null; + null; + null; + foo; + end; + begin + Local_Level_5; + end; + begin + Local_Level_4; + end; + begin + Local_Level_3; + end; + begin + Local_Level_2; + end; +begin + Local_Level_1; +end; +EOF + +sed s/foo/null/ < in > in2 || fail_ "failed to create temporary file" + +# Before diff-2.10, the function line would be truncated like this: +# @@ -8,7 +8,7 @@ procedure Local_Leve + +cat <<EOF > exp || fail_ "failed to create temporary file" +@@ -8,7 +8,7 @@ procedure Local_Level_5 is + null; + null; + null; +- foo; ++ null; + end; + begin + Local_Level_5; +EOF + +fail=0 + +returns_ 1 diff -u -F '^[[:space:]]*\(function\|procedure\)' in in2 \ + > out 2> err || fail=1 + +sed -n '3,$p' out > k && mv k out || fail=1 + +compare exp out || fail=1 + +# expect empty stderr +compare /dev/null err || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/help-version b/local/recipes/tools/diffutils/source/tests/help-version new file mode 100755 index 0000000000..c3a91b3ec5 --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/help-version @@ -0,0 +1,269 @@ +#! /bin/sh +# Make sure all these programs work properly +# when invoked with --help or --version. + +# Copyright (C) 2000-2013, 2015-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Ensure that $SHELL is set to *some* value and exported. +# This is required for dircolors, which would fail e.g., when +# invoked via debuild (which removes SHELL from the environment). +test "x$SHELL" = x && SHELL=/bin/sh +export SHELL + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +expected_failure_status_chroot=125 +expected_failure_status_env=125 +expected_failure_status_nice=125 +expected_failure_status_nohup=125 +expected_failure_status_stdbuf=125 +expected_failure_status_su=125 +expected_failure_status_timeout=125 +expected_failure_status_printenv=2 +expected_failure_status_tty=3 +expected_failure_status_sort=2 +expected_failure_status_expr=3 +expected_failure_status_lbracket=2 +expected_failure_status_dir=2 +expected_failure_status_ls=2 +expected_failure_status_vdir=2 + +expected_failure_status_cmp=2 +expected_failure_status_zcmp=2 +expected_failure_status_sdiff=2 +expected_failure_status_diff3=2 +expected_failure_status_diff=2 +expected_failure_status_zdiff=2 +expected_failure_status_zgrep=2 +expected_failure_status_zegrep=2 +expected_failure_status_zfgrep=2 + +expected_failure_status_grep=2 +expected_failure_status_egrep=2 +expected_failure_status_fgrep=2 + +test "$built_programs" \ + || fail_ "built_programs not specified!?!" + +test "$VERSION" \ + || fail_ "set envvar VERSION; it is required for a PATH sanity-check" + +# Extract version from --version output of the first program +for i in $built_programs; do + v=$(env $i --version | sed -n '1s/.* //p;q') + break +done + +# Ensure that it matches $VERSION. +test "x$v" = "x$VERSION" \ + || fail_ "--version-\$VERSION mismatch" + +for lang in C fr da; do + for i in $built_programs; do + + # Skip 'test'; it doesn't accept --help or --version. + test $i = test && continue; + + # false fails even when invoked with --help or --version. + if test $i = false; then + env LC_MESSAGES=$lang $i --help >/dev/null && fail=1 + env LC_MESSAGES=$lang $i --version >/dev/null && fail=1 + continue + fi + + # The just-built install executable is always named 'ginstall'. + test $i = install && i=ginstall + + # Make sure they exit successfully, under normal conditions. + env $i --help > h-$i || fail=1 + env $i --version >/dev/null || fail=1 + + # Make sure they mention the bug-reporting address in --help output. + grep "$PACKAGE_BUGREPORT" h-$i > /dev/null || fail=1 + rm -f h-$i + + # Make sure they fail upon 'disk full' error. + if test -w /dev/full && test -c /dev/full; then + env $i --help >/dev/full 2>/dev/null && fail=1 + env $i --version >/dev/full 2>/dev/null && fail=1 + status=$? + test $i = [ && prog=lbracket || prog=$i + eval "expected=\$expected_failure_status_$prog" + test x$expected = x && expected=1 + if test $status = $expected; then + : # ok + else + fail=1 + echo "*** $i: bad exit status '$status' (expected $expected)," 1>&2 + echo " with --help or --version output redirected to /dev/full" 1>&2 + fi + fi + done +done + +bigZ_in=bigZ-in.Z +zin=zin.gz +zin2=zin2.gz + +tmp=tmp-$$ +tmp_in=in-$$ +tmp_in2=in2-$$ +tmp_dir=dir-$$ +tmp_out=out-$$ +mkdir $tmp || fail=1 +cd $tmp || fail=1 + +comm_setup () { args="$tmp_in $tmp_in"; } +csplit_setup () { args="$tmp_in //"; } +cut_setup () { args='-f 1'; } +join_setup () { args="$tmp_in $tmp_in"; } +tr_setup () { args='a a'; } + +chmod_setup () { args="a+x $tmp_in"; } +# Punt on these. +chgrp_setup () { args=--version; } +chown_setup () { args=--version; } +mkfifo_setup () { args=--version; } +mknod_setup () { args=--version; } +# Punt on uptime, since it fails (e.g., failing to get boot time) +# on some systems, and we shouldn't let that stop 'make check'. +uptime_setup () { args=--version; } + +# Create a file in the current directory, not in $TMPDIR. +mktemp_setup () { args=mktemp.XXXX; } + +cmp_setup () { args="$tmp_in $tmp_in2"; } + +# Tell dd not to print the line with transfer rate and total. +# The transfer rate would vary between runs. +dd_setup () { args=status=noxfer; } + +zdiff_setup () { args="$zin $zin2"; } +zcmp_setup () { args="$zin $zin2"; } +zcat_setup () { args=$zin; } +gunzip_setup () { args=$zin; } +zmore_setup () { args=$zin; } +zless_setup () { args=$zin; } +znew_setup () { args=$bigZ_in; } +zforce_setup () { args=$zin; } +zgrep_setup () { args="z $zin"; } +zegrep_setup () { args="z $zin"; } +zfgrep_setup () { args="z $zin"; } +gzexe_setup () { args=$tmp_in; } + +# We know that $tmp_in contains a "0" +grep_setup () { args="0 $tmp_in"; } +egrep_setup () { args="0 $tmp_in"; } +fgrep_setup () { args="0 $tmp_in"; } + +diff_setup () { args="$tmp_in $tmp_in2"; } +sdiff_setup () { args="$tmp_in $tmp_in2"; } +diff3_setup () { args="$tmp_in $tmp_in2 $tmp_in2"; } +cp_setup () { args="$tmp_in $tmp_in2"; } +ln_setup () { args="$tmp_in ln-target"; } +ginstall_setup () { args="$tmp_in $tmp_in2"; } +mv_setup () { args="$tmp_in $tmp_in2"; } +mkdir_setup () { args=$tmp_dir/subdir; } +rmdir_setup () { args=$tmp_dir; } +rm_setup () { args=$tmp_in; } +shred_setup () { args=$tmp_in; } +touch_setup () { args=$tmp_in2; } +truncate_setup () { args="--reference=$tmp_in $tmp_in2"; } + +basename_setup () { args=$tmp_in; } +dirname_setup () { args=$tmp_in; } +expr_setup () { args=foo; } + +# Punt, in case GNU 'id' hasn't been installed yet. +groups_setup () { args=--version; } + +pathchk_setup () { args=$tmp_in; } +yes_setup () { args=--version; } +logname_setup () { args=--version; } +nohup_setup () { args=--version; } +printf_setup () { args=foo; } +seq_setup () { args=10; } +sleep_setup () { args=0; } +su_setup () { args=--version; } +stdbuf_setup () { args="-oL true"; } +timeout_setup () { args=--version; } + +# I'd rather not run sync, since it spins up disks that I've +# deliberately caused to spin down (but not unmounted). +sync_setup () { args=--version; } + +test_setup () { args=foo; } + +# This is necessary in the unusual event that there is +# no valid entry in /etc/mtab. +df_setup () { args=/; } + +# This is necessary in the unusual event that getpwuid (getuid ()) fails. +id_setup () { args=-u; } + +# Use env to avoid invoking built-in sleep of Solaris 11's /bin/sh. +kill_setup () { + env sleep 10m & + args=$! +} + +link_setup () { args="$tmp_in link-target"; } +unlink_setup () { args=$tmp_in; } + +readlink_setup () { + ln -s . slink + args=slink; +} + +stat_setup () { args=$tmp_in; } +unlink_setup () { args=$tmp_in; } +lbracket_setup () { args=": ]"; } + +# Ensure that each program "works" (exits successfully) when doing +# something more than --help or --version. +for i in $built_programs; do + # Skip these. + case $i in chroot|stty|tty|false|chcon|runcon) continue;; esac + + rm -rf $tmp_in $tmp_in2 $tmp_dir $tmp_out $bigZ_in $zin $zin2 + echo z |gzip > $zin + cp $zin $zin2 + cp $zin $bigZ_in + + # This is sort of kludgey: use numbers so this is valid input for factor, + # and two tokens so it's valid input for tsort. + echo 2147483647 0 > $tmp_in + # Make $tmp_in2 identical. Then, using $tmp_in and $tmp_in2 as arguments + # to the likes of cmp and diff makes them exit successfully. + cp $tmp_in $tmp_in2 + mkdir $tmp_dir + # echo ================== $i + test $i = [ && prog=lbracket || prog=$i + if type ${prog}_setup > /dev/null 2>&1; then + ${prog}_setup + else + args= + fi + if env $i $args < $tmp_in > $tmp_out; then + : # ok + else + echo FAIL: $i + fail=1 + fi + rm -rf $tmp_in $tmp_in2 $tmp_out $tmp_dir +done + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/ignore-matching-lines b/local/recipes/tools/diffutils/source/tests/ignore-matching-lines new file mode 100755 index 0000000000..1b3259f64e --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/ignore-matching-lines @@ -0,0 +1,46 @@ +#!/bin/sh +# --ignore-matching-lines + +# Bug reported by Vincent Lefevre in <http://bugs.gnu.org/16864>. + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +fail=0 + +cat <<'EOF' >a +1a +2 +3a +4 +5 +6 +EOF + +cat <<'EOF' >b +1b +2 +3b +4 +5 +6 +7 +EOF + +cat <<'EOF' >exp +@@ -1,6 +1,7 @@ +-1a ++1b + 2 +-3a ++3b + 4 + 5 + 6 ++7 +EOF + +returns_ 1 diff -u --ignore-matching-lines 3 a b >out 2>err || fail=1 +sed 1,2d out >outtail || framework_failure+ +compare exp outtail || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/init.sh b/local/recipes/tools/diffutils/source/tests/init.sh new file mode 100644 index 0000000000..584194f0e8 --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/init.sh @@ -0,0 +1,605 @@ +# source this file; set up for tests + +# Copyright (C) 2009-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Using this file in a test +# ========================= +# +# The typical skeleton of a test looks like this: +# +# #!/bin/sh +# . "${srcdir=.}/init.sh"; path_prepend_ . +# Execute some commands. +# Note that these commands are executed in a subdirectory, therefore you +# need to prepend "../" to relative filenames in the build directory. +# Note that the "path_prepend_ ." is useful only if the body of your +# test invokes programs residing in the initial directory. +# For example, if the programs you want to test are in src/, and this test +# script is named tests/test-1, then you would use "path_prepend_ ../src", +# or perhaps export PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH" +# to all tests via automake's TESTS_ENVIRONMENT. +# Set the exit code 0 for success, 77 for skipped, or 1 or other for failure. +# Use the skip_ and fail_ functions to print a diagnostic and then exit +# with the corresponding exit code. +# Exit $? + +# Executing a test that uses this file +# ==================================== +# +# Running a single test: +# $ make check TESTS=test-foo.sh +# +# Running a single test, with verbose output: +# $ make check TESTS=test-foo.sh VERBOSE=yes +# +# Running a single test, keeping the temporary directory: +# $ make check TESTS=test-foo.sh KEEP=yes +# +# Running a single test, with single-stepping: +# 1. Go into a sub-shell: +# $ bash +# 2. Set relevant environment variables from TESTS_ENVIRONMENT in the +# Makefile: +# $ export srcdir=../../tests # this is an example +# 3. Execute the commands from the test, copy&pasting them one by one: +# $ . "$srcdir/init.sh"; path_prepend_ . +# ... +# 4. Finally +# $ exit + +ME_=`expr "./$0" : '.*/\(.*\)$'` + +# We use a trap below for cleanup. This requires us to go through +# hoops to get the right exit status transported through the handler. +# So use 'Exit STATUS' instead of 'exit STATUS' inside of the tests. +# Turn off errexit here so that we don't trip the bug with OSF1/Tru64 +# sh inside this function. +Exit () { set +e; (exit $1); exit $1; } + +# Print warnings (e.g., about skipped and failed tests) to this file number. +# Override by defining to say, 9, in init.cfg, and putting say, +# export ...ENVVAR_SETTINGS...; $(SHELL) 9>&2 +# in the definition of TESTS_ENVIRONMENT in your tests/Makefile.am file. +# This is useful when using automake's parallel tests mode, to print +# the reason for skip/failure to console, rather than to the .log files. +: ${stderr_fileno_=2} + +# Note that correct expansion of "$*" depends on IFS starting with ' '. +# Always write the full diagnostic to stderr. +# When stderr_fileno_ is not 2, also emit the first line of the +# diagnostic to that file descriptor. +warn_ () +{ + # If IFS does not start with ' ', set it and emit the warning in a subshell. + case $IFS in + ' '*) printf '%s\n' "$*" >&2 + test $stderr_fileno_ = 2 \ + || { printf '%s\n' "$*" | sed 1q >&$stderr_fileno_ ; } ;; + *) (IFS=' '; warn_ "$@");; + esac +} +fail_ () { warn_ "$ME_: failed test: $@"; Exit 1; } +skip_ () { warn_ "$ME_: skipped test: $@"; Exit 77; } +fatal_ () { warn_ "$ME_: hard error: $@"; Exit 99; } +framework_failure_ () { warn_ "$ME_: set-up failure: $@"; Exit 99; } + +# This is used to simplify checking of the return value +# which is useful when ensuring a command fails as desired. +# I.e., just doing `command ... &&fail=1` will not catch +# a segfault in command for example. With this helper you +# instead check an explicit exit code like +# returns_ 1 command ... || fail +returns_ () { + # Disable tracing so it doesn't interfere with stderr of the wrapped command + { set +x; } 2>/dev/null + + local exp_exit="$1" + shift + "$@" + test $? -eq $exp_exit && ret_=0 || ret_=1 + + if test "$VERBOSE" = yes && test "$gl_set_x_corrupts_stderr_" = false; then + set -x + fi + { return $ret_; } 2>/dev/null +} + +# Sanitize this shell to POSIX mode, if possible. +DUALCASE=1; export DUALCASE +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; + esac +fi + +# We require $(...) support unconditionally. +# We require non-surprising "local" semantics (this eliminates dash). +# This takes the admittedly draconian step of eliminating dash, because the +# assignment tab=$(printf '\t') works fine, yet preceding it with "local " +# transforms it into an assignment that sets the variable to the empty string. +# That is too counter-intuitive, and can lead to subtle run-time malfunction. +# The example below is less subtle in that with dash, it evokes the run-time +# exception "dash: 1: local: 1: bad variable name". +# We require a few additional shell features only when $EXEEXT is nonempty, +# in order to support automatic $EXEEXT emulation: +# - hyphen-containing alias names +# - we prefer to use ${var#...} substitution, rather than having +# to work around lack of support for that feature. +# The following code attempts to find a shell with support for these features. +# If the current shell passes the test, we're done. Otherwise, test other +# shells until we find one that passes. If one is found, re-exec it. +# If no acceptable shell is found, skip the current test. +# +# The "...set -x; P=1 true 2>err..." test is to disqualify any shell that +# emits "P=1" into err, as /bin/sh from SunOS 5.11 and OpenBSD 4.7 do. +# +# Use "9" to indicate success (rather than 0), in case some shell acts +# like Solaris 10's /bin/sh but exits successfully instead of with status 2. + +# Eval this code in a subshell to determine a shell's suitability. +# 10 - passes all tests; ok to use +# 9 - ok, but enabling "set -x" corrupts app stderr; prefer higher score +# ? - not ok +gl_shell_test_script_=' +test $(echo y) = y || exit 1 +f_local_() { local v=1; }; f_local_ || exit 1 +f_dash_local_fail_() { local t=$(printf " 1"); }; f_dash_local_fail_ +score_=10 +if test "$VERBOSE" = yes; then + test -n "$( (exec 3>&1; set -x; P=1 true 2>&3) 2> /dev/null)" && score_=9 +fi +test -z "$EXEEXT" && exit $score_ +shopt -s expand_aliases +alias a-b="echo zoo" +v=abx + test ${v%x} = ab \ + && test ${v#a} = bx \ + && test $(a-b) = zoo \ + && exit $score_ +' + +if test "x$1" = "x--no-reexec"; then + shift +else + # Assume a working shell. Export to subshells (setup_ needs this). + gl_set_x_corrupts_stderr_=false + export gl_set_x_corrupts_stderr_ + + # Record the first marginally acceptable shell. + marginal_= + + # Search for a shell that meets our requirements. + for re_shell_ in __current__ "${CONFIG_SHELL:-no_shell}" \ + /bin/sh bash dash zsh pdksh fail + do + test "$re_shell_" = no_shell && continue + + # If we've made it all the way to the sentinel, "fail" without + # finding even a marginal shell, skip this test. + if test "$re_shell_" = fail; then + test -z "$marginal_" && skip_ failed to find an adequate shell + re_shell_=$marginal_ + break + fi + + # When testing the current shell, simply "eval" the test code. + # Otherwise, run it via $re_shell_ -c ... + if test "$re_shell_" = __current__; then + # 'eval'ing this code makes Solaris 10's /bin/sh exit with + # $? set to 2. It does not evaluate any of the code after the + # "unexpected" first '('. Thus, we must run it in a subshell. + ( eval "$gl_shell_test_script_" ) > /dev/null 2>&1 + else + "$re_shell_" -c "$gl_shell_test_script_" 2>/dev/null + fi + + st_=$? + + # $re_shell_ works just fine. Use it. + if test $st_ = 10; then + gl_set_x_corrupts_stderr_=false + break + fi + + # If this is our first marginally acceptable shell, remember it. + if test "$st_:$marginal_" = 9: ; then + marginal_="$re_shell_" + gl_set_x_corrupts_stderr_=true + fi + done + + if test "$re_shell_" != __current__; then + # Found a usable shell. Preserve -v and -x. + case $- in + *v*x* | *x*v*) opts_=-vx ;; + *v*) opts_=-v ;; + *x*) opts_=-x ;; + *) opts_= ;; + esac + re_shell=$re_shell_ + export re_shell + exec "$re_shell_" $opts_ "$0" --no-reexec "$@" + echo "$ME_: exec failed" 1>&2 + exit 127 + fi +fi + +# If this is bash, turn off all aliases. +test -n "$BASH_VERSION" && unalias -a + +# Note that when supporting $EXEEXT (transparently mapping from PROG_NAME to +# PROG_NAME.exe), we want to support hyphen-containing names like test-acos. +# That is part of the shell-selection test above. Why use aliases rather +# than functions? Because support for hyphen-containing aliases is more +# widespread than that for hyphen-containing function names. +test -n "$EXEEXT" && shopt -s expand_aliases + +# Enable glibc's malloc-perturbing option. +# This is useful for exposing code that depends on the fact that +# malloc-related functions often return memory that is mostly zeroed. +# If you have the time and cycles, use valgrind to do an even better job. +: ${MALLOC_PERTURB_=87} +export MALLOC_PERTURB_ + +# This is a stub function that is run upon trap (upon regular exit and +# interrupt). Override it with a per-test function, e.g., to unmount +# a partition, or to undo any other global state changes. +cleanup_ () { :; } + +# Emit a header similar to that from diff -u; Print the simulated "diff" +# command so that the order of arguments is clear. Don't bother with @@ lines. +emit_diff_u_header_ () +{ + printf '%s\n' "diff -u $*" \ + "--- $1 1970-01-01" \ + "+++ $2 1970-01-01" +} + +# Arrange not to let diff or cmp operate on /dev/null, +# since on some systems (at least OSF/1 5.1), that doesn't work. +# When there are not two arguments, or no argument is /dev/null, return 2. +# When one argument is /dev/null and the other is not empty, +# cat the nonempty file to stderr and return 1. +# Otherwise, return 0. +compare_dev_null_ () +{ + test $# = 2 || return 2 + + if test "x$1" = x/dev/null; then + test -s "$2" || return 0 + emit_diff_u_header_ "$@"; sed 's/^/+/' "$2" + return 1 + fi + + if test "x$2" = x/dev/null; then + test -s "$1" || return 0 + emit_diff_u_header_ "$@"; sed 's/^/-/' "$1" + return 1 + fi + + return 2 +} + +for diff_opt_ in -u -U3 -c '' no; do + test "$diff_opt_" != no && + diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" < /dev/null` && + break +done +if test "$diff_opt_" != no; then + if test -z "$diff_out_"; then + compare_ () { diff $diff_opt_ "$@"; } + else + compare_ () + { + # If no differences were found, AIX and HP-UX 'diff' produce output + # like "No differences encountered". Hide this output. + diff $diff_opt_ "$@" > diff.out + diff_status_=$? + test $diff_status_ -eq 0 || cat diff.out || diff_status_=2 + rm -f diff.out || diff_status_=2 + return $diff_status_ + } + fi +elif cmp -s /dev/null /dev/null 2>/dev/null; then + compare_ () { cmp -s "$@"; } +else + compare_ () { cmp "$@"; } +fi + +# Usage: compare EXPECTED ACTUAL +# +# Given compare_dev_null_'s preprocessing, defer to compare_ if 2 or more. +# Otherwise, propagate $? to caller: any diffs have already been printed. +compare () +{ + # This looks like it can be factored to use a simple "case $?" + # after unchecked compare_dev_null_ invocation, but that would + # fail in a "set -e" environment. + if compare_dev_null_ "$@"; then + return 0 + else + case $? in + 1) return 1;; + *) compare_ "$@";; + esac + fi +} + +# An arbitrary prefix to help distinguish test directories. +testdir_prefix_ () { printf gt; } + +# Run the user-overridable cleanup_ function, remove the temporary +# directory and exit with the incoming value of $?. +remove_tmp_ () +{ + __st=$? + cleanup_ + if test "$KEEP" = yes; then + echo "Not removing temporary directory $test_dir_" + else + # cd out of the directory we're about to remove + cd "$initial_cwd_" || cd / || cd /tmp + chmod -R u+rwx "$test_dir_" + # If removal fails and exit status was to be 0, then change it to 1. + rm -rf "$test_dir_" || { test $__st = 0 && __st=1; } + fi + exit $__st +} + +# Given a directory name, DIR, if every entry in it that matches *.exe +# contains only the specified bytes (see the case stmt below), then print +# a space-separated list of those names and return 0. Otherwise, don't +# print anything and return 1. Naming constraints apply also to DIR. +find_exe_basenames_ () +{ + feb_dir_=$1 + feb_fail_=0 + feb_result_= + feb_sp_= + for feb_file_ in $feb_dir_/*.exe; do + # If there was no *.exe file, or there existed a file named "*.exe" that + # was deleted between the above glob expansion and the existence test + # below, just skip it. + test "x$feb_file_" = "x$feb_dir_/*.exe" && test ! -f "$feb_file_" \ + && continue + # Exempt [.exe, since we can't create a function by that name, yet + # we can't invoke [ by PATH search anyways due to shell builtins. + test "x$feb_file_" = "x$feb_dir_/[.exe" && continue + case $feb_file_ in + *[!-a-zA-Z/0-9_.+]*) feb_fail_=1; break;; + *) # Remove leading file name components as well as the .exe suffix. + feb_file_=${feb_file_##*/} + feb_file_=${feb_file_%.exe} + feb_result_="$feb_result_$feb_sp_$feb_file_";; + esac + feb_sp_=' ' + done + test $feb_fail_ = 0 && printf %s "$feb_result_" + return $feb_fail_ +} + +# Consider the files in directory, $1. +# For each file name of the form PROG.exe, create an alias named +# PROG that simply invokes PROG.exe, then return 0. If any selected +# file name or the directory name, $1, contains an unexpected character, +# define no alias and return 1. +create_exe_shims_ () +{ + case $EXEEXT in + '') return 0 ;; + .exe) ;; + *) echo "$0: unexpected \$EXEEXT value: $EXEEXT" 1>&2; return 1 ;; + esac + + base_names_=`find_exe_basenames_ $1` \ + || { echo "$0 (exe_shim): skipping directory: $1" 1>&2; return 0; } + + if test -n "$base_names_"; then + for base_ in $base_names_; do + alias "$base_"="$base_$EXEEXT" + done + fi + + return 0 +} + +# Use this function to prepend to PATH an absolute name for each +# specified, possibly-$initial_cwd_-relative, directory. +path_prepend_ () +{ + while test $# != 0; do + path_dir_=$1 + case $path_dir_ in + '') fail_ "invalid path dir: '$1'";; + /*) abs_path_dir_=$path_dir_;; + *) abs_path_dir_=$initial_cwd_/$path_dir_;; + esac + case $abs_path_dir_ in + *:*) fail_ "invalid path dir: '$abs_path_dir_'";; + esac + PATH="$abs_path_dir_:$PATH" + + # Create an alias, FOO, for each FOO.exe in this directory. + create_exe_shims_ "$abs_path_dir_" \ + || fail_ "something failed (above): $abs_path_dir_" + shift + done + export PATH +} + +setup_ () +{ + if test "$VERBOSE" = yes; then + # Test whether set -x may cause the selected shell to corrupt an + # application's stderr. Many do, including zsh-4.3.10 and the /bin/sh + # from SunOS 5.11, OpenBSD 4.7 and Irix 5.x and 6.5. + # If enabling verbose output this way would cause trouble, simply + # issue a warning and refrain. + if $gl_set_x_corrupts_stderr_; then + warn_ "using SHELL=$SHELL with 'set -x' corrupts stderr" + else + set -x + fi + fi + + initial_cwd_=$PWD + + pfx_=`testdir_prefix_` + test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \ + || fail_ "failed to create temporary directory in $initial_cwd_" + cd "$test_dir_" || fail_ "failed to cd to temporary directory" + + # As autoconf-generated configure scripts do, ensure that IFS + # is defined initially, so that saving and restoring $IFS works. + gl_init_sh_nl_=' +' + IFS=" "" $gl_init_sh_nl_" + + # This trap statement, along with a trap on 0 below, ensure that the + # temporary directory, $test_dir_, is removed upon exit as well as + # upon receipt of any of the listed signals. + for sig_ in 1 2 3 13 15; do + eval "trap 'Exit $(expr $sig_ + 128)' $sig_" + done +} + +# Create a temporary directory, much like mktemp -d does. +# Written by Jim Meyering. +# +# Usage: mktempd_ /tmp phoey.XXXXXXXXXX +# +# First, try to use the mktemp program. +# Failing that, we'll roll our own mktemp-like function: +# - try to get random bytes from /dev/urandom +# - failing that, generate output from a combination of quickly-varying +# sources and gzip. Ignore non-varying gzip header, and extract +# "random" bits from there. +# - given those bits, map to file-name bytes using tr, and try to create +# the desired directory. +# - make only $MAX_TRIES_ attempts + +# Helper function. Print $N pseudo-random bytes from a-zA-Z0-9. +rand_bytes_ () +{ + n_=$1 + + # Maybe try openssl rand -base64 $n_prime_|tr '+/=\012' abcd first? + # But if they have openssl, they probably have mktemp, too. + + chars_=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 + dev_rand_=/dev/urandom + if test -r "$dev_rand_"; then + # Note: 256-length($chars_) == 194; 3 copies of $chars_ is 186 + 8 = 194. + dd ibs=$n_ count=1 if=$dev_rand_ 2>/dev/null \ + | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_ + return + fi + + n_plus_50_=`expr $n_ + 50` + cmds_='date; date +%N; free; who -a; w; ps auxww; ps ef; netstat -n' + data_=` (eval "$cmds_") 2>&1 | gzip ` + + # Ensure that $data_ has length at least 50+$n_ + while :; do + len_=`echo "$data_"|wc -c` + test $n_plus_50_ -le $len_ && break; + data_=` (echo "$data_"; eval "$cmds_") 2>&1 | gzip ` + done + + echo "$data_" \ + | dd bs=1 skip=50 count=$n_ 2>/dev/null \ + | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_ +} + +mktempd_ () +{ + case $# in + 2);; + *) fail_ "Usage: mktempd_ DIR TEMPLATE";; + esac + + destdir_=$1 + template_=$2 + + MAX_TRIES_=4 + + # Disallow any trailing slash on specified destdir: + # it would subvert the post-mktemp "case"-based destdir test. + case $destdir_ in + / | //) destdir_slash_=$destdir;; + */) fail_ "invalid destination dir: remove trailing slash(es)";; + *) destdir_slash_=$destdir_/;; + esac + + case $template_ in + *XXXX) ;; + *) fail_ \ + "invalid template: $template_ (must have a suffix of at least 4 X's)";; + esac + + # First, try to use mktemp. + d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` && + + # The resulting name must be in the specified directory. + case $d in "$destdir_slash_"*) :;; *) false;; esac && + + # It must have created the directory. + test -d "$d" && + + # It must have 0700 permissions. Handle sticky "S" bits. + perms=`ls -dgo "$d" 2>/dev/null` && + case $perms in drwx--[-S]---*) :;; *) false;; esac && { + echo "$d" + return + } + + # If we reach this point, we'll have to create a directory manually. + + # Get a copy of the template without its suffix of X's. + base_template_=`echo "$template_"|sed 's/XX*$//'` + + # Calculate how many X's we've just removed. + template_length_=`echo "$template_" | wc -c` + nx_=`echo "$base_template_" | wc -c` + nx_=`expr $template_length_ - $nx_` + + err_= + i_=1 + while :; do + X_=`rand_bytes_ $nx_` + candidate_dir_="$destdir_slash_$base_template_$X_" + err_=`mkdir -m 0700 "$candidate_dir_" 2>&1` \ + && { echo "$candidate_dir_"; return; } + test $MAX_TRIES_ -le $i_ && break; + i_=`expr $i_ + 1` + done + fail_ "$err_" +} + +# If you want to override the testdir_prefix_ function, +# or to add more utility functions, use this file. +test -f "$srcdir/init.cfg" \ + && . "$srcdir/init.cfg" + +setup_ "$@" +# This trap is here, rather than in the setup_ function, because some +# shells run the exit trap at shell function exit, rather than script exit. +trap remove_tmp_ 0 diff --git a/local/recipes/tools/diffutils/source/tests/invalid-re b/local/recipes/tools/diffutils/source/tests/invalid-re new file mode 100755 index 0000000000..0732a1f702 --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/invalid-re @@ -0,0 +1,18 @@ +#!/bin/sh +# Ensure we diagnose and fail upon first invalid -I regex. + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +fail=0 + +echo > a || framework_failure_ +echo b > b || framework_failure_ +echo 'diff: \: Trailing backslash' > exp-err || framework_failure_ + +# This must fail with an exit status of 2: +returns_ 2 diff -Ix -I\\ a b > out 2> err || fail=1 + +compare /dev/null out || fail=1 +compare exp-err err || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/label-vs-func b/local/recipes/tools/diffutils/source/tests/label-vs-func new file mode 100755 index 0000000000..4b4c9b702d --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/label-vs-func @@ -0,0 +1,31 @@ +#!/bin/sh +# Show how diff's -p option can mistakenly match a label: in column 1. + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +fail=0 +cat <<EOF > exp || fail=1 +@@ -4 +4 @@ label: +-1; ++2; +EOF + +cat <<EOF > a || fail=1 +func () +{ +label: +1; +} +EOF + +sed s/1/2/ a > b || fail=1 +returns_ 1 diff -p -u0 a b > out 2> err || fail=1 + +tail -3 out > k && mv k out || fail=1 + +compare exp out || fail=1 + +# expect empty stderr +compare /dev/null err || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/new-file b/local/recipes/tools/diffutils/source/tests/new-file new file mode 100755 index 0000000000..4400051aad --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/new-file @@ -0,0 +1,41 @@ +#!/bin/sh +# Test --new-file (-N) and --unidirectional-new-file. + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +fail=0 + +echo a > a || fail=1 + +echo '0a1 +> a' > exp || fail=1 + +returns_ 1 diff -N - a <&- > out || fail=1 +compare exp out || fail=1 + +returns_ 1 diff --unidirectional-new-file - a <&- > out || fail=1 +compare exp out || fail=1 + +returns_ 1 diff -N b - < a > out || fail=1 +compare exp out || fail=1 + +returns_ 1 diff --unidirectional-new-file b - < a > out || fail=1 +compare exp out || fail=1 + +echo '1d0 +< a' > exp || fail=1 + +returns_ 1 diff -N a - <&- > out || fail=1 +compare exp out || fail=1 + +# With closed standard input, require an exit status of 2 +# and empty stdout. +returns_ 2 diff --unidirectional-new-file a - <&- > out || fail=1 +compare /dev/null out || fail=1 + +returns_ 1 diff -N - b < a > out || fail=1 +compare exp out || fail=1 + +returns_ 2 diff --unidirectional-new-file - b < a > out || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/no-dereference b/local/recipes/tools/diffutils/source/tests/no-dereference new file mode 100644 index 0000000000..3f67bd24f7 --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/no-dereference @@ -0,0 +1,155 @@ +#!/bin/sh +# Test the --no-dereference option. + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +echo 'Simple contents' > regular1 +echo 'Sample contents' > regular2 +echo 'Sample contents' > regular3 +ln -s regular1 symlink1 +ln -s regular1 symlink1bis +ln -s regular2 symlink2 +ln -s regular3 symlink3 + +# Non-recursive comparisons. + +# Test case 3: Compare regular file with regular file. +returns_ 1 diff --no-dereference regular1 regular2 > out || fail=1 +cat <<EOF > expected || framework_failure_ +1c1 +< Simple contents +--- +> Sample contents +EOF +compare expected out || fail=1 + +# Test case 4: Compare regular file with symbolic link. +returns_ 1 diff --no-dereference regular1 symlink1 > out || fail=1 +cat <<EOF > expected || framework_failure_ +File regular1 is a regular file while file symlink1 is a symbolic link +EOF +compare expected out || fail=1 + +# Test case 5: Compare symbolic link with regular file. +returns_ 1 diff --no-dereference symlink1 regular1 > out || fail=1 +cat <<EOF > expected || framework_failure_ +File symlink1 is a symbolic link while file regular1 is a regular file +EOF +compare expected out || fail=1 + +# Test case 6: Compare symbolic links with same value. +diff --no-dereference symlink1 symlink1bis > out || fail=1 +compare /dev/null out || fail=1 + +# Test case 7: Compare symbolic links with different value and different target +# contents. +returns_ 1 diff --no-dereference symlink1 symlink2 > out || fail=1 +cat <<EOF > expected || framework_failure_ +Symbolic links symlink1 and symlink2 differ +EOF +compare expected out || fail=1 + +# Test case 8: Compare symbolic links with different value and same target +# contents. +returns_ 1 diff --no-dereference symlink2 symlink3 > out || fail=1 +cat <<EOF > expected || framework_failure_ +Symbolic links symlink2 and symlink3 differ +EOF +compare expected out || fail=1 + +# Recursive comparisons. + +# Test case 1: Compare symbolic link with nonexistent file. +mkdir subdir1a +mkdir subdir1b +ln -s nonexistent subdir1a/foo +ln -s ../regular1 subdir1a/bar +returns_ 1 diff -r --no-dereference subdir1a subdir1b > out || fail=1 +cat <<EOF > expected || framework_failure_ +Only in subdir1a: bar +Only in subdir1a: foo +EOF +compare expected out || fail=1 + +# Test case 1: Compare nonexistent file with symbolic link. +mkdir subdir2a +mkdir subdir2b +ln -s nonexistent subdir2b/foo +ln -s ../regular1 subdir2b/bar +returns_ 1 diff -r --no-dereference subdir2a subdir2b > out || fail=1 +cat <<EOF > expected || framework_failure_ +Only in subdir2b: bar +Only in subdir2b: foo +EOF +compare expected out || fail=1 + +# Test case 3: Compare regular file with regular file. +mkdir subdir3a +mkdir subdir3b +cp regular1 subdir3a/foo +cp regular2 subdir3b/foo +returns_ 1 diff -r --no-dereference subdir3a subdir3b > out || fail=1 +cat <<EOF > expected || framework_failure_ +diff -r --no-dereference subdir3a/foo subdir3b/foo +1c1 +< Simple contents +--- +> Sample contents +EOF +compare expected out || fail=1 + +# Test case 4: Compare regular file with symbolic link. +mkdir subdir4a +mkdir subdir4b +cp regular1 subdir4a/foo +ln -s ../regular1 subdir4b/foo +returns_ 1 diff -r --no-dereference subdir4a subdir4b > out || fail=1 +cat <<EOF > expected || framework_failure_ +File subdir4a/foo is a regular file while file subdir4b/foo is a symbolic link +EOF +compare expected out || fail=1 + +# Test case 5: Compare symbolic link with regular file. +mkdir subdir5a +mkdir subdir5b +ln -s ../regular1 subdir5a/foo +cp regular1 subdir5b/foo +returns_ 1 diff -r --no-dereference subdir5a subdir5b > out || fail=1 +cat <<EOF > expected || framework_failure_ +File subdir5a/foo is a symbolic link while file subdir5b/foo is a regular file +EOF +compare expected out || fail=1 + +# Test case 6: Compare symbolic links with same value. +mkdir subdir6a +mkdir subdir6b +ln -s ../regular1 subdir6a/foo +ln -s ../regular1 subdir6b/foo +diff -r --no-dereference subdir6a subdir6b > out || fail=1 +compare /dev/null out || fail=1 + +# Test case 7: Compare symbolic links with different value and different target +# contents. +mkdir subdir7a +mkdir subdir7b +ln -s ../regular1 subdir7a/foo +ln -s ../regular2 subdir7b/foo +returns_ 1 diff -r --no-dereference subdir7a subdir7b > out || fail=1 +cat <<EOF > expected || framework_failure_ +Symbolic links subdir7a/foo and subdir7b/foo differ +EOF +compare expected out || fail=1 + +# Test case 8: Compare symbolic links with different value and same target +# contents. +mkdir subdir8a +mkdir subdir8b +ln -s ../regular2 subdir8a/foo +ln -s ../regular3 subdir8b/foo +returns_ 1 diff -r --no-dereference subdir8a subdir8b > out || fail=1 +cat <<EOF > expected || framework_failure_ +Symbolic links subdir8a/foo and subdir8b/foo differ +EOF +compare expected out || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/no-newline-at-eof b/local/recipes/tools/diffutils/source/tests/no-newline-at-eof new file mode 100755 index 0000000000..5f000039a7 --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/no-newline-at-eof @@ -0,0 +1,56 @@ +#!/bin/sh +# exercise the no-newline-at-EOF bug +# Before the April 2010 fix, the "\ No newline at end of file" +# line would not be printed. + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +printf '\n1' > a || framework_failure_ +printf '\n0\n\n1' > b || framework_failure_ +cat <<EOF > exp || framework_failure_ +@@ -1,2 +1,4 @@ + ++0 ++ + 1 +\ No newline at end of file +EOF + +cat <<EOF > exp2 || framework_failure_ +@@ -1,2 +1,4 @@ + +-1 ++0 ++ ++1 +\ No newline at end of file +EOF + +fail=0 + +# So we don't have to record trailing blanks in expected output above. +opt=--suppress-blank-empty + +returns_ 1 diff $opt -U1 a b > out 2> err || fail=1 + +sed -n '/^@@/,$p' out > k && mv k out || fail=1 +compare exp out || fail=1 +# expect empty stderr +compare /dev/null err || fail=1 + +# Repeat, but with a newline at the end of "a". +echo >> a + +returns_ 1 diff $opt -U1 a b > out 2> err || fail=1 + +sed -n '/^@@/,$p' out > k && mv k out || fail=1 +compare exp2 out || fail=1 +# expect empty stderr +compare /dev/null err || fail=1 + +# Test for Bug#18402. +printf a > a +printf b > b +returns_ 1 diff -B a b > out 2>err || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/stdin b/local/recipes/tools/diffutils/source/tests/stdin new file mode 100755 index 0000000000..94b75429b0 --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/stdin @@ -0,0 +1,24 @@ +#!/bin/sh +# Ensure that "-" means "standard input". + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +fail=0 + +cat <<EOF > exp || fail=1 +--- - ++++ b +@@ -1 +1 @@ +-a ++b +EOF + +echo a > a +echo b > b + +returns_ 1 diff -u - b < a > out 2> err || fail=1 +# Remove date and time. +sed -e 's/^\([-+*][-+*][-+*] [^ ]*\) .*/\1/' out > k; mv k out +compare exp out || fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/strcoll-0-names b/local/recipes/tools/diffutils/source/tests/strcoll-0-names new file mode 100755 index 0000000000..33c4a3c4cb --- /dev/null +++ b/local/recipes/tools/diffutils/source/tests/strcoll-0-names @@ -0,0 +1,25 @@ +#!/bin/sh +# Check that diff responds well with two different file names +# that compare equal with strcoll. See: +# http://lists.gnu.org/archive/html/bug-diffutils/2013-03/msg00012.html + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +# These two names compare equal in the en_US.UTF-8 locale +# in current (2013) versions of glibc. +# On systems where the names do not compare equal, +# this diff test should still do the right thing. +LC_ALL=en_US.UTF-8 +export LC_ALL +name1='エンドカード1' +name2='ブックレット1' + +mkdir d1 d2 || fail=1 +echo x >d1/"$name1" || fail=1 +echo x >d2/"$name2" || fail=1 + +# This should report a difference, but on the affected systems +# diffutils 3.3 does not. +diff d1 d2 && fail=1 + +Exit $fail diff --git a/local/recipes/tools/diffutils/source/tests/t-local.sh b/local/recipes/tools/diffutils/source/tests/t-local.sh new file mode 100644 index 0000000000..e69de29bb2 diff --git a/local/recipes/tui/tlc/source/Cargo.toml b/local/recipes/tui/tlc/source/Cargo.toml index a518c46569..53946ee47d 100644 --- a/local/recipes/tui/tlc/source/Cargo.toml +++ b/local/recipes/tui/tlc/source/Cargo.toml @@ -143,9 +143,9 @@ assert_cmd = "2" serde_yaml = "0.9" [target.'cfg(target_os = "redox")'.dependencies] -libredox = "0.1.17" +libredox = { path = "../../../../../local/sources/libredox" } redox_event = "0.4.6" -redox_syscall = { version = "0.8", features = ["std"] } +redox_syscall = { path = "../../../../../local/sources/syscall", features = ["std"] } redox_termios = "0.1.3" [profile.release] @@ -157,3 +157,6 @@ panic = "abort" [profile.dev] opt-level = 1 + +[patch.crates-io] +libredox = { path = "../../../../../local/sources/libredox" } diff --git a/local/recipes/tui/tlc/source/src/editor/mod.rs b/local/recipes/tui/tlc/source/src/editor/mod.rs index f9b60faad2..227369895c 100644 --- a/local/recipes/tui/tlc/source/src/editor/mod.rs +++ b/local/recipes/tui/tlc/source/src/editor/mod.rs @@ -102,6 +102,14 @@ pub struct Editor { buffer: Buffer, /// Cursor position and selection. cursor: Cursor, + /// Secondary cursor positions for multi-cursor editing (D7). + /// The primary cursor (`cursor.position`) is always present; + /// `secondary_cursors` is empty for single-cursor mode. When + /// non-empty, text insertions and deletions apply at every + /// position in the sorted, deduplicated union of primary + + /// secondary. The selection markers (anchor, column_anchor) are + /// unaffected — they continue to apply to the primary cursor. + secondary_cursors: Vec<usize>, /// Scroll offsets. view: EditorView, /// The file path the buffer was loaded from (or will be saved to). @@ -244,6 +252,7 @@ impl Editor { Self { buffer, cursor: Cursor::new(), + secondary_cursors: Vec::new(), view: EditorView::new(), path: Some(path), modified: false, @@ -263,7 +272,7 @@ impl Editor { highlighter: hl, #[cfg(feature = "syntect")] last_render_top: 0, -bracket_flash: None, + bracket_flash: None, search: SearchState::new(), history_popup_selected: None, cursor_shape: CursorShape::default(), @@ -290,6 +299,7 @@ bracket_flash: None, Self { buffer: Buffer::new(), cursor: Cursor::new(), + secondary_cursors: Vec::new(), view: EditorView::new(), path: None, modified: false, @@ -967,6 +977,118 @@ bracket_flash: None, self.modified = true; } + pub fn has_multi_cursor(&self) -> bool { + !self.secondary_cursors.is_empty() + } + + pub fn secondary_cursor_count(&self) -> usize { + self.secondary_cursors.len() + } + + pub fn add_secondary_cursor(&mut self, byte_pos: usize) { + let pos = byte_pos.min(self.buffer.len()); + if pos == self.cursor.position() { + return; + } + if !self.secondary_cursors.contains(&pos) { + self.secondary_cursors.push(pos); + self.secondary_cursors.sort_unstable(); + self.secondary_cursors.dedup(); + } + } + + pub fn clear_secondary_cursors(&mut self) { + self.secondary_cursors.clear(); + } + + pub fn all_cursor_positions(&self) -> Vec<usize> { + let mut all = self.secondary_cursors.clone(); + all.push(self.cursor.position()); + all.sort_unstable(); + all.dedup(); + all + } + + /// Insert `c` at every cursor position (primary + all secondary). + /// Positions are processed right-to-left so earlier insertions + /// don't shift later positions. After insertion, all secondary + /// cursor byte offsets are advanced by the char's UTF-8 length. + pub fn insert_char_multi(&mut self, c: char) { + if self.secondary_cursors.is_empty() { + self.insert_char(c); + return; + } + self.completer.cancel(); + let char_len = c.len_utf8(); + let line_before = self.buffer_line_of(self.cursor.position()); + let lines_before = self.buffer.line_count(); + let mut positions = self.all_cursor_positions(); + for &pos in positions.iter().rev() { + self.buffer.set_cursor(pos); + self.buffer.insert_char(c); + } + for sec in &mut self.secondary_cursors { + *sec += char_len; + } + self.cursor.set_position( + self.cursor.position() + char_len, + &self.buffer, + ); + self.adjust_bookmarks_after_edit(line_before, lines_before); + self.modified = true; + } + + /// Backspace at every cursor position. Positions are processed + /// right-to-left. Secondary cursors at byte offset 0 are skipped. + pub fn delete_back_multi(&mut self) { + if self.secondary_cursors.is_empty() { + self.delete_back(); + return; + } + self.completer.cancel(); + let line_before = self.buffer_line_of(self.cursor.position()); + let lines_before = self.buffer.line_count(); + let mut positions = self.all_cursor_positions(); + for &pos in positions.iter().rev() { + if pos == 0 { + continue; + } + self.buffer.set_cursor(pos); + self.buffer.delete_back(); + } + let new_len = self.buffer.len(); + self.secondary_cursors.retain_mut(|p| { + if *p > 0 { *p -= 1; } + *p <= new_len + }); + let primary = self.cursor.position().saturating_sub(1); + self.cursor.set_position(primary, &self.buffer); + self.adjust_bookmarks_after_edit(line_before, lines_before); + self.modified = true; + } + + /// Delete-forward at every cursor position. Positions are processed + /// right-to-left so earlier deletions don't shift later positions. + pub fn delete_forward_multi(&mut self) { + if self.secondary_cursors.is_empty() { + self.delete_forward(); + return; + } + self.completer.cancel(); + let line_before = self.buffer_line_of(self.cursor.position()); + let lines_before = self.buffer.line_count(); + let positions = self.all_cursor_positions(); + for &pos in positions.iter().rev() { + self.buffer.set_cursor(pos); + self.buffer.delete_forward(); + } + let new_len = self.buffer.len(); + self.secondary_cursors.retain(|p| *p <= new_len); + self.cursor.set_position(self.cursor.position().min(new_len), &self.buffer); + self.adjust_bookmarks_after_edit(line_before, lines_before); + self.modified = true; + } + /// Undo the last edit. Returns true if anything was undone. pub fn undo(&mut self) -> bool { let r = self.buffer.undo(); @@ -3355,5 +3477,90 @@ mod tests { assert_eq!(e.buffer().as_string(), " "); assert_eq!(e.cursor.visual_column(), 8); } + + #[test] + fn multi_cursor_add_and_clear() { + let mut e = make_empty(); + e.insert_str("hello world"); + assert!(!e.has_multi_cursor()); + e.add_secondary_cursor(5); + assert!(e.has_multi_cursor()); + assert_eq!(e.secondary_cursor_count(), 1); + e.clear_secondary_cursors(); + assert!(!e.has_multi_cursor()); + } + + #[test] + fn multi_cursor_all_positions_includes_primary() { + let mut e = make_empty(); + e.insert_str("abcdef"); + e.buffer.set_cursor(0); + let snap = e.buffer().clone(); + e.cursor.set_position(0, &snap); + e.add_secondary_cursor(3); + let positions = e.all_cursor_positions(); + assert_eq!(positions, vec![0, 3]); + } + + #[test] + fn multi_cursor_insert_char_at_all_cursors() { + let mut e = make_empty(); + e.insert_str("ac"); + e.buffer.set_cursor(1); + let snap = e.buffer().clone(); + e.cursor.set_position(1, &snap); + e.add_secondary_cursor(0); + e.insert_char_multi('X'); + assert_eq!(e.buffer().as_string(), "XaXc"); + } + + #[test] + fn multi_cursor_delete_back_at_all_cursors() { + let mut e = make_empty(); + e.insert_str("a_b_c"); + e.buffer.set_cursor(4); + let snap = e.buffer().clone(); + e.cursor.set_position(4, &snap); + e.add_secondary_cursor(2); + e.delete_back_multi(); + assert_eq!(e.buffer().as_string(), "abc"); + } + + #[test] + fn multi_cursor_delete_forward_at_all_cursors() { + let mut e = make_empty(); + e.insert_str("aXbXc"); + e.buffer.set_cursor(1); + let snap = e.buffer().clone(); + e.cursor.set_position(1, &snap); + e.add_secondary_cursor(3); + e.delete_forward_multi(); + assert_eq!(e.buffer().as_string(), "abc"); + } + + #[test] + fn multi_cursor_insert_unicode_preserves_offsets() { + let mut e = make_empty(); + e.insert_str("ab"); + e.buffer.set_cursor(1); + let snap = e.buffer().clone(); + e.cursor.set_position(1, &snap); + e.add_secondary_cursor(0); + e.insert_char_multi('→'); + let s = e.buffer().as_string(); + assert_eq!(s, "→a→b"); + } + + #[test] + fn multi_cursor_duplicate_add_ignored() { + let mut e = make_empty(); + e.insert_str("test"); + e.buffer.set_cursor(0); + let snap = e.buffer().clone(); + e.cursor.set_position(0, &snap); + e.add_secondary_cursor(2); + e.add_secondary_cursor(2); + assert_eq!(e.secondary_cursor_count(), 1); + } } diff --git a/local/scripts/apply-rb-suffix.sh b/local/scripts/apply-rb-suffix.sh index 02a7be4345..edd9103309 100755 --- a/local/scripts/apply-rb-suffix.sh +++ b/local/scripts/apply-rb-suffix.sh @@ -1,50 +1,25 @@ #!/usr/bin/env bash -# apply-rb-suffix.sh — Enforce the -rb<N> version convention on all -# local upstream forks (Category 2 per local/AGENTS.md). +# apply-rb-suffix.sh — Apply the -rb<branch> version suffix to all Cat 2 forks. # -# Policy (local/AGENTS.md § "Category 2 — Local forks of upstream packages" -# and § "No-fake-version-label rule"): +# This script is now a thin wrapper around sync-versions.sh Phase 2. +# It exists for backward compatibility and focused Cat-2-only operation. # -# Every Cat 2 fork version MUST be `<upstream-tag>-rb<N>` where: -# <upstream-tag> = the upstream version the fork currently tracks -# <N> = a Red Bear incremental counter, starting at 1 for -# a new fork, bumped every time Red Bear additions -# are applied on top of a new upstream commit. +# Policy (local/AGENTS.md § "Version conventions"): # -# The `-rb<N>` part is a Cargo pre-release identifier. Per SemVer and -# Cargo's version-selection rules, a pre-release version (e.g. 0.9.0-rb1) -# is NEVER substituted for the corresponding stable version (0.9.0). -# This guarantees fail-fast when a transitive crate pulls upstream from -# crates.io while a workspace depends on the local fork. +# Every Cat 2 fork version MUST be `<upstream-version>-rb<branch-version>` where: +# <upstream-version> = the upstream version the fork currently tracks +# <branch-version> = the current Red Bear OS git branch (e.g. 0.2.5) # -# What this script does: -# -# 1. Updates `version = "X.Y.Z"` in every `local/sources/*/Cargo.toml` -# to `"X.Y.Z-rb1"`. The base tag is detected from the current -# version field; the rb counter defaults to 1 but can be overridden -# via `--rb=<N>`. -# -# 2. Updates path-dep `version = "X.Y.Z"` requirements in every -# workspace that depends on the local fork (e.g. `base/Cargo.toml`, -# `libredox/Cargo.toml`, every `local/recipes/*/source/Cargo.toml`). -# Without this, Cargo will refuse to use `X.Y.Z-rb1` for a path -# that requires `"X.Y.Z"`. -# -# 3. (Optional) Adds `[patch.crates-io]` entries in workspace -# Cargo.toml files for every Cat 2 fork, so that crates.io -# transitive references to upstream `X.Y.Z` are also redirected -# to the local fork. This is necessary because pre-release -# versions don't match non-pre-release requirements. -# -# 4. Verifies that all in-source references are consistent and -# reports any policy violations (Cat 1 version drift, missing -# -rb suffix on Cat 2, etc). +# The `-rb<branch>` suffix is a Cargo pre-release identifier. Per SemVer, a +# pre-release version (e.g. 0.9.0-rb0.2.5) is NEVER substituted for the +# corresponding stable version (0.9.0). # # Usage: -# ./local/scripts/apply-rb-suffix.sh # Apply -rb1 to all -# ./local/scripts/apply-rb-suffix.sh --rb=5 # Apply -rb5 to all +# ./local/scripts/apply-rb-suffix.sh # Apply -rb<branch> to all # ./local/scripts/apply-rb-suffix.sh --check # Verify only -# ./local/scripts/apply-rb-suffix.sh --rollback # Revert to stable X.Y.Z +# ./local/scripts/apply-rb-suffix.sh --rollback # Revert to stable X.Y.Z +# +# For full Cat 1 + Cat 2 sync, use sync-versions.sh instead. set -euo pipefail @@ -53,14 +28,12 @@ cd "$ROOT" CHECK_ONLY=0 ROLLBACK=0 -RB_N="1" while [[ $# -gt 0 ]]; do case "$1" in - --rb=*) RB_N="${1#*=}" ;; - --check) CHECK_ONLY=1 ;; + --check) CHECK_ONLY=1 ;; --rollback) ROLLBACK=1 ;; - *) echo "Unknown option: $1" >&2; exit 1 ;; + *) echo "Unknown option: $1" >&2; exit 1 ;; esac shift done @@ -70,10 +43,44 @@ if [[ $CHECK_ONLY -eq 1 ]] && [[ $ROLLBACK -eq 1 ]]; then exit 1 fi +# ---- Determine branch version ---- +BRANCH="$(git branch --show-current 2>/dev/null || echo "")" +if [[ -z "$BRANCH" ]]; then + echo "ERROR: cannot determine current git branch" >&2 + exit 1 +fi +BRANCH_VERSION="$(echo "$BRANCH" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' || true)" +if [[ -z "$BRANCH_VERSION" ]]; then + echo "ERROR: branch '$BRANCH' does not contain a semantic version" >&2 + exit 1 +fi + +RB_SUFFIX="-rb${BRANCH_VERSION}" + +# ---- Rollback mode: strip all -rb<x.y.z> suffixes ---- +if [[ $ROLLBACK -eq 1 ]]; then + echo "=== Rolling back Cat 2 forks to stable versions (stripping -rb*) ===" + for fork_dir in local/sources/*/; do + [ -d "$fork_dir" ] || continue + fork_name=$(basename "$fork_dir") + f="${fork_dir}Cargo.toml" + [ -f "$f" ] || continue + if ! grep -qE '^[[:space:]]*\[(package|workspace\.package)\]' "$f" 2>/dev/null; then + continue + fi + current="$(grep -E '^version\s*=' "$f" | head -1 | sed 's/.*"\(.*\)".*/\1/' || true)" + [[ -n "$current" ]] || continue + if [[ "$current" == *"-rb"* ]]; then + base="$(echo "$current" | sed -E 's/-rb([0-9]+(\.[0-9]+\.[0-9]+)?)$//')" + sed -i "s|^version = \"${current}\"|version = \"${base}\"|" "$f" + echo " ROLLBACK: $fork_name $current → $base" + fi + done + echo "Rolled back to stable versions." + exit 0 +fi + # ---- List of Cat 2 forks ---- -# -# Path under local/sources/. Order matters: dep ordering (syscall first, -# then libredox which depends on syscall, then everything else). CAT2_FORKS=( syscall libredox @@ -84,215 +91,64 @@ CAT2_FORKS=( installer redoxfs userutils + redox-scheme ) -# ---- Read current version from a Cat 2 fork's Cargo.toml ---- -get_current_version() { - local fork="$1" - local f="local/sources/${fork}/Cargo.toml" - [[ -f "$f" ]] || { echo "MISSING"; return 0; } - grep -E '^version\s*=' "$f" | head -1 | sed 's/.*"\(.*\)".*/\1/' -} +# ---- Apply or check ---- +DRIFT=0 +APPLIED=0 -# ---- Determine target version for a fork ---- -# If ROLLBACK is set: strip any -rb<N> suffix -# Else: append -rb<RB_N> to the stable base -compute_target_version() { - local current="$1" - # Strip any existing -rb<N> or -pre suffix to get the base - local base - base="$(echo "$current" | sed -E 's/-[a-zA-Z0-9.\-]+$//')" - if [[ $ROLLBACK -eq 1 ]]; then - echo "$base" - else - echo "${base}-rb${RB_N}" - fi -} +echo "=== Cat 2 fork versions (suffix: $RB_SUFFIX) ===" -# ---- Update a single fork's Cargo.toml version ---- -update_fork_version() { - local fork="$1" - local f="local/sources/${fork}/Cargo.toml" +for fork in "${CAT2_FORKS[@]}"; do + f="local/sources/${fork}/Cargo.toml" if [[ ! -f "$f" ]]; then echo " SKIP ${fork}: no Cargo.toml" - return 0 + continue fi - # Workspace-only roots (no [package], no [workspace.package]) have no - # version to bump. The fork's individual member crates each carry - # their own version. - if ! grep -qE '^[[:space:]]*\[(package|workspace\.package)\]' "$f"; then - echo " SKIP ${fork}: workspace-only root (no version field)" - return 0 + if ! grep -qE '^[[:space:]]*\[(package|workspace\.package)\]' "$f" 2>/dev/null; then + echo " SKIP ${fork}: workspace-only root" + continue fi - local current target - current="$(get_current_version "$fork")" - if [[ -z "$current" ]]; then - echo " SKIP ${fork}: empty version field" - return 0 - fi - target="$(compute_target_version "$current")" + current="$(grep -E '^version\s*=' "$f" | head -1 | sed 's/.*"\(.*\)".*/\1/' || true)" + [[ -n "$current" ]] || { echo " SKIP ${fork}: empty version"; continue; } + + base="$(echo "$current" | sed -E 's/(-rb[0-9]+(\.[0-9]+\.[0-9]+)?)+$//')" + target="${base}${RB_SUFFIX}" + if [[ "$current" == "$target" ]]; then - echo " OK ${fork}: version already ${target}" - return 0 + echo " OK ${fork}: ${target}" + continue fi + if [[ $CHECK_ONLY -eq 1 ]]; then echo " DRIFT ${fork}: ${current} → ${target}" - return 1 - fi - sed -i "s|^version = \"${current}\"|version = \"${target}\"|" "$f" - echo " SET ${fork}: ${current} → ${target}" -} - -# ---- Find all Cargo.toml that reference a Cat 2 fork by version requirement ---- -find_referencing_files() { - local fork="$1" - local target="$2" - # Search for any reference to a package name matching the fork - # (or its renamed package, like redox_syscall for syscall). - local package_names - case "$fork" in - syscall) package_names=("redox_syscall" "syscall") ;; - *) package_names=("$fork") ;; - esac - for name in "${package_names[@]}"; do - # Cargo dep lines: name = { ... version = "X.Y.Z" ... } - grep -rln --include="*.toml" \ - -E "^${name}\s*=\s*\{[^}]*version\s*=" \ - . 2>/dev/null \ - | grep -v "/target/" \ - | grep -v "/.git/" - done | sort -u -} - -# ---- Update version requirements for a fork across all referencing files ---- -# Args: <fork-name> <old-base-version> <new-target-version> -update_referencing_files() { - local fork="$1" - local old_base="$2" - local new_target="$3" - local files - files="$(find_referencing_files "$fork" "$new_target")" - if [[ -z "$files" ]]; then - return 0 - fi - echo " DEBUG update_referencing_files: files=$files" >&2 - # We need to update version requirements from "<old_base>" or - # "<old_base>-*" to "<new_target>". The trick is to be precise: - # we update the version field inside `{...}` blocks for THIS fork. - local package_names - case "$fork" in - syscall) package_names=("redox_syscall" "syscall") ;; - *) package_names=("$fork") ;; - esac - for f in $files; do - local changed=0 - for name in "${package_names[@]}"; do - if grep -qE "^${name}\s*=\s*\{" "$f"; then - local tmp - tmp="$(mktemp)" - awk -v name="$name" -v old="$old_base" -v new="$new_target" ' - BEGIN { in_block=0; depth=0 } - { - if (in_block) { - n_open = gsub(/\{/, "{") - n_close = gsub(/\}/, "}") - depth += n_open - n_close - if (depth == 0) { - in_block=0 - print - next - } - if ($0 ~ /version[[:space:]]*=/) { - gsub("version[[:space:]]*=[[:space:]]*\"" old "\"", "version = \"" new "\"") - } - print - next - } - if ($0 ~ "^"name"[[:space:]]*=[[:space:]]*\\{") { - in_block=1 - depth=1 - # Handle the entry line itself: it may carry - # the version= we want to update. - n_open = gsub(/\{/, "{") - n_close = gsub(/\}/, "}") - depth += n_open - n_close - if (depth == 0) { - in_block=0 - print - next - } - if ($0 ~ /version[[:space:]]*=/) { - gsub("version[[:space:]]*=[[:space:]]*\"" old "\"", "version = \"" new "\"") - } - print - next - } - print - } - ' "$f" > "$tmp" && mv "$tmp" "$f" - changed=1 - fi - done - if [[ $changed -eq 1 ]]; then - echo " REQ ${f}: ${old_base} → ${new_target}" - fi - done -} - -# ---- Phase 1: bump fork versions ---- -echo "=== Phase 1: update Cat 2 fork versions ===" -DRIFT=0 -for fork in "${CAT2_FORKS[@]}"; do - if ! update_fork_version "$fork"; then DRIFT=$((DRIFT + 1)) + else + sed -i "s|^version = \"${current}\"|version = \"${target}\"|" "$f" + echo " SET ${fork}: ${current} → ${target}" + APPLIED=$((APPLIED + 1)) fi done + echo "" -# ---- Phase 1.5: enforce no-fake-version-label rule ---- -# Per local/AGENTS.md § "No-fake-version-label rule", a `-rbN` version -# label is only valid when the source content matches the corresponding -# upstream release + documented Red Bear patches. Verify that the -# contents we just labelled actually correspond to the declared -# upstream tag before we declare success. Refuse to leave the working -# tree in a state where the version label is fake. -SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" -if [ -x "$SCRIPT_DIR/verify-fork-versions.sh" ]; then - if ! "$SCRIPT_DIR/verify-fork-versions.sh" 2>&1 | grep -q "^All Cat 2 forks pass"; then - echo "ERROR: After applying -rbN suffix, verify-fork-versions.sh found fake labels." >&2 - echo " The local source content does not match the declared upstream release." >&2 - echo " This is the no-fake-version-label policy violation." >&2 - echo " Inspect the upstream tag/branch mapping in local/fork-upstream-map.toml," >&2 - echo " update the fork's source content, then re-run apply-rb-suffix.sh." >&2 - if [ "$CHECK_ONLY" != "1" ]; then - exit 1 - fi - fi -fi - -# ---- Phase 2: update referencing files ---- -echo "=== Phase 2: update version requirements in path-dep consumers ===" -for fork in "${CAT2_FORKS[@]}"; do - current="$(get_current_version "$fork")" - [[ "$current" == "MISSING" ]] && continue - new_target="$current" - old_base="$(echo "$current" | sed -E 's/-rb[0-9]+$//')" - update_referencing_files "$fork" "$old_base" "$new_target" -done -echo "" - -# ---- Phase 3: summary ---- if [[ $CHECK_ONLY -eq 1 ]]; then if [[ $DRIFT -gt 0 ]]; then - echo "FAIL: $DRIFT fork(s) out of -rb suffix policy" + echo "FAIL: $DRIFT fork(s) out of policy (expected $RB_SUFFIX)" exit 1 fi - echo "PASS: all Cat 2 forks have -rb<RB_N> suffix" + echo "PASS: all Cat 2 forks have $RB_SUFFIX suffix" exit 0 fi -if [[ $ROLLBACK -eq 1 ]]; then - echo "Rolled back Cat 2 forks to stable X.Y.Z (no -rb suffix)" -else - echo "Applied -rb${RB_N} suffix to all Cat 2 forks" +echo "Applied $RB_SUFFIX suffix to $APPLIED fork(s)" + +# ---- Verify content matches upstream ---- +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +if [ -x "$SCRIPT_DIR/verify-fork-versions.sh" ]; then + if ! "$SCRIPT_DIR/verify-fork-versions.sh" 2>&1 | grep -q "^All Cat 2 forks pass"; then + echo "WARNING: verify-fork-versions.sh found content mismatches." >&2 + echo " The -rb suffix is applied but some forks may not match upstream." >&2 + fi fi diff --git a/local/scripts/build-preflight.sh b/local/scripts/build-preflight.sh old mode 100644 new mode 100755 index 120e3e9afa..3397c7467b --- a/local/scripts/build-preflight.sh +++ b/local/scripts/build-preflight.sh @@ -40,12 +40,13 @@ if [ -x "$SCRIPT_DIR/verify-overlay-integrity.sh" ]; then fi # Enforce the "no fake version label" rule (local/AGENTS.md): -# every Cat 2 fork's `<X.Y.Z>-rbN>` version must match the source -# content from upstream `<X.Y.Z>` + Red Bear patches. This runs before -# any recipe cook to fail fast. +# every Cat 2 fork's `<X.Y.Z>-rb<B.B.B>` version must match the source +# content from upstream `<X.Y.Z>` + Red Bear patches, and the `-rb<B.B.B>` +# suffix must match the current Red Bear OS git branch. if [ -x "$SCRIPT_DIR/verify-fork-versions.sh" ]; then - if ! "$SCRIPT_DIR/verify-fork-versions.sh" 2>&1 | grep -v "^All Cat 2 forks pass"; then + if ! "$SCRIPT_DIR/verify-fork-versions.sh" >/tmp/fork-verify.out 2>&1; then if [ "${REDBEAR_SKIP_FORK_VERIFY:-0}" != "1" ]; then + cat /tmp/fork-verify.out >&2 echo "ERROR: fork version verification failed." >&2 echo " Set REDBEAR_SKIP_FORK_VERIFY=1 to bypass (DANGEROUS, only for emergency)." >&2 exit 1 diff --git a/local/scripts/sync-versions.sh b/local/scripts/sync-versions.sh index f9c21feee0..1a7427a383 100755 --- a/local/scripts/sync-versions.sh +++ b/local/scripts/sync-versions.sh @@ -1,12 +1,23 @@ #!/usr/bin/env bash -# sync-versions.sh — Synchronise all in-house Red Bear crate versions to match -# the current git branch name (e.g. branch "0.2.4" → version "0.2.4"). +# sync-versions.sh — Synchronise ALL Red Bear crate versions to match the +# current git branch. # -# Policy: -# - In-house Red Bear crates (local/recipes/) MUST use the branch version. -# - Upstream Redox forks (local/sources/) keep their upstream versioning. -# - Established projects with their own versioning (tlc, zbus) are excluded. -# - Meson test-case crates are excluded. +# Handles BOTH version categories (local/AGENTS.md § "Version conventions"): +# +# Cat 1 — In-house Red Bear crates (local/recipes/*/source/): +# version = "<branch>" (e.g. "0.2.5") +# +# Cat 2 — Upstream Redox forks (local/sources/*/): +# version = "<upstream-base>-rb<branch>" (e.g. "0.9.0-rb0.2.5") +# +# When the branch changes (e.g. 0.2.5 → 0.2.6), running this script bumps +# Cat 1 versions to the new branch version AND updates Cat 2 suffixes to +# match the new branch version. The upstream base versions are preserved. +# +# Exclusions: +# - zbus (upstream zbus fork, keeps its own versioning) +# - tlc (established project with independent versioning) +# - Meson test-case crates # # Usage: # ./local/scripts/sync-versions.sh # Apply @@ -28,7 +39,7 @@ if [[ -z "$BRANCH" ]]; then exit 1 fi -# Extract semantic version from branch name (e.g. "0.2.4" from "0.2.4") +# Extract semantic version from branch name (e.g. "0.2.5" from "0.2.5") TARGET_VERSION="$(echo "$BRANCH" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' || true)" if [[ -z "$TARGET_VERSION" ]]; then echo "ERROR: branch '$BRANCH' does not contain a semantic version" >&2 @@ -36,6 +47,7 @@ if [[ -z "$TARGET_VERSION" ]]; then fi echo "Target version: $TARGET_VERSION (from branch '$BRANCH')" +echo "Cat 2 suffix: -rb$TARGET_VERSION" echo "" # ---- Exclusions ---- @@ -67,22 +79,28 @@ should_exclude() { return 1 } -# ---- Find and update Cargo.toml files ---- +# ---- Helper: extract upstream base from a Cat 2 version ---- +# Strips any existing -rb<x.y.z> suffix to get the upstream base version. +strip_rb_suffix() { + echo "$1" | sed -E 's/(-rb[0-9]+(\.[0-9]+\.[0-9]+)?)+$//' +} -CHANGED=0 -CHECKED=0 -DRIFT=0 +# ---- Phase 1: Cat 1 — In-house crates (local/recipes/*/source/) ---- + +echo "=== Phase 1: Cat 1 — In-house crates ===" + +CAT1_CHANGED=0 +CAT1_CHECKED=0 +CAT1_DRIFT=0 -# Find all Cargo.toml in local/recipes/ (source dirs only, skip target/) while IFS= read -r f; do - # Extract crate name (if present) name="$(grep '^name = ' "$f" 2>/dev/null | head -1 | sed 's/name = "//;s/"//' || true)" if should_exclude "$name" "$f"; then continue fi - CHECKED=$((CHECKED + 1)) + CAT1_CHECKED=$((CAT1_CHECKED + 1)) # Case 1: [package] version = "x.y.z" if grep -q '^version = "' "$f" 2>/dev/null; then @@ -90,11 +108,11 @@ while IFS= read -r f; do if [[ "$current" != "$TARGET_VERSION" ]]; then if [[ $CHECK_ONLY -eq 1 ]]; then echo " DRIFT: $name $current → $TARGET_VERSION ($f)" - DRIFT=$((DRIFT + 1)) + CAT1_DRIFT=$((CAT1_DRIFT + 1)) else sed -i "s/^version = \"$current\"/version = \"$TARGET_VERSION\"/" "$f" echo " UPDATED: $name $current → $TARGET_VERSION ($f)" - CHANGED=$((CHANGED + 1)) + CAT1_CHANGED=$((CAT1_CHANGED + 1)) fi fi fi @@ -105,10 +123,8 @@ while IFS= read -r f; do if [[ "$current" != "$TARGET_VERSION" ]]; then if [[ $CHECK_ONLY -eq 1 ]]; then echo " DRIFT (workspace): $current → $TARGET_VERSION ($f)" - DRIFT=$((DRIFT + 1)) + CAT1_DRIFT=$((CAT1_DRIFT + 1)) else - # Only replace the version line that appears under [workspace.package] - # Use awk for precision awk -v new="$TARGET_VERSION" ' /^\[workspace\.package\]/ { in_wp=1 } /^\[/ && !/^\[workspace\.package\]/ { in_wp=0 } @@ -116,7 +132,7 @@ while IFS= read -r f; do { print } ' "$f" > "${f}.tmp" && mv "${f}.tmp" "$f" echo " UPDATED (workspace): $current → $TARGET_VERSION ($f)" - CHANGED=$((CHANGED + 1)) + CAT1_CHANGED=$((CAT1_CHANGED + 1)) fi fi fi @@ -124,10 +140,74 @@ while IFS= read -r f; do done < <(find local/recipes/ -name "Cargo.toml" -not -path "*/target/*" -path "*/source/*" | sort) echo "" + +# ---- Phase 2: Cat 2 — Upstream forks (local/sources/*/) ---- + +echo "=== Phase 2: Cat 2 — Upstream forks ===" + +CAT2_CHANGED=0 +CAT2_CHECKED=0 +CAT2_DRIFT=0 + +RB_SUFFIX="-rb${TARGET_VERSION}" + +update_cat2_version() { + local f="$1" + local fork_name="$2" + + if ! grep -qE '^[[:space:]]*\[(package|workspace\.package)\]' "$f" 2>/dev/null; then + return 0 + fi + + local current target base + current="$(grep -E '^version\s*=' "$f" | head -1 | sed 's/.*"\(.*\)".*/\1/' || true)" + [[ -n "$current" ]] || return 0 + + # Strip any existing -rb<x.y.z> suffix to get upstream base + base="$(strip_rb_suffix "$current")" + target="${base}${RB_SUFFIX}" + + if [[ "$current" == "$target" ]]; then + return 0 + fi + + CAT2_CHECKED=$((CAT2_CHECKED + 1)) + + if [[ $CHECK_ONLY -eq 1 ]]; then + echo " DRIFT: $fork_name $current → $target ($f)" + CAT2_DRIFT=$((CAT2_DRIFT + 1)) + else + sed -i "s|^version = \"${current}\"|version = \"${target}\"|" "$f" + echo " UPDATED: $fork_name $current → $target ($f)" + CAT2_CHANGED=$((CAT2_CHANGED + 1)) + fi +} + +for fork_dir in local/sources/*/; do + [ -d "$fork_dir" ] || continue + fork_name=$(basename "$fork_dir") + # Skip non-submodule dirs (ctrlc, libpciaccess, redox-drm, sysinfo — empty stubs) + [ -f "${fork_dir}Cargo.toml" ] || continue + + # Try root Cargo.toml first + update_cat2_version "${fork_dir}Cargo.toml" "$fork_name" +done + +echo "" + +# ---- Summary ---- + if [[ $CHECK_ONLY -eq 1 ]]; then - echo "Checked $CHECKED crates, found $DRIFT with version drift" - [[ $DRIFT -gt 0 ]] && exit 1 - echo "All in-house crates are at $TARGET_VERSION" + echo "Cat 1: checked $CAT1_CHECKED, drift $CAT1_DRIFT" + echo "Cat 2: checked $CAT2_CHECKED, drift $CAT2_DRIFT" + TOTAL_DRIFT=$((CAT1_DRIFT + CAT2_DRIFT)) + if [[ $TOTAL_DRIFT -gt 0 ]]; then + echo "FAIL: $TOTAL_DRIFT version drift(s) found" + exit 1 + fi + echo "All crates are at correct versions for branch '$BRANCH'" else - echo "Updated $CHANGED crates to $TARGET_VERSION (checked $CHECKED total)" + echo "Cat 1: updated $CAT1_CHANGED (checked $CAT1_CHECKED)" + echo "Cat 2: updated $CAT2_CHANGED" + echo "All versions synced to branch '$BRANCH'" fi diff --git a/local/scripts/verify-fork-versions.sh b/local/scripts/verify-fork-versions.sh index 9df2524cdf..16dc0816e1 100755 --- a/local/scripts/verify-fork-versions.sh +++ b/local/scripts/verify-fork-versions.sh @@ -2,15 +2,15 @@ # verify-fork-versions.sh — Enforce the "no fake version label" rule. # # For each local Cat 2 fork under local/sources/<name>/ that has a -# version field of the form `<X.Y.Z>-rb<N>`, verify that: +# version field of the form `<X.Y.Z>-rb<B.B.B>`, verify that: # 1. The fork's source content is a real rebase onto the matching # upstream `<X.Y.Z>` release (with the Red Bear patches applied). -# 2. The `version` field in the fork's Cargo.toml starts with that +# 2. The `<B.B.B>` part matches the current Red Bear OS git branch. +# 3. The `version` field in the fork's Cargo.toml starts with that # upstream release tag. # # This script is invoked by build-preflight.sh and apply-rb-suffix.sh. -# It returns exit code 1 if any fork fails the check, with a clear -# error message identifying the fork and the specific mismatch. +# It returns exit code 1 if any fork fails the check. set -euo pipefail @@ -24,6 +24,9 @@ if [ ! -f "$MAP_FILE" ]; then exit 1 fi +BRANCH="$(git branch --show-current 2>/dev/null || echo "")" +BRANCH_VERSION="$(echo "$BRANCH" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' || true)" + violations=0 for fork_dir in local/sources/*/; do @@ -40,17 +43,13 @@ for fork_dir in local/sources/*/; do continue fi - # Extract the base version (before -rb) and the rb counter - base_version=$(echo "$version" | sed -E 's/-rb[0-9]+$//') || true - rb_n=$(echo "$version" | sed -E 's/^.*-rb([0-9]+)$/\1/') || true + # Extract the upstream base version (before -rb) and the branch version (after -rb) + base_version=$(echo "$version" | sed -E 's/-rb[0-9]+\.[0-9]+\.[0-9]+$//') || true + rb_branch=$(echo "$version" | sed -E 's/^.*-rb([0-9]+\.[0-9]+\.[0-9]+)$/\1/') || true - if [ -z "$base_version" ] || [ -z "$rb_n" ]; then - # If the base_version came out empty (e.g. version field is - # blank), we already detected & skipped in the empty-version - # case above. Reaching this branch with empty outputs means - # the version string is malformed (e.g. ends in `-rb` with - # no number). That is a fake-label failure. - echo "ERROR: $toml has malformed version '$version' (must be <X.Y.Z>-rb<N>)" >&2 + if [ -z "$base_version" ] || [ -z "$rb_branch" ]; then + echo "ERROR: $toml has malformed version '$version'" >&2 + echo " Expected format: <X.Y.Z>-rb<B.B.B> (e.g. 0.9.0-rb0.2.5)" >&2 violations=$((violations + 1)) continue fi @@ -64,16 +63,11 @@ for fork_dir in local/sources/*/; do fi upstream_url=$(echo "$map_line" | awk '{print $2}') upstream_tag=$(echo "$map_line" | awk '{print $3}') + fork_mode=$(echo "$map_line" | awk '{print $4}') - # If the upstream tag is `PENDING_REBASE` (used to mark a fork - # whose rebase is in progress), the build cannot proceed. Refuse - # with a clear error pointing the user to the rebase work. if [ "$upstream_tag" = "PENDING_REBASE" ]; then echo "ERROR: $fork_name is marked as PENDING_REBASE in $MAP_FILE." >&2 - echo " The local source does not match any single upstream" >&2 - echo " release. A real rebase onto a chosen upstream tag is" >&2 - echo " required. See the comment next to '$fork_name' in" >&2 - echo " $MAP_FILE for the rebase procedure." >&2 + echo " A real rebase onto a chosen upstream tag is required." >&2 violations=$((violations + 1)) continue fi @@ -81,11 +75,24 @@ for fork_dir in local/sources/*/; do if [ "$upstream_tag" != "$base_version" ]; then echo "ERROR: $fork_name Cargo.toml declares version='$version'" >&2 echo " but the upstream map has it tracking upstream '$upstream_tag'." >&2 - echo " Either update the version field or update the map." >&2 violations=$((violations + 1)) continue fi + # Verify the -rb suffix matches the current branch + if [ -n "$BRANCH_VERSION" ] && [ "$rb_branch" != "$BRANCH_VERSION" ]; then + echo "ERROR: $fork_name version suffix -rb$rb_branch does not match" >&2 + echo " current branch '$BRANCH' (expected -rb$BRANCH_VERSION)." >&2 + violations=$((violations + 1)) + continue + fi + + # Snapshot forks: skip content comparison (unrelated git histories). + # Version format and suffix are still verified above. + if [ "$fork_mode" = "snapshot" ]; then + continue + fi + # Fetch the upstream tag's tree hash upstream_hash=$(cd /tmp && git ls-remote --tags "$upstream_url" "refs/tags/$upstream_tag" 2>/dev/null | awk '{print $1}' | head -1) if [ -z "$upstream_hash" ]; then @@ -94,81 +101,50 @@ for fork_dir in local/sources/*/; do fi # Compare file lists: the local fork should have the same files as - # upstream at $upstream_hash, plus any Red Bear patch files in - # local/patches/$fork_name/. + # upstream at $upstream_hash, plus any Red Bear patch files. cd "$fork_dir" local_files=$(find . -type f -not -path './.git/*' -not -path './target/*' -not -path './Cargo.lock' | sort | sed 's|^\./||') cd /tmp rm -rf "verify-$fork_name" 2>/dev/null - # Shallow-clone the specific tag directly. `--depth 1 --branch <tag>` - # makes the tag the initial HEAD, so we have the file tree without - # having to fetch a specific commit (which `git clone --depth 1` - # can't reach on shallow clones because the commit is past the - # shallow boundary). - upstream_dir="verify-$fork_name-upstream" + upstream_dir="/tmp/verify-$fork_name-upstream" rm -rf "$upstream_dir" 2>/dev/null if ! timeout 60 git clone --depth 1 --branch "$upstream_tag" --quiet "$upstream_url" "$upstream_dir" 2>/dev/null; then echo "WARN: $fork_name: couldn't clone $upstream_url branch $upstream_tag, skipping content check" >&2 cd "$ROOT" continue fi - cd "$upstream_dir" - upstream_files=$(find . -type f -not -path './.git/*' -not -path './target/*' -not -path './Cargo.lock' | sort | sed 's|^\./||') + upstream_files=$(cd "$upstream_dir" && find . -type f -not -path './.git/*' -not -path './target/*' -not -path './Cargo.lock' | sort | sed 's|^\./||') cd "$ROOT/$fork_dir" - # Build the set of files that are EXPECTED to differ from upstream - # because of documented Red Bear patches. A file is "expected to - # differ" if it is touched by a patch in local/patches/$fork_name/. - # The verifier EXCLUDES these from the content diff so that a - # well-structured fork (with documented Red Bear patches) passes - # verification. + # Build the set of files expected to differ (documented Red Bear patches) patch_dir="$ROOT/local/patches/$fork_name" expected_differ=() if [ -d "$patch_dir" ]; then while IFS= read -r patch_file; do [ -z "$patch_file" ] && continue - # `git apply --stat` lists files touched by the patch. - # Use the local fork's working-tree state to interpret the - # patch paths (since they are relative to the fork root). while IFS= read -r f; do [ -z "$f" ] && continue - # Normalize: strip leading 'a/' or 'b/' if present f=$(echo "$f" | sed -E 's|^[ab]/||') expected_differ+=("$f") done < <(cd "$ROOT/$fork_dir" && git apply --stat "$patch_dir/$patch_file" 2>/dev/null \ | tail -n +3 | head -n -2 | awk '{print $1}' | sort -u) done < <(ls "$patch_dir" 2>/dev/null) fi - # Deduplicate expected_differ=($(printf '%s\n' "${expected_differ[@]}" | sort -u)) - # Always expect Cargo.toml and Cargo.toml.orig to differ (version field - # bump and auto-generated Cargo.toml are Red Bear bookkeeping). expected_differ+=("Cargo.toml") expected_differ+=("Cargo.toml.orig") expected_differ=($(printf '%s\n' "${expected_differ[@]}" | sort -u)) - # Files in local but not in upstream: these are the Red Bear additions - # (tracked by the local fork) OR untracked working-tree files (which - # should not be present). Files in upstream but not in local: these - # are missing patches (unacceptable). only_local=$(comm -23 <(echo "$local_files") <(echo "$upstream_files")) only_upstream=$(comm -13 <(echo "$local_files") <(echo "$upstream_files")) if [ -n "$only_upstream" ]; then - # Filter out files that are EXPECTED to be absent (e.g. deleted - # by a Red Bear patch). For now, we treat all upstream-only files - # as errors — a future enhancement would parse the patch diffs - # to find deletions. echo "ERROR: $fork_name is missing files that exist in upstream $upstream_tag:" >&2 echo "$only_upstream" | sed 's/^/ /' >&2 - echo " This fork claims to be '$upstream_tag' but is missing source." >&2 violations=$((violations + 1)) fi if [ -n "$only_local" ]; then - # Filter out files in local/patches/$fork_name/ (patches - # themselves, README, etc.) — those are Red Bear bookkeeping, - # not source files. local_non_patch=$(comm -23 <(echo "$local_files") \ <(cd "$ROOT" && find "local/patches/$fork_name" -type f 2>/dev/null | \ sed "s|^local/patches/$fork_name/||" | sort -u)) @@ -179,17 +155,14 @@ for fork_dir in local/sources/*/; do if [ "$count" -gt 10 ]; then echo " ... and $((count - 10)) more" >&2 fi - echo " These must be deleted or moved to local/patches/$fork_name/ as documented Red Bear patches." >&2 violations=$((violations + 1)) fi fi - # Verify content of shared files. Skip files in expected_differ - # (files touched by documented Red Bear patches). + # Verify content of shared files (skip files touched by Red Bear patches) diff_count=0 while IFS= read -r f; do [ -z "$f" ] && continue - # Skip if this file is in expected_differ skip=0 for ed in "${expected_differ[@]}"; do if [ "$f" = "$ed" ]; then @@ -208,8 +181,6 @@ for fork_dir in local/sources/*/; do done <<< "$(comm -12 <(echo "$local_files") <(echo "$upstream_files"))" if [ "$diff_count" -gt 0 ]; then - echo " These must either be re-rebased onto $upstream_tag OR" >&2 - echo " moved to local/patches/$fork_name/ as documented Red Bear patches." >&2 violations=$((violations + 1)) fi @@ -219,8 +190,6 @@ done if [ "$violations" -gt 0 ]; then echo "" >&2 echo "FAIL: $violations fork version violations found." >&2 - echo " Run local/scripts/refresh-fork-upstream-map.sh and" >&2 - echo " local/scripts/apply-rb-suffix.sh to fix the offending forks." >&2 exit 1 fi diff --git a/local/sources/base b/local/sources/base index 4bfb878b55..e653ef10d6 160000 --- a/local/sources/base +++ b/local/sources/base @@ -1 +1 @@ -Subproject commit 4bfb878b55fbb4cd4a2fcb290df885ac4aef53d3 +Subproject commit e653ef10d664c82cfec9334d0bb87d4a72248a8d diff --git a/local/sources/bootloader b/local/sources/bootloader index 3cc7ed909c..e7bc6a56dc 160000 --- a/local/sources/bootloader +++ b/local/sources/bootloader @@ -1 +1 @@ -Subproject commit 3cc7ed909caf6e59f925753016dfe5c53520088a +Subproject commit e7bc6a56dcc7222b8349d2fbe0e5d422b4c71920 diff --git a/local/sources/installer b/local/sources/installer index 8d1bad9eb4..e604868baf 160000 --- a/local/sources/installer +++ b/local/sources/installer @@ -1 +1 @@ -Subproject commit 8d1bad9eb440516497faa47e1e9dcf46b16aaf42 +Subproject commit e604868baf05bbcc7615b3fef4523c5055db6b4c diff --git a/local/sources/kernel b/local/sources/kernel index f95576841d..71f189ba04 160000 --- a/local/sources/kernel +++ b/local/sources/kernel @@ -1 +1 @@ -Subproject commit f95576841d84ec6ed798061e9006e555a45eb0c6 +Subproject commit 71f189ba047ee6976ed71a7343409f46017109cd diff --git a/local/sources/libredox b/local/sources/libredox index 8a4014fb3c..4a578129b2 160000 --- a/local/sources/libredox +++ b/local/sources/libredox @@ -1 +1 @@ -Subproject commit 8a4014fb3cf99b10f06afa70bf2196918d5a70d8 +Subproject commit 4a578129b2e5f6d676b5404f0343cf9d599b1292 diff --git a/local/sources/redox-scheme/Cargo.toml b/local/sources/redox-scheme/Cargo.toml index 1256443340..cd398a588c 100644 --- a/local/sources/redox-scheme/Cargo.toml +++ b/local/sources/redox-scheme/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "redox-scheme" -authors = ["4lDO2 <4lDO2@protonmail.com>"] -# Local fork: upstream 0.11.2 + Red Bear -rb1 version policy. +authors = ["4lDO2 <4lDO2@protonmail.com>", "vasilito <adminpupkin@gmail.com>"] +# Local fork: upstream 0.11.2 + Red Bear +rb0.2.5 version policy. # See local/AGENTS.md § "Category 2 — Local forks of upstream packages". -version = "0.11.2-rb1" +version = "0.11.2+rb0.2.5" edition = "2024" license = "MIT" exclude = ["target"] @@ -15,5 +15,9 @@ default = ["std"] std = [] [dependencies] -redox_syscall = "0.9.0-rb1" -libredox = { version = "0.1.18-rb1", default-features = false, features = ["redox_syscall", "call"] } +redox_syscall = { path = "../syscall" } +libredox = { path = "../libredox", default-features = false, features = ["redox_syscall", "call"] } + +[patch.crates-io] +redox_syscall = { path = "../syscall" } +libredox = { path = "../libredox" } diff --git a/local/sources/redox-scheme/Cargo.toml.orig b/local/sources/redox-scheme/Cargo.toml.orig index a1d461a392..2c46ec21fc 100644 --- a/local/sources/redox-scheme/Cargo.toml.orig +++ b/local/sources/redox-scheme/Cargo.toml.orig @@ -1,7 +1,7 @@ [package] name = "redox-scheme" authors = ["4lDO2 <4lDO2@protonmail.com>"] -# Local fork: upstream 0.11.2 + Red Bear -rb1 version policy. +# Local fork: upstream 0.11.2 + Red Bear -rb0.2.5 version policy. # See local/AGENTS.md § "Category 2 — Local forks of upstream packages". version = "0.11.2-rb1" edition = "2024" @@ -18,5 +18,5 @@ default = ["std"] std = [] [dependencies] -redox_syscall = "0.9.0-rb1" -libredox = { version = "0.1.18-rb1", default-features = false, features = ["redox_syscall", "call"] } +redox_syscall = "0.9.0-rb0.2.5" +libredox = { version = "0.1.18-rb0.2.5", default-features = false, features = ["redox_syscall", "call"] } diff --git a/local/sources/redoxfs b/local/sources/redoxfs index d47cd7d3f6..f29cbc3dfe 160000 --- a/local/sources/redoxfs +++ b/local/sources/redoxfs @@ -1 +1 @@ -Subproject commit d47cd7d3f6e957e7212c94c0d498b62d4044b8af +Subproject commit f29cbc3dfecf81d5bf57eef6274a92ecd3f61ad9 diff --git a/local/sources/relibc b/local/sources/relibc index 68ed35f243..c81fe5fc98 160000 --- a/local/sources/relibc +++ b/local/sources/relibc @@ -1 +1 @@ -Subproject commit 68ed35f2437787f5af4ffce73ab041a88f65827b +Subproject commit c81fe5fc98090789af1d11823010cd627d854e31 diff --git a/local/sources/userutils b/local/sources/userutils index 5dc4a8364e..e5c076b0ea 160000 --- a/local/sources/userutils +++ b/local/sources/userutils @@ -1 +1 @@ -Subproject commit 5dc4a8364eb2baa89f76e1e9444f30a458513738 +Subproject commit e5c076b0ea6654c9ad16df7107921cea8bc90836 diff --git a/recipes/core/base/libredox b/recipes/core/base/libredox new file mode 120000 index 0000000000..083ac86176 --- /dev/null +++ b/recipes/core/base/libredox @@ -0,0 +1 @@ +../../../local/sources/libredox \ No newline at end of file diff --git a/recipes/core/base/syscall b/recipes/core/base/syscall new file mode 120000 index 0000000000..ba6a37507b --- /dev/null +++ b/recipes/core/base/syscall @@ -0,0 +1 @@ +../../../local/sources/syscall \ No newline at end of file diff --git a/recipes/libs/libffi/recipe.toml b/recipes/libs/libffi/recipe.toml index 8851cfceae..5c70decd33 100644 --- a/recipes/libs/libffi/recipe.toml +++ b/recipes/libs/libffi/recipe.toml @@ -14,5 +14,8 @@ autotools_recursive_regenerate -I$(realpath ./m4) template = "custom" script = """ DYNAMIC_STATIC_INIT +COOKBOOK_CONFIGURE_FLAGS+=( + --with-pic +) cookbook_configure """ \ No newline at end of file diff --git a/recipes/tools/xz/recipe.toml b/recipes/tools/xz/recipe.toml index b3d25b6724..930b0a9199 100644 --- a/recipes/tools/xz/recipe.toml +++ b/recipes/tools/xz/recipe.toml @@ -15,6 +15,7 @@ COOKBOOK_CONFIGURE_FLAGS+=( --disable-xz --disable-xzdec --enable-threads=no + --with-pic ) cookbook_configure """ diff --git a/recipes/wip/qt/qtshadertools b/recipes/wip/qt/qtshadertools new file mode 120000 index 0000000000..ad582ce34e --- /dev/null +++ b/recipes/wip/qt/qtshadertools @@ -0,0 +1 @@ +../../../local/recipes/qt/qtshadertools \ No newline at end of file diff --git a/recipes/wip/qt/qtshadertools/recipe.toml b/recipes/wip/qt/qtshadertools/recipe.toml deleted file mode 100644 index 81de54e800..0000000000 --- a/recipes/wip/qt/qtshadertools/recipe.toml +++ /dev/null @@ -1,263 +0,0 @@ -#TODO: Qt6 shader tools — provides libQt6ShaderTools and the qsb host tool used by -# Qt Quick for runtime shader compilation. Host-side Qt6ShaderToolsTools metadata and qsb -# must be propagated into the shared QT_HOST_PATH for downstream modules to configure cleanly. -# Depends on qtbase being built first. -[build] -template = "custom" -dependencies = [ - "qtbase", -] -script = """ -DYNAMIC_INIT - -source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" - -HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" -SHADER_HOST="${COOKBOOK_ROOT}/build/qt-shadertools-host" -SHADER_HOST_SRC="${COOKBOOK_ROOT}/build/qt-shadertools-host-src" - -mkdir -p "${HOST_BUILD}/include/QtGui/6.11.0/QtGui" - -QTBASE_STAGE="${COOKBOOK_ROOT}/recipes/wip/qt/qtbase/target/${TARGET}/stage/usr" -if [ -d "${QTBASE_STAGE}/include/QtGui" ] && [ ! -d "${COOKBOOK_SYSROOT}/include/QtGui" ]; then - mkdir -p "${COOKBOOK_SYSROOT}/include" - cp -a "${QTBASE_STAGE}/include/QtGui" "${COOKBOOK_SYSROOT}/include/" -fi -QTBASE_BUILD_INCLUDE="${COOKBOOK_ROOT}/recipes/wip/qt/qtbase/target/${TARGET}/build/include/QtGui" -if [ -d "${QTBASE_BUILD_INCLUDE}/6.11.0/QtGui/rhi" ]; then - mkdir -p "${COOKBOOK_SYSROOT}/include/QtGui/6.11.0" - cp -a "${QTBASE_BUILD_INCLUDE}/6.11.0/QtGui" "${COOKBOOK_SYSROOT}/include/QtGui/6.11.0/" - mkdir -p "${COOKBOOK_SYSROOT}/include" - cp -a "${QTBASE_BUILD_INCLUDE}/6.11.0/QtGui/rhi" "${COOKBOOK_SYSROOT}/include/" -fi -export CPPFLAGS="${CPPFLAGS} -I${COOKBOOK_SYSROOT}/include/QtGui/6.11.0/QtGui" -export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include/QtGui/6.11.0/QtGui" -export CXXFLAGS="${CXXFLAGS} -I${COOKBOOK_SYSROOT}/include/QtGui/6.11.0/QtGui" - -python - <<'PY' -import os -from pathlib import Path -root = Path(os.environ["COOKBOOK_ROOT"]) -sysroot = Path(os.environ["COOKBOOK_SYSROOT"]) -src = Path(os.environ["COOKBOOK_SOURCE"]) / "src/shadertools" -shim_dir = src / "redbear_rhi" -shim_dir.mkdir(exist_ok=True) - -qshader_src = (root / "recipes/wip/qt/qtbase/source/src/gui/rhi/qshader.h").read_text() -qguiglobal_src = (sysroot / "include/QtGui/qtguiglobal.h").read_text() -qguiglobal_src = qguiglobal_src.replace('#include <QtCore/qglobal.h>', f'#include "{sysroot / "include/QtCore/qglobal.h"}"') -qguiglobal_src = qguiglobal_src.replace('#include <QtGui/qtgui-config.h>', f'#include "{sysroot / "include/QtGui/qtgui-config.h"}"') -qguiglobal_src = qguiglobal_src.replace('#include <QtGui/qtguiexports.h>', f'#include "{sysroot / "include/QtGui/qtguiexports.h"}"') -(shim_dir / 'qtguiglobal_redbear.h').write_text(qguiglobal_src) - -qshader_src = qshader_src.replace('#include <QtGui/qtguiglobal.h>', '#include "qtguiglobal_redbear.h"') -qshader_src = qshader_src.replace('#include <QtCore/qhash.h>', f'#include "{sysroot / "include/QtCore/qhash.h"}"') -qshader_src = qshader_src.replace('#include <QtCore/qmap.h>', f'#include "{sysroot / "include/QtCore/qmap.h"}"') -qshader_src = qshader_src.replace('#include <rhi/qshaderdescription.h>', '#include "qshaderdescription_redbear.h"') -(shim_dir / 'qshader_redbear.h').write_text(qshader_src) - -qshaderdesc_src = (root / "recipes/wip/qt/qtbase/source/src/gui/rhi/qshaderdescription.h").read_text() -qshaderdesc_src = qshaderdesc_src.replace('#include <QtGui/qtguiglobal.h>', '#include "qtguiglobal_redbear.h"') -qshaderdesc_src = qshaderdesc_src.replace('#include <QtCore/qstring.h>', f'#include "{sysroot / "include/QtCore/qstring.h"}"') -qshaderdesc_src = qshaderdesc_src.replace('#include <QtCore/qlist.h>', f'#include "{sysroot / "include/QtCore/qlist.h"}"') -(shim_dir / 'qshaderdescription_redbear.h').write_text(qshaderdesc_src) - -qshaderdesc_p_src = (root / "recipes/wip/qt/qtbase/source/src/gui/rhi/qshaderdescription_p.h").read_text() -qshaderdesc_p_src = qshaderdesc_p_src.replace('#include <rhi/qshaderdescription.h>', '#include "qshaderdescription_redbear.h"') -qshaderdesc_p_src = qshaderdesc_p_src.replace('#include <QtCore/QList>', f'#include "{sysroot / "include/QtCore/QList"}"') -qshaderdesc_p_src = qshaderdesc_p_src.replace('#include <QtCore/QAtomicInt>', f'#include "{sysroot / "include/QtCore/QAtomicInt"}"') -qshaderdesc_p_src = qshaderdesc_p_src.replace('#include <QtCore/QJsonDocument>', f'#include "{sysroot / "include/QtCore/QJsonDocument"}"') -(shim_dir / 'qshaderdescription_p_redbear.h').write_text(qshaderdesc_p_src) - -qshader_p_src = (root / "recipes/wip/qt/qtbase/source/src/gui/rhi/qshader_p.h").read_text() -qtguiglobal_p_src = (root / "recipes/wip/qt/qtbase/source/src/gui/kernel/qtguiglobal_p.h").read_text() -qglobal_p_src = (root / "recipes/wip/qt/qtbase/source/src/corelib/global/qglobal_p.h").read_text() -qtcoreglobal_p_src = (root / "recipes/wip/qt/qtbase/source/src/corelib/global/qtcoreglobal_p.h").read_text() -qtcoreglobal_p_src = qtcoreglobal_p_src.replace('#include <QtCore/qglobal.h>', f'#include "{sysroot / "include/QtCore/qglobal.h"}"') -qtcoreglobal_p_src = qtcoreglobal_p_src.replace('#include <QtCore/private/qconfig_p.h>', f'#include "{root / "recipes/wip/qt/qtbase/target" / os.environ["TARGET"] / "stage/usr/include/QtCore/6.11.0/QtCore/private/qconfig_p.h"}"') -(shim_dir / 'qtcoreglobal_p_redbear.h').write_text(qtcoreglobal_p_src) - -qglobal_p_src = qglobal_p_src.replace('#include "qglobal.h"', f'#include "{sysroot / "include/QtCore/qglobal.h"}"') -qglobal_p_src = qglobal_p_src.replace('#include "qglobal_p.h" // include self to avoid syncqt warning - no-op', '// self-include removed for Red Bear shim') -qglobal_p_src = qglobal_p_src.replace('#include <QtCore/private/qtcoreglobal_p.h>', '#include "qtcoreglobal_p_redbear.h"') -(shim_dir / 'qglobal_p_redbear.h').write_text(qglobal_p_src) - -qtguiglobal_p_src = qtguiglobal_p_src.replace('#include <QtGui/qtguiglobal.h>', '#include "qtguiglobal_redbear.h"') -qtguiglobal_p_src = qtguiglobal_p_src.replace('#include <QtGui/private/qtgui-config_p.h>', f'#include "{root / "recipes/wip/qt/qtbase/target" / os.environ["TARGET"] / "stage/usr/include/QtGui/6.11.0/QtGui/private/qtgui-config_p.h"}"') -qtguiglobal_p_src = qtguiglobal_p_src.replace('#include <QtCore/private/qglobal_p.h>', '#include "qglobal_p_redbear.h"') -(shim_dir / 'qtguiglobal_p_redbear.h').write_text(qtguiglobal_p_src) - -qshader_p_src = qshader_p_src.replace('#include <QtGui/private/qtguiglobal_p.h>', '#include "qtguiglobal_p_redbear.h"') -qshader_p_src = qshader_p_src.replace('#include <rhi/qshader.h>', '#include "qshader_redbear.h"') -qshader_p_src = qshader_p_src.replace('#include <QtCore/QAtomicInt>', f'#include "{sysroot / "include/QtCore/QAtomicInt"}"') -qshader_p_src = qshader_p_src.replace('#include <QtCore/QMap>', f'#include "{sysroot / "include/QtCore/QMap"}"') -(shim_dir / 'qshader_p_redbear.h').write_text(qshader_p_src) - -target = shim_dir / 'qshader_redbear.h' -for rel in ["qshaderbaker.h", "qspirvcompiler_p.h", "qspirvshader_p.h"]: - path = src / rel - text = path.read_text() - text = text.replace('#include <QtGui/6.11.0/QtGui/rhi/qshader.h>', f'#include "{target}"') - text = text.replace('#include <rhi/qshader.h>', f'#include "{target}"') - text = text.replace(f'#include "{root / "recipes/wip/qt/qtbase/source/src/gui/rhi/qshader.h"}"', f'#include "{target}"') - path.write_text(text) - -qspirvshader_cpp = src / 'qspirvshader.cpp' -text = qspirvshader_cpp.read_text() -text = text.replace('#include <private/qshaderdescription_p.h>', '#include "redbear_rhi/qshaderdescription_p_redbear.h"') -text = text.replace('#include <private/qshader_p.h>', '#include "redbear_rhi/qshader_p_redbear.h"') -text = text.replace(f'#include "{root / "recipes/wip/qt/qtbase/source/src/gui/rhi/private/qshaderdescription_p.h"}"', '#include "redbear_rhi/qshaderdescription_p_redbear.h"') -text = text.replace(f'#include "{root / "recipes/wip/qt/qtbase/source/src/gui/rhi/private/qshader_p.h"}"', '#include "redbear_rhi/qshader_p_redbear.h"') -text = text.replace(f'#include "{root / "recipes/wip/qt/qtbase/source/src/gui/rhi/qshaderdescription_p.h"}"', '#include "redbear_rhi/qshaderdescription_p_redbear.h"') -text = text.replace(f'#include "{root / "recipes/wip/qt/qtbase/source/src/gui/rhi/qshader_p.h"}"', '#include "redbear_rhi/qshader_p_redbear.h"') -qspirvshader_cpp.write_text(text) - -qsb_cpp = Path(os.environ["COOKBOOK_SOURCE"]) / "tools/qsb/qsb.cpp" -text = qsb_cpp.read_text() -text = text.replace('#include <QtGui/private/qshader_p.h>', '#include "../../src/shadertools/redbear_rhi/qshader_p_redbear.h"') -qsb_cpp.write_text(text) - -tools_cmake = Path(os.environ["COOKBOOK_SOURCE"]) / "tools/CMakeLists.txt" -text = tools_cmake.read_text() -text = text.replace('# add_subdirectory(qsb) # disabled in Red Bear target build; host qsb is built separately', 'add_subdirectory(qsb)') -tools_cmake.write_text(text) - -PY - -# ============================================================ -# Step 1: Build host qsb from the module top-level so Qt's repo macros resolve. -# ============================================================ -if [ ! -f "${HOST_BUILD}/bin/qsb" ]; then - echo "=== Building qsb host tool ===" - rm -rf "${SHADER_HOST}" - rm -rf "${SHADER_HOST_SRC}" - mkdir -p "${SHADER_HOST}" - mkdir -p "${SHADER_HOST_SRC}" - tar -xf "${COOKBOOK_RECIPE}/source.tar" -C "${SHADER_HOST_SRC}" --strip-components=1 - env \ - -u CPPFLAGS \ - -u LDFLAGS \ - -u PKG_CONFIG_ALLOW_CROSS \ - -u PKG_CONFIG_PATH \ - -u PKG_CONFIG_LIBDIR \ - -u PKG_CONFIG_SYSROOT_DIR \ - -u CFLAGS \ - -u CXXFLAGS \ - -u CFLAGS_x86_64_unknown_redox \ - -u CXXFLAGS_x86_64_unknown_redox \ - -u LDFLAGS_x86_64_unknown_redox \ - cmake -S "${SHADER_HOST_SRC}" -B "${SHADER_HOST}" \ - -DCMAKE_C_COMPILER=/usr/bin/cc \ - -DCMAKE_CXX_COMPILER=/usr/bin/c++ \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX="${HOST_BUILD}" \ - -DCMAKE_PREFIX_PATH="${HOST_BUILD}" \ - -DQT_BUILD_EXAMPLES=OFF \ - -DQT_BUILD_TESTS=OFF \ - -DQT_GENERATE_SBOM=OFF \ - -Wno-dev - cmake --build "${SHADER_HOST}" --target qsb -j"${COOKBOOK_MAKE_JOBS}" - cmake --install "${SHADER_HOST}" --prefix "${HOST_BUILD}" -fi - -python - <<'PY' -import os -from pathlib import Path -tools_cmake = Path(os.environ["COOKBOOK_SOURCE"]) / "tools/CMakeLists.txt" -text = tools_cmake.read_text() -text = text.replace('add_subdirectory(qsb)', '# add_subdirectory(qsb) # disabled in Red Bear target build; host qsb is built separately') -tools_cmake.write_text(text) -PY - -# ============================================================ -# Step 2: Cross-compile libQt6ShaderTools for Redox -# ============================================================ -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done - -rm -f CMakeCache.txt -rm -rf CMakeFiles - -cmake "${COOKBOOK_SOURCE}" \ - -DCMAKE_TOOLCHAIN_FILE="${COOKBOOK_ROOT}/local/recipes/qt/redox-toolchain.cmake" \ - -DQT_HOST_PATH="${HOST_BUILD}" \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}" \ - -DCMAKE_C_STANDARD_INCLUDE_DIRECTORIES="${COOKBOOK_SYSROOT}/include/QtGui/6.11.0/QtGui" \ - -DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES="${COOKBOOK_SYSROOT}/include/QtGui/6.11.0/QtGui" \ - -DCMAKE_C_FLAGS="${CFLAGS}" \ - -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \ - -DQT_BUILD_EXAMPLES=OFF \ - -DQT_BUILD_TESTS=OFF \ - -DQT_GENERATE_SBOM=OFF \ - -Wno-dev - -cmake --build . -j${COOKBOOK_MAKE_JOBS} - -cmake --install . --prefix "${COOKBOOK_STAGE}/usr" - -# ============================================================ -# Step 3: Stage artifacts -# ============================================================ -for lib in lib/libQt6*.so*; do - [ -f "${lib}" ] && cp -a "${lib}" "${COOKBOOK_STAGE}/usr/lib/" -done -for lib in lib/libQt6*.a; do - [ -f "${lib}" ] && cp -a "${lib}" "${COOKBOOK_STAGE}/usr/lib/" -done - -if [ -d "lib/cmake" ]; then - mkdir -p "${COOKBOOK_STAGE}/usr/lib/cmake" - cp -a lib/cmake/Qt6* "${COOKBOOK_STAGE}/usr/lib/cmake/" 2>/dev/null || true -fi -if [ -d "lib/pkgconfig" ]; then - mkdir -p "${COOKBOOK_STAGE}/usr/lib/pkgconfig" - cp -a lib/pkgconfig/*.pc "${COOKBOOK_STAGE}/usr/lib/pkgconfig/" 2>/dev/null || true -fi -if [ -d "include" ]; then - mkdir -p "${COOKBOOK_STAGE}/usr/include" - cp -a include/* "${COOKBOOK_STAGE}/usr/include/" 2>/dev/null || true -fi -if [ -d "plugins" ]; then - mkdir -p "${COOKBOOK_STAGE}/usr/plugins" - cp -a plugins/* "${COOKBOOK_STAGE}/usr/plugins/" 2>/dev/null || true -fi - -# RPATH cleanup -for lib in "${COOKBOOK_STAGE}/usr/lib/libQt6"*.so.*; do - [ -f "${lib}" ] || continue - patchelf --remove-rpath "${lib}" 2>/dev/null || true -done -find "${COOKBOOK_STAGE}/usr/plugins" -name '*.so' -exec patchelf --remove-rpath {} + 2>/dev/null || true - -# CMake export fixup and sysroot propagation for downstream Qt modules -BUILD_DIR="${COOKBOOK_BUILD}" -STAGE_USR="${COOKBOOK_STAGE}/usr" -SYSROOT="${COOKBOOK_SYSROOT}" -redbear_qt_rewrite_stage_build_paths "${STAGE_USR}" "${BUILD_DIR}" -redbear_qt_rewrite_stage_include_paths "${STAGE_USR}/lib/cmake/Qt6ShaderTools" "${SYSROOT}" -redbear_qt_rewrite_usr_src_metatype_paths "${STAGE_USR}/lib/cmake/Qt6ShaderTools" "${SYSROOT}" -redbear_qt_rewrite_stage_lib_paths "${STAGE_USR}/lib/cmake/Qt6ShaderTools" "${SYSROOT}" -redbear_qt_rewrite_stage_include_paths "${STAGE_USR}/lib/cmake/Qt6ShaderToolsPrivate" "${SYSROOT}" -redbear_qt_rewrite_usr_src_metatype_paths "${STAGE_USR}/lib/cmake/Qt6ShaderToolsPrivate" "${SYSROOT}" -redbear_qt_rewrite_stage_lib_paths "${STAGE_USR}/lib/cmake/Qt6ShaderToolsPrivate" "${SYSROOT}" -redbear_qt_rewrite_stage_path_literal "${STAGE_USR}/lib/cmake/Qt6ShaderToolsPrivate" "/usr/src/shadertools" "${SYSROOT}/include/QtShaderTools" -redbear_qt_copy_common_stage_to_sysroot "${STAGE_USR}" "${SYSROOT}" -redbear_qt_copy_stage_cmake_subdir_to_sysroot "${STAGE_USR}" "${SYSROOT}" "Qt6ShaderTools" -redbear_qt_copy_stage_cmake_subdir_to_sysroot "${STAGE_USR}" "${SYSROOT}" "Qt6ShaderToolsPrivate" - -# Ensure qsb is staged for downstream consumers. -if [ -f "${HOST_BUILD}/bin/qsb" ]; then - mkdir -p "${COOKBOOK_STAGE}/usr/bin" - cp -a "${HOST_BUILD}/bin/qsb" "${COOKBOOK_STAGE}/usr/bin/" - patchelf --remove-rpath "${COOKBOOK_STAGE}/usr/bin/qsb" 2>/dev/null || true -fi -""" - -[source] -tar = "https://download.qt.io/official_releases/qt/6.11/6.11.0/submodules/qtshadertools-everywhere-src-6.11.0.tar.xz" -blake3 = "7d11bdaaeb7f823e0d168d0864413e76274e110ccdab499ae20479d1942198b9" diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000000..f328e4d9d0 --- /dev/null +++ b/src/main.rs @@ -0,0 +1 @@ +fn main() {}